diff --git a/EngineOptions.lua b/EngineOptions.lua index 0af1df64898..71bd6f8ea46 100644 --- a/EngineOptions.lua +++ b/EngineOptions.lua @@ -25,24 +25,23 @@ -- Example EngineOptions.lua -- -local options = -{ +local options = { { - key="engineoptions", - name="Engine Options", - desc="Engine Options", - type="section", + key = "engineoptions", + name = "Engine Options", + desc = "Engine Options", + type = "section", }, { - key = 'maxunits', - name = 'Max units', - desc = 'Maximum number of units (including buildings) for each team allowed at the same time', - type = 'number', - section= 'engineoptions', - def = 2000, - min = 1, - max = 10000, --- engine caps at lower limit if more than 3 team are ingame - step = 1, + key = "maxunits", + name = "Max units", + desc = "Maximum number of units (including buildings) for each team allowed at the same time", + type = "number", + section = "engineoptions", + def = 2000, + min = 1, + max = 10000, --- engine caps at lower limit if more than 3 team are ingame + step = 1, }, } diff --git a/common/SetList.lua b/common/SetList.lua index 50b9a589edc..c171512105b 100644 --- a/common/SetList.lua +++ b/common/SetList.lua @@ -2,11 +2,15 @@ -- A SetList is a data structure used for storing only keys, any key is valid (no values!) -- It consists of a hash part for fast containment checks -- And a list part for fast random generation -local function tstr(t,n) - if t==nil then return end - local res = tostring(n or "") .. ' {' - for k,v in pairs(t) do res = res .. tostring(k) .. "=" .. tostring(v) ..", " end - print( res .. '}') +local function tstr(t, n) + if t == nil then + return + end + local res = tostring(n or "") .. " {" + for k, v in pairs(t) do + res = res .. tostring(k) .. "=" .. tostring(v) .. ", " + end + print(res .. "}") end local mRandom = math.random @@ -15,39 +19,39 @@ SetListMT.__index = SetListMT function SetListMT:Add(key) if self.hash[key] == nil then -- So that we dont add twice self.count = self.count + 1 - self.hash[key] = self.count + self.hash[key] = self.count self.list[self.count] = key end end function SetListMT:Remove(key) local popindex = self.hash[key] if popindex then - if popindex ~= self.count then + if popindex ~= self.count then -- If not last element, then take the element at the very back, and emplace it at popindex local popkey = self.list[self.count] - self.list[popindex] = popkey -- bring it back in list + self.list[popindex] = popkey -- bring it back in list self.hash[popkey] = popindex end self.list[self.count] = nil - self.hash[key] = nil + self.hash[key] = nil self.count = self.count - 1 end - end function SetListMT:GetRandom() - if self.count > 0 then return self.list[mRandom(1, self.count)] end + if self.count > 0 then + return self.list[mRandom(1, self.count)] + end end local function NewSetList() local t = { - hash = {}, -- Hash table map keys to positions in list + hash = {}, -- Hash table map keys to positions in list list = {}, -- List table maps positions in list to keys count = 0, -- Keeps a tally of how many elements - } + } setmetatable(t, SetListMT) return t end - -- A SetListMin is a data structure used for storing only positive integer keys or strings (no values!) -- It consists of only a hash part. Negative numbers are not allowed local setListMinMT = {} @@ -62,30 +66,31 @@ end function setListMinMT:Remove(key) local popindex = self.hash[key] if popindex then - if popindex ~= self.count then + if popindex ~= self.count then -- If not last element, then take the element at the very back, and emplace it at popindex local popkey = self.hash[-1 * self.count] - self.hash[-1 * popindex] = popkey -- bring it back in list + self.hash[-1 * popindex] = popkey -- bring it back in list self.hash[popkey] = popindex end - self.hash[-1* self.count] = nil - self.hash[key] = nil + self.hash[-1 * self.count] = nil + self.hash[key] = nil self.count = self.count - 1 end end function setListMinMT:GetRandom() - if self.count > 0 then return self.hash[-1 * mRandom(1, self.count)] end + if self.count > 0 then + return self.hash[-1 * mRandom(1, self.count)] + end end local function NewSetListMin() local t = { - hash = {}, -- Hash table map keys to positions in list + hash = {}, -- Hash table map keys to positions in list count = 0, -- Keeps a tally of how many elements - } + } setmetatable(t, setListMinMT) return t end - -- A SetListNoTable is a data structure used for storing only positive integer keys, or string keys which arent called 'count' -- It consists of only the table itself. Negative numbers are not allowed @@ -101,30 +106,32 @@ end function SetListNoTableMT:Remove(key) local popindex = self[key] if popindex then - if popindex ~= self.count then + if popindex ~= self.count then -- If not last element, then take the element at the very back, and emplace it at popindex local popkey = self[-1 * self.count] - self[-1 * popindex] = popkey -- bring it back in list + self[-1 * popindex] = popkey -- bring it back in list self[popkey] = popindex end self[-1 * self.count] = nil - self[key] = nil + self[key] = nil self.count = self.count - 1 end end function SetListNoTableMT:GetRandom() - if self.count > 0 then return self[-1 * mRandom(1, self.count)] end + if self.count > 0 then + return self[-1 * mRandom(1, self.count)] + end end local function NewSetListNoTable() - local t = {count = 0} -- Keeps a tally of how many elements + local t = { count = 0 } -- Keeps a tally of how many elements setmetatable(t, SetListNoTableMT) return t end local SetListUtilities = { NewSetListNoTable = NewSetListNoTable, - NewSetListMin = NewSetListMin, - NewSetList = NewSetList + NewSetListMin = NewSetListMin, + NewSetList = NewSetList, } return SetListUtilities @@ -205,4 +212,5 @@ end local deltat = os.clock()-t0 print ("Time taken to test", "good old vanilla", deltat,"s") - ]]-- \ No newline at end of file + ]] +-- diff --git a/common/configs/LavaMaps/AcidicQuarry.lua b/common/configs/LavaMaps/AcidicQuarry.lua index 2a095ff0b92..772e50c0123 100644 --- a/common/configs/LavaMaps/AcidicQuarry.lua +++ b/common/configs/LavaMaps/AcidicQuarry.lua @@ -20,7 +20,7 @@ local conf = { fogHeight = 36, fogAbove = 0.1, fogDistortion = 2.0, - tideRhythm = { { 4, 1.5, 5*6000 } }, + tideRhythm = { { 4, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Claymore.lua b/common/configs/LavaMaps/Claymore.lua index 55af6ef19a4..ac33c2c6d05 100644 --- a/common/configs/LavaMaps/Claymore.lua +++ b/common/configs/LavaMaps/Claymore.lua @@ -12,7 +12,7 @@ local conf = { fogDistortion = 2.0, tideAmplitude = 0.3, tidePeriod = 1000, - tideRhythm = { { -1, 1.5, 5*6000 } }, + tideRhythm = { { -1, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Forge.lua b/common/configs/LavaMaps/Forge.lua index 534802cebe8..b4a72723dc1 100644 --- a/common/configs/LavaMaps/Forge.lua +++ b/common/configs/LavaMaps/Forge.lua @@ -16,7 +16,7 @@ local conf = { fogHeight = 35, fogAbove = 0.18, - tideRhythm = { { -1, 7.5, 5*6000 } }, + tideRhythm = { { -1, 7.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Ghenna Rising.lua b/common/configs/LavaMaps/Ghenna Rising.lua index 7fb0e9adab3..8b64aa248cb 100644 --- a/common/configs/LavaMaps/Ghenna Rising.lua +++ b/common/configs/LavaMaps/Ghenna Rising.lua @@ -9,13 +9,7 @@ local conf = { shadowStrength = 0.9, coastLightBoost = 0.8, uvScale = 1.5, - tideRhythm = { { 250, 3, 15 }, - { 415, 1.5, 30 }, - { 250, 3, 5*60 }, - { 415, 1.5, 30 }, - { 250, 3, 5*60 }, - { 415, 1.5, 3*30 }, - { 250, 3, 10*60 } }, + tideRhythm = { { 250, 3, 15 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 3 * 30 }, { 250, 3, 10 * 60 } }, } return conf diff --git a/common/configs/LavaMaps/Hotstepper 5.lua b/common/configs/LavaMaps/Hotstepper 5.lua index 3ea4fedfbfc..f1a6a4b826f 100644 --- a/common/configs/LavaMaps/Hotstepper 5.lua +++ b/common/configs/LavaMaps/Hotstepper 5.lua @@ -1,16 +1,7 @@ local conf = { level = 100, damage = 130, - tideRhythm = { { 90, 7.5, 5*60 }, - { 215, 3, 5 }, - { 90, 7.5, 5*60 }, - { 290, 4.5, 5 }, - { 90, 7.5, 4*60 }, - { 355, 6, 5 }, - { 90, 7.5, 4*60 }, - { 390, 6, 5 }, - { 90, 7.5, 2*60 }, - { 440, 1.2, 2*60 } }, + tideRhythm = { { 90, 7.5, 5 * 60 }, { 215, 3, 5 }, { 90, 7.5, 5 * 60 }, { 290, 4.5, 5 }, { 90, 7.5, 4 * 60 }, { 355, 6, 5 }, { 90, 7.5, 4 * 60 }, { 390, 6, 5 }, { 90, 7.5, 2 * 60 }, { 440, 1.2, 2 * 60 } }, } return conf diff --git a/common/configs/LavaMaps/Hyperion Shale.lua b/common/configs/LavaMaps/Hyperion Shale.lua index 36bde185e1d..2323ee0597b 100644 --- a/common/configs/LavaMaps/Hyperion Shale.lua +++ b/common/configs/LavaMaps/Hyperion Shale.lua @@ -12,7 +12,7 @@ local conf = { fogDistortion = 2.0, tideAmplitude = 0.3, tidePeriod = 1000, - tideRhythm = { { -1, 1.5, 5*6000 } }, + tideRhythm = { { -1, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Incandescence Remake.lua b/common/configs/LavaMaps/Incandescence Remake.lua index 00cdfcd674a..94a5f2e0a18 100644 --- a/common/configs/LavaMaps/Incandescence Remake.lua +++ b/common/configs/LavaMaps/Incandescence Remake.lua @@ -16,7 +16,7 @@ local conf = { fogHeight = 85, fogAbove = 0.18, - tideRhythm = { { 206, 7.5, 5*6000 } }, + tideRhythm = { { 206, 7.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Kings Assault.lua b/common/configs/LavaMaps/Kings Assault.lua index 7a3085de2c8..0c7297761dc 100644 --- a/common/configs/LavaMaps/Kings Assault.lua +++ b/common/configs/LavaMaps/Kings Assault.lua @@ -10,7 +10,7 @@ local conf = { fogDistortion = 2.0, tideAmplitude = 0.3, tidePeriod = 1000, - tideRhythm = { { -1, 1.5, 5*6000 } }, + tideRhythm = { { -1, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Pit of Azar.lua b/common/configs/LavaMaps/Pit of Azar.lua index 85a2d9633e6..7cbd89f6d54 100644 --- a/common/configs/LavaMaps/Pit of Azar.lua +++ b/common/configs/LavaMaps/Pit of Azar.lua @@ -17,7 +17,7 @@ local conf = { fogAbove = 0.18, fogDistortion = 2.0, uvScale = 10.0, - tideRhythm = { { -1, 7.5, 5*6000 } }, + tideRhythm = { { -1, 7.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Sector 318C.lua b/common/configs/LavaMaps/Sector 318C.lua index 016c466eb6b..a0913506173 100644 --- a/common/configs/LavaMaps/Sector 318C.lua +++ b/common/configs/LavaMaps/Sector 318C.lua @@ -22,7 +22,7 @@ local conf = { fogHeight = 36, fogAbove = 0.1, fogDistortion = 2.0, - tideRhythm = { { 4, 1.5, 5*6000 } }, + tideRhythm = { { 4, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Special Hotstepper.lua b/common/configs/LavaMaps/Special Hotstepper.lua index faef48f5efc..fd9f188f97c 100644 --- a/common/configs/LavaMaps/Special Hotstepper.lua +++ b/common/configs/LavaMaps/Special Hotstepper.lua @@ -18,32 +18,32 @@ local conf = { level = 35, damage = 120, tideRhythm = { - { 0, 4.5, 4*60}, -- ~ 0:00- 4:00 - { 120, 3.0, 10 }, -- ~ 4:30- 4:40 - { 50, 4.5, 4*60}, -- ~ 4:55- 8:55 - { 250, 3.0, 10 }, -- ~10:00-10:10 - { 50, 4.5, 4*60}, -- ~10:55-14:55 - { 400, 3.0, 10 }, -- ~16:50-17:00 - { 250, 4.5, 150 }, -- ~17:35-20:05 - { 600, 4.5, 10 }, -- ~21:25-21:35 - { 400, 6.0, 4*60}, -- ~22:05-26:05 - { 700, 4.5, 10 }, -- ~27:15-27:25 - { 400, 6.0, 4*60}, -- ~28:15-32:15 - { 780, 4.5, 10 }, -- ~33:40-33:50 - { 400, 6.0, 4*60}, -- ~34:50-38:50 - { 880, 4.5, 10}, -- ~40:40-40:50 - { 0, 15, 2*60}, -- ~41:45-43:45 - { 980, 30, 1 }, -- ~44:19-44:20 - { 880, 7.5, 2*60}, - { 1050, 30, 1 }, - { 880, 7.5, 2*60}, - { 1100, 30, 1 }, - { 880, 7.5, 2*60}, - { 1180, 30, 5 }, - { 880, 7.5, 2*60}, - { 1210, 1.5, 20 }, -- ~58:15-58:35 - { 4000, 15, 10*60} - }, + { 0, 4.5, 4 * 60 }, -- ~ 0:00- 4:00 + { 120, 3.0, 10 }, -- ~ 4:30- 4:40 + { 50, 4.5, 4 * 60 }, -- ~ 4:55- 8:55 + { 250, 3.0, 10 }, -- ~10:00-10:10 + { 50, 4.5, 4 * 60 }, -- ~10:55-14:55 + { 400, 3.0, 10 }, -- ~16:50-17:00 + { 250, 4.5, 150 }, -- ~17:35-20:05 + { 600, 4.5, 10 }, -- ~21:25-21:35 + { 400, 6.0, 4 * 60 }, -- ~22:05-26:05 + { 700, 4.5, 10 }, -- ~27:15-27:25 + { 400, 6.0, 4 * 60 }, -- ~28:15-32:15 + { 780, 4.5, 10 }, -- ~33:40-33:50 + { 400, 6.0, 4 * 60 }, -- ~34:50-38:50 + { 880, 4.5, 10 }, -- ~40:40-40:50 + { 0, 15, 2 * 60 }, -- ~41:45-43:45 + { 980, 30, 1 }, -- ~44:19-44:20 + { 880, 7.5, 2 * 60 }, + { 1050, 30, 1 }, + { 880, 7.5, 2 * 60 }, + { 1100, 30, 1 }, + { 880, 7.5, 2 * 60 }, + { 1180, 30, 5 }, + { 880, 7.5, 2 * 60 }, + { 1210, 1.5, 20 }, -- ~58:15-58:35 + { 4000, 15, 10 * 60 }, + }, } return conf diff --git a/common/configs/LavaMaps/SpeedMetal BAR.lua b/common/configs/LavaMaps/SpeedMetal BAR.lua index 88b554093ef..be04508f38f 100644 --- a/common/configs/LavaMaps/SpeedMetal BAR.lua +++ b/common/configs/LavaMaps/SpeedMetal BAR.lua @@ -10,7 +10,7 @@ local conf = { swirlAmp = 0.003, tideAmplitude = 3, tidePeriod = 50, - tideRhythm = { { 1, 1.5, 5*6000 } }, + tideRhythm = { { 1, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Stronghold.lua b/common/configs/LavaMaps/Stronghold.lua index df6d2ab6951..d8f17eeb477 100644 --- a/common/configs/LavaMaps/Stronghold.lua +++ b/common/configs/LavaMaps/Stronghold.lua @@ -1,28 +1,28 @@ local config = { - grow = 0, - effectBurst = false, - level = 5, - diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds", - normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds", - colorCorrection = "vec3(0.2, 0.65, 0.03)", - --coastColor = "vec3(0.6, 0.7, 0.03)", - coastLightBoost = 0.6, - coastWidth = 60.0, - fogColor = "vec3(1.60, 0.8, 0.3)", - --coastWidth = 30.0, - lavaParallaxDepth = 8.0, - lavaParallaxOffset = 0.2, - swirlFreq = 0.008, - swirlAmp = 0.017, - uvScale = 2.2, - specularExp = 12.0, - tideAmplitude = 3, - tidePeriod = 40, - fogFactor = 0.13, - fogHeight = 36, - fogAbove = 0.1, - fogDistortion = 2.0, - tideRhythm = { { 4, 1.5, 5*6000 } }, + grow = 0, + effectBurst = false, + level = 5, + diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds", + normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds", + colorCorrection = "vec3(0.2, 0.65, 0.03)", + --coastColor = "vec3(0.6, 0.7, 0.03)", + coastLightBoost = 0.6, + coastWidth = 60.0, + fogColor = "vec3(1.60, 0.8, 0.3)", + --coastWidth = 30.0, + lavaParallaxDepth = 8.0, + lavaParallaxOffset = 0.2, + swirlFreq = 0.008, + swirlAmp = 0.017, + uvScale = 2.2, + specularExp = 12.0, + tideAmplitude = 3, + tidePeriod = 40, + fogFactor = 0.13, + fogHeight = 36, + fogAbove = 0.1, + fogDistortion = 2.0, + tideRhythm = { { 4, 1.5, 5 * 6000 } }, } return config diff --git a/common/configs/LavaMaps/Thermal Shock.lua b/common/configs/LavaMaps/Thermal Shock.lua index 7a3085de2c8..0c7297761dc 100644 --- a/common/configs/LavaMaps/Thermal Shock.lua +++ b/common/configs/LavaMaps/Thermal Shock.lua @@ -10,7 +10,7 @@ local conf = { fogDistortion = 2.0, tideAmplitude = 0.3, tidePeriod = 1000, - tideRhythm = { { -1, 1.5, 5*6000 } }, + tideRhythm = { { -1, 1.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/To Kill The Middle.lua b/common/configs/LavaMaps/To Kill The Middle.lua index 099317e3b29..d5ccd53d00d 100644 --- a/common/configs/LavaMaps/To Kill The Middle.lua +++ b/common/configs/LavaMaps/To Kill The Middle.lua @@ -16,7 +16,7 @@ local conf = { fogHeight = 85, fogAbove = 0.18, - tideRhythm = { { -1, 7.5, 5*6000 } }, + tideRhythm = { { -1, 7.5, 5 * 6000 } }, } return conf diff --git a/common/configs/LavaMaps/Zed Remake.lua b/common/configs/LavaMaps/Zed Remake.lua index 544641cadc5..4a4c10dd1ce 100644 --- a/common/configs/LavaMaps/Zed Remake.lua +++ b/common/configs/LavaMaps/Zed Remake.lua @@ -10,7 +10,7 @@ local conf = { coastLightBoost = 1.3, tideAmplitude = 1.5, tidePeriod = 150, - tideRhythm = { { 0, 9, 5*6000 } }, + tideRhythm = { { 0, 9, 5 * 6000 } }, } return conf diff --git a/common/configs/unit_restrictions_config.lua b/common/configs/unit_restrictions_config.lua index 12fc669833b..682559c2fc3 100644 --- a/common/configs/unit_restrictions_config.lua +++ b/common/configs/unit_restrictions_config.lua @@ -20,7 +20,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end - if (unitDef.minWaterDepth > 0 or unitDef.modCategories['ship']) and not (unitDef.customParams.restrictions_exclusion and string.find(unitDef.customParams.restrictions_exclusion, "_nosea_")) then + if (unitDef.minWaterDepth > 0 or unitDef.modCategories["ship"]) and not (unitDef.customParams.restrictions_exclusion and string.find(unitDef.customParams.restrictions_exclusion, "_nosea_")) then isWaterUnit[unitDefID] = true end end @@ -31,7 +31,7 @@ end local function shouldShowWaterUnits() local voidWater = false - local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") if success and mapinfo then voidWater = mapinfo.voidwater end @@ -47,11 +47,7 @@ local function shouldShowWaterUnits() -- terraform, done too late to read w/ get ground, and too hectic to even try and guess if debugCommands and debugCommands:len() > 1 then - if debugCommands:find("waterlevel") - or debugCommands:find("height") - or debugCommands:find("extreme") - or debugCommands:find("invertmap") - then + if debugCommands:find("waterlevel") or debugCommands:find("height") or debugCommands:find("extreme") or debugCommands:find("invertmap") then return true end end diff --git a/common/constants.lua b/common/constants.lua index 4ed29123776..684a32c7ecf 100644 --- a/common/constants.lua +++ b/common/constants.lua @@ -1,7 +1,9 @@ -- constants.lua --------------------------------------------------------------- -- General game and engine constants, for use in general Lua environments. -if not Engine or not Spring then return end +if not Engine or not Spring then + return +end -------------------------------------------------------------------------------- -- Version handling ------------------------------------------------------------ @@ -27,13 +29,13 @@ Engine.FeatureSupport.targetBorderBug = isEngineMinVersion(2025, 6, 4) and not i -- Extended LuaConst ----------------------------------------------------------- if CMD then - CMD.NIL = "n" -- Handling for unintended nil's. - CMD.ANY = "a" -- Matches on all command values. + CMD.NIL = "n" -- Handling for unintended nil's. + CMD.ANY = "a" -- Matches on all command values. CMD.BUILD = "b" -- Filters for negative commands. - CMD.n = "NIL" - CMD.a = "ANY" - CMD.b = "BUILD" + CMD.n = "NIL" + CMD.a = "ANY" + CMD.b = "BUILD" end -------------------------------------------------------------------------------- diff --git a/common/holidays.lua b/common/holidays.lua index 1ff1d840569..e894795f31e 100644 --- a/common/holidays.lua +++ b/common/holidays.lua @@ -1,9 +1,9 @@ if not Spring.GetModOptions then - return + return end if not Spring.GetModOptions().holiday_events then - return + return end local modOptions = Spring.GetModOptions() @@ -13,60 +13,59 @@ local currentYear = modOptions.date_year -- Meeus's Julian algorithm Function to calculate Easter Sunday for a given year. Magic. local function EasterDate(year) - local a = year % 19 - local b = math.floor(year / 100) - local c = year % 100 - local d = math.floor(b / 4) - local e = b % 4 - local f = math.floor((b + 8) / 25) - local g = math.floor((b - f + 1) / 3) - local h = (19 * a + b - d - g + 15) % 30 - local i = math.floor(c / 4) - local k = c % 4 - local l = (32 + 2 * e + 2 * i - h - k) % 7 - local m = math.floor((a + 11 * h + 22 * l) / 451) - local month = math.floor((h + l - 7 * m + 114) / 31) - local day = ((h + l - 7 * m + 114) % 31) + 1 - - return year, month, day + local a = year % 19 + local b = math.floor(year / 100) + local c = year % 100 + local d = math.floor(b / 4) + local e = b % 4 + local f = math.floor((b + 8) / 25) + local g = math.floor((b - f + 1) / 3) + local h = (19 * a + b - d - g + 15) % 30 + local i = math.floor(c / 4) + local k = c % 4 + local l = (32 + 2 * e + 2 * i - h - k) % 7 + local m = math.floor((a + 11 * h + 22 * l) / 451) + local month = math.floor((h + l - 7 * m + 114) / 31) + local day = ((h + l - 7 * m + 114) % 31) + 1 + + return year, month, day end local function GetEasterStartEnd() - local easterYear, easterMonth, easterDay = EasterDate(currentYear) - local firstDay = easterDay - 6 -- We start at Monday before Easter - local firstMonth = easterMonth - local lastDay = easterDay + 1 -- We end at Monday after Easter - local lastMonth = easterMonth - - if easterMonth%2 == 0 then -- Easter is in April - 30 days month - if firstDay < 1 then - firstDay = firstDay + 31 - firstMonth = firstMonth - 1 - end - if lastDay > 30 then - lastDay = lastDay - 30 - lastMonth = lastMonth + 1 - end - - else -- Easter is in March or May - 31 days month - if firstDay < 1 then - firstDay = firstDay + 30 - firstMonth = firstMonth - 1 - end - if lastDay > 31 then - lastDay = lastDay - 31 - lastMonth = lastMonth + 1 - end - end - - return { - firstDay = firstDay, - firstMonth = firstMonth, - lastDay = lastDay, - lastMonth = lastMonth, - easterDay = easterDay, - easterMonth = easterMonth, - } + local easterYear, easterMonth, easterDay = EasterDate(currentYear) + local firstDay = easterDay - 6 -- We start at Monday before Easter + local firstMonth = easterMonth + local lastDay = easterDay + 1 -- We end at Monday after Easter + local lastMonth = easterMonth + + if easterMonth % 2 == 0 then -- Easter is in April - 30 days month + if firstDay < 1 then + firstDay = firstDay + 31 + firstMonth = firstMonth - 1 + end + if lastDay > 30 then + lastDay = lastDay - 30 + lastMonth = lastMonth + 1 + end + else -- Easter is in March or May - 31 days month + if firstDay < 1 then + firstDay = firstDay + 30 + firstMonth = firstMonth - 1 + end + if lastDay > 31 then + lastDay = lastDay - 31 + lastMonth = lastMonth + 1 + end + end + + return { + firstDay = firstDay, + firstMonth = firstMonth, + lastDay = lastDay, + lastMonth = lastMonth, + easterDay = easterDay, + easterMonth = easterMonth, + } end local EasterEventDates = GetEasterStartEnd() @@ -78,51 +77,51 @@ local EasterEventDates = GetEasterStartEnd() local holidaysList = { -- Static ----------------------------- ["aprilfools"] = { - firstDay = { day = 1, month = 4}, - lastDay = { day = 7, month = 4} + firstDay = { day = 1, month = 4 }, + lastDay = { day = 7, month = 4 }, }, - ["aprilfools_specialDay"] = { - firstDay = { day = 1, month = 4}, - lastDay = { day = 1, month = 4} + ["aprilfools_specialDay"] = { + firstDay = { day = 1, month = 4 }, + lastDay = { day = 1, month = 4 }, }, ["halloween"] = { - firstDay = { day = 17, month = 10}, - lastDay = { day = 31, month = 10} + firstDay = { day = 17, month = 10 }, + lastDay = { day = 31, month = 10 }, }, - ["halloween_specialDay"] = { - firstDay = { day = 31, month = 10}, - lastDay = { day = 31, month = 10} + ["halloween_specialDay"] = { + firstDay = { day = 31, month = 10 }, + lastDay = { day = 31, month = 10 }, }, ["xmas"] = { - firstDay = { day = 12, month = 12}, - lastDay = { day = 31, month = 12} + firstDay = { day = 12, month = 12 }, + lastDay = { day = 31, month = 12 }, }, - ["xmas_specialDay"] = { - firstDay = { day = 24, month = 12}, - lastDay = { day = 26, month = 12} + ["xmas_specialDay"] = { + firstDay = { day = 24, month = 12 }, + lastDay = { day = 26, month = 12 }, }, - -- We split these into two events because yes - ["newyearbefore"] = { - firstDay = { day = 31, month = 12}, - lastDay = { day = 31, month = 12} + -- We split these into two events because yes + ["newyearbefore"] = { + firstDay = { day = 31, month = 12 }, + lastDay = { day = 31, month = 12 }, }, - ["newyearafter"] = { - firstDay = { day = 1, month = 1}, - lastDay = { day = 1, month = 1} + ["newyearafter"] = { + firstDay = { day = 1, month = 1 }, + lastDay = { day = 1, month = 1 }, }, -- Dynamic ----------------------------- - ["easter"] = { - firstDay = { day = EasterEventDates.firstDay, month = EasterEventDates.firstMonth}, - lastDay = { day = EasterEventDates.lastDay, month = EasterEventDates.lastMonth} + ["easter"] = { + firstDay = { day = EasterEventDates.firstDay, month = EasterEventDates.firstMonth }, + lastDay = { day = EasterEventDates.lastDay, month = EasterEventDates.lastMonth }, }, - ["easter_specialDay"] = { - firstDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth}, - lastDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth} + ["easter_specialDay"] = { + firstDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth }, + lastDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth }, }, } -return holidaysList \ No newline at end of file +return holidaysList diff --git a/common/lib_polygon.lua b/common/lib_polygon.lua index 492f9458f53..298d41aafc6 100644 --- a/common/lib_polygon.lua +++ b/common/lib_polygon.lua @@ -69,10 +69,18 @@ function PolygonLib.GetStartboxBounds(entry) local polygon = entry.boxes[i] for j = 1, #polygon do local vx, vy = polygon[j][1], polygon[j][2] - if vx < xmin then xmin = vx end - if vx > xmax then xmax = vx end - if vy < ymin then ymin = vy end - if vy > ymax then ymax = vy end + if vx < xmin then + xmin = vx + end + if vx > xmax then + xmax = vx + end + if vy < ymin then + ymin = vy + end + if vy > ymax then + ymax = vy + end end end diff --git a/common/lib_spline.lua b/common/lib_spline.lua index 412dbf86f0f..3fcbe30a15e 100644 --- a/common/lib_spline.lua +++ b/common/lib_spline.lua @@ -12,8 +12,12 @@ local DEFAULT_SEGMENTS = 12 ---@field [3] number? strength Catmull-Rom anchor weight in [0,1]; absent or 0 is a sharp corner local function clamp01(v) - if v < 0 then return 0 end - if v > 1 then return 1 end + if v < 0 then + return 0 + end + if v > 1 then + return 1 + end return v end @@ -94,7 +98,9 @@ function SplineLib.TessellateRing(anchors, opts) end local segments = (opts and opts.segments) or DEFAULT_SEGMENTS - if segments < 1 then segments = 1 end + if segments < 1 then + segments = 1 + end local out = {} for i = 1, n do @@ -106,8 +112,14 @@ function SplineLib.TessellateRing(anchors, opts) local p2 = anchors[iNext] local p3 = anchors[iNext2] - local s1 = p1[3]; if s1 == nil then s1 = 0 end - local s2 = p2[3]; if s2 == nil then s2 = 0 end + local s1 = p1[3] + if s1 == nil then + s1 = 0 + end + local s2 = p2[3] + if s2 == nil then + s2 = 0 + end local edgeTension = clamp01((clamp01(s1) + clamp01(s2)) * 0.5) out[#out + 1] = { p1[1], p1[2] } diff --git a/common/lib_startpoint_guesser.lua b/common/lib_startpoint_guesser.lua index ee4457999c6..20241b303dc 100644 --- a/common/lib_startpoint_guesser.lua +++ b/common/lib_startpoint_guesser.lua @@ -1,9 +1,9 @@ -- Start Point Guessing functions used by initial_spawn -local claimRadius = 250*2.3 -- the radius about your own startpoint which the startpoint guesser regards as containing mexes that you've claimed for yourself (dgun range=250) -local claimRadius2 = 250*1.5 -- as above, but for continuous metal dist instead of spots +local claimRadius = 250 * 2.3 -- the radius about your own startpoint which the startpoint guesser regards as containing mexes that you've claimed for yourself (dgun range=250) +local claimRadius2 = 250 * 1.5 -- as above, but for continuous metal dist instead of spots local claimHeight = 300 -- the height difference relative your own startpoint in which, within the claimRadius, the startpoint guesser regards you as claiming mexes (coms can build up a cliff ~200 high but not much more). -local walkRadius = 250*3 -- the radius outside of the startbox that we regard as being able to walk to a mex on +local walkRadius = 250 * 3 -- the radius outside of the startbox that we regard as being able to walk to a mex on local mathAbs = math.abs local mathAtan = math.atan @@ -18,28 +18,34 @@ local mtta = mathAcos(1.0 - 0.41221) - 0.02 --http://springrts.com/wiki/Movedefs -- format of startPointTable passed in should be startPointTable(teamID) = {x,z}, where x,z<=-500 if team does not yet have a startpoint -function IsSteep(x,z) +function IsSteep(x, z) --check if the position (x,z) is too step to start a commander on or not - local a1,a2,a3,a4 = 0,0,0,0 + local a1, a2, a3, a4 = 0, 0, 0, 0 local d = 5 - local y = spGetGroundHeight(x,z) - local y1 = spGetGroundHeight(x+d,z) - if mathAbs(y1 - y) > 0.1 then a1 = mathAtan((y1-y)/d) end - local y2 = spGetGroundHeight(x,z+d) - if mathAbs(y2 - y) > 0.1 then a2 = mathAtan((y2-y)/d) end - local y3 = spGetGroundHeight(x-d,z) - if mathAbs(y3 - y) > 0.1 then a3 = mathAtan((y3-y)/d) end - local y4 = spGetGroundHeight(x,z-d) - if mathAbs(y4 - y) > 0.1 then a4 = mathAtan((y4-y)/d) end + local y = spGetGroundHeight(x, z) + local y1 = spGetGroundHeight(x + d, z) + if mathAbs(y1 - y) > 0.1 then + a1 = mathAtan((y1 - y) / d) + end + local y2 = spGetGroundHeight(x, z + d) + if mathAbs(y2 - y) > 0.1 then + a2 = mathAtan((y2 - y) / d) + end + local y3 = spGetGroundHeight(x - d, z) + if mathAbs(y3 - y) > 0.1 then + a3 = mathAtan((y3 - y) / d) + end + local y4 = spGetGroundHeight(x, z - d) + if mathAbs(y4 - y) > 0.1 then + a4 = mathAtan((y4 - y) / d) + end if mathAbs(a1) > mtta or mathAbs(a2) > mtta or mathAbs(a3) > mtta or mathAbs(a4) > mtta then return true --too steep else return false --ok end - end - function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) -- guess based on metal spots within startbox -- @@ -47,26 +53,26 @@ function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) local resourceSpotFinder = (GG and GG["resource_spot_finder"]) or (WG and WG["resource_spot_finder"]) local metalSpots = resourceSpotFinder and resourceSpotFinder.metalSpotsList or nil if not metalSpots or #metalSpots == 0 then - return -1,-1 + return -1, -1 end -- find free metal spots - local freeMetalSpots = {} -- will contain all metalspots that are within teamIDs startbox and are not within one of the cylinders given by (claimradius,claimheight) about an already existing startpoint + local freeMetalSpots = {} -- will contain all metalspots that are within teamIDs startbox and are not within one of the cylinders given by (claimradius,claimheight) about an already existing startpoint local walkableMetalSpots = {} -- will contain all metalspots that are NOT within teamIDs startbox and are not within one of the cylinders given by (claimradius,claimheight) about an already existing startpoint, but are within walkradius of the startbox - local k,j = 1,1 - for i=1,#metalSpots do + local k, j = 1, 1 + for i = 1, #metalSpots do local spot = metalSpots[i] - local mx,mz = spot.x,spot.z - local my = spGetGroundHeight(mx,mz) + local mx, mz = spot.x, spot.z + local my = spGetGroundHeight(mx, mz) local isWithinStartBox = (xmin < mx) and (mx < xmax) and (zmin < mz) and (mz < zmax) local isWithinWalkRadius = (mx >= xmin - walkRadius) and (mx <= xmax + walkRadius) and (mz >= zmin - walkRadius) and (mz <= zmax + walkRadius) local isFree = true - for _,startpoint in pairs(startPointTable) do -- we avoid enemy startpoints too, to prevent unnecessary explosions and to deal with the case of having no startboxes - local sx,sz = startpoint[1],startpoint[2] - local sy = spGetGroundHeight(sx,sz) - local isWithinClaimRadius = ((sx-mx)*(sx-mx)+(sz-mz)*(sz-mz) <= (claimRadius)*(claimRadius)) - local isWithinClaimHeight = (mathAbs(my-sy) <= claimHeight) + for _, startpoint in pairs(startPointTable) do -- we avoid enemy startpoints too, to prevent unnecessary explosions and to deal with the case of having no startboxes + local sx, sz = startpoint[1], startpoint[2] + local sy = spGetGroundHeight(sx, sz) + local isWithinClaimRadius = ((sx - mx) * (sx - mx) + (sz - mz) * (sz - mz) <= claimRadius * claimRadius) + local isWithinClaimHeight = (mathAbs(my - sy) <= claimHeight) if isWithinClaimRadius and isWithinClaimHeight then isFree = false break @@ -75,82 +81,82 @@ function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) if isFree then if isWithinStartBox then - freeMetalSpots[k] = {mx,mz} + freeMetalSpots[k] = { mx, mz } k = k + 1 elseif isWithinWalkRadius then - walkableMetalSpots[j] = {mx,mz} + walkableMetalSpots[j] = { mx, mz } j = j + 1 end end end - if k==1 then --found no free metal spots within startbox - if j==1 then --found no walkable spots either -> give up - return -1,-1 + if k == 1 then --found no free metal spots within startbox + if j == 1 then --found no walkable spots either -> give up + return -1, -1 end -- find nearest walkable metal spot to startbox - local bx,bz = -1,-1 -- will contain nearest point in startbox to nearest walkable mex - local bestDist = 2*walkRadius - for i=1,#walkableMetalSpots do - local mx,mz = walkableMetalSpots[i][1], walkableMetalSpots[i][2] + local bx, bz = -1, -1 -- will contain nearest point in startbox to nearest walkable mex + local bestDist = 2 * walkRadius + for i = 1, #walkableMetalSpots do + local mx, mz = walkableMetalSpots[i][1], walkableMetalSpots[i][2] local nx = mathClamp(mx, xmin, xmax) local nz = mathClamp(mz, zmin, zmax) - local dist = mathSqrt((mx-nx)^2 + (mz-nz)^2) + local dist = mathSqrt((mx - nx) ^ 2 + (mz - nz) ^ 2) - if not IsSteep(nx,nz) and dist < bestDist then + if not IsSteep(nx, nz) and dist < bestDist then bx = nx bz = nz end end - return bx,bz + return bx, bz end -- score each free metal spot local freeMetalSpotScores = {} local freeMetalSpotHeights = {} - for i=1,#freeMetalSpots do - freeMetalSpotScores[i]=0 + for i = 1, #freeMetalSpots do + freeMetalSpotScores[i] = 0 freeMetalSpotHeights[i] = spGetGroundHeight(freeMetalSpots[i][1], freeMetalSpots[i][2]) end local walkableMetalSpotHeights = {} - for i=1,#walkableMetalSpots do + for i = 1, #walkableMetalSpots do walkableMetalSpotHeights[i] = spGetGroundHeight(walkableMetalSpots[i][1], walkableMetalSpots[i][2]) end - for i=1,#freeMetalSpots do - local ix,iz = freeMetalSpots[i][1], freeMetalSpots[i][2] + for i = 1, #freeMetalSpots do + local ix, iz = freeMetalSpots[i][1], freeMetalSpots[i][2] local iy = freeMetalSpotHeights[i] - for j=1,#freeMetalSpots do - local jx,jz = freeMetalSpots[j][1],freeMetalSpots[j][2] + for j = 1, #freeMetalSpots do + local jx, jz = freeMetalSpots[j][1], freeMetalSpots[j][2] if ix ~= jx or iz ~= jz then - local r = mathSqrt((ix-jx)^2+(iz-jz)^2) + local r = mathSqrt((ix - jx) ^ 2 + (iz - jz) ^ 2) local jy = freeMetalSpotHeights[j] local isWithinClaimRadius = (r <= claimRadius) - local isWithinClaimHeight = (mathAbs(iy-jy) <= claimHeight) + local isWithinClaimHeight = (mathAbs(iy - jy) <= claimHeight) local score -- Magic formula. Assumes all metal spots are of equal production value, TODO... if isWithinClaimRadius and isWithinClaimHeight then score = 10 else - score = r^(-1/2) + score = r ^ (-1 / 2) end freeMetalSpotScores[i] = freeMetalSpotScores[i] + score end end -- Also check all the walkable spots as some may be on the edge of the startbox - for j=1,#walkableMetalSpots do - local jx,jz = walkableMetalSpots[j][1],walkableMetalSpots[j][2] + for j = 1, #walkableMetalSpots do + local jx, jz = walkableMetalSpots[j][1], walkableMetalSpots[j][2] if ix ~= jx or iz ~= jz then - local r = mathSqrt((ix-jx)^2+(iz-jz)^2) + local r = mathSqrt((ix - jx) ^ 2 + (iz - jz) ^ 2) local jy = walkableMetalSpotHeights[j] local isWithinClaimRadius = (r <= claimRadius) - local isWithinClaimHeight = (mathAbs(iy-jy) <= claimHeight) + local isWithinClaimHeight = (mathAbs(iy - jy) <= claimHeight) local score -- Magic formula. Assumes all metal spots are of equal production value, TODO... if isWithinClaimRadius and isWithinClaimHeight then score = 10 else - score = r^(-1/2) + score = r ^ (-1 / 2) end freeMetalSpotScores[i] = freeMetalSpotScores[i] + score end @@ -159,21 +165,21 @@ function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) -- find free metal spot with highest score local bestIndex = 1 - for i=2,#freeMetalSpotScores do + for i = 2, #freeMetalSpotScores do if freeMetalSpotScores[i] >= freeMetalSpotScores[bestIndex] then bestIndex = i end end -- find nearest free spot closest to best - local bx,bz = freeMetalSpots[bestIndex][1],freeMetalSpots[bestIndex][2] - local nx,nz - local bestDistance = (xmax)*(xmax)+(zmax)*(zmax) -- meh, just need to be big + local bx, bz = freeMetalSpots[bestIndex][1], freeMetalSpots[bestIndex][2] + local nx, nz + local bestDistance = xmax * xmax + zmax * zmax -- meh, just need to be big - for i=1,#freeMetalSpots do + for i = 1, #freeMetalSpots do if i ~= bestIndex then - local mx,mz = freeMetalSpots[i][1],freeMetalSpots[i][2] - local thisDistance = (bx-mx)*(bx-mx)+(bz-mz)*(bz-mz) --no need to squareroot, we care only about the order + local mx, mz = freeMetalSpots[i][1], freeMetalSpots[i][2] + local thisDistance = (bx - mx) * (bx - mx) + (bz - mz) * (bz - mz) --no need to squareroot, we care only about the order if thisDistance < bestDistance then bestDistance = thisDistance nx = mx @@ -183,132 +189,130 @@ function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) end -- if it wasn't possible to find a nearest free spot - if nx==nil or nx==bx or nz==nil or nz==bz then - nx=bx+1 - nz=bx+1 + if nx == nil or nx == bx or nz == nil or nz == bz then + nx = bx + 1 + nz = bx + 1 end -- move slightly towards nearest from best - local norm = mathSqrt((bx-nx)*(bx-nx)+(bz-nz)*(bz-nz)) - local dispx = (nx-bx)/norm - local dispz = (nz-bz)/norm + local norm = mathSqrt((bx - nx) * (bx - nx) + (bz - nz) * (bz - nz)) + local dispx = (nx - bx) / norm + local dispz = (nz - bz) / norm local disp = 120 - local x = bx + disp * (dispx) - local z = bz + disp * (dispz) + local x = bx + disp * dispx + local z = bz + disp * dispz -- if the terrain nearby was too steep, just start on the mex (-> assume mex is passable) - if IsSteep(x,z) then + if IsSteep(x, z) then x = bx z = bz end - return x,z + return x, z end - - function GuessTwo(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) --TODO: make this more efficient, atm it akes 1-2 sec to run -- search over metal map and find a point with a reasonable amount of non-claimed metal near to it - local mmapx,mmapz = Spring.GetMetalMapSize() -- metal map cords * 16 = world coords - local xres = mathMax(1,mathFloor(mmapx/16)) - local zres = mathMax(1,mathFloor(mmapz/16)) - - local points = {} --possible startpoints point[id] = {x,z,metal}, grid over metalmap of sidelength res - local pointCount = 0 - local x = xres - local z = zres - while true do --i hate lua - local y = spGetGroundHeight(x*16,z*16) - local isWithinStartBox = (xmin < 16*x) and (16*x < xmax) and (zmin < 16*z) and (16*z < zmax) - if isWithinStartBox then - pointCount = pointCount + 1 - points[pointCount] = {x=x, y=y, z=z, m=0} - end - x = x + xres - if x > mmapx then - x = 1 - z = z + zres - end - if z > mmapz then - break - end - end - - -- count metal for each point (sample metalmap at points in square grid of sidelength res2) - local xres2 = mathMax(1,mathFloor(xres/4)) - local zres2 = mathMax(1,mathFloor(zres/4)) - local claimRadius2Sq = claimRadius2 * claimRadius2 - local claimRadius2Div16Sq = (claimRadius2/16)*(claimRadius2/16) - for x=1,mmapx,xres2 do - for z=1,mmapz,zres2 do - -- is this metal aready claimed? - local isFree = true - for _,startpoint in pairs(startPointTable) do -- we avoid enemy startpoints too, to prevent unnecessary explosions and to deal with the case of having no startboxes - local sx,sz = startpoint[1],startpoint[2] - local sy = spGetGroundHeight(sx,sz) - local y = spGetGroundHeight(x*16,z*16) - local isWithinClaimRadius = ((sx-x*16)*(sx-x*16)+(sz-z*16)*(sz-z*16) <= claimRadius2Sq) - local isWithinClaimHeight = (mathAbs(sy-y) <= claimHeight) - if isWithinClaimRadius and isWithinClaimHeight then - isFree = false - break - end - end - - -- if it is, add this metal into points - local m = Spring.GetMetalAmount(x,z) - if isFree and m > 0.1 then - local y = spGetGroundHeight(x*16,z*16) - for _,p in ipairs(points) do - if m and (p.x-x)*(p.x-x)+(p.z-z)*(p.z-z) <= claimRadius2Div16Sq and mathAbs(p.y-y) <= claimHeight then - p.m = p.m + m - end - end - end - end - end - - -- find which point within the startbox that has the most metal - local best - local bestM = 0 - for id,p in ipairs(points) do - if bestM < p.m then - best = id - bestM = p.m - end - end - - -- return best - if best then - return (points[best].x)*16, (points[best].z)*16 - end - - -- give up - return -1,-1 -end + local mmapx, mmapz = Spring.GetMetalMapSize() -- metal map cords * 16 = world coords + local xres = mathMax(1, mathFloor(mmapx / 16)) + local zres = mathMax(1, mathFloor(mmapz / 16)) + + local points = {} --possible startpoints point[id] = {x,z,metal}, grid over metalmap of sidelength res + local pointCount = 0 + local x = xres + local z = zres + while true do --i hate lua + local y = spGetGroundHeight(x * 16, z * 16) + local isWithinStartBox = (xmin < 16 * x) and (16 * x < xmax) and (zmin < 16 * z) and (16 * z < zmax) + if isWithinStartBox then + pointCount = pointCount + 1 + points[pointCount] = { x = x, y = y, z = z, m = 0 } + end + x = x + xres + if x > mmapx then + x = 1 + z = z + zres + end + if z > mmapz then + break + end + end + + -- count metal for each point (sample metalmap at points in square grid of sidelength res2) + local xres2 = mathMax(1, mathFloor(xres / 4)) + local zres2 = mathMax(1, mathFloor(zres / 4)) + local claimRadius2Sq = claimRadius2 * claimRadius2 + local claimRadius2Div16Sq = (claimRadius2 / 16) * (claimRadius2 / 16) + for x = 1, mmapx, xres2 do + for z = 1, mmapz, zres2 do + -- is this metal aready claimed? + local isFree = true + for _, startpoint in pairs(startPointTable) do -- we avoid enemy startpoints too, to prevent unnecessary explosions and to deal with the case of having no startboxes + local sx, sz = startpoint[1], startpoint[2] + local sy = spGetGroundHeight(sx, sz) + local y = spGetGroundHeight(x * 16, z * 16) + local isWithinClaimRadius = ((sx - x * 16) * (sx - x * 16) + (sz - z * 16) * (sz - z * 16) <= claimRadius2Sq) + local isWithinClaimHeight = (mathAbs(sy - y) <= claimHeight) + if isWithinClaimRadius and isWithinClaimHeight then + isFree = false + break + end + end + -- if it is, add this metal into points + local m = Spring.GetMetalAmount(x, z) + if isFree and m > 0.1 then + local y = spGetGroundHeight(x * 16, z * 16) + for _, p in ipairs(points) do + if m and (p.x - x) * (p.x - x) + (p.z - z) * (p.z - z) <= claimRadius2Div16Sq and mathAbs(p.y - y) <= claimHeight then + p.m = p.m + m + end + end + end + end + end + + -- find which point within the startbox that has the most metal + local best + local bestM = 0 + for id, p in ipairs(points) do + if bestM < p.m then + best = id + bestM = p.m + end + end + + -- return best + if best then + return points[best].x * 16, points[best].z * 16 + end + + -- give up + return -1, -1 +end function GuessStartSpot(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) --Sanity check - if (xmin >= xmax) or (zmin>=zmax) then return 0,0 end + if (xmin >= xmax) or (zmin >= zmax) then + return 0, 0 + end -- Try our guesses - local x,z = GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) - if x>=0 and z>=0 then - startPointTable[teamID]={x,z} - return x,z + local x, z = GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) + if x >= 0 and z >= 0 then + startPointTable[teamID] = { x, z } + return x, z end - x,z = GuessTwo(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) - if x>=0 and z>=0 then - startPointTable[teamID]={x,z} - return x,z + x, z = GuessTwo(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable) + if x >= 0 and z >= 0 then + startPointTable[teamID] = { x, z } + return x, z end - -- GIVE UP, fuuuuuuuuuuuuu -- x = (xmin + xmax) / 2 z = (zmin + zmax) / 2 - startPointTable[teamID]={x,z} - return x,z + startPointTable[teamID] = { x, z } + return x, z end diff --git a/common/numberfunctions.lua b/common/numberfunctions.lua index ab8a21d1241..de49f8b1394 100644 --- a/common/numberfunctions.lua +++ b/common/numberfunctions.lua @@ -5,7 +5,7 @@ if not math.isInRect then end if not math.cross_product then - function math.cross_product (px, pz, ax, az, bx, bz) + function math.cross_product(px, pz, ax, az, bx, bz) return ((px - bx) * (az - bz) - (ax - bx) * (pz - bz)) end end @@ -31,13 +31,11 @@ if not math.triangulate then -- the van gogh concave polygon triangulation algorithm: cuts off ears -- is pretty shitty at O(V^3) but was easy to code and it's typically only done once anyway while #polygon > 2 do - -- get a candidate ear local triangle local c0, c1, c2 = 0 local candidate_ok = false while not candidate_ok do - c0 = c0 + 1 c1, c2 = c0 + 1, c0 + 2 if c1 > #polygon then @@ -47,9 +45,12 @@ if not math.triangulate then c2 = c2 - #polygon end triangle = { - polygon[c0][1], polygon[c0][2], - polygon[c1][1], polygon[c1][2], - polygon[c2][1], polygon[c2][2], + polygon[c0][1], + polygon[c0][2], + polygon[c1][1], + polygon[c1][2], + polygon[c2][1], + polygon[c2][2], } -- make sure the ear is of proper rotation but then make it counter-clockwise @@ -69,10 +70,7 @@ if not math.triangulate then for i = 1, #polygon do if i ~= c0 and i ~= c1 and i ~= c2 then local current_pt = polygon[i] - if (math.cross_product(current_pt[1], current_pt[2], triangle[1], triangle[2], triangle[3], triangle[4]) < 0) - and (math.cross_product(current_pt[1], current_pt[2], triangle[3], triangle[4], triangle[5], triangle[6]) < 0) - and (math.cross_product(current_pt[1], current_pt[2], triangle[5], triangle[6], triangle[1], triangle[2]) < 0) - then + if (math.cross_product(current_pt[1], current_pt[2], triangle[1], triangle[2], triangle[3], triangle[4]) < 0) and (math.cross_product(current_pt[1], current_pt[2], triangle[3], triangle[4], triangle[5], triangle[6]) < 0) and (math.cross_product(current_pt[1], current_pt[2], triangle[5], triangle[6], triangle[1], triangle[2]) < 0) then candidate_ok = false end end @@ -93,18 +91,18 @@ end if not math.closestPointOnCircle then function math.closestPointOnCircle(centerX, centerZ, radius, targetX, targetZ) - local dx = targetX - centerX - local dz = targetZ - centerZ - local dist = math.diag(dx, dz) - if dist == 0 then - -- Target is exactly at center; choose arbitrary point on circle - return centerX + radius, centerZ - end - local scale = radius / dist - local closestX = centerX + dx * scale - local closestZ = centerZ + dz * scale - return closestX, closestZ - end + local dx = targetX - centerX + local dz = targetZ - centerZ + local dist = math.diag(dx, dz) + if dist == 0 then + -- Target is exactly at center; choose arbitrary point on circle + return centerX + radius, centerZ + end + local scale = radius / dist + local closestX = centerX + dx * scale + local closestZ = centerZ + dz * scale + return closestX, closestZ + end end if not math.HSLtoRGB then diff --git a/common/overlap_lines.lua b/common/overlap_lines.lua index 39128fce3ef..a01bce1dc5b 100644 --- a/common/overlap_lines.lua +++ b/common/overlap_lines.lua @@ -9,29 +9,29 @@ local OverlapLines = {} ---@return table|nil intersection1 {x: number, z: number} ---@return table|nil intersection2 {x: number, z: number} local function getCircleIntersections(centerX0, centerZ0, centerX1, centerZ1, radius) - local distanceSquared = math.distance2dSquared(centerX0, centerZ0, centerX1, centerZ1) - - if distanceSquared > (2 * radius) ^ 2 or distanceSquared == 0 then - return nil, nil - end + local distanceSquared = math.distance2dSquared(centerX0, centerZ0, centerX1, centerZ1) - local distance = math.sqrt(distanceSquared) - local deltaX = centerX1 - centerX0 - local deltaZ = centerZ1 - centerZ0 + if distanceSquared > (2 * radius) ^ 2 or distanceSquared == 0 then + return nil, nil + end - local distToChord = distance / 2 - local height = math.sqrt(math.max(0, radius * radius - distToChord * distToChord)) + local distance = math.sqrt(distanceSquared) + local deltaX = centerX1 - centerX0 + local deltaZ = centerZ1 - centerZ0 - local midX = centerX0 + distToChord * (deltaX / distance) - local midZ = centerZ0 + distToChord * (deltaZ / distance) + local distToChord = distance / 2 + local height = math.sqrt(math.max(0, radius * radius - distToChord * distToChord)) - local intersection1X = midX + height * (deltaZ / distance) - local intersection1Z = midZ - height * (deltaX / distance) + local midX = centerX0 + distToChord * (deltaX / distance) + local midZ = centerZ0 + distToChord * (deltaZ / distance) - local intersection2X = midX - height * (deltaZ / distance) - local intersection2Z = midZ + height * (deltaX / distance) + local intersection1X = midX + height * (deltaZ / distance) + local intersection1Z = midZ - height * (deltaX / distance) - return {x = intersection1X, z = intersection1Z}, {x = intersection2X, z = intersection2Z} + local intersection2X = midX - height * (deltaZ / distance) + local intersection2Z = midZ + height * (deltaX / distance) + + return { x = intersection1X, z = intersection1Z }, { x = intersection2X, z = intersection2Z } end ---Generate lines for a commander against a list of neighbors @@ -41,37 +41,37 @@ end ---@param range number ---@return table[] lines function OverlapLines.getOverlapLines(originX, originZ, neighbors, range) - local lines = { - originX = originX, - originZ = originZ, - } - local lineCount = 0 - for i = 1, #neighbors do - local neighbor = neighbors[i] - local point1, point2 = getCircleIntersections(originX, originZ, neighbor.x, neighbor.z, range) - if point1 and point2 then - local deltaX = point2.x - point1.x - local deltaZ = point2.z - point1.z - - local lineCoeffA = -deltaZ - local lineCoeffB = deltaX - local lineCoeffC = -(lineCoeffA * point1.x + lineCoeffB * point1.z) - - local originSideValue = lineCoeffA * originX + lineCoeffB * originZ + lineCoeffC - - lineCount = lineCount + 1 - lines[lineCount] = { - p1 = point1, - p2 = point2, - neighbor = neighbor, - A = lineCoeffA, - B = lineCoeffB, - C = lineCoeffC, - originVal = originSideValue - } - end - end - return lines + local lines = { + originX = originX, + originZ = originZ, + } + local lineCount = 0 + for i = 1, #neighbors do + local neighbor = neighbors[i] + local point1, point2 = getCircleIntersections(originX, originZ, neighbor.x, neighbor.z, range) + if point1 and point2 then + local deltaX = point2.x - point1.x + local deltaZ = point2.z - point1.z + + local lineCoeffA = -deltaZ + local lineCoeffB = deltaX + local lineCoeffC = -(lineCoeffA * point1.x + lineCoeffB * point1.z) + + local originSideValue = lineCoeffA * originX + lineCoeffB * originZ + lineCoeffC + + lineCount = lineCount + 1 + lines[lineCount] = { + p1 = point1, + p2 = point2, + neighbor = neighbor, + A = lineCoeffA, + B = lineCoeffB, + C = lineCoeffC, + originVal = originSideValue, + } + end + end + return lines end ---Check if point is "past" any of the lines relative to origin. @@ -82,27 +82,27 @@ end ---@param lines table[] ---@return boolean isPast function OverlapLines.isPointPastLines(pointX, pointZ, originX, originZ, lines) - if not lines or #lines == 0 then - return false - end - - if lines.originX and lines.originZ then - local TOLERANCE = 0.1 - if math.abs(originX - lines.originX) > TOLERANCE or math.abs(originZ - lines.originZ) > TOLERANCE then - -- Origin mismatch detected but no warning needed - end - end - - for i = 1, #lines do - local line = lines[i] - - local pointSideValue = line.A * pointX + line.B * pointZ + line.C - - if pointSideValue * line.originVal < 0 then - return true - end - end - return false + if not lines or #lines == 0 then + return false + end + + if lines.originX and lines.originZ then + local TOLERANCE = 0.1 + if math.abs(originX - lines.originX) > TOLERANCE or math.abs(originZ - lines.originZ) > TOLERANCE then + -- Origin mismatch detected but no warning needed + end + end + + for i = 1, #lines do + local line = lines[i] + + local pointSideValue = line.A * pointX + line.B * pointZ + line.C + + if pointSideValue * line.originVal < 0 then + return true + end + end + return false end ---Calculate intersection of two lines @@ -112,33 +112,35 @@ end ---@param p4 table Second point of second line {x: number, z: number} ---@return table|nil intersection Point of intersection {x: number, z: number, t: number} or nil if no intersection local function findLineIntersection(p1, p2, p3, p4) - local x1, z1 = p1.x, p1.z - local x2, z2 = p2.x, p2.z - local x3, z3 = p3.x, p3.z - local x4, z4 = p4.x, p4.z - - local denom = (x1 - x2) * (z3 - z4) - (z1 - z2) * (x3 - x4) - if math.abs(denom) < 0.0001 then return nil end - - local t = ((x1 - x3) * (z3 - z4) - (z1 - z3) * (x3 - x4)) / denom - local u = -((x1 - x2) * (z1 - z3) - (z1 - z2) * (x1 - x3)) / denom - - if t >= 0 and t <= 1 and u >= 0 and u <= 1 then - return { - x = x1 + t * (x2 - x1), - z = z1 + t * (z2 - z1), - t = t - } - end - return nil + local x1, z1 = p1.x, p1.z + local x2, z2 = p2.x, p2.z + local x3, z3 = p3.x, p3.z + local x4, z4 = p4.x, p4.z + + local denom = (x1 - x2) * (z3 - z4) - (z1 - z2) * (x3 - x4) + if math.abs(denom) < 0.0001 then + return nil + end + + local t = ((x1 - x3) * (z3 - z4) - (z1 - z3) * (x3 - x4)) / denom + local u = -((x1 - x2) * (z1 - z3) - (z1 - z2) * (x1 - x3)) / denom + + if t >= 0 and t <= 1 and u >= 0 and u <= 1 then + return { + x = x1 + t * (x2 - x1), + z = z1 + t * (z2 - z1), + t = t, + } + end + return nil end local function getSide(p, lineP1, lineP2) - return (lineP2.x - lineP1.x) * (p.z - lineP1.z) - (lineP2.z - lineP1.z) * (p.x - lineP1.x) + return (lineP2.x - lineP1.x) * (p.z - lineP1.z) - (lineP2.z - lineP1.z) * (p.x - lineP1.x) end local function getSideXZ(px, pz, lineP1, lineP2) - return (lineP2.x - lineP1.x) * (pz - lineP1.z) - (lineP2.z - lineP1.z) * (px - lineP1.x) + return (lineP2.x - lineP1.x) * (pz - lineP1.z) - (lineP2.z - lineP1.z) * (px - lineP1.x) end local CIRCLE_SEGMENT_COUNT = 128 @@ -146,9 +148,9 @@ local CIRCLE_SEGMENT_COUNT = 128 local circCos = {} local circSin = {} for i = 0, CIRCLE_SEGMENT_COUNT do - local angle = i * (2 * math.pi / CIRCLE_SEGMENT_COUNT) - circCos[i] = math.cos(angle) - circSin[i] = math.sin(angle) + local angle = i * (2 * math.pi / CIRCLE_SEGMENT_COUNT) + circCos[i] = math.cos(angle) + circSin[i] = math.sin(angle) end ---Get segments for drawing the overlap lines and circle boundary @@ -158,99 +160,101 @@ end ---@param radius number The radius of the build circle ---@return table[] segments List of segments to draw, each segment is {p1={x,z}, p2={x,z}} function OverlapLines.getDrawingSegments(lines, originX, originZ, radius) - local segments = {} - local segCount = 0 - - local lineValidSides = {} - local lineCount = lines and #lines or 0 - - if lineCount > 0 then - for i = 1, lineCount do - local line = lines[i] - lineValidSides[i] = getSideXZ(originX, originZ, line.p1, line.p2) - end - - local sortFunc = function(a, b) return a.t < b.t end - - for i = 1, lineCount do - local line = lines[i] - local intersections = { - {x = line.p1.x, z = line.p1.z, t = 0}, - {x = line.p2.x, z = line.p2.z, t = 1}, - } - local intCount = 2 - - for j = 1, lineCount do - if i ~= j then - local intersection = findLineIntersection(line.p1, line.p2, lines[j].p1, lines[j].p2) - if intersection then - intCount = intCount + 1 - intersections[intCount] = intersection - end - end - end - - table.sort(intersections, sortFunc) - - for k = 1, intCount - 1 do - local pA = intersections[k] - local pB = intersections[k + 1] - local midX = (pA.x + pB.x) * 0.5 - local midZ = (pA.z + pB.z) * 0.5 - - local valid = true - for j = 1, lineCount do - if i ~= j then - local otherLine = lines[j] - local side = getSideXZ(midX, midZ, otherLine.p1, otherLine.p2) - if lineValidSides[j] * side < -0.01 then - valid = false - break - end - end - end - - if valid then - segCount = segCount + 1 - segments[segCount] = {p1 = pA, p2 = pB} - end - end - end - end - - if radius and radius > 0 then - for i = 0, CIRCLE_SEGMENT_COUNT - 1 do - local p1x = originX + radius * circCos[i] - local p1z = originZ + radius * circSin[i] - local p2x = originX + radius * circCos[i + 1] - local p2z = originZ + radius * circSin[i + 1] - - local midX = (p1x + p2x) * 0.5 - local midZ = (p1z + p2z) * 0.5 - - local valid = true - if lineCount > 0 then - for j = 1, lineCount do - local line = lines[j] - local side = getSideXZ(midX, midZ, line.p1, line.p2) - if lineValidSides[j] * side < -0.01 then - valid = false - break - end - end - end - - if valid then - segCount = segCount + 1 - segments[segCount] = { - p1 = {x = p1x, z = p1z}, - p2 = {x = p2x, z = p2z}, - } - end - end - end - - return segments + local segments = {} + local segCount = 0 + + local lineValidSides = {} + local lineCount = lines and #lines or 0 + + if lineCount > 0 then + for i = 1, lineCount do + local line = lines[i] + lineValidSides[i] = getSideXZ(originX, originZ, line.p1, line.p2) + end + + local sortFunc = function(a, b) + return a.t < b.t + end + + for i = 1, lineCount do + local line = lines[i] + local intersections = { + { x = line.p1.x, z = line.p1.z, t = 0 }, + { x = line.p2.x, z = line.p2.z, t = 1 }, + } + local intCount = 2 + + for j = 1, lineCount do + if i ~= j then + local intersection = findLineIntersection(line.p1, line.p2, lines[j].p1, lines[j].p2) + if intersection then + intCount = intCount + 1 + intersections[intCount] = intersection + end + end + end + + table.sort(intersections, sortFunc) + + for k = 1, intCount - 1 do + local pA = intersections[k] + local pB = intersections[k + 1] + local midX = (pA.x + pB.x) * 0.5 + local midZ = (pA.z + pB.z) * 0.5 + + local valid = true + for j = 1, lineCount do + if i ~= j then + local otherLine = lines[j] + local side = getSideXZ(midX, midZ, otherLine.p1, otherLine.p2) + if lineValidSides[j] * side < -0.01 then + valid = false + break + end + end + end + + if valid then + segCount = segCount + 1 + segments[segCount] = { p1 = pA, p2 = pB } + end + end + end + end + + if radius and radius > 0 then + for i = 0, CIRCLE_SEGMENT_COUNT - 1 do + local p1x = originX + radius * circCos[i] + local p1z = originZ + radius * circSin[i] + local p2x = originX + radius * circCos[i + 1] + local p2z = originZ + radius * circSin[i + 1] + + local midX = (p1x + p2x) * 0.5 + local midZ = (p1z + p2z) * 0.5 + + local valid = true + if lineCount > 0 then + for j = 1, lineCount do + local line = lines[j] + local side = getSideXZ(midX, midZ, line.p1, line.p2) + if lineValidSides[j] * side < -0.01 then + valid = false + break + end + end + end + + if valid then + segCount = segCount + 1 + segments[segCount] = { + p1 = { x = p1x, z = p1z }, + p2 = { x = p2x, z = p2z }, + } + end + end + end + + return segments end return OverlapLines diff --git a/common/platformFunctions.lua b/common/platformFunctions.lua index 06762888d6c..0543dbf025b 100644 --- a/common/platformFunctions.lua +++ b/common/platformFunctions.lua @@ -1,4 +1,6 @@ -if not Platform then return end +if not Platform then + return +end local hasGL4 = false local hasGL = false local hasShaders = false @@ -30,13 +32,13 @@ local function checkRequires(allRequires) end for i = 1, #allRequires do local req = allRequires[i] - if req == 'gl' and not hasGL then + if req == "gl" and not hasGL then return false - elseif req == 'gl4' and not hasGL4 then + elseif req == "gl4" and not hasGL4 then return false - elseif req == 'shaders' and not hasShaders then + elseif req == "shaders" and not hasShaders then return false - elseif req == 'fbo' and not hasFBO then + elseif req == "fbo" and not hasFBO then return false end end diff --git a/common/springFunctions.lua b/common/springFunctions.lua index 19da1fcce5d..578dc38e9bd 100644 --- a/common/springFunctions.lua +++ b/common/springFunctions.lua @@ -1,12 +1,12 @@ -local utilitiesDirectory = 'common/springUtilities/' +local utilitiesDirectory = "common/springUtilities/" -local tga = VFS.Include(utilitiesDirectory .. 'image_tga.lua') -local team = VFS.Include(utilitiesDirectory .. 'teamFunctions.lua') -local syncFunctions = VFS.Include(utilitiesDirectory .. 'synced.lua') -local tableFunctions = VFS.Include(utilitiesDirectory .. 'tableFunctions.lua') -local colorFunctions = VFS.Include(utilitiesDirectory .. 'color.lua') -local safeLuaTableParser = VFS.Include(utilitiesDirectory .. 'safeluaparser.lua') -local facingFunctions = VFS.Include(utilitiesDirectory .. 'facingFunctions.lua') +local tga = VFS.Include(utilitiesDirectory .. "image_tga.lua") +local team = VFS.Include(utilitiesDirectory .. "teamFunctions.lua") +local syncFunctions = VFS.Include(utilitiesDirectory .. "synced.lua") +local tableFunctions = VFS.Include(utilitiesDirectory .. "tableFunctions.lua") +local colorFunctions = VFS.Include(utilitiesDirectory .. "color.lua") +local safeLuaTableParser = VFS.Include(utilitiesDirectory .. "safeluaparser.lua") +local facingFunctions = VFS.Include(utilitiesDirectory .. "facingFunctions.lua") local accountIDCache = {} @@ -27,12 +27,12 @@ local utilities = { GetRaptorAllyTeamID = team.GetRaptorAllyTeamID, IsDevMode = function() - local devMode = Spring.GetGameRulesParam('isDevMode') + local devMode = Spring.GetGameRulesParam("isDevMode") return (devMode and devMode > 0) and true or false end, - ShowDevUI = function () - local devUI = Spring.GetConfigInt('DevUI', 0) + ShowDevUI = function() + local devUI = Spring.GetConfigInt("DevUI", 0) return (devUI > 0) and true or false end, @@ -43,7 +43,7 @@ local utilities = { IsDevModeCached = function() local frame = Spring.GetGameFrame() if frame ~= utilities._devModeCacheFrame then - local devMode = Spring.GetGameRulesParam('isDevMode') + local devMode = Spring.GetGameRulesParam("isDevMode") utilities._devModeCache = (devMode and devMode > 0) and true or false utilities._devModeCacheFrame = frame end @@ -74,7 +74,7 @@ local utilities = { end, } -local debugUtilities = VFS.Include(utilitiesDirectory .. 'debug.lua') +local debugUtilities = VFS.Include(utilitiesDirectory .. "debug.lua") local debugFuncs = { ParamsEcho = debugUtilities.ParamsEcho, diff --git a/common/springOverrides.lua b/common/springOverrides.lua index 0e0829b56fa..e406f8019a7 100644 --- a/common/springOverrides.lua +++ b/common/springOverrides.lua @@ -1,6 +1,6 @@ if Spring.GetModOptions then local modOptions = Spring.GetModOptions() - local modOptionsFile = VFS.Include('modoptions.lua') + local modOptionsFile = VFS.Include("modoptions.lua") for _, modOption in ipairs(modOptionsFile) do local key = modOption.key @@ -10,12 +10,12 @@ if Spring.GetModOptions then modOptions[key] = modOption.def end - if (modOption.type == 'bool') and (type(modOptions[key]) ~= 'boolean') then + if (modOption.type == "bool") and (type(modOptions[key]) ~= "boolean") then local value = tonumber(modOptions[key]) modOptions[key] = value == 1 and true or false end - if modOption.type == 'number' then + if modOption.type == "number" then modOptions[key] = tonumber(modOptions[key]) end end @@ -27,17 +27,17 @@ if Spring.GetModOptions then setmetatable(readOnlyModOptions, { __index = modOptions, __newindex = function(t, k, v) - error("attempt to update a read-only Spring.GetModOptions table", 2) - end + error("attempt to update a read-only Spring.GetModOptions table", 2) + end, }) - Spring.GetModOptions = function () + Spring.GetModOptions = function() return readOnlyModOptions end -- Returns a copy of the modOptions table. Slower, but allows iterating over -- the returned table using pairs/ipairs. - Spring.GetModOptionsCopy = function () + Spring.GetModOptionsCopy = function() return table.copy(modOptions) end end @@ -47,12 +47,12 @@ if Spring.Echo then local printOptions = { pretty = true } local function multiEcho(...) - local n = select('#', ...) + local n = select("#", ...) local firstTableIndex local tableCount = 0 for index = 1, n do - if type(select(index, ...)) == 'table' then + if type(select(index, ...)) == "table" then tableCount = tableCount + 1 if not firstTableIndex then firstTableIndex = index @@ -75,7 +75,7 @@ if Spring.Echo then local args = table.pack(...) for index = firstTableIndex, n do - if type(args[index]) == 'table' then + if type(args[index]) == "table" then echo(table.toString(args[index], printOptions)) end end diff --git a/common/springUtilities/color.lua b/common/springUtilities/color.lua index 6ad5dd11ac3..af1a27f90f3 100644 --- a/common/springUtilities/color.lua +++ b/common/springUtilities/color.lua @@ -11,26 +11,28 @@ local colorAndOutlineIndicator = Game.textColorCodes.ColorAndOutline local function ColorStringEx(r, g, b, a, oR, oG, oB, oA) -- Formats alpha and also outline color. - return colorAndOutlineIndicator .. schar(floor(r * 255)) .. schar(floor(g * 255)) .. - schar(floor(b * 255)) .. schar(floor(a * 255)) .. - schar(floor(oR * 255)) .. schar(floor(oG * 255)) .. - schar(floor(oB * 255)) .. schar(floor(oA * 255)) + return colorAndOutlineIndicator .. schar(floor(r * 255)) .. schar(floor(g * 255)) .. schar(floor(b * 255)) .. schar(floor(a * 255)) .. schar(floor(oR * 255)) .. schar(floor(oG * 255)) .. schar(floor(oB * 255)) .. schar(floor(oA * 255)) end local function ColorArray(r, g, b) return floor(r * 255), floor(g * 255), floor(b * 255) end - local function ColorString(r, g, b) -- Standard R, G, B color code. r = floor(r * 255) g = floor(g * 255) b = floor(b * 255) -- avoid special char used by i18n - if r == 37 then r = 38 end -- 37 = % - if g == 37 then g = 38 end -- 37 = % - if b == 37 then b = 38 end -- 37 = % + if r == 37 then + r = 38 + end -- 37 = % + if g == 37 then + g = 38 + end -- 37 = % + if b == 37 then + b = 38 + end -- 37 = % return colorIndicator .. schar(r) .. schar(g) .. schar(b) end @@ -38,26 +40,26 @@ local function RgbToLinear(c) -- Convert Gamma corrected RGB (0-1) to linear RGB -- See https://en.wikipedia.org/wiki/SRGB#From_sRGB_to_CIE_XYZ for an explanation of this transfert function - if c <= 0.04045 then - return c / 12.92 - end - return math_pow((c + 0.055) / 1.055, 2.4) + if c <= 0.04045 then + return c / 12.92 + end + return math_pow((c + 0.055) / 1.055, 2.4) end local function RgbToY(r, g, b) -- Convert Gamma corrected RGB (0-1) to the Y' relative luminance of XYZ - -- Linearize the RGB values - local linearR = RgbToLinear(r) - local linearG = RgbToLinear(g) - local linearB = RgbToLinear(b) + -- Linearize the RGB values + local linearR = RgbToLinear(r) + local linearG = RgbToLinear(g) + local linearB = RgbToLinear(b) -- Compute the Y' component of XYZ - return linearR * 0.2126729 + linearG * 0.7151522 + linearB * 0.0721750 + return linearR * 0.2126729 + linearG * 0.7151522 + linearB * 0.0721750 end local function ColorIsDark(red, green, blue) - -- Determines if the (player) color is dark (i.e. if a white outline is needed) + -- Determines if the (player) color is dark (i.e. if a white outline is needed) -- Input color is a gamma corrected RGB (0-1) color -- 0.07 was selected because its the lower than all 16 colors in the BAR 8v8 color palette. So if the colors @@ -72,12 +74,24 @@ local function ConvertColor(r, g, b) r = floor(r * 255) g = floor(g * 255) b = floor(b * 255) - if r < 11 then r = 11 end - if g < 11 then g = 11 end - if b < 11 then b = 11 end - if r == 37 then r = 38 end - if g == 37 then g = 38 end - if b == 37 then b = 38 end + if r < 11 then + r = 11 + end + if g < 11 then + g = 11 + end + if b < 11 then + b = 11 + end + if r == 37 then + r = 38 + end + if g == 37 then + g = 38 + end + if b == 37 then + b = 38 + end return colorIndicator .. schar(r) .. schar(g) .. schar(b) end diff --git a/common/springUtilities/debug.lua b/common/springUtilities/debug.lua index 95fef3b7b48..dd723e9f667 100644 --- a/common/springUtilities/debug.lua +++ b/common/springUtilities/debug.lua @@ -2,17 +2,19 @@ local function paramsEcho(...) local called_from = "Called from: " .. tostring(debug.getinfo(2).name) .. " args:" Spring.Echo(called_from) local args = { ... } - Spring.Echo( table.toString(args) ) + Spring.Echo(table.toString(args)) return ... end local function traceEcho(...) - local myargs = {...} + local myargs = { ... } local parts = {} local n = 0 for i = 1, #myargs do - n = n + 1; parts[n] = tostring(myargs[i]) - n = n + 1; parts[n] = "\t" + n = n + 1 + parts[n] = tostring(myargs[i]) + n = n + 1 + parts[n] = "\t" end local infostr = n > 0 and (table.concat(parts) .. " ") or "" local functionstr = "Trace:[" @@ -22,18 +24,24 @@ local function traceEcho(...) local funcName = info.name if funcName then functionstr = functionstr .. tostring(funcName) .. " <- " - else break end - else break end + else + break + end + else + break + end end functionstr = functionstr .. "]" local arguments = "" local info2 = debug and debug.getinfo(2) local funcName1 = (info2 and info2.name) or "??" - if funcName1 ~= "??" then + if funcName1 ~= "??" then for i = 1, 10 do local name, value = debug.getlocal(2, i) - if not name then break end - local sep = ((arguments == "") and "") or "; " + if not name then + break + end + local sep = ((arguments == "") and "") or "; " arguments = arguments .. sep .. ((name and tostring(name)) or "name?") .. "=" .. tostring(value) end end @@ -41,12 +49,12 @@ local function traceEcho(...) end local function traceFullEcho(maxdepth, maxwidth, maxtableelements, ...) - -- Call it at any point, and it will give you the name of each function on the stack (up to maxdepth), + -- Call it at any point, and it will give you the name of each function on the stack (up to maxdepth), -- all arguments and first #maxwidth local variables of that function - -- if any of the values of the locals are tables, then it will try to shallow print + count them up to maxtablelements numbers. + -- if any of the values of the locals are tables, then it will try to shallow print + count them up to maxtablelements numbers. -- It will also just print any args after the first 3. (the ... part) -- It will also try to print the source file+line of each function - if (debug) then + if debug then else Spring.Echo("traceFullEcho needs debug to work, this seems to be missing or overwritten", debug) return @@ -55,31 +63,35 @@ local function traceFullEcho(maxdepth, maxwidth, maxtableelements, ...) local functionsource = true maxdepth = maxdepth or 16 maxwidth = maxwidth or 10 - maxtableelements = maxtableelements or 6 -- max amount of elements to expand from table type values + maxtableelements = maxtableelements or 6 -- max amount of elements to expand from table type values - local function dbgt(t, maxtableelements) - local count = 0 - local res = '' - for k,v in pairs(t) do - count = count + 1 - if count < maxtableelements then - if tracedebug then Spring.Echo(count, k) end + local function dbgt(t, maxtableelements) + local count = 0 + local res = "" + for k, v in pairs(t) do + count = count + 1 + if count < maxtableelements then + if tracedebug then + Spring.Echo(count, k) + end if type(k) == "number" and type(v) == "function" then -- try to get function lists? local vinfo = debug.getinfo(v) - if tracedebug then Spring.Echo(k,v, vinfo, vinfo.name) end --debug.getinfo(v).short_src)? - res = res .. tostring(k) .. ':' .. ((vinfo and vinfo.name) or "") ..', ' + if tracedebug then + Spring.Echo(k, v, vinfo, vinfo.name) + end --debug.getinfo(v).short_src)? + res = res .. tostring(k) .. ":" .. ((vinfo and vinfo.name) or "") .. ", " else - res = res .. tostring(k) .. ':' .. tostring(v) ..', ' + res = res .. tostring(k) .. ":" .. tostring(v) .. ", " end - end - end - res = '{'..res .. '}[#'..count..']' - return res - end + end + end + res = "{" .. res .. "}[#" .. count .. "]" + return res + end - local myargs = {...} + local myargs = { ... } local infostr = "TraceFullEcho:[" - for i,v in ipairs(myargs) do + for i, v in ipairs(myargs) do infostr = infostr .. tostring(v) .. "\t" end infostr = infostr .. "]\n" @@ -89,36 +101,48 @@ local function traceFullEcho(maxdepth, maxwidth, maxtableelements, ...) if info then local funcName = info.name if funcName then - functionstr = functionstr .. tostring(i-1) .. ": " .. tostring(funcName) .. " " + functionstr = functionstr .. tostring(i - 1) .. ": " .. tostring(funcName) .. " " local arguments = "" if funcName ~= "??" then - if functionsource and info.source then - local source = info.source - if string.len(source) > 128 then source = "sourcetoolong" end + if functionsource and info.source then + local source = info.source + if string.len(source) > 128 then + source = "sourcetoolong" + end functionstr = functionstr .. " @" .. source - end - if functionsource and info.linedefined then - functionstr = functionstr .. ":" .. tostring(info.linedefined) - end + end + if functionsource and info.linedefined then + functionstr = functionstr .. ":" .. tostring(info.linedefined) + end for j = 1, maxwidth do local name, value = debug.getlocal(i, j) - if not name then break end - if tracedebug then Spring.Echo(i,j, funcName,name) end - local sep = ((arguments == "") and "") or "; " - if tostring(name) == 'self' then - arguments = arguments .. sep .. ((name and tostring(name)) or "name?") .. "=" .. tostring("??") - else - local newvalue - if maxtableelements > 0 and type({}) == type(value) then newvalue = dbgt(value, maxtableelements) else newvalue = value end - arguments = arguments .. sep .. ((name and tostring(name)) or "name?") .. "=" .. tostring(newvalue) - end + if not name then + break + end + if tracedebug then + Spring.Echo(i, j, funcName, name) + end + local sep = ((arguments == "") and "") or "; " + if tostring(name) == "self" then + arguments = arguments .. sep .. ((name and tostring(name)) or "name?") .. "=" .. tostring("??") + else + local newvalue + if maxtableelements > 0 and type({}) == type(value) then + newvalue = dbgt(value, maxtableelements) + else + newvalue = value + end + arguments = arguments .. sep .. ((name and tostring(name)) or "name?") .. "=" .. tostring(newvalue) + end end end - functionstr = functionstr .. " Locals:(" .. arguments .. ")" .. "\n" - else - functionstr = functionstr .. tostring(i-1) .. ": ??\n" + functionstr = functionstr .. " Locals:(" .. arguments .. ")" .. "\n" + else + functionstr = functionstr .. tostring(i - 1) .. ": ??\n" end - else break end + else + break + end end Spring.Echo(infostr .. functionstr) end @@ -127,4 +151,4 @@ return { ParamsEcho = paramsEcho, TraceEcho = traceEcho, TraceFullEcho = traceFullEcho, -} \ No newline at end of file +} diff --git a/common/springUtilities/facingFunctions.lua b/common/springUtilities/facingFunctions.lua index 7c705675998..30d32b787e1 100644 --- a/common/springUtilities/facingFunctions.lua +++ b/common/springUtilities/facingFunctions.lua @@ -1,19 +1,19 @@ local facingMap = { south = 0, - east = 1, + east = 1, north = 2, - west = 3, + west = 3, s = 0, - e = 1, + e = 1, n = 2, - w = 3, + w = 3, [0] = 0, [1] = 1, [2] = 2, [3] = 3, } -local facingNames = { [0] = 's', [1] = 'e', [2] = 'n', [3] = 'w' } +local facingNames = { [0] = "s", [1] = "e", [2] = "n", [3] = "w" } -- TODO: remove this if/when Spring.CreateFeature and/or Spring.GetHeadingFromFacing supports named facings ---Convert a named facing to a heading integer (engine uses 0-65535 headings). diff --git a/common/springUtilities/image_tga.lua b/common/springUtilities/image_tga.lua index 2e70f10147f..49939352be8 100644 --- a/common/springUtilities/image_tga.lua +++ b/common/springUtilities/image_tga.lua @@ -15,48 +15,47 @@ local function loadTGA(fileName) -- returns texture | nil, error on failure end local texture = {} - local header = string.sub(file,1,18) + local header = string.sub(file, 1, 18) if header == nil then return nil, "Error loading header data." end - texture.channels = VFS.UnpackU8(header, 17)/8 -- bits per pixel --:byte(17) / 8 - texture.width = VFS.UnpackU16(header, 13) --header:byte(14) * 256 + header:byte(13) - texture.height = VFS.UnpackU16(header, 15) --header:byte(16) * 256 + header:byte(15) - texture.type = VFS.UnpackU8(header,3) - texture.format = (texture.channels == 4) and "RGBA" or "RGB" - texture.filename = fileName + texture.channels = VFS.UnpackU8(header, 17) / 8 -- bits per pixel --:byte(17) / 8 + texture.width = VFS.UnpackU16(header, 13) --header:byte(14) * 256 + header:byte(13) + texture.height = VFS.UnpackU16(header, 15) --header:byte(16) * 256 + header:byte(15) + texture.type = VFS.UnpackU8(header, 3) + texture.format = (texture.channels == 4) and "RGBA" or "RGB" + texture.filename = fileName if header:byte(3) ~= 2 and header:byte(3) ~= 3 then return nil, "Unsupported tga type. Only 8/24/32 bits uncompressed images are supported." end - local data = string.sub(file,19, texture.width * texture.height * texture.channels + 18) - if string.len(data) ~= texture.width * texture.height * texture.channels then --WHY +1????? - Spring.Echo("Failed to load",fileName,string.len(data), texture.width, texture.height, texture.channels) + local data = string.sub(file, 19, texture.width * texture.height * texture.channels + 18) + if string.len(data) ~= texture.width * texture.height * texture.channels then --WHY +1????? + Spring.Echo("Failed to load", fileName, string.len(data), texture.width, texture.height, texture.channels) return nil, "Error loading file, size mismatch" end --Spring.Echo("Trying to load",fileName,string.len(data), texture.width, texture.height, texture.channels) local offset = 0 local channels = texture.channels - for j=1, texture.height do + for j = 1, texture.height do local line = {} local lineIdx = 0 - for i=1, texture.width do - for k=1, channels do + for i = 1, texture.width do + for k = 1, channels do offset = offset + 1 local val = VFS.UnpackU8(data, offset) - if val and val >=0 and val <256 then - + if val and val >= 0 and val < 256 then else --Spring.Echo("LoadTGA failed to parse",j,i,k,val,offset) val = 0 end lineIdx = lineIdx + 1 line[lineIdx] = val - end + end end texture[j] = line end @@ -64,49 +63,59 @@ local function loadTGA(fileName) -- returns texture | nil, error on failure end local function saveTGA(texture, fileName) --return nil | error on failure - Spring.Echo("Saving",fileName) + Spring.Echo("Saving", fileName) - local file = io.open(fileName,'wb') + local file = io.open(fileName, "wb") if file == nil then return "Failed to open file" end local datatype = 2 - if texture.channels == 1 then datatype = 3 end + if texture.channels == 1 then + datatype = 3 + end - local header = VFS.PackU16(0,datatype,0,0,0,0, texture.width, texture.height, 8* texture.channels) + local header = VFS.PackU16(0, datatype, 0, 0, 0, 0, texture.width, texture.height, 8 * texture.channels) file:write(header) for j = 1, texture.height do for i = 1, texture.width do for k = 1, texture.channels do - file:write(VFS.PackU8(texture[j][(i-1)*texture.channels + k])) + file:write(VFS.PackU8(texture[j][(i - 1) * texture.channels + k])) end end end file:close() - Spring.Echo("Saved",fileName) + Spring.Echo("Saved", fileName) return nil end local function newTGA(width, height, channels, initvalue) -- returns the new 'texture table' or nil, error -- initvalue is a table of b,g,r,a - if initvalue == nil then initvalue = {0,0,0,0} end - if width < 1 then return nil, "Width must be greater than 0" end - if height < 1 then return nil, "Height must be greater than 0" end - if channels ~= 1 and channels ~= 3 and channels ~=4 then return nil, "Channels must be 1,3 or 4" end + if initvalue == nil then + initvalue = { 0, 0, 0, 0 } + end + if width < 1 then + return nil, "Width must be greater than 0" + end + if height < 1 then + return nil, "Height must be greater than 0" + end + if channels ~= 1 and channels ~= 3 and channels ~= 4 then + return nil, "Channels must be 1,3 or 4" + end local texture = {} - texture.channels = channels - texture.width = width - texture.height = height + texture.channels = channels + texture.width = width + texture.height = height - for j=1, height do + for j = 1, height do local line = {} local lineIdx = 0 - for i=1, width do - for k=1, channels do + for i = 1, width do + for k = 1, channels do lineIdx = lineIdx + 1 line[lineIdx] = initvalue[k] end diff --git a/common/springUtilities/safeluaparser.lua b/common/springUtilities/safeluaparser.lua index 58dc944564c..4900504aefd 100644 --- a/common/springUtilities/safeluaparser.lua +++ b/common/springUtilities/safeluaparser.lua @@ -14,1030 +14,1010 @@ end ]] - -- TODO: -- [x] Handle the case where a single table is returned from the input string, e.g: - -- return {key = "value" } +-- return {key = "value" } -- [x] Handle function definitions, by returning them as a string, - -- func = function() return true end - -- Should become: - -- func = "function() return true end" +-- func = function() return true end +-- Should become: +-- func = "function() return true end" -- [x] Handle in-place function executions, by also returning them as a string: - -- func = (function() return true end)() - -- Should become: - -- func = "(function() return true end)()" +-- func = (function() return true end)() +-- Should become: +-- func = "(function() return true end)()" -- [x] wrap the whole safeLuaTableParser in a pcall and return an empty table on failure --- - - +-- -- Internal parser function that does the actual parsing local function _safeLuaTableParserInternal(text) - if not text or type(text) ~= 'string' then - return nil, "Invalid input: expected string" - end - - local pos = 1 - local len = #text - - -- Skip whitespace and comments - local function skipWhitespaceAndComments() - while pos <= len do - local char = text:sub(pos, pos) - if char:match('%s') then - pos = pos + 1 - elseif text:sub(pos, pos + 1) == '--' then - -- Check if this is a block comment --[[...]] - if pos + 3 <= len and text:sub(pos + 2, pos + 2) == '[' then - -- This might be a block comment, check for opening pattern - local blockStart = pos + 2 - local equalCount = 0 - local checkPos = blockStart + 1 - - -- Count equals after first '[' - while checkPos <= len and text:sub(checkPos, checkPos) == '=' do - equalCount = equalCount + 1 - checkPos = checkPos + 1 - end - - -- Check for second '[' - if checkPos <= len and text:sub(checkPos, checkPos) == '[' then - -- This is a block comment --[=*[...]=*] - pos = checkPos + 1 - local closePattern = ']' .. string.rep('=', equalCount) .. ']' - - -- Find the matching closing pattern - local found = false - while pos <= len - #closePattern + 1 do - if text:sub(pos, pos + #closePattern - 1) == closePattern then - pos = pos + #closePattern - found = true - break - end - pos = pos + 1 - end - - if not found then - -- Unterminated block comment, skip to end - pos = len + 1 - end - else - -- Not a block comment, treat as line comment - while pos <= len and text:sub(pos, pos) ~= '\n' do - pos = pos + 1 - end - end - else - -- Regular line comment - while pos <= len and text:sub(pos, pos) ~= '\n' do - pos = pos + 1 - end - end - else - break - end - end - end - - -- Parse a string literal - local function parseString() - local quote = text:sub(pos, pos) - if quote ~= '"' and quote ~= "'" then - return nil, "Expected string" - end - - pos = pos + 1 - local result = "" - - while pos <= len do - local char = text:sub(pos, pos) - if char == quote then - pos = pos + 1 - return result - elseif char == '\\' then - pos = pos + 1 - if pos <= len then - local escaped = text:sub(pos, pos) - if escaped == 'n' then - result = result .. '\n' - elseif escaped == 't' then - result = result .. '\t' - elseif escaped == 'r' then - result = result .. '\r' - elseif escaped == '\\' then - result = result .. '\\' - elseif escaped == quote then - result = result .. quote - else - result = result .. escaped - end - pos = pos + 1 - end - else - result = result .. char - pos = pos + 1 - end - end - - return nil, "Unterminated string" - end - - -- Parse a long string literal [[...]] - local function parseLongString() - -- We expect to be at the first '[' - if pos > len or text:sub(pos, pos) ~= '[' then - return nil, "Expected '['" - end - - -- Count the number of '=' characters between the brackets - local start = pos - pos = pos + 1 - local equalCount = 0 - - -- Count equals after first '[' - while pos <= len and text:sub(pos, pos) == '=' do - equalCount = equalCount + 1 - pos = pos + 1 - end - - -- Expect second '[' - if pos > len or text:sub(pos, pos) ~= '[' then - return nil, "Expected second '[' in long string" - end - pos = pos + 1 - - -- Build the closing pattern - local closePattern = ']' .. string.rep('=', equalCount) .. ']' - - local result = "" - local contentStart = pos - - -- Find the matching closing bracket sequence - while pos <= len do - if text:sub(pos, pos) == ']' then - -- Check if this is our closing pattern - if pos + #closePattern - 1 <= len and text:sub(pos, pos + #closePattern - 1) == closePattern then - -- Found the end - result = text:sub(contentStart, pos - 1) - pos = pos + #closePattern - return result - end - end - pos = pos + 1 - end - - return nil, "Unterminated long string" - end - - -- Parse a number - local function parseNumber() - local start = pos - local hasDecimal = false - - if text:sub(pos, pos) == '-' then - pos = pos + 1 - end - - while pos <= len do - local char = text:sub(pos, pos) - if char:match('%d') then - pos = pos + 1 - elseif char == '.' and not hasDecimal then - hasDecimal = true - pos = pos + 1 - else - break - end - end - - local numStr = text:sub(start, pos - 1) - local num = tonumber(numStr) - if num then - return num - else - return nil, "Invalid number: " .. numStr - end - end - - -- Parse an identifier/key - local function parseIdentifier() - local start = pos - local char = text:sub(pos, pos) - - if not (char:match('%a') or char == '_') then - return nil, "Invalid identifier start" - end - - while pos <= len do - char = text:sub(pos, pos) - if char:match('%w') or char == '_' then - pos = pos + 1 - else - break - end - end - - return text:sub(start, pos - 1) - end - - -- Forward declaration - local parseValue - - -- Parse a function definition and return it as a string - local function parseFunction() - local start = pos - - -- We expect to be at the beginning of "function" - if pos + 7 > len or text:sub(pos, pos + 7) ~= "function" then - return nil, "Expected 'function'" - end - - pos = pos + 8 -- Skip "function" - - -- Count all 'end' keywords we need to match - local depth = 1 -- We're already inside one function (need 1 'end') - local inString = false - local stringChar = nil - local endFound = false - local expectingDo = false -- Track if we're expecting a 'do' after for/while - - while pos <= len and not endFound do - local char = text:sub(pos, pos) - - if inString then - if char == stringChar then - -- Check if it's escaped - local backslashes = 0 - local checkPos = pos - 1 - while checkPos >= 1 and text:sub(checkPos, checkPos) == '\\' do - backslashes = backslashes + 1 - checkPos = checkPos - 1 - end - if backslashes % 2 == 0 then - inString = false - stringChar = nil - end - end - else - if char == '"' or char == "'" then - inString = true - stringChar = char - elseif char:match('%a') then - -- Check for keywords that start/end blocks - local wordStart = pos - while pos <= len and (text:sub(pos, pos):match('%w') or text:sub(pos, pos) == '_') do - pos = pos + 1 - end - local word = text:sub(wordStart, pos - 1) - - if word == "function" or word == "if" then - -- These always need an 'end' - depth = depth + 1 - expectingDo = false - elseif word == "for" or word == "while" then - -- These need an 'end' and will have a 'do' - depth = depth + 1 - expectingDo = true - elseif word == "do" then - -- If we were expecting 'do' from for/while, don't count it as a separate block - if not expectingDo then - depth = depth + 1 - end - expectingDo = false - elseif word == "repeat" then - -- repeat...until doesn't use 'end' - expectingDo = false - elseif word == "end" then - depth = depth - 1 - if depth == 0 then - endFound = true - end - expectingDo = false - elseif word == "until" then - -- until ends a repeat block (no 'end' needed for repeat) - expectingDo = false - else - -- Other keywords don't affect our block counting - -- But some keywords reset the expectingDo flag - if not word:match("^(local|return|break|and|or|not|in|then|else|elseif|pairs|type|v)$") then - expectingDo = false - end - end - pos = pos - 1 -- Adjust for the increment at the end of the loop - end - end - - pos = pos + 1 - end - - if not endFound then - return nil, "Unterminated function (depth=" .. depth .. ")" - end - - local functionStr = text:sub(start, pos - 1) - return functionStr - end - - -- Parse an in-place function execution: (function() ... end)() - local function parseInPlaceFunctionExecution() - local start = pos - - -- We expect to be at the beginning of "(" - if text:sub(pos, pos) ~= "(" then - return nil, "Expected '('" - end - - pos = pos + 1 -- Skip "(" - skipWhitespaceAndComments() - - -- Check if this is a function - if text:sub(pos, pos + 7) ~= "function" then - return nil, "Expected 'function' after '('" - end - - -- Parse the function - local functionStr, err = parseFunction() - if not functionStr then - return nil, err - end - - skipWhitespaceAndComments() - - -- Expect closing parenthesis - if pos > len or text:sub(pos, pos) ~= ")" then - return nil, "Expected ')' after function" - end - pos = pos + 1 - - skipWhitespaceAndComments() - - -- Expect opening parenthesis for function call - if pos > len or text:sub(pos, pos) ~= "(" then - return nil, "Expected '(' for function call" - end - - -- Find the matching closing parenthesis for the function call - local parenDepth = 1 - local callStart = pos - pos = pos + 1 - local inString = false - local stringChar = nil - - while pos <= len and parenDepth > 0 do - local char = text:sub(pos, pos) - - if inString then - if char == stringChar then - -- Check if it's escaped - local backslashes = 0 - local checkPos = pos - 1 - while checkPos >= 1 and text:sub(checkPos, checkPos) == '\\' do - backslashes = backslashes + 1 - checkPos = checkPos - 1 - end - if backslashes % 2 == 0 then - inString = false - stringChar = nil - end - end - else - if char == '"' or char == "'" then - inString = true - stringChar = char - elseif char == '(' then - parenDepth = parenDepth + 1 - elseif char == ')' then - parenDepth = parenDepth - 1 - end - end - - pos = pos + 1 - end - - if parenDepth > 0 then - return nil, "Unterminated function call" - end - - local fullExpressionStr = text:sub(start, pos - 1) - return fullExpressionStr - end - - -- Parse a table - local function parseTable() - local result = {} - local arrayIndex = 1 - - skipWhitespaceAndComments() - if pos > len or text:sub(pos, pos) ~= '{' then - return nil, "Expected '{'" - end - pos = pos + 1 - - skipWhitespaceAndComments() - - -- Empty table - if pos <= len and text:sub(pos, pos) == '}' then - pos = pos + 1 - return result - end - - while pos <= len do - skipWhitespaceAndComments() - - if pos > len then - return nil, "Unexpected end of input" - end - - if text:sub(pos, pos) == '}' then - pos = pos + 1 - return result - end - - local key, value - local char = text:sub(pos, pos) - - -- Check for explicit key - if char == '[' then - -- Bracketed key [key] = value - pos = pos + 1 - skipWhitespaceAndComments() - - key, err = parseValue() - if not key then - return nil, err - end - - skipWhitespaceAndComments() - if pos > len or text:sub(pos, pos) ~= ']' then - return nil, "Expected ']'" - end - pos = pos + 1 - - skipWhitespaceAndComments() - if pos > len or text:sub(pos, pos) ~= '=' then - return nil, "Expected '=' after key" - end - pos = pos + 1 - - elseif char:match('%a') or char == '_' then - -- Identifier key - local identifier = parseIdentifier() - if not identifier then - return nil, "Invalid identifier" - end - - skipWhitespaceAndComments() - if pos <= len and text:sub(pos, pos) == '=' then - -- It's a key = value pair - pos = pos + 1 - key = identifier - else - -- It's just a value (identifier as string) - key = arrayIndex - arrayIndex = arrayIndex + 1 - -- Reset position to parse the identifier as a value - pos = pos - #identifier - end - else - -- Array element - key = arrayIndex - arrayIndex = arrayIndex + 1 - end - - skipWhitespaceAndComments() - value, err = parseValue() - if not value and err then - return nil, err - end - - result[key] = value - - skipWhitespaceAndComments() - if pos <= len then - char = text:sub(pos, pos) - if char == ',' or char == ';' then - pos = pos + 1 - elseif char == '}' then - -- Will be handled in next iteration - else - return nil, string.format("Expected ',' or '}', got '%s' at pos %d", char, pos ) - end - end - end - - return nil, "Unterminated table" - end - - -- Parse any value - parseValue = function() - skipWhitespaceAndComments() - - if pos > len then - return nil, "Unexpected end of input" - end - - local char = text:sub(pos, pos) - - -- String - if char == '"' or char == "'" then - return parseString() - - -- Long string [[...]] - elseif char == '[' then - -- Check if this is a long string (starts with '[' followed by optional '=' and another '[') - local nextPos = pos + 1 - local isLongString = false - - -- Skip any '=' characters - while nextPos <= len and text:sub(nextPos, nextPos) == '=' do - nextPos = nextPos + 1 - end - - -- Check if we have another '[' after the equals - if nextPos <= len and text:sub(nextPos, nextPos) == '[' then - isLongString = true - end - - if isLongString then - return parseLongString() - else - return nil, "Unexpected character: " .. char - end - - -- Number - elseif char:match('%d') or char == '-' or char == '.' then - return parseNumber() - - -- Table - elseif char == '{' then - return parseTable() - - -- In-place function execution: (function() ... end)() - elseif char == '(' then - return parseInPlaceFunctionExecution() - - -- Boolean or nil - elseif char:match('%a') then - local identifier = parseIdentifier() - if identifier == 'true' then - return true - elseif identifier == 'false' then - return false - elseif identifier == 'nil' then - return nil - elseif identifier == 'function' then - -- Reset position to start of "function" keyword - pos = pos - #identifier - return parseFunction() - else - -- Treat as string literal (unquoted identifier) - return identifier - end - - else - return nil, "Unexpected character: " .. char - end - end - - -- First, check if the input starts with "return" - skipWhitespaceAndComments() - - -- Check for "return" keyword at the beginning - if pos <= len - 5 and text:sub(pos, pos + 5) == "return" then - -- Check if it's followed by whitespace or a valid character - local nextPos = pos + 6 - if nextPos > len or text:sub(nextPos, nextPos):match('%s') or text:sub(nextPos, nextPos) == '{' then - pos = pos + 6 -- Skip "return" - skipWhitespaceAndComments() - end - end - - local result, err = parseValue() - if err then - return nil, err - end - - -- Make sure we've consumed all input (except trailing whitespace/comments) - skipWhitespaceAndComments() - if pos <= len then - return nil, "Unexpected trailing content" - end - - return result + if not text or type(text) ~= "string" then + return nil, "Invalid input: expected string" + end + + local pos = 1 + local len = #text + + -- Skip whitespace and comments + local function skipWhitespaceAndComments() + while pos <= len do + local char = text:sub(pos, pos) + if char:match("%s") then + pos = pos + 1 + elseif text:sub(pos, pos + 1) == "--" then + -- Check if this is a block comment --[[...]] + if pos + 3 <= len and text:sub(pos + 2, pos + 2) == "[" then + -- This might be a block comment, check for opening pattern + local blockStart = pos + 2 + local equalCount = 0 + local checkPos = blockStart + 1 + + -- Count equals after first '[' + while checkPos <= len and text:sub(checkPos, checkPos) == "=" do + equalCount = equalCount + 1 + checkPos = checkPos + 1 + end + + -- Check for second '[' + if checkPos <= len and text:sub(checkPos, checkPos) == "[" then + -- This is a block comment --[=*[...]=*] + pos = checkPos + 1 + local closePattern = "]" .. string.rep("=", equalCount) .. "]" + + -- Find the matching closing pattern + local found = false + while pos <= len - #closePattern + 1 do + if text:sub(pos, pos + #closePattern - 1) == closePattern then + pos = pos + #closePattern + found = true + break + end + pos = pos + 1 + end + + if not found then + -- Unterminated block comment, skip to end + pos = len + 1 + end + else + -- Not a block comment, treat as line comment + while pos <= len and text:sub(pos, pos) ~= "\n" do + pos = pos + 1 + end + end + else + -- Regular line comment + while pos <= len and text:sub(pos, pos) ~= "\n" do + pos = pos + 1 + end + end + else + break + end + end + end + + -- Parse a string literal + local function parseString() + local quote = text:sub(pos, pos) + if quote ~= '"' and quote ~= "'" then + return nil, "Expected string" + end + + pos = pos + 1 + local result = "" + + while pos <= len do + local char = text:sub(pos, pos) + if char == quote then + pos = pos + 1 + return result + elseif char == "\\" then + pos = pos + 1 + if pos <= len then + local escaped = text:sub(pos, pos) + if escaped == "n" then + result = result .. "\n" + elseif escaped == "t" then + result = result .. "\t" + elseif escaped == "r" then + result = result .. "\r" + elseif escaped == "\\" then + result = result .. "\\" + elseif escaped == quote then + result = result .. quote + else + result = result .. escaped + end + pos = pos + 1 + end + else + result = result .. char + pos = pos + 1 + end + end + + return nil, "Unterminated string" + end + + -- Parse a long string literal [[...]] + local function parseLongString() + -- We expect to be at the first '[' + if pos > len or text:sub(pos, pos) ~= "[" then + return nil, "Expected '['" + end + + -- Count the number of '=' characters between the brackets + local start = pos + pos = pos + 1 + local equalCount = 0 + + -- Count equals after first '[' + while pos <= len and text:sub(pos, pos) == "=" do + equalCount = equalCount + 1 + pos = pos + 1 + end + + -- Expect second '[' + if pos > len or text:sub(pos, pos) ~= "[" then + return nil, "Expected second '[' in long string" + end + pos = pos + 1 + + -- Build the closing pattern + local closePattern = "]" .. string.rep("=", equalCount) .. "]" + + local result = "" + local contentStart = pos + + -- Find the matching closing bracket sequence + while pos <= len do + if text:sub(pos, pos) == "]" then + -- Check if this is our closing pattern + if pos + #closePattern - 1 <= len and text:sub(pos, pos + #closePattern - 1) == closePattern then + -- Found the end + result = text:sub(contentStart, pos - 1) + pos = pos + #closePattern + return result + end + end + pos = pos + 1 + end + + return nil, "Unterminated long string" + end + + -- Parse a number + local function parseNumber() + local start = pos + local hasDecimal = false + + if text:sub(pos, pos) == "-" then + pos = pos + 1 + end + + while pos <= len do + local char = text:sub(pos, pos) + if char:match("%d") then + pos = pos + 1 + elseif char == "." and not hasDecimal then + hasDecimal = true + pos = pos + 1 + else + break + end + end + + local numStr = text:sub(start, pos - 1) + local num = tonumber(numStr) + if num then + return num + else + return nil, "Invalid number: " .. numStr + end + end + + -- Parse an identifier/key + local function parseIdentifier() + local start = pos + local char = text:sub(pos, pos) + + if not (char:match("%a") or char == "_") then + return nil, "Invalid identifier start" + end + + while pos <= len do + char = text:sub(pos, pos) + if char:match("%w") or char == "_" then + pos = pos + 1 + else + break + end + end + + return text:sub(start, pos - 1) + end + + -- Forward declaration + local parseValue + + -- Parse a function definition and return it as a string + local function parseFunction() + local start = pos + + -- We expect to be at the beginning of "function" + if pos + 7 > len or text:sub(pos, pos + 7) ~= "function" then + return nil, "Expected 'function'" + end + + pos = pos + 8 -- Skip "function" + + -- Count all 'end' keywords we need to match + local depth = 1 -- We're already inside one function (need 1 'end') + local inString = false + local stringChar = nil + local endFound = false + local expectingDo = false -- Track if we're expecting a 'do' after for/while + + while pos <= len and not endFound do + local char = text:sub(pos, pos) + + if inString then + if char == stringChar then + -- Check if it's escaped + local backslashes = 0 + local checkPos = pos - 1 + while checkPos >= 1 and text:sub(checkPos, checkPos) == "\\" do + backslashes = backslashes + 1 + checkPos = checkPos - 1 + end + if backslashes % 2 == 0 then + inString = false + stringChar = nil + end + end + else + if char == '"' or char == "'" then + inString = true + stringChar = char + elseif char:match("%a") then + -- Check for keywords that start/end blocks + local wordStart = pos + while pos <= len and (text:sub(pos, pos):match("%w") or text:sub(pos, pos) == "_") do + pos = pos + 1 + end + local word = text:sub(wordStart, pos - 1) + + if word == "function" or word == "if" then + -- These always need an 'end' + depth = depth + 1 + expectingDo = false + elseif word == "for" or word == "while" then + -- These need an 'end' and will have a 'do' + depth = depth + 1 + expectingDo = true + elseif word == "do" then + -- If we were expecting 'do' from for/while, don't count it as a separate block + if not expectingDo then + depth = depth + 1 + end + expectingDo = false + elseif word == "repeat" then + -- repeat...until doesn't use 'end' + expectingDo = false + elseif word == "end" then + depth = depth - 1 + if depth == 0 then + endFound = true + end + expectingDo = false + elseif word == "until" then + -- until ends a repeat block (no 'end' needed for repeat) + expectingDo = false + else + -- Other keywords don't affect our block counting + -- But some keywords reset the expectingDo flag + if not word:match("^(local|return|break|and|or|not|in|then|else|elseif|pairs|type|v)$") then + expectingDo = false + end + end + pos = pos - 1 -- Adjust for the increment at the end of the loop + end + end + + pos = pos + 1 + end + + if not endFound then + return nil, "Unterminated function (depth=" .. depth .. ")" + end + + local functionStr = text:sub(start, pos - 1) + return functionStr + end + + -- Parse an in-place function execution: (function() ... end)() + local function parseInPlaceFunctionExecution() + local start = pos + + -- We expect to be at the beginning of "(" + if text:sub(pos, pos) ~= "(" then + return nil, "Expected '('" + end + + pos = pos + 1 -- Skip "(" + skipWhitespaceAndComments() + + -- Check if this is a function + if text:sub(pos, pos + 7) ~= "function" then + return nil, "Expected 'function' after '('" + end + + -- Parse the function + local functionStr, err = parseFunction() + if not functionStr then + return nil, err + end + + skipWhitespaceAndComments() + + -- Expect closing parenthesis + if pos > len or text:sub(pos, pos) ~= ")" then + return nil, "Expected ')' after function" + end + pos = pos + 1 + + skipWhitespaceAndComments() + + -- Expect opening parenthesis for function call + if pos > len or text:sub(pos, pos) ~= "(" then + return nil, "Expected '(' for function call" + end + + -- Find the matching closing parenthesis for the function call + local parenDepth = 1 + local callStart = pos + pos = pos + 1 + local inString = false + local stringChar = nil + + while pos <= len and parenDepth > 0 do + local char = text:sub(pos, pos) + + if inString then + if char == stringChar then + -- Check if it's escaped + local backslashes = 0 + local checkPos = pos - 1 + while checkPos >= 1 and text:sub(checkPos, checkPos) == "\\" do + backslashes = backslashes + 1 + checkPos = checkPos - 1 + end + if backslashes % 2 == 0 then + inString = false + stringChar = nil + end + end + else + if char == '"' or char == "'" then + inString = true + stringChar = char + elseif char == "(" then + parenDepth = parenDepth + 1 + elseif char == ")" then + parenDepth = parenDepth - 1 + end + end + + pos = pos + 1 + end + + if parenDepth > 0 then + return nil, "Unterminated function call" + end + + local fullExpressionStr = text:sub(start, pos - 1) + return fullExpressionStr + end + + -- Parse a table + local function parseTable() + local result = {} + local arrayIndex = 1 + + skipWhitespaceAndComments() + if pos > len or text:sub(pos, pos) ~= "{" then + return nil, "Expected '{'" + end + pos = pos + 1 + + skipWhitespaceAndComments() + + -- Empty table + if pos <= len and text:sub(pos, pos) == "}" then + pos = pos + 1 + return result + end + + while pos <= len do + skipWhitespaceAndComments() + + if pos > len then + return nil, "Unexpected end of input" + end + + if text:sub(pos, pos) == "}" then + pos = pos + 1 + return result + end + + local key, value + local char = text:sub(pos, pos) + + -- Check for explicit key + if char == "[" then + -- Bracketed key [key] = value + pos = pos + 1 + skipWhitespaceAndComments() + + key, err = parseValue() + if not key then + return nil, err + end + + skipWhitespaceAndComments() + if pos > len or text:sub(pos, pos) ~= "]" then + return nil, "Expected ']'" + end + pos = pos + 1 + + skipWhitespaceAndComments() + if pos > len or text:sub(pos, pos) ~= "=" then + return nil, "Expected '=' after key" + end + pos = pos + 1 + elseif char:match("%a") or char == "_" then + -- Identifier key + local identifier = parseIdentifier() + if not identifier then + return nil, "Invalid identifier" + end + + skipWhitespaceAndComments() + if pos <= len and text:sub(pos, pos) == "=" then + -- It's a key = value pair + pos = pos + 1 + key = identifier + else + -- It's just a value (identifier as string) + key = arrayIndex + arrayIndex = arrayIndex + 1 + -- Reset position to parse the identifier as a value + pos = pos - #identifier + end + else + -- Array element + key = arrayIndex + arrayIndex = arrayIndex + 1 + end + + skipWhitespaceAndComments() + value, err = parseValue() + if not value and err then + return nil, err + end + + result[key] = value + + skipWhitespaceAndComments() + if pos <= len then + char = text:sub(pos, pos) + if char == "," or char == ";" then + pos = pos + 1 + elseif char == "}" then + -- Will be handled in next iteration + else + return nil, string.format("Expected ',' or '}', got '%s' at pos %d", char, pos) + end + end + end + + return nil, "Unterminated table" + end + + -- Parse any value + parseValue = function() + skipWhitespaceAndComments() + + if pos > len then + return nil, "Unexpected end of input" + end + + local char = text:sub(pos, pos) + + -- String + if char == '"' or char == "'" then + return parseString() + + -- Long string [[...]] + elseif char == "[" then + -- Check if this is a long string (starts with '[' followed by optional '=' and another '[') + local nextPos = pos + 1 + local isLongString = false + + -- Skip any '=' characters + while nextPos <= len and text:sub(nextPos, nextPos) == "=" do + nextPos = nextPos + 1 + end + + -- Check if we have another '[' after the equals + if nextPos <= len and text:sub(nextPos, nextPos) == "[" then + isLongString = true + end + + if isLongString then + return parseLongString() + else + return nil, "Unexpected character: " .. char + end + + -- Number + elseif char:match("%d") or char == "-" or char == "." then + return parseNumber() + + -- Table + elseif char == "{" then + return parseTable() + + -- In-place function execution: (function() ... end)() + elseif char == "(" then + return parseInPlaceFunctionExecution() + + -- Boolean or nil + elseif char:match("%a") then + local identifier = parseIdentifier() + if identifier == "true" then + return true + elseif identifier == "false" then + return false + elseif identifier == "nil" then + return nil + elseif identifier == "function" then + -- Reset position to start of "function" keyword + pos = pos - #identifier + return parseFunction() + else + -- Treat as string literal (unquoted identifier) + return identifier + end + else + return nil, "Unexpected character: " .. char + end + end + + -- First, check if the input starts with "return" + skipWhitespaceAndComments() + + -- Check for "return" keyword at the beginning + if pos <= len - 5 and text:sub(pos, pos + 5) == "return" then + -- Check if it's followed by whitespace or a valid character + local nextPos = pos + 6 + if nextPos > len or text:sub(nextPos, nextPos):match("%s") or text:sub(nextPos, nextPos) == "{" then + pos = pos + 6 -- Skip "return" + skipWhitespaceAndComments() + end + end + + local result, err = parseValue() + if err then + return nil, err + end + + -- Make sure we've consumed all input (except trailing whitespace/comments) + skipWhitespaceAndComments() + if pos <= len then + return nil, "Unexpected trailing content" + end + + return result end -- Public safe parser function that wraps the internal parser with pcall local function safeLuaTableParser(text) - local success, result, err = pcall(_safeLuaTableParserInternal, text) - - if success then - -- Internal function succeeded, return its result - if result then - return result, err - else - -- Internal function returned nil with error message - return {}, err or "Parse failed" - end - else - -- pcall failed, return empty table - return {}, "Parser error: " .. tostring(result) - end + local success, result, err = pcall(_safeLuaTableParserInternal, text) + + if success then + -- Internal function succeeded, return its result + if result then + return result, err + else + -- Internal function returned nil with error message + return {}, err or "Parse failed" + end + else + -- pcall failed, return empty table + return {}, "Parser error: " .. tostring(result) + end end +if not Spring then + local function deep_equal(a, b) + if a == b then + return true + end + if type(a) ~= "table" or type(b) ~= "table" then + return false, string.format("Type mismatch: %s vs %s (a=%s, b=%s)", type(a), type(b), tostring(a), tostring(b)) + end -if not Spring then - local function deep_equal(a, b) - if a == b then return true end - if type(a) ~= "table" or type(b) ~= "table" then - return false, string.format("Type mismatch: %s vs %s (a=%s, b=%s)", type(a), type(b), tostring(a), tostring(b)) - end + -- Check all keys/values in a + for k, v in pairs(a) do + local equal, reason = deep_equal(v, b[k]) + if not equal then + return false, string.format("At key [%s]: %s", tostring(k), reason or "values differ") + end + end - -- Check all keys/values in a - for k, v in pairs(a) do - local equal, reason = deep_equal(v, b[k]) - if not equal then - return false, string.format("At key [%s]: %s", tostring(k), reason or "values differ") - end - end + -- Ensure b doesn't have keys missing in a + for k in pairs(b) do + if a[k] == nil then + return false, string.format("Key [%s] exists in b but not in a", tostring(k)) + end + end - -- Ensure b doesn't have keys missing in a - for k in pairs(b) do - if a[k] == nil then - return false, string.format("Key [%s] exists in b but not in a", tostring(k)) - end - end + return true + end - return true - end + local function compare(ttext) + local safet, err1 = safeLuaTableParser(ttext) + local err2, unsafet = pcall(loadstring("return " .. ttext)) + local equal, reason = deep_equal(safet, unsafet) + print("The two tables are equal? " .. tostring(equal) .. " " .. reason or "") + if err1 then + print("safeLuaTableParser error: " .. tostring(err1)) + end + end - local function compare(ttext) - local safet, err1 = safeLuaTableParser(ttext) - local err2, unsafet = pcall(loadstring('return '..ttext)) - local equal, reason = deep_equal(safet, unsafet) - print("The two tables are equal? " .. tostring(equal) .. " " .. reason or "") - if err1 then - print("safeLuaTableParser error: " .. tostring(err1)) - end - end - - -- This is our test class when run outside of Spring - -- e.g. "C:\Users\Peti\Downloads\ZeroBraneStudio\bin\lua.exe" "C:\Users\Peti\Documents\My Games\Spring\games\Beyond-All-Reason.sdd\safeluaparser.lua" ... - - print("Running tests for safeLuaTableParser...") - -- Get the command line args from Lua executable: - local args = {...} - print("Command line args:", table.concat(args, ", ")) - - local content = nil - for i, arg in ipairs(args) do - print("Arg " .. i .. ": " .. arg) - local inputFile = args[1] - if inputFile then - print("Reading test input from file: " .. inputFile) - local file = io.open(inputFile, "r") - if file then - content = file:read("*all") - file:close() - - if content then - print("Parsing content from file...") - compare(content) - end - else - print("Error: Could not open file " .. inputFile) - end - else - print("No input file specified. Usage: lua safeluaparser.lua ") - end - end - - -- if args were given, exit straight up: - if #args ~= 0 then - print("Done with file tests, exiting.") - os.exit() - end - - - -- Test function definition parsing - local function testFunctionParsing() - print("Testing function definition parsing...") - - -- Test case 1: Simple function - local test1 = '{func = function() return true end}' - local result1, err1 = safeLuaTableParser(test1) - if result1 then - print("Test 1 passed: func = " .. tostring(result1.func)) - print("Type: " .. type(result1.func)) - else - print("Test 1 failed: " .. (err1 or "unknown error")) - end - - -- Test case 2: Function with parameters - local test2 = '{func = function(a, b) return a + b end}' - local result2, err2 = safeLuaTableParser(test2) - if result2 then - print("Test 2 passed: func = " .. tostring(result2.func)) - print("Type: " .. type(result2.func)) - else - print("Test 2 failed: " .. (err2 or "unknown error")) - end - - -- Test case 3: Nested function - local test3 = '{func = function() local inner = function() return 1 end; return inner() end}' - local result3, err3 = safeLuaTableParser(test3) - if result3 then - print("Test 3 passed: func = " .. tostring(result3.func)) - print("Type: " .. type(result3.func)) - else - print("Test 3 failed: " .. (err3 or "unknown error")) - end - - -- Test case 4: In-place function execution - local test4 = '{result = (function() return true end)()}' - local result4, err4 = safeLuaTableParser(test4) - if result4 then - print("Test 4 passed: result = " .. tostring(result4.result)) - print("Type: " .. type(result4.result)) - else - print("Test 4 failed: " .. (err4 or "unknown error")) - end - - -- Test case 5: In-place function execution with parameters - local test5 = '{result = (function(x) return x * 2 end)(5)}' - local result5, err5 = safeLuaTableParser(test5) - if result5 then - print("Test 5 passed: result = " .. tostring(result5.result)) - print("Type: " .. type(result5.result)) - else - print("Test 5 failed: " .. (err5 or "unknown error")) - end + -- This is our test class when run outside of Spring + -- e.g. "C:\Users\Peti\Downloads\ZeroBraneStudio\bin\lua.exe" "C:\Users\Peti\Documents\My Games\Spring\games\Beyond-All-Reason.sdd\safeluaparser.lua" ... - -- Test case 6: Complex function with nested definitions - local test6 = '{flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end }' - print("Testing complex function: " .. test6) - local result6, err6 = safeLuaTableParser(test6) - if result6 then - print("Test 6 passed: flip = " .. tostring(result6.flip)) - print("Type: " .. type(result6.flip)) - print(err6 or "no error") - else - print("Test 6 failed: " .. (err6 or "unknown error")) - end - - -- Test case 7: Just the function itself to debug - local test7 = 'function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end' - print("Testing standalone function: " .. test7) - local result7, err7 = safeLuaTableParser(test7) - if result7 then - print("Test 7 passed: result = " .. tostring(result7)) - print("Type: " .. type(result7)) - print("err7: " .. tostring(err7)) - else - print("Test 7 failed: " .. (err7 or "unknown error")) - end - - -- Test case 8: Just the function itself to debug - local test8 = [[{buildoptions=(function()local a={[1]='corfus',[2]='corafus',[3]='corageo',[4]='corbhmth',[5]='cormoho',[6]='cormexp',[7]='cormmkr',[8]='coruwadves',[9]='coruwadvms',[10]='corarad',[11]='corshroud',[12]='corfort',[13]='corlab',[14]='cortarg',[15]='corsd',[16]='corgate',[17]='cortoast',[18]='corvipe',[19]='cordoom',[20]='corflak',[21]='corscreamer',[22]='corvp',[23]='corfmd',[24]='corap',[25]='corint',[26]='corplat',[27]='corsy',[28]='coruwmme',[29]='coruwmmm',[30]='corenaa',[31]='corfdoom',[32]='coratl',[33]='coruwfus',[34]='corjugg',[35]='corshiva',[36]='corsumo',[37]='corgol',[38]='corkorg',[39]='cornanotc2plat',[40]='cornanotct2',[41]='cornecro',[42]='cordoomt3',[43]='corhllllt',[44]='cormaw',[45]='cormwall',[46]='corgatet3'}return a end)()}]] - print("Testing standalone function: " .. test8) - local result8, err8 = safeLuaTableParser(test8) - if result8 then - print("Test 8 passed: result = " .. tostring(result8)) - print("Type: " .. type(result8)) - print("err8: " .. tostring(err8)) - else - print("Test 8 failed: " .. (err8 or "unknown error")) - end - end - - testFunctionParsing() - - -- Test pcall wrapper functionality - local function testPcallWrapper() - print("\nTesting pcall wrapper functionality...") - - -- Test case 1: Valid input should work - local test1 = '{key = "value", number = 42}' - local result1, err1 = safeLuaTableParser(test1) - print("Test 1 (valid input):") - print(" Result type: " .. type(result1)) - if type(result1) == "table" then - print(" Table contents: key=" .. tostring(result1.key) .. ", number=" .. tostring(result1.number)) - end - print(" Error: " .. tostring(err1)) - - -- Test case 2: Invalid input should return empty table - local test2 = '{invalid syntax here @#$%' - local result2, err2 = safeLuaTableParser(test2) - print("Test 2 (invalid input):") - print(" Result type: " .. type(result2)) - print(" Table size: " .. #result2) - print(" Error: " .. tostring(err2)) - - -- Test case 3: Nil input should return empty table - local result3, err3 = safeLuaTableParser(nil) - print("Test 3 (nil input):") - print(" Result type: " .. type(result3)) - print(" Table size: " .. #result3) - print(" Error: " .. tostring(err3)) - - -- Test case 4: Empty string should return empty table - local result4, err4 = safeLuaTableParser("") - print("Test 4 (empty string):") - print(" Result type: " .. type(result4)) - print(" Table size: " .. #result4) - print(" Error: " .. tostring(err4)) - end - - testPcallWrapper() - - -- Test return statement handling - local function testReturnStatements() - print("\nTesting return statement handling...") - - -- Test case 1: return with a simple table - local test1 = 'return {key = "value", number = 42}' - local result1, err1 = safeLuaTableParser(test1) - print("Test 1 (return table):") - print(" Result type: " .. type(result1)) - if type(result1) == "table" then - print(" Table contents: key=" .. tostring(result1.key) .. ", number=" .. tostring(result1.number)) - end - print(" Error: " .. tostring(err1)) - - -- Test case 2: return with nested tables - local test2 = 'return {outer = {inner = "nested"}}' - local result2, err2 = safeLuaTableParser(test2) - print("Test 2 (return nested table):") - print(" Result type: " .. type(result2)) - if type(result2) == "table" and type(result2.outer) == "table" then - print(" Nested value: outer.inner=" .. tostring(result2.outer.inner)) - end - print(" Error: " .. tostring(err2)) - - -- Test case 3: return with comments and whitespace - local test3 = '-- This is a config file\nreturn {\n setting = true,\n value = 123\n}' - local result3, err3 = safeLuaTableParser(test3) - print("Test 3 (return with comments):") - print(" Result type: " .. type(result3)) - if type(result3) == "table" then - print(" Table contents: setting=" .. tostring(result3.setting) .. ", value=" .. tostring(result3.value)) - end - print(" Error: " .. tostring(err3)) - - -- Test case 4: return with function definitions - local test4 = 'return {func = function() return "hello" end}' - local result4, err4 = safeLuaTableParser(test4) - print("Test 4 (return with function):") - print(" Result type: " .. type(result4)) - if type(result4) == "table" then - print(" Function value: func=" .. tostring(result4.func) .. " (type: " .. type(result4.func) .. ")") - end - print(" Error: " .. tostring(err4)) - - -- Test case 5: Regular table without return (should still work) - local test5 = '{normal = "table"}' - local result5, err5 = safeLuaTableParser(test5) - print("Test 5 (normal table without return):") - print(" Result type: " .. type(result5)) - if type(result5) == "table" then - print(" Table contents: normal=" .. tostring(result5.normal)) - end - print(" Error: " .. tostring(err5)) - end - - testReturnStatements() - - -- Test long string parsing - local function testLongStrings() - print("\nTesting long string parsing...") - - -- Test case 1: Simple long string - local test1 = '{message = [[Hello, World!]]}' - local result1, err1 = safeLuaTableParser(test1) - print("Test 1 (simple long string):") - print(" Result type: " .. type(result1)) - if type(result1) == "table" then - print(" Message: " .. tostring(result1.message)) - end - print(" Error: " .. tostring(err1)) - - -- Test case 2: Long string with equals - local test2 = '{code = [==[function() return "nested quotes: ]]" end]==]}' - local result2, err2 = safeLuaTableParser(test2) - print("Test 2 (long string with equals):") - print(" Result type: " .. type(result2)) - if type(result2) == "table" then - print(" Code: " .. tostring(result2.code)) - end - print(" Error: " .. tostring(err2)) - - -- Test case 3: Long string with newlines - local test3 = '{multiline = [[Line 1\nLine 2\nLine 3]]}' - local result3, err3 = safeLuaTableParser(test3) - print("Test 3 (multiline long string):") - print(" Result type: " .. type(result3)) - if type(result3) == "table" then - print(" Multiline length: " .. #tostring(result3.multiline)) - print(" Contains newlines: " .. tostring(string.find(result3.multiline, '\n') ~= nil)) - end - print(" Error: " .. tostring(err3)) - - -- Test case 4: Empty long string - local test4 = '{empty = [[]]}' - local result4, err4 = safeLuaTableParser(test4) - print("Test 4 (empty long string):") - print(" Result type: " .. type(result4)) - if type(result4) == "table" then - print(" Empty string length: " .. #tostring(result4.empty)) - end - print(" Error: " .. tostring(err4)) - - -- Test case 5: Long string with multiple equals - local test5 = '{special = [===[This is a [=[nested]=] string]===]}' - local result5, err5 = safeLuaTableParser(test5) - print("Test 5 (long string with multiple equals):") - print(" Result type: " .. type(result5)) - if type(result5) == "table" then - print(" Special: " .. tostring(result5.special)) - end - print(" Error: " .. tostring(err5)) - end - - testLongStrings() - - -- Test block comment parsing - local function testBlockComments() - print("\nTesting block comment parsing...") - - -- Test case 1: Simple block comment - local test1 = '--[[ This is a block comment ]] {key = "value"}' - local result1, err1 = safeLuaTableParser(test1) - print("Test 1 (simple block comment):") - print(" Result type: " .. type(result1)) - if type(result1) == "table" then - print(" Key: " .. tostring(result1.key)) - end - print(" Error: " .. tostring(err1)) - - -- Test case 2: Block comment with equals - local test2 = '--[=[ This is a block comment with ]] inside ]=] {number = 42}' - local result2, err2 = safeLuaTableParser(test2) - print("Test 2 (block comment with equals):") - print(" Result type: " .. type(result2)) - if type(result2) == "table" then - print(" Number: " .. tostring(result2.number)) - end - print(" Error: " .. tostring(err2)) - - -- Test case 3: Multi-line block comment - local test3 = "--[[\n" .. - " This is a multi-line\n" .. - " block comment\n" .. - " ]]\n" .. - " {\n" .. - " setting = true,\n" .. - " value = 123\n" .. - " }" - local result3, err3 = safeLuaTableParser(test3) - print("Test 3 (multi-line block comment):") - print(" Result type: " .. type(result3)) - if type(result3) == "table" then - print(" Setting: " .. tostring(result3.setting) .. ", Value: " .. tostring(result3.value)) - end - print(" Error: " .. tostring(err3)) - - -- Test case 4: Mixed comments (line and block) - local test4 = "\n" .. - " -- Line comment\n" .. - " --[[ Block comment ]]\n" .. - " {\n" .. - " -- Another line comment\n" .. - " mixed = \"comments\",\n" .. - " --[=[ Another block comment ]=]\n" .. - " test = true\n" .. - " }" - local result4, err4 = safeLuaTableParser(test4) - print("Test 4 (mixed comments):") - print(" Result type: " .. type(result4)) - if type(result4) == "table" then - print(" Mixed: " .. tostring(result4.mixed) .. ", Test: " .. tostring(result4.test)) - end - print(" Error: " .. tostring(err4)) - - -- Test case 5: Block comment with nested content - local test5 = '--[=[ Comment with --[[ nested ]] content ]=] {nested = "value"}' - local result5, err5 = safeLuaTableParser(test5) - print("Test 5 (nested block comment content):") - print(" Result type: " .. type(result5)) - if type(result5) == "table" then - print(" Nested: " .. tostring(result5.nested)) - end - print(" Error: " .. tostring(err5)) - end + print("Running tests for safeLuaTableParser...") + -- Get the command line args from Lua executable: + local args = { ... } + print("Command line args:", table.concat(args, ", ")) + + local content = nil + for i, arg in ipairs(args) do + print("Arg " .. i .. ": " .. arg) + local inputFile = args[1] + if inputFile then + print("Reading test input from file: " .. inputFile) + local file = io.open(inputFile, "r") + if file then + content = file:read("*all") + file:close() + + if content then + print("Parsing content from file...") + compare(content) + end + else + print("Error: Could not open file " .. inputFile) + end + else + print("No input file specified. Usage: lua safeluaparser.lua ") + end + end + + -- if args were given, exit straight up: + if #args ~= 0 then + print("Done with file tests, exiting.") + os.exit() + end + + -- Test function definition parsing + local function testFunctionParsing() + print("Testing function definition parsing...") + + -- Test case 1: Simple function + local test1 = "{func = function() return true end}" + local result1, err1 = safeLuaTableParser(test1) + if result1 then + print("Test 1 passed: func = " .. tostring(result1.func)) + print("Type: " .. type(result1.func)) + else + print("Test 1 failed: " .. (err1 or "unknown error")) + end + + -- Test case 2: Function with parameters + local test2 = "{func = function(a, b) return a + b end}" + local result2, err2 = safeLuaTableParser(test2) + if result2 then + print("Test 2 passed: func = " .. tostring(result2.func)) + print("Type: " .. type(result2.func)) + else + print("Test 2 failed: " .. (err2 or "unknown error")) + end + + -- Test case 3: Nested function + local test3 = "{func = function() local inner = function() return 1 end; return inner() end}" + local result3, err3 = safeLuaTableParser(test3) + if result3 then + print("Test 3 passed: func = " .. tostring(result3.func)) + print("Type: " .. type(result3.func)) + else + print("Test 3 failed: " .. (err3 or "unknown error")) + end + + -- Test case 4: In-place function execution + local test4 = "{result = (function() return true end)()}" + local result4, err4 = safeLuaTableParser(test4) + if result4 then + print("Test 4 passed: result = " .. tostring(result4.result)) + print("Type: " .. type(result4.result)) + else + print("Test 4 failed: " .. (err4 or "unknown error")) + end + + -- Test case 5: In-place function execution with parameters + local test5 = "{result = (function(x) return x * 2 end)(5)}" + local result5, err5 = safeLuaTableParser(test5) + if result5 then + print("Test 5 passed: result = " .. tostring(result5.result)) + print("Type: " .. type(result5.result)) + else + print("Test 5 failed: " .. (err5 or "unknown error")) + end + + -- Test case 6: Complex function with nested definitions + local test6 = '{flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end }' + print("Testing complex function: " .. test6) + local result6, err6 = safeLuaTableParser(test6) + if result6 then + print("Test 6 passed: flip = " .. tostring(result6.flip)) + print("Type: " .. type(result6.flip)) + print(err6 or "no error") + else + print("Test 6 failed: " .. (err6 or "unknown error")) + end + + -- Test case 7: Just the function itself to debug + local test7 = 'function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end' + print("Testing standalone function: " .. test7) + local result7, err7 = safeLuaTableParser(test7) + if result7 then + print("Test 7 passed: result = " .. tostring(result7)) + print("Type: " .. type(result7)) + print("err7: " .. tostring(err7)) + else + print("Test 7 failed: " .. (err7 or "unknown error")) + end + + -- Test case 8: Just the function itself to debug + local test8 = [[{buildoptions=(function()local a={[1]='corfus',[2]='corafus',[3]='corageo',[4]='corbhmth',[5]='cormoho',[6]='cormexp',[7]='cormmkr',[8]='coruwadves',[9]='coruwadvms',[10]='corarad',[11]='corshroud',[12]='corfort',[13]='corlab',[14]='cortarg',[15]='corsd',[16]='corgate',[17]='cortoast',[18]='corvipe',[19]='cordoom',[20]='corflak',[21]='corscreamer',[22]='corvp',[23]='corfmd',[24]='corap',[25]='corint',[26]='corplat',[27]='corsy',[28]='coruwmme',[29]='coruwmmm',[30]='corenaa',[31]='corfdoom',[32]='coratl',[33]='coruwfus',[34]='corjugg',[35]='corshiva',[36]='corsumo',[37]='corgol',[38]='corkorg',[39]='cornanotc2plat',[40]='cornanotct2',[41]='cornecro',[42]='cordoomt3',[43]='corhllllt',[44]='cormaw',[45]='cormwall',[46]='corgatet3'}return a end)()}]] + print("Testing standalone function: " .. test8) + local result8, err8 = safeLuaTableParser(test8) + if result8 then + print("Test 8 passed: result = " .. tostring(result8)) + print("Type: " .. type(result8)) + print("err8: " .. tostring(err8)) + else + print("Test 8 failed: " .. (err8 or "unknown error")) + end + end + + testFunctionParsing() + + -- Test pcall wrapper functionality + local function testPcallWrapper() + print("\nTesting pcall wrapper functionality...") + + -- Test case 1: Valid input should work + local test1 = '{key = "value", number = 42}' + local result1, err1 = safeLuaTableParser(test1) + print("Test 1 (valid input):") + print(" Result type: " .. type(result1)) + if type(result1) == "table" then + print(" Table contents: key=" .. tostring(result1.key) .. ", number=" .. tostring(result1.number)) + end + print(" Error: " .. tostring(err1)) - testBlockComments() + -- Test case 2: Invalid input should return empty table + local test2 = "{invalid syntax here @#$%" + local result2, err2 = safeLuaTableParser(test2) + print("Test 2 (invalid input):") + print(" Result type: " .. type(result2)) + print(" Table size: " .. #result2) + print(" Error: " .. tostring(err2)) - print("done") -end + -- Test case 3: Nil input should return empty table + local result3, err3 = safeLuaTableParser(nil) + print("Test 3 (nil input):") + print(" Result type: " .. type(result3)) + print(" Table size: " .. #result3) + print(" Error: " .. tostring(err3)) + + -- Test case 4: Empty string should return empty table + local result4, err4 = safeLuaTableParser("") + print("Test 4 (empty string):") + print(" Result type: " .. type(result4)) + print(" Table size: " .. #result4) + print(" Error: " .. tostring(err4)) + end + + testPcallWrapper() + + -- Test return statement handling + local function testReturnStatements() + print("\nTesting return statement handling...") + + -- Test case 1: return with a simple table + local test1 = 'return {key = "value", number = 42}' + local result1, err1 = safeLuaTableParser(test1) + print("Test 1 (return table):") + print(" Result type: " .. type(result1)) + if type(result1) == "table" then + print(" Table contents: key=" .. tostring(result1.key) .. ", number=" .. tostring(result1.number)) + end + print(" Error: " .. tostring(err1)) + + -- Test case 2: return with nested tables + local test2 = 'return {outer = {inner = "nested"}}' + local result2, err2 = safeLuaTableParser(test2) + print("Test 2 (return nested table):") + print(" Result type: " .. type(result2)) + if type(result2) == "table" and type(result2.outer) == "table" then + print(" Nested value: outer.inner=" .. tostring(result2.outer.inner)) + end + print(" Error: " .. tostring(err2)) + + -- Test case 3: return with comments and whitespace + local test3 = "-- This is a config file\nreturn {\n setting = true,\n value = 123\n}" + local result3, err3 = safeLuaTableParser(test3) + print("Test 3 (return with comments):") + print(" Result type: " .. type(result3)) + if type(result3) == "table" then + print(" Table contents: setting=" .. tostring(result3.setting) .. ", value=" .. tostring(result3.value)) + end + print(" Error: " .. tostring(err3)) + + -- Test case 4: return with function definitions + local test4 = 'return {func = function() return "hello" end}' + local result4, err4 = safeLuaTableParser(test4) + print("Test 4 (return with function):") + print(" Result type: " .. type(result4)) + if type(result4) == "table" then + print(" Function value: func=" .. tostring(result4.func) .. " (type: " .. type(result4.func) .. ")") + end + print(" Error: " .. tostring(err4)) + + -- Test case 5: Regular table without return (should still work) + local test5 = '{normal = "table"}' + local result5, err5 = safeLuaTableParser(test5) + print("Test 5 (normal table without return):") + print(" Result type: " .. type(result5)) + if type(result5) == "table" then + print(" Table contents: normal=" .. tostring(result5.normal)) + end + print(" Error: " .. tostring(err5)) + end + + testReturnStatements() + + -- Test long string parsing + local function testLongStrings() + print("\nTesting long string parsing...") + + -- Test case 1: Simple long string + local test1 = "{message = [[Hello, World!]]}" + local result1, err1 = safeLuaTableParser(test1) + print("Test 1 (simple long string):") + print(" Result type: " .. type(result1)) + if type(result1) == "table" then + print(" Message: " .. tostring(result1.message)) + end + print(" Error: " .. tostring(err1)) + + -- Test case 2: Long string with equals + local test2 = '{code = [==[function() return "nested quotes: ]]" end]==]}' + local result2, err2 = safeLuaTableParser(test2) + print("Test 2 (long string with equals):") + print(" Result type: " .. type(result2)) + if type(result2) == "table" then + print(" Code: " .. tostring(result2.code)) + end + print(" Error: " .. tostring(err2)) + + -- Test case 3: Long string with newlines + local test3 = "{multiline = [[Line 1\nLine 2\nLine 3]]}" + local result3, err3 = safeLuaTableParser(test3) + print("Test 3 (multiline long string):") + print(" Result type: " .. type(result3)) + if type(result3) == "table" then + print(" Multiline length: " .. #tostring(result3.multiline)) + print(" Contains newlines: " .. tostring(string.find(result3.multiline, "\n") ~= nil)) + end + print(" Error: " .. tostring(err3)) + + -- Test case 4: Empty long string + local test4 = "{empty = [[]]}" + local result4, err4 = safeLuaTableParser(test4) + print("Test 4 (empty long string):") + print(" Result type: " .. type(result4)) + if type(result4) == "table" then + print(" Empty string length: " .. #tostring(result4.empty)) + end + print(" Error: " .. tostring(err4)) + + -- Test case 5: Long string with multiple equals + local test5 = "{special = [===[This is a [=[nested]=] string]===]}" + local result5, err5 = safeLuaTableParser(test5) + print("Test 5 (long string with multiple equals):") + print(" Result type: " .. type(result5)) + if type(result5) == "table" then + print(" Special: " .. tostring(result5.special)) + end + print(" Error: " .. tostring(err5)) + end + + testLongStrings() + + -- Test block comment parsing + local function testBlockComments() + print("\nTesting block comment parsing...") + + -- Test case 1: Simple block comment + local test1 = '--[[ This is a block comment ]] {key = "value"}' + local result1, err1 = safeLuaTableParser(test1) + print("Test 1 (simple block comment):") + print(" Result type: " .. type(result1)) + if type(result1) == "table" then + print(" Key: " .. tostring(result1.key)) + end + print(" Error: " .. tostring(err1)) + + -- Test case 2: Block comment with equals + local test2 = "--[=[ This is a block comment with ]] inside ]=] {number = 42}" + local result2, err2 = safeLuaTableParser(test2) + print("Test 2 (block comment with equals):") + print(" Result type: " .. type(result2)) + if type(result2) == "table" then + print(" Number: " .. tostring(result2.number)) + end + print(" Error: " .. tostring(err2)) + + -- Test case 3: Multi-line block comment + local test3 = "--[[\n" .. " This is a multi-line\n" .. " block comment\n" .. " ]]\n" .. " {\n" .. " setting = true,\n" .. " value = 123\n" .. " }" + local result3, err3 = safeLuaTableParser(test3) + print("Test 3 (multi-line block comment):") + print(" Result type: " .. type(result3)) + if type(result3) == "table" then + print(" Setting: " .. tostring(result3.setting) .. ", Value: " .. tostring(result3.value)) + end + print(" Error: " .. tostring(err3)) + + -- Test case 4: Mixed comments (line and block) + local test4 = "\n" .. " -- Line comment\n" .. " --[[ Block comment ]]\n" .. " {\n" .. " -- Another line comment\n" .. ' mixed = "comments",\n' .. " --[=[ Another block comment ]=]\n" .. " test = true\n" .. " }" + local result4, err4 = safeLuaTableParser(test4) + print("Test 4 (mixed comments):") + print(" Result type: " .. type(result4)) + if type(result4) == "table" then + print(" Mixed: " .. tostring(result4.mixed) .. ", Test: " .. tostring(result4.test)) + end + print(" Error: " .. tostring(err4)) + + -- Test case 5: Block comment with nested content + local test5 = '--[=[ Comment with --[[ nested ]] content ]=] {nested = "value"}' + local result5, err5 = safeLuaTableParser(test5) + print("Test 5 (nested block comment content):") + print(" Result type: " .. type(result5)) + if type(result5) == "table" then + print(" Nested: " .. tostring(result5.nested)) + end + print(" Error: " .. tostring(err5)) + end + + testBlockComments() + + print("done") +end -return {SafeLuaTableParser = safeLuaTableParser} \ No newline at end of file +return { SafeLuaTableParser = safeLuaTableParser } diff --git a/common/springUtilities/synced.lua b/common/springUtilities/synced.lua index b349c119c33..56b8ee6fe08 100644 --- a/common/springUtilities/synced.lua +++ b/common/springUtilities/synced.lua @@ -6,7 +6,7 @@ local function makeRealTable(proxy, debugTag) end local proxyLocal = proxy local ret = {} - for i,v in pairs(proxyLocal) do + for i, v in pairs(proxyLocal) do if type(v) == "table" then ret[i] = makeRealTable(v) else @@ -18,4 +18,4 @@ end return { MakeRealTable = makeRealTable, -} \ No newline at end of file +} diff --git a/common/springUtilities/tableFunctions.lua b/common/springUtilities/tableFunctions.lua index 1aae0cfd9bd..d3a5f089c83 100644 --- a/common/springUtilities/tableFunctions.lua +++ b/common/springUtilities/tableFunctions.lua @@ -2,10 +2,10 @@ local function customKeyToUsefulTable(dataRaw) if not dataRaw then return end - if not type(dataRaw) == 'string' then + if not type(dataRaw) == "string" then Spring.Echo("Customkey data error! type == " .. type(dataRaw)) else - dataRaw = string.gsub(dataRaw, '_', '=') + dataRaw = string.gsub(dataRaw, "_", "=") dataRaw = string.base64Decode(dataRaw) local dataFunc, err = loadstring("return " .. dataRaw) if dataFunc then @@ -22,4 +22,4 @@ end return { CustomKeyToUsefulTable = customKeyToUsefulTable, -} \ No newline at end of file +} diff --git a/common/springUtilities/teamFunctions.lua b/common/springUtilities/teamFunctions.lua index f74629a060e..f41a520837c 100644 --- a/common/springUtilities/teamFunctions.lua +++ b/common/springUtilities/teamFunctions.lua @@ -1,6 +1,6 @@ local smallTeamThreshold = 4 local initialized = false -local settings = { } +local settings = {} local holidaysList = VFS.Include("common/holidays.lua") @@ -28,7 +28,7 @@ local function getSettings() local isAllyTeamValid = true for _, teamID in ipairs(teamList) do - if select (4, Spring.GetTeamInfo(teamID, false)) then + if select(4, Spring.GetTeamInfo(teamID, false)) then allyteamEntirelyHuman = false else local teamPlayers = Spring.GetPlayerList(teamID) @@ -55,12 +55,12 @@ local function getSettings() end if isAllyTeamValid then - allyTeamList[#allyTeamList+1] = allyTeamID - allyTeamSizes[#allyTeamSizes+1] = #teamList + allyTeamList[#allyTeamList + 1] = allyTeamID + allyTeamSizes[#allyTeamSizes + 1] = #teamList end if allyteamEntirelyHuman then - entirelyHumanAllyTeams[#entirelyHumanAllyTeams+1] = allyTeamID + entirelyHumanAllyTeams[#entirelyHumanAllyTeams + 1] = allyTeamID end end end @@ -146,46 +146,83 @@ end return { ---Get number of ally teams (humans and AIs, but not Raptors and Scavengers). - GetAllyTeamCount = function() return getSettings().allyTeamCount end, + GetAllyTeamCount = function() + return getSettings().allyTeamCount + end, ---Get ally team list (humans and AIs, but not Raptors and Scavengers). ---@return integer[] allyTeamList table[i] = allyTeamID - GetAllyTeamList = function () return getSettings().allyTeamList end, + GetAllyTeamList = function() + return getSettings().allyTeamList + end, ---@return integer? playerCount Get number of players in a game, nil If it's an AI only game. - GetPlayerCount = function () return getSettings().playerCount end, + GetPlayerCount = function() + return getSettings().playerCount + end, Gametype = { ---@return boolean - IsSinglePlayer = function () return getSettings().isSinglePlayer end, + IsSinglePlayer = function() + return getSettings().isSinglePlayer + end, ---@return boolean - Is1v1 = function () return getSettings().is1v1 end, + Is1v1 = function() + return getSettings().is1v1 + end, ---@return boolean - IsTeams = function () return getSettings().isTeams end, + IsTeams = function() + return getSettings().isTeams + end, ---@return boolean - IsBigTeams = function () return getSettings().isBigTeams end, + IsBigTeams = function() + return getSettings().isBigTeams + end, ---@return boolean - IsSmallTeams = function () return getSettings().isSmallTeams end, + IsSmallTeams = function() + return getSettings().isSmallTeams + end, ---@return boolean - IsRaptors = function () return getSettings().isRaptors end, + IsRaptors = function() + return getSettings().isRaptors + end, ---@return boolean - IsScavengers = function () return getSettings().isScavengers end, + IsScavengers = function() + return getSettings().isScavengers + end, ---@return boolean - IsPvE = function () return getSettings().isPvE end, + IsPvE = function() + return getSettings().isPvE + end, ---@return boolean - IsCoop = function () return getSettings().isCoop end, + IsCoop = function() + return getSettings().isCoop + end, ---@return boolean - IsFFA = function () return getSettings().isFFA end, + IsFFA = function() + return getSettings().isFFA + end, ---@return boolean - IsSandbox = function () return getSettings().isSandbox end, - ---@return table? isHoliday Currently running holiday events. + IsSandbox = function() + return getSettings().isSandbox + end, + ---@return table? isHoliday Currently running holiday events. ---See common/holidays.lua for more information. - GetCurrentHolidays = function () return getSettings().isHoliday end, + GetCurrentHolidays = function() + return getSettings().isHoliday + end, }, ---@return integer? scavTeamID Team ID for the scavenger team. - GetScavTeamID = function () return getSettings().scavTeamID end, + GetScavTeamID = function() + return getSettings().scavTeamID + end, ---@return integer? scavAllyTeamID Team ID for the scavenger ally team. - GetScavAllyTeamID = function () return getSettings().scavAllyTeamID end, + GetScavAllyTeamID = function() + return getSettings().scavAllyTeamID + end, ---@return integer? raptorTeamID Team ID for the raptor team. - GetRaptorTeamID = function () return getSettings().raptorTeamID end, + GetRaptorTeamID = function() + return getSettings().raptorTeamID + end, ---@return integer? raptorAllyTeamID Team ID for the raptor ally team. - GetRaptorAllyTeamID = function () return getSettings().raptorAllyTeamID end, - + GetRaptorAllyTeamID = function() + return getSettings().raptorAllyTeamID + end, } diff --git a/common/stringFunctions.lua b/common/stringFunctions.lua index 3b138d09fe7..a9f80a1e9da 100644 --- a/common/stringFunctions.lua +++ b/common/stringFunctions.lua @@ -102,9 +102,15 @@ end if not string.randomString then local mathRandom = math.random local randomCharset = {} - for c = 48, 57 do randomCharset[#randomCharset + 1] = string.char(c) end - for c = 65, 90 do randomCharset[#randomCharset + 1] = string.char(c) end - for c = 97, 122 do randomCharset[#randomCharset + 1] = string.char(c) end + for c = 48, 57 do + randomCharset[#randomCharset + 1] = string.char(c) + end + for c = 65, 90 do + randomCharset[#randomCharset + 1] = string.char(c) + end + for c = 97, 122 do + randomCharset[#randomCharset + 1] = string.char(c) + end function string.randomString(length) length = length or 4 local result = {} diff --git a/common/tableFunctionsTests.lua b/common/tableFunctionsTests.lua index 419871d7fc9..360e347a316 100644 --- a/common/tableFunctionsTests.lua +++ b/common/tableFunctionsTests.lua @@ -1,195 +1,190 @@ local function testMergeInPlace(deep) - Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] start", tostring(deep))) - local mergeTarget = { - shouldBeOverriden = "no", - shouldBeMerged = { - shouldBeOverriden = "no", - shouldBeMerged = { "no", "no", "yes", }, - "yes", - }, - shouldBeKept = "yes", - [1] = "no", - [2] = "yes", - } - local mergeData = { - shouldBeOverriden = "yes", - shouldBeMerged = { - shouldBeOverriden = "yes", - shouldBeMerged = { "yes", "yes", }, - shouldBeAdded = { "yes", }, - }, - shouldBeAdded = { "yes", }, - [1] = "yes", - [3] = "yes" - } - - table.mergeInPlace(mergeTarget, mergeData, deep) - Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] %s", tostring(deep), table.toString(mergeTarget))) - - local expectedYesCount = 12 - local yesCount = 0 - local function checkAllYes(tbl) - for key, value in pairs(tbl) do - if type(value) == "table" then - checkAllYes(value) - else - assert(value == "yes", string.format("expected all values to be 'yes', but go '%s' for key %s", value, key)) - yesCount = yesCount + 1 - end - end - end - checkAllYes(mergeTarget) - assert(yesCount == expectedYesCount, string.format("expected %s 'yes' values, got %s", expectedYesCount, yesCount)) - - if deep then - assert(mergeData.shouldBeAdded ~= mergeTarget.shouldBeAdded, - "expected mergeData.shouldBeAdded and mergeTarget.shouldBeAdded to be different instance, due to deep merge") - assert(mergeData.shouldBeMerged.shouldBeAdded ~= mergeTarget.shouldBeMerged.shouldBeAdded, - "expected mergeData.shouldBeMerged.shouldBeAdded and mergeTarget.shouldBeMerged.shouldBeAdded to be different instance, due to deep merge") - else - assert(mergeData.shouldBeAdded == mergeTarget.shouldBeAdded, - "expected mergeData.shouldBeAdded and mergeTarget.shouldBeAdded to be same instance, due to non-deep merge") - assert(mergeData.shouldBeMerged.shouldBeAdded == mergeTarget.shouldBeMerged.shouldBeAdded, - "expected mergeData.shouldBeMerged.shouldBeAdded and mergeTarget.shouldBeMerged.shouldBeAdded to be same instance, due to non-deep merge") - end - - Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] success", tostring(deep))) + Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] start", tostring(deep))) + local mergeTarget = { + shouldBeOverriden = "no", + shouldBeMerged = { + shouldBeOverriden = "no", + shouldBeMerged = { "no", "no", "yes" }, + "yes", + }, + shouldBeKept = "yes", + [1] = "no", + [2] = "yes", + } + local mergeData = { + shouldBeOverriden = "yes", + shouldBeMerged = { + shouldBeOverriden = "yes", + shouldBeMerged = { "yes", "yes" }, + shouldBeAdded = { "yes" }, + }, + shouldBeAdded = { "yes" }, + [1] = "yes", + [3] = "yes", + } + + table.mergeInPlace(mergeTarget, mergeData, deep) + Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] %s", tostring(deep), table.toString(mergeTarget))) + + local expectedYesCount = 12 + local yesCount = 0 + local function checkAllYes(tbl) + for key, value in pairs(tbl) do + if type(value) == "table" then + checkAllYes(value) + else + assert(value == "yes", string.format("expected all values to be 'yes', but go '%s' for key %s", value, key)) + yesCount = yesCount + 1 + end + end + end + checkAllYes(mergeTarget) + assert(yesCount == expectedYesCount, string.format("expected %s 'yes' values, got %s", expectedYesCount, yesCount)) + + if deep then + assert(mergeData.shouldBeAdded ~= mergeTarget.shouldBeAdded, "expected mergeData.shouldBeAdded and mergeTarget.shouldBeAdded to be different instance, due to deep merge") + assert(mergeData.shouldBeMerged.shouldBeAdded ~= mergeTarget.shouldBeMerged.shouldBeAdded, "expected mergeData.shouldBeMerged.shouldBeAdded and mergeTarget.shouldBeMerged.shouldBeAdded to be different instance, due to deep merge") + else + assert(mergeData.shouldBeAdded == mergeTarget.shouldBeAdded, "expected mergeData.shouldBeAdded and mergeTarget.shouldBeAdded to be same instance, due to non-deep merge") + assert(mergeData.shouldBeMerged.shouldBeAdded == mergeTarget.shouldBeMerged.shouldBeAdded, "expected mergeData.shouldBeMerged.shouldBeAdded and mergeTarget.shouldBeMerged.shouldBeAdded to be same instance, due to non-deep merge") + end + + Spring.Echo(string.format("[test] [table.mergeInPlace(deep: %s)] success", tostring(deep))) end local function testTableRemoveIf() - Spring.Echo("[test] [table.removeIf] start") - local t = { a = 1, b = 2, c = 3, d = 4, e = 5, } - local tEven = table.copy(t) - table.removeIf(tEven, function(v) return v % 2 == 1 end) - local tOdd = table.copy(t) - table.removeIf(tOdd, function(v) return v % 2 == 0 end) - - Spring.Echo(string.format("[test] [table.removeIf] tEven: %s", table.toString(tEven))) - Spring.Echo(string.format("[test] [table.removeIf] tOdd: %s", table.toString(tOdd))) - - local assertions = { - tEven = { table.count(tEven), 2 }, - tOdd = { table.count(tOdd), 3 }, - } - - for tbl, assertion in pairs(assertions) do - assert(assertion[1] == assertion[2], - string.format("expected %s to have %s values (actual: %s)", tbl, assertion[1], assertion[2])) - end - Spring.Echo("[test] [table.removeIf] success") + Spring.Echo("[test] [table.removeIf] start") + local t = { a = 1, b = 2, c = 3, d = 4, e = 5 } + local tEven = table.copy(t) + table.removeIf(tEven, function(v) + return v % 2 == 1 + end) + local tOdd = table.copy(t) + table.removeIf(tOdd, function(v) + return v % 2 == 0 + end) + + Spring.Echo(string.format("[test] [table.removeIf] tEven: %s", table.toString(tEven))) + Spring.Echo(string.format("[test] [table.removeIf] tOdd: %s", table.toString(tOdd))) + + local assertions = { + tEven = { table.count(tEven), 2 }, + tOdd = { table.count(tOdd), 3 }, + } + + for tbl, assertion in pairs(assertions) do + assert(assertion[1] == assertion[2], string.format("expected %s to have %s values (actual: %s)", tbl, assertion[1], assertion[2])) + end + Spring.Echo("[test] [table.removeIf] success") end local function testTableRemoveAll() - Spring.Echo("[test] [table.removeAll] start") - local t = { a = 1, b = 2, c = 1, d = 2, e = 1, } - local tOnes = table.copy(t) - table.removeAll(tOnes, 2) - local tTwos = table.copy(t) - table.removeAll(tTwos, 1) - - Spring.Echo(string.format("[test] [table.removeAll] tOnes: %s", table.toString(tOnes))) - Spring.Echo(string.format("[test] [table.removeAll] tTwos: %s", table.toString(tTwos))) - - local assertions = { - tOnes = { table.count(tOnes), 3 }, - tTwos = { table.count(tTwos), 2 }, - } - - for tbl, assertion in pairs(assertions) do - assert(assertion[1] == assertion[2], - string.format("expected %s to have %s values (actual: %s)", tbl, assertion[1], assertion[2])) - end - Spring.Echo("[test] [table.removeAll] success") + Spring.Echo("[test] [table.removeAll] start") + local t = { a = 1, b = 2, c = 1, d = 2, e = 1 } + local tOnes = table.copy(t) + table.removeAll(tOnes, 2) + local tTwos = table.copy(t) + table.removeAll(tTwos, 1) + + Spring.Echo(string.format("[test] [table.removeAll] tOnes: %s", table.toString(tOnes))) + Spring.Echo(string.format("[test] [table.removeAll] tTwos: %s", table.toString(tTwos))) + + local assertions = { + tOnes = { table.count(tOnes), 3 }, + tTwos = { table.count(tTwos), 2 }, + } + + for tbl, assertion in pairs(assertions) do + assert(assertion[1] == assertion[2], string.format("expected %s to have %s values (actual: %s)", tbl, assertion[1], assertion[2])) + end + Spring.Echo("[test] [table.removeAll] success") end local function testTableRemoveFirst() - Spring.Echo("[test] [table.removeFirst] start") - local tests = { - sequence = { "a", "b", "c" }, -- indexes should be kept without any gaps for this one - notASequence = { "a", "b", [4] = "c" }, - regularTable = { a = "a", b = "b", c = "c" }, - } - - for name, test in pairs(tests) do - Spring.Echo(string.format("[test] [table.removeFirst] %s: %s", name, table.toString(test))) - for _, value in pairs({ "b", "c", "a", }) do - table.removeFirst(test, value) - Spring.Echo(string.format("[test] [table.removeFirst] %s: %s (removed: %s)", name, table.toString(test), value)) - -- special case for sequence: check that indexes are kept without any gaps - if name == "sequence" then - local prev_i = 0 - for i, _ in pairs(test) do - i = tonumber(i) - assert(i == prev_i + 1, string.format("expected table %s to have continuous indexes, but it does not", name)) - prev_i = i - end - end - end - assert(table.count(test) == 0, string.format("expected table %s to be empty, but it's not", name)) - end - Spring.Echo("[test] [table.removeFirst] success") + Spring.Echo("[test] [table.removeFirst] start") + local tests = { + sequence = { "a", "b", "c" }, -- indexes should be kept without any gaps for this one + notASequence = { "a", "b", [4] = "c" }, + regularTable = { a = "a", b = "b", c = "c" }, + } + + for name, test in pairs(tests) do + Spring.Echo(string.format("[test] [table.removeFirst] %s: %s", name, table.toString(test))) + for _, value in pairs({ "b", "c", "a" }) do + table.removeFirst(test, value) + Spring.Echo(string.format("[test] [table.removeFirst] %s: %s (removed: %s)", name, table.toString(test), value)) + -- special case for sequence: check that indexes are kept without any gaps + if name == "sequence" then + local prev_i = 0 + for i, _ in pairs(test) do + i = tonumber(i) + assert(i == prev_i + 1, string.format("expected table %s to have continuous indexes, but it does not", name)) + prev_i = i + end + end + end + assert(table.count(test) == 0, string.format("expected table %s to be empty, but it's not", name)) + end + Spring.Echo("[test] [table.removeFirst] success") end local function testTableShuffle() - Spring.Echo("[test] [table.shuffle] start") - local t = { "a", "b", "c" } - local t0 = { [0] = "a", "b", "c" } - local results = { abc = 0, acb = 0, bac = 0, bca = 0, cab = 0, cba = 0 } - local results0 = { abc = 0, acb = 0, bac = 0, bca = 0, cab = 0, cba = 0 } - - local roundsPerCombination = 1000000 - local rounds = roundsPerCombination * table.count(results) - for _ = 1, rounds do - table.shuffle(t) - table.shuffle(t0, 0) - local r = t[1] .. t[2] .. t[3] - local r0 = t0[0] .. t0[1] .. t0[2] - results[r] = results[r] + 1 - results0[r0] = results0[r0] + 1 - end - - Spring.Echo(string.format("[test] [table.shuffle] results : %s", table.toString(results))) - Spring.Echo(string.format("[test] [table.shuffle] results0: %s", table.toString(results0))) - - local function mean(tbl) - local sum = 0 - local count = 0 - - for _, value in pairs(tbl) do - sum = sum + value - count = count + 1 - end - return (sum / count) - end - - local function standardDeviation(tbl) - local meanValue - local deviation - local sum = 0 - local count = 0 - - meanValue = mean(tbl) - for _, value in pairs(tbl) do - deviation = value - meanValue - sum = sum + (deviation * deviation) - count = count + 1 - end - return math.sqrt(sum / (count - 1)) - end - - local standardDeviationResults = standardDeviation(results) - local standardDeviationResults0 = standardDeviation(results0) - Spring.Echo(string.format("[test] [table.shuffle] [results ] standardDeviation: %s", standardDeviationResults)) - Spring.Echo(string.format("[test] [table.shuffle] [results0] standardDeviation: %s", standardDeviationResults0)) - - local threshold = rounds * 0.005 -- this is not a p-norm but it'll be good enough - assert(standardDeviationResults < threshold, - string.format("expected results standard deviation to be below %s (actual: %s)", threshold, standardDeviationResults)) - assert(standardDeviationResults0 < threshold, - string.format("expected results0 standard deviation to be below %s (actual: %s)", threshold, - standardDeviationResults0)) - - Spring.Echo("[test] [table.shuffle] success") + Spring.Echo("[test] [table.shuffle] start") + local t = { "a", "b", "c" } + local t0 = { [0] = "a", "b", "c" } + local results = { abc = 0, acb = 0, bac = 0, bca = 0, cab = 0, cba = 0 } + local results0 = { abc = 0, acb = 0, bac = 0, bca = 0, cab = 0, cba = 0 } + + local roundsPerCombination = 1000000 + local rounds = roundsPerCombination * table.count(results) + for _ = 1, rounds do + table.shuffle(t) + table.shuffle(t0, 0) + local r = t[1] .. t[2] .. t[3] + local r0 = t0[0] .. t0[1] .. t0[2] + results[r] = results[r] + 1 + results0[r0] = results0[r0] + 1 + end + + Spring.Echo(string.format("[test] [table.shuffle] results : %s", table.toString(results))) + Spring.Echo(string.format("[test] [table.shuffle] results0: %s", table.toString(results0))) + + local function mean(tbl) + local sum = 0 + local count = 0 + + for _, value in pairs(tbl) do + sum = sum + value + count = count + 1 + end + return (sum / count) + end + + local function standardDeviation(tbl) + local meanValue + local deviation + local sum = 0 + local count = 0 + + meanValue = mean(tbl) + for _, value in pairs(tbl) do + deviation = value - meanValue + sum = sum + (deviation * deviation) + count = count + 1 + end + return math.sqrt(sum / (count - 1)) + end + + local standardDeviationResults = standardDeviation(results) + local standardDeviationResults0 = standardDeviation(results0) + Spring.Echo(string.format("[test] [table.shuffle] [results ] standardDeviation: %s", standardDeviationResults)) + Spring.Echo(string.format("[test] [table.shuffle] [results0] standardDeviation: %s", standardDeviationResults0)) + + local threshold = rounds * 0.005 -- this is not a p-norm but it'll be good enough + assert(standardDeviationResults < threshold, string.format("expected results standard deviation to be below %s (actual: %s)", threshold, standardDeviationResults)) + assert(standardDeviationResults0 < threshold, string.format("expected results0 standard deviation to be below %s (actual: %s)", threshold, standardDeviationResults0)) + + Spring.Echo("[test] [table.shuffle] success") end testMergeInPlace(false) diff --git a/common/tablefunctions.lua b/common/tablefunctions.lua index 5cd03cb36a6..d289bb5f283 100644 --- a/common/tablefunctions.lua +++ b/common/tablefunctions.lua @@ -6,7 +6,9 @@ run for end users.) ]] -- Lua 5.1 backwards compatibility -table.pack = table.pack or function(...) return { n = select("#", ...), ... } end +table.pack = table.pack or function(...) + return { n = select("#", ...), ... } +end if not table.copy then function table.copy(tbl) @@ -56,7 +58,7 @@ if not table.mergeInPlace then function table.mergeInPlace(mergeTarget, mergeData, deep) deep = deep or false for key, value in pairs(mergeData) do - if type(value) == 'table' and type(mergeTarget[key] or false) == 'table' then + if type(value) == "table" and type(mergeTarget[key] or false) == "table" then table.mergeInPlace(mergeTarget[key], value, deep) elseif type(value) == "table" and deep then mergeTarget[key] = table.copy(value) @@ -112,8 +114,7 @@ if not table.toString then local tableSort = table.sort local DEFAULT_INDENT_STEP = 2 - local function tableToString(tbl, options, _seen, _depth) - end + local function tableToString(tbl, options, _seen, _depth) end local function keyCmp(a, b) local ta = type(a) @@ -142,7 +143,7 @@ if not table.toString then local inputType = type(tbl) if inputType == "string" then - return "\"" .. tbl .. "\"" + return '"' .. tbl .. '"' elseif inputType == "userdata" then return tostring(tbl) or "" elseif inputType ~= "table" then @@ -169,42 +170,58 @@ if not table.toString then local parts = {} local n = 0 - n = n + 1; parts[n] = "{" + n = n + 1 + parts[n] = "{" if keyCount > 0 and pretty then - n = n + 1; parts[n] = "\n" + n = n + 1 + parts[n] = "\n" end for i = 1, keyCount do local key = keys[i] if pretty then - n = n + 1; parts[n] = stringRep(" ", (_depth + 1) * indent) + n = n + 1 + parts[n] = stringRep(" ", (_depth + 1) * indent) end if key ~= i then local keyType = type(key) if keyType == "string" then - n = n + 1; parts[n] = key - n = n + 1; parts[n] = "=" + n = n + 1 + parts[n] = key + n = n + 1 + parts[n] = "=" elseif keyType == "number" then - n = n + 1; parts[n] = "[" - n = n + 1; parts[n] = tostring(key) - n = n + 1; parts[n] = "]=" + n = n + 1 + parts[n] = "[" + n = n + 1 + parts[n] = tostring(key) + n = n + 1 + parts[n] = "]=" else - n = n + 1; parts[n] = "[" - n = n + 1; parts[n] = tableToString(key, options, _seen) - n = n + 1; parts[n] = "]=" + n = n + 1 + parts[n] = "[" + n = n + 1 + parts[n] = tableToString(key, options, _seen) + n = n + 1 + parts[n] = "]=" end end - n = n + 1; parts[n] = tableToString(tbl[key], options, _seen, _depth + 1) + n = n + 1 + parts[n] = tableToString(tbl[key], options, _seen, _depth + 1) if i < keyCount or pretty then - n = n + 1; parts[n] = "," + n = n + 1 + parts[n] = "," end if pretty then - n = n + 1; parts[n] = "\n" + n = n + 1 + parts[n] = "\n" end end if keyCount > 0 and pretty then - n = n + 1; parts[n] = stringRep(" ", _depth * indent) + n = n + 1 + parts[n] = stringRep(" ", _depth * indent) end - n = n + 1; parts[n] = "}" + n = n + 1 + parts[n] = "}" return tableConcat(parts) end @@ -385,7 +402,9 @@ if not table.removeAll then ---@param tbl table ---@param value V function table.removeAll(tbl, value) - table.removeIf(tbl, function(v) return v == value end) + table.removeIf(tbl, function(v) + return v == value + end) end end @@ -545,7 +564,7 @@ if not table.valueIntersection then ---@param ... V[] Any number of array-style tables. ---@return V[] A new array containing only values present in all input arrays. function table.valueIntersection(...) - local tables = { ...} + local tables = { ... } -- Count occurrences of each value across all arrays local valueCounts = {} @@ -585,9 +604,11 @@ if not pairsByKeys then ---(Implementation copied straight from the docs at https://www.lua.org/pil/19.3.html.) function pairsByKeys(tbl, keySortFunction) local keys = {} - for key in pairs(tbl) do table.insert(keys, key) end + for key in pairs(tbl) do + table.insert(keys, key) + end table.sort(keys, keySortFunction) - local i = 0 -- iterator variable + local i = 0 -- iterator variable local iter = function() -- iterator function i = i + 1 if keys[i] == nil then diff --git a/common/testing/assertions.lua b/common/testing/assertions.lua index 8cb8cb64805..77e1abfe76b 100644 --- a/common/testing/assertions.lua +++ b/common/testing/assertions.lua @@ -51,8 +51,8 @@ local depth = 0 -- fn will be called every 'frames' game frames. -- errorMsg can be set to customize the error message preface. local function assertSuccessBefore(seconds, frames, fn, errorMsg, depthOffset) - local iters = math.ceil((seconds*30)/frames) - for i=1, iters do + local iters = math.ceil((seconds * 30) / frames) + for i = 1, iters do -- dangerous to set depth here since fn() can fail. -- no pcall since SyncedProxy and SyncedRun wouldn't work. local res = fn() @@ -66,7 +66,6 @@ local function assertSuccessBefore(seconds, frames, fn, errorMsg, depthOffset) error(errorMsg or "assertSuccessBefore: didn't succeed before " .. tostring(seconds) .. " seconds", depthOffset) end - -- Assert the given function throws an exception -- -- Note it's better to use assertThrowsMessage since otherwise you might be catching an @@ -82,7 +81,6 @@ local function assertThrows(fn, errorMsg, depthOffset) end end - -- Assert the given function throws an exception with a specific error message -- -- Can't be used with SyncedProxy or SyncedRun for now as they don't work inside pcall. @@ -101,7 +99,7 @@ local function assertThrowsMessage(fn, testMsg, errorMsg, depthOffset) -- split "standard" error format -- it's in the form: [string "LuaUI/tests/selftests/test_assertions.lua"]:17: error2 local match = result - local errorIndex = result:match'^%[string "[%p%a%s]*%"]:[%d]+:().*' + local errorIndex = result:match('^%[string "[%p%a%s]*%"]:[%d]+:().*') if errorIndex and errorIndex > 0 then match = result:sub(errorIndex + 1) end @@ -119,9 +117,7 @@ end local function assertEqual(actual, expected, errorMsg) if actual ~= expected then - local msg = (errorMsg or "assertEqual failed") - .. ": expected " .. formatValueForAssert(expected) - .. ", actual " .. formatValueForAssert(actual) + local msg = (errorMsg or "assertEqual failed") .. ": expected " .. formatValueForAssert(expected) .. ", actual " .. formatValueForAssert(actual) local depthOffset = 2 error(msg, depthOffset) end diff --git a/common/testing/infologtest.lua b/common/testing/infologtest.lua index 4f2ac138f60..a2a56892cd9 100644 --- a/common/testing/infologtest.lua +++ b/common/testing/infologtest.lua @@ -7,15 +7,14 @@ function skip() return true end - local function skipErrors(line) - if string.find(line, 'Could not finalize projectile-texture atlas', nil, true) then + if string.find(line, "Could not finalize projectile-texture atlas", nil, true) then return true end - if string.find(line, 'Could not finalize Decals', nil, true) then + if string.find(line, "Could not finalize Decals", nil, true) then return true end - if string.find(line, 'Could not finalize groundFX texture', nil, true) then + if string.find(line, "Could not finalize groundFX texture", nil, true) then return true end -- Errors for engine >= 2025.03.X deprecations, remove these @@ -37,9 +36,9 @@ local function infologTest() if infolog then local fileLines = string.lines(infolog) for i, line in ipairs(fileLines) do - local errorIndex = line:match('^%[t=[%d%.:]*%]%[f=[%-%d]*%] Error().*') + local errorIndex = line:match("^%[t=[%d%.:]*%]%[f=[%-%d]*%] Error().*") if errorIndex and errorIndex > 0 and not skipErrors(line) then - errors[#errors+1] = line + errors[#errors + 1] = line if #errors > maxErrors then return errors end @@ -49,7 +48,6 @@ local function infologTest() return errors end - function test() local errors = infologTest() if #errors > 0 then diff --git a/common/testing/locals_access.lua b/common/testing/locals_access.lua index 7c332726f21..45f7807a0dd 100644 --- a/common/testing/locals_access.lua +++ b/common/testing/locals_access.lua @@ -4,7 +4,8 @@ usage: * load the file again, with generateLocalsAccessStr(localsNames)) appended. * setmetatable on the new environment to generateLocalsAccessMetatable() Through the metatable, local variables within the loaded file will now be accessible as if they were globals -]]-- +]] +-- local localsDetectorString = [[ @@ -42,7 +43,7 @@ local function generateLocalsAccessStr(localsNames) content = content .. "\tgetAllLocals = function() return {\n" for _, name in ipairs(localsNames) do - content = content .. "\t\t\"" .. name .. "\",\n" + content = content .. '\t\t"' .. name .. '",\n' end content = content .. "\t} end,\n" diff --git a/common/testing/mocha_json_reporter.lua b/common/testing/mocha_json_reporter.lua index f10414e3646..d6a4de052f2 100644 --- a/common/testing/mocha_json_reporter.lua +++ b/common/testing/mocha_json_reporter.lua @@ -14,7 +14,7 @@ function MochaJSONReporter:new() endTime = nil, duration = nil, tests = {}, - skipped = {} + skipped = {}, } setmetatable(obj, self) self.__index = self @@ -36,7 +36,7 @@ function MochaJSONReporter:extractError(text) text = text:sub(errorIndex + 1) return text end - errorIndex = text:match('^%[t=[%d%.:]*%]%[f=[%-%d]*%] ().*') + errorIndex = text:match("^%[t=[%d%.:]*%]%[f=[%-%d]*%] ().*") if errorIndex and errorIndex > 0 then text = text:sub(errorIndex) end @@ -61,7 +61,7 @@ function MochaJSONReporter:testResult(label, filePath, success, skipped, duratio if errorMessage ~= nil then result.err = { message = self:extractError(errorMessage), - stack = errorMessage + stack = errorMessage, } else result.err = { @@ -71,9 +71,9 @@ function MochaJSONReporter:testResult(label, filePath, success, skipped, duratio end self.totalTests = self.totalTests + 1 - self.tests[#(self.tests) + 1] = result + self.tests[#self.tests + 1] = result if skipped then - self.skipped[#(self.skipped) + 1] = {fullTitle = label} + self.skipped[#self.skipped + 1] = { fullTitle = label } end end @@ -88,10 +88,10 @@ function MochaJSONReporter:report(filePath) ["failures"] = self.totalFailures, ["start"] = formatTimestamp(self.startTime), ["end"] = formatTimestamp(self.endTime), - ["duration"] = self.duration + ["duration"] = self.duration, }, ["tests"] = self.tests, - ["pending"] = self.skipped + ["pending"] = self.skipped, } local encoded = Json.encode(output) diff --git a/common/testing/mock.lua b/common/testing/mock.lua index 53fb635f943..dfed97ccd91 100644 --- a/common/testing/mock.lua +++ b/common/testing/mock.lua @@ -12,7 +12,7 @@ local function spy(parent, target) calls = calls, remove = function() parent[target] = original - end + end, } end @@ -32,7 +32,7 @@ local function mock(parent, target, fn) calls = calls, remove = function() parent[target] = original - end + end, } end diff --git a/common/testing/results.lua b/common/testing/results.lua index 01612505260..03fef6d8b45 100644 --- a/common/testing/results.lua +++ b/common/testing/results.lua @@ -7,17 +7,12 @@ local function enum(...) return result end -local TEST_RESULT = enum( - "PASS", - "FAIL", - "SKIP", - "ERROR" -) +local TEST_RESULT = enum("PASS", "FAIL", "SKIP", "ERROR") local function clamp(min, max, num) - if (num < min) then + if num < min then return min - elseif (num > max) then + elseif num > max then return max end return num diff --git a/common/testing/rpc.lua b/common/testing/rpc.lua index b5e0de77a86..9719cc391e5 100644 --- a/common/testing/rpc.lua +++ b/common/testing/rpc.lua @@ -1,5 +1,5 @@ -local serpent = VFS.Include('common/luaUtilities/serpent.lua') -local Util = VFS.Include('common/testing/util.lua') +local serpent = VFS.Include("common/luaUtilities/serpent.lua") +local Util = VFS.Include("common/testing/util.lua") local function generateRandomString(length) local charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" diff --git a/common/testing/synced_proxy.lua b/common/testing/synced_proxy.lua index 7d7f6663289..97911411837 100644 --- a/common/testing/synced_proxy.lua +++ b/common/testing/synced_proxy.lua @@ -6,5 +6,5 @@ return { CALL = "synced_proxy_call" .. separator, RUN = "synced_proxy_run" .. separator, RETURN = "synced_proxy_return" .. separator, - } + }, } diff --git a/common/testing/test_extra_utils.lua b/common/testing/test_extra_utils.lua index 05b9ca2bf51..7d6187b8fc0 100644 --- a/common/testing/test_extra_utils.lua +++ b/common/testing/test_extra_utils.lua @@ -1,4 +1,3 @@ - local levelTimeout = 100 local heightMapChanged = false local autoHeightMap = false @@ -11,8 +10,12 @@ end local function levelHeightMap(level) local prevLevel = currentLevel - if level == nil then level = 10 end - if prevLevel == level then return end + if level == nil then + level = 10 + end + if prevLevel == level then + return + end SyncedRun(function(locals) local level = locals.level - locals.prevLevel Spring.LevelHeightMap(0, 0, Game.mapSizeX, Game.mapSizeZ, level) @@ -23,7 +26,9 @@ local function levelHeightMap(level) end local function restoreHeightMap(force) - if not force and not heightMapChanged then return end + if not force and not heightMapChanged then + return + end SyncedRun(function() Spring.RevertHeightMap(0, 0, Game.mapSizeX, Game.mapSizeZ, 1.0) Spring.RebuildSmoothMesh(0, 0, Game.mapSizeX, Game.mapSizeZ) @@ -55,22 +60,16 @@ local function endTest() end local linkActions = function(widget) - widgetHandler.actionHandler:AddAction( - widget, - "testsautoheightmap", - function(cmd, optLine, optWords, data, isRepeat, release, actions) - local enable = not autoHeightMap - local enableOpt = optWords[1] - if enableOpt == 'on' or enableOpt == '1' then - enable = true - elseif enableOpt == 'off' or enableOpt == '0' then - enable = false - end - setAutoHeightMap(enable) - end, - nil, - "t" - ) + widgetHandler.actionHandler:AddAction(widget, "testsautoheightmap", function(cmd, optLine, optWords, data, isRepeat, release, actions) + local enable = not autoHeightMap + local enableOpt = optWords[1] + if enableOpt == "on" or enableOpt == "1" then + enable = true + elseif enableOpt == "off" or enableOpt == "0" then + enable = false + end + setAutoHeightMap(enable) + end, nil, "t") end return { diff --git a/common/testing/util.lua b/common/testing/util.lua index 16c97d219cb..1068470099a 100644 --- a/common/testing/util.lua +++ b/common/testing/util.lua @@ -20,7 +20,7 @@ local function splitPhrases(input) local currentPhrase = "" local function appendPhrase(phrase) - table.insert(result, phrase:match("^%s*(.-)%s*$")) -- Trim whitespace + table.insert(result, phrase:match("^%s*(.-)%s*$")) -- Trim whitespace currentPhrase = "" end @@ -32,7 +32,7 @@ local function splitPhrases(input) if char == " " and currentPhrase ~= "" then appendPhrase(currentPhrase) - elseif char == "\"" then + elseif char == '"' then local quoteStart = i repeat i = i + 1 @@ -40,7 +40,7 @@ local function splitPhrases(input) if char == "\\" then i = i + 1 -- Skip escaped character end - until char == "\"" or i > len + until char == '"' or i > len local quoteEnd = i appendPhrase(string.sub(input, quoteStart + 1, quoteEnd - 1)) diff --git a/common/traversability_grid.lua b/common/traversability_grid.lua index af40ca43c82..ae168346abc 100644 --- a/common/traversability_grid.lua +++ b/common/traversability_grid.lua @@ -10,8 +10,8 @@ local DEFAULT_GRID_SPACING = 32 -- the interval at which terrain is tested using local GRID_RESOLUTION_MULTIPLIER_DEFAULT = 2 -- how many GRID_SPACINGs step to check in each direction to determine if a spot is reachable or not. local DEFAULT_MAX_SLOPE = 0.36 -- calibrated using quickstart on ascendency -local BFS_NDX = {1, -1, 0, 0} -local BFS_NDZ = {0, 0, 1, -1} +local BFS_NDX = { 1, -1, 0, 0 } +local BFS_NDZ = { 0, 0, 1, -1 } local unitIDTraversabilityGrids = {} local unitIDGridResolutions = {} @@ -53,8 +53,8 @@ local function generateTraversableGrid(originX, originZ, range, gridResolution, visited[snappedOriginX] = visited[snappedOriginX] or {} visited[snappedOriginX][snappedOriginZ] = true - local queueX = {snappedOriginX} - local queueZ = {snappedOriginZ} + local queueX = { snappedOriginX } + local queueZ = { snappedOriginZ } local queueLen = 1 local rangeSq = range * range @@ -128,5 +128,5 @@ end return { generateTraversableGrid = generateTraversableGrid, canMoveToPosition = canMoveToPosition, - unitIDTraversabilityGrids = unitIDTraversabilityGrids + unitIDTraversabilityGrids = unitIDTraversabilityGrids, } diff --git a/common/upgets/api_resource_spot_finder.lua b/common/upgets/api_resource_spot_finder.lua index bf1d8559c9c..f5ea212e676 100644 --- a/common/upgets/api_resource_spot_finder.lua +++ b/common/upgets/api_resource_spot_finder.lua @@ -148,7 +148,6 @@ local function GetValidStrips(spot) spot.validRight = validRight end - local function GetBuildingPositions(spot, uDefID, facing, testBuild) local xoff, zoff if facing == 0 or facing == 2 then @@ -180,7 +179,6 @@ local function GetBuildingPositions(spot, uDefID, facing, testBuild) return positions end - local function IsBuildingPositionValid(spot, x, z) -- add an extra mapSquareSize to account for snapping behaviours from api users local expandedRadius = extractorRadius + metalMapSquareSize @@ -188,7 +186,7 @@ local function IsBuildingPositionValid(spot, x, z) return false end - local expandedRadiusSqr = expandedRadius*expandedRadius + local expandedRadiusSqr = expandedRadius * expandedRadius local sLeft, sRight = spot.left, spot.right for sz = spot.minZ, spot.maxZ, metalMapSquareSize do local dz = sz - z @@ -362,14 +360,12 @@ local function GetSpotsMetal() return spots, false end - - ------------------------------------------------------------ -- Callins ------------------------------------------------------------ function upget:Initialize() - if(gadget) then + if gadget then -- With armmex.extractsMetal=0.001 and armmoho.extractsMetal=0.004 -- base_extraction=0.001 is meant to say that T1 mex is baseline x1, and T2 is baseline x4 -- as opposed to T1 being x0.5 and T2 being x2. @@ -393,7 +389,7 @@ function upget:Initialize() globalScope["resource_spot_finder"].GetBuildingPositions = GetBuildingPositions globalScope["resource_spot_finder"].IsMexPositionValid = IsBuildingPositionValid - if(gadget) then + if gadget then setMexGameRules(metalSpots) end end diff --git a/common/wav.lua b/common/wav.lua index b028993fd1f..1576dfdcd1c 100644 --- a/common/wav.lua +++ b/common/wav.lua @@ -4,7 +4,6 @@ local wavCache = {} -- A table keyed with the absolute path to the filename, - function ReadWAV(fname) if wavCache[fname] then return wavCache[fname] @@ -15,25 +14,24 @@ function ReadWAV(fname) end local data = VFS.LoadFile(fname) local ChunkID = string.sub(data, 1, 4) - local ChunkSize = VFS.UnpackU32(string.sub(data,5,8)) + local ChunkSize = VFS.UnpackU32(string.sub(data, 5, 8)) local Format = string.sub(data, 9, 12) if ChunkID == "RIFF" and Format == "WAVE" then local NumChannels = VFS.UnpackU16(string.sub(data, 23, 24)) - local SampleRate = VFS.UnpackU32(string.sub(data, 25, 28)) + local SampleRate = VFS.UnpackU32(string.sub(data, 25, 28)) local BitsPerSample = VFS.UnpackU16(string.sub(data, 35, 36)) --Spring.Echo(fname, ChunkID, ChunkSize, Format, NumChannels, SampleRate, BitsPerSample) - local Length = (ChunkSize - 36) / (SampleRate * NumChannels *(BitsPerSample/8)) + local Length = (ChunkSize - 36) / (SampleRate * NumChannels * (BitsPerSample / 8)) --Spring.Echo(Length) wavCache[fname] = { - NumChannels = NumChannels, - SampleRate = SampleRate, - BitsPerSample = BitsPerSample, - Length = Length - } + NumChannels = NumChannels, + SampleRate = SampleRate, + BitsPerSample = BitsPerSample, + Length = Length, + } return wavCache[fname] else Spring.Echo("ReadWAV: File is not a RIFF .wav file:", fname) end - end diff --git a/common/wind_functions.lua b/common/wind_functions.lua index 5c71e3772b5..9a10a64f18e 100644 --- a/common/wind_functions.lua +++ b/common/wind_functions.lua @@ -1,8 +1,42 @@ -- Precomputed average wind values, from wind random monte carlo simulation, given minWind and maxWind -local averageWindLookup = {[0]={[1]="0.8",[2]="1.5",[3]="2.2",[4]="3.0",[5]="3.7",[6]="4.5",[7]="5.2",[8]="6.0",[9]="6.7",[10]="7.5",[11]="8.2",[12]="9.0",[13]="9.7",[14]="10.4",[15]="11.2",[16]="11.9",[17]="12.7",[18]="13.4",[19]="14.2",[20]="14.9",[21]="15.7",[22]="16.4",[23]="17.2",[24]="17.9",[25]="18.6",[26]="19.2",[27]="19.6",[28]="20.0",[29]="20.4",[30]="20.7",},[1]={[2]="1.6",[3]="2.3",[4]="3.0",[5]="3.8",[6]="4.5",[7]="5.2",[8]="6.0",[9]="6.7",[10]="7.5",[11]="8.2",[12]="9.0",[13]="9.7",[14]="10.4",[15]="11.2",[16]="11.9",[17]="12.7",[18]="13.4",[19]="14.2",[20]="14.9",[21]="15.7",[22]="16.4",[23]="17.2",[24]="17.9",[25]="18.6",[26]="19.2",[27]="19.6",[28]="20.0",[29]="20.4",[30]="20.7",},[2]={[3]="2.6",[4]="3.2",[5]="3.9",[6]="4.6",[7]="5.3",[8]="6.0",[9]="6.8",[10]="7.5",[11]="8.2",[12]="9.0",[13]="9.7",[14]="10.5",[15]="11.2",[16]="12.0",[17]="12.7",[18]="13.4",[19]="14.2",[20]="14.9",[21]="15.7",[22]="16.4",[23]="17.2",[24]="17.9",[25]="18.6",[26]="19.2",[27]="19.6",[28]="20.0",[29]="20.4",[30]="20.7",},[3]={[4]="3.6",[5]="4.2",[6]="4.8",[7]="5.5",[8]="6.2",[9]="6.9",[10]="7.6",[11]="8.3",[12]="9.0",[13]="9.8",[14]="10.5",[15]="11.2",[16]="12.0",[17]="12.7",[18]="13.5",[19]="14.2",[20]="15.0",[21]="15.7",[22]="16.4",[23]="17.2",[24]="17.9",[25]="18.7",[26]="19.2",[27]="19.7",[28]="20.0",[29]="20.4",[30]="20.7",},[4]={[5]="4.6",[6]="5.2",[7]="5.8",[8]="6.4",[9]="7.1",[10]="7.8",[11]="8.5",[12]="9.2",[13]="9.9",[14]="10.6",[15]="11.3",[16]="12.1",[17]="12.8",[18]="13.5",[19]="14.3",[20]="15.0",[21]="15.7",[22]="16.5",[23]="17.2",[24]="18.0",[25]="18.7",[26]="19.2",[27]="19.7",[28]="20.1",[29]="20.4",[30]="20.7",},[5]={[6]="5.5",[7]="6.1",[8]="6.8",[9]="7.4",[10]="8.0",[11]="8.7",[12]="9.4",[13]="10.1",[14]="10.8",[15]="11.5",[16]="12.2",[17]="12.9",[18]="13.6",[19]="14.4",[20]="15.1",[21]="15.8",[22]="16.5",[23]="17.3",[24]="18.0",[25]="18.8",[26]="19.3",[27]="19.7",[28]="20.1",[29]="20.4",[30]="20.7",},[6]={[7]="6.5",[8]="7.1",[9]="7.7",[10]="8.4",[11]="9.0",[12]="9.7",[13]="10.3",[14]="11.0",[15]="11.7",[16]="12.4",[17]="13.1",[18]="13.8",[19]="14.5",[20]="15.2",[21]="15.9",[22]="16.7",[23]="17.4",[24]="18.1",[25]="18.8",[26]="19.4",[27]="19.8",[28]="20.2",[29]="20.5",[30]="20.8",},[7]={[8]="7.5",[9]="8.1",[10]="8.7",[11]="9.3",[12]="10.0",[13]="10.6",[14]="11.3",[15]="11.9",[16]="12.6",[17]="13.3",[18]="14.0",[19]="14.7",[20]="15.4",[21]="16.1",[22]="16.8",[23]="17.5",[24]="18.2",[25]="19.0",[26]="19.5",[27]="19.9",[28]="20.3",[29]="20.6",[30]="20.9",},[8]={[9]="8.5",[10]="9.1",[11]="9.7",[12]="10.3",[13]="11.0",[14]="11.6",[15]="12.2",[16]="12.9",[17]="13.6",[18]="14.2",[19]="14.9",[20]="15.6",[21]="16.3",[22]="17.0",[23]="17.7",[24]="18.4",[25]="19.1",[26]="19.6",[27]="20.0",[28]="20.4",[29]="20.7",[30]="21.0",},[9]={[10]="9.5",[11]="10.1",[12]="10.7",[13]="11.3",[14]="11.9",[15]="12.6",[16]="13.2",[17]="13.8",[18]="14.5",[19]="15.2",[20]="15.8",[21]="16.5",[22]="17.2",[23]="17.9",[24]="18.6",[25]="19.3",[26]="19.8",[27]="20.2",[28]="20.5",[29]="20.8",[30]="21.1",},[10]={[11]="10.5",[12]="11.1",[13]="11.7",[14]="12.3",[15]="12.9",[16]="13.5",[17]="14.2",[18]="14.8",[19]="15.4",[20]="16.1",[21]="16.8",[22]="17.4",[23]="18.1",[24]="18.8",[25]="19.5",[26]="20.0",[27]="20.4",[28]="20.7",[29]="21.0",[30]="21.2",},[11]={[12]="11.5",[13]="12.1",[14]="12.7",[15]="13.3",[16]="13.9",[17]="14.5",[18]="15.1",[19]="15.8",[20]="16.4",[21]="17.1",[22]="17.7",[23]="18.4",[24]="19.1",[25]="19.7",[26]="20.2",[27]="20.6",[28]="20.9",[29]="21.2",[30]="21.4",},[12]={[13]="12.5",[14]="13.1",[15]="13.6",[16]="14.2",[17]="14.9",[18]="15.5",[19]="16.1",[20]="16.7",[21]="17.4",[22]="18.0",[23]="18.7",[24]="19.3",[25]="20.0",[26]="20.4",[27]="20.8",[28]="21.1",[29]="21.4",[30]="21.6",},[13]={[14]="13.5",[15]="14.1",[16]="14.6",[17]="15.2",[18]="15.8",[19]="16.5",[20]="17.1",[21]="17.7",[22]="18.4",[23]="19.0",[24]="19.6",[25]="20.3",[26]="20.7",[27]="21.1",[28]="21.4",[29]="21.6",[30]="21.8",},[14]={[15]="14.5",[16]="15.0",[17]="15.6",[18]="16.2",[19]="16.8",[20]="17.4",[21]="18.1",[22]="18.7",[23]="19.3",[24]="20.0",[25]="20.6",[26]="21.0",[27]="21.3",[28]="21.6",[29]="21.8",[30]="22.0",},[15]={[16]="15.5",[17]="16.0",[18]="16.6",[19]="17.2",[20]="17.8",[21]="18.4",[22]="19.0",[23]="19.6",[24]="20.3",[25]="20.9",[26]="21.3",[27]="21.6",[28]="21.9",[29]="22.1",[30]="22.3",},[16]={[17]="16.5",[18]="17.0",[19]="17.6",[20]="18.2",[21]="18.8",[22]="19.4",[23]="20.0",[24]="20.6",[25]="21.3",[26]="21.7",[27]="21.9",[28]="22.2",[29]="22.4",[30]="22.5",},[17]={[18]="17.5",[19]="18.0",[20]="18.6",[21]="19.2",[22]="19.8",[23]="20.4",[24]="21.0",[25]="21.6",[26]="22.0",[27]="22.3",[28]="22.5",[29]="22.7",[30]="22.8",},[18]={[19]="18.5",[20]="19.0",[21]="19.6",[22]="20.2",[23]="20.8",[24]="21.4",[25]="22.0",[26]="22.4",[27]="22.6",[28]="22.8",[29]="23.0",[30]="23.1",},[19]={[20]="19.5",[21]="20.0",[22]="20.6",[23]="21.2",[24]="21.8",[25]="22.4",[26]="22.7",[27]="22.9",[28]="23.1",[29]="23.2",[30]="23.4",},[20]={[21]="20.4",[22]="21.0",[23]="21.6",[24]="22.2",[25]="22.8",[26]="23.1",[27]="23.3",[28]="23.4",[29]="23.6",[30]="23.7",},[21]={[22]="21.4",[23]="22.0",[24]="22.6",[25]="23.2",[26]="23.5",[27]="23.6",[28]="23.8",[29]="23.9",[30]="24.0",},[22]={[23]="22.4",[24]="23.0",[25]="23.6",[26]="23.8",[27]="24.0",[28]="24.1",[29]="24.2",[30]="24.2",},[23]={[24]="23.4",[25]="24.0",[26]="24.2",[27]="24.4",[28]="24.4",[29]="24.5",[30]="24.5",},[24]={[25]="24.4",[26]="24.6",[27]="24.7",[28]="24.7",[29]="24.8",[30]="24.8",},} +local averageWindLookup = { + [0] = { [1] = "0.8", [2] = "1.5", [3] = "2.2", [4] = "3.0", [5] = "3.7", [6] = "4.5", [7] = "5.2", [8] = "6.0", [9] = "6.7", [10] = "7.5", [11] = "8.2", [12] = "9.0", [13] = "9.7", [14] = "10.4", [15] = "11.2", [16] = "11.9", [17] = "12.7", [18] = "13.4", [19] = "14.2", [20] = "14.9", [21] = "15.7", [22] = "16.4", [23] = "17.2", [24] = "17.9", [25] = "18.6", [26] = "19.2", [27] = "19.6", [28] = "20.0", [29] = "20.4", [30] = "20.7" }, + [1] = { [2] = "1.6", [3] = "2.3", [4] = "3.0", [5] = "3.8", [6] = "4.5", [7] = "5.2", [8] = "6.0", [9] = "6.7", [10] = "7.5", [11] = "8.2", [12] = "9.0", [13] = "9.7", [14] = "10.4", [15] = "11.2", [16] = "11.9", [17] = "12.7", [18] = "13.4", [19] = "14.2", [20] = "14.9", [21] = "15.7", [22] = "16.4", [23] = "17.2", [24] = "17.9", [25] = "18.6", [26] = "19.2", [27] = "19.6", [28] = "20.0", [29] = "20.4", [30] = "20.7" }, + [2] = { [3] = "2.6", [4] = "3.2", [5] = "3.9", [6] = "4.6", [7] = "5.3", [8] = "6.0", [9] = "6.8", [10] = "7.5", [11] = "8.2", [12] = "9.0", [13] = "9.7", [14] = "10.5", [15] = "11.2", [16] = "12.0", [17] = "12.7", [18] = "13.4", [19] = "14.2", [20] = "14.9", [21] = "15.7", [22] = "16.4", [23] = "17.2", [24] = "17.9", [25] = "18.6", [26] = "19.2", [27] = "19.6", [28] = "20.0", [29] = "20.4", [30] = "20.7" }, + [3] = { [4] = "3.6", [5] = "4.2", [6] = "4.8", [7] = "5.5", [8] = "6.2", [9] = "6.9", [10] = "7.6", [11] = "8.3", [12] = "9.0", [13] = "9.8", [14] = "10.5", [15] = "11.2", [16] = "12.0", [17] = "12.7", [18] = "13.5", [19] = "14.2", [20] = "15.0", [21] = "15.7", [22] = "16.4", [23] = "17.2", [24] = "17.9", [25] = "18.7", [26] = "19.2", [27] = "19.7", [28] = "20.0", [29] = "20.4", [30] = "20.7" }, + [4] = { [5] = "4.6", [6] = "5.2", [7] = "5.8", [8] = "6.4", [9] = "7.1", [10] = "7.8", [11] = "8.5", [12] = "9.2", [13] = "9.9", [14] = "10.6", [15] = "11.3", [16] = "12.1", [17] = "12.8", [18] = "13.5", [19] = "14.3", [20] = "15.0", [21] = "15.7", [22] = "16.5", [23] = "17.2", [24] = "18.0", [25] = "18.7", [26] = "19.2", [27] = "19.7", [28] = "20.1", [29] = "20.4", [30] = "20.7" }, + [5] = { [6] = "5.5", [7] = "6.1", [8] = "6.8", [9] = "7.4", [10] = "8.0", [11] = "8.7", [12] = "9.4", [13] = "10.1", [14] = "10.8", [15] = "11.5", [16] = "12.2", [17] = "12.9", [18] = "13.6", [19] = "14.4", [20] = "15.1", [21] = "15.8", [22] = "16.5", [23] = "17.3", [24] = "18.0", [25] = "18.8", [26] = "19.3", [27] = "19.7", [28] = "20.1", [29] = "20.4", [30] = "20.7" }, + [6] = { [7] = "6.5", [8] = "7.1", [9] = "7.7", [10] = "8.4", [11] = "9.0", [12] = "9.7", [13] = "10.3", [14] = "11.0", [15] = "11.7", [16] = "12.4", [17] = "13.1", [18] = "13.8", [19] = "14.5", [20] = "15.2", [21] = "15.9", [22] = "16.7", [23] = "17.4", [24] = "18.1", [25] = "18.8", [26] = "19.4", [27] = "19.8", [28] = "20.2", [29] = "20.5", [30] = "20.8" }, + [7] = { [8] = "7.5", [9] = "8.1", [10] = "8.7", [11] = "9.3", [12] = "10.0", [13] = "10.6", [14] = "11.3", [15] = "11.9", [16] = "12.6", [17] = "13.3", [18] = "14.0", [19] = "14.7", [20] = "15.4", [21] = "16.1", [22] = "16.8", [23] = "17.5", [24] = "18.2", [25] = "19.0", [26] = "19.5", [27] = "19.9", [28] = "20.3", [29] = "20.6", [30] = "20.9" }, + [8] = { [9] = "8.5", [10] = "9.1", [11] = "9.7", [12] = "10.3", [13] = "11.0", [14] = "11.6", [15] = "12.2", [16] = "12.9", [17] = "13.6", [18] = "14.2", [19] = "14.9", [20] = "15.6", [21] = "16.3", [22] = "17.0", [23] = "17.7", [24] = "18.4", [25] = "19.1", [26] = "19.6", [27] = "20.0", [28] = "20.4", [29] = "20.7", [30] = "21.0" }, + [9] = { [10] = "9.5", [11] = "10.1", [12] = "10.7", [13] = "11.3", [14] = "11.9", [15] = "12.6", [16] = "13.2", [17] = "13.8", [18] = "14.5", [19] = "15.2", [20] = "15.8", [21] = "16.5", [22] = "17.2", [23] = "17.9", [24] = "18.6", [25] = "19.3", [26] = "19.8", [27] = "20.2", [28] = "20.5", [29] = "20.8", [30] = "21.1" }, + [10] = { [11] = "10.5", [12] = "11.1", [13] = "11.7", [14] = "12.3", [15] = "12.9", [16] = "13.5", [17] = "14.2", [18] = "14.8", [19] = "15.4", [20] = "16.1", [21] = "16.8", [22] = "17.4", [23] = "18.1", [24] = "18.8", [25] = "19.5", [26] = "20.0", [27] = "20.4", [28] = "20.7", [29] = "21.0", [30] = "21.2" }, + [11] = { [12] = "11.5", [13] = "12.1", [14] = "12.7", [15] = "13.3", [16] = "13.9", [17] = "14.5", [18] = "15.1", [19] = "15.8", [20] = "16.4", [21] = "17.1", [22] = "17.7", [23] = "18.4", [24] = "19.1", [25] = "19.7", [26] = "20.2", [27] = "20.6", [28] = "20.9", [29] = "21.2", [30] = "21.4" }, + [12] = { [13] = "12.5", [14] = "13.1", [15] = "13.6", [16] = "14.2", [17] = "14.9", [18] = "15.5", [19] = "16.1", [20] = "16.7", [21] = "17.4", [22] = "18.0", [23] = "18.7", [24] = "19.3", [25] = "20.0", [26] = "20.4", [27] = "20.8", [28] = "21.1", [29] = "21.4", [30] = "21.6" }, + [13] = { [14] = "13.5", [15] = "14.1", [16] = "14.6", [17] = "15.2", [18] = "15.8", [19] = "16.5", [20] = "17.1", [21] = "17.7", [22] = "18.4", [23] = "19.0", [24] = "19.6", [25] = "20.3", [26] = "20.7", [27] = "21.1", [28] = "21.4", [29] = "21.6", [30] = "21.8" }, + [14] = { [15] = "14.5", [16] = "15.0", [17] = "15.6", [18] = "16.2", [19] = "16.8", [20] = "17.4", [21] = "18.1", [22] = "18.7", [23] = "19.3", [24] = "20.0", [25] = "20.6", [26] = "21.0", [27] = "21.3", [28] = "21.6", [29] = "21.8", [30] = "22.0" }, + [15] = { [16] = "15.5", [17] = "16.0", [18] = "16.6", [19] = "17.2", [20] = "17.8", [21] = "18.4", [22] = "19.0", [23] = "19.6", [24] = "20.3", [25] = "20.9", [26] = "21.3", [27] = "21.6", [28] = "21.9", [29] = "22.1", [30] = "22.3" }, + [16] = { [17] = "16.5", [18] = "17.0", [19] = "17.6", [20] = "18.2", [21] = "18.8", [22] = "19.4", [23] = "20.0", [24] = "20.6", [25] = "21.3", [26] = "21.7", [27] = "21.9", [28] = "22.2", [29] = "22.4", [30] = "22.5" }, + [17] = { [18] = "17.5", [19] = "18.0", [20] = "18.6", [21] = "19.2", [22] = "19.8", [23] = "20.4", [24] = "21.0", [25] = "21.6", [26] = "22.0", [27] = "22.3", [28] = "22.5", [29] = "22.7", [30] = "22.8" }, + [18] = { [19] = "18.5", [20] = "19.0", [21] = "19.6", [22] = "20.2", [23] = "20.8", [24] = "21.4", [25] = "22.0", [26] = "22.4", [27] = "22.6", [28] = "22.8", [29] = "23.0", [30] = "23.1" }, + [19] = { [20] = "19.5", [21] = "20.0", [22] = "20.6", [23] = "21.2", [24] = "21.8", [25] = "22.4", [26] = "22.7", [27] = "22.9", [28] = "23.1", [29] = "23.2", [30] = "23.4" }, + [20] = { [21] = "20.4", [22] = "21.0", [23] = "21.6", [24] = "22.2", [25] = "22.8", [26] = "23.1", [27] = "23.3", [28] = "23.4", [29] = "23.6", [30] = "23.7" }, + [21] = { [22] = "21.4", [23] = "22.0", [24] = "22.6", [25] = "23.2", [26] = "23.5", [27] = "23.6", [28] = "23.8", [29] = "23.9", [30] = "24.0" }, + [22] = { [23] = "22.4", [24] = "23.0", [25] = "23.6", [26] = "23.8", [27] = "24.0", [28] = "24.1", [29] = "24.2", [30] = "24.2" }, + [23] = { [24] = "23.4", [25] = "24.0", [26] = "24.2", [27] = "24.4", [28] = "24.4", [29] = "24.5", [30] = "24.5" }, + [24] = { [25] = "24.4", [26] = "24.6", [27] = "24.7", [28] = "24.7", [29] = "24.8", [30] = "24.8" }, +} -- Precomputed wind risk values - percentage of time wind is less than 6 units -local windRiskLookup = {[0]={[1]="100",[2]="100",[3]="100",[4]="100",[5]="100",[6]="100",[7]="56",[8]="42",[9]="33",[10]="27",[11]="22",[12]="18.5",[13]="15.8",[14]="13.6",[15]="11.8",[16]="10.4",[17]="9.2",[18]="8.2",[19]="7.4",[20]="6.7",[21]="6.0",[22]="5.5",[23]="5.0",[24]="4.6",[25]="4.3",[26]="4.0",[27]="3.7",[28]="3.4",[29]="3.2",[30]="3.0",},[1]={[2]="100",[3]="100",[4]="100",[5]="100",[6]="100",[7]="56",[8]="42",[9]="33",[10]="27",[11]="22",[12]="18.5",[13]="15.7",[14]="13.6",[15]="11.8",[16]="10.4",[17]="9.2",[18]="8.2",[19]="7.4",[20]="6.7",[21]="6.0",[22]="5.5",[23]="5.0",[24]="4.6",[25]="4.3",[26]="4.0",[27]="3.7",[28]="3.4",[29]="3.2",[30]="3.0",},[2]={[3]="100",[4]="100",[5]="100",[6]="100",[7]="55",[8]="42",[9]="33",[10]="27",[11]="22",[12]="18.4",[13]="15.6",[14]="13.5",[15]="11.8",[16]="10.4",[17]="9.2",[18]="8.2",[19]="7.4",[20]="6.6",[21]="6.0",[22]="5.5",[23]="5.0",[24]="4.6",[25]="4.3",[26]="3.9",[27]="3.6",[28]="3.4",[29]="3.1",[30]="2.9",},[3]={[4]="100",[5]="100",[6]="100",[7]="53",[8]="40",[9]="32",[10]="25",[11]="21",[12]="17.8",[13]="15.2",[14]="13.2",[15]="11.5",[16]="10.2",[17]="9.1",[18]="8.1",[19]="7.3",[20]="6.6",[21]="6.0",[22]="5.4",[23]="5.0",[24]="4.6",[25]="4.2",[26]="3.9",[27]="3.6",[28]="3.4",[29]="3.1",[30]="2.9",},[4]={[5]="100",[6]="100",[7]="49",[8]="36",[9]="29",[10]="23",[11]="19.4",[12]="16.4",[13]="14.0",[14]="12.2",[15]="10.8",[16]="9.6",[17]="8.6",[18]="7.7",[19]="7.0",[20]="6.3",[21]="5.8",[22]="5.3",[23]="4.8",[24]="4.4",[25]="4.1",[26]="3.8",[27]="3.5",[28]="3.3",[29]="3.0",[30]="2.8",},[5]={[6]="100",[7]="41",[8]="30",[9]="24",[10]="19.5",[11]="16.2",[12]="13.9",[13]="11.9",[14]="10.4",[15]="9.3",[16]="8.3",[17]="7.5",[18]="6.8",[19]="6.2",[20]="5.7",[21]="5.2",[22]="4.8",[23]="4.4",[24]="4.1",[25]="3.8",[26]="3.5",[27]="3.2",[28]="3.0",[29]="2.8",[30]="2.6",},[6]={[7]="16.0",[8]="12.4",[9]="10.5",[10]="9.0",[11]="8.0",[12]="7.3",[13]="6.6",[14]="6.0",[15]="5.5",[16]="5.1",[17]="4.7",[18]="4.4",[19]="4.2",[20]="3.9",[21]="3.6",[22]="3.4",[23]="3.2",[24]="3.0",[25]="2.8",[26]="2.7",[27]="2.5",[28]="2.4",[29]="2.2",[30]="2.1",},} +local windRiskLookup = { + [0] = { [1] = "100", [2] = "100", [3] = "100", [4] = "100", [5] = "100", [6] = "100", [7] = "56", [8] = "42", [9] = "33", [10] = "27", [11] = "22", [12] = "18.5", [13] = "15.8", [14] = "13.6", [15] = "11.8", [16] = "10.4", [17] = "9.2", [18] = "8.2", [19] = "7.4", [20] = "6.7", [21] = "6.0", [22] = "5.5", [23] = "5.0", [24] = "4.6", [25] = "4.3", [26] = "4.0", [27] = "3.7", [28] = "3.4", [29] = "3.2", [30] = "3.0" }, + [1] = { [2] = "100", [3] = "100", [4] = "100", [5] = "100", [6] = "100", [7] = "56", [8] = "42", [9] = "33", [10] = "27", [11] = "22", [12] = "18.5", [13] = "15.7", [14] = "13.6", [15] = "11.8", [16] = "10.4", [17] = "9.2", [18] = "8.2", [19] = "7.4", [20] = "6.7", [21] = "6.0", [22] = "5.5", [23] = "5.0", [24] = "4.6", [25] = "4.3", [26] = "4.0", [27] = "3.7", [28] = "3.4", [29] = "3.2", [30] = "3.0" }, + [2] = { [3] = "100", [4] = "100", [5] = "100", [6] = "100", [7] = "55", [8] = "42", [9] = "33", [10] = "27", [11] = "22", [12] = "18.4", [13] = "15.6", [14] = "13.5", [15] = "11.8", [16] = "10.4", [17] = "9.2", [18] = "8.2", [19] = "7.4", [20] = "6.6", [21] = "6.0", [22] = "5.5", [23] = "5.0", [24] = "4.6", [25] = "4.3", [26] = "3.9", [27] = "3.6", [28] = "3.4", [29] = "3.1", [30] = "2.9" }, + [3] = { [4] = "100", [5] = "100", [6] = "100", [7] = "53", [8] = "40", [9] = "32", [10] = "25", [11] = "21", [12] = "17.8", [13] = "15.2", [14] = "13.2", [15] = "11.5", [16] = "10.2", [17] = "9.1", [18] = "8.1", [19] = "7.3", [20] = "6.6", [21] = "6.0", [22] = "5.4", [23] = "5.0", [24] = "4.6", [25] = "4.2", [26] = "3.9", [27] = "3.6", [28] = "3.4", [29] = "3.1", [30] = "2.9" }, + [4] = { [5] = "100", [6] = "100", [7] = "49", [8] = "36", [9] = "29", [10] = "23", [11] = "19.4", [12] = "16.4", [13] = "14.0", [14] = "12.2", [15] = "10.8", [16] = "9.6", [17] = "8.6", [18] = "7.7", [19] = "7.0", [20] = "6.3", [21] = "5.8", [22] = "5.3", [23] = "4.8", [24] = "4.4", [25] = "4.1", [26] = "3.8", [27] = "3.5", [28] = "3.3", [29] = "3.0", [30] = "2.8" }, + [5] = { [6] = "100", [7] = "41", [8] = "30", [9] = "24", [10] = "19.5", [11] = "16.2", [12] = "13.9", [13] = "11.9", [14] = "10.4", [15] = "9.3", [16] = "8.3", [17] = "7.5", [18] = "6.8", [19] = "6.2", [20] = "5.7", [21] = "5.2", [22] = "4.8", [23] = "4.4", [24] = "4.1", [25] = "3.8", [26] = "3.5", [27] = "3.2", [28] = "3.0", [29] = "2.8", [30] = "2.6" }, + [6] = { [7] = "16.0", [8] = "12.4", [9] = "10.5", [10] = "9.0", [11] = "8.0", [12] = "7.3", [13] = "6.6", [14] = "6.0", [15] = "5.5", [16] = "5.1", [17] = "4.7", [18] = "4.4", [19] = "4.2", [20] = "3.9", [21] = "3.6", [22] = "3.4", [23] = "3.2", [24] = "3.0", [25] = "2.8", [26] = "2.7", [27] = "2.5", [28] = "2.4", [29] = "2.2", [30] = "2.1" }, +} local windFunctions = {} diff --git a/effects/antinuke.lua b/effects/antinuke.lua index e22645e920c..7e4a6c91203 100644 --- a/effects/antinuke.lua +++ b/effects/antinuke.lua @@ -6,56 +6,54 @@ -- burngreen return { - ["antinuke"] = { - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 60, - particlelife = 1, - particlelifespread = 17, - particlesize = 3.3, - particlesizespread = 12, - particlespeed = 0.4, - particlespeedspread = 3.8, - pos = [[0, 2, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[flashside3]], - useairlos = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 15, - sizegrowth = 1.2, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - useairlos = true, - }, - }, - }, - + ["antinuke"] = { + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 60, + particlelife = 1, + particlelifespread = 17, + particlesize = 3.3, + particlesizespread = 12, + particlespeed = 0.4, + particlespeedspread = 3.8, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[flashside3]], + useairlos = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 15, + sizegrowth = 1.2, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + useairlos = true, + }, + }, + }, } - diff --git a/effects/atmospherics.lua b/effects/atmospherics.lua index c1a1c093594..e2a6aab2f97 100644 --- a/effects/atmospherics.lua +++ b/effects/atmospherics.lua @@ -1,1538 +1,1538 @@ -- Atmospheric Map Effects return { - ["fogdirty"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.15 0.14 0.13 0.08 0.1 0.1 0.1 0.04 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], - gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], - numparticles = 2, - particlelife = 520, - particlelifespread = 260, - particlesize = 100, - particlesizespread = 300, - particlespeed = 6.5, - particlespeedspread = 4.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[-400 r900, -50 r75, -200 r900]], - sizegrowth = [[0.3 r0.2]], - sizemod = 1, - texture = [[fogdirty]], - alwaysvisible = true, - }, - }, - }, + ["fogdirty"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.15 0.14 0.13 0.08 0.1 0.1 0.1 0.04 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], + gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], + numparticles = 2, + particlelife = 520, + particlelifespread = 260, + particlesize = 100, + particlesizespread = 300, + particlespeed = 6.5, + particlespeedspread = 4.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[-400 r900, -50 r75, -200 r900]], + sizegrowth = [[0.3 r0.2]], + sizemod = 1, + texture = [[fogdirty]], + alwaysvisible = true, + }, + }, + }, - ["fogdirty-red"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.20 0.12 0.07 0.08 0.12 0.08 0.05 0.04 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], - gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], - numparticles = 2, - particlelife = 520, - particlelifespread = 260, - particlesize = 100, - particlesizespread = 300, - particlespeed = 6.5, - particlespeedspread = 4.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[-400 r900, -50 r75, -200 r900]], - sizegrowth = [[0.3 r0.2]], - sizemod = 1, - texture = [[fogdirty]], - alwaysvisible = true, - }, - }, - }, + ["fogdirty-red"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.20 0.12 0.07 0.08 0.12 0.08 0.05 0.04 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], + gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], + numparticles = 2, + particlelife = 520, + particlelifespread = 260, + particlesize = 100, + particlesizespread = 300, + particlespeed = 6.5, + particlespeedspread = 4.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[-400 r900, -50 r75, -200 r900]], + sizegrowth = [[0.3 r0.2]], + sizemod = 1, + texture = [[fogdirty]], + alwaysvisible = true, + }, + }, + }, - ["fogdirty-brown"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.18 0.14 0.10 0.08 0.12 0.08 0.06 0.04 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], - gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], - numparticles = 2, - particlelife = 520, - particlelifespread = 260, - particlesize = 150, - particlesizespread = 350, - particlespeed = 6.5, - particlespeedspread = 4.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[-400 r900, -50 r75, -200 r900]], - sizegrowth = [[0.3 r0.2]], - sizemod = 1, - texture = [[fogdirty]], - alwaysvisible = true, - }, - }, - }, + ["fogdirty-brown"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.18 0.14 0.10 0.08 0.12 0.08 0.06 0.04 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], + gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], + numparticles = 2, + particlelife = 520, + particlelifespread = 260, + particlesize = 150, + particlesizespread = 350, + particlespeed = 6.5, + particlespeedspread = 4.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[-400 r900, -50 r75, -200 r900]], + sizegrowth = [[0.3 r0.2]], + sizemod = 1, + texture = [[fogdirty]], + alwaysvisible = true, + }, + }, + }, - ["fogdirty-green"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.15 0.16 0.08 0.07 0.08 0.09 0.06 0.03 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], - gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], - numparticles = 2, - particlelife = 520, - particlelifespread = 260, - particlesize = 100, - particlesizespread = 300, - particlespeed = 6.5, - particlespeedspread = 4.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[-400 r900, -50 r75, -200 r900]], - sizegrowth = [[0.3 r0.2]], - sizemod = 1, - texture = [[fogdirty]], - alwaysvisible = true, - }, - }, - }, + ["fogdirty-green"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.15 0.16 0.08 0.07 0.08 0.09 0.06 0.03 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[-0.7 r1.4, 1, -0.1 r0.2]], + gravity = [[-0.01 r0.02, -0.01 r0.03, -0.005 r0.01]], + numparticles = 2, + particlelife = 520, + particlelifespread = 260, + particlesize = 100, + particlesizespread = 300, + particlespeed = 6.5, + particlespeedspread = 4.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[-400 r900, -50 r75, -200 r900]], + sizegrowth = [[0.3 r0.2]], + sizemod = 1, + texture = [[fogdirty]], + alwaysvisible = true, + }, + }, + }, - ["mistycloud"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.99, - colormap = [[0 0 0 0.0 0.15 0.14 0.13 0.05 0.1 0.1 0.1 0.03 0 0 0 0.01]], - directional = false, - emitrot = 8, - emitrotspread = 8, - emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], - gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], - numparticles = [[2 r1]], - particlelife = 300, - particlelifespread = 500, - particlesize = 240, - particlesizespread = 960, - particlespeed = 16, - particlespeedspread = 16, - rotParams = [[-1.5 r3, -0.5 r1, -180 r360]], - pos = [[-40 r300, -20 r150, -40 r300]], - sizegrowth = [[-0.4 r0.8]], - sizemod = 1, - texture = [[cloudpuff]], - alwaysvisible = true, - }, - }, - }, + ["mistycloud"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.99, + colormap = [[0 0 0 0.0 0.15 0.14 0.13 0.05 0.1 0.1 0.1 0.03 0 0 0 0.01]], + directional = false, + emitrot = 8, + emitrotspread = 8, + emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], + gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], + numparticles = [[2 r1]], + particlelife = 300, + particlelifespread = 500, + particlesize = 240, + particlesizespread = 960, + particlespeed = 16, + particlespeedspread = 16, + rotParams = [[-1.5 r3, -0.5 r1, -180 r360]], + pos = [[-40 r300, -20 r150, -40 r300]], + sizegrowth = [[-0.4 r0.8]], + sizemod = 1, + texture = [[cloudpuff]], + alwaysvisible = true, + }, + }, + }, - ["mistycloudpurple"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.99, - colormap = [[0 0 0 0.0 0.16 0.13 0.17 0.05 0.11 0.09 0.12 0.03 0 0 0 0.01]], - directional = false, - emitrot = 8, - emitrotspread = 8, - emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], - gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], - numparticles = [[2 r1]], - particlelife = 300, - particlelifespread = 500, - particlesize = 240, - particlesizespread = 960, - particlespeed = 16, - particlespeedspread = 16, - rotParams = [[-1.5 r3, -0.5 r1, -180 r360]], - pos = [[-40 r300, -20 r150, -40 r300]], - sizegrowth = [[-0.4 r0.8]], - sizemod = 1, - texture = [[cloudpuff]], - alwaysvisible = true, - }, - }, - }, + ["mistycloudpurple"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.99, + colormap = [[0 0 0 0.0 0.16 0.13 0.17 0.05 0.11 0.09 0.12 0.03 0 0 0 0.01]], + directional = false, + emitrot = 8, + emitrotspread = 8, + emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], + gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], + numparticles = [[2 r1]], + particlelife = 300, + particlelifespread = 500, + particlesize = 240, + particlesizespread = 960, + particlespeed = 16, + particlespeedspread = 16, + rotParams = [[-1.5 r3, -0.5 r1, -180 r360]], + pos = [[-40 r300, -20 r150, -40 r300]], + sizegrowth = [[-0.4 r0.8]], + sizemod = 1, + texture = [[cloudpuff]], + alwaysvisible = true, + }, + }, + }, - ["mistycloudpurplemist"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0.01 0.24 0.20 0.28 0.05 0.11 0.09 0.12 0.02 0 0 0 0.01]], - dir = [[-0.1 r0.2, 1, -0.1 r0.2]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.9, - fronttexture = [[barmist]], - length = 90, - sidetexture = [[none]], - size = [[290 r190]], - sizegrowth = [[0.3 r0.65]], - ttl = 450, - pos = [[-75 r150, 0 r25, -75 r150]], - rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], - drawOrder = 0, - }, - }, - }, + ["mistycloudpurplemist"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0.01 0.24 0.20 0.28 0.05 0.11 0.09 0.12 0.02 0 0 0 0.01]], + dir = [[-0.1 r0.2, 1, -0.1 r0.2]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.9, + fronttexture = [[barmist]], + length = 90, + sidetexture = [[none]], + size = [[290 r190]], + sizegrowth = [[0.3 r0.65]], + ttl = 450, + pos = [[-75 r150, 0 r25, -75 r150]], + rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], + drawOrder = 0, + }, + }, + }, - ["mistycloudpurplemistxl"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0.01 0.24 0.20 0.28 0.05 0.11 0.09 0.12 0.02 0 0 0 0.01]], - dir = [[-0.06 r0.12, 1, -0.06 r0.12]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.9, - fronttexture = [[barmist]], - length = 90, - sidetexture = [[none]], - size = [[550 r290]], - sizegrowth = [[0.3 r0.55]], - ttl = 550, - pos = [[-150 r300, -5 r35, -150 r300]], - rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], - drawOrder = 0, - }, - }, - }, + ["mistycloudpurplemistxl"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0.01 0.24 0.20 0.28 0.05 0.11 0.09 0.12 0.02 0 0 0 0.01]], + dir = [[-0.06 r0.12, 1, -0.06 r0.12]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.9, + fronttexture = [[barmist]], + length = 90, + sidetexture = [[none]], + size = [[550 r290]], + sizegrowth = [[0.3 r0.55]], + ttl = 550, + pos = [[-150 r300, -5 r35, -150 r300]], + rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], + drawOrder = 0, + }, + }, + }, - ["mistycloudbrownmistxl"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0.01 0.24 0.18 0.14 0.22 0.17 0.13 0.11 0.08 0 0 0 0.01]], - dir = [[-0.06 r0.12, 1, -0.06 r0.12]], - --gravity = [[-0.008 r0.016, -0.03 r0.06, -0.008 r0.016]], - frontoffset = 0.9, - fronttexture = [[barmist]], - length = 90, - sidetexture = [[none]], - size = [[550 r290]], - sizegrowth = [[0.3 r0.55]], - ttl = 550, - pos = [[-150 r300, -5 r35, -150 r300]], - rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], - drawOrder = 1, - }, - }, - }, + ["mistycloudbrownmistxl"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0.01 0.24 0.18 0.14 0.22 0.17 0.13 0.11 0.08 0 0 0 0.01]], + dir = [[-0.06 r0.12, 1, -0.06 r0.12]], + --gravity = [[-0.008 r0.016, -0.03 r0.06, -0.008 r0.016]], + frontoffset = 0.9, + fronttexture = [[barmist]], + length = 90, + sidetexture = [[none]], + size = [[550 r290]], + sizegrowth = [[0.3 r0.55]], + ttl = 550, + pos = [[-150 r300, -5 r35, -150 r300]], + rotParams = [[-1.8 r3.6, -0.3 r0.6, -180 r360]], + drawOrder = 1, + }, + }, + }, - ["thickcloud"] = { - usedefaultexplosions = false, - cloud = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.99, - colormap = [[0 0 0 0.01 0.20 0.19 0.17 0.05 0.11 0.11 0.11 0.03 0 0 0 0.01]], - directional = false, - emitrot = 8, - emitrotspread = 8, - emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], - gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], - numparticles = [[2 r1]], - particlelife = 500, - particlelifespread = 400, - particlesize = 1240, - particlesizespread = 2580, - particlespeed = 8, - particlespeedspread = 8, - rotParams = [[-2 r4, -0.1 r0.2, -180 r360]], - pos = [[-40 r300, -20 r150, -40 r300]], - sizegrowth = [[-0.4 r0.8]], - sizemod = 1, - texture = [[cloudpuff]], - alwaysvisible = true, - }, - }, - }, + ["thickcloud"] = { + usedefaultexplosions = false, + cloud = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.99, + colormap = [[0 0 0 0.01 0.20 0.19 0.17 0.05 0.11 0.11 0.11 0.03 0 0 0 0.01]], + directional = false, + emitrot = 8, + emitrotspread = 8, + emitvector = [[-0.35 r0.7, 0, -0.1 r0.2]], + gravity = [[-0.005 r0.01, -0.01 r0.02, -0.005 r0.01]], + numparticles = [[2 r1]], + particlelife = 500, + particlelifespread = 400, + particlesize = 1240, + particlesizespread = 2580, + particlespeed = 8, + particlespeedspread = 8, + rotParams = [[-2 r4, -0.1 r0.2, -180 r360]], + pos = [[-40 r300, -20 r150, -40 r300]], + sizegrowth = [[-0.4 r0.8]], + sizemod = 1, + texture = [[cloudpuff]], + alwaysvisible = true, + }, + }, + }, - ["lightningstorm"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 14, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r1090]], - explosiongenerator = [[custom:lightninginair]], - pos = [[-500 r1000, 128, -500 r1000]], - }, - }, - }, + ["lightningstorm"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 14, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r1090]], + explosiongenerator = [[custom:lightninginair]], + pos = [[-500 r1000, 128, -500 r1000]], + }, + }, + }, - ["lightningstormgreen"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 14, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r1090]], - explosiongenerator = [[custom:lightninginairgreen]], - pos = [[-500 r1000, 128, -500 r1000]], - }, - }, - }, + ["lightningstormgreen"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 14, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r1090]], + explosiongenerator = [[custom:lightninginairgreen]], + pos = [[-500 r1000, 128, -500 r1000]], + }, + }, + }, - ["lightninginair"] = { - lightningbolt = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.1 0.1 0.1 0.006 0.8 0.8 0.8 0.02 0 0 0 0.01 0.5 0.5 0.5 0.020 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - rotParams = [[0, -30 r60, -180 r360]], - frontoffset = 0, - fronttexture = [[none]], - length = 1700, - sidetexture = [[lightninginair]], - size = [[40 r80]], - sizegrowth = 0, - ttl = [[2.5 r7]], - pos = [[0.5, 64, 0.0]], - alwaysvisible = true, - }, - }, - }, - ["lightninginairgreen"] = { - lightningbolt = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.1 0.2 0.1 0.007 0.6 0.8 0.65 0.025 0 0 0 0.01 0.6 0.8 0.65 0.025 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 1700, - sidetexture = [[lightninginair]], - size = [[40 r80]], - sizegrowth = 0, - ttl = [[3 r8]], - pos = [[0.5, 64, 0.0]], - alwaysvisible = true, - }, - }, - }, - ["lightningstrike"] = { - lightningbolt = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.1 0.1 0.1 0.007 0.8 0.8 0.8 0.025 0 0 0 0.01 0.60 0.6 0.6 0.025 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - rotParams = [[0, -30 r60, -180 r360]], - frontoffset = 0, - fronttexture = [[none]], - length = 2500, - sidetexture = [[lightning]], - size = [[50 r100]], - sizegrowth = 0, - ttl = [[2.5 r7]], - pos = [[0.5, 5, 0.0]], - alwaysvisible = true, - }, - }, - lightningbolt2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0.1 0.1 0.1 0.007 0.8 0.8 0.8 0.025 0 0 0 0.01 0.60 0.6 0.6 0.025 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[3 r3]], - particlelife = 10, - particlelifespread = 15, - particlesize = 20, - particlesizespread = 40, - particlespeed = 1, - particlespeedspread = 1, - pos = [[1, 300, 1]], - sizegrowth = -0.9, - sizemod = 1, - texture = [[lightning]], - useairlos = false, - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.6 0.6 0.6 0.45 0 0 0 0.01]], - size = 70, - sizegrowth = -0.4, - ttl = 9, - texture = [[groundflash]], - }, - }, - electricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0.9 0.9 0.9 0.037 0.6 0.6 0.6 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.01, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 7, - particlelifespread = 1, - particlesize = 12, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 3.3, - pos = [[0, 5, 0]], - sizegrowth = 0.75, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - alwaysvisible = true, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 8, - heatfalloff = 1.5, - maxheat = 16, - pos = [[r-2 r3, 5, r-2 r3]], - size = 2.5, - sizegrowth = 7, - speed = [[0, 1 0, 0]], - texture = [[plasmaball]], - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[2 r1]], - particlelife = 5, - particlelifespread = 5, - particlesize = 18, - particlesizespread = 22, - particlespeed = 10, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.04, - sizemod = 0.92, - texture = [[flare2]], - useairlos = false, - alwaysvisible = true, - }, - }, - }, + ["lightninginair"] = { + lightningbolt = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.1 0.1 0.006 0.8 0.8 0.8 0.02 0 0 0 0.01 0.5 0.5 0.5 0.020 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + rotParams = [[0, -30 r60, -180 r360]], + frontoffset = 0, + fronttexture = [[none]], + length = 1700, + sidetexture = [[lightninginair]], + size = [[40 r80]], + sizegrowth = 0, + ttl = [[2.5 r7]], + pos = [[0.5, 64, 0.0]], + alwaysvisible = true, + }, + }, + }, + ["lightninginairgreen"] = { + lightningbolt = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.2 0.1 0.007 0.6 0.8 0.65 0.025 0 0 0 0.01 0.6 0.8 0.65 0.025 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 1700, + sidetexture = [[lightninginair]], + size = [[40 r80]], + sizegrowth = 0, + ttl = [[3 r8]], + pos = [[0.5, 64, 0.0]], + alwaysvisible = true, + }, + }, + }, + ["lightningstrike"] = { + lightningbolt = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.1 0.1 0.007 0.8 0.8 0.8 0.025 0 0 0 0.01 0.60 0.6 0.6 0.025 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + rotParams = [[0, -30 r60, -180 r360]], + frontoffset = 0, + fronttexture = [[none]], + length = 2500, + sidetexture = [[lightning]], + size = [[50 r100]], + sizegrowth = 0, + ttl = [[2.5 r7]], + pos = [[0.5, 5, 0.0]], + alwaysvisible = true, + }, + }, + lightningbolt2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.007 0.8 0.8 0.8 0.025 0 0 0 0.01 0.60 0.6 0.6 0.025 0.01 0.01 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[3 r3]], + particlelife = 10, + particlelifespread = 15, + particlesize = 20, + particlesizespread = 40, + particlespeed = 1, + particlespeedspread = 1, + pos = [[1, 300, 1]], + sizegrowth = -0.9, + sizemod = 1, + texture = [[lightning]], + useairlos = false, + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.6 0.6 0.45 0 0 0 0.01]], + size = 70, + sizegrowth = -0.4, + ttl = 9, + texture = [[groundflash]], + }, + }, + electricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0.9 0.9 0.9 0.037 0.6 0.6 0.6 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.01, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 7, + particlelifespread = 1, + particlesize = 12, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 3.3, + pos = [[0, 5, 0]], + sizegrowth = 0.75, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + alwaysvisible = true, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 8, + heatfalloff = 1.5, + maxheat = 16, + pos = [[r-2 r3, 5, r-2 r3]], + size = 2.5, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[plasmaball]], + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[2 r1]], + particlelife = 5, + particlelifespread = 5, + particlesize = 18, + particlesizespread = 22, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.04, + sizemod = 0.92, + texture = [[flare2]], + useairlos = false, + alwaysvisible = true, + }, + }, + }, - ["lightningstrikegreen"] = { - lightningbolt = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.1 0.2 0.1 0.007 0.6 0.8 0.65 0.012 0 0 0 0.01 0.7 0.9 0.75 0.03 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - rotParams = [[0, -30 r60, -180 r360]], - frontoffset = 0, - fronttexture = [[none]], - length = 2500, - sidetexture = [[lightning]], - size = [[40 r100]], - sizegrowth = 0, - ttl = [[2.5 r9]], - pos = [[0.5, 5, 0.0]], - alwaysvisible = true, - }, - }, - lightningbolt2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0.1 0.2 0.1 0.007 0.7 0.9 0.75 0.03 0 0 0 0.01 0.6 0.8 0.75 0.03 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[3 r3]], - particlelife = 10, - particlelifespread = 15, - particlesize = 20, - particlesizespread = 40, - particlespeed = 1, - particlespeedspread = 1, - pos = [[1, 300, 1]], - sizegrowth = -0.9, - sizemod = 1, - texture = [[lightning]], - useairlos = false, - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.7 0.5 0.45 0 0 0 0.01]], - size = 150, - sizegrowth = -7.5, - ttl = 13, - texture = [[groundflash]], - }, - }, - electricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0.75 0.9 0.8 0.037 0.6 0.7 0.6 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.01, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 7, - particlelifespread = 1, - particlesize = 12, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 3.3, - pos = [[0, 5, 0]], - sizegrowth = 0.75, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - alwaysvisible = true, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 8, - heatfalloff = 1.5, - maxheat = 16, - pos = [[r-2 r3, 5, r-2 r3]], - size = 2.5, - sizegrowth = 7, - speed = [[0, 1 0, 0]], - texture = [[plasmaball]], - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.75 0.9 0.8 0.02 0.6 0.7 0.6 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[2 r1]], - particlelife = 5, - particlelifespread = 5, - particlesize = 18, - particlesizespread = 22, - particlespeed = 10, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.04, - sizemod = 0.92, - texture = [[flare2]], - useairlos = false, - alwaysvisible = true, - }, - }, - }, + ["lightningstrikegreen"] = { + lightningbolt = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.2 0.1 0.007 0.6 0.8 0.65 0.012 0 0 0 0.01 0.7 0.9 0.75 0.03 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + rotParams = [[0, -30 r60, -180 r360]], + frontoffset = 0, + fronttexture = [[none]], + length = 2500, + sidetexture = [[lightning]], + size = [[40 r100]], + sizegrowth = 0, + ttl = [[2.5 r9]], + pos = [[0.5, 5, 0.0]], + alwaysvisible = true, + }, + }, + lightningbolt2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.2 0.1 0.007 0.7 0.9 0.75 0.03 0 0 0 0.01 0.6 0.8 0.75 0.03 0.01 0.02 0.01 0.03 0.01 0.01 0.01 0.009 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[3 r3]], + particlelife = 10, + particlelifespread = 15, + particlesize = 20, + particlesizespread = 40, + particlespeed = 1, + particlespeedspread = 1, + pos = [[1, 300, 1]], + sizegrowth = -0.9, + sizemod = 1, + texture = [[lightning]], + useairlos = false, + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.7 0.5 0.45 0 0 0 0.01]], + size = 150, + sizegrowth = -7.5, + ttl = 13, + texture = [[groundflash]], + }, + }, + electricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0.75 0.9 0.8 0.037 0.6 0.7 0.6 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.01, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 7, + particlelifespread = 1, + particlesize = 12, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 3.3, + pos = [[0, 5, 0]], + sizegrowth = 0.75, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + alwaysvisible = true, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 8, + heatfalloff = 1.5, + maxheat = 16, + pos = [[r-2 r3, 5, r-2 r3]], + size = 2.5, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[plasmaball]], + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.75 0.9 0.8 0.02 0.6 0.7 0.6 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[2 r1]], + particlelife = 5, + particlelifespread = 5, + particlesize = 18, + particlesizespread = 22, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.04, + sizemod = 0.92, + texture = [[flare2]], + useairlos = false, + alwaysvisible = true, + }, + }, + }, - ["sandstorm"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 50, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:sandblast]], - pos = [[-375 r750, -20 r30, -375 r750]], - }, - }, - }, + ["sandstorm"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 50, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:sandblast]], + pos = [[-375 r750, -20 r30, -375 r750]], + }, + }, + }, - ["sandblast"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0.0 0.05 0.05 0.05 0.03 0.07 0.07 0.07 0.08 0.1 0.1 0.1 0.12 0 0 0 0.01]], - directional = false, - emitrot = 4, - emitrotspread = 4, - emitvector = [[1, 0, -0.1]], - gravity = [[0.5, -0.03, -0.01]], - numparticles = 4, - particlelife = 8, - particlelifespread = 50, - particlesize = 36, - particlesizespread = 60, - particlespeed = 5.5, - particlespeedspread = 3.5, - pos = [[-20 r40, -20 r50, 0 r40]], - sizegrowth = [[2 r1.8]], - sizemod = 1, - texture = [[sandblast]], - alwaysvisible = true, - }, - }, - }, + ["sandblast"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0.0 0.05 0.05 0.05 0.03 0.07 0.07 0.07 0.08 0.1 0.1 0.1 0.12 0 0 0 0.01]], + directional = false, + emitrot = 4, + emitrotspread = 4, + emitvector = [[1, 0, -0.1]], + gravity = [[0.5, -0.03, -0.01]], + numparticles = 4, + particlelife = 8, + particlelifespread = 50, + particlesize = 36, + particlesizespread = 60, + particlespeed = 5.5, + particlespeedspread = 3.5, + pos = [[-20 r40, -20 r50, 0 r40]], + sizegrowth = [[2 r1.8]], + sizemod = 1, + texture = [[sandblast]], + alwaysvisible = true, + }, + }, + }, - ["sandcloud"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 80, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r500]], - explosiongenerator = [[custom:sanddust]], - pos = [[-500 r1000, 125 r30, -500 r1000]], - }, - }, - }, + ["sandcloud"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 80, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r500]], + explosiongenerator = [[custom:sanddust]], + pos = [[-500 r1000, 125 r30, -500 r1000]], + }, + }, + }, - ["sandcloud_sparse"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 20, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r300]], - explosiongenerator = [[custom:sanddustgray]], - pos = [[-500 r2000, 125 r30, -500 r2000]], - }, - }, - }, + ["sandcloud_sparse"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 20, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r300]], + explosiongenerator = [[custom:sanddustgray]], + pos = [[-500 r2000, 125 r30, -500 r2000]], + }, + }, + }, - ["sandclouddense"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 75, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r375]], - explosiongenerator = [[custom:sanddustdense]], - pos = [[-500 r1000, 125 r30, -500 r1000]], - }, - }, - }, + ["sandclouddense"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 75, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r375]], + explosiongenerator = [[custom:sanddustdense]], + pos = [[-500 r1000, 125 r30, -500 r1000]], + }, + }, + }, - ["sandclouddensexl"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 750, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[25 r1000]], - explosiongenerator = [[custom:sanddustdense]], - pos = [[-500 r2500, 125 r30, -500 r2500]], - }, - }, - }, + ["sandclouddensexl"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 750, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[25 r1000]], + explosiongenerator = [[custom:sanddustdense]], + pos = [[-500 r2500, 125 r30, -500 r2500]], + }, + }, + }, -["sanddustgray"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.12 0.14 0.15 0.04 0.12 0.14 0.15 0.02 0 0 0 0.0]], - directional = false, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0.3, -1, 0.3]], - gravity = [[0.02 r0.08, 0.004 r0.008, 0.02 r0.08]], - numparticles = 3, - particlelife = 220, - particlelifespread = 140, - particlesize = 8, - particlesizespread = 120, - particlespeed = 12.5, - particlespeedspread = 7.5, - rotParams = [[-5 r10, -2 r4, -180 r360]], - pos = [[0 r150, -25 r50, 0 r150]], - sizegrowth = [[0.25 r0.1]], - sizemod = 1, - texture = [[smoke_puff_red]], - useairlos = true, - -- alwaysvisible = true, - }, - }, - }, + ["sanddustgray"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.12 0.14 0.15 0.04 0.12 0.14 0.15 0.02 0 0 0 0.0]], + directional = false, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0.3, -1, 0.3]], + gravity = [[0.02 r0.08, 0.004 r0.008, 0.02 r0.08]], + numparticles = 3, + particlelife = 220, + particlelifespread = 140, + particlesize = 8, + particlesizespread = 120, + particlespeed = 12.5, + particlespeedspread = 7.5, + rotParams = [[-5 r10, -2 r4, -180 r360]], + pos = [[0 r150, -25 r50, 0 r150]], + sizegrowth = [[0.25 r0.1]], + sizemod = 1, + texture = [[smoke_puff_red]], + useairlos = true, + -- alwaysvisible = true, + }, + }, + }, -["sanddust"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0.0 0.14 0.14 0.14 0.14 0.08 0.08 0.08 0.08 0 0 0 0.0]], - directional = false, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0.3, -1, 0.3]], - gravity = [[0, 0.004 r0.008, 0]], - numparticles = 3, - particlelife = 200, - particlelifespread = 140, - particlesize = 16, - particlesizespread = 140, - particlespeed = 14.5, - particlespeedspread = 7.5, - rotParams = [[-5 r10, -2 r4, -180 r360]], - pos = [[0 r150, -25 r50, 0 r150]], - sizegrowth = [[0.25 r0.1]], - sizemod = 1, - texture = [[smoke_puff_red]], - useairlos = true, - --alwaysvisible = true, - }, - }, - }, + ["sanddust"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0.0 0.14 0.14 0.14 0.14 0.08 0.08 0.08 0.08 0 0 0 0.0]], + directional = false, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0.3, -1, 0.3]], + gravity = [[0, 0.004 r0.008, 0]], + numparticles = 3, + particlelife = 200, + particlelifespread = 140, + particlesize = 16, + particlesizespread = 140, + particlespeed = 14.5, + particlespeedspread = 7.5, + rotParams = [[-5 r10, -2 r4, -180 r360]], + pos = [[0 r150, -25 r50, 0 r150]], + sizegrowth = [[0.25 r0.1]], + sizemod = 1, + texture = [[smoke_puff_red]], + useairlos = true, + --alwaysvisible = true, + }, + }, + }, - ["sanddustdense"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 5, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0.0 0.14 0.14 0.14 0.14 0.08 0.08 0.08 0.08 0 0 0 0.0]], - directional = false, - emitrot = 8, - emitrotspread = 16, - emitvector = [[0.3, -1, 0.3]], - gravity = [[0, 0.004 r0.008, 0]], - numparticles = 1, - particlelife = 190, - particlelifespread = 250, - particlesize = 24, - particlesizespread = 170, - particlespeed = 14.5, - particlespeedspread = 7.5, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0 r150, -25 r50, 0 r150]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[smoke_puff_red]], - useairlos = true, - --alwaysvisible = true, - }, - }, - }, + ["sanddustdense"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 5, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0.0 0.14 0.14 0.14 0.14 0.08 0.08 0.08 0.08 0 0 0 0.0]], + directional = false, + emitrot = 8, + emitrotspread = 16, + emitvector = [[0.3, -1, 0.3]], + gravity = [[0, 0.004 r0.008, 0]], + numparticles = 1, + particlelife = 190, + particlelifespread = 250, + particlesize = 24, + particlesizespread = 170, + particlespeed = 14.5, + particlespeedspread = 7.5, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0 r150, -25 r50, 0 r150]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[smoke_puff_red]], + useairlos = true, + --alwaysvisible = true, + }, + }, + }, - ["dunecloud"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 5, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r500]], - explosiongenerator = [[custom:dunedust]], - pos = [[-200 r400, 50 r25, -200 r400]], - }, - }, - }, + ["dunecloud"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 5, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r500]], + explosiongenerator = [[custom:dunedust]], + pos = [[-200 r400, 50 r25, -200 r400]], + }, + }, + }, -["dunedust"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.0 0.12 0.10 0.08 0.05 0.16 0.14 0.10 0.07 0.11 0.09 0.07 0.06 0 0 0 0.0]], - directional = false, - emitrot = 5, - emitrotspread = 45, - emitvector = [[0, -1, 0]], - gravity = [[-0.05 r0.10, -0.03 r0.09, -0.01 r0.02]], - numparticles = 1, - particlelife = 120, - particlelifespread = 120, - particlesize = 55, - particlesizespread = 290, - particlespeed = 3.1, - particlespeedspread = 1.7, - rotParams = [[-3 r6, -1.5 r3, -120 r240]], - pos = [[-75 r150, -20 r40, -75 r150]], - sizegrowth = [[0.18 r0.13]], - sizemod = 1, - texture = [[barmist]], - useairlos = true, - --alwaysvisible = true, - }, - }, - }, + ["dunedust"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.0 0.12 0.10 0.08 0.05 0.16 0.14 0.10 0.07 0.11 0.09 0.07 0.06 0 0 0 0.0]], + directional = false, + emitrot = 5, + emitrotspread = 45, + emitvector = [[0, -1, 0]], + gravity = [[-0.05 r0.10, -0.03 r0.09, -0.01 r0.02]], + numparticles = 1, + particlelife = 120, + particlelifespread = 120, + particlesize = 55, + particlesizespread = 290, + particlespeed = 3.1, + particlespeedspread = 1.7, + rotParams = [[-3 r6, -1.5 r3, -120 r240]], + pos = [[-75 r150, -20 r40, -75 r150]], + sizegrowth = [[0.18 r0.13]], + sizemod = 1, + texture = [[barmist]], + useairlos = true, + --alwaysvisible = true, + }, + }, + }, - ["ventairburst"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 80, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r90]], - explosiongenerator = [[custom:ventair-puff]], - pos = [[-3 r6, 0 r10, -3 r6]], - }, - }, - }, + ["ventairburst"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 80, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r90]], + explosiongenerator = [[custom:ventair-puff]], + pos = [[-3 r6, 0 r10, -3 r6]], + }, + }, + }, - ["ventair-puff"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.15 0.14 0.16 0.07 0.16 0.15 0.17 0.18 0.16 0.15 0.17 0.13 0.12 0.11 0.13 0.09 0 0 0 0.01]], - directional = false, - emitrot = 5, - emitrotspread = 1, - emitvector = [[0.0, 1, 0.0]], - gravity = [[-0.03 r0.06, 0.02 r0.07, -0.03 r0.06]], - numparticles = 1, - particlelife = 40, - particlelifespread = 60, - particlesize = 1.9, - particlesizespread = 14, - particlespeed = 3.5, - particlespeedspread = 2, - pos = [[0.0, 1, 0.0]], - rotParams = [[-20 r40, -8 r16, -180 r360]], - sizegrowth = [[0.45 r0.2]], - sizemod = 0.99, - texture = [[dirtbar]], - useairlos = true, - }, - }, - }, + ["ventair-puff"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.15 0.14 0.16 0.07 0.16 0.15 0.17 0.18 0.16 0.15 0.17 0.13 0.12 0.11 0.13 0.09 0 0 0 0.01]], + directional = false, + emitrot = 5, + emitrotspread = 1, + emitvector = [[0.0, 1, 0.0]], + gravity = [[-0.03 r0.06, 0.02 r0.07, -0.03 r0.06]], + numparticles = 1, + particlelife = 40, + particlelifespread = 60, + particlesize = 1.9, + particlesizespread = 14, + particlespeed = 3.5, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + rotParams = [[-20 r40, -8 r16, -180 r360]], + sizegrowth = [[0.45 r0.2]], + sizemod = 0.99, + texture = [[dirtbar]], + useairlos = true, + }, + }, + }, - ["fireflies"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 60, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:firefly]], - pos = [[-25 r125, 5 r25, -25 r125]], - }, - }, - }, + ["fireflies"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 60, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:firefly]], + pos = [[-25 r125, 5 r25, -25 r125]], + }, + }, + }, - ["firefliesgreen"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 60, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:fireflygreen]], - pos = [[-25 r125, 5 r25, -25 r125]], - }, - }, - }, + ["firefliesgreen"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 60, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:fireflygreen]], + pos = [[-25 r125, 5 r25, -25 r125]], + }, + }, + }, - ["firefliespurple"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 60, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:fireflypurple]], - pos = [[-25 r125, 5 r25, -25 r125]], - }, - }, - }, + ["firefliespurple"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 60, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:fireflypurple]], + pos = [[-25 r125, 5 r25, -25 r125]], + }, + }, + }, - ["firefly"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.68 0.6 0.05 0.018 0.92 0.77 0.15 0.035 0.81 0.72 0.1 0.008 0.3 0.2 0.05 0.005 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 180, - --emitmul = [[2, 2, 2]], - emitvector = [[1, 1, 1]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 66, - particlesize = 4, - particlesizespread = 35, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - }, - }, - }, + ["firefly"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.68 0.6 0.05 0.018 0.92 0.77 0.15 0.035 0.81 0.72 0.1 0.008 0.3 0.2 0.05 0.005 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 180, + --emitmul = [[2, 2, 2]], + emitvector = [[1, 1, 1]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 66, + particlesize = 4, + particlesizespread = 35, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, - ["fireflygreen"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.5 0.7 0.05 0.018 0.7 0.92 0.15 0.035 0.6 0.81 0.1 0.008 0.15 0.3 0.05 0.005 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 180, - --emitmul = [[2, 2, 2]], - emitvector = [[1, 1, 1]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 66, - particlesize = 4, - particlesizespread = 35, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - }, - }, - }, + ["fireflygreen"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.5 0.7 0.05 0.018 0.7 0.92 0.15 0.035 0.6 0.81 0.1 0.008 0.15 0.3 0.05 0.005 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 180, + --emitmul = [[2, 2, 2]], + emitvector = [[1, 1, 1]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 66, + particlesize = 4, + particlesizespread = 35, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, - ["fireflypurple"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.65 0.3 0.7 0.018 0.9 0.4 0.95 0.035 0.78 0.25 0.8 0.008 0.25 0.1 0.3 0.005 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 180, - --emitmul = [[2, 2, 2]], - emitvector = [[1, 1, 1]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 66, - particlesize = 4, - particlesizespread = 35, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - }, - }, - }, + ["fireflypurple"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.65 0.3 0.7 0.018 0.9 0.4 0.95 0.035 0.78 0.25 0.8 0.008 0.25 0.1 0.3 0.005 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 180, + --emitmul = [[2, 2, 2]], + emitvector = [[1, 1, 1]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 66, + particlesize = 4, + particlesizespread = 35, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, - ["dustparticles"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 200, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:dustparticle]], - pos = [[-25 r2000, 25 r150, -25 r2000]], - }, - }, - }, + ["dustparticles"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 200, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:dustparticle]], + pos = [[-25 r2000, 25 r150, -25 r2000]], + }, + }, + }, - ["dustparticle"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.2 0.2 0.2 0.016 0.3 0.3 0.3 0.03 0.25 0.25 0.25 0.008 0.1 0.1 0.1 0.005 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 180, - --emitmul = [[2, 2, 2]], - emitvector = [[1, 0.1, 1]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 100, - particlelifespread = 200, - particlesize = 3, - particlesizespread = 6, - particlespeed = 4.15, - particlespeedspread = 1.16, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.1, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - }, - }, - }, + ["dustparticle"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.2 0.2 0.2 0.016 0.3 0.3 0.3 0.03 0.25 0.25 0.25 0.008 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 180, + --emitmul = [[2, 2, 2]], + emitvector = [[1, 0.1, 1]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 100, + particlelifespread = 200, + particlesize = 3, + particlesizespread = 6, + particlespeed = 4.15, + particlespeedspread = 1.16, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.1, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, -["powerupwhite"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 60, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r750]], - explosiongenerator = [[custom:powerupspritewhite]], - pos = [[-25 r50, -35 r25, -25 r50]], - }, - }, - }, + ["powerupwhite"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 60, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r750]], + explosiongenerator = [[custom:powerupspritewhite]], + pos = [[-25 r50, -35 r25, -25 r50]], + }, + }, + }, -["powerupspritewhite"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.7 0.7 0.7 0.018 0.9 0.9 0.9 0.035 0.7 0.7 0.7 0.008 0.2 0.2 0.2 0.005 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - --emitmul = [[2, 2, 2]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0.06, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 66, - particlesize = 6, - particlesizespread = 15, - particlespeed = 0.40, - particlespeedspread = 0.03, - pos = [[-10 r20, 1, -10 r20]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[gunshot]], - alwaysvisible = true, - }, - }, - }, - ["rain"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 3180, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r1060]], - explosiongenerator = [[custom:raindrop]], - pos = [[-875 r1750, 1250 r150, -875 r1750]], - }, - }, - }, + ["powerupspritewhite"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.7 0.7 0.7 0.018 0.9 0.9 0.9 0.035 0.7 0.7 0.7 0.008 0.2 0.2 0.2 0.005 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + --emitmul = [[2, 2, 2]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0.06, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 66, + particlesize = 6, + particlesizespread = 15, + particlespeed = 0.40, + particlespeedspread = 0.03, + pos = [[-10 r20, 1, -10 r20]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[gunshot]], + alwaysvisible = true, + }, + }, + }, + ["rain"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 3180, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r1060]], + explosiongenerator = [[custom:raindrop]], + pos = [[-875 r1750, 1250 r150, -875 r1750]], + }, + }, + }, - ["rainlight"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 900, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r1060]], - explosiongenerator = [[custom:raindrop]], - pos = [[-625 r1250, 1250 r150, -625 r1550]], - }, - }, - }, + ["rainlight"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 900, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r1060]], + explosiongenerator = [[custom:raindrop]], + pos = [[-625 r1250, 1250 r150, -625 r1550]], + }, + }, + }, - ["rainlight-acid"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 500, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r1060]], - explosiongenerator = [[custom:raindrop-acid]], - pos = [[-500 r1000, 1250 r150, -500 r1000]], - }, - }, - }, + ["rainlight-acid"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 500, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r1060]], + explosiongenerator = [[custom:raindrop-acid]], + pos = [[-500 r1000, 1250 r150, -500 r1000]], + }, + }, + }, - ["rainverylight-acid"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 210, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r530]], - explosiongenerator = [[custom:raindrop-acid]], - pos = [[-375 r750, 1250 r150, -375 r750]], - }, - }, - }, + ["rainverylight-acid"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 210, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r530]], + explosiongenerator = [[custom:raindrop-acid]], + pos = [[-375 r750, 1250 r150, -375 r750]], + }, + }, + }, - ["rainpatch"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CExpGenSpawner]], - count = 900, - ground = true, - water = true, - underwater = false, - properties = { - delay = [[1 r300]], - explosiongenerator = [[custom:raindrop]], - pos = [[-875 r1750, 1250 r150, -875 r1750]], - }, - }, - }, + ["rainpatch"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CExpGenSpawner]], + count = 900, + ground = true, + water = true, + underwater = false, + properties = { + delay = [[1 r300]], + explosiongenerator = [[custom:raindrop]], + pos = [[-875 r1750, 1250 r150, -875 r1750]], + }, + }, + }, - ["raindrop"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - unit = false, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.07 0.07 0.07 0.02 0.1 0.1 0.1 0.09 0 0 0 0.1]], - directional = true, - emitrot = 180, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 34, - particlelifespread = 90, - particlesize = 18, - particlesizespread = 90, - particlespeed = 11, - particlespeedspread = 14, - pos = [[200 r900, 0 r500, 200 r900]], - sizegrowth = 0.8, - sizemod = 1, - texture = [[rain]], - alwaysvisible = true, - }, - }, - }, - ["raindrop-acid-new"] = { - usedefaultexplosions = false, - raindrops = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.10 0.13 0.07 0.02 0.13 0.15 0.1 0.07 0 0 0 0.1]], - dir = [[-0.1 r0.2, -0.8 r-0.20, -0.1 r0.2]], - --speed = [[0, 1, 0]], - particleSpeed = 80, - gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = [[200 r120]], - sidetexture = [[rain]], - size = [[60 r100]], - sizegrowth = -0.1, - ttl = [[34 r90]], - rotParams = [[-20 r40, -12 r24, -180 r360]], - pos = [[-10 r20, 0 r50, -10 r20]], - speed = [[0, 50, 0]], - drawOrder = 1, - }, - }, - }, - ["raindrop-acid"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - unit = false, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.10 0.13 0.07 0.02 0.13 0.15 0.1 0.07 0 0 0 0.1]], - directional = true, - emitrot = 180, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 34, - particlelifespread = 90, - particlesize = 18, - particlesizespread = 90, - particlespeed = 11, - particlespeedspread = 14, - pos = [[200 r900, 0 r500, 200 r900]], - --rotParams = [[-2 r4, -1 r2, 89 r2]], - sizegrowth = 0.8, - sizemod = 1, - texture = [[rain]], - alwaysvisible = true, - }, - }, - }, -["smokeblack"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.0 0.01 0.01 0.01 0.02 0.01 0.01 0.01 0.02 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.06, 0]], - numparticles = 6, - particlelife = 600, - particlelifespread = 400, - particlesize = 200, - particlesizespread = 200, - particlespeed = 9, - particlespeedspread = 4.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[-400 r900, -50 r75, -200 r900]], - sizegrowth = [[0.3 r0.2]], - sizemod = 1, - texture = [[fogdirty]], - alwaysvisible = true, - }, - }, - }, - ["noceg"] = { - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = false, - underwater = false, - unit = false, - properties = { - airdrag = 0, - colormap = [[0 0 0 0 0 0 0 0.1]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0, 0, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 0, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 0, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[glow]], - alwaysvisible = false, - }, - }, - }, + ["raindrop"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + unit = false, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.07 0.07 0.07 0.02 0.1 0.1 0.1 0.09 0 0 0 0.1]], + directional = true, + emitrot = 180, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 34, + particlelifespread = 90, + particlesize = 18, + particlesizespread = 90, + particlespeed = 11, + particlespeedspread = 14, + pos = [[200 r900, 0 r500, 200 r900]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[rain]], + alwaysvisible = true, + }, + }, + }, + ["raindrop-acid-new"] = { + usedefaultexplosions = false, + raindrops = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.10 0.13 0.07 0.02 0.13 0.15 0.1 0.07 0 0 0 0.1]], + dir = [[-0.1 r0.2, -0.8 r-0.20, -0.1 r0.2]], + --speed = [[0, 1, 0]], + particleSpeed = 80, + gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = [[200 r120]], + sidetexture = [[rain]], + size = [[60 r100]], + sizegrowth = -0.1, + ttl = [[34 r90]], + rotParams = [[-20 r40, -12 r24, -180 r360]], + pos = [[-10 r20, 0 r50, -10 r20]], + speed = [[0, 50, 0]], + drawOrder = 1, + }, + }, + }, + ["raindrop-acid"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + unit = false, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.10 0.13 0.07 0.02 0.13 0.15 0.1 0.07 0 0 0 0.1]], + directional = true, + emitrot = 180, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 34, + particlelifespread = 90, + particlesize = 18, + particlesizespread = 90, + particlespeed = 11, + particlespeedspread = 14, + pos = [[200 r900, 0 r500, 200 r900]], + --rotParams = [[-2 r4, -1 r2, 89 r2]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[rain]], + alwaysvisible = true, + }, + }, + }, + ["smokeblack"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.0 0.01 0.01 0.01 0.02 0.01 0.01 0.01 0.02 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.06, 0]], + numparticles = 6, + particlelife = 600, + particlelifespread = 400, + particlesize = 200, + particlesizespread = 200, + particlespeed = 9, + particlespeedspread = 4.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[-400 r900, -50 r75, -200 r900]], + sizegrowth = [[0.3 r0.2]], + sizemod = 1, + texture = [[fogdirty]], + alwaysvisible = true, + }, + }, + }, + ["noceg"] = { + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = false, + underwater = false, + unit = false, + properties = { + airdrag = 0, + colormap = [[0 0 0 0 0 0 0 0.1]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[glow]], + alwaysvisible = false, + }, + }, + }, } diff --git a/effects/barrelshot.lua b/effects/barrelshot.lua index bc85d509100..f70ea3456c8 100644 --- a/effects/barrelshot.lua +++ b/effects/barrelshot.lua @@ -1,722 +1,721 @@ local definitions = { - ["barrelshot-greenblaster"] = { - fire = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.2 1 0.8 0.013 0.15 0.6 0.32 0.01 0.015 0.3 0.07 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[shotgunflare]], - length = 45, - sidetexture = [[shotgunside]], - size = 15.9, - sizegrowth = -0.5, - ttl = 10, - pos = [[0.0, 1, 0.0]], - }, - }, - fire2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.2 1 0.8 0.013 0.1 0.6 0.25 0.01 0.015 0.3 0.07 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -9, - sidetexture = [[shotgunside]], - size = 18, - sizegrowth = -0.5, - ttl = 9, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.90 0.95 0.93 0.55 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 30, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -12.9, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - flare = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.7 0.95 0.90 0.55 0.05 0.1 0.07 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 3, - particlesize = 60, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - rotParams = [[60 r220, -60 r120, -180 r360]], - sizegrowth = -4.5, - sizemod = 1, - texture = [[flare2]], - useairlos = true, - }, - }, - -- TEST for waterwave on (big) ship guns - -- waterring = { - -- air = false, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.1 0.1 0.1 0.05 0.40 0.41 0.38 0.1 0.2 0.2 0.18 0.4 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[wake]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 46.9, - -- sizegrowth = 1.0, - -- ttl = 80, - -- rotParams = [[-10 r20, -2 r4, -180 r360]], - -- pos = [[0, -50, -0]], - -- }, - -- }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0 0.35 1 0.65 0.95 0.3 0.6 0.4 0.70 0.25 0.35 0.30 0.60 0.23 0.25 0.24 0.45 0.14 0.16 0.15 0.40 0.1 0.12 0.11 0.48 0.058 0.063 0.062 0.30 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 8, - emitvector = [[dir]], - gravity = [[-0.02 r0.04, 0.007 r0.02, -0.02 r0.04]], - numparticles = 1, - particlelife = 15, - particlelifespread = 20, - particlesize = 4.2, - particlesizespread = 3.9, - particlespeed = 1.2, - particlespeedspread = 0.7, - pos = [[0.0, 0, 0.0]], - rotParams = [[-17 r34, -9 r18, -180 r360]], - sizegrowth = 0.55, - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,50 r80]], - useairlos = true, - castShadow = true, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0.28 0.91 0.81 0.96 0.13 0.32 0.27 0.85 0.12 0.15 0.14 0.72 0.12 0.12 0.12 0.25 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 9, - emitvector = [[dir]], - gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], - numparticles = 2, - particlelife = 13, - particlelifespread = 9, - particlesize = 4, - particlesizespread = 7, - particlespeed = 1.40, - particlespeedspread = 0.5, - rotParams = [[-12 r24, -8 r16, -20 r40]], - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.92, - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - --castShadow = true, - }, - }, - impulse = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.35 0.80 0.65 0.22 0.45 0.85 0.72 0.22 0.15 0.50 0.40 0.011 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.18, - fronttexture = [[explosionwave]], - length = 15, - sidetexture = [[flashside3]], - size = 4, - sizegrowth = 1.7, - ttl = 9, - pos = [[0, 0, 0]], - drawOrder = 1, - }, - }, - --clouddust = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.02 0.02 0.02 0.03 0.045 0.045 0.045 0.07 0.035 0.035 0.035 0.05 0.019 0.019 0.019 0.03 0 0 0 0]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 4, - -- emitvector = [[0.5, 1, 0.5]], - -- gravity = [[0, 0.015, 0]], - -- numparticles = 2, - -- particlelife = 90, - -- particlelifespread = 90, - -- particlesize = 4, - -- particlesizespread = 1.5, - -- particlespeed = 1, - -- particlespeedspread = 1, - -- pos = [[0, 0, 0]], - -- sizegrowth = 0.25, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - }, - - ["barrelshot-medium"] = { - fire = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.92 0.8 0.013 0.6 0.32 0.07 0.01 0.3 0.07 0.015 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[flare1]], - length = 55, - sidetexture = [[shotgunside]], - size = 17.2, - sizegrowth = -0.5, - ttl = 9, - pos = [[0.0, 1, 0.0]], - rotParams = [[-20 r40, -10 r20, -180 r360]], - }, - }, - fire2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.92 0.8 0.12 0.5 0.5 0.5 0.08 0.35 0.35 0.35 0.004 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[1InstaHeat1Shock1]], - animParams = [[8,12,19]], - length = 45, - sidetexture = [[none]], - size = 10.5, - sizegrowth = 0.63, - ttl = 15, - pos = [[0, 0, 0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 30, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -12.9, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - flare = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.95 0.90 0.7 0.55 0.1 0.07 0.05 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 3, - particlesize = 60, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - rotParams = [[60 r220, -60 r120, -180 r360]], - sizegrowth = -4.5, - sizemod = 1, - texture = [[flare2]], - useairlos = true, - }, - }, - -- TEST for waterwave on (big) ship guns - -- waterring = { - -- air = false, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.1 0.1 0.1 0.05 0.40 0.41 0.38 0.1 0.2 0.2 0.18 0.4 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[wake]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 46.9, - -- sizegrowth = 1.0, - -- ttl = 80, - -- rotParams = [[-10 r20, -2 r4, -180 r360]], - -- pos = [[0, -50, -0]], - -- }, - -- }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0 1.0 0.65 0.35 0.95 0.6 0.4 0.3 0.70 0.35 0.30 0.25 0.60 0.25 0.24 0.23 0.45 0.16 0.15 0.14 0.40 0.12 0.11 0.1 0.48 0.063 0.062 0.058 0.30 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 8, - emitvector = [[dir]], - gravity = [[-0.02 r0.04, 0.007 r0.02, -0.02 r0.04]], - numparticles = 1, - particlelife = 15, - particlelifespread = 20, - particlesize = 4.2, - particlesizespread = 3.9, - particlespeed = 1.2, - particlespeedspread = 0.7, - pos = [[0.0, 0, 0.0]], - rotParams = [[-17 r34, -9 r18, -180 r360]], - sizegrowth = 0.55, - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,50 r80]], - useairlos = true, - castShadow = true, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0.91 0.81 0.28 0.96 0.32 0.27 0.13 0.85 0.15 0.14 0.12 0.72 0.12 0.12 0.12 0.25 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 9, - emitvector = [[dir]], - gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], - numparticles = 2, - particlelife = 13, - particlelifespread = 9, - particlesize = 4, - particlesizespread = 7, - particlespeed = 1.40, - particlespeedspread = 0.5, - rotParams = [[-12 r24, -8 r16, -20 r40]], - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.92, - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - --castShadow = true, - }, - }, - impulse = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.90 0.9 0.9 0.8 0.85 0.8 0.7 0.22 0.40 0.40 0.20 0.011 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.1, - fronttexture = [[1InstaHeat1Shock1]], - animParams = [[8,12,30]], - length = 15, - sidetexture = [[none]], - size = 5, - sizegrowth = 1.3, - ttl = 25, - pos = [[0, 0, 0]], - rotParams = [[-10 r20, -5 r10, -180 r360]], - drawOrder = 1, - }, - }, - --clouddust = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.02 0.02 0.02 0.03 0.045 0.045 0.045 0.07 0.035 0.035 0.035 0.05 0.019 0.019 0.019 0.03 0 0 0 0]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 4, - -- emitvector = [[0.5, 1, 0.5]], - -- gravity = [[0, 0.015, 0]], - -- numparticles = 2, - -- particlelife = 90, - -- particlelifespread = 90, - -- particlesize = 4, - -- particlesizespread = 1.5, - -- particlespeed = 1, - -- particlespeedspread = 1, - -- pos = [[0, 0, 0]], - -- sizegrowth = 0.25, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - }, + ["barrelshot-greenblaster"] = { + fire = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.2 1 0.8 0.013 0.15 0.6 0.32 0.01 0.015 0.3 0.07 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 45, + sidetexture = [[shotgunside]], + size = 15.9, + sizegrowth = -0.5, + ttl = 10, + pos = [[0.0, 1, 0.0]], + }, + }, + fire2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.2 1 0.8 0.013 0.1 0.6 0.25 0.01 0.015 0.3 0.07 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -9, + sidetexture = [[shotgunside]], + size = 18, + sizegrowth = -0.5, + ttl = 9, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.90 0.95 0.93 0.55 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 30, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -12.9, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + flare = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.7 0.95 0.90 0.55 0.05 0.1 0.07 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 3, + particlesize = 60, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + rotParams = [[60 r220, -60 r120, -180 r360]], + sizegrowth = -4.5, + sizemod = 1, + texture = [[flare2]], + useairlos = true, + }, + }, + -- TEST for waterwave on (big) ship guns + -- waterring = { + -- air = false, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.1 0.1 0.1 0.05 0.40 0.41 0.38 0.1 0.2 0.2 0.18 0.4 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[wake]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 46.9, + -- sizegrowth = 1.0, + -- ttl = 80, + -- rotParams = [[-10 r20, -2 r4, -180 r360]], + -- pos = [[0, -50, -0]], + -- }, + -- }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0 0.35 1 0.65 0.95 0.3 0.6 0.4 0.70 0.25 0.35 0.30 0.60 0.23 0.25 0.24 0.45 0.14 0.16 0.15 0.40 0.1 0.12 0.11 0.48 0.058 0.063 0.062 0.30 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 8, + emitvector = [[dir]], + gravity = [[-0.02 r0.04, 0.007 r0.02, -0.02 r0.04]], + numparticles = 1, + particlelife = 15, + particlelifespread = 20, + particlesize = 4.2, + particlesizespread = 3.9, + particlespeed = 1.2, + particlespeedspread = 0.7, + pos = [[0.0, 0, 0.0]], + rotParams = [[-17 r34, -9 r18, -180 r360]], + sizegrowth = 0.55, + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,50 r80]], + useairlos = true, + castShadow = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0.28 0.91 0.81 0.96 0.13 0.32 0.27 0.85 0.12 0.15 0.14 0.72 0.12 0.12 0.12 0.25 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 9, + emitvector = [[dir]], + gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], + numparticles = 2, + particlelife = 13, + particlelifespread = 9, + particlesize = 4, + particlesizespread = 7, + particlespeed = 1.40, + particlespeedspread = 0.5, + rotParams = [[-12 r24, -8 r16, -20 r40]], + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.92, + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + --castShadow = true, + }, + }, + impulse = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.35 0.80 0.65 0.22 0.45 0.85 0.72 0.22 0.15 0.50 0.40 0.011 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.18, + fronttexture = [[explosionwave]], + length = 15, + sidetexture = [[flashside3]], + size = 4, + sizegrowth = 1.7, + ttl = 9, + pos = [[0, 0, 0]], + drawOrder = 1, + }, + }, + --clouddust = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.02 0.02 0.02 0.03 0.045 0.045 0.045 0.07 0.035 0.035 0.035 0.05 0.019 0.019 0.019 0.03 0 0 0 0]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 4, + -- emitvector = [[0.5, 1, 0.5]], + -- gravity = [[0, 0.015, 0]], + -- numparticles = 2, + -- particlelife = 90, + -- particlelifespread = 90, + -- particlesize = 4, + -- particlesizespread = 1.5, + -- particlespeed = 1, + -- particlespeedspread = 1, + -- pos = [[0, 0, 0]], + -- sizegrowth = 0.25, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + }, - ["barrelshot-flak"] = { - fire = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[shotgunflare]], - length = 45, - sidetexture = [[shotgunside]], - size = 18.9, - sizegrowth = -0.5, - ttl = 10, - pos = [[0.0, 1, 0.0]], - }, - }, - fire2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -9, - sidetexture = [[shotgunside]], - size = 18, - sizegrowth = -0.5, - ttl = 9, - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = -1, - fronttexture = [[none]], - length = 110, - sidetexture = [[gunshotxl2]], - size = 5, - sizegrowth = 2.7, - ttl = 7, - --rotParams = [[-120 r240, -40 r80, -180 r360]], - pos = [[0, 0, 0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 30, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -12.9, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 8, - emitvector = [[dir]], - gravity = [[-0.02 r0.04, -0.005, -0.02 r0.04]], - numparticles = 4, - particlelife = 13, - particlelifespread = 17, - particlesize = 1.3, - particlesizespread = 3.7, - particlespeed = 1.1, - particlespeedspread = 2.1, - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.30, - sizemod = 1, - texture = [[smoke_puff2]], - useairlos = true, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 9, - emitvector = [[dir]], - gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], - numparticles = 1, - particlelife = 13, - particlelifespread = 9, - particlesize = 4, - particlesizespread = 7, - particlespeed = 1.40, - particlespeedspread = 0.5, - rotParams = [[-10 r20, -7 r14, -20 r40]], - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.92, - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - }, - }, - flakimpulse = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.18, - fronttexture = [[explosionwave]], - length = 17, - sidetexture = [[flashside3]], - size = 5, - sizegrowth = 1.7, - ttl = 9, - pos = [[0, 0, 0]], - drawOrder = 1, - }, - }, - }, + ["barrelshot-medium"] = { + fire = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.92 0.8 0.013 0.6 0.32 0.07 0.01 0.3 0.07 0.015 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flare1]], + length = 55, + sidetexture = [[shotgunside]], + size = 17.2, + sizegrowth = -0.5, + ttl = 9, + pos = [[0.0, 1, 0.0]], + rotParams = [[-20 r40, -10 r20, -180 r360]], + }, + }, + fire2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.92 0.8 0.12 0.5 0.5 0.5 0.08 0.35 0.35 0.35 0.004 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[1InstaHeat1Shock1]], + animParams = [[8,12,19]], + length = 45, + sidetexture = [[none]], + size = 10.5, + sizegrowth = 0.63, + ttl = 15, + pos = [[0, 0, 0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 30, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -12.9, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + flare = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.95 0.90 0.7 0.55 0.1 0.07 0.05 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 3, + particlesize = 60, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + rotParams = [[60 r220, -60 r120, -180 r360]], + sizegrowth = -4.5, + sizemod = 1, + texture = [[flare2]], + useairlos = true, + }, + }, + -- TEST for waterwave on (big) ship guns + -- waterring = { + -- air = false, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.1 0.1 0.1 0.05 0.40 0.41 0.38 0.1 0.2 0.2 0.18 0.4 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[wake]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 46.9, + -- sizegrowth = 1.0, + -- ttl = 80, + -- rotParams = [[-10 r20, -2 r4, -180 r360]], + -- pos = [[0, -50, -0]], + -- }, + -- }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0 1.0 0.65 0.35 0.95 0.6 0.4 0.3 0.70 0.35 0.30 0.25 0.60 0.25 0.24 0.23 0.45 0.16 0.15 0.14 0.40 0.12 0.11 0.1 0.48 0.063 0.062 0.058 0.30 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 8, + emitvector = [[dir]], + gravity = [[-0.02 r0.04, 0.007 r0.02, -0.02 r0.04]], + numparticles = 1, + particlelife = 15, + particlelifespread = 20, + particlesize = 4.2, + particlesizespread = 3.9, + particlespeed = 1.2, + particlespeedspread = 0.7, + pos = [[0.0, 0, 0.0]], + rotParams = [[-17 r34, -9 r18, -180 r360]], + sizegrowth = 0.55, + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,50 r80]], + useairlos = true, + castShadow = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0.91 0.81 0.28 0.96 0.32 0.27 0.13 0.85 0.15 0.14 0.12 0.72 0.12 0.12 0.12 0.25 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 9, + emitvector = [[dir]], + gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], + numparticles = 2, + particlelife = 13, + particlelifespread = 9, + particlesize = 4, + particlesizespread = 7, + particlespeed = 1.40, + particlespeedspread = 0.5, + rotParams = [[-12 r24, -8 r16, -20 r40]], + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.92, + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + --castShadow = true, + }, + }, + impulse = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.90 0.9 0.9 0.8 0.85 0.8 0.7 0.22 0.40 0.40 0.20 0.011 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.1, + fronttexture = [[1InstaHeat1Shock1]], + animParams = [[8,12,30]], + length = 15, + sidetexture = [[none]], + size = 5, + sizegrowth = 1.3, + ttl = 25, + pos = [[0, 0, 0]], + rotParams = [[-10 r20, -5 r10, -180 r360]], + drawOrder = 1, + }, + }, + --clouddust = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.02 0.02 0.02 0.03 0.045 0.045 0.045 0.07 0.035 0.035 0.035 0.05 0.019 0.019 0.019 0.03 0 0 0 0]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 4, + -- emitvector = [[0.5, 1, 0.5]], + -- gravity = [[0, 0.015, 0]], + -- numparticles = 2, + -- particlelife = 90, + -- particlelifespread = 90, + -- particlesize = 4, + -- particlesizespread = 1.5, + -- particlespeed = 1, + -- particlespeedspread = 1, + -- pos = [[0, 0, 0]], + -- sizegrowth = 0.25, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + }, - ["barrelshot-mg"] = { - mgfire = { - air = true, - class = [[CExpGenSpawner]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - dir = [[dir]], - delay = [[0 i3]], - explosiongenerator = [[custom:barrelshot-fire]], - --pos = [[-5 r10, 0, -5 r10]], - }, - }, - }, + ["barrelshot-flak"] = { + fire = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 45, + sidetexture = [[shotgunside]], + size = 18.9, + sizegrowth = -0.5, + ttl = 10, + pos = [[0.0, 1, 0.0]], + }, + }, + fire2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -9, + sidetexture = [[shotgunside]], + size = 18, + sizegrowth = -0.5, + ttl = 9, + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = -1, + fronttexture = [[none]], + length = 110, + sidetexture = [[gunshotxl2]], + size = 5, + sizegrowth = 2.7, + ttl = 7, + --rotParams = [[-120 r240, -40 r80, -180 r360]], + pos = [[0, 0, 0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 30, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -12.9, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 8, + emitvector = [[dir]], + gravity = [[-0.02 r0.04, -0.005, -0.02 r0.04]], + numparticles = 4, + particlelife = 13, + particlelifespread = 17, + particlesize = 1.3, + particlesizespread = 3.7, + particlespeed = 1.1, + particlespeedspread = 2.1, + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.30, + sizemod = 1, + texture = [[smoke_puff2]], + useairlos = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 9, + emitvector = [[dir]], + gravity = [[-0.006 r0.012, 0, -0.006 r0.012]], + numparticles = 1, + particlelife = 13, + particlelifespread = 9, + particlesize = 4, + particlesizespread = 7, + particlespeed = 1.40, + particlespeedspread = 0.5, + rotParams = [[-10 r20, -7 r14, -20 r40]], + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.92, + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + }, + }, + flakimpulse = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.18, + fronttexture = [[explosionwave]], + length = 17, + sidetexture = [[flashside3]], + size = 5, + sizegrowth = 1.7, + ttl = 9, + pos = [[0, 0, 0]], + drawOrder = 1, + }, + }, + }, - ["barrelshot-fire"] = { - fire = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.92 0.8 0.013 0.6 0.22 0.07 0.01 0.4 0.07 0.015 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0.03, - fronttexture = [[shotgunflare]], - length = [[38 r85]], - sidetexture = [[shotgunside]], - size = [[12 r16]], - sizegrowth = -0.6, - ttl = 9, - rotParams = [[-400 r200, 0, -180 r360]], - pos = [[0.0, 1, 0.0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 10, - particlesizespread = 45, - particlespeed = 0, - particlespeedspread = 0, - pos = [[-5 r10, 0, -5 r10]], - sizegrowth = -12.9, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - }, + ["barrelshot-mg"] = { + mgfire = { + air = true, + class = [[CExpGenSpawner]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + dir = [[dir]], + delay = [[0 i3]], + explosiongenerator = [[custom:barrelshot-fire]], + --pos = [[-5 r10, 0, -5 r10]], + }, + }, + }, + ["barrelshot-fire"] = { + fire = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.92 0.8 0.013 0.6 0.22 0.07 0.01 0.4 0.07 0.015 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.03, + fronttexture = [[shotgunflare]], + length = [[38 r85]], + sidetexture = [[shotgunside]], + size = [[12 r16]], + sizegrowth = -0.6, + ttl = 9, + rotParams = [[-400 r200, 0, -180 r360]], + pos = [[0.0, 1, 0.0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.95 0.93 0.90 0.55 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 10, + particlesizespread = 45, + particlespeed = 0, + particlespeedspread = 0, + pos = [[-5 r10, 0, -5 r10]], + sizegrowth = -12.9, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + }, } local size = 0.48 definitions["barrelshot-tiny"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-tiny"].fire.properties.length = definitions["barrelshot-tiny"].fire.properties.length * size -definitions["barrelshot-tiny"].fire.properties.size = definitions["barrelshot-tiny"].fire.properties.size * size -definitions["barrelshot-tiny"].fire.properties.ttl = 4.7 -definitions["barrelshot-tiny"].fire2.properties.length = definitions["barrelshot-tiny"].fire2.properties.length * size -definitions["barrelshot-tiny"].fire2.properties.size = definitions["barrelshot-tiny"].fire2.properties.size * size -definitions["barrelshot-tiny"].fire2.properties.ttl = 4.7 +definitions["barrelshot-tiny"].fire.properties.length = definitions["barrelshot-tiny"].fire.properties.length * size +definitions["barrelshot-tiny"].fire.properties.size = definitions["barrelshot-tiny"].fire.properties.size * size +definitions["barrelshot-tiny"].fire.properties.ttl = 4.7 +definitions["barrelshot-tiny"].fire2.properties.length = definitions["barrelshot-tiny"].fire2.properties.length * size +definitions["barrelshot-tiny"].fire2.properties.size = definitions["barrelshot-tiny"].fire2.properties.size * size +definitions["barrelshot-tiny"].fire2.properties.ttl = 4.7 --definitions["barrelshot-tiny"].fireglow.properties.particlesize = definitions["barrelshot-tiny"].fireglow.properties.particlesize * size *0.7 definitions["barrelshot-tiny"].fireglow = nil --definitions["barrelshot-tiny"].fireglow.properties.particlelife = 2 + definitions["barrelshot-tiny"].fireglow.properties.particlelife * size @@ -727,28 +726,28 @@ definitions["barrelshot-tiny"].smoke = nil local size = 0.88 definitions["barrelshot-small"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-small"].smoke2.count = 2 -definitions["barrelshot-small"].fire.properties.length = definitions["barrelshot-small"].fire.properties.length * size -definitions["barrelshot-small"].fire.properties.size = definitions["barrelshot-small"].fire.properties.size * size -definitions["barrelshot-small"].fire.properties.ttl = 7.5 +definitions["barrelshot-small"].smoke2.count = 2 +definitions["barrelshot-small"].fire.properties.length = definitions["barrelshot-small"].fire.properties.length * size +definitions["barrelshot-small"].fire.properties.size = definitions["barrelshot-small"].fire.properties.size * size +definitions["barrelshot-small"].fire.properties.ttl = 7.5 definitions["barrelshot-small"].fire2.count = 0 -definitions["barrelshot-small"].fire2.properties.length = definitions["barrelshot-small"].fire2.properties.length * size -definitions["barrelshot-small"].fire2.properties.size = definitions["barrelshot-small"].fire2.properties.size * size * 0.6 -definitions["barrelshot-small"].fire2.properties.ttl = 13 -definitions["barrelshot-small"].fireglow.properties.particlesize = definitions["barrelshot-small"].fireglow.properties.particlesize * size +definitions["barrelshot-small"].fire2.properties.length = definitions["barrelshot-small"].fire2.properties.length * size +definitions["barrelshot-small"].fire2.properties.size = definitions["barrelshot-small"].fire2.properties.size * size * 0.6 +definitions["barrelshot-small"].fire2.properties.ttl = 13 +definitions["barrelshot-small"].fireglow.properties.particlesize = definitions["barrelshot-small"].fireglow.properties.particlesize * size --definitions["barrelshot-small"].fireglow.properties.particlelife = 1.7 + definitions["barrelshot-small"].fireglow.properties.particlelife * size --definitions["barrelshot-small"].fireglow.properties.colormap = [[0.122 0.066 0.013 0.03 0 0 0 0.01]] -definitions["barrelshot-small"].smoke2.properties.particlelifespread = definitions["barrelshot-small"].smoke2.properties.particlelifespread * size -definitions["barrelshot-small"].smoke2.properties.particlesize = definitions["barrelshot-small"].smoke2.properties.particlesize * size -definitions["barrelshot-small"].smoke2.properties.particlesizespread = definitions["barrelshot-small"].smoke2.properties.particlesizespread * size +definitions["barrelshot-small"].smoke2.properties.particlelifespread = definitions["barrelshot-small"].smoke2.properties.particlelifespread * size +definitions["barrelshot-small"].smoke2.properties.particlesize = definitions["barrelshot-small"].smoke2.properties.particlesize * size +definitions["barrelshot-small"].smoke2.properties.particlesizespread = definitions["barrelshot-small"].smoke2.properties.particlesizespread * size --definitions["barrelshot-small"].smoke2.properties.numparticles = definitions["barrelshot-small"].smoke2.properties.numparticles * size -definitions["barrelshot-small"].smoke2.properties.particlespeedspread = definitions["barrelshot-small"].smoke2.properties.particlespeedspread * size -definitions["barrelshot-small"].smoke.properties.particlelifespread = definitions["barrelshot-small"].smoke.properties.particlelifespread * size -definitions["barrelshot-small"].smoke.properties.particlesize = definitions["barrelshot-small"].smoke.properties.particlesize * size -definitions["barrelshot-small"].smoke.properties.particlesizespread = definitions["barrelshot-small"].smoke.properties.particlesizespread * size -definitions["barrelshot-small"].smoke.properties.sizegrowth = definitions["barrelshot-small"].smoke.properties.sizegrowth * size +definitions["barrelshot-small"].smoke2.properties.particlespeedspread = definitions["barrelshot-small"].smoke2.properties.particlespeedspread * size +definitions["barrelshot-small"].smoke.properties.particlelifespread = definitions["barrelshot-small"].smoke.properties.particlelifespread * size +definitions["barrelshot-small"].smoke.properties.particlesize = definitions["barrelshot-small"].smoke.properties.particlesize * size +definitions["barrelshot-small"].smoke.properties.particlesizespread = definitions["barrelshot-small"].smoke.properties.particlesizespread * size +definitions["barrelshot-small"].smoke.properties.sizegrowth = definitions["barrelshot-small"].smoke.properties.sizegrowth * size --definitions["barrelshot-small"].smoke.properties.numparticles = definitions["barrelshot-small"].smoke.properties.numparticles * size -definitions["barrelshot-small"].smoke.properties.particlespeedspread = definitions["barrelshot-small"].smoke.properties.particlespeedspread * size +definitions["barrelshot-small"].smoke.properties.particlespeedspread = definitions["barrelshot-small"].smoke.properties.particlespeedspread * size --definitions["barrelshot-small"].clouddust.properties.particlesize = definitions["barrelshot-small"].clouddust.properties.particlesize * size --definitions["barrelshot-small"].clouddust.properties.particlesizespread = definitions["barrelshot-small"].clouddust.properties.particlesizespread * size --definitions["barrelshot-small"].clouddust.properties.particlelife = definitions["barrelshot-small"].clouddust.properties.particlelife * size @@ -756,28 +755,28 @@ definitions["barrelshot-small"].smoke.properties.particlespeedspread = definit local size = 1.8 definitions["barrelshot-large"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-large"].fire.properties.length = definitions["barrelshot-large"].fire.properties.length * size -definitions["barrelshot-large"].fire.properties.size = definitions["barrelshot-large"].fire.properties.size * size -definitions["barrelshot-large"].fire.properties.sizegrowth = definitions["barrelshot-large"].fire.properties.sizegrowth * 1.5 -definitions["barrelshot-large"].fire.properties.ttl = definitions["barrelshot-large"].fire.properties.ttl * 1.04 -definitions["barrelshot-large"].fire2.properties.length = definitions["barrelshot-large"].fire2.properties.length * size -definitions["barrelshot-large"].fire2.properties.size = definitions["barrelshot-large"].fire2.properties.size * size * 0.7 -definitions["barrelshot-large"].fire2.properties.sizegrowth = definitions["barrelshot-large"].fire2.properties.sizegrowth * 1.4 -definitions["barrelshot-large"].fire2.properties.ttl = definitions["barrelshot-large"].fire2.properties.ttl * 1.2 -definitions["barrelshot-large"].fireglow.properties.particlesize = definitions["barrelshot-large"].fireglow.properties.particlesize * size +definitions["barrelshot-large"].fire.properties.length = definitions["barrelshot-large"].fire.properties.length * size +definitions["barrelshot-large"].fire.properties.size = definitions["barrelshot-large"].fire.properties.size * size +definitions["barrelshot-large"].fire.properties.sizegrowth = definitions["barrelshot-large"].fire.properties.sizegrowth * 1.5 +definitions["barrelshot-large"].fire.properties.ttl = definitions["barrelshot-large"].fire.properties.ttl * 1.04 +definitions["barrelshot-large"].fire2.properties.length = definitions["barrelshot-large"].fire2.properties.length * size +definitions["barrelshot-large"].fire2.properties.size = definitions["barrelshot-large"].fire2.properties.size * size * 0.7 +definitions["barrelshot-large"].fire2.properties.sizegrowth = definitions["barrelshot-large"].fire2.properties.sizegrowth * 1.4 +definitions["barrelshot-large"].fire2.properties.ttl = definitions["barrelshot-large"].fire2.properties.ttl * 1.2 +definitions["barrelshot-large"].fireglow.properties.particlesize = definitions["barrelshot-large"].fireglow.properties.particlesize * size --definitions["barrelshot-large"].fireglow.properties.particlelife = definitions["barrelshot-large"].fireglow.properties.particlelife * size --definitions["barrelshot-large"].fireglow.properties.colormap = [[0.122 0.066 0.013 0.035 0 0 0 0.01]] -definitions["barrelshot-large"].smoke2.properties.particlelife = definitions["barrelshot-large"].smoke2.properties.particlelife * size * 0.6 -definitions["barrelshot-large"].smoke2.properties.particlelifespread = definitions["barrelshot-large"].smoke2.properties.particlelifespread * size -definitions["barrelshot-large"].smoke2.properties.particlesize = definitions["barrelshot-large"].smoke2.properties.particlesize * size -definitions["barrelshot-large"].smoke2.properties.particlesizespread = definitions["barrelshot-large"].smoke2.properties.particlesizespread * size +definitions["barrelshot-large"].smoke2.properties.particlelife = definitions["barrelshot-large"].smoke2.properties.particlelife * size * 0.6 +definitions["barrelshot-large"].smoke2.properties.particlelifespread = definitions["barrelshot-large"].smoke2.properties.particlelifespread * size +definitions["barrelshot-large"].smoke2.properties.particlesize = definitions["barrelshot-large"].smoke2.properties.particlesize * size +definitions["barrelshot-large"].smoke2.properties.particlesizespread = definitions["barrelshot-large"].smoke2.properties.particlesizespread * size --definitions["barrelshot-large"].smoke2.properties.numparticles = definitions["barrelshot-large"].smoke2.properties.numparticles * size -definitions["barrelshot-large"].smoke2.properties.particlespeedspread = definitions["barrelshot-large"].smoke2.properties.particlespeedspread * size -definitions["barrelshot-large"].smoke.properties.particlelifespread = definitions["barrelshot-large"].smoke.properties.particlelifespread * size -definitions["barrelshot-large"].smoke.properties.particlesize = definitions["barrelshot-large"].smoke.properties.particlesize * size -definitions["barrelshot-large"].smoke.properties.particlesizespread = definitions["barrelshot-large"].smoke.properties.particlesizespread * size +definitions["barrelshot-large"].smoke2.properties.particlespeedspread = definitions["barrelshot-large"].smoke2.properties.particlespeedspread * size +definitions["barrelshot-large"].smoke.properties.particlelifespread = definitions["barrelshot-large"].smoke.properties.particlelifespread * size +definitions["barrelshot-large"].smoke.properties.particlesize = definitions["barrelshot-large"].smoke.properties.particlesize * size +definitions["barrelshot-large"].smoke.properties.particlesizespread = definitions["barrelshot-large"].smoke.properties.particlesizespread * size --definitions["barrelshot-large"].smoke.properties.numparticles = definitions["barrelshot-large"].smoke.properties.numparticles * size -definitions["barrelshot-large"].smoke.properties.particlespeedspread = definitions["barrelshot-large"].smoke.properties.particlespeedspread * size +definitions["barrelshot-large"].smoke.properties.particlespeedspread = definitions["barrelshot-large"].smoke.properties.particlespeedspread * size --definitions["barrelshot-large"].clouddust.properties.particlesize = definitions["barrelshot-large"].clouddust.properties.particlesize * size --definitions["barrelshot-large"].clouddust.properties.particlesizespread = definitions["barrelshot-large"].clouddust.properties.particlesizespread * size --definitions["barrelshot-large"].clouddust.properties.particlelife = definitions["barrelshot-small"].clouddust.properties.particlelife * size @@ -785,62 +784,62 @@ definitions["barrelshot-large"].smoke.properties.particlespeedspread = definiti local size = 2.5 definitions["barrelshot-larger"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-larger"].fire.properties.length = definitions["barrelshot-larger"].fire.properties.length * size * 1.1 -definitions["barrelshot-larger"].fire.properties.size = definitions["barrelshot-larger"].fire.properties.size * size * 1.06 -definitions["barrelshot-larger"].fire.properties.sizegrowth = definitions["barrelshot-larger"].fire.properties.sizegrowth * 1.5 -definitions["barrelshot-larger"].fire.properties.ttl = definitions["barrelshot-larger"].fire.properties.ttl * 1.08 -definitions["barrelshot-larger"].fire2.properties.length = definitions["barrelshot-larger"].fire2.properties.length * size * 1.3 -definitions["barrelshot-larger"].fire2.properties.size = definitions["barrelshot-larger"].fire2.properties.size * size * 0.9 -definitions["barrelshot-larger"].fire2.properties.sizegrowth = definitions["barrelshot-larger"].fire2.properties.sizegrowth * 0.5 -definitions["barrelshot-larger"].fire2.properties.ttl = definitions["barrelshot-larger"].fire2.properties.ttl * 1.0 -definitions["barrelshot-larger"].fireglow.properties.particlesize = definitions["barrelshot-larger"].fireglow.properties.particlesize * size -definitions["barrelshot-larger"].smoke2.count = 6 -definitions["barrelshot-larger"].smoke2.properties.particlelife = definitions["barrelshot-larger"].smoke2.properties.particlelife * size * 0.5 -definitions["barrelshot-larger"].smoke2.properties.particlelifespread = definitions["barrelshot-larger"].smoke2.properties.particlelifespread * size * 0.9 -definitions["barrelshot-larger"].smoke2.properties.particlesize = definitions["barrelshot-larger"].smoke2.properties.particlesize * size * 1.5 -definitions["barrelshot-larger"].smoke2.properties.particlesizespread = definitions["barrelshot-larger"].smoke2.properties.particlesizespread * size * 0.9 -definitions["barrelshot-larger"].smoke2.properties.particlespeed = definitions["barrelshot-larger"].smoke2.properties.particlespeed * size -definitions["barrelshot-larger"].smoke2.properties.particlespeedspread = definitions["barrelshot-larger"].smoke2.properties.particlespeedspread * size * 0.5 -definitions["barrelshot-larger"].smoke2.properties.airdrag = .95 -definitions["barrelshot-larger"].smoke.properties.particlelifespread = definitions["barrelshot-larger"].smoke.properties.particlelifespread * size -definitions["barrelshot-larger"].smoke.properties.particlesize = definitions["barrelshot-larger"].smoke.properties.particlesize * size -definitions["barrelshot-larger"].smoke.properties.particlesizespread = definitions["barrelshot-larger"].smoke.properties.particlesizespread * size * 0.9 -definitions["barrelshot-larger"].smoke.properties.particlespeed = definitions["barrelshot-larger"].smoke.properties.particlespeed * size * 1.05 -definitions["barrelshot-larger"].smoke.properties.particlespeedspread = definitions["barrelshot-larger"].smoke.properties.particlespeedspread * size * 1.15 +definitions["barrelshot-larger"].fire.properties.length = definitions["barrelshot-larger"].fire.properties.length * size * 1.1 +definitions["barrelshot-larger"].fire.properties.size = definitions["barrelshot-larger"].fire.properties.size * size * 1.06 +definitions["barrelshot-larger"].fire.properties.sizegrowth = definitions["barrelshot-larger"].fire.properties.sizegrowth * 1.5 +definitions["barrelshot-larger"].fire.properties.ttl = definitions["barrelshot-larger"].fire.properties.ttl * 1.08 +definitions["barrelshot-larger"].fire2.properties.length = definitions["barrelshot-larger"].fire2.properties.length * size * 1.3 +definitions["barrelshot-larger"].fire2.properties.size = definitions["barrelshot-larger"].fire2.properties.size * size * 0.9 +definitions["barrelshot-larger"].fire2.properties.sizegrowth = definitions["barrelshot-larger"].fire2.properties.sizegrowth * 0.5 +definitions["barrelshot-larger"].fire2.properties.ttl = definitions["barrelshot-larger"].fire2.properties.ttl * 1.0 +definitions["barrelshot-larger"].fireglow.properties.particlesize = definitions["barrelshot-larger"].fireglow.properties.particlesize * size +definitions["barrelshot-larger"].smoke2.count = 6 +definitions["barrelshot-larger"].smoke2.properties.particlelife = definitions["barrelshot-larger"].smoke2.properties.particlelife * size * 0.5 +definitions["barrelshot-larger"].smoke2.properties.particlelifespread = definitions["barrelshot-larger"].smoke2.properties.particlelifespread * size * 0.9 +definitions["barrelshot-larger"].smoke2.properties.particlesize = definitions["barrelshot-larger"].smoke2.properties.particlesize * size * 1.5 +definitions["barrelshot-larger"].smoke2.properties.particlesizespread = definitions["barrelshot-larger"].smoke2.properties.particlesizespread * size * 0.9 +definitions["barrelshot-larger"].smoke2.properties.particlespeed = definitions["barrelshot-larger"].smoke2.properties.particlespeed * size +definitions["barrelshot-larger"].smoke2.properties.particlespeedspread = definitions["barrelshot-larger"].smoke2.properties.particlespeedspread * size * 0.5 +definitions["barrelshot-larger"].smoke2.properties.airdrag = 0.95 +definitions["barrelshot-larger"].smoke.properties.particlelifespread = definitions["barrelshot-larger"].smoke.properties.particlelifespread * size +definitions["barrelshot-larger"].smoke.properties.particlesize = definitions["barrelshot-larger"].smoke.properties.particlesize * size +definitions["barrelshot-larger"].smoke.properties.particlesizespread = definitions["barrelshot-larger"].smoke.properties.particlesizespread * size * 0.9 +definitions["barrelshot-larger"].smoke.properties.particlespeed = definitions["barrelshot-larger"].smoke.properties.particlespeed * size * 1.05 +definitions["barrelshot-larger"].smoke.properties.particlespeedspread = definitions["barrelshot-larger"].smoke.properties.particlespeedspread * size * 1.15 local size = 3.1 definitions["barrelshot-huge"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-huge"].fire.properties.length = definitions["barrelshot-huge"].fire.properties.length * size * 2.2 -definitions["barrelshot-huge"].fire.properties.size = definitions["barrelshot-huge"].fire.properties.size * size * 1.6 -definitions["barrelshot-huge"].fire.properties.sizegrowth = definitions["barrelshot-huge"].fire.properties.sizegrowth * 1.8 -definitions["barrelshot-huge"].fire.properties.ttl = definitions["barrelshot-huge"].fire.properties.ttl * 1.2 -definitions["barrelshot-huge"].fire2.count = 0 -definitions["barrelshot-huge"].fire2.properties.animParams = [[8,12,50 r20]] -definitions["barrelshot-huge"].fire2.properties.length = definitions["barrelshot-huge"].fire2.properties.length * size * 2.2 -definitions["barrelshot-huge"].fire2.properties.size = definitions["barrelshot-huge"].fire2.properties.size * size * 0.5 -definitions["barrelshot-huge"].fire2.properties.sizegrowth = definitions["barrelshot-huge"].fire2.properties.sizegrowth * 1.9 -definitions["barrelshot-huge"].fire2.properties.ttl = definitions["barrelshot-huge"].fire2.properties.ttl * 1.6 -definitions["barrelshot-huge"].fireglow.properties.particlesize = definitions["barrelshot-huge"].fireglow.properties.particlesize * size * 0.8 +definitions["barrelshot-huge"].fire.properties.length = definitions["barrelshot-huge"].fire.properties.length * size * 2.2 +definitions["barrelshot-huge"].fire.properties.size = definitions["barrelshot-huge"].fire.properties.size * size * 1.6 +definitions["barrelshot-huge"].fire.properties.sizegrowth = definitions["barrelshot-huge"].fire.properties.sizegrowth * 1.8 +definitions["barrelshot-huge"].fire.properties.ttl = definitions["barrelshot-huge"].fire.properties.ttl * 1.2 +definitions["barrelshot-huge"].fire2.count = 0 +definitions["barrelshot-huge"].fire2.properties.animParams = [[8,12,50 r20]] +definitions["barrelshot-huge"].fire2.properties.length = definitions["barrelshot-huge"].fire2.properties.length * size * 2.2 +definitions["barrelshot-huge"].fire2.properties.size = definitions["barrelshot-huge"].fire2.properties.size * size * 0.5 +definitions["barrelshot-huge"].fire2.properties.sizegrowth = definitions["barrelshot-huge"].fire2.properties.sizegrowth * 1.9 +definitions["barrelshot-huge"].fire2.properties.ttl = definitions["barrelshot-huge"].fire2.properties.ttl * 1.6 +definitions["barrelshot-huge"].fireglow.properties.particlesize = definitions["barrelshot-huge"].fireglow.properties.particlesize * size * 0.8 --definitions["barrelshot-huge"].fireglow.properties.particlelife = definitions["barrelshot-huge"].fireglow.properties.particlelife * size * 0.8 --definitions["barrelshot-huge"].fireglow.properties.colormap = [[0.122 0.066 0.013 0.03 0 0 0 0.01]] -definitions["barrelshot-huge"].smoke2.count = 9 -definitions["barrelshot-huge"].smoke2.properties.particlelifespread = definitions["barrelshot-huge"].smoke2.properties.particlelifespread * size -definitions["barrelshot-huge"].smoke2.properties.particlesize = definitions["barrelshot-huge"].smoke2.properties.particlesize * size * 1.4 -definitions["barrelshot-huge"].smoke2.properties.particlesizespread = definitions["barrelshot-huge"].smoke2.properties.particlesizespread * size -definitions["barrelshot-huge"].smoke2.properties.particlespeed = definitions["barrelshot-huge"].smoke2.properties.particlespeed * size * 1.2 -definitions["barrelshot-huge"].smoke2.properties.particlespeedspread = definitions["barrelshot-huge"].smoke2.properties.particlespeedspread * size * 1.6 -definitions["barrelshot-huge"].smoke2.properties.airdrag = .96 +definitions["barrelshot-huge"].smoke2.count = 9 +definitions["barrelshot-huge"].smoke2.properties.particlelifespread = definitions["barrelshot-huge"].smoke2.properties.particlelifespread * size +definitions["barrelshot-huge"].smoke2.properties.particlesize = definitions["barrelshot-huge"].smoke2.properties.particlesize * size * 1.4 +definitions["barrelshot-huge"].smoke2.properties.particlesizespread = definitions["barrelshot-huge"].smoke2.properties.particlesizespread * size +definitions["barrelshot-huge"].smoke2.properties.particlespeed = definitions["barrelshot-huge"].smoke2.properties.particlespeed * size * 1.2 +definitions["barrelshot-huge"].smoke2.properties.particlespeedspread = definitions["barrelshot-huge"].smoke2.properties.particlespeedspread * size * 1.6 +definitions["barrelshot-huge"].smoke2.properties.airdrag = 0.96 --definitions["barrelshot-huge"].smoke2.properties.numparticles = 4 --definitions["barrelshot-huge"].smoke2.properties.colormap = [[0 0 0 0 0.90 0.58 0.16 0.70 0.12 0.12 0.12 0.38 0.011 0.011 0.11 0.22 0.010 0.010 0.10 0.16 0 0 0 0.01]] -definitions["barrelshot-huge"].smoke.properties.particlelife = definitions["barrelshot-huge"].smoke.properties.particlelife * size -definitions["barrelshot-huge"].smoke.properties.particlelifespread = definitions["barrelshot-huge"].smoke.properties.particlelifespread * size -definitions["barrelshot-huge"].smoke.properties.particlesize = definitions["barrelshot-huge"].smoke.properties.particlesize * size * 1.3 -definitions["barrelshot-huge"].smoke.properties.particlesizespread = definitions["barrelshot-huge"].smoke.properties.particlesizespread * size -definitions["barrelshot-huge"].smoke.properties.particlespeed = definitions["barrelshot-huge"].smoke.properties.particlespeed * size * 0.99 -definitions["barrelshot-huge"].smoke.properties.rotParams = [[-6 r12, -4 r8, -5 r10]] -definitions["barrelshot-huge"].smoke.properties.airdrag = .96 +definitions["barrelshot-huge"].smoke.properties.particlelife = definitions["barrelshot-huge"].smoke.properties.particlelife * size +definitions["barrelshot-huge"].smoke.properties.particlelifespread = definitions["barrelshot-huge"].smoke.properties.particlelifespread * size +definitions["barrelshot-huge"].smoke.properties.particlesize = definitions["barrelshot-huge"].smoke.properties.particlesize * size * 1.3 +definitions["barrelshot-huge"].smoke.properties.particlesizespread = definitions["barrelshot-huge"].smoke.properties.particlesizespread * size +definitions["barrelshot-huge"].smoke.properties.particlespeed = definitions["barrelshot-huge"].smoke.properties.particlespeed * size * 0.99 +definitions["barrelshot-huge"].smoke.properties.rotParams = [[-6 r12, -4 r8, -5 r10]] +definitions["barrelshot-huge"].smoke.properties.airdrag = 0.96 -definitions["barrelshot-huge"].smoke.properties.numparticles = 1 +definitions["barrelshot-huge"].smoke.properties.numparticles = 1 --definitions["barrelshot-huge"].smoke.properties.particlespeedspread = definitions["barrelshot-huge"].smoke.properties.particlespeedspread * size --definitions["barrelshot-huge"].clouddust.properties.particlesize = definitions["barrelshot-huge"].clouddust.properties.particlesize * size --definitions["barrelshot-huge"].clouddust.properties.particlesizespread = definitions["barrelshot-huge"].clouddust.properties.particlesizespread * size @@ -853,13 +852,13 @@ definitions["barrelshot-huge"].flash = { ground = 1, count = 1, class = [[CSimpleParticleSystem]], - properties = { + properties = { sizeGrowth = -4, sizeMod = 1.0, pos = [[0, 4, 0]], emitVector = [[-0, 1, 0]], gravity = [[0, 0, 0]], - colorMap = [[1 0.8 0.55 0.01 1 0.8 0.65 0.9 0 0 0 0.01]], + colorMap = [[1 0.8 0.55 0.01 1 0.8 0.65 0.9 0 0 0 0.01]], texture = [[dirt]], airdrag = 1, particleLife = 5, @@ -876,20 +875,20 @@ definitions["barrelshot-huge"].flash = { } definitions["barrelshot-small-impulse"] = table.copy(definitions["barrelshot-small"]) -definitions["barrelshot-small-impulse"].impulse.count = 1 +definitions["barrelshot-small-impulse"].impulse.count = 1 --definitions["barrelshot-small-impulse"].impulse.properties.size = 6 definitions["barrelshot-small-impulse"].smoke.properties.particlespeed = definitions["barrelshot-small-impulse"].smoke.properties.particlespeed * 1.7 definitions["barrelshot-small-impulse"].smoke.properties.particlesize = definitions["barrelshot-small-impulse"].smoke.properties.particlesize * 1.3 definitions["barrelshot-medium-impulse"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-medium-impulse"].impulse.count = 1 +definitions["barrelshot-medium-impulse"].impulse.count = 1 definitions["barrelshot-medium-impulse"].smoke.properties.particlespeed = definitions["barrelshot-medium-impulse"].smoke.properties.particlespeed * 1.7 definitions["barrelshot-medium-impulse"].smoke.properties.particlesize = 6 definitions["barrelshot-medium-impulse"].impulse.properties.size = 8 definitions["barrelshot-medium-impulse"].fire.properties.length = definitions["barrelshot-medium-impulse"].fire.properties.length * 1.5 definitions["barrelshot-large-impulse"] = table.copy(definitions["barrelshot-large"]) -definitions["barrelshot-large-impulse"].impulse.count = 1 +definitions["barrelshot-large-impulse"].impulse.count = 1 definitions["barrelshot-large-impulse"].smoke.properties.particlespeed = definitions["barrelshot-large-impulse"].smoke.properties.particlespeed * 2.0 definitions["barrelshot-large-impulse"].smoke.properties.particlesize = 13 definitions["barrelshot-large-impulse"].impulse.properties.size = 10 @@ -897,192 +896,189 @@ definitions["barrelshot-large-impulse"].impulse.properties.ttl = 25 definitions["barrelshot-large-impulse"].impulse.properties.animParams = [[8,12,35]] definitions["barrelshot-tiny-aa"] = table.copy(definitions["barrelshot-tiny"]) -definitions["barrelshot-tiny-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] +definitions["barrelshot-tiny-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] definitions["barrelshot-tiny-aa"].fire2.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] --definitions["barrelshot-tiny-aa"].fireglow.properties.colormap = [[0.122 0.066 0.09 0.04 0 0 0 0.01]] --definitions["barrelshot-tiny-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] --definitions["barrelshot-tiny-aa"].smoke2.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-small-aa"] = table.copy(definitions["barrelshot-small"]) -definitions["barrelshot-small-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] +definitions["barrelshot-small-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] definitions["barrelshot-small-aa"].fire2.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] --definitions["barrelshot-small-aa"].fireglow.properties.colormap = [[0.122 0.066 0.09 0.04 0 0 0 0.01]] -definitions["barrelshot-small-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] +definitions["barrelshot-small-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-small-aa"].smoke2.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-medium-aa"] = table.copy(definitions["barrelshot-medium"]) -definitions["barrelshot-medium-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] +definitions["barrelshot-medium-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] definitions["barrelshot-medium-aa"].fire2.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] --definitions["barrelshot-medium-aa"].fireglow.properties.colormap = [[0.122 0.066 0.09 0.04 0 0 0 0.01]] -definitions["barrelshot-medium-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] +definitions["barrelshot-medium-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-medium-aa"].smoke2.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-large-aa"] = table.copy(definitions["barrelshot-large"]) -definitions["barrelshot-large-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] +definitions["barrelshot-large-aa"].fire.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] definitions["barrelshot-large-aa"].fire2.properties.colormap = [[1 0.26 0.78 0.013 0.6 0.29 0.47 0.01 0.4 0.22 0.33 0.006 0 0 0 0.01]] --definitions["barrelshot-large-aa"].fireglow.properties.colormap = [[0.122 0.066 0.09 0.04 0 0 0 0.01]] -definitions["barrelshot-large-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] +definitions["barrelshot-large-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-large-aa"].smoke2.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-huge-aa"] = table.copy(definitions["barrelshot-huge"]) -definitions["barrelshot-huge-aa"].fire.properties.colormap = [[1 0.6 0.85 0.013 0.6 0.2 0.5 0.01 0.4 0.06 0.033 0.006 0 0 0 0.01]] +definitions["barrelshot-huge-aa"].fire.properties.colormap = [[1 0.6 0.85 0.013 0.6 0.2 0.5 0.01 0.4 0.06 0.033 0.006 0 0 0 0.01]] definitions["barrelshot-huge-aa"].fire2.properties.colormap = [[1 0.6 0.85 0.013 0.6 0.2 0.5 0.01 0.4 0.06 0.033 0.006 0 0 0 0.01]] --definitions["barrelshot-huge-aa"].fireglow.properties.colormap = [[0.122 0.066 0.09 0.04 0 0 0 0.01]] -definitions["barrelshot-huge-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] +definitions["barrelshot-huge-aa"].smoke.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] definitions["barrelshot-huge-aa"].smoke2.properties.colormap = [[0.95 0.17 0.69 0.95 0.35 0.13 0.20 0.65 0.15 0.12 0.14 0.60 0.12 0.12 0.12 0.25 0 0 0 0.01]] local size = 1.3 definitions["barrelshot-sniper"] = table.copy(definitions["barrelshot-large"]) -definitions["barrelshot-sniper"].fire.properties.length = definitions["barrelshot-sniper"].fire.properties.length * size * 1.3 -definitions["barrelshot-sniper"].fire.properties.size = definitions["barrelshot-sniper"].fire.properties.size * size * 0.8 -definitions["barrelshot-sniper"].fire2.properties.length = definitions["barrelshot-sniper"].fire.properties.length * size * 1.3 -definitions["barrelshot-sniper"].fire2.properties.size = definitions["barrelshot-sniper"].fire.properties.size * size * 0.8 -definitions["barrelshot-sniper"].flare.count = 1 +definitions["barrelshot-sniper"].fire.properties.length = definitions["barrelshot-sniper"].fire.properties.length * size * 1.3 +definitions["barrelshot-sniper"].fire.properties.size = definitions["barrelshot-sniper"].fire.properties.size * size * 0.8 +definitions["barrelshot-sniper"].fire2.properties.length = definitions["barrelshot-sniper"].fire.properties.length * size * 1.3 +definitions["barrelshot-sniper"].fire2.properties.size = definitions["barrelshot-sniper"].fire.properties.size * size * 0.8 +definitions["barrelshot-sniper"].flare.count = 1 --definitions["barrelshot-sniper"].fire.properties.colormap = [[1 0.33 0.15 0.015 0.7 0.17 0.08 0.01 0.4 0.06 0.03 0.01 0 0 0 0.01]] --definitions["barrelshot-sniper"].fire2.properties.colormap = [[1 0.33 0.15 0.015 0.7 0.17 0.08 0.01 0.4 0.06 0.03 0.01 0 0 0 0.01]] --definitions["barrelshot-sniper"].fireglow.properties.colormap = [[0.122 0.066 0.025 0.04 0 0 0 0.01]] --definitions["barrelshot-sniper"].smoke.properties.colormap = [[0 0 0 0 0.15 0.055 0.03 0.2 0.48 0.26 0.15 0.44 0.2 0.135 0.1 0.4 0.16 0.12 0.11 0.4 0.145 0.11 0.095 0.4 0.13 0.095 0.075 0.4 0.115 0.088 0.07 0.35 0.1 0.075 0.066 0.3 0.09 0.07 0.06 0.26 0.08 0.065 0.06 0.22 0 0 0 0]] - - - definitions["barrelshot-lightning"] = { - -- groundflash = { - -- circlealpha = 1, - -- circlegrowth = 0, - -- flashalpha = 0.12, - -- flashsize = 35, - -- ttl = 3, - -- color = { - -- [1] = 0.66, - -- [2] = 0.66, - -- [3] = 1, - -- }, - -- }, - -- blueelectricityspikes = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.8, - -- colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.01, 0]], - -- numparticles = 2, - -- particlelife = 3, - -- particlelifespread = 2, - -- particlesize = 7.5, - -- particlesizespread = 3.5, - -- particlespeed = 0.5, - -- particlespeedspread = 0.5, - -- pos = [[0, 0, 0]], - -- sizegrowth = 1.8, - -- sizemod = 1, - -- texture = [[whitelightb]], - -- useairlos = false, - -- }, - -- }, - -- centerflare = { - -- air = true, - -- class = [[CHeatCloudProjectile]], - -- count = 0, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- heat = 7, - -- heatfalloff = 0.9, - -- maxheat = 15, - -- pos = [[r-2 r2, 0, r-2 r2]], - -- size = 14, - -- sizegrowth = -4, - -- speed = [[0, 1 0, 0]], - -- texture = [[flare]], - -- }, - -- }, - -- flare = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0.98 0.98 1 0.2 0.98 0.98 1 0.5 0.92 0.92 0.95 0.2 0 0 0 0 0.98 0.98 1 0.4 0 0 0 0 0.98 0.98 1 0.5 0 0 0 0]], - -- directional = true, - -- emitrot = 90, - -- emitrotspread = 0, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = 9, - -- particlelifespread = 1, - -- particlesize = 14, - -- particlesizespread = 8, - -- particlespeed = 0.1, - -- particlespeedspread = 0.1, - -- pos = [[10, 2, 0]], - -- sizegrowth = -0.5, - -- sizemod = 1, - -- texture = [[flare2]], - -- useairlos = false, - -- }, - -- }, + -- groundflash = { + -- circlealpha = 1, + -- circlegrowth = 0, + -- flashalpha = 0.12, + -- flashsize = 35, + -- ttl = 3, + -- color = { + -- [1] = 0.66, + -- [2] = 0.66, + -- [3] = 1, + -- }, + -- }, + -- blueelectricityspikes = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.8, + -- colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.01, 0]], + -- numparticles = 2, + -- particlelife = 3, + -- particlelifespread = 2, + -- particlesize = 7.5, + -- particlesizespread = 3.5, + -- particlespeed = 0.5, + -- particlespeedspread = 0.5, + -- pos = [[0, 0, 0]], + -- sizegrowth = 1.8, + -- sizemod = 1, + -- texture = [[whitelightb]], + -- useairlos = false, + -- }, + -- }, + -- centerflare = { + -- air = true, + -- class = [[CHeatCloudProjectile]], + -- count = 0, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- heat = 7, + -- heatfalloff = 0.9, + -- maxheat = 15, + -- pos = [[r-2 r2, 0, r-2 r2]], + -- size = 14, + -- sizegrowth = -4, + -- speed = [[0, 1 0, 0]], + -- texture = [[flare]], + -- }, + -- }, + -- flare = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0.98 0.98 1 0.2 0.98 0.98 1 0.5 0.92 0.92 0.95 0.2 0 0 0 0 0.98 0.98 1 0.4 0 0 0 0 0.98 0.98 1 0.5 0 0 0 0]], + -- directional = true, + -- emitrot = 90, + -- emitrotspread = 0, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = 9, + -- particlelifespread = 1, + -- particlesize = 14, + -- particlesizespread = 8, + -- particlespeed = 0.1, + -- particlespeedspread = 0.1, + -- pos = [[10, 2, 0]], + -- sizegrowth = -0.5, + -- sizemod = 1, + -- texture = [[flare2]], + -- useairlos = false, + -- }, + -- }, } -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - fire = { - properties = { - colormap = [[0.75 0.65 1 0.013 0.3 0.15 0.6 0.01 0.25 0.02 0.4 0.006 0 0 0 0.01]] - } - }, - fire2 = { - properties = { - colormap = [[0.75 0.65 1 0.013 0.3 0.15 0.6 0.01 0.25 0.02 0.4 0.006 0 0 0 0.01]] - } - }, - fireglow = { - properties = { - colormap = [[0.075 0.03 0.12 0.04 0 0 0 0.01]] - } - }, + fire = { + properties = { + colormap = [[0.75 0.65 1 0.013 0.3 0.15 0.6 0.01 0.25 0.02 0.4 0.006 0 0 0 0.01]], + }, + }, + fire2 = { + properties = { + colormap = [[0.75 0.65 1 0.013 0.3 0.15 0.6 0.01 0.25 0.02 0.4 0.006 0 0 0 0.01]], + }, + }, + fireglow = { + properties = { + colormap = [[0.075 0.03 0.12 0.04 0 0 0 0.01]], + }, + }, mgfire = { properties = { explosiongenerator = [[custom:barrelshot-fire-purple]], - } - } + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do if scavengerDefs[defName][effect][param][property] then scavengerDefs[defName][effect][param][property] = propertyValue end end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/blacksmoke.lua b/effects/blacksmoke.lua index c3b12750474..feebbf1fe48 100644 --- a/effects/blacksmoke.lua +++ b/effects/blacksmoke.lua @@ -1,62 +1,61 @@ return { - ["blacksmoke"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.7, - colormap = [[1 0.5 0 1.0 1 0.5 0 1.0 0.9 0.4 0 1.0 0.6 0.2 0 1.0 0.3 0.1 0 1.0 0 0 0 1.0 0 0 0 0.5 0 0 0 0.1]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 4, - particlelife = 60, - particlelifespread = 20, - particlesize = 1, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 4, - sizegrowth = 1, - sizemod = 0.9, - texture = [[new_dirta]], - useairlos = false, - }, - }, - - bubblesuw = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - water = false, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 4, - particlelife = 60, - particlelifespread = 20, - particlesize = 1, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 4, - sizegrowth = 1, - sizemod = 0.9, - texture = [[randdots]], - useairlos = false, - }, - }, - }, -} + ["blacksmoke"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.7, + colormap = [[1 0.5 0 1.0 1 0.5 0 1.0 0.9 0.4 0 1.0 0.6 0.2 0 1.0 0.3 0.1 0 1.0 0 0 0 1.0 0 0 0 0.5 0 0 0 0.1]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 4, + particlelife = 60, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + sizegrowth = 1, + sizemod = 0.9, + texture = [[new_dirta]], + useairlos = false, + }, + }, + bubblesuw = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + water = false, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 4, + particlelife = 60, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + sizegrowth = 1, + sizemod = 0.9, + texture = [[randdots]], + useairlos = false, + }, + }, + }, +} diff --git a/effects/blank.lua b/effects/blank.lua index 497f388c986..dc7928ae861 100644 --- a/effects/blank.lua +++ b/effects/blank.lua @@ -1,4 +1,3 @@ return { - ["blank"] = {}, + ["blank"] = {}, } - diff --git a/effects/bubbles.lua b/effects/bubbles.lua index e5ddc3f1fbc..9e608b1e708 100644 --- a/effects/bubbles.lua +++ b/effects/bubbles.lua @@ -1,90 +1,90 @@ return { ["geobubbles"] = { bubbles = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]], - directional = false, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, -0.4 r0.12, 0]], - gravity = [[-0.01 r0.01, 0.05, 0.01 r0.01]], - numparticles = [[1 r1]], - particlelife = 45, - particlelifespread = 35, - particlesize = 0.25, - particlesizespread = 0.15, - particlespeed = 1, - particlespeedspread = 3, - rotParams = [[-40 r80, -30 r60, -180 r360]], - pos = [[-10 r20, -20, -10 r20]], - sizegrowth = 0.27, - sizemod = 0.98, - texture = [[bubbletexture]], - useairlos = false, + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, -0.4 r0.12, 0]], + gravity = [[-0.01 r0.01, 0.05, 0.01 r0.01]], + numparticles = [[1 r1]], + particlelife = 45, + particlelifespread = 35, + particlesize = 0.25, + particlesizespread = 0.15, + particlespeed = 1, + particlespeedspread = 3, + rotParams = [[-40 r80, -30 r60, -180 r360]], + pos = [[-10 r20, -20, -10 r20]], + sizegrowth = 0.27, + sizemod = 0.98, + texture = [[bubbletexture]], + useairlos = false, }, }, }, ["subbubbles"] = { bubbles = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]], - directional = false, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, -0.4 r0.12, 0]], - gravity = [[-0.01 r0.01, 0.03, 0.01 r0.01]], - numparticles = [[1 r1]], - particlelife = 35, - particlelifespread = 35, - particlesize = 0.1, - particlesizespread = 0.2, - particlespeed = 1, - particlespeedspread = 3, - rotParams = [[-40 r80, -30 r60, -180 r360]], - pos = [[-10 r20, -20, -10 r20]], - sizegrowth = 0.22, - sizemod = 0.95, - texture = [[bubbletexture]], - useairlos = false, + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, -0.4 r0.12, 0]], + gravity = [[-0.01 r0.01, 0.03, 0.01 r0.01]], + numparticles = [[1 r1]], + particlelife = 35, + particlelifespread = 35, + particlesize = 0.1, + particlesizespread = 0.2, + particlespeed = 1, + particlespeedspread = 3, + rotParams = [[-40 r80, -30 r60, -180 r360]], + pos = [[-10 r20, -20, -10 r20]], + sizegrowth = 0.22, + sizemod = 0.95, + texture = [[bubbletexture]], + useairlos = false, }, }, }, - ["subwake"] = { - subwake = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.05 0.052 0.054 0.004 0.25 0.23 0.21 0.008 0.10 0.11 0.13 0.006 0 0 0 0.01]], - dir = [[0, -1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[subwake]], - length = 45, - sidetexture = [[none]], - size = [[6 r6]], - sizegrowth = 4, - ttl = [[75 r28]], - pos = [[0, -10, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - }, - }, + ["subwake"] = { + subwake = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.05 0.052 0.054 0.004 0.25 0.23 0.21 0.008 0.10 0.11 0.13 0.006 0 0 0 0.01]], + dir = [[0, -1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[subwake]], + length = 45, + sidetexture = [[none]], + size = [[6 r6]], + sizegrowth = 4, + ttl = [[75 r28]], + pos = [[0, -10, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + }, + }, }, } diff --git a/effects/burn.lua b/effects/burn.lua index 9d310687361..092d1d0687c 100644 --- a/effects/burn.lua +++ b/effects/burn.lua @@ -6,2140 +6,2132 @@ -- burngreen return { - ["burnblackbig-anim"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[1.0 0.95 0.55 0.3 1.0 1.0 0.9 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.36 0 0 0 0.08 0 0 0 0.05 0 0 0 0.03 0 0 0 0.01]], - directional = false, - emitrot = 65, - emitrotspread = 65, - emitvector = [[0.3, 1, 0.3]], - gravity = [[0, 0.05, 0]], - numparticles = 1, - particlelife = 55, - particlelifespread = 40, - particlesize = 8, - particlesizespread = 11, - particlespeed = 0.45, - particlespeedspread = 0.4, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[8,8,100 r50]], - pos = [[-3 r6, -3 r6, -3 r6]], - sizegrowth = 1.1, - sizemod = 0.98, - texture = [[FireBall02-anim]], - }, - }, - }, - ["burnflame-anim"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[0, 0.06 r0.05, 0]], - numparticles = [[0.49 r0.60]], - particlelife = 24, - particlelifespread = 9, - particlesize = 6.4, - particlesizespread = 6.8, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,40 r80]], - pos = [[-2 r4, 32 r8, -2 r4]], - sizegrowth = [[1.6 r1.3 d+7]], - sizemod = 0.93, - texture = [[BARFlame02]], - drawOrder = 1, - castShadow = true, - }, - }, - }, - ["burnflame-anim-x2"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[0, 0.06 r0.05, 0]], - numparticles = [[1 r2.5]], - particlelife = 24, - particlelifespread = 9, - particlesize = 18.4, - particlesizespread = 18.8, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,40 r80]], - pos = [[-2 r4, 32 r8, -2 r4]], - sizegrowth = [[1.7 r1.9]], - sizemod = 0.93, - texture = [[BARFlame02]], - drawOrder = 1, - castShadow = true, - }, - }, - }, - ["missileburn"] = { - groundflash = { - circlealpha = 0.1, - circlegrowth = 3, - flashalpha = 1, - flashsize = 12, - ttl = 8, - color = { - [1] = 0.80000001192093, - [2] = 0.10000000149012, - [3] = 0, - }, - }, - searingflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 0.5, 0.5]], - gravity = [[0, 2, 0]], - numparticles = 10, - particlelife = 10, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 0, - particlespeed = 5, - particlespeedspread = 15, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 0.5, - texture = [[gunshot]], - useairlos = false, - }, - }, - }, - - ["electricburn"] = { - groundflash = { - circlealpha = 0.1, - circlegrowth = 3, - flashalpha = 1, - flashsize = 12, - ttl = 8, - color = { - [1] = 0, - [2] = 0.10000000149012, - [3] = 0.80000001192093, - }, - }, - searingflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 0, - particlespeed = 5, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 0.5, - texture = [[gunshot]], - useairlos = false, - }, - }, - smokeandfire = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.70, - colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 2, 0.0]], - numparticles = 3, - particlelife = 10, - particlelifespread = 4, - particlesize = 0, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 2, - pos = [[0.0, 1, 0.0]], - sizegrowth = 3, - sizemod = 0.5, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - - ["burn"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.9 0.9 0.0 0.01 1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 10, - particlelifespread = 10, - particlesize = 1, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 5, - pos = [[r-3 r3, 1.5, r-3 r3]], - sizegrowth = 1.2, - sizemod = 1.0, - texture = [[dirt]], - useairlos = false, - }, - }, - dirtw1 = { - class = [[CSimpleParticleSystem]], - count = 1, - underwater = 1, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 10, - particlesize = 3, - particlesizespread = 5, - particlespeed = 1, - particlespeedspread = 5, - pos = [[r-1 r1, 1, r-1 r1]], - sizegrowth = 1.2, - sizemod = 1.0, - texture = [[randomdots]], - useairlos = false, - }, - }, - groundflash = { - air = true, - circlealpha = 0.0, - circlegrowth = 6, - flashalpha = 0.9, - flashsize = 25, - ground = true, - ttl = 3, - underwater = 1, - water = true, - color = { - [1] = 1, - [2] = 0.5, - [3] = 0, - }, - }, - shatter = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.8, - colormap = [[0.9 0.9 0.0 0.04 1.0 0.5 0.0 0.01 1.0 0.5 0.0 0.00]], - directional = true, - emitrot = 35, - emitrotspread = 1, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 7, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2, - particlespeed = 7, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[longshot]], - useairlos = false, - }, - }, - }, - - ["burnold"] = { - groundflash = { - circlealpha = 0.1, - circlegrowth = 3, - flashalpha = 1, - flashsize = 12, - ttl = 8, - color = { - [1] = 0.80000001192093, - [2] = 0.10000000149012, - [3] = 0, - }, - }, - searingflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 2, 0]], - numparticles = 10, - particlelife = 10, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 0, - particlespeed = 5, - particlespeedspread = 15, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 0.5, - texture = [[gunshot]], - useairlos = false, - }, - }, - smokeandfire = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.70, - colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 2, 0.0]], - numparticles = 3, - particlelife = 10, - particlelifespread = 4, - particlesize = 0, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 2, - pos = [[0.0, 1, 0.0]], - sizegrowth = 3, - sizemod = 0.5, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - - ["pilotlight"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.66, - colormap = [[0.7 0.5 1.0 0.5 0.90 0.88 0.9 0.25 0.30 0.18 0.02 0.09 0 0 0 0.01]], - directional = true, - emitrot = 4, - emitrotspread = 12, - emitvector = [[dir]], - gravity = [[0, 0.30, 0]], - numparticles = 1, - particlelife = 5.5, - particlelifespread = 8, - particlesize = 3, - particlesizespread = 1.8, - particlespeed = 0.5, - particlespeedspread = 0.8, - pos = [[-0.5 r1, 1, -0.5 r1]], - sizegrowth = 0.6, - sizemod = 1.0, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[16,6,8 r15]], - texture = [[BARFlame02]], - useairlos = false, - }, - }, - }, - - ["pilotlightxl"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.75, - colormap = [[0.7 0.5 1.0 0.3 0.90 0.88 0.9 0.15 0.30 0.18 0.02 0.06 0 0 0 0.01]], - directional = true, - emitrot = 4, - emitrotspread = 8, - emitvector = [[dir]], - gravity = [[0, 0.15, 0]], - numparticles = 1, - particlelife = 7.5, - particlelifespread = 14, - particlesize = 4, - particlesizespread = 2.8, - particlespeed = 0.5, - particlespeedspread = 0.8, - pos = [[-0.5 r1, 0, -0.5 r1]], - sizegrowth = 0.3, - sizemod = 1.0, - rotParams = [[-15 r10, 0, -180 r360]], - animParams = [[16,6,12 r15]], - texture = [[BARFlame02]], - useairlos = false, - }, - }, - }, - - ["burnblack"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - --colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.15 0.12 0.06 0.15 0.023 0.022 0.022 0.05 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], - colormap = [[1.0 0.95 0.55 0.9 1.0 1.0 0.9 1 1.0 0.78 0.25 0.88 0.45 0.25 0.1 0.66 0.033 0.023 0.05 0.3 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.05, 0.06 r0.05, -0.03 r0.05]], - numparticles = [[1 r1]], - particlelife = 27, - particlelifespread = 20, - particlesize = 10, - particlesizespread = 16, - particlespeed = 0.4, - particlespeedspread = 0.6, - pos = [[-3 r6, -3 r6, -3 r6]], - sizegrowth = [[1.5 r2.1]], - sizemod = 0.97, - rotParams = [[-8 r16, 0, -180 r360]], - animParams = [[16,6,24 r55]], - texture = [[BARFlame02]], - castShadow = true, - }, - }, - }, - ["burnthermite"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 1, 0.3]], - gravity = [[0, 0.11, 0]], - numparticles = 1, - particlelife = 9, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 16, - particlespeed = 0.5, - particlespeedspread = 0.7, - pos = [[-3 r6, -3 r6, -3 r6]], - sizegrowth = [[1.2 d+0.8 r2.99]],--0.3 d+5 - sizemod = 0.97, - rotParams = [[-8 r16, 0, -180 r360]], - animParams = [[16,6,80 r55]], - texture = [[BARFlame02]], - castShadow = true, - }, - }, - }, - - ["burnblackxl"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - --colormap = [[0.9 0.8 0.7 0.3 1 0.9 0.8 1 0.95 0.8 0.66 1 0.45 0.25 0.1 0.6 0.023 0.022 0.022 0.3 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], - colormap = [[1.0 0.95 0.55 0.9 1.0 1.0 0.9 1 1.0 0.78 0.25 0.88 0.45 0.25 0.1 0.66 0.033 0.023 0.05 0.3 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.05, 0.07 r0.05, -0.03 r0.05]], - numparticles = [[2 r1]], - particlelife = 40, - particlelifespread = 30, - particlesize = 25, - particlesizespread = 40, - particlespeed = 0.5, - particlespeedspread = 0.5, - pos = [[-4 r8, -4 r8, -4 r8]], - sizegrowth = [[1.2 r2.99]], - sizemod = 0.97, - rotParams = [[-8 r16, 0, -180 r360]], - animParams = [[16,6,24 r60]], - texture = [[BARFlame02]], - }, - }, - }, + ["burnblackbig-anim"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[1.0 0.95 0.55 0.3 1.0 1.0 0.9 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.36 0 0 0 0.08 0 0 0 0.05 0 0 0 0.03 0 0 0 0.01]], + directional = false, + emitrot = 65, + emitrotspread = 65, + emitvector = [[0.3, 1, 0.3]], + gravity = [[0, 0.05, 0]], + numparticles = 1, + particlelife = 55, + particlelifespread = 40, + particlesize = 8, + particlesizespread = 11, + particlespeed = 0.45, + particlespeedspread = 0.4, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[8,8,100 r50]], + pos = [[-3 r6, -3 r6, -3 r6]], + sizegrowth = 1.1, + sizemod = 0.98, + texture = [[FireBall02-anim]], + }, + }, + }, + ["burnflame-anim"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[0, 0.06 r0.05, 0]], + numparticles = [[0.49 r0.60]], + particlelife = 24, + particlelifespread = 9, + particlesize = 6.4, + particlesizespread = 6.8, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,40 r80]], + pos = [[-2 r4, 32 r8, -2 r4]], + sizegrowth = [[1.6 r1.3 d+7]], + sizemod = 0.93, + texture = [[BARFlame02]], + drawOrder = 1, + castShadow = true, + }, + }, + }, + ["burnflame-anim-x2"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[0, 0.06 r0.05, 0]], + numparticles = [[1 r2.5]], + particlelife = 24, + particlelifespread = 9, + particlesize = 18.4, + particlesizespread = 18.8, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,40 r80]], + pos = [[-2 r4, 32 r8, -2 r4]], + sizegrowth = [[1.7 r1.9]], + sizemod = 0.93, + texture = [[BARFlame02]], + drawOrder = 1, + castShadow = true, + }, + }, + }, + ["missileburn"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 0.5, 0.5]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + }, - ["burnblackbig"] = { - flame1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.12 0.07 0.05 0.1 0.25 0.18 0.07 0.45 0.045 0.04 0.04 0.33 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.15, 1, 0.15]], - gravity = [[-0.03 r0.05, 0.04 r0.03, -0.03 r0.05]], - numparticles = [[1 r1]], - particlelife = 28, - particlelifespread = 18, - particlesize = 25, - particlesizespread = 25, - particlespeed = 0.5, - particlespeedspread = 0.7, - pos = [[-2 r4, 0 r8, -2 r4]], - sizegrowth = [[1.0 r2.0]], - sizemod = 0.97, - rotParams = [[-8 r16, 0, -180 r360]], - animParams = [[16,6,24 r55]], - texture = [[BARFlame02]], - castShadow = true, - }, - }, - flame2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 30, - emitvector = [[0.2, -0.4, 0.2]], - gravity = [[0, 0.05 r0.08, 0]], - numparticles = [[0.65 r0.75]], - particlelife = 34, - particlelifespread = 38, - particlesize = 25, - particlesizespread = 30, - particlespeed = 1, - particlespeedspread = 1.3, - animParams = [[8,8,60 r50]], - rotParams = [[-2 r4, -2 r4, -180 r360]], - pos = [[-2 r4, 10 r15, -2 r4]], - sizegrowth = [[1.1 r0.5]], - sizemod = 0.98, - texture = [[FireBall02-anim]], - drawOrder = 0, - }, - }, - }, + ["electricburn"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0, + [2] = 0.10000000149012, + [3] = 0.80000001192093, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - ["burnblackbiggest"] = { - particles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[1.0 0.78 0.25 0.8 1.0 0.95 0.55 0.4 0.7 0.4 0.1 0.2 0.16 0.12 0.09 0.11 0.023 0.022 0.022 0.05 0 0 0 0.01]], - directional = true, - emitrot = 65, - emitrotspread = 65, - emitvector = [[0.3, 1, 0.3]], - gravity = [[0, 0.09, 0]], - numparticles = [[1 r1]], - particlelife = 60, - particlelifespread = 66, - particlesize = 15, - particlesizespread = 17, - particlespeed = 0.45, - particlespeedspread = 0.4, - pos = [[-3 r6, -3 r6, -3 r6]], - sizegrowth = 0.7, - sizemod = 0.99, - texture = [[randdots]], - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0.01 1.0 0.78 0.25 0.8 1.0 0.95 0.55 0.4 0.7 0.4 0.1 0.2 0.16 0.12 0.09 0.11 0.023 0.022 0.022 0.05 0 0 0 0.01]], - directional = true, - emitrot = 65, - emitrotspread = 65, - emitvector = [[0.3, 1, 0.3]], - gravity = [[0, 0.00, 0]], - numparticles = 2, - particlelife = 60, - particlelifespread = 66, - particlesize = 17, - particlesizespread = 18, - particlespeed = 0.45, - particlespeedspread = 0.4, - pos = [[-3 r6, -3 r6, -3 r6]], - sizegrowth = 0.7, - sizemod = 0.99, - texture = [[smoke_puff]], - }, - }, - }, + ["burn"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.9 0.9 0.0 0.01 1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 1, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-3 r3, 1.5, r-3 r3]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = false, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + groundflash = { + air = true, + circlealpha = 0.0, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 25, + ground = true, + ttl = 3, + underwater = 1, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + shatter = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.9 0.9 0.0 0.04 1.0 0.5 0.0 0.01 1.0 0.5 0.0 0.00]], + directional = true, + emitrot = 35, + emitrotspread = 1, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 7, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2, + particlespeed = 7, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[longshot]], + useairlos = false, + }, + }, + }, - ["burngreen"] = { - groundflash = { - circlealpha = 0.1, - circlegrowth = 3, - flashalpha = 1, - flashsize = 12, - ttl = 8, - color = { - [1] = 0.80000001192093, - [2] = 0.10000000149012, - [3] = 0, - }, - }, - searingflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.4 0.9 0.4 0.04 0.4 0.9 0.1 0.01 0.1 0.5 0.1 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 0.5, 0.5]], - gravity = [[0, 2, 0]], - numparticles = 10, - particlelife = 10, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 0, - particlespeed = 5, - particlespeedspread = 15, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 0.5, - texture = [[gunshot]], - useairlos = false, - }, - }, - smokeandfire = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.70, - colormap = [[0.1 0.1 0.1 0.01 0.0 0.5 0.0 0.05 0.1 0.5 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[1, 1, 1]], - gravity = [[0.0, 2, 0.0]], - numparticles = 3, - particlelife = 10, - particlelifespread = 4, - particlesize = 0, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 2, - pos = [[0.0, 1, 0.0]], - sizegrowth = 3, - sizemod = 0.5, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["flamestream"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.22, 0]], - numparticles = [[0.88 r0.85]], - particlelife = 8, - particlelifespread = 6, - particlesize = -19, - particlesizespread = -13, - particlespeed = 13, - particlespeedspread = 11, - rotParams = [[-10 r20, -10 r20, -10 r20]], - pos = [[-2 r4, 10 r8, -2 r4]], - sizegrowth = 0.15, - sizemod = 0.96, - texture = [[flamestream]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.83, - colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 8, - emitrotspread = 4, - emitvector = [[dir]], - gravity = [[-0.4 r0.8, 0.55 r0.4, -0.4 r0.8]], - numparticles = [[0.55 r0.62]], - particlelife = 10, - particlelifespread = 8, - particlesize = -15, - particlesizespread = -7, - particlespeed = 13, - particlespeedspread = 18, - pos = [[0, 4, 0]], - sizegrowth = 0.02, - sizemod = 0.9, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, - ["flamestreamxm"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], - directional = true, - emitrot = 2.5, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.58 r0.65]], - particlelife = 9, - particlelifespread = 6, - particlesize = -25, - particlesizespread = -12, - particlespeed = 14, - particlespeedspread = 8, - rotParams = [[-5 r10, 0, -5 r10]], - pos = [[-2 r4, 10 r8, -2 r4]], - sizegrowth = 0.11, - sizemod = 0.96, - texture = [[flamestream]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 4, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[-0.45 r0.9, 0.25 r0.3, -0.45 r0.9]], - numparticles = [[0.52 r0.55]], - particlelife = 9, - particlelifespread = 15, - particlesize = -18, - particlesizespread = -8, - particlespeed = 10, - particlespeedspread = 15, - pos = [[0, 4, 0]], - sizegrowth = 0.02, - sizemod = 0.9, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, - ["thermitesmoke"] = { - flame = { - air = true,--also a useful function for experimenting with the particle physics - class = [[CSimpleParticleSystem]], - count = 300, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.1 0.12 0.1 0.01 0.3 0.3 0.3 0.01 0.82 0.88 0.77 0.015 0.4 0.55 0.3 0.01 0.1 0.1 0.1 0]], - directional = true, - emitrot = 30, - emitrotspread = 1, - emitvector = [[dir]], - emitmul = [[1.7, 1.8, 1.7]], - gravity = [[0, 0.05, 0]], - numparticles = [[1.95 r0.86]], - particlelife = 150, - particlelifespread = 40, - particlesize = 1.5, - particlesizespread = -1.2, - particlespeed = 0.7, - particlespeedspread = 0.05, - rotParams = [[0, 0, 0]], - pos = [[99,1,1]], - sizegrowth = "0.29 d+2", - sizemod = 0.93, - texture = [[smoke]], - drawOrder = 1, - }, - }, + ["burnold"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, }, - ["flamestreamthermite"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], - directional = true, - emitmul = [[1.0, 1.0 r0.86, 2.0]], - emitrot = 2.5, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.58 r0.65]], - particlelife = 9, - particlelifespread = 6, - particlesize = -15, - particlesizespread = -6, - particlespeed = 14, - particlespeedspread = 8, - rotParams = [[-5 r10, 0, -5 r10]], - pos = [[-2 r4, 10 r8, -2 r4]], - sizegrowth = 0.11, - sizemod = 0.96, - texture = [[flamestream]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 4, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[-0.45 r0.9, 0.25 r0.3, -0.45 r0.9]], - numparticles = [[0.52 r0.55]], - particlelife = 9, - particlelifespread = 15, - particlesize = -18, - particlesizespread = -8, - particlespeed = 10, - particlespeedspread = 15, - pos = [[0, 4, 0]], - sizegrowth = 0.02, - sizemod = 0.9, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, + ["pilotlight"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.66, + colormap = [[0.7 0.5 1.0 0.5 0.90 0.88 0.9 0.25 0.30 0.18 0.02 0.09 0 0 0 0.01]], + directional = true, + emitrot = 4, + emitrotspread = 12, + emitvector = [[dir]], + gravity = [[0, 0.30, 0]], + numparticles = 1, + particlelife = 5.5, + particlelifespread = 8, + particlesize = 3, + particlesizespread = 1.8, + particlespeed = 0.5, + particlespeedspread = 0.8, + pos = [[-0.5 r1, 1, -0.5 r1]], + sizegrowth = 0.6, + sizemod = 1.0, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[16,6,8 r15]], + texture = [[BARFlame02]], + useairlos = false, + }, + }, + }, - }, - ["flamestreamxl"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.94, - colormap = [[0.96 0.90 0.85 1 0.98 0.95 0.90 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.65 r0.75]], - particlelife = 14, - particlelifespread = 8, - particlesize = -17, - particlesizespread = -21, - particlespeed = 14, - particlespeedspread = 11, - rotParams = [[-7 r14, 0, -10 r20]], - pos = [[-2 r4, 10 r8, -2 r4]], - sizegrowth = 0.08, - sizemod = 0.975, - texture = [[flamestream]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 10, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[-0.45 r0.9, 0.30 r0.45, -0.45 r0.9]], - numparticles = [[0.6 r0.8]], - particlelife = 9, - particlelifespread = 15, - particlesize = -18, - particlesizespread = -8, - particlespeed = 13, - particlespeedspread = 19, - pos = [[0, 4, 0]], - sizegrowth = 0.02, - sizemod = 0.9, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, - ["flamestreamxxl"] = { - flame = { + ["pilotlightxl"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.75, + colormap = [[0.7 0.5 1.0 0.3 0.90 0.88 0.9 0.15 0.30 0.18 0.02 0.06 0 0 0 0.01]], + directional = true, + emitrot = 4, + emitrotspread = 8, + emitvector = [[dir]], + gravity = [[0, 0.15, 0]], + numparticles = 1, + particlelife = 7.5, + particlelifespread = 14, + particlesize = 4, + particlesizespread = 2.8, + particlespeed = 0.5, + particlespeedspread = 0.8, + pos = [[-0.5 r1, 0, -0.5 r1]], + sizegrowth = 0.3, + sizemod = 1.0, + rotParams = [[-15 r10, 0, -180 r360]], + animParams = [[16,6,12 r15]], + texture = [[BARFlame02]], + useairlos = false, + }, + }, + }, - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = true, - properties = { - airdrag = 0.91, - colormap = [[0.75 0.45 0.99 0.3 0.96 0.90 0.95 0.95 0.98 0.95 0.90 0.33 0.94 0.88 0.80 0.12 0.78 0.45 0.1 0.07 0.01 0 0 0.01]], - directional = true, - emitrot = 2, - emitrotspread = 2, - emitvector = [[dir]], - emitmul = [[1.0, 2.0, 2.0]], - gravity = [[0, 0.07, 0]], - numparticles = [[0.6 r0.75]], - particlelife = 6, - particlelifespread = 8, - particlesize = -34, - particlesizespread = -22, - particlespeed = 13, - particlespeedspread = 4, - rotParams = [[-7 r14, -20 r40, -15 r30]], - pos = [[-3 r6, 0, -3 r6]], - sizegrowth = [[1.2 r0.5]], - sizemod = 1.05, - texture = [[flamestream]], - drawOrder = 0, - --castShadow = true, + ["burnblack"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + --colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.15 0.12 0.06 0.15 0.023 0.022 0.022 0.05 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], + colormap = [[1.0 0.95 0.55 0.9 1.0 1.0 0.9 1 1.0 0.78 0.25 0.88 0.45 0.25 0.1 0.66 0.033 0.023 0.05 0.3 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.05, 0.06 r0.05, -0.03 r0.05]], + numparticles = [[1 r1]], + particlelife = 27, + particlelifespread = 20, + particlesize = 10, + particlesizespread = 16, + particlespeed = 0.4, + particlespeedspread = 0.6, + pos = [[-3 r6, -3 r6, -3 r6]], + sizegrowth = [[1.5 r2.1]], + sizemod = 0.97, + rotParams = [[-8 r16, 0, -180 r360]], + animParams = [[16,6,24 r55]], + texture = [[BARFlame02]], + castShadow = true, + }, + }, + }, + ["burnthermite"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 1, 0.3]], + gravity = [[0, 0.11, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 16, + particlespeed = 0.5, + particlespeedspread = 0.7, + pos = [[-3 r6, -3 r6, -3 r6]], + sizegrowth = [[1.2 d+0.8 r2.99]], --0.3 d+5 + sizemod = 0.97, + rotParams = [[-8 r16, 0, -180 r360]], + animParams = [[16,6,80 r55]], + texture = [[BARFlame02]], + castShadow = true, + }, + }, + }, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 10, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[-0.45 r0.9, 0.30 r0.45, -0.45 r0.9]], - numparticles = [[0.5 r0.7]], - particlelife = 9, - particlelifespread = 15, - particlesize = -18, - particlesizespread = -8, - particlespeed = 15, - particlespeedspread = 21, - pos = [[0, 4, 0]], - sizegrowth = 0.02, - sizemod = 0.9, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + ["burnblackxl"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + --colormap = [[0.9 0.8 0.7 0.3 1 0.9 0.8 1 0.95 0.8 0.66 1 0.45 0.25 0.1 0.6 0.023 0.022 0.022 0.3 0.023 0.022 0.022 0.05 0 0 0 0.03 0 0 0 0.01]], + colormap = [[1.0 0.95 0.55 0.9 1.0 1.0 0.9 1 1.0 0.78 0.25 0.88 0.45 0.25 0.1 0.66 0.033 0.023 0.05 0.3 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.05, 0.07 r0.05, -0.03 r0.05]], + numparticles = [[2 r1]], + particlelife = 40, + particlelifespread = 30, + particlesize = 25, + particlesizespread = 40, + particlespeed = 0.5, + particlespeedspread = 0.5, + pos = [[-4 r8, -4 r8, -4 r8]], + sizegrowth = [[1.2 r2.99]], + sizemod = 0.97, + rotParams = [[-8 r16, 0, -180 r360]], + animParams = [[16,6,24 r60]], + texture = [[BARFlame02]], + }, + }, + }, - ["burnflame"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.99, - colormap = [[ 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], - --colormap = [[0.01 0 0 0.2 0.22 0.12 0.33 0.7 0.3 0.3 0.28 0.99 0.28 0.28 0.25 0.8 0.27 0.26 0.22 0.6 0.25 0.20 0.15 0.24 0.01 0 0 0.01]], - --colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, -1, 0.3]], - gravity = [[0, 0.24, 0]], - numparticles = [[0.80 r0.63]], - particlelife = 7, - particlelifespread = 7, - particlesize = 56, - particlesizespread = 26, - particlespeed = -1, - particlespeedspread = 0.6, - --rotParams = [[-240 r480, -100 r200, -180 r360]], - pos = [[-2 r4, 35 r8, -2 r4]], - sizegrowth = -0.8, - sizemod = 0.88, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,35 r60]], - texture = [[BARFlame02]], - drawOrder = 1, - }, - }, - }, + ["burnblackbig"] = { + flame1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[1.0 0.78 0.25 0.3 1.0 1.0 0.9 1 1.0 0.95 0.55 1 1.0 0.78 0.25 0.6 0.45 0.25 0.1 0.3 0.12 0.07 0.05 0.1 0.25 0.18 0.07 0.45 0.045 0.04 0.04 0.33 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.15, 1, 0.15]], + gravity = [[-0.03 r0.05, 0.04 r0.03, -0.03 r0.05]], + numparticles = [[1 r1]], + particlelife = 28, + particlelifespread = 18, + particlesize = 25, + particlesizespread = 25, + particlespeed = 0.5, + particlespeedspread = 0.7, + pos = [[-2 r4, 0 r8, -2 r4]], + sizegrowth = [[1.0 r2.0]], + sizemod = 0.97, + rotParams = [[-8 r16, 0, -180 r360]], + animParams = [[16,6,24 r55]], + texture = [[BARFlame02]], + castShadow = true, + }, + }, + flame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 30, + emitvector = [[0.2, -0.4, 0.2]], + gravity = [[0, 0.05 r0.08, 0]], + numparticles = [[0.65 r0.75]], + particlelife = 34, + particlelifespread = 38, + particlesize = 25, + particlesizespread = 30, + particlespeed = 1, + particlespeedspread = 1.3, + animParams = [[8,8,60 r50]], + rotParams = [[-2 r4, -2 r4, -180 r360]], + pos = [[-2 r4, 10 r15, -2 r4]], + sizegrowth = [[1.1 r0.5]], + sizemod = 0.98, + texture = [[FireBall02-anim]], + drawOrder = 0, + }, + }, + }, - ["burnflame-xs"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.99, - colormap = [[0.92 0.92 0.91 0.98 0.92 0.90 0.78 0.95 0.75 0.43 0.09 0.3 0.01 0 0 0.01]], - --colormap = [[0.01 0 0 0.2 0.22 0.12 0.33 0.7 0.3 0.3 0.28 0.99 0.28 0.28 0.25 0.8 0.27 0.26 0.22 0.6 0.25 0.20 0.15 0.24 0.01 0 0 0.01]], - --colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, -0.5, 0.3]], - gravity = [[0, 0.24, 0]], - numparticles = [[0.95 r0.70]], - particlelife = 6, - particlelifespread = 4, - particlesize = 52, - particlesizespread = 25, - particlespeed = -0.5, - particlespeedspread = 0.3, - --rotParams = [[-240 r480, -100 r200, -180 r360]], - pos = [[-2 r4, 35 r8, -2 r4]], - sizegrowth = -1.5, - sizemod = 0.85, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,30 r40]], - texture = [[BARFlame02]], - drawOrder = 1, - }, - }, - }, + ["burnblackbiggest"] = { + particles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[1.0 0.78 0.25 0.8 1.0 0.95 0.55 0.4 0.7 0.4 0.1 0.2 0.16 0.12 0.09 0.11 0.023 0.022 0.022 0.05 0 0 0 0.01]], + directional = true, + emitrot = 65, + emitrotspread = 65, + emitvector = [[0.3, 1, 0.3]], + gravity = [[0, 0.09, 0]], + numparticles = [[1 r1]], + particlelife = 60, + particlelifespread = 66, + particlesize = 15, + particlesizespread = 17, + particlespeed = 0.45, + particlespeedspread = 0.4, + pos = [[-3 r6, -3 r6, -3 r6]], + sizegrowth = 0.7, + sizemod = 0.99, + texture = [[randdots]], + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0.01 1.0 0.78 0.25 0.8 1.0 0.95 0.55 0.4 0.7 0.4 0.1 0.2 0.16 0.12 0.09 0.11 0.023 0.022 0.022 0.05 0 0 0 0.01]], + directional = true, + emitrot = 65, + emitrotspread = 65, + emitvector = [[0.3, 1, 0.3]], + gravity = [[0, 0.00, 0]], + numparticles = 2, + particlelife = 60, + particlelifespread = 66, + particlesize = 17, + particlesizespread = 18, + particlespeed = 0.45, + particlespeedspread = 0.4, + pos = [[-3 r6, -3 r6, -3 r6]], + sizegrowth = 0.7, + sizemod = 0.99, + texture = [[smoke_puff]], + }, + }, + }, - ["burnflamexm"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, -1, 0.3]], - gravity = [[0, 0.24, 0]], - numparticles = [[0.5 r0.60]], - particlelife = 8, - particlelifespread = 9, - particlesize = 3.8, - particlesizespread = 13, - particlespeed = -1, - particlespeedspread = 0.6, - rotParams = [[-240 r480, -100 r200, -180 r360]], - pos = [[-2 r4, 35 r8, -2 r4]], - sizegrowth = 1.5, - sizemod = 0.94, - texture = [[flame_alt2]], - drawOrder = 1, - }, - }, - }, - ["burnflamethermite"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.2 r0.81]], - particlelife = 7, - particlelifespread = 12, - particlesize = 9, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-3 r6, 20, -3 r6]], - sizegrowth = 0.1, - sizemod = 1.01, - texture = [[fire]], - drawOrder = -1, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.3, 1.0, 0.3]], - --gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], - numparticles = [[0.45 r0.75]], - particlelife = 19, - particlelifespread = 8, - particlesize = 32, - particlesizespread = 44, - particlespeed = 0.4, - particlespeedspread = 0.9, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,50 r60]], - texture = [[BARFlame02]], - pos = [[-2 r4, 32 r12, -2 r4]], - sizegrowth = [[1.9 d+10 r3.0]], - sizemod = 0.82, - drawOrder = 1, - }, - }, + ["burngreen"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.9 0.4 0.04 0.4 0.9 0.1 0.01 0.1 0.5 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 0.5, 0.5]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.5 0.0 0.05 0.1 0.5 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[1, 1, 1]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["flamestream"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.22, 0]], + numparticles = [[0.88 r0.85]], + particlelife = 8, + particlelifespread = 6, + particlesize = -19, + particlesizespread = -13, + particlespeed = 13, + particlespeedspread = 11, + rotParams = [[-10 r20, -10 r20, -10 r20]], + pos = [[-2 r4, 10 r8, -2 r4]], + sizegrowth = 0.15, + sizemod = 0.96, + texture = [[flamestream]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.83, + colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 8, + emitrotspread = 4, + emitvector = [[dir]], + gravity = [[-0.4 r0.8, 0.55 r0.4, -0.4 r0.8]], + numparticles = [[0.55 r0.62]], + particlelife = 10, + particlelifespread = 8, + particlesize = -15, + particlesizespread = -7, + particlespeed = 13, + particlespeedspread = 18, + pos = [[0, 4, 0]], + sizegrowth = 0.02, + sizemod = 0.9, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["flamestreamxm"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], + directional = true, + emitrot = 2.5, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.58 r0.65]], + particlelife = 9, + particlelifespread = 6, + particlesize = -25, + particlesizespread = -12, + particlespeed = 14, + particlespeedspread = 8, + rotParams = [[-5 r10, 0, -5 r10]], + pos = [[-2 r4, 10 r8, -2 r4]], + sizegrowth = 0.11, + sizemod = 0.96, + texture = [[flamestream]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 4, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[-0.45 r0.9, 0.25 r0.3, -0.45 r0.9]], + numparticles = [[0.52 r0.55]], + particlelife = 9, + particlelifespread = 15, + particlesize = -18, + particlesizespread = -8, + particlespeed = 10, + particlespeedspread = 15, + pos = [[0, 4, 0]], + sizegrowth = 0.02, + sizemod = 0.9, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["thermitesmoke"] = { + flame = { + air = true, --also a useful function for experimenting with the particle physics + class = [[CSimpleParticleSystem]], + count = 300, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.1 0.12 0.1 0.01 0.3 0.3 0.3 0.01 0.82 0.88 0.77 0.015 0.4 0.55 0.3 0.01 0.1 0.1 0.1 0]], + directional = true, + emitrot = 30, + emitrotspread = 1, + emitvector = [[dir]], + emitmul = [[1.7, 1.8, 1.7]], + gravity = [[0, 0.05, 0]], + numparticles = [[1.95 r0.86]], + particlelife = 150, + particlelifespread = 40, + particlesize = 1.5, + particlesizespread = -1.2, + particlespeed = 0.7, + particlespeedspread = 0.05, + rotParams = [[0, 0, 0]], + pos = [[99,1,1]], + sizegrowth = "0.29 d+2", + sizemod = 0.93, + texture = [[smoke]], + drawOrder = 1, + }, + }, + }, + ["flamestreamthermite"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0.65 0.45 0.99 0.3 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], + directional = true, + emitmul = [[1.0, 1.0 r0.86, 2.0]], + emitrot = 2.5, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.58 r0.65]], + particlelife = 9, + particlelifespread = 6, + particlesize = -15, + particlesizespread = -6, + particlespeed = 14, + particlespeedspread = 8, + rotParams = [[-5 r10, 0, -5 r10]], + pos = [[-2 r4, 10 r8, -2 r4]], + sizegrowth = 0.11, + sizemod = 0.96, + texture = [[flamestream]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 4, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[-0.45 r0.9, 0.25 r0.3, -0.45 r0.9]], + numparticles = [[0.52 r0.55]], + particlelife = 9, + particlelifespread = 15, + particlesize = -18, + particlesizespread = -8, + particlespeed = 10, + particlespeedspread = 15, + pos = [[0, 4, 0]], + sizegrowth = 0.02, + sizemod = 0.9, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["flamestreamxl"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.94, + colormap = [[0.96 0.90 0.85 1 0.98 0.95 0.90 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.65 r0.75]], + particlelife = 14, + particlelifespread = 8, + particlesize = -17, + particlesizespread = -21, + particlespeed = 14, + particlespeedspread = 11, + rotParams = [[-7 r14, 0, -10 r20]], + pos = [[-2 r4, 10 r8, -2 r4]], + sizegrowth = 0.08, + sizemod = 0.975, + texture = [[flamestream]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 10, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[-0.45 r0.9, 0.30 r0.45, -0.45 r0.9]], + numparticles = [[0.6 r0.8]], + particlelife = 9, + particlelifespread = 15, + particlesize = -18, + particlesizespread = -8, + particlespeed = 13, + particlespeedspread = 19, + pos = [[0, 4, 0]], + sizegrowth = 0.02, + sizemod = 0.9, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["flamestreamxxl"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = true, + properties = { + airdrag = 0.91, + colormap = [[0.75 0.45 0.99 0.3 0.96 0.90 0.95 0.95 0.98 0.95 0.90 0.33 0.94 0.88 0.80 0.12 0.78 0.45 0.1 0.07 0.01 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 2, + emitvector = [[dir]], + emitmul = [[1.0, 2.0, 2.0]], + gravity = [[0, 0.07, 0]], + numparticles = [[0.6 r0.75]], + particlelife = 6, + particlelifespread = 8, + particlesize = -34, + particlesizespread = -22, + particlespeed = 13, + particlespeedspread = 4, + rotParams = [[-7 r14, -20 r40, -15 r30]], + pos = [[-3 r6, 0, -3 r6]], + sizegrowth = [[1.2 r0.5]], + sizemod = 1.05, + texture = [[flamestream]], + drawOrder = 0, + --castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 10, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[-0.45 r0.9, 0.30 r0.45, -0.45 r0.9]], + numparticles = [[0.5 r0.7]], + particlelife = 9, + particlelifespread = 15, + particlesize = -18, + particlesizespread = -8, + particlespeed = 15, + particlespeedspread = 21, + pos = [[0, 4, 0]], + sizegrowth = 0.02, + sizemod = 0.9, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["burnflame"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.99, + colormap = [[ 0.91 0.90 0.95 0.98 0.92 0.88 0.80 0.95 0.75 0.45 0.1 0.3 0.01 0 0 0.01]], + --colormap = [[0.01 0 0 0.2 0.22 0.12 0.33 0.7 0.3 0.3 0.28 0.99 0.28 0.28 0.25 0.8 0.27 0.26 0.22 0.6 0.25 0.20 0.15 0.24 0.01 0 0 0.01]], + --colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, -1, 0.3]], + gravity = [[0, 0.24, 0]], + numparticles = [[0.80 r0.63]], + particlelife = 7, + particlelifespread = 7, + particlesize = 56, + particlesizespread = 26, + particlespeed = -1, + particlespeedspread = 0.6, + --rotParams = [[-240 r480, -100 r200, -180 r360]], + pos = [[-2 r4, 35 r8, -2 r4]], + sizegrowth = -0.8, + sizemod = 0.88, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,35 r60]], + texture = [[BARFlame02]], + drawOrder = 1, + }, + }, + }, - }, - ["burnflamexl"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.2 r0.81]], - particlelife = 7, - particlelifespread = 12, - particlesize = 9, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-3 r6, 20, -3 r6]], - sizegrowth = 2, - sizemod = 0.99, - texture = [[fire]], - drawOrder = -1, - castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[-0.04 r0.08, 0.06 r0.08, -0.04 r0.08]], - numparticles = [[0.45 r0.75]], - particlelife = 25, - particlelifespread = 8, - particlesize = 26, - particlesizespread = 36, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,50 r60]], - pos = [[-2 r4, 32 r12, -2 r4]], - sizegrowth = [[2.5 d+9 r4.0]], - sizemod = 0.92, - texture = [[BARFlame02]], - drawOrder = 1, - }, - }, - }, - ["burnflamexl-gen"] = { - burnrandom = { - class = [[CExpGenSpawner]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r12]], - explosiongenerator = [[custom:burnflamexl]], - pos = [[-10 r20, 0 r20, -10 r20]], - }, - }, - }, + ["burnflame-xs"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.99, + colormap = [[0.92 0.92 0.91 0.98 0.92 0.90 0.78 0.95 0.75 0.43 0.09 0.3 0.01 0 0 0.01]], + --colormap = [[0.01 0 0 0.2 0.22 0.12 0.33 0.7 0.3 0.3 0.28 0.99 0.28 0.28 0.25 0.8 0.27 0.26 0.22 0.6 0.25 0.20 0.15 0.24 0.01 0 0 0.01]], + --colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, -0.5, 0.3]], + gravity = [[0, 0.24, 0]], + numparticles = [[0.95 r0.70]], + particlelife = 6, + particlelifespread = 4, + particlesize = 52, + particlesizespread = 25, + particlespeed = -0.5, + particlespeedspread = 0.3, + --rotParams = [[-240 r480, -100 r200, -180 r360]], + pos = [[-2 r4, 35 r8, -2 r4]], + sizegrowth = -1.5, + sizemod = 0.85, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,30 r40]], + texture = [[BARFlame02]], + drawOrder = 1, + }, + }, + }, - ["burnflamel"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[0.2 r0.81]], - particlelife = 7, - particlelifespread = 12, - particlesize = 7, - particlesizespread = 11, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-3 r6, 20, -3 r6]], - sizegrowth = 2, - sizemod = 0.99, - texture = [[fire]], - drawOrder = -1, - castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[-0.04 r0.08, 0.06 r0.08, -0.04 r0.08]], - numparticles = [[0.45 r0.75]], - particlelife = 25, - particlelifespread = 8, - particlesize = 22, - particlesizespread = 30, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,50 r60]], - pos = [[-2 r4, 32 r12, -2 r4]], - sizegrowth = [[2.5 d+9 r4.0]], - sizemod = 0.92, - texture = [[BARFlame02]], - drawOrder = 1, - }, - }, - }, - ["burnflamel-gen"] = { - burnrandom = { - class = [[CExpGenSpawner]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r12]], - explosiongenerator = [[custom:burnflamel]], - pos = [[-10 r20, 0 r20, -10 r20]], - }, - }, - }, + ["burnflamexm"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0 0 0.7 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, -1, 0.3]], + gravity = [[0, 0.24, 0]], + numparticles = [[0.5 r0.60]], + particlelife = 8, + particlelifespread = 9, + particlesize = 3.8, + particlesizespread = 13, + particlespeed = -1, + particlespeedspread = 0.6, + rotParams = [[-240 r480, -100 r200, -180 r360]], + pos = [[-2 r4, 35 r8, -2 r4]], + sizegrowth = 1.5, + sizemod = 0.94, + texture = [[flame_alt2]], + drawOrder = 1, + }, + }, + }, + ["burnflamethermite"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.2 r0.81]], + particlelife = 7, + particlelifespread = 12, + particlesize = 9, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-3 r6, 20, -3 r6]], + sizegrowth = 0.1, + sizemod = 1.01, + texture = [[fire]], + drawOrder = -1, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.3, 1.0, 0.3]], + --gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], + numparticles = [[0.45 r0.75]], + particlelife = 19, + particlelifespread = 8, + particlesize = 32, + particlesizespread = 44, + particlespeed = 0.4, + particlespeedspread = 0.9, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,50 r60]], + texture = [[BARFlame02]], + pos = [[-2 r4, 32 r12, -2 r4]], + sizegrowth = [[1.9 d+10 r3.0]], + sizemod = 0.82, + drawOrder = 1, + }, + }, + }, + ["burnflamexl"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.2 r0.81]], + particlelife = 7, + particlelifespread = 12, + particlesize = 9, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-3 r6, 20, -3 r6]], + sizegrowth = 2, + sizemod = 0.99, + texture = [[fire]], + drawOrder = -1, + castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[-0.04 r0.08, 0.06 r0.08, -0.04 r0.08]], + numparticles = [[0.45 r0.75]], + particlelife = 25, + particlelifespread = 8, + particlesize = 26, + particlesizespread = 36, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,50 r60]], + pos = [[-2 r4, 32 r12, -2 r4]], + sizegrowth = [[2.5 d+9 r4.0]], + sizemod = 0.92, + texture = [[BARFlame02]], + drawOrder = 1, + }, + }, + }, + ["burnflamexl-gen"] = { + burnrandom = { + class = [[CExpGenSpawner]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r12]], + explosiongenerator = [[custom:burnflamexl]], + pos = [[-10 r20, 0 r20, -10 r20]], + }, + }, + }, - ["demonflame"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 30, - emitvector = [[dir]], - gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], - numparticles = [[0.2 r0.81]], - particlelife = 7, - particlelifespread = 12, - particlesize = 16, - particlesizespread = 20, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-4 r8, 23, -4 r8]], - sizegrowth = 0.1, - sizemod = 1.01, - texture = [[fire]], - drawOrder = -1, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - nounit = true, - properties = { - airdrag = 0.97, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 60, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[-0.03 r0.05, 0.07 r0.08, -0.03 r0.05]], - numparticles = [[0.40 r0.73]], - particlelife = 25, - particlelifespread = 8, - particlesize = 40, - particlesizespread = 50, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,50 r60]], - pos = [[-6 r12, 32 r12, -6 r12]], - sizegrowth = [[2.4 r3.0 d+20]], - sizemod = 0.82, - texture = [[BARFlame02]], - drawOrder = 1, - }, - }, - }, + ["burnflamel"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[0.2 r0.81]], + particlelife = 7, + particlelifespread = 12, + particlesize = 7, + particlesizespread = 11, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-3 r6, 20, -3 r6]], + sizegrowth = 2, + sizemod = 0.99, + texture = [[fire]], + drawOrder = -1, + castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[-0.04 r0.08, 0.06 r0.08, -0.04 r0.08]], + numparticles = [[0.45 r0.75]], + particlelife = 25, + particlelifespread = 8, + particlesize = 22, + particlesizespread = 30, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,50 r60]], + pos = [[-2 r4, 32 r12, -2 r4]], + sizegrowth = [[2.5 d+9 r4.0]], + sizemod = 0.92, + texture = [[BARFlame02]], + drawOrder = 1, + }, + }, + }, + ["burnflamel-gen"] = { + burnrandom = { + class = [[CExpGenSpawner]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r12]], + explosiongenerator = [[custom:burnflamel]], + pos = [[-10 r20, 0 r20, -10 r20]], + }, + }, + }, - ["burnfire"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.07, 0]], - numparticles = [[1 r2]], - particlelife = 8, - particlelifespread = 13, - particlesize = 9, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-10 r20, 30, -10 r20]], - sizegrowth = 3, - sizemod = 0.99, - texture = [[fire]], - drawOrder = 0, - --castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0.8, 0.7, 0.8]], - gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], - numparticles = [[2 r3]], - particlelife = 23, - particlelifespread = 13, - particlesize = 38, - particlesizespread = 56, - particlespeed = 0.9, - particlespeedspread = 1.2, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,60 r60]], - pos = [[-14 r28, 38 r12, -14 r28]], - sizegrowth = [[3.3 r5.0]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 70, - emitrotspread = 45, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], - numparticles = [[4 r10]], - particlelife = 9, - particlelifespread = 15, - particlesize = -24, - particlesizespread = -12, - particlespeed = 2, - particlespeedspread = 7, - pos = [[0, 20, 0]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 3, - }, - }, - }, + ["demonflame"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], + numparticles = [[0.2 r0.81]], + particlelife = 7, + particlelifespread = 12, + particlesize = 16, + particlesizespread = 20, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-4 r8, 23, -4 r8]], + sizegrowth = 0.1, + sizemod = 1.01, + texture = [[fire]], + drawOrder = -1, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + nounit = true, + properties = { + airdrag = 0.97, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 60, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[-0.03 r0.05, 0.07 r0.08, -0.03 r0.05]], + numparticles = [[0.40 r0.73]], + particlelife = 25, + particlelifespread = 8, + particlesize = 40, + particlesizespread = 50, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,50 r60]], + pos = [[-6 r12, 32 r12, -6 r12]], + sizegrowth = [[2.4 r3.0 d+20]], + sizemod = 0.82, + texture = [[BARFlame02]], + drawOrder = 1, + }, + }, + }, - ["burnfire-xs"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.06, 0]], - numparticles = [[1.5 r1]], - particlelife = 8, - particlelifespread = 12, - particlesize = 12, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-10 r20, 30, -10 r20]], - sizegrowth = 3, - sizemod = 0.99, - texture = [[fire]], - drawOrder = 0, - --castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0.8, 0.65, 0.8]], - gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], - numparticles = [[2 r2.5]], - particlelife = 20, - particlelifespread = 9, - particlesize = 42, - particlesizespread = 50, - particlespeed = 0.6, - particlespeedspread = 1.2, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,60 r60]], - pos = [[-14 r28, 38 r12, -14 r28]], - sizegrowth = [[3.3 r5.5]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 70, - emitrotspread = 45, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], - numparticles = [[2 r4]], - particlelife = 9, - particlelifespread = 15, - particlesize = -24, - particlesizespread = -12, - particlespeed = 2, - particlespeedspread = 7, - pos = [[0, 20, 0]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 3, - }, - }, - }, + ["burnfire"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.07, 0]], + numparticles = [[1 r2]], + particlelife = 8, + particlelifespread = 13, + particlesize = 9, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-10 r20, 30, -10 r20]], + sizegrowth = 3, + sizemod = 0.99, + texture = [[fire]], + drawOrder = 0, + --castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0.8, 0.7, 0.8]], + gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], + numparticles = [[2 r3]], + particlelife = 23, + particlelifespread = 13, + particlesize = 38, + particlesizespread = 56, + particlespeed = 0.9, + particlespeedspread = 1.2, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,60 r60]], + pos = [[-14 r28, 38 r12, -14 r28]], + sizegrowth = [[3.3 r5.0]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 70, + emitrotspread = 45, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], + numparticles = [[4 r10]], + particlelife = 9, + particlelifespread = 15, + particlesize = -24, + particlesizespread = -12, + particlespeed = 2, + particlespeedspread = 7, + pos = [[0, 20, 0]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 3, + }, + }, + }, - ["burnfirecom"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.07, 0]], - numparticles = [[1 r2]], - particlelife = 10, - particlelifespread = 13, - particlesize = 9, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-10 r20, 30, -10 r20]], - sizegrowth = 3, - sizemod = 0.99, - texture = [[fire]], - drawOrder = 0, - --castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0.8, 0.7, 0.8]], - gravity = [[-0.06 r0.12, 0.05 r0.07, -0.06 r0.12]], - numparticles = [[3 r4]], - particlelife = 26, - particlelifespread = 15, - particlesize = 38, - particlesizespread = 56, - particlespeed = 0.8, - particlespeedspread = 1.2, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,70 r50]], - pos = [[-14 r28, 38 r12, -14 r28]], - sizegrowth = [[3.1 r4.5]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 70, - emitrotspread = 45, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], - numparticles = [[5 r10]], - particlelife = 9, - particlelifespread = 15, - particlesize = -24, - particlesizespread = -12, - particlespeed = 2, - particlespeedspread = 7, - pos = [[0, 20, 0]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 3, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 8, - sizegrowth = [[-16 r7]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 2, - }, - }, - }, + ["burnfire-xs"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.06, 0]], + numparticles = [[1.5 r1]], + particlelife = 8, + particlelifespread = 12, + particlesize = 12, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-10 r20, 30, -10 r20]], + sizegrowth = 3, + sizemod = 0.99, + texture = [[fire]], + drawOrder = 0, + --castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0.8, 0.65, 0.8]], + gravity = [[-0.06 r0.12, 0.06 r0.08, -0.06 r0.12]], + numparticles = [[2 r2.5]], + particlelife = 20, + particlelifespread = 9, + particlesize = 42, + particlesizespread = 50, + particlespeed = 0.6, + particlespeedspread = 1.2, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,60 r60]], + pos = [[-14 r28, 38 r12, -14 r28]], + sizegrowth = [[3.3 r5.5]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 70, + emitrotspread = 45, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], + numparticles = [[2 r4]], + particlelife = 9, + particlelifespread = 15, + particlesize = -24, + particlesizespread = -12, + particlespeed = 2, + particlespeedspread = 7, + pos = [[0, 20, 0]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 3, + }, + }, + }, - ["burnfirecom-xl"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.07, 0]], - numparticles = [[2 r2]], - particlelife = 10, - particlelifespread = 13, - particlesize = 10, - particlesizespread = 16, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-15 r30, 30, -15 r30]], - sizegrowth = 3, - sizemod = 0.99, - texture = [[fire]], - drawOrder = 0, - --castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0.8, 0.7, 0.8]], - gravity = [[-0.06 r0.12, 0.05 r0.065, -0.06 r0.12]], - numparticles = [[4 r4]], - particlelife = 28, - particlelifespread = 17, - particlesize = 44, - particlesizespread = 64, - particlespeed = 0.8, - particlespeedspread = 1.2, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16, 6, 70 r50]], - pos = [[-18 r36, 38 r12, -18 r36]], - sizegrowth = [[3.1 r4.5]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 70, - emitrotspread = 45, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], - numparticles = [[6 r10]], - particlelife = 10, - particlelifespread = 16, - particlesize = -26, - particlesizespread = -14, - particlespeed = 3, - particlespeedspread = 8, - pos = [[0, 20, 0]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 3, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 8, - sizegrowth = [[-17 r8]], - ttl = 11, - pos = [[0, 22, 0]], - drawOrder = 2, - }, - }, - }, + ["burnfirecom"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.07, 0]], + numparticles = [[1 r2]], + particlelife = 10, + particlelifespread = 13, + particlesize = 9, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-10 r20, 30, -10 r20]], + sizegrowth = 3, + sizemod = 0.99, + texture = [[fire]], + drawOrder = 0, + --castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0.8, 0.7, 0.8]], + gravity = [[-0.06 r0.12, 0.05 r0.07, -0.06 r0.12]], + numparticles = [[3 r4]], + particlelife = 26, + particlelifespread = 15, + particlesize = 38, + particlesizespread = 56, + particlespeed = 0.8, + particlespeedspread = 1.2, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,70 r50]], + pos = [[-14 r28, 38 r12, -14 r28]], + sizegrowth = [[3.1 r4.5]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 70, + emitrotspread = 45, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], + numparticles = [[5 r10]], + particlelife = 9, + particlelifespread = 15, + particlesize = -24, + particlesizespread = -12, + particlespeed = 2, + particlespeedspread = 7, + pos = [[0, 20, 0]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 3, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 8, + sizegrowth = [[-16 r7]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 2, + }, + }, + }, - ["burnfire-bomb"] = { - extrafire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.15, - colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 1, - emitvector = [[dir]], - gravity = [[0, 0.07, 0]], - numparticles = [[1 r2]], - particlelife = 8, - particlelifespread = 13, - particlesize = 9, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-90 r180, -50 r100, -180 r360]], - pos = [[-10 r20, 30, -10 r20]], - sizegrowth = 3, - sizemod = 0.99, - texture = [[fire]], - drawOrder = 0, - --castShadow = true, - }, - }, - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], - --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.06 r0.12, 0.04 r0.06, -0.06 r0.12]], - numparticles = [[3 r4]], - particlelife = 32, - particlelifespread = 13, - particlesize = 44, - particlesizespread = 59, - particlespeed = 0.9, - particlespeedspread = 1.2, - rotParams = [[-24 r48, -60 r120, -180 r360]], - animParams = [[16,6,60 r60]], - pos = [[-14 r28, 38 r12, -14 r28]], - sizegrowth = [[4.0 r5.0]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], - directional = true, - emitrot = 70, - emitrotspread = 45, - emitvector = [[0.8, 0.6, 0.8]], - gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], - numparticles = [[5 r12]], - particlelife = 9, - particlelifespread = 15, - particlesize = -24, - particlesizespread = -12, - particlespeed = 4, - particlespeedspread = 13, - pos = [[0, 20, 0]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 3, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.4, - maxheat = 14, - pos = [[r-2 r2, 5, r-2 r2]], - size = 3, - sizegrowth = 12, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], - size = 70, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], - size = 140, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 110, - sizegrowth = 0, - ttl = 4, - texture = [[groundflash]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[1 0.9 0.6 0.11 0.9 0.5 0.2 0.08 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 8, - particlelife = 6, - particlelifespread = 13, - particlesize = 13, - particlesizespread = 20, - particlespeed = 0.99, - particlespeedspread = 2.3, - pos = [[0, 4, 0]], - sizegrowth = 0.44, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 10, - maxheat = 12, - heatFalloff = 1.5, - size = 4, - sizeGrowth = 8, - pos = [[r-10 r8, 16, r-10 r8]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 8, - sizegrowth = [[-14 r7]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 2, - }, - }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.05, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 40, - particlesize = 7, - particlesizespread = 25, - particlespeed = 2, - particlespeedspread = 4, - rotParams = [[-3 r6, -3 r6, -180 r360]], - pos = [[-18 r36, -30 r10, -18 r36]], - sizegrowth = [[5.0 r0.65]], - sizemod = 0.95, - texture = [[dirtrush]], - useairlos = true, - drawOrder = 1, - castShadow = true, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 4, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.94 0.64 0.27 0.86 0.93 0.62 0.25 0.65 0.07 0.05 0.05 0.61 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[47 r14]], - sidetexture = [[flamestream]], - size = [[36 r11]], - sizegrowth = 1.1, - ttl = [[24 r3]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 0, - castShadow = true, - }, - }, - }, + ["burnfirecom-xl"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.07, 0]], + numparticles = [[2 r2]], + particlelife = 10, + particlelifespread = 13, + particlesize = 10, + particlesizespread = 16, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-15 r30, 30, -15 r30]], + sizegrowth = 3, + sizemod = 0.99, + texture = [[fire]], + drawOrder = 0, + --castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.9 1 1 0.95 0.93 0.7 0.95 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0.8, 0.7, 0.8]], + gravity = [[-0.06 r0.12, 0.05 r0.065, -0.06 r0.12]], + numparticles = [[4 r4]], + particlelife = 28, + particlelifespread = 17, + particlesize = 44, + particlesizespread = 64, + particlespeed = 0.8, + particlespeedspread = 1.2, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16, 6, 70 r50]], + pos = [[-18 r36, 38 r12, -18 r36]], + sizegrowth = [[3.1 r4.5]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 70, + emitrotspread = 45, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], + numparticles = [[6 r10]], + particlelife = 10, + particlelifespread = 16, + particlesize = -26, + particlesizespread = -14, + particlespeed = 3, + particlespeedspread = 8, + pos = [[0, 20, 0]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 3, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 8, + sizegrowth = [[-17 r8]], + ttl = 11, + pos = [[0, 22, 0]], + drawOrder = 2, + }, + }, + }, + ["burnfire-bomb"] = { + extrafire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.15, + colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0.07, 0]], + numparticles = [[1 r2]], + particlelife = 8, + particlelifespread = 13, + particlesize = 9, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-90 r180, -50 r100, -180 r360]], + pos = [[-10 r20, 30, -10 r20]], + sizegrowth = 3, + sizemod = 0.99, + texture = [[fire]], + drawOrder = 0, + --castShadow = true, + }, + }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.7 0.023 0.022 0.022 0.3 0 0 0 0.01]], + --colormap = [[0.8 0.78 0.6 0.9 1.0 0.97 0.7 1 0.8 0.7 0.55 0.88 0.22 0.13 0.1 0.66 0.023 0.022 0.022 0.25 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.06 r0.12, 0.04 r0.06, -0.06 r0.12]], + numparticles = [[3 r4]], + particlelife = 32, + particlelifespread = 13, + particlesize = 44, + particlesizespread = 59, + particlespeed = 0.9, + particlespeedspread = 1.2, + rotParams = [[-24 r48, -60 r120, -180 r360]], + animParams = [[16,6,60 r60]], + pos = [[-14 r28, 38 r12, -14 r28]], + sizegrowth = [[4.0 r5.0]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.8 0.55 0.3 0.01 1 0.88 0.77 0.020 0 0 0 0]], + directional = true, + emitrot = 70, + emitrotspread = 45, + emitvector = [[0.8, 0.6, 0.8]], + gravity = [[-0.05 r0.1, 0.10 r0.20, -0.05 r0.1]], + numparticles = [[5 r12]], + particlelife = 9, + particlelifespread = 15, + particlesize = -24, + particlesizespread = -12, + particlespeed = 4, + particlespeedspread = 13, + pos = [[0, 20, 0]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 3, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.4, + maxheat = 14, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], + size = 70, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], + size = 140, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 110, + sizegrowth = 0, + ttl = 4, + texture = [[groundflash]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[1 0.9 0.6 0.11 0.9 0.5 0.2 0.08 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 8, + particlelife = 6, + particlelifespread = 13, + particlesize = 13, + particlesizespread = 20, + particlespeed = 0.99, + particlespeedspread = 2.3, + pos = [[0, 4, 0]], + sizegrowth = 0.44, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 10, + maxheat = 12, + heatFalloff = 1.5, + size = 4, + sizeGrowth = 8, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 8, + sizegrowth = [[-14 r7]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 2, + }, + }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.05, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 40, + particlesize = 7, + particlesizespread = 25, + particlespeed = 2, + particlespeedspread = 4, + rotParams = [[-3 r6, -3 r6, -180 r360]], + pos = [[-18 r36, -30 r10, -18 r36]], + sizegrowth = [[5.0 r0.65]], + sizemod = 0.95, + texture = [[dirtrush]], + useairlos = true, + drawOrder = 1, + castShadow = true, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 4, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.94 0.64 0.27 0.86 0.93 0.62 0.25 0.65 0.07 0.05 0.05 0.61 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[47 r14]], + sidetexture = [[flamestream]], + size = [[36 r11]], + sizegrowth = 1.1, + ttl = [[24 r3]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 0, + castShadow = true, + }, + }, + }, } - diff --git a/effects/cannons.lua b/effects/cannons.lua index d0162a4ccaf..990e033ca3f 100644 --- a/effects/cannons.lua +++ b/effects/cannons.lua @@ -3,681 +3,679 @@ local definitions = { ["cannonblaze-small"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-1.9 r0.2]], - --pos = [[-4, 0, 0]], - sidetexture = [[shot]], - size = 5.9, - sizegrowth = [[-0.2 r0.1]], - ttl = 1, - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 3, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-1.9 r0.2]], + --pos = [[-4, 0, 0]], + sidetexture = [[shot]], + size = 5.9, + sizegrowth = [[-0.2 r0.1]], + ttl = 1, + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 3, particlelifespread = 5, - particlesize = 13, + particlesize = 13, particlesizespread = 10, - particlespeed = 1.2, + particlespeed = 1.2, particlespeedspread = 1.2, - pos = [[0, 0, 0]], - sizegrowth = 0.77, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = true, - }, - }, - fireback = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0.9 0.50 0.10 0.01 0.95 0.65 0.4 0.019 0.95 0.45 0.08 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], - directional = true, - emitrot = 20, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 5, - particlesize = 3.0, - particlesizespread = 0, - particlespeed = 0.5, - particlespeedspread = 0.5, - pos = [[-4, -1, 0]], - sizegrowth = -0.8, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - + pos = [[0, 0, 0]], + sizegrowth = 0.77, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = true, + }, + }, + fireback = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0.9 0.50 0.10 0.01 0.95 0.65 0.4 0.019 0.95 0.45 0.08 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], + directional = true, + emitrot = 20, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 5, + particlesize = 3.0, + particlesizespread = 0, + particlespeed = 0.5, + particlespeedspread = 0.5, + pos = [[-4, -1, 0]], + sizegrowth = -0.8, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, }, ["impulse-trail"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.75 0.4 0.006 0.8 0.70 0.3 0.005 0.8 0.5 0.1 0.005 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -2.8, - sidetexture = [[trail]], - size = 5.5, - sizegrowth = -0.09, - ttl = 3, - useairlos = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.75 0.4 0.006 0.8 0.70 0.3 0.005 0.8 0.5 0.1 0.005 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -2.8, + sidetexture = [[trail]], + size = 5.5, + sizegrowth = -0.09, + ttl = 3, + useairlos = true, + }, + }, }, ["arty-fast"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.75 0.3 0.0 0.9 0.75 0.3 0.009 0.9 0.7 0.2 0.007 0.9 0.3 0.1 0.004 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -3.8, - sidetexture = [[trail]], - size = 1.8, - sizegrowth = -0.05, - ttl = 5, - useairlos = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.75 0.3 0.0 0.9 0.75 0.3 0.009 0.9 0.7 0.2 0.007 0.9 0.3 0.1 0.004 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -3.8, + sidetexture = [[trail]], + size = 1.8, + sizegrowth = -0.05, + ttl = 5, + useairlos = true, + }, + }, }, ["Heavy-Plasma"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.8 0.3 0.1 0.004 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.03 - fronttexture = [[null]], --glow - length = -1.5, - sidetexture = [[trail]], - size = 14, - sizegrowth = 0.0, - ttl = 3, - useairlos = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.8 0.3 0.1 0.004 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.03 + fronttexture = [[null]], --glow + length = -1.5, + sidetexture = [[trail]], + size = 14, + sizegrowth = 0.0, + ttl = 3, + useairlos = true, + castShadow = true, + }, + }, }, ["arty-small"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.75 0.4 0.0 0.9 0.75 0.4 0.00.9 0.75 0.4 0.006 0.8 0.70 0.3 0.005 0.8 0.5 0.1 0.005 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -3.9, - sidetexture = [[trail]], - size = 2.5, - sizegrowth = -0.16, - ttl = 3, - useairlos = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.75 0.4 0.0 0.9 0.75 0.4 0.00.9 0.75 0.4 0.006 0.8 0.70 0.3 0.005 0.8 0.5 0.1 0.005 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -3.9, + sidetexture = [[trail]], + size = 2.5, + sizegrowth = -0.16, + ttl = 3, + useairlos = true, + }, + }, }, - ["arty-medium"] = { + ["arty-medium"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0 0.9 0.65 0.3 0.006 0.9 0.6 0.2 0.005 0.8 0.3 0.1 0.004 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = -4.2, - sidetexture = [[trail]], - size = 4.2, - sizegrowth = -0.09, - ttl = 4, - useairlos = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0 0.9 0.65 0.3 0.006 0.9 0.6 0.2 0.005 0.8 0.3 0.1 0.004 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -4.2, + sidetexture = [[trail]], + size = 4.2, + sizegrowth = -0.09, + ttl = 4, + useairlos = true, + castShadow = true, + }, + }, }, ["arty-large"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.8 0.3 0.1 0.004 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.03 - fronttexture = [[null]], --glow - length = -4.9, - sidetexture = [[trail]], - size = 5.5, - sizegrowth = -0.09, - ttl = 4, - useairlos = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.8 0.3 0.1 0.004 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.03 + fronttexture = [[null]], --glow + length = -4.9, + sidetexture = [[trail]], + size = 5.5, + sizegrowth = -0.09, + ttl = 4, + useairlos = true, + castShadow = true, + }, + }, }, ["arty-heavy"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.9 0.3 0.1 0.005 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.05 - fronttexture = [[null]], --glow - length = -5.5, - sidetexture = [[trail]], - size = 7.2, - sizegrowth = -0.09, - ttl = 4, - useairlos = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.0 0.9 0.65 0.3 0.007 0.9 0.6 0.2 0.006 0.9 0.3 0.1 0.005 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.05 + fronttexture = [[null]], --glow + length = -5.5, + sidetexture = [[trail]], + size = 7.2, + sizegrowth = -0.09, + ttl = 4, + useairlos = true, + castShadow = true, + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 3, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 3, particlelifespread = 3, - particlesize = 14, + particlesize = 14, particlesizespread = 18, - particlespeed = 1.1, + particlespeed = 1.1, particlespeedspread = 1.5, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.7, - texture = [[gunshotglow]], - useairlos = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.7, + texture = [[gunshotglow]], + useairlos = true, + }, + }, }, ["arty-extraheavy"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.008 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.05 - fronttexture = [[null]], --glow - length = -5.8, - sidetexture = [[trail]], - size = 17, - sizegrowth = -0.20, - ttl = 2, - useairlos = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.008 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.05 + fronttexture = [[null]], --glow + length = -5.8, + sidetexture = [[trail]], + size = 17, + sizegrowth = -0.20, + ttl = 2, + useairlos = true, + castShadow = true, + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 3, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 3, particlelifespread = 3, - particlesize = 14, + particlesize = 14, particlesizespread = 18, - particlespeed = 1.1, + particlespeed = 1.1, particlespeedspread = 1.5, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.7, - texture = [[gunshotglow]], - useairlos = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.7, + texture = [[gunshotglow]], + useairlos = true, + }, + }, }, ["arty-huge"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[null]], --was glow before - length = -6, - sidetexture = [[shot]], - size = 20.2, - sizegrowth = -0.20, - ttl = 2, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 3, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.65 0.3 0.01 0.9 0.6 0.2 0.01 0.9 0.3 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[null]], --was glow before + length = -6, + sidetexture = [[shot]], + size = 20.2, + sizegrowth = -0.20, + ttl = 2, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 3, particlelifespread = 4, - particlesize = 26, + particlesize = 26, particlesizespread = 26, - particlespeed = 1.5, + particlespeed = 1.5, particlespeedspread = 2.0, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = true, - castShadow = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = true, + castShadow = true, + }, + }, }, ["arty-botrail"] = { fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.44 0.48 1 0.2 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 0, - particlesize = 35, - particlesizespread = 10, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -5, - sizemod = 1, - texture = [[glow]], - useairlos = true, - }, - }, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.44 0.48 1 0.2 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 0, + particlesize = 35, + particlesizespread = 10, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -5, + sizemod = 1, + texture = [[glow]], + useairlos = true, + }, + }, flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.49 0.49 0.9 0.01 0.44 0.44 0.9 0.01 0.35 0.35 0.88 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0.1, - fronttexture = [[blastwave]], - length = -5.8, - sidetexture = [[shot]], - size = 5.2, - sizegrowth = -0.15, - ttl = 9, - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.5 0.52 1 0.017 0.3 0.3 0.8 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 3, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.49 0.49 0.9 0.01 0.44 0.44 0.9 0.01 0.35 0.35 0.88 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.1, + fronttexture = [[blastwave]], + length = -5.8, + sidetexture = [[shot]], + size = 5.2, + sizegrowth = -0.15, + ttl = 9, + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.5 0.52 1 0.017 0.3 0.3 0.8 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 3, particlelifespread = 4, - particlesize = 30, + particlesize = 30, particlesizespread = 30, - particlespeed = 1.5, + particlespeed = 1.5, particlespeedspread = 2.0, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = true, + }, + }, }, ["railgun"] = { - shockwaves = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.67 0.48 1 0.01 0.27 0.58 0.89 0.03 0.15 0.19 0.35 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = [[0.4 r0.2]], - fronttexture = [[bubbletexture]], - length = [[0.9 r0.6]], - sidetexture = [[longshot]], - size = [[5 r4.1]], - sizegrowth = 0.65, - ttl = [[18 r6]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.67 0.82 0 0.01 0.27 0.58 0.89 0.01 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 10, + shockwaves = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.67 0.48 1 0.01 0.27 0.58 0.89 0.03 0.15 0.19 0.35 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = [[0.4 r0.2]], + fronttexture = [[bubbletexture]], + length = [[0.9 r0.6]], + sidetexture = [[longshot]], + size = [[5 r4.1]], + sizegrowth = 0.65, + ttl = [[18 r6]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.67 0.82 0 0.01 0.27 0.58 0.89 0.01 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 10, particlelifespread = 15, - particlesize = 30, + particlesize = 30, particlesizespread = 30, - particlespeed = 1.5, + particlespeed = 1.5, particlespeedspread = 2.0, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = true, + }, + }, }, ["railgun-old"] = { - lightningtrail = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0 0 0 0 0 1 0.85 0.6 0.22 1 0.63 0.3 0.12 0.54 0.52 0.4 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.05, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 10, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 3, - sizemod = 0.90, - texture = [[lightning]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 3, + lightningtrail = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0 0 0 0 0 1 0.85 0.6 0.22 1 0.63 0.3 0.12 0.54 0.52 0.4 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.05, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 3, + sizemod = 0.90, + texture = [[lightning]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 3, particlelifespread = 4, - particlesize = 30, + particlesize = 30, particlesizespread = 30, - particlespeed = 1.5, + particlespeed = 1.5, particlespeedspread = 2.0, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = true, - }, - }, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = true, + }, + }, }, - ["starfire"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.6 1 0.04 0.65 0.65 1 0.02 0.3 0.4 0.8 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[glow]], --glow - length = -18, - sidetexture = [[shot-trail]], - size = 9.2, - sizegrowth = -0.16, - ttl = 3, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.67, - colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.9 0.011 0 0 0 0]], - directional = false, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.55 r0.7]], - particlelife = 4, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.6 1 0.04 0.65 0.65 1 0.02 0.3 0.4 0.8 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -18, + sidetexture = [[shot-trail]], + size = 9.2, + sizegrowth = -0.16, + ttl = 3, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.67, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.9 0.011 0 0 0 0]], + directional = false, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.55 r0.7]], + particlelife = 4, particlelifespread = 5, - particlesize = 7, + particlesize = 7, particlesizespread = 14, - particlespeed = 1.5, + particlespeed = 1.5, particlespeedspread = 2.0, - pos = [[0, 0, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 1.7, - sizemod = 0.9, - texture = [[gunshotxl]], - useairlos = true, - castShadow = true, - }, - }, + pos = [[0, 0, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 1.7, + sizemod = 0.9, + texture = [[gunshotxl]], + useairlos = true, + castShadow = true, + }, + }, }, ["starfire-small"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.3 0.45 1 0.01 0.5 0.5 1 0.01 0.7 0.7 1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[glow]], --glow - length = -9, - sidetexture = [[shot-trail]], - size = 7, - sizegrowth = -0.18, - ttl = 3, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], - directional = false, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, --[[0.6 r0.75]] - particlelife = 5, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.3 0.45 1 0.01 0.5 0.5 1 0.01 0.7 0.7 1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -9, + sidetexture = [[shot-trail]], + size = 7, + sizegrowth = -0.18, + ttl = 3, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], + directional = false, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, --[[0.6 r0.75]] + particlelife = 5, particlelifespread = 0, - particlesize = 18, + particlesize = 18, particlesizespread = 5, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0, 0, 0]], - sizegrowth = -2.8, - sizemod = 1, - texture = [[bubbletexture]], - useairlos = true, + pos = [[0, 0, 0]], + sizegrowth = -2.8, + sizemod = 1, + texture = [[bubbletexture]], + useairlos = true, --castShadow = true, - }, - }, - -- sparks-old = { + }, + }, + -- sparks-old = { -- air = true, -- class = [[CSimpleParticleSystem]], -- count = 1, @@ -705,217 +703,217 @@ local definitions = { -- texture = [[gunshotglow]], -- useairlos = true, -- castShadow = true, - -- }, - -- }, + -- }, + -- }, }, - ["starfire_tiny"] = { + ["starfire_tiny"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[glow]], --glow - length = -6, - sidetexture = [[shot-trail]], - size = 6, - sizegrowth = -0.06, - ttl = 2, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], - directional = false, - emitrot = 20, - emitrotspread = 25, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, --[[0.6 r0.75]] - particlelife = 3, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -6, + sidetexture = [[shot-trail]], + size = 6, + sizegrowth = -0.06, + ttl = 2, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], + directional = false, + emitrot = 20, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, --[[0.6 r0.75]] + particlelife = 3, particlelifespread = 0, - particlesize = 6, + particlesize = 6, particlesizespread = 0, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0, 0, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[bubbletexture]], - useairlos = true, + pos = [[0, 0, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[bubbletexture]], + useairlos = true, --castShadow = true, - }, - }, + }, + }, }, ["ministarfire"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[glow]], --glow - length = -10, - sidetexture = [[shot-trail]], - size = 2.2, - sizegrowth = -0.18, - ttl = 2, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.67, - colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], - directional = false, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 2, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -10, + sidetexture = [[shot-trail]], + size = 2.2, + sizegrowth = -0.18, + ttl = 2, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.67, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], + directional = false, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 2, particlelifespread = 0, - particlesize = 7, + particlesize = 7, particlesizespread = 0, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0, 0, 0]], + pos = [[0, 0, 0]], --rotParams = [[-5 r10, -5 r10, 0]], - sizegrowth = -1.9, - sizemod = 1, - texture = [[bubbletexture]], - useairlos = true, + sizegrowth = -1.9, + sizemod = 1, + texture = [[bubbletexture]], + useairlos = true, --castShadow = true, - }, - }, + }, + }, }, - ["starfire_arty"] = { + ["starfire_arty"] = { flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], - dir = [[dir]], - frontoffset = 0, --0.04 - fronttexture = [[glow]], --glow - length = -8, - sidetexture = [[shot-trail]], - size = 8.2, - sizegrowth = -0.06, - ttl = 2, - --rotParams = [[0 , 0, -180 r360]], - useairlos = true, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], - directional = false, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, --[[0.6 r0.75]] - particlelife = 4, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -8, + sidetexture = [[shot-trail]], + size = 8.2, + sizegrowth = -0.06, + ttl = 2, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], + directional = false, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, --[[0.6 r0.75]] + particlelife = 4, particlelifespread = 0, - particlesize = 10, + particlesize = 10, particlesizespread = 0, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0, 0, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[bubbletexture]], - useairlos = true, + pos = [[0, 0, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[bubbletexture]], + useairlos = true, --castShadow = true, - }, - }, + }, + }, }, } -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - flame = { - properties = { - colormap = [[0.8 0.5 1 0.01 0.65 0.2 0.9 0.01 0.35 0.07 0.6 0.01 0 0 0 0.01]], - }, - }, - -- fireback = { - -- properties = { - -- colormap = [[0.8 0.45 1 0.01 0.8 0.45 1 0.019 0.65 0.2 0.9 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], - -- }, - -- }, - -- traillight = { - -- properties = { - -- colormap = [[0.8 0.45 1 0.01 0.8 0.45 1 0.019 0.65 0.2 0.9 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], - -- }, - -- }, + flame = { + properties = { + colormap = [[0.8 0.5 1 0.01 0.65 0.2 0.9 0.01 0.35 0.07 0.6 0.01 0 0 0 0.01]], + }, + }, + -- fireback = { + -- properties = { + -- colormap = [[0.8 0.45 1 0.01 0.8 0.45 1 0.019 0.65 0.2 0.9 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], + -- }, + -- }, + -- traillight = { + -- properties = { + -- colormap = [[0.8 0.45 1 0.01 0.8 0.45 1 0.019 0.65 0.2 0.9 0.006 0.05 0.05 0.05 0.005 0 0 0 0]], + -- }, + -- }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/commander-levelup.lua b/effects/commander-levelup.lua index 169659f17b1..045a0b77f6d 100644 --- a/effects/commander-levelup.lua +++ b/effects/commander-levelup.lua @@ -1,283 +1,281 @@ - return { - ["commander-levelup"] = { - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.8 1 0.3 0.5 0 0 0 0.01]], - size = 77, - sizegrowth = -0.7, - ttl = 100, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.66 1 0.3 0.28 0 0 0 0.01]], - size = 120, - sizegrowth = -0.7, - ttl = 120, - texture = [[groundflash]], - }, - }, - --dustparticles = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.88, - -- colormap = [[0.4 1 0.3 0.22 0.52 1 0.25 0.12 0.66 1 0.2 0.06 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0.5, 1, 0.5]], - -- gravity = [[0, -0.011, 0]], - -- numparticles = 1, - -- particlelife = 4, - -- particlelifespread = 1.4, - -- particlesize = 1.5, - -- particlesizespread = 0.25, - -- particlespeed = 0.23, - -- particlespeedspread = 0.11, - -- pos = [[0, 0, 0]], - -- sizegrowth = 2.2, - -- sizemod = 1.0, - -- texture = [[randomdots]], - -- }, - --}, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.66, - alwaysVisible = 0, - sizeGrowth = 0.66, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[0.55 1 0.35 0.1 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=22, - particleLifeSpread=75, - numparticles=4, - particleSpeed=0.6, - particleSpeedSpread=6.4, - particleSize=8, - particleSizeSpread=14, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.66, - alwaysVisible = 0, - sizeGrowth = 0.2, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[0.5 1 0.3 0.1 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=17, - particleLifeSpread=60, - numparticles=7, - particleSpeed=2.2, - particleSpeedSpread=6.4, - particleSize=20, - particleSizeSpread=14, - directional=0, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[3 r1]], - particlelife = 25, - particlelifespread = 90, - particlesize = 2, - particlesizespread = 2, - particlespeed = 3.5, - particlespeedspread = 5.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[4 r1]], - particlelife = 25, - particlelifespread = 90, - particlesize = 2, - particlesizespread = 2, - particlespeed = 3.5, - particlespeedspread = 5.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[3 r1]], - particlelife = 25, - particlelifespread = 90, - particlesize = 2, - particlesizespread = 2, - particlespeed = 3.5, - particlespeedspread = 5.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - --grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- properties = { - -- airdrag = 0.91, - -- colormap = [[0.085 0.085 0.085 0.13 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.005, 0]], - -- numparticles = 16, - -- particlelife = 20, - -- particlelifespread = 30, - -- particlesize = 5, - -- particlesizespread = 2.5, - -- particlespeed = 5, - -- particlespeedspread = 1.4, - -- pos = [[0, 4, 0]], - -- sizegrowth = 0.55, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - confetti = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], - directional = true, - emitrot = 17, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 4, - particlelife = 20, - particlelifespread = 90, - particlesize = 0.8, - particlesizespread = 1, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, - }, - }, - glitter = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 ]], - directional = true, - emitrot = 14, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 7, - particlelife = 28, - particlelifespread = 90, - particlesize = 0.8, - particlesizespread = 0.6, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, - }, - } - } + ["commander-levelup"] = { + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.8 1 0.3 0.5 0 0 0 0.01]], + size = 77, + sizegrowth = -0.7, + ttl = 100, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.66 1 0.3 0.28 0 0 0 0.01]], + size = 120, + sizegrowth = -0.7, + ttl = 120, + texture = [[groundflash]], + }, + }, + --dustparticles = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.88, + -- colormap = [[0.4 1 0.3 0.22 0.52 1 0.25 0.12 0.66 1 0.2 0.06 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0.5, 1, 0.5]], + -- gravity = [[0, -0.011, 0]], + -- numparticles = 1, + -- particlelife = 4, + -- particlelifespread = 1.4, + -- particlesize = 1.5, + -- particlesizespread = 0.25, + -- particlespeed = 0.23, + -- particlespeedspread = 0.11, + -- pos = [[0, 0, 0]], + -- sizegrowth = 2.2, + -- sizemod = 1.0, + -- texture = [[randomdots]], + -- }, + --}, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.66, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[0.55 1 0.35 0.1 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 22, + particleLifeSpread = 75, + numparticles = 4, + particleSpeed = 0.6, + particleSpeedSpread = 6.4, + particleSize = 8, + particleSizeSpread = 14, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.66, + alwaysVisible = 0, + sizeGrowth = 0.2, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[0.5 1 0.3 0.1 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 17, + particleLifeSpread = 60, + numparticles = 7, + particleSpeed = 2.2, + particleSpeedSpread = 6.4, + particleSize = 20, + particleSizeSpread = 14, + directional = 0, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[3 r1]], + particlelife = 25, + particlelifespread = 90, + particlesize = 2, + particlesizespread = 2, + particlespeed = 3.5, + particlespeedspread = 5.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[4 r1]], + particlelife = 25, + particlelifespread = 90, + particlesize = 2, + particlesizespread = 2, + particlespeed = 3.5, + particlespeedspread = 5.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[3 r1]], + particlelife = 25, + particlelifespread = 90, + particlesize = 2, + particlesizespread = 2, + particlespeed = 3.5, + particlespeedspread = 5.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + --grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- properties = { + -- airdrag = 0.91, + -- colormap = [[0.085 0.085 0.085 0.13 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.005, 0]], + -- numparticles = 16, + -- particlelife = 20, + -- particlelifespread = 30, + -- particlesize = 5, + -- particlesizespread = 2.5, + -- particlespeed = 5, + -- particlespeedspread = 1.4, + -- pos = [[0, 4, 0]], + -- sizegrowth = 0.55, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + confetti = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[1 1 0 0.01 0.5 1 0 0.1 1 1 0 0.1 1 0.6 0.2 0.1 0.4 1 0 0.01 0 1 0 0.01 0.4 1 0.2 0.01 0.8 0.7 0 0.01 0.8 1 0 0.01 0 1 0 0.1 1 0.7 0.1 0.01 0.6 0.7 0.1 0.01 0.5 0.7 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 17, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 4, + particlelife = 20, + particlelifespread = 90, + particlesize = 0.8, + particlesizespread = 1, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, + }, + }, + glitter = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0.7 1 0.3 0.01 0 0 0 0.01 ]], + directional = true, + emitrot = 14, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 7, + particlelife = 28, + particlelifespread = 90, + particlesize = 0.8, + particlesizespread = 0.6, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, + }, + }, + }, } - diff --git a/effects/commander-spawn-alwaysvisible.lua b/effects/commander-spawn-alwaysvisible.lua index a975fda97d6..3a5afe56872 100644 --- a/effects/commander-spawn-alwaysvisible.lua +++ b/effects/commander-spawn-alwaysvisible.lua @@ -1,648 +1,646 @@ - return { - ["commander-spawn-alwaysvisible-explo"] = { - fireglowbright = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0, 0.0]], - numparticles = 2, - particlelife = 60, - particlelifespread = 10, - particlesize = 320, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 5, - pos = [[0.0, 30, 0.0]], - sizegrowth = 1.20, - sizemod = 0.98, - texture = [[glow2]], - useairlos = true, - alwaysvisible = true, - drawOrder = 1, - }, - }, - firespawnbright = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[glow2]], - length = 200, - sidetexture = [[laser]], - size = 240, - sizegrowth = -0.5, - ttl = 60, - pos = [[0, 30, 0]], - rotParams = [[-280 r50, -10 r20, 0 r90]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.8, - maxheat = 11, - pos = [[r-10 r10, 50, r-10 r10]], - size = 17, - sizegrowth = 11, - speed = [[0, 1 0, 0]], - texture = [[dirt]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - pop2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.4 0.45 0.45 0.45 0.20 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 20, - sidetexture = [[none]], - size = 24, - sizegrowth = 7, - ttl = 14, - pos = [[0, 20, 0]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - -- pop1 = { - -- class = [[CHeatCloudProjectile]], - -- air=1, - -- water=1, - -- ground=1, - -- count=0, - -- properties ={ - -- alwaysVisible=0, - -- texture=[[blastwave]], - -- heat = 9, - -- maxheat = 11, - -- heatFalloff = 0.8, - -- size = 12, - -- sizeGrowth = 18, - -- pos = [[r-10 r10, 0, r-10 r10]], - -- speed=[[0, 0, 0]], - -- }, - -- }, - groundflash_large_long = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.82 0.82 0.82 0.45 0.7 0.7 0.7 0.30 0 0 0 0.01]], - size = 300, - ttl = 300, - sizegrowth = 1.5, - texture = [[groundflashwhite]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], - size = 120, - sizegrowth = 0, - ttl = 90, - texture = [[groundflashwhite]], - alwaysvisible = true, - }, - }, - groundflash_scarglow = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.40 0.45 .50 0.09 0.5 0.60 0.70 0.65 0.5 0.60 0.70 0.55 0 0 0 0.01]], - size = 80, - sizegrowth = 0, - ttl = 130, - texture = [[scar50glow]], - alwaysvisible = true, - }, - }, - groundflash_scar = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.95 0.9 0.9 0.9 0.94 0.9 0.9 0.9 0.93 0.9 0.9 0.9 0.90 0.1 0.1 0.1 0.5 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[scar50]], - length = 20, - sidetexture = [[none]], - size = 80, - sizegrowth = 0, - ttl = 800, - pos = [[0, 5, 0]], - alwaysvisible = true, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - -- explosion_flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.01, 0]], - -- numparticles = 11, - -- particlelife = 30, - -- particlelifespread = 16, - -- particlesize = 22, - -- particlesizespread = 39, - -- particlespeed = 7, - -- particlespeedspread = 7, - -- pos = [[0, 15, 0]], - -- sizegrowth = -0.3, - -- sizemod = 1, - -- texture = [[flashside3]], - -- useairlos = false, - -- alwaysvisible = true, - -- }, - -- }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 20, - particlelifespread = 25, - particlesize = 22, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.92, - colormap = [[0.8 0.8 0.8 0.02 0.75 0.75 0.75 0.03 0.55 0.55 0.55 0.03 0.15 0.15 0.15 0.005 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 13, - particlelife = 24, - particlelifespread = 14, - particlesize = -20, - particlesizespread = -35, - particlespeed = 14.5, - particlespeedspread = 11, - pos = [[0, 4, 0]], - sizegrowth = 0.11, - sizemod = 0.98, - texture = [[gunshotxl2]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[blastwave]], - useairlos = false, - alwaysvisible = true, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.8 0.8 0.8 0.02 0.65 0.65 0.65 0.015 0.25 0.25 0.25 0.012 0.12 0.12 0.12 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 400, - sidetexture = [[blastwave]], - size = 4, - sizegrowth = [[-34 r4]], - ttl = 32, - pos = [[0, 25, 0]], - alwaysvisible = true, - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.015 0.3 0.3 0.3 0.012 0.1 0.1 0.1 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 2.4, - sizegrowth = [[-47 r7]], - ttl = 18, - pos = [[0, 45, 0]], - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = 3, - particlelife = 26, - particlelifespread = 25, - particlesize = 30, - particlesizespread = -3.6, - particlespeed = 4, - particlespeedspread = 10, - pos = [[0, 3, 0]], - rotParams = [[-24 r48, -10 r20, 180 r360]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.04, 0]], - numparticles = 5, - particlelife = 70, - particlelifespread = 120, - particlesize = 30, - particlesizespread = 55, - particlespeed = 1.8, - particlespeedspread = 6, - pos = [[0, 40, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 1 1 0.22 0.8 0.8 0.8 0.12 0.5 0.5 0.5 0.06 0 0 0 0.1]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 8, - particlelife = 30, - particlelifespread = 5.75, - particlesize = 15, - particlesizespread = 40, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - rotParams = [[-24 r48, -10 r20, 180 r360]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - -- junoring = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 3, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[1 r300]], - -- explosiongenerator = [[custom:junoring]], - -- pos = [[0 r0, 20 r20, 0]], - -- alwaysvisible = true, - -- }, - -- }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.5 0.5 0.5 0.22 0.30 0.30 0.30 0.10 0.2 0.2 0.2 0.009 0.1 0.1 0.1 0.008 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 75, - sizegrowth = 0.68, - ttl = 50, - pos = [[0, 20, 0]], - alwaysvisible = true, - }, - }, - -- junocloudspawn = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 15, - -- ground = true, - -- water = true, - -- underwater = false, - -- properties = { - -- delay = [[1 r770]], - -- explosiongenerator = [[custom:junocloud]], - -- pos = [[-50 r100, 10 r25, 0 r150]], - -- alwaysvisible = true, - -- }, - -- }, - -- Lightning is now rendered by the GL4 gadget "Environmental Lightning GL4" - -- via GG.SpawnEnvironmentalLightning("commanderspawn", ...), called from the - -- gadgets that spawn this CEG. The old electricstorm CEG below is disabled. - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 25, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[6 r70]], - -- explosiongenerator = [[custom:lightning_stormbigalt]], - -- pos = [[-120 r240, 30 r30, -120 r240]], - -- alwaysvisible = true, - -- }, - -- }, - }, + ["commander-spawn-alwaysvisible-explo"] = { + fireglowbright = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0, 0.0]], + numparticles = 2, + particlelife = 60, + particlelifespread = 10, + particlesize = 320, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 5, + pos = [[0.0, 30, 0.0]], + sizegrowth = 1.20, + sizemod = 0.98, + texture = [[glow2]], + useairlos = true, + alwaysvisible = true, + drawOrder = 1, + }, + }, + firespawnbright = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[glow2]], + length = 200, + sidetexture = [[laser]], + size = 240, + sizegrowth = -0.5, + ttl = 60, + pos = [[0, 30, 0]], + rotParams = [[-280 r50, -10 r20, 0 r90]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.8, + maxheat = 11, + pos = [[r-10 r10, 50, r-10 r10]], + size = 17, + sizegrowth = 11, + speed = [[0, 1 0, 0]], + texture = [[dirt]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + pop2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.4 0.45 0.45 0.45 0.20 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 20, + sidetexture = [[none]], + size = 24, + sizegrowth = 7, + ttl = 14, + pos = [[0, 20, 0]], + alwaysvisible = true, + drawOrder = 2, + }, + }, + -- pop1 = { + -- class = [[CHeatCloudProjectile]], + -- air=1, + -- water=1, + -- ground=1, + -- count=0, + -- properties ={ + -- alwaysVisible=0, + -- texture=[[blastwave]], + -- heat = 9, + -- maxheat = 11, + -- heatFalloff = 0.8, + -- size = 12, + -- sizeGrowth = 18, + -- pos = [[r-10 r10, 0, r-10 r10]], + -- speed=[[0, 0, 0]], + -- }, + -- }, + groundflash_large_long = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.82 0.82 0.82 0.45 0.7 0.7 0.7 0.30 0 0 0 0.01]], + size = 300, + ttl = 300, + sizegrowth = 1.5, + texture = [[groundflashwhite]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], + size = 120, + sizegrowth = 0, + ttl = 90, + texture = [[groundflashwhite]], + alwaysvisible = true, + }, + }, + groundflash_scarglow = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.40 0.45 .50 0.09 0.5 0.60 0.70 0.65 0.5 0.60 0.70 0.55 0 0 0 0.01]], + size = 80, + sizegrowth = 0, + ttl = 130, + texture = [[scar50glow]], + alwaysvisible = true, + }, + }, + groundflash_scar = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.95 0.9 0.9 0.9 0.94 0.9 0.9 0.9 0.93 0.9 0.9 0.9 0.90 0.1 0.1 0.1 0.5 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[scar50]], + length = 20, + sidetexture = [[none]], + size = 80, + sizegrowth = 0, + ttl = 800, + pos = [[0, 5, 0]], + alwaysvisible = true, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + -- explosion_flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.01, 0]], + -- numparticles = 11, + -- particlelife = 30, + -- particlelifespread = 16, + -- particlesize = 22, + -- particlesizespread = 39, + -- particlespeed = 7, + -- particlespeedspread = 7, + -- pos = [[0, 15, 0]], + -- sizegrowth = -0.3, + -- sizemod = 1, + -- texture = [[flashside3]], + -- useairlos = false, + -- alwaysvisible = true, + -- }, + -- }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 25, + particlesize = 22, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.92, + colormap = [[0.8 0.8 0.8 0.02 0.75 0.75 0.75 0.03 0.55 0.55 0.55 0.03 0.15 0.15 0.15 0.005 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 13, + particlelife = 24, + particlelifespread = 14, + particlesize = -20, + particlesizespread = -35, + particlespeed = 14.5, + particlespeedspread = 11, + pos = [[0, 4, 0]], + sizegrowth = 0.11, + sizemod = 0.98, + texture = [[gunshotxl2]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[blastwave]], + useairlos = false, + alwaysvisible = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.8 0.8 0.8 0.02 0.65 0.65 0.65 0.015 0.25 0.25 0.25 0.012 0.12 0.12 0.12 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 400, + sidetexture = [[blastwave]], + size = 4, + sizegrowth = [[-34 r4]], + ttl = 32, + pos = [[0, 25, 0]], + alwaysvisible = true, + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.015 0.3 0.3 0.3 0.012 0.1 0.1 0.1 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 2.4, + sizegrowth = [[-47 r7]], + ttl = 18, + pos = [[0, 45, 0]], + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = 3, + particlelife = 26, + particlelifespread = 25, + particlesize = 30, + particlesizespread = -3.6, + particlespeed = 4, + particlespeedspread = 10, + pos = [[0, 3, 0]], + rotParams = [[-24 r48, -10 r20, 180 r360]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.04, 0]], + numparticles = 5, + particlelife = 70, + particlelifespread = 120, + particlesize = 30, + particlesizespread = 55, + particlespeed = 1.8, + particlespeedspread = 6, + pos = [[0, 40, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 1 1 0.22 0.8 0.8 0.8 0.12 0.5 0.5 0.5 0.06 0 0 0 0.1]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 8, + particlelife = 30, + particlelifespread = 5.75, + particlesize = 15, + particlesizespread = 40, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + rotParams = [[-24 r48, -10 r20, 180 r360]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + -- junoring = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 3, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[1 r300]], + -- explosiongenerator = [[custom:junoring]], + -- pos = [[0 r0, 20 r20, 0]], + -- alwaysvisible = true, + -- }, + -- }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.5 0.5 0.5 0.22 0.30 0.30 0.30 0.10 0.2 0.2 0.2 0.009 0.1 0.1 0.1 0.008 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 75, + sizegrowth = 0.68, + ttl = 50, + pos = [[0, 20, 0]], + alwaysvisible = true, + }, + }, + -- junocloudspawn = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 15, + -- ground = true, + -- water = true, + -- underwater = false, + -- properties = { + -- delay = [[1 r770]], + -- explosiongenerator = [[custom:junocloud]], + -- pos = [[-50 r100, 10 r25, 0 r150]], + -- alwaysvisible = true, + -- }, + -- }, + -- Lightning is now rendered by the GL4 gadget "Environmental Lightning GL4" + -- via GG.SpawnEnvironmentalLightning("commanderspawn", ...), called from the + -- gadgets that spawn this CEG. The old electricstorm CEG below is disabled. + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 25, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[6 r70]], + -- explosiongenerator = [[custom:lightning_stormbigalt]], + -- pos = [[-120 r240, 30 r30, -120 r240]], + -- alwaysvisible = true, + -- }, + -- }, + }, - ["commander-spawn-alwaysvisible"] = { + ["commander-spawn-alwaysvisible"] = { - spawnbeacon = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 200, - sidetexture = [[gunshotxl2]], - size = 20, - sizegrowth = 2.8, - ttl = 34, - pos = [[0, -90, 0]], - alwaysvisible = true, - }, - }, - spawn_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i5]], - explosiongenerator = [[custom:spawn_ring_1_alwaysvisible]], - pos = [[0, 60 i-18, 0]], - alwaysvisible = true, - }, - }, - spawn_explo = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = 20, - explosiongenerator = [[custom:commander-spawn-alwaysvisible-explo]], - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - }, + spawnbeacon = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 200, + sidetexture = [[gunshotxl2]], + size = 20, + sizegrowth = 2.8, + ttl = 34, + pos = [[0, -90, 0]], + alwaysvisible = true, + }, + }, + spawn_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i5]], + explosiongenerator = [[custom:spawn_ring_1_alwaysvisible]], + pos = [[0, 60 i-18, 0]], + alwaysvisible = true, + }, + }, + spawn_explo = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = 20, + explosiongenerator = [[custom:commander-spawn-alwaysvisible-explo]], + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + }, - ["spawn_ring_1_alwaysvisible"] = { - fireglowbright = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.40 0.55 0.70 0.04 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 3, - particlesize = 60, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 5, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.40, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - alwaysvisible = true, - drawOrder = 1, - }, - }, - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.011 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 200, - sidetexture = [[none]], - size = 20, - sizegrowth = 0.8, - ttl = 14, - pos = [[0, 6, 0]], - alwaysvisible = true, - }, - }, - }, + ["spawn_ring_1_alwaysvisible"] = { + fireglowbright = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.40 0.55 0.70 0.04 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 3, + particlesize = 60, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 5, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.40, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + alwaysvisible = true, + drawOrder = 1, + }, + }, + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.011 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 200, + sidetexture = [[none]], + size = 20, + sizegrowth = 0.8, + ttl = 14, + pos = [[0, 6, 0]], + alwaysvisible = true, + }, + }, + }, } - diff --git a/effects/commander-spawn.lua b/effects/commander-spawn.lua index 8ea0de7f84f..83af433c063 100644 --- a/effects/commander-spawn.lua +++ b/effects/commander-spawn.lua @@ -1,637 +1,635 @@ - return { - ["commander-spawn-explo"] = { - fireglowbright = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0, 0.0]], - numparticles = 2, - particlelife = 60, - particlelifespread = 10, - particlesize = 320, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 5, - pos = [[0.0, 30, 0.0]], - sizegrowth = 1.20, - sizemod = 0.98, - texture = [[glow2]], - useairlos = true, - drawOrder = 1, - }, - }, - firespawnbright = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[glow2]], - length = 200, - sidetexture = [[laser]], - size = 240, - sizegrowth = -0.5, - ttl = 60, - pos = [[0, 30, 0]], - rotParams = [[-280 r50, -10 r20, 0 r90]], - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.8, - maxheat = 11, - pos = [[r-10 r10, 50, r-10 r10]], - size = 17, - sizegrowth = 11, - speed = [[0, 1 0, 0]], - texture = [[dirt]], - alwaysvisible = false, - drawOrder = 1, - }, - }, - pop2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.4 0.45 0.45 0.45 0.20 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 20, - sidetexture = [[none]], - size = 24, - sizegrowth = 7, - ttl = 14, - pos = [[0, 20, 0]], - drawOrder = 2, - }, - }, - -- pop1 = { - -- class = [[CHeatCloudProjectile]], - -- air=1, - -- water=1, - -- ground=1, - -- count=0, - -- properties ={ - -- alwaysVisible=0, - -- texture=[[blastwave]], - -- heat = 9, - -- maxheat = 11, - -- heatFalloff = 0.8, - -- size = 12, - -- sizeGrowth = 18, - -- pos = [[r-10 r10, 0, r-10 r10]], - -- speed=[[0, 0, 0]], - -- }, - -- }, - groundflash_large_long = { - class = [[CSimpleGroundFlash]], - count = 0, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.82 0.82 0.82 0.45 0.7 0.7 0.7 0.30 0 0 0 0.01]], - size = 300, - ttl = 300, - sizegrowth = 1.5, - texture = [[groundflashwhite]], - alwaysvisible = false, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], - size = 120, - sizegrowth = 0, - ttl = 90, - texture = [[groundflashwhite]], - alwaysvisible = false, - }, - }, - groundflash_scarglow = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.40 0.45 .50 0.09 0.5 0.60 0.70 0.65 0.5 0.60 0.70 0.55 0 0 0 0.01]], - size = 80, - sizegrowth = 0, - ttl = 130, - texture = [[scar50glow]], - alwaysvisible = false, - }, - }, - groundflash_scar = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.95 0.9 0.9 0.9 0.94 0.9 0.9 0.9 0.93 0.9 0.9 0.9 0.90 0.1 0.1 0.1 0.5 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[scar50]], - length = 20, - sidetexture = [[none]], - size = 80, - sizegrowth = 0, - ttl = 800, - pos = [[0, 5, 0]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = false, - }, - }, - -- explosion_flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.01, 0]], - -- numparticles = 11, - -- particlelife = 30, - -- particlelifespread = 16, - -- particlesize = 22, - -- particlesizespread = 39, - -- particlespeed = 7, - -- particlespeedspread = 7, - -- pos = [[0, 15, 0]], - -- sizegrowth = -0.3, - -- sizemod = 1, - -- texture = [[flashside3]], - -- useairlos = false, - -- alwaysvisible = true, - -- }, - -- }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 20, - particlelifespread = 25, - particlesize = 22, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.92, - colormap = [[0.8 0.8 0.8 0.02 0.75 0.75 0.75 0.03 0.55 0.55 0.55 0.03 0.15 0.15 0.15 0.005 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 13, - particlelife = 24, - particlelifespread = 14, - particlesize = -20, - particlesizespread = -35, - particlespeed = 14.5, - particlespeedspread = 11, - pos = [[0, 4, 0]], - sizegrowth = 0.11, - sizemod = 0.98, - texture = [[gunshotxl2]], - useairlos = false, - alwaysvisible = false, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[blastwave]], - useairlos = false, - alwaysvisible = false, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.8 0.8 0.8 0.02 0.65 0.65 0.65 0.015 0.25 0.25 0.25 0.012 0.12 0.12 0.12 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 400, - sidetexture = [[blastwave]], - size = 4, - sizegrowth = [[-34 r4]], - ttl = 32, - pos = [[0, 25, 0]], - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.015 0.3 0.3 0.3 0.012 0.1 0.1 0.1 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 2.4, - sizegrowth = [[-47 r7]], - ttl = 18, - pos = [[0, 45, 0]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = 3, - particlelife = 26, - particlelifespread = 25, - particlesize = 30, - particlesizespread = -3.6, - particlespeed = 4, - particlespeedspread = 10, - pos = [[0, 3, 0]], - rotParams = [[-24 r48, -10 r20, 180 r360]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.04, 0]], - numparticles = 5, - particlelife = 70, - particlelifespread = 120, - particlesize = 30, - particlesizespread = 55, - particlespeed = 1.8, - particlespeedspread = 6, - pos = [[0, 40, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = false, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 1 1 0.22 0.8 0.8 0.8 0.12 0.5 0.5 0.5 0.06 0 0 0 0.1]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 8, - particlelife = 30, - particlelifespread = 5.75, - particlesize = 15, - particlesizespread = 40, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - rotParams = [[-24 r48, -10 r20, 180 r360]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = false, - }, - }, - -- junoring = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 3, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[1 r300]], - -- explosiongenerator = [[custom:junoring]], - -- pos = [[0 r0, 20 r20, 0]], - -- alwaysvisible = true, - -- }, - -- }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.5 0.5 0.5 0.22 0.30 0.30 0.30 0.10 0.2 0.2 0.2 0.009 0.1 0.1 0.1 0.008 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 75, - sizegrowth = 0.68, - ttl = 50, - pos = [[0, 20, 0]], - alwaysvisible = false, - }, - }, - -- junocloudspawn = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 15, - -- ground = true, - -- water = true, - -- underwater = false, - -- properties = { - -- delay = [[1 r770]], - -- explosiongenerator = [[custom:junocloud]], - -- pos = [[-50 r100, 10 r25, 0 r150]], - -- alwaysvisible = true, - -- }, - -- }, - -- Lightning is now rendered by the GL4 gadget "Environmental Lightning GL4" - -- via GG.SpawnEnvironmentalLightning("commanderspawn", ...), called from the - -- gadgets that spawn this CEG. The old electricstorm CEG below is disabled. - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 25, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[6 r70]], - -- explosiongenerator = [[custom:lightning_stormbigalt]], - -- pos = [[-120 r240, 30 r30, -120 r240]], - -- alwaysvisible = false, - -- }, - -- }, - }, + ["commander-spawn-explo"] = { + fireglowbright = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0, 0.0]], + numparticles = 2, + particlelife = 60, + particlelifespread = 10, + particlesize = 320, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 5, + pos = [[0.0, 30, 0.0]], + sizegrowth = 1.20, + sizemod = 0.98, + texture = [[glow2]], + useairlos = true, + drawOrder = 1, + }, + }, + firespawnbright = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.001]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[glow2]], + length = 200, + sidetexture = [[laser]], + size = 240, + sizegrowth = -0.5, + ttl = 60, + pos = [[0, 30, 0]], + rotParams = [[-280 r50, -10 r20, 0 r90]], + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.8, + maxheat = 11, + pos = [[r-10 r10, 50, r-10 r10]], + size = 17, + sizegrowth = 11, + speed = [[0, 1 0, 0]], + texture = [[dirt]], + alwaysvisible = false, + drawOrder = 1, + }, + }, + pop2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.4 0.45 0.45 0.45 0.20 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 20, + sidetexture = [[none]], + size = 24, + sizegrowth = 7, + ttl = 14, + pos = [[0, 20, 0]], + drawOrder = 2, + }, + }, + -- pop1 = { + -- class = [[CHeatCloudProjectile]], + -- air=1, + -- water=1, + -- ground=1, + -- count=0, + -- properties ={ + -- alwaysVisible=0, + -- texture=[[blastwave]], + -- heat = 9, + -- maxheat = 11, + -- heatFalloff = 0.8, + -- size = 12, + -- sizeGrowth = 18, + -- pos = [[r-10 r10, 0, r-10 r10]], + -- speed=[[0, 0, 0]], + -- }, + -- }, + groundflash_large_long = { + class = [[CSimpleGroundFlash]], + count = 0, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.82 0.82 0.82 0.45 0.7 0.7 0.7 0.30 0 0 0 0.01]], + size = 300, + ttl = 300, + sizegrowth = 1.5, + texture = [[groundflashwhite]], + alwaysvisible = false, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], + size = 120, + sizegrowth = 0, + ttl = 90, + texture = [[groundflashwhite]], + alwaysvisible = false, + }, + }, + groundflash_scarglow = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.40 0.45 .50 0.09 0.5 0.60 0.70 0.65 0.5 0.60 0.70 0.55 0 0 0 0.01]], + size = 80, + sizegrowth = 0, + ttl = 130, + texture = [[scar50glow]], + alwaysvisible = false, + }, + }, + groundflash_scar = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.95 0.9 0.9 0.9 0.94 0.9 0.9 0.9 0.93 0.9 0.9 0.9 0.90 0.1 0.1 0.1 0.5 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[scar50]], + length = 20, + sidetexture = [[none]], + size = 80, + sizegrowth = 0, + ttl = 800, + pos = [[0, 5, 0]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = false, + }, + }, + -- explosion_flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.01, 0]], + -- numparticles = 11, + -- particlelife = 30, + -- particlelifespread = 16, + -- particlesize = 22, + -- particlesizespread = 39, + -- particlespeed = 7, + -- particlespeedspread = 7, + -- pos = [[0, 15, 0]], + -- sizegrowth = -0.3, + -- sizemod = 1, + -- texture = [[flashside3]], + -- useairlos = false, + -- alwaysvisible = true, + -- }, + -- }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 25, + particlesize = 22, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.92, + colormap = [[0.8 0.8 0.8 0.02 0.75 0.75 0.75 0.03 0.55 0.55 0.55 0.03 0.15 0.15 0.15 0.005 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 13, + particlelife = 24, + particlelifespread = 14, + particlesize = -20, + particlesizespread = -35, + particlespeed = 14.5, + particlespeedspread = 11, + pos = [[0, 4, 0]], + sizegrowth = 0.11, + sizemod = 0.98, + texture = [[gunshotxl2]], + useairlos = false, + alwaysvisible = false, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[blastwave]], + useairlos = false, + alwaysvisible = false, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.8 0.8 0.8 0.02 0.65 0.65 0.65 0.015 0.25 0.25 0.25 0.012 0.12 0.12 0.12 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 400, + sidetexture = [[blastwave]], + size = 4, + sizegrowth = [[-34 r4]], + ttl = 32, + pos = [[0, 25, 0]], + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.9 0.9 0.9 0.02 0.7 0.7 0.7 0.015 0.3 0.3 0.3 0.012 0.1 0.1 0.1 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 2.4, + sizegrowth = [[-47 r7]], + ttl = 18, + pos = [[0, 45, 0]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = 3, + particlelife = 26, + particlelifespread = 25, + particlesize = 30, + particlesizespread = -3.6, + particlespeed = 4, + particlespeedspread = 10, + pos = [[0, 3, 0]], + rotParams = [[-24 r48, -10 r20, 180 r360]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.04, 0]], + numparticles = 5, + particlelife = 70, + particlelifespread = 120, + particlesize = 30, + particlesizespread = 55, + particlespeed = 1.8, + particlespeedspread = 6, + pos = [[0, 40, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = false, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 1 1 0.22 0.8 0.8 0.8 0.12 0.5 0.5 0.5 0.06 0 0 0 0.1]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 8, + particlelife = 30, + particlelifespread = 5.75, + particlesize = 15, + particlesizespread = 40, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + rotParams = [[-24 r48, -10 r20, 180 r360]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = false, + }, + }, + -- junoring = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 3, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[1 r300]], + -- explosiongenerator = [[custom:junoring]], + -- pos = [[0 r0, 20 r20, 0]], + -- alwaysvisible = true, + -- }, + -- }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.5 0.5 0.5 0.22 0.30 0.30 0.30 0.10 0.2 0.2 0.2 0.009 0.1 0.1 0.1 0.008 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 75, + sizegrowth = 0.68, + ttl = 50, + pos = [[0, 20, 0]], + alwaysvisible = false, + }, + }, + -- junocloudspawn = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 15, + -- ground = true, + -- water = true, + -- underwater = false, + -- properties = { + -- delay = [[1 r770]], + -- explosiongenerator = [[custom:junocloud]], + -- pos = [[-50 r100, 10 r25, 0 r150]], + -- alwaysvisible = true, + -- }, + -- }, + -- Lightning is now rendered by the GL4 gadget "Environmental Lightning GL4" + -- via GG.SpawnEnvironmentalLightning("commanderspawn", ...), called from the + -- gadgets that spawn this CEG. The old electricstorm CEG below is disabled. + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 25, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[6 r70]], + -- explosiongenerator = [[custom:lightning_stormbigalt]], + -- pos = [[-120 r240, 30 r30, -120 r240]], + -- alwaysvisible = false, + -- }, + -- }, + }, - ["commander-spawn"] = { + ["commander-spawn"] = { - spawnbeacon = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 200, - sidetexture = [[gunshotxl2]], - size = 20, - sizegrowth = 2.8, - ttl = 34, - pos = [[0, -90, 0]], - }, - }, - spawn_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i5]], - explosiongenerator = [[custom:spawn_ring_1]], - pos = [[0, 60 i-18, 0]], - }, - }, - spawn_explo = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = 20, - explosiongenerator = [[custom:commander-spawn-explo]], - pos = [[0, 0, 0]], - }, - }, - }, + spawnbeacon = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 200, + sidetexture = [[gunshotxl2]], + size = 20, + sizegrowth = 2.8, + ttl = 34, + pos = [[0, -90, 0]], + }, + }, + spawn_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i5]], + explosiongenerator = [[custom:spawn_ring_1]], + pos = [[0, 60 i-18, 0]], + }, + }, + spawn_explo = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = 20, + explosiongenerator = [[custom:commander-spawn-explo]], + pos = [[0, 0, 0]], + }, + }, + }, - ["spawn_ring_1"] = { - fireglowbright = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.40 0.55 0.70 0.04 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 3, - particlesize = 60, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 5, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.40, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - drawOrder = 1, - }, - }, - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.011 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 200, - sidetexture = [[none]], - size = 20, - sizegrowth = 0.8, - ttl = 14, - pos = [[0, 6, 0]], - }, - }, - }, + ["spawn_ring_1"] = { + fireglowbright = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.40 0.55 0.70 0.04 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 3, + particlesize = 60, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 5, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.40, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + drawOrder = 1, + }, + }, + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.011 0.96 0.96 0.96 0.33 0.75 0.75 0.75 0.22 0.55 0.55 0.55 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 200, + sidetexture = [[none]], + size = 20, + sizegrowth = 0.8, + ttl = 14, + pos = [[0, 6, 0]], + }, + }, + }, } - diff --git a/effects/commander_explosion.lua b/effects/commander_explosion.lua index 0d02e1907b2..4502ee5b3c5 100644 --- a/effects/commander_explosion.lua +++ b/effects/commander_explosion.lua @@ -1,729 +1,728 @@ - return { ["COMMANDER_EXPLOSION"] = { centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 0.4, - maxheat = 20, - pos = [[r-2 r2, 25, r-2 r2]], - size = 50, - sizegrowth = 13, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.4 0.35 0.28 0.18 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 2800, - sizegrowth = [[0.4 r0.2]], - ttl = 16, - pos = [[0, 180, 0]], - drawOrder = 1, - }, - }, - brightflareslow = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.35 0.8 0.72 0.60 0.21 0.35 0.28 0.18 0.12 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 8, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 380, - sizegrowth = [[0.4 r0.2]], - ttl = 120, - pos = [[0, -250, 0]], - drawOrder = 0, - }, - }, - pop1 = { - class=[[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=2, - properties ={ - alwaysVisible=1, - texture=[[flame]], + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 0.4, + maxheat = 20, + pos = [[r-2 r2, 25, r-2 r2]], + size = 50, + sizegrowth = 13, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.4 0.35 0.28 0.18 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 2800, + sizegrowth = [[0.4 r0.2]], + ttl = 16, + pos = [[0, 180, 0]], + drawOrder = 1, + }, + }, + brightflareslow = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.35 0.8 0.72 0.60 0.21 0.35 0.28 0.18 0.12 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 8, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 380, + sizegrowth = [[0.4 r0.2]], + ttl = 120, + pos = [[0, -250, 0]], + drawOrder = 0, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 2, + properties = { + alwaysVisible = 1, + texture = [[flame]], heat = 10, maxheat = 10, heatFalloff = 0.55, size = [[3.4 r0.4]], sizeGrowth = 18, pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 700, + ttl = 80, + sizegrowth = -1, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + -- groundflash_largequick = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- properties = { + -- colormap = [[1 0.95 0.8 0.8 0.7 0.5 0.4 0.45 0 0 0 0.01]], + -- size = 600, + -- ttl = 70, + -- sizegrowth = 4, + -- texture = [[shotgunflare]], + -- }, + -- }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.93 0.75 0.2 0.3 0.2 0.15 0.06 0 0 0 0.01]], + size = 50, + sizegrowth = 2, + ttl = 30, + --sizegrowth = 10, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], + size = 950, + sizegrowth = 0, + ttl = 90, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + explosion_flames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.008, 0]], + numparticles = 2, + particlelife = 46, + particlelifespread = 16, + particlesize = 35, + particlesizespread = 65, + particlespeed = 5.5, + particlespeedspread = 7.0, + pos = [[0, 15, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.003 0.20 0.06 0.004 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.008, 0]], + numparticles = 5, + particlelife = 45, + particlelifespread = 15, + particlesize = 30, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 3.2, + sizemod = 1, + texture = [[flashside1]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 10, + sizegrowth = [[-29 r6]], + ttl = 30, + pos = [[0, 45, 0]], + drawOrder = 1, + }, + }, + shockwaveslow = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 24, + sizegrowth = [[-15 r3]], + ttl = 120, + pos = [[0, 25, 0]], + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 90, + particlelifespread = 25, + particlesize = 6, + particlesizespread = 5.7, + particlespeed = 16.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[1 r2.2]], + particlelife = 70, + particlelifespread = 18, + particlesize = 7, + particlesizespread = 5.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[1 r1.5]], + particlelife = 80, + particlelifespread = 20, + particlesize = 8, + particlesizespread = 6.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.92, + colormap = [[0.9 0.85 0.77 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], + directional = true, + emitrot = 40, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 12, + particlelife = 42, + particlelifespread = 16, + particlesize = 45, + particlesizespread = 80, + particlespeed = 24.5, + particlespeedspread = 10, + pos = [[0, 4, 0]], + sizegrowth = -0.096, + sizemod = 0.96, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 40, + particlelifespread = 0, + particlesize = 128, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.20, + -- ttl = 30, + -- expansionSpeed = 18, + -- color = [[1.0, 0.85, 0.45]], + -- alwaysvisible = true, + -- }, + -- }, + -- shockwave_slow = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.05, + -- ttl = 110, + -- expansionSpeed = 8.5, + -- color = [[0.8, 0.55, 0.2]], + -- }, + -- }, + -- shockwave_inner = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.95, + -- ttl = 50, + -- expansionSpeed = 4.8, + -- color = [[0.7, 0.60, 0.32]], + -- alwaysvisible = true, + -- }, + -- }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 6, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.33 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], + dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], + --gravity = [[0.0, -0.2, 0.0]], + frontoffset = 0.08, + fronttexture = [[none]], + length = [[215 r65]], + sidetexture = [[flamestream]], + size = [[100 r25]], + sizegrowth = 0.95, + ttl = [[95 r30]], + rotParams = [[-12 r24, -4 r8, 30 r30]], + pos = [[-35 r70, -10 r60, -35 r70]], + drawOrder = 1, + castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 9, + ground = true, + properties = { + airdrag = 0.985, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.13, 0]], + numparticles = 4, + particlelife = 70, + particlelifespread = 50, + particlesize = 32, + particlesizespread = 14.6, + particlespeed = 4.0, + particlespeedspread = 8, + rotParams = [[-20 r40, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1.005, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 50, + particlelife = 180, + particlelifespread = 40, + particlesize = 3, + particlesizespread = -1.5, + particlespeed = 10, + particlespeedspread = 18, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 45, + particlesize = 90, + particlesizespread = -3.6, + particlespeed = 12, + particlespeedspread = 21, + rotParams = [[-15 r30, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 35, + particlelife = 90, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 40, + particlelifespread = 5.75, + particlesize = 4, + particlesizespread = 1.5, + particlespeed = 5.8, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.05 0.08 0.07 0.06 0.2 0.08 0.07 0.06 0.2 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.07, 0]], + numparticles = 2, + particlelife = 140, + particlelifespread = 60, + particlesize = 18, + particlesizespread = 25, + particlespeed = 6, + particlespeedspread = 6, + pos = [[0, 100, 0]], + rotParams = [[-30 r60, 0, -180 r360]], + sizegrowth = 1.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + nukefloor = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0]], + explosiongenerator = [[custom:newcomnuke-floor]], + pos = [[-40 r80, 100 r20, -40 r80]], }, }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 700, - ttl = 80, - sizegrowth = -1, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - -- groundflash_largequick = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- properties = { - -- colormap = [[1 0.95 0.8 0.8 0.7 0.5 0.4 0.45 0 0 0 0.01]], - -- size = 600, - -- ttl = 70, - -- sizegrowth = 4, - -- texture = [[shotgunflare]], - -- }, - -- }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.93 0.75 0.2 0.3 0.2 0.15 0.06 0 0 0 0.01]], - size = 50, - sizegrowth = 2, - ttl = 30, - --sizegrowth = 10, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], - size = 950, - sizegrowth = 0, - ttl = 90, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - explosion_flames = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.008, 0]], - numparticles = 2, - particlelife = 46, - particlelifespread = 16, - particlesize = 35, - particlesizespread = 65, - particlespeed = 5.5, - particlespeedspread = 7.0, - pos = [[0, 15, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.003 0.20 0.06 0.004 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.008, 0]], - numparticles = 5, - particlelife = 45, - particlelifespread = 15, - particlesize = 30, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 3.2, - sizemod = 1, - texture = [[flashside1]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 10, - sizegrowth = [[-29 r6]], - ttl = 30, - pos = [[0, 45, 0]], - drawOrder = 1, - }, - }, - shockwaveslow = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 24, - sizegrowth = [[-15 r3]], - ttl = 120, - pos = [[0, 25, 0]], - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 90, - particlelifespread = 25, - particlesize = 6, - particlesizespread = 5.7, - particlespeed = 16.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[1 r2.2]], - particlelife = 70, - particlelifespread = 18, - particlesize = 7, - particlesizespread = 5.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[1 r1.5]], - particlelife = 80, - particlelifespread = 20, - particlesize = 8, - particlesizespread = 6.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.92, - colormap = [[0.9 0.85 0.77 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], - directional = true, - emitrot = 40, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 12, - particlelife = 42, - particlelifespread = 16, - particlesize = 45, - particlesizespread = 80, - particlespeed = 24.5, - particlespeedspread = 10, - pos = [[0, 4, 0]], - sizegrowth = -0.096, - sizemod = 0.96, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 40, - particlelifespread = 0, - particlesize = 128, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.20, - -- ttl = 30, - -- expansionSpeed = 18, - -- color = [[1.0, 0.85, 0.45]], - -- alwaysvisible = true, - -- }, - -- }, - -- shockwave_slow = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.05, - -- ttl = 110, - -- expansionSpeed = 8.5, - -- color = [[0.8, 0.55, 0.2]], - -- }, - -- }, - -- shockwave_inner = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.95, - -- ttl = 50, - -- expansionSpeed = 4.8, - -- color = [[0.7, 0.60, 0.32]], - -- alwaysvisible = true, - -- }, - -- }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 6, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.33 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], - dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], - --gravity = [[0.0, -0.2, 0.0]], - frontoffset = 0.08, - fronttexture = [[none]], - length = [[215 r65]], - sidetexture = [[flamestream]], - size = [[100 r25]], - sizegrowth = 0.95, - ttl = [[95 r30]], - rotParams = [[-12 r24, -4 r8, 30 r30]], - pos = [[-35 r70, -10 r60, -35 r70]], - drawOrder = 1, - castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 9, - ground = true, - properties = { - airdrag = 0.985, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.13, 0]], - numparticles = 4, - particlelife = 70, - particlelifespread = 50, - particlesize = 32, - particlesizespread = 14.6, - particlespeed = 4.0, - particlespeedspread = 8, - rotParams = [[-20 r40, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1.005, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 50, - particlelife = 180, - particlelifespread = 40, - particlesize = 3, - particlesizespread = -1.5, - particlespeed = 10, - particlespeedspread = 18, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 60, - particlelifespread = 45, - particlesize = 90, - particlesizespread = -3.6, - particlespeed = 12, - particlespeedspread = 21, - rotParams = [[-15 r30, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 35, - particlelife = 90, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 40, - particlelifespread = 5.75, - particlesize = 4, - particlesizespread = 1.5, - particlespeed = 5.8, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.05 0.08 0.07 0.06 0.2 0.08 0.07 0.06 0.2 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.07, 0]], - numparticles = 2, - particlelife = 140, - particlelifespread = 60, - particlesize = 18, - particlesizespread = 25, - particlespeed = 6, - particlespeedspread = 6, - pos = [[0, 100, 0]], - rotParams = [[-30 r60, 0, -180 r360]], - sizegrowth = 1.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - nukefloor = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0]], - explosiongenerator = [[custom:newcomnuke-floor]], - pos = [[-40 r80, 100 r20, -40 r80]], - }, - }, electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = false, - underwater = false, + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = false, + underwater = false, properties = { - delay = [[40 r170]], + delay = [[40 r170]], explosiongenerator = [[custom:lightning_stormbig]], - pos = [[-100 r160, 55 r50, -100 r160]], + pos = [[-100 r160, 55 r50, -100 r160]], }, }, - electricstormalt = { - air = true, - class = [[CExpGenSpawner]], - count = 12, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[40 r180]], - explosiongenerator = [[custom:lightning_stormbigalt]], - pos = [[-100 r160, 55 r50, -100 r160]], - }, - }, + electricstormalt = { + air = true, + class = [[CExpGenSpawner]], + count = 12, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[40 r180]], + explosiongenerator = [[custom:lightning_stormbigalt]], + pos = [[-100 r160, 55 r50, -100 r160]], + }, + }, electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 5, - ground = true, - water = false, - underwater = false, + air = true, + class = [[CExpGenSpawner]], + count = 5, + ground = true, + water = false, + underwater = false, properties = { - delay = [[65 r130]], + delay = [[65 r130]], explosiongenerator = [[custom:lightning_stormflares]], - pos = [[-70 r140, 140 r30, -70 r140]], + pos = [[-70 r140, 140 r30, -70 r140]], }, }, @@ -742,99 +741,97 @@ return { -- }, }, ["newcomnuke-floor"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], - directional = true, - emitrot = 94, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = 7, - particlelife = 155, - particlelifespread = 125, - particlesize = 18, - particlesizespread = 22, - particlespeed = 13, - particlespeedspread = 8, - pos = [[0.0, 60, 0.0]], - sizegrowth = 1.03, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], - directional = false, - emitrot = 120, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = 8, - particlelife = 165, - particlelifespread = 115, - particlesize = 15, - particlesizespread = 24, - particlespeed = 11, - particlespeedspread = 12, - pos = [[0.0, 60, 0.0]], - sizegrowth = 1.01, - sizemod = 1, - texture = [[fogdirty]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - }, - }, - smoke3 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], - directional = false, - emitrot = 95, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.065, 0.0]], - numparticles = 1, - particlelife = 130, - particlelifespread = 115, - particlesize = 32, - particlesizespread = 95, - particlespeed = 11, - particlespeedspread = 12, - rotParams = [[-6 r12, -2 r4, -180 r360]], - pos = [[-2 r40, 40, -20 r40]], - sizegrowth = 1.01, - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - - }, - + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], + directional = true, + emitrot = 94, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = 7, + particlelife = 155, + particlelifespread = 125, + particlesize = 18, + particlesizespread = 22, + particlespeed = 13, + particlespeedspread = 8, + pos = [[0.0, 60, 0.0]], + sizegrowth = 1.03, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], + directional = false, + emitrot = 120, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = 8, + particlelife = 165, + particlelifespread = 115, + particlesize = 15, + particlesizespread = 24, + particlespeed = 11, + particlespeedspread = 12, + pos = [[0.0, 60, 0.0]], + sizegrowth = 1.01, + sizemod = 1, + texture = [[fogdirty]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + }, + }, + smoke3 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], + directional = false, + emitrot = 95, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.065, 0.0]], + numparticles = 1, + particlelife = 130, + particlelifespread = 115, + particlesize = 32, + particlesizespread = 95, + particlespeed = 11, + particlespeedspread = 12, + rotParams = [[-6 r12, -2 r4, -180 r360]], + pos = [[-2 r40, 40, -20 r40]], + sizegrowth = 1.01, + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + }, } diff --git a/effects/crusherkrog.lua b/effects/crusherkrog.lua index a511afe2496..ab9e5087ca4 100644 --- a/effects/crusherkrog.lua +++ b/effects/crusherkrog.lua @@ -1,35 +1,33 @@ return { - ["crusherkrog"] = { - -- put this next to groundflash - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 30, - particlelife = 2, - particlelifespread = 30, - particlesize = 2, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - + ["crusherkrog"] = { + -- put this next to groundflash + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, } - diff --git a/effects/custom_explosions.lua b/effects/custom_explosions.lua index 4aebaad88ef..6d4ab1e9401 100644 --- a/effects/custom_explosions.lua +++ b/effects/custom_explosions.lua @@ -1,6647 +1,6642 @@ +local definitions = { + + ["noexplosion"] = { --needed for hacking behaviour via fake weapons + }, + ["botrailspawn"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.6, + maxheat = 12, + pos = [[r-2 r2, 5, r-2 r2]], + size = 64, + sizegrowth = -12, + speed = [[0, 10, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.50 0.52 1 0.033 0.50 0.52 1 0.22 0.2 0.2 0.4 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 10, + sizegrowth = -9, + ttl = 12, + pos = [[0, 6, 0]], + }, + }, + spawnring2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.5 0.52 1 0.033 0.44 0.46 0.95 0.22 0.26 0.29 0.6 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[smoke_puff]], + length = 45, + sidetexture = [[none]], + size = 6.8, + sizegrowth = 10, + ttl = 10, + pos = [[0, 0, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.52 1 0.4 0 0 0 0.01]], + size = 70, + sizegrowth = 4, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.52 1 0.2 0 0 0 0.01]], + size = 80, + sizegrowth = -3.5, + ttl = 30, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.52 1 0.77 0 0 0 0.01]], + size = 100, + sizegrowth = 0, + ttl = 4, + texture = [[groundflash]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 0.38 0.40 0.85 0.10 0.33 0.35 0.75 0.08 0.24 0.26 0.5 0.06 0.01 0.01 0.01 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 22, + particlesize = 28, + particlesizespread = 24, + particlespeed = 6.9, + particlespeedspread = 3.0, + pos = [[0, 2, 0]], + sizegrowth = -0.8, + sizemod = 0.9, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[bluenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 20.5, + sizeGrowth = 10, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0.5 0.52 1 0.017 0.33 0.35 0.7 0.011 0 0 0 0]], + directional = false, + emitrot = 90, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 8.5, + particlelife = 12, + particlelifespread = 24, + particlesize = 15, + particlesizespread = 25, + particlespeed = 2.2, + particlespeedspread = 5.0, + pos = [[0, -20, 0]], + sizegrowth = 1, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.1 0.043 0.04 0.04 0.1 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 20, + particlesize = 60, + particlesizespread = 40, + particlespeed = 1.2, + particlespeedspread = 2.5, + pos = [[0, 4, 0]], + sizegrowth = -0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 22, + sizegrowth = -1.5, + speed = [[0, 1, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + + ["corpsedestroyed"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.15 0 0 0 0.01]], + size = 60, + sizegrowth = -0.85, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.93 0.90 0.1 0 0 0 0.01]], + size = 40, + sizegrowth = -3.9, + ttl = 9, + texture = [[groundflashwhite]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 70, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 7, + particleSizeSpread = 15, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 50, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 24, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 2, + particlelife = 18, + particlelifespread = 14, + particlesize = 1.6, + particlesizespread = -1.3, + particlespeed = 3.5, + particlespeedspread = 4.7, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 15, + particlesize = 1.5, + particlesizespread = -1.25, + particlespeed = 3, + particlespeedspread = 6.2, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 20, + particlelifespread = 13, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 20, + particlelifespread = 13, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[r1.25]], + particlelife = 28, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1.35, 0.5]], + gravity = [[0, 0.03, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 100, + particlesize = 45, + particlesizespread = 70, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 90, + particlesize = 5.2, + particlesizespread = 2.8, + particlespeed = 3.2, + particlespeedspread = 1.35, + pos = [[0, 5, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + + ["selfrepair-sparks"] = { + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.2 0.8 0.2 0.02 0.4 0.8 0.4 0.01 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.981, 0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 15, + particlesize = 10, + particlesizespread = 30, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.75, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["wallexplosion-metal"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 15, + sizegrowth = -2, + speed = [[0, 1 0, 0]], + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.3 0 0 0 0.01]], + size = 65, + sizegrowth = -0.85, + ttl = 16, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], + size = 45, + sizegrowth = -3.9, + ttl = 11, + texture = [[groundflashwhite]], + }, + }, + -- explosion = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.81, + -- colormap = [[0 0 0 0 0.85 0.65 0.45 0.10 0.75 0.45 0.35 0.08 0.50 0.40 0.30 0.06 0.01 0.01 0.01 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.01, 0]], + -- numparticles = 4, + -- particlelife = 7, + -- particlelifespread = 9, + -- particlesize = 3.5, + -- particlesizespread = 10.8, + -- particlespeed = 1.4, + -- particlespeedspread = 3.75, + -- pos = [[0, 2, 0]], + -- sizegrowth = 0.35, + -- sizemod = 1, + -- texture = [[bigexplosmoke]], + -- useairlos = false, + -- }, + -- }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.0, + sizegrowth = [[-15 r8]], + ttl = 8, + pos = [[0, 10, 0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 11, + particlelifespread = 0, + particlesize = 14, + particlesizespread = 4, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + fireglow2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 0, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 14, + particlelifespread = 0, + particlesize = 33, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 70, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 7, + particleSizeSpread = 15, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 50, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.44 0.46 0.95 0.017 0.30 0.32 0.7 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 15, + particlesize = 90, + particlesizespread = 130, + particlespeed = 1.9, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.75, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 24, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 18, + particlelifespread = 14, + particlesize = 1.6, + particlesizespread = -1.3, + particlespeed = 3.5, + particlespeedspread = 4.7, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 2, + particlelife = 33, + particlelifespread = 15, + particlesize = 1.5, + particlesizespread = -1.25, + particlespeed = 3, + particlespeedspread = 6.2, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[r1.25]], + particlelife = 28, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1.35, 0.5]], + gravity = [[0, 0.03, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 110, + particlesize = 45, + particlesizespread = 70, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 13, + particlelife = 10, + particlelifespread = 90, + particlesize = 5.2, + particlesizespread = 2.8, + particlespeed = 3.2, + particlespeedspread = 1.35, + pos = [[0, 5, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + ["wallexplosion-concrete"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.3, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.3 0 0 0 0.01]], + size = 65, + sizegrowth = -0.85, + ttl = 16, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], + size = 45, + sizegrowth = -3.9, + ttl = 11, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.81, + colormap = [[0 0 0 0 0.85 0.65 0.45 0.10 0.75 0.45 0.35 0.08 0.50 0.40 0.30 0.06 0.01 0.01 0.01 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 9, + particlesize = 3.5, + particlesizespread = 10.8, + particlespeed = 1.4, + particlespeedspread = 3.75, + pos = [[0, 2, 0]], + sizegrowth = 0.35, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.0, + sizegrowth = [[-15 r8]], + ttl = 8, + pos = [[0, 10, 0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 11, + particlelifespread = 0, + particlesize = 14, + particlesizespread = 4, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + }, + }, + fireglow2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 0, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 14, + particlelifespread = 0, + particlesize = 33, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 70, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 7, + particleSizeSpread = 15, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 50, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.95 0.50 0.35 0.017 0.7 0.5 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 15, + particlesize = 90, + particlesizespread = 130, + particlespeed = 2.9, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.75, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 24, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 18, + particlelifespread = 14, + particlesize = 1.6, + particlesizespread = -1.3, + particlespeed = 3.5, + particlespeedspread = 4.7, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 2, + particlelife = 33, + particlelifespread = 15, + particlesize = 1.5, + particlesizespread = -1.25, + particlespeed = 3, + particlespeedspread = 6.2, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 4, + particlespeed = 2.4, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.75]], + particlelife = 24, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 4, + particlespeed = 2.4, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[r1.25]], + particlelife = 28, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 4, + particlespeed = 2.4, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1.35, 0.5]], + gravity = [[0, 0.03, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 110, + particlesize = 45, + particlesizespread = 70, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 13, + particlelife = 10, + particlelifespread = 90, + particlesize = 5.2, + particlesizespread = 2.8, + particlespeed = 3.2, + particlespeedspread = 1.35, + pos = [[0, 5, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + ["wallexplosion-water"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 15, + sizegrowth = -2, + speed = [[0, 1 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 16, + particlespeed = [[2 i0.25]], + particlespeedspread = 2, + pos = [[0, 18, 0]], + sizegrowth = -0.25, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 12.5, + sizegrowth = 2, + ttl = 65, + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 4, + particlelifespread = 28, + particlesize = [[1 r2]], + particlesizespread = 0, + particlespeed = [[1.2 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.0, + sizegrowth = [[-15 r8]], + ttl = 8, + pos = [[0, 10, 0]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 11, + particlelifespread = 0, + particlesize = 14, + particlesizespread = 4, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + }, + }, + fireglow2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 0, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 14, + particlelifespread = 0, + particlesize = 33, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 70, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 7, + particleSizeSpread = 15, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 50, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 11, + particlelifespread = 21, + particlesize = 6, + particlesizespread = 18, + particlespeed = 1, + particlespeedspread = 8, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.6, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 24, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 18, + particlelifespread = 14, + particlesize = 1.6, + particlesizespread = -1.3, + particlespeed = 3.5, + particlespeedspread = 4.7, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 2, + particlelife = 33, + particlelifespread = 15, + particlesize = 1.5, + particlesizespread = -1.25, + particlespeed = 3, + particlespeedspread = 6.2, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[r1.25]], + particlelife = 28, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1.35, 0.5]], + gravity = [[0, 0.03, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 110, + particlesize = 45, + particlesizespread = 70, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 4, 0]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 13, + particlelife = 10, + particlelifespread = 90, + particlesize = 5.2, + particlesizespread = 2.8, + particlespeed = 3.2, + particlespeedspread = 1.35, + pos = [[0, 5, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + ["subtorpfire"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 20, + sizegrowth = -1.5, + speed = [[0, 1 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 10, + particlelife = 20, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 8, + particlespeed = [[1 i0.25]], + particlespeedspread = 2, + pos = [[0, 9, 0]], + sizegrowth = -0.25, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, + ["subtorpfire-medium"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 40, + sizegrowth = -1.5, + speed = [[0, 1 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 10, + particlelife = 20, + particlelifespread = 20, + particlesize = 2, + particlesizespread = 12, + particlespeed = [[1 i0.25]], + particlespeedspread = 2, + pos = [[0, 9, 0]], + sizegrowth = -0.25, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, + ["juno-explo"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.7, + maxheat = 11, + pos = [[r-10 r10, 50, r-10 r10]], + rotParams = [[-150 r300, -30 r60, -180 r360]], + size = 20, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + alwaysvisible = true, + }, + }, + -- pop1 = { + -- class = [[CHeatCloudProjectile]], + -- air=1, + -- water=1, + -- ground=1, + -- count=1, + -- properties ={ + -- alwaysVisible=1, + -- texture=[[explo]], + -- heat = 10, + -- maxheat = 10, + -- heatFalloff = 0.9, + -- size = 6, + -- sizeGrowth = 12, + -- pos = [[r-10 r10, 20, r-10 r10]], + -- speed=[[0, 0, 0]], + -- }, + -- }, + groundflash_large_long = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + rotParams = [[4 r2, -0.5, -180 r360]], + colormap = [[0.82 0.99 0.22 0.45 0.72 0.92 0.2 0.30 0 0 0 0.01]], + size = 700, + ttl = 50, + sizegrowth = 0, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.82 0.99 0.22 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 70, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 1, + sidetexture = [[none]], + size = [[38 r28]], + sizegrowth = 2, + ttl = 100, + pos = [[0.5, 1, 0.0]], + rotParams = [[-6 r12, -3 r6, -180 r360]], + }, + }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 32, + particlelifespread = 35, + particlesize = -24, + particlesizespread = -48, + particlespeed = 2.8, + particlespeedspread = 14, + pos = [[-10 r20,-32, -10 r20]], + sizegrowth = -0.2, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterfoam = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[70 r12]], + sizegrowth = [[0.6 r0.9]], + ttl = 90, + rotParams = [[-4 r8, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + -- kickedupwater = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- air = false, + -- ground = false, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 3, + -- particlelife = 2, + -- particlelifespread = 45, + -- particlesize = 3, + -- particlesizespread = 1.5, + -- particlespeed = 12, + -- particlespeedspread = 20, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.5, + -- sizemod = 1.0, + -- texture = [[wake]], + -- alwaysvisible = true, + -- }, + -- }, + -- explosion_flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.01, 0]], + -- numparticles = 11, + -- particlelife = 30, + -- particlelifespread = 16, + -- particlesize = 22, + -- particlesizespread = 39, + -- particlespeed = 7, + -- particlespeedspread = 7, + -- pos = [[0, 15, 0]], + -- sizegrowth = -0.3, + -- sizemod = 1, + -- texture = [[flashside3]], + -- useairlos = false, + -- alwaysvisible = true, + -- }, + -- }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 25, + particlesize = 22, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 13, + particlelife = 24, + particlelifespread = 14, + particlesize = 38, + particlesizespread = 45, + particlespeed = 14.5, + particlespeedspread = 11, + pos = [[0, 4, 0]], + sizegrowth = -0.11, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.75 0.98 0.32 0.2 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[explo]], + useairlos = false, + alwaysvisible = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 400, + sidetexture = [[blastwave]], + size = 8, + sizegrowth = [[-29 r8]], + ttl = 32, + pos = [[0, 25, 0]], + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 4.8, + sizegrowth = [[-47 r7]], + ttl = 18, + pos = [[0, 45, 0]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 12, + particlelife = 26, + particlelifespread = 25, + particlesize = 40, + particlesizespread = -3.6, + particlespeed = 6, + particlespeedspread = 14, + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.17 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 5, + particlelife = 80, + particlelifespread = 150, + particlesize = 75, + particlesizespread = 120, + particlespeed = 0.3, + particlespeedspread = 8, + pos = [[0, 40, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[FireBall02-anim]], + animParams = [[8,8,100 r50]], + alwaysvisible = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 30, + particlelifespread = 5.75, + particlesize = 15, + particlesizespread = 40, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + junoring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.4 0.58 0.10 0.15 0.35 0.60 0.08 0.11 0.22 0.42 0.06 0.009 0.15 0.28 0.04 0.008 0.10 0.18 0.03 0.007 0.05 0.09 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 0, + sidetexture = [[none]], + size = 400, + sizegrowth = 0.16, + ttl = 200, + pos = [[0, 20, 0]], + rotParams = [[4 r2, -0.5, -180 r360]], + alwaysvisible = true, + }, + }, + -- moved to synced gadget-driven GL4 environmental lightning + }, + ["juno-explo-mini"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.7, + maxheat = 11, + pos = [[r-5 r5, 25, r-5 r5]], + rotParams = [[-150 r300, -30 r60, -180 r360]], + size = 14, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + alwaysvisible = true, + }, + }, + groundflash_large_long = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + rotParams = [[4 r2, -0.5, -180 r360]], + colormap = [[0.82 0.99 0.22 0.45 0.72 0.92 0.2 0.30 0 0 0 0.01]], + size = 500, + ttl = 350, + sizegrowth = 0, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.82 0.99 0.22 0.77 0 0 0 0.01]], + size = 135, + sizegrowth = 0, + ttl = 60, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 12, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 16, + particlespeed = 4, + particlespeedspread = 4.5, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.88, + colormap = [[0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 13, + particlelife = 24, + particlelifespread = 14, + particlesize = 38, + particlesizespread = 45, + particlespeed = 14.5, + particlespeedspread = 11, + pos = [[0, 4, 0]], + sizegrowth = -0.11, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.75 0.98 0.32 0.2 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 20, + particlelifespread = 0, + particlesize = 70, + particlesizespread = 45, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[explo]], + useairlos = false, + alwaysvisible = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 200, + sidetexture = [[blastwave]], + size = 5.5, + sizegrowth = [[-29 r8]], + ttl = 32, + pos = [[0, 25, 0]], + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 200, + sidetexture = [[none]], + size = 4.8, + sizegrowth = [[-47 r7]], + ttl = 18, + pos = [[0, 45, 0]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 12, + particlelife = 13, + particlelifespread = 25, + particlesize = 28, + particlesizespread = -3.6, + particlespeed = 6, + particlespeedspread = 14, + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 5, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.17 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 5, + particlelife = 40, + particlelifespread = 75, + particlesize = 30, + particlesizespread = 56, + particlespeed = 0.3, + particlespeedspread = 8, + pos = [[0, 40, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 15, + particlelifespread = 5.75, + particlesize = 7.5, + particlesizespread = 28, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + junoring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.4 0.58 0.10 0.15 0.35 0.60 0.08 0.11 0.22 0.42 0.06 0.009 0.15 0.28 0.04 0.008 0.10 0.18 0.03 0.007 0.05 0.09 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 0, + sidetexture = [[none]], + size = 280, + sizegrowth = 0.16, + ttl = 200, + pos = [[0, 20, 0]], + rotParams = [[4 r2, -0.5, -180 r360]], + alwaysvisible = true, + }, + }, + -- moved to synced gadget-driven GL4 environmental lightning, + }, + ["junocloud"] = { + usedefaultexplosions = false, + grounddust1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.0 0.4 0.54 0.17 0.18 0.2 0.29 0.01 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], + numparticles = [[1.5 r1]], + particlelife = 150, + particlelifespread = 120, + particlesize = 125, + particlesizespread = 300, + particlespeed = 4.5, + particlespeedspread = 4.5, + pos = [[-50 r100, -25 r75, -50 r100]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff]], + alwaysvisible = true, + }, + }, + grounddust2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.0 0.4 0.54 0.17 0.18 0.2 0.29 0.01 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], + numparticles = [[1.4 r1]], + particlelife = 160, + particlelifespread = 120, + particlesize = 125, + particlesizespread = 300, + particlespeed = 4.5, + particlespeedspread = 4.5, + pos = [[-50 r100, -25 r75, -50 r100]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff2]], + alwaysvisible = true, + }, + }, + }, + ["juno-damage"] = { + usedefaultexplosions = false, + -- engine = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- alwaysVisible = true, + -- colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[none]], + -- length = [[-15 r3.5]], + -- sidetexture = [[muzzleside]], + -- size = 15.5, + -- sizegrowth = [[0.2 r0.3]], + -- ttl = 1, + -- }, + -- }, + -- lightningballs = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 1, + -- colormap = [[0 0 0 0.01 0.66 0.92 0.66 0.10 0.66 0.86 0.66 0.01 0 0 0 0.01]], + -- directional = true, + -- emitrot = 80, + -- emitrotspread = 120, + -- emitvector = [[1, 1, 1]], + -- gravity = [[0, 0, 0]], + -- numparticles = 2, + -- particlelife = 3, + -- particlelifespread = 5, + -- particlesize = 8, + -- particlesizespread = 20, + -- particlespeed = 0.04, + -- particlespeedspread = 0, + -- pos = [[-10 r10, -25 r50, -10 r10]], + -- sizegrowth = -0.2, + -- sizemod = 1.0, + -- texture = [[lightninginair]], + -- }, + --}, + fireglow = { -local definitions = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.77 0.98 0.77 0.2 0.75 0.98 0.32 0.2 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0, 0.0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 9, + particlesizespread = 20, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = 1.9, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.65 0.92 0.26 0.3 0.6 0.88 0.24 0.2 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 9, + particlesizespread = 11, + particlespeed = 0.25, + particlespeedspread = 0.4, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.65 0.92 0.26 0.25 0.6 0.88 0.24 0.1 0.06 0.088 0.02 0.25 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 2, + particlelife = 25, + particlelifespread = 15, + particlesize = 5, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 0.5, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + -- smoke = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.92, + -- colormap = [[0.012 0.012 0.012 0.05 0.10 0.08 0.066 0.66 0.08 0.076 0.086 0.56 0.08 0.076 0.084 0.44 0.05 0.05 0.05 0.28 0.028 0.028 0.028 0.13 0.012 0.012 0.012 0.05 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 7, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.04, 0.0]], + -- numparticles = [[1 r1]], + -- particlelife = 14, + -- particlelifespread = 25, + -- particlesize = 5, + -- particlesizespread = 6, + -- particlespeed = 1.5, + -- particlespeedspread = 1.5, + -- pos = [[-15 r30, -15 r30, -15 r30]], + -- sizegrowth = 0.32, + -- sizemod = 1, + -- texture = [[smoke]], + -- useairlos = true, + -- }, + -- }, + -- dustparticles = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.77, + -- colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + -- directional = true, + -- emitrot = 80, + -- emitrotspread = 15, + -- emitvector = [[dir]], + -- gravity = [[0, -0.011, 0]], + -- numparticles = 1, + -- particlelife = 9, + -- particlelifespread = 6, + -- particlesize = 4, + -- particlesizespread = 0.8, + -- particlespeed = 0.05, + -- particlespeedspread = 0.6, + -- pos = [[0, 0, 0]], + -- sizegrowth = 0.06, + -- sizemod = 1.0, + -- texture = [[randomdots]], + -- }, + -- }, + }, + ["fusexpl"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.8, + maxheat = 20, + pos = [[r-10 r10, 50, r-10 r10]], + size = 8, + sizegrowth = 18, + speed = [[0, 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.84 0.70 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 300, + sizegrowth = [[0.6 r0.2]], + ttl = 7, + pos = [[0, 180, 0]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 2, + properties = { + --alwaysVisible=1, + texture = [[explo]], + heat = 8, + maxheat = 10, + heatFalloff = 0.8, + size = 2, + sizeGrowth = 10, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + rotParams = [[6 r6, -1 r2, -180 r360]], + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 80, + ttl = 65, + sizegrowth = 12, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + -- groundflash_largequick = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- properties = { + -- colormap = [[1 0.95 0.8 0.8 0.7 0.5 0.4 0.45 0 0 0 0.01]], + -- size = 600, + -- ttl = 70, + -- sizegrowth = 4, + -- texture = [[shotgunflare]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[8 r6, -1 r-0.5, -180 r360]], + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 110, + sizegrowth = 0, + ttl = 80, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[-8 r16, -3 r6, -180 r360]], + colormap = [[1 0.93 0.75 0.3 0.5 0.46 0.32 0.05 0 0 0 0.01]], + size = 80, + sizegrowth = 32, + ttl = 45, + texture = [[groundflash]], + }, + }, + -- kickedupwater = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- air = false, + -- ground = false, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 100, + -- particlelife = 2, + -- particlelifespread = 45, + -- particlesize = 3, + -- particlesizespread = 1.5, + -- particlespeed = 12, + -- particlespeedspread = 20, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.5, + -- sizemod = 1.0, + -- texture = [[wake]], + -- alwaysvisible = true, + -- }, + -- }, + explosion_flames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 26, + particlelifespread = 12, + particlesize = 12, + particlesizespread = 28, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 15, 0]], + sizegrowth = -0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.007 0.20 0.06 0.004 0.006 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 7, + particlelife = 30, + particlelifespread = 20, + particlesize = 15, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.1, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[3 r2.3]], + particlelife = 80, + particlelifespread = 25, + particlesize = 6, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r2.2]], + particlelife = 70, + particlelifespread = 18, + particlesize = 7, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r1.5]], + particlelife = 75, + particlelifespread = 20, + particlesize = 8, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.87, + colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 12, + particlelife = 22, + particlelifespread = 14, + particlesize = 36, + particlesizespread = 42, + particlespeed = 12.5, + particlespeedspread = 10, + pos = [[0, 4, 0]], + sizegrowth = -0.11, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[explo]], + useairlos = false, + alwaysvisible = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 400, + sidetexture = [[none]], + size = 7, + sizegrowth = [[-29 r6]], + ttl = 30, + pos = [[0, 25, 0]], + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 4.5, + sizegrowth = [[-45 r6]], + ttl = 11, + pos = [[0, 45, 0]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.13, 0]], + numparticles = 24, + particlelife = 65, + particlelifespread = 45, + particlesize = 34, + particlesizespread = -3.6, + particlespeed = 3, + particlespeedspread = 6, + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 20, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 20, + particlelife = 100, + particlelifespread = 40, + particlesize = 3, + particlesizespread = -1.5, + particlespeed = 6, + particlespeedspread = 12, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.10, 0]], + numparticles = 5, + particlelife = 60, + particlelifespread = 35, + particlesize = 70, + particlesizespread = -3.6, + particlespeed = 4, + particlespeedspread = 3, + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 25, + particlelife = 70, + particlelifespread = 120, + particlesize = 44, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 5, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 25, + particlelifespread = 5.75, + particlesize = 13, + particlesizespread = 30, + particlespeed = 5.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 8, + particlelife = 140, + particlelifespread = 60, + particlesize = 80.4, + particlesizespread = 30.5, + particlespeed = 12, + particlespeedspread = 3, + pos = [[0, 50, 0]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 1, + sidetexture = [[none]], + size = [[38 r28]], + sizegrowth = 2, + ttl = 100, + pos = [[0.5, 1, 0.0]], + rotParams = [[-6 r12, -3 r6, -180 r360]], + }, + }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 32, + particlelifespread = 35, + particlesize = -24, + particlesizespread = -48, + particlespeed = 2.8, + particlespeedspread = 14, + pos = [[-10 r20,-32, -10 r20]], + sizegrowth = -0.2, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterfoam = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[70 r12]], + sizegrowth = [[0.6 r0.9]], + ttl = 90, + rotParams = [[-4 r8, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + + fusfloor = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0]], + explosiongenerator = [[custom:afus-floor]], + pos = [[-10 r20, 130, -10 r20]], + alwaysvisible = true, + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[15 r70]], + explosiongenerator = [[custom:lightning_stormbig]], + pos = [[0 r75, 20 r50, 0 r75]], + alwaysvisible = true, + }, + }, + + electricstormxl = { + air = true, + class = [[CExpGenSpawner]], + count = 4, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[60 r90]], + explosiongenerator = [[custom:lightning_stormflares]], + pos = [[-20 r90, 120 r25, -20 r90]], + alwaysvisible = true, + }, + }, + + -- electricstorm2 = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 35, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[40 r200]], + -- explosiongenerator = [[custom:lightning_stormbolt]], + -- pos = [[-200 r400, 2 r60, -200 r400]], + -- }, + -- }, + }, + ["afusexpl"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.7, + maxheat = 11, + pos = [[r-10 r10, 50, r-10 r10]], + size = 20, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + flameandsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + properties = { + airdrag = 0.88, + --colormap = [[0.8 0.78 0.6 0.85 1.0 0.97 0.7 0.97 0.8 0.7 0.55 0.89 0.22 0.13 0.1 0.72 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.90 0.7 1 0.89 0.58 0.35 0.85 0.22 0.16 0.13 0.73 0.16 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.09 r0.09, -0.09 r0.18]], + numparticles = 1, + particlelife = 78, + particlelifespread = 35, + particlesize = 180.0, + particlesizespread = 60.0, + particlespeed = 12.4, + particlespeedspread = 12.2, + pos = [[-10 r20, 5 r5, -10 r20]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + sizegrowth = [[3.9 r2.5]], + sizemod = 0.99, + animParams = [[16,6,130 r55]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.7 0.68 0.48 0.5 0.3 0.25 0.2 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 1200, + sizegrowth = [[0.4 r0.2]], + ttl = 8, + pos = [[0, 180, 0]], + drawOrder = 1, + }, + }, + brightflareslow = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.94 0.80 0.95 0.82 0.70 0.60 0.21 0.37 0.24 0.18 0.12 0.13 0.10 0.08 0.06 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 6, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 380, + sizegrowth = [[0.4 r0.2]], + ttl = [[130 r65]], + pos = [[0, -250, 0]], + drawOrder = 1, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + texture = [[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 0.9, + size = 6, + sizeGrowth = 12, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + rotParams = [[4 r2, -1 r-0.5, -180 r360]], + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 50, + ttl = 80, + sizegrowth = 12, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[8 r4, -1 r-0.5, -180 r360]], + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 170, + sizegrowth = 5, + ttl = 80, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[-20 r40, -5 r10, -180 r360]], + colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], + size = 80, + sizegrowth = 28, + ttl = 60, + --sizegrowth = 10, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + explosion_flames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.03 0.1 0.04 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 11, + particlelife = 28, + particlelifespread = 14, + particlesize = 25, + particlesizespread = 32, + particlespeed = 7, + particlespeedspread = 7, + pos = [[0, 15, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.20 0.06 0.004 0.006 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 30, + particlelifespread = 20, + particlesize = 22, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[3 r2.3]], + particlelife = 90, + particlelifespread = 25, + particlesize = 6, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r2.2]], + particlelife = 60, + particlelifespread = 18, + particlesize = 7, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r1.5]], + particlelife = 70, + particlelifespread = 20, + particlesize = 8, + particlesizespread = 3.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.88, + colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 5, + particlelife = 22, + particlelifespread = 14, + particlesize = 38, + particlesizespread = 45, + particlespeed = 16.5, + particlespeedspread = 13, + pos = [[0, 4, 0]], + sizegrowth = -0.11, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[explo]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 40, + sidetexture = [[none]], + size = 8, + sizegrowth = [[29 r8]], + ttl = 32, + pos = [[0, 25, 0]], + drawOrder = 1, + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 40, + sidetexture = [[none]], + size = 4.8, + sizegrowth = [[47 r7]], + ttl = 12, + pos = [[0, 45, 0]], + }, + }, + shockwave_fast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + unit = true, + properties = { + colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.18 0.4 0.3 0.15 0.11 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[shockwave]], + length = 1, + sidetexture = [[none]], + size = 15, + sizegrowth = [[-40 r4]], + ttl = 9, + pos = [[0, 50, 0]], + drawOrder = 1, + useairlos = false, + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 10, + particlelife = 70, + particlelifespread = 50, + particlesize = 40, + particlesizespread = -3.6, + particlespeed = 3.8, + particlespeedspread = 8, + pos = [[0, 3, 0]], + rotParams = [[-20 r40, 0, -180 r360]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 32, + particlelife = 150, + particlelifespread = 40, + particlesize = 3, + particlesizespread = -1.5, + particlespeed = 10, + particlespeedspread = 18, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 60, + particlelifespread = 40, + particlesize = 90, + particlesizespread = -3.6, + particlespeed = 4, + particlespeedspread = 3, + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 25, + particlelife = 40, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 30, + particlelifespread = 5.75, + particlesize = 15, + particlesizespread = 40, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 8, + particlelife = 140, + particlelifespread = 60, + particlesize = 80.4, + particlesizespread = 30.5, + particlespeed = 12, + particlespeedspread = 3, + pos = [[0, 50, 0]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, - ["noexplosion"] = {--needed for hacking behaviour via fake weapons - }, - ["botrailspawn"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.6, - maxheat = 12, - pos = [[r-2 r2, 5, r-2 r2]], - size = 64, - sizegrowth = -12, - speed = [[0, 10, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.50 0.52 1 0.033 0.50 0.52 1 0.22 0.2 0.2 0.4 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 10, - sizegrowth = -9, - ttl = 12, - pos = [[0, 6, 0]], - }, - }, - spawnring2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.5 0.52 1 0.033 0.44 0.46 0.95 0.22 0.26 0.29 0.6 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[smoke_puff]], - length = 45, - sidetexture = [[none]], - size = 6.8, - sizegrowth = 10, - ttl = 10, - pos = [[0, 0, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.52 1 0.4 0 0 0 0.01]], - size = 70, - sizegrowth = 4, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.52 1 0.2 0 0 0 0.01]], - size = 80, - sizegrowth = -3.5, - ttl = 30, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.52 1 0.77 0 0 0 0.01]], - size = 100, - sizegrowth = 0, - ttl = 4, - texture = [[groundflash]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 0.38 0.40 0.85 0.10 0.33 0.35 0.75 0.08 0.24 0.26 0.5 0.06 0.01 0.01 0.01 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 5, - particlelife = 15, - particlelifespread = 22, - particlesize = 28, - particlesizespread = 24, - particlespeed = 6.9, - particlespeedspread = 3.0, - pos = [[0, 2, 0]], - sizegrowth = -0.8, - sizemod = 0.9, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[bluenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 20.5, - sizeGrowth = 10, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0.5 0.52 1 0.017 0.33 0.35 0.7 0.011 0 0 0 0]], - directional = false, - emitrot = 90, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 8.5, - particlelife = 12, - particlelifespread = 24, - particlesize = 15, - particlesizespread = 25, - particlespeed = 2.2, - particlespeedspread = 5.0, - pos = [[0, -20, 0]], - sizegrowth = 1, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, + afusfloor = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0]], + explosiongenerator = [[custom:afus-floor]], + pos = [[-10 r20, 130, -10 r20]], + alwaysvisible = true, + }, + }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.1 0.043 0.04 0.04 0.1 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 20, - particlesize = 60, - particlesizespread = 40, - particlespeed = 1.2, - particlespeedspread = 2.5, - pos = [[0, 4, 0]], - sizegrowth = -0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 22, - sizegrowth = -1.5, - speed = [[0, 1, 0]], - texture = [[bluenovaexplo]], - }, - }, - }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[15 r90]], + explosiongenerator = [[custom:lightning_stormbig]], + pos = [[0 r165, 50 r50, 0 r165]], + alwaysvisible = true, + }, + }, - ["corpsedestroyed"] = { - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.15 0 0 0 0.01]], - size = 60, - sizegrowth = -0.85, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.93 0.90 0.1 0 0 0 0.01]], - size = 40, - sizegrowth = -3.9, - ttl = 9, - texture = [[groundflashwhite]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particleLife=25, - particleLifeSpread=70, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=7, - particleSizeSpread=15 - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=50, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=11, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 24, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 2, - particlelife = 18, - particlelifespread = 14, - particlesize = 1.6, - particlesizespread = -1.3, - particlespeed = 3.5, - particlespeedspread = 4.7, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 15, - particlesize = 1.5, - particlesizespread = -1.25, - particlespeed = 3, - particlespeedspread = 6.2, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 20, - particlelifespread = 13, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 20, - particlelifespread = 13, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[r1.25]], - particlelife = 28, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1.35, 0.5]], - gravity = [[0, 0.03, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 100, - particlesize = 45, - particlesizespread = 70, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 8, - particlelife = 10, - particlelifespread = 90, - particlesize = 5.2, - particlesizespread = 2.8, - particlespeed = 3.2, - particlespeedspread = 1.35, - pos = [[0, 5, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, + electricstormalt = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[30 r100]], + explosiongenerator = [[custom:lightning_stormbigalt]], + pos = [[-100 r160, 55 r50, -100 r160]], + }, + }, - ["selfrepair-sparks"] = { - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.2 0.8 0.2 0.02 0.4 0.8 0.4 0.01 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.981, 0]], - numparticles = 3, - particlelife = 10, - particlelifespread = 15, - particlesize = 10, - particlesizespread = 30, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 0.75, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - }, - ["wallexplosion-metal"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 15, - sizegrowth = -2, - speed = [[0, 1 0, 0]], - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.3 0 0 0 0.01]], - size = 65, - sizegrowth = -0.85, - ttl = 16, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], - size = 45, - sizegrowth = -3.9, - ttl = 11, - texture = [[groundflashwhite]], - }, - }, - -- explosion = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.81, - -- colormap = [[0 0 0 0 0.85 0.65 0.45 0.10 0.75 0.45 0.35 0.08 0.50 0.40 0.30 0.06 0.01 0.01 0.01 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.01, 0]], - -- numparticles = 4, - -- particlelife = 7, - -- particlelifespread = 9, - -- particlesize = 3.5, - -- particlesizespread = 10.8, - -- particlespeed = 1.4, - -- particlespeedspread = 3.75, - -- pos = [[0, 2, 0]], - -- sizegrowth = 0.35, - -- sizemod = 1, - -- texture = [[bigexplosmoke]], - -- useairlos = false, - -- }, - -- }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.0, - sizegrowth = [[-15 r8]], - ttl = 8, - pos = [[0, 10, 0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 11, - particlelifespread = 0, - particlesize = 14, - particlesizespread = 4, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - fireglow2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 0, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 14, - particlelifespread = 0, - particlesize = 33, - particlesizespread = 2, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particleLife=25, - particleLifeSpread=70, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=7, - particleSizeSpread=15 - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=50, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=11, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.44 0.46 0.95 0.017 0.30 0.32 0.7 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 15, - particlesize = 90, - particlesizespread = 130, - particlespeed = 1.9, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.75, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 24, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 18, - particlelifespread = 14, - particlesize = 1.6, - particlesizespread = -1.3, - particlespeed = 3.5, - particlespeedspread = 4.7, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 2, - particlelife = 33, - particlelifespread = 15, - particlesize = 1.5, - particlesizespread = -1.25, - particlespeed = 3, - particlespeedspread = 6.2, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[r1.25]], - particlelife = 28, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1.35, 0.5]], - gravity = [[0, 0.03, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 110, - particlesize = 45, - particlesizespread = 70, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 13, - particlelife = 10, - particlelifespread = 90, - particlesize = 5.2, - particlesizespread = 2.8, - particlespeed = 3.2, - particlespeedspread = 1.35, - pos = [[0, 5, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - ["wallexplosion-concrete"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.3, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[bigexplosmoke]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.3 0 0 0 0.01]], - size = 65, - sizegrowth = -0.85, - ttl = 16, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], - size = 45, - sizegrowth = -3.9, - ttl = 11, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.81, - colormap = [[0 0 0 0 0.85 0.65 0.45 0.10 0.75 0.45 0.35 0.08 0.50 0.40 0.30 0.06 0.01 0.01 0.01 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 9, - particlesize = 3.5, - particlesizespread = 10.8, - particlespeed = 1.4, - particlespeedspread = 3.75, - pos = [[0, 2, 0]], - sizegrowth = 0.35, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.0, - sizegrowth = [[-15 r8]], - ttl = 8, - pos = [[0, 10, 0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 11, - particlelifespread = 0, - particlesize = 14, - particlesizespread = 4, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - }, - }, - fireglow2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 0, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 14, - particlelifespread = 0, - particlesize = 33, - particlesizespread = 2, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particleLife=25, - particleLifeSpread=70, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=7, - particleSizeSpread=15 - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=50, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=11, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.95 0.50 0.35 0.017 0.7 0.5 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 15, - particlesize = 90, - particlesizespread = 130, - particlespeed = 2.9, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.75, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 24, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 18, - particlelifespread = 14, - particlesize = 1.6, - particlesizespread = -1.3, - particlespeed = 3.5, - particlespeedspread = 4.7, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 2, - particlelife = 33, - particlelifespread = 15, - particlesize = 1.5, - particlesizespread = -1.25, - particlespeed = 3, - particlespeedspread = 6.2, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 4, - particlespeed = 2.4, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.75]], - particlelife = 24, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 4, - particlespeed = 2.4, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[r1.25]], - particlelife = 28, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 4, - particlespeed = 2.4, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1.35, 0.5]], - gravity = [[0, 0.03, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 110, - particlesize = 45, - particlesizespread = 70, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 13, - particlelife = 10, - particlelifespread = 90, - particlesize = 5.2, - particlesizespread = 2.8, - particlespeed = 3.2, - particlespeedspread = 1.35, - pos = [[0, 5, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - ["wallexplosion-water"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 15, - sizegrowth = -2, - speed = [[0, 1 0, 0]], - texture = [[bigexplosmoke]], - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 16, - particlespeed = [[2 i0.25]], - particlespeedspread = 2, - pos = [[0, 18, 0]], - sizegrowth = -0.25, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 12.5, - sizegrowth = 2, - ttl = 65, - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 3, - particlelife = 4, - particlelifespread = 28, - particlesize = [[1 r2]], - particlesizespread = 0, - particlespeed = [[1.2 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.9 0.9 0.9 0.12 0.65 0.65 0.65 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.0, - sizegrowth = [[-15 r8]], - ttl = 8, - pos = [[0, 10, 0]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.32 0.32 0.32 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 11, - particlelifespread = 0, - particlesize = 14, - particlesizespread = 4, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - }, - }, - fireglow2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.26 0.22 0.22 0.26 0.44 0.38 0.38 0.44 0.14 0.14 0.14 0.2 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 0, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 14, - particlelifespread = 0, - particlesize = 33, - particlesizespread = 2, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap = [[0.7 0.6 0.6 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particleLife=25, - particleLifeSpread=70, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=7, - particleSizeSpread=15 - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[0.6 0.5 0.5 0.6 0.25 0.25 0.25 0.5 0.15 0.15 0.15 0.44 0.1 0.1 0.1 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=50, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=11, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 8, - particlelife = 11, - particlelifespread = 21, - particlesize = 6, - particlesizespread = 18, - particlespeed = 1, - particlespeedspread = 8, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.6, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 24, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 18, - particlelifespread = 14, - particlesize = 1.6, - particlesizespread = -1.3, - particlespeed = 3.5, - particlespeedspread = 4.7, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 2, - particlelife = 33, - particlelifespread = 15, - particlesize = 1.5, - particlesizespread = -1.25, - particlespeed = 3, - particlespeedspread = 6.2, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - colormap = [[0.65 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[r1.25]], - particlelife = 28, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1.35, 0.5]], - gravity = [[0, 0.03, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 110, - particlesize = 45, - particlesizespread = 70, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 4, 0]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 13, - particlelife = 10, - particlelifespread = 90, - particlesize = 5.2, - particlesizespread = 2.8, - particlespeed = 3.2, - particlespeedspread = 1.35, - pos = [[0, 5, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - ["subtorpfire"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 20, - sizegrowth = -1.5, - speed = [[0, 1 0, 0]], - texture = [[bigexplosmoke]], - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 10, - particlelife = 20, - particlelifespread = 20, - particlesize = 1, - particlesizespread = 8, - particlespeed = [[1 i0.25]], - particlespeedspread = 2, - pos = [[0, 9, 0]], - sizegrowth = -0.25, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, - ["subtorpfire-medium"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 40, - sizegrowth = -1.5, - speed = [[0, 1 0, 0]], - texture = [[bigexplosmoke]], - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 10, - particlelife = 20, - particlelifespread = 20, - particlesize = 2, - particlesizespread = 12, - particlespeed = [[1 i0.25]], - particlespeedspread = 2, - pos = [[0, 9, 0]], - sizegrowth = -0.25, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, - ["juno-explo"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.7, - maxheat = 11, - pos = [[r-10 r10, 50, r-10 r10]], - rotParams = [[-150 r300, -30 r60, -180 r360]], - size = 20, - sizegrowth = 10, - speed = [[0, 1 0, 0]], - texture = [[greennovaexplo]], - alwaysvisible = true, - }, - }, - -- pop1 = { - -- class = [[CHeatCloudProjectile]], - -- air=1, - -- water=1, - -- ground=1, - -- count=1, - -- properties ={ - -- alwaysVisible=1, - -- texture=[[explo]], - -- heat = 10, - -- maxheat = 10, - -- heatFalloff = 0.9, - -- size = 6, - -- sizeGrowth = 12, - -- pos = [[r-10 r10, 20, r-10 r10]], - -- speed=[[0, 0, 0]], - -- }, - -- }, - groundflash_large_long = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - rotParams = [[4 r2, -0.5, -180 r360]], - colormap = [[0.82 0.99 0.22 0.45 0.72 0.92 0.2 0.30 0 0 0 0.01]], - size = 700, - ttl = 50, - sizegrowth = 0, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.82 0.99 0.22 0.77 0 0 0 0.01]], - size = 190, - sizegrowth = 0, - ttl = 70, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 1, - sidetexture = [[none]], - size = [[38 r28]], - sizegrowth = 2, - ttl = 100, - pos = [[0.5, 1, 0.0]], - rotParams = [[-6 r12, -3 r6, -180 r360]], - }, - }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 32, - particlelifespread = 35, - particlesize = -24, - particlesizespread = -48, - particlespeed = 2.8, - particlespeedspread = 14, - pos = [[-10 r20,-32, -10 r20]], - sizegrowth = -0.2, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterfoam = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[70 r12]], - sizegrowth = [[0.6 r0.9]], - ttl = 90, - rotParams = [[-4 r8, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - -- kickedupwater = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- air = false, - -- ground = false, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 3, - -- particlelife = 2, - -- particlelifespread = 45, - -- particlesize = 3, - -- particlesizespread = 1.5, - -- particlespeed = 12, - -- particlespeedspread = 20, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.5, - -- sizemod = 1.0, - -- texture = [[wake]], - -- alwaysvisible = true, - -- }, - -- }, - -- explosion_flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.01, 0]], - -- numparticles = 11, - -- particlelife = 30, - -- particlelifespread = 16, - -- particlesize = 22, - -- particlesizespread = 39, - -- particlespeed = 7, - -- particlespeedspread = 7, - -- pos = [[0, 15, 0]], - -- sizegrowth = -0.3, - -- sizemod = 1, - -- texture = [[flashside3]], - -- useairlos = false, - -- alwaysvisible = true, - -- }, - -- }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 20, - particlelifespread = 25, - particlesize = 22, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 13, - particlelife = 24, - particlelifespread = 14, - particlesize = 38, - particlesizespread = 45, - particlespeed = 14.5, - particlespeedspread = 11, - pos = [[0, 4, 0]], - sizegrowth = -0.11, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.75 0.98 0.32 0.2 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[explo]], - useairlos = false, - alwaysvisible = true, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 400, - sidetexture = [[blastwave]], - size = 8, - sizegrowth = [[-29 r8]], - ttl = 32, - pos = [[0, 25, 0]], - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 4.8, - sizegrowth = [[-47 r7]], - ttl = 18, - pos = [[0, 45, 0]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 12, - particlelife = 26, - particlelifespread = 25, - particlesize = 40, - particlesizespread = -3.6, - particlespeed = 6, - particlespeedspread = 14, - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.17 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 5, - particlelife = 80, - particlelifespread = 150, - particlesize = 75, - particlesizespread = 120, - particlespeed = 0.3, - particlespeedspread = 8, - pos = [[0, 40, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[FireBall02-anim]], - animParams = [[8,8,100 r50]], - alwaysvisible = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 30, - particlelifespread = 5.75, - particlesize = 15, - particlesizespread = 40, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - junoring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.4 0.58 0.10 0.15 0.35 0.60 0.08 0.11 0.22 0.42 0.06 0.009 0.15 0.28 0.04 0.008 0.10 0.18 0.03 0.007 0.05 0.09 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 0, - sidetexture = [[none]], - size = 400, - sizegrowth = 0.16, - ttl = 200, - pos = [[0, 20, 0]], - rotParams = [[4 r2, -0.5, -180 r360]], - alwaysvisible = true, - }, - }, - -- moved to synced gadget-driven GL4 environmental lightning - }, - ["juno-explo-mini"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.7, - maxheat = 11, - pos = [[r-5 r5, 25, r-5 r5]], - rotParams = [[-150 r300, -30 r60, -180 r360]], - size = 14, - sizegrowth = 7, - speed = [[0, 1 0, 0]], - texture = [[greennovaexplo]], - alwaysvisible = true, - }, - }, - groundflash_large_long = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - rotParams = [[4 r2, -0.5, -180 r360]], - colormap = [[0.82 0.99 0.22 0.45 0.72 0.92 0.2 0.30 0 0 0 0.01]], - size = 500, - ttl = 350, - sizegrowth = 0, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.82 0.99 0.22 0.77 0 0 0 0.01]], - size = 135, - sizegrowth = 0, - ttl = 60, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 12, - particlelifespread = 15, - particlesize = 13, - particlesizespread = 16, - particlespeed = 4, - particlespeedspread = 4.5, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.88, - colormap = [[0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.82 0.99 0.22 0.03 0.21 0.33 0.07 0.005 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 13, - particlelife = 24, + electricstormxl = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[60 r110]], + explosiongenerator = [[custom:lightning_stormflares]], + pos = [[-20 r150, 150 r25, -20 r150]], + alwaysvisible = true, + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[190 r75]], + sidetexture = [[flamestream]], + size = [[60 r15]], + sizegrowth = 1.3, + ttl = [[42 r8]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-8 r16, -10 r6, -8 r16]], + drawOrder = 0, + castShadow = true, + }, + }, + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], + --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + size = [[450 r200]], + sizegrowth = 0, + --dir = [[0, 0, 0]], + --sizemod = 0.95, + ttl = 80, + --sizegrowth = 10, + pos = [[0, 75, 0]], + rotParams = [[0, 0, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,80]], + }, + }, + }, + ["afusexplxl"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.7, + maxheat = 11, + pos = [[r-10 r10, 50, r-10 r10]], + size = 30, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.7 0.68 0.48 0.5 0.3 0.25 0.2 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 1400, + sizegrowth = [[0.4 r0.2]], + ttl = 8, + pos = [[0, 180, 0]], + drawOrder = 1, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + texture = [[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 0.9, + size = 8, + sizeGrowth = 16, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + rotParams = [[4 r2, -1 r-0.5, -180 r360]], + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 75, + ttl = 80, + sizegrowth = 12, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[8 r4, -1 r-0.5, -180 r360]], + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 230, + sizegrowth = 5, + ttl = 80, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[-20 r40, -5 r10, -180 r360]], + colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], + size = 120, + sizegrowth = 28, + ttl = 60, + --sizegrowth = 10, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + explosion_flames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.03 0.1 0.04 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 11, + particlelife = 34, + particlelifespread = 16, + particlesize = 26, + particlesizespread = 39, + particlespeed = 8, + particlespeedspread = 10, + pos = [[0, 15, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.20 0.06 0.004 0.006 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 8, + particlelife = 40, + particlelifespread = 25, + particlesize = 24, + particlesizespread = 29, + particlespeed = 7, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 2.2, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[4 r2.5]], + particlelife = 90, + particlelifespread = 25, + particlesize = 7, + particlesizespread = 3.7, + particlespeed = 9.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r2.2]], + particlelife = 60, + particlelifespread = 18, + particlesize = 8, + particlesizespread = 3.7, + particlespeed = 9.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[2 r2]], + particlelife = 70, + particlelifespread = 20, + particlesize = 8, + particlesizespread = 3.7, + particlespeed = 9.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.88, + colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 10, + particlelife = 22, particlelifespread = 14, - particlesize = 38, + particlesize = 38, particlesizespread = 45, - particlespeed = 14.5, + particlespeed = 14.5, particlespeedspread = 11, - pos = [[0, 4, 0]], - sizegrowth = -0.11, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, + pos = [[0, 4, 0]], + sizegrowth = -0.11, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, }, }, fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.75 0.98 0.32 0.2 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 20, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 30, particlelifespread = 0, - particlesize = 70, - particlesizespread = 45, - particlespeed = 3, + particlesize = 150, + particlesizespread = 64, + particlespeed = 3, particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[explo]], - useairlos = false, - alwaysvisible = true, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[explo]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, }, }, shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 200, - sidetexture = [[blastwave]], - size = 5.5, - sizegrowth = [[-29 r8]], - ttl = 32, - pos = [[0, 25, 0]], - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.75 0.98 0.32 0.02 0.67 0.67 0.35 0.015 0.21 0.33 0.07 0.012 0.11 0.15 0.03 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 200, - sidetexture = [[none]], - size = 4.8, - sizegrowth = [[-47 r7]], - ttl = 18, - pos = [[0, 45, 0]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[0.03 0.04 0.01 0 0.1 0.15 0.033 0.66 0.1 0.14 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 12, - particlelife = 13, - particlelifespread = 25, - particlesize = 28, - particlesizespread = -3.6, - particlespeed = 6, - particlespeedspread = 14, - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 5, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.17 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 5, - particlelife = 40, - particlelifespread = 75, - particlesize = 30, - particlesizespread = 56, - particlespeed = 0.3, - particlespeedspread = 8, - pos = [[0, 40, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 15, - particlelifespread = 5.75, - particlesize = 7.5, - particlesizespread = 28, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - junoring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.4 0.58 0.10 0.15 0.35 0.60 0.08 0.11 0.22 0.42 0.06 0.009 0.15 0.28 0.04 0.008 0.10 0.18 0.03 0.007 0.05 0.09 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 0, - sidetexture = [[none]], - size = 280, - sizegrowth = 0.16, - ttl = 200, - pos = [[0, 20, 0]], - rotParams = [[4 r2, -0.5, -180 r360]], - alwaysvisible = true, - }, - }, - -- moved to synced gadget-driven GL4 environmental lightning, - }, - ["junocloud"] = { - usedefaultexplosions = false, - grounddust1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.0 0.4 0.54 0.17 0.18 0.2 0.29 0.01 0.09 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], - numparticles = [[1.5 r1]], - particlelife = 150, - particlelifespread = 120, - particlesize = 125, - particlesizespread = 300, - particlespeed = 4.5, - particlespeedspread = 4.5, - pos = [[-50 r100, -25 r75, -50 r100]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke_puff]], - alwaysvisible = true, - }, - }, - grounddust2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.0 0.4 0.54 0.17 0.18 0.2 0.29 0.01 0.09 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], - numparticles = [[1.4 r1]], - particlelife = 160, - particlelifespread = 120, - particlesize = 125, - particlesizespread = 300, - particlespeed = 4.5, - particlespeedspread = 4.5, - pos = [[-50 r100, -25 r75, -50 r100]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke_puff2]], - alwaysvisible = true, - }, - }, - }, - ["juno-damage"] = { - usedefaultexplosions = false, - -- engine = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- alwaysVisible = true, - -- colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[none]], - -- length = [[-15 r3.5]], - -- sidetexture = [[muzzleside]], - -- size = 15.5, - -- sizegrowth = [[0.2 r0.3]], - -- ttl = 1, - -- }, - -- }, - -- lightningballs = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 1, - -- colormap = [[0 0 0 0.01 0.66 0.92 0.66 0.10 0.66 0.86 0.66 0.01 0 0 0 0.01]], - -- directional = true, - -- emitrot = 80, - -- emitrotspread = 120, - -- emitvector = [[1, 1, 1]], - -- gravity = [[0, 0, 0]], - -- numparticles = 2, - -- particlelife = 3, - -- particlelifespread = 5, - -- particlesize = 8, - -- particlesizespread = 20, - -- particlespeed = 0.04, - -- particlespeedspread = 0, - -- pos = [[-10 r10, -25 r50, -10 r10]], - -- sizegrowth = -0.2, - -- sizemod = 1.0, - -- texture = [[lightninginair]], - -- }, - --}, - fireglow = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.77 0.98 0.77 0.2 0.75 0.98 0.32 0.2 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0, 0.0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 9, - particlesizespread = 20, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = 1.9, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = true, - }, - }, - exhale = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.65 0.92 0.26 0.3 0.6 0.88 0.24 0.2 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.2, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 9, - particlesizespread = 11, - particlespeed = 0.25, - particlespeedspread = 0.4, - pos = [[0, 1, 0]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.65 0.92 0.26 0.25 0.6 0.88 0.24 0.1 0.06 0.088 0.02 0.25 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 2, - particlelife = 25, - particlelifespread = 15, - particlesize = 5, - particlesizespread = 6, - particlespeed = 0.25, - particlespeedspread = 0.5, - pos = [[0, 1, 0]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - -- smoke = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.92, - -- colormap = [[0.012 0.012 0.012 0.05 0.10 0.08 0.066 0.66 0.08 0.076 0.086 0.56 0.08 0.076 0.084 0.44 0.05 0.05 0.05 0.28 0.028 0.028 0.028 0.13 0.012 0.012 0.012 0.05 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 7, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.04, 0.0]], - -- numparticles = [[1 r1]], - -- particlelife = 14, - -- particlelifespread = 25, - -- particlesize = 5, - -- particlesizespread = 6, - -- particlespeed = 1.5, - -- particlespeedspread = 1.5, - -- pos = [[-15 r30, -15 r30, -15 r30]], - -- sizegrowth = 0.32, - -- sizemod = 1, - -- texture = [[smoke]], - -- useairlos = true, - -- }, - -- }, - -- dustparticles = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.77, - -- colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], - -- directional = true, - -- emitrot = 80, - -- emitrotspread = 15, - -- emitvector = [[dir]], - -- gravity = [[0, -0.011, 0]], - -- numparticles = 1, - -- particlelife = 9, - -- particlelifespread = 6, - -- particlesize = 4, - -- particlesizespread = 0.8, - -- particlespeed = 0.05, - -- particlespeedspread = 0.6, - -- pos = [[0, 0, 0]], - -- sizegrowth = 0.06, - -- sizemod = 1.0, - -- texture = [[randomdots]], - -- }, - -- }, - }, - ["fusexpl"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.8, - maxheat = 20, - pos = [[r-10 r10, 50, r-10 r10]], - size = 8, - sizegrowth = 18, - speed = [[0, 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.84 0.70 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 300, - sizegrowth = [[0.6 r0.2]], - ttl = 7, - pos = [[0, 180, 0]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=2, - properties ={ - --alwaysVisible=1, - texture=[[explo]], - heat = 8, - maxheat = 10, - heatFalloff = 0.8, - size = 2, - sizeGrowth = 10, - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - rotParams = [[6 r6, -1 r2, -180 r360]], - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 80, - ttl = 65, - sizegrowth = 12, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - -- groundflash_largequick = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- properties = { - -- colormap = [[1 0.95 0.8 0.8 0.7 0.5 0.4 0.45 0 0 0 0.01]], - -- size = 600, - -- ttl = 70, - -- sizegrowth = 4, - -- texture = [[shotgunflare]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[8 r6, -1 r-0.5, -180 r360]], - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 110, - sizegrowth = 0, - ttl = 80, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[-8 r16, -3 r6, -180 r360]], - colormap = [[1 0.93 0.75 0.3 0.5 0.46 0.32 0.05 0 0 0 0.01]], - size = 80, - sizegrowth = 32, - ttl = 45, - texture = [[groundflash]], - }, - }, - -- kickedupwater = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- air = false, - -- ground = false, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 100, - -- particlelife = 2, - -- particlelifespread = 45, - -- particlesize = 3, - -- particlesizespread = 1.5, - -- particlespeed = 12, - -- particlespeedspread = 20, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.5, - -- sizemod = 1.0, - -- texture = [[wake]], - -- alwaysvisible = true, - -- }, - -- }, - explosion_flames = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 8, - particlelife = 26, - particlelifespread = 12, - particlesize = 12, - particlesizespread = 28, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 15, 0]], - sizegrowth = -0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.007 0.20 0.06 0.004 0.006 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 7, - particlelife = 30, - particlelifespread = 20, - particlesize = 15, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.1, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[3 r2.3]], - particlelife = 80, - particlelifespread = 25, - particlesize = 6, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r2.2]], - particlelife = 70, - particlelifespread = 18, - particlesize = 7, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r1.5]], - particlelife = 75, - particlelifespread = 20, - particlesize = 8, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.87, - colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 12, - particlelife = 22, - particlelifespread = 14, - particlesize = 36, - particlesizespread = 42, - particlespeed = 12.5, - particlespeedspread = 10, - pos = [[0, 4, 0]], - sizegrowth = -0.11, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[explo]], - useairlos = false, - alwaysvisible = true, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 400, - sidetexture = [[none]], - size = 7, - sizegrowth = [[-29 r6]], - ttl = 30, - pos = [[0, 25, 0]], - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 4.5, - sizegrowth = [[-45 r6]], - ttl = 11, - pos = [[0, 45, 0]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.13, 0]], - numparticles = 24, - particlelife = 65, - particlelifespread = 45, - particlesize = 34, - particlesizespread = -3.6, - particlespeed = 3, - particlespeedspread = 6, - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 20, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 20, - particlelife = 100, - particlelifespread = 40, - particlesize = 3, - particlesizespread = -1.5, - particlespeed = 6, - particlespeedspread = 12, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.10, 0]], - numparticles = 5, - particlelife = 60, - particlelifespread = 35, - particlesize = 70, - particlesizespread = -3.6, - particlespeed = 4, - particlespeedspread = 3, - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 25, - particlelife = 70, - particlelifespread = 120, - particlesize = 44, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 5, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 25, - particlelifespread = 5.75, - particlesize = 13, - particlesizespread = 30, - particlespeed = 5.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 8, - particlelife = 140, - particlelifespread = 60, - particlesize = 80.4, - particlesizespread = 30.5, - particlespeed = 12, - particlespeedspread = 3, - pos = [[0, 50, 0]], - sizegrowth = 0.2, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 1, - sidetexture = [[none]], - size = [[38 r28]], - sizegrowth = 2, - ttl = 100, - pos = [[0.5, 1, 0.0]], - rotParams = [[-6 r12, -3 r6, -180 r360]], - }, - }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 32, - particlelifespread = 35, - particlesize = -24, - particlesizespread = -48, - particlespeed = 2.8, - particlespeedspread = 14, - pos = [[-10 r20,-32, -10 r20]], - sizegrowth = -0.2, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterfoam = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[70 r12]], - sizegrowth = [[0.6 r0.9]], - ttl = 90, - rotParams = [[-4 r8, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - - fusfloor = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0]], - explosiongenerator = [[custom:afus-floor]], - pos = [[-10 r20, 130, -10 r20]], - alwaysvisible = true, - }, - }, - - electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[15 r70]], - explosiongenerator = [[custom:lightning_stormbig]], - pos = [[0 r75, 20 r50, 0 r75]], - alwaysvisible = true, - }, - }, - - electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 4, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[60 r90]], - explosiongenerator = [[custom:lightning_stormflares]], - pos = [[-20 r90, 120 r25, -20 r90]], - alwaysvisible = true, - }, - }, - - -- electricstorm2 = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 35, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[40 r200]], - -- explosiongenerator = [[custom:lightning_stormbolt]], - -- pos = [[-200 r400, 2 r60, -200 r400]], - -- }, - -- }, - }, - ["afusexpl"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.7, - maxheat = 11, - pos = [[r-10 r10, 50, r-10 r10]], - size = 20, - sizegrowth = 20, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - flameandsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - properties = { - airdrag = 0.88, - --colormap = [[0.8 0.78 0.6 0.85 1.0 0.97 0.7 0.97 0.8 0.7 0.55 0.89 0.22 0.13 0.1 0.72 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.90 0.7 1 0.89 0.58 0.35 0.85 0.22 0.16 0.13 0.73 0.16 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = true, - emitrot = 2, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.09 r0.09, -0.09 r0.18]], - numparticles = 1, - particlelife = 78, - particlelifespread = 35, - particlesize = 180.0, - particlesizespread = 60.0, - particlespeed = 12.4, - particlespeedspread = 12.2, - pos = [[-10 r20, 5 r5, -10 r20]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - sizegrowth = [[3.9 r2.5]], - sizemod = 0.99, - animParams = [[16,6,130 r55]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.7 0.68 0.48 0.5 0.3 0.25 0.2 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 1200, - sizegrowth = [[0.4 r0.2]], - ttl = 8, - pos = [[0, 180, 0]], - drawOrder = 1, - }, - }, - brightflareslow = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.94 0.80 0.95 0.82 0.70 0.60 0.21 0.37 0.24 0.18 0.12 0.13 0.10 0.08 0.06 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 6, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 380, - sizegrowth = [[0.4 r0.2]], - ttl = [[130 r65]], - pos = [[0, -250, 0]], - drawOrder = 1, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=1, - texture=[[explo]], - heat = 10, - maxheat = 10, - heatFalloff = 0.9, - size = 6, - sizeGrowth = 12, - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - rotParams = [[4 r2, -1 r-0.5, -180 r360]], - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 50, - ttl = 80, - sizegrowth = 12, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[8 r4, -1 r-0.5, -180 r360]], - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 170, - sizegrowth = 5, - ttl = 80, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[-20 r40, -5 r10, -180 r360]], - colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], - size = 80, - sizegrowth = 28, - ttl = 60, - --sizegrowth = 10, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - explosion_flames = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.03 0.1 0.04 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 11, - particlelife = 28, - particlelifespread = 14, - particlesize = 25, - particlesizespread = 32, - particlespeed = 7, - particlespeedspread = 7, - pos = [[0, 15, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.20 0.06 0.004 0.006 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 30, - particlelifespread = 20, - particlesize = 22, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[3 r2.3]], - particlelife = 90, - particlelifespread = 25, - particlesize = 6, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r2.2]], - particlelife = 60, - particlelifespread = 18, - particlesize = 7, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r1.5]], - particlelife = 70, - particlelifespread = 20, - particlesize = 8, - particlesizespread = 3.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.88, - colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 5, - particlelife = 22, - particlelifespread = 14, - particlesize = 38, - particlesizespread = 45, - particlespeed = 16.5, - particlespeedspread = 13, - pos = [[0, 4, 0]], - sizegrowth = -0.11, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[explo]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 40, - sidetexture = [[none]], - size = 8, - sizegrowth = [[29 r8]], - ttl = 32, - pos = [[0, 25, 0]], - drawOrder = 1, - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 40, - sidetexture = [[none]], - size = 4.8, - sizegrowth = [[47 r7]], - ttl = 12, - pos = [[0, 45, 0]], - }, - }, - shockwave_fast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - unit = true, - properties = { - colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.18 0.4 0.3 0.15 0.11 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[shockwave]], - length = 1, - sidetexture = [[none]], - size = 15, - sizegrowth = [[-40 r4]], - ttl = 9, - pos = [[0, 50, 0]], - drawOrder = 1, - useairlos = false, - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 10, - particlelife = 70, - particlelifespread = 50, - particlesize = 40, - particlesizespread = -3.6, - particlespeed = 3.8, - particlespeedspread = 8, - pos = [[0, 3, 0]], - rotParams = [[-20 r40, 0, -180 r360]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 32, - particlelife = 150, - particlelifespread = 40, - particlesize = 3, - particlesizespread = -1.5, - particlespeed = 10, - particlespeedspread = 18, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 7, - particlelife = 60, - particlelifespread = 40, - particlesize = 90, - particlesizespread = -3.6, - particlespeed = 4, - particlespeedspread = 3, - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 25, - particlelife = 40, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 30, - particlelifespread = 5.75, - particlesize = 15, - particlesizespread = 40, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 8, - particlelife = 140, - particlelifespread = 60, - particlesize = 80.4, - particlesizespread = 30.5, - particlespeed = 12, - particlespeedspread = 3, - pos = [[0, 50, 0]], - sizegrowth = 0.2, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 1, + sidetexture = [[none]], + size = 12, + sizegrowth = [[29 r8]], + ttl = 32, + pos = [[0, 25, 0]], + drawOrder = 1, + }, + }, + shockwavefast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 1, + sidetexture = [[none]], + size = 6.8, + sizegrowth = [[47 r7]], + ttl = 12, + pos = [[0, 45, 0]], + }, + }, + shockwave_fast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + unit = true, + properties = { + colormap = [[0 0 0 0.01 0.5 0.4 0.3 0.11 0.3 0.2 0.1 0.07 0.10 0.08 0.04 0.007 0.06 0.04 0.02 0.003 0 0 0 0.001]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[shockwave]], + length = 1, + sidetexture = [[none]], + size = 19, + sizegrowth = [[-35 r8]], + ttl = [[6 r3.5]], + pos = [[0, 50, 0]], + drawOrder = 1, + useairlos = false, + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 10, + particlelife = 70, + particlelifespread = 50, + particlesize = 55, + particlesizespread = -3.6, + particlespeed = 4.8, + particlespeedspread = 8, + pos = [[0, 3, 0]], + rotParams = [[-20 r40, 0, -180 r360]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 32, + particlelife = 150, + particlelifespread = 40, + particlesize = 4, + particlesizespread = -1.5, + particlespeed = 14, + particlespeedspread = 18, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.99, + colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 60, + particlelifespread = 40, + particlesize = 90, + particlesizespread = -3.6, + particlespeed = 4, + particlespeedspread = 3, + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 25, + particlelife = 40, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 30, + particlelifespread = 5.75, + particlesize = 15, + particlesizespread = 40, + particlespeed = 6.0, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = -0.30, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 8, + particlelife = 140, + particlelifespread = 60, + particlesize = 80.4, + particlesizespread = 30.5, + particlespeed = 12, + particlespeedspread = 3, + pos = [[0, 50, 0]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + castShadow = true, + }, + }, - afusfloor = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0]], - explosiongenerator = [[custom:afus-floor]], - pos = [[-10 r20, 130, -10 r20]], - alwaysvisible = true, - }, - }, + afusfloor = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0]], + explosiongenerator = [[custom:afus-floor]], + pos = [[-10 r20, 130, -10 r20]], + alwaysvisible = true, + }, + }, electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[15 r90]], + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[15 r90]], explosiongenerator = [[custom:lightning_stormbig]], - pos = [[0 r165, 50 r50, 0 r165]], - alwaysvisible = true, + pos = [[0 r165, 50 r50, 0 r165]], + alwaysvisible = true, }, }, - electricstormalt = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[30 r100]], - explosiongenerator = [[custom:lightning_stormbigalt]], - pos = [[-100 r160, 55 r50, -100 r160]], - }, - }, + electricstormalt = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[30 r100]], + explosiongenerator = [[custom:lightning_stormbigalt]], + pos = [[-100 r160, 55 r50, -100 r160]], + }, + }, electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[60 r110]], + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[60 r110]], explosiongenerator = [[custom:lightning_stormflares]], - pos = [[-20 r150, 150 r25, -20 r150]], - alwaysvisible = true, - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[190 r75]], - sidetexture = [[flamestream]], - size = [[60 r15]], - sizegrowth = 1.3, - ttl = [[42 r8]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-8 r16, -10 r6, -8 r16]], - drawOrder = 0, - castShadow = true, - }, - }, - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], - --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - size = [[450 r200]], - sizegrowth = 0, - --dir = [[0, 0, 0]], - --sizemod = 0.95, - ttl = 80, - --sizegrowth = 10, - pos = [[0, 75, 0]], - rotParams = [[0, 0, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,80]], - }, - }, + pos = [[-20 r150, 150 r25, -20 r150]], + alwaysvisible = true, + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[190 r75]], + sidetexture = [[flamestream]], + size = [[60 r15]], + sizegrowth = 1.3, + ttl = [[42 r8]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-8 r16, -10 r6, -8 r16]], + drawOrder = 0, + castShadow = true, + }, + }, }, - ["afusexplxl"] = { + ["afus-floor"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], + directional = true, + emitrot = 94, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = 7, + particlelife = 100, + particlelifespread = 150, + particlesize = 18, + particlesizespread = 22, + particlespeed = 13, + particlespeedspread = 8, + pos = [[0.0, 60, 0.0]], + sizegrowth = 1.03, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0 0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], + directional = false, + emitrot = 120, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = 4, + particlelife = 165, + particlelifespread = 115, + particlesize = 15, + particlesizespread = 24, + particlespeed = 11, + particlespeedspread = 12, + pos = [[0.0, 60, 0.0]], + rotParams = [[-15 r30, 0, -180 r360]], + sizegrowth = 1.01, + sizemod = 1, + texture = [[fogdirty]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + }, + }, + smoke3 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], + directional = false, + emitrot = 95, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.065, 0.0]], + numparticles = 1, + particlelife = 90, + particlelifespread = 130, + particlesize = 28, + particlesizespread = 85, + particlespeed = 11, + particlespeedspread = 12, + rotParams = [[-6 r12, -2 r4, -180 r360]], + pos = [[-20 r40, 40, -20 r40]], + sizegrowth = 1.01, + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + }, + ["t3unitexplosion"] = { centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.7, - maxheat = 11, - pos = [[r-10 r10, 50, r-10 r10]], - size = 30, - sizegrowth = 20, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.7 0.68 0.48 0.5 0.3 0.25 0.2 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 1400, - sizegrowth = [[0.4 r0.2]], - ttl = 8, - pos = [[0, 180, 0]], - drawOrder = 1, - }, - }, - pop1 = { + air = true, class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=1, - texture=[[explo]], - heat = 10, - maxheat = 10, + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.2, + maxheat = 14, + pos = [[r-2 r2, 5, r-2 r2]], + size = 5.5, + sizegrowth = 14.5, + speed = [[0, 1 0, 0]], + texture = [[explo]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + rotParams = [[-20 r40, -5 r10, -180 r360]], + colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], + size = 245, + sizegrowth = -3.3, + ttl = 52, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + rotParams = [[-15 r30, -5 r10, -180 r360]], + colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], + size = 220, + sizegrowth = -2.4, + ttl = 30, + texture = [[groundflashwhite]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + --alwaysVisible=1, + texture = [[explo]], + heat = 14, + maxheat = 20, heatFalloff = 0.9, - size = 8, - sizeGrowth = 16, - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - rotParams = [[4 r2, -1 r-0.5, -180 r360]], - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 75, - ttl = 80, - sizegrowth = 12, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[8 r4, -1 r-0.5, -180 r360]], - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 230, - sizegrowth = 5, - ttl = 80, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[-20 r40, -5 r10, -180 r360]], - colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], - size = 120, - sizegrowth = 28, - ttl = 60, - --sizegrowth = 10, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - explosion_flames = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.03 0.1 0.04 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 11, - particlelife = 34, - particlelifespread = 16, - particlesize = 26, - particlesizespread = 39, - particlespeed = 8, - particlespeedspread = 10, - pos = [[0, 15, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.20 0.06 0.004 0.006 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 8, - particlelife = 40, - particlelifespread = 25, - particlesize = 24, - particlesizespread = 29, - particlespeed = 7, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 2.2, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[4 r2.5]], - particlelife = 90, - particlelifespread = 25, - particlesize = 7, - particlesizespread = 3.7, - particlespeed = 9.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r2.2]], - particlelife = 60, - particlelifespread = 18, - particlesize = 8, - particlesizespread = 3.7, - particlespeed = 9.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[2 r2]], - particlelife = 70, - particlelifespread = 20, - particlesize = 8, - particlesizespread = 3.7, - particlespeed = 9.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.88, - colormap = [[0.9 0.85 0.77 0.025 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 10, - particlelife = 22, - particlelifespread = 14, - particlesize = 38, - particlesizespread = 45, - particlespeed = 14.5, - particlespeedspread = 11, - pos = [[0, 4, 0]], - sizegrowth = -0.11, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 0, - particlesize = 150, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[explo]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 1, - sidetexture = [[none]], - size = 12, - sizegrowth = [[29 r8]], - ttl = 32, - pos = [[0, 25, 0]], - drawOrder = 1, - }, - }, - shockwavefast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 1, - sidetexture = [[none]], - size = 6.8, - sizegrowth = [[47 r7]], - ttl = 12, - pos = [[0, 45, 0]], - }, - }, - shockwave_fast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - unit = true, - properties = { - colormap = [[0 0 0 0.01 0.5 0.4 0.3 0.11 0.3 0.2 0.1 0.07 0.10 0.08 0.04 0.007 0.06 0.04 0.02 0.003 0 0 0 0.001]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[shockwave]], - length = 1, - sidetexture = [[none]], - size = 19, - sizegrowth = [[-35 r8]], - ttl = [[6 r3.5]], - pos = [[0, 50, 0]], - drawOrder = 1, - useairlos = false, - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 10, - particlelife = 70, - particlelifespread = 50, - particlesize = 55, - particlesizespread = -3.6, - particlespeed = 4.8, - particlespeedspread = 8, - pos = [[0, 3, 0]], - rotParams = [[-20 r40, 0, -180 r360]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 32, - particlelife = 150, - particlelifespread = 40, - particlesize = 4, - particlesizespread = -1.5, - particlespeed = 14, - particlespeedspread = 18, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.99, - colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 7, - particlelife = 60, - particlelifespread = 40, - particlesize = 90, - particlesizespread = -3.6, - particlespeed = 4, - particlespeedspread = 3, - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 25, - particlelife = 40, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 30, - particlelifespread = 5.75, - particlesize = 15, - particlesizespread = 40, - particlespeed = 6.0, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = -0.30, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.08 0.07 0.06 0.2 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 8, - particlelife = 140, - particlelifespread = 60, - particlesize = 80.4, - particlesizespread = 30.5, - particlespeed = 12, - particlespeedspread = 3, - pos = [[0, 50, 0]], - sizegrowth = 0.2, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - castShadow = true, - }, - }, - - afusfloor = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0]], - explosiongenerator = [[custom:afus-floor]], - pos = [[-10 r20, 130, -10 r20]], - alwaysvisible = true, - }, - }, - - electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[15 r90]], - explosiongenerator = [[custom:lightning_stormbig]], - pos = [[0 r165, 50 r50, 0 r165]], - alwaysvisible = true, + size = 5, + sizeGrowth = 13, + pos = [[r-5 r10, 10, r-5 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.84, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 13, + particlelife = 6.5, + particlelifespread = 15, + particlesize = 24, + particlesizespread = 24.5, + particlespeed = 3.2, + particlespeedspread = 5.5, + pos = [[0, 5, 0]], + sizegrowth = 0.48, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 10, + particlesize = 7.8, + particlesizespread = 2.8, + particlespeed = 4.8, + particlespeedspread = 3.5, + pos = [[0, 0, 0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = 2.2, + sizemod = 0.92, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 19, + particlelifespread = 4, + particlesize = 190, + particlesizespread = 25, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particlelife = 66, + particleLifeSpread = 100, + numparticles = 5, + particlespeed = 3.3, + particlespeedspread = 10.5, + particlesize = 12, + particlesizespread = 24, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particlelife = 60, + particleLifeSpread = 75, + numparticles = 3.4, + particlespeed = 4.9, + particlespeedspread = 13, + particlesize = 27, + particlesizespread = 20, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 7, + particlelife = 52, + particlelifespread = 14, + particlesize = 100, + particlesizespread = 45, + particlespeed = 17, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.005 0.05 0.03 0.02 0.004 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 4.3, + sizegrowth = -34, + ttl = 16, + pos = [[0, 20, 0]], + drawOrder = 0, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.39, + -- ttl = 13, + -- expansionSpeed = 9, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.26, + -- ttl = 18.5, + -- expansionSpeed = 5.4, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + --unit = false, + properties = { + airdrag = 0.97, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 5, + particlelife = 20, + particlelifespread = 50, + particlesize = 17, + particlesizespread = 11, + particlespeed = 4.1, + particlespeedspread = 12, + pos = [[0, 6, 0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = -0.05, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 22, + particlelife = 105, + particlelifespread = 20, + particlesize = 2.2, + particlesizespread = -1.4, + particlespeed = 6.4, + particlespeedspread = 15, + pos = [[0, 6, 0]], + sizegrowth = -0.018, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[3 r2.3]], + particlelife = 45, + particlelifespread = 25, + particlesize = 4, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r2.2]], + particlelife = 35, + particlelifespread = 18, + particlesize = 4, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.5]], + particlelife = 40, + particlelifespread = 20, + particlesize = 4, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 3, + particlelife = 75, + particlelifespread = 110, + particlesize = 90, + particlesizespread = 90, + particlespeed = 3.8, + particlespeedspread = 3.8, + pos = [[0, 4, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + castShadow = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 17, + particlelife = 20, + particlelifespread = 55, + particlesize = 2.5, + particlesizespread = 1.1, + particlespeed = 6.3, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 3, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.65 r1.3, 0.3 r0.50, 0 r-0.65]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[90 r22]], + sidetexture = [[flamestream]], + size = [[45 r10]], + sizegrowth = 1.1, + ttl = [[42 r8]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-8 r16, -10 r6, -8 r16]], + drawOrder = 0, + castShadow = true, }, }, - - electricstormalt = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[30 r100]], - explosiongenerator = [[custom:lightning_stormbigalt]], - pos = [[-100 r160, 55 r50, -100 r160]], - }, - }, - - electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[60 r110]], - explosiongenerator = [[custom:lightning_stormflares]], - pos = [[-20 r150, 150 r25, -20 r150]], - alwaysvisible = true, - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[190 r75]], - sidetexture = [[flamestream]], - size = [[60 r15]], - sizegrowth = 1.3, - ttl = [[42 r8]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-8 r16, -10 r6, -8 r16]], - drawOrder = 0, - castShadow = true, - }, - }, }, - ["afus-floor"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], - directional = true, - emitrot = 94, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = 7, - particlelife = 100, - particlelifespread = 150, - particlesize = 18, - particlesizespread = 22, - particlespeed = 13, - particlespeedspread = 8, - pos = [[0.0, 60, 0.0]], - sizegrowth = 1.03, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0 0 0 0 0.01 0.20 0.14 0.08 0.01 0.16 0.12 0.06 0.15 0.12 0.10 0.08 0.38 0.11 0.09 0.07 0.30 0.10 0.08 0.07 0.24 0.09 0.065 0.055 0.22 0.08 0.06 0.045 0.20 0.065 0.048 0.037 0.18 0.045 0.035 0.03 0.16 0.05 0.04 0.035 0.1 0.038 0.029 0.022 0.1 0.026 0.020 0.017 0.05 0.023 0.018 0.016 0.05 0 0 0 0.01]], - directional = false, - emitrot = 120, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = 4, - particlelife = 165, - particlelifespread = 115, - particlesize = 15, - particlesizespread = 24, - particlespeed = 11, - particlespeedspread = 12, - pos = [[0.0, 60, 0.0]], - rotParams = [[-15 r30, 0, -180 r360]], - sizegrowth = 1.01, - sizemod = 1, - texture = [[fogdirty]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - }, - }, - smoke3 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], - directional = false, - emitrot = 95, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.065, 0.0]], - numparticles = 1, - particlelife = 90, - particlelifespread = 130, - particlesize = 28, - particlesizespread = 85, - particlespeed = 11, - particlespeedspread = 12, - rotParams = [[-6 r12, -2 r4, -180 r360]], - pos = [[-20 r40, 40, -20 r40]], - sizegrowth = 1.01, - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - }, - ["t3unitexplosion"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.2, - maxheat = 14, - pos = [[r-2 r2, 5, r-2 r2]], - size = 5.5, - sizegrowth = 14.5, - speed = [[0, 1 0, 0]], - texture = [[explo]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - rotParams = [[-20 r40, -5 r10, -180 r360]], - colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], - size = 245, - sizegrowth = -3.3, - ttl = 52, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - rotParams = [[-15 r30, -5 r10, -180 r360]], - colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], - size = 220, - sizegrowth = -2.4, - ttl = 30, - texture = [[groundflashwhite]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - --alwaysVisible=1, - texture=[[explo]], - heat = 14, - maxheat = 20, - heatFalloff = 0.9, - size = 5, - sizeGrowth = 13, - pos = [[r-5 r10, 10, r-5 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.84, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 13, - particlelife = 6.5, - particlelifespread = 15, - particlesize = 24, - particlesizespread = 24.5, - particlespeed = 3.2, - particlespeedspread = 5.5, - pos = [[0, 5, 0]], - sizegrowth = 0.48, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 10, - particlesize = 7.8, - particlesizespread = 2.8, - particlespeed = 4.8, - particlespeedspread = 3.5, - pos = [[0, 0, 0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = 2.2, - sizemod = 0.92, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 19, - particlelifespread = 4, - particlesize = 190, - particlesizespread = 25, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water = 1, - air = 1, - ground = 1, - count = 1, - properties = { - airdrag = 0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot = 33, - emitRotSpread = 50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particlelife = 66, - particleLifeSpread = 100, - numparticles = 5, - particlespeed = 3.3, - particlespeedspread = 10.5, - particlesize = 12, - particlesizespread = 24, - directional = 0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water = 1, - air = 1, - ground = 1, - count = 1, - properties = { - airdrag = 0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot = 33, - emitRotSpread = 50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture = [[graysmoke]], - particlelife = 60, - particleLifeSpread = 75, - numparticles = 3.4, - particlespeed = 4.9, - particlespeedspread = 13, - particlesize = 27, - particlesizespread = 20, - directional = 0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 7, - particlelife = 52, - particlelifespread = 14, - particlesize = 100, - particlesizespread = 45, - particlespeed = 17, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.005 0.05 0.03 0.02 0.004 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 4.3, - sizegrowth = -34, - ttl = 16, - pos = [[0, 20, 0]], - drawOrder = 0, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.39, - -- ttl = 13, - -- expansionSpeed = 9, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.26, - -- ttl = 18.5, - -- expansionSpeed = 5.4, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - --unit = false, - properties = { - airdrag = 0.97, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 5, - particlelife = 20, - particlelifespread = 50, - particlesize = 17, - particlesizespread = 11, - particlespeed = 4.1, - particlespeedspread = 12, - pos = [[0, 6, 0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = -0.05, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 22, - particlelife = 105, - particlelifespread = 20, - particlesize = 2.2, - particlesizespread = -1.4, - particlespeed = 6.4, - particlespeedspread = 15, - pos = [[0, 6, 0]], - sizegrowth = -0.018, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[3 r2.3]], - particlelife = 45, - particlelifespread = 25, - particlesize = 4, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r2.2]], - particlelife = 35, - particlelifespread = 18, - particlesize = 4, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.5]], - particlelife = 40, - particlelifespread = 20, - particlesize = 4, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 3, - particlelife = 75, - particlelifespread = 110, - particlesize = 90, - particlesizespread = 90, - particlespeed = 3.8, - particlespeedspread = 3.8, - pos = [[0, 4, 0]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - castShadow = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 17, - particlelife = 20, - particlelifespread = 55, - particlesize = 2.5, - particlesizespread = 1.1, - particlespeed = 6.3, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = 0.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 3, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.65 r1.3, 0.3 r0.50, 0 r-0.65]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[90 r22]], - sidetexture = [[flamestream]], - size = [[45 r10]], - sizegrowth = 1.1, - ttl = [[42 r8]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-8 r16, -10 r6, -8 r16]], - drawOrder = 0, - castShadow = true, - }, - }, - }, - -["starfire-explosion"] = { - -- blueelectricityspikes = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.7, - -- colormap = [[0.7 0.7 0.8 0.03 0.5 0.5 0.6 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.01, 0]], - -- numparticles = 1, - -- particlelife = 8, - -- particlelifespread = 5, - -- particlesize = 25, - -- particlesizespread = 30, - -- particlespeed = 0, - -- particlespeedspread = 13, - -- rotParams = [[-20 r40, -1 r2, -180 r360]], - -- pos = [[0, 2, 0]], - -- sizegrowth = 1.7, - -- sizemod = 1, - -- texture = [[flame_alt2]], - -- useairlos = false, - -- drawOrder = 1, - -- }, - -- }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 16, - heatfalloff = 1.15, - maxheat = 20, - rotParams = [[-120 r250, -80 r160, -180 r360]], - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = [[15 r6]], - speed = [[0, 2, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0.8 0.8 0.9 0.017 0.2 0.2 0.8 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 3, - particlelife = 20, - particlelifespread = 15, - particlesize = 20, - particlesizespread = 24, - particlespeed = 6.5, - particlespeedspread = 19.4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.88, - texture = [[gunshotxl]], - useairlos = false, - drawOrder = 2, - }, - }, - - groundflash = { - air = true, - flashalpha = 0.4, - flashsize = 120, - ground = true, - ttl = 25, - water = true, - underwater = true, - color = { - [1] = 0.4, - [2] = 0.5, - [3] = 0.8, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.3, - -- ttl = 8, - -- expansionSpeed = 9, - -- color = [[0.6, 0.60, 1]], - -- --alwaysvisible = true, - -- }, - -- }, - - - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.8, - maxheat = 12, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-250 r500, -80 r160, -180 r360]], - size = 60.5, - sizegrowth = 28, - speed = [[0, 1, 0]], - texture = [[brightblueexplo]], - drawOrder = 2, - }, - }, + ["starfire-explosion"] = { + -- blueelectricityspikes = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.7, + -- colormap = [[0.7 0.7 0.8 0.03 0.5 0.5 0.6 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.01, 0]], + -- numparticles = 1, + -- particlelife = 8, + -- particlelifespread = 5, + -- particlesize = 25, + -- particlesizespread = 30, + -- particlespeed = 0, + -- particlespeedspread = 13, + -- rotParams = [[-20 r40, -1 r2, -180 r360]], + -- pos = [[0, 2, 0]], + -- sizegrowth = 1.7, + -- sizemod = 1, + -- texture = [[flame_alt2]], + -- useairlos = false, + -- drawOrder = 1, + -- }, + -- }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 16, + heatfalloff = 1.15, + maxheat = 20, + rotParams = [[-120 r250, -80 r160, -180 r360]], + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = [[15 r6]], + speed = [[0, 2, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0.8 0.8 0.9 0.017 0.2 0.2 0.8 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 3, + particlelife = 20, + particlelifespread = 15, + particlesize = 20, + particlesizespread = 24, + particlespeed = 6.5, + particlespeedspread = 19.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.88, + texture = [[gunshotxl]], + useairlos = false, + drawOrder = 2, + }, + }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.65 0.46 0.22 0.8 0.53 1 0.12 0.5 0.52 0.92 0.06 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.4, 1, 0.4]], - gravity = [[0, -0.021, 0]], - numparticles = 2, - particlelife = 11, - particlelifespread = 19, - particlesize = 2, - particlesizespread = 4, - particlespeed = 2.25, - particlespeedspread = 2, - pos = [[0, 0, 0]], - rotParams = [[-8 r16, -4 r8, -180 r360]], - sizegrowth = [[1.4 r2.5]], - sizemod = 0.95, - texture = [[randomdots]], - }, - }, - -- innersmoke = { - -- class = [[CSimpleParticleSystem]], - -- water=0, - -- air=1, - -- ground=1, - -- count=2, - -- properties = { - -- airdrag=0.75, - -- alwaysVisible = 0, - -- colormap=[[1 0.66 0.4 0.45 0.28 0.18 0.12 0.42 0.17 0.14 0.10 0.36 0.12 0.11 0.1 0.33 0.1 0.09 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - -- directional=0, - -- emitRot=33, - -- emitRotSpread=50, - -- emitVector = [[0, 1, 0]], - -- gravity = [[0, 0.02, 0]], - -- numparticles=2, - -- particleLife=55, - -- particleLifeSpread=20, - -- particleSize=33, - -- particleSizeSpread=24, - -- particleSpeed=3.5, - -- particleSpeedSpread=9, - -- pos = [[r-1 r1, 0, r-1 r1]], - -- rotParams = [[-4 r8, -1 r2, -180 r360]], - -- sizeGrowth = 0.66, - -- sizeMod = 1, - -- Texture=[[dirtpuff]], - -- rotParams = [[-10 r20, -10 r20, -180 r360]], - -- castShadow = true, - -- }, - -- }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - colormap=[[1 0.76 0.74 0.45 0.43 0.32 0.23 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - directional=0, - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - numparticles=1, - particleLife=100, - particleLifeSpread=35, - particleSize=85, - particleSizeSpread=50, - particleSpeed=5, - particleSpeedSpread=8, - pos = [[r-3 r6, 0, r-3 r6]], - sizeGrowth = 0.45, - sizeMod = 1, - Texture=[[fogdirty]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, + groundflash = { + air = true, + flashalpha = 0.4, + flashsize = 120, + ground = true, + ttl = 25, + water = true, + underwater = true, + color = { + [1] = 0.4, + [2] = 0.5, + [3] = 0.8, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.3, + -- ttl = 8, + -- expansionSpeed = 9, + -- color = [[0.6, 0.60, 1]], + -- --alwaysvisible = true, + -- }, + -- }, - -- dirt = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- water = false, - -- air = false, - -- underwater = false, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - -- directional = true, - -- emitrot = 15, - -- emitrotspread = 36, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.2, 0]], - -- numparticles = 4, - -- particlelife = 21, - -- particlelifespread = 5, - -- particlesize = 1.75, - -- particlesizespread = -1.4, - -- particlespeed = 3.3, - -- particlespeedspread = 5, - -- pos = [[0, 6, 0]], - -- sizegrowth = -0.01, - -- sizemod = 1, - -- texture = [[bigexplosmoke]], - -- useairlos = false, - -- drawOrder = 1, - -- castShadow = true, - -- }, - -- }, - -- dirt2 = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- unit = false, - -- nounit = true, - -- water = false, - -- air = false, - -- underwater = false, - -- properties = { - -- airdrag = 1, - -- colormap = [[0.04 0.03 0.01 0 0.09 0.07 0.033 0.66 0.085 0.07 0.033 0.58 0.08 0.07 0.033 0.5 0.075 0.07 0.033 0.4 0 0 0 0 ]], - -- directional = true, - -- emitrot = 1, - -- emitrotspread = 13, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.33, 0]], - -- numparticles = 5, - -- particlelife = 28, - -- particlelifespread = 4, - -- particlesize = 1.8, - -- particlesizespread = -1.4, - -- particlespeed = 3.6, - -- particlespeedspread = 3.4, - -- rotParams = [[-4 r8, -1 r2, -180 r360]], - -- pos = [[0, 6, 0]], - -- sizegrowth = -0.01, - -- sizemod = 1, - -- texture = [[bigexplosmoke]], - -- useairlos = false, - -- drawOrder = 1, - -- castShadow = true, - -- }, - -- }, - -- shard1 = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- unit = true, - -- nounit = false, - -- underwater = false, - -- properties = { - -- airdrag = 0.93, - -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - -- directional = true, - -- emitrot = 35, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.3, 0]], - -- numparticles = 1, - -- particlelife = 36, - -- particlelifespread = 0, - -- particlesize = 1.9, - -- particlesizespread = 2.3, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 2, 0]], - -- sizegrowth = 0, - -- sizemod = 1, - -- texture = [[shard1]], - -- useairlos = false, - -- drawOrder = 1, - -- castShadow = true, - -- }, - -- }, - -- shard2 = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- unit = true, - -- nounit = false, - -- underwater = false, - -- properties = { - -- airdrag = 0.93, - -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - -- directional = true, - -- emitrot = 35, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.3, 0]], - -- numparticles = 2, - -- particlelife = 36, - -- particlelifespread = 0, - -- particlesize = 2, - -- particlesizespread = 2.35, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 2, 0]], - -- sizegrowth = 0, - -- sizemod = 1, - -- texture = [[shard2]], - -- useairlos = false, - -- castShadow = true, - -- }, - -- }, - -- shard3 = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- unit = true, - -- nounit = false, - -- underwater = false, - -- properties = { - -- airdrag = 0.93, - -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - -- directional = true, - -- emitrot = 35, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.3, 0]], - -- numparticles = 1, - -- particlelife = 36, - -- particlelifespread = 0, - -- particlesize = 2, - -- particlesizespread = 2.35, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 2, 0]], - -- sizegrowth = 0, - -- sizemod = 1, - -- texture = [[shard3]], - -- useairlos = false, - -- castShadow = true, - -- }, - -- }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0.01 0.01 0.01 0.1 0.20 0.20 0.20 0.50 0.27 0.27 0.27 0.71 0.23 0.23 0.23 0.77 0.18 0.18 0.18 0.65 0.10 0.10 0.10 0.40 0.05 0.05 0.05 0.22 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 1, - particlelife = 45, - particlelifespread = 50, - particlesize = 95, - particlesizespread = 180, - particlespeed = 1.2, - particlespeedspread = 4.5, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = [[0.20 r0.15]], - sizemod = 1.0, - texture = [[smoke-ice-anim]], - animParams = [[8,8,85 r40]], - drawOrder = 0, - --castShadow = true, - }, - }, - -- dirtrush = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- underwater = 0, - -- water = false, - -- properties = { - -- airdrag = 0.96, - -- colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], - -- directional = false, - -- emitrot = 7, - -- emitrotspread = 7, - -- emitvector = [[0.1, 1, 0.1]], - -- gravity = [[0, -0.05, 0]], - -- numparticles = 1, - -- particlelife = 22, - -- particlelifespread = 40, - -- particlesize = 7, - -- particlesizespread = 25, - -- particlespeed = 2, - -- particlespeedspread = 4, - -- rotParams = [[-3 r6, -3 r6, -180 r360]], - -- pos = [[-18 r36, -30 r10, -18 r36]], - -- sizegrowth = [[5.0 r0.65]], - -- sizemod = 0.95, - -- texture = [[dirtrush]], - -- useairlos = true, - -- drawOrder = 1, - -- castShadow = true, - -- }, - -- }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.8, + maxheat = 12, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-250 r500, -80 r160, -180 r360]], + size = 60.5, + sizegrowth = 28, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + drawOrder = 2, + }, + }, - }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.65 0.46 0.22 0.8 0.53 1 0.12 0.5 0.52 0.92 0.06 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.4, 1, 0.4]], + gravity = [[0, -0.021, 0]], + numparticles = 2, + particlelife = 11, + particlelifespread = 19, + particlesize = 2, + particlesizespread = 4, + particlespeed = 2.25, + particlespeedspread = 2, + pos = [[0, 0, 0]], + rotParams = [[-8 r16, -4 r8, -180 r360]], + sizegrowth = [[1.4 r2.5]], + sizemod = 0.95, + texture = [[randomdots]], + }, + }, + -- innersmoke = { + -- class = [[CSimpleParticleSystem]], + -- water=0, + -- air=1, + -- ground=1, + -- count=2, + -- properties = { + -- airdrag=0.75, + -- alwaysVisible = 0, + -- colormap=[[1 0.66 0.4 0.45 0.28 0.18 0.12 0.42 0.17 0.14 0.10 0.36 0.12 0.11 0.1 0.33 0.1 0.09 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + -- directional=0, + -- emitRot=33, + -- emitRotSpread=50, + -- emitVector = [[0, 1, 0]], + -- gravity = [[0, 0.02, 0]], + -- numparticles=2, + -- particleLife=55, + -- particleLifeSpread=20, + -- particleSize=33, + -- particleSizeSpread=24, + -- particleSpeed=3.5, + -- particleSpeedSpread=9, + -- pos = [[r-1 r1, 0, r-1 r1]], + -- rotParams = [[-4 r8, -1 r2, -180 r360]], + -- sizeGrowth = 0.66, + -- sizeMod = 1, + -- Texture=[[dirtpuff]], + -- rotParams = [[-10 r20, -10 r20, -180 r360]], + -- castShadow = true, + -- }, + -- }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + colormap = [[1 0.76 0.74 0.45 0.43 0.32 0.23 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + directional = 0, + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particleLife = 100, + particleLifeSpread = 35, + particleSize = 85, + particleSizeSpread = 50, + particleSpeed = 5, + particleSpeedSpread = 8, + pos = [[r-3 r6, 0, r-3 r6]], + sizeGrowth = 0.45, + sizeMod = 1, + Texture = [[fogdirty]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, -["ministarfire-explosion"] = { + -- dirt = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- water = false, + -- air = false, + -- underwater = false, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + -- directional = true, + -- emitrot = 15, + -- emitrotspread = 36, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.2, 0]], + -- numparticles = 4, + -- particlelife = 21, + -- particlelifespread = 5, + -- particlesize = 1.75, + -- particlesizespread = -1.4, + -- particlespeed = 3.3, + -- particlespeedspread = 5, + -- pos = [[0, 6, 0]], + -- sizegrowth = -0.01, + -- sizemod = 1, + -- texture = [[bigexplosmoke]], + -- useairlos = false, + -- drawOrder = 1, + -- castShadow = true, + -- }, + -- }, + -- dirt2 = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- unit = false, + -- nounit = true, + -- water = false, + -- air = false, + -- underwater = false, + -- properties = { + -- airdrag = 1, + -- colormap = [[0.04 0.03 0.01 0 0.09 0.07 0.033 0.66 0.085 0.07 0.033 0.58 0.08 0.07 0.033 0.5 0.075 0.07 0.033 0.4 0 0 0 0 ]], + -- directional = true, + -- emitrot = 1, + -- emitrotspread = 13, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.33, 0]], + -- numparticles = 5, + -- particlelife = 28, + -- particlelifespread = 4, + -- particlesize = 1.8, + -- particlesizespread = -1.4, + -- particlespeed = 3.6, + -- particlespeedspread = 3.4, + -- rotParams = [[-4 r8, -1 r2, -180 r360]], + -- pos = [[0, 6, 0]], + -- sizegrowth = -0.01, + -- sizemod = 1, + -- texture = [[bigexplosmoke]], + -- useairlos = false, + -- drawOrder = 1, + -- castShadow = true, + -- }, + -- }, + -- shard1 = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- unit = true, + -- nounit = false, + -- underwater = false, + -- properties = { + -- airdrag = 0.93, + -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + -- directional = true, + -- emitrot = 35, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.3, 0]], + -- numparticles = 1, + -- particlelife = 36, + -- particlelifespread = 0, + -- particlesize = 1.9, + -- particlesizespread = 2.3, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 2, 0]], + -- sizegrowth = 0, + -- sizemod = 1, + -- texture = [[shard1]], + -- useairlos = false, + -- drawOrder = 1, + -- castShadow = true, + -- }, + -- }, + -- shard2 = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- unit = true, + -- nounit = false, + -- underwater = false, + -- properties = { + -- airdrag = 0.93, + -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + -- directional = true, + -- emitrot = 35, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.3, 0]], + -- numparticles = 2, + -- particlelife = 36, + -- particlelifespread = 0, + -- particlesize = 2, + -- particlesizespread = 2.35, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 2, 0]], + -- sizegrowth = 0, + -- sizemod = 1, + -- texture = [[shard2]], + -- useairlos = false, + -- castShadow = true, + -- }, + -- }, + -- shard3 = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- unit = true, + -- nounit = false, + -- underwater = false, + -- properties = { + -- airdrag = 0.93, + -- colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + -- directional = true, + -- emitrot = 35, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.3, 0]], + -- numparticles = 1, + -- particlelife = 36, + -- particlelifespread = 0, + -- particlesize = 2, + -- particlesizespread = 2.35, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 2, 0]], + -- sizegrowth = 0, + -- sizemod = 1, + -- texture = [[shard3]], + -- useairlos = false, + -- castShadow = true, + -- }, + -- }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0.01 0.01 0.01 0.1 0.20 0.20 0.20 0.50 0.27 0.27 0.27 0.71 0.23 0.23 0.23 0.77 0.18 0.18 0.18 0.65 0.10 0.10 0.10 0.40 0.05 0.05 0.05 0.22 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 50, + particlesize = 95, + particlesizespread = 180, + particlespeed = 1.2, + particlespeedspread = 4.5, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = [[0.20 r0.15]], + sizemod = 1.0, + texture = [[smoke-ice-anim]], + animParams = [[8,8,85 r40]], + drawOrder = 0, + --castShadow = true, + }, + }, + -- dirtrush = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- underwater = 0, + -- water = false, + -- properties = { + -- airdrag = 0.96, + -- colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], + -- directional = false, + -- emitrot = 7, + -- emitrotspread = 7, + -- emitvector = [[0.1, 1, 0.1]], + -- gravity = [[0, -0.05, 0]], + -- numparticles = 1, + -- particlelife = 22, + -- particlelifespread = 40, + -- particlesize = 7, + -- particlesizespread = 25, + -- particlespeed = 2, + -- particlespeedspread = 4, + -- rotParams = [[-3 r6, -3 r6, -180 r360]], + -- pos = [[-18 r36, -30 r10, -18 r36]], + -- sizegrowth = [[5.0 r0.65]], + -- sizemod = 0.95, + -- texture = [[dirtrush]], + -- useairlos = true, + -- drawOrder = 1, + -- castShadow = true, + -- }, + -- }, + }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 16, - heatfalloff = 1.8, - maxheat = 20, - rotParams = [[-120 r250, -80 r160, -180 r360]], - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 8, - speed = [[0, 1, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, + ["ministarfire-explosion"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 16, + heatfalloff = 1.8, + maxheat = 20, + rotParams = [[-120 r250, -80 r160, -180 r360]], + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, - groundflash = { - air = true, - flashalpha = 0.1, - flashsize = 50, - ground = true, - ttl = 15, - water = true, - underwater = true, - color = { - [1] = 0.6, - [2] = 0.5, - [3] = 0.5, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.2, - -- ttl = 8, - -- expansionSpeed = 9, - -- color = [[0.16, 0.16, 0.17]], - -- --alwaysvisible = true, - -- }, - -- }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.82, - colormap = [[0.25 0.25 0.3 0.04 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 2, - emitvector = [[0, 1, 0]], - gravity = [[-0.03 r0.06, -0.01 r0.08, -0.03 r0.06]], - numparticles = 2, - particlelife = 40, - particlelifespread = 15, - particlesize = 22, - particlesizespread = 12, - particlespeed = 4.5, - particlespeedspread = 2, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 40, 0]], - sizegrowth = [[0.25 r0.12]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - --alwaysvisible = true, - }, - }, - grounddust2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.82, - colormap = [[0.25 0.25 0.3 0.06 0 0 0 0.0]], - directional = false, - emitrot = 75, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], - numparticles = 1, - particlelife = 40, - particlelifespread = 20, - particlesize = 12, - particlesizespread = 42, - particlespeed = 3.5, - particlespeedspread = 3, - rotParams = [[-8 r16, -8 r16, -180 r360]], - pos = [[0, 100, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[dirt]], - --alwaysvisible = true, - }, - }, + groundflash = { + air = true, + flashalpha = 0.1, + flashsize = 50, + ground = true, + ttl = 15, + water = true, + underwater = true, + color = { + [1] = 0.6, + [2] = 0.5, + [3] = 0.5, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.2, + -- ttl = 8, + -- expansionSpeed = 9, + -- color = [[0.16, 0.16, 0.17]], + -- --alwaysvisible = true, + -- }, + -- }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.82, + colormap = [[0.25 0.25 0.3 0.04 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 2, + emitvector = [[0, 1, 0]], + gravity = [[-0.03 r0.06, -0.01 r0.08, -0.03 r0.06]], + numparticles = 2, + particlelife = 40, + particlelifespread = 15, + particlesize = 22, + particlesizespread = 12, + particlespeed = 4.5, + particlespeedspread = 2, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 40, 0]], + sizegrowth = [[0.25 r0.12]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + --alwaysvisible = true, + }, + }, + grounddust2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.82, + colormap = [[0.25 0.25 0.3 0.06 0 0 0 0.0]], + directional = false, + emitrot = 75, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], + numparticles = 1, + particlelife = 40, + particlelifespread = 20, + particlesize = 12, + particlesizespread = 42, + particlespeed = 3.5, + particlespeedspread = 3, + rotParams = [[-8 r16, -8 r16, -180 r360]], + pos = [[0, 100, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[dirt]], + --alwaysvisible = true, + }, + }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 3.8, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-250 r500, -80 r160, -180 r360]], - size = 6.5, - sizegrowth = -0.5, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - drawOrder = 2, - }, - }, - }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 3.8, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-250 r500, -80 r160, -180 r360]], + size = 6.5, + sizegrowth = -0.5, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + drawOrder = 2, + }, + }, + }, } local size = 0.7 -definitions['t3unitexplosionmed'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionmed'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].sparks.properties.particlespeed * size) -definitions['t3unitexplosionmed'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionmed'].sparks.properties.particlespeedspread * size) -definitions['t3unitexplosionmed'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].explosion.properties.particlespeed * size) -definitions['t3unitexplosionmed'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionmed'].explosion.properties.particlesize * size) -definitions['t3unitexplosionmed'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionmed'].explosion.properties.particlelife * size) -definitions['t3unitexplosionmed'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].dustparticles.properties.particlespeed * size) -definitions['t3unitexplosionmed'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionmed'].dustparticles.properties.particlesize * size) -definitions['t3unitexplosionmed'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionmed'].dustparticles.properties.particlelife * size) -definitions['t3unitexplosionmed'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].dirt.properties.particlespeed * size) -definitions['t3unitexplosionmed'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionmed'].dirt.properties.particlespeedspread * size) -definitions['t3unitexplosionmed'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionmed'].dirt.properties.numparticles * size) -definitions['t3unitexplosionmed'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].dirt2.properties.particlespeed * size) -definitions['t3unitexplosionmed'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionmed'].dirt2.properties.particlespeedspread * size) -definitions['t3unitexplosionmed'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionmed'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionmed'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionmed'].shockwave.properties.ttl * size) -definitions['t3unitexplosionmed'].centerflare.properties.size = math.floor(definitions['t3unitexplosionmed'].centerflare.properties.size * size) -definitions['t3unitexplosionmed'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionmed'].centerflare.properties.heat * size) -definitions['t3unitexplosionmed'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionmed'].centerflare.properties.maxheat * size) -definitions['t3unitexplosionmed'].pop1.properties.size = math.floor(definitions['t3unitexplosionmed'].pop1.properties.size * size) -definitions['t3unitexplosionmed'].pop1.properties.heat = math.floor(definitions['t3unitexplosionmed'].pop1.properties.heat * size) -definitions['t3unitexplosionmed'].pop1.properties.maxheat = math.floor(definitions['t3unitexplosionmed'].pop1.properties.maxheat * size) -definitions['t3unitexplosionmed'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionmed'].groundflash_large.properties.size * size) -definitions['t3unitexplosionmed'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionmed'].groundflash_large.properties.ttl * size) -definitions['t3unitexplosionmed'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionmed'].groundflash_white.properties.size * size) -definitions['t3unitexplosionmed'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionmed'].grounddust.properties.particlesize * size) -definitions['t3unitexplosionmed'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionmed'].grounddust.properties.particlespeed * size) -definitions['t3unitexplosionmed'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionmed'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionmed'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionmed'].grounddust.properties.particlelife * size) -definitions['t3unitexplosionmed'].bigsmoketrails.properties.length = [[70 r20]] +definitions["t3unitexplosionmed"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionmed"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].sparks.properties.particlespeed * size) +definitions["t3unitexplosionmed"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionmed"].sparks.properties.particlespeedspread * size) +definitions["t3unitexplosionmed"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].explosion.properties.particlespeed * size) +definitions["t3unitexplosionmed"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionmed"].explosion.properties.particlesize * size) +definitions["t3unitexplosionmed"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionmed"].explosion.properties.particlelife * size) +definitions["t3unitexplosionmed"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].dustparticles.properties.particlespeed * size) +definitions["t3unitexplosionmed"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionmed"].dustparticles.properties.particlesize * size) +definitions["t3unitexplosionmed"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionmed"].dustparticles.properties.particlelife * size) +definitions["t3unitexplosionmed"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].dirt.properties.particlespeed * size) +definitions["t3unitexplosionmed"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionmed"].dirt.properties.particlespeedspread * size) +definitions["t3unitexplosionmed"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionmed"].dirt.properties.numparticles * size) +definitions["t3unitexplosionmed"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].dirt2.properties.particlespeed * size) +definitions["t3unitexplosionmed"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionmed"].dirt2.properties.particlespeedspread * size) +definitions["t3unitexplosionmed"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionmed"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionmed"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionmed"].shockwave.properties.ttl * size) +definitions["t3unitexplosionmed"].centerflare.properties.size = math.floor(definitions["t3unitexplosionmed"].centerflare.properties.size * size) +definitions["t3unitexplosionmed"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionmed"].centerflare.properties.heat * size) +definitions["t3unitexplosionmed"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionmed"].centerflare.properties.maxheat * size) +definitions["t3unitexplosionmed"].pop1.properties.size = math.floor(definitions["t3unitexplosionmed"].pop1.properties.size * size) +definitions["t3unitexplosionmed"].pop1.properties.heat = math.floor(definitions["t3unitexplosionmed"].pop1.properties.heat * size) +definitions["t3unitexplosionmed"].pop1.properties.maxheat = math.floor(definitions["t3unitexplosionmed"].pop1.properties.maxheat * size) +definitions["t3unitexplosionmed"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionmed"].groundflash_large.properties.size * size) +definitions["t3unitexplosionmed"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionmed"].groundflash_large.properties.ttl * size) +definitions["t3unitexplosionmed"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionmed"].groundflash_white.properties.size * size) +definitions["t3unitexplosionmed"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionmed"].grounddust.properties.particlesize * size) +definitions["t3unitexplosionmed"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionmed"].grounddust.properties.particlespeed * size) +definitions["t3unitexplosionmed"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionmed"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionmed"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionmed"].grounddust.properties.particlelife * size) +definitions["t3unitexplosionmed"].bigsmoketrails.properties.length = [[70 r20]] local size = 1.4 -definitions['t3unitexplosionxl'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionxl'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].sparks.properties.particlespeed * size) -definitions['t3unitexplosionxl'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxl'].sparks.properties.particlespeedspread * size) -definitions['t3unitexplosionxl'].sparks.properties.numparticles = math.floor(definitions['t3unitexplosionxl'].sparks.properties.numparticles * size) -definitions['t3unitexplosionxl'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].explosion.properties.particlespeed * size) -definitions['t3unitexplosionxl'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].explosion.properties.particlesize * size * 0.7) -definitions['t3unitexplosionxl'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionxl'].explosion.properties.particlelife * size) -definitions['t3unitexplosionxl'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].dustparticles.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxl'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].dustparticles.properties.particlesize * size * 0.5) -definitions['t3unitexplosionxl'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionxl'].dustparticles.properties.particlelife * size) -definitions['t3unitexplosionxl'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].dirt.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxl'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxl'].dirt.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxl'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionxl'].dirt.properties.numparticles * size) -definitions['t3unitexplosionxl'].dirt.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].dirt.properties.particlesize * size * 0.9) -definitions['t3unitexplosionxl'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].dirt2.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxl'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxl'].dirt2.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxl'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionxl'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionxl'].dirt2.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].dirt2.properties.particlesize * size * 0.9) -definitions['t3unitexplosionxl'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionxl'].shockwave.properties.ttl * size) -definitions['t3unitexplosionxl'].centerflare.properties.size = math.floor(definitions['t3unitexplosionxl'].centerflare.properties.size * size * 0.5) -definitions['t3unitexplosionxl'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionxl'].centerflare.properties.heat * size) -definitions['t3unitexplosionxl'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionxl'].centerflare.properties.maxheat * size) -definitions['t3unitexplosionxl'].pop1.properties.size = math.floor(definitions['t3unitexplosionxl'].pop1.properties.size * size * 0.7) -definitions['t3unitexplosionxl'].pop1.properties.heat = math.floor(definitions['t3unitexplosionxl'].pop1.properties.heat * size * 0.7) -definitions['t3unitexplosionxl'].pop1.properties.maxheat = math.floor(definitions['t3unitexplosionxl'].pop1.properties.maxheat * size * 0.7) -definitions['t3unitexplosionxl'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionxl'].groundflash_large.properties.size * size * 0.8) -definitions['t3unitexplosionxl'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionxl'].groundflash_large.properties.ttl * size * 0.7) -definitions['t3unitexplosionxl'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionxl'].groundflash_white.properties.size * size) -definitions['t3unitexplosionxl'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].grounddust.properties.particlesize * size) -definitions['t3unitexplosionxl'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxl'].grounddust.properties.particlespeed * size) -definitions['t3unitexplosionxl'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxl'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxl'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionxl'].grounddust.properties.particlelife * size * 0.6) -definitions['t3unitexplosionxl'].bigsmoketrails.properties.length = [[100 r25]] +definitions["t3unitexplosionxl"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionxl"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].sparks.properties.particlespeed * size) +definitions["t3unitexplosionxl"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxl"].sparks.properties.particlespeedspread * size) +definitions["t3unitexplosionxl"].sparks.properties.numparticles = math.floor(definitions["t3unitexplosionxl"].sparks.properties.numparticles * size) +definitions["t3unitexplosionxl"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].explosion.properties.particlespeed * size) +definitions["t3unitexplosionxl"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].explosion.properties.particlesize * size * 0.7) +definitions["t3unitexplosionxl"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionxl"].explosion.properties.particlelife * size) +definitions["t3unitexplosionxl"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].dustparticles.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxl"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].dustparticles.properties.particlesize * size * 0.5) +definitions["t3unitexplosionxl"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionxl"].dustparticles.properties.particlelife * size) +definitions["t3unitexplosionxl"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].dirt.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxl"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxl"].dirt.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxl"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionxl"].dirt.properties.numparticles * size) +definitions["t3unitexplosionxl"].dirt.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].dirt.properties.particlesize * size * 0.9) +definitions["t3unitexplosionxl"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].dirt2.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxl"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxl"].dirt2.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxl"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionxl"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionxl"].dirt2.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].dirt2.properties.particlesize * size * 0.9) +definitions["t3unitexplosionxl"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionxl"].shockwave.properties.ttl * size) +definitions["t3unitexplosionxl"].centerflare.properties.size = math.floor(definitions["t3unitexplosionxl"].centerflare.properties.size * size * 0.5) +definitions["t3unitexplosionxl"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionxl"].centerflare.properties.heat * size) +definitions["t3unitexplosionxl"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionxl"].centerflare.properties.maxheat * size) +definitions["t3unitexplosionxl"].pop1.properties.size = math.floor(definitions["t3unitexplosionxl"].pop1.properties.size * size * 0.7) +definitions["t3unitexplosionxl"].pop1.properties.heat = math.floor(definitions["t3unitexplosionxl"].pop1.properties.heat * size * 0.7) +definitions["t3unitexplosionxl"].pop1.properties.maxheat = math.floor(definitions["t3unitexplosionxl"].pop1.properties.maxheat * size * 0.7) +definitions["t3unitexplosionxl"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionxl"].groundflash_large.properties.size * size * 0.8) +definitions["t3unitexplosionxl"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionxl"].groundflash_large.properties.ttl * size * 0.7) +definitions["t3unitexplosionxl"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionxl"].groundflash_white.properties.size * size) +definitions["t3unitexplosionxl"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].grounddust.properties.particlesize * size) +definitions["t3unitexplosionxl"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxl"].grounddust.properties.particlespeed * size) +definitions["t3unitexplosionxl"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxl"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxl"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionxl"].grounddust.properties.particlelife * size * 0.6) +definitions["t3unitexplosionxl"].bigsmoketrails.properties.length = [[100 r25]] local size = 1.7 -definitions['t3unitexplosionxxl'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionxxl'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].sparks.properties.particlespeed * size * 0.9) -definitions['t3unitexplosionxxl'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxl'].sparks.properties.particlespeedspread * size) -definitions['t3unitexplosionxxl'].sparks.properties.numparticles = math.floor(definitions['t3unitexplosionxxl'].sparks.properties.numparticles * size) -definitions['t3unitexplosionxxl'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].explosion.properties.particlespeed * size) -definitions['t3unitexplosionxxl'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionxxl'].explosion.properties.particlesize * size * 0.9) -definitions['t3unitexplosionxxl'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionxxl'].explosion.properties.particlelife * size) -definitions['t3unitexplosionxxl'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].dustparticles.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxl'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionxxl'].dustparticles.properties.particlesize * size * 0.7) -definitions['t3unitexplosionxxl'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionxxl'].dustparticles.properties.particlelife * size) -definitions['t3unitexplosionxxl'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].dirt.properties.particlespeed * size * 0.7) -definitions['t3unitexplosionxxl'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxl'].dirt.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxxl'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionxxl'].dirt.properties.numparticles * size) -definitions['t3unitexplosionxxl'].dirt.properties.particlesize = math.floor(definitions['t3unitexplosionxxl'].dirt.properties.particlesize * size * 0.85) -definitions['t3unitexplosionxxl'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].dirt2.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxl'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxl'].dirt2.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxxl'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionxxl'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionxxl'].dirt2.properties.particlesize = math.floor(definitions['t3unitexplosionxl'].dirt2.properties.particlesize * size * 0.85) -definitions['t3unitexplosionxxl'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionxxl'].shockwave.properties.ttl * size * 1.05) -definitions['t3unitexplosionxxl'].shockwave.properties.size = math.floor(definitions['t3unitexplosionxxl'].shockwave.properties.size * size * 0.9) -definitions['t3unitexplosionxxl'].centerflare.properties.size = math.floor(definitions['t3unitexplosionxxl'].centerflare.properties.size * size * 0.8) -definitions['t3unitexplosionxxl'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionxxl'].centerflare.properties.heat * size) -definitions['t3unitexplosionxxl'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionxxl'].centerflare.properties.maxheat * size) -definitions['t3unitexplosionxxl'].pop1.properties.size = math.floor(definitions['t3unitexplosionxxl'].pop1.properties.size * size * 0.8) -definitions['t3unitexplosionxxl'].pop1.properties.heat = math.floor(definitions['t3unitexplosionxxl'].pop1.properties.heat * size * 0.6) -definitions['t3unitexplosionxxl'].pop1.properties.maxheat = math.floor(definitions['t3unitexplosionxxl'].pop1.properties.maxheat * size * 0.7) -definitions['t3unitexplosionxxl'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionxxl'].groundflash_large.properties.size * size * 0.8) -definitions['t3unitexplosionxxl'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionxxl'].groundflash_large.properties.ttl * size * 0.8) -definitions['t3unitexplosionxxl'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionxxl'].groundflash_white.properties.size * size) -definitions['t3unitexplosionxxl'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxl'].grounddust.properties.particlesize * size) -definitions['t3unitexplosionxxl'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxl'].grounddust.properties.particlespeed * size) -definitions['t3unitexplosionxxl'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxl'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxl'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxl'].grounddust.properties.particlelife * size * 0.7) -definitions['t3unitexplosionxxl'].bigsmoketrails.properties.length = [[110 r28]] +definitions["t3unitexplosionxxl"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionxxl"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].sparks.properties.particlespeed * size * 0.9) +definitions["t3unitexplosionxxl"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxl"].sparks.properties.particlespeedspread * size) +definitions["t3unitexplosionxxl"].sparks.properties.numparticles = math.floor(definitions["t3unitexplosionxxl"].sparks.properties.numparticles * size) +definitions["t3unitexplosionxxl"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].explosion.properties.particlespeed * size) +definitions["t3unitexplosionxxl"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionxxl"].explosion.properties.particlesize * size * 0.9) +definitions["t3unitexplosionxxl"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionxxl"].explosion.properties.particlelife * size) +definitions["t3unitexplosionxxl"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].dustparticles.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxl"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionxxl"].dustparticles.properties.particlesize * size * 0.7) +definitions["t3unitexplosionxxl"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionxxl"].dustparticles.properties.particlelife * size) +definitions["t3unitexplosionxxl"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].dirt.properties.particlespeed * size * 0.7) +definitions["t3unitexplosionxxl"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxl"].dirt.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxxl"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionxxl"].dirt.properties.numparticles * size) +definitions["t3unitexplosionxxl"].dirt.properties.particlesize = math.floor(definitions["t3unitexplosionxxl"].dirt.properties.particlesize * size * 0.85) +definitions["t3unitexplosionxxl"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].dirt2.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxl"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxl"].dirt2.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxxl"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionxxl"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionxxl"].dirt2.properties.particlesize = math.floor(definitions["t3unitexplosionxl"].dirt2.properties.particlesize * size * 0.85) +definitions["t3unitexplosionxxl"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionxxl"].shockwave.properties.ttl * size * 1.05) +definitions["t3unitexplosionxxl"].shockwave.properties.size = math.floor(definitions["t3unitexplosionxxl"].shockwave.properties.size * size * 0.9) +definitions["t3unitexplosionxxl"].centerflare.properties.size = math.floor(definitions["t3unitexplosionxxl"].centerflare.properties.size * size * 0.8) +definitions["t3unitexplosionxxl"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionxxl"].centerflare.properties.heat * size) +definitions["t3unitexplosionxxl"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionxxl"].centerflare.properties.maxheat * size) +definitions["t3unitexplosionxxl"].pop1.properties.size = math.floor(definitions["t3unitexplosionxxl"].pop1.properties.size * size * 0.8) +definitions["t3unitexplosionxxl"].pop1.properties.heat = math.floor(definitions["t3unitexplosionxxl"].pop1.properties.heat * size * 0.6) +definitions["t3unitexplosionxxl"].pop1.properties.maxheat = math.floor(definitions["t3unitexplosionxxl"].pop1.properties.maxheat * size * 0.7) +definitions["t3unitexplosionxxl"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionxxl"].groundflash_large.properties.size * size * 0.8) +definitions["t3unitexplosionxxl"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionxxl"].groundflash_large.properties.ttl * size * 0.8) +definitions["t3unitexplosionxxl"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionxxl"].groundflash_white.properties.size * size) +definitions["t3unitexplosionxxl"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxl"].grounddust.properties.particlesize * size) +definitions["t3unitexplosionxxl"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxl"].grounddust.properties.particlespeed * size) +definitions["t3unitexplosionxxl"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxl"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxl"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxl"].grounddust.properties.particlelife * size * 0.7) +definitions["t3unitexplosionxxl"].bigsmoketrails.properties.length = [[110 r28]] local size = 2.2 -definitions['t3unitexplosionxxxl'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionxxxl'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].sparks.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxxl'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].sparks.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxl'].sparks.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].sparks.properties.numparticles * size) -definitions['t3unitexplosionxxxl'].explosion.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].explosion.properties.numparticles * size) -definitions['t3unitexplosionxxxl'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].explosion.properties.particlespeed * size) -definitions['t3unitexplosionxxxl'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].explosion.properties.particlesize * size * 0.7) -definitions['t3unitexplosionxxxl'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].explosion.properties.particlelife * size) -definitions['t3unitexplosionxxxl'].dustparticles.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].dustparticles.properties.numparticles * size) -definitions['t3unitexplosionxxxl'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].dustparticles.properties.particlespeed * size * 0.9) -definitions['t3unitexplosionxxxl'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].dustparticles.properties.particlesize * size * 0.9) -definitions['t3unitexplosionxxxl'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].dustparticles.properties.particlelife * size * 1.2) -definitions['t3unitexplosionxxxl'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].dirt.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxxxl'].dirt.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].dirt.properties.particlesize * size * 0.8) -definitions['t3unitexplosionxxxl'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].dirt.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxxxl'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].dirt.properties.numparticles * size) -definitions['t3unitexplosionxxxl'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].dirt2.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxxxl'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].dirt2.properties.particlespeedspread * size * 0.6) -definitions['t3unitexplosionxxxl'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionxxxl'].dirt2.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].dirt2.properties.particlesize * size * 0.8) -definitions['t3unitexplosionxxxl'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionxxxl'].shockwave.properties.ttl * size * 0.8) -definitions['t3unitexplosionxxxl'].shockwave.properties.size = math.floor(definitions['t3unitexplosionxxxl'].shockwave.properties.size * size) -definitions['t3unitexplosionxxxl'].centerflare.properties.size = math.floor(definitions['t3unitexplosionxxxl'].centerflare.properties.size * size * 0.5) -definitions['t3unitexplosionxxxl'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionxxxl'].centerflare.properties.heat * size) -definitions['t3unitexplosionxxxl'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionxxxl'].centerflare.properties.maxheat * size) -definitions['t3unitexplosionxxxl'].pop1.properties.size = math.floor(definitions['t3unitexplosionxxxl'].pop1.properties.size * size * 0.8) -definitions['t3unitexplosionxxxl'].pop1.properties.heat = math.floor(definitions['t3unitexplosionxxxl'].pop1.properties.heat * size * 0.5) -definitions['t3unitexplosionxxxl'].pop1.properties.maxheat = math.floor(definitions['t3unitexplosionxxxl'].pop1.properties.maxheat * size * 0.6) -definitions['t3unitexplosionxxxl'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionxxxl'].groundflash_large.properties.size * size * 0.8) -definitions['t3unitexplosionxxxl'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionxxxl'].groundflash_large.properties.ttl * size * 0.7) -definitions['t3unitexplosionxxxl'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionxxxl'].groundflash_white.properties.size * size) -definitions['t3unitexplosionxxxl'].grounddust.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].grounddust.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxl'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].grounddust.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxl'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].grounddust.properties.particlespeed * size * 1.2) -definitions['t3unitexplosionxxxl'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxl'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].grounddust.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxl'].clouddust.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].clouddust.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxl'].clouddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].clouddust.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxl'].clouddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].clouddust.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxl'].clouddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].clouddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxl'].clouddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].clouddust.properties.particlelife * size * 1.2) -definitions['t3unitexplosionxxxl'].innersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].innersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxl'].innersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].innersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxl'].innersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].innersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxl'].innersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].innersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxl'].innersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].innersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxl'].outersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxl'].outersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxl'].outersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxl'].outersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxl'].outersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxl'].outersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxl'].outersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxl'].outersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxl'].outersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxl'].outersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxl'].bigsmoketrails.properties.length = [[140 r35]] +definitions["t3unitexplosionxxxl"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionxxxl"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].sparks.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxxl"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].sparks.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxl"].sparks.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].sparks.properties.numparticles * size) +definitions["t3unitexplosionxxxl"].explosion.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].explosion.properties.numparticles * size) +definitions["t3unitexplosionxxxl"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].explosion.properties.particlespeed * size) +definitions["t3unitexplosionxxxl"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].explosion.properties.particlesize * size * 0.7) +definitions["t3unitexplosionxxxl"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].explosion.properties.particlelife * size) +definitions["t3unitexplosionxxxl"].dustparticles.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].dustparticles.properties.numparticles * size) +definitions["t3unitexplosionxxxl"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].dustparticles.properties.particlespeed * size * 0.9) +definitions["t3unitexplosionxxxl"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].dustparticles.properties.particlesize * size * 0.9) +definitions["t3unitexplosionxxxl"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].dustparticles.properties.particlelife * size * 1.2) +definitions["t3unitexplosionxxxl"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].dirt.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxxxl"].dirt.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].dirt.properties.particlesize * size * 0.8) +definitions["t3unitexplosionxxxl"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].dirt.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxxxl"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].dirt.properties.numparticles * size) +definitions["t3unitexplosionxxxl"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].dirt2.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxxxl"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].dirt2.properties.particlespeedspread * size * 0.6) +definitions["t3unitexplosionxxxl"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionxxxl"].dirt2.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].dirt2.properties.particlesize * size * 0.8) +definitions["t3unitexplosionxxxl"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionxxxl"].shockwave.properties.ttl * size * 0.8) +definitions["t3unitexplosionxxxl"].shockwave.properties.size = math.floor(definitions["t3unitexplosionxxxl"].shockwave.properties.size * size) +definitions["t3unitexplosionxxxl"].centerflare.properties.size = math.floor(definitions["t3unitexplosionxxxl"].centerflare.properties.size * size * 0.5) +definitions["t3unitexplosionxxxl"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionxxxl"].centerflare.properties.heat * size) +definitions["t3unitexplosionxxxl"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionxxxl"].centerflare.properties.maxheat * size) +definitions["t3unitexplosionxxxl"].pop1.properties.size = math.floor(definitions["t3unitexplosionxxxl"].pop1.properties.size * size * 0.8) +definitions["t3unitexplosionxxxl"].pop1.properties.heat = math.floor(definitions["t3unitexplosionxxxl"].pop1.properties.heat * size * 0.5) +definitions["t3unitexplosionxxxl"].pop1.properties.maxheat = math.floor(definitions["t3unitexplosionxxxl"].pop1.properties.maxheat * size * 0.6) +definitions["t3unitexplosionxxxl"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionxxxl"].groundflash_large.properties.size * size * 0.8) +definitions["t3unitexplosionxxxl"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionxxxl"].groundflash_large.properties.ttl * size * 0.7) +definitions["t3unitexplosionxxxl"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionxxxl"].groundflash_white.properties.size * size) +definitions["t3unitexplosionxxxl"].grounddust.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].grounddust.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxl"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].grounddust.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxl"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].grounddust.properties.particlespeed * size * 1.2) +definitions["t3unitexplosionxxxl"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxl"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].grounddust.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxl"].clouddust.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].clouddust.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxl"].clouddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].clouddust.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxl"].clouddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].clouddust.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxl"].clouddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].clouddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxl"].clouddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].clouddust.properties.particlelife * size * 1.2) +definitions["t3unitexplosionxxxl"].innersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].innersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxl"].innersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].innersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxl"].innersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].innersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxl"].innersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].innersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxl"].innersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].innersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxl"].outersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxl"].outersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxl"].outersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxl"].outersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxl"].outersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxl"].outersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxl"].outersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxl"].outersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxl"].outersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxl"].outersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxl"].bigsmoketrails.properties.length = [[140 r35]] local size = 2.6 -definitions['t3unitexplosionxxxxl'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionxxxxl'].sparks.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].sparks.properties.numparticles * size) -definitions['t3unitexplosionxxxxl'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].sparks.properties.particlespeed * size * 0.6) -definitions['t3unitexplosionxxxxl'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].sparks.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxl'].explosion.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].explosion.properties.numparticles * size * 0.5) -definitions['t3unitexplosionxxxxl'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].explosion.properties.particlespeed * size * 1.8) -definitions['t3unitexplosionxxxxl'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].explosion.properties.particlesize * size * 0.7) -definitions['t3unitexplosionxxxxl'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].explosion.properties.particlelife * size * 0.8) -definitions['t3unitexplosionxxxxl'].dustparticles.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].dustparticles.properties.numparticles * size) -definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlesize * size * 0.7) -definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].dustparticles.properties.particlelife * size) -definitions['t3unitexplosionxxxxl'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].dirt.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxxxl'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].dirt.properties.particlespeedspread * size * 0.8) -definitions['t3unitexplosionxxxxl'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].dirt.properties.numparticles * size) -definitions['t3unitexplosionxxxxl'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].dirt2.properties.particlespeed * size * 0.8) -definitions['t3unitexplosionxxxxl'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].dirt2.properties.particlespeedspread * size * 08) -definitions['t3unitexplosionxxxxl'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionxxxxl'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionxxxxl'].shockwave.properties.ttl * size * 0.93) -definitions['t3unitexplosionxxxxl'].shockwave.properties.size = math.floor(definitions['t3unitexplosionxxxxl'].shockwave.properties.size * size * 0.85) -definitions['t3unitexplosionxxxxl'].centerflare.properties.size = math.floor(definitions['t3unitexplosionxxxxl'].centerflare.properties.size * size * 0.7) -definitions['t3unitexplosionxxxxl'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionxxxxl'].centerflare.properties.heat * size * 0.7) -definitions['t3unitexplosionxxxxl'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionxxxxl'].centerflare.properties.maxheat * size * 0.7) -definitions['t3unitexplosionxxxxl'].pop1.properties.size = math.floor(definitions['t3unitexplosionxxxxl'].pop1.properties.size * size * 0.8) -definitions['t3unitexplosionxxxxl'].pop1.properties.heat = math.floor(definitions['t3unitexplosionxxxxl'].pop1.properties.heat * size * 0.5) -definitions['t3unitexplosionxxxxl'].pop1.properties.maxheat = math.floor(definitions['t3unitexplosionxxxxl'].pop1.properties.maxheat * size * 0.6) -definitions['t3unitexplosionxxxxl'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionxxxxl'].groundflash_large.properties.size * size * 0.9) -definitions['t3unitexplosionxxxxl'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionxxxxl'].groundflash_large.properties.ttl * size * 0.8) -definitions['t3unitexplosionxxxxl'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionxxxxl'].groundflash_white.properties.size * size) -definitions['t3unitexplosionxxxxl'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].grounddust.properties.particlesize * size) -definitions['t3unitexplosionxxxxl'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].grounddust.properties.particlespeed * size) -definitions['t3unitexplosionxxxxl'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxl'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].grounddust.properties.particlelife * size * 0.8) -definitions['t3unitexplosionxxxxl'].clouddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].clouddust.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxl'].clouddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].clouddust.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxl'].clouddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].clouddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxl'].clouddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].clouddust.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxl'].innersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].innersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].innersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxl'].outersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxl'].outersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxl'].outersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxl'].bigsmoketrails.properties.length = [[160 r40]] -definitions['t3unitexplosionxxxxl'].bigsmoketrails.properties.ttl = [[52 r10]] +definitions["t3unitexplosionxxxxl"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionxxxxl"].sparks.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].sparks.properties.numparticles * size) +definitions["t3unitexplosionxxxxl"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].sparks.properties.particlespeed * size * 0.6) +definitions["t3unitexplosionxxxxl"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].sparks.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxl"].explosion.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].explosion.properties.numparticles * size * 0.5) +definitions["t3unitexplosionxxxxl"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].explosion.properties.particlespeed * size * 1.8) +definitions["t3unitexplosionxxxxl"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].explosion.properties.particlesize * size * 0.7) +definitions["t3unitexplosionxxxxl"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].explosion.properties.particlelife * size * 0.8) +definitions["t3unitexplosionxxxxl"].dustparticles.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].dustparticles.properties.numparticles * size) +definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlesize * size * 0.7) +definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].dustparticles.properties.particlelife * size) +definitions["t3unitexplosionxxxxl"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].dirt.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxxxl"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].dirt.properties.particlespeedspread * size * 0.8) +definitions["t3unitexplosionxxxxl"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].dirt.properties.numparticles * size) +definitions["t3unitexplosionxxxxl"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].dirt2.properties.particlespeed * size * 0.8) +definitions["t3unitexplosionxxxxl"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].dirt2.properties.particlespeedspread * size * 08) +definitions["t3unitexplosionxxxxl"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionxxxxl"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionxxxxl"].shockwave.properties.ttl * size * 0.93) +definitions["t3unitexplosionxxxxl"].shockwave.properties.size = math.floor(definitions["t3unitexplosionxxxxl"].shockwave.properties.size * size * 0.85) +definitions["t3unitexplosionxxxxl"].centerflare.properties.size = math.floor(definitions["t3unitexplosionxxxxl"].centerflare.properties.size * size * 0.7) +definitions["t3unitexplosionxxxxl"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionxxxxl"].centerflare.properties.heat * size * 0.7) +definitions["t3unitexplosionxxxxl"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionxxxxl"].centerflare.properties.maxheat * size * 0.7) +definitions["t3unitexplosionxxxxl"].pop1.properties.size = math.floor(definitions["t3unitexplosionxxxxl"].pop1.properties.size * size * 0.8) +definitions["t3unitexplosionxxxxl"].pop1.properties.heat = math.floor(definitions["t3unitexplosionxxxxl"].pop1.properties.heat * size * 0.5) +definitions["t3unitexplosionxxxxl"].pop1.properties.maxheat = math.floor(definitions["t3unitexplosionxxxxl"].pop1.properties.maxheat * size * 0.6) +definitions["t3unitexplosionxxxxl"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionxxxxl"].groundflash_large.properties.size * size * 0.9) +definitions["t3unitexplosionxxxxl"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionxxxxl"].groundflash_large.properties.ttl * size * 0.8) +definitions["t3unitexplosionxxxxl"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionxxxxl"].groundflash_white.properties.size * size) +definitions["t3unitexplosionxxxxl"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].grounddust.properties.particlesize * size) +definitions["t3unitexplosionxxxxl"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].grounddust.properties.particlespeed * size) +definitions["t3unitexplosionxxxxl"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxl"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].grounddust.properties.particlelife * size * 0.8) +definitions["t3unitexplosionxxxxl"].clouddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].clouddust.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxl"].clouddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].clouddust.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxl"].clouddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].clouddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxl"].clouddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].clouddust.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxl"].innersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].innersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].innersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxl"].outersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxl"].outersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxl"].outersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxl"].bigsmoketrails.properties.length = [[160 r40]] +definitions["t3unitexplosionxxxxl"].bigsmoketrails.properties.ttl = [[52 r10]] local size = 3.2 -definitions['t3unitexplosionxxxxxl'] = table.copy(definitions['t3unitexplosion']) -definitions['t3unitexplosionxxxxxl'].sparks.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].sparks.properties.numparticles * size) -definitions['t3unitexplosionxxxxxl'].sparks.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].sparks.properties.particlespeed * size* 0.5) -definitions['t3unitexplosionxxxxxl'].sparks.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].sparks.properties.particlespeedspread * size * 1.5) -definitions['t3unitexplosionxxxxxl'].explosion.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].explosion.properties.numparticles * size * 0.2) -definitions['t3unitexplosionxxxxxl'].explosion.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].explosion.properties.particlespeed * size * 1.5) -definitions['t3unitexplosionxxxxxl'].explosion.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].explosion.properties.particlesize * size * 0.85) -definitions['t3unitexplosionxxxxxl'].explosion.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].explosion.properties.particlelife * size * 0.8) -definitions['t3unitexplosionxxxxxl'].dustparticles.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].dustparticles.properties.numparticles * size) -definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlespeed * size * 0.9) -definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlesize * size * 0.8) -definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].dustparticles.properties.particlelife * size) -definitions['t3unitexplosionxxxxxl'].dirt.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].dirt.properties.particlespeed * size * 0.9) -definitions['t3unitexplosionxxxxxl'].dirt.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].dirt.properties.particlespeedspread * size * 0.9) -definitions['t3unitexplosionxxxxxl'].dirt.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].dirt.properties.numparticles * size) -definitions['t3unitexplosionxxxxxl'].dirt2.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].dirt2.properties.particlespeed * size * 0.9) -definitions['t3unitexplosionxxxxxl'].dirt2.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].dirt2.properties.particlespeedspread * size * 0.9) -definitions['t3unitexplosionxxxxxl'].dirt2.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].dirt2.properties.numparticles * size) -definitions['t3unitexplosionxxxxxl'].shockwave.properties.ttl = math.floor(definitions['t3unitexplosionxxxxxl'].shockwave.properties.ttl * size * 0.75) -definitions['t3unitexplosionxxxxxl'].shockwave.properties.size = math.floor(definitions['t3unitexplosionxxxxxl'].shockwave.properties.size * size * 0.85) -definitions['t3unitexplosionxxxxxl'].centerflare.properties.size = math.floor(definitions['t3unitexplosionxxxxxl'].centerflare.properties.size * size * 0.8) -definitions['t3unitexplosionxxxxxl'].centerflare.properties.heat = math.floor(definitions['t3unitexplosionxxxxxl'].centerflare.properties.heat * size * 0.8) -definitions['t3unitexplosionxxxxxl'].centerflare.properties.maxheat = math.floor(definitions['t3unitexplosionxxxxxl'].centerflare.properties.maxheat * size * 0.8) -definitions['t3unitexplosionxxxxxl'].groundflash_large.properties.size = math.floor(definitions['t3unitexplosionxxxxxl'].groundflash_large.properties.size * size * 0.9) -definitions['t3unitexplosionxxxxxl'].groundflash_large.properties.ttl = math.floor(definitions['t3unitexplosionxxxxxl'].groundflash_large.properties.ttl * size * 0.8) -definitions['t3unitexplosionxxxxxl'].groundflash_white.properties.size = math.floor(definitions['t3unitexplosionxxxxxl'].groundflash_white.properties.size * size) -definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlesize * size) -definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlespeed * size) -definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].grounddust.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].clouddust.properties.particlelife * size * 1.2) -definitions['t3unitexplosionxxxxxl'].innersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].innersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].innersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxxl'].outersmoke.properties.numparticles = math.floor(definitions['t3unitexplosionxxxxxl'].outersmoke.properties.numparticles * size * 1.2) -definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlesize = math.floor(definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlesize * size * 1.2) -definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlespeed = math.floor(definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlespeed * size * 1.4) -definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlespeedspread = math.floor(definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlespeedspread * size) -definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlelife = math.floor(definitions['t3unitexplosionxxxxxl'].outersmoke.properties.particlelife * size * 0.9) -definitions['t3unitexplosionxxxxxl'].bigsmoketrails.properties.length = [[195 r60]] -definitions['t3unitexplosionxxxxxl'].bigsmoketrails.properties.ttl = [[55 r12]] +definitions["t3unitexplosionxxxxxl"] = table.copy(definitions["t3unitexplosion"]) +definitions["t3unitexplosionxxxxxl"].sparks.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].sparks.properties.numparticles * size) +definitions["t3unitexplosionxxxxxl"].sparks.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].sparks.properties.particlespeed * size * 0.5) +definitions["t3unitexplosionxxxxxl"].sparks.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].sparks.properties.particlespeedspread * size * 1.5) +definitions["t3unitexplosionxxxxxl"].explosion.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].explosion.properties.numparticles * size * 0.2) +definitions["t3unitexplosionxxxxxl"].explosion.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].explosion.properties.particlespeed * size * 1.5) +definitions["t3unitexplosionxxxxxl"].explosion.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].explosion.properties.particlesize * size * 0.85) +definitions["t3unitexplosionxxxxxl"].explosion.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].explosion.properties.particlelife * size * 0.8) +definitions["t3unitexplosionxxxxxl"].dustparticles.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].dustparticles.properties.numparticles * size) +definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlespeed * size * 0.9) +definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlesize * size * 0.8) +definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].dustparticles.properties.particlelife * size) +definitions["t3unitexplosionxxxxxl"].dirt.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].dirt.properties.particlespeed * size * 0.9) +definitions["t3unitexplosionxxxxxl"].dirt.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].dirt.properties.particlespeedspread * size * 0.9) +definitions["t3unitexplosionxxxxxl"].dirt.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].dirt.properties.numparticles * size) +definitions["t3unitexplosionxxxxxl"].dirt2.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].dirt2.properties.particlespeed * size * 0.9) +definitions["t3unitexplosionxxxxxl"].dirt2.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].dirt2.properties.particlespeedspread * size * 0.9) +definitions["t3unitexplosionxxxxxl"].dirt2.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].dirt2.properties.numparticles * size) +definitions["t3unitexplosionxxxxxl"].shockwave.properties.ttl = math.floor(definitions["t3unitexplosionxxxxxl"].shockwave.properties.ttl * size * 0.75) +definitions["t3unitexplosionxxxxxl"].shockwave.properties.size = math.floor(definitions["t3unitexplosionxxxxxl"].shockwave.properties.size * size * 0.85) +definitions["t3unitexplosionxxxxxl"].centerflare.properties.size = math.floor(definitions["t3unitexplosionxxxxxl"].centerflare.properties.size * size * 0.8) +definitions["t3unitexplosionxxxxxl"].centerflare.properties.heat = math.floor(definitions["t3unitexplosionxxxxxl"].centerflare.properties.heat * size * 0.8) +definitions["t3unitexplosionxxxxxl"].centerflare.properties.maxheat = math.floor(definitions["t3unitexplosionxxxxxl"].centerflare.properties.maxheat * size * 0.8) +definitions["t3unitexplosionxxxxxl"].groundflash_large.properties.size = math.floor(definitions["t3unitexplosionxxxxxl"].groundflash_large.properties.size * size * 0.9) +definitions["t3unitexplosionxxxxxl"].groundflash_large.properties.ttl = math.floor(definitions["t3unitexplosionxxxxxl"].groundflash_large.properties.ttl * size * 0.8) +definitions["t3unitexplosionxxxxxl"].groundflash_white.properties.size = math.floor(definitions["t3unitexplosionxxxxxl"].groundflash_white.properties.size * size) +definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlesize * size) +definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlespeed * size) +definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].grounddust.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].clouddust.properties.particlelife * size * 1.2) +definitions["t3unitexplosionxxxxxl"].innersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].innersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].innersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxxl"].outersmoke.properties.numparticles = math.floor(definitions["t3unitexplosionxxxxxl"].outersmoke.properties.numparticles * size * 1.2) +definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlesize = math.floor(definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlesize * size * 1.2) +definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlespeed = math.floor(definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlespeed * size * 1.4) +definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlespeedspread = math.floor(definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlespeedspread * size) +definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlelife = math.floor(definitions["t3unitexplosionxxxxxl"].outersmoke.properties.particlelife * size * 0.9) +definitions["t3unitexplosionxxxxxl"].bigsmoketrails.properties.length = [[195 r60]] +definitions["t3unitexplosionxxxxxl"].bigsmoketrails.properties.ttl = [[55 r12]] -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - centerflare = { - properties = { - texture = [[purplenovaexplo]], - }, - }, - pop1 = { - properties = { - texture = [[purpleexplo]], - }, - }, - groundflash_small = { - properties = { - colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], - }, - }, - groundflash_large = { - properties = { - colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], - }, - }, - groundflash_large_long = { - properties = { - colormap = [[0.82 0.22 0.99 0.45 0.72 0.2 0.92 0.30 0 0 0 0.01]], - }, - }, - groundflash_white = { - properties = { - colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], - }, - }, - explosion = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], - }, - }, - fireglow = { - properties = { - colormap = [[0.29 0.055 0.4 0.02 0 0 0 0]], - }, - }, - shockwave = { - properties = { - color = [[0.9, 0.3, 1]], - }, - }, - shockwavefirst = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.02 0.65 0.2 0.9 0.015 0.35 0.07 0.6 0.012 0.15 0.05 0.4 0.006 0 0 0 0]], - }, - }, - shockwavefast = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.02 0.65 0.2 0.9 0.015 0.35 0.07 0.6 0.012 0.15 0.05 0.4 0.006 0 0 0 0]], - }, - }, - junoring = { - properties = { - colormap = [[0 0 0 0 0.5 0.12 0.71 0.22 0.45 0.10 0.68 0.018 0.35 0.08 0.6 0.011 0.15 0.04 0.28 0.009 0 0 0 0.05]], - }, - }, - electricstorm = { - properties = { - explosiongenerator = [[custom:lightning_storm_juno_scav]], - }, - }, - innersmoke = { - properties = { - colormap=[[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], - }, - }, - outersmoke = { - properties = { - colormap=[[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], - }, - }, - sparks = { - properties = { - colormap=[[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], - }, - }, - dustparticles = { - properties = { - colormap=[[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], - }, - }, + centerflare = { + properties = { + texture = [[purplenovaexplo]], + }, + }, + pop1 = { + properties = { + texture = [[purpleexplo]], + }, + }, + groundflash_small = { + properties = { + colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], + }, + }, + groundflash_large = { + properties = { + colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], + }, + }, + groundflash_large_long = { + properties = { + colormap = [[0.82 0.22 0.99 0.45 0.72 0.2 0.92 0.30 0 0 0 0.01]], + }, + }, + groundflash_white = { + properties = { + colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], + }, + }, + explosion = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], + }, + }, + fireglow = { + properties = { + colormap = [[0.29 0.055 0.4 0.02 0 0 0 0]], + }, + }, + shockwave = { + properties = { + color = [[0.9, 0.3, 1]], + }, + }, + shockwavefirst = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.02 0.65 0.2 0.9 0.015 0.35 0.07 0.6 0.012 0.15 0.05 0.4 0.006 0 0 0 0]], + }, + }, + shockwavefast = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.02 0.65 0.2 0.9 0.015 0.35 0.07 0.6 0.012 0.15 0.05 0.4 0.006 0 0 0 0]], + }, + }, + junoring = { + properties = { + colormap = [[0 0 0 0 0.5 0.12 0.71 0.22 0.45 0.10 0.68 0.018 0.35 0.08 0.6 0.011 0.15 0.04 0.28 0.009 0 0 0 0.05]], + }, + }, + electricstorm = { + properties = { + explosiongenerator = [[custom:lightning_storm_juno_scav]], + }, + }, + innersmoke = { + properties = { + colormap = [[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], + }, + }, + outersmoke = { + properties = { + colormap = [[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], + }, + }, + sparks = { + properties = { + colormap = [[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], + }, + }, + dustparticles = { + properties = { + colormap = [[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/deathceg.lua b/effects/deathceg.lua index b693473f0f7..aa2d5667d6c 100644 --- a/effects/deathceg.lua +++ b/effects/deathceg.lua @@ -1,158 +1,154 @@ local defs = { - ["deathceg2"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.85, - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 30, - emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], - gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], - numparticles = 1, - particlelife = 5, - particlelifespread = 5, - particlesize = 4, - particlesizespread = 2, - particlespeed = 0.2, - particlespeedspread = 0.55, - pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2 r1.5]], - sizemod = 0.85, - animParams = [[16,6,40 r40]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - }, + ["deathceg2"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.85, + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 30, + emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], + gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], + numparticles = 1, + particlelife = 5, + particlelifespread = 5, + particlesize = 4, + particlesizespread = 2, + particlespeed = 0.2, + particlespeedspread = 0.55, + pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2 r1.5]], + sizemod = 0.85, + animParams = [[16,6,40 r40]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + }, + ["deathceg3"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.85, + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 30, + emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], + gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], + numparticles = 1, + particlelife = 5, + particlelifespread = 7, + particlesize = 6, + particlesizespread = 3.5, + particlespeed = 0.2, + particlespeedspread = 0.55, + pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2 r1.5]], + sizemod = 0.85, + animParams = [[16,6,40 r40]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + }, - - ["deathceg3"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.85, - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 30, - emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], - gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], - numparticles = 1, - particlelife = 5, - particlelifespread = 7, - particlesize = 6, - particlesizespread = 3.5, - particlespeed = 0.2, - particlespeedspread = 0.55, - pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2 r1.5]], - sizemod = 0.85, - animParams = [[16,6,40 r40]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - }, - - - - ["deathceg4"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.85, - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 30, - emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], - gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], - numparticles = 1, - particlelife = 8, - particlelifespread = 10, - particlesize = 9, - particlesizespread = 5, - particlespeed = 0.2, - particlespeedspread = 0.55, - pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2 r1.5]], - sizemod = 0.84, - animParams = [[16,6,100 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - } + ["deathceg4"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.85, + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 30, + emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], + gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], + numparticles = 1, + particlelife = 8, + particlelifespread = 10, + particlesize = 9, + particlesizespread = 5, + particlespeed = 0.2, + particlespeedspread = 0.55, + pos = [[-1.5 r3, -1.5 r3, -1.5 r3]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2 r1.5]], + sizemod = 0.84, + animParams = [[16,6,100 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + }, } local effects = { - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.8, - colormap = [[0.7 0.7 0.9 0.037 0.5 0.5 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 2, - particlelife = 3, - particlelifespread = 1, - particlesize = 1.6, - particlesizespread = 0.8, - particlespeed = 0, - particlespeedspread = 1.2, - pos = [[0, 2, 0]], - sizegrowth = 0.6, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - }, - }, - --fire = { - -- properties = { - -- colormap = [[1 1 1 0.55 1 0.75 0.55 0.44 0.75 0.47 0.44 0.37 0.3 0.14 0.25 0.3 0.11 0.033 0.14 0.11 0.08 0.016 0.12 0.16 0 0 0 0.01]], - -- }, - --}, - --fireglow = { - -- properties = { - -- colormap = [[0.25 0.17 0.05 0.01 0 0 0 0.01]], - -- }, - --}, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + colormap = [[0.7 0.7 0.9 0.037 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 3, + particlelifespread = 1, + particlesize = 1.6, + particlesizespread = 0.8, + particlespeed = 0, + particlespeedspread = 1.2, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + --fire = { + -- properties = { + -- colormap = [[1 1 1 0.55 1 0.75 0.55 0.44 0.75 0.47 0.44 0.37 0.3 0.14 0.25 0.3 0.11 0.033 0.14 0.11 0.08 0.016 0.12 0.16 0 0 0 0.01]], + -- }, + --}, + --fireglow = { + -- properties = { + -- colormap = [[0.25 0.17 0.05 0.01 0 0 0 0.01]], + -- }, + --}, } defs["deathceg2-lightning"] = table.merge(defs["deathceg2"], effects) --defs["deathceg2-lightning"].fire.properties.numparticles = defs["deathceg2-lightning"].fire.properties.numparticles/2.5 --defs["deathceg2-lightning"].electricity.properties.numparticles = defs["deathceg2-lightning"].electricity.properties.numparticles/1.6 -defs["deathceg2-lightning"].electricity.properties.particlelife = defs["deathceg2-lightning"].electricity.properties.particlelife/1.6 +defs["deathceg2-lightning"].electricity.properties.particlelife = defs["deathceg2-lightning"].electricity.properties.particlelife / 1.6 defs["deathceg3-lightning"] = table.merge(defs["deathceg3"], effects) --defs["deathceg3-lightning"].fire.properties.numparticles = defs["deathceg3-lightning"].fire.properties.numparticles/2.5 --defs["deathceg3-lightning"].electricity.properties.numparticles = defs["deathceg3-lightning"].electricity.properties.numparticles/1.2 @@ -161,16 +157,16 @@ defs["deathceg4-lightning"] = table.merge(defs["deathceg4"], effects) --defs["deathceg4-lightning"].fire.properties.numparticles = defs["deathceg4-lightning"].fire.properties.numparticles/2.5 effects = { - --fire = { - -- properties = { - -- colormap = [[1 0.97 0.93 0.66 1 0.8 0.4 0.5 0.75 0.47 0.18 0.4 0.33 0.14 0.04 0.33 0.14 0.033 0 0.25 0.11 0.016 0 0.16 0 0 0 0.01]], - -- }, - --}, - --fireglow = { - -- properties = { - -- colormap = [[0.15 0.075 0.02 0.015 0 0 0 0.01]], - -- }, - --}, + --fire = { + -- properties = { + -- colormap = [[1 0.97 0.93 0.66 1 0.8 0.4 0.5 0.75 0.47 0.18 0.4 0.33 0.14 0.04 0.33 0.14 0.033 0 0.25 0.11 0.016 0 0.16 0 0 0 0.01]], + -- }, + --}, + --fireglow = { + -- properties = { + -- colormap = [[0.15 0.075 0.02 0.015 0 0 0 0.01]], + -- }, + --}, } defs["deathceg2-fire"] = table.merge(defs["deathceg2"], effects) --defs["deathceg2-fire"].fireglow.properties.particlesize = defs["deathceg2-fire"].fireglow.properties.particlesize*1.7 @@ -187,18 +183,17 @@ defs["deathceg3-fire"] = table.merge(defs["deathceg3"], effects) defs["deathceg4-fire"] = table.merge(defs["deathceg4"], effects) --defs["deathceg4-fire"].fireglow.properties.particlesize = defs["deathceg4-fire"].fireglow.properties.particlesize*1.7 - effects = { - --fire = { - -- properties = { - -- colormap = [[0.98 1 0.91 0.55 0.85 1 0.3 0.4 0.4 0.6 0.1 0.3 0 0 0 0.01]], - -- }, - --}, - --fireglow = { - -- properties = { - -- colormap = [[0.12 0.15 0.02 0.015 0 0 0 0.01]], - -- }, - --}, + --fire = { + -- properties = { + -- colormap = [[0.98 1 0.91 0.55 0.85 1 0.3 0.4 0.4 0.6 0.1 0.3 0 0 0 0.01]], + -- }, + --}, + --fireglow = { + -- properties = { + -- colormap = [[0.12 0.15 0.02 0.015 0 0 0 0.01]], + -- }, + --}, } defs["deathceg2-builder"] = table.merge(defs["deathceg2"], effects) defs["deathceg3-builder"] = table.merge(defs["deathceg3"], effects) @@ -215,7 +210,6 @@ defs["deathceg4-builder"] = table.merge(defs["deathceg4"], effects) --defs["deathceg3-builder"].dustparticles.properties.colormap = [[0.8 1 0.2 0.01 0 0 0 0.01]] --defs["deathceg4-builder"].dustparticles.properties.colormap = defs["deathceg3-builder"].dustparticles.properties.colormap - --local effects = { -- searingflame = { -- air = true, @@ -249,10 +243,9 @@ defs["deathceg4-builder"] = table.merge(defs["deathceg4"], effects) defs["deathceg2-air"] = table.merge(defs["deathceg2"], effects) defs["deathceg3-air"] = table.merge(defs["deathceg3"], effects) - local airDefs = {} -for k,v in pairs(defs) do - airDefs['air'..k] = table.copy(defs[k]) +for k, v in pairs(defs) do + airDefs["air" .. k] = table.copy(defs[k]) --airDefs['air'..k].fireandsmoke.properties.particlelife = v.fireandsmoke.properties.particlelife * 0.6 --airDefs['air'..k].fireandsmoke.properties.colormap = [[0.05 0.034 0.028 0.62 0.044 0.033 0.027 0.57 0.04 0.031 0.026 0.48 0.025 0.023 0.023 0.3 0.014 0.013 0.013 0.15 0.006 0.006 0.006 0.06 0 0 0 0.01]] end @@ -260,40 +253,40 @@ table.mergeInPlace(defs, airDefs) -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(defs) do - scavengerDefs[k..'-purple'] = table.copy(defs[k]) +for k, v in pairs(defs) do + scavengerDefs[k .. "-purple"] = table.copy(defs[k]) end local purpleEffects = { - --fire = { - -- properties = { - -- colormap = [[0.6 0.25 0.8 0.04 0.5 0.35 0.75 0.035 0.3 0.1 0.5 0.03 0.2 0.08 0.3 0.022 0.1 0.04 0.2 0.015 0 0 0 0.01]] - -- } - --}, - --fireglow = { - -- properties = { - -- colormap = [[0.18 0.07 0.33 0.01 0 0 0 0.01]] - -- } - --}, + --fire = { + -- properties = { + -- colormap = [[0.6 0.25 0.8 0.04 0.5 0.35 0.75 0.035 0.3 0.1 0.5 0.03 0.2 0.08 0.3 0.022 0.1 0.04 0.2 0.015 0 0 0 0.01]] + -- } + --}, + --fireglow = { + -- properties = { + -- colormap = [[0.18 0.07 0.33 0.01 0 0 0 0.01]] + -- } + --}, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(defs, scavengerDefs) diff --git a/effects/dgunprojectile.lua b/effects/dgunprojectile.lua index d71ab151e67..84ff65cc7a6 100644 --- a/effects/dgunprojectile.lua +++ b/effects/dgunprojectile.lua @@ -1,1255 +1,1251 @@ - return { - ["dgunprojectile"] = { - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- properties = { - -- colormap = [[1 0.7 0.3 0.04 0 0 0 0.01]], - -- size = 65, - -- sizegrowth = -0.5, - -- ttl = 14, - -- texture = [[groundflash]], - -- }, - -- }, - -- brightflare = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[flare]], - -- length = 40, - -- sidetexture = [[none]], - -- size = [[50 r15]], - -- sizegrowth = -0.3, - -- ttl = 2, - -- pos = [[0, 0, 0]], - -- --rotParams = [[-10 r20, -20 r40, -180 r360]], - -- drawOrder = 0, - -- }, - -- }, - ball = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.4, - colormap = [[0.75 0.60 0.55 0.22 0.70 0.58 0.50 0.25 0.21 0.15 0.14 0.15 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 4, - particlelife = 9, - particlelifespread = 2, - particlesize = 13, - particlesizespread = 2, - particlespeed = 0.5, - particlespeedspread = 2.9, - pos = [[0, 2, 0]], - rotParams = [[-40 r80, -20 r40, -180 r360]], - sizegrowth = -0.3, - sizemod = 1.0, - texture = [[dirt]], - useairlos = false, - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.83, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 16, - particlesizespread = 20, - particlespeed = 6.1, - particlespeedspread = 6.5, - pos = [[0, 0, 0]], - sizegrowth = -0.3, - sizemod = 0.72, - texture = [[gunshotglow]], - useairlos = true, - }, - }, - }, - - ["expldgun"] = { - -- groundflash_small = { - -- class = [[CSimpleGroundFlash]], - -- count = 0, - -- air = true, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- colormap = [[1 0.66 0.25 0.12 1 0.66 0.25 0.12 0 0 0 0.01]], - -- size = 20, - -- sizegrowth = 1, - -- ttl = 18, - -- texture = [[groundflash]], - -- }, - -- }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- colormap = [[1 0.66 0.35 0.12 0 0 0 0.01]], - -- size = 90, - -- sizegrowth = 0, - -- ttl = 9, - -- texture = [[groundflash]], - -- }, - -- }, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - unit = false, - water = true, - properties = { - colormap = [[0.4 0.3 0.02 0.8 0.3 0.06 0.02 0.6 0 0 0 0.01]], - size = 16, - sizegrowth = 0, - ttl = 80, - texture = [[groundflash]], - }, - }, - - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 2.2, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - -brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[flare]], - length = 40, - sidetexture = [[none]], - size = [[50 r20]], - sizegrowth = -0.3, - ttl = 2, - pos = [[0, 5, 0]], - --rotParams = [[-10 r20, -20 r40, -180 r360]], - drawOrder = 1, - }, - }, + ["dgunprojectile"] = { + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- properties = { + -- colormap = [[1 0.7 0.3 0.04 0 0 0 0.01]], + -- size = 65, + -- sizegrowth = -0.5, + -- ttl = 14, + -- texture = [[groundflash]], + -- }, + -- }, + -- brightflare = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[flare]], + -- length = 40, + -- sidetexture = [[none]], + -- size = [[50 r15]], + -- sizegrowth = -0.3, + -- ttl = 2, + -- pos = [[0, 0, 0]], + -- --rotParams = [[-10 r20, -20 r40, -180 r360]], + -- drawOrder = 0, + -- }, + -- }, + ball = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.4, + colormap = [[0.75 0.60 0.55 0.22 0.70 0.58 0.50 0.25 0.21 0.15 0.14 0.15 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 4, + particlelife = 9, + particlelifespread = 2, + particlesize = 13, + particlesizespread = 2, + particlespeed = 0.5, + particlespeedspread = 2.9, + pos = [[0, 2, 0]], + rotParams = [[-40 r80, -20 r40, -180 r360]], + sizegrowth = -0.3, + sizemod = 1.0, + texture = [[dirt]], + useairlos = false, + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.83, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 16, + particlesizespread = 20, + particlespeed = 6.1, + particlespeedspread = 6.5, + pos = [[0, 0, 0]], + sizegrowth = -0.3, + sizemod = 0.72, + texture = [[gunshotglow]], + useairlos = true, + }, + }, + }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = false, - emitrot = 15, - emitrotspread = 15, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, - particlelife = 14, - particlelifespread = 5, - particlesize = 15.7, - particlesizespread = 6.4, - particlespeed = 1.9, - particlespeedspread = 2.15, - pos = [[0, 7, 0]], - rotParams = [[-20 r40, -20 r40, -180 r360]], - sizegrowth = -0.8, - sizemod = 1.02, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 3.2, - sizegrowth = [[-20 r7]], - ttl = 5, - pos = [[0, 5, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[1 0.85 0.6 0.42 1 0.63 0.3 0.22 1 0.52 0.2 0.12 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.018, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 2, - particlesize = 2.5, - particlesizespread = 2.66, - particlespeed = 2.4, - particlespeedspread = 1.8, - pos = [[-10 r20, 0, -10 r20]], - rotParams = [[-24 r48, 0, -180 r360]], - sizegrowth = 1.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - sizeGrowth = 0.25, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - rotParams = [[-24 r48, 0, -180 r360]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.006, 0]], - colormap=[[0.8 0.44 0.32 0.6 0.3 0.2 0.13 0.45 0.18 0.15 0.11 0.4 0.13 0.12 0.1 0.36 0.11 0.1 0.093 0.32 0.063 0.062 0.058 0.19 0 0 0 0.01]], - Texture=[[dirt]], - particleLife=44, - particleLifeSpread=45, - numparticles=1, - particleSpeed=0.5, - particleSpeedSpread=2.1, - particleSize=5.5, - particleSizeSpread=6.5, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=0, - properties = { - airdrag=0.4, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=22, - particleLifeSpread=25, - numparticles=1, - particleSpeed=1, - particleSpeedSpread=3.3, - particleSize=6.2, - particleSizeSpread=3.5, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 0, - water = false, - air = false, - ground = true, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.70 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 22, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 3, - particlelife = 19, - particlelifespread = 4, - particlesize = 1.2, - particlesizespread = -1, - particlespeed = 1.65, - particlespeedspread = 2.0, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = false, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 18, - particlelifespread = 4, - particlesize = 1.44, - particlesizespread = -1, - particlespeed = 1.66, - particlespeedspread = 2.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, --should be 1/2 - particlelife = 33, - particlelifespread = 55, - particlesize = 5, - particlesizespread = 8, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.1, - particlesizespread = 1.8, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.6, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 2, - particlespeed = 1.35, - particlespeedspread = 1.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 3, - particlelife = 3.7, - particlelifespread = 8, - particlesize = 14, - particlesizespread = 14, - particlespeed = 2.1, - particlespeedspread = 2.1, - pos = [[0, 2, 0]], - sizegrowth = 0.77, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + ["expldgun"] = { + -- groundflash_small = { + -- class = [[CSimpleGroundFlash]], + -- count = 0, + -- air = true, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- colormap = [[1 0.66 0.25 0.12 1 0.66 0.25 0.12 0 0 0 0.01]], + -- size = 20, + -- sizegrowth = 1, + -- ttl = 18, + -- texture = [[groundflash]], + -- }, + -- }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- colormap = [[1 0.66 0.35 0.12 0 0 0 0.01]], + -- size = 90, + -- sizegrowth = 0, + -- ttl = 9, + -- texture = [[groundflash]], + -- }, + -- }, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + unit = false, + water = true, + properties = { + colormap = [[0.4 0.3 0.02 0.8 0.3 0.06 0.02 0.6 0 0 0 0.01]], + size = 16, + sizegrowth = 0, + ttl = 80, + texture = [[groundflash]], + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 16, - particlelifespread = 26, - particlesize = 6.5, - particlesizespread = 20, - particlespeed = 1.8, - particlespeedspread = 4, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2.2, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = 12, - sizegrowth = 1.2, - ttl = 70, - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 0, 0]], - }, - }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[flare]], + length = 40, + sidetexture = [[none]], + size = [[50 r20]], + sizegrowth = -0.3, + ttl = 2, + pos = [[0, 5, 0]], + --rotParams = [[-10 r20, -20 r40, -180 r360]], + drawOrder = 1, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, - particlelife = 13, - particlelifespread = 30, - particlesize = [[3 r12]], - particlesizespread = 13, - particlespeed = [[2.5 i0.4]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = false, + emitrot = 15, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, + particlelife = 14, + particlelifespread = 5, + particlesize = 15.7, + particlesizespread = 6.4, + particlespeed = 1.9, + particlespeedspread = 2.15, + pos = [[0, 7, 0]], + rotParams = [[-20 r40, -20 r40, -180 r360]], + sizegrowth = -0.8, + sizemod = 1.02, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 3.2, + sizegrowth = [[-20 r7]], + ttl = 5, + pos = [[0, 5, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[1 0.85 0.6 0.42 1 0.63 0.3 0.22 1 0.52 0.2 0.12 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.018, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 2, + particlesize = 2.5, + particlesizespread = 2.66, + particlespeed = 2.4, + particlespeedspread = 1.8, + pos = [[-10 r20, 0, -10 r20]], + rotParams = [[-24 r48, 0, -180 r360]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + sizeGrowth = 0.25, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + rotParams = [[-24 r48, 0, -180 r360]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.006, 0]], + colormap = [[0.8 0.44 0.32 0.6 0.3 0.2 0.13 0.45 0.18 0.15 0.11 0.4 0.13 0.12 0.1 0.36 0.11 0.1 0.093 0.32 0.063 0.062 0.058 0.19 0 0 0 0.01]], + Texture = [[dirt]], + particleLife = 44, + particleLifeSpread = 45, + numparticles = 1, + particleSpeed = 0.5, + particleSpeedSpread = 2.1, + particleSize = 5.5, + particleSizeSpread = 6.5, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 0, + properties = { + airdrag = 0.4, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 22, + particleLifeSpread = 25, + numparticles = 1, + particleSpeed = 1, + particleSpeedSpread = 3.3, + particleSize = 6.2, + particleSizeSpread = 3.5, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 0, + water = false, + air = false, + ground = true, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.70 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 22, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 3, + particlelife = 19, + particlelifespread = 4, + particlesize = 1.2, + particlesizespread = -1, + particlespeed = 1.65, + particlespeedspread = 2.0, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = false, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 18, + particlelifespread = 4, + particlesize = 1.44, + particlesizespread = -1, + particlespeed = 1.66, + particlespeedspread = 2.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, --should be 1/2 + particlelife = 33, + particlelifespread = 55, + particlesize = 5, + particlesizespread = 8, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.1, + particlesizespread = 1.8, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.6, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 2, + particlespeed = 1.35, + particlespeedspread = 1.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 3, + particlelife = 3.7, + particlelifespread = 8, + particlesize = 14, + particlesizespread = 14, + particlespeed = 2.1, + particlespeedspread = 2.1, + pos = [[0, 2, 0]], + sizegrowth = 0.77, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - -- dirtrush = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = 0, - -- water = false, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0 0 0 0 0.8 0.8 0.8 .85 0.8 0.8 0.8 .5 0.2 0.2 0.2 .3 0 0 0 0.01]], - -- directional = false, - -- emitrot = 7, - -- emitrotspread = 7, - -- emitvector = [[0.1, 1, 0.1]], - -- gravity = [[0, -0.06, 0]], - -- numparticles = 3, - -- particlelife = 15, - -- particlelifespread = 40, - -- particlesize = 2, - -- particlesizespread = 12, - -- particlespeed = 1, - -- particlespeedspread = 3, - -- rotParams = [[-2 r4, 0, -180 r360]], - -- pos = [[-10 r20, -30 r10, -10 r20]], - -- sizegrowth = [[3.8]], - -- sizemod = 0.95, - -- texture = [[dirtrush]], - -- useairlos = true, - -- }, - -- }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 4, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.8 0.07 0.05 0.05 0.75 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.7 r1.4, 0.4 r0.40, -0.7 r1.4]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[23 r14]], - sidetexture = [[flamestream]], - size = [[20 r16]], - sizegrowth = 1, - ttl = [[28 r3]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, -10 r12, -10 r20]], - drawOrder = 0, - }, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 16, + particlelifespread = 26, + particlesize = 6.5, + particlesizespread = 20, + particlespeed = 1.8, + particlespeedspread = 4, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = 12, + sizegrowth = 1.2, + ttl = 70, + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 0, 0]], + }, + }, --- DGUN Deflect mechanic for Commander Update + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, + particlelife = 13, + particlelifespread = 30, + particlesize = [[3 r12]], + particlesizespread = 13, + particlespeed = [[2.5 i0.4]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, + -- dirtrush = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = 0, + -- water = false, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0 0 0 0 0.8 0.8 0.8 .85 0.8 0.8 0.8 .5 0.2 0.2 0.2 .3 0 0 0 0.01]], + -- directional = false, + -- emitrot = 7, + -- emitrotspread = 7, + -- emitvector = [[0.1, 1, 0.1]], + -- gravity = [[0, -0.06, 0]], + -- numparticles = 3, + -- particlelife = 15, + -- particlelifespread = 40, + -- particlesize = 2, + -- particlesizespread = 12, + -- particlespeed = 1, + -- particlespeedspread = 3, + -- rotParams = [[-2 r4, 0, -180 r360]], + -- pos = [[-10 r20, -30 r10, -10 r20]], + -- sizegrowth = [[3.8]], + -- sizemod = 0.95, + -- texture = [[dirtrush]], + -- useairlos = true, + -- }, + -- }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 4, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.8 0.07 0.05 0.05 0.75 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.7 r1.4, 0.4 r0.40, -0.7 r1.4]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[23 r14]], + sidetexture = [[flamestream]], + size = [[20 r16]], + sizegrowth = 1, + ttl = [[28 r3]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, -10 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - ["dgun-deflect"] = { - firespawnbright = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[glow2]], - length = 400, - sidetexture = [[none]], - size = 8.5, - sizegrowth = 22.5, - ttl = 35, - pos = [[0, 34, 0]], - rotParams = [[-280 r50, -10 r20, 0 r90]], - drawOrder = 0, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 0, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.88, - -- ttl = 26, - -- expansionSpeed = 4.5, - -- color = [[0.5, 0.65, 0.95]], - -- alwaysvisible = true, - -- --drawOrder = -2, - -- }, - -- }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 0.8, - maxheat = 11, - pos = [[r-10 r10, 30, r-10 r10]], - size = 300, - sizegrowth = -15, - speed = [[0, 0, 0]], - texture = [[flare2]], - alwaysvisible = false, - drawOrder = 1, - }, - }, - -- pop2blast = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 0.6 0.7 0.95 0.25 0.35 0.45 0.65 0.10 0.14 0.18 0.24 0.07 0 0 0 0.001]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 14, - -- sidetexture = [[none]], - -- size = 14, - -- sizegrowth = [[5 r3]], - -- ttl = [[11 r3]], - -- pos = [[0, 15 r10, 0]], - -- rotParams = [[-60 r120, -50 r100, -180 r360]], - -- drawOrder = 1, - -- }, - -- }, - -- groundflash_large_long = { - -- class = [[CSimpleGroundFlash]], - -- count = 0, - -- air = true, - -- ground = true, - -- water = true, - -- properties = { - -- colormap = [[0.82 0.82 0.82 0.50 0.7 0.7 0.7 0.30 0 0 0 0.01]], - -- size = 130, - -- ttl = 25, - -- sizegrowth = -6.5, - -- texture = [[groundflashwhite]], - -- alwaysvisible = false, - -- }, - -- }, - -- groundflash_large_long2 = { - -- class = [[CSimpleGroundFlash]], - -- count = 0, - -- air = true, - -- ground = true, - -- water = true, - -- properties = { - -- colormap = [[0.82 0.82 0.82 0.50 0.7 0.7 0.7 0.30 0 0 0 0.01]], - -- size = 30, - -- ttl = 28, - -- sizegrowth = 1.5, - -- texture = [[seismic]], - -- rotParams = [[-60 r120, -30 r60, -180 r360]], - -- alwaysvisible = false, - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], - size = 60, - sizegrowth = 0, - ttl = 30, - texture = [[groundflashwhite]], - alwaysvisible = false, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 0.50 0.68 0.82 0.03 0.45 0.62 0.75 0.05 0.40 0.50 0.60 0.06 0.10 0.12 0.18 0.008 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 3, - particlelife = 22, - particlelifespread = 12, - particlesize = -12, - particlesizespread = -20, - particlespeed = 12.5, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = 0.11, - sizemod = 0.98, - texture = [[gunshotxl2]], - useairlos = false, - alwaysvisible = false, - drawOrder = 1, - castShadow = true, - }, - }, - -- dgundeflect = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- water = true, - -- underwater = false, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0.84 0.78 0.60 0.5 0.82 0.68 0.45 0.4 0.72 0.50 0.18 0.4 0.40 0.20 0.14 0.12 0 0 0 0.01]], - -- directional = true, - -- emitrot = 60, - -- emitrotspread = 10, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.01, 0]], - -- numparticles = 1, - -- particlelife = 36, - -- particlelifespread = 12, - -- particlesize = -180, - -- particlesizespread = -20, - -- particlespeed = 20.5, - -- particlespeedspread = 5, - -- pos = [[0, 30, 0]], - -- sizegrowth = 0.13, - -- sizemod = 0.98, - -- texture = [[gunshotxl2]], - -- useairlos = false, - -- alwaysvisible = false, - -- drawOrder = 2, - -- }, - -- }, - -- fireglow = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.9, - -- colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], - -- directional = true, - -- emitrot = 65, - -- emitrotspread = 30, - -- emitvector = [[0.0, 1, 0.0]], - -- gravity = [[0.0, 0.0, 0.0]], - -- numparticles = 1, - -- particlelife = 30, - -- particlelifespread = 0, - -- particlesize = 100, - -- particlesizespread = 64, - -- particlespeed = 3, - -- particlespeedspread = 0, - -- pos = [[0, 2, 0]], - -- sizegrowth = 10.2, - -- sizemod = 1, - -- texture = [[blastwave]], - -- useairlos = false, - -- alwaysvisible = false, - -- }, - -- }, - -- fireburn2 = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0.45 0.55 0.95 0.95 0.45 0.55 0.95 0.70 0.20 0.25 0.35 0.60 0.21 0.22 0.27 0.45 0.16 0.15 0.14 0.40 0.12 0.11 0.1 0.48 0.063 0.062 0.058 0.30 0 0 0 0.01]], - -- directional = false, - -- emitrot = 45, - -- emitrotspread = 35, - -- emitvector = [[0, 0.8, 0]], - -- gravity = [[-0.02 r0.04, 0.007 r0.04, -0.02 r0.04]], - -- numparticles = 1, - -- particlelife = 12, - -- particlelifespread = 60, - -- particlesize = 60, - -- particlesizespread = 44, - -- particlespeed = 3.2, - -- particlespeedspread = 3.7, - -- pos = [[0.0, 35, 0.0]], - -- rotParams = [[-17 r34, -9 r18, -180 r360]], - -- sizegrowth = 1.8, - -- sizemod = 1, - -- texture = [[BARFlame02]], - -- animParams = [[16,6,80 r80]], - -- useairlos = true, - -- castShadow = true, - -- drawOrder = 1, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.94, - colormap = [[0.3 0.4 0.8 0 0.45 0.55 0.95 0.58 0.55 0.65 0.85 0.66 0.12 0.12 0.12 0.47 0.07 0.07 0.07 0.4 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = 2, - particlelife = 26, - particlelifespread = 25, - particlesize = 22, - particlesizespread = 9.6, - particlespeed = 2, - particlespeedspread = 5, - pos = [[0, 3, 0]], - rotParams = [[-24 r48, -10 r20, 180 r360]], - sizegrowth = -0.045, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, --3 - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 75, - emitrotspread = 12, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.06, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 60, - particlesize = 30, - particlesizespread = 55, - particlespeed = 1.6, - particlespeedspread = 5, - pos = [[0, 10, 0]], - rotParams = [[-20 r40, -5 r10, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = false, - }, - }, - -- dustparticlesbright = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, --4 - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.90, - -- colormap = [[1 1 1 0.22 0.65 0.75 0.88 0.12 0.4 0.44 0.56 0.06 0 0 0 0.1]], - -- directional = false, - -- emitrot = 30, - -- emitrotspread = 10, - -- emitvector = [[0.3, 1, 0.3]], - -- gravity = [[0, -0.011, 0]], - -- numparticles = 1, - -- particlelife = 30, - -- particlelifespread = 5.75, - -- particlesize = 14, - -- particlesizespread = 29, - -- particlespeed = 6.0, - -- particlespeedspread = 6, - -- pos = [[0, 0, 0]], - -- rotParams = [[-48 r96, -10 r20, 180 r360]], - -- sizegrowth = 0.74, - -- sizemod = 0.95, - -- texture = [[randomdots]], - -- alwaysvisible = false, - -- }, - -- }, - -- shockwaveblast = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 0.40 0.40 0.40 0.16 0.24 0.24 0.24 0.09 0.16 0.16 0.16 0.007 0.09 0.09 0.09 0.006 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 5, - -- sizegrowth = 40, - -- ttl = 17, - -- pos = [[0, 20, 0]], - -- alwaysvisible = false, - -- }, - -- }, - -- shockwaveslow= { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = false, - -- water = false, - -- properties = { - -- colormap = [[0 0 0 0 0.8 0.8 0.8 0.04 0.65 0.65 0.65 0.03 0.25 0.25 0.25 0.024 0.12 0.12 0.12 0.012 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = -0.01, --0.03 - -- fronttexture = [[explosionwave]], - -- length = 400, - -- sidetexture = [[none]], - -- size = 20, - -- sizegrowth = 3, - -- ttl = 27, - -- pos = [[0, 25, 0]], - -- --castShadow = true, - -- }, - -- }, - -- shockwaveslow2= { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = false, - -- water = false, - -- properties = { - -- colormap = [[0.8 0.8 0.8 0.7 0.65 0.65 0.65 0.5 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0.2, --0.03 - -- fronttexture = [[circles]], - -- length = 100, - -- sidetexture = [[none]], - -- size = 15, - -- sizegrowth = 2, - -- ttl = 22, - -- pos = [[0, 0, 0]], - -- rotParams = [[80 r40, -60 r30, -180 r360]], - -- --castShadow = true, - -- drawOrder = 0, - -- }, - -- }, - shield_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:deflectshield]], - pos = [[0, 15 i20, 0]], - }, - }, - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 6, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - directional = false, - emitrot = 25, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 10, - particlesize = 6, - particlesizespread = 32, - particlespeed = 1, - particlespeedspread = 8, - rotParams = [[-20 r40, -1 r2, -180 r360]], - pos = [[-6 r12, 25, -6 r12]], - sizegrowth = 0.63, - sizemod = 1, - texture = [[lightninginair]], - useairlos = false, - drawOrder = 2, + -- DGUN Deflect mechanic for Commander Update - }, - }, - blueelectricityspikesalt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - directional = false, - emitrot = 25, - emitrotspread = 20, - emitvector = [[0, 0.5, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 10, - particlesize = -9, - particlesizespread = -32, - particlespeed = 1, - particlespeedspread = 6, - rotParams = [[-20 r40, -1 r2, -180 r360]], - pos = [[-5 r10, 35, -5 r10]], - sizegrowth = 0.63, - sizemod = 1, - texture = [[lightninginair]], - useairlos = false, - drawOrder = 2, - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 25, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[6 r70]], - -- explosiongenerator = [[custom:lightning_stormbigalt]], - -- pos = [[-120 r240, 30 r30, -120 r240]], - -- alwaysvisible = false, - -- }, - -- }, - }, - ["deflectshield"] = { - shockwaveslow2= { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0.8 0.8 0.8 0.7 0.65 0.65 0.65 0.5 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, --0.03 - fronttexture = [[circles]], - length = 100, - sidetexture = [[none]], - size = 15, - sizegrowth = 2, - ttl = 22, - pos = [[0, 0, 0]], - rotParams = [[80 r40, -60 r30, -180 r360]], - --castShadow = true, - drawOrder = 0, - }, - }, - }, + ["dgun-deflect"] = { + firespawnbright = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.40 0.55 0.70 0.08 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[glow2]], + length = 400, + sidetexture = [[none]], + size = 8.5, + sizegrowth = 22.5, + ttl = 35, + pos = [[0, 34, 0]], + rotParams = [[-280 r50, -10 r20, 0 r90]], + drawOrder = 0, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 0, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.88, + -- ttl = 26, + -- expansionSpeed = 4.5, + -- color = [[0.5, 0.65, 0.95]], + -- alwaysvisible = true, + -- --drawOrder = -2, + -- }, + -- }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 0.8, + maxheat = 11, + pos = [[r-10 r10, 30, r-10 r10]], + size = 300, + sizegrowth = -15, + speed = [[0, 0, 0]], + texture = [[flare2]], + alwaysvisible = false, + drawOrder = 1, + }, + }, + -- pop2blast = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 0.6 0.7 0.95 0.25 0.35 0.45 0.65 0.10 0.14 0.18 0.24 0.07 0 0 0 0.001]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 14, + -- sidetexture = [[none]], + -- size = 14, + -- sizegrowth = [[5 r3]], + -- ttl = [[11 r3]], + -- pos = [[0, 15 r10, 0]], + -- rotParams = [[-60 r120, -50 r100, -180 r360]], + -- drawOrder = 1, + -- }, + -- }, + -- groundflash_large_long = { + -- class = [[CSimpleGroundFlash]], + -- count = 0, + -- air = true, + -- ground = true, + -- water = true, + -- properties = { + -- colormap = [[0.82 0.82 0.82 0.50 0.7 0.7 0.7 0.30 0 0 0 0.01]], + -- size = 130, + -- ttl = 25, + -- sizegrowth = -6.5, + -- texture = [[groundflashwhite]], + -- alwaysvisible = false, + -- }, + -- }, + -- groundflash_large_long2 = { + -- class = [[CSimpleGroundFlash]], + -- count = 0, + -- air = true, + -- ground = true, + -- water = true, + -- properties = { + -- colormap = [[0.82 0.82 0.82 0.50 0.7 0.7 0.7 0.30 0 0 0 0.01]], + -- size = 30, + -- ttl = 28, + -- sizegrowth = 1.5, + -- texture = [[seismic]], + -- rotParams = [[-60 r120, -30 r60, -180 r360]], + -- alwaysvisible = false, + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.82 0.82 0.82 0.77 0 0 0 0.01]], + size = 60, + sizegrowth = 0, + ttl = 30, + texture = [[groundflashwhite]], + alwaysvisible = false, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 0.50 0.68 0.82 0.03 0.45 0.62 0.75 0.05 0.40 0.50 0.60 0.06 0.10 0.12 0.18 0.008 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 3, + particlelife = 22, + particlelifespread = 12, + particlesize = -12, + particlesizespread = -20, + particlespeed = 12.5, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = 0.11, + sizemod = 0.98, + texture = [[gunshotxl2]], + useairlos = false, + alwaysvisible = false, + drawOrder = 1, + castShadow = true, + }, + }, + -- dgundeflect = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- water = true, + -- underwater = false, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0.84 0.78 0.60 0.5 0.82 0.68 0.45 0.4 0.72 0.50 0.18 0.4 0.40 0.20 0.14 0.12 0 0 0 0.01]], + -- directional = true, + -- emitrot = 60, + -- emitrotspread = 10, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.01, 0]], + -- numparticles = 1, + -- particlelife = 36, + -- particlelifespread = 12, + -- particlesize = -180, + -- particlesizespread = -20, + -- particlespeed = 20.5, + -- particlespeedspread = 5, + -- pos = [[0, 30, 0]], + -- sizegrowth = 0.13, + -- sizemod = 0.98, + -- texture = [[gunshotxl2]], + -- useairlos = false, + -- alwaysvisible = false, + -- drawOrder = 2, + -- }, + -- }, + -- fireglow = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.9, + -- colormap = [[0.80 0.80 0.80 0.2 0 0 0 0]], + -- directional = true, + -- emitrot = 65, + -- emitrotspread = 30, + -- emitvector = [[0.0, 1, 0.0]], + -- gravity = [[0.0, 0.0, 0.0]], + -- numparticles = 1, + -- particlelife = 30, + -- particlelifespread = 0, + -- particlesize = 100, + -- particlesizespread = 64, + -- particlespeed = 3, + -- particlespeedspread = 0, + -- pos = [[0, 2, 0]], + -- sizegrowth = 10.2, + -- sizemod = 1, + -- texture = [[blastwave]], + -- useairlos = false, + -- alwaysvisible = false, + -- }, + -- }, + -- fireburn2 = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0.45 0.55 0.95 0.95 0.45 0.55 0.95 0.70 0.20 0.25 0.35 0.60 0.21 0.22 0.27 0.45 0.16 0.15 0.14 0.40 0.12 0.11 0.1 0.48 0.063 0.062 0.058 0.30 0 0 0 0.01]], + -- directional = false, + -- emitrot = 45, + -- emitrotspread = 35, + -- emitvector = [[0, 0.8, 0]], + -- gravity = [[-0.02 r0.04, 0.007 r0.04, -0.02 r0.04]], + -- numparticles = 1, + -- particlelife = 12, + -- particlelifespread = 60, + -- particlesize = 60, + -- particlesizespread = 44, + -- particlespeed = 3.2, + -- particlespeedspread = 3.7, + -- pos = [[0.0, 35, 0.0]], + -- rotParams = [[-17 r34, -9 r18, -180 r360]], + -- sizegrowth = 1.8, + -- sizemod = 1, + -- texture = [[BARFlame02]], + -- animParams = [[16,6,80 r80]], + -- useairlos = true, + -- castShadow = true, + -- drawOrder = 1, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.94, + colormap = [[0.3 0.4 0.8 0 0.45 0.55 0.95 0.58 0.55 0.65 0.85 0.66 0.12 0.12 0.12 0.47 0.07 0.07 0.07 0.4 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = 2, + particlelife = 26, + particlelifespread = 25, + particlesize = 22, + particlesizespread = 9.6, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 3, 0]], + rotParams = [[-24 r48, -10 r20, 180 r360]], + sizegrowth = -0.045, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, --3 + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.065 0.065 0.055 0.17 0.05 0.048 0.03 0.12 0.024 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 75, + emitrotspread = 12, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.06, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 60, + particlesize = 30, + particlesizespread = 55, + particlespeed = 1.6, + particlespeedspread = 5, + pos = [[0, 10, 0]], + rotParams = [[-20 r40, -5 r10, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = false, + }, + }, + -- dustparticlesbright = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, --4 + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.90, + -- colormap = [[1 1 1 0.22 0.65 0.75 0.88 0.12 0.4 0.44 0.56 0.06 0 0 0 0.1]], + -- directional = false, + -- emitrot = 30, + -- emitrotspread = 10, + -- emitvector = [[0.3, 1, 0.3]], + -- gravity = [[0, -0.011, 0]], + -- numparticles = 1, + -- particlelife = 30, + -- particlelifespread = 5.75, + -- particlesize = 14, + -- particlesizespread = 29, + -- particlespeed = 6.0, + -- particlespeedspread = 6, + -- pos = [[0, 0, 0]], + -- rotParams = [[-48 r96, -10 r20, 180 r360]], + -- sizegrowth = 0.74, + -- sizemod = 0.95, + -- texture = [[randomdots]], + -- alwaysvisible = false, + -- }, + -- }, + -- shockwaveblast = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 0.40 0.40 0.40 0.16 0.24 0.24 0.24 0.09 0.16 0.16 0.16 0.007 0.09 0.09 0.09 0.006 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 5, + -- sizegrowth = 40, + -- ttl = 17, + -- pos = [[0, 20, 0]], + -- alwaysvisible = false, + -- }, + -- }, + -- shockwaveslow= { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = false, + -- water = false, + -- properties = { + -- colormap = [[0 0 0 0 0.8 0.8 0.8 0.04 0.65 0.65 0.65 0.03 0.25 0.25 0.25 0.024 0.12 0.12 0.12 0.012 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = -0.01, --0.03 + -- fronttexture = [[explosionwave]], + -- length = 400, + -- sidetexture = [[none]], + -- size = 20, + -- sizegrowth = 3, + -- ttl = 27, + -- pos = [[0, 25, 0]], + -- --castShadow = true, + -- }, + -- }, + -- shockwaveslow2= { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = false, + -- water = false, + -- properties = { + -- colormap = [[0.8 0.8 0.8 0.7 0.65 0.65 0.65 0.5 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0.2, --0.03 + -- fronttexture = [[circles]], + -- length = 100, + -- sidetexture = [[none]], + -- size = 15, + -- sizegrowth = 2, + -- ttl = 22, + -- pos = [[0, 0, 0]], + -- rotParams = [[80 r40, -60 r30, -180 r360]], + -- --castShadow = true, + -- drawOrder = 0, + -- }, + -- }, + shield_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:deflectshield]], + pos = [[0, 15 i20, 0]], + }, + }, + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 6, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = false, + emitrot = 25, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 10, + particlesize = 6, + particlesizespread = 32, + particlespeed = 1, + particlespeedspread = 8, + rotParams = [[-20 r40, -1 r2, -180 r360]], + pos = [[-6 r12, 25, -6 r12]], + sizegrowth = 0.63, + sizemod = 1, + texture = [[lightninginair]], + useairlos = false, + drawOrder = 2, + }, + }, + blueelectricityspikesalt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = false, + emitrot = 25, + emitrotspread = 20, + emitvector = [[0, 0.5, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 10, + particlesize = -9, + particlesizespread = -32, + particlespeed = 1, + particlespeedspread = 6, + rotParams = [[-20 r40, -1 r2, -180 r360]], + pos = [[-5 r10, 35, -5 r10]], + sizegrowth = 0.63, + sizemod = 1, + texture = [[lightninginair]], + useairlos = false, + drawOrder = 2, + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 25, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[6 r70]], + -- explosiongenerator = [[custom:lightning_stormbigalt]], + -- pos = [[-120 r240, 30 r30, -120 r240]], + -- alwaysvisible = false, + -- }, + -- }, + }, + ["deflectshield"] = { + shockwaveslow2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0.8 0.8 0.8 0.7 0.65 0.65 0.65 0.5 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, --0.03 + fronttexture = [[circles]], + length = 100, + sidetexture = [[none]], + size = 15, + sizegrowth = 2, + ttl = 22, + pos = [[0, 0, 0]], + rotParams = [[80 r40, -60 r30, -180 r360]], + --castShadow = true, + drawOrder = 0, + }, + }, + }, } diff --git a/effects/dirt.lua b/effects/dirt.lua index b859357f54c..5175ec2a8e6 100644 --- a/effects/dirt.lua +++ b/effects/dirt.lua @@ -1,579 +1,578 @@ -- dirt return { - ["dirt"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.05 0.05 0.05 0.8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25 r0.3, 0]], - numparticles = 4, - particlelife = 14, - particlelifespread = 21, - particlesize = 8, - particlesizespread = 19, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 1.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.1 0.1 0.1 0.5 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25 r0.3, 0]], - numparticles = 3, - particlelife = 16, - particlelifespread = 24, - particlesize = 6, - particlesizespread = 22, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 1.1, - sizemod = 1.0, - texture = [[new_dirtb]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtw = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 20, - particlesize = [[7 r4]], - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - }, - }, - }, + ["dirt"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.05 0.05 0.05 0.8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25 r0.3, 0]], + numparticles = 4, + particlelife = 14, + particlelifespread = 21, + particlesize = 8, + particlesizespread = 19, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.1 0.1 0.1 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25 r0.3, 0]], + numparticles = 3, + particlelife = 16, + particlelifespread = 24, + particlesize = 6, + particlesizespread = 22, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.1, + sizemod = 1.0, + texture = [[new_dirtb]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 20, + particlesize = [[7 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, -["dirtpopup"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.8, - colormap = [[0.06 0.06 0.06 0.7 0.06 0.06 0.06 0.6 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25 r0.3, 0]], - numparticles = 4, - particlelife = 18, - particlelifespread = 32, - particlesize = 8, - particlesizespread = 24, - particlespeed = 2, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 1.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirttop = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.94, - colormap = [[0.3 0.3 0.3 0.7 0 0 0 0.01]], - directional = false, - emitrot = 10, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.35 r0.2, 0]], - numparticles = 2, - particlelife = 26, - particlelifespread = 32, - particlesize = 12, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 2, - pos = [[r-0.5 r0.5, 10 r15, r-0.5 r0.5]], - sizegrowth = 1.3, - sizemod = 1.0, - texture = [[smoke_puff]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtpopup = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - air = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0.55 0.1 0.07 0.033 0.44 0 0 0 0]], - directional = true, - emitrot = 180, - emitrotspread = 10, - emitvector = [[-0.5 r1, -1, -0.5 r1]], - gravity = [[0, -0.06, 0]], - numparticles = [[2 r1]], - particlelife = 22, - particlelifespread = 40, - particlesize = 12.5, - particlesizespread = 16.5, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 12, 0]], - sizegrowth = [[-0.20 r0.20]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.1 0.1 0.1 0.6 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25 r0.3, 0]], - numparticles = 4, - particlelife = 16, - particlelifespread = 24, - particlesize = 5, - particlesizespread = 28, - particlespeed = 1, - particlespeedspread = 4, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 1.1, - sizemod = 1.0, - texture = [[new_dirtb]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtw = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 20, - particlesize = [[7 r4]], - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - }, - }, - }, + ["dirtpopup"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.06 0.06 0.06 0.7 0.06 0.06 0.06 0.6 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25 r0.3, 0]], + numparticles = 4, + particlelife = 18, + particlelifespread = 32, + particlesize = 8, + particlesizespread = 24, + particlespeed = 2, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirttop = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.94, + colormap = [[0.3 0.3 0.3 0.7 0 0 0 0.01]], + directional = false, + emitrot = 10, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.35 r0.2, 0]], + numparticles = 2, + particlelife = 26, + particlelifespread = 32, + particlesize = 12, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 2, + pos = [[r-0.5 r0.5, 10 r15, r-0.5 r0.5]], + sizegrowth = 1.3, + sizemod = 1.0, + texture = [[smoke_puff]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtpopup = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + air = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0.55 0.1 0.07 0.033 0.44 0 0 0 0]], + directional = true, + emitrot = 180, + emitrotspread = 10, + emitvector = [[-0.5 r1, -1, -0.5 r1]], + gravity = [[0, -0.06, 0]], + numparticles = [[2 r1]], + particlelife = 22, + particlelifespread = 40, + particlesize = 12.5, + particlesizespread = 16.5, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 12, 0]], + sizegrowth = [[-0.20 r0.20]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.1 0.1 0.1 0.6 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25 r0.3, 0]], + numparticles = 4, + particlelife = 16, + particlelifespread = 24, + particlesize = 5, + particlesizespread = 28, + particlespeed = 1, + particlespeedspread = 4, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.1, + sizemod = 1.0, + texture = [[new_dirtb]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 20, + particlesize = [[7 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, - ["dirtpoof"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.72, - colormap = [[0.05 0.05 0.05 0.9 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.4 r0.2, 0]], - numparticles = 5, - particlelife = 15, - particlelifespread = 20, - particlesize = [[4 r10]], - particlesizespread = 15, - particlespeed = 5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 3.2, - sizemod = 0.98, - texture = [[new_dirta]], - useairlos = false, - drawOrder = 1, - --alwaysvisible = true, - }, - }, + ["dirtpoof"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.72, + colormap = [[0.05 0.05 0.05 0.9 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.4 r0.2, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 20, + particlesize = [[4 r10]], + particlesizespread = 15, + particlespeed = 5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 3.2, + sizemod = 0.98, + texture = [[new_dirta]], + useairlos = false, + drawOrder = 1, + --alwaysvisible = true, + }, + }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.71, - colormap = [[0.05 0.05 0.05 0.10 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5 r0.3, 0]], - numparticles = 5, - particlelife = 20, - particlelifespread = 40, - particlesize = [[2.5 r5]], - particlesizespread = 15, - particlespeed = 12, - particlespeedspread = 15, - pos = [[0.1 r0.1, 2 r1.0, 0.1 r0.1]], - sizegrowth = 2.0, - sizemod = 0.98, - texture = [[smoke_puff]], - useairlos = false, - alwaysvisible = true, - }, - }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.71, + colormap = [[0.05 0.05 0.05 0.10 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5 r0.3, 0]], + numparticles = 5, + particlelife = 20, + particlelifespread = 40, + particlesize = [[2.5 r5]], + particlesizespread = 15, + particlespeed = 12, + particlespeedspread = 15, + pos = [[0.1 r0.1, 2 r1.0, 0.1 r0.1]], + sizegrowth = 2.0, + sizemod = 0.98, + texture = [[smoke_puff]], + useairlos = false, + alwaysvisible = true, + }, + }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.3 0.3 0.3 0.12 0.5 0.5 0.5 0.50 0.2 0.2 0.2 0.25 0.1 0.1 0.1 0.008 0.04 0.04 0.04 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 2.5, - sizegrowth = [[-19 r3]], - ttl = 12, - pos = [[0, 5, 0]], - --drawOrder = 1, - }, - }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.3 0.3 0.3 0.12 0.5 0.5 0.5 0.50 0.2 0.2 0.2 0.25 0.1 0.1 0.1 0.008 0.04 0.04 0.04 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 2.5, + sizegrowth = [[-19 r3]], + ttl = 12, + pos = [[0, 5, 0]], + --drawOrder = 1, + }, + }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - properties = { - colormap = [[1 1 1 0.15 0 0 0 0.01]], - size = 45, - sizegrowth = -1.8, - ttl = 40, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + properties = { + colormap = [[1 1 1 0.15 0 0 0 0.01]], + size = 45, + sizegrowth = -1.8, + ttl = 40, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - properties = { - colormap = [[1 0.9 0.75 0.26 0 0 0 0.01]], - size = 45, - sizegrowth = -1, - ttl = 16, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + properties = { + colormap = [[1 0.9 0.75 0.26 0 0 0 0.01]], + size = 45, + sizegrowth = -1, + ttl = 16, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 2, - particlesize = 6.9, - particlesizespread = 1.7, - particlespeed = 3.4, - particlespeedspread = 1, - rotParams = [[-80 r160, -10 r20, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.80, - alwaysVisible = 0, - sizeGrowth = 3.5, - sizeMod = 0.97, - rotParams = [[-40 r80, -10 r20, -180 r360]], - pos = [[r-4 r8, 0, r-4 r8]], - emitRot=55, - emitRotSpread=20, - emitVector = [[0, 1, 0]], - gravity = [[-0.04 r 0.08, -0.02, -0.04 r 0.08]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[bigexplosmoke]], - particleLife=12, - particleLifeSpread=28, - numparticles=1, - particleSpeed=3.7, - particleSpeedSpread=6.7, - particleSize=11, - particleSizeSpread=22, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[-0.04 r 0.08, -0.27, -0.04 r 0.08]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 1.7, - particlesizespread = -1.9, - particlespeed = 2.45, - particlespeedspread = 2.75, - rotParams = [[-40 r80, -10 r20, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.27, 0]], - numparticles = 3, - particlelife = 35, - particlelifespread = 17, - particlesize = 1.9, - particlesizespread = -1.4, - particlespeed = 2.65, - particlespeedspread = 3.35, - rotParams = [[-40 r80, -10 r20, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirtw = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - air = false, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 20, - particlesize = [[7 r4]], - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - alwaysvisible = true, - }, - }, - }, - - ["dirtsmall"] = { - dirtg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.05 0.05 0.05 0.6 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 4, - particlelife = 10, - particlelifespread = 20, - particlesize = [[12 r4]], - particlesizespread = 10, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 1, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - }, - }, - dirttop = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.94, - colormap = [[0.25 0.25 0.25 0.52 0 0 0 0.01]], - directional = false, - emitrot = 10, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.35 r0.1, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 26, - particlesize = 8, - particlesizespread = 16, - particlespeed = 4, - particlespeedspread = 1.5, - pos = [[r-0.5 r0.5, 10 r15, r-0.5 r0.5]], - sizegrowth = 1.3, - sizemod = 1.0, - texture = [[smoke_puff]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirtw = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 10, - particlelife = 10, - particlelifespread = 20, - particlesize = [[7 r4]], - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 6, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[new_dirta]], - useairlos = false, - }, - }, - }, -} + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 2, + particlesize = 6.9, + particlesizespread = 1.7, + particlespeed = 3.4, + particlespeedspread = 1, + rotParams = [[-80 r160, -10 r20, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.80, + alwaysVisible = 0, + sizeGrowth = 3.5, + sizeMod = 0.97, + rotParams = [[-40 r80, -10 r20, -180 r360]], + pos = [[r-4 r8, 0, r-4 r8]], + emitRot = 55, + emitRotSpread = 20, + emitVector = [[0, 1, 0]], + gravity = [[-0.04 r 0.08, -0.02, -0.04 r 0.08]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[bigexplosmoke]], + particleLife = 12, + particleLifeSpread = 28, + numparticles = 1, + particleSpeed = 3.7, + particleSpeedSpread = 6.7, + particleSize = 11, + particleSizeSpread = 22, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[-0.04 r 0.08, -0.27, -0.04 r 0.08]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 1.7, + particlesizespread = -1.9, + particlespeed = 2.45, + particlespeedspread = 2.75, + rotParams = [[-40 r80, -10 r20, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.27, 0]], + numparticles = 3, + particlelife = 35, + particlelifespread = 17, + particlesize = 1.9, + particlesizespread = -1.4, + particlespeed = 2.65, + particlespeedspread = 3.35, + rotParams = [[-40 r80, -10 r20, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + air = false, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 20, + particlesize = [[7 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + alwaysvisible = true, + }, + }, + }, + ["dirtsmall"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.05 0.05 0.05 0.6 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 4, + particlelife = 10, + particlelifespread = 20, + particlesize = [[12 r4]], + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + }, + }, + dirttop = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.94, + colormap = [[0.25 0.25 0.25 0.52 0 0 0 0.01]], + directional = false, + emitrot = 10, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.35 r0.1, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 26, + particlesize = 8, + particlesizespread = 16, + particlespeed = 4, + particlespeedspread = 1.5, + pos = [[r-0.5 r0.5, 10 r15, r-0.5 r0.5]], + sizegrowth = 1.3, + sizemod = 1.0, + texture = [[smoke_puff]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 20, + particlesize = [[7 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, +} diff --git a/effects/dust_cloud.lua b/effects/dust_cloud.lua index 296487e744b..4ebdb5ed874 100644 --- a/effects/dust_cloud.lua +++ b/effects/dust_cloud.lua @@ -1,255 +1,255 @@ - return { - ["dust_cloud"] = { - poof01 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - properties = { - airdrag = 0.93, - alwaysvisible = false, - colormap = [[0.0 0.0 0.0 0.01 0.20 0.19 0.17 0.35 0.14 0.12 0.10 0.17 0 0 0 0.001]], - directional = false, - emitrot = 90, - emitrotspread = 25, - emitvector = [[0, 0, 0]], - gravity = [[-0.025 r0.05, 0 r0.06, -0.025 r0.05]], - numparticles = [[0.8 r0.65]], - particlelife = 14, - particlelifespread = 4, - particlesize = 12, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[r-3 r3, 1, r-8 r3]], - rotParams = [[-20 r40, -15 r30, -180 r360]], - sizegrowth = [[r-0.12 r0.38]], - --sizegrowth = 0, - sizemod = 0.94, - texture = [[dirtpuff]], - --castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0.55 0.1 0.07 0.033 0.44 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 10, - emitvector = [[0, -0.15, 0]], - gravity = [[0, -0.07, 0]], - numparticles = [[0.45 r0.62]], - particlelife = 11, - particlelifespread = 24, - particlesize = 5, - particlesizespread = 6, - particlespeed = 2.2, - particlespeedspread = 8, - pos = [[0, 6, 0]], - rotParams = [[-26 r52, -20 r40, -180 r360]], - sizegrowth = [[-0.08 r0.15]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - }, - ["dust_cloud_dirt_light"] = { - poof01 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - properties = { - airdrag = 0.93, - alwaysvisible = false, - useairlos = false, - colormap = [[0.03 0.02 0.01 0.02 0.19 0.16 0.12 0.32 0.14 0.12 0.09 0.21 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[-0.02 r0.04, -0.01 r0.06, r-0.02 r0.04]], - numparticles = [[0.8 r0.65]], - particlelife = 14, - particlelifespread = 17, - particlesize = 15, - particlesizespread = 5.5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[-3 r6, -40 r10, -3 r6]], - rotParams = [[-20 r40, -20 r40, -180 r360]], - --sizegrowth = 0, - sizegrowth = [[r-0.14 r0.28]], - sizemod = 0.965, - texture = [[dirtpuff]], - --texture = [[smoke-anim]], - --animParams = [[8,6,30 r50]], - castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0.66 0.1 0.07 0.033 0.55 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 10, - emitvector = [[0, -0.15, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0.48 r0.65]], - particlelife = 13, - particlelifespread = 28, - particlesize = 7, - particlesizespread = 8, - particlespeed = 2.5, - particlespeedspread = 10, - pos = [[0, 6, 0]], - rotParams = [[-26 r52, -20 r40, -180 r360]], - sizegrowth = [[-0.10 r0.22]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - }, - ["dust_cloud_dirt"] = { - poof01 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - properties = { - airdrag = 0.93, - alwaysvisible = false, - useairlos = false, - --colormap = [[0.0 0.0 0.00 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], - colormap = [[0.03 0.02 0.01 0.01 0.15 0.13 0.09 0.4 0.13 0.12 0.09 0.24 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 25, - emitvector = [[0, 0, 0]], - gravity = [[-0.03 r0.06, 0.02 r0.05, -0.03 r0.06]], - numparticles = [[0.7 r0.5]], - particlelife = 18, - particlelifespread = 20, - particlesize = 17, - particlesizespread = 13, - particlespeed = 0, - particlespeedspread = 0, - pos = [[r-3 r3, 1, r-8 r3]], - rotParams = [[-26 r52, -20 r40, -180 r360]], - --sizegrowth = [[r0.24 r0.34]], - sizegrowth = 0, - sizemod = 0.99, - texture = [[dirtpuff]], - --castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0.66 0.1 0.07 0.033 0.55 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 10, - emitvector = [[0, -0.1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = [[0.5 r0.66]], - particlelife = 22, - particlelifespread = 40, - particlesize = 6.5, - particlesizespread = 8.5, - particlespeed = 2, - particlespeedspread = 10, - pos = [[0, 6, 0]], - rotParams = [[-26 r52, -20 r40, -180 r360]], - sizegrowth = [[-0.10 r0.22]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - }, - ["dust_cloud_fast"] = { - poof01 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - properties = { - airdrag = 0.90, - alwaysvisible = false, - colormap = [[0.05 0.0 0.0 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], - directional = true, - emitrot = 90, - emitrotspread = 25, - emitvector = [[0, 0, 0]], - gravity = [[r-0.05 r0.05, 0 r0.09, r-0.05 r0.05]], - numparticles = 1, - particlelife = 10, - particlelifespread = 26, - particlesize = 6, - particlesizespread = 3, - particlespeed = 3, - particlespeedspread = 10, - pos = [[r-3 r3, 1, r-8 r3]], - rotParams = [[-3 r6, -4 r8, -180 r360]], - sizegrowth = [[r0.25 r0.40]], - sizemod = 1.0, - texture = [[smoke_puff]], - }, - }, - }, - ["dust_cloud_huge"] = { - poof01 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - properties = { - airdrag = 0.93, - alwaysvisible = false, - colormap = [[0.0 0.0 0.00 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], - directional = true, - emitrot = 90, - emitrotspread = 25, - emitvector = [[0, 0, 0]], - gravity = [[r-0.05 r0.05, 0 r0.05, r-0.05 r0.05]], - numparticles = 1, - particlelife = 20, - particlelifespread = 30, - particlesize = 32, - particlesizespread = 1.1, - particlespeed = 3, - particlespeedspread = 10, - pos = [[r-3 r3, 1, r-8 r3]], - rotParams = [[-2 r4, -3 r6, -180 r360]], - sizegrowth = [[r0.20 r0.30]], - sizemod = 1.1, - texture = [[smoke_puff]], - }, - }, - }, +return { + ["dust_cloud"] = { + poof01 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + properties = { + airdrag = 0.93, + alwaysvisible = false, + colormap = [[0.0 0.0 0.0 0.01 0.20 0.19 0.17 0.35 0.14 0.12 0.10 0.17 0 0 0 0.001]], + directional = false, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[-0.025 r0.05, 0 r0.06, -0.025 r0.05]], + numparticles = [[0.8 r0.65]], + particlelife = 14, + particlelifespread = 4, + particlesize = 12, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[r-3 r3, 1, r-8 r3]], + rotParams = [[-20 r40, -15 r30, -180 r360]], + sizegrowth = [[r-0.12 r0.38]], + --sizegrowth = 0, + sizemod = 0.94, + texture = [[dirtpuff]], + --castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0.55 0.1 0.07 0.033 0.44 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 10, + emitvector = [[0, -0.15, 0]], + gravity = [[0, -0.07, 0]], + numparticles = [[0.45 r0.62]], + particlelife = 11, + particlelifespread = 24, + particlesize = 5, + particlesizespread = 6, + particlespeed = 2.2, + particlespeedspread = 8, + pos = [[0, 6, 0]], + rotParams = [[-26 r52, -20 r40, -180 r360]], + sizegrowth = [[-0.08 r0.15]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + }, + ["dust_cloud_dirt_light"] = { + poof01 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + properties = { + airdrag = 0.93, + alwaysvisible = false, + useairlos = false, + colormap = [[0.03 0.02 0.01 0.02 0.19 0.16 0.12 0.32 0.14 0.12 0.09 0.21 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[-0.02 r0.04, -0.01 r0.06, r-0.02 r0.04]], + numparticles = [[0.8 r0.65]], + particlelife = 14, + particlelifespread = 17, + particlesize = 15, + particlesizespread = 5.5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[-3 r6, -40 r10, -3 r6]], + rotParams = [[-20 r40, -20 r40, -180 r360]], + --sizegrowth = 0, + sizegrowth = [[r-0.14 r0.28]], + sizemod = 0.965, + texture = [[dirtpuff]], + --texture = [[smoke-anim]], + --animParams = [[8,6,30 r50]], + castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0.66 0.1 0.07 0.033 0.55 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 10, + emitvector = [[0, -0.15, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0.48 r0.65]], + particlelife = 13, + particlelifespread = 28, + particlesize = 7, + particlesizespread = 8, + particlespeed = 2.5, + particlespeedspread = 10, + pos = [[0, 6, 0]], + rotParams = [[-26 r52, -20 r40, -180 r360]], + sizegrowth = [[-0.10 r0.22]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + }, + ["dust_cloud_dirt"] = { + poof01 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + properties = { + airdrag = 0.93, + alwaysvisible = false, + useairlos = false, + --colormap = [[0.0 0.0 0.00 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], + colormap = [[0.03 0.02 0.01 0.01 0.15 0.13 0.09 0.4 0.13 0.12 0.09 0.24 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[-0.03 r0.06, 0.02 r0.05, -0.03 r0.06]], + numparticles = [[0.7 r0.5]], + particlelife = 18, + particlelifespread = 20, + particlesize = 17, + particlesizespread = 13, + particlespeed = 0, + particlespeedspread = 0, + pos = [[r-3 r3, 1, r-8 r3]], + rotParams = [[-26 r52, -20 r40, -180 r360]], + --sizegrowth = [[r0.24 r0.34]], + sizegrowth = 0, + sizemod = 0.99, + texture = [[dirtpuff]], + --castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0.66 0.1 0.07 0.033 0.55 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 10, + emitvector = [[0, -0.1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = [[0.5 r0.66]], + particlelife = 22, + particlelifespread = 40, + particlesize = 6.5, + particlesizespread = 8.5, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 6, 0]], + rotParams = [[-26 r52, -20 r40, -180 r360]], + sizegrowth = [[-0.10 r0.22]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + }, + ["dust_cloud_fast"] = { + poof01 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + properties = { + airdrag = 0.90, + alwaysvisible = false, + colormap = [[0.05 0.0 0.0 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[r-0.05 r0.05, 0 r0.09, r-0.05 r0.05]], + numparticles = 1, + particlelife = 10, + particlelifespread = 26, + particlesize = 6, + particlesizespread = 3, + particlespeed = 3, + particlespeedspread = 10, + pos = [[r-3 r3, 1, r-8 r3]], + rotParams = [[-3 r6, -4 r8, -180 r360]], + sizegrowth = [[r0.25 r0.40]], + sizemod = 1.0, + texture = [[smoke_puff]], + }, + }, + }, + ["dust_cloud_huge"] = { + poof01 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + properties = { + airdrag = 0.93, + alwaysvisible = false, + colormap = [[0.0 0.0 0.00 0.0 0.19 0.16 0.08 0.3 0 0 0 0.00]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[r-0.05 r0.05, 0 r0.05, r-0.05 r0.05]], + numparticles = 1, + particlelife = 20, + particlelifespread = 30, + particlesize = 32, + particlesizespread = 1.1, + particlespeed = 3, + particlespeedspread = 10, + pos = [[r-3 r3, 1, r-8 r3]], + rotParams = [[-2 r4, -3 r6, -180 r360]], + sizegrowth = [[r0.20 r0.30]], + sizemod = 1.1, + texture = [[smoke_puff]], + }, + }, + }, } diff --git a/effects/fire.lua b/effects/fire.lua index 6aeef4626f3..d51b41095e4 100644 --- a/effects/fire.lua +++ b/effects/fire.lua @@ -1,1574 +1,1563 @@ -- Effects for Fire / Flames / Napalm local definitions = { -["fire-incinerator"] = { - usedefaultexplosions = false, - burned_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 5, - sidetexture = [[none]], - size = [[21 r11]], - sizegrowth = 0.1, - ttl = 83, - pos = [[0, 4, 0]], - rotParams = [[0, 0, -180 r360]], - alwaysvisible = true, - drawOrder = -2, - --castShadow = true, - }, - }, - fireflamearea = { - air = true, - class = [[CExpGenSpawner]], - count = 1, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r50]], - explosiongenerator = [[custom:fire-flames-small]], - pos = [[-18 r36, 0 r10, -18 r36]], - --alwaysvisible = true, - }, - }, - fireflameground = { - air = true, - class = [[CExpGenSpawner]], - count = 1, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r50]], - explosiongenerator = [[custom:fire-burnground-small]], - pos = [[-15 r30, 0 r5, -15 r30]], - --alwaysvisible = true, - }, - }, - fireburngroundcircle = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[FireBall02-anim]], - animParams = [[8,8,80 r50]], - length = 0, - sidetexture = [[none]], - size = [[10 r5]], - sizegrowth = [[-0.5 r2.2]], - ttl = 135, - pos = [[0, 8, 0]], - rotParams = [[-2 r4, -2 r4, -180 r360]], - drawOrder = 0, - castShadow = true, - }, - }, - }, + ["fire-incinerator"] = { + usedefaultexplosions = false, + burned_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 5, + sidetexture = [[none]], + size = [[21 r11]], + sizegrowth = 0.1, + ttl = 83, + pos = [[0, 4, 0]], + rotParams = [[0, 0, -180 r360]], + alwaysvisible = true, + drawOrder = -2, + --castShadow = true, + }, + }, + fireflamearea = { + air = true, + class = [[CExpGenSpawner]], + count = 1, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r50]], + explosiongenerator = [[custom:fire-flames-small]], + pos = [[-18 r36, 0 r10, -18 r36]], + --alwaysvisible = true, + }, + }, + fireflameground = { + air = true, + class = [[CExpGenSpawner]], + count = 1, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r50]], + explosiongenerator = [[custom:fire-burnground-small]], + pos = [[-15 r30, 0 r5, -15 r30]], + --alwaysvisible = true, + }, + }, + fireburngroundcircle = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[FireBall02-anim]], + animParams = [[8,8,80 r50]], + length = 0, + sidetexture = [[none]], + size = [[10 r5]], + sizegrowth = [[-0.5 r2.2]], + ttl = 135, + pos = [[0, 8, 0]], + rotParams = [[-2 r4, -2 r4, -180 r360]], + drawOrder = 0, + castShadow = true, + }, + }, + }, -["fire-area-75"] = { - usedefaultexplosions = false, - burned_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.65 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.6 0.11 0.08 0.08 0.40 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.15 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[42 r22]], - sizegrowth = 0.1, - ttl = 330, - pos = [[0, 4, 0]], - rotParams = [[0, 0, -180 r360]], - alwaysvisible = true, - drawOrder = -2, - }, - }, - -- flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.3, 0.7, 0.3]], - -- gravity = [[0, 0.13, 0]], - -- numparticles = [[4 r4]], - -- particlelife = 24, - -- particlelifespread = 7, - -- particlesize = 1, - -- particlesizespread = 4, - -- particlespeed = 0.3, - -- particlespeedspread = 0.6, - -- rotParams = [[-24 r48, -60 r120, -180 r360]], - -- animParams = [[8,8,20 r50]], - -- pos = [[-2 r4, 35 r8, -2 r4]], - -- sizegrowth = [[1.5 r2]], - -- sizemod = 0.92, - -- texture = [[FireBall02-anim]], - -- drawOrder = 1, - -- }, - -- }, - fireflamearea = { - air = true, - class = [[CExpGenSpawner]], - count = 10, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i30]], - explosiongenerator = [[custom:fire-flames]], - pos = [[-18 r36, 0 r10, -18 r36]], - }, - }, - fireflameground = { - air = true, - class = [[CExpGenSpawner]], - count = 10, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r300]], - explosiongenerator = [[custom:fire-burnground]], - pos = [[-15 r30, 0 r5, -15 r30]], - --alwaysvisible = true, - }, - }, - fireburngroundcircle = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - --colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], - colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[BARFlame02]], - animParams = [[16,6,100 r50]], - length = 0, - sidetexture = [[none]], - size = [[70 r10]], - sizegrowth = [[0.1 r0.4]], - ttl = 270, - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -2 r4, -180 r360]], - drawOrder = -1, - castShadow = true, - }, - }, - }, + ["fire-area-75"] = { + usedefaultexplosions = false, + burned_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.65 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.6 0.11 0.08 0.08 0.40 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.15 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[42 r22]], + sizegrowth = 0.1, + ttl = 330, + pos = [[0, 4, 0]], + rotParams = [[0, 0, -180 r360]], + alwaysvisible = true, + drawOrder = -2, + }, + }, + -- flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.3, 0.7, 0.3]], + -- gravity = [[0, 0.13, 0]], + -- numparticles = [[4 r4]], + -- particlelife = 24, + -- particlelifespread = 7, + -- particlesize = 1, + -- particlesizespread = 4, + -- particlespeed = 0.3, + -- particlespeedspread = 0.6, + -- rotParams = [[-24 r48, -60 r120, -180 r360]], + -- animParams = [[8,8,20 r50]], + -- pos = [[-2 r4, 35 r8, -2 r4]], + -- sizegrowth = [[1.5 r2]], + -- sizemod = 0.92, + -- texture = [[FireBall02-anim]], + -- drawOrder = 1, + -- }, + -- }, + fireflamearea = { + air = true, + class = [[CExpGenSpawner]], + count = 10, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i30]], + explosiongenerator = [[custom:fire-flames]], + pos = [[-18 r36, 0 r10, -18 r36]], + }, + }, + fireflameground = { + air = true, + class = [[CExpGenSpawner]], + count = 10, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r300]], + explosiongenerator = [[custom:fire-burnground]], + pos = [[-15 r30, 0 r5, -15 r30]], + --alwaysvisible = true, + }, + }, + fireburngroundcircle = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + --colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], + colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[BARFlame02]], + animParams = [[16,6,100 r50]], + length = 0, + sidetexture = [[none]], + size = [[70 r10]], + sizegrowth = [[0.1 r0.4]], + ttl = 270, + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -2 r4, -180 r360]], + drawOrder = -1, + castShadow = true, + }, + }, + }, -["fire-area-60"] = { - usedefaultexplosions = false, - burned_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.65 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.6 0.11 0.08 0.08 0.40 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.15 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[42 r22]], - sizegrowth = 0.1, - ttl = 330, - pos = [[0, 4, 0]], - rotParams = [[0, 0, -180 r360]], - alwaysvisible = true, - drawOrder = -2, - }, - }, - -- flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.3, 0.7, 0.3]], - -- gravity = [[0, 0.13, 0]], - -- numparticles = [[4 r4]], - -- particlelife = 24, - -- particlelifespread = 7, - -- particlesize = 1, - -- particlesizespread = 4, - -- particlespeed = 0.3, - -- particlespeedspread = 0.6, - -- rotParams = [[-24 r48, -60 r120, -180 r360]], - -- animParams = [[8,8,20 r50]], - -- pos = [[-2 r4, 35 r8, -2 r4]], - -- sizegrowth = [[1.5 r2]], - -- sizemod = 0.92, - -- texture = [[FireBall02-anim]], - -- drawOrder = 1, - -- }, - -- }, - fireflamearea = { - air = true, - class = [[CExpGenSpawner]], - count = 10, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i30]], - explosiongenerator = [[custom:fire-flames]], - pos = [[-15 r30, 0 r10, -15 r30]], - }, - }, - fireflameground = { - air = true, - class = [[CExpGenSpawner]], - count = 10, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r300]], - explosiongenerator = [[custom:fire-burnground]], - pos = [[-12 r24, 0 r5, -12 r24]], - --alwaysvisible = true, - }, - }, - fireburngroundcircle = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - --colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], - colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[BARFlame02]], - animParams = [[16,6,100 r50]], - length = 0, - sidetexture = [[none]], - size = [[55 r10]], - sizegrowth = [[0.1 r0.4]], - ttl = 270, - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -2 r4, -180 r360]], - drawOrder = -1, - castShadow = true, - }, - }, - }, + ["fire-area-60"] = { + usedefaultexplosions = false, + burned_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.65 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.7 0.12 0.1 0.1 0.6 0.11 0.08 0.08 0.40 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.15 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[42 r22]], + sizegrowth = 0.1, + ttl = 330, + pos = [[0, 4, 0]], + rotParams = [[0, 0, -180 r360]], + alwaysvisible = true, + drawOrder = -2, + }, + }, + -- flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.3, 0.7, 0.3]], + -- gravity = [[0, 0.13, 0]], + -- numparticles = [[4 r4]], + -- particlelife = 24, + -- particlelifespread = 7, + -- particlesize = 1, + -- particlesizespread = 4, + -- particlespeed = 0.3, + -- particlespeedspread = 0.6, + -- rotParams = [[-24 r48, -60 r120, -180 r360]], + -- animParams = [[8,8,20 r50]], + -- pos = [[-2 r4, 35 r8, -2 r4]], + -- sizegrowth = [[1.5 r2]], + -- sizemod = 0.92, + -- texture = [[FireBall02-anim]], + -- drawOrder = 1, + -- }, + -- }, + fireflamearea = { + air = true, + class = [[CExpGenSpawner]], + count = 10, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i30]], + explosiongenerator = [[custom:fire-flames]], + pos = [[-15 r30, 0 r10, -15 r30]], + }, + }, + fireflameground = { + air = true, + class = [[CExpGenSpawner]], + count = 10, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r300]], + explosiongenerator = [[custom:fire-burnground]], + pos = [[-12 r24, 0 r5, -12 r24]], + --alwaysvisible = true, + }, + }, + fireburngroundcircle = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + --colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], + colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[BARFlame02]], + animParams = [[16,6,100 r50]], + length = 0, + sidetexture = [[none]], + size = [[55 r10]], + sizegrowth = [[0.1 r0.4]], + ttl = 270, + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -2 r4, -180 r360]], + drawOrder = -1, + castShadow = true, + }, + }, + }, + ["fire-flames"] = { + usedefaultexplosions = false, + flame1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 30, + emitvector = [[0.2, -0.4, 0.2]], + gravity = [[0, 0.03 r0.04, 0]], + numparticles = [[0.50 r0.70]], + particlelife = 80, + particlelifespread = 75, + particlesize = 35, + particlesizespread = 57, + particlespeed = 1, + particlespeedspread = 1.3, + animParams = [[8,8,90 r50]], + rotParams = [[-3 r6, -3 r6, -180 r360]], + pos = [[-4 r8, -5 r15, -4 r8]], + sizegrowth = [[1.6 r0.6]], + sizemod = 0.98, + texture = [[FireBall02-anim]], + drawOrder = 1, + --castShadow = true, + }, + }, + blacksmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + --colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.13 0.12 0.10 0.75 0.11 0.10 0.09 0.85 0.09 0.08 0.08 0.7 0.075 0.07 0.07 0.6 0.05 0.05 0.05 0.4 0.01 0.01 0.01 0.01]], + colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.11 0.10 0.09 0.85 0.075 0.07 0.07 0.6 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 70, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], + numparticles = [[0.55 r0.55]], + particlelife = 110, + particlelifespread = 60, + particlesize = 45, + particlesizespread = 60, + particlespeed = 3, + particlespeedspread = 2, + rotParams = [[-15 r30, -2 r4, -180 r360]], + pos = [[0.0, 30, 0.0]], + sizegrowth = [[0.55 r0.55]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,150 r80]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + drawOrder = 1, + castShadow = true, + }, + }, + }, - ["fire-flames"] = { - usedefaultexplosions = false, - flame1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 30, - emitvector = [[0.2, -0.4, 0.2]], - gravity = [[0, 0.03 r0.04, 0]], - numparticles = [[0.50 r0.70]], - particlelife = 80, - particlelifespread = 75, - particlesize = 35, - particlesizespread = 57, - particlespeed = 1, - particlespeedspread = 1.3, - animParams = [[8,8,90 r50]], - rotParams = [[-3 r6, -3 r6, -180 r360]], - pos = [[-4 r8, -5 r15, -4 r8]], - sizegrowth = [[1.6 r0.6]], - sizemod = 0.98, - texture = [[FireBall02-anim]], - drawOrder = 1, - --castShadow = true, - }, - }, - blacksmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.70, - --colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.13 0.12 0.10 0.75 0.11 0.10 0.09 0.85 0.09 0.08 0.08 0.7 0.075 0.07 0.07 0.6 0.05 0.05 0.05 0.4 0.01 0.01 0.01 0.01]], - colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.11 0.10 0.09 0.85 0.075 0.07 0.07 0.6 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 70, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], - numparticles = [[0.55 r0.55]], - particlelife = 110, - particlelifespread = 60, - particlesize = 45, - particlesizespread = 60, - particlespeed = 3, - particlespeedspread = 2, - rotParams = [[-15 r30, -2 r4, -180 r360]], - pos = [[0.0, 30, 0.0]], - sizegrowth = [[0.55 r0.55]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,150 r80]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - drawOrder = 1, - castShadow = true, - }, - }, - }, - ["fire-flames-small"] = { - usedefaultexplosions = false, - flame1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 30, - emitvector = [[0.2, -0.4, 0.2]], - gravity = [[0, 0.01 r0.04, 0]], - numparticles = [[0.50 r0.65]], - particlelife = 30, - particlelifespread = 27, - particlesize = 11, - particlesizespread = 35, - particlespeed = 1, - particlespeedspread = 1.3, - animParams = [[8,8,120 r50]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - pos = [[-3 r8, 0 r15, -3 r8]], - sizegrowth = [[1.2 r0.45]], - sizemod = 0.98, - texture = [[FireBall02-anim]], - drawOrder = 0, - --castShadow = true, - }, - }, - }, + usedefaultexplosions = false, + flame1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 30, + emitvector = [[0.2, -0.4, 0.2]], + gravity = [[0, 0.01 r0.04, 0]], + numparticles = [[0.50 r0.65]], + particlelife = 30, + particlelifespread = 27, + particlesize = 11, + particlesizespread = 35, + particlespeed = 1, + particlespeedspread = 1.3, + animParams = [[8,8,120 r50]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + pos = [[-3 r8, 0 r15, -3 r8]], + sizegrowth = [[1.2 r0.45]], + sizemod = 0.98, + texture = [[FireBall02-anim]], + drawOrder = 0, + --castShadow = true, + }, + }, + }, - ["fire-burnground-small"] = { - usedefaultexplosions = false, - -- flame = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- ground = true, - -- properties = { - -- airdrag = 0.98, - -- colormap = [[0.14 0.14 0.10 0.3 0.81 0.89 1 1 0.75 0.76 0.89 0.75 0.72 0.75 1 1 0.026 0.026 0.026 0.58 0.022 0.022 0.022 0.35 0.02 0.02 0.02 0.25 0.023 0.023 0.023 0.15 0 0 0 0.03 0 0 0 0.01]], - -- directional = true, - -- emitrot = 65, - -- emitrotspread = 65, - -- emitvector = [[0.28, 1, 0.28]], - -- gravity = [[-0.02 r0.05, 0.01 r0.07, -0.02 r0.05]], - -- numparticles = [[0.70 r0.65]], - -- particlelife = 80, - -- particlelifespread = 65, - -- particlesize = 14, - -- particlesizespread = 48, - -- particlespeed = 0.45, - -- particlespeedspread = 0.4, - -- rotParams = [[-5 r10, 0, -180 r360]], - -- animParams = [[8,8,80 r50]], - -- pos = [[-3 r6, -5 r6, -3 r6]], - -- sizegrowth = [[1.22 r0.8]], - -- sizemod = 0.98, - -- texture = [[FireBall02-anim]], - -- drawOrder = 1, - -- }, - -- }, - flamematt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.96, - colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0.85 0.52 0.28 1 0.80 0.47 0.24 0.98 0.75 0.41 0.20 0.97 0.72 0.38 0.18 0.96 0.6 0.30 0.12 0.9 0.18 0.10 0.05 0.55 0.023 0.022 0.022 0.2 0 0 0 0.01]], + ["fire-burnground-small"] = { + usedefaultexplosions = false, + -- flame = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- ground = true, + -- properties = { + -- airdrag = 0.98, + -- colormap = [[0.14 0.14 0.10 0.3 0.81 0.89 1 1 0.75 0.76 0.89 0.75 0.72 0.75 1 1 0.026 0.026 0.026 0.58 0.022 0.022 0.022 0.35 0.02 0.02 0.02 0.25 0.023 0.023 0.023 0.15 0 0 0 0.03 0 0 0 0.01]], + -- directional = true, + -- emitrot = 65, + -- emitrotspread = 65, + -- emitvector = [[0.28, 1, 0.28]], + -- gravity = [[-0.02 r0.05, 0.01 r0.07, -0.02 r0.05]], + -- numparticles = [[0.70 r0.65]], + -- particlelife = 80, + -- particlelifespread = 65, + -- particlesize = 14, + -- particlesizespread = 48, + -- particlespeed = 0.45, + -- particlespeedspread = 0.4, + -- rotParams = [[-5 r10, 0, -180 r360]], + -- animParams = [[8,8,80 r50]], + -- pos = [[-3 r6, -5 r6, -3 r6]], + -- sizegrowth = [[1.22 r0.8]], + -- sizemod = 0.98, + -- texture = [[FireBall02-anim]], + -- drawOrder = 1, + -- }, + -- }, + flamematt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.96, + colormap = [[0.4 0.25 0.1 0.75 1 0.66 0.45 0.95 0.9 0.8 0.66 1 0.85 0.52 0.28 1 0.80 0.47 0.24 0.98 0.75 0.41 0.20 0.97 0.72 0.38 0.18 0.96 0.6 0.30 0.12 0.9 0.18 0.10 0.05 0.55 0.023 0.022 0.022 0.2 0 0 0 0.01]], - directional = false, - emitrot = 65, - emitrotspread = 65, - emitvector = [[0.28, 1, 0.28]], - gravity = [[-0.03 r0.05, 0.03 r0.08, -0.03 r0.05]], - numparticles = [[0.68 r0.65]], - particlelife = 40, - particlelifespread = 30, - particlesize = 20, - particlesizespread = 50, - particlespeed = 0.20, - particlespeedspread = 0.20, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[16,6,80 r55]], - pos = [[-3 r6, -8 r6, -3 r6]], - sizegrowth = [[0.8 r0.5]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 1, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], - directional = true, - emitrot = 35, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], - numparticles = [[0.65 r0.75]], - particlelife = 6, - particlelifespread = 6, - particlesize = -12, - particlesizespread = -3, - particlespeed = 4, - particlespeedspread = 3, - pos = [[-7 r14, 17 r15, -7 r14]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + directional = false, + emitrot = 65, + emitrotspread = 65, + emitvector = [[0.28, 1, 0.28]], + gravity = [[-0.03 r0.05, 0.03 r0.08, -0.03 r0.05]], + numparticles = [[0.68 r0.65]], + particlelife = 40, + particlelifespread = 30, + particlesize = 20, + particlesizespread = 50, + particlespeed = 0.20, + particlespeedspread = 0.20, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[16,6,80 r55]], + pos = [[-3 r6, -8 r6, -3 r6]], + sizegrowth = [[0.8 r0.5]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 1, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], + directional = true, + emitrot = 35, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], + numparticles = [[0.65 r0.75]], + particlelife = 6, + particlelifespread = 6, + particlesize = -12, + particlesizespread = -3, + particlespeed = 4, + particlespeedspread = 3, + pos = [[-7 r14, 17 r15, -7 r14]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - ["fire-burnground"] = { - usedefaultexplosions = false, - -- flame = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- ground = true, - -- properties = { - -- airdrag = 0.98, - -- colormap = [[0.14 0.14 0.10 0.3 0.81 0.89 1 1 0.75 0.76 0.89 0.75 0.72 0.75 1 1 0.026 0.026 0.026 0.58 0.022 0.022 0.022 0.35 0.02 0.02 0.02 0.25 0.023 0.023 0.023 0.15 0 0 0 0.03 0 0 0 0.01]], - -- directional = true, - -- emitrot = 65, - -- emitrotspread = 65, - -- emitvector = [[0.28, 1, 0.28]], - -- gravity = [[-0.02 r0.05, 0.01 r0.07, -0.02 r0.05]], - -- numparticles = [[0.70 r0.65]], - -- particlelife = 80, - -- particlelifespread = 65, - -- particlesize = 14, - -- particlesizespread = 48, - -- particlespeed = 0.45, - -- particlespeedspread = 0.4, - -- rotParams = [[-5 r10, 0, -180 r360]], - -- animParams = [[8,8,80 r50]], - -- pos = [[-3 r6, -5 r6, -3 r6]], - -- sizegrowth = [[1.22 r0.8]], - -- sizemod = 0.98, - -- texture = [[FireBall02-anim]], - -- drawOrder = 1, - -- }, - -- }, - flamematt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.25 0.22 0.18 0.75 0.75 0.77 0.71 1 0.72 0.51 0.39 1 0.67 0.47 0.34 0.99 0.63 0.41 0.27 0.98 0.58 0.37 0.29 0.97 0.48 0.31 0.22 0.91 0.11 0.11 0.12 0.50 0.016 0.011 0.07 0.45 0 0 0 0.01]], + ["fire-burnground"] = { + usedefaultexplosions = false, + -- flame = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- ground = true, + -- properties = { + -- airdrag = 0.98, + -- colormap = [[0.14 0.14 0.10 0.3 0.81 0.89 1 1 0.75 0.76 0.89 0.75 0.72 0.75 1 1 0.026 0.026 0.026 0.58 0.022 0.022 0.022 0.35 0.02 0.02 0.02 0.25 0.023 0.023 0.023 0.15 0 0 0 0.03 0 0 0 0.01]], + -- directional = true, + -- emitrot = 65, + -- emitrotspread = 65, + -- emitvector = [[0.28, 1, 0.28]], + -- gravity = [[-0.02 r0.05, 0.01 r0.07, -0.02 r0.05]], + -- numparticles = [[0.70 r0.65]], + -- particlelife = 80, + -- particlelifespread = 65, + -- particlesize = 14, + -- particlesizespread = 48, + -- particlespeed = 0.45, + -- particlespeedspread = 0.4, + -- rotParams = [[-5 r10, 0, -180 r360]], + -- animParams = [[8,8,80 r50]], + -- pos = [[-3 r6, -5 r6, -3 r6]], + -- sizegrowth = [[1.22 r0.8]], + -- sizemod = 0.98, + -- texture = [[FireBall02-anim]], + -- drawOrder = 1, + -- }, + -- }, + flamematt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.25 0.22 0.18 0.75 0.75 0.77 0.71 1 0.72 0.51 0.39 1 0.67 0.47 0.34 0.99 0.63 0.41 0.27 0.98 0.58 0.37 0.29 0.97 0.48 0.31 0.22 0.91 0.11 0.11 0.12 0.50 0.016 0.011 0.07 0.45 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.32, 0.7, 0.32]], - gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], - numparticles = [[0.67 r0.69]], - particlelife = 50, - particlelifespread = 60, - particlesize = 46, - particlesizespread = 130, - particlespeed = 3.20, - particlespeedspread = 5.20, - rotParams = [[-5 r10, -20 r40, -180 r360]], - animParams = [[16,6,88 r55]], - pos = [[-3 r6, -25 r12, -3 r6]], - sizegrowth = [[1.10 r1.05]], - sizemod = 0.98, - texture = [[BARFlame02]], - drawOrder = 2, - castShadow = true, - }, - }, - flamedark = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.26 0.29 0.21 0.1 0.36 0.27 0.29 0.90 0.34 0.43 0.40 0.88 0.33 0.29 0.20 0.85 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.32, 0.7, 0.32]], + gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], + numparticles = [[0.67 r0.69]], + particlelife = 50, + particlelifespread = 60, + particlesize = 46, + particlesizespread = 130, + particlespeed = 3.20, + particlespeedspread = 5.20, + rotParams = [[-5 r10, -20 r40, -180 r360]], + animParams = [[16,6,88 r55]], + pos = [[-3 r6, -25 r12, -3 r6]], + sizegrowth = [[1.10 r1.05]], + sizemod = 0.98, + texture = [[BARFlame02]], + drawOrder = 2, + castShadow = true, + }, + }, + flamedark = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.26 0.29 0.21 0.1 0.36 0.27 0.29 0.90 0.34 0.43 0.40 0.88 0.33 0.29 0.20 0.85 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0 0 0 0.01]], - directional = false, - emitrot = 85, - emitrotspread = 25, - emitvector = [[0.28, 0.9, 0.28]], - gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], - numparticles = [[0.32 r0.68]], - particlelife = 25, - particlelifespread = 35, - particlesize = 72, - particlesizespread = 100, - particlespeed = 0.10, - particlespeedspread = 0.16, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[16,6,80 r55]], - pos = [[0, 60 r25, 0]], - sizegrowth = [[1.3 r1.1]], - sizemod = 0.99, - texture = [[BARFlame02]], - drawOrder = 3, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], - directional = true, - emitrot = 35, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], - numparticles = [[0.50 r0.65]], - particlelife = 11, - particlelifespread = 11, - particlesize = -24, - particlesizespread = -8, - particlespeed = 9, - particlespeedspread = 4, - pos = [[-7 r14, 17 r15, -7 r14]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + directional = false, + emitrot = 85, + emitrotspread = 25, + emitvector = [[0.28, 0.9, 0.28]], + gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], + numparticles = [[0.32 r0.68]], + particlelife = 25, + particlelifespread = 35, + particlesize = 72, + particlesizespread = 100, + particlespeed = 0.10, + particlespeedspread = 0.16, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[16,6,80 r55]], + pos = [[0, 60 r25, 0]], + sizegrowth = [[1.3 r1.1]], + sizemod = 0.99, + texture = [[BARFlame02]], + drawOrder = 3, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], + directional = true, + emitrot = 35, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], + numparticles = [[0.50 r0.65]], + particlelife = 11, + particlelifespread = 11, + particlesize = -24, + particlesizespread = -8, + particlespeed = 9, + particlespeedspread = 4, + pos = [[-7 r14, 17 r15, -7 r14]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - --["fire-flames-backup"] = { - -- usedefaultexplosions = false, - -- extrafires = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0 0 0 0.01 0.33 0.18 0.45 0.18 0.55 0.52 0.42 0.35 0.35 0.35 0.28 0.25 0.5 0.5 0.42 0.32 0.32 0.28 0.18 0.12 0.01 0 0 0.01]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 1, - -- emitvector = [[dir]], - -- gravity = [[0, 0.06, 0]], - -- numparticles = [[0.23 r0.81]], - -- particlelife = 9, - -- particlelifespread = 18, - -- particlesize = 11, - -- particlesizespread = 15, - -- particlespeed = 0, - -- particlespeedspread = 0, - -- rotParams = [[-90 r180, -50 r100, -180 r360]], - -- pos = [[-3 r6, 20, -3 r6]], - -- sizegrowth = [[1.3 r0.35]], - -- sizemod = 0.99, - -- texture = [[fire]], - -- drawOrder = 0, - -- }, - -- }, - -- flame1 = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.99, - -- colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.2, -0.4, 0.2]], - -- gravity = [[0, 0.23 r0.09, 0]], - -- numparticles = [[0.45 r0.62]], - -- particlelife = 14, - -- particlelifespread = 18, - -- particlesize = 4.9, - -- particlesizespread = 22, - -- particlespeed = -2, - -- particlespeedspread = 0.9, - -- rotParams = [[-120 r240, -80 r160, -180 r360]], - -- pos = [[-3 r8, 25 r10, -3 r8]], - -- sizegrowth = [[1.6 r0.6]], - -- sizemod = 0.98, - -- texture = [[flame_alt2]], - -- drawOrder = 2, - -- }, - -- }, + --["fire-flames-backup"] = { + -- usedefaultexplosions = false, + -- extrafires = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0 0 0 0.01 0.33 0.18 0.45 0.18 0.55 0.52 0.42 0.35 0.35 0.35 0.28 0.25 0.5 0.5 0.42 0.32 0.32 0.28 0.18 0.12 0.01 0 0 0.01]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 1, + -- emitvector = [[dir]], + -- gravity = [[0, 0.06, 0]], + -- numparticles = [[0.23 r0.81]], + -- particlelife = 9, + -- particlelifespread = 18, + -- particlesize = 11, + -- particlesizespread = 15, + -- particlespeed = 0, + -- particlespeedspread = 0, + -- rotParams = [[-90 r180, -50 r100, -180 r360]], + -- pos = [[-3 r6, 20, -3 r6]], + -- sizegrowth = [[1.3 r0.35]], + -- sizemod = 0.99, + -- texture = [[fire]], + -- drawOrder = 0, + -- }, + -- }, + -- flame1 = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.99, + -- colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.2, -0.4, 0.2]], + -- gravity = [[0, 0.23 r0.09, 0]], + -- numparticles = [[0.45 r0.62]], + -- particlelife = 14, + -- particlelifespread = 18, + -- particlesize = 4.9, + -- particlesizespread = 22, + -- particlespeed = -2, + -- particlespeedspread = 0.9, + -- rotParams = [[-120 r240, -80 r160, -180 r360]], + -- pos = [[-3 r8, 25 r10, -3 r8]], + -- sizegrowth = [[1.6 r0.6]], + -- sizemod = 0.98, + -- texture = [[flame_alt2]], + -- drawOrder = 2, + -- }, + -- }, - -- flame2 = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.99, - -- colormap = [[0 0 0 0.01 0.95 0.95 1 0.25 0.65 0.65 0.68 0.15 0.1 0.1 0.1 0.16 0.08 0.07 0.06 0.11 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.2, -0.4, 0.2]], - -- gravity = [[0, 0.23 r0.09, 0]], - -- numparticles = [[0.45 r0.62]], - -- particlelife = 14, - -- particlelifespread = 18, - -- particlesize = 4.9, - -- particlesizespread = 22, - -- particlespeed = -2, - -- particlespeedspread = 0.9, - -- rotParams = [[-180 r360, -80 r160, -180 r360]], - -- pos = [[-3 r8, 25 r10, -3 r8]], - -- sizegrowth = [[1.6 r0.6]], - -- sizemod = 0.98, - -- texture = [[fire]], - -- drawOrder = 1, - -- }, - -- }, - -- }, + -- flame2 = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.99, + -- colormap = [[0 0 0 0.01 0.95 0.95 1 0.25 0.65 0.65 0.68 0.15 0.1 0.1 0.1 0.16 0.08 0.07 0.06 0.11 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.2, -0.4, 0.2]], + -- gravity = [[0, 0.23 r0.09, 0]], + -- numparticles = [[0.45 r0.62]], + -- particlelife = 14, + -- particlelifespread = 18, + -- particlesize = 4.9, + -- particlesizespread = 22, + -- particlespeed = -2, + -- particlespeedspread = 0.9, + -- rotParams = [[-180 r360, -80 r160, -180 r360]], + -- pos = [[-3 r8, 25 r10, -3 r8]], + -- sizegrowth = [[1.6 r0.6]], + -- sizemod = 0.98, + -- texture = [[fire]], + -- drawOrder = 1, + -- }, + -- }, + -- }, - --not finalized - ["fire-area-150"] = { - usedefaultexplosions = false, - burned_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[84 r44]], - sizegrowth = 0.1, - ttl = 330, - pos = [[0, 4, 0]], - rotParams = [[0, 0, -180 r360]], - alwaysvisible = true, - drawOrder = -2, - }, - }, - -- flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.3, 0.7, 0.3]], - -- gravity = [[0, 0.13, 0]], - -- numparticles = [[4 r4]], - -- particlelife = 24, - -- particlelifespread = 7, - -- particlesize = 1, - -- particlesizespread = 4, - -- particlespeed = 0.3, - -- particlespeedspread = 0.6, - -- rotParams = [[-24 r48, -60 r120, -180 r360]], - -- animParams = [[8,8,20 r50]], - -- pos = [[-2 r4, 35 r8, -2 r4]], - -- sizegrowth = [[1.5 r2]], - -- sizemod = 0.92, - -- texture = [[FireBall02-anim]], - -- drawOrder = 1, - -- }, - -- }, - fireflamearea = { - air = true, - class = [[CExpGenSpawner]], - count = 25, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i12]], - explosiongenerator = [[custom:fire-flames]], - pos = [[-66 r132, 0 r10, -66 r132]], - }, - }, - fireflameground = { - air = true, - class = [[CExpGenSpawner]], - count = 24, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:fire-burnground]], - pos = [[-60 r120, 0 r5, -60 r120]], - }, - }, - fireburngroundcircle = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[FireBall02-anim]], - animParams = [[8,8,80 r50]], - length = 0, - sidetexture = [[none]], - size = [[68 r36]], - sizegrowth = [[-0.5 r2.2]], - ttl = 270, - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -2 r4, -180 r360]], - drawOrder = -1, - }, - }, - }, + --not finalized + ["fire-area-150"] = { + usedefaultexplosions = false, + burned_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[84 r44]], + sizegrowth = 0.1, + ttl = 330, + pos = [[0, 4, 0]], + rotParams = [[0, 0, -180 r360]], + alwaysvisible = true, + drawOrder = -2, + }, + }, + -- flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0.7 0.7 0.7 0.9 1.99 0.99 1 0.8 0.8 0.8 0.68 0.5 0.16 0.11 0.1 0.4 0.09 0.10 0.11 0.3 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.3, 0.7, 0.3]], + -- gravity = [[0, 0.13, 0]], + -- numparticles = [[4 r4]], + -- particlelife = 24, + -- particlelifespread = 7, + -- particlesize = 1, + -- particlesizespread = 4, + -- particlespeed = 0.3, + -- particlespeedspread = 0.6, + -- rotParams = [[-24 r48, -60 r120, -180 r360]], + -- animParams = [[8,8,20 r50]], + -- pos = [[-2 r4, 35 r8, -2 r4]], + -- sizegrowth = [[1.5 r2]], + -- sizemod = 0.92, + -- texture = [[FireBall02-anim]], + -- drawOrder = 1, + -- }, + -- }, + fireflamearea = { + air = true, + class = [[CExpGenSpawner]], + count = 25, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i12]], + explosiongenerator = [[custom:fire-flames]], + pos = [[-66 r132, 0 r10, -66 r132]], + }, + }, + fireflameground = { + air = true, + class = [[CExpGenSpawner]], + count = 24, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:fire-burnground]], + pos = [[-60 r120, 0 r5, -60 r120]], + }, + }, + fireburngroundcircle = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + --colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[FireBall02-anim]], + animParams = [[8,8,80 r50]], + length = 0, + sidetexture = [[none]], + size = [[68 r36]], + sizegrowth = [[-0.5 r2.2]], + ttl = 270, + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -2 r4, -180 r360]], + drawOrder = -1, + }, + }, + }, - -- CEGs for revision of unit_area_timed_damage ------------------------------- + -- CEGs for revision of unit_area_timed_damage ------------------------------- - -- Effects trigger on a fixed interval after the first impact, so the inital - -- explosion has to add fire fx to look different from a normal arty explo. - ["fire-explosion-small"] = { - usedefaultexplosions = false, - flame = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - unit = true, - properties = { - airdrag = 0.93, - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.65 0.65 0.2 0.25 0.022 0.022 0.022 0.3 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.03 r0.03, -0.09 r0.18]], - numparticles = [[1.2 r1]], - particlelife = 90, - particlelifespread = 12, - particlesize = 64, - particlesizespread = 32, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-10 r20, -5 r20, -10 r20]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2.5 r1.5]], - sizemod = 0.96, - animParams = [[16,6,80 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], - size = 25, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], - size = 50, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - centerflare = { - class = [[CHeatCloudProjectile]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.0, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - explosion = { - class = [[CSimpleParticleSystem]], - count = 2, - air = true, - ground = true, - underwater = false, - water = true, - unit = true, - properties = { - airdrag = 0.83, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = true, - emitrot = 40, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 6, - particlesize = 1.1, - particlesizespread = 4.5, - particlespeed = 1.1, - particlespeedspread = 2.5, - pos = [[0, 8, 0]], - sizegrowth = [[0.8 r0.8]], - sizemod = 1.0, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - explosionfire = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - unit = true, - feature = true, - properties = { - airdrag = 0.73, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 1, - particlelife = 34, - particlelifespread = 34, - particlesize = 32, - particlesizespread = 18, - particlespeed = 1.0, - particlespeedspread = 1.5, - pos = [[0, 8, 0]], - sizegrowth = [[0.8 r0.8]], - sizemod = 1.0, - texture = [[BARFlame02]], - animParams = [[16,6,80 r60]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - dustparticles = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 2, - particlesize = 2.5, - particlesizespread = 0.66, - particlespeed = 0.55, - particlespeedspread = 0.2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = false, - properties = { - airdrag = 0.8, - colormap = - [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - emitrot = 25, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.018, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 22, - particlesize = 6, - particlesizespread = 5.5, - particlespeed = 0.8, - particlespeedspread = 3.2, - pos = [[r-1 r1, 0, r-1 r1]], - sizegrowth = 0.6, - sizemod = 0.99, - texture = [[dirtpuff]], - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = false, - properties = { - airdrag = 0.4, - alwaysvisible = 0, - colormap = - [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - directional = 0, - emitrot = 33, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 25, - particlesize = 8.5, - particlesizespread = 3.5, - particlespeed = 1, - particlespeedspread = 3.3, - pos = [[r-1 r1, 0, r-1 r1]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[fogdirty]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = true, - underwater = false, - water = false, - unit = false, - nounit = true, - properties = { - airdrag = 0.98, - colormap = - [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 22, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 4, - particlesize = 1.2, - particlesizespread = -1, - particlespeed = 2.2, - particlespeedspread = 3.9, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - underwater = false, - water = false, - unit = false, - nounit = true, - properties = { - airdrag = 1, - colormap = - [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 4, - particlesize = 1.23, - particlesizespread = -1, - particlespeed = 1.66, - particlespeedspread = 2.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - properties = { - airdrag = 0.91, - colormap = - [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 44, - particlesize = 8, - particlesizespread = 8, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - underwater = false, - unit = true, - nounit = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.1, - particlesizespread = 1.8, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - underwater = false, - unit = true, - nounit = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.6, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - underwater = false, - unit = true, - nounit = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 2, - particlespeed = 1.35, - particlespeedspread = 1.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 60, - emitrotspread = 55, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 6, - particlelifespread = 8, - particlesize = 17, - particlesizespread = 14, - particlespeed = 1.75, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 0.88, - sizemod = 0.85, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - watersparks = { - class = [[CSimpleParticleSystem]], - count = 1, - air = false, - ground = false, - underwater = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 16, - particlelifespread = 26, - particlesize = 6.5, - particlesizespread = 20, - particlespeed = 1.8, - particlespeedspread = 4, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - outerflash = { - class = [[CHeatCloudProjectile]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 6, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, + -- Effects trigger on a fixed interval after the first impact, so the inital + -- explosion has to add fire fx to look different from a normal arty explo. + ["fire-explosion-small"] = { + usedefaultexplosions = false, + flame = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + unit = true, + properties = { + airdrag = 0.93, + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.65 0.65 0.2 0.25 0.022 0.022 0.022 0.3 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.03 r0.03, -0.09 r0.18]], + numparticles = [[1.2 r1]], + particlelife = 90, + particlelifespread = 12, + particlesize = 64, + particlesizespread = 32, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-10 r20, -5 r20, -10 r20]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2.5 r1.5]], + sizemod = 0.96, + animParams = [[16,6,80 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], + size = 25, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], + size = 50, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + centerflare = { + class = [[CHeatCloudProjectile]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.0, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + explosion = { + class = [[CSimpleParticleSystem]], + count = 2, + air = true, + ground = true, + underwater = false, + water = true, + unit = true, + properties = { + airdrag = 0.83, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = true, + emitrot = 40, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 6, + particlesize = 1.1, + particlesizespread = 4.5, + particlespeed = 1.1, + particlespeedspread = 2.5, + pos = [[0, 8, 0]], + sizegrowth = [[0.8 r0.8]], + sizemod = 1.0, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + explosionfire = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + unit = true, + feature = true, + properties = { + airdrag = 0.73, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 1, + particlelife = 34, + particlelifespread = 34, + particlesize = 32, + particlesizespread = 18, + particlespeed = 1.0, + particlespeedspread = 1.5, + pos = [[0, 8, 0]], + sizegrowth = [[0.8 r0.8]], + sizemod = 1.0, + texture = [[BARFlame02]], + animParams = [[16,6,80 r60]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + dustparticles = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 2, + particlesize = 2.5, + particlesizespread = 0.66, + particlespeed = 0.55, + particlespeedspread = 0.2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = false, + properties = { + airdrag = 0.8, + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + emitrot = 25, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.018, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 22, + particlesize = 6, + particlesizespread = 5.5, + particlespeed = 0.8, + particlespeedspread = 3.2, + pos = [[r-1 r1, 0, r-1 r1]], + sizegrowth = 0.6, + sizemod = 0.99, + texture = [[dirtpuff]], + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = false, + properties = { + airdrag = 0.4, + alwaysvisible = 0, + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + directional = 0, + emitrot = 33, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 25, + particlesize = 8.5, + particlesizespread = 3.5, + particlespeed = 1, + particlespeedspread = 3.3, + pos = [[r-1 r1, 0, r-1 r1]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[fogdirty]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = true, + underwater = false, + water = false, + unit = false, + nounit = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 22, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 4, + particlesize = 1.2, + particlesizespread = -1, + particlespeed = 2.2, + particlespeedspread = 3.9, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + underwater = false, + water = false, + unit = false, + nounit = true, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 4, + particlesize = 1.23, + particlesizespread = -1, + particlespeed = 1.66, + particlespeedspread = 2.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 44, + particlesize = 8, + particlesizespread = 8, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = false, + unit = true, + nounit = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.1, + particlesizespread = 1.8, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = false, + unit = true, + nounit = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.6, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = false, + unit = true, + nounit = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 2, + particlespeed = 1.35, + particlespeedspread = 1.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 60, + emitrotspread = 55, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 6, + particlelifespread = 8, + particlesize = 17, + particlesizespread = 14, + particlespeed = 1.75, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 0.88, + sizemod = 0.85, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + watersparks = { + class = [[CSimpleParticleSystem]], + count = 1, + air = false, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 16, + particlelifespread = 26, + particlesize = 6.5, + particlesizespread = 20, + particlespeed = 1.8, + particlespeedspread = 4, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + outerflash = { + class = [[CHeatCloudProjectile]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 6, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, - ["fire-flames-repeat"] = { - usedefaultexplosions = false, - flame1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = - [[0 0 0 0.01 0.9 0.87 0.87 0.4 0.65 0.65 0.4 0.2 0.65 0.65 0.4 0.2 0.13 0.13 0.02 0.12 0.08 0.08 0.02 0.07 0.025 0.02 0.01 0.02 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 30, - emitvector = [[-0.4 r0.2, -0.4, -0.4 r0.2]], - gravity = [[0, 0.03 r0.04, 0]], - numparticles = [[0.18 r1]], - particlelife = 54, - particlelifespread = 110, - particlesize = 32, - particlesizespread = 64, - particlespeed = 1, - particlespeedspread = 1.3, - animParams = [[8,8,90 r50]], - rotParams = [[-3 r6, -3 r6, -180 r360]], - pos = [[-4 r8, -5 r35, -4 r8]], - sizegrowth = [[1.6 r0.6]], - sizemod = 0.98, - texture = [[FireBall02-anim]], - castShadow = false, - drawOrder = 0, - }, - }, - blacksmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.8, - colormap = - [[0.01 0.01 0.01 0.01 0.03 0.03 0.01 0.2 0.01 0.01 0.01 0.32 0.1 0.1 0.1 0.64 0.04 0.04 0.04 0.32 0.02 0.02 0.02 0.17 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 70, - emitvector = [[r0.2 -0.4, 1, r0.2 -0.4]], - gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], - numparticles = [[0.08 r1]], - particlelife = 180, - particlelifespread = 60, - particlesize = 54, - particlesizespread = 84, - particlespeed = 3, - particlespeedspread = 2, - rotParams = [[-10 r20, -1 r2, -180 r360]], - pos = [[0.0, 0, 0.0]], - sizegrowth = [[0.55 r0.85]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,200 r200]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - drawOrder = 1, - }, - }, - }, + ["fire-flames-repeat"] = { + usedefaultexplosions = false, + flame1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.9 0.87 0.87 0.4 0.65 0.65 0.4 0.2 0.65 0.65 0.4 0.2 0.13 0.13 0.02 0.12 0.08 0.08 0.02 0.07 0.025 0.02 0.01 0.02 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 30, + emitvector = [[-0.4 r0.2, -0.4, -0.4 r0.2]], + gravity = [[0, 0.03 r0.04, 0]], + numparticles = [[0.18 r1]], + particlelife = 54, + particlelifespread = 110, + particlesize = 32, + particlesizespread = 64, + particlespeed = 1, + particlespeedspread = 1.3, + animParams = [[8,8,90 r50]], + rotParams = [[-3 r6, -3 r6, -180 r360]], + pos = [[-4 r8, -5 r35, -4 r8]], + sizegrowth = [[1.6 r0.6]], + sizemod = 0.98, + texture = [[FireBall02-anim]], + castShadow = false, + drawOrder = 0, + }, + }, + blacksmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.01 0.01 0.01 0.01 0.03 0.03 0.01 0.2 0.01 0.01 0.01 0.32 0.1 0.1 0.1 0.64 0.04 0.04 0.04 0.32 0.02 0.02 0.02 0.17 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 70, + emitvector = [[r0.2 -0.4, 1, r0.2 -0.4]], + gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], + numparticles = [[0.08 r1]], + particlelife = 180, + particlelifespread = 60, + particlesize = 54, + particlesizespread = 84, + particlespeed = 3, + particlespeedspread = 2, + rotParams = [[-10 r20, -1 r2, -180 r360]], + pos = [[0.0, 0, 0.0]], + sizegrowth = [[0.55 r0.85]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,200 r200]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + drawOrder = 1, + }, + }, + }, - ["fire-burnground-repeat"] = { - usedefaultexplosions = false, - flamemattalways = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = - [[0.25 0.22 0.18 0.6 0.75 0.77 0.40 0.8 0.72 0.58 0.39 1 0.67 0.54 0.34 0.9 0.63 0.49 0.27 0.8 0.58 0.39 0.29 0.7 0.48 0.29 0.22 0.6 0.11 0.06 0.12 0.50 0.016 0.009 0.07 0.4 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 0.7, 0]], - gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], - numparticles = 1, -- always one, a little larger, try to guarantee the area is covered basically - particlelife = 44, - particlelifespread = 44, - particlesize = 64, - particlesizespread = 100, - particlespeed = 3.20, - particlespeedspread = 5.20, - rotParams = [[-5 r10, -20 r40, -180 r360]], - animParams = [[16,6,88 r55]], - pos = [[-3 r6, -12 r25, -3 r6]], - sizegrowth = [[1.10 r1.05]], - sizemod = 0.98, - texture = [[BARFlame02]], - castShadow = false, - drawOrder = 2, - }, - }, - flamemattrandom = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - properties = { - airdrag = 0.92, - colormap = - [[0.25 0.22 0.18 0.6 0.75 0.77 0.40 0.8 0.72 0.58 0.39 1 0.67 0.54 0.34 0.9 0.63 0.49 0.27 0.8 0.58 0.39 0.29 0.7 0.48 0.29 0.22 0.6 0.11 0.06 0.12 0.50 0.016 0.009 0.07 0.4 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 0.7, 0]], - gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], - numparticles = [[0.1 r1]], -- less often, spawn smaller fires to give a more natural look - particlelife = 44, - particlelifespread = 66, - particlesize = 46, - particlesizespread = 130, - particlespeed = 3.20, - particlespeedspread = 5.20, - rotParams = [[-5 r10, -20 r40, -180 r360]], - animParams = [[16,6,88 r55]], - pos = [[-32 r16, -12 r44, -32 r16]], - sizegrowth = [[1.10 r1.05]], - sizemod = 0.98, - texture = [[BARFlame02]], - castShadow = false, - drawOrder = 2, - }, - }, - flamedark = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - properties = { - airdrag = 0.93, - colormap = - [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.26 0.2 0.18 0.333 0.36 0.27 0.29 0.72 0.34 0.28 0.40 0.88 0.33 0.29 0.20 0.7 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0.01 0.01 0.01 0.01 0 0 0 0.01]], - directional = false, - emitrot = 85, - emitrotspread = 25, - emitvector = [[r0.28 0.56, 0.9, r0.28 0.56]], - gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], - numparticles = [[0.3 r0.7]], - particlelife = 44, - particlelifespread = 44, - particlesize = 44, - particlesizespread = 88, - particlespeed = 0.10, - particlespeedspread = 0.16, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[16,6,80 r55]], - pos = [[0, 60 r25, 0]], - sizegrowth = [[1.3 r1.1]], - sizemod = 0.99, - texture = [[BARFlame02]], - castShadow = false, - drawOrder = 3, - }, - }, - sparks = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], - directional = true, - emitrot = 35, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], - numparticles = [[0.23 r1]], - particlelife = 11, - particlelifespread = 11, - particlesize = -24, - particlesizespread = -8, - particlespeed = 9, - particlespeedspread = 4, - pos = [[-7 r14, 17 r15, -7 r14]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + ["fire-burnground-repeat"] = { + usedefaultexplosions = false, + flamemattalways = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.25 0.22 0.18 0.6 0.75 0.77 0.40 0.8 0.72 0.58 0.39 1 0.67 0.54 0.34 0.9 0.63 0.49 0.27 0.8 0.58 0.39 0.29 0.7 0.48 0.29 0.22 0.6 0.11 0.06 0.12 0.50 0.016 0.009 0.07 0.4 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0.7, 0]], + gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], + numparticles = 1, -- always one, a little larger, try to guarantee the area is covered basically + particlelife = 44, + particlelifespread = 44, + particlesize = 64, + particlesizespread = 100, + particlespeed = 3.20, + particlespeedspread = 5.20, + rotParams = [[-5 r10, -20 r40, -180 r360]], + animParams = [[16,6,88 r55]], + pos = [[-3 r6, -12 r25, -3 r6]], + sizegrowth = [[1.10 r1.05]], + sizemod = 0.98, + texture = [[BARFlame02]], + castShadow = false, + drawOrder = 2, + }, + }, + flamemattrandom = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.25 0.22 0.18 0.6 0.75 0.77 0.40 0.8 0.72 0.58 0.39 1 0.67 0.54 0.34 0.9 0.63 0.49 0.27 0.8 0.58 0.39 0.29 0.7 0.48 0.29 0.22 0.6 0.11 0.06 0.12 0.50 0.016 0.009 0.07 0.4 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0.7, 0]], + gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], + numparticles = [[0.1 r1]], -- less often, spawn smaller fires to give a more natural look + particlelife = 44, + particlelifespread = 66, + particlesize = 46, + particlesizespread = 130, + particlespeed = 3.20, + particlespeedspread = 5.20, + rotParams = [[-5 r10, -20 r40, -180 r360]], + animParams = [[16,6,88 r55]], + pos = [[-32 r16, -12 r44, -32 r16]], + sizegrowth = [[1.10 r1.05]], + sizemod = 0.98, + texture = [[BARFlame02]], + castShadow = false, + drawOrder = 2, + }, + }, + flamedark = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.26 0.2 0.18 0.333 0.36 0.27 0.29 0.72 0.34 0.28 0.40 0.88 0.33 0.29 0.20 0.7 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0.01 0.01 0.01 0.01 0 0 0 0.01]], + directional = false, + emitrot = 85, + emitrotspread = 25, + emitvector = [[r0.28 0.56, 0.9, r0.28 0.56]], + gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], + numparticles = [[0.3 r0.7]], + particlelife = 44, + particlelifespread = 44, + particlesize = 44, + particlesizespread = 88, + particlespeed = 0.10, + particlespeedspread = 0.16, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[16,6,80 r55]], + pos = [[0, 60 r25, 0]], + sizegrowth = [[1.3 r1.1]], + sizemod = 0.99, + texture = [[BARFlame02]], + castShadow = false, + drawOrder = 3, + }, + }, + sparks = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], + directional = true, + emitrot = 35, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], + numparticles = [[0.23 r1]], + particlelife = 11, + particlelifespread = 11, + particlesize = -24, + particlesizespread = -8, + particlespeed = 9, + particlespeedspread = 4, + pos = [[-7 r14, 17 r15, -7 r14]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - ["fire-area-repeat"] = { - usedefaultexplosions = false, - under = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.5 0.43 0.2 0.18 0.65 0.65 0.3 0.4 0.3 0.2 0.1 0.28 0.08 0.05 0.07 0.12 0.08 0.05 0.07 0.08 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[FireBall02-anim]], - animParams = [[8,8,90 r60]], - length = 0, - sidetexture = [[none]], - size = 75, - sizegrowth = [[-0.5 r1.2]], - ttl = 22 * 2.5, - pos = [[0, 5, 0]], - rotParams = [[-4 r8, -4 r8, -180 r360]], - drawOrder = -2, - castShadow = false, - }, - }, - fireflamearea = { - class = [[CExpGenSpawner]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r9]], - dir = [[dir]], - explosiongenerator = [[custom:fire-flames-repeat]], - pos = [[-18 r36, 4 r28, -18 r36]], - }, - }, - fireflameground = { - class = [[CExpGenSpawner]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r9]], - dir = [[dir]], - explosiongenerator = [[custom:fire-burnground-repeat]], - pos = [[-15 r30, 4 r12, -15 r30]], - }, - }, - }, + ["fire-area-repeat"] = { + usedefaultexplosions = false, + under = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.5 0.43 0.2 0.18 0.65 0.65 0.3 0.4 0.3 0.2 0.1 0.28 0.08 0.05 0.07 0.12 0.08 0.05 0.07 0.08 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[FireBall02-anim]], + animParams = [[8,8,90 r60]], + length = 0, + sidetexture = [[none]], + size = 75, + sizegrowth = [[-0.5 r1.2]], + ttl = 22 * 2.5, + pos = [[0, 5, 0]], + rotParams = [[-4 r8, -4 r8, -180 r360]], + drawOrder = -2, + castShadow = false, + }, + }, + fireflamearea = { + class = [[CExpGenSpawner]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r9]], + dir = [[dir]], + explosiongenerator = [[custom:fire-flames-repeat]], + pos = [[-18 r36, 4 r28, -18 r36]], + }, + }, + fireflameground = { + class = [[CExpGenSpawner]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r9]], + dir = [[dir]], + explosiongenerator = [[custom:fire-burnground-repeat]], + pos = [[-15 r30, 4 r12, -15 r30]], + }, + }, + }, } -- Keep array in sync with values in unit_area_timed_damage: @@ -1576,35 +1565,35 @@ local areaSizePresets = { 37.5, 46, 54, 63, 75, 88, 100, 125, 150, 175, 200, 225 local debugEffects = false local debugCircle = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0.1 0 0 0 1 0 0 0 0.1]], - dir = [[dir]], - drawOrder = 0, - frontoffset = 0, - fronttexture = [[blastwave]], - length = 0, - pos = [[0, 8, 0]], - rotParams = [[0, 0, 0]], - sidetexture = [[none]], - size = 75, - sizegrowth = [[0]], - ttl = 30, - }, + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0.1 0 0 0 1 0 0 0 0.1]], + dir = [[dir]], + drawOrder = 0, + frontoffset = 0, + fronttexture = [[blastwave]], + length = 0, + pos = [[0, 8, 0]], + rotParams = [[0, 0, 0]], + sidetexture = [[none]], + size = 75, + sizegrowth = [[0]], + ttl = 30, + }, } local function circularAreaOfEffect(radius, ypos) - ypos = ypos or [[0]] - local angle = "r6.283 y0 " - local distance = "r1 p0.5 y1 "..radius.." x1 y1 " - local xpos = "a0 s1 x1" - local zpos = "1.57 "..xpos - return angle..distance..xpos..", "..ypos..", "..zpos + ypos = ypos or [[0]] + local angle = "r6.283 y0 " + local distance = "r1 p0.5 y1 " .. radius .. " x1 y1 " + local xpos = "a0 s1 x1" + local zpos = "1.57 " .. xpos + return angle .. distance .. xpos .. ", " .. ypos .. ", " .. zpos end -- At higher particle counts in a CEG, swap in a larger fireball texture. @@ -1623,50 +1612,50 @@ definitions["fire-burnground-large-repeat"].flamemattrandom.properties.particles definitions["fire-burnground-large-repeat"].flamemattrandom.properties.particlesizespread = radiusFlameLarge * 1.4 for ii = 1, #areaSizePresets do - local expgen = table.copy(definitions['fire-area-repeat']) - local radius = areaSizePresets[ii] + local expgen = table.copy(definitions["fire-area-repeat"]) + local radius = areaSizePresets[ii] - local radiusFlame = 56 - local inset = radiusFlame * 0.5 + local radiusFlame = 56 + local inset = radiusFlame * 0.5 - local count, delay, posArea, posGround - count = math.ceil((1/5) * (radius / radiusFlame) ^ 2) -- longer particle life => decrease this fraction - if count > 4 then - -- Reduce the total particle count by spawning larger fire particles - expgen.fireflamearea.properties.explosiongenerator = [[custom:fire-flames-large-repeat]] - expgen.fireflameground.properties.explosiongenerator = [[custom:fire-burnground-large-repeat]] - radiusFlame = 84 - inset = radiusFlame * 0.5 - count = math.ceil((1/5) * (radius / radiusFlame) ^ 2) -- longer particle life => decrease this fraction - end + local count, delay, posArea, posGround + count = math.ceil((1 / 5) * (radius / radiusFlame) ^ 2) -- longer particle life => decrease this fraction + if count > 4 then + -- Reduce the total particle count by spawning larger fire particles + expgen.fireflamearea.properties.explosiongenerator = [[custom:fire-flames-large-repeat]] + expgen.fireflameground.properties.explosiongenerator = [[custom:fire-burnground-large-repeat]] + radiusFlame = 84 + inset = radiusFlame * 0.5 + count = math.ceil((1 / 5) * (radius / radiusFlame) ^ 2) -- longer particle life => decrease this fraction + end - local framesDelayMax = math.floor(math.sqrt(2 * count * math.sqrt(22))) - delay = framesDelayMax > 4 and ("r"..framesDelayMax) or nil + local framesDelayMax = math.floor(math.sqrt(2 * count * math.sqrt(22))) + delay = framesDelayMax > 4 and ("r" .. framesDelayMax) or nil - posArea = circularAreaOfEffect(radius - inset, [[8 r]]..radiusFlame/2) - posGround = circularAreaOfEffect(radius - inset, [[-8 r]]..radiusFlame/3) + posArea = circularAreaOfEffect(radius - inset, [[8 r]] .. radiusFlame / 2) + posGround = circularAreaOfEffect(radius - inset, [[-8 r]] .. radiusFlame / 3) - expgen.fireflamearea.count = count - expgen.fireflameground.count = count + expgen.fireflamearea.count = count + expgen.fireflameground.count = count - expgen.fireflamearea.properties.delay = delay - expgen.fireflameground.properties.delay = delay + expgen.fireflamearea.properties.delay = delay + expgen.fireflameground.properties.delay = delay - expgen.fireflamearea.properties.pos = posArea - expgen.fireflameground.properties.pos = posGround + expgen.fireflamearea.properties.pos = posArea + expgen.fireflameground.properties.pos = posGround - expgen.under.properties.size = (radius + radiusFlame) * 0.5 + expgen.under.properties.size = (radius + radiusFlame) * 0.5 - if debugEffects == true then - expgen.debugcircle = table.copy(debugCircle) - expgen.debugcircle.properties.size = radius - end + if debugEffects == true then + expgen.debugcircle = table.copy(debugCircle) + expgen.debugcircle.properties.size = radius + end - local name = 'fire-area-'..math.floor(radius)..'-repeat' - definitions[name] = expgen + local name = "fire-area-" .. math.floor(radius) .. "-repeat" + definitions[name] = expgen end -definitions['fire-area-repeat'] = nil +definitions["fire-area-repeat"] = nil definitions["fire-explosion-medium"] = table.copy(definitions["fire-explosion-small"]) definitions["fire-explosion-medium"].explosionfire.properties.particlesize = 64 diff --git a/effects/flak.lua b/effects/flak.lua index 2325c0b1e98..f8f12e0fad3 100644 --- a/effects/flak.lua +++ b/effects/flak.lua @@ -1,247 +1,243 @@ - local definitions = { - ["flak"] = { - shardcloud = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r7]], - explosiongenerator = [[custom:flakshard]], - pos = [[-38 r76, -30 r60, -38 r76]], - }, - }, - -- glow = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0, - -- colormap = [[0.115 0.09 0.1 0.01 0 0 0 0.01]], - -- directional = true, - -- emitrot = 90, - -- emitrotspread = 0, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.0, 0.0]], - -- numparticles = 1, - -- particlelife = 12, - -- particlelifespread = 12, - -- particlesize = 95, - -- particlesizespread = 15, - -- particlespeed = 0, - -- particlespeedspread = 0, - -- pos = [[0.0, 90, 0.0]], - -- sizegrowth = 0, - -- sizemod = 1, - -- texture = [[glow2]], - -- useairlos = true, - -- }, - -- }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.8 0.6 0.7 0.6 0.30 0.18 0.23 0.3 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 70, - sizegrowth = [[-0.5 r-0.5]], - ttl = 6, - pos = [[0, 0, 0]], - - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 1 0.8 0.9 0.09 0.9 0.5 0.6 0.066 0.6 0.28 0.3 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 3, - particlelife = 6, - particlelifespread = 5, - particlesize = 2, - particlesizespread = 2, - particlespeed = 0.2, - particlespeedspread = 1, - pos = [[0, 2, 0]], - sizegrowth = 0.2, - sizemod = 1.1, - texture = [[flashside2]], - useairlos = false, - }, - }, - smoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=0, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.12, - sizeMod = 1, - pos = [[-2 r4, -2 r4, -2 r4]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap = [[0.9 0.6 0.66 0.4 0.1 0.07 0.085 0.6 0.044 0.04 0.041 0.4 0.04 0.034 0.034 0.4 0.025 0.025 0.025 0.26 0.014 0.014 0.014 0.15 0.01 0.01 0.01 0.1 0.006 0.006 0.006 0.06 0 0 0 0.01]], - Texture=[[smoke]], - particleLife=5, - particleLifeSpread=55, - numparticles=[[2.6 r1]], - particleSpeed=0.3, - particleSpeedSpread=1.5, - particleSize=8, - particleSizeSpread=8, - directional=0, - }, - }, - }, - ["flakshard"] = { - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 1 0.8 0.9 0.18 0.9 0.5 0.6 0.066 0.6 0.28 0.3 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = [[2.5 r1]], - particlelife = 3, - particlelifespread = 7, - particlesize = 2.2, - particlesizespread = 2.4, - particlespeed = 0.2, - particlespeedspread = 1, - rotParams = [[-120 r240, -60 r120, -180 r360]], - pos = [[0, 2, 0]], - sizegrowth = 0.2, - sizemod = 1.1, - texture = [[flashside2]], - useairlos = false, - }, - }, - glow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.13 0.1 0.117 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 12, - particlesize = 48, - particlesizespread = 14, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 90, 0.0]], - sizegrowth = 0, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - smoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.06, - sizeMod = 1, - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[-2 r4, -2 r4, -2 r4]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap = [[0.9 0.6 0.66 0.4 0.1 0.07 0.085 0.6 0.044 0.04 0.041 0.4 0.04 0.034 0.034 0.4 0.025 0.025 0.025 0.26 0.014 0.014 0.014 0.14 0.01 0.01 0.01 0.09 0.006 0.006 0.006 0.06 0 0 0 0.01]], - Texture=[[smoke]], - particleLife=6, - particleLifeSpread=23, - numparticles=1, - particleSpeed=0.3, - particleSpeedSpread=1.5, - particleSize=7.5, - particleSizeSpread=10.5, - directional=0, - }, - }, - smoke2 = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.08, - sizeMod = 1, - rotParams = [[-60 r120, -30 r60, -180 r360]], - pos = [[-2 r4, -2 r4, -2 r4]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap = [[0.9 0.6 0.66 0.55 0.1 0.07 0.085 0.7 0.044 0.04 0.041 0.55 0.04 0.034 0.034 0.4 0.036 0.033 0.033 0.36 0.025 0.025 0.025 0.32 0.014 0.014 0.014 0.2 0.01 0.01 0.01 0.15 0.006 0.006 0.006 0.08 0 0 0 0.01]], - Texture=[[smoke_puff]], - particleLife=5, - particleLifeSpread=55, - numparticles=[[0.6 r1]], - particleSpeed=0.3, - particleSpeedSpread=1.5, - particleSize=7.5, - particleSizeSpread=10.5, - directional=0, - }, - }, - }, + ["flak"] = { + shardcloud = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r7]], + explosiongenerator = [[custom:flakshard]], + pos = [[-38 r76, -30 r60, -38 r76]], + }, + }, + -- glow = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0, + -- colormap = [[0.115 0.09 0.1 0.01 0 0 0 0.01]], + -- directional = true, + -- emitrot = 90, + -- emitrotspread = 0, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.0, 0.0]], + -- numparticles = 1, + -- particlelife = 12, + -- particlelifespread = 12, + -- particlesize = 95, + -- particlesizespread = 15, + -- particlespeed = 0, + -- particlespeedspread = 0, + -- pos = [[0.0, 90, 0.0]], + -- sizegrowth = 0, + -- sizemod = 1, + -- texture = [[glow2]], + -- useairlos = true, + -- }, + -- }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.8 0.6 0.7 0.6 0.30 0.18 0.23 0.3 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 70, + sizegrowth = [[-0.5 r-0.5]], + ttl = 6, + pos = [[0, 0, 0]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 1 0.8 0.9 0.09 0.9 0.5 0.6 0.066 0.6 0.28 0.3 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 3, + particlelife = 6, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 2, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.2, + sizemod = 1.1, + texture = [[flashside2]], + useairlos = false, + }, + }, + smoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 0, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.12, + sizeMod = 1, + pos = [[-2 r4, -2 r4, -2 r4]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[0.9 0.6 0.66 0.4 0.1 0.07 0.085 0.6 0.044 0.04 0.041 0.4 0.04 0.034 0.034 0.4 0.025 0.025 0.025 0.26 0.014 0.014 0.014 0.15 0.01 0.01 0.01 0.1 0.006 0.006 0.006 0.06 0 0 0 0.01]], + Texture = [[smoke]], + particleLife = 5, + particleLifeSpread = 55, + numparticles = [[2.6 r1]], + particleSpeed = 0.3, + particleSpeedSpread = 1.5, + particleSize = 8, + particleSizeSpread = 8, + directional = 0, + }, + }, + }, + ["flakshard"] = { + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 1 0.8 0.9 0.18 0.9 0.5 0.6 0.066 0.6 0.28 0.3 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = [[2.5 r1]], + particlelife = 3, + particlelifespread = 7, + particlesize = 2.2, + particlesizespread = 2.4, + particlespeed = 0.2, + particlespeedspread = 1, + rotParams = [[-120 r240, -60 r120, -180 r360]], + pos = [[0, 2, 0]], + sizegrowth = 0.2, + sizemod = 1.1, + texture = [[flashside2]], + useairlos = false, + }, + }, + glow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.13 0.1 0.117 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 12, + particlesize = 48, + particlesizespread = 14, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 90, 0.0]], + sizegrowth = 0, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + smoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.06, + sizeMod = 1, + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[-2 r4, -2 r4, -2 r4]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[0.9 0.6 0.66 0.4 0.1 0.07 0.085 0.6 0.044 0.04 0.041 0.4 0.04 0.034 0.034 0.4 0.025 0.025 0.025 0.26 0.014 0.014 0.014 0.14 0.01 0.01 0.01 0.09 0.006 0.006 0.006 0.06 0 0 0 0.01]], + Texture = [[smoke]], + particleLife = 6, + particleLifeSpread = 23, + numparticles = 1, + particleSpeed = 0.3, + particleSpeedSpread = 1.5, + particleSize = 7.5, + particleSizeSpread = 10.5, + directional = 0, + }, + }, + smoke2 = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.08, + sizeMod = 1, + rotParams = [[-60 r120, -30 r60, -180 r360]], + pos = [[-2 r4, -2 r4, -2 r4]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[0.9 0.6 0.66 0.55 0.1 0.07 0.085 0.7 0.044 0.04 0.041 0.55 0.04 0.034 0.034 0.4 0.036 0.033 0.033 0.36 0.025 0.025 0.025 0.32 0.014 0.014 0.014 0.2 0.01 0.01 0.01 0.15 0.006 0.006 0.006 0.08 0 0 0 0.01]], + Texture = [[smoke_puff]], + particleLife = 5, + particleLifeSpread = 55, + numparticles = [[0.6 r1]], + particleSpeed = 0.3, + particleSpeedSpread = 1.5, + particleSize = 7.5, + particleSizeSpread = 10.5, + directional = 0, + }, + }, + }, } - - -return definitions \ No newline at end of file +return definitions diff --git a/effects/footsteps.lua b/effects/footsteps.lua index af4787f4a14..e7728c27ec7 100644 --- a/effects/footsteps.lua +++ b/effects/footsteps.lua @@ -1,426 +1,425 @@ -- unit footsteps CURRENTLY DISABLED return { - ["footstep-small"] = { - dirtsplat = { - class = [[CSimpleParticleSystem]], - count = 2, -- 2 - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 45, - emitvector = [[0, -0.3, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 1, - particlelife = 13, - particlelifespread = 25, - particlesize = 4.0, - particlesizespread = 6, - particlespeed = 2.5, - particlespeedspread = 10, - pos = [[0, 3, 0]], - rotParams = [[-20 r40, 0, -180 r360]], - sizegrowth = [[-0.05 r0.18]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1,-- 1 - ground = true, - properties = { - airdrag = 0.67, - --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], - colormap = [[0.15 0.12 0.07 0.7 0.06 0.04 0.04 0.4 0 0 0 0.01]], - directional = false, - emitrot = 60, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.11 r0.07, 0]], - numparticles = 1, - particlelife = 23, - particlelifespread = 13, - particlesize = 34, - particlesizespread = 19, - particlespeed = 2, - particlespeedspread = 2, - pos = [[-0.05 r0.1, 2 r2, -0.05 r0.1]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = 0.04, - sizemod = 1.002, - texture = [[smoke-ice-anim]], - animParams = [[8,8,80 r45]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - -- extradebree = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, -- 1 - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], - -- directional = false, - -- emitrot = 45, - -- emitrotspread = 45, - -- emitvector = [[0, 0.5, 0]], - -- gravity = [[0, -0.07, 0]], - -- numparticles = 2, - -- particlelife = 20, - -- particlelifespread = 30, - -- particlesize = 1, - -- particlesizespread = 4, - -- particlespeed = 6, - -- particlespeedspread = 14, - -- pos = [[0, 4, 0]], - -- sizegrowth = 0.2, - -- sizemod = 0.98, - -- texture = [[shard3]], - -- useairlos = false, - -- }, - -- }, - }, - ["footstep-medium"] = { - dirtsplat = { - class = [[CSimpleParticleSystem]], - count = 2, -- 2 - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 45, - emitvector = [[0, -0.3, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[1.2 r0.8]], - particlelife = 17, - particlelifespread = 35, - particlesize = 3.5, - particlesizespread = 10, - particlespeed = 2.5, - particlespeedspread = 10, - pos = [[0, 6, 0]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = [[-0.05 r0.18]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1,-- 1 - ground = true, - properties = { - airdrag = 0.67, - --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], - colormap = [[0.15 0.12 0.07 0.7 0.06 0.04 0.04 0.4 0 0 0 0.01]], - directional = false, - emitrot = 60, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.09 r0.07, 0]], - numparticles = 1, - particlelife = 30, - particlelifespread = 15, - particlesize = 38, - particlesizespread = 18, - particlespeed = 2, - particlespeedspread = 2, - pos = [[-0.3 r0.6, 0 r4, -0.3 r0.6]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = 0.05, - sizemod = 1.005, - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r45]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - -- extradebree = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, -- 1 - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.94, - -- colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], - -- directional = false, - -- emitrot = 45, - -- emitrotspread = 45, - -- emitvector = [[0, 0.5, 0]], - -- gravity = [[0, -0.07, 0]], - -- numparticles = 2, - -- particlelife = 20, - -- particlelifespread = 30, - -- particlesize = 1, - -- particlesizespread = 4, - -- particlespeed = 6, - -- particlespeedspread = 14, - -- pos = [[0, 4, 0]], - -- sizegrowth = 0.2, - -- sizemod = 0.98, - -- texture = [[shard3]], - -- useairlos = false, - -- }, - -- }, - }, + ["footstep-small"] = { + dirtsplat = { + class = [[CSimpleParticleSystem]], + count = 2, -- 2 + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 45, + emitvector = [[0, -0.3, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 1, + particlelife = 13, + particlelifespread = 25, + particlesize = 4.0, + particlesizespread = 6, + particlespeed = 2.5, + particlespeedspread = 10, + pos = [[0, 3, 0]], + rotParams = [[-20 r40, 0, -180 r360]], + sizegrowth = [[-0.05 r0.18]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, -- 1 + ground = true, + properties = { + airdrag = 0.67, + --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], + colormap = [[0.15 0.12 0.07 0.7 0.06 0.04 0.04 0.4 0 0 0 0.01]], + directional = false, + emitrot = 60, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.11 r0.07, 0]], + numparticles = 1, + particlelife = 23, + particlelifespread = 13, + particlesize = 34, + particlesizespread = 19, + particlespeed = 2, + particlespeedspread = 2, + pos = [[-0.05 r0.1, 2 r2, -0.05 r0.1]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = 0.04, + sizemod = 1.002, + texture = [[smoke-ice-anim]], + animParams = [[8,8,80 r45]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + -- extradebree = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, -- 1 + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], + -- directional = false, + -- emitrot = 45, + -- emitrotspread = 45, + -- emitvector = [[0, 0.5, 0]], + -- gravity = [[0, -0.07, 0]], + -- numparticles = 2, + -- particlelife = 20, + -- particlelifespread = 30, + -- particlesize = 1, + -- particlesizespread = 4, + -- particlespeed = 6, + -- particlespeedspread = 14, + -- pos = [[0, 4, 0]], + -- sizegrowth = 0.2, + -- sizemod = 0.98, + -- texture = [[shard3]], + -- useairlos = false, + -- }, + -- }, + }, + ["footstep-medium"] = { + dirtsplat = { + class = [[CSimpleParticleSystem]], + count = 2, -- 2 + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 45, + emitvector = [[0, -0.3, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[1.2 r0.8]], + particlelife = 17, + particlelifespread = 35, + particlesize = 3.5, + particlesizespread = 10, + particlespeed = 2.5, + particlespeedspread = 10, + pos = [[0, 6, 0]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = [[-0.05 r0.18]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, -- 1 + ground = true, + properties = { + airdrag = 0.67, + --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], + colormap = [[0.15 0.12 0.07 0.7 0.06 0.04 0.04 0.4 0 0 0 0.01]], + directional = false, + emitrot = 60, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.09 r0.07, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 15, + particlesize = 38, + particlesizespread = 18, + particlespeed = 2, + particlespeedspread = 2, + pos = [[-0.3 r0.6, 0 r4, -0.3 r0.6]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = 0.05, + sizemod = 1.005, + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r45]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + -- extradebree = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, -- 1 + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.94, + -- colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], + -- directional = false, + -- emitrot = 45, + -- emitrotspread = 45, + -- emitvector = [[0, 0.5, 0]], + -- gravity = [[0, -0.07, 0]], + -- numparticles = 2, + -- particlelife = 20, + -- particlelifespread = 30, + -- particlesize = 1, + -- particlesizespread = 4, + -- particlespeed = 6, + -- particlespeedspread = 14, + -- pos = [[0, 4, 0]], + -- sizegrowth = 0.2, + -- sizemod = 0.98, + -- texture = [[shard3]], + -- useairlos = false, + -- }, + -- }, + }, - ["footstep-large"] = { - dirtsplat = { - class = [[CSimpleParticleSystem]], - count = 2, -- 2 - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 45, - emitvector = [[0, -0.3, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[1.2 r0.9]], - particlelife = 17, - particlelifespread = 35, - particlesize = 6.5, - particlesizespread = 14, - particlespeed = 4.5, - particlespeedspread = 14, - pos = [[0, 6, 0]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = [[-0.05 r0.18]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - shockwave_fast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - unit = true, - properties = { - colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[shockwave]], - length = 1, - sidetexture = [[none]], - size = 1, - sizegrowth = [[-35 r8]], - ttl = 5, - pos = [[0, 0, 0]], - drawOrder = 1, - useairlos = false, - alwaysvisible = false, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1,-- 1 - ground = true, - properties = { - airdrag = 0.69, - --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], - colormap = [[0.14 0.13 0.12 1 0.07 0.07 0.06 0.8 0 0 0 0.01]], - directional = false, - emitrot = 60, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.09 r0.07, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 15, - particlesize = 45, - particlesizespread = 15, - particlespeed = 3, - particlespeedspread = 3, - pos = [[-0.2 r0.4, 3 r8, -0.2 r0.4]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = 0.05, - sizemod = 1.001, - texture = [[smoke-anim]], - animParams = [[8,6,41 r45]], - useairlos = false, - alwaysvisible = false, - castShadow = false, - }, - }, - extradebree = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, -- 1 - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], - directional = false, - emitrot = 45, - emitrotspread = 45, - emitvector = [[0, 0.5, 0]], - gravity = [[0, -0.07, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 4, - particlespeed = 6, - particlespeedspread = 14, - pos = [[0, 4, 0]], - sizegrowth = 0.2, - sizemod = 0.98, - texture = [[shard3]], - useairlos = false, - }, - }, - }, + ["footstep-large"] = { + dirtsplat = { + class = [[CSimpleParticleSystem]], + count = 2, -- 2 + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 45, + emitvector = [[0, -0.3, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[1.2 r0.9]], + particlelife = 17, + particlelifespread = 35, + particlesize = 6.5, + particlesizespread = 14, + particlespeed = 4.5, + particlespeedspread = 14, + pos = [[0, 6, 0]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = [[-0.05 r0.18]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + shockwave_fast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + unit = true, + properties = { + colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[shockwave]], + length = 1, + sidetexture = [[none]], + size = 1, + sizegrowth = [[-35 r8]], + ttl = 5, + pos = [[0, 0, 0]], + drawOrder = 1, + useairlos = false, + alwaysvisible = false, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, -- 1 + ground = true, + properties = { + airdrag = 0.69, + --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], + colormap = [[0.14 0.13 0.12 1 0.07 0.07 0.06 0.8 0 0 0 0.01]], + directional = false, + emitrot = 60, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.09 r0.07, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 15, + particlesize = 45, + particlesizespread = 15, + particlespeed = 3, + particlespeedspread = 3, + pos = [[-0.2 r0.4, 3 r8, -0.2 r0.4]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = 0.05, + sizemod = 1.001, + texture = [[smoke-anim]], + animParams = [[8,6,41 r45]], + useairlos = false, + alwaysvisible = false, + castShadow = false, + }, + }, + extradebree = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, -- 1 + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], + directional = false, + emitrot = 45, + emitrotspread = 45, + emitvector = [[0, 0.5, 0]], + gravity = [[0, -0.07, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 4, + particlespeed = 6, + particlespeedspread = 14, + pos = [[0, 4, 0]], + sizegrowth = 0.2, + sizemod = 0.98, + texture = [[shard3]], + useairlos = false, + }, + }, + }, - ["footstep-huge"] = { - dirtsplat = { - class = [[CSimpleParticleSystem]], - count = 2, -- 2 - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], - directional = false, - emitrot = 180, - emitrotspread = 45, - emitvector = [[0, -0.6, 0]], - gravity = [[0, -0.12, 0]], - numparticles = [[1.2 r0.8]], - particlelife = 17, - particlelifespread = 35, - particlesize = 10.5, - particlesizespread = 15, - particlespeed = 2.5, - particlespeedspread = 8, - pos = [[0, 0, 0]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = [[-0.05 r0.20]], - sizemod = 1, - texture = [[randdots]], - useairlos = false, - alwaysvisible = false, - castShadow = true, - }, - }, - shockwave_fast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - unit = true, - properties = { - colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[shockwave]], - length = 1, - sidetexture = [[none]], - size = 1, - sizegrowth = [[-40 r12]], - ttl = 6, - pos = [[0, 0, 0]], - drawOrder = 1, - useairlos = false, - alwaysvisible = false, - }, - }, - dirtg2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2,-- 1 - ground = true, - properties = { - airdrag = 0.72, - --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], - colormap = [[0.15 0.12 0.07 1 0.06 0.04 0.04 0.6 0 0 0 0.01]], - directional = false, - emitrot = 60, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[-0.05 r0.1, 0.16 r0.14, -0.05 r0.1]], - numparticles = 1, - particlelife = 60, - particlelifespread = 0, - particlesize = 40, - particlesizespread = 28, - particlespeed = 2, - particlespeedspread = 2, - pos = [[-4 r8, 32 r12, -4 r8]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = 0.17, - sizemod = 1.005, - -- texture = [[smoke-ice-anim]], - texture = [[smoke-anim]], - animParams = [[8,6,41 r45]], - useairlos = false, - alwaysvisible = false, - --castShadow = true, - }, - }, - extradebree = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, -- 1 - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], - directional = false, - emitrot = 45, - emitrotspread = 45, - emitvector = [[0, 0.5, 0]], - gravity = [[0, -0.07, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 4, - particlespeed = 6, - particlespeedspread = 14, - pos = [[0, 0, 0]], - sizegrowth = 0.2, - sizemod = 0.98, - texture = [[shard3]], - useairlos = false, - }, - }, - }, + ["footstep-huge"] = { + dirtsplat = { + class = [[CSimpleParticleSystem]], + count = 2, -- 2 + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.08 0.06 0.02 0.88 0.1 0.07 0.033 0.68 0 0 0 0]], + directional = false, + emitrot = 180, + emitrotspread = 45, + emitvector = [[0, -0.6, 0]], + gravity = [[0, -0.12, 0]], + numparticles = [[1.2 r0.8]], + particlelife = 17, + particlelifespread = 35, + particlesize = 10.5, + particlesizespread = 15, + particlespeed = 2.5, + particlespeedspread = 8, + pos = [[0, 0, 0]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = [[-0.05 r0.20]], + sizemod = 1, + texture = [[randdots]], + useairlos = false, + alwaysvisible = false, + castShadow = true, + }, + }, + shockwave_fast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + unit = true, + properties = { + colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[shockwave]], + length = 1, + sidetexture = [[none]], + size = 1, + sizegrowth = [[-40 r12]], + ttl = 6, + pos = [[0, 0, 0]], + drawOrder = 1, + useairlos = false, + alwaysvisible = false, + }, + }, + dirtg2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, -- 1 + ground = true, + properties = { + airdrag = 0.72, + --colormap = [[0.20 0.18 0.14 0.55 0.35 0.30 0.27 0.50 0 0 0 0.01]], + colormap = [[0.15 0.12 0.07 1 0.06 0.04 0.04 0.6 0 0 0 0.01]], + directional = false, + emitrot = 60, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[-0.05 r0.1, 0.16 r0.14, -0.05 r0.1]], + numparticles = 1, + particlelife = 60, + particlelifespread = 0, + particlesize = 40, + particlesizespread = 28, + particlespeed = 2, + particlespeedspread = 2, + pos = [[-4 r8, 32 r12, -4 r8]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = 0.17, + sizemod = 1.005, + -- texture = [[smoke-ice-anim]], + texture = [[smoke-anim]], + animParams = [[8,6,41 r45]], + useairlos = false, + alwaysvisible = false, + --castShadow = true, + }, + }, + extradebree = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, -- 1 + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.15 0.15 0.15 1 0.1 0.1 0.1 0.7 0 0 0 0]], + directional = false, + emitrot = 45, + emitrotspread = 45, + emitvector = [[0, 0.5, 0]], + gravity = [[0, -0.07, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 4, + particlespeed = 6, + particlespeedspread = 14, + pos = [[0, 0, 0]], + sizegrowth = 0.2, + sizemod = 0.98, + texture = [[shard3]], + useairlos = false, + }, + }, + }, } - diff --git a/effects/gausscannon.lua b/effects/gausscannon.lua index 7b13a07d615..be4f9efa13c 100644 --- a/effects/gausscannon.lua +++ b/effects/gausscannon.lua @@ -1,876 +1,876 @@ -- Gauss Cannon Effects return { - ["gausscannonprojectile"] = { - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], - size = 25, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], - size = 50, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], - size = 41, - sizegrowth = 0, - ttl = 3, - texture = [[groundflash]], - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.2, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 2, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[flare]], - length = 40, - sidetexture = [[none]], - size = [[65 r20]], - sizegrowth = -0.3, - ttl = 2, - pos = [[0, 0, 0]], - --rotParams = [[-10 r20, -20 r40, -180 r360]], - drawOrder = 0, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 6, - particlelifespread = 2, - particlesize = 4.44, - particlesizespread = 8.2, - particlespeed = 0.9, - particlespeedspread = 2.2, - pos = [[0, 2, 0]], - rotParams = [[-20 r40, -20 r40, -180 r360]], - sizegrowth = 0.2, - sizemod = 1.02, - texture = [[flame_alt]], - useairlos = false, - }, - }, - ball = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.4, - colormap = [[0.75 0.60 0.55 0.22 0.70 0.58 0.50 0.25 0.21 0.15 0.14 0.15 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 4, - particlelife = 9, - particlelifespread = 2, - particlesize = 13, - particlesizespread = 2, - particlespeed = 0.5, - particlespeedspread = 2.9, - pos = [[0, 2, 0]], - rotParams = [[-40 r80, -20 r40, -180 r360]], - sizegrowth = -0.3, - sizemod = 1.0, - texture = [[dirt]], - useairlos = false, - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 2, - particlesize = 2.5, - particlesizespread = 0.66, - particlespeed = 0.55, - particlespeedspread = 0.2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - sizeGrowth = 0.4, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - rotParams = [[-24 r48, 0, -180 r360]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=22, - particleLifeSpread=45, - numparticles=2, - particleSpeed=0.6, - particleSpeedSpread=2.7, - particleSize=8, - particleSizeSpread=5.5, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=0, - properties = { - airdrag=0.4, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=25, - numparticles=2, - particleSpeed=1, - particleSpeedSpread=3.3, - particleSize=7.5, - particleSizeSpread=2.5, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = true, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 22, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 2, - particlelife = 17, - particlelifespread = 4, - particlesize = 1.5, - particlesizespread = -1, - particlespeed = 1.4, - particlespeedspread = 1.75, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = false, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 18, - particlelifespread = 4, - particlesize = 1.23, - particlesizespread = -1, - particlespeed = 1.66, - particlespeedspread = 2.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 55, - particlesize = 5, - particlesizespread = 8, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - --grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - -- directional = true, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.02, 0]], - -- numparticles = 12, - -- particlelife = 10, - -- particlelifespread = 40, - -- particlesize = 3, - -- particlesizespread = 2, - -- particlespeed = 2.2, - -- particlespeedspread = 0.8, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.1, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.2]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.1, - particlesizespread = 1.8, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.6]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.6, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.6]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 2, - particlespeed = 1.35, - particlespeedspread = 1.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 8, - particlesize = 19, - particlesizespread = 14, - particlespeed = 4.75, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = 0.79, - sizemod = 0.72, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 4, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, - - ["gausscannonprojectilexl"] = { - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.7 0.3 1.0 0.32 0 0 0 0.01]], - size = 32, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[0.7 0.3 1.0 0.11 0 0 0 0.01]], - size = 65, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], - size = 42, - sizegrowth = -0.3, - ttl = 5, - texture = [[groundflash]], - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.2, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 4, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 0.7 0.3 1.0 0.09 0.6 0.25 0.9 0.066 0.28 0.04 0.66 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 3, - particlelife = 8, - particlelifespread = 6, - particlesize = 4, - particlesizespread = 5, - particlespeed = 0.4, - particlespeedspread = 2.5, - pos = [[0, 2, 0]], - sizegrowth = 0.25, - sizemod = 1.1, - texture = [[flashside2]], - useairlos = false, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 2, - particlesize = 6, - particlesizespread = 1.6, - particlespeed = 0.55, - particlespeedspread = 0.2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - sizeGrowth = 0.4, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=22, - particleLifeSpread=45, - numparticles=1, - particleSpeed=0.6, - particleSpeedSpread=2.7, - particleSize=5, - particleSizeSpread=2.6, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.4, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=25, - numparticles=1, - particleSpeed=1, - particleSpeedSpread=3.3, - particleSize=8.5, - particleSizeSpread=2.8, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = true, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 22, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 16, - particlelifespread = 4, - particlesize = 1.4, - particlesizespread = -1.2, - particlespeed = 1.4, - particlespeedspread = 1.75, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = false, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 4, - particlesize = 1.4, - particlesizespread = -1, - particlespeed = 1.66, - particlespeedspread = 2.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 55, - particlesize = 5, - particlesizespread = 8, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.2]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.1, - particlesizespread = 1.8, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.6]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.6, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 0, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.6]], - particlelife = 28, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 2, - particlespeed = 1.35, - particlespeedspread = 1.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0.7 0.3 1.0 0.017 0.6 0.25 0.9 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 10, - particlesize = 38, - particlesizespread = 34, - particlespeed = 4.95, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 0.6, - sizemod = 0.88, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 4, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, -} \ No newline at end of file + ["gausscannonprojectile"] = { + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], + size = 25, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], + size = 50, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], + size = 41, + sizegrowth = 0, + ttl = 3, + texture = [[groundflash]], + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.2, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.96 0.92 0.80 0.3 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[flare]], + length = 40, + sidetexture = [[none]], + size = [[65 r20]], + sizegrowth = -0.3, + ttl = 2, + pos = [[0, 0, 0]], + --rotParams = [[-10 r20, -20 r40, -180 r360]], + drawOrder = 0, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 6, + particlelifespread = 2, + particlesize = 4.44, + particlesizespread = 8.2, + particlespeed = 0.9, + particlespeedspread = 2.2, + pos = [[0, 2, 0]], + rotParams = [[-20 r40, -20 r40, -180 r360]], + sizegrowth = 0.2, + sizemod = 1.02, + texture = [[flame_alt]], + useairlos = false, + }, + }, + ball = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.4, + colormap = [[0.75 0.60 0.55 0.22 0.70 0.58 0.50 0.25 0.21 0.15 0.14 0.15 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 4, + particlelife = 9, + particlelifespread = 2, + particlesize = 13, + particlesizespread = 2, + particlespeed = 0.5, + particlespeedspread = 2.9, + pos = [[0, 2, 0]], + rotParams = [[-40 r80, -20 r40, -180 r360]], + sizegrowth = -0.3, + sizemod = 1.0, + texture = [[dirt]], + useairlos = false, + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 2, + particlesize = 2.5, + particlesizespread = 0.66, + particlespeed = 0.55, + particlespeedspread = 0.2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + sizeGrowth = 0.4, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + rotParams = [[-24 r48, 0, -180 r360]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 22, + particleLifeSpread = 45, + numparticles = 2, + particleSpeed = 0.6, + particleSpeedSpread = 2.7, + particleSize = 8, + particleSizeSpread = 5.5, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 0, + properties = { + airdrag = 0.4, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 25, + numparticles = 2, + particleSpeed = 1, + particleSpeedSpread = 3.3, + particleSize = 7.5, + particleSizeSpread = 2.5, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = true, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 22, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 2, + particlelife = 17, + particlelifespread = 4, + particlesize = 1.5, + particlesizespread = -1, + particlespeed = 1.4, + particlespeedspread = 1.75, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = false, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 18, + particlelifespread = 4, + particlesize = 1.23, + particlesizespread = -1, + particlespeed = 1.66, + particlespeedspread = 2.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 55, + particlesize = 5, + particlesizespread = 8, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + --grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + -- directional = true, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.02, 0]], + -- numparticles = 12, + -- particlelife = 10, + -- particlelifespread = 40, + -- particlesize = 3, + -- particlesizespread = 2, + -- particlespeed = 2.2, + -- particlespeedspread = 0.8, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.1, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.2]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.1, + particlesizespread = 1.8, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.6]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.6, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.6]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 2, + particlespeed = 1.35, + particlespeedspread = 1.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 8, + particlesize = 19, + particlesizespread = 14, + particlespeed = 4.75, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.79, + sizemod = 0.72, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 4, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + + ["gausscannonprojectilexl"] = { + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.7 0.3 1.0 0.32 0 0 0 0.01]], + size = 32, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[0.7 0.3 1.0 0.11 0 0 0 0.01]], + size = 65, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], + size = 42, + sizegrowth = -0.3, + ttl = 5, + texture = [[groundflash]], + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.2, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 4, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 0.7 0.3 1.0 0.09 0.6 0.25 0.9 0.066 0.28 0.04 0.66 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 3, + particlelife = 8, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 5, + particlespeed = 0.4, + particlespeedspread = 2.5, + pos = [[0, 2, 0]], + sizegrowth = 0.25, + sizemod = 1.1, + texture = [[flashside2]], + useairlos = false, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 2, + particlesize = 6, + particlesizespread = 1.6, + particlespeed = 0.55, + particlespeedspread = 0.2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + sizeGrowth = 0.4, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 22, + particleLifeSpread = 45, + numparticles = 1, + particleSpeed = 0.6, + particleSpeedSpread = 2.7, + particleSize = 5, + particleSizeSpread = 2.6, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.4, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 25, + numparticles = 1, + particleSpeed = 1, + particleSpeedSpread = 3.3, + particleSize = 8.5, + particleSizeSpread = 2.8, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = true, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 22, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 16, + particlelifespread = 4, + particlesize = 1.4, + particlesizespread = -1.2, + particlespeed = 1.4, + particlespeedspread = 1.75, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = false, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 4, + particlesize = 1.4, + particlesizespread = -1, + particlespeed = 1.66, + particlespeedspread = 2.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 55, + particlesize = 5, + particlesizespread = 8, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.2]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.1, + particlesizespread = 1.8, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.6]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.6, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 0, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.6]], + particlelife = 28, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 2, + particlespeed = 1.35, + particlespeedspread = 1.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0.7 0.3 1.0 0.017 0.6 0.25 0.9 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 10, + particlesize = 38, + particlesizespread = 34, + particlespeed = 4.95, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 0.88, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 4, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, +} diff --git a/effects/genericbuildingexplosion.lua b/effects/genericbuildingexplosion.lua index 9554e315d99..fdd2312d741 100644 --- a/effects/genericbuildingexplosion.lua +++ b/effects/genericbuildingexplosion.lua @@ -1,1392 +1,1390 @@ local root = "genericbuildingexplosion" local definitions = { - [root.."-small"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 2, - sizegrowth = 17, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.3 0 0 0 0.01]], - size = 110, - sizegrowth = -0.85, - ttl = 25, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], - size = 52, - sizegrowth = -3.9, - ttl = 14, - texture = [[groundflashwhite]], - }, - }, - --kickedupwater = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 80, - -- particlelife = 2, - -- particlelifespread = 30, - -- particlesize = 2, - -- particlesizespread = 1, - -- particlespeed = 10, - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.5, - -- sizemod = 1.0, - -- texture = [[wake]], - -- }, - --}, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0 0 0 0 1 0.85 0.6 0.10 0.9 0.45 0.16 0.066 0.64 0.30 0.04 0.033 0.01 0.01 0.01 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 9, - particlelife = 4, - particlelifespread = 9, - particlesize = 6, - particlesizespread = 8.8, - particlespeed = 2, - particlespeedspread = 3.75, - pos = [[0, 2, 0]], - sizegrowth = 0.35, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.3, - sizegrowth = [[-20 r8]], - ttl = 9.5, - pos = [[0, 10, 0]], - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.35 0.32 0.23 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 13, - particlelifespread = 0, - particlesize = 22, - particlesizespread = 4, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - fireglow2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.26 0.22 0.08 0.26 0.44 0.38 0.13 0.44 0.2 0.14 0 0.2 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 0, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 16, - particlelifespread = 0, - particlesize = 44, - particlesizespread = 2, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=25, - particleLifeSpread=70, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=7, - particleSizeSpread=15, - castShadow = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=50, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=11, - directional=0, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 5, - particlelife = 10, - particlelifespread = 15, - particlesize = 90, - particlesizespread = 130, - particlespeed = 2.4, - particlespeedspread = 4.55, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.75, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.94, - colormap = [[0.04 0.03 0.01 0 0.2 0.14 0.066 0.45 0.15 0.10 0.06 0.40 0.08 0.065 0.035 0.30 0.075 0.07 0.06 0.2 0 0 0 0 ]], - directional = false, - emitrot = 24, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 2, - particlelife = 14, - particlelifespread = 14, - particlesize = 1.9, - particlesizespread = -1.3, - particlespeed = 3.4, - particlespeedspread = 4.6, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.02, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 0, - castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 2, - particlelife = 33, - particlelifespread = 15, - particlesize = 1.5, - particlesizespread = -1.25, - particlespeed = 3, - particlespeedspread = 6.2, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 24, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[r1.25]], - particlelife = 28, - particlelifespread = 12, - particlesize = 2, - particlesizespread = 3, - particlespeed = 2.8, - particlespeedspread = 6.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1.35, 0.5]], - gravity = [[0, 0.03, 0]], - numparticles = 1, - particlelife = 30, - particlelifespread = 110, - particlesize = 45, - particlesizespread = 70, - particlespeed = 3, - particlespeedspread = 4, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - castShadow = true, - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 13, - particlelife = 10, - particlelifespread = 90, - particlesize = 5.2, - particlesizespread = 2.8, - particlespeed = 3.2, - particlespeedspread = 1.35, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 5, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - }, + [root .. "-small"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2, + sizegrowth = 17, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.3 0 0 0 0.01]], + size = 110, + sizegrowth = -0.85, + ttl = 25, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.93 0.90 0.5 0 0 0 0.01]], + size = 52, + sizegrowth = -3.9, + ttl = 14, + texture = [[groundflashwhite]], + }, + }, + --kickedupwater = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 80, + -- particlelife = 2, + -- particlelifespread = 30, + -- particlesize = 2, + -- particlesizespread = 1, + -- particlespeed = 10, + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.5, + -- sizemod = 1.0, + -- texture = [[wake]], + -- }, + --}, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0 0 0 0 1 0.85 0.6 0.10 0.9 0.45 0.16 0.066 0.64 0.30 0.04 0.033 0.01 0.01 0.01 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 9, + particlelife = 4, + particlelifespread = 9, + particlesize = 6, + particlesizespread = 8.8, + particlespeed = 2, + particlespeedspread = 3.75, + pos = [[0, 2, 0]], + sizegrowth = 0.35, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.3, + sizegrowth = [[-20 r8]], + ttl = 9.5, + pos = [[0, 10, 0]], + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.35 0.32 0.23 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 13, + particlelifespread = 0, + particlesize = 22, + particlesizespread = 4, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + fireglow2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.26 0.22 0.08 0.26 0.44 0.38 0.13 0.44 0.2 0.14 0 0.2 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 0, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 16, + particlelifespread = 0, + particlesize = 44, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 70, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 7, + particleSizeSpread = 15, + castShadow = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 50, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 15, + particlesize = 90, + particlesizespread = 130, + particlespeed = 2.4, + particlespeedspread = 4.55, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.75, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.94, + colormap = [[0.04 0.03 0.01 0 0.2 0.14 0.066 0.45 0.15 0.10 0.06 0.40 0.08 0.065 0.035 0.30 0.075 0.07 0.06 0.2 0 0 0 0 ]], + directional = false, + emitrot = 24, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 2, + particlelife = 14, + particlelifespread = 14, + particlesize = 1.9, + particlesizespread = -1.3, + particlespeed = 3.4, + particlespeedspread = 4.6, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.02, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 0, + castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 2, + particlelife = 33, + particlelifespread = 15, + particlesize = 1.5, + particlesizespread = -1.25, + particlespeed = 3, + particlespeedspread = 6.2, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 24, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[r1.25]], + particlelife = 28, + particlelifespread = 12, + particlesize = 2, + particlesizespread = 3, + particlespeed = 2.8, + particlespeedspread = 6.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1.35, 0.5]], + gravity = [[0, 0.03, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 110, + particlesize = 45, + particlesizespread = 70, + particlespeed = 3, + particlespeedspread = 4, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + castShadow = true, + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 13, + particlelife = 10, + particlelifespread = 90, + particlesize = 5.2, + particlesizespread = 2.8, + particlespeed = 3.2, + particlespeedspread = 1.35, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 5, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + }, } -- add different sizes -definitions[root] = definitions[root.."-small"] +definitions[root] = definitions[root .. "-small"] local sizes = { - tiny = { - centerflare = { - properties = { - size = 1.3, - sizegrowth = 11, - }, - }, - groundflash_large = { - properties = { - --colormap = [[1 0.7 0.3 0.24 0 0 0 0.01]], - size = 75, - ttl = 17, - }, - }, - groundflash_white = { - properties = { - --colormap = [[1 0.9 0.75 0.33 0 0 0 0.01]], - size = 55, - ttl = 11, - }, - }, - explosion = { - properties = { - numparticles = 6, - particlelifespread = 8, - particlesize = 3, - particlesizespread = 4, - particlespeed = 1.5, - particlespeedspread = 2.5, - }, + tiny = { + centerflare = { + properties = { + size = 1.3, + sizegrowth = 11, + }, + }, + groundflash_large = { + properties = { + --colormap = [[1 0.7 0.3 0.24 0 0 0 0.01]], + size = 75, + ttl = 17, + }, + }, + groundflash_white = { + properties = { + --colormap = [[1 0.9 0.75 0.33 0 0 0 0.01]], + size = 55, + ttl = 11, + }, + }, + explosion = { + properties = { + numparticles = 6, + particlelifespread = 8, + particlesize = 3, + particlesizespread = 4, + particlespeed = 1.5, + particlespeedspread = 2.5, + }, + }, + fireglow = { + properties = { + particlesize = 14, + particlelife = 11, + }, + }, + fireglow2 = { + properties = { + particlesize = 33, + particlelife = 14, + }, + }, + innersmoke = { + properties = { + particleLife = 20, + particleLifeSpread = 55, + numparticles = 3, + particleSpeed = 1.5, + particleSpeedSpread = 3.5, + particleSize = 6, + particleSizeSpread = 12, + }, + }, + outersmoke = { + properties = { + particleLife = 12, + particleLifeSpread = 38, + numparticles = 3, + particleSpeed = 1.8, + particleSpeedSpread = 4.2, + particleSize = 18, + particleSizeSpread = 9, + }, + }, + sparks = { + properties = { + numparticles = 3, + particlespeed = 1.96, + particlespeedspread = 4, + }, + }, + dirt = { + properties = { + numparticles = 1, + particlelifespread = 13, + particlespeed = 3, + particlespeedspread = 3.7, + }, + }, + dirt2 = { + properties = { + numparticles = 1, + particlelifespread = 17, + particlespeed = 2.8, + particlespeedspread = 4.4, + }, + }, + shard1 = { + properties = { + numparticles = [[1 r0.75]], + particlelife = 22, + particlesize = 1.8, + particlesizespread = 2.3, + particlespeed = 2.2, + particlespeedspread = 4.5, + }, + }, + shard2 = { + properties = { + numparticles = [[r1.25]], + particlelife = 22, + particlesize = 1.8, + particlesizespread = 2.3, + particlespeed = 2.2, + particlespeedspread = 4.5, + }, + }, + shard3 = { + properties = { + numparticles = [[r1.1]], + particlelife = 22, + particlesize = 1.8, + particlesizespread = 2.3, + particlespeed = 2.2, + particlespeedspread = 4.5, + }, + }, + clouddust = { + properties = { + numparticles = 1, + particlelifespread = 50, + particlesize = 33, + particlesizespread = 55, + }, + }, + grounddust = { + properties = { + numparticles = 10, + particlelifespread = 65, + particlesize = 4.1, + particlesizespread = 2.1, + particlespeed = 2.33, + particlespeedspread = 1, + }, + }, }, - fireglow = { - properties = { - particlesize = 14, - particlelife = 11, - }, - }, - fireglow2 = { - properties = { - particlesize = 33, - particlelife = 14, - }, - }, - innersmoke = { - properties = { - particleLife = 20, - particleLifeSpread = 55, - numparticles = 3, - particleSpeed = 1.5, - particleSpeedSpread = 3.5, - particleSize = 6, - particleSizeSpread = 12, - }, - }, - outersmoke = { - properties = { - particleLife = 12, - particleLifeSpread = 38, - numparticles = 3, - particleSpeed = 1.8, - particleSpeedSpread = 4.2, - particleSize = 18, - particleSizeSpread = 9, - }, - }, - sparks = { - properties = { - numparticles = 3, - particlespeed = 1.96, - particlespeedspread = 4, - }, - }, - dirt = { - properties = { - numparticles = 1, - particlelifespread = 13, - particlespeed = 3, - particlespeedspread = 3.7, - }, - }, - dirt2 = { - properties = { - numparticles = 1, - particlelifespread = 17, - particlespeed = 2.8, - particlespeedspread = 4.4, - }, - }, - shard1 = { - properties = { - numparticles = [[1 r0.75]], - particlelife = 22, - particlesize = 1.8, - particlesizespread = 2.3, - particlespeed = 2.2, - particlespeedspread = 4.5, - }, - }, - shard2 = { - properties = { - numparticles = [[r1.25]], - particlelife = 22, - particlesize = 1.8, - particlesizespread = 2.3, - particlespeed = 2.2, - particlespeedspread = 4.5, - }, - }, - shard3 = { - properties = { - numparticles = [[r1.1]], - particlelife = 22, - particlesize = 1.8, - particlesizespread = 2.3, - particlespeed = 2.2, - particlespeedspread = 4.5, - }, - }, - clouddust = { - properties = { - numparticles = 1, - particlelifespread = 50, - particlesize = 33, - particlesizespread = 55, - }, - }, - grounddust = { - properties = { - numparticles = 10, - particlelifespread = 65, - particlesize = 4.1, - particlesizespread = 2.1, - particlespeed = 2.33, - particlespeedspread = 1, - }, - }, - }, - - small = { - centerflare = { - properties = { - size = 2.5, - sizegrowth = 21, - }, - }, - explosion = { - properties = { - numparticles = 9, - particlelifespread = 12, - particlesize = 7, - particlesizespread = 12, - particlespeed = 2.4, - particlespeedspread = 7, - }, - }, - shockwavexplo = { - properties = { - size = 2.4, - sizegrowth = [[-21 r7.5]], - ttl = 10, - --pos = [[0, 10, 0]], - }, - }, - }, - - medium = { - centerflare = { - properties = { - size = 3, - sizegrowth = 23, - }, - }, - groundflash_large = { - properties = { - colormap = [[1 0.7 0.3 0.36 0 0 0 0.01]], - size = 188, - ttl = 34, - }, - }, - groundflash_white = { - properties = { - --colormap = [[1 0.93 0.9 0.6 1 0.91 0.85 0.23 0 0 0 0.01]], - size = 120, - sizegrowth = -4, - ttl = 24, - }, - }, - explosion = { - properties = { - numparticles = 12, - particlelifespread = 11, - particlesize = 6.5, - particlesizespread = 11, - particlespeed = 2.5, - particlespeedspread = 7, - }, + + small = { + centerflare = { + properties = { + size = 2.5, + sizegrowth = 21, + }, + }, + explosion = { + properties = { + numparticles = 9, + particlelifespread = 12, + particlesize = 7, + particlesizespread = 12, + particlespeed = 2.4, + particlespeedspread = 7, + }, + }, + shockwavexplo = { + properties = { + size = 2.4, + sizegrowth = [[-21 r7.5]], + ttl = 10, + --pos = [[0, 10, 0]], + }, + }, }, - shockwavexplo = { - properties = { - size = 2.7, - sizegrowth = [[-22 r8.5]], - ttl = 11, - --pos = [[0, 10, 0]], - }, - }, - fireglow = { - properties = { - particlesize = 33, - particlelife = 16, - }, - }, - fireglow2 = { - properties = { - particlesize = 64, - particlelife = 18, - }, - }, - innersmoke = { - properties = { - particleLife = 32, - particleLifeSpread = 80, - numparticles = 5, - particleSpeed = 3, - particleSpeedSpread = 7, - particleSize = 11, - particleSizeSpread = 20, - }, - }, - outersmoke = { - properties = { - particleLife = 24, - particleLifeSpread = 60, - numparticles = 4, - particleSpeed = 3.2, - particleSpeedSpread = 7.5, - particleSize = 26, - particleSizeSpread = 15, - }, - }, - sparks = { - properties = { - numparticles = 7, - particlespeed = 3.3, - particlespeedspread = 6, - particlesize = 100, - particlesizespread = 140, - }, - }, - dirt = { - properties = { - numparticles = 3, - particlelifespread = 40, - particlespeed = 3.7, - particlespeedspread = 4.7, - }, - }, - dirt2 = { - properties = { - numparticles = 3, - particlelifespread = 45, - particlespeed = 3.7, - particlespeedspread = 5.7, - }, - }, - shard1 = { - properties = { - numparticles = [[2 r2.25]], - particlelife = 40, - particlesize = 2.3, - particlesizespread = 3, - particlespeed = 4, - particlespeedspread = 8, - }, - }, - shard2 = { - properties = { - numparticles = [[2 r1.25]], - particlelife = 30, - particlesize = 2.3, - particlesizespread = 3, - particlespeed = 4, - particlespeedspread = 8, - }, - }, - shard3 = { - properties = { - numparticles = [[1 r1.25]], - particlelife = 25, - particlesize = 2.3, - particlesizespread = 3, - particlespeed = 4, - particlespeedspread = 8, - }, - }, - clouddust = { - properties = { - numparticles = 3, - particlelifespread = 130, - particlesize = 72, - particlesizespread = 95, - }, - }, - grounddust = { - properties = { - numparticles = 16, - particlelifespread = 90, - particlesize = 7, - particlesizespread = 3.3, - particlespeed = 4.75, - particlespeedspread = 1.75, - }, - }, - }, - - large = { - centerflare = { - properties = { - size = 4, - sizegrowth = 32, - }, - }, - groundflash_large = { - properties = { - colormap = [[1 0.7 0.3 0.38 0 0 0 0.01]], - size = 265, - ttl = 25, - }, - }, - groundflash_white = { - properties = { - --colormap = [[1 0.9 0.75 0.7 1 0.9 0.75 0.25 0 0 0 0.01]], - size = 144, - sizegrowth = -2.9, - ttl = 26, - }, - }, - explosion = { - properties = { - numparticles = 16, - particlelifespread = 13, - particlesize = 10, - particlesizespread = 14, - particlespeed = 3.8, - particlespeedspread = 9.5, - }, + + medium = { + centerflare = { + properties = { + size = 3, + sizegrowth = 23, + }, + }, + groundflash_large = { + properties = { + colormap = [[1 0.7 0.3 0.36 0 0 0 0.01]], + size = 188, + ttl = 34, + }, + }, + groundflash_white = { + properties = { + --colormap = [[1 0.93 0.9 0.6 1 0.91 0.85 0.23 0 0 0 0.01]], + size = 120, + sizegrowth = -4, + ttl = 24, + }, + }, + explosion = { + properties = { + numparticles = 12, + particlelifespread = 11, + particlesize = 6.5, + particlesizespread = 11, + particlespeed = 2.5, + particlespeedspread = 7, + }, + }, + shockwavexplo = { + properties = { + size = 2.7, + sizegrowth = [[-22 r8.5]], + ttl = 11, + --pos = [[0, 10, 0]], + }, + }, + fireglow = { + properties = { + particlesize = 33, + particlelife = 16, + }, + }, + fireglow2 = { + properties = { + particlesize = 64, + particlelife = 18, + }, + }, + innersmoke = { + properties = { + particleLife = 32, + particleLifeSpread = 80, + numparticles = 5, + particleSpeed = 3, + particleSpeedSpread = 7, + particleSize = 11, + particleSizeSpread = 20, + }, + }, + outersmoke = { + properties = { + particleLife = 24, + particleLifeSpread = 60, + numparticles = 4, + particleSpeed = 3.2, + particleSpeedSpread = 7.5, + particleSize = 26, + particleSizeSpread = 15, + }, + }, + sparks = { + properties = { + numparticles = 7, + particlespeed = 3.3, + particlespeedspread = 6, + particlesize = 100, + particlesizespread = 140, + }, + }, + dirt = { + properties = { + numparticles = 3, + particlelifespread = 40, + particlespeed = 3.7, + particlespeedspread = 4.7, + }, + }, + dirt2 = { + properties = { + numparticles = 3, + particlelifespread = 45, + particlespeed = 3.7, + particlespeedspread = 5.7, + }, + }, + shard1 = { + properties = { + numparticles = [[2 r2.25]], + particlelife = 40, + particlesize = 2.3, + particlesizespread = 3, + particlespeed = 4, + particlespeedspread = 8, + }, + }, + shard2 = { + properties = { + numparticles = [[2 r1.25]], + particlelife = 30, + particlesize = 2.3, + particlesizespread = 3, + particlespeed = 4, + particlespeedspread = 8, + }, + }, + shard3 = { + properties = { + numparticles = [[1 r1.25]], + particlelife = 25, + particlesize = 2.3, + particlesizespread = 3, + particlespeed = 4, + particlespeedspread = 8, + }, + }, + clouddust = { + properties = { + numparticles = 3, + particlelifespread = 130, + particlesize = 72, + particlesizespread = 95, + }, + }, + grounddust = { + properties = { + numparticles = 16, + particlelifespread = 90, + particlesize = 7, + particlesizespread = 3.3, + particlespeed = 4.75, + particlespeedspread = 1.75, + }, + }, }, - shockwavexplo = { - properties = { - size = 3.8, - sizegrowth = [[-28 r12]], - ttl = 11, - pos = [[0, 20, 0]], - }, - }, - fireglow = { - properties = { - particlesize = 53, - particlelife = 17, - }, - }, - fireglow2 = { - properties = { - particlesize = 105, - particlelife = 19, - }, - }, - innersmoke = { - properties = { - particleLife = 40, - particleLifeSpread = 100, - numparticles = 6, - particleSpeed = 3, - particleSpeedSpread = 10, - particleSize = 18, - particleSizeSpread = 25, - }, - }, - outersmoke = { - properties = { - particleLife = 32, - particleLifeSpread = 80, - numparticles = 4, - particleSpeed = 3.2, - particleSpeedSpread = 10.5, - particleSize = 40, - particleSizeSpread = 28, - }, - }, - sparks = { - properties = { - numparticles = 10, - particlespeed = 3.75, - particlespeedspread = 6.8, - particlesize = 110, - particlesizespread = 150, - }, - }, - dirt = { - properties = { - numparticles = 4, - particlelifespread = 50, - particlespeed = 5.5, - particlespeedspread = 6.2, - }, - }, - dirt2 = { - properties = { - numparticles = 4, - particlelifespread = 55, - particlespeed = 5.75, - particlespeedspread = 7.5, - }, - }, - shard1 = { - properties = { - numparticles = [[3 r2]], - particlelife = 50, - particlesize = 2.5, - particlesizespread = 4.5, - particlespeed = 5.6, - particlespeedspread = 10.5, - }, - }, - shard2 = { - properties = { - numparticles = [[2 r1.4]], - particlelife = 40, - particlesize = 2.5, - particlesizespread = 4.5, - particlespeed = 5.2, - particlespeedspread = 10.5, - }, - }, - shard3 = { - properties = { - numparticles = [[1 r1.2]], - particlelife = 45, - particlesize = 2.5, - particlesizespread = 4.5, - particlespeed = 5.2, - particlespeedspread = 10.5, - }, - }, - clouddust = { - properties = { - numparticles = 4, - particlelifespread = 160, - particlesize = 85, - particlesizespread = 90, - }, - }, - grounddust = { - properties = { - numparticles = 22, - particlelifespread = 115, - particlesize = 10, - particlesizespread = 5, - particlespeed = 6.7, - particlespeedspread = 3.3, - }, - }, - }, - huge = { - centerflare = { - properties = { - size = 5.5, - sizegrowth = 40, - }, - }, - groundflash_large = { - properties = { - colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], - size = 330, - ttl = 30, - }, - }, - groundflash_white = { - properties = { - --colormap = [[1 0.9 0.75 0.7 1 0.9 0.75 0.25 0 0 0 0.01]], - size = 230, - sizegrowth = -1.5, - ttl = 28, - }, - }, - explosion = { - properties = { - numparticles = 20, - particlelifespread = 15, - particlesize = 13, - particlesizespread = 20, - particlespeed = 5.5, - particlespeedspread = 10, - }, - }, - shockwavexplo = { - properties = { - size = 4.4, - sizegrowth = [[-28 r15]], - ttl = 12.75, - pos = [[0, 25, 0]], - }, - }, - fireglow = { - properties = { - particlesize = 75, - particlelife = 19, - }, - }, - fireglow2 = { - properties = { - particlesize = 150, - particlelife = 21, - }, - }, - innersmoke = { - properties = { - particleLife = 45, - particleLifeSpread = 125, - numparticles = 7, - particleSpeed = 3.2, - particleSpeedSpread = 13, - particleSize = 20, - particleSizeSpread = 30, - }, - }, - outersmoke = { - properties = { - particleLife = 35, - particleLifeSpread = 100, - numparticles = 5, - particleSpeed = 3.4, - particleSpeedSpread = 14, - particleSize = 38, - particleSizeSpread = 30, - }, - }, - sparks = { - properties = { - numparticles = 10, - particlespeed = 4.2, - particlespeedspread = 8, - particlesize = 120, - particlesizespread = 160, - }, - }, - -- dirt = { - -- properties = { - -- numparticles = 5, - -- particlelifespread = 55, - -- particlespeed = 7, - -- particlespeedspread = 7.7, - -- } - -- }, - dirt = { - properties = { - numparticles = 5, - particlelifespread = 10, - particlespeed = 4, - particlespeedspread = 6, - particlesize = 25, - particlesizespread = 50, - }, - }, - dirt2 = { - properties = { - numparticles = 4, - particlelifespread = 60, - particlespeed = 7.5, - particlespeedspread = 10.3, - }, - }, - shard1 = { - properties = { - numparticles = [[3 r3]], - particlelife = 55, - particlesize = 3, - particlesizespread = 5, - particlespeed = 6.5, - particlespeedspread = 15, - }, - }, - shard2 = { - properties = { - numparticles = [[2 r2]], - particlelife = 45, - particlesize = 3, - particlesizespread = 5, - particlespeed = 6.5, - particlespeedspread = 15, - }, - }, - shard3 = { - properties = { - numparticles = [[1 r2]], - particlelife = 50, - particlesize = 3, - particlesizespread = 5, - particlespeed = 6.5, - particlespeedspread = 15, - }, - }, - clouddust = { - properties = { - numparticles = 5, - particlelifespread = 180, - particlesize = 100, - particlesizespread = 100, - }, - }, - grounddust = { - properties = { - numparticles = 24, - particlelifespread = 130, - particlesize = 14, - particlesizespread = 5.5, - particlespeed = 11, - particlespeedspread = 4.4, - }, - }, - }, + large = { + centerflare = { + properties = { + size = 4, + sizegrowth = 32, + }, + }, + groundflash_large = { + properties = { + colormap = [[1 0.7 0.3 0.38 0 0 0 0.01]], + size = 265, + ttl = 25, + }, + }, + groundflash_white = { + properties = { + --colormap = [[1 0.9 0.75 0.7 1 0.9 0.75 0.25 0 0 0 0.01]], + size = 144, + sizegrowth = -2.9, + ttl = 26, + }, + }, + explosion = { + properties = { + numparticles = 16, + particlelifespread = 13, + particlesize = 10, + particlesizespread = 14, + particlespeed = 3.8, + particlespeedspread = 9.5, + }, + }, + shockwavexplo = { + properties = { + size = 3.8, + sizegrowth = [[-28 r12]], + ttl = 11, + pos = [[0, 20, 0]], + }, + }, + fireglow = { + properties = { + particlesize = 53, + particlelife = 17, + }, + }, + fireglow2 = { + properties = { + particlesize = 105, + particlelife = 19, + }, + }, + innersmoke = { + properties = { + particleLife = 40, + particleLifeSpread = 100, + numparticles = 6, + particleSpeed = 3, + particleSpeedSpread = 10, + particleSize = 18, + particleSizeSpread = 25, + }, + }, + outersmoke = { + properties = { + particleLife = 32, + particleLifeSpread = 80, + numparticles = 4, + particleSpeed = 3.2, + particleSpeedSpread = 10.5, + particleSize = 40, + particleSizeSpread = 28, + }, + }, + sparks = { + properties = { + numparticles = 10, + particlespeed = 3.75, + particlespeedspread = 6.8, + particlesize = 110, + particlesizespread = 150, + }, + }, + dirt = { + properties = { + numparticles = 4, + particlelifespread = 50, + particlespeed = 5.5, + particlespeedspread = 6.2, + }, + }, + dirt2 = { + properties = { + numparticles = 4, + particlelifespread = 55, + particlespeed = 5.75, + particlespeedspread = 7.5, + }, + }, + shard1 = { + properties = { + numparticles = [[3 r2]], + particlelife = 50, + particlesize = 2.5, + particlesizespread = 4.5, + particlespeed = 5.6, + particlespeedspread = 10.5, + }, + }, + shard2 = { + properties = { + numparticles = [[2 r1.4]], + particlelife = 40, + particlesize = 2.5, + particlesizespread = 4.5, + particlespeed = 5.2, + particlespeedspread = 10.5, + }, + }, + shard3 = { + properties = { + numparticles = [[1 r1.2]], + particlelife = 45, + particlesize = 2.5, + particlesizespread = 4.5, + particlespeed = 5.2, + particlespeedspread = 10.5, + }, + }, + clouddust = { + properties = { + numparticles = 4, + particlelifespread = 160, + particlesize = 85, + particlesizespread = 90, + }, + }, + grounddust = { + properties = { + numparticles = 22, + particlelifespread = 115, + particlesize = 10, + particlesizespread = 5, + particlespeed = 6.7, + particlespeedspread = 3.3, + }, + }, + }, + + huge = { + centerflare = { + properties = { + size = 5.5, + sizegrowth = 40, + }, + }, + groundflash_large = { + properties = { + colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], + size = 330, + ttl = 30, + }, + }, + groundflash_white = { + properties = { + --colormap = [[1 0.9 0.75 0.7 1 0.9 0.75 0.25 0 0 0 0.01]], + size = 230, + sizegrowth = -1.5, + ttl = 28, + }, + }, + explosion = { + properties = { + numparticles = 20, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 20, + particlespeed = 5.5, + particlespeedspread = 10, + }, + }, + shockwavexplo = { + properties = { + size = 4.4, + sizegrowth = [[-28 r15]], + ttl = 12.75, + pos = [[0, 25, 0]], + }, + }, + fireglow = { + properties = { + particlesize = 75, + particlelife = 19, + }, + }, + fireglow2 = { + properties = { + particlesize = 150, + particlelife = 21, + }, + }, + innersmoke = { + properties = { + particleLife = 45, + particleLifeSpread = 125, + numparticles = 7, + particleSpeed = 3.2, + particleSpeedSpread = 13, + particleSize = 20, + particleSizeSpread = 30, + }, + }, + outersmoke = { + properties = { + particleLife = 35, + particleLifeSpread = 100, + numparticles = 5, + particleSpeed = 3.4, + particleSpeedSpread = 14, + particleSize = 38, + particleSizeSpread = 30, + }, + }, + sparks = { + properties = { + numparticles = 10, + particlespeed = 4.2, + particlespeedspread = 8, + particlesize = 120, + particlesizespread = 160, + }, + }, + -- dirt = { + -- properties = { + -- numparticles = 5, + -- particlelifespread = 55, + -- particlespeed = 7, + -- particlespeedspread = 7.7, + -- } + -- }, + dirt = { + properties = { + numparticles = 5, + particlelifespread = 10, + particlespeed = 4, + particlespeedspread = 6, + particlesize = 25, + particlesizespread = 50, + }, + }, + dirt2 = { + properties = { + numparticles = 4, + particlelifespread = 60, + particlespeed = 7.5, + particlespeedspread = 10.3, + }, + }, + shard1 = { + properties = { + numparticles = [[3 r3]], + particlelife = 55, + particlesize = 3, + particlesizespread = 5, + particlespeed = 6.5, + particlespeedspread = 15, + }, + }, + shard2 = { + properties = { + numparticles = [[2 r2]], + particlelife = 45, + particlesize = 3, + particlesizespread = 5, + particlespeed = 6.5, + particlespeedspread = 15, + }, + }, + shard3 = { + properties = { + numparticles = [[1 r2]], + particlelife = 50, + particlesize = 3, + particlesizespread = 5, + particlespeed = 6.5, + particlespeedspread = 15, + }, + }, + clouddust = { + properties = { + numparticles = 5, + particlelifespread = 180, + particlesize = 100, + particlesizespread = 100, + }, + }, + grounddust = { + properties = { + numparticles = 24, + particlelifespread = 130, + particlesize = 14, + particlesizespread = 5.5, + particlespeed = 11, + particlespeedspread = 4.4, + }, + }, + }, - gigantic = { - centerflare = { - properties = { - size = 5.5, - sizegrowth = 40, - }, - }, - groundflash_large = { - properties = { - colormap = [[1 0.7 0.3 0.43 0 0 0 0.01]], - size = 430, - ttl = 33, - }, - }, - groundflash_white = { - properties = { - --colormap = [[1 0.9 0.75 0.75 1 0.9 0.75 0.25 0 0 0 0.01]], - size = 285, - sizegrowth = -1.5, - ttl = 30, - }, - }, - explosion = { - properties = { - numparticles = 24, - particlelifespread = 17, - particlesize = 18, - particlesizespread = 24, - particlespeed = 7.5, - particlespeedspread = 11.5, - }, - }, - fireglow = { - properties = { - particlesize = 90, - particlelife = 21, - }, - }, - fireglow2 = { - properties = { - particlesize = 190, - particlelife = 23, - }, - }, - innersmoke = { - properties = { - particleLife = 65, - particleLifeSpread = 150, - numparticles = 8, - particleSpeed = 3.6, - particleSpeedSpread = 16, - particleSize = 26, - particleSizeSpread = 34, - }, - }, - outersmoke = { - properties = { - particleLife = 45, - particleLifeSpread = 120, - numparticles = 6, - particleSpeed = 4, - particleSpeedSpread = 19, - particleSize = 45, - particleSizeSpread = 32, - }, - }, - sparks = { - properties = { - numparticles = 10, - particlespeed = 6.5, - particlespeedspread = 9, - }, - }, - dirt = { - properties = { - numparticles = 6, - particlelifespread = 30, - particlespeed = 9, - particlespeedspread = 11, - particlesize = 70, - particlesizespread = 130, - }, - }, - dirt2 = { - properties = { - numparticles = 4, - particlelifespread = 65, - particlespeed = 10.6, - particlespeedspread = 14.5, - }, - }, - shard1 = { - properties = { - numparticles = [[3 r3.5]], - particlelife = 55, - particlesize = 3.4, - particlesizespread = 6, - particlespeed = 8, - particlespeedspread = 15.5, - }, - }, - shard2 = { - properties = { - numparticles = [[3 r2]], - particlelife = 55, - particlesize = 3.4, - particlesizespread = 6, - particlespeed = 8, - particlespeedspread = 15.5, - }, - }, - shard3 = { - properties = { - numparticles = [[2 r2]], - particlelife = 55, - particlesize = 3.4, - particlesizespread = 6, - particlespeed = 8, - particlespeedspread = 15.5, - }, - }, - clouddust = { - properties = { - numparticles = 8, - particlelifespread = 200, - particlesize = 120, - particlesizespread = 120, - }, - }, - grounddust = { - properties = { - numparticles = 28, - particlelifespread = 130, - particlesize = 15, - particlesizespread = 7, - particlespeed = 15, - particlespeedspread = 6, - } - }, - }, + gigantic = { + centerflare = { + properties = { + size = 5.5, + sizegrowth = 40, + }, + }, + groundflash_large = { + properties = { + colormap = [[1 0.7 0.3 0.43 0 0 0 0.01]], + size = 430, + ttl = 33, + }, + }, + groundflash_white = { + properties = { + --colormap = [[1 0.9 0.75 0.75 1 0.9 0.75 0.25 0 0 0 0.01]], + size = 285, + sizegrowth = -1.5, + ttl = 30, + }, + }, + explosion = { + properties = { + numparticles = 24, + particlelifespread = 17, + particlesize = 18, + particlesizespread = 24, + particlespeed = 7.5, + particlespeedspread = 11.5, + }, + }, + fireglow = { + properties = { + particlesize = 90, + particlelife = 21, + }, + }, + fireglow2 = { + properties = { + particlesize = 190, + particlelife = 23, + }, + }, + innersmoke = { + properties = { + particleLife = 65, + particleLifeSpread = 150, + numparticles = 8, + particleSpeed = 3.6, + particleSpeedSpread = 16, + particleSize = 26, + particleSizeSpread = 34, + }, + }, + outersmoke = { + properties = { + particleLife = 45, + particleLifeSpread = 120, + numparticles = 6, + particleSpeed = 4, + particleSpeedSpread = 19, + particleSize = 45, + particleSizeSpread = 32, + }, + }, + sparks = { + properties = { + numparticles = 10, + particlespeed = 6.5, + particlespeedspread = 9, + }, + }, + dirt = { + properties = { + numparticles = 6, + particlelifespread = 30, + particlespeed = 9, + particlespeedspread = 11, + particlesize = 70, + particlesizespread = 130, + }, + }, + dirt2 = { + properties = { + numparticles = 4, + particlelifespread = 65, + particlespeed = 10.6, + particlespeedspread = 14.5, + }, + }, + shard1 = { + properties = { + numparticles = [[3 r3.5]], + particlelife = 55, + particlesize = 3.4, + particlesizespread = 6, + particlespeed = 8, + particlespeedspread = 15.5, + }, + }, + shard2 = { + properties = { + numparticles = [[3 r2]], + particlelife = 55, + particlesize = 3.4, + particlesizespread = 6, + particlespeed = 8, + particlespeedspread = 15.5, + }, + }, + shard3 = { + properties = { + numparticles = [[2 r2]], + particlelife = 55, + particlesize = 3.4, + particlesizespread = 6, + particlespeed = 8, + particlespeedspread = 15.5, + }, + }, + clouddust = { + properties = { + numparticles = 8, + particlelifespread = 200, + particlesize = 120, + particlesizespread = 120, + }, + }, + grounddust = { + properties = { + numparticles = 28, + particlelifespread = 130, + particlesize = 15, + particlesizespread = 7, + particlespeed = 15, + particlespeedspread = 6, + }, + }, + }, } for size, effects in pairs(sizes) do - definitions[root.."-"..size] = table.merge(definitions[root.."-small"], effects) + definitions[root .. "-" .. size] = table.merge(definitions[root .. "-small"], effects) end -definitions[root..'-wind'] = table.copy(definitions[root.."-small"]) -definitions[root..'-wind'].clouddust.properties.numparticles = definitions[root..'-wind'].clouddust.properties.numparticles / 3 -definitions[root..'-wind'].grounddust.properties.numparticles = definitions[root..'-wind'].grounddust.properties.numparticles / 3 -definitions[root..'-wind'].dirt.properties.numparticles = definitions[root..'-wind'].dirt.properties.numparticles / 2 -definitions[root..'-wind'].dirt2.properties.numparticles = definitions[root..'-wind'].dirt2.properties.numparticles / 2 -definitions[root..'-wind'].sparks.properties.numparticles = definitions[root..'-wind'].sparks.properties.numparticles / 2 +definitions[root .. "-wind"] = table.copy(definitions[root .. "-small"]) +definitions[root .. "-wind"].clouddust.properties.numparticles = definitions[root .. "-wind"].clouddust.properties.numparticles / 3 +definitions[root .. "-wind"].grounddust.properties.numparticles = definitions[root .. "-wind"].grounddust.properties.numparticles / 3 +definitions[root .. "-wind"].dirt.properties.numparticles = definitions[root .. "-wind"].dirt.properties.numparticles / 2 +definitions[root .. "-wind"].dirt2.properties.numparticles = definitions[root .. "-wind"].dirt2.properties.numparticles / 2 +definitions[root .. "-wind"].sparks.properties.numparticles = definitions[root .. "-wind"].sparks.properties.numparticles / 2 -definitions[root..'-nano'] = table.copy(definitions[root.."-wind"]) +definitions[root .. "-nano"] = table.copy(definitions[root .. "-wind"]) --definitions[root..'-nano'].explosion.properties.colormap = [[0 0 0 0 0.92 1 0.7 0.08 0.77 0.9 0.21 0.06 0.57 0.66 0.04 0.03 0 0 0 0.01]] --definitions[root..'-nano'].fireglow.properties.colormap = [[0.15 0.14 0.1 0.005 0 0 0 0.01]] --definitions[root..'-nano'].fireglow2.properties.colormap = [[0.26 0.24 0.08 0.26 0.36 0.44 0.13 0.44 0.15 0.2 0 0.2 0 0 0 0.01]] --definitions[root..'-nano'].sparks.properties.colormap = [[0.85 0.95 0.77 0.017 0.6 0.9 0.3 0.011 0 0 0 0]] -definitions[root..'-nano'].sparks.properties.numparticles = definitions[root..'-nano'].sparks.properties.numparticles * 1.5 +definitions[root .. "-nano"].sparks.properties.numparticles = definitions[root .. "-nano"].sparks.properties.numparticles * 1.5 --definitions[root..'-nano'].dirt.properties.colormap = [[0.8 1 0.4 0.1 0 0 0 0.01]] --definitions[root..'-nano'].dirt2.properties.colormap = [[0.7 1 0.3 0.1 0 0 0 0.01]] -definitions[root..'-metalmaker'] = table.copy(definitions[root.."-medium"]) -definitions[root..'-metalmaker'].clouddust.properties.numparticles = definitions[root..'-metalmaker'].clouddust.properties.numparticles / 3 -definitions[root..'-metalmaker'].grounddust.properties.numparticles = definitions[root..'-metalmaker'].grounddust.properties.numparticles / 3 -definitions[root..'-metalmaker'].dirt.properties.numparticles = definitions[root..'-metalmaker'].dirt.properties.numparticles / 2 -definitions[root..'-metalmaker'].dirt2.properties.numparticles = definitions[root..'-metalmaker'].dirt2.properties.numparticles / 2 -definitions[root..'-metalmaker'].sparks.properties.numparticles = definitions[root..'-metalmaker'].sparks.properties.numparticles / 2 +definitions[root .. "-metalmaker"] = table.copy(definitions[root .. "-medium"]) +definitions[root .. "-metalmaker"].clouddust.properties.numparticles = definitions[root .. "-metalmaker"].clouddust.properties.numparticles / 3 +definitions[root .. "-metalmaker"].grounddust.properties.numparticles = definitions[root .. "-metalmaker"].grounddust.properties.numparticles / 3 +definitions[root .. "-metalmaker"].dirt.properties.numparticles = definitions[root .. "-metalmaker"].dirt.properties.numparticles / 2 +definitions[root .. "-metalmaker"].dirt2.properties.numparticles = definitions[root .. "-metalmaker"].dirt2.properties.numparticles / 2 +definitions[root .. "-metalmaker"].sparks.properties.numparticles = definitions[root .. "-metalmaker"].sparks.properties.numparticles / 2 -definitions[root..'-metalmakerselfd'] = table.copy(definitions[root.."-large"]) -definitions[root..'-metalmakerselfd'].clouddust.properties.numparticles = definitions[root..'-metalmakerselfd'].clouddust.properties.numparticles / 3 -definitions[root..'-metalmakerselfd'].grounddust.properties.numparticles = definitions[root..'-metalmakerselfd'].grounddust.properties.numparticles / 3 -definitions[root..'-metalmakerselfd'].dirt.properties.numparticles = definitions[root..'-metalmakerselfd'].dirt.properties.numparticles / 2 -definitions[root..'-metalmakerselfd'].dirt2.properties.numparticles = definitions[root..'-metalmakerselfd'].dirt2.properties.numparticles / 2 -definitions[root..'-metalmakerselfd'].sparks.properties.numparticles = definitions[root..'-metalmakerselfd'].sparks.properties.numparticles / 2 +definitions[root .. "-metalmakerselfd"] = table.copy(definitions[root .. "-large"]) +definitions[root .. "-metalmakerselfd"].clouddust.properties.numparticles = definitions[root .. "-metalmakerselfd"].clouddust.properties.numparticles / 3 +definitions[root .. "-metalmakerselfd"].grounddust.properties.numparticles = definitions[root .. "-metalmakerselfd"].grounddust.properties.numparticles / 3 +definitions[root .. "-metalmakerselfd"].dirt.properties.numparticles = definitions[root .. "-metalmakerselfd"].dirt.properties.numparticles / 2 +definitions[root .. "-metalmakerselfd"].dirt2.properties.numparticles = definitions[root .. "-metalmakerselfd"].dirt2.properties.numparticles / 2 +definitions[root .. "-metalmakerselfd"].sparks.properties.numparticles = definitions[root .. "-metalmakerselfd"].sparks.properties.numparticles / 2 -definitions[root..'-advmetalmaker'] = table.copy(definitions[root.."-metalmakerselfd"]) +definitions[root .. "-advmetalmaker"] = table.copy(definitions[root .. "-metalmakerselfd"]) -definitions[root..'-advmetalmakerselfd'] = table.copy(definitions[root.."-huge"]) -definitions[root..'-advmetalmakerselfd'].clouddust.properties.numparticles = definitions[root..'-advmetalmakerselfd'].clouddust.properties.numparticles / 3 -definitions[root..'-advmetalmakerselfd'].grounddust.properties.numparticles = definitions[root..'-advmetalmakerselfd'].grounddust.properties.numparticles / 3 -definitions[root..'-advmetalmakerselfd'].dirt.properties.numparticles = definitions[root..'-advmetalmakerselfd'].dirt.properties.numparticles / 2 -definitions[root..'-advmetalmakerselfd'].dirt2.properties.numparticles = definitions[root..'-advmetalmakerselfd'].dirt2.properties.numparticles / 2 -definitions[root..'-advmetalmakerselfd'].sparks.properties.numparticles = definitions[root..'-advmetalmakerselfd'].sparks.properties.numparticles / 2 +definitions[root .. "-advmetalmakerselfd"] = table.copy(definitions[root .. "-huge"]) +definitions[root .. "-advmetalmakerselfd"].clouddust.properties.numparticles = definitions[root .. "-advmetalmakerselfd"].clouddust.properties.numparticles / 3 +definitions[root .. "-advmetalmakerselfd"].grounddust.properties.numparticles = definitions[root .. "-advmetalmakerselfd"].grounddust.properties.numparticles / 3 +definitions[root .. "-advmetalmakerselfd"].dirt.properties.numparticles = definitions[root .. "-advmetalmakerselfd"].dirt.properties.numparticles / 2 +definitions[root .. "-advmetalmakerselfd"].dirt2.properties.numparticles = definitions[root .. "-advmetalmakerselfd"].dirt2.properties.numparticles / 2 +definitions[root .. "-advmetalmakerselfd"].sparks.properties.numparticles = definitions[root .. "-advmetalmakerselfd"].sparks.properties.numparticles / 2 -definitions['genericshellexplosion-meteor'] = table.copy(definitions[root.."-huge"]) -definitions['genericshellexplosion-meteor'].groundflash_large.alwaysvisible = true -definitions['genericshellexplosion-meteor'].groundflash_white.alwaysvisible = true -definitions['genericshellexplosion-meteor'].explosion.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].explosion.properties.particlespeed = 1.5 -definitions['genericshellexplosion-meteor'].explosion.properties.particlespeedspread = 11 -definitions['genericshellexplosion-meteor'].centerflare.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].sparks.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].innersmoke.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].outersmoke.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].dirt.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].dirt2.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].shard1 = nil -definitions['genericshellexplosion-meteor'].shard2 = nil -definitions['genericshellexplosion-meteor'].shard3 = nil -definitions['genericshellexplosion-meteor'].grounddust.properties.alwaysvisible = true -definitions['genericshellexplosion-meteor'].clouddust = nil +definitions["genericshellexplosion-meteor"] = table.copy(definitions[root .. "-huge"]) +definitions["genericshellexplosion-meteor"].groundflash_large.alwaysvisible = true +definitions["genericshellexplosion-meteor"].groundflash_white.alwaysvisible = true +definitions["genericshellexplosion-meteor"].explosion.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].explosion.properties.particlespeed = 1.5 +definitions["genericshellexplosion-meteor"].explosion.properties.particlespeedspread = 11 +definitions["genericshellexplosion-meteor"].centerflare.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].sparks.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].innersmoke.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].outersmoke.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].dirt.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].dirt2.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].shard1 = nil +definitions["genericshellexplosion-meteor"].shard2 = nil +definitions["genericshellexplosion-meteor"].shard3 = nil +definitions["genericshellexplosion-meteor"].grounddust.properties.alwaysvisible = true +definitions["genericshellexplosion-meteor"].clouddust = nil --definitions['genericshellexplosion-meteor'].groundclouddust.properties.alwaysvisible = true --definitions['genericshellexplosion-meteor'].kickedupwater.properties.alwaysvisible = true - local types = { - uw = { - groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - explosion = {ground=false, water=false, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]]}}, - dirt = false, - dirt2 = false, - sparks = false, - }, + uw = { + groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + explosion = { ground = false, water = false, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]] } }, + dirt = false, + dirt2 = false, + sparks = false, + }, } for t, effects in pairs(types) do - for size, _ in pairs(sizes) do - definitions[root.."-"..size.."-"..t] = table.merge(definitions[root.."-"..size], effects) - end + for size, _ in pairs(sizes) do + definitions[root .. "-" .. size .. "-" .. t] = table.merge(definitions[root .. "-" .. size], effects) + end end - -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - groundflash_large = { - properties = { - colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], - }, - }, - groundflash_white = { - properties = { - colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], - }, - }, - explosion = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], - }, - }, - fireglow = { - properties = { - colormap = [[0.29 0.2 0.35 0.01 0 0 0 0.01]], - }, - }, - fireglow2 = { - properties = { - colormap = [[0.21 0.08 0.26 0.26 0.35 0.12 0.44 0.44 0.14 0 0.2 0.2 0 0 0 0.01]], - }, - }, - innersmoke = { - properties = { - colormap=[[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], - }, - }, - outersmoke = { - properties = { - colormap=[[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], - }, - }, - sparks = { - properties = { - colormap=[[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], - }, - }, - dustparticles = { - properties = { - colormap=[[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], - }, - }, + groundflash_large = { + properties = { + colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], + }, + }, + groundflash_white = { + properties = { + colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], + }, + }, + explosion = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], + }, + }, + fireglow = { + properties = { + colormap = [[0.29 0.2 0.35 0.01 0 0 0 0.01]], + }, + }, + fireglow2 = { + properties = { + colormap = [[0.21 0.08 0.26 0.26 0.35 0.12 0.44 0.44 0.14 0 0.2 0.2 0 0 0 0.01]], + }, + }, + innersmoke = { + properties = { + colormap = [[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], + }, + }, + outersmoke = { + properties = { + colormap = [[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], + }, + }, + sparks = { + properties = { + colormap = [[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], + }, + }, + dustparticles = { + properties = { + colormap = [[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/genericshellexplosion-lightning.lua b/effects/genericshellexplosion-lightning.lua index 5d424325804..a5e1c589ee5 100644 --- a/effects/genericshellexplosion-lightning.lua +++ b/effects/genericshellexplosion-lightning.lua @@ -4,1719 +4,1711 @@ local definitions = { - ["genericshellexplosion-small-lightning"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.8, - colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 6, - particlelife = 7, - particlelifespread = 1, - particlesize = 8, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 1.5, - pos = [[0, 2, 0]], - sizegrowth = 1, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.6, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 2, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r70]], - -- explosiongenerator = [[custom:lightning_stormbolt]], - -- pos = [[-40 r60, 1, -40 r60]], - -- }, - -- }, - groundflash = { - air = true, - flashalpha = 0.18, - flashsize = 50, - ground = true, - ttl = 20, - water = true, - underwater = true, - color = { - [1] = 0, - [2] = 0.4, - [3] = 1, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 5, - particlelife = 3, - particlelifespread = 24, - particlesize = 0.8, - particlesizespread = 1.4, - particlespeed = 0.8, - particlespeedspread = 3.5, - pos = [[0, 1, 0]], - sizegrowth = 0.4, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.6, - maxheat = 14, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - }, - }, - }, + ["genericshellexplosion-small-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 6, + particlelife = 7, + particlelifespread = 1, + particlesize = 8, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 1.5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.6, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 2, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r70]], + -- explosiongenerator = [[custom:lightning_stormbolt]], + -- pos = [[-40 r60, 1, -40 r60]], + -- }, + -- }, + groundflash = { + air = true, + flashalpha = 0.18, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.4, + [3] = 1, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 5, + particlelife = 3, + particlelifespread = 24, + particlesize = 0.8, + particlesizespread = 1.4, + particlespeed = 0.8, + particlespeedspread = 3.5, + pos = [[0, 1, 0]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.6, + maxheat = 14, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + ["genericshellexplosion-medium-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + colormap = [[0.7 0.7 0.9 0.037 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 7, + particlelifespread = 1, + particlesize = 2, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 4, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 2, 0]], + sizegrowth = 0.75, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r70]], + -- explosiongenerator = [[custom:lightning_stormbolt]], + -- pos = [[-55 r70, 1, -55 r70]], + -- }, + -- }, + groundflash = { + air = true, + flashalpha = 0.13, + flashsize = 80, + ground = true, + ttl = 45, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.4, + [3] = 1, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.07, 0]], + numparticles = 4, + particlelife = 3, + particlelifespread = 26, + particlesize = 0.5, + particlesizespread = 1.5, + particlespeed = 0.5, + particlespeedspread = 7.5, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = 0.22, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 8, + heatfalloff = 1.7, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, - ["genericshellexplosion-medium-lightning"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.8, - colormap = [[0.7 0.7 0.9 0.037 0.5 0.5 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 8, - particlelife = 7, - particlelifespread = 1, - particlesize = 2, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 4, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 2, 0]], - sizegrowth = 0.75, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 7, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r70]], - -- explosiongenerator = [[custom:lightning_stormbolt]], - -- pos = [[-55 r70, 1, -55 r70]], - -- }, - -- }, - groundflash = { - air = true, - flashalpha = 0.13, - flashsize = 80, - ground = true, - ttl = 45, - water = true, - underwater = true, - color = { - [1] = 0, - [2] = 0.4, - [3] = 1, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.07, 0]], - numparticles = 4, - particlelife = 3, - particlelifespread = 26, - particlesize = 0.5, - particlesizespread = 1.5, - particlespeed = 0.5, - particlespeedspread = 7.5, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = 0.22, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 8, - heatfalloff = 1.7, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - }, - }, - }, + ["genericshellexplosion-medium-lightning2"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0.65 0.7 0.9 0.037 0.5 0.6 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 0, 0]], + gravity = [[0, -0.01, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 7, + particlelifespread = 1, + particlesize = 3, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 3.3, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 2, 0]], + sizegrowth = 0.75, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.8, + maxheat = 12, + pos = [[r-2 r3, 5, r-2 r3]], + size = 1.1, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[plasmaball]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], + directional = true, + emitrot = 15, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[0.4 r0.8]], + particlelife = 1.5, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 22, + particlespeed = 15, + particlespeedspread = 3.5, + pos = [[0, 12, 0]], + sizegrowth = -0.08, + sizemod = 0.9, + texture = [[flare2]], + useairlos = false, + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r70]], + -- explosiongenerator = [[custom:lightning_stormbolt]], + -- pos = [[-55 r70, 1, -55 r70]], + -- }, + -- }, + flare = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + colormap = [[0.5 0.5 0.75 0.04 0.0 0.0 0.0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 1, + particlesize = 15, + particlesizespread = 30, + particlespeed = 0.0, + particlespeedspread = 0.1, + pos = [[0, 0, 0]], + rotParams = [[-30 r60, 0, -180 r360]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + -- groundflash = { + -- air = true, + -- flashalpha = 0.04, + -- flashsize = 80, + -- ground = true, + -- ttl = 12, + -- water = true, + -- underwater = true, + -- color = { + -- [1] = 0, + -- [2] = 0.4, + -- [3] = 1, + -- }, + -- }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 ]], + directional = false, + emitrot = 90, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.07, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 2, + particlelifespread = 15, + particlesize = 12, + particlesizespread = 6.5, + particlespeed = 0.5, + particlespeedspread = 1.5, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 5, 0]], + sizegrowth = 0.22, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 3, + heatfalloff = 2, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + ["genericshellexplosion-large-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[0.7 0.5 0.9 0.03 0.5 0.4 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 6, + particlelife = 8, + particlelifespread = 5, + particlesize = 12, + particlesizespread = 16, + particlespeed = 3, + particlespeedspread = 13, + rotParams = [[-20 r40, -1 r2, -180 r360]], + pos = [[0, 2, 0]], + sizegrowth = 1.4, + sizemod = 1, + texture = [[lightninginair]], + useairlos = false, + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.15, + maxheat = 20, + rotParams = [[-120 r250, -80 r160, -180 r360]], + pos = [[r-2 r2, 5, r-2 r2]], + size = -2, + sizegrowth = 10, + speed = [[0, 2, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.80, + colormap = [[0.6 0.6 1 0.017 0.6 0.6 1 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 6, + particlelife = 6, + particlelifespread = 8, + particlesize = 18, + particlesizespread = 24, + particlespeed = 14.5, + particlespeedspread = 14.4, + pos = [[0, 4, 0]], + sizegrowth = -0.3, + sizemod = 0.90, + texture = [[laser]], + useairlos = false, + drawOrder = 2, + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 4, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r30]], + -- explosiongenerator = [[custom:lightning_storm_emp]], + -- pos = [[-40 r80, 20 r10, -40 r80]], + -- }, + -- }, + -- electricstorm2 = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 4, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r30]], + -- explosiongenerator = [[custom:lightning_storm_emp2]], + -- pos = [[-40 r80, 20 r10, -40 r80]], + -- }, + -- }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + --colormap = [[0 0 0 0 0.33 0.33 1 0.18 0.3 0.3 0.9 0.75 0.15 0.15 0.5 0.30 0.10 0.10 0.3 0.008 0.05 0.05 0.1 0.005 0.01 0.01 0.01 0.02]], + colormap = [[0 0 0 0 0.55 0.45 0.90 0.16 0.5 0.43 0.90 0.32 0.35 0.25 0.70 0.22 0.15 0.15 0.3 0.007 0.05 0.05 0.1 0.004 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 3.2, + sizegrowth = [[-24 r6]], + ttl = 8, + pos = [[0, 5, 0]], + drawOrder = 0, + }, + }, + -- groundflash = { + -- air = true, + -- flashalpha = 0.6, + -- flashsize = 140, + -- ground = true, + -- ttl = 15, + -- water = true, + -- underwater = true, + -- color = { + -- [1] = 0.4, + -- [2] = 0.5, + -- [3] = 0.8, + -- }, + -- }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.3, + -- ttl = 8, + -- expansionSpeed = 9, + -- color = [[0.6, 0.60, 1]], + -- --alwaysvisible = true, + -- }, + -- }, + -- grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0.25 0.25 0.5 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[-0.03 r0.06, -0.01 r0.08, -0.03 r0.06]], + -- numparticles = 2, + -- particlelife = 60, + -- particlelifespread = 45, + -- particlesize = 64, + -- particlesizespread = 52, + -- particlespeed = 6.5, + -- particlespeedspread = 3, + -- rotParams = [[-4 r8, -1 r2, -180 r360]], + -- pos = [[0, 40, 0]], + -- sizegrowth = [[0.25 r0.12]], + -- sizemod = 1, + -- texture = [[smoke-ice-anim]], + -- animParams = [[8,8,60 r40]], + -- --alwaysvisible = true, + -- }, + -- }, + -- grounddust2 = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 3, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0 0 0 0.01 0.25 0.25 0.5 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 75, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], + -- numparticles = 1, + -- particlelife = 60, + -- particlelifespread = 40, + -- particlesize = 23, + -- particlesizespread = 42, + -- particlespeed = 3.5, + -- particlespeedspread = 3, + -- rotParams = [[-8 r16, -8 r16, -180 r360]], + -- pos = [[0, 100, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[dirt]], + -- --alwaysvisible = true, + -- }, + -- }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + --colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = -30, + emitvector = [[0, 1.15, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 12, + particlesize = 8, + particlesizespread = 24, + particlespeed = 1, + particlespeedspread = 10, + rotParams = [[-180 r360, 0, 0]], + pos = [[0, 1, 0]], + sizegrowth = 0.24, + sizemod = 1.02, + texture = [[lightninginair]], + drawOrder = 2, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.8, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-250 r500, -80 r160, -180 r360]], + size = 16.5, + sizegrowth = 17, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + drawOrder = 2, + }, + }, + }, - ["genericshellexplosion-medium-lightning2"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0.65 0.7 0.9 0.037 0.5 0.6 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 0, 0]], - gravity = [[0, -0.01, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 7, - particlelifespread = 1, - particlesize = 3, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 3.3, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 2, 0]], - sizegrowth = 0.75, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.8, - maxheat = 12, - pos = [[r-2 r3, 5, r-2 r3]], - size = 1.1, - sizegrowth = 7, - speed = [[0, 1 0, 0]], - texture = [[plasmaball]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], - directional = true, - emitrot = 15, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[0.4 r0.8]], - particlelife = 1.5, - particlelifespread = 5, - particlesize = 20, - particlesizespread = 22, - particlespeed = 15, - particlespeedspread = 3.5, - pos = [[0, 12, 0]], - sizegrowth = -0.08, - sizemod = 0.9, - texture = [[flare2]], - useairlos = false, - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r70]], - -- explosiongenerator = [[custom:lightning_stormbolt]], - -- pos = [[-55 r70, 1, -55 r70]], - -- }, - -- }, - flare = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.8, - colormap = [[0.5 0.5 0.75 0.04 0.0 0.0 0.0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 0, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 1, - particlesize = 15, - particlesizespread = 30, - particlespeed = 0.0, - particlespeedspread = 0.1, - pos = [[0, 0, 0]], - rotParams = [[-30 r60, 0, -180 r360]], - sizegrowth = 0.5, - sizemod = 1, - texture = [[whitelightb]], - useairlos = false, - }, - }, - -- groundflash = { - -- air = true, - -- flashalpha = 0.04, - -- flashsize = 80, - -- ground = true, - -- ttl = 12, - -- water = true, - -- underwater = true, - -- color = { - -- [1] = 0, - -- [2] = 0.4, - -- [3] = 1, - -- }, - -- }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 ]], - directional = false, - emitrot = 90, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.07, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 2, - particlelifespread = 15, - particlesize = 12, - particlesizespread = 6.5, - particlespeed = 0.5, - particlespeedspread = 1.5, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 5, 0]], - sizegrowth = 0.22, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 3, - heatfalloff = 2, - maxheat = 10, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - }, - }, - }, + ["genericshellexplosion-large-lightning-thor"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.75, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = [[0.7 r1]], + particlelife = 5, + particlelifespread = 3, + particlesize = 6, + particlesizespread = 24, + particlespeed = 0, + particlespeedspread = 14, + rotParams = [[-20 r40, -1 r2, -180 r360]], + pos = [[-5 r10, 4, -5 r10]], + sizegrowth = 0.9, + sizemod = 1, + texture = [[lightninginair]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.3, + maxheat = 10, + pos = [[-20 r40, -16 r32, -20 r40]], + size = [[1 r5]], + sizegrowth = 14, + speed = [[0, 4, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.6 0.6 1 0.032 0.6 0.6 1 0.020 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[0.5 r0.8]], + particlelife = 5, + particlelifespread = 6, + particlesize = 24, + particlesizespread = 20, + particlespeed = 25, + particlespeedspread = 8, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.95, + texture = [[laser]], + useairlos = false, + drawOrder = 2, + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r40]], + -- explosiongenerator = [[custom:lightning_storm_emp]], + -- pos = [[-60 r120, 20, -60 r120]], + -- }, + -- }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.33 0.33 1 0.15 0.3 0.3 0.9 0.50 0.15 0.15 0.5 0.20 0.10 0.10 0.3 0.007 0.05 0.05 0.1 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 4.2, + sizegrowth = [[-24 r6]], + ttl = 6, + pos = [[0, 5, 0]], + drawOrder = 0, + }, + }, + groundflash = { + air = true, + flashalpha = 0.06, + flashsize = 140, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.12, + [2] = 0.4, + [3] = 1, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.3, + -- ttl = 8, + -- expansionSpeed = 9, + -- color = [[0.6, 0.60, 1]], + -- --alwaysvisible = true, + -- }, + -- }, + -- grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0.25 0.25 0.5 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[-0.03 r0.06, -0.03 r0.06, -0.03 r0.06]], + -- numparticles = [[0.3 r0.8]], + -- particlelife = 30, + -- particlelifespread = 20, + -- particlesize = 26, + -- particlesizespread = 26, + -- particlespeed = 6.7, + -- particlespeedspread = 4, + -- rotParams = [[-4 r8, -1 r2, -180 r360]], + -- pos = [[0, 100, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[smoke_puff]], + -- --alwaysvisible = true, + -- }, + -- }, + -- grounddust2 = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0 0 0 0.01 0.25 0.25 0.5 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 75, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], + -- numparticles = 1, + -- particlelife = 40, + -- particlelifespread = 20, + -- particlesize = 20, + -- particlesizespread = 30, + -- particlespeed = 6.7, + -- particlespeedspread = 4, + -- rotParams = [[-8 r16, -8 r16, -180 r360]], + -- pos = [[0, 100, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[dirt]], + -- --alwaysvisible = true, + -- }, + -- }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 30, + emitvector = [[0, 1.15, 0]], + gravity = [[0, 0.15, 0]], + numparticles = [[0.5 r0.8]], + particlelife = 4, + particlelifespread = 6, + particlesize = 6, + particlesizespread = 20, + particlespeed = 0, + particlespeedspread = 10, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = [[0.06 r0.2]], + sizemod = 1.0, + texture = [[lightninginair]], + drawOrder = 2, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + heat = 6, + heatfalloff = 2, + maxheat = 10, + pos = [[r-4 r4, 5, r-4 r4]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + ["heatcloud-rot"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 19, + heatfalloff = 0.5, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-50 r100, -5 r10, -90 r180]], + size = [[4 r2]], + sizegrowth = [[4 r2]], + speed = [[0, 1, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, + }, + ["genericshellexplosion-huge-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 20, + particlelife = 6, + particlelifespread = 3, + particlesize = 8, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 13, + pos = [[0, 2, 0]], + sizegrowth = 0.7, + sizemod = 1, + texture = [[lightninginair]], + useairlos = false, + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 19, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-125 r250, -10 r15, -180 r360]], + size = 5, + sizegrowth = 15, + speed = [[0, 3, 0]], + texture = [[bluenovaexplo]], + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.81, + colormap = [[0.6 0.6 1 0.017 0.6 0.6 1 0.015 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 9, + particlesize = 30, + particlesizespread = 28, + particlespeed = 15, + particlespeedspread = 15, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[laser]], + useairlos = false, + drawOrder = 2, + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 8, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10 r100]], + -- explosiongenerator = [[custom:lightning_storm_emp]], + -- pos = [[-50 r120, 20, -50 r120]], + -- }, + -- }, - ["genericshellexplosion-large-lightning"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[0.7 0.5 0.9 0.03 0.5 0.4 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 6, - particlelife = 8, - particlelifespread = 5, - particlesize = 12, - particlesizespread = 16, - particlespeed = 3, - particlespeedspread = 13, - rotParams = [[-20 r40, -1 r2, -180 r360]], - pos = [[0, 2, 0]], - sizegrowth = 1.4, - sizemod = 1, - texture = [[lightninginair]], - useairlos = false, - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.15, - maxheat = 20, - rotParams = [[-120 r250, -80 r160, -180 r360]], - pos = [[r-2 r2, 5, r-2 r2]], - size = -2, - sizegrowth = 10, - speed = [[0, 2, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.80, - colormap = [[0.6 0.6 1 0.017 0.6 0.6 1 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 6, - particlelife = 6, - particlelifespread = 8, - particlesize = 18, - particlesizespread = 24, - particlespeed = 14.5, - particlespeedspread = 14.4, - pos = [[0, 4, 0]], - sizegrowth = -0.3, - sizemod = 0.90, - texture = [[laser]], - useairlos = false, - drawOrder = 2, - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 4, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r30]], - -- explosiongenerator = [[custom:lightning_storm_emp]], - -- pos = [[-40 r80, 20 r10, -40 r80]], - -- }, - -- }, - -- electricstorm2 = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 4, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r30]], - -- explosiongenerator = [[custom:lightning_storm_emp2]], - -- pos = [[-40 r80, 20 r10, -40 r80]], - -- }, - -- }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - --colormap = [[0 0 0 0 0.33 0.33 1 0.18 0.3 0.3 0.9 0.75 0.15 0.15 0.5 0.30 0.10 0.10 0.3 0.008 0.05 0.05 0.1 0.005 0.01 0.01 0.01 0.02]], - colormap = [[0 0 0 0 0.55 0.45 0.90 0.16 0.5 0.43 0.90 0.32 0.35 0.25 0.70 0.22 0.15 0.15 0.3 0.007 0.05 0.05 0.1 0.004 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 3.2, - sizegrowth = [[-24 r6]], - ttl = 8, - pos = [[0, 5, 0]], - drawOrder = 0, - }, - }, - -- groundflash = { - -- air = true, - -- flashalpha = 0.6, - -- flashsize = 140, - -- ground = true, - -- ttl = 15, - -- water = true, - -- underwater = true, - -- color = { - -- [1] = 0.4, - -- [2] = 0.5, - -- [3] = 0.8, - -- }, - -- }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.3, - -- ttl = 8, - -- expansionSpeed = 9, - -- color = [[0.6, 0.60, 1]], - -- --alwaysvisible = true, - -- }, - -- }, - -- grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0.25 0.25 0.5 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[-0.03 r0.06, -0.01 r0.08, -0.03 r0.06]], - -- numparticles = 2, - -- particlelife = 60, - -- particlelifespread = 45, - -- particlesize = 64, - -- particlesizespread = 52, - -- particlespeed = 6.5, - -- particlespeedspread = 3, - -- rotParams = [[-4 r8, -1 r2, -180 r360]], - -- pos = [[0, 40, 0]], - -- sizegrowth = [[0.25 r0.12]], - -- sizemod = 1, - -- texture = [[smoke-ice-anim]], - -- animParams = [[8,8,60 r40]], - -- --alwaysvisible = true, - -- }, - -- }, - -- grounddust2 = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 3, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0 0 0 0.01 0.25 0.25 0.5 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 75, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], - -- numparticles = 1, - -- particlelife = 60, - -- particlelifespread = 40, - -- particlesize = 23, - -- particlesizespread = 42, - -- particlespeed = 3.5, - -- particlespeedspread = 3, - -- rotParams = [[-8 r16, -8 r16, -180 r360]], - -- pos = [[0, 100, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[dirt]], - -- --alwaysvisible = true, - -- }, - -- }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - --colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = -30, - emitvector = [[0, 1.15, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 12, - particlesize = 8, - particlesizespread = 24, - particlespeed = 1, - particlespeedspread = 10, - rotParams = [[-180 r360, 0, 0]], - pos = [[0, 1, 0]], - sizegrowth = 0.24, - sizemod = 1.02, - texture = [[lightninginair]], - drawOrder = 2, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.8, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-250 r500, -80 r160, -180 r360]], - size = 16.5, - sizegrowth = 17, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - drawOrder = 2, - }, - }, - }, + -- groundflash = { + -- air = true, + -- flashalpha = 0.13, + -- flashsize = 180, + -- ground = true, + -- ttl = 220, + -- water = true, + -- underwater = true, + -- color = { + -- [1] = 0, + -- [2] = 0.4, + -- [3] = 1, + -- }, + -- }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.4, + -- ttl = 9, + -- expansionSpeed = 14, + -- color = [[0.6, 0.6, 1]], + -- --alwaysvisible = true, + -- }, + -- }, + -- grounddust-old = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 4, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.88, + -- colormap = [[0.2 0.2 0.5 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.01 r0.02, 0]], + -- numparticles = 2, + -- particlelife = 180, + -- particlelifespread = 60, + -- particlesize = 32, + -- particlesizespread = 52, + -- particlespeed = 5, + -- particlespeedspread = 9, + -- rotParams = [[-4 r8, -1 r2, -180 r360]], + -- pos = [[0, 100, 0]], + -- sizegrowth = 0.2, + -- sizemod = 1, + -- texture = [[smoke_puff]], + -- --alwaysvisible = true, + -- drawOrder = 1, + -- }, + -- }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.88, + colormap = [[0.2 0.2 0.5 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01 r0.02, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 60, + particlesize = 64, + particlesizespread = 130, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 100, 0]], + sizegrowth = 0.2, + sizemod = 1, + texture = [[smoke-anim]], + animParams = [[8,6,90 r30]], + rotParams = [[-4 r8, -10 r20, -180 r360]], + --alwaysvisible = true, + drawOrder = 1, + }, + }, + grounddust2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 6, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.17 0.17 0.35 0.1 0 0 0 0.0]], + directional = false, + emitrot = 60, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01 r0.02, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 90, + particlesize = 32, + particlesizespread = 58, + particlespeed = 3.5, + particlespeedspread = 6, + rotParams = [[-6 r12, -6 r12, -180 r360]], + pos = [[0, 100, 0]], + sizegrowth = 0.2, + sizemod = 1, + texture = [[dirt]], + --alwaysvisible = true, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.45 0.45 0.95 0.18 0.4 0.4 0.98 0.35 0.25 0.25 0.7 0.25 0.10 0.10 0.3 0.007 0.05 0.05 0.1 0.004 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 20.2, + sizegrowth = [[-10 r1.5]], + ttl = 21, + pos = [[0, 5, 0]], + drawOrder = 0, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], + directional = true, + emitrot = 90, + emitrotspread = -30, + emitvector = [[0, 1.15, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 10, + particlelife = 4, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 10, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = -0.16, + sizemod = 1.0, + texture = [[whitelightb]], + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.7, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 8.2, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + drawOrder = 2, + }, + }, + }, - ["genericshellexplosion-large-lightning-thor"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.75, - colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = [[0.7 r1]], - particlelife = 5, - particlelifespread = 3, - particlesize = 6, - particlesizespread = 24, - particlespeed = 0, - particlespeedspread = 14, - rotParams = [[-20 r40, -1 r2, -180 r360]], - pos = [[-5 r10, 4, -5 r10]], - sizegrowth = 0.9, - sizemod = 1, - texture = [[lightninginair]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.3, - maxheat = 10, - pos = [[-20 r40, -16 r32, -20 r40]], - size = [[1 r5]], - sizegrowth = 14, - speed = [[0, 4, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.6 0.6 1 0.032 0.6 0.6 1 0.020 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[0.5 r0.8]], - particlelife = 5, - particlelifespread = 6, - particlesize = 24, - particlesizespread = 20, - particlespeed = 25, - particlespeedspread = 8, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.95, - texture = [[laser]], - useairlos = false, - drawOrder = 2, - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r40]], - -- explosiongenerator = [[custom:lightning_storm_emp]], - -- pos = [[-60 r120, 20, -60 r120]], - -- }, - -- }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.33 0.33 1 0.15 0.3 0.3 0.9 0.50 0.15 0.15 0.5 0.20 0.10 0.10 0.3 0.007 0.05 0.05 0.1 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 4.2, - sizegrowth = [[-24 r6]], - ttl = 6, - pos = [[0, 5, 0]], - drawOrder = 0, - }, - }, - groundflash = { - air = true, - flashalpha = 0.06, - flashsize = 140, - ground = true, - ttl = 20, - water = true, - underwater = true, - color = { - [1] = 0.12, - [2] = 0.4, - [3] = 1, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.3, - -- ttl = 8, - -- expansionSpeed = 9, - -- color = [[0.6, 0.60, 1]], - -- --alwaysvisible = true, - -- }, - -- }, - -- grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0.25 0.25 0.5 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[-0.03 r0.06, -0.03 r0.06, -0.03 r0.06]], - -- numparticles = [[0.3 r0.8]], - -- particlelife = 30, - -- particlelifespread = 20, - -- particlesize = 26, - -- particlesizespread = 26, - -- particlespeed = 6.7, - -- particlespeedspread = 4, - -- rotParams = [[-4 r8, -1 r2, -180 r360]], - -- pos = [[0, 100, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[smoke_puff]], - -- --alwaysvisible = true, - -- }, - -- }, - -- grounddust2 = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0 0 0 0.01 0.25 0.25 0.5 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 75, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[-0.03 r0.06, -0.02 r0.07, -0.03 r0.06]], - -- numparticles = 1, - -- particlelife = 40, - -- particlelifespread = 20, - -- particlesize = 20, - -- particlesizespread = 30, - -- particlespeed = 6.7, - -- particlespeedspread = 4, - -- rotParams = [[-8 r16, -8 r16, -180 r360]], - -- pos = [[0, 100, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[dirt]], - -- --alwaysvisible = true, - -- }, - -- }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 30, - emitvector = [[0, 1.15, 0]], - gravity = [[0, 0.15, 0]], - numparticles = [[0.5 r0.8]], - particlelife = 4, - particlelifespread = 6, - particlesize = 6, - particlesizespread = 20, - particlespeed = 0, - particlespeedspread = 10, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = [[0.06 r0.2]], - sizemod = 1.0, - texture = [[lightninginair]], - drawOrder = 2, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - heat = 6, - heatfalloff = 2, - maxheat = 10, - pos = [[r-4 r4, 5, r-4 r4]], - size = 1, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - }, - }, - }, + ["genericshellexplosion-splash-lightning"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.6, + maxheat = 15, + pos = [[r-2 r3, 0, r-2 r3]], + size = 1.6, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[whitelightb]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- colormap = [[0 0.36 0.9 1 0 0 0 0.01]], + -- size = 24, + -- sizegrowth = -1, + -- ttl = 8, + -- texture = [[whitelightb]], + -- }, + -- }, + groundflash = { + air = true, + flashalpha = 0.08, + flashsize = 32, + ground = true, + ttl = 12, + water = true, + underwater = true, + properties = { + texture = [[whitelightb]], + }, + color = { + [1] = 0, + [2] = 0.3, + [3] = 0.9, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0.9 0.9 0.9 0.038 0 0 0 0.0 0.8 0.8 0.8 0.035 0 0 0 0.0 ]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1.0, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 7, + particlesize = 2, + particlesizespread = 6, + particlespeed = 1.6, + particlespeedspread = 1.5, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 12 r30, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[lightninginair]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 1, + particlelifespread = 5, + particlesize = 11, + particlesizespread = 22, + particlespeed = 11, + particlespeedspread = 3, + pos = [[0, 5, 0]], + sizegrowth = -0.04, + sizemod = 0.9, + texture = [[flare2]], + useairlos = false, + }, + }, + -- outerflash = { + -- air = true, + -- class = [[CHeatCloudProjectile]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- heat = 10, + -- heatfalloff = 1.7, + -- maxheat = 12, + -- pos = [[r-2 r2, 5, r-2 r2]], + -- size = 0.8, + -- sizegrowth = 5.5, + -- speed = [[0, 1 0, 0]], + -- texture = [[brightblueexplo]], + -- }, + -- }, + }, -["heatcloud-rot"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 19, - heatfalloff = 0.5, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-50 r100, -5 r10, -90 r180]], - size = [[4 r2]], - sizegrowth = [[4 r2]], - speed = [[0, 1, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, -}, - ["genericshellexplosion-huge-lightning"] = { - blueelectricityspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.7, - colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 20, - particlelife = 6, - particlelifespread = 3, - particlesize = 8, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 13, - pos = [[0, 2, 0]], - sizegrowth = 0.7, - sizemod = 1, - texture = [[lightninginair]], - useairlos = false, - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 19, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-125 r250, -10 r15, -180 r360]], - size = 5, - sizegrowth = 15, - speed = [[0, 3, 0]], - texture = [[bluenovaexplo]], - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.81, - colormap = [[0.6 0.6 1 0.017 0.6 0.6 1 0.015 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 10, - particlelife = 8, - particlelifespread = 9, - particlesize = 30, - particlesizespread = 28, - particlespeed = 15, - particlespeedspread = 15, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.78, - texture = [[laser]], - useairlos = false, - drawOrder = 2, - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 8, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10 r100]], - -- explosiongenerator = [[custom:lightning_storm_emp]], - -- pos = [[-50 r120, 20, -50 r120]], - -- }, - -- }, + ["genericshellexplosion-splash-large-lightning"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.6, + maxheat = 15, + pos = [[r-2 r3, 0, r-2 r3]], + size = 1.8, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- colormap = [[0 0.36 0.9 1 0 0 0 0.01]], + -- size = 24, + -- sizegrowth = -1, + -- ttl = 8, + -- texture = [[whitelightb]], + -- }, + -- }, + groundflash = { + air = true, + flashalpha = 0.08, + flashsize = 48, + ground = true, + ttl = 12, + water = true, + underwater = true, + properties = { + texture = [[whitelightb]], + }, + color = { + [1] = 0, + [2] = 0.3, + [3] = 0.9, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 ]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1.0, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 12, + particlesize = 11, + particlesizespread = 16, + particlespeed = 1.8, + particlespeedspread = 1.5, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 120 r30, 0]], + sizegrowth = 0.4, + sizemod = 0.99, + texture = [[lightning]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[0.4 r0.9]], + particlelife = 4, + particlelifespread = 5, + particlesize = 13, + particlesizespread = 25, + particlespeed = 12, + particlespeedspread = 4, + pos = [[0, 5, 0]], + sizegrowth = -0.04, + sizemod = 0.9, + texture = [[flare2]], + useairlos = false, + }, + }, + -- outerflash = { + -- air = true, + -- class = [[CHeatCloudProjectile]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- heat = 10, + -- heatfalloff = 1.7, + -- maxheat = 12, + -- pos = [[r-2 r2, 5, r-2 r2]], + -- size = 0.8, + -- sizegrowth = 5.5, + -- speed = [[0, 1 0, 0]], + -- texture = [[brightblueexplo]], + -- }, + -- }, + }, - -- groundflash = { - -- air = true, - -- flashalpha = 0.13, - -- flashsize = 180, - -- ground = true, - -- ttl = 220, - -- water = true, - -- underwater = true, - -- color = { - -- [1] = 0, - -- [2] = 0.4, - -- [3] = 1, - -- }, - -- }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.4, - -- ttl = 9, - -- expansionSpeed = 14, - -- color = [[0.6, 0.6, 1]], - -- --alwaysvisible = true, - -- }, - -- }, - -- grounddust-old = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 4, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.88, - -- colormap = [[0.2 0.2 0.5 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.01 r0.02, 0]], - -- numparticles = 2, - -- particlelife = 180, - -- particlelifespread = 60, - -- particlesize = 32, - -- particlesizespread = 52, - -- particlespeed = 5, - -- particlespeedspread = 9, - -- rotParams = [[-4 r8, -1 r2, -180 r360]], - -- pos = [[0, 100, 0]], - -- sizegrowth = 0.2, - -- sizemod = 1, - -- texture = [[smoke_puff]], - -- --alwaysvisible = true, - -- drawOrder = 1, - -- }, - -- }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.88, - colormap = [[0.2 0.2 0.5 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01 r0.02, 0]], - numparticles = 1, - particlelife = 60, - particlelifespread = 60, - particlesize = 64, - particlesizespread = 130, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 100, 0]], - sizegrowth = 0.2, - sizemod = 1, - texture = [[smoke-anim]], - animParams = [[8,6,90 r30]], - rotParams = [[-4 r8, -10 r20, -180 r360]], - --alwaysvisible = true, - drawOrder = 1, - }, - }, - grounddust2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 6, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.17 0.17 0.35 0.1 0 0 0 0.0]], - directional = false, - emitrot = 60, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01 r0.02, 0]], - numparticles = 1, - particlelife = 70, - particlelifespread = 90, - particlesize = 32, - particlesizespread = 58, - particlespeed = 3.5, - particlespeedspread = 6, - rotParams = [[-6 r12, -6 r12, -180 r360]], - pos = [[0, 100, 0]], - sizegrowth = 0.2, - sizemod = 1, - texture = [[dirt]], - --alwaysvisible = true, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.45 0.45 0.95 0.18 0.4 0.4 0.98 0.35 0.25 0.25 0.7 0.25 0.10 0.10 0.3 0.007 0.05 0.05 0.1 0.004 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 20.2, - sizegrowth = [[-10 r1.5]], - ttl = 21, - pos = [[0, 5, 0]], - drawOrder = 0, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 1 1 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 1 1 1 0.012 0 0 0 0.0 ]], - directional = true, - emitrot = 90, - emitrotspread = -30, - emitvector = [[0, 1.15, 0]], - gravity = [[0, 0.05, 0]], - numparticles = 10, - particlelife = 4, - particlelifespread = 30, - particlesize = 2, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 10, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = -0.16, - sizemod = 1.0, - texture = [[whitelightb]], - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.7, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 8.2, - sizegrowth = 20, - speed = [[0, 1 0, 0]], - texture = [[brightblueexplo]], - drawOrder = 2, - }, - }, - }, - - - ["genericshellexplosion-splash-lightning"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.6, - maxheat = 15, - pos = [[r-2 r3, 0, r-2 r3]], - size = 1.6, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[whitelightb]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- colormap = [[0 0.36 0.9 1 0 0 0 0.01]], - -- size = 24, - -- sizegrowth = -1, - -- ttl = 8, - -- texture = [[whitelightb]], - -- }, - -- }, - groundflash = { - air = true, - flashalpha = 0.08, - flashsize = 32, - ground = true, - ttl = 12, - water = true, - underwater = true, - properties = { - texture = [[whitelightb]], - }, - color = { - [1] = 0, - [2] = 0.3, - [3] = 0.9, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 0.9 0.9 0.9 0.038 0 0 0 0.0 0.8 0.8 0.8 0.035 0 0 0 0.0 ]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1.0, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 7, - particlesize = 2, - particlesizespread = 6, - particlespeed = 1.6, - particlespeedspread = 1.5, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 12 r30, 0]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[lightninginair]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 1, - particlelifespread = 5, - particlesize = 11, - particlesizespread = 22, - particlespeed = 11, - particlespeedspread = 3, - pos = [[0, 5, 0]], - sizegrowth = -0.04, - sizemod = 0.9, - texture = [[flare2]], - useairlos = false, - }, - }, - -- outerflash = { - -- air = true, - -- class = [[CHeatCloudProjectile]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- heat = 10, - -- heatfalloff = 1.7, - -- maxheat = 12, - -- pos = [[r-2 r2, 5, r-2 r2]], - -- size = 0.8, - -- sizegrowth = 5.5, - -- speed = [[0, 1 0, 0]], - -- texture = [[brightblueexplo]], - -- }, - -- }, - }, - - ["genericshellexplosion-splash-large-lightning"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.6, - maxheat = 15, - pos = [[r-2 r3, 0, r-2 r3]], - size = 1.8, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- colormap = [[0 0.36 0.9 1 0 0 0 0.01]], - -- size = 24, - -- sizegrowth = -1, - -- ttl = 8, - -- texture = [[whitelightb]], - -- }, - -- }, - groundflash = { - air = true, - flashalpha = 0.08, - flashsize = 48, - ground = true, - ttl = 12, - water = true, - underwater = true, - properties = { - texture = [[whitelightb]], - }, - color = { - [1] = 0, - [2] = 0.3, - [3] = 0.9, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 0 0 0 0.0 1 1 1 0.04 0 0 0 0.0 ]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1.0, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 12, - particlesize = 11, - particlesizespread = 16, - particlespeed = 1.8, - particlespeedspread = 1.5, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 120 r30, 0]], - sizegrowth = 0.4, - sizemod = 0.99, - texture = [[lightning]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0.8 0.9 1 0.02 0.6 0.7 0.9 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[0.4 r0.9]], - particlelife = 4, - particlelifespread = 5, - particlesize = 13, - particlesizespread = 25, - particlespeed = 12, - particlespeedspread = 4, - pos = [[0, 5, 0]], - sizegrowth = -0.04, - sizemod = 0.9, - texture = [[flare2]], - useairlos = false, - }, - }, - -- outerflash = { - -- air = true, - -- class = [[CHeatCloudProjectile]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- heat = 10, - -- heatfalloff = 1.7, - -- maxheat = 12, - -- pos = [[r-2 r2, 5, r-2 r2]], - -- size = 0.8, - -- sizegrowth = 5.5, - -- speed = [[0, 1 0, 0]], - -- texture = [[brightblueexplo]], - -- }, - -- }, - }, - - - - - ["juno_stormbolt"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.12, - flashsize = 40, - ttl = 3, - color = { - [1] = 0.66, - [2] = 0.66, - [3] = 1, - }, - }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 1 0.5 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 7.5, - particlespeed = 0.01, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[lightbw]], - }, - }, - }, - ["genericshellexplosion-juno-lightning"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 1.25, - maxheat = 22, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 15, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 33, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[20 r1000]], - -- explosiongenerator = [[custom:juno_stormbolt]], - -- pos = [[-500 r1000, 1, -500 r1000]], - -- }, - -- }, - groundflash = { - air = true, - flashalpha = 0.28, - flashsize = [[330]], - ground = true, - ttl = 200, - water = true, - underwater = true, - alwaysVisible=1, - color = { - [1] = 0.4, - [2] = 1, - [3] = 0.2, - }, - }, - electricity = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.012 0 0 0 0.0 ]], - directional = true, - emitrot = 90, - emitrotspread = -30, - emitvector = [[0, 1.15, 0]], - gravity = [[0, 0.05, 0]], - numparticles = 18, - particlelife = 15, - particlelifespread = 75, - particlesize = 0.8, - particlesizespread = 2.3, - particlespeed = 0, - particlespeedspread = 34, - pos = [[0, 1, 0]], - sizegrowth = 0.11, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - }, + ["juno_stormbolt"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.12, + flashsize = 40, + ttl = 3, + color = { + [1] = 0.66, + [2] = 0.66, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 1 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 7.5, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, + ["genericshellexplosion-juno-lightning"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 1.25, + maxheat = 22, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 33, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[20 r1000]], + -- explosiongenerator = [[custom:juno_stormbolt]], + -- pos = [[-500 r1000, 1, -500 r1000]], + -- }, + -- }, + groundflash = { + air = true, + flashalpha = 0.28, + flashsize = [[330]], + ground = true, + ttl = 200, + water = true, + underwater = true, + alwaysVisible = 1, + color = { + [1] = 0.4, + [2] = 1, + [3] = 0.2, + }, + }, + electricity = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 1 0.5 0.012 0 0 0 0.0 ]], + directional = true, + emitrot = 90, + emitrotspread = -30, + emitvector = [[0, 1.15, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 18, + particlelife = 15, + particlelifespread = 75, + particlesize = 0.8, + particlesizespread = 2.3, + particlespeed = 0, + particlespeedspread = 34, + pos = [[0, 1, 0]], + sizegrowth = 0.11, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + }, } -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - blueelectricityspikes = { - properties = { - colormap = [[0.7 0.2 0.9 0.03 0.5 0.15 0.9 0.01]], - }, - }, - groundflash = { - color = { - [1] = 0.66, - [2] = 0.2, - [3] = 1, - }, - }, - electricity = { - properties = { - colormap = [[0 0 0 0.0 0.5 1 0.7 0.04 0 0 0 0.0 0 0 0 0.0 0.5 0. 0.7 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.3 1 0.025 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.04 0 0 0 0.0 0 0 0 0.0 0.66 0.25 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.4 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.6 0.5 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.25 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.15 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.012 0 0 0 0.0 ]], - }, - }, - lightningballs = { - properties = { - colormap = [[0 0 0 0.01 0.66 0.33 1 0.01 0 0 0 0.01]], - }, - }, - + blueelectricityspikes = { + properties = { + colormap = [[0.7 0.2 0.9 0.03 0.5 0.15 0.9 0.01]], + }, + }, + groundflash = { + color = { + [1] = 0.66, + [2] = 0.2, + [3] = 1, + }, + }, + electricity = { + properties = { + colormap = [[0 0 0 0.0 0.5 1 0.7 0.04 0 0 0 0.0 0 0 0 0.0 0.5 0. 0.7 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.3 1 0.025 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.04 0 0 0 0.0 0 0 0 0.0 0.66 0.25 1 0.04 0 0 0 0.12 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.03 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.4 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.6 0.5 1 0.025 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.25 1 0.02 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.15 1 0.015 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0 0 0 0.0 0.66 0.2 1 0.012 0 0 0 0.0 ]], + }, + }, + lightningballs = { + properties = { + colormap = [[0 0 0 0.01 0.66 0.33 1 0.01 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/genericshellexplosion.lua b/effects/genericshellexplosion.lua index cc8f90f5268..01756a0267e 100644 --- a/effects/genericshellexplosion.lua +++ b/effects/genericshellexplosion.lua @@ -1,4924 +1,4905 @@ local root = "genericshellexplosion" local definitions = { - [root.."-tiny"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.2, - -- flashsize = 67, - -- ground = true, - -- ttl = 13, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.75, - -- [3] = 0.3, - -- }, - --}, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.28 0 0 0 0.01]], - size = 18, - sizegrowth = -0.5, - ttl = 12, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.09 0 0 0 0.01]], - size = 36, - sizegrowth = -0.5, - ttl = 12, - texture = [[groundflash]], - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.2, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.5, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.77, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 6, - particlelifespread = 5, - particlesize = 1.6, - particlesizespread = 2.8, - particlespeed = 0.38, - particlespeedspread = 1.8, - pos = [[0, 4, 0]], - sizegrowth = 0.2, - sizemod = 1.1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 1.6, - sizegrowth = [[-20 r7]], - ttl = 5, - pos = [[0, 5, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 1.4, - particlesize = 2, - particlesizespread = 0.4, - particlespeed = 0.22, - particlespeedspread = 0.1, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - sizeGrowth = 1, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - rotParams = [[0 , 0, -180 r360]], - emitRot=35, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.014, 0]], - colormap=[[1 0.66 0.45 0.2 0.4 0.2 0.14 0.50 0.21 0.16 0.11 0.42 0.15 0.12 0.09 0.33 0.1 0.095 0.088 0.26 0.07 0.065 0.058 0.15 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=17, - particleLifeSpread=21, - numparticles=2, - particleSpeed=0.5, - particleSpeedSpread=2, - particleSize=14, - particleSizeSpread=7.5, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.4, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[dirt]], - particleLife=7, - particleLifeSpread=18, - numparticles=1, - particleSpeed=1, - particleSpeedSpread=3.3, - particleSize=6, - particleSizeSpread=2.5, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 16, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 3, - particlesize = 1.08, - particlesizespread = -1, - particlespeed = 1.05, - particlespeedspread = 1.2, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 3, - particlesize = 1.1, - particlesizespread = -1, - particlespeed = 1.25, - particlespeedspread = 1.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - clouddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, - particlelife = 25, - particlelifespread = 40, - particlesize = 4, - particlesizespread = 5, - particlespeed = 0.3, - particlespeedspread = 1, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - --grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - -- directional = true, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.02, 0]], - -- numparticles = 8, - -- particlelife = 10, - -- particlelifespread = 40, - -- particlesize = 2, - -- particlesizespread = 1.4, - -- particlespeed = 1.6, - -- particlespeedspread = 0.55, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.1, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0.7 r1]], - particlelife = 22, - particlelifespread = 0, - particlesize = 1, - particlesizespread = 1.6, - particlespeed = 1, - particlespeedspread = 1.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.2]], - particlelife = 22, - particlelifespread = 0, - particlesize = 1, - particlesizespread = 1.4, - particlespeed = 1, - particlespeedspread = 1.45, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.2]], - particlelife = 22, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.7, - particlespeed = 1, - particlespeedspread = 1.4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 8, - particlesize = 13, - particlesizespread = 10, - particlespeed = 1.5, - particlespeedspread = 1.6, - pos = [[0, 2, 0]], - sizegrowth = 0.77, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + [root .. "-tiny"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.2, + -- flashsize = 67, + -- ground = true, + -- ttl = 13, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.75, + -- [3] = 0.3, + -- }, + --}, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.28 0 0 0 0.01]], + size = 18, + sizegrowth = -0.5, + ttl = 12, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.09 0 0 0 0.01]], + size = 36, + sizegrowth = -0.5, + ttl = 12, + texture = [[groundflash]], + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.2, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.5, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.77, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 6, + particlelifespread = 5, + particlesize = 1.6, + particlesizespread = 2.8, + particlespeed = 0.38, + particlespeedspread = 1.8, + pos = [[0, 4, 0]], + sizegrowth = 0.2, + sizemod = 1.1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 1.6, + sizegrowth = [[-20 r7]], + ttl = 5, + pos = [[0, 5, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 1.4, + particlesize = 2, + particlesizespread = 0.4, + particlespeed = 0.22, + particlespeedspread = 0.1, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + sizeGrowth = 1, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + rotParams = [[0 , 0, -180 r360]], + emitRot = 35, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.014, 0]], + colormap = [[1 0.66 0.45 0.2 0.4 0.2 0.14 0.50 0.21 0.16 0.11 0.42 0.15 0.12 0.09 0.33 0.1 0.095 0.088 0.26 0.07 0.065 0.058 0.15 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 17, + particleLifeSpread = 21, + numparticles = 2, + particleSpeed = 0.5, + particleSpeedSpread = 2, + particleSize = 14, + particleSizeSpread = 7.5, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.4, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[dirt]], + particleLife = 7, + particleLifeSpread = 18, + numparticles = 1, + particleSpeed = 1, + particleSpeedSpread = 3.3, + particleSize = 6, + particleSizeSpread = 2.5, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 16, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 3, + particlesize = 1.08, + particlesizespread = -1, + particlespeed = 1.05, + particlespeedspread = 1.2, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 3, + particlesize = 1.1, + particlesizespread = -1, + particlespeed = 1.25, + particlespeedspread = 1.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + clouddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, + particlelife = 25, + particlelifespread = 40, + particlesize = 4, + particlesizespread = 5, + particlespeed = 0.3, + particlespeedspread = 1, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + --grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + -- directional = true, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.02, 0]], + -- numparticles = 8, + -- particlelife = 10, + -- particlelifespread = 40, + -- particlesize = 2, + -- particlesizespread = 1.4, + -- particlespeed = 1.6, + -- particlespeedspread = 0.55, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.1, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0.7 r1]], + particlelife = 22, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1.6, + particlespeed = 1, + particlespeedspread = 1.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.2]], + particlelife = 22, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1.4, + particlespeed = 1, + particlespeedspread = 1.45, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.2]], + particlelife = 22, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.7, + particlespeed = 1, + particlespeedspread = 1.4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 8, + particlesize = 13, + particlesizespread = 10, + particlespeed = 1.5, + particlespeedspread = 1.6, + pos = [[0, 2, 0]], + sizegrowth = 0.77, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 18, - particlelifespread = 30, - particlesize = 7.5, - particlesizespread = 22, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 18, + particlelifespread = 30, + particlesize = 7.5, + particlesizespread = 22, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 16.9, - sizegrowth = 2, - ttl = 80, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 16.9, + sizegrowth = 2, + ttl = 80, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 2, - particlelife = 15, - particlelifespread = 40, - particlesize = [[4 r16]], - particlesizespread = 16, - particlespeed = [[5 i0.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 2, + particlelife = 15, + particlelifespread = 40, + particlesize = [[4 r16]], + particlesizespread = 16, + particlespeed = [[5 i0.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.4 0.4 0.4 .85 0.5 0.5 0.5 .6 0.4 0.4 0.4 .3 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 15, - particlelifespread = 40, - particlesize = 2, - particlesizespread = 12, - particlespeed = 1, - particlespeedspread = 3, - rotParams = [[-2 r4, 0, -180 r360]], - pos = [[-10 r20, -30 r10, -10 r20]], - sizegrowth = [[3.8]], - sizemod = 0.95, - texture = [[dirtrush]], - useairlos = true, - }, - }, - outerflash = { - air = false, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 2.5, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 1, - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[30 r16]], - sidetexture = [[flamestream]], - size = [[16 r14]], - sizegrowth = 1, - ttl = [[28 r3]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, -10 r12, -10 r20]], - drawOrder = 0, - }, - }, - - }, - - [root.."-small"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.91, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.022 0.022 0.022 0.3 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[-0.07 r0.14, 0.03 r0.03, -0.07 r0.14]], - numparticles = 1, - particlelife = 20, - particlelifespread = 5, - particlesize = 15.0, - particlesizespread = 5.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -2 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[1.5 r1.5]], - sizemod = 0.96, - animParams = [[16,6,80 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], - size = 25, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], - size = 50, - sizegrowth = -0.5, - ttl = 14, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], - size = 41, - sizegrowth = 0, - ttl = 3, - texture = [[groundflash]], - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.0, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.83, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - --colormap = [[0.05 0.05 0.02 0.4 0.98 0.95 0.87 0.99 0.85 0.80 0.68 0.95 0.40 0.30 0.15 0.85 0.2 0.18 0.12 0.4 0 0 0 0.01]], - directional = true, - emitrot = 40, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 6, - particlesize = 1.1, - particlesizespread = 4.5, - particlespeed = 1.1, - particlespeedspread = 2.5, - pos = [[0, 8, 0]], - sizegrowth = [[0.8 r0.8]], - sizemod = 1.0, - texture = [[flashside3]], - --rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - explosionfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.73, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], - --colormap = [[0.05 0.05 0.02 0.4 0.98 0.95 0.87 0.99 0.85 0.80 0.68 0.95 0.40 0.30 0.15 0.85 0.2 0.18 0.12 0.4 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 7, - particlesize = 12, - particlesizespread = 16, - particlespeed = 1.0, - particlespeedspread = 1.5, - pos = [[0, 8, 0]], - sizegrowth = [[0.8 r0.8]], - sizemod = 1.0, - texture = [[BARFlame02]], - animParams = [[16,6,80 r60]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 1.8, - sizegrowth = [[-20 r7]], - ttl = 6, - pos = [[0, 5, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 2, - particlesize = 2.5, - particlesizespread = 0.66, - particlespeed = 0.55, - particlespeedspread = 0.2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.8, - alwaysVisible = 0, - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - directional=0, - emitRot=25, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.018, 0]], - numparticles=1, - particleLife=17, - particleLifeSpread=25, - particleSize=6, - particleSizeSpread=5.5, - particleSpeed=0.8, - particleSpeedSpread=3.2, - pos = [[r-1 r1, 0, r-1 r1]], - sizeGrowth = 0.6, - sizeMod = 0.99, - Texture=[[dirtpuff]], - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.4, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=15, - particleLifeSpread=25, - numparticles=1, - particleSpeed=1, - particleSpeedSpread=3.3, - particleSize=8.5, - particleSizeSpread=3.5, - directional=0, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = true, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 22, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 4, - particlesize = 1.2, - particlesizespread = -1, - particlespeed = 2.2, - particlespeedspread = 3.9, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = false, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 11, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 18, - particlelifespread = 4, - particlesize = 1.23, - particlesizespread = -1, - particlespeed = 1.66, - particlespeedspread = 2.4, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.015, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 40, - particlesize = 5, - particlesizespread = 8, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[0, 6, 0]], - sizegrowth = 0.1, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - --grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- properties = { - -- airdrag = 0.86, - -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - -- directional = true, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.02, 0]], - -- numparticles = 12, - -- particlelife = 10, - -- particlelifespread = 40, - -- particlesize = 3, - -- particlesizespread = 2, - -- particlespeed = 2.2, - -- particlespeedspread = 0.8, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.1, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.1, - particlesizespread = 1.8, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.3, - particlesizespread = 1.6, - particlespeed = 1.35, - particlespeedspread = 2.65, - pos = [[1, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 28, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 2, - particlespeed = 1.35, - particlespeedspread = 1.65, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.94, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 60, - emitrotspread = 55, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 2, - particlelife = 6, - particlelifespread = 8, - particlesize = 17, - particlesizespread = 14, - particlespeed = 1.75, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 0.88, - sizemod = 0.85, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 16, - particlelifespread = 26, - particlesize = 6.5, - particlesizespread = 20, - particlespeed = 1.8, - particlespeedspread = 4, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = 12, - sizegrowth = 1.2, - ttl = 70, - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 0, 0]], - }, - }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.4 0.4 0.4 .85 0.5 0.5 0.5 .6 0.4 0.4 0.4 .3 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 15, + particlelifespread = 40, + particlesize = 2, + particlesizespread = 12, + particlespeed = 1, + particlespeedspread = 3, + rotParams = [[-2 r4, 0, -180 r360]], + pos = [[-10 r20, -30 r10, -10 r20]], + sizegrowth = [[3.8]], + sizemod = 0.95, + texture = [[dirtrush]], + useairlos = true, + }, + }, + outerflash = { + air = false, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2.5, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 1, + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[30 r16]], + sidetexture = [[flamestream]], + size = [[16 r14]], + sizegrowth = 1, + ttl = [[28 r3]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, -10 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 1, - particlelife = 13, - particlelifespread = 30, - particlesize = [[3 r12]], - particlesizespread = 13, - particlespeed = [[2.5 i0.4]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, + [root .. "-small"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.91, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.022 0.022 0.022 0.3 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[-0.07 r0.14, 0.03 r0.03, -0.07 r0.14]], + numparticles = 1, + particlelife = 20, + particlelifespread = 5, + particlesize = 15.0, + particlesizespread = 5.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -2 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[1.5 r1.5]], + sizemod = 0.96, + animParams = [[16,6,80 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.32 0 0 0 0.01]], + size = 25, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], + size = 50, + sizegrowth = -0.5, + ttl = 14, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], + size = 41, + sizegrowth = 0, + ttl = 3, + texture = [[groundflash]], + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.0, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.83, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + --colormap = [[0.05 0.05 0.02 0.4 0.98 0.95 0.87 0.99 0.85 0.80 0.68 0.95 0.40 0.30 0.15 0.85 0.2 0.18 0.12 0.4 0 0 0 0.01]], + directional = true, + emitrot = 40, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 6, + particlesize = 1.1, + particlesizespread = 4.5, + particlespeed = 1.1, + particlespeedspread = 2.5, + pos = [[0, 8, 0]], + sizegrowth = [[0.8 r0.8]], + sizemod = 1.0, + texture = [[flashside3]], + --rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + explosionfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.73, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.066 0.66 0.28 0.04 0.033 0 0 0 0]], + --colormap = [[0.05 0.05 0.02 0.4 0.98 0.95 0.87 0.99 0.85 0.80 0.68 0.95 0.40 0.30 0.15 0.85 0.2 0.18 0.12 0.4 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 7, + particlesize = 12, + particlesizespread = 16, + particlespeed = 1.0, + particlespeedspread = 1.5, + pos = [[0, 8, 0]], + sizegrowth = [[0.8 r0.8]], + sizemod = 1.0, + texture = [[BARFlame02]], + animParams = [[16,6,80 r60]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 1.8, + sizegrowth = [[-20 r7]], + ttl = 6, + pos = [[0, 5, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 2, + particlesize = 2.5, + particlesizespread = 0.66, + particlespeed = 0.55, + particlespeedspread = 0.2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.8, + alwaysVisible = 0, + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + directional = 0, + emitRot = 25, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.018, 0]], + numparticles = 1, + particleLife = 17, + particleLifeSpread = 25, + particleSize = 6, + particleSizeSpread = 5.5, + particleSpeed = 0.8, + particleSpeedSpread = 3.2, + pos = [[r-1 r1, 0, r-1 r1]], + sizeGrowth = 0.6, + sizeMod = 0.99, + Texture = [[dirtpuff]], + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.4, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 15, + particleLifeSpread = 25, + numparticles = 1, + particleSpeed = 1, + particleSpeedSpread = 3.3, + particleSize = 8.5, + particleSizeSpread = 3.5, + directional = 0, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = true, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 22, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 4, + particlesize = 1.2, + particlesizespread = -1, + particlespeed = 2.2, + particlespeedspread = 3.9, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = false, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 11, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 18, + particlelifespread = 4, + particlesize = 1.23, + particlesizespread = -1, + particlespeed = 1.66, + particlespeedspread = 2.4, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.035 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.015, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 40, + particlesize = 5, + particlesizespread = 8, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[0, 6, 0]], + sizegrowth = 0.1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + --grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- properties = { + -- airdrag = 0.86, + -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + -- directional = true, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.02, 0]], + -- numparticles = 12, + -- particlelife = 10, + -- particlelifespread = 40, + -- particlesize = 3, + -- particlesizespread = 2, + -- particlespeed = 2.2, + -- particlespeedspread = 0.8, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.1, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.1, + particlesizespread = 1.8, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.3, + particlesizespread = 1.6, + particlespeed = 1.35, + particlespeedspread = 2.65, + pos = [[1, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 28, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 2, + particlespeed = 1.35, + particlespeedspread = 1.65, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.94, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 60, + emitrotspread = 55, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 2, + particlelife = 6, + particlelifespread = 8, + particlesize = 17, + particlesizespread = 14, + particlespeed = 1.75, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 0.88, + sizemod = 0.85, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.4 0.4 0.4 .85 0.5 0.5 0.5 .6 0.4 0.4 0.4 .3 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 15, - particlelifespread = 40, - particlesize = 2, - particlesizespread = 12, - particlespeed = 1, - particlespeedspread = 3, - rotParams = [[-2 r4, 0, -180 r360]], - pos = [[-10 r20, -30 r10, -10 r20]], - sizegrowth = [[3.8]], - sizemod = 0.95, - texture = [[dirtrush]], - useairlos = true, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.38, - -- ttl = 4, - -- expansionSpeed = 6, - -- color = [[0.7, 0.60, 0.32]], - -- alwaysVisible = false, - -- }, - -- }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 6, - sizegrowth = 0.6, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[30 r16]], - sidetexture = [[flamestream]], - size = [[16 r14]], - sizegrowth = 1, - ttl = [[28 r3]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, -10 r12, -10 r20]], - drawOrder = 0, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 16, + particlelifespread = 26, + particlesize = 6.5, + particlesizespread = 20, + particlespeed = 1.8, + particlespeedspread = 4, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = 12, + sizegrowth = 1.2, + ttl = 70, + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 0, 0]], + }, + }, - [root.."-medium"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], - numparticles = 1, - particlelife = 22, - particlelifespread = 10, - particlesize = 50.0, - particlesizespread = 10.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[1.5 r1.5]], - sizemod = 0.96, - animParams = [[16,6,150 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 3, r-2 r2]], - size = 1.0, - sizegrowth = 5.3, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - properties = { - colormap = [[1 0.7 0.3 0.38 0 0 0 0.01]], - size = 35, - sizegrowth = -1, - ttl = 17, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.12 0 0 0 0.01]], - size = 70, - sizegrowth = -1, - ttl = 17, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.7 0 0 0 0.01]], - size = 55, - sizegrowth = 0, - ttl = 4, - texture = [[groundflash]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], - --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, 0., 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 8, - particlesize = 2.5, - particlesizespread = 4.0, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = [[1.2 r1.4]], - sizemod = 0.98, - texture = [[flashside3]], - --animParams = [[16,6,60 r40]], - --rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - }, - }, - explosionfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.73, - --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 11, - particlesize = 18, - particlesizespread = 14, - particlespeed = 3, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = [[1.2 r1.4]], - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,60 r40]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 2, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 9, - maxheat = 9, - heatFalloff = 1.8, - size = 1.8, - sizeGrowth = 6, - pos = [[r-10 r8, 15, r-10 r8]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 1, + particlelife = 13, + particlelifespread = 30, + particlesize = [[3 r12]], + particlesizespread = 13, + particlespeed = [[2.5 i0.4]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2, - sizegrowth = [[-24 r7]], - ttl = 8, - pos = [[0, 5, 0]], - drawOrder = 1, - }, - }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.4 0.4 0.4 .85 0.5 0.5 0.5 .6 0.4 0.4 0.4 .3 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 15, + particlelifespread = 40, + particlesize = 2, + particlesizespread = 12, + particlespeed = 1, + particlespeedspread = 3, + rotParams = [[-2 r4, 0, -180 r360]], + pos = [[-10 r20, -30 r10, -10 r20]], + sizegrowth = [[3.8]], + sizemod = 0.95, + texture = [[dirtrush]], + useairlos = true, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.38, + -- ttl = 4, + -- expansionSpeed = 6, + -- color = [[0.7, 0.60, 0.32]], + -- alwaysVisible = false, + -- }, + -- }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 6, + sizegrowth = 0.6, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[30 r16]], + sidetexture = [[flamestream]], + size = [[16 r14]], + sizegrowth = 1, + ttl = [[28 r3]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, -10 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 2, - particlesize = 4, - particlesizespread = 1, - particlespeed = 2.9, - particlespeedspread = 0.7, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, + [root .. "-medium"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], + numparticles = 1, + particlelife = 22, + particlelifespread = 10, + particlesize = 50.0, + particlesizespread = 10.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[1.5 r1.5]], + sizemod = 0.96, + animParams = [[16,6,150 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 3, r-2 r2]], + size = 1.0, + sizegrowth = 5.3, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + properties = { + colormap = [[1 0.7 0.3 0.38 0 0 0 0.01]], + size = 35, + sizegrowth = -1, + ttl = 17, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.12 0 0 0 0.01]], + size = 70, + sizegrowth = -1, + ttl = 17, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.7 0 0 0 0.01]], + size = 55, + sizegrowth = 0, + ttl = 4, + texture = [[groundflash]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], + --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0., 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 8, + particlesize = 2.5, + particlesizespread = 4.0, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = [[1.2 r1.4]], + sizemod = 0.98, + texture = [[flashside3]], + --animParams = [[16,6,60 r40]], + --rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + }, + }, + explosionfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.73, + --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 11, + particlesize = 18, + particlesizespread = 14, + particlespeed = 3, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = [[1.2 r1.4]], + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,60 r40]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 2, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 9, + maxheat = 9, + heatFalloff = 1.8, + size = 1.8, + sizeGrowth = 6, + pos = [[r-10 r8, 15, r-10 r8]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.9, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=25, - particleLifeSpread=50, - numparticles=1, - particleSpeed=1.5, - particleSpeedSpread=4.5, - particleSize=18, - particleSizeSpread=14, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2, + sizegrowth = [[-24 r7]], + ttl = 8, + pos = [[0, 5, 0]], + drawOrder = 1, + }, + }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.2, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=20, - particleLifeSpread=40, - numparticles=2, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=18, - particleSizeSpread=12, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - }, - }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 2, + particlesize = 4, + particlesizespread = 1, + particlespeed = 2.9, + particlespeedspread = 0.7, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 3, - particlelife = 6, - particlelifespread = 8, - particlesize = 24, - particlesizespread = 16, - particlespeed = 4.1, - particlespeedspread = 2.6, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.85, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.9, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 25, + particleLifeSpread = 50, + numparticles = 1, + particleSpeed = 1.5, + particleSpeedSpread = 4.5, + particleSize = 18, + particleSizeSpread = 14, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 3, - particlelife = 18, - particlelifespread = 30, - particlesize = 7.5, - particlesizespread = 22, - particlespeed = 1.8, - particlespeedspread = 5, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.2, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 20, + particleLifeSpread = 40, + numparticles = 2, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 18, + particleSizeSpread = 12, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + }, + }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = 15, - sizegrowth = 1.3, - ttl = 80, - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 0, 0]], - }, - }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 3, + particlelife = 6, + particlelifespread = 8, + particlesize = 24, + particlesizespread = 16, + particlespeed = 4.1, + particlespeedspread = 2.6, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.85, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 2, - particlelife = 15, - particlelifespread = 40, - particlesize = [[4 r16]], - particlesizespread = 16, - particlespeed = [[3 i0.5]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 18, + particlelifespread = 30, + particlesize = 7.5, + particlesizespread = 22, + particlespeed = 1.8, + particlespeedspread = 5, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = true, - unit = false, - underwater = false, - properties = { - airdrag = 0.97, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 18, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 3, - particlelife = 19, - particlelifespread = 5, - particlesize = 1.5, - particlesizespread = -1.15, - particlespeed = 2.95, - particlespeedspread = 3.9, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - water = false, - air = false, - ground = false, - unit = false, - nounit = true, - underwater = false, - properties = { - airdrag = 0.97, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2.5, - particlelife = 21, - particlelifespread = 5, - particlesize = 1.55, - particlesizespread = -1.2, - particlespeed = 2.5, - particlespeedspread = 4.3, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = 15, + sizegrowth = 1.3, + ttl = 80, + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 0, 0]], + }, + }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 32, - particlelifespread = 0, - particlesize = 2.6, - particlesizespread = 4.1, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - castShadow = true, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 2, + particlelife = 15, + particlelifespread = 40, + particlesize = [[4 r16]], + particlesizespread = 16, + particlespeed = [[3 i0.5]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 32, - particlelifespread = 0, - particlesize = 2.8, - particlesizespread = 4.3, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - castShadow = true, - }, - }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = true, + unit = false, + underwater = false, + properties = { + airdrag = 0.97, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 18, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 3, + particlelife = 19, + particlelifespread = 5, + particlesize = 1.5, + particlesizespread = -1.15, + particlespeed = 2.95, + particlespeedspread = 3.9, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = false, + air = false, + ground = false, + unit = false, + nounit = true, + underwater = false, + properties = { + airdrag = 0.97, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2.5, + particlelife = 21, + particlelifespread = 5, + particlesize = 1.55, + particlesizespread = -1.2, + particlespeed = 2.5, + particlespeedspread = 4.3, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 32, - particlelifespread = 0, - particlesize = 3.0, - particlesizespread = 4.3, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 32, + particlelifespread = 0, + particlesize = 2.6, + particlesizespread = 4.1, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + castShadow = true, + }, + }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.85, - colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.033 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.02, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 40, - particlesize = 35, - particlesizespread = 22, - particlespeed = 0.8, - particlespeedspread = 2.2, - pos = [[0, 4, 0]], - sizegrowth = 0.22, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 32, + particlelifespread = 0, + particlesize = 2.8, + particlesizespread = 4.3, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + castShadow = true, + }, + }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.45 0.45 0.45 .90 0.4 0.4 0.4 .68 0.3 0.3 0.3 .39 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.04, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 60, - particlesize = 2, - particlesizespread = 12, - particlespeed = 1, - particlespeedspread = 3, - rotParams = [[-4 r8, -2 r4, -180 r360]], - pos = [[-20 r40, -55 r10, -20 r40]], - sizegrowth = [[4.1 r0.4]], - sizemod = 0.93, - texture = [[dirtrush]], - useairlos = true, - drawOrder = 1, - castShadow = true, - }, - }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 32, + particlelifespread = 0, + particlesize = 3.0, + particlesizespread = 4.3, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[16 r10]], - sidetexture = [[flamestream]], - size = [[13 r7]], - sizegrowth = 1.5, - ttl = [[25 r2]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-7 r14, -4 r6, -7 r14]], - drawOrder = 0, - castShadow = true, - }, - }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.85, + colormap = [[0 0 0 0.01 0.025 0.025 0.025 0.033 0.06 0.06 0.06 0.08 0.05 0.05 0.05 0.065 0.026 0.026 0.026 0.035 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.02, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 40, + particlesize = 35, + particlesizespread = 22, + particlespeed = 0.8, + particlespeedspread = 2.2, + pos = [[0, 4, 0]], + sizegrowth = 0.22, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 0, - air = false, - ground = true, - water = false, - underwater = false, - unit = true, - properties = { - colormap = [[0.62 0.65 0.65 0.6 1 1 1 0.8 1 0.85 0.85 0.7 0.75 0.45 0.45 0.5 0.35 0.35 0.35 0.3 0 0 0 0.01]], - --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - size = [[13 r40]], - sizegrowth = 0.1, - --sizemod = 0.95, - ttl = 18, - --sizegrowth = 10, - pos = [[0, 15, 0]], - rotParams = [[-4 r8, -4 r8, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,18 r5]], - }, - }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.45 0.45 0.45 .90 0.4 0.4 0.4 .68 0.3 0.3 0.3 .39 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.04, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 60, + particlesize = 2, + particlesizespread = 12, + particlespeed = 1, + particlespeedspread = 3, + rotParams = [[-4 r8, -2 r4, -180 r360]], + pos = [[-20 r40, -55 r10, -20 r40]], + sizegrowth = [[4.1 r0.4]], + sizemod = 0.93, + texture = [[dirtrush]], + useairlos = true, + drawOrder = 1, + castShadow = true, + }, + }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 9, - heatfalloff = 1.5, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 12, - sizegrowth = 0.55, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[16 r10]], + sidetexture = [[flamestream]], + size = [[13 r7]], + sizegrowth = 1.5, + ttl = [[25 r2]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-7 r14, -4 r6, -7 r14]], + drawOrder = 0, + castShadow = true, + }, + }, - [root.."-large"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.96, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.05 r0.03, -0.09 r0.18]], - numparticles = 1, - particlelife = 28, - particlelifespread = 6, - particlesize = 130.0, - particlesizespread = 35.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2.5 r1.5]], - sizemod = 0.97, - animParams = [[16,6,250 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.4, - maxheat = 14, - pos = [[r-2 r2, 5, r-2 r2]], - size = 3, - sizegrowth = 12, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], - size = 70, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], - size = 140, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 110, - sizegrowth = 0, - ttl = 4, - texture = [[groundflash]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[1 0.9 0.6 0.11 0.9 0.5 0.2 0.08 0.66 0.28 0.04 0.033 0 0 0 0]], - directional = true, - emitrot = 25, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 8, - particlelife = 6, - particlelifespread = 13, - particlesize = 13, - particlesizespread = 20, - particlespeed = 0.99, - particlespeedspread = 2.3, - pos = [[0, 4, 0]], - sizegrowth = 0.44, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 10, - maxheat = 12, - heatFalloff = 1.5, - size = 4, - sizeGrowth = 8, - pos = [[r-10 r8, 16, r-10 r8]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 3, - particlelife = 7.6, - particlelifespread = 6.5, - particlesize = 4.5, - particlesizespread = 1.2, - particlespeed = 2.25, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 0.93, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.75, - alwaysVisible = 0, - colormap=[[1 0.66 0.4 0.45 0.28 0.18 0.12 0.42 0.17 0.14 0.10 0.36 0.12 0.11 0.1 0.33 0.1 0.09 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - directional=0, - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles=2, - particleLife=25, - particleLifeSpread=70, - particleSize=13, - particleSizeSpread=24, - particleSpeed=3.5, - particleSpeedSpread=9, - pos = [[r-1 r1, 0, r-1 r1]], - rotParams = [[-4 r8, -1 r2, -180 r360]], - sizeGrowth = 0.66, - sizeMod = 1, - Texture=[[dirtpuff]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.6, - alwaysVisible = 0, - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - directional=0, - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - numparticles=1, - particleLife=20, - particleLifeSpread=45, - particleSize=27, - particleSizeSpread=27, - particleSpeed=5, - particleSpeedSpread=8, - pos = [[r-1 r1, 0, r-1 r1]], - rotParams = [[-4 r8, -1 r2, -180 r360]], - sizeGrowth = 0.35, - sizeMod = 1, - Texture=[[fogdirty]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.10, 0]], - numparticles = 4, - particlelife = 8, - particlelifespread = 12, - particlesize = 35, - particlesizespread = 25, - particlespeed = 9.5, - particlespeedspread = 3.4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.77, - texture = [[gunshotxl]], - useairlos = false, - drawOrder = 2, - }, - }, + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 0, + air = false, + ground = true, + water = false, + underwater = false, + unit = true, + properties = { + colormap = [[0.62 0.65 0.65 0.6 1 1 1 0.8 1 0.85 0.85 0.7 0.75 0.45 0.45 0.5 0.35 0.35 0.35 0.3 0 0 0 0.01]], + --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + size = [[13 r40]], + sizegrowth = 0.1, + --sizemod = 0.95, + ttl = 18, + --sizegrowth = 10, + pos = [[0, 15, 0]], + rotParams = [[-4 r8, -4 r8, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,18 r5]], + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 6, - particlelife = 18, - particlelifespread = 30, - particlesize = 8.5, - particlesizespread = 25, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 9, + heatfalloff = 1.5, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 12, + sizegrowth = 0.55, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = 23, - sizegrowth = 1.2, - ttl = 90, - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 0, 0]], - }, - }, + [root .. "-large"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.96, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.05 r0.03, -0.09 r0.18]], + numparticles = 1, + particlelife = 28, + particlelifespread = 6, + particlesize = 130.0, + particlesizespread = 35.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2.5 r1.5]], + sizemod = 0.97, + animParams = [[16,6,250 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.4, + maxheat = 14, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], + size = 70, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], + size = 140, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 110, + sizegrowth = 0, + ttl = 4, + texture = [[groundflash]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[1 0.9 0.6 0.11 0.9 0.5 0.2 0.08 0.66 0.28 0.04 0.033 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 8, + particlelife = 6, + particlelifespread = 13, + particlesize = 13, + particlesizespread = 20, + particlespeed = 0.99, + particlespeedspread = 2.3, + pos = [[0, 4, 0]], + sizegrowth = 0.44, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 10, + maxheat = 12, + heatFalloff = 1.5, + size = 4, + sizeGrowth = 8, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 3, + particlelife = 7.6, + particlelifespread = 6.5, + particlesize = 4.5, + particlesizespread = 1.2, + particlespeed = 2.25, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 0.93, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + colormap = [[1 0.66 0.4 0.45 0.28 0.18 0.12 0.42 0.17 0.14 0.10 0.36 0.12 0.11 0.1 0.33 0.1 0.09 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + directional = 0, + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 2, + particleLife = 25, + particleLifeSpread = 70, + particleSize = 13, + particleSizeSpread = 24, + particleSpeed = 3.5, + particleSpeedSpread = 9, + pos = [[r-1 r1, 0, r-1 r1]], + rotParams = [[-4 r8, -1 r2, -180 r360]], + sizeGrowth = 0.66, + sizeMod = 1, + Texture = [[dirtpuff]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.6, + alwaysVisible = 0, + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + directional = 0, + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particleLife = 20, + particleLifeSpread = 45, + particleSize = 27, + particleSizeSpread = 27, + particleSpeed = 5, + particleSpeedSpread = 8, + pos = [[r-1 r1, 0, r-1 r1]], + rotParams = [[-4 r8, -1 r2, -180 r360]], + sizeGrowth = 0.35, + sizeMod = 1, + Texture = [[fogdirty]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.10, 0]], + numparticles = 4, + particlelife = 8, + particlelifespread = 12, + particlesize = 35, + particlesizespread = 25, + particlespeed = 9.5, + particlespeedspread = 3.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.77, + texture = [[gunshotxl]], + useairlos = false, + drawOrder = 2, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 2, - particlelife = 17, - particlelifespread = 40, - particlesize = [[5 r18]], - particlesizespread = 18, - particlespeed = [[4 i0.6]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - castShadow = true, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 18, + particlelifespread = 30, + particlesize = 8.5, + particlesizespread = 25, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 6, - sizegrowth = [[-13 r7]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 0.95, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 4, - particlelife = 21, - particlelifespread = 5, - particlesize = 1.75, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 5, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - unit = false, - nounit = true, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.09 0.07 0.033 0.66 0.085 0.07 0.033 0.58 0.08 0.07 0.033 0.5 0.075 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 1, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 5, - particlelife = 28, - particlelifespread = 4, - particlesize = 1.8, - particlesizespread = -1.4, - particlespeed = 3.6, - particlespeedspread = 3.4, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 36, - particlelifespread = 0, - particlesize = 1.9, - particlesizespread = 2.3, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0.01 0.01 0.01 0.1 0.20 0.20 0.20 0.50 0.27 0.27 0.27 0.74 0.23 0.23 0.23 0.85 0.18 0.18 0.18 0.68 0.10 0.10 0.10 0.45 0.05 0.05 0.05 0.24 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 1, - particlelife = 45, - particlelifespread = 50, - particlesize = 68, - particlesizespread = 80, - particlespeed = 1.2, - particlespeedspread = 2.5, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.22, - sizemod = 1.0, - texture = [[smoke-ice-anim]], - animParams = [[8,8,85 r40]], - drawOrder = 0, - --castShadow = true, - }, - }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.05, 0]], - numparticles = 1, - particlelife = 22, - particlelifespread = 40, - particlesize = 7, - particlesizespread = 25, - particlespeed = 2, - particlespeedspread = 4, - rotParams = [[-3 r6, -3 r6, -180 r360]], - pos = [[-18 r36, -30 r10, -18 r36]], - sizegrowth = [[5.0 r0.65]], - sizemod = 0.95, - texture = [[dirtrush]], - useairlos = true, - drawOrder = 1, - castShadow = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 15, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - castShadow = true, - }, - }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.85 0.85 0.85 0.75 0.55 0.55 0.55 0.4 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = 23, + sizegrowth = 1.2, + ttl = 90, + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 0, 0]], + }, + }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.94 0.64 0.27 0.86 0.93 0.62 0.25 0.65 0.07 0.05 0.05 0.61 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[53 r24]], - sidetexture = [[flamestream]], - size = [[36 r11]], - sizegrowth = 1.1, - ttl = [[24 r3]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 0, - castShadow = true, - }, - }, - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 0, - air = false, - ground = true, - water = false, - underwater = false, - unit = true, - properties = { - colormap = [[0.62 0.65 0.65 0.6 1 1 1 0.8 1 0.85 0.85 0.7 0.75 0.45 0.45 0.5 0.35 0.35 0.35 0.3 0 0 0 0.01]], - --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - size = [[18 r70]], - sizegrowth = 0.2, - --sizemod = 0.95, - ttl = 20, - --sizegrowth = 10, - pos = [[0, 15, 0]], - rotParams = [[-4 r8, -4 r8, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,20 r5]], - }, - }, - --kickedupwater = { - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 120, - -- particlelife = 2, - -- particlelifespread = 30, - -- particlesize = 2, - -- particlesizespread = 1, - -- particlespeed = 10, - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.5, - -- sizemod = 1.0, - -- texture = [[wake]], - -- }, - --}, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 2, + particlelife = 17, + particlelifespread = 40, + particlesize = [[5 r18]], + particlesizespread = 18, + particlespeed = [[4 i0.6]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + castShadow = true, + }, + }, -[root.."-large-aoe-ship"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.96, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 1.0 0.97 0.7 0.98 0.8 0.55 0.33 0.95 0.19 0.15 0.12 0.85 0.14 0.12 0.1 0.63 0.09 0.08 0.07 0.4 0.022 0.022 0.022 0.2 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.06 r0.12, 0.06 r0.05, -0.06 r0.12]], - numparticles = 1, - particlelife = 24, - particlelifespread = 14, - particlesize = 140.0, - particlesizespread = 60.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, 0 r20, -5 r10]], - rotParams = [[-3 r6, -1 r2, -180 r360]], - sizegrowth = [[2.2 r1.4]], - sizemod = 0.98, - animParams = [[16,6,100 r190]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - castShadow = true, - }, - }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.14 0.75 0.65 0.4 0.50 0.24 0.15 0.10 0.010 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 6, + sizegrowth = [[-13 r7]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 0.95, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 4, + particlelife = 21, + particlelifespread = 5, + particlesize = 1.75, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 5, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.09 0.07 0.033 0.66 0.085 0.07 0.033 0.58 0.08 0.07 0.033 0.5 0.075 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 28, + particlelifespread = 4, + particlesize = 1.8, + particlesizespread = -1.4, + particlespeed = 3.6, + particlespeedspread = 3.4, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 36, + particlelifespread = 0, + particlesize = 1.9, + particlesizespread = 2.3, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0.01 0.01 0.01 0.1 0.20 0.20 0.20 0.50 0.27 0.27 0.27 0.74 0.23 0.23 0.23 0.85 0.18 0.18 0.18 0.68 0.10 0.10 0.10 0.45 0.05 0.05 0.05 0.24 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 50, + particlesize = 68, + particlesizespread = 80, + particlespeed = 1.2, + particlespeedspread = 2.5, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.22, + sizemod = 1.0, + texture = [[smoke-ice-anim]], + animParams = [[8,8,85 r40]], + drawOrder = 0, + --castShadow = true, + }, + }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.43 0.43 0.43 .72 0.39 0.39 0.39 .35 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.05, 0]], + numparticles = 1, + particlelife = 22, + particlelifespread = 40, + particlesize = 7, + particlesizespread = 25, + particlespeed = 2, + particlespeedspread = 4, + rotParams = [[-3 r6, -3 r6, -180 r360]], + pos = [[-18 r36, -30 r10, -18 r36]], + sizegrowth = [[5.0 r0.65]], + sizemod = 0.95, + texture = [[dirtrush]], + useairlos = true, + drawOrder = 1, + castShadow = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 15, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + castShadow = true, + }, + }, - -- shockwave-old = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 4, - -- sizegrowth = -14, - -- ttl = 11, - -- pos = [[0, 5, 0]], - -- drawOrder = 1, - -- }, - -- }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.94 0.64 0.27 0.86 0.93 0.62 0.25 0.65 0.07 0.05 0.05 0.61 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[53 r24]], + sidetexture = [[flamestream]], + size = [[36 r11]], + sizegrowth = 1.1, + ttl = [[24 r3]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 0, + castShadow = true, + }, + }, + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 0, + air = false, + ground = true, + water = false, + underwater = false, + unit = true, + properties = { + colormap = [[0.62 0.65 0.65 0.6 1 1 1 0.8 1 0.85 0.85 0.7 0.75 0.45 0.45 0.5 0.35 0.35 0.35 0.3 0 0 0 0.01]], + --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + size = [[18 r70]], + sizegrowth = 0.2, + --sizemod = 0.95, + ttl = 20, + --sizegrowth = 10, + pos = [[0, 15, 0]], + rotParams = [[-4 r8, -4 r8, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,20 r5]], + }, + }, + --kickedupwater = { + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 120, + -- particlelife = 2, + -- particlelifespread = 30, + -- particlesize = 2, + -- particlesizespread = 1, + -- particlespeed = 10, + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.5, + -- sizemod = 1.0, + -- texture = [[wake]], + -- }, + --}, + }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.40 0.40 0.40 .65 0.37 0.37 0.37 .25 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.06, 0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 38, - particlesize = 6, - particlesizespread = 23, - particlespeed = 3, - particlespeedspread = 5, - rotParams = [[-4 r8, -3 r6, -180 r360]], - pos = [[-18 r36, -45 r15, -18 r36]], - sizegrowth = [[5.2 r0.9]], - sizemod = 0.94, - texture = [[dirtrush]], - useairlos = true, - drawOrder = 1, - castShadow = true, - }, - }, + [root .. "-large-aoe-ship"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.96, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 1.0 0.97 0.7 0.98 0.8 0.55 0.33 0.95 0.19 0.15 0.12 0.85 0.14 0.12 0.1 0.63 0.09 0.08 0.07 0.4 0.022 0.022 0.022 0.2 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.06 r0.12, 0.06 r0.05, -0.06 r0.12]], + numparticles = 1, + particlelife = 24, + particlelifespread = 14, + particlesize = 140.0, + particlesizespread = 60.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, 0 r20, -5 r10]], + rotParams = [[-3 r6, -1 r2, -180 r360]], + sizegrowth = [[2.2 r1.4]], + sizemod = 0.98, + animParams = [[16,6,100 r190]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + castShadow = true, + }, + }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.4, - maxheat = 14, - pos = [[r-2 r2, 10, r-2 r2]], - size = 3.0, - sizegrowth = 13, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], - size = 100, - sizegrowth = -1.5, - ttl = 20, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], - size = 175, - sizegrowth = -1.5, - ttl = 20, - texture = [[groundflash]], - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.93 0.75 0.2 0 0 0 0.01]], - size = 2, - sizegrowth = 16, - ttl = 15, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 190, - sizegrowth = 0, - ttl = 5, - texture = [[groundflash]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.8, - size = 5, - sizeGrowth = 13, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - explosionanim = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.73, - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 65, - emitrotspread = 24, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.35, 0]], - numparticles = 2, - particlelife = 6, - particlelifespread = 18, - particlesize = 50, - particlesizespread = 29, - particlespeed = 4.8, - particlespeedspread = 7.3, - pos = [[0, 5, 0]], - sizegrowth = [[2.5 r1.8]], - sizemod = 0.99, - texture = [[BARFlame02]], - animParams = [[16,6,60 r40]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 2, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.83, - colormap = [[1 0.9 0.7 0.11 0.9 0.6 0.3 0.15 0.66 0.30 0.05 0.033 0.55 0.15 0.02 0.011 0 0 0 0]], - directional = true, - emitrot = 35, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 1.9, - particlelifespread = 13, - particlesize = 27.5, - particlesizespread = 22, - particlespeed = 5.8, - particlespeedspread = 4.3, - pos = [[0, 5, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.16 0.85 0.70 0.5 0.68 0.65 0.42 0.25 0.26 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 5.2, - sizegrowth = [[-22 r4]], - ttl = 9, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 5, - particlelife = 13.6, - particlelifespread = 8.5, - particlesize = 5.5, - particlesizespread = 1.2, - particlespeed = 4.25, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 0.91, - texture = [[randomdots]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.80, - alwaysVisible = 0, - sizeGrowth = 0.66, - sizeMod = 1, - pos = [[-1 r2, 0, -1 r2]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=60, - particleLifeSpread=30, - numparticles=2, - particleSpeed=3, - particleSpeedSpread=5, - particleSize=35, - particleSizeSpread=50, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1, - pos = [[-1 r2, 0, -1 r2]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=22, - particleLifeSpread=50, - numparticles=1, - particleSpeed=5, - particleSpeedSpread=8, - particleSize=38, - particleSizeSpread=27, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], - directional = true, - emitrot = 25, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.04, 0]], - numparticles = 3, - particlelife = 11, - particlelifespread = 15, - particlesize = 43, - particlesizespread = 37, - particlespeed = 15.5, - particlespeedspread = 7.4, - pos = [[0, 0, 0]], - sizegrowth = 1, - sizemod = 0.78, - texture = [[gunshotxl]], - useairlos = false, - drawOrder = 2, - --castShadow = true, - }, - }, + -- shockwave-old = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 4, + -- sizegrowth = -14, + -- ttl = 11, + -- pos = [[0, 5, 0]], + -- drawOrder = 1, + -- }, + -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 26, - particlelifespread = 5, - particlesize = 12.25, - particlesizespread = -1.8, - particlespeed = 3.3, - particlespeedspread = 3, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - --castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - unit = false, - nounit = true, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.3 0.1 0.07 0.033 0.40 0.1 0.07 0.033 0.38 0.1 0.07 0.033 0.27 0 0 0 0 ]], - directional = false, - emitrot = 1, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 1, - particlelife = 17, - particlelifespread = 9, - particlesize = 16, - particlesizespread = 4, - particlespeed = 2.6, - particlespeedspread = 1.4, - pos = [[0, 6, 0]], - rotParams = [[-40 r80, -20 r40, -180 r360]], - sizegrowth = 1.8, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = false, - emitrot = 25, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.22, 0]], - numparticles = [[2 r1]], - particlelife = 33, - particlelifespread = 12, - particlesize = 1.9, - particlesizespread = 3.3, - particlespeed = 6.5, - particlespeedspread = 8, - pos = [[0, 0, 0]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - --castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = true, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = false, - emitrot = 25, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.22, 0]], - numparticles = [[1 r1.5]], - particlelife = 36, - particlelifespread = 0, - particlesize = 4, - particlesizespread = 6.35, - particlespeed = 5.5, - particlespeedspread = 6, - pos = [[0, 2, 0]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 60, - particlesize = 60, - particlesizespread = 40, - particlespeed = 1.2, - particlespeedspread = 2.5, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - castShadow = true, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 3, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.5 r1, 0.7 r0.40, -0.5 r1]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[52 r30]], - sidetexture = [[flamestream]], - size = [[40 r14]], - sizegrowth = 1.2, - ttl = [[32 r4]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 1, - castShadow = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 15, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.40 0.40 0.40 .65 0.37 0.37 0.37 .25 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.06, 0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 38, + particlesize = 6, + particlesizespread = 23, + particlespeed = 3, + particlespeedspread = 5, + rotParams = [[-4 r8, -3 r6, -180 r360]], + pos = [[-18 r36, -45 r15, -18 r36]], + sizegrowth = [[5.2 r0.9]], + sizemod = 0.94, + texture = [[dirtrush]], + useairlos = true, + drawOrder = 1, + castShadow = true, + }, + }, - [root.."-large-aoe"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.96, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 1.0 0.97 0.7 0.98 0.8 0.55 0.33 0.95 0.19 0.15 0.12 0.85 0.14 0.12 0.1 0.63 0.09 0.08 0.07 0.4 0.022 0.022 0.022 0.2 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.06 r0.12, 0.06 r0.05, -0.06 r0.12]], - numparticles = 1, - particlelife = 24, - particlelifespread = 14, - particlesize = 140.0, - particlesizespread = 60.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, 0 r20, -5 r10]], - rotParams = [[-3 r6, -1 r2, -180 r360]], - sizegrowth = [[2.2 r1.4]], - sizemod = 0.98, - animParams = [[16,6,100 r190]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - castShadow = true, - }, - }, - -- Swirl-test looking interesting! needs further work - -- swirl = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 2, - -- ground = true, - -- underwater = false, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 1 0.98 0.8 0.8 0.98 0.85 0.6 0.3 0.95 0.75 0.3 0.25 0.1 0.1 0.1 0.20 0.08 0.08 0.08 0.2 0.01 0.01 0.01 0.02]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[none]], - -- length = 30, - -- sidetexture = [[swirl]], - -- size = [[14 r6]], - -- sizegrowth = [[4 r1]], - -- ttl = 28, - -- pos = [[0, -10, 0]], - -- rotParams = [[-10 r20, -10 r20, -180 r360]], - -- animParams = [[8,8,25 r30]], - -- drawOrder = 0, - -- }, - -- }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.4, - maxheat = 14, - pos = [[r-2 r2, 10, r-2 r2]], - size = 3.2, - sizegrowth = 14, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 2, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], - size = 110, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], - size = 190, - sizegrowth = -1.5, - ttl = 22, - texture = [[groundflash]], - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.93 0.75 0.2 0 0 0 0.01]], - size = 2, - sizegrowth = 16, - ttl = 15, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], - size = 190, - sizegrowth = 0, - ttl = 5, - texture = [[groundflash]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.8, - size = 6, - sizeGrowth = 13, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - explosionanim = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.73, - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 65, - emitrotspread = 24, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.35, 0]], - numparticles = 3, - particlelife = 6, - particlelifespread = 18, - particlesize = 40, - particlesizespread = 22, - particlespeed = 4.8, - particlespeedspread = 7.3, - pos = [[0, 5, 0]], - sizegrowth = [[2.5 r1.8]], - sizemod = 1.0, - texture = [[BARFlame02]], - animParams = [[16,6,60 r40]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 2, - castShadow = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.83, - colormap = [[1 0.9 0.7 0.11 0.9 0.6 0.3 0.15 0.66 0.30 0.05 0.033 0.55 0.15 0.02 0.011 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 14, - particlelife = 1.9, - particlelifespread = 13, - particlesize = 24.5, - particlesizespread = 20, - particlespeed = 5.8, - particlespeedspread = 4.3, - pos = [[0, 5, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 6.2, - sizegrowth = [[-20 r4]], - ttl = 9, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - -- no success with animated shockwave - -- groundblast = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = false, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 0 0 0 0 1 0.98 0.8 0.8 0.96 0.96 0.8 0.4 0.95 0.95 0.6 0.22 0.7 0.65 0.3 0.14 0.3 0.2 0.1 0.08 0.01 0.01 0.01 0.02]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[smoke-ice-anim]], - -- animParams = [[8,8,60 r40]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 18.2, - -- sizegrowth = [[5 r4]], - -- ttl = 20, - -- pos = [[0, 20, 0]], - -- rotParams = [[-10 r20, -10 r20, -180 r360]], - -- drawOrder = 0, - -- }, - -- }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 5, - particlelife = 13.6, - particlelifespread = 8.5, - particlesize = 5.5, - particlesizespread = 1.2, - particlespeed = 4.25, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 0.91, - texture = [[randomdots]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.80, - alwaysVisible = 0, - sizeGrowth = 0.66, - sizeMod = 1, - pos = [[-1 r2, 0, -1 r2]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=60, - particleLifeSpread=30, - numparticles=2, - particleSpeed=3, - particleSpeedSpread=5, - particleSize=25, - particleSizeSpread=40, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=2, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1, - pos = [[-1 r2, 0, -1 r2]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=22, - particleLifeSpread=50, - numparticles=1, - particleSpeed=5, - particleSpeedSpread=8, - particleSize=32, - particleSizeSpread=22, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 5, - particlelife = 13, - particlelifespread = 18, - particlesize = 40, - particlesizespread = 35, - particlespeed = 15.5, - particlespeedspread = 7.4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.78, - texture = [[gunshotxl]], - useairlos = false, - drawOrder = 2, - --castShadow = true, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.4, + maxheat = 14, + pos = [[r-2 r2, 10, r-2 r2]], + size = 3.0, + sizegrowth = 13, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], + size = 100, + sizegrowth = -1.5, + ttl = 20, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], + size = 175, + sizegrowth = -1.5, + ttl = 20, + texture = [[groundflash]], + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.93 0.75 0.2 0 0 0 0.01]], + size = 2, + sizegrowth = 16, + ttl = 15, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 5, + texture = [[groundflash]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.8, + size = 5, + sizeGrowth = 13, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + explosionanim = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.73, + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 65, + emitrotspread = 24, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.35, 0]], + numparticles = 2, + particlelife = 6, + particlelifespread = 18, + particlesize = 50, + particlesizespread = 29, + particlespeed = 4.8, + particlespeedspread = 7.3, + pos = [[0, 5, 0]], + sizegrowth = [[2.5 r1.8]], + sizemod = 0.99, + texture = [[BARFlame02]], + animParams = [[16,6,60 r40]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 2, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.83, + colormap = [[1 0.9 0.7 0.11 0.9 0.6 0.3 0.15 0.66 0.30 0.05 0.033 0.55 0.15 0.02 0.011 0 0 0 0]], + directional = true, + emitrot = 35, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 1.9, + particlelifespread = 13, + particlesize = 27.5, + particlesizespread = 22, + particlespeed = 5.8, + particlespeedspread = 4.3, + pos = [[0, 5, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.16 0.85 0.70 0.5 0.68 0.65 0.42 0.25 0.26 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 5.2, + sizegrowth = [[-22 r4]], + ttl = 9, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 5, + particlelife = 13.6, + particlelifespread = 8.5, + particlesize = 5.5, + particlesizespread = 1.2, + particlespeed = 4.25, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 0.91, + texture = [[randomdots]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.80, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[-1 r2, 0, -1 r2]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 60, + particleLifeSpread = 30, + numparticles = 2, + particleSpeed = 3, + particleSpeedSpread = 5, + particleSize = 35, + particleSizeSpread = 50, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1, + pos = [[-1 r2, 0, -1 r2]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 22, + particleLifeSpread = 50, + numparticles = 1, + particleSpeed = 5, + particleSpeedSpread = 8, + particleSize = 38, + particleSizeSpread = 27, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0.01]], + directional = true, + emitrot = 25, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.04, 0]], + numparticles = 3, + particlelife = 11, + particlelifespread = 15, + particlesize = 43, + particlesizespread = 37, + particlespeed = 15.5, + particlespeedspread = 7.4, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[gunshotxl]], + useairlos = false, + drawOrder = 2, + --castShadow = true, + }, + }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 9, - particlelife = 26, - particlelifespread = 5, - particlesize = 1.75, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 3, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - --castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - unit = false, - nounit = true, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 1, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 5, - particlelife = 28, - particlelifespread = 4, - particlesize = 1.8, - particlesizespread = -1.4, - particlespeed = 3.6, - particlespeedspread = 3.4, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - castShadow = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 1.9, - particlesizespread = 2.3, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 60, - particlesize = 60, - particlesizespread = 40, - particlespeed = 1.2, - particlespeedspread = 2.5, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - castShadow = true, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 3, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[55 r20]], - sidetexture = [[flamestream]], - size = [[40 r14]], - sizegrowth = 1.2, - ttl = [[32 r4]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 1, - castShadow = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 15, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - }, - }, - }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 26, + particlelifespread = 5, + particlesize = 12.25, + particlesizespread = -1.8, + particlespeed = 3.3, + particlespeedspread = 3, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + --castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.3 0.1 0.07 0.033 0.40 0.1 0.07 0.033 0.38 0.1 0.07 0.033 0.27 0 0 0 0 ]], + directional = false, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 1, + particlelife = 17, + particlelifespread = 9, + particlesize = 16, + particlesizespread = 4, + particlespeed = 2.6, + particlespeedspread = 1.4, + pos = [[0, 6, 0]], + rotParams = [[-40 r80, -20 r40, -180 r360]], + sizegrowth = 1.8, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = false, + emitrot = 25, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.22, 0]], + numparticles = [[2 r1]], + particlelife = 33, + particlelifespread = 12, + particlesize = 1.9, + particlesizespread = 3.3, + particlespeed = 6.5, + particlespeedspread = 8, + pos = [[0, 0, 0]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + --castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = true, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = false, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.22, 0]], + numparticles = [[1 r1.5]], + particlelife = 36, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 6.35, + particlespeed = 5.5, + particlespeedspread = 6, + pos = [[0, 2, 0]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 60, + particlesize = 60, + particlesizespread = 40, + particlespeed = 1.2, + particlespeedspread = 2.5, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + castShadow = true, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 3, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.5 r1, 0.7 r0.40, -0.5 r1]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[52 r30]], + sidetexture = [[flamestream]], + size = [[40 r14]], + sizegrowth = 1.2, + ttl = [[32 r4]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 1, + castShadow = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 15, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + [root .. "-large-aoe"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.96, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 1.0 0.97 0.7 0.98 0.8 0.55 0.33 0.95 0.19 0.15 0.12 0.85 0.14 0.12 0.1 0.63 0.09 0.08 0.07 0.4 0.022 0.022 0.022 0.2 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.06 r0.12, 0.06 r0.05, -0.06 r0.12]], + numparticles = 1, + particlelife = 24, + particlelifespread = 14, + particlesize = 140.0, + particlesizespread = 60.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, 0 r20, -5 r10]], + rotParams = [[-3 r6, -1 r2, -180 r360]], + sizegrowth = [[2.2 r1.4]], + sizemod = 0.98, + animParams = [[16,6,100 r190]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + castShadow = true, + }, + }, + -- Swirl-test looking interesting! needs further work + -- swirl = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 2, + -- ground = true, + -- underwater = false, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 1 0.98 0.8 0.8 0.98 0.85 0.6 0.3 0.95 0.75 0.3 0.25 0.1 0.1 0.1 0.20 0.08 0.08 0.08 0.2 0.01 0.01 0.01 0.02]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[none]], + -- length = 30, + -- sidetexture = [[swirl]], + -- size = [[14 r6]], + -- sizegrowth = [[4 r1]], + -- ttl = 28, + -- pos = [[0, -10, 0]], + -- rotParams = [[-10 r20, -10 r20, -180 r360]], + -- animParams = [[8,8,25 r30]], + -- drawOrder = 0, + -- }, + -- }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.4, + maxheat = 14, + pos = [[r-2 r2, 10, r-2 r2]], + size = 3.2, + sizegrowth = 14, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 2, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.4 0 0 0 0.01]], + size = 110, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.125 0 0 0 0.01]], + size = 190, + sizegrowth = -1.5, + ttl = 22, + texture = [[groundflash]], + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.93 0.75 0.2 0 0 0 0.01]], + size = 2, + sizegrowth = 16, + ttl = 15, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 5, + texture = [[groundflash]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.8, + size = 6, + sizeGrowth = 13, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + explosionanim = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.73, + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 65, + emitrotspread = 24, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.35, 0]], + numparticles = 3, + particlelife = 6, + particlelifespread = 18, + particlesize = 40, + particlesizespread = 22, + particlespeed = 4.8, + particlespeedspread = 7.3, + pos = [[0, 5, 0]], + sizegrowth = [[2.5 r1.8]], + sizemod = 1.0, + texture = [[BARFlame02]], + animParams = [[16,6,60 r40]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 2, + castShadow = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.83, + colormap = [[1 0.9 0.7 0.11 0.9 0.6 0.3 0.15 0.66 0.30 0.05 0.033 0.55 0.15 0.02 0.011 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 14, + particlelife = 1.9, + particlelifespread = 13, + particlesize = 24.5, + particlesizespread = 20, + particlespeed = 5.8, + particlespeedspread = 4.3, + pos = [[0, 5, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 6.2, + sizegrowth = [[-20 r4]], + ttl = 9, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + -- no success with animated shockwave + -- groundblast = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = false, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 0 0 0 0 1 0.98 0.8 0.8 0.96 0.96 0.8 0.4 0.95 0.95 0.6 0.22 0.7 0.65 0.3 0.14 0.3 0.2 0.1 0.08 0.01 0.01 0.01 0.02]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[smoke-ice-anim]], + -- animParams = [[8,8,60 r40]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 18.2, + -- sizegrowth = [[5 r4]], + -- ttl = 20, + -- pos = [[0, 20, 0]], + -- rotParams = [[-10 r20, -10 r20, -180 r360]], + -- drawOrder = 0, + -- }, + -- }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 5, + particlelife = 13.6, + particlelifespread = 8.5, + particlesize = 5.5, + particlesizespread = 1.2, + particlespeed = 4.25, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 0.91, + texture = [[randomdots]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.80, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[-1 r2, 0, -1 r2]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 60, + particleLifeSpread = 30, + numparticles = 2, + particleSpeed = 3, + particleSpeedSpread = 5, + particleSize = 25, + particleSizeSpread = 40, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 2, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1, + pos = [[-1 r2, 0, -1 r2]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 22, + particleLifeSpread = 50, + numparticles = 1, + particleSpeed = 5, + particleSpeedSpread = 8, + particleSize = 32, + particleSizeSpread = 22, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 5, + particlelife = 13, + particlelifespread = 18, + particlesize = 40, + particlesizespread = 35, + particlespeed = 15.5, + particlespeedspread = 7.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[gunshotxl]], + useairlos = false, + drawOrder = 2, + --castShadow = true, + }, + }, - [root.."-huge"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.96, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.05 r0.03, -0.09 r0.18]], - numparticles = 1, - particlelife = 33, - particlelifespread = 8, - particlesize = 250.0, - particlesizespread = 50.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2.5 r1.5]], - sizemod = 0.97, - animParams = [[16,6,350 r100]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = false, - drawOrder = 1, - castShadow = true, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.4, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.8, - sizegrowth = 11, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - properties = { - colormap = [[1 0.7 0.3 0.34 0 0 0 0.01]], - size = 110, - sizegrowth = -2, - ttl = 25, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], - size = 220, - sizegrowth = -2, - ttl = 25, - texture = [[groundflash]], - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.93 0.75 0.6 0 0 0 0.01]], - size = 4, - sizegrowth = 22, - ttl = 12, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.9 0.75 0.85 0 0 0 0.01]], - size = 170, - sizegrowth = 4, - ttl = 6, - texture = [[groundflash]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=0, - texture=[[explo]], - heat = 10, - maxheat = 12, - heatFalloff = 1.3, - size = 7, - sizeGrowth = 10, - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.068 0.66 0.28 0.04 0.035 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 42, - emitvector = [[0, 1.1, 0]], - gravity = [[0, 0.014, 0]], - numparticles = 17, - particlelife = 3, - particlelifespread = 12, - particlesize = 18, - particlesizespread = 34, - particlespeed = 3, - particlespeedspread = 7, - pos = [[0, 8, 0]], - sizegrowth = 0, - sizemod = 0.97, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 5, - sizegrowth = -14, - ttl = 13, - pos = [[0, 5, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.89, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 0.54 0.52 0.4 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.05, 0]], - numparticles = 7, - particlelife = 15, - particlelifespread = 11.75, - particlesize = 4, - particlesizespread = 1.5, - particlespeed = 4.2, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 0.90, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.66, - alwaysVisible = 0, - sizeGrowth = 0.8, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=20, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[dirt]], - particleLife=35, - particleLifeSpread=80, - numparticles=4, - particleSpeed=6, - particleSpeedSpread=22, - particleSize=22, - particleSizeSpread=25, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.66, - alwaysVisible = 0, - sizeGrowth = -0.11, - sizeMod = 1, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=25, - emitRotSpread=40, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=20, - particleLifeSpread=70, - numparticles=3, - particleSpeed=15, - particleSpeedSpread=14, - particleSize=42, - particleSizeSpread=24, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 6, - particlelife = 8, - particlelifespread = 13, - particlesize = 66, - particlesizespread = 35, - particlespeed = 5, - particlespeedspread = 5, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.77, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 9, + particlelife = 26, + particlelifespread = 5, + particlesize = 1.75, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 3, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + --castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 28, + particlelifespread = 4, + particlesize = 1.8, + particlesizespread = -1.4, + particlespeed = 3.6, + particlespeedspread = 3.4, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + castShadow = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 1.9, + particlesizespread = 2.3, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 60, + particlesize = 60, + particlesizespread = 40, + particlespeed = 1.2, + particlespeedspread = 2.5, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + castShadow = true, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 3, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[55 r20]], + sidetexture = [[flamestream]], + size = [[40 r14]], + sizegrowth = 1.2, + ttl = [[32 r4]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 1, + castShadow = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 15, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 18, - particlelifespread = 30, - particlesize = 7.5, - particlesizespread = 22, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + [root .. "-huge"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.96, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.09 0.08 0.07 0.5 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.05 r0.03, -0.09 r0.18]], + numparticles = 1, + particlelife = 33, + particlelifespread = 8, + particlesize = 250.0, + particlesizespread = 50.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2.5 r1.5]], + sizemod = 0.97, + animParams = [[16,6,350 r100]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = false, + drawOrder = 1, + castShadow = true, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.4, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.8, + sizegrowth = 11, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + properties = { + colormap = [[1 0.7 0.3 0.34 0 0 0 0.01]], + size = 110, + sizegrowth = -2, + ttl = 25, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.11 0 0 0 0.01]], + size = 220, + sizegrowth = -2, + ttl = 25, + texture = [[groundflash]], + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.93 0.75 0.6 0 0 0 0.01]], + size = 4, + sizegrowth = 22, + ttl = 12, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.9 0.75 0.85 0 0 0 0.01]], + size = 170, + sizegrowth = 4, + ttl = 6, + texture = [[groundflash]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[explo]], + heat = 10, + maxheat = 12, + heatFalloff = 1.3, + size = 7, + sizeGrowth = 10, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0 0 0 0 1 0.9 0.6 0.09 0.9 0.5 0.2 0.068 0.66 0.28 0.04 0.035 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 42, + emitvector = [[0, 1.1, 0]], + gravity = [[0, 0.014, 0]], + numparticles = 17, + particlelife = 3, + particlelifespread = 12, + particlesize = 18, + particlesizespread = 34, + particlespeed = 3, + particlespeedspread = 7, + pos = [[0, 8, 0]], + sizegrowth = 0, + sizemod = 0.97, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.70 0.5 0.75 0.65 0.42 0.25 0.30 0.20 0.15 0.08 0.008 0.06 0.04 0.02 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 5, + sizegrowth = -14, + ttl = 13, + pos = [[0, 5, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.89, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 0.54 0.52 0.4 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 15, + particlelifespread = 11.75, + particlesize = 4, + particlesizespread = 1.5, + particlespeed = 4.2, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 0.90, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.66, + alwaysVisible = 0, + sizeGrowth = 0.8, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 20, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[dirt]], + particleLife = 35, + particleLifeSpread = 80, + numparticles = 4, + particleSpeed = 6, + particleSpeedSpread = 22, + particleSize = 22, + particleSizeSpread = 25, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.66, + alwaysVisible = 0, + sizeGrowth = -0.11, + sizeMod = 1, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 25, + emitRotSpread = 40, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 20, + particleLifeSpread = 70, + numparticles = 3, + particleSpeed = 15, + particleSpeedSpread = 14, + particleSize = 42, + particleSizeSpread = 24, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0.9 0.85 0.77 0.017 0.8 0.55 0.3 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 6, + particlelife = 8, + particlelifespread = 13, + particlesize = 66, + particlesizespread = 35, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.77, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 16.9, - sizegrowth = 2, - ttl = 80, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 18, + particlelifespread = 30, + particlesize = 7.5, + particlesizespread = 22, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 2, - particlelife = 15, - particlelifespread = 40, - particlesize = [[4 r16]], - particlesizespread = 16, - particlespeed = [[5 i0.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - castShadow = true, - }, - }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 16.9, + sizegrowth = 2, + ttl = 80, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 16, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 9, - particlelife = 36, - particlelifespread = 9, - particlesize = 2, - particlesizespread = -1.3, - particlespeed = 3.9, - particlespeedspread = 4, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = -5, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 5, - particlelife = 38, - particlelifespread = 9, - particlesize = 1.85, - particlesizespread = -1.3, - particlespeed = 3.8, - particlespeedspread = 4.5, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 40, - particlelifespread = 0, - particlesize = 2.1, - particlesizespread = 2.35, - particlespeed = 3, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 40, - particlelifespread = 0, - particlesize = 2.25, - particlesizespread = 2.6, - particlespeed = 3, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 40, - particlelifespread = 0, - particlesize = 2.25, - particlesizespread = 2.6, - particlespeed = 3, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 50, - particlelifespread = 95, - particlesize = 90, - particlesizespread = 55, - particlespeed = 2, - particlespeedspread = 2.7, - pos = [[0, 4, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 4, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.9 0.63 0.26 0.88 0.9 0.63 0.26 0.61 0.07 0.05 0.05 0.58 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[79 r30]], - sidetexture = [[flamestream]], - size = [[32 r20]], - sizegrowth = 1, - ttl = [[41 r6]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-20 r40, -18 r20, -20 r40]], - drawOrder = 0, - castShadow = true, - }, - }, - dirtrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 0, - water = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.40 0.40 0.40 .65 0.37 0.37 0.37 .25 0 0 0 0.01]], - directional = false, - emitrot = 7, - emitrotspread = 7, - emitvector = [[0.1, 1, 0.1]], - gravity = [[0, -0.06, 0]], - numparticles = 1, - particlelife = 32, - particlelifespread = 38, - particlesize = 7, - particlesizespread = 25, - particlespeed = 2, - particlespeedspread = 4, - rotParams = [[-4 r8, -3 r6, -180 r360]], - pos = [[-18 r36, -45 r15, -18 r36]], - sizegrowth = [[5.2 r0.9]], - sizemod = 0.94, - texture = [[dirtrush]], - useairlos = true, - drawOrder = 1, - castShadow = true, - }, - }, - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.9 0.85 0.65 1 1 0.8 0.5 1.0 0.85 0.65 0.35 0.7 0.45 0.45 0.45 0.4 0.35 0.35 0.35 0.12 0 0 0 0.01]], - --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - size = [[60 r30]], - sizegrowth = [[0.4 r0.4]], - --sizemod = 0.95, - ttl = 32, - --sizegrowth = 10, - pos = [[0, 75, 0]], - rotParams = [[0, 0, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,40]], - }, - }, - --grounddust = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- unit = false, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = -2, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.01, 0]], - -- numparticles = 55, - -- particlelife = 12, - -- particlelifespread = 70, - -- particlesize = 4, - -- particlesizespread = 1.6, - -- particlespeed = 9, - -- particlespeedspread = 2.6, - -- pos = [[0, 4, 0]], - -- sizegrowth = 0.6, - -- sizemod = 1.0, - -- texture = [[bigexplosmoke]], - -- }, - --}, - groundclouddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.85, - colormap = [[0.14 0.14 0.14 0.18 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0.22, 1, 0.22]], - gravity = [[0, 0, 0]], - numparticles = 7, - particlelife = 20, - particlelifespread = 80, - particlesize = 17, - particlesizespread = 5, - particlespeed = 0.8, - particlespeedspread = 6.5, - pos = [[0, 4, 0]], - sizegrowth = 0.28, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.3, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 20, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - drawOrder = 1, - }, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 2, + particlelife = 15, + particlelifespread = 40, + particlesize = [[4 r16]], + particlesizespread = 16, + particlespeed = [[5 i0.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 16, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 9, + particlelife = 36, + particlelifespread = 9, + particlesize = 2, + particlesizespread = -1.3, + particlespeed = 3.9, + particlespeedspread = 4, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = -5, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 38, + particlelifespread = 9, + particlesize = 1.85, + particlesizespread = -1.3, + particlespeed = 3.8, + particlespeedspread = 4.5, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 40, + particlelifespread = 0, + particlesize = 2.1, + particlesizespread = 2.35, + particlespeed = 3, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 40, + particlelifespread = 0, + particlesize = 2.25, + particlesizespread = 2.6, + particlespeed = 3, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 40, + particlelifespread = 0, + particlesize = 2.25, + particlesizespread = 2.6, + particlespeed = 3, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 50, + particlelifespread = 95, + particlesize = 90, + particlesizespread = 55, + particlespeed = 2, + particlespeedspread = 2.7, + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 4, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.9 0.63 0.26 0.88 0.9 0.63 0.26 0.61 0.07 0.05 0.05 0.58 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[79 r30]], + sidetexture = [[flamestream]], + size = [[32 r20]], + sizegrowth = 1, + ttl = [[41 r6]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-20 r40, -18 r20, -20 r40]], + drawOrder = 0, + castShadow = true, + }, + }, + dirtrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 0, + water = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.45 0.45 0.45 .95 0.40 0.40 0.40 .65 0.37 0.37 0.37 .25 0 0 0 0.01]], + directional = false, + emitrot = 7, + emitrotspread = 7, + emitvector = [[0.1, 1, 0.1]], + gravity = [[0, -0.06, 0]], + numparticles = 1, + particlelife = 32, + particlelifespread = 38, + particlesize = 7, + particlesizespread = 25, + particlespeed = 2, + particlespeedspread = 4, + rotParams = [[-4 r8, -3 r6, -180 r360]], + pos = [[-18 r36, -45 r15, -18 r36]], + sizegrowth = [[5.2 r0.9]], + sizemod = 0.94, + texture = [[dirtrush]], + useairlos = true, + drawOrder = 1, + castShadow = true, + }, + }, + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.9 0.85 0.65 1 1 0.8 0.5 1.0 0.85 0.65 0.35 0.7 0.45 0.45 0.45 0.4 0.35 0.35 0.35 0.12 0 0 0 0.01]], + --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + size = [[60 r30]], + sizegrowth = [[0.4 r0.4]], + --sizemod = 0.95, + ttl = 32, + --sizegrowth = 10, + pos = [[0, 75, 0]], + rotParams = [[0, 0, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,40]], + }, + }, + --grounddust = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- unit = false, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = -2, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.01, 0]], + -- numparticles = 55, + -- particlelife = 12, + -- particlelifespread = 70, + -- particlesize = 4, + -- particlesizespread = 1.6, + -- particlespeed = 9, + -- particlespeedspread = 2.6, + -- pos = [[0, 4, 0]], + -- sizegrowth = 0.6, + -- sizemod = 1.0, + -- texture = [[bigexplosmoke]], + -- }, + --}, + groundclouddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.85, + colormap = [[0.14 0.14 0.14 0.18 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0.22, 1, 0.22]], + gravity = [[0, 0, 0]], + numparticles = 7, + particlelife = 20, + particlelifespread = 80, + particlesize = 17, + particlesizespread = 5, + particlespeed = 0.8, + particlespeedspread = 6.5, + pos = [[0, 4, 0]], + sizegrowth = 0.28, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.3, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 20, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + drawOrder = 1, + }, + }, + }, } -- add different sizes -definitions[root] = definitions[root.."-small"] +definitions[root] = definitions[root .. "-small"] local sizes = { - tiny = { - - }, - - small = { - - }, + tiny = {}, - medium = { + small = {}, - }, - - large = { - - }, + medium = {}, - huge = { + large = {}, - }, + huge = {}, } for size, effects in pairs(sizes) do - definitions[root.."-"..size].explosion.properties.numparticles = math.ceil(definitions[root.."-"..size].explosion.properties.numparticles/1.7) - definitions[root.."-"..size].explosion2 = table.copy(definitions[root.."-"..size].explosion) - definitions[root.."-"..size].explosion2.properties.colormap = [[1 0.33 0 0.1 0.5 0.15 0 0.05 0.07 0.03 0 0.02 0 0 0 0]] - definitions[root.."-"..size].explosion2.properties.numparticles = definitions[root.."-"..size].explosion.properties.numparticles-1 + definitions[root .. "-" .. size].explosion.properties.numparticles = math.ceil(definitions[root .. "-" .. size].explosion.properties.numparticles / 1.7) + definitions[root .. "-" .. size].explosion2 = table.copy(definitions[root .. "-" .. size].explosion) + definitions[root .. "-" .. size].explosion2.properties.colormap = [[1 0.33 0 0.1 0.5 0.15 0 0.05 0.07 0.03 0 0.02 0 0 0 0]] + definitions[root .. "-" .. size].explosion2.properties.numparticles = definitions[root .. "-" .. size].explosion.properties.numparticles - 1 end -- add coloring local colors = { - air = { - groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - underwaterexplosionsparks = false, - kickedupwater = false, - dirt = false, - dirt2 = false, - shard1 = false, - shard2 = false, - shard3 = false, - innersmoke = {properties={numparticles=1}}, - outersmoke = false, + air = { + groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + underwaterexplosionsparks = false, + kickedupwater = false, + dirt = false, + dirt2 = false, + shard1 = false, + shard2 = false, + shard3 = false, + innersmoke = { properties = { numparticles = 1 } }, + outersmoke = false, - --grounddust = false, - centerflare = {air=false, ground=false, water=false, unit=true}, - clouddust = {air=false, ground=false, water=false, unit=true}, - explosion = {air=false, ground=false, water=false, unit=true, properties={colormap=[[0 0 0 0 1 0.85 0.7 0.09 0.9 0.45 0.37 0.066 0.66 0.26 0.2 0.033 0 0 0 0]]}}, - explosion2 = {air=false, ground=false, water=false, unit=true, properties={colormap=[[1 0.3 0.24 0.1 0.5 0.13 0.1 0.05 0.07 0.025 0.02 0.02 0 0 0 0]]}}, - sparks = {air=false, ground=false, water=false, unit=true, properties={colormap=[[0.9 0.8 0.7 0.017 0.8 0.5 0.4 0.011 0 0 0 0]]}}, - outerflash = {air=false, ground=false, water=false, unit=true}, - }, - aa = { - groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - underwaterexplosionsparks = false, - kickedupwater = false, - dirt = false, - dirt2 = false, - shard1 = false, - shard2 = false, - shard3 = false, - --grounddust = false, - centerflare = {ground=false, water=false}, - clouddust = {ground=false, water=false}, - explosion = {ground=false, water=false, properties={colormap=[[0 0 0 0 1 0.9 0.8 0.09 0.9 0.5 0.55 0.066 0.66 0.28 0.35 0.033 0 0 0 0]]}}, - explosion2 = {ground=false, water=false, properties={colormap=[[0 0 0 0 1 0.6 0.4 0.09 0.6 0.3 0.45 0.066 0.46 0.18 0.25 0.033 0 0 0 0]]}}, - dustparticles = {ground=false, water=false, properties={colormap=[[1 0.65 0.85 0.22 1 0.5 0.77 0.12 1 0.4 0.7 0.06 0 0 0 0.01]]}}, - outerflash = {ground=false, water=false}, - }, - uw = { - groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - underwaterexplosionsparks = false, - kickedupwater = {count=1}, - centerflare = false, --{properties={texture=[[blueexplo]]}}, - explosion = {ground=false, water=false, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]]}}, - explosion2 = {ground=false, water=false, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]]}}, - dustparticles = {ground=false, water=true, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.020 0.30 0.31 0.33 0.016 0 0 0 0.01]]}}, - dirt = false, - dirt2 = false, - sparks = false, - watersparks = {count=1}, - waterring = {count=1}, - }, - bomb = { - explosion = {properties={colormap=[[0 0 0 0 1 0.62 0.38 0.09 0.7 0.27 0.1 0.066 0.5 0.15 0.025 0.033 0 0 0 0]]}}, - explosion2 = {properties={colormap=[[0 0 0 0 1 0.32 0.18 0.09 0.7 0.17 0.05 0.066 0.3 0.08 0.015 0.033 0 0 0 0]]}}, - innersmoke = {properties={colormap=[[1 0.6 0.4 0.4 0.5 0.24 0.14 0.5 0.27 0.17 0.13 0.42 0.21 0.16 0.14 0.35 0.105 0.095 0.088 0.25 0.07 0.064 0.058 0.17 0 0 0 0.01]]}}, - outersmoke = {properties={colormap=[[1 0.58 0.36 0.4 0.48 0.24 0.14 0.45 0.26 0.16 0.13 0.4 0.2 0.16 0.14 0.35 0.1 0.09 0.088 0.25 0.07 0.063 0.058 0.17 0 0 0 0.01]]}}, - dustparticles = {properties={numparticles=10}}, - shockwave = {count=1}, - groundflash_anim = {count=1}, - dirtrush = {count=1}, - bigsmoketrails = {count=4, properties={ttl=[[33 r5]], length=[[38 r14]]}}, - groundflash_small = {properties={colormap=[[1 0.47 0.25 0.08 0 0 0 0.01]]}}, - groundflash_large = {properties={colormap=[[1 0.47 0.25 0.08 0 0 0 0.01]]}}, - sparks = {properties={colormap=[[0.85 0.4 0.15 0.01 0.95 0.45 0.18 0.017 0 0 0 0]], numparticles=5}}, - } + --grounddust = false, + centerflare = { air = false, ground = false, water = false, unit = true }, + clouddust = { air = false, ground = false, water = false, unit = true }, + explosion = { air = false, ground = false, water = false, unit = true, properties = { colormap = [[0 0 0 0 1 0.85 0.7 0.09 0.9 0.45 0.37 0.066 0.66 0.26 0.2 0.033 0 0 0 0]] } }, + explosion2 = { air = false, ground = false, water = false, unit = true, properties = { colormap = [[1 0.3 0.24 0.1 0.5 0.13 0.1 0.05 0.07 0.025 0.02 0.02 0 0 0 0]] } }, + sparks = { air = false, ground = false, water = false, unit = true, properties = { colormap = [[0.9 0.8 0.7 0.017 0.8 0.5 0.4 0.011 0 0 0 0]] } }, + outerflash = { air = false, ground = false, water = false, unit = true }, + }, + aa = { + groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + underwaterexplosionsparks = false, + kickedupwater = false, + dirt = false, + dirt2 = false, + shard1 = false, + shard2 = false, + shard3 = false, + --grounddust = false, + centerflare = { ground = false, water = false }, + clouddust = { ground = false, water = false }, + explosion = { ground = false, water = false, properties = { colormap = [[0 0 0 0 1 0.9 0.8 0.09 0.9 0.5 0.55 0.066 0.66 0.28 0.35 0.033 0 0 0 0]] } }, + explosion2 = { ground = false, water = false, properties = { colormap = [[0 0 0 0 1 0.6 0.4 0.09 0.6 0.3 0.45 0.066 0.46 0.18 0.25 0.033 0 0 0 0]] } }, + dustparticles = { ground = false, water = false, properties = { colormap = [[1 0.65 0.85 0.22 1 0.5 0.77 0.12 1 0.4 0.7 0.06 0 0 0 0.01]] } }, + outerflash = { ground = false, water = false }, + }, + uw = { + groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + underwaterexplosionsparks = false, + kickedupwater = { count = 1 }, + centerflare = false, --{properties={texture=[[blueexplo]]}}, + explosion = { ground = false, water = false, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]] } }, + explosion2 = { ground = false, water = false, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.010 0.30 0.31 0.33 0.008 0 0 0 0.01]] } }, + dustparticles = { ground = false, water = true, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.020 0.30 0.31 0.33 0.016 0 0 0 0.01]] } }, + dirt = false, + dirt2 = false, + sparks = false, + watersparks = { count = 1 }, + waterring = { count = 1 }, + }, + bomb = { + explosion = { properties = { colormap = [[0 0 0 0 1 0.62 0.38 0.09 0.7 0.27 0.1 0.066 0.5 0.15 0.025 0.033 0 0 0 0]] } }, + explosion2 = { properties = { colormap = [[0 0 0 0 1 0.32 0.18 0.09 0.7 0.17 0.05 0.066 0.3 0.08 0.015 0.033 0 0 0 0]] } }, + innersmoke = { properties = { colormap = [[1 0.6 0.4 0.4 0.5 0.24 0.14 0.5 0.27 0.17 0.13 0.42 0.21 0.16 0.14 0.35 0.105 0.095 0.088 0.25 0.07 0.064 0.058 0.17 0 0 0 0.01]] } }, + outersmoke = { properties = { colormap = [[1 0.58 0.36 0.4 0.48 0.24 0.14 0.45 0.26 0.16 0.13 0.4 0.2 0.16 0.14 0.35 0.1 0.09 0.088 0.25 0.07 0.063 0.058 0.17 0 0 0 0.01]] } }, + dustparticles = { properties = { numparticles = 10 } }, + shockwave = { count = 1 }, + groundflash_anim = { count = 1 }, + dirtrush = { count = 1 }, + bigsmoketrails = { count = 4, properties = { ttl = [[33 r5]], length = [[38 r14]] } }, + groundflash_small = { properties = { colormap = [[1 0.47 0.25 0.08 0 0 0 0.01]] } }, + groundflash_large = { properties = { colormap = [[1 0.47 0.25 0.08 0 0 0 0.01]] } }, + sparks = { properties = { colormap = [[0.85 0.4 0.15 0.01 0.95 0.45 0.18 0.017 0 0 0 0]], numparticles = 5 } }, + }, } for color, effects in pairs(colors) do - for size, e in pairs(sizes) do - definitions[root.."-"..size.."-"..color] = table.merge(definitions[root.."-"..size], effects) - for pname, defs in pairs(effects) do - if defs == false then - definitions[root.."-"..size.."-"..color][pname] = nil - end - end - end + for size, e in pairs(sizes) do + definitions[root .. "-" .. size .. "-" .. color] = table.merge(definitions[root .. "-" .. size], effects) + for pname, defs in pairs(effects) do + if defs == false then + definitions[root .. "-" .. size .. "-" .. color][pname] = nil + end + end + end end -- adjust ceg for large bombs -definitions[root.."-large-bomb"].bigsmoketrails.properties.length = [[52 r24]] -definitions[root.."-large-bomb"].bigsmoketrails.properties.dir = [[-0.55 r1.1, 0.5 r0.40, 0 r-0.55]] -definitions[root.."-large-bomb"].sparks.properties.numparticles = 3 -definitions[root.."-large-bomb"].groundflash_anim.count = 1 - - +definitions[root .. "-large-bomb"].bigsmoketrails.properties.length = [[52 r24]] +definitions[root .. "-large-bomb"].bigsmoketrails.properties.dir = [[-0.55 r1.1, 0.5 r0.40, 0 r-0.55]] +definitions[root .. "-large-bomb"].sparks.properties.numparticles = 3 +definitions[root .. "-large-bomb"].groundflash_anim.count = 1 -- adjust ceg used for flak -definitions[root.."-large-aa"].explosion.properties.particlesize = definitions[root.."-large-aa"].explosion.properties.particlesize * 0.5 -definitions[root.."-large-aa"].explosion.properties.numparticles = math.floor(definitions[root.."-large-aa"].explosion.properties.numparticles * 0.5) -definitions[root.."-large-aa"].explosion2.properties.particlesize = definitions[root.."-large-aa"].explosion2.properties.particlesize * 0.5 -definitions[root.."-large-aa"].explosion2.properties.numparticles = math.floor(definitions[root.."-large-aa"].explosion2.properties.numparticles * 0.5) -definitions[root.."-small-aa"].sparks = nil -definitions[root.."-medium-aa"].sparks = nil -definitions[root.."-large-aa"].sparks = nil -definitions[root.."-huge-aa"].sparks = nil +definitions[root .. "-large-aa"].explosion.properties.particlesize = definitions[root .. "-large-aa"].explosion.properties.particlesize * 0.5 +definitions[root .. "-large-aa"].explosion.properties.numparticles = math.floor(definitions[root .. "-large-aa"].explosion.properties.numparticles * 0.5) +definitions[root .. "-large-aa"].explosion2.properties.particlesize = definitions[root .. "-large-aa"].explosion2.properties.particlesize * 0.5 +definitions[root .. "-large-aa"].explosion2.properties.numparticles = math.floor(definitions[root .. "-large-aa"].explosion2.properties.numparticles * 0.5) +definitions[root .. "-small-aa"].sparks = nil +definitions[root .. "-medium-aa"].sparks = nil +definitions[root .. "-large-aa"].sparks = nil +definitions[root .. "-huge-aa"].sparks = nil -- adjust for beam weapons local devideBy = 12 for size, e in pairs(sizes) do - local defname = root.."-"..size.."-beam" - definitions[defname] = table.copy(definitions[root.."-"..size]) - definitions[defname].clouddust = nil - if definitions[defname].groundclouddust ~= nil then - definitions[defname].groundclouddust.properties.numparticles = nil - end - definitions[defname].groundflash_small.colormap = [[0.5 0.35 0.15 0.02 0 0 0 0.01]] - definitions[defname].groundflash_large.colormap = [[0.5 0.35 0.15 0.01 0 0 0 0.01]] - definitions[defname].groundflash_white = false - definitions[defname].centerflare.properties.heat = math.ceil(definitions[defname].centerflare.properties.heat / devideBy) - definitions[defname].centerflare.properties.maxheat = math.ceil(definitions[defname].centerflare.properties.maxheat / devideBy) - definitions[defname].explosion.properties.numparticles = [[0 r1.05]] - definitions[defname].explosion2.properties.numparticles = [[0 r1.05]] - definitions[defname].sparks.properties.numparticles = [[0 r2.1]] - -- definitions[defname].dirt.properties.numparticles = [[0 r2.1]] - -- definitions[defname].dirt2.properties.numparticles = [[0 r2.1]] - -- definitions[defname].shard1.properties.numparticles = [[0.2 r1.2]] - -- definitions[defname].shard2.properties.numparticles = [[0.2 r0.6]] - -- definitions[defname].shard3.properties.numparticles = [[0.2 r0.6]] - -- definitions[defname].dustparticles.properties.numparticles = [[0.25 r0.9]] - definitions[defname].dirt.properties.numparticles = 0 - definitions[defname].dirt2.properties.numparticles = 0 - definitions[defname].shard1.properties.numparticles = 0 - definitions[defname].shard2.properties.numparticles = 0 - definitions[defname].shard3.properties.numparticles = 0 - definitions[defname].dustparticles.properties.numparticles = 0 + local defname = root .. "-" .. size .. "-beam" + definitions[defname] = table.copy(definitions[root .. "-" .. size]) + definitions[defname].clouddust = nil + if definitions[defname].groundclouddust ~= nil then + definitions[defname].groundclouddust.properties.numparticles = nil + end + definitions[defname].groundflash_small.colormap = [[0.5 0.35 0.15 0.02 0 0 0 0.01]] + definitions[defname].groundflash_large.colormap = [[0.5 0.35 0.15 0.01 0 0 0 0.01]] + definitions[defname].groundflash_white = false + definitions[defname].centerflare.properties.heat = math.ceil(definitions[defname].centerflare.properties.heat / devideBy) + definitions[defname].centerflare.properties.maxheat = math.ceil(definitions[defname].centerflare.properties.maxheat / devideBy) + definitions[defname].explosion.properties.numparticles = [[0 r1.05]] + definitions[defname].explosion2.properties.numparticles = [[0 r1.05]] + definitions[defname].sparks.properties.numparticles = [[0 r2.1]] + -- definitions[defname].dirt.properties.numparticles = [[0 r2.1]] + -- definitions[defname].dirt2.properties.numparticles = [[0 r2.1]] + -- definitions[defname].shard1.properties.numparticles = [[0.2 r1.2]] + -- definitions[defname].shard2.properties.numparticles = [[0.2 r0.6]] + -- definitions[defname].shard3.properties.numparticles = [[0.2 r0.6]] + -- definitions[defname].dustparticles.properties.numparticles = [[0.25 r0.9]] + definitions[defname].dirt.properties.numparticles = 0 + definitions[defname].dirt2.properties.numparticles = 0 + definitions[defname].shard1.properties.numparticles = 0 + definitions[defname].shard2.properties.numparticles = 0 + definitions[defname].shard3.properties.numparticles = 0 + definitions[defname].dustparticles.properties.numparticles = 0 - if definitions[defname].innersmoke ~= nil then - definitions[defname].innersmoke.properties.numparticles = [[0 r1.7]] - end - if definitions[defname].outersmoke ~= nil then - definitions[defname].outersmoke.properties.numparticles = [[0 r1.3]] - end - --if definitions[defname].grounddust ~= nil then - -- definitions[defname].grounddust.properties.particlespeed = definitions[defname].grounddust.properties.particlespeed / 2 - -- definitions[defname].grounddust.properties.particlespeedspread = definitions[defname].grounddust.properties.particlespeedspread * 2 - -- definitions[defname].grounddust.properties.numparticles = math.ceil(definitions[defname].grounddust.properties.numparticles / 5) - --end + if definitions[defname].innersmoke ~= nil then + definitions[defname].innersmoke.properties.numparticles = [[0 r1.7]] + end + if definitions[defname].outersmoke ~= nil then + definitions[defname].outersmoke.properties.numparticles = [[0 r1.3]] + end + --if definitions[defname].grounddust ~= nil then + -- definitions[defname].grounddust.properties.particlespeed = definitions[defname].grounddust.properties.particlespeed / 2 + -- definitions[defname].grounddust.properties.particlespeedspread = definitions[defname].grounddust.properties.particlespeedspread * 2 + -- definitions[defname].grounddust.properties.numparticles = math.ceil(definitions[defname].grounddust.properties.numparticles / 5) + --end end -definitions['genericshellexplosion-medium-aoe'] = table.copy(definitions[root.."-medium"]) -definitions['genericshellexplosion-medium-aoe'].dustparticles.properties.numparticles = 10 -definitions['genericshellexplosion-medium-aoe'].shockwave.count = 1 -definitions['genericshellexplosion-medium-aoe'].dirtrush.count = 1 -definitions['genericshellexplosion-medium-aoe'].bigsmoketrails.count = 4 -definitions['genericshellexplosion-medium-aoe'].bigsmoketrails.properties.ttl = [[28 r3]] -definitions['genericshellexplosion-medium-aoe'].bigsmoketrails.properties.length = [[28 r5]] -definitions['genericshellexplosion-medium-aoe'].explosion.properties.colormap = [[0 0 0 0 1 0.62 0.38 0.09 0.7 0.27 0.1 0.066 0.5 0.15 0.025 0.033 0 0 0 0]] -definitions['genericshellexplosion-medium-aoe'].explosion2.properties.colormap = [[0 0 0 0 1 0.32 0.18 0.09 0.7 0.17 0.05 0.066 0.3 0.08 0.015 0.033 0 0 0 0]] - -definitions['genericshellexplosion-small-t2'] = table.copy(definitions[root.."-small"]) -definitions['genericshellexplosion-small-t2'].explosion.properties.particlesize = 8 - -definitions['antinukeexplosion'] = table.copy(definitions[root.."-large"]) +definitions["genericshellexplosion-medium-aoe"] = table.copy(definitions[root .. "-medium"]) +definitions["genericshellexplosion-medium-aoe"].dustparticles.properties.numparticles = 10 +definitions["genericshellexplosion-medium-aoe"].shockwave.count = 1 +definitions["genericshellexplosion-medium-aoe"].dirtrush.count = 1 +definitions["genericshellexplosion-medium-aoe"].bigsmoketrails.count = 4 +definitions["genericshellexplosion-medium-aoe"].bigsmoketrails.properties.ttl = [[28 r3]] +definitions["genericshellexplosion-medium-aoe"].bigsmoketrails.properties.length = [[28 r5]] +definitions["genericshellexplosion-medium-aoe"].explosion.properties.colormap = [[0 0 0 0 1 0.62 0.38 0.09 0.7 0.27 0.1 0.066 0.5 0.15 0.025 0.033 0 0 0 0]] +definitions["genericshellexplosion-medium-aoe"].explosion2.properties.colormap = [[0 0 0 0 1 0.32 0.18 0.09 0.7 0.17 0.05 0.066 0.3 0.08 0.015 0.033 0 0 0 0]] -definitions['genericshellexplosion-debris'] = table.copy(definitions[root.."-tiny"]) -definitions['genericshellexplosion-debris'].explosion.properties.colormap = [[0 0 0 0 1 0.77 0.44 0.06 0.75 0.38 0.14 0.045 0.55 0.22 0.04 0.02 0 0 0 0]] -definitions['genericshellexplosion-debris'].explosion.properties.numparticles = 3 -definitions['genericshellexplosion-debris'].explosion.properties.particlesize = 0.44 -definitions['genericshellexplosion-debris'].explosion.properties.particlesizespread = 0.6 -definitions['genericshellexplosion-debris'].explosion.properties.particlespeed = 0.35 -definitions['genericshellexplosion-debris'].explosion.properties.particlespeedspread = 1.1 -definitions['genericshellexplosion-debris'].innersmoke.properties.particleLife = 7 -definitions['genericshellexplosion-debris'].innersmoke.properties.particleLifeSpread = 10 -definitions['genericshellexplosion-debris'].innersmoke.properties.particlesize = 4 -definitions['genericshellexplosion-debris'].innersmoke.properties.particlesizespread = 2.2 -definitions['genericshellexplosion-debris'].innersmoke.properties.particlespeedspread = 1.2 -definitions['genericshellexplosion-debris'].groundflash_small.properties.colormap = [[1 0.6 0.25 0.2 0 0 0 0.01]] -definitions['genericshellexplosion-debris'].groundflash_small.properties.size = 13 -definitions['genericshellexplosion-debris'].groundflash_small.properties.ttl = 9 -definitions['genericshellexplosion-debris'].explosion2 = nil -definitions['genericshellexplosion-debris'].outersmoke = nil -definitions['genericshellexplosion-debris'].sparks = nil -definitions['genericshellexplosion-debris'].groundflash_large = nil -definitions['genericshellexplosion-debris'].centerflare = nil -definitions['genericshellexplosion-debris'].dustparticles = nil -definitions['genericshellexplosion-debris'].dirt = nil -definitions['genericshellexplosion-debris'].dirt2 = nil -definitions['genericshellexplosion-debris'].shard1 = nil -definitions['genericshellexplosion-debris'].shard2 = nil -definitions['genericshellexplosion-debris'].shard3 = nil -definitions['genericshellexplosion-debris'].clouddust = nil -definitions['genericshellexplosion-debris'].outerflash = nil +definitions["genericshellexplosion-small-t2"] = table.copy(definitions[root .. "-small"]) +definitions["genericshellexplosion-small-t2"].explosion.properties.particlesize = 8 -definitions['genericshellexplosion-debris2'] = table.copy(definitions[root.."-debris"]) -definitions['genericshellexplosion-debris2'].explosion.properties.numparticles = 2 -definitions['genericshellexplosion-debris2'].explosion.properties.particlesize = 0.35 -definitions['genericshellexplosion-debris2'].explosion.properties.particlesizespread = 0.45 -definitions['genericshellexplosion-debris2'].explosion.properties.particlespeed = 0.25 -definitions['genericshellexplosion-debris2'].explosion.properties.particlespeedspread = 0.66 -definitions['genericshellexplosion-debris2'].explosion2 = nil +definitions["antinukeexplosion"] = table.copy(definitions[root .. "-large"]) -definitions['genericshellexplosion-catapult'] = table.copy(definitions[root.."-large-bomb"]) -definitions['genericshellexplosion-catapult'].explosion.properties.numparticles = 4 -definitions['genericshellexplosion-catapult'].explosion.properties.colormap = [[0 0 0 0 1 0.45 0.25 0.09 0.75 0.35 0.15 0.066 0.44 0.25 0.06 0.033 0 0 0 0]] -definitions['genericshellexplosion-catapult'].explosion2.properties.numparticles = 4 -definitions['genericshellexplosion-catapult'].explosion2.properties.colormap = [[0 0 0 0 1 0.38 0.1 0.09 0.55 0.22 0.05 0.066 0.25 0.08 0.03 0.033 0 0 0 0]] -definitions['genericshellexplosion-catapult'].dustparticles.properties.numparticles = 1 -definitions['genericshellexplosion-catapult'].dirt.properties.numparticles = 3 -definitions['genericshellexplosion-catapult'].dirt2.properties.numparticles = 3 -definitions['genericshellexplosion-catapult'].sparks.properties.numparticles = 4 -definitions['genericshellexplosion-catapult'].clouddust.properties.numparticles = 1 +definitions["genericshellexplosion-debris"] = table.copy(definitions[root .. "-tiny"]) +definitions["genericshellexplosion-debris"].explosion.properties.colormap = [[0 0 0 0 1 0.77 0.44 0.06 0.75 0.38 0.14 0.045 0.55 0.22 0.04 0.02 0 0 0 0]] +definitions["genericshellexplosion-debris"].explosion.properties.numparticles = 3 +definitions["genericshellexplosion-debris"].explosion.properties.particlesize = 0.44 +definitions["genericshellexplosion-debris"].explosion.properties.particlesizespread = 0.6 +definitions["genericshellexplosion-debris"].explosion.properties.particlespeed = 0.35 +definitions["genericshellexplosion-debris"].explosion.properties.particlespeedspread = 1.1 +definitions["genericshellexplosion-debris"].innersmoke.properties.particleLife = 7 +definitions["genericshellexplosion-debris"].innersmoke.properties.particleLifeSpread = 10 +definitions["genericshellexplosion-debris"].innersmoke.properties.particlesize = 4 +definitions["genericshellexplosion-debris"].innersmoke.properties.particlesizespread = 2.2 +definitions["genericshellexplosion-debris"].innersmoke.properties.particlespeedspread = 1.2 +definitions["genericshellexplosion-debris"].groundflash_small.properties.colormap = [[1 0.6 0.25 0.2 0 0 0 0.01]] +definitions["genericshellexplosion-debris"].groundflash_small.properties.size = 13 +definitions["genericshellexplosion-debris"].groundflash_small.properties.ttl = 9 +definitions["genericshellexplosion-debris"].explosion2 = nil +definitions["genericshellexplosion-debris"].outersmoke = nil +definitions["genericshellexplosion-debris"].sparks = nil +definitions["genericshellexplosion-debris"].groundflash_large = nil +definitions["genericshellexplosion-debris"].centerflare = nil +definitions["genericshellexplosion-debris"].dustparticles = nil +definitions["genericshellexplosion-debris"].dirt = nil +definitions["genericshellexplosion-debris"].dirt2 = nil +definitions["genericshellexplosion-debris"].shard1 = nil +definitions["genericshellexplosion-debris"].shard2 = nil +definitions["genericshellexplosion-debris"].shard3 = nil +definitions["genericshellexplosion-debris"].clouddust = nil +definitions["genericshellexplosion-debris"].outerflash = nil +definitions["genericshellexplosion-debris2"] = table.copy(definitions[root .. "-debris"]) +definitions["genericshellexplosion-debris2"].explosion.properties.numparticles = 2 +definitions["genericshellexplosion-debris2"].explosion.properties.particlesize = 0.35 +definitions["genericshellexplosion-debris2"].explosion.properties.particlesizespread = 0.45 +definitions["genericshellexplosion-debris2"].explosion.properties.particlespeed = 0.25 +definitions["genericshellexplosion-debris2"].explosion.properties.particlespeedspread = 0.66 +definitions["genericshellexplosion-debris2"].explosion2 = nil -definitions['genericshellexplosion-sniper'] = table.copy(definitions[root.."-large"]) -definitions['genericshellexplosion-sniper'].explosion.properties.colormap = [[0 0 0 0 1 0.3 0.15 0.01 1 0.2 0.12 0.01 0.8 0.16 0.09 0.01 0 0 0 0]] -definitions['genericshellexplosion-sniper'].explosion.properties.numparticles = definitions['genericshellexplosion-sniper'].explosion.properties.numparticles*1.3 -definitions['genericshellexplosion-sniper'].explosion2.properties.colormap = [[0 0 0 0 1 0 0 0.01 1 0.1 0.09 0.01 0.8 0.1 0.05 0.01 0 0 0 0]] -definitions['genericshellexplosion-sniper'].explosion2.properties.numparticles = definitions['genericshellexplosion-sniper'].explosion2.properties.numparticles*1.3 -definitions['genericshellexplosion-sniper'].sparks.properties.colormap = [[1 0.3 0.1 0.01 0.9 0.3 0.2 0.017 0 0 0 0]] -definitions['genericshellexplosion-sniper'].explosion.properties.particlesize = definitions['genericshellexplosion-sniper'].explosion.properties.particlesize * 0.85 -definitions['genericshellexplosion-sniper'].explosion.properties.particlesizespread = definitions['genericshellexplosion-sniper'].explosion.properties.particlesizespread * 0.85 -definitions['genericshellexplosion-sniper'].explosion2.properties.particlesize = definitions['genericshellexplosion-sniper'].explosion2.properties.particlesize * 0.85 -definitions['genericshellexplosion-sniper'].explosion2.properties.particlesizespread = definitions['genericshellexplosion-sniper'].explosion2.properties.particlesizespread * 0.85 - +definitions["genericshellexplosion-catapult"] = table.copy(definitions[root .. "-large-bomb"]) +definitions["genericshellexplosion-catapult"].explosion.properties.numparticles = 4 +definitions["genericshellexplosion-catapult"].explosion.properties.colormap = [[0 0 0 0 1 0.45 0.25 0.09 0.75 0.35 0.15 0.066 0.44 0.25 0.06 0.033 0 0 0 0]] +definitions["genericshellexplosion-catapult"].explosion2.properties.numparticles = 4 +definitions["genericshellexplosion-catapult"].explosion2.properties.colormap = [[0 0 0 0 1 0.38 0.1 0.09 0.55 0.22 0.05 0.066 0.25 0.08 0.03 0.033 0 0 0 0]] +definitions["genericshellexplosion-catapult"].dustparticles.properties.numparticles = 1 +definitions["genericshellexplosion-catapult"].dirt.properties.numparticles = 3 +definitions["genericshellexplosion-catapult"].dirt2.properties.numparticles = 3 +definitions["genericshellexplosion-catapult"].sparks.properties.numparticles = 4 +definitions["genericshellexplosion-catapult"].clouddust.properties.numparticles = 1 +definitions["genericshellexplosion-sniper"] = table.copy(definitions[root .. "-large"]) +definitions["genericshellexplosion-sniper"].explosion.properties.colormap = [[0 0 0 0 1 0.3 0.15 0.01 1 0.2 0.12 0.01 0.8 0.16 0.09 0.01 0 0 0 0]] +definitions["genericshellexplosion-sniper"].explosion.properties.numparticles = definitions["genericshellexplosion-sniper"].explosion.properties.numparticles * 1.3 +definitions["genericshellexplosion-sniper"].explosion2.properties.colormap = [[0 0 0 0 1 0 0 0.01 1 0.1 0.09 0.01 0.8 0.1 0.05 0.01 0 0 0 0]] +definitions["genericshellexplosion-sniper"].explosion2.properties.numparticles = definitions["genericshellexplosion-sniper"].explosion2.properties.numparticles * 1.3 +definitions["genericshellexplosion-sniper"].sparks.properties.colormap = [[1 0.3 0.1 0.01 0.9 0.3 0.2 0.017 0 0 0 0]] +definitions["genericshellexplosion-sniper"].explosion.properties.particlesize = definitions["genericshellexplosion-sniper"].explosion.properties.particlesize * 0.85 +definitions["genericshellexplosion-sniper"].explosion.properties.particlesizespread = definitions["genericshellexplosion-sniper"].explosion.properties.particlesizespread * 0.85 +definitions["genericshellexplosion-sniper"].explosion2.properties.particlesize = definitions["genericshellexplosion-sniper"].explosion2.properties.particlesize * 0.85 +definitions["genericshellexplosion-sniper"].explosion2.properties.particlesizespread = definitions["genericshellexplosion-sniper"].explosion2.properties.particlesizespread * 0.85 -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - groundflash_small = { - properties = { - colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], - }, - }, - groundflash_large = { - properties = { - colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], - }, - }, - explosion = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], - }, - }, - innersmoke = { - properties = { - colormap=[[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], - }, - }, - outersmoke = { - properties = { - colormap=[[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], - }, - }, - sparks = { - properties = { - colormap=[[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], - }, - }, - dustparticles = { - properties = { - colormap=[[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], - }, - }, + groundflash_small = { + properties = { + colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], + }, + }, + groundflash_large = { + properties = { + colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], + }, + }, + explosion = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], + }, + }, + innersmoke = { + properties = { + colormap = [[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], + }, + }, + outersmoke = { + properties = { + colormap = [[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], + }, + }, + sparks = { + properties = { + colormap = [[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], + }, + }, + dustparticles = { + properties = { + colormap = [[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/genericunitexplosion.lua b/effects/genericunitexplosion.lua index 50bb62d2bf7..5edddbacc42 100644 --- a/effects/genericunitexplosion.lua +++ b/effects/genericunitexplosion.lua @@ -1,3303 +1,3286 @@ local root = "genericunitexplosion" local definitions = { - [root.."-tiny"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.5, - maxheat = 10, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.6, - sizegrowth = 3.2, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.2 0 0 0 0.01]], - size = 58, - sizegrowth = -0.5, - ttl = 20, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.95 0.93 0.5 0 0 0 0.01]], - size = 46, - sizegrowth = -4.0, - ttl = 14, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 4, - particlelife = 5, - particlelifespread = 8, - particlesize = 5.9, - particlesizespread = 9.32, - particlespeed = 1, - particlespeedspread = 3.5, - pos = [[0, 2, 0]], - sizegrowth = 0.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.3, - sizegrowth = [[-20 r7]], - ttl = 9.5, - pos = [[0, 10, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 2, - particlesize = 4, - particlesizespread = 1.2, - particlespeed = 1.9, - particlespeedspread = 0.4, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 7.5, - particlelifespread = 0, - particlesize = 38, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.4, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=14, - particleLifeSpread=28, - numparticles=2, - particleSpeed=1.4, - particleSpeedSpread=3, - particleSize=11, - particleSizeSpread=20, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.2, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=9, - particleLifeSpread=25, - numparticles=1, - particleSpeed=1.8, - particleSpeedSpread=3.5, - particleSize=30, - particleSizeSpread=15, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.865, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 7, - particlesize = 30, - particlesizespread = 22, - particlespeed = 7, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = -0.04, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.20, - -- ttl = 6, - -- expansionSpeed = 5, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 25, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 1, - particlelife = 16, - particlelifespread = 10, - particlesize = 1.18, - particlesizespread = -1, - particlespeed = 2, - particlespeedspread = 3, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 15, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.25, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 15, - particlesize = 1.22, - particlesizespread = -1.1, - particlespeed = 2.3, - particlespeedspread = 3.3, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 14, - particlelifespread = 14, - particlesize = 1.1, - particlesizespread = 2.3, - particlespeed = 1.5, - particlespeedspread = 3.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0.7 r1.25]], - particlelife = 14, - particlelifespread = 14, - particlesize = 1.1, - particlesizespread = 2.3, - particlespeed = 1.5, - particlespeedspread = 3.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0 r1.15]], - particlelife = 14, - particlelifespread = 14, - particlesize = 1.1, - particlesizespread = 2.3, - particlespeed = 1.5, - particlespeedspread = 3.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 20, - particlesize = 28, - particlesizespread = 30, - particlespeed = 2.55, - particlespeedspread = 2.8, - pos = [[0, 4, 0]], - sizegrowth = 0.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 20, - particlesize = 2.4, - particlesizespread = 1.5, - particlespeed = 2.3, - particlespeedspread = 1, - pos = [[0, 5, 0]], - sizegrowth = 0.2, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - - - [root.."-small"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.1, - sizegrowth = 5.4, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.23 0 0 0 0.01]], - size = 100, - sizegrowth = -0.7, - ttl = 30, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.95 0.93 0.6 1 0.95 0.93 0.23 0 0 0 0.01]], - size = 83, - sizegrowth = -4.0, - ttl = 19, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.86, - colormap = [[0 0 0 0 1 0.8 0.5 0.11 0.9 0.4 0.15 0.088 0.66 0.22 0.03 0.044 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 7, - particlelife = 7, - particlelifespread = 8.5, - particlesize = 7.8, - particlesizespread = 12, - particlespeed = 1.3, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 0.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 2.5, - sizegrowth = [[-20 r7]], - ttl = 10, - pos = [[0, 10, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 2, - particlelife = 4.5, - particlelifespread = 2, - particlesize = 5.3, - particlesizespread = 1.5, - particlespeed = 2.9, - particlespeedspread = 0.7, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8.5, - particlelifespread = 0, - particlesize = 70, - particlesizespread = 10, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=18, - particleLifeSpread=40, - numparticles=4, - particleSpeed=2, - particleSpeedSpread=4.4, - particleSize=8, - particleSizeSpread=15, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=11, - particleLifeSpread=28, - numparticles=3, - particleSpeed=2.5, - particleSpeedSpread=5, - particleSize=20, - particleSizeSpread=11, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.865, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 3, - particlelife = 28, - particlelifespread = 8, - particlesize = 30, - particlesizespread = 22, - particlespeed = 8, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = -0.04, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.20, - -- ttl = 8, - -- expansionSpeed = 7, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.24, - -- ttl = 12.0, - -- expansionSpeed = 4, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 25, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 23, - particlelifespread = 15, - particlesize = 1.47, - particlesizespread = -1.2, - particlespeed = 2.6, - particlespeedspread = 3.3, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 38, - particlelifespread = 17, - particlesize = 1.4, - particlesizespread = -1.2, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, 3, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 16, - particlelifespread = 18, - particlesize = 1.2, - particlesizespread = 2.5, - particlespeed = 1.8, - particlespeedspread = 4.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.6]], - particlelife = 16, - particlelifespread = 18, - particlesize = 1.2, - particlesizespread = 2.5, - particlespeed = 1.8, - particlespeedspread = 4.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 16, - particlelifespread = 18, - particlesize = 1.2, - particlesizespread = 2.5, - particlespeed = 1.8, - particlespeedspread = 4.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 1, - particlelife = 30, - particlelifespread = 50, - particlesize = 40, - particlesizespread = 50, - particlespeed = 2.7, - particlespeedspread = 3.5, - pos = [[0, 4, 0]], - sizegrowth = 0.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 6, - particlelife = 5, - particlelifespread = 33, - particlesize = 3, - particlesizespread = 1.55, - particlespeed = 3, - particlespeedspread = 0.9, - pos = [[0, 5, 0]], - sizegrowth = 0.2, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - - [root.."-medium"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.3, - sizegrowth = 8.5, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.26 0 0 0 0.01]], - size = 144, - sizegrowth = -1, - ttl = 40, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.95 0.93 0.65 1 0.95 0.93 0.25 0 0 0 0.01]], - size = 108, - sizegrowth = -4.5, - ttl = 24, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.82, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 10, - particlelife = 9, - particlelifespread = 11, - particlesize = 7.6, - particlesizespread = 13.4, - particlespeed = 1.9, - particlespeedspread = 5.6, - pos = [[0, 5, 0]], - sizegrowth = 0.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 2, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.24 0.7 0.64 0.50 0.55 0.18 0.12 0.08 0.009 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 3, - sizegrowth = [[-22 r8]], - ttl = 11, - pos = [[0, 10, 0]], - rotParams = [[0, 0, -180 r360]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 3, - particlelife = 5, - particlelifespread = 2, - particlesize = 6.9, - particlesizespread = 1.7, - particlespeed = 3.4, - particlespeedspread = 1, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 9.5, - particlelifespread = 0, - particlesize = 110, - particlesizespread = 16, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=28, - particleLifeSpread=75, - numparticles=4, - particleSpeed=2.8, - particleSpeedSpread=6, - particleSize=11, - particleSizeSpread=17, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=20, - particleLifeSpread=55, - numparticles=3, - particleSpeed=3.7, - particleSpeedSpread=6.7, - particleSize=28, - particleSizeSpread=14, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 5, - particlelife = 34, - particlelifespread = 10, - particlesize = 35, - particlesizespread = 26, - particlespeed = 10, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.04, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.20, - -- ttl = 9.3, - -- expansionSpeed = 7.8, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.25, - -- ttl = 16.0, - -- expansionSpeed = 4.3, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.27, 0]], - numparticles = 5, - particlelife = 30, - particlelifespread = 15, - particlesize = 1.9, - particlesizespread = -1.4, - particlespeed = 2.45, - particlespeedspread = 2.75, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.27, 0]], - numparticles = 3, - particlelife = 35, - particlelifespread = 17, - particlesize = 1.9, - particlesizespread = -1.4, - particlespeed = 2.65, - particlespeedspread = 3.35, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 18, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r2.1]], - particlelife = 22, - particlelifespread = 20, - particlesize = 1.4, - particlesizespread = 2.7, - particlespeed = 1.9, - particlespeedspread = 5.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 18, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.5]], - particlelife = 22, - particlelifespread = 20, - particlesize = 1.4, - particlesizespread = 2.7, - particlespeed = 1.9, - particlespeedspread = 5.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 18, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.25]], - particlelife = 22, - particlelifespread = 20, - particlesize = 1.4, - particlesizespread = 2.7, - particlespeed = 1.9, - particlespeedspread = 5.1, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 40, - particlelifespread = 75, - particlesize = 80, - particlesizespread = 75, - particlespeed = 3.3, - particlespeedspread = 3.3, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 4, - particlelife = 10, - particlelifespread = 48, - particlesize = 1.4, - particlesizespread = 0.6, - particlespeed = 4.8, - particlespeedspread = 1.6, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.56, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, - - [root.."-large"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.4, - sizegrowth = 8.8, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], - size = 190, - sizegrowth = -1.2, - ttl = 64, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[1 0.95 0.93 0.7 1 0.95 0.93 0.25 0 0 0 0.01]], - size = 128, - sizegrowth = -3.0, - ttl = 29, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.84, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.5 0.20 0.085 0.66 0.24 0.05 0.055 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 11, - particlelife = 9, - particlelifespread = 9, - particlesize = 11, - particlesizespread = 17, - particlespeed = 2.2, - particlespeedspread = 6, - pos = [[0, 10, 0]], - sizegrowth = 0.44, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 3.8, - sizegrowth = [[-26 r10]], - ttl = 12, - pos = [[0, 15, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 3, - particlelife = 5.25, - particlelifespread = 2, - particlesize = 7.8, - particlesizespread = 1.66, - particlespeed = 4, - particlespeedspread = 1.25, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 0, - particlesize = 150, - particlesizespread = 20, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=35, - particleLifeSpread=70, - numparticles=5, - particleSpeed=3.25, - particleSpeedSpread=8, - particleSize=11, - particleSizeSpread=20, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=20, - particleLifeSpread=60, - numparticles=4, - particleSpeed=4.5, - particleSpeedSpread=9.5, - particleSize=28, - particleSizeSpread=17, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.865, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 5, - particlelife = 34, - particlelifespread = 10, - particlesize = 60, - particlesizespread = 26, - particlespeed = 9, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.02, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.22, - -- ttl = 10.5, - -- expansionSpeed = 8.5, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.26, - -- ttl = 17.5, - -- expansionSpeed = 5.2, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 6, - particlelife = 40, - particlelifespread = 18, - particlesize = 1.8, - particlesizespread = -1.4, - particlespeed = 2.6, - particlespeedspread = 3, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 45, - particlelifespread = 18, - particlesize = 1.8, - particlesizespread = -1.4, - particlespeed = 3, - particlespeedspread = 4, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 35, - particlelifespread = 22, - particlesize = 1.8, - particlesizespread = 3.5, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 2, - particlelife = 35, - particlelifespread = 22, - particlesize = 1.8, - particlesizespread = 3.5, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.5]], - particlelife = 35, - particlelifespread = 22, - particlesize = 1.8, - particlesizespread = 3.5, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 40, - particlelifespread = 80, - particlesize = 5, - particlesizespread = 15, - particlespeed = 3.3, - particlespeedspread = 3.3, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 4, - particlelife = 10, - particlelifespread = 60, - particlesize = 2.1, - particlesizespread = 0.8, - particlespeed = 5, - particlespeedspread = 1.75, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 4, 0]], - sizegrowth = 0.57, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[75 r20]], - sidetexture = [[flamestream]], - size = [[20 r10]], - sizegrowth = 1.1, - ttl = [[38 r9]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-5 r10, 0 r6, -5 r10]], - drawOrder = 0, - }, - }, - }, - - [root.."-huge"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.1, - sizegrowth = 12.6, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], - size = 235, - sizegrowth = -1.33, - ttl = 52, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], - size = 169, - sizegrowth = -1.5, - ttl = 36, - texture = [[groundflashwhite]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.84, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.5 0.20 0.066 0.66 0.24 0.05 0.055 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 15, - particlelife = 4.4, - particlelifespread = 24, - particlesize = 12, - particlesizespread = 24, - particlespeed = 4.8, - particlespeedspread = 6.7, - pos = [[0, 15, 0]], - sizegrowth = 0.66, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 4.2, - sizegrowth = [[-26 r12]], - ttl = 14, - pos = [[0, 17, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 3, - particlelife = 5.75, - particlelifespread = 2, - particlesize = 7.8, - particlesizespread = 1.8, - particlespeed = 4.8, - particlespeedspread = 1.5, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 0, - particlesize = 190, - particlesizespread = 25, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=44, - particleLifeSpread=100, - numparticles=5, - particleSpeed=3.3, - particleSpeedSpread=10.5, - particleSize=12, - particleSizeSpread=24, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=30, - particleLifeSpread=75, - numparticles=3.4, - particleSpeed=4.9, - particleSpeedSpread=13, - particleSize=27, - particleSizeSpread=20, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.865, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 5, - particlelife = 42, - particlelifespread = 10, - particlesize = 90, - particlesizespread = 45, - particlespeed = 11, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.24, - -- ttl = 10.5, - -- expansionSpeed = 8.7, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.26, - -- ttl = 18.5, - -- expansionSpeed = 5.4, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 8, - particlelife = 30, - particlelifespread = 15, - particlesize = 1.7, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 4.7, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 23, - particlelifespread = 15, - particlesize = 1.7, - particlesizespread = -1.4, - particlespeed = 3.9, - particlespeedspread = 5.1, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[3 r2.3]], - particlelife = 45, - particlelifespread = 25, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r2.2]], - particlelife = 35, - particlelifespread = 18, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - drawOrder = 1, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.5]], - particlelife = 40, - particlelifespread = 20, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 3, - particlelife = 50, - particlelifespread = 110, - particlesize = 90, - particlesizespread = 90, - particlespeed = 3.8, - particlespeedspread = 3.8, - pos = [[0, 4, 0]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 17, - particlelife = 10, - particlelifespread = 55, - particlesize = 2.5, - particlesizespread = 1.1, - particlespeed = 6.3, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = 0.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[85 r22]], - sidetexture = [[flamestream]], - size = [[40 r10]], - sizegrowth = 1.1, - ttl = [[42 r8]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-5 r10, -10 r6, -5 r10]], - drawOrder = 0, - }, - }, - }, - - [root.."-gigantic"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 5, - sizegrowth = 12.8, - speed = [[0, 1 0, 0]], - texture = [[flare]], - drawOrder = 1, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], - size = 280, - sizegrowth = -1.33, - ttl = 54, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = false, - properties = { - colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], - size = 199, - sizegrowth = -1.5, - ttl = 38, - texture = [[groundflashwhite]], - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=1, - texture=[[explo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.8, - size = 6, - sizeGrowth = 13, - pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.85, - colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 6, - particlelifespread = 16, - particlesize = 28, - particlesizespread = 24.5, - particlespeed = 3.2, - particlespeedspread = 5.9, - pos = [[0, 2, 0]], - sizegrowth = 0.48, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwavexplo = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.35 0.8 0.7 0.50 0.65 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 5, - sizegrowth = [[-30 r10]], - ttl = 15, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 5, - particlelife = 6.75, - particlelifespread = 2, - particlesize = 7.8, - particlesizespread = 1.8, - particlespeed = 4.8, - particlespeedspread = 1.5, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 0.93, - texture = [[randomdots]], - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.5, - colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 0, - particlesize = 210, - particlesizespread = 35, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - drawOrder = 2, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.5, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=44, - particleLifeSpread=100, - numparticles=5, - particleSpeed=3.5, - particleSpeedSpread=12, - particleSize=13, - particleSizeSpread=26, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - underwater = true, - water=1, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.35, - alwaysVisible = 0, - sizeGrowth = 0.45, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colorMap=[[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=30, - particleLifeSpread=75, - numparticles=3.4, - particleSpeed=4.9, - particleSpeedSpread=13, - particleSize=27, - particleSizeSpread=20, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.865, - colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.17, 0]], - numparticles = 6, - particlelife = 46, - particlelifespread = 15, - particlesize = 95, - particlesizespread = 49, - particlespeed = 13, - particlespeedspread = 3, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = false, - -- air = true, - -- properties = { - -- alpha = 0.25, - -- ttl = 11.5, - -- expansionSpeed = 8.7, - -- color = [[1.0, 0.85, 0.45]], - -- --alwaysvisible = true, - -- }, - -- }, - -- shockwavewater = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = false, - -- water = true, - -- underwater = true, - -- air = false, - -- properties = { - -- alpha = 0.26, - -- ttl = 19.5, - -- expansionSpeed = 5.4, - -- color = [[0.55, 0.55, 0.8]], - -- --alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 8, - particlelife = 32, - particlelifespread = 17, - particlesize = 1.9, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 4.7, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - drawOrder = 1, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 4, - particlelife = 25, - particlelifespread = 17, - particlesize = 1.8, - particlesizespread = -1.4, - particlespeed = 3.9, - particlespeedspread = 5.1, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[3 r2.3]], - particlelife = 45, - particlelifespread = 25, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r2.2]], - particlelife = 35, - particlelifespread = 18, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - drawOrder = 1, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[2 r1.5]], - particlelife = 40, - particlelifespread = 20, - particlesize = 2, - particlesizespread = 3.7, - particlespeed = 2.4, - particlespeedspread = 7.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 3, - particlelife = 55, - particlelifespread = 120, - particlesize = 90, - particlesizespread = 90, - particlespeed = 3.9, - particlespeedspread = 3.9, - pos = [[0, 4, 0]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = 17, - particlelife = 11, - particlelifespread = 65, - particlesize = 3, - particlesizespread = 1.2, - particlespeed = 6.5, - particlespeedspread = 2, - pos = [[0, 4, 0]], - sizegrowth = 0.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 3, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[90 r22]], - sidetexture = [[flamestream]], - size = [[45 r10]], - sizegrowth = 1.1, - ttl = [[42 r8]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-8 r16, -10 r6, -8 r16]], - drawOrder = 0, - }, - }, - }, -} - --- add different sizes -definitions[root] = definitions[root.."-small"] -local sizes = { - tiny = { + [root .. "-tiny"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.5, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.6, + sizegrowth = 3.2, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.2 0 0 0 0.01]], + size = 58, + sizegrowth = -0.5, + ttl = 20, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.95 0.93 0.5 0 0 0 0.01]], + size = 46, + sizegrowth = -4.0, + ttl = 14, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 4, + particlelife = 5, + particlelifespread = 8, + particlesize = 5.9, + particlesizespread = 9.32, + particlespeed = 1, + particlespeedspread = 3.5, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.3, + sizegrowth = [[-20 r7]], + ttl = 9.5, + pos = [[0, 10, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 2, + particlesize = 4, + particlesizespread = 1.2, + particlespeed = 1.9, + particlespeedspread = 0.4, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 7.5, + particlelifespread = 0, + particlesize = 38, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.4, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 14, + particleLifeSpread = 28, + numparticles = 2, + particleSpeed = 1.4, + particleSpeedSpread = 3, + particleSize = 11, + particleSizeSpread = 20, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.2, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 9, + particleLifeSpread = 25, + numparticles = 1, + particleSpeed = 1.8, + particleSpeedSpread = 3.5, + particleSize = 30, + particleSizeSpread = 15, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.865, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 7, + particlesize = 30, + particlesizespread = 22, + particlespeed = 7, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = -0.04, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.20, + -- ttl = 6, + -- expansionSpeed = 5, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 25, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 1, + particlelife = 16, + particlelifespread = 10, + particlesize = 1.18, + particlesizespread = -1, + particlespeed = 2, + particlespeedspread = 3, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.25, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 15, + particlesize = 1.22, + particlesizespread = -1.1, + particlespeed = 2.3, + particlespeedspread = 3.3, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 14, + particlelifespread = 14, + particlesize = 1.1, + particlesizespread = 2.3, + particlespeed = 1.5, + particlespeedspread = 3.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0.7 r1.25]], + particlelife = 14, + particlelifespread = 14, + particlesize = 1.1, + particlesizespread = 2.3, + particlespeed = 1.5, + particlespeedspread = 3.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0 r1.15]], + particlelife = 14, + particlelifespread = 14, + particlesize = 1.1, + particlesizespread = 2.3, + particlespeed = 1.5, + particlespeedspread = 3.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 20, + particlesize = 28, + particlesizespread = 30, + particlespeed = 2.55, + particlespeedspread = 2.8, + pos = [[0, 4, 0]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 20, + particlesize = 2.4, + particlesizespread = 1.5, + particlespeed = 2.3, + particlespeedspread = 1, + pos = [[0, 5, 0]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + [root .. "-small"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.1, + sizegrowth = 5.4, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.23 0 0 0 0.01]], + size = 100, + sizegrowth = -0.7, + ttl = 30, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.95 0.93 0.6 1 0.95 0.93 0.23 0 0 0 0.01]], + size = 83, + sizegrowth = -4.0, + ttl = 19, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.86, + colormap = [[0 0 0 0 1 0.8 0.5 0.11 0.9 0.4 0.15 0.088 0.66 0.22 0.03 0.044 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 7, + particlelife = 7, + particlelifespread = 8.5, + particlesize = 7.8, + particlesizespread = 12, + particlespeed = 1.3, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.7 0.64 0.50 0.50 0.18 0.12 0.08 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 2.5, + sizegrowth = [[-20 r7]], + ttl = 10, + pos = [[0, 10, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 2, + particlelife = 4.5, + particlelifespread = 2, + particlesize = 5.3, + particlesizespread = 1.5, + particlespeed = 2.9, + particlespeedspread = 0.7, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8.5, + particlelifespread = 0, + particlesize = 70, + particlesizespread = 10, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 18, + particleLifeSpread = 40, + numparticles = 4, + particleSpeed = 2, + particleSpeedSpread = 4.4, + particleSize = 8, + particleSizeSpread = 15, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 11, + particleLifeSpread = 28, + numparticles = 3, + particleSpeed = 2.5, + particleSpeedSpread = 5, + particleSize = 20, + particleSizeSpread = 11, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.865, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 3, + particlelife = 28, + particlelifespread = 8, + particlesize = 30, + particlesizespread = 22, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = -0.04, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.20, + -- ttl = 8, + -- expansionSpeed = 7, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.24, + -- ttl = 12.0, + -- expansionSpeed = 4, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 25, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 23, + particlelifespread = 15, + particlesize = 1.47, + particlesizespread = -1.2, + particlespeed = 2.6, + particlespeedspread = 3.3, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 38, + particlelifespread = 17, + particlesize = 1.4, + particlesizespread = -1.2, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, 3, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 16, + particlelifespread = 18, + particlesize = 1.2, + particlesizespread = 2.5, + particlespeed = 1.8, + particlespeedspread = 4.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.6]], + particlelife = 16, + particlelifespread = 18, + particlesize = 1.2, + particlesizespread = 2.5, + particlespeed = 1.8, + particlespeedspread = 4.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 16, + particlelifespread = 18, + particlesize = 1.2, + particlesizespread = 2.5, + particlespeed = 1.8, + particlespeedspread = 4.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 50, + particlesize = 40, + particlesizespread = 50, + particlespeed = 2.7, + particlespeedspread = 3.5, + pos = [[0, 4, 0]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 6, + particlelife = 5, + particlelifespread = 33, + particlesize = 3, + particlesizespread = 1.55, + particlespeed = 3, + particlespeedspread = 0.9, + pos = [[0, 5, 0]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, }, - small = { + [root .. "-medium"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.3, + sizegrowth = 8.5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.26 0 0 0 0.01]], + size = 144, + sizegrowth = -1, + ttl = 40, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.95 0.93 0.65 1 0.95 0.93 0.25 0 0 0 0.01]], + size = 108, + sizegrowth = -4.5, + ttl = 24, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.82, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 10, + particlelife = 9, + particlelifespread = 11, + particlesize = 7.6, + particlesizespread = 13.4, + particlespeed = 1.9, + particlespeedspread = 5.6, + pos = [[0, 5, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 2, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.24 0.7 0.64 0.50 0.55 0.18 0.12 0.08 0.009 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 3, + sizegrowth = [[-22 r8]], + ttl = 11, + pos = [[0, 10, 0]], + rotParams = [[0, 0, -180 r360]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 3, + particlelife = 5, + particlelifespread = 2, + particlesize = 6.9, + particlesizespread = 1.7, + particlespeed = 3.4, + particlespeedspread = 1, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 9.5, + particlelifespread = 0, + particlesize = 110, + particlesizespread = 16, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 28, + particleLifeSpread = 75, + numparticles = 4, + particleSpeed = 2.8, + particleSpeedSpread = 6, + particleSize = 11, + particleSizeSpread = 17, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 20, + particleLifeSpread = 55, + numparticles = 3, + particleSpeed = 3.7, + particleSpeedSpread = 6.7, + particleSize = 28, + particleSizeSpread = 14, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 5, + particlelife = 34, + particlelifespread = 10, + particlesize = 35, + particlesizespread = 26, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.04, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.20, + -- ttl = 9.3, + -- expansionSpeed = 7.8, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.25, + -- ttl = 16.0, + -- expansionSpeed = 4.3, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.27, 0]], + numparticles = 5, + particlelife = 30, + particlelifespread = 15, + particlesize = 1.9, + particlesizespread = -1.4, + particlespeed = 2.45, + particlespeedspread = 2.75, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.27, 0]], + numparticles = 3, + particlelife = 35, + particlelifespread = 17, + particlesize = 1.9, + particlesizespread = -1.4, + particlespeed = 2.65, + particlespeedspread = 3.35, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 18, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r2.1]], + particlelife = 22, + particlelifespread = 20, + particlesize = 1.4, + particlesizespread = 2.7, + particlespeed = 1.9, + particlespeedspread = 5.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 18, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.5]], + particlelife = 22, + particlelifespread = 20, + particlesize = 1.4, + particlesizespread = 2.7, + particlespeed = 1.9, + particlespeedspread = 5.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 18, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.25]], + particlelife = 22, + particlelifespread = 20, + particlesize = 1.4, + particlesizespread = 2.7, + particlespeed = 1.9, + particlespeedspread = 5.1, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 75, + particlesize = 80, + particlesizespread = 75, + particlespeed = 3.3, + particlespeedspread = 3.3, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 4, + particlelife = 10, + particlelifespread = 48, + particlesize = 1.4, + particlesizespread = 0.6, + particlespeed = 4.8, + particlespeedspread = 1.6, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.56, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, + [root .. "-large"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.4, + sizegrowth = 8.8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], + size = 190, + sizegrowth = -1.2, + ttl = 64, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[1 0.95 0.93 0.7 1 0.95 0.93 0.25 0 0 0 0.01]], + size = 128, + sizegrowth = -3.0, + ttl = 29, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.84, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.5 0.20 0.085 0.66 0.24 0.05 0.055 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 11, + particlelife = 9, + particlelifespread = 9, + particlesize = 11, + particlesizespread = 17, + particlespeed = 2.2, + particlespeedspread = 6, + pos = [[0, 10, 0]], + sizegrowth = 0.44, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 3.8, + sizegrowth = [[-26 r10]], + ttl = 12, + pos = [[0, 15, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 3, + particlelife = 5.25, + particlelifespread = 2, + particlesize = 7.8, + particlesizespread = 1.66, + particlespeed = 4, + particlespeedspread = 1.25, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 0, + particlesize = 150, + particlesizespread = 20, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 35, + particleLifeSpread = 70, + numparticles = 5, + particleSpeed = 3.25, + particleSpeedSpread = 8, + particleSize = 11, + particleSizeSpread = 20, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 20, + particleLifeSpread = 60, + numparticles = 4, + particleSpeed = 4.5, + particleSpeedSpread = 9.5, + particleSize = 28, + particleSizeSpread = 17, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.865, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 5, + particlelife = 34, + particlelifespread = 10, + particlesize = 60, + particlesizespread = 26, + particlespeed = 9, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.02, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.22, + -- ttl = 10.5, + -- expansionSpeed = 8.5, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.26, + -- ttl = 17.5, + -- expansionSpeed = 5.2, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 6, + particlelife = 40, + particlelifespread = 18, + particlesize = 1.8, + particlesizespread = -1.4, + particlespeed = 2.6, + particlespeedspread = 3, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 45, + particlelifespread = 18, + particlesize = 1.8, + particlesizespread = -1.4, + particlespeed = 3, + particlespeedspread = 4, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 35, + particlelifespread = 22, + particlesize = 1.8, + particlesizespread = 3.5, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 2, + particlelife = 35, + particlelifespread = 22, + particlesize = 1.8, + particlesizespread = 3.5, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.5]], + particlelife = 35, + particlelifespread = 22, + particlesize = 1.8, + particlesizespread = 3.5, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 80, + particlesize = 5, + particlesizespread = 15, + particlespeed = 3.3, + particlespeedspread = 3.3, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 4, + particlelife = 10, + particlelifespread = 60, + particlesize = 2.1, + particlesizespread = 0.8, + particlespeed = 5, + particlespeedspread = 1.75, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 4, 0]], + sizegrowth = 0.57, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[75 r20]], + sidetexture = [[flamestream]], + size = [[20 r10]], + sizegrowth = 1.1, + ttl = [[38 r9]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-5 r10, 0 r6, -5 r10]], + drawOrder = 0, + }, + }, }, - medium = { + [root .. "-huge"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.1, + sizegrowth = 12.6, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], + size = 235, + sizegrowth = -1.33, + ttl = 52, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], + size = 169, + sizegrowth = -1.5, + ttl = 36, + texture = [[groundflashwhite]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.84, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.5 0.20 0.066 0.66 0.24 0.05 0.055 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 15, + particlelife = 4.4, + particlelifespread = 24, + particlesize = 12, + particlesizespread = 24, + particlespeed = 4.8, + particlespeedspread = 6.7, + pos = [[0, 15, 0]], + sizegrowth = 0.66, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.30 0.8 0.7 0.50 0.60 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 4.2, + sizegrowth = [[-26 r12]], + ttl = 14, + pos = [[0, 17, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 3, + particlelife = 5.75, + particlelifespread = 2, + particlesize = 7.8, + particlesizespread = 1.8, + particlespeed = 4.8, + particlespeedspread = 1.5, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 0, + particlesize = 190, + particlesizespread = 25, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 44, + particleLifeSpread = 100, + numparticles = 5, + particleSpeed = 3.3, + particleSpeedSpread = 10.5, + particleSize = 12, + particleSizeSpread = 24, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 30, + particleLifeSpread = 75, + numparticles = 3.4, + particleSpeed = 4.9, + particleSpeedSpread = 13, + particleSize = 27, + particleSizeSpread = 20, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.865, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 5, + particlelife = 42, + particlelifespread = 10, + particlesize = 90, + particlesizespread = 45, + particlespeed = 11, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.24, + -- ttl = 10.5, + -- expansionSpeed = 8.7, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.26, + -- ttl = 18.5, + -- expansionSpeed = 5.4, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 8, + particlelife = 30, + particlelifespread = 15, + particlesize = 1.7, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 4.7, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 23, + particlelifespread = 15, + particlesize = 1.7, + particlesizespread = -1.4, + particlespeed = 3.9, + particlespeedspread = 5.1, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[3 r2.3]], + particlelife = 45, + particlelifespread = 25, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r2.2]], + particlelife = 35, + particlelifespread = 18, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + drawOrder = 1, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.5]], + particlelife = 40, + particlelifespread = 20, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 110, + particlesize = 90, + particlesizespread = 90, + particlespeed = 3.8, + particlespeedspread = 3.8, + pos = [[0, 4, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 17, + particlelife = 10, + particlelifespread = 55, + particlesize = 2.5, + particlesizespread = 1.1, + particlespeed = 6.3, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[85 r22]], + sidetexture = [[flamestream]], + size = [[40 r10]], + sizegrowth = 1.1, + ttl = [[42 r8]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-5 r10, -10 r6, -5 r10]], + drawOrder = 0, + }, + }, + }, + [root .. "-gigantic"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 5, + sizegrowth = 12.8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.7 0.3 0.29 0 0 0 0.01]], + size = 280, + sizegrowth = -1.33, + ttl = 54, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = false, + properties = { + colormap = [[1 0.9 0.8 0.7 1 0.9 0.8 0.25 0 0 0 0.01]], + size = 199, + sizegrowth = -1.5, + ttl = 38, + texture = [[groundflashwhite]], + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + texture = [[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.8, + size = 6, + sizeGrowth = 13, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.85, + colormap = [[0 0 0 0 1 0.8 0.5 0.09 0.9 0.4 0.15 0.066 0.66 0.22 0.03 0.033 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 6, + particlelifespread = 16, + particlesize = 28, + particlesizespread = 24.5, + particlespeed = 3.2, + particlespeedspread = 5.9, + pos = [[0, 2, 0]], + sizegrowth = 0.48, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwavexplo = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.35 0.8 0.7 0.50 0.65 0.18 0.12 0.08 0.012 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 5, + sizegrowth = [[-30 r10]], + ttl = 15, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.72 0.4 0.12 1 0.66 0.3 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 5, + particlelife = 6.75, + particlelifespread = 2, + particlesize = 7.8, + particlesizespread = 1.8, + particlespeed = 4.8, + particlespeedspread = 1.5, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 0.93, + texture = [[randomdots]], + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.5, + colormap = [[0.4 0.3 0.055 0.02 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 0, + particlesize = 210, + particlesizespread = 35, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + drawOrder = 2, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.5, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 44, + particleLifeSpread = 100, + numparticles = 5, + particleSpeed = 3.5, + particleSpeedSpread = 12, + particleSize = 13, + particleSizeSpread = 26, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + underwater = true, + water = 1, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.35, + alwaysVisible = 0, + sizeGrowth = 0.45, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colorMap = [[1 0.6 0.35 0.6 0.3 0.2 0.1 0.5 0.18 0.14 0.09 0.44 0.12 0.1 0.08 0.33 0.09 0.09 0.085 0.26 0.06 0.06 0.05 0.16 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 30, + particleLifeSpread = 75, + numparticles = 3.4, + particleSpeed = 4.9, + particleSpeedSpread = 13, + particleSize = 27, + particleSizeSpread = 20, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.865, + colormap = [[1 0.88 0.77 0.015 0.8 0.55 0.3 0.01 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.17, 0]], + numparticles = 6, + particlelife = 46, + particlelifespread = 15, + particlesize = 95, + particlesizespread = 49, + particlespeed = 13, + particlespeedspread = 3, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = false, + -- air = true, + -- properties = { + -- alpha = 0.25, + -- ttl = 11.5, + -- expansionSpeed = 8.7, + -- color = [[1.0, 0.85, 0.45]], + -- --alwaysvisible = true, + -- }, + -- }, + -- shockwavewater = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = false, + -- water = true, + -- underwater = true, + -- air = false, + -- properties = { + -- alpha = 0.26, + -- ttl = 19.5, + -- expansionSpeed = 5.4, + -- color = [[0.55, 0.55, 0.8]], + -- --alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 8, + particlelife = 32, + particlelifespread = 17, + particlesize = 1.9, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 4.7, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + drawOrder = 1, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 4, + particlelife = 25, + particlelifespread = 17, + particlesize = 1.8, + particlesizespread = -1.4, + particlespeed = 3.9, + particlespeedspread = 5.1, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[3 r2.3]], + particlelife = 45, + particlelifespread = 25, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r2.2]], + particlelife = 35, + particlelifespread = 18, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + drawOrder = 1, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[2 r1.5]], + particlelife = 40, + particlelifespread = 20, + particlesize = 2, + particlesizespread = 3.7, + particlespeed = 2.4, + particlespeedspread = 7.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.02 0.02 0.02 0.03 0.055 0.055 0.055 0.066 0.05 0.05 0.05 0.052 0.03 0.03 0.03 0.03 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 3, + particlelife = 55, + particlelifespread = 120, + particlesize = 90, + particlesizespread = 90, + particlespeed = 3.9, + particlespeedspread = 3.9, + pos = [[0, 4, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.07 0.07 0.07 0.1 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = 17, + particlelife = 11, + particlelifespread = 65, + particlesize = 3, + particlesizespread = 1.2, + particlespeed = 6.5, + particlespeedspread = 2, + pos = [[0, 4, 0]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 3, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.07 0.05 0.05 0.30 0.98 0.88 0.35 0.95 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.3 r0.50, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[90 r22]], + sidetexture = [[flamestream]], + size = [[45 r10]], + sizegrowth = 1.1, + ttl = [[42 r8]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-8 r16, -10 r6, -8 r16]], + drawOrder = 0, + }, + }, }, +} - large = { +-- add different sizes +definitions[root] = definitions[root .. "-small"] +local sizes = { + tiny = {}, - }, + small = {}, - huge = { + medium = {}, - }, + large = {}, - gigantic = { + huge = {}, - }, + gigantic = {}, } local types = { - white = { - --groundflash = { - -- color = {1,1,1}, - --} - }, - dirty = { - - }, - builder = { - --explosion = {properties = {colormap = [[0 0 0 0 1 0.92 0.2 0.08 0.91 0.82 0.06 0.06 0.80 0.66 0.04 0.03 0 0 0 0.01]]}}, - --fireglow = { properties = {colormap = [[0.3 0.3 0.04 0.025 0 0 0 0]]}}, - --sparks = { properties = {colormap = [[0.93 0.9 0.20 0.015 0.8 0.8 0.1 0.01 0 0 0 0]]}}, - }, - uw = { - -- groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - explosion = {ground=false, water=false, air=false, underwater=false, properties={colormap=[[0 0 0 0 1 0.75 0.9 0.09 0.45 0.4 0.66 0.066 0.33 0.3 0.05 0.033 0 0 0 0]]}}, - sparks = {ground=false, water=true, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.015 0.30 0.31 0.33 0.01 0 0 0 0]]}}, - dustparticles = {ground=false, water=true, air=false, underwater=true, properties={colormap=[[0.5 0.51 0.53 0.015 0.30 0.31 0.33 0.01 0 0 0 0]]}}, - shockwavexplo = {ground=false, water=true, air=false, underwater=true, properties={colormap=[[0 0 0 0 0.9 0.91 0.93 0.12 0.6 0.61 0.7 0.50 0.14 0.16 0.18 0.008 0.04 0.06 0.08 0.006 0.02 0.03 0.04 0.005 0 0 0 0]]}}, - dirt = true, - dirt2 = false, - --sparks = false, - }, - phib = { - --groundflash_small = false, - groundflash_large = false, - groundflash_white = false, - dirt = true, - dirt2 = false, - --sparks = false, - }, - fire = { - groundfire = { - air = true, - class = [[CExpGenSpawner]], - count = 5, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r6]], - explosiongenerator = [[custom:burnblack]], - pos = [[-9 r18, 2, -9 r18]], - }, - }, - groundfire2 = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1 r6]], - explosiongenerator = [[custom:burnblack]], - pos = [[-15 r25, 2, -15 r25]], - }, - }, - } + white = { + --groundflash = { + -- color = {1,1,1}, + --} + }, + dirty = {}, + builder = { + --explosion = {properties = {colormap = [[0 0 0 0 1 0.92 0.2 0.08 0.91 0.82 0.06 0.06 0.80 0.66 0.04 0.03 0 0 0 0.01]]}}, + --fireglow = { properties = {colormap = [[0.3 0.3 0.04 0.025 0 0 0 0]]}}, + --sparks = { properties = {colormap = [[0.93 0.9 0.20 0.015 0.8 0.8 0.1 0.01 0 0 0 0]]}}, + }, + uw = { + -- groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + explosion = { ground = false, water = false, air = false, underwater = false, properties = { colormap = [[0 0 0 0 1 0.75 0.9 0.09 0.45 0.4 0.66 0.066 0.33 0.3 0.05 0.033 0 0 0 0]] } }, + sparks = { ground = false, water = true, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.015 0.30 0.31 0.33 0.01 0 0 0 0]] } }, + dustparticles = { ground = false, water = true, air = false, underwater = true, properties = { colormap = [[0.5 0.51 0.53 0.015 0.30 0.31 0.33 0.01 0 0 0 0]] } }, + shockwavexplo = { ground = false, water = true, air = false, underwater = true, properties = { colormap = [[0 0 0 0 0.9 0.91 0.93 0.12 0.6 0.61 0.7 0.50 0.14 0.16 0.18 0.008 0.04 0.06 0.08 0.006 0.02 0.03 0.04 0.005 0 0 0 0]] } }, + dirt = true, + dirt2 = false, + --sparks = false, + }, + phib = { + --groundflash_small = false, + groundflash_large = false, + groundflash_white = false, + dirt = true, + dirt2 = false, + --sparks = false, + }, + fire = { + groundfire = { + air = true, + class = [[CExpGenSpawner]], + count = 5, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r6]], + explosiongenerator = [[custom:burnblack]], + pos = [[-9 r18, 2, -9 r18]], + }, + }, + groundfire2 = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1 r6]], + explosiongenerator = [[custom:burnblack]], + pos = [[-15 r25, 2, -15 r25]], + }, + }, + }, } for t, effects in pairs(types) do - for size, e in pairs(sizes) do - definitions[root.."-"..size.."-"..t] = table.merge(definitions[root.."-"..size], effects) - if t == 'phib' then - definitions[root.."-"..size.."-"..t].explosion_uw = table.copy(definitions[root.."-"..size].explosion) - definitions[root.."-"..size.."-"..t].explosion_uw.water = false - definitions[root.."-"..size.."-"..t].explosion_uw.ground = false - definitions[root.."-"..size.."-"..t].explosion_uw.air = false - definitions[root.."-"..size.."-"..t].explosion_uw.underwater = true - definitions[root.."-"..size.."-"..t].explosion_uw.properties.colormap=[[0 0 0 0 1 0.75 0.9 0.09 0.45 0.4 0.66 0.066 0.33 0.3 0.05 0.033 0 0 0 0]] - end - if t == 'dirty' then - definitions[root.."-"..size.."-"..t].innersmoke.properties.numparticles = math.floor(definitions[root.."-"..size.."-"..t].innersmoke.properties.numparticles * 2) - definitions[root.."-"..size.."-"..t].outersmoke.properties.numparticles = math.floor(definitions[root.."-"..size.."-"..t].outersmoke.properties.numparticles * 2) - definitions[root.."-"..size.."-"..t].clouddust.properties.numparticles = math.floor(definitions[root.."-"..size.."-"..t].clouddust.properties.numparticles * 3.2) - definitions[root.."-"..size.."-"..t].grounddust.properties.numparticles = math.floor(definitions[root.."-"..size.."-"..t].grounddust.properties.numparticles * 1.6) - definitions[root.."-"..size.."-"..t].dirt.properties.numparticles = definitions[root.."-"..size.."-"..t].dirt.properties.numparticles * 3 - definitions[root.."-"..size.."-"..t].dirt2.properties.numparticles = definitions[root.."-"..size.."-"..t].dirt2.properties.numparticles * 3 - end - if t == 'fire' then - if size == 'tiny' then - definitions[root.."-"..size.."-"..t].groundfire.count = 1 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r3]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-3 r6, 2, -3 r6]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 2 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r1.5]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-5 r10, 2, -5 r10]] - elseif size == 'small' then - definitions[root.."-"..size.."-"..t].groundfire.count = 3 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r5]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-7 r14, 2, -7 r14]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 6 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r3]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-11 r22, 2, -11 r22]] - elseif size == 'medium' then - definitions[root.."-"..size.."-"..t].groundfire.count = 5 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r6]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-12 r24, 2, -12 r24]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 8 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r4]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-17 r34, 2, -17 r34]] - elseif size == 'large' then - definitions[root.."-"..size.."-"..t].groundfire.count = 6 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r7]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-18 r36, 2, -18 r36]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 10 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r4.5]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-25 r50, 2, -25 r50]] - elseif size == 'huge' then - definitions[root.."-"..size.."-"..t].groundfire.count = 7 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r8]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-25 r50, 2, -25 r50]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 12 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r5.5]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-33 r66, 2, -33 r66]] - elseif size == 'gigantic' then - definitions[root.."-"..size.."-"..t].groundfire.count = 8 - definitions[root.."-"..size.."-"..t].groundfire.properties.delay = [[1 r9]] - definitions[root.."-"..size.."-"..t].groundfire.properties.pos = [[-30 r60, 2, -30 r60]] - definitions[root.."-"..size.."-"..t].groundfire2.count = 15 - definitions[root.."-"..size.."-"..t].groundfire2.properties.delay = [[1 r6]] - definitions[root.."-"..size.."-"..t].groundfire2.properties.pos = [[-42 r84, 2, -42 r84]] - end - end - end + for size, e in pairs(sizes) do + definitions[root .. "-" .. size .. "-" .. t] = table.merge(definitions[root .. "-" .. size], effects) + if t == "phib" then + definitions[root .. "-" .. size .. "-" .. t].explosion_uw = table.copy(definitions[root .. "-" .. size].explosion) + definitions[root .. "-" .. size .. "-" .. t].explosion_uw.water = false + definitions[root .. "-" .. size .. "-" .. t].explosion_uw.ground = false + definitions[root .. "-" .. size .. "-" .. t].explosion_uw.air = false + definitions[root .. "-" .. size .. "-" .. t].explosion_uw.underwater = true + definitions[root .. "-" .. size .. "-" .. t].explosion_uw.properties.colormap = [[0 0 0 0 1 0.75 0.9 0.09 0.45 0.4 0.66 0.066 0.33 0.3 0.05 0.033 0 0 0 0]] + end + if t == "dirty" then + definitions[root .. "-" .. size .. "-" .. t].innersmoke.properties.numparticles = math.floor(definitions[root .. "-" .. size .. "-" .. t].innersmoke.properties.numparticles * 2) + definitions[root .. "-" .. size .. "-" .. t].outersmoke.properties.numparticles = math.floor(definitions[root .. "-" .. size .. "-" .. t].outersmoke.properties.numparticles * 2) + definitions[root .. "-" .. size .. "-" .. t].clouddust.properties.numparticles = math.floor(definitions[root .. "-" .. size .. "-" .. t].clouddust.properties.numparticles * 3.2) + definitions[root .. "-" .. size .. "-" .. t].grounddust.properties.numparticles = math.floor(definitions[root .. "-" .. size .. "-" .. t].grounddust.properties.numparticles * 1.6) + definitions[root .. "-" .. size .. "-" .. t].dirt.properties.numparticles = definitions[root .. "-" .. size .. "-" .. t].dirt.properties.numparticles * 3 + definitions[root .. "-" .. size .. "-" .. t].dirt2.properties.numparticles = definitions[root .. "-" .. size .. "-" .. t].dirt2.properties.numparticles * 3 + end + if t == "fire" then + if size == "tiny" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 1 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r3]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-3 r6, 2, -3 r6]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 2 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r1.5]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-5 r10, 2, -5 r10]] + elseif size == "small" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 3 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r5]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-7 r14, 2, -7 r14]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 6 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r3]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-11 r22, 2, -11 r22]] + elseif size == "medium" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 5 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r6]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-12 r24, 2, -12 r24]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 8 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r4]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-17 r34, 2, -17 r34]] + elseif size == "large" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 6 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r7]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-18 r36, 2, -18 r36]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 10 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r4.5]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-25 r50, 2, -25 r50]] + elseif size == "huge" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 7 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r8]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-25 r50, 2, -25 r50]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 12 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r5.5]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-33 r66, 2, -33 r66]] + elseif size == "gigantic" then + definitions[root .. "-" .. size .. "-" .. t].groundfire.count = 8 + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.delay = [[1 r9]] + definitions[root .. "-" .. size .. "-" .. t].groundfire.properties.pos = [[-30 r60, 2, -30 r60]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.count = 15 + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.delay = [[1 r6]] + definitions[root .. "-" .. size .. "-" .. t].groundfire2.properties.pos = [[-42 r84, 2, -42 r84]] + end + end + end end -definitions['decoycommander'] = table.copy(definitions[root.."-small"]) -definitions['decoycommander'].confetti = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, +definitions["decoycommander"] = table.copy(definitions[root .. "-small"]) +definitions["decoycommander"].confetti = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, properties = { - airdrag = 0.95, - colormap = [[1 0 0 0.01 0 1 0 0.01 1 0 0 0.01 0 1 0.5 0.01 1 0 0 0.01 0 1 0 0.01 1 1 0 0.01 0 1 0 0.01 0 1 0.6 0.01 0 1 0 0.01 1 0.1 0.7 0.01 0.6 0.3 0.6 0.01 0.6 0.6 0.6 0.01 0 0 0 0.01]], - directional = true, - emitrot = 17, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 70, - particlelife = 40, + airdrag = 0.95, + colormap = [[1 0 0 0.01 0 1 0 0.01 1 0 0 0.01 0 1 0.5 0.01 1 0 0 0.01 0 1 0 0.01 1 1 0 0.01 0 1 0 0.01 0 1 0.6 0.01 0 1 0 0.01 1 0.1 0.7 0.01 0.6 0.3 0.6 0.01 0.6 0.6 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 17, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 70, + particlelife = 40, particlelifespread = 120, - particlesize = 0.8, + particlesize = 0.8, particlesizespread = 1, - particlespeed = 3.3, + particlespeed = 3.3, particlespeedspread = 10, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, }, } -definitions['decoycommander'].glitter = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, +definitions["decoycommander"].glitter = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 ]], - directional = true, - emitrot = 14, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 70, - particlelife = 45, + airdrag = 0.95, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 ]], + directional = true, + emitrot = 14, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 70, + particlelife = 45, particlelifespread = 150, - particlesize = 0.8, + particlesize = 0.8, particlesizespread = 0.6, - particlespeed = 4.2, + particlespeed = 4.2, particlespeedspread = 11, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, }, } -definitions['decoycommander'].sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.8 0.65 0.4 0.01 0.9 0.65 0.33 0.015 0 0 0 0.01]], - directional = true, - emitrot = 14, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 17, - particlelife = 18, - particlelifespread = 33, - particlesize = 14, - particlesizespread = 14, - particlespeed = 3.5, - particlespeedspread = 9, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - }, +definitions["decoycommander"].sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.8 0.65 0.4 0.01 0.9 0.65 0.33 0.015 0 0 0 0.01]], + directional = true, + emitrot = 14, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 17, + particlelife = 18, + particlelifespread = 33, + particlesize = 14, + particlesizespread = 14, + particlespeed = 3.5, + particlespeedspread = 9, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + }, } -definitions['decoycommander-selfd'] = table.copy(definitions[root.."-medium"]) -definitions['decoycommander-selfd'].confetti = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[1 0 0 0.01 0 1 0 0.01 1 0 0 0.01 0 1 0.5 0.01 1 0 0 0.01 0 1 0 0.01 1 1 0 0.01 0 1 0 0.01 0 1 0.6 0.01 0 1 0 0.01 1 0.1 0.7 0.01 0.6 0.3 0.6 0.01 0.6 0.6 0.6 0.01 0 0 0 0.01]], - directional = true, - emitrot = 17, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 120, - particlelife = 45, - particlelifespread = 135, - particlesize = 0.8, - particlesizespread = 1, - particlespeed = 3.3, - particlespeedspread = 17, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, - }, +definitions["decoycommander-selfd"] = table.copy(definitions[root .. "-medium"]) +definitions["decoycommander-selfd"].confetti = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[1 0 0 0.01 0 1 0 0.01 1 0 0 0.01 0 1 0.5 0.01 1 0 0 0.01 0 1 0 0.01 1 1 0 0.01 0 1 0 0.01 0 1 0.6 0.01 0 1 0 0.01 1 0.1 0.7 0.01 0.6 0.3 0.6 0.01 0.6 0.6 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 17, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 120, + particlelife = 45, + particlelifespread = 135, + particlesize = 0.8, + particlesizespread = 1, + particlespeed = 3.3, + particlespeedspread = 17, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, + }, } -definitions['decoycommander-selfd'].glitter = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 ]], - directional = true, - emitrot = 14, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 120, - particlelife = 50, - particlelifespread = 160, - particlesize = 0.8, - particlesizespread = 0.6, - particlespeed = 4.2, - particlespeedspread = 18, - pos = [[0, 6, 0]], - sizegrowth = -0.008, - sizemod = 1, - texture = [[dot]], - useairlos = false, - }, +definitions["decoycommander-selfd"].glitter = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 0 0 0 0.01 0 0 0 0.01 1 1 1 0.01 0 0 0 0.01 ]], + directional = true, + emitrot = 14, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 120, + particlelife = 50, + particlelifespread = 160, + particlesize = 0.8, + particlesizespread = 0.6, + particlespeed = 4.2, + particlespeedspread = 18, + pos = [[0, 6, 0]], + sizegrowth = -0.008, + sizemod = 1, + texture = [[dot]], + useairlos = false, + }, } -definitions['decoycommander-selfd'].sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.8 0.65 0.4 0.01 0.9 0.65 0.33 0.015 0 0 0 0.01]], - directional = true, - emitrot = 14, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 25, - particlelife = 25, - particlelifespread = 50 - , - particlesize = 14, - particlesizespread = 14, - particlespeed = 4, - particlespeedspread = 9, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.9, - texture = [[gunshotglow]], - useairlos = false, - }, +definitions["decoycommander-selfd"].sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.8 0.65 0.4 0.01 0.9 0.65 0.33 0.015 0 0 0 0.01]], + directional = true, + emitrot = 14, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 25, + particlelife = 25, + particlelifespread = 50, + particlesize = 14, + particlesizespread = 14, + particlespeed = 4, + particlespeedspread = 9, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.9, + texture = [[gunshotglow]], + useairlos = false, + }, } - -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end local purpleEffects = { - groundflash_small = { - properties = { - colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], - }, - }, - groundflash_large = { - properties = { - colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], - }, - }, - groundflash_white = { - properties = { - colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], - }, - }, - explosion = { - properties = { - colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], - }, - }, - shockwave = { - properties = { - color = [[0.9, 0.3, 1]], - }, - }, - fireglow = { - properties = { - colormap = [[0.29 0.055 0.4 0.02 0 0 0 0]], - }, - }, - innersmoke = { - properties = { - colormap=[[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], - }, - }, - outersmoke = { - properties = { - colormap=[[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], - }, - }, - sparks = { - properties = { - colormap=[[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], - }, - }, - dustparticles = { - properties = { - colormap=[[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], - }, - }, + groundflash_small = { + properties = { + colormap = [[0.7 0.3 1 0.28 0 0 0 0.01]], + }, + }, + groundflash_large = { + properties = { + colormap = [[0.7 0.3 1 0.09 0 0 0 0.01]], + }, + }, + groundflash_white = { + properties = { + colormap = [[0.9 0.7 1 0.25 0 0 0 0.01]], + }, + }, + explosion = { + properties = { + colormap = [[0 0 0 0 0.8 0.5 1 0.09 0.65 0.2 0.9 0.066 0.35 0.07 0.6 0.033 0 0 0 0]], + }, + }, + shockwave = { + properties = { + color = [[0.9, 0.3, 1]], + }, + }, + fireglow = { + properties = { + colormap = [[0.29 0.055 0.4 0.02 0 0 0 0]], + }, + }, + innersmoke = { + properties = { + colormap = [[0.8 0.44 1 0.2 0.3 0.2 0.4 0.35 0.16 0.11 0.21 0.31 0.11 0.07 0.15 0.28 0.09 0.08 0.1 0.22 0.065 0.06 0.07 0.15 0 0 0 0.01]], + }, + }, + outersmoke = { + properties = { + colormap = [[0.8 0.45 1 0.45 0.22 0.15 0.3 0.4 0.15 0.11 0.18 0.35 0.12 0.1 0.13 0.32 0.105 0.095 0.11 0.25 0.061 0.059 0.063 0.17 0 0 0 0.01]], + }, + }, + sparks = { + properties = { + colormap = [[0.75 0.6 0.9 0.017 0.6 0.3 0.8 0.011 0 0 0 0]], + }, + }, + dustparticles = { + properties = { + colormap = [[0.85 0.6 1 0.22 0.75 0.3 1 0.12 0.6 0.2 1 0.06 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/heal.lua b/effects/heal.lua index ace8c0262d3..3c4e811f31f 100644 --- a/effects/heal.lua +++ b/effects/heal.lua @@ -1,61 +1,59 @@ -- heal return { - ["heal"] = { - healg = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.7, - colormap = [[0.25 0.60 0.10 1.0 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[1 r0.3, 1 r0.3, 1 r0.3]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 20, - particlesize = 2.5, - particlesizespread = 4.5, - particlespeed = 0.6, - particlespeedspread = 1.4, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[heal]], - useairlos = false, - }, - }, - healw = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - properties = { - airdrag = 0.7, - colormap = [[1 0.5 1 1 0.5 0.5 1 1 0 0 0 0.5]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.3, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 20, - particlesize = [[2 r2.5]], - particlesizespread = 2, - particlespeed = 0.6, - particlespeedspread = 1.4, - pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[heal]], - useairlos = false, - }, - }, - }, - + ["heal"] = { + healg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + colormap = [[0.25 0.60 0.10 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[1 r0.3, 1 r0.3, 1 r0.3]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 20, + particlesize = 2.5, + particlesizespread = 4.5, + particlespeed = 0.6, + particlespeedspread = 1.4, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[heal]], + useairlos = false, + }, + }, + healw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + colormap = [[1 0.5 1 1 0.5 0.5 1 1 0 0 0 0.5]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 20, + particlesize = [[2 r2.5]], + particlesizespread = 2, + particlespeed = 0.6, + particlespeedspread = 1.4, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[heal]], + useairlos = false, + }, + }, + }, } - diff --git a/effects/heatrays.lua b/effects/heatrays.lua index fe75e8c0cfe..11ab3862bbe 100644 --- a/effects/heatrays.lua +++ b/effects/heatrays.lua @@ -1,793 +1,791 @@ return { ["heatray-large"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], - numparticles = [[0.5 r1]], - particlelife = 15, - particlelifespread = 10, - particlesize = 50.0, - particlesizespread = 10.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[1.5 r1.5]], - sizemod = 0.96, - animParams = [[16,6,120 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], + numparticles = [[0.5 r1]], + particlelife = 15, + particlelifespread = 10, + particlesize = 50.0, + particlesizespread = 10.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[1.5 r1.5]], + sizemod = 0.96, + animParams = [[16,6,120 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 0, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.35 0.15 0.4 0 0 0 0.01]], - size = 32, - sizegrowth = -0.5, - ttl = 8, - texture = [[groundflash]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.35 0.15 0.30 0 0 0 0.01]], - size = 60, - sizegrowth = -0.5, - ttl = 10, - texture = [[groundflash]], - rotParams = [[0, 0, -180 r360]], - }, - }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 0, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.35 0.15 0.4 0 0 0 0.01]], + size = 32, + sizegrowth = -0.5, + ttl = 8, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.35 0.15 0.30 0 0 0 0.01]], + size = 60, + sizegrowth = -0.5, + ttl = 10, + texture = [[groundflash]], + rotParams = [[0, 0, -180 r360]], + }, + }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], - --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, 0., 0]], - numparticles = [[0 r1.05]], - particlelife = 9, - particlelifespread = 6, - particlesize = 2.5, - particlesizespread = 4.0, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = [[1.2 r1.4]], - sizemod = 0.98, - texture = [[flashside3]], - --animParams = [[16,6,60 r40]], - --rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - }, - }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], + --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0., 0]], + numparticles = [[0 r1.05]], + particlelife = 9, + particlelifespread = 6, + particlesize = 2.5, + particlesizespread = 4.0, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = [[1.2 r1.4]], + sizemod = 0.98, + texture = [[flashside3]], + --animParams = [[16,6,60 r40]], + --rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + }, + }, - explosionfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.73, - --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = [[0 r1.07]], - particlelife = 7, - particlelifespread = 10, - particlesize = 34, - particlesizespread = 20, - particlespeed = 4, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = [[1.2 r1.4]], - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,60 r40]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - useairlos = false, - drawOrder = 2, - }, - }, + explosionfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.73, + --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = [[0 r1.07]], + particlelife = 7, + particlelifespread = 10, + particlesize = 34, + particlesizespread = 20, + particlespeed = 4, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = [[1.2 r1.4]], + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,60 r40]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + useairlos = false, + drawOrder = 2, + }, + }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=1, - texture=[[explo]], - heat = 10, - maxheat = 13, - heatFalloff = 3.9, - size = 4.4, - sizeGrowth = 10, - pos = [[r-6 r12, 10, r-6 r12]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + texture = [[explo]], + heat = 10, + maxheat = 13, + heatFalloff = 3.9, + size = 4.4, + sizeGrowth = 10, + pos = [[r-6 r12, 10, r-6 r12]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, - -- shockwave = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = false, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 2, - -- sizegrowth = [[-24 r7]], - -- ttl = 8, - -- pos = [[0, 5, 0]], - -- drawOrder = 1, - -- }, - -- }, + -- shockwave = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = false, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 2, + -- sizegrowth = [[-24 r7]], + -- ttl = 8, + -- pos = [[0, 5, 0]], + -- drawOrder = 1, + -- }, + -- }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.93, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.65 0.3 0.2 0.13 0.55 0.18 0.15 0.11 0.45 0.13 0.12 0.1 0.38 0.11 0.1 0.093 0.28 0.063 0.062 0.058 0.18 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=25, - particleLifeSpread=40, - numparticles=[[0 r1.1]], - particleSpeed=1.5, - particleSpeedSpread=4.5, - particleSize=24, - particleSizeSpread=18, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.93, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.65 0.3 0.2 0.13 0.55 0.18 0.15 0.11 0.45 0.13 0.12 0.1 0.38 0.11 0.1 0.093 0.28 0.063 0.062 0.058 0.18 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 25, + particleLifeSpread = 40, + numparticles = [[0 r1.1]], + particleSpeed = 1.5, + particleSpeedSpread = 4.5, + particleSize = 24, + particleSizeSpread = 18, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.2, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=20, - particleLifeSpread=40, - numparticles=[[0 r1.05]], - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=20, - particleSizeSpread=14, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - }, - }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.2, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 20, + particleLifeSpread = 40, + numparticles = [[0 r1.05]], + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 20, + particleSizeSpread = 14, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.96, - colormap = [[0.9 0.85 0.77 0.019 0.8 0.55 0.3 0.013 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0 r1.1]], - particlelife = 6, - particlelifespread = 8, - particlesize = 27, - particlesizespread = 17, - particlespeed = 4.4, - particlespeedspread = 3.2, - pos = [[0, 4, 0]], - sizegrowth = 1.1, - sizemod = 0.85, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.96, + colormap = [[0.9 0.85 0.77 0.019 0.8 0.55 0.3 0.013 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0 r1.1]], + particlelife = 6, + particlelifespread = 8, + particlesize = 27, + particlesizespread = 17, + particlespeed = 4.4, + particlespeedspread = 3.2, + pos = [[0, 4, 0]], + sizegrowth = 1.1, + sizemod = 0.85, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = [[0 r1.1]], - particlelife = 18, - particlelifespread = 30, - particlesize = 7.5, - particlesizespread = 22, - particlespeed = 1.8, - particlespeedspread = 5, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = [[0 r1.1]], + particlelife = 18, + particlelifespread = 30, + particlesize = 7.5, + particlesizespread = 22, + particlespeed = 1.8, + particlespeedspread = 5, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 16.9, - sizegrowth = 2, - ttl = 80, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 16.9, + sizegrowth = 2, + ttl = 80, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = [[0 r1.08]], - particlelife = 15, - particlelifespread = 40, - particlesize = [[7 r18]], - particlesizespread = 16, - particlespeed = [[3 i0.5]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.3 r0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = [[0 r1.08]], + particlelife = 15, + particlelifespread = 40, + particlesize = [[7 r18]], + particlesizespread = 16, + particlespeed = [[3 i0.5]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.3 r0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[18 r12]], - sidetexture = [[flamestream]], - size = [[15 r8]], - sizegrowth = 1.65, - ttl = [[17 r5]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-7 r14, -4 r6, -7 r14]], - drawOrder = 0, - castShadow = true, - }, - }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[18 r12]], + sidetexture = [[flamestream]], + size = [[15 r8]], + sizegrowth = 1.65, + ttl = [[17 r5]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-7 r14, -4 r6, -7 r14]], + drawOrder = 0, + castShadow = true, + }, + }, + }, - }, + ["heatray-huge"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], + numparticles = [[0.6 r1]], + particlelife = 15, + particlelifespread = 10, + particlesize = 68.0, + particlesizespread = 20.0, + particlespeed = 0.4, + particlespeedspread = 0.2, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[1.5 r1.5]], + sizemod = 0.96, + animParams = [[16,6,120 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, - ["heatray-huge"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - --colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - colormap = [[1.0 0.9 0.7 1 0.8 0.55 0.33 0.85 0.19 0.15 0.12 0.73 0.14 0.12 0.1 0.62 0.022 0.022 0.022 0.3 0.01 0.01 0.01 0.15 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[-0.09 r0.18, 0.06 r0.04, -0.09 r0.18]], - numparticles = [[0.6 r1]], - particlelife = 15, - particlelifespread = 10, - particlesize = 68.0, - particlesizespread = 20.0, - particlespeed = 0.4, - particlespeedspread = 0.2, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[1.5 r1.5]], - sizemod = 0.96, - animParams = [[16,6,120 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, + -- groundflash_small = { + -- class = [[CSimpleGroundFlash]], + -- count = 0, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.5 0.35 0.15 0.4 0 0 0 0.01]], + -- size = 32, + -- sizegrowth = -0.5, + -- ttl = 8, + -- texture = [[groundflash]], + -- }, + -- }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.5 0.35 0.15 0.15 0 0 0 0.01]], + size = 75, + sizegrowth = -0.5, + ttl = 10, + texture = [[groundflash]], + }, + }, - -- groundflash_small = { - -- class = [[CSimpleGroundFlash]], - -- count = 0, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.5 0.35 0.15 0.4 0 0 0 0.01]], - -- size = 32, - -- sizegrowth = -0.5, - -- ttl = 8, - -- texture = [[groundflash]], - -- }, - -- }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.5 0.35 0.15 0.15 0 0 0 0.01]], - size = 75, - sizegrowth = -0.5, - ttl = 10, - texture = [[groundflash]], - }, - }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.90, + colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], + --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0., 0]], + numparticles = [[0 r1.05]], + particlelife = 9, + particlelifespread = 6, + particlesize = 10.5, + particlesizespread = 8.0, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = [[1.4 r1.4]], + sizemod = 0.98, + texture = [[flashside3]], + --animParams = [[16,6,60 r40]], + --rotParams = [[-5 r10, -5 r10, -180 r360]], + useairlos = false, + drawOrder = 1, + }, + }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.90, - colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.03 0 0 0 0.01]], - --colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, 0., 0]], - numparticles = [[0 r1.05]], - particlelife = 9, - particlelifespread = 6, - particlesize = 10.5, - particlesizespread = 8.0, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = [[1.4 r1.4]], - sizemod = 0.98, - texture = [[flashside3]], - --animParams = [[16,6,60 r40]], - --rotParams = [[-5 r10, -5 r10, -180 r360]], - useairlos = false, - drawOrder = 1, - }, - }, + explosionfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.73, + --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = [[0 r1.1]], + particlelife = 7, + particlelifespread = 10, + particlesize = 60, + particlesizespread = 30, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = [[1.35 r1.45]], + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,60 r40]], + rotParams = [[-10 r20, -10 r20, -180 r360]], + useairlos = false, + drawOrder = 2, + }, + }, - explosionfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.73, - --colormap = [[0 0 0 0 1 0.9 0.6 0.12 0.9 0.5 0.2 0.09 0.66 0.28 0.04 0.04 0 0 0 0]], - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3, 0]], - numparticles = [[0 r1.1]], - particlelife = 7, - particlelifespread = 10, - particlesize = 60, - particlesizespread = 30, - particlespeed = 5, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = [[1.35 r1.45]], - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,60 r40]], - rotParams = [[-10 r20, -10 r20, -180 r360]], - useairlos = false, - drawOrder = 2, - }, - }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + texture = [[explo]], + heat = 10, + maxheat = 13, + heatFalloff = 3.9, + size = 7.6, + sizeGrowth = 11, + pos = [[r-6 r12, 10, r-6 r12]], + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - alwaysVisible=1, - texture=[[explo]], - heat = 10, - maxheat = 13, - heatFalloff = 3.9, - size = 7.6, - sizeGrowth = 11, - pos = [[r-6 r12, 10, r-6 r12]], - speed=[[0, 0, 0]], - drawOrder = 1, - }, - }, + -- shockwave = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = false, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 2, + -- sizegrowth = [[-24 r7]], + -- ttl = 8, + -- pos = [[0, 5, 0]], + -- drawOrder = 1, + -- }, + -- }, - -- shockwave = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = false, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 1 0.95 0.9 0.12 0.6 0.55 0.35 0.45 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 2, - -- sizegrowth = [[-24 r7]], - -- ttl = 8, - -- pos = [[0, 5, 0]], - -- drawOrder = 1, - -- }, - -- }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.9, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.60 0.3 0.2 0.13 0.55 0.18 0.15 0.11 0.45 0.13 0.12 0.1 0.36 0.11 0.1 0.093 0.28 0.063 0.062 0.058 0.17 0 0 0 0.01]], + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + particleLife = 25, + particleLifeSpread = 50, + numparticles = [[0 r1.1]], + particleSpeed = 1.5, + particleSpeedSpread = 4.5, + particleSize = 28, + particleSizeSpread = 22, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + castShadow = true, + }, + }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.9, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.60 0.3 0.2 0.13 0.55 0.18 0.15 0.11 0.45 0.13 0.12 0.1 0.36 0.11 0.1 0.093 0.28 0.063 0.062 0.058 0.17 0 0 0 0.01]], - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - particleLife=25, - particleLifeSpread=50, - numparticles=[[0 r1.1]], - particleSpeed=1.5, - particleSpeedSpread=4.5, - particleSize=28, - particleSizeSpread=22, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - castShadow = true, - }, - }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.2, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[fogdirty]], + particleLife = 20, + particleLifeSpread = 40, + numparticles = [[0 r1.05]], + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 28, + particleSizeSpread = 16, + directional = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + }, + }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.2, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[fogdirty]], - particleLife=20, - particleLifeSpread=40, - numparticles=[[0 r1.05]], - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=28, - particleSizeSpread=16, - directional=0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - }, - }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.92, + colormap = [[0.9 0.85 0.77 0.019 0.8 0.55 0.3 0.013 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0 r1.1]], + particlelife = 6, + particlelifespread = 8, + particlesize = 30, + particlesizespread = 18, + particlespeed = 7.4, + particlespeedspread = 3.2, + pos = [[0, 4, 0]], + sizegrowth = 1.2, + sizemod = 0.85, + texture = [[gunshotglow]], + useairlos = false, + drawOrder = 2, + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.92, - colormap = [[0.9 0.85 0.77 0.019 0.8 0.55 0.3 0.013 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0 r1.1]], - particlelife = 6, - particlelifespread = 8, - particlesize = 30, - particlesizespread = 18, - particlespeed = 7.4, - particlespeedspread = 3.2, - pos = [[0, 4, 0]], - sizegrowth = 1.2, - sizemod = 0.85, - texture = [[gunshotglow]], - useairlos = false, - drawOrder = 2, - }, - }, + watersparks = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.03, 0]], + numparticles = [[0.2 r1]], + particlelife = 18, + particlelifespread = 30, + particlesize = 9.5, + particlesizespread = 25, + particlespeed = 5.8, + particlespeedspread = 7, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-15 r30, -5 r10, 180]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, - watersparks = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.03, 0]], - numparticles = [[0.2 r1]], - particlelife = 18, - particlelifespread = 30, - particlesize = 9.5, - particlesizespread = 25, - particlespeed = 5.8, - particlespeedspread = 7, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-15 r30, -5 r10, 180]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 16.9, + sizegrowth = 2, + ttl = 80, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 16.9, - sizegrowth = 2, - ttl = 80, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, + watersplash = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = false, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 0.95, 0]], + gravity = [[0, -0.06, 0]], + numparticles = [[0.33 r1]], + particlelife = 13, + particlelifespread = 25, + particlesize = 12, + particlesizespread = 22, + particlespeed = [[3 i0.5]], + particlespeedspread = 1.2, + pos = [[0, 70 r50, 0]], + rotParams = [[-100 r200, -0.5 r1, -180 r360]], + sizegrowth = [[0.4 r0.9]], + sizemod = 1, + texture = [[explowater]], + useairlos = true, + }, + }, - watersplash = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = false, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 0.95, 0]], - gravity = [[0, -0.06, 0]], - numparticles = [[0.33 r1]], - particlelife = 13, - particlelifespread = 25, - particlesize = 12, - particlesizespread = 22, - particlespeed = [[3 i0.5]], - particlespeedspread = 1.2, - pos = [[0, 70 r50, 0]], - rotParams = [[-100 r200, -0.5 r1, -180 r360]], - sizegrowth = [[0.4 r0.9]], - sizemod = 1, - texture = [[explowater]], - useairlos = true, - }, - }, + kickedupwater = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = [[0.15 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 15, + particlesizespread = 45, + particlespeed = [[3 i0.5]], + particlespeedspread = 0, + pos = [[0, 70 r50, 0]], + sizegrowth = [[0.3 r0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, - kickedupwater = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = [[0.15 r1]], - particlelife = 15, - particlelifespread = 40, - particlesize = 15, - particlesizespread = 45, - particlespeed = [[3 i0.5]], - particlespeedspread = 0, - pos = [[0, 70 r50, 0]], - sizegrowth = [[0.3 r0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, - - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], - dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[24 r16]], - sidetexture = [[flamestream]], - size = [[19 r10]], - sizegrowth = 1.8, - ttl = [[17 r5]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-9 r18, -4 r9, -9 r18]], - drawOrder = 0, - castShadow = true, - }, - }, - }, - -} \ No newline at end of file + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0.95 0.68 0.28 0.92 0.93 0.65 0.27 0.71 0.07 0.05 0.05 0.63 0.07 0.05 0.05 0.30 0.05 0.04 0.04 0.24 0.03 0.03 0.03 0.16 0.025 0.025 0.025 0.09 0.02 0.02 0.02 0.07 0 0 0 0.01]], + dir = [[-0.7 r1.4, 0.2 r0.8, -0.7 r1.4]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[24 r16]], + sidetexture = [[flamestream]], + size = [[19 r10]], + sizegrowth = 1.8, + ttl = [[17 r5]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-9 r18, -4 r9, -9 r18]], + drawOrder = 0, + castShadow = true, + }, + }, + }, +} diff --git a/effects/juno_sphere_emit.lua b/effects/juno_sphere_emit.lua index 1dcb8179588..6dcf77834ea 100644 --- a/effects/juno_sphere_emit.lua +++ b/effects/juno_sphere_emit.lua @@ -7,7 +7,7 @@ return { ground = true, unit = true, count = 4, - properties = { + properties = { airdrag = 0.92, sizeGrowth = -0.03, sizeMod = 1.0, @@ -26,7 +26,7 @@ return { directional = true, emitRot = 40, emitRotSpread = 32, - useAirLos = false; + useAirLos = false, }, }, }, diff --git a/effects/laserhit.lua b/effects/laserhit.lua index 325a1b34f91..6cc32e63847 100644 --- a/effects/laserhit.lua +++ b/effects/laserhit.lua @@ -1,1390 +1,1386 @@ - local definitions = { - ["laserhit-mini"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.04, - -- flashsize = 50, - -- ground = true, - -- ttl = 5, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.8, - -- [3] = 0.5, - -- }, - --}, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.15 0.05 0.35 0 0 0 0.01]], - size = 0.6, - sizegrowth = 0, - ttl = 18, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 10, - particlelife = 2, - particlelifespread = 13, - particlesize = 0.7, - particlesizespread = 0.7, - particlespeed = 1, - particlespeedspread = 2.5, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 4, - particlesize = 2, - particlesizespread = 3, - particlespeed = 0.5, - particlespeedspread = 1.25, - pos = [[0, 2, 0]], - sizegrowth = 2.6, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 6, - particlesize = 0.3, - particlesizespread = 0.2, - particlespeed = 0.8, - particlespeedspread = 0.25, - pos = [[0, 1, 0]], - sizegrowth = 1.5, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 5, - -- particlelifespread = 3, - -- particlesize = 22, - -- particlesizespread = 15, - -- particlespeed = 4, - -- particlespeedspread = 2, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, - - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 13, - particlesize = 0.6, - particlesizespread = 0, - particlespeed = 1.2, - particlespeedspread = 1, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + ["laserhit-mini"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.04, + -- flashsize = 50, + -- ground = true, + -- ttl = 5, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.8, + -- [3] = 0.5, + -- }, + --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.15 0.05 0.35 0 0 0 0.01]], + size = 0.6, + sizegrowth = 0, + ttl = 18, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 13, + particlesize = 0.7, + particlesizespread = 0.7, + particlespeed = 1, + particlespeedspread = 2.5, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 4, + particlesize = 2, + particlesizespread = 3, + particlespeed = 0.5, + particlespeedspread = 1.25, + pos = [[0, 2, 0]], + sizegrowth = 2.6, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 6, + particlesize = 0.3, + particlesizespread = 0.2, + particlespeed = 0.8, + particlespeedspread = 0.25, + pos = [[0, 1, 0]], + sizegrowth = 1.5, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 5, + -- particlelifespread = 3, + -- particlesize = 22, + -- particlesizespread = 15, + -- particlespeed = 4, + -- particlespeedspread = 2, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, - ["laserhit-tiny"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.04, - -- flashsize = 50, - -- ground = true, - -- ttl = 5, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.8, - -- [3] = 0.5, - -- }, - --}, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.15 0.05 0.35 0 0 0 0.01]], - size = 1.8, - sizegrowth = 0, - ttl = 20, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 2, - particlelife = 2, - particlelifespread = 10, - particlesize = 1.5, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 1, 0]], - sizegrowth = 0.2, - sizemod = 0.66, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[1.9 r1.5]], - sizegrowth = [[2.5 r1.1]], - ttl = 20, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-2 r4, 1, -2 r4]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 4, - particlesize = 25, - particlesizespread = 38, - particlespeed = 0.75, - particlespeedspread = 3.3, - pos = [[0, 2, 0]], - sizegrowth = 2.6, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 8, - particlesize = 0.7, - particlesizespread = 0.4, - particlespeed = 1.5, - particlespeedspread = 0.5, - pos = [[0, 1, 0]], - sizegrowth = 3.3, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 5, - -- particlelifespread = 3, - -- particlesize = 22, - -- particlesizespread = 15, - -- particlespeed = 4, - -- particlespeedspread = 2, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 13, + particlesize = 0.6, + particlesizespread = 0, + particlespeed = 1.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 13, - particlesize = 1, - particlesizespread = 0, - particlespeed = 2, - particlespeedspread = 1.5, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + ["laserhit-tiny"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.04, + -- flashsize = 50, + -- ground = true, + -- ttl = 5, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.8, + -- [3] = 0.5, + -- }, + --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.15 0.05 0.35 0 0 0 0.01]], + size = 1.8, + sizegrowth = 0, + ttl = 20, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 2, + particlelifespread = 10, + particlesize = 1.5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 1, 0]], + sizegrowth = 0.2, + sizemod = 0.66, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[1.9 r1.5]], + sizegrowth = [[2.5 r1.1]], + ttl = 20, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-2 r4, 1, -2 r4]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 4, + particlesize = 25, + particlesizespread = 38, + particlespeed = 0.75, + particlespeedspread = 3.3, + pos = [[0, 2, 0]], + sizegrowth = 2.6, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 8, + particlesize = 0.7, + particlesizespread = 0.4, + particlespeed = 1.5, + particlespeedspread = 0.5, + pos = [[0, 1, 0]], + sizegrowth = 3.3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 5, + -- particlelifespread = 3, + -- particlesize = 22, + -- particlesizespread = 15, + -- particlespeed = 4, + -- particlespeedspread = 2, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, - ["laserhit-small"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.048, - -- flashsize = 68, - -- ground = true, - -- ttl = 8, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.8, - -- [3] = 0.5, - -- }, - --}, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - unit = false, - nounit = false, - water = false, - underwater = false, - properties = { - colormap = [[1 0.15 0.05 0.4 0 0 0 0.01]], - size = 3, - sizegrowth = 0, - ttl = 24, - texture = [[groundflash]], - }, - }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 13, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1.5, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, - --kickedupdirt = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.66, - -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 60, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 4, - -- particlelife = 2, - -- particlelifespread = 15, - -- particlesize = 5.5, - -- particlesizespread = 5, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.25, - -- sizemod = 0.7, - -- texture = [[randomdots]], - -- }, - --}, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 60, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 4, - particlelife = 2, - particlelifespread = 13, - particlesize = 1.5, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 1, 0]], - sizegrowth = 0.2, - sizemod = 0.7, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[2.1 r2]], - sizegrowth = [[2.5 r1.1]], - ttl = 25, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 5, - particlesize = 42, - particlesizespread = 46, - particlespeed = 1.5, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 3.3, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 13, - particlelifespread = 10, - particlesize = 3, - particlesizespread = 1.4, - particlespeed = 1.5, - particlespeedspread = 0.5, - pos = [[0, 1, 0]], - sizegrowth = 3.5, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 6, - -- particlelifespread = 3, - -- particlesize = 35, - -- particlesizespread = 45, - -- particlespeed = 4, - -- particlespeedspread = 3, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, + ["laserhit-small"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.048, + -- flashsize = 68, + -- ground = true, + -- ttl = 8, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.8, + -- [3] = 0.5, + -- }, + --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + unit = false, + nounit = false, + water = false, + underwater = false, + properties = { + colormap = [[1 0.15 0.05 0.4 0 0 0 0.01]], + size = 3, + sizegrowth = 0, + ttl = 24, + texture = [[groundflash]], + }, + }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.8 0.8 0.9 0.03 0.3 0.3 0.8 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 5, - particlespeed = 2, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = 0.6, - sizemod = 0.5, - texture = [[bubbletexture]], - useairlos = false, - }, - }, - }, + --kickedupdirt = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.66, + -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 60, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 4, + -- particlelife = 2, + -- particlelifespread = 15, + -- particlesize = 5.5, + -- particlesizespread = 5, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.25, + -- sizemod = 0.7, + -- texture = [[randomdots]], + -- }, + --}, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 60, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 4, + particlelife = 2, + particlelifespread = 13, + particlesize = 1.5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 1, 0]], + sizegrowth = 0.2, + sizemod = 0.7, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[2.1 r2]], + sizegrowth = [[2.5 r1.1]], + ttl = 25, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 5, + particlesize = 42, + particlesizespread = 46, + particlespeed = 1.5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 3.3, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 13, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 1.4, + particlespeed = 1.5, + particlespeedspread = 0.5, + pos = [[0, 1, 0]], + sizegrowth = 3.5, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 6, + -- particlelifespread = 3, + -- particlesize = 35, + -- particlesizespread = 45, + -- particlespeed = 4, + -- particlespeedspread = 3, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, - ["laserhit-emp"] = { + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.8 0.8 0.9 0.03 0.3 0.3 0.8 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 0.5, + texture = [[bubbletexture]], + useairlos = false, + }, + }, + }, + ["laserhit-emp"] = { - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 60, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 4, - particlelife = 2, - particlelifespread = 13, - particlesize = 1.5, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 1, 0]], - sizegrowth = 0.2, - sizemod = 0.7, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[2.1 r2]], - sizegrowth = [[2.5 r1.1]], - ttl = 25, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.88, - colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.8 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 5, - particlesize = 32, - particlesizespread = 36, - particlespeed = 1, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = 3.3, - sizemod = 0.5, - texture = [[lightninginair]], - useairlos = false, - }, - }, - -- hit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- nounit = true, - -- properties = { - -- airdrag = 0.8, - -- colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - -- directional = true, - -- emitrot = 15, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.14, 0]], - -- numparticles = 1, - -- particlelife = 13, - -- particlelifespread = 10, - -- particlesize = 3, - -- particlesizespread = 1.4, - -- particlespeed = 1.5, - -- particlespeedspread = 0.5, - -- pos = [[0, 1, 0]], - -- sizegrowth = 3.5, - -- sizemod = 0.5, - -- texture = [[dirt]], - -- useairlos = false, - -- }, - -- }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 60, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 4, + particlelife = 2, + particlelifespread = 13, + particlesize = 1.5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 1, 0]], + sizegrowth = 0.2, + sizemod = 0.7, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[2.1 r2]], + sizegrowth = [[2.5 r1.1]], + ttl = 25, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.88, + colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.8 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 5, + particlesize = 32, + particlesizespread = 36, + particlespeed = 1, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 3.3, + sizemod = 0.5, + texture = [[lightninginair]], + useairlos = false, + }, + }, + -- hit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- nounit = true, + -- properties = { + -- airdrag = 0.8, + -- colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + -- directional = true, + -- emitrot = 15, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.14, 0]], + -- numparticles = 1, + -- particlelife = 13, + -- particlelifespread = 10, + -- particlesize = 3, + -- particlesizespread = 1.4, + -- particlespeed = 1.5, + -- particlespeedspread = 0.5, + -- pos = [[0, 1, 0]], + -- sizegrowth = 3.5, + -- sizemod = 0.5, + -- texture = [[dirt]], + -- useairlos = false, + -- }, + -- }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.8 0.8 0.9 0.03 0.3 0.3 0.8 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 5, - particlespeed = 2, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = 0.6, - sizemod = 0.5, - texture = [[bubbletexture]], - useairlos = false, - }, - }, - }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.8 0.8 0.9 0.03 0.3 0.3 0.8 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 0.5, + texture = [[bubbletexture]], + useairlos = false, + }, + }, + }, - ["laserhit-medium"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.048, - -- flashsize = 68, - -- ground = true, - -- ttl = 8, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.8, - -- [3] = 0.5, - -- }, - --}, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - unit = false, - nounit = false, - water = false, - underwater = false, - properties = { - colormap = [[1 0.15 0.05 0.42 0 0 0 0.01]], - size = 4, - sizegrowth = 0, - ttl = 28, - texture = [[groundflash]], - }, - }, - --kickedupdirt = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.66, - -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 60, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 4, - -- particlelife = 2, - -- particlelifespread = 15, - -- particlesize = 5.5, - -- particlesizespread = 5, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.25, - -- sizemod = 0.7, - -- texture = [[randomdots]], - -- }, - --}, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.86, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 70, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 4, - particlelife = 3, - particlelifespread = 13, - particlesize = 2.2, - particlesizespread = 2.5, - particlespeed = 2.5, - particlespeedspread = 4.3, - pos = [[0, 1, 0]], - sizegrowth = 0.25, - sizemod = 0.7, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[2.6 r2.8]], - sizegrowth = [[3.1 r1.6]], - ttl = 30, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 3, - particlelife = 9, - particlelifespread = 6, - particlesize = 50, - particlesizespread = 60, - particlespeed = 1.5, - particlespeedspread = 6, - pos = [[0, 2, 0]], - sizegrowth = 3.5, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 17, - particlelifespread = 10, - particlesize = 8.5, - particlesizespread = 5, - particlespeed = 2.5, - particlespeedspread = 1, - pos = [[0, 1, 0]], - sizegrowth = 3.2, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 6, - -- particlelifespread = 3, - -- particlesize = 35, - -- particlesizespread = 45, - -- particlespeed = 5, - -- particlespeedspread = 3, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, + ["laserhit-medium"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.048, + -- flashsize = 68, + -- ground = true, + -- ttl = 8, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.8, + -- [3] = 0.5, + -- }, + --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + unit = false, + nounit = false, + water = false, + underwater = false, + properties = { + colormap = [[1 0.15 0.05 0.42 0 0 0 0.01]], + size = 4, + sizegrowth = 0, + ttl = 28, + texture = [[groundflash]], + }, + }, + --kickedupdirt = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.66, + -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 60, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 4, + -- particlelife = 2, + -- particlelifespread = 15, + -- particlesize = 5.5, + -- particlesizespread = 5, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.25, + -- sizemod = 0.7, + -- texture = [[randomdots]], + -- }, + --}, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.86, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 70, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 4, + particlelife = 3, + particlelifespread = 13, + particlesize = 2.2, + particlesizespread = 2.5, + particlespeed = 2.5, + particlespeedspread = 4.3, + pos = [[0, 1, 0]], + sizegrowth = 0.25, + sizemod = 0.7, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[2.6 r2.8]], + sizegrowth = [[3.1 r1.6]], + ttl = 30, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 3, + particlelife = 9, + particlelifespread = 6, + particlesize = 50, + particlesizespread = 60, + particlespeed = 1.5, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 3.5, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 17, + particlelifespread = 10, + particlesize = 8.5, + particlesizespread = 5, + particlespeed = 2.5, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 3.2, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 6, + -- particlelifespread = 3, + -- particlesize = 35, + -- particlesizespread = 45, + -- particlespeed = 5, + -- particlespeedspread = 3, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 4, - particlespeedspread = 2.5, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 2.5, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, - ["laserhit-large"] = { - --groundflash = { - -- air = true, - -- -- flashalpha = 0.048, - -- flashsize = 68, - -- ground = true, - -- ttl = 8, - -- water = true, - --underwater = true, - -- color = { - -- [1] = 1, - -- [2] = 0.8, - -- [3] = 0.5, - -- }, - --}, - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - unit = false, - nounit = false, - water = false, - underwater = false, - properties = { - colormap = [[1 0.15 0.05 0.44 0 0 0 0.01]], - size = 4.5, - sizegrowth = 0, - ttl = 22, - texture = [[groundflash]], - }, - }, - --kickedupdirt = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- properties = { - -- airdrag = 0.66, - -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - -- directional = false, - -- emitrot = 60, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = 4, - -- particlelife = 2, - -- particlelifespread = 15, - -- particlesize = 5.5, - -- particlesizespread = 5, - -- particlespeed = 2.5, - -- particlespeedspread = 4, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.25, - -- sizemod = 0.7, - -- texture = [[randomdots]], - -- }, - --}, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 70, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 5, - particlelife = 4, - particlelifespread = 13, - particlesize = 2.4, - particlesizespread = 2.8, - particlespeed = 3, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.3, - sizemod = 0.7, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[4.4 r3.8]], - sizegrowth = [[2.8 r1.4]], - ttl = 32, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - }, - }, - - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 10, - particlesize = 100, - particlesizespread = 80, - particlespeed = 3.3, - particlespeedspread = 9, - pos = [[0, 2, 0]], - sizegrowth = 3.3, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 14, - particlesize = 14, - particlesizespread = 7, - particlespeed = 2.5, - particlespeedspread = 0.7, - pos = [[0, 1, 0]], - sizegrowth = 3.5, - sizemod = 0.8, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 6, - -- particlelifespread = 3, - -- particlesize = 35, - -- particlesizespread = 45, - -- particlespeed = 5, - -- particlespeedspread = 3, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, + ["laserhit-large"] = { + --groundflash = { + -- air = true, + -- -- flashalpha = 0.048, + -- flashsize = 68, + -- ground = true, + -- ttl = 8, + -- water = true, + --underwater = true, + -- color = { + -- [1] = 1, + -- [2] = 0.8, + -- [3] = 0.5, + -- }, + --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + unit = false, + nounit = false, + water = false, + underwater = false, + properties = { + colormap = [[1 0.15 0.05 0.44 0 0 0 0.01]], + size = 4.5, + sizegrowth = 0, + ttl = 22, + texture = [[groundflash]], + }, + }, + --kickedupdirt = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- properties = { + -- airdrag = 0.66, + -- -- colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + -- directional = false, + -- emitrot = 60, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = 4, + -- particlelife = 2, + -- particlelifespread = 15, + -- particlesize = 5.5, + -- particlesizespread = 5, + -- particlespeed = 2.5, + -- particlespeedspread = 4, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.25, + -- sizemod = 0.7, + -- texture = [[randomdots]], + -- }, + --}, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 70, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 5, + particlelife = 4, + particlelifespread = 13, + particlesize = 2.4, + particlesizespread = 2.8, + particlespeed = 3, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.3, + sizemod = 0.7, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[4.4 r3.8]], + sizegrowth = [[2.8 r1.4]], + ttl = 32, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + }, + }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 1, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 4, - particlespeedspread = 2.5, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 10, + particlesize = 100, + particlesizespread = 80, + particlespeed = 3.3, + particlespeedspread = 9, + pos = [[0, 2, 0]], + sizegrowth = 3.3, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 14, + particlesize = 14, + particlesizespread = 7, + particlespeed = 2.5, + particlespeedspread = 0.7, + pos = [[0, 1, 0]], + sizegrowth = 3.5, + sizemod = 0.8, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 6, + -- particlelifespread = 3, + -- particlesize = 35, + -- particlesizespread = 45, + -- particlespeed = 5, + -- particlespeedspread = 3, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 2.5, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, } -- add coloring local colors = { - red = { - sparks = {properties={colormap=[[1 0.4 0.1 0.01 0.7 0.15 0.05 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[1 0.3 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]]}}, - }, - green = { - sparks = {properties={colormap=[[0.7 1 0.3 0.01 0.45 0.7 0.15 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[0.3 1 0.1 0.01 0.02 0.05 0.005 0.01 0.006 0.012 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]]}}, - }, - aqua = { - sparks = {properties={colormap=[[0.3 1 0.7 0.01 0.15 0.7 0.45 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[0.2 1 0.8 0.01 0.02 0.05 0.06 0.01 0.006 0.012 0.0014 0.01 0.04 0.04 0.05 0.01 0.04 0.038 0.040 0.01 0 0 0 0 ]]}}, - }, - yellow = { - sparks = {properties={colormap=[[1 1 0.3 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[1 1 0.1 0.01 0.05 0.05 0.005 0.01 0.012 0.012 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]]}}, - }, - blue = { - sparks = {properties={colormap=[[0.7 0.7 1 0.01 0.45 0.45 0.7 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[0.3 0.3 1 0.01 0.01 0.01 0.5 0.01 0.006 0.006 0.012 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]]}}, - }, - purple = { - sparks = {properties={colormap=[[1 0.7 0.9 0.01 0.7 0.4 0.65 0.01 0 0 0 0 ]]}}, - hit = {properties={colormap=[[1 0.3 1 0.01 0.5 0.01 0.5 0.01 0.012 0.006 0.012 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]]}}, - }, + red = { + sparks = { properties = { colormap = [[1 0.4 0.1 0.01 0.7 0.15 0.05 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[1 0.3 0.1 0.01 0.05 0.01 0.005 0.01 0.012 0.008 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]] } }, + }, + green = { + sparks = { properties = { colormap = [[0.7 1 0.3 0.01 0.45 0.7 0.15 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[0.3 1 0.1 0.01 0.02 0.05 0.005 0.01 0.006 0.012 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]] } }, + }, + aqua = { + sparks = { properties = { colormap = [[0.3 1 0.7 0.01 0.15 0.7 0.45 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[0.2 1 0.8 0.01 0.02 0.05 0.06 0.01 0.006 0.012 0.0014 0.01 0.04 0.04 0.05 0.01 0.04 0.038 0.040 0.01 0 0 0 0 ]] } }, + }, + yellow = { + sparks = { properties = { colormap = [[1 1 0.3 0.01 0.7 0.45 0.15 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[1 1 0.1 0.01 0.05 0.05 0.005 0.01 0.012 0.012 0.005 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]] } }, + }, + blue = { + sparks = { properties = { colormap = [[0.7 0.7 1 0.01 0.45 0.45 0.7 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[0.3 0.3 1 0.01 0.01 0.01 0.5 0.01 0.006 0.006 0.012 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]] } }, + }, + purple = { + sparks = { properties = { colormap = [[1 0.7 0.9 0.01 0.7 0.4 0.65 0.01 0 0 0 0 ]] } }, + hit = { properties = { colormap = [[1 0.3 1 0.01 0.5 0.01 0.5 0.01 0.012 0.006 0.012 0.01 0.04 0.04 0.005 0.01 0.04 0.038 0.035 0.01 0 0 0 0 ]] } }, + }, } local sizes = { - "laserhit-mini", - "laserhit-tiny", - "laserhit-small", - "laserhit-medium", - "laserhit-large", + "laserhit-mini", + "laserhit-tiny", + "laserhit-small", + "laserhit-medium", + "laserhit-large", } for color, effects in pairs(colors) do - for k, size in pairs(sizes) do - definitions[size.."-"..color] = table.merge(definitions[size], effects) - end + for k, size in pairs(sizes) do + definitions[size .. "-" .. color] = table.merge(definitions[size], effects) + end end - definitions["laserhit-beamer"] = { - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - unit = false, - nounit = false, - water = false, - underwater = false, - properties = { - colormap = [[1 0.15 0.05 0.4 0 0 0 0.01]], - size = 3, - sizegrowth = 0, - ttl = 25, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 13, - particlesize = 2.1, - particlesizespread = 2.1, - particlespeed = 2, - particlespeedspread = 4, - pos = [[0, 1, 0]], - sizegrowth = 0.25, - sizemod = 0.7, - texture = [[wake]], - }, - }, - waterring = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 45, - sidetexture = [[none]], - size = [[2.9 r3.2]], - sizegrowth = [[2.9 r1.5]], - ttl = 15, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.7 1 0.01 0.45 0.45 0.7 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 5, - particlesize = 35, - particlesizespread = 50, - particlespeed = 1.5, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 3.3, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[0.3 0.3 1 0.05 0.01 0.01 0.35 0.04 0.006 0.006 0.012 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 16, - particlelifespread = 12, - particlesize = 3, - particlesizespread = 1.4, - particlespeed = 1.5, - particlespeedspread = 0.5, - pos = [[0, 1, 0]], - sizegrowth = 3.5, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - --sparkshit = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- water = false, - -- underwater = false, - -- unit = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], - -- directional = true, - -- emitrot = 66, - -- emitrotspread = 25, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.4, 0]], - -- numparticles = 1, - -- particlelife = 6, - -- particlelifespread = 3, - -- particlesize = 35, - -- particlesizespread = 45, - -- particlespeed = 4, - -- particlespeedspread = 3, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.6, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - --}, + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + unit = false, + nounit = false, + water = false, + underwater = false, + properties = { + colormap = [[1 0.15 0.05 0.4 0 0 0 0.01]], + size = 3, + sizegrowth = 0, + ttl = 25, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.7 0.7 0.8 0.35 0.3 0.3 0.4 0.13 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 13, + particlesize = 2.1, + particlesizespread = 2.1, + particlespeed = 2, + particlespeedspread = 4, + pos = [[0, 1, 0]], + sizegrowth = 0.25, + sizemod = 0.7, + texture = [[wake]], + }, + }, + waterring = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 45, + sidetexture = [[none]], + size = [[2.9 r3.2]], + sizegrowth = [[2.9 r1.5]], + ttl = 15, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.7 1 0.01 0.45 0.45 0.7 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 5, + particlesize = 35, + particlesizespread = 50, + particlespeed = 1.5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 3.3, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[0.3 0.3 1 0.05 0.01 0.01 0.35 0.04 0.006 0.006 0.012 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 16, + particlelifespread = 12, + particlesize = 3, + particlesizespread = 1.4, + particlespeed = 1.5, + particlespeedspread = 0.5, + pos = [[0, 1, 0]], + sizegrowth = 3.5, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + --sparkshit = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- water = false, + -- underwater = false, + -- unit = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[1 0.66 0.1 0.05 0.6 0.1 0.05 0.025 0 0 0 0 ]], + -- directional = true, + -- emitrot = 66, + -- emitrotspread = 25, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.4, 0]], + -- numparticles = 1, + -- particlelife = 6, + -- particlelifespread = 3, + -- particlesize = 35, + -- particlesizespread = 45, + -- particlespeed = 4, + -- particlespeedspread = 3, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.6, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + --}, } return definitions diff --git a/effects/lava.lua b/effects/lava.lua index 2bf0de78654..379016dca9e 100644 --- a/effects/lava.lua +++ b/effects/lava.lua @@ -1,347 +1,346 @@ -- lava-splash return { - ["lavasplash"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.65 0.48 0.1 .3 0.45 .22 0.08 .18 0.2 .08 0.04 .1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[dirt]], - length = [[45 r30]], - sidetexture = [[none]], - size = [[18 r26]], - sizegrowth = 1.7, - ttl = [[55 r20]], - pos = [[0.5, 5, 0.0]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - alwaysvisible = true, - }, - }, - circlewaves = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 0.5 0.3 0.1 .1 0.4 .22 0.08 .05 0.2 .08 0.04 .02 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 40, - particlesize = [[5 r10]], - particlesizespread = 0, - particlespeed = [[3 i-0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10, 4, 0 r-10 r10]], - rotParams = [[-5 r10, -5 r10, -210 r60]], - sizegrowth = [[0.84]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - alwaysvisible = true, - }, - }, - waterrush = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 0.7 0.5 0.1 .2 0.6 .33 0.12 .1 0.25 .12 0.05 .05 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.04, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 42, - particlesize = [[12 r38]], - particlesizespread = 30, - particlespeed = [[1.4 r0.8]], - particlespeedspread = 1, - pos = [[0, 120 r25, 0]], - rotParams = [[-4 r8, -4 r8, -180 r360]], - sizegrowth = [[0.87]], - sizemod = 1, - texture = [[flashside3]], - --useairlos = true, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.8 0.8 0.2 1 1 0.4 0.1 1 0 0 0 0.01]], - directional = false, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = 3, - particlelife = 40, - particlelifespread = 50, - particlesize = 12, - particlesizespread = 28, - particlespeed = 2, - particlespeedspread = 12, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - sizegrowth = -0.35, - sizemod = 0.99, - texture = [[lavasplats]], - alwaysvisible = true, - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.95 0.77 0.28 0.94 0.95 0.68 0.27 0.71 0.8 0.5 0.2 0.63 0.5 0.2 0.08 0.24 0.025 0.025 0.025 0.09 0 0 0 0.01]], - dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.065, - fronttexture = [[none]], - length = [[64 r80]], - sidetexture = [[megaparticle2]], - size = [[22 r34]], - sizegrowth = 2.4, - ttl = [[40 r20]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-2 r4, -20, -2 r4]], - drawOrder = 0, - alwaysvisible = true, - }, - }, - waterexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[1 0.89 0.3 1 0.95 0.89 0.2 1 1 0.4 0.1 0.8 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 2, - particlelife = 35, - particlelifespread = 50, - particlesize = 11, - particlesizespread = 34, - particlespeed = [[6 r4]], - particlespeedspread = 7, - pos = [[0, 18, 0]], - rotParams = [[-5 r10, -3 r6, -210 r60]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[lavachunk]], - alwaysvisible = true, - }, - }, - }, + ["lavasplash"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.65 0.48 0.1 .3 0.45 .22 0.08 .18 0.2 .08 0.04 .1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[dirt]], + length = [[45 r30]], + sidetexture = [[none]], + size = [[18 r26]], + sizegrowth = 1.7, + ttl = [[55 r20]], + pos = [[0.5, 5, 0.0]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + alwaysvisible = true, + }, + }, + circlewaves = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 0.5 0.3 0.1 .1 0.4 .22 0.08 .05 0.2 .08 0.04 .02 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 40, + particlesize = [[5 r10]], + particlesizespread = 0, + particlespeed = [[3 i-0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10, 4, 0 r-10 r10]], + rotParams = [[-5 r10, -5 r10, -210 r60]], + sizegrowth = [[0.84]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + alwaysvisible = true, + }, + }, + waterrush = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0 0.7 0.5 0.1 .2 0.6 .33 0.12 .1 0.25 .12 0.05 .05 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.04, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 42, + particlesize = [[12 r38]], + particlesizespread = 30, + particlespeed = [[1.4 r0.8]], + particlespeedspread = 1, + pos = [[0, 120 r25, 0]], + rotParams = [[-4 r8, -4 r8, -180 r360]], + sizegrowth = [[0.87]], + sizemod = 1, + texture = [[flashside3]], + --useairlos = true, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.8 0.8 0.2 1 1 0.4 0.1 1 0 0 0 0.01]], + directional = false, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = 3, + particlelife = 40, + particlelifespread = 50, + particlesize = 12, + particlesizespread = 28, + particlespeed = 2, + particlespeedspread = 12, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + sizegrowth = -0.35, + sizemod = 0.99, + texture = [[lavasplats]], + alwaysvisible = true, + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.95 0.77 0.28 0.94 0.95 0.68 0.27 0.71 0.8 0.5 0.2 0.63 0.5 0.2 0.08 0.24 0.025 0.025 0.025 0.09 0 0 0 0.01]], + dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.065, + fronttexture = [[none]], + length = [[64 r80]], + sidetexture = [[megaparticle2]], + size = [[22 r34]], + sizegrowth = 2.4, + ttl = [[40 r20]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-2 r4, -20, -2 r4]], + drawOrder = 0, + alwaysvisible = true, + }, + }, + waterexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.89 0.3 1 0.95 0.89 0.2 1 1 0.4 0.1 0.8 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 2, + particlelife = 35, + particlelifespread = 50, + particlesize = 11, + particlesizespread = 34, + particlespeed = [[6 r4]], + particlespeedspread = 7, + pos = [[0, 18, 0]], + rotParams = [[-5 r10, -3 r6, -210 r60]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[lavachunk]], + alwaysvisible = true, + }, + }, + }, - ["lavadamage"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0 0.65 0.48 0.1 .3 0.45 .22 0.08 .18 0.2 .08 0.04 .1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.07, - fronttexture = [[dirt]], - length = [[45 r30]], - sidetexture = [[none]], - size = [[11 r18]], - sizegrowth = 1.5, - ttl = [[25 r15]], - pos = [[0.5, 5, 0.0]], - rotParams = [[-5 r10, 5 r10, -180 r360]], - alwaysvisible = true, - }, - }, - waterrush = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 0.7 0.5 0.1 .2 0.6 .33 0.12 .1 0.25 .12 0.05 .05 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.04, 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 15, - particlesize = [[2 r15]], - particlesizespread = 15, - particlespeed = [[1.2 r0.7]], - particlespeedspread = 1, - pos = [[0, 120 r25, 0]], - rotParams = [[-4 r8, 10 r22, -180 r360]], - sizegrowth = [[0.87]], - sizemod = 1, - texture = [[flashside3]], - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[1 0.88 0.77 0.015 0.8 0.4 0.1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 8, - emitrotspread = 24, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 9, - particlesize = 10, - particlesizespread = 18, - particlespeed = 10, - particlespeedspread = 4, - pos = [[-4 r8, 4, -4 r8]], - rotParams = [[-5 r10, -5 r10, -180]], - sizegrowth = -0.03, - sizemod = 0.9, - texture = [[gunshotxl2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - lavasplats = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.8 0.8 0.2 1 1 0.4 0.1 1 0 0 0 0.01]], - directional = false, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 15, - particlesize = 9, - particlesizespread = 24, - particlespeed = 3, - particlespeedspread = 6, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - rotParams = [[-5 r10, -5 r10, -180 r360]], - sizegrowth = -0.35, - sizemod = 0.99, - texture = [[lavasplats]], - alwaysvisible = true, - }, - }, - -- bigsmoketrails = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.95 0.77 0.28 0.94 0.95 0.68 0.27 0.71 0.8 0.5 0.2 0.63 0.5 0.2 0.08 0.24 0.025 0.025 0.025 0.09 0 0 0 0.01]], - -- dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0.065, - -- fronttexture = [[none]], - -- length = [[32 r40]], - -- sidetexture = [[megaparticle2]], - -- size = [[11 r17]], - -- sizegrowth = 2.2, - -- ttl = [[20 r10]], - -- rotParams = [[-24 r48, -10 r20, 0 r90]], - -- pos = [[-2 r4, -20, -2 r4]], - -- drawOrder = 0, - -- alwaysvisible = true, - -- }, - -- }, - waterexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0.5 0.3 0.1 .012 0.4 .22 0.08 .006 0.2 .08 0.04 .005 0 0 0 0.01]], - directional = true, - emitrot = 16, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 16, - particlesize = 8.5, - particlesizespread = 24, - particlespeed = [[1.5 r2]], - particlespeedspread = 4, - pos = [[0, 18, 0]], - rotParams = [[-5 r10, -3 r6, -210 r60]], - sizegrowth = -0.24, - sizemod = 1.0, - texture = [[lavachunk]], - alwaysvisible = true, - }, - }, - }, - -} \ No newline at end of file + ["lavadamage"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0 0.65 0.48 0.1 .3 0.45 .22 0.08 .18 0.2 .08 0.04 .1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.07, + fronttexture = [[dirt]], + length = [[45 r30]], + sidetexture = [[none]], + size = [[11 r18]], + sizegrowth = 1.5, + ttl = [[25 r15]], + pos = [[0.5, 5, 0.0]], + rotParams = [[-5 r10, 5 r10, -180 r360]], + alwaysvisible = true, + }, + }, + waterrush = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0 0.7 0.5 0.1 .2 0.6 .33 0.12 .1 0.25 .12 0.05 .05 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.04, 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 15, + particlesize = [[2 r15]], + particlesizespread = 15, + particlespeed = [[1.2 r0.7]], + particlespeedspread = 1, + pos = [[0, 120 r25, 0]], + rotParams = [[-4 r8, 10 r22, -180 r360]], + sizegrowth = [[0.87]], + sizemod = 1, + texture = [[flashside3]], + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[1 0.88 0.77 0.015 0.8 0.4 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 8, + emitrotspread = 24, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 9, + particlesize = 10, + particlesizespread = 18, + particlespeed = 10, + particlespeedspread = 4, + pos = [[-4 r8, 4, -4 r8]], + rotParams = [[-5 r10, -5 r10, -180]], + sizegrowth = -0.03, + sizemod = 0.9, + texture = [[gunshotxl2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, + lavasplats = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.8 0.8 0.2 1 1 0.4 0.1 1 0 0 0 0.01]], + directional = false, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 15, + particlesize = 9, + particlesizespread = 24, + particlespeed = 3, + particlespeedspread = 6, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + rotParams = [[-5 r10, -5 r10, -180 r360]], + sizegrowth = -0.35, + sizemod = 0.99, + texture = [[lavasplats]], + alwaysvisible = true, + }, + }, + -- bigsmoketrails = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.95 0.77 0.28 0.94 0.95 0.68 0.27 0.71 0.8 0.5 0.2 0.63 0.5 0.2 0.08 0.24 0.025 0.025 0.025 0.09 0 0 0 0.01]], + -- dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0.065, + -- fronttexture = [[none]], + -- length = [[32 r40]], + -- sidetexture = [[megaparticle2]], + -- size = [[11 r17]], + -- sizegrowth = 2.2, + -- ttl = [[20 r10]], + -- rotParams = [[-24 r48, -10 r20, 0 r90]], + -- pos = [[-2 r4, -20, -2 r4]], + -- drawOrder = 0, + -- alwaysvisible = true, + -- }, + -- }, + waterexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0.5 0.3 0.1 .012 0.4 .22 0.08 .006 0.2 .08 0.04 .005 0 0 0 0.01]], + directional = true, + emitrot = 16, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 16, + particlesize = 8.5, + particlesizespread = 24, + particlespeed = [[1.5 r2]], + particlespeedspread = 4, + pos = [[0, 18, 0]], + rotParams = [[-5 r10, -3 r6, -210 r60]], + sizegrowth = -0.24, + sizemod = 1.0, + texture = [[lavachunk]], + alwaysvisible = true, + }, + }, + }, +} diff --git a/effects/lavasplash.lua b/effects/lavasplash.lua index 6208bcd9a54..949ea12091b 100644 --- a/effects/lavasplash.lua +++ b/effects/lavasplash.lua @@ -4,36 +4,40 @@ -- Lava color palettes (derived from effects/lava.lua) local C = { - pool = [[0 0 0 0 0.65 0.48 0.1 .25 0.45 .22 0.08 .15 0.2 .08 0.04 .08 0 0 0 0.01]], - waves = [[0 0 0 0 0.5 0.3 0.1 .01 0.4 .22 0.08 .006 0.2 .08 0.04 .003 0 0 0 0.01]], - rush = [[0 0 0 0 0.7 0.5 0.1 .01 0.6 .33 0.12 .005 0.25 .12 0.05 .004 0 0 0 0.01]], + pool = [[0 0 0 0 0.65 0.48 0.1 .25 0.45 .22 0.08 .15 0.2 .08 0.04 .08 0 0 0 0.01]], + waves = [[0 0 0 0 0.5 0.3 0.1 .01 0.4 .22 0.08 .006 0.2 .08 0.04 .003 0 0 0 0.01]], + rush = [[0 0 0 0 0.7 0.5 0.1 .01 0.6 .33 0.12 .005 0.25 .12 0.05 .004 0 0 0 0.01]], embers = [[0.8 0.8 0.2 0.015 1 0.4 0.1 0.01 0 0 0 0.005]], chunks = [[1 0.89 0.3 0.8 0.95 0.5 0.2 0.6 1 0.4 0.1 0.3 0 0 0 0.01]], - smoke = [[0.95 0.77 0.28 0.7 0.8 0.5 0.2 0.45 0.5 0.2 0.08 0.18 0.025 0.025 0.025 0.07 0 0 0 0.01]], - flare = [[0.95 0.77 0.28 0.8 0.8 0.45 0.15 0.5 0 0 0 0]], - glow = [[0 0 0 0 0.65 0.48 0.1 0.6 0.35 0.15 0.06 0.2 0 0 0 0]], + smoke = [[0.95 0.77 0.28 0.7 0.8 0.5 0.2 0.45 0.5 0.2 0.08 0.18 0.025 0.025 0.025 0.07 0 0 0 0.01]], + flare = [[0.95 0.77 0.28 0.8 0.8 0.45 0.15 0.5 0 0 0 0]], + glow = [[0 0 0 0 0.65 0.48 0.1 0.6 0.35 0.15 0.06 0.2 0 0 0 0]], gflash = [[0.8 0.5 0.1 0.6 0.5 0.25 0.08 0.4 0.2 0.08 0.04 0.15 0 0 0 0.01]], - shock = [[0.65 0.48 0.1 0.013 0.45 .22 0.08 0.01 0.2 .08 0.04 0.006 0 0 0 0.01]], - ball = [[0 0 0 0 0.7 0.5 0.1 .08 0.5 .3 0.1 .04 0 0 0 0.01]], + shock = [[0.65 0.48 0.1 0.013 0.45 .22 0.08 0.01 0.2 .08 0.04 0.006 0 0 0 0.01]], + ball = [[0 0 0 0 0.7 0.5 0.1 .08 0.5 .3 0.1 .04 0 0 0 0.01]], } -- Component builder: expanding lava pool on surface (replaces waterring) local function lavapool(size, ttl, rotParams) return { - air = true, class = [[CBitmapMuzzleFlame]], count = 1, - ground = true, underwater = 1, water = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, properties = { - colormap = C.pool, - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[dirt]], - length = 35, - sidetexture = [[none]], - size = size, - sizegrowth = 1.5, - ttl = ttl, - rotParams = rotParams, - pos = [[0.5, 3, 0.0]], + colormap = C.pool, + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[dirt]], + length = 35, + sidetexture = [[none]], + size = size, + sizegrowth = 1.5, + ttl = ttl, + rotParams = rotParams, + pos = [[0.5, 3, 0.0]], alwaysvisible = true, }, } @@ -42,28 +46,32 @@ end -- Component builder: circular ripple waves on lava surface (replaces circlewaves) local function lavawaves(numparticles, particlesize, speed, lifespread) return { - air = true, class = [[CSimpleParticleSystem]], count = 1, - ground = true, underwater = 1, water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, properties = { - airdrag = 0.93, - colormap = C.waves, - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = numparticles, - particlelife = 4, + airdrag = 0.93, + colormap = C.waves, + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = numparticles, + particlelife = 4, particlelifespread = lifespread, - particlesize = particlesize, + particlesize = particlesize, particlesizespread = 0, - particlespeed = speed, + particlespeed = speed, particlespeedspread = 0, - pos = [[0 r-8 r8, 4, 0 r-8 r8]], - sizegrowth = [[0.6]], - sizemod = 1.0, - texture = [[wave]], - alwaysvisible = true, + pos = [[0 r-8 r8, 4, 0 r-8 r8]], + sizegrowth = [[0.6]], + sizemod = 1.0, + texture = [[wave]], + alwaysvisible = true, }, } end @@ -71,28 +79,32 @@ end -- Component builder: rising lava smoke column (replaces waterrush) local function lavarush(count, numparticles, particlesize, sizespread, speed, speedspread, life, lifespread, pos, emitvector) return { - air = true, class = [[CSimpleParticleSystem]], count = count, - ground = true, underwater = 1, water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = count, + ground = true, + underwater = 1, + water = true, properties = { - airdrag = 0.97, - colormap = C.rush, - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = emitvector or [[0, 1, 0]], - gravity = [[0, -0.04, 0]], - numparticles = numparticles, - particlelife = life, + airdrag = 0.97, + colormap = C.rush, + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = emitvector or [[0, 1, 0]], + gravity = [[0, -0.04, 0]], + numparticles = numparticles, + particlelife = life, particlelifespread = lifespread, - particlesize = particlesize, + particlesize = particlesize, particlesizespread = sizespread, - particlespeed = speed, + particlespeed = speed, particlespeedspread = speedspread or 0, - pos = pos or [[0, 80 r20, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[flashside3]], - alwaysvisible = true, + pos = pos or [[0, 80 r20, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[flashside3]], + alwaysvisible = true, }, } end @@ -100,28 +112,32 @@ end -- Component builder: glowing lava ember particles (replaces sparks) local function lavaembers(numparticles, particlesize, sizespread, speed, speedspread, life, lifespread) return { - air = true, class = [[CSimpleParticleSystem]], count = 1, - ground = true, water = true, underwater = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, properties = { - airdrag = 0.93, - colormap = C.embers, - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.09, 0]], - numparticles = numparticles, - particlelife = life, + airdrag = 0.93, + colormap = C.embers, + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.09, 0]], + numparticles = numparticles, + particlelife = life, particlelifespread = lifespread, - particlesize = particlesize, + particlesize = particlesize, particlesizespread = sizespread, - particlespeed = speed, + particlespeed = speed, particlespeedspread = speedspread, - pos = [[0 r-8 r8, -24, 0 r-8 r8]], - sizegrowth = -0.35, - sizemod = 0.99, - texture = [[lavasplats]], - alwaysvisible = true, + pos = [[0 r-8 r8, -24, 0 r-8 r8]], + sizegrowth = -0.35, + sizemod = 0.99, + texture = [[lavasplats]], + alwaysvisible = true, }, } end @@ -129,29 +145,33 @@ end -- Component builder: thrown lava chunks (replaces waterexplosion) local function lavachunks(numparticles, particlesize, sizespread, speed, speedspread, life, lifespread, rotParams) return { - air = true, class = [[CSimpleParticleSystem]], count = 1, - ground = true, underwater = 1, water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, properties = { - airdrag = 0.95, - colormap = C.chunks, - directional = true, - emitrot = 16, - emitrotspread = [[15 r-15 r15]], - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = numparticles, - particlelife = life, + airdrag = 0.95, + colormap = C.chunks, + directional = true, + emitrot = 16, + emitrotspread = [[15 r-15 r15]], + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = numparticles, + particlelife = life, particlelifespread = lifespread, - particlesize = particlesize, + particlesize = particlesize, particlesizespread = sizespread, - particlespeed = speed, + particlespeed = speed, particlespeedspread = speedspread, - pos = [[0, 12, 0]], - rotParams = rotParams, - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[lavachunk]], - alwaysvisible = true, + pos = [[0, 12, 0]], + rotParams = rotParams, + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[lavachunk]], + alwaysvisible = true, }, } end @@ -159,21 +179,25 @@ end -- Component builder: thick lava smoke trails (for large impacts) local function lavasmoke(count, size, sizegrowth, length, ttl, rotParams, pos) return { - air = true, class = [[CBitmapMuzzleFlame]], count = count, - ground = true, underwater = 1, water = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = count, + ground = true, + underwater = 1, + water = true, properties = { - colormap = C.smoke, - dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], - frontoffset = 0.065, - fronttexture = [[none]], - length = length, - sidetexture = [[megaparticle2]], - size = size, - sizegrowth = sizegrowth, - ttl = ttl, - rotParams = rotParams, - pos = pos or [[-2 r4, -15, -2 r4]], - drawOrder = 0, + colormap = C.smoke, + dir = [[-0.2 r0.4, 0.8 r0.2, -0.2 r0.4]], + frontoffset = 0.065, + fronttexture = [[none]], + length = length, + sidetexture = [[megaparticle2]], + size = size, + sizegrowth = sizegrowth, + ttl = ttl, + rotParams = rotParams, + pos = pos or [[-2 r4, -15, -2 r4]], + drawOrder = 0, alwaysvisible = true, }, } @@ -182,20 +206,24 @@ end -- Component builder: expanding lava glow pool (replaces brightwakefoam) local function lavaglow(size, ttl, rotParams) return { - air = true, class = [[CBitmapMuzzleFlame]], count = 1, - ground = true, underwater = true, water = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, properties = { - colormap = C.glow, - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[dirt]], - length = 35, - sidetexture = [[none]], - size = size, - sizegrowth = [[0.12 r0.5]], - ttl = ttl, - rotParams = rotParams, - pos = [[0, 5, 0]], + colormap = C.glow, + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[dirt]], + length = 35, + sidetexture = [[none]], + size = size, + sizegrowth = [[0.12 r0.5]], + ttl = ttl, + rotParams = rotParams, + pos = [[0, 5, 0]], alwaysvisible = true, }, } @@ -204,19 +232,23 @@ end -- Component builder: bright lava flash (replaces brightflare) local function lavaflare(size, ttl) return { - air = true, class = [[CBitmapMuzzleFlame]], count = 1, - ground = true, underwater = true, water = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, properties = { - colormap = C.flare, - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 35, - sidetexture = [[none]], - size = size, - sizegrowth = [[0.1 r0.2]], - ttl = ttl, - pos = [[0, 50, 0]], + colormap = C.flare, + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 35, + sidetexture = [[none]], + size = size, + sizegrowth = [[0.1 r0.2]], + ttl = ttl, + pos = [[0, 50, 0]], alwaysvisible = true, }, } @@ -225,19 +257,23 @@ end -- Component builder: lava shockwave ring local function lavashockwave(size, sizegrowth, ttl) return { - air = true, class = [[CBitmapMuzzleFlame]], count = 1, - ground = true, underwater = true, water = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, properties = { - colormap = C.shock, - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 35, - sidetexture = [[none]], - size = size, - sizegrowth = sizegrowth, - ttl = ttl, - pos = [[0, 0, 0]], + colormap = C.shock, + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 35, + sidetexture = [[none]], + size = size, + sizegrowth = sizegrowth, + ttl = ttl, + pos = [[0, 0, 0]], alwaysvisible = true, }, } @@ -246,161 +282,154 @@ end -- Component builder: ground flash from lava impact local function lavagroundflash(size, sizegrowth, ttl) return { - class = [[CSimpleGroundFlash]], count = 1, - air = false, ground = true, water = true, underwater = true, + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, properties = { - colormap = C.gflash, - size = size, - sizegrowth = sizegrowth, - ttl = ttl, - texture = [[groundflashwhite]], + colormap = C.gflash, + size = size, + sizegrowth = sizegrowth, + ttl = ttl, + texture = [[groundflashwhite]], alwaysvisible = true, }, } end - -- Assemble lava splash definitions from components -- Sizes are ~65-70% of water counterparts local definitions = {} definitions["lavasplash-torpedo"] = { - lavapool = lavapool(4, 40), + lavapool = lavapool(4, 40), circlewaves = lavawaves(1, [[0.4 r0.5]], [[0.8 i0.2]], 18), - embers = lavaembers(2, 3, 8, 0.5, 5, 5, 10), - lavachunks = lavachunks(4, 0.8, 8, [[1.2 i0.2]], 1.5, 8, 8), + embers = lavaembers(2, 3, 8, 0.5, 5, 5, 10), + lavachunks = lavachunks(4, 0.8, 8, [[1.2 i0.2]], 1.5, 8, 8), } definitions["lavasplash-tiny"] = { - lavapool = lavapool(7, 45, [[-2 r4, -0.5 r1, -180 r360]]), + lavapool = lavapool(7, 45, [[-2 r4, -0.5 r1, -180 r360]]), circlewaves = lavawaves(1, [[0.5 r0.7]], [[1.0 i0.2]], 20), - embers = lavaembers(3, 3, 8, 0.6, 6, 6, 12), - lavachunks = lavachunks(5, 1, 8, [[1.3 i0.2]], 1.5, 9, 9), + embers = lavaembers(3, 3, 8, 0.6, 6, 6, 12), + lavachunks = lavachunks(5, 1, 8, [[1.3 i0.2]], 1.5, 9, 9), } definitions["lavasplash-small"] = { - lavapool = lavapool(8, 45, [[-6 r12, -1.5 r3, -180 r360]]), + lavapool = lavapool(8, 45, [[-6 r12, -1.5 r3, -180 r360]]), circlewaves = lavawaves(2, [[0.7 r1.4]], [[0.8 i0.2]], 20), - embers = lavaembers(5, 4, 12, 0.7, 6, 8, 15), - lavachunks = lavachunks(7, 1.4, 11, [[1.4 i0.2]], 1.5, 11, 11), + embers = lavaembers(5, 4, 12, 0.7, 6, 8, 15), + lavachunks = lavachunks(7, 1.4, 11, [[1.4 i0.2]], 1.5, 11, 11), } definitions["lavasplash-medium"] = { - lavapool = lavapool(11, 55, [[-2 r4, -0.5 r1, -180 r360]]), + lavapool = lavapool(11, 55, [[-2 r4, -0.5 r1, -180 r360]]), circlewaves = lavawaves(3, [[0.7 r2]], [[1.4 i0.2]], 24), - lavarush = lavarush(1, 1, [[3 r10]], 12, [[3.5 i0.5]], 0, 11, 28), - embers = lavaembers(7, 5, 15, 1.2, 8, 13, 21), - lavachunks = lavachunks(7, 2, 14, [[1.8 i0.2]], 1.5, 11, 11), + lavarush = lavarush(1, 1, [[3 r10]], 12, [[3.5 i0.5]], 0, 11, 28), + embers = lavaembers(7, 5, 15, 1.2, 8, 13, 21), + lavachunks = lavachunks(7, 2, 14, [[1.8 i0.2]], 1.5, 11, 11), } definitions["lavasplash-large"] = { - lavapool = lavapool(15, 65, [[-7 r14, -1.5 r3, -180 r360]]), + lavapool = lavapool(15, 65, [[-7 r14, -1.5 r3, -180 r360]]), circlewaves = lavawaves(3, [[1.3 r2.8]], [[2.1 i0.2]], 25), - lavarush = lavarush(1, 1, [[8 r17]], 21, [[3.5 i0.5]], 0, 28, 50), - embers = lavaembers(12, 5.5, 17, 1.3, 8, 16, 23), - lavachunks = lavachunks(8, 2.5, 16, [[2 i0.2]], 1.5, 13, 13, - [[-70 r140, -0.4 r0.8, -180 r360]]), + lavarush = lavarush(1, 1, [[8 r17]], 21, [[3.5 i0.5]], 0, 28, 50), + embers = lavaembers(12, 5.5, 17, 1.3, 8, 16, 23), + lavachunks = lavachunks(8, 2.5, 16, [[2 i0.2]], 1.5, 13, 13, [[-70 r140, -0.4 r0.8, -180 r360]]), } definitions["lavasplash-huge"] = { - lavapool = lavapool(22, 85, [[-7 r14, -1.5 r3, -180 r360]]), - lavaglow = lavaglow([[32 r20]], [[85 r30]], [[-4 r8, -0.4 r0.8, -180 r360]]), + lavapool = lavapool(22, 85, [[-7 r14, -1.5 r3, -180 r360]]), + lavaglow = lavaglow([[32 r20]], [[85 r30]], [[-4 r8, -0.4 r0.8, -180 r360]]), circlewaves = lavawaves(4, [[1.4 r3.5]], [[2.1 i0.2]], 28), - lavarush = lavarush(2, 1, [[10 r20]], 21, [[4.8 i1.2]], 0, 32, 53, - nil, [[r0.08, 1, r0.08]]), - embers = lavaembers(16, 6, 19, 1.3, 8, 18, 25), - lavachunks = lavachunks(8, 2.7, 17, [[2.8 i0.2]], 1.5, 17, 15, - [[-70 r140, -0.4 r0.8, -180 r360]]), + lavarush = lavarush(2, 1, [[10 r20]], 21, [[4.8 i1.2]], 0, 32, 53, nil, [[r0.08, 1, r0.08]]), + embers = lavaembers(16, 6, 19, 1.3, 8, 18, 25), + lavachunks = lavachunks(8, 2.7, 17, [[2.8 i0.2]], 1.5, 17, 15, [[-70 r140, -0.4 r0.8, -180 r360]]), } definitions["lavasplash-gigantic"] = { - lavapool = lavapool(40, 85, [[-8 r16, -1.5 r3, -180 r360]]), - lavaglow = lavaglow([[70 r42]], [[85 r30]], [[-4 r8, -0.4 r0.8, -180 r360]]), + lavapool = lavapool(40, 85, [[-8 r16, -1.5 r3, -180 r360]]), + lavaglow = lavaglow([[70 r42]], [[85 r30]], [[-4 r8, -0.4 r0.8, -180 r360]]), circlewaves = lavawaves(7, [[4 r12]], [[1.3 i0.8]], 56), - lavarush = lavarush(2, 2, [[28 r48]], 68, [[10.5 i0.7]], 6, 35, 56, - [[-70 r140, 70 r35, -70 r140]], [[r0.1, 0.7, r0.1]]), - lavasmoke = lavasmoke(1, [[15 r23]], 1.7, [[44 r55]], [[28 r14]], - [[-17 r34, -7 r14, 0 r65]]), - embers = lavaembers(6, 20, 25, 5.6, 11, 45, 38), - lavachunks = lavachunks(8, 15, 38, [[4.2 i0.7]], 5, 35, 29, - [[-70 r140, -7 r14, -180 r360]]), - lavashockwave = lavashockwave(6, [[-18 r4]], 17), + lavarush = lavarush(2, 2, [[28 r48]], 68, [[10.5 i0.7]], 6, 35, 56, [[-70 r140, 70 r35, -70 r140]], [[r0.1, 0.7, r0.1]]), + lavasmoke = lavasmoke(1, [[15 r23]], 1.7, [[44 r55]], [[28 r14]], [[-17 r34, -7 r14, 0 r65]]), + embers = lavaembers(6, 20, 25, 5.6, 11, 45, 38), + lavachunks = lavachunks(8, 15, 38, [[4.2 i0.7]], 5, 35, 29, [[-70 r140, -7 r14, -180 r360]]), + lavashockwave = lavashockwave(6, [[-18 r4]], 17), lavagroundflash = lavagroundflash(140, 2, 85), } definitions["lavasplash-nuke"] = { - lavapool = lavapool(95, 115), - lavaflare = lavaflare(630, 12), - lavaglow = lavaglow([[200 r72]], [[78 r28]], [[-1.5 r3, -0.4 r0.8, -180 r360]]), + lavapool = lavapool(95, 115), + lavaflare = lavaflare(630, 12), + lavaglow = lavaglow([[200 r72]], [[78 r28]], [[-1.5 r3, -0.4 r0.8, -180 r360]]), circlewaves = lavawaves(14, [[6 r17]], [[2.2 i1.2]], 75), - lavarush = lavarush(3, 2, [[66 r84]], 84, [[13 i0.7]], 7, 70, 84, - [[-91 r182, 77 r42, -91 r182]], [[r0.1, 0.7, r0.1]]), - lavasmoke = lavasmoke(2, [[24 r38]], 1.9, [[62 r78]], [[38 r18]], - [[-35 r70, -7 r14, 0 r65]]), - embers = lavaembers(18, 24, 27, 9, 17, 56, 45), - lavachunks = lavachunks(14, 30, 63, [[5.6 i0.7]], 5.6, 63, 28, - [[-35 r70, -5 r10, -180 r360]]), - lavashockwave = lavashockwave(22, [[-13 r3.5]], 115), + lavarush = lavarush(3, 2, [[66 r84]], 84, [[13 i0.7]], 7, 70, 84, [[-91 r182, 77 r42, -91 r182]], [[r0.1, 0.7, r0.1]]), + lavasmoke = lavasmoke(2, [[24 r38]], 1.9, [[62 r78]], [[38 r18]], [[-35 r70, -7 r14, 0 r65]]), + embers = lavaembers(18, 24, 27, 9, 17, 56, 45), + lavachunks = lavachunks(14, 30, 63, [[5.6 i0.7]], 5.6, 63, 28, [[-35 r70, -5 r10, -180 r360]]), + lavashockwave = lavashockwave(22, [[-13 r3.5]], 115), lavagroundflash = lavagroundflash(195, 2, 100), } definitions["lavasplash-nukexl"] = { - lavapool = lavapool(130, 125), - lavaflare = lavaflare(770, 12), - lavaglow = lavaglow([[275 r82]], [[85 r28]], [[-1.5 r3, -0.4 r0.8, -180 r360]]), + lavapool = lavapool(130, 125), + lavaflare = lavaflare(770, 12), + lavaglow = lavaglow([[275 r82]], [[85 r28]], [[-1.5 r3, -0.4 r0.8, -180 r360]]), circlewaves = lavawaves(14, [[8 r19]], [[2.5 i1.3]], 78), - lavarush = lavarush(3, 2, [[84 r98]], 98, [[18 i0.7]], 10, 70, 98, - [[-91 r182, 77 r42, -91 r182]], [[r0.1, 0.7, r0.1]]), - lavasmoke = lavasmoke(3, [[28 r48]], 2.1, [[72 r96]], [[46 r23]], - [[-35 r70, -7 r14, 0 r65]]), - embers = lavaembers(18, 56, 56, 12, 18, 63, 45), - lavachunks = lavachunks(17, 42, 105, [[7.7 i1.4]], 7, 77, 31, - [[-35 r70, -5 r10, -180 r360]]), - lavashockwave = lavashockwave(14, [[-15 r4]], 15), + lavarush = lavarush(3, 2, [[84 r98]], 98, [[18 i0.7]], 10, 70, 98, [[-91 r182, 77 r42, -91 r182]], [[r0.1, 0.7, r0.1]]), + lavasmoke = lavasmoke(3, [[28 r48]], 2.1, [[72 r96]], [[46 r23]], [[-35 r70, -7 r14, 0 r65]]), + embers = lavaembers(18, 56, 56, 12, 18, 63, 45), + lavachunks = lavachunks(17, 42, 105, [[7.7 i1.4]], 7, 77, 31, [[-35 r70, -5 r10, -180 r360]]), + lavashockwave = lavashockwave(14, [[-15 r4]], 15), lavagroundflash = lavagroundflash(360, 3.5, 155), } - -- Lava versions of old watersplash effects (used by unit_water_depth_damage.lua) definitions["lavasplash_small"] = { lavaball = { - air = true, class = [[CSimpleParticleSystem]], count = 1, - ground = true, underwater = 1, water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, properties = { - airdrag = 1, - colormap = C.ball, - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 14, - particlelife = 2, + airdrag = 1, + colormap = C.ball, + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 14, + particlelife = 2, particlelifespread = 14, - particlesize = 0.4, + particlesize = 0.4, particlesizespread = 1.4, - particlespeed = [[0 r2 i-0.04]], + particlespeed = [[0 r2 i-0.04]], particlespeedspread = 1.5, - pos = [[0 r-7 r7, 2 r4, 0 r-7 r7]], - sizegrowth = [[0.12 r0.7 r-0.7]], - sizemod = 1.0, - texture = [[dirt]], - alwaysvisible = true, + pos = [[0 r-7 r7, 2 r4, 0 r-7 r7]], + sizegrowth = [[0.12 r0.7 r-0.7]], + sizemod = 1.0, + texture = [[dirt]], + alwaysvisible = true, }, }, - embers = lavaembers(4, 3.5, 3.5, 2, 1.4, 28, 8), - lavachunks = lavachunks(5, 1, 3, [[2 i0.2]], 1.5, 11, 8), + embers = lavaembers(4, 3.5, 3.5, 2, 1.4, 28, 8), + lavachunks = lavachunks(5, 1, 3, [[2 i0.2]], 1.5, 11, 8), } definitions["lavasplash_large"] = { - lavapool = lavapool(12, 55), + lavapool = lavapool(12, 55), circlewaves = lavawaves(3, [[1 r2.5]], [[1.8 i0.2]], 22), - lavarush = lavarush(1, 1, [[6 r14]], 16, [[3 i0.5]], 0, 22, 42), - embers = lavaembers(10, 5, 14, 1, 7, 14, 18), - lavachunks = lavachunks(7, 2, 14, [[2 i0.2]], 1.5, 13, 11), + lavarush = lavarush(1, 1, [[6 r14]], 16, [[3 i0.5]], 0, 22, 42), + embers = lavaembers(10, 5, 14, 1, 7, 14, 18), + lavachunks = lavachunks(7, 2, 14, [[2 i0.2]], 1.5, 13, 11), } - return definitions diff --git a/effects/light.lua b/effects/light.lua index 8633de8cf3a..dcd4f9dfcd5 100644 --- a/effects/light.lua +++ b/effects/light.lua @@ -129,8 +129,8 @@ return { }, }, }, - ["LootboxLightGold"] = { - light = { + ["LootboxLightGold"] = { + light = { useAirLos = false, usedefaultexplosions = false, class = [[CHeatCloudProjectile]], diff --git a/effects/lightning_stormbolt.lua b/effects/lightning_stormbolt.lua index cc1cbf767ca..740868f13ec 100644 --- a/effects/lightning_stormbolt.lua +++ b/effects/lightning_stormbolt.lua @@ -1,486 +1,485 @@ -- lightning_stormbolt return { - ["lightning_stormbolt"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.12, - flashsize = 40, - ttl = 3, - color = { - [1] = 0.66, - [2] = 0.66, - [3] = 1, - }, - }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 0, - particlesize = 1.8, - particlesizespread = 7.5, - particlespeed = 0.01, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[lightbw]], - }, - }, - }, - ["lightning_stormbolt_small"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.08, - flashsize = 25, - ttl = 2, - color = { - [1] = 0.66, - [2] = 0.66, - [3] = 1, - }, - }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 0, - particlesize = 1.5, - particlesizespread = 4.5, - particlespeed = 0.01, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[lightbw]], - }, - }, - }, - ["lightning_storm_emp"] = { - -- groundflash = { - -- circlealpha = 1, - -- circlegrowth = 0, - -- flashalpha = 0.17, - -- flashsize = 40, - -- ttl = 3, - -- color = { - -- [1] = 0.66, - -- [2] = 0.66, - -- [3] = 1, - -- }, - -- }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 4, - particlesize = 9, - particlesizespread = 50, - particlespeed = 0.03, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lightninginair]], - }, - }, - }, - ["lightning_storm_emp2"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 4, - particlesize = 9, - particlesizespread = 50, - particlespeed = 0.03, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lwhitelightb]], - }, - }, - }, - ["lightning_stormbig"] = { - -- groundflash = { - -- circlealpha = 1, - -- circlegrowth = 0, - -- flashalpha = 0.17, - -- flashsize = 80, - -- ttl = 15, - -- color = { - -- [1] = 0.66, - -- [2] = 0.66, - -- [3] = 0.66, - -- }, - -- }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.96 0.75 0.60 0.05 0.9 0.6 0.3 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 8, - particlesize = 9, - particlesizespread = 100, - particlespeed = 0.03, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - }, - ["lightning_stormbigalt"] = { - -- groundflash = { - -- circlealpha = 1, - -- circlegrowth = 0, - -- flashalpha = 0.17, - -- flashsize = 80, - -- ttl = 15, - -- color = { - -- [1] = 0.66, - -- [2] = 0.66, - -- [3] = 0.66, - -- }, - -- }, - lightningballsalt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0 0 0 0.01 0.96 0.75 0.60 0.05 0.9 0.6 0.3 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 6, - particlesize = 8, - particlesizespread = 75, - particlespeed = 0.06, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lightning]], - }, - }, - }, - ["lightning_storm_juno"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.17, - flashsize = 80, - ttl = 15, - color = { - [1] = 0.66, - [2] = 0.88, - [3] = 0.33, - }, - }, - lightningarcs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.92 0.5 0.08 0.5 0.71 0.4 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - --gravity = [[-0.5 r1, 0, -0.5 r1]], - numparticles = 1, - particlelife = 2, - particlelifespread = 8, - particlesize = 11, - particlesizespread = 120, - particlespeed = 0.02, - particlespeedspread = 0.01, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[lightninginair]], - }, - }, - lightningelectric = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.92 0.5 0.08 0.5 0.71 0.4 0.01 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - --gravity = [[-0.5 r1, 0, -0.5 r1]], - numparticles = [[0.6 r0.6]], - particlelife = 2, - particlelifespread = 8, - particlesize = 10, - particlesizespread = 190, - particlespeed = 0.01, - particlespeedspread = 0.02, - pos = [[-30 r30, 30.0, -30 r30]], - rotParams = [[-1 r2, 0, -180 r360]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - lightorbs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.72 0.92 0.4 0.015 0.6 0.71 0.35 0.01 0.4 0.65 0.3 0.005 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = [[0.35 r0.8]], - particlelife = 22, - particlelifespread = 25, - particlesize = 9, - particlesizespread = 150, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.3, - sizemod = 1.0, - texture = [[flare1]], - }, - }, - }, - ["lightning_storm_juno_scav"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.17, - flashsize = 80, - ttl = 15, - color = { - [1] = 0.66, - [2] = 0.33, - [3] = 0.88, - }, - }, - lightningarcs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.5 0.92 0.08 0.5 0.4 0.71 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 8, - particlesize = 11, - particlesizespread = 120, - particlespeed = 0.03, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lightninginair]], - }, - }, - lightningelectric = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.5 0.92 0.08 0.5 0.4 0.71 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = [[0.6 r0.6]], - particlelife = 2, - particlelifespread = 8, - particlesize = 30, - particlesizespread = 160, - particlespeed = 0.03, - particlespeedspread = 0, - pos = [[-30 r30, 30.0, -30 r30]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lightninginair]], - }, - }, - lightorbs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.72 0.4 0.92 0.015 0.6 0.35 0.71 0.01 0.4 0.3 0.65 0.005 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = [[0.6 r0.8]], - particlelife = 22, - particlelifespread = 25, - particlesize = 9, - particlesizespread = 150, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.3, - sizemod = 1.0, - texture = [[flare1]], - }, - }, - }, - ["lightning_stormflares"] = { - -- groundflash = { - -- circlealpha = 0.9, - -- circlegrowth = -0.05, - -- flashalpha = 0.20, - -- flashsize = 100, - -- ttl = 12, - -- color = { - -- [1] = 0.76, - -- [2] = 0.76, - -- [3] = 0.76, - -- }, - -- }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.83 0.64 0.50 0.15 0.82 0.55 0.27 0.08 0.6 0.4 0.15 0.05 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 14, - particlesize = 12, - particlesizespread = 50, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-20 r40, 1.0, -20 r40]], - sizegrowth = -0.6, - sizemod = 1.0, - texture = [[glow2]], - }, - }, - }, + ["lightning_stormbolt"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.12, + flashsize = 40, + ttl = 3, + color = { + [1] = 0.66, + [2] = 0.66, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1.8, + particlesizespread = 7.5, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, + ["lightning_stormbolt_small"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.08, + flashsize = 25, + ttl = 2, + color = { + [1] = 0.66, + [2] = 0.66, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1.5, + particlesizespread = 4.5, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, + ["lightning_storm_emp"] = { + -- groundflash = { + -- circlealpha = 1, + -- circlegrowth = 0, + -- flashalpha = 0.17, + -- flashsize = 40, + -- ttl = 3, + -- color = { + -- [1] = 0.66, + -- [2] = 0.66, + -- [3] = 1, + -- }, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 4, + particlesize = 9, + particlesizespread = 50, + particlespeed = 0.03, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lightninginair]], + }, + }, + }, + ["lightning_storm_emp2"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 4, + particlesize = 9, + particlesizespread = 50, + particlespeed = 0.03, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lwhitelightb]], + }, + }, + }, + ["lightning_stormbig"] = { + -- groundflash = { + -- circlealpha = 1, + -- circlegrowth = 0, + -- flashalpha = 0.17, + -- flashsize = 80, + -- ttl = 15, + -- color = { + -- [1] = 0.66, + -- [2] = 0.66, + -- [3] = 0.66, + -- }, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.96 0.75 0.60 0.05 0.9 0.6 0.3 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 8, + particlesize = 9, + particlesizespread = 100, + particlespeed = 0.03, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + }, + ["lightning_stormbigalt"] = { + -- groundflash = { + -- circlealpha = 1, + -- circlegrowth = 0, + -- flashalpha = 0.17, + -- flashsize = 80, + -- ttl = 15, + -- color = { + -- [1] = 0.66, + -- [2] = 0.66, + -- [3] = 0.66, + -- }, + -- }, + lightningballsalt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0 0 0 0.01 0.96 0.75 0.60 0.05 0.9 0.6 0.3 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 6, + particlesize = 8, + particlesizespread = 75, + particlespeed = 0.06, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lightning]], + }, + }, + }, + ["lightning_storm_juno"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.17, + flashsize = 80, + ttl = 15, + color = { + [1] = 0.66, + [2] = 0.88, + [3] = 0.33, + }, + }, + lightningarcs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.92 0.5 0.08 0.5 0.71 0.4 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + --gravity = [[-0.5 r1, 0, -0.5 r1]], + numparticles = 1, + particlelife = 2, + particlelifespread = 8, + particlesize = 11, + particlesizespread = 120, + particlespeed = 0.02, + particlespeedspread = 0.01, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[lightninginair]], + }, + }, + lightningelectric = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.92 0.5 0.08 0.5 0.71 0.4 0.01 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + --gravity = [[-0.5 r1, 0, -0.5 r1]], + numparticles = [[0.6 r0.6]], + particlelife = 2, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 190, + particlespeed = 0.01, + particlespeedspread = 0.02, + pos = [[-30 r30, 30.0, -30 r30]], + rotParams = [[-1 r2, 0, -180 r360]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + lightorbs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.72 0.92 0.4 0.015 0.6 0.71 0.35 0.01 0.4 0.65 0.3 0.005 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = [[0.35 r0.8]], + particlelife = 22, + particlelifespread = 25, + particlesize = 9, + particlesizespread = 150, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.3, + sizemod = 1.0, + texture = [[flare1]], + }, + }, + }, + ["lightning_storm_juno_scav"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.17, + flashsize = 80, + ttl = 15, + color = { + [1] = 0.66, + [2] = 0.33, + [3] = 0.88, + }, + }, + lightningarcs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.5 0.92 0.08 0.5 0.4 0.71 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 8, + particlesize = 11, + particlesizespread = 120, + particlespeed = 0.03, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lightninginair]], + }, + }, + lightningelectric = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.5 0.92 0.08 0.5 0.4 0.71 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = [[0.6 r0.6]], + particlelife = 2, + particlelifespread = 8, + particlesize = 30, + particlesizespread = 160, + particlespeed = 0.03, + particlespeedspread = 0, + pos = [[-30 r30, 30.0, -30 r30]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lightninginair]], + }, + }, + lightorbs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.72 0.4 0.92 0.015 0.6 0.35 0.71 0.01 0.4 0.3 0.65 0.005 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = [[0.6 r0.8]], + particlelife = 22, + particlelifespread = 25, + particlesize = 9, + particlesizespread = 150, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.3, + sizemod = 1.0, + texture = [[flare1]], + }, + }, + }, + ["lightning_stormflares"] = { + -- groundflash = { + -- circlealpha = 0.9, + -- circlegrowth = -0.05, + -- flashalpha = 0.20, + -- flashsize = 100, + -- ttl = 12, + -- color = { + -- [1] = 0.76, + -- [2] = 0.76, + -- [3] = 0.76, + -- }, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.83 0.64 0.50 0.15 0.82 0.55 0.27 0.08 0.6 0.4 0.15 0.05 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 14, + particlesize = 12, + particlesizespread = 50, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-20 r40, 1.0, -20 r40]], + sizegrowth = -0.6, + sizemod = 1.0, + texture = [[glow2]], + }, + }, + }, } - diff --git a/effects/lootboxes.lua b/effects/lootboxes.lua index 450a70e650b..8452e92561c 100644 --- a/effects/lootboxes.lua +++ b/effects/lootboxes.lua @@ -1,76 +1,76 @@ -- lootbox beacons return { - ["LootboxBeaconBronze"] = { - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], - size = 36, - ttl = 46, - sizegrowth = 0.4, - texture = [[circlefx0]], - alwaysvisible = true, - }, - }, - }, - ["LootboxBeaconSilver"] = { - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], - size = 54, - ttl = 64, - sizegrowth = 0.4, - texture = [[circlefx1]], - alwaysvisible = true, - }, - }, - }, - ["LootboxBeaconGold"] = { - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], - size = 72, - ttl = 82, - sizegrowth = 0.4, - texture = [[circlefx2]], - alwaysvisible = true, - }, - }, - }, - ["LootboxBeaconPlatinum"] = { - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.8 1 1 1 0.7 1 1 1 0.3 0 0 0 0.01]], - size = 90, - ttl = 100, - sizegrowth = 0.4, - texture = [[circlefx3]], - alwaysvisible = true, - }, - }, - }, -} \ No newline at end of file + ["LootboxBeaconBronze"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx0]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconSilver"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 54, + ttl = 64, + sizegrowth = 0.4, + texture = [[circlefx1]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconGold"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 72, + ttl = 82, + sizegrowth = 0.4, + texture = [[circlefx2]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconPlatinum"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.8 1 1 1 0.7 1 1 1 0.3 0 0 0 0.01]], + size = 90, + ttl = 100, + sizegrowth = 0.4, + texture = [[circlefx3]], + alwaysvisible = true, + }, + }, + }, +} diff --git a/effects/lootboxes/lootbox-trail.lua b/effects/lootboxes/lootbox-trail.lua index c7216c18938..e30d0e17226 100644 --- a/effects/lootboxes/lootbox-trail.lua +++ b/effects/lootboxes/lootbox-trail.lua @@ -1,208 +1,206 @@ -- Spawntrail for Lootbox Drops return { - ["lootbox-trail"] = { - usedefaultexplosions = false, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - alwaysVisible = true, - colormap = [[1 0.75 0.1 0.01 0.9 0.55 0.08 0.01 0.8 0.35 0.05 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-15 r3.5]], - sidetexture = [[muzzleside]], - size = 24, - sizegrowth = [[0.2 r0.9]], - ttl = 1, - }, - }, - fireglow = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.95 0.75 0 0.01 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = [[0.3 r0.2]], - particlelife = 20, - particlelifespread = 1, - particlesize = 40, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.95 0.75 0 0.1 0.45 0.32 0 0.1 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.2, 0]], - numparticles = 1, - particlelife = 70, - particlelifespread = 30, - particlesize = 9, - particlesizespread = 12, - particlespeed = 0.5, - particlespeedspread = 1.2, - pos = [[0, 1, 0]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.89, - colormap = [[0.8 0.6 0 0.15 0.55 0.40 0 0.1 0.028 0.020 0 0.15 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.65, 0]], - numparticles = [[0.3 r0.3]], - particlelife = 50, - particlelifespread = 15, - particlesize = 8, - particlesizespread = 7, - particlespeed = 0.25, - particlespeedspread = 1.9, - pos = [[0, 1, 0]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - -- trail = { - - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = [[0 r1]], - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- alwaysVisible = true, - -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -20, - -- sidetexture = [[smoketrail]], - -- size = 2.0, - -- sizegrowth = 0.05, - -- ttl = 160, - -- }, - -- }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.012 0.012 0.012 0.05 0.08 0.07 0.05 0.33 0.06 0.05 0.04 0.28 0.05 0.03 0.03 0.25 0.03 0.025 0.015 0.20 0.015 0.012 0.008 0.10 0.006 0.006 0.006 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, 0.02, 0.0]], - numparticles = [[0.5 r1]], - particlelife = 35, - particlelifespread = 40, - particlesize = 15.6, - particlesizespread = 12.4, - particlespeed = 2.5, - particlespeedspread = 2.5, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.33, - sizemod = 0.95, - texture = [[smoke]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.85, - colormap = [[0.9 0.66 0.4 0.6 1 0.74 0.48 0.7 0.75 0.45 0.25 0.4 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 15, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = [[0.5 r0.6]], - particlelife = 38, - particlelifespread = 24, - particlesize = 12, - particlesizespread = 6, - particlespeed = 0.05, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 1.5, - sizemod = 0.92, - texture = [[randomdots]], - }, - }, - -- spikes = { - -- air = true, - -- class = [[CExploSpikeProjectile]], - -- count = 2, - -- ground = true, - -- water = true, - -- properties = { - -- alpha = 0.6, - -- alphadecay = 0.08, - -- color = [[1.0, 0.5, 0.2]], - -- dir = [[-10 r20,-10 r20,-10 r20]], - -- length = 2, - -- width = 9, - -- }, - -- }, - }, + ["lootbox-trail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[1 0.75 0.1 0.01 0.9 0.55 0.08 0.01 0.8 0.35 0.05 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 24, + sizegrowth = [[0.2 r0.9]], + ttl = 1, + }, + }, + fireglow = { -} + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.95 0.75 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = [[0.3 r0.2]], + particlelife = 20, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.95 0.75 0 0.1 0.45 0.32 0 0.1 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 30, + particlesize = 9, + particlesizespread = 12, + particlespeed = 0.5, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.89, + colormap = [[0.8 0.6 0 0.15 0.55 0.40 0 0.1 0.028 0.020 0 0.15 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.65, 0]], + numparticles = [[0.3 r0.3]], + particlelife = 50, + particlelifespread = 15, + particlesize = 8, + particlesizespread = 7, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + -- trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = [[0 r1]], + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- alwaysVisible = true, + -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -20, + -- sidetexture = [[smoketrail]], + -- size = 2.0, + -- sizegrowth = 0.05, + -- ttl = 160, + -- }, + -- }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.012 0.012 0.012 0.05 0.08 0.07 0.05 0.33 0.06 0.05 0.04 0.28 0.05 0.03 0.03 0.25 0.03 0.025 0.015 0.20 0.015 0.012 0.008 0.10 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.02, 0.0]], + numparticles = [[0.5 r1]], + particlelife = 35, + particlelifespread = 40, + particlesize = 15.6, + particlesizespread = 12.4, + particlespeed = 2.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.33, + sizemod = 0.95, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.85, + colormap = [[0.9 0.66 0.4 0.6 1 0.74 0.48 0.7 0.75 0.45 0.25 0.4 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = [[0.5 r0.6]], + particlelife = 38, + particlelifespread = 24, + particlesize = 12, + particlesizespread = 6, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 1.5, + sizemod = 0.92, + texture = [[randomdots]], + }, + }, + -- spikes = { + -- air = true, + -- class = [[CExploSpikeProjectile]], + -- count = 2, + -- ground = true, + -- water = true, + -- properties = { + -- alpha = 0.6, + -- alphadecay = 0.08, + -- color = [[1.0, 0.5, 0.2]], + -- dir = [[-10 r20,-10 r20,-10 r20]], + -- length = 2, + -- width = 9, + -- }, + -- }, + }, +} diff --git a/effects/meteortrail.lua b/effects/meteortrail.lua index 4ed6acb2cdd..28fa10d2246 100644 --- a/effects/meteortrail.lua +++ b/effects/meteortrail.lua @@ -1,39 +1,38 @@ - return { - ["meteortrail"] = { - - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = 1, - airdrag = 0, - colormap = [[0.23 0.2 0.014 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 200, - particlesizespread = 45, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -1.7, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - - smoke = { + ["meteortrail"] = { + + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = 1, + airdrag = 0, + colormap = [[0.23 0.2 0.014 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 200, + particlesizespread = 45, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -1.7, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + + smoke = { class = [[CSimpleParticleSystem]], air = 1, water = 1, @@ -59,6 +58,6 @@ return { emitRot = 360, emitRotSpread = 360, }, - }, + }, }, } diff --git a/effects/minesweep.lua b/effects/minesweep.lua index 3e4eb6f88c5..8064cf8a45a 100644 --- a/effects/minesweep.lua +++ b/effects/minesweep.lua @@ -1,13 +1,13 @@ return { ["MINESWEEP"] = { - usedefaultexplosions = false; + usedefaultexplosions = false, ["GROUNDFLASH"] = { flashsize = 50, flashalpha = 0.4, circlegrowth = 2, circlealpha = 0.05, ttl = 8, - color = {0.1, 0.52, 0.05}, + color = { 0.1, 0.52, 0.05 }, }, }, -} \ No newline at end of file +} diff --git a/effects/missiletrail.lua b/effects/missiletrail.lua index 89622fae39a..2c7f3f9ebf6 100644 --- a/effects/missiletrail.lua +++ b/effects/missiletrail.lua @@ -1,3095 +1,3089 @@ - local definitions = { - ["missiletrailsmall-anim"] = { - --groundflash = { - -- circlealpha = 0, - -- circlegrowth = 0, - -- flashalpha = 0.025, - -- flashsize = 50, - -- ttl = 12, - -- color = { - -- [1] = 1, - -- [2] = 0.75, - -- [3] = 0.25, - -- }, - --}, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-14 r3.8]], - sidetexture = [[muzzleside]], - size = 2.0, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 2, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.12 0.085 0.017 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 30, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 90, 0.0]], - sizegrowth = 0, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0.6 0.6 0.6 0.6 0.3 0.3 0.3 0.5 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, -0.01, 0.0]], - numparticles = 1, - particlelife = 55, - particlelifespread = 24, - particlesize = 1.7, - particlesizespread = 3.5, - particlespeed = 0.5, - particlespeedspread = 1.5, - animParams = [[8,8,20 r20]], - rotParams = [[-5 r10, -2 r4, 40 r90]], - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.23, - sizemod = 1, - texture = [[Cloud01-anim]], - useairlos = true, - }, - }, - -- trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0.01 0.028 0.02 0.012 0.1 0.035 0.025 0.015 0.1 0.035 0.025 0.015 0.08 0.03 0.02 0.013 0.066 0.025 0.015 0.011 0.05 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -70, - -- sidetexture = [[smoketrail]], - -- size = 2.54, - -- sizegrowth = -0.055, - -- ttl = 5, - -- }, - -- }, - }, - ["missilegroundsmall-liftoff"] = { - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0.07 0.07 0.07 0.11 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 60, - particlesize = 5, - particlesizespread = 3, - particlespeed = 1.2, - particlespeedspread = 1.85, - pos = [[0, 8, 0]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.3, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], - Texture=[[smoke_puff2]], - particleLife=7, - particleLifeSpread=9, - numparticles=1, - particleSpeed=1.5, - particleSpeedSpread=3.5, - particleSize=7, - particleSizeSpread=12, - directional=0, - rotParams = [[-60 r120, -30 r60, -180 r360]], - castShadow = true, - }, - }, - }, - ["missilegroundsmall-liftoff-fire"] = { - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], - directional = true, - emitrot = 77, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.18, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 7, - particlesize = 5, - particlesizespread = 5, - particlespeed = 1.2, - particlespeedspread = 3, - pos = [[0, 3, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[flashside2]], - useairlos = false, - }, - }, - }, - - ["missilegroundmedium-liftoff"] = { - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.84, - colormap = [[0.07 0.07 0.07 0.44 0 0 0 0.1]], - directional = true, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - numparticles = 1, - particlelife = 9, - particlelifespread = 40, - particlesize = 4.5, - particlesizespread = 4.3, - particlespeed = 2.35, - particlespeedspread = 2.7, - pos = [[0, 11, 0]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - sizegrowth = 0.25, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.85, - alwaysVisible = 0, - sizeGrowth = 0.1, - sizeMod = 1.0, - pos = [[r-1 r1, 2, r-1 r1]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - emitRot=90, - emitRotSpread=30, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], - Texture=[[smoke_puff]], - particleLife=10, - particleLifeSpread=16, - numparticles=1, - particleSpeed=2, - particleSpeedSpread=5, - particleSize=14, - particleSizeSpread=18, - directional=0, - castShadow = true, - }, - }, - }, - ["missilegroundmedium-liftoff-fire"] = { - -- explosion = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.82, - -- colormap = [[0.55 0.36 0.22 0.24 0.3 0.11 0.02 0.09 0 0 0 0.01]], - -- directional = false, - -- emitrot = 77, - -- emitrotspread = 16, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.2, 0]], - -- numparticles = 1, - -- particlelife = 4, - -- particlelifespread = 7, - -- particlesize = 12.5, - -- particlesizespread = 12, - -- particlespeed = 1.5, - -- particlespeedspread = 4.5, - -- pos = [[0, 7, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[flashside3]], - -- useairlos = false, - -- }, - -- }, - explosion2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[1 0.9 0.6 0.44 0.9 0.5 0.2 0.24 0.66 0.28 0.04 0.12 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 15, - particlesize = 12, - particlesizespread = 15, - particlespeed = 0.99, - particlespeedspread = 4.3, - pos = [[0, 4, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - }, - - ["missilegroundlarge-liftoff"] = { - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0.07 0.07 0.07 0.13 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 4, - particlelife = 18, - particlelifespread = 130, - particlesize = 10, - particlesizespread = 3.5, - particlespeed = 2, - particlespeedspread = 4.7, - pos = [[0, 27, 0]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.3, - sizeMod = 1.0, - pos = [[r-1 r1, 20, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=15, - particleLifeSpread=15, - numparticles=1, - particleSpeed=2.5, - particleSpeedSpread=5.5, - particleSize=36, - particleSizeSpread=36, - directional=0, - rotParams = [[-60 r120, -30 r60, -180 r360]], - castShadow = true, - }, - }, - }, - ["missilegroundlarge-liftoff-fire"] = { - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], - directional = true, - emitrot = 77, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.22, 0]], - numparticles = 3, - particlelife = 7, - particlelifespread = 9, - particlesize = 8, - particlesizespread = 9, - particlespeed = 2.5, - particlespeedspread = 7.5, - pos = [[0, 23, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[flashside2]], - useairlos = false, - }, - }, - }, - - ["missilegroundhuge-liftoff"] = { - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0.07 0.07 0.07 0.13 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 6, - particlelife = 22, - particlelifespread = 140, - particlesize = 20, - particlesizespread = 8, - particlespeed = 2.2, - particlespeedspread = 7, - pos = [[0, 40, 0]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.75, - alwaysVisible = 0, - sizeGrowth = 0.3, - sizeMod = 1.0, - pos = [[r-1 r1, 24, r-1 r1]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colorMap=[[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=20, - particleLifeSpread=20, - numparticles=[[1.4 r0.7]], - particleSpeed=3.5, - particleSpeedSpread=7, - particleSize=50, - particleSizeSpread=50, - directional=0, - rotParams = [[-60 r120, -30 r60, -180 r360]], - castShadow = true, - }, - }, - }, - ["missilegroundhuge-liftoff-fire"] = { - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], - directional = true, - emitrot = 77, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 4, - particlelife = 7, - particlelifespread = 10, - particlesize = 14, - particlesizespread = 14, - particlespeed = 4.5, - particlespeedspread = 12.5, - pos = [[0, 28, 0]], - sizegrowth = 0.6, - sizemod = 1, - texture = [[flashside2]], - useairlos = false, - }, - }, - }, + ["missiletrailsmall-anim"] = { + --groundflash = { + -- circlealpha = 0, + -- circlegrowth = 0, + -- flashalpha = 0.025, + -- flashsize = 50, + -- ttl = 12, + -- color = { + -- [1] = 1, + -- [2] = 0.75, + -- [3] = 0.25, + -- }, + --}, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-14 r3.8]], + sidetexture = [[muzzleside]], + size = 2.0, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 2, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.12 0.085 0.017 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 30, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 90, 0.0]], + sizegrowth = 0, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0.6 0.6 0.6 0.6 0.3 0.3 0.3 0.5 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, -0.01, 0.0]], + numparticles = 1, + particlelife = 55, + particlelifespread = 24, + particlesize = 1.7, + particlesizespread = 3.5, + particlespeed = 0.5, + particlespeedspread = 1.5, + animParams = [[8,8,20 r20]], + rotParams = [[-5 r10, -2 r4, 40 r90]], + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.23, + sizemod = 1, + texture = [[Cloud01-anim]], + useairlos = true, + }, + }, + -- trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0.01 0.028 0.02 0.012 0.1 0.035 0.025 0.015 0.1 0.035 0.025 0.015 0.08 0.03 0.02 0.013 0.066 0.025 0.015 0.011 0.05 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -70, + -- sidetexture = [[smoketrail]], + -- size = 2.54, + -- sizegrowth = -0.055, + -- ttl = 5, + -- }, + -- }, + }, + ["missilegroundsmall-liftoff"] = { + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0.07 0.07 0.07 0.11 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 60, + particlesize = 5, + particlesizespread = 3, + particlespeed = 1.2, + particlespeedspread = 1.85, + pos = [[0, 8, 0]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.3, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], + Texture = [[smoke_puff2]], + particleLife = 7, + particleLifeSpread = 9, + numparticles = 1, + particleSpeed = 1.5, + particleSpeedSpread = 3.5, + particleSize = 7, + particleSizeSpread = 12, + directional = 0, + rotParams = [[-60 r120, -30 r60, -180 r360]], + castShadow = true, + }, + }, + }, + ["missilegroundsmall-liftoff-fire"] = { + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], + directional = true, + emitrot = 77, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.18, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 7, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1.2, + particlespeedspread = 3, + pos = [[0, 3, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + }, - ["missiletrailfighter"] = { - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = 35, - sidetexture = [[muzzlesideflipped]], - size = 2.5, - sizegrowth = 0, - ttl = 1, - drawOrder = 1, - }, - }, - -- engineglow = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.1 0.07 0.022 0.01 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = 70, - -- sidetexture = [[glow2]], - -- size = 32, - -- sizegrowth = 0, - -- ttl = 1, - -- }, - -- }, - -- trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.25 0.16 0.05 0.4 0.035 0.025 0.015 0.15 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = 31, - -- sidetexture = [[smoketrail]], - -- size = 2, - -- sizegrowth = 0, - -- ttl = 11, - -- }, - -- }, - }, - ["missiletrailfighter-smoke"] = { -- used by gadget: fx_missile_smoke - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-6.5 r1]], - sidetexture = [[muzzleside]], - size = 1.35, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 2, - }, - }, - --trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.035 0.025 0.015 0.08 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = 31, - -- sidetexture = [[smoketrail]], - -- size = 1.5, - -- sizegrowth = -0.03, - -- ttl = 4.5, - -- }, - --}, - }, + ["missilegroundmedium-liftoff"] = { + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.84, + colormap = [[0.07 0.07 0.07 0.44 0 0 0 0.1]], + directional = true, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 40, + particlesize = 4.5, + particlesizespread = 4.3, + particlespeed = 2.35, + particlespeedspread = 2.7, + pos = [[0, 11, 0]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.85, + alwaysVisible = 0, + sizeGrowth = 0.1, + sizeMod = 1.0, + pos = [[r-1 r1, 2, r-1 r1]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + emitRot = 90, + emitRotSpread = 30, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], + Texture = [[smoke_puff]], + particleLife = 10, + particleLifeSpread = 16, + numparticles = 1, + particleSpeed = 2, + particleSpeedSpread = 5, + particleSize = 14, + particleSizeSpread = 18, + directional = 0, + castShadow = true, + }, + }, + }, + ["missilegroundmedium-liftoff-fire"] = { + -- explosion = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.82, + -- colormap = [[0.55 0.36 0.22 0.24 0.3 0.11 0.02 0.09 0 0 0 0.01]], + -- directional = false, + -- emitrot = 77, + -- emitrotspread = 16, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.2, 0]], + -- numparticles = 1, + -- particlelife = 4, + -- particlelifespread = 7, + -- particlesize = 12.5, + -- particlesizespread = 12, + -- particlespeed = 1.5, + -- particlespeedspread = 4.5, + -- pos = [[0, 7, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[flashside3]], + -- useairlos = false, + -- }, + -- }, + explosion2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[1 0.9 0.6 0.44 0.9 0.5 0.2 0.24 0.66 0.28 0.04 0.12 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 15, + particlesize = 12, + particlesizespread = 15, + particlespeed = 0.99, + particlespeedspread = 4.3, + pos = [[0, 4, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + }, + ["missilegroundlarge-liftoff"] = { + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0.07 0.07 0.07 0.13 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 4, + particlelife = 18, + particlelifespread = 130, + particlesize = 10, + particlesizespread = 3.5, + particlespeed = 2, + particlespeedspread = 4.7, + pos = [[0, 27, 0]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.3, + sizeMod = 1.0, + pos = [[r-1 r1, 20, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 15, + particleLifeSpread = 15, + numparticles = 1, + particleSpeed = 2.5, + particleSpeedSpread = 5.5, + particleSize = 36, + particleSizeSpread = 36, + directional = 0, + rotParams = [[-60 r120, -30 r60, -180 r360]], + castShadow = true, + }, + }, + }, + ["missilegroundlarge-liftoff-fire"] = { + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], + directional = true, + emitrot = 77, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.22, 0]], + numparticles = 3, + particlelife = 7, + particlelifespread = 9, + particlesize = 8, + particlesizespread = 9, + particlespeed = 2.5, + particlespeedspread = 7.5, + pos = [[0, 23, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + }, - ["missiletrailtiny"] = { - --groundflash = { - -- circlealpha = 0, - -- circlegrowth = 0, - -- flashalpha = 0.02, - -- flashsize = 40, - -- ttl = 10, - -- color = { - -- [1] = 1, - -- [2] = 0.75, - -- [3] = 0.25, - -- }, - --}, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.66 0.25 0.01 1.0 0.6 0.18 0.01 1.0 0.5 0.09 0.01 0.55 0.3 0.05 0.012 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[15 r4]], - sidetexture = [[muzzlesideflipped]], - size = 2.3, - sizegrowth = 0, - ttl = 2, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.15 0.1 0.02 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 26, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -1.7, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.9, - -- colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], - -- directional = true, - -- emitrot = 180, - -- emitrotspread = 7, - -- emitvector = [[dir]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = 2, - -- particlelifespread = 0, - -- particlesize = 11, - -- particlesizespread = 11, - -- particlespeed = -2, - -- particlespeedspread = 1, - -- pos = [[0, 90 ,0]], - -- sizegrowth = -4, - -- sizemod = 1.8, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - -- }, - }, - ["missiletrailtiny-smoke"] = { -- used by gadget: fx_missile_smoke - exhaustengine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-8 r1]], - sidetexture = [[muzzleside]], - size = 1.5, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 1, - drawOrder = 1, - }, - }, - }, + ["missilegroundhuge-liftoff"] = { + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0.07 0.07 0.07 0.13 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 6, + particlelife = 22, + particlelifespread = 140, + particlesize = 20, + particlesizespread = 8, + particlespeed = 2.2, + particlespeedspread = 7, + pos = [[0, 40, 0]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.75, + alwaysVisible = 0, + sizeGrowth = 0.3, + sizeMod = 1.0, + pos = [[r-1 r1, 24, r-1 r1]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colorMap = [[1 0.66 0.4 0.35 0.5 0.3 0.14 0.45 0.27 0.19 0.13 0.4 0.19 0.16 0.14 0.35 0.1 0.095 0.088 0.25 0.07 0.065 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 20, + particleLifeSpread = 20, + numparticles = [[1.4 r0.7]], + particleSpeed = 3.5, + particleSpeedSpread = 7, + particleSize = 50, + particleSizeSpread = 50, + directional = 0, + rotParams = [[-60 r120, -30 r60, -180 r360]], + castShadow = true, + }, + }, + }, + ["missilegroundhuge-liftoff-fire"] = { + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0.55 0.36 0.22 0.06 0.3 0.11 0.02 0.03 0 0 0 0.01]], + directional = true, + emitrot = 77, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 4, + particlelife = 7, + particlelifespread = 10, + particlesize = 14, + particlesizespread = 14, + particlespeed = 4.5, + particlespeedspread = 12.5, + pos = [[0, 28, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + }, - ["missiletrailsmall"] = { - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-14 r3.5]], - sidetexture = [[muzzleside]], - size = 2.1, - sizegrowth = [[0.2 r0.3]], - ttl = 2, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.11 0.077 0.015 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 0, - particlesize = 28, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 90, 0.0]], - sizegrowth = 0, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 0.04 0.038 0.034 0.25 0.04 0.036 0.032 0.3 0.025 0.025 0.025 0.22 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0.0, -0.01, 0.0]], - numparticles = [[1 r0.5]], - particlelife = 1, - particlelifespread = 0, - particlesize = 3, - particlesizespread = 2, - particlespeed = 1, - particlespeedspread = 1.6, - rotParams = [[-180 r360, -120 r240, -180 r360]], - pos = [[-2 r4, -2 r4, -2 r4]], - sizegrowth = -0.05, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["missiletrailsmall-smoke"] = { -- used by gadget: fx_missile_smoke - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-8.5 r1]], - sidetexture = [[muzzleside]], - size = 2.1, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 1, - drawOrder = 1, - }, - }, - --smoke = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.91, - -- colormap = [[0.075 0.073 0.07 0.2 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 7.5, - -- emitvector = [[dir]], - -- gravity = [[0.0, -0.01, 0.0]], - -- numparticles = 1, - -- particlelife = 15, - -- particlelifespread = 9, - -- particlesize = 1.6, - -- particlesizespread = 1.1, - -- particlespeed = 1, - -- particlespeedspread = 1, - -- pos = [[0.0, 1, 0.0]], - -- sizegrowth = 0.11, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - --}, - }, - ["missiletrailsmall-simple"] = { - --groundflash = { - -- circlealpha = 0, - -- circlegrowth = 0, - -- flashalpha = 0.025, - -- flashsize = 50, - -- ttl = 12, - -- color = { - -- [1] = 1, - -- [2] = 0.75, - -- [3] = 0.25, - -- }, - --}, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-14 r3.8]], - sidetexture = [[muzzleside]], - size = 2.0, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 2, - drawOrder = 1, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.12 0.085 0.017 0.01 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 30, - particlesizespread = 6, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 90, 0.0]], - sizegrowth = 0, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0, 0.005, 0]], - numparticles = 0, - particlelife = 2.3, - particlelifespread = 2, - particlesize = 22, - particlesizespread = 28, - particlespeed = 2.35, - particlespeedspread = 4.2, - pos = [[0, 90 ,0]], - sizegrowth = -2.4, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - -- trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0.01 0.028 0.02 0.012 0.1 0.035 0.025 0.015 0.1 0.035 0.025 0.015 0.08 0.03 0.02 0.013 0.066 0.025 0.015 0.011 0.05 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -70, - -- sidetexture = [[smoketrail]], - -- size = 2.54, - -- sizegrowth = -0.055, - -- ttl = 5, - -- }, - -- }, - }, - ["missiletrailsmall-simple-smoke"] = { -- used by gadget: fx_missile_smoke - exhaustengine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-8.5 r1]], - sidetexture = [[muzzleside]], - size = 2.1, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 1, - drawOrder = 2, - }, - }, - --trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.09 0.035 0.025 0.015 0.07 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -50, - -- sidetexture = [[smoketrail]], - -- size = 2.50, - -- sizegrowth = -0.055, - -- ttl = 3, - -- }, - --}, - }, - ["missiletrailviper"] = { - --groundflash = { - -- circlealpha = 0, - -- circlegrowth = 0, - -- flashalpha = 0.035, - -- flashsize = 65, - -- ttl = 10, - -- color = { - -- [1] = 0.9, - -- [2] = 0.55, - -- [3] = 0.15, - -- }, - --},= - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.5 0.25 0.01 1.0 0.4 0.1 0.01 1.0 0.3 0.07 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-35 r5]], - sidetexture = [[muzzleside]], - size = 3.8, - sizegrowth = [[0.2 r0.3]], - ttl = 3, - drawOrder = 2, - }, - }, - --fire = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 1, - -- colormap = [[0.9 0.7 0.33 0.15 0.44 0.26 0.09 0.2 0.14 0.04 0.01 0.17 0.02 0.01 0.006 0.1 0 0 0 0.01]], - -- directional = true, - -- emitrot = 180, - -- emitrotspread = 7, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.1, 0.0]], - -- numparticles = 3, - -- particlelife = 5, - -- particlelifespread = 3, - -- particlesize = 1.8, - -- particlesizespread = 2, - -- particlespeed = 1, - -- particlespeedspread = 3.5, - -- pos = [[0.0, 10, 0.0]], - -- sizegrowth = -0.2, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - --}, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.25 0.13 0.025 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 60, - particlesizespread = 6, - particlespeed = 16, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 4, - particlesize = 18, - particlesizespread = 26, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 90 ,0]], - sizegrowth = -2.4, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - -- smoke = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.91, - -- colormap = [[0.16 0.13 0.1 0.22 0.16 0.13 0.1 0.38 0.11 0.105 0.1 0.33 0.085 0.085 0.085 0.24 0.07 0.07 0.07 0.19 0.04 0.04 0.04 0.115 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 13, - -- emitvector = [[dir]], - -- gravity = [[0.0, -0.03, 0.0]], - -- numparticles = 2, - -- particlelife = 20, - -- particlelifespread = 14, - -- particlesize = 3.8, - -- particlesizespread = 3.8, - -- particlespeed = 2.5, - -- particlespeedspread = 4.5, - -- pos = [[0.0, 0, 0.0]], - -- sizegrowth = 0.1, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - -- }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.4 0.4 0.4 0.01 1 0.8 0.48 0.5 0.8 0.44 0.22 0.5 0.55 0.3 0.1 0.35 0.2 0.06 0.02 0.15 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 3, - particlesize = 5, - particlesizespread = 2.5, - particlespeed = 1.2, - particlespeedspread = 3, - rotParams = [[-180 r360, -90 r180, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 0.4, - sizemod = 1.0, - texture = [[randdots]], - }, - }, - }, + ["missiletrailfighter"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 35, + sidetexture = [[muzzlesideflipped]], + size = 2.5, + sizegrowth = 0, + ttl = 1, + drawOrder = 1, + }, + }, + -- engineglow = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.1 0.07 0.022 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = 70, + -- sidetexture = [[glow2]], + -- size = 32, + -- sizegrowth = 0, + -- ttl = 1, + -- }, + -- }, + -- trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.25 0.16 0.05 0.4 0.035 0.025 0.015 0.15 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = 31, + -- sidetexture = [[smoketrail]], + -- size = 2, + -- sizegrowth = 0, + -- ttl = 11, + -- }, + -- }, + }, + ["missiletrailfighter-smoke"] = { -- used by gadget: fx_missile_smoke + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-6.5 r1]], + sidetexture = [[muzzleside]], + size = 1.35, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 2, + }, + }, + --trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.035 0.025 0.015 0.08 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = 31, + -- sidetexture = [[smoketrail]], + -- size = 1.5, + -- sizegrowth = -0.03, + -- ttl = 4.5, + -- }, + --}, + }, - ["missiletrailmedium"] = { - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-24 r6]], - sidetexture = [[muzzleside]], - size = 3.3, - sizegrowth = [[0.2 r0.3]], - ttl = 2, - drawOrder = 1, - --castShadow = true, + ["missiletrailtiny"] = { + --groundflash = { + -- circlealpha = 0, + -- circlegrowth = 0, + -- flashalpha = 0.02, + -- flashsize = 40, + -- ttl = 10, + -- color = { + -- [1] = 1, + -- [2] = 0.75, + -- [3] = 0.25, + -- }, + --}, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.66 0.25 0.01 1.0 0.6 0.18 0.01 1.0 0.5 0.09 0.01 0.55 0.3 0.05 0.012 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[15 r4]], + sidetexture = [[muzzlesideflipped]], + size = 2.3, + sizegrowth = 0, + ttl = 2, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.15 0.1 0.02 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 26, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -1.7, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.9, + -- colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], + -- directional = true, + -- emitrot = 180, + -- emitrotspread = 7, + -- emitvector = [[dir]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = 2, + -- particlelifespread = 0, + -- particlesize = 11, + -- particlesizespread = 11, + -- particlespeed = -2, + -- particlespeedspread = 1, + -- pos = [[0, 90 ,0]], + -- sizegrowth = -4, + -- sizemod = 1.8, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + -- }, + }, + ["missiletrailtiny-smoke"] = { -- used by gadget: fx_missile_smoke + exhaustengine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-8 r1]], + sidetexture = [[muzzleside]], + size = 1.5, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 1, + drawOrder = 1, + }, + }, + }, - }, - }, - --fire = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 1, - -- colormap = [[0.9 0.7 0.33 0.15 0.44 0.26 0.09 0.2 0.14 0.04 0.01 0.17 0.02 0.01 0.006 0.1 0 0 0 0.01]], - -- directional = true, - -- emitrot = 180, - -- emitrotspread = 7, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.1, 0.0]], - -- numparticles = 3, - -- particlelife = 5, - -- particlelifespread = 3, - -- particlesize = 1.8, - -- particlesizespread = 2, - -- particlespeed = 1, - -- particlespeedspread = 3.5, - -- pos = [[0.0, 10, 0.0]], - -- sizegrowth = -0.2, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - --}, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.35 0.25 0.039 0.5 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 60, - particlesizespread = 6, - particlespeed = 16, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.4 0.01 0.75 0.35 0.1 0.01 0.35 0.12 0.04 0.01 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 1, - particlelifespread = 4, - particlesize = 18, - particlesizespread = 24, - particlespeed = 3, - particlespeedspread = 4, - rotParams = [[-180 r360, -120 r240, -180 r360]], - pos = [[0, 90 ,0]], - sizegrowth = -2.4, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.006 0.006 0.006 0 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.012 0.012 0.012 0.1 0.004 0.004 0.004 0.03 0 0 0 0.01]], - directional = false, - emitrot = -180, - emitrotspread = 11, - emitvector = [[dir]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 4, - particlesize = 3, - particlesizespread = 6, - particlespeed = 1.5, - particlespeedspread = 6, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = -0.25, - sizemod = 1.01, - texture = [[smoke]], - useairlos = true, - --castShadow = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.006 0.006 0.006 0.01 0.12 0.09 0.08 0.1 0.095 0.085 0.07 0.33 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.02 0.06 0.01 0.01 0.01 0.03 0 0 0 0.01]], - directional = false, - emitrot = -180, - emitrotspread = 11, - emitvector = [[dir]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = [[2 r2]], - particlelife = 6.5, - particlelifespread = 4.5, - particlesize = 5, - particlesizespread = 6, - particlespeed = 1, - particlespeedspread = 5, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = -0.25, - sizemod = 1, - texture = [[smoke_puff]], - useairlos = true, - --castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.77, - colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 15, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 7, - particlesize = 4, - particlesizespread = 0.8, - particlespeed = 0.05, - particlespeedspread = 0.6, - rotParams = [[-180 r360, -90 r180, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 0.03, - sizemod = 1.0, - texture = [[randomdots]], - castShadow = false, - }, - }, - }, - ["missiletrailmedium-smoke"] = { -- used by gadget: fx_missile_smoke - exhaustengine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-12 r1]], - sidetexture = [[muzzleside]], - size = 2.75, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 1, - }, - }, - --smoke = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.92, - -- colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 8, - -- emitvector = [[dir]], - -- gravity = [[0.0, -0.02, 0.0]], - -- numparticles = 1, - -- particlelife = 9, - -- particlelifespread = 4, - -- particlesize = 3, - -- particlesizespread = 3, - -- particlespeed = 1, - -- particlespeedspread = 1, - -- pos = [[-15 r30, -15 r30, -15 r30]], - -- sizegrowth = 0.2, - -- sizemod = 1, - -- texture = [[smoke]], - -- useairlos = true, - -- }, - --}, - }, + ["missiletrailsmall"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-14 r3.5]], + sidetexture = [[muzzleside]], + size = 2.1, + sizegrowth = [[0.2 r0.3]], + ttl = 2, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.11 0.077 0.015 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 0, + particlesize = 28, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 90, 0.0]], + sizegrowth = 0, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 0.04 0.038 0.034 0.25 0.04 0.036 0.032 0.3 0.025 0.025 0.025 0.22 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0.0, -0.01, 0.0]], + numparticles = [[1 r0.5]], + particlelife = 1, + particlelifespread = 0, + particlesize = 3, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 1.6, + rotParams = [[-180 r360, -120 r240, -180 r360]], + pos = [[-2 r4, -2 r4, -2 r4]], + sizegrowth = -0.05, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["missiletrailsmall-smoke"] = { -- used by gadget: fx_missile_smoke + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-8.5 r1]], + sidetexture = [[muzzleside]], + size = 2.1, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 1, + drawOrder = 1, + }, + }, + --smoke = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.91, + -- colormap = [[0.075 0.073 0.07 0.2 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 7.5, + -- emitvector = [[dir]], + -- gravity = [[0.0, -0.01, 0.0]], + -- numparticles = 1, + -- particlelife = 15, + -- particlelifespread = 9, + -- particlesize = 1.6, + -- particlesizespread = 1.1, + -- particlespeed = 1, + -- particlespeedspread = 1, + -- pos = [[0.0, 1, 0.0]], + -- sizegrowth = 0.11, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + --}, + }, + ["missiletrailsmall-simple"] = { + --groundflash = { + -- circlealpha = 0, + -- circlegrowth = 0, + -- flashalpha = 0.025, + -- flashsize = 50, + -- ttl = 12, + -- color = { + -- [1] = 1, + -- [2] = 0.75, + -- [3] = 0.25, + -- }, + --}, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-14 r3.8]], + sidetexture = [[muzzleside]], + size = 2.0, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 2, + drawOrder = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.12 0.085 0.017 0.01 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 30, + particlesizespread = 6, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 90, 0.0]], + sizegrowth = 0, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0, 0.005, 0]], + numparticles = 0, + particlelife = 2.3, + particlelifespread = 2, + particlesize = 22, + particlesizespread = 28, + particlespeed = 2.35, + particlespeedspread = 4.2, + pos = [[0, 90 ,0]], + sizegrowth = -2.4, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + -- trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0.01 0.028 0.02 0.012 0.1 0.035 0.025 0.015 0.1 0.035 0.025 0.015 0.08 0.03 0.02 0.013 0.066 0.025 0.015 0.011 0.05 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -70, + -- sidetexture = [[smoketrail]], + -- size = 2.54, + -- sizegrowth = -0.055, + -- ttl = 5, + -- }, + -- }, + }, + ["missiletrailsmall-simple-smoke"] = { -- used by gadget: fx_missile_smoke + exhaustengine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-8.5 r1]], + sidetexture = [[muzzleside]], + size = 2.1, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 1, + drawOrder = 2, + }, + }, + --trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.09 0.035 0.025 0.015 0.07 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -50, + -- sidetexture = [[smoketrail]], + -- size = 2.50, + -- sizegrowth = -0.055, + -- ttl = 3, + -- }, + --}, + }, + ["missiletrailviper"] = { + --groundflash = { + -- circlealpha = 0, + -- circlegrowth = 0, + -- flashalpha = 0.035, + -- flashsize = 65, + -- ttl = 10, + -- color = { + -- [1] = 0.9, + -- [2] = 0.55, + -- [3] = 0.15, + -- }, + --},= + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.5 0.25 0.01 1.0 0.4 0.1 0.01 1.0 0.3 0.07 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-35 r5]], + sidetexture = [[muzzleside]], + size = 3.8, + sizegrowth = [[0.2 r0.3]], + ttl = 3, + drawOrder = 2, + }, + }, + --fire = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 1, + -- colormap = [[0.9 0.7 0.33 0.15 0.44 0.26 0.09 0.2 0.14 0.04 0.01 0.17 0.02 0.01 0.006 0.1 0 0 0 0.01]], + -- directional = true, + -- emitrot = 180, + -- emitrotspread = 7, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.1, 0.0]], + -- numparticles = 3, + -- particlelife = 5, + -- particlelifespread = 3, + -- particlesize = 1.8, + -- particlesizespread = 2, + -- particlespeed = 1, + -- particlespeedspread = 3.5, + -- pos = [[0.0, 10, 0.0]], + -- sizegrowth = -0.2, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + --}, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.25 0.13 0.025 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 60, + particlesizespread = 6, + particlespeed = 16, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.4 0.15 0.05 0.007 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 4, + particlesize = 18, + particlesizespread = 26, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 90 ,0]], + sizegrowth = -2.4, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + -- smoke = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.91, + -- colormap = [[0.16 0.13 0.1 0.22 0.16 0.13 0.1 0.38 0.11 0.105 0.1 0.33 0.085 0.085 0.085 0.24 0.07 0.07 0.07 0.19 0.04 0.04 0.04 0.115 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 13, + -- emitvector = [[dir]], + -- gravity = [[0.0, -0.03, 0.0]], + -- numparticles = 2, + -- particlelife = 20, + -- particlelifespread = 14, + -- particlesize = 3.8, + -- particlesizespread = 3.8, + -- particlespeed = 2.5, + -- particlespeedspread = 4.5, + -- pos = [[0.0, 0, 0.0]], + -- sizegrowth = 0.1, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + -- }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.4 0.4 0.4 0.01 1 0.8 0.48 0.5 0.8 0.44 0.22 0.5 0.55 0.3 0.1 0.35 0.2 0.06 0.02 0.15 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 3, + particlesize = 5, + particlesizespread = 2.5, + particlespeed = 1.2, + particlespeedspread = 3, + rotParams = [[-180 r360, -90 r180, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[randdots]], + }, + }, + }, - ["missiletraillarge"] = { - fire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[1 0.75 0.33 0.01 0.44 0.26 0.09 0.01 0.14 0.04 0.01 0.01 0.02 0.01 0.006 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 3.3, - particlesizespread = 2.5, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0.0, 88, 0.0]], - sizegrowth = -0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.18 0.07 0.012 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 88, - particlesizespread = 7, - particlespeed = 16, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[1 0.7 0.5 0.01 0.9 0.4 0.1 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = [[2 r2]], - particlelife = 1, - particlelifespread = 2, - particlesize = 25, - particlesizespread = 33, - particlespeed = 1, - particlespeedspread = 3, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = -1, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.006 0.006 0.006 0 0.05 0.04 0.033 0.6 0.04 0.038 0.034 0.5 0.04 0.036 0.032 0.33 0.015 0.015 0.015 0.15 0.014 0.014 0.014 0.1 0.006 0.006 0.006 0.04 0 0 0 0.01]], - directional = false, - emitrot = -120, - emitrotspread = 10, - emitvector = [[0, 0.5, 0]], - gravity = [[0.0, 0.02, 0.0]], - numparticles = [[3 r2]], - particlelife = 6, - particlelifespread = 11, - particlesize = 2.5, - particlesizespread = 3, - particlespeed = 2, - particlespeedspread = 6, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-30 r60, -15 r30, -30 r60]], - sizegrowth = 0.44, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.006 0.006 0.006 0.05 0.12 0.09 0.08 0.4 0.095 0.085 0.07 0.33 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.027 0.08 0.012 0.012 0.012 0.04 0 0 0 0.01]], - directional = false, - emitrot = -120, - emitrotspread = 10, - emitvector = [[0, 0.5, 0]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = 3, - particlelife = 4, - particlelifespread = 5, - particlesize = 4, - particlesizespread = 5, - particlespeed = 2, - particlespeedspread = 6, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-30 r60, -15 r30, -30 r60]], - sizegrowth = 0.75, - sizemod = 1, - texture = [[smoke_puff]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0.5 0.45 0.4 0.01 1 0.75 0.5 0.03 0.77 0.44 0.33 0.18 0.5 0.27 0.22 0.15 0.17 0.1 0.1 0.1 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 28, - emitvector = [[1, 1, 1]], - gravity = [[0, -0.02, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 8, - particlesize = 3.9, - particlesizespread = 1.2, - particlespeed = 0.15, - particlespeedspread = 0.4, - rotParams = [[-120 r240, -120 r240, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 0.35, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - }, - ["missiletraillarge-smoke"] = { -- used by gadget: fx_missile_smoke - exhaustengine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-20 r1]], - sidetexture = [[muzzleside]], - size = 3.6, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 2, - }, - }, - }, + ["missiletrailmedium"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-24 r6]], + sidetexture = [[muzzleside]], + size = 3.3, + sizegrowth = [[0.2 r0.3]], + ttl = 2, + drawOrder = 1, + --castShadow = true, + }, + }, + --fire = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 1, + -- colormap = [[0.9 0.7 0.33 0.15 0.44 0.26 0.09 0.2 0.14 0.04 0.01 0.17 0.02 0.01 0.006 0.1 0 0 0 0.01]], + -- directional = true, + -- emitrot = 180, + -- emitrotspread = 7, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.1, 0.0]], + -- numparticles = 3, + -- particlelife = 5, + -- particlelifespread = 3, + -- particlesize = 1.8, + -- particlesizespread = 2, + -- particlespeed = 1, + -- particlespeedspread = 3.5, + -- pos = [[0.0, 10, 0.0]], + -- sizegrowth = -0.2, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + --}, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.35 0.25 0.039 0.5 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 60, + particlesizespread = 6, + particlespeed = 16, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.01 0.75 0.35 0.1 0.01 0.35 0.12 0.04 0.01 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 4, + particlesize = 18, + particlesizespread = 24, + particlespeed = 3, + particlespeedspread = 4, + rotParams = [[-180 r360, -120 r240, -180 r360]], + pos = [[0, 90 ,0]], + sizegrowth = -2.4, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.006 0.006 0.006 0 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.012 0.012 0.012 0.1 0.004 0.004 0.004 0.03 0 0 0 0.01]], + directional = false, + emitrot = -180, + emitrotspread = 11, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 4, + particlesize = 3, + particlesizespread = 6, + particlespeed = 1.5, + particlespeedspread = 6, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = -0.25, + sizemod = 1.01, + texture = [[smoke]], + useairlos = true, + --castShadow = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.006 0.006 0.006 0.01 0.12 0.09 0.08 0.1 0.095 0.085 0.07 0.33 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.02 0.06 0.01 0.01 0.01 0.03 0 0 0 0.01]], + directional = false, + emitrot = -180, + emitrotspread = 11, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[2 r2]], + particlelife = 6.5, + particlelifespread = 4.5, + particlesize = 5, + particlesizespread = 6, + particlespeed = 1, + particlespeedspread = 5, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = -0.25, + sizemod = 1, + texture = [[smoke_puff]], + useairlos = true, + --castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 7, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + rotParams = [[-180 r360, -90 r180, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + castShadow = false, + }, + }, + }, + ["missiletrailmedium-smoke"] = { -- used by gadget: fx_missile_smoke + exhaustengine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-12 r1]], + sidetexture = [[muzzleside]], + size = 2.75, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 1, + }, + }, + --smoke = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.92, + -- colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 8, + -- emitvector = [[dir]], + -- gravity = [[0.0, -0.02, 0.0]], + -- numparticles = 1, + -- particlelife = 9, + -- particlelifespread = 4, + -- particlesize = 3, + -- particlesizespread = 3, + -- particlespeed = 1, + -- particlespeedspread = 1, + -- pos = [[-15 r30, -15 r30, -15 r30]], + -- sizegrowth = 0.2, + -- sizemod = 1, + -- texture = [[smoke]], + -- useairlos = true, + -- }, + --}, + }, - ["missiletrailbomber"] = { - coreflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 0, - particlesize = 5, - particlesizespread = 1, - particlespeed = 0, - particlespeedspread = 5, - pos = [[0, 1, 0]], - sizegrowth = 0.50, - sizemod = 1.0, - texture = [[smoke]], - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 7, - particlesize = 13, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 5, - pos = [[0, 1, 0]], - sizegrowth = 0.50, - sizemod = 1.0, - texture = [[smoke]], - }, - }, - }, + ["missiletraillarge"] = { + fire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.75 0.33 0.01 0.44 0.26 0.09 0.01 0.14 0.04 0.01 0.01 0.02 0.01 0.006 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 3.3, + particlesizespread = 2.5, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0.0, 88, 0.0]], + sizegrowth = -0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.18 0.07 0.012 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 88, + particlesizespread = 7, + particlespeed = 16, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.7 0.5 0.01 0.9 0.4 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = [[2 r2]], + particlelife = 1, + particlelifespread = 2, + particlesize = 25, + particlesizespread = 33, + particlespeed = 1, + particlespeedspread = 3, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = -1, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.006 0.006 0.006 0 0.05 0.04 0.033 0.6 0.04 0.038 0.034 0.5 0.04 0.036 0.032 0.33 0.015 0.015 0.015 0.15 0.014 0.014 0.014 0.1 0.006 0.006 0.006 0.04 0 0 0 0.01]], + directional = false, + emitrot = -120, + emitrotspread = 10, + emitvector = [[0, 0.5, 0]], + gravity = [[0.0, 0.02, 0.0]], + numparticles = [[3 r2]], + particlelife = 6, + particlelifespread = 11, + particlesize = 2.5, + particlesizespread = 3, + particlespeed = 2, + particlespeedspread = 6, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-30 r60, -15 r30, -30 r60]], + sizegrowth = 0.44, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.006 0.006 0.006 0.05 0.12 0.09 0.08 0.4 0.095 0.085 0.07 0.33 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.027 0.08 0.012 0.012 0.012 0.04 0 0 0 0.01]], + directional = false, + emitrot = -120, + emitrotspread = 10, + emitvector = [[0, 0.5, 0]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = 3, + particlelife = 4, + particlelifespread = 5, + particlesize = 4, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 6, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-30 r60, -15 r30, -30 r60]], + sizegrowth = 0.75, + sizemod = 1, + texture = [[smoke_puff]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0.5 0.45 0.4 0.01 1 0.75 0.5 0.03 0.77 0.44 0.33 0.18 0.5 0.27 0.22 0.15 0.17 0.1 0.1 0.1 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 28, + emitvector = [[1, 1, 1]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 8, + particlesize = 3.9, + particlesizespread = 1.2, + particlespeed = 0.15, + particlespeedspread = 0.4, + rotParams = [[-120 r240, -120 r240, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 0.35, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + ["missiletraillarge-smoke"] = { -- used by gadget: fx_missile_smoke + exhaustengine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-20 r1]], + sidetexture = [[muzzleside]], + size = 3.6, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 2, + }, + }, + }, - ["missiletrailaa"] = { - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - --colormap = [[1 0.5 0.1 0.01 1.0 0.4 0.05 0.01 1.0 0.2 0.02 0.01 0.5 0.1 0 0.01 0 0 0 0.01]], - colormap = [[1 0.5 0.85 0.0 1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = 32, - sidetexture = [[muzzlesideflipped]], - size = 2.8, - sizegrowth = 0, - ttl = 1, - }, - }, - }, - ["missiletrailaa-smoke"] = { -- used by gadget: fx_missile_smoke - trail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.03 0.021 0.028 0.08 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = -24, - sidetexture = [[smoketrail]], - size = 1.66, - sizegrowth = -0.03, - ttl = 8.5, - }, - }, - }, + ["missiletrailbomber"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 7, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + }, - ["flaktrailaa"] = { - trail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.4 0.8 0.22 0.68 0.2 0.40 0.11 0.34 0.1 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = -2.8, - --lengthgrowth = -4.5, - sidetexture = [[trail3]], - size = 4.2, - sizegrowth = -0.08, - ttl = 2, - pos = [[0, -2, 0]], - }, - }, - }, + ["missiletrailaa"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + --colormap = [[1 0.5 0.1 0.01 1.0 0.4 0.05 0.01 1.0 0.2 0.02 0.01 0.5 0.1 0 0.01 0 0 0 0.01]], + colormap = [[1 0.5 0.85 0.0 1 0.5 0.85 0.01 1.0 0.4 0.85 0.01 1.0 0.2 0.8 0.01 0.5 0.1 0.4 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 32, + sidetexture = [[muzzlesideflipped]], + size = 2.8, + sizegrowth = 0, + ttl = 1, + }, + }, + }, + ["missiletrailaa-smoke"] = { -- used by gadget: fx_missile_smoke + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.03 0.021 0.028 0.08 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -24, + sidetexture = [[smoketrail]], + size = 1.66, + sizegrowth = -0.03, + ttl = 8.5, + }, + }, + }, - ["flaktrailaamg"] = { - trail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.4 0.8 0.22 0.68 0.2 0.40 0.11 0.34 0.1 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = 1.2, - -- lengthgrowth = -4.5, - sidetexture = [[trail3]], - size = 1.2, - sizegrowth = -0.08, - ttl = 2, - pos = [[0, 2, 0]], - }, - }, - }, + ["flaktrailaa"] = { + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.4 0.8 0.22 0.68 0.2 0.40 0.11 0.34 0.1 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -2.8, + --lengthgrowth = -4.5, + sidetexture = [[trail3]], + size = 4.2, + sizegrowth = -0.08, + ttl = 2, + pos = [[0, -2, 0]], + }, + }, + }, - ["missiletrailaa-medium"] = { - -- fire = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0.9 0.7 0.75 0.15 0.44 0.26 0.36 0.2 0.14 0.04 0.115 0.17 0.02 0.01 0.0165 0.1 0 0 0 0.01]], - -- directional = false, - -- emitrot = 180, - -- emitrotspread = 45, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.06, 0.0]], - -- numparticles = 3, - -- particlelife = 4, - -- particlelifespread = 4, - -- particlesize = 3.5, - -- particlesizespread = 8, - -- particlespeed = 1, - -- particlespeedspread = 5, - -- rotParams = [[-80 r160, -30 r60, -180 r360]], - -- pos = [[-40 r80, 88, -40 r80]], - -- sizegrowth = -0.2, - -- sizemod = 1, - -- texture = [[lightning]], - -- useairlos = true, - -- }, - -- }, + ["flaktrailaamg"] = { + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.0 0.90 0.35 0.80 0.4 0.8 0.22 0.68 0.2 0.40 0.11 0.34 0.1 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = 1.2, + -- lengthgrowth = -4.5, + sidetexture = [[trail3]], + size = 1.2, + sizegrowth = -0.08, + ttl = 2, + pos = [[0, 2, 0]], + }, + }, + }, - -- fireglow = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 1, - -- colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 0, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.0, 0.0]], - -- numparticles = 1, - -- particlelife = 1, - -- particlelifespread = 0, - -- particlesize = 80, - -- particlesizespread = 7, - -- particlespeed = 16, - -- particlespeedspread = 0, - -- pos = [[0.0, 0, 0.0]], - -- sizegrowth = -0.5, - -- sizemod = 1, - -- texture = [[circularthingy]], - -- useairlos = true, - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0 0 0 0.01 0 0 0 0.01 0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 1, - particlesize = 24, - particlesizespread = 8, - particlespeed = 4, - particlespeedspread = 7, - pos = [[0, 90 ,0]], - sizegrowth = 1.75, - sizemod = 0.84, - texture = [[gunshotxl2]], - useairlos = true, - }, - }, - }, + ["missiletrailaa-medium"] = { + -- fire = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0.9 0.7 0.75 0.15 0.44 0.26 0.36 0.2 0.14 0.04 0.115 0.17 0.02 0.01 0.0165 0.1 0 0 0 0.01]], + -- directional = false, + -- emitrot = 180, + -- emitrotspread = 45, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.06, 0.0]], + -- numparticles = 3, + -- particlelife = 4, + -- particlelifespread = 4, + -- particlesize = 3.5, + -- particlesizespread = 8, + -- particlespeed = 1, + -- particlespeedspread = 5, + -- rotParams = [[-80 r160, -30 r60, -180 r360]], + -- pos = [[-40 r80, 88, -40 r80]], + -- sizegrowth = -0.2, + -- sizemod = 1, + -- texture = [[lightning]], + -- useairlos = true, + -- }, + -- }, - ["missiletrailaa-large"] = { + -- fireglow = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 1, + -- colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 0, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.0, 0.0]], + -- numparticles = 1, + -- particlelife = 1, + -- particlelifespread = 0, + -- particlesize = 80, + -- particlesizespread = 7, + -- particlespeed = 16, + -- particlespeedspread = 0, + -- pos = [[0.0, 0, 0.0]], + -- sizegrowth = -0.5, + -- sizemod = 1, + -- texture = [[circularthingy]], + -- useairlos = true, + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 1, + particlesize = 24, + particlesizespread = 8, + particlespeed = 4, + particlespeedspread = 7, + pos = [[0, 90 ,0]], + sizegrowth = 1.75, + sizemod = 0.84, + texture = [[gunshotxl2]], + useairlos = true, + }, + }, + }, - -- fire = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0.9 0.7 0.75 0.15 0.44 0.26 0.36 0.2 0.14 0.04 0.115 0.17 0.02 0.01 0.0165 0.1 0 0 0 0.01]], - -- directional = false, - -- emitrot = 180, - -- emitrotspread = 45, - -- emitvector = [[dir]], - -- gravity = [[0.0, 0.06, 0.0]], - -- numparticles = 3, - -- particlelife = 4, - -- particlelifespread = 4, - -- particlesize = 5, - -- particlesizespread = 12, - -- particlespeed = 1, - -- particlespeedspread = 5, - -- rotParams = [[-80 r160, -30 r60, -180 r360]], - -- pos = [[-40 r80, 88, -40 r80]], - -- sizegrowth = -0.2, - -- sizemod = 1, - -- texture = [[lightning]], - -- useairlos = true, - -- }, - -- }, + ["missiletrailaa-large"] = { - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 80, - particlesizespread = 7, - particlespeed = 16, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 1, - particlesize = 75, - particlesizespread = 30, - particlespeed = 4, - particlespeedspread = 7, - pos = [[0, 90 ,0]], - sizegrowth = 1.75, - sizemod = 0.88, - texture = [[gunshotxl2]], - useairlos = true, - }, - }, - --smoke = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.915, - -- colormap = [[0.16 0.13 0.1 0.2 0.16 0.13 0.1 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.07 0.07 0.07 0.17 0.04 0.04 0.04 0.1 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 11, - -- emitvector = [[dir]], - -- gravity = [[0.0, -0.03, 0.0]], - -- numparticles = 2, - -- particlelife = 22, - -- particlelifespread = 15, - -- particlesize = 4, - -- particlesizespread = 9, - -- particlespeed = 5.25, - -- particlespeedspread = 8.5, - -- pos = [[0.0, 0, 0.0]], - -- sizegrowth = 0.22, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - --}, - }, + -- fire = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0.9 0.7 0.75 0.15 0.44 0.26 0.36 0.2 0.14 0.04 0.115 0.17 0.02 0.01 0.0165 0.1 0 0 0 0.01]], + -- directional = false, + -- emitrot = 180, + -- emitrotspread = 45, + -- emitvector = [[dir]], + -- gravity = [[0.0, 0.06, 0.0]], + -- numparticles = 3, + -- particlelife = 4, + -- particlelifespread = 4, + -- particlesize = 5, + -- particlesizespread = 12, + -- particlespeed = 1, + -- particlespeedspread = 5, + -- rotParams = [[-80 r160, -30 r60, -180 r360]], + -- pos = [[-40 r80, 88, -40 r80]], + -- sizegrowth = -0.2, + -- sizemod = 1, + -- texture = [[lightning]], + -- useairlos = true, + -- }, + -- }, - ["sporetrail-large"] = { - --groundflash = { - -- circlealpha = 0, - -- circlegrowth = 0, - -- flashalpha = 0.05, - -- flashsize = 85, - -- ttl = 10, - -- color = { - -- [1] = 0.80000001192093, - -- [2] = 0.50000000149012, - -- [3] = 0.15, - -- }, - --}, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 80, + particlesizespread = 7, + particlespeed = 16, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 1, + particlesize = 75, + particlesizespread = 30, + particlespeed = 4, + particlespeedspread = 7, + pos = [[0, 90 ,0]], + sizegrowth = 1.75, + sizemod = 0.88, + texture = [[gunshotxl2]], + useairlos = true, + }, + }, + --smoke = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.915, + -- colormap = [[0.16 0.13 0.1 0.2 0.16 0.13 0.1 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.07 0.07 0.07 0.17 0.04 0.04 0.04 0.1 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 11, + -- emitvector = [[dir]], + -- gravity = [[0.0, -0.03, 0.0]], + -- numparticles = 2, + -- particlelife = 22, + -- particlelifespread = 15, + -- particlesize = 4, + -- particlesizespread = 9, + -- particlespeed = 5.25, + -- particlespeedspread = 8.5, + -- pos = [[0.0, 0, 0.0]], + -- sizegrowth = 0.22, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + --}, + }, - --engineglow = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.9 0.27 0.79 0.01 0.45 0.13 0.37 0.01 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -5.5, - -- --lengthgrowth = -4.5, - -- sidetexture = [[glow2]], - -- size = 3.5, - -- sizegrowth = -0.01, - -- ttl = 12, - -- useairlos = true, - -- -- pos = [[5, 0, 0]], - -- }, - -- }, + ["sporetrail-large"] = { + --groundflash = { + -- circlealpha = 0, + -- circlegrowth = 0, + -- flashalpha = 0.05, + -- flashsize = 85, + -- ttl = 10, + -- color = { + -- [1] = 0.80000001192093, + -- [2] = 0.50000000149012, + -- [3] = 0.15, + -- }, + --}, - fire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.90, - colormap = [[0.95 0.8 0.29 0.15 0.86 0.56 0.13 0.2 0.7 0.38 0.1 0.17 0.49 0.28 0.09 0.1 0 0 0 0.01]], - directional = false, - emitrot = 180, - emitrotspread = 45, - emitvector = [[dir]], - gravity = [[0.0, 0.06, 0.0]], - numparticles = 2, - particlelife = 8, - particlelifespread = 9, - particlesize = 4.5, - particlesizespread = 16, - particlespeed = 0.7, - particlespeedspread = 2.5, - rotParams = [[-80 r160, -30 r60, -180 r360]], - pos = [[-30 r60, 40, -30 r60]], - sizegrowth = -0.15, - sizemod = 1, - texture = [[bloodblast2white]], - useairlos = true, - }, - }, + --engineglow = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.9 0.27 0.79 0.01 0.45 0.13 0.37 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -5.5, + -- --lengthgrowth = -4.5, + -- sidetexture = [[glow2]], + -- size = 3.5, + -- sizegrowth = -0.01, + -- ttl = 12, + -- useairlos = true, + -- -- pos = [[5, 0, 0]], + -- }, + -- }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 90, - particlesizespread = 7, - particlespeed = 16, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[circularthingy]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 0, - particlesize = 110, - particlesizespread = 30, - particlespeed = 4, - particlespeedspread = 7, - pos = [[0, 90 ,0]], - sizegrowth = 2, - sizemod = 0.8, - texture = [[gunshotxl2]], - useairlos = true, - }, - }, - --smoke = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- properties = { - -- airdrag = 0.915, - -- colormap = [[0.16 0.13 0.1 0.2 0.16 0.13 0.1 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.07 0.07 0.07 0.17 0.04 0.04 0.04 0.1 0 0 0 0.01]], - -- directional = true, - -- emitrot = -180, - -- emitrotspread = 11, - -- emitvector = [[dir]], - -- gravity = [[0.0, -0.03, 0.0]], - -- numparticles = 2, - -- particlelife = 22, - -- particlelifespread = 15, - -- particlesize = 4, - -- particlesizespread = 9, - -- particlespeed = 5.25, - -- particlespeedspread = 8.5, - -- pos = [[0.0, 0, 0.0]], - -- sizegrowth = 0.22, - -- sizemod = 1, - -- texture = [[dirt]], - -- useairlos = true, - -- }, - --}, - }, + fire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.90, + colormap = [[0.95 0.8 0.29 0.15 0.86 0.56 0.13 0.2 0.7 0.38 0.1 0.17 0.49 0.28 0.09 0.1 0 0 0 0.01]], + directional = false, + emitrot = 180, + emitrotspread = 45, + emitvector = [[dir]], + gravity = [[0.0, 0.06, 0.0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 9, + particlesize = 4.5, + particlesizespread = 16, + particlespeed = 0.7, + particlespeedspread = 2.5, + rotParams = [[-80 r160, -30 r60, -180 r360]], + pos = [[-30 r60, 40, -30 r60]], + sizegrowth = -0.15, + sizemod = 1, + texture = [[bloodblast2white]], + useairlos = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.125 0.08 0.17 0.30 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 90, + particlesizespread = 7, + particlespeed = 16, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[circularthingy]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.7 0.1 0.9 0.4 0.6 0.08 0.25 0.1 0.2 0.005 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 0, + particlesize = 110, + particlesizespread = 30, + particlespeed = 4, + particlespeedspread = 7, + pos = [[0, 90 ,0]], + sizegrowth = 2, + sizemod = 0.8, + texture = [[gunshotxl2]], + useairlos = true, + }, + }, + --smoke = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- properties = { + -- airdrag = 0.915, + -- colormap = [[0.16 0.13 0.1 0.2 0.16 0.13 0.1 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.07 0.07 0.07 0.17 0.04 0.04 0.04 0.1 0 0 0 0.01]], + -- directional = true, + -- emitrot = -180, + -- emitrotspread = 11, + -- emitvector = [[dir]], + -- gravity = [[0.0, -0.03, 0.0]], + -- numparticles = 2, + -- particlelife = 22, + -- particlelifespread = 15, + -- particlesize = 4, + -- particlesizespread = 9, + -- particlespeed = 5.25, + -- particlespeedspread = 8.5, + -- pos = [[0.0, 0, 0.0]], + -- sizegrowth = 0.22, + -- sizemod = 1, + -- texture = [[dirt]], + -- useairlos = true, + -- }, + --}, + }, - ["nuketrail"] = { - groundflash = { - circlealpha = 0, - circlegrowth = 0, - flashalpha = 0.06, - flashsize = 15, - ttl = 30, - color = { - [1] = 1, - [2] = 0.8, - [3] = 0.3, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.84, - colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0]], - directional = true, - emitrot = -180, - emitrotspread = 4, - emitvector = [[dir]], - gravity = [[0, -0.03, 0]], - numparticles = 2, - particlelife = 3, - particlelifespread = 5, - particlesize = 25, - particlesizespread = 35, - particlespeed = 16, - particlespeedspread = 8, - pos = [[-33 r66, -33 r66, -33 r66]], - sizegrowth = 1, - sizemod = 0.66, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - fire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[1 0.88 0.7 0.05 0.55 0.4 0.06 0.035 0.3 0.14 0 0.02 0.08 0.022 0 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0.0, 0.01, 0.0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 5, - particlesizespread = 6, - particlespeed = 5, - particlespeedspread = 10, - pos = [[0.0, 0, 0.0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = -0.25, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.6 0.4 0.04 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 150, - particlesizespread = 20, - particlespeed = 20, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.4, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, + ["nuketrail"] = { + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.06, + flashsize = 15, + ttl = 30, + color = { + [1] = 1, + [2] = 0.8, + [3] = 0.3, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.84, + colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0]], + directional = true, + emitrot = -180, + emitrotspread = 4, + emitvector = [[dir]], + gravity = [[0, -0.03, 0]], + numparticles = 2, + particlelife = 3, + particlelifespread = 5, + particlesize = 25, + particlesizespread = 35, + particlespeed = 16, + particlespeedspread = 8, + pos = [[-33 r66, -33 r66, -33 r66]], + sizegrowth = 1, + sizemod = 0.66, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + fire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[1 0.88 0.7 0.05 0.55 0.4 0.06 0.035 0.3 0.14 0 0.02 0.08 0.022 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0.01, 0.0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 5, + particlesizespread = 6, + particlespeed = 5, + particlespeedspread = 10, + pos = [[0.0, 0, 0.0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = -0.25, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.6 0.4 0.04 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 150, + particlesizespread = 20, + particlespeed = 20, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.4, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.1 0.1 0.1 0.005 0.4 0.4 0.4 0.01 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 10, - emitvector = [[1, 1, 1]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 4, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.1 0.1 0.1 0.005 0.4 0.4 0.4 0.01 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 10, + emitvector = [[1, 1, 1]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 4, particlelifespread = 7, - particlesize = 7, + particlesize = 7, particlesizespread = 5, - particlespeed = 0.04, + particlespeed = 0.04, particlespeedspread = 0.12, - pos = [[0, 0, 0]], - sizegrowth = 0.01, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.01 0.01 0.01 0 0.035 0.03 0.02 0.15 0.04 0.035 0.025 0.22 0.03 0.03 0.03 0.12 0.01 0.01 0.01 0.04 0 0 0 0]], - directional = false, - emitrot = -180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0, 0.05, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 6, - particlesize = 3, - particlesizespread = 4, - particlespeed = 6, - particlespeedspread = 11, - pos = [[-33 r66, -33 r66, -33 r66]], - rotParams = [[-48 r96, -10 r20, -180 r360]], - sizegrowth = 0.55, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, + pos = [[0, 0, 0]], + sizegrowth = 0.01, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.01 0.01 0.01 0 0.035 0.03 0.02 0.15 0.04 0.035 0.025 0.22 0.03 0.03 0.03 0.12 0.01 0.01 0.01 0.04 0 0 0 0]], + directional = false, + emitrot = -180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 6, + particlesize = 3, + particlesizespread = 4, + particlespeed = 6, + particlespeedspread = 11, + pos = [[-33 r66, -33 r66, -33 r66]], + rotParams = [[-48 r96, -10 r20, -180 r360]], + sizegrowth = 0.55, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.95, - colormap = [[0.05 0.04 0.01 0.01 0.05 0.04 0.034 0.33 0.05 0.04 0.034 0.33 0.04 0.035 0.025 0.36 0.05 0.05 0.05 0.19 0.015 0.015 0.015 0.05 0 0 0 0]], - directional = false, - emitrot = -180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0, 0.05, 0]], - numparticles = 1, - particlelife = 4, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.95, + colormap = [[0.05 0.04 0.01 0.01 0.05 0.04 0.034 0.33 0.05 0.04 0.034 0.33 0.04 0.035 0.025 0.36 0.05 0.05 0.05 0.19 0.015 0.015 0.015 0.05 0 0 0 0]], + directional = false, + emitrot = -180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 1, + particlelife = 4, particlelifespread = 6, - particlesize = 3, + particlesize = 3, particlesizespread = 4, - particlespeed = 6, + particlespeed = 6, particlespeedspread = 9, - pos = [[-33 r66, -33 r66, -33 r66]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = 0.55, - sizemod = 1, - texture = [[smoke]], + pos = [[-33 r66, -33 r66, -33 r66]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = 0.55, + sizemod = 1, + texture = [[smoke]], }, }, - }, + }, - ["nuketrail-starburst"] = { - groundflash = { - circlealpha = 0, - circlegrowth = 0, - flashalpha = 0.06, - flashsize = 15, - ttl = 30, - color = { - [1] = 1, - [2] = 0.8, - [3] = 0.3, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.84, - colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.5 0.1 0.1 0]], - directional = true, - emitrot = 180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0, -0.03, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 5, - particlesize = 66, - particlesizespread = 66, - particlespeed = 17, - particlespeedspread = 10, - pos = [[0, 0, 0]], - sizegrowth = 1, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - smokeandfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.7 0.6 0.45 0.2 0.44 0.33 0.06 0.2 0.34 0.15 0 0.15 0.09 0.025 0 0.11 0.015 0.01 0 0.05 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 5.5, - emitvector = [[dir]], - gravity = [[0.0, 0.01, 0.0]], - numparticles = 2, - particlelife = 9, - particlelifespread = 5, - particlesize = 9, - particlesizespread = 6.5, - particlespeed = 8, - particlespeedspread = 16, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.52, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.36 0.23 0.045 0.01 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 0, - particlesize = 210, - particlesizespread = 20, - particlespeed = 20, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.4, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.85, - colormap = [[0.027 0.024 0.022 0.08 0.06 0.058 0.055 0.07 0.02 0.02 0.02 0.025 0 0 0 0]], - directional = true, - emitrot = 90, - emitrotspread = 52, - emitvector = [[0, 0.22, 0]], - gravity = [[0, 0.05, 0]], - numparticles = 1, - particlelife = 70, - particlelifespread = 40, - particlesize = 9, - particlesizespread = 9, - particlespeed = 1.7, - particlespeedspread = 3, - pos = [[0, 1, 0]], - sizegrowth = 0.1, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, - }, - - ["missiletrailgunship"] = { -- unused - coreflame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 4, - particlelife = 50, - particlelifespread = 0, - particlesize = 5, - particlesizespread = 1, - particlespeed = 0, - particlespeedspread = 5, - pos = [[0, 1, 0]], - sizegrowth = 0.4, - sizemod = 1.0, - texture = [[smoke]], - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.5 0.2 0.12 0.15 0.15 0.15 0.22 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 3, - particlelife = 100, - particlelifespread = 15, - particlesize = 10, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 5, - pos = [[0, 1, 0]], - sizegrowth = 0.4, - sizemod = 1.0, - texture = [[smoke]], - }, - }, - coreflame2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 2, - particlelife = 20, - particlelifespread = 0, - particlesize = 1, - particlesizespread = 1, - particlespeed = 1, - particlespeedspread = 1, - pos = [[0, 1, 0]], - sizegrowth = 0.4, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 3, - particlelife = 22, - particlelifespread = 11, - particlesize = 2, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - }, - ["cruisemissiletrail"] = { - groundflash = { - circlealpha = 0, - circlegrowth = 0, - flashalpha = 0.13, - flashsize = 90, - ttl = 10, - color = { - [1] = 0.80000001192093, - [2] = 0.50000000149012, - [3] = 0.15, - }, - }, - smokeandfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.7 0.6 0.45 0.01 0.44 0.33 0.06 0.01 0.34 0.15 0 0.01 0.09 0.025 0 0.01 0.05 0.01 0 0.01 0.02 0.008 0 0.01 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, 0.01, 0.0]], - numparticles = 3, - particlelife = 7, - particlelifespread = 3, - particlesize = 5.5, - particlesizespread = 3.3, - particlespeed = 3, - particlespeedspread = 10, - pos = [[0.0, 0, 0.0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.3 0.01 0.6 0.35 0.1 0.01 0.5 0.1 0.1 0]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, -0.03, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 30, - particlesizespread = 30, - particlespeed = 13, - particlespeedspread = 6, - pos = [[0, 0, 0]], - sizegrowth = -2.6, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - sparks2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.3 0.01 0.6 0.35 0.1 0.01 0.5 0.1 0.1 0]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, -0.03, 0]], - numparticles = 1, - particlelife = 6, - particlelifespread = 6, - particlesize = 15, - particlesizespread = 15, - particlespeed = 23, - particlespeedspread = 15, - pos = [[0, 0, 0]], - sizegrowth = -2.6, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.15 0.095 0.02 0.01 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 70, - particlesizespread = 12, - particlespeed = 20, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - fireglowbright = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.35 0.45 0.75 0.04 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = [[0.9 r0.6]], - particlelife = 8, - particlelifespread = 3, - particlesize = 50, - particlesizespread = 24, - particlespeed = 6, - particlespeedspread = 5, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.40, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - drawOrder = 1, - }, - }, - exhale4 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.03 0.03 0.03 0.12 0.07 0.07 0.07 0.3 0.11 0.11 0.11 0.25 0.06 0.06 0.06 0.17 0.035 0.035 0.035 0.09 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0.0, -0.03, 0.0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 10, - particlesize = 6, - particlesizespread = 3.5, - particlespeed = 3, - particlespeedspread = 6, - pos = [[0.0, 1, 0.0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.03 0.03 0.03 0.07 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.15 0.098 0.08 0.08 0.1 0.05 0.05 0.05 0.05 0 0 0 0]], - directional = true, - emitrot = 180, - emitrotspread = 13, - emitvector = [[dir]], - gravity = [[0, -0.04, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 9, - particlesize = 5, - particlesizespread = 2.5, - particlespeed = 2, - particlespeedspread = 5, - pos = [[0, 1, 0]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.4 0.4 0.4 0.01 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 9, - emitvector = [[1, 1, 1]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 5, - particlelifespread = 3.5, - particlesize = 5.8, - particlesizespread = 1.3, - particlespeed = 0.04, - particlespeedspread = 0.12, - pos = [[0, 0, 0]], - rotParams = [[-24 r48, -10 r20, -180 r360]], - sizegrowth = 0.01, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - --dustparticles2 = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.77, - -- colormap = [[0.55 0.55 0.55 0.02 0.4 0.4 0.4 0.13 0.15 0.15 0.15 0.08 0 0 0 0]], - -- directional = false, - -- emitrot = 80, - -- emitrotspread = 5, - -- emitvector = [[1, 1, 1]], - -- gravity = [[0, -0.015, 0]], - -- numparticles = 2, - -- particlelife = 38, - -- particlelifespread = 9, - -- particlesize = 4.2, - -- particlesizespread = 1, - -- particlespeed = 0.24, - -- particlespeedspread = 0.11, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.033, - -- sizemod = 1.0, - -- texture = [[randomdots]], - -- }, - --}, - }, - - ["cruisemissiletrail-starburst"] = { - groundflash = { - circlealpha = 0, - circlegrowth = 0, - flashalpha = 0.13, - flashsize = 90, - ttl = 10, - color = { - [1] = 0.80000001192093, - [2] = 0.50000000149012, - [3] = 0.15, - }, - }, - smokeandfire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.7 0.6 0.45 0.2 0.44 0.33 0.06 0.2 0.34 0.15 0 0.15 0.09 0.025 0 0.11 0.05 0.01 0 0.09 0.02 0.008 0 0.06 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, 0.01, 0.0]], - numparticles = 3, - particlelife = 7, - particlelifespread = 3, - particlesize = 6.5, - particlesizespread = 4, - particlespeed = 5, - particlespeedspread = 15, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.5 0.1 0.1 0]], - directional = true, - emitrot = 180, - emitrotspread = 6, - emitvector = [[dir]], - gravity = [[0, -0.03, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 3, - particlesize = 55, - particlesizespread = 40, - particlespeed = 18, - particlespeedspread = 9, - pos = [[0, 0, 0]], - sizegrowth = -2.6, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0.15 0.095 0.02 0.01 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 0, - emitvector = [[dir]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 90, - particlesizespread = 18, - particlespeed = 20, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = true, - }, - }, - exhale4 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.03 0.03 0.03 0.12 0.07 0.07 0.07 0.3 0.11 0.11 0.11 0.25 0.06 0.06 0.06 0.17 0.035 0.035 0.035 0.09 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0.0, -0.03, 0.0]], - numparticles = 1, - particlelife = 31, - particlelifespread = 13, - particlesize = 6, - particlesizespread = 3.5, - particlespeed = 5, - particlespeedspread = 10, - pos = [[0.0, 1, 0.0]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.03 0.03 0.03 0.07 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.15 0.098 0.08 0.08 0.1 0.05 0.05 0.05 0.05 0 0 0 0]], - directional = true, - emitrot = 180, - emitrotspread = 13, - emitvector = [[dir]], - gravity = [[0, -0.04, 0]], - numparticles = 1, - particlelife = 27, - particlelifespread = 11, - particlesize = 5, - particlesizespread = 2.5, - particlespeed = 3.4, - particlespeedspread = 7.5, - pos = [[0, 1, 0]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.8, - colormap = [[0.4 0.4 0.4 0.008 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 9, - emitvector = [[1, 1, 1]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 3.5, - particlesize = 5.8, - particlesizespread = 1.3, - particlespeed = 0.08, - particlespeedspread = 0.16, - pos = [[0, 0, 0]], - sizegrowth = 0.01, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - --dustparticles2 = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.77, - -- colormap = [[0.55 0.55 0.55 0.02 0.4 0.4 0.4 0.13 0.15 0.15 0.15 0.08 0 0 0 0]], - -- directional = false, - -- emitrot = 80, - -- emitrotspread = 5, - -- emitvector = [[1, 1, 1]], - -- gravity = [[0, -0.015, 0]], - -- numparticles = 2, - -- particlelife = 38, - -- particlelifespread = 9, - -- particlesize = 4.2, - -- particlesizespread = 1, - -- particlespeed = 0.24, - -- particlespeedspread = 0.11, - -- pos = [[0, 1, 0]], - -- sizegrowth = 0.033, - -- sizemod = 1.0, - -- texture = [[randomdots]], - -- }, - --}, - }, + ["nuketrail-starburst"] = { + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.06, + flashsize = 15, + ttl = 30, + color = { + [1] = 1, + [2] = 0.8, + [3] = 0.3, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.84, + colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.5 0.1 0.1 0]], + directional = true, + emitrot = 180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, -0.03, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 5, + particlesize = 66, + particlesizespread = 66, + particlespeed = 17, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.7 0.6 0.45 0.2 0.44 0.33 0.06 0.2 0.34 0.15 0 0.15 0.09 0.025 0 0.11 0.015 0.01 0 0.05 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 5.5, + emitvector = [[dir]], + gravity = [[0.0, 0.01, 0.0]], + numparticles = 2, + particlelife = 9, + particlelifespread = 5, + particlesize = 9, + particlesizespread = 6.5, + particlespeed = 8, + particlespeedspread = 16, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.52, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.36 0.23 0.045 0.01 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 210, + particlesizespread = 20, + particlespeed = 20, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.4, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.85, + colormap = [[0.027 0.024 0.022 0.08 0.06 0.058 0.055 0.07 0.02 0.02 0.02 0.025 0 0 0 0]], + directional = true, + emitrot = 90, + emitrotspread = 52, + emitvector = [[0, 0.22, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 40, + particlesize = 9, + particlesizespread = 9, + particlespeed = 1.7, + particlespeedspread = 3, + pos = [[0, 1, 0]], + sizegrowth = 0.1, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, + }, + ["missiletrailgunship"] = { -- unused + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 50, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.12 0.15 0.15 0.15 0.22 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 100, + particlelifespread = 15, + particlesize = 10, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + coreflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 3, + particlelife = 22, + particlelifespread = 11, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + ["cruisemissiletrail"] = { + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.13, + flashsize = 90, + ttl = 10, + color = { + [1] = 0.80000001192093, + [2] = 0.50000000149012, + [3] = 0.15, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.7 0.6 0.45 0.01 0.44 0.33 0.06 0.01 0.34 0.15 0 0.01 0.09 0.025 0 0.01 0.05 0.01 0 0.01 0.02 0.008 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.01, 0.0]], + numparticles = 3, + particlelife = 7, + particlelifespread = 3, + particlesize = 5.5, + particlesizespread = 3.3, + particlespeed = 3, + particlespeedspread = 10, + pos = [[0.0, 0, 0.0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.3 0.01 0.6 0.35 0.1 0.01 0.5 0.1 0.1 0]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, -0.03, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 30, + particlesizespread = 30, + particlespeed = 13, + particlespeedspread = 6, + pos = [[0, 0, 0]], + sizegrowth = -2.6, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + sparks2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.3 0.01 0.6 0.35 0.1 0.01 0.5 0.1 0.1 0]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, -0.03, 0]], + numparticles = 1, + particlelife = 6, + particlelifespread = 6, + particlesize = 15, + particlesizespread = 15, + particlespeed = 23, + particlespeedspread = 15, + pos = [[0, 0, 0]], + sizegrowth = -2.6, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.15 0.095 0.02 0.01 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 70, + particlesizespread = 12, + particlespeed = 20, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + fireglowbright = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.35 0.45 0.75 0.04 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = [[0.9 r0.6]], + particlelife = 8, + particlelifespread = 3, + particlesize = 50, + particlesizespread = 24, + particlespeed = 6, + particlespeedspread = 5, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.40, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + drawOrder = 1, + }, + }, + exhale4 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.03 0.03 0.03 0.12 0.07 0.07 0.07 0.3 0.11 0.11 0.11 0.25 0.06 0.06 0.06 0.17 0.035 0.035 0.035 0.09 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, -0.03, 0.0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 10, + particlesize = 6, + particlesizespread = 3.5, + particlespeed = 3, + particlespeedspread = 6, + pos = [[0.0, 1, 0.0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.03 0.03 0.03 0.07 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.15 0.098 0.08 0.08 0.1 0.05 0.05 0.05 0.05 0 0 0 0]], + directional = true, + emitrot = 180, + emitrotspread = 13, + emitvector = [[dir]], + gravity = [[0, -0.04, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 9, + particlesize = 5, + particlesizespread = 2.5, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.01 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 9, + emitvector = [[1, 1, 1]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 3.5, + particlesize = 5.8, + particlesizespread = 1.3, + particlespeed = 0.04, + particlespeedspread = 0.12, + pos = [[0, 0, 0]], + rotParams = [[-24 r48, -10 r20, -180 r360]], + sizegrowth = 0.01, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + --dustparticles2 = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.77, + -- colormap = [[0.55 0.55 0.55 0.02 0.4 0.4 0.4 0.13 0.15 0.15 0.15 0.08 0 0 0 0]], + -- directional = false, + -- emitrot = 80, + -- emitrotspread = 5, + -- emitvector = [[1, 1, 1]], + -- gravity = [[0, -0.015, 0]], + -- numparticles = 2, + -- particlelife = 38, + -- particlelifespread = 9, + -- particlesize = 4.2, + -- particlesizespread = 1, + -- particlespeed = 0.24, + -- particlespeedspread = 0.11, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.033, + -- sizemod = 1.0, + -- texture = [[randomdots]], + -- }, + --}, + }, - ["missiletrail-grenadesmoke"] = { -- used by grenades - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[0, 0.7 ,0]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-8.5 r1]], - sidetexture = [[muzzleside]], - size = 2.1, - sizegrowth = [[0.2 r0.3]], - pos = [[0, 0.01 ,0]], - ttl = 1, - drawOrder = 2, - }, - }, - --trail = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.09 0.035 0.025 0.015 0.07 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -50, - -- sidetexture = [[smoketrail]], - -- size = 2.50, - -- sizegrowth = -0.055, - -- ttl = 3, - -- }, - --}, - }, + ["cruisemissiletrail-starburst"] = { + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.13, + flashsize = 90, + ttl = 10, + color = { + [1] = 0.80000001192093, + [2] = 0.50000000149012, + [3] = 0.15, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.7 0.6 0.45 0.2 0.44 0.33 0.06 0.2 0.34 0.15 0 0.15 0.09 0.025 0 0.11 0.05 0.01 0 0.09 0.02 0.008 0 0.06 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.01, 0.0]], + numparticles = 3, + particlelife = 7, + particlelifespread = 3, + particlesize = 6.5, + particlesizespread = 4, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.01 0.9 0.4 0.1 0.007 0.5 0.1 0.1 0]], + directional = true, + emitrot = 180, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, -0.03, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 3, + particlesize = 55, + particlesizespread = 40, + particlespeed = 18, + particlespeedspread = 9, + pos = [[0, 0, 0]], + sizegrowth = -2.6, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.15 0.095 0.02 0.01 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 90, + particlesizespread = 18, + particlespeed = 20, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = true, + }, + }, + exhale4 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.03 0.03 0.03 0.12 0.07 0.07 0.07 0.3 0.11 0.11 0.11 0.25 0.06 0.06 0.06 0.17 0.035 0.035 0.035 0.09 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, -0.03, 0.0]], + numparticles = 1, + particlelife = 31, + particlelifespread = 13, + particlesize = 6, + particlesizespread = 3.5, + particlespeed = 5, + particlespeedspread = 10, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.03 0.03 0.03 0.07 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.15 0.098 0.08 0.08 0.1 0.05 0.05 0.05 0.05 0 0 0 0]], + directional = true, + emitrot = 180, + emitrotspread = 13, + emitvector = [[dir]], + gravity = [[0, -0.04, 0]], + numparticles = 1, + particlelife = 27, + particlelifespread = 11, + particlesize = 5, + particlesizespread = 2.5, + particlespeed = 3.4, + particlespeedspread = 7.5, + pos = [[0, 1, 0]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.008 1 0.75 0.5 0.02 0.66 0.37 0.3 0.18 0.5 0.27 0.22 0.15 0.33 0.18 0.18 0.15 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 9, + emitvector = [[1, 1, 1]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 3.5, + particlesize = 5.8, + particlesizespread = 1.3, + particlespeed = 0.08, + particlespeedspread = 0.16, + pos = [[0, 0, 0]], + sizegrowth = 0.01, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + --dustparticles2 = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.77, + -- colormap = [[0.55 0.55 0.55 0.02 0.4 0.4 0.4 0.13 0.15 0.15 0.15 0.08 0 0 0 0]], + -- directional = false, + -- emitrot = 80, + -- emitrotspread = 5, + -- emitvector = [[1, 1, 1]], + -- gravity = [[0, -0.015, 0]], + -- numparticles = 2, + -- particlelife = 38, + -- particlelifespread = 9, + -- particlesize = 4.2, + -- particlesizespread = 1, + -- particlespeed = 0.24, + -- particlespeedspread = 0.11, + -- pos = [[0, 1, 0]], + -- sizegrowth = 0.033, + -- sizemod = 1.0, + -- texture = [[randomdots]], + -- }, + --}, + }, + ["missiletrail-grenadesmoke"] = { -- used by grenades + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.25 0.05 0.01 0.7 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[0, 0.7 ,0]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-8.5 r1]], + sidetexture = [[muzzleside]], + size = 2.1, + sizegrowth = [[0.2 r0.3]], + pos = [[0, 0.01 ,0]], + ttl = 1, + drawOrder = 2, + }, + }, + --trail = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.09 0.035 0.025 0.015 0.07 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -50, + -- sidetexture = [[smoketrail]], + -- size = 2.50, + -- sizegrowth = -0.055, + -- ttl = 3, + -- }, + --}, + }, } definitions["antimissiletrail"] = table.copy(definitions["cruisemissiletrail"]) -definitions["antimissiletrail"].smokeandfire.properties.colormap = [[0.7 0.45 0.45 0.2 0.44 0.25 0.25 0.2 0.34 0.12 0.12 0.15 0.09 0.023 0.023 0.11 0.05 0.008 0.008 0.09 0.02 0.006 0.01 0.06 0 0 0 0.01]] +definitions["antimissiletrail"].smokeandfire.properties.colormap = [[0.7 0.45 0.45 0.2 0.44 0.25 0.25 0.2 0.34 0.12 0.12 0.15 0.09 0.023 0.023 0.11 0.05 0.008 0.008 0.09 0.02 0.006 0.01 0.06 0 0 0 0.01]] definitions["antimissiletrail"].sparks.properties.colormap = [[0.9 0.4 0.4 0.01 0.9 0.3 0.3 0.007 0.5 0.07 0.07 0]] definitions["antimissiletrail"].fireglow.properties.colormap = [[0.4 0.4 0.9 0.01 0.3 0.3 0.8 0.007 0.3 0.3 0.6 0]] definitions["antimissiletrail"].fireglowbright.count = 1 @@ -3132,16 +3126,15 @@ definitions["missiletrailsmall-starburst-vertical"].smoke.properties.emitrotspre definitions["missiletrailsmall-starburst-vertical"].smoke.properties.particlespeed = definitions["missiletrailsmall-starburst-vertical"].smoke.properties.particlespeed * 1.25 definitions["missiletrailsmall-starburst-vertical"].smoke.properties.particlespeedspread = definitions["missiletrailsmall-starburst-vertical"].smoke.properties.particlespeedspread * 1.25 - -definitions["missiletrailmedium-starburst"] = table.copy(definitions["missiletrailmedium"])definitions["missiletrailmedium-starburst"].sparks.properties.colormap = [[1 0.2 0.1 0.01 1 0.15 0.05 0.007 0.55 0.05 0 0.007 0 0 0 0.01]] +definitions["missiletrailmedium-starburst"] = table.copy(definitions["missiletrailmedium"]) +definitions["missiletrailmedium-starburst"].sparks.properties.colormap = [[1 0.2 0.1 0.01 1 0.15 0.05 0.007 0.55 0.05 0 0.007 0 0 0 0.01]] definitions["missiletrailmedium-starburst"].dustparticles.properties.colormap = [[0.4 0.35 0.3 0.008 1 0.5 0.3 0.02 0.66 0.33 0.2 0.17 0.5 0.22 0.12 0.16 0.33 0.16 0.05 0.15 0 0 0 0.01]] definitions["missiletrailmedium-starburst"].fireglow = nil definitions["missiletrailmedium-starburst-vertical"] = table.copy(definitions["missiletrailmedium-starburst"]) definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize = definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize * 1.15 -definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize = definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize * 1.5 +definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize = definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesize * 1.5 definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesizespread = definitions["missiletrailmedium-starburst-vertical"].sparks.properties.particlesizespread * 1.5 - definitions["missiletraillarge-starburst"] = table.copy(definitions["missiletraillarge"]) definitions["missiletraillarge-starburst"].smoke.properties.emitrotspread = 4 definitions["missiletraillarge-starburst"].smoke.properties.particlespeed = definitions["missiletraillarge-starburst"].smoke.properties.particlespeed * 2 @@ -3151,7 +3144,6 @@ definitions["missiletraillarge-starburst"].sparks.properties.colormap = [[1 0.2 definitions["missiletraillarge-starburst"].dustparticles.properties.colormap = [[0.4 0.35 0.3 0.008 1 0.5 0.3 0.02 0.66 0.33 0.2 0.17 0.5 0.22 0.12 0.16 0.33 0.16 0.05 0.15 0 0 0 0.01]] definitions["missiletraillarge-starburst"].fireglow.properties.colormap = [[0.25 0.05 0.02 0.01 0 0 0 0.01]] - definitions["missiletrail-juno"] = table.copy(definitions["missiletrailmedium"]) definitions["missiletrail-juno"].fireglow.properties.colormap = [[0.3 0.24 0.03 0.01 0 0 0 0.01]] definitions["missiletrail-juno"].engine.properties.colormap = [[0.66 1 0.4 0.01 0.6 1 0.2 0.01 0.44 1 0.1 0.01 0 0 0 0.01]] @@ -3181,65 +3173,64 @@ definitions["cruisemissiletrail-emp"].fireglowbright = nil definitions["cruisemissiletrail-tacnuke"] = table.copy(definitions["cruisemissiletrail"]) definitions["cruisemissiletrail-tacnuke"].smokeandfire.properties.colormap = [[0.7 0.6 0.45 0.01 0.44 0.33 0.06 0.01 0.34 0.15 0 0.01 0.09 0.025 0 0.01 0.05 0.01 0 0.01 0.024 0.01 0 0.01 0.014 0.002 0 0.01 0 0 0 0.01]] - -- add purple scavenger variants local scavengerDefs = {} -for k,v in pairs(definitions) do - scavengerDefs[k..'-purple'] = table.copy(definitions[k]) +for k, v in pairs(definitions) do + scavengerDefs[k .. "-purple"] = table.copy(definitions[k]) end -- NOTE: this method isnt really working as well for missiletrails since these vary so much from eachother (unlike plasma and unit explosions) -- improve/customize by renaming some effects so you can separately adjust them more uniquely local purpleEffects = { - engine = { - properties = { - colormap = [[0.75 0.4 1 0.01 0.6 0.2 1 0.01 0.4 0.1 1 0.01 0 0 0 0.01]], - }, - }, - engineglow = { - properties = { - colormap = [[0.07 0.022 0.1 0.01 0 0 0 0.01]], - }, - }, - sparks = { - properties = { - colormap = [[0.7 0.5 0.9 0.01 0.6 0.4 0.9 0.007 0.2 0.1 0.25 0.005 0 0 0 0.01]], - }, - }, - explosion = { - properties = { - colormap = [[0.36 0.22 0.55 0.06 0.15 0.02 0.3 0.03 0 0 0 0.01]], - }, - }, - fireglow = { - properties = { - colormap = [[0.125 0.08 0.17 0.01 0 0 0 0.01]], - }, - }, - dustparticles = { - properties = { - colormap = [[0.4 0.4 0.4 0.008 0.75 0.5 1 0.02 0.44 0.25 0.66 0.18 0.33 0.18 0.5 0.15 0.24 0.14 0.33 0.15 0 0 0 0.01]], - }, - }, + engine = { + properties = { + colormap = [[0.75 0.4 1 0.01 0.6 0.2 1 0.01 0.4 0.1 1 0.01 0 0 0 0.01]], + }, + }, + engineglow = { + properties = { + colormap = [[0.07 0.022 0.1 0.01 0 0 0 0.01]], + }, + }, + sparks = { + properties = { + colormap = [[0.7 0.5 0.9 0.01 0.6 0.4 0.9 0.007 0.2 0.1 0.25 0.005 0 0 0 0.01]], + }, + }, + explosion = { + properties = { + colormap = [[0.36 0.22 0.55 0.06 0.15 0.02 0.3 0.03 0 0 0 0.01]], + }, + }, + fireglow = { + properties = { + colormap = [[0.125 0.08 0.17 0.01 0 0 0 0.01]], + }, + }, + dustparticles = { + properties = { + colormap = [[0.4 0.4 0.4 0.008 0.75 0.5 1 0.02 0.44 0.25 0.66 0.18 0.33 0.18 0.5 0.15 0.24 0.14 0.33 0.15 0 0 0 0.01]], + }, + }, } for defName, def in pairs(scavengerDefs) do - for effect, effectParams in pairs(purpleEffects) do - if scavengerDefs[defName][effect] then - for param, paramValue in pairs(effectParams) do - if scavengerDefs[defName][effect][param] then - if param == 'properties' then - for property,propertyValue in pairs(paramValue) do - if scavengerDefs[defName][effect][param][property] then - scavengerDefs[defName][effect][param][property] = propertyValue - end - end - else - scavengerDefs[defName][effect][param] = paramValue - end - end - end - end - end + for effect, effectParams in pairs(purpleEffects) do + if scavengerDefs[defName][effect] then + for param, paramValue in pairs(effectParams) do + if scavengerDefs[defName][effect][param] then + if param == "properties" then + for property, propertyValue in pairs(paramValue) do + if scavengerDefs[defName][effect][param][property] then + scavengerDefs[defName][effect][param][property] = propertyValue + end + end + else + scavengerDefs[defName][effect][param] = paramValue + end + end + end + end + end end table.mergeInPlace(definitions, scavengerDefs) diff --git a/effects/missiletrailcorroyspecial.lua b/effects/missiletrailcorroyspecial.lua index fc53f5637ef..36a189b1875 100644 --- a/effects/missiletrailcorroyspecial.lua +++ b/effects/missiletrailcorroyspecial.lua @@ -1,118 +1,114 @@ -- "missiletrailcorroyspecial" return { - ["missiletrailmship"] = { - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1.0 0.25 0.05 0.0 1.0 0.25 0.05 0.01 1.0 0.15 0.03 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-7 r2]], - sidetexture = [[muzzleside]], - size = 4, - sizegrowth = [[0.2 r0.3]], - ttl = 1, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.87, - colormap = [[0.006 0.006 0.006 0.0 0.05 0.04 0.033 0.4 0.04 0.038 0.034 0.4 0.04 0.036 0.032 0.4 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0.1, - emitvector = [[dir]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = [[2.6 r1]], - particlelife = 11, - particlelifespread = 22, - particlesize = 1.5, - particlesizespread = 3, - particlespeed = 0.3, - particlespeedspread = 0.6, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0.006 0.006 0.006 0 0.12 0.09 0.08 0.33 0.095 0.085 0.07 0.28 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.027 0.08 0.012 0.012 0.012 0.04 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 0.1, - emitvector = [[dir]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = [[1.8 r1]], - particlelife = 11, - particlelifespread = 23, - particlesize = 1.5, - particlesizespread = 3, - particlespeed = 0.4, - particlespeedspread = 1.1, - rotParams = [[-360 r720, -120 r240, -180 r360]], - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[fogdirty]], - useairlos = true, - }, - }, - }, - - - ["missiletrailcorroyspecial"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0.006 0.006 0.006 0.0 0.006 0.006 0.006 0.0 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.025 0.025 0.025 0.28 0.006 0.006 0.006 0.05 0 0 0 0.0]], - directional = true, - emitrot = -180, - emitrotspread = 0.3, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0, 0.0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 4, - particlesize = 1.5, - particlesizespread = 2.5, - particlespeed = 0, - particlespeedspread = -1, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - }, - + ["missiletrailmship"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1.0 0.25 0.05 0.0 1.0 0.25 0.05 0.01 1.0 0.15 0.03 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-7 r2]], + sidetexture = [[muzzleside]], + size = 4, + sizegrowth = [[0.2 r0.3]], + ttl = 1, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.006 0.006 0.006 0.0 0.05 0.04 0.033 0.4 0.04 0.038 0.034 0.4 0.04 0.036 0.032 0.4 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0.1, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[2.6 r1]], + particlelife = 11, + particlelifespread = 22, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0.3, + particlespeedspread = 0.6, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0.006 0.006 0.006 0 0.12 0.09 0.08 0.33 0.095 0.085 0.07 0.28 0.08 0.072 0.07 0.24 0.05 0.045 0.04 0.15 0.027 0.027 0.027 0.08 0.012 0.012 0.012 0.04 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 0.1, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[1.8 r1]], + particlelife = 11, + particlelifespread = 23, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0.4, + particlespeedspread = 1.1, + rotParams = [[-360 r720, -120 r240, -180 r360]], + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[fogdirty]], + useairlos = true, + }, + }, + }, + ["missiletrailcorroyspecial"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0.006 0.006 0.006 0.0 0.006 0.006 0.006 0.0 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.025 0.025 0.025 0.28 0.006 0.006 0.006 0.05 0 0 0 0.0]], + directional = true, + emitrot = -180, + emitrotspread = 0.3, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0, 0.0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 4, + particlesize = 1.5, + particlesizespread = 2.5, + particlespeed = 0, + particlespeedspread = -1, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + }, } - diff --git a/effects/newshockwave.lua b/effects/newshockwave.lua index 6228bc20925..9feff2685fc 100644 --- a/effects/newshockwave.lua +++ b/effects/newshockwave.lua @@ -1,891 +1,888 @@ return { - ["shockwaveceg"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 0.4, - maxheat = 20, - pos = [[r-2 r2, 25, r-2 r2]], - size = 50, - sizegrowth = 13, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.4 0.35 0.28 0.18 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 2800, - sizegrowth = [[0.4 r0.2]], - ttl = 16, - pos = [[0, 180, 0]], - drawOrder = 1, - }, - }, - brightflareslow = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.95 0.8 0.72 0.60 0.21 0.35 0.28 0.18 0.12 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 6, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 380, - sizegrowth = [[0.4 r0.2]], - ttl = 100, - pos = [[0, -250, 0]], - drawOrder = 1, - }, - }, - pop1 = { - class=[[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=2, - properties ={ - alwaysVisible=1, - texture=[[flame]], + ["shockwaveceg"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 0.4, + maxheat = 20, + pos = [[r-2 r2, 25, r-2 r2]], + size = 50, + sizegrowth = 13, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.4 0.35 0.28 0.18 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 2800, + sizegrowth = [[0.4 r0.2]], + ttl = 16, + pos = [[0, 180, 0]], + drawOrder = 1, + }, + }, + brightflareslow = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.95 0.8 0.72 0.60 0.21 0.35 0.28 0.18 0.12 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 6, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 380, + sizegrowth = [[0.4 r0.2]], + ttl = 100, + pos = [[0, -250, 0]], + drawOrder = 1, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 2, + properties = { + alwaysVisible = 1, + texture = [[flame]], heat = 10, maxheat = 10, heatFalloff = 0.55, size = [[3.4 r0.4]], sizeGrowth = 18, pos = [[r-10 r10, 20, r-10 r10]], - speed=[[0, 0, 0]], - drawOrder = 1, + speed = [[0, 0, 0]], + drawOrder = 1, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 700, + ttl = 80, + sizegrowth = -1, + texture = [[groundflash]], + alwaysvisible = true, }, }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 700, - ttl = 80, - sizegrowth = -1, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.93 0.75 0.2 0.3 0.2 0.15 0.06 0 0 0 0.01]], - size = 50, - sizegrowth = 2, - ttl = 30, - --sizegrowth = 10, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], - size = 950, - sizegrowth = 0, - ttl = 90, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.93 0.75 0.2 0.3 0.2 0.15 0.06 0 0 0 0.01]], + size = 50, + sizegrowth = 2, + ttl = 30, + --sizegrowth = 10, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], + size = 950, + sizegrowth = 0, + ttl = 90, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, - -- explosion_flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 0, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.93, - -- colormap = [[0 0 0 0 1 0.90 0.95 0.02 0.62 0.65 0.65 0.018 0.6 0.60 0.65 0.016 0.6 0.67 0.35 0.014 0 0 0 0.01]], - -- --colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], - -- directional = false, - -- emitrot = 0, - -- emitrotspread = 0, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.04, 0]], - -- numparticles = 1, - -- particlelife = 80, - -- particlelifespread = 0, - -- particlesize = 350, - -- particlesizespread = 120, - -- particlespeed = 4, - -- particlespeedspread = 0, - -- pos = [[0, 55, 0]], - -- --rotParams = [[1 r2, -1 r2, -180 r360]], - -- sizegrowth = [[28.0 r8]], - -- sizemod = 0.95, - -- texture = [[nukeshockwave]], - -- animParams = [[8,8,60]], - -- --texture = [[barshockwaveproj]], - -- --animParams = [[8,12,80]], - -- useairlos = false, - -- alwaysvisible = true, - -- drawOrder = -1, - -- castShadow = true, - -- }, - -- }, + -- explosion_flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 0, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.93, + -- colormap = [[0 0 0 0 1 0.90 0.95 0.02 0.62 0.65 0.65 0.018 0.6 0.60 0.65 0.016 0.6 0.67 0.35 0.014 0 0 0 0.01]], + -- --colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], + -- directional = false, + -- emitrot = 0, + -- emitrotspread = 0, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.04, 0]], + -- numparticles = 1, + -- particlelife = 80, + -- particlelifespread = 0, + -- particlesize = 350, + -- particlesizespread = 120, + -- particlespeed = 4, + -- particlespeedspread = 0, + -- pos = [[0, 55, 0]], + -- --rotParams = [[1 r2, -1 r2, -180 r360]], + -- sizegrowth = [[28.0 r8]], + -- sizemod = 0.95, + -- texture = [[nukeshockwave]], + -- animParams = [[8,8,60]], + -- --texture = [[barshockwaveproj]], + -- --animParams = [[8,12,80]], + -- useairlos = false, + -- alwaysvisible = true, + -- drawOrder = -1, + -- castShadow = true, + -- }, + -- }, - shockwaveblastdelay = { - air = false, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[1]], - explosiongenerator = [[custom:newshockwaveblast]], - pos = [[0, 0, 0]], - }, - }, + shockwaveblastdelay = { + air = false, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[1]], + explosiongenerator = [[custom:newshockwaveblast]], + pos = [[0, 0, 0]], + }, + }, - -- shockwaveblastdelay2 = { - -- air = false, - -- class = [[CExpGenSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[10]], - -- explosiongenerator = [[custom:newshockwaveblast2]], - -- pos = [[0, 0, 0]], - -- }, - -- }, + -- shockwaveblastdelay2 = { + -- air = false, + -- class = [[CExpGenSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[10]], + -- explosiongenerator = [[custom:newshockwaveblast2]], + -- pos = [[0, 0, 0]], + -- }, + -- }, - -- groundflash_anim = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = false, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- colormap = [[0.32 0.35 0.35 0.4 0.52 0.55 0.55 1 0.85 0.85 0.85 1 0.85 0.85 0.85 1 075 0.75 0.75 1 0.55 0.55 0.55 0.3 0 0 0 0.01]], - -- --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - -- size = [[650 r180]], - -- sizegrowth = 0.0, - -- --sizemod = 0.95, - -- ttl = 65, - -- --sizegrowth = 10, - -- texture = [[barshockwave]], - -- animParams = [[8,8,60]], - -- }, - -- }, + -- groundflash_anim = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = false, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- colormap = [[0.32 0.35 0.35 0.4 0.52 0.55 0.55 1 0.85 0.85 0.85 1 0.85 0.85 0.85 1 075 0.75 0.75 1 0.55 0.55 0.55 0.3 0 0 0 0.01]], + -- --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + -- size = [[650 r180]], + -- sizegrowth = 0.0, + -- --sizemod = 0.95, + -- ttl = 65, + -- --sizegrowth = 10, + -- texture = [[barshockwave]], + -- animParams = [[8,8,60]], + -- }, + -- }, - -- explosion_flames = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 4, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 35, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.008, 0]], - -- numparticles = 2, - -- particlelife = 46, - -- particlelifespread = 16, - -- particlesize = 35, - -- particlesizespread = 65, - -- particlespeed = 5.5, - -- particlespeedspread = 7.0, - -- pos = [[0, 15, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[flashside3]], - -- useairlos = false, - -- alwaysvisible = true, - -- drawOrder = 1, - -- castShadow = true, - -- }, - -- }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.003 0.20 0.06 0.004 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.008, 0]], - numparticles = 5, - particlelife = 45, - particlelifespread = 15, - particlesize = 30, - particlesizespread = 26, - particlespeed = 6, - particlespeedspread = 7, - pos = [[0, 60, 0]], - sizegrowth = 3.2, - sizemod = 1, - texture = [[flashside1]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - shockwavefirst = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 400, - sidetexture = [[none]], - size = 10, - sizegrowth = [[-29 r6]], - ttl = 30, - pos = [[0, 45, 0]], - drawOrder = 1, - }, - }, - -- shockwaveslow = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = false, - -- water = false, - -- properties = { - -- colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 24, - -- sizegrowth = [[-15 r3]], - -- ttl = 120, - -- pos = [[0, 25, 0]], - -- }, - -- }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 90, - particlelifespread = 25, - particlesize = 6, - particlesizespread = 5.7, - particlespeed = 16.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[1 r2.2]], - particlelife = 70, - particlelifespread = 18, - particlesize = 7, - particlesizespread = 5.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - castShadow = true, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - properties = { - airdrag = 0.97, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.1, 0]], - numparticles = [[1 r1.5]], - particlelife = 80, - particlelifespread = 20, - particlesize = 8, - particlesizespread = 6.7, - particlespeed = 8.8, - particlespeedspread = 11.7, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - castShadow = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.92, - colormap = [[0.9 0.85 0.77 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], - directional = true, - emitrot = 40, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 12, - particlelife = 42, - particlelifespread = 16, - particlesize = 45, - particlesizespread = 80, - particlespeed = 24.5, - particlespeedspread = 10, - pos = [[0, 4, 0]], - sizegrowth = -0.096, - sizemod = 0.96, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 40, - particlelifespread = 0, - particlesize = 128, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.20, - -- ttl = 30, - -- expansionSpeed = 18, - -- color = [[1.0, 0.85, 0.45]], - -- alwaysvisible = true, - -- }, - -- }, - -- shockwave_slow = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.05, - -- ttl = 110, - -- expansionSpeed = 8.5, - -- color = [[0.8, 0.55, 0.2]], - -- }, - -- }, - -- shockwave_inner = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.95, - -- ttl = 50, - -- expansionSpeed = 4.8, - -- color = [[0.7, 0.60, 0.32]], - -- alwaysvisible = true, - -- }, - -- }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 6, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.33 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], - dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], - --gravity = [[0.0, -0.2, 0.0]], - frontoffset = 0.08, - fronttexture = [[none]], - length = [[215 r80]], - sidetexture = [[flamestream]], - size = [[120 r25]], - sizegrowth = 0.95, - ttl = [[95 r30]], - rotParams = [[-12 r24, -4 r8, 30 r30]], - pos = [[-50 r100, -30 r60, -50 r100]], - drawOrder = 1, - castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 9, - ground = true, - properties = { - airdrag = 0.985, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.13, 0]], - numparticles = 4, - particlelife = 70, - particlelifespread = 50, - particlesize = 32, - particlesizespread = 14.6, - particlespeed = 4.0, - particlespeedspread = 8, - rotParams = [[-20 r40, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1.005, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 50, - particlelife = 180, - particlelifespread = 40, - particlesize = 3, - particlesizespread = -1.5, - particlespeed = 10, - particlespeedspread = 18, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 1, - particlelife = 60, - particlelifespread = 45, - particlesize = 90, - particlesizespread = -3.6, - particlespeed = 12, - particlespeedspread = 21, - rotParams = [[-15 r30, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 35, - particlelife = 90, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 40, - particlelifespread = 5.75, - particlesize = 4, - particlesizespread = 1.5, - particlespeed = 5.8, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0.05 0.08 0.07 0.06 0.2 0.08 0.07 0.06 0.2 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.07, 0]], - numparticles = 2, - particlelife = 140, - particlelifespread = 60, - particlesize = 18, - particlesizespread = 25, - particlespeed = 6, - particlespeedspread = 6, - pos = [[0, 100, 0]], - rotParams = [[-30 r60, 0, -180 r360]], - sizegrowth = 1.6, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - nukefloor = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0]], - explosiongenerator = [[custom:newcomnuke-floor]], - pos = [[-40 r80, 100 r20, -40 r80]], - }, - }, + -- explosion_flames = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 4, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.56 0.23 0.05 0.01 0.1 0.04 0.015 0.005 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 35, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.008, 0]], + -- numparticles = 2, + -- particlelife = 46, + -- particlelifespread = 16, + -- particlesize = 35, + -- particlesizespread = 65, + -- particlespeed = 5.5, + -- particlespeedspread = 7.0, + -- pos = [[0, 15, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[flashside3]], + -- useairlos = false, + -- alwaysvisible = true, + -- drawOrder = 1, + -- castShadow = true, + -- }, + -- }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.53 0.21 0.012 0.70 0.32 0.04 0.008 0.60 0.22 0.01 0.003 0.20 0.06 0.004 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.008, 0]], + numparticles = 5, + particlelife = 45, + particlelifespread = 15, + particlesize = 30, + particlesizespread = 26, + particlespeed = 6, + particlespeedspread = 7, + pos = [[0, 60, 0]], + sizegrowth = 3.2, + sizemod = 1, + texture = [[flashside1]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + shockwavefirst = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 400, + sidetexture = [[none]], + size = 10, + sizegrowth = [[-29 r6]], + ttl = 30, + pos = [[0, 45, 0]], + drawOrder = 1, + }, + }, + -- shockwaveslow = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = false, + -- water = false, + -- properties = { + -- colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 24, + -- sizegrowth = [[-15 r3]], + -- ttl = 120, + -- pos = [[0, 25, 0]], + -- }, + -- }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 90, + particlelifespread = 25, + particlesize = 6, + particlesizespread = 5.7, + particlespeed = 16.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[1 r2.2]], + particlelife = 70, + particlelifespread = 18, + particlesize = 7, + particlesizespread = 5.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + castShadow = true, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = [[1 r1.5]], + particlelife = 80, + particlelifespread = 20, + particlesize = 8, + particlesizespread = 6.7, + particlespeed = 8.8, + particlespeedspread = 11.7, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.92, + colormap = [[0.9 0.85 0.77 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.25 0.15 0.08 0.01 0 0 0 0]], + directional = true, + emitrot = 40, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 12, + particlelife = 42, + particlelifespread = 16, + particlesize = 45, + particlesizespread = 80, + particlespeed = 24.5, + particlespeedspread = 10, + pos = [[0, 4, 0]], + sizegrowth = -0.096, + sizemod = 0.96, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 40, + particlelifespread = 0, + particlesize = 128, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.20, + -- ttl = 30, + -- expansionSpeed = 18, + -- color = [[1.0, 0.85, 0.45]], + -- alwaysvisible = true, + -- }, + -- }, + -- shockwave_slow = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.05, + -- ttl = 110, + -- expansionSpeed = 8.5, + -- color = [[0.8, 0.55, 0.2]], + -- }, + -- }, + -- shockwave_inner = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.95, + -- ttl = 50, + -- expansionSpeed = 4.8, + -- color = [[0.7, 0.60, 0.32]], + -- alwaysvisible = true, + -- }, + -- }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 6, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.33 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], + dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], + --gravity = [[0.0, -0.2, 0.0]], + frontoffset = 0.08, + fronttexture = [[none]], + length = [[215 r80]], + sidetexture = [[flamestream]], + size = [[120 r25]], + sizegrowth = 0.95, + ttl = [[95 r30]], + rotParams = [[-12 r24, -4 r8, 30 r30]], + pos = [[-50 r100, -30 r60, -50 r100]], + drawOrder = 1, + castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 9, + ground = true, + properties = { + airdrag = 0.985, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.13, 0]], + numparticles = 4, + particlelife = 70, + particlelifespread = 50, + particlesize = 32, + particlesizespread = 14.6, + particlespeed = 4.0, + particlespeedspread = 8, + rotParams = [[-20 r40, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1.005, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0.88 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 50, + particlelife = 180, + particlelifespread = 40, + particlesize = 3, + particlesizespread = -1.5, + particlespeed = 10, + particlespeedspread = 18, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 45, + particlesize = 90, + particlesizespread = -3.6, + particlespeed = 12, + particlespeedspread = 21, + rotParams = [[-15 r30, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.028 0.04 0.02 0.05 0.065 0.065 0.055 0.2 0.043 0.05 0.03 0.12 0.0238 0.023 0.021 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 35, + particlelife = 90, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 40, + particlelifespread = 5.75, + particlesize = 4, + particlesizespread = 1.5, + particlespeed = 5.8, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0.05 0.08 0.07 0.06 0.2 0.08 0.07 0.06 0.2 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.07, 0]], + numparticles = 2, + particlelife = 140, + particlelifespread = 60, + particlesize = 18, + particlesizespread = 25, + particlespeed = 6, + particlespeedspread = 6, + pos = [[0, 100, 0]], + rotParams = [[-30 r60, 0, -180 r360]], + sizegrowth = 1.6, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + nukefloor = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0]], + explosiongenerator = [[custom:newcomnuke-floor]], + pos = [[-40 r80, 100 r20, -40 r80]], + }, + }, electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = false, - underwater = false, + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = false, + underwater = false, properties = { - delay = [[40 r170]], + delay = [[40 r170]], explosiongenerator = [[custom:lightning_stormbig]], - pos = [[-100 r160, 55 r50, -100 r160]], + pos = [[-100 r160, 55 r50, -100 r160]], }, }, - electricstormalt = { - air = true, - class = [[CExpGenSpawner]], - count = 12, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[40 r180]], - explosiongenerator = [[custom:lightning_stormbigalt]], - pos = [[-100 r160, 55 r50, -100 r160]], - }, - }, + electricstormalt = { + air = true, + class = [[CExpGenSpawner]], + count = 12, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[40 r180]], + explosiongenerator = [[custom:lightning_stormbigalt]], + pos = [[-100 r160, 55 r50, -100 r160]], + }, + }, electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 5, - ground = true, - water = false, - underwater = false, + air = true, + class = [[CExpGenSpawner]], + count = 5, + ground = true, + water = false, + underwater = false, properties = { - delay = [[65 r130]], + delay = [[65 r130]], explosiongenerator = [[custom:lightning_stormflares]], - pos = [[-70 r140, 140 r30, -70 r140]], + pos = [[-70 r140, 140 r30, -70 r140]], }, }, - }, -["newshockwaveblast"] = { - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], - --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], - size = [[375 r150]], - sizegrowth = -0.7, - --sizemod = 0.95, - ttl = 70, - --sizegrowth = 10, - pos = [[0, 75, 0]], - rotParams = [[0, 0, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,70]], - }, - }, - }, - -["newshockwaveblast2"] = { - muzzleparticle = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - --airdrag = 0.90, -- higher is less drag - --colormap = [[0 0 0 0 1 0.95 0.8 0.25 0.9 0.8 0.70 0.3 0.8 0.65 0.4 0.15 0.6 0.6 0.6 0.012 0.09 0.09 0.09 0.006 0 0 0 0.01]], - colormap = [[0.95 0.95 0.95 0.9 1 0.95 0.8 0.20 0.8 0.6 0.3 0.010 0.4 0.3 0.2 0.008 0.3 0.2 0.1 0.008 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.2, 0.0]], - frontoffset = -1, - length = [[500]], - fronttexture = [[none]], - sidetexture = [[BARFlame02]], - animParams = [[16,6,60]], -- animated sidetexture params - size = [[380 r20]], - sizegrowth = [[0.3 r0.1]], - ttl = 60, - --speed = 5, -- currently speed changes [dir] to a fixed angle to the effect - --speedspread = 5, - pos = [[0, -180, 0]], - rotParams = [[0, 0, -180 r360]], - drawOrder = 0, - }, - }, -}, + ["newshockwaveblast"] = { + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], + --colormap = [[1 0.93 0.75 0.62 0.3 0.2 0.15 0.3 0 0 0 0.01]], + size = [[375 r150]], + sizegrowth = -0.7, + --sizemod = 0.95, + ttl = 70, + --sizegrowth = 10, + pos = [[0, 75, 0]], + rotParams = [[0, 0, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,70]], + }, + }, + }, -["newshockwavetest"] = { - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.90, -- higher is less drag - colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], - dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], - gravity = [[0.0, 0.2, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], -- would love animated texture here - frontanimParams = [[16,6,50 r80]], -- animated texture params - length = [[100 r25]], - sidetexture = [[flamestream]], - size = [[50 r20]], - sizegrowth = [[15 r5]], - ttl = 60, - --speed = 5, -- currently speed changes [dir] to a fixed angle to the effect - speedspread = 50, - pos = [[0, 45, 0]], - rotParams = [[-60 r120, -30 r60, -180 r360]], - drawOrder = 1, - }, - }, - }, + ["newshockwaveblast2"] = { + muzzleparticle = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + --airdrag = 0.90, -- higher is less drag + --colormap = [[0 0 0 0 1 0.95 0.8 0.25 0.9 0.8 0.70 0.3 0.8 0.65 0.4 0.15 0.6 0.6 0.6 0.012 0.09 0.09 0.09 0.006 0 0 0 0.01]], + colormap = [[0.95 0.95 0.95 0.9 1 0.95 0.8 0.20 0.8 0.6 0.3 0.010 0.4 0.3 0.2 0.008 0.3 0.2 0.1 0.008 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.2, 0.0]], + frontoffset = -1, + length = [[500]], + fronttexture = [[none]], + sidetexture = [[BARFlame02]], + animParams = [[16,6,60]], -- animated sidetexture params + size = [[380 r20]], + sizegrowth = [[0.3 r0.1]], + ttl = 60, + --speed = 5, -- currently speed changes [dir] to a fixed angle to the effect + --speedspread = 5, + pos = [[0, -180, 0]], + rotParams = [[0, 0, -180 r360]], + drawOrder = 0, + }, + }, + }, + ["newshockwavetest"] = { + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.90, -- higher is less drag + colormap = [[0 0 0 0 1 0.95 0.8 0.50 0.9 0.8 0.70 0.7 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0]], + dir = [[-0.75 r1.5, 0.4 r0.55, -0.75 r1.5]], + gravity = [[0.0, 0.2, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], -- would love animated texture here + frontanimParams = [[16,6,50 r80]], -- animated texture params + length = [[100 r25]], + sidetexture = [[flamestream]], + size = [[50 r20]], + sizegrowth = [[15 r5]], + ttl = 60, + --speed = 5, -- currently speed changes [dir] to a fixed angle to the effect + speedspread = 50, + pos = [[0, 45, 0]], + rotParams = [[-60 r120, -30 r60, -180 r360]], + drawOrder = 1, + }, + }, + }, } diff --git a/effects/nukedatbewm.lua b/effects/nukedatbewm.lua index 8f80cbe453a..50f36e701ee 100644 --- a/effects/nukedatbewm.lua +++ b/effects/nukedatbewm.lua @@ -1,198 +1,197 @@ -- nukedatbewm return { - ["nukedatbewm"] = { - groundflash = { - air = true, - ground = true, - water = true, - underwater = true, - flashalpha = 0.33, - flashsize = 660, - ground = true, - ttl = 36, - water = true, - color = { - [1] = 1, - [2] = 0.9, - [3] = 0.55, - }, - }, + ["nukedatbewm"] = { + groundflash = { + air = true, + ground = true, + water = true, + underwater = true, + flashalpha = 0.33, + flashsize = 660, + ground = true, + ttl = 36, + water = true, + color = { + [1] = 1, + [2] = 0.9, + [3] = 0.55, + }, + }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = true, - properties = { - colormap = [[1 0.9 0.75 0.75 0 0 0 0.01]], - size = 660, - sizegrowth = 0, - ttl = 25, - texture = [[groundflash]], - }, - }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + properties = { + colormap = [[1 0.9 0.75 0.75 0 0 0 0.01]], + size = 660, + sizegrowth = 0, + ttl = 25, + texture = [[groundflash]], + }, + }, - pop1 = { - class=[[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=2, - properties ={ - alwaysVisible=1, - texture=[[fireball]], - heat = 10, - maxheat = 10, - heatFalloff = 0.7, - size = 2, - sizeGrowth = 22, - pos = [[r-10 r10, 0, r-10 r10]], - speed=[[0, 0, 0]], - }, - }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 2, + properties = { + alwaysVisible = 1, + texture = [[fireball]], + heat = 10, + maxheat = 10, + heatFalloff = 0.7, + size = 2, + sizeGrowth = 22, + pos = [[r-10 r10, 0, r-10 r10]], + speed = [[0, 0, 0]], + }, + }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - alwaysVisible = 1, - sizeGrowth = 1.08, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=35, - emitRotSpread=70, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.005, 0]], - colorMap=[[1 0.65 0.4 0.5 0.45 0.24 0.09 0.8 0.3 0.19 0.12 0.7 0.2 0.17 0.14 0.6 0.1 0.095 0.088 0.29 0.07 0.065 0.058 0.18 0 0 0 0.01]], - Texture=[[graysmoke]], - airdrag=0.66, - particleLife=20, - particleLifeSpread=150, - numParticles=30, - particleSpeed=2, - particleSpeedSpread=75, - particleSize=30, - particleSizeSpread=6, - directional=1, - }, - }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + sizeGrowth = 1.08, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 35, + emitRotSpread = 70, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.005, 0]], + colorMap = [[1 0.65 0.4 0.5 0.45 0.24 0.09 0.8 0.3 0.19 0.12 0.7 0.2 0.17 0.14 0.6 0.1 0.095 0.088 0.29 0.07 0.065 0.058 0.18 0 0 0 0.01]], + Texture = [[graysmoke]], + airdrag = 0.66, + particleLife = 20, + particleLifeSpread = 150, + numParticles = 30, + particleSpeed = 2, + particleSpeedSpread = 75, + particleSize = 30, + particleSizeSpread = 6, + directional = 1, + }, + }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - alwaysVisible = 1, - sizeGrowth = 1.08, - sizeMod = 1.0, - pos = [[r-1 r1, 0, r-1 r1]], - emitRot=35, - emitRotSpread=70, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.005, 0]], - colorMap=[[1 0.65 0.4 0.5 0.42 0.22 0.07 0.8 0.2 0.17 0.14 0.6 0.1 0.095 0.088 0.29 0 0 0 0.01]], - Texture=[[graysmoke]], - airdrag=0.77, - particleLife=10, - particleLifeSpread=110, - numParticles=100, - particleSpeed=15, - particleSpeedSpread=40, - particleSize=25, - particleSizeSpread=6, - directional=1, - }, - }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 1, + sizeGrowth = 1.08, + sizeMod = 1.0, + pos = [[r-1 r1, 0, r-1 r1]], + emitRot = 35, + emitRotSpread = 70, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.005, 0]], + colorMap = [[1 0.65 0.4 0.5 0.42 0.22 0.07 0.8 0.2 0.17 0.14 0.6 0.1 0.095 0.088 0.29 0 0 0 0.01]], + Texture = [[graysmoke]], + airdrag = 0.77, + particleLife = 10, + particleLifeSpread = 110, + numParticles = 100, + particleSpeed = 15, + particleSpeedSpread = 40, + particleSize = 25, + particleSizeSpread = 6, + directional = 1, + }, + }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - air = true, - properties = { - airdrag = 0.96, - colormap = [[ 0.1 0.07 0.033 0.66 0.02 0.02 0.2 0.4 0.08 0.065 0.035 0.55 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 25, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.55, 0]], - numparticles = 12, - particlelife = 40, - particlelifespread = 15, - particlesize = 3.2, - particlesizespread = -2.7, - particlespeed = 9, - particlespeedspread = 15, - pos = [[0, 10, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + air = true, + properties = { + airdrag = 0.96, + colormap = [[ 0.1 0.07 0.033 0.66 0.02 0.02 0.2 0.4 0.08 0.065 0.035 0.55 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 25, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.55, 0]], + numparticles = 12, + particlelife = 40, + particlelifespread = 15, + particlesize = 3.2, + particlesizespread = -2.7, + particlespeed = 9, + particlespeedspread = 15, + pos = [[0, 10, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, - dirtbig = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0.09 0.1 0.07 0.033 0.66 0.02 0.02 0.2 0.4 0.08 0.065 0.035 0.55 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 25, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.85, 0]], - numparticles = 7, - particlelife = 37, - particlelifespread = 13, - particlesize = 4, - particlesizespread = -3.3, - particlespeed = 8, - particlespeedspread = 14, - pos = [[0, 10, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[bigexplosmoke]], - }, - }, + dirtbig = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0.09 0.1 0.07 0.033 0.66 0.02 0.02 0.2 0.4 0.08 0.065 0.035 0.55 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 25, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.85, 0]], + numparticles = 7, + particlelife = 37, + particlelifespread = 13, + particlesize = 4, + particlesizespread = -3.3, + particlespeed = 8, + particlespeedspread = 14, + pos = [[0, 10, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[bigexplosmoke]], + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.5 0.2 0.022 0.5 0.3 0.1 0.013 0.04 0.03 0.01 0.07 0.01 0.01 0 0.015]], - directional = true, - emitrot = 22, - emitrotspread = 66, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.11, 0]], - numparticles = 12, - particlelife = 25, - particlelifespread = 25, - particlesize = 60, - particlesizespread = 160, - particlespeed = 7.5, - particlespeedspread = 12, - pos = [[0, 4, 0]], - sizegrowth = -0.007, - sizemod = 0.5, - texture = [[gunshotglow]], - }, - }, - } + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.5 0.2 0.022 0.5 0.3 0.1 0.013 0.04 0.03 0.01 0.07 0.01 0.01 0 0.015]], + directional = true, + emitrot = 22, + emitrotspread = 66, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.11, 0]], + numparticles = 12, + particlelife = 25, + particlelifespread = 25, + particlesize = 60, + particlesizespread = 160, + particlespeed = 7.5, + particlespeedspread = 12, + pos = [[0, 4, 0]], + sizegrowth = -0.007, + sizemod = 0.5, + texture = [[gunshotglow]], + }, + }, + }, } - diff --git a/effects/nukes.lua b/effects/nukes.lua index 5dd2f52a791..fef61ea4847 100644 --- a/effects/nukes.lua +++ b/effects/nukes.lua @@ -1,1395 +1,1394 @@ -- nukedatbewm local definitions = { - ["newnuke"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = [[0.18 r0.04]], - maxheat = 20, - pos = [[r-2 r2, 50, r-2 r2]], - rotParams = [[20 r10, -5 r-2, -180 r360]], - --rotParams = [[25 r30, -4 r-6, -180 r360]], - size = [[32 r5]], - sizegrowth = [[7 r3]], - speed = [[-1 r2, 0.7, -1 r2]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - -- animated textures on large areas DONT WORK - -- groundblast = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = false, - -- water = true, - -- properties = { - -- colormap = [[0 0 0 0 1 0.98 0.8 0.8 1 0.95 0.75 0.6 0.96 0.93 0.7 0.5 0.95 0.95 0.6 0.16 0.7 0.65 0.3 0.14 0.3 0.2 0.1 0.08 0.01 0.01 0.01 0.02]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[groundblast]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 350, - -- sizegrowth = [[2.5 r0.5]], - -- ttl = 45, - -- pos = [[0, 20, 0]], - -- rotParams = [[-2 r4, -1 r2, -180 r360]], - -- animParams = [[8,8,50 r15]], - -- drawOrder = 0, - -- }, - -- }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.1 0.8 0.72 0.60 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 3800, - sizegrowth = [[0.4 r0.2]], - ttl = 38, - pos = [[0, 180, 0]], - drawOrder = 0, - }, - }, - brightflaresingularity = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.5 0.5 0.5 0.7 0.7 0.6 0.5 0.4 0.35 0.30 0.24 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 1, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 200, - sizegrowth = [[1.8 r1.2]], - ttl = 125, - pos = [[0, -10, 0]], - drawOrder = 0, - }, - }, - brightflareslow = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.4 0.8 0.72 0.60 0.25 0.35 0.28 0.18 0.11 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 2, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 450, - sizegrowth = [[0.4 r0.8]], - ttl = 250, - pos = [[0, 0, 0]], - drawOrder = 0, - }, - }, - brightflareslowair = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = false, - water = false, - properties = { - colormap = [[1.0 0.96 0.80 0.4 0.6 0.5 0.4 0.15 0.25 0.22 0.16 0.09 0 0 0 0.1]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 4, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 400, - sizegrowth = [[0.7 r0.6]], - ttl = 150, - pos = [[0, -150, 0]], - drawOrder = 0, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[1 r1, -0.5 r0.5, -180 r360]], - colormap = [[1 0.7 0.3 0.49 0 0 0 0.01]], - size = 900, - ttl = 250, - sizegrowth = -2, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_quick = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - rotParams = [[1 r1, -0.5 r0.5, -180 r360]], - colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], - size = 200, - sizegrowth = 18, - ttl = 250, - --sizegrowth = 10, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], - size = 1200, - sizegrowth = 0, - ttl = 145, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 0, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - alwaysvisible = true, - }, - }, - explosion_flames = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.55 0.24 0.07 0.01 0.1 0.05 0.02 0.005 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 5, - particlelife = 60, - particlelifespread = 20, - particlesize = 45, - particlesizespread = 62, - particlespeed = 8, - particlespeedspread = 8, - pos = [[0, 15, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - }, - }, - explosionanim = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.79, - colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], - directional = false, - emitrot = 65, - emitrotspread = 24, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.35, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 40, - particlesize = 180, - particlesizespread = 52, - particlespeed = 8.8, - particlespeedspread = 14.3, - pos = [[-20 r40, -10 r20, -20 r40]], - sizegrowth = [[3.8 r2.2]], - sizemod = 1.0, - texture = [[smoke-ice-anim]], - animParams = [[8,8,180 r50]], - rotParams = [[-3 r6, -4 r8, -180 r360]], - useairlos = false, - drawOrder = 1, - castShadow = true, - }, - }, - groundflash_anim = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], - size = 570, - sizegrowth = 1, - ttl = 120, - pos = [[0, 75, 0]], - rotParams = [[0, 0, -180 r360]], - texture = [[barshockwave]], - animParams = [[8,12,120]], - }, - }, - airflash_anim = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = false, - underwater = false, - water = false, - properties = { - --colormap = [[0 0 0 0 1 0.95 0.8 0.25 0.9 0.8 0.70 0.3 0.8 0.65 0.4 0.15 0.6 0.6 0.6 0.012 0.09 0.09 0.09 0.006 0 0 0 0.01]], - colormap = [[0.95 0.95 0.95 0.9 1 0.95 0.8 0.16 0.8 0.6 0.3 0.009 0.4 0.3 0.2 0.007 0.3 0.2 0.1 0.005 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - length = [[10]], - fronttexture = [[1InstaHeat1Shock1]], - sidetexture = [[none]], - animParams = [[8,12,90]], -- animated sidetexture params - size = 240, - sizegrowth = [[0.5 r0.3]], - ttl = 90, - pos = [[0, 0, 0]], - rotParams = [[-5 r10, -3 r6, -180 r360]], - drawOrder = 0, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.63 0.26 0.012 0.70 0.38 0.04 0.008 0.15 0.05 0.002 0.005 0.40 0.20 0.04 0.008 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.005, 0]], - numparticles = 4, - particlelife = 52, - particlelifespread = 34, - particlesize = 57, - particlesizespread = 68, - particlespeed = 6, - particlespeedspread = 2, - pos = [[0, 60, 0]], - sizegrowth = 3.2, - sizemod = 0.97, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.97, - colormap = [[0.85 0.75 0.67 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.4 0.22 0.15 0.01 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 13, - particlelife = 80, - particlelifespread = 16, - particlesize = 70, - particlesizespread = 95, - particlespeed = 14, - particlespeedspread = 9, - pos = [[0, 4, 0]], - rotParams = [[-5 r10, -5 r10, -180]], - sizegrowth = -0.04, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - --castShadow = true, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], - directional = true, - emitrot = 65, - emitrotspread = 30, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 5, - particlelife = 40, - particlelifespread = 0, - particlesize = 128, - particlesizespread = 64, - particlespeed = 3, - particlespeedspread = 0, - pos = [[0, 2, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, - shockwave = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0.1 1 0.95 0.8 0.48 0.9 0.8 0.70 0.6 0.8 0.65 0.4 0.45 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 1, - sidetexture = [[none]], - size = 8, - sizegrowth = [[-70 r6]], - ttl = 34, - pos = [[0, 75, 0]], - drawOrder = 1, - }, - }, - shockwave_fast = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - unit = true, - properties = { - colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[shockwave]], - length = 1, - sidetexture = [[none]], - size = 19, - sizegrowth = [[-58 r4]], - ttl = 13, - pos = [[0, 85, 0]], - drawOrder = 1, - useairlos = false, - alwaysvisible = true, - }, - }, - shockwave_inner = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.7 0.6 0.35 0.25 0.5 0.38 0.15 0.12 0.3 0.25 0.09 0.10 0.10 0.08 0.04 0.008 0.06 0.04 0.02 0.005 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 0, - sidetexture = [[none]], - size = 45, - sizegrowth = [[-15 r6]], - ttl = 95, - pos = [[0, 5, 0]], - }, - }, - shockwave_slow = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 0, - sidetexture = [[none]], - size = 24, - sizegrowth = [[-15 r3]], - ttl = 120, - pos = [[0, 25, 0]], - }, - }, - bigsmoketrails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 5, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.44 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], - dir = [[-0.7 r1.4, 0.3 r0.58, 0 r-0.7]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[260 r25]], - sidetexture = [[flamestream]], - size = [[170 r25]], - sizegrowth = 0.75, - ttl = 100, - rotParams = [[-15 r30, -5 r10, -90 r180]], - pos = [[-50 r100, 0 r50, -50 r100]], - drawOrder = 0, - castShadow = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 8, - ground = true, - air = false, - properties = { - airdrag = 0.97, - colormap = [[0.04 0.03 0.01 0 0.15 0.14 0.066 0.50 0.13 0.09 0.05 0.45 0.08 0.065 0.035 0.35 0.075 0.07 0.06 0.20 0 0 0 0 ]], - directional = false, - emitrot = 35, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 6, - particlelife = 100, - particlelifespread = 45, - particlesize = 40, - particlesizespread = -3.6, - particlespeed = 6, - particlespeedspread = 14, - rotParams = [[-20 r40, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.045, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 1, - castShadow = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - air = false, - properties = { - airdrag = 0.98, - colormap = [[0.08 0.06 0.03 0.66 0.12 0.09 0.05 0.58 0.1 0.07 0.03 0.52 0.08 0.065 0.035 0.40 0.075 0.07 0.06 0.3 0 0 0 0 ]], - directional = false, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 18, - particlelife = 180, - particlelifespread = 40, - particlesize = 3, - particlesizespread = -1.5, - particlespeed = 10, - particlespeedspread = 18, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,180 r50]], - useairlos = false, - alwaysvisible = true, - drawOrder = 0, - castShadow = true, - }, - }, - dirt3 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - air = false, - properties = { - airdrag = 0.96, - colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = false, - emitrot = 45, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.10, 0]], - numparticles = 7, - particlelife = 80, - particlelifespread = 45, - particlesize = 90, - particlesizespread = -3.6, - particlespeed = 8, - particlespeedspread = 4, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.2, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - drawOrder = 0, - --castShadow = true, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.05 0.06 0.055 0.055 0.16 0.043 0.04 0.04 0.11 0.0238 0.022 0.022 0.06 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 35, - particlelife = 90, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - rotParams = [[-30 r60, 0, -180 r360]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[smoke-ice-anim]], - animParams = [[8,8,180 r50]], - alwaysvisible = true, - drawOrder = 0, - castShadow = true, - }, - }, - dustparticles = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.94, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 12, - particlelife = 40, - particlelifespread = 5.75, - particlesize = 5, - particlesizespread = 1.5, - particlespeed = 5.8, - particlespeedspread = 2, - rotParams = [[-5 r10, 0, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 0.36 0.32 0.28 0.4 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0.3, 0.7, 0.3]], - gravity = [[-0.1 r0.2, 0 r0.1, -0.1 r0.2]], - numparticles = 1, - particlelife = 130, - particlelifespread = 55, - particlesize = 60, - particlesizespread = 60, - particlespeed = 16, - particlespeedspread = 8, - rotParams = [[-4 r8, -1 r2, -180 r360]], - pos = [[-20 r40, 0 r50, -20 r40]], - sizegrowth = 1.6, - sizemod = 1.0, - texture = [[smoke-ice-anim]], - animParams = [[8,8,180 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, + ["newnuke"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = [[0.18 r0.04]], + maxheat = 20, + pos = [[r-2 r2, 50, r-2 r2]], + rotParams = [[20 r10, -5 r-2, -180 r360]], + --rotParams = [[25 r30, -4 r-6, -180 r360]], + size = [[32 r5]], + sizegrowth = [[7 r3]], + speed = [[-1 r2, 0.7, -1 r2]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + -- animated textures on large areas DONT WORK + -- groundblast = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = false, + -- water = true, + -- properties = { + -- colormap = [[0 0 0 0 1 0.98 0.8 0.8 1 0.95 0.75 0.6 0.96 0.93 0.7 0.5 0.95 0.95 0.6 0.16 0.7 0.65 0.3 0.14 0.3 0.2 0.1 0.08 0.01 0.01 0.01 0.02]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[groundblast]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 350, + -- sizegrowth = [[2.5 r0.5]], + -- ttl = 45, + -- pos = [[0, 20, 0]], + -- rotParams = [[-2 r4, -1 r2, -180 r360]], + -- animParams = [[8,8,50 r15]], + -- drawOrder = 0, + -- }, + -- }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.1 0.8 0.72 0.60 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 3800, + sizegrowth = [[0.4 r0.2]], + ttl = 38, + pos = [[0, 180, 0]], + drawOrder = 0, + }, + }, + brightflaresingularity = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.5 0.5 0.5 0.7 0.7 0.6 0.5 0.4 0.35 0.30 0.24 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 1, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 200, + sizegrowth = [[1.8 r1.2]], + ttl = 125, + pos = [[0, -10, 0]], + drawOrder = 0, + }, + }, + brightflareslow = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.4 0.8 0.72 0.60 0.25 0.35 0.28 0.18 0.11 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 2, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 450, + sizegrowth = [[0.4 r0.8]], + ttl = 250, + pos = [[0, 0, 0]], + drawOrder = 0, + }, + }, + brightflareslowair = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = false, + water = false, + properties = { + colormap = [[1.0 0.96 0.80 0.4 0.6 0.5 0.4 0.15 0.25 0.22 0.16 0.09 0 0 0 0.1]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 4, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 400, + sizegrowth = [[0.7 r0.6]], + ttl = 150, + pos = [[0, -150, 0]], + drawOrder = 0, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[1 r1, -0.5 r0.5, -180 r360]], + colormap = [[1 0.7 0.3 0.49 0 0 0 0.01]], + size = 900, + ttl = 250, + sizegrowth = -2, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_quick = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + rotParams = [[1 r1, -0.5 r0.5, -180 r360]], + colormap = [[1 0.93 0.75 0.3 0 0 0 0.01]], + size = 200, + sizegrowth = 18, + ttl = 250, + --sizegrowth = 10, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[1 0.9 0.75 0.45 0 0 0 0.01]], + size = 1200, + sizegrowth = 0, + ttl = 145, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 0, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + alwaysvisible = true, + }, + }, + explosion_flames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0 1 0.95 0.8 0.02 0.92 0.67 0.35 0.015 0.55 0.24 0.07 0.01 0.1 0.05 0.02 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 5, + particlelife = 60, + particlelifespread = 20, + particlesize = 45, + particlesizespread = 62, + particlespeed = 8, + particlespeedspread = 8, + pos = [[0, 15, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + }, + }, + explosionanim = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.79, + colormap = [[0.05 0.05 0.02 0.1 0.95 0.93 0.85 0.95 0.80 0.75 0.65 0.85 0.35 0.25 0.1 0.75 0.08 0.07 0.06 0.28 0 0 0 0.01]], + directional = false, + emitrot = 65, + emitrotspread = 24, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.35, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 40, + particlesize = 180, + particlesizespread = 52, + particlespeed = 8.8, + particlespeedspread = 14.3, + pos = [[-20 r40, -10 r20, -20 r40]], + sizegrowth = [[3.8 r2.2]], + sizemod = 1.0, + texture = [[smoke-ice-anim]], + animParams = [[8,8,180 r50]], + rotParams = [[-3 r6, -4 r8, -180 r360]], + useairlos = false, + drawOrder = 1, + castShadow = true, + }, + }, + groundflash_anim = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.9 0.65 0.35 1 1 1 1 1.0 0.85 0.85 0.85 1 0.45 0.45 0.45 1 0.35 0.35 0.35 0.5 0 0 0 0.01]], + size = 570, + sizegrowth = 1, + ttl = 120, + pos = [[0, 75, 0]], + rotParams = [[0, 0, -180 r360]], + texture = [[barshockwave]], + animParams = [[8,12,120]], + }, + }, + airflash_anim = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = false, + underwater = false, + water = false, + properties = { + --colormap = [[0 0 0 0 1 0.95 0.8 0.25 0.9 0.8 0.70 0.3 0.8 0.65 0.4 0.15 0.6 0.6 0.6 0.012 0.09 0.09 0.09 0.006 0 0 0 0.01]], + colormap = [[0.95 0.95 0.95 0.9 1 0.95 0.8 0.16 0.8 0.6 0.3 0.009 0.4 0.3 0.2 0.007 0.3 0.2 0.1 0.005 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + length = [[10]], + fronttexture = [[1InstaHeat1Shock1]], + sidetexture = [[none]], + animParams = [[8,12,90]], -- animated sidetexture params + size = 240, + sizegrowth = [[0.5 r0.3]], + ttl = 90, + pos = [[0, 0, 0]], + rotParams = [[-5 r10, -3 r6, -180 r360]], + drawOrder = 0, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0 1 0.93 0.7 0.008 0.9 0.63 0.26 0.012 0.70 0.38 0.04 0.008 0.15 0.05 0.002 0.005 0.40 0.20 0.04 0.008 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.005, 0]], + numparticles = 4, + particlelife = 52, + particlelifespread = 34, + particlesize = 57, + particlesizespread = 68, + particlespeed = 6, + particlespeedspread = 2, + pos = [[0, 60, 0]], + sizegrowth = 3.2, + sizemod = 0.97, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.97, + colormap = [[0.85 0.75 0.67 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.4 0.22 0.15 0.01 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 13, + particlelife = 80, + particlelifespread = 16, + particlesize = 70, + particlesizespread = 95, + particlespeed = 14, + particlespeedspread = 9, + pos = [[0, 4, 0]], + rotParams = [[-5 r10, -5 r10, -180]], + sizegrowth = -0.04, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + --castShadow = true, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.3 0.055 0.01 0 0 0 0]], + directional = true, + emitrot = 65, + emitrotspread = 30, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 40, + particlelifespread = 0, + particlesize = 128, + particlesizespread = 64, + particlespeed = 3, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, + shockwave = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0.1 1 0.95 0.8 0.48 0.9 0.8 0.70 0.6 0.8 0.65 0.4 0.45 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 1, + sidetexture = [[none]], + size = 8, + sizegrowth = [[-70 r6]], + ttl = 34, + pos = [[0, 75, 0]], + drawOrder = 1, + }, + }, + shockwave_fast = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + unit = true, + properties = { + colormap = [[0 0 0 0.01 0.6 0.5 0.4 0.22 0.4 0.3 0.15 0.15 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[shockwave]], + length = 1, + sidetexture = [[none]], + size = 19, + sizegrowth = [[-58 r4]], + ttl = 13, + pos = [[0, 85, 0]], + drawOrder = 1, + useairlos = false, + alwaysvisible = true, + }, + }, + shockwave_inner = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.7 0.6 0.35 0.25 0.5 0.38 0.15 0.12 0.3 0.25 0.09 0.10 0.10 0.08 0.04 0.008 0.06 0.04 0.02 0.005 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 0, + sidetexture = [[none]], + size = 45, + sizegrowth = [[-15 r6]], + ttl = 95, + pos = [[0, 5, 0]], + }, + }, + shockwave_slow = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.06 0.04 0.02 0.006 0.10 0.08 0.04 0.008 0.18 0.12 0.08 0.010 0.4 0.35 0.3 0.15 0.18 0.12 0.08 0.010 0.10 0.08 0.04 0.005 0.06 0.04 0.02 0.004 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 0, + sidetexture = [[none]], + size = 24, + sizegrowth = [[-15 r3]], + ttl = 120, + pos = [[0, 25, 0]], + }, + }, + bigsmoketrails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 5, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0 0 0 0 0.9 0.63 0.26 0.4 0.07 0.05 0.05 0.25 0.07 0.05 0.05 0.44 0.05 0.04 0.04 0.25 0.03 0.03 0.03 0.15 0 0 0 0.01]], + dir = [[-0.7 r1.4, 0.3 r0.58, 0 r-0.7]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[260 r25]], + sidetexture = [[flamestream]], + size = [[170 r25]], + sizegrowth = 0.75, + ttl = 100, + rotParams = [[-15 r30, -5 r10, -90 r180]], + pos = [[-50 r100, 0 r50, -50 r100]], + drawOrder = 0, + castShadow = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 8, + ground = true, + air = false, + properties = { + airdrag = 0.97, + colormap = [[0.04 0.03 0.01 0 0.15 0.14 0.066 0.50 0.13 0.09 0.05 0.45 0.08 0.065 0.035 0.35 0.075 0.07 0.06 0.20 0 0 0 0 ]], + directional = false, + emitrot = 35, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 6, + particlelife = 100, + particlelifespread = 45, + particlesize = 40, + particlesizespread = -3.6, + particlespeed = 6, + particlespeedspread = 14, + rotParams = [[-20 r40, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.045, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 1, + castShadow = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + air = false, + properties = { + airdrag = 0.98, + colormap = [[0.08 0.06 0.03 0.66 0.12 0.09 0.05 0.58 0.1 0.07 0.03 0.52 0.08 0.065 0.035 0.40 0.075 0.07 0.06 0.3 0 0 0 0 ]], + directional = false, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 18, + particlelife = 180, + particlelifespread = 40, + particlesize = 3, + particlesizespread = -1.5, + particlespeed = 10, + particlespeedspread = 18, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,180 r50]], + useairlos = false, + alwaysvisible = true, + drawOrder = 0, + castShadow = true, + }, + }, + dirt3 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + air = false, + properties = { + airdrag = 0.96, + colormap = [[0.03 0.02 0.01 0.6 0.1 0.07 0.033 0.76 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = false, + emitrot = 45, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.10, 0]], + numparticles = 7, + particlelife = 80, + particlelifespread = 45, + particlesize = 90, + particlesizespread = -3.6, + particlespeed = 8, + particlespeedspread = 4, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + drawOrder = 0, + --castShadow = true, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.05 0.06 0.055 0.055 0.16 0.043 0.04 0.04 0.11 0.0238 0.022 0.022 0.06 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 35, + particlelife = 90, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + rotParams = [[-30 r60, 0, -180 r360]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[smoke-ice-anim]], + animParams = [[8,8,180 r50]], + alwaysvisible = true, + drawOrder = 0, + castShadow = true, + }, + }, + dustparticles = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.94, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 12, + particlelife = 40, + particlelifespread = 5.75, + particlesize = 5, + particlesizespread = 1.5, + particlespeed = 5.8, + particlespeedspread = 2, + rotParams = [[-5 r10, 0, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 0.36 0.32 0.28 0.4 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0.3, 0.7, 0.3]], + gravity = [[-0.1 r0.2, 0 r0.1, -0.1 r0.2]], + numparticles = 1, + particlelife = 130, + particlelifespread = 55, + particlesize = 60, + particlesizespread = 60, + particlespeed = 16, + particlespeedspread = 8, + rotParams = [[-4 r8, -1 r2, -180 r360]], + pos = [[-20 r40, 0 r50, -20 r40]], + sizegrowth = 1.6, + sizemod = 1.0, + texture = [[smoke-ice-anim]], + animParams = [[8,8,180 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, - nukefloor = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[22 i1]], - explosiongenerator = [[custom:newnuke-floor]], - pos = [[-70 r140, 70 r15, -70 r140]], - }, - }, + nukefloor = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[22 i1]], + explosiongenerator = [[custom:newnuke-floor]], + pos = [[-70 r140, 70 r15, -70 r140]], + }, + }, - -- electricstorm = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 0, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- delay = [[15 r90]], - -- explosiongenerator = [[custom:lightning_stormbig]], - -- pos = [[0 r165, 50 r50, 0 r165]], - -- alwaysvisible = true, - -- }, - -- }, + -- electricstorm = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 0, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- delay = [[15 r90]], + -- explosiongenerator = [[custom:lightning_stormbig]], + -- pos = [[0 r165, 50 r50, 0 r165]], + -- alwaysvisible = true, + -- }, + -- }, - -- electricstormalt = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 0, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- delay = [[30 r100]], - -- explosiongenerator = [[custom:lightning_stormbigalt]], - -- pos = [[-100 r160, 55 r50, -100 r160]], - -- }, - -- }, + -- electricstormalt = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 0, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- delay = [[30 r100]], + -- explosiongenerator = [[custom:lightning_stormbigalt]], + -- pos = [[-100 r160, 55 r50, -100 r160]], + -- }, + -- }, - -- electricstormxl = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 0, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- delay = [[60 r110]], - -- explosiongenerator = [[custom:lightning_stormflares]], - -- pos = [[-20 r150, 150 r25, -20 r150]], - -- alwaysvisible = true, - -- }, - -- }, -}, + -- electricstormxl = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 0, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- delay = [[60 r110]], + -- explosiongenerator = [[custom:lightning_stormflares]], + -- pos = [[-20 r150, 150 r25, -20 r150]], + -- alwaysvisible = true, + -- }, + -- }, + }, - ["newnuke-floor"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.86, - --colormap = [[0 0 0 0.01 0.20 0.16 0.14 0.46 0.32 0.244 0.12 0.30 0.24 0.20 0.16 0.62 0.22 0.18 0.14 0.53 0.20 0.16 0.14 0.46 0.18 0.12 0.1 0.42 0.16 0.12 0.08 0.38 0.065 0.048 0.037 0.36 0.045 0.035 0.03 0.32 0.05 0.04 0.035 0.2 0 0 0 0.01]], - --colormap =[[1 0.66 0.4 0.45 0.18 0.15 0.11 0.65 0.13 0.12 0.1 0.55 0.11 0.1 0.093 0.45 0.063 0.062 0.058 0.20 0 0 0 0.01]], - colormap =[[0.9 0.66 0.4 0.45 0.18 0.15 0.11 0.60 0.13 0.12 0.1 0.54 0.11 0.1 0.093 0.32 0 0 0 0.01]], - directional = false, - emitrot = 55, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.02 r0.02, 0.0]], - numparticles = 2, - particlelife = 130, - particlelifespread = 120, - particlesize = 150, - particlesizespread = 180, - particlespeed = 13, - particlespeedspread = 14, - rotParams = [[-15 r30, -1 r2, -180 r360]], - pos = [[0.0, -40 r40, 0.0]], - sizegrowth = [[1.05 r0.07]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,160 r100]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - drawOrder = -1, - }, - }, - smoke1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.20 0.16 0.14 0.46 0.32 0.244 0.12 0.30 0.24 0.20 0.16 0.40 0.22 0.18 0.14 0.45 0.20 0.16 0.14 0.40 0.18 0.12 0.1 0.32 0.12 0.10 0.06 0.27 0.065 0.048 0.037 0.21 0.045 0.035 0.03 0.18 0.05 0.04 0.035 0.13 0 0 0 0.01]], - --colormap =[[1 0.66 0.4 0.45 0.18 0.15 0.11 0.65 0.13 0.12 0.1 0.55 0.11 0.1 0.093 0.45 0.063 0.062 0.058 0.20 0 0 0 0.01]], - --colormap =[[1 0.66 0.4 0.55 0.18 0.15 0.11 0.75 0.13 0.12 0.1 0.65 0.11 0.1 0.093 0.45 0 0 0 0.01]], - directional = false, - emitrot = 95, - emitrotspread = 10, - emitvector = [[0.4, 0.5, 0.4]], - gravity = [[0.01 r0.03, 0.045 r0.02, 0.01 r0.03]], - numparticles = 1, - particlelife = 90, - particlelifespread = 130, - particlesize = 40, - particlesizespread = 100, - particlespeed = 13, - particlespeedspread = 16, - rotParams = [[-15 r30, -1 r2, -180 r360]], - pos = [[-50 r100, 10 r40, -50 r100]], - sizegrowth = [[1.5 r0.5]], - sizemod = 1, - texture = [[bigexplosmoke]], - --animParams = [[8,8,160 r100]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - drawOrder = 0, - }, - }, - smoke2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0 0 0 0.01 0.1 0.09 0.06 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.50 0.22 0.18 0.16 0.45 0.19 0.15 0.15 0.42 0.18 0.14 0.14 0.34 0.17 0.14 0.14 0.30 0.16 0.14 0.13 0.24 0.14 0.10 0.10 0.16 0 0 0 0.01]], - directional = false, - emitrot = 95, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.065, 0.0]], - numparticles = 1, - particlelife = 130, - particlelifespread = 100, - particlesize = 125, - particlesizespread = 115, - particlespeed = 11, - particlespeedspread = 12, - rotParams = [[-15 r30, -4 r8, -180 r360]], - pos = [[0.0, 80, 0.0]], - sizegrowth = 1.01, - sizemod = 1, - texture = [[BARFlame02]], - animParams = [[16,6,170 r80]], - useairlos = true, - alwaysvisible = true, - --castShadow = true, - drawOrder = 0, - }, - }, - smoke3 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - properties = { - airdrag = 0.88, - --colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], - colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.15 0.14 0.08 0.04 0.10 0.09 0.09 0.24 0.08 0.07 0.07 0.16 0 0 0 0.01]], - directional = false, - emitrot = 95, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.045, 0.0]], - numparticles = 1, - particlelife = 130, - particlelifespread = 100, - particlesize = 150, - particlesizespread = 150, - particlespeed = 11, - particlespeedspread = 12, - rotParams = [[-3 r6, -2 r4, -180 r360]], - pos = [[-50 r100, 80, -50 r100]], - sizegrowth = 1.4, - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,180 r40]], - useairlos = true, - alwaysvisible = true, - castShadow = true, - drawOrder = 0, - }, - }, - }, + ["newnuke-floor"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.86, + --colormap = [[0 0 0 0.01 0.20 0.16 0.14 0.46 0.32 0.244 0.12 0.30 0.24 0.20 0.16 0.62 0.22 0.18 0.14 0.53 0.20 0.16 0.14 0.46 0.18 0.12 0.1 0.42 0.16 0.12 0.08 0.38 0.065 0.048 0.037 0.36 0.045 0.035 0.03 0.32 0.05 0.04 0.035 0.2 0 0 0 0.01]], + --colormap =[[1 0.66 0.4 0.45 0.18 0.15 0.11 0.65 0.13 0.12 0.1 0.55 0.11 0.1 0.093 0.45 0.063 0.062 0.058 0.20 0 0 0 0.01]], + colormap = [[0.9 0.66 0.4 0.45 0.18 0.15 0.11 0.60 0.13 0.12 0.1 0.54 0.11 0.1 0.093 0.32 0 0 0 0.01]], + directional = false, + emitrot = 55, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.02 r0.02, 0.0]], + numparticles = 2, + particlelife = 130, + particlelifespread = 120, + particlesize = 150, + particlesizespread = 180, + particlespeed = 13, + particlespeedspread = 14, + rotParams = [[-15 r30, -1 r2, -180 r360]], + pos = [[0.0, -40 r40, 0.0]], + sizegrowth = [[1.05 r0.07]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,160 r100]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + drawOrder = -1, + }, + }, + smoke1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.20 0.16 0.14 0.46 0.32 0.244 0.12 0.30 0.24 0.20 0.16 0.40 0.22 0.18 0.14 0.45 0.20 0.16 0.14 0.40 0.18 0.12 0.1 0.32 0.12 0.10 0.06 0.27 0.065 0.048 0.037 0.21 0.045 0.035 0.03 0.18 0.05 0.04 0.035 0.13 0 0 0 0.01]], + --colormap =[[1 0.66 0.4 0.45 0.18 0.15 0.11 0.65 0.13 0.12 0.1 0.55 0.11 0.1 0.093 0.45 0.063 0.062 0.058 0.20 0 0 0 0.01]], + --colormap =[[1 0.66 0.4 0.55 0.18 0.15 0.11 0.75 0.13 0.12 0.1 0.65 0.11 0.1 0.093 0.45 0 0 0 0.01]], + directional = false, + emitrot = 95, + emitrotspread = 10, + emitvector = [[0.4, 0.5, 0.4]], + gravity = [[0.01 r0.03, 0.045 r0.02, 0.01 r0.03]], + numparticles = 1, + particlelife = 90, + particlelifespread = 130, + particlesize = 40, + particlesizespread = 100, + particlespeed = 13, + particlespeedspread = 16, + rotParams = [[-15 r30, -1 r2, -180 r360]], + pos = [[-50 r100, 10 r40, -50 r100]], + sizegrowth = [[1.5 r0.5]], + sizemod = 1, + texture = [[bigexplosmoke]], + --animParams = [[8,8,160 r100]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + drawOrder = 0, + }, + }, + smoke2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.1 0.09 0.06 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.50 0.22 0.18 0.16 0.45 0.19 0.15 0.15 0.42 0.18 0.14 0.14 0.34 0.17 0.14 0.14 0.30 0.16 0.14 0.13 0.24 0.14 0.10 0.10 0.16 0 0 0 0.01]], + directional = false, + emitrot = 95, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.065, 0.0]], + numparticles = 1, + particlelife = 130, + particlelifespread = 100, + particlesize = 125, + particlesizespread = 115, + particlespeed = 11, + particlespeedspread = 12, + rotParams = [[-15 r30, -4 r8, -180 r360]], + pos = [[0.0, 80, 0.0]], + sizegrowth = 1.01, + sizemod = 1, + texture = [[BARFlame02]], + animParams = [[16,6,170 r80]], + useairlos = true, + alwaysvisible = true, + --castShadow = true, + drawOrder = 0, + }, + }, + smoke3 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + properties = { + airdrag = 0.88, + --colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.20 0.14 0.08 0.04 0.30 0.22 0.10 0.20 0.22 0.18 0.17 0.55 0.20 0.16 0.14 0.50 0.17 0.13 0.13 0.42 0.12 0.10 0.10 0.36 0.13 0.10 0.10 0.30 0.11 0.09 0.09 0.24 0.10 0.07 0.07 0.16 0 0 0 0.01]], + colormap = [[0 0 0 0.01 0.13 0.10 0.07 0.05 0.15 0.14 0.08 0.04 0.10 0.09 0.09 0.24 0.08 0.07 0.07 0.16 0 0 0 0.01]], + directional = false, + emitrot = 95, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.045, 0.0]], + numparticles = 1, + particlelife = 130, + particlelifespread = 100, + particlesize = 150, + particlesizespread = 150, + particlespeed = 11, + particlespeedspread = 12, + rotParams = [[-3 r6, -2 r4, -180 r360]], + pos = [[-50 r100, 80, -50 r100]], + sizegrowth = 1.4, + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,180 r40]], + useairlos = true, + alwaysvisible = true, + castShadow = true, + drawOrder = 0, + }, + }, + }, - ["armnuke"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 9, - sizegrowth = 40, - speed = [[0, 1 0, 0]], - texture = [[flare]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], - size = 900, - ttl = 40, - sizegrowth = -1, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - properties = { - colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], - size = 1200, - sizegrowth = 0, - ttl = 45, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 100, - particlelife = 2, - particlelifespread = 45, - particlesize = 3, - particlesizespread = 1.5, - particlespeed = 12, - particlespeedspread = 20, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.82, - colormap = [[0 0 0 0 1 0.93 0.7 0.09 0.9 0.53 0.21 0.066 0.66 0.28 0.04 0.033 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 22, - particlelife = 18, - particlelifespread = 13, - particlesize = 20, - particlesizespread = 32, - particlespeed = 6, - particlespeedspread = 8, - pos = [[0, 15, 0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.8 0.5 0.2 0.01 0.95 0.55 0.25 0.017 0.6 0.35 0.1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.55, 0]], - numparticles = 35, - particlelife = 22, - particlelifespread = 22, - particlesize = 140, - particlesizespread = 200, - particlespeed = 9, - particlespeedspread = 18, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.7, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.98, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 25, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.55, 0]], - numparticles = 40, - particlelife = 55, - particlelifespread = 25, - particlesize = 3, - particlesizespread = -1.8, - particlespeed = 9, - particlespeedspread = 22, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.96, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.55, 0]], - numparticles = 10, - particlelife = 45, - particlelifespread = 20, - particlesize = 2.7, - particlesizespread = -1.5, - particlespeed = 9, - particlespeedspread = 22, - pos = [[0, 3, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.05 0.06 0.055 0.055 0.1 0.043 0.04 0.04 0.06 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 15, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.01, 0]], - numparticles = 35, - particlelife = 90, - particlelifespread = 150, - particlesize = 66, - particlesizespread = 40, - particlespeed = 0.3, - particlespeedspread = 6, - pos = [[0, 40, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - castShadow = true, - }, - }, + ["armnuke"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.45 0 0 0 0.01]], + size = 900, + ttl = 40, + sizegrowth = -1, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + properties = { + colormap = [[1 0.9 0.75 0.55 0 0 0 0.01]], + size = 1200, + sizegrowth = 0, + ttl = 45, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 100, + particlelife = 2, + particlelifespread = 45, + particlesize = 3, + particlesizespread = 1.5, + particlespeed = 12, + particlespeedspread = 20, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.82, + colormap = [[0 0 0 0 1 0.93 0.7 0.09 0.9 0.53 0.21 0.066 0.66 0.28 0.04 0.033 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 22, + particlelife = 18, + particlelifespread = 13, + particlesize = 20, + particlesizespread = 32, + particlespeed = 6, + particlespeedspread = 8, + pos = [[0, 15, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.8 0.5 0.2 0.01 0.95 0.55 0.25 0.017 0.6 0.35 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.55, 0]], + numparticles = 35, + particlelife = 22, + particlelifespread = 22, + particlesize = 140, + particlesizespread = 200, + particlespeed = 9, + particlespeedspread = 18, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.7, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.98, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 25, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.55, 0]], + numparticles = 40, + particlelife = 55, + particlelifespread = 25, + particlesize = 3, + particlesizespread = -1.8, + particlespeed = 9, + particlespeedspread = 22, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.96, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.55, 0]], + numparticles = 10, + particlelife = 45, + particlelifespread = 20, + particlesize = 2.7, + particlesizespread = -1.5, + particlespeed = 9, + particlespeedspread = 22, + pos = [[0, 3, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.05 0.06 0.055 0.055 0.1 0.043 0.04 0.04 0.06 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 15, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.01, 0]], + numparticles = 35, + particlelife = 90, + particlelifespread = 150, + particlesize = 66, + particlesizespread = 40, + particlespeed = 0.3, + particlespeedspread = 6, + pos = [[0, 40, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + castShadow = true, + }, + }, - nukefloor = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i1]], - explosiongenerator = [[custom:armnuke-floor]], - pos = [[-50 r100, 40, -50 r100]], - }, - }, - nukestem = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i1.5]], - explosiongenerator = [[custom:armnuke-stem]], - pos = [[-10 r20, -66 r33 i30, -10 r20]], - }, - }, - nukestem2 = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i1]], - explosiongenerator = [[custom:armnuke-stem2]], - pos = [[-10 r20, -66 r33 i30, -10 r20]], - }, - }, - --nukemid = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 7, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[6 i2]], - -- explosiongenerator = [[custom:armnuke-mid]], - -- pos = [[-10 r20, 90 i5.5, -10 r20]], - -- }, - --}, - nukeheadring = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[4 i1]], - explosiongenerator = [[custom:armnuke-headring]], - pos = [[0, 235, 0]], - }, - }, - nukehead = { - air = true, - class = [[CExpGenSpawner]], - count = 8, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[8.5 i1]], - explosiongenerator = [[custom:armnuke-head]], - pos = [[-25 r50, 245 i2.7, -25 r50]], - }, - }, - }, - - ["armnuke-floor"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.4, - colormap = [[0.63 0.5 0.4 0.01 0.28 0.25 0.21 0.4 0.18 0.16 0.14 0.38 0.15 0.14 0.13 0.38 0.14 0.13 0.12 0.34 0.108 0.1 0.09 0.26 0.105 0.1 0.09 0.26 0.1 0.095 0.085 0.2 0.095 0.09 0.085 0.2 0.045 0.045 0.04 0.1 0.045 0.045 0.04 0.1 0.022 0.022 0.02 0.05 0.022 0.022 0.02 0.05 0 0 0 0.01]], - directional = true, - emitrot = 94, - emitrotspread = 3, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.005, 0.0]], - numparticles = 65, - particlelife = 120, - particlelifespread = 75, - particlesize = 26, - particlesizespread = 12, - particlespeed = 15, - particlespeedspread = 180, - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["armnuke-stem"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.25 0.21 0.1 0.5 0.45 0.27 0.18 0.45 0.3 0.22 0.13 0.4 0.25 0.17 0.13 0.37 0.33 0.24 0.12 0.35 0.25 0.2 0.12 0.35 0.18 0.14 0.11 0.3 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 15, - particlesizespread = 6, - particlespeed = 5.5, - particlespeedspread = 3.5, - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["armnuke-stem2"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.9, - colormap = [[0.17 0.15 0.12 0.15 0.17 0.15 0.11 0.4 0.17 0.14 0.1 0.38 0.17 0.14 0.1 0.38 0.16 0.13 0.095 0.34 0.13 0.11 0.09 0.26 0.11 0.095 0.075 0.2 0.085 0.075 0.07 0.15 0 0 0 0.01]], - directional = true, - emitrot = 2, - emitrotspread = 2, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.08, 0.0]], - numparticles = [[4 r1.5]], - particlelife = 50, - particlelifespread = 20, - particlesize = 14, - particlesizespread = 5, - particlespeed = 3, - particlespeedspread = 5, - pos = [[0.0, 0, 0.0]], - sizegrowth = 0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["armnuke-mid"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.82, - colormap = [[0.38 0.28 0.18 0.4 0.22 0.16 0.1 0.33 0.2 0.15 0.1 0.3 0.2 0.15 0.1 0.3 0.22 0.18 0.09 0.25 0.2 0.15 0.07 0.22 0.19 0.16 0.1 0.25 0 0 0 0.01]], - directional = true, - emitrot = 100, - emitrotspread = 1, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.3, 0.0]], - numparticles = 3, - particlelife = 36, - particlelifespread = 10, - particlesize = 13, - particlesizespread = 8, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 5, 0]], - sizegrowth = -0.15, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["armnuke-headring"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.44, - colormap = [[0 0 0 0.01 0.006 0.003 0.001 0.009 0.2 0.15 0.07 0.03 0.3 0.23 0.1 0.35 0.4 0.29 0.15 0.42 0.7 0.5 0.28 0.4 0.55 0.3 0.25 0.32 0.45 0.225 0.13 0.25 0.3 0.2 0.07 0.2 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 2, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.66, 0.0]], - numparticles = 40, - particlelife = 24, - particlelifespread = 24, - particlesize = 33, - particlesizespread = 3, - particlespeed = 23, - particlespeedspread = 1, - pos = [[48, 48, 48]], - sizegrowth = -0.6, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - ["armnuke-head"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[0.022 0.019 0.015 0.04 0.055 0.045 0.04 0.08 0.18 0.15 0.13 0.33 0.13 0.11 0.095 0.27 0.11 0.09 0.08 0.22 0.06 0.05 0.045 0.145 0.043 0.04 0.03 0.1 0 0 0 0.01]], - directional = true, - emitrot = 100, - emitrotspread = 2, - emitvector = [[0, 1, 0]], - gravity = [[0.0, 0.015, 0.0]], - numparticles = 7, - particlelife = 40, - particlelifespread = 55, - particlesize = 6.5, - particlesizespread = 6.5, - particlespeed = 1, - particlespeedspread = 2, - pos = [[50, 50, 50]], - sizegrowth = 0.27, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + nukefloor = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i1]], + explosiongenerator = [[custom:armnuke-floor]], + pos = [[-50 r100, 40, -50 r100]], + }, + }, + nukestem = { + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i1.5]], + explosiongenerator = [[custom:armnuke-stem]], + pos = [[-10 r20, -66 r33 i30, -10 r20]], + }, + }, + nukestem2 = { + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i1]], + explosiongenerator = [[custom:armnuke-stem2]], + pos = [[-10 r20, -66 r33 i30, -10 r20]], + }, + }, + --nukemid = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 7, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[6 i2]], + -- explosiongenerator = [[custom:armnuke-mid]], + -- pos = [[-10 r20, 90 i5.5, -10 r20]], + -- }, + --}, + nukeheadring = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[4 i1]], + explosiongenerator = [[custom:armnuke-headring]], + pos = [[0, 235, 0]], + }, + }, + nukehead = { + air = true, + class = [[CExpGenSpawner]], + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[8.5 i1]], + explosiongenerator = [[custom:armnuke-head]], + pos = [[-25 r50, 245 i2.7, -25 r50]], + }, + }, + }, + ["armnuke-floor"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.4, + colormap = [[0.63 0.5 0.4 0.01 0.28 0.25 0.21 0.4 0.18 0.16 0.14 0.38 0.15 0.14 0.13 0.38 0.14 0.13 0.12 0.34 0.108 0.1 0.09 0.26 0.105 0.1 0.09 0.26 0.1 0.095 0.085 0.2 0.095 0.09 0.085 0.2 0.045 0.045 0.04 0.1 0.045 0.045 0.04 0.1 0.022 0.022 0.02 0.05 0.022 0.022 0.02 0.05 0 0 0 0.01]], + directional = true, + emitrot = 94, + emitrotspread = 3, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.005, 0.0]], + numparticles = 65, + particlelife = 120, + particlelifespread = 75, + particlesize = 26, + particlesizespread = 12, + particlespeed = 15, + particlespeedspread = 180, + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["armnuke-stem"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.25 0.21 0.1 0.5 0.45 0.27 0.18 0.45 0.3 0.22 0.13 0.4 0.25 0.17 0.13 0.37 0.33 0.24 0.12 0.35 0.25 0.2 0.12 0.35 0.18 0.14 0.11 0.3 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 15, + particlesizespread = 6, + particlespeed = 5.5, + particlespeedspread = 3.5, + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["armnuke-stem2"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + colormap = [[0.17 0.15 0.12 0.15 0.17 0.15 0.11 0.4 0.17 0.14 0.1 0.38 0.17 0.14 0.1 0.38 0.16 0.13 0.095 0.34 0.13 0.11 0.09 0.26 0.11 0.095 0.075 0.2 0.085 0.075 0.07 0.15 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 2, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.08, 0.0]], + numparticles = [[4 r1.5]], + particlelife = 50, + particlelifespread = 20, + particlesize = 14, + particlesizespread = 5, + particlespeed = 3, + particlespeedspread = 5, + pos = [[0.0, 0, 0.0]], + sizegrowth = 0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["armnuke-mid"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.82, + colormap = [[0.38 0.28 0.18 0.4 0.22 0.16 0.1 0.33 0.2 0.15 0.1 0.3 0.2 0.15 0.1 0.3 0.22 0.18 0.09 0.25 0.2 0.15 0.07 0.22 0.19 0.16 0.1 0.25 0 0 0 0.01]], + directional = true, + emitrot = 100, + emitrotspread = 1, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.3, 0.0]], + numparticles = 3, + particlelife = 36, + particlelifespread = 10, + particlesize = 13, + particlesizespread = 8, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 5, 0]], + sizegrowth = -0.15, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["armnuke-headring"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.44, + colormap = [[0 0 0 0.01 0.006 0.003 0.001 0.009 0.2 0.15 0.07 0.03 0.3 0.23 0.1 0.35 0.4 0.29 0.15 0.42 0.7 0.5 0.28 0.4 0.55 0.3 0.25 0.32 0.45 0.225 0.13 0.25 0.3 0.2 0.07 0.2 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 2, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.66, 0.0]], + numparticles = 40, + particlelife = 24, + particlelifespread = 24, + particlesize = 33, + particlesizespread = 3, + particlespeed = 23, + particlespeedspread = 1, + pos = [[48, 48, 48]], + sizegrowth = -0.6, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + ["armnuke-head"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[0.022 0.019 0.015 0.04 0.055 0.045 0.04 0.08 0.18 0.15 0.13 0.33 0.13 0.11 0.095 0.27 0.11 0.09 0.08 0.22 0.06 0.05 0.045 0.145 0.043 0.04 0.03 0.1 0 0 0 0.01]], + directional = true, + emitrot = 100, + emitrotspread = 2, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.015, 0.0]], + numparticles = 7, + particlelife = 40, + particlelifespread = 55, + particlesize = 6.5, + particlesizespread = 6.5, + particlespeed = 1, + particlespeedspread = 2, + pos = [[50, 50, 50]], + sizegrowth = 0.27, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, } -- local size = 1.5 @@ -1427,232 +1426,231 @@ local definitions = { -- definitions['cornuke'].groundflash_large.properties.size = math.floor(definitions['cornuke'].groundflash_large.properties.size * size) -- definitions['cornuke'].groundflash_white.properties.size = math.floor(definitions['cornuke'].groundflash_white.properties.size * size) - local size = 1.5 -definitions['newnukecor-floor'] = table.copy(definitions['newnuke-floor']) -definitions['newnukecor-floor'].smoke.properties.numparticles = math.floor(definitions['newnukecor-floor'].smoke.properties.numparticles * size * 1.3) -definitions['newnukecor-floor'].smoke.properties.particlesize = math.floor(definitions['newnukecor-floor'].smoke.properties.particlesize * size * 1.3) -definitions['newnukecor-floor'].smoke.properties.particlespeed = math.floor(definitions['newnukecor-floor'].smoke.properties.particlespeed * size) -definitions['newnukecor-floor'].smoke.properties.particlespeedspread = math.floor(definitions['newnukecor-floor'].smoke.properties.particlespeedspread * size) +definitions["newnukecor-floor"] = table.copy(definitions["newnuke-floor"]) +definitions["newnukecor-floor"].smoke.properties.numparticles = math.floor(definitions["newnukecor-floor"].smoke.properties.numparticles * size * 1.3) +definitions["newnukecor-floor"].smoke.properties.particlesize = math.floor(definitions["newnukecor-floor"].smoke.properties.particlesize * size * 1.3) +definitions["newnukecor-floor"].smoke.properties.particlespeed = math.floor(definitions["newnukecor-floor"].smoke.properties.particlespeed * size) +definitions["newnukecor-floor"].smoke.properties.particlespeedspread = math.floor(definitions["newnukecor-floor"].smoke.properties.particlespeedspread * size) --definitions['newnukecor-floor'].smoke1.properties.numparticles = math.floor(definitions['newnukecor-floor'].smoke1.properties.numparticles * size * 1.3) -definitions['newnukecor-floor'].smoke1.properties.particlesize = math.floor(definitions['newnukecor-floor'].smoke1.properties.particlesize * size * 1.3) -definitions['newnukecor-floor'].smoke1.properties.particlespeed = math.floor(definitions['newnukecor-floor'].smoke1.properties.particlespeed * size) -definitions['newnukecor-floor'].smoke1.properties.particlespeedspread = math.floor(definitions['newnukecor-floor'].smoke1.properties.particlespeedspread * size) -definitions['newnukecor-floor'].smoke3.properties.particlesize = math.floor(definitions['newnukecor-floor'].smoke3.properties.particlesize * size * 1.3) +definitions["newnukecor-floor"].smoke1.properties.particlesize = math.floor(definitions["newnukecor-floor"].smoke1.properties.particlesize * size * 1.3) +definitions["newnukecor-floor"].smoke1.properties.particlespeed = math.floor(definitions["newnukecor-floor"].smoke1.properties.particlespeed * size) +definitions["newnukecor-floor"].smoke1.properties.particlespeedspread = math.floor(definitions["newnukecor-floor"].smoke1.properties.particlespeedspread * size) +definitions["newnukecor-floor"].smoke3.properties.particlesize = math.floor(definitions["newnukecor-floor"].smoke3.properties.particlesize * size * 1.3) -- -definitions['newnukecor'] = table.copy(definitions['newnuke']) -definitions['newnukecor'].nukefloor.properties.explosiongenerator = [[custom:newnukecor-floor]] +definitions["newnukecor"] = table.copy(definitions["newnuke"]) +definitions["newnukecor"].nukefloor.properties.explosiongenerator = [[custom:newnukecor-floor]] -definitions['newnukecor'].sparks.properties.particlespeed = math.floor(definitions['newnukecor'].sparks.properties.particlespeed * size) -definitions['newnukecor'].sparks.properties.particlespeedspread = math.floor(definitions['newnukecor'].sparks.properties.particlespeedspread * size) -definitions['newnukecor'].explosion_flames.properties.particlespeed = math.floor(definitions['newnukecor'].explosion_flames.properties.particlespeed * size) -definitions['newnukecor'].explosion_flames.properties.particlesize = math.floor(definitions['newnukecor'].explosion_flames.properties.particlesize * size) -definitions['newnukecor'].explosion.properties.particlespeed = math.floor(definitions['newnukecor'].explosion.properties.particlespeed * size) -definitions['newnukecor'].explosion.properties.particlesize = math.floor(definitions['newnukecor'].explosion.properties.particlesize * size) -definitions['newnukecor'].dustparticles.properties.particlespeed = math.floor(definitions['newnukecor'].dustparticles.properties.particlespeed * size) -definitions['newnukecor'].dustparticles.properties.particlesize = math.floor(definitions['newnukecor'].dustparticles.properties.particlesize * size) -definitions['newnukecor'].clouddust.properties.particlespeed = math.floor(definitions['newnukecor'].clouddust.properties.particlespeed * size) -definitions['newnukecor'].clouddust.properties.particlesize = math.floor(definitions['newnukecor'].clouddust.properties.particlesize * size) -definitions['newnukecor'].dirt.properties.particlespeed = math.floor(definitions['newnukecor'].dirt.properties.particlespeed * size * 0.7) -definitions['newnukecor'].dirt.properties.particlespeedspread = math.floor(definitions['newnukecor'].dirt.properties.particlespeedspread * size * 0.7) -definitions['newnukecor'].dirt.properties.numparticles = math.floor(definitions['newnukecor'].dirt.properties.numparticles * size) -definitions['newnukecor'].dirt2.properties.particlespeed = math.floor(definitions['newnukecor'].dirt2.properties.particlespeed * size * 0.7) -definitions['newnukecor'].dirt2.properties.particlespeedspread = math.floor(definitions['newnukecor'].dirt2.properties.particlespeedspread * size * 0.7) -definitions['newnukecor'].dirt2.properties.numparticles = math.floor(definitions['newnukecor'].dirt2.properties.numparticles * size) -definitions['newnukecor'].brightflare.properties.ttl = math.floor(definitions['newnukecor'].brightflare.properties.ttl * size * 0.7) -definitions['newnukecor'].shockwave.properties.ttl = math.floor(definitions['newnukecor'].shockwave.properties.ttl * size) -definitions['newnukecor'].shockwave_fast.properties.size = math.floor(definitions['newnukecor'].shockwave_fast.properties.size * size * 0.95) -definitions['newnukecor'].shockwave_fast.properties.ttl = math.floor(definitions['newnukecor'].shockwave_fast.properties.ttl * size * 0.85) -definitions['newnukecor'].shockwave_slow.properties.ttl = math.floor(definitions['newnukecor'].shockwave_slow.properties.ttl * size) -definitions['newnukecor'].shockwave_inner.properties.ttl = math.floor(definitions['newnukecor'].shockwave_inner.properties.ttl * size) +definitions["newnukecor"].sparks.properties.particlespeed = math.floor(definitions["newnukecor"].sparks.properties.particlespeed * size) +definitions["newnukecor"].sparks.properties.particlespeedspread = math.floor(definitions["newnukecor"].sparks.properties.particlespeedspread * size) +definitions["newnukecor"].explosion_flames.properties.particlespeed = math.floor(definitions["newnukecor"].explosion_flames.properties.particlespeed * size) +definitions["newnukecor"].explosion_flames.properties.particlesize = math.floor(definitions["newnukecor"].explosion_flames.properties.particlesize * size) +definitions["newnukecor"].explosion.properties.particlespeed = math.floor(definitions["newnukecor"].explosion.properties.particlespeed * size) +definitions["newnukecor"].explosion.properties.particlesize = math.floor(definitions["newnukecor"].explosion.properties.particlesize * size) +definitions["newnukecor"].dustparticles.properties.particlespeed = math.floor(definitions["newnukecor"].dustparticles.properties.particlespeed * size) +definitions["newnukecor"].dustparticles.properties.particlesize = math.floor(definitions["newnukecor"].dustparticles.properties.particlesize * size) +definitions["newnukecor"].clouddust.properties.particlespeed = math.floor(definitions["newnukecor"].clouddust.properties.particlespeed * size) +definitions["newnukecor"].clouddust.properties.particlesize = math.floor(definitions["newnukecor"].clouddust.properties.particlesize * size) +definitions["newnukecor"].dirt.properties.particlespeed = math.floor(definitions["newnukecor"].dirt.properties.particlespeed * size * 0.7) +definitions["newnukecor"].dirt.properties.particlespeedspread = math.floor(definitions["newnukecor"].dirt.properties.particlespeedspread * size * 0.7) +definitions["newnukecor"].dirt.properties.numparticles = math.floor(definitions["newnukecor"].dirt.properties.numparticles * size) +definitions["newnukecor"].dirt2.properties.particlespeed = math.floor(definitions["newnukecor"].dirt2.properties.particlespeed * size * 0.7) +definitions["newnukecor"].dirt2.properties.particlespeedspread = math.floor(definitions["newnukecor"].dirt2.properties.particlespeedspread * size * 0.7) +definitions["newnukecor"].dirt2.properties.numparticles = math.floor(definitions["newnukecor"].dirt2.properties.numparticles * size) +definitions["newnukecor"].brightflare.properties.ttl = math.floor(definitions["newnukecor"].brightflare.properties.ttl * size * 0.7) +definitions["newnukecor"].shockwave.properties.ttl = math.floor(definitions["newnukecor"].shockwave.properties.ttl * size) +definitions["newnukecor"].shockwave_fast.properties.size = math.floor(definitions["newnukecor"].shockwave_fast.properties.size * size * 0.95) +definitions["newnukecor"].shockwave_fast.properties.ttl = math.floor(definitions["newnukecor"].shockwave_fast.properties.ttl * size * 0.85) +definitions["newnukecor"].shockwave_slow.properties.ttl = math.floor(definitions["newnukecor"].shockwave_slow.properties.ttl * size) +definitions["newnukecor"].shockwave_inner.properties.ttl = math.floor(definitions["newnukecor"].shockwave_inner.properties.ttl * size) -- definitions['newnukecor'].centerflare.properties.size = math.floor(definitions['newnukecor'].centerflare.properties.size * size * 1.2) -- definitions['newnukecor'].centerflare.properties.heat = math.floor(definitions['newnukecor'].centerflare.properties.heat * size * 0.85) -- definitions['newnukecor'].centerflare.properties.maxheat = math.floor(definitions['newnukecor'].centerflare.properties.maxheat * size) -definitions['newnukecor'].centerflare.properties.size = [[48 r7]] -definitions['newnukecor'].centerflare.properties.heat = math.floor(definitions['newnukecor'].centerflare.properties.heat * size * 0.85) -definitions['newnukecor'].centerflare.properties.maxheat = math.floor(definitions['newnukecor'].centerflare.properties.maxheat * size) -definitions['newnukecor'].groundflash_large.properties.size = math.floor(definitions['newnukecor'].groundflash_large.properties.size * size) -definitions['newnukecor'].groundflash_white.properties.size = math.floor(definitions['newnukecor'].groundflash_white.properties.size * size) -definitions['newnukecor'].groundflash_quick.properties.size = math.floor(definitions['newnukecor'].groundflash_quick.properties.size * size) +definitions["newnukecor"].centerflare.properties.size = [[48 r7]] +definitions["newnukecor"].centerflare.properties.heat = math.floor(definitions["newnukecor"].centerflare.properties.heat * size * 0.85) +definitions["newnukecor"].centerflare.properties.maxheat = math.floor(definitions["newnukecor"].centerflare.properties.maxheat * size) +definitions["newnukecor"].groundflash_large.properties.size = math.floor(definitions["newnukecor"].groundflash_large.properties.size * size) +definitions["newnukecor"].groundflash_white.properties.size = math.floor(definitions["newnukecor"].groundflash_white.properties.size * size) +definitions["newnukecor"].groundflash_quick.properties.size = math.floor(definitions["newnukecor"].groundflash_quick.properties.size * size) -definitions['newnukecor'].groundflash_anim.properties.size = math.floor(definitions['newnukecor'].groundflash_anim.properties.size * size) -definitions['newnukecor'].airflash_anim.properties.size = math.floor(definitions['newnukecor'].airflash_anim.properties.size * size) +definitions["newnukecor"].groundflash_anim.properties.size = math.floor(definitions["newnukecor"].groundflash_anim.properties.size * size) +definitions["newnukecor"].airflash_anim.properties.size = math.floor(definitions["newnukecor"].airflash_anim.properties.size * size) -definitions['newnukecor'].bigsmoketrails.properties.size = [[226 r45]] -definitions['newnukecor'].bigsmoketrails.properties.length = [[310 r45]] -definitions['newnukecor'].bigsmoketrails.count = 7 +definitions["newnukecor"].bigsmoketrails.properties.size = [[226 r45]] +definitions["newnukecor"].bigsmoketrails.properties.length = [[310 r45]] +definitions["newnukecor"].bigsmoketrails.count = 7 local size = 2.2 -definitions['newnukehuge-floor'] = table.copy(definitions['newnuke-floor']) -definitions['newnukehuge-floor'].smoke.properties.numparticles = math.floor(definitions['newnukehuge-floor'].smoke.properties.numparticles * size) -definitions['newnukehuge-floor'].smoke.properties.particlespeed = math.floor(definitions['newnukehuge-floor'].smoke.properties.particlespeed * size) -definitions['newnukehuge-floor'].smoke.properties.particlespeedspread = math.floor(definitions['newnukehuge-floor'].smoke.properties.particlespeedspread * size) -definitions['newnukehuge-floor'].smoke1.properties.numparticles = math.floor(definitions['newnukehuge-floor'].smoke1.properties.numparticles * size) -definitions['newnukehuge-floor'].smoke1.properties.particlespeed = math.floor(definitions['newnukehuge-floor'].smoke1.properties.particlespeed * size) -definitions['newnukehuge-floor'].smoke1.properties.particlespeedspread = math.floor(definitions['newnukehuge-floor'].smoke1.properties.particlespeedspread * size) -definitions['newnukehuge-floor'].smoke3.properties.particlesize = math.floor(definitions['newnukehuge-floor'].smoke3.properties.particlesize * size * 1.3) +definitions["newnukehuge-floor"] = table.copy(definitions["newnuke-floor"]) +definitions["newnukehuge-floor"].smoke.properties.numparticles = math.floor(definitions["newnukehuge-floor"].smoke.properties.numparticles * size) +definitions["newnukehuge-floor"].smoke.properties.particlespeed = math.floor(definitions["newnukehuge-floor"].smoke.properties.particlespeed * size) +definitions["newnukehuge-floor"].smoke.properties.particlespeedspread = math.floor(definitions["newnukehuge-floor"].smoke.properties.particlespeedspread * size) +definitions["newnukehuge-floor"].smoke1.properties.numparticles = math.floor(definitions["newnukehuge-floor"].smoke1.properties.numparticles * size) +definitions["newnukehuge-floor"].smoke1.properties.particlespeed = math.floor(definitions["newnukehuge-floor"].smoke1.properties.particlespeed * size) +definitions["newnukehuge-floor"].smoke1.properties.particlespeedspread = math.floor(definitions["newnukehuge-floor"].smoke1.properties.particlespeedspread * size) +definitions["newnukehuge-floor"].smoke3.properties.particlesize = math.floor(definitions["newnukehuge-floor"].smoke3.properties.particlesize * size * 1.3) -- -- -definitions['newnukehuge'] = table.copy(definitions['newnuke']) -definitions['newnukehuge'].nukefloor.properties.explosiongenerator = [[custom:newnukehuge-floor]] +definitions["newnukehuge"] = table.copy(definitions["newnuke"]) +definitions["newnukehuge"].nukefloor.properties.explosiongenerator = [[custom:newnukehuge-floor]] -definitions['newnukehuge'].sparks.properties.particlespeed = math.floor(definitions['newnukehuge'].sparks.properties.particlespeed * size) -definitions['newnukehuge'].sparks.properties.particlespeedspread = math.floor(definitions['newnukehuge'].sparks.properties.particlespeedspread * size) -definitions['newnukehuge'].explosion_flames.properties.particlespeed = math.floor(definitions['newnukehuge'].explosion_flames.properties.particlespeed * size) -definitions['newnukehuge'].explosion_flames.properties.particlesize = math.floor(definitions['newnukehuge'].explosion_flames.properties.particlesize * size) -definitions['newnukehuge'].explosion.properties.particlespeed = math.floor(definitions['newnukehuge'].explosion.properties.particlespeed * size) -definitions['newnukehuge'].explosion.properties.particlesize = math.floor(definitions['newnukehuge'].explosion.properties.particlesize * size) -definitions['newnukehuge'].dustparticles.properties.particlespeed = math.floor(definitions['newnukehuge'].dustparticles.properties.particlespeed * size) -definitions['newnukehuge'].dustparticles.properties.particlesize = math.floor(definitions['newnukehuge'].dustparticles.properties.particlesize * size) -definitions['newnukehuge'].clouddust.properties.particlespeed = math.floor(definitions['newnukehuge'].clouddust.properties.particlespeed * size) -definitions['newnukehuge'].clouddust.properties.particlesize = math.floor(definitions['newnukehuge'].clouddust.properties.particlesize * size) -definitions['newnukehuge'].dirt.properties.particlespeed = math.floor(definitions['newnukehuge'].dirt.properties.particlespeed * size * 0.7) -definitions['newnukehuge'].dirt.properties.particlespeedspread = math.floor(definitions['newnukehuge'].dirt.properties.particlespeedspread * size * 0.7) -definitions['newnukehuge'].dirt.properties.numparticles = math.floor(definitions['newnukehuge'].dirt.properties.numparticles * size) -definitions['newnukehuge'].dirt2.properties.particlespeed = math.floor(definitions['newnukehuge'].dirt2.properties.particlespeed * size * 0.7) -definitions['newnukehuge'].dirt2.properties.particlespeedspread = math.floor(definitions['newnukehuge'].dirt2.properties.particlespeedspread * size * 0.7) -definitions['newnukehuge'].dirt2.properties.numparticles = math.floor(definitions['newnukehuge'].dirt2.properties.numparticles * size) -definitions['newnukehuge'].brightflare.properties.ttl = math.floor(definitions['newnukehuge'].brightflare.properties.ttl * size) -definitions['newnukehuge'].shockwave.properties.ttl = math.floor(definitions['newnukehuge'].shockwave.properties.ttl * size) * 0.7 -definitions['newnukehuge'].shockwave_fast.properties.size = math.floor(definitions['newnukehuge'].shockwave_fast.properties.size * size) -definitions['newnukehuge'].shockwave_fast.properties.ttl = math.floor(definitions['newnukehuge'].shockwave_fast.properties.ttl * size) -definitions['newnukehuge'].shockwave_slow.properties.ttl = math.floor(definitions['newnukehuge'].shockwave_slow.properties.ttl * size) -definitions['newnukehuge'].shockwave_inner.properties.ttl = math.floor(definitions['newnukehuge'].shockwave_inner.properties.ttl * size) -definitions['newnukehuge'].centerflare.properties.size = [[64 r9]] -definitions['newnukehuge'].centerflare.properties.heat = math.floor(definitions['newnukehuge'].centerflare.properties.heat * size * 0.7) -definitions['newnukehuge'].centerflare.properties.maxheat = math.floor(definitions['newnukehuge'].centerflare.properties.maxheat * size * 0.7) -definitions['newnukehuge'].groundflash_large.properties.size = math.floor(definitions['newnukehuge'].groundflash_large.properties.size * size) -definitions['newnukehuge'].groundflash_white.properties.size = math.floor(definitions['newnukehuge'].groundflash_white.properties.size * size) -definitions['newnukehuge'].groundflash_anim.properties.size = math.floor(definitions['newnukehuge'].groundflash_anim.properties.size * size * 0.8) -definitions['newnukehuge'].groundflash_anim.properties.ttl = math.floor(definitions['newnukehuge'].groundflash_anim.properties.ttl * size * 0.7) -definitions['newnukehuge'].groundflash_anim.properties.animParams = [[8,12,170]] -definitions['newnukehuge'].groundflash_anim.properties.sizegrowth = math.floor(definitions['newnukehuge'].groundflash_anim.properties.sizegrowth * size * 0.3) -definitions['newnukehuge'].airflash_anim.properties.size = math.floor(definitions['newnukehuge'].airflash_anim.properties.size * size) +definitions["newnukehuge"].sparks.properties.particlespeed = math.floor(definitions["newnukehuge"].sparks.properties.particlespeed * size) +definitions["newnukehuge"].sparks.properties.particlespeedspread = math.floor(definitions["newnukehuge"].sparks.properties.particlespeedspread * size) +definitions["newnukehuge"].explosion_flames.properties.particlespeed = math.floor(definitions["newnukehuge"].explosion_flames.properties.particlespeed * size) +definitions["newnukehuge"].explosion_flames.properties.particlesize = math.floor(definitions["newnukehuge"].explosion_flames.properties.particlesize * size) +definitions["newnukehuge"].explosion.properties.particlespeed = math.floor(definitions["newnukehuge"].explosion.properties.particlespeed * size) +definitions["newnukehuge"].explosion.properties.particlesize = math.floor(definitions["newnukehuge"].explosion.properties.particlesize * size) +definitions["newnukehuge"].dustparticles.properties.particlespeed = math.floor(definitions["newnukehuge"].dustparticles.properties.particlespeed * size) +definitions["newnukehuge"].dustparticles.properties.particlesize = math.floor(definitions["newnukehuge"].dustparticles.properties.particlesize * size) +definitions["newnukehuge"].clouddust.properties.particlespeed = math.floor(definitions["newnukehuge"].clouddust.properties.particlespeed * size) +definitions["newnukehuge"].clouddust.properties.particlesize = math.floor(definitions["newnukehuge"].clouddust.properties.particlesize * size) +definitions["newnukehuge"].dirt.properties.particlespeed = math.floor(definitions["newnukehuge"].dirt.properties.particlespeed * size * 0.7) +definitions["newnukehuge"].dirt.properties.particlespeedspread = math.floor(definitions["newnukehuge"].dirt.properties.particlespeedspread * size * 0.7) +definitions["newnukehuge"].dirt.properties.numparticles = math.floor(definitions["newnukehuge"].dirt.properties.numparticles * size) +definitions["newnukehuge"].dirt2.properties.particlespeed = math.floor(definitions["newnukehuge"].dirt2.properties.particlespeed * size * 0.7) +definitions["newnukehuge"].dirt2.properties.particlespeedspread = math.floor(definitions["newnukehuge"].dirt2.properties.particlespeedspread * size * 0.7) +definitions["newnukehuge"].dirt2.properties.numparticles = math.floor(definitions["newnukehuge"].dirt2.properties.numparticles * size) +definitions["newnukehuge"].brightflare.properties.ttl = math.floor(definitions["newnukehuge"].brightflare.properties.ttl * size) +definitions["newnukehuge"].shockwave.properties.ttl = math.floor(definitions["newnukehuge"].shockwave.properties.ttl * size) * 0.7 +definitions["newnukehuge"].shockwave_fast.properties.size = math.floor(definitions["newnukehuge"].shockwave_fast.properties.size * size) +definitions["newnukehuge"].shockwave_fast.properties.ttl = math.floor(definitions["newnukehuge"].shockwave_fast.properties.ttl * size) +definitions["newnukehuge"].shockwave_slow.properties.ttl = math.floor(definitions["newnukehuge"].shockwave_slow.properties.ttl * size) +definitions["newnukehuge"].shockwave_inner.properties.ttl = math.floor(definitions["newnukehuge"].shockwave_inner.properties.ttl * size) +definitions["newnukehuge"].centerflare.properties.size = [[64 r9]] +definitions["newnukehuge"].centerflare.properties.heat = math.floor(definitions["newnukehuge"].centerflare.properties.heat * size * 0.7) +definitions["newnukehuge"].centerflare.properties.maxheat = math.floor(definitions["newnukehuge"].centerflare.properties.maxheat * size * 0.7) +definitions["newnukehuge"].groundflash_large.properties.size = math.floor(definitions["newnukehuge"].groundflash_large.properties.size * size) +definitions["newnukehuge"].groundflash_white.properties.size = math.floor(definitions["newnukehuge"].groundflash_white.properties.size * size) +definitions["newnukehuge"].groundflash_anim.properties.size = math.floor(definitions["newnukehuge"].groundflash_anim.properties.size * size * 0.8) +definitions["newnukehuge"].groundflash_anim.properties.ttl = math.floor(definitions["newnukehuge"].groundflash_anim.properties.ttl * size * 0.7) +definitions["newnukehuge"].groundflash_anim.properties.animParams = [[8,12,170]] +definitions["newnukehuge"].groundflash_anim.properties.sizegrowth = math.floor(definitions["newnukehuge"].groundflash_anim.properties.sizegrowth * size * 0.3) +definitions["newnukehuge"].airflash_anim.properties.size = math.floor(definitions["newnukehuge"].airflash_anim.properties.size * size) local size = 0.48 -definitions['newnuketac-floor'] = table.copy(definitions['newnuke-floor']) -definitions['newnuketac-floor'].smoke.properties.numparticles = math.floor(definitions['newnuketac-floor'].smoke.properties.numparticles * size * 0.8) -definitions['newnuketac-floor'].smoke.properties.particlespeed = math.floor(definitions['newnuketac-floor'].smoke.properties.particlespeed * size * 0.4) -definitions['newnuketac-floor'].smoke.properties.particlespeedspread = math.floor(definitions['newnuketac-floor'].smoke.properties.particlespeedspread * size * 0.4) -definitions['newnuketac-floor'].smoke.properties.particlesize = math.floor(definitions['newnuketac-floor'].smoke.properties.particlesize * size * 0.4) -definitions['newnuketac-floor'].smoke.properties.particlelife = math.floor(definitions['newnuketac-floor'].smoke.properties.particlelife * size * 0.4) -definitions['newnuketac-floor'].smoke1.properties.particlespeed = math.floor(definitions['newnuketac-floor'].smoke1.properties.particlespeed * size * 0.2) -definitions['newnuketac-floor'].smoke1.properties.particlespeedspread = math.floor(definitions['newnuketac-floor'].smoke1.properties.particlespeedspread * size * 0.2) -definitions['newnuketac-floor'].smoke1.properties.particlesize = math.floor(definitions['newnuketac-floor'].smoke1.properties.particlesize * size * 0.2) -definitions['newnuketac-floor'].smoke1.properties.particlelife = math.floor(definitions['newnuketac-floor'].smoke1.properties.particlelife * size * 0.2) -definitions['newnuketac-floor'].smoke2.properties.particlelife = math.floor(definitions['newnuketac-floor'].smoke2.properties.particlelife * size * 0.4) -definitions['newnuketac-floor'].smoke2.properties.particlespeed = math.floor(definitions['newnuketac-floor'].smoke2.properties.particlespeed * size * 0.4) -definitions['newnuketac-floor'].smoke2.properties.particlesize = math.floor(definitions['newnuketac-floor'].smoke2.properties.particlesize * size * 0.4) -definitions['newnuketac-floor'].smoke3.properties.particlespeed = math.floor(definitions['newnuketac-floor'].smoke3.properties.particlespeed * size * 0.5) -definitions['newnuketac-floor'].smoke3.properties.particlesize = math.floor(definitions['newnuketac-floor'].smoke3.properties.particlesize * size * 0.4) -definitions['newnuketac-floor'].smoke3.properties.particlelife = math.floor(definitions['newnuketac-floor'].smoke3.properties.particlelife * size * 0.6) +definitions["newnuketac-floor"] = table.copy(definitions["newnuke-floor"]) +definitions["newnuketac-floor"].smoke.properties.numparticles = math.floor(definitions["newnuketac-floor"].smoke.properties.numparticles * size * 0.8) +definitions["newnuketac-floor"].smoke.properties.particlespeed = math.floor(definitions["newnuketac-floor"].smoke.properties.particlespeed * size * 0.4) +definitions["newnuketac-floor"].smoke.properties.particlespeedspread = math.floor(definitions["newnuketac-floor"].smoke.properties.particlespeedspread * size * 0.4) +definitions["newnuketac-floor"].smoke.properties.particlesize = math.floor(definitions["newnuketac-floor"].smoke.properties.particlesize * size * 0.4) +definitions["newnuketac-floor"].smoke.properties.particlelife = math.floor(definitions["newnuketac-floor"].smoke.properties.particlelife * size * 0.4) +definitions["newnuketac-floor"].smoke1.properties.particlespeed = math.floor(definitions["newnuketac-floor"].smoke1.properties.particlespeed * size * 0.2) +definitions["newnuketac-floor"].smoke1.properties.particlespeedspread = math.floor(definitions["newnuketac-floor"].smoke1.properties.particlespeedspread * size * 0.2) +definitions["newnuketac-floor"].smoke1.properties.particlesize = math.floor(definitions["newnuketac-floor"].smoke1.properties.particlesize * size * 0.2) +definitions["newnuketac-floor"].smoke1.properties.particlelife = math.floor(definitions["newnuketac-floor"].smoke1.properties.particlelife * size * 0.2) +definitions["newnuketac-floor"].smoke2.properties.particlelife = math.floor(definitions["newnuketac-floor"].smoke2.properties.particlelife * size * 0.4) +definitions["newnuketac-floor"].smoke2.properties.particlespeed = math.floor(definitions["newnuketac-floor"].smoke2.properties.particlespeed * size * 0.4) +definitions["newnuketac-floor"].smoke2.properties.particlesize = math.floor(definitions["newnuketac-floor"].smoke2.properties.particlesize * size * 0.4) +definitions["newnuketac-floor"].smoke3.properties.particlespeed = math.floor(definitions["newnuketac-floor"].smoke3.properties.particlespeed * size * 0.5) +definitions["newnuketac-floor"].smoke3.properties.particlesize = math.floor(definitions["newnuketac-floor"].smoke3.properties.particlesize * size * 0.4) +definitions["newnuketac-floor"].smoke3.properties.particlelife = math.floor(definitions["newnuketac-floor"].smoke3.properties.particlelife * size * 0.6) -- -definitions['newnuketac'] = table.copy(definitions['newnuke']) -definitions['newnuketac'].nukefloor.properties.explosiongenerator = [[custom:newnuketac-floor]] -definitions['newnuketac'].nukefloor.properties.delay = [[10 i0.5]] +definitions["newnuketac"] = table.copy(definitions["newnuke"]) +definitions["newnuketac"].nukefloor.properties.explosiongenerator = [[custom:newnuketac-floor]] +definitions["newnuketac"].nukefloor.properties.delay = [[10 i0.5]] -definitions['newnuketac'].sparks.properties.particlespeed = math.floor(definitions['newnuketac'].sparks.properties.particlespeed * size * 1.2) -definitions['newnuketac'].sparks.properties.particlespeedspread = math.floor(definitions['newnuketac'].sparks.properties.particlespeedspread * size) -definitions['newnuketac'].sparks.properties.particlelife = math.floor(definitions['newnuketac'].sparks.properties.particlelife * size * 0.6) -definitions['newnuketac'].explosion_flames.properties.particlespeed = math.floor(definitions['newnuketac'].explosion_flames.properties.particlespeed * 0.6) -definitions['newnuketac'].explosion_flames.properties.particlesize = math.floor(definitions['newnuketac'].explosion_flames.properties.particlesize * size * 0.7) +definitions["newnuketac"].sparks.properties.particlespeed = math.floor(definitions["newnuketac"].sparks.properties.particlespeed * size * 1.2) +definitions["newnuketac"].sparks.properties.particlespeedspread = math.floor(definitions["newnuketac"].sparks.properties.particlespeedspread * size) +definitions["newnuketac"].sparks.properties.particlelife = math.floor(definitions["newnuketac"].sparks.properties.particlelife * size * 0.6) +definitions["newnuketac"].explosion_flames.properties.particlespeed = math.floor(definitions["newnuketac"].explosion_flames.properties.particlespeed * 0.6) +definitions["newnuketac"].explosion_flames.properties.particlesize = math.floor(definitions["newnuketac"].explosion_flames.properties.particlesize * size * 0.7) --definitions['newnuketac'].explosion_flames.properties.numparticles = math.floor(definitions['newnuketac'].explosion_flames.properties.numparticles * size) -definitions['newnuketac'].explosion_flames.properties.particlelife = math.floor(definitions['newnuketac'].explosion_flames.properties.particlelife * size) -definitions['newnuketac'].explosion.properties.particlespeed = math.floor(definitions['newnuketac'].explosion.properties.particlespeed * size * 0.7) -definitions['newnuketac'].explosion.properties.particlesize = math.floor(definitions['newnuketac'].explosion.properties.particlesize * size * 0.7) -definitions['newnuketac'].explosion.properties.particlelife = math.floor(definitions['newnuketac'].explosion.properties.particlelife * size) -definitions['newnuketac'].dustparticles.properties.particlespeed = math.floor(definitions['newnuketac'].dustparticles.properties.particlespeed * size * 0.6) -definitions['newnuketac'].dustparticles.properties.particlesize = math.floor(definitions['newnuketac'].dustparticles.properties.particlesize * size * 0.5) -definitions['newnuketac'].dustparticles.properties.particlelife = math.floor(definitions['newnuketac'].dustparticles.properties.particlelife * size * 0.5) -definitions['newnuketac'].clouddust.properties.particlespeed = math.floor(definitions['newnuketac'].clouddust.properties.particlespeed * size) -definitions['newnuketac'].clouddust.properties.particlesize = math.floor(definitions['newnuketac'].clouddust.properties.particlesize * size) -definitions['newnuketac'].clouddust.properties.particlelife = math.floor(definitions['newnuketac'].clouddust.properties.particlelife * size * 0.5) +definitions["newnuketac"].explosion_flames.properties.particlelife = math.floor(definitions["newnuketac"].explosion_flames.properties.particlelife * size) +definitions["newnuketac"].explosion.properties.particlespeed = math.floor(definitions["newnuketac"].explosion.properties.particlespeed * size * 0.7) +definitions["newnuketac"].explosion.properties.particlesize = math.floor(definitions["newnuketac"].explosion.properties.particlesize * size * 0.7) +definitions["newnuketac"].explosion.properties.particlelife = math.floor(definitions["newnuketac"].explosion.properties.particlelife * size) +definitions["newnuketac"].dustparticles.properties.particlespeed = math.floor(definitions["newnuketac"].dustparticles.properties.particlespeed * size * 0.6) +definitions["newnuketac"].dustparticles.properties.particlesize = math.floor(definitions["newnuketac"].dustparticles.properties.particlesize * size * 0.5) +definitions["newnuketac"].dustparticles.properties.particlelife = math.floor(definitions["newnuketac"].dustparticles.properties.particlelife * size * 0.5) +definitions["newnuketac"].clouddust.properties.particlespeed = math.floor(definitions["newnuketac"].clouddust.properties.particlespeed * size) +definitions["newnuketac"].clouddust.properties.particlesize = math.floor(definitions["newnuketac"].clouddust.properties.particlesize * size) +definitions["newnuketac"].clouddust.properties.particlelife = math.floor(definitions["newnuketac"].clouddust.properties.particlelife * size * 0.5) -definitions['newnuketac'].dirt.properties.particlespeed = math.floor(definitions['newnuketac'].dirt.properties.particlespeed * size * 0.8) -definitions['newnuketac'].dirt.properties.particlespeedspread = math.floor(definitions['newnuketac'].dirt.properties.particlespeedspread * size * 0.9) -definitions['newnuketac'].dirt.properties.numparticles = math.floor(definitions['newnuketac'].dirt.properties.numparticles * size) -definitions['newnuketac'].dirt2.properties.particlelife = math.floor(definitions['newnuketac'].dirt2.properties.particlelife * size * 0.8) -definitions['newnuketac'].dirt2.properties.particlespeed = math.floor(definitions['newnuketac'].dirt2.properties.particlespeed * size * 0.9) -definitions['newnuketac'].dirt2.properties.particlespeedspread = math.floor(definitions['newnuketac'].dirt2.properties.particlespeedspread * size * 0.9) -definitions['newnuketac'].dirt2.properties.numparticles = math.floor(definitions['newnuketac'].dirt2.properties.numparticles * size) -definitions['newnuketac'].dirt3.properties.particlespeed = math.floor(definitions['newnuketac'].dirt3.properties.particlespeed * size * 0.9) -definitions['newnuketac'].dirt3.properties.particlespeedspread = math.floor(definitions['newnuketac'].dirt3.properties.particlespeedspread * size * 0.9) -definitions['newnuketac'].dirt3.properties.numparticles = math.floor(definitions['newnuketac'].dirt3.properties.numparticles * size) -definitions['newnuketac'].brightflare.properties.ttl = math.floor(definitions['newnuketac'].brightflare.properties.ttl * size * 0.5) -definitions['newnuketac'].brightflare.properties.size = math.floor(definitions['newnuketac'].brightflare.properties.size * size * 0.2) -definitions['newnuketac'].brightflare.properties.pos = [[0, 40, 0]] -definitions['newnuketac'].brightflareslow.properties.ttl = math.floor(definitions['newnuketac'].brightflareslow.properties.ttl * size * 0.5) -definitions['newnuketac'].brightflareslow.properties.size = math.floor(definitions['newnuketac'].brightflareslow.properties.size * size * 0.2) -definitions['newnuketac'].brightflaresingularity.properties.sizegrowth = [[0.4 r0.3]] -definitions['newnuketac'].brightflareslow.properties.sizegrowth = [[0.2 r0.1]] -definitions['newnuketac'].shockwave.properties.ttl = math.floor(definitions['newnuketac'].shockwave.properties.ttl * size * 0.7) -definitions['newnuketac'].shockwave.properties.size = math.floor(definitions['newnuketac'].shockwave.properties.size * size * 1.2) -definitions['newnuketac'].shockwave_fast.properties.size = math.floor(definitions['newnuketac'].shockwave_fast.properties.size * size * 0.6) -definitions['newnuketac'].shockwave_fast.properties.ttl = math.floor(definitions['newnuketac'].shockwave_fast.properties.ttl * size * 1.8) -definitions['newnuketac'].shockwave_slow.properties.ttl = math.floor(definitions['newnuketac'].shockwave_slow.properties.ttl * size * 0.8) -definitions['newnuketac'].shockwave_slow.properties.size = math.floor(definitions['newnuketac'].shockwave_slow.properties.size * size * 1.3) -definitions['newnuketac'].shockwave_inner.properties.ttl = math.floor(definitions['newnuketac'].shockwave_inner.properties.ttl * size * 0.8) -definitions['newnuketac'].shockwave_inner.properties.size = math.floor(definitions['newnuketac'].shockwave_inner.properties.size * size * 0.4) -definitions['newnuketac'].centerflare.properties.size = [[24 r4]] -definitions['newnuketac'].centerflare.properties.heat = math.floor(definitions['newnuketac'].centerflare.properties.heat * size * 1.05) -definitions['newnuketac'].centerflare.properties.maxheat = math.floor(definitions['newnuketac'].centerflare.properties.maxheat * size * 1.05) -definitions['newnuketac'].groundflash_large.properties.size = math.floor(definitions['newnuketac'].groundflash_large.properties.size * size * 0.8) -definitions['newnuketac'].groundflash_large.properties.ttl = math.floor(definitions['newnuketac'].groundflash_large.properties.ttl * size * 0.6) -definitions['newnuketac'].groundflash_white.properties.size = math.floor(definitions['newnuketac'].groundflash_white.properties.size * size * 0.8) -definitions['newnuketac'].groundflash_white.properties.ttl = math.floor(definitions['newnuketac'].groundflash_white.properties.ttl * size * 0.4) -definitions['newnuketac'].groundflash_quick.properties.size = math.floor(definitions['newnuketac'].groundflash_quick.properties.size * size * 0.8) -definitions['newnuketac'].groundflash_quick.properties.ttl = math.floor(definitions['newnuketac'].groundflash_quick.properties.ttl * size * 0.4) -definitions['newnuketac'].groundflash_quick.properties.sizegrowth = math.floor(definitions['newnuketac'].groundflash_quick.properties.sizegrowth * size * 0.8) -definitions['newnuketac'].grounddust.properties.particlesize = math.floor(definitions['newnuketac'].grounddust.properties.particlesize * size) -definitions['newnuketac'].grounddust.properties.particlespeed = math.floor(definitions['newnuketac'].grounddust.properties.particlespeed * size) -definitions['newnuketac'].grounddust.properties.particlespeedspread = math.floor(definitions['newnuketac'].grounddust.properties.particlespeedspread * size) -definitions['newnuketac'].grounddust.properties.particlelife = math.floor(definitions['newnuketac'].grounddust.properties.particlelife * size * 0.5) -definitions['newnuketac'].bigsmoketrails.properties.size = [[130 r25]] -definitions['newnuketac'].bigsmoketrails.properties.length = [[170 r25]] -definitions['newnuketac'].bigsmoketrails.count = 3 +definitions["newnuketac"].dirt.properties.particlespeed = math.floor(definitions["newnuketac"].dirt.properties.particlespeed * size * 0.8) +definitions["newnuketac"].dirt.properties.particlespeedspread = math.floor(definitions["newnuketac"].dirt.properties.particlespeedspread * size * 0.9) +definitions["newnuketac"].dirt.properties.numparticles = math.floor(definitions["newnuketac"].dirt.properties.numparticles * size) +definitions["newnuketac"].dirt2.properties.particlelife = math.floor(definitions["newnuketac"].dirt2.properties.particlelife * size * 0.8) +definitions["newnuketac"].dirt2.properties.particlespeed = math.floor(definitions["newnuketac"].dirt2.properties.particlespeed * size * 0.9) +definitions["newnuketac"].dirt2.properties.particlespeedspread = math.floor(definitions["newnuketac"].dirt2.properties.particlespeedspread * size * 0.9) +definitions["newnuketac"].dirt2.properties.numparticles = math.floor(definitions["newnuketac"].dirt2.properties.numparticles * size) +definitions["newnuketac"].dirt3.properties.particlespeed = math.floor(definitions["newnuketac"].dirt3.properties.particlespeed * size * 0.9) +definitions["newnuketac"].dirt3.properties.particlespeedspread = math.floor(definitions["newnuketac"].dirt3.properties.particlespeedspread * size * 0.9) +definitions["newnuketac"].dirt3.properties.numparticles = math.floor(definitions["newnuketac"].dirt3.properties.numparticles * size) +definitions["newnuketac"].brightflare.properties.ttl = math.floor(definitions["newnuketac"].brightflare.properties.ttl * size * 0.5) +definitions["newnuketac"].brightflare.properties.size = math.floor(definitions["newnuketac"].brightflare.properties.size * size * 0.2) +definitions["newnuketac"].brightflare.properties.pos = [[0, 40, 0]] +definitions["newnuketac"].brightflareslow.properties.ttl = math.floor(definitions["newnuketac"].brightflareslow.properties.ttl * size * 0.5) +definitions["newnuketac"].brightflareslow.properties.size = math.floor(definitions["newnuketac"].brightflareslow.properties.size * size * 0.2) +definitions["newnuketac"].brightflaresingularity.properties.sizegrowth = [[0.4 r0.3]] +definitions["newnuketac"].brightflareslow.properties.sizegrowth = [[0.2 r0.1]] +definitions["newnuketac"].shockwave.properties.ttl = math.floor(definitions["newnuketac"].shockwave.properties.ttl * size * 0.7) +definitions["newnuketac"].shockwave.properties.size = math.floor(definitions["newnuketac"].shockwave.properties.size * size * 1.2) +definitions["newnuketac"].shockwave_fast.properties.size = math.floor(definitions["newnuketac"].shockwave_fast.properties.size * size * 0.6) +definitions["newnuketac"].shockwave_fast.properties.ttl = math.floor(definitions["newnuketac"].shockwave_fast.properties.ttl * size * 1.8) +definitions["newnuketac"].shockwave_slow.properties.ttl = math.floor(definitions["newnuketac"].shockwave_slow.properties.ttl * size * 0.8) +definitions["newnuketac"].shockwave_slow.properties.size = math.floor(definitions["newnuketac"].shockwave_slow.properties.size * size * 1.3) +definitions["newnuketac"].shockwave_inner.properties.ttl = math.floor(definitions["newnuketac"].shockwave_inner.properties.ttl * size * 0.8) +definitions["newnuketac"].shockwave_inner.properties.size = math.floor(definitions["newnuketac"].shockwave_inner.properties.size * size * 0.4) +definitions["newnuketac"].centerflare.properties.size = [[24 r4]] +definitions["newnuketac"].centerflare.properties.heat = math.floor(definitions["newnuketac"].centerflare.properties.heat * size * 1.05) +definitions["newnuketac"].centerflare.properties.maxheat = math.floor(definitions["newnuketac"].centerflare.properties.maxheat * size * 1.05) +definitions["newnuketac"].groundflash_large.properties.size = math.floor(definitions["newnuketac"].groundflash_large.properties.size * size * 0.8) +definitions["newnuketac"].groundflash_large.properties.ttl = math.floor(definitions["newnuketac"].groundflash_large.properties.ttl * size * 0.6) +definitions["newnuketac"].groundflash_white.properties.size = math.floor(definitions["newnuketac"].groundflash_white.properties.size * size * 0.8) +definitions["newnuketac"].groundflash_white.properties.ttl = math.floor(definitions["newnuketac"].groundflash_white.properties.ttl * size * 0.4) +definitions["newnuketac"].groundflash_quick.properties.size = math.floor(definitions["newnuketac"].groundflash_quick.properties.size * size * 0.8) +definitions["newnuketac"].groundflash_quick.properties.ttl = math.floor(definitions["newnuketac"].groundflash_quick.properties.ttl * size * 0.4) +definitions["newnuketac"].groundflash_quick.properties.sizegrowth = math.floor(definitions["newnuketac"].groundflash_quick.properties.sizegrowth * size * 0.8) +definitions["newnuketac"].grounddust.properties.particlesize = math.floor(definitions["newnuketac"].grounddust.properties.particlesize * size) +definitions["newnuketac"].grounddust.properties.particlespeed = math.floor(definitions["newnuketac"].grounddust.properties.particlespeed * size) +definitions["newnuketac"].grounddust.properties.particlespeedspread = math.floor(definitions["newnuketac"].grounddust.properties.particlespeedspread * size) +definitions["newnuketac"].grounddust.properties.particlelife = math.floor(definitions["newnuketac"].grounddust.properties.particlelife * size * 0.5) +definitions["newnuketac"].bigsmoketrails.properties.size = [[130 r25]] +definitions["newnuketac"].bigsmoketrails.properties.length = [[170 r25]] +definitions["newnuketac"].bigsmoketrails.count = 3 -definitions['newnuketac'].groundflash_anim.properties.size = math.floor(definitions['newnuketac'].groundflash_anim.properties.size * size * 0.66) -definitions['newnuketac'].groundflash_anim.properties.sizegrowth = math.floor(definitions['newnuketac'].groundflash_anim.properties.sizegrowth * size * 5.5) -definitions['newnuketac'].groundflash_anim.properties.ttl = math.floor(definitions['newnuketac'].groundflash_anim.properties.ttl * size * 0.75) -definitions['newnuketac'].airflash_anim.properties.size = math.floor(definitions['newnuketac'].airflash_anim.properties.size * size * 0.8) +definitions["newnuketac"].groundflash_anim.properties.size = math.floor(definitions["newnuketac"].groundflash_anim.properties.size * size * 0.66) +definitions["newnuketac"].groundflash_anim.properties.sizegrowth = math.floor(definitions["newnuketac"].groundflash_anim.properties.sizegrowth * size * 5.5) +definitions["newnuketac"].groundflash_anim.properties.ttl = math.floor(definitions["newnuketac"].groundflash_anim.properties.ttl * size * 0.75) +definitions["newnuketac"].airflash_anim.properties.size = math.floor(definitions["newnuketac"].airflash_anim.properties.size * size * 0.8) local size = 0.6 -definitions['raptornuke-floor'] = table.copy(definitions['armnuke-floor']) -definitions['raptornuke-floor'].smoke.properties.numparticles = math.floor(definitions['raptornuke-floor'].smoke.properties.numparticles * size) -definitions['raptornuke-floor'].smoke.properties.particlespeedspread = math.floor(definitions['raptornuke-floor'].smoke.properties.particlespeedspread * size) -definitions['raptornuke-stem'] = table.copy(definitions['armnuke-stem']) -definitions['raptornuke-stem'].smoke.properties.particlesize = math.floor(definitions['raptornuke-stem'].smoke.properties.particlesize * size) -definitions['raptornuke-stem2'] = table.copy(definitions['armnuke-stem2']) -definitions['raptornuke-stem2'].smoke.properties.particlesize = math.floor(definitions['raptornuke-stem2'].smoke.properties.particlesize * size) -definitions['raptornuke-headring'] = table.copy(definitions['armnuke-headring']) -definitions['raptornuke-headring'].smoke.properties.numparticles = math.floor(definitions['raptornuke-headring'].smoke.properties.numparticles * size) -definitions['raptornuke-headring'].smoke.properties.particlespeedspread = math.floor(definitions['raptornuke-headring'].smoke.properties.particlespeedspread * size) -definitions['raptornuke-headring'].smoke.properties.particlesize = math.floor(definitions['raptornuke-headring'].smoke.properties.particlesize * size) -definitions['raptornuke-head'] = table.copy(definitions['armnuke-head']) -definitions['raptornuke-head'].smoke.properties.numparticles = math.floor(definitions['raptornuke-head'].smoke.properties.numparticles * size) -definitions['raptornuke-head'].smoke.properties.particlespeedspread = math.floor(definitions['raptornuke-head'].smoke.properties.particlespeedspread * size) -definitions['raptornuke-head'].smoke.properties.particlesize = math.floor(definitions['raptornuke-head'].smoke.properties.particlesize * size) +definitions["raptornuke-floor"] = table.copy(definitions["armnuke-floor"]) +definitions["raptornuke-floor"].smoke.properties.numparticles = math.floor(definitions["raptornuke-floor"].smoke.properties.numparticles * size) +definitions["raptornuke-floor"].smoke.properties.particlespeedspread = math.floor(definitions["raptornuke-floor"].smoke.properties.particlespeedspread * size) +definitions["raptornuke-stem"] = table.copy(definitions["armnuke-stem"]) +definitions["raptornuke-stem"].smoke.properties.particlesize = math.floor(definitions["raptornuke-stem"].smoke.properties.particlesize * size) +definitions["raptornuke-stem2"] = table.copy(definitions["armnuke-stem2"]) +definitions["raptornuke-stem2"].smoke.properties.particlesize = math.floor(definitions["raptornuke-stem2"].smoke.properties.particlesize * size) +definitions["raptornuke-headring"] = table.copy(definitions["armnuke-headring"]) +definitions["raptornuke-headring"].smoke.properties.numparticles = math.floor(definitions["raptornuke-headring"].smoke.properties.numparticles * size) +definitions["raptornuke-headring"].smoke.properties.particlespeedspread = math.floor(definitions["raptornuke-headring"].smoke.properties.particlespeedspread * size) +definitions["raptornuke-headring"].smoke.properties.particlesize = math.floor(definitions["raptornuke-headring"].smoke.properties.particlesize * size) +definitions["raptornuke-head"] = table.copy(definitions["armnuke-head"]) +definitions["raptornuke-head"].smoke.properties.numparticles = math.floor(definitions["raptornuke-head"].smoke.properties.numparticles * size) +definitions["raptornuke-head"].smoke.properties.particlespeedspread = math.floor(definitions["raptornuke-head"].smoke.properties.particlespeedspread * size) +definitions["raptornuke-head"].smoke.properties.particlesize = math.floor(definitions["raptornuke-head"].smoke.properties.particlesize * size) -- -definitions['raptornuke'] = table.copy(definitions['armnuke']) -definitions['raptornuke'].nukefloor.properties.explosiongenerator = [[custom:raptornuke-floor]] -definitions['raptornuke'].nukestem.properties.explosiongenerator = [[custom:raptornuke-stem]] -definitions['raptornuke'].nukestem2.properties.explosiongenerator = [[custom:raptornuke-stem2]] -definitions['raptornuke'].nukeheadring.properties.explosiongenerator = [[custom:raptornuke-headring]] -definitions['raptornuke'].nukehead.properties.explosiongenerator = [[custom:raptornuke-head]] +definitions["raptornuke"] = table.copy(definitions["armnuke"]) +definitions["raptornuke"].nukefloor.properties.explosiongenerator = [[custom:raptornuke-floor]] +definitions["raptornuke"].nukestem.properties.explosiongenerator = [[custom:raptornuke-stem]] +definitions["raptornuke"].nukestem2.properties.explosiongenerator = [[custom:raptornuke-stem2]] +definitions["raptornuke"].nukeheadring.properties.explosiongenerator = [[custom:raptornuke-headring]] +definitions["raptornuke"].nukehead.properties.explosiongenerator = [[custom:raptornuke-head]] -definitions['raptornuke'].sparks.properties.particlespeed = math.floor(definitions['raptornuke'].sparks.properties.particlespeed * size) -definitions['raptornuke'].sparks.properties.particlespeedspread = math.floor(definitions['raptornuke'].sparks.properties.particlespeedspread * size) -definitions['raptornuke'].dirt.properties.particlespeed = math.floor(definitions['raptornuke'].dirt.properties.particlespeed * size) -definitions['raptornuke'].dirt.properties.particlespeedspread = math.floor(definitions['raptornuke'].dirt.properties.particlespeedspread * size) -definitions['raptornuke'].dirt2.properties.particlespeed = math.floor(definitions['raptornuke'].dirt2.properties.particlespeed * size) -definitions['raptornuke'].dirt2.properties.particlespeedspread = math.floor(definitions['raptornuke'].dirt2.properties.particlespeedspread * size) -definitions['raptornuke'].centerflare.properties.size = [[15 r4]] -definitions['raptornuke'].groundflash_large.properties.size = math.floor(definitions['raptornuke'].groundflash_large.properties.size * size) -definitions['raptornuke'].groundflash_white.properties.size = math.floor(definitions['raptornuke'].groundflash_white.properties.size * size) +definitions["raptornuke"].sparks.properties.particlespeed = math.floor(definitions["raptornuke"].sparks.properties.particlespeed * size) +definitions["raptornuke"].sparks.properties.particlespeedspread = math.floor(definitions["raptornuke"].sparks.properties.particlespeedspread * size) +definitions["raptornuke"].dirt.properties.particlespeed = math.floor(definitions["raptornuke"].dirt.properties.particlespeed * size) +definitions["raptornuke"].dirt.properties.particlespeedspread = math.floor(definitions["raptornuke"].dirt.properties.particlespeedspread * size) +definitions["raptornuke"].dirt2.properties.particlespeed = math.floor(definitions["raptornuke"].dirt2.properties.particlespeed * size) +definitions["raptornuke"].dirt2.properties.particlespeedspread = math.floor(definitions["raptornuke"].dirt2.properties.particlespeedspread * size) +definitions["raptornuke"].centerflare.properties.size = [[15 r4]] +definitions["raptornuke"].groundflash_large.properties.size = math.floor(definitions["raptornuke"].groundflash_large.properties.size * size) +definitions["raptornuke"].groundflash_white.properties.size = math.floor(definitions["raptornuke"].groundflash_white.properties.size * size) -- definitions['afusexpl'] = table.copy(definitions['newnuke']) -- definitions['afusexpl'].electricstorm.count = 8 @@ -1664,11 +1662,9 @@ definitions['raptornuke'].groundflash_white.properties.size = math.floor(definit -- definitions['afusexpl'].groundflash_quick.properties.ttl = math.floor(definitions['afusexpl'].groundflash_quick.properties.ttl * 0.1) -- definitions['afusexpl'].groundflash_white.properties.ttl = math.floor(definitions['afusexpl'].groundflash_white.properties.ttl * 0.15) - -- definitions['afusexplxl'] = table.copy(definitions['newnukecor']) -- definitions['afusexplxl'].electricstorm.count = 8 -- definitions['afusexplxl'].electricstormalt = 6 -- definitions['afusexplxl'].electricstormxl = 6 - return definitions diff --git a/effects/plasmahit.lua b/effects/plasmahit.lua index 71d4c6f67e0..2075f1785dc 100644 --- a/effects/plasmahit.lua +++ b/effects/plasmahit.lua @@ -3,600 +3,598 @@ -- genericshellexplosion-large-sparks-burn local definitions = { - ["plasmahit-small"] = { - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.7 0.05 0.35 0 0 0 0.01]], - size = 1.8, - sizegrowth = 0, - ttl = 18, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 10, - particlelife = 2, - particlelifespread = 13, - particlesize = 2, - particlesizespread = 1, - particlespeed = 1.5, - particlespeedspread = 4.5, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks_directional = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 5, - emitrotspread = 45, - emitvector = [[dir]], - gravity = [[0, -0.2, 0]], - numparticles = 3, - particlelife = 4, - particlelifespread = 3, - particlesize = 26, - particlesizespread = 33, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 2.6, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 3, - particlesize = 18, - particlesizespread = 18, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 2.6, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - heat = 7, - heatfalloff = 1.6, - maxheat = 20, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 0.8, - sizegrowth = 1.5, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, + ["plasmahit-small"] = { + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.7 0.05 0.35 0 0 0 0.01]], + size = 1.8, + sizegrowth = 0, + ttl = 18, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 13, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1.5, + particlespeedspread = 4.5, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks_directional = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 5, + emitrotspread = 45, + emitvector = [[dir]], + gravity = [[0, -0.2, 0]], + numparticles = 3, + particlelife = 4, + particlelifespread = 3, + particlesize = 26, + particlesizespread = 33, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 2.6, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 3, + particlesize = 18, + particlesizespread = 18, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 2.6, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + heat = 7, + heatfalloff = 1.6, + maxheat = 20, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 0.8, + sizegrowth = 1.5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 13, - particlesize = 1, - particlesizespread = 0, - particlespeed = 2, - particlespeedspread = 1.5, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 13, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1.5, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, - ["plasmahit-medium"] = { - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.7 0.05 0.38 0 0 0 0.01]], - size = 2.2, - sizegrowth = 0, - ttl = 20, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks_directional = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 5, - emitrotspread = 45, - emitvector = [[dir]], - gravity = [[0, -0.2, 0]], - numparticles = 3, - particlelife = 6, - particlelifespread = 4, - particlesize = 30, - particlesizespread = 45, - particlespeed = 1.5, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 2, - particlelife = 6, - particlelifespread = 4, - particlesize = 20, - particlesizespread = 20, - particlespeed = 1, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.5, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - heat = 8, - heatfalloff = 1.6, - maxheat = 15, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 1, - sizegrowth = 1.5, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, - -["plasmahit-sparkonly"] = { - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.7 0.05 0.38 0 0 0 0.01]], - size = 3.2, - sizegrowth = 0, - ttl = 10, - texture = [[groundflash]], - }, - }, - kickedupwater = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[0.5 0.5 0.7 0.01 0.18 0.18 0.22 0.01 0 0 0 0 ]], - directional = true, - emitrot = 5, - emitrotspread = 30, - emitvector = [[dir]], - gravity = [[0, -0.4, 0]], - numparticles = 3, - particlelife = 12, - particlelifespread = 10, - particlesize = 40, - particlesizespread = 60, - particlespeed = 3.5, - particlespeedspread = 4.5, - pos = [[0, 5, 0]], - sizegrowth = 2.2, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - sparks_directional = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.9, - colormap = [[1 0.9 0.8 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 5, - emitrotspread = 45, - emitvector = [[dir]], - gravity = [[0, -0.2, 0]], - numparticles = 1, - particlelife = 6, - particlelifespread = 11, - particlesize = 70, - particlesizespread = 90, - particlespeed = 4, - particlespeedspread = 5.5, - pos = [[0, 5, 0]], - sizegrowth = 2.9, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = false, - -- underwater = true, - -- properties = { - -- airdrag = 0.9, - -- colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - -- directional = true, - -- emitrot = 15, - -- emitrotspread = 60, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.2, 0]], - -- numparticles = 2, - -- particlelife = 6, - -- particlelifespread = 4, - -- particlesize = 20, - -- particlesizespread = 20, - -- particlespeed = 1, - -- particlespeedspread = 4.5, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2.9, - -- sizemod = 0.5, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - -- }, - -- centerflare = { - -- air = true, - -- class = [[CHeatCloudProjectile]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = false, - -- underwater = true, - -- properties = { - -- heat = 8, - -- heatfalloff = 1.6, - -- maxheat = 15, - -- pos = [[r-2 r2, 2.5, r-2 r2]], - -- size = 1, - -- sizegrowth = 1.5, - -- speed = [[0, 0, 0]], - -- texture = [[flare]], - -- }, - -- }, - -- underwaterexplosionspikes = { - -- class = [[CSimpleParticleSystem]], - -- count = 2, - -- underwater = 1, - -- properties = { - -- airdrag = 0.9, - -- colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.5, 0]], - -- numparticles = 4, - -- particlelife = 4, - -- particlelifespread = 15, - -- particlesize = 1, - -- particlesizespread = 0, - -- particlespeed = 3, - -- particlespeedspread = 2, - -- pos = [[0, 2, 0]], - -- sizegrowth = 2, - -- sizemod = 0.25, - -- texture = [[wake]], - -- useairlos = false, - -- }, - -- }, - }, - -["plasmahit-huge"] = { - heatedgroundflash = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = false, - unit = false, - nounit = true, - water = false, - properties = { - colormap = [[1 0.8 0.6 0.70 0 0 0 0.01]], - size = 4.5, - sizegrowth = 2, - ttl = 20, - texture = [[groundflash]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 4, - particlesizespread = 2, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.9, - texture = [[wake]], - }, - }, - sparks_directional = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.02 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 5, - emitrotspread = 45, - emitvector = [[dir]], - gravity = [[0, -0.2, 0]], - numparticles = 3, - particlelife = 6, - particlelifespread = 4, - particlesize = 50, - particlesizespread = 65, - particlespeed = 1.5, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.8, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 2, - particlelife = 12, - particlelifespread = 4, - particlesize = 40, - particlesizespread = 40, - particlespeed = 1, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.7, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - heat = 8, - heatfalloff = 1.6, - maxheat = 15, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 3, - sizegrowth = 1.5, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 3, - particlesizespread = 1, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - }, + ["plasmahit-medium"] = { + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.7 0.05 0.38 0 0 0 0.01]], + size = 2.2, + sizegrowth = 0, + ttl = 20, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks_directional = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 5, + emitrotspread = 45, + emitvector = [[dir]], + gravity = [[0, -0.2, 0]], + numparticles = 3, + particlelife = 6, + particlelifespread = 4, + particlesize = 30, + particlesizespread = 45, + particlespeed = 1.5, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 2, + particlelife = 6, + particlelifespread = 4, + particlesize = 20, + particlesizespread = 20, + particlespeed = 1, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.5, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + heat = 8, + heatfalloff = 1.6, + maxheat = 15, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 1, + sizegrowth = 1.5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, + ["plasmahit-sparkonly"] = { + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.7 0.05 0.38 0 0 0 0.01]], + size = 3.2, + sizegrowth = 0, + ttl = 10, + texture = [[groundflash]], + }, + }, + kickedupwater = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[0.5 0.5 0.7 0.01 0.18 0.18 0.22 0.01 0 0 0 0 ]], + directional = true, + emitrot = 5, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[0, -0.4, 0]], + numparticles = 3, + particlelife = 12, + particlelifespread = 10, + particlesize = 40, + particlesizespread = 60, + particlespeed = 3.5, + particlespeedspread = 4.5, + pos = [[0, 5, 0]], + sizegrowth = 2.2, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + sparks_directional = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.9, + colormap = [[1 0.9 0.8 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 5, + emitrotspread = 45, + emitvector = [[dir]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 6, + particlelifespread = 11, + particlesize = 70, + particlesizespread = 90, + particlespeed = 4, + particlespeedspread = 5.5, + pos = [[0, 5, 0]], + sizegrowth = 2.9, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = false, + -- underwater = true, + -- properties = { + -- airdrag = 0.9, + -- colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + -- directional = true, + -- emitrot = 15, + -- emitrotspread = 60, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.2, 0]], + -- numparticles = 2, + -- particlelife = 6, + -- particlelifespread = 4, + -- particlesize = 20, + -- particlesizespread = 20, + -- particlespeed = 1, + -- particlespeedspread = 4.5, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2.9, + -- sizemod = 0.5, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + -- }, + -- centerflare = { + -- air = true, + -- class = [[CHeatCloudProjectile]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = false, + -- underwater = true, + -- properties = { + -- heat = 8, + -- heatfalloff = 1.6, + -- maxheat = 15, + -- pos = [[r-2 r2, 2.5, r-2 r2]], + -- size = 1, + -- sizegrowth = 1.5, + -- speed = [[0, 0, 0]], + -- texture = [[flare]], + -- }, + -- }, + -- underwaterexplosionspikes = { + -- class = [[CSimpleParticleSystem]], + -- count = 2, + -- underwater = 1, + -- properties = { + -- airdrag = 0.9, + -- colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.5, 0]], + -- numparticles = 4, + -- particlelife = 4, + -- particlelifespread = 15, + -- particlesize = 1, + -- particlesizespread = 0, + -- particlespeed = 3, + -- particlespeedspread = 2, + -- pos = [[0, 2, 0]], + -- sizegrowth = 2, + -- sizemod = 0.25, + -- texture = [[wake]], + -- useairlos = false, + -- }, + -- }, + }, + ["plasmahit-huge"] = { + heatedgroundflash = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = false, + unit = false, + nounit = true, + water = false, + properties = { + colormap = [[1 0.8 0.6 0.70 0 0 0 0.01]], + size = 4.5, + sizegrowth = 2, + ttl = 20, + texture = [[groundflash]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 4, + particlesizespread = 2, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.9, + texture = [[wake]], + }, + }, + sparks_directional = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.02 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 5, + emitrotspread = 45, + emitvector = [[dir]], + gravity = [[0, -0.2, 0]], + numparticles = 3, + particlelife = 6, + particlelifespread = 4, + particlesize = 50, + particlesizespread = 65, + particlespeed = 1.5, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.8, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 2, + particlelife = 12, + particlelifespread = 4, + particlesize = 40, + particlesizespread = 40, + particlespeed = 1, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.7, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + heat = 8, + heatfalloff = 1.6, + maxheat = 15, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 3, + sizegrowth = 1.5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 3, + particlesizespread = 1, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, } -- add coloring @@ -633,5 +631,4 @@ local definitions = { -- end --end - return definitions diff --git a/effects/raptors/blob_fire.lua b/effects/raptors/blob_fire.lua index cf710411b94..e13c4b8bd7e 100644 --- a/effects/raptors/blob_fire.lua +++ b/effects/raptors/blob_fire.lua @@ -1,16 +1,16 @@ return { blob_fire = { - splashes = { + splashes = { class = [[CSimpleParticleSystem]], properties = { - sizegrowth = -.1, + sizegrowth = -0.1, sizemod = 1, pos = [[0, 1.0, 0]], emitVector = [[0, 1, 0]], gravity = [[0, 0, 0]], Texture = [[blooddropwhite]], colorMap = [[0 0.6 0.6 1 0.3 0.6 0.6 0.4 0.85 0.6 0.6 0]], - airdrag = .96, + airdrag = 0.96, particleLife = 18, particleLifeSpread = 8, numParticles = 2, @@ -36,7 +36,7 @@ return { gravity = [[0, 0, 0]], Texture = [[bloodblastwhite]], colorMap = [[0.85 0.6 0.6 1 0 0.6 0.6 0.4 0 0 0 0]], - airdrag = .9, + airdrag = 0.9, particleLife = 14, particleLifeSpread = 2, numParticles = 1, @@ -50,6 +50,6 @@ return { }, air = 1, ground = 1, - } - } + }, + }, } diff --git a/effects/raptors/nukedatbewm-roost.lua b/effects/raptors/nukedatbewm-roost.lua index 221a1e9896a..72cd113148b 100644 --- a/effects/raptors/nukedatbewm-roost.lua +++ b/effects/raptors/nukedatbewm-roost.lua @@ -1,258 +1,255 @@ -- nukedatbewm-roost return { - ["nukedatbewm-roost"] = { - alwaysvisible = true, - - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 18, - heatfalloff = 0.44, - maxheat = 20, - pos = [[r-2 r2, 100, r-2 r2]], - --rotParams = [[-50 r100, -5 r10, -90 r180]], - size = 24, - sizegrowth = 18, - speed = [[1, 0, 1]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.5 0.8 0.72 0.60 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 3800, - sizegrowth = [[0.4 r0.2]], - ttl = 38, - pos = [[0, 180, 0]], - drawOrder = 0, - }, - }, + ["nukedatbewm-roost"] = { + alwaysvisible = true, - brightflareslow = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[1.0 0.96 0.80 0.4 0.8 0.72 0.60 0.25 0.35 0.28 0.18 0.11 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 9, - fronttexture = [[circularthingy]], - length = 40, - sidetexture = [[none]], - size = 500, - sizegrowth = [[0.4 r0.2]], - ttl = 200, - pos = [[0, -350, 0]], - drawOrder = 0, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 18, + heatfalloff = 0.44, + maxheat = 20, + pos = [[r-2 r2, 100, r-2 r2]], + --rotParams = [[-50 r100, -5 r10, -90 r180]], + size = 24, + sizegrowth = 18, + speed = [[1, 0, 1]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.5 0.8 0.72 0.60 0.5 0.35 0.28 0.18 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 3800, + sizegrowth = [[0.4 r0.2]], + ttl = 38, + pos = [[0, 180, 0]], + drawOrder = 0, + }, + }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = false, - properties = { - airdrag = 0.97, - colormap = [[0.85 0.75 0.67 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.4 0.22 0.15 0.01 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 13, - particlelife = 80, - particlelifespread = 16, - particlesize = 70, - particlesizespread = 95, - particlespeed = 18, - particlespeedspread = 13, - pos = [[0, 4, 0]], - rotParams = [[-5 r10, -5 r10, -180]], - sizegrowth = -0.04, - sizemod = 0.98, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - drawOrder = 2, - }, - }, + brightflareslow = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[1.0 0.96 0.80 0.4 0.8 0.72 0.60 0.25 0.35 0.28 0.18 0.11 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 9, + fronttexture = [[circularthingy]], + length = 40, + sidetexture = [[none]], + size = 500, + sizegrowth = [[0.4 r0.2]], + ttl = 200, + pos = [[0, -350, 0]], + drawOrder = 0, + }, + }, - shockwave = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.8 0.3 0.9 0.8 0.70 0.5 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 40, - sidetexture = [[none]], - size = 24, - sizegrowth = [[-29 r6]], - ttl = 38, - pos = [[0, 75, 0]], - drawOrder = 1, - }, - }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = false, + properties = { + airdrag = 0.97, + colormap = [[0.85 0.75 0.67 0.005 0.8 0.55 0.3 0.011 0.8 0.55 0.3 0.005 0.4 0.22 0.15 0.01 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 13, + particlelife = 80, + particlelifespread = 16, + particlesize = 70, + particlesizespread = 95, + particlespeed = 18, + particlespeedspread = 13, + pos = [[0, 4, 0]], + rotParams = [[-5 r10, -5 r10, -180]], + sizegrowth = -0.04, + sizemod = 0.98, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + drawOrder = 2, + }, + }, - groundflash = { - air = true, - ground = true, - water = true, - underwater = true, - alwaysvisible = true, - flashalpha = 0.5, - flashsize = 2000, - ground = true, - ttl = 300, - water = true, - color = { - [1] = 1, - [2] = 0.69999998807907, - [3] = 0.30000001192093, - }, - }, - - poof02 = { - air = true, - ground = true, - water = true, - underwater = true, - class = [[CSimpleParticleSystem]], - count = 10, - properties = { - airdrag = 0.89, - alwaysvisible = true, - colormap = [[0.9 0.6 0.1 0.1 0.4 0.4 0.4 0.03 0.1 0.1 0.1 0.02 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[-0.08 r0.16, 0.15 r0.075, -0.08 r0.16]], - numparticles = 16, - particlelife = 150, - particlelifespread = 150, - particlesize = 50, - particlesizespread = 70, - particlespeed = 70, - particlespeedspread = 22, - pos = [[0, 2, 0]], - rotParams = [[-10 r20, -5 r10, -180 r360]], - sizegrowth = 1, - sizemod = 1.001, - texture = [[bigexplosmoke-raptors]], - useairlos = false, - drawOrder = 1, - }, - }, - - poof04 = { - air = true, - ground = true, - water = true, - underwater = true, - class = [[CSimpleParticleSystem]], - count = 4, - properties = { - airdrag = 0.82, - alwaysvisible = true, - colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.2, 0]], - numparticles = 5, - particlelife = 150, - particlelifespread = 150, - particlesize = 80, - particlesizespread = 70, - particlespeed = 20, - particlespeedspread = 32, - pos = [[0, 2, 0]], - rotParams = [[-10 r20, -5 r10, -180 r360]], - sizegrowth = 1, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - useairlos = false, - }, - }, - - pop1 = { - air = true, - ground = true, - water = true, - underwater = true, - alwaysvisible = true, - class = [[CHeatCloudProjectile]], - count = 2, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 0.4, - maxheat = 10, - pos = [[r-10 r10, 0, r-10 r10]], - size = 1, - sizegrowth = 50, - speed = [[0, 0, 0]], - texture = [[bigexplosmoke-raptors]], - }, - }, - - pop2 = { - air = true, - ground = true, - water = true, - underwater = true, - alwaysvisible = true, - class = [[CHeatCloudProjectile]], - count = 10, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 0.6, - maxheat = 15, - pos = [[r-150 r150, 0, r-300 r150]], - size = 1, - sizegrowth = 40, - speed = [[0, 0, 0]], - texture = [[bigexplosmoke-raptors]], - }, - }, - - }, + shockwave = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.8 0.3 0.9 0.8 0.70 0.5 0.8 0.65 0.4 0.35 0.10 0.08 0.04 0.012 0.06 0.04 0.02 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 40, + sidetexture = [[none]], + size = 24, + sizegrowth = [[-29 r6]], + ttl = 38, + pos = [[0, 75, 0]], + drawOrder = 1, + }, + }, -} + groundflash = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + flashalpha = 0.5, + flashsize = 2000, + ground = true, + ttl = 300, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + + poof02 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 10, + properties = { + airdrag = 0.89, + alwaysvisible = true, + colormap = [[0.9 0.6 0.1 0.1 0.4 0.4 0.4 0.03 0.1 0.1 0.1 0.02 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[-0.08 r0.16, 0.15 r0.075, -0.08 r0.16]], + numparticles = 16, + particlelife = 150, + particlelifespread = 150, + particlesize = 50, + particlesizespread = 70, + particlespeed = 70, + particlespeedspread = 22, + pos = [[0, 2, 0]], + rotParams = [[-10 r20, -5 r10, -180 r360]], + sizegrowth = 1, + sizemod = 1.001, + texture = [[bigexplosmoke-raptors]], + useairlos = false, + drawOrder = 1, + }, + }, + + poof04 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 4, + properties = { + airdrag = 0.82, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 5, + particlelife = 150, + particlelifespread = 150, + particlesize = 80, + particlesizespread = 70, + particlespeed = 20, + particlespeedspread = 32, + pos = [[0, 2, 0]], + rotParams = [[-10 r20, -5 r10, -180 r360]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + useairlos = false, + }, + }, + pop1 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[CHeatCloudProjectile]], + count = 2, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke-raptors]], + }, + }, + + pop2 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[CHeatCloudProjectile]], + count = 10, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke-raptors]], + }, + }, + }, +} diff --git a/effects/raptors/nuketrail-roost.lua b/effects/raptors/nuketrail-roost.lua index 4db4f18f834..9c8582ba10e 100644 --- a/effects/raptors/nuketrail-roost.lua +++ b/effects/raptors/nuketrail-roost.lua @@ -1,191 +1,189 @@ -- nuketrail-roost return { - ["nuketrail-roost"] = { - usedefaultexplosions = false, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.08 0.06 0.02 0.01 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - rotParams = [[-10 r20, -10 r20, -180 r360]], - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.75 0.5 0.2 0.1 0.045 0.044 0.04 0.1 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 2, - particlelife = 40, - particlelifespread = 15, - particlesize = 19, - particlesizespread = 14, - particlespeed = 0.25, - particlespeedspread = 1.2, - rotParams = [[-10 r20, -10 r20, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.8 0.35 0.1 0.15 0.55 0.25 0.15 0.1 0.028 0.027 0.026 0.15 0.0 0.0 0.0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.8, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 7, - particlesizespread = 6, - particlespeed = 0.25, - particlespeedspread = 1.9, - rotParams = [[-10 r20, -10 r20, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - trail = { - - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - alwaysVisible = true, - colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = -20, - sidetexture = [[smoketrail]], - size = 2.0, - sizegrowth = 0.05, - ttl = 40, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.5, - colormap = [[0.0 0.0 0.0 0.01 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], - directional = false, - emitrot = -180, - emitrotspread = 7, - emitvector = [[1, 1, 1]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = [[0.8 r0.5]], - particlelife = 15, - particlelifespread = 40, - particlesize = 5.6, - particlesizespread = 20.2, - particlespeed = 0.02, - particlespeedspread = 0.05, - rotParams = [[-10 r20, -10 r20, -180 r360]], - pos = [[-1 r2, -1 r2, -1 r2]], - sizegrowth = 0.8, - sizemod = 0.98, - texture = [[smoke]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.85, - colormap = [[0.0 0.0 0.0 0.01 0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], - directional = false, - emitrot = -180, - emitrotspread = 15, - emitvector = [[1, 1, 1]], - gravity = [[0, -0.011, 0]], - numparticles = [[0.5 r0.7]], - particlelife = 9, - particlelifespread = 6, - particlesize = 20, - particlesizespread = 20, - particlespeed = 0.03, - particlespeedspread = 0.5, - rotParams = [[-10 r20, -10 r20, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - spikes = { - air = true, - class = [[CExploSpikeProjectile]], - count = 2, - ground = true, - water = true, - properties = { - alpha = 0.6, - alphadecay = 0.08, - color = [[1.0, 0.5, 0.2]], - dir = [[-10 r20,-10 r20,-10 r20]], - length = 1, - width = 9, - }, - }, - }, + ["nuketrail-roost"] = { + usedefaultexplosions = false, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.08 0.06 0.02 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + rotParams = [[-10 r20, -10 r20, -180 r360]], + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.75 0.5 0.2 0.1 0.045 0.044 0.04 0.1 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 15, + particlesize = 19, + particlesizespread = 14, + particlespeed = 0.25, + particlespeedspread = 1.2, + rotParams = [[-10 r20, -10 r20, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.35 0.1 0.15 0.55 0.25 0.15 0.1 0.028 0.027 0.026 0.15 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.8, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 7, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.9, + rotParams = [[-10 r20, -10 r20, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -20, + sidetexture = [[smoketrail]], + size = 2.0, + sizegrowth = 0.05, + ttl = 40, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.0 0.0 0.0 0.01 0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = false, + emitrot = -180, + emitrotspread = 7, + emitvector = [[1, 1, 1]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[0.8 r0.5]], + particlelife = 15, + particlelifespread = 40, + particlesize = 5.6, + particlesizespread = 20.2, + particlespeed = 0.02, + particlespeedspread = 0.05, + rotParams = [[-10 r20, -10 r20, -180 r360]], + pos = [[-1 r2, -1 r2, -1 r2]], + sizegrowth = 0.8, + sizemod = 0.98, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.85, + colormap = [[0.0 0.0 0.0 0.01 0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = false, + emitrot = -180, + emitrotspread = 15, + emitvector = [[1, 1, 1]], + gravity = [[0, -0.011, 0]], + numparticles = [[0.5 r0.7]], + particlelife = 9, + particlelifespread = 6, + particlesize = 20, + particlesizespread = 20, + particlespeed = 0.03, + particlespeedspread = 0.5, + rotParams = [[-10 r20, -10 r20, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + spikes = { + air = true, + class = [[CExploSpikeProjectile]], + count = 2, + ground = true, + water = true, + properties = { + alpha = 0.6, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 1, + width = 9, + }, + }, + }, } - diff --git a/effects/raptors/raptor-effects.lua b/effects/raptors/raptor-effects.lua index cf2bed0eb92..7f42cc62fa2 100644 --- a/effects/raptors/raptor-effects.lua +++ b/effects/raptors/raptor-effects.lua @@ -1,2419 +1,2419 @@ -- Effects for Raptors (before known as Raptors) local definitions = { - ["blob_trail_blue"] = { - usedefaultexplosions = false, + ["blob_trail_blue"] = { + usedefaultexplosions = false, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.8, - colormap = [[0.2 0.5 0.9 1 0.3 0.6 0.8 0.4 0.4 0.7 0.7 0.12 0.1 0.35 0.35 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = [[1 r1]], - particlelife = 3, - particlelifespread = 6, - particlesize = 7, - particlesizespread = 4, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 1, 0]], - sizegrowth = -0.3, - sizemod = 1, - texture = [[blooddropwhite]], - alwaysvisible = true, - drawOrder = 1, - }, - }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.8, + colormap = [[0.2 0.5 0.9 1 0.3 0.6 0.8 0.4 0.4 0.7 0.7 0.12 0.1 0.35 0.35 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = [[1 r1]], + particlelife = 3, + particlelifespread = 6, + particlesize = 7, + particlesizespread = 4, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = -0.3, + sizemod = 1, + texture = [[blooddropwhite]], + alwaysvisible = true, + drawOrder = 1, + }, + }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 8.5, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[glow]], - drawOrder = 1, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 8.5, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[glow]], + drawOrder = 1, + }, + }, - flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.2 0.5 0.9 0.01 0.3 0.6 0.8 0.01 0.4 0.7 0.7 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -10.9, - sidetexture = [[shot]], - size = 7.2, - sizegrowth = -0.15, - ttl = 1, - useairlos = true, - }, - }, + flame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.2 0.5 0.9 0.01 0.3 0.6 0.8 0.01 0.4 0.7 0.7 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -10.9, + sidetexture = [[shot]], + size = 7.2, + sizegrowth = -0.15, + ttl = 1, + useairlos = true, + }, + }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], - -- directional = true, - -- emitrot = 25, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.15, 0]], - -- numparticles = 2, - -- particlelife = 3, - -- particlelifespread = 3, - -- particlesize = 14, - -- particlesizespread = 20, - -- particlespeed = 3.1, - -- particlespeedspread = 1.5, - -- pos = [[0, 0, 0]], - -- sizegrowth = -0.3, - -- sizemod = 0.7, - -- texture = [[gunshotglow]], - -- useairlos = true, - -- }, - -- }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], + -- directional = true, + -- emitrot = 25, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.15, 0]], + -- numparticles = 2, + -- particlelife = 3, + -- particlelifespread = 3, + -- particlesize = 14, + -- particlesizespread = 20, + -- particlespeed = 3.1, + -- particlespeedspread = 1.5, + -- pos = [[0, 0, 0]], + -- sizegrowth = -0.3, + -- sizemod = 0.7, + -- texture = [[gunshotglow]], + -- useairlos = true, + -- }, + -- }, - pop = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.9, - colormap = [[0.4 0.7 1 1 0.3 0.6 0.8 0.3 0.4 0.7 0.7 0.01 0.1 0.24 0.24 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 6, - particlesize = 8, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 1, 0]], - sizegrowth = -0.7, - sizemod = 1, - texture = [[bloodblast2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - }, + pop = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.7 1 1 0.3 0.6 0.8 0.3 0.4 0.7 0.7 0.01 0.1 0.24 0.24 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 6, + particlesize = 8, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 1, 0]], + sizegrowth = -0.7, + sizemod = 1, + texture = [[bloodblast2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + }, - ["blob_trail_red"] = { - usedefaultexplosions = false, + ["blob_trail_red"] = { + usedefaultexplosions = false, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.8, - colormap = [[0.9 0.5 0.2 1 0.8 0.6 0.3 0.4 0.7 0.55 0.4 0.12 0.35 0.25 0.1 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = [[1 r1]], - particlelife = 3, - particlelifespread = 6, - particlesize = 7, - particlesizespread = 4, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 1, 0]], - sizegrowth = -0.3, - sizemod = 1, - texture = [[blooddropwhite]], - alwaysvisible = true, - drawOrder = 1, - }, - }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.8, + colormap = [[0.9 0.5 0.2 1 0.8 0.6 0.3 0.4 0.7 0.55 0.4 0.12 0.35 0.25 0.1 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = [[1 r1]], + particlelife = 3, + particlelifespread = 6, + particlesize = 7, + particlesizespread = 4, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = -0.3, + sizemod = 1, + texture = [[blooddropwhite]], + alwaysvisible = true, + drawOrder = 1, + }, + }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 8.5, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[glow]], - drawOrder = 1, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 8.5, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[glow]], + drawOrder = 1, + }, + }, - flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.9 0.5 0.2 0.01 0.8 0.6 0.3 0.01 0.7 0.6 0.3 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -10.9, - sidetexture = [[shot]], - size = 7.2, - sizegrowth = -0.15, - ttl = 1, - useairlos = true, - }, - }, + flame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.9 0.5 0.2 0.01 0.8 0.6 0.3 0.01 0.7 0.6 0.3 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -10.9, + sidetexture = [[shot]], + size = 7.2, + sizegrowth = -0.15, + ttl = 1, + useairlos = true, + }, + }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], - -- directional = true, - -- emitrot = 25, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.15, 0]], - -- numparticles = 2, - -- particlelife = 3, - -- particlelifespread = 3, - -- particlesize = 14, - -- particlesizespread = 20, - -- particlespeed = 3.1, - -- particlespeedspread = 1.5, - -- pos = [[0, 0, 0]], - -- sizegrowth = -0.3, - -- sizemod = 0.7, - -- texture = [[gunshotglow]], - -- useairlos = true, - -- }, - -- }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], + -- directional = true, + -- emitrot = 25, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.15, 0]], + -- numparticles = 2, + -- particlelife = 3, + -- particlelifespread = 3, + -- particlesize = 14, + -- particlesizespread = 20, + -- particlespeed = 3.1, + -- particlespeedspread = 1.5, + -- pos = [[0, 0, 0]], + -- sizegrowth = -0.3, + -- sizemod = 0.7, + -- texture = [[gunshotglow]], + -- useairlos = true, + -- }, + -- }, - pop = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.9, - colormap = [[1 0.7 0.4 1 0.8 0.6 0.3 0.3 0.7 0.6 0.3 0.01 0.24 0.20 0.1 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 6, - particlesize = 8, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 1, 0]], - sizegrowth = -0.7, - sizemod = 1, - texture = [[bloodblast2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - }, + pop = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.9, + colormap = [[1 0.7 0.4 1 0.8 0.6 0.3 0.3 0.7 0.6 0.3 0.01 0.24 0.20 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 6, + particlesize = 8, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 1, 0]], + sizegrowth = -0.7, + sizemod = 1, + texture = [[bloodblast2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + }, -["blob_trail_green"] = { - usedefaultexplosions = false, + ["blob_trail_green"] = { + usedefaultexplosions = false, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.95, - colormap = [[0.7 0.9 0.11 1 0.6 0.8 0.09 0.4 0.5 0.7 0.07 0.12 0.25 0.35 0.03 0.01 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = [[1 r1]], - particlelife = 4, - particlelifespread = 4, - particlesize = 15, - particlesizespread = 6.5, - particlespeed = -0.01, - particlespeedspread = 0, - pos = [[0, 1, 0]], - rotParams = [[-10 r20, 0, -180 r360]], - sizegrowth = -0.7, - sizemod = 1, - texture = [[bloodcentersplatshwhite]], - alwaysvisible = true, - drawOrder = 1, - }, - }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.9 0.11 1 0.6 0.8 0.09 0.4 0.5 0.7 0.07 0.12 0.25 0.35 0.03 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = [[1 r1]], + particlelife = 4, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 6.5, + particlespeed = -0.01, + particlespeedspread = 0, + pos = [[0, 1, 0]], + rotParams = [[-10 r20, 0, -180 r360]], + sizegrowth = -0.7, + sizemod = 1, + texture = [[bloodcentersplatshwhite]], + alwaysvisible = true, + drawOrder = 1, + }, + }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 0, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 5, - maxheat = 16, - pos = [[r-2 r2, 5, r-2 r2]], - size = 9.5, - sizegrowth = 8, - speed = [[0, 1 0, 0]], - texture = [[glow]], - drawOrder = 1, - }, - }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 0, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 5, + maxheat = 16, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9.5, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[glow]], + drawOrder = 1, + }, + }, - flame = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.8 0.9 0.011 0.01 0.7 0.8 0.09 0.01 0.6 0.7 0.08 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = -10.9, - sidetexture = [[shot]], - size = 7.2, - sizegrowth = -0.15, - ttl = 1, - useairlos = true, - }, - }, + flame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.8 0.9 0.011 0.01 0.7 0.8 0.09 0.01 0.6 0.7 0.08 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = -10.9, + sidetexture = [[shot]], + size = 7.2, + sizegrowth = -0.15, + ttl = 1, + useairlos = true, + }, + }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.85, - -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], - -- directional = true, - -- emitrot = 25, - -- emitrotspread = 30, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.15, 0]], - -- numparticles = 2, - -- particlelife = 3, - -- particlelifespread = 3, - -- particlesize = 14, - -- particlesizespread = 20, - -- particlespeed = 3.1, - -- particlespeedspread = 1.5, - -- pos = [[0, 0, 0]], - -- sizegrowth = -0.3, - -- sizemod = 0.7, - -- texture = [[gunshotglow]], - -- useairlos = true, - -- }, - -- }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.85, + -- colormap = [[0.2 0.5 0.9 0.017 0.3 0.6 0.8 0.011 0 0 0 0]], + -- directional = true, + -- emitrot = 25, + -- emitrotspread = 30, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.15, 0]], + -- numparticles = 2, + -- particlelife = 3, + -- particlelifespread = 3, + -- particlesize = 14, + -- particlesizespread = 20, + -- particlespeed = 3.1, + -- particlespeedspread = 1.5, + -- pos = [[0, 0, 0]], + -- sizegrowth = -0.3, + -- sizemod = 0.7, + -- texture = [[gunshotglow]], + -- useairlos = true, + -- }, + -- }, - pop = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - water = false, - underwater = false, - --unit = false, - properties = { - airdrag = 0.9, - colormap = [[0.8 0.99 0.11 1 0.7 0.8 0.09 0.3 0.6 0.7 0.08 0.01 0.18 0.24 0.05 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 6, - particlesize = 8, - particlesizespread = 5, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0, 1, 0]], - sizegrowth = -0.7, - sizemod = 1, - texture = [[bloodblast2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - }, + pop = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = false, + underwater = false, + --unit = false, + properties = { + airdrag = 0.9, + colormap = [[0.8 0.99 0.11 1 0.7 0.8 0.09 0.3 0.6 0.7 0.08 0.01 0.18 0.24 0.05 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 6, + particlesize = 8, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 1, 0]], + sizegrowth = -0.7, + sizemod = 1, + texture = [[bloodblast2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + }, -["acid-explosion-xl"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 3.5, - sizegrowth = 6, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - acid_groundsplat = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.25 0.36 0.06 0.16 0.25 0.36 0.06 0.14 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 220, - sidetexture = [[none]], - size = [[60 r20]], - sizegrowth = 2, - ttl = 40, - pos = [[0, 15, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidshockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.8 0.99 0.11 0.14 0.7 0.8 0.09 0.50 0.20 0.25 0.04 0.010 0.08 0.12 0.02 0.006 0.05 0.06 0.01 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 45, - sidetexture = [[none]], - size = 6, - sizegrowth = [[-14 r7]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.89, - colormap = [[0.8 0.99 0.11 1 0.75 0.9 0.08 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 70, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[4 r2]], - particlelife = 14, - particlelifespread = 9.5, - particlesize = 23, - particlesizespread = 36, - particlespeed = 3.9, - particlespeedspread = 7.5, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.98, - texture = [[blooddrop2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - acidblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { + ["acid-explosion-xl"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 3.5, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, + acid_groundsplat = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.25 0.36 0.06 0.16 0.25 0.36 0.06 0.14 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 220, + sidetexture = [[none]], + size = [[60 r20]], + sizegrowth = 2, + ttl = 40, + pos = [[0, 15, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidshockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.8 0.99 0.11 0.14 0.7 0.8 0.09 0.50 0.20 0.25 0.04 0.010 0.08 0.12 0.02 0.006 0.05 0.06 0.01 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 45, + sidetexture = [[none]], + size = 6, + sizegrowth = [[-14 r7]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.89, + colormap = [[0.8 0.99 0.11 1 0.75 0.9 0.08 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 70, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[4 r2]], + particlelife = 14, + particlelifespread = 9.5, + particlesize = 23, + particlesizespread = 36, + particlespeed = 3.9, + particlespeedspread = 7.5, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.98, + texture = [[blooddrop2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + acidblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { - airdrag = 0.92, - colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 5, - particlesize = 14, - particlesizespread = 20, - particlespeed = 0.18, - particlespeedspread = 0.20, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.99, - texture = [[bloodblast2white]], - alwaysvisible = true, - }, - }, - groundflash_acid = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.8 0.99 0.11 0.7 0 0 0 0.01]], - size = 90, - sizegrowth = 7, - ttl = 18, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - acid_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[0.5 r4]], - particlelife = 14, - particlelifespread = 24, - particlesize = 3.8, - particlesizespread = 12, - particlespeed = 3.8, - particlespeedspread = 11.5, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.36, - sizemod = 0.97, - texture = [[bloodspark2white]], - useairlos = false, - drawOrder = 2, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.8 0.99 0.11 0.92 0.7 0.8 0.09 0.71 0.07 0.09 0.04 0.63 0.05 0.07 0.02 0.30 0.03 0.05 0 0.24 0.01 0.03 0 0.16 0 0.025 0 0.09 0 0.02 0 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[75 r20]], - sidetexture = [[flamestream]], - size = [[40 r14]], - sizegrowth = 1.0, - ttl = [[20 r4]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 0, - }, - }, - }, + airdrag = 0.92, + colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 5, + particlesize = 14, + particlesizespread = 20, + particlespeed = 0.18, + particlespeedspread = 0.20, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.99, + texture = [[bloodblast2white]], + alwaysvisible = true, + }, + }, + groundflash_acid = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.8 0.99 0.11 0.7 0 0 0 0.01]], + size = 90, + sizegrowth = 7, + ttl = 18, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + acid_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[0.5 r4]], + particlelife = 14, + particlelifespread = 24, + particlesize = 3.8, + particlesizespread = 12, + particlespeed = 3.8, + particlespeedspread = 11.5, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.36, + sizemod = 0.97, + texture = [[bloodspark2white]], + useairlos = false, + drawOrder = 2, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.8 0.99 0.11 0.92 0.7 0.8 0.09 0.71 0.07 0.09 0.04 0.63 0.05 0.07 0.02 0.30 0.03 0.05 0 0.24 0.01 0.03 0 0.16 0 0.025 0 0.09 0 0.02 0 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[75 r20]], + sidetexture = [[flamestream]], + size = [[40 r14]], + sizegrowth = 1.0, + ttl = [[20 r4]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - ["acid-explosion-small"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 3.2, - sizegrowth = 5.5, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - acid_groundsplat = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.25 0.36 0.06 0.18 0.25 0.36 0.06 0.16 0.25 0.36 0.06 0.15 0.25 0.36 0.06 0.14 0.25 0.36 0.06 0.13 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 0, - sidetexture = [[none]], - size = [[35 r10]], - sizegrowth = 2.3, - ttl = 35, - pos = [[0, 15, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidshockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.8 0.99 0.11 0.14 0.7 0.8 0.09 0.50 0.20 0.25 0.04 0.010 0.08 0.12 0.02 0.006 0.05 0.06 0.01 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 45, - sidetexture = [[none]], - size = 5, - sizegrowth = [[-13 r6]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.89, - colormap = [[0.8 0.99 0.11 1 0.75 0.9 0.08 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 70, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[3 r2]], - particlelife = 12, - particlelifespread = 9.5, - particlesize = 21, - particlesizespread = 32, - particlespeed = 3.8, - particlespeedspread = 7.2, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.98, - texture = [[blooddrop2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - acidblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { + ["acid-explosion-small"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 3.2, + sizegrowth = 5.5, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, + acid_groundsplat = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.25 0.36 0.06 0.18 0.25 0.36 0.06 0.16 0.25 0.36 0.06 0.15 0.25 0.36 0.06 0.14 0.25 0.36 0.06 0.13 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 0, + sidetexture = [[none]], + size = [[35 r10]], + sizegrowth = 2.3, + ttl = 35, + pos = [[0, 15, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidshockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.8 0.99 0.11 0.14 0.7 0.8 0.09 0.50 0.20 0.25 0.04 0.010 0.08 0.12 0.02 0.006 0.05 0.06 0.01 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 45, + sidetexture = [[none]], + size = 5, + sizegrowth = [[-13 r6]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.89, + colormap = [[0.8 0.99 0.11 1 0.75 0.9 0.08 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 70, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[3 r2]], + particlelife = 12, + particlelifespread = 9.5, + particlesize = 21, + particlesizespread = 32, + particlespeed = 3.8, + particlespeedspread = 7.2, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.98, + texture = [[blooddrop2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + acidblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { - airdrag = 0.92, - colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 17, - particlelifespread = 5, - particlesize = 12, - particlesizespread = 18, - particlespeed = 0.18, - particlespeedspread = 0.20, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.99, - texture = [[bloodblast2white]], - alwaysvisible = true, - }, - }, - groundflash_acid = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.8 0.99 0.11 0.7 0 0 0 0.01]], - size = 70, - sizegrowth = 7, - ttl = 17, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - acid_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[0.5 r3]], - particlelife = 12, - particlelifespread = 23, - particlesize = 3.6, - particlesizespread = 10, - particlespeed = 3.7, - particlespeedspread = 11, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.36, - sizemod = 0.97, - texture = [[bloodspark2white]], - useairlos = false, - drawOrder = 2, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.8 0.99 0.11 0.92 0.7 0.8 0.09 0.71 0.07 0.09 0.04 0.63 0.05 0.07 0.02 0.30 0.03 0.05 0 0.24 0.01 0.03 0 0.16 0 0.025 0 0.09 0 0.02 0 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[60 r16]], - sidetexture = [[flamestream]], - size = [[35 r11]], - sizegrowth = 1.0, - ttl = [[18 r3.5]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 0, - }, - }, - }, + airdrag = 0.92, + colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 17, + particlelifespread = 5, + particlesize = 12, + particlesizespread = 18, + particlespeed = 0.18, + particlespeedspread = 0.20, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.99, + texture = [[bloodblast2white]], + alwaysvisible = true, + }, + }, + groundflash_acid = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.8 0.99 0.11 0.7 0 0 0 0.01]], + size = 70, + sizegrowth = 7, + ttl = 17, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + acid_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[0.5 r3]], + particlelife = 12, + particlelifespread = 23, + particlesize = 3.6, + particlesizespread = 10, + particlespeed = 3.7, + particlespeedspread = 11, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.36, + sizemod = 0.97, + texture = [[bloodspark2white]], + useairlos = false, + drawOrder = 2, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.8 0.99 0.11 0.92 0.7 0.8 0.09 0.71 0.07 0.09 0.04 0.63 0.05 0.07 0.02 0.30 0.03 0.05 0 0.24 0.01 0.03 0 0.16 0 0.025 0 0.09 0 0.02 0 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[60 r16]], + sidetexture = [[flamestream]], + size = [[35 r11]], + sizegrowth = 1.0, + ttl = [[18 r3.5]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - ["acid-damage-gen"] = { - acidrandom = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r22]], - explosiongenerator = [[custom:acid-damage]], - pos = [[-10 r20, 0 r20, -10 r20]], - --alwaysvisible = true, - }, - }, - }, + ["acid-damage-gen"] = { + acidrandom = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r22]], + explosiongenerator = [[custom:acid-damage]], + pos = [[-10 r20, 0 r20, -10 r20]], + --alwaysvisible = true, + }, + }, + }, - ["acid-area"] = { - usedefaultexplosions = false, - acid_groundpuddle = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - --colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 45, - sidetexture = [[none]], - size = [[230 r60]], - sizegrowth = 0.1, - ttl = 110, - pos = [[0, 15, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - class = [[CExpGenSpawner]], - count = 10, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i30]], - explosiongenerator = [[custom:acid-area-smoke]], - pos = [[-128 r256, 0 r20, -128 r256]], - }, - }, - }, + ["acid-area"] = { + usedefaultexplosions = false, + acid_groundpuddle = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + --colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 45, + sidetexture = [[none]], + size = [[230 r60]], + sizegrowth = 0.1, + ttl = 110, + pos = [[0, 15, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + class = [[CExpGenSpawner]], + count = 10, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i30]], + explosiongenerator = [[custom:acid-area-smoke]], + pos = [[-128 r256, 0 r20, -128 r256]], + }, + }, + }, - ["acid-area-rot"] = { - usedefaultexplosions = false, - -- testceg for rotParams for CSimpleGroundFlash - acid_groundsplat = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - rotParams = [[0 r0, 0, -180 r360]], - --colormap = [[0.05 0.09 0.02 0.40 0.50 0.72 0.12 0.5 0.25 0.36 0.06 0.9 0.22 0.34 0.055 0.8 0.22 0.34 0.055 0.7 0.18 0.32 0.045 0.65 0.15 0.18 0.04 0.5 0.10 0.16 0.03 0.55 0.10 0.16 0.03 0.50 0.10 0.16 0.03 0.30 0 0 0 0.01]], - colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - size = [[230 r60]], - sizegrowth = 0.1, - ttl = 110, --was 330 - texture = [[centersplatsh]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - air = true, - class = [[CExpGenSpawner]], - count = 10, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i30]], - explosiongenerator = [[custom:acid-area-smoke]], - pos = [[-128 r256, 0 r20, -128 r256]], - --alwaysvisible = true, - }, - }, - }, + ["acid-area-rot"] = { + usedefaultexplosions = false, + -- testceg for rotParams for CSimpleGroundFlash + acid_groundsplat = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + rotParams = [[0 r0, 0, -180 r360]], + --colormap = [[0.05 0.09 0.02 0.40 0.50 0.72 0.12 0.5 0.25 0.36 0.06 0.9 0.22 0.34 0.055 0.8 0.22 0.34 0.055 0.7 0.18 0.32 0.045 0.65 0.15 0.18 0.04 0.5 0.10 0.16 0.03 0.55 0.10 0.16 0.03 0.50 0.10 0.16 0.03 0.30 0 0 0 0.01]], + colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + size = [[230 r60]], + sizegrowth = 0.1, + ttl = 110, --was 330 + texture = [[centersplatsh]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i30]], + explosiongenerator = [[custom:acid-area-smoke]], + pos = [[-128 r256, 0 r20, -128 r256]], + --alwaysvisible = true, + }, + }, + }, - -- ["acid-area-75"] = { - -- usedefaultexplosions = false, - -- acid_area = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.12 0.22 0.34 0.055 0.12 0.18 0.32 0.045 0.11 0.18 0.32 0.045 0.11 0.15 0.18 0.04 0.11 0.15 0.18 0.04 0.10 0.12 0.18 0.04 0.10 0.12 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- frontoffset = 0, - -- fronttexture = [[bloodcentersplatshwhite]], - -- length = 45, - -- sidetexture = [[none]], - -- size = [[75 r15]], - -- sizegrowth = 0.11, - -- ttl = 330, - -- pos = [[0, 20, 0]], - -- rotParams = [[0 r0, 0, -180 r360]], - -- alwaysvisible = true, - -- }, - -- }, - -- acidrandomsmoke = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 5, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[0 r300]], - -- explosiongenerator = [[custom:acid-area-smoke]], - -- pos = [[-38 r75, 0 r20, -37 r75]], - -- --alwaysvisible = true, - -- }, - -- }, - -- }, + -- ["acid-area-75"] = { + -- usedefaultexplosions = false, + -- acid_area = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.12 0.22 0.34 0.055 0.12 0.18 0.32 0.045 0.11 0.18 0.32 0.045 0.11 0.15 0.18 0.04 0.11 0.15 0.18 0.04 0.10 0.12 0.18 0.04 0.10 0.12 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- frontoffset = 0, + -- fronttexture = [[bloodcentersplatshwhite]], + -- length = 45, + -- sidetexture = [[none]], + -- size = [[75 r15]], + -- sizegrowth = 0.11, + -- ttl = 330, + -- pos = [[0, 20, 0]], + -- rotParams = [[0 r0, 0, -180 r360]], + -- alwaysvisible = true, + -- }, + -- }, + -- acidrandomsmoke = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 5, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[0 r300]], + -- explosiongenerator = [[custom:acid-area-smoke]], + -- pos = [[-38 r75, 0 r20, -37 r75]], + -- --alwaysvisible = true, + -- }, + -- }, + -- }, - -- ["acid-area-150"] = { - -- usedefaultexplosions = false, - -- acid_area = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- frontoffset = 0, - -- fronttexture = [[bloodcentersplatshwhite]], - -- length = 45, - -- sidetexture = [[none]], - -- size = [[145 r25]], - -- sizegrowth = 0.0, - -- ttl = 330, - -- pos = [[0, 20, 0]], - -- rotParams = [[0 r0, 0, -180 r360]], - -- alwaysvisible = true, - -- }, - -- }, - -- acidrandomsmoke = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 6, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[0 r300]], - -- explosiongenerator = [[custom:acid-area-smoke]], - -- pos = [[-75 r150, 0 r20, -75 r150]], - -- --alwaysvisible = true, - -- }, - -- }, - -- }, + -- ["acid-area-150"] = { + -- usedefaultexplosions = false, + -- acid_area = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.10 0.22 0.34 0.055 0.10 0.18 0.32 0.045 0.10 0.15 0.18 0.04 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0.10 0.16 0.03 0.10 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- frontoffset = 0, + -- fronttexture = [[bloodcentersplatshwhite]], + -- length = 45, + -- sidetexture = [[none]], + -- size = [[145 r25]], + -- sizegrowth = 0.0, + -- ttl = 330, + -- pos = [[0, 20, 0]], + -- rotParams = [[0 r0, 0, -180 r360]], + -- alwaysvisible = true, + -- }, + -- }, + -- acidrandomsmoke = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 6, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[0 r300]], + -- explosiongenerator = [[custom:acid-area-smoke]], + -- pos = [[-75 r150, 0 r20, -75 r150]], + -- --alwaysvisible = true, + -- }, + -- }, + -- }, - -- ["burnflamexl"] = { - -- extrafire = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 3, - -- ground = true, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 1, - -- emitvector = [[dir]], - -- gravity = [[0, 0, 0]], - -- numparticles = [[0.2 r0.81]], - -- particlelife = 7, - -- particlelifespread = 12, - -- particlesize = 3, - -- particlesizespread = 12, - -- particlespeed = 0, - -- particlespeedspread = 0, - -- rotParams = [[-90 r180, -50 r100, -180 r360]], - -- pos = [[-3 r6, 20, -3 r6]], - -- sizegrowth = 2, - -- sizemod = 0.99, - -- texture = [[fire]], - -- drawOrder = -1, - -- }, - -- }, - -- flame = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 3, - -- ground = true, - -- properties = { - -- airdrag = 0.99, - -- colormap = [[0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - -- directional = false, - -- emitrot = 70, - -- emitrotspread = 40, - -- emitvector = [[0.3, -1, 0.3]], - -- gravity = [[0, 0, 0]], - -- numparticles = [[0.52 r0.65]], - -- particlelife = 8, - -- particlelifespread = 14, - -- particlesize = 3, - -- particlesizespread = 22, - -- particlespeed = -2, - -- particlespeedspread = 0.9, - -- rotParams = [[-240 r480, -100 r200, -180 r360]], - -- pos = [[-3 r8, 25 r10, -3 r8]], - -- sizegrowth = 2.0, - -- sizemod = 0.97, - -- texture = [[flame_alt2]], - -- drawOrder = 1, - -- }, - -- }, - -- }, + -- ["burnflamexl"] = { + -- extrafire = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 3, + -- ground = true, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0 0 0 0.01 0.01 0 0 0.05 0.22 0.12 0.33 0.3 0.3 0.3 0.28 0.6 0.28 0.28 0.25 0.5 0.27 0.26 0.22 0.35 0.25 0.20 0.15 0.12 0.01 0 0 0.01]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 1, + -- emitvector = [[dir]], + -- gravity = [[0, 0, 0]], + -- numparticles = [[0.2 r0.81]], + -- particlelife = 7, + -- particlelifespread = 12, + -- particlesize = 3, + -- particlesizespread = 12, + -- particlespeed = 0, + -- particlespeedspread = 0, + -- rotParams = [[-90 r180, -50 r100, -180 r360]], + -- pos = [[-3 r6, 20, -3 r6]], + -- sizegrowth = 2, + -- sizemod = 0.99, + -- texture = [[fire]], + -- drawOrder = -1, + -- }, + -- }, + -- flame = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 3, + -- ground = true, + -- properties = { + -- airdrag = 0.99, + -- colormap = [[0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + -- directional = false, + -- emitrot = 70, + -- emitrotspread = 40, + -- emitvector = [[0.3, -1, 0.3]], + -- gravity = [[0, 0, 0]], + -- numparticles = [[0.52 r0.65]], + -- particlelife = 8, + -- particlelifespread = 14, + -- particlesize = 3, + -- particlesizespread = 22, + -- particlespeed = -2, + -- particlespeedspread = 0.9, + -- rotParams = [[-240 r480, -100 r200, -180 r360]], + -- pos = [[-3 r8, 25 r10, -3 r8]], + -- sizegrowth = 2.0, + -- sizemod = 0.97, + -- texture = [[flame_alt2]], + -- drawOrder = 1, + -- }, + -- }, + -- }, - ["fire-area-75-old"] = { - usedefaultexplosions = false, - acid_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.1 0.12 0.1 0.1 0.95 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.5 0.12 0.1 0.1 0.4 0.11 0.08 0.08 0.4 0.10 0.07 0.07 0.4 0.08 0.06 0.06 0.4 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[30 r10]], - sizegrowth = 0.05, - ttl = 330, --was 330 - pos = [[0, 20, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - air = true, - class = [[CExpGenSpawner]], - count = 60, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:burnflamexl]], - pos = [[-25 r50, 0 r10, -25 r50]], - --alwaysvisible = true, - }, - }, - }, - ["fire-area-redux-75"] = { - usedefaultexplosions = false, - acid_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.3 0.1 0.1 0.95 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.2 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.95]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[30 r10]], - sizegrowth = 0.0, - ttl = 330, - pos = [[0, 20, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - air = true, - class = [[CExpGenSpawner]], - count = 40, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:burnflamexl]], - pos = [[-25 r50, 0 r10, -25 r50]], - --alwaysvisible = true, - }, - }, - }, - ["fire-area-comm-160"] = { - usedefaultexplosions = false, - acid_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.4 0.15 0.15 0.95 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.2 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.95]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 10, - sidetexture = [[none]], - size = [[120 r0]], - sizegrowth = 0.0, - ttl = 330, - pos = [[0, 20, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - air = true, - class = [[CExpGenSpawner]], - count = 320, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:burnflamexl]], - pos = [[-75 r150, 0 r20, -75 r150]], - --alwaysvisible = true, - }, - }, - }, - ["fire-area-comm-200"] = { - usedefaultexplosions = false, - acid_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.4 0.15 0.15 0.95 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.2 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.95]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 10, - sidetexture = [[none]], - size = [[150 r0]], - sizegrowth = 0.0, - ttl = 330, - pos = [[0, 20, 0]], - rotParams = [[0 r0, 0, -180 r360]], - alwaysvisible = true, - }, - }, - acidrandomsmoke = { - air = true, - class = [[CExpGenSpawner]], - count = 480, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:burnflamexl]], - pos = [[-95 r190, 0 r20, -95 r190]], - --alwaysvisible = true, - }, - }, - }, - --["fire-area-150"] = { - -- usedefaultexplosions = false, - -- acid_area = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.3 0.1 0.1 0.95 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.2 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.95]], - -- dir = [[0, 1, 0]], - -- frontoffset = 0, - -- fronttexture = [[bloodcentersplatshwhite]], - -- length = 15, - -- sidetexture = [[none]], - -- size = [[120 r30]], - -- sizegrowth = 0.0, - -- ttl = 330, - -- pos = [[0, 20, 0]], - -- rotParams = [[0 r0, 0, -180 r360]], - -- alwaysvisible = true, - -- }, - -- }, - -- acidrandomsmoke = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 240, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- delay = [[0 r300]], - -- explosiongenerator = [[custom:burnflamexl]], - -- pos = [[-75 r150, 0 r30, -75 r150]], - -- --alwaysvisible = true, - -- }, - -- }, - --}, + ["fire-area-75-old"] = { + usedefaultexplosions = false, + acid_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.1 0.12 0.1 0.1 0.95 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.5 0.12 0.1 0.1 0.4 0.11 0.08 0.08 0.4 0.10 0.07 0.07 0.4 0.08 0.06 0.06 0.4 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[30 r10]], + sizegrowth = 0.05, + ttl = 330, --was 330 + pos = [[0, 20, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + air = true, + class = [[CExpGenSpawner]], + count = 60, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:burnflamexl]], + pos = [[-25 r50, 0 r10, -25 r50]], + --alwaysvisible = true, + }, + }, + }, + ["fire-area-redux-75"] = { + usedefaultexplosions = false, + acid_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.3 0.1 0.1 0.95 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.2 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.95]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[30 r10]], + sizegrowth = 0.0, + ttl = 330, + pos = [[0, 20, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + air = true, + class = [[CExpGenSpawner]], + count = 40, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:burnflamexl]], + pos = [[-25 r50, 0 r10, -25 r50]], + --alwaysvisible = true, + }, + }, + }, + ["fire-area-comm-160"] = { + usedefaultexplosions = false, + acid_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.4 0.15 0.15 0.95 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.2 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.95]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 10, + sidetexture = [[none]], + size = [[120 r0]], + sizegrowth = 0.0, + ttl = 330, + pos = [[0, 20, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + air = true, + class = [[CExpGenSpawner]], + count = 320, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:burnflamexl]], + pos = [[-75 r150, 0 r20, -75 r150]], + --alwaysvisible = true, + }, + }, + }, + ["fire-area-comm-200"] = { + usedefaultexplosions = false, + acid_area = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.4 0.15 0.15 0.95 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.2 0.4 0.15 0.15 0.5 0.4 0.15 0.15 0.75 0.4 0.15 0.15 0.95]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 10, + sidetexture = [[none]], + size = [[150 r0]], + sizegrowth = 0.0, + ttl = 330, + pos = [[0, 20, 0]], + rotParams = [[0 r0, 0, -180 r360]], + alwaysvisible = true, + }, + }, + acidrandomsmoke = { + air = true, + class = [[CExpGenSpawner]], + count = 480, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:burnflamexl]], + pos = [[-95 r190, 0 r20, -95 r190]], + --alwaysvisible = true, + }, + }, + }, + --["fire-area-150"] = { + -- usedefaultexplosions = false, + -- acid_area = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.3 0.1 0.1 0.95 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.2 0.3 0.1 0.1 0.5 0.3 0.1 0.1 0.75 0.3 0.1 0.1 0.95]], + -- dir = [[0, 1, 0]], + -- frontoffset = 0, + -- fronttexture = [[bloodcentersplatshwhite]], + -- length = 15, + -- sidetexture = [[none]], + -- size = [[120 r30]], + -- sizegrowth = 0.0, + -- ttl = 330, + -- pos = [[0, 20, 0]], + -- rotParams = [[0 r0, 0, -180 r360]], + -- alwaysvisible = true, + -- }, + -- }, + -- acidrandomsmoke = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 240, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[0 r300]], + -- explosiongenerator = [[custom:burnflamexl]], + -- pos = [[-75 r150, 0 r30, -75 r150]], + -- --alwaysvisible = true, + -- }, + -- }, + --}, --- ["acid-area-192"] = { --- usedefaultexplosions = false, --- acid_area = { --- air = true, --- class = [[CBitmapMuzzleFlame]], --- count = 1, --- ground = true, --- underwater = 1, --- water = true, --- properties = { --- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.11 0.22 0.34 0.055 0.11 0.20 0.33 0.049 0.11 0.19 0.32 0.047 0.11 0.18 0.32 0.045 0.11 0.15 0.18 0.04 0.11 0.10 0.16 0.03 0.10 0 0 0 0.01]], --- dir = [[0, 1, 0]], --- frontoffset = 0, --- fronttexture = [[bloodcentersplatshwhite]], --- length = 45, --- sidetexture = [[none]], --- size = [[188 r35]], --- sizegrowth = 0.0, --- ttl = 330, --- pos = [[0, 20, 0]], --- rotParams = [[0 r0, 0, -180 r360]], --- alwaysvisible = true, --- }, --- }, --- acidrandomsmoke = { --- air = true, --- class = [[CExpGenSpawner]], --- count = 6, --- ground = true, --- water = true, --- underwater = true, --- properties = { --- delay = [[0 r300]], --- explosiongenerator = [[custom:acid-area-smoke]], --- pos = [[-96 r192, 0 r20, -96 r192]], --- --alwaysvisible = true, --- }, --- }, --- }, + -- ["acid-area-192"] = { + -- usedefaultexplosions = false, + -- acid_area = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.05 0.09 0.02 0.10 0.25 0.36 0.06 0.12 0.25 0.36 0.06 0.12 0.22 0.34 0.055 0.11 0.22 0.34 0.055 0.11 0.20 0.33 0.049 0.11 0.19 0.32 0.047 0.11 0.18 0.32 0.045 0.11 0.15 0.18 0.04 0.11 0.10 0.16 0.03 0.10 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- frontoffset = 0, + -- fronttexture = [[bloodcentersplatshwhite]], + -- length = 45, + -- sidetexture = [[none]], + -- size = [[188 r35]], + -- sizegrowth = 0.0, + -- ttl = 330, + -- pos = [[0, 20, 0]], + -- rotParams = [[0 r0, 0, -180 r360]], + -- alwaysvisible = true, + -- }, + -- }, + -- acidrandomsmoke = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 6, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- delay = [[0 r300]], + -- explosiongenerator = [[custom:acid-area-smoke]], + -- pos = [[-96 r192, 0 r20, -96 r192]], + -- --alwaysvisible = true, + -- }, + -- }, + -- }, -["acid-area-smoke"] = { - usedefaultexplosions = false, - acidclouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.05 0.10 0.05 0.03 0.33 0.40 0.33 0.2 0.32 0.37 0.32 0.13 0.30 0.30 0.30 0.08 0 0 0 0.01]], - directional = false, - emitrot = 6, - emitrotspread = 4, - emitvector = [[-0.1 r0.2, 1, -0.1 r0.2]], - gravity = [[0, 0.055, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 80, - particlesize = 20, - particlesizespread = 68, - particlespeed = 2.3, - particlespeedspread = 2.3, - rotParams = [[-10 r20, -5 r10, -120 r60]], - pos = [[0, 15, 0]], - sizegrowth = 0.8, - sizemod = 0.99, - texture = [[cloudmist]], - drawOrder = 0, - }, - }, - }, + ["acid-area-smoke"] = { + usedefaultexplosions = false, + acidclouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.05 0.10 0.05 0.03 0.33 0.40 0.33 0.2 0.32 0.37 0.32 0.13 0.30 0.30 0.30 0.08 0 0 0 0.01]], + directional = false, + emitrot = 6, + emitrotspread = 4, + emitvector = [[-0.1 r0.2, 1, -0.1 r0.2]], + gravity = [[0, 0.055, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 80, + particlesize = 20, + particlesizespread = 68, + particlespeed = 2.3, + particlespeedspread = 2.3, + rotParams = [[-10 r20, -5 r10, -120 r60]], + pos = [[0, 15, 0]], + sizegrowth = 0.8, + sizemod = 0.99, + texture = [[cloudmist]], + drawOrder = 0, + }, + }, + }, - ["acid-damage"] = { - usedefaultexplosions = false, - groundflash_acid = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - rotParams = [[-50 r100, -10 r20, -180 r360]], - colormap = [[0.8 0.99 0.11 0.5 0 0 0 0.01]], - size = [[18 r8]], - sizegrowth = 3, - ttl = 13, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - acidblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { + ["acid-damage"] = { + usedefaultexplosions = false, + groundflash_acid = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + rotParams = [[-50 r100, -10 r20, -180 r360]], + colormap = [[0.8 0.99 0.11 0.5 0 0 0 0.01]], + size = [[18 r8]], + sizegrowth = 3, + ttl = 13, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + acidblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { - airdrag = 0.92, - colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - numparticles = [[0.3 r1]], - particlelife = 8, - particlelifespread = 4.5, - particlesize = 7, - particlesizespread = 14, - particlespeed = 0.18, - particlespeedspread = 0.20, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, 15 r20, -10 r20]], - sizegrowth = 2.7, - sizemod = 0.98, - texture = [[bloodblast2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - acid_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[0.3 r0.9]], - particlelife = 9, - particlelifespread = 18, - particlesize = 3.0, - particlesizespread = 9.7, - particlespeed = 2.3, - particlespeedspread = 7.3, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.32, - sizemod = 0.96, - texture = [[bloodspark2white]], - useairlos = false, - drawOrder = 2, - }, - }, - hissingsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.05 0.05 0.05 0.03 0.17 0.17 0.17 0.1 0.19 0.19 0.19 0.056 0.12 0.12 0.12 0.06 0 0 0 0.01]], - directional = false, - emitrot = 10, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.055, 0]], - numparticles = [[0.3 r0.9]], - particlelife = 40, - particlelifespread = 70, - particlesize = 2, - particlesizespread = 4, - particlespeed = 3.3, - particlespeedspread = 3.3, - rotParams = [[-10 r20, 0, -180 r360]], - pos = [[0, 15, 0]], - sizegrowth = 0.5, - sizemod = 0.99, - texture = [[bigexplosmoke]], - drawOrder = 0, - }, - }, - }, + airdrag = 0.92, + colormap = [[0.8 0.99 0.11 1 0.8 0.99 0.11 0.8 0.8 0.99 0.09 0.9 0.02 0.12 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + numparticles = [[0.3 r1]], + particlelife = 8, + particlelifespread = 4.5, + particlesize = 7, + particlesizespread = 14, + particlespeed = 0.18, + particlespeedspread = 0.20, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, 15 r20, -10 r20]], + sizegrowth = 2.7, + sizemod = 0.98, + texture = [[bloodblast2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + acid_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.8 0.99 0.11 0.8 0.8 0.9 0.09 1 0.8 0.99 0.11 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[0.3 r0.9]], + particlelife = 9, + particlelifespread = 18, + particlesize = 3.0, + particlesizespread = 9.7, + particlespeed = 2.3, + particlespeedspread = 7.3, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.32, + sizemod = 0.96, + texture = [[bloodspark2white]], + useairlos = false, + drawOrder = 2, + }, + }, + hissingsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.05 0.05 0.05 0.03 0.17 0.17 0.17 0.1 0.19 0.19 0.19 0.056 0.12 0.12 0.12 0.06 0 0 0 0.01]], + directional = false, + emitrot = 10, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.055, 0]], + numparticles = [[0.3 r0.9]], + particlelife = 40, + particlelifespread = 70, + particlesize = 2, + particlesizespread = 4, + particlespeed = 3.3, + particlespeedspread = 3.3, + rotParams = [[-10 r20, 0, -180 r360]], + pos = [[0, 15, 0]], + sizegrowth = 0.5, + sizemod = 0.99, + texture = [[bigexplosmoke]], + drawOrder = 0, + }, + }, + }, - ["blood_explode_xl"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 3.5, - sizegrowth = 6, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - bloodshockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 0.9 0.17 0.1 0.14 0.80 0.12 0.09 0.50 0.25 0.10 0.04 0.010 0.12 0.05 0.02 0.006 0.06 0.02 0.01 0.005 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 45, - sidetexture = [[none]], - size = 6, - sizegrowth = [[-14 r7]], - ttl = 10, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.89, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 70, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[6 r3]], - particlelife = 14, - particlelifespread = 9.5, - particlesize = 22, - particlesizespread = 34, - particlespeed = 3.5, - particlespeedspread = 6.5, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = 0.4, - sizemod = 0.98, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 5, - particlesize = 14, - particlesizespread = 20, - particlespeed = 0.17, - particlespeedspread = 0.19, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.99, - texture = [[bloodblast2]], - alwaysvisible = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[1 0.8 0.55 0.11 0.9 0.28 0.15 0.08 0.66 0.20 0.02 0.033 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 7, - particlelife = 1.9, - particlelifespread = 13, - particlesize = 12, - particlesizespread = 18, - particlespeed = 0.99, - particlespeedspread = 4.3, - pos = [[0, 4, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - drawOrder = 1, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = true, - properties = { - colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.5 0.3 0.75 0.65 0.3 0.12 0.30 0.20 0.05 0.03 0.008 0.06 0.03 0.01 0.005 0.01 0.01 0.01 0.02]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 45, - sidetexture = [[none]], - size = 3.2, - sizegrowth = [[-17 r4]], - ttl = 8, - pos = [[0, 20, 0]], - drawOrder = 1, - }, - }, - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.62 0 0.01 0.7 0 0 0 0.01]], - size = 80, - sizegrowth = 7, - ttl = 18, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[0.5 r4]], - particlelife = 10, - particlelifespread = 20, - particlesize = 2.5, - particlesizespread = 9, - particlespeed = 3.2, - particlespeedspread = 9.5, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.32, - sizemod = 0.96, - texture = [[bloodspark2]], - useairlos = false, - drawOrder = 2, - }, - }, - bigsmoketrails = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 0, - water = true, - properties = { - colormap = [[0.85 0.0 0.08 0.92 0.65 0.0 0.06 0.71 0.07 0.0 0.05 0.63 0.07 0.0 0.03 0.30 0.05 0.0 0.02 0.24 0.03 0.0 0.01 0.16 0.025 0.0 0.0 0.09 0.02 0.0 0.0 0.07 0 0 0 0.01]], - dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.05, - fronttexture = [[none]], - length = [[75 r20]], - sidetexture = [[flamestream]], - size = [[40 r14]], - sizegrowth = 1.0, - ttl = [[20 r4]], - rotParams = [[-24 r48, -10 r20, 0 r90]], - pos = [[-10 r20, 0 r12, -10 r20]], - drawOrder = 0, - }, - }, - }, + ["blood_explode_xl"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 3.5, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, + bloodshockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 0.9 0.17 0.1 0.14 0.80 0.12 0.09 0.50 0.25 0.10 0.04 0.010 0.12 0.05 0.02 0.006 0.06 0.02 0.01 0.005 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 45, + sidetexture = [[none]], + size = 6, + sizegrowth = [[-14 r7]], + ttl = 10, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.89, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 70, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[6 r3]], + particlelife = 14, + particlelifespread = 9.5, + particlesize = 22, + particlesizespread = 34, + particlespeed = 3.5, + particlespeedspread = 6.5, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = 0.4, + sizemod = 0.98, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 5, + particlesize = 14, + particlesizespread = 20, + particlespeed = 0.17, + particlespeedspread = 0.19, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.99, + texture = [[bloodblast2]], + alwaysvisible = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[1 0.8 0.55 0.11 0.9 0.28 0.15 0.08 0.66 0.20 0.02 0.033 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 7, + particlelife = 1.9, + particlelifespread = 13, + particlesize = 12, + particlesizespread = 18, + particlespeed = 0.99, + particlespeedspread = 4.3, + pos = [[0, 4, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + drawOrder = 1, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = true, + properties = { + colormap = [[0 0 0 0 1 0.95 0.9 0.18 0.85 0.5 0.3 0.75 0.65 0.3 0.12 0.30 0.20 0.05 0.03 0.008 0.06 0.03 0.01 0.005 0.01 0.01 0.01 0.02]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 45, + sidetexture = [[none]], + size = 3.2, + sizegrowth = [[-17 r4]], + ttl = 8, + pos = [[0, 20, 0]], + drawOrder = 1, + }, + }, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.62 0 0.01 0.7 0 0 0 0.01]], + size = 80, + sizegrowth = 7, + ttl = 18, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[0.5 r4]], + particlelife = 10, + particlelifespread = 20, + particlesize = 2.5, + particlesizespread = 9, + particlespeed = 3.2, + particlespeedspread = 9.5, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.32, + sizemod = 0.96, + texture = [[bloodspark2]], + useairlos = false, + drawOrder = 2, + }, + }, + bigsmoketrails = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 0, + water = true, + properties = { + colormap = [[0.85 0.0 0.08 0.92 0.65 0.0 0.06 0.71 0.07 0.0 0.05 0.63 0.07 0.0 0.03 0.30 0.05 0.0 0.02 0.24 0.03 0.0 0.01 0.16 0.025 0.0 0.0 0.09 0.02 0.0 0.0 0.07 0 0 0 0.01]], + dir = [[-0.6 r1.2, 0.5 r0.40, 0 r-0.6]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.05, + fronttexture = [[none]], + length = [[75 r20]], + sidetexture = [[flamestream]], + size = [[40 r14]], + sizegrowth = 1.0, + ttl = [[20 r4]], + rotParams = [[-24 r48, -10 r20, 0 r90]], + pos = [[-10 r20, 0 r12, -10 r20]], + drawOrder = 0, + }, + }, + }, - ["blood_explode"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 2.1, - sizegrowth = 6, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.91, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = [[6 r3]], - particlelife = 14, - particlelifespread = 9.5, - particlesize = 8, - particlesizespread = 12, - particlespeed = 3.5, - particlespeedspread = 3.5, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 5, - particlesize = 8, - particlesizespread = 10, - particlespeed = 0.1, - particlespeedspread = 0.1, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.99, - texture = [[bloodblast2]], - alwaysvisible = true, - }, - }, - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], - size = 40, - sizegrowth = 5, - ttl = 16, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.5 r6]], - particlelife = 10, - particlelifespread = 20, - particlesize = 1, - particlesizespread = 6, - particlespeed = 2.0, - particlespeedspread = 6.5, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.27, - sizemod = 0.96, - texture = [[bloodspark2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + ["blood_explode"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 2.1, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.91, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = [[6 r3]], + particlelife = 14, + particlelifespread = 9.5, + particlesize = 8, + particlesizespread = 12, + particlespeed = 3.5, + particlespeedspread = 3.5, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 5, + particlesize = 8, + particlesizespread = 10, + particlespeed = 0.1, + particlespeedspread = 0.1, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.99, + texture = [[bloodblast2]], + alwaysvisible = true, + }, + }, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], + size = 40, + sizegrowth = 5, + ttl = 16, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.5 r6]], + particlelife = 10, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 6, + particlespeed = 2.0, + particlespeedspread = 6.5, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.27, + sizemod = 0.96, + texture = [[bloodspark2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - ["blood_explode_small"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.205, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 1.5, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.91, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = [[6 r2]], - particlelife = 14, - particlelifespread = 9.5, - particlesize = 8, - particlesizespread = 11, - particlespeed = 3.5, - particlespeedspread = 3.5, - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 5, - particlesize = 8, - particlesizespread = 10, - particlespeed = 0.1, - particlespeedspread = 0.1, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.99, - texture = [[bloodblast2]], - alwaysvisible = true, - }, - }, - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], - size = 40, - sizegrowth = 5, - ttl = 16, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[3 r2]], - particlelife = 10, - particlelifespread = 20, - particlesize = 1.0, - particlesizespread = 4.8, - particlespeed = 4.0, - particlespeedspread = 4.5, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.3, - sizemod = 0.99, - texture = [[bloodspark2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + ["blood_explode_small"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.205, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 1.5, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.91, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = [[6 r2]], + particlelife = 14, + particlelifespread = 9.5, + particlesize = 8, + particlesizespread = 11, + particlespeed = 3.5, + particlespeedspread = 3.5, + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 5, + particlesize = 8, + particlesizespread = 10, + particlespeed = 0.1, + particlespeedspread = 0.1, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.99, + texture = [[bloodblast2]], + alwaysvisible = true, + }, + }, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], + size = 40, + sizegrowth = 5, + ttl = 16, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[3 r2]], + particlelife = 10, + particlelifespread = 20, + particlesize = 1.0, + particlesizespread = 4.8, + particlespeed = 4.0, + particlespeedspread = 4.5, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.3, + sizemod = 0.99, + texture = [[bloodspark2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - ["blood_explode_blue"] = { - usedefaultexplosions = false, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.205, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - size = 1.5, - sizegrowth = 6, - speed = [[0, 1 0, 0]], - texture = [[bloodcentersplatshwhite]], - drawOrder = 1, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.91, - colormap = [[0 0.8 0.8 1 0 0.7 0.7 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.16, 0]], - numparticles = [[4 r3]], - particlelife = 12, - particlelifespread = 8.5, - particlesize = 8, - particlesizespread = 12, - particlespeed = 2.8, - particlespeedspread = 2.8, - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[0 0.7 0.7 1 0 0.7 0.7 0.9 0 0.7 0.7 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 5, - particlesize = 8, - particlesizespread = 10, - particlespeed = 0.1, - particlespeedspread = 0.1, - pos = [[-10 r20, -10 r20, -10 r20]], - sizegrowth = 2.5, - sizemod = 0.98, - texture = [[bloodblast2white]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.1 0.6 0.8 0.55 0 0 0 0.01]], - size = 40, - sizegrowth = 5, - ttl = 16, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.1 0.8 0.8 0.8 0.05 0.7 0.7 1 0.1 0.8 0.8 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.9 r6.1]], - particlelife = 10, - particlelifespread = 20, - particlesize = 2.8, - particlesizespread = 5.5, - particlespeed = 2.0, - particlespeedspread = 6.5, - pos = [[0, 4, 0]], - sizegrowth = 0.27, - sizemod = 0.96, - texture = [[bloodspark2white]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + ["blood_explode_blue"] = { + usedefaultexplosions = false, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.205, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + size = 1.5, + sizegrowth = 6, + speed = [[0, 1 0, 0]], + texture = [[bloodcentersplatshwhite]], + drawOrder = 1, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.91, + colormap = [[0 0.8 0.8 1 0 0.7 0.7 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.16, 0]], + numparticles = [[4 r3]], + particlelife = 12, + particlelifespread = 8.5, + particlesize = 8, + particlesizespread = 12, + particlespeed = 2.8, + particlespeedspread = 2.8, + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[0 0.7 0.7 1 0 0.7 0.7 0.9 0 0.7 0.7 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 5, + particlesize = 8, + particlesizespread = 10, + particlespeed = 0.1, + particlespeedspread = 0.1, + pos = [[-10 r20, -10 r20, -10 r20]], + sizegrowth = 2.5, + sizemod = 0.98, + texture = [[bloodblast2white]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.1 0.6 0.8 0.55 0 0 0 0.01]], + size = 40, + sizegrowth = 5, + ttl = 16, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.1 0.8 0.8 0.8 0.05 0.7 0.7 1 0.1 0.8 0.8 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.9 r6.1]], + particlelife = 10, + particlelifespread = 20, + particlesize = 2.8, + particlesizespread = 5.5, + particlespeed = 2.0, + particlespeedspread = 6.5, + pos = [[0, 4, 0]], + sizegrowth = 0.27, + sizemod = 0.96, + texture = [[bloodspark2white]], + useairlos = false, + drawOrder = 2, + }, + }, + }, - ["blood_trail_xl"] = { - usedefaultexplosions = false, - splash = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[0.6 0 0 1 1 1 1 1 0.8 0.8 0.8 0.7 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 60, - emitvector = [[-1 r2, -1 r2, -1 r2]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.8 r1.2]], - particlelife = 9, - particlelifespread = 12, - particlesize = 8.2, - particlesizespread = 22.6, - particlespeed = 0.6, - particlespeedspread = 1.5, - rotParams = [[-2 r4, -1 r2, -180 r360]], - pos = [[0, 1, 0]], - sizegrowth = 1.2, - sizemod = 0.97, - texture = [[bloodblast2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - bloodtrail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], - dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], - frontoffset = 0, - fronttexture = [[bloodsplat2]], - length = [[5.5 r1.2]], - sidetexture = [[bloodsplat2]], - size = 2.2, - sizegrowth = [[5.0 r3]], - ttl = 18, - rotParams = [[-2 r4, -1 r2, -180 r360]], - drawOrder = 1, - }, - }, - }, + ["blood_trail_xl"] = { + usedefaultexplosions = false, + splash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[0.6 0 0 1 1 1 1 1 0.8 0.8 0.8 0.7 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 60, + emitvector = [[-1 r2, -1 r2, -1 r2]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.8 r1.2]], + particlelife = 9, + particlelifespread = 12, + particlesize = 8.2, + particlesizespread = 22.6, + particlespeed = 0.6, + particlespeedspread = 1.5, + rotParams = [[-2 r4, -1 r2, -180 r360]], + pos = [[0, 1, 0]], + sizegrowth = 1.2, + sizemod = 0.97, + texture = [[bloodblast2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, + bloodtrail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], + dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], + frontoffset = 0, + fronttexture = [[bloodsplat2]], + length = [[5.5 r1.2]], + sidetexture = [[bloodsplat2]], + size = 2.2, + sizegrowth = [[5.0 r3]], + ttl = 18, + rotParams = [[-2 r4, -1 r2, -180 r360]], + drawOrder = 1, + }, + }, + }, - ["blood_spray"] = { - usedefaultexplosions = false, - splash = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[1 1 1 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 40, - emitvector = [[-1 r2, -1 r2, -1 r2]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.2 r0.9]], - particlelife = 8, - particlelifespread = 6, - particlesize = 0.15, - particlesizespread = 0.3, - particlespeed = 0.4, - particlespeedspread = 1.2, - pos = [[0, 1, 0]], - sizegrowth = 1.2, - sizemod = 0.99, - texture = [[bloodsplat2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - bloodtrail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], - dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], - frontoffset = 0, - fronttexture = [[bloodsplat2]], - length = [[3.5 r0.9]], - sidetexture = [[bloodsplat2]], - size = 0.7, - sizegrowth = [[7.0 r3]], - ttl = 12, - rotParams = [[-2 r4, -1 r2, -180 r360]], - drawOrder = 1, - }, - }, - }, + ["blood_spray"] = { + usedefaultexplosions = false, + splash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[1 1 1 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 40, + emitvector = [[-1 r2, -1 r2, -1 r2]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.2 r0.9]], + particlelife = 8, + particlelifespread = 6, + particlesize = 0.15, + particlesizespread = 0.3, + particlespeed = 0.4, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = 1.2, + sizemod = 0.99, + texture = [[bloodsplat2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, + bloodtrail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], + dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], + frontoffset = 0, + fronttexture = [[bloodsplat2]], + length = [[3.5 r0.9]], + sidetexture = [[bloodsplat2]], + size = 0.7, + sizegrowth = [[7.0 r3]], + ttl = 12, + rotParams = [[-2 r4, -1 r2, -180 r360]], + drawOrder = 1, + }, + }, + }, - ["blood_spray_small"] = { - usedefaultexplosions = false, - splash = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[1 1 1 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 40, - emitvector = [[-1 r2, -1 r2, -1 r2]], - gravity = [[0, -0.15, 0]], - numparticles = [[0.2 r0.9]], - particlelife = 8, - particlelifespread = 6, - particlesize = 0.15, - particlesizespread = 0.3, - particlespeed = 0.4, - particlespeedspread = 1.2, - pos = [[0, 1, 0]], - sizegrowth = 1.2, - sizemod = 0.99, - texture = [[bloodsplat2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - bloodtrail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], - dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], - frontoffset = 0, - fronttexture = [[bloodsplat2]], - length = [[3.5 r0.9]], - sidetexture = [[bloodsplat2]], - size = 0.7, - sizegrowth = [[7.0 r3]], - ttl = 12, - rotParams = [[-20 r40, -10 r20, -180 r360]], - drawOrder = 1, - }, - }, - }, + ["blood_spray_small"] = { + usedefaultexplosions = false, + splash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[1 1 1 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 40, + emitvector = [[-1 r2, -1 r2, -1 r2]], + gravity = [[0, -0.15, 0]], + numparticles = [[0.2 r0.9]], + particlelife = 8, + particlelifespread = 6, + particlesize = 0.15, + particlesizespread = 0.3, + particlespeed = 0.4, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = 1.2, + sizemod = 0.99, + texture = [[bloodsplat2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, + bloodtrail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], + dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], + frontoffset = 0, + fronttexture = [[bloodsplat2]], + length = [[3.5 r0.9]], + sidetexture = [[bloodsplat2]], + size = 0.7, + sizegrowth = [[7.0 r3]], + ttl = 12, + rotParams = [[-20 r40, -10 r20, -180 r360]], + drawOrder = 1, + }, + }, + }, - ["blood_hit"] = { - usedefaultexplosions = false, - splash = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.9 0.9 1 0.7 0.7 0.7 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 40, - emitvector = [[-0.9 r1.8, -0.9 r1.8, -0.9 r1.8]], - gravity = [[0, -0.15, 0]], - numparticles = [[2 r1]], - particlelife = 9, - particlelifespread = 7, - particlesize = 1.5, - particlesizespread = 1, - particlespeed = 0.3, - particlespeedspread = 0.5, - rotParams = [[-20 r40, -10 r20, -180 r360]], - pos = [[0, 16, 0]], - sizegrowth = 1.2, - sizemod = 0.99, - texture = [[bloodsplat2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodtrail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], - dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], - frontoffset = 0.1, - fronttexture = [[bloodsplat2]], - length = [[4.5 r1.6]], - sidetexture = [[bloodsplat2]], - size = 1.8, - sizegrowth = [[6.5 r3]], - ttl = 14, - rotParams = [[-20 r40, -10 r20, -180 r360]], - drawOrder = 1, - }, - }, - }, - ["blood_hit_small"] = { - usedefaultexplosions = false, - splash = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.98, - colormap = [[0.9 0.9 0.9 1 0.7 0.7 0.7 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 40, - emitvector = [[-1 r2, -1 r2, -1 r2]], - gravity = [[0, -0.15, 0]], - numparticles = [[2 r1]], - particlelife = 9, - particlelifespread = 7, - particlesize = 0.60, - particlesizespread = 0.8, - particlespeed = 0.3, - particlespeedspread = 0.5, - rotParams = [[-40 r80, -10 r20, -180 r360]], - pos = [[0, 16, 0]], - sizegrowth = 1.2, - sizemod = 0.99, - texture = [[bloodsplat2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - bloodtrail = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], - dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], - frontoffset = 0.1, - fronttexture = [[bloodsplat2]], - length = [[4.5 r1.6]], - sidetexture = [[bloodsplat2]], - size = 1.8, - sizegrowth = [[6.5 r3]], - ttl = 14, - rotParams = [[-60 r120, -10 r20, -180 r360]], - }, - }, - }, + ["blood_hit"] = { + usedefaultexplosions = false, + splash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.9 0.9 1 0.7 0.7 0.7 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 40, + emitvector = [[-0.9 r1.8, -0.9 r1.8, -0.9 r1.8]], + gravity = [[0, -0.15, 0]], + numparticles = [[2 r1]], + particlelife = 9, + particlelifespread = 7, + particlesize = 1.5, + particlesizespread = 1, + particlespeed = 0.3, + particlespeedspread = 0.5, + rotParams = [[-20 r40, -10 r20, -180 r360]], + pos = [[0, 16, 0]], + sizegrowth = 1.2, + sizemod = 0.99, + texture = [[bloodsplat2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodtrail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], + dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], + frontoffset = 0.1, + fronttexture = [[bloodsplat2]], + length = [[4.5 r1.6]], + sidetexture = [[bloodsplat2]], + size = 1.8, + sizegrowth = [[6.5 r3]], + ttl = 14, + rotParams = [[-20 r40, -10 r20, -180 r360]], + drawOrder = 1, + }, + }, + }, + ["blood_hit_small"] = { + usedefaultexplosions = false, + splash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.98, + colormap = [[0.9 0.9 0.9 1 0.7 0.7 0.7 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 40, + emitvector = [[-1 r2, -1 r2, -1 r2]], + gravity = [[0, -0.15, 0]], + numparticles = [[2 r1]], + particlelife = 9, + particlelifespread = 7, + particlesize = 0.60, + particlesizespread = 0.8, + particlespeed = 0.3, + particlespeedspread = 0.5, + rotParams = [[-40 r80, -10 r20, -180 r360]], + pos = [[0, 16, 0]], + sizegrowth = 1.2, + sizemod = 0.99, + texture = [[bloodsplat2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + bloodtrail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.7 0.7 0.9 0.4 0.4 0.4 0.7 0.2 0.2 0.2 0.3 0 0 0 0.01]], + dir = [[-0.8 r1.6, -0.8 r1.6, -0.8 r1.6]], + frontoffset = 0.1, + fronttexture = [[bloodsplat2]], + length = [[4.5 r1.6]], + sidetexture = [[bloodsplat2]], + size = 1.8, + sizegrowth = [[6.5 r3]], + ttl = 14, + rotParams = [[-60 r120, -10 r20, -180 r360]], + }, + }, + }, - -- CEGs for revision of unit_area_timed_damage ------------------------------- + -- CEGs for revision of unit_area_timed_damage ------------------------------- - ["acid-area-smoke-repeat"] = { - usedefaultexplosions = false, - acid_clouddust = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.05 0.10 0.05 0.03 0.33 0.40 0.33 0.2 0.3 0.34 0.3 0.1 0.22 0.22 0.22 0.07 0 0 0 0.01]], - directional = false, - emitrot = 6, - emitrotspread = 4, - emitvector = [[-0.1 r0.2, 1, -0.1 r0.2]], - gravity = [[0, 0.055, 0]], - numparticles = [[0.18 r1]], - particlelife = 30, - particlelifespread = 90, - particlesize = 64, - particlesizespread = 64, - particlespeed = 2.3, - particlespeedspread = 2.3, - rotParams = [[-10 r20, -5 r10, -120 r60]], - pos = [[0, 48, 0]], - sizegrowth = 1, - sizemod = 0.985, - texture = [[cloudmist]], - drawOrder = 1, - }, - }, - }, + ["acid-area-smoke-repeat"] = { + usedefaultexplosions = false, + acid_clouddust = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.05 0.10 0.05 0.03 0.33 0.40 0.33 0.2 0.3 0.34 0.3 0.1 0.22 0.22 0.22 0.07 0 0 0 0.01]], + directional = false, + emitrot = 6, + emitrotspread = 4, + emitvector = [[-0.1 r0.2, 1, -0.1 r0.2]], + gravity = [[0, 0.055, 0]], + numparticles = [[0.18 r1]], + particlelife = 30, + particlelifespread = 90, + particlesize = 64, + particlesizespread = 64, + particlespeed = 2.3, + particlespeedspread = 2.3, + rotParams = [[-10 r20, -5 r10, -120 r60]], + pos = [[0, 48, 0]], + sizegrowth = 1, + sizemod = 0.985, + texture = [[cloudmist]], + drawOrder = 1, + }, + }, + }, - ["acid-area-repeat"] = { - usedefaultexplosions = false, - acid_groundpuddle = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.045 0.045 0.045 0.06 0.14 0.08 0.043 0.067 0.12 0.12 0.04 0.08 0.11 0.15 0.05 0.10 0.11 0.18 0.06 0.12 0.10 0.18 0.06 0.12 0.10 0.18 0.06 0.12 0.09 0.18 0.06 0.12 0.09 0.18 0.06 0.12 0.042 0.09 0.028 0.06 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 0, - sidetexture = [[none]], - size = [[230 r60]], - sizegrowth = 0.10, - ttl = 64, - pos = [[0, 8, 0]], - rotParams = [[0, 0, -180 r360]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - acid_randomsmoke = { - class = [[CExpGenSpawner]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[r18]], - explosiongenerator = [[custom:acid-area-smoke-repeat]], - pos = [[-128 r256, 0 r20, -128 r256]], - }, - }, - }, + ["acid-area-repeat"] = { + usedefaultexplosions = false, + acid_groundpuddle = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.045 0.045 0.045 0.06 0.14 0.08 0.043 0.067 0.12 0.12 0.04 0.08 0.11 0.15 0.05 0.10 0.11 0.18 0.06 0.12 0.10 0.18 0.06 0.12 0.10 0.18 0.06 0.12 0.09 0.18 0.06 0.12 0.09 0.18 0.06 0.12 0.042 0.09 0.028 0.06 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 0, + sidetexture = [[none]], + size = [[230 r60]], + sizegrowth = 0.10, + ttl = 64, + pos = [[0, 8, 0]], + rotParams = [[0, 0, -180 r360]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + acid_randomsmoke = { + class = [[CExpGenSpawner]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[r18]], + explosiongenerator = [[custom:acid-area-smoke-repeat]], + pos = [[-128 r256, 0 r20, -128 r256]], + }, + }, + }, } local areaSizesUnitTimedDamage = { 37.5, 46, 54, 63, 75, 88, 100, 125, 150, 175, 200, 225, 250, 275, 300 } @@ -2421,66 +2421,66 @@ local areaSizesUnitDefinitions = { 75, 150, 192 } -- from raptor defs local debugEffects = false local debugCircle = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0.1 0.05 0 0 0.1 0.01 0 0 0 0]], - dir = [[0, 1, 0]], - drawOrder = 2, - frontoffset = 0, - fronttexture = [[blastwave]], - length = 0, - pos = [[0, 0, 0]], - rotParams = [[0, 0, 0]], - sidetexture = [[none]], - size = 75, - sizegrowth = [[0]], - ttl = 30, - }, + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0.1 0.05 0 0 0.1 0.01 0 0 0 0]], + dir = [[0, 1, 0]], + drawOrder = 2, + frontoffset = 0, + fronttexture = [[blastwave]], + length = 0, + pos = [[0, 0, 0]], + rotParams = [[0, 0, 0]], + sidetexture = [[none]], + size = 75, + sizegrowth = [[0]], + ttl = 30, + }, } local function count(radius) - return math.round(2 + (radius - 75) / 84) + return math.round(2 + (radius - 75) / 84) end local function size(radius) - return string.format([[%.0f r%.0f]], radius * 0.9, radius * 0.2 + 8) + return string.format([[%.0f r%.0f]], radius * 0.9, radius * 0.2 + 8) end local function pos(radius, ypos) - local xz = string.format([[%.0f r%.0f]], radius * -0.4, radius * 0.8) - return xz .. ", " .. (ypos or [[0]]) .. ", " .. xz + local xz = string.format([[%.0f r%.0f]], radius * -0.4, radius * 0.8) + return xz .. ", " .. (ypos or [[0]]) .. ", " .. xz end local areaSizePresets = {} -for _, array in pairs({areaSizesUnitTimedDamage, areaSizesUnitDefinitions}) do - for _, radius in ipairs(array) do - local key = tostring(radius) - if not areaSizePresets[key] then - areaSizePresets[key] = true - areaSizePresets[#areaSizePresets+1] = radius - end - end +for _, array in pairs({ areaSizesUnitTimedDamage, areaSizesUnitDefinitions }) do + for _, radius in ipairs(array) do + local key = tostring(radius) + if not areaSizePresets[key] then + areaSizePresets[key] = true + areaSizePresets[#areaSizePresets + 1] = radius + end + end end for ii = 1, #areaSizePresets do - local radius = areaSizePresets[ii] - local expgen = table.copy(definitions['acid-area-repeat']) - expgen.acid_groundpuddle.properties.size = size(radius) - expgen.acid_randomsmoke.count = count(radius) - expgen.acid_randomsmoke.properties.pos = pos(radius, [[r20]]) - if debugEffects then - expgen.debugcircle = table.copy(debugCircle) - expgen.debugcircle.properties.size = radius - end - local name = 'acid-area-' .. math.floor(radius) .. '-repeat' - definitions[name] = expgen + local radius = areaSizePresets[ii] + local expgen = table.copy(definitions["acid-area-repeat"]) + expgen.acid_groundpuddle.properties.size = size(radius) + expgen.acid_randomsmoke.count = count(radius) + expgen.acid_randomsmoke.properties.pos = pos(radius, [[r20]]) + if debugEffects then + expgen.debugcircle = table.copy(debugCircle) + expgen.debugcircle.properties.size = radius + end + local name = "acid-area-" .. math.floor(radius) .. "-repeat" + definitions[name] = expgen end -definitions['acid-area-repeat'] = nil +definitions["acid-area-repeat"] = nil return definitions diff --git a/effects/raptors/raptorspike-sparks-burn.lua b/effects/raptors/raptorspike-sparks-burn.lua index a1634f26c7d..c661762cfab 100644 --- a/effects/raptors/raptorspike-sparks-burn.lua +++ b/effects/raptors/raptorspike-sparks-burn.lua @@ -4,739 +4,735 @@ -- raptorspike-huge-sparks-burn return { - ["raptorspike-small-sparks-burn"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 8.5, - heatfalloff = 1.5, - maxheat = 15, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.4, - sizegrowth = 5, - speed = [[0, 0, 0]], - texture = [[flare-raptors]], - }, - }, - centerflare2 = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - heat = 8.5, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 2.2, - sizegrowth = 6.3, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.7, - texture = [[randomdots-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 20, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 5, - particlelife = 6, - particlelifespread = 4, - particlesize = 25, - particlesizespread = 25, - particlespeed = 1.2, - particlespeedspread = 5, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 14, - particlesize = 0.8, - particlesizespread = 0.5, - particlespeed = 1.5, - particlespeedspread = 0.5, - pos = [[0, 1, 0]], - sizegrowth = 3.3, - sizemod = 0.6, - texture = [[dirt]], - useairlos = false, - }, - }, - }, + ["raptorspike-small-sparks-burn"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 8.5, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.4, + sizegrowth = 5, + speed = [[0, 0, 0]], + texture = [[flare-raptors]], + }, + }, + centerflare2 = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + heat = 8.5, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 2.2, + sizegrowth = 6.3, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[randomdots-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 20, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 5, + particlelife = 6, + particlelifespread = 4, + particlesize = 25, + particlesizespread = 25, + particlespeed = 1.2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 14, + particlesize = 0.8, + particlesizespread = 0.5, + particlespeed = 1.5, + particlespeedspread = 0.5, + pos = [[0, 1, 0]], + sizegrowth = 3.3, + sizemod = 0.6, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + ["raptorspike-medium-sparks-burn"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 9, + heatfalloff = 1.5, + maxheat = 18, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.5, + sizegrowth = 6.5, + speed = [[0, 0, 0]], + texture = [[flare-raptors]], + }, + }, + centerflare2 = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + heat = 9.5, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 3, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 20, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 8, + particlelife = 9, + particlelifespread = 6, + particlesize = 44, + particlesizespread = 44, + particlespeed = 2, + particlespeedspread = 8, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 16, + particlelifespread = 20, + particlesize = 4, + particlesizespread = 1.8, + particlespeed = 1.8, + particlespeedspread = 0.66, + pos = [[0, 1, 0]], + sizegrowth = 3.5, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + }, - ["raptorspike-medium-sparks-burn"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 9, - heatfalloff = 1.5, - maxheat = 18, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.5, - sizegrowth = 6.5, - speed = [[0, 0, 0]], - texture = [[flare-raptors]], - }, - }, - centerflare2 = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - heat = 9.5, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 3, - sizegrowth = 8, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[randomdots-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 20, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 8, - particlelife = 9, - particlelifespread = 6, - particlesize = 44, - particlesizespread = 44, - particlespeed = 2, - particlespeedspread = 8, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 16, - particlelifespread = 20, - particlesize = 4, - particlesizespread = 1.8, - particlespeed = 1.8, - particlespeedspread = 0.66, - pos = [[0, 1, 0]], - sizegrowth = 3.5, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - }, - - - ["raptorspike-large-sparks-burn"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.5, - maxheat = 22, - pos = [[r-2 r2, 5, r-2 r2]], - size = 2.5, - sizegrowth = 8.5, - speed = [[0, 0, 0]], - texture = [[flare-raptors]], - }, - }, - centerflare2 = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - heat = 11, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 4, - sizegrowth = 9, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[randomdots-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 20, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 10, - particlelife = 9, - particlelifespread = 7, - particlesize = 70, - particlesizespread = 70, - particlespeed = 3.5, - particlespeedspread = 12, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 18, - particlelifespread = 24, - particlesize = 8.5, - particlesizespread = 5, - particlespeed = 3, - particlespeedspread = 1.2, - pos = [[0, 1, 0]], - sizegrowth = 3.2, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - }, - - ["raptorspike-huge-sparks-burn"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 12, - heatfalloff = 1.5, - maxheat = 26, - pos = [[r-2 r2, 5, r-2 r2]], - size = 3.5, - sizegrowth = 9, - speed = [[0, 0, 0]], - texture = [[flare-raptors]], - }, - }, - centerflare2 = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - underwater = 1, - water = true, - underwater = true, - properties = { - heat = 12, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 2.5, r-2 r2]], - size = 5.5, - sizegrowth = 10, - speed = [[0, 0, 0]], - texture = [[flare]], - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[randomdots-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 15, - particlelife = 2, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 1, - particlespeed = 4, - particlespeedspread = 6, - pos = [[0, 1, 0]], - sizegrowth = 0.7, - sizemod = 0.7, - texture = [[wake]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = true, - properties = { - airdrag = 0.9, - colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], - directional = true, - emitrot = 20, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 11, - particlelife = 11, - particlelifespread = 7, - particlesize = 110, - particlesizespread = 110, - particlespeed = 6, - particlespeedspread = 16, - pos = [[0, 2, 0]], - sizegrowth = 2.9, - sizemod = 0.6, - texture = [[gunshotglow]], - useairlos = false, - }, - }, - underwaterexplosionspikes = { - class = [[CSimpleParticleSystem]], - count = 2, - underwater = 1, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 4, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 0, - particlespeed = 3, - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = 2, - sizemod = 0.25, - texture = [[wake]], - useairlos = false, - }, - }, - hit = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = false, - underwater = false, - unit = true, - nounit = true, - properties = { - airdrag = 0.8, - colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.14, 0]], - numparticles = 1, - particlelife = 24, - particlelifespread = 24, - particlesize = 15, - particlesizespread = 7, - particlespeed = 3, - particlespeedspread = 1, - pos = [[0, 1, 0]], - sizegrowth = 3.5, - sizemod = 0.5, - texture = [[dirt]], - useairlos = false, - }, - }, - }, + ["raptorspike-large-sparks-burn"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.5, + maxheat = 22, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2.5, + sizegrowth = 8.5, + speed = [[0, 0, 0]], + texture = [[flare-raptors]], + }, + }, + centerflare2 = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + heat = 11, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 4, + sizegrowth = 9, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 20, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 10, + particlelife = 9, + particlelifespread = 7, + particlesize = 70, + particlesizespread = 70, + particlespeed = 3.5, + particlespeedspread = 12, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 18, + particlelifespread = 24, + particlesize = 8.5, + particlesizespread = 5, + particlespeed = 3, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = 3.2, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + ["raptorspike-huge-sparks-burn"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 12, + heatfalloff = 1.5, + maxheat = 26, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3.5, + sizegrowth = 9, + speed = [[0, 0, 0]], + texture = [[flare-raptors]], + }, + }, + centerflare2 = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + heat = 12, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 2.5, r-2 r2]], + size = 5.5, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = true, + properties = { + airdrag = 0.9, + colormap = [[1 0.8 0.6 0.01 1 0.55 0.2 0.01 0 0 0 0 ]], + directional = true, + emitrot = 20, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 11, + particlelife = 11, + particlelifespread = 7, + particlesize = 110, + particlesizespread = 110, + particlespeed = 6, + particlespeedspread = 16, + pos = [[0, 2, 0]], + sizegrowth = 2.9, + sizemod = 0.6, + texture = [[gunshotglow]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + hit = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = false, + underwater = false, + unit = true, + nounit = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.7 0.3 0.05 0.035 0.02 0.01 0.04 0.012 0.008 0.005 0.08 0.04 0.04 0.005 0.08 0.04 0.038 0.035 0.08 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.14, 0]], + numparticles = 1, + particlelife = 24, + particlelifespread = 24, + particlesize = 15, + particlesizespread = 7, + particlespeed = 3, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 3.5, + sizemod = 0.5, + texture = [[dirt]], + useairlos = false, + }, + }, + }, } - diff --git a/effects/raptors/raptorunitexplosion-red.lua b/effects/raptors/raptorunitexplosion-red.lua index 4ba9710d352..99c641e28d2 100644 --- a/effects/raptors/raptorunitexplosion-red.lua +++ b/effects/raptors/raptorunitexplosion-red.lua @@ -3,1519 +3,1515 @@ -- raptorunitexplosion-large-red return { - ["raptorunitexplosion-micro-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 6, - heatfalloff = 1.35, - maxheat = 18, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.1, - sizegrowth = 1, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + ["raptorunitexplosion-micro-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 6, + heatfalloff = 1.35, + maxheat = 18, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.1, + sizegrowth = 1, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - groundflash = { - air = true, - alwaysvisible = true, - flashalpha = 0.25, - flashsize = 10, - ground = true, - ttl = 15, - water = true, - underwater = true, - color = { - [1] = 1, - [2] = 0, - [3] = 0, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.1 0.05 0.02 0.15 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.1, - particlesizespread = 0.15, - particlespeed = 0.1, - particlespeedspread = 0.4, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 4, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.1, - particlesizespread = 0.15, - particlespeed = 0.1, - particlespeedspread = 0.4, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.88, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[4 r5]], - particlelife = 5, - particlelifespread = 7, - particlesize = 4, - particlesizespread = 7, - particlespeed = 2.0, - particlespeedspread = 3, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.1, - maxheat = 24, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.1, - sizegrowth = 1.9, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - }, + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.25, + flashsize = 10, + ground = true, + ttl = 15, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.1 0.05 0.02 0.15 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.1, + particlesizespread = 0.15, + particlespeed = 0.1, + particlespeedspread = 0.4, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 4, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.1, + particlesizespread = 0.15, + particlespeed = 0.1, + particlespeedspread = 0.4, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.88, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[4 r5]], + particlelife = 5, + particlelifespread = 7, + particlesize = 4, + particlesizespread = 7, + particlespeed = 2.0, + particlespeedspread = 3, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 24, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.1, + sizegrowth = 1.9, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, + ["raptorunitexplosion-tiny-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 6, + heatfalloff = 1.35, + maxheat = 18, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.3, + sizegrowth = 1, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - ["raptorunitexplosion-tiny-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 6, - heatfalloff = 1.35, - maxheat = 18, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.3, - sizegrowth = 1, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.25, + flashsize = 25, + ground = true, + ttl = 15, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.1 0.05 0.02 0.15 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 3, + particlelife = 2, + particlelifespread = 20, + particlesize = 0.2, + particlesizespread = 0.15, + particlespeed = 0.1, + particlespeedspread = 0.4, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 4, + particlelife = 2, + particlelifespread = 23, + particlesize = 0.4, + particlesizespread = 0.3, + particlespeed = 1.5, + particlespeedspread = 4.25, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + alwaysvisible = true, + colormap = [[0.96 0.11 0.13 0.18 0.16 0 0 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 3, + particlespeed = 1.2, + particlespeedspread = 2.0, + pos = [[0, 2, 0]], + sizegrowth = 1.3, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.88, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[4 r5]], + particlelife = 5, + particlelifespread = 7, + particlesize = 4, + particlesizespread = 7, + particlespeed = 2.0, + particlespeedspread = 3, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 24, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.2, + sizegrowth = 1.9, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, - groundflash = { - air = true, - alwaysvisible = true, - flashalpha = 0.25, - flashsize = 25, - ground = true, - ttl = 15, - water = true, - underwater = true, - color = { - [1] = 1, - [2] = 0, - [3] = 0, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.1 0.05 0.02 0.15 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 3, - particlelife = 2, - particlelifespread = 20, - particlesize = 0.2, - particlesizespread = 0.15, - particlespeed = 0.1, - particlespeedspread = 0.4, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 4, - particlelife = 2, - particlelifespread = 23, - particlesize = 0.4, - particlesizespread = 0.3, - particlespeed = 1.5, - particlespeedspread = 4.25, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - alwaysvisible = true, - colormap = [[0.96 0.11 0.13 0.18 0.16 0 0 0.05]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 5, - particlesize = 1, - particlesizespread = 3, - particlespeed = 1.2, - particlespeedspread = 2.0, - pos = [[0, 2, 0]], - sizegrowth = 1.3, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.88, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[4 r5]], - particlelife = 5, - particlelifespread = 7, - particlesize = 4, - particlesizespread = 7, - particlespeed = 2.0, - particlespeedspread = 3, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.1, - maxheat = 24, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.2, - sizegrowth = 1.9, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - }, + ["raptorunitexplosion-small-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 6, + heatfalloff = 1.4, + maxheat = 18, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - ["raptorunitexplosion-small-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 6, - heatfalloff = 1.4, - maxheat = 18, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.3, + flashsize = 30, + ground = true, + ttl = 14, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.1 0.08 0.04 0.14 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 5, + particlelife = 3, + particlelifespread = 26, + particlesize = 2, + particlesizespread = 1, + particlespeed = 0.5, + particlespeedspread = 1.7, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 30, + particlesize = 1.5, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5.5, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.89, + alwaysvisible = true, + colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 3, + particlelife = 4, + particlelifespread = 7, + particlesize = 3, + particlesizespread = 6, + particlespeed = 1.8, + particlespeedspread = 2.5, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.89, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[3 r4]], + particlelife = 9, + particlelifespread = 9, + particlesize = 6, + particlesizespread = 9, + particlespeed = 2.2, + particlespeedspread = 3.2, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 30, + heatfalloff = 2.6, + maxheat = 25, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.8, + sizegrowth = 1.9, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, - groundflash = { - air = true, - alwaysvisible = true, - flashalpha = 0.3, - flashsize = 30, - ground = true, - ttl = 14, - water = true, - underwater = true, - color = { - [1] = 1, - [2] = 0, - [3] = 0, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.1 0.08 0.04 0.14 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 5, - particlelife = 3, - particlelifespread = 26, - particlesize = 2, - particlesizespread = 1, - particlespeed = 0.5, - particlespeedspread = 1.7, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 5, - particlelife = 2, - particlelifespread = 30, - particlesize = 1.5, - particlesizespread = 1, - particlespeed = 2, - particlespeedspread = 5.5, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.89, - alwaysvisible = true, - colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 3, - particlelife = 4, - particlelifespread = 7, - particlesize = 3, - particlesizespread = 6, - particlespeed = 1.8, - particlespeedspread = 2.5, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.89, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[3 r4]], - particlelife = 9, - particlelifespread = 9, - particlesize = 6, - particlesizespread = 9, - particlespeed = 2.2, - particlespeedspread = 3.2, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 30, - heatfalloff = 2.6, - maxheat = 25, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.8, - sizegrowth = 1.9, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - }, + ["raptorunitexplosion-medium-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.35, + maxheat = 18, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1.1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, + -- put this next to groundflash + --explosionwave = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- alwaysvisible = true, + -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 0, 0]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = [[20]], -- same as groundflash ttl + -- particlelifespread = 0, + -- particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + -- particlesizespread = 1, + -- particlespeed = [[8]], + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 3, -- same as groundflash circlegrowth + -- sizemod = 1.0, + -- texture = [[bloodblast]], + -- }, + --}, - ["raptorunitexplosion-medium-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.35, - maxheat = 18, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1.1, - sizegrowth = 5, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.55, + flashsize = 55, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 26, + particlesize = 1.5, + particlesizespread = 1, + particlespeed = 1.25, + particlespeedspread = 4.25, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 30, + particlesize = 1.25, + particlesizespread = 1, + particlespeed = 1.5, + particlespeedspread = 4.25, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.96 0.11 0.13 0.5 0.16 0 0 0.05 0.01 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 5, + particlelifespread = 8, + particlesize = 4, + particlesizespread = 8, + particlespeed = 2.6, + particlespeedspread = 3.2, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.13, 0]], + numparticles = [[4 r5]], + particlelife = 11, + particlelifespread = 12, + particlesize = 9, + particlesizespread = 12, + particlespeed = 3.2, + particlespeedspread = 4, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.08, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 1.4, + maxheat = 24, + pos = [[r-2 r2, 5, r-2 r2]], + size = 4.25, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.90, + colormap = [[1 1 1 1 1 1 1 0.8 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 6, + particlesize = 6, + particlesizespread = 8, + particlespeed = 0.11, + particlespeedspread = 0.11, + rotParams = [[-25 r50, 10 r20, -180 r360]], + pos = [[-10 r20, 10 r30, -10 r20]], + sizegrowth = 5.1, + sizemod = 1, + texture = [[bloodblast2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + }, - -- put this next to groundflash - --explosionwave = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- alwaysvisible = true, - -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 0, 0]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = [[20]], -- same as groundflash ttl - -- particlelifespread = 0, - -- particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 - -- particlesizespread = 1, - -- particlespeed = [[8]], - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 3, -- same as groundflash circlegrowth - -- sizemod = 1.0, - -- texture = [[bloodblast]], - -- }, - --}, + ["raptorunitexplosion-large-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 9.5, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - groundflash = { - air = true, - alwaysvisible = true, - flashalpha = 0.55, - flashsize = 55, - ground = true, - ttl = 20, - water = true, - underwater = true, - color = { - [1] = 1, - [2] = 0, - [3] = 0, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 10, - particlelife = 2, - particlelifespread = 26, - particlesize = 1.5, - particlesizespread = 1, - particlespeed = 1.25, - particlespeedspread = 4.25, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 10, - particlelife = 2, - particlelifespread = 30, - particlesize = 1.25, - particlesizespread = 1, - particlespeed = 1.5, - particlespeedspread = 4.25, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.96 0.11 0.13 0.5 0.16 0 0 0.05 0.01 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 5, - particlelifespread = 8, - particlesize = 4, - particlesizespread = 8, - particlespeed = 2.6, - particlespeedspread = 3.2, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.13, 0]], - numparticles = [[4 r5]], - particlelife = 11, - particlelifespread = 12, - particlesize = 9, - particlesizespread = 12, - particlespeed = 3.2, - particlespeedspread = 4, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.08, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 15, - heatfalloff = 1.4, - maxheat = 24, - pos = [[r-2 r2, 5, r-2 r2]], - size = 4.25, - sizegrowth = 5, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.90, - colormap = [[1 1 1 1 1 1 1 0.8 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.05, 0]], - numparticles = 2, - particlelife = 10, - particlelifespread = 6, - particlesize = 6, - particlesizespread = 8, - particlespeed = 0.11, - particlespeedspread = 0.11, - rotParams = [[-25 r50, 10 r20, -180 r360]], - pos = [[-10 r20, 10 r30, -10 r20]], - sizegrowth = 5.1, - sizemod = 1, - texture = [[bloodblast2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - }, + -- put this next to groundflash + --explosionwave = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- alwaysvisible = true, + -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 0, 0]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = [[20]], -- same as groundflash ttl + -- particlelifespread = 0, + -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + -- particlesizespread = 1, + -- particlespeed = [[8]], + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 12, -- same as groundflash circlegrowth + -- sizemod = 1.0, + -- texture = [[bloodblast]], + -- }, + --}, - ["raptorunitexplosion-large-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 9.5, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.6, + flashsize = 125, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 2, + particlespeed = 2, + particlespeedspread = 8, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 2, + particlespeed = 2.5, + particlespeedspread = 8, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 7, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 10, + particlespeed = 3.3, + particlespeedspread = 4.4, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.93, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[5 r6]], + particlelife = 13, + particlelifespread = 11, + particlesize = 12, + particlesizespread = 16, + particlespeed = 3.2, + particlespeedspread = 6.5, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, - -- put this next to groundflash - --explosionwave = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- alwaysvisible = true, - -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 0, 0]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = [[20]], -- same as groundflash ttl - -- particlelifespread = 0, - -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 - -- particlesizespread = 1, - -- particlespeed = [[8]], - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 12, -- same as groundflash circlegrowth - -- sizemod = 1.0, - -- texture = [[bloodblast]], - -- }, - --}, + ["raptorunitexplosion-huge-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-50 r100, -25 r50, -180 r360]], + size = 3.2, + sizegrowth = 9.5, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - groundflash = { - air = true, - alwaysvisible = true, - flashalpha = 0.6, - flashsize = 125, - ground = true, - ttl = 20, - water = true, - underwater = true, - color = { - [1] = 1, - [2] = 0, - [3] = 0, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 30, - particlesize = 2, - particlesizespread = 2, - particlespeed = 2, - particlespeedspread = 8, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 30, - particlesize = 2, - particlesizespread = 2, - particlespeed = 2.5, - particlespeedspread = 8, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 4, - particlelife = 7, - particlelifespread = 10, - particlesize = 5, - particlesizespread = 10, - particlespeed = 3.3, - particlespeedspread = 4.4, - pos = [[0, 2, 0]], - sizegrowth = 1.5, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.93, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[5 r6]], - particlelife = 13, - particlelifespread = 11, - particlesize = 12, - particlesizespread = 16, - particlespeed = 3.2, - particlespeedspread = 6.5, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.2, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 1, - sizegrowth = 12, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.93, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[15 r10]], + particlelife = 15, + particlelifespread = 12.5, + particlesize = 12, + particlesizespread = 19, + particlespeed = 3.5, + particlespeedspread = 7, + rotParams = [[-50 r100, -25 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, - ["raptorunitexplosion-huge-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-50 r100, -25 r50, -180 r360]], - size = 3.2, - sizegrowth = 9.5, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.05, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + rotParams = [[-50 r100, 0 r50, -180 r360]], + size = 2.8, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, -splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.93, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[15 r10]], - particlelife = 15, - particlelifespread = 12.5, - particlesize = 12, - particlesizespread = 19, - particlespeed = 3.5, - particlespeedspread = 7, - rotParams = [[-50 r100, -25 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.1, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, + -- put this next to groundflash + --explosionwave = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- alwaysvisible = true, + -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 0, 0]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = [[20]], -- same as groundflash ttl + -- particlelifespread = 0, + -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + -- particlesizespread = 1, + -- particlespeed = [[8]], + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 12, -- same as groundflash circlegrowth + -- sizemod = 1.0, + -- texture = [[bloodblast]], + -- }, + --}, - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.05, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - rotParams = [[-50 r100, 0 r50, -180 r360]], - size = 2.8, - sizegrowth = 6, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], + size = 50, + sizegrowth = 5, + ttl = 17, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 3, + particlelifespread = 35, + particlesize = 2.8, + particlesizespread = 2.4, + particlespeed = 2.4, + particlespeedspread = 9, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 2, + particlespeed = 2.5, + particlespeedspread = 8, + pos = [[0, 1, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 9, + particlelife = 13, + particlelifespread = 8, + particlesize = 5, + particlesizespread = 10, + particlespeed = 3.4, + particlespeedspread = 4.5, + pos = [[0, 2, 0]], + sizegrowth = 1.7, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.9, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-50 r100, 0 r50, -180 r360]], + size = 24.3, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.92, + colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 2, + particlelife = 22, + particlelifespread = 12, + particlesize = 22, + particlesizespread = 20, + particlespeed = 0.1, + particlespeedspread = 0.1, + rotParams = [[-50 r100, -25 r50, -180 r360]], + pos = [[-10 r20, 15 r30, -10 r20]], + sizegrowth = 2.9, + sizemod = 0.99, + texture = [[bloodblast2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = [[2 r8]], + particlelife = 14, + particlelifespread = 22, + particlesize = 4.4, + particlesizespread = 7.5, + particlespeed = 3.5, + particlespeedspread = 7.5, + rotParams = [[-60 r120, -30 r60, 180]], + pos = [[0, 4, 0]], + sizegrowth = 0.27, + sizemod = 0.96, + texture = [[bloodspark2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, + ["raptorunitexplosion-mega-red"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + rotParams = [[-50 r100, 0 r50, -180 r360]], + size = 5.5, + sizegrowth = 10.5, + speed = [[0, 1 0, 0]], + texture = [[flare-raptors]], + }, + }, - -- put this next to groundflash - --explosionwave = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- alwaysvisible = true, - -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 0, 0]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = [[20]], -- same as groundflash ttl - -- particlelifespread = 0, - -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 - -- particlesizespread = 1, - -- particlespeed = [[8]], - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 12, -- same as groundflash circlegrowth - -- sizemod = 1.0, - -- texture = [[bloodblast]], - -- }, - --}, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.94, + colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], + directional = true, + emitrot = 25, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.14, 0]], + numparticles = [[20 r15]], + particlelife = 20, + particlelifespread = 15, + particlesize = 16, + particlesizespread = 25, + particlespeed = 5.5, + particlespeedspread = 8, + rotParams = [[-50 r100, 0 r50, 150 r60]], + pos = [[0, 1, 0]], + sizegrowth = -0.09, + sizemod = 1, + texture = [[blooddrop2]], + alwaysvisible = true, + drawOrder = 2, + }, + }, - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.64 0 0.01 0.55 0 0 0 0.01]], - size = 50, - sizegrowth = 5, - ttl = 17, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 3, - particlelifespread = 35, - particlesize = 2.8, - particlesizespread = 2.4, - particlespeed = 2.4, - particlespeedspread = 9, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 30, - particlesize = 2, - particlesizespread = 2, - particlespeed = 2.5, - particlespeedspread = 8, - pos = [[0, 1, 0]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.9, - alwaysvisible = true, - colormap = [[0.96 0.11 0.13 0.15 0.16 0 0 0.05]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 9, - particlelife = 13, - particlelifespread = 8, - particlesize = 5, - particlesizespread = 10, - particlespeed = 3.4, - particlespeedspread = 4.5, - pos = [[0, 2, 0]], - sizegrowth = 1.7, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 0.9, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-50 r100, 0 r50, -180 r360]], - size = 24.3, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.92, - colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 2, - particlelife = 22, - particlelifespread = 12, - particlesize = 22, - particlesizespread = 20, - particlespeed = 0.1, - particlespeedspread = 0.1, - rotParams = [[-50 r100, -25 r50, -180 r360]], - pos = [[-10 r20, 15 r30, -10 r20]], - sizegrowth = 2.9, - sizemod = 0.99, - texture = [[bloodblast2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = [[2 r8]], - particlelife = 14, - particlelifespread = 22, - particlesize = 4.4, - particlesizespread = 7.5, - particlespeed = 3.5, - particlespeedspread = 7.5, - rotParams = [[-60 r120, -30 r60, 180]], - pos = [[0, 4, 0]], - sizegrowth = 0.27, - sizemod = 0.96, - texture = [[bloodspark2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, - ["raptorunitexplosion-mega-red"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 10, - heatfalloff = 1.3, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - rotParams = [[-50 r100, 0 r50, -180 r360]], - size = 5.5, - sizegrowth = 10.5, - speed = [[0, 1 0, 0]], - texture = [[flare-raptors]], - }, - }, + centersplatsh = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 15, + heatfalloff = 1.05, + maxheat = 20, + pos = [[r-2 r2, 0, r-2 r2]], + rotParams = [[-50 r100, 0 r50, -180 r360]], + size = 4.8, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[bloodcentersplatsh]], + drawOrder = 1, + }, + }, -splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.94, - colormap = [[1 1 1 1 0.9 0.9 0.9 1 0 0 0 0.01]], - directional = true, - emitrot = 25, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.14, 0]], - numparticles = [[20 r15]], - particlelife = 20, - particlelifespread = 15, - particlesize = 16, - particlesizespread = 25, - particlespeed = 5.5, - particlespeedspread = 8, - rotParams = [[-50 r100, 0 r50, 150 r60]], - pos = [[0, 1, 0]], - sizegrowth = -0.09, - sizemod = 1, - texture = [[blooddrop2]], - alwaysvisible = true, - drawOrder = 2, - }, - }, - - centersplatsh = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 15, - heatfalloff = 1.05, - maxheat = 20, - pos = [[r-2 r2, 0, r-2 r2]], - rotParams = [[-50 r100, 0 r50, -180 r360]], - size = 4.8, - sizegrowth = 6, - speed = [[0, 1, 0]], - texture = [[bloodcentersplatsh]], - drawOrder = 1, - }, - }, - - -- put this next to groundflash - --explosionwave = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.87, - -- alwaysvisible = true, - -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 5, - -- emitvector = [[0, 0, 0]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = [[20]], -- same as groundflash ttl - -- particlelifespread = 0, - -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 - -- particlesizespread = 1, - -- particlespeed = [[8]], - -- particlespeedspread = 6, - -- pos = [[0, 1, 0]], - -- sizegrowth = 12, -- same as groundflash circlegrowth - -- sizemod = 1.0, - -- texture = [[bloodblast]], - -- }, - --}, - - groundflash_blood = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.64 0 0.01 0.55 0.1 0.1 0.1 0.01]], - size = 90, - sizegrowth = 5.2, - ttl = 24, - texture = [[groundflash]], - --alwaysvisible = true, - }, - }, - kickedupdirt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 3, - particlelifespread = 35, - particlesize = 3.8, - particlesizespread = 3.4, - particlespeed = 2.8, - particlespeedspread = 11, - pos = [[0, 1, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke-raptors]], - }, - }, - kickedupwater = { - class = [[CSimpleParticleSystem]], - count = 1, - water = true, - underwater = true, - properties = { - airdrag = 0.87, - alwaysvisible = true, - colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 30, - particlesize = 8, - particlesizespread = 8, - particlespeed = 4.5, - particlespeedspread = 8, - pos = [[0, 1, 0]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[wake]], - }, - }, - orangeexplosionspikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - alwaysvisible = true, - colormap = [[0.50 0.09 0.07 0.45 0.16 0 0 0.15 0.01 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 32, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 9, - particlelife = 14, - particlelifespread = 9, - particlesize = 7, - particlesizespread = 12, - particlespeed = 6.4, - particlespeedspread = 6.5, - pos = [[0, 10, 0]], - sizegrowth = 1.7, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - alwaysvisible = true, - heat = 15, - heatfalloff = 0.9, - maxheat = 20, - pos = [[-2 r4, 10, -2 r4]], - rotParams = [[-50 r100, 25 r50, -180 r360]], - size = 28.3, - sizegrowth = 4, - speed = [[0, 1 0, 0]], - texture = [[bloodblast]], - }, - }, - bloodblast = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.90, - colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.05, 0]], - numparticles = 3, - particlelife = 20, - particlelifespread = 14, - particlesize = 20, - particlesizespread = 24, - particlespeed = 0.11, - particlespeedspread = 0.11, - rotParams = [[-25 r50, 10 r20, -180 r360]], - pos = [[-12 r24, 15 r30, -12 r24]], - sizegrowth = 5.8, - sizemod = 0.99, - texture = [[bloodblast2]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - blood_sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = [[2 r8]], - particlelife = 17, - particlelifespread = 26, - particlesize = 18.0, - particlesizespread = 24.5, - particlespeed = 6.5, - particlespeedspread = 4.5, - rotParams = [[-60 r120, 25 r60, 180]], - pos = [[-10 r20, 4, -10 r20]], - sizegrowth = 0.29, - sizemod = 0.96, - texture = [[bloodspark2]], - useairlos = false, - drawOrder = 2, - }, - }, - }, + -- put this next to groundflash + --explosionwave = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.87, + -- alwaysvisible = true, + -- colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 5, + -- emitvector = [[0, 0, 0]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = [[20]], -- same as groundflash ttl + -- particlelifespread = 0, + -- particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + -- particlesizespread = 1, + -- particlespeed = [[8]], + -- particlespeedspread = 6, + -- pos = [[0, 1, 0]], + -- sizegrowth = 12, -- same as groundflash circlegrowth + -- sizemod = 1.0, + -- texture = [[bloodblast]], + -- }, + --}, + groundflash_blood = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.64 0 0.01 0.55 0.1 0.1 0.1 0.01]], + size = 90, + sizegrowth = 5.2, + ttl = 24, + texture = [[groundflash]], + --alwaysvisible = true, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 3, + particlelifespread = 35, + particlesize = 3.8, + particlesizespread = 3.4, + particlespeed = 2.8, + particlespeedspread = 11, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-raptors]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 8, + particlesizespread = 8, + particlespeed = 4.5, + particlespeedspread = 8, + pos = [[0, 1, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + alwaysvisible = true, + colormap = [[0.50 0.09 0.07 0.45 0.16 0 0 0.15 0.01 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 9, + particlelife = 14, + particlelifespread = 9, + particlesize = 7, + particlesizespread = 12, + particlespeed = 6.4, + particlespeedspread = 6.5, + pos = [[0, 10, 0]], + sizegrowth = 1.7, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 0.9, + maxheat = 20, + pos = [[-2 r4, 10, -2 r4]], + rotParams = [[-50 r100, 25 r50, -180 r360]], + size = 28.3, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + bloodblast = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.90, + colormap = [[1 1 1 1 1 1 1 0.8 1 1 1 0.9 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 3, + particlelife = 20, + particlelifespread = 14, + particlesize = 20, + particlesizespread = 24, + particlespeed = 0.11, + particlespeedspread = 0.11, + rotParams = [[-25 r50, 10 r20, -180 r360]], + pos = [[-12 r24, 15 r30, -12 r24]], + sizegrowth = 5.8, + sizemod = 0.99, + texture = [[bloodblast2]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + blood_sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[1 1 1 0.8 0.9 0.9 0.9 1 1 1 1 1 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = [[2 r8]], + particlelife = 17, + particlelifespread = 26, + particlesize = 18.0, + particlesizespread = 24.5, + particlespeed = 6.5, + particlespeedspread = 4.5, + rotParams = [[-60 r120, 25 r60, 180]], + pos = [[-10 r20, 4, -10 r20]], + sizegrowth = 0.29, + sizemod = 0.96, + texture = [[bloodspark2]], + useairlos = false, + drawOrder = 2, + }, + }, + }, } - diff --git a/effects/reclaimshards.lua b/effects/reclaimshards.lua index 886098346b2..f0b5090a061 100644 --- a/effects/reclaimshards.lua +++ b/effects/reclaimshards.lua @@ -1,152 +1,151 @@ - local definitions = { - ["reclaimshards1"] = { - groundflash = { - flashalpha = 0.015, - flashsize = 40, - ttl = 9, - color = { - [1] = 1, - [2] = 1, - [3] = 1, - }, - }, - shards = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - water = true, - ground = true, - count = 1, - properties = { - airdrag = 0.9, - directional = true, - emitRot = 30, - emitRotSpread = 30, - emitVector = [[0, 0.8, 0]], - gravity = [[0, 0.03, 0]], - colorMap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], - numParticles = [[0.2 r1.2]], - particleLife = 16, - particleLifeSpread = 12, - particleSpeed = 2.5, - particleSpeedSpread = 1.7, - particleSize = 2.6, - particleSizeSpread = 1.8, - pos = [[0, -0.5, 0]], - sizeGrowth = -0.16, - sizeMod = 1, - texture = [[shard1]], - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0]], - directional = true, - emitrot = 12, - emitrotspread = 33, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0.35 r1]], - particlelife = 15, - particlelifespread = 8, - particlesize = 1.2, - particlesizespread = -1, - particlespeed = 1.6, - particlespeedspread = 2.2, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0]], - directional = true, - emitrot = 0, - emitrotspread = 12, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[0.1 r1]], - particlelife = 25, - particlelifespread = 10, - particlesize = 1.2, - particlesizespread = -1, - particlespeed = 1.5, - particlespeedspread = 2.6, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0]], - directional = true, - emitrot = 45, - emitrotspread = 3, - emitvector = [[0.25, 0.8, 0.25]], - gravity = [[0, 0.02, 0]], - numparticles = [[0.2 r1]], - particlelife = 40, - particlelifespread = 75, - particlesize = 13, - particlesizespread = 16, - particlespeed = 4, - particlespeedspread = 4, - pos = [[0, 6, 0]], - sizegrowth = 0.5, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - grounddust = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.09 0.09 0.09 0.14 0 0 0 0.0]], - directional = true, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = 3, - particlelife = 5, - particlelifespread = 22, - particlesize = 3.5, - particlesizespread = 1.5, - particlespeed = 0.8, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - }, + ["reclaimshards1"] = { + groundflash = { + flashalpha = 0.015, + flashsize = 40, + ttl = 9, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + shards = { + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + water = true, + ground = true, + count = 1, + properties = { + airdrag = 0.9, + directional = true, + emitRot = 30, + emitRotSpread = 30, + emitVector = [[0, 0.8, 0]], + gravity = [[0, 0.03, 0]], + colorMap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], + numParticles = [[0.2 r1.2]], + particleLife = 16, + particleLifeSpread = 12, + particleSpeed = 2.5, + particleSpeedSpread = 1.7, + particleSize = 2.6, + particleSizeSpread = 1.8, + pos = [[0, -0.5, 0]], + sizeGrowth = -0.16, + sizeMod = 1, + texture = [[shard1]], + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0]], + directional = true, + emitrot = 12, + emitrotspread = 33, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0.35 r1]], + particlelife = 15, + particlelifespread = 8, + particlesize = 1.2, + particlesizespread = -1, + particlespeed = 1.6, + particlespeedspread = 2.2, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0]], + directional = true, + emitrot = 0, + emitrotspread = 12, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[0.1 r1]], + particlelife = 25, + particlelifespread = 10, + particlesize = 1.2, + particlesizespread = -1, + particlespeed = 1.5, + particlespeedspread = 2.6, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0.022 0.022 0.022 0.03 0.05 0.05 0.05 0.068 0.042 0.042 0.042 0.052 0.023 0.023 0.023 0.028 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 3, + emitvector = [[0.25, 0.8, 0.25]], + gravity = [[0, 0.02, 0]], + numparticles = [[0.2 r1]], + particlelife = 40, + particlelifespread = 75, + particlesize = 13, + particlesizespread = 16, + particlespeed = 4, + particlespeedspread = 4, + pos = [[0, 6, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + grounddust = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.09 0.09 0.09 0.14 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 3, + particlelife = 5, + particlelifespread = 22, + particlesize = 3.5, + particlesizespread = 1.5, + particlespeed = 0.8, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + }, } definitions["reclaimshards2"] = table.copy(definitions["reclaimshards1"]) diff --git a/effects/rocketflare.lua b/effects/rocketflare.lua index 9c72c6d8516..564b0280304 100644 --- a/effects/rocketflare.lua +++ b/effects/rocketflare.lua @@ -3,76 +3,76 @@ local definitions = { ["RocketFlare"] = { fire = { class = [[CBitmapMuzzleFlame]], - water=1, - air=1, - underwater=1, - ground=1, - count=1, + water = 1, + air = 1, + underwater = 1, + ground = 1, + count = 1, properties = { dir = [[dir]], - colorMap=[[1 0.6 0.25 0.015 0.75 0.3 0.1 0.006]], - size=-2.6, - length=-11, - sizeGrowth=0.75, - ttl=5, - frontOffset=0, - sideTexture=[[shot]], - frontTexture=[[flash1]], - } + colorMap = [[1 0.6 0.25 0.015 0.75 0.3 0.1 0.006]], + size = -2.6, + length = -11, + sizeGrowth = 0.75, + ttl = 5, + frontOffset = 0, + sideTexture = [[shot]], + frontTexture = [[flash1]], + }, }, fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, properties = { - airdrag = 0, - colormap = [[0.08 0.055 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 5, + airdrag = 0, + colormap = [[0.08 0.055 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 5, particlelifespread = 0, - particlesize = 35, + particlesize = 35, particlesizespread = 6, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.25, - sizemod = 1, - texture = [[glow]], - useairlos = true, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.25, + sizemod = 1, + texture = [[glow]], + useairlos = true, }, }, smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, properties = { - airdrag = 0.84, - colormap = [[ 0.12 0.11 0.1 0.45 0.12 0.11 0.10 0.4 0.07 0.07 0.07 0.22 0 0 0 0]], - directional = false, - emitrot = 0, - emitrotspread = 20, - emitvector = [[dir]], - gravity = [[0,0,0]], - numparticles = 17, - particlelife = 55, + airdrag = 0.84, + colormap = [[ 0.12 0.11 0.1 0.45 0.12 0.11 0.10 0.4 0.07 0.07 0.07 0.22 0 0 0 0]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0,0,0]], + numparticles = 17, + particlelife = 55, particlelifespread = 0, - particlesize = 1.7, + particlesize = 1.7, particlesizespread = 1.2, - particlespeed = -0.25, + particlespeed = -0.25, particlespeedspread = -2.5, - pos = [[0, 1, 3]], - sizegrowth = 0.04, - sizemod = 1.0, - texture = [[smoke]], + pos = [[0, 1, 3]], + sizegrowth = 0.04, + sizemod = 1.0, + texture = [[smoke]], }, }, }, @@ -80,80 +80,79 @@ local definitions = { ["RocketFlare-large"] = { fire = { class = [[CBitmapMuzzleFlame]], - water=1, - air=1, - underwater=1, - ground=1, - count=1, + water = 1, + air = 1, + underwater = 1, + ground = 1, + count = 1, properties = { dir = [[dir]], - colorMap=[[1 0.6 0.25 0.015 0.75 0.3 0.1 0.006]], - size=-3.7, - length=-15, - sizeGrowth=0.75, - ttl=5, - frontOffset=0, - sideTexture=[[shot]], - frontTexture=[[flash1]], - } + colorMap = [[1 0.6 0.25 0.015 0.75 0.3 0.1 0.006]], + size = -3.7, + length = -15, + sizeGrowth = 0.75, + ttl = 5, + frontOffset = 0, + sideTexture = [[shot]], + frontTexture = [[flash1]], + }, }, fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, properties = { - airdrag = 0, - colormap = [[0.08 0.055 0.015 0.005 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 6, + airdrag = 0, + colormap = [[0.08 0.055 0.015 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 6, particlelifespread = 0, - particlesize = 50, + particlesize = 50, particlesizespread = 9, - particlespeed = 0, + particlespeed = 0, particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.25, - sizemod = 1, - texture = [[glow]], - useairlos = true, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.25, + sizemod = 1, + texture = [[glow]], + useairlos = true, }, }, smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, properties = { - airdrag = 0.84, - colormap = [[ 0.12 0.11 0.1 0.45 0.12 0.11 0.10 0.4 0.07 0.07 0.07 0.22 0 0 0 0]], - directional = false, - emitrot = 0, - emitrotspread = 20, - emitvector = [[dir]], - gravity = [[0,0,0]], - numparticles = 25, - particlelife = 55, + airdrag = 0.84, + colormap = [[ 0.12 0.11 0.1 0.45 0.12 0.11 0.10 0.4 0.07 0.07 0.07 0.22 0 0 0 0]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0,0,0]], + numparticles = 25, + particlelife = 55, particlelifespread = 0, - particlesize = 2.8, + particlesize = 2.8, particlesizespread = 2.8, - particlespeed = -0.4, + particlespeed = -0.4, particlespeedspread = -3.5, - pos = [[0, 1, 3]], - sizegrowth = 0.04, - sizemod = 1.0, - texture = [[smoke]], + pos = [[0, 1, 3]], + sizegrowth = 0.04, + sizemod = 1.0, + texture = [[smoke]], }, }, }, - } return definitions diff --git a/effects/scavengers/scaspawn-greentrail.lua b/effects/scavengers/scaspawn-greentrail.lua index aace259234f..3888345de24 100644 --- a/effects/scavengers/scaspawn-greentrail.lua +++ b/effects/scavengers/scaspawn-greentrail.lua @@ -1,207 +1,206 @@ -- Spawntrail for Scavenger Droppods return { - ["scaspawn-greentrail"] = { - usedefaultexplosions = false, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - alwaysVisible = true, - colormap = [[0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-15 r3.5]], - sidetexture = [[muzzleside]], - size = 15.5, - sizegrowth = [[0.2 r0.3]], - ttl = 1, - }, - }, - fireglow = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.00 1.00 0.00 0.01 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 40, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.00 0.80 0.00 0.1 0.00 0.50 0.00 0.05 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 15, - particlesize = 15, - particlesizespread = 12, - particlespeed = 0.25, - particlespeedspread = 1.3, - pos = [[0, 1, 0]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.00 1.00 0.00 0.15 0.00 1.00 0.00 0.1 0.00 1.00 0.00 0.15 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.75, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 4, - particlesizespread = 6, - particlespeed = 0.4, - particlespeedspread = 3, - pos = [[0, 1, 0]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - trail = { - - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - alwaysVisible = true, - colormap = [[0 0 0 0.01 0.00 0.70 0.00 0.10 0.00 0.60 0.00 0.08 0.00 0.50 0.00 0.05 0.00 0.40 0.00 0.04 0.00 0.15 0.00 0.02 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[trans]], - length = -20, - sidetexture = [[smoketrail]], - size = 2.0, - sizegrowth = 0.05, - ttl = 40, - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.00 1.00 0.00 0.05 0.00 0.90 0.00 0.66 0.00 0.75 0.00 0.56 0.00 0.60 0.00 0.44 0.00 0.45 0.00 0.28 0.00 0.30 0.00 0.13 0.00 0.15 0.00 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, -0.06, 0.0]], - numparticles = [[1.5 r1]], - particlelife = 15, - particlelifespread = 40, - particlesize = 4.6, - particlesizespread = 6.2, - particlespeed = 1.5, - particlespeedspread = 2.5, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.32, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.77, - colormap = [[0.00 1.00 0.00 0.8 0.00 1.00 0.00 0.9 0.00 1.00 0.00 0.5 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 15, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 9, - particlelifespread = 6, - particlesize = 4, - particlesizespread = 0.8, - particlespeed = 0.05, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 0.03, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - spikes = { - air = true, - class = [[CExploSpikeProjectile]], - count = 2, - ground = true, - water = true, - properties = { - alpha = 0.6, - alphadecay = 0.08, - color = [[0.00, 1.00, 0.00]], - dir = [[-10 r20,-10 r20,-10 r20]], - length = 2, - width = 9, - }, - }, - }, + ["scaspawn-greentrail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 15.5, + sizegrowth = [[0.2 r0.3]], + ttl = 1, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.00 1.00 0.00 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.00 0.80 0.00 0.1 0.00 0.50 0.00 0.05 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 15, + particlesize = 15, + particlesizespread = 12, + particlespeed = 0.25, + particlespeedspread = 1.3, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.00 1.00 0.00 0.15 0.00 1.00 0.00 0.1 0.00 1.00 0.00 0.15 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.75, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 4, + particlesizespread = 6, + particlespeed = 0.4, + particlespeedspread = 3, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + trail = { + + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0 0 0 0.01 0.00 0.70 0.00 0.10 0.00 0.60 0.00 0.08 0.00 0.50 0.00 0.05 0.00 0.40 0.00 0.04 0.00 0.15 0.00 0.02 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -20, + sidetexture = [[smoketrail]], + size = 2.0, + sizegrowth = 0.05, + ttl = 40, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.00 1.00 0.00 0.05 0.00 0.90 0.00 0.66 0.00 0.75 0.00 0.56 0.00 0.60 0.00 0.44 0.00 0.45 0.00 0.28 0.00 0.30 0.00 0.13 0.00 0.15 0.00 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, -0.06, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.00 1.00 0.00 0.8 0.00 1.00 0.00 0.9 0.00 1.00 0.00 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + spikes = { + air = true, + class = [[CExploSpikeProjectile]], + count = 2, + ground = true, + water = true, + properties = { + alpha = 0.6, + alphadecay = 0.08, + color = [[0.00, 1.00, 0.00]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 2, + width = 9, + }, + }, + }, } diff --git a/effects/scavengers/scav-effects.lua b/effects/scavengers/scav-effects.lua index 963c59583aa..15488d6dad0 100644 --- a/effects/scavengers/scav-effects.lua +++ b/effects/scavengers/scav-effects.lua @@ -1,1593 +1,1592 @@ -- Effects for Scavengers return { - ["scavradiation"] = { - usedefaultexplosions = false, - topclouds = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 0.30 0.015 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.045 r0.11, -0.004 r0.008]], - numparticles = [[0.7 r0.81]], - particlelife = 140, - particlelifespread = 200, - particlesize = 300, - particlesizespread = 400, - particlespeed = 4.5, - particlespeedspread = 3.5, - pos = [[-150 r300, 120 r300, -150 r300]], - rotParams = [[-3.5 r7, -1.5 r3, -180 r360]], - sizegrowth = [[0.4 r0.12]], - sizemod = 1, - texture = [[cloudpuff]], - useairlos = true, - alwaysvisible = true, - }, - }, - grounddust1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.017 r0.018, -0.004 r0.008]], - numparticles = [[0.79 r0.85]], - particlelife = 150, - particlelifespread = 200, - particlesize = 440, - particlesizespread = 780, - particlespeed = 6.5, - particlespeedspread = 4.5, - pos = [[-200 r400, 60 r190, -200 r400]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,370 r380]], - alwaysvisible = true, - castShadow = true, - }, - }, - }, - ["scavradiation-old"] = { - usedefaultexplosions = false, - grounddust1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.0 0.30 0.016 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], - numparticles = [[1.5 r1]], - particlelife = 180, - particlelifespread = 120, - particlesize = 300, - particlesizespread = 450, - particlespeed = 6.5, - particlespeedspread = 4.5, - pos = [[-200 r900, -50 r50, -200 r900]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke_puff]], - alwaysvisible = true, - }, - }, - grounddust2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.0 0.30 0.016 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], - numparticles = [[1.5 r1]], - particlelife = 180, - particlelifespread = 120, - particlesize = 300, - particlesizespread = 450, - particlespeed = 6.5, - particlespeedspread = 4.5, - pos = [[-200 r900, -50 r50, -200 r900]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke_puff2]], - alwaysvisible = true, - }, - }, - }, - ["scavmist"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.10 0.005 0.28 0.04 0.14 0.007 0.37 0.05 0.14 0.007 0.37 0.08 0.30 0.016 0.6 0.24 0.14 0.007 0.37 0.09 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], - numparticles = [[0.9 r1.1]], - particlelife = 120, - particlelifespread = 120, - particlesize = 50, - particlesizespread = 100, - particlespeed = 2.5, - particlespeedspread = 3.5, - pos = [[-50 r100, 0 r50, -50 r100]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[smoke_puff]], - alwaysvisible = true, - }, - }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.05 0.3 0.05 0.6 0.045 0.45 0.1 0.8 0.01 0.45 0.1 0.8 0.009 0.3 0.05 0.6 0.007 0.3 0.05 0.6 0.005 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 120, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.1, 0]], - numparticles = [[0.5 r1]], - particlelife = 20, - particlelifespread = 30, - particlesize = 8, - particlesizespread = 24, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-6 r12, 25, -6 r12]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - }, - }, - }, - ["scavmistxl"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - --unit = false, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.01 0.11 0.005 0.28 0.07 0.15 0.007 0.37 0.13 0.26 0.014 0.55 0.19 0.34 0.018 0.64 0.27 0.15 0.007 0.37 0.12 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.005 r0.04, -0.004 r0.008]], - numparticles = [[0.74 r0.86]], - particlelife = 170, - particlelifespread = 190, - particlesize = 190, - particlesizespread = 520, - particlespeed = 2.7, - particlespeedspread = 3.7, - pos = [[-50 r100, -75 r90, -50 r100]], - rotParams = [[-5.0 r10, -1.5 r3, -180 r360]], - sizegrowth = 0.28, - sizemod = 1, - texture = [[dirtpuff]], - --animParams = [[8,8,290 r480]], - drawOrder = 1, - alwaysvisible = true, - castShadow = true, - }, - }, - -- lightningballs = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.92, - -- colormap = [[0 0 0 0.05 0.3 0.05 0.6 0.045 0.45 0.1 0.8 0.01 0.45 0.1 0.8 0.009 0.3 0.05 0.6 0.007 0.3 0.05 0.6 0.005 0 0 0 0.01]], - -- directional = false, - -- emitrot = 80, - -- emitrotspread = 120, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.1, 0]], - -- numparticles = [[0.5 r1]], - -- particlelife = 24, - -- particlelifespread = 36, - -- particlesize = 12, - -- particlesizespread = 24, - -- particlespeed = 0.12, - -- particlespeedspread = 0.32, - -- pos = [[-6 r12, 25, -6 r12]], - -- sizegrowth = -0.4, - -- sizemod = 1.0, - -- texture = [[flare1]], - -- alwaysvisible = true, - -- }, - -- }, - }, - ["scav_mist_explosion"] = { - electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[5 r20]], - explosiongenerator = [[custom:lightning_storm_scav]], - pos = [[-50 r100, 20, -50 r100]], - }, - }, - electricstormxl = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - delay = [[0 r10]], - explosiongenerator = [[custom:lightning_stormflares_scav]], - pos = [[-25 r50, 50 r25, -25 r50]], - }, - }, - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.5, - maxheat = 12, - pos = [[r-2 r2, 10, r-2 r2]], - size = 14.0, - sizegrowth = 16, - speed = [[0, 1 0, 0]], - texture = [[flare]], - alwaysvisible = true, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.6 0.15 1 0.4 0 0 0 0.01]], - size = 200, - sizegrowth = -1.5, - ttl = 29, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.6 0.15 1 0.175 0 0 0 0.01]], - size = 250, - sizegrowth = -1.5, - ttl = 35, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], - size = 190, - sizegrowth = 0, - ttl = 9, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - -- pop1 = { - -- class = [[CHeatCloudProjectile]], - -- air=1, - -- water=1, - -- ground=1, - -- count=1, - -- properties ={ - -- texture=[[explo]], - -- heat = 8, - -- maxheat = 8, - -- heatFalloff = 1.1, - -- size = 7, - -- sizeGrowth = 18, - -- pos = [[r-10 r10, 20, r-10 r10]], - -- speed = [[0, 0, 0]], - -- alwaysvisible = true, - -- }, - -- }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.11 0.5 0.12 0.9 0.08 0.45 0.07 0.70 0.033 0.27 0.03 0.55 0.012 0.18 0.0015 0.35 0.007 0 0 0 0.1]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.04, 0]], - numparticles = 12, - particlelife = 12, - particlelifespread = 18, - particlesize = 15, - particlesizespread = 35, - particlespeed = 5.8, - particlespeedspread = 4.3, - pos = [[0, 2, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - }, - }, - -- dustparticles = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- airdrag = 0.88, - -- colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0.5, 1, 0.5]], - -- gravity = [[0, -0.011, 0]], - -- numparticles = 5, - -- particlelife = 11.6, - -- particlelifespread = 4.5, - -- particlesize = 6.5, - -- particlesizespread = 1.6, - -- particlespeed = 4.75, - -- particlespeedspread = 0.8, - -- pos = [[0, 0, 0]], - -- sizegrowth = 2.2, - -- sizemod = 1.0, - -- texture = [[randomdots]], - -- }, - -- }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.80, - alwaysVisible = 0, - sizeGrowth = 0.66, - sizeMod = 1, - pos = [[r-1 r3, 0, r-1 r3]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=35, - particleLifeSpread=80, - numparticles=7, - particleSpeed=7, - particleSpeedSpread=9, - particleSize=14, - particleSizeSpread=23, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1, - pos = [[r-1 r4, 0, r-1 r4]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=25, - particleLifeSpread=60, - numparticles=4, - particleSpeed=6, - particleSpeedSpread=8, - particleSize=31, - particleSizeSpread=23, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.6 0.15 1 0.017 0.4 0.05 0.8 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 7, - particlelife = 16, - particlelifespread = 18, - particlesize = 48, - particlesizespread = 38, - particlespeed = 18.5, - particlespeedspread = 11.4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.78, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 9, - particlelife = 32, - particlelifespread = 7, - particlesize = 2.25, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 3, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - unit = false, - nounit = true, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 1, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 5, - particlelife = 35, - particlelifespread = 8, - particlesize = 2.3, - particlesizespread = -1.4, - particlespeed = 3.6, - particlespeedspread = 3.4, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2.0, - particlesizespread = 2.3, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 75, - particlelifespread = 120, - particlesize = 66, - particlesizespread = 44, - particlespeed = 1.2, - particlespeedspread = 2.5, - pos = [[0, 4, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.1, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 17, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - }, - }, - }, - ["scav_commander_explosion"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.5, - maxheat = 12, - pos = [[r-2 r2, 10, r-2 r2]], - size = 4.0, - sizegrowth = 16, - speed = [[0, 1 0, 0]], - texture = [[flare]], - alwaysvisible = true, - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.6 0.15 1 0.4 0 0 0 0.01]], - size = 200, - sizegrowth = -1.5, - ttl = 29, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.6 0.15 1 0.175 0 0 0 0.01]], - size = 250, - sizegrowth = -1.5, - ttl = 35, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], - size = 190, - sizegrowth = 0, - ttl = 9, - texture = [[groundflash]], - alwaysvisible = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air=1, - water=1, - ground=1, - count=1, - properties ={ - texture=[[explo]], - heat = 8, - maxheat = 8, - heatFalloff = 1.1, - size = 9, - sizeGrowth = 25, - pos = [[r-10 r10, 20, r-10 r10]], - speed = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - explosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.11 0.5 0.12 0.9 0.08 0.35 0.05 0.66 0.033 0.27 0.03 0.55 0.012 0.18 0.0015 0.35 0.007 0 0 0 0.1]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0, 1.1, 0]], - gravity = [[0, -0.01, 0]], - numparticles = 15, - particlelife = 12, - particlelifespread = 18, - particlesize = 23, - particlesizespread = 20, - particlespeed = 6.8, - particlespeedspread = 5.3, - pos = [[0, 2, 0]], - sizegrowth = 0.4, - sizemod = 1, - texture = [[flashside3]], - useairlos = false, - alwaysvisible = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.88, - colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 32, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, -0.011, 0]], - numparticles = 5, - particlelife = 11.6, - particlelifespread = 4.5, - particlesize = 6.5, - particlesizespread = 1.6, - particlespeed = 4.75, - particlespeedspread = 0.8, - pos = [[0, 0, 0]], - sizegrowth = 2.2, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - innersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.80, - alwaysVisible = 0, - sizeGrowth = 0.66, - sizeMod = 1, - pos = [[r-1 r3, 0, r-1 r3]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, 0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=35, - particleLifeSpread=80, - numparticles=7, - particleSpeed=7, - particleSpeedSpread=9, - particleSize=14, - particleSizeSpread=23, - directional=0, - }, - }, - outersmoke = { - class = [[CSimpleParticleSystem]], - water=0, - air=1, - ground=1, - count=1, - properties = { - airdrag=0.7, - alwaysVisible = 0, - sizeGrowth = 0.35, - sizeMod = 1, - pos = [[r-1 r4, 0, r-1 r4]], - emitRot=33, - emitRotSpread=50, - emitVector = [[0, 1, 0]], - gravity = [[0, -0.02, 0]], - colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], - Texture=[[graysmoke]], - particleLife=25, - particleLifeSpread=60, - numparticles=4, - particleSpeed=6, - particleSpeedSpread=8, - particleSize=31, - particleSizeSpread=23, - directional=0, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.6 0.15 1 0.017 0.4 0.05 0.8 0.011 0 0 0 0]], - directional = true, - emitrot = 30, - emitrotspread = 40, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.05, 0]], - numparticles = 7, - particlelife = 16, - particlelifespread = 18, - particlesize = 48, - particlesizespread = 38, - particlespeed = 22.5, - particlespeedspread = 11.4, - pos = [[0, 4, 0]], - sizegrowth = 1, - sizemod = 0.78, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - }, - }, - shockwave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = false, - water = false, - properties = { - colormap = [[0 0 0 0 0.6 0.15 1 0.40 0.5 0.13 0.8 0.80 0.12 0.08 0.18 0.012 0.08 0.04 0.12 0.005 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 4.3, - sizegrowth = [[-31 r8]], - ttl = 16, - pos = [[0, 20, 0]], - }, - }, - -- shockwave = { - -- class = [[CSpherePartSpawner]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- air = true, - -- properties = { - -- alpha = 0.6, - -- ttl = 11, - -- expansionSpeed = 13, - -- color = [[0.6, 0.15, 1]], - -- alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 15, - emitrotspread = 36, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 9, - particlelife = 32, - particlelifespread = 7, - particlesize = 2.25, - particlesizespread = -1.4, - particlespeed = 3.3, - particlespeedspread = 3, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - unit = false, - nounit = true, - water = false, - air = false, - underwater = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], - directional = true, - emitrot = 1, - emitrotspread = 13, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.33, 0]], - numparticles = 5, - particlelife = 35, - particlelifespread = 8, - particlesize = 2.3, - particlesizespread = -1.4, - particlespeed = 3.6, - particlespeedspread = 3.4, - pos = [[0, 6, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - alwaysvisible = true, - }, - }, - shard1 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2.0, - particlesizespread = 2.3, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard1]], - useairlos = false, - }, - }, - shard2 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r2]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard2]], - useairlos = false, - }, - }, - shard3 = { - class = [[CSimpleParticleSystem]], - count = 1, - unit = true, - nounit = false, - underwater = false, - properties = { - airdrag = 0.93, - colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], - directional = true, - emitrot = 35, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = [[1 r1.5]], - particlelife = 36, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 2.35, - particlespeed = 2.5, - particlespeedspread = 4, - pos = [[0, 2, 0]], - sizegrowth = 0, - sizemod = 1, - texture = [[shard3]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 4, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.025, 0]], - numparticles = 2, - particlelife = 75, - particlelifespread = 120, - particlesize = 66, - particlesizespread = 44, - particlespeed = 1.2, - particlespeedspread = 2.5, - pos = [[0, 4, 0]], - sizegrowth = 0.18, - sizemod = 1.0, - texture = [[bigexplosmoke]], - alwaysvisible = true, - }, - }, - outerflash = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 14, - heatfalloff = 1.1, - maxheat = 40, - pos = [[r-2 r2, 4, r-2 r2]], - size = 17, - sizegrowth = 1.1, - speed = [[0, 1 0, 0]], - texture = [[orangenovaexplo]], - alwaysvisible = true, - }, - }, - }, - ["scavradiation-beacon"] = { - usedefaultexplosions = false, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0.01 0.40 0.020 0.8 0.18 0.14 0.007 0.37 0.09 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 60, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.035, 0]], - numparticles = 3, - particlelife = 140, - particlelifespread = 100, - particlesize = 50, - particlesizespread = 125, - particlespeed = 4.5, - particlespeedspread = 3.5, - pos = [[0 r150, 100 r50, 0 r150]], - sizegrowth = 0.3, - sizemod = 1, - texture = [[fogdirty]], - useairlos = true, - --alwaysvisible = true, - }, - }, - }, - ["scavradiation-lightning"] = { - usedefaultexplosions = false, - electricstorm = { - air = true, - class = [[CExpGenSpawner]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[10 r200]], - explosiongenerator = [[custom:lightning_storm_scav]], - pos = [[-50 r100, 20, -50 r100]], - }, - }, - lightningstrikesinstant = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.85 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = [[0.38 r0.75]], - particlelife = 3, - particlelifespread = 5, - particlesize = 160, - particlesizespread = 580, - particlespeed = 0.06, - particlespeedspread = 0, - pos = [[-10 r10, -50 r50, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[lightninginair]], - alwaysvisible = true, - }, - }, - -- electricstormxl = { - -- air = true, - -- class = [[CExpGenSpawner]], - -- count = 1, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- delay = [[50 r120]], - -- explosiongenerator = [[custom:lightning_stormflares_scav]], - -- pos = [[-50 r250, 0 r25, -50 r250]], - -- }, - -- }, - }, - ["lightning_storm_scav"] = { - -- groundflash = { - -- circlealpha = 1, - -- circlegrowth = 0, - -- flashalpha = 0.17, - -- flashsize = 40, - -- ttl = 3, - -- color = { - -- [1] = 0.66, - -- [2] = 0.66, - -- [3] = 1, - -- }, - -- alwaysvisible = true, - -- }, - lightningstrikes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = [[0.5 r0.75]], - particlelife = 2, - particlelifespread = 6, - particlesize = 80, - particlesizespread = 380, - particlespeed = 0.06, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[whitelightb]], - alwaysvisible = true, - }, - }, - }, - ["lightning_storm_scavmist"] = { - groundflash = { - circlealpha = 1, - circlegrowth = 0, - flashalpha = 0.16, - flashsize = 100, - ttl = 6, - color = { - [1] = 0.66, - [2] = 0.28, - [3] = 1, - }, - alwaysvisible = true, - }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 5, - particlesize = 30, - particlesizespread = 64, - particlespeed = 0.06, - particlespeedspread = 0, - pos = [[-20 r40, 25.0, -20 r40]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[whitelightb]], - alwaysvisible = true, - }, - }, - }, - ["lightning_stormflares_scav"] = { - -- groundflash = { - -- circlealpha = 0.9, - -- circlegrowth = -0.05, - -- flashalpha = 0.80, - -- flashsize = 300, - -- ttl = 80, - -- color = { - -- [1] = 0.4, - -- [2] = 0.1, - -- [3] = 0.8, - -- }, - -- alwaysvisible = true, - -- }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0.3 0.05 0.6 0.025 0.45 0.1 0.8 0.01 0.3 0.05 0.6 0.005 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0.4, 0]], - numparticles = 2, - particlelife = 25, - particlelifespread = 35, - particlesize = 14, - particlesizespread = 100, - particlespeed = 0.12, - particlespeedspread = 0.32, - pos = [[-10 r25, 1.0, -10 r25]], - sizegrowth = -0.4, - sizemod = 1.0, - texture = [[flare1]], - alwaysvisible = true, - drawOrder = 1, - }, - }, - }, - ["scav-damage"] = { - usedefaultexplosions = false, - -- engine = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- alwaysVisible = true, - -- colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[none]], - -- length = [[-15 r3.5]], - -- sidetexture = [[muzzleside]], - -- size = 15.5, - -- sizegrowth = [[0.2 r0.3]], - -- ttl = 1, - -- }, - -- }, - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 0.66 0.66 1 0.10 0.66 0.66 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 120, - emitvector = [[1, 1, 1]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 3, - particlelifespread = 5, - particlesize = 13, - particlesizespread = 40, - particlespeed = 0.04, - particlespeedspread = 0, - pos = [[-10 r10, -25, -10 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[whitelightb]], - }, - }, - fireglow = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.9 0.15 1.0 0.5 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0, 0.0]], - numparticles = 1, - particlelife = 2, - particlelifespread = 1, - particlesize = 20, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.8 0.15 1.0 0.3 0.6 0.06 0.8 0.2 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.2, 0]], - numparticles = 2, - particlelife = 40, - particlelifespread = 15, - particlesize = 11, - particlesizespread = 14, - particlespeed = 0.25, - particlespeedspread = 1.2, - pos = [[0, 1, 0]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.8 0.1 1.0 0.25 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.25 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.5, 0]], - numparticles = 2, - particlelife = 30, - particlelifespread = 15, - particlesize = 6, - particlesizespread = 6, - particlespeed = 0.25, - particlespeedspread = 1.9, - pos = [[0, 1, 0]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.012 0.012 0.012 0.05 0.10 0.08 0.066 0.66 0.08 0.076 0.086 0.56 0.08 0.076 0.084 0.44 0.05 0.05 0.05 0.28 0.028 0.028 0.028 0.13 0.012 0.012 0.012 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, 0.02, 0.0]], - numparticles = [[1.5 r1]], - particlelife = 15, - particlelifespread = 40, - particlesize = 4.6, - particlesizespread = 6.2, - particlespeed = 1.5, - particlespeedspread = 2.5, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.32, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.77, - colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 15, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 9, - particlelifespread = 6, - particlesize = 4, - particlesizespread = 0.8, - particlespeed = 0.05, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 0.06, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - }, + ["scavradiation"] = { + usedefaultexplosions = false, + topclouds = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0.30 0.015 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.045 r0.11, -0.004 r0.008]], + numparticles = [[0.7 r0.81]], + particlelife = 140, + particlelifespread = 200, + particlesize = 300, + particlesizespread = 400, + particlespeed = 4.5, + particlespeedspread = 3.5, + pos = [[-150 r300, 120 r300, -150 r300]], + rotParams = [[-3.5 r7, -1.5 r3, -180 r360]], + sizegrowth = [[0.4 r0.12]], + sizemod = 1, + texture = [[cloudpuff]], + useairlos = true, + alwaysvisible = true, + }, + }, + grounddust1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.017 r0.018, -0.004 r0.008]], + numparticles = [[0.79 r0.85]], + particlelife = 150, + particlelifespread = 200, + particlesize = 440, + particlesizespread = 780, + particlespeed = 6.5, + particlespeedspread = 4.5, + pos = [[-200 r400, 60 r190, -200 r400]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,370 r380]], + alwaysvisible = true, + castShadow = true, + }, + }, + }, + ["scavradiation-old"] = { + usedefaultexplosions = false, + grounddust1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.0 0.30 0.016 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], + numparticles = [[1.5 r1]], + particlelife = 180, + particlelifespread = 120, + particlesize = 300, + particlesizespread = 450, + particlespeed = 6.5, + particlespeedspread = 4.5, + pos = [[-200 r900, -50 r50, -200 r900]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff]], + alwaysvisible = true, + }, + }, + grounddust2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.0 0.30 0.016 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], + numparticles = [[1.5 r1]], + particlelife = 180, + particlelifespread = 120, + particlesize = 300, + particlesizespread = 450, + particlespeed = 6.5, + particlespeedspread = 4.5, + pos = [[-200 r900, -50 r50, -200 r900]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff2]], + alwaysvisible = true, + }, + }, + }, + ["scavmist"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.10 0.005 0.28 0.04 0.14 0.007 0.37 0.05 0.14 0.007 0.37 0.08 0.30 0.016 0.6 0.24 0.14 0.007 0.37 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.030 r0.006, -0.004 r0.008]], + numparticles = [[0.9 r1.1]], + particlelife = 120, + particlelifespread = 120, + particlesize = 50, + particlesizespread = 100, + particlespeed = 2.5, + particlespeedspread = 3.5, + pos = [[-50 r100, 0 r50, -50 r100]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff]], + alwaysvisible = true, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.05 0.3 0.05 0.6 0.045 0.45 0.1 0.8 0.01 0.45 0.1 0.8 0.009 0.3 0.05 0.6 0.007 0.3 0.05 0.6 0.005 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = [[0.5 r1]], + particlelife = 20, + particlelifespread = 30, + particlesize = 8, + particlesizespread = 24, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-6 r12, 25, -6 r12]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, + ["scavmistxl"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + --unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.01 0.11 0.005 0.28 0.07 0.15 0.007 0.37 0.13 0.26 0.014 0.55 0.19 0.34 0.018 0.64 0.27 0.15 0.007 0.37 0.12 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.005 r0.04, -0.004 r0.008]], + numparticles = [[0.74 r0.86]], + particlelife = 170, + particlelifespread = 190, + particlesize = 190, + particlesizespread = 520, + particlespeed = 2.7, + particlespeedspread = 3.7, + pos = [[-50 r100, -75 r90, -50 r100]], + rotParams = [[-5.0 r10, -1.5 r3, -180 r360]], + sizegrowth = 0.28, + sizemod = 1, + texture = [[dirtpuff]], + --animParams = [[8,8,290 r480]], + drawOrder = 1, + alwaysvisible = true, + castShadow = true, + }, + }, + -- lightningballs = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.92, + -- colormap = [[0 0 0 0.05 0.3 0.05 0.6 0.045 0.45 0.1 0.8 0.01 0.45 0.1 0.8 0.009 0.3 0.05 0.6 0.007 0.3 0.05 0.6 0.005 0 0 0 0.01]], + -- directional = false, + -- emitrot = 80, + -- emitrotspread = 120, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.1, 0]], + -- numparticles = [[0.5 r1]], + -- particlelife = 24, + -- particlelifespread = 36, + -- particlesize = 12, + -- particlesizespread = 24, + -- particlespeed = 0.12, + -- particlespeedspread = 0.32, + -- pos = [[-6 r12, 25, -6 r12]], + -- sizegrowth = -0.4, + -- sizemod = 1.0, + -- texture = [[flare1]], + -- alwaysvisible = true, + -- }, + -- }, + }, + ["scav_mist_explosion"] = { + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[5 r20]], + explosiongenerator = [[custom:lightning_storm_scav]], + pos = [[-50 r100, 20, -50 r100]], + }, + }, + electricstormxl = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[0 r10]], + explosiongenerator = [[custom:lightning_stormflares_scav]], + pos = [[-25 r50, 50 r25, -25 r50]], + }, + }, + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.5, + maxheat = 12, + pos = [[r-2 r2, 10, r-2 r2]], + size = 14.0, + sizegrowth = 16, + speed = [[0, 1 0, 0]], + texture = [[flare]], + alwaysvisible = true, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.4 0 0 0 0.01]], + size = 200, + sizegrowth = -1.5, + ttl = 29, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.175 0 0 0 0.01]], + size = 250, + sizegrowth = -1.5, + ttl = 35, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 9, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + -- pop1 = { + -- class = [[CHeatCloudProjectile]], + -- air=1, + -- water=1, + -- ground=1, + -- count=1, + -- properties ={ + -- texture=[[explo]], + -- heat = 8, + -- maxheat = 8, + -- heatFalloff = 1.1, + -- size = 7, + -- sizeGrowth = 18, + -- pos = [[r-10 r10, 20, r-10 r10]], + -- speed = [[0, 0, 0]], + -- alwaysvisible = true, + -- }, + -- }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.11 0.5 0.12 0.9 0.08 0.45 0.07 0.70 0.033 0.27 0.03 0.55 0.012 0.18 0.0015 0.35 0.007 0 0 0 0.1]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.04, 0]], + numparticles = 12, + particlelife = 12, + particlelifespread = 18, + particlesize = 15, + particlesizespread = 35, + particlespeed = 5.8, + particlespeedspread = 4.3, + pos = [[0, 2, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + }, + }, + -- dustparticles = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- airdrag = 0.88, + -- colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0.5, 1, 0.5]], + -- gravity = [[0, -0.011, 0]], + -- numparticles = 5, + -- particlelife = 11.6, + -- particlelifespread = 4.5, + -- particlesize = 6.5, + -- particlesizespread = 1.6, + -- particlespeed = 4.75, + -- particlespeedspread = 0.8, + -- pos = [[0, 0, 0]], + -- sizegrowth = 2.2, + -- sizemod = 1.0, + -- texture = [[randomdots]], + -- }, + -- }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.80, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[r-1 r3, 0, r-1 r3]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 35, + particleLifeSpread = 80, + numparticles = 7, + particleSpeed = 7, + particleSpeedSpread = 9, + particleSize = 14, + particleSizeSpread = 23, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1, + pos = [[r-1 r4, 0, r-1 r4]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 60, + numparticles = 4, + particleSpeed = 6, + particleSpeedSpread = 8, + particleSize = 31, + particleSizeSpread = 23, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.6 0.15 1 0.017 0.4 0.05 0.8 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 16, + particlelifespread = 18, + particlesize = 48, + particlesizespread = 38, + particlespeed = 18.5, + particlespeedspread = 11.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 9, + particlelife = 32, + particlelifespread = 7, + particlesize = 2.25, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 3, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 35, + particlelifespread = 8, + particlesize = 2.3, + particlesizespread = -1.4, + particlespeed = 3.6, + particlespeedspread = 3.4, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2.0, + particlesizespread = 2.3, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 75, + particlelifespread = 120, + particlesize = 66, + particlesizespread = 44, + particlespeed = 1.2, + particlespeedspread = 2.5, + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.1, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 17, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + }, + }, + }, + ["scav_commander_explosion"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.5, + maxheat = 12, + pos = [[r-2 r2, 10, r-2 r2]], + size = 4.0, + sizegrowth = 16, + speed = [[0, 1 0, 0]], + texture = [[flare]], + alwaysvisible = true, + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.4 0 0 0 0.01]], + size = 200, + sizegrowth = -1.5, + ttl = 29, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.175 0 0 0 0.01]], + size = 250, + sizegrowth = -1.5, + ttl = 35, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 9, + texture = [[groundflash]], + alwaysvisible = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + texture = [[explo]], + heat = 8, + maxheat = 8, + heatFalloff = 1.1, + size = 9, + sizeGrowth = 25, + pos = [[r-10 r10, 20, r-10 r10]], + speed = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.11 0.5 0.12 0.9 0.08 0.35 0.05 0.66 0.033 0.27 0.03 0.55 0.012 0.18 0.0015 0.35 0.007 0 0 0 0.1]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 15, + particlelife = 12, + particlelifespread = 18, + particlesize = 23, + particlesizespread = 20, + particlespeed = 6.8, + particlespeedspread = 5.3, + pos = [[0, 2, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside3]], + useairlos = false, + alwaysvisible = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 5, + particlelife = 11.6, + particlelifespread = 4.5, + particlesize = 6.5, + particlesizespread = 1.6, + particlespeed = 4.75, + particlespeedspread = 0.8, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.80, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[r-1 r3, 0, r-1 r3]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 35, + particleLifeSpread = 80, + numparticles = 7, + particleSpeed = 7, + particleSpeedSpread = 9, + particleSize = 14, + particleSizeSpread = 23, + directional = 0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water = 0, + air = 1, + ground = 1, + count = 1, + properties = { + airdrag = 0.7, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1, + pos = [[r-1 r4, 0, r-1 r4]], + emitRot = 33, + emitRotSpread = 50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap = [[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture = [[graysmoke]], + particleLife = 25, + particleLifeSpread = 60, + numparticles = 4, + particleSpeed = 6, + particleSpeedSpread = 8, + particleSize = 31, + particleSizeSpread = 23, + directional = 0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.6 0.15 1 0.017 0.4 0.05 0.8 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 16, + particlelifespread = 18, + particlesize = 48, + particlesizespread = 38, + particlespeed = 22.5, + particlespeedspread = 11.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + shockwave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = false, + water = false, + properties = { + colormap = [[0 0 0 0 0.6 0.15 1 0.40 0.5 0.13 0.8 0.80 0.12 0.08 0.18 0.012 0.08 0.04 0.12 0.005 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 4.3, + sizegrowth = [[-31 r8]], + ttl = 16, + pos = [[0, 20, 0]], + }, + }, + -- shockwave = { + -- class = [[CSpherePartSpawner]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- air = true, + -- properties = { + -- alpha = 0.6, + -- ttl = 11, + -- expansionSpeed = 13, + -- color = [[0.6, 0.15, 1]], + -- alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 9, + particlelife = 32, + particlelifespread = 7, + particlesize = 2.25, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 3, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 35, + particlelifespread = 8, + particlesize = 2.3, + particlesizespread = -1.4, + particlespeed = 3.6, + particlespeedspread = 3.4, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + alwaysvisible = true, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2.0, + particlesizespread = 2.3, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 75, + particlelifespread = 120, + particlesize = 66, + particlesizespread = 44, + particlespeed = 1.2, + particlespeedspread = 2.5, + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + alwaysvisible = true, + }, + }, + outerflash = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.1, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 17, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + alwaysvisible = true, + }, + }, + }, + ["scavradiation-beacon"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0.40 0.020 0.8 0.18 0.14 0.007 0.37 0.09 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.035, 0]], + numparticles = 3, + particlelife = 140, + particlelifespread = 100, + particlesize = 50, + particlesizespread = 125, + particlespeed = 4.5, + particlespeedspread = 3.5, + pos = [[0 r150, 100 r50, 0 r150]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[fogdirty]], + useairlos = true, + --alwaysvisible = true, + }, + }, + }, + ["scavradiation-lightning"] = { + usedefaultexplosions = false, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_storm_scav]], + pos = [[-50 r100, 20, -50 r100]], + }, + }, + lightningstrikesinstant = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.85 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = [[0.38 r0.75]], + particlelife = 3, + particlelifespread = 5, + particlesize = 160, + particlesizespread = 580, + particlespeed = 0.06, + particlespeedspread = 0, + pos = [[-10 r10, -50 r50, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[lightninginair]], + alwaysvisible = true, + }, + }, + -- electricstormxl = { + -- air = true, + -- class = [[CExpGenSpawner]], + -- count = 1, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- delay = [[50 r120]], + -- explosiongenerator = [[custom:lightning_stormflares_scav]], + -- pos = [[-50 r250, 0 r25, -50 r250]], + -- }, + -- }, + }, + ["lightning_storm_scav"] = { + -- groundflash = { + -- circlealpha = 1, + -- circlegrowth = 0, + -- flashalpha = 0.17, + -- flashsize = 40, + -- ttl = 3, + -- color = { + -- [1] = 0.66, + -- [2] = 0.66, + -- [3] = 1, + -- }, + -- alwaysvisible = true, + -- }, + lightningstrikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = [[0.5 r0.75]], + particlelife = 2, + particlelifespread = 6, + particlesize = 80, + particlesizespread = 380, + particlespeed = 0.06, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + alwaysvisible = true, + }, + }, + }, + ["lightning_storm_scavmist"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.16, + flashsize = 100, + ttl = 6, + color = { + [1] = 0.66, + [2] = 0.28, + [3] = 1, + }, + alwaysvisible = true, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 5, + particlesize = 30, + particlesizespread = 64, + particlespeed = 0.06, + particlespeedspread = 0, + pos = [[-20 r40, 25.0, -20 r40]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + alwaysvisible = true, + }, + }, + }, + ["lightning_stormflares_scav"] = { + -- groundflash = { + -- circlealpha = 0.9, + -- circlegrowth = -0.05, + -- flashalpha = 0.80, + -- flashsize = 300, + -- ttl = 80, + -- color = { + -- [1] = 0.4, + -- [2] = 0.1, + -- [3] = 0.8, + -- }, + -- alwaysvisible = true, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.3 0.05 0.6 0.025 0.45 0.1 0.8 0.01 0.3 0.05 0.6 0.005 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0.4, 0]], + numparticles = 2, + particlelife = 25, + particlelifespread = 35, + particlesize = 14, + particlesizespread = 100, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + drawOrder = 1, + }, + }, + }, + ["scav-damage"] = { + usedefaultexplosions = false, + -- engine = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- alwaysVisible = true, + -- colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[none]], + -- length = [[-15 r3.5]], + -- sidetexture = [[muzzleside]], + -- size = 15.5, + -- sizegrowth = [[0.2 r0.3]], + -- ttl = 1, + -- }, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.10 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 5, + particlesize = 13, + particlesizespread = 40, + particlespeed = 0.04, + particlespeedspread = 0, + pos = [[-10 r10, -25, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + fireglow = { -} \ No newline at end of file + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.9 0.15 1.0 0.5 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 20, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.15 1.0 0.3 0.6 0.06 0.8 0.2 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 15, + particlesize = 11, + particlesizespread = 14, + particlespeed = 0.25, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.1 1.0 0.25 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.25 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 6, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.012 0.012 0.012 0.05 0.10 0.08 0.066 0.66 0.08 0.076 0.086 0.56 0.08 0.076 0.084 0.44 0.05 0.05 0.05 0.28 0.028 0.028 0.028 0.13 0.012 0.012 0.012 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.02, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.06, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, +} diff --git a/effects/scavengers/scav-spawn-effects.lua b/effects/scavengers/scav-spawn-effects.lua index a8870657ec1..37a8fa84e9f 100644 --- a/effects/scavengers/scav-spawn-effects.lua +++ b/effects/scavengers/scav-spawn-effects.lua @@ -1,943 +1,942 @@ -- Spawns effects for Scavengers return { - ["scav-spawnexplo-small"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.6, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 64, - sizegrowth = -12, - speed = [[0, 10, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.16 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.5, 0.0]], - frontoffset = 1.2, - fronttexture = [[blastwave]], - length = -45, - sidetexture = [[none]], - size = 50, - sizegrowth = -0.38, - ttl = 12, - pos = [[0, 52, 0]], - }, - }, - groundsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], - numparticles = [[1 r1.2]], - particlelife = 20, - particlelifespread = 50, - particlesize = 70, - particlesizespread = 80, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[-2 r4, 25 r50, -2 r4]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = [[0.9 r0.5]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,90 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, - -- spawnring2 = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 0, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.9 0.7 1 0.033 0.6 0.14 0.95 0.22 0.3 0.08 0.6 0.011 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[dirtpuff]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 70, - -- sizegrowth = -0.6, - -- ttl = 16, - -- pos = [[0, 10, 0]], - -- }, - -- }, - -- scavdust = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- unit = false, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0 0 0 0.0 0.40 0.020 0.8 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], - -- directional = false, - -- emitrot = 90, - -- emitrotspread = 60, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, 0.035, 0]], - -- numparticles = 3, - -- particlelife = 140, - -- particlelifespread = 100, - -- particlesize = 50, - -- particlesizespread = 125, - -- particlespeed = 4.5, - -- particlespeedspread = 3.5, - -- pos = [[0, 100, 0]], - -- sizegrowth = 0.3, - -- sizemod = 1, - -- texture = [[fogdirty]], - -- useairlos = true, - -- --alwaysvisible = true, - -- }, - -- }, - -- groundflash_small = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.8 0.3 1 0.4 0 0 0 0.01]], - -- size = 70, - -- sizegrowth = 4, - -- ttl = 22, - -- texture = [[groundflash]], - -- }, - -- }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.6 0.15 1 0.2 0 0 0 0.01]], - -- size = 80, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - -- groundflash_white = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], - -- size = 100, - -- sizegrowth = 0, - -- ttl = 4, - -- texture = [[groundflash]], - -- }, - -- }, - -- explosion = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = true, - -- properties = { - -- airdrag = 0.92, - -- colormap = [[0.6 0.15 0.9 0.03 0.8 0.18 1 0.04 0.35 0.05 0.66 0.033 0.27 0.03 0.55 0.011 0 0 0 0]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 32, - -- emitvector = [[0, 1.1, 0]], - -- gravity = [[0, -0.01, 0]], - -- numparticles = 4, - -- particlelife = 5, - -- particlelifespread = 15, - -- particlesize = 28, - -- particlesizespread = 24, - -- particlespeed = 6.9, - -- particlespeedspread = 3.0, - -- pos = [[0, 2, 0]], - -- sizegrowth = -0.8, - -- sizemod = 0.9, - -- texture = [[gunshotxl]], - -- useairlos = false, - -- }, - -- }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[purplenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 40.5, - sizeGrowth = -1, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.15, 0]], - numparticles = 1, - particlelife = 14, - particlelifespread = 25, - particlesize = 19, - particlesizespread = 27, - particlespeed = 1.4, - particlespeedspread = 3.2, - pos = [[0, -20, 0]], - sizegrowth = 1, - sizemod = 0.92, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["scav-spawnexplo-small"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.6, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 64, + sizegrowth = -12, + speed = [[0, 10, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.16 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.5, 0.0]], + frontoffset = 1.2, + fronttexture = [[blastwave]], + length = -45, + sidetexture = [[none]], + size = 50, + sizegrowth = -0.38, + ttl = 12, + pos = [[0, 52, 0]], + }, + }, + groundsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], + numparticles = [[1 r1.2]], + particlelife = 20, + particlelifespread = 50, + particlesize = 70, + particlesizespread = 80, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[-2 r4, 25 r50, -2 r4]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = [[0.9 r0.5]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,90 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, + -- spawnring2 = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 0, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.9 0.7 1 0.033 0.6 0.14 0.95 0.22 0.3 0.08 0.6 0.011 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[dirtpuff]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 70, + -- sizegrowth = -0.6, + -- ttl = 16, + -- pos = [[0, 10, 0]], + -- }, + -- }, + -- scavdust = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- unit = false, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0 0 0 0.0 0.40 0.020 0.8 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], + -- directional = false, + -- emitrot = 90, + -- emitrotspread = 60, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, 0.035, 0]], + -- numparticles = 3, + -- particlelife = 140, + -- particlelifespread = 100, + -- particlesize = 50, + -- particlesizespread = 125, + -- particlespeed = 4.5, + -- particlespeedspread = 3.5, + -- pos = [[0, 100, 0]], + -- sizegrowth = 0.3, + -- sizemod = 1, + -- texture = [[fogdirty]], + -- useairlos = true, + -- --alwaysvisible = true, + -- }, + -- }, + -- groundflash_small = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.8 0.3 1 0.4 0 0 0 0.01]], + -- size = 70, + -- sizegrowth = 4, + -- ttl = 22, + -- texture = [[groundflash]], + -- }, + -- }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.6 0.15 1 0.2 0 0 0 0.01]], + -- size = 80, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + -- groundflash_white = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.7 0.25 1 0.77 0 0 0 0.01]], + -- size = 100, + -- sizegrowth = 0, + -- ttl = 4, + -- texture = [[groundflash]], + -- }, + -- }, + -- explosion = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = true, + -- properties = { + -- airdrag = 0.92, + -- colormap = [[0.6 0.15 0.9 0.03 0.8 0.18 1 0.04 0.35 0.05 0.66 0.033 0.27 0.03 0.55 0.011 0 0 0 0]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 32, + -- emitvector = [[0, 1.1, 0]], + -- gravity = [[0, -0.01, 0]], + -- numparticles = 4, + -- particlelife = 5, + -- particlelifespread = 15, + -- particlesize = 28, + -- particlesizespread = 24, + -- particlespeed = 6.9, + -- particlespeedspread = 3.0, + -- pos = [[0, 2, 0]], + -- sizegrowth = -0.8, + -- sizemod = 0.9, + -- texture = [[gunshotxl]], + -- useairlos = false, + -- }, + -- }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[purplenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 40.5, + sizeGrowth = -1, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.15, 0]], + numparticles = 1, + particlelife = 14, + particlelifespread = 25, + particlesize = 19, + particlesizespread = 27, + particlespeed = 1.4, + particlespeedspread = 3.2, + pos = [[0, -20, 0]], + sizegrowth = 1, + sizemod = 0.92, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["scav-spawnexplo-tiny"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.6, - maxheat = 20, - pos = [[r-2 r2, 3, r-2 r2]], - size = 50, - sizegrowth = -3, - speed = [[0, 1, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.5, 0.0]], - frontoffset = 1.1, - fronttexture = [[blastwave]], - length = -45, - sidetexture = [[none]], - size = 38, - sizegrowth = -0.40, - ttl = 12, - pos = [[0, 46, 0]], - }, - }, - groundsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], - numparticles = [[1 r1.2]], - particlelife = 17, - particlelifespread = 40, - particlesize = 55, - particlesizespread = 70, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[-2 r4, 25 r25, -2 r4]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = [[0.85 r0.5]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,80 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[purplenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.6, - size = 32, - sizeGrowth = -1, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.15, 0]], - numparticles = 1, - particlelife = 12, - particlelifespread = 20, - particlesize = 14, - particlesizespread = 22, - particlespeed = 1.4, - particlespeedspread = 3.2, - pos = [[0, -20, 0]], - sizegrowth = 1, - sizemod = 0.92, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["scav-spawnexplo-tiny"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.6, + maxheat = 20, + pos = [[r-2 r2, 3, r-2 r2]], + size = 50, + sizegrowth = -3, + speed = [[0, 1, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.5, 0.0]], + frontoffset = 1.1, + fronttexture = [[blastwave]], + length = -45, + sidetexture = [[none]], + size = 38, + sizegrowth = -0.40, + ttl = 12, + pos = [[0, 46, 0]], + }, + }, + groundsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], + numparticles = [[1 r1.2]], + particlelife = 17, + particlelifespread = 40, + particlesize = 55, + particlesizespread = 70, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[-2 r4, 25 r25, -2 r4]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = [[0.85 r0.5]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,80 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[purplenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.6, + size = 32, + sizeGrowth = -1, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.15, 0]], + numparticles = 1, + particlelife = 12, + particlelifespread = 20, + particlesize = 14, + particlesizespread = 22, + particlespeed = 1.4, + particlespeedspread = 3.2, + pos = [[0, -20, 0]], + sizegrowth = 1, + sizemod = 0.92, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["scav-spawnexplo-medium"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.5, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 72, - sizegrowth = -12, - speed = [[0, 10, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.5, 0.0]], - frontoffset = 1.6, - fronttexture = [[blastwave]], - length = -45, - sidetexture = [[none]], - size = 64, - sizegrowth = -0.40, - ttl = 14, - pos = [[0, 64, 0]], - }, - }, - groundsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], - numparticles = [[1 r1.2]], - particlelife = 20, - particlelifespread = 50, - particlesize = 80, - particlesizespread = 80, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[-2 r4, 25 r50, -2 r4]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = [[0.9 r0.5]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,90 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[purplenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 50.5, - sizeGrowth = -1, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.15, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 25, - particlesize = 25, - particlesizespread = 30, - particlespeed = 1.5, - particlespeedspread = 3.4, - pos = [[0, -20, 0]], - sizegrowth = 1, - sizemod = 0.92, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["scav-spawnexplo-medium"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.5, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 72, + sizegrowth = -12, + speed = [[0, 10, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.5, 0.0]], + frontoffset = 1.6, + fronttexture = [[blastwave]], + length = -45, + sidetexture = [[none]], + size = 64, + sizegrowth = -0.40, + ttl = 14, + pos = [[0, 64, 0]], + }, + }, + groundsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], + numparticles = [[1 r1.2]], + particlelife = 20, + particlelifespread = 50, + particlesize = 80, + particlesizespread = 80, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[-2 r4, 25 r50, -2 r4]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = [[0.9 r0.5]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,90 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[purplenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 50.5, + sizeGrowth = -1, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.15, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 25, + particlesize = 25, + particlesizespread = 30, + particlespeed = 1.5, + particlespeedspread = 3.4, + pos = [[0, -20, 0]], + sizegrowth = 1, + sizemod = 0.92, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["scav-spawnexplo-large"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 86, - sizegrowth = -2, - speed = [[0, 5, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.5, 0.0]], - frontoffset = 2.8, - fronttexture = [[blastwave]], - length = -45, - sidetexture = [[none]], - size = 75, - sizegrowth = -0.40, - ttl = 16, - pos = [[0, 120, 0]], - }, - }, - groundsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], - numparticles = [[1 r1.2]], - particlelife = 20, - particlelifespread = 50, - particlesize = 100, - particlesizespread = 80, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[-2 r4, 25 r50, -2 r4]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = [[0.9 r0.5]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,90 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[purplenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 64.5, - sizeGrowth = -1, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.15, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 25, - particlesize = 38, - particlesizespread = 32, - particlespeed = 1.5, - particlespeedspread = 3.4, - pos = [[-10 r20, 0, -10 r20]], - sizegrowth = 1, - sizemod = 0.92, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["scav-spawnexplo-large"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 86, + sizegrowth = -2, + speed = [[0, 5, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.5, 0.0]], + frontoffset = 2.8, + fronttexture = [[blastwave]], + length = -45, + sidetexture = [[none]], + size = 75, + sizegrowth = -0.40, + ttl = 16, + pos = [[0, 120, 0]], + }, + }, + groundsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], + numparticles = [[1 r1.2]], + particlelife = 20, + particlelifespread = 50, + particlesize = 100, + particlesizespread = 80, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[-2 r4, 25 r50, -2 r4]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = [[0.9 r0.5]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,90 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[purplenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 64.5, + sizeGrowth = -1, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.15, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 25, + particlesize = 38, + particlesizespread = 32, + particlespeed = 1.5, + particlespeedspread = 3.4, + pos = [[-10 r20, 0, -10 r20]], + sizegrowth = 1, + sizemod = 0.92, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["scav-spawnexplo-huge"] = { - centerflare = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - heat = 10, - heatfalloff = 1.1, - maxheat = 20, - pos = [[r-2 r2, 5, r-2 r2]], - size = 90, - sizegrowth = -2, - speed = [[0, 5, 0]], - texture = [[flare]], - }, - }, - spawnring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.5, 0.0]], - frontoffset = 3.2, - fronttexture = [[blastwave]], - length = -45, - sidetexture = [[none]], - size = 95, - sizegrowth = -0.40, - ttl = 16, - pos = [[0, 140, 0]], - }, - }, - groundsmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - unit = false, - properties = { - airdrag = 0.90, - colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], - directional = false, - emitrot = 45, - emitrotspread = 80, - emitvector = [[0, 1, 0]], - gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], - numparticles = [[1 r1.2]], - particlelife = 20, - particlelifespread = 50, - particlesize = 120, - particlesizespread = 90, - particlespeed = 0.5, - particlespeedspread = 1.5, - pos = [[-2 r4, 35 r60, -2 r4]], - rotParams = [[-5.5 r11, -2 r4, -180 r360]], - sizegrowth = [[0.9 r0.5]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,90 r50]], - alwaysvisible = true, - castShadow = true, - }, - }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[purplenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 76, - sizeGrowth = -1, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.88, - colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.3 r0.15, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 25, - particlesize = 45, - particlesizespread = 45, - particlespeed = 1.7, - particlespeedspread = 3.9, - pos = [[-20 r40, 0, -20 r40]], - sizegrowth = 1, - sizemod = 0.92, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["scav-spawnexplo-huge"] = { + centerflare = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 90, + sizegrowth = -2, + speed = [[0, 5, 0]], + texture = [[flare]], + }, + }, + spawnring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.15 0.04 0.3 0.009 0.6 0.15 1 0.18 0.2 0.06 0.4 0.011 0.15 0.04 0.3 0.009 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.5, 0.0]], + frontoffset = 3.2, + fronttexture = [[blastwave]], + length = -45, + sidetexture = [[none]], + size = 95, + sizegrowth = -0.40, + ttl = 16, + pos = [[0, 140, 0]], + }, + }, + groundsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.90, + colormap = [[0.14 0.009 0.37 0.10 0.30 0.016 0.6 0.22 0.14 0.007 0.37 0.13 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[-0.004 r0.008, 0.034 r0.025, -0.004 r0.008]], + numparticles = [[1 r1.2]], + particlelife = 20, + particlelifespread = 50, + particlesize = 120, + particlesizespread = 90, + particlespeed = 0.5, + particlespeedspread = 1.5, + pos = [[-2 r4, 35 r60, -2 r4]], + rotParams = [[-5.5 r11, -2 r4, -180 r360]], + sizegrowth = [[0.9 r0.5]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,90 r50]], + alwaysvisible = true, + castShadow = true, + }, + }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[purplenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 76, + sizeGrowth = -1, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.88, + colormap = [[0.6 0.15 1 0.017 0.7 0.18 1 0.011 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.15, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 25, + particlesize = 45, + particlesizespread = 45, + particlespeed = 1.7, + particlespeedspread = 3.9, + pos = [[-20 r40, 0, -20 r40]], + sizegrowth = 1, + sizemod = 0.92, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["scaspawn-trail"] = { - usedefaultexplosions = false, - engine = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - alwaysVisible = true, - colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[none]], - length = [[-15 r3.5]], - sidetexture = [[muzzleside]], - size = 15.5, - sizegrowth = [[0.2 r0.3]], - ttl = 1, - }, - }, - fireglow = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 1, - colormap = [[0.85 0.05 1.0 0.01 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 0, - emitvector = [[0.0, 0.0, 0.0]], - gravity = [[0.0, 0, 0.0]], - numparticles = [[0.4 r1]], - particlelife = 2, - particlelifespread = 1, - particlesize = 40, - particlesizespread = 12, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 20, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[dirt]], - useairlos = true, - }, - }, - exhale = { - - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.75 0.08 1.0 0.1 0.45 0.04 0.6 0.1 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 8, - particlesize = 16, - particlesizespread = 25, - particlespeed = 0.25, - particlespeedspread = 1.2, - pos = [[-5 r10, 1, -5 r10]], - sizegrowth = -0.2, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - exhale2 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - alwaysVisible = true, - airdrag = 0.87, - colormap = [[0.8 0.1 1.0 0.15 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.15 0.0 0.0 0.0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 5, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.8, 0]], - numparticles = 1, - particlelife = 7, - particlelifespread = 7, - particlesize = 7, - particlesizespread = 13, - particlespeed = 0.25, - particlespeedspread = 1.9, - pos = [[-5 r10, 1, -5 r10]], - sizegrowth = -0.07, - sizemod = 1.0, - texture = [[smoke-raptors]], - }, - }, - -- trail = { - - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- alwaysVisible = true, - -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[trans]], - -- length = -20, - -- sidetexture = [[smoketrail]], - -- size = 2.0, - -- sizegrowth = 0.05, - -- ttl = 40, - -- }, - -- }, - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], - directional = true, - emitrot = -180, - emitrotspread = 7, - emitvector = [[dir]], - gravity = [[0.0, -0.02, 0.0]], - numparticles = [[0.7 r1]], - particlelife = 6, - particlelifespread = 10, - particlesize = 6.6, - particlesizespread = 9.2, - particlespeed = 1.5, - particlespeedspread = 2.5, - pos = [[-15 r30, -15 r30, -15 r30]], - sizegrowth = 0.36, - sizemod = 1, - texture = [[smoke]], - useairlos = true, - }, - }, - dustparticles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = true, - underwater = true, - water = true, - properties = { - airdrag = 0.77, - colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 15, - emitvector = [[dir]], - gravity = [[0, -0.011, 0]], - numparticles = 1, - particlelife = 9, - particlelifespread = 6, - particlesize = 4, - particlesizespread = 0.8, - particlespeed = 0.05, - particlespeedspread = 0.6, - pos = [[0, 0, 0]], - sizegrowth = 0.03, - sizemod = 1.0, - texture = [[randomdots]], - }, - }, - -- spikes = { - -- air = true, - -- class = [[CExploSpikeProjectile]], - -- count = 2, - -- ground = true, - -- water = true, - -- properties = { - -- alpha = 0.6, - -- alphadecay = 0.08, - -- color = [[1.0, 0.5, 0.2]], - -- dir = [[-10 r20,-10 r20,-10 r20]], - -- length = 2, - -- width = 9, - -- }, - -- }, - }, + ["scaspawn-trail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 15.5, + sizegrowth = [[0.2 r0.3]], + ttl = 1, + }, + }, + fireglow = { -} \ No newline at end of file + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.85 0.05 1.0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0, 0.0]], + numparticles = [[0.4 r1]], + particlelife = 2, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 20, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.75 0.08 1.0 0.1 0.45 0.04 0.6 0.1 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 8, + particlesize = 16, + particlesizespread = 25, + particlespeed = 0.25, + particlespeedspread = 1.2, + pos = [[-5 r10, 1, -5 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.1 1.0 0.15 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.15 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.8, 0]], + numparticles = 1, + particlelife = 7, + particlelifespread = 7, + particlesize = 7, + particlesizespread = 13, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[-5 r10, 1, -5 r10]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-raptors]], + }, + }, + -- trail = { + + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- alwaysVisible = true, + -- colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[trans]], + -- length = -20, + -- sidetexture = [[smoketrail]], + -- size = 2.0, + -- sizegrowth = 0.05, + -- ttl = 40, + -- }, + -- }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[0.7 r1]], + particlelife = 6, + particlelifespread = 10, + particlesize = 6.6, + particlesizespread = 9.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.36, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + -- spikes = { + -- air = true, + -- class = [[CExploSpikeProjectile]], + -- count = 2, + -- ground = true, + -- water = true, + -- properties = { + -- alpha = 0.6, + -- alphadecay = 0.08, + -- color = [[1.0, 0.5, 0.2]], + -- dir = [[-10 r20,-10 r20,-10 r20]], + -- length = 2, + -- width = 9, + -- }, + -- }, + }, +} diff --git a/effects/sparklegreen.lua b/effects/sparklegreen.lua index 9dad8512ca1..9409fa32058 100644 --- a/effects/sparklegreen.lua +++ b/effects/sparklegreen.lua @@ -1,243 +1,241 @@ -- sparklegreen return { - ["sparklegreen"] = { - explosionspikes = { - air = true, - class = [[CExploSpikeProjectile]], - count = 6, - ground = true, - water = true, - properties = { - alpha = 0.5, - alphadecay = 0.2, - color = [[0.1, 0.6, 0.1]], - dir = [[-45 r90,-45 r90,-45 r90]], - length = 0.004, - width = 1, - }, - }, - groundflash = { - air = true, - circlealpha = 0.0, - circlegrowth = 8, - flashalpha = 0.15, - flashsize = 24, - ground = true, - ttl = 17, - water = true, - color = { - [1] = 0.5, - [2] = 1, - [3] = 0.5, - }, - }, - poof01 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.86, - colormap = [[0.22 0.9 0.22 0.017 0.15 0.66 0.15 0.01 0.1 0.1 0.1 0.01]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 3, - particlelifespread = 18, - particlesize = 4.5, - particlesizespread = 3, - particlespeed = 1.15, - particlespeedspread = 3, - pos = [[0, 2, 0]], - sizegrowth = -0.015, - sizemod = 1.0, - texture = [[randomdots]], - useairlos = false, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 9, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 14, - particlelife = 24, - particlelifespread = 8, - particlesize = 0.8, - particlesizespread = -0.7, - particlespeed = 1, - particlespeedspread = 1.8, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirt2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], - directional = true, - emitrot = 0, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.3, 0]], - numparticles = 14, - particlelife = 30, - particlelifespread = 10, - particlesize = 1.1, - particlesizespread = -1, - particlespeed = 1.5, - particlespeedspread = 2.5, - pos = [[0, 4, 0]], - sizegrowth = -0.015, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirtgreen = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.07 0.8 0.07 0.017 0.05 0.66 0.05 0.014 0.03 0.55 0.03 0.011 0.1 0.1 0.1 0.01]], - directional = true, - emitrot = 10, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 12, - particlelife = 40, - particlelifespread = 40, - particlesize = 1, - particlesizespread = -0.65, - particlespeed = 0.5, - particlespeedspread = 1.8, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - dirtgreen2 = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 1, - colormap = [[0.12 1.0 0.12 0.017 0.1 0.88 0.1 0.014 0.07 0.66 0.07 0.011 0.1 0.1 0.1 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.2, 0]], - numparticles = 12, - particlelife = 33, - particlelifespread = 33, - particlesize = 1, - particlesizespread = -0.85, - particlespeed = 0.7, - particlespeedspread = 1.9, - pos = [[0, 4, 0]], - sizegrowth = -0.01, - sizemod = 1, - texture = [[bigexplosmoke]], - useairlos = false, - }, - }, - clouddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.88, - colormap = [[0.04 0.04 0.04 0.055 0.066 0.066 0.066 0.08 0.055 0.055 0.055 0.06 0.03 0.03 0.03 0.033 0 0 0 0]], - directional = true, - emitrot = 0, - emitrotspread = 33, - emitvector = [[0.5, 1, 0.5]], - gravity = [[0, 0.02, 0]], - numparticles = 2, - particlelife = 50, - particlelifespread = 240, - particlesize = 14, - particlesizespread = 8, - particlespeed = 0.3, - particlespeedspread = 1.4, - pos = [[0, 4, 0]], - sizegrowth = 0.3, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - grounddust = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = false, - properties = { - airdrag = 0.92, - colormap = [[0.1 0.1 0.1 0.13 0 0 0 0.0]], - directional = false, - emitrot = 90, - emitrotspread = -2, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.03, 0]], - numparticles = 8, - particlelife = 5, - particlelifespread = 35, - particlesize = 2.6, - particlesizespread = 1.3, - particlespeed = 1.5, - particlespeedspread = 0.6, - pos = [[0, 5, 0]], - sizegrowth = 0.15, - sizemod = 1.0, - texture = [[bigexplosmoke]], - }, - }, - pop1 = { - air = true, - class = [[CHeatCloudProjectile]], - count = 1, - ground = true, - water = true, - properties = { - heat = 6, - heatfalloff = 3, - maxheat = 6, - pos = [[r-2 r2, 5, r-2 r2]], - size = 0.4, - sizegrowth = 10, - speed = [[0, 0, 0]], - texture = [[greennovaexplo]], - }, - }, - }, - + ["sparklegreen"] = { + explosionspikes = { + air = true, + class = [[CExploSpikeProjectile]], + count = 6, + ground = true, + water = true, + properties = { + alpha = 0.5, + alphadecay = 0.2, + color = [[0.1, 0.6, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.004, + width = 1, + }, + }, + groundflash = { + air = true, + circlealpha = 0.0, + circlegrowth = 8, + flashalpha = 0.15, + flashsize = 24, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0.5, + [2] = 1, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.86, + colormap = [[0.22 0.9 0.22 0.017 0.15 0.66 0.15 0.01 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 3, + particlelifespread = 18, + particlesize = 4.5, + particlesizespread = 3, + particlespeed = 1.15, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = -0.015, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 9, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 14, + particlelife = 24, + particlelifespread = 8, + particlesize = 0.8, + particlesizespread = -0.7, + particlespeed = 1, + particlespeedspread = 1.8, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.03 0.58 0.08 0.065 0.035 0.47 0.075 0.07 0.06 0.4 0 0 0 0 ]], + directional = true, + emitrot = 0, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 14, + particlelife = 30, + particlelifespread = 10, + particlesize = 1.1, + particlesizespread = -1, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[0, 4, 0]], + sizegrowth = -0.015, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirtgreen = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.07 0.8 0.07 0.017 0.05 0.66 0.05 0.014 0.03 0.55 0.03 0.011 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 10, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 12, + particlelife = 40, + particlelifespread = 40, + particlesize = 1, + particlesizespread = -0.65, + particlespeed = 0.5, + particlespeedspread = 1.8, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirtgreen2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 1, + colormap = [[0.12 1.0 0.12 0.017 0.1 0.88 0.1 0.014 0.07 0.66 0.07 0.011 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 12, + particlelife = 33, + particlelifespread = 33, + particlesize = 1, + particlesizespread = -0.85, + particlespeed = 0.7, + particlespeedspread = 1.9, + pos = [[0, 4, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.88, + colormap = [[0.04 0.04 0.04 0.055 0.066 0.066 0.066 0.08 0.055 0.055 0.055 0.06 0.03 0.03 0.03 0.033 0 0 0 0]], + directional = true, + emitrot = 0, + emitrotspread = 33, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.02, 0]], + numparticles = 2, + particlelife = 50, + particlelifespread = 240, + particlesize = 14, + particlesizespread = 8, + particlespeed = 0.3, + particlespeedspread = 1.4, + pos = [[0, 4, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + properties = { + airdrag = 0.92, + colormap = [[0.1 0.1 0.1 0.13 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = -2, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.03, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 35, + particlesize = 2.6, + particlesizespread = 1.3, + particlespeed = 1.5, + particlespeedspread = 0.6, + pos = [[0, 5, 0]], + sizegrowth = 0.15, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + pop1 = { + air = true, + class = [[CHeatCloudProjectile]], + count = 1, + ground = true, + water = true, + properties = { + heat = 6, + heatfalloff = 3, + maxheat = 6, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.4, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[greennovaexplo]], + }, + }, + }, } - diff --git a/effects/splash.lua b/effects/splash.lua index 89b8fe57784..fdcc54f020e 100644 --- a/effects/splash.lua +++ b/effects/splash.lua @@ -1,2098 +1,2093 @@ local definitions = { - ["splash-emerge-tiny"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.1, 0]], - numparticles = 12, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.2, - particlesizespread = 1, - particlespeed = [[0 r2 i-0.05]], - particlespeedspread = 1.5, - pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], - sizegrowth = [[0.60 r0.5 r-0.5]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -.25, 0]], - numparticles = 9, - particlelife = 3, - particlelifespread = 9, - particlesize = [[0.75 r2]], - particlesizespread = 0, - particlespeed = [[0.4 r0.4]], - particlespeedspread = 0, - pos = [[0 r-2 r2, 4, 0 r-2 r2]], - sizegrowth = [[0.040]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 20, - particlelife = 16, - particlelifespread = 6, - particlesize = 1.5, - particlesizespread = 2, - particlespeed = [[1.7 i0.25]], - particlespeedspread = 1, - pos = [[0, 0, 0]], - sizegrowth = -0.15, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - --droplets = { - -- class = [[dirt]], - -- count = 4, - -- water = true, - -- properties = { - -- alphafalloff = 1, - -- color = [[0.75, 0.75, 1]], - -- pos = [[0, 0, 0]], - -- size = [[4 r16]], - -- speed = [[-1 r2, 1 r1, -1 r2]], - -- }, - --}, - }, + ["splash-emerge-tiny"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.1, 0]], + numparticles = 12, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.2, + particlesizespread = 1, + particlespeed = [[0 r2 i-0.05]], + particlespeedspread = 1.5, + pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], + sizegrowth = [[0.60 r0.5 r-0.5]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -.25, 0]], + numparticles = 9, + particlelife = 3, + particlelifespread = 9, + particlesize = [[0.75 r2]], + particlesizespread = 0, + particlespeed = [[0.4 r0.4]], + particlespeedspread = 0, + pos = [[0 r-2 r2, 4, 0 r-2 r2]], + sizegrowth = [[0.040]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 20, + particlelife = 16, + particlelifespread = 6, + particlesize = 1.5, + particlesizespread = 2, + particlespeed = [[1.7 i0.25]], + particlespeedspread = 1, + pos = [[0, 0, 0]], + sizegrowth = -0.15, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + --droplets = { + -- class = [[dirt]], + -- count = 4, + -- water = true, + -- properties = { + -- alphafalloff = 1, + -- color = [[0.75, 0.75, 1]], + -- pos = [[0, 0, 0]], + -- size = [[4 r16]], + -- speed = [[-1 r2, 1 r1, -1 r2]], + -- }, + --}, + }, - ["splash-emerge-small"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.1, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.25, - particlesizespread = 1.5, - particlespeed = [[0 r2 i-0.05]], - particlespeedspread = 1.5, - pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], - sizegrowth = [[0.65 r0.5 r-0.5]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -.25, 0]], - numparticles = 15, - particlelife = 4, - particlelifespread = 10, - particlesize = [[0.75 r2]], - particlesizespread = 0, - particlespeed = [[0.6 r0.6]], - particlespeedspread = 0, - pos = [[0 r-2 r2, 4, 0 r-2 r2]], - sizegrowth = [[0.040]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 30, - particlelife = 20, - particlelifespread = 6, - particlesize = 1.5, - particlesizespread = 2, - particlespeed = [[2.4 i0.25]], - particlespeedspread = 1.5, - pos = [[0, 0, 0]], - sizegrowth = -0.15, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - --droplets = { - -- class = [[dirt]], - -- count = 4, - -- water = true, - -- properties = { - -- alphafalloff = 1, - -- color = [[0.75, 0.75, 1]], - -- pos = [[0, 0, 0]], - -- size = [[4 r16]], - -- speed = [[-1 r2, 1 r1, -1 r2]], - -- }, - --}, - }, + ["splash-emerge-small"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.25, + particlesizespread = 1.5, + particlespeed = [[0 r2 i-0.05]], + particlespeedspread = 1.5, + pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], + sizegrowth = [[0.65 r0.5 r-0.5]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -.25, 0]], + numparticles = 15, + particlelife = 4, + particlelifespread = 10, + particlesize = [[0.75 r2]], + particlesizespread = 0, + particlespeed = [[0.6 r0.6]], + particlespeedspread = 0, + pos = [[0 r-2 r2, 4, 0 r-2 r2]], + sizegrowth = [[0.040]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 30, + particlelife = 20, + particlelifespread = 6, + particlesize = 1.5, + particlesizespread = 2, + particlespeed = [[2.4 i0.25]], + particlespeedspread = 1.5, + pos = [[0, 0, 0]], + sizegrowth = -0.15, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + --droplets = { + -- class = [[dirt]], + -- count = 4, + -- water = true, + -- properties = { + -- alphafalloff = 1, + -- color = [[0.75, 0.75, 1]], + -- pos = [[0, 0, 0]], + -- size = [[4 r16]], + -- speed = [[-1 r2, 1 r1, -1 r2]], + -- }, + --}, + }, - ["splash-emerge-large"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.15, 0]], - numparticles = 35, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.35, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], - sizegrowth = [[0.8 r0.8 r-0.8]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -.25, 0]], - numparticles = 30, - particlelife = 4, - particlelifespread = 12, - particlesize = [[0.75 r2]], - particlesizespread = 0, - particlespeed = [[1 r1]], - particlespeedspread = 0, - pos = [[0 r-2 r2, 4, 0 r-2 r2]], - sizegrowth = [[0.040]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 35, - particlelife = 20, - particlelifespread = 6, - particlesize = 2, - particlesizespread = 3, - particlespeed = [[3 i0.25]], - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = -0.15, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - --droplets = { - -- class = [[dirt]], - -- count = 10, - -- water = true, - -- properties = { - -- alphafalloff = 1, - -- color = [[0.75, 0.75, 1]], - -- pos = [[0, 0, 0]], - -- size = [[4 r24]], - -- speed = [[-1 r2, 1 r1, -1 r2]], - -- }, - --}, - }, + ["splash-emerge-large"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.15, 0]], + numparticles = 35, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.35, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], + sizegrowth = [[0.8 r0.8 r-0.8]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -.25, 0]], + numparticles = 30, + particlelife = 4, + particlelifespread = 12, + particlesize = [[0.75 r2]], + particlesizespread = 0, + particlespeed = [[1 r1]], + particlespeedspread = 0, + pos = [[0 r-2 r2, 4, 0 r-2 r2]], + sizegrowth = [[0.040]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 35, + particlelife = 20, + particlelifespread = 6, + particlesize = 2, + particlesizespread = 3, + particlespeed = [[3 i0.25]], + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = -0.15, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + --droplets = { + -- class = [[dirt]], + -- count = 10, + -- water = true, + -- properties = { + -- alphafalloff = 1, + -- color = [[0.75, 0.75, 1]], + -- pos = [[0, 0, 0]], + -- size = [[4 r24]], + -- speed = [[-1 r2, 1 r1, -1 r2]], + -- }, + --}, + }, - ["splash-torpedo"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 7, - sizegrowth = 1.8, - ttl = 65, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 28, - particlesize = [[0.5 r0.6]], - particlesizespread = 0, - particlespeed = [[1.0 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.3]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - -- waterrush = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - -- directional = false, - -- emitrot = 1, - -- emitrotspread = 0, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.12, 0]], - -- numparticles = 1, - -- particlelife = 35, - -- particlelifespread = 60, - -- particlesize = [[10 r25]], - -- particlesizespread = 30, - -- particlespeed = [[5 i0.7]], - -- particlespeedspread = 0, - -- pos = [[0, 50 r50, 0]], - -- sizegrowth = [[0.7]], - -- sizemod = 1, - -- texture = [[waterrush]], - -- useairlos = true, - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 3, - particlelife = 7, - particlelifespread = 14, - particlesize = 4, - particlesizespread = 12, - particlespeed = 0.7, - particlespeedspread = 7, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.55, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.3 0.3 0.32 0.006 0.3 0.3 0.32 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 6, - particlelife = 12, - particlelifespread = 13, - particlesize = 1.1, - particlesizespread = 12, - particlespeed = [[1.8 i0.25]], - particlespeedspread = 2, - rotParams = [[-80 r160, -30 r60, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, + ["splash-torpedo"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 7, + sizegrowth = 1.8, + ttl = 65, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 28, + particlesize = [[0.5 r0.6]], + particlesizespread = 0, + particlespeed = [[1.0 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.3]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + -- waterrush = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + -- directional = false, + -- emitrot = 1, + -- emitrotspread = 0, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.12, 0]], + -- numparticles = 1, + -- particlelife = 35, + -- particlelifespread = 60, + -- particlesize = [[10 r25]], + -- particlesizespread = 30, + -- particlespeed = [[5 i0.7]], + -- particlespeedspread = 0, + -- pos = [[0, 50 r50, 0]], + -- sizegrowth = [[0.7]], + -- sizemod = 1, + -- texture = [[waterrush]], + -- useairlos = true, + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 7, + particlelifespread = 14, + particlesize = 4, + particlesizespread = 12, + particlespeed = 0.7, + particlespeedspread = 7, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.55, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.3 0.3 0.32 0.006 0.3 0.3 0.32 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 6, + particlelife = 12, + particlelifespread = 13, + particlesize = 1.1, + particlesizespread = 12, + particlespeed = [[1.8 i0.25]], + particlespeedspread = 2, + rotParams = [[-80 r160, -30 r60, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, - ["splash-tiny"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 10.9, - sizegrowth = 1.8, - ttl = 65, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 28, - particlesize = [[0.8 r1]], - particlesizespread = 0, - particlespeed = [[1.4 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.5]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - -- waterrush = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - -- directional = false, - -- emitrot = 1, - -- emitrotspread = 0, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.12, 0]], - -- numparticles = 1, - -- particlelife = 35, - -- particlelifespread = 60, - -- particlesize = [[10 r25]], - -- particlesizespread = 30, - -- particlespeed = [[5 i0.7]], - -- particlespeedspread = 0, - -- pos = [[0, 50 r50, 0]], - -- sizegrowth = [[0.7]], - -- sizemod = 1, - -- texture = [[waterrush]], - -- useairlos = true, - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.90, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 4, - particlelife = 8, - particlelifespread = 16, - particlesize = 4, - particlesizespread = 12, - particlespeed = 0.8, - particlespeedspread = 8, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.55, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.3 0.3 0.32 0.006 0.3 0.3 0.32 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 8, - particlelife = 13, - particlelifespread = 13, - particlesize = 1.5, - particlesizespread = 12, - particlespeed = [[1.8 i0.25]], - particlespeedspread = 2, - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, + ["splash-tiny"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 10.9, + sizegrowth = 1.8, + ttl = 65, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 28, + particlesize = [[0.8 r1]], + particlesizespread = 0, + particlespeed = [[1.4 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.5]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + -- waterrush = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + -- directional = false, + -- emitrot = 1, + -- emitrotspread = 0, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.12, 0]], + -- numparticles = 1, + -- particlelife = 35, + -- particlelifespread = 60, + -- particlesize = [[10 r25]], + -- particlesizespread = 30, + -- particlespeed = [[5 i0.7]], + -- particlespeedspread = 0, + -- pos = [[0, 50 r50, 0]], + -- sizegrowth = [[0.7]], + -- sizemod = 1, + -- texture = [[waterrush]], + -- useairlos = true, + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.90, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 8, + particlelifespread = 16, + particlesize = 4, + particlesizespread = 12, + particlespeed = 0.8, + particlespeedspread = 8, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.55, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.3 0.3 0.32 0.006 0.3 0.3 0.32 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 8, + particlelife = 13, + particlelifespread = 13, + particlesize = 1.5, + particlesizespread = 12, + particlespeed = [[1.8 i0.25]], + particlespeedspread = 2, + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, + ["splash-small"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 12.5, + sizegrowth = 2, + ttl = 65, + rotParams = [[-8 r16, -2 r4, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.94, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 4, + particlelifespread = 28, + particlesize = [[1 r2]], + particlesizespread = 0, + particlespeed = [[1.2 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + -- waterrush = { + -- air = false, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- airdrag = 0.97, + -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + -- directional = false, + -- emitrot = 1, + -- emitrotspread = 0, + -- emitvector = [[0, 1, 0]], + -- gravity = [[0, -0.12, 0]], + -- numparticles = 1, + -- particlelife = 35, + -- particlelifespread = 60, + -- particlesize = [[10 r25]], + -- particlesizespread = 30, + -- particlespeed = [[5 i0.7]], + -- particlespeedspread = 0, + -- pos = [[0, 50 r50, 0]], + -- sizegrowth = [[0.7]], + -- sizemod = 1, + -- texture = [[waterrush]], + -- useairlos = true, + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 11, + particlelifespread = 21, + particlesize = 6, + particlesizespread = 18, + particlespeed = 1, + particlespeedspread = 8, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.6, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 16, + particlespeed = [[2 i0.25]], + particlespeedspread = 2, + rotParams = [[-80 r160, -30 r60, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.25, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, - ["splash-small"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 12.5, - sizegrowth = 2, - ttl = 65, - rotParams = [[-8 r16, -2 r4, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.94, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 3, - particlelife = 4, - particlelifespread = 28, - particlesize = [[1 r2]], - particlesizespread = 0, - particlespeed = [[1.2 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - -- waterrush = { - -- air = false, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- airdrag = 0.97, - -- colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - -- directional = false, - -- emitrot = 1, - -- emitrotspread = 0, - -- emitvector = [[0, 1, 0]], - -- gravity = [[0, -0.12, 0]], - -- numparticles = 1, - -- particlelife = 35, - -- particlelifespread = 60, - -- particlesize = [[10 r25]], - -- particlesizespread = 30, - -- particlespeed = [[5 i0.7]], - -- particlespeedspread = 0, - -- pos = [[0, 50 r50, 0]], - -- sizegrowth = [[0.7]], - -- sizemod = 1, - -- texture = [[waterrush]], - -- useairlos = true, - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 8, - particlelife = 11, - particlelifespread = 21, - particlesize = 6, - particlesizespread = 18, - particlespeed = 1, - particlespeedspread = 8, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.6, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 10, - particlelife = 15, - particlelifespread = 15, - particlesize = 2, - particlesizespread = 16, - particlespeed = [[2 i0.25]], - particlespeedspread = 2, - rotParams = [[-80 r160, -30 r60, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.25, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, + ["splash-medium"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 16.9, + sizegrowth = 2, + ttl = 80, + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 5, + particlelifespread = 32, + particlesize = [[1 r3]], + particlesizespread = 0, + particlespeed = [[2 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 40, + particlesize = [[4 r16]], + particlesizespread = 16, + particlespeed = [[5 i0.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.7]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.93, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 18, + particlelifespread = 30, + particlesize = 7.5, + particlesizespread = 22, + particlespeed = 1.7, + particlespeedspread = 12, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 10, + particlelife = 16, + particlelifespread = 16, + particlesize = 3, + particlesizespread = 21, + particlespeed = [[2.6 i0.25]], + particlespeedspread = 2, + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, + ["splash-large"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 22.9, + sizegrowth = 2, + ttl = 90, + rotParams = [[-10 r20, -2 r4, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 5, + particlelifespread = 36, + particlesize = [[1.9 r4]], + particlesizespread = 0, + particlespeed = [[3 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 70, + particlesize = [[11 r25]], + particlesizespread = 30, + particlespeed = [[5 i0.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 18, + particlelife = 23, + particlelifespread = 33, + particlesize = 7.8, + particlesizespread = 25, + particlespeed = 1.8, + particlespeedspread = 12, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.45, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 11, + particlelife = 18, + particlelifespread = 18, + particlesize = 3.5, + particlesizespread = 23, + particlespeed = [[2.8 i0.25]], + particlespeedspread = 2, + rotParams = [[-100 r200, -0.5 r1, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, + ["splash-huge"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 32.9, + sizegrowth = 2, + ttl = 120, + rotParams = [[-10 r20, -2 r4, -180 r360]], + pos = [[0.5, 1, 0.0]], + }, + }, + brightwakefoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.65 0.65 0.65 0.85 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 40, + sidetexture = [[none]], + size = [[48 r30]], + sizegrowth = [[0.15 r0.7]], + ttl = [[120 r40]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 5, 0]], + alwaysvisible = true, + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.93, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 5, + particlelifespread = 40, + particlesize = [[2 r5]], + particlesizespread = 0, + particlespeed = [[3 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[r0.1, 1, r0.1]], + gravity = [[0, -0.12, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 75, + particlesize = [[15 r30]], + particlesizespread = 30, + particlespeed = [[6.8 i1.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 24, + particlelife = 25, + particlelifespread = 35, + particlesize = 8.5, + particlesizespread = 27, + particlespeed = 1.8, + particlespeedspread = 12, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.45, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 12, + particlelife = 24, + particlelifespread = 22, + particlesize = 3.8, + particlesizespread = 25, + particlespeed = [[4 i0.25]], + particlespeedspread = 2, + rotParams = [[-100 r200, -0.5 r1, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, - ["splash-medium"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 16.9, - sizegrowth = 2, - ttl = 80, - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 4, - particlelife = 5, - particlelifespread = 32, - particlesize = [[1 r3]], - particlesizespread = 0, - particlespeed = [[2 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 1, - particlelife = 15, - particlelifespread = 40, - particlesize = [[4 r16]], - particlesizespread = 16, - particlespeed = [[5 i0.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.7]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.93, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 10, - particlelife = 18, - particlelifespread = 30, - particlesize = 7.5, - particlesizespread = 22, - particlespeed = 1.7, - particlespeedspread = 12, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.3 0.3 0.32 0.008 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 10, - particlelife = 16, - particlelifespread = 16, - particlesize = 3, - particlesizespread = 21, - particlespeed = [[2.6 i0.25]], - particlespeedspread = 2, - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, + ["splash-gigantic"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 60, + sizegrowth = 2, + ttl = 120, + rotParams = [[-11 r22, -2 r4, -180 r360]], + pos = [[0.5, 1, 0.0]], + alwaysvisible = true, + }, + }, + brightwakefoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.65 0.65 0.65 0.85 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 40, + sidetexture = [[none]], + size = [[110 r65]], + sizegrowth = [[0.15 r0.7]], + ttl = [[120 r40]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 5, 0]], + alwaysvisible = true, + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 50, + particlelifespread = 80, + particlesize = [[6 r18]], + particlesizespread = 0, + particlespeed = [[1.8 i1.1]], + particlespeedspread = 1.2, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.78]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + alwaysvisible = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[r0.12, 0.7, r0.12]], + gravity = [[0, -0.07, 0]], + numparticles = 2, + particlelife = 50, + particlelifespread = 80, + particlesize = [[40 r70]], + particlesizespread = 100, + particlespeed = [[15 i1]], + particlespeedspread = 9, + pos = [[-100 r200, 100 r50, -100 r200]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 6, + emitrotspread = 12, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 9, + particlelife = 65, + particlelifespread = 55, + particlesize = 28.5, + particlesizespread = 36, + particlespeed = 8, + particlespeedspread = 16, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.25, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = false, + emitrot = 25, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 11, + particlelife = 50, + particlelifespread = 42, + particlesize = 22, + particlesizespread = 55, + particlespeed = [[6 i0.95]], + particlespeedspread = 7, + rotParams = [[-100 r200, -10 r20, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + alwaysvisible = true, + }, + }, + shockwave = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 40, + sidetexture = [[none]], + size = 8, + sizegrowth = [[-25 r5]], + ttl = 24, + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + -- shockwave_slow = { + -- air = false, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[explosionwave]], + -- length = 0, + -- sidetexture = [[none]], + -- size = 28, + -- sizegrowth = [[-16 r4]], + -- ttl = 140, + -- pos = [[0, 0, 0]], + -- alwaysvisible = true, + -- }, + -- }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + air = true, + underwater = true, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 15, + particlelife = 50, + particlelifespread = 55, + particlesize = 27, + particlesizespread = 23.6, + particlespeed = 4, + particlespeedspread = 13, + rotParams = [[-25 r50, -7 r14, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.08, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.6 0.61 0.63 0.5 0.40 0.41 0.43 0.3 0.1 0.1 0.1 0.1 0 0 0 0.01]], + size = 200, + sizegrowth = 3, + ttl = 125, + texture = [[groundflashwhite]], + alwaysvisible = true, + }, + }, + }, - - ["splash-large"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 22.9, - sizegrowth = 2, - ttl = 90, - rotParams = [[-10 r20, -2 r4, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 5, - particlelifespread = 36, - particlesize = [[1.9 r4]], - particlesizespread = 0, - particlespeed = [[3 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 70, - particlesize = [[11 r25]], - particlesizespread = 30, - particlespeed = [[5 i0.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 18, - particlelife = 23, - particlelifespread = 33, - particlesize = 7.8, - particlesizespread = 25, - particlespeed = 1.8, - particlespeedspread = 12, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.45, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 11, - particlelife = 18, - particlelifespread = 18, - particlesize = 3.5, - particlesizespread = 23, - particlespeed = [[2.8 i0.25]], - particlespeedspread = 2, - rotParams = [[-100 r200, -0.5 r1, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, - - ["splash-huge"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 32.9, - sizegrowth = 2, - ttl = 120, - rotParams = [[-10 r20, -2 r4, -180 r360]], - pos = [[0.5, 1, 0.0]], - }, - }, - brightwakefoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.65 0.65 0.65 0.85 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 40, - sidetexture = [[none]], - size = [[48 r30]], - sizegrowth = [[0.15 r0.7]], - ttl = [[120 r40]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 5, 0]], - alwaysvisible = true, - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.93, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 6, - particlelife = 5, - particlelifespread = 40, - particlesize = [[2 r5]], - particlesizespread = 0, - particlespeed = [[3 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[r0.1, 1, r0.1]], - gravity = [[0, -0.12, 0]], - numparticles = 1, - particlelife = 45, - particlelifespread = 75, - particlesize = [[15 r30]], - particlesizespread = 30, - particlespeed = [[6.8 i1.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 24, - particlelife = 25, - particlelifespread = 35, - particlesize = 8.5, - particlesizespread = 27, - particlespeed = 1.8, - particlespeedspread = 12, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.45, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 12, - particlelife = 24, - particlelifespread = 22, - particlesize = 3.8, - particlesizespread = 25, - particlespeed = [[4 i0.25]], - particlespeedspread = 2, - rotParams = [[-100 r200, -0.5 r1, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, - - ["splash-gigantic"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 60, - sizegrowth = 2, - ttl = 120, - rotParams = [[-11 r22, -2 r4, -180 r360]], - pos = [[0.5, 1, 0.0]], - alwaysvisible = true, - }, - }, - brightwakefoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.65 0.65 0.65 0.85 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 40, - sidetexture = [[none]], - size = [[110 r65]], - sizegrowth = [[0.15 r0.7]], - ttl = [[120 r40]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 5, 0]], - alwaysvisible = true, - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 10, - particlelife = 50, - particlelifespread = 80, - particlesize = [[6 r18]], - particlesizespread = 0, - particlespeed = [[1.8 i1.1]], - particlespeedspread = 1.2, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.78]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - alwaysvisible = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[r0.12, 0.7, r0.12]], - gravity = [[0, -0.07, 0]], - numparticles = 2, - particlelife = 50, - particlelifespread = 80, - particlesize = [[40 r70]], - particlesizespread = 100, - particlespeed = [[15 i1]], - particlespeedspread = 9, - pos = [[-100 r200, 100 r50, -100 r200]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 6, - emitrotspread = 12, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 9, - particlelife = 65, - particlelifespread = 55, - particlesize = 28.5, - particlesizespread = 36, - particlespeed = 8, - particlespeedspread = 16, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.25, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = false, - emitrot = 25, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 11, - particlelife = 50, - particlelifespread = 42, - particlesize = 22, - particlesizespread = 55, - particlespeed = [[6 i0.95]], - particlespeedspread = 7, - rotParams = [[-100 r200, -10 r20, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - alwaysvisible = true, - }, - }, - shockwave = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 40, - sidetexture = [[none]], - size = 8, - sizegrowth = [[-25 r5]], - ttl = 24, - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - -- shockwave_slow = { - -- air = false, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[explosionwave]], - -- length = 0, - -- sidetexture = [[none]], - -- size = 28, - -- sizegrowth = [[-16 r4]], - -- ttl = 140, - -- pos = [[0, 0, 0]], - -- alwaysvisible = true, - -- }, - -- }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - air = true, - underwater = true, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.15, 0]], - numparticles = 15, - particlelife = 50, - particlelifespread = 55, - particlesize = 27, - particlesizespread = 23.6, - particlespeed = 4, - particlespeedspread = 13, - rotParams = [[-25 r50, -7 r14, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.08, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.6 0.61 0.63 0.5 0.40 0.41 0.43 0.3 0.1 0.1 0.1 0.1 0 0 0 0.01]], - size = 200, - sizegrowth = 3, - ttl = 125, - texture = [[groundflashwhite]], - alwaysvisible = true, - }, - }, - }, - - ["splash-nuke"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 140.9, - sizegrowth = 2, - ttl = 160, - pos = [[0.5, 1, 0.0]], - alwaysvisible = true, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.90 0.97 0.99 0.8 0.18 0.23 0.30 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 900, - sizegrowth = [[0.1 r0.2]], - ttl = 15, - pos = [[0, 70, 0]], - - }, - }, - brightwake = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.5 0.5 0.45 0.35 0.15 0.15 0.12 0.15 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 40, - sidetexture = [[none]], - size = [[180 r280]], - sizegrowth = [[0.15 r0.7]], - ttl = [[80 r60]], - pos = [[0, 5, 0]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - alwaysvisible = true, - }, - }, - brightwakefoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.6 0.6 0.6 0.8 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 40, - sidetexture = [[none]], - size = [[300 r110]], - sizegrowth = [[0.15 r0.7]], - ttl = [[110 r40]], - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - pos = [[0, 5, 0]], - alwaysvisible = true, - }, - }, - brightwakewave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.4 0.4 0.4 0.5 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 40, - sidetexture = [[none]], - size = [[90 r200]], - sizegrowth = [[0.15 r0.7]], - ttl = [[110 r40]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 20, - particlelife = 80, - particlelifespread = 110, - particlesize = [[9 r25]], - particlesizespread = 0, - particlespeed = [[3.2 i1.7]], - particlespeedspread = 1.7, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.78]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - alwaysvisible = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[r0.12, 0.7, r0.12]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 100, - particlelifespread = 120, - particlesize = [[95 r120]], - particlesizespread = 120, - particlespeed = [[18.8 i1]], - particlespeedspread = 10, - pos = [[-130 r260, 110 r60, -130 r260]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.96, - colormap = [[0.44 0.44 0.48 0.020 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 6, - emitrotspread = 12, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 26, - particlelife = 80, - particlelifespread = 65, - particlesize = 34, - particlesizespread = 38, - particlespeed = 12.8, - particlespeedspread = 24, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.25, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - alwaysvisible = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.6 0.6 0.58 0.009 0.40 0.4 0.38 0.013 0.1 0.1 0.08 0.006 0 0 0 0.01]], - directional = true, - emitrot = 25, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.06, 0]], - numparticles = 20, - particlelife = 90, - particlelifespread = 40, - particlesize = 42.8, - particlesizespread = 90, - particlespeed = [[8 i0.95]], - particlespeedspread = 8, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - alwaysvisible = true, - }, - }, - -- shockwave = { - -- air = false, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = true, - -- water = true, - -- properties = { - -- colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 40, - -- sidetexture = [[none]], - -- size = 12, - -- sizegrowth = [[-29 r6]], - -- ttl = 38, - -- pos = [[0, 5, 0]], - -- alwaysvisible = true, - -- }, - -- }, - shockwave_slow = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 0, - sidetexture = [[none]], - size = 32, - sizegrowth = [[-18 r5]], - ttl = 170, - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 3, - ground = true, - air = true, - underwater = true, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 8, - particlelife = 70, - particlelifespread = 75, - particlesize = 36, - particlesizespread = 39, - particlespeed = 6, - particlespeedspread = 15, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.08, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.6 0.61 0.63 0.7 0.40 0.41 0.43 0.5 0.1 0.1 0.1 0.2 0 0 0 0.01]], - size = 280, - sizegrowth = 3, - ttl = 145, - texture = [[groundflashwhite]], - alwaysvisible = true, - }, - }, - }, - ["splash-nukexl"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 190.9, - sizegrowth = 2, - ttl = 170, - pos = [[0.5, 1, 0.0]], - alwaysvisible = true, - }, - }, - brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.90 0.97 0.99 0.8 0.18 0.23 0.30 0.5 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 1100, - sizegrowth = [[0.1 r0.2]], - ttl = 15, - pos = [[0, 10, 0]], - }, - }, - brightwake = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.5 0.5 0.45 0.4 0.15 0.15 0.12 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 40, - sidetexture = [[none]], - size = [[280 r340]], - sizegrowth = [[0.15 r0.7]], - ttl = [[90 r70]], - pos = [[0, 5, 0]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], - }, - }, - brightwakefoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.6 0.6 0.6 0.8 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 40, - sidetexture = [[none]], - size = [[400 r120]], - sizegrowth = [[0.15 r0.7]], - ttl = [[120 r40]], - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -0.5 r1, -180 r360]], - alwaysvisible = true, - }, - }, - brightwakewave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0 0 0 0 0.4 0.4 0.4 0.5 0.15 0.15 0.15 0.2 0 0 0 0]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 40, - sidetexture = [[none]], - size = [[120 r240]], - sizegrowth = [[0.15 r0.7]], - ttl = [[110 r40]], - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 20, - particlelife = 80, - particlelifespread = 110, - particlesize = [[12 r27]], - particlesizespread = 0, - particlespeed = [[3.5 i1.9]], - particlespeedspread = 1.9, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.78]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - alwaysvisible = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[r0.12, 0.7, r0.12]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 100, - particlelifespread = 140, - particlesize = [[120 r140]], - particlesizespread = 140, - particlespeed = [[25.8 i1]], - particlespeedspread = 15, - pos = [[-130 r260, 110 r60, -130 r260]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - alwaysvisible = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.66 0.66 0.62 0.020 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 12, - emitrotspread = 12, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 26, - particlelife = 90, - particlelifespread = 65, - particlesize = 80, - particlesizespread = 80, - particlespeed = 16.8, - particlespeedspread = 26, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.25, - sizemod = 0.99, - texture = [[gunshotxl2]], - useairlos = false, - alwaysvisible = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.952, - colormap = [[0.6 0.6 0.58 0.009 0.40 0.4 0.38 0.013 0.1 0.1 0.08 0.006 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = [[-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.045, 0]], - numparticles = 24, - particlelife = 110, - particlelifespread = 45, - particlesize = 60, - particlesizespread = 150, - particlespeed = [[11 i1.95]], - particlespeedspread = 10, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - alwaysvisible = true, - }, - }, - shockwave = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.011 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 40, - sidetexture = [[none]], - size = 20, - sizegrowth = [[-22 r6]], - ttl = 20, - pos = [[0, 5, 0]], - alwaysvisible = true, - }, - }, - shockwave_slow = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.008 0.1 0.1 0.1 0.005 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 0, - sidetexture = [[none]], - size = 50, - sizegrowth = [[-18 r5]], - ttl = 220, - pos = [[0, 0, 0]], - alwaysvisible = true, - }, - }, - dirt = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - air = true, - underwater = true, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 7, - particlelife = 80, - particlelifespread = 85, - particlesize = 39, - particlesizespread = 42, - particlespeed = 6, - particlespeedspread = 15, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.08, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.8 0.8 0.7 0.8 0.40 0.41 0.43 0.5 0.1 0.1 0.1 0.2 0 0 0 0.01]], - size = 520, - sizegrowth = 5, - ttl = 220, - texture = [[groundflashwhite]], - alwaysvisible = true, - }, - }, - }, + ["splash-nuke"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 140.9, + sizegrowth = 2, + ttl = 160, + pos = [[0.5, 1, 0.0]], + alwaysvisible = true, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.90 0.97 0.99 0.8 0.18 0.23 0.30 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 900, + sizegrowth = [[0.1 r0.2]], + ttl = 15, + pos = [[0, 70, 0]], + }, + }, + brightwake = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.5 0.5 0.45 0.35 0.15 0.15 0.12 0.15 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 40, + sidetexture = [[none]], + size = [[180 r280]], + sizegrowth = [[0.15 r0.7]], + ttl = [[80 r60]], + pos = [[0, 5, 0]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + alwaysvisible = true, + }, + }, + brightwakefoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.6 0.6 0.6 0.8 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 40, + sidetexture = [[none]], + size = [[300 r110]], + sizegrowth = [[0.15 r0.7]], + ttl = [[110 r40]], + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + pos = [[0, 5, 0]], + alwaysvisible = true, + }, + }, + brightwakewave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.4 0.4 0.4 0.5 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 40, + sidetexture = [[none]], + size = [[90 r200]], + sizegrowth = [[0.15 r0.7]], + ttl = [[110 r40]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 80, + particlelifespread = 110, + particlesize = [[9 r25]], + particlesizespread = 0, + particlespeed = [[3.2 i1.7]], + particlespeedspread = 1.7, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.78]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + alwaysvisible = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[r0.12, 0.7, r0.12]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 100, + particlelifespread = 120, + particlesize = [[95 r120]], + particlesizespread = 120, + particlespeed = [[18.8 i1]], + particlespeedspread = 10, + pos = [[-130 r260, 110 r60, -130 r260]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.96, + colormap = [[0.44 0.44 0.48 0.020 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 6, + emitrotspread = 12, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 26, + particlelife = 80, + particlelifespread = 65, + particlesize = 34, + particlesizespread = 38, + particlespeed = 12.8, + particlespeedspread = 24, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.25, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + alwaysvisible = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.6 0.6 0.58 0.009 0.40 0.4 0.38 0.013 0.1 0.1 0.08 0.006 0 0 0 0.01]], + directional = true, + emitrot = 25, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.06, 0]], + numparticles = 20, + particlelife = 90, + particlelifespread = 40, + particlesize = 42.8, + particlesizespread = 90, + particlespeed = [[8 i0.95]], + particlespeedspread = 8, + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + alwaysvisible = true, + }, + }, + -- shockwave = { + -- air = false, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = true, + -- water = true, + -- properties = { + -- colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 40, + -- sidetexture = [[none]], + -- size = 12, + -- sizegrowth = [[-29 r6]], + -- ttl = 38, + -- pos = [[0, 5, 0]], + -- alwaysvisible = true, + -- }, + -- }, + shockwave_slow = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 0, + sidetexture = [[none]], + size = 32, + sizegrowth = [[-18 r5]], + ttl = 170, + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 3, + ground = true, + air = true, + underwater = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 8, + particlelife = 70, + particlelifespread = 75, + particlesize = 36, + particlesizespread = 39, + particlespeed = 6, + particlespeedspread = 15, + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.08, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.6 0.61 0.63 0.7 0.40 0.41 0.43 0.5 0.1 0.1 0.1 0.2 0 0 0 0.01]], + size = 280, + sizegrowth = 3, + ttl = 145, + texture = [[groundflashwhite]], + alwaysvisible = true, + }, + }, + }, + ["splash-nukexl"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 190.9, + sizegrowth = 2, + ttl = 170, + pos = [[0.5, 1, 0.0]], + alwaysvisible = true, + }, + }, + brightflare = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.90 0.97 0.99 0.8 0.18 0.23 0.30 0.5 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 1100, + sizegrowth = [[0.1 r0.2]], + ttl = 15, + pos = [[0, 10, 0]], + }, + }, + brightwake = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.5 0.5 0.45 0.4 0.15 0.15 0.12 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[wake]], + length = 40, + sidetexture = [[none]], + size = [[280 r340]], + sizegrowth = [[0.15 r0.7]], + ttl = [[90 r70]], + pos = [[0, 5, 0]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], + }, + }, + brightwakefoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.6 0.6 0.6 0.8 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 40, + sidetexture = [[none]], + size = [[400 r120]], + sizegrowth = [[0.15 r0.7]], + ttl = [[120 r40]], + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -0.5 r1, -180 r360]], + alwaysvisible = true, + }, + }, + brightwakewave = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0 0 0 0 0.4 0.4 0.4 0.5 0.15 0.15 0.15 0.2 0 0 0 0]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 40, + sidetexture = [[none]], + size = [[120 r240]], + sizegrowth = [[0.15 r0.7]], + ttl = [[110 r40]], + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.98, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 80, + particlelifespread = 110, + particlesize = [[12 r27]], + particlesizespread = 0, + particlespeed = [[3.5 i1.9]], + particlespeedspread = 1.9, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.78]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + alwaysvisible = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0.005 0.3 0.3 0.3 .011 0.25 .25 0.25 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[r0.12, 0.7, r0.12]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 100, + particlelifespread = 140, + particlesize = [[120 r140]], + particlesizespread = 140, + particlespeed = [[25.8 i1]], + particlespeedspread = 15, + pos = [[-130 r260, 110 r60, -130 r260]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + alwaysvisible = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.66 0.66 0.62 0.020 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 12, + emitrotspread = 12, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 26, + particlelife = 90, + particlelifespread = 65, + particlesize = 80, + particlesizespread = 80, + particlespeed = 16.8, + particlespeedspread = 26, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.25, + sizemod = 0.99, + texture = [[gunshotxl2]], + useairlos = false, + alwaysvisible = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.952, + colormap = [[0.6 0.6 0.58 0.009 0.40 0.4 0.38 0.013 0.1 0.1 0.08 0.006 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = [[-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.045, 0]], + numparticles = 24, + particlelife = 110, + particlelifespread = 45, + particlesize = 60, + particlesizespread = 150, + particlespeed = [[11 i1.95]], + particlespeedspread = 10, + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + alwaysvisible = true, + }, + }, + shockwave = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.011 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 40, + sidetexture = [[none]], + size = 20, + sizegrowth = [[-22 r6]], + ttl = 20, + pos = [[0, 5, 0]], + alwaysvisible = true, + }, + }, + shockwave_slow = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.008 0.1 0.1 0.1 0.005 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 0, + sidetexture = [[none]], + size = 50, + sizegrowth = [[-18 r5]], + ttl = 220, + pos = [[0, 0, 0]], + alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + air = true, + underwater = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 7, + particlelife = 80, + particlelifespread = 85, + particlesize = 39, + particlesizespread = 42, + particlespeed = 6, + particlespeedspread = 15, + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.08, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.8 0.8 0.7 0.8 0.40 0.41 0.43 0.5 0.1 0.1 0.1 0.2 0 0 0 0.01]], + size = 520, + sizegrowth = 5, + ttl = 220, + texture = [[groundflashwhite]], + alwaysvisible = true, + }, + }, + }, } return definitions diff --git a/effects/storage_leak.lua b/effects/storage_leak.lua index 80614f297b7..2aa24150f55 100644 --- a/effects/storage_leak.lua +++ b/effects/storage_leak.lua @@ -1,195 +1,194 @@ return { - ["energy_storage_leak"] = { - Spawner = { - air = true, - class = [[CExpGenSpawner]], - count = 10, - ground = true, - water = true, - unit = 0, - properties = { - delay = [[0 i2]], - explosiongenerator = [[custom:energy_leak]], - pos = [[0, 0, 0]], - }, - }, - }, - ["energy_leak"] = { - unit_sparkles = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = 1, - water = true, - properties = { - airdrag = 0.95, - colormap = [[0 0 0 0 0.5 0.5 0.8 0.2 0.8 0.8 0.8 0.4 0.3 0.3 0.7 0.2 0.1 0.1 0.1 0.1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 270, - emitvector = [[0, -1, 0]], - gravity = [[0,0,0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 8, - particlesize = 12, - particlesizespread = 22, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = 1.15, - sizemod = -1.0, - texture = [[lightb]], - }, - }, - }, - ["metal_storage_leak"] = { - Spawner = { - air = true, - class = [[CExpGenSpawner]], - count = 6, - ground = true, - water = true, - unit = 0, - properties = { - delay = [[0 i6]], - explosiongenerator = [[custom:metal_storage]], - pos = [[-15 r30, 0, -15 r30]], - - }, - }, - }, - ["metal_storage"] = { - smokecloud = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 0, - water = true, - properties = { - airdrag = 0.83, - colormap = [[0.6 0.3 0 0.8 0.1 0.1 0.1 0.8 0.1 0.1 0.1 0.8 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[0 r360 r-360]], - emitvector = [[0,1,0]], - gravity = [[0, 0.1, 0]], - numparticles = 28, - particlelife = 24, - particlelifespread = 30, - particlesize = 5, - particlesizespread = 25, - particlespeed = [[2 i0.25]], - particlespeedspread = 4, - pos = [[0, 0, 0]], - sizegrowth = -0.35, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - Spawner = { - air = true, - class = [[CExpGenSpawner]], - count = 4, - ground = true, - water = true, - unit = 0, - properties = { - delay = [[0 i5]], - explosiongenerator = [[custom:metal_leak]], - pos = [[0, 0, 0]], - }, - }, - explosionball = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.92, - colormap = [[1 0.5 0 .2 0.9 0.8 0.7 0.5 0.6 0.3 0 .1 0 0 0 0.01]], - directional = true, - emitrot = 0, - emitrotspread = 360, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 4, - particlelife = 22, - particlelifespread = 4, - particlesize = 2, - particlesizespread = 8, - particlespeed = [[0 r0.2 i-0.05]], - particlespeedspread = 1.5, - pos = [[0, 5, 0]], - sizegrowth = [[0.50 r-.50]], - sizemod = 1.0, - texture = [[firenovaexplo]], - useairlos = true, - }, - }, - }, - ["metal_leak"] = { - spark = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = 0, - water = false, - properties = { - airdrag = 0.86, - colormap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], - directional = true, - emitrot = 0, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.25 r0.15 r-1, 0]], - numparticles = 4, - particlelife = 11, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 2, - particlespeed = 5, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = [[0.0 r-.2]], - sizemod = 1.0, - texture = [[shard1]], - useairlos = true, - }, - }, - shards1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - unit = 0, - water = false, - properties = { - airdrag = 0.86, - colormap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], - directional = true, - emitrot = 0, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.25 r0.15 r-1, 0]], - numparticles = 9, - particlelife = 11, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 2, - particlespeed = 5, - particlespeedspread = 3, - pos = [[0, 0, 0]], - sizegrowth = [[0.0 r-.2]], - sizemod = 1.0, - texture = [[shard2]], - useairlos = true, - }, - }, - }, + ["energy_storage_leak"] = { + Spawner = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + unit = 0, + properties = { + delay = [[0 i2]], + explosiongenerator = [[custom:energy_leak]], + pos = [[0, 0, 0]], + }, + }, + }, + ["energy_leak"] = { + unit_sparkles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = 1, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0 0.5 0.5 0.8 0.2 0.8 0.8 0.8 0.4 0.3 0.3 0.7 0.2 0.1 0.1 0.1 0.1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 270, + emitvector = [[0, -1, 0]], + gravity = [[0,0,0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 8, + particlesize = 12, + particlesizespread = 22, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 1.15, + sizemod = -1.0, + texture = [[lightb]], + }, + }, + }, + ["metal_storage_leak"] = { + Spawner = { + air = true, + class = [[CExpGenSpawner]], + count = 6, + ground = true, + water = true, + unit = 0, + properties = { + delay = [[0 i6]], + explosiongenerator = [[custom:metal_storage]], + pos = [[-15 r30, 0, -15 r30]], + }, + }, + }, + ["metal_storage"] = { + smokecloud = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 0, + water = true, + properties = { + airdrag = 0.83, + colormap = [[0.6 0.3 0 0.8 0.1 0.1 0.1 0.8 0.1 0.1 0.1 0.8 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[0 r360 r-360]], + emitvector = [[0,1,0]], + gravity = [[0, 0.1, 0]], + numparticles = 28, + particlelife = 24, + particlelifespread = 30, + particlesize = 5, + particlesizespread = 25, + particlespeed = [[2 i0.25]], + particlespeedspread = 4, + pos = [[0, 0, 0]], + sizegrowth = -0.35, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + Spawner = { + air = true, + class = [[CExpGenSpawner]], + count = 4, + ground = true, + water = true, + unit = 0, + properties = { + delay = [[0 i5]], + explosiongenerator = [[custom:metal_leak]], + pos = [[0, 0, 0]], + }, + }, + explosionball = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[1 0.5 0 .2 0.9 0.8 0.7 0.5 0.6 0.3 0 .1 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 360, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 22, + particlelifespread = 4, + particlesize = 2, + particlesizespread = 8, + particlespeed = [[0 r0.2 i-0.05]], + particlespeedspread = 1.5, + pos = [[0, 5, 0]], + sizegrowth = [[0.50 r-.50]], + sizemod = 1.0, + texture = [[firenovaexplo]], + useairlos = true, + }, + }, + }, + ["metal_leak"] = { + spark = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = 0, + water = false, + properties = { + airdrag = 0.86, + colormap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], + directional = true, + emitrot = 0, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.25 r0.15 r-1, 0]], + numparticles = 4, + particlelife = 11, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 2, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = [[0.0 r-.2]], + sizemod = 1.0, + texture = [[shard1]], + useairlos = true, + }, + }, + shards1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = 0, + water = false, + properties = { + airdrag = 0.86, + colormap = [[0.6 0.6 0.6 1 0.2 0.2 0.2 1]], + directional = true, + emitrot = 0, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.25 r0.15 r-1, 0]], + numparticles = 9, + particlelife = 11, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 2, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = [[0.0 r-.2]], + sizemod = 1.0, + texture = [[shard2]], + useairlos = true, + }, + }, + }, } diff --git a/effects/tachyoneffects.lua b/effects/tachyoneffects.lua index cdf102c329c..97ff738908d 100644 --- a/effects/tachyoneffects.lua +++ b/effects/tachyoneffects.lua @@ -1,167 +1,167 @@ -- Tachyon Effects return { - ["tachyonshot"] = { - -- fire = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.4 0.6 1 0.013 0.06 0.22 0.6 0.01 0.015 0.07 0.4 0.006 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[shotgunflare]], - -- length = 90, - -- sidetexture = [[shotgunside]], - -- size = 30.9, - -- sizegrowth = -0.5, - -- ttl = 10, - -- pos = [[0.0, 0, 0.0]], - -- }, - -- }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.80 1 0.95 0.4 0.65 1 0.7 0.1 0.2 0.7 0.08 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 220, - sidetexture = [[gunshotxl2]], - size = 90, - sizegrowth = 0.7, - ttl = 32, - --rotParams = [[-120 r240, -40 r80, -180 r360]], - pos = [[0, 0, 0]], - }, - }, - spawnlightning = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.80 0.80 1 0.5 0.80 0.80 1 0.2 0.2 0.2 0.6 0.08 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.1, - fronttexture = [[bubbletexture]], - length = 50, - sidetexture = [[lightning]], - size = 3, - sizegrowth = 5.0, - ttl = [[13 r5]], - rotParams = [[-360 r720, -240 r480, -180 r360]], - pos = [[0, 0, 0]], - }, - }, - spawnlightning2 = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0 0 0 0.01 0.90 0.92 1 0.5 0.80 0.85 1 0.2 0.2 0.3 0.6 0.08 0 0 0 0.01]], - dir = [[dir]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0.1, - fronttexture = [[none]], - length = 30, - sidetexture = [[lightninginair]], - size = 15, - sizegrowth = 3.0, - ttl = [[8 r6]], - rotParams = [[-180 r360, -240 r480, -180 r360]], - pos = [[0, 0, 0]], - }, - }, - -- groundflash_small = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - -- size = 56, - -- sizegrowth = -2, - -- ttl = 18, - -- texture = [[circlefx2]], - -- }, - -- }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 80, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - -- groundflash_white = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - -- size = 70, - -- sizegrowth = -1, - -- ttl = 5, - -- texture = [[groundflashwhite]], - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.1 0.13 0.56 0.96 0.017 0.21 0.51 0.92 0.011 0 0 0 0.1]], - directional = true, - emitrot = 1, - emitrotspread = 3, - emitvector = [[dir]], - gravity = [[0, 0, 0]], - numparticles = 5, - particlelife = 24, - particlelifespread = 32, - particlesize = 20, - particlesizespread = 24, - particlespeed = 1, - particlespeedspread = 6, - rotParams = [[200 r40, -180, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 0.6, - sizemod = 0.90, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["tachyonshot"] = { + -- fire = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.4 0.6 1 0.013 0.06 0.22 0.6 0.01 0.015 0.07 0.4 0.006 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[shotgunflare]], + -- length = 90, + -- sidetexture = [[shotgunside]], + -- size = 30.9, + -- sizegrowth = -0.5, + -- ttl = 10, + -- pos = [[0.0, 0, 0.0]], + -- }, + -- }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.80 1 0.95 0.4 0.65 1 0.7 0.1 0.2 0.7 0.08 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 220, + sidetexture = [[gunshotxl2]], + size = 90, + sizegrowth = 0.7, + ttl = 32, + --rotParams = [[-120 r240, -40 r80, -180 r360]], + pos = [[0, 0, 0]], + }, + }, + spawnlightning = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.80 0.80 1 0.5 0.80 0.80 1 0.2 0.2 0.2 0.6 0.08 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.1, + fronttexture = [[bubbletexture]], + length = 50, + sidetexture = [[lightning]], + size = 3, + sizegrowth = 5.0, + ttl = [[13 r5]], + rotParams = [[-360 r720, -240 r480, -180 r360]], + pos = [[0, 0, 0]], + }, + }, + spawnlightning2 = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0 0 0 0.01 0.90 0.92 1 0.5 0.80 0.85 1 0.2 0.2 0.3 0.6 0.08 0 0 0 0.01]], + dir = [[dir]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0.1, + fronttexture = [[none]], + length = 30, + sidetexture = [[lightninginair]], + size = 15, + sizegrowth = 3.0, + ttl = [[8 r6]], + rotParams = [[-180 r360, -240 r480, -180 r360]], + pos = [[0, 0, 0]], + }, + }, + -- groundflash_small = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + -- size = 56, + -- sizegrowth = -2, + -- ttl = 18, + -- texture = [[circlefx2]], + -- }, + -- }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 80, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + -- groundflash_white = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + -- size = 70, + -- sizegrowth = -1, + -- ttl = 5, + -- texture = [[groundflashwhite]], + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.1 0.13 0.56 0.96 0.017 0.21 0.51 0.92 0.011 0 0 0 0.1]], + directional = true, + emitrot = 1, + emitrotspread = 3, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 24, + particlelifespread = 32, + particlesize = 20, + particlesizespread = 24, + particlespeed = 1, + particlespeedspread = 6, + rotParams = [[200 r40, -180, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 0.6, + sizemod = 0.90, + texture = [[randdots]], + useairlos = false, + }, + }, + }, } diff --git a/effects/torpedo.lua b/effects/torpedo.lua index de867abba05..6628b8f79f3 100644 --- a/effects/torpedo.lua +++ b/effects/torpedo.lua @@ -1,158 +1,154 @@ local definitions = { - ["torpedotrail-tiny"] = { - trail = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.20 0.21 0.23 0.025 0 0 0 0.001]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[explowater]], - length = -2.7, - sidetexture = [[none]], - size = 1.8, - sizegrowth = 1.4, - ttl = 5, - rotParams = [[0, -50 r100, -20 r40]], - }, - }, - }, + ["torpedotrail-tiny"] = { + trail = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.20 0.21 0.23 0.025 0 0 0 0.001]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[explowater]], + length = -2.7, + sidetexture = [[none]], + size = 1.8, + sizegrowth = 1.4, + ttl = 5, + rotParams = [[0, -50 r100, -20 r40]], + }, + }, + }, + ["torpedotrail-small"] = { + trail = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.36 0.38 0.025 0.12 0.13 0.14 0.020 0 0 0 0.001]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[explowater]], + length = -3.2, + sidetexture = [[none]], + size = 1.6, + sizegrowth = 1.2, + ttl = 6, + rotParams = [[0, -50 r100, -20 r40]], + }, + }, + }, - ["torpedotrail-small"] = { - trail = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.35 0.36 0.38 0.025 0.12 0.13 0.14 0.020 0 0 0 0.001]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[explowater]], - length = -3.2, - sidetexture = [[none]], - size = 1.6, - sizegrowth = 1.2, - ttl = 6, - rotParams = [[0, -50 r100, -20 r40]], - }, - }, - }, + ["torpedotrail-large"] = { + trail = { + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.36 0.38 0.025 0.12 0.13 0.14 0.020 0 0 0 0.001]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[explowater]], + length = -3.2, + sidetexture = [[none]], + size = 1.8, + sizegrowth = 1.4, + ttl = 8, + rotParams = [[0, -50 r100, -20 r40]], + }, + }, + -- engine = { + -- air = false, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[1 0.7 0.9 0.01 0.6 0.6 1 0.01 0.4 0.4 1 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[none]], + -- length = [[-14 r4]], + -- sidetexture = [[muzzleside]], + -- size = 1.6, + -- sizegrowth = [[0.2 r0.3]], + -- ttl = 1, + -- }, + -- }, + -- sparks = { + -- air = true, + -- class = [[CSimpleParticleSystem]], + -- count = 1, + -- ground = true, + -- water = true, + -- underwater = 1, + -- properties = { + -- airdrag = 0.95, + -- colormap = [[0.3 0.3 0.4 0.01 0.15 0.15 0.2 0.007 0 0 0 0.01]], + -- directional = true, + -- emitrot = 45, + -- emitrotspread = 7, + -- emitvector = [[dir]], + -- gravity = [[0, 0, 0]], + -- numparticles = 1, + -- particlelife = 5, + -- particlelifespread = 2, + -- particlesize = 12, + -- particlesizespread = 24, + -- particlespeed = 4.5, + -- particlespeedspread = 3.5, + -- pos = [[0, 90 ,0]], + -- sizegrowth = 0.5, + -- sizemod = 0.99, + -- texture = [[gunshotglow]], + -- useairlos = false, + -- }, + -- }, + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.91, + colormap = [[0.25 0.25 0.25 .01 0.15 0.15 0.15 .01 0 0 0 0.01]], + directional = true, + emitrot = 180, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 22, + particlesize = 1.25, + particlesizespread = 1.85, + particlespeed = 0.2, + particlespeedspread = 0.1, + pos = [[-12 r24, 0 r10, -12 r24]], + sizegrowth = 0.02, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - ["torpedotrail-large"] = { - trail = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - colormap = [[0.35 0.36 0.38 0.025 0.12 0.13 0.14 0.020 0 0 0 0.001]], - dir = [[dir]], - frontoffset = 0, - fronttexture = [[explowater]], - length = -3.2, - sidetexture = [[none]], - size = 1.8, - sizegrowth = 1.4, - ttl = 8, - rotParams = [[0, -50 r100, -20 r40]], - }, - }, + -- ["torpedo-launch"] = { - -- engine = { - -- air = false, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[1 0.7 0.9 0.01 0.6 0.6 1 0.01 0.4 0.4 1 0.01 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[none]], - -- length = [[-14 r4]], - -- sidetexture = [[muzzleside]], - -- size = 1.6, - -- sizegrowth = [[0.2 r0.3]], - -- ttl = 1, - -- }, - -- }, - -- sparks = { - -- air = true, - -- class = [[CSimpleParticleSystem]], - -- count = 1, - -- ground = true, - -- water = true, - -- underwater = 1, - -- properties = { - -- airdrag = 0.95, - -- colormap = [[0.3 0.3 0.4 0.01 0.15 0.15 0.2 0.007 0 0 0 0.01]], - -- directional = true, - -- emitrot = 45, - -- emitrotspread = 7, - -- emitvector = [[dir]], - -- gravity = [[0, 0, 0]], - -- numparticles = 1, - -- particlelife = 5, - -- particlelifespread = 2, - -- particlesize = 12, - -- particlesizespread = 24, - -- particlespeed = 4.5, - -- particlespeedspread = 3.5, - -- pos = [[0, 90 ,0]], - -- sizegrowth = 0.5, - -- sizemod = 0.99, - -- texture = [[gunshotglow]], - -- useairlos = false, - -- }, - -- }, - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.91, - colormap = [[0.25 0.25 0.25 .01 0.15 0.15 0.15 .01 0 0 0 0.01]], - directional = true, - emitrot = 180, - emitrotspread = 5, - emitvector = [[dir]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = 2, - particlelife = 5, - particlelifespread = 22, - particlesize = 1.25, - particlesizespread = 1.85, - particlespeed = 0.2, - particlespeedspread = 0.1, - pos = [[-12 r24, 0 r10, -12 r24]], - sizegrowth = 0.02, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, - - - - -- ["torpedo-launch"] = { - - -- }, + -- }, } -return definitions \ No newline at end of file +return definitions diff --git a/effects/treeburn.lua b/effects/treeburn.lua index a1f40649b4c..efe1b360ed0 100644 --- a/effects/treeburn.lua +++ b/effects/treeburn.lua @@ -2,189 +2,185 @@ -- treeburn local definitions = { - ["treeburnexplode"] = { - -- groundflash = { - -- air = true, - -- circlealpha = 0.0, - -- circlegrowth = 6, - -- flashalpha = 0.16, - -- flashsize = 45, - -- ground = true, - -- ttl = 25, - -- underwater = 1, - -- water = true, - -- color = { - -- [1] = 1, - -- [2] = 0.15, - -- [3] = 0, - -- }, - -- }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.90, - colormap = [[1 1 0.4 0.08 1.0 0.66 0.2 0.06 1.0 0.55 0.0 0.01]], - directional = true, - emitrot = 14, - emitrotspread = 75, - emitvector = [[0 r0.2, 1, 0 r0.2]], - gravity = [[-0.1 r0.2, 0.4, -0.1 r0.2]], - numparticles = [[0.5 r1.51]], - particlelife = 9, - particlelifespread = 14, - particlesize = 15, - particlesizespread = 7, - particlespeed = 1, - particlespeedspread = 2, - pos = [[0, 20, 0]], - sizegrowth = 1.2, - sizemod = 0.80, - texture = [[gunshotglow]], - useairlos = true, - drawOrder = 1, - }, - }, - }, + ["treeburnexplode"] = { + -- groundflash = { + -- air = true, + -- circlealpha = 0.0, + -- circlegrowth = 6, + -- flashalpha = 0.16, + -- flashsize = 45, + -- ground = true, + -- ttl = 25, + -- underwater = 1, + -- water = true, + -- color = { + -- [1] = 1, + -- [2] = 0.15, + -- [3] = 0, + -- }, + -- }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.90, + colormap = [[1 1 0.4 0.08 1.0 0.66 0.2 0.06 1.0 0.55 0.0 0.01]], + directional = true, + emitrot = 14, + emitrotspread = 75, + emitvector = [[0 r0.2, 1, 0 r0.2]], + gravity = [[-0.1 r0.2, 0.4, -0.1 r0.2]], + numparticles = [[0.5 r1.51]], + particlelife = 9, + particlelifespread = 14, + particlesize = 15, + particlesizespread = 7, + particlespeed = 1, + particlespeedspread = 2, + pos = [[0, 20, 0]], + sizegrowth = 1.2, + sizemod = 0.80, + texture = [[gunshotglow]], + useairlos = true, + drawOrder = 1, + }, + }, + }, - - ["treeburn"] = { - flame = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - properties = { - airdrag = 0.93, - colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], - gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], - numparticles = 1, - particlelife = 18, - particlelifespread = 25, - particlesize = 3.0, - particlesizespread = 5.0, - particlespeed = 0.2, - particlespeedspread = 0.55, - pos = [[-5 r10, -5 r20, -5 r10]], - rotParams = [[-5 r10, 0, -180 r360]], - sizegrowth = [[2.0 r2.2]], - sizemod = 0.92, - animParams = [[16,6,40 r80]], - texture = [[BARFlame02]], - useairlos = true, - alwaysVisible = true, - drawOrder = 1, - }, - }, - }, + ["treeburn"] = { + flame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.93, + colormap = [[0.8 0.78 0.6 0.8 1.0 0.97 0.7 0.95 0.8 0.7 0.55 0.85 0.22 0.13 0.1 0.62 0.023 0.022 0.022 0.3 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.3 r0.1, 1, 0.3 r0.1]], + gravity = [[-0.09 r0.18, 0.06 r0.11, -0.09 r0.18]], + numparticles = 1, + particlelife = 18, + particlelifespread = 25, + particlesize = 3.0, + particlesizespread = 5.0, + particlespeed = 0.2, + particlespeedspread = 0.55, + pos = [[-5 r10, -5 r20, -5 r10]], + rotParams = [[-5 r10, 0, -180 r360]], + sizegrowth = [[2.0 r2.2]], + sizemod = 0.92, + animParams = [[16,6,40 r80]], + texture = [[BARFlame02]], + useairlos = true, + alwaysVisible = true, + drawOrder = 1, + }, + }, + }, } -- add different sizes -local root = 'treeburn' -definitions[root..'-medium'] = definitions[root] +local root = "treeburn" +definitions[root .. "-medium"] = definitions[root] local sizes = { - tiny = { - flame = { - count = 2, - properties = { - --numparticles = 2, - particlesize = 1.5, - particlesizespread = 2.5, - particlespeed = 0.07, - particlespeedspread = 0.13, - particlelifespread = 20, - pos = [[-5 r10, -1 r15, -5 r10]], - }, - }, - }, + tiny = { + flame = { + count = 2, + properties = { + --numparticles = 2, + particlesize = 1.5, + particlesizespread = 2.5, + particlespeed = 0.07, + particlespeedspread = 0.13, + particlelifespread = 20, + pos = [[-5 r10, -1 r15, -5 r10]], + }, + }, + }, - small = { - flame = { - count = 2, - properties = { - --numparticles = 2, - particlesize = 2.6, - particlesizespread = 3.2, - particlespeed = 0.13, - particlespeedspread = 0.25, - particlelifespread = 25, - pos = [[-7 r14, -1 r20, -7 r14]], - }, - }, - }, + small = { + flame = { + count = 2, + properties = { + --numparticles = 2, + particlesize = 2.6, + particlesizespread = 3.2, + particlespeed = 0.13, + particlespeedspread = 0.25, + particlelifespread = 25, + pos = [[-7 r14, -1 r20, -7 r14]], + }, + }, + }, - large = { - flame = { - count = 2, - properties = { - --numparticles = 2, - particlesize = 5.0, - particlesizespread = 6.5, - particlespeed = 0.35, - particlespeedspread = 0.75, - particlelifespread = 35, - pos = [[-15 r30, -4 r30, -15 r30]], - }, - }, - }, + large = { + flame = { + count = 2, + properties = { + --numparticles = 2, + particlesize = 5.0, + particlesizespread = 6.5, + particlespeed = 0.35, + particlespeedspread = 0.75, + particlelifespread = 35, + pos = [[-15 r30, -4 r30, -15 r30]], + }, + }, + }, } for size, effects in pairs(sizes) do - definitions[root..'-'..size] = table.merge(definitions[root], effects) + definitions[root .. "-" .. size] = table.merge(definitions[root], effects) end - - -root = 'treeburnexplode' -definitions[root..'-medium'] = definitions[root] +root = "treeburnexplode" +definitions[root .. "-medium"] = definitions[root] local sizes = { - tiny = { - -- groundflash = { - -- flashsize = 12, - -- }, - sparks = { - particlelife = 6, - particlelifespread = 8, - particlesizespread = 4, - particlespeed = 0.3, - emitrot = 8, - } - }, - small = { - -- groundflash = { - -- flashsize = 18, - -- }, - sparks = { - particlelife = 8, - particlelifespread = 11, - particlesizespread = 5, - particlespeed = 0.55, - emitrot = 11, - } - }, - large = { - -- groundflash = { - -- flashsize = 32, - -- }, - sparks = { - particlelife = 10, - particlelifespread = 18, - particlesizespread = 7, - particlespeed = 4, - emitrot = 19, - } - }, + tiny = { + -- groundflash = { + -- flashsize = 12, + -- }, + sparks = { + particlelife = 6, + particlelifespread = 8, + particlesizespread = 4, + particlespeed = 0.3, + emitrot = 8, + }, + }, + small = { + -- groundflash = { + -- flashsize = 18, + -- }, + sparks = { + particlelife = 8, + particlelifespread = 11, + particlesizespread = 5, + particlespeed = 0.55, + emitrot = 11, + }, + }, + large = { + -- groundflash = { + -- flashsize = 32, + -- }, + sparks = { + particlelife = 10, + particlelifespread = 18, + particlesizespread = 7, + particlespeed = 4, + emitrot = 19, + }, + }, } for size, effects in pairs(sizes) do - definitions[root..'-'..size] = table.merge(definitions[root], effects) + definitions[root .. "-" .. size] = table.merge(definitions[root], effects) end - return definitions diff --git a/effects/uieffects.lua b/effects/uieffects.lua index 6df89bfd643..66b8beda571 100644 --- a/effects/uieffects.lua +++ b/effects/uieffects.lua @@ -1,439 +1,439 @@ -- UI Effects return { - ["radarpulse_t1_slow"] = { + ["radarpulse_t1_slow"] = { - radarpulse = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, -0.4, 0.0]], - frontoffset = 0, - fronttexture = [[radarfx1]], - length = 45, - sidetexture = [[none]], - size = 12, - sizegrowth = 1.2, - ttl = 40, - pos = [[0, 0, 0]], - rotParams = [[-64, 27, -180 r360]], - useairlos = false, - }, - }, - }, + radarpulse = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, -0.4, 0.0]], + frontoffset = 0, + fronttexture = [[radarfx1]], + length = 45, + sidetexture = [[none]], + size = 12, + sizegrowth = 1.2, + ttl = 40, + pos = [[0, 0, 0]], + rotParams = [[-64, 27, -180 r360]], + useairlos = false, + }, + }, + }, - ["radarpulse_t1"] = { + ["radarpulse_t1"] = { - radarpulse = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, -0.4, 0.0]], - frontoffset = 0, - fronttexture = [[radarfx1]], - length = 45, - sidetexture = [[none]], - size = 16, - sizegrowth = 0.3, - ttl = 12, - pos = [[0, 5, 0]], - rotParams = [[-48, 32, -180 r360]], - useairlos = false, - }, - }, - }, + radarpulse = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, -0.4, 0.0]], + frontoffset = 0, + fronttexture = [[radarfx1]], + length = 45, + sidetexture = [[none]], + size = 16, + sizegrowth = 0.3, + ttl = 12, + pos = [[0, 5, 0]], + rotParams = [[-48, 32, -180 r360]], + useairlos = false, + }, + }, + }, - ["radarpulse_t1_short"] = { + ["radarpulse_t1_short"] = { - radarpulse = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0 0 0 0.01 0.03 0.30 0.03 0.01 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, -0.4, 0.0]], - frontoffset = 0, - fronttexture = [[radarfx1]], - length = 45, - sidetexture = [[none]], - size = 32, - sizegrowth = 1.0, - ttl = 8, - pos = [[0, 0, 0]], - rotParams = [[-48, 32, -180 r360]], - useairlos = false, - }, - }, - }, + radarpulse = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0 0 0 0.01 0.03 0.30 0.03 0.01 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, -0.4, 0.0]], + frontoffset = 0, + fronttexture = [[radarfx1]], + length = 45, + sidetexture = [[none]], + size = 32, + sizegrowth = 1.0, + ttl = 8, + pos = [[0, 0, 0]], + rotParams = [[-48, 32, -180 r360]], + useairlos = false, + }, + }, + }, --- Don't use _ground since groundflash in it discards airlos=false - -- ["radarpulse_t2_ground"] = { + -- Don't use _ground since groundflash in it discards airlos=false + -- ["radarpulse_t2_ground"] = { - -- groundflash_small = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0 0 0 0.01 0.21 0.71 0.21 0.6 0.21 0.71 0.21 0.2 0 0 0 0.01]], - -- size = 14, - -- sizegrowth = 0.7, - -- ttl = 30, - -- texture = [[radarfx2ground]], - -- useairlos = false, - -- }, - -- }, + -- groundflash_small = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0 0 0 0.01 0.21 0.71 0.21 0.6 0.21 0.71 0.21 0.2 0 0 0 0.01]], + -- size = 14, + -- sizegrowth = 0.7, + -- ttl = 30, + -- texture = [[radarfx2ground]], + -- useairlos = false, + -- }, + -- }, - -- radarpulse = { - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], - -- dir = [[0, 1, 0]], - -- --gravity = [[0.0, -0.4, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[radarfx2]], - -- length = 45, - -- sidetexture = [[none]], - -- size = 10, - -- sizegrowth = 1.8, - -- ttl = 20, - -- pos = [[0, -10, 0]], - -- }, - -- }, - -- }, + -- radarpulse = { + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], + -- dir = [[0, 1, 0]], + -- --gravity = [[0.0, -0.4, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[radarfx2]], + -- length = 45, + -- sidetexture = [[none]], + -- size = 10, + -- sizegrowth = 1.8, + -- ttl = 20, + -- pos = [[0, -10, 0]], + -- }, + -- }, + -- }, - ["radarpulse_t2"] = { + ["radarpulse_t2"] = { - radarpulse = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 0.05 0.30 0.03 0.01 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, -0.4, 0.0]], - frontoffset = 0, - fronttexture = [[radarfx2]], - length = 45, - sidetexture = [[none]], - size = 20, - sizegrowth = 0.2, - ttl = 32, - pos = [[0, 0, 0]], - rotParams = [[-48, 32, -180 r360]], - useairlos = false, - }, - }, - }, + radarpulse = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 0.05 0.30 0.03 0.01 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, -0.4, 0.0]], + frontoffset = 0, + fronttexture = [[radarfx2]], + length = 45, + sidetexture = [[none]], + size = 20, + sizegrowth = 0.2, + ttl = 32, + pos = [[0, 0, 0]], + rotParams = [[-48, 32, -180 r360]], + useairlos = false, + }, + }, + }, - ["radarpulse_t2_slow"] = { + ["radarpulse_t2_slow"] = { - radarpulse = { - class = [[CBitmapMuzzleFlame]], - count = 1, - air = true, - ground = true, - water = true, - underwater = true, - properties = { - colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, -0.4, 0.0]], - frontoffset = 0, - fronttexture = [[radarfx2]], - length = 45, - sidetexture = [[none]], - size = 15, - sizegrowth = 1.0, - ttl = 40, - pos = [[0, 0, 0]], - rotParams = [[-64, 27, -180 r360]], - useairlos = false, - }, - }, - }, + radarpulse = { + class = [[CBitmapMuzzleFlame]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 0.14 0.28 0.05 0.022 0.03 0.30 0.03 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, -0.4, 0.0]], + frontoffset = 0, + fronttexture = [[radarfx2]], + length = 45, + sidetexture = [[none]], + size = 15, + sizegrowth = 1.0, + ttl = 40, + pos = [[0, 0, 0]], + rotParams = [[-64, 27, -180 r360]], + useairlos = false, + }, + }, + }, - ["testceg-dir"] = { + ["testceg-dir"] = { - waterexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.0, - colormap = [[0.05 0.05 0.05 0.05 0.5 0.5 0.5 0.9 0.4 0.4 0.4 0.8 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 0, - --emitrotspread = [[20 r-20 r20]], - emitvector = [[0,0,0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 200, - particlelifespread = 0, - particlesize = 280, - particlesizespread = 0, - particlespeed = 0, - particlespeedspread = 0, - animParams = [[8,8,120]], - --rotParams = [[-5 r10, 0, 60 r90]], - pos = [[0, 0, 0]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[Cloud01-anim]], - useairlos = true, - alwaysvisible = true, - }, - }, - }, - ["testceg-fire"] = { - waterexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.0, - colormap = [[0.3 0.3 0.7 0.01 0.99 0.99 1 0.99 0.7 0.7 0.68 0.6 0.16 0.11 0.1 0.3 0.09 0.10 0.11 0.3 0 0 0 0.01]], - directional = false, - emitrot = 0, - --emitrotspread = [[20 r-20 r20]], - emitvector = [[0,0,0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 100, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 0, - particlespeed = 0, - particlespeedspread = 0, - animParams = [[8,8,120 r60]], - rotParams = [[-5 r10, -1 r2, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 10.6, - sizemod = 0.98, - texture = [[FireBall02-anim]], - useairlos = true, - alwaysvisible = true, - }, - }, - }, - ["testceg-fire-xs"] = { - aoeexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.0, - colormap = [[0.3 0.3 0.7 0.01 0.99 0.99 1 0.99 0.7 0.7 0.68 0.6 0.16 0.11 0.1 0.3 0.09 0.10 0.11 0.3 0 0 0 0.01]], - directional = false, - emitrot = 0, - --emitrotspread = [[20 r-20 r20]], - emitvector = [[0,0,0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 50, - particlelifespread = 0, - particlesize = 25, - particlesizespread = 0, - particlespeed = 0, - particlespeedspread = 0, - animParams = [[8,8,70 r30]], - rotParams = [[-5 r10, -1 r2, -180 r360]], - pos = [[0, 0, 0]], - sizegrowth = 12.0, - sizemod = 0.92, - texture = [[FireBall02-anim]], - useairlos = true, - alwaysvisible = true, - }, - }, - }, - ["testceg-nodir"] = { + waterexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.0, + colormap = [[0.05 0.05 0.05 0.05 0.5 0.5 0.5 0.9 0.4 0.4 0.4 0.8 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 0, + --emitrotspread = [[20 r-20 r20]], + emitvector = [[0,0,0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 200, + particlelifespread = 0, + particlesize = 280, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + animParams = [[8,8,120]], + --rotParams = [[-5 r10, 0, 60 r90]], + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[Cloud01-anim]], + useairlos = true, + alwaysvisible = true, + }, + }, + }, + ["testceg-fire"] = { + waterexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.0, + colormap = [[0.3 0.3 0.7 0.01 0.99 0.99 1 0.99 0.7 0.7 0.68 0.6 0.16 0.11 0.1 0.3 0.09 0.10 0.11 0.3 0 0 0 0.01]], + directional = false, + emitrot = 0, + --emitrotspread = [[20 r-20 r20]], + emitvector = [[0,0,0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 100, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + animParams = [[8,8,120 r60]], + rotParams = [[-5 r10, -1 r2, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 10.6, + sizemod = 0.98, + texture = [[FireBall02-anim]], + useairlos = true, + alwaysvisible = true, + }, + }, + }, + ["testceg-fire-xs"] = { + aoeexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.0, + colormap = [[0.3 0.3 0.7 0.01 0.99 0.99 1 0.99 0.7 0.7 0.68 0.6 0.16 0.11 0.1 0.3 0.09 0.10 0.11 0.3 0 0 0 0.01]], + directional = false, + emitrot = 0, + --emitrotspread = [[20 r-20 r20]], + emitvector = [[0,0,0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 50, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + animParams = [[8,8,70 r30]], + rotParams = [[-5 r10, -1 r2, -180 r360]], + pos = [[0, 0, 0]], + sizegrowth = 12.0, + sizemod = 0.92, + texture = [[FireBall02-anim]], + useairlos = true, + alwaysvisible = true, + }, + }, + }, + ["testceg-nodir"] = { - waterexplosion = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = false, - emitrot = 25, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 11, - particlelife = 120, - particlelifespread = 42, - particlesize = 22, - particlesizespread = 55, - particlespeed = [[6 i0.95]], - particlespeedspread = 7, - rotParams = [[-60.0 r120, 0.0, 0.0]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - alwaysvisible = true, - }, - }, - }, - ["testceg-muzzle"] = { + waterexplosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = false, + emitrot = 25, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 11, + particlelife = 120, + particlelifespread = 42, + particlesize = 22, + particlesizespread = 55, + particlespeed = [[6 i0.95]], + particlespeedspread = 7, + rotParams = [[-60.0 r120, 0.0, 0.0]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + alwaysvisible = true, + }, + }, + }, + ["testceg-muzzle"] = { - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 240, - sidetexture = [[lightning]], - size = 50, - sizegrowth = 0.8, - ttl = 100, - pos = [[0, 6, 0]], - }, - }, - }, - -- ["testceg-muzzlex1"] = { + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 240, + sidetexture = [[lightning]], + size = 50, + sizegrowth = 0.8, + ttl = 100, + pos = [[0, 6, 0]], + }, + }, + }, + -- ["testceg-muzzlex1"] = { - -- spawnbeam = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - -- dir = [[1, 0, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 240, - -- sidetexture = [[lightning]], - -- size = 50, - -- sizegrowth = 0.8, - -- ttl = 100, - -- pos = [[0, 6, 0]], - -- }, - -- }, - -- }, - -- ["testceg-muzzlex-1"] = { + -- spawnbeam = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + -- dir = [[1, 0, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 240, + -- sidetexture = [[lightning]], + -- size = 50, + -- sizegrowth = 0.8, + -- ttl = 100, + -- pos = [[0, 6, 0]], + -- }, + -- }, + -- }, + -- ["testceg-muzzlex-1"] = { - -- spawnbeam = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - -- dir = [[-1, 0, 0]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 240, - -- sidetexture = [[lightning]], - -- size = 50, - -- sizegrowth = 0.8, - -- ttl = 100, - -- pos = [[0, 6, 0]], - -- }, - -- }, - -- }, - -- ["testceg-muzzlez1"] = { + -- spawnbeam = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + -- dir = [[-1, 0, 0]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 240, + -- sidetexture = [[lightning]], + -- size = 50, + -- sizegrowth = 0.8, + -- ttl = 100, + -- pos = [[0, 6, 0]], + -- }, + -- }, + -- }, + -- ["testceg-muzzlez1"] = { - -- spawnbeam = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - -- dir = [[0, 0, 1]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 240, - -- sidetexture = [[lightning]], - -- size = 50, - -- sizegrowth = 0.8, - -- ttl = 100, - -- pos = [[0, 6, 0]], - -- }, - -- }, - -- }, - -- ["testceg-muzzlez-1"] = { + -- spawnbeam = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + -- dir = [[0, 0, 1]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 240, + -- sidetexture = [[lightning]], + -- size = 50, + -- sizegrowth = 0.8, + -- ttl = 100, + -- pos = [[0, 6, 0]], + -- }, + -- }, + -- }, + -- ["testceg-muzzlez-1"] = { - -- spawnbeam = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = true, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - -- dir = [[0, 0, -1]], - -- --gravity = [[0.0, 0.1, 0.0]], - -- frontoffset = 0, - -- fronttexture = [[blastwave]], - -- length = 240, - -- sidetexture = [[lightning]], - -- size = 50, - -- sizegrowth = 0.8, - -- ttl = 100, - -- pos = [[0, 6, 0]], - -- }, - -- }, - -- }, + -- spawnbeam = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + -- dir = [[0, 0, -1]], + -- --gravity = [[0.0, 0.1, 0.0]], + -- frontoffset = 0, + -- fronttexture = [[blastwave]], + -- length = 240, + -- sidetexture = [[lightning]], + -- size = 50, + -- sizegrowth = 0.8, + -- ttl = 100, + -- pos = [[0, 6, 0]], + -- }, + -- }, + -- }, } diff --git a/effects/unitsmokes.lua b/effects/unitsmokes.lua index e543489b3de..d405daf2cce 100644 --- a/effects/unitsmokes.lua +++ b/effects/unitsmokes.lua @@ -1,359 +1,357 @@ return { - ["unitsmokegen"] = { - smoke = { - air = true, - class = [[CExpGenSpawner]], - count = 50, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:smokegen-part]], - pos = [[-2 r4, 0 r5, -2 r4]], - alwaysvisible = false, - }, - }, - }, - ["smokegen-part"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.70, - colormap = [[0.01 0.01 0.01 0.1 0.12 0.12 0.12 0.68 0.10 0.10 0.10 0.75 0.09 0.09 0.09 0.9 0.08 0.08 0.08 0.6 0.07 0.07 0.07 0.4 0.05 0.05 0.05 0.2 0.01 0.01 0.01 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 5, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.06, 0.4 r0.6, -0.03 r0.06]], - numparticles = 1, - particlelife = 35, - particlelifespread = 35, - particlesize = 10, - particlesizespread = 30, - particlespeed = 1.0, - particlespeedspread = 1, - pos = [[0.0, 1, 0.0]], - sizegrowth = [[0.12 r0.05]], - sizemod = 1, - texture = [[smoke-anim]], - animParams = [[8,6,50 r50]], - rotParams = [[-16 r16, -8 r8, -180 r360]], - useairlos = false, - castShadow = true, - }, - }, - }, + ["unitsmokegen"] = { + smoke = { + air = true, + class = [[CExpGenSpawner]], + count = 50, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:smokegen-part]], + pos = [[-2 r4, 0 r5, -2 r4]], + alwaysvisible = false, + }, + }, + }, + ["smokegen-part"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.70, + colormap = [[0.01 0.01 0.01 0.1 0.12 0.12 0.12 0.68 0.10 0.10 0.10 0.75 0.09 0.09 0.09 0.9 0.08 0.08 0.08 0.6 0.07 0.07 0.07 0.4 0.05 0.05 0.05 0.2 0.01 0.01 0.01 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 5, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.06, 0.4 r0.6, -0.03 r0.06]], + numparticles = 1, + particlelife = 35, + particlelifespread = 35, + particlesize = 10, + particlesizespread = 30, + particlespeed = 1.0, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = [[0.12 r0.05]], + sizemod = 1, + texture = [[smoke-anim]], + animParams = [[8,6,50 r50]], + rotParams = [[-16 r16, -8 r8, -180 r360]], + useairlos = false, + castShadow = true, + }, + }, + }, - ["unitsmokegen2"] = { - smoke = { - air = true, - class = [[CExpGenSpawner]], - count = 50, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[i6]], - explosiongenerator = [[custom:smokegen-part2]], - pos = [[-2 r4, 0 r5, -2 r4]], - --alwaysvisible = true, - }, - }, - }, - ["smokegen-part2"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.72, - colormap = [[0.01 0.01 0.01 0.1 0.17 0.17 0.17 0.50 0.257 0.25 0.25 0.74 0.21 0.21 0.21 0.85 0.16 0.16 0.16 0.68 0.10 0.10 0.10 0.45 0.05 0.05 0.05 0.24 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 5, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.02 r0.04, 0.4 r0.5, -0.02 r0.04]], - numparticles = 1, - particlelife = 40, - particlelifespread = 28, - particlesize = 20, - particlesizespread = 20, - particlespeed = 1.6, - particlespeedspread = 2.0, - pos = [[0.0, 1, 0.0]], - sizegrowth = [[0.17 r0.04]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,60 r40]], - rotParams = [[-4 r8, -6 r12, -180 r360]], - useairlos = false, - castShadow = true, - }, - }, - }, + ["unitsmokegen2"] = { + smoke = { + air = true, + class = [[CExpGenSpawner]], + count = 50, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[i6]], + explosiongenerator = [[custom:smokegen-part2]], + pos = [[-2 r4, 0 r5, -2 r4]], + --alwaysvisible = true, + }, + }, + }, + ["smokegen-part2"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.72, + colormap = [[0.01 0.01 0.01 0.1 0.17 0.17 0.17 0.50 0.257 0.25 0.25 0.74 0.21 0.21 0.21 0.85 0.16 0.16 0.16 0.68 0.10 0.10 0.10 0.45 0.05 0.05 0.05 0.24 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 5, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.02 r0.04, 0.4 r0.5, -0.02 r0.04]], + numparticles = 1, + particlelife = 40, + particlelifespread = 28, + particlesize = 20, + particlesizespread = 20, + particlespeed = 1.6, + particlespeedspread = 2.0, + pos = [[0.0, 1, 0.0]], + sizegrowth = [[0.17 r0.04]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,60 r40]], + rotParams = [[-4 r8, -6 r12, -180 r360]], + useairlos = false, + castShadow = true, + }, + }, + }, - ["unitsmokegen-beh"] = { - smoke = { - air = true, - class = [[CExpGenSpawner]], - count = 50, --60 - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 r300]], - explosiongenerator = [[custom:smokegen-part-beh]], - pos = [[-2 r4, 0 r5, -2 r4]], - --alwaysvisible = true, - }, - }, - }, - ["smokegen-part-beh"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, - water = true, - properties = { - airdrag = 0.70, - colormap = [[0.01 0.01 0.01 0.1 0.12 0.12 0.12 0.68 0.10 0.10 0.10 0.75 0.09 0.09 0.09 0.9 0.08 0.08 0.08 0.6 0.07 0.07 0.07 0.4 0.05 0.05 0.05 0.2 0.01 0.01 0.01 0.01]], - directional = true, - emitrot = 45, - emitrotspread = 5, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.06, 0.4 r0.6, -0.03 r0.06]], - numparticles = 1, - particlelife = 35, - particlelifespread = 35, - particlesize = 10, - particlesizespread = 30, - particlespeed = 1.0, - particlespeedspread = 1, - pos = [[0.0, 1, 0.0]], - sizegrowth = [[0.12 r0.05]], - sizemod = 1, - texture = [[smoke-beh-anim]], - animParams = [[8,8,50 r50]], - rotParams = [[-16 r16, -8 r8, -180 r360]], - useairlos = false, - castShadow = true, - }, - }, - }, + ["unitsmokegen-beh"] = { + smoke = { + air = true, + class = [[CExpGenSpawner]], + count = 50, --60 + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 r300]], + explosiongenerator = [[custom:smokegen-part-beh]], + pos = [[-2 r4, 0 r5, -2 r4]], + --alwaysvisible = true, + }, + }, + }, + ["smokegen-part-beh"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.70, + colormap = [[0.01 0.01 0.01 0.1 0.12 0.12 0.12 0.68 0.10 0.10 0.10 0.75 0.09 0.09 0.09 0.9 0.08 0.08 0.08 0.6 0.07 0.07 0.07 0.4 0.05 0.05 0.05 0.2 0.01 0.01 0.01 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 5, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.06, 0.4 r0.6, -0.03 r0.06]], + numparticles = 1, + particlelife = 35, + particlelifespread = 35, + particlesize = 10, + particlesizespread = 30, + particlespeed = 1.0, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = [[0.12 r0.05]], + sizemod = 1, + texture = [[smoke-beh-anim]], + animParams = [[8,8,50 r50]], + rotParams = [[-16 r16, -8 r8, -180 r360]], + useairlos = false, + castShadow = true, + }, + }, + }, - - --- old effects below - ["unitsmoke"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.6, - colormap = [[0.13 0.12 0.05 0.22 0.12 0.1 0.075 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.04 0.04 0.04 0.1 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, -0.025, 0.0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 25, - particlesize = 5, - particlesizespread = 3.5, - particlespeed = 0.8, - particlespeedspread = 1, - pos = [[0.0, 1, 0.0]], - sizegrowth = 0.09, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - }, - ["unitsmokefire"] = { - smoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.6, - colormap = [[0.13 0.12 0.05 0.22 0.12 0.1 0.075 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.04 0.04 0.04 0.1 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, -0.025, 0.0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 25, - particlesize = 6, - particlesizespread = 4, - particlespeed = 1, - particlespeedspread = 1, - pos = [[0.0, 1, 0.0]], - sizegrowth = 0.08, - sizemod = 1, - texture = [[dirt]], - useairlos = false, - }, - }, - fire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.25, - colormap = [[0.9 0.65 0.3 0.15 0.44 0.22 0.08 0.2 0.14 0.037 0.01 0.17 0.02 0.005 0.006 0.1 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 10, - particlesize = 9, - particlesizespread = 5, - particlespeed = 0.5, - particlespeedspread = 2.5, - pos = [[0.0, 2, 0.0]], - sizegrowth = -0.05, - sizemod = 0.9, - texture = [[dirt]], - useairlos = false, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.085 0.066 0.02 0.005 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 10, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow]], - useairlos = false, - }, - }, - }, - ["unitfire"] = { - fire = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0.25, - colormap = [[0.9 0.65 0.3 0.15 0.44 0.22 0.08 0.2 0.14 0.037 0.01 0.17 0.02 0.005 0.006 0.1 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.1, 0.0]], - numparticles = 1, - particlelife = 33, - particlelifespread = 10, - particlesize = 9, - particlesizespread = 5, - particlespeed = 0.5, - particlespeedspread = 2.5, - pos = [[0.0, 2, 0.0]], - sizegrowth = -0.05, - sizemod = 0.9, - texture = [[flame]], - useairlos = false, - }, - }, - fireglow = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - properties = { - airdrag = 0, - colormap = [[0.085 0.066 0.02 0.005 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0.0, 1, 0.0]], - gravity = [[0.0, 0.0, 0.0]], - numparticles = 1, - particlelife = 8, - particlelifespread = 0, - particlesize = 100, - particlesizespread = 10, - particlespeed = 0, - particlespeedspread = 0, - pos = [[0.0, 0, 0.0]], - sizegrowth = -0.5, - sizemod = 1, - texture = [[glow2]], - useairlos = false, - }, - }, - }, - ["unitsparkles"] = { - lightningballs = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], - directional = true, - emitrot = 80, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 6, - particlelifespread = 0, - particlesize = 2, - particlesizespread = 7.5, - particlespeed = 0.01, - particlespeedspread = 0, - pos = [[-10 r10, 1.0, -10 r10]], - sizegrowth = 0, - sizemod = 1.0, - texture = [[lightbw]], - }, - }, - }, + --- old effects below + ["unitsmoke"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.6, + colormap = [[0.13 0.12 0.05 0.22 0.12 0.1 0.075 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.04 0.04 0.04 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, -0.025, 0.0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 25, + particlesize = 5, + particlesizespread = 3.5, + particlespeed = 0.8, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.09, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + ["unitsmokefire"] = { + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.6, + colormap = [[0.13 0.12 0.05 0.22 0.12 0.1 0.075 0.34 0.11 0.105 0.1 0.28 0.085 0.085 0.085 0.21 0.04 0.04 0.04 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, -0.025, 0.0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 25, + particlesize = 6, + particlesizespread = 4, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.08, + sizemod = 1, + texture = [[dirt]], + useairlos = false, + }, + }, + fire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.25, + colormap = [[0.9 0.65 0.3 0.15 0.44 0.22 0.08 0.2 0.14 0.037 0.01 0.17 0.02 0.005 0.006 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 10, + particlesize = 9, + particlesizespread = 5, + particlespeed = 0.5, + particlespeedspread = 2.5, + pos = [[0.0, 2, 0.0]], + sizegrowth = -0.05, + sizemod = 0.9, + texture = [[dirt]], + useairlos = false, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.085 0.066 0.02 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 10, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow]], + useairlos = false, + }, + }, + }, + ["unitfire"] = { + fire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.25, + colormap = [[0.9 0.65 0.3 0.15 0.44 0.22 0.08 0.2 0.14 0.037 0.01 0.17 0.02 0.005 0.006 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 33, + particlelifespread = 10, + particlesize = 9, + particlesizespread = 5, + particlespeed = 0.5, + particlespeedspread = 2.5, + pos = [[0.0, 2, 0.0]], + sizegrowth = -0.05, + sizemod = 0.9, + texture = [[flame]], + useairlos = false, + }, + }, + fireglow = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0, + colormap = [[0.085 0.066 0.02 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 10, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[glow2]], + useairlos = false, + }, + }, + }, + ["unitsparkles"] = { + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 6, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 7.5, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, } - diff --git a/effects/volcano.lua b/effects/volcano.lua index a915ea17023..c25fe98ff7b 100644 --- a/effects/volcano.lua +++ b/effects/volcano.lua @@ -17,119 +17,119 @@ end return { ["volcano_smoke_turbulence"] = { turbulence = { - air = true, - ground = true, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.72, - alwaysvisible = true, - colormap = [[0.07 0.07 0.07 0.65 0.08 0.08 0.08 0.45 0.05 0.05 0.05 0.25 0 0 0 0.01]], - directional = false, + airdrag = 0.72, + alwaysvisible = true, + colormap = [[0.07 0.07 0.07 0.65 0.08 0.08 0.08 0.45 0.05 0.05 0.05 0.25 0 0 0 0.01]], + directional = false, - emitrot = 40, - emitrotspread = 60, - emitvector = [[0.4 r0.4, 1, 0.4 r0.4]], + emitrot = 40, + emitrotspread = 60, + emitvector = [[0.4 r0.4, 1, 0.4 r0.4]], - gravity = [[-0.02 r0.05, 0.2 r0.4, -0.02 r0.05]], + gravity = [[-0.02 r0.05, 0.2 r0.4, -0.02 r0.05]], - numparticles = 6, - particlelife = 80, - particlelifespread = 60, + numparticles = 6, + particlelife = 80, + particlelifespread = 60, - particlesize = 90, - particlesizespread = 100, + particlesize = 90, + particlesizespread = 100, - particlespeed = 2.0, + particlespeed = 2.0, particlespeedspread = 2.5, - pos = [[0 r200, 0 r200, 0 r200]], + pos = [[0 r200, 0 r200, 0 r200]], - sizegrowth = 1.2, - sizemod = 0.97, + sizegrowth = 1.2, + sizemod = 0.97, - rotParams = [[-20 r40, -20 r40, -180 r360]], + rotParams = [[-20 r40, -20 r40, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - castShadow = true, - useairlos = false, + castShadow = true, + useairlos = false, }, }, }, ["volcano_ash_build"] = { -- main wide low ash ash = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.92, - alwaysvisible = true, - colormap = [[0.08 0.08 0.08 0.8 0.07 0.07 0.07 0.5 0.05 0.05 0.05 0.25 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], + airdrag = 0.92, + alwaysvisible = true, + colormap = [[0.08 0.08 0.08 0.8 0.07 0.07 0.07 0.5 0.05 0.05 0.05 0.25 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], -- reduced per-burst particles; micro wisps fill in - numparticles = 12, - particlelife = 210, - particlelifespread = 80, - particlesize = 80, - particlesizespread = 40, - particlespeed = 1.2, + numparticles = 12, + particlelife = 210, + particlelifespread = 80, + particlesize = 80, + particlesizespread = 40, + particlespeed = 1.2, particlespeedspread = 0.8, - pos = [[-180 r360, 10, -180 r360]], - sizegrowth = 0.9, - sizemod = 0.97, + pos = [[-180 r360, 10, -180 r360]], + sizegrowth = 0.9, + sizemod = 0.97, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, -- taller, thinner ash above the rim ash_high = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.95, - alwaysvisible = true, - colormap = [[0.07 0.07 0.07 0.6 0.06 0.06 0.06 0.35 0.04 0.04 0.04 0.18 0 0 0 0.01]], - directional = false, - emitrot = 85, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.005, 0]], - numparticles = 8, - particlelife = 260, - particlelifespread = 90, - particlesize = 110, - particlesizespread = 45, - particlespeed = 0.7, + airdrag = 0.95, + alwaysvisible = true, + colormap = [[0.07 0.07 0.07 0.6 0.06 0.06 0.06 0.35 0.04 0.04 0.04 0.18 0 0 0 0.01]], + directional = false, + emitrot = 85, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.005, 0]], + numparticles = 8, + particlelife = 260, + particlelifespread = 90, + particlesize = 110, + particlesizespread = 45, + particlespeed = 0.7, particlespeedspread = 0.4, - pos = [[-140 r280, 80, -140 r280]], - sizegrowth = 0.7, - sizemod = 0.985, + pos = [[-140 r280, 80, -140 r280]], + sizegrowth = 0.7, + sizemod = 0.985, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, @@ -137,166 +137,166 @@ return { -- micro “wisps” to break up the pulses ------------------------------------------------------------------ micro = { - class = [[CExpGenSpawner]], - count = SmokeCount(35), -- << adjust base 35 for more / less ambient wisps + class = [[CExpGenSpawner]], + count = SmokeCount(35), -- << adjust base 35 for more / less ambient wisps properties = { - delay = [[0 r90]], -- random up to 3 seconds per volcano_ash_build CEG + delay = [[0 r90]], -- random up to 3 seconds per volcano_ash_build CEG explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[-200 r400, 0 r120, -200 r400]], + pos = [[-200 r400, 0 r120, -200 r400]], }, }, }, ["volcano_ash_big"] = { column_core = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.90, - alwaysvisible = true, - colormap = [[0.07 0.07 0.07 1.0 0.06 0.06 0.06 0.8 0.05 0.05 0.05 0.45 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.015, 0]], + airdrag = 0.90, + alwaysvisible = true, + colormap = [[0.07 0.07 0.07 1.0 0.06 0.06 0.06 0.8 0.05 0.05 0.05 0.45 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.015, 0]], -- fewer particles per single burst; micro system below handles “fill” - numparticles = 18, - particlelife = 260, - particlelifespread = 110, + numparticles = 18, + particlelife = 260, + particlelifespread = 110, -- SHRUNK FROM 150 / 70 - particlesize = 90, - particlesizespread = 40, + particlesize = 90, + particlesizespread = 40, - particlespeed = 4.0, + particlespeed = 4.0, particlespeedspread = 2.0, - pos = [[-80 r160, 40, -80 r160]], - sizegrowth = 1.4, - sizemod = 0.97, + pos = [[-80 r160, 40, -80 r160]], + sizegrowth = 1.4, + sizemod = 0.97, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - useairlos = true, + useairlos = true, }, }, column_sheath = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.93, - alwaysvisible = true, - colormap = [[0.10 0.10 0.10 0.9 0.09 0.09 0.09 0.6 0.07 0.07 0.07 0.3 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 16, - particlelife = 300, - particlelifespread = 120, + airdrag = 0.93, + alwaysvisible = true, + colormap = [[0.10 0.10 0.10 0.9 0.09 0.09 0.09 0.6 0.07 0.07 0.07 0.3 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 16, + particlelife = 300, + particlelifespread = 120, -- SHRUNK FROM 220 / 80 - particlesize = 130, - particlesizespread = 50, + particlesize = 130, + particlesizespread = 50, - particlespeed = 3.2, + particlespeed = 3.2, particlespeedspread = 1.6, - pos = [[-140 r280, 80, -140 r280]], - sizegrowth = 1.7, - sizemod = 0.975, + pos = [[-140 r280, 80, -140 r280]], + sizegrowth = 1.7, + sizemod = 0.975, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - useairlos = true, + useairlos = true, }, }, column_cap = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.96, - alwaysvisible = true, - colormap = [[0.09 0.09 0.09 0.7 0.08 0.08 0.08 0.4 0.06 0.06 0.06 0.2 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.0, 0]], - numparticles = 14, - particlelife = 320, - particlelifespread = 130, + airdrag = 0.96, + alwaysvisible = true, + colormap = [[0.09 0.09 0.09 0.7 0.08 0.08 0.08 0.4 0.06 0.06 0.06 0.2 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.0, 0]], + numparticles = 14, + particlelife = 320, + particlelifespread = 130, -- SHRUNK FROM 260 / 90 - particlesize = 160, - particlesizespread = 55, + particlesize = 160, + particlesizespread = 55, - particlespeed = 2.2, + particlespeed = 2.2, particlespeedspread = 1.2, - pos = [[-220 r440, 500, -220 r440]], - sizegrowth = 1.1, - sizemod = 0.985, + pos = [[-220 r440, 500, -220 r440]], + sizegrowth = 1.1, + sizemod = 0.985, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, column_skirt = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.92, - alwaysvisible = true, - colormap = [[0.10 0.10 0.10 0.8 0.09 0.09 0.09 0.5 0.07 0.07 0.07 0.25 0 0 0 0.01]], - directional = false, - emitrot = 5, - emitrotspread = 35, - emitvector = [[0.9, 0.4, 0.9]], - gravity = [[0, -0.02, 0]], - numparticles = 18, - particlelife = 180, - particlelifespread = 80, + airdrag = 0.92, + alwaysvisible = true, + colormap = [[0.10 0.10 0.10 0.8 0.09 0.09 0.09 0.5 0.07 0.07 0.07 0.25 0 0 0 0.01]], + directional = false, + emitrot = 5, + emitrotspread = 35, + emitvector = [[0.9, 0.4, 0.9]], + gravity = [[0, -0.02, 0]], + numparticles = 18, + particlelife = 180, + particlelifespread = 80, -- SHRUNK FROM 140 / 60 - particlesize = 85, - particlesizespread = 36, + particlesize = 85, + particlesizespread = 36, - particlespeed = 8.5, + particlespeed = 8.5, particlespeedspread = 3.0, - pos = [[-140 r280, 260, -140 r280]], - sizegrowth = 1.3, - sizemod = 0.98, + pos = [[-140 r280, 260, -140 r280]], + sizegrowth = 1.3, + sizemod = 0.98, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - useairlos = true, + useairlos = true, }, }, @@ -304,84 +304,84 @@ return { -- random micro turbulence inside the column volume ------------------------------------------------------------------ micro = { - class = [[CExpGenSpawner]], - count = SmokeCount(35), -- was 50, slightly less dense + class = [[CExpGenSpawner]], + count = SmokeCount(35), -- was 50, slightly less dense properties = { - alwaysvisible = true, - delay = [[0 r120]], -- random up to 4 seconds per volcano_ash_big CEG + alwaysvisible = true, + delay = [[0 r120]], -- random up to 4 seconds per volcano_ash_big CEG explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[-220 r440, 80 r520, -220 r440]], + pos = [[-220 r440, 80 r520, -220 r440]], }, }, }, ["volcano_ash_small"] = { puff = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.93, - alwaysvisible = true, - colormap = [[0.10 0.10 0.10 0.8 0.07 0.07 0.07 0.5 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 10, - particlelife = 160, - particlelifespread = 70, - particlesize = 90, - particlesizespread = 35, - particlespeed = 2.6, + airdrag = 0.93, + alwaysvisible = true, + colormap = [[0.10 0.10 0.10 0.8 0.07 0.07 0.07 0.5 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 10, + particlelife = 160, + particlelifespread = 70, + particlesize = 90, + particlesizespread = 35, + particlespeed = 2.6, particlespeedspread = 1.4, - pos = [[-160 r320, 140 r80, -160 r320]], - sizegrowth = 1.0, - sizemod = 0.98, + pos = [[-160 r320, 140 r80, -160 r320]], + sizegrowth = 1.0, + sizemod = 0.98, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, puff_drift = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.97, - alwaysvisible = true, - colormap = [[0.08 0.08 0.08 0.6 0.06 0.06 0.06 0.35 0.04 0.04 0.04 0.15 0 0 0 0.01]], - directional = false, - emitrot = 60, - emitrotspread = 40, - emitvector = [[0.4, 1, 0.4]], - gravity = [[0, 0.002, 0]], - numparticles = 6, - particlelife = 200, - particlelifespread = 80, - particlesize = 120, - particlesizespread = 40, - particlespeed = 1.4, + airdrag = 0.97, + alwaysvisible = true, + colormap = [[0.08 0.08 0.08 0.6 0.06 0.06 0.06 0.35 0.04 0.04 0.04 0.15 0 0 0 0.01]], + directional = false, + emitrot = 60, + emitrotspread = 40, + emitvector = [[0.4, 1, 0.4]], + gravity = [[0, 0.002, 0]], + numparticles = 6, + particlelife = 200, + particlelifespread = 80, + particlesize = 120, + particlesizespread = 40, + particlespeed = 1.4, particlespeedspread = 0.9, - pos = [[-200 r400, 180 r80, -200 r400]], - sizegrowth = 0.9, - sizemod = 0.99, + pos = [[-200 r400, 180 r80, -200 r400]], + sizegrowth = 0.9, + sizemod = 0.99, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, @@ -389,554 +389,552 @@ return { -- micro chaos for side puffs ------------------------------------------------------------------ micro = { - class = [[CExpGenSpawner]], - count = SmokeCount(18), -- << adjust base 18 for side puff chaos level + class = [[CExpGenSpawner]], + count = SmokeCount(18), -- << adjust base 18 for side puff chaos level properties = { - alwaysvisible = true, - delay = [[0 r60]], + alwaysvisible = true, + delay = [[0 r60]], explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[-200 r400, 120 r140, -200 r400]], + pos = [[-200 r400, 120 r140, -200 r400]], }, }, }, ["volcano_eject"] = { flame_core = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.86, - alwaysvisible = true, - colormap = [[1.0 0.85 0.5 1.0 1.0 0.55 0.2 0.7 0.8 0.3 0.1 0.4 0.25 0.08 0.03 0.15 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 28, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.20, 0]], - numparticles = 26, - particlelife = 32, - particlelifespread = 10, - particlesize = 140, - particlesizespread = 60, - particlespeed = 20, + airdrag = 0.86, + alwaysvisible = true, + colormap = [[1.0 0.85 0.5 1.0 1.0 0.55 0.2 0.7 0.8 0.3 0.1 0.4 0.25 0.08 0.03 0.15 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 28, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.20, 0]], + numparticles = 26, + particlelife = 32, + particlelifespread = 10, + particlesize = 140, + particlesizespread = 60, + particlespeed = 20, particlespeedspread = 9, - pos = [[0, 18, 0]], - sizegrowth = -1.6, - sizemod = 0.96, - texture = [[flame]], - useairlos = true, + pos = [[0, 18, 0]], + sizegrowth = -1.6, + sizemod = 0.96, + texture = [[flame]], + useairlos = true, }, }, eject_smoke = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.93, - alwaysvisible = true, - colormap = [[0.14 0.12 0.11 0.95 0.11 0.10 0.10 0.6 0.08 0.08 0.08 0.28 0 0 0 0.01]], - directional = false, - emitrot = 75, - emitrotspread = 35, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.01, 0]], - numparticles = 22, - particlelife = 200, - particlelifespread = 80, - particlesize = 120, - particlesizespread = 50, - particlespeed = 4.8, + airdrag = 0.93, + alwaysvisible = true, + colormap = [[0.14 0.12 0.11 0.95 0.11 0.10 0.10 0.6 0.08 0.08 0.08 0.28 0 0 0 0.01]], + directional = false, + emitrot = 75, + emitrotspread = 35, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.01, 0]], + numparticles = 22, + particlelife = 200, + particlelifespread = 80, + particlesize = 120, + particlesizespread = 50, + particlespeed = 4.8, particlespeedspread = 2.3, - pos = [[0, 26, 0]], - sizegrowth = 1.3, - sizemod = 0.97, + pos = [[0, 26, 0]], + sizegrowth = 1.3, + sizemod = 0.97, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - useairlos = true, + useairlos = true, }, }, -- Turbulence to roughen ejection smoke turbulence = { - class = [[CExpGenSpawner]], - count = 8, + class = [[CExpGenSpawner]], + count = 8, properties = { - alwaysvisible = true, - delay = [[0 r40]], + alwaysvisible = true, + delay = [[0 r40]], explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[-60 r120, 24 r40, -60 r120]], + pos = [[-60 r120, 24 r40, -60 r120]], }, }, }, ["volcano_rock_impact"] = { smoke = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.90, - alwaysvisible = true, - colormap = [[0.10 0.10 0.10 1.0 0.09 0.09 0.09 0.65 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 22, - particlelife = 90, - particlelifespread = 40, - particlesize = 90, - particlesizespread = 40, - particlespeed = 6.0, + airdrag = 0.90, + alwaysvisible = true, + colormap = [[0.10 0.10 0.10 1.0 0.09 0.09 0.09 0.65 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 22, + particlelife = 90, + particlelifespread = 40, + particlesize = 90, + particlesizespread = 40, + particlespeed = 6.0, particlespeedspread = 2.5, - pos = [[0, 12, 0]], - sizegrowth = 1.0, - sizemod = 0.97, + pos = [[0, 12, 0]], + sizegrowth = 1.0, + sizemod = 0.97, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, flame = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.88, - alwaysvisible = true, - colormap = [[1.0 0.8 0.3 0.9 0.8 0.4 0.1 0.5 0.3 0.12 0.04 0.15 0 0 0 0.01]], - directional = false, - emitrot = 80, - emitrotspread = 25, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.20, 0]], - numparticles = 14, - particlelife = 40, - particlelifespread = 16, - particlesize = 80, - particlesizespread = 30, - particlespeed = 10, + airdrag = 0.88, + alwaysvisible = true, + colormap = [[1.0 0.8 0.3 0.9 0.8 0.4 0.1 0.5 0.3 0.12 0.04 0.15 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.20, 0]], + numparticles = 14, + particlelife = 40, + particlelifespread = 16, + particlesize = 80, + particlesizespread = 30, + particlespeed = 10, particlespeedspread = 4, - pos = [[0, 6, 0]], - sizegrowth = -0.7, - sizemod = 0.96, - texture = [[flame]], - useairlos = true, + pos = [[0, 6, 0]], + sizegrowth = -0.7, + sizemod = 0.96, + texture = [[flame]], + useairlos = true, }, }, dust = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.91, - alwaysvisible = true, - colormap = [[0.15 0.12 0.08 0.6 0.10 0.08 0.06 0.35 0.05 0.04 0.03 0.15 0 0 0 0.01]], - directional = false, - emitrot = 70, - emitrotspread = 40, - emitvector = [[0.7, 1, 0.7]], - gravity = [[0, -0.04, 0]], - numparticles = 20, - particlelife = 70, - particlelifespread = 30, - particlesize = 70, - particlesizespread = 30, - particlespeed = 7, + airdrag = 0.91, + alwaysvisible = true, + colormap = [[0.15 0.12 0.08 0.6 0.10 0.08 0.06 0.35 0.05 0.04 0.03 0.15 0 0 0 0.01]], + directional = false, + emitrot = 70, + emitrotspread = 40, + emitvector = [[0.7, 1, 0.7]], + gravity = [[0, -0.04, 0]], + numparticles = 20, + particlelife = 70, + particlelifespread = 30, + particlesize = 70, + particlesizespread = 30, + particlespeed = 7, particlespeedspread = 3, - pos = [[0, 6, 0]], - sizegrowth = 0.9, - sizemod = 0.98, - texture = [[smoke]], - useairlos = true, + pos = [[0, 6, 0]], + sizegrowth = 0.9, + sizemod = 0.98, + texture = [[smoke]], + useairlos = true, }, }, -- Impact turbulence: adds breakup to the smoke cap turbulence = { - class = [[CExpGenSpawner]], - count = 6, + class = [[CExpGenSpawner]], + count = 6, properties = { - alwaysvisible = true, - delay = [[0 r20]], + alwaysvisible = true, + delay = [[0 r20]], explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[0 r30, 6 r16, 0 r30]], + pos = [[0 r30, 6 r16, 0 r30]], }, }, }, ["volcano_lava_splash_nukexl"] = { waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = 1, - water = true, + water = true, properties = { - colormap = [[1.0 0.75 0.35 0.013 0.85 0.35 0.12 0.01 0.25 0.08 0.03 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], + colormap = [[1.0 0.75 0.35 0.013 0.85 0.35 0.12 0.01 0.25 0.08 0.03 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 190.9, - sizegrowth = 2, - ttl = 170, - pos = [[0.5, 1, 0.0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 190.9, + sizegrowth = 2, + ttl = 170, + pos = [[0.5, 1, 0.0]], alwaysvisible = true, }, }, brightflare = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[1.0 0.95 0.75 0.8 1.0 0.45 0.12 0.5 0 0 0 0]], - dir = [[0, 1, 0]], + colormap = [[1.0 0.95 0.75 0.8 1.0 0.45 0.12 0.5 0 0 0 0]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[exploflare]], - length = 40, - sidetexture = [[none]], - size = 1100, - sizegrowth = [[0.1 r0.2]], - ttl = 15, - pos = [[0, 10, 0]], + frontoffset = 0, + fronttexture = [[exploflare]], + length = 40, + sidetexture = [[none]], + size = 1100, + sizegrowth = [[0.1 r0.2]], + ttl = 15, + pos = [[0, 10, 0]], alwaysvisible = true, }, }, brightwake = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[0 0 0 0 1.0 0.55 0.18 0.4 0.35 0.12 0.05 0.2 0 0 0 0]], - dir = [[0, 1, 0]], + colormap = [[0 0 0 0 1.0 0.55 0.18 0.4 0.35 0.12 0.05 0.2 0 0 0 0]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[wake]], - length = 40, - sidetexture = [[none]], - size = [[280 r340]], - sizegrowth = [[0.15 r0.7]], - ttl = [[90 r70]], - pos = [[0, 5, 0]], - rotParams = [[-6 r12, -0.5 r1, -180 r360]], + frontoffset = 0, + fronttexture = [[wake]], + length = 40, + sidetexture = [[none]], + size = [[280 r340]], + sizegrowth = [[0.15 r0.7]], + ttl = [[90 r70]], + pos = [[0, 5, 0]], + rotParams = [[-6 r12, -0.5 r1, -180 r360]], alwaysvisible = true, }, }, brightwakefoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[0 0 0 0 1.0 0.65 0.25 0.8 0.35 0.14 0.06 0.2 0 0 0 0]], - dir = [[0, 1, 0]], + colormap = [[0 0 0 0 1.0 0.65 0.25 0.8 0.35 0.14 0.06 0.2 0 0 0 0]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 40, - sidetexture = [[none]], - size = [[400 r120]], - sizegrowth = [[0.15 r0.7]], - ttl = [[120 r40]], - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -0.5 r1, -180 r360]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 40, + sidetexture = [[none]], + size = [[400 r120]], + sizegrowth = [[0.15 r0.7]], + ttl = [[120 r40]], + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -0.5 r1, -180 r360]], alwaysvisible = true, }, }, brightwakewave = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 2, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 2, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[0 0 0 0 0.85 0.35 0.12 0.5 0.30 0.10 0.05 0.2 0 0 0 0]], - dir = [[0, 1, 0]], + colormap = [[0 0 0 0 0.85 0.35 0.12 0.5 0.30 0.10 0.05 0.2 0 0 0 0]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 40, - sidetexture = [[none]], - size = [[120 r240]], - sizegrowth = [[0.15 r0.7]], - ttl = [[110 r40]], - pos = [[0, 0, 0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 40, + sidetexture = [[none]], + size = [[120 r240]], + sizegrowth = [[0.15 r0.7]], + ttl = [[110 r40]], + pos = [[0, 0, 0]], alwaysvisible = true, }, }, circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, underwater = 1, - water = true, + water = true, properties = { - airdrag = 0.98, - colormap = [[0 0 0 0 1.0 0.55 0.18 .013 0.85 0.35 0.12 .008 0.25 0.08 0.03 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 20, - particlelife = 80, - particlelifespread = 110, - particlesize = [[12 r27]], - particlesizespread = 0, - particlespeed = [[3.5 i1.9]], + airdrag = 0.98, + colormap = [[0 0 0 0 1.0 0.55 0.18 .013 0.85 0.35 0.12 .008 0.25 0.08 0.03 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 80, + particlelifespread = 110, + particlesize = [[12 r27]], + particlesizespread = 0, + particlespeed = [[3.5 i1.9]], particlespeedspread = 1.9, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.78]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - alwaysvisible = true, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.78]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + alwaysvisible = true, }, }, waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 3, - ground = false, + air = false, + class = [[CSimpleParticleSystem]], + count = 3, + ground = false, underwater = 1, - water = true, + water = true, properties = { - airdrag = 0.97, - colormap = - [[0 0 0 0.005 0.35 0.12 0.05 .011 0.25 0.08 0.03 .006 0.1 0.03 0.01 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[r0.12, 0.7, r0.12]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 100, - particlelifespread = 140, - particlesize = [[120 r140]], - particlesizespread = 140, - particlespeed = [[25.8 i1]], + airdrag = 0.97, + colormap = [[0 0 0 0.005 0.35 0.12 0.05 .011 0.25 0.08 0.03 .006 0.1 0.03 0.01 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[r0.12, 0.7, r0.12]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 100, + particlelifespread = 140, + particlesize = [[120 r140]], + particlesizespread = 140, + particlespeed = [[25.8 i1]], particlespeedspread = 15, - pos = [[-130 r260, 110 r60, -130 r260]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - alwaysvisible = true, + pos = [[-130 r260, 110 r60, -130 r260]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + alwaysvisible = true, }, }, sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, underwater = true, properties = { - airdrag = 0.95, - alwaysvisible = true, - colormap = [[1.0 0.65 0.25 0.020 0.85 0.35 0.12 0.01 0 0 0 0.005]], - directional = true, - emitrot = 12, - emitrotspread = 12, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 26, - particlelife = 90, - particlelifespread = 65, - particlesize = 80, - particlesizespread = 80, - particlespeed = 16.8, + airdrag = 0.95, + alwaysvisible = true, + colormap = [[1.0 0.65 0.25 0.020 0.85 0.35 0.12 0.01 0 0 0 0.005]], + directional = true, + emitrot = 12, + emitrotspread = 12, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 26, + particlelife = 90, + particlelifespread = 65, + particlesize = 80, + particlesizespread = 80, + particlespeed = 16.8, particlespeedspread = 26, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.25, - sizemod = 0.99, - texture = [[gunshotxl2]], - useairlos = false, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.25, + sizemod = 0.99, + texture = [[gunshotxl2]], + useairlos = false, }, }, waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, underwater = 1, - water = true, + water = true, properties = { - airdrag = 0.952, - alwaysvisible = true, - colormap = [[1.0 0.75 0.35 0.009 0.85 0.35 0.12 0.013 0.25 0.08 0.03 0.006 0 0 0 0.01]], - directional = true, - emitrot = 70, - emitrotspread = [[-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.045, 0]], - numparticles = 24, - particlelife = 110, - particlelifespread = 45, - particlesize = 60, - particlesizespread = 150, - particlespeed = [[11 i1.95]], + airdrag = 0.952, + alwaysvisible = true, + colormap = [[1.0 0.75 0.35 0.009 0.85 0.35 0.12 0.013 0.25 0.08 0.03 0.006 0 0 0 0.01]], + directional = true, + emitrot = 70, + emitrotspread = [[-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.045, 0]], + numparticles = 24, + particlelife = 110, + particlelifespread = 45, + particlesize = 60, + particlesizespread = 150, + particlespeed = [[11 i1.95]], particlespeedspread = 10, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, }, }, shockwave = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[1.0 0.65 0.25 0.011 0.85 0.35 0.12 0.01 0.25 0.08 0.03 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], + colormap = [[1.0 0.65 0.25 0.011 0.85 0.35 0.12 0.01 0.25 0.08 0.03 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 40, - sidetexture = [[none]], - size = 20, - sizegrowth = [[-22 r6]], - ttl = 20, - pos = [[0, 5, 0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 40, + sidetexture = [[none]], + size = 20, + sizegrowth = [[-22 r6]], + ttl = 20, + pos = [[0, 5, 0]], alwaysvisible = true, }, }, shockwave_slow = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, + air = false, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = [[1.0 0.65 0.25 0.013 0.85 0.35 0.12 0.008 0.25 0.08 0.03 0.005 0 0 0 0.01]], - dir = [[0, 1, 0]], + colormap = [[1.0 0.65 0.25 0.013 0.85 0.35 0.12 0.008 0.25 0.08 0.03 0.005 0 0 0 0.01]], + dir = [[0, 1, 0]], --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[explosionwave]], - length = 0, - sidetexture = [[none]], - size = 50, - sizegrowth = [[-18 r5]], - ttl = 220, - pos = [[0, 0, 0]], + frontoffset = 0, + fronttexture = [[explosionwave]], + length = 0, + sidetexture = [[none]], + size = 50, + sizegrowth = [[-18 r5]], + ttl = 220, + pos = [[0, 0, 0]], alwaysvisible = true, }, }, dirt = { - class = [[CSimpleParticleSystem]], - count = 4, - ground = true, - air = true, + class = [[CSimpleParticleSystem]], + count = 4, + ground = true, + air = true, underwater = true, - water = true, + water = true, properties = { - airdrag = 0.97, - colormap = [[0.35 0.12 0.05 0.013 0.25 0.08 0.03 0.01 0.1 0.03 0.01 0.006 0 0 0 0.01]], - directional = false, - emitrot = 30, - emitrotspread = 16, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 7, - particlelife = 80, - particlelifespread = 85, - particlesize = 39, - particlesizespread = 42, - particlespeed = 6, + airdrag = 0.97, + colormap = [[0.35 0.12 0.05 0.013 0.25 0.08 0.03 0.01 0.1 0.03 0.01 0.006 0 0 0 0.01]], + directional = false, + emitrot = 30, + emitrotspread = 16, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 7, + particlelife = 80, + particlelifespread = 85, + particlesize = 39, + particlesizespread = 42, + particlespeed = 6, particlespeedspread = 15, - rotParams = [[-50 r100, -7 r14, -180 r360]], - pos = [[0, 3, 0]], - sizegrowth = -0.08, - sizemod = 1, - texture = [[randomdots]], - useairlos = false, - alwaysvisible = true, + rotParams = [[-50 r100, -7 r14, -180 r360]], + pos = [[0, 3, 0]], + sizegrowth = -0.08, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + alwaysvisible = true, }, }, groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = false, - ground = true, - water = true, + class = [[CSimpleGroundFlash]], + count = 1, + air = false, + ground = true, + water = true, underwater = true, properties = { - colormap = [[1.0 0.9 0.7 0.8 1.0 0.45 0.12 0.5 0.25 0.08 0.03 0.2 0 0 0 0.01]], - size = 520, - sizegrowth = 5, - ttl = 220, - texture = [[groundflashwhite]], + colormap = [[1.0 0.9 0.7 0.8 1.0 0.45 0.12 0.5 0.25 0.08 0.03 0.2 0 0 0 0.01]], + size = 520, + sizegrowth = 5, + ttl = 220, + texture = [[groundflashwhite]], alwaysvisible = true, }, }, }, ["volcano1_flames"] = { rocks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 30, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 30, + ground = true, + water = true, underwater = true, properties = { - airdrag = 0.97, - alwaysvisible = true, - colormap = [[0.0 0.00 0.0 0.01 + airdrag = 0.97, + alwaysvisible = true, + colormap = [[0.0 0.00 0.0 0.01 0.9 0.90 0.0 0.50 0.9 0.90 0.0 0.50 0.9 0.90 0.0 0.50 @@ -949,53 +947,53 @@ return { 0.5 0.35 0.0 0.50 0.5 0.35 0.0 0.50 0.0 0.00 0.0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0.001 r-0.002, 0.0, 0.001 r-0.002]], - numparticles = 1, - particlelife = 180, - particlelifespread = 20, - particlesize = 120, - particlesizespread = 120, - particlespeed = 24, + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0.001 r-0.002, 0.0, 0.001 r-0.002]], + numparticles = 1, + particlelife = 180, + particlelifespread = 20, + particlesize = 120, + particlesizespread = 120, + particlespeed = 24, particlespeedspread = 0, - pos = [[0, 0, 0]], - sizegrowth = 0.05, - sizemod = 1.0, - texture = [[fireball]], + pos = [[0, 0, 0]], + sizegrowth = 0.05, + sizemod = 1.0, + texture = [[fireball]], }, }, }, ["volcano_rising_fireball_spawner"] = { nw = { - air = true, - class = [[CExpGenSpawner]], - count = 150, - ground = true, - water = true, + air = true, + class = [[CExpGenSpawner]], + count = 150, + ground = true, + water = true, underwater = true, properties = { - delay = [[0 i1]], + delay = [[0 i1]], explosiongenerator = [[custom:volcano_rising_fireball_sub]], - pos = [[20 r40, i20, -20 r40]], - alwaysvisible = true, + pos = [[20 r40, i20, -20 r40]], + alwaysvisible = true, }, }, }, ["volcano_rising_fireball_sub"] = { rocks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, underwater = true, properties = { - airdrag = 0.97, - alwaysvisible = true, - colormap = [[ + airdrag = 0.97, + alwaysvisible = true, + colormap = [[ 0.9 0.45 0.15 0.75 0.4 0.2 0.08 0.65 0.12 0.1 0.1 0.6 @@ -1004,22 +1002,22 @@ return { 0.02 0.02 0.02 0.18 0.0 0.0 0.0 0.0 ]], - directional = true, - emitrot = 90, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0.001 r-0.002, 0.01 r-0.02, 0.001 r-0.002]], - numparticles = 1, - particlelife = 150, - particlelifespread = 150, - particlesize = 90, - particlesizespread = 90, - particlespeed = 3, + directional = true, + emitrot = 90, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0.001 r-0.002, 0.01 r-0.02, 0.001 r-0.002]], + numparticles = 1, + particlelife = 150, + particlelifespread = 150, + particlesize = 90, + particlesizespread = 90, + particlespeed = 3, particlespeedspread = 5, - pos = [[0, 0, 0]], - sizegrowth = 0.05, - sizemod = 1.0, - texture = [[fireball]], + pos = [[0, 0, 0]], + sizegrowth = 0.05, + sizemod = 1.0, + texture = [[fireball]], }, }, }, @@ -1029,109 +1027,109 @@ return { ---------------------------------------------------------------------- ["volcano_rock_trail"] = { trail_flame = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.85, - alwaysvisible = true, - colormap = [[1.0 0.8 0.4 1.0 1.0 0.45 0.12 0.7 0.7 0.2 0.06 0.4 0.25 0.08 0.03 0.12 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 20, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.30, 0]], - numparticles = 6, - particlelife = 40, - particlelifespread = 14, - particlesize = 25, - particlesizespread = 12, - particlespeed = 2.2, + airdrag = 0.85, + alwaysvisible = true, + colormap = [[1.0 0.8 0.4 1.0 1.0 0.45 0.12 0.7 0.7 0.2 0.06 0.4 0.25 0.08 0.03 0.12 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.30, 0]], + numparticles = 6, + particlelife = 40, + particlelifespread = 14, + particlesize = 25, + particlesizespread = 12, + particlespeed = 2.2, particlespeedspread = 1.3, - pos = [[0, 0, 0]], - sizegrowth = -0.5, - sizemod = 0.96, - texture = [[flame]], - useairlos = true, + pos = [[0, 0, 0]], + sizegrowth = -0.5, + sizemod = 0.96, + texture = [[flame]], + useairlos = true, }, }, trail_smoke = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.93, - alwaysvisible = true, - colormap = [[0.08 0.07 0.07 0.95 0.09 0.09 0.09 0.7 0.07 0.07 0.07 0.4 0 0 0 0.01]], - directional = false, - emitrot = 10, - emitrotspread = 30, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 5, - particlelife = 80, - particlelifespread = 30, - particlesize = 30, - particlesizespread = 12, - particlespeed = 1.0, + airdrag = 0.93, + alwaysvisible = true, + colormap = [[0.08 0.07 0.07 0.95 0.09 0.09 0.09 0.7 0.07 0.07 0.07 0.4 0 0 0 0.01]], + directional = false, + emitrot = 10, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 5, + particlelife = 80, + particlelifespread = 30, + particlesize = 30, + particlesizespread = 12, + particlespeed = 1.0, particlespeedspread = 0.7, - pos = [[0, -2, 0]], - sizegrowth = 0.9, - sizemod = 0.98, + pos = [[0, -2, 0]], + sizegrowth = 0.9, + sizemod = 0.98, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-anim]], - useairlos = true, + useairlos = true, }, }, sparks = { - air = true, - ground = true, - water = false, - class = [[CSimpleParticleSystem]], - count = 1, + air = true, + ground = true, + water = false, + class = [[CSimpleParticleSystem]], + count = 1, properties = { - airdrag = 0.86, - alwaysvisible = true, - colormap = [[1.0 0.9 0.6 0.9 1.0 0.6 0.25 0.6 0.8 0.35 0.1 0.3 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = 45, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.35, 0]], - numparticles = 7, - particlelife = 22, - particlelifespread = 8, - particlesize = 6, - particlesizespread = 3, - particlespeed = 4.5, + airdrag = 0.86, + alwaysvisible = true, + colormap = [[1.0 0.9 0.6 0.9 1.0 0.6 0.25 0.6 0.8 0.35 0.1 0.3 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 45, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.35, 0]], + numparticles = 7, + particlelife = 22, + particlelifespread = 8, + particlesize = 6, + particlesizespread = 3, + particlespeed = 4.5, particlespeedspread = 2.5, - pos = [[0, 0, 0]], - sizegrowth = -0.7, - sizemod = 0.97, - texture = [[flame]], - useairlos = true, + pos = [[0, 0, 0]], + sizegrowth = -0.7, + sizemod = 0.97, + texture = [[flame]], + useairlos = true, }, }, -- Small turbulence added to the trailing smoke turbulence = { - class = [[CExpGenSpawner]], - count = 6, + class = [[CExpGenSpawner]], + count = 6, properties = { - delay = [[0 r30]], + delay = [[0 r30]], explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[0 r12, -4 r8, 0 r12]], - alwaysvisible = true, + pos = [[0 r12, -4 r8, 0 r12]], + alwaysvisible = true, }, }, }, @@ -1141,77 +1139,77 @@ return { ---------------------------------------------------------------------- ["volcano_fireball_impact"] = { impact_smoke = { - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - air = true, - water = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + air = true, + water = false, properties = { - airdrag = 0.90, - alwaysvisible = true, - colormap = [[0.1 0.1 0.1 1 0.09 0.09 0.09 0.6 0 0 0 0.01]], - emitrot = 80, - emitrotspread = 45, - emitvector = [[0,1,0]], - gravity = [[0,-0.05,0]], - numparticles = 20, - particlelife = 80, - particlelifespread = 35, - particlesize = 120, - particlesizespread = 60, - particlespeed = 6, + airdrag = 0.90, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1 0.09 0.09 0.09 0.6 0 0 0 0.01]], + emitrot = 80, + emitrotspread = 45, + emitvector = [[0,1,0]], + gravity = [[0,-0.05,0]], + numparticles = 20, + particlelife = 80, + particlelifespread = 35, + particlesize = 120, + particlesizespread = 60, + particlespeed = 6, particlespeedspread = 3, - pos = [[0,5,0]], - sizegrowth = 1.0, - sizemod = 0.97, + pos = [[0,5,0]], + sizegrowth = 1.0, + sizemod = 0.97, - rotParams = [[-16 r16, -8 r8, -180 r360]], + rotParams = [[-16 r16, -8 r8, -180 r360]], -- TEXTURE/ANIM TWEAK - animParams = [[8,8,120 r80]], - texture = [[smoke-beh-anim]], + animParams = [[8,8,120 r80]], + texture = [[smoke-beh-anim]], - useairlos = true, + useairlos = true, }, }, impact_flame = { - class = [[CSimpleParticleSystem]], - count = 1, - air = true, - ground = true, - water = false, + class = [[CSimpleParticleSystem]], + count = 1, + air = true, + ground = true, + water = false, properties = { - airdrag = 0.90, - alwaysvisible = true, - colormap = [[1 0.8 0.3 1 1 0.3 0.1 0.5 0.3 0.1 0.05 0.2 0 0 0 0.01]], - emitrot = 90, - emitrotspread = 25, - emitvector = [[0,1,0]], - gravity = [[0,-0.2,0]], - numparticles = 14, - particlelife = 30, - particlelifespread = 12, - particlesize = 90, - particlesizespread = 50, - particlespeed = 8, + airdrag = 0.90, + alwaysvisible = true, + colormap = [[1 0.8 0.3 1 1 0.3 0.1 0.5 0.3 0.1 0.05 0.2 0 0 0 0.01]], + emitrot = 90, + emitrotspread = 25, + emitvector = [[0,1,0]], + gravity = [[0,-0.2,0]], + numparticles = 14, + particlelife = 30, + particlelifespread = 12, + particlesize = 90, + particlesizespread = 50, + particlespeed = 8, particlespeedspread = 3, - pos = [[0,3,0]], - sizegrowth = -1.4, - sizemod = 0.96, - texture = [[flame]], - useairlos = true, + pos = [[0,3,0]], + sizegrowth = -1.4, + sizemod = 0.96, + texture = [[flame]], + useairlos = true, }, }, -- Extra churn in the impact smoke turbulence = { - class = [[CExpGenSpawner]], - count = 8, + class = [[CExpGenSpawner]], + count = 8, properties = { - delay = [[0 r25]], + delay = [[0 r25]], explosiongenerator = [[custom:volcano_smoke_turbulence]], - pos = [[0 r40, 4 r20, 0 r40]], - alwaysvisible = true, + pos = [[0 r40, 4 r20, 0 r40]], + alwaysvisible = true, }, }, }, @@ -1219,83 +1217,81 @@ return { ["volcano_fire-area"] = { usedefaultexplosions = false, burned_area = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, underwater = 1, - water = true, + water = true, properties = { - colormap = - [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[bloodcentersplatshwhite]], - length = 15, - sidetexture = [[none]], - size = [[84 r44]], - sizegrowth = 0.1, - ttl = 330, - pos = [[0, 4, 0]], - rotParams = [[0, 0, -180 r360]], + colormap = [[0 0 0 0.1 0.08 0.06 0.06 0.2 0.12 0.1 0.1 0.75 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.12 0.1 0.1 0.80 0.11 0.08 0.08 0.45 0.10 0.07 0.07 0.2 0.08 0.06 0.06 0.2 0 0 0 0.1]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[bloodcentersplatshwhite]], + length = 15, + sidetexture = [[none]], + size = [[84 r44]], + sizegrowth = 0.1, + ttl = 330, + pos = [[0, 4, 0]], + rotParams = [[0, 0, -180 r360]], alwaysVisible = true, - drawOrder = -2, + drawOrder = -2, }, }, fireflamearea = { - air = true, - class = [[CExpGenSpawner]], - count = 25, - ground = true, - water = true, + air = true, + class = [[CExpGenSpawner]], + count = 25, + ground = true, + water = true, underwater = true, properties = { - delay = [[i12]], + delay = [[i12]], explosiongenerator = [[custom:volcano_fire-flames]], - pos = [[-66 r132, 0 r10, -66 r132]], - alwaysVisible = true, + pos = [[-66 r132, 0 r10, -66 r132]], + alwaysVisible = true, }, }, fireflameground = { - air = true, - class = [[CExpGenSpawner]], - count = 24, - ground = true, - water = true, + air = true, + class = [[CExpGenSpawner]], + count = 24, + ground = true, + water = true, underwater = true, properties = { - delay = [[0 r300]], + delay = [[0 r300]], explosiongenerator = [[custom:volcano_fire-burnground]], - pos = [[-60 r120, 0 r5, -60 r120]], - alwaysVisible = true, + pos = [[-60 r120, 0 r5, -60 r120]], + alwaysVisible = true, }, }, fireburngroundcircle = { - air = false, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, + air = false, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, underwater = true, - water = true, + water = true, properties = { - colormap = - [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[FireBall02-anim]], - animParams = [[8,8,80 r50]], - length = 0, - sidetexture = [[none]], - size = [[68 r36]], - sizegrowth = [[-0.5 r2.2]], - ttl = 270, - pos = [[0, 5, 0]], - rotParams = [[-2 r4, -2 r4, -180 r360]], + colormap = [[0 0 0 0.01 0.40 0.40 0.48 0.12 0.67 0.69 0.9 0.85 0.64 0.67 0.79 0.55 0.68 0.78 0.88 0.85 0.02 0.02 0.03 0.44 0.026 0.026 0.026 0.40 0.02 0.02 0.02 0.30 0.023 0.023 0.023 0.38 0 0 0 0.03 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[FireBall02-anim]], + animParams = [[8,8,80 r50]], + length = 0, + sidetexture = [[none]], + size = [[68 r36]], + sizegrowth = [[-0.5 r2.2]], + ttl = 270, + pos = [[0, 5, 0]], + rotParams = [[-2 r4, -2 r4, -180 r360]], alwaysVisible = true, - drawOrder = -1, + drawOrder = -1, }, }, }, @@ -1303,69 +1299,67 @@ return { ["volcano_fire-flames"] = { usedefaultexplosions = false, flame1 = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, properties = { - airdrag = 0.88, - colormap = - [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], - directional = false, - emitrot = 40, - emitrotspread = 30, - emitvector = [[0.2, -0.4, 0.2]], - gravity = [[0, 0.03 r0.04, 0]], - numparticles = [[0.50 r0.70]], - particlelife = 80, - particlelifespread = 75, - particlesize = 35, - particlesizespread = 57, - particlespeed = 1, + airdrag = 0.88, + colormap = [[0 0 0 0.01 0.95 0.95 1 0.4 0.65 0.65 0.68 0.2 0.1 0.1 0.1 0.18 0.08 0.07 0.06 0.12 0 0 0 0.01]], + directional = false, + emitrot = 40, + emitrotspread = 30, + emitvector = [[0.2, -0.4, 0.2]], + gravity = [[0, 0.03 r0.04, 0]], + numparticles = [[0.50 r0.70]], + particlelife = 80, + particlelifespread = 75, + particlesize = 35, + particlesizespread = 57, + particlespeed = 1, particlespeedspread = 1.3, - animParams = [[8,8,90 r50]], - rotParams = [[-3 r6, -3 r6, -180 r360]], - pos = [[-4 r8, -5 r15, -4 r8]], - sizegrowth = [[1.6 r0.6]], - sizemod = 0.98, - texture = [[FireBall02-anim]], - alwaysVisible = true, - drawOrder = 1, + animParams = [[8,8,90 r50]], + rotParams = [[-3 r6, -3 r6, -180 r360]], + pos = [[-4 r8, -5 r15, -4 r8]], + sizegrowth = [[1.6 r0.6]], + sizemod = 0.98, + texture = [[FireBall02-anim]], + alwaysVisible = true, + drawOrder = 1, }, }, blacksmoke = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, properties = { - airdrag = 0.70, - colormap = - [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.11 0.10 0.09 0.85 0.075 0.07 0.07 0.6 0.01 0.01 0.01 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 70, - emitvector = [[0.3, 1, 0.3]], - gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], - numparticles = [[0.55 r0.55]], - particlelife = 110, - particlelifespread = 60, - particlesize = 45, - particlesizespread = 60, - particlespeed = 3, + airdrag = 0.70, + colormap = [[0.01 0.01 0.01 0.01 0.02 0.02 0.01 0.2 0.15 0.14 0.12 0.68 0.11 0.10 0.09 0.85 0.075 0.07 0.07 0.6 0.01 0.01 0.01 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 70, + emitvector = [[0.3, 1, 0.3]], + gravity = [[-0.03 r0.06, 0.24 r0.3, -0.03 r0.06]], + numparticles = [[0.55 r0.55]], + particlelife = 110, + particlelifespread = 60, + particlesize = 45, + particlesizespread = 60, + particlespeed = 3, particlespeedspread = 2, - rotParams = [[-15 r30, -2 r4, -180 r360]], - pos = [[0.0, 30, 0.0]], - sizegrowth = [[0.55 r0.55]], - sizemod = 1, - texture = [[smoke-ice-anim]], - animParams = [[8,8,150 r80]], - useairlos = true, - alwaysVisible = true, - castShadow = true, - drawOrder = 1, + rotParams = [[-15 r30, -2 r4, -180 r360]], + pos = [[0.0, 30, 0.0]], + sizegrowth = [[0.55 r0.55]], + sizemod = 1, + texture = [[smoke-ice-anim]], + animParams = [[8,8,150 r80]], + useairlos = true, + alwaysVisible = true, + castShadow = true, + drawOrder = 1, }, }, }, @@ -1374,102 +1368,99 @@ return { usedefaultexplosions = false, flamematt = { - air = true, - class = [[CSimpleParticleSystem]], - count = 2, - ground = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, properties = { - airdrag = 0.92, - colormap = - [[0.25 0.22 0.18 0.75 0.75 0.77 0.71 1 0.72 0.51 0.39 1 0.67 0.47 0.34 0.99 0.63 0.41 0.27 0.98 0.58 0.37 0.29 0.97 0.48 0.31 0.22 0.91 0.11 0.11 0.12 0.50 0.016 0.011 0.07 0.45 0 0 0 0.01]], - directional = false, - emitrot = 90, - emitrotspread = 5, - emitvector = [[0.32, 0.7, 0.32]], - gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], - numparticles = [[0.67 r0.69]], - particlelife = 50, - particlelifespread = 60, - particlesize = 46, - particlesizespread = 130, - particlespeed = 3.20, + airdrag = 0.92, + colormap = [[0.25 0.22 0.18 0.75 0.75 0.77 0.71 1 0.72 0.51 0.39 1 0.67 0.47 0.34 0.99 0.63 0.41 0.27 0.98 0.58 0.37 0.29 0.97 0.48 0.31 0.22 0.91 0.11 0.11 0.12 0.50 0.016 0.011 0.07 0.45 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0.32, 0.7, 0.32]], + gravity = [[-0.025 r0.05, 0.03 r0.11, -0.025 r0.05]], + numparticles = [[0.67 r0.69]], + particlelife = 50, + particlelifespread = 60, + particlesize = 46, + particlesizespread = 130, + particlespeed = 3.20, particlespeedspread = 5.20, - rotParams = [[-5 r10, -20 r40, -180 r360]], - animParams = [[16,6,88 r55]], - pos = [[-3 r6, -25 r12, -3 r6]], - sizegrowth = [[1.10 r1.05]], - sizemod = 0.98, - texture = [[BARFlame02]], - alwaysVisible = true, - drawOrder = 2, - castShadow = true, + rotParams = [[-5 r10, -20 r40, -180 r360]], + animParams = [[16,6,88 r55]], + pos = [[-3 r6, -25 r12, -3 r6]], + sizegrowth = [[1.10 r1.05]], + sizemod = 0.98, + texture = [[BARFlame02]], + alwaysVisible = true, + drawOrder = 2, + castShadow = true, }, }, flamedark = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, properties = { - airdrag = 0.93, - colormap = - [[0.26 0.29 0.21 0.1 0.36 0.27 0.29 0.90 0.34 0.43 0.40 0.88 0.33 0.29 0.20 0.85 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0 0 0 0.01]], - directional = false, - emitrot = 85, - emitrotspread = 25, - emitvector = [[0.28, 0.9, 0.28]], - gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], - numparticles = [[0.32 r0.68]], - particlelife = 25, - particlelifespread = 35, - particlesize = 72, - particlesizespread = 100, - particlespeed = 0.10, + airdrag = 0.93, + colormap = [[0.26 0.29 0.21 0.1 0.36 0.27 0.29 0.90 0.34 0.43 0.40 0.88 0.33 0.29 0.20 0.85 0.33 0.27 0.18 0.83 0.29 0.22 0.14 0.80 0.29 0.20 0.13 0.75 0.22 0.16 0.11 0.55 0.05 0.06 0.09 0.35 0.021 0.022 0.023 0.2 0 0 0 0.01]], + directional = false, + emitrot = 85, + emitrotspread = 25, + emitvector = [[0.28, 0.9, 0.28]], + gravity = [[-0.02 r0.04, 0.015 r0.032, -0.02 r0.04]], + numparticles = [[0.32 r0.68]], + particlelife = 25, + particlelifespread = 35, + particlesize = 72, + particlesizespread = 100, + particlespeed = 0.10, particlespeedspread = 0.16, - rotParams = [[-5 r10, 0, -180 r360]], - animParams = [[16,6,80 r55]], - pos = [[0, 60 r25, 0]], - sizegrowth = [[1.3 r1.1]], - sizemod = 0.99, - texture = [[BARFlame02]], - alwaysVisible = true, - drawOrder = 3, - castShadow = true, + rotParams = [[-5 r10, 0, -180 r360]], + animParams = [[16,6,80 r55]], + pos = [[0, 60 r25, 0]], + sizegrowth = [[1.3 r1.1]], + sizemod = 0.99, + texture = [[BARFlame02]], + alwaysVisible = true, + drawOrder = 3, + castShadow = true, }, }, sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, underwater = true, properties = { - airdrag = 0.92, - colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], - directional = true, - emitrot = 35, - emitrotspread = 22, - emitvector = [[0, 1, 0]], - gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], - numparticles = [[0.50 r0.65]], - particlelife = 11, - particlelifespread = 11, - particlesize = -24, - particlesizespread = -8, - particlespeed = 9, + airdrag = 0.92, + colormap = [[0 0 0 0.01 0 0 0 0.01 1 0.88 0.77 0.030 0.8 0.55 0.3 0.015 0 0 0 0]], + directional = true, + emitrot = 35, + emitrotspread = 22, + emitvector = [[0, 1, 0]], + gravity = [[-0.4 r0.8, -0.1 r0.3, -0.4 r0.8]], + numparticles = [[0.50 r0.65]], + particlelife = 11, + particlelifespread = 11, + particlesize = -24, + particlesizespread = -8, + particlespeed = 9, particlespeedspread = 4, - pos = [[-7 r14, 17 r15, -7 r14]], - sizegrowth = 0.04, - sizemod = 0.91, - texture = [[gunshotxl2]], - useairlos = false, - alwaysVisible = true, - drawOrder = 2, + pos = [[-7 r14, 17 r15, -7 r14]], + sizegrowth = 0.04, + sizemod = 0.91, + texture = [[gunshotxl2]], + useairlos = false, + alwaysVisible = true, + drawOrder = 2, }, }, }, - } diff --git a/effects/watersplashes.lua b/effects/watersplashes.lua index 9fe99104c14..4dc06a221a6 100644 --- a/effects/watersplashes.lua +++ b/effects/watersplashes.lua @@ -5,692 +5,692 @@ return { - -- Commander sea laser bubbles (used in unit weapondefs) - ["com_sea_laser_bubbles"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.4 0.8 1 .1 0.6 .9 0.95 .4 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = [[0 r-30 r30]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 15, - particlesize = 1, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-5 r5, 3 r8, 0 r-5 r5]], - sizegrowth = [[0 0 0]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Commander sea laser bubbles (used in unit weapondefs) + ["com_sea_laser_bubbles"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.4 0.8 1 .1 0.6 .9 0.95 .4 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = [[0 r-30 r30]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-5 r5, 3 r8, 0 r-5 r5]], + sizegrowth = [[0 0 0]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - -- Small water bubbles - ["small_water_bubbles"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.4 0.8 1 .1 0.6 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 15, - emitrotspread = [[0 r-30 r30]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 4, - particlelifespread = 18, - particlesize = 1, - particlesizespread = 3, - particlespeed = [[0 r4 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-12 r12, 5 r15, 0 r-12 r12]], - sizegrowth = [[0 0 0]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Small water bubbles + ["small_water_bubbles"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.4 0.8 1 .1 0.6 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 15, + emitrotspread = [[0 r-30 r30]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 4, + particlelifespread = 18, + particlesize = 1, + particlesizespread = 3, + particlespeed = [[0 r4 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-12 r12, 5 r15, 0 r-12 r12]], + sizegrowth = [[0 0 0]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - -- Extra small water splash - ["watersplash_extrasmall"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 35, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.35, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], - sizegrowth = [[0.30 r1.6 r-1.6]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 30, - particlelife = 4, - particlelifespread = 14, - particlesize = [[0.75 r2]], - particlesizespread = 0, - particlespeed = [[1 r1]], - particlespeedspread = 0, - pos = [[0 r-2 r2, 4, 0 r-2 r2]], - sizegrowth = [[0.040]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 35, - particlelife = 20, - particlelifespread = 6, - particlesize = 2, - particlesizespread = 3, - particlespeed = [[3 i0.25]], - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = -0.15, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Extra small water splash + ["watersplash_extrasmall"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 35, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.35, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], + sizegrowth = [[0.30 r1.6 r-1.6]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 30, + particlelife = 4, + particlelifespread = 14, + particlesize = [[0.75 r2]], + particlesizespread = 0, + particlespeed = [[1 r1]], + particlespeedspread = 0, + pos = [[0 r-2 r2, 4, 0 r-2 r2]], + sizegrowth = [[0.040]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 35, + particlelife = 20, + particlelifespread = 6, + particlesize = 2, + particlesizespread = 3, + particlespeed = [[3 i0.25]], + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = -0.15, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - -- Small water splash (used by unit_water_depth_damage.lua) - ["watersplash_small"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 20, - particlelife = 2, - particlelifespread = 20, - particlesize = 0.5, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-10 r10, 3 r5, 0 r-10 r10]], - sizegrowth = [[0.17 r1.0 r-1.0]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 50, - particlelife = 4, - particlelifespread = 20, - particlesize = [[1 r2]], - particlesizespread = 0, - particlespeed = [[1 r1]], - particlespeedspread = 0, - pos = [[0 r-2 r2,4, 0 r-2 r2]], - sizegrowth = [[0.05]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 30, - particlelife = 40, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 5, - particlespeed = [[3 i0.25]], - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = -0.35, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Small water splash (used by unit_water_depth_damage.lua) + ["watersplash_small"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 20, + particlesize = 0.5, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-10 r10, 3 r5, 0 r-10 r10]], + sizegrowth = [[0.17 r1.0 r-1.0]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 50, + particlelife = 4, + particlelifespread = 20, + particlesize = [[1 r2]], + particlesizespread = 0, + particlespeed = [[1 r1]], + particlespeedspread = 0, + pos = [[0 r-2 r2,4, 0 r-2 r2]], + sizegrowth = [[0.05]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 30, + particlelife = 40, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 5, + particlespeed = [[3 i0.25]], + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = -0.35, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - -- Small light water splash - ["watersplash_small_light"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 2, - particlelifespread = 20, - particlesize = 1, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-10 r10, 3 r5, 0 r-10 r10]], - sizegrowth = [[0.17 r1.0 r-1.0]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 2, - particlelife = 4, - particlelifespread = 20, - particlesize = [[1 r2]], - particlesizespread = 0, - particlespeed = [[1 r1]], - particlespeedspread = 0, - pos = [[0 r-2 r2,4, 0 r-2 r2]], - sizegrowth = [[0.05]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = true, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 5, - particlespeed = [[1.5 i0.25]], - particlespeedspread = 2, - pos = [[0, 2, 0]], - sizegrowth = -0.35, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - dirtcloud = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = false, - underwater = false, - properties = { - airdrag = 0.9, - colormap = [[0.7 0.4 0.3 0.8 0.5 0.4 0.3 0.6 0 0 0 0]], - directional = false, - emitrot = 80, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 4, - particlelife = 15, - particlelifespread = 10, - particlesize = 3, - particlesizespread = 3, - particlespeed = 1, - particlespeedspread = 4, - pos = [[0, 0, 0]], - sizegrowth = 1, - sizemod = 1.0, - texture = [[dirt]], - }, - }, - }, + -- Small light water splash + ["watersplash_small_light"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 2, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-10 r10, 3 r5, 0 r-10 r10]], + sizegrowth = [[0.17 r1.0 r-1.0]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 4, + particlelifespread = 20, + particlesize = [[1 r2]], + particlesizespread = 0, + particlespeed = [[1 r1]], + particlespeedspread = 0, + pos = [[0 r-2 r2,4, 0 r-2 r2]], + sizegrowth = [[0.05]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 5, + particlespeed = [[1.5 i0.25]], + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = -0.35, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtcloud = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + airdrag = 0.9, + colormap = [[0.7 0.4 0.3 0.8 0.5 0.4 0.3 0.6 0 0 0 0]], + directional = false, + emitrot = 80, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 15, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 3, + particlespeed = 1, + particlespeedspread = 4, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[dirt]], + }, + }, + }, - -- Large water splash (used by unit_water_depth_damage.lua) - ["watersplash_large"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[explowater]], - length = 45, - sidetexture = [[none]], - size = 25.9, - sizegrowth = 2, - ttl = 100, - pos = [[0.5, 1, 0.0]], - }, - }, - circlewaves = { - air = false, - class = [[CSimpleParticleSystem]], - count = 2, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.92, - colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 6, - particlelife = 5, - particlelifespread = 40, - particlesize = [[2 r5]], - particlesizespread = 0, - particlespeed = [[3 i0.3]], - particlespeedspread = 0, - pos = [[0 r-10 r10,4, 0 r-10 r10]], - sizegrowth = [[0.8]], - sizemod = 1.0, - texture = [[wave]], - useairlos = true, - }, - }, - waterrush = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.97, - colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], - directional = false, - emitrot = 1, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.12, 0]], - numparticles = 1, - particlelife = 40, - particlelifespread = 70, - particlesize = [[12 r25]], - particlesizespread = 30, - particlespeed = [[5 i0.7]], - particlespeedspread = 0, - pos = [[0, 50 r50, 0]], - sizegrowth = [[0.8]], - sizemod = 1, - texture = [[waterrush]], - useairlos = true, - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.94, - colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], - directional = true, - emitrot = 5, - emitrotspread = 10, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 20, - particlelife = 25, - particlelifespread = 35, - particlesize = 8, - particlesizespread = 25, - particlespeed = 1.8, - particlespeedspread = 12, - pos = [[0 r-10 r10,-32, 0 r-10 r10]], - sizegrowth = -0.5, - sizemod = 0.99, - texture = [[gunshotxl]], - useairlos = false, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 0.96, - colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], - directional = true, - emitrot = 20, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -0.1, 0]], - numparticles = 12, - particlelife = 20, - particlelifespread = 18, - particlesize = 3.5, - particlesizespread = 23, - particlespeed = [[3 i0.25]], - particlespeedspread = 2, - pos = [[0, 18, 0]], - sizegrowth = -0.21, - sizemod = 1.0, - texture = [[explowater]], - useairlos = true, - }, - }, - }, + -- Large water splash (used by unit_water_depth_damage.lua) + ["watersplash_large"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.6 0.61 0.63 0.013 0.40 0.41 0.43 0.01 0.1 0.1 0.1 0.006 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[explowater]], + length = 45, + sidetexture = [[none]], + size = 25.9, + sizegrowth = 2, + ttl = 100, + pos = [[0.5, 1, 0.0]], + }, + }, + circlewaves = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0 0.4 0.4 0.4 .013 0.3 .3 0.3 .008 0.1 .1 0.1 .006 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 5, + particlelifespread = 40, + particlesize = [[2 r5]], + particlesizespread = 0, + particlespeed = [[3 i0.3]], + particlespeedspread = 0, + pos = [[0 r-10 r10,4, 0 r-10 r10]], + sizegrowth = [[0.8]], + sizemod = 1.0, + texture = [[wave]], + useairlos = true, + }, + }, + waterrush = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0 0 0 0.4 0.4 0.4 .012 0.3 .3 0.3 .006 0.1 .1 0.1 .005 0 0 0 0.01]], + directional = false, + emitrot = 1, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.12, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 70, + particlesize = [[12 r25]], + particlesizespread = 30, + particlespeed = [[5 i0.7]], + particlespeedspread = 0, + pos = [[0, 50 r50, 0]], + sizegrowth = [[0.8]], + sizemod = 1, + texture = [[waterrush]], + useairlos = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.94, + colormap = [[0.44 0.44 0.48 0.015 0.3 0.31 0.35 0.01 0 0 0 0.005]], + directional = true, + emitrot = 5, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 35, + particlesize = 8, + particlesizespread = 25, + particlespeed = 1.8, + particlespeedspread = 12, + pos = [[0 r-10 r10,-32, 0 r-10 r10]], + sizegrowth = -0.5, + sizemod = 0.99, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 0.96, + colormap = [[0.6 0.6 0.63 0.009 0.40 0.4 0.43 0.013 0.1 0.1 0.1 0.006 0 0 0 0.01]], + directional = true, + emitrot = 20, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -0.1, 0]], + numparticles = 12, + particlelife = 20, + particlelifespread = 18, + particlesize = 3.5, + particlesizespread = 23, + particlespeed = [[3 i0.25]], + particlespeedspread = 2, + pos = [[0, 18, 0]], + sizegrowth = -0.21, + sizemod = 1.0, + texture = [[explowater]], + useairlos = true, + }, + }, + }, - -- Extra large water splash - ["watersplash_extralarge"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 80, - particlelife = 6, - particlelifespread = 30, - particlesize = 1, - particlesizespread = 8, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 3, - pos = [[0 r-10 r10, 5 r20, 0 r-10 r10]], - sizegrowth = [[-0.50 r0.6]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, 0, 0]], - numparticles = 80, - particlelife = 4, - particlelifespread = 30, - particlesize = [[2 r4]], - particlesizespread = 0, - particlespeed = [[1 r8]], - particlespeedspread = 0, - pos = [[0 r-10 r10, 4, 0 r-10 r10]], - sizegrowth = [[0.50 r-0.6]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 60, - particlelife = 48, - particlelifespread = 20, - particlesize = 5, - particlesizespread = 25, - particlespeed = [[3 i0.25]], - particlespeedspread = 6, - pos = [[0, 18, 0]], - sizegrowth = -0.55, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Extra large water splash + ["watersplash_extralarge"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 80, + particlelife = 6, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 8, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 3, + pos = [[0 r-10 r10, 5 r20, 0 r-10 r10]], + sizegrowth = [[-0.50 r0.6]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 80, + particlelife = 4, + particlelifespread = 30, + particlesize = [[2 r4]], + particlesizespread = 0, + particlespeed = [[1 r8]], + particlespeedspread = 0, + pos = [[0 r-10 r10, 4, 0 r-10 r10]], + sizegrowth = [[0.50 r-0.6]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 60, + particlelife = 48, + particlelifespread = 20, + particlesize = 5, + particlesizespread = 25, + particlespeed = [[3 i0.25]], + particlespeedspread = 6, + pos = [[0, 18, 0]], + sizegrowth = -0.55, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, - -- Emerge splash (submarine surfacing) - ["watersplash_emerge"] = { - waterball = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 30, - emitrotspread = [[0 r-360 r360]], - emitvector = [[0, 1, 0]], - gravity = [[0, -.15, 0]], - numparticles = 35, - particlelife = 2, - particlelifespread = 10, - particlesize = 0.35, - particlesizespread = 2, - particlespeed = [[0 r3 i-0.05]], - particlespeedspread = 2, - pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], - sizegrowth = [[0.30 r1.6 r-1.6]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterball2 = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], - directional = true, - emitrot = 90, - emitrotspread = 0, - emitvector = [[0, 1, 0]], - gravity = [[0, -.25, 0]], - numparticles = 30, - particlelife = 4, - particlelifespread = 14, - particlesize = [[0.75 r2]], - particlesizespread = 0, - particlespeed = [[1 r1]], - particlespeedspread = 0, - pos = [[0 r-2 r2, 4, 0 r-2 r2]], - sizegrowth = [[0.040]], - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - waterexplosion = { - air = false, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - airdrag = 1, - colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], - directional = false, - emitrot = 0, - emitrotspread = [[20 r-20 r20]], - emitvector = [[0,1,0]], - gravity = [[0, -.25, 0]], - numparticles = 35, - particlelife = 20, - particlelifespread = 6, - particlesize = 2, - particlesizespread = 3, - particlespeed = [[3 i0.25]], - particlespeedspread = 2, - pos = [[0, 0, 0]], - sizegrowth = -0.15, - sizemod = 1.0, - texture = [[dirt]], - useairlos = true, - }, - }, - }, + -- Emerge splash (submarine surfacing) + ["watersplash_emerge"] = { + waterball = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 30, + emitrotspread = [[0 r-360 r360]], + emitvector = [[0, 1, 0]], + gravity = [[0, -.15, 0]], + numparticles = 35, + particlelife = 2, + particlelifespread = 10, + particlesize = 0.35, + particlesizespread = 2, + particlespeed = [[0 r3 i-0.05]], + particlespeedspread = 2, + pos = [[0 r-10 r10, 1 r5, 0 r-10 r10]], + sizegrowth = [[0.30 r1.6 r-1.6]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterball2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0 0.8 0.8 1 .1 0.9 .9 0.95 .8 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -.25, 0]], + numparticles = 30, + particlelife = 4, + particlelifespread = 14, + particlesize = [[0.75 r2]], + particlesizespread = 0, + particlespeed = [[1 r1]], + particlespeedspread = 0, + pos = [[0 r-2 r2, 4, 0 r-2 r2]], + sizegrowth = [[0.040]], + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + waterexplosion = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 1 0.8 0.8 1 1 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = [[20 r-20 r20]], + emitvector = [[0,1,0]], + gravity = [[0, -.25, 0]], + numparticles = 35, + particlelife = 20, + particlelifespread = 6, + particlesize = 2, + particlesizespread = 3, + particlespeed = [[3 i0.25]], + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = -0.15, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, } diff --git a/effects/waterwake.lua b/effects/waterwake.lua index 8bd67c78c02..2d5d2149a5c 100644 --- a/effects/waterwake.lua +++ b/effects/waterwake.lua @@ -1,817 +1,816 @@ -- waterwake return { - ["waterwake"] = { - wake = { - air = true, - class = [[CWakeProjectile]], - count = 1, - ground = true, - underwater = true, - water = true, - properties = { - startsize = 10, - sizeexpansion = 10, - alpha = 0.9, - alphafalloff = 0.5, - fadeuptime = 2, - texture = [[fogdirty]], - }, - }, - }, + ["waterwake"] = { + wake = { + air = true, + class = [[CWakeProjectile]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + startsize = 10, + sizeexpansion = 10, + alpha = 0.9, + alphafalloff = 0.5, + fadeuptime = 2, + texture = [[fogdirty]], + }, + }, + }, - ["waterwake-tiny"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[4.1 r3]], - sizegrowth = [[2.5 r1.1]], - ttl = 55, - rotParams = [[-70 r140, -10 r20, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - useairlos = false, - }, - }, - }, + ["waterwake-tiny"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.24 0.24 0.24 0.24 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[4.1 r3]], + sizegrowth = [[2.5 r1.1]], + ttl = 55, + rotParams = [[-70 r140, -10 r20, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + useairlos = false, + }, + }, + }, - ["waterwake-tiny-long"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.1 0.1 0.1 0.05 0.4 0.4 0.4 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[9 r2.5]], - sizegrowth = [[0.2 r0.4]], - ttl = 55, - rotParams = [[-60 r120, -10 r20, -180 r360]], - pos = [[-5 r10, 1, -5 r10]], - useairlos = false, - }, - }, - waterfoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[6 r3]], - sizegrowth = [[0.65 r1.0]], - ttl = 24, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - }, + ["waterwake-tiny-long"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.1 0.1 0.05 0.4 0.4 0.4 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[9 r2.5]], + sizegrowth = [[0.2 r0.4]], + ttl = 55, + rotParams = [[-60 r120, -10 r20, -180 r360]], + pos = [[-5 r10, 1, -5 r10]], + useairlos = false, + }, + }, + waterfoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[6 r3]], + sizegrowth = [[0.65 r1.0]], + ttl = 24, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + }, - ["waterwake-small"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.4 0.4 0.4 0.28 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[7 r4]], - sizegrowth = [[1.4 r1.3]], - ttl = 70, - rotParams = [[-50 r100, -10 r20, -180 r360]], - pos = [[-5 r10, 1, -5 r10]], - useairlos = false, - }, - }, - }, + ["waterwake-small"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.4 0.4 0.4 0.28 0.38 0.38 0.38 0.38 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[7 r4]], + sizegrowth = [[1.4 r1.3]], + ttl = 70, + rotParams = [[-50 r100, -10 r20, -180 r360]], + pos = [[-5 r10, 1, -5 r10]], + useairlos = false, + }, + }, + }, - ["waterwake-small-hover"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.3 0.3 0.3 0.25 0.4 0.4 0.4 0.3 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[7 r3]], - sizegrowth = [[1.5 r1]], - ttl = 40, - rotParams = [[-50 r100, -10 r20, -180 r360]], - pos = [[-5 r10, 1, -5 r10]], - useairlos = false, - }, - }, - }, + ["waterwake-small-hover"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.3 0.3 0.3 0.25 0.4 0.4 0.4 0.3 0.13 0.13 0.13 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[7 r3]], + sizegrowth = [[1.5 r1]], + ttl = 40, + rotParams = [[-50 r100, -10 r20, -180 r360]], + pos = [[-5 r10, 1, -5 r10]], + useairlos = false, + }, + }, + }, - ["waterwake-small-long"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.11 0.11 0.11 0.10 0.40 0.40 0.40 0.3 0.14 0.14 0.14 0.16 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[16 r4]], - sizegrowth = [[-0.1 r0.3]], - ttl = 80, - rotParams = [[-60 r120, -10 r20, -180 r360]], - pos = [[-5 r10, 1, -5 r10]], - useairlos = false, - }, - }, - waterfoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[8 r6]], - sizegrowth = [[0.7 r1.1]], - ttl = 22, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - }, + ["waterwake-small-long"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.11 0.11 0.11 0.10 0.40 0.40 0.40 0.3 0.14 0.14 0.14 0.16 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[16 r4]], + sizegrowth = [[-0.1 r0.3]], + ttl = 80, + rotParams = [[-60 r120, -10 r20, -180 r360]], + pos = [[-5 r10, 1, -5 r10]], + useairlos = false, + }, + }, + waterfoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[8 r6]], + sizegrowth = [[0.7 r1.1]], + ttl = 22, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + }, - ["waterwake-medium"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = [[1]], - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.15 0.15 0.15 0.15 0.3 0.3 0.3 0.28 0.12 0.12 0.12 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[7.5 r4.5]], - sizegrowth = [[1.3 r1.1]], - ttl = 80, - rotParams = [[-50 r100, -10 r20, -180 r360]], - pos = [[-7 r14, 1, -7 r14]], - useairlos = false, - }, - }, - }, + ["waterwake-medium"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = [[1]], + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.15 0.15 0.15 0.15 0.3 0.3 0.3 0.28 0.12 0.12 0.12 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[7.5 r4.5]], + sizegrowth = [[1.3 r1.1]], + ttl = 80, + rotParams = [[-50 r100, -10 r20, -180 r360]], + pos = [[-7 r14, 1, -7 r14]], + useairlos = false, + }, + }, + }, - ["waterwake-medium-splash"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = [[1]], - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.15 0.15 0.15 0.15 0.3 0.3 0.3 0.28 0.12 0.12 0.12 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[7.5 r4.5]], - sizegrowth = [[1.3 r1.1]], - ttl = 70, - rotParams = [[-50 r100, -10 r20, -180 r360]], - pos = [[-7 r14, 1, -7 r14]], - useairlos = false, - }, - }, - waterfoam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[8 r6]], - sizegrowth = [[0.7 r1.1]], - ttl = 18, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - }, + ["waterwake-medium-splash"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = [[1]], + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.15 0.15 0.15 0.15 0.3 0.3 0.3 0.28 0.12 0.12 0.12 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[7.5 r4.5]], + sizegrowth = [[1.3 r1.1]], + ttl = 70, + rotParams = [[-50 r100, -10 r20, -180 r360]], + pos = [[-7 r14, 1, -7 r14]], + useairlos = false, + }, + }, + waterfoam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.65 0.65 0.70 0.017 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[8 r6]], + sizegrowth = [[0.7 r1.1]], + ttl = 18, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + }, - ["waterwake-large"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.15 0.15 0.15 0.2 0.3 0.3 0.3 0.3 0.11 0.11 0.11 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[6 r10]], - sizegrowth = [[2.0 r1.9]], - ttl = 150, - rotParams = [[-20 r40, -5 r10, -180 r360]], - pos = [[-10 r20, 1, -10 r20]], - useairlos = false, - }, - }, - waterringdetails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.4 0.4 0.4 0.28 0.6 0.6 0.6 0.40 0.13 0.13 0.13 0.15 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[6 r6]], - sizegrowth = [[1.5 r1.6]], - ttl = 30, - rotParams = [[-25 r50, -7 r14, -180 r360]], - pos = [[-10 r20, 1, -10 r20]], - useairlos = false, - }, - }, - }, + ["waterwake-large"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.15 0.15 0.15 0.2 0.3 0.3 0.3 0.3 0.11 0.11 0.11 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[6 r10]], + sizegrowth = [[2.0 r1.9]], + ttl = 150, + rotParams = [[-20 r40, -5 r10, -180 r360]], + pos = [[-10 r20, 1, -10 r20]], + useairlos = false, + }, + }, + waterringdetails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.4 0.4 0.4 0.28 0.6 0.6 0.6 0.40 0.13 0.13 0.13 0.15 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[6 r6]], + sizegrowth = [[1.5 r1.6]], + ttl = 30, + rotParams = [[-25 r50, -7 r14, -180 r360]], + pos = [[-10 r20, 1, -10 r20]], + useairlos = false, + }, + }, + }, - ["waterwake-huge"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.15 0.15 0.15 0.2 0.3 0.3 0.3 0.3 0.11 0.11 0.11 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[5 r15]], - sizegrowth = [[2.0 r1.9]], - ttl = 250, - rotParams = [[-20 r40, -5 r10, -180 r360]], - pos = [[-12 r24, 1, -12 r24]], - useairlos = false, - }, - }, - waterringdetails = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.4 0.4 0.4 0.28 0.6 0.6 0.6 0.40 0.13 0.13 0.13 0.15 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[7 r7]], - sizegrowth = [[1.6 r1.7]], - ttl = 40, - rotParams = [[-25 r50, -7 r14, -180 r360]], - pos = [[-10 r20, 1, -10 r20]], - useairlos = false, - }, - }, - }, + ["waterwake-huge"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.15 0.15 0.15 0.2 0.3 0.3 0.3 0.3 0.11 0.11 0.11 0.15 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[5 r15]], + sizegrowth = [[2.0 r1.9]], + ttl = 250, + rotParams = [[-20 r40, -5 r10, -180 r360]], + pos = [[-12 r24, 1, -12 r24]], + useairlos = false, + }, + }, + waterringdetails = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.4 0.4 0.4 0.28 0.6 0.6 0.6 0.40 0.13 0.13 0.13 0.15 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[7 r7]], + sizegrowth = [[1.6 r1.7]], + ttl = 40, + rotParams = [[-25 r50, -7 r14, -180 r360]], + pos = [[-10 r20, 1, -10 r20]], + useairlos = false, + }, + }, + }, - ["waterblast-large"] = { - waterfoamy = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.3 0.3 0.3 0.15 0.45 0.45 0.45 0.5 0.18 0.18 0.18 0.30 0.09 0.09 0.09 0.1 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[wakegrey]], - length = 45, - sidetexture = [[none]], - size = [[42 r5]], - sizegrowth = [[0.27 r0.1]], - ttl = 40, - rotParams = [[-10 r20, -2 r4, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - --waterblastcircle = { - -- air = true, - -- class = [[CBitmapMuzzleFlame]], - -- count = 1, - -- ground = false, - -- underwater = 1, - -- water = true, - -- properties = { - -- colormap = [[0.20 0.20 0.20 0.11 0.25 0.25 0.25 0.20 0.11 0.11 0.11 0.11 0 0 0 0.01]], - -- dir = [[dir]], - -- frontoffset = 0, - -- fronttexture = [[explowaveblastxl]], -- this doesnt exist - -- length = 45, - -- sidetexture = [[none]], - -- size = [[55 r4]], - -- sizegrowth = [[0.70 r0.13]], - -- ttl = [[24 r4]], - -- rotParams = [[-5 r10, -4 r8, -10 r20]], - -- pos = [[0, 1, 0]], - -- useairlos = false, - -- }, - --}, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 0, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.95, - colormap = [[0.65 0.65 0.70 0.5 0.3 0.31 0.35 0.25 0 0 0 0.005]], - directional = true, - emitrot = 4, - emitrotspread = 4, - emitvector = [[1, 0, 0]], - gravity = [[0, 0, 0]], - numparticles = 1, - particlelife = 20, - particlelifespread = 12, - particlesize = 64, - particlesizespread = 7, - particlespeed = 4.5, - particlespeedspread = 2.8, - --rotParams = [[-1 r2, 0, -180]], - pos = [[-15 r30, 0, -15 r30]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[waterfoam]], -- was [[explosionwaveblast]], - useairlos = false, - }, - }, - }, + ["waterblast-large"] = { + waterfoamy = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.3 0.3 0.3 0.15 0.45 0.45 0.45 0.5 0.18 0.18 0.18 0.30 0.09 0.09 0.09 0.1 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[wakegrey]], + length = 45, + sidetexture = [[none]], + size = [[42 r5]], + sizegrowth = [[0.27 r0.1]], + ttl = 40, + rotParams = [[-10 r20, -2 r4, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + --waterblastcircle = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = false, + -- underwater = 1, + -- water = true, + -- properties = { + -- colormap = [[0.20 0.20 0.20 0.11 0.25 0.25 0.25 0.20 0.11 0.11 0.11 0.11 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[explowaveblastxl]], -- this doesnt exist + -- length = 45, + -- sidetexture = [[none]], + -- size = [[55 r4]], + -- sizegrowth = [[0.70 r0.13]], + -- ttl = [[24 r4]], + -- rotParams = [[-5 r10, -4 r8, -10 r20]], + -- pos = [[0, 1, 0]], + -- useairlos = false, + -- }, + --}, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.95, + colormap = [[0.65 0.65 0.70 0.5 0.3 0.31 0.35 0.25 0 0 0 0.005]], + directional = true, + emitrot = 4, + emitrotspread = 4, + emitvector = [[1, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 12, + particlesize = 64, + particlesizespread = 7, + particlespeed = 4.5, + particlespeedspread = 2.8, + --rotParams = [[-1 r2, 0, -180]], + pos = [[-15 r30, 0, -15 r30]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[waterfoam]], -- was [[explosionwaveblast]], + useairlos = false, + }, + }, + }, - ["bowsplash-small"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[4.8 r1.7]], - sizegrowth = [[3.4 r1.6]], - ttl = 19, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 50, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0.5 r1]], - particlelife = 10, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 5, - particlespeed = 2.2, - particlespeedspread = 2, - rotParams = [[-100 r200, 0, -180 r360]], - pos = [[-10 r20, 0, -10 r20]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - }, - }, - }, + ["bowsplash-small"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[4.8 r1.7]], + sizegrowth = [[3.4 r1.6]], + ttl = 19, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 50, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0.5 r1]], + particlelife = 10, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 5, + particlespeed = 2.2, + particlespeedspread = 2, + rotParams = [[-100 r200, 0, -180 r360]], + pos = [[-10 r20, 0, -10 r20]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, -["bowsplash-small-hover"] = { - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 50, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0.5 r1]], - particlelife = 10, - particlelifespread = 12, - particlesize = 6, - particlesizespread = 6, - particlespeed = 2.4, - particlespeedspread = 2.2, - rotParams = [[-120 r240, 0, -180 r360]], - pos = [[-10 r20, 0, -10 r20]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - }, - }, - }, + ["bowsplash-small-hover"] = { + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 50, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0.5 r1]], + particlelife = 10, + particlelifespread = 12, + particlesize = 6, + particlesizespread = 6, + particlespeed = 2.4, + particlespeedspread = 2.2, + rotParams = [[-120 r240, 0, -180 r360]], + pos = [[-10 r20, 0, -10 r20]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, - ["hover-wake-tiny"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[8.1 r2.8]], - sizegrowth = [[0.8 r0.7]], - ttl = 42, - rotParams = [[-15 r30, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - }, + ["hover-wake-tiny"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[8.1 r2.8]], + sizegrowth = [[0.8 r0.7]], + ttl = 42, + rotParams = [[-15 r30, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + }, - ["hover-wake-small"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[9.9 r4.5]], - sizegrowth = [[0.9 r0.5]], - ttl = 45, - rotParams = [[-15 r30, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - }, + ["hover-wake-small"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[9.9 r4.5]], + sizegrowth = [[0.9 r0.5]], + ttl = 45, + rotParams = [[-15 r30, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + }, - ["hover-wake-large"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[12.9 r5.5]], - sizegrowth = [[0.9 r0.5]], - ttl = 50, - rotParams = [[-15 r30, 0, -180 r360]], - pos = [[-4 r8, 1, -4 r8]], - useairlos = false, - }, - }, - }, + ["hover-wake-large"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.35 0.35 0.35 0.012 0.55 0.55 0.55 0.015 0.25 0.25 0.25 0.012 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[12.9 r5.5]], + sizegrowth = [[0.9 r0.5]], + ttl = 50, + rotParams = [[-15 r30, 0, -180 r360]], + pos = [[-4 r8, 1, -4 r8]], + useairlos = false, + }, + }, + }, - ["bowsplash-medium"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[7.5 r5.5]], - sizegrowth = [[2 r1]], - ttl = 21, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 60, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0.7 r1]], - particlelife = 10, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 6, - particlespeed = 4, - particlespeedspread = 2.6, - rotParams = [[-100 r200, 0, -180 r360]], - pos = [[-10 r20, 0, -10 r20]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - }, - }, - }, + ["bowsplash-medium"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[7.5 r5.5]], + sizegrowth = [[2 r1]], + ttl = 21, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 60, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0.7 r1]], + particlelife = 10, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 6, + particlespeed = 4, + particlespeedspread = 2.6, + rotParams = [[-100 r200, 0, -180 r360]], + pos = [[-10 r20, 0, -10 r20]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, -["bowsplash-large"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[8.9 r6.2]], - sizegrowth = [[2.1 r0.8]], - ttl = 23, - rotParams = [[-50 r100, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 65, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = [[0.7 r1]], - particlelife = 10, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 7, - particlespeed = 4.5, - particlespeedspread = 2.8, - rotParams = [[-100 r200, 0, -180 r360]], - pos = [[-15 r30, 0, -15 r30]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - }, - }, - }, + ["bowsplash-large"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[8.9 r6.2]], + sizegrowth = [[2.1 r0.8]], + ttl = 23, + rotParams = [[-50 r100, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.65 0.65 0.70 0.26 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 65, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = [[0.7 r1]], + particlelife = 10, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 7, + particlespeed = 4.5, + particlespeedspread = 2.8, + rotParams = [[-100 r200, 0, -180 r360]], + pos = [[-15 r30, 0, -15 r30]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, - ["bowsplash-huge"] = { - waterring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = false, - underwater = 1, - water = true, - properties = { - colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], - dir = [[0, 1, 0]], - frontoffset = 0, - fronttexture = [[waterfoam]], - length = 45, - sidetexture = [[none]], - size = [[11 r7.8]], - sizegrowth = [[1.8 r0.9]], - ttl = 24, - rotParams = [[-25 r50, 0, -180 r360]], - pos = [[0, 1, 0]], - useairlos = false, - }, - }, - splashes = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.85, - colormap = [[0.70 0.70 0.75 0.2 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 50, - emitrotspread = 4, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.08, 0]], - numparticles = 1, - particlelife = 10, - particlelifespread = 12, - particlesize = 5, - particlesizespread = 7, - particlespeed = 5.5, - particlespeedspread = 3.5, - rotParams = [[-100 r200, 0, -180 r360]], - pos = [[-10 r20, 0, -10 r20]], - sizegrowth = 0.1, - sizemod = 0.98, - texture = [[randomdots]], - useairlos = false, - }, - }, - }, - ["enginespurt-huge"] = { - enginespurts = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = false, - water = true, - underwater = true, - properties = { - airdrag = 0.84, - colormap = [[0.50 0.50 0.55 0.2 0.3 0.31 0.35 0.05 0 0 0 0.005]], - directional = false, - emitrot = 70, - emitrotspread = 8, - emitvector = [[0, 1, 0]], - gravity = [[0, -0.06, 0]], - numparticles = 3, - particlelife = 15, - particlelifespread = 8, - particlesize = 4, - particlesizespread = 6, - particlespeed = 2, - particlespeedspread = 1, - --rotParams = [[-100 r200, 0, -180 r360]], - pos = [[-15 r-30, 0 , -15 r30]], - sizegrowth = 0.5, - sizemod = 0.99, - texture = [[randomdots]], - useairlos = false, - }, - }, - muzzletestceg = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 0, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[1 0.88 0.6 0.013 0.6 0.22 0.06 0.01 0.4 0.07 0.015 0.006 0 0 0 0.01]], - dir = [[dir]], - frontoffset = 0.03, - fronttexture = [[shotgunflare]], - length = [[38 r85]], - sidetexture = [[shotgunside]], - size = [[12 r16]], - sizegrowth = -0.6, - ttl = 9, - rotParams = [[-400 r200, 0, 180 r360]], - pos = [[0.0, 1, 0.0]], - useairlos = false, - }, - }, - }, + ["bowsplash-huge"] = { + waterring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = false, + underwater = 1, + water = true, + properties = { + colormap = [[0.55 0.55 0.55 0.015 0 0 0 0.01]], + dir = [[0, 1, 0]], + frontoffset = 0, + fronttexture = [[waterfoam]], + length = 45, + sidetexture = [[none]], + size = [[11 r7.8]], + sizegrowth = [[1.8 r0.9]], + ttl = 24, + rotParams = [[-25 r50, 0, -180 r360]], + pos = [[0, 1, 0]], + useairlos = false, + }, + }, + splashes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.70 0.70 0.75 0.2 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 50, + emitrotspread = 4, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.08, 0]], + numparticles = 1, + particlelife = 10, + particlelifespread = 12, + particlesize = 5, + particlesizespread = 7, + particlespeed = 5.5, + particlespeedspread = 3.5, + rotParams = [[-100 r200, 0, -180 r360]], + pos = [[-10 r20, 0, -10 r20]], + sizegrowth = 0.1, + sizemod = 0.98, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + ["enginespurt-huge"] = { + enginespurts = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + water = true, + underwater = true, + properties = { + airdrag = 0.84, + colormap = [[0.50 0.50 0.55 0.2 0.3 0.31 0.35 0.05 0 0 0 0.005]], + directional = false, + emitrot = 70, + emitrotspread = 8, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.06, 0]], + numparticles = 3, + particlelife = 15, + particlelifespread = 8, + particlesize = 4, + particlesizespread = 6, + particlespeed = 2, + particlespeedspread = 1, + --rotParams = [[-100 r200, 0, -180 r360]], + pos = [[-15 r-30, 0 , -15 r30]], + sizegrowth = 0.5, + sizemod = 0.99, + texture = [[randomdots]], + useairlos = false, + }, + }, + muzzletestceg = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 0, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.88 0.6 0.013 0.6 0.22 0.06 0.01 0.4 0.07 0.015 0.006 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.03, + fronttexture = [[shotgunflare]], + length = [[38 r85]], + sidetexture = [[shotgunside]], + size = [[12 r16]], + sizegrowth = -0.6, + ttl = 9, + rotParams = [[-400 r200, 0, 180 r360]], + pos = [[0.0, 1, 0.0]], + useairlos = false, + }, + }, + }, } - diff --git a/effects/xpeffects_arm.lua b/effects/xpeffects_arm.lua index 22146bdccdc..95f25ce6086 100644 --- a/effects/xpeffects_arm.lua +++ b/effects/xpeffects_arm.lua @@ -1,697 +1,696 @@ -- XP Effects return { - ["levelup_fp_arm1"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i5]], - explosiongenerator = [[custom:levelup_ring_fp_arm1]], - pos = [[0, 0 i8, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 110, - sidetexture = [[gunshotxl2]], - size = 12, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 20, - sizegrowth = -1, - ttl = 18, - texture = [[circlefx2]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 40, - sizegrowth = -3.5, - ttl = 30, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 30, - sizegrowth = -1, - ttl = 5, - texture = [[groundflash]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 5, - particlelife = 9, - particlelifespread = 17, - particlesize = 5, - particlesizespread = 7, - particlespeed = 1.2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp_arm1"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i5]], + explosiongenerator = [[custom:levelup_ring_fp_arm1]], + pos = [[0, 0 i8, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 110, + sidetexture = [[gunshotxl2]], + size = 12, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 20, + sizegrowth = -1, + ttl = 18, + texture = [[circlefx2]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 40, + sizegrowth = -3.5, + ttl = 30, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 30, + sizegrowth = -1, + ttl = 5, + texture = [[groundflash]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 5, + particlelife = 9, + particlelifespread = 17, + particlesize = 5, + particlesizespread = 7, + particlespeed = 1.2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp_arm2"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp_arm2]], - pos = [[0, 0 i13, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 170, - sidetexture = [[gunshotxl2]], - size = 16, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 30, - sizegrowth = -2, - ttl = 15, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 40, - -- sizegrowth = -1, - -- ttl = 30, - -- texture = [[seismic]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 50, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 7, - particlelife = 12, - particlelifespread = 24, - particlesize = 6, - particlesizespread = 10, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp_arm2"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp_arm2]], + pos = [[0, 0 i13, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 170, + sidetexture = [[gunshotxl2]], + size = 16, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 30, + sizegrowth = -2, + ttl = 15, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 40, + -- sizegrowth = -1, + -- ttl = 30, + -- texture = [[seismic]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 50, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 7, + particlelife = 12, + particlelifespread = 24, + particlesize = 6, + particlesizespread = 10, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp_arm3"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp_arm3]], - pos = [[0, 5 i13, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 190, - sidetexture = [[gunshotxl2]], - size = 18, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 45, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 80, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 60, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 7, - particlelife = 12, - particlelifespread = 24, - particlesize = 6, - particlesizespread = 10, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp_arm3"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp_arm3]], + pos = [[0, 5 i13, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 190, + sidetexture = [[gunshotxl2]], + size = 18, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 45, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 80, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 60, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 7, + particlelife = 12, + particlelifespread = 24, + particlesize = 6, + particlesizespread = 10, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp_arm4"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp_arm4]], - pos = [[0, 16 i16, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 200, - sidetexture = [[gunshotxl2]], - size = 19, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 60, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 140, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 80, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 8, - particlelife = 14, - particlelifespread = 28, - particlesize = 8, - particlesizespread = 12, - particlespeed = 3, - particlespeedspread = 3, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp_arm4"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp_arm4]], + pos = [[0, 16 i16, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 200, + sidetexture = [[gunshotxl2]], + size = 19, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 60, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 140, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 80, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 8, + particlelife = 14, + particlelifespread = 28, + particlesize = 8, + particlesizespread = 12, + particlespeed = 3, + particlespeedspread = 3, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp_arm5"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp_arm5]], - pos = [[0, 25 i25, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 250, - sidetexture = [[gunshotxl2]], - size = 20, - sizegrowth = 0.6, - ttl = 22, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 90, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 170, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[orangenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 20.5, - sizeGrowth = 10, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], - size = 120, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 10, - particlelife = 16, - particlelifespread = 32, - particlesize = 10, - particlesizespread = 14, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp_arm5"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp_arm5]], + pos = [[0, 25 i25, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 250, + sidetexture = [[gunshotxl2]], + size = 20, + sizegrowth = 0.6, + ttl = 22, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 90, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 170, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[orangenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 20.5, + sizeGrowth = 10, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0 0 0 0.01]], + size = 120, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 10, + particlelife = 16, + particlelifespread = 32, + particlesize = 10, + particlesizespread = 14, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_ring_fp_arm1"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 6, - sizegrowth = 1.6, - ttl = 6, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp_arm1"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 6, + sizegrowth = 1.6, + ttl = 6, + pos = [[0, 6, 0]], + }, + }, + }, + ["levelup_ring_fp_arm2"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 7.5, + sizegrowth = 1.8, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp_arm2"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 7.5, - sizegrowth = 1.8, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp_arm3"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 11, + sizegrowth = 1.7, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp_arm3"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 11, - sizegrowth = 1.7, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp_arm4"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 14, + sizegrowth = 1.7, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp_arm4"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 14, - sizegrowth = 1.7, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, - - ["levelup_ring_fp_arm5"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 17, - sizegrowth = 1.8, - ttl = 8, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp_arm5"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.9 0.9 0.9 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 17, + sizegrowth = 1.8, + ttl = 8, + pos = [[0, 6, 0]], + }, + }, + }, } diff --git a/effects/xpeffects_cor.lua b/effects/xpeffects_cor.lua index 924da2615c6..3fcd150a210 100644 --- a/effects/xpeffects_cor.lua +++ b/effects/xpeffects_cor.lua @@ -1,698 +1,696 @@ -- XP Effects return { - ["levelup_fp1"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 2, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i5]], - explosiongenerator = [[custom:levelup_ring_fp1]], - pos = [[0, 0 i8, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 110, - sidetexture = [[gunshotxl2]], - size = 12, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - size = 30, - sizegrowth = -1, - ttl = 18, - texture = [[circlefx2]], - }, - }, - groundflash_large = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - size = 40, - sizegrowth = -3.5, - ttl = 30, - texture = [[groundflash]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - size = 55, - sizegrowth = -1, - ttl = 5, - texture = [[groundflash]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 5, - particlelife = 9, - particlelifespread = 17, - particlesize = 5, - particlesizespread = 7, - particlespeed = 1.2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp1"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i5]], + explosiongenerator = [[custom:levelup_ring_fp1]], + pos = [[0, 0 i8, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 110, + sidetexture = [[gunshotxl2]], + size = 12, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + size = 30, + sizegrowth = -1, + ttl = 18, + texture = [[circlefx2]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + size = 40, + sizegrowth = -3.5, + ttl = 30, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + size = 55, + sizegrowth = -1, + ttl = 5, + texture = [[groundflash]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 5, + particlelife = 9, + particlelifespread = 17, + particlesize = 5, + particlesizespread = 7, + particlespeed = 1.2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp2"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp2]], - pos = [[0, 0 i13, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 170, - sidetexture = [[gunshotxl2]], - size = 16, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - size = 30, - sizegrowth = -2, - ttl = 15, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 40, - -- sizegrowth = -1, - -- ttl = 30, - -- texture = [[seismic]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - size = 50, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 7, - particlelife = 12, - particlelifespread = 24, - particlesize = 6, - particlesizespread = 10, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp2"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp2]], + pos = [[0, 0 i13, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 170, + sidetexture = [[gunshotxl2]], + size = 16, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + size = 30, + sizegrowth = -2, + ttl = 15, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 40, + -- sizegrowth = -1, + -- ttl = 30, + -- texture = [[seismic]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + size = 50, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 7, + particlelife = 12, + particlelifespread = 24, + particlesize = 6, + particlesizespread = 10, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp3"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp3]], - pos = [[0, 5 i13, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 190, - sidetexture = [[gunshotxl2]], - size = 18, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - size = 45, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 80, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - size = 60, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 7, - particlelife = 12, - particlelifespread = 24, - particlesize = 6, - particlesizespread = 10, - particlespeed = 2, - particlespeedspread = 2, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp3"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp3]], + pos = [[0, 5 i13, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 190, + sidetexture = [[gunshotxl2]], + size = 18, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + size = 45, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 80, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + size = 60, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 7, + particlelife = 12, + particlelifespread = 24, + particlesize = 6, + particlesizespread = 10, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp4"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp4]], - pos = [[0, 16 i16, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 200, - sidetexture = [[gunshotxl2]], - size = 19, - sizegrowth = 0.6, - ttl = 20, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - size = 60, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 140, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - size = 80, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 8, - particlelife = 14, - particlelifespread = 28, - particlesize = 8, - particlesizespread = 12, - particlespeed = 3, - particlespeedspread = 3, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp4"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp4]], + pos = [[0, 16 i16, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 200, + sidetexture = [[gunshotxl2]], + size = 19, + sizegrowth = 0.6, + ttl = 20, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + size = 60, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 140, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + size = 80, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 8, + particlelife = 14, + particlelifespread = 28, + particlesize = 8, + particlesizespread = 12, + particlespeed = 3, + particlespeedspread = 3, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_fp5"] = { - levelup_rings = { - air = true, - class = [[CExpGenSpawner]], - count = 3, - ground = true, - water = true, - underwater = true, - properties = { - delay = [[0 i4]], - explosiongenerator = [[custom:levelup_ring_fp5]], - pos = [[0, 25 i25, 0]], - }, - }, - spawnbeam = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[none]], - length = 250, - sidetexture = [[gunshotxl2]], - size = 20, - sizegrowth = 0.6, - ttl = 22, - pos = [[0, 6, 0]], - }, - }, - groundflash_small = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], - size = 90, - sizegrowth = -2, - ttl = 18, - texture = [[circlefx2]], - }, - }, - -- groundflash_large = { - -- class = [[CSimpleGroundFlash]], - -- count = 1, - -- air = true, - -- ground = true, - -- water = false, - -- underwater = false, - -- properties = { - -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], - -- size = 170, - -- sizegrowth = -3.5, - -- ttl = 30, - -- texture = [[groundflash]], - -- }, - -- }, - pop1 = { - class = [[CHeatCloudProjectile]], - air = 1, - water = 1, - ground = 1, - count = 1, - properties = { - alwaysVisible = 0, - texture = [[orangenovaexplo]], - heat = 10, - maxheat = 10, - heatFalloff = 1.5, - size = 20.5, - sizeGrowth = 10, - pos = [[r-10 r8, 16, r-10 r8]], - speed = [[0, 0, 0]], - }, - }, - groundflash_white = { - class = [[CSimpleGroundFlash]], - count = 1, - air = true, - ground = true, - water = false, - underwater = false, - properties = { - colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], - size = 120, - sizegrowth = -1, - ttl = 5, - texture = [[groundflashwhite]], - }, - }, - sparks = { - air = true, - class = [[CSimpleParticleSystem]], - count = 1, - ground = true, - water = true, - underwater = true, - properties = { - airdrag = 0.91, - colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], - directional = true, - emitrot = 30, - emitrotspread = 50, - emitvector = [[0, 1, 0]], - gravity = [[0, 0.25, 0]], - numparticles = 10, - particlelife = 16, - particlelifespread = 32, - particlesize = 10, - particlesizespread = 14, - particlespeed = 3, - particlespeedspread = 4, - pos = [[0, -10, 0]], - sizegrowth = 0.98, - sizemod = 0.94, - texture = [[randdots]], - useairlos = false, - }, - }, - }, + ["levelup_fp5"] = { + levelup_rings = { + air = true, + class = [[CExpGenSpawner]], + count = 3, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[0 i4]], + explosiongenerator = [[custom:levelup_ring_fp5]], + pos = [[0, 25 i25, 0]], + }, + }, + spawnbeam = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.88 0.65 0.10 0.20 0.85 0.85 0.24 0.14 0.78 0.50 0.15 0.08 0.58 0.30 0.08 0.06 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[none]], + length = 250, + sidetexture = [[gunshotxl2]], + size = 20, + sizegrowth = 0.6, + ttl = 22, + pos = [[0, 6, 0]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.92 0.71 0.21 0.3 0 0 0 0.01]], + size = 90, + sizegrowth = -2, + ttl = 18, + texture = [[circlefx2]], + }, + }, + -- groundflash_large = { + -- class = [[CSimpleGroundFlash]], + -- count = 1, + -- air = true, + -- ground = true, + -- water = false, + -- underwater = false, + -- properties = { + -- colormap = [[0.96 0.76 0.13 0.2 0 0 0 0.01]], + -- size = 170, + -- sizegrowth = -3.5, + -- ttl = 30, + -- texture = [[groundflash]], + -- }, + -- }, + pop1 = { + class = [[CHeatCloudProjectile]], + air = 1, + water = 1, + ground = 1, + count = 1, + properties = { + alwaysVisible = 0, + texture = [[orangenovaexplo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.5, + size = 20.5, + sizeGrowth = 10, + pos = [[r-10 r8, 16, r-10 r8]], + speed = [[0, 0, 0]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.99 0.95 0.66 0.77 0 0 0 0.01]], + size = 120, + sizegrowth = -1, + ttl = 5, + texture = [[groundflashwhite]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.91, + colormap = [[0.96 0.76 0.13 0.017 0.92 0.71 0.21 0.011 0 0 0 0.1]], + directional = true, + emitrot = 30, + emitrotspread = 50, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.25, 0]], + numparticles = 10, + particlelife = 16, + particlelifespread = 32, + particlesize = 10, + particlesizespread = 14, + particlespeed = 3, + particlespeedspread = 4, + pos = [[0, -10, 0]], + sizegrowth = 0.98, + sizemod = 0.94, + texture = [[randdots]], + useairlos = false, + }, + }, + }, - ["levelup_ring_fp1"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 6, - sizegrowth = 1.6, - ttl = 6, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp1"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 6, + sizegrowth = 1.6, + ttl = 6, + pos = [[0, 6, 0]], + }, + }, + }, + ["levelup_ring_fp2"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 7.5, + sizegrowth = 1.8, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp2"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 7.5, - sizegrowth = 1.8, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp3"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 11, + sizegrowth = 1.7, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp3"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 11, - sizegrowth = 1.7, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, + ["levelup_ring_fp4"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 14, + sizegrowth = 1.7, + ttl = 7, + pos = [[0, 6, 0]], + }, + }, + }, - ["levelup_ring_fp4"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 14, - sizegrowth = 1.7, - ttl = 7, - pos = [[0, 6, 0]], - }, - }, - }, - - ["levelup_ring_fp5"] = { - levelupring = { - air = true, - class = [[CBitmapMuzzleFlame]], - count = 1, - ground = true, - underwater = 1, - water = true, - properties = { - colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], - dir = [[0, 1, 0]], - --gravity = [[0.0, 0.1, 0.0]], - frontoffset = 0, - fronttexture = [[blastwave]], - length = 45, - sidetexture = [[none]], - size = 17, - sizegrowth = 1.8, - ttl = 8, - pos = [[0, 6, 0]], - }, - }, - }, - + ["levelup_ring_fp5"] = { + levelupring = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.96 0.76 0.13 0.33 0.99 0.95 0.27 0.22 0.92 0.71 0.21 0.011 0 0 0 0.01]], + dir = [[0, 1, 0]], + --gravity = [[0.0, 0.1, 0.0]], + frontoffset = 0, + fronttexture = [[blastwave]], + length = 45, + sidetexture = [[none]], + size = 17, + sizegrowth = 1.8, + ttl = 8, + pos = [[0, 6, 0]], + }, + }, + }, } diff --git a/features/candycane.lua b/features/candycane.lua index a98b4433105..3282fa2084d 100644 --- a/features/candycane.lua +++ b/features/candycane.lua @@ -11,15 +11,17 @@ local candyCane = { metal = 0, reclaimable = 0, customparams = { - i18nfrom = 'candycane' - } + i18nfrom = "candycane", + }, } local candyCaneDefs = {} for i = 1, 7 do - local name = 'candycane' .. i - local object = 'candycane' .. i .. '.s3o' - if object == 'candycane1.s3o' then object = 'candycane.s3o' end + local name = "candycane" .. i + local object = "candycane" .. i .. ".s3o" + if object == "candycane1.s3o" then + object = "candycane.s3o" + end local def = table.copy(candyCane) def.name = name diff --git a/features/enginetrees_override.lua b/features/enginetrees_override.lua index 1127aa1d57a..f68e74d4b20 100644 --- a/features/enginetrees_override.lua +++ b/features/enginetrees_override.lua @@ -7,33 +7,33 @@ local objects = { local treeDefs = {} local function CreateTreeDef(i) - treeDefs["treetype" .. i] = { - description = [[Tree]], - blocking = true, - burnable = true, - reclaimable = true, - energy = 250, - damage = 250, - metal = 0, - reclaimTime = 1500, - mass = 20, - upright = true, - object = objects[(i % #objects) + 1] , - footprintX = 1, - footprintZ = 1, - collisionVolumeScales = [[20 60 20]], - collisionVolumeType = [[cylY]], + treeDefs["treetype" .. i] = { + description = [[Tree]], + blocking = true, + burnable = true, + reclaimable = true, + energy = 250, + damage = 250, + metal = 0, + reclaimTime = 1500, + mass = 20, + upright = true, + object = objects[(i % #objects) + 1], + footprintX = 1, + footprintZ = 1, + collisionVolumeScales = [[20 60 20]], + collisionVolumeType = [[cylY]], - customParams = { - model_author = "Beherith, 0 A.D.", - normalmaps = "yes", - normaltex = "unittextures/tree_fir_tall_5_normal.dds", - treeshader = "yes", - randomrotate = "true", - category = "Plants", - set = "0AD features", - }, - } + customParams = { + model_author = "Beherith, 0 A.D.", + normalmaps = "yes", + normaltex = "unittextures/tree_fir_tall_5_normal.dds", + treeshader = "yes", + randomrotate = "true", + category = "Plants", + set = "0AD features", + }, + } end --[[ In theory it's possible to have treetype16 or higher. @@ -42,11 +42,11 @@ end for which reason map compilers don't usually permit placing those, in turn making maps with them really rare (enough not to worry about it, at least). ]] -for i=0,15 do - CreateTreeDef(i) +for i = 0, 15 do + CreateTreeDef(i) end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -return lowerkeys( treeDefs ) +return lowerkeys(treeDefs) diff --git a/features/pilha_crystal.lua b/features/pilha_crystal.lua index 24e1c487686..89d0b99340a 100644 --- a/features/pilha_crystal.lua +++ b/features/pilha_crystal.lua @@ -1,21 +1,21 @@ ----------------------------------------------------------------------------- -- pilha_crystal_* ----------------------------------------------------------------------------- -local Base = { - blocking = true, - category = "crystals", - damage = 100, - description = "Crystal", - energy = 200, - flammable = false, - footprintX = 1, - footprintZ = 1, - height = 16, - hitdensity = 0, - metal = 10, - reclaimable = true, - autoreclaimable = true, - upright = false, +local Base = { + blocking = true, + category = "crystals", + damage = 100, + description = "Crystal", + energy = 200, + flammable = false, + footprintX = 1, + footprintZ = 1, + height = 16, + hitdensity = 0, + metal = 10, + reclaimable = true, + autoreclaimable = true, + upright = false, customparams = { -- this will be customParams (note capital P) ingame author = "Beherith", category = "crystals", @@ -35,11 +35,11 @@ local colormetal = { _lime = 5, _obsidian = 5, _quartz = 5, - _orange = 5 , - _red = 5 , + _orange = 5, + _red = 5, _teal = 5, - _team = 5 - } + _team = 5, +} local colorenergy = { [""] = 100, _violet = 100, @@ -48,35 +48,37 @@ local colorenergy = { _lime = 100, _obsidian = 100, _quartz = 100, - _orange = 100 , - _red = 100 , + _orange = 100, + _red = 100, _teal = 100, _team = 100, - } +} local crystals = {} for color, _ in pairs(colormetal) do - for i = 1, 3 do -- increase if you have more than 3! - local name = 'pilha_crystal' .. color .. i + for i = 1, 3 do -- increase if you have more than 3! + local name = "pilha_crystal" .. color .. i --local name = 'pilha_crystal' .. i local def = {} for k, v in pairs(Base) do - if k == 'customparams' then + if k == "customparams" then def[k] = {} - for k2, v2 in pairs(v) do def[k][k2] = v2 end + for k2, v2 in pairs(v) do + def[k][k2] = v2 + end else def[k] = v end end def.name = name - def.object = 'pilha_crystal' .. color .. "_" .. i .. ".s3o" + def.object = "pilha_crystal" .. color .. "_" .. i .. ".s3o" if i == 1 then def.description = "Small Crystal" def.damage = 100 def.metal = 1 * colormetal[color] def.energy = 1 * colorenergy[color] - def.customparams.decalinfo_texfile = "pilha_crystal".. color .."_1_aoplane.tga" + def.customparams.decalinfo_texfile = "pilha_crystal" .. color .. "_1_aoplane.tga" def.customparams.decalinfo_sizex = "3" def.customparams.decalinfo_sizez = "3" def.customparams.decalinfo_alpha = "1.0" @@ -85,13 +87,12 @@ for color, _ in pairs(colormetal) do def.damage = 300 def.metal = 2 * colormetal[color] def.energy = 2 * colorenergy[color] - def.customparams.decalinfo_texfile = "pilha_crystal".. color .."_2_aoplane.tga" + def.customparams.decalinfo_texfile = "pilha_crystal" .. color .. "_2_aoplane.tga" def.customparams.decalinfo_sizex = "5" def.customparams.decalinfo_sizez = "5" def.customparams.decalinfo_alpha = "1.0" def.collisionvolumescales = "0 32 0" def.collisionvolumeoffsets = "14 0 0" - elseif i == 3 then def.description = "Large Crystal" def.damage = 500 @@ -99,7 +100,7 @@ for color, _ in pairs(colormetal) do def.energy = 5 * colorenergy[color] def.footprintX = 2 def.footprintZ = 2 - def.customparams.decalinfo_texfile = "pilha_crystal".. color .."_3_aoplane.tga" + def.customparams.decalinfo_texfile = "pilha_crystal" .. color .. "_3_aoplane.tga" def.customparams.decalinfo_sizex = "7" def.customparams.decalinfo_sizez = "7" def.customparams.decalinfo_alpha = "1.0" @@ -109,5 +110,4 @@ for color, _ in pairs(colormetal) do end end - return crystals diff --git a/features/raptor_egg.lua b/features/raptor_egg.lua index e8e3162dbad..58894ba6214 100644 --- a/features/raptor_egg.lua +++ b/features/raptor_egg.lua @@ -1,54 +1,56 @@ -local raptor_egg = { - description = "Egg", - blocking = 0, - category = "corpses", - damage = 10000, - energy = 1000, - footprintx = 1, - footprintz = 1, - height = 15, - hitdensity = 999999, - metal = 100, - mass = 100, - reclaimable = 1, - resurrectable = 0, - smokeTime = 0, +local raptor_egg = { + description = "Egg", + blocking = 0, + category = "corpses", + damage = 10000, + energy = 1000, + footprintx = 1, + footprintz = 1, + height = 15, + hitdensity = 999999, + metal = 100, + mass = 100, + reclaimable = 1, + resurrectable = 0, + smokeTime = 0, - --collisions - collisionVolumeType = "sphere", - collisionVolumeScales = "2 2 2", - collisionVolumeOffsets = "0 -2 0", - selectionVolumeType = "sphere", - selectionVolumeScales = "8 8 8", + --collisions + collisionVolumeType = "sphere", + collisionVolumeScales = "2 2 2", + collisionVolumeOffsets = "0 -2 0", + selectionVolumeType = "sphere", + selectionVolumeScales = "8 8 8", } local eggs = {} -local sizes = {"s","m","l",} -local colors = {"pink","white","red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen"} -local mvalues = {s = 200, m = 500, l = 2000} -local evalues = {s = 2000, m = 4000, l = 20000} -local healthvalues = {s = 2000, m = 5000, l = 8000} +local sizes = { "s", "m", "l" } +local colors = { "pink", "white", "red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen" } +local mvalues = { s = 200, m = 500, l = 2000 } +local evalues = { s = 2000, m = 4000, l = 20000 } +local healthvalues = { s = 2000, m = 5000, l = 8000 } for _, size in pairs(sizes) do - for _, color in pairs(colors) do - local name = "raptor_egg_"..size.."_"..color - local def = {} - for k,v in pairs(raptor_egg) do def[k] = v end - def.customparams = { - model_author = "KDR11k, Beherith", - normalmaps = "yes", - normaltex = "unittextures/chicken_s_normals.png", - treeshader = "yes", - i18nfrom = 'raptor_egg' - } - def.name = name - def.object = "Raptors/raptoregg_"..size.."_"..color .. ".s3o" - def.metal = mvalues[size] - def.energy = evalues[size] - def.reclaimtime = evalues[size] - def.damage = healthvalues[size] - eggs[name] = def - end + for _, color in pairs(colors) do + local name = "raptor_egg_" .. size .. "_" .. color + local def = {} + for k, v in pairs(raptor_egg) do + def[k] = v + end + def.customparams = { + model_author = "KDR11k, Beherith", + normalmaps = "yes", + normaltex = "unittextures/chicken_s_normals.png", + treeshader = "yes", + i18nfrom = "raptor_egg", + } + def.name = name + def.object = "Raptors/raptoregg_" .. size .. "_" .. color .. ".s3o" + def.metal = mvalues[size] + def.energy = evalues[size] + def.reclaimtime = evalues[size] + def.damage = healthvalues[size] + eggs[name] = def + end end return eggs diff --git a/features/rocks30.lua b/features/rocks30.lua index 5861343b589..c2773044b1d 100644 --- a/features/rocks30.lua +++ b/features/rocks30.lua @@ -1,19 +1,19 @@ ----------------------------------------------------------------------------- -- rocks30_*_* ----------------------------------------------------------------------------- -local Base = { - blocking = true, - category = "rocks", - description = "Rock", - energy = 0, - flammable = false, - footprintX = 1, - footprintZ = 1, - height = 16, - hitdensity = 0, - reclaimable = true, - autoreclaimable = true, - upright = false, +local Base = { + blocking = true, + category = "rocks", + description = "Rock", + energy = 0, + flammable = false, + footprintX = 1, + footprintZ = 1, + height = 16, + hitdensity = 0, + reclaimable = true, + autoreclaimable = true, + upright = false, customparams = { -- this will be customParams (note capital P) ingame author = "Beherith", category = "rocks", @@ -26,36 +26,38 @@ local Base = { }, } -local biomes = { def="", snow = "Snowy ", moss = "Mossy " , desert = "Barren ", map = ""} +local biomes = { def = "", snow = "Snowy ", moss = "Mossy ", desert = "Barren ", map = "" } local rocks = {} for biome, descname in pairs(biomes) do - for i = 1, 30 do -- increase if you have more than 3! - local name = string.format('rocks30_%s_%02d', biome, i) + for i = 1, 30 do -- increase if you have more than 3! + local name = string.format("rocks30_%s_%02d", biome, i) local def = {} for k, v in pairs(Base) do - if k == 'customparams' then + if k == "customparams" then def[k] = {} - for k2, v2 in pairs(v) do def[k][k2] = v2 end + for k2, v2 in pairs(v) do + def[k][k2] = v2 + end else def[k] = v end end def.name = name - def.object = string.format('rocks30/rocks30_%s_%02d.s3o', biome, i) + def.object = string.format("rocks30/rocks30_%s_%02d.s3o", biome, i) def.description = descname .. "Rock" def.metal = 9 + i def.damage = 100 + i * 50 - def.customparams.decalinfo_texfile = string.format('rocks30_def_%02d_aoplane.tga', i) - def.customparams.decalinfo_sizex = tostring(math.floor(i/5) + 5) - def.customparams.decalinfo_sizez = tostring(math.floor(i/5) + 5) - def.footprintX = tostring(math.floor(i/8) + 1) - def.footprintZ = tostring(math.floor(i/8) + 1) + def.customparams.decalinfo_texfile = string.format("rocks30_def_%02d_aoplane.tga", i) + def.customparams.decalinfo_sizex = tostring(math.floor(i / 5) + 5) + def.customparams.decalinfo_sizez = tostring(math.floor(i / 5) + 5) + def.footprintX = tostring(math.floor(i / 8) + 1) + def.footprintZ = tostring(math.floor(i / 8) + 1) def.customparams.decalinfo_alpha = "0.9" - def.customparams.normaltex = string.format('unittextures/rocks30_%s_normal.dds', biome) + def.customparams.normaltex = string.format("unittextures/rocks30_%s_normal.dds", biome) rocks[name] = def end diff --git a/features/tombstones.lua b/features/tombstones.lua index d0e67e2de63..de96b7c990c 100644 --- a/features/tombstones.lua +++ b/features/tombstones.lua @@ -16,7 +16,7 @@ local object = { normaltex = "unittextures/Arm_normal.dds", nohealthbars = true, decoration = 1, - } + }, } local tombstones = { armstone = table.copy(object), diff --git a/features/xmascomwreck.lua b/features/xmascomwreck.lua index 205a88f4d38..2fb039529db 100644 --- a/features/xmascomwreck.lua +++ b/features/xmascomwreck.lua @@ -1,31 +1,31 @@ return { - xmascomwreck = { - blocking = true, - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "47 10 47", - collisionvolumetype = "CylY", - damage = 10000, - description = "Xmas Commander Wreckage", - featuredead = "HEAP", - footprintx = 2, - footprintz = 2, - height = 20, - metal = 1250, - object = "gingerbread.s3o", - reclaimable = true, - }, - heap = { - blocking = false, - category = "heaps", - collisionvolumescales = "35.0 4.0 6.0", - collisionvolumetype = "cylY", - damage = 5000, - footprintx = 2, - footprintz = 2, - height = 4, - metal = 500, - object = "Units/arm2X2F.s3o", - reclaimable = true, - resurrectable = 0, - }, + xmascomwreck = { + blocking = true, + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "47 10 47", + collisionvolumetype = "CylY", + damage = 10000, + description = "Xmas Commander Wreckage", + featuredead = "HEAP", + footprintx = 2, + footprintz = 2, + height = 20, + metal = 1250, + object = "gingerbread.s3o", + reclaimable = true, + }, + heap = { + blocking = false, + category = "heaps", + collisionvolumescales = "35.0 4.0 6.0", + collisionvolumetype = "cylY", + damage = 5000, + footprintx = 2, + footprintz = 2, + height = 4, + metal = 500, + object = "Units/arm2X2F.s3o", + reclaimable = true, + resurrectable = 0, + }, } diff --git a/gamedata/alldefs_post.lua b/gamedata/alldefs_post.lua index 84d4950f360..304d1b52199 100644 --- a/gamedata/alldefs_post.lua +++ b/gamedata/alldefs_post.lua @@ -107,7 +107,7 @@ local hoverList = { HOVER2 = true, HOVER3 = true, HHOVER4 = true, - AHOVER2 = true + AHOVER2 = true, } local shipList = { @@ -115,12 +115,12 @@ local shipList = { BOAT4 = true, BOAT5 = true, BOAT9 = true, - EPICSHIP = true + EPICSHIP = true, } local subList = { UBOAT4 = true, - EPICSUBMARINE = true + EPICSUBMARINE = true, } local amphibList = { @@ -132,12 +132,12 @@ local amphibList = { HABOT5 = true, ABOTBOMB2 = true, EPICBOT = true, - EPICALLTERRAIN = true + EPICALLTERRAIN = true, } local commanderList = { COMMANDERBOT = true, - SCAVCOMMANDERBOT = true + SCAVCOMMANDERBOT = true, } local categories = {} @@ -145,24 +145,60 @@ local categories = {} -- Manual categories: OBJECT T4AIR LIGHTAIRSCOUT GROUNDSCOUT RAPTOR -- Deprecated caregories: BOT TANK PHIB NOTLAND SPACE -categories["ALL"] = function() return true end -categories["MOBILE"] = function(uDef) return uDef.speed and uDef.speed > 0 end -categories["NOTMOBILE"] = function(uDef) return not categories.MOBILE(uDef) end -categories["WEAPON"] = function(uDef) return next(uDef.weapondefs) ~= nil end -categories["NOWEAPON"] = function(uDef) return next(uDef.weapondefs) == nil end -categories["VTOL"] = function(uDef) return uDef.canfly == true end -categories["NOTAIR"] = function(uDef) return not categories.VTOL(uDef) end -categories["HOVER"] = function(uDef) return hoverList[uDef.movementclass] and (uDef.maxwaterdepth == nil or uDef.maxwaterdepth < 1) end -- convertible tank/boats have maxwaterdepth -categories["NOTHOVER"] = function(uDef) return not categories.HOVER(uDef) end -categories["SHIP"] = function(uDef) return shipList[uDef.movementclass] or (hoverList[uDef.movementclass] and uDef.maxwaterdepth and uDef.maxwaterdepth >=1) end -categories["NOTSHIP"] = function(uDef) return not categories.SHIP(uDef) end -categories["NOTSUB"] = function(uDef) return not subList[uDef.movementclass] end -categories["CANBEUW"] = function(uDef) return amphibList[uDef.movementclass] or uDef.cansubmerge == true end -categories["UNDERWATER"] = function(uDef) return (uDef.minwaterdepth and uDef.waterline == nil) or (uDef.minwaterdepth and uDef.waterline > uDef.minwaterdepth and uDef.speed and uDef.speed > 0) end -categories["SURFACE"] = function(uDef) return not (categories.UNDERWATER(uDef) and categories.MOBILE(uDef)) and not categories.VTOL(uDef) end -categories["MINE"] = function(uDef) return uDef.weapondefs.minerange end -categories["COMMANDER"] = function(uDef) return commanderList[uDef.movementclass] end -categories["EMPABLE"] = function(uDef) return categories.SURFACE(uDef) and uDef.customparams.paralyzemultiplier ~= 0 end +categories["ALL"] = function() + return true +end +categories["MOBILE"] = function(uDef) + return uDef.speed and uDef.speed > 0 +end +categories["NOTMOBILE"] = function(uDef) + return not categories.MOBILE(uDef) +end +categories["WEAPON"] = function(uDef) + return next(uDef.weapondefs) ~= nil +end +categories["NOWEAPON"] = function(uDef) + return next(uDef.weapondefs) == nil +end +categories["VTOL"] = function(uDef) + return uDef.canfly == true +end +categories["NOTAIR"] = function(uDef) + return not categories.VTOL(uDef) +end +categories["HOVER"] = function(uDef) + return hoverList[uDef.movementclass] and (uDef.maxwaterdepth == nil or uDef.maxwaterdepth < 1) +end -- convertible tank/boats have maxwaterdepth +categories["NOTHOVER"] = function(uDef) + return not categories.HOVER(uDef) +end +categories["SHIP"] = function(uDef) + return shipList[uDef.movementclass] or (hoverList[uDef.movementclass] and uDef.maxwaterdepth and uDef.maxwaterdepth >= 1) +end +categories["NOTSHIP"] = function(uDef) + return not categories.SHIP(uDef) +end +categories["NOTSUB"] = function(uDef) + return not subList[uDef.movementclass] +end +categories["CANBEUW"] = function(uDef) + return amphibList[uDef.movementclass] or uDef.cansubmerge == true +end +categories["UNDERWATER"] = function(uDef) + return (uDef.minwaterdepth and uDef.waterline == nil) or (uDef.minwaterdepth and uDef.waterline > uDef.minwaterdepth and uDef.speed and uDef.speed > 0) +end +categories["SURFACE"] = function(uDef) + return not (categories.UNDERWATER(uDef) and categories.MOBILE(uDef)) and not categories.VTOL(uDef) +end +categories["MINE"] = function(uDef) + return uDef.weapondefs.minerange +end +categories["COMMANDER"] = function(uDef) + return commanderList[uDef.movementclass] +end +categories["EMPABLE"] = function(uDef) + return categories.SURFACE(uDef) and uDef.customparams.paralyzemultiplier ~= 0 +end ------------------------- -- MODULE FUNCTIONS @@ -197,8 +233,6 @@ local function unitDef_Post(name, uDef) ---------------------------------------------------------------------------------------------------------- - - if uDef.sounds then if uDef.sounds.ok then uDef.sounds.ok = nil @@ -249,19 +283,19 @@ local function unitDef_Post(name, uDef) end end - if modOptions.unit_restrictions_noair and (not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_noair_"))) then + if modOptions.unit_restrictions_noair and not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_noair_")) then if string.find(customparams.subfolder, "Aircraft", 1, true) then customparams.modoption_blocked = true elseif customparams.unitgroup and customparams.unitgroup == "aa" then customparams.modoption_blocked = true elseif uDef.canfly then customparams.modoption_blocked = true - elseif (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_noair_")) then --used to remove factories and drone carriers with no other purpose (ex. leghive but not rampart) + elseif customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_noair_") then --used to remove factories and drone carriers with no other purpose (ex. leghive but not rampart) customparams.modoption_blocked = true end end - if modOptions.unit_restrictions_nosea and (not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_nosea_"))) then + if modOptions.unit_restrictions_nosea and not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_nosea_")) then if (uDef.minwaterdepth and uDef.minwaterdepth > 0) or (uDef.category and string.find(uDef.category, "SHIP")) or (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_nosea_")) then customparams.modoption_blocked = true end @@ -275,7 +309,7 @@ local function unitDef_Post(name, uDef) if modOptions.legionsimplifiedmexes then local legiont15mex = { - legmext15 = true, + legmext15 = true, } if legiont15mex[basename] then uDef.customparams.modoption_blocked = true @@ -290,7 +324,7 @@ local function unitDef_Post(name, uDef) if modOptions.unit_restrictions_nonukes then for _, weapon in pairs(weapondefs) do - if (weapon.targetable and weapon.targetable == 1) then + if weapon.targetable and weapon.targetable == 1 then customparams.modoption_blocked = true break end @@ -313,11 +347,11 @@ local function unitDef_Post(name, uDef) end if hasAnti then uDef.weapondefs = newWdefs - if numWeapons == 0 and (not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_noantinuke_"))) then + if numWeapons == 0 and not (customparams.restrictions_exclusion and string.find(customparams.restrictions_exclusion, "_noantinuke_")) then customparams.modoption_blocked = true else if uDef.metalcost then - uDef.metalcost = math.floor(uDef.metalcost * 0.6) -- give a discount for removing anti-nuke + uDef.metalcost = math.floor(uDef.metalcost * 0.6) -- give a discount for removing anti-nuke uDef.energycost = math.floor(uDef.energycost * 0.6) end end @@ -326,31 +360,31 @@ local function unitDef_Post(name, uDef) end if modOptions.unit_restrictions_nofusion then - if (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_nofusion_")) then + if customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_nofusion_") then customparams.modoption_blocked = true end end if modOptions.unit_restrictions_notacnukes then - if (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_notacnukes_")) then + if customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_notacnukes_") then customparams.modoption_blocked = true end end if modOptions.unit_restrictions_nolrpc then - if (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_nolrpc_")) then + if customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_nolrpc_") then customparams.modoption_blocked = true end end if modOptions.unit_restrictions_noendgamelrpc then - if (customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_noendgamelrpc_")) then + if customparams.restrictions_inclusion and string.find(customparams.restrictions_inclusion, "_noendgamelrpc_") then customparams.modoption_blocked = true end end --normal commander respawning - if modOptions.comrespawn == "all" or (modOptions.comrespawn == "evocom" and modOptions.evocom)then + if modOptions.comrespawn == "all" or (modOptions.comrespawn == "evocom" and modOptions.evocom) then if name == "armcom" or name == "corcom" or name == "legcom" then customparams.effigy = "comeffigylvl1" customparams.effigy_offset = 1 @@ -367,15 +401,15 @@ local function unitDef_Post(name, uDef) end if customparams.evolution_target then - customparams.combatradius = customparams.combatradius or 1000 - customparams.evolution_announcement_size = tonumber(customparams.evolution_announcement_size) - customparams.evolution_condition = customparams.evolution_condition or "timer" - customparams.evolution_health_threshold = tonumber(customparams.evolution_health_threshold) or 0 - customparams.evolution_health_transfer = customparams.evolution_health_transfer or "flat" + customparams.combatradius = customparams.combatradius or 1000 + customparams.evolution_announcement_size = tonumber(customparams.evolution_announcement_size) + customparams.evolution_condition = customparams.evolution_condition or "timer" + customparams.evolution_health_threshold = tonumber(customparams.evolution_health_threshold) or 0 + customparams.evolution_health_transfer = customparams.evolution_health_transfer or "flat" customparams.evolution_power_enemy_multiplier = tonumber(customparams.evolution_power_enemy_multiplier) or 1 - customparams.evolution_power_multiplier = tonumber(customparams.evolution_power_multiplier) or 1 - customparams.evolution_power_threshold = tonumber(customparams.evolution_power_threshold) or 600 - customparams.evolution_timer = tonumber(customparams.evolution_timer) or 20 + customparams.evolution_power_multiplier = tonumber(customparams.evolution_power_multiplier) or 1 + customparams.evolution_power_threshold = tonumber(customparams.evolution_power_threshold) or 600 + customparams.evolution_timer = tonumber(customparams.evolution_timer) or 20 end -- Extra Units ---------------------------------------------------------------------------------------------------------------------------------- @@ -390,7 +424,6 @@ local function unitDef_Post(name, uDef) -- Release candidate units -------------------------------------------------------------------------------------------------------------------------------------------------------- if modOptions.releasecandidates or modOptions.experimentalextraunits then - end if string.find(name, "raptor", 1, true) and uDef.health then @@ -475,7 +508,7 @@ local function unitDef_Post(name, uDef) end if uDef.canfly then - uDef.crashdrag = 0.01 -- default 0.005 + uDef.crashdrag = 0.01 -- default 0.005 if not (string.find(name, "fepoch", 1, true) or string.find(name, "fblackhy", 1, true) or string.find(name, "corcrw", 1, true) or string.find(name, "legfort", 1, true)) then --(string.find(name, "liche") or string.find(name, "crw") or string.find(name, "fepoch") or string.find(name, "fblackhy")) then uDef.collide = false @@ -483,7 +516,7 @@ local function unitDef_Post(name, uDef) end if uDef.metalcost and uDef.health and uDef.canmove == true and uDef.mass == nil then - local healthmass = math.ceil(uDef.health/6) + local healthmass = math.ceil(uDef.health / 6) uDef.mass = math.max(uDef.metalcost, healthmass) if uDef.metalcost < 751 and uDef.mass > 750 then uDef.mass = 750 @@ -544,7 +577,6 @@ local function unitDef_Post(name, uDef) -- Factory costs test if modOptions.factory_costs == true then - end ---------------- @@ -709,16 +741,16 @@ local function unitDef_Post(name, uDef) customparams.healthlookmod = 0 -- Animation Cleanup - if modOptions.animationcleanup then + if modOptions.animationcleanup then if uDef.script then local oldscript = uDef.script:lower() if oldscript:find(".cob", nil, true) and (not oldscript:find("_clean.", nil, true)) then local newscript = string.sub(oldscript, 1, -5) .. "_clean.cob" - if VFS.FileExists('scripts/'..newscript) then - Spring.Echo("Using new script for", name, oldscript, '->', newscript) + if VFS.FileExists("scripts/" .. newscript) then + Spring.Echo("Using new script for", name, oldscript, "->", newscript) uDef.script = newscript else - Spring.Echo("Unable to find new script for", name, oldscript, '->', newscript, "using old one") + Spring.Echo("Unable to find new script for", name, oldscript, "->", newscript, "using old one") end end end @@ -742,7 +774,9 @@ local function unitDef_Post(name, uDef) -- [<0] := never active, [0] := always active, [1] := primary set, [>1] := alternate sets for weaponName, weaponDef in pairs(weapondefs) do local groupNumber = 0 - if table.any(weapons, function(weapon) return weaponName:lower() == (weapon.def or ""):lower() end) then + if table.any(weapons, function(weapon) + return weaponName:lower() == (weapon.def or ""):lower() + end) then groupNumber = tonumber(weaponDef.customparams.weapons_group or 0) or 0 else groupNumber = -1 @@ -760,11 +794,7 @@ local function unitDef_Post(name, uDef) if not customparams.defend_never_hesitate and next(weapondefs) then for _, weaponDef in pairs(weapondefs) do if not weaponDef.customparams.bogus then - if uDef.canfly - or weaponDef.weapontype == "StarburstLauncher" - or (weaponDef.range and weaponDef.range > DEFEND_NEVER_HESITATE_RANGE) - or (weaponDef.customparams.carried_unit and weaponDef.customparams.carried_unit ~= "") - then + if uDef.canfly or weaponDef.weapontype == "StarburstLauncher" or (weaponDef.range and weaponDef.range > DEFEND_NEVER_HESITATE_RANGE) or (weaponDef.customparams.carried_unit and weaponDef.customparams.carried_unit ~= "") then customparams.defend_never_hesitate = true break end @@ -835,7 +865,8 @@ local function weaponDef_Post(name, wDef) -- Standard Gravity local gravityOverwriteExemptions = { --add the name of the weapons (or just the name of the unit followed by _ ) to this table to exempt from gravity standardization. - 'cormship_', 'armmship_' + "cormship_", + "armmship_", } if wDef.gravityaffected == "true" and wDef.mygravity == nil then local isExempt = false @@ -898,7 +929,6 @@ local function weaponDef_Post(name, wDef) end end - local bounceShields = shieldModOption == "bounceeverything" or shieldModOption == "bounceplasma" if bounceShields then if shield then @@ -912,7 +942,7 @@ local function weaponDef_Post(name, wDef) end -- allows unblocked weapons' aoe to reach inside shields - if ((not wDef.interceptedbyshieldtype or wDef.interceptedbyshieldtype ~= 1) and wDef.weapontype ~= "Cannon") then + if (not wDef.interceptedbyshieldtype or wDef.interceptedbyshieldtype ~= 1) and wDef.weapontype ~= "Cannon" then customparams.shield_aoe_penetration = true end @@ -1005,7 +1035,9 @@ local function weaponDef_Post(name, wDef) end -- Store original visual properties before zeroing (GL4 gadget reads WeaponDefs at runtime) - if not wDef.customparams then wDef.customparams = {} end + if not wDef.customparams then + wDef.customparams = {} + end wDef.customparams.plasma_size_orig = wDef.size or 2 -- Hide engine cannon projectile rendering (GL4 gadget replaces it) @@ -1029,21 +1061,23 @@ local function weaponDef_Post(name, wDef) if wDef.weapontype == "Flame" then -- Store original visual properties so the GL4 flamethrower gadget can read them at runtime. - if not wDef.customparams then wDef.customparams = {} end + if not wDef.customparams then + wDef.customparams = {} + end local cp = wDef.customparams - cp.flame_orig_intensity = tostring(wDef.intensity or 0.5) - cp.flame_orig_sizegrowth = tostring(wDef.sizegrowth or 0.5) - cp.flame_orig_rgbcolor = tostring(wDef.rgbcolor or "1 0.9 0.8") - cp.flame_orig_rgbcolor2 = tostring(wDef.rgbcolor2 or wDef.rgbcolor or "1 0.9 0.8") - cp.flame_orig_velocity = tostring(wDef.weaponvelocity or 250) - cp.flame_orig_range = tostring(wDef.range or 200) - cp.flame_orig_sprayangle = tostring(wDef.sprayangle or 0) + cp.flame_orig_intensity = tostring(wDef.intensity or 0.5) + cp.flame_orig_sizegrowth = tostring(wDef.sizegrowth or 0.5) + cp.flame_orig_rgbcolor = tostring(wDef.rgbcolor or "1 0.9 0.8") + cp.flame_orig_rgbcolor2 = tostring(wDef.rgbcolor2 or wDef.rgbcolor or "1 0.9 0.8") + cp.flame_orig_velocity = tostring(wDef.weaponvelocity or 250) + cp.flame_orig_range = tostring(wDef.range or 200) + cp.flame_orig_sprayangle = tostring(wDef.sprayangle or 0) cp.flame_orig_areaofeffect = tostring(wDef.areaofeffect or 48) cp.flame_orig_flamegfxtime = tostring(wDef.flamegfxtime or 1) - cp.flame_orig_cegtag = tostring(wDef.cegtag or "") - cp.flame_orig_expgen = tostring(wDef.explosiongenerator or "") + cp.flame_orig_cegtag = tostring(wDef.cegtag or "") + cp.flame_orig_expgen = tostring(wDef.explosiongenerator or "") local dmg = wDef.damage and (wDef.damage.default or 0) or 0 - cp.flame_orig_damage = tostring(dmg) + cp.flame_orig_damage = tostring(dmg) -- Hide engine flame projectile rendering (GL4 gadget replaces it). -- IMPORTANT: do NOT touch flamegfxtime/duration -- that is a range -- multiplier, not just a visual lifetime, so lowering it kills the @@ -1060,17 +1094,17 @@ local function weaponDef_Post(name, wDef) -- fire dots that compete with the GL4 gadget. Replace with custom:blank -- (a no-op CEG that already exists in effects/blank.lua). if cp.flame_keep_engine_gfx ~= "1" then - wDef.intensity = 0.0 - wDef.sizegrowth = 0.0 - wDef.rgbcolor = "0 0 0" - wDef.rgbcolor2 = "0 0 0" - wDef.cegtag = "" + wDef.intensity = 0.0 + wDef.sizegrowth = 0.0 + wDef.rgbcolor = "0 0 0" + wDef.rgbcolor2 = "0 0 0" + wDef.cegtag = "" --wDef.explosiongenerator = "custom:blank" end end - if isXmas and wDef.weapontype == "StarburstLauncher" and wDef.model and VFS.FileExists('objects3d\\candycane_' .. wDef.model) then - wDef.model = 'candycane_' .. wDef.model + if isXmas and wDef.weapontype == "StarburstLauncher" and wDef.model and VFS.FileExists("objects3d\\candycane_" .. wDef.model) then + wDef.model = "candycane_" .. wDef.model end -- prepared to strip these customparams for when we remove old deferred lighting widgets @@ -1112,7 +1146,9 @@ local function weaponDef_Post(name, wDef) wDef.beamdecay = 0.7 end -- Store original visual properties before zeroing (GL4 gadget reads WeaponDefs at runtime) - if not wDef.customparams then wDef.customparams = {} end + if not wDef.customparams then + wDef.customparams = {} + end wDef.customparams.beam_thickness_orig = wDef.thickness or 2 wDef.customparams.beam_corethickness_orig = wDef.corethickness or 0.3 wDef.customparams.beam_laserflaresize_orig = wDef.laserflaresize or 7 @@ -1129,15 +1165,17 @@ local function weaponDef_Post(name, wDef) wDef.thickness = 0.001 wDef.corethickness = 0 wDef.laserflaresize = 0 - wDef.texture1 = "beam_gl4_invis" -- nonexistent texture -> engine Draw() early-outs + wDef.texture1 = "beam_gl4_invis" -- nonexistent texture -> engine Draw() early-outs wDef.texture3 = "beam_gl4_invis" wDef.texture4 = "beam_gl4_invis" end if wDef.weapontype == "LightningCannon" then -- Store original visual properties before zeroing (GL4 gadget reads WeaponDefs at runtime) - if not wDef.customparams then wDef.customparams = {} end - wDef.customparams.lightning_thickness_orig = wDef.thickness or 1.5 + if not wDef.customparams then + wDef.customparams = {} + end + wDef.customparams.lightning_thickness_orig = wDef.thickness or 1.5 wDef.customparams.lightning_corethickness_orig = wDef.corethickness or 0.5 wDef.customparams.lightning_laserflaresize_orig = wDef.laserflaresize or 0 -- Hide engine lightning rendering (GL4 gadget replaces it). @@ -1145,13 +1183,13 @@ local function weaponDef_Post(name, wDef) wDef.thickness = 0.001 wDef.corethickness = 0 wDef.laserflaresize = 0 - wDef.texture1 = "lightning_gl4_invis" -- nonexistent texture -> engine Draw() early-outs + wDef.texture1 = "lightning_gl4_invis" -- nonexistent texture -> engine Draw() early-outs wDef.texture3 = "lightning_gl4_invis" wDef.texture4 = "lightning_gl4_invis" end -- scavengers - if string.find(name, '_scav', 1, true) then + if string.find(name, "_scav", 1, true) then wDef = scavWeaponDefPost(name, wDef) end @@ -1196,9 +1234,9 @@ local function weaponDef_Post(name, wDef) -- ExplosionSpeed is calculated same way engine does it, and then doubled -- Note that this modifier will only effect weapons fired from actual units, via super clever hax of using the weapon name as prefix if damage and damage.default then - if string.find(name, '_', 1, true) then + if string.find(name, "_", 1, true) then local prefix = string.sub(name, 1, 3) - if prefix == 'arm' or prefix == 'cor' or prefix == 'leg' or prefix == 'rap' then + if prefix == "arm" or prefix == "cor" or prefix == "leg" or prefix == "rap" then local globaldamage = math.max(30, damage.default / 20) local defExpSpeed = (8 + (globaldamage * 2.5)) / (9 + (math.sqrt(globaldamage) * 0.70)) * 0.5 wDef.explosionSpeed = defExpSpeed * 2 @@ -1208,17 +1246,14 @@ local function weaponDef_Post(name, wDef) end -- process effects -local function explosionDef_Post(name, eDef) - -end +local function explosionDef_Post(name, eDef) end -------------------------- -- MODOPTIONS ------------------------- -- process modoptions (last, because they should not get baked) -local function modOptions_Post (UnitDefs, WeaponDefs) - +local function modOptions_Post(UnitDefs, WeaponDefs) -- transporting enemy coms if Spring.GetModOptions().transportenemy == "notcoms" then for name, ud in pairs(UnitDefs) do @@ -1243,9 +1278,9 @@ end -------------------------- return { - UnitDef_Post = unitDef_Post, - WeaponDef_Post = weaponDef_Post, - ExplosionDef_Post = explosionDef_Post, - ModOptions_Post = modOptions_Post, - PrebakeUnitDefs = prebakeUnitDefs, + UnitDef_Post = unitDef_Post, + WeaponDef_Post = weaponDef_Post, + ExplosionDef_Post = explosionDef_Post, + ModOptions_Post = modOptions_Post, + PrebakeUnitDefs = prebakeUnitDefs, } diff --git a/gamedata/armordefs.lua b/gamedata/armordefs.lua index 8388e1277ca..2217fecc181 100644 --- a/gamedata/armordefs.lua +++ b/gamedata/armordefs.lua @@ -280,7 +280,7 @@ local armorDefs = { "armbeamer", "armart", "corban", - "armbeaver", + "armbeaver", "armcroc", "armpincer", "coramph", @@ -291,30 +291,30 @@ local armorDefs = { "corsala", "armmar", "corshiva", - "cormadsam", + "cormadsam", "armferret", - "armwar", + "armwar", "corexp", "corlevlr", "cormexp", - "armspy", + "armspy", "cormando", "corspy", "legaspy", - "armdl", + "armdl", "cordl", "legctl", - "armfflak", + "armfflak", "armflak", "armyork", "corenaa", "corflak", "corsent", - "armmlv", + "armmlv", "cormlv", "legmlv", "corpyro", - "armarad", + "armarad", "armaser", "armason", "armeyes", @@ -469,7 +469,6 @@ local armorDefs = { "armanavaldefturret", "coranavaldefturret", "leganavaldefturret", - }, mines = { "armfmine3", @@ -509,17 +508,17 @@ local armorDefs = { "corcsa", "corfink", "corseap", - "armawac", + "armawac", "armsehak", "corawac", "corhunt", - "armatlas", + "armatlas", "corvalk", - "armbrawl", + "armbrawl", "armkam", "armkam2", "armsaber", - "armblade", + "armblade", "corbw", "corape", "corcrw", @@ -670,14 +669,14 @@ local armorDefs = { "corsub", "legnavysub", "legstingray", - "armsubk", + "armsubk", "corshark", "leganavybattlesub", - "corssub", + "corssub", "armserp", "leganavyheavysub", "armacsub", - "coracsub", + "coracsub", "leganavyconsub", "armrecl", "correcl", @@ -688,8 +687,7 @@ local armorDefs = { "armseadragon", }, - raptor = - { + raptor = { "raptor_land_swarmer_basic_t2_v1", "raptor_land_swarmer_basic_t2_v2", "raptor_land_swarmer_basic_t2_v3", @@ -740,8 +738,7 @@ local armorDefs = { "raptor_hive", "raptor_antinuke", }, - raptorqueen = - { + raptorqueen = { "raptor_queen_veryeasy", "raptor_queen_easy", "raptor_queen_normal", @@ -761,7 +758,7 @@ for category, names in pairs(armorDefs) do end nameCount = nameCount + 1 - scavArmorDefs[category][nameCount] = name .. '_scav' + scavArmorDefs[category][nameCount] = name .. "_scav" end end @@ -776,15 +773,15 @@ local function clearArmorDef(unitDefName) end -- expose armor defs to custom params -for unitName, unitDef in pairs (DEFS.unitDefs) do +for unitName, unitDef in pairs(DEFS.unitDefs) do if unitDef.customparams and unitDef.customparams.armordef then local lowerCaseArmorDef = unitDef.customparams.armordef:lower() clearArmorDef(unitName) local defCategory = armorDefs[lowerCaseArmorDef] if defCategory then - defCategory[#defCategory+1] = unitName + defCategory[#defCategory + 1] = unitName else - armorDefs[lowerCaseArmorDef] = {unitName} + armorDefs[lowerCaseArmorDef] = { unitName } end end end diff --git a/gamedata/defs.lua b/gamedata/defs.lua index ce18f4a4da9..43f92b571bf 100644 --- a/gamedata/defs.lua +++ b/gamedata/defs.lua @@ -12,27 +12,27 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -VFS.Include('init.lua') +VFS.Include("init.lua") DEFS = {} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local section='defs.lua' +local section = "defs.lua" VFS_MODES = VFS.MAP .. VFS.MOD .. VFS.BASE local function LoadDefs(name) - local filename = 'gamedata/' .. name .. '.lua' + local filename = "gamedata/" .. name .. ".lua" local success, result = pcall(VFS.Include, filename, nil, VFS_MODES) - if (not success) then - Spring.Log(section, LOG.ERROR, 'Failed to load ' .. name) + if not success then + Spring.Log(section, LOG.ERROR, "Failed to load " .. name) error(result) end - if (result == nil) then - error('Missing lua table for ' .. name) + if result == nil then + error("Missing lua table for " .. name) end return result @@ -41,12 +41,12 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -Spring.TimeCheck('Loading all definitions: ', function() - DEFS.unitDefs = LoadDefs('unitDefs') - DEFS.featureDefs = LoadDefs('featureDefs') - DEFS.weaponDefs = LoadDefs('weaponDefs') - DEFS.armorDefs = LoadDefs('armorDefs') - DEFS.moveDefs = LoadDefs('moveDefs') +Spring.TimeCheck("Loading all definitions: ", function() + DEFS.unitDefs = LoadDefs("unitDefs") + DEFS.featureDefs = LoadDefs("featureDefs") + DEFS.weaponDefs = LoadDefs("weaponDefs") + DEFS.armorDefs = LoadDefs("armorDefs") + DEFS.moveDefs = LoadDefs("moveDefs") end) -------------------------------------------------------------------------------- @@ -56,9 +56,9 @@ end) -- return { - unitdefs = DEFS.unitDefs, + unitdefs = DEFS.unitDefs, featuredefs = DEFS.featureDefs, - weapondefs = DEFS.weaponDefs, - armordefs = DEFS.armorDefs, - movedefs = DEFS.moveDefs, + weapondefs = DEFS.weaponDefs, + armordefs = DEFS.armorDefs, + movedefs = DEFS.moveDefs, } diff --git a/gamedata/explosions_pre.lua b/gamedata/explosions_pre.lua index c428e31aef5..311c79eae02 100644 --- a/gamedata/explosions_pre.lua +++ b/gamedata/explosions_pre.lua @@ -1 +1 @@ -VFS.Include('init.lua') \ No newline at end of file +VFS.Include("init.lua") diff --git a/gamedata/featuredefs.lua b/gamedata/featuredefs.lua index ae864190884..0a39c458de3 100644 --- a/gamedata/featuredefs.lua +++ b/gamedata/featuredefs.lua @@ -14,11 +14,11 @@ local featureDefs = {} local shared = {} -- shared amongst the lua featuredef enviroments -local preProcFile = 'gamedata/featuredefs_pre.lua' -local postProcFile = 'gamedata/featuredefs_post.lua' +local preProcFile = "gamedata/featuredefs_pre.lua" +local postProcFile = "gamedata/featuredefs_post.lua" -local system = VFS.Include('gamedata/system.lua') -local section='featuredefs.lua' +local system = VFS.Include("gamedata/system.lua") +local section = "featuredefs.lua" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -26,38 +26,39 @@ local section='featuredefs.lua' -- Run a pre-processing script if one exists -- -if (VFS.FileExists(preProcFile)) then - Shared = shared -- make it global - FeatureDefs = featureDefs -- make it global +if VFS.FileExists(preProcFile) then + Shared = shared -- make it global + FeatureDefs = featureDefs -- make it global VFS.Include(preProcFile) FeatureDefs = nil Shared = nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Load the raw LUA format featuredef files -- -local luaFiles = VFS.DirList('features/', '*.lua', nil, true) +local luaFiles = VFS.DirList("features/", "*.lua", nil, true) for _, filename in ipairs(luaFiles) do local featureDefsEnv = {} featureDefsEnv._G = featureDefsEnv featureDefsEnv.Shared = shared - featureDefsEnv.GetFilename = function() return filename end + featureDefsEnv.GetFilename = function() + return filename + end setmetatable(featureDefsEnv, { __index = system }) local success, defs = pcall(VFS.Include, filename, featureDefsEnv, VFS_MODES) - if (not success) then - Spring.Log(section, LOG.ERROR, 'Error parsing ' .. filename .. ': ' .. tostring(defs)) - elseif (defs == nil) then - Spring.Log(section, LOG.ERROR, 'Missing return table from: ' .. filename) + if not success then + Spring.Log(section, LOG.ERROR, "Error parsing " .. filename .. ": " .. tostring(defs)) + elseif defs == nil then + Spring.Log(section, LOG.ERROR, "Missing return table from: " .. filename) else for featureDefName, featureDef in pairs(defs) do - if ((type(featureDefName) == 'string') and (type(featureDef) == 'table')) then + if (type(featureDefName) == "string") and (type(featureDef) == "table") then featureDefs[featureDefName] = featureDef end end @@ -70,9 +71,9 @@ end -- Run a post-processing script if one exists -- -if (VFS.FileExists(postProcFile)) then - Shared = shared -- make it global - FeatureDefs = featureDefs -- make it global +if VFS.FileExists(postProcFile) then + Shared = shared -- make it global + FeatureDefs = featureDefs -- make it global VFS.Include(postProcFile) FeatureDefs = nil Shared = nil diff --git a/gamedata/featuredefs_post.lua b/gamedata/featuredefs_post.lua index a8082f7175f..c4df135263b 100644 --- a/gamedata/featuredefs_post.lua +++ b/gamedata/featuredefs_post.lua @@ -11,7 +11,7 @@ local system = VFS.Include("gamedata/system.lua") -local mapFeatureProxies = VFS.Include('gamedata/map_feature_i18n_proxies.lua') +local mapFeatureProxies = VFS.Include("gamedata/map_feature_i18n_proxies.lua") local function normalizeFeatureDef(featureDef) system.lowerkeys(featureDef) @@ -42,7 +42,7 @@ local function processUnitDef(unitDefName, unitDef) -- add this unitDef's featureDefs for featureDefName, featureDef in pairs(features) do - local fullName = unitDefName .. '_' .. featureDefName + local fullName = unitDefName .. "_" .. featureDefName FeatureDefs[fullName] = featureDef normalizeFeatureDef(featureDef) featureDef.customparams.fromunit = unitDefName @@ -52,8 +52,8 @@ local function processUnitDef(unitDefName, unitDef) -- FeatureDead name changes for featureDefName, featureDef in pairs(features) do if featureDef.featuredead then - local fullName = unitDefName .. '_' .. featureDef.featuredead:lower() - if (FeatureDefs[fullName]) then + local fullName = unitDefName .. "_" .. featureDef.featuredead:lower() + if FeatureDefs[fullName] then featureDef.featuredead = fullName end end @@ -61,9 +61,9 @@ local function processUnitDef(unitDefName, unitDef) -- convert the unit corpse name if unitDef.corpse then - local fullName = unitDefName .. '_' .. unitDef.corpse:lower() + local fullName = unitDefName .. "_" .. unitDef.corpse:lower() local corpseFeatureDef = FeatureDefs[fullName] - if (corpseFeatureDef) then + if corpseFeatureDef then unitDef.corpse = fullName end end @@ -103,8 +103,7 @@ local function isModelOK(featureDef) end -- explicitly specified to use a model, but doesn't provide one (gigachad.jpg) - if featureDef.drawtype == 0 - and not specifiesModel then + if featureDef.drawtype == 0 and not specifiesModel then return false end @@ -114,9 +113,7 @@ local function isModelOK(featureDef) end local modelPath = "objects3d/" .. featureDef.object - return VFS.FileExists(modelPath , VFS.ZIP) - or VFS.FileExists(modelPath .. ".3do", VFS.ZIP) - or VFS.FileExists(modelPath .. ".s3o", VFS.ZIP) + return VFS.FileExists(modelPath, VFS.ZIP) or VFS.FileExists(modelPath .. ".3do", VFS.ZIP) or VFS.FileExists(modelPath .. ".s3o", VFS.ZIP) end for name, def in pairs(FeatureDefs) do @@ -124,4 +121,4 @@ for name, def in pairs(FeatureDefs) do Spring.Log("featuredefs_post.lua", LOG.WARNING, "Removing feature def", name, "for having invalid model that would crash the engine", def.object) FeatureDefs[name] = nil end -end \ No newline at end of file +end diff --git a/gamedata/icontypes.lua b/gamedata/icontypes.lua index b9e50c91e04..af8fbad2cdb 100644 --- a/gamedata/icontypes.lua +++ b/gamedata/icontypes.lua @@ -1,2856 +1,2856 @@ local icontypes = { leganavybattlesub = { bitmap = "icons/sub_t2.png", - size = 1.78499997 + size = 1.78499997, }, leganavyradjamship = { bitmap = "icons/ship_t2_hybridradjam.png", - size = 1.73249984 + size = 1.73249984, }, leganavyaaship = { bitmap = "icons/ship_t2_aa_flak.png", - size = 1.73249984 + size = 1.73249984, }, leganavyantinukecarrier = { bitmap = "icons/ship_t2_antidrone.png", - size = 2.51999998 + size = 2.51999998, }, leganavyheavysub = { bitmap = "icons/battlesub_t2.png", - size = 2.20000005 + size = 2.20000005, }, leganavybattleship = { bitmap = "icons/ship_t2_plasma_shotgun_walker.png", - size = 2.67749977 + size = 2.67749977, }, leganavyartyship = { bitmap = "icons/ship_t2_multi_cluster_arty.png", - size = 3.16499968 + size = 3.16499968, }, leganavyflagship = { bitmap = "icons/ship_t2_flagship.png", - size = 3.46499968 + size = 3.46499968, }, leganavyconsub = { bitmap = "icons/sub_t2_worker.png", - size = 1.74299991 + size = 1.74299991, }, leganavyengineer = { bitmap = "icons/shipengineer.png", - size = 1.57499993 + size = 1.57499993, }, leganavycruiser = { bitmap = "icons/ship_t2_gatling.png", - size = 2.25749993 + size = 2.25749993, }, leganavymissileship = { bitmap = "icons/ship_t2_missile.png", - size = 2.0999999 + size = 2.0999999, }, leganavyantiswarm = { bitmap = "icons/ship_t2_impulse.png", - size = 1.79999995 + size = 1.79999995, }, armaak = { bitmap = "icons/bot_amph_t2_aa.png", - size = 1.41999996 + size = 1.41999996, }, armaap = { bitmap = "icons/factory_air_t2.png", - size = 1.9425 + size = 1.9425, }, armaas = { bitmap = "icons/ship_t2_aa_flak.png", - size = 1.73249984 + size = 1.73249984, }, armaca = { bitmap = "icons/air_t2_worker.png", - size = 1.62749982 + size = 1.62749982, }, armack = { bitmap = "icons/bot_t2_worker.png", - size = 1.39649999 + size = 1.39649999, }, armacsub = { bitmap = "icons/sub_t2_worker.png", - size = 1.74299991 + size = 1.74299991, }, armacv = { bitmap = "icons/vehicle_t2_worker.png", - size = 1.36499989 + size = 1.36499989, }, armadvsol = { bitmap = "icons/energy2_1.18.png", - size = 1.23899984 + size = 1.23899984, }, armafus = { bitmap = "icons/energy5_1.85.png", - size = 1.9425 + size = 1.9425, }, armafust3 = { bitmap = "icons/energy5_1.85.png", - size = 3.9 + size = 3.9, }, armageo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, armah = { bitmap = "icons/hover_aa.png", - size = 1.15499997 + size = 1.15499997, }, armalab = { bitmap = "icons/factory_bot_t2.png", - size = 1.9425 + size = 1.9425, }, armamb = { bitmap = "icons/def_t2_arty.png", - size = 1.57499993 + size = 1.57499993, }, armamd = { bitmap = "icons/antinuke.png", - size = 1.67999995 + size = 1.67999995, }, armamex = { bitmap = "icons/mex_t1_emp.png", - size = 1.02999997 + size = 1.02999997, }, armamph = { bitmap = "icons/amph_t2_aa.png", - size = 1.5 + size = 1.5, }, armamsub = { bitmap = "icons/factory_amph.png", - size = 1.52250004 + size = 1.52250004, }, armanac = { bitmap = "icons/hover_gun.png", - size = 1.10249984 + size = 1.10249984, }, armanni = { bitmap = "icons/armanni.png", - size = 2.0474999 + size = 2.0474999, }, armannit3 = { bitmap = "icons/laserdefenset3.png", - size = 2.5474999 + size = 2.5474999, }, armantiship = { bitmap = "icons/ship_t2_carrier.png", - size = 2.51999998 + size = 2.51999998, }, armap = { bitmap = "icons/factory_air.png", - size = 1.52250004 + size = 1.52250004, }, armapt3 = { bitmap = "icons/factory_air_t3.png", - size = 1.52250004 + size = 1.52250004, }, armarad = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, legarad = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, armart = { bitmap = "icons/vehicle_arty.png", - size = 1.10000002 + size = 1.10000002, }, armaser = { bitmap = "icons/bot_t2_jammer.png", - size = 1.34399986 + size = 1.34399986, }, armason = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, leganavalsonarstation = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, armassimilator = { bitmap = "icons/bot_t3.png", - size = 1.99499989 + size = 1.99499989, }, armassistdrone = { bitmap = "icons/air_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, armassistdrone_land = { bitmap = "icons/land_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, armasy = { bitmap = "icons/factory_ship_t2.png", - size = 1.9425 + size = 1.9425, }, armatl = { bitmap = "icons/defence_2_naval.png", - size = 1.46999991 + size = 1.46999991, }, leganavaltorpturret = { bitmap = "icons/defence_2_naval.png", - size = 1.46999991 + size = 1.46999991, }, armatlas = { bitmap = "icons/air_trans.png", - size = 1.36499989 + size = 1.36499989, }, leglts = { bitmap = "icons/air_trans.png", - size = 1.36499989 + size = 1.36499989, }, armhvytrans = { bitmap = "icons/air_trans.png", - size = 1.5 + size = 1.5, }, corhvytrans = { bitmap = "icons/air_trans.png", - size = 1.5 + size = 1.5, }, armavp = { bitmap = "icons/factory_vehicle_t2.png", - size = 1.9425 + size = 1.9425, }, armawac = { bitmap = "icons/air_t2_radar.png", - size = 1.39649999 + size = 1.39649999, }, armbanth = { bitmap = "icons/bantha.png", - size = 2.83500004 + size = 2.83500004, }, armbats = { bitmap = "icons/ship_t2_battleship.png", - size = 2.67749977 + size = 2.67749977, }, armbeamer = { bitmap = "icons/def_beamer.png", - size = 1.10699987 + size = 1.10699987, }, armbeaver = { bitmap = "icons/amphib_worker.png", - size = 1.36499989 + size = 1.36499989, }, armblade = { bitmap = "icons/air_t2_hover_missile.png", - size = 1.46999991 + size = 1.46999991, }, armbotrail = { bitmap = "icons/botrail.png", - size = 3.97000003 + size = 3.97000003, }, armbrawl = { bitmap = "icons/air_t2_hover.png", - size = 1.46999991 + size = 1.46999991, }, armbrtha = { bitmap = "icons/armbrtha.png", - size = 2.625 + size = 2.625, }, armbull = { bitmap = "icons/vehicle_t2_tank.png", - size = 1.46999991 + size = 1.46999991, }, armca = { bitmap = "icons/air_worker.png", - size = 1.25999999 + size = 1.25999999, }, armcarry = { bitmap = "icons/ship_t2_carrier.png", - size = 2.51999998 + size = 2.51999998, }, armch = { bitmap = "icons/hover_worker.png", - size = 1.25999999 + size = 1.25999999, }, armcir = { bitmap = "icons/aa_t1_long.png", - size = 1.29999995 + size = 1.29999995, }, armck = { bitmap = "icons/bot_worker.png", - size = 0.99749994 + size = 0.99749994, }, armckfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, armclaw = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, armcom = { bitmap = "icons/armcom.png", - size = 1.83749986 + size = 1.83749986, }, armcomboss = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armcomcon = { bitmap = "icons/armcom.png", - size = 1.83749986 + size = 1.83749986, }, armconsul = { bitmap = "icons/armconsul_1.35.png", - size = 1.41750002 + size = 1.41750002, }, armcroc = { bitmap = "icons/armcroc.png", - size = 1.67999995 + size = 1.67999995, }, armcrus = { bitmap = "icons/ship_t2_cruiser_plasma.png", - size = 2.25749993 + size = 2.25749993, }, armcs = { bitmap = "icons/ship_worker.png", - size = 1.39649999 + size = 1.39649999, }, armcsa = { bitmap = "icons/air_worker_sea.png", - size = 1.25999999 + size = 1.25999999, }, armcv = { bitmap = "icons/vehicle_worker.png", - size = 0.99749994 + size = 0.99749994, }, armdecade = { bitmap = "icons/ship_raid.png", - size = 1.15499997 + size = 1.15499997, }, armdecadet3 = { bitmap = "icons/ship_t4_decade.png", - size = 2.70000005 + size = 2.70000005, }, armdecom = { bitmap = "icons/armcom.png", - size = 1.83749986 + size = 1.83749986, }, armdf = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, armdfly = { bitmap = "icons/air_trans.png", - size = 1.83749986 + size = 1.83749986, }, armdl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, armdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, armdrone = { bitmap = "icons/air_hover.png", - size = 0.34999999 + size = 0.34999999, }, armdronecarry = { bitmap = "icons/ship_t2_dronecarry.png", - size = 2.45000005 + size = 2.45000005, }, armdronecarryland = { bitmap = "icons/vehicle_t3_dronecarryland.png", - size = 2.45000005 + size = 2.45000005, }, armdroneold = { bitmap = "icons/air_hover.png", - size = 0.5 + size = 0.5, }, armemp = { bitmap = "icons/emp.png", - size = 1.88999987 + size = 1.88999987, }, armepoch = { bitmap = "icons/ship_t2_flagship.png", - size = 3.46499968 + size = 3.46499968, }, corprince = { bitmap = "icons/t2_quad_artillery_ship.png", - size = 3.46499968 + size = 3.46499968, }, armestor = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, armexcalibur = { bitmap = "icons/sub_t2_coastal.png", - size = 2.2 + size = 2.2, }, armeyes = { bitmap = "icons/eye.png", - size = 0.89249998 + size = 0.89249998, }, armfark = { bitmap = "icons/engineer_small.png", - size = 0.94499993 + size = 0.94499993, }, armfast = { bitmap = "icons/bot_t2_raid.png", - size = 1.15499997 + size = 1.15499997, }, armfatf = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, leganavalpinpointer = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, armfav = { bitmap = "icons/vehicle.png", - size = 0.57749999 + size = 0.57749999, }, armfboy = { bitmap = "icons/bot_t2_plasma_aoe.png", - size = 1.67999995 + size = 1.67999995, }, armfdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, armfepocht4 = { bitmap = "icons/air_t4_flagship.png", - size = 3.3599999 + size = 3.3599999, }, armferret = { bitmap = "icons/aa_t15.png", - size = 1.15499997 + size = 1.15499997, }, armfflak = { bitmap = "icons/aa_flak_t2.png", - size = 1.46999991 + size = 1.46999991, }, armfgate = { bitmap = "icons/shield.png", - size = 1.57499993 + size = 1.57499993, }, armfhlt = { bitmap = "icons/defence_1_laser.png", - size = 1.3 + size = 1.3, }, armnavaldefturret = { bitmap = "icons/defence_t15_gauss_impulse.png", - size = 1.6 + size = 1.6, }, cornavaldefturret = { bitmap = "icons/defence_t15_plasma_aoe.png", - size = 1.6 + size = 1.6, }, legnavaldefturret = { bitmap = "icons/defence_t15_rocket.png", - size = 1.6 + size = 1.6, }, legsy = { bitmap = "icons/factory_ship.png", - size = 1.52250004 + size = 1.52250004, }, legnavyconship = { bitmap = "icons/ship_worker.png", - size = 1.39649999 + size = 1.39649999, }, legnavyaaship = { bitmap = "icons/ship_aa.png", - size = 1.14999998 + size = 1.14999998, }, legnavyscout = { bitmap = "icons/ship_raid.png", - size = 1.05 + size = 1.05, }, legnavyfrigate = { bitmap = "icons/ship_torpedo.png", - size = 1.25999999 + size = 1.25999999, }, legnavydestro = { bitmap = "icons/ship_laser_drones.png", - size = 1.51199996 + size = 1.51199996, }, legnavysub = { bitmap = "icons/sub.png", - size = 1.0 + size = 1.0, }, legnavyartyship = { bitmap = "icons/ship_t15_artillery_mediumtraj.png", - size = 1.6 + size = 1.6, }, legnavyrezsub = { bitmap = "icons/sub_rez.png", - size = 1.64299989 + size = 1.64299989, }, armanavaldefturret = { bitmap = "icons/armanni.png", - size = 2.0 + size = 2.0, }, coranavaldefturret = { bitmap = "icons/defence_t2_aoe_plasma_laser.png", - size = 2.0 + size = 2.0, }, leganavaldefturret = { bitmap = "icons/defence_t2_shotgun_mg.png", - size = 2.0 + size = 2.0, }, armfhp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, armfido = { bitmap = "icons/bot_arty_t2.png", - size = 1.34399986 + size = 1.34399986, }, armfig = { bitmap = "icons/air.png", - size = 0.86099994 + size = 0.86099994, }, armfify = { bitmap = "icons/air_t1_rez.png", - size = 1.25999999 + size = 1.25999999, }, armflak = { bitmap = "icons/aa_flak_t2.png", - size = 1.5 + size = 1.5, }, armflash = { bitmap = "icons/vehicle_t1_raid.png", - size = 0.89249998 + size = 0.89249998, }, armflea = { bitmap = "icons/bot_t1_flea.png", - size = 0.53549999 + size = 0.53549999, }, armfmine3 = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, armfmkr = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, armfort = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, armfrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, armfrock = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, armfrt = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, armfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, armgate = { bitmap = "icons/shield.png", - size = 1.57499993 + size = 1.57499993, }, legdeflector = { bitmap = "icons/shield.png", - size = 1.57499993 + size = 1.57499993, }, leggatet3 = { bitmap = "icons/shield.png", - size = 1.9425 + size = 1.9425, }, armgatet3 = { bitmap = "icons/shield.png", - size = 1.9425 + size = 1.9425, }, armgeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, armgmm = { bitmap = "icons/energy_geo_safe.png", - size = 1.56999993 + size = 1.56999993, }, armgplat = { bitmap = "icons/defence_0_0.8.png", - size = 0.83999997 + size = 0.83999997, }, armgremlin = { bitmap = "icons/armst_1.25.png", - size = 1.2889998 + size = 1.2889998, }, armguard = { bitmap = "icons/def_t1_arty.png", - size = 1.36499989 + size = 1.36499989, }, armham = { bitmap = "icons/bot_plasma_t1.png", - size = 1.10249984 + size = 1.10249984, }, armhawk = { bitmap = "icons/air_t2.png", - size = 1.02899992 + size = 1.02899992, }, armhlt = { bitmap = "icons/defence_1.5_laser.png", - size = 1.30249989 + size = 1.30249989, }, armhp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, armjam = { bitmap = "icons/vehicle_t2_jammer.png", - size = 1.36499989 + size = 1.36499989, }, armjamt = { bitmap = "icons/jammer.png", - size = 0.94499993 + size = 0.94499993, }, armjanus = { bitmap = "icons/armjanus_1.2.png", - size = 1.25999999 + size = 1.25999999, }, armjeth = { bitmap = "icons/bot_amph_aa.png", - size = 1.04999995 + size = 1.04999995, }, armjuno = { bitmap = "icons/juno.png", - size = 1.29999995 + size = 1.29999995, }, armkam = { bitmap = "icons/air_hover.png", - size = 1.25999999 + size = 1.25999999, }, armkraken = { bitmap = "icons/def_t2_cannon.png", - size = 1.46999991 + size = 1.46999991, }, armlab = { bitmap = "icons/factory_bot.png", - size = 1.52250004 + size = 1.52250004, }, armlance = { bitmap = "icons/air_t2_torpbomber.png", - size = 1.67999995 + size = 1.67999995, }, armlatnk = { bitmap = "icons/armlatnk_1.3.png", - size = 1.36499989 + size = 1.36499989, }, armliche = { bitmap = "icons/air_liche.png", - size = 2.0999999 + size = 2.0999999, }, armlichet4 = { bitmap = "icons/air_liche.png", - size = 4.19999981 + size = 4.19999981, }, armllt = { bitmap = "icons/defence_0_laser.png", - size = 0.83999997 + size = 0.83999997, }, armlship = { bitmap = "icons/ship_t2_lightning.png", - size = 1.79999995 + size = 1.79999995, }, armlun = { bitmap = "icons/armlun_1.8.png", - size = 1.88999987 + size = 1.88999987, }, armlunchbox = { bitmap = "icons/allterrain.png", - size = 2.0474999 + size = 2.0474999, }, armlwall = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, armmakr = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, armmanni = { bitmap = "icons/armmanni_1.55.png", - size = 1.62749982 + size = 1.62749982, }, armmar = { bitmap = "icons/armmar_t3.png", - size = 2 + size = 2, }, legjav = { bitmap = "icons/legjav.png", - size = 2.1 + size = 2.1, }, armmark = { bitmap = "icons/bot_t2_radar.png", - size = 1.34399986 + size = 1.34399986, }, armmart = { bitmap = "icons/vehicle_arty_t2.png", - size = 1.36499989 + size = 1.36499989, }, armmav = { bitmap = "icons/bot_t2_impulse2x.png", - size = 1.36499989 + size = 1.36499989, }, armmeatball = { bitmap = "icons/amphib_t3.png", - size = 2.20499969 + size = 2.20499969, }, armmercury = { bitmap = "icons/aa_longrange_t2.png", - size = 1.88999987 + size = 1.88999987, }, armmerl = { bitmap = "icons/vehicle_t2_vroc.png", - size = 1.62749982 + size = 1.62749982, }, armmex = { bitmap = "icons/mex_t1.png", - size = 0.80849993 + size = 0.80849993, }, armmh = { bitmap = "icons/hover_t1_missile.png", - size = 1.41750002 + size = 1.41750002, }, armmine1 = { bitmap = "icons/mine.png", - size = 0.37799999 + size = 0.37799999, }, armmine2 = { bitmap = "icons/mine.png", - size = 0.46199998 + size = 0.46199998, }, armmine3 = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, armminivulc = { bitmap = "icons/armvulc.png", - size = 1.88999987 + size = 1.88999987, }, armmls = { bitmap = "icons/shipengineer.png", - size = 1.57499993 + size = 1.57499993, }, armmlv = { bitmap = "icons/armmlv_1.0.png", - size = 1.04999995 + size = 1.04999995, }, armmmkr = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, armmmkrt3 = { bitmap = "icons/metalmaker_t2.png", - size = 2.40749986 + size = 2.40749986, }, armmoho = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, armmship = { bitmap = "icons/ship_t2_missile.png", - size = 2.0999999 + size = 2.0999999, }, armmstor = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, armnanotc = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, armnanotcplat = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, armnanotct2 = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, armnanotc2plat = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, armpb = { bitmap = "icons/def_t2_impulse.png", - size = 1.46999991 + size = 1.46999991, }, armpeep = { bitmap = "icons/air_los.png", - size = 0.78749996 + size = 0.78749996, }, armpincer = { bitmap = "icons/amphib_tank.png", - size = 1.35000002 + size = 1.35000002, }, armplat = { bitmap = "icons/factory_air_sea.png", - size = 1.52250004 + size = 1.52250004, }, armpnix = { bitmap = "icons/air_t2_bomber.png", - size = 1.74299991 + size = 1.74299991, }, armprowl = { bitmap = "icons/amphib_t3.png", - size = 2.20499969 + size = 2.20499969, }, armpship = { bitmap = "icons/ship_pship.png", - size = 1.25999999 + size = 1.25999999, }, armpshipt3 = { bitmap = "icons/ship_t4_pship.png", - size = 2.70000005 + size = 2.70000005, }, armpt = { bitmap = "icons/ship.png", - size = 1 + size = 1, }, armptt2 = { bitmap = "icons/ship_t3_pt.png", - size = 2.29999995 + size = 2.29999995, }, armpw = { bitmap = "icons/bot_t1_raid_0.7.png", - size = 0.73499995 + size = 0.73499995, }, armpwt4 = { bitmap = "icons/armpwt4.png", - size = 2.30999994 + size = 2.30999994, }, squadarmpw = { bitmap = "icons/bot_t1_raid_0.7.png", - size = 0.73499995 + size = 0.73499995, }, squadarmpwt4 = { bitmap = "icons/armpwt4.png", - size = 2.30999994 + size = 2.30999994, }, armrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, armrattet4 = { bitmap = "icons/armrattet4.png", - size = 3.09749985 + size = 3.09749985, }, armraz = { bitmap = "icons/armraz_1.75.png", - size = 1.83749986 + size = 1.83749986, }, armrecl = { bitmap = "icons/sub_rez.png", - size = 1.64299989 + size = 1.64299989, }, armrectr = { bitmap = "icons/bot_t1_rez.png", - size = 0.74000001 + size = 0.74000001, }, legrezbot = { bitmap = "icons/bot_t1_rez.png", - size = 0.74000001 + size = 0.74000001, }, armrespawn = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, armrl = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, armrock = { bitmap = "icons/bot_rocket.png", - size = 1.04999995 + size = 1.04999995, }, armroy = { bitmap = "icons/ship_destroyer.png", - size = 1.51199996 + size = 1.51199996, }, armsaber = { bitmap = "icons/air_t1_hover_sea.png", - size = 1.25999999 + size = 1.25999999, }, legspsurfacegunship = { bitmap = "icons/air_t15_impulse.png", - size = 1.25999999 + size = 1.25999999, }, legspcarrier = { bitmap = "icons/air_t15_carrier.png", - size = 1.65 + size = 1.65, }, armsam = { bitmap = "icons/vehicle_t1_missile.png", - size = 1.04999995 + size = 1.04999995, }, armsb = { bitmap = "icons/air_bomber_sea.png", - size = 1.41750002 + size = 1.41750002, }, armscab = { bitmap = "icons/antinukemobile.png", - size = 1.46999991 + size = 1.46999991, }, armscavengerbossv2_easy = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armscavengerbossv2_epic = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armscavengerbossv2_hard = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armscavengerbossv2_normal = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armscavengerbossv2_veryeasy = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armscavengerbossv2_veryhard = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_easy = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_epic = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_hard = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_normal = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_veryeasy = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, scavengerbossv4_veryhard = { bitmap = "icons/armcomboss.png", - size = 4.19999981 + size = 4.19999981, }, armsd = { bitmap = "icons/seismic.png", - size = 1.46999991 + size = 1.46999991, }, legsd = { bitmap = "icons/seismic.png", - size = 1.46999991 + size = 1.46999991, }, armseadragon = { bitmap = "icons/sub_t3_nuke.png", - size = 2.8 + size = 2.8, }, armseap = { bitmap = "icons/air_torp_sea.png", - size = 1.57499993 + size = 1.57499993, }, armseer = { bitmap = "icons/vehicle_t2_radar.png", - size = 1.36499989 + size = 1.36499989, }, armsehak = { bitmap = "icons/air_los_sea.png", - size = 1.39649999 + size = 1.39649999, }, armserp = { bitmap = "icons/battlesub_t2.png", - size = 2.20000005 + size = 2.20000005, }, armserpt3 = { bitmap = "icons/sub_t3x.png", - size = 2.79999995 + size = 2.79999995, }, armsfig = { bitmap = "icons/air_sea.png", - size = 0.86099994 + size = 0.86099994, }, armsfig2 = { bitmap = "icons/air_sea.png", - size = 1.29999995 + size = 1.29999995, }, armsh = { bitmap = "icons/hover_raid.png", - size = 1.10249984 + size = 1.10249984, }, armshltx = { bitmap = "icons/factory_gantry.png", - size = 2.51999998 + size = 2.51999998, }, armshltxuw = { bitmap = "icons/factory_gantry_uw.png", - size = 2.51999998 + size = 2.51999998, }, armshockwave = { bitmap = "icons/mex_t2_emp.png", - size = 1.20749986 + size = 1.20749986, }, armsilo = { bitmap = "icons/nuke.png", - size = 2.51999998 + size = 2.51999998, }, armsjam = { bitmap = "icons/ship_t2_jammer.png", - size = 1.73249984 + size = 1.73249984, }, armsnipe = { bitmap = "icons/armsnipe_1.3.png", - size = 1.36499989 + size = 1.36499989, }, armsolar = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, armsonar = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, armspid = { bitmap = "icons/allterrain_emp.png", - size = 1.25 + size = 1.25, }, armsptk = { bitmap = "icons/armsptk_1.44.png", - size = 1.65199995 + size = 1.65199995, }, armsptkt4 = { bitmap = "icons/armsptkt4.png", - size = 2.30999994 + size = 2.30999994, }, squadarmsptk = { bitmap = "icons/armsptk_1.44.png", - size = 1.65199995 + size = 1.65199995, }, squadarmsptkt4 = { bitmap = "icons/armsptkt4.png", - size = 2.30999994 + size = 2.30999994, }, armspy = { bitmap = "icons/spy.png", - size = 1.17999995 + size = 1.17999995, }, armstil = { bitmap = "icons/armstil_1.66.png", - size = 1.74299991 + size = 1.74299991, }, armstump = { bitmap = "icons/vehicle_t1_tank.png", - size = 1.15499997 + size = 1.15499997, }, armsub = { bitmap = "icons/sub.png", - size = 1.29999995 + size = 1.29999995, }, armsubk = { bitmap = "icons/sub_t2.png", - size = 1.78499997 + size = 1.78499997, }, armsy = { bitmap = "icons/factory_ship.png", - size = 1.52250004 + size = 1.52250004, }, armtarg = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, legtarg = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, armthor = { bitmap = "icons/armthor.png", - size = 2.4000001 + size = 2.4000001, }, armthund = { bitmap = "icons/air_bomber.png", - size = 1.41750002 + size = 1.41750002, }, armthundt4 = { bitmap = "icons/armthundt4.png", - size = 3.3599999 + size = 3.3599999, }, armtide = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, armtl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, armtorps = { bitmap = "icons/ship.png", - size = 1.25999999 + size = 1.25999999, }, armtrident = { bitmap = "icons/ship_t2_dronecarry.png", - size = 1.83749986 + size = 1.83749986, }, armtdrone = { bitmap = "icons/air_bladew.png", - size = 0.5 + size = 0.5, }, armuwadves = { bitmap = "icons/energystorage_t2.png", - size = 1.3125 + size = 1.3125, }, armuwadvms = { bitmap = "icons/metalstorage_t2.png", - size = 1.3125 + size = 1.3125, }, armuwageo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, leganavaladvgeo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, armuwes = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, legadvestore = { bitmap = "icons/energystorage_t2.png", - size = 1.3125 + size = 1.3125, }, armuwfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, leganavalfusion = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, armuwgeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, armuwmme = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, leganavalmex = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, armuwmmm = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, armuwms = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, armvader = { bitmap = "icons/armvader_0.9.png", - size = 0.94499993 + size = 0.94499993, }, armvadert4 = { bitmap = "icons/armvadert4.png", - size = 2.625 + size = 2.625, }, armvang = { bitmap = "icons/allterrain_t3_arty.png", - size = 2.51999998 + size = 2.51999998, }, armveil = { bitmap = "icons/jammer_t2.png", - size = 1.25999999 + size = 1.25999999, }, legajam = { bitmap = "icons/jammer_t2.png", - size = 1.25999999 + size = 1.25999999, }, armvp = { bitmap = "icons/factory_vehicle.png", - size = 1.52250004 + size = 1.52250004, }, armvulc = { bitmap = "icons/armvulc.png", - size = 3.25499964 + size = 3.25499964, }, armwar = { bitmap = "icons/armwar_1.15.png", - size = 1.20749986 + size = 1.20749986, }, armwin = { bitmap = "icons/wind.png", - size = 1.04999995 + size = 1.04999995, }, armwint2 = { bitmap = "icons/wind.png", - size = 1.64999998 + size = 1.64999998, }, armyork = { bitmap = "icons/vehicle_t2_aa_flak.png", - size = 1.36499989 + size = 1.36499989, }, armzapper = { bitmap = "icons/vehicle.png", - size = 0.57749999 + size = 0.57749999, }, armzeus = { bitmap = "icons/armzeus_1.28.png", - size = 1.34399986 + size = 1.34399986, }, chip = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_viking = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_hornet = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_ptaq = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_fightnight = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_legfn = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, cor_hat_hw = { bitmap = "icons/blank.png", - size = 1 + size = 1, }, coraak = { bitmap = "icons/bot_amph_t2_aa.png", - size = 1.41999996 + size = 1.41999996, }, legadvaabot = { bitmap = "icons/bot_amph_t2_aa.png", - size = 1.41999996 + size = 1.41999996, }, coraap = { bitmap = "icons/factory_air_t2.png", - size = 1.9425 + size = 1.9425, }, coraca = { bitmap = "icons/air_t2_worker.png", - size = 1.62749982 + size = 1.62749982, }, corack = { bitmap = "icons/bot_t2_worker.png", - size = 1.39649999 + size = 1.39649999, }, coracsub = { bitmap = "icons/sub_t2_worker.png", - size = 1.74299991 + size = 1.74299991, }, coracv = { bitmap = "icons/vehicle_t2_worker.png", - size = 1.36499989 + size = 1.36499989, }, coradvsol = { bitmap = "icons/energy2_1.18.png", - size = 1.23899984 + size = 1.23899984, }, corafus = { bitmap = "icons/energy5_1.85.png", - size = 1.9425 + size = 1.9425, }, corafust3 = { bitmap = "icons/energy5_1.85.png", - size = 3.9 + size = 3.9, }, corageo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, legageo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, legafus = { bitmap = "icons/energy5_1.85.png", - size = 1.9425 + size = 1.9425, }, legafust3 = { bitmap = "icons/energy5_1.85.png", - size = 3.9 + size = 3.9, }, legatorpbomber = { bitmap = "icons/air_t2_torpbomber.png", - size = 1.67999995 + size = 1.67999995, }, legrampart = { bitmap = "icons/legion_rampart.png", - size = 1.88999987 + size = 1.88999987, }, corah = { bitmap = "icons/hover_aa.png", - size = 1.15499997 + size = 1.15499997, }, corak = { bitmap = "icons/bot_t1_raid_0.7.png", - size = 0.73499995 + size = 0.73499995, }, corakt4 = { bitmap = "icons/corakt4.png", - size = 1.7 + size = 1.7, }, squadcorak = { bitmap = "icons/bot_t1_raid_0.7.png", - size = 0.73499995 + size = 0.73499995, }, squadcorakt4 = { bitmap = "icons/corakt4.png", - size = 1.7 + size = 1.7, }, coralab = { bitmap = "icons/factory_bot_t2.png", - size = 1.9425 + size = 1.9425, }, coramph = { bitmap = "icons/amph_torp.png", - size = 1.65999997 + size = 1.65999997, }, coramsub = { bitmap = "icons/factory_amph.png", - size = 1.52250004 + size = 1.52250004, }, corantiship = { bitmap = "icons/ship_t2_carrier.png", - size = 2.51999998 + size = 2.51999998, }, corap = { bitmap = "icons/factory_air.png", - size = 1.52250004 + size = 1.52250004, }, corape = { bitmap = "icons/air_t2_hover_missile.png", - size = 1.46999991 + size = 1.46999991, }, corapt3 = { bitmap = "icons/factory_air_t3.png", - size = 1.52250004 + size = 1.52250004, }, corarad = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, corarch = { bitmap = "icons/ship_t2_aa_flak.png", - size = 1.73249984 + size = 1.73249984, }, corason = { bitmap = "icons/radar_t2.png", - size = 1.25999999 + size = 1.25999999, }, corassistdrone = { bitmap = "icons/air_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, corassistdrone_land = { bitmap = "icons/land_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, corasy = { bitmap = "icons/factory_ship_t2.png", - size = 1.9425 + size = 1.9425, }, legadvshipyard = { bitmap = "icons/factory_ship_t2.png", - size = 1.9425 + size = 1.9425, }, coratl = { bitmap = "icons/defence_2_naval.png", - size = 1.46999991 + size = 1.46999991, }, coravp = { bitmap = "icons/factory_vehicle_t2.png", - size = 1.9425 + size = 1.9425, }, corawac = { bitmap = "icons/air_t2_radar.png", - size = 1.39649999 + size = 1.39649999, }, corban = { bitmap = "icons/corban_1.6.png", - size = 1.67999995 + size = 1.67999995, }, corbats = { bitmap = "icons/ship_t2_battleship.png", - size = 2.67749977 + size = 2.67749977, }, corbhmth = { bitmap = "icons/corbhmth.png", - size = 1.82749987 + size = 1.82749987, }, corblackhy = { bitmap = "icons/ship_t2_flagship.png", - size = 3.46499968 + size = 3.46499968, }, corbuzz = { bitmap = "icons/corbuzz.png", - size = 4.04249954 + size = 4.04249954, }, corbw = { bitmap = "icons/air_bladew.png", - size = 0.78749996 + size = 0.78749996, }, corca = { bitmap = "icons/air_worker.png", - size = 1.25999999 + size = 1.25999999, }, corcan = { bitmap = "icons/corcan.png", - size = 1.34399986 + size = 1.34399986, }, corcarry = { bitmap = "icons/ship_t2_carrier.png", - size = 2.51999998 + size = 2.51999998, }, corcat = { bitmap = "icons/corcat_1.9.png", - size = 1.99499989 + size = 1.99499989, }, corch = { bitmap = "icons/hover_worker.png", - size = 1.25999999 + size = 1.25999999, }, corck = { bitmap = "icons/bot_worker.png", - size = 0.99749994 + size = 0.99749994, }, corcom = { bitmap = "icons/corcom.png", - size = 1.83749986 + size = 1.83749986, }, corcomboss = { bitmap = "icons/corcomboss.png", - size = 4.19999981 + size = 4.19999981, }, corcomcon = { bitmap = "icons/corcom.png", - size = 1.83749986 + size = 1.83749986, }, corcrash = { bitmap = "icons/bot_amph_aa.png", - size = 1.04999995 + size = 1.04999995, }, legaabot = { bitmap = "icons/bot_amph_aa.png", - size = 1.04999995 + size = 1.04999995, }, corcrus = { bitmap = "icons/ship_t2_cruiser.png", - size = 2.25749993 + size = 2.25749993, }, corcrw = { bitmap = "icons/air_krow.png", - size = 2.0999999 + size = 2.0999999, }, corcrwh = { bitmap = "icons/air_krow.png", - size = 2.0999999 + size = 2.0999999, }, corcrwt4 = { bitmap = "icons/corcrwt4.png", - size = 3.3599999 + size = 3.3599999, }, corcs = { bitmap = "icons/ship_worker.png", - size = 1.39649999 + size = 1.39649999, }, corcsa = { bitmap = "icons/air_worker_sea.png", - size = 1.25999999 + size = 1.25999999, }, legspcon = { bitmap = "icons/air_worker_sea.png", - size = 1.25999999 + size = 1.25999999, }, corcut = { bitmap = "icons/air_t1_hover_sea_cannon.png", - size = 1.25999999 + size = 1.25999999, }, corcv = { bitmap = "icons/vehicle_worker.png", - size = 0.99749994 + size = 0.99749994, }, cordeadeye = { bitmap = "icons/armsnipe_1.3.png", - size = 1.36499989 + size = 1.36499989, }, cordecom = { bitmap = "icons/corcom.png", - size = 1.83749986 + size = 1.83749986, }, cordemon = { bitmap = "icons/cordemon.png", - size = 2.625 + size = 2.625, }, cordesolator = { bitmap = "icons/sub_t3_nuke.png", - size = 2.8 + size = 2.8, }, cordl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, legctl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, cordoom = { bitmap = "icons/cordoom.png", - size = 2.0474999 + size = 2.0474999, }, cordoomt3 = { bitmap = "icons/laserdefenset3.png", - size = 2.5474999 + size = 2.5474999, }, cordrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, cordrone = { bitmap = "icons/air_bladew.png", - size = 0.5 + size = 0.5, }, cordronecarry = { bitmap = "icons/ship_t2_dronecarry.png", - size = 2.45000005 + size = 2.45000005, }, cordronecarryair = { bitmap = "icons/air_t3_dronecarryair.png", - size = 2.45000005 + size = 2.45000005, }, cordroneold = { bitmap = "icons/air_hover.png", - size = 0.34999999 + size = 0.34999999, }, corenaa = { bitmap = "icons/aa_flak_t2.png", - size = 1.46999991 + size = 1.46999991, }, leganavalaaturret = { bitmap = "icons/aa_flak_t2.png", - size = 1.46999991 + size = 1.46999991, }, corerad = { bitmap = "icons/aa_t1_long.png", - size = 1.29999995 + size = 1.29999995, }, corestor = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, coresupp = { bitmap = "icons/ship_raid.png", - size = 0.89999998 + size = 0.89999998, }, coresuppt3 = { bitmap = "icons/ship_t4_esuppt3.png", - size = 3.5 + size = 3.5, }, coreter = { bitmap = "icons/vehicle_t2_jammer.png", - size = 1.36499989 + size = 1.36499989, }, corexp = { bitmap = "icons/mex_t1_laser.png", - size = 0.97000003 + size = 0.97000003, }, coreyes = { bitmap = "icons/eye.png", - size = 0.89249998 + size = 0.89249998, }, corfast = { bitmap = "icons/corfast_1.3.png", - size = 1.16999996 + size = 1.16999996, }, corfatf = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, corfav = { bitmap = "icons/vehicle.png", - size = 0.57749999 + size = 0.57749999, }, corfblackhyt4 = { bitmap = "icons/air_t4_flagship.png", - size = 3.3599999 + size = 3.3599999, }, corfdoom = { bitmap = "icons/cordoom.png", - size = 1.5 + size = 1.5, }, corfdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corfgate = { bitmap = "icons/shield.png", - size = 1.57499993 + size = 1.57499993, }, corfhlt = { bitmap = "icons/defence_1_laser.png", - size = 1.3 + size = 1.3, }, corfhp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, corfink = { bitmap = "icons/air_los.png", - size = 0.78749996 + size = 0.78749996, }, corflak = { bitmap = "icons/aa_flak_t2.png", - size = 1.5 + size = 1.5, }, corfmd = { bitmap = "icons/antinuke.png", - size = 1.67999995 + size = 1.67999995, }, legabm = { bitmap = "icons/antinuke.png", - size = 1.67999995 + size = 1.67999995, }, corfmine3 = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, corfmkr = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, corforge = { bitmap = "icons/cor_t2_flameworker.png", - size = 1.45000005 + size = 1.45000005, }, corfort = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corfrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, corfrock = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, corfrt = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, legfrl = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, corfship = { bitmap = "icons/ship_t2_flame.png", - size = 1.89999998 + size = 1.89999998, }, corftiger = { bitmap = "icons/vehicle_t2_tank.png", - size = 1.46999991 + size = 1.46999991, }, corfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, corgant = { bitmap = "icons/factory_gantry.png", - size = 2.51999998 + size = 2.51999998, }, corgantuw = { bitmap = "icons/factory_gantry_uw.png", - size = 2.51999998 + size = 2.51999998, }, leggantuw = { bitmap = "icons/factory_gantry_uw.png", - size = 2.51999998 + size = 2.51999998, }, corgarp = { bitmap = "icons/amphib_tank.png", - size = 1.35000002 + size = 1.35000002, }, corgate = { bitmap = "icons/shield.png", - size = 1.57499993 + size = 1.57499993, }, corgatet3 = { bitmap = "icons/shield.png", - size = 1.9425 + size = 1.9425, }, corgator = { bitmap = "icons/vehicle_t1_raid.png", - size = 0.89249998 + size = 0.89249998, }, corgatreap = { bitmap = "icons/corgatreap.png", - size = 1.36499989 + size = 1.36499989, }, corgeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, leggeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, corgol = { bitmap = "icons/vehicle_t2_plasma_aoe.png", - size = 1.83749986 + size = 1.83749986, }, corgolt4 = { bitmap = "icons/armrattet4.png", - size = 3.09749985 + size = 3.09749985, }, corves = { bitmap = "icons/armrattet4.png", - size = 3.09749985 + size = 3.09749985, }, corgplat = { bitmap = "icons/defence_0_0.8.png", - size = 0.83999997 + size = 0.83999997, }, corhal = { bitmap = "icons/corhal.png", - size = 1.39649999 + size = 1.39649999, }, corhllllt = { bitmap = "icons/defence_hllllt.png", - size = 1.68699992 + size = 1.68699992, }, corhllt = { bitmap = "icons/defence_hllt.png", - size = 1.10870004 + size = 1.10870004, }, corhlt = { bitmap = "icons/defence_1.5_laser.png", - size = 1.30249989 + size = 1.30249989, }, corhp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, corhrk = { bitmap = "icons/bot_t2_vroc.png", - size = 1.41750002 + size = 1.41750002, }, corhunt = { bitmap = "icons/air_los_sea.png", - size = 1.39649999 + size = 1.39649999, }, legspradarsonarplane = { bitmap = "icons/air_los_sea.png", - size = 1.39649999 + size = 1.39649999, }, corhurc = { bitmap = "icons/air_t2_bomber.png", - size = 1.74299991 + size = 1.74299991, }, corint = { bitmap = "icons/corint.png", - size = 2.41499972 + size = 2.41499972, }, corjamt = { bitmap = "icons/jammer.png", - size = 0.94499993 + size = 0.94499993, }, corjugg = { bitmap = "icons/juggernaut.png", - size = 3.14999986 + size = 3.14999986, }, corjuno = { bitmap = "icons/juno.png", - size = 1.29999995 + size = 1.29999995, }, legjuno = { bitmap = "icons/juno.png", - size = 1.29999995 + size = 1.29999995, }, corkarg = { bitmap = "icons/corkarg_2.05.png", - size = 2.424999 + size = 2.424999, }, corkarganetht4 = { bitmap = "icons/corkarganetht4.png", - size = 3.14999986 + size = 3.14999986, }, squadcorkarg = { bitmap = "icons/corkarg_2.05.png", - size = 2.424999 + size = 2.424999, }, squadcorkarganetht4 = { bitmap = "icons/corkarganetht4.png", - size = 3.14999986 + size = 3.14999986, }, corkorg = { bitmap = "icons/mech.png", - size = 3.46499968 + size = 3.46499968, }, corlab = { bitmap = "icons/factory_bot.png", - size = 1.52250004 + size = 1.52250004, }, corlevlr = { bitmap = "icons/vehicle_t1_impulse.png", - size = 1.25999999 + size = 1.25999999, }, corllt = { bitmap = "icons/defence_0_laser.png", - size = 0.83999997 + size = 0.83999997, }, cormabm = { bitmap = "icons/antinukevehicle.png", - size = 1.46999991 + size = 1.46999991, }, cormadsam = { bitmap = "icons/aa_t15.png", - size = 1.15499997 + size = 1.15499997, }, cormakr = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, cormando = { bitmap = "icons/cormando.png", - size = 1.65999997 + size = 1.65999997, }, cormart = { bitmap = "icons/vehicle_arty_t2.png", - size = 1.36499989 + size = 1.36499989, }, cormaw = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, cormex = { bitmap = "icons/mex_t1.png", - size = 0.80849993 + size = 0.80849993, }, cormexp = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, cormh = { bitmap = "icons/hover_t1_missile.png", - size = 1.41750002 + size = 1.41750002, }, cormine1 = { bitmap = "icons/mine.png", - size = 0.37799999 + size = 0.37799999, }, cormine2 = { bitmap = "icons/mine.png", - size = 0.46199998 + size = 0.46199998, }, cormine3 = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, legmine1 = { bitmap = "icons/mine.png", - size = 0.37799999 + size = 0.37799999, }, legmine2 = { bitmap = "icons/mine.png", - size = 0.46199998 + size = 0.46199998, }, legmine3 = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, cormine4 = { bitmap = "icons/mine.png", - size = 0.46199998 + size = 0.46199998, }, corminibuzz = { bitmap = "icons/corbuzz.png", - size = 1.88999987 + size = 1.88999987, }, cormist = { bitmap = "icons/vehicle_t1_missile.png", - size = 1.04999995 + size = 1.04999995, }, cormls = { bitmap = "icons/shipengineer.png", - size = 1.57499993 + size = 1.57499993, }, cormlv = { bitmap = "icons/cormlv_1.0.png", - size = 1.04999995 + size = 1.04999995, }, cormmkr = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, cormmkrt3 = { bitmap = "icons/metalmaker_t2.png", - size = 2.40749986 + size = 2.40749986, }, legadveconv = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, legadveconvt3 = { bitmap = "icons/metalmaker_t2.png", - size = 2.40749986 + size = 2.40749986, }, cormoho = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, cormort = { bitmap = "icons/bot_arty_t2.png", - size = 1.36499989 + size = 1.36499989, }, cormship = { bitmap = "icons/ship_t2_missile.png", - size = 2.0999999 + size = 2.0999999, }, cormstor = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, cormuskrat = { bitmap = "icons/amphib_worker.png", - size = 1.36499989 + size = 1.36499989, }, cormwall = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, cornanotc = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, legnanotc = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, cornanotcplat = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, legnanotcplat = { bitmap = "icons/nanot1.png", - size = 0.96599996 + size = 0.96599996, }, legnanotct2 = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, legnanotct2plat = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, legnanotcbase = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, cornanotct2 = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, cornanotc2plat = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, cornecro = { bitmap = "icons/bot_t1_rez.png", - size = 0.74000001 + size = 0.74000001, }, coronager = { bitmap = "icons/sub_t2_coastal.png", - size = 2.2 + size = 2.2, }, corparrow = { bitmap = "icons/corparrow.png", - size = 1.62749982 + size = 1.62749982, }, corphantom = { bitmap = "icons/spy.png", - size = 1.20749986 + size = 1.20749986, }, corplat = { bitmap = "icons/factory_air_sea.png", - size = 1.52250004 + size = 1.52250004, }, legsplab = { bitmap = "icons/factory_air_sea.png", - size = 1.52250004 + size = 1.52250004, }, corprinter = { bitmap = "icons/corprinter.png", - size = 1.20000005 + size = 1.20000005, }, corpship = { bitmap = "icons/ship_pship.png", - size = 1.25999999 + size = 1.25999999, }, corpt = { bitmap = "icons/ship.png", - size = 1.14999998 + size = 1.14999998, }, corpun = { bitmap = "icons/def_t1_arty.png", - size = 1.36499989 + size = 1.36499989, }, corpyro = { bitmap = "icons/corpyro_1.15.png", - size = 1.20749986 + size = 1.20749986, }, corrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, corraid = { bitmap = "icons/vehicle_t1_tank.png", - size = 1.15499997 + size = 1.15499997, }, correap = { bitmap = "icons/vehicle_t2_tank.png", - size = 1.46999991 + size = 1.46999991, }, correcl = { bitmap = "icons/sub_rez.png", - size = 1.64299989 + size = 1.64299989, }, correspawn = { bitmap = "icons/nanot2.png", - size = 1.64999998 + size = 1.64999998, }, corrl = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, corroach = { bitmap = "icons/corroach_0.9.png", - size = 0.94499993 + size = 0.94499993, }, corroy = { bitmap = "icons/ship_destroyer.png", - size = 1.51199996 + size = 1.51199996, }, corsala = { bitmap = "icons/corseal.png", - size = 1.52250004 + size = 1.52250004, }, corsb = { bitmap = "icons/air_bomber_sea.png", - size = 1.41750002 + size = 1.41750002, }, legspbomber = { bitmap = "icons/air_bomber_sea.png", - size = 1.41750002 + size = 1.41750002, }, corscavdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corscavdtf = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corscavdtl = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corscavdtm = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corscavfort = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, corscreamer = { bitmap = "icons/aa_longrange_t2.png", - size = 1.88999987 + size = 1.88999987, }, corsd = { bitmap = "icons/seismic.png", - size = 1.46999991 + size = 1.46999991, }, corseah = { bitmap = "icons/air_trans.png", - size = 1.83749986 + size = 1.83749986, }, corseal = { bitmap = "icons/corseal.png", - size = 1.52250004 + size = 1.52250004, }, corseap = { bitmap = "icons/air_torp_sea.png", - size = 1.57499993 + size = 1.57499993, }, legsptorpgunship = { bitmap = "icons/air_torp_sea.png", - size = 1.47499993 + size = 1.47499993, }, corsent = { bitmap = "icons/vehicle_t2_aa_flak.png", - size = 1.36499989 + size = 1.36499989, }, legvflak = { bitmap = "icons/vehicle_t2_aa_flak.png", - size = 1.36499989 + size = 1.36499989, }, corsiegebreaker = { bitmap = "icons/vehicle_t2_tank_laser.png", - size = 1.46999991 - }, + size = 1.46999991, + }, corsentinel = { bitmap = "icons/ship_t2_dronecarry.png", - size = 1.83749986 + size = 1.83749986, }, corsfig = { bitmap = "icons/air_sea.png", - size = 0.86099994 + size = 0.86099994, }, legspfighter = { bitmap = "icons/air_sea.png", - size = 0.86099994 + size = 0.86099994, }, corsfig2 = { bitmap = "icons/air_sea.png", - size = 1.29999995 + size = 1.29999995, }, corsh = { bitmap = "icons/hover_raid.png", - size = 1.10249984 + size = 1.10249984, }, corshad = { bitmap = "icons/air_bomber.png", - size = 1.41750002 + size = 1.41750002, }, corshark = { bitmap = "icons/sub_t2.png", - size = 1.78499997 + size = 1.78499997, }, corshiva = { bitmap = "icons/corshiva_2.1.png", - size = 2.20499969 + size = 2.20499969, }, corshroud = { bitmap = "icons/jammer_t2.png", - size = 1.25999999 + size = 1.25999999, }, corsilo = { bitmap = "icons/nuke.png", - size = 2.51999998 + size = 2.51999998, }, corsjam = { bitmap = "icons/ship_t2_jammer.png", - size = 1.73249984 + size = 1.73249984, }, corsktl = { bitmap = "icons/corsktl.png", - size = 1.14999998 + size = 1.14999998, }, corslrpc = { bitmap = "icons/ship_t4_slrpc.png", - size = 3.20000005 + size = 3.20000005, }, corsnap = { bitmap = "icons/hover_gun.png", - size = 1.10249984 + size = 1.10249984, }, corsok = { bitmap = "icons/corsok_1.8.png", - size = 1.88999987 + size = 1.88999987, }, legehovertank = { bitmap = "icons/corsok_1.8.png", - size = 1.88999987 + size = 1.88999987, }, corsolar = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, corsonar = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, corspec = { bitmap = "icons/bot_t2_jammer.png", - size = 1.34399986 + size = 1.34399986, }, legajamk = { bitmap = "icons/bot_t2_jammer.png", - size = 1.34399986 + size = 1.34399986, }, corspy = { bitmap = "icons/spy.png", - size = 1.17999995 + size = 1.17999995, }, legaspy = { bitmap = "icons/spy.png", - size = 1.17999995 + size = 1.17999995, }, corssub = { bitmap = "icons/battlesub_t2.png", - size = 2.20000005 + size = 2.20000005, }, corstorm = { bitmap = "icons/bot_rocket.png", - size = 1.04999995 + size = 1.04999995, }, corsub = { bitmap = "icons/sub.png", - size = 1.5 + size = 1.5, }, corsumo = { bitmap = "icons/corsumo.png", - size = 1.74299991 + size = 1.74299991, }, corsy = { bitmap = "icons/factory_ship.png", - size = 1.52250004 + size = 1.52250004, }, cortarg = { bitmap = "icons/targetting.png", - size = 1.36499989 + size = 1.36499989, }, cortdrone = { bitmap = "icons/air_bladew.png", - size = 0.5 + size = 0.5, }, cortermite = { bitmap = "icons/cortermite_1.5.png", - size = 1.57499993 + size = 1.57499993, }, corthermite = { bitmap = "icons/corthermite.png", - size = 2.42499924 + size = 2.42499924, }, corthud = { bitmap = "icons/bot_plasma_t1.png", - size = 1.10249984 + size = 1.10249984, }, cortide = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, cortitan = { bitmap = "icons/air_t2_torpbomber.png", - size = 1.67999995 + size = 1.67999995, }, cortl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, cortoast = { bitmap = "icons/def_t2_arty.png", - size = 1.57499993 + size = 1.57499993, }, cortorch = { bitmap = "icons/cortorch.png", - size = 1.20000005 + size = 1.20000005, }, cortrem = { bitmap = "icons/cortrem_t2.png", - size = 1.9425 + size = 1.9425, }, cortron = { bitmap = "icons/tacnuke.png", - size = 1.88999987 + size = 1.88999987, }, coruwadves = { bitmap = "icons/energystorage_t2.png", - size = 1.3125 + size = 1.3125, }, coruwadvms = { bitmap = "icons/metalstorage_t2.png", - size = 1.3125 + size = 1.3125, }, coruwageo = { bitmap = "icons/hazardous.png", - size = 1.88999987 + size = 1.88999987, }, coruwes = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, leguwestore = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, coruwfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, coruwgeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, leguwgeo = { bitmap = "icons/energy6_1.3.png", - size = 1.36499989 + size = 1.36499989, }, coruwmme = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, coruwmmm = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, leganavaleconv = { bitmap = "icons/metalmaker_t2.png", - size = 1.20749986 + size = 1.20749986, }, coruwms = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, leguwmstore = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, corvac = { bitmap = "icons/corprinter.png", - size = 1.20000005 + size = 1.20000005, }, corvacct = { bitmap = "icons/blank.png", - size = 1.20000005 + size = 1.20000005, }, corvalk = { bitmap = "icons/air_trans.png", - size = 1.36499989 + size = 1.36499989, }, corvamp = { bitmap = "icons/air_t2.png", - size = 1.02899992 + size = 1.02899992, }, corveng = { bitmap = "icons/air.png", - size = 0.86099994 + size = 0.86099994, }, corvipe = { bitmap = "icons/def_t2_missile.png", - size = 1.46999991 + size = 1.46999991, }, corvoyr = { bitmap = "icons/bot_t2_radar.png", - size = 1.34399986 + size = 1.34399986, }, legaradk = { bitmap = "icons/bot_t2_radar.png", - size = 1.34399986 + size = 1.34399986, }, corvp = { bitmap = "icons/factory_vehicle.png", - size = 1.52250004 + size = 1.52250004, }, corvrad = { bitmap = "icons/vehicle_t2_radar.png", - size = 1.36499989 + size = 1.36499989, }, corvroc = { bitmap = "icons/vehicle_t2_vroc.png", - size = 1.67999995 + size = 1.67999995, }, corwin = { bitmap = "icons/wind.png", - size = 1.04999995 + size = 1.04999995, }, corwint2 = { bitmap = "icons/wind.png", - size = 1.67999995 + size = 1.67999995, }, corwolv = { bitmap = "icons/vehicle_arty.png", - size = 1.10000002 + size = 1.10000002, }, critter_ant = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_crab = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_duck = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_goldfish = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_gull = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_penguin = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_penguinbro = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, critter_penguinking = { bitmap = "icons/blank.png", - size = 0.01 + size = 0.01, }, dbg_sphere = { bitmap = "icons/allterrain.png", - size = 0.5 + size = 0.5, }, dice = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, freefusion = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, legbunk = { bitmap = "icons/legbunk.png", - size = 1.83749986 + size = 1.83749986, }, leegmech = { bitmap = "icons/bantha.png", - size = 2.29999995 + size = 2.29999995, }, legeshotgunmech = { bitmap = "icons/t3_bot_shotgun.png", - size = 1.93749986 + size = 1.93749986, }, legeheatraymech = { bitmap = "icons/t3_solinvictus.png", - size = 3.46499968 + size = 3.46499968, }, legeheatraymech_old = { bitmap = "icons/t3_solinvictus.png", - size = 3.46499968 + size = 3.46499968, }, legelrpcmech = { bitmap = "icons/t3_bot_clusterarty.png", - size = 2.75 + size = 2.75, }, legaap = { bitmap = "icons/factory_air_t2.png", - size = 1.9425 + size = 1.9425, }, legaca = { bitmap = "icons/air_t2_worker.png", - size = 1.62749982 + size = 1.62749982, }, legaceb = { bitmap = "icons/legceb.png", - size = 1.25 + size = 1.25, }, legafcv = { bitmap = "icons/armconsul_1.35.png", - size = 1.0 + size = 1.0, }, legack = { bitmap = "icons/bot_t2_worker.png", - size = 1.39649999 + size = 1.39649999, }, legacluster = { bitmap = "icons/def_t2_arty.png", - size = 1.57499993 + size = 1.57499993, }, legamcluster = { bitmap = "icons/vehicle_arty_t2.png", - size = 1.36499989 + size = 1.36499989, }, legacv = { bitmap = "icons/vehicle_t2_worker.png", - size = 1.36499989 + size = 1.36499989, }, legadvsol = { bitmap = "icons/energy2_1.18.png", - size = 1.23899984 + size = 1.23899984, }, legah = { bitmap = "icons/hover_aa.png", - size = 1.15499997 + size = 1.15499997, }, legalab = { bitmap = "icons/factory_bot_t2.png", - size = 1.9425 + size = 1.9425, }, legap = { bitmap = "icons/factory_air.png", - size = 1.52250004 + size = 1.52250004, }, legamphlab = { bitmap = "icons/factory_amph.png", - size = 1.52250004 + size = 1.52250004, }, legaskirmtank = { bitmap = "icons/vehicle_t2_tank_triplasma.png", - size = 1.36999991 + size = 1.36999991, }, legavroc = { bitmap = "icons/vehicle_t2_vroc.png", - size = 1.62749982 + size = 1.62749982, }, legavrad = { bitmap = "icons/vehicle_t2_radar.png", - size = 1.36499989 + size = 1.36499989, }, legavjam = { bitmap = "icons/vehicle_t2_jammer.png", - size = 1.36499989 + size = 1.36499989, }, legaheattank = { bitmap = "icons/vehicle_t2_tank_heavylaser.png", - size = 1.73749986 + size = 1.73749986, }, legassistdrone = { bitmap = "icons/air_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, legassistdrone_land = { bitmap = "icons/land_assistdrone.png", - size = 0.85000002 + size = 0.85000002, }, legatrans = { bitmap = "icons/air_trans.png", - size = 1.5 + size = 1.5, }, legavantinuke = { bitmap = "icons/antinukevehicle.png", - size = 1.46999991 + size = 1.46999991, }, legavp = { bitmap = "icons/factory_vehicle_t2.png", - size = 1.9425 + size = 1.9425, }, legbal = { bitmap = "icons/bot_t15_rocket.png", - size = 1.20000005 + size = 1.20000005, }, legbar = { bitmap = "icons/vehicle_t1_arty_napalm.png", - size = 1.35 + size = 1.35, }, legbart = { bitmap = "icons/bot_t2_arty_napalm.png", - size = 1.60000002 + size = 1.60000002, }, legbastion = { bitmap = "icons/def_t2_tachyon.png", - size = 2.0474999 + size = 2.0474999, }, legbombard = { bitmap = "icons/def_t2_impulse.png", - size = 1.46999991 + size = 1.46999991, }, legapopupdef = { bitmap = "icons/def_t2_impulse.png", - size = 1.46999991 + size = 1.46999991, }, legca = { bitmap = "icons/air_worker.png", - size = 1.25999999 + size = 1.25999999, }, legcar = { bitmap = "icons/hover_t15_shotgun.png", - size = 1.35 + size = 1.35, }, legcen = { bitmap = "icons/bot_t15_raid.png", - size = 1.04999995 + size = 1.04999995, }, legch = { bitmap = "icons/hover_worker.png", - size = 1.25999999 + size = 1.25999999, }, legcib = { bitmap = "icons/air_bomber_juno.png", - size = 1.20000005 + size = 1.20000005, }, legck = { bitmap = "icons/bot_worker.png", - size = 0.99749994 + size = 0.99749994, }, legcluster = { bitmap = "icons/def_t1_arty.png", - size = 1.1500000 + size = 1.1500000, }, legcom = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomecon = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomlvl2 = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomlvl3 = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomlvl4 = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomoff = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomt2com = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomt2def = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legcomt2off = { bitmap = "icons/legcom.png", - size = 1.83749986 + size = 1.83749986, }, legeconv = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, legestor = { bitmap = "icons/energystorage.png", - size = 1.10249984 + size = 1.10249984, }, legerailtank = { bitmap = "icons/vehicle_t3_tank_rail_mgun.png", - size = 2.4000001 + size = 2.4000001, }, legcv = { bitmap = "icons/vehicle_worker.png", - size = 0.99749994 + size = 0.99749994, }, legdecom = { bitmap = "icons/legcom.png", - size = 1.60000002 + size = 1.60000002, }, legdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, legdtf = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, legdtl = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, legdtm = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, legeyes = { bitmap = "icons/eye.png", - size = 0.89249998 + size = 0.89249998, }, legforti = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, legfrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, legrwall = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, leghive = { bitmap = "icons/defence_t15_dronecarry.png", - size = 1.65999997 + size = 1.65999997, }, legfhive = { bitmap = "icons/defence_t15_dronecarry.png", - size = 1.65999997 + size = 1.65999997, }, legdrone = { bitmap = "icons/air_hover.png", - size = 0.66 + size = 0.66, }, legheavydrone = { bitmap = "icons/heavyheatraydrone.png", - size = 0.9 + size = 0.9, }, legheavydronesmall = { bitmap = "icons/heavyheatraydrone.png", - size = 0.9 + size = 0.9, }, legfhp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, legfig = { bitmap = "icons/air.png", - size = 0.64999998 + size = 0.64999998, }, legflak = { bitmap = "icons/aa_flak_t2.png", - size = 1.5 + size = 1.5, }, legfloat = { bitmap = "icons/corparrow.png", - size = 1.4 + size = 1.4, }, legfort = { bitmap = "icons/air_battleship.png", - size = 2.29999995 + size = 2.29999995, }, legfortt4 = { bitmap = "icons/air_battleship.png", - size = 4.0 + size = 4.0, }, legapt3 = { bitmap = "icons/factory_air_t3.png", - size = 1.52250004 + size = 1.52250004, }, leggant = { bitmap = "icons/factory_gantry.png", - size = 2.51999998 + size = 2.51999998, }, leggat = { bitmap = "icons/vehicle_t1_tank_mgun.png", - size = 1.29999995 + size = 1.29999995, }, leggob = { bitmap = "icons/bot_t1_skirmish.png", - size = 0.60000002 + size = 0.60000002, }, leggobt3 = { bitmap = "icons/leggobt3.png", - size = 2 + size = 2, }, babyleggob = { bitmap = "icons/bot_t1_raid_0.7.png", - size = 0.60000002 + size = 0.60000002, }, leghades = { bitmap = "icons/vehicle_t1_raid.png", - size = 0.75 + size = 0.75, }, leghelios = { bitmap = "icons/vehicle_t1_tank.png", - size = 0.94999999 + size = 0.94999999, }, leghastatus = { bitmap = "icons/ship_pship.png", - size = 1.25999999 + size = 1.25999999, }, - legmohocon = { + legmohocon = { bitmap = "icons/mex_t2_con.png", - size = 1.20749986 + size = 1.20749986, }, leghastatusalt = { bitmap = "icons/ship_pship.png", - size = 1.25999999 + size = 1.25999999, }, legamph = { bitmap = "icons/amph_torp.png", - size = 1.65999997 + size = 1.65999997, }, legamphtank = { bitmap = "icons/amphib_tank.png", - size = 1.35000002 + size = 1.35000002, }, leghp = { bitmap = "icons/factory_hover.png", - size = 1.52250004 + size = 1.52250004, }, - legjam ={ - bitmap ="icons/jammer.png", - size = 0.94499993 + legjam = { + bitmap = "icons/jammer.png", + size = 0.94499993, }, leginc = { bitmap = "icons/corsumo.png", - size = 1.85000002 + size = 1.85000002, }, leginf = { bitmap = "icons/cortrem_t2.png", - size = 1.9425 + size = 1.9425, }, leginfestor = { bitmap = "icons/leginfestor.png", - size = 1.6 + size = 1.6, }, legionnaire = { bitmap = "icons/air_t2.png", - size = 1.02899992 + size = 1.02899992, }, legafigdef = { bitmap = "icons/air_t2.png", - size = 1.02899992 + size = 1.02899992, }, legkam = { bitmap = "icons/air_kamikaze.png", - size = 1 + size = 1, }, legkark = { bitmap = "icons/bot_t15_heat_shot.png", - size = 1.3 + size = 1.3, }, corkark = { bitmap = "icons/legkark.png", - size = 1.3 + size = 1.3, }, legkeres = { bitmap = "icons/vehicle_t3_tank_mgun.png", - size = 2 + size = 2, }, leglht = { bitmap = "icons/defence_0_laser.png", - size = 0.80000001 + size = 0.80000001, }, leglab = { bitmap = "icons/factory_bot.png", - size = 1.52250004 + size = 1.52250004, }, legdtr = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, leglob = { bitmap = "icons/bot_plasma_t1.png", - size = 0.80000001 + size = 0.80000001, }, babyleglob = { bitmap = "icons/bot_plasma_t1.png", - size = 0.80000001 + size = 0.80000001, }, leglupara = { bitmap = "icons/aa_flak_t15.png", - size = 1.3 + size = 1.3, }, leglraa = { bitmap = "icons/aa_longrange_railgun_t2.png", @@ -2858,1101 +2858,1098 @@ local icontypes = { }, leglrpc = { bitmap = "icons/leglrpc.png", - size = 2.41499972 + size = 2.41499972, }, legmed = { bitmap = "icons/corban_1.6.png", - size = 1.85 + size = 1.85, }, legmex = { bitmap = "icons/mex_t1.png", - size = 0.80849993 + size = 0.80849993, }, legmext15 = { bitmap = "icons/mex_t1.png", - size = 1 + size = 1, }, legmstor = { bitmap = "icons/metalstorage.png", - size = 1.10249984 + size = 1.10249984, }, legmoho = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, legmohobp = { bitmap = "icons/mex_t2.png", - size = 1.20749986 + size = 1.20749986, }, legmohobpct = { bitmap = "icons/blank.png", - size = 1.0 + size = 1.0, }, legamstor = { bitmap = "icons/metalstorage_t2.png", - size = 1.3125 + size = 1.3125, }, legmg = { bitmap = "icons/defence_2_mg.png", - size = 1.3 + size = 1.3, }, legfmg = { bitmap = "icons/defence_2_mg.png", - size = 1.3 + size = 1.3, }, legmh = { bitmap = "icons/hover_t1_missile.png", - size = 1.41750002 + size = 1.41750002, }, legmineb = { bitmap = "icons/air_bomber_minelayer.png", - size = 1.39999998 + size = 1.39999998, }, legministarfall = { bitmap = "icons/armvulc.png", - size = 1.88999987 + size = 1.88999987, }, legmos = { bitmap = "icons/air_hover_rocket.png", - size = 1.25999999 + size = 1.25999999, }, legmost3 = { bitmap = "icons/air_hover_rocket.png", - size = 2 + size = 2, }, legmrv = { bitmap = "icons/vehicle_t2_raid.png", - size = 1.45000005 + size = 1.45000005, }, legnap = { bitmap = "icons/air_t2_bomber_napalm.png", - size = 1.85000002 + size = 1.85000002, }, legner = { bitmap = "icons/hover_gun.png", - size = 1 + size = 1, }, legoptio = { bitmap = "icons/ship_t2_aa_flak.png", - size = 1.36499989 + size = 1.36499989, }, legotter = { bitmap = "icons/amphib_worker.png", - size = 1.36499989 + size = 1.36499989, }, legpede = { bitmap = "icons/corkarg_2.05.png", - size = 3 + size = 3, }, legperdition = { bitmap = "icons/tacnuke.png", - size = 1.88999987 + size = 1.88999987, }, legphoenix = { bitmap = "icons/air_t2_laser.png", - size = 1.74299991 + size = 1.74299991, }, legpontus = { bitmap = "icons/ship.png", - size = 1.14999998 + size = 1.14999998, }, legrad = { bitmap = "icons/radar_t1.png", - size = 0.94499993 + size = 0.94499993, }, legrail = { bitmap = "icons/vehicle_t1_tank_rail.png", - size = 1.35000002 + size = 1.35000002, }, legrl = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, legrhapsis = { bitmap = "icons/aa_t15.png", - size = 1.15499997 + size = 1.15499997, }, legsco = { bitmap = "icons/vehicle_t2_sco.png", - size = 1.64999998 + size = 1.64999998, }, legscout = { bitmap = "icons/vehicle.png", - size = 0.57749999 + size = 0.57749999, }, legsh = { bitmap = "icons/hover_raid.png", - size = 1 + size = 1, }, legsilo = { bitmap = "icons/nuke.png", - size = 2.51999998 + size = 2.51999998, }, legshot = { bitmap = "icons/bot_t2_impulse2x.png", - size = 1.60000002 + size = 1.60000002, }, babylegshot = { bitmap = "icons/kbot_t2_shotgun.png", - size = 1.60000002 + size = 1.60000002, }, legsnapper = { bitmap = "icons/corroach_0.9.png", - size = 0.94499993 + size = 0.94499993, }, legsolar = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, legsrail = { bitmap = "icons/allterrain_t2_rail.png", - size = 1.85000002 + size = 1.85000002, }, legsrailt4 = { bitmap = "icons/allterrain_t2_rail.png", - size = 4 + size = 4, }, legstarfall = { bitmap = "icons/armvulc.png", - size = 3.25499964 + size = 3.25499964, }, legstr = { bitmap = "icons/bot_t2_raid.png", - size = 1.29999995 + size = 1.29999995, }, legstronghold = { bitmap = "icons/air_t2_transport_shotgun.png", - size = 1.83749986 + size = 1.83749986, }, legjim = { bitmap = "icons/factory_ship.png", - size = 1.52250004 + size = 1.52250004, }, legtide = { bitmap = "icons/energy1_1.0.png", - size = 1.04999995 + size = 1.04999995, }, legtl = { bitmap = "icons/defence_1_naval.png", - size = 1.10249984 + size = 1.10249984, }, legfeconv = { bitmap = "icons/metalmaker_t1.png", - size = 0.78749996 + size = 0.78749996, }, legfus = { bitmap = "icons/fusion.png", - size = 1.46999991 + size = 1.46999991, }, legtriarius = { bitmap = "icons/ship_destroyer.png", - size = 1.51199996 + size = 1.51199996, }, legtriariusalt = { bitmap = "icons/ship_destroyer.png", - size = 1.51199996 + size = 1.51199996, }, legstingray = { bitmap = "icons/sub.png", - size = 1.29999995 + size = 1.29999995, }, legvcarry = { bitmap = "icons/vehicle_t2_dronecarryland.png", - size = 1.64999998 + size = 1.64999998, }, legeallterrainmech = { bitmap = "icons/t3_allterrain_drone_cluster_bot.png", - size = 2.61999998 + size = 2.61999998, }, legvelite = { bitmap = "icons/ship_raid.png", - size = 1.15499997 + size = 1.15499997, }, legvenator = { bitmap = "icons/air_t2.png", - size = 1.02899992 + size = 1.02899992, }, legvp = { bitmap = "icons/factory_vehicle.png", - size = 1.52250004 + size = 1.52250004, }, legwhisper = { bitmap = "icons/air_t2_radar.png", - size = 1.39649999 + size = 1.39649999, }, legwin = { bitmap = "icons/wind.png", - size = 1.04999995 + size = 1.04999995, }, legwint2 = { bitmap = "icons/wind.png", - size = 1.67999995 + size = 1.67999995, }, legmlv = { bitmap = "icons/cormlv_1.0.png", - size = 1.04999995 + size = 1.04999995, }, lootboxbronze = { bitmap = "icons/lootbox.png", - size = 1.04999995 + size = 1.04999995, }, lootboxgold = { bitmap = "icons/lootboxt3.png", - size = 1.20749986 + size = 1.20749986, }, lootboxnano_t1_var1 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var2 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var3 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var4 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var5 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var6 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var7 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var8 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t1_var9 = { bitmap = "icons/scavnanotc_t1.png", - size = 1.57499993 + size = 1.57499993, }, lootboxnano_t2_var1 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var2 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var3 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var4 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var5 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var6 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var7 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var8 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t2_var9 = { bitmap = "icons/scavnanotc_t2.png", - size = 1.96874988 + size = 1.96874988, }, lootboxnano_t3_var1 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var2 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var3 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var4 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var5 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var6 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var7 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var8 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t3_var9 = { bitmap = "icons/scavnanotc_t3.png", - size = 2.46749973 + size = 2.46749973, }, lootboxnano_t4_var1 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var2 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var3 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var4 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var5 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var6 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var7 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var8 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxnano_t4_var9 = { bitmap = "icons/scavnanotc_t4.png", - size = 3.09749985 + size = 3.09749985, }, lootboxplatinum = { bitmap = "icons/lootboxt4.png", - size = 1.25999999 + size = 1.25999999, }, lootboxsilver = { bitmap = "icons/lootboxt2.png", - size = 1.15499997 + size = 1.15499997, }, lootdroppod_gold = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, lootdroppod_printer = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, meteor = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, mission_command_tower = { bitmap = "icons/mission_command_tower.png", - size = 2.46749973 + size = 2.46749973, }, nuketest = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, nuketestcor = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, nuketestorg = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, raptor_air_bomber_acid_t2_v1 = { bitmap = "icons/raptor_air_acid.png", - size = 2.5 + size = 2.5, }, raptor_air_bomber_basic_t1_v1 = { bitmap = "icons/raptor_air.png", - size = 1.25 + size = 1.25, }, raptor_air_bomber_basic_t2_v1 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_bomber_basic_t2_v2 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_bomber_basic_t4_v1 = { bitmap = "icons/raptor_air.png", - size = 3 + size = 3, }, raptor_air_bomber_basic_t4_v2 = { bitmap = "icons/raptor_air.png", - size = 3 + size = 3, }, raptor_air_bomber_brood_t4_v2 = { bitmap = "icons/raptor_air.png", - size = 3 + size = 3, }, raptor_air_bomber_brood_t4_v3 = { bitmap = "icons/raptor_air.png", - size = 3 + size = 3, }, raptor_air_bomber_brood_t4_v4 = { bitmap = "icons/raptor_air.png", - size = 3 + size = 3, }, raptor_air_bomber_emp_t2_v1 = { bitmap = "icons/raptor_air.png", - size = 2.5 + size = 2.5, }, raptor_air_fighter_basic_t1_v1 = { bitmap = "icons/raptor_air.png", - size = 1.25 + size = 1.25, }, raptor_air_fighter_basic_t2_v1 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_fighter_basic_t2_v2 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_fighter_basic_t2_v3 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_fighter_basic_t2_v4 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_fighter_basic_t4_v1 = { bitmap = "icons/raptor_air.png", - size = 2 + size = 2, }, raptor_air_kamikaze_basic_t2_v1 = { bitmap = "icons/raptor_air.png", - size = 1.5 + size = 1.5, }, raptor_air_scout_basic_t2_v1 = { bitmap = "icons/raptor_air.png", - size = 1.25 + size = 1.25, }, raptor_air_scout_basic_t3_v1 = { bitmap = "icons/raptor_air.png", - size = 1.75 + size = 1.75, }, raptor_air_scout_basic_t4_v1 = { bitmap = "icons/raptor_air.png", - size = 2.25 + size = 2.25, }, raptor_allterrain_arty_acid_t2_v1 = { bitmap = "icons/raptor_acid_arty.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_arty_acid_t4_v1 = { bitmap = "icons/raptor_arty.png", - size = 3 + size = 3, }, raptor_allterrain_arty_basic_t2_v1 = { bitmap = "icons/raptor_arty.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_arty_basic_t4_v1 = { bitmap = "icons/raptor_arty.png", - size = 3 + size = 3, }, raptor_allterrain_arty_brood_t2_v1 = { bitmap = "icons/raptor_earty.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_arty_brood_t4_v1 = { bitmap = "icons/raptor_arty.png", - size = 3 + size = 3, }, raptor_allterrain_arty_emp_t2_v1 = { bitmap = "icons/raptor_earty.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_arty_emp_t4_v1 = { bitmap = "icons/raptor_arty.png", - size = 3 + size = 3, }, raptor_allterrain_assault_acid_t2_v1 = { bitmap = "icons/raptor_acid.png", - size = 2 + size = 2, }, raptor_allterrain_assault_basic_t2_v1 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_allterrain_assault_basic_t2_v2 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_allterrain_assault_basic_t2_v3 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_allterrain_assault_basic_t4_v1 = { bitmap = "icons/raptor.png", - size = 3 + size = 3, }, raptor_allterrain_assault_basic_t4_v2 = { bitmap = "icons/raptor.png", - size = 3 + size = 3, }, raptor_allterrain_assault_emp_t2_v1 = { bitmap = "icons/raptor_paralyze.png", - size = 2 + size = 2, }, raptor_allterrain_swarmer_acid_t2_v1 = { bitmap = "icons/raptor_acid.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_swarmer_basic_t2_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_swarmer_basic_t3_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_swarmer_basic_t4_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_swarmer_emp_t2_v1 = { bitmap = "icons/raptor_paralyze.png", - size = 1.5 + size = 1.5, }, raptor_allterrain_swarmer_fire_t2_v1 = { bitmap = "icons/raptor_flame.png", - size = 1.5 + size = 1.5, }, raptor_antinuke = { bitmap = "icons/raptor_roost.png", - size = 0 + size = 0, }, raptor_hive = { bitmap = "icons/raptor_roost.png", - size = 2 + size = 2, }, raptor_land_assault_acid_t2_v1 = { bitmap = "icons/raptor_acid.png", - size = 2 + size = 2, }, raptor_land_assault_basic_t2_v1 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_land_assault_basic_t2_v2 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_land_assault_basic_t2_v3 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_land_assault_basic_t4_v1 = { bitmap = "icons/raptor.png", - size = 3 + size = 3, }, raptor_land_assault_basic_t4_v2 = { bitmap = "icons/raptor.png", - size = 3 + size = 3, }, raptor_land_assault_emp_t2_v1 = { bitmap = "icons/raptor_paralyze.png", - size = 2 + size = 2, }, raptor_land_assault_spectre_t2_v1 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_land_assault_spectre_t4_v1 = { bitmap = "icons/raptor.png", - size = 3 + size = 3, }, raptor_land_kamikaze_basic_t2_v1 = { bitmap = "icons/raptor_bomb.png", - size = 1 + size = 1, }, raptor_land_kamikaze_basic_t4_v1 = { bitmap = "icons/raptor_bomb.png", - size = 1.5 + size = 1.5, }, raptor_land_kamikaze_emp_t2_v1 = { bitmap = "icons/raptor_bomb.png", - size = 1 + size = 1, }, raptor_land_kamikaze_emp_t4_v1 = { bitmap = "icons/raptor_bomb.png", - size = 1.5 + size = 1.5, }, raptor_land_spiker_basic_t2_v1 = { bitmap = "icons/raptor_spike.png", - size = 1.5 + size = 1.5, }, raptor_land_spiker_basic_t4_v1 = { bitmap = "icons/raptor_spike.png", - size = 2 + size = 2, }, raptor_land_spiker_spectre_t4_v1 = { bitmap = "icons/raptor_spike.png", - size = 2 + size = 2, }, raptor_land_swarmer_acids_t2_v1 = { bitmap = "icons/raptor_acid.png", - size = 1 + size = 1, }, raptor_land_swarmer_basic_t1_v1 = { bitmap = "icons/raptor.png", - size = 0.75 + size = 0.75, }, raptor_land_swarmer_basic_t2_v1 = { bitmap = "icons/raptor.png", - size = 1 + size = 1, }, raptor_land_swarmer_basic_t2_v2 = { bitmap = "icons/raptor.png", - size = 1 + size = 1, }, raptor_land_swarmer_basic_t2_v3 = { bitmap = "icons/raptor.png", - size = 1 + size = 1, }, raptor_land_swarmer_basic_t2_v4 = { bitmap = "icons/raptor.png", - size = 1 + size = 1, }, raptor_land_swarmer_basic_t3_v1 = { bitmap = "icons/raptor.png", - size = 1.25 + size = 1.25, }, raptor_land_swarmer_basic_t3_v2 = { bitmap = "icons/raptor.png", - size = 1.25 + size = 1.25, }, raptor_land_swarmer_basic_t3_v3 = { bitmap = "icons/raptor.png", - size = 1.25 + size = 1.25, }, raptor_land_swarmer_basic_t4_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_land_swarmer_basic_t4_v2 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_land_swarmer_brood_t2_v1 = { bitmap = "icons/raptor.png", - size = 1 + size = 1, }, raptor_land_swarmer_brood_t3_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_land_swarmer_brood_t4_v1 = { bitmap = "icons/raptor.png", - size = 2 + size = 2, }, raptor_land_swarmer_emp_t2_v1 = { bitmap = "icons/raptor_paralyze.png", - size = 1 + size = 1, }, raptor_land_swarmer_fire_t2_v1 = { bitmap = "icons/raptor_flame.png", - size = 1.5 + size = 1.5, }, raptor_land_swarmer_fire_t4_v1 = { bitmap = "icons/raptor_flame.png", - size = 2 + size = 2, }, raptor_land_swarmer_heal_t1_v1 = { bitmap = "icons/raptor.png", - size = 0.75 + size = 0.75, }, raptor_land_swarmer_heal_t2_v1 = { bitmap = "icons/raptor.png", - size = 1.125 + size = 1.125, }, raptor_land_swarmer_heal_t3_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_land_swarmer_heal_t4_v1 = { bitmap = "icons/raptor.png", - size = 1.875 + size = 1.875, }, raptor_land_swarmer_spectre_t3_v1 = { bitmap = "icons/raptor.png", - size = 1.25 + size = 1.25, }, raptor_land_swarmer_spectre_t4_v1 = { bitmap = "icons/raptor.png", - size = 1.5 + size = 1.5, }, raptor_matriarch_acid = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_matriarch_basic = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_matriarch_electric = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_matriarch_fire = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_matriarch_healer = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_matriarch_spectre = { bitmap = "icons/raptor_queen.png", - size = 3 + size = 3, }, raptor_queen_easy = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_queen_epic = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_queen_hard = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_queen_normal = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_queen_veryeasy = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_queen_veryhard = { bitmap = "icons/raptor_queen.png", - size = 5 + size = 5, }, raptor_turret_acid_t2_v1 = { bitmap = "icons/raptor_tentacle.png", - size = 2 + size = 2, }, raptor_turret_acid_t3_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 3 + size = 3, }, raptor_turret_acid_t4_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 5 + size = 5, }, raptor_turret_antiair_t2_v1 = { bitmap = "icons/raptor_tentacle.png", - size = 2 + size = 2, }, raptor_turret_antiair_t3_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 3 + size = 3, }, raptor_turret_antiair_t4_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 5 + size = 5, }, raptor_turret_antinuke_t2_v1 = { bitmap = "icons/raptor_tentacle.png", - size = 2 + size = 2, }, raptor_turret_antinuke_t3_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 3 + size = 3, }, raptor_turret_basic_t2_v1 = { bitmap = "icons/raptor_tentacle.png", - size = 2 + size = 2, }, raptor_turret_basic_t3_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 3 + size = 3, }, raptor_turret_basic_t4_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 5 + size = 5, }, raptor_turret_emp_t2_v1 = { bitmap = "icons/raptor_tentacle.png", - size = 2 + size = 2, }, raptor_turret_emp_t3_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 3 + size = 3, }, raptor_turret_emp_t4_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 5 + size = 5, }, raptor_turret_meteor_t4_v1 = { bitmap = "icons/raptor_tentacle2.png", - size = 5 + size = 5, }, raptorh1b = { bitmap = "icons/raptor.png", - size = 0.75 + size = 0.75, }, resourcecheat = { bitmap = "icons/building.png", - size = 1.36499989 + size = 1.36499989, }, scavempspawner = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, scavengerdroppod = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, scavbeacon_t1 = { bitmap = "icons/beacon.png", - size = 1.25 + size = 1.25, }, scavbeacon_t2 = { bitmap = "icons/beacon.png", - size = 1.5 + size = 1.5, }, scavbeacon_t3 = { bitmap = "icons/beacon.png", - size = 1.74299991 + size = 1.74299991, }, scavbeacon_t4 = { bitmap = "icons/beacon.png", - size = 2 + size = 2, }, scavengerdroppodfriendly = { bitmap = "icons/mine.png", - size = 0.55649996 + size = 0.55649996, }, scavmist = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, scavmistxl = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, scavmistxxl = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, scavsafeareabeacon = { bitmap = "icons/beacon.png", - size = 1.74299991 + size = 1.74299991, }, scavtacnukespawner = { bitmap = "icons/aa.png", - size = 0.89249998 + size = 0.89249998, }, xmasball1_1 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball1_2 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball1_3 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball1_4 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball1_5 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball1_6 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_1 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_2 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_3 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_4 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_5 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, xmasball2_6 = { bitmap = "icons/blank.png", - size = 1.04999995 + size = 1.04999995, }, leghrk = { bitmap = "icons/kbot_t2_barrage.png", - size = 1.6 + size = 1.6, }, legfdrag = { bitmap = "icons/wall_0.4.png", - size = 0.41999999 + size = 0.41999999, }, -- T2 split armhaca = { bitmap = "icons/shipengineer.png", - size = 2.31 + size = 2.31, }, armhack = { bitmap = "icons/bot_t2_worker.png", - size = 2.31 + size = 2.31, }, armhacs = { bitmap = "icons/vehicle_t2_worker.png", - size = 2.31 + size = 2.31, }, armhacv = { bitmap = "icons/vehicle_t2_worker.png", - size = 2.31 + size = 2.31, }, corhaca = { bitmap = "icons/air_t2_worker.png", - size = 2.31 + size = 2.31, }, corhack = { bitmap = "icons/bot_t2_worker.png", - size = 2.31 + size = 2.31, }, corhacs = { bitmap = "icons/shipengineer.png", - size = 2.31 + size = 2.31, }, corhacv = { bitmap = "icons/vehicle_t2_worker.png", - size = 2.31 + size = 2.31, }, leghaca = { bitmap = "icons/air_t2_worker.png", - size = 2.31 + size = 2.31, }, leghack = { bitmap = "icons/bot_t2_worker.png", - size = 2.31 + size = 2.31, }, leghacv = { bitmap = "icons/vehicle_t2_worker.png", - size = 2.31 + size = 2.31, }, - armhaap = { bitmap = "icons/factory_air_t2.png", - size = 2.6 + size = 2.6, }, armhaapuw = { bitmap = "icons/factory_air_t2.png", - size = 2.6 + size = 2.6, }, armhalab = { bitmap = "icons/factory_bot_t2.png", - size = 2.6 + size = 2.6, }, armhavp = { bitmap = "icons/factory_vehicle_t2.png", - size = 2.6 + size = 2.6, }, armhasy = { bitmap = "icons/factory_ship_t2.png", - size = 2.6 + size = 2.6, }, - corhaap = { bitmap = "icons/factory_air_t2.png", - size = 2.6 + size = 2.6, }, corhaapuw = { bitmap = "icons/factory_air_t2.png", - size = 2.6 + size = 2.6, }, - + corhalab = { bitmap = "icons/factory_bot_t2.png", - size = 2.6 + size = 2.6, }, corhavp = { bitmap = "icons/factory_vehicle_t2.png", - size = 2.6 + size = 2.6, }, corhasy = { bitmap = "icons/factory_ship_t2.png", - size = 2.6 + size = 2.6, }, leghaap = { bitmap = "icons/factory_air_t2.png", - size = 2.6 + size = 2.6, }, leghalab = { bitmap = "icons/factory_bot_t2.png", - size = 2.6 + size = 2.6, }, leghavp = { bitmap = "icons/factory_vehicle_t2.png", - size = 2.6 + size = 2.6, }, - blank = { bitmap = "icons/blank.png", @@ -3967,9 +3964,9 @@ local icontypes = { local newIcontypes = {} for name, params in pairs(icontypes) do newIcontypes[name] = params - newIcontypes[name..'_scav'] = { size = params.size or 1 } + newIcontypes[name .. "_scav"] = { size = params.size or 1 } if params.bitmap then - newIcontypes[name..'_scav'].bitmap = params.bitmap:gsub('/', '/inverted/') + newIcontypes[name .. "_scav"].bitmap = params.bitmap:gsub("/", "/inverted/") end end diff --git a/gamedata/map_feature_i18n_proxies.lua b/gamedata/map_feature_i18n_proxies.lua index bca30dd5094..7c6bdd413a7 100644 --- a/gamedata/map_feature_i18n_proxies.lua +++ b/gamedata/map_feature_i18n_proxies.lua @@ -1,801 +1,801 @@ -- Add entries to this file for map features that should read their I18N info from a proxy entry -- feature_name = 'I18N_entry_to_use' return { - ad0_banyan_1 = 'treeBanyan', - ad0_banyan_2 = 'treeBanyan', - ad0_banyan_3 = 'treeBanyan', - ad0_banyan_4 = 'treeBanyan', - ad0_banyan_5 = 'treeBanyan', - ad0_banyan_6 = 'treeBanyan', - ad0_aleppo_1 = 'treeAleppoPine', - ad0_aleppo_2 = 'treeAleppoPine', - ad0_aleppo_3 = 'treeAleppoPine', - ad0_aleppo_4 = 'treeAleppoPine', - ad0_aleppo_5 = 'treeAleppoPine', - ad0_aleppo_6 = 'treeAleppoPine', - ad0_aleppo_7 = 'treeAleppoPine', - ad0_aleppo_8 = 'treeAleppoPine', - ad0_aleppo_9 = 'treeAleppoPine', - ad0_aleppo_10 = 'treeAleppoPine', - ad0_aleppo2_dense_dark_l = 'treeAleppoPine', - ad0_aleppo2_dense_dark_m = 'treeAleppoPine', - ad0_aleppo2_dense_dark_s = 'treeAleppoPine', - ad0_aleppo2_dense_dark_xl = 'treeAleppoPine', - ad0_aleppo2_dense_dead_l = 'treeAleppoPine', - ad0_aleppo2_dense_dead_m = 'treeAleppoPine', - ad0_aleppo2_dense_dead_s = 'treeAleppoPine', - ad0_aleppo2_dense_dead_xl = 'treeAleppoPine', - ad0_aleppo2_dense_light_l = 'treeAleppoPine', - ad0_aleppo2_dense_light_m = 'treeAleppoPine', - ad0_aleppo2_dense_light_s = 'treeAleppoPine', - ad0_aleppo2_dense_light_xl = 'treeAleppoPine', - ad0_aleppo2_dense_med_l = 'treeAleppoPine', - ad0_aleppo2_dense_med_m = 'treeAleppoPine', - ad0_aleppo2_dense_med_s = 'treeAleppoPine', - ad0_aleppo2_dense_med_xl = 'treeAleppoPine', - ad0_aleppo2_double_dark_l = 'treeAleppoPine', - ad0_aleppo2_double_dark_m = 'treeAleppoPine', - ad0_aleppo2_double_dark_s = 'treeAleppoPine', - ad0_aleppo2_double_dark_xl = 'treeAleppoPine', - ad0_aleppo2_double_dead_l = 'treeAleppoPine', - ad0_aleppo2_double_dead_m = 'treeAleppoPine', - ad0_aleppo2_double_dead_s = 'treeAleppoPine', - ad0_aleppo2_double_dead_xl = 'treeAleppoPine', - ad0_aleppo2_double_light_l = 'treeAleppoPine', - ad0_aleppo2_double_light_m = 'treeAleppoPine', - ad0_aleppo2_double_light_s = 'treeAleppoPine', - ad0_aleppo2_double_light_xl = 'treeAleppoPine', - ad0_aleppo2_double_med_l = 'treeAleppoPine', - ad0_aleppo2_double_med_m = 'treeAleppoPine', - ad0_aleppo2_double_med_s = 'treeAleppoPine', - ad0_aleppo2_double_med_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_l = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_m = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_s = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_l = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_m = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_s = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_light_l = 'treeAleppoPine', - ad0_aleppo2_sparse_light_m = 'treeAleppoPine', - ad0_aleppo2_sparse_light_s = 'treeAleppoPine', - ad0_aleppo2_sparse_light_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_med_l = 'treeAleppoPine', - ad0_aleppo2_sparse_med_m = 'treeAleppoPine', - ad0_aleppo2_sparse_med_s = 'treeAleppoPine', - ad0_aleppo2_sparse_med_xl = 'treeAleppoPine', - ad0_pine_1_l = 'treePine', - ad0_pine_1_m = 'treePine', - ad0_pine_1_s = 'treePine', - ad0_pine_1_xl = 'treePine', - ad0_pine_1_xxl = 'treePine', - ad0_pine_2_l = 'treePine', - ad0_pine_2_m = 'treePine', - ad0_pine_2_s = 'treePine', - ad0_pine_2_xl = 'treePine', - ad0_pine_2_xxl = 'treePine', - ad0_pine_3_l = 'treePine', - ad0_pine_3_m = 'treePine', - ad0_pine_3_s = 'treePine', - ad0_pine_3_xl = 'treePine', - ad0_pine_3_xxl = 'treePine', - prock1 = 'ancientRocks', - prock2 = 'ancientRocks', - prock3 = 'ancientRocks', - prock4 = 'ancientRocks', - prock5 = 'ancientRocks', - pvolcanicrock1 = 'ancientRocks', - pvolcanicrock2 = 'ancientRocks', - pvolcanicrock3 = 'ancientRocks', - pvolcanicrock4 = 'ancientRocks', - pvolcanicrock5 = 'ancientRocks', - ad0_baobab_0 = 'treeBaobab', - ad0_baobab_1 = 'treeBaobab', - ad0_baobab_2 = 'treeBaobab', - ad0_baobab_3 = 'treeBaobab', - ad0_baobab_4 = 'treeBaobab', - ad0_bush_2_l = 'bush', - ad0_bush_2_m = 'bush', - ad0_bush_2_s = 'bush', - ['ad0_bushes_l_1'] = 'bushLarge', - ['ad0_bushes_l_2'] = 'bushLarge', - ['ad0_bushes_l_3'] = 'bushLarge', - ['ad0_bushes_l_4'] = 'bushLarge', - ['ad0_bushes_l_5'] = 'bushLarge', - ['ad0_bushes_l_6'] = 'bushLarge', - ['ad0_bushes_l_7'] = 'bushLarge', - ['ad0_bushes_l_8'] = 'bushLarge', - ['ad0_bushes_xl_1'] = 'bushLarger', - ad0_bushes_xl_2 = 'bushLarger', - ad0_bushes_xl_3 = 'bushLarger', - ad0_bushes_xl_4 = 'bushLarger', - ad0_bushes_xl_5 = 'bushLarger', - ad0_bushes_xl_6 = 'bushLarger', - ad0_bushes_xl_7 = 'bushLarger', - ad0_bushes_m_1 = 'bushMedium', - ad0_bushes_m_2 = 'bushMedium', - ad0_bushes_m_3 = 'bushMedium', - ad0_bushes_m_4 = 'bushMedium', - ad0_bushes_m_5 = 'bushMedium', - ad0_bushes_m_6 = 'bushMedium', - ad0_bushes_m_7 = 'bushMedium', - ad0_bushes_s_1 = 'bushSmall', - ad0_bushes_s_2 = 'bushSmall', - ad0_bushes_s_3 = 'bushSmall', - ad0_bushes_s_4 = 'bushSmall', - ad0_bushes_s_5 = 'bushSmall', - ad0_bushes_s_6 = 'bushSmall', - ad0_bushes_s_7 = 'bushSmall', - btreechi_3 = 'treeCedar', - btreechi_4 = 'treeCedar', - btreeclo_1 = 'treeCedar', - btreeclo_2 = 'treeCedar', - btreeclo_4 = 'treeCedar', - crystalring = 'metal', - map_metal_spot1 = 'metal', - map_metal_spot2 = 'metal', - map_metal_spot3 = 'metal', - cluster1_dead = 'treeDeadPalms', - cluster2_dead = 'treeDeadPalms', - cluster3_dead = 'treeDeadPalms', - artbirchbighi = 'treeDeciduous', - artbirchmediumhi = 'treeDeciduous', - artbircholdhi = 'treeDeciduous', - artbirchsmallhi = 'treeDeciduous', - artbirchwinterhi = 'treeDeciduous', - artbush1hi = 'treeDeciduous', - artbush2hi = 'treeDeciduous', - artbush3hi = 'treeDeciduous', - artbushweird1hi = 'treeDeciduous', - artbushweird2hi = 'treeDeciduous', - artmaplebasichi = 'treeDeciduous', - artmaplebighi = 'treeDeciduous', - artmapleoldhi = 'treeDeciduous', - artmapletallhi = 'treeDeciduous', - artmaplevarhi = 'treeDeciduous', - artmaplewinterhi = 'treeDeciduous', - artmapleyounghi = 'treeDeciduous', - artoakbasichi = 'treeDeciduous', - artoakbasicvarhi = 'treeDeciduous', - artoakbighi = 'treeDeciduous', - artoakgrandhi = 'treeDeciduous', - artoakoldhi = 'treeDeciduous', - artoaktallhi = 'treeDeciduous', - artoakyounghi = 'treeDeciduous', - ['btreea-1'] = 'treeDeciduous', - ['btreea-2'] = 'treeDeciduous', - ['btreea-3'] = 'treeDeciduous', - ['btreea-4'] = 'treeDeciduous', - ['btreea-5'] = 'treeDeciduous', - ['btreebhi-1'] = 'treeDeciduous', - ['btreebhi-2'] = 'treeDeciduous', - ['btreebhi-3'] = 'treeDeciduous', - ['btreebhi-4'] = 'treeDeciduous', - ['btreebhi-5'] = 'treeDeciduous', - ['btreeblo-1'] = 'treeDeciduous', - ['btreeblo-2'] = 'treeDeciduous', - ['btreeblo-3'] = 'treeDeciduous', - ['btreeblo-4'] = 'treeDeciduous', - ['btreeblo-5'] = 'treeDeciduous', - ['btreechi-1'] = 'treeDeciduous', - ['btreechi-2'] = 'treeDeciduous', - ['btreechi-3'] = 'treeDeciduous', - ['btreechi-4'] = 'treeDeciduous', - ['btreechi-5'] = 'treeDeciduous', - ['btreeclo-1'] = 'treeDeciduous', - ['btreeclo-2'] = 'treeDeciduous', - ['btreeclo-3'] = 'treeDeciduous', - ['btreeclo-4'] = 'treeDeciduous', - ['btreeclo-5'] = 'treeDeciduous', - eistatue1 = 'statueEasterIsland', - eistatue2 = 'statueEasterIsland', - eistatue3 = 'statueEasterIsland', - eistatue4 = 'statueEasterIsland', - eistatue5 = 'statueEasterIsland', - eistatue6 = 'statueEasterIsland', - eistatue7 = 'statueEasterIsland', - eistatue8 = 'statueEasterIsland', - eistatuecl1 = 'statueEasterIsland', - eistatuecl2 = 'statueEasterIsland', - espire1 = 'energySpire', - espire2 = 'energySpire', - espire3 = 'energySpire', - espire4 = 'energySpire', - espire5 = 'energySpire', - cycas2 = 'fern', - fern_sword = 'fern', - fern2 = 'fern', - cycas6 = 'fernsStone', - cycas8 = 'fernsStone', - fern6 = 'fernStone', - fern8 = 'fernStone', - cycas1 = 'fernStones', - fern1 = 'fernStones', - cycas3 = 'ferns', - cycas4 = 'ferns', - cycas5 = 'ferns', - cycas7 = 'ferns', - fern3 = 'ferns', - fern4 = 'ferns', - fern5 = 'ferns', - fern7 = 'ferns', - fir_tree_small_1__tree_fir_tall_1 = 'treeFir', - fir_tree_small_1__tree_fir_tall_2 = 'treeFir', - fir_tree_small_1__tree_fir_tall_3 = 'treeFir', - fir_tree_small_1__tree_fir_tall_4 = 'treeFir', - fir_tree_small_1__tree_fir_tall_5 = 'treeFir', - fir_tree_small_2__tree_fir_tall_1 = 'treeFir', - fir_tree_small_2__tree_fir_tall_2 = 'treeFir', - fir_tree_small_2__tree_fir_tall_3 = 'treeFir', - fir_tree_small_2__tree_fir_tall_4 = 'treeFir', - fir_tree_small_2__tree_fir_tall_5 = 'treeFir', - fir_tree_small_3__tree_fir_tall_1 = 'treeFir', - fir_tree_small_3__tree_fir_tall_2 = 'treeFir', - fir_tree_small_3__tree_fir_tall_3 = 'treeFir', - fir_tree_small_3__tree_fir_tall_4 = 'treeFir', - fir_tree_small_3__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_5 = 'treeFir', - ad0_senegal_1 = 'treePalm', - ad0_senegal_1_large = 'treePalm', - ad0_senegal_2 = 'treePalm', - ad0_senegal_2_large = 'treePalm', - ad0_senegal_3 = 'treePalm', - ad0_senegal_3_large = 'treePalm', - ad0_senegal_4 = 'treePalm', - ad0_senegal_4_large = 'treePalm', - ad0_senegal_5 = 'treePalm', - ad0_senegal_5_large = 'treePalm', - ad0_senegal_6 = 'treePalm', - ad0_senegal_6_large = 'treePalm', - ad0_senegal_7 = 'treePalm', - ad0_senegal_7_large = 'treePalm', - cluster1 = 'treePalms', - cluster2 = 'treePalms', - cluster3 = 'treePalms', - treecluster1 = 'treePalms', - treecluster2 = 'treePalms', - treecluster3 = 'treePalms', - palmetto_1 = 'treePalmetto', - palmetto_2 = 'treePalmetto', - palmetto_3 = 'treePalmetto', - peyote1 = 'peyote', - peyote2 = 'peyote', - peyote3 = 'peyote', - peyote4 = 'peyote', - allpinesb_ad0_brown_a_l = 'treePine', - allpinesb_ad0_brown_a_l_lod1 = 'treePine', - allpinesb_ad0_brown_a_m = 'treePine', - allpinesb_ad0_brown_a_m_lod1 = 'treePine', - allpinesb_ad0_brown_a_s = 'treePine', - allpinesb_ad0_brown_a_s_lod1 = 'treePine', - allpinesb_ad0_brown_a_xl = 'treePine', - allpinesb_ad0_brown_a_xl_lod1 = 'treePine', - allpinesb_ad0_brown_a_xs = 'treePine', - allpinesb_ad0_brown_a_xxl = 'treePine', - allpinesb_ad0_brown_a_xxl_lod1 = 'treePine', - allpinesb_ad0_brown_b_l = 'treePine', - allpinesb_ad0_brown_b_l_lod1 = 'treePine', - allpinesb_ad0_brown_b_m = 'treePine', - allpinesb_ad0_brown_b_m_lod1 = 'treePine', - allpinesb_ad0_brown_b_s = 'treePine', - allpinesb_ad0_brown_b_s_lod1 = 'treePine', - allpinesb_ad0_brown_b_xl = 'treePine', - allpinesb_ad0_brown_b_xl_lod1 = 'treePine', - allpinesb_ad0_brown_b_xs = 'treePine', - allpinesb_ad0_brown_b_xxl = 'treePine', - allpinesb_ad0_brown_b_xxl_lod1 = 'treePine', - allpinesb_ad0_brown_c_l = 'treePine', - allpinesb_ad0_brown_c_l_lod1 = 'treePine', - allpinesb_ad0_brown_c_m = 'treePine', - allpinesb_ad0_brown_c_m_lod1 = 'treePine', - allpinesb_ad0_brown_c_s = 'treePine', - allpinesb_ad0_brown_c_s_lod1 = 'treePine', - allpinesb_ad0_brown_c_xl = 'treePine', - allpinesb_ad0_brown_c_xl_lod1 = 'treePine', - allpinesb_ad0_brown_c_xs = 'treePine', - allpinesb_ad0_brown_c_xxl = 'treePine', - allpinesb_ad0_brown_c_xxl_lod1 = 'treePine', - allpinesb_ad0_green_a_l = 'treePine', - allpinesb_ad0_green_a_l_lod1 = 'treePine', - allpinesb_ad0_green_a_m = 'treePine', - allpinesb_ad0_green_a_m_lod1 = 'treePine', - allpinesb_ad0_green_a_s = 'treePine', - allpinesb_ad0_green_a_s_lod1 = 'treePine', - allpinesb_ad0_green_a_xl = 'treePine', - allpinesb_ad0_green_a_xl_lod1 = 'treePine', - allpinesb_ad0_green_a_xs = 'treePine', - allpinesb_ad0_green_a_xxl = 'treePine', - allpinesb_ad0_green_a_xxl_lod1 = 'treePine', - allpinesb_ad0_green_b_l = 'treePine', - allpinesb_ad0_green_b_l_lod1 = 'treePine', - allpinesb_ad0_green_b_m = 'treePine', - allpinesb_ad0_green_b_m_lod1 = 'treePine', - allpinesb_ad0_green_b_s = 'treePine', - allpinesb_ad0_green_b_s_lod1 = 'treePine', - allpinesb_ad0_green_b_xl = 'treePine', - allpinesb_ad0_green_b_xl_lod1 = 'treePine', - allpinesb_ad0_green_b_xs = 'treePine', - allpinesb_ad0_green_b_xxl = 'treePine', - allpinesb_ad0_green_b_xxl_lod1 = 'treePine', - allpinesb_ad0_green_c_l = 'treePine', - allpinesb_ad0_green_c_l_lod1 = 'treePine', - allpinesb_ad0_green_c_m = 'treePine', - allpinesb_ad0_green_c_m_lod1 = 'treePine', - allpinesb_ad0_green_c_s = 'treePine', - allpinesb_ad0_green_c_s_lod1 = 'treePine', - allpinesb_ad0_green_c_xl = 'treePine', - allpinesb_ad0_green_c_xl_lod1 = 'treePine', - allpinesb_ad0_green_c_xs = 'treePine', - allpinesb_ad0_green_c_xxl = 'treePine', - allpinesb_ad0_green_c_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_a_l = 'treePine', - allpinesb_ad0_snow_a_l_lod1 = 'treePine', - allpinesb_ad0_snow_a_m = 'treePine', - allpinesb_ad0_snow_a_m_lod1 = 'treePine', - allpinesb_ad0_snow_a_s = 'treePine', - allpinesb_ad0_snow_a_s_lod1 = 'treePine', - allpinesb_ad0_snow_a_xl = 'treePine', - allpinesb_ad0_snow_a_xl_lod1 = 'treePine', - allpinesb_ad0_snow_a_xs = 'treePine', - allpinesb_ad0_snow_a_xxl = 'treePine', - allpinesb_ad0_snow_a_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_b_l = 'treePine', - allpinesb_ad0_snow_b_l_lod1 = 'treePine', - allpinesb_ad0_snow_b_m = 'treePine', - allpinesb_ad0_snow_b_m_lod1 = 'treePine', - allpinesb_ad0_snow_b_s = 'treePine', - allpinesb_ad0_snow_b_s_lod1 = 'treePine', - allpinesb_ad0_snow_b_xl = 'treePine', - allpinesb_ad0_snow_b_xl_lod1 = 'treePine', - allpinesb_ad0_snow_b_xs = 'treePine', - allpinesb_ad0_snow_b_xxl = 'treePine', - allpinesb_ad0_snow_b_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_c_l = 'treePine', - allpinesb_ad0_snow_c_l_lod1 = 'treePine', - allpinesb_ad0_snow_c_m = 'treePine', - allpinesb_ad0_snow_c_m_lod1 = 'treePine', - allpinesb_ad0_snow_c_s = 'treePine', - allpinesb_ad0_snow_c_s_lod1 = 'treePine', - allpinesb_ad0_snow_c_xl = 'treePine', - allpinesb_ad0_snow_c_xl_lod1 = 'treePine', - allpinesb_ad0_snow_c_xs = 'treePine', - allpinesb_ad0_snow_c_xxl = 'treePine', - allpinesb_ad0_snow_c_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_l = 'treePine', - allpinesb_ad0_snowgreen_a_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_m = 'treePine', - allpinesb_ad0_snowgreen_a_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_s = 'treePine', - allpinesb_ad0_snowgreen_a_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_xl = 'treePine', - allpinesb_ad0_snowgreen_a_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_xs = 'treePine', - allpinesb_ad0_snowgreen_a_xxl = 'treePine', - allpinesb_ad0_snowgreen_a_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_l = 'treePine', - allpinesb_ad0_snowgreen_b_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_m = 'treePine', - allpinesb_ad0_snowgreen_b_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_s = 'treePine', - allpinesb_ad0_snowgreen_b_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_xl = 'treePine', - allpinesb_ad0_snowgreen_b_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_xs = 'treePine', - allpinesb_ad0_snowgreen_b_xxl = 'treePine', - allpinesb_ad0_snowgreen_b_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_l = 'treePine', - allpinesb_ad0_snowgreen_c_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_m = 'treePine', - allpinesb_ad0_snowgreen_c_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_s = 'treePine', - allpinesb_ad0_snowgreen_c_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_xl = 'treePine', - allpinesb_ad0_snowgreen_c_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_xs = 'treePine', - allpinesb_ad0_snowgreen_c_xxl = 'treePine', - allpinesb_ad0_snowgreen_c_xxl_lod1 = 'treePine', - lowpoly_tree_pinetree1large = 'treePine', - lowpoly_tree_pinetree1largeburnt = 'treePine', - lowpoly_tree_pinetree1medium = 'treePine', - lowpoly_tree_pinetree1mediumburnt = 'treePine', - lowpoly_tree_pinetree1small = 'treePine', - lowpoly_tree_pinetree1smallburnt = 'treePine', - lowpoly_tree_pinetree1tiny = 'treePine', - lowpoly_tree_pinetree1tinyburnt = 'treePine', - lowpoly_tree_pinetree2large = 'treePine', - lowpoly_tree_pinetree2largeburnt = 'treePine', - lowpoly_tree_pinetree2medium = 'treePine', - lowpoly_tree_pinetree2mediumburnt = 'treePine', - lowpoly_tree_pinetree2small = 'treePine', - lowpoly_tree_pinetree2smallburnt = 'treePine', - lowpoly_tree_pinetree2tiny = 'treePine', - lowpoly_tree_pinetree2tinyburnt = 'treePine', - lowpoly_tree_pinetree3large = 'treePine', - lowpoly_tree_pinetree3largeburnt = 'treePine', - lowpoly_tree_pinetree3medium = 'treePine', - lowpoly_tree_pinetree3mediumburnt = 'treePine', - lowpoly_tree_pinetree3small = 'treePine', - lowpoly_tree_pinetree3smallburnt = 'treePine', - lowpoly_tree_pinetree3tiny = 'treePine', - lowpoly_tree_pinetree3tinyburnt = 'treePine', - lowpoly_tree_snowypinetree1large = 'treePine', - lowpoly_tree_snowypinetree1medium = 'treePine', - lowpoly_tree_snowypinetree1small = 'treePine', - lowpoly_tree_snowypinetree1tiny = 'treePine', - lowpoly_tree_snowypinetree2large = 'treePine', - lowpoly_tree_snowypinetree2medium = 'treePine', - lowpoly_tree_snowypinetree2small = 'treePine', - lowpoly_tree_snowypinetree2tiny = 'treePine', - lowpoly_tree_snowypinetree3large = 'treePine', - lowpoly_tree_snowypinetree3medium = 'treePine', - lowpoly_tree_snowypinetree3small = 'treePine', - lowpoly_tree_snowypinetree3tiny = 'treePine', - pipe_large_1 = 'pipeline', - pipe_large_2 = 'pipeline', - pipe_long_1 = 'pipeline', - pipe_long_2 = 'pipeline', - pipe_really_tall_2 = 'pipeline', - pipe_small_1 = 'pipeline', - pipe_small_2 = 'pipeline', - pipe_tall_1 = 'pipeline', - pipe_tall_2 = 'pipeline', - agorm_rock1 = 'rock', - agorm_rock2 = 'rock', - agorm_rock3 = 'rock', - agorm_rock4 = 'rock', - agorm_rock5 = 'rock', - agorm_rock6 = 'rock', - brock_1 = 'rock', - brock_10 = 'rock', - brock_2 = 'rock', - brock_3 = 'rock', - brock_4 = 'rock', - brock_5 = 'rock', - brock_6 = 'rock', - brock_7 = 'rock', - brock_8 = 'rock', - brock_9 = 'rock', - moonrock1 = 'rock', - moonrock2 = 'rock', - moonrock3 = 'rock', - moonrock4 = 'rock', - moonrock5 = 'rock', - pdrock1 = 'rock', - pdrock2 = 'rock', - pdrock3 = 'rock', - pdrock4 = 'rock', - pdrock5 = 'rock', - pdrock6 = 'rock', - pdrock7 = 'rock', - pdrock8 = 'rock', - pdrock1a = 'rock', - pdrock2a = 'rock', - pdrock3a = 'rock', - pdrock4a = 'rock', - rock1 = 'rock', - rock2 = 'rock', - rock3 = 'rock', - rock4 = 'rock', - rocksoar1 = 'rock', - rocksoar2 = 'rock', - rocksoar3 = 'rock', - rocksoar4 = 'rock', - rocksoar5 = 'rock', - rocksoar6 = 'rock', - pedro1 = 'cactusSanPedro', - pedro2 = 'cactusSanPedro', - pedro3 = 'cactusSanPedro', - pedro4 = 'cactusSanPedro', - pedro5 = 'cactusSanPedro', - pedro6 = 'cactusSanPedro', - tiberium01 = 'crystalSapphire', - tiberium03 = 'crystalSapphire', - tiberium06 = 'crystalSapphire', - tiberium09 = 'crystalSapphire', - mushroom01 = 'mushroomsOrange', - mushroom02 = 'mushroomsOrange', - mushroom03 = 'mushroomsOrange', - mushroom04 = 'mushroomsOrange', - mushroom05 = 'mushroomsOrange', - mushroom06 = 'mushroomsOrange', - mushroom07 = 'mushroomsOrange', - mushroom08 = 'mushroomsOrange', - mushroom09 = 'mushroomsOrange', - mushroom10 = 'mushroomsOrange', - mushroom11 = 'mushroomsPurple', - mushroom12 = 'mushroomsPurple', - mushroom13 = 'mushroomsPurple', - mushroom14 = 'mushroomsPurple', - mushroom15 = 'mushroomsPurple', - mushroom16 = 'mushroomsPurple', - mushroom17 = 'mushroomsPurple', - mushroom18 = 'mushroomsPurple', - mushroom19 = 'mushroomsPurple', - mushroom20 = 'mushroomsPurple', - mushroom21 = 'mushroomsTan', - mushroom22 = 'mushroomsTan', - mushroom23 = 'mushroomsTan', - mushroom24 = 'mushroomsTan', - mushroom25 = 'mushroomsTan', - mushroom26 = 'mushroomsTan', - mushroom27 = 'mushroomsTan', - mushroom28 = 'mushroomsTan', - mushroom29 = 'mushroomsTan', - mushroom30 = 'mushroomsTan', - cedar_atlas_1__cedar_atlas_1 = 'treeCedar', - cedar_atlas_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_1__cedar_atlas_dead = 'treeCedar', - cedar_atlas_2__cedar_atlas_1 = 'treeCedar', - cedar_atlas_2__cedar_atlas_2 = 'treeCedar', - cedar_atlas_2__cedar_atlas_dead = 'treeCedar', - cedar_atlas_3__cedar_atlas_1 = 'treeCedar', - cedar_atlas_3__cedar_atlas_2 = 'treeCedar', - cedar_atlas_3__cedar_atlas_dead = 'treeCedar', - cedar_atlas_sapling_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_1__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_2__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_2__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_3__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_3__cedar_atlas_2 = 'treeCedar', - fir_sapling_1__cedar_atlas_2 = 'treeFir', - fir_sapling_2__cedar_atlas_2 = 'treeFir', - slrock1 = 'rock', - slrock2 = 'rock', - slrock3 = 'rock', - slrock4 = 'rock', - treetype0 = 'tree', - treetype1 = 'tree', - treetype2 = 'tree', - treetype3 = 'tree', - treetype4 = 'tree', - treetype5 = 'tree', - treetype6 = 'tree', - treetype7 = 'tree', - treetype8 = 'tree', - treetype9 = 'tree', - treetype10 = 'tree', - treetype11 = 'tree', - treetype12 = 'tree', - treetype13 = 'tree', - treetype14 = 'tree', - treetype15 = 'tree', + ad0_banyan_1 = "treeBanyan", + ad0_banyan_2 = "treeBanyan", + ad0_banyan_3 = "treeBanyan", + ad0_banyan_4 = "treeBanyan", + ad0_banyan_5 = "treeBanyan", + ad0_banyan_6 = "treeBanyan", + ad0_aleppo_1 = "treeAleppoPine", + ad0_aleppo_2 = "treeAleppoPine", + ad0_aleppo_3 = "treeAleppoPine", + ad0_aleppo_4 = "treeAleppoPine", + ad0_aleppo_5 = "treeAleppoPine", + ad0_aleppo_6 = "treeAleppoPine", + ad0_aleppo_7 = "treeAleppoPine", + ad0_aleppo_8 = "treeAleppoPine", + ad0_aleppo_9 = "treeAleppoPine", + ad0_aleppo_10 = "treeAleppoPine", + ad0_aleppo2_dense_dark_l = "treeAleppoPine", + ad0_aleppo2_dense_dark_m = "treeAleppoPine", + ad0_aleppo2_dense_dark_s = "treeAleppoPine", + ad0_aleppo2_dense_dark_xl = "treeAleppoPine", + ad0_aleppo2_dense_dead_l = "treeAleppoPine", + ad0_aleppo2_dense_dead_m = "treeAleppoPine", + ad0_aleppo2_dense_dead_s = "treeAleppoPine", + ad0_aleppo2_dense_dead_xl = "treeAleppoPine", + ad0_aleppo2_dense_light_l = "treeAleppoPine", + ad0_aleppo2_dense_light_m = "treeAleppoPine", + ad0_aleppo2_dense_light_s = "treeAleppoPine", + ad0_aleppo2_dense_light_xl = "treeAleppoPine", + ad0_aleppo2_dense_med_l = "treeAleppoPine", + ad0_aleppo2_dense_med_m = "treeAleppoPine", + ad0_aleppo2_dense_med_s = "treeAleppoPine", + ad0_aleppo2_dense_med_xl = "treeAleppoPine", + ad0_aleppo2_double_dark_l = "treeAleppoPine", + ad0_aleppo2_double_dark_m = "treeAleppoPine", + ad0_aleppo2_double_dark_s = "treeAleppoPine", + ad0_aleppo2_double_dark_xl = "treeAleppoPine", + ad0_aleppo2_double_dead_l = "treeAleppoPine", + ad0_aleppo2_double_dead_m = "treeAleppoPine", + ad0_aleppo2_double_dead_s = "treeAleppoPine", + ad0_aleppo2_double_dead_xl = "treeAleppoPine", + ad0_aleppo2_double_light_l = "treeAleppoPine", + ad0_aleppo2_double_light_m = "treeAleppoPine", + ad0_aleppo2_double_light_s = "treeAleppoPine", + ad0_aleppo2_double_light_xl = "treeAleppoPine", + ad0_aleppo2_double_med_l = "treeAleppoPine", + ad0_aleppo2_double_med_m = "treeAleppoPine", + ad0_aleppo2_double_med_s = "treeAleppoPine", + ad0_aleppo2_double_med_xl = "treeAleppoPine", + ad0_aleppo2_sparse_dark_l = "treeAleppoPine", + ad0_aleppo2_sparse_dark_m = "treeAleppoPine", + ad0_aleppo2_sparse_dark_s = "treeAleppoPine", + ad0_aleppo2_sparse_dark_xl = "treeAleppoPine", + ad0_aleppo2_sparse_dead_l = "treeAleppoPine", + ad0_aleppo2_sparse_dead_m = "treeAleppoPine", + ad0_aleppo2_sparse_dead_s = "treeAleppoPine", + ad0_aleppo2_sparse_dead_xl = "treeAleppoPine", + ad0_aleppo2_sparse_light_l = "treeAleppoPine", + ad0_aleppo2_sparse_light_m = "treeAleppoPine", + ad0_aleppo2_sparse_light_s = "treeAleppoPine", + ad0_aleppo2_sparse_light_xl = "treeAleppoPine", + ad0_aleppo2_sparse_med_l = "treeAleppoPine", + ad0_aleppo2_sparse_med_m = "treeAleppoPine", + ad0_aleppo2_sparse_med_s = "treeAleppoPine", + ad0_aleppo2_sparse_med_xl = "treeAleppoPine", + ad0_pine_1_l = "treePine", + ad0_pine_1_m = "treePine", + ad0_pine_1_s = "treePine", + ad0_pine_1_xl = "treePine", + ad0_pine_1_xxl = "treePine", + ad0_pine_2_l = "treePine", + ad0_pine_2_m = "treePine", + ad0_pine_2_s = "treePine", + ad0_pine_2_xl = "treePine", + ad0_pine_2_xxl = "treePine", + ad0_pine_3_l = "treePine", + ad0_pine_3_m = "treePine", + ad0_pine_3_s = "treePine", + ad0_pine_3_xl = "treePine", + ad0_pine_3_xxl = "treePine", + prock1 = "ancientRocks", + prock2 = "ancientRocks", + prock3 = "ancientRocks", + prock4 = "ancientRocks", + prock5 = "ancientRocks", + pvolcanicrock1 = "ancientRocks", + pvolcanicrock2 = "ancientRocks", + pvolcanicrock3 = "ancientRocks", + pvolcanicrock4 = "ancientRocks", + pvolcanicrock5 = "ancientRocks", + ad0_baobab_0 = "treeBaobab", + ad0_baobab_1 = "treeBaobab", + ad0_baobab_2 = "treeBaobab", + ad0_baobab_3 = "treeBaobab", + ad0_baobab_4 = "treeBaobab", + ad0_bush_2_l = "bush", + ad0_bush_2_m = "bush", + ad0_bush_2_s = "bush", + ["ad0_bushes_l_1"] = "bushLarge", + ["ad0_bushes_l_2"] = "bushLarge", + ["ad0_bushes_l_3"] = "bushLarge", + ["ad0_bushes_l_4"] = "bushLarge", + ["ad0_bushes_l_5"] = "bushLarge", + ["ad0_bushes_l_6"] = "bushLarge", + ["ad0_bushes_l_7"] = "bushLarge", + ["ad0_bushes_l_8"] = "bushLarge", + ["ad0_bushes_xl_1"] = "bushLarger", + ad0_bushes_xl_2 = "bushLarger", + ad0_bushes_xl_3 = "bushLarger", + ad0_bushes_xl_4 = "bushLarger", + ad0_bushes_xl_5 = "bushLarger", + ad0_bushes_xl_6 = "bushLarger", + ad0_bushes_xl_7 = "bushLarger", + ad0_bushes_m_1 = "bushMedium", + ad0_bushes_m_2 = "bushMedium", + ad0_bushes_m_3 = "bushMedium", + ad0_bushes_m_4 = "bushMedium", + ad0_bushes_m_5 = "bushMedium", + ad0_bushes_m_6 = "bushMedium", + ad0_bushes_m_7 = "bushMedium", + ad0_bushes_s_1 = "bushSmall", + ad0_bushes_s_2 = "bushSmall", + ad0_bushes_s_3 = "bushSmall", + ad0_bushes_s_4 = "bushSmall", + ad0_bushes_s_5 = "bushSmall", + ad0_bushes_s_6 = "bushSmall", + ad0_bushes_s_7 = "bushSmall", + btreechi_3 = "treeCedar", + btreechi_4 = "treeCedar", + btreeclo_1 = "treeCedar", + btreeclo_2 = "treeCedar", + btreeclo_4 = "treeCedar", + crystalring = "metal", + map_metal_spot1 = "metal", + map_metal_spot2 = "metal", + map_metal_spot3 = "metal", + cluster1_dead = "treeDeadPalms", + cluster2_dead = "treeDeadPalms", + cluster3_dead = "treeDeadPalms", + artbirchbighi = "treeDeciduous", + artbirchmediumhi = "treeDeciduous", + artbircholdhi = "treeDeciduous", + artbirchsmallhi = "treeDeciduous", + artbirchwinterhi = "treeDeciduous", + artbush1hi = "treeDeciduous", + artbush2hi = "treeDeciduous", + artbush3hi = "treeDeciduous", + artbushweird1hi = "treeDeciduous", + artbushweird2hi = "treeDeciduous", + artmaplebasichi = "treeDeciduous", + artmaplebighi = "treeDeciduous", + artmapleoldhi = "treeDeciduous", + artmapletallhi = "treeDeciduous", + artmaplevarhi = "treeDeciduous", + artmaplewinterhi = "treeDeciduous", + artmapleyounghi = "treeDeciduous", + artoakbasichi = "treeDeciduous", + artoakbasicvarhi = "treeDeciduous", + artoakbighi = "treeDeciduous", + artoakgrandhi = "treeDeciduous", + artoakoldhi = "treeDeciduous", + artoaktallhi = "treeDeciduous", + artoakyounghi = "treeDeciduous", + ["btreea-1"] = "treeDeciduous", + ["btreea-2"] = "treeDeciduous", + ["btreea-3"] = "treeDeciduous", + ["btreea-4"] = "treeDeciduous", + ["btreea-5"] = "treeDeciduous", + ["btreebhi-1"] = "treeDeciduous", + ["btreebhi-2"] = "treeDeciduous", + ["btreebhi-3"] = "treeDeciduous", + ["btreebhi-4"] = "treeDeciduous", + ["btreebhi-5"] = "treeDeciduous", + ["btreeblo-1"] = "treeDeciduous", + ["btreeblo-2"] = "treeDeciduous", + ["btreeblo-3"] = "treeDeciduous", + ["btreeblo-4"] = "treeDeciduous", + ["btreeblo-5"] = "treeDeciduous", + ["btreechi-1"] = "treeDeciduous", + ["btreechi-2"] = "treeDeciduous", + ["btreechi-3"] = "treeDeciduous", + ["btreechi-4"] = "treeDeciduous", + ["btreechi-5"] = "treeDeciduous", + ["btreeclo-1"] = "treeDeciduous", + ["btreeclo-2"] = "treeDeciduous", + ["btreeclo-3"] = "treeDeciduous", + ["btreeclo-4"] = "treeDeciduous", + ["btreeclo-5"] = "treeDeciduous", + eistatue1 = "statueEasterIsland", + eistatue2 = "statueEasterIsland", + eistatue3 = "statueEasterIsland", + eistatue4 = "statueEasterIsland", + eistatue5 = "statueEasterIsland", + eistatue6 = "statueEasterIsland", + eistatue7 = "statueEasterIsland", + eistatue8 = "statueEasterIsland", + eistatuecl1 = "statueEasterIsland", + eistatuecl2 = "statueEasterIsland", + espire1 = "energySpire", + espire2 = "energySpire", + espire3 = "energySpire", + espire4 = "energySpire", + espire5 = "energySpire", + cycas2 = "fern", + fern_sword = "fern", + fern2 = "fern", + cycas6 = "fernsStone", + cycas8 = "fernsStone", + fern6 = "fernStone", + fern8 = "fernStone", + cycas1 = "fernStones", + fern1 = "fernStones", + cycas3 = "ferns", + cycas4 = "ferns", + cycas5 = "ferns", + cycas7 = "ferns", + fern3 = "ferns", + fern4 = "ferns", + fern5 = "ferns", + fern7 = "ferns", + fir_tree_small_1__tree_fir_tall_1 = "treeFir", + fir_tree_small_1__tree_fir_tall_2 = "treeFir", + fir_tree_small_1__tree_fir_tall_3 = "treeFir", + fir_tree_small_1__tree_fir_tall_4 = "treeFir", + fir_tree_small_1__tree_fir_tall_5 = "treeFir", + fir_tree_small_2__tree_fir_tall_1 = "treeFir", + fir_tree_small_2__tree_fir_tall_2 = "treeFir", + fir_tree_small_2__tree_fir_tall_3 = "treeFir", + fir_tree_small_2__tree_fir_tall_4 = "treeFir", + fir_tree_small_2__tree_fir_tall_5 = "treeFir", + fir_tree_small_3__tree_fir_tall_1 = "treeFir", + fir_tree_small_3__tree_fir_tall_2 = "treeFir", + fir_tree_small_3__tree_fir_tall_3 = "treeFir", + fir_tree_small_3__tree_fir_tall_4 = "treeFir", + fir_tree_small_3__tree_fir_tall_5 = "treeFir", + fir_tree_tall_1__tree_fir_tall_1 = "treeFir", + fir_tree_tall_1__tree_fir_tall_2 = "treeFir", + fir_tree_tall_1__tree_fir_tall_3 = "treeFir", + fir_tree_tall_1__tree_fir_tall_4 = "treeFir", + fir_tree_tall_1__tree_fir_tall_5 = "treeFir", + fir_tree_tall_2__tree_fir_tall_1 = "treeFir", + fir_tree_tall_2__tree_fir_tall_2 = "treeFir", + fir_tree_tall_2__tree_fir_tall_3 = "treeFir", + fir_tree_tall_2__tree_fir_tall_4 = "treeFir", + fir_tree_tall_2__tree_fir_tall_5 = "treeFir", + fir_tree_tall_3__tree_fir_tall_1 = "treeFir", + fir_tree_tall_3__tree_fir_tall_2 = "treeFir", + fir_tree_tall_3__tree_fir_tall_3 = "treeFir", + fir_tree_tall_3__tree_fir_tall_4 = "treeFir", + fir_tree_tall_3__tree_fir_tall_5 = "treeFir", + fir_tree_tall_4__tree_fir_tall_1 = "treeFir", + fir_tree_tall_4__tree_fir_tall_2 = "treeFir", + fir_tree_tall_4__tree_fir_tall_3 = "treeFir", + fir_tree_tall_4__tree_fir_tall_4 = "treeFir", + fir_tree_tall_4__tree_fir_tall_5 = "treeFir", + fir_tree_tall_5__tree_fir_tall_1 = "treeFir", + fir_tree_tall_5__tree_fir_tall_2 = "treeFir", + fir_tree_tall_5__tree_fir_tall_3 = "treeFir", + fir_tree_tall_5__tree_fir_tall_4 = "treeFir", + fir_tree_tall_5__tree_fir_tall_5 = "treeFir", + fir_tree_tall_6__tree_fir_tall_1 = "treeFir", + fir_tree_tall_6__tree_fir_tall_2 = "treeFir", + fir_tree_tall_6__tree_fir_tall_3 = "treeFir", + fir_tree_tall_6__tree_fir_tall_4 = "treeFir", + fir_tree_tall_6__tree_fir_tall_5 = "treeFir", + fir_tree_tall_7__tree_fir_tall_1 = "treeFir", + fir_tree_tall_7__tree_fir_tall_2 = "treeFir", + fir_tree_tall_7__tree_fir_tall_3 = "treeFir", + fir_tree_tall_7__tree_fir_tall_4 = "treeFir", + fir_tree_tall_7__tree_fir_tall_5 = "treeFir", + fir_tree_tall_8__tree_fir_tall_1 = "treeFir", + fir_tree_tall_8__tree_fir_tall_2 = "treeFir", + fir_tree_tall_8__tree_fir_tall_3 = "treeFir", + fir_tree_tall_8__tree_fir_tall_4 = "treeFir", + fir_tree_tall_8__tree_fir_tall_5 = "treeFir", + ad0_senegal_1 = "treePalm", + ad0_senegal_1_large = "treePalm", + ad0_senegal_2 = "treePalm", + ad0_senegal_2_large = "treePalm", + ad0_senegal_3 = "treePalm", + ad0_senegal_3_large = "treePalm", + ad0_senegal_4 = "treePalm", + ad0_senegal_4_large = "treePalm", + ad0_senegal_5 = "treePalm", + ad0_senegal_5_large = "treePalm", + ad0_senegal_6 = "treePalm", + ad0_senegal_6_large = "treePalm", + ad0_senegal_7 = "treePalm", + ad0_senegal_7_large = "treePalm", + cluster1 = "treePalms", + cluster2 = "treePalms", + cluster3 = "treePalms", + treecluster1 = "treePalms", + treecluster2 = "treePalms", + treecluster3 = "treePalms", + palmetto_1 = "treePalmetto", + palmetto_2 = "treePalmetto", + palmetto_3 = "treePalmetto", + peyote1 = "peyote", + peyote2 = "peyote", + peyote3 = "peyote", + peyote4 = "peyote", + allpinesb_ad0_brown_a_l = "treePine", + allpinesb_ad0_brown_a_l_lod1 = "treePine", + allpinesb_ad0_brown_a_m = "treePine", + allpinesb_ad0_brown_a_m_lod1 = "treePine", + allpinesb_ad0_brown_a_s = "treePine", + allpinesb_ad0_brown_a_s_lod1 = "treePine", + allpinesb_ad0_brown_a_xl = "treePine", + allpinesb_ad0_brown_a_xl_lod1 = "treePine", + allpinesb_ad0_brown_a_xs = "treePine", + allpinesb_ad0_brown_a_xxl = "treePine", + allpinesb_ad0_brown_a_xxl_lod1 = "treePine", + allpinesb_ad0_brown_b_l = "treePine", + allpinesb_ad0_brown_b_l_lod1 = "treePine", + allpinesb_ad0_brown_b_m = "treePine", + allpinesb_ad0_brown_b_m_lod1 = "treePine", + allpinesb_ad0_brown_b_s = "treePine", + allpinesb_ad0_brown_b_s_lod1 = "treePine", + allpinesb_ad0_brown_b_xl = "treePine", + allpinesb_ad0_brown_b_xl_lod1 = "treePine", + allpinesb_ad0_brown_b_xs = "treePine", + allpinesb_ad0_brown_b_xxl = "treePine", + allpinesb_ad0_brown_b_xxl_lod1 = "treePine", + allpinesb_ad0_brown_c_l = "treePine", + allpinesb_ad0_brown_c_l_lod1 = "treePine", + allpinesb_ad0_brown_c_m = "treePine", + allpinesb_ad0_brown_c_m_lod1 = "treePine", + allpinesb_ad0_brown_c_s = "treePine", + allpinesb_ad0_brown_c_s_lod1 = "treePine", + allpinesb_ad0_brown_c_xl = "treePine", + allpinesb_ad0_brown_c_xl_lod1 = "treePine", + allpinesb_ad0_brown_c_xs = "treePine", + allpinesb_ad0_brown_c_xxl = "treePine", + allpinesb_ad0_brown_c_xxl_lod1 = "treePine", + allpinesb_ad0_green_a_l = "treePine", + allpinesb_ad0_green_a_l_lod1 = "treePine", + allpinesb_ad0_green_a_m = "treePine", + allpinesb_ad0_green_a_m_lod1 = "treePine", + allpinesb_ad0_green_a_s = "treePine", + allpinesb_ad0_green_a_s_lod1 = "treePine", + allpinesb_ad0_green_a_xl = "treePine", + allpinesb_ad0_green_a_xl_lod1 = "treePine", + allpinesb_ad0_green_a_xs = "treePine", + allpinesb_ad0_green_a_xxl = "treePine", + allpinesb_ad0_green_a_xxl_lod1 = "treePine", + allpinesb_ad0_green_b_l = "treePine", + allpinesb_ad0_green_b_l_lod1 = "treePine", + allpinesb_ad0_green_b_m = "treePine", + allpinesb_ad0_green_b_m_lod1 = "treePine", + allpinesb_ad0_green_b_s = "treePine", + allpinesb_ad0_green_b_s_lod1 = "treePine", + allpinesb_ad0_green_b_xl = "treePine", + allpinesb_ad0_green_b_xl_lod1 = "treePine", + allpinesb_ad0_green_b_xs = "treePine", + allpinesb_ad0_green_b_xxl = "treePine", + allpinesb_ad0_green_b_xxl_lod1 = "treePine", + allpinesb_ad0_green_c_l = "treePine", + allpinesb_ad0_green_c_l_lod1 = "treePine", + allpinesb_ad0_green_c_m = "treePine", + allpinesb_ad0_green_c_m_lod1 = "treePine", + allpinesb_ad0_green_c_s = "treePine", + allpinesb_ad0_green_c_s_lod1 = "treePine", + allpinesb_ad0_green_c_xl = "treePine", + allpinesb_ad0_green_c_xl_lod1 = "treePine", + allpinesb_ad0_green_c_xs = "treePine", + allpinesb_ad0_green_c_xxl = "treePine", + allpinesb_ad0_green_c_xxl_lod1 = "treePine", + allpinesb_ad0_snow_a_l = "treePine", + allpinesb_ad0_snow_a_l_lod1 = "treePine", + allpinesb_ad0_snow_a_m = "treePine", + allpinesb_ad0_snow_a_m_lod1 = "treePine", + allpinesb_ad0_snow_a_s = "treePine", + allpinesb_ad0_snow_a_s_lod1 = "treePine", + allpinesb_ad0_snow_a_xl = "treePine", + allpinesb_ad0_snow_a_xl_lod1 = "treePine", + allpinesb_ad0_snow_a_xs = "treePine", + allpinesb_ad0_snow_a_xxl = "treePine", + allpinesb_ad0_snow_a_xxl_lod1 = "treePine", + allpinesb_ad0_snow_b_l = "treePine", + allpinesb_ad0_snow_b_l_lod1 = "treePine", + allpinesb_ad0_snow_b_m = "treePine", + allpinesb_ad0_snow_b_m_lod1 = "treePine", + allpinesb_ad0_snow_b_s = "treePine", + allpinesb_ad0_snow_b_s_lod1 = "treePine", + allpinesb_ad0_snow_b_xl = "treePine", + allpinesb_ad0_snow_b_xl_lod1 = "treePine", + allpinesb_ad0_snow_b_xs = "treePine", + allpinesb_ad0_snow_b_xxl = "treePine", + allpinesb_ad0_snow_b_xxl_lod1 = "treePine", + allpinesb_ad0_snow_c_l = "treePine", + allpinesb_ad0_snow_c_l_lod1 = "treePine", + allpinesb_ad0_snow_c_m = "treePine", + allpinesb_ad0_snow_c_m_lod1 = "treePine", + allpinesb_ad0_snow_c_s = "treePine", + allpinesb_ad0_snow_c_s_lod1 = "treePine", + allpinesb_ad0_snow_c_xl = "treePine", + allpinesb_ad0_snow_c_xl_lod1 = "treePine", + allpinesb_ad0_snow_c_xs = "treePine", + allpinesb_ad0_snow_c_xxl = "treePine", + allpinesb_ad0_snow_c_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_l = "treePine", + allpinesb_ad0_snowgreen_a_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_m = "treePine", + allpinesb_ad0_snowgreen_a_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_s = "treePine", + allpinesb_ad0_snowgreen_a_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_xl = "treePine", + allpinesb_ad0_snowgreen_a_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_xs = "treePine", + allpinesb_ad0_snowgreen_a_xxl = "treePine", + allpinesb_ad0_snowgreen_a_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_l = "treePine", + allpinesb_ad0_snowgreen_b_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_m = "treePine", + allpinesb_ad0_snowgreen_b_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_s = "treePine", + allpinesb_ad0_snowgreen_b_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_xl = "treePine", + allpinesb_ad0_snowgreen_b_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_xs = "treePine", + allpinesb_ad0_snowgreen_b_xxl = "treePine", + allpinesb_ad0_snowgreen_b_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_l = "treePine", + allpinesb_ad0_snowgreen_c_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_m = "treePine", + allpinesb_ad0_snowgreen_c_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_s = "treePine", + allpinesb_ad0_snowgreen_c_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_xl = "treePine", + allpinesb_ad0_snowgreen_c_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_xs = "treePine", + allpinesb_ad0_snowgreen_c_xxl = "treePine", + allpinesb_ad0_snowgreen_c_xxl_lod1 = "treePine", + lowpoly_tree_pinetree1large = "treePine", + lowpoly_tree_pinetree1largeburnt = "treePine", + lowpoly_tree_pinetree1medium = "treePine", + lowpoly_tree_pinetree1mediumburnt = "treePine", + lowpoly_tree_pinetree1small = "treePine", + lowpoly_tree_pinetree1smallburnt = "treePine", + lowpoly_tree_pinetree1tiny = "treePine", + lowpoly_tree_pinetree1tinyburnt = "treePine", + lowpoly_tree_pinetree2large = "treePine", + lowpoly_tree_pinetree2largeburnt = "treePine", + lowpoly_tree_pinetree2medium = "treePine", + lowpoly_tree_pinetree2mediumburnt = "treePine", + lowpoly_tree_pinetree2small = "treePine", + lowpoly_tree_pinetree2smallburnt = "treePine", + lowpoly_tree_pinetree2tiny = "treePine", + lowpoly_tree_pinetree2tinyburnt = "treePine", + lowpoly_tree_pinetree3large = "treePine", + lowpoly_tree_pinetree3largeburnt = "treePine", + lowpoly_tree_pinetree3medium = "treePine", + lowpoly_tree_pinetree3mediumburnt = "treePine", + lowpoly_tree_pinetree3small = "treePine", + lowpoly_tree_pinetree3smallburnt = "treePine", + lowpoly_tree_pinetree3tiny = "treePine", + lowpoly_tree_pinetree3tinyburnt = "treePine", + lowpoly_tree_snowypinetree1large = "treePine", + lowpoly_tree_snowypinetree1medium = "treePine", + lowpoly_tree_snowypinetree1small = "treePine", + lowpoly_tree_snowypinetree1tiny = "treePine", + lowpoly_tree_snowypinetree2large = "treePine", + lowpoly_tree_snowypinetree2medium = "treePine", + lowpoly_tree_snowypinetree2small = "treePine", + lowpoly_tree_snowypinetree2tiny = "treePine", + lowpoly_tree_snowypinetree3large = "treePine", + lowpoly_tree_snowypinetree3medium = "treePine", + lowpoly_tree_snowypinetree3small = "treePine", + lowpoly_tree_snowypinetree3tiny = "treePine", + pipe_large_1 = "pipeline", + pipe_large_2 = "pipeline", + pipe_long_1 = "pipeline", + pipe_long_2 = "pipeline", + pipe_really_tall_2 = "pipeline", + pipe_small_1 = "pipeline", + pipe_small_2 = "pipeline", + pipe_tall_1 = "pipeline", + pipe_tall_2 = "pipeline", + agorm_rock1 = "rock", + agorm_rock2 = "rock", + agorm_rock3 = "rock", + agorm_rock4 = "rock", + agorm_rock5 = "rock", + agorm_rock6 = "rock", + brock_1 = "rock", + brock_10 = "rock", + brock_2 = "rock", + brock_3 = "rock", + brock_4 = "rock", + brock_5 = "rock", + brock_6 = "rock", + brock_7 = "rock", + brock_8 = "rock", + brock_9 = "rock", + moonrock1 = "rock", + moonrock2 = "rock", + moonrock3 = "rock", + moonrock4 = "rock", + moonrock5 = "rock", + pdrock1 = "rock", + pdrock2 = "rock", + pdrock3 = "rock", + pdrock4 = "rock", + pdrock5 = "rock", + pdrock6 = "rock", + pdrock7 = "rock", + pdrock8 = "rock", + pdrock1a = "rock", + pdrock2a = "rock", + pdrock3a = "rock", + pdrock4a = "rock", + rock1 = "rock", + rock2 = "rock", + rock3 = "rock", + rock4 = "rock", + rocksoar1 = "rock", + rocksoar2 = "rock", + rocksoar3 = "rock", + rocksoar4 = "rock", + rocksoar5 = "rock", + rocksoar6 = "rock", + pedro1 = "cactusSanPedro", + pedro2 = "cactusSanPedro", + pedro3 = "cactusSanPedro", + pedro4 = "cactusSanPedro", + pedro5 = "cactusSanPedro", + pedro6 = "cactusSanPedro", + tiberium01 = "crystalSapphire", + tiberium03 = "crystalSapphire", + tiberium06 = "crystalSapphire", + tiberium09 = "crystalSapphire", + mushroom01 = "mushroomsOrange", + mushroom02 = "mushroomsOrange", + mushroom03 = "mushroomsOrange", + mushroom04 = "mushroomsOrange", + mushroom05 = "mushroomsOrange", + mushroom06 = "mushroomsOrange", + mushroom07 = "mushroomsOrange", + mushroom08 = "mushroomsOrange", + mushroom09 = "mushroomsOrange", + mushroom10 = "mushroomsOrange", + mushroom11 = "mushroomsPurple", + mushroom12 = "mushroomsPurple", + mushroom13 = "mushroomsPurple", + mushroom14 = "mushroomsPurple", + mushroom15 = "mushroomsPurple", + mushroom16 = "mushroomsPurple", + mushroom17 = "mushroomsPurple", + mushroom18 = "mushroomsPurple", + mushroom19 = "mushroomsPurple", + mushroom20 = "mushroomsPurple", + mushroom21 = "mushroomsTan", + mushroom22 = "mushroomsTan", + mushroom23 = "mushroomsTan", + mushroom24 = "mushroomsTan", + mushroom25 = "mushroomsTan", + mushroom26 = "mushroomsTan", + mushroom27 = "mushroomsTan", + mushroom28 = "mushroomsTan", + mushroom29 = "mushroomsTan", + mushroom30 = "mushroomsTan", + cedar_atlas_1__cedar_atlas_1 = "treeCedar", + cedar_atlas_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_1__cedar_atlas_dead = "treeCedar", + cedar_atlas_2__cedar_atlas_1 = "treeCedar", + cedar_atlas_2__cedar_atlas_2 = "treeCedar", + cedar_atlas_2__cedar_atlas_dead = "treeCedar", + cedar_atlas_3__cedar_atlas_1 = "treeCedar", + cedar_atlas_3__cedar_atlas_2 = "treeCedar", + cedar_atlas_3__cedar_atlas_dead = "treeCedar", + cedar_atlas_sapling_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_1__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_2__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_2__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_3__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_3__cedar_atlas_2 = "treeCedar", + fir_sapling_1__cedar_atlas_2 = "treeFir", + fir_sapling_2__cedar_atlas_2 = "treeFir", + slrock1 = "rock", + slrock2 = "rock", + slrock3 = "rock", + slrock4 = "rock", + treetype0 = "tree", + treetype1 = "tree", + treetype2 = "tree", + treetype3 = "tree", + treetype4 = "tree", + treetype5 = "tree", + treetype6 = "tree", + treetype7 = "tree", + treetype8 = "tree", + treetype9 = "tree", + treetype10 = "tree", + treetype11 = "tree", + treetype12 = "tree", + treetype13 = "tree", + treetype14 = "tree", + treetype15 = "tree", talltree1 = "tree", talltree2 = "tree", talltree3 = "tree", talltree4 = "tree", talltree5 = "tree", talltree6 = "tree", - hclus1 = 'treePalms', - hclus2 = 'treePalms', - hclus3 = 'treePalms', - hpalm1 = 'treePalms', - hpalm2 = 'treePalm', - hpalm3 = 'treePalm', - hpalm4 = 'treePalm', - smothdist = 'powerhouse', - smothdist2 = 'powerhouse', - pilha_crystal1 = 'crystalSmall', - pilha_crystal2 = 'crystalMedium', - pilha_crystal3 = 'crystalLarge', - pilha_crystal_blue1 = 'crystalSmall', - pilha_crystal_blue2 = 'crystalMedium', - pilha_crystal_blue3 = 'crystalLarge', - pilha_crystal_green1 = 'crystalSmall', - pilha_crystal_green2 = 'crystalMedium', - pilha_crystal_green3 = 'crystalLarge', - pilha_crystal_lime1 = 'crystalSmall', - pilha_crystal_lime2 = 'crystalMedium', - pilha_crystal_lime3 = 'crystalLarge', - pilha_crystal_obsidian1 = 'crystalSmall', - pilha_crystal_obsidian2 = 'crystalMedium', - pilha_crystal_obsidian3 = 'crystalLarge', - pilha_crystal_orange1 = 'crystalSmall', - pilha_crystal_orange2 = 'crystalMedium', - pilha_crystal_orange3 = 'crystalLarge', - pilha_crystal_quartz1 = 'crystalSmall', - pilha_crystal_quartz2 = 'crystalMedium', - pilha_crystal_quartz3 = 'crystalLarge', - pilha_crystal_red1 = 'crystalSmall', - pilha_crystal_red2 = 'crystalMedium', - pilha_crystal_red3 = 'crystalLarge', - pilha_crystal_teal1 = 'crystalSmall', - pilha_crystal_teal2 = 'crystalMedium', - pilha_crystal_teal3 = 'crystalLarge', - pilha_crystal_team1 = 'crystalSmall', - pilha_crystal_team2 = 'crystalMedium', - pilha_crystal_team3 = 'crystalLarge', - pilha_crystal_violet1 = 'crystalSmall', - pilha_crystal_violet2 = 'crystalMedium', - pilha_crystal_violet3 = 'crystalLarge', - rocks30_map_01 = 'rock', - rocks30_map_02 = 'rock', - rocks30_map_03 = 'rock', - rocks30_map_04 = 'rock', - rocks30_map_05 = 'rock', - rocks30_map_06 = 'rock', - rocks30_map_07 = 'rock', - rocks30_map_08 = 'rock', - rocks30_map_09 = 'rock', - rocks30_map_10 = 'rock', - rocks30_map_11 = 'rock', - rocks30_map_12 = 'rock', - rocks30_map_13 = 'rock', - rocks30_map_14 = 'rock', - rocks30_map_15 = 'rock', - rocks30_map_16 = 'rock', - rocks30_map_17 = 'rock', - rocks30_map_18 = 'rock', - rocks30_map_19 = 'rock', - rocks30_map_20 = 'rock', - rocks30_map_21 = 'rock', - rocks30_map_22 = 'rock', - rocks30_map_23 = 'rock', - rocks30_map_24 = 'rock', - rocks30_map_25 = 'rock', - rocks30_map_26 = 'rock', - rocks30_map_27 = 'rock', - rocks30_map_28 = 'rock', - rocks30_map_29 = 'rock', - rocks30_map_30 = 'rock', - rocks30_def_01 = 'rock', - rocks30_def_02 = 'rock', - rocks30_def_03 = 'rock', - rocks30_def_04 = 'rock', - rocks30_def_05 = 'rock', - rocks30_def_06 = 'rock', - rocks30_def_07 = 'rock', - rocks30_def_08 = 'rock', - rocks30_def_09 = 'rock', - rocks30_def_10 = 'rock', - rocks30_def_11 = 'rock', - rocks30_def_12 = 'rock', - rocks30_def_13 = 'rock', - rocks30_def_14 = 'rock', - rocks30_def_15 = 'rock', - rocks30_def_16 = 'rock', - rocks30_def_17 = 'rock', - rocks30_def_18 = 'rock', - rocks30_def_19 = 'rock', - rocks30_def_20 = 'rock', - rocks30_def_21 = 'rock', - rocks30_def_22 = 'rock', - rocks30_def_23 = 'rock', - rocks30_def_24 = 'rock', - rocks30_def_25 = 'rock', - rocks30_def_26 = 'rock', - rocks30_def_27 = 'rock', - rocks30_def_28 = 'rock', - rocks30_def_29 = 'rock', - rocks30_def_30 = 'rock', - rocks30_desert_01 = 'rockBarren', - rocks30_desert_02 = 'rockBarren', - rocks30_desert_03 = 'rockBarren', - rocks30_desert_04 = 'rockBarren', - rocks30_desert_05 = 'rockBarren', - rocks30_desert_06 = 'rockBarren', - rocks30_desert_07 = 'rockBarren', - rocks30_desert_08 = 'rockBarren', - rocks30_desert_09 = 'rockBarren', - rocks30_desert_10 = 'rockBarren', - rocks30_desert_11 = 'rockBarren', - rocks30_desert_12 = 'rockBarren', - rocks30_desert_13 = 'rockBarren', - rocks30_desert_14 = 'rockBarren', - rocks30_desert_15 = 'rockBarren', - rocks30_desert_16 = 'rockBarren', - rocks30_desert_17 = 'rockBarren', - rocks30_desert_18 = 'rockBarren', - rocks30_desert_19 = 'rockBarren', - rocks30_desert_20 = 'rockBarren', - rocks30_desert_21 = 'rockBarren', - rocks30_desert_22 = 'rockBarren', - rocks30_desert_23 = 'rockBarren', - rocks30_desert_24 = 'rockBarren', - rocks30_desert_25 = 'rockBarren', - rocks30_desert_26 = 'rockBarren', - rocks30_desert_27 = 'rockBarren', - rocks30_desert_28 = 'rockBarren', - rocks30_desert_29 = 'rockBarren', - rocks30_desert_30 = 'rockBarren', - rocks30_moss_01 = 'rockMossy', - rocks30_moss_02 = 'rockMossy', - rocks30_moss_03 = 'rockMossy', - rocks30_moss_04 = 'rockMossy', - rocks30_moss_05 = 'rockMossy', - rocks30_moss_06 = 'rockMossy', - rocks30_moss_07 = 'rockMossy', - rocks30_moss_08 = 'rockMossy', - rocks30_moss_09 = 'rockMossy', - rocks30_moss_10 = 'rockMossy', - rocks30_moss_11 = 'rockMossy', - rocks30_moss_12 = 'rockMossy', - rocks30_moss_13 = 'rockMossy', - rocks30_moss_14 = 'rockMossy', - rocks30_moss_15 = 'rockMossy', - rocks30_moss_16 = 'rockMossy', - rocks30_moss_17 = 'rockMossy', - rocks30_moss_18 = 'rockMossy', - rocks30_moss_19 = 'rockMossy', - rocks30_moss_20 = 'rockMossy', - rocks30_moss_21 = 'rockMossy', - rocks30_moss_22 = 'rockMossy', - rocks30_moss_23 = 'rockMossy', - rocks30_moss_24 = 'rockMossy', - rocks30_moss_25 = 'rockMossy', - rocks30_moss_26 = 'rockMossy', - rocks30_moss_27 = 'rockMossy', - rocks30_moss_28 = 'rockMossy', - rocks30_moss_29 = 'rockMossy', - rocks30_moss_30 = 'rockMossy', - rocks30_snow_01 = 'rockSnowy', - rocks30_snow_02 = 'rockSnowy', - rocks30_snow_03 = 'rockSnowy', - rocks30_snow_04 = 'rockSnowy', - rocks30_snow_05 = 'rockSnowy', - rocks30_snow_06 = 'rockSnowy', - rocks30_snow_07 = 'rockSnowy', - rocks30_snow_08 = 'rockSnowy', - rocks30_snow_09 = 'rockSnowy', - rocks30_snow_10 = 'rockSnowy', - rocks30_snow_11 = 'rockSnowy', - rocks30_snow_12 = 'rockSnowy', - rocks30_snow_13 = 'rockSnowy', - rocks30_snow_14 = 'rockSnowy', - rocks30_snow_15 = 'rockSnowy', - rocks30_snow_16 = 'rockSnowy', - rocks30_snow_17 = 'rockSnowy', - rocks30_snow_18 = 'rockSnowy', - rocks30_snow_19 = 'rockSnowy', - rocks30_snow_20 = 'rockSnowy', - rocks30_snow_21 = 'rockSnowy', - rocks30_snow_22 = 'rockSnowy', - rocks30_snow_23 = 'rockSnowy', - rocks30_snow_24 = 'rockSnowy', - rocks30_snow_25 = 'rockSnowy', - rocks30_snow_26 = 'rockSnowy', - rocks30_snow_27 = 'rockSnowy', - rocks30_snow_28 = 'rockSnowy', - rocks30_snow_29 = 'rockSnowy', - rocks30_snow_30 = 'rockSnowy', -} \ No newline at end of file + hclus1 = "treePalms", + hclus2 = "treePalms", + hclus3 = "treePalms", + hpalm1 = "treePalms", + hpalm2 = "treePalm", + hpalm3 = "treePalm", + hpalm4 = "treePalm", + smothdist = "powerhouse", + smothdist2 = "powerhouse", + pilha_crystal1 = "crystalSmall", + pilha_crystal2 = "crystalMedium", + pilha_crystal3 = "crystalLarge", + pilha_crystal_blue1 = "crystalSmall", + pilha_crystal_blue2 = "crystalMedium", + pilha_crystal_blue3 = "crystalLarge", + pilha_crystal_green1 = "crystalSmall", + pilha_crystal_green2 = "crystalMedium", + pilha_crystal_green3 = "crystalLarge", + pilha_crystal_lime1 = "crystalSmall", + pilha_crystal_lime2 = "crystalMedium", + pilha_crystal_lime3 = "crystalLarge", + pilha_crystal_obsidian1 = "crystalSmall", + pilha_crystal_obsidian2 = "crystalMedium", + pilha_crystal_obsidian3 = "crystalLarge", + pilha_crystal_orange1 = "crystalSmall", + pilha_crystal_orange2 = "crystalMedium", + pilha_crystal_orange3 = "crystalLarge", + pilha_crystal_quartz1 = "crystalSmall", + pilha_crystal_quartz2 = "crystalMedium", + pilha_crystal_quartz3 = "crystalLarge", + pilha_crystal_red1 = "crystalSmall", + pilha_crystal_red2 = "crystalMedium", + pilha_crystal_red3 = "crystalLarge", + pilha_crystal_teal1 = "crystalSmall", + pilha_crystal_teal2 = "crystalMedium", + pilha_crystal_teal3 = "crystalLarge", + pilha_crystal_team1 = "crystalSmall", + pilha_crystal_team2 = "crystalMedium", + pilha_crystal_team3 = "crystalLarge", + pilha_crystal_violet1 = "crystalSmall", + pilha_crystal_violet2 = "crystalMedium", + pilha_crystal_violet3 = "crystalLarge", + rocks30_map_01 = "rock", + rocks30_map_02 = "rock", + rocks30_map_03 = "rock", + rocks30_map_04 = "rock", + rocks30_map_05 = "rock", + rocks30_map_06 = "rock", + rocks30_map_07 = "rock", + rocks30_map_08 = "rock", + rocks30_map_09 = "rock", + rocks30_map_10 = "rock", + rocks30_map_11 = "rock", + rocks30_map_12 = "rock", + rocks30_map_13 = "rock", + rocks30_map_14 = "rock", + rocks30_map_15 = "rock", + rocks30_map_16 = "rock", + rocks30_map_17 = "rock", + rocks30_map_18 = "rock", + rocks30_map_19 = "rock", + rocks30_map_20 = "rock", + rocks30_map_21 = "rock", + rocks30_map_22 = "rock", + rocks30_map_23 = "rock", + rocks30_map_24 = "rock", + rocks30_map_25 = "rock", + rocks30_map_26 = "rock", + rocks30_map_27 = "rock", + rocks30_map_28 = "rock", + rocks30_map_29 = "rock", + rocks30_map_30 = "rock", + rocks30_def_01 = "rock", + rocks30_def_02 = "rock", + rocks30_def_03 = "rock", + rocks30_def_04 = "rock", + rocks30_def_05 = "rock", + rocks30_def_06 = "rock", + rocks30_def_07 = "rock", + rocks30_def_08 = "rock", + rocks30_def_09 = "rock", + rocks30_def_10 = "rock", + rocks30_def_11 = "rock", + rocks30_def_12 = "rock", + rocks30_def_13 = "rock", + rocks30_def_14 = "rock", + rocks30_def_15 = "rock", + rocks30_def_16 = "rock", + rocks30_def_17 = "rock", + rocks30_def_18 = "rock", + rocks30_def_19 = "rock", + rocks30_def_20 = "rock", + rocks30_def_21 = "rock", + rocks30_def_22 = "rock", + rocks30_def_23 = "rock", + rocks30_def_24 = "rock", + rocks30_def_25 = "rock", + rocks30_def_26 = "rock", + rocks30_def_27 = "rock", + rocks30_def_28 = "rock", + rocks30_def_29 = "rock", + rocks30_def_30 = "rock", + rocks30_desert_01 = "rockBarren", + rocks30_desert_02 = "rockBarren", + rocks30_desert_03 = "rockBarren", + rocks30_desert_04 = "rockBarren", + rocks30_desert_05 = "rockBarren", + rocks30_desert_06 = "rockBarren", + rocks30_desert_07 = "rockBarren", + rocks30_desert_08 = "rockBarren", + rocks30_desert_09 = "rockBarren", + rocks30_desert_10 = "rockBarren", + rocks30_desert_11 = "rockBarren", + rocks30_desert_12 = "rockBarren", + rocks30_desert_13 = "rockBarren", + rocks30_desert_14 = "rockBarren", + rocks30_desert_15 = "rockBarren", + rocks30_desert_16 = "rockBarren", + rocks30_desert_17 = "rockBarren", + rocks30_desert_18 = "rockBarren", + rocks30_desert_19 = "rockBarren", + rocks30_desert_20 = "rockBarren", + rocks30_desert_21 = "rockBarren", + rocks30_desert_22 = "rockBarren", + rocks30_desert_23 = "rockBarren", + rocks30_desert_24 = "rockBarren", + rocks30_desert_25 = "rockBarren", + rocks30_desert_26 = "rockBarren", + rocks30_desert_27 = "rockBarren", + rocks30_desert_28 = "rockBarren", + rocks30_desert_29 = "rockBarren", + rocks30_desert_30 = "rockBarren", + rocks30_moss_01 = "rockMossy", + rocks30_moss_02 = "rockMossy", + rocks30_moss_03 = "rockMossy", + rocks30_moss_04 = "rockMossy", + rocks30_moss_05 = "rockMossy", + rocks30_moss_06 = "rockMossy", + rocks30_moss_07 = "rockMossy", + rocks30_moss_08 = "rockMossy", + rocks30_moss_09 = "rockMossy", + rocks30_moss_10 = "rockMossy", + rocks30_moss_11 = "rockMossy", + rocks30_moss_12 = "rockMossy", + rocks30_moss_13 = "rockMossy", + rocks30_moss_14 = "rockMossy", + rocks30_moss_15 = "rockMossy", + rocks30_moss_16 = "rockMossy", + rocks30_moss_17 = "rockMossy", + rocks30_moss_18 = "rockMossy", + rocks30_moss_19 = "rockMossy", + rocks30_moss_20 = "rockMossy", + rocks30_moss_21 = "rockMossy", + rocks30_moss_22 = "rockMossy", + rocks30_moss_23 = "rockMossy", + rocks30_moss_24 = "rockMossy", + rocks30_moss_25 = "rockMossy", + rocks30_moss_26 = "rockMossy", + rocks30_moss_27 = "rockMossy", + rocks30_moss_28 = "rockMossy", + rocks30_moss_29 = "rockMossy", + rocks30_moss_30 = "rockMossy", + rocks30_snow_01 = "rockSnowy", + rocks30_snow_02 = "rockSnowy", + rocks30_snow_03 = "rockSnowy", + rocks30_snow_04 = "rockSnowy", + rocks30_snow_05 = "rockSnowy", + rocks30_snow_06 = "rockSnowy", + rocks30_snow_07 = "rockSnowy", + rocks30_snow_08 = "rockSnowy", + rocks30_snow_09 = "rockSnowy", + rocks30_snow_10 = "rockSnowy", + rocks30_snow_11 = "rockSnowy", + rocks30_snow_12 = "rockSnowy", + rocks30_snow_13 = "rockSnowy", + rocks30_snow_14 = "rockSnowy", + rocks30_snow_15 = "rockSnowy", + rocks30_snow_16 = "rockSnowy", + rocks30_snow_17 = "rockSnowy", + rocks30_snow_18 = "rockSnowy", + rocks30_snow_19 = "rockSnowy", + rocks30_snow_20 = "rockSnowy", + rocks30_snow_21 = "rockSnowy", + rocks30_snow_22 = "rockSnowy", + rocks30_snow_23 = "rockSnowy", + rocks30_snow_24 = "rockSnowy", + rocks30_snow_25 = "rockSnowy", + rocks30_snow_26 = "rockSnowy", + rocks30_snow_27 = "rockSnowy", + rocks30_snow_28 = "rockSnowy", + rocks30_snow_29 = "rockSnowy", + rocks30_snow_30 = "rockSnowy", +} diff --git a/gamedata/modrules.lua b/gamedata/modrules.lua index cd3440bb795..59f37f2a252 100644 --- a/gamedata/modrules.lua +++ b/gamedata/modrules.lua @@ -1,4 +1,4 @@ -VFS.Include('init.lua') +VFS.Include("init.lua") -- See: https://springrts.com/wiki/Modrules.lua local useQTPFS = Script.IsEngineMinVersion(105, 0, 2020) @@ -13,22 +13,22 @@ XPValues = { local modrules = { construction = { - constructionDecay = true, -- Do uncompleted building frames begin to decay if no builder is working on them? - constructionDecayTime = 9, -- The time in seconds before abandoned building frames begin to decay. - constructionDecaySpeed = 0.03, -- How fast build progress decays for abandoned building frames. Note that the rate is inversely proportional to the buildtime i.e. a building with a larger buildtime will decay more slowly for a given value of this tag than a building with a shorter buildtime. + constructionDecay = true, -- Do uncompleted building frames begin to decay if no builder is working on them? + constructionDecayTime = 9, -- The time in seconds before abandoned building frames begin to decay. + constructionDecaySpeed = 0.03, -- How fast build progress decays for abandoned building frames. Note that the rate is inversely proportional to the buildtime i.e. a building with a larger buildtime will decay more slowly for a given value of this tag than a building with a shorter buildtime. }, reclaim = { - multiReclaim = 1, -- Can multiple units reclaim a feature or only one? 0 implies the latter, all other values the former. - reclaimMethod = 0, -- Controls how features are reclaimed. Can be 0 - gradual reclaim, 1 - all reclaimed at end, any other positive value n - reclaim in n chunks. - unitMethod = 1, -- Controls how units are reclaimed. Can be 0 - gradual reclaim, 1 - all reclaimed at end, any other positive value n - reclaim in n chunks. + multiReclaim = 1, -- Can multiple units reclaim a feature or only one? 0 implies the latter, all other values the former. + reclaimMethod = 0, -- Controls how features are reclaimed. Can be 0 - gradual reclaim, 1 - all reclaimed at end, any other positive value n - reclaim in n chunks. + unitMethod = 1, -- Controls how units are reclaimed. Can be 0 - gradual reclaim, 1 - all reclaimed at end, any other positive value n - reclaim in n chunks. - unitEnergyCostFactor = 0, -- How much energy should reclaiming a unit cost? Multiplier against the fraction of the unit's buildCostEnergy reclaimed. - unitEfficiency = 1, -- How much metal should reclaiming a unit return? Multiplier against the unit's buildCostMetal. - featureEnergyCostFactor = 0, -- How much energy should reclaiming a feature cost? Multiplier against the fraction of the features' metal content reclaimed. + unitEnergyCostFactor = 0, -- How much energy should reclaiming a unit cost? Multiplier against the fraction of the unit's buildCostEnergy reclaimed. + unitEfficiency = 1, -- How much metal should reclaiming a unit return? Multiplier against the unit's buildCostMetal. + featureEnergyCostFactor = 0, -- How much energy should reclaiming a feature cost? Multiplier against the fraction of the features' metal content reclaimed. - allowEnemies = true, -- Can enemy units be reclaimed? - allowAllies = true, -- Can allied units be reclaimed? + allowEnemies = true, -- Can enemy units be reclaimed? + allowAllies = true, -- Can allied units be reclaimed? }, repair = { @@ -50,39 +50,39 @@ local modrules = { }, sensors = { - separateJammers = true, -- When true each allyTeam only jams their own units. - requireSonarUnderWater = true, -- If true then when underwater, units only get LOS if they also have sonar. - alwaysVisibleOverridesCloaked = false, -- If true then units will be visible even when cloaked (probably?). - decloakRequiresLineOfSight = false, -- default: false + separateJammers = true, -- When true each allyTeam only jams their own units. + requireSonarUnderWater = true, -- If true then when underwater, units only get LOS if they also have sonar. + alwaysVisibleOverridesCloaked = false, -- If true then units will be visible even when cloaked (probably?). + decloakRequiresLineOfSight = false, -- default: false los = { - losMipLevel = 3, -- Controls the resolution of the LOS calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the LOS map in both x and y direction. Must be between 0 and 6 inclusive. - airMipLevel = 4, -- Controls the resolution of the LOS vs. aircraft calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the air-LOS map in both x and y direction. Must be between 0 and 30 inclusive. [1] - jK describe for you what the value means. - radarMipLevel = 3, -- Controls the resolution of the radar. See description of airMipLevel for details. + losMipLevel = 3, -- Controls the resolution of the LOS calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the LOS map in both x and y direction. Must be between 0 and 6 inclusive. + airMipLevel = 4, -- Controls the resolution of the LOS vs. aircraft calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the air-LOS map in both x and y direction. Must be between 0 and 30 inclusive. [1] - jK describe for you what the value means. + radarMipLevel = 3, -- Controls the resolution of the radar. See description of airMipLevel for details. }, }, fireAtDead = { - fireAtKilled = false, -- Will units continue to target and fire on enemies which are running their Killed() animation? - fireAtCrashing = false, -- Will units continue to target and fire on enemy aircraft which are in the 'crashing' state? + fireAtKilled = false, -- Will units continue to target and fire on enemies which are running their Killed() animation? + fireAtCrashing = false, -- Will units continue to target and fire on enemy aircraft which are in the 'crashing' state? }, movement = { - allowUnitCollisionDamage = true, -- default: true if using QTPFS pathfinder. Do unit-unit (skidding) collisions cause damage? - allowUnitCollisionOverlap = false, -- can mobile units collision volumes overlap one another? Allows unit movement like this (video http://www.youtube.com/watch?v=mRtePUdVk2o ) at the cost of more 'clumping'. - allowCrushingAlliedUnits = true, -- default: false. Can allied ground units crush each other during collisions? Units still have to be explicitly set as crushable using the crushable parameter of Spring.SetUnitBlocking. - allowGroundUnitGravity = false, -- default: true. Allows fast moving mobile units to 'catch air' as they move over terrain. + allowUnitCollisionDamage = true, -- default: true if using QTPFS pathfinder. Do unit-unit (skidding) collisions cause damage? + allowUnitCollisionOverlap = false, -- can mobile units collision volumes overlap one another? Allows unit movement like this (video http://www.youtube.com/watch?v=mRtePUdVk2o ) at the cost of more 'clumping'. + allowCrushingAlliedUnits = true, -- default: false. Can allied ground units crush each other during collisions? Units still have to be explicitly set as crushable using the crushable parameter of Spring.SetUnitBlocking. + allowGroundUnitGravity = false, -- default: true. Allows fast moving mobile units to 'catch air' as they move over terrain. --NOTE: allowGroundUnitGravity was set to false to "Fix units flying over hills and bumps", but this came at a cost for unit impulse which was a desired trait --allowGroundUnitGravity = true, is possibly causing units getting stuck in labs - allowAirPlanesToLeaveMap = true, -- Are (gunship) aircraft allowed to fly outside the bounds of the map? - allowAircraftToHitGround = true, -- Are aircraft allowed to hit the ground whilst manoeuvring? - allowPushingEnemyUnits = false, -- Can enemy ground units push each other during collisions? - allowHoverUnitStrafing = true, -- Allows hovercraft units to slide in turns. + allowAirPlanesToLeaveMap = true, -- Are (gunship) aircraft allowed to fly outside the bounds of the map? + allowAircraftToHitGround = true, -- Are aircraft allowed to hit the ground whilst manoeuvring? + allowPushingEnemyUnits = false, -- Can enemy ground units push each other during collisions? + allowHoverUnitStrafing = true, -- Allows hovercraft units to slide in turns. - allowDirectionalPathing = true, -- determines if ground speed going downhill != going uphill - allowAircraftToLeaveMap = true, -- determines if gunships are allowed to leave map boundaries - maxCollisionPushMultiplier = 1, -- mitigate slow units being pushed faster than they can normally walk by fast units + allowDirectionalPathing = true, -- determines if ground speed going downhill != going uphill + allowAircraftToLeaveMap = true, -- determines if gunships are allowed to leave map boundaries + maxCollisionPushMultiplier = 1, -- mitigate slow units being pushed faster than they can normally walk by fast units }, featureLOS = { @@ -90,39 +90,39 @@ local modrules = { }, system = { - allowTake = true, -- Enables and disables the /take UI command. - LuaAllocLimit = 1536, -- default: 1536. Global Lua alloc limit (in megabytes) + allowTake = true, -- Enables and disables the /take UI command. + LuaAllocLimit = 1536, -- default: 1536. Global Lua alloc limit (in megabytes) enableSmoothMesh = true, - - pathFinderSystem = useQTPFS and 1 or 0, -- Which pathfinder does the game use? Can be 0 - The legacy default pathfinder, 1 - Quad-Tree Pathfinder System (QTPFS) or -1 - disabled. + + pathFinderSystem = useQTPFS and 1 or 0, -- Which pathfinder does the game use? Can be 0 - The legacy default pathfinder, 1 - Quad-Tree Pathfinder System (QTPFS) or -1 - disabled. --pathFinderUpdateRate = 0.0001, -- default: 0.007. Controls how often the pathfinder updates; larger values means more rapid updates - pathFinderRawDistMult = 100000, -- default: 1.25. Engine does raw move with a limited distance, this multiplier adjusts that - pfRepathDelayInFrames = 60, -- default: 60. How many frames at least must pass between checks for whether a unit is making enough progress to its current waypoint or whether a new path should be requested - pfRepathMaxRateInFrames = 150, -- default: 150. Controls the minimum amount of frames that must pass before a unit is allowed to request a new path. Mostly for rate limiting and prevent excessive CPU wastage - pfUpdateRateScale = 1, -- default: 1. Multiplier for the update rate - pfRawMoveSpeedThreshold = 0, -- default: 0. Controls the speed modifier (which includes typemap boosts and up/down hill modifiers) under which units will never do raw move, regardless of distance etc. Defaults to 0, which means units will not try to raw-move into unpathable terrain (e.g. typemapped lava, cliffs, water). You can set it to some positive value to make them avoid pathable but very slow terrain (for example if you set it to 0.2 then they will not raw-move across terrain where they move at 20% speed or less, and will use normal pathing instead - which may still end up taking them through that path). - pfHcostMult = 0.2, -- default: 0.2. A float value between 0 and 2. Controls how aggressively the pathing search prioritizes nodes going in the direction of the goal. Higher values mean pathing is cheaper, but can start producing degenerate paths where the unit goes straight at the goal and then has to hug a wall. - nativeExcessSharing = Spring.GetModOptions().easytax==false and Spring.GetModOptions().tax_resource_sharing_amount==0, -- default: true. If true, the engine will handle resource overflow sharing between allied teams. If false, overflow sharing is disabled and we use Lua implementation in game_tax_resource_sharing.lua gadget. + pathFinderRawDistMult = 100000, -- default: 1.25. Engine does raw move with a limited distance, this multiplier adjusts that + pfRepathDelayInFrames = 60, -- default: 60. How many frames at least must pass between checks for whether a unit is making enough progress to its current waypoint or whether a new path should be requested + pfRepathMaxRateInFrames = 150, -- default: 150. Controls the minimum amount of frames that must pass before a unit is allowed to request a new path. Mostly for rate limiting and prevent excessive CPU wastage + pfUpdateRateScale = 1, -- default: 1. Multiplier for the update rate + pfRawMoveSpeedThreshold = 0, -- default: 0. Controls the speed modifier (which includes typemap boosts and up/down hill modifiers) under which units will never do raw move, regardless of distance etc. Defaults to 0, which means units will not try to raw-move into unpathable terrain (e.g. typemapped lava, cliffs, water). You can set it to some positive value to make them avoid pathable but very slow terrain (for example if you set it to 0.2 then they will not raw-move across terrain where they move at 20% speed or less, and will use normal pathing instead - which may still end up taking them through that path). + pfHcostMult = 0.2, -- default: 0.2. A float value between 0 and 2. Controls how aggressively the pathing search prioritizes nodes going in the direction of the goal. Higher values mean pathing is cheaper, but can start producing degenerate paths where the unit goes straight at the goal and then has to hug a wall. + nativeExcessSharing = Spring.GetModOptions().easytax == false and Spring.GetModOptions().tax_resource_sharing_amount == 0, -- default: true. If true, the engine will handle resource overflow sharing between allied teams. If false, overflow sharing is disabled and we use Lua implementation in game_tax_resource_sharing.lua gadget. }, transportability = { - transportAir = false, -- Can aircraft be transported? - transportShip = false, -- Can ships be transported? - transportHover = true, -- Can hovercraft be transported? - transportGround = true, -- Can ground units be transported? - targetableTransportedUnits = false, -- Can transported units be targeted by weapons? true allows both manual and automatic targeting. + transportAir = false, -- Can aircraft be transported? + transportShip = false, -- Can ships be transported? + transportHover = true, -- Can hovercraft be transported? + transportGround = true, -- Can ground units be transported? + targetableTransportedUnits = false, -- Can transported units be targeted by weapons? true allows both manual and automatic targeting. }, paralyze = { - paralyzeOnMaxHealth = true, -- Are units paralyzed when the level of emp is greater than their current health or their maximum health? - paralyzeDeclineRate = Spring.GetModOptions().emprework==true and 20 or 40, -- default: 40. + paralyzeOnMaxHealth = true, -- Are units paralyzed when the level of emp is greater than their current health or their maximum health? + paralyzeDeclineRate = Spring.GetModOptions().emprework == true and 20 or 40, -- default: 40. }, experience = { experienceMult = XPValues.experienceMult, -- Controls the amount of experience gained by units engaging in combat. The formulae used are: xp for damage = 0.1 * experienceMult * damage / target_HP * target_power / attacker_power. xp for kill = 0.1 * experienceMult * target_power / attacker_power. Where power can be set by the UnitDef tag. - powerScale = XPValues.powerScale, -- Controls how gaining experience changes the relative power of the unit. The formula used is Power multiplier = powerScale * (1 + xp / (xp + 1)). - healthScale = XPValues.healthScale, -- Controls how gaining experience increases the maxDamage (total hitpoints) of the unit. The formula used is Health multiplier = healthScale * (1 + xp / (xp + 1)). - reloadScale = XPValues.reloadScale, -- Controls how gaining experience decreases the reloadTime of the unit's weapons. The formula used is Rate of fire multiplier = reloadScale * (1 + xp / (xp + 1)). + powerScale = XPValues.powerScale, -- Controls how gaining experience changes the relative power of the unit. The formula used is Power multiplier = powerScale * (1 + xp / (xp + 1)). + healthScale = XPValues.healthScale, -- Controls how gaining experience increases the maxDamage (total hitpoints) of the unit. The formula used is Health multiplier = healthScale * (1 + xp / (xp + 1)). + reloadScale = XPValues.reloadScale, -- Controls how gaining experience decreases the reloadTime of the unit's weapons. The formula used is Rate of fire multiplier = reloadScale * (1 + xp / (xp + 1)). }, damage = { @@ -130,12 +130,12 @@ local modrules = { }, guard = { - guardRecalculateThreshold = 100.0, -- Distance that a guardee must move before the guard goal is recalculated - guardStoppedProximityGoal = 50.0, -- Distance that a guardian will stop at nearing a stopped guardee - guardStoppedExtraDistance = 100.0, -- The extra distance a guardian will keep from a stopped guardee - guardMovingProximityGoal = 200.0, -- Distance the guardian is considered to be in guarding range and will match the velocity + guardRecalculateThreshold = 100.0, -- Distance that a guardee must move before the guard goal is recalculated + guardStoppedProximityGoal = 50.0, -- Distance that a guardian will stop at nearing a stopped guardee + guardStoppedExtraDistance = 100.0, -- The extra distance a guardian will keep from a stopped guardee + guardMovingProximityGoal = 200.0, -- Distance the guardian is considered to be in guarding range and will match the velocity guardMovingIntervalMultiplier = 2.13, -- A multiplier for the moving goal while guarding, smaller values will result in higher detail movement but more performance cost - guardInterceptionLimit = 128.0, -- Limit for the intercept when a guardian is not in guarding range + guardInterceptionLimit = 128.0, -- Limit for the intercept when a guardian is not in guarding range }, } diff --git a/gamedata/movedefs.lua b/gamedata/movedefs.lua index 0a5c7f18291..b682a0a4f8d 100644 --- a/gamedata/movedefs.lua +++ b/gamedata/movedefs.lua @@ -17,45 +17,45 @@ local SPEED_CLASS = Game.speedModClasses local CRUSH = { - NONE = 0, - TINY = 5, - LIGHT = 10, -- default - SMALL = 18, - MEDIUM = 25, - LARGE = 50, - HEAVY = 250, - HUGE = 1400, + NONE = 0, + TINY = 5, + LIGHT = 10, -- default + SMALL = 18, + MEDIUM = 25, + LARGE = 50, + HEAVY = 250, + HUGE = 1400, MASSIVE = 9999, MAXIMUM = 99999, -- arbitrary limit } local DEPTH = { - NONE = 0, - TICK = 5, - MIN_SHALLOW = 8, -- default minimum for ships + NONE = 0, + TICK = 5, + MIN_SHALLOW = 8, -- default minimum for ships MAX_SHALLOW = 20, -- default maximum for land units - SUBMERGED = 15, -- minimum depth for subs and huge ships - AMPHIBIOUS = 5000, - MAXIMUM = 9999, -- aribitrary limit - DEFAULT = 1000000, + SUBMERGED = 15, -- minimum depth for subs and huge ships + AMPHIBIOUS = 5000, + MAXIMUM = 9999, -- aribitrary limit + DEFAULT = 1000000, } local SLOPE = { - NONE = 0, - MINIMUM = 27, - MODERATE = 33, -- just below angle of repose + NONE = 0, + MINIMUM = 27, + MODERATE = 33, -- just below angle of repose DIFFICULT = 54, - EXTREME = 75, - MAXIMUM = 90, + EXTREME = 75, + MAXIMUM = 90, } local SLOPE_MOD = { - MINIMUM = 4, - MODERATE = 18, - SLOW = 25, + MINIMUM = 4, + MODERATE = 18, + SLOW = 25, VERY_SLOW = 36, - GLACIAL = 42, - MAXIMUM = 4000, + GLACIAL = 42, + MAXIMUM = 4000, } ---------------------------------------------------------------------------------- @@ -71,16 +71,16 @@ local SLOPE_MOD = { ---@type DepthModParams local depthModGeneric = { - minHeight = 4, + minHeight = 4, linearCoeff = 0.03, - maxValue = 0.7, -- TODO: Should be "maxScale" and should be > 1. + maxValue = 0.7, -- TODO: Should be "maxScale" and should be > 1. } ---@type DepthModParams local depthModCommanders = { - maxScale = 1.5, + maxScale = 1.5, quadraticCoeff = (9.9 / 22090) / 2, - linearCoeff = (0.1 / 470) / 2, + linearCoeff = (0.1 / 470) / 2, } ---@type DepthModParams @@ -562,7 +562,9 @@ local function validate(moveDef) local name = moveDef.name if type(name) ~= "string" then return false - elseif table.any(validName, function(v) return name:match(v) end) then + elseif table.any(validName, function(v) + return name:match(v) + end) then return true elseif name:match("%d+$") == tostring(moveDef.footprintx) then return true @@ -576,34 +578,31 @@ local defs = {} for moveName, moveData in pairs(moveDatas) do ---@type MoveDefCreate local moveDef = { - name = moveName, - crushstrength = moveData.crushstrength, - footprintx = moveData.footprint, - footprintz = moveData.footprint, - allowRawMovement = true, + name = moveName, + crushstrength = moveData.crushstrength, + footprintx = moveData.footprint, + footprintz = moveData.footprint, + allowRawMovement = true, allowTerrainCollisions = false, - heatmapping = true, + heatmapping = true, -- - depthMod = moveData.depthMod, - depthModParams = moveData.depthModParams, - maxslope = moveData.maxslope, - maxwaterdepth = moveData.maxwaterdepth, - maxwaterslope = moveData.maxwaterslope, - minwaterdepth = moveData.minwaterdepth, - slopeMod = moveData.slopeMod, - speedModClass = moveData.speedModClass, - subMarine = moveData.subMarine, - overrideUnitWaterline = moveData.overrideUnitWaterline, + depthMod = moveData.depthMod, + depthModParams = moveData.depthModParams, + maxslope = moveData.maxslope, + maxwaterdepth = moveData.maxwaterdepth, + maxwaterslope = moveData.maxwaterslope, + minwaterdepth = moveData.minwaterdepth, + slopeMod = moveData.slopeMod, + speedModClass = moveData.speedModClass, + subMarine = moveData.subMarine, + overrideUnitWaterline = moveData.overrideUnitWaterline, } - - setMaxSlope(moveDef) if validate(moveDef) then defs[#defs + 1] = moveDef end - end return defs diff --git a/gamedata/post_save_to_customparams.lua b/gamedata/post_save_to_customparams.lua index 84f5730abc9..99f7fee88cc 100644 --- a/gamedata/post_save_to_customparams.lua +++ b/gamedata/post_save_to_customparams.lua @@ -1,22 +1,23 @@ -function table.val_to_str ( v ) - if "string" == type( v ) then - v = string.gsub( v, "\n", "\\n" ) - if string.match( string.gsub(v,"[^'\"]",""), '^"+$' ) then +function table.val_to_str(v) + if "string" == type(v) then + v = string.gsub(v, "\n", "\\n") + if string.match(string.gsub(v, "[^'\"]", ""), '^"+$') then return "'" .. v .. "'" end - return '"' .. string.gsub(v,'"', '\\"' ) .. '"' + return '"' .. string.gsub(v, '"', '\\"') .. '"' else - return "table" == type( v ) and table.tostring( v ) or - tostring( v ) + return "table" == type(v) and table.tostring(v) or tostring(v) end end -function table.key_to_str ( k ) - if "string" == type( k ) and string.match( k, "^[_%a][_%a%d]*$" ) then - if k == "else" then k = "default" end -- handles deprecated ["else"] damage class +function table.key_to_str(k) + if "string" == type(k) and string.match(k, "^[_%a][_%a%d]*$") then + if k == "else" then + k = "default" + end -- handles deprecated ["else"] damage class return string.lower(k) -- make all key values lower case else - return "[" .. table.val_to_str( k ) .. "]" + return "[" .. table.val_to_str(k) .. "]" end end @@ -24,21 +25,20 @@ local function isEmptyTable(v) return type(v) == "table" and next(v) == nil end -function table.tostring( tbl ) +function table.tostring(tbl) local result, done = {}, {} - for k, v in ipairs( tbl ) do + for k, v in ipairs(tbl) do if not isEmptyTable(v) then - table.insert( result, table.val_to_str( v ) ) - done[ k ] = true + table.insert(result, table.val_to_str(v)) + done[k] = true end end - for k, v in pairs( tbl ) do - if not done[ k ] and not isEmptyTable(v) then - table.insert( result, - table.key_to_str( k ) .. "=" .. table.val_to_str( v ) ) + for k, v in pairs(tbl) do + if not done[k] and not isEmptyTable(v) then + table.insert(result, table.key_to_str(k) .. "=" .. table.val_to_str(v)) end end - return "{" .. table.concat( result, "," ) .. "}" + return "{" .. table.concat(result, ",") .. "}" end local function saveDefToCustomParams(defType, name, def) @@ -56,6 +56,6 @@ local function markDefOmittedInCustomParams(defType, name, def) end return { - SaveDefToCustomParams = saveDefToCustomParams, + SaveDefToCustomParams = saveDefToCustomParams, MarkDefOmittedInCustomParams = markDefOmittedInCustomParams, } diff --git a/gamedata/resources.lua b/gamedata/resources.lua index 86c96a061ad..077408f27a6 100644 --- a/gamedata/resources.lua +++ b/gamedata/resources.lua @@ -1,106 +1,106 @@ local resources = { graphics = { - maps = { - detailtex = 'default/detailtex2.bmp', - watertex = 'default/ocean.jpg', - }, - groundfx = { - groundflash = 'default/groundflash.tga', - groundflashwhite = 'default/groundflashwhite.tga', - groundring = 'default/groundring.tga', - seismic = nil, - circlefx0 = 'default/circlefx0.png', - circlefx1 = 'default/circlefx1.png', - circlefx2 = 'default/circlefx2.png', - circlefx3 = 'default/circlefx3.png', - radarfx2ground = 'ui/radarping2.png', - scar50glow = 'projectiletextures/decal_scar_50_glow.tga', - centersplatsh = 'default/centersplatsh_white.tga', - barshockwave = 'default/BARshockwave1.tga', - }, - projectiletextures = { - circularthingy = 'default/circularthingy.tga', - circles = 'default/circles.tga', - gfxtexture = 'projectiletextures/nanopart.tga', - laserend = 'default/laserend.tga', - laserfalloff = 'default/laserfalloff.tga', - randdots = 'default/randdots.tga', - smoketrail = 'default/smoketrail.tga', - smoketrailaa = 'default/smoketrailaa.tga', - railguntrail = 'default/railguntrail.tga', - trail = 'default/trail.tga', - wake = 'default/wake.tga', - wakegrey = 'projectiletextures/wakegrey.tga', - flashside3 = 'projectiletextures/flashside3.tga', - flare = 'default/flare.tga', - flare2 = 'default/flare2.tga', - explo = 'default/explo.tga', - explo2 = 'default/explo2.tga', - sakexplo2 = 'default/sakexplo2.tga', - explofade = 'default/explofade.tga', - exploflare = 'projectiletextures/exploflare.tga', - heatcloud = 'default/explo.tga', - blastwave = 'projectiletextures/blastwave.tga', - flame = 'default/flame.tga', - flame_dark = 'projectiletextures/flame.tga', - flame_alt = 'gpl/flame.tga', - flame_alt2 = 'gpl/flame_alt.tga', - fire = 'gpl/fire.tga', - flamestream = 'atmos/flamestream.tga', - treefire = 'gpl/treefire.png', - muzzlesideflipped = 'default/muzzlesideflipped.tga', - muzzleside = 'default/muzzleside.tga', - muzzlefront = 'default/muzzlefront.tga', - largebeam = 'default/largelaserfalloff.tga', - gunshotxl = 'default/gunshotxl.tga', + maps = { + detailtex = "default/detailtex2.bmp", + watertex = "default/ocean.jpg", + }, + groundfx = { + groundflash = "default/groundflash.tga", + groundflashwhite = "default/groundflashwhite.tga", + groundring = "default/groundring.tga", + seismic = nil, + circlefx0 = "default/circlefx0.png", + circlefx1 = "default/circlefx1.png", + circlefx2 = "default/circlefx2.png", + circlefx3 = "default/circlefx3.png", + radarfx2ground = "ui/radarping2.png", + scar50glow = "projectiletextures/decal_scar_50_glow.tga", + centersplatsh = "default/centersplatsh_white.tga", + barshockwave = "default/BARshockwave1.tga", + }, + projectiletextures = { + circularthingy = "default/circularthingy.tga", + circles = "default/circles.tga", + gfxtexture = "projectiletextures/nanopart.tga", + laserend = "default/laserend.tga", + laserfalloff = "default/laserfalloff.tga", + randdots = "default/randdots.tga", + smoketrail = "default/smoketrail.tga", + smoketrailaa = "default/smoketrailaa.tga", + railguntrail = "default/railguntrail.tga", + trail = "default/trail.tga", + wake = "default/wake.tga", + wakegrey = "projectiletextures/wakegrey.tga", + flashside3 = "projectiletextures/flashside3.tga", + flare = "default/flare.tga", + flare2 = "default/flare2.tga", + explo = "default/explo.tga", + explo2 = "default/explo2.tga", + sakexplo2 = "default/sakexplo2.tga", + explofade = "default/explofade.tga", + exploflare = "projectiletextures/exploflare.tga", + heatcloud = "default/explo.tga", + blastwave = "projectiletextures/blastwave.tga", + flame = "default/flame.tga", + flame_dark = "projectiletextures/flame.tga", + flame_alt = "gpl/flame.tga", + flame_alt2 = "gpl/flame_alt.tga", + fire = "gpl/fire.tga", + flamestream = "atmos/flamestream.tga", + treefire = "gpl/treefire.png", + muzzlesideflipped = "default/muzzlesideflipped.tga", + muzzleside = "default/muzzleside.tga", + muzzlefront = "default/muzzlefront.tga", + largebeam = "default/largelaserfalloff.tga", + gunshotxl = "default/gunshotxl.tga", - radarfx1 = 'ui/radarping1.png', - radarfx2 = 'ui/radarping2.png', + radarfx1 = "ui/radarping1.png", + radarfx2 = "ui/radarping2.png", - lavachunk = 'atmos/lavachunk.tga', - lavasplats = 'atmos/lavasplats.tga', - lavaplosion = 'atmos/lavaplosion.tga', + lavachunk = "atmos/lavachunk.tga", + lavasplats = "atmos/lavasplats.tga", + lavaplosion = "atmos/lavaplosion.tga", - fogdirty = 'atmos/fogdirty.tga', - rain = 'atmos/rain.tga', - cloudpuff = 'atmos/cloudpuff.tga', - cloudmist = 'atmos/cloudmist.tga', - barmist = 'atmos/barmist.tga', - sandblast = 'atmos/sandblast.tga', - smoke_puff = 'atmos/smoke_puff.tga', - smoke_puff2 = 'atmos/smoke_puff2.tga', - smoke_puff_red = 'atmos/smoke_puff_red.tga', - dirtrush = 'atmos/dirtdebrisexplo.tga', - dirtpuff = 'atmos/dirtpuff.tga', - explowater = 'projectiletextures/explowater.tga', - waterrush = 'projectiletextures/waterrush.tga', - waterfoam = 'atmos/waterfoam.tga', - subwak = 'projectiletextures/subwake.tga', - scar50 = 'projectiletextures/decal_scar_50.tga', + fogdirty = "atmos/fogdirty.tga", + rain = "atmos/rain.tga", + cloudpuff = "atmos/cloudpuff.tga", + cloudmist = "atmos/cloudmist.tga", + barmist = "atmos/barmist.tga", + sandblast = "atmos/sandblast.tga", + smoke_puff = "atmos/smoke_puff.tga", + smoke_puff2 = "atmos/smoke_puff2.tga", + smoke_puff_red = "atmos/smoke_puff_red.tga", + dirtrush = "atmos/dirtdebrisexplo.tga", + dirtpuff = "atmos/dirtpuff.tga", + explowater = "projectiletextures/explowater.tga", + waterrush = "projectiletextures/waterrush.tga", + waterfoam = "atmos/waterfoam.tga", + subwak = "projectiletextures/subwake.tga", + scar50 = "projectiletextures/decal_scar_50.tga", --Raptor Defense effects - uglynovaexplo = 'CC/uglynovaexplo.tga', - sporetrail = 'GPL/sporetrail.tga', - sporetrail_xl = 'GPL/sporetrail_xl.tga', - blooddrop = 'PD/blooddrop.tga', - blooddrop2 = 'raptors/blooddrop2.tga', - blooddrop2white = 'raptors/blooddrop2_white.tga', - bloodblast = 'PD/bloodblast.tga', - bloodblast2 = 'raptors/bloodblast2.tga', - bloodblast2white = 'raptors/bloodblast2_white.tga', - bloodsplat = 'PD/bloodsplat.tga', - bloodsplat2 = 'raptors/bloodsplat2.tga', - bloodsplat2white = 'raptors/bloodsplat2_white.tga', - bloodspark2 = 'raptors/blood_splat.tga', - bloodspark2white = 'raptors/blood_splat_white.tga', - bloodcentersplatsh = 'raptors/blood_centersplatsh.tga', - bloodcentersplatshwhite = 'raptors/blood_centersplatsh_white.tga', - blooddropwhite = 'PD/blooddropwhite.tga', - bloodblastwhite = 'PD/bloodblastwhite.tga', - lightningbeam = 'PD/lightning.tga', - }, - } - } + uglynovaexplo = "CC/uglynovaexplo.tga", + sporetrail = "GPL/sporetrail.tga", + sporetrail_xl = "GPL/sporetrail_xl.tga", + blooddrop = "PD/blooddrop.tga", + blooddrop2 = "raptors/blooddrop2.tga", + blooddrop2white = "raptors/blooddrop2_white.tga", + bloodblast = "PD/bloodblast.tga", + bloodblast2 = "raptors/bloodblast2.tga", + bloodblast2white = "raptors/bloodblast2_white.tga", + bloodsplat = "PD/bloodsplat.tga", + bloodsplat2 = "raptors/bloodsplat2.tga", + bloodsplat2white = "raptors/bloodsplat2_white.tga", + bloodspark2 = "raptors/blood_splat.tga", + bloodspark2white = "raptors/blood_splat_white.tga", + bloodcentersplatsh = "raptors/blood_centersplatsh.tga", + bloodcentersplatshwhite = "raptors/blood_centersplatsh_white.tga", + blooddropwhite = "PD/blooddropwhite.tga", + bloodblastwhite = "PD/bloodblastwhite.tga", + lightningbeam = "PD/lightning.tga", + }, + }, +} local function AutoAdd(subDir, map, filter) local dirList = VFS.DirList("bitmaps/" .. subDir, nil, nil, true) @@ -111,9 +111,9 @@ local function AutoAdd(subDir, map, filter) resources["graphics"][subDir] = subTable if not filter or filter == ext then if not map then - table.insert(subTable, path) + table.insert(subTable, path) else -- a mapped subtable - subTable[key] = path + subTable[key] = path end end end diff --git a/gamedata/scavengers/unitdef_changes.lua b/gamedata/scavengers/unitdef_changes.lua index 2227e24aed7..9fd7208c070 100644 --- a/gamedata/scavengers/unitdef_changes.lua +++ b/gamedata/scavengers/unitdef_changes.lua @@ -5,7 +5,6 @@ -- -- Since you can't actually remove parameters normally, it will do it when you set string: 'nil' as value -- -- Normally an empty table as value will be ignored when merging, but not here, it will overwrite what it had with an empty table - local customDefs = {} -- local scavDifficulty = Spring.GetModOptions().scavdifficulty @@ -30,9 +29,9 @@ local customDefs = {} -- end local scavUnit = {} -for name,uDef in pairs(UnitDefs) do +for name, uDef in pairs(UnitDefs) do if string.sub(name, 1, 3) == "arm" or string.sub(name, 1, 3) == "cor" or string.sub(name, 1, 3) == "leg" then - scavUnit[#scavUnit+1] = name .. '_scav' + scavUnit[#scavUnit + 1] = name .. "_scav" end end @@ -130,9 +129,9 @@ customDefs.legcomlvl3 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl3 = { @@ -147,9 +146,9 @@ customDefs.legdecomlvl3 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl4 = { @@ -164,9 +163,9 @@ customDefs.legcomlvl4 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl4 = { @@ -181,9 +180,9 @@ customDefs.legdecomlvl4 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl5 = { @@ -198,9 +197,9 @@ customDefs.legcomlvl5 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl5 = { @@ -215,9 +214,9 @@ customDefs.legdecomlvl5 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl6 = { @@ -232,9 +231,9 @@ customDefs.legcomlvl6 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl6 = { @@ -249,9 +248,9 @@ customDefs.legdecomlvl6 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl7 = { @@ -266,9 +265,9 @@ customDefs.legcomlvl7 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl7 = { @@ -283,9 +282,9 @@ customDefs.legdecomlvl7 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl8 = { @@ -300,9 +299,9 @@ customDefs.legcomlvl8 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl8 = { @@ -317,9 +316,9 @@ customDefs.legdecomlvl8 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl9 = { @@ -334,9 +333,9 @@ customDefs.legcomlvl9 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl9 = { @@ -351,9 +350,9 @@ customDefs.legdecomlvl9 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legcomlvl10 = { @@ -368,9 +367,9 @@ customDefs.legcomlvl10 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.legdecomlvl10 = { @@ -385,9 +384,9 @@ customDefs.legdecomlvl10 = { spawns_mode = "random_locked", spawns_expire = 60, spawns_surface = "LAND", -- Available: "LAND SEA" - } - } - } + }, + }, + }, } customDefs.armrectr = { @@ -413,9 +412,9 @@ customDefs.legkam = { spawns_name = "cormine1_scav", spawns_surface = "LAND", spawns_expire = 99999, - } - } - } + }, + }, + }, } -- local scavConstructorsList = { @@ -1093,7 +1092,6 @@ customDefs.legkam = { -- mincloakdistance = 144, -- } - -- -- Cloaked Jammers -- customDefs.armjamt = { @@ -1330,7 +1328,6 @@ customDefs.legkam = { -- } -- } - -- -- Faster LLT - unique sound - shorter beamtime -- customDefs.armllt = { -- -- cloakcost = 6, diff --git a/gamedata/scavengers/unitdef_post.lua b/gamedata/scavengers/unitdef_post.lua index e0b89d9451a..c5a98010940 100644 --- a/gamedata/scavengers/unitdef_post.lua +++ b/gamedata/scavengers/unitdef_post.lua @@ -1,7 +1,7 @@ -- -- UnitDef postprocessing specific to Scavenger units only local function scavUnitDef_Post(name, uDef) - uDef.category = uDef.category .. ' SCAVENGER' + uDef.category = uDef.category .. " SCAVENGER" uDef.customparams.isscavenger = true uDef.capturable = false uDef.decloakonfire = true @@ -17,13 +17,7 @@ local function scavUnitDef_Post(name, uDef) if uDef.buildpic then --Spring.Echo("FILEEXISTS", VFS.FileExists("unitpics/scavengers/"..uDef.buildpic)) --local nonScavName = string.sub(uDef.unitname, 1, string.len(uDef.unitname)-5) - if (not string.find(uDef.buildpic, "scavengers")) - and (not string.find(uDef.buildpic, "raptor")) - and (not string.find(uDef.buildpic, "critters")) - and (not string.find(uDef.buildpic, "lootboxes")) - and (not string.find(uDef.buildpic, "other")) - and (not string.find(uDef.buildpic, "alternative")) - and (VFS.FileExists("unitpics/scavengers/" .. uDef.buildpic)) then + if (not string.find(uDef.buildpic, "scavengers")) and (not string.find(uDef.buildpic, "raptor")) and (not string.find(uDef.buildpic, "critters")) and (not string.find(uDef.buildpic, "lootboxes")) and (not string.find(uDef.buildpic, "other")) and (not string.find(uDef.buildpic, "alternative")) and (VFS.FileExists("unitpics/scavengers/" .. uDef.buildpic)) then uDef.buildpic = "scavengers/" .. uDef.buildpic end end @@ -33,8 +27,8 @@ local function scavUnitDef_Post(name, uDef) -- make barrelshot purple if uDef.customparams.firingceg then - if string.find(uDef.customparams.firingceg, 'barrelshot') then - uDef.customparams.firingceg = uDef.customparams.firingceg .. '-purple' + if string.find(uDef.customparams.firingceg, "barrelshot") then + uDef.customparams.firingceg = uDef.customparams.firingceg .. "-purple" end end @@ -42,16 +36,16 @@ local function scavUnitDef_Post(name, uDef) -- make barrelshot purple if uDef.sfxtypes.explosiongenerators then for k, v in pairs(uDef.sfxtypes.explosiongenerators) do - if string.find(v, 'barrelshot') then - uDef.sfxtypes.explosiongenerators[k] = v .. '-purple' + if string.find(v, "barrelshot") then + uDef.sfxtypes.explosiongenerators[k] = v .. "-purple" end end end -- make deathcegs purple if uDef.sfxtypes.pieceexplosiongenerators then for k, v in pairs(uDef.sfxtypes.pieceexplosiongenerators) do - if string.find(v, 'deathceg') then - uDef.sfxtypes.pieceexplosiongenerators[k] = v .. '-purple' + if string.find(v, "deathceg") then + uDef.sfxtypes.pieceexplosiongenerators[k] = v .. "-purple" end end end @@ -59,37 +53,26 @@ local function scavUnitDef_Post(name, uDef) -- make unit explosion purple if uDef.explodeas then - if string.find(string.lower(uDef.explodeas), 'explosiongeneric') or - string.find(string.lower(uDef.explodeas), 'buildingexplosiongeneric') or - string.find(string.lower(uDef.explodeas), 'explosiont3') or - string.find(string.lower(uDef.explodeas), 'bantha') or - string.find(string.lower(uDef.explodeas), 'lootbox') - then - uDef.explodeas = uDef.explodeas .. '-purple' + if string.find(string.lower(uDef.explodeas), "explosiongeneric") or string.find(string.lower(uDef.explodeas), "buildingexplosiongeneric") or string.find(string.lower(uDef.explodeas), "explosiont3") or string.find(string.lower(uDef.explodeas), "bantha") or string.find(string.lower(uDef.explodeas), "lootbox") then + uDef.explodeas = uDef.explodeas .. "-purple" end end if uDef.selfdestructas then - if string.find(string.lower(uDef.selfdestructas), 'explosiongeneric') or - string.find(string.lower(uDef.selfdestructas), 'buildingexplosiongeneric') or - string.find(string.lower(uDef.selfdestructas), 'explosiont3') or - string.find(string.lower(uDef.selfdestructas), 'bantha') or - string.find(string.lower(uDef.selfdestructas), 'lootbox') - then - uDef.selfdestructas = uDef.selfdestructas .. '-purple' + if string.find(string.lower(uDef.selfdestructas), "explosiongeneric") or string.find(string.lower(uDef.selfdestructas), "buildingexplosiongeneric") or string.find(string.lower(uDef.selfdestructas), "explosiont3") or string.find(string.lower(uDef.selfdestructas), "bantha") or string.find(string.lower(uDef.selfdestructas), "lootbox") then + uDef.selfdestructas = uDef.selfdestructas .. "-purple" end end -- replace buildlists with _scav units if uDef.buildoptions then for k, v in pairs(uDef.buildoptions) do - if UnitDefs[v .. '_scav'] then - uDef.buildoptions[k] = v .. '_scav' + if UnitDefs[v .. "_scav"] then + uDef.buildoptions[k] = v .. "_scav" end end end - -- Remove wrecks of units you shouldn't be able to capture -- if uDef.featuredefs and uDef.corpse and (uDef.buildoptions or (not uDef.canmove)) then -- if uDef.corpse == "DEAD" and uDef.featuredefs.heap then @@ -103,9 +86,15 @@ local function scavUnitDef_Post(name, uDef) if uDef.health then if not string.find(name, "scavbeacon") then uDef.health = uDef.health * 1.25 - if uDef.metalcost then uDef.metalcost = uDef.metalcost * 1.1 end - if uDef.energycost then uDef.energycost = uDef.energycost * 1.1 end - if uDef.buildtime then uDef.buildtime = uDef.buildtime * 1.1 end + if uDef.metalcost then + uDef.metalcost = uDef.metalcost * 1.1 + end + if uDef.energycost then + uDef.energycost = uDef.energycost * 1.1 + end + if uDef.buildtime then + uDef.buildtime = uDef.buildtime * 1.1 + end end uDef.autoheal = 0 uDef.idleautoheal = math.ceil(math.sqrt(uDef.health * 0.1)) @@ -140,9 +129,15 @@ local function scavUnitDef_Post(name, uDef) uDef.capturespeed = uDef.workerspeed * 4 uDef.reclaimspeed = uDef.workerspeed * 2 - if uDef.metalcost then uDef.metalcost = uDef.metalcost * 1.5 end - if uDef.energycost then uDef.energycost = uDef.energycost * 1.5 end - if uDef.buildtime then uDef.buildtime = uDef.buildtime * 1.5 end + if uDef.metalcost then + uDef.metalcost = uDef.metalcost * 1.5 + end + if uDef.energycost then + uDef.energycost = uDef.energycost * 1.5 + end + if uDef.buildtime then + uDef.buildtime = uDef.buildtime * 1.5 + end end end @@ -187,17 +182,17 @@ local function scavUnitDef_Post(name, uDef) if uDef.metalstorage then uDef.metalstorage = uDef.metalstorage * 1.2 end - if (uDef.extractsmetal and uDef.extractsmetal > 0) then + if uDef.extractsmetal and uDef.extractsmetal > 0 then uDef.extractsmetal = uDef.extractsmetal * 1.2 end - if (uDef.customparams.metal_extractor and uDef.customparams.metal_extractor > 0) then + if uDef.customparams.metal_extractor and uDef.customparams.metal_extractor > 0 then uDef.customparams.metal_extractor = uDef.customparams.metal_extractor * 1.2 end if uDef.customparams.energyconv_capacity then uDef.customparams.energyconv_capacity = uDef.customparams.energyconv_capacity * 1.2 end if uDef.windgenerator then - uDef.windgenerator = uDef.windgenerator*1.1 + uDef.windgenerator = uDef.windgenerator * 1.1 if uDef.customparams.energymultiplier then uDef.customparams.energymultiplier = uDef.customparams.energymultiplier * 1.1 else @@ -205,9 +200,15 @@ local function scavUnitDef_Post(name, uDef) end end - if uDef.metalcost then uDef.metalcost = math.ceil(uDef.metalcost) end - if uDef.energycost then uDef.energycost = math.ceil(uDef.energycost) end - if uDef.buildtime then uDef.buildtime = math.ceil(uDef.buildtime) end + if uDef.metalcost then + uDef.metalcost = math.ceil(uDef.metalcost) + end + if uDef.energycost then + uDef.energycost = math.ceil(uDef.energycost) + end + if uDef.buildtime then + uDef.buildtime = math.ceil(uDef.buildtime) + end if uDef.featuredefs and uDef.health then -- wrecks @@ -227,319 +228,319 @@ local function scavUnitDef_Post(name, uDef) end -- Extra Units ---------------------------------------------------------------------------------------------------------------------------------- - -- Armada T1 Land Constructors - if name == "armca_scav" or name == "armck_scav" or name == "armcv_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Armada T1 Land Constructors + if name == "armca_scav" or name == "armck_scav" or name == "armcv_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Armada T1 Sea Constructors - if name == "armcs_scav" or name == "armcsa_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armgplat_scav" -- Gun Platform - Light Plasma Defense - uDef.buildoptions[numBuildoptions + 2] = "armfrock_scav" -- Scumbag - Anti Air Missile Battery - end + -- Armada T1 Sea Constructors + if name == "armcs_scav" or name == "armcsa_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armgplat_scav" -- Gun Platform - Light Plasma Defense + uDef.buildoptions[numBuildoptions + 2] = "armfrock_scav" -- Scumbag - Anti Air Missile Battery + end - -- Armada T1 Vehicle Factory - if name == "armvp_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armzapper_scav" -- Zapper - Light EMP Vehicle - end + -- Armada T1 Vehicle Factory + if name == "armvp_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armzapper_scav" -- Zapper - Light EMP Vehicle + end - -- Armada T1 Aircraft Plant - if name == "armap_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armfify_scav" -- Firefly - Resurrection Aircraft - end + -- Armada T1 Aircraft Plant + if name == "armap_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armfify_scav" -- Firefly - Resurrection Aircraft + end - -- Armada T2 Land Constructors - if name == "armaca_scav" or name == "armack_scav" or name == "armacv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armshockwave_scav" -- Shockwave - T2 EMP Armed Metal Extractor - uDef.buildoptions[numBuildoptions + 2] = "armwint2_scav" -- T2 Wind Generator - uDef.buildoptions[numBuildoptions + 3] = "armnanotct2_scav" -- T2 Constructor Turret - uDef.buildoptions[numBuildoptions + 4] = "armlwall_scav" -- Dragon's Fury - T2 Pop-up Wall Turret - uDef.buildoptions[numBuildoptions + 5] = "armgatet3_scav" -- Asylum - Advanced Shield Generator - end + -- Armada T2 Land Constructors + if name == "armaca_scav" or name == "armack_scav" or name == "armacv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armshockwave_scav" -- Shockwave - T2 EMP Armed Metal Extractor + uDef.buildoptions[numBuildoptions + 2] = "armwint2_scav" -- T2 Wind Generator + uDef.buildoptions[numBuildoptions + 3] = "armnanotct2_scav" -- T2 Constructor Turret + uDef.buildoptions[numBuildoptions + 4] = "armlwall_scav" -- Dragon's Fury - T2 Pop-up Wall Turret + uDef.buildoptions[numBuildoptions + 5] = "armgatet3_scav" -- Asylum - Advanced Shield Generator + end - -- Armada T2 Sea Constructors - if name == "armacsub_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armfgate_scav" -- Aurora - Floating Plasma Deflector - uDef.buildoptions[numBuildoptions + 2] = "armnanotc2plat_scav" -- Floating T2 Constructor Turret - end + -- Armada T2 Sea Constructors + if name == "armacsub_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armfgate_scav" -- Aurora - Floating Plasma Deflector + uDef.buildoptions[numBuildoptions + 2] = "armnanotc2plat_scav" -- Floating T2 Constructor Turret + end - -- Armada T2 Shipyard - if name == "armasy_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armexcalibur_scav" -- Excalibur - Coastal Assault Submarine - uDef.buildoptions[numBuildoptions + 2] = "armseadragon_scav" -- Seadragon - Nuclear ICBM Submarine - end + -- Armada T2 Shipyard + if name == "armasy_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armexcalibur_scav" -- Excalibur - Coastal Assault Submarine + uDef.buildoptions[numBuildoptions + 2] = "armseadragon_scav" -- Seadragon - Nuclear ICBM Submarine + end - -- Armada T3 Gantry - if name == "armshltx_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armmeatball_scav" -- Meatball - Amphibious Assault Mech - uDef.buildoptions[numBuildoptions + 2] = "armassimilator_scav" -- Assimilator - Battle Mech - end + -- Armada T3 Gantry + if name == "armshltx_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armmeatball_scav" -- Meatball - Amphibious Assault Mech + uDef.buildoptions[numBuildoptions + 2] = "armassimilator_scav" -- Assimilator - Battle Mech + end - -- Armada T3 Underwater Gantry - if name == "armshltxuw_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armmeatball_scav" -- Meatball - Amphibious Assault Mech - uDef.buildoptions[numBuildoptions + 2] = "armassimilator_scav" -- Assimilator - Battle Mech - end + -- Armada T3 Underwater Gantry + if name == "armshltxuw_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armmeatball_scav" -- Meatball - Amphibious Assault Mech + uDef.buildoptions[numBuildoptions + 2] = "armassimilator_scav" -- Assimilator - Battle Mech + end - -- Cortex T1 Land Constructors - if name == "corca_scav" or name == "corck_scav" or name == "corcv_scav" then - local numBuildoptions = #uDef.buildoptions - end - - -- Cortex T1 Sea Constructors - if name == "corcs_scav" or name == "corcsa_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corgplat_scav" -- Gun Platform - Light Plasma Defense - uDef.buildoptions[numBuildoptions + 2] = "corfrock_scav" -- Janitor - Anti Air Missile Battery - end + -- Cortex T1 Land Constructors + if name == "corca_scav" or name == "corck_scav" or name == "corcv_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Cortex T1 Bots Factory - if name == "corlab_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T1 Sea Constructors + if name == "corcs_scav" or name == "corcsa_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corgplat_scav" -- Gun Platform - Light Plasma Defense + uDef.buildoptions[numBuildoptions + 2] = "corfrock_scav" -- Janitor - Anti Air Missile Battery + end - -- Cortex T2 Land Constructors - if name == "coraca_scav" or name == "corack_scav" or name == "coracv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corwint2_scav" -- T2 Wind Generator - uDef.buildoptions[numBuildoptions + 2] = "cornanotct2_scav" -- T2 Constructor Turret - uDef.buildoptions[numBuildoptions + 3] = "cormwall_scav" -- Dragon's Rage - T2 Pop-up Wall Turret - uDef.buildoptions[numBuildoptions + 4] = "corgatet3_scav" -- Sanctuary - Advanced Shield Generator - end + -- Cortex T1 Bots Factory + if name == "corlab_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Cortex T2 Sea Constructors - if name == "coracsub_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corfgate_scav" -- Atoll - Floating Plasma Deflector - uDef.buildoptions[numBuildoptions + 2] = "cornanotc2plat_scav" -- Floating T2 Constructor Turret - end + -- Cortex T2 Land Constructors + if name == "coraca_scav" or name == "corack_scav" or name == "coracv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corwint2_scav" -- T2 Wind Generator + uDef.buildoptions[numBuildoptions + 2] = "cornanotct2_scav" -- T2 Constructor Turret + uDef.buildoptions[numBuildoptions + 3] = "cormwall_scav" -- Dragon's Rage - T2 Pop-up Wall Turret + uDef.buildoptions[numBuildoptions + 4] = "corgatet3_scav" -- Sanctuary - Advanced Shield Generator + end - -- Cortex T2 Bots Factory - if name == "coralab_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions+1] = "cordeadeye_scav" - end + -- Cortex T2 Sea Constructors + if name == "coracsub_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corfgate_scav" -- Atoll - Floating Plasma Deflector + uDef.buildoptions[numBuildoptions + 2] = "cornanotc2plat_scav" -- Floating T2 Constructor Turret + end - -- Cortex T2 Vehicle Factory - if name == "coravp_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corvac_scav" -- Printer - Armored Field Engineer - uDef.buildoptions[numBuildoptions + 2] = "corphantom_scav" -- Phantom - Amphibious Stealth Scout - uDef.buildoptions[numBuildoptions + 3] = "corsiegebreaker_scav" -- Siegebreaker - Heavy Long Range Destroyer - uDef.buildoptions[numBuildoptions + 4] = "corforge_scav" -- Forge - Flamethrower Combat Engineer - uDef.buildoptions[numBuildoptions + 5] = "cortorch_scav" -- Torch - Fast Flamethrower Tank - end + -- Cortex T2 Bots Factory + if name == "coralab_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "cordeadeye_scav" + end - -- Cortex T2 Aircraft Plant - if name == "coraap_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T2 Vehicle Factory + if name == "coravp_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corvac_scav" -- Printer - Armored Field Engineer + uDef.buildoptions[numBuildoptions + 2] = "corphantom_scav" -- Phantom - Amphibious Stealth Scout + uDef.buildoptions[numBuildoptions + 3] = "corsiegebreaker_scav" -- Siegebreaker - Heavy Long Range Destroyer + uDef.buildoptions[numBuildoptions + 4] = "corforge_scav" -- Forge - Flamethrower Combat Engineer + uDef.buildoptions[numBuildoptions + 5] = "cortorch_scav" -- Torch - Fast Flamethrower Tank + end - -- Cortex T2 Shipyard - if name == "corasy_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "coresuppt3_scav" -- Adjudictator - Ultra Heavy Heatray Battleship - uDef.buildoptions[numBuildoptions + 2] = "coronager_scav" -- Onager - Coastal Assault Submarine - uDef.buildoptions[numBuildoptions + 3] = "cordesolator_scav" -- Desolator - Nuclear ICBM Submarine - uDef.buildoptions[numBuildoptions + 4] = "CorPrince_scav" -- Black Prince - Shore bombardment battleship - end + -- Cortex T2 Aircraft Plant + if name == "coraap_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Cortex T3 Gantry - if name == "corgant_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T2 Shipyard + if name == "corasy_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "coresuppt3_scav" -- Adjudictator - Ultra Heavy Heatray Battleship + uDef.buildoptions[numBuildoptions + 2] = "coronager_scav" -- Onager - Coastal Assault Submarine + uDef.buildoptions[numBuildoptions + 3] = "cordesolator_scav" -- Desolator - Nuclear ICBM Submarine + uDef.buildoptions[numBuildoptions + 4] = "CorPrince_scav" -- Black Prince - Shore bombardment battleship + end - -- Cortex T3 Underwater Gantry - if name == "corgantuw_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T3 Gantry + if name == "corgant_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Legion T1 Land Constructors - if name == "legca_scav" or name == "legck_scav" or name == "legcv_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T3 Underwater Gantry + if name == "corgantuw_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Legion T2 Land Constructors - if name == "legaca_scav" or name == "legack_scav" or name == "legacv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "legmohocon_scav" -- Advanced Metal Fortifier - Metal Extractor with Constructor Turret - uDef.buildoptions[numBuildoptions + 2] = "legwint2_scav" -- T2 Wind Generator - uDef.buildoptions[numBuildoptions + 3] = "legnanotct2_scav" -- T2 Constructor Turret - uDef.buildoptions[numBuildoptions + 4] = "legrwall_scav" -- Dragon's Constitution - T2 (not Pop-up) Wall Turret - uDef.buildoptions[numBuildoptions + 5] = "leggatet3_scav" -- Elysium - Advanced Shield Generator - end + -- Legion T1 Land Constructors + if name == "legca_scav" or name == "legck_scav" or name == "legcv_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Legion T2 Sea Constructors - if name == "leganavyconsub_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corfgate_scav" - uDef.buildoptions[numBuildoptions + 2] = "legnanotct2plat_scav" - end + -- Legion T2 Land Constructors + if name == "legaca_scav" or name == "legack_scav" or name == "legacv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "legmohocon_scav" -- Advanced Metal Fortifier - Metal Extractor with Constructor Turret + uDef.buildoptions[numBuildoptions + 2] = "legwint2_scav" -- T2 Wind Generator + uDef.buildoptions[numBuildoptions + 3] = "legnanotct2_scav" -- T2 Constructor Turret + uDef.buildoptions[numBuildoptions + 4] = "legrwall_scav" -- Dragon's Constitution - T2 (not Pop-up) Wall Turret + uDef.buildoptions[numBuildoptions + 5] = "leggatet3_scav" -- Elysium - Advanced Shield Generator + end - -- Legion T3 Gantry - if name == "leggant_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "legbunk_scav" -- Pilum - Fast Assault Mech - end + -- Legion T2 Sea Constructors + if name == "leganavyconsub_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corfgate_scav" + uDef.buildoptions[numBuildoptions + 2] = "legnanotct2plat_scav" + end + + -- Legion T3 Gantry + if name == "leggant_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "legbunk_scav" -- Pilum - Fast Assault Mech + end -- Scavengers Units ------------------------------------------------------------------------------------------------------------------------ - -- Armada T1 Land Constructors - if name == "armca_scav" or name == "armck_scav" or name == "armcv_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Armada T1 Land Constructors + if name == "armca_scav" or name == "armck_scav" or name == "armcv_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Armada T1 Sea Constructors - if name == "armcs_scav" or name == "armcsa_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Armada T1 Sea Constructors + if name == "armcs_scav" or name == "armcsa_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Armada T1 Vehicle Factory - if name == "armvp_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Armada T1 Vehicle Factory + if name == "armvp_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Armada T1 Aircraft Plant - if name == "armap_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Armada T1 Aircraft Plant + if name == "armap_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Armada T2 Constructors - if name == "armaca_scav" or name == "armack_scav" or name == "armacv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armapt3_scav" -- T3 Aircraft Gantry - uDef.buildoptions[numBuildoptions + 2] = "armminivulc_scav" -- Mini Ragnarok - uDef.buildoptions[numBuildoptions + 3] = "armbotrail_scav" -- Pawn Launcher - uDef.buildoptions[numBuildoptions + 4] = "armannit3_scav" -- Epic Pulsar - uDef.buildoptions[numBuildoptions + 5] = "armafust3_scav" -- Epic Fusion Reactor - uDef.buildoptions[numBuildoptions + 6] = "armmmkrt3_scav" -- Epic Energy Converter - end + -- Armada T2 Constructors + if name == "armaca_scav" or name == "armack_scav" or name == "armacv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armapt3_scav" -- T3 Aircraft Gantry + uDef.buildoptions[numBuildoptions + 2] = "armminivulc_scav" -- Mini Ragnarok + uDef.buildoptions[numBuildoptions + 3] = "armbotrail_scav" -- Pawn Launcher + uDef.buildoptions[numBuildoptions + 4] = "armannit3_scav" -- Epic Pulsar + uDef.buildoptions[numBuildoptions + 5] = "armafust3_scav" -- Epic Fusion Reactor + uDef.buildoptions[numBuildoptions + 6] = "armmmkrt3_scav" -- Epic Energy Converter + end - -- Armada T2 Shipyard - if name == "armasy_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armdronecarry_scav" -- Nexus - Drone Carrier - uDef.buildoptions[numBuildoptions + 2] = "armptt2_scav" -- Epic Skater - uDef.buildoptions[numBuildoptions + 3] = "armdecadet3_scav" -- Epic Dolphin - uDef.buildoptions[numBuildoptions + 4] = "armpshipt3_scav" -- Epic Ellysaw - uDef.buildoptions[numBuildoptions + 5] = "armserpt3_scav" -- Epic Serpent - uDef.buildoptions[numBuildoptions + 6] = "armtrident_scav" -- Trident - Depth Charge Drone Carrier - end + -- Armada T2 Shipyard + if name == "armasy_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armdronecarry_scav" -- Nexus - Drone Carrier + uDef.buildoptions[numBuildoptions + 2] = "armptt2_scav" -- Epic Skater + uDef.buildoptions[numBuildoptions + 3] = "armdecadet3_scav" -- Epic Dolphin + uDef.buildoptions[numBuildoptions + 4] = "armpshipt3_scav" -- Epic Ellysaw + uDef.buildoptions[numBuildoptions + 5] = "armserpt3_scav" -- Epic Serpent + uDef.buildoptions[numBuildoptions + 6] = "armtrident_scav" -- Trident - Depth Charge Drone Carrier + end - -- Armada T3 Gantry - if name == "armshltx_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armrattet4_scav" -- Ratte - Very Heavy Tank - uDef.buildoptions[numBuildoptions + 2] = "armsptkt4_scav" -- Epic Recluse - uDef.buildoptions[numBuildoptions + 3] = "armpwt4_scav" -- Epic Pawn - uDef.buildoptions[numBuildoptions + 4] = "armvadert4_scav" -- Epic Tumbleweed - Nuclear Rolling Bomb - uDef.buildoptions[numBuildoptions + 5] = "armdronecarryland_scav" -- Nexus Terra - Drone Carrier - end + -- Armada T3 Gantry + if name == "armshltx_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armrattet4_scav" -- Ratte - Very Heavy Tank + uDef.buildoptions[numBuildoptions + 2] = "armsptkt4_scav" -- Epic Recluse + uDef.buildoptions[numBuildoptions + 3] = "armpwt4_scav" -- Epic Pawn + uDef.buildoptions[numBuildoptions + 4] = "armvadert4_scav" -- Epic Tumbleweed - Nuclear Rolling Bomb + uDef.buildoptions[numBuildoptions + 5] = "armdronecarryland_scav" -- Nexus Terra - Drone Carrier + end - -- Armada T3 Underwater Gantry - if name == "armshltxuw_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "armrattet4_scav" -- Ratte - Very Heavy Tank - uDef.buildoptions[numBuildoptions + 2] = "armsptkt4_scav" -- Epic Recluse - uDef.buildoptions[numBuildoptions + 3] = "armpwt4_scav" -- Epic Pawn - uDef.buildoptions[numBuildoptions + 4] = "armvadert4_scav" -- Epic Tumbleweed - Nuclear Rolling Bomb - end + -- Armada T3 Underwater Gantry + if name == "armshltxuw_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "armrattet4_scav" -- Ratte - Very Heavy Tank + uDef.buildoptions[numBuildoptions + 2] = "armsptkt4_scav" -- Epic Recluse + uDef.buildoptions[numBuildoptions + 3] = "armpwt4_scav" -- Epic Pawn + uDef.buildoptions[numBuildoptions + 4] = "armvadert4_scav" -- Epic Tumbleweed - Nuclear Rolling Bomb + end - -- Cortex T1 Bots Factory - if name == "corlab_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions+1] = "corkark_scav" -- Archaic Karkinos - end + -- Cortex T1 Bots Factory + if name == "corlab_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corkark_scav" -- Archaic Karkinos + end - -- Cortex T2 Land Constructors - if name == "coraca_scav" or name == "corack_scav" or name == "coracv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corapt3_scav" -- T3 Aircraft Gantry - uDef.buildoptions[numBuildoptions + 2] = "corminibuzz_scav" -- Mini Calamity - uDef.buildoptions[numBuildoptions + 3] = "corhllllt_scav" -- Quad Guard - Quad Light Laser Turret - uDef.buildoptions[numBuildoptions + 4] = "cordoomt3_scav" -- Epic Bulwark - uDef.buildoptions[numBuildoptions + 5] = "corafust3_scav" -- Epic Fusion Reactor - uDef.buildoptions[numBuildoptions + 6] = "cormmkrt3_scav" -- Epic Energy Converter - end + -- Cortex T2 Land Constructors + if name == "coraca_scav" or name == "corack_scav" or name == "coracv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corapt3_scav" -- T3 Aircraft Gantry + uDef.buildoptions[numBuildoptions + 2] = "corminibuzz_scav" -- Mini Calamity + uDef.buildoptions[numBuildoptions + 3] = "corhllllt_scav" -- Quad Guard - Quad Light Laser Turret + uDef.buildoptions[numBuildoptions + 4] = "cordoomt3_scav" -- Epic Bulwark + uDef.buildoptions[numBuildoptions + 5] = "corafust3_scav" -- Epic Fusion Reactor + uDef.buildoptions[numBuildoptions + 6] = "cormmkrt3_scav" -- Epic Energy Converter + end - -- Cortex T2 Sea Constructors - if name == "coracsub_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T2 Sea Constructors + if name == "coracsub_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Cortex T2 Bots Factory - if name == "coralab_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Cortex T2 Bots Factory + if name == "coralab_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Cortex T2 Vehicle Factory - if name == "coravp_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions+1] = "corgatreap_scav" -- Laser Tiger - uDef.buildoptions[numBuildoptions+2] = "corftiger_scav" -- Heat Tiger - end + -- Cortex T2 Vehicle Factory + if name == "coravp_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corgatreap_scav" -- Laser Tiger + uDef.buildoptions[numBuildoptions + 2] = "corftiger_scav" -- Heat Tiger + end - -- Cortex T2 Aircraft Plant - if name == "coraap_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions+1] = "corcrw_scav" -- Archaic Dragon - end + -- Cortex T2 Aircraft Plant + if name == "coraap_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corcrw_scav" -- Archaic Dragon + end - -- Cortex T2 Shipyard - if name == "corasy_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "cordronecarry_scav" -- Dispenser - Drone Carrier - uDef.buildoptions[numBuildoptions + 2] = "corslrpc_scav" -- Leviathan - LRPC Ship - uDef.buildoptions[numBuildoptions + 3] = "corsentinel_scav" -- Sentinel - Depth Charge Drone Carrier - end + -- Cortex T2 Shipyard + if name == "corasy_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "cordronecarry_scav" -- Dispenser - Drone Carrier + uDef.buildoptions[numBuildoptions + 2] = "corslrpc_scav" -- Leviathan - LRPC Ship + uDef.buildoptions[numBuildoptions + 3] = "corsentinel_scav" -- Sentinel - Depth Charge Drone Carrier + end - -- Cortex T3 Gantry - if name == "corgant_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corkarganetht4_scav" -- Epic Karganeth - uDef.buildoptions[numBuildoptions + 2] = "corves_scav" -- Vesuvius - uDef.buildoptions[numBuildoptions + 3] = "corakt4_scav" -- Epic Grunt - uDef.buildoptions[numBuildoptions + 4] = "corthermite_scav" -- Thermite/Epic Termite - uDef.buildoptions[numBuildoptions + 5] = "cormandot4_scav" -- Epic Commando - end + -- Cortex T3 Gantry + if name == "corgant_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corkarganetht4_scav" -- Epic Karganeth + uDef.buildoptions[numBuildoptions + 2] = "corves_scav" -- Vesuvius + uDef.buildoptions[numBuildoptions + 3] = "corakt4_scav" -- Epic Grunt + uDef.buildoptions[numBuildoptions + 4] = "corthermite_scav" -- Thermite/Epic Termite + uDef.buildoptions[numBuildoptions + 5] = "cormandot4_scav" -- Epic Commando + end - -- Cortex T3 Underwater Gantry - if name == "corgantuw_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "corkarganetht4_scav" -- Epic Karganeth - uDef.buildoptions[numBuildoptions + 2] = "corves_scav" -- Vesuvius - uDef.buildoptions[numBuildoptions + 3] = "corakt4_scav" -- Epic Grunt - uDef.buildoptions[numBuildoptions + 4] = "cormandot4_scav" -- Epic Commando - end + -- Cortex T3 Underwater Gantry + if name == "corgantuw_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "corkarganetht4_scav" -- Epic Karganeth + uDef.buildoptions[numBuildoptions + 2] = "corves_scav" -- Vesuvius + uDef.buildoptions[numBuildoptions + 3] = "corakt4_scav" -- Epic Grunt + uDef.buildoptions[numBuildoptions + 4] = "cormandot4_scav" -- Epic Commando + end - -- Legion T1 Land Constructors - if name == "legca_scav" or name == "legck_scav" or name == "legcv_scav" then - local numBuildoptions = #uDef.buildoptions - end + -- Legion T1 Land Constructors + if name == "legca_scav" or name == "legck_scav" or name == "legcv_scav" then + local numBuildoptions = #uDef.buildoptions + end - -- Legion T2 Land Constructors - if name == "legaca_scav" or name == "legack_scav" or name == "legacv_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "legapt3_scav" -- T3 Aircraft Gantry - uDef.buildoptions[numBuildoptions + 2] = "legministarfall_scav" -- Mini Starfall - uDef.buildoptions[numBuildoptions + 3] = "legafust3_scav" -- Epic Fusion Reactor - uDef.buildoptions[numBuildoptions + 4] = "legadveconvt3_scav" -- Epic Energy Converter - end + -- Legion T2 Land Constructors + if name == "legaca_scav" or name == "legack_scav" or name == "legacv_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "legapt3_scav" -- T3 Aircraft Gantry + uDef.buildoptions[numBuildoptions + 2] = "legministarfall_scav" -- Mini Starfall + uDef.buildoptions[numBuildoptions + 3] = "legafust3_scav" -- Epic Fusion Reactor + uDef.buildoptions[numBuildoptions + 4] = "legadveconvt3_scav" -- Epic Energy Converter + end - -- Legion T3 Gantry - if name == "leggant_scav" then - local numBuildoptions = #uDef.buildoptions - uDef.buildoptions[numBuildoptions + 1] = "legsrailt4_scav" -- Epic Arquebus - uDef.buildoptions[numBuildoptions + 2] = "leggobt3_scav" -- Epic Goblin - uDef.buildoptions[numBuildoptions + 3] = "legpede_scav" -- Mukade - Heavy Multi Weapon Centipede - end + -- Legion T3 Gantry + if name == "leggant_scav" then + local numBuildoptions = #uDef.buildoptions + uDef.buildoptions[numBuildoptions + 1] = "legsrailt4_scav" -- Epic Arquebus + uDef.buildoptions[numBuildoptions + 2] = "leggobt3_scav" -- Epic Goblin + uDef.buildoptions[numBuildoptions + 3] = "legpede_scav" -- Mukade - Heavy Multi Weapon Centipede + end -- Release candidate units -------------------------------------------------------------------------------------------------------------------------------------------------------- -- there's nothing here! @@ -549,5 +550,5 @@ local function scavUnitDef_Post(name, uDef) end return { - ScavUnitDef_Post = scavUnitDef_Post + ScavUnitDef_Post = scavUnitDef_Post, } diff --git a/gamedata/scavengers/weapondef_post.lua b/gamedata/scavengers/weapondef_post.lua index 63964f4de3d..565858dde0f 100644 --- a/gamedata/scavengers/weapondef_post.lua +++ b/gamedata/scavengers/weapondef_post.lua @@ -1,75 +1,79 @@ -- this file gets included in alldefs_post.lua local function convertToPurple(value) - value = string.gsub(value, '-red', '-purple') - value = string.gsub(value, '-green', '-purple') - value = string.gsub(value, '-blue', '-purple') - value = string.gsub(value, '-yellow', '-purple') - return value + value = string.gsub(value, "-red", "-purple") + value = string.gsub(value, "-green", "-purple") + value = string.gsub(value, "-blue", "-purple") + value = string.gsub(value, "-yellow", "-purple") + return value end local function scavWeaponDefPost(name, wDef) - if not wDef.customparams then wDef.customparams = {} end - if wDef.commandfire and (not wDef.customparams.scavforcecommandfire) then wDef.commandfire = false end - --wDef.metalpershot = 0 - --wDef.energypershot = 0 - if wDef.weapontype == "Cannon" then - wDef.rgbcolor = { 0.96, 0.42, 1 } - --if wDef.intensity then - -- wDef.intensity = math.ceil(wDef.intensity*2.5) - --end - --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode - if wDef.explosiongenerator then - if string.find(wDef.explosiongenerator, 'genericshellexplosion') or string.find(wDef.explosiongenerator, 'expldgun') then - wDef.explosiongenerator = wDef.explosiongenerator .. '-purple' - end - end - if wDef.cegtag and string.find(wDef.cegtag, '^arty-') then - wDef.cegtag = wDef.cegtag .. '-purple' - end - elseif wDef.weapontype == "MissileLauncher" or wDef.weapontype == "StarburstLauncher" then - if wDef.explosiongenerator then - if string.find(wDef.explosiongenerator, 'genericshellexplosion') or string.find(wDef.explosiongenerator, 'expldgun') then - wDef.explosiongenerator = wDef.explosiongenerator .. '-purple' - end - end - if wDef.cegtag and string.find(wDef.cegtag, 'missiletrail') then - wDef.cegtag = wDef.cegtag .. '-purple' - end - elseif wDef.weapontype == "LightningCannon" then - wDef.rgbcolor = { 0.95, 0.32, 1 } - --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode - --wDef.explosiongenerator = "custom:genericshellexplosion-medium-lightning2-purple" - elseif wDef.weapontype == "BeamLaser" or wDef.weapontype == "LaserCannon" or wDef.weapontype == "DGun" then - wDef.rgbcolor = { 0.95, 0.32, 1 } - --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode - wDef.rgbcolor2 = { 1, 0.8, 1 } - wDef.explosiongenerator = convertToPurple(wDef.explosiongenerator) - end - -- make lighting purple (sort of: by switching around the rgb values) - if wDef.customparams then - for k, v in pairs(wDef.customparams) do - if type(v) == 'string' and string.find(k, 'light_color') then - local colors = string.split(v, ' ') - if colors[1] and colors[3] and colors[1] == '1' then - wDef.customparams[k] = colors[2] .. ' ' .. colors[3] .. ' ' .. colors[1] - end - end - end - if wDef.customparams.carried_unit and (not string.find(wDef.customparams.carried_unit, "_scav")) then - wDef.customparams.carried_unit = wDef.customparams.carried_unit .. "_scav" - if not wDef.customparams.spawnrate then - wDef.customparams.spawnrate = 10 - end - end - if wDef.customparams.spawns_name and (not string.find(wDef.customparams.spawns_name, "_scav")) then - local spawnNames = string.split(wDef.customparams.spawns_name) - wDef.customparams.spawns_name = "" - for _, spawnName in pairs(spawnNames) do - wDef.customparams.spawns_name = wDef.customparams.spawns_name .. spawnName .. "_scav" .. " " - end - end - end - return wDef + if not wDef.customparams then + wDef.customparams = {} + end + if wDef.commandfire and not wDef.customparams.scavforcecommandfire then + wDef.commandfire = false + end + --wDef.metalpershot = 0 + --wDef.energypershot = 0 + if wDef.weapontype == "Cannon" then + wDef.rgbcolor = { 0.96, 0.42, 1 } + --if wDef.intensity then + -- wDef.intensity = math.ceil(wDef.intensity*2.5) + --end + --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode + if wDef.explosiongenerator then + if string.find(wDef.explosiongenerator, "genericshellexplosion") or string.find(wDef.explosiongenerator, "expldgun") then + wDef.explosiongenerator = wDef.explosiongenerator .. "-purple" + end + end + if wDef.cegtag and string.find(wDef.cegtag, "^arty-") then + wDef.cegtag = wDef.cegtag .. "-purple" + end + elseif wDef.weapontype == "MissileLauncher" or wDef.weapontype == "StarburstLauncher" then + if wDef.explosiongenerator then + if string.find(wDef.explosiongenerator, "genericshellexplosion") or string.find(wDef.explosiongenerator, "expldgun") then + wDef.explosiongenerator = wDef.explosiongenerator .. "-purple" + end + end + if wDef.cegtag and string.find(wDef.cegtag, "missiletrail") then + wDef.cegtag = wDef.cegtag .. "-purple" + end + elseif wDef.weapontype == "LightningCannon" then + wDef.rgbcolor = { 0.95, 0.32, 1 } + --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode + --wDef.explosiongenerator = "custom:genericshellexplosion-medium-lightning2-purple" + elseif wDef.weapontype == "BeamLaser" or wDef.weapontype == "LaserCannon" or wDef.weapontype == "DGun" then + wDef.rgbcolor = { 0.95, 0.32, 1 } + --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode + wDef.rgbcolor2 = { 1, 0.8, 1 } + wDef.explosiongenerator = convertToPurple(wDef.explosiongenerator) + end + -- make lighting purple (sort of: by switching around the rgb values) + if wDef.customparams then + for k, v in pairs(wDef.customparams) do + if type(v) == "string" and string.find(k, "light_color") then + local colors = string.split(v, " ") + if colors[1] and colors[3] and colors[1] == "1" then + wDef.customparams[k] = colors[2] .. " " .. colors[3] .. " " .. colors[1] + end + end + end + if wDef.customparams.carried_unit and (not string.find(wDef.customparams.carried_unit, "_scav")) then + wDef.customparams.carried_unit = wDef.customparams.carried_unit .. "_scav" + if not wDef.customparams.spawnrate then + wDef.customparams.spawnrate = 10 + end + end + if wDef.customparams.spawns_name and (not string.find(wDef.customparams.spawns_name, "_scav")) then + local spawnNames = string.split(wDef.customparams.spawns_name) + wDef.customparams.spawns_name = "" + for _, spawnName in pairs(spawnNames) do + wDef.customparams.spawns_name = wDef.customparams.spawns_name .. spawnName .. "_scav" .. " " + end + end + end + return wDef end return { diff --git a/gamedata/sidedata.lua b/gamedata/sidedata.lua index 4397244c50a..c97833c03a3 100644 --- a/gamedata/sidedata.lua +++ b/gamedata/sidedata.lua @@ -3,29 +3,29 @@ local SIDES = VFS.Include("gamedata/sides_enum.lua") if not SIDES then - error("[Sidedata] Failed to load sides_enum.lua!") + error("[Sidedata] Failed to load sides_enum.lua!") end -- NOTE: Don't change the ordering here until -- chobby fixed to accept arbitrary ordering, otherwise -- AI will crash. local sideOptions = { - { - name = "Armada", - startunit = SIDES.ARMADA .. 'com', - }, - { - name = "Cortex", - startunit = SIDES.CORTEX .. 'com', - }, - { - name = "Random", - startunit = 'dummycom', - }, - { - name = "Legion", - startunit = SIDES.LEGION .. 'com', - }, + { + name = "Armada", + startunit = SIDES.ARMADA .. "com", + }, + { + name = "Cortex", + startunit = SIDES.CORTEX .. "com", + }, + { + name = "Random", + startunit = "dummycom", + }, + { + name = "Legion", + startunit = SIDES.LEGION .. "com", + }, } return sideOptions diff --git a/gamedata/sides_enum.lua b/gamedata/sides_enum.lua index b62c9f4a77a..13eb65ef1b9 100644 --- a/gamedata/sides_enum.lua +++ b/gamedata/sides_enum.lua @@ -8,9 +8,9 @@ ---@type SidesEnum local SIDES = { - ARMADA = "arm", - CORTEX = "cor", - LEGION = "leg", + ARMADA = "arm", + CORTEX = "cor", + LEGION = "leg", } -return SIDES \ No newline at end of file +return SIDES diff --git a/gamedata/sounds.lua b/gamedata/sounds.lua index d8788113348..ba3b06a173c 100644 --- a/gamedata/sounds.lua +++ b/gamedata/sounds.lua @@ -9,7 +9,7 @@ local Sounds = { in3d = "false", }, MapPoint = { - file = "sounds/ui/mappoint.wav", -- file now equal as blank.wav, is being called by chat ui widget now (so users can adjust its volume) + file = "sounds/ui/mappoint.wav", -- file now equal as blank.wav, is being called by chat ui widget now (so users can adjust its volume) --rolloff = 0.1, --dopplerscale = 0, in3d = "false", @@ -45,20 +45,20 @@ local Sounds = { ]] local soundData = { -- UI SOUNDS - ['ui'] = { + ["ui"] = { gain = 0.8, pitchmod = 0, - gainmod = 0, + gainmod = 0, dopplerscale = 0, maxconcurrent = 1, --priority = 1, rolloff = 0, }, - ['uw'] = { + ["uw"] = { gain = 1.2 * 0.3, pitchmod = 0.17, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 8, --priority = 1, @@ -99,47 +99,47 @@ local soundData = { ]] -- WEAPON SOUNDS - ['weapons'] = { + ["weapons"] = { gain = { default = 1.2 * 0.3, custom = { - ['^beamershot2$'] = 0.5 * 0.3, - ['^disigun1$'] = 0.075 * 0.3, + ["^beamershot2$"] = 0.5 * 0.3, + ["^disigun1$"] = 0.075 * 0.3, -- ['^newboom$'] = 0.045 * 0.3, - ['^xplomas2$'] = 0.225 * 0.3, - ['^starfallchargup$'] = 4.0 * 0.3, - ['^ministarfallchargup$'] = 4.0 * 0.3, + ["^xplomas2$"] = 0.225 * 0.3, + ["^starfallchargup$"] = 4.0 * 0.3, + ["^ministarfallchargup$"] = 4.0 * 0.3, }, }, pitchmod = { default = 0.17, custom = { - ['^heliosfire$'] = 0.03, - ['^beamershot2$'] = 0.04, - ['^lasfirerc$'] = 0.06, - ['^heatray'] = 0, - ['^lasr'] = 0, - ['^nanlath'] = 0.02, - ['^mavgun'] = 0.06, - ['^mgun'] = 0.08, - ['^minigun'] = 0.09, - ['^lrpcshot'] = 0.12, - ['^raptorlaser$'] = 0.04, - ['^heatray3'] = 0.04, - ['^xplosml'] = 0.22, - ['^xplomed'] = 0.25, - ['^xplolrg'] = 0.3, - ['^nukelaunch$'] = 0.08, - ['^nukelaunchalarm$'] = 0, - ['^starfallchargup$'] = 0, - ['^ministarfallchargup$'] = 0, + ["^heliosfire$"] = 0.03, + ["^beamershot2$"] = 0.04, + ["^lasfirerc$"] = 0.06, + ["^heatray"] = 0, + ["^lasr"] = 0, + ["^nanlath"] = 0.02, + ["^mavgun"] = 0.06, + ["^mgun"] = 0.08, + ["^minigun"] = 0.09, + ["^lrpcshot"] = 0.12, + ["^raptorlaser$"] = 0.04, + ["^heatray3"] = 0.04, + ["^xplosml"] = 0.22, + ["^xplomed"] = 0.25, + ["^xplolrg"] = 0.3, + ["^nukelaunch$"] = 0.08, + ["^nukelaunchalarm$"] = 0, + ["^starfallchargup$"] = 0, + ["^ministarfallchargup$"] = 0, }, }, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, maxconcurrent = { default = 7, custom = { - ['^minigun'] = 12, + ["^minigun"] = 12, }, }, dopplerscale = 1.0, @@ -147,61 +147,61 @@ local soundData = { }, -- WEAPON SOUNDS MULTI (more concurrent) - ['weapons-mult'] = { + ["weapons-mult"] = { gain = 1.2 * 0.3, pitchmod = { default = 0.17, custom = { - ['^lasr'] = 0.03, - ['^mgun'] = 0.02, + ["^lasr"] = 0.03, + ["^mgun"] = 0.02, }, }, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 1.0, maxconcurrent = 15, rolloff = 1.5, }, -- RAPTOR SOUNDS - ['raptors'] = { + ["raptors"] = { gain = 1.2 * 0.5, pitchmod = { default = 0.23, custom = { - ['^talonattack$'] = 0.07 + ["^talonattack$"] = 0.07, }, }, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 1.0, maxconcurrent = 6, rolloff = 1.1, }, -- GLOBAL EVENTS not in use currently - ['global-events'] = { + ["global-events"] = { gain = 1.0 * 0.3, pitchmod = 0.33, - gainmod = 0.1 * 0.3, + gainmod = 0.1 * 0.3, dopplerscale = 1.0, maxconcurrent = 8, rolloff = 0.2, }, -- BOMB SOUNDS / More maxconcurrent - ['bombs'] = { + ["bombs"] = { gain = 1.2 * 0.3, pitchmod = 0.27, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 1.0, maxconcurrent = 32, rolloff = 1.1, }, -- REPLY SOUNDS - ['replies'] = { + ["replies"] = { gain = 1.2 * 0.3, pitchmod = 0.02, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 32, rolloff = 0.05, @@ -210,10 +210,10 @@ local soundData = { }, -- LAND UNIT MOVEMENT SOUNDS - ['movement'] = { + ["movement"] = { gain = 1.2 * 0.3, pitchmod = 0.062, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 2, rolloff = 0.1, @@ -222,10 +222,10 @@ local soundData = { }, -- AIR UNIT MOVEMENT SOUNDS - ['movement-air'] = { + ["movement-air"] = { gain = 1.2 * 0.3, pitchmod = 0.02, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 2, rolloff = 0.1, @@ -234,10 +234,10 @@ local soundData = { }, -- UNIT FOOTSTEPS SOUNDS // high pitch-mod - ['unit'] = { + ["unit"] = { gain = 1.2 * 0.3, pitchmod = 0.33, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0.5, maxconcurrent = 6, rolloff = 1.1, @@ -246,10 +246,10 @@ local soundData = { }, -- UNIT MOVEMENT SOUNDS // local low pitch-mod - ['unit-local'] = { + ["unit-local"] = { gain = 1.2 * 0.5, pitchmod = 0.03, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 2, rolloff = 1.3, @@ -258,10 +258,10 @@ local soundData = { }, -- UNIT FUNCTION/WEAPON SOUNDS - ['function'] = { + ["function"] = { gain = 1.2 * 0.3, pitchmod = 0.02, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 7, rolloff = 0.1, @@ -270,10 +270,10 @@ local soundData = { }, -- BUILDING FUNCTION/WEAPON SOUNDS - ['buildings'] = { + ["buildings"] = { gain = 1.2 * 0.3, pitchmod = 0.03, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 2, rolloff = 0.1, @@ -282,10 +282,10 @@ local soundData = { }, -- UI COMMANDS SOUNDS - ['commands'] = { + ["commands"] = { gain = 1.2 * 0.3, pitchmod = 0.02, - gainmod = 0.2 * 0.3, + gainmod = 0.2 * 0.3, dopplerscale = 0, maxconcurrent = 32, rolloff = 0, @@ -294,16 +294,16 @@ local soundData = { }, -- CRITTER SOUNDS - ['critters'] = { + ["critters"] = { gain = 1.1 * 0.3, pitchmod = 0.01, - gainmod = 0.15 * 0.3, + gainmod = 0.15 * 0.3, dopplerscale = 1.0, maxconcurrent = 4, rolloff = 0.7, }, ---[[ + --[[ -- SCAVENGER SOUNDS not in use currently ['scavengers'] = { gain = 1.0 * 0.3, @@ -316,11 +316,11 @@ local soundData = { ]] -- AMBIENCE - ['atmos'] = { + ["atmos"] = { gain = 1.2 * 0.3, priority = -10, pitchmod = 0.22, - gainmod = 0, + gainmod = 0, dopplerscale = 8.0, maxconcurrent = 10, rolloff = 0.7, @@ -329,11 +329,11 @@ local soundData = { }, -- AMBIENCE LOCAL - ['atmos-local'] = { + ["atmos-local"] = { gain = 1.2 * 0.3, priority = -5, pitchmod = 0.22, - gainmod = 0, + gainmod = 0, dopplerscale = 4.0, maxconcurrent = 10, rolloff = 1.5, @@ -342,11 +342,11 @@ local soundData = { }, -- AMBIENCE GEOVENTS - ['atmos-geovents'] = { + ["atmos-geovents"] = { gain = 0.8, priority = -3, pitchmod = 0.06, - gainmod = 0, + gainmod = 0, dopplerscale = 2.0, maxconcurrent = 10, rolloff = 3, @@ -358,7 +358,7 @@ local function loadSoundFiles(directory, soundAttributes) local soundFiles = VFS.DirList(directory) for _, fileName in ipairs(soundFiles) do - local soundName = string.sub(fileName, string.len(directory) + 1, string.find(fileName, ".wav") -1) + local soundName = string.sub(fileName, string.len(directory) + 1, string.find(fileName, ".wav") - 1) Sounds.SoundItems[soundName] = {} Sounds.SoundItems[soundName].file = fileName @@ -382,7 +382,7 @@ local function loadSoundFiles(directory, soundAttributes) end for directory, attributes in pairs(soundData) do - loadSoundFiles('sounds/' .. directory .. '/', attributes) + loadSoundFiles("sounds/" .. directory .. "/", attributes) end return Sounds diff --git a/gamedata/soundsVoice.lua b/gamedata/soundsVoice.lua index a0c2a3d4c14..cca375768c0 100644 --- a/gamedata/soundsVoice.lua +++ b/gamedata/soundsVoice.lua @@ -1,10 +1,10 @@ -local Sounds = {SoundItems = {}} +local Sounds = { SoundItems = {} } --Special handling of Voice files -- We need to do this in separate file so the notifications widget can load the custom modded ones. local voiceAttributes = { gain = 1, pitchmod = 0, - gainmod = 0, + gainmod = 0, dopplerscale = 0, maxconcurrent = 1, priority = 1000, @@ -12,18 +12,18 @@ local voiceAttributes = { } local function handleVoiceSoundFile(file) -- Creates a sound item that has the same name as the full path, for compatibility with existing solutions - local eventName = string.gsub(file, "\\", "/") - if not Sounds.SoundItems[eventName] then - Sounds.SoundItems[eventName] = {} - Sounds.SoundItems[eventName].file = file - for attribute, attributeValue in pairs(voiceAttributes) do - Sounds.SoundItems[eventName][attribute] = attributeValue - end - --Spring.Echo(eventName) - --for attribute2, value in pairs(Sounds.SoundItems[file]) do - -- Spring.Echo("attribute", attribute2, "value", value) - --end - end + local eventName = string.gsub(file, "\\", "/") + if not Sounds.SoundItems[eventName] then + Sounds.SoundItems[eventName] = {} + Sounds.SoundItems[eventName].file = file + for attribute, attributeValue in pairs(voiceAttributes) do + Sounds.SoundItems[eventName][attribute] = attributeValue + end + --Spring.Echo(eventName) + --for attribute2, value in pairs(Sounds.SoundItems[file]) do + -- Spring.Echo("attribute", attribute2, "value", value) + --end + end end --local VoiceFilesLvl1Files = VFS.DirList("sounds/voice/") @@ -58,7 +58,7 @@ end local voiceSoundEffectsAttributes = { gain = 1, pitchmod = 0, - gainmod = 0, + gainmod = 0, dopplerscale = 0, maxconcurrent = 1, priority = 999, @@ -78,4 +78,4 @@ for _, file in pairs(VoiceSoundEffectFiles) do -- files in the voice-soundeffect --end end -return Sounds \ No newline at end of file +return Sounds diff --git a/gamedata/unitDefRenames.lua b/gamedata/unitDefRenames.lua index 604c163246d..0f93f1d586c 100644 --- a/gamedata/unitDefRenames.lua +++ b/gamedata/unitDefRenames.lua @@ -468,5 +468,5 @@ unitDefRenames = { corwin = "cortex_windturbine", corwint2 = "cortex_advancedwindturbine", corwolv = "cortex_wolverine", - correspawn = "cortex_basebuilder" + correspawn = "cortex_basebuilder", } diff --git a/gamedata/unitdefs.lua b/gamedata/unitdefs.lua index 12905872236..7447557f26b 100644 --- a/gamedata/unitdefs.lua +++ b/gamedata/unitdefs.lua @@ -14,12 +14,12 @@ local unitDefs = {} local shared = {} -- shared amongst the lua unitdef enviroments -local preProcFile = 'gamedata/unitdefs_pre.lua' -local postProcFile = 'gamedata/unitdefs_post.lua' +local preProcFile = "gamedata/unitdefs_pre.lua" +local postProcFile = "gamedata/unitdefs_post.lua" -local system = VFS.Include('gamedata/system.lua') +local system = VFS.Include("gamedata/system.lua") -local section = 'unitdefs.lua' +local section = "unitdefs.lua" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -28,14 +28,13 @@ local section = 'unitdefs.lua' -- if VFS.FileExists(preProcFile) then - Shared = shared -- make it global - UnitDefs = unitDefs -- make it global + Shared = shared -- make it global + UnitDefs = unitDefs -- make it global VFS.Include(preProcFile) UnitDefs = nil - Shared = nil + Shared = nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -43,7 +42,7 @@ end -- (these will override the SWU versions) -- -local luaFiles = VFS.DirList('units/', '*.lua', nil, true) +local luaFiles = VFS.DirList("units/", "*.lua", nil, true) local legionEnabled = Spring.GetModOptions().experimentallegionfaction local scavengersEnabled = Spring.Utilities.Gametype.IsScavengers() @@ -75,27 +74,27 @@ if Spring.GetModOptions().forceallunits then end for _, filename in ipairs(luaFiles) do - local loadFile = (legionEnabled or not filename:find('legion')) - and (scavengersEnabled or not filename:find('scavengers')) - and (raptorsEnabled or not filename:find('raptors')) + local loadFile = (legionEnabled or not filename:find("legion")) and (scavengersEnabled or not filename:find("scavengers")) and (raptorsEnabled or not filename:find("raptors")) if loadFile then local unitDefsEnv = {} unitDefsEnv._G = unitDefsEnv unitDefsEnv.Shared = shared - unitDefsEnv.GetFilename = function() return filename end + unitDefsEnv.GetFilename = function() + return filename + end setmetatable(unitDefsEnv, { __index = system }) local success, defs = pcall(VFS.Include, filename, unitDefsEnv, VFS_MODES) if not success then - Spring.Log(section, LOG.ERROR, 'Error parsing ' .. filename .. ': ' .. tostring(defs)) - elseif type(defs) ~= 'table' then - Spring.Log(section, LOG.ERROR, 'Bad return table from: ' .. filename) + Spring.Log(section, LOG.ERROR, "Error parsing " .. filename .. ": " .. tostring(defs)) + elseif type(defs) ~= "table" then + Spring.Log(section, LOG.ERROR, "Bad return table from: " .. filename) else for unitDefName, unitDef in pairs(defs) do - if ((type(unitDefName) == 'string') and (type(unitDef) == 'table')) then + if (type(unitDefName) == "string") and (type(unitDef) == "table") then unitDefs[unitDefName] = unitDef else - Spring.Log(section, LOG.ERROR, 'Bad return table entry from: ' .. filename) + Spring.Log(section, LOG.ERROR, "Bad return table entry from: " .. filename) end end end @@ -109,11 +108,11 @@ end -- if VFS.FileExists(postProcFile) then - Shared = shared -- make it global - UnitDefs = unitDefs -- make it global + Shared = shared -- make it global + UnitDefs = unitDefs -- make it global VFS.Include(postProcFile) UnitDefs = nil - Shared = nil + Shared = nil end -------------------------------------------------------------------------------- @@ -126,12 +125,12 @@ for name, def in pairs(unitDefs) do local model = def.objectname if model == nil then unitDefs[name] = nil - Spring.Log(section, LOG.ERROR, 'removed ' .. name .. ' unitDef, missing objectname param') + Spring.Log(section, LOG.ERROR, "removed " .. name .. " unitDef, missing objectname param") else - local objfile = 'objects3d/' .. model + local objfile = "objects3d/" .. model if not VFS.FileExists(objfile) then unitDefs[name] = nil - Spring.Log(section, LOG.ERROR, 'removed ' .. name .. ' unitDef, missing model file (' .. model .. ')') + Spring.Log(section, LOG.ERROR, "removed " .. name .. " unitDef, missing model file (" .. model .. ")") end end end diff --git a/gamedata/unitdefs_post.lua b/gamedata/unitdefs_post.lua index 282b8b569c6..71e95357157 100644 --- a/gamedata/unitdefs_post.lua +++ b/gamedata/unitdefs_post.lua @@ -61,7 +61,7 @@ local function bakeUnitDefs() local filepath = getFilePath(name .. ".lua", "units/") if filepath then if not unitDef.customparams.subfolder or string.sub(filepath, 7, #filepath - 1) ~= string.lower(unitDef.customparams.subfolder) then - unitDef.customparams.subfolder = string.sub(filepath, 7, #filepath - 1) -- not that this always gets to be lowercase despite whatever it is in the repo + unitDef.customparams.subfolder = string.sub(filepath, 7, #filepath - 1) -- not that this always gets to be lowercase despite whatever it is in the repo end end saveDefToCustomParams("UnitDefs", name, unitDef) @@ -97,7 +97,6 @@ local function tableMergeSpecial(t1, t2) return newTable end - local function getDimensions(scale) if not scale then return false @@ -137,11 +136,7 @@ local function enlargeSelectionVolumes() if ud.selectionvolumescales then local dim = getDimensions(ud.selectionvolumescales) - ud.selectionvolumescales = math.ceil(dim[1] * scale) - .. " " - .. math.ceil(dim[2] * scale) - .. " " - .. math.ceil(dim[3] * scale) + ud.selectionvolumescales = math.ceil(dim[1] * scale) .. " " .. math.ceil(dim[2] * scale) .. " " .. math.ceil(dim[3] * scale) else local size = math.max(ud.footprintx or 0, ud.footprintz or 0) * 15 if size > 0 then @@ -175,11 +170,7 @@ local function enlargeSelectionVolumes() z = dimensions[3] ud.selectionvolumetype = ud.selectionvolumetype or ud.collisionvolumetype end - ud.selectionvolumescales = math.ceil(x * scale) - .. " " - .. math.ceil(y * scale) - .. " " - .. math.ceil(z * scale) + ud.selectionvolumescales = math.ceil(x * scale) .. " " .. math.ceil(y * scale) .. " " .. math.ceil(z * scale) end end else @@ -236,15 +227,15 @@ local function preProcessTweakOptions() for name, value in pairs(modOptions) do local tweakType = name:match("^tweak([a-z]+)%d*$") local index = tonumber(name:match("^tweak[a-z]+(%d*)$")) or 0 - if (tweakType == 'defs' or tweakType == 'units') and index then - table.insert(tweaks, {name = name, type = tweakType, index = index, value = value}) + if (tweakType == "defs" or tweakType == "units") and index then + table.insert(tweaks, { name = name, type = tweakType, index = index, value = value }) end end table.sort(tweaks, function(a, b) - if a.type == 'defs' and b.type == 'units' then + if a.type == "defs" and b.type == "units" then return true - elseif a.type == 'units' and b.type == 'defs' then + elseif a.type == "units" and b.type == "defs" then return false end return a.index < b.index @@ -255,14 +246,14 @@ local function preProcessTweakOptions() for i = 1, #tweaks do local tweak = tweaks[i] local name = tweak.name - if tweak.type == 'defs' then + if tweak.type == "defs" then local decodeSuccess, postsFuncStr = pcall(string.base64Decode, modOptions[name]) if decodeSuccess then local postfunc, err = loadstring(postsFuncStr) if err then Spring.Echo("Error parsing modoption", name, "from string", postsFuncStr, "Error: " .. err) else - Spring.Echo("Loading ".. name .. " modoption") + Spring.Echo("Loading " .. name .. " modoption") Spring.Echo(postsFuncStr) if postfunc then local success, result = pcall(postfunc) @@ -280,7 +271,7 @@ local function preProcessTweakOptions() local success, tweakunits = pcall(Spring.Utilities.CustomKeyToUsefulTable, modOptions[name]) if success then if type(tweakunits) == "table" then - Spring.Echo("Loading ".. name .. " modoption") + Spring.Echo("Loading " .. name .. " modoption") for unitName, ud in pairs(UnitDefs) do if tweakunits[unitName] then Spring.Echo("Loading tweakunits for " .. unitName) @@ -328,7 +319,6 @@ if SaveDefsToCustomParams then bakeUnitDefs() end - preProcessTweakOptions() preProcessUnitDefs() if scavengersEnabled then diff --git a/gamedata/weapondefs.lua b/gamedata/weapondefs.lua index fe83dd3743e..9ef75457031 100644 --- a/gamedata/weapondefs.lua +++ b/gamedata/weapondefs.lua @@ -14,12 +14,12 @@ local weaponDefs = {} local shared = {} -- shared amongst the lua weapondef enviroments -local preProcFile = 'gamedata/weapondefs_pre.lua' -local postProcFile = 'gamedata/weapondefs_post.lua' +local preProcFile = "gamedata/weapondefs_pre.lua" +local postProcFile = "gamedata/weapondefs_post.lua" -local system = VFS.Include('gamedata/system.lua') +local system = VFS.Include("gamedata/system.lua") -local section = 'weapondefs.lua' +local section = "weapondefs.lua" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -27,9 +27,9 @@ local section = 'weapondefs.lua' -- Run a pre-processing script if one exists -- -if (VFS.FileExists(preProcFile)) then - Shared = shared -- make it global - WeaponDefs = weaponDefs -- make it global +if VFS.FileExists(preProcFile) then + Shared = shared -- make it global + WeaponDefs = weaponDefs -- make it global VFS.Include(preProcFile) WeaponDefs = nil Shared = nil @@ -41,22 +41,24 @@ end -- Load the raw LUA format weapondef files -- -local luaFiles = VFS.DirList('weapons/', '*.lua', nil, true) +local luaFiles = VFS.DirList("weapons/", "*.lua", nil, true) for _, filename in ipairs(luaFiles) do local weaponDefsEnv = {} weaponDefsEnv._G = weaponDefsEnv weaponDefsEnv.Shared = shared - weaponDefsEnv.GetFilename = function() return filename end + weaponDefsEnv.GetFilename = function() + return filename + end setmetatable(weaponDefsEnv, { __index = system }) local success, defs = pcall(VFS.Include, filename, weaponDefsEnv, VFS_MODES) - if (not success) then - Spring.Log(section, LOG.ERROR, 'Error parsing ' .. filename .. ': ' .. tostring(defs)) - elseif (defs == nil) then - Spring.Log(section, LOG.ERROR, 'Missing return table from: ' .. filename) + if not success then + Spring.Log(section, LOG.ERROR, "Error parsing " .. filename .. ": " .. tostring(defs)) + elseif defs == nil then + Spring.Log(section, LOG.ERROR, "Missing return table from: " .. filename) else for weaponDefName, weaponDef in pairs(defs) do - if ((type(weaponDefName) == 'string') and (type(weaponDef) == 'table')) then + if (type(weaponDefName) == "string") and (type(weaponDef) == "table") then weaponDefs[weaponDefName] = weaponDef end end @@ -69,9 +71,9 @@ end -- Run a post-processing script if one exists -- -if (VFS.FileExists(postProcFile)) then - Shared = shared -- make it global - WeaponDefs = weaponDefs -- make it global +if VFS.FileExists(postProcFile) then + Shared = shared -- make it global + WeaponDefs = weaponDefs -- make it global VFS.Include(postProcFile) WeaponDefs = nil Shared = nil @@ -85,12 +87,11 @@ end for name, def in pairs(weaponDefs) do local model = def.model - if ((type(model) == 'string') and (#model > 0)) then - local modelFile = 'objects3d/' .. model - if ((not VFS.FileExists(modelFile)) and - (not VFS.FileExists(modelFile .. '.s3o'))) then + if (type(model) == "string") and (#model > 0) then + local modelFile = "objects3d/" .. model + if (not VFS.FileExists(modelFile)) and (not VFS.FileExists(modelFile .. ".s3o")) then weaponDefs[name] = nil - Spring.Log(section, LOG.ERROR, 'removed ' .. name .. ' weaponDef, missing model') + Spring.Log(section, LOG.ERROR, "removed " .. name .. " weaponDef, missing model") end end end diff --git a/gamedata/weapondefs_post.lua b/gamedata/weapondefs_post.lua index aa45c5c7a03..5c80a345e12 100644 --- a/gamedata/weapondefs_post.lua +++ b/gamedata/weapondefs_post.lua @@ -50,22 +50,22 @@ local function ExtractWeaponDefs(unitDefName, unitDef) -- convert the weapon names local weapons = unitDef.weapons - for _, weapon in pairs(weapons) do - local fullName = prefix .. weapon.def:lower() - local weaponDef = WeaponDefs[fullName] + for _, weapon in pairs(weapons) do + local fullName = prefix .. weapon.def:lower() + local weaponDef = WeaponDefs[fullName] - if weaponDef then - weapon.name = fullName - end - - weapon.def = nil + if weaponDef then + weapon.name = fullName end + weapon.def = nil + end + -- convert the death explosions if unitDef.explodeas then local fullName = prefix .. unitDef.explodeas - if (WeaponDefs[fullName]) then + if WeaponDefs[fullName] then unitDef.explodeas = fullName end end @@ -73,7 +73,7 @@ local function ExtractWeaponDefs(unitDefName, unitDef) if unitDef.selfdestructas then local fullName = prefix .. unitDef.selfdestructas - if (WeaponDefs[fullName]) then + if WeaponDefs[fullName] then unitDef.selfdestructas = fullName end end diff --git a/icons/icon_atlas.lua b/icons/icon_atlas.lua index 8485309a991..07fa00bd6df 100644 --- a/icons/icon_atlas.lua +++ b/icons/icon_atlas.lua @@ -1,722 +1,721 @@ local atlas = { - ["icons/aa.png"] = { 0.96923828125,0.99951171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/aa_flak_1.4.png"] = { 0.93798828125,0.96826171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/aa_longrange_1.8.png"] = { 0.90673828125,0.93701171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/aa_t15.png"] = { 0.87548828125,0.90576171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air.png"] = { 0.84423828125,0.87451171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_assistdrone.png"] = { 0.81298828125,0.84326171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_battleship.png"] = { 0.78173828125,0.81201171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bladew.png"] = { 0.75048828125,0.78076171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bomber.png"] = { 0.71923828125,0.74951171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bomber_juno.png"] = { 0.68798828125,0.71826171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bomber_minelayer.png"] = { 0.65673828125,0.68701171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bomber_napalm.png"] = { 0.62548828125,0.65576171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_bomber_sea.png"] = { 0.59423828125,0.62451171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_flagship.png"] = { 0.56298828125,0.59326171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_hover.png"] = { 0.53173828125,0.56201171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_hover_bw.png"] = { 0.50048828125,0.53076171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_hover_rocket.png"] = { 0.46923828125,0.49951171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_kamikaze.png"] = { 0.43798828125,0.46826171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_krow.png"] = { 0.40673828125,0.43701171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_liche.png"] = { 0.37548828125,0.40576171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_los.png"] = { 0.34423828125,0.37451171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_los_sea.png"] = { 0.31298828125,0.34326171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_sea.png"] = { 0.28173828125,0.31201171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t1_hover_sea.png"] = { 0.25048828125,0.28076171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2.png"] = { 0.21923828125,0.24951171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_bomber.png"] = { 0.18798828125,0.21826171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_bomber_napalm.png"] = { 0.15673828125,0.18701171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_hover.png"] = { 0.12548828125,0.15576171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_hover_missile.png"] = { 0.09423828125,0.12451171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_radar.png"] = { 0.06298828125,0.09326171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_torpbomber.png"] = { 0.03173828125,0.06201171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_trans.png"] = { 0.00048828125,0.03076171875,0.00048828125,0.03076171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t2_worker.png"] = { 0.96923828125,0.99951171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t3.png"] = { 0.93798828125,0.96826171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_t4_flagship.png"] = { 0.90673828125,0.93701171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_torp.png"] = { 0.87548828125,0.90576171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_torp_sea.png"] = { 0.84423828125,0.87451171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_trans.png"] = { 0.81298828125,0.84326171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_worker.png"] = { 0.78173828125,0.81201171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/air_worker_sea.png"] = { 0.75048828125,0.78076171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/allterrain.png"] = { 0.71923828125,0.74951171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/allterrain_emp.png"] = { 0.68798828125,0.71826171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/allterrain_t2_rail.png"] = { 0.65673828125,0.68701171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/allterrain_vanguard_2.4.png"] = { 0.62548828125,0.65576171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib.png"] = { 0.59423828125,0.62451171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_aa.png"] = { 0.56298828125,0.59326171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_t2.png"] = { 0.53173828125,0.56201171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_t2_aa.png"] = { 0.50048828125,0.53076171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_t3.png"] = { 0.46923828125,0.49951171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_tank.png"] = { 0.43798828125,0.46826171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/amphib_worker.png"] = { 0.40673828125,0.43701171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/antinuke.png"] = { 0.37548828125,0.40576171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/antinukemobile.png"] = { 0.34423828125,0.37451171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armamb_1.5.png"] = { 0.31298828125,0.34326171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armamph_1.3.png"] = { 0.28173828125,0.31201171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armanni_1.95.png"] = { 0.25048828125,0.28076171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armart_1.png"] = { 0.21923828125,0.24951171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armasp_2.4.png"] = { 0.18798828125,0.21826171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armbrtha_2.5.png"] = { 0.15673828125,0.18701171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armcom.png"] = { 0.12548828125,0.15576171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armcomboss.png"] = { 0.09423828125,0.12451171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armconsul_1.35.png"] = { 0.06298828125,0.09326171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armcroc_1.6.png"] = { 0.03173828125,0.06201171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armfboy_1.6.png"] = { 0.00048828125,0.03076171875,0.03173828125,0.06201171875,0.03125,0.03125 } , --xXyYwh - ["icons/armfido_1.28.png"] = { 0.96923828125,0.99951171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armguard_1.3.png"] = { 0.93798828125,0.96826171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armham_1.05.png"] = { 0.90673828125,0.93701171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armjanus_1.2.png"] = { 0.87548828125,0.90576171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armjeth_0.95.png"] = { 0.84423828125,0.87451171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armlatnk_1.3.png"] = { 0.81298828125,0.84326171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armlun_1.8.png"] = { 0.78173828125,0.81201171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmanni_1.55.png"] = { 0.75048828125,0.78076171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmart_1.3.png"] = { 0.71923828125,0.74951171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmar_t3.png"] = { 0.68798828125,0.71826171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmav_1.3.png"] = { 0.65673828125,0.68701171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmerl_1.55.png"] = { 0.62548828125,0.65576171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armmlv_1.0.png"] = { 0.59423828125,0.62451171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armnanotcplat_0.92.png"] = { 0.56298828125,0.59326171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armnanotc_0.92.png"] = { 0.53173828125,0.56201171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armpb_1.4.png"] = { 0.50048828125,0.53076171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armpwt4.png"] = { 0.46923828125,0.49951171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armrattet4.png"] = { 0.43798828125,0.46826171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armraz_1.75.png"] = { 0.40673828125,0.43701171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armrock_1.png"] = { 0.37548828125,0.40576171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armsnipe_1.3.png"] = { 0.34423828125,0.37451171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armsptkt4.png"] = { 0.31298828125,0.34326171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armsptk_1.44.png"] = { 0.28173828125,0.31201171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armstil_1.66.png"] = { 0.25048828125,0.28076171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armst_1.25.png"] = { 0.21923828125,0.24951171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armthor.png"] = { 0.18798828125,0.21826171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armthundt4.png"] = { 0.15673828125,0.18701171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armvadert4.png"] = { 0.12548828125,0.15576171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armvader_0.9.png"] = { 0.09423828125,0.12451171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armvulc_3.1.png"] = { 0.06298828125,0.09326171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armwar_1.15.png"] = { 0.03173828125,0.06201171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/armzeus_1.28.png"] = { 0.00048828125,0.03076171875,0.06298828125,0.09326171875,0.03125,0.03125 } , --xXyYwh - ["icons/bantha.png"] = { 0.96923828125,0.99951171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/battlesub_t2.png"] = { 0.93798828125,0.96826171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/beacon.png"] = { 0.90673828125,0.93701171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/blank.png"] = { 0.87548828125,0.90576171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot.png"] = { 0.84423828125,0.87451171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/botrail.png"] = { 0.81298828125,0.84326171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_aa.png"] = { 0.78173828125,0.81201171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_arty.png"] = { 0.75048828125,0.78076171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_jammer.png"] = { 0.71923828125,0.74951171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_radar.png"] = { 0.68798828125,0.71826171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_rocket.png"] = { 0.65673828125,0.68701171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_big.png"] = { 0.62548828125,0.65576171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_flea.png"] = { 0.59423828125,0.62451171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_raid.png"] = { 0.56298828125,0.59326171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_raid_0.7.png"] = { 0.53173828125,0.56201171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_rez.png"] = { 0.50048828125,0.53076171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t1_tinyworker.png"] = { 0.46923828125,0.49951171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2.png"] = { 0.43798828125,0.46826171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_aa.png"] = { 0.40673828125,0.43701171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_arty_napalm.png"] = { 0.37548828125,0.40576171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_big.png"] = { 0.34423828125,0.37451171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_jammer.png"] = { 0.31298828125,0.34326171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_radar.png"] = { 0.28173828125,0.31201171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_raid.png"] = { 0.25048828125,0.28076171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t2_worker.png"] = { 0.21923828125,0.24951171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_t3.png"] = { 0.18798828125,0.21826171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/bot_worker.png"] = { 0.15673828125,0.18701171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/building.png"] = { 0.12548828125,0.15576171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor.png"] = { 0.09423828125,0.12451171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_acid.png"] = { 0.06298828125,0.09326171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_acid_arty.png"] = { 0.03173828125,0.06201171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_air.png"] = { 0.00048828125,0.03076171875,0.09423828125,0.12451171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_air_acid.png"] = { 0.96923828125,0.99951171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_arty.png"] = { 0.93798828125,0.96826171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_bomb.png"] = { 0.90673828125,0.93701171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_earty.png"] = { 0.87548828125,0.90576171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_flame.png"] = { 0.84423828125,0.87451171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_overseer.png"] = { 0.81298828125,0.84326171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_paralyze.png"] = { 0.78173828125,0.81201171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_queen.png"] = { 0.75048828125,0.78076171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_roost.png"] = { 0.71923828125,0.74951171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_spike.png"] = { 0.68798828125,0.71826171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_tentacle.png"] = { 0.65673828125,0.68701171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/raptor_tentacle2.png"] = { 0.62548828125,0.65576171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/commando.png"] = { 0.59423828125,0.62451171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corakt4.png"] = { 0.56298828125,0.59326171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/coramph_1.3.png"] = { 0.53173828125,0.56201171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corasp_2.4.png"] = { 0.50048828125,0.53076171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corban_1.6.png"] = { 0.46923828125,0.49951171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corbhmth_1.55.png"] = { 0.43798828125,0.46826171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corbuzz_3.85.png"] = { 0.40673828125,0.43701171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcan_1.28.png"] = { 0.37548828125,0.40576171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcat_1.9.png"] = { 0.34423828125,0.37451171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcom.png"] = { 0.31298828125,0.34326171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcomboss.png"] = { 0.28173828125,0.31201171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcrash_0.95.png"] = { 0.25048828125,0.28076171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corcrwt4.png"] = { 0.21923828125,0.24951171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/cordemon.png"] = { 0.18798828125,0.21826171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/cordoom_1.95.png"] = { 0.15673828125,0.18701171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corfast_1.3.png"] = { 0.12548828125,0.15576171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corgatreap.png"] = { 0.09423828125,0.12451171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corgol_1.75.png"] = { 0.06298828125,0.09326171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corhal_1.33.png"] = { 0.03173828125,0.06201171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corhrk_1.35.png"] = { 0.00048828125,0.03076171875,0.12548828125,0.15576171875,0.03125,0.03125 } , --xXyYwh - ["icons/corintr.png"] = { 0.96923828125,0.99951171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corint_2.3.png"] = { 0.93798828125,0.96826171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corkarganetht4.png"] = { 0.90673828125,0.93701171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corkarg_2.05.png"] = { 0.87548828125,0.90576171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corlevlr_1.2.png"] = { 0.84423828125,0.87451171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cormart_1.3.png"] = { 0.81298828125,0.84326171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cormlv_1.0.png"] = { 0.78173828125,0.81201171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cormort_1.3.png"] = { 0.75048828125,0.78076171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cornanotcplat_0.92.png"] = { 0.71923828125,0.74951171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cornanotc_0.92.png"] = { 0.68798828125,0.71826171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corparrow_1.55.png"] = { 0.65673828125,0.68701171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corprinter.png"] = { 0.62548828125,0.65576171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corpun_1.3.png"] = { 0.59423828125,0.62451171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corpyro_1.15.png"] = { 0.56298828125,0.59326171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corroach_0.9.png"] = { 0.53173828125,0.56201171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corseal_1.45.png"] = { 0.50048828125,0.53076171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corshiva_2.1.png"] = { 0.46923828125,0.49951171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corsktl.png"] = { 0.43798828125,0.46826171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corsok_1.8.png"] = { 0.40673828125,0.43701171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corstorm_1.png"] = { 0.37548828125,0.40576171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corsumo_1.66.png"] = { 0.34423828125,0.37451171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cortermite_1.5.png"] = { 0.31298828125,0.34326171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corthud_1.05.png"] = { 0.28173828125,0.31201171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cortoast_1.5.png"] = { 0.25048828125,0.28076171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cortorch.png"] = { 0.21923828125,0.24951171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cortrem_1.85.png"] = { 0.18798828125,0.21826171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corvipe_1.4.png"] = { 0.15673828125,0.18701171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corvroc_1.6.png"] = { 0.12548828125,0.15576171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/corwolv_1.png"] = { 0.09423828125,0.12451171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/cor_t2_flameworker.png"] = { 0.06298828125,0.09326171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence.png"] = { 0.03173828125,0.06201171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_0_0.8.png"] = { 0.00048828125,0.03076171875,0.15673828125,0.18701171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_0_laser2_0.94.png"] = { 0.96923828125,0.99951171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_0_laser_0.8.png"] = { 0.93798828125,0.96826171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1.5_laser.png"] = { 0.90673828125,0.93701171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_1.05.png"] = { 0.87548828125,0.90576171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_arty_1.3.png"] = { 0.84423828125,0.87451171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_claw.png"] = { 0.81298828125,0.84326171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_laser.png"] = { 0.78173828125,0.81201171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_laser_1.05.png"] = { 0.75048828125,0.78076171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_maw.png"] = { 0.71923828125,0.74951171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_1_naval.png"] = { 0.68798828125,0.71826171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_1.4.png"] = { 0.65673828125,0.68701171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_arty_1.5.png"] = { 0.62548828125,0.65576171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_laser_1.4.png"] = { 0.59423828125,0.62451171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_mg.png"] = { 0.56298828125,0.59326171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_missile_1.4.png"] = { 0.53173828125,0.56201171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_2_naval.png"] = { 0.50048828125,0.53076171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_3_1.95.png"] = { 0.46923828125,0.49951171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_beamer.png"] = { 0.43798828125,0.46826171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_hllllt.png"] = { 0.40673828125,0.43701171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/defence_hllt.png"] = { 0.37548828125,0.40576171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/droppod.png"] = { 0.34423828125,0.37451171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/emp.png"] = { 0.31298828125,0.34326171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energy.png"] = { 0.28173828125,0.31201171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energy1_1.0.png"] = { 0.25048828125,0.28076171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energy2_1.18.png"] = { 0.21923828125,0.24951171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energy5_1.85.png"] = { 0.18798828125,0.21826171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energy6_1.3.png"] = { 0.15673828125,0.18701171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energystorage.png"] = { 0.12548828125,0.15576171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/energystorage_t2.png"] = { 0.09423828125,0.12451171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/engineer_small.png"] = { 0.06298828125,0.09326171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/eye.png"] = { 0.03173828125,0.06201171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/eyes.png"] = { 0.00048828125,0.03076171875,0.18798828125,0.21826171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_air.png"] = { 0.96923828125,0.99951171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_air_sea.png"] = { 0.93798828125,0.96826171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_air_t2.png"] = { 0.90673828125,0.93701171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_air_t3.png"] = { 0.87548828125,0.90576171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_amph.png"] = { 0.84423828125,0.87451171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_bot.png"] = { 0.81298828125,0.84326171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_bot_t2.png"] = { 0.78173828125,0.81201171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_gantry.png"] = { 0.75048828125,0.78076171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_hover.png"] = { 0.71923828125,0.74951171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_seaplanes.png"] = { 0.68798828125,0.71826171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_ship.png"] = { 0.65673828125,0.68701171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_ship_t2.png"] = { 0.62548828125,0.65576171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_vehicle.png"] = { 0.59423828125,0.62451171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/factory_vehicle_t2.png"] = { 0.56298828125,0.59326171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/fusion.png"] = { 0.53173828125,0.56201171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hazardous.png"] = { 0.50048828125,0.53076171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover.png"] = { 0.46923828125,0.49951171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hovertrans.png"] = { 0.43798828125,0.46826171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_aa.png"] = { 0.40673828125,0.43701171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_gun.png"] = { 0.37548828125,0.40576171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_raid.png"] = { 0.34423828125,0.37451171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_t1_missile.png"] = { 0.31298828125,0.34326171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_t2.png"] = { 0.28173828125,0.31201171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_t3.png"] = { 0.25048828125,0.28076171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/hover_worker.png"] = { 0.21923828125,0.24951171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/icon_atlas.png"] = { 0.18798828125,0.21826171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/jammer.png"] = { 0.15673828125,0.18701171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/jammer_t15.png"] = { 0.12548828125,0.15576171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/jammer_t1_0.9.png"] = { 0.09423828125,0.12451171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/jammer_t2.png"] = { 0.06298828125,0.09326171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/jammer_t2_1.2.png"] = { 0.03173828125,0.06201171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/juggernaut.png"] = { 0.00048828125,0.03076171875,0.21923828125,0.24951171875,0.03125,0.03125 } , --xXyYwh - ["icons/juno.png"] = { 0.96923828125,0.99951171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/kbot_t2_shotgun.png"] = { 0.93798828125,0.96826171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/land_assistdrone.png"] = { 0.90673828125,0.93701171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/laserdefenset3.png"] = { 0.87548828125,0.90576171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcom.png"] = { 0.84423828125,0.87451171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcomt2com.png"] = { 0.81298828125,0.84326171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcomt2_def.png"] = { 0.78173828125,0.81201171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcom_def.png"] = { 0.75048828125,0.78076171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcom_econ.png"] = { 0.71923828125,0.74951171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legcom_off.png"] = { 0.68798828125,0.71826171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legfhive.png"] = { 0.65673828125,0.68701171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/leghive.png"] = { 0.65673828125,0.68701171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/legkark.png"] = { 0.62548828125,0.65576171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/lootbox.png"] = { 0.59423828125,0.62451171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/lootboxt2.png"] = { 0.56298828125,0.59326171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/lootboxt3.png"] = { 0.53173828125,0.56201171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/lootboxt4.png"] = { 0.50048828125,0.53076171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mech.png"] = { 0.46923828125,0.49951171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/metalmaker.png"] = { 0.43798828125,0.46826171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/metalmaker_t1_0.75.png"] = { 0.40673828125,0.43701171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/metalmaker_t2_1.15.png"] = { 0.37548828125,0.40576171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/metalstorage.png"] = { 0.34423828125,0.37451171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/metalstorage_t2.png"] = { 0.31298828125,0.34326171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mex.png"] = { 0.28173828125,0.31201171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mex_t1_0.77.png"] = { 0.25048828125,0.28076171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mex_t2_1.15.png"] = { 0.21923828125,0.24951171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mine.png"] = { 0.18798828125,0.21826171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/mission_command_tower.png"] = { 0.15673828125,0.18701171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/nanot2.png"] = { 0.12548828125,0.15576171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/nuke.png"] = { 0.09423828125,0.12451171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/radar.png"] = { 0.06298828125,0.09326171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/radar_t1_0.9.png"] = { 0.03173828125,0.06201171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/radar_t2_1.2.png"] = { 0.00048828125,0.03076171875,0.25048828125,0.28076171875,0.03125,0.03125 } , --xXyYwh - ["icons/scavnanotc_t1.png"] = { 0.96923828125,0.99951171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/scavnanotc_t2.png"] = { 0.93798828125,0.96826171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/scavnanotc_t3.png"] = { 0.90673828125,0.93701171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/scavnanotc_t4.png"] = { 0.87548828125,0.90576171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/seismic.png"] = { 0.84423828125,0.87451171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/shield.png"] = { 0.81298828125,0.84326171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship.png"] = { 0.78173828125,0.81201171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/shipengineer.png"] = { 0.75048828125,0.78076171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/shiptrans.png"] = { 0.71923828125,0.74951171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_aa.png"] = { 0.68798828125,0.71826171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_destroyer.png"] = { 0.65673828125,0.68701171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_jammer.png"] = { 0.62548828125,0.65576171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_pship.png"] = { 0.59423828125,0.62451171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_raid.png"] = { 0.56298828125,0.59326171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2.png"] = { 0.53173828125,0.56201171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_aa.png"] = { 0.50048828125,0.53076171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_battleship.png"] = { 0.46923828125,0.49951171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_carrier.png"] = { 0.43798828125,0.46826171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_cruiser.png"] = { 0.40673828125,0.43701171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_flagship.png"] = { 0.37548828125,0.40576171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_jammer.png"] = { 0.34423828125,0.37451171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_missile.png"] = { 0.31298828125,0.34326171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t2_worker.png"] = { 0.28173828125,0.31201171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t3.png"] = { 0.25048828125,0.28076171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t3_pt.png"] = { 0.21923828125,0.24951171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t4_decade.png"] = { 0.18798828125,0.21826171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t4_esuppt3.png"] = { 0.15673828125,0.18701171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t4_pship.png"] = { 0.12548828125,0.15576171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_t4_slrpc.png"] = { 0.09423828125,0.12451171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_tiny.png"] = { 0.06298828125,0.09326171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_torpedo.png"] = { 0.03173828125,0.06201171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/ship_worker.png"] = { 0.00048828125,0.03076171875,0.28173828125,0.31201171875,0.03125,0.03125 } , --xXyYwh - ["icons/skull.png"] = { 0.96923828125,0.99951171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/solar.png"] = { 0.93798828125,0.96826171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/spy.png"] = { 0.90673828125,0.93701171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub.png"] = { 0.87548828125,0.90576171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_rez.png"] = { 0.84423828125,0.87451171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_t2.png"] = { 0.81298828125,0.84326171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_t2_worker.png"] = { 0.78173828125,0.81201171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_t3.png"] = { 0.75048828125,0.78076171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_t3x.png"] = { 0.71923828125,0.74951171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_t4.png"] = { 0.68798828125,0.71826171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/sub_worker.png"] = { 0.65673828125,0.68701171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/t3.png"] = { 0.62548828125,0.65576171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/tacnuke.png"] = { 0.59423828125,0.62451171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/targetting.png"] = { 0.56298828125,0.59326171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/unknown.png"] = { 0.53173828125,0.56201171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle.png"] = { 0.50048828125,0.53076171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_aa.png"] = { 0.46923828125,0.49951171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_arty.png"] = { 0.43798828125,0.46826171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_jammer.png"] = { 0.40673828125,0.43701171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_radar.png"] = { 0.37548828125,0.40576171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_arty_napalm.png"] = { 0.34423828125,0.37451171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_big.png"] = { 0.31298828125,0.34326171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_missile.png"] = { 0.28173828125,0.31201171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_raid.png"] = { 0.25048828125,0.28076171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_tank.png"] = { 0.21923828125,0.24951171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_tank_mgun.png"] = { 0.18798828125,0.21826171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_tank_rail.png"] = { 0.15673828125,0.18701171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t1_tiny.png"] = { 0.12548828125,0.15576171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2.png"] = { 0.09423828125,0.12451171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_aa.png"] = { 0.06298828125,0.09326171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_big.png"] = { 0.03173828125,0.06201171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_carry.png"] = { 0.00048828125,0.03076171875,0.31298828125,0.34326171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_jammer.png"] = { 0.96923828125,0.99951171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_radar.png"] = { 0.93798828125,0.96826171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_raid.png"] = { 0.90673828125,0.93701171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_sco.png"] = { 0.87548828125,0.90576171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_tank.png"] = { 0.84423828125,0.87451171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_tank_rail.png"] = { 0.81298828125,0.84326171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t2_worker.png"] = { 0.78173828125,0.81201171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_t3.png"] = { 0.75048828125,0.78076171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_trans.png"] = { 0.71923828125,0.74951171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/vehicle_worker.png"] = { 0.68798828125,0.71826171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/wall_0.4.png"] = { 0.65673828125,0.68701171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/wind.png"] = { 0.62548828125,0.65576171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/worker.png"] = { 0.59423828125,0.62451171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/wrench.png"] = { 0.56298828125,0.59326171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/aa.png"] = { 0.53173828125,0.56201171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/aa_flak_1.4.png"] = { 0.50048828125,0.53076171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/aa_longrange_1.8.png"] = { 0.46923828125,0.49951171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/aa_t15.png"] = { 0.43798828125,0.46826171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air.png"] = { 0.40673828125,0.43701171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_assistdrone.png"] = { 0.37548828125,0.40576171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_battleship.png"] = { 0.34423828125,0.37451171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bladew.png"] = { 0.31298828125,0.34326171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bomber.png"] = { 0.28173828125,0.31201171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bomber_juno.png"] = { 0.25048828125,0.28076171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bomber_minelayer.png"] = { 0.21923828125,0.24951171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bomber_napalm.png"] = { 0.18798828125,0.21826171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_bomber_sea.png"] = { 0.15673828125,0.18701171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_flagship.png"] = { 0.12548828125,0.15576171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_hover.png"] = { 0.09423828125,0.12451171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_hover_bw.png"] = { 0.06298828125,0.09326171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_hover_rocket.png"] = { 0.03173828125,0.06201171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_kamikaze.png"] = { 0.00048828125,0.03076171875,0.34423828125,0.37451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_krow.png"] = { 0.96923828125,0.99951171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_liche.png"] = { 0.93798828125,0.96826171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_los.png"] = { 0.90673828125,0.93701171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_los_sea.png"] = { 0.87548828125,0.90576171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_sea.png"] = { 0.84423828125,0.87451171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t1_hover_sea.png"] = { 0.81298828125,0.84326171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2.png"] = { 0.78173828125,0.81201171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_bomber.png"] = { 0.75048828125,0.78076171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_bomber_napalm.png"] = { 0.71923828125,0.74951171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_hover.png"] = { 0.68798828125,0.71826171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_hover_missile.png"] = { 0.65673828125,0.68701171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_radar.png"] = { 0.62548828125,0.65576171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_torpbomber.png"] = { 0.59423828125,0.62451171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_trans.png"] = { 0.56298828125,0.59326171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t2_worker.png"] = { 0.53173828125,0.56201171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t3.png"] = { 0.50048828125,0.53076171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_t4_flagship.png"] = { 0.46923828125,0.49951171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_torp.png"] = { 0.43798828125,0.46826171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_torp_sea.png"] = { 0.40673828125,0.43701171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_trans.png"] = { 0.37548828125,0.40576171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_worker.png"] = { 0.34423828125,0.37451171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/air_worker_sea.png"] = { 0.31298828125,0.34326171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/allterrain.png"] = { 0.28173828125,0.31201171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/allterrain_emp.png"] = { 0.25048828125,0.28076171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/allterrain_t2_rail.png"] = { 0.21923828125,0.24951171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/allterrain_vanguard_2.4.png"] = { 0.18798828125,0.21826171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib.png"] = { 0.15673828125,0.18701171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_aa.png"] = { 0.12548828125,0.15576171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_t2.png"] = { 0.09423828125,0.12451171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_t2_aa.png"] = { 0.06298828125,0.09326171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_t3.png"] = { 0.03173828125,0.06201171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_tank.png"] = { 0.00048828125,0.03076171875,0.37548828125,0.40576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/amphib_worker.png"] = { 0.96923828125,0.99951171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/antinuke.png"] = { 0.93798828125,0.96826171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/antinukemobile.png"] = { 0.90673828125,0.93701171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armamb_1.5.png"] = { 0.87548828125,0.90576171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armamph_1.3.png"] = { 0.84423828125,0.87451171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armanni_1.95.png"] = { 0.81298828125,0.84326171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armart_1.png"] = { 0.78173828125,0.81201171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armasp_2.4.png"] = { 0.75048828125,0.78076171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armbrtha_2.5.png"] = { 0.71923828125,0.74951171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armcom.png"] = { 0.68798828125,0.71826171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armcomboss.png"] = { 0.65673828125,0.68701171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armconsul_1.35.png"] = { 0.62548828125,0.65576171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armcroc_1.6.png"] = { 0.59423828125,0.62451171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armfboy_1.6.png"] = { 0.56298828125,0.59326171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armfido_1.28.png"] = { 0.53173828125,0.56201171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armguard_1.3.png"] = { 0.50048828125,0.53076171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armham_1.05.png"] = { 0.46923828125,0.49951171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armjanus_1.2.png"] = { 0.43798828125,0.46826171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armjeth_0.95.png"] = { 0.40673828125,0.43701171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armlatnk_1.3.png"] = { 0.37548828125,0.40576171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armlun_1.8.png"] = { 0.34423828125,0.37451171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armmanni_1.55.png"] = { 0.31298828125,0.34326171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armmart_1.3.png"] = { 0.28173828125,0.31201171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armmav_1.3.png"] = { 0.25048828125,0.28076171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armmerl_1.55.png"] = { 0.21923828125,0.24951171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armmlv_1.0.png"] = { 0.18798828125,0.21826171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armnanotcplat_0.92.png"] = { 0.15673828125,0.18701171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armnanotc_0.92.png"] = { 0.12548828125,0.15576171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armpb_1.4.png"] = { 0.09423828125,0.12451171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armpwt4.png"] = { 0.06298828125,0.09326171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armrattet4.png"] = { 0.03173828125,0.06201171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armraz_1.75.png"] = { 0.00048828125,0.03076171875,0.40673828125,0.43701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armrock_1.png"] = { 0.96923828125,0.99951171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armsnipe_1.3.png"] = { 0.93798828125,0.96826171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armsptkt4.png"] = { 0.90673828125,0.93701171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armsptk_1.44.png"] = { 0.87548828125,0.90576171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armstil_1.66.png"] = { 0.84423828125,0.87451171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armst_1.25.png"] = { 0.81298828125,0.84326171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armthor.png"] = { 0.78173828125,0.81201171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armthundt4.png"] = { 0.75048828125,0.78076171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armvadert4.png"] = { 0.71923828125,0.74951171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armvader_0.9.png"] = { 0.68798828125,0.71826171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armvulc_3.1.png"] = { 0.65673828125,0.68701171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armwar_1.15.png"] = { 0.62548828125,0.65576171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/armzeus_1.28.png"] = { 0.59423828125,0.62451171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bantha.png"] = { 0.56298828125,0.59326171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/battlesub_t2.png"] = { 0.53173828125,0.56201171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/beacon.png"] = { 0.50048828125,0.53076171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/blank.png"] = { 0.46923828125,0.49951171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot.png"] = { 0.43798828125,0.46826171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/botrail.png"] = { 0.40673828125,0.43701171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_aa.png"] = { 0.37548828125,0.40576171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_arty.png"] = { 0.34423828125,0.37451171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_jammer.png"] = { 0.31298828125,0.34326171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_radar.png"] = { 0.28173828125,0.31201171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_rocket.png"] = { 0.25048828125,0.28076171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_big.png"] = { 0.21923828125,0.24951171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_flea.png"] = { 0.18798828125,0.21826171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_raid.png"] = { 0.15673828125,0.18701171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_raid_0.7.png"] = { 0.12548828125,0.15576171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_rez.png"] = { 0.09423828125,0.12451171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t1_tinyworker.png"] = { 0.06298828125,0.09326171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2.png"] = { 0.03173828125,0.06201171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_aa.png"] = { 0.00048828125,0.03076171875,0.43798828125,0.46826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_arty_napalm.png"] = { 0.96923828125,0.99951171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_big.png"] = { 0.93798828125,0.96826171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_jammer.png"] = { 0.90673828125,0.93701171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_radar.png"] = { 0.87548828125,0.90576171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_raid.png"] = { 0.84423828125,0.87451171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t2_worker.png"] = { 0.81298828125,0.84326171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_t3.png"] = { 0.78173828125,0.81201171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/bot_worker.png"] = { 0.75048828125,0.78076171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/building.png"] = { 0.71923828125,0.74951171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/raptor.png"] = { 0.68798828125,0.71826171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/raptor_air.png"] = { 0.65673828125,0.68701171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/raptor_queen.png"] = { 0.62548828125,0.65576171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/raptor_roost.png"] = { 0.59423828125,0.62451171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/commando.png"] = { 0.56298828125,0.59326171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corakt4.png"] = { 0.53173828125,0.56201171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/coramph_1.3.png"] = { 0.50048828125,0.53076171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corasp_2.4.png"] = { 0.46923828125,0.49951171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corban_1.6.png"] = { 0.43798828125,0.46826171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corbhmth_1.55.png"] = { 0.40673828125,0.43701171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corbuzz_3.85.png"] = { 0.37548828125,0.40576171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcan_1.28.png"] = { 0.34423828125,0.37451171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcat_1.9.png"] = { 0.31298828125,0.34326171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcom.png"] = { 0.28173828125,0.31201171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcomboss.png"] = { 0.25048828125,0.28076171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcrash_0.95.png"] = { 0.21923828125,0.24951171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corcrwt4.png"] = { 0.18798828125,0.21826171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cordemon.png"] = { 0.15673828125,0.18701171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cordoom_1.95.png"] = { 0.12548828125,0.15576171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corfast_1.3.png"] = { 0.09423828125,0.12451171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corgatreap.png"] = { 0.06298828125,0.09326171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corgol_1.75.png"] = { 0.03173828125,0.06201171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corhal_1.33.png"] = { 0.00048828125,0.03076171875,0.46923828125,0.49951171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corhrk_1.35.png"] = { 0.96923828125,0.99951171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corintr.png"] = { 0.93798828125,0.96826171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corint_2.3.png"] = { 0.90673828125,0.93701171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corkarganetht4.png"] = { 0.87548828125,0.90576171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corkarg_2.05.png"] = { 0.84423828125,0.87451171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corkark.png"] = { 0.81298828125,0.84326171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corlevlr_1.2.png"] = { 0.78173828125,0.81201171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cormart_1.3.png"] = { 0.75048828125,0.78076171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cormlv_1.0.png"] = { 0.71923828125,0.74951171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cormort_1.3.png"] = { 0.68798828125,0.71826171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cornanotcplat_0.92.png"] = { 0.65673828125,0.68701171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cornanotc_0.92.png"] = { 0.62548828125,0.65576171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corparrow_1.55.png"] = { 0.59423828125,0.62451171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corpun_1.3.png"] = { 0.56298828125,0.59326171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corpyro_1.15.png"] = { 0.53173828125,0.56201171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corroach_0.9.png"] = { 0.50048828125,0.53076171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corseal_1.45.png"] = { 0.46923828125,0.49951171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corshiva_2.1.png"] = { 0.43798828125,0.46826171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corsktl.png"] = { 0.40673828125,0.43701171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corsok_1.8.png"] = { 0.37548828125,0.40576171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corstorm_1.png"] = { 0.34423828125,0.37451171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corsumo_1.66.png"] = { 0.31298828125,0.34326171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cortermite_1.5.png"] = { 0.28173828125,0.31201171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corthud_1.05.png"] = { 0.25048828125,0.28076171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cortoast_1.5.png"] = { 0.21923828125,0.24951171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cortrem_1.85.png"] = { 0.18798828125,0.21826171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corvipe_1.4.png"] = { 0.15673828125,0.18701171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corvroc_1.6.png"] = { 0.12548828125,0.15576171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/corwolv_1.png"] = { 0.09423828125,0.12451171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/cor_t2_flameworker.png"] = { 0.06298828125,0.09326171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence.png"] = { 0.03173828125,0.06201171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_0_0.8.png"] = { 0.00048828125,0.03076171875,0.50048828125,0.53076171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_0_laser2_0.94.png"] = { 0.96923828125,0.99951171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_0_laser_0.8.png"] = { 0.93798828125,0.96826171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1.5_laser.png"] = { 0.90673828125,0.93701171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_1.05.png"] = { 0.87548828125,0.90576171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_arty_1.3.png"] = { 0.84423828125,0.87451171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_claw.png"] = { 0.81298828125,0.84326171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_laser.png"] = { 0.78173828125,0.81201171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_laser_1.05.png"] = { 0.75048828125,0.78076171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_maw.png"] = { 0.71923828125,0.74951171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_1_naval.png"] = { 0.68798828125,0.71826171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_1.4.png"] = { 0.65673828125,0.68701171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_arty_1.5.png"] = { 0.62548828125,0.65576171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_laser_1.4.png"] = { 0.59423828125,0.62451171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_mg.png"] = { 0.56298828125,0.59326171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_missile_1.4.png"] = { 0.53173828125,0.56201171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_2_naval.png"] = { 0.50048828125,0.53076171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_3_1.95.png"] = { 0.46923828125,0.49951171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_beamer.png"] = { 0.43798828125,0.46826171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_hllllt.png"] = { 0.40673828125,0.43701171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defence_hllt.png"] = { 0.37548828125,0.40576171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/defense_master_shape.png"] = { 0.34423828125,0.37451171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/droppod.png"] = { 0.31298828125,0.34326171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/emp.png"] = { 0.28173828125,0.31201171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energy.png"] = { 0.25048828125,0.28076171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energy1_1.0.png"] = { 0.21923828125,0.24951171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energy2_1.18.png"] = { 0.18798828125,0.21826171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energy5_1.85.png"] = { 0.15673828125,0.18701171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energy6_1.3.png"] = { 0.12548828125,0.15576171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energystorage.png"] = { 0.09423828125,0.12451171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/energystorage_t2.png"] = { 0.06298828125,0.09326171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/engineer_small.png"] = { 0.03173828125,0.06201171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/estore.png"] = { 0.00048828125,0.03076171875,0.53173828125,0.56201171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/eye.png"] = { 0.96923828125,0.99951171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/eyes.png"] = { 0.93798828125,0.96826171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_air.png"] = { 0.90673828125,0.93701171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_air_sea.png"] = { 0.87548828125,0.90576171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_air_t2.png"] = { 0.84423828125,0.87451171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_air_t3.png"] = { 0.81298828125,0.84326171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_amph.png"] = { 0.78173828125,0.81201171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_bot.png"] = { 0.75048828125,0.78076171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_bot_t2.png"] = { 0.71923828125,0.74951171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_gantry.png"] = { 0.68798828125,0.71826171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_hover.png"] = { 0.65673828125,0.68701171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_seaplanes.png"] = { 0.62548828125,0.65576171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_ship.png"] = { 0.59423828125,0.62451171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_ship_t2.png"] = { 0.56298828125,0.59326171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_vehicle.png"] = { 0.53173828125,0.56201171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/factory_vehicle_t2.png"] = { 0.50048828125,0.53076171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/fusion.png"] = { 0.46923828125,0.49951171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hazardous.png"] = { 0.43798828125,0.46826171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover.png"] = { 0.40673828125,0.43701171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hovertrans.png"] = { 0.37548828125,0.40576171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_aa.png"] = { 0.34423828125,0.37451171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_gun.png"] = { 0.31298828125,0.34326171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_raid.png"] = { 0.28173828125,0.31201171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_t1_missile.png"] = { 0.25048828125,0.28076171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_t2.png"] = { 0.21923828125,0.24951171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_t3.png"] = { 0.18798828125,0.21826171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/hover_worker.png"] = { 0.15673828125,0.18701171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/jammer.png"] = { 0.12548828125,0.15576171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/jammer_t15.png"] = { 0.09423828125,0.12451171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/jammer_t1_0.9.png"] = { 0.06298828125,0.09326171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/jammer_t2.png"] = { 0.03173828125,0.06201171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/juggernaut.png"] = { 0.00048828125,0.03076171875,0.56298828125,0.59326171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/juno.png"] = { 0.96923828125,0.99951171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/kbot_t2_shotgun.png"] = { 0.93798828125,0.96826171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/laserdefenset3.png"] = { 0.90673828125,0.93701171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legcomt2com.png"] = { 0.87548828125,0.90576171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legcomt2_def.png"] = { 0.84423828125,0.87451171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legcom_def.png"] = { 0.81298828125,0.84326171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legcom_econ.png"] = { 0.78173828125,0.81201171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legcom_off.png"] = { 0.75048828125,0.78076171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/legfhive.png"] = { 0.71923828125,0.74951171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/leghive.png"] = { 0.71923828125,0.74951171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/lootbox.png"] = { 0.68798828125,0.71826171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/lootboxt2.png"] = { 0.65673828125,0.68701171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/lootboxt3.png"] = { 0.62548828125,0.65576171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/lootboxt4.png"] = { 0.59423828125,0.62451171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mech.png"] = { 0.56298828125,0.59326171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/metalmaker.png"] = { 0.53173828125,0.56201171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/metalmaker_t1_0.75.png"] = { 0.50048828125,0.53076171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/metalmaker_t2_1.15.png"] = { 0.46923828125,0.49951171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/metalstorage.png"] = { 0.43798828125,0.46826171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/metalstorage_t2.png"] = { 0.40673828125,0.43701171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mex.png"] = { 0.37548828125,0.40576171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mex_t1_0.77.png"] = { 0.34423828125,0.37451171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mex_t2_1.15.png"] = { 0.31298828125,0.34326171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mine.png"] = { 0.28173828125,0.31201171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mission_command_tower.png"] = { 0.25048828125,0.28076171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/mstore.png"] = { 0.21923828125,0.24951171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/nanot2.png"] = { 0.18798828125,0.21826171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/nuke.png"] = { 0.15673828125,0.18701171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/radar.png"] = { 0.12548828125,0.15576171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/radar_t1_0.9.png"] = { 0.09423828125,0.12451171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/radar_t2_1.2.png"] = { 0.06298828125,0.09326171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/Rocket.png"] = { 0.03173828125,0.06201171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/scavnanotc_t1.png"] = { 0.00048828125,0.03076171875,0.59423828125,0.62451171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/scavnanotc_t2.png"] = { 0.96923828125,0.99951171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/scavnanotc_t3.png"] = { 0.93798828125,0.96826171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/scavnanotc_t4.png"] = { 0.90673828125,0.93701171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/seismic.png"] = { 0.87548828125,0.90576171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/shield.png"] = { 0.84423828125,0.87451171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship.png"] = { 0.81298828125,0.84326171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/shipengineer.png"] = { 0.78173828125,0.81201171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/shiptrans.png"] = { 0.75048828125,0.78076171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_aa.png"] = { 0.71923828125,0.74951171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_destroyer.png"] = { 0.68798828125,0.71826171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_jammer.png"] = { 0.65673828125,0.68701171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_pship.png"] = { 0.62548828125,0.65576171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_raid.png"] = { 0.59423828125,0.62451171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2.png"] = { 0.56298828125,0.59326171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_aa.png"] = { 0.53173828125,0.56201171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_battleship.png"] = { 0.50048828125,0.53076171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_carrier.png"] = { 0.46923828125,0.49951171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_cruiser.png"] = { 0.43798828125,0.46826171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_flagship.png"] = { 0.40673828125,0.43701171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_jammer.png"] = { 0.37548828125,0.40576171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_missile.png"] = { 0.34423828125,0.37451171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t2_worker.png"] = { 0.31298828125,0.34326171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t3.png"] = { 0.28173828125,0.31201171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t3_pt.png"] = { 0.25048828125,0.28076171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t4_decade.png"] = { 0.21923828125,0.24951171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t4_esuppt3.png"] = { 0.18798828125,0.21826171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t4_pship.png"] = { 0.15673828125,0.18701171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_t4_slrpc.png"] = { 0.12548828125,0.15576171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_tiny.png"] = { 0.09423828125,0.12451171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_torpedo.png"] = { 0.06298828125,0.09326171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/ship_worker.png"] = { 0.03173828125,0.06201171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/skull.png"] = { 0.00048828125,0.03076171875,0.62548828125,0.65576171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/solar.png"] = { 0.96923828125,0.99951171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/spy.png"] = { 0.93798828125,0.96826171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub.png"] = { 0.90673828125,0.93701171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_rez.png"] = { 0.87548828125,0.90576171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_t2.png"] = { 0.84423828125,0.87451171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_t2_worker.png"] = { 0.81298828125,0.84326171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_t3.png"] = { 0.78173828125,0.81201171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_t3x.png"] = { 0.75048828125,0.78076171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_t4.png"] = { 0.71923828125,0.74951171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/sub_worker.png"] = { 0.68798828125,0.71826171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/tacnuke.png"] = { 0.65673828125,0.68701171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/targetting.png"] = { 0.62548828125,0.65576171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/unknown.png"] = { 0.59423828125,0.62451171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle.png"] = { 0.56298828125,0.59326171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_aa.png"] = { 0.53173828125,0.56201171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_arty.png"] = { 0.50048828125,0.53076171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_jammer.png"] = { 0.46923828125,0.49951171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_radar.png"] = { 0.43798828125,0.46826171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_arty_napalm.png"] = { 0.40673828125,0.43701171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_big.png"] = { 0.37548828125,0.40576171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_missile.png"] = { 0.34423828125,0.37451171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_raid.png"] = { 0.31298828125,0.34326171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_tank.png"] = { 0.28173828125,0.31201171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_tank_mgun.png"] = { 0.25048828125,0.28076171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_tank_rail.png"] = { 0.21923828125,0.24951171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t1_tiny.png"] = { 0.18798828125,0.21826171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2.png"] = { 0.15673828125,0.18701171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_aa.png"] = { 0.12548828125,0.15576171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_big.png"] = { 0.09423828125,0.12451171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_carry.png"] = { 0.06298828125,0.09326171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_jammer.png"] = { 0.03173828125,0.06201171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_radar.png"] = { 0.00048828125,0.03076171875,0.65673828125,0.68701171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_raid.png"] = { 0.96923828125,0.99951171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_sco.png"] = { 0.93798828125,0.96826171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_tank.png"] = { 0.90673828125,0.93701171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_tank_rail.png"] = { 0.87548828125,0.90576171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t2_worker.png"] = { 0.84423828125,0.87451171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_t3.png"] = { 0.81298828125,0.84326171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_trans.png"] = { 0.78173828125,0.81201171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/vehicle_worker.png"] = { 0.75048828125,0.78076171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/wall_0.4.png"] = { 0.71923828125,0.74951171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/wind.png"] = { 0.68798828125,0.71826171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/worker.png"] = { 0.65673828125,0.68701171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - ["icons/inverted/wrench.png"] = { 0.62548828125,0.65576171875,0.68798828125,0.71826171875,0.03125,0.03125 } , --xXyYwh - + ["icons/aa.png"] = { 0.96923828125, 0.99951171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/aa_flak_1.4.png"] = { 0.93798828125, 0.96826171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/aa_longrange_1.8.png"] = { 0.90673828125, 0.93701171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/aa_t15.png"] = { 0.87548828125, 0.90576171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air.png"] = { 0.84423828125, 0.87451171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_assistdrone.png"] = { 0.81298828125, 0.84326171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_battleship.png"] = { 0.78173828125, 0.81201171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bladew.png"] = { 0.75048828125, 0.78076171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bomber.png"] = { 0.71923828125, 0.74951171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bomber_juno.png"] = { 0.68798828125, 0.71826171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bomber_minelayer.png"] = { 0.65673828125, 0.68701171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bomber_napalm.png"] = { 0.62548828125, 0.65576171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_bomber_sea.png"] = { 0.59423828125, 0.62451171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_flagship.png"] = { 0.56298828125, 0.59326171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_hover.png"] = { 0.53173828125, 0.56201171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_hover_bw.png"] = { 0.50048828125, 0.53076171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_hover_rocket.png"] = { 0.46923828125, 0.49951171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_kamikaze.png"] = { 0.43798828125, 0.46826171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_krow.png"] = { 0.40673828125, 0.43701171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_liche.png"] = { 0.37548828125, 0.40576171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_los.png"] = { 0.34423828125, 0.37451171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_los_sea.png"] = { 0.31298828125, 0.34326171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_sea.png"] = { 0.28173828125, 0.31201171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t1_hover_sea.png"] = { 0.25048828125, 0.28076171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2.png"] = { 0.21923828125, 0.24951171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_bomber.png"] = { 0.18798828125, 0.21826171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_bomber_napalm.png"] = { 0.15673828125, 0.18701171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_hover.png"] = { 0.12548828125, 0.15576171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_hover_missile.png"] = { 0.09423828125, 0.12451171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_radar.png"] = { 0.06298828125, 0.09326171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_torpbomber.png"] = { 0.03173828125, 0.06201171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_trans.png"] = { 0.00048828125, 0.03076171875, 0.00048828125, 0.03076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t2_worker.png"] = { 0.96923828125, 0.99951171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t3.png"] = { 0.93798828125, 0.96826171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_t4_flagship.png"] = { 0.90673828125, 0.93701171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_torp.png"] = { 0.87548828125, 0.90576171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_torp_sea.png"] = { 0.84423828125, 0.87451171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_trans.png"] = { 0.81298828125, 0.84326171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_worker.png"] = { 0.78173828125, 0.81201171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/air_worker_sea.png"] = { 0.75048828125, 0.78076171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/allterrain.png"] = { 0.71923828125, 0.74951171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/allterrain_emp.png"] = { 0.68798828125, 0.71826171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/allterrain_t2_rail.png"] = { 0.65673828125, 0.68701171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/allterrain_vanguard_2.4.png"] = { 0.62548828125, 0.65576171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib.png"] = { 0.59423828125, 0.62451171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_aa.png"] = { 0.56298828125, 0.59326171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_t2.png"] = { 0.53173828125, 0.56201171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_t2_aa.png"] = { 0.50048828125, 0.53076171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_t3.png"] = { 0.46923828125, 0.49951171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_tank.png"] = { 0.43798828125, 0.46826171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/amphib_worker.png"] = { 0.40673828125, 0.43701171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/antinuke.png"] = { 0.37548828125, 0.40576171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/antinukemobile.png"] = { 0.34423828125, 0.37451171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armamb_1.5.png"] = { 0.31298828125, 0.34326171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armamph_1.3.png"] = { 0.28173828125, 0.31201171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armanni_1.95.png"] = { 0.25048828125, 0.28076171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armart_1.png"] = { 0.21923828125, 0.24951171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armasp_2.4.png"] = { 0.18798828125, 0.21826171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armbrtha_2.5.png"] = { 0.15673828125, 0.18701171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armcom.png"] = { 0.12548828125, 0.15576171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armcomboss.png"] = { 0.09423828125, 0.12451171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armconsul_1.35.png"] = { 0.06298828125, 0.09326171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armcroc_1.6.png"] = { 0.03173828125, 0.06201171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armfboy_1.6.png"] = { 0.00048828125, 0.03076171875, 0.03173828125, 0.06201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armfido_1.28.png"] = { 0.96923828125, 0.99951171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armguard_1.3.png"] = { 0.93798828125, 0.96826171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armham_1.05.png"] = { 0.90673828125, 0.93701171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armjanus_1.2.png"] = { 0.87548828125, 0.90576171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armjeth_0.95.png"] = { 0.84423828125, 0.87451171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armlatnk_1.3.png"] = { 0.81298828125, 0.84326171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armlun_1.8.png"] = { 0.78173828125, 0.81201171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmanni_1.55.png"] = { 0.75048828125, 0.78076171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmart_1.3.png"] = { 0.71923828125, 0.74951171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmar_t3.png"] = { 0.68798828125, 0.71826171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmav_1.3.png"] = { 0.65673828125, 0.68701171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmerl_1.55.png"] = { 0.62548828125, 0.65576171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armmlv_1.0.png"] = { 0.59423828125, 0.62451171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armnanotcplat_0.92.png"] = { 0.56298828125, 0.59326171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armnanotc_0.92.png"] = { 0.53173828125, 0.56201171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armpb_1.4.png"] = { 0.50048828125, 0.53076171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armpwt4.png"] = { 0.46923828125, 0.49951171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armrattet4.png"] = { 0.43798828125, 0.46826171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armraz_1.75.png"] = { 0.40673828125, 0.43701171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armrock_1.png"] = { 0.37548828125, 0.40576171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armsnipe_1.3.png"] = { 0.34423828125, 0.37451171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armsptkt4.png"] = { 0.31298828125, 0.34326171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armsptk_1.44.png"] = { 0.28173828125, 0.31201171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armstil_1.66.png"] = { 0.25048828125, 0.28076171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armst_1.25.png"] = { 0.21923828125, 0.24951171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armthor.png"] = { 0.18798828125, 0.21826171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armthundt4.png"] = { 0.15673828125, 0.18701171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armvadert4.png"] = { 0.12548828125, 0.15576171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armvader_0.9.png"] = { 0.09423828125, 0.12451171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armvulc_3.1.png"] = { 0.06298828125, 0.09326171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armwar_1.15.png"] = { 0.03173828125, 0.06201171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/armzeus_1.28.png"] = { 0.00048828125, 0.03076171875, 0.06298828125, 0.09326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bantha.png"] = { 0.96923828125, 0.99951171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/battlesub_t2.png"] = { 0.93798828125, 0.96826171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/beacon.png"] = { 0.90673828125, 0.93701171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/blank.png"] = { 0.87548828125, 0.90576171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot.png"] = { 0.84423828125, 0.87451171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/botrail.png"] = { 0.81298828125, 0.84326171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_aa.png"] = { 0.78173828125, 0.81201171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_arty.png"] = { 0.75048828125, 0.78076171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_jammer.png"] = { 0.71923828125, 0.74951171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_radar.png"] = { 0.68798828125, 0.71826171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_rocket.png"] = { 0.65673828125, 0.68701171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_big.png"] = { 0.62548828125, 0.65576171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_flea.png"] = { 0.59423828125, 0.62451171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_raid.png"] = { 0.56298828125, 0.59326171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_raid_0.7.png"] = { 0.53173828125, 0.56201171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_rez.png"] = { 0.50048828125, 0.53076171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t1_tinyworker.png"] = { 0.46923828125, 0.49951171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2.png"] = { 0.43798828125, 0.46826171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_aa.png"] = { 0.40673828125, 0.43701171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_arty_napalm.png"] = { 0.37548828125, 0.40576171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_big.png"] = { 0.34423828125, 0.37451171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_jammer.png"] = { 0.31298828125, 0.34326171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_radar.png"] = { 0.28173828125, 0.31201171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_raid.png"] = { 0.25048828125, 0.28076171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t2_worker.png"] = { 0.21923828125, 0.24951171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_t3.png"] = { 0.18798828125, 0.21826171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/bot_worker.png"] = { 0.15673828125, 0.18701171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/building.png"] = { 0.12548828125, 0.15576171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor.png"] = { 0.09423828125, 0.12451171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_acid.png"] = { 0.06298828125, 0.09326171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_acid_arty.png"] = { 0.03173828125, 0.06201171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_air.png"] = { 0.00048828125, 0.03076171875, 0.09423828125, 0.12451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_air_acid.png"] = { 0.96923828125, 0.99951171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_arty.png"] = { 0.93798828125, 0.96826171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_bomb.png"] = { 0.90673828125, 0.93701171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_earty.png"] = { 0.87548828125, 0.90576171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_flame.png"] = { 0.84423828125, 0.87451171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_overseer.png"] = { 0.81298828125, 0.84326171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_paralyze.png"] = { 0.78173828125, 0.81201171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_queen.png"] = { 0.75048828125, 0.78076171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_roost.png"] = { 0.71923828125, 0.74951171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_spike.png"] = { 0.68798828125, 0.71826171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_tentacle.png"] = { 0.65673828125, 0.68701171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/raptor_tentacle2.png"] = { 0.62548828125, 0.65576171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/commando.png"] = { 0.59423828125, 0.62451171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corakt4.png"] = { 0.56298828125, 0.59326171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/coramph_1.3.png"] = { 0.53173828125, 0.56201171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corasp_2.4.png"] = { 0.50048828125, 0.53076171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corban_1.6.png"] = { 0.46923828125, 0.49951171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corbhmth_1.55.png"] = { 0.43798828125, 0.46826171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corbuzz_3.85.png"] = { 0.40673828125, 0.43701171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcan_1.28.png"] = { 0.37548828125, 0.40576171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcat_1.9.png"] = { 0.34423828125, 0.37451171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcom.png"] = { 0.31298828125, 0.34326171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcomboss.png"] = { 0.28173828125, 0.31201171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcrash_0.95.png"] = { 0.25048828125, 0.28076171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corcrwt4.png"] = { 0.21923828125, 0.24951171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cordemon.png"] = { 0.18798828125, 0.21826171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cordoom_1.95.png"] = { 0.15673828125, 0.18701171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corfast_1.3.png"] = { 0.12548828125, 0.15576171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corgatreap.png"] = { 0.09423828125, 0.12451171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corgol_1.75.png"] = { 0.06298828125, 0.09326171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corhal_1.33.png"] = { 0.03173828125, 0.06201171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corhrk_1.35.png"] = { 0.00048828125, 0.03076171875, 0.12548828125, 0.15576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corintr.png"] = { 0.96923828125, 0.99951171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corint_2.3.png"] = { 0.93798828125, 0.96826171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corkarganetht4.png"] = { 0.90673828125, 0.93701171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corkarg_2.05.png"] = { 0.87548828125, 0.90576171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corlevlr_1.2.png"] = { 0.84423828125, 0.87451171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cormart_1.3.png"] = { 0.81298828125, 0.84326171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cormlv_1.0.png"] = { 0.78173828125, 0.81201171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cormort_1.3.png"] = { 0.75048828125, 0.78076171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cornanotcplat_0.92.png"] = { 0.71923828125, 0.74951171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cornanotc_0.92.png"] = { 0.68798828125, 0.71826171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corparrow_1.55.png"] = { 0.65673828125, 0.68701171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corprinter.png"] = { 0.62548828125, 0.65576171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corpun_1.3.png"] = { 0.59423828125, 0.62451171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corpyro_1.15.png"] = { 0.56298828125, 0.59326171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corroach_0.9.png"] = { 0.53173828125, 0.56201171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corseal_1.45.png"] = { 0.50048828125, 0.53076171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corshiva_2.1.png"] = { 0.46923828125, 0.49951171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corsktl.png"] = { 0.43798828125, 0.46826171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corsok_1.8.png"] = { 0.40673828125, 0.43701171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corstorm_1.png"] = { 0.37548828125, 0.40576171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corsumo_1.66.png"] = { 0.34423828125, 0.37451171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cortermite_1.5.png"] = { 0.31298828125, 0.34326171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corthud_1.05.png"] = { 0.28173828125, 0.31201171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cortoast_1.5.png"] = { 0.25048828125, 0.28076171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cortorch.png"] = { 0.21923828125, 0.24951171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cortrem_1.85.png"] = { 0.18798828125, 0.21826171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corvipe_1.4.png"] = { 0.15673828125, 0.18701171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corvroc_1.6.png"] = { 0.12548828125, 0.15576171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/corwolv_1.png"] = { 0.09423828125, 0.12451171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/cor_t2_flameworker.png"] = { 0.06298828125, 0.09326171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence.png"] = { 0.03173828125, 0.06201171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_0_0.8.png"] = { 0.00048828125, 0.03076171875, 0.15673828125, 0.18701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_0_laser2_0.94.png"] = { 0.96923828125, 0.99951171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_0_laser_0.8.png"] = { 0.93798828125, 0.96826171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1.5_laser.png"] = { 0.90673828125, 0.93701171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_1.05.png"] = { 0.87548828125, 0.90576171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_arty_1.3.png"] = { 0.84423828125, 0.87451171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_claw.png"] = { 0.81298828125, 0.84326171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_laser.png"] = { 0.78173828125, 0.81201171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_laser_1.05.png"] = { 0.75048828125, 0.78076171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_maw.png"] = { 0.71923828125, 0.74951171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_1_naval.png"] = { 0.68798828125, 0.71826171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_1.4.png"] = { 0.65673828125, 0.68701171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_arty_1.5.png"] = { 0.62548828125, 0.65576171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_laser_1.4.png"] = { 0.59423828125, 0.62451171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_mg.png"] = { 0.56298828125, 0.59326171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_missile_1.4.png"] = { 0.53173828125, 0.56201171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_2_naval.png"] = { 0.50048828125, 0.53076171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_3_1.95.png"] = { 0.46923828125, 0.49951171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_beamer.png"] = { 0.43798828125, 0.46826171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_hllllt.png"] = { 0.40673828125, 0.43701171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/defence_hllt.png"] = { 0.37548828125, 0.40576171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/droppod.png"] = { 0.34423828125, 0.37451171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/emp.png"] = { 0.31298828125, 0.34326171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energy.png"] = { 0.28173828125, 0.31201171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energy1_1.0.png"] = { 0.25048828125, 0.28076171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energy2_1.18.png"] = { 0.21923828125, 0.24951171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energy5_1.85.png"] = { 0.18798828125, 0.21826171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energy6_1.3.png"] = { 0.15673828125, 0.18701171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energystorage.png"] = { 0.12548828125, 0.15576171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/energystorage_t2.png"] = { 0.09423828125, 0.12451171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/engineer_small.png"] = { 0.06298828125, 0.09326171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/eye.png"] = { 0.03173828125, 0.06201171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/eyes.png"] = { 0.00048828125, 0.03076171875, 0.18798828125, 0.21826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_air.png"] = { 0.96923828125, 0.99951171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_air_sea.png"] = { 0.93798828125, 0.96826171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_air_t2.png"] = { 0.90673828125, 0.93701171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_air_t3.png"] = { 0.87548828125, 0.90576171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_amph.png"] = { 0.84423828125, 0.87451171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_bot.png"] = { 0.81298828125, 0.84326171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_bot_t2.png"] = { 0.78173828125, 0.81201171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_gantry.png"] = { 0.75048828125, 0.78076171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_hover.png"] = { 0.71923828125, 0.74951171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_seaplanes.png"] = { 0.68798828125, 0.71826171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_ship.png"] = { 0.65673828125, 0.68701171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_ship_t2.png"] = { 0.62548828125, 0.65576171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_vehicle.png"] = { 0.59423828125, 0.62451171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/factory_vehicle_t2.png"] = { 0.56298828125, 0.59326171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/fusion.png"] = { 0.53173828125, 0.56201171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hazardous.png"] = { 0.50048828125, 0.53076171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover.png"] = { 0.46923828125, 0.49951171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hovertrans.png"] = { 0.43798828125, 0.46826171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_aa.png"] = { 0.40673828125, 0.43701171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_gun.png"] = { 0.37548828125, 0.40576171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_raid.png"] = { 0.34423828125, 0.37451171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_t1_missile.png"] = { 0.31298828125, 0.34326171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_t2.png"] = { 0.28173828125, 0.31201171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_t3.png"] = { 0.25048828125, 0.28076171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/hover_worker.png"] = { 0.21923828125, 0.24951171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/icon_atlas.png"] = { 0.18798828125, 0.21826171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/jammer.png"] = { 0.15673828125, 0.18701171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/jammer_t15.png"] = { 0.12548828125, 0.15576171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/jammer_t1_0.9.png"] = { 0.09423828125, 0.12451171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/jammer_t2.png"] = { 0.06298828125, 0.09326171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/jammer_t2_1.2.png"] = { 0.03173828125, 0.06201171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/juggernaut.png"] = { 0.00048828125, 0.03076171875, 0.21923828125, 0.24951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/juno.png"] = { 0.96923828125, 0.99951171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/kbot_t2_shotgun.png"] = { 0.93798828125, 0.96826171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/land_assistdrone.png"] = { 0.90673828125, 0.93701171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/laserdefenset3.png"] = { 0.87548828125, 0.90576171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcom.png"] = { 0.84423828125, 0.87451171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcomt2com.png"] = { 0.81298828125, 0.84326171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcomt2_def.png"] = { 0.78173828125, 0.81201171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcom_def.png"] = { 0.75048828125, 0.78076171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcom_econ.png"] = { 0.71923828125, 0.74951171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legcom_off.png"] = { 0.68798828125, 0.71826171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legfhive.png"] = { 0.65673828125, 0.68701171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/leghive.png"] = { 0.65673828125, 0.68701171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/legkark.png"] = { 0.62548828125, 0.65576171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/lootbox.png"] = { 0.59423828125, 0.62451171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/lootboxt2.png"] = { 0.56298828125, 0.59326171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/lootboxt3.png"] = { 0.53173828125, 0.56201171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/lootboxt4.png"] = { 0.50048828125, 0.53076171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mech.png"] = { 0.46923828125, 0.49951171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/metalmaker.png"] = { 0.43798828125, 0.46826171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/metalmaker_t1_0.75.png"] = { 0.40673828125, 0.43701171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/metalmaker_t2_1.15.png"] = { 0.37548828125, 0.40576171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/metalstorage.png"] = { 0.34423828125, 0.37451171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/metalstorage_t2.png"] = { 0.31298828125, 0.34326171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mex.png"] = { 0.28173828125, 0.31201171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mex_t1_0.77.png"] = { 0.25048828125, 0.28076171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mex_t2_1.15.png"] = { 0.21923828125, 0.24951171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mine.png"] = { 0.18798828125, 0.21826171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/mission_command_tower.png"] = { 0.15673828125, 0.18701171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/nanot2.png"] = { 0.12548828125, 0.15576171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/nuke.png"] = { 0.09423828125, 0.12451171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/radar.png"] = { 0.06298828125, 0.09326171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/radar_t1_0.9.png"] = { 0.03173828125, 0.06201171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/radar_t2_1.2.png"] = { 0.00048828125, 0.03076171875, 0.25048828125, 0.28076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/scavnanotc_t1.png"] = { 0.96923828125, 0.99951171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/scavnanotc_t2.png"] = { 0.93798828125, 0.96826171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/scavnanotc_t3.png"] = { 0.90673828125, 0.93701171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/scavnanotc_t4.png"] = { 0.87548828125, 0.90576171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/seismic.png"] = { 0.84423828125, 0.87451171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/shield.png"] = { 0.81298828125, 0.84326171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship.png"] = { 0.78173828125, 0.81201171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/shipengineer.png"] = { 0.75048828125, 0.78076171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/shiptrans.png"] = { 0.71923828125, 0.74951171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_aa.png"] = { 0.68798828125, 0.71826171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_destroyer.png"] = { 0.65673828125, 0.68701171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_jammer.png"] = { 0.62548828125, 0.65576171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_pship.png"] = { 0.59423828125, 0.62451171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_raid.png"] = { 0.56298828125, 0.59326171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2.png"] = { 0.53173828125, 0.56201171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_aa.png"] = { 0.50048828125, 0.53076171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_battleship.png"] = { 0.46923828125, 0.49951171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_carrier.png"] = { 0.43798828125, 0.46826171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_cruiser.png"] = { 0.40673828125, 0.43701171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_flagship.png"] = { 0.37548828125, 0.40576171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_jammer.png"] = { 0.34423828125, 0.37451171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_missile.png"] = { 0.31298828125, 0.34326171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t2_worker.png"] = { 0.28173828125, 0.31201171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t3.png"] = { 0.25048828125, 0.28076171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t3_pt.png"] = { 0.21923828125, 0.24951171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t4_decade.png"] = { 0.18798828125, 0.21826171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t4_esuppt3.png"] = { 0.15673828125, 0.18701171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t4_pship.png"] = { 0.12548828125, 0.15576171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_t4_slrpc.png"] = { 0.09423828125, 0.12451171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_tiny.png"] = { 0.06298828125, 0.09326171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_torpedo.png"] = { 0.03173828125, 0.06201171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/ship_worker.png"] = { 0.00048828125, 0.03076171875, 0.28173828125, 0.31201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/skull.png"] = { 0.96923828125, 0.99951171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/solar.png"] = { 0.93798828125, 0.96826171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/spy.png"] = { 0.90673828125, 0.93701171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub.png"] = { 0.87548828125, 0.90576171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_rez.png"] = { 0.84423828125, 0.87451171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_t2.png"] = { 0.81298828125, 0.84326171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_t2_worker.png"] = { 0.78173828125, 0.81201171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_t3.png"] = { 0.75048828125, 0.78076171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_t3x.png"] = { 0.71923828125, 0.74951171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_t4.png"] = { 0.68798828125, 0.71826171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/sub_worker.png"] = { 0.65673828125, 0.68701171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/t3.png"] = { 0.62548828125, 0.65576171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/tacnuke.png"] = { 0.59423828125, 0.62451171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/targetting.png"] = { 0.56298828125, 0.59326171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/unknown.png"] = { 0.53173828125, 0.56201171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle.png"] = { 0.50048828125, 0.53076171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_aa.png"] = { 0.46923828125, 0.49951171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_arty.png"] = { 0.43798828125, 0.46826171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_jammer.png"] = { 0.40673828125, 0.43701171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_radar.png"] = { 0.37548828125, 0.40576171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_arty_napalm.png"] = { 0.34423828125, 0.37451171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_big.png"] = { 0.31298828125, 0.34326171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_missile.png"] = { 0.28173828125, 0.31201171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_raid.png"] = { 0.25048828125, 0.28076171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_tank.png"] = { 0.21923828125, 0.24951171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_tank_mgun.png"] = { 0.18798828125, 0.21826171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_tank_rail.png"] = { 0.15673828125, 0.18701171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t1_tiny.png"] = { 0.12548828125, 0.15576171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2.png"] = { 0.09423828125, 0.12451171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_aa.png"] = { 0.06298828125, 0.09326171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_big.png"] = { 0.03173828125, 0.06201171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_carry.png"] = { 0.00048828125, 0.03076171875, 0.31298828125, 0.34326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_jammer.png"] = { 0.96923828125, 0.99951171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_radar.png"] = { 0.93798828125, 0.96826171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_raid.png"] = { 0.90673828125, 0.93701171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_sco.png"] = { 0.87548828125, 0.90576171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_tank.png"] = { 0.84423828125, 0.87451171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_tank_rail.png"] = { 0.81298828125, 0.84326171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t2_worker.png"] = { 0.78173828125, 0.81201171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_t3.png"] = { 0.75048828125, 0.78076171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_trans.png"] = { 0.71923828125, 0.74951171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/vehicle_worker.png"] = { 0.68798828125, 0.71826171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/wall_0.4.png"] = { 0.65673828125, 0.68701171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/wind.png"] = { 0.62548828125, 0.65576171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/worker.png"] = { 0.59423828125, 0.62451171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/wrench.png"] = { 0.56298828125, 0.59326171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/aa.png"] = { 0.53173828125, 0.56201171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/aa_flak_1.4.png"] = { 0.50048828125, 0.53076171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/aa_longrange_1.8.png"] = { 0.46923828125, 0.49951171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/aa_t15.png"] = { 0.43798828125, 0.46826171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air.png"] = { 0.40673828125, 0.43701171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_assistdrone.png"] = { 0.37548828125, 0.40576171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_battleship.png"] = { 0.34423828125, 0.37451171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bladew.png"] = { 0.31298828125, 0.34326171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bomber.png"] = { 0.28173828125, 0.31201171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bomber_juno.png"] = { 0.25048828125, 0.28076171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bomber_minelayer.png"] = { 0.21923828125, 0.24951171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bomber_napalm.png"] = { 0.18798828125, 0.21826171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_bomber_sea.png"] = { 0.15673828125, 0.18701171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_flagship.png"] = { 0.12548828125, 0.15576171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_hover.png"] = { 0.09423828125, 0.12451171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_hover_bw.png"] = { 0.06298828125, 0.09326171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_hover_rocket.png"] = { 0.03173828125, 0.06201171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_kamikaze.png"] = { 0.00048828125, 0.03076171875, 0.34423828125, 0.37451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_krow.png"] = { 0.96923828125, 0.99951171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_liche.png"] = { 0.93798828125, 0.96826171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_los.png"] = { 0.90673828125, 0.93701171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_los_sea.png"] = { 0.87548828125, 0.90576171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_sea.png"] = { 0.84423828125, 0.87451171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t1_hover_sea.png"] = { 0.81298828125, 0.84326171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2.png"] = { 0.78173828125, 0.81201171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_bomber.png"] = { 0.75048828125, 0.78076171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_bomber_napalm.png"] = { 0.71923828125, 0.74951171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_hover.png"] = { 0.68798828125, 0.71826171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_hover_missile.png"] = { 0.65673828125, 0.68701171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_radar.png"] = { 0.62548828125, 0.65576171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_torpbomber.png"] = { 0.59423828125, 0.62451171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_trans.png"] = { 0.56298828125, 0.59326171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t2_worker.png"] = { 0.53173828125, 0.56201171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t3.png"] = { 0.50048828125, 0.53076171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_t4_flagship.png"] = { 0.46923828125, 0.49951171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_torp.png"] = { 0.43798828125, 0.46826171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_torp_sea.png"] = { 0.40673828125, 0.43701171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_trans.png"] = { 0.37548828125, 0.40576171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_worker.png"] = { 0.34423828125, 0.37451171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/air_worker_sea.png"] = { 0.31298828125, 0.34326171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/allterrain.png"] = { 0.28173828125, 0.31201171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/allterrain_emp.png"] = { 0.25048828125, 0.28076171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/allterrain_t2_rail.png"] = { 0.21923828125, 0.24951171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/allterrain_vanguard_2.4.png"] = { 0.18798828125, 0.21826171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib.png"] = { 0.15673828125, 0.18701171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_aa.png"] = { 0.12548828125, 0.15576171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_t2.png"] = { 0.09423828125, 0.12451171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_t2_aa.png"] = { 0.06298828125, 0.09326171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_t3.png"] = { 0.03173828125, 0.06201171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_tank.png"] = { 0.00048828125, 0.03076171875, 0.37548828125, 0.40576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/amphib_worker.png"] = { 0.96923828125, 0.99951171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/antinuke.png"] = { 0.93798828125, 0.96826171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/antinukemobile.png"] = { 0.90673828125, 0.93701171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armamb_1.5.png"] = { 0.87548828125, 0.90576171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armamph_1.3.png"] = { 0.84423828125, 0.87451171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armanni_1.95.png"] = { 0.81298828125, 0.84326171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armart_1.png"] = { 0.78173828125, 0.81201171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armasp_2.4.png"] = { 0.75048828125, 0.78076171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armbrtha_2.5.png"] = { 0.71923828125, 0.74951171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armcom.png"] = { 0.68798828125, 0.71826171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armcomboss.png"] = { 0.65673828125, 0.68701171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armconsul_1.35.png"] = { 0.62548828125, 0.65576171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armcroc_1.6.png"] = { 0.59423828125, 0.62451171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armfboy_1.6.png"] = { 0.56298828125, 0.59326171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armfido_1.28.png"] = { 0.53173828125, 0.56201171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armguard_1.3.png"] = { 0.50048828125, 0.53076171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armham_1.05.png"] = { 0.46923828125, 0.49951171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armjanus_1.2.png"] = { 0.43798828125, 0.46826171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armjeth_0.95.png"] = { 0.40673828125, 0.43701171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armlatnk_1.3.png"] = { 0.37548828125, 0.40576171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armlun_1.8.png"] = { 0.34423828125, 0.37451171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armmanni_1.55.png"] = { 0.31298828125, 0.34326171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armmart_1.3.png"] = { 0.28173828125, 0.31201171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armmav_1.3.png"] = { 0.25048828125, 0.28076171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armmerl_1.55.png"] = { 0.21923828125, 0.24951171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armmlv_1.0.png"] = { 0.18798828125, 0.21826171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armnanotcplat_0.92.png"] = { 0.15673828125, 0.18701171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armnanotc_0.92.png"] = { 0.12548828125, 0.15576171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armpb_1.4.png"] = { 0.09423828125, 0.12451171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armpwt4.png"] = { 0.06298828125, 0.09326171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armrattet4.png"] = { 0.03173828125, 0.06201171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armraz_1.75.png"] = { 0.00048828125, 0.03076171875, 0.40673828125, 0.43701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armrock_1.png"] = { 0.96923828125, 0.99951171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armsnipe_1.3.png"] = { 0.93798828125, 0.96826171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armsptkt4.png"] = { 0.90673828125, 0.93701171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armsptk_1.44.png"] = { 0.87548828125, 0.90576171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armstil_1.66.png"] = { 0.84423828125, 0.87451171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armst_1.25.png"] = { 0.81298828125, 0.84326171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armthor.png"] = { 0.78173828125, 0.81201171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armthundt4.png"] = { 0.75048828125, 0.78076171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armvadert4.png"] = { 0.71923828125, 0.74951171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armvader_0.9.png"] = { 0.68798828125, 0.71826171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armvulc_3.1.png"] = { 0.65673828125, 0.68701171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armwar_1.15.png"] = { 0.62548828125, 0.65576171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/armzeus_1.28.png"] = { 0.59423828125, 0.62451171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bantha.png"] = { 0.56298828125, 0.59326171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/battlesub_t2.png"] = { 0.53173828125, 0.56201171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/beacon.png"] = { 0.50048828125, 0.53076171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/blank.png"] = { 0.46923828125, 0.49951171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot.png"] = { 0.43798828125, 0.46826171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/botrail.png"] = { 0.40673828125, 0.43701171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_aa.png"] = { 0.37548828125, 0.40576171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_arty.png"] = { 0.34423828125, 0.37451171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_jammer.png"] = { 0.31298828125, 0.34326171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_radar.png"] = { 0.28173828125, 0.31201171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_rocket.png"] = { 0.25048828125, 0.28076171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_big.png"] = { 0.21923828125, 0.24951171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_flea.png"] = { 0.18798828125, 0.21826171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_raid.png"] = { 0.15673828125, 0.18701171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_raid_0.7.png"] = { 0.12548828125, 0.15576171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_rez.png"] = { 0.09423828125, 0.12451171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t1_tinyworker.png"] = { 0.06298828125, 0.09326171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2.png"] = { 0.03173828125, 0.06201171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_aa.png"] = { 0.00048828125, 0.03076171875, 0.43798828125, 0.46826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_arty_napalm.png"] = { 0.96923828125, 0.99951171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_big.png"] = { 0.93798828125, 0.96826171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_jammer.png"] = { 0.90673828125, 0.93701171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_radar.png"] = { 0.87548828125, 0.90576171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_raid.png"] = { 0.84423828125, 0.87451171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t2_worker.png"] = { 0.81298828125, 0.84326171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_t3.png"] = { 0.78173828125, 0.81201171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/bot_worker.png"] = { 0.75048828125, 0.78076171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/building.png"] = { 0.71923828125, 0.74951171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/raptor.png"] = { 0.68798828125, 0.71826171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/raptor_air.png"] = { 0.65673828125, 0.68701171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/raptor_queen.png"] = { 0.62548828125, 0.65576171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/raptor_roost.png"] = { 0.59423828125, 0.62451171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/commando.png"] = { 0.56298828125, 0.59326171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corakt4.png"] = { 0.53173828125, 0.56201171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/coramph_1.3.png"] = { 0.50048828125, 0.53076171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corasp_2.4.png"] = { 0.46923828125, 0.49951171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corban_1.6.png"] = { 0.43798828125, 0.46826171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corbhmth_1.55.png"] = { 0.40673828125, 0.43701171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corbuzz_3.85.png"] = { 0.37548828125, 0.40576171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcan_1.28.png"] = { 0.34423828125, 0.37451171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcat_1.9.png"] = { 0.31298828125, 0.34326171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcom.png"] = { 0.28173828125, 0.31201171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcomboss.png"] = { 0.25048828125, 0.28076171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcrash_0.95.png"] = { 0.21923828125, 0.24951171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corcrwt4.png"] = { 0.18798828125, 0.21826171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cordemon.png"] = { 0.15673828125, 0.18701171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cordoom_1.95.png"] = { 0.12548828125, 0.15576171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corfast_1.3.png"] = { 0.09423828125, 0.12451171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corgatreap.png"] = { 0.06298828125, 0.09326171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corgol_1.75.png"] = { 0.03173828125, 0.06201171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corhal_1.33.png"] = { 0.00048828125, 0.03076171875, 0.46923828125, 0.49951171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corhrk_1.35.png"] = { 0.96923828125, 0.99951171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corintr.png"] = { 0.93798828125, 0.96826171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corint_2.3.png"] = { 0.90673828125, 0.93701171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corkarganetht4.png"] = { 0.87548828125, 0.90576171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corkarg_2.05.png"] = { 0.84423828125, 0.87451171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corkark.png"] = { 0.81298828125, 0.84326171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corlevlr_1.2.png"] = { 0.78173828125, 0.81201171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cormart_1.3.png"] = { 0.75048828125, 0.78076171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cormlv_1.0.png"] = { 0.71923828125, 0.74951171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cormort_1.3.png"] = { 0.68798828125, 0.71826171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cornanotcplat_0.92.png"] = { 0.65673828125, 0.68701171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cornanotc_0.92.png"] = { 0.62548828125, 0.65576171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corparrow_1.55.png"] = { 0.59423828125, 0.62451171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corpun_1.3.png"] = { 0.56298828125, 0.59326171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corpyro_1.15.png"] = { 0.53173828125, 0.56201171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corroach_0.9.png"] = { 0.50048828125, 0.53076171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corseal_1.45.png"] = { 0.46923828125, 0.49951171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corshiva_2.1.png"] = { 0.43798828125, 0.46826171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corsktl.png"] = { 0.40673828125, 0.43701171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corsok_1.8.png"] = { 0.37548828125, 0.40576171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corstorm_1.png"] = { 0.34423828125, 0.37451171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corsumo_1.66.png"] = { 0.31298828125, 0.34326171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cortermite_1.5.png"] = { 0.28173828125, 0.31201171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corthud_1.05.png"] = { 0.25048828125, 0.28076171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cortoast_1.5.png"] = { 0.21923828125, 0.24951171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cortrem_1.85.png"] = { 0.18798828125, 0.21826171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corvipe_1.4.png"] = { 0.15673828125, 0.18701171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corvroc_1.6.png"] = { 0.12548828125, 0.15576171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/corwolv_1.png"] = { 0.09423828125, 0.12451171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/cor_t2_flameworker.png"] = { 0.06298828125, 0.09326171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence.png"] = { 0.03173828125, 0.06201171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_0_0.8.png"] = { 0.00048828125, 0.03076171875, 0.50048828125, 0.53076171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_0_laser2_0.94.png"] = { 0.96923828125, 0.99951171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_0_laser_0.8.png"] = { 0.93798828125, 0.96826171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1.5_laser.png"] = { 0.90673828125, 0.93701171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_1.05.png"] = { 0.87548828125, 0.90576171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_arty_1.3.png"] = { 0.84423828125, 0.87451171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_claw.png"] = { 0.81298828125, 0.84326171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_laser.png"] = { 0.78173828125, 0.81201171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_laser_1.05.png"] = { 0.75048828125, 0.78076171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_maw.png"] = { 0.71923828125, 0.74951171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_1_naval.png"] = { 0.68798828125, 0.71826171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_1.4.png"] = { 0.65673828125, 0.68701171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_arty_1.5.png"] = { 0.62548828125, 0.65576171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_laser_1.4.png"] = { 0.59423828125, 0.62451171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_mg.png"] = { 0.56298828125, 0.59326171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_missile_1.4.png"] = { 0.53173828125, 0.56201171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_2_naval.png"] = { 0.50048828125, 0.53076171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_3_1.95.png"] = { 0.46923828125, 0.49951171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_beamer.png"] = { 0.43798828125, 0.46826171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_hllllt.png"] = { 0.40673828125, 0.43701171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defence_hllt.png"] = { 0.37548828125, 0.40576171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/defense_master_shape.png"] = { 0.34423828125, 0.37451171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/droppod.png"] = { 0.31298828125, 0.34326171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/emp.png"] = { 0.28173828125, 0.31201171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energy.png"] = { 0.25048828125, 0.28076171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energy1_1.0.png"] = { 0.21923828125, 0.24951171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energy2_1.18.png"] = { 0.18798828125, 0.21826171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energy5_1.85.png"] = { 0.15673828125, 0.18701171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energy6_1.3.png"] = { 0.12548828125, 0.15576171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energystorage.png"] = { 0.09423828125, 0.12451171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/energystorage_t2.png"] = { 0.06298828125, 0.09326171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/engineer_small.png"] = { 0.03173828125, 0.06201171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/estore.png"] = { 0.00048828125, 0.03076171875, 0.53173828125, 0.56201171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/eye.png"] = { 0.96923828125, 0.99951171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/eyes.png"] = { 0.93798828125, 0.96826171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_air.png"] = { 0.90673828125, 0.93701171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_air_sea.png"] = { 0.87548828125, 0.90576171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_air_t2.png"] = { 0.84423828125, 0.87451171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_air_t3.png"] = { 0.81298828125, 0.84326171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_amph.png"] = { 0.78173828125, 0.81201171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_bot.png"] = { 0.75048828125, 0.78076171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_bot_t2.png"] = { 0.71923828125, 0.74951171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_gantry.png"] = { 0.68798828125, 0.71826171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_hover.png"] = { 0.65673828125, 0.68701171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_seaplanes.png"] = { 0.62548828125, 0.65576171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_ship.png"] = { 0.59423828125, 0.62451171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_ship_t2.png"] = { 0.56298828125, 0.59326171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_vehicle.png"] = { 0.53173828125, 0.56201171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/factory_vehicle_t2.png"] = { 0.50048828125, 0.53076171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/fusion.png"] = { 0.46923828125, 0.49951171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hazardous.png"] = { 0.43798828125, 0.46826171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover.png"] = { 0.40673828125, 0.43701171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hovertrans.png"] = { 0.37548828125, 0.40576171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_aa.png"] = { 0.34423828125, 0.37451171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_gun.png"] = { 0.31298828125, 0.34326171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_raid.png"] = { 0.28173828125, 0.31201171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_t1_missile.png"] = { 0.25048828125, 0.28076171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_t2.png"] = { 0.21923828125, 0.24951171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_t3.png"] = { 0.18798828125, 0.21826171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/hover_worker.png"] = { 0.15673828125, 0.18701171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/jammer.png"] = { 0.12548828125, 0.15576171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/jammer_t15.png"] = { 0.09423828125, 0.12451171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/jammer_t1_0.9.png"] = { 0.06298828125, 0.09326171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/jammer_t2.png"] = { 0.03173828125, 0.06201171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/juggernaut.png"] = { 0.00048828125, 0.03076171875, 0.56298828125, 0.59326171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/juno.png"] = { 0.96923828125, 0.99951171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/kbot_t2_shotgun.png"] = { 0.93798828125, 0.96826171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/laserdefenset3.png"] = { 0.90673828125, 0.93701171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legcomt2com.png"] = { 0.87548828125, 0.90576171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legcomt2_def.png"] = { 0.84423828125, 0.87451171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legcom_def.png"] = { 0.81298828125, 0.84326171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legcom_econ.png"] = { 0.78173828125, 0.81201171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legcom_off.png"] = { 0.75048828125, 0.78076171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/legfhive.png"] = { 0.71923828125, 0.74951171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/leghive.png"] = { 0.71923828125, 0.74951171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/lootbox.png"] = { 0.68798828125, 0.71826171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/lootboxt2.png"] = { 0.65673828125, 0.68701171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/lootboxt3.png"] = { 0.62548828125, 0.65576171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/lootboxt4.png"] = { 0.59423828125, 0.62451171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mech.png"] = { 0.56298828125, 0.59326171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/metalmaker.png"] = { 0.53173828125, 0.56201171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/metalmaker_t1_0.75.png"] = { 0.50048828125, 0.53076171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/metalmaker_t2_1.15.png"] = { 0.46923828125, 0.49951171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/metalstorage.png"] = { 0.43798828125, 0.46826171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/metalstorage_t2.png"] = { 0.40673828125, 0.43701171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mex.png"] = { 0.37548828125, 0.40576171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mex_t1_0.77.png"] = { 0.34423828125, 0.37451171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mex_t2_1.15.png"] = { 0.31298828125, 0.34326171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mine.png"] = { 0.28173828125, 0.31201171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mission_command_tower.png"] = { 0.25048828125, 0.28076171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/mstore.png"] = { 0.21923828125, 0.24951171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/nanot2.png"] = { 0.18798828125, 0.21826171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/nuke.png"] = { 0.15673828125, 0.18701171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/radar.png"] = { 0.12548828125, 0.15576171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/radar_t1_0.9.png"] = { 0.09423828125, 0.12451171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/radar_t2_1.2.png"] = { 0.06298828125, 0.09326171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/Rocket.png"] = { 0.03173828125, 0.06201171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/scavnanotc_t1.png"] = { 0.00048828125, 0.03076171875, 0.59423828125, 0.62451171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/scavnanotc_t2.png"] = { 0.96923828125, 0.99951171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/scavnanotc_t3.png"] = { 0.93798828125, 0.96826171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/scavnanotc_t4.png"] = { 0.90673828125, 0.93701171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/seismic.png"] = { 0.87548828125, 0.90576171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/shield.png"] = { 0.84423828125, 0.87451171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship.png"] = { 0.81298828125, 0.84326171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/shipengineer.png"] = { 0.78173828125, 0.81201171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/shiptrans.png"] = { 0.75048828125, 0.78076171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_aa.png"] = { 0.71923828125, 0.74951171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_destroyer.png"] = { 0.68798828125, 0.71826171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_jammer.png"] = { 0.65673828125, 0.68701171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_pship.png"] = { 0.62548828125, 0.65576171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_raid.png"] = { 0.59423828125, 0.62451171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2.png"] = { 0.56298828125, 0.59326171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_aa.png"] = { 0.53173828125, 0.56201171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_battleship.png"] = { 0.50048828125, 0.53076171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_carrier.png"] = { 0.46923828125, 0.49951171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_cruiser.png"] = { 0.43798828125, 0.46826171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_flagship.png"] = { 0.40673828125, 0.43701171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_jammer.png"] = { 0.37548828125, 0.40576171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_missile.png"] = { 0.34423828125, 0.37451171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t2_worker.png"] = { 0.31298828125, 0.34326171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t3.png"] = { 0.28173828125, 0.31201171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t3_pt.png"] = { 0.25048828125, 0.28076171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t4_decade.png"] = { 0.21923828125, 0.24951171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t4_esuppt3.png"] = { 0.18798828125, 0.21826171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t4_pship.png"] = { 0.15673828125, 0.18701171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_t4_slrpc.png"] = { 0.12548828125, 0.15576171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_tiny.png"] = { 0.09423828125, 0.12451171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_torpedo.png"] = { 0.06298828125, 0.09326171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/ship_worker.png"] = { 0.03173828125, 0.06201171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/skull.png"] = { 0.00048828125, 0.03076171875, 0.62548828125, 0.65576171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/solar.png"] = { 0.96923828125, 0.99951171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/spy.png"] = { 0.93798828125, 0.96826171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub.png"] = { 0.90673828125, 0.93701171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_rez.png"] = { 0.87548828125, 0.90576171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_t2.png"] = { 0.84423828125, 0.87451171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_t2_worker.png"] = { 0.81298828125, 0.84326171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_t3.png"] = { 0.78173828125, 0.81201171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_t3x.png"] = { 0.75048828125, 0.78076171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_t4.png"] = { 0.71923828125, 0.74951171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/sub_worker.png"] = { 0.68798828125, 0.71826171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/tacnuke.png"] = { 0.65673828125, 0.68701171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/targetting.png"] = { 0.62548828125, 0.65576171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/unknown.png"] = { 0.59423828125, 0.62451171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle.png"] = { 0.56298828125, 0.59326171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_aa.png"] = { 0.53173828125, 0.56201171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_arty.png"] = { 0.50048828125, 0.53076171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_jammer.png"] = { 0.46923828125, 0.49951171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_radar.png"] = { 0.43798828125, 0.46826171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_arty_napalm.png"] = { 0.40673828125, 0.43701171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_big.png"] = { 0.37548828125, 0.40576171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_missile.png"] = { 0.34423828125, 0.37451171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_raid.png"] = { 0.31298828125, 0.34326171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_tank.png"] = { 0.28173828125, 0.31201171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_tank_mgun.png"] = { 0.25048828125, 0.28076171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_tank_rail.png"] = { 0.21923828125, 0.24951171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t1_tiny.png"] = { 0.18798828125, 0.21826171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2.png"] = { 0.15673828125, 0.18701171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_aa.png"] = { 0.12548828125, 0.15576171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_big.png"] = { 0.09423828125, 0.12451171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_carry.png"] = { 0.06298828125, 0.09326171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_jammer.png"] = { 0.03173828125, 0.06201171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_radar.png"] = { 0.00048828125, 0.03076171875, 0.65673828125, 0.68701171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_raid.png"] = { 0.96923828125, 0.99951171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_sco.png"] = { 0.93798828125, 0.96826171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_tank.png"] = { 0.90673828125, 0.93701171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_tank_rail.png"] = { 0.87548828125, 0.90576171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t2_worker.png"] = { 0.84423828125, 0.87451171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_t3.png"] = { 0.81298828125, 0.84326171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_trans.png"] = { 0.78173828125, 0.81201171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/vehicle_worker.png"] = { 0.75048828125, 0.78076171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/wall_0.4.png"] = { 0.71923828125, 0.74951171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/wind.png"] = { 0.68798828125, 0.71826171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/worker.png"] = { 0.65673828125, 0.68701171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh + ["icons/inverted/wrench.png"] = { 0.62548828125, 0.65576171875, 0.68798828125, 0.71826171875, 0.03125, 0.03125 }, --xXyYwh } return atlas diff --git a/init.lua b/init.lua index 1eb9d0840a7..d5c3ebbd2b7 100644 --- a/init.lua +++ b/init.lua @@ -2,53 +2,53 @@ -- Universal Lua functions applicable to any Lua code -- These add missing base lua functionality -VFS.Include('common/numberfunctions.lua') -VFS.Include('common/stringFunctions.lua') -VFS.Include('common/tablefunctions.lua') -Json = Json or VFS.Include('common/luaUtilities/json.lua') +VFS.Include("common/numberfunctions.lua") +VFS.Include("common/stringFunctions.lua") +VFS.Include("common/tablefunctions.lua") +Json = Json or VFS.Include("common/luaUtilities/json.lua") -VFS.Include('common/springOverrides.lua') +VFS.Include("common/springOverrides.lua") local environment = Script.GetName and Script.GetName() or "LuaParser" local commonFunctions = { spring = { - LuaMenu = true, - LuaIntro = true, + LuaMenu = true, + LuaIntro = true, LuaParser = true, - LuaRules = true, - LuaGaia = true, - LuaUI = true, + LuaRules = true, + LuaGaia = true, + LuaUI = true, }, i18n = { - LuaMenu = true, - LuaIntro = true, - LuaUI = true, + LuaMenu = true, + LuaIntro = true, + LuaUI = true, }, cmd = { - LuaRules = true, - LuaUI = true, + LuaRules = true, + LuaUI = true, }, map = { - LuaRules = true, - LuaUI = true, + LuaRules = true, + LuaUI = true, }, graphics = { - LuaRules = true, - LuaUI = true, + LuaRules = true, + LuaUI = true, }, } if commonFunctions.spring[environment] then - local springFunctions = VFS.Include('common/springFunctions.lua') + local springFunctions = VFS.Include("common/springFunctions.lua") Spring.Utilities = Spring.Utilities or springFunctions.Utilities Spring.Debug = Spring.Debug or springFunctions.Debug - VFS.Include('common/platformFunctions.lua') - VFS.Include('common/constants.lua') + VFS.Include("common/platformFunctions.lua") + VFS.Include("common/constants.lua") end if commonFunctions.i18n[environment] then diff --git a/language/test_unicode.lua b/language/test_unicode.lua index ce9448d7423..30cb51cb8f3 100644 --- a/language/test_unicode.lua +++ b/language/test_unicode.lua @@ -162,36 +162,36 @@ return { morph = "Upgrade", morph_tooltip = "Upgrade to next Tech-level (second click to cancel)", -- Stateful orders - ['Fire at will'] = "Fire at will", - ['Hold fire'] = "Hold fire", - ['Return fire'] = "Return fire", + ["Fire at will"] = "Fire at will", + ["Hold fire"] = "Hold fire", + ["Return fire"] = "Return fire", firestate_tooltip = "Set under what conditions a unit should start firing at enemies (without explicit attack order)", - ['Hold pos'] = "Hold pos", - ['Maneuver'] = "Maneuver", + ["Hold pos"] = "Hold pos", + ["Maneuver"] = "Maneuver", movestate_tooltip = "Set how far out of its way a unit should move to attack enemies", - ['Roam'] = "Roam", - ['Repeat on'] = "Repeat", - ['Repeat off'] = "Repeat", + ["Roam"] = "Roam", + ["Repeat on"] = "Repeat", + ["Repeat off"] = "Repeat", repeat_tooltip = "Repeat unit command queue", - ['Low Prio'] = "Priority", - ['High Prio'] = "Priority", + ["Low Prio"] = "Priority", + ["High Prio"] = "Priority", priority_tooltip = "Assigns resources to use for this builder when not having enough for all", - ['Decloaked'] = "Cloaked", - ['Cloaked'] = "Cloaked", + ["Decloaked"] = "Cloaked", + ["Cloaked"] = "Cloaked", wantcloak_tooltip = "Invisibility state", - [' On '] = "On", - [' Off '] = "On", + [" On "] = "On", + [" Off "] = "On", onoff_tooltip = "Active state: turn a unit on/off", - ['Fighters'] = "Fighters", - ['Bombers'] = "Bombers", - ['No priority'] = "No priority", + ["Fighters"] = "Fighters", + ["Bombers"] = "Bombers", + ["No priority"] = "No priority", setpriority_tooltip = "Set target priority Fighters/Bombers/no priority", - [' Fly '] = "Land", - ['Land'] = "Land", + [" Fly "] = "Land", + ["Land"] = "Land", idlemode_tooltip = "Sets what aircraft do when idle", csSpawning_tooltip = "Sets the spawning state of the carrier", - ['Low traj'] = "High Traj", - ['High traj'] = "High Traj", + ["Low traj"] = "High Traj", + ["High traj"] = "High Traj", trajectory_tooltip = "Sets fire mode in artillery state (firing upwards instead of forwards)", customOnOff = { lowTrajectory = "Low Trajectory", @@ -200,7 +200,7 @@ return { gaussCannon = "Gauss Cannon", heavyPlasma = "Heavy Plasma", gauss_tooltip = "Switches between Gauss Cannon and Heavy Plasma Cannon", - } + }, }, moveGameWindow = { moveWindow = "%{textColor}Move window position with the %{emphasisColor}arrow keys%{textColor} or %{emphasisColor}drag%{textColor} using the mouse.", @@ -594,7 +594,7 @@ return { removed = "No Owner Mode: Removing Team %{team}", destroyed = "No Owner Mode: Destroying Team %{team}", disconnected = "No Owner Mode: Team %{team} has %{gracePeriod} minute(s) to reconnect", - reconnected= "No Owner Mode: Team %{team} reconnected", + reconnected = "No Owner Mode: Team %{team} reconnected", }, unitTotals = { totals = "%{titleColor}Units %{textColor}%{units} / %{maxUnits} %{titleColor}Total %{textColor}%{totalUnits}", @@ -636,8 +636,8 @@ return { eventMiniboss = "Alert! Miniboss Detected.", eventSwarm = "Warning! Scavenger swarm detected.", eventCloud = "Alert! Scavenger cloud approaching.", - reinforcements = "%{player}'s reinforcements detected. Unit type: %{unit}." - } + reinforcements = "%{player}'s reinforcements detected. Unit type: %{unit}.", + }, }, tips = { @@ -686,7 +686,7 @@ return { groups = "You can assign units to groups by pressing CTRL+(0-9).\nSelect the group by pressing the group number (0-9).", screenBombers = "When performing a bombing run fly your fighters first to eliminate the enemy's fighter-wall.\nUse the Fight or Patrol commands for more effective engagement.", disableAntiNukes = "You can disable enemy anti-nukes using EMP missiles, available to Armada at T2.", - howShieldsWork = "Shields are \"plasma deflector shields.\" They only deflect plasma shells, everything else will go through.", + howShieldsWork = 'Shields are "plasma deflector shields." They only deflect plasma shells, everything else will go through.', mohoGeoExplosion = "Don't build too much around your T2 Geothermal Powerplants, when they die everything will go boom!", joinDiscord = "If you encounter a bug, or have a great idea, or want to contribute in any way, please join BAR on Discord.", destroyFighters = "Build long range anti-air on an extended front line to slowly dismantle the enemy's fighter-wall.", @@ -1192,11 +1192,11 @@ return { corroy = "Enforcer", corsb = "Dam Buster", corscreamer = "Screamer", - corscavdrag="Dragon's Teeth", - corscavfort="Fortification Wall", - corscavdtm="Missile Wall", - corscavdtl="Dragon's Claw", - corscavdtf="Dragon's Maw", + corscavdrag = "Dragon's Teeth", + corscavfort = "Fortification Wall", + corscavdtm = "Missile Wall", + corscavdtl = "Dragon's Claw", + corscavdtf = "Dragon's Maw", corsd = "Nemesis", corseah = "Seahook", corseal = "Croc", @@ -1744,11 +1744,11 @@ return { corscreamer = "Long Range Anti-Air Tower", corscreamer_scav = "Customized Long Range AA", corsd = "Intrusion Countermeasure System", - corscavdrag="Dragon's Teeth", - corscavfort="Fortification Wall", - corscavdtm="Pop-up Missile Turret", - corscavdtl="Pop-up Lightning Turret", - corscavdtf="Pop-up Flamethrower Turret", + corscavdrag = "Dragon's Teeth", + corscavfort = "Fortification Wall", + corscavdtm = "Pop-up Missile Turret", + corscavdtl = "Pop-up Lightning Turret", + corscavdtf = "Pop-up Flamethrower Turret", corseah = "Assault Heavy Transport", corseal = "Medium Amphibious Tank", corseap = "Torpedo Gunship", @@ -1845,8 +1845,8 @@ return { resourcecheat = "INFINITE RESOURCES", raptor_hive = "Spawns Raptor", scavdrag = "Dragon's Teeth", - scavdtf = "Flamethrower Turret", - scavdtl = "Lightning Turret", + scavdtf = "Flamethrower Turret", + scavdtl = "Lightning Turret", scavempspawner = "Spawning a new nuke", scavengerdroppod = "\0", --ASCII NULL character, empty string crashes i18n scavengerdroppodbeacon = "Calls in Scavenger drops", @@ -1911,15 +1911,15 @@ return { ferns = "Ferns", fernStone = "Ferns and Stone", fernStones = "Ferns and Stones", - ['streetlamp_1'] = "Large Streetlamp", + ["streetlamp_1"] = "Large Streetlamp", obelisk = "Obelisk of Seth", peyote = "Peyote", - ['pipe1.0'] = "Pipe 1.0", - ['pipe2.0'] = "Pipe 2.0", - ['pipe3.0'] = "Pipe 3.0", - ['pipe4.0'] = "Pipe 4.0", - ['pipe5.0'] = "Pipe 5.0", - ['pipe6.0'] = "Pipe 6.0", + ["pipe1.0"] = "Pipe 1.0", + ["pipe2.0"] = "Pipe 2.0", + ["pipe3.0"] = "Pipe 3.0", + ["pipe4.0"] = "Pipe 4.0", + ["pipe5.0"] = "Pipe 5.0", + ["pipe6.0"] = "Pipe 6.0", pipeline = "Pipeline", industrial_structure_pipes_1 = "Building Pipes", pressurevalve = "Pressure Valve", @@ -1938,5 +1938,5 @@ return { heap = "Debris", }, }, - } + }, } diff --git a/luaai.lua b/luaai.lua index d617841e60d..f1bd71d8522 100644 --- a/luaai.lua +++ b/luaai.lua @@ -8,26 +8,26 @@ -- return { - { - name = 'SimpleAI', - desc = 'EasyAI' - }, - { - name = 'SimpleDefenderAI', - desc = 'EasyAI' - }, - { - name = 'SimpleConstructorAI', - desc = 'EasyAI' - }, - { - name = 'ScavengersAI', - desc = 'Infinite Games' - }, - { - name = 'RaptorsAI', - desc = 'Raptor Defence' - }, + { + name = "SimpleAI", + desc = "EasyAI", + }, + { + name = "SimpleDefenderAI", + desc = "EasyAI", + }, + { + name = "SimpleConstructorAI", + desc = "EasyAI", + }, + { + name = "ScavengersAI", + desc = "Infinite Games", + }, + { + name = "RaptorsAI", + desc = "Raptor Defence", + }, } -------------------------------------------------------------------------------- diff --git a/luaintro/Addons/engine_taskbar_control.lua b/luaintro/Addons/engine_taskbar_control.lua index 98118775787..1038bb2dc26 100644 --- a/luaintro/Addons/engine_taskbar_control.lua +++ b/luaintro/Addons/engine_taskbar_control.lua @@ -1,14 +1,13 @@ - function addon:GetInfo() - return { - name = "Engine Taskbar Stuff", - desc = 'Icon, name', - author = "KingRaptor", - date = "13 July 2011", - license = "Public Domain", - layer = -math.huge, - enabled = true, - } + return { + name = "Engine Taskbar Stuff", + desc = "Icon, name", + author = "KingRaptor", + date = "13 July 2011", + license = "Public Domain", + layer = -math.huge, + enabled = true, + } end function addon:Initialize() diff --git a/luaintro/Addons/loadprogress.lua b/luaintro/Addons/loadprogress.lua index 2d1353bdaad..e69c01b1e1c 100644 --- a/luaintro/Addons/loadprogress.lua +++ b/luaintro/Addons/loadprogress.lua @@ -1,28 +1,29 @@ - if addon.InGetInfo then return { - name = "LoadProgress", - desc = "", - author = "jK", - date = "2012", + name = "LoadProgress", + desc = "", + author = "jK", + date = "2012", license = "GPL2", - layer = 0, + layer = 0, enabled = true, } end -local tips = require "savetable.lua" +local tips = require("savetable.lua") local startTime = -1 -local cachedLoadTimes = VFS.FileExists("loadprogress_cached.lua") and VFS.Include("loadprogress_cached.lua") or { } +local cachedLoadTimes = VFS.FileExists("loadprogress_cached.lua") and VFS.Include("loadprogress_cached.lua") or {} local cachedTotalTime = (cachedLoadTimes[Game.mapName] or -1) * 0.97 --*0.97 cause else last rendered frame would show 99% -local function mix(x,y,a) - return x * (1-a) + y * a +local function mix(x, y, a) + return x * (1 - a) + y * a end function SG.GetLoadProgress() - if startTime < 0 then startTime = os.clock() end + if startTime < 0 then + startTime = os.clock() + end if cachedTotalTime > 0 then return math.clamp((os.clock() - startTime) / cachedTotalTime, 0, 1) @@ -35,4 +36,3 @@ function addon.Shutdown() cachedLoadTimes[Game.mapName] = os.clock() - startTime table.save(cachedLoadTimes, "loadprogress_cached.lua") end - diff --git a/luaintro/Addons/main.lua b/luaintro/Addons/main.lua index bec793055aa..4f23873afd8 100644 --- a/luaintro/Addons/main.lua +++ b/luaintro/Addons/main.lua @@ -1,18 +1,18 @@ if addon.InGetInfo then return { - name = "Main", - desc = "loadbar and tips", - author = "jK, Floris", - date = "2012", + name = "Main", + desc = "loadbar and tips", + author = "jK, Floris", + date = "2012", license = "GPL2", - layer = 0, - depend = {"LoadProgress"}, + layer = 0, + depend = { "LoadProgress" }, enabled = true, } end local showTipAboveBar = true -local showTipBackground = false -- false = tips shown below the loading bar +local showTipBackground = false -- false = tips shown below the loading bar local gameID local usingIntelPotato = false @@ -20,7 +20,10 @@ local infolog = VFS.LoadFile("infolog.txt") if infolog then local function lines(str) local t = {} - local function helper(line) table.insert(t, line) return "" end + local function helper(line) + table.insert(t, line) + return "" + end helper((str:gsub("(.-)\r?\n", helper))) return t end @@ -28,29 +31,29 @@ if infolog then -- store changelog into array local fileLines = lines(infolog) for i, line in ipairs(fileLines) do - if string.sub(line, 1, 3) == '[F=' then + if string.sub(line, 1, 3) == "[F=" then break end - if string.find(line, 'GL vendor') then - if string.find(string.lower(line), 'intel') then + if string.find(line, "GL vendor") then + if string.find(string.lower(line), "intel") then usingIntelPotato = true end end - if string.find(line, 'GLSL version') then - if string.find(string.lower(line), 'intel') then + if string.find(line, "GLSL version") then + if string.find(string.lower(line), "intel") then usingIntelPotato = true end end - if string.find(line, 'GL renderer') then - if string.find(string.lower(line), 'intel') then + if string.find(line, "GL renderer") then + if string.find(string.lower(line), "intel") then usingIntelPotato = true end - if string.find(string.lower(line), 'intel') and string.find(string.lower(line), 'arc') then + if string.find(string.lower(line), "intel") and string.find(string.lower(line), "arc") then usingIntelPotato = false end end - if string.find(line, '001] GameID: ') then - gameID = string.sub(line, string.find(line, ': ')+2) + if string.find(line, "001] GameID: ") then + gameID = string.sub(line, string.find(line, ": ") + 2) end end end @@ -71,12 +74,12 @@ for _, teamID in ipairs(teamList) do local luaAI = Spring.GetTeamLuaAI(teamID) if luaAI then if luaAI:find("Raptors") then - loadscreens = VFS.DirList(loadscreenPath.."manual/raptors/") + loadscreens = VFS.DirList(loadscreenPath .. "manual/raptors/") if loadscreens[1] then break end elseif luaAI:find("Scavengers") then - loadscreens = VFS.DirList(loadscreenPath.."manual/scavengers/") + loadscreens = VFS.DirList(loadscreenPath .. "manual/scavengers/") if loadscreens[1] then break end @@ -93,13 +96,13 @@ local backgroundTexture = loadscreens[math.random(#loadscreens)] -- backgroundTexture = "bitmaps/loadpictures/manual/donations.jpg" --end -local showTips = (Spring.GetConfigInt("loadscreen_tips",1) == 1) +local showTips = (Spring.GetConfigInt("loadscreen_tips", 1) == 1) if string.find(backgroundTexture, "guide") then showTips = false end local hasLowRam = false -local ram = string.match(Platform.hwConfig, '([0-9]*MB RAM)') +local ram = string.match(Platform.hwConfig, "([0-9]*MB RAM)") if ram ~= nil then ram = string.gsub(ram, "MB RAM", "") end @@ -109,75 +112,74 @@ end -- I18N module does not support accessing translation keys by index number, so need to concatenate name local tipKeys = { - 'alwaysExpand', - 'armyDiversity', - 'assistFactories', - 'autogroups', - 'buildingHotkeys', - 'completelyDisappear', - 'destroyFighters', - 'dGun', - 'dGunAssassin', - 'disableAntiNukes', - 'factoryCannibalism', - 'factoryRepeat', - 'graphicsSettings', - 'groups', - 'howShieldsWork', - 'idleConstructors', - 'ignoreUsers', - 'insertFactoryQuickBuild', - 'joinDiscord', - 'lastCommander', - 'lastNotification', - 'longRangeUnits', - 'mapmarks', - 'mohoGeoExplosion', - 'nanoTurretFight', - 'overflowingEnergy', - 'queues', - 'reclaimWrecks', - 'reportUsers', - 'resurrectFight', - 'screenBombers', - 'selectCommander', - 'selectSameType', - 'separateBuildings', - 'separateBuildings2', - 'shareResources', - 'shareUnits', - 'showMetalSpots', - 'takeUnits', - 'transportBuildings', - 'useAntiAir', - 'useCloak', - 'useDragMove', - 'useFighters', - 'useJuno', - 'useMines', - 'usePause', - 'useRadar', - 'useRadarJammers', - 'useReclaim', - 'useRepair', - 'useSelfDestruct', - 'useSpotters', - 'vehiclesOrBots', - 'windEnergyBuffer', - 'windSpeed', + "alwaysExpand", + "armyDiversity", + "assistFactories", + "autogroups", + "buildingHotkeys", + "completelyDisappear", + "destroyFighters", + "dGun", + "dGunAssassin", + "disableAntiNukes", + "factoryCannibalism", + "factoryRepeat", + "graphicsSettings", + "groups", + "howShieldsWork", + "idleConstructors", + "ignoreUsers", + "insertFactoryQuickBuild", + "joinDiscord", + "lastCommander", + "lastNotification", + "longRangeUnits", + "mapmarks", + "mohoGeoExplosion", + "nanoTurretFight", + "overflowingEnergy", + "queues", + "reclaimWrecks", + "reportUsers", + "resurrectFight", + "screenBombers", + "selectCommander", + "selectSameType", + "separateBuildings", + "separateBuildings2", + "shareResources", + "shareUnits", + "showMetalSpots", + "takeUnits", + "transportBuildings", + "useAntiAir", + "useCloak", + "useDragMove", + "useFighters", + "useJuno", + "useMines", + "usePause", + "useRadar", + "useRadarJammers", + "useReclaim", + "useRepair", + "useSelfDestruct", + "useSpotters", + "vehiclesOrBots", + "windEnergyBuffer", + "windSpeed", } -local randomTip = '' +local randomTip = "" if showTips then local index = math.random(#tipKeys) - randomTip = Spring.I18N('tips.loadscreen.' .. tipKeys[index]) + randomTip = Spring.I18N("tips.loadscreen." .. tipKeys[index]) end --if showDonationTip then -- randomTip = Spring.I18N('tips.loadscreen.donations') --end - -- for guishader local function CheckHardware() if not (gl.CopyToTexture ~= nil) then @@ -195,7 +197,7 @@ local function CheckHardware() if not gl.HasExtension("GL_ARB_texture_non_power_of_two") then return false end - if Platform ~= nil and Platform.gpuVendor == 'Intel' then + if Platform ~= nil and Platform.gpuVendor == "Intel" then return false end return true @@ -210,13 +212,12 @@ local blurtex2 local stenciltex local guishaderRects = {} local guishaderDlists = {} -local vsx, vsy, vpx, vpy = Spring.GetViewGeometry() +local vsx, vsy, vpx, vpy = Spring.GetViewGeometry() local ivsx, ivsy = vsx, vsy local wsx, wsy, _, _ = Spring.GetWindowGeometry() local ssx, ssy, _, _ = Spring.GetScreenGeometry() if wsx > ssx or wsy > ssy then - end function lines(str) @@ -229,35 +230,35 @@ function lines(str) return t end -local defaultFont = 'Poppins-Regular.otf' -local fontfile = 'fonts/'..Spring.GetConfigString("bar_font", defaultFont) +local defaultFont = "Poppins-Regular.otf" +local fontfile = "fonts/" .. Spring.GetConfigString("bar_font", defaultFont) if not VFS.FileExists(fontfile) then - Spring.SetConfigString('bar_font', defaultFont) - fontfile = 'fonts/'..defaultFont + Spring.SetConfigString("bar_font", defaultFont) + fontfile = "fonts/" .. defaultFont end -local defaultFont2 = 'Exo2-SemiBold.otf' -local fontfile2 = 'fonts/'..Spring.GetConfigString("bar_font2", defaultFont2) +local defaultFont2 = "Exo2-SemiBold.otf" +local fontfile2 = "fonts/" .. Spring.GetConfigString("bar_font2", defaultFont2) if not VFS.FileExists(fontfile2) then - Spring.SetConfigString('bar_font2', defaultFont2) - fontfile2 = 'fonts/'..defaultFont2 + Spring.SetConfigString("bar_font2", defaultFont2) + fontfile2 = "fonts/" .. defaultFont2 end local height = math.floor(vsy * 0.038) -- loading bar height (in pixels) -local posYorg = math.floor((0.065 * vsy)+0.5) / vsy -local posX = math.floor(((((posYorg*1.44)*vsy)/vsx) * vsx)+0.5) / vsx +local posYorg = math.floor((0.065 * vsy) + 0.5) / vsy +local posX = math.floor(((((posYorg * 1.44) * vsy) / vsx) * vsx) + 0.5) / vsx local borderSize = math.max(1, math.floor(vsy * 0.0027)) local fontSize = 40 -local fontScale = math.min(3, (0.5 + (vsx*vsy / 3500000))) -local font = gl.LoadFont(fontfile, fontSize*fontScale, (fontSize/2)*fontScale, 1) +local fontScale = math.min(3, (0.5 + (vsx * vsy / 3500000))) +local font = gl.LoadFont(fontfile, fontSize * fontScale, (fontSize / 2) * fontScale, 1) local font2Size = 45 -local font2 = gl.LoadFont(fontfile2, font2Size*fontScale, (font2Size/4)*fontScale, 1.3) +local font2 = gl.LoadFont(fontfile2, font2Size * fontScale, (font2Size / 4) * fontScale, 1.3) function DrawStencilTexture() - if next(guishaderRects) or next(guishaderDlists) then + if next(guishaderRects) or next(guishaderDlists) then if stenciltex then gl.DeleteTextureFBO(stenciltex) end @@ -269,34 +270,34 @@ function DrawStencilTexture() wrap_t = GL.CLAMP, fbo = true, }) - else - gl.RenderToTexture(stenciltex, gl.Clear, GL.COLOR_BUFFER_BIT ,0,0,0,0) - return - end - - gl.RenderToTexture(stenciltex, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.PushMatrix() - gl.Translate(-1,-1,0) - gl.Scale(2/vsx,2/vsy,0) - for _,rect in pairs(guishaderRects) do - gl.Rect(rect[1],rect[2],rect[3],rect[4]) + else + gl.RenderToTexture(stenciltex, gl.Clear, GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) + return + end + + gl.RenderToTexture(stenciltex, function() + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) + gl.PushMatrix() + gl.Translate(-1, -1, 0) + gl.Scale(2 / vsx, 2 / vsy, 0) + for _, rect in pairs(guishaderRects) do + gl.Rect(rect[1], rect[2], rect[3], rect[4]) end - for _,dlist in pairs(guishaderDlists) do + for _, dlist in pairs(guishaderDlists) do gl.CallList(dlist) end - gl.PopMatrix() - end) + gl.PopMatrix() + end) end local function CreateShaders() - if blurShader then - gl.DeleteShader(blurShader or 0) - end + if blurShader then + gl.DeleteShader(blurShader or 0) + end - -- create blur shaders - blurShader = gl.CreateShader({ - fragment = [[ + -- create blur shaders + blurShader = gl.CreateShader({ + fragment = [[ #version 150 compatibility uniform sampler2D tex2; uniform sampler2D tex0; @@ -325,44 +326,44 @@ local function CreateShaders() } ]], - uniformInt = { - tex0 = 0, - tex2 = 2, - }, - uniformFloat = { - intensity = blurIntensity, - } - }) - - if (blurShader == nil) then - --Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader blurShader: shader error: "..gl.GetShaderLog()) - --widgetHandler:RemoveWidget() - return false - end - - -- create blurtextures - screencopy = gl.CreateTexture(vsx, vsy, { - border = false, - min_filter = GL.NEAREST, - mag_filter = GL.NEAREST, - }) - blurtex = gl.CreateTexture(ivsx, ivsy, { - border = false, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - blurtex2 = gl.CreateTexture(ivsx, ivsy, { - border = false, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - intensityLoc = gl.GetUniformLocation(blurShader, "intensity") + uniformInt = { + tex0 = 0, + tex2 = 2, + }, + uniformFloat = { + intensity = blurIntensity, + }, + }) + + if blurShader == nil then + --Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader blurShader: shader error: "..gl.GetShaderLog()) + --widgetHandler:RemoveWidget() + return false + end + + -- create blurtextures + screencopy = gl.CreateTexture(vsx, vsy, { + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + blurtex = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + blurtex2 = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + + intensityLoc = gl.GetUniformLocation(blurShader, "intensity") end -local function gradientv(px,py,sx,sy, c1,c2) +local function gradientv(px, py, sx, sy, c1, c2) gl.Color(c1) gl.Vertex(px, sy, 0) gl.Vertex(sx, sy, 0) @@ -371,7 +372,7 @@ local function gradientv(px,py,sx,sy, c1,c2) gl.Vertex(px, py, 0) end -local function gradienth(px,py,sx,sy, c1,c2) +local function gradienth(px, py, sx, sy, c1, c2) gl.Color(c1) gl.Vertex(sx, sy, 0) gl.Vertex(sx, py, 0) @@ -380,45 +381,45 @@ local function gradienth(px,py,sx,sy, c1,c2) gl.Vertex(px, sy, 0) end -local function bartexture(px,py,sx,sy, texLength, texHeight) +local function bartexture(px, py, sx, sy, texLength, texHeight) local texHeight = texHeight or 1 - local width = (sx-px) / texLength * 4 + local width = (sx - px) / texLength * 4 gl.TexCoord(width or 1, texHeight) gl.Vertex(sx, sy, 0) gl.TexCoord(width or 1, 0) gl.Vertex(sx, py, 0) - gl.TexCoord(0,0) + gl.TexCoord(0, 0) gl.Vertex(px, py, 0) - gl.TexCoord(0,texHeight) + gl.TexCoord(0, texHeight) gl.Vertex(px, sy, 0) end local lastLoadMessage = "" -local lastProgress = {0, 0} +local lastProgress = { 0, 0 } local progressByLastLine = { - ["Loading Map"] = {0, 10}, - ["Parsing Map Information"] = {7, 15}, - ["Loading GameData Definitions"] = {10, 20}, - ["Creating QuadField and CEGs"] = {13, 22}, - ["Creating Unit Textures"] = {16, 25}, - ["Creating Sky"] = {19, 35}, - ["Loading Weapon Definitions"] = {22, 40}, - ["Loading Unit Definitions"] = {25, 45}, - ["Loading Feature Definitions"] = {29, 45}, - ["Loading Models and Textures"] = {33, 50}, - ["Loading Map Tiles"] = {38, 55}, - ["Loading Square Textures"] = {43, 55}, - ["Creating Projectile Textures"] = {48, 60}, - ["Creating Water"] = {54, 65}, - ["PathCosts"] = {58, 65}, - ["[LoadFinalize] finalizing PFS"] = {62, 65}, - ["Loading LuaRules"] = {69, 75}, - ["Loading LuaUI"] = {82, 85}, - ["Loading Skirmish AIs"] = {90, 95}, - ["Finalizing"] = {100, 100} + ["Loading Map"] = { 0, 10 }, + ["Parsing Map Information"] = { 7, 15 }, + ["Loading GameData Definitions"] = { 10, 20 }, + ["Creating QuadField and CEGs"] = { 13, 22 }, + ["Creating Unit Textures"] = { 16, 25 }, + ["Creating Sky"] = { 19, 35 }, + ["Loading Weapon Definitions"] = { 22, 40 }, + ["Loading Unit Definitions"] = { 25, 45 }, + ["Loading Feature Definitions"] = { 29, 45 }, + ["Loading Models and Textures"] = { 33, 50 }, + ["Loading Map Tiles"] = { 38, 55 }, + ["Loading Square Textures"] = { 43, 55 }, + ["Creating Projectile Textures"] = { 48, 60 }, + ["Creating Water"] = { 54, 65 }, + ["PathCosts"] = { 58, 65 }, + ["[LoadFinalize] finalizing PFS"] = { 62, 65 }, + ["Loading LuaRules"] = { 69, 75 }, + ["Loading LuaUI"] = { 82, 85 }, + ["Loading Skirmish AIs"] = { 90, 95 }, + ["Finalizing"] = { 100, 100 }, } -for name,val in pairs(progressByLastLine) do - progressByLastLine[name] = {val[1]*0.01, val[2]*0.01} +for name, val in pairs(progressByLastLine) do + progressByLastLine[name] = { val[1] * 0.01, val[2] * 0.01 } end function addon.LoadProgress(message, replaceLastLine) @@ -438,11 +439,15 @@ end function addon.DrawLoadScreen() local loadProgress = SG.GetLoadProgress() - if not Platform.gl then return end + if not Platform.gl then + return + end if not aspectRatio then local texInfo = gl.TextureInfo(backgroundTexture) - if not texInfo then return end + if not texInfo then + return + end aspectRatio = texInfo.xsize / texInfo.ysize end @@ -451,8 +456,8 @@ function addon.DrawLoadScreen() -- Handle viewport resize: recalculate layout and recreate shader resources if vsx ~= ivsx or vsy ~= ivsy then height = math.floor(vsy * 0.038) - posYorg = math.floor((0.065 * vsy)+0.5) / vsy - posX = math.floor(((((posYorg*1.44)*vsy)/vsx) * vsx)+0.5) / vsx + posYorg = math.floor((0.065 * vsy) + 0.5) / vsy + posX = math.floor(((((posYorg * 1.44) * vsy) / vsx) * vsx) + 0.5) / vsx borderSize = math.max(1, math.floor(vsy * 0.0027)) ivsx, ivsy = vsx, vsy @@ -486,15 +491,15 @@ function addon.DrawLoadScreen() -- background local scale = 1 - local ssx,ssy,spx,spy = Spring.GetScreenGeometry() - if ssx / vsx < 1 then -- adjust when window is larger than the screen resolution + local ssx, ssy, spx, spy = Spring.GetScreenGeometry() + if ssx / vsx < 1 then -- adjust when window is larger than the screen resolution --scale = ssx / vsx --xDiv = xDiv * scale -- this doesnt work --yDiv = yDiv * scale end - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) gl.Texture(backgroundTexture) - gl.TexRect(0+xDiv,(1-scale)+yDiv,scale-xDiv,1-yDiv) + gl.TexRect(0 + xDiv, (1 - scale) + yDiv, scale - xDiv, 1 - yDiv) gl.Texture(false) ----------------------- @@ -503,92 +508,91 @@ function addon.DrawLoadScreen() local posY = posYorg -- tip - local tipTextSize = height*0.7 + local tipTextSize = height * 0.7 local tipTextLineHeight = tipTextSize * 1.17 local wrappedTipText, numLines = font2:WrapText(randomTip, vsx * 1.35) local tipLines = lines(wrappedTipText) - local tipPosYtop = posY + (height/vsy)+(borderSize/vsy) + (posY*0.9) + ((tipTextLineHeight * #tipLines)/vsy) + local tipPosYtop = posY + (height / vsy) + (borderSize / vsy) + (posY * 0.9) + ((tipTextLineHeight * #tipLines) / vsy) if showTips and not showTipBackground and not showTipAboveBar then if #tipLines > 1 then - posY = posY + ( (tipTextLineHeight*0.75/vsy) * (#tipLines-1) ) + posY = posY + ((tipTextLineHeight * 0.75 / vsy) * (#tipLines - 1)) tipPosYtop = posY else - tipPosYtop = posY - (tipTextLineHeight* 0.2/vsy) + tipPosYtop = posY - (tipTextLineHeight * 0.2 / vsy) end end - local barTextSize = height*0.55 + local barTextSize = height * 0.55 if guishader then if not blurShader then CreateShaders() - guishaderRects['loadprocess1'] = {(posX*vsx)-borderSize, (posY*vsy)-borderSize, (vsx-(posX*vsx))+borderSize, ((posY*vsy)+height+borderSize)} + guishaderRects["loadprocess1"] = { (posX * vsx) - borderSize, (posY * vsy) - borderSize, (vsx - (posX * vsx)) + borderSize, ((posY * vsy) + height + borderSize) } if showTips and showTipAboveBar and showTipBackground then - guishaderRects['loadprocess2'] = {(posX*vsx)-borderSize, ((posY*vsy)+height+borderSize), (vsx-(posX*vsx))+borderSize, tipPosYtop*vsy} + guishaderRects["loadprocess2"] = { (posX * vsx) - borderSize, ((posY * vsy) + height + borderSize), (vsx - (posX * vsx)) + borderSize, tipPosYtop * vsy } end if usingIntelPotato or hasLowRam then - guishaderRects['loadprocess3'] = {0, ((usingIntelPotato and hasLowRam) and 0.9 or 0.95)*vsy, vsx,vsy} + guishaderRects["loadprocess3"] = { 0, ((usingIntelPotato and hasLowRam) and 0.9 or 0.95) * vsy, vsx, vsy } end DrawStencilTexture() end if next(guishaderRects) or next(guishaderDlists) then - gl.Texture(false) - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) gl.Blending(false) gl.CopyToTexture(screencopy, 0, 0, vpx, vpy, vsx, vsy) gl.Texture(screencopy) - gl.TexRect(0,1,1,0) - gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.TexRect(0, 1, 1, 0) + gl.RenderToTexture(blurtex, gl.TexRect, -1, 1, 1, -1) gl.UseShader(blurShader) gl.Uniform(intensityLoc, blurIntensity) - gl.Texture(2,stenciltex) - gl.Texture(2,false) + gl.Texture(2, stenciltex) + gl.Texture(2, false) gl.Texture(blurtex) - gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex2, gl.TexRect, -1, 1, 1, -1) gl.Texture(blurtex2) - gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex, gl.TexRect, -1, 1, 1, -1) gl.UseShader(0) if blurIntensity >= 0.0015 then gl.UseShader(blurShader) - gl.Uniform(intensityLoc, blurIntensity*0.5) + gl.Uniform(intensityLoc, blurIntensity * 0.5) gl.Texture(blurtex) - gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex2, gl.TexRect, -1, 1, 1, -1) gl.Texture(blurtex2) - gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex, gl.TexRect, -1, 1, 1, -1) gl.UseShader(0) end if blurIntensity >= 0.003 then gl.UseShader(blurShader) - gl.Uniform(intensityLoc, blurIntensity*0.25) + gl.Uniform(intensityLoc, blurIntensity * 0.25) gl.Texture(blurtex) - gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex2, gl.TexRect, -1, 1, 1, -1) gl.Texture(blurtex2) - gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex, gl.TexRect, -1, 1, 1, -1) gl.UseShader(0) end if blurIntensity >= 0.005 then gl.UseShader(blurShader) - gl.Uniform(intensityLoc, blurIntensity*0.125) + gl.Uniform(intensityLoc, blurIntensity * 0.125) gl.Texture(blurtex) - gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex2, gl.TexRect, -1, 1, 1, -1) gl.Texture(blurtex2) - gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.RenderToTexture(blurtex, gl.TexRect, -1, 1, 1, -1) gl.UseShader(0) end gl.Texture(blurtex) - gl.TexRect(0,1,1,0) + gl.TexRect(0, 1, 1, 0) gl.Texture(false) gl.Blending(true) @@ -604,78 +608,76 @@ function addon.DrawLoadScreen() vsx, vsy, vpx, vpy = Spring.GetViewGeometry() - local loadvalue = math.max(0, loadProgress) * (1-posX-posX) - loadvalue = math.floor((loadvalue * vsx)+0.5) / vsx + local loadvalue = math.max(0, loadProgress) * (1 - posX - posX) + loadvalue = math.floor((loadvalue * vsx) + 0.5) / vsx -- fade away bottom if showTips and not showTipBackground then - gl.BeginEnd(GL.QUADS, gradientv, 0, 0, 1, tipPosYtop+(height*3/vsy), {0,0,0,0}, {0,0,0,0.55}) + gl.BeginEnd(GL.QUADS, gradientv, 0, 0, 1, tipPosYtop + (height * 3 / vsy), { 0, 0, 0, 0 }, { 0, 0, 0, 0.55 }) end -- border - gl.Color(0,0,0,0.6) - gl.Rect(posX,posY+(height/vsy),1-posX,posY+((height+borderSize)/vsy)) -- top - gl.Rect(posX,posY,1-posX,posY-(borderSize/vsy)) -- bottom - gl.Rect(posX-(borderSize/vsx),posY-(borderSize/vsy),posX,posY+((height+borderSize)/vsy)) -- left - gl.Rect(1-posX,posY-(borderSize/vsy),(1-posX)+(borderSize/vsx),posY+((height+borderSize)/vsy)) -- right + gl.Color(0, 0, 0, 0.6) + gl.Rect(posX, posY + (height / vsy), 1 - posX, posY + ((height + borderSize) / vsy)) -- top + gl.Rect(posX, posY, 1 - posX, posY - (borderSize / vsy)) -- bottom + gl.Rect(posX - (borderSize / vsx), posY - (borderSize / vsy), posX, posY + ((height + borderSize) / vsy)) -- left + gl.Rect(1 - posX, posY - (borderSize / vsy), (1 - posX) + (borderSize / vsx), posY + ((height + borderSize) / vsy)) -- right -- background - gl.Color(0.15,0.15,0.15,(blurShader and 0.55 or 0.7)) - gl.Rect(posX+loadvalue,posY,1-posX,posY+(height/vsy)) + gl.Color(0.15, 0.15, 0.15, (blurShader and 0.55 or 0.7)) + gl.Rect(posX + loadvalue, posY, 1 - posX, posY + (height / vsy)) -- progress value - gl.Color((0.4-(loadProgress/7)), (loadProgress*0.35), 0, 0.85) - gl.Rect(posX,posY,posX+loadvalue,posY+(height)/vsy) + gl.Color((0.4 - (loadProgress / 7)), (loadProgress * 0.35), 0, 0.85) + gl.Rect(posX, posY, posX + loadvalue, posY + height / vsy) gl.Blending(GL.SRC_ALPHA, GL.ONE) -- background - gl.Color(0.2,0.2,0.2,0.12) - gl.Rect(posX,posY,1-posX,posY+(height/vsy)) + gl.Color(0.2, 0.2, 0.2, 0.12) + gl.Rect(posX, posY, 1 - posX, posY + (height / vsy)) -- progress value - gl.Color((0.45-(loadProgress/7)), (loadProgress*0.38), 0, 0.2) - gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX+loadvalue, posY+((height)/vsy), {1,1,1,0.2}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX+loadvalue, posY+(((height)*0.3)/vsy), {1,1,1,0}, {1,1,1,0.04}) + gl.Color((0.45 - (loadProgress / 7)), (loadProgress * 0.38), 0, 0.2) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX + loadvalue, posY + (height / vsy), { 1, 1, 1, 0.2 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX + loadvalue, posY + ((height * 0.3) / vsy), { 1, 1, 1, 0 }, { 1, 1, 1, 0.04 }) -- progress value texture - gl.Color((0.4-(loadProgress/7)), (loadProgress*0.3), 0, 0.19) - gl.Texture(':ng:luaui/images/rgbnoise.png') - gl.BeginEnd(GL.QUADS, bartexture, posX,posY,1-posX,posY+((height)/vsy), (height*7)/vsy, (height*7)/vsy) + gl.Color((0.4 - (loadProgress / 7)), (loadProgress * 0.3), 0, 0.19) + gl.Texture(":ng:luaui/images/rgbnoise.png") + gl.BeginEnd(GL.QUADS, bartexture, posX, posY, 1 - posX, posY + (height / vsy), (height * 7) / vsy, (height * 7) / vsy) gl.Texture(false) -- progress value gloss - gl.BeginEnd(GL.QUADS, gradientv, posX, posY+(((height)*0.93)/vsy), posX+loadvalue, posY+((height)/vsy), {1,1,1,0.18}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX, posY+(((height)*0.77)/vsy), posX+loadvalue, posY+((height)/vsy), {1,1,1,0.15}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX, posY+(((height)*0.3)/vsy), posX+loadvalue, posY+((height)/vsy), {1,1,1,0.15}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX+loadvalue, posY+(((height)*0.3)/vsy), {1,1,1,0}, {1,1,1,0.01}) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY + ((height * 0.93) / vsy), posX + loadvalue, posY + (height / vsy), { 1, 1, 1, 0.18 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY + ((height * 0.77) / vsy), posX + loadvalue, posY + (height / vsy), { 1, 1, 1, 0.15 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY + ((height * 0.3) / vsy), posX + loadvalue, posY + (height / vsy), { 1, 1, 1, 0.15 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX, posY, posX + loadvalue, posY + ((height * 0.3) / vsy), { 1, 1, 1, 0 }, { 1, 1, 1, 0.01 }) -- bar gloss - gl.Color(1,1,1, 0.1) - gl.BeginEnd(GL.QUADS, gradientv, posX+loadvalue, posY+(((height)*0.93)/vsy), 1-posX, posY+((height)/vsy), {1,1,1,0.12}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX+loadvalue, posY+(((height)*0.77)/vsy), 1-posX, posY+((height)/vsy), {1,1,1,0.1}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX+loadvalue, posY+(((height)*0.3)/vsy), 1-posX, posY+((height)/vsy), {1,1,1,0.1}, {1,1,1,0}) - gl.BeginEnd(GL.QUADS, gradientv, posX+loadvalue, posY, 1-posX, posY+(((height)*0.3)/vsy), {1,1,1,0}, {1,1,1,0.018}) + gl.Color(1, 1, 1, 0.1) + gl.BeginEnd(GL.QUADS, gradientv, posX + loadvalue, posY + ((height * 0.93) / vsy), 1 - posX, posY + (height / vsy), { 1, 1, 1, 0.12 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX + loadvalue, posY + ((height * 0.77) / vsy), 1 - posX, posY + (height / vsy), { 1, 1, 1, 0.1 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX + loadvalue, posY + ((height * 0.3) / vsy), 1 - posX, posY + (height / vsy), { 1, 1, 1, 0.1 }, { 1, 1, 1, 0 }) + gl.BeginEnd(GL.QUADS, gradientv, posX + loadvalue, posY, 1 - posX, posY + ((height * 0.3) / vsy), { 1, 1, 1, 0 }, { 1, 1, 1, 0.018 }) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- progress text gl.PushMatrix() - gl.Scale(1/vsx,1/vsy,1) - gl.Translate(vsx/2, (posY*vsy)+(height*0.68), 0) - font:SetTextColor(0.88,0.88,0.88,1) - font:SetOutlineColor(0,0,0,0.85) + gl.Scale(1 / vsx, 1 / vsy, 1) + gl.Translate(vsx / 2, (posY * vsy) + (height * 0.68), 0) + font:SetTextColor(0.88, 0.88, 0.88, 1) + font:SetOutlineColor(0, 0, 0, 0.85) font:Print(lastLoadMessage, 0, 0, barTextSize, "oac") gl.PopMatrix() - if showTips then - -- tip background if showTipBackground and showTipAboveBar then - gl.Color(0,0,0,(blurShader and 0.22 or 0.3)) - gl.Rect(posX-(borderSize/vsx), posY+(height/vsy)+(borderSize/vsy), 1-posX+(borderSize/vsx), tipPosYtop) + gl.Color(0, 0, 0, (blurShader and 0.22 or 0.3)) + gl.Rect(posX - (borderSize / vsx), posY + (height / vsy) + (borderSize / vsy), 1 - posX + (borderSize / vsx), tipPosYtop) - gl.BeginEnd(GL.QUADS, gradientv, posX-(borderSize/vsx), posY+(height/vsy)+(borderSize/vsy), 1-posX+(borderSize/vsx), tipPosYtop, {1,1,1,0.045}, {1,1,1,0}) + gl.BeginEnd(GL.QUADS, gradientv, posX - (borderSize / vsx), posY + (height / vsy) + (borderSize / vsy), 1 - posX + (borderSize / vsx), tipPosYtop, { 1, 1, 1, 0.045 }, { 1, 1, 1, 0 }) --gl.BeginEnd(GL.QUADS, gradientv, posX-(borderSize/vsx), tipPosYtop-(height/vsy), 1-posX+(borderSize/vsx), tipPosYtop, {1,1,1,0.04}, {1,1,1,0}) --gl.Color(0,0,0,0.1) --gl.Rect(posX, posY+(height/vsy)+(borderSize/vsy), 1-posX, tipPosYtop-(borderSize/vsy)) @@ -683,39 +685,37 @@ function addon.DrawLoadScreen() -- tip text gl.PushMatrix() - gl.Scale(1/vsx,1/vsy,1) - gl.Translate(vsx/2, (tipPosYtop*vsy)-(tipTextSize*0.75), 0) - font2:SetTextColor(1,1,1,1) - font2:SetOutlineColor(0,0,0,0.8) - for i,line in pairs(tipLines) do - font2:Print(line, 0, -tipTextLineHeight*(i-1), tipTextSize, "oac") + gl.Scale(1 / vsx, 1 / vsy, 1) + gl.Translate(vsx / 2, (tipPosYtop * vsy) - (tipTextSize * 0.75), 0) + font2:SetTextColor(1, 1, 1, 1) + font2:SetOutlineColor(0, 0, 0, 0.8) + for i, line in pairs(tipLines) do + font2:Print(line, 0, -tipTextLineHeight * (i - 1), tipTextSize, "oac") end gl.PopMatrix() end if hasLowRam then if usingIntelPotato then - gl.Color(0.066,0.066,0.066,(blurShader and 0.55 or 0.7)) + gl.Color(0.066, 0.066, 0.066, (blurShader and 0.55 or 0.7)) else - gl.Color(0.15,0.15,0.15,(blurShader and 0.55 or 0.7)) + gl.Color(0.15, 0.15, 0.15, (blurShader and 0.55 or 0.7)) end - gl.Rect(0,(usingIntelPotato and 0.9 or 0.95),1,usingIntelPotato and 0.95 or 1) + gl.Rect(0, (usingIntelPotato and 0.9 or 0.95), 1, usingIntelPotato and 0.95 or 1) gl.PushMatrix() - gl.Scale(1/vsx,1/vsy,1) - gl.Translate(vsx/2, (usingIntelPotato and 0.938 or 0.988)*vsy, 0) - font2:SetTextColor(0.8,0.8,0.8,1) - font2:SetOutlineColor(0,0,0,0.8) - font2:Print(Spring.I18N('ui.loadScreen.lowRamWarning', { textColor = '\255\200\200\200', warnColor = '\255\255\255\255' }), 0, 0, height*0.66, "oac") + gl.Scale(1 / vsx, 1 / vsy, 1) + gl.Translate(vsx / 2, (usingIntelPotato and 0.938 or 0.988) * vsy, 0) + font2:SetTextColor(0.8, 0.8, 0.8, 1) + font2:SetOutlineColor(0, 0, 0, 0.8) + font2:Print(Spring.I18N("ui.loadScreen.lowRamWarning", { textColor = "\255\200\200\200", warnColor = "\255\255\255\255" }), 0, 0, height * 0.66, "oac") gl.PopMatrix() end end - function addon.MousePress(...) --Spring.Echo(...) end - function addon.Shutdown() if guishader then for id, dlist in pairs(guishaderDlists) do diff --git a/luaintro/Addons/music.lua b/luaintro/Addons/music.lua index 866887d6029..92a0ae28072 100644 --- a/luaintro/Addons/music.lua +++ b/luaintro/Addons/music.lua @@ -1,12 +1,11 @@ - if addon.InGetInfo then return { - name = "Music", - desc = "plays music", - author = "jK", - date = "2012,2013", + name = "Music", + desc = "plays music", + author = "jK", + date = "2012,2013", license = "GPL2", - layer = 0, + layer = 0, --depend = {"LoadProgress"}, enabled = true, -- loading makes it choppy towards the end; also, volume cannot be adjusted } @@ -17,7 +16,7 @@ function addon.DrawLoadScreen() -- -- fade in & out music with progress -- if (loadProgress > 0.9) then - -- Spring.SetSoundStreamVolume(1 - ((loadProgress - 0.9) * 10)) + -- Spring.SetSoundStreamVolume(1 - ((loadProgress - 0.9) * 10)) -- end end @@ -29,88 +28,87 @@ function addon.Initialize() --if Spring.GetConfigInt('music', 1) == 0 then -- return --end - local originalSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackNew', 1) - local customSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackCustom', 1) + local originalSoundtrackEnabled = Spring.GetConfigInt("UseSoundtrackNew", 1) + local customSoundtrackEnabled = Spring.GetConfigInt("UseSoundtrackCustom", 1) local allowedExtensions = "{*.ogg,*.mp3}" local musicPlaylist = {} local musicPlaylistEvent = {} - local musicDirCustom = 'music/custom' - local musicDirOriginal = 'music/original' + local musicDirCustom = "music/custom" + local musicDirOriginal = "music/original" if originalSoundtrackEnabled == 1 then - -- Events ---------------------------------------------------------------------------------------------------------------------- -- Raptors if Spring.Utilities.Gametype.IsRaptors() then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/raptors/loading', allowedExtensions)) - elseif Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1 then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/raptors/loading', allowedExtensions)) + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/raptors/loading", allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackRaptors", 0) == 1 then + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/events/raptors/loading", allowedExtensions)) end -- Scavengers if Spring.Utilities.Gametype.IsScavengers() then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/scavengers/loading', allowedExtensions)) - elseif Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1 then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/scavengers/loading', allowedExtensions)) + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/scavengers/loading", allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackScavengers", 0) == 1 then + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/events/scavengers/loading", allowedExtensions)) end -- April Fools ---- Day 1 - 100% chance - if Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools_specialDay"] then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) + if Spring.GetConfigInt("UseSoundtrackAprilFools", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools_specialDay"] then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/aprilfools/loading", allowedExtensions)) ---- Day 2-7 - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and math.random() <= 0.5 then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackAprilFools", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and math.random() <= 0.5 then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/aprilfools/loading", allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/aprilfools/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackAprilFoolsPostEvent", 0) == 1 and not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/events/aprilfools/loading", allowedExtensions)) end -- Halloween ---- Halloween Day - 100% chance - if Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"] then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) + if Spring.GetConfigInt("UseSoundtrackHalloween", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"] then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/halloween/loading", allowedExtensions)) ---- 2 Weeks Before Halloween - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and math.random() <= 0.5 then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackHalloween", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and math.random() <= 0.5 then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/halloween/loading", allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"]) then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/halloween/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackHalloweenPostEvent", 0) == 1 and not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween_specialDay"] then + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/events/halloween/loading", allowedExtensions)) end -- Xmas ---- Christmas Days - 100% chance - if Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas_specialDay"] then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) + if Spring.GetConfigInt("UseSoundtrackXmas", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas_specialDay"] then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/xmas/loading", allowedExtensions)) ---- The Rest of the event - 50% chance - elseif Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and math.random() <= 0.5 then - table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackXmas", 1) == 1 and Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and math.random() <= 0.5 then + table.append(musicPlaylistEvent, VFS.DirList(musicDirOriginal .. "/events/xmas/loading", allowedExtensions)) ---- Post Event - Add to regular playlist - elseif Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1 and (not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"]) then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/events/xmas/loading', allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackXmasPostEvent", 0) == 1 and not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/events/xmas/loading", allowedExtensions)) end -- Map Music - table.append(musicPlaylistEvent, VFS.DirList('music/map/loading', allowedExtensions)) + table.append(musicPlaylistEvent, VFS.DirList("music/map/loading", allowedExtensions)) ------------------------------------------------------------------------------------------------------------------------------- -- Regular Music - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/loading', allowedExtensions)) + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/loading", allowedExtensions)) end -- Custom Soundtrack List if customSoundtrackEnabled == 1 then - table.append(musicPlaylist, VFS.DirList(musicDirCustom..'/loading', allowedExtensions)) + table.append(musicPlaylist, VFS.DirList(musicDirCustom .. "/loading", allowedExtensions)) end if #musicPlaylist == 0 then if originalSoundtrackEnabled == 1 then - table.append(musicPlaylist, VFS.DirList(musicDirOriginal..'/peace', allowedExtensions)) + table.append(musicPlaylist, VFS.DirList(musicDirOriginal .. "/peace", allowedExtensions)) end if customSoundtrackEnabled == 1 then - table.append(musicPlaylist, VFS.DirList(musicDirCustom..'/peace', allowedExtensions)) + table.append(musicPlaylist, VFS.DirList(musicDirCustom .. "/peace", allowedExtensions)) end end @@ -119,11 +117,11 @@ function addon.Initialize() local pickedTrack = musicPlaylistEvent[math.random(1, #musicPlaylistEvent)] Spring.PlaySoundStream(pickedTrack, 1) Spring.SetSoundStreamVolume(musicvolume) - Spring.SetConfigString('music_loadscreen_track', pickedTrack) + Spring.SetConfigString("music_loadscreen_track", pickedTrack) elseif #musicPlaylist > 0 then local pickedTrack = musicPlaylist[math.random(1, #musicPlaylist)] Spring.PlaySoundStream(pickedTrack, 1) Spring.SetSoundStreamVolume(musicvolume) - Spring.SetConfigString('music_loadscreen_track', pickedTrack) + Spring.SetConfigString("music_loadscreen_track", pickedTrack) end end diff --git a/luaintro/config.lua b/luaintro/config.lua index c51dea76b2b..eac3f59fbbf 100644 --- a/luaintro/config.lua +++ b/luaintro/config.lua @@ -18,7 +18,7 @@ math.randomseed(seed) --// 1: enabled, but can be overriden by widget.GetInfo().unsafe --// 2: always enabled SAFEWRAP = 1 -SAFEDRAW = false --// requires SAFEWRAP to work +SAFEDRAW = false --// requires SAFEWRAP to work --// VFSMODE = VFS.MAP .. VFS.MOD .. VFS.BASE @@ -26,34 +26,33 @@ VFSMODE = VFS.MAP .. VFS.MOD .. VFS.BASE --// when false, the handler will `compress` some output (e.g. list of started widgets) handler.verbose = false or true - if LUA_NAME == "LuaUI" then --// Config & Widget Locations - ORDER_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.gameShortName .. '_order.lua' - CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.gameShortName .. '_data.lua' - KNOWN_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.gameShortName .. '_known.lua' - - ADDON_DIRS = { - LUA_DIRNAME .. 'Addons/'; - LUA_DIRNAME .. 'Widgets/'; - LUA_DIRNAME .. 'SystemAddons/'; - LUA_DIRNAME .. 'SystemWidgets/'; - LUA_DIRNAME .. 'chili/'; + ORDER_FILENAME = LUAUI_DIRNAME .. "Config/" .. Game.gameShortName .. "_order.lua" + CONFIG_FILENAME = LUAUI_DIRNAME .. "Config/" .. Game.gameShortName .. "_data.lua" + KNOWN_FILENAME = LUAUI_DIRNAME .. "Config/" .. Game.gameShortName .. "_known.lua" + + ADDON_DIRS = { + LUA_DIRNAME .. "Addons/", + LUA_DIRNAME .. "Widgets/", + LUA_DIRNAME .. "SystemAddons/", + LUA_DIRNAME .. "SystemWidgets/", + LUA_DIRNAME .. "chili/", } --// Create the "LuaUI/Config" directory - Spring.CreateDir(LUAUI_DIRNAME .. 'Config') + Spring.CreateDir(LUAUI_DIRNAME .. "Config") handler:Load(LUAUI_DIRNAME .. "SystemWidgets/BlockUserWidgets.lua" --[[, VFS.ZIP]]) else AddonNames = handler.AddonName .. "s/" - ADDON_DIRS = { - LUA_DIRNAME .. 'Addons/'; - LUA_DIRNAME .. AddonNames; - LUA_DIRNAME .. 'SystemAddons/'; - LUA_DIRNAME .. 'System' .. AddonNames; - LUA_DIRNAME .. 'chili/'; + ADDON_DIRS = { + LUA_DIRNAME .. "Addons/", + LUA_DIRNAME .. AddonNames, + LUA_DIRNAME .. "SystemAddons/", + LUA_DIRNAME .. "System" .. AddonNames, + LUA_DIRNAME .. "chili/", } end diff --git a/luaintro/main.lua b/luaintro/main.lua index 84c52e05237..4a76f8f7db7 100644 --- a/luaintro/main.lua +++ b/luaintro/main.lua @@ -10,10 +10,9 @@ -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -VFS.Include('init.lua') +VFS.Include("init.lua") - -LUA_NAME = Script.GetName() +LUA_NAME = Script.GetName() LUA_DIRNAME = Script.GetName() .. "/" LUA_VERSION = Script.GetName() .. " v1.0" @@ -35,7 +34,7 @@ else local origSpringLog = Spring.Log Spring.Log = function(name, level, ...) - if (type(level) == "string")and(level == "info") then + if (type(level) == "string") and (level == "info") then Spring.Echo(("[%s]"):format(name), ...) else origSpringLog(name, level, ...) @@ -43,7 +42,6 @@ else end end - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- @@ -53,7 +51,7 @@ end VFS.Include("LuaHandler/Utilities/utils.lua", nil, VFS.DEF_MODE) --// the addon handler -include "LuaHandler/handler.lua" +include("LuaHandler/handler.lua") --// print Lua & LuaUI version Spring.Log(LUA_NAME, "info", LUA_VERSION .. " (" .. _VERSION .. ")") @@ -61,5 +59,4 @@ Spring.Log(LUA_NAME, "info", LUA_VERSION .. " (" .. _VERSION .. ")") ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- - -include "springconfig.lua" +include("springconfig.lua") diff --git a/luaintro/springconfig.lua b/luaintro/springconfig.lua index 3e0127495b3..d2ea9f0896a 100644 --- a/luaintro/springconfig.lua +++ b/luaintro/springconfig.lua @@ -20,12 +20,11 @@ Spring.SetConfigFloat("unitSunMult", 1.0) Spring.SetConfigFloat("unitExposureMult", 1.0) Spring.SetConfigFloat("modelGamma", 1.0) - -- BAR requires higher textureatlas size for particles than the default of 2048x2048 local maxTextureAtlasSize = 8192 Spring.SetConfigInt("MaxTextureAtlasSizeX", maxTextureAtlasSize) Spring.SetConfigInt("MaxTextureAtlasSizeY", maxTextureAtlasSize) -if tonumber(Spring.GetConfigInt("MaxTextureAtlasSizeX",2048) or 2048) < maxTextureAtlasSize then +if tonumber(Spring.GetConfigInt("MaxTextureAtlasSizeX", 2048) or 2048) < maxTextureAtlasSize then Spring.SetConfigInt("MaxTextureAtlasSizeX", maxTextureAtlasSize) Spring.SetConfigInt("MaxTextureAtlasSizeY", maxTextureAtlasSize) end @@ -34,7 +33,6 @@ end Spring.SetConfigInt("CubeTexGenerateMipMaps", 1) Spring.SetConfigInt("CubeTexSizeReflection", 1024) - Spring.SetConfigInt("AdvSky", 0) -- disable grass @@ -56,12 +54,12 @@ if Spring.GetConfigFloat("ui_tilescale", 7) < 0 then end -- disable ForceDisableShaders -if Spring.GetConfigInt("ForceDisableShaders",0) == 1 then +if Spring.GetConfigInt("ForceDisableShaders", 0) == 1 then Spring.SetConfigInt("ForceDisableShaders", 0) end -- enable lua shaders -if not tonumber(Spring.GetConfigInt("LuaShaders",0) or 0) then +if not tonumber(Spring.GetConfigInt("LuaShaders", 0) or 0) then Spring.SetConfigInt("LuaShaders", 1) end @@ -85,7 +83,6 @@ Spring.SetConfigInt("LuaGarbageCollectionMemLoadMult", 1) -- Reduce the max runtime of GC to 1 ms instead of 5 (2022.08.16) Spring.SetConfigInt("LuaGarbageCollectionRunTimeMult", 1) - -- we used 3 as default toggle, changing to 4 if (Spring.GetConfigInt("GroundDecals", 3) or 3) >= 4 then Spring.SetConfigInt("GroundDecals", 3) @@ -102,7 +99,7 @@ Spring.SetConfigInt("SmoothTimeOffset", 2) -- New in BAR engine -- This is needed for better profiling info, and (theoretically better frame timing). -- Notably a decade ago windows had issues with this -Spring.SetConfigInt("UseHighResTimer", 1) -- Default off +Spring.SetConfigInt("UseHighResTimer", 1) -- Default off -- This changes the sleep time of the game server thread to make it wake up every 1.999 ms instead of the default 5.999 ms -- This hopefully gets us less variance in issuing new sim frames @@ -111,7 +108,7 @@ Spring.SetConfigInt("ServerSleepTime", 1) -- The default of 256 is just too tiny, at this size the VS load outpaces FS load anyway, makes for actually pretty reflections with CUS GL4 Spring.SetConfigInt("BumpWaterTexSizeReflection", 1024) -Spring.SetConfigFloat("CrossAlpha", 0) -- will be in effect next launch +Spring.SetConfigFloat("CrossAlpha", 0) -- will be in effect next launch if not Spring.GetConfigFloat("UnitIconFadeAmount") then Spring.SetConfigFloat("UnitIconFadeAmount", 0.1) @@ -161,13 +158,12 @@ version = 8 if Spring.GetConfigInt("version", 0) < version then Spring.SetConfigInt("version", version) - local voiceset = Spring.GetConfigString("voiceset", '') - if voiceset == 'en/allison' then - Spring.SetConfigString("voiceset", 'en/cephis') + local voiceset = Spring.GetConfigString("voiceset", "") + if voiceset == "en/allison" then + Spring.SetConfigString("voiceset", "en/cephis") end end - -- apply the old pre-engine implementation stored camera minimum zoom level local oldMinCamHeight = Spring.GetConfigInt("MinimumCameraHeight", -1) if oldMinCamHeight ~= -1 then @@ -201,16 +197,15 @@ else Spring.SetConfigInt("KeyChainTimeout", userKeyChainTimeout) end - -- The default mouse drag threshold is set extremely low for engine by default, and fast clicking often results in a drag. -- This is bad for single unit commands, which turn into empty area commmands as a result of the small drag local xresolution = math.max(Spring.GetConfigInt("XResolution", 1920), Spring.GetConfigInt("XResolutionWindowed", 1920)) local yresolution = math.max(Spring.GetConfigInt("YResolution", 1080), Spring.GetConfigInt("YResolutionWindowed", 1080)) local baseDragThreshold = 16 -baseDragThreshold = math.round(baseDragThreshold * (xresolution + yresolution) * ( 1/3000) ) -- is 16 at 1080p +baseDragThreshold = math.round(baseDragThreshold * (xresolution + yresolution) * (1 / 3000)) -- is 16 at 1080p baseDragThreshold = math.clamp(baseDragThreshold, 8, 40) -Spring.Echo(string.format("Setting Mouse Drag thresholds based on resolution (%dx%d) for Selection to %d, and Command to %d", xresolution,yresolution,baseDragThreshold, baseDragThreshold + 16)) +Spring.Echo(string.format("Setting Mouse Drag thresholds based on resolution (%dx%d) for Selection to %d, and Command to %d", xresolution, yresolution, baseDragThreshold, baseDragThreshold + 16)) Spring.SetConfigInt("MouseDragSelectionThreshold", baseDragThreshold) Spring.SetConfigInt("MouseDragCircleCommandThreshold", baseDragThreshold + 16) Spring.SetConfigInt("MouseDragBoxCommandThreshold", baseDragThreshold + 16) diff --git a/luarules/Utilities/damgam_lib/hashpostable.lua b/luarules/Utilities/damgam_lib/hashpostable.lua index aff5eb8bd78..2c9a05977f9 100644 --- a/luarules/Utilities/damgam_lib/hashpostable.lua +++ b/luarules/Utilities/damgam_lib/hashpostable.lua @@ -7,8 +7,6 @@ -- To get then Nth closest other square from the current position, simply call: -- HashPosTable:GetNthCenter(x,z,N) - - local function MakeHashedPosTable(resolution) -- hashes into 1000*z + x resolution = resolution or 512 @@ -21,22 +19,22 @@ local function MakeHashedPosTable(resolution) resolution = resolution, mx = mx, mz = mz, - numPos = mx*mz/(resolution*resolution) + numPos = mx * mz / (resolution * resolution), } - function HashPos:hashPos(px,pz) - return mfloor(pz/self.resolution) * 1000 + mfloor(px/self.resolution) + function HashPos:hashPos(px, pz) + return mfloor(pz / self.resolution) * 1000 + mfloor(px / self.resolution) end -- return x,y function HashPos:unhash(h) - local z = mfloor(h/1000) - return h - 1000*z, z + local z = mfloor(h / 1000) + return h - 1000 * z, z end function HashPos:hashtopos(h) - local z = mfloor(h/1000) - local cx = (h - 1000*z) * self.resolution + self.resolution/2 - local cz = z*self.resolution + self.resolution/2 - return cx,cz + local z = mfloor(h / 1000) + local cx = (h - 1000 * z) * self.resolution + self.resolution / 2 + local cz = z * self.resolution + self.resolution / 2 + return cx, cz end function HashPos:distancesqr(hp1, hp2) @@ -44,13 +42,13 @@ local function MakeHashedPosTable(resolution) local x2, z2 = self:unhash(hp2) x1 = x1 - x2 z1 = z1 - z2 - return x1*x1 + z1*z1 + return x1 * x1 + z1 * z1 end local hashIDs = {} local count = 0 - for x=1, mx, resolution do + for x = 1, mx, resolution do for z = 1, mz, resolution do - local hp = HashPos:hashPos(x,z) + local hp = HashPos:hashPos(x, z) count = count + 1 hashIDs[count] = hp end @@ -63,18 +61,18 @@ local function MakeHashedPosTable(resolution) function HashPos:SortNewRegion(hp) local thispos = {} - for j,hp2 in ipairs(hashIDs) do + for j, hp2 in ipairs(hashIDs) do thispos[j] = hp2 end - local function comparetome(a,b) - return HashPos:distancesqr(hp,a) < HashPos:distancesqr(hp,b) + local function comparetome(a, b) + return HashPos:distancesqr(hp, a) < HashPos:distancesqr(hp, b) end table.sort(thispos, comparetome) self.sortedPositions[hp] = thispos end - function HashPos:GetNthCenter(px,pz, n) - local hp = self:hashPos(px,pz) + function HashPos:GetNthCenter(px, pz, n) + local hp = self:hashPos(px, pz) local sorted = self.sortedPositions[hp] if sorted == nil then self:SortNewRegion(hp) @@ -95,6 +93,7 @@ local hpt = MakeHashedPosTable(512) for i = 1, 50 do print (hpt:GetNthCenter(256,4000, i)) end -]]-- +]] +-- return MakeHashedPosTable diff --git a/luarules/Utilities/damgam_lib/nearby_capture.lua b/luarules/Utilities/damgam_lib/nearby_capture.lua index 8e342863fa9..a9bc10aa52e 100644 --- a/luarules/Utilities/damgam_lib/nearby_capture.lua +++ b/luarules/Utilities/damgam_lib/nearby_capture.lua @@ -3,56 +3,56 @@ local GaiaTeamID = Spring.GetGaiaTeamID() local GaiaAllyTeamID = select(6, Spring.GetTeamInfo(GaiaTeamID)) local function NearbyCapture(unitID, difficulty, range) - difficulty = difficulty or 1 - range = range or 256 + difficulty = difficulty or 1 + range = range or 256 - local unitAllyTeam = Spring.GetUnitAllyTeam(unitID) + local unitAllyTeam = Spring.GetUnitAllyTeam(unitID) - local x,y,z = Spring.GetUnitPosition(unitID) - local nearbyUnits = Spring.GetUnitsInCylinder(x, z, range) + local x, y, z = Spring.GetUnitPosition(unitID) + local nearbyUnits = Spring.GetUnitsInCylinder(x, z, range) - local captureDamage = 0 - for i = 1,#nearbyUnits do - local attackerID = nearbyUnits[i] - if attackerID ~= unitID then - if not Spring.GetUnitIsBeingBuilt(unitID) then - local attackerAllyTeamID = Spring.GetUnitAllyTeam(attackerID) - local attackerDefID = Spring.GetUnitDefID(attackerID) - local attackerMetalCost = UnitDefs[attackerDefID].metalCost - local capturePower = ((attackerMetalCost/1000)*0.01)/difficulty - if attackerAllyTeamID == unitAllyTeam then - captureDamage = captureDamage - capturePower - elseif attackerAllyTeamID ~= GaiaAllyTeamID then - captureDamage = captureDamage + capturePower - end - end - end - end + local captureDamage = 0 + for i = 1, #nearbyUnits do + local attackerID = nearbyUnits[i] + if attackerID ~= unitID then + if not Spring.GetUnitIsBeingBuilt(unitID) then + local attackerAllyTeamID = Spring.GetUnitAllyTeam(attackerID) + local attackerDefID = Spring.GetUnitDefID(attackerID) + local attackerMetalCost = UnitDefs[attackerDefID].metalCost + local capturePower = ((attackerMetalCost / 1000) * 0.01) / difficulty + if attackerAllyTeamID == unitAllyTeam then + captureDamage = captureDamage - capturePower + elseif attackerAllyTeamID ~= GaiaAllyTeamID then + captureDamage = captureDamage + capturePower + end + end + end + end - if captureDamage ~= 0 then - local captureProgress = select(4, Spring.GetUnitHealth(unitID)) - local newProgress = captureProgress + captureDamage - if newProgress < 0 then - Spring.SetUnitHealth(unitID, {capture = 0}) - SendToUnsynced("unitCaptureFrame", unitID, 0) - GG.addUnitToCaptureDecay(unitID) - elseif newProgress >= 1 then - local nearestAttacker = Spring.GetUnitNearestEnemy(unitID, range*2, false) - if nearestAttacker then - local attackerTeamID = Spring.GetUnitTeam(nearestAttacker) - Spring.TransferUnit(unitID, attackerTeamID, false) - Spring.SetUnitHealth(unitID, {capture = 0.75}) - SendToUnsynced("unitCaptureFrame", unitID, 0.75) - GG.addUnitToCaptureDecay(unitID) - end - else - Spring.SetUnitHealth(unitID, {capture = newProgress}) - SendToUnsynced("unitCaptureFrame", unitID, newProgress) - GG.addUnitToCaptureDecay(unitID) - end - end + if captureDamage ~= 0 then + local captureProgress = select(4, Spring.GetUnitHealth(unitID)) + local newProgress = captureProgress + captureDamage + if newProgress < 0 then + Spring.SetUnitHealth(unitID, { capture = 0 }) + SendToUnsynced("unitCaptureFrame", unitID, 0) + GG.addUnitToCaptureDecay(unitID) + elseif newProgress >= 1 then + local nearestAttacker = Spring.GetUnitNearestEnemy(unitID, range * 2, false) + if nearestAttacker then + local attackerTeamID = Spring.GetUnitTeam(nearestAttacker) + Spring.TransferUnit(unitID, attackerTeamID, false) + Spring.SetUnitHealth(unitID, { capture = 0.75 }) + SendToUnsynced("unitCaptureFrame", unitID, 0.75) + GG.addUnitToCaptureDecay(unitID) + end + else + Spring.SetUnitHealth(unitID, { capture = newProgress }) + SendToUnsynced("unitCaptureFrame", unitID, newProgress) + GG.addUnitToCaptureDecay(unitID) + end + end end return { - NearbyCapture = NearbyCapture, + NearbyCapture = NearbyCapture, } diff --git a/luarules/Utilities/damgam_lib/position_checks.lua b/luarules/Utilities/damgam_lib/position_checks.lua index f55e2d1b204..c9cd4e5ed6d 100644 --- a/luarules/Utilities/damgam_lib/position_checks.lua +++ b/luarules/Utilities/damgam_lib/position_checks.lua @@ -26,51 +26,50 @@ local allyTeams = Spring.GetAllyTeamList() local startPositionsInitialized = false local function initializeStartPositionTable() - if (startPositionsInitialized) then - return - end - for _, testAllyTeamID in ipairs(allyTeams) do - local allyTeamHasStartbox = true - local xMin, zMin, xMax, zMax = Spring.GetAllyTeamStartBox(testAllyTeamID) - if xMin == 0 and zMin == 0 and xMax == mapSizeX and zMax == mapSizeZ then - allyTeamHasStartbox = false - end - AllyTeamStartboxes[testAllyTeamID + 1] = { -- Lua Tables start at 1, AllyTeamID's start at 0, so we have to add 1 everytime - allyTeamHasStartbox = allyTeamHasStartbox, - xMin = xMin, - zMin = zMin, - xMax = xMax, - zMax = zMax, - } - Spring.Echo('AllyTeamId: ' .. tostring(testAllyTeamID) .. ' startx: ' .. tostring(xMin)) - end + if startPositionsInitialized then + return + end + for _, testAllyTeamID in ipairs(allyTeams) do + local allyTeamHasStartbox = true + local xMin, zMin, xMax, zMax = Spring.GetAllyTeamStartBox(testAllyTeamID) + if xMin == 0 and zMin == 0 and xMax == mapSizeX and zMax == mapSizeZ then + allyTeamHasStartbox = false + end + AllyTeamStartboxes[testAllyTeamID + 1] = { -- Lua Tables start at 1, AllyTeamID's start at 0, so we have to add 1 everytime + allyTeamHasStartbox = allyTeamHasStartbox, + xMin = xMin, + zMin = zMin, + xMax = xMax, + zMax = zMax, + } + Spring.Echo("AllyTeamId: " .. tostring(testAllyTeamID) .. " startx: " .. tostring(xMin)) + end end -- game_ffa_start_setup can shuffle startboxes after this code runs if not Spring.Utilities.Gametype.IsFFA() then - initializeStartPositionTable() - startPositionsInitialized = true + initializeStartPositionTable() + startPositionsInitialized = true end - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------- Position Check functions -------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local function FlatAreaCheck(posx, posy, posz, posradius, heightTollerance, checkWater) -- Returns true if position is flat enough. -- nil fixes - posradius = posradius or 1000 - heightTollerance = heightTollerance or 30 - local deathwater = Game.waterDamage - local lavaLevel = Spring.GetGameRulesParam("lavaLevel") - - -- Pre-compute coordinate offsets - local xPlus = posx + posradius - local xMinus = posx - posradius - local zPlus = posz + posradius - local zMinus = posz - posradius - - -- Check height of test points in all 8 directions. + posradius = posradius or 1000 + heightTollerance = heightTollerance or 30 + local deathwater = Game.waterDamage + local lavaLevel = Spring.GetGameRulesParam("lavaLevel") + + -- Pre-compute coordinate offsets + local xPlus = posx + posradius + local xMinus = posx - posradius + local zPlus = posz + posradius + local zMinus = posz - posradius + + -- Check height of test points in all 8 directions. local testpos1 = Spring.GetGroundHeight(xPlus, zPlus) local testpos2 = Spring.GetGroundHeight(xPlus, zMinus) local testpos3 = Spring.GetGroundHeight(xMinus, zPlus) @@ -80,37 +79,58 @@ local function FlatAreaCheck(posx, posy, posz, posradius, heightTollerance, chec local testpos7 = Spring.GetGroundHeight(xMinus, posz) local testpos8 = Spring.GetGroundHeight(posx, zMinus) - -- Compare with original height - if (not checkWater) and (not deathwater or deathwater == 0) and posy <= 0 then return true end -- Is water, Not Deathwater, No water bottom check. - if deathwater > 0 and posy <= 0 then return false end -- Is water, Deathwater - if lavaLevel and posy <= lavaLevel then return false end -- Is lava - local minY = posy - heightTollerance - local maxY = posy + heightTollerance - if testpos1 < minY or testpos1 > maxY then return false end - if testpos2 < minY or testpos2 > maxY then return false end - if testpos3 < minY or testpos3 > maxY then return false end - if testpos4 < minY or testpos4 > maxY then return false end - if testpos5 < minY or testpos5 > maxY then return false end - if testpos6 < minY or testpos6 > maxY then return false end - if testpos7 < minY or testpos7 > maxY then return false end - if testpos8 < minY or testpos8 > maxY then return false end - - return true -- Nothing failed, so position is safe + -- Compare with original height + if (not checkWater) and (not deathwater or deathwater == 0) and posy <= 0 then + return true + end -- Is water, Not Deathwater, No water bottom check. + if deathwater > 0 and posy <= 0 then + return false + end -- Is water, Deathwater + if lavaLevel and posy <= lavaLevel then + return false + end -- Is lava + local minY = posy - heightTollerance + local maxY = posy + heightTollerance + if testpos1 < minY or testpos1 > maxY then + return false + end + if testpos2 < minY or testpos2 > maxY then + return false + end + if testpos3 < minY or testpos3 > maxY then + return false + end + if testpos4 < minY or testpos4 > maxY then + return false + end + if testpos5 < minY or testpos5 > maxY then + return false + end + if testpos6 < minY or testpos6 > maxY then + return false + end + if testpos7 < minY or testpos7 > maxY then + return false + end + if testpos8 < minY or testpos8 > maxY then + return false + end + return true -- Nothing failed, so position is safe end local function LandOrSeaCheck(posx, posy, posz, posradius) -- returns string, "land", "sea", "mixed", "death" - posradius = posradius or 1000 - local deathwater = Game.waterDamage - local lavaLevel = Spring.GetGameRulesParam("lavaLevel") + posradius = posradius or 1000 + local deathwater = Game.waterDamage + local lavaLevel = Spring.GetGameRulesParam("lavaLevel") - -- Pre-compute coordinate offsets - local xPlus = posx + posradius - local xMinus = posx - posradius - local zPlus = posz + posradius - local zMinus = posz - posradius + -- Pre-compute coordinate offsets + local xPlus = posx + posradius + local xMinus = posx - posradius + local zPlus = posz + posradius + local zMinus = posz - posradius - -- Check height of test points in all 8 directions. + -- Check height of test points in all 8 directions. local testpos1 = Spring.GetGroundHeight(xPlus, zPlus) local testpos2 = Spring.GetGroundHeight(xPlus, zMinus) local testpos3 = Spring.GetGroundHeight(xMinus, zPlus) @@ -120,29 +140,29 @@ local function LandOrSeaCheck(posx, posy, posz, posradius) -- returns string, "l local testpos7 = Spring.GetGroundHeight(xMinus, posz) local testpos8 = Spring.GetGroundHeight(posx, zMinus) - local minimumheight = math.min(testpos1, testpos2, testpos3, testpos4, testpos5, testpos6, testpos7, testpos8) - local maximumheight = math.max(testpos1, testpos2, testpos3, testpos4, testpos5, testpos6, testpos7, testpos8) + local minimumheight = math.min(testpos1, testpos2, testpos3, testpos4, testpos5, testpos6, testpos7, testpos8) + local maximumheight = math.max(testpos1, testpos2, testpos3, testpos4, testpos5, testpos6, testpos7, testpos8) - if (deathwater > 0 and minimumheight <= 0) or (lavaLevel and (minimumheight <= lavaLevel)) then - return "death" - end + if (deathwater > 0 and minimumheight <= 0) or (lavaLevel and (minimumheight <= lavaLevel)) then + return "death" + end - if minimumheight <= 0 and maximumheight <= 0 then - return "sea" - end + if minimumheight <= 0 and maximumheight <= 0 then + return "sea" + end - if minimumheight > 0 and maximumheight > 0 then - return "land" - end + if minimumheight > 0 and maximumheight > 0 then + return "land" + end - if minimumheight <= 0 and maximumheight > 0 then - return "mixed" - end + if minimumheight <= 0 and maximumheight > 0 then + return "mixed" + end end local function OccupancyCheck(posx, posy, posz, posradius) -- Returns true if there are no units in the spawn area local posradius = posradius or 1000 - local unitcount = #Spring.GetUnitsInRectangle(posx-posradius, posz-posradius, posx+posradius, posz+posradius) + local unitcount = #Spring.GetUnitsInRectangle(posx - posradius, posz - posradius, posx + posradius, posz + posradius) if unitcount > 0 then return false else @@ -151,139 +171,125 @@ local function OccupancyCheck(posx, posy, posz, posradius) -- Returns true if th end local function ResourceCheck(posx, posz, posradius) -- Returns true if there are no resources in the spawn area - local posradiusSquared = posradius * posradius - local metalSpots = GG["resource_spot_finder"].metalSpotsList - if metalSpots then - for _,spot in ipairs(metalSpots) do - if math.distance2dSquared(spot.x, spot.z, posx, posz) < posradiusSquared then - return false - end - end - end - - local geoSpots = GG["resource_spot_finder"].geoSpotsList - if geoSpots then - for _,spot in ipairs(geoSpots) do - if math.distance2dSquared(spot.x, spot.z, posx, posz) < posradiusSquared then - return false - end - end - end - return true + local posradiusSquared = posradius * posradius + local metalSpots = GG["resource_spot_finder"].metalSpotsList + if metalSpots then + for _, spot in ipairs(metalSpots) do + if math.distance2dSquared(spot.x, spot.z, posx, posz) < posradiusSquared then + return false + end + end + end + + local geoSpots = GG["resource_spot_finder"].geoSpotsList + if geoSpots then + for _, spot in ipairs(geoSpots) do + if math.distance2dSquared(spot.x, spot.z, posx, posz) < posradiusSquared then + return false + end + end + end + return true end local function VisibilityCheck(posx, posy, posz, posradius, allyTeamID, checkLoS, checkAirLos, checkRadar) -- Return True when position is not in sensor ranges of specified allyTeam. - posradius = posradius or 1000 if noFogOfWar then - return OccupancyCheck(posx, posy, posz, posradius*4) - end - - -- Pre-compute coordinate offsets - local xPlus = posx + posradius - local xMinus = posx - posradius - local zPlus = posz + posradius - local zMinus = posz - posradius - - if checkLoS and ( - Spring.IsPosInLos(posx, posy, posz, allyTeamID) == true or - Spring.IsPosInLos(xPlus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInLos(xPlus, posy, zMinus, allyTeamID) == true or - Spring.IsPosInLos(xMinus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInLos(xMinus, posy, zMinus, allyTeamID) == true) then - return false - end - - if checkRadar and ( - Spring.IsPosInRadar(posx, posy, posz, allyTeamID) == true or - Spring.IsPosInRadar(xPlus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInRadar(xPlus, posy, zMinus, allyTeamID) == true or - Spring.IsPosInRadar(xMinus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInRadar(xMinus, posy, zMinus, allyTeamID) == true) then - return false - end - - if checkAirLos and ( - Spring.IsPosInAirLos(posx, posy, posz, allyTeamID) == true or - Spring.IsPosInAirLos(xPlus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInAirLos(xPlus, posy, zMinus, allyTeamID) == true or - Spring.IsPosInAirLos(xMinus, posy, zPlus, allyTeamID) == true or - Spring.IsPosInAirLos(xMinus, posy, zMinus, allyTeamID) == true) then - return false - end + return OccupancyCheck(posx, posy, posz, posradius * 4) + end + + -- Pre-compute coordinate offsets + local xPlus = posx + posradius + local xMinus = posx - posradius + local zPlus = posz + posradius + local zMinus = posz - posradius + + if checkLoS and (Spring.IsPosInLos(posx, posy, posz, allyTeamID) == true or Spring.IsPosInLos(xPlus, posy, zPlus, allyTeamID) == true or Spring.IsPosInLos(xPlus, posy, zMinus, allyTeamID) == true or Spring.IsPosInLos(xMinus, posy, zPlus, allyTeamID) == true or Spring.IsPosInLos(xMinus, posy, zMinus, allyTeamID) == true) then + return false + end + + if checkRadar and (Spring.IsPosInRadar(posx, posy, posz, allyTeamID) == true or Spring.IsPosInRadar(xPlus, posy, zPlus, allyTeamID) == true or Spring.IsPosInRadar(xPlus, posy, zMinus, allyTeamID) == true or Spring.IsPosInRadar(xMinus, posy, zPlus, allyTeamID) == true or Spring.IsPosInRadar(xMinus, posy, zMinus, allyTeamID) == true) then + return false + end + + if checkAirLos and (Spring.IsPosInAirLos(posx, posy, posz, allyTeamID) == true or Spring.IsPosInAirLos(xPlus, posy, zPlus, allyTeamID) == true or Spring.IsPosInAirLos(xPlus, posy, zMinus, allyTeamID) == true or Spring.IsPosInAirLos(xMinus, posy, zPlus, allyTeamID) == true or Spring.IsPosInAirLos(xMinus, posy, zMinus, allyTeamID) == true) then + return false + end return true end local function VisibilityCheckEnemy(posx, posy, posz, posradius, allyTeamID, checkLoS, checkAirLos, checkRadar) -- Return True when position is not in sensor ranges of all enemies of specified allyTeam. - for _,testAllyTeamID in ipairs(allyTeams) do + for _, testAllyTeamID in ipairs(allyTeams) do local posCheck = true - if testAllyTeamID ~= allyTeamID and testAllyTeamID ~= GaiaAllyTeamID then - posCheck = VisibilityCheck(posx, posy, posz, posradius, testAllyTeamID, checkLoS, checkAirLos, checkRadar) - end - if posCheck == false then - return false - end - end - return true + if testAllyTeamID ~= allyTeamID and testAllyTeamID ~= GaiaAllyTeamID then + posCheck = VisibilityCheck(posx, posy, posz, posradius, testAllyTeamID, checkLoS, checkAirLos, checkRadar) + end + if posCheck == false then + return false + end + end + return true end local function StartboxCheck(posx, posy, posz, allyTeamID, returnTrueWhenNoStartbox) -- Return True when position is within startbox. - if (not startPositionsInitialized) then - initializeStartPositionTable() - startPositionsInitialized = true - end - --local posradius = posradius or 1000 - if not returnTrueWhenNoStartbox then returnTrueWhenNoStartbox = false end - - if allyTeamID == GaiaAllyTeamID then - return not returnTrueWhenNoStartbox - end - - -- try polygon-aware check first (available when explicit polygon config is loaded) - if GG.IsInsideStartbox then - local polygonResult = GG.IsInsideStartbox(posx, posz, allyTeamID) - if polygonResult ~= nil then - if polygonResult then - return not returnTrueWhenNoStartbox - else - return returnTrueWhenNoStartbox - end - end - end - - -- fall back to engine AABB - local startbox = AllyTeamStartboxes[allyTeamID+1] - - if startbox.allyTeamHasStartbox == false then - return not returnTrueWhenNoStartbox - end - - if posx >= startbox.xMin and posz >= startbox.zMin and posx <= startbox.xMax and posz <= startbox.zMax then -- Lua Tables start at 1, AllyTeamID's start at 0, so we have to add 1 everytime - return not returnTrueWhenNoStartbox - else - return returnTrueWhenNoStartbox - end + if not startPositionsInitialized then + initializeStartPositionTable() + startPositionsInitialized = true + end + --local posradius = posradius or 1000 + if not returnTrueWhenNoStartbox then + returnTrueWhenNoStartbox = false + end + + if allyTeamID == GaiaAllyTeamID then + return not returnTrueWhenNoStartbox + end + + -- try polygon-aware check first (available when explicit polygon config is loaded) + if GG.IsInsideStartbox then + local polygonResult = GG.IsInsideStartbox(posx, posz, allyTeamID) + if polygonResult ~= nil then + if polygonResult then + return not returnTrueWhenNoStartbox + else + return returnTrueWhenNoStartbox + end + end + end + + -- fall back to engine AABB + local startbox = AllyTeamStartboxes[allyTeamID + 1] + + if startbox.allyTeamHasStartbox == false then + return not returnTrueWhenNoStartbox + end + + if posx >= startbox.xMin and posz >= startbox.zMin and posx <= startbox.xMax and posz <= startbox.zMax then -- Lua Tables start at 1, AllyTeamID's start at 0, so we have to add 1 everytime + return not returnTrueWhenNoStartbox + else + return returnTrueWhenNoStartbox + end end local function NotInEnemyStartboxCheck(posx, posy, posz, allyTeamID, returnTrueWhenNoStartbox) - for _,testAllyTeamID in pairs(allyTeams) do - if (testAllyTeamID ~= GaiaAllyTeamID) and (testAllyTeamID ~= allyTeamID) then - if StartboxCheck(posx, posy, posz, testAllyTeamID, returnTrueWhenNoStartbox) then - return false; - end - end - end - return true; + for _, testAllyTeamID in pairs(allyTeams) do + if (testAllyTeamID ~= GaiaAllyTeamID) and (testAllyTeamID ~= allyTeamID) then + if StartboxCheck(posx, posy, posz, testAllyTeamID, returnTrueWhenNoStartbox) then + return false + end + end + end + return true end local function MapEdgeCheck(posx, posy, posz, posradius) -- if true then position is far enough from map border local posradius = posradius or 1000 - local xPlus = posx + posradius - local xMinus = posx - posradius - local zPlus = posz + posradius - local zMinus = posz - posradius - if xPlus >= mapSizeX or xMinus <= 0 or zMinus <= 0 or zPlus >= mapSizeZ then + local xPlus = posx + posradius + local xMinus = posx - posradius + local zPlus = posz + posradius + local zMinus = posz - posradius + if xPlus >= mapSizeX or xMinus <= 0 or zMinus <= 0 or zPlus >= mapSizeZ then return false else return true @@ -291,12 +297,12 @@ local function MapEdgeCheck(posx, posy, posz, posradius) -- if true then positio end local function SurfaceCheck(posx, posy, posz, posradius, sea) -- if true then position is safe for either Land or Sea units. - posradius = posradius or 1000 - -- Pre-compute coordinate offsets - local xPlus = posx + posradius - local xMinus = posx - posradius - local zPlus = posz + posradius - local zMinus = posz - posradius + posradius = posradius or 1000 + -- Pre-compute coordinate offsets + local xPlus = posx + posradius + local xMinus = posx - posradius + local zPlus = posz + posradius + local zMinus = posz - posradius local testpos0 = Spring.GetGroundHeight(posx, posz) local testpos1 = Spring.GetGroundHeight(xPlus, zPlus) @@ -308,133 +314,191 @@ local function SurfaceCheck(posx, posy, posz, posradius, sea) -- if true then po local testpos7 = Spring.GetGroundHeight(xMinus, posz) local testpos8 = Spring.GetGroundHeight(posx, zMinus) local deathwater = Game.waterDamage - local lavaLevel = Spring.GetGameRulesParam("lavaLevel") - - if deathwater > 0 and posy <= 0 then return false end -- Is water, Deathwater - if lavaLevel and posy <= lavaLevel then return false end -- Is lava - - if not sea then -- Test for land units - if testpos0 <= 0 then return false end - if testpos1 <= 0 then return false end - if testpos2 <= 0 then return false end - if testpos3 <= 0 then return false end - if testpos4 <= 0 then return false end - if testpos5 <= 0 then return false end - if testpos6 <= 0 then return false end - if testpos7 <= 0 then return false end - if testpos8 <= 0 then return false end - else -- Test for sea units - if testpos0 > 0 then return false end - if testpos1 > 0 then return false end - if testpos2 > 0 then return false end - if testpos3 > 0 then return false end - if testpos4 > 0 then return false end - if testpos5 > 0 then return false end - if testpos6 > 0 then return false end - if testpos7 > 0 then return false end - if testpos8 > 0 then return false end - end - - return true -- nothing failed, so it's good. + local lavaLevel = Spring.GetGameRulesParam("lavaLevel") + + if deathwater > 0 and posy <= 0 then + return false + end -- Is water, Deathwater + if lavaLevel and posy <= lavaLevel then + return false + end -- Is lava + + if not sea then -- Test for land units + if testpos0 <= 0 then + return false + end + if testpos1 <= 0 then + return false + end + if testpos2 <= 0 then + return false + end + if testpos3 <= 0 then + return false + end + if testpos4 <= 0 then + return false + end + if testpos5 <= 0 then + return false + end + if testpos6 <= 0 then + return false + end + if testpos7 <= 0 then + return false + end + if testpos8 <= 0 then + return false + end + else -- Test for sea units + if testpos0 > 0 then + return false + end + if testpos1 > 0 then + return false + end + if testpos2 > 0 then + return false + end + if testpos3 > 0 then + return false + end + if testpos4 > 0 then + return false + end + if testpos5 > 0 then + return false + end + if testpos6 > 0 then + return false + end + if testpos7 > 0 then + return false + end + if testpos8 > 0 then + return false + end + end + + return true -- nothing failed, so it's good. end local function ScavengerSpawnAreaCheck(posx, posy, posz, posradius) -- if true then position is within Scavengers spawn area. - local posradius = posradius or 1000 - if scavengerAllyTeamID then - local scavTechPercentage = Spring.GetGameRulesParam("scavStatsTechPercentage") - if scavTechPercentage then - if Spring.GetModOptions().scavspawnarea == true then - if not AllyTeamStartboxes[scavengerAllyTeamID+1].allyTeamHasStartbox then return true end -- Scavs do not have a startbox so we allow them to spawn anywhere - if StartboxCheck(posx, posy, posz, scavengerAllyTeamID) == true then return true end -- Area is within startbox, so it's for sure in the spawn box. - - -- Spawn Box grows with Scavengers tech, getting that into from GameRulesParameter set by Scav gadget - local startbox = AllyTeamStartboxes[scavengerAllyTeamID+1] - local xExpand = mapSizeX * 0.01 * scavTechPercentage - local zExpand = mapSizeZ * 0.01 * scavTechPercentage - local SpawnBoxMinX = math.floor(startbox.xMin - xExpand) - local SpawnBoxMaxX = math.ceil(startbox.xMax + xExpand) - local SpawnBoxMinZ = math.floor(startbox.zMin - zExpand) - local SpawnBoxMaxZ = math.ceil(startbox.zMax + zExpand) - - if posx < SpawnBoxMinX then return false end - if posx > SpawnBoxMaxX then return false end - if posz < SpawnBoxMinZ then return false end - if posz > SpawnBoxMaxZ then return false end - - return true - else - return true - end - else - if not AllyTeamStartboxes[scavengerAllyTeamID+1].allyTeamHasStartbox then return true end -- There's no info about tech percentage, but if there's no startbox, we assume they can spawn anywhere, right? - if StartboxCheck(posx, posy, posz, scavengerAllyTeamID) == true then return true end -- Area is within startbox, so it's for sure in the spawn box, even if we don't have info about how big spawn box is. - return false -- but otherwise, don't let them spawn, don't risk spawning in place they shouldn't spawn. - end - else - return false -- Scavs aren't in the game, so they don't have a spawn area. - end + local posradius = posradius or 1000 + if scavengerAllyTeamID then + local scavTechPercentage = Spring.GetGameRulesParam("scavStatsTechPercentage") + if scavTechPercentage then + if Spring.GetModOptions().scavspawnarea == true then + if not AllyTeamStartboxes[scavengerAllyTeamID + 1].allyTeamHasStartbox then + return true + end -- Scavs do not have a startbox so we allow them to spawn anywhere + if StartboxCheck(posx, posy, posz, scavengerAllyTeamID) == true then + return true + end -- Area is within startbox, so it's for sure in the spawn box. + + -- Spawn Box grows with Scavengers tech, getting that into from GameRulesParameter set by Scav gadget + local startbox = AllyTeamStartboxes[scavengerAllyTeamID + 1] + local xExpand = mapSizeX * 0.01 * scavTechPercentage + local zExpand = mapSizeZ * 0.01 * scavTechPercentage + local SpawnBoxMinX = math.floor(startbox.xMin - xExpand) + local SpawnBoxMaxX = math.ceil(startbox.xMax + xExpand) + local SpawnBoxMinZ = math.floor(startbox.zMin - zExpand) + local SpawnBoxMaxZ = math.ceil(startbox.zMax + zExpand) + + if posx < SpawnBoxMinX then + return false + end + if posx > SpawnBoxMaxX then + return false + end + if posz < SpawnBoxMinZ then + return false + end + if posz > SpawnBoxMaxZ then + return false + end + + return true + else + return true + end + else + if not AllyTeamStartboxes[scavengerAllyTeamID + 1].allyTeamHasStartbox then + return true + end -- There's no info about tech percentage, but if there's no startbox, we assume they can spawn anywhere, right? + if StartboxCheck(posx, posy, posz, scavengerAllyTeamID) == true then + return true + end -- Area is within startbox, so it's for sure in the spawn box, even if we don't have info about how big spawn box is. + return false -- but otherwise, don't let them spawn, don't risk spawning in place they shouldn't spawn. + end + else + return false -- Scavs aren't in the game, so they don't have a spawn area. + end end local function LavaCheck(posx, posy, posz, posradius) -- Returns false if area is in lava - local posradius = posradius or 1000 - local lavaLevel = Spring.GetGameRulesParam("lavaLevel") - if lavaLevel and posy <= lavaLevel then return false end -- Is lava - return true + local posradius = posradius or 1000 + local lavaLevel = Spring.GetGameRulesParam("lavaLevel") + if lavaLevel and posy <= lavaLevel then + return false + end -- Is lava + return true end local function MapIsLandOrSea() - if not landLevel then - local grid = (math.ceil(mapSizeX/16))*(math.ceil(mapSizeZ/16)) - local x = 0 - local z = 0 - local y = 0 - local landNodes = 0 - local seaNodes = 0 - for i = 1,grid do - if x <= mapSizeX then - y = Spring.GetGroundHeight(x,z) - if y > -15 then - landNodes = landNodes + 1 - elseif y <= -15 then - seaNodes = seaNodes + 1 - end - x = x + 16 - elseif x > mapSizeX then - x = 0 - z = z + 16 - if z > mapSizeZ then - break - end - - y = Spring.GetGroundHeight(x,z) - if y > 0 then - landNodes = landNodes + 1 - elseif y <= 0 then - seaNodes = seaNodes + 1 - end - end - end - landLevel = math.ceil((landNodes/grid)*10000)/100 - seaLevel = math.ceil((seaNodes/grid)*10000)/100 - end - --Spring.Echo("LandLevel", landLevel.." "..seaLevel) - return landLevel, seaLevel + if not landLevel then + local grid = (math.ceil(mapSizeX / 16)) * (math.ceil(mapSizeZ / 16)) + local x = 0 + local z = 0 + local y = 0 + local landNodes = 0 + local seaNodes = 0 + for i = 1, grid do + if x <= mapSizeX then + y = Spring.GetGroundHeight(x, z) + if y > -15 then + landNodes = landNodes + 1 + elseif y <= -15 then + seaNodes = seaNodes + 1 + end + x = x + 16 + elseif x > mapSizeX then + x = 0 + z = z + 16 + if z > mapSizeZ then + break + end + + y = Spring.GetGroundHeight(x, z) + if y > 0 then + landNodes = landNodes + 1 + elseif y <= 0 then + seaNodes = seaNodes + 1 + end + end + end + landLevel = math.ceil((landNodes / grid) * 10000) / 100 + seaLevel = math.ceil((seaNodes / grid) * 10000) / 100 + end + --Spring.Echo("LandLevel", landLevel.." "..seaLevel) + return landLevel, seaLevel end return { - FlatAreaCheck = FlatAreaCheck, - OccupancyCheck = OccupancyCheck, - VisibilityCheck = VisibilityCheck, - VisibilityCheckEnemy = VisibilityCheckEnemy, - StartboxCheck = StartboxCheck, - NotInEnemyStartboxCheck = NotInEnemyStartboxCheck, - MapEdgeCheck = MapEdgeCheck, - SurfaceCheck = SurfaceCheck, - LavaCheck = LavaCheck, - MapIsLandOrSea = MapIsLandOrSea, - LandOrSeaCheck = LandOrSeaCheck, - ResourceCheck = ResourceCheck, - - -- Scavengers - ScavengerSpawnAreaCheck = ScavengerSpawnAreaCheck, + FlatAreaCheck = FlatAreaCheck, + OccupancyCheck = OccupancyCheck, + VisibilityCheck = VisibilityCheck, + VisibilityCheckEnemy = VisibilityCheckEnemy, + StartboxCheck = StartboxCheck, + NotInEnemyStartboxCheck = NotInEnemyStartboxCheck, + MapEdgeCheck = MapEdgeCheck, + SurfaceCheck = SurfaceCheck, + LavaCheck = LavaCheck, + MapIsLandOrSea = MapIsLandOrSea, + LandOrSeaCheck = LandOrSeaCheck, + ResourceCheck = ResourceCheck, + + -- Scavengers + ScavengerSpawnAreaCheck = ScavengerSpawnAreaCheck, } diff --git a/luarules/Utilities/damgam_lib/spawn_queue.lua b/luarules/Utilities/damgam_lib/spawn_queue.lua index d54974d7bf5..fa133a40e51 100644 --- a/luarules/Utilities/damgam_lib/spawn_queue.lua +++ b/luarules/Utilities/damgam_lib/spawn_queue.lua @@ -1,39 +1,41 @@ - local QueuedSpawnList = {} local function AddToSpawnQueue(unitName, posx, posy, posz, facing, team, frame, blocking, resurrected) - - if blocking == nil then blocking = UnitDefNames[unitName].blocking end - if resurrected == nil then resurrected = false end + if blocking == nil then + blocking = UnitDefNames[unitName].blocking + end + if resurrected == nil then + resurrected = false + end if UnitDefNames[unitName] then local QueueSpawnCommand = { - unitName = unitName, - frame = frame, - posx = posx, - posy = posy, - posz = posz, - facing = facing, - team = team, - blocking = blocking, - resurrected = resurrected, - } - if #QueuedSpawnList > 0 then - local len = #QueuedSpawnList - for i = 1, len do - local TestedQueueFrame = QueuedSpawnList[i].frame - if TestedQueueFrame >= QueueSpawnCommand.frame then - table.insert(QueuedSpawnList, i, QueueSpawnCommand) - break - elseif i == len then - QueuedSpawnList[len + 1] = QueueSpawnCommand - break - end - end - else - QueuedSpawnList[1] = QueueSpawnCommand - end + unitName = unitName, + frame = frame, + posx = posx, + posy = posy, + posz = posz, + facing = facing, + team = team, + blocking = blocking, + resurrected = resurrected, + } + if #QueuedSpawnList > 0 then + local len = #QueuedSpawnList + for i = 1, len do + local TestedQueueFrame = QueuedSpawnList[i].frame + if TestedQueueFrame >= QueueSpawnCommand.frame then + table.insert(QueuedSpawnList, i, QueueSpawnCommand) + break + elseif i == len then + QueuedSpawnList[len + 1] = QueueSpawnCommand + break + end + end + else + QueuedSpawnList[1] = QueueSpawnCommand + end else - Spring.Echo("[Spawn Queue] Failed to queue "..unitName..", invalid unitDefName") + Spring.Echo("[Spawn Queue] Failed to queue " .. unitName .. ", invalid unitDefName") end end @@ -41,62 +43,58 @@ local function SpawnUnitsFromQueue(n) -- Call this every frame in your gadget. local QueuedSpawnsNumber = #QueuedSpawnList if QueuedSpawnsNumber > 0 then local removedCount = 0 - for i = 1,QueuedSpawnsNumber do + for i = 1, QueuedSpawnsNumber do local item = QueuedSpawnList[1] if item and n >= item.frame then - local unitID = Spring.CreateUnit( - item.unitName, - item.posx, - item.posy, - item.posz, - item.facing, - item.team - ) + local unitID = Spring.CreateUnit(item.unitName, item.posx, item.posy, item.posz, item.facing, item.team) if unitID and item.blocking == false then Spring.SetUnitBlocking(unitID, false, false, true) end - if unitID and item.resurrected == true then - Spring.SetUnitRulesParam(unitID, "resurrected", 1, {inlos=true}) - Spring.SetUnitHealth(unitID, 10) + if unitID and item.resurrected == true then + Spring.SetUnitRulesParam(unitID, "resurrected", 1, { inlos = true }) + Spring.SetUnitHealth(unitID, 10) elseif unitID then - GG.ScavengersSpawnEffectUnitID(unitID) - end - table.remove(QueuedSpawnList, 1) + GG.ScavengersSpawnEffectUnitID(unitID) + end + table.remove(QueuedSpawnList, 1) elseif not item then - break - end + break + end end end end - local QueuedDestroyList = {} local function AddToDestroyQueue(unitID, selfd, reclaimed, frame) - if selfd == nil then selfd = false end - if reclaimed == nil then reclaimed = false end + if selfd == nil then + selfd = false + end + if reclaimed == nil then + reclaimed = false + end - if Spring.ValidUnitID(unitID) then + if Spring.ValidUnitID(unitID) then local QueueDestroyCommand = { - unitID = unitID, - frame = frame, - selfd = selfd, - reclaimed = reclaimed, - } - if #QueuedDestroyList > 0 then - local len = #QueuedDestroyList - for i = 1, len do - local TestedQueueFrame = QueuedDestroyList[i].frame - if TestedQueueFrame >= QueueDestroyCommand.frame then - table.insert(QueuedDestroyList, i, QueueDestroyCommand) - break - elseif i == len then - QueuedDestroyList[len + 1] = QueueDestroyCommand - break - end - end - else - QueuedDestroyList[1] = QueueDestroyCommand - end + unitID = unitID, + frame = frame, + selfd = selfd, + reclaimed = reclaimed, + } + if #QueuedDestroyList > 0 then + local len = #QueuedDestroyList + for i = 1, len do + local TestedQueueFrame = QueuedDestroyList[i].frame + if TestedQueueFrame >= QueueDestroyCommand.frame then + table.insert(QueuedDestroyList, i, QueueDestroyCommand) + break + elseif i == len then + QueuedDestroyList[len + 1] = QueueDestroyCommand + break + end + end + else + QueuedDestroyList[1] = QueueDestroyCommand + end else --Spring.Echo("[Spawn Queue] Failed to queue destruction of unit "..unitID..", invalid unit") end @@ -105,14 +103,10 @@ end local function DestroyUnitsFromQueue(n) -- Call this every frame in your gadget. local QueuedDestroyNumber = #QueuedDestroyList if QueuedDestroyNumber > 0 then - for i = 1,QueuedDestroyNumber do + for i = 1, QueuedDestroyNumber do local item = QueuedDestroyList[1] if item and n >= item.frame then - Spring.DestroyUnit( - item.unitID, - item.selfd, - item.reclaimed - ) + Spring.DestroyUnit(item.unitID, item.selfd, item.reclaimed) table.remove(QueuedDestroyList, 1) elseif not item then break @@ -122,8 +116,8 @@ local function DestroyUnitsFromQueue(n) -- Call this every frame in your gadget. end return { - AddToSpawnQueue = AddToSpawnQueue, - AddToDestroyQueue = AddToDestroyQueue, - SpawnUnitsFromQueue = SpawnUnitsFromQueue, - DestroyUnitsFromQueue = DestroyUnitsFromQueue, + AddToSpawnQueue = AddToSpawnQueue, + AddToDestroyQueue = AddToDestroyQueue, + SpawnUnitsFromQueue = SpawnUnitsFromQueue, + DestroyUnitsFromQueue = DestroyUnitsFromQueue, } diff --git a/luarules/Utilities/damgam_lib/unit_swap.lua b/luarules/Utilities/damgam_lib/unit_swap.lua index 3c0d1a02554..2eb38118944 100644 --- a/luarules/Utilities/damgam_lib/unit_swap.lua +++ b/luarules/Utilities/damgam_lib/unit_swap.lua @@ -1,33 +1,33 @@ local function SwapUnit(unitID, newUnitName) - -- Collect info about unit - local unitDefID = Spring.GetUnitDefID(unitID) - local unitTeam = Spring.GetUnitTeam(unitID) - local unitHealth, unitMaxHealth, unitParalyze, unitCapture, unitBuildProgress = Spring.GetUnitHealth(unitID) - local unitExperience = Spring.GetUnitExperience(unitID) - local unitPosX, unitPosY, unitPosZ = Spring.GetUnitPosition(unitID) - local unitDirectionX, unitDirectionY, unitDirectionZ = Spring.GetUnitDirection(unitID) - local unitVelocityX, unitVelocityY, unitVelocityZ = Spring.GetUnitVelocity(unitID) - local unitResurrected = Spring.GetUnitRulesParam(unitID, "resurrected") + -- Collect info about unit + local unitDefID = Spring.GetUnitDefID(unitID) + local unitTeam = Spring.GetUnitTeam(unitID) + local unitHealth, unitMaxHealth, unitParalyze, unitCapture, unitBuildProgress = Spring.GetUnitHealth(unitID) + local unitExperience = Spring.GetUnitExperience(unitID) + local unitPosX, unitPosY, unitPosZ = Spring.GetUnitPosition(unitID) + local unitDirectionX, unitDirectionY, unitDirectionZ = Spring.GetUnitDirection(unitID) + local unitVelocityX, unitVelocityY, unitVelocityZ = Spring.GetUnitVelocity(unitID) + local unitResurrected = Spring.GetUnitRulesParam(unitID, "resurrected") - -- Spawn new unit, and if successful, despawn old one. - local newUnitID = Spring.CreateUnit(newUnitName, unitPosX, unitPosY, unitPosZ, 0, unitTeam) - if newUnitID then - Spring.DestroyUnit(unitID, false, true) - GG.ScavengersSpawnEffectUnitID(newUnitID) - - -- Apply stats of old unit to new one - Spring.SetUnitExperience(newUnitID, unitExperience) - local newUnitMaxHealth = select(2, Spring.GetUnitHealth(newUnitID)) - local newUnitHealth = (unitHealth/unitMaxHealth)*newUnitMaxHealth - Spring.SetUnitHealth(newUnitID, newUnitHealth, unitCapture, unitParalyze, unitBuildProgress) - Spring.SetUnitDirection(newUnitID, unitDirectionX, unitDirectionY, unitDirectionZ) - Spring.SetUnitVelocity(newUnitID, unitVelocityX, unitVelocityY, unitVelocityZ) - if unitResurrected then - Spring.SetUnitRulesParam(newUnitID, "resurrected", 1, {inlos=true}) - end - end + -- Spawn new unit, and if successful, despawn old one. + local newUnitID = Spring.CreateUnit(newUnitName, unitPosX, unitPosY, unitPosZ, 0, unitTeam) + if newUnitID then + Spring.DestroyUnit(unitID, false, true) + GG.ScavengersSpawnEffectUnitID(newUnitID) + + -- Apply stats of old unit to new one + Spring.SetUnitExperience(newUnitID, unitExperience) + local newUnitMaxHealth = select(2, Spring.GetUnitHealth(newUnitID)) + local newUnitHealth = (unitHealth / unitMaxHealth) * newUnitMaxHealth + Spring.SetUnitHealth(newUnitID, newUnitHealth, unitCapture, unitParalyze, unitBuildProgress) + Spring.SetUnitDirection(newUnitID, unitDirectionX, unitDirectionY, unitDirectionZ) + Spring.SetUnitVelocity(newUnitID, unitVelocityX, unitVelocityY, unitVelocityZ) + if unitResurrected then + Spring.SetUnitRulesParam(newUnitID, "resurrected", 1, { inlos = true }) + end + end end return { - SwapUnit = SwapUnit, -} \ No newline at end of file + SwapUnit = SwapUnit, +} diff --git a/luarules/Utilities/unitrendering.lua b/luarules/Utilities/unitrendering.lua index 741d91751df..1a0efd10365 100644 --- a/luarules/Utilities/unitrendering.lua +++ b/luarules/Utilities/unitrendering.lua @@ -10,7 +10,7 @@ ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- -if (SendToUnsynced) then +if SendToUnsynced then return "" end @@ -42,7 +42,7 @@ end local function ActivateMaterial(rendering, objectID, lod) local activeMats = rendering.activeMats[objectID] if not activeMats then - activeMats = {current = math.huge} + activeMats = { current = math.huge } rendering.activeMats[objectID] = activeMats end @@ -65,9 +65,7 @@ local function ActivateMaterial(rendering, objectID, lod) end end - local function DeactivateMaterial(rendering, objectID, lod) - local activeMats = rendering.activeMats[objectID] if not activeMats then return @@ -78,7 +76,6 @@ local function DeactivateMaterial(rendering, objectID, lod) if activeMats.current == lod then --// detect next available material for i = 1, rendering.curHighestLOD do - if activeMats[i] then activeMats.current = i @@ -89,8 +86,6 @@ local function DeactivateMaterial(rendering, objectID, lod) --// none material active - - rendering.activeMats[objectID] = nil rendering.spSetMaterialLastLOD(objectID, "opaque", 0) SetLODCount(rendering, objectID, 0) diff --git a/luarules/colors.h.lua b/luarules/colors.h.lua index 9c368cc8892..9f631fb9b0d 100644 --- a/luarules/colors.h.lua +++ b/luarules/colors.h.lua @@ -11,24 +11,24 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -WhiteStr = "\255\255\255\255" -BlackStr = "\255\001\001\001" -GreyStr = "\255\128\128\128" -RedStr = "\255\255\001\001" -PinkStr = "\255\255\064\064" -GreenStr = "\255\001\255\001" -BlueStr = "\255\001\001\255" -CyanStr = "\255\001\255\255" -YellowStr = "\255\255\255\001" +WhiteStr = "\255\255\255\255" +BlackStr = "\255\001\001\001" +GreyStr = "\255\128\128\128" +RedStr = "\255\255\001\001" +PinkStr = "\255\255\064\064" +GreenStr = "\255\001\255\001" +BlueStr = "\255\001\001\255" +CyanStr = "\255\001\255\255" +YellowStr = "\255\255\255\001" MagentaStr = "\255\255\001\255" Colors = {} -Colors.white = { 1.0, 1.0, 1.0, 1.0 } -Colors.black = { 0.0, 0.0, 0.0, 1.0 } -Colors.grey = { 0.5, 0.5, 0.5, 1.0 } -Colors.red = { 1.0, 0.0, 0.0, 1.0 } -Colors.green = { 0.0, 1.0, 0.0, 1.0 } -Colors.blue = { 0.0, 0.0, 1.0, 1.0 } -Colors.yellow = { 1.0, 1.0, 0.0, 1.0 } -Colors.cyan = { 0.0, 1.0, 1.0, 1.0 } +Colors.white = { 1.0, 1.0, 1.0, 1.0 } +Colors.black = { 0.0, 0.0, 0.0, 1.0 } +Colors.grey = { 0.5, 0.5, 0.5, 1.0 } +Colors.red = { 1.0, 0.0, 0.0, 1.0 } +Colors.green = { 0.0, 1.0, 0.0, 1.0 } +Colors.blue = { 0.0, 0.0, 1.0, 1.0 } +Colors.yellow = { 1.0, 1.0, 0.0, 1.0 } +Colors.cyan = { 0.0, 1.0, 1.0, 1.0 } Colors.magenta = { 1.0, 0.0, 1.0, 1.0 } diff --git a/luarules/configs/Atmosphereconfigs/acidicquarry.lua b/luarules/configs/Atmosphereconfigs/acidicquarry.lua index aa4d9069645..3f58484a8c3 100644 --- a/luarules/configs/Atmosphereconfigs/acidicquarry.lua +++ b/luarules/configs/Atmosphereconfigs/acidicquarry.lua @@ -5,28 +5,26 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere Functions --- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) --- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) + -- ## Atmosphere Functions + -- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) + -- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable - - --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty-green", 1900, 32, 1257) - SpawnCEGInPositionGround("fogdirty-green", 757, 32, 1554) + SpawnCEGInPositionGround("fogdirty-green", 757, 32, 1554) SpawnCEGInPositionGround("fogdirty-green", 4608, 32, 1413) SpawnCEGInPositionGround("fogdirty-green", 5459, 32, 1650) SpawnCEGInPositionGround("fogdirty-green", 4536, 32, 4716) @@ -35,15 +33,15 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty-green", 1295, 32, 5537) end - if n%360 == 180 then + if n % 360 == 180 then SpawnCEGInPositionGround("fogdirty-green", 1382, 32, 1824) SpawnCEGInPositionGround("fogdirty-green", 4582, 32, 1805) SpawnCEGInPositionGround("fogdirty-green", 5704, 32, 4257) SpawnCEGInPositionGround("fogdirty-green", 478, 32, 4262) end --- rare foggy cliffs - if n%700 == 0 then + -- rare foggy cliffs + if n % 700 == 0 then SpawnCEGInPositionGround("fogdirty-green", 3038, 32, 3031) SpawnCEGInPositionGround("fogdirty-green", 1487, 32, 3747) SpawnCEGInPositionGround("fogdirty-green", 3575, 32, 4326) @@ -54,35 +52,33 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty-green", 3433, 32, 3686) end --- common fireflies - if n%1800 == 0 then + -- common fireflies + if n % 1800 == 0 then SpawnCEGInPositionGround("firefliesgreen", 2259, 0, 3987) SpawnCEGInPositionGround("firefliesgreen", 5599, 0, 4069) SpawnCEGInPositionGround("firefliesgreen", 588, 0, 3758) end --- rare rain - if n%6800 == 5000 then + -- rare rain + if n % 6800 == 5000 then SpawnCEGInRandomMapPos("rainlight-acid", 0, 15, _, 750, "rainlight", 0.5) end - if n%6800 == 4300 then + if n % 6800 == 4300 then SpawnCEGInRandomMapPos("rainlight-acid", 0, 15, _, 750, "rainlight", 0.5) end - if n%500 == 10 then + if n % 500 == 10 then SpawnCEGInRandomMapPos("rainverylight-acid", 0, 15, _, 750, "rainlight", 0.5) end --- -- random rain --- if n%3200 == 1600 then --- SpawnCEGInRandomMapPos("rain", 0, _, _, _, "rainlight", 1) --- end + -- -- random rain + -- if n%3200 == 1600 then + -- SpawnCEGInRandomMapPos("rain", 0, _, _, _, "rainlight", 1) + -- end --- -- random lightning --- if n%7000 == 600 then --- SpawnCEGInRandomMapPos("lightningstormgreen", 0, _, _, _, "distantthunder", 0.85) --- end - - -end \ No newline at end of file + -- -- random lightning + -- if n%7000 == 600 then + -- SpawnCEGInRandomMapPos("lightningstormgreen", 0, _, _, _, "distantthunder", 0.85) + -- end +end diff --git a/luarules/configs/Atmosphereconfigs/all that simmers.lua b/luarules/configs/Atmosphereconfigs/all that simmers.lua index 631de669ad6..14a4b9c1c2f 100644 --- a/luarules/configs/Atmosphereconfigs/all that simmers.lua +++ b/luarules/configs/Atmosphereconfigs/all that simmers.lua @@ -5,69 +5,68 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- random sandclouds - if n%400 == 200 then + -- random sandclouds + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 6000, 0, 5919, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 4770, 0, 6680, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 7160, 0, 5388, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 4700, 0, 7300, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 4140, 0, 7456, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 4610, 0, 8710, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 5562, 0, 8540, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 4560, 0, 10210, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 7120, 0, 9950, 50) end - - if n%400 == 200 then + + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 50, 0, 50, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 2400, 0, 40, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 2400, 0, 1200, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 40, 0, 2200, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 13300, 0, 2500, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 2300, 0, 3300, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 1300, 0, 3900, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 50, 0, 4700, 50) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("mistycloud", 6, 0, 3400, 50) end - + -- if n%2000 == 1000 then -- SpawnCEGInArea("sandclouddense", 3200, 235, 1900, 1900) -- end - + -- if n%6000 == 3000 then -- SpawnCEGInArea("sandclouddensexl", 3200, 235, 1900, 500) -- end - end diff --git a/luarules/configs/Atmosphereconfigs/all that smolders.lua b/luarules/configs/Atmosphereconfigs/all that smolders.lua index 7ceaa9aacf1..c55c067f7a1 100644 --- a/luarules/configs/Atmosphereconfigs/all that smolders.lua +++ b/luarules/configs/Atmosphereconfigs/all that smolders.lua @@ -5,23 +5,22 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- random sandclouds - if n%400 == 200 then + -- random sandclouds + if n % 400 == 200 then SpawnCEGInArea("sandcloud_sparse", 3300, 200, 2800, 2500) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("sandcloud_sparse", 2300, 200, 5100, 1000) end - if n%400 == 200 then + if n % 400 == 200 then SpawnCEGInArea("sandcloud_sparse", 500, 200, 7700, 2500) end - + -- if n%2000 == 1000 then -- SpawnCEGInArea("sandclouddense", 3200, 235, 1900, 1900) -- end - + -- if n%6000 == 3000 then -- SpawnCEGInArea("sandclouddensexl", 3200, 235, 1900, 500) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/altored divide bar remake.lua b/luarules/configs/Atmosphereconfigs/altored divide bar remake.lua index 3c1f9730ab3..9e1ad9dfed0 100644 --- a/luarules/configs/Atmosphereconfigs/altored divide bar remake.lua +++ b/luarules/configs/Atmosphereconfigs/altored divide bar remake.lua @@ -5,21 +5,21 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1050 == 0 then + -- SND windy locations + if n % 1050 == 0 then SpawnCEGInPositionGround("noceg", 660, 500, 413, _, _, _, "windy", 0.3) end - if n%1090 == 30 then + if n % 1090 == 30 then SpawnCEGInPositionGround("noceg", 7400, 600, 350, _, _, _, "windy", 0.3) end - if n%1170 == 60 then + if n % 1170 == 60 then SpawnCEGInPositionGround("noceg", 470, 500, 7900, _, _, _, "windy", 0.3) end - if n%980 == 90 then + if n % 980 == 90 then SpawnCEGInPositionGround("noceg", 7400, 600, 7800, _, _, _, "windy", 0.3) end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 0 then -- SpawnCEGInPositionGround("noceg", 2525, 300, 5383, _, _, _, "geoventshort", 0.5) -- end @@ -33,9 +33,9 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 2513, 300, 3967, _, _, _, "geoventshort", 0.5) -- end --- ## Atmosphere Functions --- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) --- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) + -- ## Atmosphere Functions + -- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) + -- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) -- DayNight Cycle --[[ @@ -48,20 +48,20 @@ function gadget:GameFrame(n) end --]] --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- Lightningstorm clusters ---[[ + -- Lightningstorm clusters + --[[ local lightningsounds = { "thunder1", "thunder2", @@ -138,59 +138,58 @@ if n%9000 > 4500 then end ]] --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty-green", 1490, 32, 4271) SpawnCEGInPositionGround("fogdirty-green", 5545, 32, 3359) SpawnCEGInPositionGround("fogdirty-green", 3365, 32, 3438) SpawnCEGInPositionGround("fogdirty-green", 5261, 32, 2582) end - if n%360 == 180 then - + if n % 360 == 180 then SpawnCEGInPositionGround("fogdirty-green", 4039, 32, 4245) SpawnCEGInPositionGround("fogdirty-green", 5626, 32, 4687) SpawnCEGInPositionGround("fogdirty-green", 2913, 32, 5769) SpawnCEGInPositionGround("fogdirty-green", 360, 32, 2558) end --- rare foggy cliffs - if n%700 == 0 then + -- rare foggy cliffs + if n % 700 == 0 then SpawnCEGInPositionGround("fogdirty-green", 624, 32, 565) SpawnCEGInPositionGround("fogdirty-green", 7201, 32, 5743) end --- common fireflies - if n%1000 == 0 then + -- common fireflies + if n % 1000 == 0 then SpawnCEGInPositionGround("fireflies", 774, 32, 4289) SpawnCEGInPositionGround("fireflies", 7299, 32, 3964) SpawnCEGInPositionGround("fireflies", 2933, 32, 4136) end --- rare fireflies - if n%2200 == 0 then + -- rare fireflies + if n % 2200 == 0 then SpawnCEGInPositionGround("fireflies", 3362, 32, 3494) SpawnCEGInPositionGround("fireflies", 943, 32, 3381) end --- -- random rain --- if n%3200 == 1600 then --- SpawnCEGInRandomMapPos("rain", 0, _, _, _, "rainlight", 1) --- end + -- -- random rain + -- if n%3200 == 1600 then + -- SpawnCEGInRandomMapPos("rain", 0, _, _, _, "rainlight", 1) + -- end --- -- random lightning --- if n%7000 == 600 then --- SpawnCEGInRandomMapPos("lightningstormgreen", 0, _, _, _, "distantthunder", 0.85) --- end - --- lightningstorms + -- -- random lightning + -- if n%7000 == 600 then + -- SpawnCEGInRandomMapPos("lightningstormgreen", 0, _, _, _, "distantthunder", 0.85) + -- end + + -- lightningstorms -- if n%60 == 0 then - -- local r = math.random(0,2) - -- if r == 0 then + -- local r = math.random(0,2) + -- if r == 0 then -- SpawnCEGInRandomMapPos("lightningstrikegreen", 0, 100, 20, 128, lightningsounds[math.random(1,#lightningsounds)], 1) - -- end - -- end + -- end + -- end -- if n%6400 == 4900 then -- SpawnCEGInRandomMapPos("lightningstrikegreen", 0, 100, 20, 128, lightningsounds[math.random(1,#lightningsounds)], 1) @@ -207,5 +206,4 @@ end -- if n%6400 == 5610 then -- SpawnCEGInRandomMapPos("lightningstrikegreen", 0, 100, 20, 128, lightningsounds[math.random(1,#lightningsounds)], 1) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/ascendancy.lua b/luarules/configs/Atmosphereconfigs/ascendancy.lua index ada17b09411..e09d6da13f8 100644 --- a/luarules/configs/Atmosphereconfigs/ascendancy.lua +++ b/luarules/configs/Atmosphereconfigs/ascendancy.lua @@ -5,16 +5,16 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1150 == 0 then + -- SND windy locations + if n % 1150 == 0 then SpawnCEGInPositionGround("noceg", 2200, 500, 4200, _, _, _, "windy", 0.2) end - if n%1270 == 100 then + if n % 1270 == 100 then SpawnCEGInPositionGround("noceg", 10000, 600, 4000, _, _, _, "windy", 0.2) end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 5 then -- SpawnCEGInPositionGround("noceg", 6181, 200, 7267, _, _, _, "geoventshort", 0.4) -- end @@ -43,20 +43,20 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 6050, 200, 4204, _, _, _, "geoventshort", 0.4) -- end --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 5600, 0, 128) SpawnCEGInPositionGround("fogdirty", 5900, 0, 150) SpawnCEGInPositionGround("fogdirty", 6530, 0, 220) @@ -70,38 +70,38 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty", 380, 0, 554) end --- rare foggy cliffs + -- rare foggy cliffs -- if n%380 == 150 then - -- SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) - -- SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) - -- SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) + -- SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) + -- SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) + -- SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) -- end --- -- mistyclouds + -- -- mistyclouds -- if n%1200 == 550 then -- SpawnCEGInPositionGround("mistycloud", 9076, 150, 6829) -- end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs + -- alternate rare foggy cliffs -- if n%620 == 300 then - -- SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) - -- SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) - -- SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) + -- SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) + -- SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) + -- SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) -- end --- super rare foggy cliffs + -- super rare foggy cliffs -- if n%1000 == 400 then - -- SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) - -- SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) + -- SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) + -- SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) -- end --- fireflies + -- fireflies -- if n%1400 == 0 then -- SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) -- SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) @@ -109,9 +109,8 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("fireflies", 223, 32, 249) -- end --- pollen - if n%300 == 0 then + -- pollen + if n % 300 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/centerrock remake dry.lua b/luarules/configs/Atmosphereconfigs/centerrock remake dry.lua index ff3dac09767..12dfee80288 100644 --- a/luarules/configs/Atmosphereconfigs/centerrock remake dry.lua +++ b/luarules/configs/Atmosphereconfigs/centerrock remake dry.lua @@ -13,43 +13,43 @@ function gadget:GameFrame(n) -- SendToUnsynced("MapAtmosphereConfigSetSun", 0.45, 1, 0.1) -- end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy canyon - if n%20 == 0 then + -- common foggy canyon + if n % 20 == 0 then SpawnCEGInRandomMapPosBelowY("fogdirty-brown", 16, 800) end --- clouds - if n%18000 > 500 and n%18000 < 9500 then - if n%660 == 100 then + -- clouds + if n % 18000 > 500 and n % 18000 < 9500 then + if n % 660 == 100 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2100) end - if n%660 == 130 then + if n % 660 == 130 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2025) end - if n%660 == 165 then + if n % 660 == 165 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2100) end - if n%660 == 225 then + if n % 660 == 225 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2150) end - if n%660 == 255 then + if n % 660 == 255 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2150) end end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then --SpawnCEGInPositionGround("fogdirty-brown", 5437, 0, 3089) SpawnCEGInPositionGround("fogdirty-brown", 3400, 0, 4800) SpawnCEGInPositionGround("fogdirty-brown", 6594, 0, 1463) @@ -58,8 +58,8 @@ function gadget:GameFrame(n) --SpawnCEGInPositionGround("fogdirty-brown", 3034, 0, 3736) end --- rare foggy cliffs - if n%700 == 0 then + -- rare foggy cliffs + if n % 700 == 0 then SpawnCEGInPositionGround("fogdirty-brown", 2861, 0, 659) SpawnCEGInPositionGround("fogdirty-brown", 3687, 0, 4067) SpawnCEGInPositionGround("fogdirty-brown", 248, 0, 7927) @@ -67,14 +67,14 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty-brown", 1050, 0, 2410) end --- super rare foggy cliffs + -- super rare foggy cliffs -- if n%1100 == 0 then -- SpawnCEGInPositionGround("fogdirty-brown", 4026, 0, 4667) -- SpawnCEGInPositionGround("fogdirty-brown", 7104, 0, 2290) -- end --- powerup heavy metal - if n%900 == 0 then + -- powerup heavy metal + if n % 900 == 0 then SpawnCEGInPositionGround("powerupwhite", 3447, 0, 4172) SpawnCEGInPositionGround("powerupwhite", 3582, 0, 4383) SpawnCEGInPositionGround("powerupwhite", 5076, 0, 3385) @@ -85,10 +85,9 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("powerupwhite", 814, 0, 8011) end --- rare sandclouds + -- rare sandclouds -- if n%1900 == 800 then -- SpawnCEGInAreaGround("sandcloud", 610, 0, 470, 200) -- SpawnCEGInAreaGround("sandcloud", 7400, 0, 7400, 200) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/centerrock remake.lua b/luarules/configs/Atmosphereconfigs/centerrock remake.lua index 59cc29cf140..dcd73c1e1ac 100644 --- a/luarules/configs/Atmosphereconfigs/centerrock remake.lua +++ b/luarules/configs/Atmosphereconfigs/centerrock remake.lua @@ -11,53 +11,53 @@ function gadget:GameFrame(n) -- SendToUnsynced("MapAtmosphereConfigSetSun", 0.1, 2, 0.2) -- end -local lightningsounds = { - "thunder1", - "thunder2", - "thunder3", - "thunder4", - "thunder5", - "thunder6", - } - --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) - --- Use _ for damage, paralyzedamage, damageradius if you want to disable - --- common foggy canyon + local lightningsounds = { + "thunder1", + "thunder2", + "thunder3", + "thunder4", + "thunder5", + "thunder6", + } + + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + + -- Use _ for damage, paralyzedamage, damageradius if you want to disable + + -- common foggy canyon -- if n%20 == 0 then -- SpawnCEGInRandomMapPosBelowY("fogdirty-brown-brown", 16, 100) -- end --- clouds - if n%630 == 100 then + -- clouds + if n % 630 == 100 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2100) end - if n%630 == 130 then + if n % 630 == 130 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2025) end - if n%630 == 165 then + if n % 630 == 165 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2100) end - if n%630 == 225 then + if n % 630 == 225 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2150) end - if n%630 == 255 then + if n % 630 == 255 then SpawnCEGInRandomMapPosPresetY("mistycloud", 2150) end - if n%1260 == 325 then + if n % 1260 == 325 then SpawnCEGInRandomMapPosPresetY("thickcloud", 2650) end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then --SpawnCEGInPosition("fogdirty-brown", 5437, 212, 3089) SpawnCEGInPosition("fogdirty", 3658, 179, 4861) SpawnCEGInPosition("fogdirty-brown", 6594, 93, 1463) @@ -66,8 +66,8 @@ local lightningsounds = { --SpawnCEGInPosition("fogdirty-brown", 3034, 32, 3736) end --- rare foggy cliffs - if n%700 == 0 then + -- rare foggy cliffs + if n % 700 == 0 then SpawnCEGInPosition("fogdirty-brown", 2861, 407, 659) SpawnCEGInPosition("fogdirty-brown", 3687, 383, 4067) SpawnCEGInPosition("fogdirty-brown", 248, 150, 7927) @@ -75,14 +75,14 @@ local lightningsounds = { SpawnCEGInPosition("fogdirty-brown", 1050, 450, 2410) end --- super rare foggy cliffs + -- super rare foggy cliffs --if n%1100 == 0 then -- SpawnCEGInPosition("fogdirty-brown", 4026, 672, 4667) -- SpawnCEGInPosition("fogdirty-brown", 7104, 569, 2290) --end --- powerup heavy metal - if n%900 == 0 then + -- powerup heavy metal + if n % 900 == 0 then SpawnCEGInPosition("powerupwhite", 3447, 525, 4172) SpawnCEGInPosition("powerupwhite", 3582, 496, 4383) SpawnCEGInPosition("powerupwhite", 5076, 523, 3385) @@ -93,48 +93,45 @@ local lightningsounds = { SpawnCEGInPosition("powerupwhite", 814, 144, 8011) end --- light rain - if n%6400 == 5370 then + -- light rain + if n % 6400 == 5370 then SpawnCEGInRandomMapPos("rainlight", 0, _, _, _, "rainlight", 0.5) end --- Thunderstorm Darkness Cycle + -- Thunderstorm Darkness Cycle - if n%6400 < 4800 then + if n % 6400 < 4800 then SendToUnsynced("MapAtmosphereConfigSetSun", 1, 2, 1, 1, 1) else SendToUnsynced("MapAtmosphereConfigSetSun", 0.5, 3, 0.5, 0.5, 0.5) end - if n %6400 == 5400 then - local thunderstormcenterx = math.random(100, (mapsizeX-100)) - local thunderstormcenterz = math.random(100, (mapsizeZ-100)) - local thunderstormradius = 675 - thunderstormxmin = thunderstormcenterx - thunderstormradius - thunderstormxmax = thunderstormcenterx + thunderstormradius - thunderstormzmin = thunderstormcenterz - thunderstormradius - thunderstormzmax = thunderstormcenterz + thunderstormradius - SpawnCEGInPositionGround("rainlight", thunderstormcenterx, 0, thunderstormcenterz, _, _, _, "rainlight", 0.7) - SpawnCEGInPosition("noceg", thunderstormcenterx, 1000, thunderstormcenterz, _, _, _, "distantthunder", 0.4) + if n % 6400 == 5400 then + local thunderstormcenterx = math.random(100, (mapsizeX - 100)) + local thunderstormcenterz = math.random(100, (mapsizeZ - 100)) + local thunderstormradius = 675 + thunderstormxmin = thunderstormcenterx - thunderstormradius + thunderstormxmax = thunderstormcenterx + thunderstormradius + thunderstormzmin = thunderstormcenterz - thunderstormradius + thunderstormzmax = thunderstormcenterz + thunderstormradius + SpawnCEGInPositionGround("rainlight", thunderstormcenterx, 0, thunderstormcenterz, _, _, _, "rainlight", 0.7) + SpawnCEGInPosition("noceg", thunderstormcenterx, 1000, thunderstormcenterz, _, _, _, "distantthunder", 0.4) end - if n%6400 > 5400 then - if n%30 == 0 then - local r = math.random(0,4) - if r == 0 then - local posx = math.random(thunderstormxmin, thunderstormxmax) - local posz = math.random(thunderstormzmin, thunderstormzmax) - SpawnCEGInPositionGround("lightningstrike", posx, 0, posz, _, _, _, lightningsounds[math.random(1,#lightningsounds)], 1) - end - end + if n % 6400 > 5400 then + if n % 30 == 0 then + local r = math.random(0, 4) + if r == 0 then + local posx = math.random(thunderstormxmin, thunderstormxmax) + local posz = math.random(thunderstormzmin, thunderstormzmax) + SpawnCEGInPositionGround("lightningstrike", posx, 0, posz, _, _, _, lightningsounds[math.random(1, #lightningsounds)], 1) + end + end end - - --- rare sandclouds + -- rare sandclouds -- if n%1900 == 800 then -- SpawnCEGInAreaGround("sandcloud", 610, 0, 470, 200) -- SpawnCEGInAreaGround("sandcloud", 7400, 0, 7400, 200) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/colorado_v2.lua b/luarules/configs/Atmosphereconfigs/colorado_v2.lua index 1bbe6f87977..6ca3d50b421 100644 --- a/luarules/configs/Atmosphereconfigs/colorado_v2.lua +++ b/luarules/configs/Atmosphereconfigs/colorado_v2.lua @@ -5,24 +5,24 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1020 == 0 then + -- SND windy locations + if n % 1020 == 0 then SpawnCEGInPositionGround("noceg", 6200, 500, 900, _, _, _, "windy_mountains", 0.15) end - if n%990 == 100 then + if n % 990 == 100 then SpawnCEGInPositionGround("noceg", 3200, 600, 2300, _, _, _, "windy_mountains", 0.15) end - if n%1010 == 200 then + if n % 1010 == 200 then SpawnCEGInPositionGround("noceg", 6200, 600, 2900, _, _, _, "windy_mountains", 0.15) end - if n%980 == 300 then + if n % 980 == 300 then SpawnCEGInPositionGround("noceg", 3000, 600, 5400, _, _, _, "windy_mountains", 0.15) end --- SND water ocean + -- SND water ocean -- if n%960 == 20 then -- SpawnCEGInPositionGround("noceg", 2200, 0, 6000, _, _, _, "oceangentlesurf", 0.3) -- end @@ -31,7 +31,7 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 6000, 0, 1100, _, _, _, "oceangentlesurf", 0.3) -- end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 0 then -- SpawnCEGInPositionGround("noceg", 4300, 200, 5400, _, _, _, "geoventshort", 0.15) -- end @@ -56,44 +56,43 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 8460, 200, 2012, _, _, _, "geoventshort", 0.15) -- end --- common foggy canyon - if n%700 == 0 then + -- common foggy canyon + if n % 700 == 0 then SpawnCEGInPositionGround("mistycloud", 4286, 300, 3100) SpawnCEGInPositionGround("mistycloud", 5083, 200, 4419) --SpawnCEGInPositionGround("fogdirty", 240, 100, 3655) end --- rare foggy cliffs - if n%440 == 150 then + -- rare foggy cliffs + if n % 440 == 150 then SpawnCEGInPositionGround("mistycloud", 5550, 200, 1237) SpawnCEGInPositionGround("mistycloud", 2561, 220, 5925) --SpawnCEGInPositionGround("fogdirty", 7940, 100, 3538) end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then --SpawnCEGInPositionGround("fogdirty", 6983, 0, 2452) --SpawnCEGInPositionGround("fogdirty", 1580, 0, 1888) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then --SpawnCEGInPositionGround("fogdirty", 6060, 400, 141) --SpawnCEGInPositionGround("fogdirty", 2142, 400, 6910) end --- mistyclouds - if n%1000 == 400 then + -- mistyclouds + if n % 1000 == 400 then --SpawnCEGInPositionGround("mistycloud", 5836, 500, 5343) end - if n%1100 == 200 then + if n % 1100 == 200 then --SpawnCEGInPositionGround("mistycloud", 2279, 400, 1951) end --- pollen - if n%600 == 0 then + -- pollen + if n % 600 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/dsdr.lua b/luarules/configs/Atmosphereconfigs/dsdr.lua index a6dabaf6fee..a63d5a4a63a 100644 --- a/luarules/configs/Atmosphereconfigs/dsdr.lua +++ b/luarules/configs/Atmosphereconfigs/dsdr.lua @@ -5,55 +5,55 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%540 == 0 then + -- common foggy cliffs + if n % 540 == 0 then SpawnCEGInPositionGround("fogdirty-red", 3298, 32, 2811) SpawnCEGInPositionGround("fogdirty-red", 6957, 32, 2772) SpawnCEGInPositionGround("fogdirty-red", 346, 32, 1550) end ---rare foggy cliffs - if n%610 == 305 then + --rare foggy cliffs + if n % 610 == 305 then SpawnCEGInPositionGround("fogdirty-red", 1799, 32, 440) SpawnCEGInPositionGround("fogdirty-red", 8569, 32, 535) end ---foggy canyon - if n%300 == 100 then + --foggy canyon + if n % 300 == 100 then SpawnCEGInPositionGround("fogdirty-red", 5344, 32, 488) SpawnCEGInPositionGround("fogdirty-red", 5497, 32, 1299) end ---foggy canyon alt - if n%310 == 250 then + --foggy canyon alt + if n % 310 == 250 then SpawnCEGInPositionGround("fogdirty-red", 5507, 0, 767) SpawnCEGInPositionGround("fogdirty-red", 5228, 0, 1589) end --- fireflies - if n%1500 == 0 then + -- fireflies + if n % 1500 == 0 then SpawnCEGInPositionGround("firefliesgreen", 6284, 32, 3187) SpawnCEGInPositionGround("firefliesgreen", 4813, 32, 3540) end --- fireflies alt - if n%1500 == 750 then + -- fireflies alt + if n % 1500 == 750 then SpawnCEGInPositionGround("firefliesgreen", 5980, 32, 112) SpawnCEGInPositionGround("firefliesgreen", 2547, 32, 3239) end --- lightningstorms + -- lightningstorms --local lightningsounds = { --"thunder1", --"thunder2", @@ -75,6 +75,4 @@ function gadget:GameFrame(n) --if n%5900 == 3400 then -- SpawnCEGInRandomMapPos("lightningstrike", 0, _, _, _, lightningsounds[math.random(1,#lightningsounds)], 1) --end - - end diff --git a/luarules/configs/Atmosphereconfigs/eye of horus.lua b/luarules/configs/Atmosphereconfigs/eye of horus.lua index bffd114440d..871d50a6954 100644 --- a/luarules/configs/Atmosphereconfigs/eye of horus.lua +++ b/luarules/configs/Atmosphereconfigs/eye of horus.lua @@ -5,24 +5,24 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1020 == 0 then + -- SND windy locations + if n % 1020 == 0 then SpawnCEGInPositionGround("noceg", 400, 500, 4000, _, _, _, "windy", 0.15) end - if n%990 == 100 then + if n % 990 == 100 then SpawnCEGInPositionGround("noceg", 5900, 600, 3000, _, _, _, "windy", 0.15) end - if n%1010 == 200 then + if n % 1010 == 200 then SpawnCEGInPositionGround("noceg", 2000, 600, 7000, _, _, _, "windy", 0.15) end - if n%980 == 300 then + if n % 980 == 300 then SpawnCEGInPositionGround("noceg", 3400, 600, 140, _, _, _, "windy", 0.15) end --- SND water ocean + -- SND water ocean -- if n%960 == 20 then -- SpawnCEGInPositionGround("noceg", 2200, 0, 6000, _, _, _, "oceangentlesurf", 0.3) -- end @@ -31,7 +31,7 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 6000, 0, 1100, _, _, _, "oceangentlesurf", 0.3) -- end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 0 then -- SpawnCEGInPositionGround("noceg", 290, 200, 140, _, _, _, "geoventshort", 0.15) -- end @@ -48,34 +48,33 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 4008, 200, 7032, _, _, _, "geoventshort", 0.15) -- end --- common foggy canyon + -- common foggy canyon -- if n%700 == 0 then -- -- SpawnCEGInPositionGround("mistycloud", 4286, 300, 3100) -- -- SpawnCEGInPositionGround("mistycloud", 5083, 200, 4419) -- --SpawnCEGInPositionGround("fogdirty", 240, 100, 3655) -- end --- rare foggy craters - if n%92 == 0 then - - SpawnCEGInRandomMapPosBelowY("dunecloud", 32, 270) - -- --SpawnCEGInPositionGround("mistycloud", 2561, 220, 5925) - -- --SpawnCEGInPositionGround("fogdirty", 7940, 100, 3538) + -- rare foggy craters + if n % 92 == 0 then + SpawnCEGInRandomMapPosBelowY("dunecloud", 32, 270) + -- --SpawnCEGInPositionGround("mistycloud", 2561, 220, 5925) + -- --SpawnCEGInPositionGround("fogdirty", 7940, 100, 3538) end --- alternate rare foggy cliffs + -- alternate rare foggy cliffs -- if n%620 == 300 then -- --SpawnCEGInPositionGround("fogdirty", 6983, 0, 2452) -- --SpawnCEGInPositionGround("fogdirty", 1580, 0, 1888) -- end --- super rare foggy cliffs + -- super rare foggy cliffs -- if n%1000 == 400 then -- --SpawnCEGInPositionGround("fogdirty", 6060, 400, 141) -- --SpawnCEGInPositionGround("fogdirty", 2142, 400, 6910) -- end --- mistyclouds + -- mistyclouds -- if n%1000 == 400 then -- --SpawnCEGInPositionGround("mistycloud", 5836, 500, 5343) -- end @@ -84,9 +83,8 @@ function gadget:GameFrame(n) -- --SpawnCEGInPositionGround("mistycloud", 2279, 400, 1951) -- end --- pollen + -- pollen -- if n%600 == 0 then -- SpawnCEGInRandomMapPos("dustparticles", 50) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/folsomdamr.lua b/luarules/configs/Atmosphereconfigs/folsomdamr.lua index 634c0d5af34..a751db98d33 100644 --- a/luarules/configs/Atmosphereconfigs/folsomdamr.lua +++ b/luarules/configs/Atmosphereconfigs/folsomdamr.lua @@ -5,95 +5,93 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1160 == 0 then + -- SND windy locations + if n % 1160 == 0 then SpawnCEGInPositionGround("noceg", 700, 700, 800, _, _, _, "windy", 0.35) end - if n%1270 == 100 then + if n % 1270 == 100 then SpawnCEGInPositionGround("noceg", 9400, 700, 800, _, _, _, "windy", 0.35) end - if n%1130 == 200 then + if n % 1130 == 200 then SpawnCEGInPositionGround("noceg", 660, 600, 6700, _, _, _, "windy", 0.35) end - if n%1200 == 300 then + if n % 1200 == 300 then SpawnCEGInPositionGround("noceg", 9700, 600, 6560, _, _, _, "windy", 0.35) end --- SND dam hum - if n%820 == 0 then + -- SND dam hum + if n % 820 == 0 then SpawnCEGInPositionGround("noceg", 5115, 100, 4095, _, _, _, "humheavy", 0.7) end - if n%840 == 120 then + if n % 840 == 120 then SpawnCEGInPositionGround("noceg", 5115, 100, 3078, _, _, _, "humheavy", 0.7) end --- SND water ocean gentle - if n%1330 == 0 then + -- SND water ocean gentle + if n % 1330 == 0 then SpawnCEGInPositionGround("noceg", 6400, 100, 8500, _, _, _, "oceangentlesurf", 0.35) end - if n%1230 == 300 then + if n % 1230 == 300 then SpawnCEGInPositionGround("noceg", 3971, 100, 5586, _, _, _, "oceangentlesurf", 0.35) end - if n%1160 == 35 then + if n % 1160 == 35 then SpawnCEGInPositionGround("noceg", 5101, 300, 1455, _, _, _, "tropicalbeach", 0.5) end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 9809, 0, 3968) SpawnCEGInPositionGround("fogdirty", 6297, 100, 4140) SpawnCEGInPositionGround("fogdirty", 6320, 100, 3177) end --- rare foggy cliffs - if n%380 == 150 then + -- rare foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty", 265, 0, 1718) SpawnCEGInPositionGround("fogdirty", 3919, 100, 4140) SpawnCEGInPositionGround("fogdirty", 3896, 100, 3164) - end --- -- mistyclouds - if n%1200 == 550 then + -- -- mistyclouds + if n % 1200 == 550 then SpawnCEGInPositionGround("mistycloud", 9076, 150, 6829) end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 9585, 0, 304) SpawnCEGInPositionGround("fogdirty", 275, 0, 6675) SpawnCEGInPositionGround("fogdirty", 10163, 0, 1763) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then SpawnCEGInPositionGround("fogdirty", 1125, 0, 4042) SpawnCEGInPositionGround("fogdirty", 5081, 0, 5634) SpawnCEGInPositionGround("fogdirty", 2631, 0, 6591) end --- fireflies - if n%1400 == 0 then + -- fireflies + if n % 1400 == 0 then SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) SpawnCEGInPositionGround("fireflies", 9561, 32, 1072) SpawnCEGInPositionGround("fireflies", 223, 32, 249) end --- pollen - if n%150 == 0 then + -- pollen + if n % 150 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/forge.lua b/luarules/configs/Atmosphereconfigs/forge.lua index 03f4bb4c4a7..8303f29455f 100644 --- a/luarules/configs/Atmosphereconfigs/forge.lua +++ b/luarules/configs/Atmosphereconfigs/forge.lua @@ -5,7 +5,7 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations + -- SND windy locations --if n%1150 == 0 then -- SpawnCEGInPositionGround("noceg", 2200, 500, 4200, _, _, _, "windy", 0.2) --end @@ -14,7 +14,7 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 10000, 600, 4000, _, _, _, "windy", 0.2) --end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 5 then -- SpawnCEGInPositionGround("noceg", 6181, 200, 7267, _, _, _, "geoventshort", 0.4) -- end @@ -43,20 +43,20 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 6050, 200, 4204, _, _, _, "geoventshort", 0.4) -- end --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty-red", 4608, 0, 4608) SpawnCEGInPositionGround("fogdirty-red", 4608, 150, 4608) SpawnCEGInPositionGround("fogdirty-red", 4608, 300, 4608) @@ -66,47 +66,46 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("smokeblack", 4608, 600, 4608) SpawnCEGInPositionGround("smokeblack", 4608, 700, 4608) SpawnCEGInPositionGround("smokeblack", 4608, 800, 4608) - + SpawnCEGInPositionGround("smokeblack", 4650, 0, 1610) SpawnCEGInPositionGround("smokeblack", 4650, 0, 1660) - + SpawnCEGInPositionGround("smokeblack", 4630, 0, 7500) SpawnCEGInPositionGround("smokeblack", 4630, 0, 7550) - end --- rare foggy cliffs + -- rare foggy cliffs -- if n%380 == 150 then - -- SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) - -- SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) - -- SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) + -- SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) + -- SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) + -- SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) -- end --- -- mistyclouds + -- -- mistyclouds -- if n%1200 == 550 then -- SpawnCEGInPositionGround("mistycloud", 9076, 150, 6829) -- end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs + -- alternate rare foggy cliffs -- if n%620 == 300 then - -- SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) - -- SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) - -- SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) + -- SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) + -- SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) + -- SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) -- end --- super rare foggy cliffs + -- super rare foggy cliffs -- if n%1000 == 400 then - -- SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) - -- SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) + -- SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) + -- SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) -- end --- fireflies + -- fireflies -- if n%1400 == 0 then -- SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) -- SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) @@ -114,10 +113,9 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("fireflies", 223, 32, 249) -- end ---lightning - if n%300 == 0 then + --lightning + if n % 300 == 0 then SpawnCEGInRandomMapPos("lightninginair", 50) --- SpawnCEGInPositionGround("lightningstrike", 50) + -- SpawnCEGInPositionGround("lightningstrike", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/generic_config_setup.lua b/luarules/configs/Atmosphereconfigs/generic_config_setup.lua index ad247d1a833..5bb1b8e1317 100644 --- a/luarules/configs/Atmosphereconfigs/generic_config_setup.lua +++ b/luarules/configs/Atmosphereconfigs/generic_config_setup.lua @@ -4,27 +4,26 @@ local math_random = math.random local mapsizex = Game.mapSizeX local mapsizez = Game.mapSizeZ -local transitionSpeed = (mapsizez/mapsizex) * 0.66 +local transitionSpeed = (mapsizez / mapsizex) * 0.66 local windmax = Game.windMax -local fullcyclelength = math.ceil(mapsizex+mapsizez)*2 -local nightlength = math.ceil(fullcyclelength*0.66) -- % of the cycle at which night begins and stays until the end of cycle +local fullcyclelength = math.ceil(mapsizex + mapsizez) * 2 +local nightlength = math.ceil(fullcyclelength * 0.66) -- % of the cycle at which night begins and stays until the end of cycle VFS.Include("luarules/configs/map_biomes.lua") local currentMapname = Game.mapName:lower() -for i = 1,#snowKeywords do - if string.find(currentMapname, snowKeywords[i]) then - snowMaps[currentMapname] = true - break - end +for i = 1, #snowKeywords do + if string.find(currentMapname, snowKeywords[i]) then + snowMaps[currentMapname] = true + break + end end if snowMaps[currentMapname] then - snowyMap = true + snowyMap = true end - local lightningsounds = { "thunder1", "thunder2", @@ -37,25 +36,25 @@ local lightningsounds = { local badweatherplanned = false if windmax < 5 then - atmospherelevelmult = 1 - badweatherchance = 0 - fireflieschance = 0 + atmospherelevelmult = 1 + badweatherchance = 0 + fireflieschance = 0 elseif windmax < 10 then - atmospherelevelmult = 1.05 - badweatherchance = 10 - fireflieschance = 25 + atmospherelevelmult = 1.05 + badweatherchance = 10 + fireflieschance = 25 elseif windmax < 15 then - atmospherelevelmult = 1.10 - badweatherchance = 20 - fireflieschance = 50 + atmospherelevelmult = 1.10 + badweatherchance = 20 + fireflieschance = 50 elseif windmax < 20 then - atmospherelevelmult = 1.15 - badweatherchance = 30 - fireflieschance = 75 + atmospherelevelmult = 1.15 + badweatherchance = 30 + fireflieschance = 75 else - atmospherelevelmult = 1.20 - badweatherchance = 50 - fireflieschance = 100 + atmospherelevelmult = 1.20 + badweatherchance = 50 + fireflieschance = 100 end -- testing stuff @@ -66,41 +65,41 @@ end local gadget = gadget ---@type Gadget function gadget:GameFrame(n) - local clock = n%fullcyclelength + local clock = n % fullcyclelength - if clock == 10 then -- new day - if math_random(0,100) < badweatherchance then - badweatherplanned = true - badweatherclockstart = math_random(1,math.floor(fullcyclelength*0.75)) - badweatherclockend = math_random(badweatherclockstart,fullcyclelength-1) - if snowyMap then - thunderstormenabled = false - else - thunderstormenabled = true - end - else - badweatherplanned = false - end - end + if clock == 10 then -- new day + if math_random(0, 100) < badweatherchance then + badweatherplanned = true + badweatherclockstart = math_random(1, math.floor(fullcyclelength * 0.75)) + badweatherclockend = math_random(badweatherclockstart, fullcyclelength - 1) + if snowyMap then + thunderstormenabled = false + else + thunderstormenabled = true + end + else + badweatherplanned = false + end + end - if badweatherplanned and clock > badweatherclockstart and clock < badweatherclockend then - if thunderstormenabled and math_random(1,30) == 1 then - SpawnCEGInRandomMapPosAvoidUnits("lightningstrike", 0, 128, lightningsounds[math_random(1,#lightningsounds)], 1) - end - if clock > nightlength then - SendToUnsynced("MapAtmosphereConfigSetSun", 0.8, transitionSpeed, 0.8, 0.8, 0.8*atmospherelevelmult) - SendToUnsynced("MapAtmosphereConfigSetFog", 0.5, 0.9, transitionSpeed*2.5, transitionSpeed*1.5) - else - SendToUnsynced("MapAtmosphereConfigSetSun", 0.9, transitionSpeed, 0.9, 0.9, 0.9) - SendToUnsynced("MapAtmosphereConfigSetFog", 0.5, 0.9, transitionSpeed*2.5, transitionSpeed*1.5) - end - else - if clock > nightlength then - SendToUnsynced("MapAtmosphereConfigSetSun", 0.9, transitionSpeed, 0.9, 0.9, 0.9*atmospherelevelmult) - SendToUnsynced("MapAtmosphereConfigSetFog", 1, 1, transitionSpeed*2.5, transitionSpeed*1.5) - else - SendToUnsynced("MapAtmosphereConfigSetSun", 1, transitionSpeed, 1, 1, 1) - SendToUnsynced("MapAtmosphereConfigSetFog", 1, 1, transitionSpeed*2.5, transitionSpeed*1.5) - end - end + if badweatherplanned and clock > badweatherclockstart and clock < badweatherclockend then + if thunderstormenabled and math_random(1, 30) == 1 then + SpawnCEGInRandomMapPosAvoidUnits("lightningstrike", 0, 128, lightningsounds[math_random(1, #lightningsounds)], 1) + end + if clock > nightlength then + SendToUnsynced("MapAtmosphereConfigSetSun", 0.8, transitionSpeed, 0.8, 0.8, 0.8 * atmospherelevelmult) + SendToUnsynced("MapAtmosphereConfigSetFog", 0.5, 0.9, transitionSpeed * 2.5, transitionSpeed * 1.5) + else + SendToUnsynced("MapAtmosphereConfigSetSun", 0.9, transitionSpeed, 0.9, 0.9, 0.9) + SendToUnsynced("MapAtmosphereConfigSetFog", 0.5, 0.9, transitionSpeed * 2.5, transitionSpeed * 1.5) + end + else + if clock > nightlength then + SendToUnsynced("MapAtmosphereConfigSetSun", 0.9, transitionSpeed, 0.9, 0.9, 0.9 * atmospherelevelmult) + SendToUnsynced("MapAtmosphereConfigSetFog", 1, 1, transitionSpeed * 2.5, transitionSpeed * 1.5) + else + SendToUnsynced("MapAtmosphereConfigSetSun", 1, transitionSpeed, 1, 1, 1) + SendToUnsynced("MapAtmosphereConfigSetFog", 1, 1, transitionSpeed * 2.5, transitionSpeed * 1.5) + end + end end diff --git a/luarules/configs/Atmosphereconfigs/koom valley 3.lua b/luarules/configs/Atmosphereconfigs/koom valley 3.lua index 50dc1cf7e20..88a08e8f7a7 100644 --- a/luarules/configs/Atmosphereconfigs/koom valley 3.lua +++ b/luarules/configs/Atmosphereconfigs/koom valley 3.lua @@ -5,16 +5,16 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%1150 == 0 then + -- SND windy locations + if n % 1150 == 0 then SpawnCEGInPositionGround("noceg", 2200, 500, 4200, _, _, _, "windy", 0.2) end - if n%1270 == 100 then + if n % 1270 == 100 then SpawnCEGInPositionGround("noceg", 10000, 600, 4000, _, _, _, "windy", 0.2) end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 5 then -- SpawnCEGInPositionGround("noceg", 6181, 200, 7267, _, _, _, "geoventshort", 0.4) -- end @@ -43,57 +43,56 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 6050, 200, 4204, _, _, _, "geoventshort", 0.4) -- end --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 6191, 32, 5656) SpawnCEGInPositionGround("fogdirty", 9123, 64, 1569) SpawnCEGInPositionGround("fogdirty", 2140, 32, 4752) end --- rare foggy cliffs - if n%380 == 150 then + -- rare foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) - end --- -- mistyclouds + -- -- mistyclouds -- if n%1200 == 550 then -- SpawnCEGInPositionGround("mistycloud", 9076, 150, 6829) -- end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) end --- fireflies + -- fireflies -- if n%1400 == 0 then -- SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) -- SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) @@ -101,9 +100,8 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("fireflies", 223, 32, 249) -- end --- pollen - if n%300 == 0 then + -- pollen + if n % 300 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/koomvalleybar.lua b/luarules/configs/Atmosphereconfigs/koomvalleybar.lua index cdd0be89d7f..4c197b90d58 100644 --- a/luarules/configs/Atmosphereconfigs/koomvalleybar.lua +++ b/luarules/configs/Atmosphereconfigs/koomvalleybar.lua @@ -5,57 +5,56 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere CEG Functions + -- ## Atmosphere CEG Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 6191, 32, 5656) SpawnCEGInPositionGround("fogdirty", 9123, 64, 1569) SpawnCEGInPositionGround("fogdirty", 2140, 32, 4752) end --- rare foggy cliffs - if n%380 == 150 then + -- rare foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty", 6139, 32, 2550) SpawnCEGInPositionGround("fogdirty", 2256, 32, 4227) SpawnCEGInPositionGround("fogdirty", 3994, 0, 7976) - end --- -- mistyclouds + -- -- mistyclouds -- if n%1200 == 550 then -- SpawnCEGInPositionGround("mistycloud", 9076, 150, 6829) -- end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 10965, 32, 4792) SpawnCEGInPositionGround("fogdirty", 10910, 16, 1254) SpawnCEGInPositionGround("fogdirty", 810, 0, 6156) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then SpawnCEGInPositionGround("fogdirty", 6022, 16, 4232) SpawnCEGInPositionGround("fogdirty", 9535, 32, 6993) end --- fireflies + -- fireflies -- if n%1400 == 0 then -- SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) -- SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) @@ -63,9 +62,8 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("fireflies", 223, 32, 249) -- end --- pollen - if n%300 == 0 then + -- pollen + if n % 300 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/lv412.lua b/luarules/configs/Atmosphereconfigs/lv412.lua index 8e93293b35b..7d6e0fff896 100644 --- a/luarules/configs/Atmosphereconfigs/lv412.lua +++ b/luarules/configs/Atmosphereconfigs/lv412.lua @@ -7,64 +7,64 @@ function gadget:GameFrame(n) -- DayNight Cycle - if n%10000 < 6600 then + if n % 10000 < 6600 then SendToUnsynced("MapAtmosphereConfigSetSun", 1, 0.5, 1) else SendToUnsynced("MapAtmosphereConfigSetSun", 0.75, 0.5, 0.75) end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- SND hive airbursts - if n%860 == 450 then + -- SND hive airbursts + if n % 860 == 450 then SpawnCEGInAreaGround("ventairburst", 1814, 0, 5628, 75, _, _, _, "ventair", 0.45) - end + end - if n%880 == 100 then + if n % 880 == 100 then SpawnCEGInAreaGround("ventairburst", 3229, 0, 6260, 60, _, _, _, "ventair", 0.46) - end + end - if n%900 == 690 then + if n % 900 == 690 then SpawnCEGInAreaGround("ventairburst", 2327, 0, 2510, 80, _, _, _, "ventair", 0.47) - end + end - if n%890 == 785 then + if n % 890 == 785 then SpawnCEGInAreaGround("ventairburst", 4083, 0, 6433, 100, _, _, _, "ventair", 0.46) end - if n%870 == 235 then + if n % 870 == 235 then SpawnCEGInAreaGround("ventairburst", 4176, 0, 2049, 225, _, _, _, "ventair", 0.45) - end + end - if n%1010 == 500 then + if n % 1010 == 500 then SpawnCEGInAreaGround("ventairburst", 5786, 0, 5602, 75, _, _, _, "ventair", 0.46) - end + end - if n%820 == 810 then + if n % 820 == 810 then SpawnCEGInAreaGround("ventairburst", 5869, 0, 6072, 125, _, _, _, "ventair", 0.47) - end + end --- SND windy locations - if n%1160 == 0 then + -- SND windy locations + if n % 1160 == 0 then --SpawnCEGInPositionGround("noceg", 3500, 700, 800, _, _, _, "windy_mountains", 0.35) SpawnCEGInRandomMapPosBelowY("noceg", 400, 300, _, _, _, "windy_mountains", 0.50) end - if n%1270 == 300 then + if n % 1270 == 300 then --SpawnCEGInPositionGround("noceg", 2500, 700, 6800, _, _, _, "windy_mountains", 0.35) SpawnCEGInRandomMapPosBelowY("noceg", 400, 300, _, _, _, "windy_mountains", 0.49) end - if n%1130 == 600 then + if n % 1130 == 600 then SpawnCEGInRandomMapPosBelowY("noceg", 400, 400, _, _, _, "windy_mountains", 0.50) end @@ -72,54 +72,53 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 9700, 600, 6560, _, _, _, "windy", 0.35) -- end --- distant thunder + -- distant thunder -if n%2000 == 0 then + if n % 2000 == 0 then SpawnCEGInRandomMapPosBelowY("noceg", 800, 400, _, _, _, "distantthunder", 0.62) end --- fireflies - if n%200 == 0 then + -- fireflies + if n % 200 == 0 then SpawnCEGInRandomMapPosBelowY("firefliespurple", 32, 200) end - if n%275 == 0 then + if n % 275 == 0 then SpawnCEGInRandomMapPosBelowY("firefliespurple", 32, 150) end - if n%320 == 0 then + if n % 320 == 0 then SpawnCEGInRandomMapPosBelowY("firefliespurple", 32, 130) end --- rare foggy cliffs - if n%750 == 0 then + -- rare foggy cliffs + if n % 750 == 0 then SpawnCEGInPositionGround("mistycloudpurplemist", 4120, 64, 6410) end - if n%800 == 450 then + if n % 800 == 450 then SpawnCEGInPositionGround("mistycloudpurplemist", 4168, 64, 2204) end - if n%800 == 650 then + if n % 800 == 650 then SpawnCEGInPositionGround("mistycloudpurplemist", 5816, 64, 5584) end - if n%800 == 750 then + if n % 800 == 750 then SpawnCEGInPositionGround("mistycloudpurplemistxl", 7695, 64, 4840) end --- super rare large foggy cliffs + -- super rare large foggy cliffs - if n%1700 == 1000 then + if n % 1700 == 1000 then SpawnCEGInPositionGround("mistycloudpurplemistxl", 7289, 10, 963) end - if n%1800 == 300 then + if n % 1800 == 300 then SpawnCEGInPositionGround("mistycloudpurplemistxl", 673, 10, 815) end - if n%1800 == 1500 then + if n % 1800 == 1500 then SpawnCEGInPositionGround("mistycloudpurplemistxl", 1599, 10, 4985) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/onyx cauldron.lua b/luarules/configs/Atmosphereconfigs/onyx cauldron.lua index 8fae3a2f669..3460b48a602 100644 --- a/luarules/configs/Atmosphereconfigs/onyx cauldron.lua +++ b/luarules/configs/Atmosphereconfigs/onyx cauldron.lua @@ -5,19 +5,19 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) - --- Use _ for damage, paralyzedamage, damageradius if you want to disable - ---foggy mountains - if n%300 == 100 then + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + + -- Use _ for damage, paralyzedamage, damageradius if you want to disable + + --foggy mountains + if n % 300 == 100 then SpawnCEGInPositionGround("fogdirty", 5, 0, 6604) SpawnCEGInPositionGround("fogdirty", 25, 32, 6789) @@ -31,7 +31,7 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty", 2173, 32, 8189) SpawnCEGInPositionGround("fogdirty", 8111, 0, 887) - SpawnCEGInPositionGround("fogdirty", 8189, 32, 773 ) + SpawnCEGInPositionGround("fogdirty", 8189, 32, 773) SpawnCEGInPositionGround("fogdirty", 2814, 0, 7504) SpawnCEGInPositionGround("fogdirty", 2773, 32, 8189) @@ -73,11 +73,10 @@ function gadget:GameFrame(n) SpawnCEGInRandomMapPosBelowY("fogdirty", 40, 500) SpawnCEGInRandomMapPosBelowY("fogdirty", 50, 500) SpawnCEGInRandomMapPosBelowY("fogdirty", 60, 500) - end + end --- random rain + -- random rain -- if n%3400 == 1600 then -- SpawnCEGInRandomMapPosBelowY("rain", 0, 250, _, _, _, "rainlight", 1) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/quicksilver remake.lua b/luarules/configs/Atmosphereconfigs/quicksilver remake.lua index 4aeeb4417b0..6dd02d2b04c 100644 --- a/luarules/configs/Atmosphereconfigs/quicksilver remake.lua +++ b/luarules/configs/Atmosphereconfigs/quicksilver remake.lua @@ -5,87 +5,86 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SND water ocean - if n%1030 == 0 then + -- SND water ocean + if n % 1030 == 0 then SpawnCEGInPositionGround("noceg", 3800, 60, 3800, _, _, _, "oceangentlesurf", 0.3) end - if n%1050 == 150 then + if n % 1050 == 150 then SpawnCEGInPositionGround("noceg", 2700, 30, 1200, _, _, _, "oceangentlesurf", 0.3) end - if n%1070 == 75 then + if n % 1070 == 75 then SpawnCEGInPositionGround("noceg", 5500, 30, 5900, _, _, _, "oceangentlesurf", 0.3) end - if n%1090 == 20 then + if n % 1090 == 20 then SpawnCEGInPositionGround("noceg", 650, 100, 6550, _, _, _, "tropicalbeach", 0.3) end - if n%1060 == 70 then + if n % 1060 == 70 then SpawnCEGInPositionGround("noceg", 600, 100, 800, _, _, _, "tropicalbeach", 0.3) end - if n%1080 == 50 then + if n % 1080 == 50 then SpawnCEGInPositionGround("noceg", 6450, 100, 800, _, _, _, "tropicalbeach", 0.3) end - if n%1100 == 90 then + if n % 1100 == 90 then SpawnCEGInPositionGround("noceg", 6700, 100, 6700, _, _, _, "tropicalbeach", 0.3) end --- SND windy locations - if n%1260 == 0 then + -- SND windy locations + if n % 1260 == 0 then SpawnCEGInPositionGround("noceg", 1300, 500, 6000, _, _, _, "windy", 0.2) end - if n%1320 == 100 then + if n % 1320 == 100 then SpawnCEGInPositionGround("noceg", 5500, 500, 1150, _, _, _, "windy", 0.2) end --- ## Atmosphere Functions --- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) --- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) + -- ## Atmosphere Functions + -- SendToUnsynced("MapAtmosphereConfigSetSun", red&green, transitionspeed, blue) + -- SendToUnsynced("MapAtmosphereConfigSetFog", targetfogstart, targetfogend, transitionspeedfogstart, transitionspeedfogend) --- DayNight Cycle + -- DayNight Cycle --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 6249, 0, 2938) SpawnCEGInPositionGround("fogdirty", 1029, 0, 3715) end --- rare foggy cliffs - if n%600 == 0 then + -- rare foggy cliffs + if n % 600 == 0 then SpawnCEGInPositionGround("fogdirty", 4270, 0, 2025) SpawnCEGInPositionGround("fogdirty", 2477, 0, 3812) SpawnCEGInPositionGround("fogdirty", 1495, 0, 5994) end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 6231, 0, 3595) SpawnCEGInPositionGround("fogdirty", 5047, 0, 5487) SpawnCEGInPositionGround("fogdirty", 2349, 0, 1752) end --- super rare foggy cliffs - if n%1100 == 0 then + -- super rare foggy cliffs + if n % 1100 == 0 then SpawnCEGInPositionGround("fogdirty", 2839, 0, 6290) SpawnCEGInPositionGround("fogdirty", 3892, 0, 1194) end --- fireflies - if n%800 == 0 then + -- fireflies + if n % 800 == 0 then SpawnCEGInPositionGround("firefliesgreen", 3576, 50, 1415) SpawnCEGInPositionGround("firefliesgreen", 3173, 50, 6021) end --- pollen - if n%150 == 0 then + -- pollen + if n % 150 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - end diff --git a/luarules/configs/Atmosphereconfigs/red comet remake.lua b/luarules/configs/Atmosphereconfigs/red comet remake.lua index 98a8ccbc5c8..8b99e82ce65 100644 --- a/luarules/configs/Atmosphereconfigs/red comet remake.lua +++ b/luarules/configs/Atmosphereconfigs/red comet remake.lua @@ -5,17 +5,16 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- random sandclouds - if n%400 == 200 then + -- random sandclouds + if n % 400 == 200 then SpawnCEGInArea("sandcloud", 3200, 235, 1900, 1500) end - + -- if n%2000 == 1000 then -- SpawnCEGInArea("sandclouddense", 3200, 235, 1900, 1900) -- end - + -- if n%6000 == 3000 then -- SpawnCEGInArea("sandclouddensexl", 3200, 235, 1900, 500) -- end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/riverdale remake.lua b/luarules/configs/Atmosphereconfigs/riverdale remake.lua index c05c8cb7f6e..5998e253fcf 100644 --- a/luarules/configs/Atmosphereconfigs/riverdale remake.lua +++ b/luarules/configs/Atmosphereconfigs/riverdale remake.lua @@ -5,65 +5,61 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) --- Use _ for damage, paralyzedamage, damageradius if you want to disable + -- Use _ for damage, paralyzedamage, damageradius if you want to disable --- common foggy cliffs - if n%540 == 0 then + -- common foggy cliffs + if n % 540 == 0 then SpawnCEGInPositionGround("fogdirty", 374, 32, 6318) --SpawnCEGInPositionGround("fogdirty", 3785, 219, 1594) SpawnCEGInPositionGround("fogdirty", 346, 32, 1550) end ---rare foggy cliffs - if n%610 == 305 then + --rare foggy cliffs + if n % 610 == 305 then SpawnCEGInPositionGround("fogdirty", 208, 32, 6630) SpawnCEGInPositionGround("fogdirty", 2919, 32, 6133) SpawnCEGInPositionGround("fogdirty", 529, 32, 9794) SpawnCEGInPositionGround("fogdirty", 5544, 32, 2730) end ---foggy canyon - if n%300 == 100 then + --foggy canyon + if n % 300 == 100 then SpawnCEGInPositionGround("fogdirty", 814, 0, 7504) SpawnCEGInPositionGround("fogdirty", 773, 32, 8189) SpawnCEGInPositionGround("fogdirty", 887, 0, 9111) - end + end ---foggy canyon alt - if n%310 == 250 then - SpawnCEGInPositionGround("fogdirty", 757, 0, 7800) + --foggy canyon alt + if n % 310 == 250 then + SpawnCEGInPositionGround("fogdirty", 757, 0, 7800) SpawnCEGInPositionGround("fogdirty", 776, 0, 8615) - end + end --- common fireflies - if n%1000 == 0 then + -- common fireflies + if n % 1000 == 0 then SpawnCEGInPositionGround("fireflies", 3110, 32, 1950) SpawnCEGInPositionGround("fireflies", 1061, 32, 3479) end --- rare fireflies - if n%1800 == 0 then + -- rare fireflies + if n % 1800 == 0 then SpawnCEGInPositionGround("firefliesgreen", 1627, 32, 4932) SpawnCEGInPositionGround("firefliesgreen", 5600, 32, 6159) SpawnCEGInPositionGround("firefliesgreen", 207, 32, 7963) SpawnCEGInPositionGround("firefliesgreen", 5540, 32, 8472) end --- random rain - if n%3400 == 1600 then + -- random rain + if n % 3400 == 1600 then SpawnCEGInRandomMapPos("rain", 0, _, _, _, "rainlight", 1) end - - - - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/seths ravine.lua b/luarules/configs/Atmosphereconfigs/seths ravine.lua index 596e34382cf..b349ddd88f9 100644 --- a/luarules/configs/Atmosphereconfigs/seths ravine.lua +++ b/luarules/configs/Atmosphereconfigs/seths ravine.lua @@ -5,75 +5,75 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- ## Atmosphere Functions --- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) --- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) - --- Use _ for damage, paralyzedamage, damageradius if you want to disable - --- SND windy locations - if n%500 == 0 then + -- ## Atmosphere Functions + -- SpawnCEGInPosition (cegname, posx, posy, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInPositionGround(cegname, posx, groundOffset, posz, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInArea(cegname, midposx, posy, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInAreaGround(cegname, midposx, groundOffset, midposz, radius, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPos(cegname, groundOffset, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosBelowY(cegname, groundOffset, spawnOnlyBelowY, damage, paralyzedamage, damageradius, sound, soundvolume) + -- SpawnCEGInRandomMapPosPresetY(cegname, posy, damage, paralyzedamage, damageradius, sound, soundvolume) + + -- Use _ for damage, paralyzedamage, damageradius if you want to disable + + -- SND windy locations + if n % 500 == 0 then SpawnCEGInRandomMapPosBelowY("noceg", 300, 75, _, _, _, "windy", 0.27) end --- low middle foggy cliffs - if n%420 == 0 then + -- low middle foggy cliffs + if n % 420 == 0 then -- SpawnCEGInPositionGround("fogdirty-brown", 4090, 100, 3116) SpawnCEGInAreaGround("fogdirty-brown", 4118, 100, 3150, 300) end --- canyon middle foggy cliffs - if n%380 == 150 then + -- canyon middle foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty-brown", 3553, 0, 3428) end - if n%390 == 160 then + if n % 390 == 160 then SpawnCEGInPositionGround("fogdirty-brown", 4551, 0, 2788) end --- -- mistyclouds - if n%21 == 0 then + -- -- mistyclouds + if n % 21 == 0 then --SpawnCEGInRandomMapPosBelowY("mistycloudbrownmistxl", 145, 50) SpawnCEGInRandomMapPosPresetY("mistycloudbrownmistxl", 145) end -local windgustsounds = { - "windgust2", - "windgust1", - "windgust3", -} + local windgustsounds = { + "windgust2", + "windgust1", + "windgust3", + } --- -- rare sanddune dust - if n%75 == 11 then - local r = math.random(1,4) + -- -- rare sanddune dust + if n % 75 == 11 then + local r = math.random(1, 4) if r == 1 then - SpawnCEGInAreaGround("dunecloud", 2940, 28, 2460, 750, _, _, _, windgustsounds[math.random(1,#windgustsounds)], 0.30) - SpawnCEGInAreaGround("dunecloud", 5180, 28, 3720, 750, _, _, _, windgustsounds[math.random(1,#windgustsounds)], 0.30) + SpawnCEGInAreaGround("dunecloud", 2940, 28, 2460, 750, _, _, _, windgustsounds[math.random(1, #windgustsounds)], 0.30) + SpawnCEGInAreaGround("dunecloud", 5180, 28, 3720, 750, _, _, _, windgustsounds[math.random(1, #windgustsounds)], 0.30) end end --- alternate rare foggy cliffs + -- alternate rare foggy cliffs -- if n%620 == 300 then -- SpawnCEGInPositionGround("fogdirty", 9585, 0, 304) -- SpawnCEGInPositionGround("fogdirty", 275, 0, 6675) -- SpawnCEGInPositionGround("fogdirty", 10163, 0, 1763) -- end --- super rare foggy cliffs - if n%1440 == 0 then + -- super rare foggy cliffs + if n % 1440 == 0 then SpawnCEGInAreaGround("firefliespurple", 3262, 20, 2400, 75, _, _, _, "magicalhum", 0.26) end - if n%1500 == 770 then + if n % 1500 == 770 then SpawnCEGInAreaGround("firefliespurple", 4988, 20, 3809, 75, _, _, _, "magicalhum", 0.26) end --- fireflies + -- fireflies -- if n%1400 == 0 then -- SpawnCEGInPositionGround("firefliesgreen", 3423, 32, 5559) -- SpawnCEGInPositionGround("firefliesgreen", 7079, 32, 4449) @@ -81,10 +81,9 @@ local windgustsounds = { -- SpawnCEGInPositionGround("fireflies", 223, 32, 249) -- end --- pollen - if n%150 == 0 then + -- pollen + if n % 150 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) - end -- if n%1270 == 100 then @@ -99,7 +98,7 @@ local windgustsounds = { -- SpawnCEGInPositionGround("noceg", 9700, 600, 6560, _, _, _, "windy", 0.35) -- end --- SND dam hum + -- SND dam hum -- if n%820 == 0 then -- SpawnCEGInPositionGround("noceg", 5115, 100, 4095, _, _, _, "humheavy", 0.7) -- end @@ -108,7 +107,7 @@ local windgustsounds = { -- SpawnCEGInPositionGround("noceg", 5115, 100, 3078, _, _, _, "humheavy", 0.7) -- end --- SND water ocean gentle + -- SND water ocean gentle -- if n%1330 == 0 then -- SpawnCEGInPositionGround("noceg", 6400, 100, 8500, _, _, _, "oceangentlesurf", 0.35) -- end @@ -121,9 +120,8 @@ local windgustsounds = { -- SpawnCEGInPositionGround("noceg", 5101, 300, 1455, _, _, _, "tropicalbeach", 0.5) -- end --- SND hive airbursts - -- if n%15 == 5 then + -- SND hive airbursts + -- if n%15 == 5 then -- SpawnCEGInRandomMapPosBelowY("ventairburst", 400, -50, _, _, _, "ventair", 0.45) - -- end - -end \ No newline at end of file + -- end +end diff --git a/luarules/configs/Atmosphereconfigs/tabula_remake.lua b/luarules/configs/Atmosphereconfigs/tabula_remake.lua index 7a36b8bccbc..84a160fe9fb 100644 --- a/luarules/configs/Atmosphereconfigs/tabula_remake.lua +++ b/luarules/configs/Atmosphereconfigs/tabula_remake.lua @@ -5,25 +5,25 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND windy locations - if n%950 == 0 then + -- SND windy locations + if n % 950 == 0 then SpawnCEGInPositionGround("noceg", 2000, 500, 2100, _, _, _, "windy", 0.2) end - if n%990 == 100 then + if n % 990 == 100 then SpawnCEGInPositionGround("noceg", 6000, 600, 4900, _, _, _, "windy", 0.2) end --- SND water ocean - if n%960 == 20 then + -- SND water ocean + if n % 960 == 20 then SpawnCEGInPositionGround("noceg", 2200, 0, 6000, _, _, _, "oceangentlesurf", 0.3) end - if n%960 == 50 then + if n % 960 == 50 then SpawnCEGInPositionGround("noceg", 6000, 0, 1100, _, _, _, "oceangentlesurf", 0.3) end --- SND geos Replaced by SFX_geovent.lua + -- SND geos Replaced by SFX_geovent.lua -- if n%120 == 0 then -- SpawnCEGInPositionGround("noceg", 4138, 200, 4972, _, _, _, "geoventshort", 0.3) -- end @@ -48,50 +48,49 @@ function gadget:GameFrame(n) -- SpawnCEGInPositionGround("noceg", 5361, 200, 224, _, _, _, "geoventshort", 0.3) -- end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 5673, 64, 2100) SpawnCEGInPositionGround("fogdirty", 2488, 64, 5117) SpawnCEGInPositionGround("fogdirty", 240, 100, 3655) end --- rare foggy cliffs - if n%380 == 150 then + -- rare foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty", 3231, 100, 5328) SpawnCEGInPositionGround("fogdirty", 1051, 100, 5485) SpawnCEGInPositionGround("fogdirty", 7940, 100, 3538) end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 6983, 0, 2452) SpawnCEGInPositionGround("fogdirty", 1580, 0, 1888) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then SpawnCEGInPositionGround("fogdirty", 6060, 400, 141) SpawnCEGInPositionGround("fogdirty", 2142, 400, 6910) end --- mistyclouds - if n%1000 == 400 then + -- mistyclouds + if n % 1000 == 400 then SpawnCEGInPositionGround("mistycloud", 5836, 500, 5343) end - if n%1100 == 200 then + if n % 1100 == 200 then SpawnCEGInPositionGround("mistycloud", 2279, 400, 1951) end --- fireflies - if n%1400 == 0 then + -- fireflies + if n % 1400 == 0 then SpawnCEGInPositionGround("fireflies", 2050, 32, 4850) SpawnCEGInPositionGround("fireflies", 6136, 32, 2334) end --- pollen - if n%500 == 0 then + -- pollen + if n % 500 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/tma20x.lua b/luarules/configs/Atmosphereconfigs/tma20x.lua index 33a85ccfb94..7e4f370abf0 100644 --- a/luarules/configs/Atmosphereconfigs/tma20x.lua +++ b/luarules/configs/Atmosphereconfigs/tma20x.lua @@ -5,8 +5,8 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 583, 0, 5978) SpawnCEGInPositionGround("fogdirty", 1183, 0, 8626) SpawnCEGInPositionGround("fogdirty", 9538, 0, 3735) @@ -17,8 +17,8 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty", 880, 0, 2916) end --- alternate common foggy cliffs - if n%360 == 180 then + -- alternate common foggy cliffs + if n % 360 == 180 then SpawnCEGInPositionGround("fogdirty", 7526, 25, 8427) SpawnCEGInPositionGround("fogdirty", 2477, 0, 3812) SpawnCEGInPositionGround("fogdirty", 6237, 0, 6953) @@ -28,20 +28,19 @@ function gadget:GameFrame(n) SpawnCEGInPositionGround("fogdirty", 2734, 75, 6912) end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 9055, 0, 2254) end --- super rare foggy cliffs - if n%1100 == 0 then + -- super rare foggy cliffs + if n % 1100 == 0 then SpawnCEGInPositionGround("fogdirty", 2839, 0, 6290) SpawnCEGInPositionGround("fogdirty", 3892, 0, 1194) end --- pollen - if n%150 == 0 then + -- pollen + if n % 150 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/Atmosphereconfigs/trefoil remake.lua b/luarules/configs/Atmosphereconfigs/trefoil remake.lua index aa239f3c011..57f30799cc1 100644 --- a/luarules/configs/Atmosphereconfigs/trefoil remake.lua +++ b/luarules/configs/Atmosphereconfigs/trefoil remake.lua @@ -5,81 +5,79 @@ function gadget:GameFrame(n) Spring.Echo("Loaded atmosphere CEGs config for map: " .. Game.mapName) end --- SND water ocean - if n%830 == 0 then + -- SND water ocean + if n % 830 == 0 then SpawnCEGInPositionGround("noceg", 4000, 0, 1200, _, _, _, "tropicalbeach", 0.9) end - if n%840 == 150 then + if n % 840 == 150 then SpawnCEGInPositionGround("noceg", 1400, 0, 5500, _, _, _, "tropicalbeach", 0.9) end - if n%850 == 75 then + if n % 850 == 75 then SpawnCEGInPositionGround("noceg", 6800, 0, 5600, _, _, _, "tropicalbeach", 0.9) end - if n%860 == 20 then + if n % 860 == 20 then SpawnCEGInPositionGround("noceg", 3200, 0, 3400, _, _, _, "oceangentlesurf", 0.9) end - if n%860 == 50 then + if n % 860 == 50 then SpawnCEGInPositionGround("noceg", 5100, 0, 1400, _, _, _, "oceangentlesurf", 0.9) end - if n%860 == 80 then + if n % 860 == 80 then SpawnCEGInPositionGround("noceg", 4130, 0, 5000, _, _, _, "oceangentlesurf", 0.9) end --- common foggy cliffs - if n%360 == 0 then + -- common foggy cliffs + if n % 360 == 0 then SpawnCEGInPositionGround("fogdirty", 1723, 0, 4129) SpawnCEGInPositionGround("fogdirty", 2967, 0, 1935) SpawnCEGInPositionGround("fogdirty", 4038, 0, 7229) end --- rare foggy cliffs - if n%380 == 150 then + -- rare foggy cliffs + if n % 380 == 150 then SpawnCEGInPositionGround("fogdirty", 2967, 0, 5905) SpawnCEGInPositionGround("fogdirty", 1158, 0, 2340) SpawnCEGInPositionGround("fogdirty", 7009, 0, 3937) - end --- -- sanddune dust --- if n%200 == 0 then --- SpawnCEGInPositionGround("dunecloud", 3940, 0, 3755) --- end + -- -- sanddune dust + -- if n%200 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 3940, 0, 3755) + -- end --- -- rare sanddune dust --- if n%450 == 0 then --- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) --- end + -- -- rare sanddune dust + -- if n%450 == 0 then + -- SpawnCEGInPositionGround("dunecloud", 4542, 0, 5326) + -- end --- alternate rare foggy cliffs - if n%620 == 300 then + -- alternate rare foggy cliffs + if n % 620 == 300 then SpawnCEGInPositionGround("fogdirty", 6983, 0, 2452) SpawnCEGInPositionGround("fogdirty", 1580, 0, 1888) SpawnCEGInPositionGround("fogdirty", 6016, 0, 1200) end --- super rare foggy cliffs - if n%1000 == 400 then + -- super rare foggy cliffs + if n % 1000 == 400 then SpawnCEGInPositionGround("fogdirty", 1125, 0, 4042) SpawnCEGInPositionGround("fogdirty", 5081, 0, 5634) SpawnCEGInPositionGround("fogdirty", 2631, 0, 6591) end --- fireflies - if n%1400 == 0 then + -- fireflies + if n % 1400 == 0 then SpawnCEGInPositionGround("firefliesgreen", 2925, 32, 6919) SpawnCEGInPositionGround("firefliesgreen", 7098, 32, 2288) SpawnCEGInPositionGround("firefliesgreen", 1186, 32, 3014) SpawnCEGInPositionGround("firefliesgreen", 4771, 32, 7017) end --- pollen - if n%150 == 0 then + -- pollen + if n % 150 == 0 then SpawnCEGInRandomMapPos("dustparticles", 50) end - -end \ No newline at end of file +end diff --git a/luarules/configs/ai_namer/armada.lua b/luarules/configs/ai_namer/armada.lua index bd0d30e230e..3cb4ba42068 100644 --- a/luarules/configs/ai_namer/armada.lua +++ b/luarules/configs/ai_namer/armada.lua @@ -1,94 +1,94 @@ local ArmadaAINames = { - "Abductor", - "Ambassador", - "Archangel", - "Aurora", - "Banshee", - "Barracuda", - "Beaver", - "Bermuda", - "Blink", - "Blitz", - "Blizzard", - "Bull", - "Butler", - "Centurion", - "Compass", - "Consul", - "Cormorant", - "Corsair", - "Crocodile", - "Crossbow", - "Cyclone", - "Dolphin", - "Dragonslayer", - "Dreadnought", - "Eel", - "Ellysaw", - "Epoch", - "Falcon", - "Fatboy", - "Ghost", - "Gorgon", - "Grim Reaper", - "Groundhog", - "Gunslinger", - "Harpoon", - "Haven", - "Highwind", - "Horizon", - "Hornet", - "Hound", - "Jaguar", - "Janus", - "Lazarus", - "Liche", - "Longbow", - "Lunkhead", - "Mace", - "Marauder", - "Mauser", - "Oracle", - "Osprey", - "Paladin", - "Pawn", - "Pincer", - "Platypus", - "Possum", - "Prophet", - "Puffin", - "Razorback", - "Recluse", - "Rocketeer", - "Roughneck", - "Rover", - "Sabre", - "Seeker", - "Serpent", - "Sharpshooter", - "Shellshocker", - "Shredder", - "Skater", - "Smuggler", - "Sprinter", - "Starlight", - "Stiletto", - "Stork", - "Stormbringer", - "Stout", - "Sweeper", - "Tick", - "Titan", - "Tsunami", - "Tumbleweed", - "Turtle", - "Umbra", - "Umbrella", - "Vanguard", - "Voyager", - "Webber", - "Welder", - "Whistler", + "Abductor", + "Ambassador", + "Archangel", + "Aurora", + "Banshee", + "Barracuda", + "Beaver", + "Bermuda", + "Blink", + "Blitz", + "Blizzard", + "Bull", + "Butler", + "Centurion", + "Compass", + "Consul", + "Cormorant", + "Corsair", + "Crocodile", + "Crossbow", + "Cyclone", + "Dolphin", + "Dragonslayer", + "Dreadnought", + "Eel", + "Ellysaw", + "Epoch", + "Falcon", + "Fatboy", + "Ghost", + "Gorgon", + "Grim Reaper", + "Groundhog", + "Gunslinger", + "Harpoon", + "Haven", + "Highwind", + "Horizon", + "Hornet", + "Hound", + "Jaguar", + "Janus", + "Lazarus", + "Liche", + "Longbow", + "Lunkhead", + "Mace", + "Marauder", + "Mauser", + "Oracle", + "Osprey", + "Paladin", + "Pawn", + "Pincer", + "Platypus", + "Possum", + "Prophet", + "Puffin", + "Razorback", + "Recluse", + "Rocketeer", + "Roughneck", + "Rover", + "Sabre", + "Seeker", + "Serpent", + "Sharpshooter", + "Shellshocker", + "Shredder", + "Skater", + "Smuggler", + "Sprinter", + "Starlight", + "Stiletto", + "Stork", + "Stormbringer", + "Stout", + "Sweeper", + "Tick", + "Titan", + "Tsunami", + "Tumbleweed", + "Turtle", + "Umbra", + "Umbrella", + "Vanguard", + "Voyager", + "Webber", + "Welder", + "Whistler", } -return ArmadaAINames \ No newline at end of file +return ArmadaAINames diff --git a/luarules/configs/ai_namer/contributors.lua b/luarules/configs/ai_namer/contributors.lua index 7b2541bf409..ece329945f2 100644 --- a/luarules/configs/ai_namer/contributors.lua +++ b/luarules/configs/ai_namer/contributors.lua @@ -1,160 +1,160 @@ local ContributorAINames = { - "ACowAdonis", - "AF", - "AidanNaut", - "AKU", - "AlexS", - "AlKo", - "Ambulatory Cortex", - "Amojini", - "ArbySquidums_UwU", - "Attean", + "ACowAdonis", + "AF", + "AidanNaut", + "AKU", + "AlexS", + "AlKo", + "Ambulatory Cortex", + "Amojini", + "ArbySquidums_UwU", + "Attean", "Aurora", - "Beherith", - "Belluu", - "bluejay", - "BONELESS DRAGON HAM", - "Borg King", - "Born2Crawl", - "BrassCode", - "Brightworks", - "Bruno da Silva", - "Calm Phill", - "Cephis", - "chesiren", - "Chirick2051", - "ChrisFloofyKitsune", - "Chronographer", - "citrine", - "CMDR*Zod", - "dakadaka", - "Damgam", - "deadlypants", - "Devious Null", - "Doo", - "drivver44", - "DrWizzard", - "duke_of_gloat", - "Encyclopedia", - "EnderRobo", - "Endorphins", - "Errrrrrr", - "Fireball", - "FireStorm", - "Flaka", - "Flameink", - "Floris", - "FlyingDuck", - "Gab", - "Gabba_Gandalf", - "gajop", - "GoogleFrog", - "Happiness", - "Harkenn", - "Hectate", - "hihoman23", - "Hobo Joe", - "hokomoko", - "Honkwaddle", - "Hornet", - "IceShotTheSheriff", - "IceXuick", - "Itanthias", - "ivand", - "Jaedrik", - "jauggy", - "Jazcash", - "Jinxer", - "jjackVII", - "Johannes", - "JonathanCrimson", - "KayZee", - "kek", - "kroIya", - "Krogoth", - "lamer", - "Lexon", - "Lonewolfdesign", - "LostDeadMan", - "lov", - "LunyAlex", - "MaDDoX", - "Marek", - "Matteo Dell'Acqua", - "Mist-e-Fire", - "Monty", - "Moose", - "Mr. Bob", - "mupersega", - "Nathan Sharples", - "neb_", - "Nightmare", - "Nihilore", - "Nikuksis", - "NortySpock", - "Odin", - "Okema", - "OPMan", - "pandaro", - "Perfi", - "Pessimistic Snake", - "Phalange", - "Pooman", - "Protar", - "PtaQ", - "Qbansky", - "Rachaelneco", - "Raghna", - "Rasoul", - "RebelNode", - "Requiem", - "resopmok", - "Rippsy", - "Robert82", - "robert the pie", - "rossco", - "Rubus", - "Russell Lucas-Nutt", - "Ryan Krause", - "saurtron", - "Scopa", - "Setokaiva", - "SethDGamre", - "Shadhunter", - "Shadowisperke", - "skynet", - "Skymirrh", - "smellymoo", - "smile", - "Snipebusher", - "sprEEEzy", - "Sprung", - "Steel", - "Stormfire", - "SuperKitowiec", - "Tarnished Knight", - "Teddy", - "TeeeeVeeeeOn", - "Teifion", - "Teppic", - "Tharsy", - "Thule", - "Tom Fyuri", - "tovernaar123", - "uBdead", - "Vache", - "varunda", - "verybadsoldier", - "Volshok", - "Watch The Fort", - "Westbjumpin", - "Whocanitbnow", - "wilkubyk", - "Xehrath", - "Yaribz", - "Zagupi", - "Zecrus", - "ZephyrSkies", + "Beherith", + "Belluu", + "bluejay", + "BONELESS DRAGON HAM", + "Borg King", + "Born2Crawl", + "BrassCode", + "Brightworks", + "Bruno da Silva", + "Calm Phill", + "Cephis", + "chesiren", + "Chirick2051", + "ChrisFloofyKitsune", + "Chronographer", + "citrine", + "CMDR*Zod", + "dakadaka", + "Damgam", + "deadlypants", + "Devious Null", + "Doo", + "drivver44", + "DrWizzard", + "duke_of_gloat", + "Encyclopedia", + "EnderRobo", + "Endorphins", + "Errrrrrr", + "Fireball", + "FireStorm", + "Flaka", + "Flameink", + "Floris", + "FlyingDuck", + "Gab", + "Gabba_Gandalf", + "gajop", + "GoogleFrog", + "Happiness", + "Harkenn", + "Hectate", + "hihoman23", + "Hobo Joe", + "hokomoko", + "Honkwaddle", + "Hornet", + "IceShotTheSheriff", + "IceXuick", + "Itanthias", + "ivand", + "Jaedrik", + "jauggy", + "Jazcash", + "Jinxer", + "jjackVII", + "Johannes", + "JonathanCrimson", + "KayZee", + "kek", + "kroIya", + "Krogoth", + "lamer", + "Lexon", + "Lonewolfdesign", + "LostDeadMan", + "lov", + "LunyAlex", + "MaDDoX", + "Marek", + "Matteo Dell'Acqua", + "Mist-e-Fire", + "Monty", + "Moose", + "Mr. Bob", + "mupersega", + "Nathan Sharples", + "neb_", + "Nightmare", + "Nihilore", + "Nikuksis", + "NortySpock", + "Odin", + "Okema", + "OPMan", + "pandaro", + "Perfi", + "Pessimistic Snake", + "Phalange", + "Pooman", + "Protar", + "PtaQ", + "Qbansky", + "Rachaelneco", + "Raghna", + "Rasoul", + "RebelNode", + "Requiem", + "resopmok", + "Rippsy", + "Robert82", + "robert the pie", + "rossco", + "Rubus", + "Russell Lucas-Nutt", + "Ryan Krause", + "saurtron", + "Scopa", + "Setokaiva", + "SethDGamre", + "Shadhunter", + "Shadowisperke", + "skynet", + "Skymirrh", + "smellymoo", + "smile", + "Snipebusher", + "sprEEEzy", + "Sprung", + "Steel", + "Stormfire", + "SuperKitowiec", + "Tarnished Knight", + "Teddy", + "TeeeeVeeeeOn", + "Teifion", + "Teppic", + "Tharsy", + "Thule", + "Tom Fyuri", + "tovernaar123", + "uBdead", + "Vache", + "varunda", + "verybadsoldier", + "Volshok", + "Watch The Fort", + "Westbjumpin", + "Whocanitbnow", + "wilkubyk", + "Xehrath", + "Yaribz", + "Zagupi", + "Zecrus", + "ZephyrSkies", } return ContributorAINames diff --git a/luarules/configs/ai_namer/cortex.lua b/luarules/configs/ai_namer/cortex.lua index d1539ad7d14..fb00d2508a6 100644 --- a/luarules/configs/ai_namer/cortex.lua +++ b/luarules/configs/ai_namer/cortex.lua @@ -1,98 +1,98 @@ local CortexAINames = { - "Aggravator", - "Alligator", - "Angler", - "Arbiter", - "Arrow Storm", - "Assist Drone", - "Atoll", - "Augur", - "Banisher", - "Bat", - "Bedbug", - "Behemoth", - "Birdeater", - "Black Hydra", - "Brute", - "Buccaneer", - "Cataphract", - "Catapult", - "Cayman", - "Commando", - "Condor", - "Cutlass", - "Dam Buster", - "Death Cavalry", - "Deceiver", - "Despot", - "Devastator", - "Dragon", - "Duck", - "Fiend", - "Finch", - "Fury", - "Garpike", - "Goon", - "Graverobber", - "Grunt", - "Hailstorm", - "Halberd", - "Hephaestus", - "Hercules", - "Herring", - "Incisor", - "Intruder", - "Janitor", - "Juggernaut", - "Karganeth", - "Kraken", - "Lamprey", - "Lasher", - "Mammoth", - "Mangonel", - "Manticore", - "Messenger", - "Monsoon", - "Muskrat", - "Negotiator", - "Nighthawk", - "Oasis", - "Obscurer", - "Omen", - "Oppressor", - "Orca", - "Overseer", - "Pathfinder", - "Phantasm", - "Poison Arrow", - "Pounder", - "Predator", - "Quaker", - "Rascal", - "Riptide", - "Saviour", - "Sheldon", - "Shiva", - "Shuriken", - "Skuttle", - "Skyhook", - "Spectre", - "Sumo", - "Supporter", - "Termite", - "Thug", - "Tiger", - "Trapper", - "Trasher", - "Tremor", - "Twitcher", - "Tzar", - "Urchin", - "Valiant", - "Wasp", - "Watcher", - "Whirlwind", - "Wolverine", + "Aggravator", + "Alligator", + "Angler", + "Arbiter", + "Arrow Storm", + "Assist Drone", + "Atoll", + "Augur", + "Banisher", + "Bat", + "Bedbug", + "Behemoth", + "Birdeater", + "Black Hydra", + "Brute", + "Buccaneer", + "Cataphract", + "Catapult", + "Cayman", + "Commando", + "Condor", + "Cutlass", + "Dam Buster", + "Death Cavalry", + "Deceiver", + "Despot", + "Devastator", + "Dragon", + "Duck", + "Fiend", + "Finch", + "Fury", + "Garpike", + "Goon", + "Graverobber", + "Grunt", + "Hailstorm", + "Halberd", + "Hephaestus", + "Hercules", + "Herring", + "Incisor", + "Intruder", + "Janitor", + "Juggernaut", + "Karganeth", + "Kraken", + "Lamprey", + "Lasher", + "Mammoth", + "Mangonel", + "Manticore", + "Messenger", + "Monsoon", + "Muskrat", + "Negotiator", + "Nighthawk", + "Oasis", + "Obscurer", + "Omen", + "Oppressor", + "Orca", + "Overseer", + "Pathfinder", + "Phantasm", + "Poison Arrow", + "Pounder", + "Predator", + "Quaker", + "Rascal", + "Riptide", + "Saviour", + "Sheldon", + "Shiva", + "Shuriken", + "Skuttle", + "Skyhook", + "Spectre", + "Sumo", + "Supporter", + "Termite", + "Thug", + "Tiger", + "Trapper", + "Trasher", + "Tremor", + "Twitcher", + "Tzar", + "Urchin", + "Valiant", + "Wasp", + "Watcher", + "Whirlwind", + "Wolverine", } -return CortexAINames \ No newline at end of file +return CortexAINames diff --git a/luarules/configs/ai_namer/donators.lua b/luarules/configs/ai_namer/donators.lua index bc7a7c5cd3c..975582be7d6 100644 --- a/luarules/configs/ai_namer/donators.lua +++ b/luarules/configs/ai_namer/donators.lua @@ -1,7 +1,7 @@ local DonatorAINames = { - -- Supporters ($40+ Donation & Personal Request) + -- Supporters ($40+ Donation & Personal Request) "Arkounay", - "AurenTheAbsolute", --2x $20 + "AurenTheAbsolute", --2x $20 "BamBamRVW", "Buzzwellman", "Chungus", @@ -10,109 +10,109 @@ local DonatorAINames = { "kalter", "MonkeyLord", "MrDeadKingz", - "[D]4RK_HUNT[E]R", - "[Master_Conquest]", - "[SMRT]Felnious", - "[SMRT]RobotRobert03", - "aeon", - "Aknaroth", - "Aldreagon", --$40 - "Anteep", --$40 - "badosu", - "Barscrewl", - "BiFuriousGeorge", - "Blickter", --$50 - "bobc7", - "BoT0x", - "Canyoudigit84", - "catraxx", - "Chrono", - "Coresample", + "[D]4RK_HUNT[E]R", + "[Master_Conquest]", + "[SMRT]Felnious", + "[SMRT]RobotRobert03", + "aeon", + "Aknaroth", + "Aldreagon", --$40 + "Anteep", --$40 + "badosu", + "Barscrewl", + "BiFuriousGeorge", + "Blickter", --$50 + "bobc7", + "BoT0x", + "Canyoudigit84", + "catraxx", + "Chrono", + "Coresample", "CorgiCommander", - "dallabill", - "danielquinn", - "Dave", - "Diana", - "DreamtBlue", - "EnJoY", - "ewang", - "FishouseMike", - "FlorisXIV", - "fluxtux", + "dallabill", + "danielquinn", + "Dave", + "Diana", + "DreamtBlue", + "EnJoY", + "ewang", + "FishouseMike", + "FlorisXIV", + "fluxtux", "frozenclaw", - "gamerangela911", - "Glass", - "greggy4485", + "gamerangela911", + "Glass", + "greggy4485", "Heally", - "Hershy", - "ISolox", - "Jaedrik", - "Jazcash", - "JimmiBoy", - "kabab", - "Kalladin", - "kaofeiwei", - "Kei", - "keithphw", - "Kelin", - "Kodiak", - "LethalSpirit", - "L0v3", - "Lightjohn", - "LoloJojo", - "LSR", - "madrussian097", - "MelKaven", - "mordante", - "MoustacheG", - "MVPete", - "nctr", - "Nexthazard", - "niftybeaks", - "Nunnsey", - "obliterator", - "OConquor", --$40 - "OmegaWolf", - "outerorbit", - "panzerjaeger", - "Poops", - "Prime_Federator", - "principal", - "PsychoPewPew", --$40 - "Requiem_TV", - "Rezol", - "Rikerss", - "Rikerss", - "Ripperjack", - "rlm", - "rous", - "Shadowisper", - "Sinbearer", - "SkyFire", - "Snowpocalypse", --$40 - "Sovgut", - "Spanker", - "Spooler", --$40 - "StarBeamDerg", --$60 - "SuperMadmax", - "sversuge", - "svrachmaninoff", - "thepanther67", - "TIMBO", - "Titan", - "TopHatButcher", - "Twardowsky", - "Unusual Emphasis", - "Willow", - "Wintergaming", - "WitchingMetal", - "Woody", - "Yavarin", - "Yeba", - "Zagupi", - "Zee1158", --$60 - "Zerpiederp", - "zGeneral", + "Hershy", + "ISolox", + "Jaedrik", + "Jazcash", + "JimmiBoy", + "kabab", + "Kalladin", + "kaofeiwei", + "Kei", + "keithphw", + "Kelin", + "Kodiak", + "LethalSpirit", + "L0v3", + "Lightjohn", + "LoloJojo", + "LSR", + "madrussian097", + "MelKaven", + "mordante", + "MoustacheG", + "MVPete", + "nctr", + "Nexthazard", + "niftybeaks", + "Nunnsey", + "obliterator", + "OConquor", --$40 + "OmegaWolf", + "outerorbit", + "panzerjaeger", + "Poops", + "Prime_Federator", + "principal", + "PsychoPewPew", --$40 + "Requiem_TV", + "Rezol", + "Rikerss", + "Rikerss", + "Ripperjack", + "rlm", + "rous", + "Shadowisper", + "Sinbearer", + "SkyFire", + "Snowpocalypse", --$40 + "Sovgut", + "Spanker", + "Spooler", --$40 + "StarBeamDerg", --$60 + "SuperMadmax", + "sversuge", + "svrachmaninoff", + "thepanther67", + "TIMBO", + "Titan", + "TopHatButcher", + "Twardowsky", + "Unusual Emphasis", + "Willow", + "Wintergaming", + "WitchingMetal", + "Woody", + "Yavarin", + "Yeba", + "Zagupi", + "Zee1158", --$60 + "Zerpiederp", + "zGeneral", "[Zoteling]", } diff --git a/luarules/configs/ai_namer/legion.lua b/luarules/configs/ai_namer/legion.lua index c16423289a9..8222b76c16e 100644 --- a/luarules/configs/ai_namer/legion.lua +++ b/luarules/configs/ai_namer/legion.lua @@ -1,84 +1,84 @@ local LegionAINames = { - "Aegis", - "Aeolus", - "Alaris", - "Alpheus", - "Amputator", - "Arquebus", - "Ballista", - "Barrage", - "Bastion", - "Belcher", - "Blindfold", - "Bombardier", - "Boreas", - "Bramble", - "Cacophony", - "Cardea", - "Centaur", - "Cetus", - "Cleaver", - "Decurion", - "Eviscerator", - "Fortifier", - "Gladiator", - "Glaucus", - "Goblin", - "Grenadier", - "Harbinger", - "Hastatus", - "Helios", - "Hive", - "Incinerator", - "Inferno", - "Infestor", - "Javelin", - "Karkinos", - "Keres", - "Legionnaire", - "Lobber", - "Lupara", - "Mantis", - "Martyr", - "Medusa", - "Mosquito", - "Mukade", - "Neptune", - "Nereus", - "Noctua", - "Nyx", - "Olympus", - "Optio", - "Perdition", - "Phalanx", - "Pharos", - "Phoenix", - "Piscator", - "Pontus", - "Portent", - "Praetorean", - "Prometheus", - "Proteus", - "Quickshot", - "Rampart", - "Rhapsis", - "Salacia", - "Sapper", - "Snapper", - "Starfall", - "Stingray", - "Strider", - "Stronghold", - "Supernova", - "Triarius", - "Triton", - "Tyrannus", - "Velite", - "Venator", - "Wheelie", - "Whisper", - "Wildfire", - "Xyston", + "Aegis", + "Aeolus", + "Alaris", + "Alpheus", + "Amputator", + "Arquebus", + "Ballista", + "Barrage", + "Bastion", + "Belcher", + "Blindfold", + "Bombardier", + "Boreas", + "Bramble", + "Cacophony", + "Cardea", + "Centaur", + "Cetus", + "Cleaver", + "Decurion", + "Eviscerator", + "Fortifier", + "Gladiator", + "Glaucus", + "Goblin", + "Grenadier", + "Harbinger", + "Hastatus", + "Helios", + "Hive", + "Incinerator", + "Inferno", + "Infestor", + "Javelin", + "Karkinos", + "Keres", + "Legionnaire", + "Lobber", + "Lupara", + "Mantis", + "Martyr", + "Medusa", + "Mosquito", + "Mukade", + "Neptune", + "Nereus", + "Noctua", + "Nyx", + "Olympus", + "Optio", + "Perdition", + "Phalanx", + "Pharos", + "Phoenix", + "Piscator", + "Pontus", + "Portent", + "Praetorean", + "Prometheus", + "Proteus", + "Quickshot", + "Rampart", + "Rhapsis", + "Salacia", + "Sapper", + "Snapper", + "Starfall", + "Stingray", + "Strider", + "Stronghold", + "Supernova", + "Triarius", + "Triton", + "Tyrannus", + "Velite", + "Venator", + "Wheelie", + "Whisper", + "Wildfire", + "Xyston", } -return LegionAINames \ No newline at end of file +return LegionAINames diff --git a/luarules/configs/ai_namer/random.lua b/luarules/configs/ai_namer/random.lua index 9aec6a6e6b4..440114c3e5a 100644 --- a/luarules/configs/ai_namer/random.lua +++ b/luarules/configs/ai_namer/random.lua @@ -1,17 +1,17 @@ RandomAINames = { -- This needs a revamp lol - "Chris", - "Crewmate", - "HiMom", - "Human", - "Impostor", - "NotAI", - "NotARobot", - "OTAPlayer", - "QWERTY123", - "Realplayer", - "SupCom", - "Taylor", - "password", + "Chris", + "Crewmate", + "HiMom", + "Human", + "Impostor", + "NotAI", + "NotARobot", + "OTAPlayer", + "QWERTY123", + "Realplayer", + "SupCom", + "Taylor", + "password", } -return RandomAINames \ No newline at end of file +return RandomAINames diff --git a/luarules/configs/collisionvolumes.lua b/luarules/configs/collisionvolumes.lua index 0c37d55fbe4..264c1147352 100644 --- a/luarules/configs/collisionvolumes.lua +++ b/luarules/configs/collisionvolumes.lua @@ -75,136 +75,136 @@ Spring.SetUnitPieceCollisionVolumeData ( number unitID, number pieceIndex, boole Q: The unit always has on/off volume and it never changes A: You need to edit the unit script and set ARMORED status to on or off depending on the unit's on/off status, unarmored for on and armored for off -]]-- +]] +-- ---Collision volume definitions, ones entered here are for TA, for other mods modify apropriatly -local unitCollisionVolume = {} --dynamic collision volume definitions -local pieceCollisionVolume = {} --per piece collision volume definitions -local dynamicPieceCollisionVolume = {} --dynamic per piece collision volume definitions +--Collision volume definitions, ones entered here are for TA, for other mods modify apropriatly +local unitCollisionVolume = {} --dynamic collision volume definitions +local pieceCollisionVolume = {} --per piece collision volume definitions +local dynamicPieceCollisionVolume = {} --dynamic per piece collision volume definitions -- number of times this table had to be touched since 2022 ~45 -- increase this number eachtime this table gets touched -dynamicPieceCollisionVolume['cormaw'] = { - on={ - ['0']={32,70,32,0,5,0,1,1,1}, - ['offsets']={0,27,0}, - }, - off={ - ['0']={32,22,32,0,10,0,1,1,1}, - ['offsets']={0,0,0}, - } -} -dynamicPieceCollisionVolume['armclaw'] = { - on={ - ['0']={32,85,32,0,5,0,1,1,1}, - ['offsets']={0,30,0}, - }, - off={ - ['0']={32,22,32,0,10,0,1,1,1}, - ['offsets']={0,0,0}, - } -} -dynamicPieceCollisionVolume['legdtr'] = { - on={ - ['0']={32,90,32,0,5,0,1,1,1}, - ['offsets']={0,45,0}, - }, - off={ - ['0']={32,22,32,0,11,0,1,1,1}, - ['offsets']={0,0,0}, - } -} -dynamicPieceCollisionVolume['armannit3'] = { - on={ - ['1']={96,140,96,0,5,0,2,1,0}, - }, - off={ - ['0']={96,80,96,0,10,0,2,1,0}, - } -} -dynamicPieceCollisionVolume['cordoomt3'] = { - on={ - ['1']={112,180,112,0,5,0,1,1,0}, - }, - off={ - ['0']={96,80,96,0,10,0,2,1,0}, - } -} -dynamicPieceCollisionVolume['leganavybattleship'] = { +dynamicPieceCollisionVolume["cormaw"] = { on = { - ['1'] = { 48, 48, 120, 0, 8, -58, 1, 2 }, + ["0"] = { 32, 70, 32, 0, 5, 0, 1, 1, 1 }, + ["offsets"] = { 0, 27, 0 }, + }, + off = { + ["0"] = { 32, 22, 32, 0, 10, 0, 1, 1, 1 }, + ["offsets"] = { 0, 0, 0 }, + }, +} +dynamicPieceCollisionVolume["armclaw"] = { + on = { + ["0"] = { 32, 85, 32, 0, 5, 0, 1, 1, 1 }, + ["offsets"] = { 0, 30, 0 }, + }, + off = { + ["0"] = { 32, 22, 32, 0, 10, 0, 1, 1, 1 }, + ["offsets"] = { 0, 0, 0 }, + }, +} +dynamicPieceCollisionVolume["legdtr"] = { + on = { + ["0"] = { 32, 90, 32, 0, 5, 0, 1, 1, 1 }, + ["offsets"] = { 0, 45, 0 }, + }, + off = { + ["0"] = { 32, 22, 32, 0, 11, 0, 1, 1, 1 }, + ["offsets"] = { 0, 0, 0 }, + }, +} +dynamicPieceCollisionVolume["armannit3"] = { + on = { + ["1"] = { 96, 140, 96, 0, 5, 0, 2, 1, 0 }, + }, + off = { + ["0"] = { 96, 80, 96, 0, 10, 0, 2, 1, 0 }, + }, +} +dynamicPieceCollisionVolume["cordoomt3"] = { + on = { + ["1"] = { 112, 180, 112, 0, 5, 0, 1, 1, 0 }, + }, + off = { + ["0"] = { 96, 80, 96, 0, 10, 0, 2, 1, 0 }, + }, +} +dynamicPieceCollisionVolume["leganavybattleship"] = { + on = { + ["1"] = { 48, 48, 120, 0, 8, -58, 1, 2 }, offsets = { 0, 30, 0 }, }, off = { - ['1'] = { 48, 48, 120, 0, 8, -58, 1, 2 }, + ["1"] = { 48, 48, 120, 0, 8, -58, 1, 2 }, offsets = { 0, 0, 0 }, }, } -dynamicPieceCollisionVolume['legacluster'] = { +dynamicPieceCollisionVolume["legacluster"] = { on = { - ['0'] = { 47, 56, 47, 0, 0, 0, 1, 1 }, + ["0"] = { 47, 56, 47, 0, 0, 0, 1, 1 }, offsets = { 0, 18, 0 }, }, off = { - ['0'] = { 47, 20, 47, 0, 0, 0, 1, 1 }, + ["0"] = { 47, 20, 47, 0, 0, 0, 1, 1 }, offsets = { 0, 0, 0 }, }, } -dynamicPieceCollisionVolume['legapopupdef'] = { +dynamicPieceCollisionVolume["legapopupdef"] = { on = { - ['0'] = { 35, 68, 35, 0, 0, 0, 1, 1 }, + ["0"] = { 35, 68, 35, 0, 0, 0, 1, 1 }, offsets = { 0, 18, 0 }, }, off = { - ['0'] = { 42, 42, 42, 0, 0, 0, 3, 1 }, + ["0"] = { 42, 42, 42, 0, 0, 0, 3, 1 }, offsets = { 0, 10, 0 }, }, } -unitCollisionVolume['armanni'] = { - on={54,81,54,0,-2,0,2,1,0}, - off={54,56,54,0,-15,0,2,1,0}, +unitCollisionVolume["armanni"] = { + on = { 54, 81, 54, 0, -2, 0, 2, 1, 0 }, + off = { 54, 56, 54, 0, -15, 0, 2, 1, 0 }, } -unitCollisionVolume['armlab'] = { - on={95,28,95,0,2,0,2,1,0}, - off={95,22,95,0,-1,0,1,1,1}, +unitCollisionVolume["armlab"] = { + on = { 95, 28, 95, 0, 2, 0, 2, 1, 0 }, + off = { 95, 22, 95, 0, -1, 0, 1, 1, 1 }, } -unitCollisionVolume['armpb'] = { - on={32,88,32,0,-8,0,1,1,1}, - off={40,40,40,0,-8,0,3,1,1}, +unitCollisionVolume["armpb"] = { + on = { 32, 88, 32, 0, -8, 0, 1, 1, 1 }, + off = { 40, 40, 40, 0, -8, 0, 3, 1, 1 }, } -unitCollisionVolume['armplat'] = { - on={96,66,96,0,33,0,1,1,1}, - off={96,44,96,0,0,0,1,1,1}, +unitCollisionVolume["armplat"] = { + on = { 96, 66, 96, 0, 33, 0, 1, 1, 1 }, + off = { 96, 44, 96, 0, 0, 0, 1, 1, 1 }, } -unitCollisionVolume['armsolar'] = { - on={73,76,73,0,-18,1,0,1,0}, - off={50,76,50,0,-18,1,0,1,0}, +unitCollisionVolume["armsolar"] = { + on = { 73, 76, 73, 0, -18, 1, 0, 1, 0 }, + off = { 50, 76, 50, 0, -18, 1, 0, 1, 0 }, } -unitCollisionVolume['armvp'] = { - on={96,34,96,0,0,0,2,1,0}, - off={96,34,96,0,0,0,2,1,0}, +unitCollisionVolume["armvp"] = { + on = { 96, 34, 96, 0, 0, 0, 2, 1, 0 }, + off = { 96, 34, 96, 0, 0, 0, 2, 1, 0 }, } -unitCollisionVolume['cordoom'] = { - on={63,112,63,0,0,0,1,1,1}, - off={45,87,45,0,-12,0,2,1,0}, +unitCollisionVolume["cordoom"] = { + on = { 63, 112, 63, 0, 0, 0, 1, 1, 1 }, + off = { 45, 87, 45, 0, -12, 0, 2, 1, 0 }, } -unitCollisionVolume['corplat'] = { - on={96,60,96,0,28,0,1,1,1}, - off={96,42,96,0,-20,0,1,1,1}, +unitCollisionVolume["corplat"] = { + on = { 96, 60, 96, 0, 28, 0, 1, 1, 1 }, + off = { 96, 42, 96, 0, -20, 0, 1, 1, 1 }, } -unitCollisionVolume['legsplab'] = { - on={96,76,96,0,24,0,1,1,1}, - off={96,46,96,0,-12,0,1,1,1}, +unitCollisionVolume["legsplab"] = { + on = { 96, 76, 96, 0, 24, 0, 1, 1, 1 }, + off = { 96, 46, 96, 0, -12, 0, 1, 1, 1 }, } -unitCollisionVolume['legsolar'] = { +unitCollisionVolume["legsolar"] = { - on={70,70,70,0,-12,1,0,1,0}, - - off={40,76,40,0,-10,1,0,1,0}, + on = { 70, 70, 70, 0, -12, 1, 0, 1, 0 }, + off = { 40, 76, 40, 0, -10, 1, 0, 1, 0 }, } for name, v in pairs(unitCollisionVolume) do @@ -215,249 +215,245 @@ for name, v in pairs(unitCollisionVolume) do end end - - -pieceCollisionVolume['corhrk'] = { - ['2']={35,40,30,0,-8,0,2,1}, - -} -pieceCollisionVolume['legpede'] = { - ['0']={26,28,90,0,5,-23,2,1}, - ['32']={26,28,86,0,0,7,2,1}, -} -pieceCollisionVolume['legelrpcmech'] = { - ['0']={48,48,80, 0,-10,0, 2,0}, - ['10']={24,36,24, -4,-6,1, 1,1}, - ['22']={24,36,24, -2,2,1, 1,1}, - ['15']={28,36,28, -8,-6,2, 1,1}, - ['28']={28,36,28, 6,-6,2, 1,1}, - ['29']={28,20,40, 0,2,0, 2,0}, -} -pieceCollisionVolume['legrail'] = { - ['2']={29,20,34,-0.5,-4,-4,2,1}, - ['5']={10,10,36,0,0,9,1,2}, -} -pieceCollisionVolume['legsrail'] = { - ['0']={55,24,55,0,12,0,1,1}, - ['7']={12,12,60,0,3,9,1,2}, -} -pieceCollisionVolume['leghelios'] = { - ['0']={30,11,25, 0,-4,1, 2,0}, - ['2']={16,10,18, 0,3.5,2, 2,0}, -} -pieceCollisionVolume['leggat'] = { - ['0']={33,12,43, 0,0,2, 2,1}, - ['5']={20,20,20, 0,2,0, 3,0}, -} -pieceCollisionVolume['legaskirmtank'] = { - ['0']={40,20,42, 0,-2,-1, 0,2}, - ['1']={37,8,31, 0,0,6, 2,1}, - ['2']={24,24,24, 0,0,0, 3,1}, -} -pieceCollisionVolume['legamcluster'] = { - ['0']={37,16,50, 0,0,0, 2,1}, - ['2']={16,12,24, 0,7.5,-2, 2,1}, -} -pieceCollisionVolume['legaheattank'] = { - ['0']={46,17,56, 0,0,0, 2,1}, - ['2']={20,20,27, 0,0,0, 2,1}, -} -pieceCollisionVolume['legerailtank'] = { - ['0']={65,20,75, 0,-4,0, 2,1}, - ['4']={31,21,36, 0,0,0, 2,1}, +pieceCollisionVolume["corhrk"] = { + ["2"] = { 35, 40, 30, 0, -8, 0, 2, 1 }, +} +pieceCollisionVolume["legpede"] = { + ["0"] = { 26, 28, 90, 0, 5, -23, 2, 1 }, + ["32"] = { 26, 28, 86, 0, 0, 7, 2, 1 }, +} +pieceCollisionVolume["legelrpcmech"] = { + ["0"] = { 48, 48, 80, 0, -10, 0, 2, 0 }, + ["10"] = { 24, 36, 24, -4, -6, 1, 1, 1 }, + ["22"] = { 24, 36, 24, -2, 2, 1, 1, 1 }, + ["15"] = { 28, 36, 28, -8, -6, 2, 1, 1 }, + ["28"] = { 28, 36, 28, 6, -6, 2, 1, 1 }, + ["29"] = { 28, 20, 40, 0, 2, 0, 2, 0 }, +} +pieceCollisionVolume["legrail"] = { + ["2"] = { 29, 20, 34, -0.5, -4, -4, 2, 1 }, + ["5"] = { 10, 10, 36, 0, 0, 9, 1, 2 }, +} +pieceCollisionVolume["legsrail"] = { + ["0"] = { 55, 24, 55, 0, 12, 0, 1, 1 }, + ["7"] = { 12, 12, 60, 0, 3, 9, 1, 2 }, +} +pieceCollisionVolume["leghelios"] = { + ["0"] = { 30, 11, 25, 0, -4, 1, 2, 0 }, + ["2"] = { 16, 10, 18, 0, 3.5, 2, 2, 0 }, +} +pieceCollisionVolume["leggat"] = { + ["0"] = { 33, 12, 43, 0, 0, 2, 2, 1 }, + ["5"] = { 20, 20, 20, 0, 2, 0, 3, 0 }, +} +pieceCollisionVolume["legaskirmtank"] = { + ["0"] = { 40, 20, 42, 0, -2, -1, 0, 2 }, + ["1"] = { 37, 8, 31, 0, 0, 6, 2, 1 }, + ["2"] = { 24, 24, 24, 0, 0, 0, 3, 1 }, +} +pieceCollisionVolume["legamcluster"] = { + ["0"] = { 37, 16, 50, 0, 0, 0, 2, 1 }, + ["2"] = { 16, 12, 24, 0, 7.5, -2, 2, 1 }, +} +pieceCollisionVolume["legaheattank"] = { + ["0"] = { 46, 17, 56, 0, 0, 0, 2, 1 }, + ["2"] = { 20, 20, 27, 0, 0, 0, 2, 1 }, +} +pieceCollisionVolume["legerailtank"] = { + ["0"] = { 65, 20, 75, 0, -4, 0, 2, 1 }, + ["4"] = { 31, 21, 36, 0, 0, 0, 2, 1 }, --['10']={50,50,50,0,0,0,2,1}, } -pieceCollisionVolume['leginf'] = { - ['1']={28,20,76, 0,24,14, 2,1}, - ['0']={35,20,80, 0,8,16, 2,1}, +pieceCollisionVolume["leginf"] = { + ["1"] = { 28, 20, 76, 0, 24, 14, 2, 1 }, + ["0"] = { 35, 20, 80, 0, 8, 16, 2, 1 }, } -pieceCollisionVolume['legbastion'] = { - ['0']={80,32,80, 0,15,0, 2,0}, - ['2']={48,90,48, 0,30,0, 2,0}, - ['10']={36,45,36, 0,-8,0, 1,1}, +pieceCollisionVolume["legbastion"] = { + ["0"] = { 80, 32, 80, 0, 15, 0, 2, 0 }, + ["2"] = { 48, 90, 48, 0, 30, 0, 2, 0 }, + ["10"] = { 36, 45, 36, 0, -8, 0, 1, 1 }, } ---pieceCollisionVolume['legsrailt4'] = { --- ['0']={121,53,121,0,26,0,2,2}, --- ['7']={26,26,132,0,7,20,2,4}, ---} -pieceCollisionVolume['armrad'] = { - ['1']={22,58,22,0,0,0,1,1}, - ['3']={60,13,13,11,0,0,1,0}, +pieceCollisionVolume["armrad"] = { + ["1"] = { 22, 58, 22, 0, 0, 0, 1, 1 }, + ["3"] = { 60, 13, 13, 11, 0, 0, 1, 0 }, } -pieceCollisionVolume['armamb'] = { - ['3']={22,22,22,0,0,-10,1,1}, - ['0']={60,30,15,0,0,0,1,1,0}, +pieceCollisionVolume["armamb"] = { + ["3"] = { 22, 22, 22, 0, 0, -10, 1, 1 }, + ["0"] = { 60, 30, 15, 0, 0, 0, 1, 1, 0 }, } -pieceCollisionVolume['cortoast'] = { - ['3']={22,22,22,0,10,0,1,1}, - ['0']={60,30,15,0,0,0,1,1,0}, +pieceCollisionVolume["cortoast"] = { + ["3"] = { 22, 22, 22, 0, 10, 0, 1, 1 }, + ["0"] = { 60, 30, 15, 0, 0, 0, 1, 1, 0 }, } -pieceCollisionVolume['armbrtha'] = { - ['1']={32,84,32,0,-20,0,1,1}, - ['3']={13,0,75,0,0,20,1,2}, +pieceCollisionVolume["armbrtha"] = { + ["1"] = { 32, 84, 32, 0, -20, 0, 1, 1 }, + ["3"] = { 13, 0, 75, 0, 0, 20, 1, 2 }, } -pieceCollisionVolume['corint'] = { - ['1']={72,84,72,0,28,0,1,1}, - ['3']={13,13,34,0,1,28,1,2}, +pieceCollisionVolume["corint"] = { + ["1"] = { 72, 84, 72, 0, 28, 0, 1, 1 }, + ["3"] = { 13, 13, 34, 0, 1, 28, 1, 2 }, } -pieceCollisionVolume['armvulc'] = { - ['0']={98,140,98,0,40,0,1,1}, - ['5']={55,55,174,0,18,0,1,2}, +pieceCollisionVolume["armvulc"] = { + ["0"] = { 98, 140, 98, 0, 40, 0, 1, 1 }, + ["5"] = { 55, 55, 174, 0, 18, 0, 1, 2 }, } -pieceCollisionVolume['corgator'] = { - ['0']={23,14,33,0,0,0,2,1}, - ['3']={15,5,25,0,0,2,2,1}, +pieceCollisionVolume["corgator"] = { + ["0"] = { 23, 14, 33, 0, 0, 0, 2, 1 }, + ["3"] = { 15, 5, 25, 0, 0, 2, 2, 1 }, } -pieceCollisionVolume['corsala'] = { - ['0']={34,20,34,0,3.5,0,2,1}, - ['1']={13.5,6.2,17,0,1.875,1.5,2,1}, +pieceCollisionVolume["corsala"] = { + ["0"] = { 34, 20, 34, 0, 3.5, 0, 2, 1 }, + ["1"] = { 13.5, 6.2, 17, 0, 1.875, 1.5, 2, 1 }, } -pieceCollisionVolume['cortermite'] = { - ['3']={22,10,22,0,2,0,1,1}, - ['1']={48,25,48,0,0,0,1,1,0}, +pieceCollisionVolume["cortermite"] = { + ["3"] = { 22, 10, 22, 0, 2, 0, 1, 1 }, + ["1"] = { 48, 25, 48, 0, 0, 0, 1, 1, 0 }, } - -pieceCollisionVolume['correap'] = { - ['1']={35,20,46,0,1,0,2,1}, - ['9']={19,14,20,0,2,0,2,1}, +pieceCollisionVolume["correap"] = { + ["1"] = { 35, 20, 46, 0, 1, 0, 2, 1 }, + ["9"] = { 19, 14, 20, 0, 2, 0, 2, 1 }, } -pieceCollisionVolume['corlevlr'] = { - ['0']={31,17,31,0,3.5,0,2,1}, - ['1']={16,10,15,0,1.875,1.5,2,1}, +pieceCollisionVolume["corlevlr"] = { + ["0"] = { 31, 17, 31, 0, 3.5, 0, 2, 1 }, + ["1"] = { 16, 10, 15, 0, 1.875, 1.5, 2, 1 }, } -pieceCollisionVolume['corraid'] = { - ['0']={33,18,39,0,3.5,0,2,1}, - ['4']={16,7,15,0,0,1,2,1}, +pieceCollisionVolume["corraid"] = { + ["0"] = { 33, 18, 39, 0, 3.5, 0, 2, 1 }, + ["4"] = { 16, 7, 15, 0, 0, 1, 2, 1 }, } -pieceCollisionVolume['cormist'] = { - ['0']={34,18,43,0,3.5,0,2,1}, - ['1']={20,28,24,0,0,1.5,2,1}, +pieceCollisionVolume["cormist"] = { + ["0"] = { 34, 18, 43, 0, 3.5, 0, 2, 1 }, + ["1"] = { 20, 28, 24, 0, 0, 1.5, 2, 1 }, } -pieceCollisionVolume['corgarp'] = { - ['0']={30,21,42,0,0,6,2,1}, - ['6']={16,7,15,0,-2,1.5,2,1}, +pieceCollisionVolume["corgarp"] = { + ["0"] = { 30, 21, 42, 0, 0, 6, 2, 1 }, + ["6"] = { 16, 7, 15, 0, -2, 1.5, 2, 1 }, } -pieceCollisionVolume['armstump'] = { - ['0']={34,18,40,0,-5,0,2,1}, - ['18']={17,16,16,1,0,0,2,1}, +pieceCollisionVolume["armstump"] = { + ["0"] = { 34, 18, 40, 0, -5, 0, 2, 1 }, + ["18"] = { 17, 16, 16, 1, 0, 0, 2, 1 }, } -pieceCollisionVolume['armsam'] = { - ['0']={26,26,43,0,0,-2,2,1}, - ['8']={16,16,20,0,0,0,2,1}, +pieceCollisionVolume["armsam"] = { + ["0"] = { 26, 26, 43, 0, 0, -2, 2, 1 }, + ["8"] = { 16, 16, 20, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armpincer'] = { - ['0']={31,13,31,0,5,0,2,1}, - ['1']={16,12,20,0,0,0,2,1}, +pieceCollisionVolume["armpincer"] = { + ["0"] = { 31, 13, 31, 0, 5, 0, 2, 1 }, + ["1"] = { 16, 12, 20, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armjanus'] = { - ['0']={26,12,35,0,0,0,2,1}, - ['1']={20,10,20,0,0,0,2,1}, +pieceCollisionVolume["armjanus"] = { + ["0"] = { 26, 12, 35, 0, 0, 0, 2, 1 }, + ["1"] = { 20, 10, 20, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armanac'] = { - ['0']={40,19,40,0,4,0,1,1}, - ['3']={16,10,16,0,5,0,2,1}, +pieceCollisionVolume["armanac"] = { + ["0"] = { 40, 19, 40, 0, 4, 0, 1, 1 }, + ["3"] = { 16, 10, 16, 0, 5, 0, 2, 1 }, } -pieceCollisionVolume['corah'] = { - ['0']={28,16,35,0,5,0,2,1}, - ['2']={10,20,10,0,0,0,2,1}, +pieceCollisionVolume["corah"] = { + ["0"] = { 28, 16, 35, 0, 5, 0, 2, 1 }, + ["2"] = { 10, 20, 10, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['corhal'] = { - ['0']={42,12,42,0,0,0,2,1}, - ['1']={14,10,14,0,0,0,2,1}, +pieceCollisionVolume["corhal"] = { + ["0"] = { 42, 12, 42, 0, 0, 0, 2, 1 }, + ["1"] = { 14, 10, 14, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['corsnap'] = { - ['0']={32,16,38,0,4,0,2,1}, - ['3']={12,10,12,0,0,0,2,1}, +pieceCollisionVolume["corsnap"] = { + ["0"] = { 32, 16, 38, 0, 4, 0, 2, 1 }, + ["3"] = { 12, 10, 12, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['corsumo'] = { - ['0']={42,32,45,0,0,0,2,1}, - ['2']={22,10,22,0,0,0,1,1}, +pieceCollisionVolume["corsumo"] = { + ["0"] = { 42, 32, 45, 0, 0, 0, 2, 1 }, + ["2"] = { 22, 10, 22, 0, 0, 0, 1, 1 }, } -pieceCollisionVolume['armfboy'] = { - ['0']={34,40,42,0,-5,0,2,1}, - ['8']={16,16,16,0,0,0,2,1}, +pieceCollisionVolume["armfboy"] = { + ["0"] = { 34, 40, 42, 0, -5, 0, 2, 1 }, + ["8"] = { 16, 16, 16, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armfido'] = { - ['1']={26,32,34,0,-10,10,2,1}, - ['15']={12,30,12,0,0,0,2,1}, +pieceCollisionVolume["armfido"] = { + ["1"] = { 26, 32, 34, 0, -10, 10, 2, 1 }, + ["15"] = { 12, 30, 12, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['corgol'] = { - ['0']={48,44,56,0,0,0,2,1}, - ['3']={24,24,24,0,0,0,2,1}, +pieceCollisionVolume["corgol"] = { + ["0"] = { 48, 44, 56, 0, 0, 0, 2, 1 }, + ["3"] = { 24, 24, 24, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['cortrem'] = { - ['0']={40,32,44,0,0,0,2,1}, - ['1']={24,64,24,0,0,0,2,1}, +pieceCollisionVolume["cortrem"] = { + ["0"] = { 40, 32, 44, 0, 0, 0, 2, 1 }, + ["1"] = { 24, 64, 24, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['seal'] = { - ['0']={28,25,34,0,0,0,2,1}, - ['1']={12,16,12,0,0,0,2,1}, +pieceCollisionVolume["seal"] = { + ["0"] = { 28, 25, 34, 0, 0, 0, 2, 1 }, + ["1"] = { 12, 16, 12, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['corban'] = { - ['0']={44,32,44,0,0,0,2,1}, - ['3']={24,16,24,0,8,0,2,1}, +pieceCollisionVolume["corban"] = { + ["0"] = { 44, 32, 44, 0, 0, 0, 2, 1 }, + ["3"] = { 24, 16, 24, 0, 8, 0, 2, 1 }, } -pieceCollisionVolume['cormart'] = { - ['0']={30,28,34,0,0,0,2,1}, - ['5']={12,25,12,0,2,0,2,1}, +pieceCollisionVolume["cormart"] = { + ["0"] = { 30, 28, 34, 0, 0, 0, 2, 1 }, + ["5"] = { 12, 25, 12, 0, 2, 0, 2, 1 }, } -pieceCollisionVolume['armmart'] = { - ['0']={44,24,50,0,0,0,2,1}, - ['1']={16,32,16,0,0,0,2,1}, +pieceCollisionVolume["armmart"] = { + ["0"] = { 44, 24, 50, 0, 0, 0, 2, 1 }, + ["1"] = { 16, 32, 16, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armbull'] = { - ['0']={44,23,52,0,5,0,2,1}, - ['4']={24,18,24,0,0,0,2,1}, +pieceCollisionVolume["armbull"] = { + ["0"] = { 44, 23, 52, 0, 5, 0, 2, 1 }, + ["4"] = { 24, 18, 24, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armlatnk'] = { - ['0']={30,26,34,0,0,0,2,1}, - ['5']={16,16,16,0,0,0,2,1}, +pieceCollisionVolume["armlatnk"] = { + ["0"] = { 30, 26, 34, 0, 0, 0, 2, 1 }, + ["5"] = { 16, 16, 16, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armmanni'] = { - ['0']={48,34,38,0,10,0,2,1}, - ['1']={24,52,24,0,0,0,2,1}, +pieceCollisionVolume["armmanni"] = { + ["0"] = { 48, 34, 38, 0, 10, 0, 2, 1 }, + ["1"] = { 24, 52, 24, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['armthor'] = { - ['0']={80,25,80,0,10,0,2,1}, - ['15']={55,25,40,0,0,0,2,1}, +pieceCollisionVolume["armthor"] = { + ["0"] = { 80, 25, 80, 0, 10, 0, 2, 1 }, + ["15"] = { 55, 25, 40, 0, 0, 0, 2, 1 }, } -pieceCollisionVolume['legfloat'] = { - ['0']={40,18,50,0,-1.5,0,2,1}, - ['8']={18,9,30,0,1,-5,2,1}, +pieceCollisionVolume["legfloat"] = { + ["0"] = { 40, 18, 50, 0, -1.5, 0, 2, 1 }, + ["8"] = { 18, 9, 30, 0, 1, -5, 2, 1 }, } -pieceCollisionVolume['legnavyfrigate'] = { - ['0']={30,18,52,-1,-4,1,1,1}, - ['3']={11,13,20,0,5,0,2,1}, +pieceCollisionVolume["legnavyfrigate"] = { + ["0"] = { 30, 18, 52, -1, -4, 1, 1, 1 }, + ["3"] = { 11, 13, 20, 0, 5, 0, 2, 1 }, } -pieceCollisionVolume['legcar'] = { - ['0']={34,16,46,0,-2.5,1,2,1}, - ['4']={14,12,20,0,-2,-6,2,1}, +pieceCollisionVolume["legcar"] = { + ["0"] = { 34, 16, 46, 0, -2.5, 1, 2, 1 }, + ["4"] = { 14, 12, 20, 0, -2, -6, 2, 1 }, } -pieceCollisionVolume['legmed'] = { - ['0']={48,31,69,0,0,0,2,1}, - ['1']={7,35,15,0,40,-5,2,1}, +pieceCollisionVolume["legmed"] = { + ["0"] = { 48, 31, 69, 0, 0, 0, 2, 1 }, + ["1"] = { 7, 35, 15, 0, 40, -5, 2, 1 }, } -pieceCollisionVolume['legehovertank'] = { - ['0']={63,32,63,0,-15,0,1,1}, - ['20']={25,12,37,0,0,-6,2,1}, +pieceCollisionVolume["legehovertank"] = { + ["0"] = { 63, 32, 63, 0, -15, 0, 1, 1 }, + ["20"] = { 25, 12, 37, 0, 0, -6, 2, 1 }, } -pieceCollisionVolume['corsiegebreaker'] = { - ['0']={36,18,64,0,4,8,2,2}, - ['1']={19,12,24,0,-2.5,-2.5,2,1}, +pieceCollisionVolume["corsiegebreaker"] = { + ["0"] = { 36, 18, 64, 0, 4, 8, 2, 2 }, + ["1"] = { 19, 12, 24, 0, -2.5, -2.5, 2, 1 }, } -pieceCollisionVolume['armshockwave'] = { - ['2']={22,22,22,0,10,0,1,1}, - ['0']={60,65,60,0,20,0,1,1,0}, +pieceCollisionVolume["armshockwave"] = { + ["2"] = { 22, 22, 22, 0, 10, 0, 1, 1 }, + ["0"] = { 60, 65, 60, 0, 20, 0, 1, 1, 0 }, } -pieceCollisionVolume['legmohoconct'] = { - ['0']={70,30,70,0,-3,0,1,1}, - ['1']={21,16,30,0,-3,-1,2,1}, +pieceCollisionVolume["legmohoconct"] = { + ["0"] = { 70, 30, 70, 0, -3, 0, 1, 1 }, + ["1"] = { 21, 16, 30, 0, -3, -1, 2, 1 }, } for name, v in pairs(pieceCollisionVolume) do @@ -468,16 +464,16 @@ for name, v in pairs(pieceCollisionVolume) do end end -dynamicPieceCollisionVolume['corvipe'] = { +dynamicPieceCollisionVolume["corvipe"] = { on = { - ['0']={38,26,38,0,0,0,2,0}, - ['5']={25,45,25,0,25,0,1,1}, -- changed to [1] so the cylinder collision is attached to the turret and not a door - ['offsets']={0,23,0}, + ["0"] = { 38, 26, 38, 0, 0, 0, 2, 0 }, + ["5"] = { 25, 45, 25, 0, 25, 0, 1, 1 }, -- changed to [1] so the cylinder collision is attached to the turret and not a door + ["offsets"] = { 0, 23, 0 }, }, off = { - ['0']={38,26,38,0,0,0,2,0}, - ['offsets']={0, 8, 0}, --['offsets']={0,10,0}, TODO: revert back when issue fixed: https://springrts.com/mantis/view.php?id=5144 - } + ["0"] = { 38, 26, 38, 0, 0, 0, 2, 0 }, + ["offsets"] = { 0, 8, 0 }, --['offsets']={0,10,0}, TODO: revert back when issue fixed: https://springrts.com/mantis/view.php?id=5144 + }, } for name, v in pairs(dynamicPieceCollisionVolume) do for udid, ud in pairs(UnitDefs) do diff --git a/luarules/configs/critters.lua b/luarules/configs/critters.lua index be7b62b6108..a20cb486720 100644 --- a/luarules/configs/critters.lua +++ b/luarules/configs/critters.lua @@ -100,7 +100,7 @@ local critterConfig = { }, ["melting glacier"] = { - { spawnCircle = { x = 5200, z = 4000, r = 2400 }, unitNames = { ["critter_penguin"] = rnd(3, 15) }}, + { spawnCircle = { x = 5200, z = 4000, r = 2400 }, unitNames = { ["critter_penguin"] = rnd(3, 15) } }, }, ["mescaline"] = { @@ -151,7 +151,6 @@ local critterConfig = { { spawnBox = { x1 = 50, z1 = 50, x2 = 10200, z2 = 5050 }, unitNames = { ["critter_goldfish"] = rnd(0, 1) } }, }, - ["real europe"] = { { spawnBox = { x1 = 50, z1 = 4000, x2 = 12250, z2 = 12250 }, unitNames = { ["critter_goldfish"] = rnd(220, 300) } }, { spawnCircle = { x = 2050, z = 2700, r = 2500 }, unitNames = { ["critter_gull"] = rnd(4, 7) } }, @@ -329,38 +328,36 @@ local critterConfig = { ["world in flames v"] = { { spawnBox = { x1 = 50, z1 = 400, x2 = 16200, z2 = 7300 }, unitNames = { ["critter_goldfish"] = rnd(130, 170) } }, - { spawnCircle = { x = 3800, z = 5200, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- silent sea - { spawnCircle = { x = 12500, z = 5400, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- indian ocean - { spawnCircle = { x = 14300, z = 3100, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- philippine sea - { spawnCircle = { x = 7000, z = 2400, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- atlantic ocean europe - { spawnCircle = { x = 5300, z = 2800, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- atlantic ocean americas - - { spawnBox = { x1 = 50, z1 = 7650, x2 = 16200, z2 = 8150 }, unitNames = { ["critter_penguin"] = rnd(14, 20) } }, -- antarctica - { spawnCircle = { x = 5050, z = 7450, r = 250 }, unitNames = { ["critter_penguin"] = rnd(7, 10) } }, -- antarctica colony 1 - { spawnCircle = { x = 15300, z = 7500, r = 250 }, unitNames = { ["critter_penguin"] = rnd(4, 6) } }, -- antarctica colony 2 - - { spawnCircle = { x = 14300, z = 5150, r = 530 }, unitNames = { ["critter_ant"] = rnd(5, 7) } }, -- australia center - { spawnCircle = { x = 14600, z = 4350, r = 280 }, unitNames = { ["critter_ant"] = rnd(2, 3) } }, -- australia top - - { spawnCircle = { x = 8900, z = 2400, r = 160 }, unitNames = { ["critter_duck"] = rnd(2, 3) } }, -- mediterranean sea - { spawnCircle = { x = 13400, z = 3400, r = 160 }, unitNames = { ["critter_duck"] = rnd(2, 3) } }, -- south china sea - - { spawnCircle = { x = 3050, z = 2900, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- california - { spawnCircle = { x = 4600, z = 3350, r = 1100 }, unitNames = { ["critter_gull"] = rnd(6, 10) } }, -- jamaica - { spawnCircle = { x = 13400, z = 4000, r = 1100 }, unitNames = { ["critter_gull"] = rnd(6, 10) } }, -- indonesia - { spawnCircle = { x = 7900, z = 1900, r = 700 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- english strait - { spawnCircle = { x = 8900, z = 2400, r = 900 }, unitNames = { ["critter_gull"] = rnd(4, 6) } }, -- mediterranean sea - { spawnCircle = { x = 10400, z = 2200, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- captic sea - { spawnCircle = { x = 6000, z = 4700, r = 1100 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- brasil - { spawnCircle = { x = 9000, z = 4000, r = 1100 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- mid-west africa - { spawnCircle = { x = 10500, z = 4700, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- madagascar - { spawnCircle = { x = 14000, z = 2400, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- south korea - { spawnCircle = { x = 14000, z = 2400, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- south korea - { spawnCircle = { x = 10400, z = 3500, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- gulf - { spawnCircle = { x = 16000, z = 6000, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- new zealand - + { spawnCircle = { x = 3800, z = 5200, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- silent sea + { spawnCircle = { x = 12500, z = 5400, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- indian ocean + { spawnCircle = { x = 14300, z = 3100, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- philippine sea + { spawnCircle = { x = 7000, z = 2400, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- atlantic ocean europe + { spawnCircle = { x = 5300, z = 2800, r = 600 }, unitNames = { ["critter_goldfish"] = rnd(9, 13) } }, -- atlantic ocean americas + + { spawnBox = { x1 = 50, z1 = 7650, x2 = 16200, z2 = 8150 }, unitNames = { ["critter_penguin"] = rnd(14, 20) } }, -- antarctica + { spawnCircle = { x = 5050, z = 7450, r = 250 }, unitNames = { ["critter_penguin"] = rnd(7, 10) } }, -- antarctica colony 1 + { spawnCircle = { x = 15300, z = 7500, r = 250 }, unitNames = { ["critter_penguin"] = rnd(4, 6) } }, -- antarctica colony 2 + + { spawnCircle = { x = 14300, z = 5150, r = 530 }, unitNames = { ["critter_ant"] = rnd(5, 7) } }, -- australia center + { spawnCircle = { x = 14600, z = 4350, r = 280 }, unitNames = { ["critter_ant"] = rnd(2, 3) } }, -- australia top + + { spawnCircle = { x = 8900, z = 2400, r = 160 }, unitNames = { ["critter_duck"] = rnd(2, 3) } }, -- mediterranean sea + { spawnCircle = { x = 13400, z = 3400, r = 160 }, unitNames = { ["critter_duck"] = rnd(2, 3) } }, -- south china sea + + { spawnCircle = { x = 3050, z = 2900, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- california + { spawnCircle = { x = 4600, z = 3350, r = 1100 }, unitNames = { ["critter_gull"] = rnd(6, 10) } }, -- jamaica + { spawnCircle = { x = 13400, z = 4000, r = 1100 }, unitNames = { ["critter_gull"] = rnd(6, 10) } }, -- indonesia + { spawnCircle = { x = 7900, z = 1900, r = 700 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- english strait + { spawnCircle = { x = 8900, z = 2400, r = 900 }, unitNames = { ["critter_gull"] = rnd(4, 6) } }, -- mediterranean sea + { spawnCircle = { x = 10400, z = 2200, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- captic sea + { spawnCircle = { x = 6000, z = 4700, r = 1100 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- brasil + { spawnCircle = { x = 9000, z = 4000, r = 1100 }, unitNames = { ["critter_gull"] = rnd(3, 5) } }, -- mid-west africa + { spawnCircle = { x = 10500, z = 4700, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- madagascar + { spawnCircle = { x = 14000, z = 2400, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- south korea + { spawnCircle = { x = 14000, z = 2400, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- south korea + { spawnCircle = { x = 10400, z = 3500, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- gulf + { spawnCircle = { x = 16000, z = 6000, r = 700 }, unitNames = { ["critter_gull"] = rnd(2, 3) } }, -- new zealand }, - } return critterConfig diff --git a/luarules/configs/ffa_startpoints/Altair Crossing.lua b/luarules/configs/ffa_startpoints/Altair Crossing.lua index 83684226ad9..8b160094a6a 100644 --- a/luarules/configs/ffa_startpoints/Altair Crossing.lua +++ b/luarules/configs/ffa_startpoints/Altair Crossing.lua @@ -1,19 +1,19 @@ local startPoints = { - -- corners - [1] = { x = 455, z = 918, }, -- north west - [2] = { x = 3629, z = 855, }, -- north east - [3] = { x = 3644, z = 3187, }, -- south east - [4] = { x = 465, z = 3088, }, -- south west + -- corners + [1] = { x = 455, z = 918 }, -- north west + [2] = { x = 3629, z = 855 }, -- north east + [3] = { x = 3644, z = 3187 }, -- south east + [4] = { x = 465, z = 3088 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Carrot Mountains.lua b/luarules/configs/ffa_startpoints/Carrot Mountains.lua index f539bf5a212..5bd3fdff635 100644 --- a/luarules/configs/ffa_startpoints/Carrot Mountains.lua +++ b/luarules/configs/ffa_startpoints/Carrot Mountains.lua @@ -1,140 +1,140 @@ local startPoints = { - -- all around - [1] = { x = 849, z = 1605, }, -- north west - [2] = { x = 2587, z = 1188, }, -- north west / north - [3] = { x = 4335, z = 561, }, -- north / north west - [4] = { x = 6513, z = 771, }, -- north - [5] = { x = 8059, z = 1441, }, -- north / north east - [6] = { x = 9581, z = 180, }, -- north east / north - [7] = { x = 11049, z = 1360, }, -- north east - [8] = { x = 11200, z = 3437, }, -- east / north east - [9] = { x = 12047, z = 5550, }, -- east - [10] = { x = 10717, z = 7226, }, -- east / south east - [11] = { x = 11917, z = 9090, }, -- south east / east - [12] = { x = 11999, z = 11883, }, -- south east - [13] = { x = 10101, z = 11765, }, -- south east / south - [14] = { x = 7918, z = 11990, }, -- south / south east - [15] = { x = 5169, z = 11195, }, -- south / south west - [16] = { x = 2279, z = 12035, }, -- south west / south - [17] = { x = 432, z = 10737, }, -- south west - [18] = { x = 1089, z = 8871 }, -- west / west south - [19] = { x = 237, z = 6313, }, -- west - [20] = { x = 1378, z = 3808, }, -- west / north west - -- center - [21] = { x = 3954, z = 6244, }, -- west - [22] = { x = 4802, z = 4287, }, -- north west - [23] = { x = 7332, z = 3528, }, -- north / north east - [24] = { x = 8534, z = 4935, }, -- north east / east - [25] = { x = 8815, z = 6806, }, -- east / south east - [26] = { x = 7235, z = 8345, }, -- south / south east - [27] = { x = 4877, z = 8113, }, -- south west + -- all around + [1] = { x = 849, z = 1605 }, -- north west + [2] = { x = 2587, z = 1188 }, -- north west / north + [3] = { x = 4335, z = 561 }, -- north / north west + [4] = { x = 6513, z = 771 }, -- north + [5] = { x = 8059, z = 1441 }, -- north / north east + [6] = { x = 9581, z = 180 }, -- north east / north + [7] = { x = 11049, z = 1360 }, -- north east + [8] = { x = 11200, z = 3437 }, -- east / north east + [9] = { x = 12047, z = 5550 }, -- east + [10] = { x = 10717, z = 7226 }, -- east / south east + [11] = { x = 11917, z = 9090 }, -- south east / east + [12] = { x = 11999, z = 11883 }, -- south east + [13] = { x = 10101, z = 11765 }, -- south east / south + [14] = { x = 7918, z = 11990 }, -- south / south east + [15] = { x = 5169, z = 11195 }, -- south / south west + [16] = { x = 2279, z = 12035 }, -- south west / south + [17] = { x = 432, z = 10737 }, -- south west + [18] = { x = 1089, z = 8871 }, -- west / west south + [19] = { x = 237, z = 6313 }, -- west + [20] = { x = 1378, z = 3808 }, -- west / north west + -- center + [21] = { x = 3954, z = 6244 }, -- west + [22] = { x = 4802, z = 4287 }, -- north west + [23] = { x = 7332, z = 3528 }, -- north / north east + [24] = { x = 8534, z = 4935 }, -- north east / east + [25] = { x = 8815, z = 6806 }, -- east / south east + [26] = { x = 7235, z = 8345 }, -- south / south east + [27] = { x = 4877, z = 8113 }, -- south west } local byAllyTeamCount = { - -- 3-way => center - -- north west quadrant has less metal, so we avoid combinations involving north west start pos - [3] = { - { 21, 23, 25, }, - { 21, 23, 26, }, - { 27, 23, 25, }, - }, + -- 3-way => center + -- north west quadrant has less metal, so we avoid combinations involving north west start pos + [3] = { + { 21, 23, 25 }, + { 21, 23, 26 }, + { 27, 23, 25 }, + }, - -- 4-way => corners - [4] = { - { 1, 6, 12, 16, }, - { 1, 6, 12, 17, }, - { 1, 7, 12, 16, }, - { 1, 7, 12, 17, }, - }, + -- 4-way => corners + [4] = { + { 1, 6, 12, 16 }, + { 1, 6, 12, 17 }, + { 1, 7, 12, 16 }, + { 1, 7, 12, 17 }, + }, - -- 5-way => all around, everyone 3 spots apart - [5] = { - { 1, 5, 9, 13, 17, }, - { 2, 6, 10, 14, 18, }, - { 3, 7, 11, 15, 19, }, - { 4, 8, 12, 16, 20, }, - }, + -- 5-way => all around, everyone 3 spots apart + [5] = { + { 1, 5, 9, 13, 17 }, + { 2, 6, 10, 14, 18 }, + { 3, 7, 11, 15, 19 }, + { 4, 8, 12, 16, 20 }, + }, - -- 6-way => - [6] = { - -- all around, 2/3 spots apart - { 4, 7, 10, 14, 17, 20, }, - { 3, 6, 9, 13, 16, 19, }, - -- corners-ish + 2 center - { 1, 6, 12, 16, 21, 25, }, - }, + -- 6-way => + [6] = { + -- all around, 2/3 spots apart + { 4, 7, 10, 14, 17, 20 }, + { 3, 6, 9, 13, 16, 19 }, + -- corners-ish + 2 center + { 1, 6, 12, 16, 21, 25 }, + }, - -- 7-way => - [7] = { - -- center - { 21, 22, 23, 24, 25, 26, 27, }, - -- all around, almost everyone 2 spots apart - { 2, 5, 8, 11, 14, 16, 19, }, - }, + -- 7-way => + [7] = { + -- center + { 21, 22, 23, 24, 25, 26, 27 }, + -- all around, almost everyone 2 spots apart + { 2, 5, 8, 11, 14, 16, 19 }, + }, - -- 8-way => all around, everyone 2 or 1 spots apart - -- south / south west spot [15] is 3 mexes and farther from nearest metal, so we avoid combinations with it - -- north spot [4] is 3 mexes, so pick only combinations with 2 empty spots on both side - [8] = { - { 1, 4, 7, 9, 11, 14, 17, 19, }, - { 1, 4, 7, 9, 12, 14, 17, 19, }, - { 1, 4, 7, 10, 12, 14, 17, 19, }, - }, + -- 8-way => all around, everyone 2 or 1 spots apart + -- south / south west spot [15] is 3 mexes and farther from nearest metal, so we avoid combinations with it + -- north spot [4] is 3 mexes, so pick only combinations with 2 empty spots on both side + [8] = { + { 1, 4, 7, 9, 11, 14, 17, 19 }, + { 1, 4, 7, 9, 12, 14, 17, 19 }, + { 1, 4, 7, 10, 12, 14, 17, 19 }, + }, - -- 9-way => all around + some in center - [9] = { - { 1, 4, 7, 9, 11, 14, 17, 19, 27, }, - { 2, 5, 8, 11, 14, 17, 19, 22, 26, }, - { 3, 5, 8, 10, 12, 14, 16, 18, 20, }, - }, + -- 9-way => all around + some in center + [9] = { + { 1, 4, 7, 9, 11, 14, 17, 19, 27 }, + { 2, 5, 8, 11, 14, 17, 19, 22, 26 }, + { 3, 5, 8, 10, 12, 14, 16, 18, 20 }, + }, - -- 10-way => all around, everyone 1 spot apart - [10] = { - { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, }, - { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, }, - }, + -- 10-way => all around, everyone 1 spot apart + [10] = { + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 }, + { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }, + }, - -- 11-way => 8-way + 3-way - -- center spot east / south east [25] is close to outer spots, so we avoid combinations with it - [11] = { - { 1, 4, 7, 9, 11, 14, 17, 19, 21, 23, 26, }, - { 1, 4, 7, 9, 12, 14, 17, 19, 21, 23, 26, }, - { 1, 4, 7, 10, 12, 14, 17, 19, 21, 23, 26, }, - }, + -- 11-way => 8-way + 3-way + -- center spot east / south east [25] is close to outer spots, so we avoid combinations with it + [11] = { + { 1, 4, 7, 9, 11, 14, 17, 19, 21, 23, 26 }, + { 1, 4, 7, 9, 12, 14, 17, 19, 21, 23, 26 }, + { 1, 4, 7, 10, 12, 14, 17, 19, 21, 23, 26 }, + }, - -- 12-way => at this point and up, it starts becoming a big mess but weekday try to minimize unfairness anyway - [12] = { - { 1, 3, 6, 8, 11, 13, 15, 17, 19, 21, 23, 25, }, - { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24, }, - { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 26, }, - }, + -- 12-way => at this point and up, it starts becoming a big mess but weekday try to minimize unfairness anyway + [12] = { + { 1, 3, 6, 8, 11, 13, 15, 17, 19, 21, 23, 25 }, + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24 }, + { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 26 }, + }, - -- 13-way => - [13] = { - { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24, 26, }, - { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 23, 26, }, - }, + -- 13-way => + [13] = { + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24, 26 }, + { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 23, 26 }, + }, - -- 14-way => - [14] = { - { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 22, 24, 26, 27, }, - { 1, 3, 6, 8, 10, 12, 14, 15, 17, 19, 22, 23, 26, 27, }, - }, + -- 14-way => + [14] = { + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 22, 24, 26, 27 }, + { 1, 3, 6, 8, 10, 12, 14, 15, 17, 19, 22, 23, 26, 27 }, + }, - -- 15-way => - [15] = { - { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 22, 23, 25, 27, }, - { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 25, }, - }, + -- 15-way => + [15] = { + { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 22, 23, 25, 27 }, + { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 25 }, + }, - -- 16-way => - [16] = { - { 2, 4, 6, 8, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23, 25, 27, }, - { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, }, - }, + -- 16-way => + [16] = { + { 2, 4, 6, 8, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23, 25, 27 }, + { 2, 4, 6, 8, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Charlie In The Hills.lua b/luarules/configs/ffa_startpoints/Charlie In The Hills.lua index 97e5cf734a9..803e23ba45d 100644 --- a/luarules/configs/ffa_startpoints/Charlie In The Hills.lua +++ b/luarules/configs/ffa_startpoints/Charlie In The Hills.lua @@ -1,19 +1,19 @@ local startPoints = { - -- corners - [1] = { x = 2440, z = 1841, }, -- north west - [2] = { x = 5782, z = 1904, }, -- north east - [3] = { x = 5738, z = 6358, }, -- south east - [4] = { x = 2421, z = 6320, }, -- south west + -- corners + [1] = { x = 2440, z = 1841 }, -- north west + [2] = { x = 5782, z = 1904 }, -- north east + [3] = { x = 5738, z = 6358 }, -- south east + [4] = { x = 2421, z = 6320 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Cloud9.lua b/luarules/configs/ffa_startpoints/Cloud9.lua index c4e27027bf0..5379ee79eed 100644 --- a/luarules/configs/ffa_startpoints/Cloud9.lua +++ b/luarules/configs/ffa_startpoints/Cloud9.lua @@ -1,43 +1,43 @@ local startPoints = { - -- all around - [1] = { x = 1600, z = 1600, }, -- corner north west - [2] = { x = 4651, z = 1660, }, -- edge north - [3] = { x = 7602, z = 1696, }, -- corner north east - [4] = { x = 7582, z = 4511, }, -- edge east - [5] = { x = 7583, z = 7349, }, -- corner south east - [6] = { x = 4658, z = 7349, }, -- edge south - [7] = { x = 1635, z = 7361, }, -- corner south west - [8] = { x = 1633, z = 4526, }, -- edge west - -- center - [9] = { x = 4680, z = 4465, }, + -- all around + [1] = { x = 1600, z = 1600 }, -- corner north west + [2] = { x = 4651, z = 1660 }, -- edge north + [3] = { x = 7602, z = 1696 }, -- corner north east + [4] = { x = 7582, z = 4511 }, -- edge east + [5] = { x = 7583, z = 7349 }, -- corner south east + [6] = { x = 4658, z = 7349 }, -- edge south + [7] = { x = 1635, z = 7361 }, -- corner south west + [8] = { x = 1633, z = 4526 }, -- edge west + -- center + [9] = { x = 4680, z = 4465 }, } local byAllyTeamCount = { - -- 4-way => - [4] = { - -- corners - { 1, 3, 5, 7, }, - -- edges - { 2, 4, 6, 8, }, - }, + -- 4-way => + [4] = { + -- corners + { 1, 3, 5, 7 }, + -- edges + { 2, 4, 6, 8 }, + }, - -- 5-way => corners + center - [5] = { - { 1, 3, 5, 7, 9, }, - }, + -- 5-way => corners + center + [5] = { + { 1, 3, 5, 7, 9 }, + }, - -- 8-way => all around - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => all around + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, - -- 9-way => all - [9] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, }, - }, + -- 9-way => all + [9] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Colorado.lua b/luarules/configs/ffa_startpoints/Colorado.lua index b4154c34e8c..938bd032c1f 100644 --- a/luarules/configs/ffa_startpoints/Colorado.lua +++ b/luarules/configs/ffa_startpoints/Colorado.lua @@ -1,19 +1,19 @@ local startPoints = { - -- corners - [1] = { x = 393, z = 416, }, -- north west - [2] = { x = 8853, z = 456, }, -- north east - [3] = { x = 8836, z = 5653, }, -- south east - [4] = { x = 379, z = 5622, }, -- south west + -- corners + [1] = { x = 393, z = 416 }, -- north west + [2] = { x = 8853, z = 456 }, -- north east + [3] = { x = 8836, z = 5653 }, -- south east + [4] = { x = 379, z = 5622 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Crescent Bay.lua b/luarules/configs/ffa_startpoints/Crescent Bay.lua index 984ddd263f7..cc663c952bb 100644 --- a/luarules/configs/ffa_startpoints/Crescent Bay.lua +++ b/luarules/configs/ffa_startpoints/Crescent Bay.lua @@ -1,50 +1,50 @@ local startPoints = { - -- corners - [1] = { x = 1349, z = 3119, }, -- north - [2] = { x = 9153, z = 1358, }, -- east - [3] = { x = 11016, z = 9194, }, -- south - [4] = { x = 3126, z = 10941, }, -- west - -- center - [5] = { x = 5459, z = 1256, }, -- north - [6] = { x = 11041, z = 5459, }, -- east - [7] = { x = 6831, z = 11020, }, -- south - [8] = { x = 1254, z = 6828, }, -- west - -- staggered - [9] = { x = 3304, z = 1731, }, -- north - [10] = { x = 10558, z = 3311, }, -- east - [11] = { x = 8986, z = 10546, }, -- south - [12] = { x = 1741, z = 8988, }, -- west - -- close to the middle - [13] = { x = 7236, z = 3200, }, -- north - [14] = { x = 9092, z = 7239, }, -- east - [15] = { x = 5056, z = 9094, }, -- south - [16] = { x = 3179, z = 5047, }, -- west + -- corners + [1] = { x = 1349, z = 3119 }, -- north + [2] = { x = 9153, z = 1358 }, -- east + [3] = { x = 11016, z = 9194 }, -- south + [4] = { x = 3126, z = 10941 }, -- west + -- center + [5] = { x = 5459, z = 1256 }, -- north + [6] = { x = 11041, z = 5459 }, -- east + [7] = { x = 6831, z = 11020 }, -- south + [8] = { x = 1254, z = 6828 }, -- west + -- staggered + [9] = { x = 3304, z = 1731 }, -- north + [10] = { x = 10558, z = 3311 }, -- east + [11] = { x = 8986, z = 10546 }, -- south + [12] = { x = 1741, z = 8988 }, -- west + -- close to the middle + [13] = { x = 7236, z = 3200 }, -- north + [14] = { x = 9092, z = 7239 }, -- east + [15] = { x = 5056, z = 9094 }, -- south + [16] = { x = 3179, z = 5047 }, -- west } local byAllyTeamCount = { - -- 4-way => 1 on each island - [4] = { - { 1, 2, 3, 4, }, - { 5, 6, 7, 8, }, - { 9, 10, 11, 12, }, - { 13, 14, 15, 16, }, - }, + -- 4-way => 1 on each island + [4] = { + { 1, 2, 3, 4 }, + { 5, 6, 7, 8 }, + { 9, 10, 11, 12 }, + { 13, 14, 15, 16 }, + }, - -- 8-way => 2 on each island, but only corners + center - -- we don't use the other configuration (staggered + close to the middle) - -- because in that configuration there's a strong advantage for the staggered - -- spots vs. those close to the middle - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => 2 on each island, but only corners + center + -- we don't use the other configuration (staggered + close to the middle) + -- because in that configuration there's a strong advantage for the staggered + -- spots vs. those close to the middle + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, - -- 16-way => 4 on each island - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 16-way => 4 on each island + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/DSD 8 Way.lua b/luarules/configs/ffa_startpoints/DSD 8 Way.lua index f9f79f5ed72..fa8aa597ebd 100644 --- a/luarules/configs/ffa_startpoints/DSD 8 Way.lua +++ b/luarules/configs/ffa_startpoints/DSD 8 Way.lua @@ -1,51 +1,51 @@ local startPoints = { - -- inner - [1] = { x = 3393, z = 4016, }, - [2] = { x = 4683, z = 3118, }, - [3] = { x = 6225, z = 3403, }, - [4] = { x = 7108, z = 4687, }, - [5] = { x = 6844, z = 6211, }, - [6] = { x = 5580, z = 7112, }, - [7] = { x = 4017, z = 6847, }, - [8] = { x = 3122, z = 5556, }, - -- outer - [9] = { x = 1731, z = 3900, }, - [10] = { x = 2584, z = 2558, }, - [11] = { x = 3580, z = 1881, }, - [12] = { x = 5117, z = 1520, }, - [13] = { x = 6350, z = 1730, }, - [14] = { x = 7701, z = 2583, }, - [15] = { x = 8353, z = 3591, }, - [16] = { x = 8728, z = 5127, }, - [17] = { x = 8521, z = 6323, }, - [18] = { x = 7678, z = 7689, }, - [19] = { x = 6650, z = 8376, }, - [20] = { x = 5097, z = 8725, }, - [21] = { x = 3911, z = 8510, }, - [22] = { x = 2547, z = 7647, }, - [23] = { x = 1865, z = 6685, }, - [24] = { x = 1508, z = 5082, }, + -- inner + [1] = { x = 3393, z = 4016 }, + [2] = { x = 4683, z = 3118 }, + [3] = { x = 6225, z = 3403 }, + [4] = { x = 7108, z = 4687 }, + [5] = { x = 6844, z = 6211 }, + [6] = { x = 5580, z = 7112 }, + [7] = { x = 4017, z = 6847 }, + [8] = { x = 3122, z = 5556 }, + -- outer + [9] = { x = 1731, z = 3900 }, + [10] = { x = 2584, z = 2558 }, + [11] = { x = 3580, z = 1881 }, + [12] = { x = 5117, z = 1520 }, + [13] = { x = 6350, z = 1730 }, + [14] = { x = 7701, z = 2583 }, + [15] = { x = 8353, z = 3591 }, + [16] = { x = 8728, z = 5127 }, + [17] = { x = 8521, z = 6323 }, + [18] = { x = 7678, z = 7689 }, + [19] = { x = 6650, z = 8376 }, + [20] = { x = 5097, z = 8725 }, + [21] = { x = 3911, z = 8510 }, + [22] = { x = 2547, z = 7647 }, + [23] = { x = 1865, z = 6685 }, + [24] = { x = 1508, z = 5082 }, } local byAllyTeamCount = { - -- 4-way => inner, 1 spot apart - [4] = { - { 1, 3, 5, 7, }, - { 2, 4, 6, 8, }, - }, + -- 4-way => inner, 1 spot apart + [4] = { + { 1, 3, 5, 7 }, + { 2, 4, 6, 8 }, + }, - -- 8-way => inner - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => inner + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, - -- 16-way => outer - [16] = { - { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, }, - }, + -- 16-way => outer + [16] = { + { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/DWorld.lua b/luarules/configs/ffa_startpoints/DWorld.lua index 355583b20a6..31c15d7028c 100644 --- a/luarules/configs/ffa_startpoints/DWorld.lua +++ b/luarules/configs/ffa_startpoints/DWorld.lua @@ -1,138 +1,138 @@ local startPoints = { - [1] = { x = 3668, z = 2684, }, -- north west - [2] = { x = 9900, z = 10000, }, -- south east / south - [3] = { x = 10593, z = 4754, }, -- north west / south - [4] = { x = 4873, z = 11468, }, -- south west / south - [5] = { x = 5900, z = 7600, }, -- center / west - [6] = { x = 11288, z = 8259, }, -- south east / east - [7] = { x = 3400, z = 4500, }, -- north west / west - [8] = { x = 8400, z = 3500, }, -- north east / west - [9] = { x = 9164, z = 7932, }, -- center / east - [10] = { x = 2568, z = 10701, }, -- south west - [11] = { x = 10656, z = 3159, }, -- north east - [12] = { x = 3309, z = 6278, }, -- west - [13] = { x = 5851, z = 2216, }, -- north west / east - [14] = { x = 7566, z = 11651, }, -- south - [15] = { x = 6539, z = 9542, }, -- center / south - [16] = { x = 8523, z = 6056, }, -- center / north east + [1] = { x = 3668, z = 2684 }, -- north west + [2] = { x = 9900, z = 10000 }, -- south east / south + [3] = { x = 10593, z = 4754 }, -- north west / south + [4] = { x = 4873, z = 11468 }, -- south west / south + [5] = { x = 5900, z = 7600 }, -- center / west + [6] = { x = 11288, z = 8259 }, -- south east / east + [7] = { x = 3400, z = 4500 }, -- north west / west + [8] = { x = 8400, z = 3500 }, -- north east / west + [9] = { x = 9164, z = 7932 }, -- center / east + [10] = { x = 2568, z = 10701 }, -- south west + [11] = { x = 10656, z = 3159 }, -- north east + [12] = { x = 3309, z = 6278 }, -- west + [13] = { x = 5851, z = 2216 }, -- north west / east + [14] = { x = 7566, z = 11651 }, -- south + [15] = { x = 6539, z = 9542 }, -- center / south + [16] = { x = 8523, z = 6056 }, -- center / north east } local byAllyTeamCount = { - -- 3-way => - [3] = { - { 7, 15, 16, }, - { 3, 4, 12, }, - }, + -- 3-way => + [3] = { + { 7, 15, 16 }, + { 3, 4, 12 }, + }, - -- 4-way => - [4] = { - { 4, 6, 8, 12, }, - { 4, 6, 7, 11, }, - { 4, 6, 7, 8, }, - { 1, 3, 4, 6, }, - }, + -- 4-way => + [4] = { + { 4, 6, 8, 12 }, + { 4, 6, 7, 11 }, + { 4, 6, 7, 8 }, + { 1, 3, 4, 6 }, + }, - -- 5-way => - [5] = { - { 1, 4, 5, 6, 8, }, - { 1, 2, 3, 4, 5, }, - { 1, 3, 4, 5, 6, }, - { 1, 2, 4, 5, 8, }, - { 3, 4, 5, 6, 13, }, - { 2, 3, 4, 5, 13, }, - { 2, 3, 4, 12, 13, }, - { 3, 4, 6, 12, 13, }, - }, + -- 5-way => + [5] = { + { 1, 4, 5, 6, 8 }, + { 1, 2, 3, 4, 5 }, + { 1, 3, 4, 5, 6 }, + { 1, 2, 4, 5, 8 }, + { 3, 4, 5, 6, 13 }, + { 2, 3, 4, 5, 13 }, + { 2, 3, 4, 12, 13 }, + { 3, 4, 6, 12, 13 }, + }, - -- 6-way => - [6] = { - { 3, 5, 6, 7, 10, 13, }, - { 6, 7, 10, 13, 15, 16, }, - { 1, 5, 6, 8, 10, 14, }, - { 3, 6, 10, 12, 13, 14, }, - { 2, 3, 4, 5, 7, 13, }, - { 2, 4, 5, 7, 11, 13, }, - { 3, 4, 5, 6, 7, 13, }, - }, + -- 6-way => + [6] = { + { 3, 5, 6, 7, 10, 13 }, + { 6, 7, 10, 13, 15, 16 }, + { 1, 5, 6, 8, 10, 14 }, + { 3, 6, 10, 12, 13, 14 }, + { 2, 3, 4, 5, 7, 13 }, + { 2, 4, 5, 7, 11, 13 }, + { 3, 4, 5, 6, 7, 13 }, + }, - -- 7-way => - [7] = { - { 5, 6, 7, 10, 11, 13, 14, }, - { 3, 5, 6, 7, 10, 13, 14, }, - { 1, 3, 4, 6, 8, 12, 14, }, - { 3, 4, 5, 6, 7, 13, 14, }, - { 2, 3, 4, 5, 6, 7, 13, }, - }, + -- 7-way => + [7] = { + { 5, 6, 7, 10, 11, 13, 14 }, + { 3, 5, 6, 7, 10, 13, 14 }, + { 1, 3, 4, 6, 8, 12, 14 }, + { 3, 4, 5, 6, 7, 13, 14 }, + { 2, 3, 4, 5, 6, 7, 13 }, + }, - -- 8-way => - [8] = { - { 1, 3, 5, 6, 7, 8, 10, 14, }, - { 4, 5, 6, 7, 8, 13, 14, 16, }, - { 3, 4, 5, 6, 7, 8, 13, 14, }, - { 1, 3, 4, 5, 6, 7, 8, 14, }, - }, + -- 8-way => + [8] = { + { 1, 3, 5, 6, 7, 8, 10, 14 }, + { 4, 5, 6, 7, 8, 13, 14, 16 }, + { 3, 4, 5, 6, 7, 8, 13, 14 }, + { 1, 3, 4, 5, 6, 7, 8, 14 }, + }, - -- 9-way => - [9] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 10, }, - { 3, 5, 6, 7, 8, 10, 12, 13, 14, }, - { 2, 3, 5, 6, 7, 8, 10, 13, 14, }, - }, + -- 9-way => + [9] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 10 }, + { 3, 5, 6, 7, 8, 10, 12, 13, 14 }, + { 2, 3, 5, 6, 7, 8, 10, 13, 14 }, + }, - -- 10-way => - [10] = { - { 1, 2, 4, 5, 6, 7, 8, 10, 11, 16, }, - { 2, 3, 5, 6, 7, 8, 10, 12, 13, 14, }, - { 2, 3, 5, 7, 8, 9, 10, 12, 13, 14, }, - }, + -- 10-way => + [10] = { + { 1, 2, 4, 5, 6, 7, 8, 10, 11, 16 }, + { 2, 3, 5, 6, 7, 8, 10, 12, 13, 14 }, + { 2, 3, 5, 7, 8, 9, 10, 12, 13, 14 }, + }, - -- 11-way => - [11] = { - { 1, 2, 3, 6, 10, 11, 12, 13, 14, 15, 16, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 14, 16, }, - { 1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 16, }, - { 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, }, - { 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14, }, - }, + -- 11-way => + [11] = { + { 1, 2, 3, 6, 10, 11, 12, 13, 14, 15, 16 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 14, 16 }, + { 1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 16 }, + { 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14 }, + { 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14 }, + }, - -- 12-way => - [12] = { - { 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, }, - { 1, 2, 3, 4, 6, 7, 8, 10, 12, 13, 14, 16, }, - }, + -- 12-way => + [12] = { + { 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14 }, + { 1, 2, 3, 4, 6, 7, 8, 10, 12, 13, 14, 16 }, + }, - -- 13-way => - [13] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, }, - { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, }, - }, + -- 13-way => + [13] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14 }, + { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15 }, + }, - -- 14-way => - [14] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, }, - }, + -- 14-way => + [14] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16 }, + }, - -- 15-way => - [15] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, }, - { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 15-way => + [15] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16 }, + { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, - -- 16-way => - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 16-way => + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Darkside.lua b/luarules/configs/ffa_startpoints/Darkside.lua index 2e6b6c0b12c..3b8b3c2c3ff 100644 --- a/luarules/configs/ffa_startpoints/Darkside.lua +++ b/luarules/configs/ffa_startpoints/Darkside.lua @@ -1,45 +1,45 @@ local startPoints = { - -- corners - [1] = { x = 1702, z = 662, }, -- north west - [2] = { x = 9937, z = 639, }, -- north east - [3] = { x = 11236, z = 11066, }, -- south east - [4] = { x = 1884, z = 11923, }, -- south west - -- craters - [5] = { x = 6549, z = 8603, }, -- south - [6] = { x = 5918, z = 3577, }, -- north - -- edges - [7] = { x = 10862, z = 6795, }, -- east - [8] = { x = 931, z = 7557, }, -- west + -- corners + [1] = { x = 1702, z = 662 }, -- north west + [2] = { x = 9937, z = 639 }, -- north east + [3] = { x = 11236, z = 11066 }, -- south east + [4] = { x = 1884, z = 11923 }, -- south west + -- craters + [5] = { x = 6549, z = 8603 }, -- south + [6] = { x = 5918, z = 3577 }, -- north + -- edges + [7] = { x = 10862, z = 6795 }, -- east + [8] = { x = 931, z = 7557 }, -- west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, - -- 5-way => corners + south crater - [5] = { - { 1, 2, 3, 4, 5, }, - }, + -- 5-way => corners + south crater + [5] = { + { 1, 2, 3, 4, 5 }, + }, - -- 6-way => corners + craters - [6] = { - { 1, 2, 3, 4, 5, 6, }, - }, + -- 6-way => corners + craters + [6] = { + { 1, 2, 3, 4, 5, 6 }, + }, - -- 7-way => corners + craters + east edge - [7] = { - { 1, 2, 3, 4, 5, 6, 7, }, - }, + -- 7-way => corners + craters + east edge + [7] = { + { 1, 2, 3, 4, 5, 6, 7 }, + }, - -- 8-way => corners + craters + edges - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => corners + craters + edges + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Factions and Factious.lua b/luarules/configs/ffa_startpoints/Factions and Factious.lua index ad695065338..09fada8f53d 100644 --- a/luarules/configs/ffa_startpoints/Factions and Factious.lua +++ b/luarules/configs/ffa_startpoints/Factions and Factious.lua @@ -1,71 +1,71 @@ local startPoints = { - -- corners - [1] = { x = 1409, z = 2537, }, -- north west - [2] = { x = 9212, z = 640, }, -- north east - [3] = { x = 9218, z = 8343, }, -- south east - [4] = { x = 681, z = 8977, }, -- south west - -- edges - [5] = { x = 4735, z = 617, }, -- north - [6] = { x = 5129, z = 8992, }, -- south - [7] = { x = 2118, z = 5119, }, -- west - [8] = { x = 9211, z = 4469, }, -- east - -- center - [9] = { x = 5868, z = 6379, }, -- south - [10] = { x = 5478, z = 3190, }, -- north + -- corners + [1] = { x = 1409, z = 2537 }, -- north west + [2] = { x = 9212, z = 640 }, -- north east + [3] = { x = 9218, z = 8343 }, -- south east + [4] = { x = 681, z = 8977 }, -- south west + -- edges + [5] = { x = 4735, z = 617 }, -- north + [6] = { x = 5129, z = 8992 }, -- south + [7] = { x = 2118, z = 5119 }, -- west + [8] = { x = 9211, z = 4469 }, -- east + -- center + [9] = { x = 5868, z = 6379 }, -- south + [10] = { x = 5478, z = 3190 }, -- north } local byAllyTeamCount = { - -- 3-way => north / south corner + opposite edge - [3] = { - { 1, 6, 8, }, - { 2, 3, 7, }, - }, + -- 3-way => north / south corner + opposite edge + [3] = { + { 1, 6, 8 }, + { 2, 3, 7 }, + }, - -- 4-way => - [4] = { - -- corners - { 1, 2, 3, 4, }, - -- edges - { 5, 6, 7, 8, }, - -- west/east edges + center - { 7, 8, 9, 10, }, - }, + -- 4-way => + [4] = { + -- corners + { 1, 2, 3, 4 }, + -- edges + { 5, 6, 7, 8 }, + -- west/east edges + center + { 7, 8, 9, 10 }, + }, - -- 5-way => corners + south center - [5] = { - { 1, 2, 3, 4, 9, }, - }, + -- 5-way => corners + south center + [5] = { + { 1, 2, 3, 4, 9 }, + }, - -- 6-way => corners + north/south edges - [6] = { - { 1, 2, 3, 4, 5, 6, }, - { 1, 2, 3, 4, 7, 8, }, - }, + -- 6-way => corners + north/south edges + [6] = { + { 1, 2, 3, 4, 5, 6 }, + { 1, 2, 3, 4, 7, 8 }, + }, - -- 7-way => 8-way minus 1 spot - [7] = { - { 1, 2, 3, 4, 5, 6, 7, }, - { 1, 2, 3, 4, 5, 6, 8, }, - }, + -- 7-way => 8-way minus 1 spot + [7] = { + { 1, 2, 3, 4, 5, 6, 7 }, + { 1, 2, 3, 4, 5, 6, 8 }, + }, - -- 8-way => corners + edges - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => corners + edges + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, - -- 9-way => 10-way minus 1 spot - [9] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, }, - }, + -- 9-way => 10-way minus 1 spot + [9] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10 }, + }, - -- 10-way => all - [10] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }, - }, + -- 10-way => all + [10] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Forge.lua b/luarules/configs/ffa_startpoints/Forge.lua index eadd0ae70e0..0f73d0c5f12 100644 --- a/luarules/configs/ffa_startpoints/Forge.lua +++ b/luarules/configs/ffa_startpoints/Forge.lua @@ -1,25 +1,25 @@ local startPoints = { - -- outer - [1] = { x = 2119, z = 1529, }, -- north west - [2] = { x = 7091, z = 1539, }, -- north east - [3] = { x = 7121, z = 7662, }, -- south east - [4] = { x = 2115, z = 7636, }, -- south west - -- inner - [5] = { x = 3118, z = 2684, }, -- north west - [6] = { x = 6084, z = 2679, }, -- north east - [7] = { x = 5903, z = 6549, }, -- south east - [8] = { x = 3308, z = 6577, }, -- south west + -- outer + [1] = { x = 2119, z = 1529 }, -- north west + [2] = { x = 7091, z = 1539 }, -- north east + [3] = { x = 7121, z = 7662 }, -- south east + [4] = { x = 2115, z = 7636 }, -- south west + -- inner + [5] = { x = 3118, z = 2684 }, -- north west + [6] = { x = 6084, z = 2679 }, -- north east + [7] = { x = 5903, z = 6549 }, -- south east + [8] = { x = 3308, z = 6577 }, -- south west } local byAllyTeamCount = { - -- 4-way => 1 per quadrant, make sure everybody has equal access to op geos - [4] = { - { 1, 2, 3, 4, }, - { 5, 6, 7, 8, }, - }, + -- 4-way => 1 per quadrant, make sure everybody has equal access to op geos + [4] = { + { 1, 2, 3, 4 }, + { 5, 6, 7, 8 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Ghenna Rising.lua b/luarules/configs/ffa_startpoints/Ghenna Rising.lua index 167ad09419b..d44d304ba7b 100644 --- a/luarules/configs/ffa_startpoints/Ghenna Rising.lua +++ b/luarules/configs/ffa_startpoints/Ghenna Rising.lua @@ -1,46 +1,46 @@ local startPoints = { - -- corners - [1] = { x = 920, z = 1008, }, -- north west - [2] = { x = 7336, z = 1006, }, -- north east - [3] = { x = 7324, z = 7225, }, -- south east - [4] = { x = 858, z = 7183, }, -- south west - -- left / right - [5] = { x = 642, z = 2350, }, -- north west - [6] = { x = 2326, z = 683, }, -- north west - [7] = { x = 5830, z = 668, }, -- north east - [8] = { x = 7496, z = 2416, }, -- north east - [9] = { x = 7639, z = 5774, }, -- south east - [10] = { x = 5840, z = 7538, }, -- south east - [11] = { x = 2470, z = 7427, }, -- south west - [12] = { x = 627, z = 5758, }, -- south west - -- middle - [13] = { x = 1926, z = 2022, }, -- north west - [14] = { x = 6270, z = 1931, }, -- north east - [15] = { x = 6290, z = 6101, }, -- south east - [16] = { x = 1918, z = 6103, }, -- south west + -- corners + [1] = { x = 920, z = 1008 }, -- north west + [2] = { x = 7336, z = 1006 }, -- north east + [3] = { x = 7324, z = 7225 }, -- south east + [4] = { x = 858, z = 7183 }, -- south west + -- left / right + [5] = { x = 642, z = 2350 }, -- north west + [6] = { x = 2326, z = 683 }, -- north west + [7] = { x = 5830, z = 668 }, -- north east + [8] = { x = 7496, z = 2416 }, -- north east + [9] = { x = 7639, z = 5774 }, -- south east + [10] = { x = 5840, z = 7538 }, -- south east + [11] = { x = 2470, z = 7427 }, -- south west + [12] = { x = 627, z = 5758 }, -- south west + -- middle + [13] = { x = 1926, z = 2022 }, -- north west + [14] = { x = 6270, z = 1931 }, -- north east + [15] = { x = 6290, z = 6101 }, -- south east + [16] = { x = 1918, z = 6103 }, -- south west } local byAllyTeamCount = { - -- 4-way => - [4] = { - -- corners - { 1, 2, 3, 4, }, - -- center - { 13, 14, 15, 16, }, - }, + -- 4-way => + [4] = { + -- corners + { 1, 2, 3, 4 }, + -- center + { 13, 14, 15, 16 }, + }, - -- 8-way => left / right - [8] = { - { 5, 6, 7, 8, 9, 10, 11, 12, }, - }, + -- 8-way => left / right + [8] = { + { 5, 6, 7, 8, 9, 10, 11, 12 }, + }, - -- 12-way => left / right + middle - [12] = { - { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 12-way => left / right + middle + [12] = { + { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Kolmogorov.lua b/luarules/configs/ffa_startpoints/Kolmogorov.lua index 2c955a64742..065b4c66104 100644 --- a/luarules/configs/ffa_startpoints/Kolmogorov.lua +++ b/luarules/configs/ffa_startpoints/Kolmogorov.lua @@ -1,66 +1,65 @@ local startPoints = { - -- north/south corners - [1] = { x = 691, z = 5278, }, -- south west north - [2] = { x = 5077, z = 762, }, -- north east north - [3] = { x = 9545, z = 5151, }, -- north east south - [4] = { x = 5090, z = 9587, }, -- south west south - -- west/east corners - [5] = { x = 1371, z = 9068, }, -- south west west - [6] = { x = 9264, z = 1182, }, -- north east east - [7] = { x = 3877, z = 6548, }, -- south west east - [8] = { x = 6459, z = 3731, }, -- north east west - [9] = { x = 3886, z = 4006, }, -- center west - [10] = { x = 6776, z = 6592, }, -- center east + -- north/south corners + [1] = { x = 691, z = 5278 }, -- south west north + [2] = { x = 5077, z = 762 }, -- north east north + [3] = { x = 9545, z = 5151 }, -- north east south + [4] = { x = 5090, z = 9587 }, -- south west south + -- west/east corners + [5] = { x = 1371, z = 9068 }, -- south west west + [6] = { x = 9264, z = 1182 }, -- north east east + [7] = { x = 3877, z = 6548 }, -- south west east + [8] = { x = 6459, z = 3731 }, -- north east west + [9] = { x = 3886, z = 4006 }, -- center west + [10] = { x = 6776, z = 6592 }, -- center east } - local byAllyTeamCount = { - -- 3-way => north or south corners on each quadrant + opposite center - [3] = { - { 1, 2, 10, }, - { 3, 4, 9, }, - }, + -- 3-way => north or south corners on each quadrant + opposite center + [3] = { + { 1, 2, 10 }, + { 3, 4, 9 }, + }, - -- 4-way => north/south corners from both quadrants - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => north/south corners from both quadrants + [4] = { + { 1, 2, 3, 4 }, + }, - -- 5-way => 4-way + one of the corners closer to center in one quadrant - [5] = { - { 1, 2, 3, 4, 7, }, - { 1, 2, 3, 4, 8, }, - }, + -- 5-way => 4-way + one of the corners closer to center in one quadrant + [5] = { + { 1, 2, 3, 4, 7 }, + { 1, 2, 3, 4, 8 }, + }, - -- 6-way => 4-way + corners closer to center from both quadrants - [6] = { - { 1, 2, 3, 4, 7, 8, }, - }, + -- 6-way => 4-way + corners closer to center from both quadrants + [6] = { + { 1, 2, 3, 4, 7, 8 }, + }, - -- 7-way => 8-way but one of the corners farther from the center is removed - [7] = { - { 1, 2, 3, 4, 5, 7, 8, }, - { 1, 2, 3, 4, 6, 7, 8, }, - }, + -- 7-way => 8-way but one of the corners farther from the center is removed + [7] = { + { 1, 2, 3, 4, 5, 7, 8 }, + { 1, 2, 3, 4, 6, 7, 8 }, + }, - -- 8-way => all corners from both quadrants - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => all corners from both quadrants + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, - -- 9-way => 8-way + 1 of the remaining spots - [9] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, }, - }, + -- 9-way => 8-way + 1 of the remaining spots + [9] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10 }, + }, - -- 10-way => all - [10] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }, - }, + -- 10-way => all + [10] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Krakatoa.lua b/luarules/configs/ffa_startpoints/Krakatoa.lua index 5fd10075fb2..37c0f13c72b 100644 --- a/luarules/configs/ffa_startpoints/Krakatoa.lua +++ b/luarules/configs/ffa_startpoints/Krakatoa.lua @@ -1,58 +1,58 @@ local startPoints = { - -- outer - [1] = { x = 2435, z = 5420, }, - [2] = { x = 4860, z = 2360, }, - [3] = { x = 9234, z = 2235, }, - [4] = { x = 11902, z = 5367, }, - [5] = { x = 11941, z = 9105, }, - [6] = { x = 9590, z = 12107, }, - [7] = { x = 5362, z = 12067, }, - [8] = { x = 2331, z = 9313, }, - -- inner - [9] = { x = 5151, z = 5276, }, - [10] = { x = 7179, z = 4295, }, - [11] = { x = 9041, z = 5164, }, - [12] = { x = 10068, z = 7119, }, - [13] = { x = 9168, z = 9017, }, - [14] = { x = 7383, z = 10102, }, - [15] = { x = 5624, z = 9482, }, - [16] = { x = 4615, z = 7120, }, + -- outer + [1] = { x = 2435, z = 5420 }, + [2] = { x = 4860, z = 2360 }, + [3] = { x = 9234, z = 2235 }, + [4] = { x = 11902, z = 5367 }, + [5] = { x = 11941, z = 9105 }, + [6] = { x = 9590, z = 12107 }, + [7] = { x = 5362, z = 12067 }, + [8] = { x = 2331, z = 9313 }, + -- inner + [9] = { x = 5151, z = 5276 }, + [10] = { x = 7179, z = 4295 }, + [11] = { x = 9041, z = 5164 }, + [12] = { x = 10068, z = 7119 }, + [13] = { x = 9168, z = 9017 }, + [14] = { x = 7383, z = 10102 }, + [15] = { x = 5624, z = 9482 }, + [16] = { x = 4615, z = 7120 }, } local byAllyTeamCount = { - -- 4-way => - [4] = { - -- half outer - { 1, 3, 5, 7, }, - { 2, 4, 6, 8, }, - -- half inner - { 9, 11, 13, 15, }, - { 10, 12, 14, 16, }, - }, + -- 4-way => + [4] = { + -- half outer + { 1, 3, 5, 7 }, + { 2, 4, 6, 8 }, + -- half inner + { 9, 11, 13, 15 }, + { 10, 12, 14, 16 }, + }, - -- 8-way => - [8] = { - -- outer - { 1, 2, 3, 4, 5, 6, 7, 8, }, - -- inner - { 9, 10, 11, 12, 13, 14, 15, 16, }, - -- half outer + half inner - { 1, 3, 5, 7, 9, 11, 13, 15, }, - }, + -- 8-way => + [8] = { + -- outer + { 1, 2, 3, 4, 5, 6, 7, 8 }, + -- inner + { 9, 10, 11, 12, 13, 14, 15, 16 }, + -- half outer + half inner + { 1, 3, 5, 7, 9, 11, 13, 15 }, + }, - -- 12-way => outer + half inner - [12] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, }, - }, + -- 12-way => outer + half inner + [12] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16 }, + }, - -- 16-way => all - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 16-way => all + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/LV412.lua b/luarules/configs/ffa_startpoints/LV412.lua index 8338baff5a8..9c0fa269bf4 100644 --- a/luarules/configs/ffa_startpoints/LV412.lua +++ b/luarules/configs/ffa_startpoints/LV412.lua @@ -1,27 +1,27 @@ local startPoints = { - -- spiral - [1] = { x = 3035, z = 1481, }, -- north - [2] = { x = 7006, z = 3681, }, -- east - [3] = { x = 4871, z = 7909, }, -- south - [4] = { x = 940, z = 5323, }, -- west - -- corners - [5] = { x = 7880, z = 525, }, -- north west - [6] = { x = 7738, z = 7822, }, -- north east - [7] = { x = 498, z = 7654, }, -- south east - [8] = { x = 552, z = 685, }, -- south west + -- spiral + [1] = { x = 3035, z = 1481 }, -- north + [2] = { x = 7006, z = 3681 }, -- east + [3] = { x = 4871, z = 7909 }, -- south + [4] = { x = 940, z = 5323 }, -- west + -- corners + [5] = { x = 7880, z = 525 }, -- north west + [6] = { x = 7738, z = 7822 }, -- north east + [7] = { x = 498, z = 7654 }, -- south east + [8] = { x = 552, z = 685 }, -- south west } local byAllyTeamCount = { - -- 4-way => - [4] = { - -- spiral - { 1, 2, 3, 4, }, - -- corners - { 5, 6, 7, 8, }, - }, + -- 4-way => + [4] = { + -- spiral + { 1, 2, 3, 4 }, + -- corners + { 5, 6, 7, 8 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Mediterraneum.lua b/luarules/configs/ffa_startpoints/Mediterraneum.lua index a246c542d7d..d28a28570e8 100644 --- a/luarules/configs/ffa_startpoints/Mediterraneum.lua +++ b/luarules/configs/ffa_startpoints/Mediterraneum.lua @@ -1,36 +1,36 @@ local startPoints = { - [1] = { x = 5416, z = 8996, }, -- Beljam - [2] = { x = 13934, z = 9242, }, -- Youkraine - [3] = { x = 4492, z = 15723, }, -- Moreocho - [4] = { x = 10808, z = 3287, }, -- Fineland - [5] = { x = 3204, z = 2699, }, -- Eyesland - [6] = { x = 10940, z = 11602, }, -- Balkans - [7] = { x = 15367, z = 15690, }, -- Izreal - [8] = { x = 881, z = 10237, }, -- Biscay Bay - [9] = { x = 4761, z = 6130, }, -- North Sea - [10] = { x = 14814, z = 4168, }, -- Rusha - [11] = { x = 9609, z = 7273, }, -- Poleland - [12] = { x = 7845, z = 2298, }, -- Norway - [13] = { x = 1623, z = 13247, }, -- Spain - [14] = { x = 5854, z = 12867, }, -- Sardines - [15] = { x = 9832, z = 15982, }, -- Libiya - [16] = { x = 15711, z = 571, }, -- Barents Sea - [17] = { x = 11938, z = 6606, }, -- Belarush - [18] = { x = 14558, z = 11520, }, -- Black Sea - [19] = { x = 8092, z = 5251, }, -- Swededen - [20] = { x = 3299, z = 7014, }, -- Britin - [21] = { x = 8933, z = 14490, }, -- Mediterranean Sea - [22] = { x = 9796, z = 9707, }, -- Hungry - [23] = { x = 1289, z = 1085, }, -- Greenland - [24] = { x = 6842, z = 11024, }, -- Eataly - [25] = { x = 13385, z = 13033, }, -- Turky - [26] = { x = 15872, z = 6990, }, -- Khazakstan - [27] = { x = 4291, z = 10790, }, -- Franche - [28] = { x = 5862, z = 784, }, -- Norwegian Sea - [29] = { x = 7356, z = 8131, }, -- Germoney - [30] = { x = 995, z = 7099, }, -- Ireland - [31] = { x = 616, z = 3778, }, -- Faroe Sea - [32] = { x = 14101, z = 1559, }, -- Murmansk + [1] = { x = 5416, z = 8996 }, -- Beljam + [2] = { x = 13934, z = 9242 }, -- Youkraine + [3] = { x = 4492, z = 15723 }, -- Moreocho + [4] = { x = 10808, z = 3287 }, -- Fineland + [5] = { x = 3204, z = 2699 }, -- Eyesland + [6] = { x = 10940, z = 11602 }, -- Balkans + [7] = { x = 15367, z = 15690 }, -- Izreal + [8] = { x = 881, z = 10237 }, -- Biscay Bay + [9] = { x = 4761, z = 6130 }, -- North Sea + [10] = { x = 14814, z = 4168 }, -- Rusha + [11] = { x = 9609, z = 7273 }, -- Poleland + [12] = { x = 7845, z = 2298 }, -- Norway + [13] = { x = 1623, z = 13247 }, -- Spain + [14] = { x = 5854, z = 12867 }, -- Sardines + [15] = { x = 9832, z = 15982 }, -- Libiya + [16] = { x = 15711, z = 571 }, -- Barents Sea + [17] = { x = 11938, z = 6606 }, -- Belarush + [18] = { x = 14558, z = 11520 }, -- Black Sea + [19] = { x = 8092, z = 5251 }, -- Swededen + [20] = { x = 3299, z = 7014 }, -- Britin + [21] = { x = 8933, z = 14490 }, -- Mediterranean Sea + [22] = { x = 9796, z = 9707 }, -- Hungry + [23] = { x = 1289, z = 1085 }, -- Greenland + [24] = { x = 6842, z = 11024 }, -- Eataly + [25] = { x = 13385, z = 13033 }, -- Turky + [26] = { x = 15872, z = 6990 }, -- Khazakstan + [27] = { x = 4291, z = 10790 }, -- Franche + [28] = { x = 5862, z = 784 }, -- Norwegian Sea + [29] = { x = 7356, z = 8131 }, -- Germoney + [30] = { x = 995, z = 7099 }, -- Ireland + [31] = { x = 616, z = 3778 }, -- Faroe Sea + [32] = { x = 14101, z = 1559 }, -- Murmansk } --[[ @@ -62,120 +62,120 @@ by starting from all 24 land spots (except spot 14) and removing the worst spots, using 12-way layouts and cliques in the graph as reference. ]] local byAllyTeamCount = { - -- 3-way => - [3] = { - { 2, 3, 19, }, - { 6, 10, 20, }, - { 12, 13, 25, }, - { 1, 6, 11, }, - }, - - -- 4-way => - [4] = { - { 5, 10, 13, 25, }, - { 13, 17, 20, 25, }, - { 1, 2, 3, 4, }, - { 3, 4, 20, 25, }, - }, - - -- 5-way => - [5] = { - { 1, 2, 3, 4, 5, }, - { 3, 12, 20, 25, 26, }, - { 2, 15, 19, 27, 32, }, - { 10, 12, 13, 25, 29, }, - }, - - -- 6-way => - [6] = { - { 10, 12, 13, 15, 20, 22, }, - { 2, 13, 15, 19, 20, 32, }, - { 1, 2, 3, 4, 5, 7, }, - { 1, 3, 4, 5, 25, 26, }, - }, - - -- 7-way => - [7] = { - { 3, 5, 10, 11, 12, 25, 27, }, - { 1, 4, 5, 6, 13, 15, 26, }, - { 1, 2, 3, 7, 12, 23, 32, }, - { 6, 10, 11, 12, 13, 15, 20, }, - }, - - -- 8-way => - [8] = { - { 6, 10, 11, 12, 13, 15, 20, 23, }, - { 15, 17, 19, 22, 23, 27, 30, 32, }, - { 3, 7, 10, 12, 20, 22, 23, 27, }, - { 2, 3, 5, 10, 11, 12, 25, 27, }, - }, - - -- 9-way => - [9] = { - { 2, 3, 7, 10, 11, 12, 20, 23, 27, }, - { 6, 12, 13, 15, 23, 26, 29, 30, 32, }, - { 6, 10, 11, 12, 13, 15, 20, 23, 24, }, - { 12, 13, 15, 17, 20, 23, 24, 25, 32, }, - { 3, 17, 19, 22, 23, 25, 27, 30, 32, }, - }, - - -- 10-way => - [10] = { - { 1, 6, 7, 11, 12, 13, 23, 26, 30, 32, }, - { 11, 13, 15, 19, 20, 23, 24, 25, 26, 32, }, - { 2, 10, 11, 12, 13, 15, 20, 23, 24, 25, }, - { 3, 6, 7, 12, 17, 23, 27, 29, 30, 32, }, - { 1, 4, 10, 11, 13, 15, 19, 23, 25, 30, }, - { 3, 6, 7, 11, 12, 20, 23, 26, 27, 32, }, - }, - - -- 11-way => - [11] = { - { 1, 3, 6, 7, 11, 19, 23, 24, 26, 30, 32, }, - { 1, 11, 13, 15, 19, 23, 24, 25, 26, 30, 32, }, - { 1, 2, 11, 13, 15, 19, 23, 24, 25, 30, 32, }, - { 2, 4, 10, 11, 13, 15, 19, 20, 23, 24, 25, }, - { 1, 2, 4, 10, 11, 13, 15, 19, 23, 25, 30, }, - { 1, 2, 3, 4, 5, 10, 11, 19, 24, 25, 30, }, - }, - - -- 12-way => - [12] = { - { 1, 2, 4, 5, 6, 10, 11, 13, 15, 19, 24, 30, }, - { 1, 2, 3, 4, 5, 6, 7, 10, 11, 19, 24, 30, }, - { 1, 2, 4, 10, 11, 13, 15, 19, 23, 24, 25, 30, }, - }, - - -- 13-way => - [13] = { - { 2, 3, 4, 6, 7, 17, 19, 23, 26, 27, 29, 30, 32, }, - { 1, 4, 11, 13, 15, 19, 22, 23, 24, 25, 26, 30, 32, }, - { 2, 3, 4, 6, 7, 17, 19, 23, 24, 26, 27, 29, 30, }, - { 1, 2, 3, 4, 6, 7, 10, 11, 13, 19, 23, 24, 30, }, - }, - - -- 14-way => - [14] = { - { 2, 3, 4, 6, 7, 17, 19, 23, 24, 26, 27, 29, 30, 32, }, - { 2, 4, 13, 15, 17, 19, 22, 23, 25, 26, 27, 29, 30, 32, }, - { 1, 2, 3, 4, 6, 7, 11, 13, 19, 23, 24, 26, 30, 32, }, - }, - - -- 15-way => - [15] = { - { 2, 3, 4, 6, 7, 12, 17, 19, 23, 24, 26, 27, 29, 30, 32, }, - { 2, 3, 4, 6, 7, 13, 17, 19, 23, 24, 26, 27, 29, 30, 32, }, - { 2, 4, 13, 15, 17, 19, 22, 23, 24, 25, 26, 27, 29, 30, 32, }, - }, - - -- 16-way => - [16] = { - { 1, 2, 3, 4, 7, 10, 11, 12, 13, 19, 22, 23, 24, 25, 26, 30, }, - { 2, 3, 4, 7, 12, 17, 19, 22, 23, 24, 25, 26, 27, 29, 30, 32, }, - }, + -- 3-way => + [3] = { + { 2, 3, 19 }, + { 6, 10, 20 }, + { 12, 13, 25 }, + { 1, 6, 11 }, + }, + + -- 4-way => + [4] = { + { 5, 10, 13, 25 }, + { 13, 17, 20, 25 }, + { 1, 2, 3, 4 }, + { 3, 4, 20, 25 }, + }, + + -- 5-way => + [5] = { + { 1, 2, 3, 4, 5 }, + { 3, 12, 20, 25, 26 }, + { 2, 15, 19, 27, 32 }, + { 10, 12, 13, 25, 29 }, + }, + + -- 6-way => + [6] = { + { 10, 12, 13, 15, 20, 22 }, + { 2, 13, 15, 19, 20, 32 }, + { 1, 2, 3, 4, 5, 7 }, + { 1, 3, 4, 5, 25, 26 }, + }, + + -- 7-way => + [7] = { + { 3, 5, 10, 11, 12, 25, 27 }, + { 1, 4, 5, 6, 13, 15, 26 }, + { 1, 2, 3, 7, 12, 23, 32 }, + { 6, 10, 11, 12, 13, 15, 20 }, + }, + + -- 8-way => + [8] = { + { 6, 10, 11, 12, 13, 15, 20, 23 }, + { 15, 17, 19, 22, 23, 27, 30, 32 }, + { 3, 7, 10, 12, 20, 22, 23, 27 }, + { 2, 3, 5, 10, 11, 12, 25, 27 }, + }, + + -- 9-way => + [9] = { + { 2, 3, 7, 10, 11, 12, 20, 23, 27 }, + { 6, 12, 13, 15, 23, 26, 29, 30, 32 }, + { 6, 10, 11, 12, 13, 15, 20, 23, 24 }, + { 12, 13, 15, 17, 20, 23, 24, 25, 32 }, + { 3, 17, 19, 22, 23, 25, 27, 30, 32 }, + }, + + -- 10-way => + [10] = { + { 1, 6, 7, 11, 12, 13, 23, 26, 30, 32 }, + { 11, 13, 15, 19, 20, 23, 24, 25, 26, 32 }, + { 2, 10, 11, 12, 13, 15, 20, 23, 24, 25 }, + { 3, 6, 7, 12, 17, 23, 27, 29, 30, 32 }, + { 1, 4, 10, 11, 13, 15, 19, 23, 25, 30 }, + { 3, 6, 7, 11, 12, 20, 23, 26, 27, 32 }, + }, + + -- 11-way => + [11] = { + { 1, 3, 6, 7, 11, 19, 23, 24, 26, 30, 32 }, + { 1, 11, 13, 15, 19, 23, 24, 25, 26, 30, 32 }, + { 1, 2, 11, 13, 15, 19, 23, 24, 25, 30, 32 }, + { 2, 4, 10, 11, 13, 15, 19, 20, 23, 24, 25 }, + { 1, 2, 4, 10, 11, 13, 15, 19, 23, 25, 30 }, + { 1, 2, 3, 4, 5, 10, 11, 19, 24, 25, 30 }, + }, + + -- 12-way => + [12] = { + { 1, 2, 4, 5, 6, 10, 11, 13, 15, 19, 24, 30 }, + { 1, 2, 3, 4, 5, 6, 7, 10, 11, 19, 24, 30 }, + { 1, 2, 4, 10, 11, 13, 15, 19, 23, 24, 25, 30 }, + }, + + -- 13-way => + [13] = { + { 2, 3, 4, 6, 7, 17, 19, 23, 26, 27, 29, 30, 32 }, + { 1, 4, 11, 13, 15, 19, 22, 23, 24, 25, 26, 30, 32 }, + { 2, 3, 4, 6, 7, 17, 19, 23, 24, 26, 27, 29, 30 }, + { 1, 2, 3, 4, 6, 7, 10, 11, 13, 19, 23, 24, 30 }, + }, + + -- 14-way => + [14] = { + { 2, 3, 4, 6, 7, 17, 19, 23, 24, 26, 27, 29, 30, 32 }, + { 2, 4, 13, 15, 17, 19, 22, 23, 25, 26, 27, 29, 30, 32 }, + { 1, 2, 3, 4, 6, 7, 11, 13, 19, 23, 24, 26, 30, 32 }, + }, + + -- 15-way => + [15] = { + { 2, 3, 4, 6, 7, 12, 17, 19, 23, 24, 26, 27, 29, 30, 32 }, + { 2, 3, 4, 6, 7, 13, 17, 19, 23, 24, 26, 27, 29, 30, 32 }, + { 2, 4, 13, 15, 17, 19, 22, 23, 24, 25, 26, 27, 29, 30, 32 }, + }, + + -- 16-way => + [16] = { + { 1, 2, 3, 4, 7, 10, 11, 12, 13, 19, 22, 23, 24, 25, 26, 30 }, + { 2, 3, 4, 7, 12, 17, 19, 22, 23, 24, 25, 26, 27, 29, 30, 32 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Melting Glacier.lua b/luarules/configs/ffa_startpoints/Melting Glacier.lua index a0c2aa169ac..17400c50796 100644 --- a/luarules/configs/ffa_startpoints/Melting Glacier.lua +++ b/luarules/configs/ffa_startpoints/Melting Glacier.lua @@ -1,148 +1,148 @@ local startPoints = { - -- islands - [1] = { x = 1557, z = 1246, }, - [2] = { x = 929, z = 3000, }, - [3] = { x = 1419, z = 4651, }, - [4] = { x = 2023, z = 7012, }, - [5] = { x = 2197, z = 9318, }, - [6] = { x = 8715, z = 817, }, - [7] = { x = 9256, z = 2424, }, - [8] = { x = 8905, z = 4422, }, - [9] = { x = 8608, z = 6570, }, - [10] = { x = 8058, z = 8016, }, - -- beaches - [11] = { x = 2844, z = 2392, }, - [12] = { x = 2700, z = 3548, }, - [13] = { x = 3335, z = 5117, }, - [14] = { x = 4017, z = 6324, }, - [15] = { x = 4259, z = 7948, }, - [16] = { x = 6351, z = 7160, }, - [17] = { x = 7097, z = 5799, }, - [18] = { x = 7490, z = 4096, }, - [19] = { x = 7772, z = 2635, }, - [20] = { x = 7295, z = 1273, }, - [21] = { x = 4704, z = 2983, }, - [22] = { x = 5647, z = 2879, }, + -- islands + [1] = { x = 1557, z = 1246 }, + [2] = { x = 929, z = 3000 }, + [3] = { x = 1419, z = 4651 }, + [4] = { x = 2023, z = 7012 }, + [5] = { x = 2197, z = 9318 }, + [6] = { x = 8715, z = 817 }, + [7] = { x = 9256, z = 2424 }, + [8] = { x = 8905, z = 4422 }, + [9] = { x = 8608, z = 6570 }, + [10] = { x = 8058, z = 8016 }, + -- beaches + [11] = { x = 2844, z = 2392 }, + [12] = { x = 2700, z = 3548 }, + [13] = { x = 3335, z = 5117 }, + [14] = { x = 4017, z = 6324 }, + [15] = { x = 4259, z = 7948 }, + [16] = { x = 6351, z = 7160 }, + [17] = { x = 7097, z = 5799 }, + [18] = { x = 7490, z = 4096 }, + [19] = { x = 7772, z = 2635 }, + [20] = { x = 7295, z = 1273 }, + [21] = { x = 4704, z = 2983 }, + [22] = { x = 5647, z = 2879 }, } local byAllyTeamCount = { - -- 3-way => - [3] = { - -- islands - { 1, 5, 6, }, - { 1, 6, 10, }, - { 1, 5, 10, }, - { 5, 6, 10, }, - -- beaches - { 11, 15, 20, }, - { 11, 16, 20, }, - }, + -- 3-way => + [3] = { + -- islands + { 1, 5, 6 }, + { 1, 6, 10 }, + { 1, 5, 10 }, + { 5, 6, 10 }, + -- beaches + { 11, 15, 20 }, + { 11, 16, 20 }, + }, - -- 4-way => - [4] = { - -- islands - { 1, 5, 6, 10, }, - -- beaches - { 12, 14, 17, 19, }, - }, + -- 4-way => + [4] = { + -- islands + { 1, 5, 6, 10 }, + -- beaches + { 12, 14, 17, 19 }, + }, - -- 5-way => - [5] = { - -- islands - { 1, 3, 5, 6, 10, }, - { 1, 5, 6, 8, 10, }, - -- beaches - { 11, 13, 15, 17, 19, }, - { 12, 14, 16, 18, 20, }, - }, + -- 5-way => + [5] = { + -- islands + { 1, 3, 5, 6, 10 }, + { 1, 5, 6, 8, 10 }, + -- beaches + { 11, 13, 15, 17, 19 }, + { 12, 14, 16, 18, 20 }, + }, - -- 6-way => - [6] = { - -- islands - { 1, 3, 5, 6, 8, 10, }, - -- beaches - { 11, 13, 15, 16, 18, 20, }, - }, + -- 6-way => + [6] = { + -- islands + { 1, 3, 5, 6, 8, 10 }, + -- beaches + { 11, 13, 15, 16, 18, 20 }, + }, - -- 7-way => - [7] = { - -- islands - { 1, 2, 4, 5, 6, 8, 10, }, - { 1, 3, 5, 6, 7, 9, 10, }, - -- beaches - { 11, 13, 15, 16, 17, 19, 20, }, - }, + -- 7-way => + [7] = { + -- islands + { 1, 2, 4, 5, 6, 8, 10 }, + { 1, 3, 5, 6, 7, 9, 10 }, + -- beaches + { 11, 13, 15, 16, 17, 19, 20 }, + }, - -- 8-way => - [8] = { - -- islands - { 1, 2, 4, 5, 6, 7, 9, 10, }, - -- beaches - { 11, 12, 14, 15, 16, 17, 19, 20, }, - -- islands + beaches - { 1, 5, 6, 10, 12, 14, 17, 19, }, - }, + -- 8-way => + [8] = { + -- islands + { 1, 2, 4, 5, 6, 7, 9, 10 }, + -- beaches + { 11, 12, 14, 15, 16, 17, 19, 20 }, + -- islands + beaches + { 1, 5, 6, 10, 12, 14, 17, 19 }, + }, - -- 9-way => islands + beaches - [9] = { - { 1, 5, 7, 9, 12, 14, 16, 18, 20, }, - { 2, 4, 6, 10, 11, 13, 15, 17, 19, }, - }, + -- 9-way => islands + beaches + [9] = { + { 1, 5, 7, 9, 12, 14, 16, 18, 20 }, + { 2, 4, 6, 10, 11, 13, 15, 17, 19 }, + }, - -- 10-way => - [10] = { - -- islands - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }, - -- beaches - { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, }, - -- islands + beaches - { 1, 3, 5, 6, 8, 10, 12, 14, 17, 19, }, - { 2, 4, 7, 9, 11, 13, 15, 16, 18, 20, }, - { 1, 3, 5, 7, 9, 12, 14, 16, 18, 20, }, - { 2, 4, 6, 8, 10, 11, 13, 15, 17, 19, }, - }, + -- 10-way => + [10] = { + -- islands + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, + -- beaches + { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }, + -- islands + beaches + { 1, 3, 5, 6, 8, 10, 12, 14, 17, 19 }, + { 2, 4, 7, 9, 11, 13, 15, 16, 18, 20 }, + { 1, 3, 5, 7, 9, 12, 14, 16, 18, 20 }, + { 2, 4, 6, 8, 10, 11, 13, 15, 17, 19 }, + }, - -- 11-way => islands + beaches - [11] = { - { 1, 3, 5, 6, 8, 10, 11, 13, 15, 17, 19, }, - { 1, 3, 5, 6, 8, 10, 12, 14, 16, 18, 20, }, - }, + -- 11-way => islands + beaches + [11] = { + { 1, 3, 5, 6, 8, 10, 11, 13, 15, 17, 19 }, + { 1, 3, 5, 6, 8, 10, 12, 14, 16, 18, 20 }, + }, - -- 12-way => islands + beaches - [12] = { - { 1, 3, 5, 6, 8, 10, 11, 13, 15, 16, 18, 20, }, - }, + -- 12-way => islands + beaches + [12] = { + { 1, 3, 5, 6, 8, 10, 11, 13, 15, 16, 18, 20 }, + }, - -- 13-way => it's a mess - [13] = { - { 1, 3, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20, }, - { 1, 2, 4, 5, 6, 8, 10, 11, 13, 15, 16, 18, 20, }, - { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 20, }, - { 1, 3, 5, 6, 8, 10, 11, 13, 15, 16, 17, 19, 20, }, - }, + -- 13-way => it's a mess + [13] = { + { 1, 3, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20 }, + { 1, 2, 4, 5, 6, 8, 10, 11, 13, 15, 16, 18, 20 }, + { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 20 }, + { 1, 3, 5, 6, 8, 10, 11, 13, 15, 16, 17, 19, 20 }, + }, - -- 14-way => 16-way with 2 of the worst spots removed - [14] = { - { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 19, 20, }, - { 1, 2, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20, }, - }, + -- 14-way => 16-way with 2 of the worst spots removed + [14] = { + { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 19, 20 }, + { 1, 2, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20 }, + }, - -- 15-way => 16-way with 1 of the worst spots removed - [15] = { - { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, }, - { 1, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, }, - { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20, }, - { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 18, 20, }, - }, + -- 15-way => 16-way with 1 of the worst spots removed + [15] = { + { 1, 3, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20 }, + { 1, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20 }, + { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16, 18, 20 }, + { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 18, 20 }, + }, - -- 16-way => islands + beaches - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 18, 20, }, - { 1, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, }, - }, + -- 16-way => islands + beaches + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 18, 20 }, + { 1, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Neurope.lua b/luarules/configs/ffa_startpoints/Neurope.lua index 59132090e18..afa813ee530 100644 --- a/luarules/configs/ffa_startpoints/Neurope.lua +++ b/luarules/configs/ffa_startpoints/Neurope.lua @@ -1,20 +1,20 @@ local startPoints = { - [1] = { x = 5806, z = 7654, }, -- Lombards - [2] = { x = 13084, z = 4324, }, -- Balts - [3] = { x = 4937, z = 4057, }, -- Franks - [4] = { x = 10316, z = 3080, }, -- Saamis - [5] = { x = 1352, z = 2843, }, -- Anglo-Saxons - [6] = { x = 3921, z = 595, }, -- Vikings - [7] = { x = 12398, z = 6744, }, -- Byzantines - [8] = { x = 10238, z = 5110, }, -- Slavs - [9] = { x = 1996, z = 6294, }, -- Visigoths - [10] = { x = 6720, z = 1679, }, -- Norsemen - [11] = { x = 11880, z = 1374, }, -- Finns - [12] = { x = 8566, z = 7611, }, -- Avars - [13] = { x = 7580, z = 4288, }, -- Germanic Tribes - [14] = { x = 15244, z = 6783, }, -- Khazars - [15] = { x = 4276, z = 1940, }, -- Septentrionals - [16] = { x = 15158, z = 1527, }, -- Rus + [1] = { x = 5806, z = 7654 }, -- Lombards + [2] = { x = 13084, z = 4324 }, -- Balts + [3] = { x = 4937, z = 4057 }, -- Franks + [4] = { x = 10316, z = 3080 }, -- Saamis + [5] = { x = 1352, z = 2843 }, -- Anglo-Saxons + [6] = { x = 3921, z = 595 }, -- Vikings + [7] = { x = 12398, z = 6744 }, -- Byzantines + [8] = { x = 10238, z = 5110 }, -- Slavs + [9] = { x = 1996, z = 6294 }, -- Visigoths + [10] = { x = 6720, z = 1679 }, -- Norsemen + [11] = { x = 11880, z = 1374 }, -- Finns + [12] = { x = 8566, z = 7611 }, -- Avars + [13] = { x = 7580, z = 4288 }, -- Germanic Tribes + [14] = { x = 15244, z = 6783 }, -- Khazars + [15] = { x = 4276, z = 1940 }, -- Septentrionals + [16] = { x = 15158, z = 1527 }, -- Rus } --[[ @@ -29,126 +29,126 @@ layouts in order to force scouting (e.g. in some cases there will be nobody in the sea / islands, a fact which needs to be scouted to be taken advantage of). ]] local byAllyTeamCount = { - -- 3-way => - [3] = { - { 1, 2, 3, }, - { 1, 5, 16, }, - }, - - -- 4-way => - [4] = { - { 4, 6, 9, 12, }, - { 1, 3, 4, 7, }, - { 6, 9, 14, 16, }, - { 3, 11, 12, 14, }, - }, - - -- 5-way => - [5] = { - { 1, 4, 5, 7, 16, }, - { 4, 6, 9, 12, 14, }, - { 3, 4, 5, 12, 16, }, - { 6, 9, 11, 12, 14, }, - { 6, 7, 9, 13, 16, }, - { 2, 6, 9, 12, 13, }, - }, - - -- 6-way => - [6] = { - { 3, 5, 6, 11, 12, 14, }, - { 4, 5, 9, 12, 13, 16, }, - { 6, 9, 11, 12, 13, 14, }, - { 5, 9, 11, 12, 13, 14, }, - { 5, 8, 9, 10, 14, 16, }, - }, - - -- 7-way => - [7] = { - { 4, 5, 6, 7, 9, 13, 16, }, - { 5, 6, 9, 11, 12, 13, 14, }, - { 2, 4, 5, 6, 9, 12, 13, }, - { 2, 5, 6, 9, 12, 13, 14, }, - { 2, 5, 9, 10, 12, 13, 14, }, - { 4, 5, 9, 12, 13, 14, 16, }, - { 4, 6, 9, 12, 13, 14, 16, }, - { 9, 10, 11, 12, 13, 14, 16, }, - { 1, 3, 4, 5, 8, 14, 16, }, - }, - - -- 8-way => - [8] = { - { 2, 5, 6, 9, 10, 12, 13, 14, }, - { 1, 3, 5, 6, 8, 10, 11, 14, }, - { 5, 9, 10, 11, 12, 13, 14, 16, }, - { 6, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 3, 4, 5, 8, 12, 14, 16, }, - { 1, 3, 4, 6, 8, 12, 14, 16, }, - { 1, 3, 8, 10, 11, 12, 14, 16, }, - }, - - -- 9-way => - [9] = { - { 5, 6, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 3, 5, 6, 8, 10, 11, 14, 16, }, - { 3, 5, 6, 9, 10, 11, 12, 14, 16, }, - { 1, 3, 4, 5, 6, 8, 12, 14, 16, }, - }, - - -- 10-way => - [10] = { - { 1, 3, 4, 5, 6, 8, 9, 12, 14, 16, }, - { 1, 2, 3, 4, 5, 8, 9, 12, 14, 16, }, - { 1, 2, 3, 4, 6, 8, 9, 12, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 8, 12, 14, 16, }, - }, - - -- 11-way => - [11] = { - { 1, 2, 3, 4, 5, 6, 8, 9, 12, 14, 16, }, - { 1, 3, 5, 7, 8, 9, 10, 11, 12, 14, 16, }, - { 1, 3, 6, 7, 8, 9, 10, 11, 12, 14, 16, }, - { 1, 3, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 12-way => - [12] = { - { 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 16, }, - { 1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 13-way => - [13] = { - { 1, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, }, - { 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, }, - { 1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 16, }, - }, - - -- 14-way => - [14] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 15-way => - [15] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 16-way => - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 3-way => + [3] = { + { 1, 2, 3 }, + { 1, 5, 16 }, + }, + + -- 4-way => + [4] = { + { 4, 6, 9, 12 }, + { 1, 3, 4, 7 }, + { 6, 9, 14, 16 }, + { 3, 11, 12, 14 }, + }, + + -- 5-way => + [5] = { + { 1, 4, 5, 7, 16 }, + { 4, 6, 9, 12, 14 }, + { 3, 4, 5, 12, 16 }, + { 6, 9, 11, 12, 14 }, + { 6, 7, 9, 13, 16 }, + { 2, 6, 9, 12, 13 }, + }, + + -- 6-way => + [6] = { + { 3, 5, 6, 11, 12, 14 }, + { 4, 5, 9, 12, 13, 16 }, + { 6, 9, 11, 12, 13, 14 }, + { 5, 9, 11, 12, 13, 14 }, + { 5, 8, 9, 10, 14, 16 }, + }, + + -- 7-way => + [7] = { + { 4, 5, 6, 7, 9, 13, 16 }, + { 5, 6, 9, 11, 12, 13, 14 }, + { 2, 4, 5, 6, 9, 12, 13 }, + { 2, 5, 6, 9, 12, 13, 14 }, + { 2, 5, 9, 10, 12, 13, 14 }, + { 4, 5, 9, 12, 13, 14, 16 }, + { 4, 6, 9, 12, 13, 14, 16 }, + { 9, 10, 11, 12, 13, 14, 16 }, + { 1, 3, 4, 5, 8, 14, 16 }, + }, + + -- 8-way => + [8] = { + { 2, 5, 6, 9, 10, 12, 13, 14 }, + { 1, 3, 5, 6, 8, 10, 11, 14 }, + { 5, 9, 10, 11, 12, 13, 14, 16 }, + { 6, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 3, 4, 5, 8, 12, 14, 16 }, + { 1, 3, 4, 6, 8, 12, 14, 16 }, + { 1, 3, 8, 10, 11, 12, 14, 16 }, + }, + + -- 9-way => + [9] = { + { 5, 6, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 3, 5, 6, 8, 10, 11, 14, 16 }, + { 3, 5, 6, 9, 10, 11, 12, 14, 16 }, + { 1, 3, 4, 5, 6, 8, 12, 14, 16 }, + }, + + -- 10-way => + [10] = { + { 1, 3, 4, 5, 6, 8, 9, 12, 14, 16 }, + { 1, 2, 3, 4, 5, 8, 9, 12, 14, 16 }, + { 1, 2, 3, 4, 6, 8, 9, 12, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 8, 12, 14, 16 }, + }, + + -- 11-way => + [11] = { + { 1, 2, 3, 4, 5, 6, 8, 9, 12, 14, 16 }, + { 1, 3, 5, 7, 8, 9, 10, 11, 12, 14, 16 }, + { 1, 3, 6, 7, 8, 9, 10, 11, 12, 14, 16 }, + { 1, 3, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 12-way => + [12] = { + { 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 16 }, + { 1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 13-way => + [13] = { + { 1, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16 }, + { 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16 }, + { 1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 16 }, + }, + + -- 14-way => + [14] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 15-way => + [15] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 16-way => + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Omega Valley.lua b/luarules/configs/ffa_startpoints/Omega Valley.lua index dd3bf72ef4b..c59a432f045 100644 --- a/luarules/configs/ffa_startpoints/Omega Valley.lua +++ b/luarules/configs/ffa_startpoints/Omega Valley.lua @@ -1,19 +1,19 @@ local startPoints = { - -- corners - [1] = { x = 1016, z = 1582, }, -- north west - [2] = { x = 7068, z = 1969, }, -- north east - [3] = { x = 7177, z = 6603, }, -- south east - [4] = { x = 1128, z = 6201, }, -- south west + -- corners + [1] = { x = 1016, z = 1582 }, -- north west + [2] = { x = 7068, z = 1969 }, -- north east + [3] = { x = 7177, z = 6603 }, -- south east + [4] = { x = 1128, z = 6201 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Oort Cloud.lua b/luarules/configs/ffa_startpoints/Oort Cloud.lua index 59ddf292c2d..697c8f1bc68 100644 --- a/luarules/configs/ffa_startpoints/Oort Cloud.lua +++ b/luarules/configs/ffa_startpoints/Oort Cloud.lua @@ -1,75 +1,75 @@ local startPoints = { - -- all around - [1] = { x = 1625, z = 1671, }, -- corner north west - [2] = { x = 4657, z = 1689, }, -- edge north west - [3] = { x = 7581, z = 1684, }, -- edge north east - [4] = { x = 10585, z = 1699, }, -- corner north east - [5] = { x = 10556, z = 4512, }, -- edge east north - [6] = { x = 10563, z = 7347, }, -- edge east south - [7] = { x = 10563, z = 10285, }, -- corner south east - [8] = { x = 7587, z = 10280, }, -- edge south east - [9] = { x = 4653, z = 10283, }, -- edge south west - [10] = { x = 1637, z = 10274, }, -- corner south west - [11] = { x = 1630, z = 7348, }, -- edge east south - [12] = { x = 1630, z = 4531, }, -- edge west north - -- center - [13] = { x = 4662, z = 4473, }, -- center north west - [14] = { x = 7606, z = 4451, }, -- center north east - [15] = { x = 7592, z = 7396, }, -- center south east - [16] = { x = 4665, z = 7406, }, -- center south west + -- all around + [1] = { x = 1625, z = 1671 }, -- corner north west + [2] = { x = 4657, z = 1689 }, -- edge north west + [3] = { x = 7581, z = 1684 }, -- edge north east + [4] = { x = 10585, z = 1699 }, -- corner north east + [5] = { x = 10556, z = 4512 }, -- edge east north + [6] = { x = 10563, z = 7347 }, -- edge east south + [7] = { x = 10563, z = 10285 }, -- corner south east + [8] = { x = 7587, z = 10280 }, -- edge south east + [9] = { x = 4653, z = 10283 }, -- edge south west + [10] = { x = 1637, z = 10274 }, -- corner south west + [11] = { x = 1630, z = 7348 }, -- edge east south + [12] = { x = 1630, z = 4531 }, -- edge west north + -- center + [13] = { x = 4662, z = 4473 }, -- center north west + [14] = { x = 7606, z = 4451 }, -- center north east + [15] = { x = 7592, z = 7396 }, -- center south east + [16] = { x = 4665, z = 7406 }, -- center south west } local byAllyTeamCount = { - -- 3-way => all around 3 spots apart - [3] = { - { 1, 5, 9, }, - { 2, 6, 10, }, - { 3, 7, 11, }, - { 4, 8, 12, }, - }, + -- 3-way => all around 3 spots apart + [3] = { + { 1, 5, 9 }, + { 2, 6, 10 }, + { 3, 7, 11 }, + { 4, 8, 12 }, + }, - -- 4-way => - [4] = { - -- all around 2 spots apart - { 1, 4, 7, 10, }, - { 2, 5, 8, 11, }, - { 3, 6, 9, 12, }, - -- center - { 13, 14, 15, 16, }, - }, + -- 4-way => + [4] = { + -- all around 2 spots apart + { 1, 4, 7, 10 }, + { 2, 5, 8, 11 }, + { 3, 6, 9, 12 }, + -- center + { 13, 14, 15, 16 }, + }, - -- 6-way => all around 1 spot apart - [6] = { - { 1, 3, 5, 7, 9, 11, }, - { 2, 4, 6, 8, 10, 12, }, - }, + -- 6-way => all around 1 spot apart + [6] = { + { 1, 3, 5, 7, 9, 11 }, + { 2, 4, 6, 8, 10, 12 }, + }, - -- 8-way => - [8] = { - -- edges - { 2, 3, 5, 6, 8, 9, 11, 12, }, - -- corners + center - { 1, 4, 7, 10, 13, 14, 15, 16, }, - -- check pattern - { 1, 3, 5, 7, 9, 11, 13, 15, }, - { 2, 4, 6, 8, 10, 12, 14, 16, }, - }, + -- 8-way => + [8] = { + -- edges + { 2, 3, 5, 6, 8, 9, 11, 12 }, + -- corners + center + { 1, 4, 7, 10, 13, 14, 15, 16 }, + -- check pattern + { 1, 3, 5, 7, 9, 11, 13, 15 }, + { 2, 4, 6, 8, 10, 12, 14, 16 }, + }, - -- 12-way => - [12] = { - -- all around - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, }, - -- edges + center - { 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, }, - }, + -- 12-way => + [12] = { + -- all around + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, + -- edges + center + { 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16 }, + }, - -- 16-way => all - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 16-way => all + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Red Triangle.lua b/luarules/configs/ffa_startpoints/Red Triangle.lua index 8cdd7e90c75..6c08417aef0 100644 --- a/luarules/configs/ffa_startpoints/Red Triangle.lua +++ b/luarules/configs/ffa_startpoints/Red Triangle.lua @@ -1,46 +1,46 @@ local startPoints = { - -- islands - [1] = { x = 1767, z = 1458, }, -- north west - [2] = { x = 8056, z = 3209, }, -- north east - [3] = { x = 3463, z = 7692, }, -- south - -- corners - [4] = { x = 4356, z = 1798, }, -- north - [5] = { x = 6253, z = 5502, }, -- south east - [6] = { x = 2103, z = 5330, }, -- south west - -- center - [7] = { x = 3166, z = 3510, }, -- north west - [8] = { x = 5675, z = 3706, }, -- north east - [9] = { x = 4124, z = 5630, }, -- south + -- islands + [1] = { x = 1767, z = 1458 }, -- north west + [2] = { x = 8056, z = 3209 }, -- north east + [3] = { x = 3463, z = 7692 }, -- south + -- corners + [4] = { x = 4356, z = 1798 }, -- north + [5] = { x = 6253, z = 5502 }, -- south east + [6] = { x = 2103, z = 5330 }, -- south west + -- center + [7] = { x = 3166, z = 3510 }, -- north west + [8] = { x = 5675, z = 3706 }, -- north east + [9] = { x = 4124, z = 5630 }, -- south } local byAllyTeamCount = { - -- 3-way => - [3] = { - -- islands - { 1, 2, 3, }, - -- corners - { 4, 5, 6, }, - -- center - { 7, 8, 9, }, - }, + -- 3-way => + [3] = { + -- islands + { 1, 2, 3 }, + -- corners + { 4, 5, 6 }, + -- center + { 7, 8, 9 }, + }, - -- 6-way => - [6] = { - -- islands + corners - { 1, 2, 3, 4, 5, 6, }, - -- islands + center - { 1, 2, 3, 7, 8, 9, }, - -- corners + center - { 4, 5, 6, 7, 8, 9, }, - }, + -- 6-way => + [6] = { + -- islands + corners + { 1, 2, 3, 4, 5, 6 }, + -- islands + center + { 1, 2, 3, 7, 8, 9 }, + -- corners + center + { 4, 5, 6, 7, 8, 9 }, + }, - -- 9-way => all - [9] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, }, - }, + -- 9-way => all + [9] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Ring Atoll.lua b/luarules/configs/ffa_startpoints/Ring Atoll.lua index 8a9f98c8bec..fab19f069b9 100644 --- a/luarules/configs/ffa_startpoints/Ring Atoll.lua +++ b/luarules/configs/ffa_startpoints/Ring Atoll.lua @@ -1,31 +1,31 @@ local startPoints = { - -- all around - [1] = { x = 4342, z = 986, }, - [2] = { x = 6341, z = 1525, }, - [3] = { x = 7785, z = 3346, }, - [4] = { x = 7938, z = 5593, }, - [5] = { x = 6688, z = 7558, }, - [6] = { x = 4671, z = 8030, }, - [7] = { x = 2536, z = 7453, }, - [8] = { x = 1124, z = 6061, }, - [9] = { x = 1163, z = 3913, }, - [10] = { x = 2270, z = 1771, }, + -- all around + [1] = { x = 4342, z = 986 }, + [2] = { x = 6341, z = 1525 }, + [3] = { x = 7785, z = 3346 }, + [4] = { x = 7938, z = 5593 }, + [5] = { x = 6688, z = 7558 }, + [6] = { x = 4671, z = 8030 }, + [7] = { x = 2536, z = 7453 }, + [8] = { x = 1124, z = 6061 }, + [9] = { x = 1163, z = 3913 }, + [10] = { x = 2270, z = 1771 }, } local byAllyTeamCount = { - -- 5-way => all around 1 spot apart - [5] = { - { 1, 3, 5, 7, 9, }, - { 2, 4, 6, 8, 10, }, - }, + -- 5-way => all around 1 spot apart + [5] = { + { 1, 3, 5, 7, 9 }, + { 2, 4, 6, 8, 10 }, + }, - -- 10-way => all around - [10] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }, - }, + -- 10-way => all around + [10] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Riverrun.lua b/luarules/configs/ffa_startpoints/Riverrun.lua index 53163e169a5..01e59eb13e6 100644 --- a/luarules/configs/ffa_startpoints/Riverrun.lua +++ b/luarules/configs/ffa_startpoints/Riverrun.lua @@ -1,37 +1,37 @@ local startPoints = { - -- corners - [1] = { x = 3396, z = 957, }, - [2] = { x = 10748, z = 4145, }, - [3] = { x = 8898, z = 11365, }, - [4] = { x = 1539, z = 8123, }, - -- center - [5] = { x = 5850, z = 2609, }, -- inner - [6] = { x = 9162, z = 7335, }, -- outer - [7] = { x = 6433, z = 9680, }, -- inner - [8] = { x = 3140, z = 4969, }, -- outer + -- corners + [1] = { x = 3396, z = 957 }, + [2] = { x = 10748, z = 4145 }, + [3] = { x = 8898, z = 11365 }, + [4] = { x = 1539, z = 8123 }, + -- center + [5] = { x = 5850, z = 2609 }, -- inner + [6] = { x = 9162, z = 7335 }, -- outer + [7] = { x = 6433, z = 9680 }, -- inner + [8] = { x = 3140, z = 4969 }, -- outer } local byAllyTeamCount = { - -- 4-way => - [4] = { - -- corners - { 1, 2, 3, 4, }, - -- center - { 5, 6, 7, 8, }, - }, + -- 4-way => + [4] = { + -- corners + { 1, 2, 3, 4 }, + -- center + { 5, 6, 7, 8 }, + }, - -- 6-way => corners + outer, leaving inner to be fought over - [6] = { - { 1, 2, 3, 4, 5, 7, }, - }, + -- 6-way => corners + outer, leaving inner to be fought over + [6] = { + { 1, 2, 3, 4, 5, 7 }, + }, - -- 8-way => all - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 8, }, - }, + -- 8-way => all + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 8 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Serene Caldera.lua b/luarules/configs/ffa_startpoints/Serene Caldera.lua index db6883c0d8f..accba107908 100644 --- a/luarules/configs/ffa_startpoints/Serene Caldera.lua +++ b/luarules/configs/ffa_startpoints/Serene Caldera.lua @@ -1,129 +1,129 @@ local startPoints = { - -- outer - [1] = { x = 2919, z = 2923, }, - [2] = { x = 4660, z = 1488, }, - [3] = { x = 6544, z = 1257, }, - [4] = { x = 8774, z = 1145, }, - [5] = { x = 11054, z = 1746, }, - [6] = { x = 12938, z = 2691, }, - [7] = { x = 13998, z = 4862, }, - [8] = { x = 14494, z = 7098, }, - [9] = { x = 14081, z = 9792, }, - [10] = { x = 12607, z = 12409, }, - [11] = { x = 10984, z = 14069, }, - [12] = { x = 8788, z = 14317, }, - [13] = { x = 6581, z = 14290, }, - [14] = { x = 4028, z = 13899, }, - [15] = { x = 2548, z = 12619, }, - [16] = { x = 1413, z = 10732, }, - [17] = { x = 874, z = 8100, }, - [18] = { x = 1266, z = 5487, }, - -- inner - [19] = { x = 10012, z = 3338, }, - [20] = { x = 12001, z = 5702, }, - [21] = { x = 12120, z = 8600, }, - [22] = { x = 11713, z = 11093, }, - [23] = { x = 5575, z = 12068, }, - [24] = { x = 3413, z = 9697, }, - [25] = { x = 3352, z = 7013, }, - [26] = { x = 3510, z = 4474, }, + -- outer + [1] = { x = 2919, z = 2923 }, + [2] = { x = 4660, z = 1488 }, + [3] = { x = 6544, z = 1257 }, + [4] = { x = 8774, z = 1145 }, + [5] = { x = 11054, z = 1746 }, + [6] = { x = 12938, z = 2691 }, + [7] = { x = 13998, z = 4862 }, + [8] = { x = 14494, z = 7098 }, + [9] = { x = 14081, z = 9792 }, + [10] = { x = 12607, z = 12409 }, + [11] = { x = 10984, z = 14069 }, + [12] = { x = 8788, z = 14317 }, + [13] = { x = 6581, z = 14290 }, + [14] = { x = 4028, z = 13899 }, + [15] = { x = 2548, z = 12619 }, + [16] = { x = 1413, z = 10732 }, + [17] = { x = 874, z = 8100 }, + [18] = { x = 1266, z = 5487 }, + -- inner + [19] = { x = 10012, z = 3338 }, + [20] = { x = 12001, z = 5702 }, + [21] = { x = 12120, z = 8600 }, + [22] = { x = 11713, z = 11093 }, + [23] = { x = 5575, z = 12068 }, + [24] = { x = 3413, z = 9697 }, + [25] = { x = 3352, z = 7013 }, + [26] = { x = 3510, z = 4474 }, } local byAllyTeamCount = { - -- 3-way => 1 spot more isolated but farther from metal - [3] = { - { 1, 6, 12, }, - { 3, 10, 14, }, - }, + -- 3-way => 1 spot more isolated but farther from metal + [3] = { + { 1, 6, 12 }, + { 3, 10, 14 }, + }, - -- 4-way => corners-ish, distributed equally - [4] = { - { 1, 5, 10, 14, }, - { 19, 22, 23, 26, }, - { 6, 9, 15, 18, }, - }, + -- 4-way => corners-ish, distributed equally + [4] = { + { 1, 5, 10, 14 }, + { 19, 22, 23, 26 }, + { 6, 9, 15, 18 }, + }, - -- 5-way => outer, metal distributed somewhat equally, players closer together get more metal - [5] = { - { 1, 5, 8, 11, 15, }, - { 1, 5, 9, 13, 16, }, - }, + -- 5-way => outer, metal distributed somewhat equally, players closer together get more metal + [5] = { + { 1, 5, 8, 11, 15 }, + { 1, 5, 9, 13, 16 }, + }, - -- 6-way => outer all around 2 spots apart - [6] = { - { 1, 4, 7, 10, 13, 16, }, - }, + -- 6-way => outer all around 2 spots apart + [6] = { + { 1, 4, 7, 10, 13, 16 }, + }, - -- 7-way => outer all around 2 spots apart on one side 1 spot apart on the other - [7] = { - { 1, 4, 6, 9, 11, 14, 16, }, - }, + -- 7-way => outer all around 2 spots apart on one side 1 spot apart on the other + [7] = { + { 1, 4, 6, 9, 11, 14, 16 }, + }, - -- 8-way => - [8] = { - -- outer, tried to balance north / south spots with more space around due to less metal nearby - { 1, 4, 6, 8, 10, 13, 15, 17, }, - -- inner - { 19, 20, 21, 22, 23, 24, 25, 26, }, - }, + -- 8-way => + [8] = { + -- outer, tried to balance north / south spots with more space around due to less metal nearby + { 1, 4, 6, 8, 10, 13, 15, 17 }, + -- inner + { 19, 20, 21, 22, 23, 24, 25, 26 }, + }, - -- 9-way => outer all around 1 spot apart - [9] = { - { 1, 3, 5, 7, 9, 11, 13, 15, 17, }, - { 2, 4, 6, 8, 10, 12, 14, 16, 18, }, - }, + -- 9-way => outer all around 1 spot apart + [9] = { + { 1, 3, 5, 7, 9, 11, 13, 15, 17 }, + { 2, 4, 6, 8, 10, 12, 14, 16, 18 }, + }, - -- 10-way => tried to balance north / south spots with more space around due to less metal nearby - [10] = { - { 3, 12, 19, 20, 21, 22, 23, 24, 25, 26, }, - { 1, 3, 5, 7, 8, 10, 12, 14, 16, 17, }, - }, + -- 10-way => tried to balance north / south spots with more space around due to less metal nearby + [10] = { + { 3, 12, 19, 20, 21, 22, 23, 24, 25, 26 }, + { 1, 3, 5, 7, 8, 10, 12, 14, 16, 17 }, + }, - -- 11-way => 12-way "2-by-2 and 1 sport apart" but one of the worst spots is removed - [11] = { - { 1, 2, 5, 7, 8, 10, 11, 13, 14, 16, 17, }, - { 1, 2, 4, 5, 7, 8, 10, 11, 14, 16, 17, }, - { 1, 2, 4, 5, 7, 8, 10, 13, 14, 16, 17, }, - { 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, }, - }, + -- 11-way => 12-way "2-by-2 and 1 sport apart" but one of the worst spots is removed + [11] = { + { 1, 2, 5, 7, 8, 10, 11, 13, 14, 16, 17 }, + { 1, 2, 4, 5, 7, 8, 10, 11, 14, 16, 17 }, + { 1, 2, 4, 5, 7, 8, 10, 13, 14, 16, 17 }, + { 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17 }, + }, - -- 12-way => - [12] = { - -- outer all around 2-by-2 and 1 spot apart - { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, }, - -- stack 5 on west/east (more metal nearby) then 1 on north/south (less metal nearby but more space) - { 1, 4, 6, 7, 8, 9, 10, 13, 15, 16, 17, 18, }, - }, + -- 12-way => + [12] = { + -- outer all around 2-by-2 and 1 spot apart + { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17 }, + -- stack 5 on west/east (more metal nearby) then 1 on north/south (less metal nearby but more space) + { 1, 4, 6, 7, 8, 9, 10, 13, 15, 16, 17, 18 }, + }, - -- 13-way => 12-way but one of the 4 least worst spot (so not north / south) is added - [13] = { - { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 18, }, - { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 15, 16, 17, }, - { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, }, - { 1, 2, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17, }, - }, + -- 13-way => 12-way but one of the 4 least worst spot (so not north / south) is added + [13] = { + { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 18 }, + { 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 15, 16, 17 }, + { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17 }, + { 1, 2, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17 }, + }, - -- 14-way => 16-way but two of the opposite worst spots are removed - [14] = { - { 1, 2, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 16, 17, }, - { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, }, - }, + -- 14-way => 16-way but two of the opposite worst spots are removed + [14] = { + { 1, 2, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 16, 17 }, + { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18 }, + }, - -- 15-way => 16-way but one of the worst spots is removed - [15] = { - { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, }, - { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, }, - { 1, 2, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, }, - { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, }, - }, + -- 15-way => 16-way but one of the worst spots is removed + [15] = { + { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18 }, + { 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18 }, + { 1, 2, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18 }, + { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17 }, + }, - -- 16-way => all around except worst spots (north / south) - [16] = { - { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, }, - }, + -- 16-way => all around except worst spots (north / south) + [16] = { + { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Sunderance.lua b/luarules/configs/ffa_startpoints/Sunderance.lua index e4c04ca11e7..a0e3515f50a 100644 --- a/luarules/configs/ffa_startpoints/Sunderance.lua +++ b/luarules/configs/ffa_startpoints/Sunderance.lua @@ -1,33 +1,33 @@ local startPoints = { - -- corners - [1] = { x = 1780, z = 683, }, -- north west - [2] = { x = 6719, z = 773, }, -- north east - [3] = { x = 6382, z = 7533, }, -- south east - [4] = { x = 1467, z = 7437, }, -- south west - -- staggered - [5] = { x = 457, z = 1565, }, -- north west west - [6] = { x = 3022, z = 472, }, -- north west east - [7] = { x = 5693, z = 420, }, -- north east - [8] = { x = 7841, z = 3304, }, -- east - [9] = { x = 7746, z = 6606, }, -- south east east - [10] = { x = 5168, z = 7695, }, -- south east west - [11] = { x = 2490, z = 7830, }, -- south west - [12] = { x = 322, z = 4877, }, -- west + -- corners + [1] = { x = 1780, z = 683 }, -- north west + [2] = { x = 6719, z = 773 }, -- north east + [3] = { x = 6382, z = 7533 }, -- south east + [4] = { x = 1467, z = 7437 }, -- south west + -- staggered + [5] = { x = 457, z = 1565 }, -- north west west + [6] = { x = 3022, z = 472 }, -- north west east + [7] = { x = 5693, z = 420 }, -- north east + [8] = { x = 7841, z = 3304 }, -- east + [9] = { x = 7746, z = 6606 }, -- south east east + [10] = { x = 5168, z = 7695 }, -- south east west + [11] = { x = 2490, z = 7830 }, -- south west + [12] = { x = 322, z = 4877 }, -- west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, - -- 8-way => staggered - [8] = { - { 5, 6, 7, 8, 9, 10, 11, 12, }, - }, + -- 8-way => staggered + [8] = { + { 5, 6, 7, 8, 9, 10, 11, 12 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/The Cold Place.lua b/luarules/configs/ffa_startpoints/The Cold Place.lua index f3074198fb6..b57e96617fd 100644 --- a/luarules/configs/ffa_startpoints/The Cold Place.lua +++ b/luarules/configs/ffa_startpoints/The Cold Place.lua @@ -1,36 +1,36 @@ local startPoints = { - -- corners - [1] = { x = 1843, z = 1924, }, -- north west - [2] = { x = 8421, z = 2015, }, -- north east - [3] = { x = 5119, z = 7395, }, -- south - -- staggered - [4] = { x = 3072, z = 2633, }, -- north west - [5] = { x = 7530, z = 2741, }, -- north east - [6] = { x = 5127, z = 6276, }, -- south - -- geo - [7] = { x = 5294, z = 937, }, -- south west - [8] = { x = 8932, z = 5154, }, -- north - [9] = { x = 1629, z = 5782, }, -- south east + -- corners + [1] = { x = 1843, z = 1924 }, -- north west + [2] = { x = 8421, z = 2015 }, -- north east + [3] = { x = 5119, z = 7395 }, -- south + -- staggered + [4] = { x = 3072, z = 2633 }, -- north west + [5] = { x = 7530, z = 2741 }, -- north east + [6] = { x = 5127, z = 6276 }, -- south + -- geo + [7] = { x = 5294, z = 937 }, -- south west + [8] = { x = 8932, z = 5154 }, -- north + [9] = { x = 1629, z = 5782 }, -- south east } local byAllyTeamCount = { - -- 3-way => - [3] = { - -- corners - { 1, 2, 3, }, - -- staggered - { 4, 5, 6, }, - -- geos - { 7, 8, 9, }, - }, + -- 3-way => + [3] = { + -- corners + { 1, 2, 3 }, + -- staggered + { 4, 5, 6 }, + -- geos + { 7, 8, 9 }, + }, - -- 6-way => staggered + geos - [6] = { - { 4, 5, 6, 7, 8, 9, }, - }, + -- 6-way => staggered + geos + [6] = { + { 4, 5, 6, 7, 8, 9 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Throne.lua b/luarules/configs/ffa_startpoints/Throne.lua index f14b425e5b0..1aa8db84c01 100644 --- a/luarules/configs/ffa_startpoints/Throne.lua +++ b/luarules/configs/ffa_startpoints/Throne.lua @@ -1,103 +1,103 @@ local startPoints = { - -- outer - [1] = { x = 1480, z = 2782, }, - [2] = { x = 5331, z = 843, }, - [3] = { x = 10071, z = 2076, }, - [4] = { x = 11354, z = 6600, }, - [5] = { x = 8933, z = 10865, }, - [6] = { x = 4408, z = 11097, }, - [7] = { x = 926, z = 7790, }, - -- middle - [8] = { x = 2604, z = 4947, }, - [9] = { x = 5566, z = 2220, }, - [10] = { x = 9315, z = 4325, }, - [11] = { x = 8728, z = 8340, }, - [12] = { x = 4513, z = 9034, }, - -- inner - [13] = { x = 4105, z = 5691, }, - [14] = { x = 6956, z = 3847, }, - [15] = { x = 7138, z = 7357, }, - -- center - [16] = { x = 6070, z = 5575, }, + -- outer + [1] = { x = 1480, z = 2782 }, + [2] = { x = 5331, z = 843 }, + [3] = { x = 10071, z = 2076 }, + [4] = { x = 11354, z = 6600 }, + [5] = { x = 8933, z = 10865 }, + [6] = { x = 4408, z = 11097 }, + [7] = { x = 926, z = 7790 }, + -- middle + [8] = { x = 2604, z = 4947 }, + [9] = { x = 5566, z = 2220 }, + [10] = { x = 9315, z = 4325 }, + [11] = { x = 8728, z = 8340 }, + [12] = { x = 4513, z = 9034 }, + -- inner + [13] = { x = 4105, z = 5691 }, + [14] = { x = 6956, z = 3847 }, + [15] = { x = 7138, z = 7357 }, + -- center + [16] = { x = 6070, z = 5575 }, } local byAllyTeamCount = { - -- 3-way => inner - [3] = { - { 13, 14, 15, }, - }, + -- 3-way => inner + [3] = { + { 13, 14, 15 }, + }, - -- 4-way => try to distribute on outer ring, balancing access to ramps - [4] = { - { 1, 3, 5, 7, }, - { 1, 3, 5, 6, }, - { 2, 4, 5, 7, }, - }, + -- 4-way => try to distribute on outer ring, balancing access to ramps + [4] = { + { 1, 3, 5, 7 }, + { 1, 3, 5, 6 }, + { 2, 4, 5, 7 }, + }, - -- 5-way => middle - [5] = { - { 8, 9, 10, 11, 12, }, - }, + -- 5-way => middle + [5] = { + { 8, 9, 10, 11, 12 }, + }, - -- 6-way => middle + center - [6] = { - { 8, 9, 10, 11, 12, 16, }, - }, + -- 6-way => middle + center + [6] = { + { 8, 9, 10, 11, 12, 16 }, + }, - -- 7-way => outer - [7] = { - { 1, 2, 3, 4, 5, 6, 7, }, - }, + -- 7-way => outer + [7] = { + { 1, 2, 3, 4, 5, 6, 7 }, + }, - -- 8-way => outer + center - [8] = { - { 1, 2, 3, 4, 5, 6, 7, 16, }, - }, + -- 8-way => outer + center + [8] = { + { 1, 2, 3, 4, 5, 6, 7, 16 }, + }, - -- 9-way => 4-way + 5-way but only keep the best configuration for access to ramps - [9] = { - { 1, 3, 5, 6, 8, 9, 10, 11, 12, }, - }, + -- 9-way => 4-way + 5-way but only keep the best configuration for access to ramps + [9] = { + { 1, 3, 5, 6, 8, 9, 10, 11, 12 }, + }, - -- 10-way => outer + inner - [10] = { - { 1, 2, 3, 4, 5, 6, 7, 13, 14, 15, }, - }, + -- 10-way => outer + inner + [10] = { + { 1, 2, 3, 4, 5, 6, 7, 13, 14, 15 }, + }, - -- 11-way => outer + middle except north spot, which is the least desirable one - [11] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, }, - }, + -- 11-way => outer + middle except north spot, which is the least desirable one + [11] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12 }, + }, - -- 12-way => outer + middle - [12] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, }, - }, + -- 12-way => outer + middle + [12] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }, + }, - -- 13-way => outer + middle + center - [13] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, }, - }, + -- 13-way => outer + middle + center + [13] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 }, + }, - -- 14-way => outer + middle + 2/3 of inner - [14] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, }, - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, }, - }, + -- 14-way => outer + middle + 2/3 of inner + [14] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15 }, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + }, - -- 15-way => outer + middle + inner - [15] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, }, - }, + -- 15-way => outer + middle + inner + [15] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + }, - -- 16-way => all - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 16-way => all + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/To Kill The Middle.lua b/luarules/configs/ffa_startpoints/To Kill The Middle.lua index 2b77f1b8382..f65e84a5f00 100644 --- a/luarules/configs/ffa_startpoints/To Kill The Middle.lua +++ b/luarules/configs/ffa_startpoints/To Kill The Middle.lua @@ -1,104 +1,103 @@ local startPoints = { - -- corners - [1] = { x = 3031, z = 1663, }, -- north west - [2] = { x = 11218, z = 1883, }, -- north east - [3] = { x = 9826, z = 10871, }, -- south east - [4] = { x = 2976, z = 10024, }, -- south west - -- edges - [5] = { x = 9919, z = 6010, }, -- east - [6] = { x = 1918, z = 5111, }, -- west - [7] = { x = 6997, z = 1606, }, -- north - [8] = { x = 5185, z = 11106, }, -- south - -- replacement corner - [9] = { x = 2420, z = 8257, }, -- north west - [10] = { x = 4995, z = 1725, }, - -- missing all around - [11] = { x = 9122, z = 2209, }, - [12] = { x = 10368, z = 4160, }, - [13] = { x = 10157, z = 8437, }, - [14] = { x = 7552, z = 10562, }, - [15] = { x = 1298, z = 6793, }, - [16] = { x = 2663, z = 3350, }, + -- corners + [1] = { x = 3031, z = 1663 }, -- north west + [2] = { x = 11218, z = 1883 }, -- north east + [3] = { x = 9826, z = 10871 }, -- south east + [4] = { x = 2976, z = 10024 }, -- south west + -- edges + [5] = { x = 9919, z = 6010 }, -- east + [6] = { x = 1918, z = 5111 }, -- west + [7] = { x = 6997, z = 1606 }, -- north + [8] = { x = 5185, z = 11106 }, -- south + -- replacement corner + [9] = { x = 2420, z = 8257 }, -- north west + [10] = { x = 4995, z = 1725 }, + -- missing all around + [11] = { x = 9122, z = 2209 }, + [12] = { x = 10368, z = 4160 }, + [13] = { x = 10157, z = 8437 }, + [14] = { x = 7552, z = 10562 }, + [15] = { x = 1298, z = 6793 }, + [16] = { x = 2663, z = 3350 }, } local byAllyTeamCount = { - -- 3-way => 2 corners + 1 edge center - [3] = { - { 1, 4, 5, }, - { 3, 11, 15, }, - { 7, 9, 13, }, - }, - - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, - - -- 5-way => all around 2 spots apart ignoring spot 2 - [5] = { - { 1, 8, 11, 13, 15, }, - { 5, 7, 9, 14, 16, }, - }, - - -- 6-way => corners + west/east - [6] = { - { 1, 2, 3, 4, 5, 6, }, - }, - - -- 7-way => all around 2 or 1 spots apart - [7] = { - { 1, 2, 3, 4, 5, 6, 7, }, - }, - - -- 8-way => all around 1 spot apart - [8] = { - { 1, 2, 3, 5, 6, 7, 8, 9, }, - { 4, 10, 11, 12, 13, 14, 15, 16, }, - }, - - -- 9-way => all around with empty spots in corners or edge centers - [9] = { - { 6, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 10-way => all around with empty spots in corners or edge centers - [10] = { - { 4, 6, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 11-way => starting from 13-way, removing the worst spot - [11] = { - { 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 12-way => starting from 13-way, removing the worst spot - [12] = { - { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 13-way => starting from 14-way, removing the worst spot - [13] = { - { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 14-way => starting from 15-way, removing the worst spot - [14] = { - { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, }, - }, - - -- 15-way => starting from 16-way, removing the worst spot - [15] = { - { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, - - - -- 16-way => all around - [16] = { - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, }, - }, + -- 3-way => 2 corners + 1 edge center + [3] = { + { 1, 4, 5 }, + { 3, 11, 15 }, + { 7, 9, 13 }, + }, + + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, + + -- 5-way => all around 2 spots apart ignoring spot 2 + [5] = { + { 1, 8, 11, 13, 15 }, + { 5, 7, 9, 14, 16 }, + }, + + -- 6-way => corners + west/east + [6] = { + { 1, 2, 3, 4, 5, 6 }, + }, + + -- 7-way => all around 2 or 1 spots apart + [7] = { + { 1, 2, 3, 4, 5, 6, 7 }, + }, + + -- 8-way => all around 1 spot apart + [8] = { + { 1, 2, 3, 5, 6, 7, 8, 9 }, + { 4, 10, 11, 12, 13, 14, 15, 16 }, + }, + + -- 9-way => all around with empty spots in corners or edge centers + [9] = { + { 6, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 10-way => all around with empty spots in corners or edge centers + [10] = { + { 4, 6, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 11-way => starting from 13-way, removing the worst spot + [11] = { + { 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 12-way => starting from 13-way, removing the worst spot + [12] = { + { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 13-way => starting from 14-way, removing the worst spot + [13] = { + { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 14-way => starting from 15-way, removing the worst spot + [14] = { + { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 }, + }, + + -- 15-way => starting from 16-way, removing the worst spot + [15] = { + { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, + + -- 16-way => all around + [16] = { + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Tundra V.lua b/luarules/configs/ffa_startpoints/Tundra V.lua index 6e1eb05bbc8..8c1bffe0377 100644 --- a/luarules/configs/ffa_startpoints/Tundra V.lua +++ b/luarules/configs/ffa_startpoints/Tundra V.lua @@ -4,21 +4,21 @@ config `Tundra`, but since another map named Tundra Continents exists, we had to resort to using `Tundra V`. ]] local startPoints = { - -- corners - [1] = { x = 1641, z = 711, }, -- north west - [2] = { x = 7056, z = 809, }, -- north east - [3] = { x = 6536, z = 7465, }, -- south east - [4] = { x = 1137, z = 7383, }, -- south west + -- corners + [1] = { x = 1641, z = 711 }, -- north west + [2] = { x = 7056, z = 809 }, -- north east + [3] = { x = 6536, z = 7465 }, -- south east + [4] = { x = 1137, z = 7383 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/ffa_startpoints/Valles Marineris.lua b/luarules/configs/ffa_startpoints/Valles Marineris.lua index 6efb10bcf16..f712005052a 100644 --- a/luarules/configs/ffa_startpoints/Valles Marineris.lua +++ b/luarules/configs/ffa_startpoints/Valles Marineris.lua @@ -1,19 +1,19 @@ local startPoints = { - -- corners - [1] = { x = 648, z = 377, }, -- north west - [2] = { x = 7532, z = 365, }, -- north east - [3] = { x = 7450, z = 5453, }, -- south east - [4] = { x = 750, z = 5445, }, -- south west + -- corners + [1] = { x = 648, z = 377 }, -- north west + [2] = { x = 7532, z = 365 }, -- north east + [3] = { x = 7450, z = 5453 }, -- south east + [4] = { x = 750, z = 5445 }, -- south west } local byAllyTeamCount = { - -- 4-way => corners - [4] = { - { 1, 2, 3, 4, }, - }, + -- 4-way => corners + [4] = { + { 1, 2, 3, 4 }, + }, } return { - startPoints = startPoints, - byAllyTeamCount = byAllyTeamCount + startPoints = startPoints, + byAllyTeamCount = byAllyTeamCount, } diff --git a/luarules/configs/gui_soundeffects.lua b/luarules/configs/gui_soundeffects.lua index 433b750626d..21abab5f887 100644 --- a/luarules/configs/gui_soundeffects.lua +++ b/luarules/configs/gui_soundeffects.lua @@ -1,70 +1,70 @@ local LootboxSoundEffects = { - BaseSoundSelectType = "arm-bld-select", - --BaseSoundMovementType = "blanksound", - BaseSoundWeaponType = "arm-bld-nrg-fusion", + BaseSoundSelectType = "arm-bld-select", + --BaseSoundMovementType = "blanksound", + BaseSoundWeaponType = "arm-bld-nrg-fusion", } local LootboxNanoSoundEffects = { - BaseSoundSelectType = "arm-bld-select-small", - --BaseSoundMovementType = "blanksound", - BaseSoundWeaponType = "conalt-medium", + BaseSoundSelectType = "arm-bld-select-small", + --BaseSoundMovementType = "blanksound", + BaseSoundWeaponType = "conalt-medium", } GUIUnitSoundEffects = { -- ARMADA COMMANDER armcom = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl2 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl3 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl4 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl5 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl6 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl7 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl8 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl9 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armcomlvl10 = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, armdecom = { BaseSoundSelectType = "arm-com-sel", - BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4", }, + BaseSoundMovementType = { "arm-com-ok-1", "arm-com-ok-2", "arm-com-ok-3", "arm-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, @@ -74,8 +74,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-small", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-radar", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armfrad = { @@ -88,8 +88,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "torpedo-small", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armjamt = { @@ -102,32 +102,32 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-mex", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, armamex = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "cloak", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, armmakr = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, armfmkr = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, armwin = { @@ -146,7 +146,7 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-nrghum", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-solar-alt", - BaseSoundActivate = "arm-bld-solar-activate", + BaseSoundActivate = "arm-bld-solar-activate", BaseSoundDeactivate = "arm-bld-solar-deactivate", }, @@ -326,8 +326,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-radar-alt-t2", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armveil = { @@ -346,56 +346,56 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-large", --BaseSoundMovementType = "", BaseSoundWeaponType = "targeting", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armfatf = { BaseSoundSelectType = "arm-bld-select-large-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "targeting", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armmoho = { BaseSoundSelectType = "arm-bld-select-large", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metal-t2", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, armshockwave = { BaseSoundSelectType = "arm-bld-select-large", --BaseSoundMovementType = "", BaseSoundWeaponType = "emp-rocket", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, armuwmme = { BaseSoundSelectType = "arm-sub-medium-sel", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metal-t2", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, armmmkr = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker-t2", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, armuwmmm = { BaseSoundSelectType = "arm-bld-select-large-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker-t2", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, armuwadvms = { @@ -522,8 +522,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-defense-action-t2", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-ics", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, armgate = { @@ -568,7 +568,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "arm-bld-lolcannon", }, - -- ARMADA FACTORIES armlab = { @@ -614,21 +613,21 @@ GUIUnitSoundEffects = { }, armsy = { - BaseSoundSelectType = "arm-bld-factory", + BaseSoundSelectType = "arm-bld-factory", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-water", + BaseSoundWeaponType = "arm-bld-factory-water", }, armasy = { - BaseSoundSelectType = "arm-bld-factory-t2", + BaseSoundSelectType = "arm-bld-factory-t2", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-water-t2", + BaseSoundWeaponType = "arm-bld-factory-water-t2", }, armamsub = { - BaseSoundSelectType = "arm-bld-factory-t2", + BaseSoundSelectType = "arm-bld-factory-t2", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-t2-uw", + BaseSoundWeaponType = "arm-bld-factory-t2-uw", }, armhp = { @@ -1219,57 +1218,57 @@ GUIUnitSoundEffects = { -- CORTEX COMMANDER corcom = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl2 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl3 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl4 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl5 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl6 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl7 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl8 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl9 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, corcomlvl10 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, cordecom = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "laser-tiny", }, @@ -1279,24 +1278,24 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-small", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-radar", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corfrad = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-radar-sonar", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corsonar = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "torpedo-small", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corjamt = { @@ -1309,40 +1308,40 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-mex", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, corexp = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "laser-small-cor", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, coramex = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "cloak", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, cormakr = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, corfmkr = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, corwin = { @@ -1550,8 +1549,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-radar-alt-t2", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corshroud = { @@ -1570,55 +1569,55 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-large", --BaseSoundMovementType = "", BaseSoundWeaponType = "targeting", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corfatf = { BaseSoundSelectType = "arm-bld-select-large-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "targeting", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, cormoho = { BaseSoundSelectType = "arm-bld-select-large", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metal-t2", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", + }, + cormexp = { + BaseSoundSelectType = "arm-bld-metal", + --BaseSoundMovementType = "", + BaseSoundWeaponType = "laser-large", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, - cormexp = { - BaseSoundSelectType = "arm-bld-metal", - --BaseSoundMovementType = "", - BaseSoundWeaponType = "laser-large", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", - }, coruwmme = { BaseSoundSelectType = "arm-sub-medium-sel", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metal-t2", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, cormmkr = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker-t2", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, coruwmmm = { BaseSoundSelectType = "arm-bld-select-large-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker-t2", - BaseSoundActivate = "cor-bld-mm-t2-activate", - BaseSoundDeactivate = "cor-bld-mm-t2-deactivate", + BaseSoundActivate = "cor-bld-mm-t2-activate", + BaseSoundDeactivate = "cor-bld-mm-t2-deactivate", }, coruwadvms = { @@ -1733,8 +1732,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-defense-action-t2", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-ics", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, corgate = { @@ -1779,7 +1778,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "arm-bld-lolcannon", }, - -- CORTEX FACTORIES corlab = { @@ -1819,21 +1817,21 @@ GUIUnitSoundEffects = { }, corsy = { - BaseSoundSelectType = "arm-bld-factory", + BaseSoundSelectType = "arm-bld-factory", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-water", + BaseSoundWeaponType = "arm-bld-factory-water", }, corasy = { - BaseSoundSelectType = "arm-bld-factory-t2", + BaseSoundSelectType = "arm-bld-factory-t2", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-water-t2", + BaseSoundWeaponType = "arm-bld-factory-water-t2", }, coramsub = { - BaseSoundSelectType = "arm-bld-factory-t2", + BaseSoundSelectType = "arm-bld-factory-t2", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-t2-uw", + BaseSoundWeaponType = "arm-bld-factory-t2-uw", }, corhp = { @@ -2082,7 +2080,7 @@ GUIUnitSoundEffects = { }, corkorg = { BaseSoundSelectType = "cor-korg-sel", - BaseSoundMovementType = { "cor-korg-ok1", "cor-korg-ok2", "cor-korg-ok3", }, + BaseSoundMovementType = { "cor-korg-ok1", "cor-korg-ok2", "cor-korg-ok3" }, BaseSoundWeaponType = "heatray-xl", }, cordemon = { @@ -2472,73 +2470,73 @@ GUIUnitSoundEffects = { -- LEGION COMMANDER legdecom = { - BaseSoundSelectType = { "leg-com-sel-1", "leg-com-sel-2", "leg-com-sel-3", }, - BaseSoundMovementType = { "leg-com-ok-1", "leg-com-ok-2", }, + BaseSoundSelectType = { "leg-com-sel-1", "leg-com-sel-2", "leg-com-sel-3" }, + BaseSoundMovementType = { "leg-com-ok-1", "leg-com-ok-2" }, BaseSoundWeaponType = "fastemg-small", }, legdecomlvl3 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legdecomlvl6 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legdecomlvl10 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcom = { - BaseSoundSelectType = { "leg-com-sel-1", "leg-com-sel-2", "leg-com-sel-3", }, - BaseSoundMovementType = { "leg-com-ok-1", "leg-com-ok-2", }, + BaseSoundSelectType = { "leg-com-sel-1", "leg-com-sel-2", "leg-com-sel-3" }, + BaseSoundMovementType = { "leg-com-ok-1", "leg-com-ok-2" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl2 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl3 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl4 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl5 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl6 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl7 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl8 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl9 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, legcomlvl10 = { BaseSoundSelectType = "cor-com-sel", - BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4", }, + BaseSoundMovementType = { "cor-com-ok-1", "cor-com-ok-2", "cor-com-ok-3", "cor-com-ok-4" }, BaseSoundWeaponType = "fastemg-small", }, @@ -2610,8 +2608,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-select-small-water", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, legfdrag = { BaseSoundSelectType = "arm-bld-select", @@ -2629,15 +2627,15 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-mex", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, legmext15 = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-mex", - BaseSoundActivate = "mexon", - BaseSoundDeactivate = "mexoff", + BaseSoundActivate = "mexon", + BaseSoundDeactivate = "mexoff", }, leghive = { BaseSoundSelectType = "arm-bld-factory-t2", @@ -2675,8 +2673,8 @@ GUIUnitSoundEffects = { legrad = { BaseSoundSelectType = "arm-bld-select-small", BaseSoundWeaponType = "arm-bld-radar", - BaseSoundActivate = "cmd-on", - BaseSoundDeactivate = "cmd-off", + BaseSoundActivate = "cmd-on", + BaseSoundDeactivate = "cmd-off", }, legjam = { BaseSoundSelectType = "arm-bld-select-small", @@ -2710,8 +2708,8 @@ GUIUnitSoundEffects = { BaseSoundSelectType = "arm-bld-metal", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-metalmaker", - BaseSoundActivate = "arm-bld-mm-activate", - BaseSoundDeactivate = "arm-bld-mm-deactivate", + BaseSoundActivate = "arm-bld-mm-activate", + BaseSoundDeactivate = "arm-bld-mm-deactivate", }, leggeo = { BaseSoundSelectType = "arm-bld-select-medium", @@ -2734,7 +2732,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "nuke-anti", }, - -- LEGION T2 BUILDINGS legstarfall = { @@ -2795,7 +2792,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "arm-bld-wall-t2", }, - -- LEGION FACTORIES leglab = { BaseSoundSelectType = "arm-bld-factory", @@ -2808,9 +2804,9 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "arm-bld-lab-t2", }, legamsub = { - BaseSoundSelectType = "arm-bld-factory-t2", + BaseSoundSelectType = "arm-bld-factory-t2", --BaseSoundMovementType = "", - BaseSoundWeaponType = "arm-bld-factory-t2-uw", + BaseSoundWeaponType = "arm-bld-factory-t2-uw", }, legvp = { BaseSoundSelectType = "arm-bld-factory", @@ -2848,12 +2844,11 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "arm-bld-factory-hover-water", }, - legsolar = { BaseSoundSelectType = "arm-bld-nrghum", --BaseSoundMovementType = "", BaseSoundWeaponType = "arm-bld-solar-alt", - BaseSoundActivate = "arm-bld-solar-activate", + BaseSoundActivate = "arm-bld-solar-activate", BaseSoundDeactivate = "arm-bld-solar-deactivate", }, legadvsol = { @@ -3117,12 +3112,11 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "plasma-medium-alt", }, - -- LEGION T3 UNITS legeheatraymech = { BaseSoundSelectType = "leg-t3u-mech-sel", - BaseSoundMovementType = { "leg-t3u-mech-ok-1", "leg-t3u-mech-ok-2", }, + BaseSoundMovementType = { "leg-t3u-mech-ok-1", "leg-t3u-mech-ok-2" }, BaseSoundWeaponType = "heatray4burn", }, legeshotgunmech = { @@ -3143,8 +3137,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "lrpc", }, - - -- LEGION AIRCRAFT legca = { BaseSoundSelectType = "arm-air-small-sel", @@ -3229,7 +3221,7 @@ GUIUnitSoundEffects = { legstronghold = { BaseSoundSelectType = "arm-air-transport-large-sel", BaseSoundMovementType = "arm-air-transport-large-ok", - BaseSoundWeaponType = "fastemg-medium",--transport-large ? + BaseSoundWeaponType = "fastemg-medium", --transport-large ? }, legwhisper = { BaseSoundSelectType = "arm-air-medium-sel", @@ -3263,17 +3255,16 @@ GUIUnitSoundEffects = { legmoho = { BaseSoundSelectType = "arm-bld-select-large", BaseSoundWeaponType = "arm-bld-metal-t2", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, legmohobp = { BaseSoundSelectType = "arm-bld-select-large", BaseSoundWeaponType = "conalt-small", - BaseSoundActivate = "mohorun1", - BaseSoundDeactivate = "mohooff1", + BaseSoundActivate = "mohorun1", + BaseSoundDeactivate = "mohooff1", }, - -- LEGION HOVERCRAFT legsh = { @@ -3328,8 +3319,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "mine-large", }, - - --Various Random Units freefusion = { @@ -3380,7 +3369,6 @@ GUIUnitSoundEffects = { BaseSoundWeaponType = "heatray-xl", }, - armgplat = {}, corgplat = {}, dbg_sphere = {}, @@ -3422,34 +3410,31 @@ GUIUnitSoundEffects = { scavmistxl = {}, scavmistxxl = {}, - - lootboxbronze = LootboxSoundEffects, - lootboxsilver = LootboxSoundEffects, - lootboxgold = LootboxSoundEffects, - lootboxplatinum = LootboxSoundEffects, - lootboxnano_t1_var1 = LootboxNanoSoundEffects, - lootboxnano_t1_var2 = LootboxNanoSoundEffects, - lootboxnano_t1_var3 = LootboxNanoSoundEffects, - lootboxnano_t1_var4 = LootboxNanoSoundEffects, - lootboxnano_t2_var1 = LootboxNanoSoundEffects, - lootboxnano_t2_var2 = LootboxNanoSoundEffects, - lootboxnano_t2_var3 = LootboxNanoSoundEffects, - lootboxnano_t2_var4 = LootboxNanoSoundEffects, - lootboxnano_t3_var1 = LootboxNanoSoundEffects, - lootboxnano_t3_var2 = LootboxNanoSoundEffects, - lootboxnano_t3_var3 = LootboxNanoSoundEffects, - lootboxnano_t3_var4 = LootboxNanoSoundEffects, - lootboxnano_t4_var1 = LootboxNanoSoundEffects, - lootboxnano_t4_var2 = LootboxNanoSoundEffects, - lootboxnano_t4_var3 = LootboxNanoSoundEffects, - lootboxnano_t4_var4 = LootboxNanoSoundEffects, - + lootboxbronze = LootboxSoundEffects, + lootboxsilver = LootboxSoundEffects, + lootboxgold = LootboxSoundEffects, + lootboxplatinum = LootboxSoundEffects, + lootboxnano_t1_var1 = LootboxNanoSoundEffects, + lootboxnano_t1_var2 = LootboxNanoSoundEffects, + lootboxnano_t1_var3 = LootboxNanoSoundEffects, + lootboxnano_t1_var4 = LootboxNanoSoundEffects, + lootboxnano_t2_var1 = LootboxNanoSoundEffects, + lootboxnano_t2_var2 = LootboxNanoSoundEffects, + lootboxnano_t2_var3 = LootboxNanoSoundEffects, + lootboxnano_t2_var4 = LootboxNanoSoundEffects, + lootboxnano_t3_var1 = LootboxNanoSoundEffects, + lootboxnano_t3_var2 = LootboxNanoSoundEffects, + lootboxnano_t3_var3 = LootboxNanoSoundEffects, + lootboxnano_t3_var4 = LootboxNanoSoundEffects, + lootboxnano_t4_var1 = LootboxNanoSoundEffects, + lootboxnano_t4_var2 = LootboxNanoSoundEffects, + lootboxnano_t4_var3 = LootboxNanoSoundEffects, + lootboxnano_t4_var4 = LootboxNanoSoundEffects, coruwgeo = corgeo, coruwageo = corageo, armuwgeo = armgeo, armuwageo = armageo, - } local scavCopies = {} @@ -3478,7 +3463,7 @@ for _, udef in pairs(UnitDefs) do BaseSoundMovementType = "cor-bot-medium-ok", } else - if math.random(0,1) == 0 then + if math.random(0, 1) == 0 then --Spring.Echo("[RESPONSEDOUND FALLBACK]: OTHER, RANDOM ARMADA", udef.name) GUIUnitSoundEffects[udef.name] = { BaseSoundSelectType = "arm-bot-small-sel", diff --git a/luarules/configs/icon_generator.lua b/luarules/configs/icon_generator.lua index 94b21f979d5..cdafb31a7c8 100644 --- a/luarules/configs/icon_generator.lua +++ b/luarules/configs/icon_generator.lua @@ -4,13 +4,11 @@ -- Icon Generator Config File -- - - --// Info if info then local ratios = { [""] = (1 / 1) } -- {["16to10"]=(10/16), ["1to1"]=(1/1), ["5to4"]=(4/5)} --, ["4to3"]=(3/4)} - local resolutions = { { 256, 256 }, {400, 400} } -- {{128,128},{64,64}} -- NOTE: setting too high will crash spring - local schemes = { "" } --, "cor"} + local resolutions = { { 256, 256 }, { 400, 400 } } -- {{128,128},{64,64}} -- NOTE: setting too high will crash spring + local schemes = { "" } --, "cor"} return schemes, resolutions, ratios end @@ -19,7 +17,7 @@ end ----------------------------------------------------------------------- --// filename ext -imageExt = ".png" -- unfortumnately .dds wont be with mipmaps +imageExt = ".png" -- unfortumnately .dds wont be with mipmaps --// render into a fbo in 4x size renderScale = 4 @@ -36,18 +34,17 @@ factionTeams = { -- Gets scheme from gadget when this is included factionColors = function(faction) - color = { arm = { 0.08, 0.17, 1.0 }, --// armada cor = { 1.0, 0.03, 0.0 }, --// cortex raptor = { 0.8, 0.53, 0.07 }, --// raptor scav = { 0.38, 0, 0.38 }, --// scavengers - legion = {0, 1, 0}, --// legion + legion = { 0, 1, 0 }, --// legion unknown = { 0.03, 1, 0.03 }, --// unknown Blue = { 0, 0, 0 }, - Red = { 1, 1, 1 } + Red = { 1, 1, 1 }, } - Spring.Echo('Queried faction: ' .. faction .. ', scheme: ' .. scheme) + Spring.Echo("Queried faction: " .. faction .. ", scheme: " .. scheme) if color[faction] then return color[faction] @@ -55,10 +52,9 @@ factionColors = function(faction) if color[scheme] then return color[scheme] else - return color['unknown'] + return color["unknown"] end end - end ----------------------------------------------------------------------- @@ -97,7 +93,6 @@ local IconConfig = { olTolerance = 0, halo = false, - }, } @@ -114,7 +109,6 @@ olContrast = IconConfig[selConfig].olContrast olTolerance = IconConfig[selConfig].olTolerance halo = IconConfig[selConfig].halo - ----------------------------------------------------------------------- ----------------------------------------------------------------------- @@ -124,22 +118,22 @@ local water = "LuaRules/Images/bg_water.png" local builder = "LuaRules/Images/constructionunit.png" local function Greater30(a) - return a > 30; + return a > 30 end local function GreaterEq15(a) - return a >= 15; + return a >= 15 end local function GreaterZero(a) - return a > 0; + return a > 0 end local function GreaterEqZero(a) - return a >= 0; + return a >= 0 end local function GreaterFour(a) - return a > 4; + return a > 4 end local function LessEqZero(a) - return a <= 0; + return a <= 0 end backgrounds = { @@ -149,11 +143,9 @@ backgrounds = { --{check={isBuilder=true,canMove = true},texture=builder}, } - ----------------------------------------------------------------------- ----------------------------------------------------------------------- - local Default = { -- default settings for rendering -- zoom := used to make all model icons same in size (DON'T USE, it is just for auto-configuration!) @@ -188,19 +180,16 @@ local Default = { [2] = {}, [3] = {}, [4] = {}, - } defaults = Default[1] - ----------------------------------------------------------------------- ----------------------------------------------------------------------- --// per unitdef settings unitConfigs = { - [UnitDefNames.cormex.id] = { clamp = 0, unfold = true, @@ -270,7 +259,6 @@ unitConfigs = { [UnitDefNames.armplat.id] = { wait = 65, }, - } for i = 1, #UnitDefs do diff --git a/luarules/configs/map_biomes.lua b/luarules/configs/map_biomes.lua index ec2aeb54603..d5c7eab5e9b 100644 --- a/luarules/configs/map_biomes.lua +++ b/luarules/configs/map_biomes.lua @@ -1,5 +1,5 @@ -snowKeywords = {'argent strata','boreal falls','snow','frozen','cold','winter','ice','icy','arctic','frost','melt','glacier','glacial','mosh_pit','blindside','northernmountains','amarante','cervino','avalanche'} +snowKeywords = { "argent strata", "boreal falls", "snow", "frozen", "cold", "winter", "ice", "icy", "arctic", "frost", "melt", "glacier", "glacial", "mosh_pit", "blindside", "northernmountains", "amarante", "cervino", "avalanche" } snowMaps = {} -- disable for maps that have a keyword but are not snowmaps -snowMaps['sacrifice_v1'] = false +snowMaps["sacrifice_v1"] = false diff --git a/luarules/configs/onoffdescs.lua b/luarules/configs/onoffdescs.lua index 6f9672d6a62..e58b8a3238d 100644 --- a/luarules/configs/onoffdescs.lua +++ b/luarules/configs/onoffdescs.lua @@ -1,17 +1,17 @@ cmdArray = { trajectory = { - name = "Low Trajectory/High Trajectory", - action = "customOnOff.trajectory", - params = { '0', "customOnOff.lowTrajectory", "customOnOff.highTrajectory" } + name = "Low Trajectory/High Trajectory", + action = "customOnOff.trajectory", + params = { "0", "customOnOff.lowTrajectory", "customOnOff.highTrajectory" }, }, siege = { - name = "Suppressive Fire/Siege Mode", - action = "customOnOff.siege", - params = { '0', "customOnOff.suppressiveFire", "customOnOff.siegeMode" } + name = "Suppressive Fire/Siege Mode", + action = "customOnOff.siege", + params = { "0", "customOnOff.suppressiveFire", "customOnOff.siegeMode" }, }, dreadshot = { - name = "Normal/Overcharge", - action = "customOnOff.dreadshot", - params = { '0', "customOnOff.overcharge", "customOnOff.dreadshot" } + name = "Normal/Overcharge", + action = "customOnOff.dreadshot", + params = { "0", "customOnOff.overcharge", "customOnOff.dreadshot" }, }, } diff --git a/luarules/configs/powerusers.lua b/luarules/configs/powerusers.lua index 70414251b17..7ae499cfa34 100644 --- a/luarules/configs/powerusers.lua +++ b/luarules/configs/powerusers.lua @@ -2,7 +2,7 @@ local everything = { give = true, undo = true, cmd = true, - devhelpers = true, -- catch-all for all dev helper commands + devhelpers = true, -- catch-all for all dev helper commands -- granular devhelper sub-permissions (checked when devhelpers is false): -- devhelpers_units = true, -- givecat, xpunits, destroyunits, removeunits, reclaimunits, transferunits, wreckunits, spawnceg, spawnunitexplosion, removeunitdef -- devhelpers_teams = true, -- playertoteam, killteam @@ -30,15 +30,15 @@ local eventmanager = { undo = true, cmd = false, devhelpers = false, - devhelpers_units = true, -- givecat, xpunits, destroyunits, removeunits, reclaimunits, transferunits, wreckunits, spawnceg, spawnunitexplosion, removeunitdef - devhelpers_teams = true, -- playertoteam, killteam + devhelpers_units = true, -- givecat, xpunits, destroyunits, removeunits, reclaimunits, transferunits, wreckunits, spawnceg, spawnunitexplosion, removeunitdef + devhelpers_teams = true, -- playertoteam, killteam playerdata = false, waterlevel = true, modmarker = true, sysinfo = false, volcano = true, } -local singleplayer = { -- note: these permissions override others when singleplayer +local singleplayer = { -- note: these permissions override others when singleplayer give = true, undo = true, cmd = true, @@ -60,41 +60,38 @@ local trustedNames = { return { trustedNames = trustedNames, - [-1] = singleplayer, -- SPECIAL NAME/ADDITION: dont change it + [-1] = singleplayer, -- SPECIAL NAME/ADDITION: dont change it -- admins - [112] = everything, -- [teh]Flow - [4430] = everything, -- Floris - [2585] = everything, -- IceXuick - [1214] = everything, -- [teh]Beherith - [1172] = everything, -- PtaQ - [2260] = everything, -- TarnishedKnight - [84658] = everything, -- OPman - [51535] = everything, -- Nightmare2512 - [130329] = everything, -- SethDGamre - [36669] = everything, -- Steel - [197109] = everything, -- Gabba_Gandalf - [57158] = everything, -- Endorphins + [112] = everything, -- [teh]Flow + [4430] = everything, -- Floris + [2585] = everything, -- IceXuick + [1214] = everything, -- [teh]Beherith + [1172] = everything, -- PtaQ + [2260] = everything, -- TarnishedKnight + [84658] = everything, -- OPman + [51535] = everything, -- Nightmare2512 + [130329] = everything, -- SethDGamre + [36669] = everything, -- Steel + [197109] = everything, -- Gabba_Gandalf + [57158] = everything, -- Endorphins -- moderator - [3] = moderator, -- Teifion - [3133] = moderator, -- Lexon - [258984] = moderator, -- ScavengersOffenseAI - [22297] = moderator, -- Shadhunter - [125301] = moderator, -- DeviousNull - [128743] = moderator, -- Pooman - [57869] = moderator, -- [BAC]SnekVonPess - [21114] = moderator, -- [FH]Amojini - [168817] = moderator, -- SongbirdOfChirping - [88808] = moderator, -- Shadowisperke - [591000] = moderator, -- krolya - [4102] = moderator, -- KayZee + [3] = moderator, -- Teifion + [3133] = moderator, -- Lexon + [258984] = moderator, -- ScavengersOffenseAI + [22297] = moderator, -- Shadhunter + [125301] = moderator, -- DeviousNull + [128743] = moderator, -- Pooman + [57869] = moderator, -- [BAC]SnekVonPess + [21114] = moderator, -- [FH]Amojini + [168817] = moderator, -- SongbirdOfChirping + [88808] = moderator, -- Shadowisperke + [591000] = moderator, -- krolya + [4102] = moderator, -- KayZee -- event manager - [132545] = eventmanager, -- Praedyth (KOTH organizer) - [136110] = eventmanager, -- TANKTOM (KOTH organizer) - [78506] = eventmanager, -- Twig (KOTH organizer) + [132545] = eventmanager, -- Praedyth (KOTH organizer) + [136110] = eventmanager, -- TANKTOM (KOTH organizer) + [78506] = eventmanager, -- Twig (KOTH organizer) } - - - diff --git a/luarules/configs/quick_start_build_defs.lua b/luarules/configs/quick_start_build_defs.lua index 71753bdd287..cd714aca3a7 100644 --- a/luarules/configs/quick_start_build_defs.lua +++ b/luarules/configs/quick_start_build_defs.lua @@ -1,8 +1,23 @@ local quickStartConfig = { discountableFactories = { - armap = true, armfhp = true, armhp = true, armlab = true, armsy = true, armvp = true, - corap = true, corfhp = true, corhp = true, corlab = true, corsy = true, corvp = true, - legap = true, legfhp = true, leghp = true, leglab = true, legsy = true, legvp = true, + armap = true, + armfhp = true, + armhp = true, + armlab = true, + armsy = true, + armvp = true, + corap = true, + corfhp = true, + corhp = true, + corlab = true, + corsy = true, + corvp = true, + legap = true, + legfhp = true, + leghp = true, + leglab = true, + legsy = true, + legvp = true, }, commanderNonLabOptions = { armcom = { @@ -34,7 +49,7 @@ local quickStartConfig = { floatingConverter = "legfeconv", landEnergyStorage = "legestor", waterEnergyStorage = "leguwestore", - } + }, }, optionsToNodeType = { windmill = "other", @@ -78,7 +93,7 @@ local quickStartConfig = { "mex", "mex", "solar", - } + }, }, ["water"] = { ["badWind"] = { @@ -108,8 +123,8 @@ local quickStartConfig = { "mex", "tidal", "waterEnergyStorage", - } - } + }, + }, }, ["nonMetalMap"] = { ["land"] = { @@ -146,7 +161,7 @@ local quickStartConfig = { "windmill", "windmill", "converter", - } + }, }, ["water"] = { ["badWind"] = { @@ -178,11 +193,10 @@ local quickStartConfig = { "tidal", "tidal", "tidal", - } - } - } - } + }, + }, + }, + }, } return quickStartConfig - diff --git a/luarules/configs/raptor_spawn_defs.lua b/luarules/configs/raptor_spawn_defs.lua index e42983140b0..dcecaa6b6ae 100644 --- a/luarules/configs/raptor_spawn_defs.lua +++ b/luarules/configs/raptor_spawn_defs.lua @@ -1,159 +1,153 @@ - local difficulties = { veryeasy = 1, - easy = 2, - normal = 3, - hard = 4, + easy = 2, + normal = 3, + hard = 4, veryhard = 5, - epic = 6, + epic = 6, --survival = 6, } local difficulty = difficulties[Spring.GetModOptions().raptor_difficulty] -local economyScale = 1 * Spring.GetModOptions().multiplier_resourceincome * -(0.67+(Spring.GetModOptions().multiplier_metalextraction*0.33)) * -(0.67+(Spring.GetModOptions().multiplier_energyconversion*0.33)) * -(0.67+(Spring.GetModOptions().multiplier_energyproduction*0.33)) * -(((((Spring.GetModOptions().startmetal - 1000) / 9000) + 1)*0.1)+0.9) * -(((((Spring.GetModOptions().startenergy - 1000) / 9000) + 1)*0.1)+0.9) +local economyScale = 1 * Spring.GetModOptions().multiplier_resourceincome * (0.67 + (Spring.GetModOptions().multiplier_metalextraction * 0.33)) * (0.67 + (Spring.GetModOptions().multiplier_energyconversion * 0.33)) * (0.67 + (Spring.GetModOptions().multiplier_energyproduction * 0.33)) * (((((Spring.GetModOptions().startmetal - 1000) / 9000) + 1) * 0.1) + 0.9) * (((((Spring.GetModOptions().startenergy - 1000) / 9000) + 1) * 0.1) + 0.9) -economyScale = math.min(5, (economyScale*0.33)+0.67) +economyScale = math.min(5, (economyScale * 0.33) + 0.67) -local burrowName = 'raptor_hive' +local burrowName = "raptor_hive" local raptorTurrets = {} -- If you use fractions in spawnerPerWave, it becomes a percentage chance to spawn one. -raptorTurrets["raptor_turret_basic_t2_v1"] = { minQueenAnger = 0, spawnedPerWave = 0.5, maxExisting = 20, maxQueenAnger = 1000, } -raptorTurrets["raptor_turret_acid_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000, } -raptorTurrets["raptor_turret_emp_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000, } -raptorTurrets["raptor_turret_basic_t3_v1"] = { minQueenAnger = 30, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000, } -raptorTurrets["raptor_turret_acid_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000, } -raptorTurrets["raptor_turret_emp_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000, } +raptorTurrets["raptor_turret_basic_t2_v1"] = { minQueenAnger = 0, spawnedPerWave = 0.5, maxExisting = 20, maxQueenAnger = 1000 } +raptorTurrets["raptor_turret_acid_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000 } +raptorTurrets["raptor_turret_emp_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000 } +raptorTurrets["raptor_turret_basic_t3_v1"] = { minQueenAnger = 30, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000 } +raptorTurrets["raptor_turret_acid_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000 } +raptorTurrets["raptor_turret_emp_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000 } if not Spring.GetModOptions().unit_restrictions_nonukes then - raptorTurrets["raptor_turret_antinuke_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_antinuke_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_meteor_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000, } + raptorTurrets["raptor_turret_antinuke_t2_v1"] = { minQueenAnger = 15, spawnedPerWave = 0.25, maxExisting = 10, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_antinuke_t3_v1"] = { minQueenAnger = 45, spawnedPerWave = 0.25, maxExisting = 3, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_meteor_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000 } end if not Spring.GetModOptions().unit_restrictions_noair then - raptorTurrets["raptor_turret_antiair_t2_v1"] = { minQueenAnger = 0, spawnedPerWave = 0.5, maxExisting = 20, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_antiair_t3_v1"] = { minQueenAnger = 30, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_antiair_t4_v1"] = { minQueenAnger = 60, spawnedPerWave = 0.25, maxExisting = 2, maxQueenAnger = 1000, } + raptorTurrets["raptor_turret_antiair_t2_v1"] = { minQueenAnger = 0, spawnedPerWave = 0.5, maxExisting = 20, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_antiair_t3_v1"] = { minQueenAnger = 30, spawnedPerWave = 0.5, maxExisting = 6, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_antiair_t4_v1"] = { minQueenAnger = 60, spawnedPerWave = 0.25, maxExisting = 2, maxQueenAnger = 1000 } end if not Spring.GetModOptions().unit_restrictions_nolrpc then - raptorTurrets["raptor_turret_basic_t4_v1"] = { minQueenAnger = 60, spawnedPerWave = 0.25, maxExisting = 2, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_emp_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.25, maxExisting = 1, maxQueenAnger = 1000, } - raptorTurrets["raptor_turret_acid_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.25, maxExisting = 1, maxQueenAnger = 1000, } + raptorTurrets["raptor_turret_basic_t4_v1"] = { minQueenAnger = 60, spawnedPerWave = 0.25, maxExisting = 2, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_emp_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.25, maxExisting = 1, maxQueenAnger = 1000 } + raptorTurrets["raptor_turret_acid_t4_v1"] = { minQueenAnger = 75, spawnedPerWave = 0.25, maxExisting = 1, maxQueenAnger = 1000 } end local raptorEggs = { -- Specify eggs dropped by unit here, requires useEggs to be true, if some unit is not specified here, it drops random egg colors. - raptor_land_swarmer_basic_t2_v1 = "purple", - raptor_land_swarmer_basic_t1_v1 = "purple", - raptor_land_swarmer_basic_t2_v2 = "pink", - raptor_land_swarmer_basic_t2_v3 = "purple", - raptor_land_swarmer_basic_t2_v4 = "purple", - raptor_land_swarmer_basic_t3_v1 = "pink", - raptor_land_swarmer_basic_t3_v2 = "pink", - raptor_land_swarmer_basic_t3_v3 = "pink", - raptor_land_swarmer_basic_t4_v1 = "pink", - raptor_land_swarmer_basic_t4_v2 = "pink", - raptor_land_assault_basic_t2_v1 = "red", - raptor_land_assault_basic_t2_v2 = "red", - raptor_land_assault_basic_t2_v3 = "red", + raptor_land_swarmer_basic_t2_v1 = "purple", + raptor_land_swarmer_basic_t1_v1 = "purple", + raptor_land_swarmer_basic_t2_v2 = "pink", + raptor_land_swarmer_basic_t2_v3 = "purple", + raptor_land_swarmer_basic_t2_v4 = "purple", + raptor_land_swarmer_basic_t3_v1 = "pink", + raptor_land_swarmer_basic_t3_v2 = "pink", + raptor_land_swarmer_basic_t3_v3 = "pink", + raptor_land_swarmer_basic_t4_v1 = "pink", + raptor_land_swarmer_basic_t4_v2 = "pink", + raptor_land_assault_basic_t2_v1 = "red", + raptor_land_assault_basic_t2_v2 = "red", + raptor_land_assault_basic_t2_v3 = "red", raptor_allterrain_assault_basic_t2_v1 = "red", raptor_allterrain_assault_basic_t2_v2 = "red", raptor_allterrain_assault_basic_t2_v3 = "red", - raptor_land_assault_basic_t4_v1 = "red", - raptor_land_assault_basic_t4_v2 = "red", + raptor_land_assault_basic_t4_v1 = "red", + raptor_land_assault_basic_t4_v2 = "red", raptor_allterrain_assault_basic_t4_v1 = "red", raptor_allterrain_assault_basic_t4_v2 = "red", - raptor_land_spiker_basic_t2_v1 = "green", - raptor_land_spiker_basic_t4_v1 = "darkgreen", - raptor_land_kamikaze_basic_t2_v1 = "red", - raptor_land_kamikaze_basic_t4_v1 = "red", - raptor_air_kamikaze_basic_t2_v1 = "red", - raptor_air_bomber_basic_t1_v1 = "darkgreen", - raptor_air_bomber_basic_t2_v1 = "darkgreen", - raptor_air_bomber_basic_t2_v2 = "darkgreen", - raptor_air_bomber_basic_t4_v1 = "darkgreen", - raptor_air_bomber_basic_t4_v2 = "darkgreen", - raptor_air_scout_basic_t2_v1 = "white", - raptor_air_scout_basic_t3_v1 = "white", - raptor_air_scout_basic_t4_v1 = "white", + raptor_land_spiker_basic_t2_v1 = "green", + raptor_land_spiker_basic_t4_v1 = "darkgreen", + raptor_land_kamikaze_basic_t2_v1 = "red", + raptor_land_kamikaze_basic_t4_v1 = "red", + raptor_air_kamikaze_basic_t2_v1 = "red", + raptor_air_bomber_basic_t1_v1 = "darkgreen", + raptor_air_bomber_basic_t2_v1 = "darkgreen", + raptor_air_bomber_basic_t2_v2 = "darkgreen", + raptor_air_bomber_basic_t4_v1 = "darkgreen", + raptor_air_bomber_basic_t4_v2 = "darkgreen", + raptor_air_scout_basic_t2_v1 = "white", + raptor_air_scout_basic_t3_v1 = "white", + raptor_air_scout_basic_t4_v1 = "white", raptor_allterrain_swarmer_basic_t2_v1 = "white", raptor_allterrain_swarmer_basic_t3_v1 = "white", raptor_allterrain_swarmer_basic_t4_v1 = "white", - raptor_allterrain_arty_basic_t2_v1 = "darkgreen", - raptor_allterrain_arty_basic_t4_v1 = "darkgreen", - raptor_land_swarmer_heal_t1_v1 = "white", - raptor_land_swarmer_heal_t2_v1 = "white", - raptor_land_swarmer_heal_t3_v1 = "white", - raptor_land_swarmer_heal_t4_v1 = "white", - raptorh1b = "white", - raptor_land_swarmer_brood_t4_v1 = "purple", - raptor_land_swarmer_brood_t3_v1 = "purple", - raptor_land_swarmer_brood_t2_v1 = "purple", - raptor_air_bomber_brood_t4_v2 = "purple", - raptor_air_bomber_brood_t4_v3 = "purple", - raptor_air_bomber_brood_t4_v4 = "purple", - raptor_allterrain_arty_brood_t4_v1 = "purple", - raptor_allterrain_arty_brood_t2_v1 = "purple", - raptorh5 = "white", - raptor_air_fighter_basic_t2_v1 = "purple", - raptor_air_fighter_basic_t1_v1 = "purple", - raptor_air_fighter_basic_t2_v2 = "purple", - raptor_air_fighter_basic_t2_v3 = "purple", - raptor_air_fighter_basic_t2_v4 = "purple", - raptor_air_fighter_basic_t4_v1 = "darkred", - raptor_land_swarmer_fire_t2_v1 = "darkred", - raptor_land_swarmer_fire_t4_v1 = "darkred", - raptor_allterrain_swarmer_fire_t2_v1 = "darkred", - raptor_land_swarmer_emp_t2_v1 = "blue", - raptor_land_assault_emp_t2_v1 = "blue", - raptor_allterrain_arty_emp_t2_v1 = "blue", - raptor_allterrain_arty_emp_t4_v1 = "blue", - raptor_air_bomber_emp_t2_v1 = "blue", - raptor_allterrain_swarmer_emp_t2_v1 = "blue", - raptor_allterrain_assault_emp_t2_v1 = "blue", - raptor_land_kamikaze_emp_t2_v1 = "blue", - raptor_land_kamikaze_emp_t4_v1 = "blue", - raptor_land_swarmer_acids_t2_v1 = "acidgreen", - raptor_land_assault_acid_t2_v1 = "acidgreen", - raptor_allterrain_arty_acid_t2_v1 = "acidgreen", - raptor_allterrain_arty_acid_t4_v1 = "acidgreen", - raptor_air_bomber_acid_t2_v1 = "acidgreen", - raptor_allterrain_swarmer_acid_t2_v1 = "acidgreen", - raptor_allterrain_assault_acid_t2_v1 = "acidgreen", - raptor_land_swarmer_spectre_t3_v1 = "yellow", - raptor_land_swarmer_spectre_t4_v1 = "yellow", - raptor_land_assault_spectre_t2_v1 = "yellow", - raptor_land_assault_spectre_t4_v1 = "yellow", - raptor_land_spiker_spectre_t4_v1 = "yellow", - - raptor_turret_basic_t2_v1 = "white", - raptor_turret_basic_t3_v1 = "white", - raptor_turret_basic_t4_v1 = "white", - raptor_turret_emp_t2_v1 = "blue", - raptor_turret_emp_t3_v1 = "blue", - raptor_turret_emp_t4_v1 = "blue", - raptor_turret_acid_t2_v1 = "acidgreen", - raptor_turret_acid_t3_v1 = "acidgreen", - raptor_turret_acid_t4_v1 = "acidgreen", - raptor_turret_antinuke_t2_v1 = "white", - raptor_turret_antinuke_t3_v1 = "white", - raptor_turret_antiair_t2_v1 = "red", - raptor_turret_antiair_t3_v1 = "red", - raptor_turret_antiair_t4_v1 = "red", - raptor_turret_meteor_t4_v1 = "darkgreen", - - raptor_matriarch_electric = "blue", - raptor_matriarch_acid = "acidgreen", - raptor_matriarch_healer = "white", - raptor_matriarch_basic = "pink", - raptor_matriarch_fire = "darkred", - raptor_matriarch_spectre = "yellow", + raptor_allterrain_arty_basic_t2_v1 = "darkgreen", + raptor_allterrain_arty_basic_t4_v1 = "darkgreen", + raptor_land_swarmer_heal_t1_v1 = "white", + raptor_land_swarmer_heal_t2_v1 = "white", + raptor_land_swarmer_heal_t3_v1 = "white", + raptor_land_swarmer_heal_t4_v1 = "white", + raptorh1b = "white", + raptor_land_swarmer_brood_t4_v1 = "purple", + raptor_land_swarmer_brood_t3_v1 = "purple", + raptor_land_swarmer_brood_t2_v1 = "purple", + raptor_air_bomber_brood_t4_v2 = "purple", + raptor_air_bomber_brood_t4_v3 = "purple", + raptor_air_bomber_brood_t4_v4 = "purple", + raptor_allterrain_arty_brood_t4_v1 = "purple", + raptor_allterrain_arty_brood_t2_v1 = "purple", + raptorh5 = "white", + raptor_air_fighter_basic_t2_v1 = "purple", + raptor_air_fighter_basic_t1_v1 = "purple", + raptor_air_fighter_basic_t2_v2 = "purple", + raptor_air_fighter_basic_t2_v3 = "purple", + raptor_air_fighter_basic_t2_v4 = "purple", + raptor_air_fighter_basic_t4_v1 = "darkred", + raptor_land_swarmer_fire_t2_v1 = "darkred", + raptor_land_swarmer_fire_t4_v1 = "darkred", + raptor_allterrain_swarmer_fire_t2_v1 = "darkred", + raptor_land_swarmer_emp_t2_v1 = "blue", + raptor_land_assault_emp_t2_v1 = "blue", + raptor_allterrain_arty_emp_t2_v1 = "blue", + raptor_allterrain_arty_emp_t4_v1 = "blue", + raptor_air_bomber_emp_t2_v1 = "blue", + raptor_allterrain_swarmer_emp_t2_v1 = "blue", + raptor_allterrain_assault_emp_t2_v1 = "blue", + raptor_land_kamikaze_emp_t2_v1 = "blue", + raptor_land_kamikaze_emp_t4_v1 = "blue", + raptor_land_swarmer_acids_t2_v1 = "acidgreen", + raptor_land_assault_acid_t2_v1 = "acidgreen", + raptor_allterrain_arty_acid_t2_v1 = "acidgreen", + raptor_allterrain_arty_acid_t4_v1 = "acidgreen", + raptor_air_bomber_acid_t2_v1 = "acidgreen", + raptor_allterrain_swarmer_acid_t2_v1 = "acidgreen", + raptor_allterrain_assault_acid_t2_v1 = "acidgreen", + raptor_land_swarmer_spectre_t3_v1 = "yellow", + raptor_land_swarmer_spectre_t4_v1 = "yellow", + raptor_land_assault_spectre_t2_v1 = "yellow", + raptor_land_assault_spectre_t4_v1 = "yellow", + raptor_land_spiker_spectre_t4_v1 = "yellow", + + raptor_turret_basic_t2_v1 = "white", + raptor_turret_basic_t3_v1 = "white", + raptor_turret_basic_t4_v1 = "white", + raptor_turret_emp_t2_v1 = "blue", + raptor_turret_emp_t3_v1 = "blue", + raptor_turret_emp_t4_v1 = "blue", + raptor_turret_acid_t2_v1 = "acidgreen", + raptor_turret_acid_t3_v1 = "acidgreen", + raptor_turret_acid_t4_v1 = "acidgreen", + raptor_turret_antinuke_t2_v1 = "white", + raptor_turret_antinuke_t3_v1 = "white", + raptor_turret_antiair_t2_v1 = "red", + raptor_turret_antiair_t3_v1 = "red", + raptor_turret_antiair_t4_v1 = "red", + raptor_turret_meteor_t4_v1 = "darkgreen", + + raptor_matriarch_electric = "blue", + raptor_matriarch_acid = "acidgreen", + raptor_matriarch_healer = "white", + raptor_matriarch_basic = "pink", + raptor_matriarch_fire = "darkred", + raptor_matriarch_spectre = "yellow", } raptorBehaviours = { @@ -177,11 +171,11 @@ raptorBehaviours = { [UnitDefNames["raptor_land_swarmer_brood_t4_v1"].id] = { distance = 500, chance = 0.25 }, [UnitDefNames["raptor_allterrain_arty_brood_t2_v1"].id] = { distance = 500, chance = 1 }, [UnitDefNames["raptor_allterrain_arty_brood_t4_v1"].id] = { distance = 500, chance = 0.1 }, - [UnitDefNames["raptor_land_swarmer_spectre_t3_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_swarmer_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_spiker_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_assault_spectre_t2_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_assault_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, + [UnitDefNames["raptor_land_swarmer_spectre_t3_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_swarmer_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_spiker_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_assault_spectre_t2_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_assault_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, [UnitDefNames["raptor_matriarch_spectre"].id] = { distance = 500, chance = 0.001, teleport = true, teleportcooldown = 2 }, [UnitDefNames["raptor_matriarch_electric"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["raptor_matriarch_acid"].id] = { distance = 500, chance = 0.001 }, @@ -207,23 +201,23 @@ raptorBehaviours = { [UnitDefNames["raptor_allterrain_arty_brood_t4_v1"].id] = { distance = 500, chance = 0.1 }, [UnitDefNames["raptor_land_swarmer_brood_t4_v1"].id] = { distance = 500, chance = 1 }, [UnitDefNames["raptor_land_swarmer_brood_t3_v1"].id] = { distance = 500, chance = 0.25 }, - [UnitDefNames["raptor_land_swarmer_spectre_t3_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_swarmer_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_spiker_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_assault_spectre_t2_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, - [UnitDefNames["raptor_land_assault_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2, }, + [UnitDefNames["raptor_land_swarmer_spectre_t3_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_swarmer_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_spiker_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_assault_spectre_t2_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, + [UnitDefNames["raptor_land_assault_spectre_t4_v1"].id] = { distance = 500, chance = 0.25, teleport = true, teleportcooldown = 2 }, [UnitDefNames["raptor_matriarch_spectre"].id] = { distance = 500, chance = 0.001, teleport = true, teleportcooldown = 2 }, [UnitDefNames["raptor_matriarch_electric"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["raptor_matriarch_acid"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["raptor_matriarch_healer"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["raptor_matriarch_basic"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["raptor_matriarch_fire"].id] = { distance = 500, chance = 0.001 }, - [UnitDefNames["raptor_queen_veryeasy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["raptor_queen_easy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 50, }, - [UnitDefNames["raptor_queen_normal"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 40, }, - [UnitDefNames["raptor_queen_hard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 30, }, - [UnitDefNames["raptor_queen_veryhard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 20, }, - [UnitDefNames["raptor_queen_epic"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 10, }, + [UnitDefNames["raptor_queen_veryeasy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["raptor_queen_easy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 50 }, + [UnitDefNames["raptor_queen_normal"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 40 }, + [UnitDefNames["raptor_queen_hard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 30 }, + [UnitDefNames["raptor_queen_veryhard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 20 }, + [UnitDefNames["raptor_queen_epic"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 10 }, }, BERSERK = { -- Run towards target after getting hit by enemy or after hitting the target [UnitDefNames["raptor_land_spiker_basic_t4_v1"].id] = { chance = 0.2, distance = 750 }, @@ -305,141 +299,141 @@ raptorBehaviours = { local optionValues = { [difficulties.veryeasy] = { - gracePeriod = 9 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 55 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 240 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 1, - angerBonus = 0.1, - maxXP = 0.5 * economyScale, - spawnChance = 0.1, - damageMod = 0.4, - healthMod = 0.5, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 25 * economyScale, + gracePeriod = 9 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 55 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 240 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 1, + angerBonus = 0.1, + maxXP = 0.5 * economyScale, + spawnChance = 0.1, + damageMod = 0.4, + healthMod = 0.5, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 25 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_veryeasy', - queenResistanceMult = 0.5 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_veryeasy"].health*0.33), + queenName = "raptor_queen_veryeasy", + queenResistanceMult = 0.5 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_veryeasy"].health * 0.33), time = 40, }, }, [difficulties.easy] = { - gracePeriod = 8 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 50 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 90 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 210 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 100 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 1, - angerBonus = 0.15, - maxXP = 1 * economyScale, - spawnChance = 0.2, - damageMod = 0.6, - healthMod = 0.75, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 30 * economyScale, + gracePeriod = 8 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 50 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 90 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 210 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 100 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 1, + angerBonus = 0.15, + maxXP = 1 * economyScale, + spawnChance = 0.2, + damageMod = 0.6, + healthMod = 0.75, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 30 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_easy', - queenResistanceMult = 0.75 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_easy"].health*0.33), + queenName = "raptor_queen_easy", + queenResistanceMult = 0.75 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_easy"].health * 0.33), time = 35, }, }, [difficulties.normal] = { - gracePeriod = 7 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 45 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 60 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 180 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 80 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 3, - angerBonus = 0.20, - maxXP = 1.5 * economyScale, - spawnChance = 0.3, - damageMod = 0.8, - healthMod = 1, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 35 * economyScale, + gracePeriod = 7 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 45 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 60 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 180 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 80 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 3, + angerBonus = 0.20, + maxXP = 1.5 * economyScale, + spawnChance = 0.3, + damageMod = 0.8, + healthMod = 1, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 35 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_normal', - queenResistanceMult = 1 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_normal"].health*0.33), + queenName = "raptor_queen_normal", + queenResistanceMult = 1 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_normal"].health * 0.33), time = 30, }, }, [difficulties.hard] = { - gracePeriod = 6 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 40 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 50 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 150 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 60 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 3, - angerBonus = 0.25, - maxXP = 2 * economyScale, - spawnChance = 0.4, - damageMod = 1, - healthMod = 1.1, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 40 * economyScale, + gracePeriod = 6 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 40 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 50 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 150 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 60 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 3, + angerBonus = 0.25, + maxXP = 2 * economyScale, + spawnChance = 0.4, + damageMod = 1, + healthMod = 1.1, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 40 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_hard', - queenResistanceMult = 1.33 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_hard"].health*0.33), + queenName = "raptor_queen_hard", + queenResistanceMult = 1.33 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_hard"].health * 0.33), time = 30, }, }, [difficulties.veryhard] = { - gracePeriod = 5 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 35 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 40 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 40 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 3, - angerBonus = 0.30, - maxXP = 2.5 * economyScale, - spawnChance = 0.5, - damageMod = 1.2, - healthMod = 1.25, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 45 * economyScale, + gracePeriod = 5 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 35 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 40 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 120 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 40 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 3, + angerBonus = 0.30, + maxXP = 2.5 * economyScale, + spawnChance = 0.5, + damageMod = 1.2, + healthMod = 1.25, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 45 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_veryhard', - queenResistanceMult = 1.67 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_veryhard"].health*0.33), + queenName = "raptor_queen_veryhard", + queenResistanceMult = 1.67 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_veryhard"].health * 0.33), time = 30, }, }, [difficulties.epic] = { - gracePeriod = 4 * Spring.GetModOptions().raptor_graceperiodmult * 60, - queenTime = 30 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds - raptorSpawnRate = 30 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - burrowSpawnRate = 90 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - turretSpawnRate = 20 / Spring.GetModOptions().raptor_spawntimemult / economyScale, - queenSpawnMult = 3, - angerBonus = 0.35, - maxXP = 3 * economyScale, - spawnChance = 0.6, - damageMod = 1.4, - healthMod = 1.5, - maxBurrows = 1000, - minRaptors = 5 * economyScale, - maxRaptors = 50 * economyScale, + gracePeriod = 4 * Spring.GetModOptions().raptor_graceperiodmult * 60, + queenTime = 30 * Spring.GetModOptions().raptor_queentimemult * 60, -- time at which the queen appears, seconds + raptorSpawnRate = 30 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + burrowSpawnRate = 90 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + turretSpawnRate = 20 / Spring.GetModOptions().raptor_spawntimemult / economyScale, + queenSpawnMult = 3, + angerBonus = 0.35, + maxXP = 3 * economyScale, + spawnChance = 0.6, + damageMod = 1.4, + healthMod = 1.5, + maxBurrows = 1000, + minRaptors = 5 * economyScale, + maxRaptors = 50 * economyScale, raptorPerPlayerMultiplier = 0.25, - queenName = 'raptor_queen_epic', - queenResistanceMult = 2 * economyScale, - queenStagger = { - health = math.ceil(UnitDefNames["raptor_queen_epic"].health*0.33), + queenName = "raptor_queen_epic", + queenResistanceMult = 2 * economyScale, + queenStagger = { + health = math.ceil(UnitDefNames["raptor_queen_epic"].health * 0.33), time = 30, }, }, @@ -464,7 +458,6 @@ local optionValues = { -- }, } - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -478,14 +471,24 @@ local squadSpawnOptionsTable = { local function addNewSquad(squadParams) -- params: {type = "basic", minAnger = 0, maxAnger = 100, units = {"1 raptor_land_swarmer_basic_t2_v1"}, weight = 1} if squadParams then -- Just in case - if not squadParams.units then return end - if not squadParams.minAnger then squadParams.minAnger = 0 end - if not squadParams.maxAnger then squadParams.maxAnger = squadParams.minAnger + 100 end -- Eliminate squads 100% after they're introduced by default, can be overwritten - if squadParams.maxAnger >= 1000 then squadParams.maxAnger = 1000 end -- basically infinite, anger caps at 999 - if not squadParams.weight then squadParams.weight = 1 end - - for _ = 1,squadParams.weight do - table.insert(squadSpawnOptionsTable[squadParams.type], {minAnger = squadParams.minAnger, maxAnger = squadParams.maxAnger, units = squadParams.units, weight = squadParams.weight}) + if not squadParams.units then + return + end + if not squadParams.minAnger then + squadParams.minAnger = 0 + end + if not squadParams.maxAnger then + squadParams.maxAnger = squadParams.minAnger + 100 + end -- Eliminate squads 100% after they're introduced by default, can be overwritten + if squadParams.maxAnger >= 1000 then + squadParams.maxAnger = 1000 + end -- basically infinite, anger caps at 999 + if not squadParams.weight then + squadParams.weight = 1 + end + + for _ = 1, squadParams.weight do + table.insert(squadSpawnOptionsTable[squadParams.type], { minAnger = squadParams.minAnger, maxAnger = squadParams.maxAnger, units = squadParams.units, weight = squadParams.weight }) end end end @@ -498,12 +501,12 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local miniBosses = { -- Units that spawn alongside queen - "raptor_matriarch_electric", -- Electric Miniqueen - "raptor_matriarch_acid", -- Acid Miniqueen - "raptor_matriarch_healer", -- Healer Miniqueen - "raptor_matriarch_basic", -- Basic Miniqueen - "raptor_matriarch_fire", -- Pyro Miniqueen - "raptor_matriarch_spectre", -- Spectre Miniqueen + "raptor_matriarch_electric", -- Electric Miniqueen + "raptor_matriarch_acid", -- Acid Miniqueen + "raptor_matriarch_healer", -- Healer Miniqueen + "raptor_matriarch_basic", -- Basic Miniqueen + "raptor_matriarch_fire", -- Pyro Miniqueen + "raptor_matriarch_spectre", -- Spectre Miniqueen } local raptorMinions = { -- Units spawning other units @@ -615,55 +618,55 @@ local raptorMinions = { -- Units spawning other units -- Basic Swarmer -addNewSquad({ +addNewSquad({ type = "basic", minAnger = 0, maxAnger = 30, weight = 10, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t1_v1"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t1_v1" } }, }) addNewSquad({ type = "basic", minAnger = 10, maxAnger = 40, - units = { {count = 8, unit = "raptor_land_swarmer_basic_t1_v1"} } + units = { { count = 8, unit = "raptor_land_swarmer_basic_t1_v1" } }, }) addNewSquad({ type = "basic", minAnger = 20, maxAnger = 50, - units = { {count = 16, unit = "raptor_land_swarmer_basic_t1_v1"} } - }) + units = { { count = 16, unit = "raptor_land_swarmer_basic_t1_v1" } }, +}) addNewSquad({ type = "basic", minAnger = 30, maxAnger = 60, - units = { {count = 32, unit = "raptor_land_swarmer_basic_t1_v1"} } + units = { { count = 32, unit = "raptor_land_swarmer_basic_t1_v1" } }, }) addNewSquad({ type = "basic", minAnger = 5, maxAnger = 50, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t2_v1" } } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" } }, }) addNewSquad({ type = "basic", minAnger = 5, maxAnger = 50, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t2_v2" } } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" } }, }) addNewSquad({ type = "basic", minAnger = 5, maxAnger = 50, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" } }, }) addNewSquad({ type = "basic", minAnger = 5, maxAnger = 50, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" } }, }) addNewSquad({ @@ -671,8 +674,8 @@ addNewSquad({ minAnger = 25, maxAnger = 70, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, }, }) addNewSquad({ @@ -680,8 +683,8 @@ addNewSquad({ minAnger = 25, maxAnger = 70, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, }, }) addNewSquad({ @@ -689,8 +692,8 @@ addNewSquad({ minAnger = 25, maxAnger = 70, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, }, }) addNewSquad({ @@ -698,8 +701,8 @@ addNewSquad({ minAnger = 25, maxAnger = 70, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, }, }) @@ -708,9 +711,9 @@ addNewSquad({ minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, }, }) addNewSquad({ @@ -718,9 +721,9 @@ addNewSquad({ minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, }, }) addNewSquad({ @@ -728,9 +731,9 @@ addNewSquad({ minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, }, }) addNewSquad({ @@ -738,9 +741,9 @@ addNewSquad({ minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, }, }) @@ -749,10 +752,10 @@ addNewSquad({ minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, }, }) addNewSquad({ @@ -760,10 +763,10 @@ addNewSquad({ minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, }, }) addNewSquad({ @@ -771,10 +774,10 @@ addNewSquad({ minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, }, }) addNewSquad({ @@ -782,10 +785,10 @@ addNewSquad({ minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t2_v3"} + { count = 4, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t2_v3" }, }, }) @@ -794,44 +797,44 @@ addNewSquad({ minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v4"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v4" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v1"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v1" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t2_v3"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v2"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t2_v3" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v2" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t2_v4"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t2_v3"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t2_v4" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t2_v3" }, + }, }) -- Better Swarmer @@ -840,19 +843,19 @@ addNewSquad({ type = "basic", minAnger = 25, maxAnger = 70, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" } }, }) addNewSquad({ type = "basic", minAnger = 25, maxAnger = 70, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" } }, }) addNewSquad({ type = "basic", minAnger = 25, maxAnger = 70, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" } }, }) addNewSquad({ @@ -861,7 +864,7 @@ addNewSquad({ maxAnger = 90, units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, }, }) addNewSquad({ @@ -870,7 +873,7 @@ addNewSquad({ maxAnger = 90, units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, }, }) addNewSquad({ @@ -879,7 +882,7 @@ addNewSquad({ maxAnger = 90, units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, }, }) @@ -890,7 +893,7 @@ addNewSquad({ units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, }, }) addNewSquad({ @@ -900,7 +903,7 @@ addNewSquad({ units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, }, }) addNewSquad({ @@ -910,7 +913,7 @@ addNewSquad({ units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, - { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, }, }) @@ -921,8 +924,8 @@ addNewSquad({ units = { { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, - { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" } - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, + }, }) addNewSquad({ type = "basic", @@ -931,8 +934,8 @@ addNewSquad({ units = { { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, - { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" } - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ type = "basic", @@ -941,20 +944,20 @@ addNewSquad({ units = { { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, - { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" } - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, + }, }) addNewSquad({ type = "basic", minAnger = 25, maxAnger = 70, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" } }, }) addNewSquad({ type = "basic", minAnger = 25, maxAnger = 70, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" } }, }) addNewSquad({ @@ -962,27 +965,27 @@ addNewSquad({ minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + }, }) addNewSquad({ type = "basic", minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + }, }) addNewSquad({ type = "basic", minAnger = 45, maxAnger = 90, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ @@ -990,30 +993,30 @@ addNewSquad({ minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + }, }) addNewSquad({ type = "basic", minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ type = "basic", minAnger = 65, maxAnger = 125, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + }, }) addNewSquad({ @@ -1021,30 +1024,30 @@ addNewSquad({ minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v3"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v1"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t3_v2"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t3_v2" }, + }, }) -- Apex Swarmer @@ -1053,13 +1056,13 @@ addNewSquad({ type = "basic", minAnger = 65, maxAnger = 1000, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t4_v2"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t4_v2" } }, }) addNewSquad({ type = "basic", minAnger = 65, maxAnger = 1000, - units = { {count = 4, unit = "raptor_land_swarmer_basic_t4_v1"} } + units = { { count = 4, unit = "raptor_land_swarmer_basic_t4_v1" } }, }) addNewSquad({ @@ -1067,18 +1070,18 @@ addNewSquad({ minAnger = 85, maxAnger = 1000, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v2"}, - {count = 4, unit = "raptor_land_swarmer_basic_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v2" }, + { count = 4, unit = "raptor_land_swarmer_basic_t4_v1" }, + }, }) addNewSquad({ type = "basic", minAnger = 85, maxAnger = 1000, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v1"}, - {count = 4, unit = "raptor_land_swarmer_basic_t4_v2"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v1" }, + { count = 4, unit = "raptor_land_swarmer_basic_t4_v2" }, + }, }) addNewSquad({ @@ -1086,18 +1089,18 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t4_v2"}, - {count = 8, unit = "raptor_land_swarmer_basic_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t4_v2" }, + { count = 8, unit = "raptor_land_swarmer_basic_t4_v1" }, + }, }) addNewSquad({ type = "basic", minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t4_v1"}, - {count = 8, unit = "raptor_land_swarmer_basic_t4_v2"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t4_v1" }, + { count = 8, unit = "raptor_land_swarmer_basic_t4_v2" }, + }, }) ------------------------------------------------- @@ -1110,197 +1113,181 @@ addNewSquad({ type = "special", minAnger = 0, maxAnger = 15, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t2_v1"}} + units = { { count = 1, unit = "raptor_land_swarmer_basic_t2_v1" } }, }) addNewSquad({ type = "special", minAnger = 0, maxAnger = 15, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t2_v2"}} + units = { { count = 1, unit = "raptor_land_swarmer_basic_t2_v2" } }, }) addNewSquad({ type = "special", - minAnger = 0, - maxAnger = 15, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t2_v3"} } + minAnger = 0, + maxAnger = 15, + units = { { count = 1, unit = "raptor_land_swarmer_basic_t2_v3" } }, }) addNewSquad({ type = "special", minAnger = 0, maxAnger = 15, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t2_v4"}} + units = { { count = 1, unit = "raptor_land_swarmer_basic_t2_v4" } }, }) - -addNewSquad({type = "special", - minAnger = 10, - maxAnger = 25, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t3_v1"} } -}) -addNewSquad({type = "special", - minAnger = 10, - maxAnger = 25, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t3_v2"} } -}) -addNewSquad({type = "special", - minAnger = 10, - maxAnger = 25, - units = { {count = 1, unit = "raptor_land_swarmer_basic_t3_v3"} } -}) +addNewSquad({ type = "special", minAnger = 10, maxAnger = 25, units = { { count = 1, unit = "raptor_land_swarmer_basic_t3_v1" } } }) +addNewSquad({ type = "special", minAnger = 10, maxAnger = 25, units = { { count = 1, unit = "raptor_land_swarmer_basic_t3_v2" } } }) +addNewSquad({ type = "special", minAnger = 10, maxAnger = 25, units = { { count = 1, unit = "raptor_land_swarmer_basic_t3_v3" } } }) addNewSquad({ type = "special", minAnger = 20, maxAnger = 40, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 20, maxAnger = 40, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v2"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 20, maxAnger = 40, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t3_v3"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t3_v3" }, + }, }) - addNewSquad({ type = "special", minAnger = 40, units = { - {count = 10, unit = "raptor_land_swarmer_spectre_t3_v1"} - } + { count = 10, unit = "raptor_land_swarmer_spectre_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 70, units = { - {count = 5, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 5, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 20, units = { - {count = 3, unit = "raptor_land_swarmer_emp_t2_v1"} - } + { count = 3, unit = "raptor_land_swarmer_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_land_swarmer_emp_t2_v1"} - } + { count = 10, unit = "raptor_land_swarmer_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 20, units = { - {count = 3, unit = "raptor_land_swarmer_acids_t2_v1"} - } + { count = 3, unit = "raptor_land_swarmer_acids_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_land_swarmer_acids_t2_v1"} - } + { count = 10, unit = "raptor_land_swarmer_acids_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 20, units = { - {count = 3, unit = "raptor_land_swarmer_emp_t2_v1"}, - {count = 3, unit = "raptor_land_swarmer_acids_t2_v1"} - } + { count = 3, unit = "raptor_land_swarmer_emp_t2_v1" }, + { count = 3, unit = "raptor_land_swarmer_acids_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_land_swarmer_emp_t2_v1"}, - {count = 10, unit = "raptor_land_swarmer_acids_t2_v1"} - } + { count = 10, unit = "raptor_land_swarmer_emp_t2_v1" }, + { count = 10, unit = "raptor_land_swarmer_acids_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 40, units = { - {count = 10, unit = "raptor_land_swarmer_basic_t3_v1"}, - {count = 10, unit = "raptor_land_swarmer_spectre_t3_v1"} - } + { count = 10, unit = "raptor_land_swarmer_basic_t3_v1" }, + { count = 10, unit = "raptor_land_swarmer_spectre_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 40, units = { - {count = 10, unit = "raptor_land_swarmer_basic_t3_v2"}, - {count = 10, unit = "raptor_land_swarmer_spectre_t3_v1"} - } + { count = 10, unit = "raptor_land_swarmer_basic_t3_v2" }, + { count = 10, unit = "raptor_land_swarmer_spectre_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 40, units = { - {count = 10, unit = "raptor_land_swarmer_basic_t3_v3"}, - {count = 10, unit = "raptor_land_swarmer_spectre_t3_v1"} - } + { count = 10, unit = "raptor_land_swarmer_basic_t3_v3" }, + { count = 10, unit = "raptor_land_swarmer_spectre_t3_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, maxAnger = 1000, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v2"}, - {count = 4, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v2" }, + { count = 4, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 70, maxAnger = 1000, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v1"}, - {count = 4, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v1" }, + { count = 4, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 85, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v2"}, - {count = 4, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v2" }, + { count = 4, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 85, units = { - {count = 4, unit = "raptor_land_swarmer_basic_t4_v1"}, - {count = 4, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_basic_t4_v1" }, + { count = 4, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ @@ -1308,18 +1295,18 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t4_v2"}, - {count = 8, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t4_v2" }, + { count = 8, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_basic_t4_v1"}, - {count = 8, unit = "raptor_land_swarmer_spectre_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_basic_t4_v1" }, + { count = 8, unit = "raptor_land_swarmer_spectre_t4_v1" }, + }, }) --All Terrain Swarmers------------------------------------------------------------------------------------------------------ @@ -1330,8 +1317,8 @@ addNewSquad({ maxAnger = 60, weight = 2, units = { - {count = 5, unit = "raptor_allterrain_swarmer_basic_t2_v1"} - } + { count = 5, unit = "raptor_allterrain_swarmer_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", @@ -1339,8 +1326,8 @@ addNewSquad({ minAnger = 50, maxAnger = 90, units = { - {count = 10, unit = "raptor_allterrain_swarmer_basic_t2_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_basic_t2_v1" }, + }, }) addNewSquad({ @@ -1349,8 +1336,8 @@ addNewSquad({ minAnger = 80, maxAnger = 1000, units = { - {count = 15, unit = "raptor_allterrain_swarmer_basic_t2_v1"} - } + { count = 15, unit = "raptor_allterrain_swarmer_basic_t2_v1" }, + }, }) addNewSquad({ @@ -1359,8 +1346,8 @@ addNewSquad({ maxAnger = 90, weight = 2, units = { - {count = 5, unit = "raptor_allterrain_swarmer_basic_t3_v1"} - } + { count = 5, unit = "raptor_allterrain_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ @@ -1369,8 +1356,8 @@ addNewSquad({ maxAnger = 1000, weight = 2, units = { - {count = 10, unit = "raptor_allterrain_swarmer_basic_t3_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_basic_t3_v1" }, + }, }) addNewSquad({ @@ -1379,35 +1366,33 @@ addNewSquad({ minAnger = 80, maxAnger = 1000, units = { - {count = 5, unit = "raptor_allterrain_swarmer_basic_t4_v1" } - } + { count = 5, unit = "raptor_allterrain_swarmer_basic_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_allterrain_swarmer_emp_t2_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, - maxAnger = 1000, + maxAnger = 1000, units = { - {count = 20, unit = "raptor_allterrain_swarmer_emp_t2_v1"} - } + { count = 20, unit = "raptor_allterrain_swarmer_emp_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_allterrain_swarmer_acid_t2_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_acid_t2_v1" }, + }, }) addNewSquad({ @@ -1415,18 +1400,17 @@ addNewSquad({ minAnger = 80, maxAnger = 1000, units = { - {count = 20, unit = "raptor_allterrain_swarmer_acid_t2_v1"} - } + { count = 20, unit = "raptor_allterrain_swarmer_acid_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 5, unit = "raptor_allterrain_swarmer_emp_t2_v1"}, - {count = 5, unit = "raptor_allterrain_swarmer_acid_t2_v1"} - } + { count = 5, unit = "raptor_allterrain_swarmer_emp_t2_v1" }, + { count = 5, unit = "raptor_allterrain_swarmer_acid_t2_v1" }, + }, }) addNewSquad({ @@ -1434,9 +1418,9 @@ addNewSquad({ minAnger = 80, maxAnger = 1000, units = { - {count = 10, unit = "raptor_allterrain_swarmer_emp_t2_v1"}, - {count = 10, unit = "raptor_allterrain_swarmer_acid_t2_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_emp_t2_v1" }, + { count = 10, unit = "raptor_allterrain_swarmer_acid_t2_v1" }, + }, }) --Brawlers------------------------------------------------------------------------------------------------------ @@ -1446,24 +1430,24 @@ addNewSquad({ minAnger = 0, maxAnger = 35, units = { - {count = 1, unit = "raptor_land_assault_basic_t2_v1"} - } + { count = 1, unit = "raptor_land_assault_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 0, maxAnger = 35, units = { - {count = 1, unit = "raptor_land_assault_basic_t2_v2"} - } + { count = 1, unit = "raptor_land_assault_basic_t2_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 0, maxAnger = 35, units = { - {count = 1, unit = "raptor_land_assault_basic_t2_v3"} - } + { count = 1, unit = "raptor_land_assault_basic_t2_v3" }, + }, }) addNewSquad({ @@ -1471,55 +1455,54 @@ addNewSquad({ minAnger = 35, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 35, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v2"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 35, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v3"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v3" }, + }, }) - addNewSquad({ type = "special", minAnger = 65, units = { - {count = 2, unit = "raptor_land_assault_basic_t4_v1"} - } + { count = 2, unit = "raptor_land_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 65, units = { - {count = 2, unit = "raptor_land_assault_basic_t4_v2"} - } + { count = 2, unit = "raptor_land_assault_basic_t4_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 75, units = { - {count = 2, unit = "raptor_land_assault_basic_t4_v1"} - } + { count = 2, unit = "raptor_land_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 75, units = { - {count = 2, unit = "raptor_land_assault_basic_t4_v2"} - } + { count = 2, unit = "raptor_land_assault_basic_t4_v2" }, + }, }) addNewSquad({ @@ -1527,73 +1510,71 @@ addNewSquad({ minAnger = 85, maxAnger = 1000, units = { - {count = 5, unit = "raptor_land_assault_basic_t4_v1"} - } + { count = 5, unit = "raptor_land_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 85, maxAnger = 1000, units = { - {count = 5, unit = "raptor_land_assault_basic_t4_v2"} - } + { count = 5, unit = "raptor_land_assault_basic_t4_v2" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_allterrain_assault_basic_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_assault_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_allterrain_assault_basic_t2_v2"} - } + { count = 3, unit = "raptor_allterrain_assault_basic_t2_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_allterrain_assault_basic_t2_v3"} - } + { count = 3, unit = "raptor_allterrain_assault_basic_t2_v3" }, + }, }) - addNewSquad({ type = "special", minAnger = 80, units = { - {count = 2, unit = "raptor_allterrain_assault_basic_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, units = { - {count = 2, unit = "raptor_allterrain_assault_basic_t4_v2"} - } + { count = 2, unit = "raptor_allterrain_assault_basic_t4_v2" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 2, unit = "raptor_allterrain_assault_basic_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 2, unit = "raptor_allterrain_assault_basic_t4_v2"} - } + { count = 2, unit = "raptor_allterrain_assault_basic_t4_v2" }, + }, }) addNewSquad({ @@ -1601,42 +1582,40 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_allterrain_assault_basic_t4_v1"} - } + { count = 5, unit = "raptor_allterrain_assault_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_allterrain_assault_basic_t4_v2"} - } + { count = 5, unit = "raptor_allterrain_assault_basic_t4_v2" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 3, unit = "raptor_land_assault_spectre_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_spectre_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 80, units = { - {count = 4, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 4, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 4, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ @@ -1644,17 +1623,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 10, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 10, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 60, units = { - {count = 3, unit = "raptor_land_assault_emp_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_emp_t2_v1" }, + }, }) addNewSquad({ @@ -1662,17 +1640,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_land_assault_emp_t2_v1"} - } + { count = 5, unit = "raptor_land_assault_emp_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 3, unit = "raptor_land_assault_acid_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_acid_t2_v1" }, + }, }) addNewSquad({ @@ -1680,17 +1657,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_land_assault_acid_t2_v1"} - } + { count = 5, unit = "raptor_land_assault_acid_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 60, units = { - {count = 3, unit = "raptor_allterrain_assault_emp_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_assault_emp_t2_v1" }, + }, }) addNewSquad({ @@ -1698,17 +1674,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_allterrain_assault_emp_t2_v1"} - } + { count = 5, unit = "raptor_allterrain_assault_emp_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 3, unit = "raptor_allterrain_assault_acid_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_assault_acid_t2_v1" }, + }, }) addNewSquad({ @@ -1716,71 +1691,70 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_allterrain_assault_acid_t2_v1"} - } + { count = 5, unit = "raptor_allterrain_assault_acid_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v1"}, - {count = 3, unit = "raptor_land_assault_spectre_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v1" }, + { count = 3, unit = "raptor_land_assault_spectre_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v2"}, - {count = 3, unit = "raptor_land_assault_spectre_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v2" }, + { count = 3, unit = "raptor_land_assault_spectre_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, weight = 2, units = { - {count = 3, unit = "raptor_land_assault_basic_t2_v3"}, - {count = 3, unit = "raptor_land_assault_spectre_t2_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t2_v3" }, + { count = 3, unit = "raptor_land_assault_spectre_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, - units ={ - {count = 1, unit = "raptor_land_assault_basic_t4_v1"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + units = { + { count = 1, unit = "raptor_land_assault_basic_t4_v1" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, - units ={ - {count = 1, unit = "raptor_land_assault_basic_t4_v2"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + units = { + { count = 1, unit = "raptor_land_assault_basic_t4_v2" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 1, unit = "raptor_land_assault_basic_t4_v1"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 1, unit = "raptor_land_assault_basic_t4_v1" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 1, unit = "raptor_land_assault_basic_t4_v2"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 1, unit = "raptor_land_assault_basic_t4_v2" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ @@ -1788,18 +1762,18 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_land_assault_basic_t4_v1"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t4_v1" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_land_assault_basic_t4_v2"}, - {count = 2, unit = "raptor_land_assault_spectre_t4_v1"} - } + { count = 3, unit = "raptor_land_assault_basic_t4_v2" }, + { count = 2, unit = "raptor_land_assault_spectre_t4_v1" }, + }, }) --Spikers------------------------------------------------------------------------------------------------------ @@ -1809,27 +1783,26 @@ addNewSquad({ minAnger = 10, maxAnger = 30, units = { - {count = 1, unit = "raptor_land_spiker_basic_t2_v1"} - } + { count = 1, unit = "raptor_land_spiker_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", - minAnger = 30, + minAnger = 30, weight = 3, units = { - {count = 5, unit = "raptor_land_spiker_basic_t2_v1"} - } + { count = 5, unit = "raptor_land_spiker_basic_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 60, weight = 2, units = { - {count = 10, unit = "raptor_land_spiker_basic_t4_v1" } - } + { count = 10, unit = "raptor_land_spiker_basic_t4_v1" }, + }, }) addNewSquad({ @@ -1838,17 +1811,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 10, unit = "raptor_land_spiker_basic_t4_v1" } - } + { count = 10, unit = "raptor_land_spiker_basic_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 10, unit = "raptor_land_spiker_spectre_t4_v1"} - } + { count = 10, unit = "raptor_land_spiker_spectre_t4_v1" }, + }, }) addNewSquad({ @@ -1856,18 +1828,17 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 10, unit = "raptor_land_spiker_spectre_t4_v1"} - } + { count = 10, unit = "raptor_land_spiker_spectre_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 5, unit = "raptor_land_spiker_basic_t4_v1"}, - {count = 5, unit = "raptor_land_spiker_spectre_t4_v1"} - } + { count = 5, unit = "raptor_land_spiker_basic_t4_v1" }, + { count = 5, unit = "raptor_land_spiker_spectre_t4_v1" }, + }, }) addNewSquad({ @@ -1875,9 +1846,9 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 5, unit = "raptor_land_spiker_basic_t4_v1"}, - {count = 5, unit = "raptor_land_spiker_spectre_t4_v1"} - } + { count = 5, unit = "raptor_land_spiker_basic_t4_v1" }, + { count = 5, unit = "raptor_land_spiker_spectre_t4_v1" }, + }, }) --Kamikaze------------------------------------------------------------------------------------------------------ @@ -1886,16 +1857,16 @@ addNewSquad({ type = "special", minAnger = 40, units = { - {count = 15, unit = "raptor_land_kamikaze_basic_t2_v1"} - } + { count = 15, unit = "raptor_land_kamikaze_basic_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 70, units = { - {count = 25, unit = "raptor_land_kamikaze_basic_t4_v1"} - } + { count = 25, unit = "raptor_land_kamikaze_basic_t4_v1" }, + }, }) addNewSquad({ @@ -1903,25 +1874,24 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 25, unit = "raptor_land_kamikaze_basic_t4_v1"} - } + { count = 25, unit = "raptor_land_kamikaze_basic_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 30, units = { - {count = 15, unit = "raptor_land_kamikaze_emp_t2_v1"} - } + { count = 15, unit = "raptor_land_kamikaze_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 60, units = { - {count = 25, unit = "raptor_land_kamikaze_emp_t4_v1"} - } + { count = 25, unit = "raptor_land_kamikaze_emp_t4_v1" }, + }, }) addNewSquad({ @@ -1929,27 +1899,26 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 25, unit = "raptor_land_kamikaze_emp_t4_v1"} - } + { count = 25, unit = "raptor_land_kamikaze_emp_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 40, units = { - {count = 10, unit = "raptor_land_kamikaze_basic_t2_v1"}, - {count = 10, unit = "raptor_land_kamikaze_emp_t2_v1"} - } + { count = 10, unit = "raptor_land_kamikaze_basic_t2_v1" }, + { count = 10, unit = "raptor_land_kamikaze_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 70, units = { - {count = 20, unit = "raptor_land_kamikaze_basic_t4_v1"}, - {count = 20, unit = "raptor_land_kamikaze_emp_t4_v1"} - } + { count = 20, unit = "raptor_land_kamikaze_basic_t4_v1" }, + { count = 20, unit = "raptor_land_kamikaze_emp_t4_v1" }, + }, }) addNewSquad({ @@ -1957,9 +1926,9 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 20, unit = "raptor_land_kamikaze_basic_t4_v1"}, - {count = 20, unit = "raptor_land_kamikaze_emp_t4_v1"} - } + { count = 20, unit = "raptor_land_kamikaze_basic_t4_v1" }, + { count = 20, unit = "raptor_land_kamikaze_emp_t4_v1" }, + }, }) --Flamers------------------------------------------------------------------------------------------------------ @@ -1969,51 +1938,49 @@ addNewSquad({ minAnger = 0, maxAnger = 20, units = { - {count = 1, unit = "raptor_land_swarmer_fire_t2_v1"} - } + { count = 1, unit = "raptor_land_swarmer_fire_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 20, units = { - {count = 5, unit = "raptor_land_swarmer_fire_t2_v1"} - } + { count = 5, unit = "raptor_land_swarmer_fire_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 30, units = { - {count = 10, unit = "raptor_land_swarmer_fire_t2_v1"} - } + { count = 10, unit = "raptor_land_swarmer_fire_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 10, unit = "raptor_allterrain_swarmer_fire_t2_v1"} - } + { count = 10, unit = "raptor_allterrain_swarmer_fire_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 60, units = { - {count = 8, unit = "raptor_land_swarmer_fire_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_fire_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, - units ={ - {count = 10, unit = "raptor_land_swarmer_fire_t4_v1"} - } + units = { + { count = 10, unit = "raptor_land_swarmer_fire_t4_v1" }, + }, }) --Artillery------------------------------------------------------------------------------------------------------ @@ -2023,8 +1990,8 @@ addNewSquad({ minAnger = 20, maxAnger = 50, units = { - {count = 1, unit = "raptor_allterrain_arty_basic_t2_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2032,8 +1999,8 @@ addNewSquad({ minAnger = 50, weight = 3, units = { - {count = 3, unit = "raptor_allterrain_arty_basic_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2041,8 +2008,8 @@ addNewSquad({ minAnger = 80, weight = 3, units = { - {count = 3, unit = "raptor_allterrain_arty_basic_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2050,8 +2017,8 @@ addNewSquad({ minAnger = 90, weight = 3, units = { - {count = 3, unit = "raptor_allterrain_arty_basic_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2060,33 +2027,32 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_allterrain_arty_basic_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_basic_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 1, unit = "raptor_allterrain_arty_basic_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, units = { - {count = 1, unit = "raptor_allterrain_arty_basic_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_basic_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 1, unit = "raptor_allterrain_arty_basic_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_basic_t4_v1" }, + }, }) addNewSquad({ @@ -2094,60 +2060,58 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 2, unit = "raptor_allterrain_arty_basic_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_arty_basic_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 20, maxAnger = 50, units = { - {count = 1, unit = "raptor_allterrain_arty_acid_t2_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_acid_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, units = { - {count = 3, unit = "raptor_allterrain_arty_acid_t2_v1"}} - } -) + { count = 3, unit = "raptor_allterrain_arty_acid_t2_v1" }, + }, +}) addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_allterrain_arty_acid_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_acid_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 1, unit = "raptor_allterrain_arty_acid_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_acid_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, units = { - {count = 1, unit = "raptor_allterrain_arty_acid_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_acid_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 1, unit = "raptor_allterrain_arty_acid_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_acid_t4_v1" }, + }, }) addNewSquad({ @@ -2155,26 +2119,25 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 2, unit = "raptor_allterrain_arty_acid_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_arty_acid_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 20, maxAnger = 50, units = { - {count = 1, unit = "raptor_allterrain_arty_emp_t2_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_emp_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 50, units = { - {count = 3, unit = "raptor_allterrain_arty_emp_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_emp_t2_v1" }, + }, }) addNewSquad({ @@ -2182,33 +2145,32 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_allterrain_arty_emp_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_emp_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, units = { - {count = 1, unit = "raptor_allterrain_arty_emp_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_emp_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, units = { - {count = 1, unit = "raptor_allterrain_arty_emp_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_emp_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 90, units = { - {count = 1, unit = "raptor_allterrain_arty_emp_t4_v1"} - } + { count = 1, unit = "raptor_allterrain_arty_emp_t4_v1" }, + }, }) addNewSquad({ @@ -2216,17 +2178,16 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 2, unit = "raptor_allterrain_arty_emp_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_arty_emp_t4_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 50, units = { - {count = 3, unit = "raptor_allterrain_arty_brood_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_brood_t2_v1" }, + }, }) addNewSquad({ @@ -2234,30 +2195,26 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_allterrain_arty_brood_t2_v1"} - } + { count = 3, unit = "raptor_allterrain_arty_brood_t2_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 70, - units ={{count = 1, unit = "raptor_allterrain_arty_brood_t4_v1"} -} + units = { { count = 1, unit = "raptor_allterrain_arty_brood_t4_v1" } }, }) addNewSquad({ type = "special", minAnger = 80, - units ={{count = 1, unit = "raptor_allterrain_arty_brood_t4_v1"} -} + units = { { count = 1, unit = "raptor_allterrain_arty_brood_t4_v1" } }, }) addNewSquad({ type = "special", minAnger = 90, - units ={{count = 1, unit = "raptor_allterrain_arty_brood_t4_v1"} -} + units = { { count = 1, unit = "raptor_allterrain_arty_brood_t4_v1" } }, }) addNewSquad({ @@ -2265,8 +2222,8 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 2, unit = "raptor_allterrain_arty_brood_t4_v1"} - } + { count = 2, unit = "raptor_allterrain_arty_brood_t4_v1" }, + }, }) --Brood------------------------------------------------------------------------------------------------------ @@ -2275,74 +2232,73 @@ addNewSquad({ type = "special", minAnger = 20, units = { - {count = 2, unit = "raptor_land_swarmer_brood_t2_v1"} - } + { count = 2, unit = "raptor_land_swarmer_brood_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 40, units = { - {count = 4, unit = "raptor_land_swarmer_brood_t2_v1"} - } + { count = 4, unit = "raptor_land_swarmer_brood_t2_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 60, units = { - {count = 8, unit = "raptor_land_swarmer_brood_t2_v1"} - } + { count = 8, unit = "raptor_land_swarmer_brood_t2_v1" }, + }, }) -addNewSquad({ +addNewSquad({ type = "special", minAnger = 80, - units = { - {count = 16, unit = "raptor_land_swarmer_brood_t2_v1"} - } + units = { + { count = 16, unit = "raptor_land_swarmer_brood_t2_v1" }, + }, }) -addNewSquad({ +addNewSquad({ type = "special", minAnger = 100, maxAnger = 1000, units = { - {count = 32, unit = "raptor_land_swarmer_brood_t2_v1"} + { count = 32, unit = "raptor_land_swarmer_brood_t2_v1" }, }, }) - addNewSquad({ type = "special", minAnger = 20, units = { - {count = 1, unit = "raptor_land_swarmer_brood_t3_v1"} - } + { count = 1, unit = "raptor_land_swarmer_brood_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 40, units = { - {count = 2, unit = "raptor_land_swarmer_brood_t3_v1"} - } + { count = 2, unit = "raptor_land_swarmer_brood_t3_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 60, units = { - {count = 4, unit = "raptor_land_swarmer_brood_t3_v1"} - } + { count = 4, unit = "raptor_land_swarmer_brood_t3_v1" }, + }, }) addNewSquad({ -type = "special", -minAnger = 80, + type = "special", + minAnger = 80, units = { - {count = 8, unit = "raptor_land_swarmer_brood_t3_v1"} - } + { count = 8, unit = "raptor_land_swarmer_brood_t3_v1" }, + }, }) addNewSquad({ @@ -2350,33 +2306,32 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 16, unit = "raptor_land_swarmer_brood_t3_v1"} - } + { count = 16, unit = "raptor_land_swarmer_brood_t3_v1" }, + }, }) - addNewSquad({ type = "special", minAnger = 40, units = { - {count =1, unit = "raptor_land_swarmer_brood_t4_v1"} - } + { count = 1, unit = "raptor_land_swarmer_brood_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 60, units = { - {count =2, unit = "raptor_land_swarmer_brood_t4_v1"} - } + { count = 2, unit = "raptor_land_swarmer_brood_t4_v1" }, + }, }) addNewSquad({ type = "special", minAnger = 80, units = { - {count =4, unit = "raptor_land_swarmer_brood_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_brood_t4_v1" }, + }, }) addNewSquad({ @@ -2384,36 +2339,36 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_brood_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_brood_t4_v1" }, + }, }) --Matriarchs------------------------------------------------------------------------------------------------------ for j = 1, #miniBosses do - addNewSquad({ + addNewSquad({ type = "special", minAnger = 70, - units = { - {count = 1, unit = miniBosses[j]} + units = { + { count = 1, unit = miniBosses[j] }, }, - maxAnger = 1000 + maxAnger = 1000, }) - addNewSquad({ + addNewSquad({ type = "special", minAnger = 85, - units = { - {count = 1, unit = miniBosses[j]} + units = { + { count = 1, unit = miniBosses[j] }, }, - maxAnger = 1000 + maxAnger = 1000, }) - addNewSquad({ + addNewSquad({ type = "special", minAnger = 100, - units = { - {count = 1, unit = miniBosses[j]} + units = { + { count = 1, unit = miniBosses[j] }, }, - maxAnger = 1000 + maxAnger = 1000, }) end @@ -2433,8 +2388,8 @@ addNewSquad({ minAnger = 0, maxAnger = 20, units = { - {count = 3, unit = "raptor_air_scout_basic_t2_v1"} - } + { count = 3, unit = "raptor_air_scout_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2442,8 +2397,8 @@ addNewSquad({ minAnger = 20, maxAnger = 40, units = { - {count = 1, unit = "raptor_air_scout_basic_t2_v1"} - } + { count = 1, unit = "raptor_air_scout_basic_t2_v1" }, + }, }) addNewSquad({ @@ -2451,8 +2406,8 @@ addNewSquad({ minAnger = 33, maxAnger = 80, units = { - {count = 1, unit = "raptor_air_scout_basic_t3_v1"} - } + { count = 1, unit = "raptor_air_scout_basic_t3_v1" }, + }, }) addNewSquad({ @@ -2460,8 +2415,8 @@ addNewSquad({ minAnger = 66, maxAnger = 1000, units = { - {count = 1, unit = "raptor_air_scout_basic_t4_v1"} - } + { count = 1, unit = "raptor_air_scout_basic_t4_v1" }, + }, }) --Fighters------------------------------------------------------------------------------------------------------ @@ -2471,8 +2426,8 @@ addNewSquad({ minAnger = 0, maxAnger = 20, units = { - {count = 1, unit = "raptor_air_fighter_basic_t1_v1"} - } + { count = 1, unit = "raptor_air_fighter_basic_t1_v1" }, + }, }) addNewSquad({ @@ -2480,77 +2435,75 @@ addNewSquad({ minAnger = 20, maxAnger = 60, units = { - {count = 4, unit = "raptor_air_fighter_basic_t1_v1"} - } + { count = 4, unit = "raptor_air_fighter_basic_t1_v1" }, + }, }) - addNewSquad({ type = "basicAir", minAnger = 40, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v1"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 40, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v2"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v2" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 40, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v3"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v3" }, + }, }) addNewSquad({ -type = "basicAir", -minAnger = 40, + type = "basicAir", + minAnger = 40, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v4"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v4" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 60, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v1"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 60, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v2"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v2" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 60, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v3"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v3" }, + }, }) addNewSquad({ -type = "basicAir", -minAnger = 60, + type = "basicAir", + minAnger = 60, units = { - {count = 4, unit = "raptor_air_fighter_basic_t2_v4"} - } + { count = 4, unit = "raptor_air_fighter_basic_t2_v4" }, + }, }) - addNewSquad({ type = "basicAir", weight = 2, minAnger = 80, units = { - {count = 6, unit = "raptor_air_fighter_basic_t4_v1"} - } + { count = 6, unit = "raptor_air_fighter_basic_t4_v1" }, + }, }) addNewSquad({ @@ -2559,8 +2512,8 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 8, unit = "raptor_air_fighter_basic_t4_v1"} - } + { count = 8, unit = "raptor_air_fighter_basic_t4_v1" }, + }, }) --Bombers------------------------------------------------------------------------------------------------------ @@ -2570,8 +2523,8 @@ addNewSquad({ minAnger = 0, maxAnger = 20, units = { - {count = 1, unit = "raptor_air_bomber_basic_t1_v1"} - } + { count = 1, unit = "raptor_air_bomber_basic_t1_v1" }, + }, }) addNewSquad({ @@ -2579,26 +2532,25 @@ addNewSquad({ minAnger = 20, maxAnger = 60, units = { - {count = 4, unit = "raptor_air_bomber_basic_t1_v1"} - } + { count = 4, unit = "raptor_air_bomber_basic_t1_v1" }, + }, }) - addNewSquad({ type = "basicAir", minAnger = 40, weight = 2, units = { - {count = 4, unit = "raptor_air_bomber_basic_t2_v1"} - } + { count = 4, unit = "raptor_air_bomber_basic_t2_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 40, weight = 2, units = { - {count = 4, unit = "raptor_air_bomber_basic_t2_v2"} - } + { count = 4, unit = "raptor_air_bomber_basic_t2_v2" }, + }, }) addNewSquad({ @@ -2606,32 +2558,31 @@ addNewSquad({ minAnger = 60, weight = 2, units = { - {count = 4, unit = "raptor_air_bomber_basic_t2_v1"} - } + { count = 4, unit = "raptor_air_bomber_basic_t2_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 60, weight = 2, units = { - {count = 4, unit = "raptor_air_bomber_basic_t2_v2"} - } + { count = 4, unit = "raptor_air_bomber_basic_t2_v2" }, + }, }) - addNewSquad({ type = "basicAir", minAnger = 80, units = { - {count = 2, unit = "raptor_air_bomber_basic_t4_v1"} - } + { count = 2, unit = "raptor_air_bomber_basic_t4_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 80, units = { - {count = 2, unit = "raptor_air_bomber_basic_t4_v2"} - } + { count = 2, unit = "raptor_air_bomber_basic_t4_v2" }, + }, }) addNewSquad({ @@ -2639,49 +2590,48 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_air_bomber_basic_t4_v1"} - } + { count = 3, unit = "raptor_air_bomber_basic_t4_v1" }, + }, }) addNewSquad({ type = "basicAir", minAnger = 100, maxAnger = 1000, units = { - {count = 3, unit = "raptor_air_bomber_basic_t4_v2"} - } + { count = 3, unit = "raptor_air_bomber_basic_t4_v2" }, + }, }) - addNewSquad({ type = "specialAir", minAnger = 50, units = { - {count = 1, unit = "raptor_air_bomber_emp_t2_v1" } - } + { count = 1, unit = "raptor_air_bomber_emp_t2_v1" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 60, units = { - {count = 2, unit = "raptor_air_bomber_emp_t2_v1" } - } + { count = 2, unit = "raptor_air_bomber_emp_t2_v1" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 70, units = { - {count = 4, unit = "raptor_air_bomber_emp_t2_v1" } - } + { count = 4, unit = "raptor_air_bomber_emp_t2_v1" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 80, units = { - {count = 6, unit = "raptor_air_bomber_emp_t2_v1" } - } + { count = 6, unit = "raptor_air_bomber_emp_t2_v1" }, + }, }) addNewSquad({ @@ -2689,25 +2639,24 @@ addNewSquad({ minAnger = 90, maxAnger = 1000, units = { - {count = 8, unit = "raptor_air_bomber_emp_t2_v1" } - } + { count = 8, unit = "raptor_air_bomber_emp_t2_v1" }, + }, }) - addNewSquad({ type = "specialAir", minAnger = 50, units = { - {count = 1, unit = "raptor_air_bomber_acid_t2_v1"} - } + { count = 1, unit = "raptor_air_bomber_acid_t2_v1" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 70, units = { - {count = 4, unit = "raptor_air_bomber_acid_t2_v1"} - } + { count = 4, unit = "raptor_air_bomber_acid_t2_v1" }, + }, }) addNewSquad({ @@ -2715,54 +2664,53 @@ addNewSquad({ minAnger = 90, maxAnger = 1000, units = { - {count = 8, unit = "raptor_air_bomber_acid_t2_v1"} - } + { count = 8, unit = "raptor_air_bomber_acid_t2_v1" }, + }, }) - addNewSquad({ type = "specialAir", minAnger = 50, units = { - {count = 1, unit = "raptor_air_bomber_brood_t4_v4"} - } + { count = 1, unit = "raptor_air_bomber_brood_t4_v4" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 70, units = { - {count = 1, unit = "raptor_air_bomber_brood_t4_v3"} - } + { count = 1, unit = "raptor_air_bomber_brood_t4_v3" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 70, units = { - {count = 2, unit = "raptor_air_bomber_brood_t4_v4"} - } + { count = 2, unit = "raptor_air_bomber_brood_t4_v4" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 90, units = { - {count = 1, unit = "raptor_air_bomber_brood_t4_v2"} - } + { count = 1, unit = "raptor_air_bomber_brood_t4_v2" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 90, units = { - {count = 2, unit = "raptor_air_bomber_brood_t4_v3"} - } + { count = 2, unit = "raptor_air_bomber_brood_t4_v3" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 90, units = { - {count = 4, unit = "raptor_air_bomber_brood_t4_v4"} - } + { count = 4, unit = "raptor_air_bomber_brood_t4_v4" }, + }, }) addNewSquad({ @@ -2770,24 +2718,24 @@ addNewSquad({ minAnger = 100, maxAnger = 1000, units = { - {count = 4, unit = "raptor_air_bomber_brood_t4_v4"} - } + { count = 4, unit = "raptor_air_bomber_brood_t4_v4" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 100, maxAnger = 1000, units = { - {count = 4, unit = "raptor_air_bomber_brood_t4_v3"} - } + { count = 4, unit = "raptor_air_bomber_brood_t4_v3" }, + }, }) addNewSquad({ type = "specialAir", minAnger = 100, maxAnger = 1000, units = { - {count = 4, unit = "raptor_air_bomber_brood_t4_v2"} - } + { count = 4, unit = "raptor_air_bomber_brood_t4_v2" }, + }, }) --Kamikaze------------------------------------------------------------------------------------------------------ @@ -2807,7 +2755,7 @@ addNewSquad({ minAnger = 0, maxAnger = 35, units = { - {count = 1, unit = "raptor_land_swarmer_heal_t1_v1"} + { count = 1, unit = "raptor_land_swarmer_heal_t1_v1" }, }, }) @@ -2816,16 +2764,16 @@ addNewSquad({ minAnger = 25, maxAnger = 60, units = { - {count = 2, unit = "raptor_land_swarmer_heal_t1_v1"} - } + { count = 2, unit = "raptor_land_swarmer_heal_t1_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 25, maxAnger = 60, units = { - {count = 1, unit = "raptor_land_swarmer_heal_t2_v1"} - } + { count = 1, unit = "raptor_land_swarmer_heal_t2_v1" }, + }, }) addNewSquad({ @@ -2833,24 +2781,24 @@ addNewSquad({ minAnger = 50, maxAnger = 85, units = { - {count = 4, unit = "raptor_land_swarmer_heal_t1_v1"} - } + { count = 4, unit = "raptor_land_swarmer_heal_t1_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 50, maxAnger = 85, units = { - {count = 2, unit = "raptor_land_swarmer_heal_t2_v1"} - } + { count = 2, unit = "raptor_land_swarmer_heal_t2_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 50, maxAnger = 85, units = { - {count = 1, unit = "raptor_land_swarmer_heal_t3_v1"} - } + { count = 1, unit = "raptor_land_swarmer_heal_t3_v1" }, + }, }) addNewSquad({ @@ -2858,32 +2806,32 @@ addNewSquad({ minAnger = 75, maxAnger = 100, units = { - {count = 8, unit = "raptor_land_swarmer_heal_t1_v1"} - } + { count = 8, unit = "raptor_land_swarmer_heal_t1_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 75, maxAnger = 200, units = { - {count = 4, unit = "raptor_land_swarmer_heal_t2_v1"} - } + { count = 4, unit = "raptor_land_swarmer_heal_t2_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 75, maxAnger = 300, units = { - {count = 2, unit = "raptor_land_swarmer_heal_t3_v1"} - } + { count = 2, unit = "raptor_land_swarmer_heal_t3_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 75, maxAnger = 400, units = { - {count = 1, unit = "raptor_land_swarmer_heal_t4_v1"} - } + { count = 1, unit = "raptor_land_swarmer_heal_t4_v1" }, + }, }) addNewSquad({ @@ -2891,24 +2839,24 @@ addNewSquad({ minAnger = 100, maxAnger = 300, units = { - {count = 8, unit = "raptor_land_swarmer_heal_t2_v1"} - } + { count = 8, unit = "raptor_land_swarmer_heal_t2_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 100, maxAnger = 400, units = { - {count = 4, unit = "raptor_land_swarmer_heal_t3_v1"} - } + { count = 4, unit = "raptor_land_swarmer_heal_t3_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 100, maxAnger = 500, units = { - {count = 2, unit = "raptor_land_swarmer_heal_t4_v1"} - } + { count = 2, unit = "raptor_land_swarmer_heal_t4_v1" }, + }, }) addNewSquad({ @@ -2916,16 +2864,16 @@ addNewSquad({ minAnger = 125, maxAnger = 500, units = { - {count = 8, unit = "raptor_land_swarmer_heal_t3_v1"} - } + { count = 8, unit = "raptor_land_swarmer_heal_t3_v1" }, + }, }) addNewSquad({ type = "healer", minAnger = 125, maxAnger = 600, units = { - {count = 4, unit = "raptor_land_swarmer_heal_t4_v1"} - } + { count = 4, unit = "raptor_land_swarmer_heal_t4_v1" }, + }, }) addNewSquad({ @@ -2933,8 +2881,8 @@ addNewSquad({ minAnger = 150, maxAnger = 1000, units = { - {count = 8, unit = "raptor_land_swarmer_heal_t4_v1"} - } + { count = 8, unit = "raptor_land_swarmer_heal_t4_v1" }, + }, }) --[[ @@ -2972,20 +2920,19 @@ for name, unitDef in pairs(UnitDefNames) do --Spring.Echo(name, unitDef.customParams) if unitDef.customParams.raptorcustomsquad and unitDef.customParams.raptorcustomsquad == "1" then local customSquadTable = {} - customSquadTable.units = {{ + customSquadTable.units = { { count = tonumber(unitDef.customParams.raptorsquadunitsamount) or 1, - unit = name - }} + unit = name, + } } customSquadTable.minAnger = tonumber(unitDef.customParams.raptorsquadminanger) or 0 customSquadTable.maxAnger = tonumber(unitDef.customParams.raptorsquadmaxanger) or 999 customSquadTable.weight = tonumber(unitDef.customParams.raptorsquadweight) or 1 if unitDef.customParams.raptorsquadbehavior then - if unitDef.customParams.raptorsquadbehavior == "berserk" and not raptorBehaviours.BERSERK[unitDef.id] then raptorBehaviours.BERSERK[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.1, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 2000 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 2000, } end @@ -2993,13 +2940,13 @@ for name, unitDef in pairs(UnitDefNames) do if not raptorBehaviours.SKIRMISH[unitDef.id] then raptorBehaviours.SKIRMISH[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end if not raptorBehaviours.COWARD[unitDef.id] then raptorBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end end @@ -3008,7 +2955,7 @@ for name, unitDef in pairs(UnitDefNames) do if not raptorBehaviours.COWARD[unitDef.id] then raptorBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 1, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end if not raptorBehaviours.HEALER[unitDef.id] then @@ -3020,14 +2967,14 @@ for name, unitDef in pairs(UnitDefNames) do if unitDef.customParams.raptorsquadbehavior == "artillery" then if not raptorBehaviours.SKIRMISH[unitDef.id] then raptorBehaviours.SKIRMISH[unitDef.id] = { - chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.5, + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end if not raptorBehaviours.COWARD[unitDef.id] then raptorBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end if not raptorBehaviours.ARTILLERY[unitDef.id] then @@ -3039,15 +2986,13 @@ for name, unitDef in pairs(UnitDefNames) do if not raptorBehaviours.BERSERK[unitDef.id] then raptorBehaviours.BERSERK[unitDef.id] = { chance = tonumber(unitDef.customParams.raptorsquadbehaviorchance) or 1, - distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.raptorsquadbehaviordistance) or 500, } end if not raptorBehaviours.KAMIKAZE[unitDef.id] then raptorBehaviours.KAMIKAZE[unitDef.id] = true end end - - end if not customSquadTable.type then @@ -3070,7 +3015,6 @@ for name, unitDef in pairs(UnitDefNames) do end end - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Settings -- Adjust these local useEggs = true -- Drop eggs (requires egg features from Beyond All Reason) @@ -3118,35 +3062,36 @@ local ecoBuildingsPenalty = { -- Additional queen hatch per second from eco buil [UnitDefNames["cormmkr"].id] = 0.0005, [UnitDefNames["armuwmmm"].id] = 0.0005, [UnitDefNames["coruwmmm"].id] = 0.0005, - ]]-- + ]] + -- } local config = { -- Don't touch this! --------------------------------------------------------------------------------------------------------------------------------------------- - useEggs = useEggs, - useScum = useScum, - difficulty = difficulty, - difficulties = difficulties, - raptorEggs = table.copy(raptorEggs), - burrowName = burrowName, -- burrow unit name - burrowDef = UnitDefNames[burrowName] and UnitDefNames[burrowName].id, - raptorSpawnMultiplier = Spring.GetModOptions().raptor_spawncountmult, - burrowSpawnType = Spring.GetModOptions().raptor_raptorstart, - swarmMode = Spring.GetModOptions().raptor_swarmmode, - spawnSquare = spawnSquare, - spawnSquareIncrement = spawnSquareIncrement, - raptorTurrets = table.copy(raptorTurrets), - miniBosses = miniBosses, - raptorMinions = raptorMinions, - raptorBehaviours = raptorBehaviours, - difficultyParameters = optionValues, - useWaveMsg = useWaveMsg, - burrowSize = burrowSize, - squadSpawnOptionsTable = squadSpawnOptionsTable, - airStartAnger = airStartAnger, - ecoBuildingsPenalty = ecoBuildingsPenalty, - bossFightWaveSizeScale = bossFightWaveSizeScale, + useEggs = useEggs, + useScum = useScum, + difficulty = difficulty, + difficulties = difficulties, + raptorEggs = table.copy(raptorEggs), + burrowName = burrowName, -- burrow unit name + burrowDef = UnitDefNames[burrowName] and UnitDefNames[burrowName].id, + raptorSpawnMultiplier = Spring.GetModOptions().raptor_spawncountmult, + burrowSpawnType = Spring.GetModOptions().raptor_raptorstart, + swarmMode = Spring.GetModOptions().raptor_swarmmode, + spawnSquare = spawnSquare, + spawnSquareIncrement = spawnSquareIncrement, + raptorTurrets = table.copy(raptorTurrets), + miniBosses = miniBosses, + raptorMinions = raptorMinions, + raptorBehaviours = raptorBehaviours, + difficultyParameters = optionValues, + useWaveMsg = useWaveMsg, + burrowSize = burrowSize, + squadSpawnOptionsTable = squadSpawnOptionsTable, + airStartAnger = airStartAnger, + ecoBuildingsPenalty = ecoBuildingsPenalty, + bossFightWaveSizeScale = bossFightWaveSizeScale, defaultRaptorFirestate = defaultRaptorFirestate, - economyScale = economyScale, + economyScale = economyScale, } for key, value in pairs(optionValues[difficulty]) do diff --git a/luarules/configs/scav_spawn_defs.lua b/luarules/configs/scav_spawn_defs.lua index ea29a743856..48903aed9d5 100644 --- a/luarules/configs/scav_spawn_defs.lua +++ b/luarules/configs/scav_spawn_defs.lua @@ -1,178 +1,170 @@ local difficulties = { veryeasy = 1, - easy = 2, - normal = 3, - hard = 4, + easy = 2, + normal = 3, + hard = 4, veryhard = 5, - epic = 6, + epic = 6, --survival = 6, } local difficulty = difficulties[Spring.GetModOptions().scav_difficulty] -local economyScale = 1 * Spring.GetModOptions().multiplier_resourceincome * -(0.67+(Spring.GetModOptions().multiplier_metalextraction*0.33)) * -(0.67+(Spring.GetModOptions().multiplier_energyconversion*0.33)) * -(0.67+(Spring.GetModOptions().multiplier_energyproduction*0.33)) * -(((((Spring.GetModOptions().startmetal - 1000) / 9000) + 1)*0.1)+0.9) * -(((((Spring.GetModOptions().startenergy - 1000) / 9000) + 1)*0.1)+0.9) +local economyScale = 1 * Spring.GetModOptions().multiplier_resourceincome * (0.67 + (Spring.GetModOptions().multiplier_metalextraction * 0.33)) * (0.67 + (Spring.GetModOptions().multiplier_energyconversion * 0.33)) * (0.67 + (Spring.GetModOptions().multiplier_energyproduction * 0.33)) * (((((Spring.GetModOptions().startmetal - 1000) / 9000) + 1) * 0.1) + 0.9) * (((((Spring.GetModOptions().startenergy - 1000) / 9000) + 1) * 0.1) + 0.9) -economyScale = math.min(5, (economyScale*0.33)+0.67) +economyScale = math.min(5, (economyScale * 0.33) + 0.67) local teams = Spring.GetTeamList() local humanTeamCount = -1 -- starts at -1 to disregard gaia local scavTeamCount local scavTeamID for _, teamID in ipairs(teams) do - local teamLuaAI = Spring.GetTeamLuaAI(teamID) + local teamLuaAI = Spring.GetTeamLuaAI(teamID) if not (teamLuaAI and string.find(teamLuaAI, "ScavengersAI")) then humanTeamCount = humanTeamCount + 1 end end - - local difficultyParameters = { [difficulties.veryeasy] = { - gracePeriod = 360 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 65 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 240 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 240 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 500 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 1, - angerBonus = 0.1, - maxXP = 0.1 * economyScale, - spawnChance = 0.1, - damageMod = 0.5, - healthMod = 0.5, - maxBurrows = 1000, - minScavs = 15 * economyScale, - maxScavs = 45 * economyScale, + gracePeriod = 360 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 65 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 240 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 240 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 500 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 1, + angerBonus = 0.1, + maxXP = 0.1 * economyScale, + spawnChance = 0.1, + damageMod = 0.5, + healthMod = 0.5, + maxBurrows = 1000, + minScavs = 15 * economyScale, + maxScavs = 45 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_veryeasy_scav', - bossResistanceMult = 1 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_veryeasy_scav"].health*0.33), + bossName = "scavengerbossv4_veryeasy_scav", + bossResistanceMult = 1 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_veryeasy_scav"].health * 0.33), time = 40, }, }, [difficulties.easy] = { - gracePeriod = 240 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 60 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 200 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 210 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 420 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 1, - angerBonus = 0.15, - maxXP = 0.2 * economyScale, - spawnChance = 0.2, - damageMod = 0.75, - healthMod = 0.75, - maxBurrows = 1000, - minScavs = 15 * economyScale, - maxScavs = 45 * economyScale, + gracePeriod = 240 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 60 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 200 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 210 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 420 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 1, + angerBonus = 0.15, + maxXP = 0.2 * economyScale, + spawnChance = 0.2, + damageMod = 0.75, + healthMod = 0.75, + maxBurrows = 1000, + minScavs = 15 * economyScale, + maxScavs = 45 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_easy_scav', - bossResistanceMult = 1.5 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_easy_scav"].health*0.33), + bossName = "scavengerbossv4_easy_scav", + bossResistanceMult = 1.5 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_easy_scav"].health * 0.33), time = 35, }, }, [difficulties.normal] = { - gracePeriod = 180 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 55 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 180 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 180 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 380 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 3, - angerBonus = 0.2, - maxXP = 0.3 * economyScale, - spawnChance = 0.3, - damageMod = 1, - healthMod = 1, - maxBurrows = 1000, - minScavs = 15 * economyScale, - maxScavs = 45 * economyScale, + gracePeriod = 180 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 55 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 180 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 180 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 380 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 3, + angerBonus = 0.2, + maxXP = 0.3 * economyScale, + spawnChance = 0.3, + damageMod = 1, + healthMod = 1, + maxBurrows = 1000, + minScavs = 15 * economyScale, + maxScavs = 45 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_normal_scav', - bossResistanceMult = 2 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_normal_scav"].health*0.33), + bossName = "scavengerbossv4_normal_scav", + bossResistanceMult = 2 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_normal_scav"].health * 0.33), time = 30, }, }, [difficulties.hard] = { - gracePeriod = 160 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 50 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 160 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 150 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 340 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 3, - angerBonus = 0.25, - maxXP = 0.4 * economyScale, - spawnChance = 0.4, - damageMod = 1, - healthMod = 1, - maxBurrows = 1000, - minScavs = 20 * economyScale, - maxScavs = 60 * economyScale, + gracePeriod = 160 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 50 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 160 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 150 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 340 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 3, + angerBonus = 0.25, + maxXP = 0.4 * economyScale, + spawnChance = 0.4, + damageMod = 1, + healthMod = 1, + maxBurrows = 1000, + minScavs = 20 * economyScale, + maxScavs = 60 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_hard_scav', - bossResistanceMult = 2.5 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_hard_scav"].health*0.33), + bossName = "scavengerbossv4_hard_scav", + bossResistanceMult = 2.5 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_hard_scav"].health * 0.33), time = 30, }, }, [difficulties.veryhard] = { - gracePeriod = 140 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 45 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 140 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 120 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 320 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 3, - angerBonus = 0.30, - maxXP = 0.5 * economyScale, - spawnChance = 0.5, - damageMod = 1, - healthMod = 1, - maxBurrows = 1000, - minScavs = 25 * economyScale, - maxScavs = 75 * economyScale, + gracePeriod = 140 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 45 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 140 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 120 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 320 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 3, + angerBonus = 0.30, + maxXP = 0.5 * economyScale, + spawnChance = 0.5, + damageMod = 1, + healthMod = 1, + maxBurrows = 1000, + minScavs = 25 * economyScale, + maxScavs = 75 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_veryhard_scav', - bossResistanceMult = 3 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_veryhard_scav"].health*0.33), + bossName = "scavengerbossv4_veryhard_scav", + bossResistanceMult = 3 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_veryhard_scav"].health * 0.33), time = 30, }, }, [difficulties.epic] = { - gracePeriod = 120 * Spring.GetModOptions().scav_graceperiodmult, - bossTime = 40 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds - scavSpawnRate = 120 / Spring.GetModOptions().scav_spawntimemult / economyScale, - burrowSpawnRate = 90 / Spring.GetModOptions().scav_spawntimemult / economyScale, - turretSpawnRate = 260 / Spring.GetModOptions().scav_spawntimemult / economyScale, - bossSpawnMult = 3, - angerBonus = 0.35, - maxXP = 0.6 * economyScale, - spawnChance = 0.6, - damageMod = 1, - healthMod = 1, - maxBurrows = 1000, - minScavs = 30 * economyScale, - maxScavs = 90 * economyScale, + gracePeriod = 120 * Spring.GetModOptions().scav_graceperiodmult, + bossTime = 40 * Spring.GetModOptions().scav_bosstimemult * 60, -- time at which the boss appears, seconds + scavSpawnRate = 120 / Spring.GetModOptions().scav_spawntimemult / economyScale, + burrowSpawnRate = 90 / Spring.GetModOptions().scav_spawntimemult / economyScale, + turretSpawnRate = 260 / Spring.GetModOptions().scav_spawntimemult / economyScale, + bossSpawnMult = 3, + angerBonus = 0.35, + maxXP = 0.6 * economyScale, + spawnChance = 0.6, + damageMod = 1, + healthMod = 1, + maxBurrows = 1000, + minScavs = 30 * economyScale, + maxScavs = 90 * economyScale, scavPerPlayerMultiplier = 0.25, - bossName = 'scavengerbossv4_epic_scav', - bossResistanceMult = 3.5 * economyScale, - bossStagger = { - health = math.ceil(UnitDefNames["scavengerbossv4_epic_scav"].health*0.33), + bossName = "scavengerbossv4_epic_scav", + bossResistanceMult = 3.5 * economyScale, + bossStagger = { + health = math.ceil(UnitDefNames["scavengerbossv4_epic_scav"].health * 0.33), time = 30, }, }, - } --[[ @@ -201,13 +193,13 @@ local difficultyParameters = { ]] local tierConfiguration = { -- Double maxSquadSize for special squads - [1] = {minAnger = 0, maxAnger = 20, maxSquadSize = 1}, - [2] = {minAnger = 5, maxAnger = 65, maxSquadSize = 10}, - [3] = {minAnger = 15, maxAnger = 100, maxSquadSize = 10}, - [4] = {minAnger = 30, maxAnger = 200, maxSquadSize = 10}, - [5] = {minAnger = 40, maxAnger = 350, maxSquadSize = 8}, - [6] = {minAnger = 55, maxAnger = 500, maxSquadSize = 5}, - [7] = {minAnger = 65, maxAnger = 1000, maxSquadSize = 3}, + [1] = { minAnger = 0, maxAnger = 20, maxSquadSize = 1 }, + [2] = { minAnger = 5, maxAnger = 65, maxSquadSize = 10 }, + [3] = { minAnger = 15, maxAnger = 100, maxSquadSize = 10 }, + [4] = { minAnger = 30, maxAnger = 200, maxSquadSize = 10 }, + [5] = { minAnger = 40, maxAnger = 350, maxSquadSize = 8 }, + [6] = { minAnger = 55, maxAnger = 500, maxSquadSize = 5 }, + [7] = { minAnger = 65, maxAnger = 1000, maxSquadSize = 3 }, } --local teamAngerEasementFB = 16 @@ -236,10 +228,10 @@ local tierConfiguration = { -- Double maxSquadSize for special squads ---------------------------------------------------------------------------------------------- local BurrowUnitsList = { - ['scavbeacon_t1_scav'] = {minAnger = tierConfiguration[1].minAnger, maxAnger = tierConfiguration[2].maxAnger}, - ['scavbeacon_t2_scav'] = {minAnger = tierConfiguration[2].minAnger, maxAnger = tierConfiguration[3].maxAnger}, - ['scavbeacon_t3_scav'] = {minAnger = tierConfiguration[3].minAnger, maxAnger = tierConfiguration[5].maxAnger}, - ['scavbeacon_t4_scav'] = {minAnger = tierConfiguration[4].minAnger, maxAnger = tierConfiguration[7].maxAnger}, + ["scavbeacon_t1_scav"] = { minAnger = tierConfiguration[1].minAnger, maxAnger = tierConfiguration[2].maxAnger }, + ["scavbeacon_t2_scav"] = { minAnger = tierConfiguration[2].minAnger, maxAnger = tierConfiguration[3].maxAnger }, + ["scavbeacon_t3_scav"] = { minAnger = tierConfiguration[3].minAnger, maxAnger = tierConfiguration[5].maxAnger }, + ["scavbeacon_t4_scav"] = { minAnger = tierConfiguration[4].minAnger, maxAnger = tierConfiguration[7].maxAnger }, } ---------------------------------------------------------------------------------------------- @@ -309,8 +301,6 @@ local LandUnitsList = { --Cortex --Legion - - }, [6] = { --Armada @@ -372,7 +362,6 @@ local LandUnitsList = { ["corhal_scav"] = 4, --Legion ["legshot_scav"] = 4, - }, [5] = { --Armada @@ -491,7 +480,6 @@ local LandUnitsList = { ["legbart_scav"] = 2, ["legsrail_scav"] = 2, ["legvflak_scav"] = 2, - }, [5] = { --Armada @@ -508,7 +496,6 @@ local LandUnitsList = { ["legavroc_scav"] = 2, ["leginf_scav"] = 2, ["legmed_scav"] = 2, - }, [6] = { --Armada @@ -713,13 +700,11 @@ local SeaUnitsList = { --Armada --Cortex - }, [7] = { --Armada --Cortex - }, }, Assault = { @@ -852,7 +837,6 @@ local SeaUnitsList = { --Cortex ["coronager_scav"] = 1, ["cordesolator_scav"] = 1, - }, [7] = { --Armada @@ -1002,7 +986,6 @@ if not Spring.GetModOptions().unit_restrictions_noair then table.append(SeaUnitsList.Healer[7], table.copy(t2seaairconstructors)) end - local AirUnitsList = { Land = { [1] = { @@ -1011,7 +994,6 @@ local AirUnitsList = { --Cortex ["corfink_scav"] = 2, --Legion - }, [2] = { --Armada @@ -1021,7 +1003,6 @@ local AirUnitsList = { ["corbw_scav"] = 2, --Legion ["legfig_scav"] = 2, - }, [3] = { --Armada @@ -1035,7 +1016,6 @@ local AirUnitsList = { ["legmos_scav"] = 2, ["legcib_scav"] = 2, ["legkam_scav"] = 2, - }, [4] = { --Armada @@ -1045,7 +1025,6 @@ local AirUnitsList = { ["corawac_scav"] = 2, --Legion ["legwhisper_scav"] = 2, - }, [5] = { --Armada @@ -1079,7 +1058,6 @@ local AirUnitsList = { --Cortex ["cordronecarryair_scav"] = 2, --Legion - }, [7] = { --Armada @@ -1095,7 +1073,6 @@ local AirUnitsList = { ["legfort_scav"] = 3, ["legmost3_scav"] = 2, ["legfortt4_scav"] = 1, - }, }, Sea = { @@ -1144,7 +1121,7 @@ local AirUnitsList = { ["corseap_scav"] = 2, ["corcut_scav"] = 2, ["cortitan_scav"] = 2, - + ["legatorpbomber"] = 2, }, [6] = { @@ -1160,7 +1137,7 @@ local AirUnitsList = { ["corseap_scav"] = 2, ["corcut_scav"] = 2, ["cortitan_scav"] = 2, - + ["legatorpbomber"] = 2, }, [7] = { @@ -1178,7 +1155,7 @@ local AirUnitsList = { ["legfortt4_scav"] = 3, ["legmost3_scav"] = 2, }, - } + }, } ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- @@ -1190,232 +1167,232 @@ local AirUnitsList = { local Turrets = { [1] = { - ["armllt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10}, - ["corllt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10}, - ["leglht_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10}, - ["armrl_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 10}, - ["corrl_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 10}, - ["cortl_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 4}, - ["armtl_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 4}, - ["armfrt_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2}, - ["corfrt_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2}, + ["armllt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10 }, + ["corllt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10 }, + ["leglht_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 10 }, + ["armrl_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 10 }, + ["corrl_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 10 }, + ["cortl_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 4 }, + ["armtl_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 4 }, + ["armfrt_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corfrt_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2 }, }, [2] = { --["cordl_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1}, --["armdl_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1}, --Sea Only - ["armfhlt_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["corfhlt_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armfrock_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2}, - ["corfrock_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2}, - ["corgplat_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armgplat_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, + ["armfhlt_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corfhlt_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armfrock_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corfrock_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corgplat_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armgplat_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, --Eco - ["armsolar_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corsolar_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legsolar_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armwin_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corwin_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legwin_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legadvsol_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armtide_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 3}, - ["cortide_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 3}, - ["armmstor_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["cormstor_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["armestor_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["corestor_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["armuwms_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, - ["coruwms_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, - ["armuwes_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["coruwes_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armmakr_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["cormakr_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["armfmkr_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, - ["corfmkr_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, + ["armsolar_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corsolar_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legsolar_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armwin_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corwin_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legwin_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legadvsol_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armtide_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 3 }, + ["cortide_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armmstor_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["cormstor_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armestor_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corestor_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armuwms_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, + ["coruwms_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armuwes_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["coruwes_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armmakr_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["cormakr_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armfmkr_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, + ["corfmkr_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, --Factories - ["armlab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armvp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armhp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["corlab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["corvp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["corap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["corhp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["leglab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["legvp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["legap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["leghp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armfhp_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["armsy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["corfhp_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["corsy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["legfhp_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, + ["armlab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armvp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armhp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corlab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corvp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corhp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["leglab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legvp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["leghp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armfhp_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armsy_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corfhp_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corsy_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legfhp_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, --["legsy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, }, [3] = { - ["armbeamer_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["corhllt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["legmg_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["cormaw_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, - ["armclaw_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, - ["legdtr_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, - ["armferret_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["cormadsam_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["corhlt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corpun_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armhlt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5}, - ["armguard_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["legcluster_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corscavdtl_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corscavdtf_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corscavdtm_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["leghive_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, + ["armbeamer_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corhllt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["legmg_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["cormaw_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, + ["armclaw_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, + ["legdtr_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, + ["armferret_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["cormadsam_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corhlt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corpun_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armhlt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armguard_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["legcluster_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corscavdtl_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corscavdtf_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corscavdtm_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["leghive_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, --radar/jam - ["corrad_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corjamt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armrad_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armjamt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armjuno_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["corjuno_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["legjuno_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["legrad_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legjam_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["corrad_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corjamt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armrad_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armjamt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armjuno_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["corjuno_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["legjuno_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["legrad_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legjam_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, }, [4] = { - ["armcir_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corerad_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["leglupara_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, + ["armcir_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corerad_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["leglupara_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, --Sea - ["corfdoom_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["coratl_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["corenaa_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["corason_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 0.4}, - ["armkraken_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armfflak_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armatl_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5}, - ["armason_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 0.4}, + ["corfdoom_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["coratl_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corenaa_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["corason_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 0.4 }, + ["armkraken_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armfflak_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armatl_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 5 }, + ["armason_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 0.4 }, --T2 Radar/jam - ["corarad_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corshroud_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armarad_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armveil_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["corarad_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corshroud_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armarad_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armveil_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, --T2 Popups - ["armlwall_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["cormwall_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["legrwall_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["armpb_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corvipe_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["legbombard_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, + ["armlwall_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["cormwall_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["legrwall_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armpb_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corvipe_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["legbombard_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, --Misc - ["corhllllt_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["armgate_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corgate_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["corhllllt_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armgate_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corgate_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, --T2 AA - ["corflak_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, - ["armflak_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, - ["legflak_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4}, + ["corflak_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, + ["armflak_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, + ["legflak_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.1, maxExisting = 4 }, --Eco - ["armwint2_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corwint2_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["legwint2_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["armfus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["armckfus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["corfus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["armuwfus_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 1, maxExisting = 5}, - ["coruwfus_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 1, maxExisting = 5}, - ["armuwadvms_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1}, - ["coruwadvms_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1}, - ["legamstor_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1}, - ["armuwadves_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 3}, - ["coruwadves_scav"] = {type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 3}, - ["armmmkr_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["cormmkr_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["legadveconv_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["armuwmmm_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, - ["coruwmmm_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, + ["armwint2_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corwint2_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["legwint2_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armfus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["armckfus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["corfus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["armuwfus_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 1, maxExisting = 5 }, + ["coruwfus_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 1, maxExisting = 5 }, + ["armuwadvms_scav"] = { type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1 }, + ["coruwadvms_scav"] = { type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1 }, + ["legamstor_scav"] = { type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armuwadves_scav"] = { type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 3 }, + ["coruwadves_scav"] = { type = "normal", surface = "mixed", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armmmkr_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["cormmkr_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["legadveconv_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armuwmmm_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, + ["coruwmmm_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, -- Factories - ["armalab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armavp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armaap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["coralab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["coravp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["coraap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["legalab_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["legavp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["legaap_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1}, - ["armamsub_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["armasy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["armplat_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["coramsub_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["corasy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["corplat_scav"] = {type = "antiair", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, - ["legamsub_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, + ["armalab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armavp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armaap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["coralab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["coravp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["coraap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legalab_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legavp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legaap_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armamsub_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armasy_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["armplat_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["coramsub_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corasy_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["corplat_scav"] = { type = "antiair", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, + ["legamsub_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1 }, --["legasy_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.05, maxExisting = 1}, }, [5] = { -- T2 popup arty - ["armamb_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["cortoast_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legacluster_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["armamb_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["cortoast_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legacluster_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, -- Pulsar and Bulwark normals - ["armanni_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["cordoom_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legbastion_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["armanni_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["cordoom_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legbastion_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, --LRPC - ["armbrtha_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7}, - ["corint_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7}, - ["leglrpc_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7}, + ["armbrtha_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7 }, + ["corint_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7 }, + ["leglrpc_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.25, maxExisting = 7 }, --antinukes - ["armamd_scav"] = {type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["corfmd_scav"] = {type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 5}, + ["armamd_scav"] = { type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["corfmd_scav"] = { type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, --Tactical Weapons - ["cortron_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["armemp_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["legperdition_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["cortron_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["armemp_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["legperdition_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, --T2 AA - ["armmercury_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2}, - ["corscreamer_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2}, - ["leglraa_scav"] = {type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2}, + ["armmercury_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2 }, + ["corscreamer_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2 }, + ["leglraa_scav"] = { type = "antiair", surface = "land", spawnedPerWave = 1, maxExisting = 2 }, }, [6] = { -- nukes - ["corsilo_scav"] = {type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3}, - ["armsilo_scav"] = {type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3}, - ["legsilo_scav"] = {type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3}, + ["corsilo_scav"] = { type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3 }, + ["armsilo_scav"] = { type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3 }, + ["legsilo_scav"] = { type = "nuke", surface = "land", spawnedPerWave = 1, maxExisting = 3 }, -- misc t3 turrets - ["armminivulc_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["corminibuzz_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["legministarfall_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["armbotrail_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, + ["armminivulc_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["corminibuzz_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["legministarfall_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armbotrail_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, --Eco - ["armafus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["corafus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, - ["legafus_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5}, + ["armafus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["corafus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, + ["legafus_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 5 }, --Factories - ["armshltx_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["corgant_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["leggant_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["armshltxuw_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, - ["corgantuw_scav"] = {type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1}, + ["armshltx_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["corgant_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["leggant_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["armshltxuw_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, + ["corgantuw_scav"] = { type = "normal", surface = "sea", spawnedPerWave = 0.1, maxExisting = 1 }, --misc - ["armgatet3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["corgatet3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, - ["leggatet3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2}, + ["armgatet3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["corgatet3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, + ["leggatet3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 2 }, }, [7] = { --Epic Bulwark and Pulsar/rag/cal - ["armannit3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["cordoomt3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3}, - ["armvulc_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["corbuzz_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, - ["legstarfall_scav"] = {type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1}, + ["armannit3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["cordoomt3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 0.1, maxExisting = 3 }, + ["armvulc_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["corbuzz_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, + ["legstarfall_scav"] = { type = "lrpc", surface = "land", spawnedPerWave = 0.1, maxExisting = 1 }, --Eco - ["armafust3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, - ["corafust3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, - ["legafust3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, - ["armmmkrt3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, - ["cormmkrt3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, - ["legadveconvt3_scav"] = {type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1}, + ["armafust3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, + ["corafust3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, + ["legafust3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, + ["armmmkrt3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, + ["cormmkrt3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, + ["legadveconvt3_scav"] = { type = "normal", surface = "land", spawnedPerWave = 1, maxExisting = 1 }, }, } @@ -1427,10 +1404,7 @@ local scavTurrets = {} -- Turrets table creation loop for tier, _ in pairs(Turrets) do for turret, turretInfo in pairs(Turrets[tier]) do - if (not scavTurrets[turret]) and - (not ( Spring.GetModOptions().unit_restrictions_noair and turretInfo.type == "antiair")) and - (not ( Spring.GetModOptions().unit_restrictions_nonukes and turretInfo.type == "nuke")) and - (not (Spring.GetModOptions().unit_restrictions_nolrpc and turretInfo.type == "lrpc")) then + if (not scavTurrets[turret]) and not (Spring.GetModOptions().unit_restrictions_noair and turretInfo.type == "antiair") and not (Spring.GetModOptions().unit_restrictions_nonukes and turretInfo.type == "nuke") and not (Spring.GetModOptions().unit_restrictions_nolrpc and turretInfo.type == "lrpc") then scavTurrets[turret] = { minBossAnger = tierConfiguration[tier].minAnger, spawnedPerWave = turretInfo.spawnedPerWave or 1, @@ -1510,78 +1484,77 @@ scavBehaviours = { [UnitDefNames["squadcorakt4_scav"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["squadarmsptkt4_scav"].id] = { distance = 500, chance = 0.001 }, [UnitDefNames["squadcorkarganetht4_scav"].id] = { distance = 500, chance = 0.001 }, - }, COWARD = { -- Run away from target after getting hit by enemy - [UnitDefNames["legcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl2_scav"].id] = { distance = 150, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl3_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl4_scav"].id] = { distance = 250, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl5_scav"].id] = { distance = 300, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl6_scav"].id] = { distance = 350, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl7_scav"].id] = { distance = 400, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl8_scav"].id] = { distance = 450, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl9_scav"].id] = { distance = 500, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legcomlvl10_scav"].id] = { distance = 550, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl2_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl3_scav"].id] = { distance = 300, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl4_scav"].id] = { distance = 400, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl5_scav"].id] = { distance = 500, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl6_scav"].id] = { distance = 600, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl7_scav"].id] = { distance = 700, chance = 0.01, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl8_scav"].id] = { distance = 800, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl9_scav"].id] = { distance = 900, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armcomlvl10_scav"].id] = { distance = 1000, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["corcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["corcomlvl2_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["corcomlvl3_scav"].id] = { distance = 300, chance = 0.1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["corcomlvl4_scav"].id] = { distance = 400, chance = 0.1, teleport = true, teleportcooldown = 60, }, - - [UnitDefNames["armdecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["armdecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - - [UnitDefNames["cordecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["cordecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - - [UnitDefNames["legdecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["legdecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60, }, + [UnitDefNames["legcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl2_scav"].id] = { distance = 150, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl3_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl4_scav"].id] = { distance = 250, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl5_scav"].id] = { distance = 300, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl6_scav"].id] = { distance = 350, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl7_scav"].id] = { distance = 400, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl8_scav"].id] = { distance = 450, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl9_scav"].id] = { distance = 500, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legcomlvl10_scav"].id] = { distance = 550, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl2_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl3_scav"].id] = { distance = 300, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl4_scav"].id] = { distance = 400, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl5_scav"].id] = { distance = 500, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl6_scav"].id] = { distance = 600, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl7_scav"].id] = { distance = 700, chance = 0.01, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl8_scav"].id] = { distance = 800, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl9_scav"].id] = { distance = 900, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armcomlvl10_scav"].id] = { distance = 1000, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["corcom_scav"].id] = { distance = 100, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["corcomlvl2_scav"].id] = { distance = 200, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["corcomlvl3_scav"].id] = { distance = 300, chance = 0.1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["corcomlvl4_scav"].id] = { distance = 400, chance = 0.1, teleport = true, teleportcooldown = 60 }, + + [UnitDefNames["armdecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["armdecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + + [UnitDefNames["cordecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["cordecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + + [UnitDefNames["legdecom_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl2_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl3_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl4_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl5_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl6_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl7_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl8_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl9_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["legdecomlvl10_scav"].id] = { distance = 1000, chance = 1, teleport = true, teleportcooldown = 60 }, [UnitDefNames["squadarmpwt4_scav"].id] = { distance = 500, chance = 0.1 }, [UnitDefNames["squadcorakt4_scav"].id] = { distance = 500, chance = 0.1 }, [UnitDefNames["squadarmsptkt4_scav"].id] = { distance = 500, chance = 0.1 }, [UnitDefNames["squadcorkarganetht4_scav"].id] = { distance = 500, chance = 0.1 }, - [UnitDefNames["scavengerbossv4_veryeasy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 60, }, - [UnitDefNames["scavengerbossv4_easy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 50, }, - [UnitDefNames["scavengerbossv4_normal"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 40, }, - [UnitDefNames["scavengerbossv4_hard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 30, }, - [UnitDefNames["scavengerbossv4_veryhard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 20, }, - [UnitDefNames["scavengerbossv4_epic"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 10, }, + [UnitDefNames["scavengerbossv4_veryeasy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 60 }, + [UnitDefNames["scavengerbossv4_easy"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 50 }, + [UnitDefNames["scavengerbossv4_normal"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 40 }, + [UnitDefNames["scavengerbossv4_hard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 30 }, + [UnitDefNames["scavengerbossv4_veryhard"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 20 }, + [UnitDefNames["scavengerbossv4_epic"].id] = { distance = 750, chance = 0.001, teleport = true, teleportcooldown = 10 }, }, BERSERK = { -- Run towards target after getting hit by enemy or after hitting the target [UnitDefNames["armcomlvl5_scav"].id] = { distance = 5000, chance = 0.01 }, @@ -1602,14 +1575,14 @@ scavBehaviours = { [UnitDefNames["legcomlvl8_scav"].id] = { distance = 5000, chance = 0.01 }, [UnitDefNames["legcomlvl9_scav"].id] = { distance = 5000, chance = 0.01 }, [UnitDefNames["legcomlvl10_scav"].id] = { distance = 5000, chance = 0.01 }, - [UnitDefNames["scavmist_scav"].id] = { distance = 2000, chance = 1}, - [UnitDefNames["scavmistxl_scav"].id] = { distance = 2000, chance = 1}, - [UnitDefNames["scavmistxxl_scav"].id] = { distance = 2000, chance = 1}, + [UnitDefNames["scavmist_scav"].id] = { distance = 2000, chance = 1 }, + [UnitDefNames["scavmistxl_scav"].id] = { distance = 2000, chance = 1 }, + [UnitDefNames["scavmistxxl_scav"].id] = { distance = 2000, chance = 1 }, }, HEALER = { -- Getting long max lifetime and always use Fight command. These units spawn as healers from burrows and boss --[UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = true, - [UnitDefNames["armrectr_scav"].id] = true,--Armada Rezzer - [UnitDefNames["cornecro_scav"].id] = true,--Cortex Rezzer + [UnitDefNames["armrectr_scav"].id] = true, --Armada Rezzer + [UnitDefNames["cornecro_scav"].id] = true, --Cortex Rezzer [UnitDefNames["armca_scav"].id] = true, [UnitDefNames["armaca_scav"].id] = true, [UnitDefNames["armfify_scav"].id] = true, @@ -1620,7 +1593,6 @@ scavBehaviours = { [UnitDefNames["legca_scav"].id] = true, [UnitDefNames["legaca_scav"].id] = true, - [UnitDefNames["armcom_scav"].id] = true, [UnitDefNames["corcom_scav"].id] = true, [UnitDefNames["legcom_scav"].id] = true, @@ -1694,13 +1666,13 @@ scavBehaviours = { }, KAMIKAZE = { -- Long lifetime and no regrouping, always uses Move command to rush into the enemy --[UnitDefNames["raptor_land_kamikaze_basic_t2_v1"].id] = true, - [UnitDefNames["scavmist_scav"].id] = true, - [UnitDefNames["scavmistxl_scav"].id] = true, - [UnitDefNames["scavmistxxl_scav"].id] = true, - [UnitDefNames["armvadert4_scav"].id] = true, + [UnitDefNames["scavmist_scav"].id] = true, + [UnitDefNames["scavmistxl_scav"].id] = true, + [UnitDefNames["scavmistxxl_scav"].id] = true, + [UnitDefNames["armvadert4_scav"].id] = true, }, ALWAYSMOVE = { -- Always use Move command, no matter what category this unit is in - [UnitDefNames["cormandot4_scav"].id] = true, + [UnitDefNames["cormandot4_scav"].id] = true, }, ALWAYSFIGHT = { -- Always use Fight command, no matter what category this unit is in }, @@ -1724,81 +1696,78 @@ local squadSpawnOptionsTable = { healerLand = {}, -- Healers/Medics healerSea = {}, -- Healers/Medics commanders = { - ["armcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, - ["armcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, - ["armcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, - ["armcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, - ["armcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, - ["armcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, - ["armcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, - ["armcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["armcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, - ["armcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, - ["corcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, - ["corcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, - ["corcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, - ["corcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, - ["corcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, - ["corcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, - ["corcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, - ["corcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["corcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, - ["corcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, - ["legcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, - ["legcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, - ["legcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, - ["legcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, - ["legcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, - ["legcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, - ["legcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, - ["legcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["legcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, - ["legcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, - - + ["armcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, + ["armcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, + ["armcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, + ["armcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, + ["armcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, + ["armcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, + ["armcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, + ["armcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["armcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["armcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, + ["corcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, + ["corcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, + ["corcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, + ["corcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, + ["corcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, + ["corcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, + ["corcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, + ["corcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["corcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["corcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, + ["legcom_scav"] = { minAnger = 2, maxAnger = 25, maxAlive = 1 }, + ["legcomlvl2_scav"] = { minAnger = 15, maxAnger = 30, maxAlive = 1 }, + ["legcomlvl3_scav"] = { minAnger = 20, maxAnger = 40, maxAlive = 1 }, + ["legcomlvl4_scav"] = { minAnger = 30, maxAnger = 50, maxAlive = 1 }, + ["legcomlvl5_scav"] = { minAnger = 40, maxAnger = 60, maxAlive = 1 }, + ["legcomlvl6_scav"] = { minAnger = 50, maxAnger = 70, maxAlive = 1 }, + ["legcomlvl7_scav"] = { minAnger = 60, maxAnger = 80, maxAlive = 1 }, + ["legcomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["legcomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["legcomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 4 }, }, decoyCommanders = { - ["armdecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["armdecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["armdecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["armdecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, ["armdecomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 1 }, - ["cordecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["cordecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["cordecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["cordecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, ["cordecomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 1 }, - - ["legdecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, - ["legdecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, + ["legdecom_scav"] = { minAnger = 0, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl2_scav"] = { minAnger = 10, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl3_scav"] = { minAnger = 20, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl4_scav"] = { minAnger = 30, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl5_scav"] = { minAnger = 40, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl6_scav"] = { minAnger = 50, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl7_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl8_scav"] = { minAnger = 70, maxAnger = 1000, maxAlive = 1 }, + ["legdecomlvl9_scav"] = { minAnger = 80, maxAnger = 1000, maxAlive = 1 }, ["legdecomlvl10_scav"] = { minAnger = 90, maxAnger = 1000, maxAlive = 1 }, ["cormandot4_scav"] = { minAnger = 60, maxAnger = 1000, maxAlive = 4 }, - } + }, --frontbusters = { --- + -- -- ----Tier 1 [1]---- --- + -- -- --land -- { name = "armfboy_scav", minAnger = fBusterConfig[1].minAnger, maxAnger = fBusterConfig[1].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, -- { name = "armmanni_scav", minAnger = fBusterConfig[1].minAnger, maxAnger = fBusterConfig[1].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1811,7 +1780,7 @@ local squadSpawnOptionsTable = { -- --sea -- { name = "armcrus_scav", minAnger = fBusterConfig[1].minAnger, maxAnger = fBusterConfig[1].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "corcrus_scav", minAnger = fBusterConfig[1].minAnger, maxAnger = fBusterConfig[1].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, --- + -- -- ----Tier 1.5 [2]---- -- --land -- { name = "armassimilator_scav", minAnger = fBusterConfig[2].minAnger, maxAnger = fBusterConfig[2].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1830,9 +1799,9 @@ local squadSpawnOptionsTable = { -- { name = "corsentinel_scav", minAnger = fBusterConfig[2].minAnger, maxAnger = fBusterConfig[2].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "cordronecarry_scav", minAnger = fBusterConfig[2].minAnger, maxAnger = fBusterConfig[2].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "cormship_scav", minAnger = fBusterConfig[2].minAnger, maxAnger = fBusterConfig[2].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, --- - -- --- + -- + -- + -- -- ----Tier 2, [3]---- -- --land -- { name = "armraz_scav", minAnger = fBusterConfig[3].minAnger, maxAnger = fBusterConfig[3].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1846,7 +1815,7 @@ local squadSpawnOptionsTable = { -- --sea -- { name = "armbats_scav", minAnger = fBusterConfig[3].minAnger, maxAnger = fBusterConfig[3].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "corbats_scav", minAnger = fBusterConfig[3].minAnger, maxAnger = fBusterConfig[3].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, --- + -- -- ----Tier 2.5 [4]---- -- { name = "armpwt4_scav", minAnger = fBusterConfig[4].minAnger, maxAnger = fBusterConfig[4].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, -- { name = "cordemon_scav", minAnger = fBusterConfig[4].minAnger, maxAnger = fBusterConfig[4].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1859,7 +1828,7 @@ local squadSpawnOptionsTable = { -- --sea -- { name = "armbats_scav", minAnger = fBusterConfig[4].minAnger, maxAnger = fBusterConfig[4].maxAnger, squadSize = 2, maxAlive = 2, surface = "sea" }, -- { name = "corbats_scav", minAnger = fBusterConfig[4].minAnger, maxAnger = fBusterConfig[4].maxAnger, squadSize = 2, maxAlive = 2, surface = "sea" }, --- + -- -- ----Tier 3 [5]---- -- --land -- { name = "armthor_scav", minAnger = fBusterConfig[5].minAnger, maxAnger = fBusterConfig[5].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1877,8 +1846,8 @@ local squadSpawnOptionsTable = { -- { name = "armdecadet3", minAnger = fBusterConfig[5].minAnger, maxAnger = fBusterConfig[5].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "corslrpc", minAnger = fBusterConfig[5].minAnger, maxAnger = fBusterConfig[5].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "armpshipt3", minAnger = fBusterConfig[5].minAnger, maxAnger = fBusterConfig[5].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, - -- --- + -- + -- -- ----Tier 3.5 [6]---- -- --land -- { name = "corkarganetht4_scav", minAnger = fBusterConfig[6].minAnger, maxAnger = fBusterConfig[6].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1894,7 +1863,7 @@ local squadSpawnOptionsTable = { -- { name = "armdecadet3_scav", minAnger = fBusterConfig[6].minAnger, maxAnger = fBusterConfig[6].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "armepoch_scav", minAnger = fBusterConfig[6].minAnger, maxAnger = fBusterConfig[6].maxAnger, squadSize = 1, maxAlive = 1, surface = "sea" }, -- { name = "corslrpc_scav", minAnger = fBusterConfig[6].minAnger, maxAnger = fBusterConfig[6].maxAnger, squadSize = 2, maxAlive = 2, surface = "sea" }, --- + -- -- ----Tier 4 [7]---- -- --land -- { name = "squadcorkarganetht4_scav", minAnger = fBusterConfig[7].minAnger, maxAnger = fBusterConfig[7].maxAnger, squadSize = 1, maxAlive = 1, surface = "land" }, @@ -1911,13 +1880,23 @@ local scavMinions = {} -- Units spawning other units local function addNewSquad(squadParams) -- params: {type = "basic", minAnger = 0, maxAnger = 100, units = {"1 raptor1"}, weight = 1} if squadParams then -- Just in case - if not squadParams.units then return end - if not squadParams.minAnger then squadParams.minAnger = 0 end - if not squadParams.maxAnger then squadParams.maxAnger = squadParams.minAnger + 100 end -- Eliminate squads 100% after they're introduced by default, can be overwritten - if squadParams.maxAnger >= 1000 then squadParams.maxAnger = 1000 end -- basically infinite, anger caps at 999 - if not squadParams.weight then squadParams.weight = 1 end - for _ = 1,squadParams.weight do - table.insert(squadSpawnOptionsTable[squadParams.type], {minAnger = squadParams.minAnger, maxAnger = squadParams.maxAnger, units = squadParams.units, weight = squadParams.weight}) + if not squadParams.units then + return + end + if not squadParams.minAnger then + squadParams.minAnger = 0 + end + if not squadParams.maxAnger then + squadParams.maxAnger = squadParams.minAnger + 100 + end -- Eliminate squads 100% after they're introduced by default, can be overwritten + if squadParams.maxAnger >= 1000 then + squadParams.maxAnger = 1000 + end -- basically infinite, anger caps at 999 + if not squadParams.weight then + squadParams.weight = 1 + end + for _ = 1, squadParams.weight do + table.insert(squadSpawnOptionsTable[squadParams.type], { minAnger = squadParams.minAnger, maxAnger = squadParams.maxAnger, units = squadParams.units, weight = squadParams.weight }) end end end @@ -1936,8 +1915,8 @@ for tier, _ in pairs(LandUnitsList.Raid) do minAnger = tierConfiguration[tier].minAnger, maxAnger = tierConfiguration[tier].maxAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) addNewSquad({ type = "specialLand", @@ -1945,8 +1924,8 @@ for tier, _ in pairs(LandUnitsList.Raid) do minAnger = tierConfiguration[tier].minAnger, maxAnger = tierConfiguration[tier].maxAnger, units = { - {count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName }, + }, }) end end @@ -1957,16 +1936,16 @@ for tier, _ in pairs(LandUnitsList.Assault) do if UnitDefNames[unitName] then local unitWeight = LandUnitsList.Assault[tier][unitName] if not scavBehaviours.BERSERK[UnitDefNames[unitName].id] then - scavBehaviours.BERSERK[UnitDefNames[unitName].id] = {distance = 2000, chance = 0.01} + scavBehaviours.BERSERK[UnitDefNames[unitName].id] = { distance = 2000, chance = 0.01 } end - addNewSquad({ + addNewSquad({ type = "basicLand", weight = unitWeight, maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) addNewSquad({ type = "specialLand", @@ -1974,8 +1953,8 @@ for tier, _ in pairs(LandUnitsList.Assault) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize*2, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName }, + }, }) end end @@ -1986,8 +1965,8 @@ for tier, _ in pairs(LandUnitsList.Support) do if UnitDefNames[unitName] then local unitWeight = LandUnitsList.Support[tier][unitName] if not scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] then - scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = {distance = 500, chance = 0.1} - scavBehaviours.COWARD[UnitDefNames[unitName].id] = {distance = 500, chance = 0.75} + scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = { distance = 500, chance = 0.1 } + scavBehaviours.COWARD[UnitDefNames[unitName].id] = { distance = 500, chance = 0.75 } scavBehaviours.ARTILLERY[UnitDefNames[unitName].id] = true end addNewSquad({ @@ -1996,8 +1975,8 @@ for tier, _ in pairs(LandUnitsList.Support) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) addNewSquad({ type = "specialLand", @@ -2005,8 +1984,8 @@ for tier, _ in pairs(LandUnitsList.Support) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize*2, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName }, + }, }) end end @@ -2019,8 +1998,8 @@ for tier, _ in pairs(LandUnitsList.Healer) do if not scavBehaviours.HEALER[UnitDefNames[unitName].id] then scavBehaviours.HEALER[UnitDefNames[unitName].id] = true if not scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] then - scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = {distance = 500, chance = 0.1} - scavBehaviours.COWARD[UnitDefNames[unitName].id] = {distance = 500, chance = 0.75} + scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = { distance = 500, chance = 0.1 } + scavBehaviours.COWARD[UnitDefNames[unitName].id] = { distance = 500, chance = 0.75 } end end addNewSquad({ @@ -2029,8 +2008,8 @@ for tier, _ in pairs(LandUnitsList.Healer) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) end end @@ -2050,8 +2029,8 @@ for tier, _ in pairs(SeaUnitsList.Raid) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.25), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.25), unit = unitName }, + }, }) addNewSquad({ type = "specialSea", @@ -2059,8 +2038,8 @@ for tier, _ in pairs(SeaUnitsList.Raid) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.5), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.5), unit = unitName }, + }, }) end end @@ -2071,7 +2050,7 @@ for tier, _ in pairs(SeaUnitsList.Assault) do if UnitDefNames[unitName] then local unitWeight = SeaUnitsList.Assault[tier][unitName] if not scavBehaviours.BERSERK[UnitDefNames[unitName].id] then - scavBehaviours.BERSERK[UnitDefNames[unitName].id] = {distance = 2000, chance = 0.01} + scavBehaviours.BERSERK[UnitDefNames[unitName].id] = { distance = 2000, chance = 0.01 } end addNewSquad({ type = "basicSea", @@ -2079,8 +2058,8 @@ for tier, _ in pairs(SeaUnitsList.Assault) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.25), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.25), unit = unitName }, + }, }) addNewSquad({ type = "specialSea", @@ -2088,8 +2067,8 @@ for tier, _ in pairs(SeaUnitsList.Assault) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.5), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.5), unit = unitName }, + }, }) end end @@ -2100,8 +2079,8 @@ for tier, _ in pairs(SeaUnitsList.Support) do if UnitDefNames[unitName] then local unitWeight = SeaUnitsList.Support[tier][unitName] if not scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] then - scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = {distance = 500, chance = 0.1} - scavBehaviours.COWARD[UnitDefNames[unitName].id] = {distance = 500, chance = 0.75} + scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = { distance = 500, chance = 0.1 } + scavBehaviours.COWARD[UnitDefNames[unitName].id] = { distance = 500, chance = 0.75 } scavBehaviours.ARTILLERY[UnitDefNames[unitName].id] = true end addNewSquad({ @@ -2110,8 +2089,8 @@ for tier, _ in pairs(SeaUnitsList.Support) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.25), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.25), unit = unitName }, + }, }) addNewSquad({ type = "specialSea", @@ -2119,8 +2098,8 @@ for tier, _ in pairs(SeaUnitsList.Support) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.5), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.5), unit = unitName }, + }, }) end end @@ -2133,8 +2112,8 @@ for tier, _ in pairs(SeaUnitsList.Healer) do if not scavBehaviours.HEALER[UnitDefNames[unitName].id] then scavBehaviours.HEALER[UnitDefNames[unitName].id] = true if not scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] then - scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = {distance = 500, chance = 0.1} - scavBehaviours.COWARD[UnitDefNames[unitName].id] = {distance = 500, chance = 0.75} + scavBehaviours.SKIRMISH[UnitDefNames[unitName].id] = { distance = 500, chance = 0.1 } + scavBehaviours.COWARD[UnitDefNames[unitName].id] = { distance = 500, chance = 0.75 } end end addNewSquad({ @@ -2143,8 +2122,8 @@ for tier, _ in pairs(SeaUnitsList.Healer) do maxAnger = tierConfiguration[tier].maxAnger, minAnger = tierConfiguration[tier].minAnger, units = { - {count = math.ceil(tierConfiguration[tier].maxSquadSize*0.25), unit = unitName} - } + { count = math.ceil(tierConfiguration[tier].maxSquadSize * 0.25), unit = unitName }, + }, }) end end @@ -2164,8 +2143,8 @@ for tier, _ in pairs(AirUnitsList.Land) do maxAnger = 1000, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) addNewSquad({ type = "specialAirLand", @@ -2173,8 +2152,8 @@ for tier, _ in pairs(AirUnitsList.Land) do maxAnger = 1000, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize*2, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName }, + }, }) end end @@ -2190,8 +2169,8 @@ for tier, _ in pairs(AirUnitsList.Sea) do maxAnger = 1000, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize, unit = unitName }, + }, }) addNewSquad({ type = "specialAirSea", @@ -2199,8 +2178,8 @@ for tier, _ in pairs(AirUnitsList.Sea) do maxAnger = 1000, minAnger = tierConfiguration[tier].minAnger, units = { - {count = tierConfiguration[tier].maxSquadSize*2, unit = unitName} - } + { count = tierConfiguration[tier].maxSquadSize * 2, unit = unitName }, + }, }) end end @@ -2212,9 +2191,9 @@ addNewSquad({ minAnger = tierConfiguration[2].minAnger, maxAnger = 1000, units = { - {count = 5, unit = "armrectr_scav"}, - {count = 5, unit = "cornecro_scav"} - } + { count = 5, unit = "armrectr_scav" }, + { count = 5, unit = "cornecro_scav" }, + }, }) --Rezzers addNewSquad({ type = "healerLand", @@ -2222,9 +2201,9 @@ addNewSquad({ minAnger = tierConfiguration[4].minAnger, maxAnger = 1000, units = { - {count = 10, unit = "armrectr_scav"}, - {count = 10, unit = "cornecro_scav"} - } + { count = 10, unit = "armrectr_scav" }, + { count = 10, unit = "cornecro_scav" }, + }, }) --Rezzers addNewSquad({ type = "healerLand", @@ -2232,21 +2211,21 @@ addNewSquad({ minAnger = tierConfiguration[6].minAnger, maxAnger = 1000, units = { - {count = 20, unit = "armrectr_scav"}, - {count = 20, unit = "cornecro_scav"} - } + { count = 20, unit = "armrectr_scav" }, + { count = 20, unit = "cornecro_scav" }, + }, }) --Rezzers --Land addNewSquad({ type = "specialLand", - weight = 6, + weight = 6, maxAnger = tierConfiguration[2].maxAnger, minAnger = tierConfiguration[2].minAnger, units = { - {count = 13, unit = "armfav_scav"}, - {count = 13, unit = "corfav_scav"}, - {count = 13, unit = "legscout_scav"} - } + { count = 13, unit = "armfav_scav" }, + { count = 13, unit = "corfav_scav" }, + { count = 13, unit = "legscout_scav" }, + }, }) --Rovers/Whole Tier Length addNewSquad({ type = "specialLand", @@ -2254,11 +2233,11 @@ addNewSquad({ maxAnger = tierConfiguration[2].maxAnger, minAnger = tierConfiguration[2].minAnger, units = { - {count = 6, unit = "armflash_scav"}, - {count = 6, unit = "corgator_scav"}, - {count = 6, unit = "leghelios_scav"}, - {count = 6, unit = "leghades_scav"} - } + { count = 6, unit = "armflash_scav" }, + { count = 6, unit = "corgator_scav" }, + { count = 6, unit = "leghelios_scav" }, + { count = 6, unit = "leghades_scav" }, + }, }) --T1 Veh Raid addNewSquad({ type = "specialLand", @@ -2266,11 +2245,11 @@ addNewSquad({ maxAnger = tierConfiguration[3].maxAnger, minAnger = tierConfiguration[3].minAnger, units = { - {count = 5, unit = "armstump_scav"}, - {count = 5, unit = "corraid_scav"}, - {count = 5, unit = "leggat_scav"}, - {count = 5, unit = "leghades_scav"} - } + { count = 5, unit = "armstump_scav" }, + { count = 5, unit = "corraid_scav" }, + { count = 5, unit = "leggat_scav" }, + { count = 5, unit = "leghades_scav" }, + }, }) --T1 Veh Assault addNewSquad({ type = "specialLand", @@ -2278,11 +2257,11 @@ addNewSquad({ maxAnger = tierConfiguration[3].maxAnger, minAnger = tierConfiguration[3].minAnger, units = { - {count = 2, unit = "armjanus_scav"}, - {count = 2, unit = "corlevlr_scav"}, - {count = 2, unit = "legrail_scav"}, - {count = 6, unit = "leghades_scav"} - } + { count = 2, unit = "armjanus_scav" }, + { count = 2, unit = "corlevlr_scav" }, + { count = 2, unit = "legrail_scav" }, + { count = 6, unit = "leghades_scav" }, + }, }) --T1 Veh Unique addNewSquad({ type = "specialLand", @@ -2290,13 +2269,13 @@ addNewSquad({ maxAnger = tierConfiguration[3].maxAnger, minAnger = tierConfiguration[3].minAnger, units = { - {count = 1,unit = "armart_scav"}, - {count = 2, unit = "armsam_scav"}, - {count = 1, unit = "corwolv_scav"}, - {count = 2, unit = "cormist_scav"}, - {count = 2, unit = "legbar_scav"}, - {count = 8, unit = "leghades_scav"} - } + { count = 1, unit = "armart_scav" }, + { count = 2, unit = "armsam_scav" }, + { count = 1, unit = "corwolv_scav" }, + { count = 2, unit = "cormist_scav" }, + { count = 2, unit = "legbar_scav" }, + { count = 8, unit = "leghades_scav" }, + }, }) --T1 Arty/AA --air addNewSquad({ @@ -2305,10 +2284,10 @@ addNewSquad({ minAnger = tierConfiguration[2].minAnger, maxAnger = 1000, units = { - {count = 3, unit = "armpeep_scav"}, - {count = 3, unit = "corfink_scav"}, - {count = 9, unit = "legfig_scav"} - } + { count = 3, unit = "armpeep_scav" }, + { count = 3, unit = "corfink_scav" }, + { count = 9, unit = "legfig_scav" }, + }, }) --T1 Air Scouts addNewSquad({ type = "specialAirLand", @@ -2316,19 +2295,18 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[3].minAnger, units = { - {count = 12, unit = "corbw_scav"} - } + { count = 12, unit = "corbw_scav" }, + }, }) --Bladewings addNewSquad({ type = "specialAirLand", weight = 4, maxAnger = 1000, minAnger = tierConfiguration[3].minAnger, - units = - { - {count = 20, unit = "armfig_scav"}, - {count = 20, unit = "corveng_scav"} - } + units = { + { count = 20, unit = "armfig_scav" }, + { count = 20, unit = "corveng_scav" }, + }, }) --Fighters addNewSquad({ type = "specialAirSea", @@ -2336,9 +2314,9 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[3].minAnger, units = { - {count = 20, unit = "armsfig_scav"}, - {count = 20, unit = "corsfix_scav"} - } + { count = 20, unit = "armsfig_scav" }, + { count = 20, unit = "corsfix_scav" }, + }, }) --T2 Fighters addNewSquad({ type = "specialAirLand", @@ -2346,10 +2324,10 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[3].minAnger, units = { - {count = 12, unit = "armthund_scav"}, - {count = 12, unit = "corshad_scav"}, - {count = 5, unit = "legcib_scav"} - } + { count = 12, unit = "armthund_scav" }, + { count = 12, unit = "corshad_scav" }, + { count = 5, unit = "legcib_scav" }, + }, }) --Bombers ------Tier 2 25-60% addNewSquad({ @@ -2358,10 +2336,10 @@ addNewSquad({ maxAnger = tierConfiguration[4].maxAnger, minAnger = tierConfiguration[4].minAnger, units = { - {count = 10, unit = "armfav_scav"}, - {count = 10, unit = "corfav_scav"}, - {count = 25, unit = "armzapper_scav"} - } + { count = 10, unit = "armfav_scav" }, + { count = 10, unit = "corfav_scav" }, + { count = 25, unit = "armzapper_scav" }, + }, }) --Rover and EMP Rover/Whole Tier Length --Land addNewSquad({ @@ -2370,10 +2348,10 @@ addNewSquad({ maxAnger = tierConfiguration[4].maxAnger, minAnger = tierConfiguration[4].minAnger, units = { - {count = 6, unit = "armlatnk_scav"}, - {count = 6, unit = "cortorch_scav"}, - {count = 6, unit = "legmrv_scav"} - } + { count = 6, unit = "armlatnk_scav" }, + { count = 6, unit = "cortorch_scav" }, + { count = 6, unit = "legmrv_scav" }, + }, }) --T2 Veh Raid addNewSquad({ type = "specialLand", @@ -2381,14 +2359,14 @@ addNewSquad({ maxAnger = tierConfiguration[4].maxAnger, minAnger = tierConfiguration[4].minAnger, units = { - {count = 6, unit = "armbull_scav"}, - {count = 6, unit = "correap_scav"}, - {count = 1, unit = "corgol_scav"}, - {count = 2, unit = "legaheattank_scav"}, - {count = 2, unit = "armyork_scav"}, - {count = 2, unit = "corsent_scav"}, - {count = 2, unit = "legvflak_scav"} - } + { count = 6, unit = "armbull_scav" }, + { count = 6, unit = "correap_scav" }, + { count = 1, unit = "corgol_scav" }, + { count = 2, unit = "legaheattank_scav" }, + { count = 2, unit = "armyork_scav" }, + { count = 2, unit = "corsent_scav" }, + { count = 2, unit = "legvflak_scav" }, + }, }) --T2 Veh Assault/AA addNewSquad({ type = "specialLand", @@ -2396,10 +2374,10 @@ addNewSquad({ maxAnger = tierConfiguration[5].maxAnger, minAnger = tierConfiguration[5].minAnger, units = { - {count = 2, unit = "armmanni_scav"}, - {count = 2, unit = "corban_scav"}, - {count = 1, unit = "legvcarry_scav"} - } + { count = 2, unit = "armmanni_scav" }, + { count = 2, unit = "corban_scav" }, + { count = 1, unit = "legvcarry_scav" }, + }, }) --T2 Veh Unique addNewSquad({ type = "specialLand", @@ -2407,15 +2385,15 @@ addNewSquad({ maxAnger = tierConfiguration[5].maxAnger, minAnger = tierConfiguration[5].minAnger, units = { - {count = 3, unit = "armmart_scav"}, - {count = 1, unit = "armmerl_scav"}, - {count = 1, unit = "armyork_scav"}, - {count = 3, unit = "cormart_scav"}, - {count = 1, unit = "corvroc_scav"}, - {count = 1, unit = "corsent_scav"}, - {count = 2, unit = "legvflak_scav"}, - {count = 1, unit = "leginf_scav"} - } + { count = 3, unit = "armmart_scav" }, + { count = 1, unit = "armmerl_scav" }, + { count = 1, unit = "armyork_scav" }, + { count = 3, unit = "cormart_scav" }, + { count = 1, unit = "corvroc_scav" }, + { count = 1, unit = "corsent_scav" }, + { count = 2, unit = "legvflak_scav" }, + { count = 1, unit = "leginf_scav" }, + }, }) --T2 Arty/AA --air addNewSquad({ @@ -2424,9 +2402,9 @@ addNewSquad({ minAnger = tierConfiguration[5].minAnger, maxAnger = 1000, units = { - {count = 3, unit = "armawac_scav"}, - {count = 3, unit = "corawac_scav"} - } + { count = 3, unit = "armawac_scav" }, + { count = 3, unit = "corawac_scav" }, + }, }) --T2 Air Scouts addNewSquad({ type = "specialAirLand", @@ -2434,8 +2412,8 @@ addNewSquad({ minAnger = tierConfiguration[5].minAnger, maxAnger = 1000, units = { - {count = 2, unit = "armstil_scav"} - } + { count = 2, unit = "armstil_scav" }, + }, }) --EMP Bombers addNewSquad({ type = "specialAirLand", @@ -2443,9 +2421,9 @@ addNewSquad({ minAnger = tierConfiguration[5].minAnger, maxAnger = 1000, units = { - {count = 20, unit = "armhawk_scav"}, - {count = 20, unit = "corvamp_scav"} - } + { count = 20, unit = "armhawk_scav" }, + { count = 20, unit = "corvamp_scav" }, + }, }) --Fighters addNewSquad({ type = "specialAirSea", @@ -2453,9 +2431,9 @@ addNewSquad({ minAnger = tierConfiguration[5].minAnger, maxAnger = 1000, units = { - {count = 20, unit = "armsfig_scav"}, - {count = 20, unit = "corsfix_scav"} - } + { count = 20, unit = "armsfig_scav" }, + { count = 20, unit = "corsfix_scav" }, + }, }) --T2 Fighters addNewSquad({ @@ -2464,13 +2442,13 @@ addNewSquad({ minAnger = tierConfiguration[5].minAnger, maxAnger = 1000, units = { - {count = 15, unit = "armblade_scav"}, - {count = 15, unit = "armbrawl_scav"}, - {count = 1, unit = "legfort_scav"}, - {count = 1, unit = "corcrw_scav"}, - {count = 1, unit = "corcrwh_scav"}, - {count = 15, unit = "corape_scav"} - } + { count = 15, unit = "armblade_scav" }, + { count = 15, unit = "armbrawl_scav" }, + { count = 1, unit = "legfort_scav" }, + { count = 1, unit = "corcrw_scav" }, + { count = 1, unit = "corcrwh_scav" }, + { count = 15, unit = "corape_scav" }, + }, }) --T2 Gunships ------Tier 3 60-80% --Dilluters @@ -2480,10 +2458,10 @@ addNewSquad({ minAnger = tierConfiguration[6].minAnger, maxAnger = tierConfiguration[6].maxAnger, units = { - {count = 15, unit = "armfav_scav"}, - {count = 15, unit = "corfav_scav"}, - {count = 15, unit = "legscout_scav"} - } + { count = 15, unit = "armfav_scav" }, + { count = 15, unit = "corfav_scav" }, + { count = 15, unit = "legscout_scav" }, + }, }) --Rover Whole Tier Length addNewSquad({ @@ -2492,9 +2470,9 @@ addNewSquad({ minAnger = tierConfiguration[6].minAnger, maxAnger = tierConfiguration[6].maxAnger, units = { - {count = 6, unit = "cortorch_scav"}, - {count = 6, unit = "legmrv_scav"} - } + { count = 6, unit = "cortorch_scav" }, + { count = 6, unit = "legmrv_scav" }, + }, }) --T2 Veh Raid --Land addNewSquad({ @@ -2503,8 +2481,8 @@ addNewSquad({ minAnger = tierConfiguration[6].minAnger, maxAnger = tierConfiguration[6].maxAnger, units = { - {count = 12, unit = "armmar_scav"} - } + { count = 12, unit = "armmar_scav" }, + }, }) --T3 Raid addNewSquad({ @@ -2513,12 +2491,12 @@ addNewSquad({ minAnger = tierConfiguration[6].minAnger, maxAnger = tierConfiguration[6].maxAnger, units = { - {count = 6, unit = "armmeatball_scav"}, - {count = 6, unit = "armassimilator_scav"}, - {count = 2, unit = "armyork_scav"}, - {count = 2, unit = "corsent_scav"}, - {count = 2, unit = "legvflak_scav"} - } + { count = 6, unit = "armmeatball_scav" }, + { count = 6, unit = "armassimilator_scav" }, + { count = 2, unit = "armyork_scav" }, + { count = 2, unit = "corsent_scav" }, + { count = 2, unit = "legvflak_scav" }, + }, }) --T3 Assault/AA addNewSquad({ type = "specialLand", @@ -2526,13 +2504,13 @@ addNewSquad({ maxAnger = tierConfiguration[6].maxAnger, minAnger = tierConfiguration[6].minAnger, units = { - {count = 6, unit = "corshiva_scav"}, - {count = 2, unit = "armraz_scav"}, - {count = 1, unit = "legpede_scav"}, - {count = 1, unit = "armyork_scav"}, - {count = 1, unit = "corsent_scav"}, - {count = 2, unit = "legvflak_scav"} - } + { count = 6, unit = "corshiva_scav" }, + { count = 2, unit = "armraz_scav" }, + { count = 1, unit = "legpede_scav" }, + { count = 1, unit = "armyork_scav" }, + { count = 1, unit = "corsent_scav" }, + { count = 2, unit = "legvflak_scav" }, + }, }) --T3 Assault/AA addNewSquad({ type = "specialLand", @@ -2540,12 +2518,12 @@ addNewSquad({ maxAnger = tierConfiguration[6].maxAnger, minAnger = tierConfiguration[6].minAnger, units = { - {count = 2, unit = "armvang_scav"}, - {count = 2, unit = "corcat_scav"}, - {count = 1, unit = "armyork_scav"}, - {count = 1, unit = "corsent_scav"}, - {count = 2, unit = "legvflak_scav"} - } + { count = 2, unit = "armvang_scav" }, + { count = 2, unit = "corcat_scav" }, + { count = 1, unit = "armyork_scav" }, + { count = 1, unit = "corsent_scav" }, + { count = 2, unit = "legvflak_scav" }, + }, }) --T3 Arty/AA addNewSquad({ type = "specialLand", @@ -2553,8 +2531,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[6].minAnger, units = { - {count = 5, unit = "armvadert4_scav"} - } + { count = 5, unit = "armvadert4_scav" }, + }, }) --Epic Tumbleweeds addNewSquad({ type = "specialSea", @@ -2562,8 +2540,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[6].minAnger, units = { - {count = 5, unit = "armvadert4_scav"} - } + { count = 5, unit = "armvadert4_scav" }, + }, }) --Epic Tumbleweeds --air addNewSquad({ @@ -2572,9 +2550,9 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[6].minAnger, units = { - {count = 40, unit = "armfig_scav"}, - {count = 40, unit = "corveng_scav"} - } + { count = 40, unit = "armfig_scav" }, + { count = 40, unit = "corveng_scav" }, + }, }) --T2 Fighters addNewSquad({ type = "specialAirSea", @@ -2582,9 +2560,9 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[6].minAnger, units = { - {count = 40, unit = "armsfig_scav"}, - {count = 40, unit = "corsfix_scav"} - } + { count = 40, unit = "armsfig_scav" }, + { count = 40, unit = "corsfix_scav" }, + }, }) --T2 Fighters addNewSquad({ type = "specialAirLand", @@ -2592,13 +2570,13 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[6].minAnger, units = { - {count = 15, unit = "armblade_scav"}, - {count = 15, unit = "armbrawl_scav"}, - {count = 1, unit = "legfort_scav"}, - {count = 1, unit = "corcrw_scav"}, - {count = 1, unit = "corcrwh_scav"}, - {count = 15, unit = "corape_scav"} - } + { count = 15, unit = "armblade_scav" }, + { count = 15, unit = "armbrawl_scav" }, + { count = 1, unit = "legfort_scav" }, + { count = 1, unit = "corcrw_scav" }, + { count = 1, unit = "corcrwh_scav" }, + { count = 15, unit = "corape_scav" }, + }, }) --T2 Gunships ------Tier 4 80%+ addNewSquad({ @@ -2607,8 +2585,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10 , unit = "armvadert4_scav"} - } + { count = 10, unit = "armvadert4_scav" }, + }, }) --Epic Tumbleweeds addNewSquad({ type = "specialSea", @@ -2616,8 +2594,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10, unit = "armvadert4_scav"} - } + { count = 10, unit = "armvadert4_scav" }, + }, }) --Epic Tumbleweeds addNewSquad({ type = "specialAirLand", @@ -2625,9 +2603,9 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 80, unit = "armfig_scav"}, - {count = 80, unit = "corveng_scav"} - } + { count = 80, unit = "armfig_scav" }, + { count = 80, unit = "corveng_scav" }, + }, }) --T2 Fighters addNewSquad({ type = "specialAirLand", @@ -2635,8 +2613,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10, unit = "armfepocht4_scav"} - } + { count = 10, unit = "armfepocht4_scav" }, + }, }) --Armada Flying Flagships addNewSquad({ type = "specialAirLand", @@ -2644,8 +2622,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10, unit = "corfblackhyt4_scav"} - } + { count = 10, unit = "corfblackhyt4_scav" }, + }, }) --Cortex Flying Flagships addNewSquad({ type = "specialAirSea", @@ -2653,9 +2631,9 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 80, unit = "armsfig_scav"}, - {count = 80, unit = "corsfix_scav"} - } + { count = 80, unit = "armsfig_scav" }, + { count = 80, unit = "corsfix_scav" }, + }, }) --T2 Fighters addNewSquad({ type = "specialAirSea", @@ -2663,8 +2641,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10, unit = "armfepocht4_scav"} - } + { count = 10, unit = "armfepocht4_scav" }, + }, }) --Armada Flying Flagships addNewSquad({ type = "specialAirSea", @@ -2672,8 +2650,8 @@ addNewSquad({ maxAnger = 1000, minAnger = tierConfiguration[7].minAnger, units = { - {count = 10, unit = "corfblackhyt4_scav"} - } + { count = 10, unit = "corfblackhyt4_scav" }, + }, }) --Cortex Flying Flagships --[[ @@ -2712,20 +2690,19 @@ for name, unitDef in pairs(UnitDefNames) do --Spring.Echo(name, unitDef.customParams) if unitDef.customParams.scavcustomsquad and unitDef.customParams.scavcustomsquad == "1" then local customSquadTable = {} - customSquadTable.units = {{ + customSquadTable.units = { { count = tonumber(unitDef.customParams.scavsquadunitsamount) or 1, - unit = name - }} + unit = name, + } } customSquadTable.minAnger = tonumber(unitDef.customParams.scavsquadminanger) or 0 customSquadTable.maxAnger = tonumber(unitDef.customParams.scavsquadmaxanger) or 999 customSquadTable.weight = tonumber(unitDef.customParams.scavsquadweight) or 1 if unitDef.customParams.scavsquadbehavior then - if unitDef.customParams.scavsquadbehavior == "berserk" and not scavBehaviours.BERSERK[unitDef.id] then scavBehaviours.BERSERK[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.1, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 2000 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 2000, } end @@ -2733,13 +2710,13 @@ for name, unitDef in pairs(UnitDefNames) do if not scavBehaviours.SKIRMISH[unitDef.id] then scavBehaviours.SKIRMISH[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end if not scavBehaviours.COWARD[unitDef.id] then scavBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end end @@ -2748,7 +2725,7 @@ for name, unitDef in pairs(UnitDefNames) do if not scavBehaviours.COWARD[unitDef.id] then scavBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 1, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end if not scavBehaviours.HEALER[unitDef.id] then @@ -2759,14 +2736,14 @@ for name, unitDef in pairs(UnitDefNames) do if unitDef.customParams.scavsquadbehavior == "artillery" then if not scavBehaviours.SKIRMISH[unitDef.id] then scavBehaviours.SKIRMISH[unitDef.id] = { - chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.5, + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end if not scavBehaviours.COWARD[unitDef.id] then scavBehaviours.COWARD[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 0.5, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end if not scavBehaviours.ARTILLERY[unitDef.id] then @@ -2778,7 +2755,7 @@ for name, unitDef in pairs(UnitDefNames) do if not scavBehaviours.BERSERK[unitDef.id] then scavBehaviours.BERSERK[unitDef.id] = { chance = tonumber(unitDef.customParams.scavsquadbehaviorchance) or 1, - distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500 + distance = tonumber(unitDef.customParams.scavsquadbehaviordistance) or 500, } end if not scavBehaviours.KAMIKAZE[unitDef.id] then @@ -2787,9 +2764,7 @@ for name, unitDef in pairs(UnitDefNames) do end end - if not customSquadTable.type then - if (not unitDef.customParams.scavsquadsurface) or unitDef.customParams.scavsquadsurface == "land" or unitDef.customParams.scavsquadsurface == "mixed" then if unitDef.customParams.scavsquadbehavior and unitDef.customParams.scavsquadbehavior == "healer" then customSquadTable.type = "healerLand" @@ -2883,7 +2858,8 @@ local ecoBuildingsPenalty = { -- Additional boss hatch per second from eco build [UnitDefNames["cormmkr"].id] = 0.0005, [UnitDefNames["armuwmmm"].id] = 0.0005, [UnitDefNames["coruwmmm"].id] = 0.0005, - ]]-- + ]] + -- } local highValueTargetsNames = { -- Priority targets for Scav. Must be immobile to prevent issues. @@ -2927,7 +2903,7 @@ local highValueTargetsNames = { -- Priority targets for Scav. Must be immobile t local highValueTargets = {} for unitName, params in pairs(highValueTargetsNames) do if not UnitDefNames[unitName] then - Spring.Log(gadget:GetInfo().name, LOG.ERROR, 'couldnt find unit name: '..unitName) + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "couldnt find unit name: " .. unitName) else highValueTargets[UnitDefNames[unitName].id] = params end @@ -2937,30 +2913,30 @@ highValueTargetsNames = nil ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local config = { -- Don't touch this! --------------------------------------------------------------------------------------------------------------------------------------------- - useScum = useScum, - difficulty = difficulty, - difficulties = difficulties, - burrowUnitsList = BurrowUnitsList, -- burrow unit name - scavSpawnMultiplier = Spring.GetModOptions().scav_spawncountmult, - burrowSpawnType = Spring.GetModOptions().scav_scavstart, - swarmMode = Spring.GetModOptions().scav_swarmmode, - spawnSquare = spawnSquare, - spawnSquareIncrement = spawnSquareIncrement, - scavTurrets = table.copy(scavTurrets), - unprocessedScavTurrets = table.copy(Turrets), - scavMinions = scavMinions, - scavBehaviours = scavBehaviours, - difficultyParameters = difficultyParameters, - useWaveMsg = useWaveMsg, - burrowSize = burrowSize, - squadSpawnOptionsTable = squadSpawnOptionsTable, - airStartAnger = airStartAnger, - ecoBuildingsPenalty = ecoBuildingsPenalty, - highValueTargets = highValueTargets, - bossFightWaveSizeScale = bossFightWaveSizeScale, - defaultScavFirestate = defaultScavFirestate, - tierConfiguration = tierConfiguration, - economyScale = economyScale, + useScum = useScum, + difficulty = difficulty, + difficulties = difficulties, + burrowUnitsList = BurrowUnitsList, -- burrow unit name + scavSpawnMultiplier = Spring.GetModOptions().scav_spawncountmult, + burrowSpawnType = Spring.GetModOptions().scav_scavstart, + swarmMode = Spring.GetModOptions().scav_swarmmode, + spawnSquare = spawnSquare, + spawnSquareIncrement = spawnSquareIncrement, + scavTurrets = table.copy(scavTurrets), + unprocessedScavTurrets = table.copy(Turrets), + scavMinions = scavMinions, + scavBehaviours = scavBehaviours, + difficultyParameters = difficultyParameters, + useWaveMsg = useWaveMsg, + burrowSize = burrowSize, + squadSpawnOptionsTable = squadSpawnOptionsTable, + airStartAnger = airStartAnger, + ecoBuildingsPenalty = ecoBuildingsPenalty, + highValueTargets = highValueTargets, + bossFightWaveSizeScale = bossFightWaveSizeScale, + defaultScavFirestate = defaultScavFirestate, + tierConfiguration = tierConfiguration, + economyScale = economyScale, } for key, value in pairs(difficultyParameters[difficulty]) do diff --git a/luarules/configs/timeslow_defs.lua b/luarules/configs/timeslow_defs.lua index 965c97de6c4..411615e034c 100644 --- a/luarules/configs/timeslow_defs.lua +++ b/luarules/configs/timeslow_defs.lua @@ -1,9 +1,7 @@ ------------------------ -- Config - if Spring.GetModOptions().emprework == true then - local MAX_SLOW_FACTOR = 0.9 -- Max slow damage on a unit = MAX_SLOW_FACTOR * current health -- Slowdown of unit = slow damage / current health @@ -17,8 +15,6 @@ if Spring.GetModOptions().emprework == true then local UPDATE_PERIOD = 15 -- I'd prefer if this was not changed - - ------------------------ -- Send the Config @@ -27,10 +23,10 @@ if Spring.GetModOptions().emprework == true then for name, data in pairs(WeaponDefNames) do local cp = data.customParams if cp.timeslow_damagefactor or cp.timeslow_damage or cp.timeslow_onlyslow then - local custom = {scaleSlow = true} + local custom = { scaleSlow = true } custom.slowDamage = cp.timeslow_damage or ((cp.timeslow_damagefactor or (cp.timeslow_onlyslow and 1)) * cp.raw_damage) custom.overslow = cp.timeslow_overslow_frames and (cp.timeslow_overslow_frames * DEGRADE_FACTOR / 30) - custom.onlySlow = (cp.timeslow_onlyslow) or false + custom.onlySlow = cp.timeslow_onlyslow or false custom.smartRetarget = cp.timeslow_smartretarget and tonumber(cp.timeslow_smartretarget) or nil custom.smartRetargetHealth = cp.timeslow_smartretargethealth and tonumber(cp.timeslow_smartretargethealth) or nil custom.rawDamage = tonumber(cp.raw_damage) @@ -38,7 +34,5 @@ if Spring.GetModOptions().emprework == true then end end - return weaponArray, MAX_SLOW_FACTOR, DEGRADE_TIMER*30/UPDATE_PERIOD, DEGRADE_FACTOR*UPDATE_PERIOD/30, UPDATE_PERIOD - - -end \ No newline at end of file + return weaponArray, MAX_SLOW_FACTOR, DEGRADE_TIMER * 30 / UPDATE_PERIOD, DEGRADE_FACTOR * UPDATE_PERIOD / 30, UPDATE_PERIOD +end diff --git a/luarules/draw.lua b/luarules/draw.lua index a7739f051cc..74d096662c9 100644 --- a/luarules/draw.lua +++ b/luarules/draw.lua @@ -1,9 +1,12 @@ -if (select == nil) then - select = function(n,...) - local arg = arg - if (not arg) then arg = {...}; arg.n = #arg end - return arg[((n=='#') and 'n')or n] - end +if select == nil then + select = function(n, ...) + local arg = arg + if not arg then + arg = { ... } + arg.n = #arg + end + return arg[((n == "#") and "n") or n] + end end -VFS.Include(Script.GetName() .. '/gadgets.lua', nil, VFS.ZIP_ONLY) \ No newline at end of file +VFS.Include(Script.GetName() .. "/gadgets.lua", nil, VFS.ZIP_ONLY) diff --git a/luarules/gadgets.lua b/luarules/gadgets.lua index bcc6a996e7c..65dbbc5ddb8 100644 --- a/luarules/gadgets.lua +++ b/luarules/gadgets.lua @@ -22,27 +22,24 @@ if Spring.IsDevLuaEnabled() then VFSMODE = VFS.RAW_FIRST end -VFS.Include('init.lua', nil, VFSMODE) +VFS.Include("init.lua", nil, VFSMODE) local SAFEWRAP = 0 -- 0: disabled -- 1: enabled, but can be overriden by gadget.GetInfo().unsafe -- 2: always enabled - -local HANDLER_DIR = 'LuaGadgets/' -local GADGETS_DIR = Script.GetName():gsub('US$', '') .. '/Gadgets/' -local SCRIPT_DIR = Script.GetName() .. '/' +local HANDLER_DIR = "LuaGadgets/" +local GADGETS_DIR = Script.GetName():gsub("US$", "") .. "/Gadgets/" +local SCRIPT_DIR = Script.GetName() .. "/" local LOG_SECTION = "" -- FIXME: "LuaRules" section is not registered anywhere +VFS.Include(HANDLER_DIR .. "setupdefs.lua", nil, VFSMODE) +VFS.Include(SCRIPT_DIR .. "system.lua", nil, VFSMODE) +VFS.Include(HANDLER_DIR .. "callins.lua", nil, VFSMODE) +VFS.Include(SCRIPT_DIR .. "utilities.lua", nil, VFSMODE) - -VFS.Include(HANDLER_DIR .. 'setupdefs.lua', nil, VFSMODE) -VFS.Include(SCRIPT_DIR .. 'system.lua', nil, VFSMODE) -VFS.Include(HANDLER_DIR .. 'callins.lua', nil, VFSMODE) -VFS.Include(SCRIPT_DIR .. 'utilities.lua', nil, VFSMODE) - -local actionHandler = VFS.Include(HANDLER_DIR .. 'actions.lua', nil, VFSMODE) +local actionHandler = VFS.Include(HANDLER_DIR .. "actions.lua", nil, VFSMODE) -- Utility call local isSyncedCode = (SendToUnsynced ~= nil) @@ -52,7 +49,7 @@ end if IsSyncedCode() then local devModeEnabled = string.find(string.upper(Game.gameVersion), "$VERSION", 1, true) - Spring.SetGameRulesParam('isDevMode', devModeEnabled) + Spring.SetGameRulesParam("isDevMode", devModeEnabled) end -------------------------------------------------------------------------------- @@ -66,7 +63,6 @@ end -- end --end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -98,7 +94,6 @@ gadgetHandler = { mouseOwner = nil, } - -- these call-ins are set to 'nil' if not used -- they are setup in UpdateCallIns() local callInLists = { @@ -118,7 +113,7 @@ local callInLists = { "GameFramePost", "GamePaused", - "ViewResize", -- FIXME ? + "ViewResize", -- FIXME ? "TextCommand", "GotChatMsg", @@ -234,14 +229,14 @@ local callInLists = { "DrawScreenPost", "DrawScreen", "DrawInMiniMap", - 'DrawOpaqueUnitsLua', - 'DrawOpaqueFeaturesLua', - 'DrawAlphaUnitsLua', - 'DrawAlphaFeaturesLua', - 'DrawShadowUnitsLua', - 'DrawShadowFeaturesLua', + "DrawOpaqueUnitsLua", + "DrawOpaqueFeaturesLua", + "DrawAlphaUnitsLua", + "DrawAlphaFeaturesLua", + "DrawShadowUnitsLua", + "DrawShadowFeaturesLua", - 'FontsChanged', + "FontsChanged", "RecvFromSynced", @@ -272,14 +267,13 @@ local callInLists = { "UnitLeftWater", "UnitLeftAir", - "UnsyncedHeightMapUpdate" + "UnsyncedHeightMapUpdate", } - -- initialize the call-in lists do - for _,listname in ipairs(callInLists) do - gadgetHandler[listname .. 'List'] = {} + for _, listname in ipairs(callInLists) do + gadgetHandler[listname .. "List"] = {} end end @@ -292,21 +286,20 @@ end local function Basename(fullpath) local _, _, base = string.find(fullpath, "([^\\/:]*)$") local _, _, path = string.find(fullpath, "(.*[\\/:])[^\\/:]*$") - if (path == nil) then + if path == nil then path = "" end return base, path end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- This table stores gadget paths that we want to override game side. -- Please indicate why you are adding each file in a comment local VFSMODE_OVERRIDE = { - ['luagaia/gadgets/fp_featureplacer.lua'] = VFS.GAME - } + ["luagaia/gadgets/fp_featureplacer.lua"] = VFS.GAME, +} function gadgetHandler:Initialize() gadgetHandler:CreateQueuedReorderFuncs() @@ -320,7 +313,7 @@ function gadgetHandler:Initialize() -- for k,gf in ipairs(gadgetFiles) do -- Spring.Echo('gf1 = ' .. gf) -- FIXME -- end - local doMoreYield = (Spring.Yield ~= nil); + local doMoreYield = (Spring.Yield ~= nil) -- stuff the gadgets into unsortedGadgets for k, gf in ipairs(gadgetFiles) do -- Spring.Echo('gf2 = ' .. gf) -- FIXME @@ -380,12 +373,12 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) local basename = Basename(filename) local text = VFS.LoadFile(filename, overridevfsmode or VFSMODE) if text == nil then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Failed to load: ' .. filename) + Spring.Log(LOG_SECTION, LOG.ERROR, "Failed to load: " .. filename) return nil end local chunk, err = loadstring(text, filename) if chunk == nil then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Log(LOG_SECTION, LOG.ERROR, "Failed to load: " .. basename .. " (" .. err .. ")") return nil end @@ -394,7 +387,7 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) setfenv(chunk, gadget) local success, err = pcall(chunk) if not success then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Log(LOG_SECTION, LOG.ERROR, "Failed to load: " .. basename .. " (" .. err .. ")") return nil end if err == false then -- note that all "normal" gadgets return `nil` implicitly at EOF, so don't do "if not err" @@ -402,7 +395,7 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) end if gadget.GetInfo and (Platform and not Platform.check(gadget.GetInfo().depends)) then - Spring.Echo('Missing capabilities: ' .. gadget:GetInfo().name .. '. Disabling.') + Spring.Echo("Missing capabilities: " .. gadget:GetInfo().name .. ". Disabling.") return nil end @@ -416,14 +409,14 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) err = self:ValidateGadget(gadget) if err then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Log(LOG_SECTION, LOG.ERROR, "Failed to load: " .. basename .. " (" .. err .. ")") return nil end local knownInfo = self.knownGadgets[name] if knownInfo then if knownInfo.active then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Failed to load: ' .. basename .. ' (duplicate name)') + Spring.Log(LOG_SECTION, LOG.ERROR, "Failed to load: " .. basename .. " (duplicate name)") return nil end else @@ -441,10 +434,10 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) local info = gadget.GetInfo and gadget:GetInfo() local order = self.orderList[name] - if ((order ~= nil and order > 0) or (order == nil and (info == nil or info.enabled))) then + if (order ~= nil and order > 0) or (order == nil and (info == nil or info.enabled)) then -- this will be an active gadget if order == nil then - self.orderList[name] = 12345 -- back of the pack + self.orderList[name] = 12345 -- back of the pack else self.orderList[name] = order end @@ -457,7 +450,7 @@ function gadgetHandler:LoadGadget(filename, overridevfsmode) if kbytes then collectgarbage("collect") -- mark collectgarbage("collect") -- sweep - Spring.Echo("LoadGadget",filename,"delta=",collectgarbage("count")-kbytes,"total=",collectgarbage("count"),"KB, synced =", IsSyncedCode()) + Spring.Echo("LoadGadget", filename, "delta=", collectgarbage("count") - kbytes, "total=", collectgarbage("count"), "KB, synced =", IsSyncedCode()) end return gadget end @@ -468,8 +461,8 @@ function gadgetHandler:NewGadget() for k, v in pairs(System) do gadget[k] = v end - gadget._G = _G -- the global table - gadget.GG = self.GG -- the shared table + gadget._G = _G -- the global table + gadget.GG = self.GG -- the shared table gadget.gadget = gadget -- easy self referencing -- wrapped calls (closures) @@ -574,24 +567,24 @@ function gadgetHandler:FinalizeGadget(gadget, filename, basename) gi.enabled = info.enabled or false end - gadget.ghInfo = {} -- a proxy table + gadget.ghInfo = {} -- a proxy table local mt = { __index = gi, __newindex = function() error("ghInfo tables are read-only") end, - __metatable = "protected" + __metatable = "protected", } setmetatable(gadget.ghInfo, mt) -- cache tracy zone name strings to avoid per-frame string allocation - if tracy then - gadget._tracyGameFrameName = "G:GameFrame:" .. gi.name - gadget._tracyGameFramePostName = "G:GameFramePost:" .. gi.name - gadget._tracyViewResizeName = "G:ViewResize:" .. gi.name - gadget._tracyPlayerChangedName = "G:PlayerChanged:" .. gi.name - gadget._tracyUpdateName = "G:Update:" .. gi.name - gadget._tracyDrawWorldName = "G:DrawWorld:" .. gi.name - gadget._tracyDrawWorldPreUnitName = "G:DrawWorldPreUnit:" .. gi.name + if tracy then + gadget._tracyGameFrameName = "G:GameFrame:" .. gi.name + gadget._tracyGameFramePostName = "G:GameFramePost:" .. gi.name + gadget._tracyViewResizeName = "G:ViewResize:" .. gi.name + gadget._tracyPlayerChangedName = "G:PlayerChanged:" .. gi.name + gadget._tracyUpdateName = "G:Update:" .. gi.name + gadget._tracyDrawWorldName = "G:DrawWorld:" .. gi.name + gadget._tracyDrawWorldPreUnitName = "G:DrawWorldPreUnit:" .. gi.name end end @@ -602,7 +595,6 @@ function gadgetHandler:ValidateGadget(gadget) return nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -613,14 +605,14 @@ local function SafeWrap(func, funcName) if ok then return r1, r2, r3 else - if funcName ~= 'Shutdown' then + if funcName ~= "Shutdown" then gadgetHandler:RemoveGadget(g) else - Spring.Log(LOG_SECTION, LOG.ERROR, 'Error in Shutdown') + Spring.Log(LOG_SECTION, LOG.ERROR, "Error in Shutdown") end local name = g.ghInfo.name Spring.Log(LOG_SECTION, LOG.INFO, r1) - Spring.Log(LOG_SECTION, LOG.INFO, 'Removed gadget: ' .. name) + Spring.Log(LOG_SECTION, LOG.INFO, "Removed gadget: " .. name) return nil end end @@ -631,7 +623,7 @@ local function SafeWrapGadget(gadget) return elseif SAFEWRAP == 1 then if gadget.GetInfo and gadget.GetInfo().unsafe then - Spring.Log(LOG_SECTION, LOG.ERROR, 'LuaUI: loaded unsafe gadget: ' .. gadget.ghInfo.name) + Spring.Log(LOG_SECTION, LOG.ERROR, "LuaUI: loaded unsafe gadget: " .. gadget.ghInfo.name) return end end @@ -641,12 +633,11 @@ local function SafeWrapGadget(gadget) gadget[ciName] = SafeWrap(gadget[ciName], ciName) end if gadget.Initialize then - gadget.Initialize = SafeWrap(gadget.Initialize, 'Initialize') + gadget.Initialize = SafeWrap(gadget.Initialize, "Initialize") end end end - -------------------------------------------------------------------------------- local function ArrayInsert(t, f, g) @@ -691,13 +682,12 @@ local callinDepth = 0 function gadgetHandler:CreateQueuedReorderFuncs() -- This will create an array with linked Raw methods so we can find them by index. -- It will also create the gadgetHandler usual api queing the calls. - local reorderFuncNames = {'InsertGadget', 'RemoveGadget', 'EnableGadget', 'DisableGadget', - 'LowerGadget', 'RaiseGadget', 'UpdateGadgetCallIn', 'RemoveGadgetCallIn'} + local reorderFuncNames = { "InsertGadget", "RemoveGadget", "EnableGadget", "DisableGadget", "LowerGadget", "RaiseGadget", "UpdateGadgetCallIn", "RemoveGadgetCallIn" } local queueReorder = gadgetHandler.QueueReorder for idx, name in ipairs(reorderFuncNames) do -- linked method index - reorderFuncs[#reorderFuncs + 1] = gadgetHandler[name .. 'Raw'] + reorderFuncs[#reorderFuncs + 1] = gadgetHandler[name .. "Raw"] -- gadgetHandler api gadgetHandler[name] = function(s, ...) @@ -707,7 +697,7 @@ function gadgetHandler:CreateQueuedReorderFuncs() end function gadgetHandler:QueueReorder(methodIndex, ...) - reorderQueue[#reorderQueue + 1] = {methodIndex, ...} + reorderQueue[#reorderQueue + 1] = { methodIndex, ... } reorderNeeded = true end @@ -740,8 +730,8 @@ function gadgetHandler:InsertGadgetRaw(gadget) ArrayInsert(self.gadgets, true, gadget) for _, listname in ipairs(callInLists) do local func = gadget[listname] - if type(func) == 'function' then - ArrayInsert(self[listname .. 'List'], func, gadget) + if type(func) == "function" then + ArrayInsert(self[listname .. "List"], func, gadget) end end @@ -749,7 +739,7 @@ function gadgetHandler:InsertGadgetRaw(gadget) if kbytes and collectgarbage then collectgarbage("collect") collectgarbage("collect") - kbytes= collectgarbage("count") + kbytes = collectgarbage("count") end self:UpdateCallIns() @@ -759,14 +749,14 @@ function gadgetHandler:InsertGadgetRaw(gadget) self:UpdateCallIns() if gadget.AllowCommand and not self:HasAllowCommands(gadget) then - Spring.Log('AllowCommand', LOG.WARNING, "<" .. gadget.ghInfo.basename .. "> AllowCommand defined but didn't register any commands. Autoregistering for all commands!") + Spring.Log("AllowCommand", LOG.WARNING, "<" .. gadget.ghInfo.basename .. "> AllowCommand defined but didn't register any commands. Autoregistering for all commands!") self:RegisterAllowCommand(gadget, CMD.ANY) end if kbytes then collectgarbage("collect") collectgarbage("collect") - Spring.Echo("Initialize",gadget.ghInfo.name,"delta=",collectgarbage("count")-kbytes,"total=",collectgarbage("count"),"KB, synced =", IsSyncedCode()) + Spring.Echo("Initialize", gadget.ghInfo.name, "delta=", collectgarbage("count") - kbytes, "total=", collectgarbage("count"), "KB, synced =", IsSyncedCode()) end end @@ -785,7 +775,7 @@ function gadgetHandler:RemoveGadgetRaw(gadget) self:RemoveGadgetGlobals(gadget) actionHandler.RemoveGadgetActions(gadget) for _, listname in ipairs(callInLists) do - ArrayRemove(self[listname .. 'List'], gadget) + ArrayRemove(self[listname .. "List"], gadget) end self:DeregisterAllowCommands(gadget) @@ -798,12 +788,11 @@ function gadgetHandler:RemoveGadgetRaw(gadget) self:UpdateCallIns() end - -------------------------------------------------------------------------------- function gadgetHandler:UpdateCallIn(name) - local listName = name .. 'List' - local forceUpdate = (name == 'GotChatMsg' or name == 'RecvFromSynced') -- redundant? + local listName = name .. "List" + local forceUpdate = (name == "GotChatMsg" or name == "RecvFromSynced") -- redundant? _G[name] = nil @@ -833,29 +822,29 @@ function gadgetHandler:UpdateCallIn(name) end function gadgetHandler:UpdateGadgetCallInRaw(name, g) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then local func = g[name] - if type(func) == 'function' then + if type(func) == "function" then ArrayInsert(ciList, func, g) else ArrayRemove(ciList, g) end self:UpdateCallIn(name) else - Spring.Log(LOG_SECTION, LOG.ERROR, 'UpdateGadgetCallIn: bad name: ' .. name) + Spring.Log(LOG_SECTION, LOG.ERROR, "UpdateGadgetCallIn: bad name: " .. name) end end function gadgetHandler:RemoveGadgetCallInRaw(name, g) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then ArrayRemove(ciList, g) self:UpdateCallIn(name) else - Spring.Log(LOG_SECTION, LOG.ERROR, 'RemoveGadgetCallIn: bad name: ' .. name) + Spring.Log(LOG_SECTION, LOG.ERROR, "RemoveGadgetCallIn: bad name: " .. name) end end @@ -865,7 +854,6 @@ function gadgetHandler:UpdateCallIns() end end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -876,7 +864,7 @@ function gadgetHandler:EnableGadgetRaw(name) return false end if not ki.active then - Spring.Log(LOG_SECTION, LOG.INFO, 'Loading: ' .. ki.filename) + Spring.Log(LOG_SECTION, LOG.INFO, "Loading: " .. ki.filename) local order = gadgetHandler.orderList[name] if not order or order <= 0 then self.orderList[name] = 1 @@ -901,8 +889,8 @@ function gadgetHandler:DisableGadgetRaw(name) if not w then return false end - Spring.Log(LOG_SECTION, LOG.INFO, 'Removed: ' .. ki.filename) - self:RemoveGadgetRaw(w) -- deactivate + Spring.Log(LOG_SECTION, LOG.INFO, "Removed: " .. ki.filename) + self:RemoveGadgetRaw(w) -- deactivate self.orderList[name] = 0 -- disable end return true @@ -925,12 +913,11 @@ function gadgetHandler:ToggleGadget(name) return true end - -------------------------------------------------------------------------------- local function FindGadgetIndex(t, w) for k, v in ipairs(t) do - if (v == w) then + if v == w then return k end end @@ -966,7 +953,7 @@ function gadgetHandler:RaiseGadgetRaw(gadget) end Raise(self.gadgets, true, gadget) for _, listname in ipairs(callInLists) do - Raise(self[listname .. 'List'], gadget[listname], gadget) + Raise(self[listname .. "List"], gadget[listname], gadget) end self:ReorderAllowCommands(gadget, Raise) end @@ -995,19 +982,19 @@ function gadgetHandler:LowerGadgetRaw(gadget) end local n = FindHighestIndex(t, i, w.ghInfo.layer) if n and n > i then - table.insert(t, n+1, w) + table.insert(t, n + 1, w) table.remove(t, i) end end Lower(self.gadgets, true, gadget) for _, listname in ipairs(callInLists) do - Lower(self[listname .. 'List'], gadget[listname], gadget) + Lower(self[listname .. "List"], gadget[listname], gadget) end self:ReorderAllowCommands(gadget, Lower) end function gadgetHandler:FindGadget(name) - if type(name) ~= 'string' then + if type(name) ~= "string" then return nil end for k, v in ipairs(self.gadgets) do @@ -1018,7 +1005,6 @@ function gadgetHandler:FindGadget(name) return nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1073,7 +1059,6 @@ function gadgetHandler:RemoveGadgetGlobals(owner) return count end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1092,22 +1077,18 @@ end function gadgetHandler:RegisterCMDID(gadget, id) if id <= 1000 then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a reserved CMD_ID') - Script.Kill('Reserved CMD_ID code: ' .. id) + Spring.Log(LOG_SECTION, LOG.ERROR, "Gadget (" .. gadget.ghInfo.name .. ") " .. "tried to register a reserved CMD_ID") + Script.Kill("Reserved CMD_ID code: " .. id) end if self.CMDIDs[id] ~= nil then - Spring.Log(LOG_SECTION, LOG.ERROR, 'Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a duplicated CMD_ID') - Script.Kill('Duplicate CMD_ID code: ' .. id) + Spring.Log(LOG_SECTION, LOG.ERROR, "Gadget (" .. gadget.ghInfo.name .. ") " .. "tried to register a duplicated CMD_ID") + Script.Kill("Duplicate CMD_ID code: " .. id) end self.CMDIDs[id] = gadget end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1178,8 +1159,8 @@ end function gadgetHandler:RecvFromSynced(...) local arg1, arg2 = ... - if (type(arg1) == 'string') then - tracy.ZoneBeginN("G:RecvFromSynced:"..arg1) + if type(arg1) == "string" then + tracy.ZoneBeginN("G:RecvFromSynced:" .. arg1) else tracy.ZoneBeginN("G:RecvFromSynced") end @@ -1199,20 +1180,20 @@ end function gadgetHandler:GotChatMsg(msg, player) if player == 0 and Spring.IsCheatingEnabled() then - local sp = '^%s*' -- start pattern - local ep = '%s+(.*)' -- end pattern + local sp = "^%s*" -- start pattern + local ep = "%s+(.*)" -- end pattern local s, e, match - s, e, match = string.find(msg, sp .. 'togglegadget' .. ep) + s, e, match = string.find(msg, sp .. "togglegadget" .. ep) if match then self:ToggleGadget(match) return true end - s, e, match = string.find(msg, sp .. 'enablegadget' .. ep) + s, e, match = string.find(msg, sp .. "enablegadget" .. ep) if match then self:EnableGadget(match) return true end - s, e, match = string.find(msg, sp .. 'disablegadget' .. ep) + s, e, match = string.find(msg, sp .. "disablegadget" .. ep) if match then self:DisableGadget(match) return true @@ -1280,7 +1261,6 @@ function gadgetHandler:ViewResize(vsx, vsy) return end - -------------------------------------------------------------------------------- -- -- Game call-ins @@ -1350,10 +1330,12 @@ local CMD_BUILD = CMD.BUILD local CMD_INSERT = CMD.INSERT local unpackInsertParams = Game.Commands.UnpackInsertParams -local allowCommandList = {[CMD_ANY] = {}} +local allowCommandList = { [CMD_ANY] = {} } function gadgetHandler:ReorderAllowCommands(gadget, f) - if not gadget.AllowCommand then return true end + if not gadget.AllowCommand then + return true + end for _, list in pairs(allowCommandList) do f(list, true, gadget) end @@ -1378,14 +1360,14 @@ end function gadgetHandler:RegisterAllowCommand(gadget, cmdID) -- cmdID accepts CMD.ANY and CMD.NIL in addition to usual cmdIDs -- CMD.ANY subscribes to any command - Spring.Log('AllowCommand', LOG.INFO, "<" .. gadget.ghInfo.basename .. "> Register "..tostring(cmdID)) + Spring.Log("AllowCommand", LOG.INFO, "<" .. gadget.ghInfo.basename .. "> Register " .. tostring(cmdID)) if cmdID == nil then -- use CMD.NIL instead - Spring.Log('AllowCommand', LOG.ERROR, "<" .. gadget.ghInfo.basename .. "> Invalid cmdID "..tostring(cmdID)) + Spring.Log("AllowCommand", LOG.ERROR, "<" .. gadget.ghInfo.basename .. "> Invalid cmdID " .. tostring(cmdID)) return end if not gadget.AllowCommand then - Spring.Log('AllowCommand', LOG.ERROR, "<" .. gadget.ghInfo.basename .. "> No callin method") + Spring.Log("AllowCommand", LOG.ERROR, "<" .. gadget.ghInfo.basename .. "> No callin method") return end local cmdList = allowCommandList[cmdID] @@ -1474,19 +1456,17 @@ function gadgetHandler:RecvSkirmishAIMessage(aiTeam, dataStr) end end -function gadgetHandler:CommandFallback(unitID, unitDefID, unitTeam, - cmdID, cmdParams, cmdOptions, cmdTag) +function gadgetHandler:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) for _, g in ipairs(self.CommandFallbackList) do local used, remove = g:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) if used then return remove end end - return true -- remove the command + return true -- remove the command end -function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, - cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) +function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) local fromInsert -- NB: State commands can be inserted, so should not update state or produce other side effects from -- within g:AllowCommand callins without checking if they were inserted, first (`fromInsert ~= nil`). @@ -1565,8 +1545,7 @@ function gadgetHandler:AllowUnitTransportUnload(transporterID, transporterUnitDe return true end -function gadgetHandler:AllowUnitTransfer(unitID, unitDefID, - oldTeam, newTeam, capture) +function gadgetHandler:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) for _, g in ipairs(self.AllowUnitTransferList) do if not g:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) then return false @@ -1575,9 +1554,7 @@ function gadgetHandler:AllowUnitTransfer(unitID, unitDefID, return true end -function gadgetHandler:AllowUnitBuildStep(builderID, builderTeam, - unitID, unitDefID, part) - +function gadgetHandler:AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) tracy.ZoneBeginN("G:AllowUnitBuildStep") for _, g in ipairs(self.AllowUnitBuildStepList) do if not g:AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) then @@ -1589,8 +1566,7 @@ function gadgetHandler:AllowUnitBuildStep(builderID, builderTeam, return true end -function gadgetHandler:AllowUnitCaptureStep(builderID, builderTeam, - unitID, unitDefID, part) +function gadgetHandler:AllowUnitCaptureStep(builderID, builderTeam, unitID, unitDefID, part) for _, g in ipairs(self.AllowUnitCaptureStepList) do if not g:AllowUnitCaptureStep(builderID, builderTeam, unitID, unitDefID, part) then return false @@ -1617,8 +1593,7 @@ function gadgetHandler:AllowUnitDecloak(unitID, objectID, weaponID) return true end -function gadgetHandler:AllowFeatureBuildStep(builderID, builderTeam, - featureID, featureDefID, part) +function gadgetHandler:AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, part) for _, g in ipairs(self.AllowFeatureBuildStepList) do if not g:AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, part) then return false @@ -1654,8 +1629,7 @@ function gadgetHandler:AllowResourceTransfer(oldTeamID, newTeamID, res, amount) return true end -function gadgetHandler:AllowDirectUnitControl(unitID, unitDefID, unitTeam, - playerID) +function gadgetHandler:AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID) for _, g in ipairs(self.AllowDirectUnitControlList) do if not g:AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID) then return false @@ -1683,8 +1657,7 @@ function gadgetHandler:MoveCtrlNotify(unitID, unitDefID, unitTeam, data) return state end -function gadgetHandler:TerraformComplete(unitID, unitDefID, unitTeam, - buildUnitID, buildUnitDefID, buildUnitTeam) +function gadgetHandler:TerraformComplete(unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam) for _, g in ipairs(self.TerraformCompleteList) do local stop = g:TerraformComplete(unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam) if stop then @@ -1695,18 +1668,18 @@ function gadgetHandler:TerraformComplete(unitID, unitDefID, unitTeam, end function gadgetHandler:AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) -local ignore = true -for _, g in ipairs(self.AllowWeaponTargetCheckList) do - local allowCheck, ignoreCheck = g:AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) - if not ignoreCheck then - ignore = false - if not allowCheck then - return 0 + local ignore = true + for _, g in ipairs(self.AllowWeaponTargetCheckList) do + local allowCheck, ignoreCheck = g:AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) + if not ignoreCheck then + ignore = false + if not allowCheck then + return 0 + end end end -end -return ((ignore and -1) or 1) + return ((ignore and -1) or 1) end function gadgetHandler:AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority) @@ -1751,7 +1724,6 @@ function gadgetHandler:AllowWeaponInterceptTarget(interceptorUnitID, interceptor return true end - -------------------------------------------------------------------------------- -- -- Unit call-ins @@ -1777,8 +1749,7 @@ function gadgetHandler:UnitFinished(unitID, unitDefID, unitTeam) return end -function gadgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, - factID, factDefID, userOrders) +function gadgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) for _, g in ipairs(self.UnitFromFactoryList) do g:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) end @@ -1823,8 +1794,7 @@ function gadgetHandler:RenderUnitDestroyed(unitID, unitDefID, unitTeam) return end -function gadgetHandler:UnitExperience(unitID, unitDefID, unitTeam, - experience, oldExperience) +function gadgetHandler:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) for _, g in ipairs(self.UnitExperienceList) do g:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) end @@ -1859,17 +1829,13 @@ function gadgetHandler:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paral -- check every other gadget that may be handing damage or impulse -- and check the layering and ordering of the gadgets for _, g in ipairs(self.UnitPreDamagedList) do - local dmg, imp = g:UnitPreDamaged( - unitID, unitDefID, unitTeam, - retDamage, paralyzer, - weaponDefID, projectileID, - attackerID, attackerDefID, attackerTeam) + local dmg, imp = g:UnitPreDamaged(unitID, unitDefID, unitTeam, retDamage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if dmg ~= nil then retDamage = dmg end if imp ~= nil then - retImpulse = retImpulse*imp + retImpulse = retImpulse * imp end end @@ -1979,7 +1945,7 @@ function gadgetHandler:UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unit return end -function gadgetHandler:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) +function gadgetHandler:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) for _, g in ipairs(self.UnitLoadedList) do g:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) end @@ -1988,8 +1954,7 @@ end function gadgetHandler:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) for _, g in ipairs(self.UnitUnloadedList) do - g:UnitUnloaded(unitID, unitDefID, unitTeam, - transportID, transportTeam) + g:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) end return end @@ -2055,44 +2020,18 @@ function gadgetHandler:FeatureDestroyed(featureID, allyTeam) return end -function gadgetHandler:FeatureDamaged( - featureID, - featureDefID, - featureTeam, - damage, - weaponDefID, - projectileID, - attackerID, - attackerDefID, - attackerTeam -) +function gadgetHandler:FeatureDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) for _, g in ipairs(self.FeatureDamagedList) do - g:FeatureDamaged(featureID, featureDefID, featureTeam, - damage, weaponDefID, projectileID, - attackerID, attackerDefID, attackerTeam) - end -end - -function gadgetHandler:FeaturePreDamaged( - featureID, - featureDefID, - featureTeam, - damage, - weaponDefID, - projectileID, - attackerID, - attackerDefID, - attackerTeam -) + g:FeatureDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) + end +end + +function gadgetHandler:FeaturePreDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) local retDamage = damage local retImpulse = 1.0 for _, g in ipairs(self.FeaturePreDamagedList) do - local dmg, imp = g:FeaturePreDamaged( - featureID, featureDefID, featureTeam, - retDamage, - weaponDefID, projectileID, - attackerID, attackerDefID, attackerTeam) + local dmg, imp = g:FeaturePreDamaged(featureID, featureDefID, featureTeam, retDamage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if dmg ~= nil then retDamage = dmg @@ -2105,7 +2044,6 @@ function gadgetHandler:FeaturePreDamaged( return retDamage, retImpulse end - -------------------------------------------------------------------------------- -- -- Projectile call-ins @@ -2129,14 +2067,12 @@ function gadgetHandler:ProjectileDestroyed(proID, proOwnerID, proWeaponDefID) return end - -------------------------------------------------------------------------------- -- -- Shield call-ins -- --ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) function gadgetHandler:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) - for _, g in ipairs(self.ShieldPreDamagedList) do -- first gadget to handle this consumes the event if g:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) then @@ -2147,7 +2083,6 @@ function gadgetHandler:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNu return false end - -------------------------------------------------------------------------------- -- -- Misc call-ins @@ -2304,7 +2239,6 @@ function gadgetHandler:DrawShadowFeaturesLua() return end - function gadgetHandler:DrawWorldShadow() for _, g in ipairs(self.DrawWorldShadowList) do g:DrawWorldShadow() @@ -2362,9 +2296,6 @@ function gadgetHandler:DrawInMiniMap(mmsx, mmsy) return end - - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -2390,7 +2321,7 @@ function gadgetHandler:MousePress(x, y, button) local mo = self.mouseOwner if mo then mo:MousePress(x, y, button) - return true -- already have an active press + return true -- already have an active press end for _, g in ipairs(self.MousePressList) do if g:MousePress(x, y, button) then @@ -2453,7 +2384,7 @@ function gadgetHandler:GetTooltip(x, y) end end end - return '' + return "" end function gadgetHandler:UnsyncedHeightMapUpdate(x1, z1, x2, z2) diff --git a/luarules/gadgets/activity_broadcast.lua b/luarules/gadgets/activity_broadcast.lua index d2f8809b684..91adc2d2751 100644 --- a/luarules/gadgets/activity_broadcast.lua +++ b/luarules/gadgets/activity_broadcast.lua @@ -1,14 +1,13 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Activity Broadcast", - desc = "Checks if there is keyboard/mouse activity or camera changes", - author = "Floris", - date = "July,2016", + name = "Activity Broadcast", + desc = "Checks if there is keyboard/mouse activity or camera changes", + author = "Floris", + date = "July,2016", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end @@ -17,7 +16,7 @@ end -- config -------------------------------------------------------------------------------- -local sendPacketEvery = 2 +local sendPacketEvery = 2 -------------------------------------------------------------------------------- -- synced @@ -30,26 +29,25 @@ if gadgetHandler:IsSyncedCode() then local vb1, vb2 = string.byte(validation, 1, 2) function gadget:RecvLuaMsg(msg, playerID) - if #msg >= 3 and string.byte(msg,1)==hat_b and string.byte(msg,2)==vb1 and string.byte(msg,3)==vb2 then - SendToUnsynced("activityBroadcast",playerID) + if #msg >= 3 and string.byte(msg, 1) == hat_b and string.byte(msg, 2) == vb1 and string.byte(msg, 3) == vb2 then + SendToUnsynced("activityBroadcast", playerID) return true end end - else -------------------------------------------------------------------------------- -- unsynced -------------------------------------------------------------------------------- - local GetMouseState = Spring.GetMouseState - local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds - local SendLuaRulesMsg = Spring.SendLuaRulesMsg - local GetCameraState = Spring.GetCameraState + local GetMouseState = Spring.GetMouseState + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetCameraState = Spring.GetCameraState - local activity = false - local old_mx,old_my = 0,0 - local updateTimer = 0 - local prevCameraState = GetCameraState() + local activity = false + local old_mx, old_my = 0, 0 + local updateTimer = 0 + local prevCameraState = GetCameraState() local validation = SYNCED.validationActivity function gadget:Initialize() @@ -60,7 +58,7 @@ else gadgetHandler:RemoveSyncAction("activityBroadcast") end - function handleActivityEvent(_,playerID) + function handleActivityEvent(_, playerID) if Script.LuaUI("ActivityEvent") then Script.LuaUI.ActivityEvent(playerID) end @@ -70,9 +68,9 @@ else updateTimer = updateTimer + GetLastUpdateSeconds() if updateTimer > sendPacketEvery then -- mouse - local mx,my = GetMouseState() + local mx, my = GetMouseState() if mx ~= old_mx or my ~= old_my then - old_mx,old_my = mx,my + old_mx, old_my = mx, my activity = true end -- camera @@ -91,7 +89,7 @@ else end if activity then - SendLuaRulesMsg("^"..validation) + SendLuaRulesMsg("^" .. validation) activity = false end updateTimer = 0 @@ -101,6 +99,4 @@ else function gadget:KeyPress(key, mods, isRepeat) activity = true end - end - diff --git a/luarules/gadgets/ai_namer.lua b/luarules/gadgets/ai_namer.lua index 3952b8b0a09..94985aad5fc 100644 --- a/luarules/gadgets/ai_namer.lua +++ b/luarules/gadgets/ai_namer.lua @@ -1,34 +1,30 @@ - - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "AI namer", - desc = "Assignes names to AI teams", - author = "Floris", - date = "May 2018", + name = "AI namer", + desc = "Assignes names to AI teams", + author = "Floris", + date = "May 2018", license = "GNU GPL, v2 or later", - layer = 999, + layer = 999, enabled = true, } end - - if gadgetHandler:IsSyncedCode() then local cachedGameID -- gameID seems to be the only fucking thing that is truly random in this space? but it's a random garbage of numbers and letters, and we need to filter it out - function gadget:GameID(gameID) + function gadget:GameID(gameID) -- make sure gameID is a string because i'm not actually sure cachedGameID = tostring(gameID) -- Initialise this madness local FakeRandomSeed = "" -- because yes - for i = 1,1000 do + for i = 1, 1000 do -- Check if the next character in the game ID is a number - if tonumber(string.sub(cachedGameID, i, i)) then + if tonumber(string.sub(cachedGameID, i, i)) then -- Make sure the number we are creating doesn't grow beyond the 32bit integrer limits if (not tonumber(FakeRandomSeed)) or i <= 8 or (i > 8 and tonumber(FakeRandomSeed .. tonumber(string.sub(cachedGameID, i, i))) < 10) then -- Add the next character that is for sure a number @@ -49,14 +45,14 @@ if gadgetHandler:IsSyncedCode() then -- Voilà, now it's actually random! Somehow. -- Feel free to refactor this with less insanity. - local DonatorAINames = VFS.Include("luarules/configs/ai_namer/donators.lua") - local ContributorAINames = VFS.Include("luarules/configs/ai_namer/contributors.lua") - local RandomAINames = VFS.Include("luarules/configs/ai_namer/random.lua") - local ArmadaAINames = VFS.Include("luarules/configs/ai_namer/armada.lua") - local CortexAINames = VFS.Include("luarules/configs/ai_namer/cortex.lua") - local LegionAINames = VFS.Include("luarules/configs/ai_namer/legion.lua") - local RaptorAINames = {'Raptors'} - local ScavengerAINames = {'Scavengers'} + local DonatorAINames = VFS.Include("luarules/configs/ai_namer/donators.lua") + local ContributorAINames = VFS.Include("luarules/configs/ai_namer/contributors.lua") + local RandomAINames = VFS.Include("luarules/configs/ai_namer/random.lua") + local ArmadaAINames = VFS.Include("luarules/configs/ai_namer/armada.lua") + local CortexAINames = VFS.Include("luarules/configs/ai_namer/cortex.lua") + local LegionAINames = VFS.Include("luarules/configs/ai_namer/legion.lua") + local RaptorAINames = { "Raptors" } + local ScavengerAINames = { "Scavengers" } -- Sorting Helper --[[ @@ -103,54 +99,54 @@ if gadgetHandler:IsSyncedCode() then local confirmedAIName repeat --if math.random(0, FakeRandomSeed) < FakeRandomSeed*0.001 then - local aiName - if raptor then - aiName = RaptorAINames[math.random(1,#RaptorAINames)] - elseif scavenger then - aiName = ScavengerAINames[math.random(1,#ScavengerAINames)] - else - if math.random() <= 0.9 then --90% chance to get a human name - local humanrandom = math.random() - if humanrandom <= 0.6 then -- 60.0% chance for donator name - aiName = DonatorAINames[math.random(1,#DonatorAINames)] - elseif humanrandom <= 0.95 then -- 35% chance for contributor name - aiName = ContributorAINames[math.random(1,#ContributorAINames)] - else -- 5% chance for random AI name - aiName = RandomAINames[math.random(1,#RandomAINames)] - end - else -- 10% chance to get generic unit name - local factionrandom = math.random(1,3) - if factionrandom == 1 then -- Armada - aiName = ArmadaAINames[math.random(1,#ArmadaAINames)] - elseif factionrandom == 2 then -- Cortex - aiName = CortexAINames[math.random(1,#CortexAINames)] - else -- Legion - aiName = LegionAINames[math.random(1,#LegionAINames)] - end + local aiName + if raptor then + aiName = RaptorAINames[math.random(1, #RaptorAINames)] + elseif scavenger then + aiName = ScavengerAINames[math.random(1, #ScavengerAINames)] + else + if math.random() <= 0.9 then --90% chance to get a human name + local humanrandom = math.random() + if humanrandom <= 0.6 then -- 60.0% chance for donator name + aiName = DonatorAINames[math.random(1, #DonatorAINames)] + elseif humanrandom <= 0.95 then -- 35% chance for contributor name + aiName = ContributorAINames[math.random(1, #ContributorAINames)] + else -- 5% chance for random AI name + aiName = RandomAINames[math.random(1, #RandomAINames)] + end + else -- 10% chance to get generic unit name + local factionrandom = math.random(1, 3) + if factionrandom == 1 then -- Armada + aiName = ArmadaAINames[math.random(1, #ArmadaAINames)] + elseif factionrandom == 2 then -- Cortex + aiName = CortexAINames[math.random(1, #CortexAINames)] + else -- Legion + aiName = LegionAINames[math.random(1, #LegionAINames)] end end + end - if raptor or scavenger then + if raptor or scavenger then + confirmedAIName = aiName + else + if takenNames[aiName] == nil then + takenNames[aiName] = teamID confirmedAIName = aiName - else - if takenNames[aiName] == nil then - takenNames[aiName] = teamID - confirmedAIName = aiName - end end - --end + end + --end until confirmedAIName ~= nil return confirmedAIName end --function gadget:Initialize() - local t = Spring.GetTeamList() - for _,teamID in ipairs(t) do - if select(4,Spring.GetTeamInfo(teamID,false)) then -- is AI? - Spring.SetGameRulesParam('ainame_'..teamID, getName(teamID, string.find(Spring.GetTeamLuaAI(teamID) or '', "Raptors"), string.find(Spring.GetTeamLuaAI(teamID) or '', "Scavenger"))) - end + local t = Spring.GetTeamList() + for _, teamID in ipairs(t) do + if select(4, Spring.GetTeamInfo(teamID, false)) then -- is AI? + Spring.SetGameRulesParam("ainame_" .. teamID, getName(teamID, string.find(Spring.GetTeamLuaAI(teamID) or "", "Raptors"), string.find(Spring.GetTeamLuaAI(teamID) or "", "Scavenger"))) end - gadgetHandler:RemoveGadget(self) + end + gadgetHandler:RemoveGadget(self) --end end end diff --git a/luarules/gadgets/ai_ruin_blueprint_tester.lua b/luarules/gadgets/ai_ruin_blueprint_tester.lua index 1a120531b2d..0bec1015565 100644 --- a/luarules/gadgets/ai_ruin_blueprint_tester.lua +++ b/luarules/gadgets/ai_ruin_blueprint_tester.lua @@ -1,5 +1,4 @@ - -local cmdname = 'ruinblueprinttest' +local cmdname = "ruinblueprinttest" local blueprintspath = "luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/" local enabled = Spring.Utilities.IsDevMode() -- only enable in test environment local queue = {} @@ -12,97 +11,93 @@ local line = 1 local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Ruins Blueprint Tester", - desc = "Utility to test scav blueprints", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = enabled, - } + return { + name = "Ruins Blueprint Tester", + desc = "Utility to test scav blueprints", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = enabled, + } end if gadgetHandler:IsSyncedCode() then + function gadget:RecvLuaMsg(msg, playerID) + if string.find(msg, cmdname) then + local filename = string.gsub(msg, cmdname .. " ", "") + local blueprints = VFS.Include(blueprintspath .. filename .. ".lua") + local high_radius = 0 + local lastposX = 0 + local lastposZ = 0 - function gadget:RecvLuaMsg(msg, playerID) - - - if string.find(msg, cmdname) then - local filename = string.gsub(msg, cmdname .. " ", "") - local blueprints = VFS.Include(blueprintspath..filename..".lua") - local high_radius = 0 - local lastposX = 0 - local lastposZ = 0 - - if #blueprints > 0 then - for i = 1,#blueprints do - radius = blueprints[i]().radius - if high_radius < radius then - high_radius = radius - end - end - for i = 1,#blueprints do - if i == 1 then - blueprintpositions[1] = {posx = high_radius*3, posz = high_radius*3} - lastposX = high_radius*3 - lastposZ = high_radius*3 - else - if lastposX+high_radius*3 > mapsizeX then - line = line+1 - lastposX = 0 - lastposZ = high_radius*line*3 - end - blueprintpositions[i] = {posx = lastposX+high_radius*3, posz = lastposZ} - lastposX = lastposX+high_radius*3 - lastposZ = lastposZ - end - Spring.MarkerAddPoint(blueprintpositions[i].posx, Spring.GetGroundHeight(blueprintpositions[i].posx, blueprintpositions[i].posz), blueprintpositions[i].posz , "#"..i ) - end + if #blueprints > 0 then + for i = 1, #blueprints do + radius = blueprints[i]().radius + if high_radius < radius then + high_radius = radius + end + end + for i = 1, #blueprints do + if i == 1 then + blueprintpositions[1] = { posx = high_radius * 3, posz = high_radius * 3 } + lastposX = high_radius * 3 + lastposZ = high_radius * 3 + else + if lastposX + high_radius * 3 > mapsizeX then + line = line + 1 + lastposX = 0 + lastposZ = high_radius * line * 3 + end + blueprintpositions[i] = { posx = lastposX + high_radius * 3, posz = lastposZ } + lastposX = lastposX + high_radius * 3 + lastposZ = lastposZ + end + Spring.MarkerAddPoint(blueprintpositions[i].posx, Spring.GetGroundHeight(blueprintpositions[i].posx, blueprintpositions[i].posz), blueprintpositions[i].posz, "#" .. i) + end - for i = 1,#blueprints do - for j = 1,#blueprints[i]().buildings do - local blueprintTable = blueprints[i]().buildings[j] - if blueprintTable then - blueprintTable.basePosX = blueprintpositions[i].posx - blueprintTable.basePosZ = blueprintpositions[i].posz - local unitAndPos = blueprintTable - table.insert(queue, unitAndPos) - end - end - end - end - return true - end - end + for i = 1, #blueprints do + for j = 1, #blueprints[i]().buildings do + local blueprintTable = blueprints[i]().buildings[j] + if blueprintTable then + blueprintTable.basePosX = blueprintpositions[i].posx + blueprintTable.basePosZ = blueprintpositions[i].posz + local unitAndPos = blueprintTable + table.insert(queue, unitAndPos) + end + end + end + end + return true + end + end - function gadget:GameFrame(n) - if #queue > 0 then - local unitDefID = queue[1].unitDefID - if unitDefID then - Spring.Echo("UnitDefID: "..unitDefID) - local basePosX = queue[1].basePosX - Spring.Echo("basePosX: "..basePosX) - local basePosZ = queue[1].basePosZ - Spring.Echo("basePosZ: "..basePosZ) - local xOffset = queue[1].xOffset - Spring.Echo("xOffset: "..xOffset) - local zOffset = queue[1].zOffset - Spring.Echo("zOffset: "..zOffset) - local direction = queue[1].direction - Spring.Echo("direction: "..direction) - local nonscavname = string.gsub(UnitDefs[unitDefID].name, "_scav", "") + function gadget:GameFrame(n) + if #queue > 0 then + local unitDefID = queue[1].unitDefID + if unitDefID then + Spring.Echo("UnitDefID: " .. unitDefID) + local basePosX = queue[1].basePosX + Spring.Echo("basePosX: " .. basePosX) + local basePosZ = queue[1].basePosZ + Spring.Echo("basePosZ: " .. basePosZ) + local xOffset = queue[1].xOffset + Spring.Echo("xOffset: " .. xOffset) + local zOffset = queue[1].zOffset + Spring.Echo("zOffset: " .. zOffset) + local direction = queue[1].direction + Spring.Echo("direction: " .. direction) + local nonscavname = string.gsub(UnitDefs[unitDefID].name, "_scav", "") if UnitDefNames[nonscavname] then local nonscavDefID = UnitDefNames[nonscavname].id - Spring.CreateUnit(nonscavDefID, basePosX+xOffset, Spring.GetGroundHeight(basePosX+xOffset, basePosZ+zOffset), basePosZ+zOffset, direction, 0) + Spring.CreateUnit(nonscavDefID, basePosX + xOffset, Spring.GetGroundHeight(basePosX + xOffset, basePosZ + zOffset), basePosZ + zOffset, direction, 0) end - end - table.remove(queue, 1) - end - end + end + table.remove(queue, 1) + end + end else - - function gadget:Initialize() + function gadget:Initialize() gadgetHandler:AddChatAction(cmdname, RequestScavTest) end @@ -110,12 +105,11 @@ else gadgetHandler:RemoveChatAction(cmdname) end - function RequestScavTest(cmd, line, words, playerID) - if words and #words == 1 then - Spring.SendLuaRulesMsg(cmdname .. " "..words[1]) - else - Spring.SendMessageToPlayer(playerID, "Please specify which file you want to spawn (Enter the filename only without .lua)") - end - end - + function RequestScavTest(cmd, line, words, playerID) + if words and #words == 1 then + Spring.SendLuaRulesMsg(cmdname .. " " .. words[1]) + else + Spring.SendMessageToPlayer(playerID, "Please specify which file you want to spawn (Enter the filename only without .lua)") + end + end end diff --git a/luarules/gadgets/ai_ruins.lua b/luarules/gadgets/ai_ruins.lua index 95a9843a7e0..4529c75ddbc 100644 --- a/luarules/gadgets/ai_ruins.lua +++ b/luarules/gadgets/ai_ruins.lua @@ -1,4 +1,3 @@ - if not (Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins == "scav_only" and Spring.Utilities.Gametype.IsScavengers())) then return end @@ -7,13 +6,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "ruin spawn", - desc = "123", - author = "Damgam", - date = "2020", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = true, + name = "ruin spawn", + desc = "123", + author = "Damgam", + date = "2020", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = true, } end @@ -47,13 +46,13 @@ elseif ruinDensity == "verydense" then ruinMexGeoChance = 0.8 end -math_random = math.random -- not a local cause the includes below use it +math_random = math.random -- not a local cause the includes below use it local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") -local blueprintController = VFS.Include('luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua') -local scavConfig = VFS.Include('LuaRules/Configs/scav_spawn_defs.lua') +local blueprintController = VFS.Include("luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua") +local scavConfig = VFS.Include("LuaRules/Configs/scav_spawn_defs.lua") -local spawnCutoffFrame = (math.ceil( math.ceil(mapsizeX*mapsizeZ) / 1000000 )) * 3 +local spawnCutoffFrame = (math.ceil(math.ceil(mapsizeX * mapsizeZ) / 1000000)) * 3 -- TODO: Add weights to this crap. local landMexesList = { @@ -126,27 +125,28 @@ local seaGeosList = { local landDefences = {} local seaDefences = {} -for i = 1,#scavConfig.unprocessedScavTurrets do +for i = 1, #scavConfig.unprocessedScavTurrets do if i ~= 7 then -- we don't want the endgame stuff in these ruins for unitName, defs in pairs(scavConfig.unprocessedScavTurrets[i]) do - - if string.sub(unitName, -5, -1) == "_scav" and UnitDefNames[string.sub(unitName, 1, -6)] then unitName = string.sub(unitName, 1, -6) end -- convert scav unit into non-scav + if string.sub(unitName, -5, -1) == "_scav" and UnitDefNames[string.sub(unitName, 1, -6)] then + unitName = string.sub(unitName, 1, -6) + end -- convert scav unit into non-scav if not UnitDefNames[unitName] then Spring.Echo("We got a fucked unit name here: " .. unitName) end if defs.type ~= "nuke" and UnitDefNames[unitName] and not UnitDefNames[unitName].isFactory then -- we don't want nukes and factories in ruins if defs.surface == "land" then - for _ = 1,defs.maxExisting*((7-i)^2) do - landDefences[#landDefences+1] = unitName + for _ = 1, defs.maxExisting * ((7 - i) ^ 2) do + landDefences[#landDefences + 1] = unitName end elseif defs.surface == "sea" then - for _ = 1,defs.maxExisting*((7-i)^2) do - seaDefences[#seaDefences+1] = unitName + for _ = 1, defs.maxExisting * ((7 - i) ^ 2) do + seaDefences[#seaDefences + 1] = unitName end elseif defs.surface == "mixed" then - for _ = 1,defs.maxExisting*((7-i)^2) do - landDefences[#landDefences+1] = unitName - seaDefences[#seaDefences+1] = unitName + for _ = 1, defs.maxExisting * ((7 - i) ^ 2) do + landDefences[#landDefences + 1] = unitName + seaDefences[#seaDefences + 1] = unitName end end end @@ -154,10 +154,8 @@ for i = 1,#scavConfig.unprocessedScavTurrets do end end - - local function randomlyRotateBlueprint() - local randomRotation = math.random(0,3) + local randomRotation = math.random(0, 3) if randomRotation == 0 then -- normal local swapXandY = false local flipX = 1 @@ -219,44 +217,43 @@ local function randomlyMirrorBlueprint(mirrored, direction, unitFacing) end end - function getNearestBlocker(x, z) local lowestDist = math.huge local metalSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].metalSpotsList or nil if metalSpots then for i = 1, #metalSpots do local spot = metalSpots[i] - if spot then - local dx, dz = x - spot.x, z - spot.z - local dist = dx * dx + dz * dz - if dist < lowestDist then - lowestDist = dist - end - end + if spot then + local dx, dz = x - spot.x, z - spot.z + local dist = dx * dx + dz * dz + if dist < lowestDist then + lowestDist = dist + end + end end - end + end local geoSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].geoSpotsList or nil if geoSpots then for i = 1, #geoSpots do local spot = geoSpots[i] - if spot then - local dx, dz = x - spot.x, z - spot.z - local dist = dx * dx + dz * dz - if dist < lowestDist then - lowestDist = dist - end - end + if spot then + local dx, dz = x - spot.x, z - spot.z + local dist = dx * dx + dz * dz + if dist < lowestDist then + lowestDist = dist + end + end end - end + end --Spring.Echo(lowestDist, math.sqrt(lowestDist)) - return math.sqrt(lowestDist) + return math.sqrt(lowestDist) end local function spawnRuin(ruin, posx, posy, posz, blueprintTierLevel) local swapXandY, flipX, flipZ, rotation = randomlyRotateBlueprint() local mirrored, mirroredDirection, xOffset, zOffset - if math.random(0,1) == 0 then - if math.random(0,1) == 0 then + if math.random(0, 1) == 0 then + if math.random(0, 1) == 0 then mirrored = true mirroredDirection = "h" else @@ -276,38 +273,38 @@ local function spawnRuin(ruin, posx, posy, posz, blueprintTierLevel) xOffset = building.zOffset zOffset = building.xOffset end - local mirrorX, mirrorZ, mirrorRotation = randomlyMirrorBlueprint(mirrored, mirroredDirection, (building.direction+rotation)%4) + local mirrorX, mirrorZ, mirrorRotation = randomlyMirrorBlueprint(mirrored, mirroredDirection, (building.direction + rotation) % 4) local name = UnitDefs[building.unitDefID].name local nonscavname = string.gsub(name, "_scav", "") - local r = math.random(1,100) + local r = math.random(1, 100) if r < 40 and UnitDefNames[nonscavname] then - local posy = Spring.GetGroundHeight(posx + (xOffset*flipX*mirrorX), posz + (zOffset*flipZ*mirrorZ)) - local unit = Spring.CreateUnit(UnitDefNames[nonscavname].id, posx + (xOffset*flipX*mirrorX), posy, posz + (zOffset*flipZ*mirrorZ), (building.direction+rotation+mirrorRotation)%4, GaiaTeamID) + local posy = Spring.GetGroundHeight(posx + (xOffset * flipX * mirrorX), posz + (zOffset * flipZ * mirrorZ)) + local unit = Spring.CreateUnit(UnitDefNames[nonscavname].id, posx + (xOffset * flipX * mirrorX), posy, posz + (zOffset * flipZ * mirrorZ), (building.direction + rotation + mirrorRotation) % 4, GaiaTeamID) if unit then local radarRange = UnitDefs[building.unitDefID].radarDistance local canMove = UnitDefs[building.unitDefID].canMove local speed = UnitDefs[building.unitDefID].speed Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) --Spring.SetUnitAlwaysVisible(unit, true) if building.patrol and canMove and speed > 0 then for i = 1, 6 do - Spring.GiveOrderToUnit(unit, CMD.PATROL, { posx + (math.random(-200, 200)), posy + 100, posz + (math.random(-200, 200)) }, {"shift", "alt", "ctrl"}) + Spring.GiveOrderToUnit(unit, CMD.PATROL, { posx + (math.random(-200, 200)), posy + 100, posz + (math.random(-200, 200)) }, { "shift", "alt", "ctrl" }) end end if radarRange and radarRange > 1000 then - Spring.GiveOrderToUnit(unit, CMD.ONOFF, {0}, 0) + Spring.GiveOrderToUnit(unit, CMD.ONOFF, { 0 }, 0) end end - -- elseif r < 90 and FeatureDefNames[name .. "_dead"] then - -- local wreck = Spring.CreateFeature(name .. "_dead", posx + (xOffset*flipX*mirrorX), posy, posz + (zOffset*flipZ*mirrorZ), (building.direction+rotation+mirrorRotation)%4, GaiaTeamID) - -- Spring.SetFeatureAlwaysVisible(wreck, false) - -- Spring.SetFeatureResurrect(wreck, name) + -- elseif r < 90 and FeatureDefNames[name .. "_dead"] then + -- local wreck = Spring.CreateFeature(name .. "_dead", posx + (xOffset*flipX*mirrorX), posy, posz + (zOffset*flipZ*mirrorZ), (building.direction+rotation+mirrorRotation)%4, GaiaTeamID) + -- Spring.SetFeatureAlwaysVisible(wreck, false) + -- Spring.SetFeatureResurrect(wreck, name) end end end @@ -317,11 +314,11 @@ end local SpawnedMexes = {} local function SpawnMexes(mexSpots) - for i = 1,#mexSpots do + for i = 1, #mexSpots do if math_random() <= ruinMexGeoChance then local spot = mexSpots[i] - local posx = math.ceil(spot.x/16)*16 - local posz = math.ceil(spot.z/16)*16 + local posx = math.ceil(spot.x / 16) * 16 + local posz = math.ceil(spot.z / 16) * 16 local posy = Spring.GetGroundHeight(posx, posz) local mexesList if posy > 0 then @@ -331,10 +328,7 @@ local function SpawnMexes(mexSpots) end local radius = 32 - local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) - and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) - and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) + local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) if posy > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx, posy, posz, radius) @@ -343,13 +337,13 @@ local function SpawnMexes(mexSpots) end if canBuildHere then - local mex = mexesList[math.random(1,#mexesList)] - local unit = Spring.CreateUnit(UnitDefNames[mex].id, posx, posy, posz, math.random(0,3), GaiaTeamID) + local mex = mexesList[math.random(1, #mexesList)] + local unit = Spring.CreateUnit(UnitDefNames[mex].id, posx, posy, posz, math.random(0, 3), GaiaTeamID) if unit then Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) - SpawnedMexes[i] = math.random(1,2) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) + SpawnedMexes[i] = math.random(1, 2) end end end @@ -358,11 +352,11 @@ end local SpawnedGeos = {} local function SpawnGeos(geoSpots) - for i = 1,#geoSpots do + for i = 1, #geoSpots do if math_random() <= ruinMexGeoChance then local spot = geoSpots[i] - local posx = math.ceil(spot.x/16)*16 - local posz = math.ceil(spot.z/16)*16 + local posx = math.ceil(spot.x / 16) * 16 + local posz = math.ceil(spot.z / 16) * 16 local posy = Spring.GetGroundHeight(posx, posz) local geosList if posy > 0 then @@ -372,10 +366,7 @@ local function SpawnGeos(geoSpots) end local radius = 32 - local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) - and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) - and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) + local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) if posy > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx, posy, posz, radius) @@ -384,13 +375,13 @@ local function SpawnGeos(geoSpots) end if canBuildHere then - local geo = geosList[math.random(1,#geosList)] - local unit = Spring.CreateUnit(UnitDefNames[geo].id, posx, posy, posz, math.random(0,3), GaiaTeamID) + local geo = geosList[math.random(1, #geosList)] + local unit = Spring.CreateUnit(UnitDefNames[geo].id, posx, posy, posz, math.random(0, 3), GaiaTeamID) if unit then Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) - SpawnedGeos[i] = math.random(2,3) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) + SpawnedGeos[i] = math.random(2, 3) end end end @@ -400,12 +391,12 @@ end local function SpawnMexGeoRandomStructures() local mexSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].metalSpotsList or nil if mexSpots and #mexSpots > 5 then - for i = 1,#mexSpots do + for i = 1, #mexSpots do if SpawnedMexes[i] then local spot = mexSpots[i] - for j = 1,SpawnedMexes[i] do - local posx2 = math.ceil((spot.x+math.random(-512,512))/16)*16 - local posz2 = math.ceil((spot.z+math.random(-512,512))/16)*16 + for j = 1, SpawnedMexes[i] do + local posx2 = math.ceil((spot.x + math.random(-512, 512)) / 16) * 16 + local posz2 = math.ceil((spot.z + math.random(-512, 512)) / 16) * 16 local posy2 = Spring.GetGroundHeight(posx2, posz2) local defencesList if posy2 > 0 then @@ -415,10 +406,7 @@ local function SpawnMexGeoRandomStructures() end local radius = 128 - local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx2, posy2, posz2, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx2, posy2, posz2, radius) - and positionCheckLibrary.OccupancyCheck(posx2, posy2, posz2, radius) - and positionCheckLibrary.FlatAreaCheck(posx2, posy2, posz2, radius) + local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx2, posy2, posz2, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx2, posy2, posz2, radius) and positionCheckLibrary.OccupancyCheck(posx2, posy2, posz2, radius) and positionCheckLibrary.FlatAreaCheck(posx2, posy2, posz2, radius) if posy2 > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx2, posy2, posz2, radius) @@ -431,12 +419,12 @@ local function SpawnMexGeoRandomStructures() end if canBuildHere then - local defence = defencesList[math.random(1,#defencesList)] - local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx2, posy2, posz2, math.random(0,3), GaiaTeamID) + local defence = defencesList[math.random(1, #defencesList)] + local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx2, posy2, posz2, math.random(0, 3), GaiaTeamID) if unit then Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) end end end @@ -446,12 +434,12 @@ local function SpawnMexGeoRandomStructures() local geoSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].geoSpotsList or nil if geoSpots and #geoSpots >= 1 then - for i = 1,#geoSpots do + for i = 1, #geoSpots do if SpawnedGeos[i] then local spot = geoSpots[i] - for j = 1,SpawnedGeos[i] do - local posx2 = math.ceil((spot.x+math.random(-1024,1024))/16)*16 - local posz2 = math.ceil((spot.z+math.random(-1024,1024))/16)*16 + for j = 1, SpawnedGeos[i] do + local posx2 = math.ceil((spot.x + math.random(-1024, 1024)) / 16) * 16 + local posz2 = math.ceil((spot.z + math.random(-1024, 1024)) / 16) * 16 local posy2 = Spring.GetGroundHeight(posx2, posz2) local defencesList if posy2 > 0 then @@ -461,10 +449,7 @@ local function SpawnMexGeoRandomStructures() end local radius = 128 - local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx2, posy2, posz2, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx2, posy2, posz2, radius) - and positionCheckLibrary.OccupancyCheck(posx2, posy2, posz2, radius) - and positionCheckLibrary.FlatAreaCheck(posx2, posy2, posz2, radius) + local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx2, posy2, posz2, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx2, posy2, posz2, radius) and positionCheckLibrary.OccupancyCheck(posx2, posy2, posz2, radius) and positionCheckLibrary.FlatAreaCheck(posx2, posy2, posz2, radius) if posy2 > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx2, posy2, posz2, radius) @@ -477,12 +462,12 @@ local function SpawnMexGeoRandomStructures() end if canBuildHere then - local defence = defencesList[math.random(1,#defencesList)] - local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx2, posy2, posz2, math.random(0,3), GaiaTeamID) + local defence = defencesList[math.random(1, #defencesList)] + local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx2, posy2, posz2, math.random(0, 3), GaiaTeamID) if unit then Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) end end end @@ -492,10 +477,10 @@ local function SpawnMexGeoRandomStructures() end local function SpawnRandomStructures() - for i = 1,math.ceil(spawnCutoffFrame/10) do - for j = 1,math.ceil(10*ruinDensityMultiplier) do - local posx = math.ceil(math.random(196,Game.mapSizeX-196)/16)*16 - local posz = math.ceil(math.random(196,Game.mapSizeZ-196)/16)*16 + for i = 1, math.ceil(spawnCutoffFrame / 10) do + for j = 1, math.ceil(10 * ruinDensityMultiplier) do + local posx = math.ceil(math.random(196, Game.mapSizeX - 196) / 16) * 16 + local posz = math.ceil(math.random(196, Game.mapSizeZ - 196) / 16) * 16 local posy = Spring.GetGroundHeight(posx, posz) local defencesList if posy > 0 then @@ -505,10 +490,7 @@ local function SpawnRandomStructures() end local radius = 128 - local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) - and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) - and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) + local canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) if posy > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx, posy, posz, radius) @@ -521,12 +503,12 @@ local function SpawnRandomStructures() end if canBuildHere then - local defence = defencesList[math.random(1,#defencesList)] - local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx, posy, posz, math.random(0,3), GaiaTeamID) + local defence = defencesList[math.random(1, #defencesList)] + local unit = Spring.CreateUnit(UnitDefNames[defence].id, posx, posy, posz, math.random(0, 3), GaiaTeamID) if unit then Spring.SetUnitNeutral(unit, true) - Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, {1}, 0) - Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, {0}, 0) + Spring.GiveOrderToUnit(unit, CMD.FIRE_STATE, { 1 }, 0) + Spring.GiveOrderToUnit(unit, CMD.MOVE_STATE, { 0 }, 0) end break end @@ -535,8 +517,7 @@ local function SpawnRandomStructures() end function gadget:GameFrame(n) - - if n == math.ceil(spawnCutoffFrame*0.5) then + if n == math.ceil(spawnCutoffFrame * 0.5) then local mexSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].metalSpotsList or nil if mexSpots and #mexSpots > 5 then SpawnMexes(mexSpots) @@ -558,7 +539,7 @@ function gadget:GameFrame(n) SpawnRandomStructures() end - if n < (5/ruinDensityMultiplier) or n%math.ceil((5/ruinDensityMultiplier)) ~= 0 or n > spawnCutoffFrame+5 then + if n < (5 / ruinDensityMultiplier) or n % math.ceil((5 / ruinDensityMultiplier)) ~= 0 or n > spawnCutoffFrame + 5 then return end @@ -570,7 +551,7 @@ function gadget:GameFrame(n) posy = Spring.GetGroundHeight(posx, posz) seaRuinChance = math.random(1, 2) - r = math.random(0,100) -- replace 100 with 200 when we get civilians + r = math.random(0, 100) -- replace 100 with 200 when we get civilians blueprintTierLevel = 0 -- if r > 100 and Spring.GetModOptions().ruins_civilian_disable == false then -- landRuin = blueprintController.Ruin.GetRandomLandBlueprint() @@ -606,10 +587,7 @@ function gadget:GameFrame(n) if ruin ~= nil then -- Nil check because Lua does not have a "continue" statement radius = ruin.radius - canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) - and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) - and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) - and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) + canBuildHere = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, radius, GaiaAllyTeamID, true, true, true) and positionCheckLibrary.MapEdgeCheck(posx, posy, posz, radius) and positionCheckLibrary.OccupancyCheck(posx, posy, posz, radius) and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, radius) if posy > 0 then canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx, posy, posz, radius) @@ -617,7 +595,7 @@ function gadget:GameFrame(n) canBuildHere = canBuildHere and positionCheckLibrary.SurfaceCheck(posx, posy, posz, radius, true) end - if canBuildHere and getNearestBlocker(posx, posz) < radius*0.5 then + if canBuildHere and getNearestBlocker(posx, posz) < radius * 0.5 then canBuildHere = false end diff --git a/luarules/gadgets/ai_simpleai.lua b/luarules/gadgets/ai_simpleai.lua index d529fa8fd41..1a7221ee0e1 100644 --- a/luarules/gadgets/ai_simpleai.lua +++ b/luarules/gadgets/ai_simpleai.lua @@ -9,7 +9,7 @@ local teams = Spring.GetTeamList() for i = 1, #teams do local teamID = teams[i] local luaAI = Spring.GetTeamLuaAI(teamID) - if luaAI and luaAI ~= "" and (string.sub(luaAI, 1, 8) == 'SimpleAI' or string.sub(luaAI, 1, 15) == 'SimpleCheaterAI' or string.sub(luaAI, 1, 16) == 'SimpleDefenderAI' or string.sub(luaAI, 1, 19) == 'SimpleConstructorAI') then + if luaAI and luaAI ~= "" and (string.sub(luaAI, 1, 8) == "SimpleAI" or string.sub(luaAI, 1, 15) == "SimpleCheaterAI" or string.sub(luaAI, 1, 16) == "SimpleDefenderAI" or string.sub(luaAI, 1, 19) == "SimpleConstructorAI") then enabled = true SimpleAITeamIDsCount = SimpleAITeamIDsCount + 1 SimpleAITeamIDs[SimpleAITeamIDsCount] = teamID @@ -74,9 +74,9 @@ local function RandomChoice(self) -- lazy initialization if self.array == nil then local array = {} - for k,v in pairs(self) do + for k, v in pairs(self) do if k ~= "RandomChoice" then - array[#array+1] = k + array[#array + 1] = k end end self.array = array @@ -93,15 +93,15 @@ end -- SimpleCommanderDefs:RandomChoice() -- SimpleCommanderDefs.RandomChoice(SimpleCommanderDefs) -local SimpleCommanderDefs = {RandomChoice = RandomChoice} -local SimpleFactoriesDefs = {RandomChoice = RandomChoice} -local SimpleConstructorDefs = {RandomChoice = RandomChoice} -local SimpleExtractorDefs = {RandomChoice = RandomChoice} -local SimpleGeneratorDefs = {RandomChoice = RandomChoice} -local SimpleConverterDefs = {RandomChoice = RandomChoice} -local SimpleTurretDefs = {RandomChoice = RandomChoice} -local SimpleUndefinedBuildingDefs = {RandomChoice = RandomChoice} -local SimpleUndefinedUnitDefs = {RandomChoice = RandomChoice} +local SimpleCommanderDefs = { RandomChoice = RandomChoice } +local SimpleFactoriesDefs = { RandomChoice = RandomChoice } +local SimpleConstructorDefs = { RandomChoice = RandomChoice } +local SimpleExtractorDefs = { RandomChoice = RandomChoice } +local SimpleGeneratorDefs = { RandomChoice = RandomChoice } +local SimpleConverterDefs = { RandomChoice = RandomChoice } +local SimpleTurretDefs = { RandomChoice = RandomChoice } +local SimpleUndefinedBuildingDefs = { RandomChoice = RandomChoice } +local SimpleUndefinedUnitDefs = { RandomChoice = RandomChoice } local BuildOptions = {} -- {unitDefHasBuildOptions = {1= buildOpt0, RandomChoice = RandomChoice}} @@ -109,10 +109,10 @@ local isBuilding = {} local isCommander = {} for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.isBuilding then - isBuilding[unitDefID] = {unitDef.xsize, unitDef.zsize} + isBuilding[unitDefID] = { unitDef.xsize, unitDef.zsize } end if unitDef.customParams.iscommander then - isCommander[unitDefID] = {unitDef.xsize, unitDef.zsize} + isCommander[unitDefID] = { unitDef.xsize, unitDef.zsize } end local skip = false @@ -141,7 +141,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do skip = true end -- objects/walls - if unitDef.modCategories['object'] or unitDef.customParams.objectify then + if unitDef.modCategories["object"] or unitDef.customParams.objectify then skip = true end @@ -166,15 +166,14 @@ for unitDefID, unitDef in pairs(UnitDefs) do SimpleUndefinedUnitDefs[unitDefID] = 1 end if #unitDef.buildOptions > 0 then - BuildOptions[unitDefID] = {RandomChoice = RandomChoice} - for i=1, #unitDef.buildOptions do + BuildOptions[unitDefID] = { RandomChoice = RandomChoice } + for i = 1, #unitDef.buildOptions do BuildOptions[unitDefID][unitDef.buildOptions[i]] = 1 end end end end - local spGiveOrderToUnit = Spring.GiveOrderToUnit local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy local spGetUnitsInCylinder = Spring.GetUnitsInCylinder @@ -197,7 +196,6 @@ local spGetTeamInfo = Spring.GetTeamInfo local spGetTeamLuaAI = Spring.GetTeamLuaAI local spDgunCommand = CMD.DGUN - local function SimpleGetClosestMexSpot(x, z) --tracy.ZoneBeginN("SimpleAI:SimpleGetClosestMexSpot") local bestSpot @@ -220,26 +218,28 @@ local function SimpleGetClosestMexSpot(x, z) -- optimize for metal maps a bit local searchwidth = HashPosTable.resolution / 2 - 32 for hashposindex = 1, HashPosTable.numPos do - local tilecenterx, tilecenterz = HashPosTable:GetNthCenter(x,z,hashposindex) - for attempt = 1,5 do + local tilecenterx, tilecenterz = HashPosTable:GetNthCenter(x, z, hashposindex) + for attempt = 1, 5 do local posx = tilecenterx + random(-searchwidth, searchwidth) local posz = tilecenterz + random(-searchwidth, searchwidth) local posy = spGetGroundHeight(posx, posz) if posy then - local _,_,hasmetal = spGetGroundInfo(posx, posz) + local _, _, hasmetal = spGetGroundInfo(posx, posz) if hasmetal and hasmetal > 0.1 then local flat = positionCheckLibrary.FlatAreaCheck(posx, posy, posz, 64, 25, true) if flat then local unoccupied = positionCheckLibrary.OccupancyCheck(posx, posy, posz, 48) if unoccupied then - bestSpot = {x = posx, y = posy, z = posz} + bestSpot = { x = posx, y = posy, z = posz } break end end end end end - if bestSpot then break end + if bestSpot then + break + end end end --tracy.ZoneEnd() @@ -247,7 +247,6 @@ local function SimpleGetClosestMexSpot(x, z) end local function SimpleBuildOrder(cUnitID, building) - --tracy.ZoneBeginN("SimpleAI:SimpleBuildOrder") --Spring.Echo( UnitDefs[spGetUnitDefID(cUnitID)].name, " ordered to build", UnitDefs[building].name) local searchRange = 0 @@ -256,18 +255,18 @@ local function SimpleBuildOrder(cUnitID, building) if not cunitposx then return end - + local team = spGetUnitTeam(cUnitID) --Spring.Echo("SBO", cUnitID,"Start") - for b2 = 1,20 do + for b2 = 1, 20 do searchRange = searchRange + 300 -- WARNING, THIS EVENTUALLY ENDS UP BEING A 6000 RADIUS CIRCLE! local units = spGetUnitsInCylinder(cunitposx, cunitposz, searchRange) if units and #units > 1 then local gaveOrder = false local numUnits = #units local maxTests = min(numUnits, 5 + b2 * 2) - for k=1, maxTests do - numtests = numtests+1 + for k = 1, maxTests do + numtests = numtests + 1 local buildnear = units[random(1, numUnits)] local refDefID = spGetUnitDefID(buildnear) local refEntry = refDefID and (isBuilding[refDefID] or isCommander[refDefID]) @@ -279,7 +278,7 @@ local function SimpleBuildOrder(cUnitID, building) local spacing = random(64, 128) local testspacing = spacing * 0.75 local buildingDefID = building - local r = random(0,3) + local r = random(0, 3) local rx = 0 local rz = 0 if r == 0 then @@ -287,9 +286,9 @@ local function SimpleBuildOrder(cUnitID, building) elseif r == 1 then rx = reffootx + spacing elseif r == 2 then - rz = - reffootz - spacing + rz = -reffootz - spacing else - rx = - reffootx - spacing + rx = -reffootx - spacing end local bposx = refx + rx @@ -309,7 +308,9 @@ local function SimpleBuildOrder(cUnitID, building) end end end - if gaveOrder then break end + if gaveOrder then + break + end end end --tracy.ZoneEnd() @@ -325,151 +326,150 @@ local function SimpleConstructionProjectSelection(unitID, unitDefID, unitTeam, u local unitposx, _, unitposz = spGetUnitPosition(unitID) local buildOptions = BuildOptions[unitDefID] - -- Builders - for b1 = 1,10 do - if type == "Builder" or type == "Commander" then - --Spring.Echo("unitCommands for",b1, UnitDefs[ unitDefID].name, b1) - SimpleFactoryDelay[unitTeam] = SimpleFactoryDelay[unitTeam]-1 - local r = random(0, 20) - local mexspotpos = SimpleGetClosestMexSpot(unitposx, unitposz) - if (mexspotpos and SimpleT1Mexes[unitTeam] < 3) and type == "Commander" then - local project = SimpleExtractorDefs:RandomChoice() - if buildOptions and buildOptions[project] then - spGiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) - --Spring.Echo("Success! Project Type: Extractor.") - success = true - end - elseif ecurrent < estorage * 0.75 or r == 0 then - local project = SimpleGeneratorDefs:RandomChoice() + -- Builders + for b1 = 1, 10 do + if type == "Builder" or type == "Commander" then + --Spring.Echo("unitCommands for",b1, UnitDefs[ unitDefID].name, b1) + SimpleFactoryDelay[unitTeam] = SimpleFactoryDelay[unitTeam] - 1 + local r = random(0, 20) + local mexspotpos = SimpleGetClosestMexSpot(unitposx, unitposz) + if (mexspotpos and SimpleT1Mexes[unitTeam] < 3) and type == "Commander" then + local project = SimpleExtractorDefs:RandomChoice() + if buildOptions and buildOptions[project] then + spGiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) + --Spring.Echo("Success! Project Type: Extractor.") + success = true + end + elseif ecurrent < estorage * 0.75 or r == 0 then + local project = SimpleGeneratorDefs:RandomChoice() + if buildOptions and buildOptions[project] then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Generator.") + success = true + end + elseif mcurrent < mstorage * 0.30 or r == 1 then + if (not mexspotpos) and (ecurrent > estorage * 0.85 or r == 1) then + local project = SimpleConverterDefs:RandomChoice() if buildOptions and buildOptions[project] then SimpleBuildOrder(unitID, project) - --Spring.Echo("Success! Project Type: Generator.") + --Spring.Echo("Success! Project Type: Converter.") success = true end - - elseif mcurrent < mstorage * 0.30 or r == 1 then - if (not mexspotpos) and (ecurrent > estorage * 0.85 or r == 1) then - local project = SimpleConverterDefs:RandomChoice() - if buildOptions and buildOptions[project] then - SimpleBuildOrder(unitID, project) - --Spring.Echo("Success! Project Type: Converter.") - success = true - end - elseif mexspotpos and type ~= "Commander" then - local project = SimpleExtractorDefs:RandomChoice() - local xoffsets = {0, 100, -100} - local zoffsets = {0, 100, -100} - if buildOptions and buildOptions[project] then - spGiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) - for _, xoffset in ipairs(xoffsets) do - for _, zoffset in ipairs(zoffsets) do - if xoffset ~= 0 and zoffset ~= 0 then - local projectturret = SimpleTurretDefs:RandomChoice() - if buildOptions[projectturret] then - spGiveOrderToUnit(unitID, -projectturret, { mexspotpos.x + xoffset, mexspotpos.y, mexspotpos.z + zoffset , random(0,3) }, { "shift" }) - end + elseif mexspotpos and type ~= "Commander" then + local project = SimpleExtractorDefs:RandomChoice() + local xoffsets = { 0, 100, -100 } + local zoffsets = { 0, 100, -100 } + if buildOptions and buildOptions[project] then + spGiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) + for _, xoffset in ipairs(xoffsets) do + for _, zoffset in ipairs(zoffsets) do + if xoffset ~= 0 and zoffset ~= 0 then + local projectturret = SimpleTurretDefs:RandomChoice() + if buildOptions[projectturret] then + spGiveOrderToUnit(unitID, -projectturret, { mexspotpos.x + xoffset, mexspotpos.y, mexspotpos.z + zoffset, random(0, 3) }, { "shift" }) end end end end end - elseif r == 2 or r == 3 or r == 4 or r == 5 then - local project = SimpleTurretDefs:RandomChoice() + end + elseif r == 2 or r == 3 or r == 4 or r == 5 then + local project = SimpleTurretDefs:RandomChoice() + if buildOptions and buildOptions[project] then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Turret.") + success = true + end + elseif SimpleFactoriesCount[unitTeam] < 1 or ((mcurrent > mstorage * 0.75 and ecurrent > estorage * 0.75) and SimpleFactoryDelay[unitTeam] <= 0) then + local project = SimpleFactoriesDefs:RandomChoice() + if buildOptions and buildOptions[project] and not SimpleFactories[unitTeam][project] then + SimpleBuildOrder(unitID, project) + SimpleFactoryDelay[unitTeam] = 30 + --Spring.Echo("Success! Project Type: Factory.") + success = true + end + elseif r == 11 then + for t = 1, 10 do + local targetUnit = units[random(1, #units)] + if targetUnit then + local targetDefID = spGetUnitDefID(targetUnit) + if targetDefID and isBuilding[targetDefID] then + local tUnitX, tUnitY, tUnitZ = spGetUnitPosition(targetUnit) + if tUnitX then + spGiveOrderToUnit(unitID, CMD_MOVE, { tUnitX + random(-100, 100), tUnitY, tUnitZ + random(-100, 100) }, { "shift", "alt", "ctrl" }) + success = true + break + end + end + end + end + elseif r == 12 and type ~= "Commander" then + local mapcenterX = mapsizeX / 2 + local mapcenterZ = mapsizeZ / 2 + local mapcenterY = spGetGroundHeight(mapcenterX, mapcenterZ) + if mapcenterY then + spGiveOrderToUnit(unitID, CMD_RECLAIM, { mapcenterX + random(-100, 100), mapcenterY, mapcenterZ + random(-100, 100), mapdiagonal }, 0) + success = true + end + elseif r == 13 and type ~= "Commander" then + local mapcenterX = mapsizeX / 2 + local mapcenterZ = mapsizeZ / 2 + local mapcenterY = spGetGroundHeight(mapcenterX, mapcenterZ) + if mapcenterY then + spGiveOrderToUnit(unitID, CMD_REPAIR, { mapcenterX + random(-100, 100), mapcenterY, mapcenterZ + random(-100, 100), mapdiagonal }, 0) + success = true + end + else + local r2 = random(0, 1) + if r2 == 0 then + local project = SimpleUndefinedBuildingDefs:RandomChoice() if buildOptions and buildOptions[project] then SimpleBuildOrder(unitID, project) - --Spring.Echo("Success! Project Type: Turret.") + --Spring.Echo("Success! Project Type: Other.") success = true end - elseif SimpleFactoriesCount[unitTeam] < 1 or ((mcurrent > mstorage * 0.75 and ecurrent > estorage * 0.75) and SimpleFactoryDelay[unitTeam] <= 0) then - local project = SimpleFactoriesDefs:RandomChoice() - if buildOptions and buildOptions[project] and (not SimpleFactories[unitTeam][project]) then + else + local project = SimpleTurretDefs:RandomChoice() + if buildOptions and buildOptions[project] then SimpleBuildOrder(unitID, project) - SimpleFactoryDelay[unitTeam] = 30 - --Spring.Echo("Success! Project Type: Factory.") + --Spring.Echo("Success! Project Type: Turret.") success = true end - elseif r == 11 then - for t = 1,10 do - local targetUnit = units[random(1,#units)] - if targetUnit then - local targetDefID = spGetUnitDefID(targetUnit) - if targetDefID and isBuilding[targetDefID] then - local tUnitX, tUnitY, tUnitZ = spGetUnitPosition(targetUnit) - if tUnitX then - spGiveOrderToUnit(unitID, CMD_MOVE, { tUnitX + random(-100, 100), tUnitY, tUnitZ + random(-100, 100) }, { "shift", "alt", "ctrl" }) - success = true - break - end - end + end + end + elseif type == "Factory" then + if #spGetFullBuildQueue(unitID) < 5 then + local r = random(0, 5) + local luaAI = spGetTeamLuaAI(unitTeam) + if r == 0 or mcurrent > mstorage * 0.9 or (luaAI and string_sub(luaAI, 1, 19) == "SimpleConstructorAI") then + local project = SimpleConstructorDefs:RandomChoice() + if buildOptions and buildOptions[project] then + local x, y, z = spGetUnitPosition(unitID) + if x then + spGiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) + --Spring.Echo("Success! Project Type: Constructor.") + success = true end end - elseif r == 12 and type ~= "Commander" then - local mapcenterX = mapsizeX/2 - local mapcenterZ = mapsizeZ/2 - local mapcenterY = spGetGroundHeight(mapcenterX, mapcenterZ) - if mapcenterY then - spGiveOrderToUnit(unitID, CMD_RECLAIM,{mapcenterX+random(-100,100),mapcenterY,mapcenterZ+random(-100,100),mapdiagonal}, 0) - success = true - end - elseif r == 13 and type ~= "Commander" then - local mapcenterX = mapsizeX/2 - local mapcenterZ = mapsizeZ/2 - local mapcenterY = spGetGroundHeight(mapcenterX, mapcenterZ) - if mapcenterY then - spGiveOrderToUnit(unitID, CMD_REPAIR,{mapcenterX+random(-100,100),mapcenterY,mapcenterZ+random(-100,100),mapdiagonal}, 0) - success = true - end else - local r2 = random(0, 1) - if r2 == 0 then - local project = SimpleUndefinedBuildingDefs:RandomChoice() - if buildOptions and buildOptions[project] then - SimpleBuildOrder(unitID, project) - --Spring.Echo("Success! Project Type: Other.") - success = true - end - else - local project = SimpleTurretDefs:RandomChoice() - if buildOptions and buildOptions[project] then - SimpleBuildOrder(unitID, project) - --Spring.Echo("Success! Project Type: Turret.") + local project = SimpleUndefinedUnitDefs:RandomChoice() + if buildOptions and buildOptions[project] then + local x, y, z = spGetUnitPosition(unitID) + if x then + spGiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) + --Spring.Echo("Success! Project Type: Unit.") success = true end end end - elseif type == "Factory" then - if #spGetFullBuildQueue(unitID) < 5 then - local r = random(0, 5) - local luaAI = spGetTeamLuaAI(unitTeam) - if r == 0 or mcurrent > mstorage*0.9 or (luaAI and string_sub(luaAI, 1, 19) == 'SimpleConstructorAI') then - local project = SimpleConstructorDefs:RandomChoice() - if buildOptions and buildOptions[project] then - local x, y, z = spGetUnitPosition(unitID) - if x then - spGiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) - --Spring.Echo("Success! Project Type: Constructor.") - success = true - end - end - else - local project = SimpleUndefinedUnitDefs:RandomChoice() - if buildOptions and buildOptions[project] then - local x, y, z = spGetUnitPosition(unitID) - if x then - spGiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) - --Spring.Echo("Success! Project Type: Unit.") - success = true - end - end - end - else - success = true - end - end - if success == true then - break + else + success = true end - end --tracy.ZoneEnd() + end + if success == true then + break + end + end --tracy.ZoneEnd() return success end @@ -478,18 +478,17 @@ function gadget:GameOver() end if gadgetHandler:IsSyncedCode() then - function gadget:GameFrame(n) if n % 15 == 0 then local allunits -- will lazy load later if needed for i = 1, SimpleAITeamIDsCount do - if n%(15*SimpleAITeamIDsCount) == 15*(i-1) then + if n % (15 * SimpleAITeamIDsCount) == 15 * (i - 1) then --tracy.ZoneBeginN("SimpleAI:GameFrame") local teamID = SimpleAITeamIDs[i] local _, _, _, _, _, allyTeamID = spGetTeamInfo(teamID) local mcurrent, mstorage = spGetTeamResources(teamID, "metal") local ecurrent, estorage = spGetTeamResources(teamID, "energy") - + -- resource boost (teamID is always in SimpleAITeamIDs) if mcurrent < mstorage * 0.20 then spSetTeamResource(teamID, "m", mstorage * 0.25) @@ -510,41 +509,40 @@ if gadgetHandler:IsSyncedCode() then local unitHealth, unitMaxHealth = spGetUnitHealth(unitID) local unitCommandCount = spGetUnitCommandCount(unitID) local unitposx, unitposy, unitposz = spGetUnitPosition(unitID) - + if unitposx then --Spring.Echo(UnitDefs[unitDefID].name, "has commands:",unitCommandCount, SimpleConstructorDefs[unitDefID] , SimpleCommanderDefs[unitDefID], SimpleFactoriesDefs[unitDefID] ,SimpleUndefinedUnitDefs[unitDefID] ) -- Commanders if SimpleCommanderDefs[unitDefID] then local nearestEnemyCloak = spGetUnitNearestEnemy(unitID, 2000, false) if nearestEnemyCloak and ecurrent > 1000 then - spGiveOrderToUnit(unitID, 37382, {1}, 0) + spGiveOrderToUnit(unitID, 37382, { 1 }, 0) else - spGiveOrderToUnit(unitID, 37382, {0}, 0) + spGiveOrderToUnit(unitID, 37382, { 0 }, 0) end - local nearestEnemy = spGetUnitNearestEnemy(unitID, 250, true) - local unitHealthPercentage = unitHealth and unitMaxHealth and (unitHealth/unitMaxHealth)*100 or 0 + local unitHealthPercentage = unitHealth and unitMaxHealth and (unitHealth / unitMaxHealth) * 100 or 0 if nearestEnemy and unitHealthPercentage > 30 then - if ecurrent < estorage*0.9 then - spSetTeamResource(teamID, "e", estorage*0.9) + if ecurrent < estorage * 0.9 then + spSetTeamResource(teamID, "e", estorage * 0.9) end - spGiveOrderToUnit(unitID, spDgunCommand, {nearestEnemy}, 0) + spGiveOrderToUnit(unitID, spDgunCommand, { nearestEnemy }, 0) local nearestEnemies = spGetUnitsInCylinder(unitposx, unitposz, 300) if nearestEnemies then local nearestEnemyTeam = spGetUnitTeam(nearestEnemy) - for x = 1,#nearestEnemies do + for x = 1, #nearestEnemies do local enemy = nearestEnemies[x] if spGetUnitTeam(enemy) == nearestEnemyTeam and enemy ~= nearestEnemy then - spGiveOrderToUnit(unitID, spDgunCommand, {enemy}, {"shift"}) + spGiveOrderToUnit(unitID, spDgunCommand, { enemy }, { "shift" }) end end end - spGiveOrderToUnit(unitID, CMD_MOVE, {unitposx, unitposy, unitposz}, {"shift"}) + spGiveOrderToUnit(unitID, CMD_MOVE, { unitposx, unitposy, unitposz }, { "shift" }) elseif nearestEnemy then - for x = 1,10 do - local targetUnit = units[random(1,#units)] + for x = 1, 10 do + local targetUnit = units[random(1, #units)] if targetUnit then local targetDefID = spGetUnitDefID(targetUnit) if targetDefID and isBuilding[targetDefID] then @@ -561,13 +559,13 @@ if gadgetHandler:IsSyncedCode() then -- Constructors if SimpleConstructorDefs[unitDefID] then - local unitHealthPercentage = unitHealth and unitMaxHealth and (unitHealth/unitMaxHealth)*100 or 0 + local unitHealthPercentage = unitHealth and unitMaxHealth and (unitHealth / unitMaxHealth) * 100 or 0 local nearestEnemy = spGetUnitNearestEnemy(unitID, 500, true) if nearestEnemy and unitHealthPercentage > 90 then - spGiveOrderToUnit(unitID, CMD_RECLAIM, {nearestEnemy}, 0) + spGiveOrderToUnit(unitID, CMD_RECLAIM, { nearestEnemy }, 0) elseif nearestEnemy then - for x = 1,100 do - local targetUnit = units[random(1,#units)] + for x = 1, 100 do + local targetUnit = units[random(1, #units)] if targetUnit then local targetDefID = spGetUnitDefID(targetUnit) if targetDefID and isBuilding[targetDefID] then @@ -587,7 +585,6 @@ if gadgetHandler:IsSyncedCode() then SimpleConstructionProjectSelection(unitID, unitDefID, unitTeam, units, "Builder") end - if SimpleCommanderDefs[unitDefID] then SimpleConstructionProjectSelection(unitID, unitDefID, unitTeam, units, "Commander") end @@ -598,11 +595,11 @@ if gadgetHandler:IsSyncedCode() then -- army if SimpleUndefinedUnitDefs[unitDefID] then - if luaAI and string_sub(luaAI, 1, 16) == 'SimpleDefenderAI' then + if luaAI and string_sub(luaAI, 1, 16) == "SimpleDefenderAI" then allunits = allunits or spGetAllUnits() if allunits then - for t = 1,10 do - local targetUnit = allunits[random(1,#allunits)] + for t = 1, 10 do + local targetUnit = allunits[random(1, #allunits)] if targetUnit and spGetUnitAllyTeam(targetUnit) == allyTeamID then local tUnitX, tUnitY, tUnitZ = spGetUnitPosition(targetUnit) if tUnitX then @@ -619,7 +616,7 @@ if gadgetHandler:IsSyncedCode() then if tUnitX then spGiveOrderToUnit(unitID, CMD_FIGHT, { tUnitX + random(-100, 100), tUnitY, tUnitZ + random(-100, 100) }, { "shift", "alt", "ctrl" }) end - elseif n%3600 <= 15*SimpleAITeamIDsCount then + elseif n % 3600 <= 15 * SimpleAITeamIDsCount then local targetUnit = spGetUnitNearestEnemy(unitID, 999999, false) if targetUnit then local tUnitX, tUnitY, tUnitZ = spGetUnitPosition(targetUnit) @@ -646,8 +643,8 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) for i = 1, SimpleAITeamIDsCount do if SimpleAITeamIDs[i] == unitTeam then - spGiveOrderToUnit(unitID,CMD_FIRE_STATE,{2},0) - spGiveOrderToUnit(unitID,CMD_MOVE_STATE,{2},0) + spGiveOrderToUnit(unitID, CMD_FIRE_STATE, { 2 }, 0) + spGiveOrderToUnit(unitID, CMD_MOVE_STATE, { 2 }, 0) if SimpleFactoriesDefs[unitDefID] then SimpleFactoriesCount[unitTeam] = SimpleFactoriesCount[unitTeam] + 1 @@ -658,7 +655,6 @@ if gadgetHandler:IsSyncedCode() then SimpleT1Mexes[unitTeam] = SimpleT1Mexes[unitTeam] + 1 break end - end end end @@ -682,8 +678,8 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitFinished(unitID, unitDefID, unitTeam) for i = 1, SimpleAITeamIDsCount do if SimpleAITeamIDs[i] == unitTeam then - spGiveOrderToUnit(unitID,CMD_FIRE_STATE,{2},0) - spGiveOrderToUnit(unitID,CMD_MOVE_STATE,{2},0) + spGiveOrderToUnit(unitID, CMD_FIRE_STATE, { 2 }, 0) + spGiveOrderToUnit(unitID, CMD_MOVE_STATE, { 2 }, 0) end end end diff --git a/luarules/gadgets/api_build_blocking.lua b/luarules/gadgets/api_build_blocking.lua index 7d13eae76a0..1fa9ff23cab 100644 --- a/luarules/gadgets/api_build_blocking.lua +++ b/luarules/gadgets/api_build_blocking.lua @@ -12,14 +12,14 @@ function gadget:GetInfo() } end - -- these will not be removed with "all" reason key from console commands. - -- they must be removed explicitly with the reason key. +-- these will not be removed with "all" reason key from console commands. +-- they must be removed explicitly with the reason key. local allExemptReasonKeys = { -terrain_wind = true, -terrain_water = true, -terrain_geothermal = true, -max_this_unit = true, -modoption_blocked = true, + terrain_wind = true, + terrain_water = true, + terrain_geothermal = true, + max_this_unit = true, + modoption_blocked = true, } if gadgetHandler:IsSyncedCode() then @@ -27,7 +27,9 @@ if gadgetHandler:IsSyncedCode() then local reasonsStr = "" local count = 0 for r, _ in pairs(reasons) do - if count > 0 then reasonsStr = reasonsStr .. "," end + if count > 0 then + reasonsStr = reasonsStr .. "," + end reasonsStr = reasonsStr .. r count = count + 1 end @@ -35,7 +37,6 @@ if gadgetHandler:IsSyncedCode() then SendToUnsynced("BuildBlocked_" .. teamID, unitDefID, reasonsStr) end - local windDisabled = false local waterAvailable = true local geoInitialized, landGeoAvailable, seaGeoAvailable @@ -100,7 +101,7 @@ if gadgetHandler:IsSyncedCode() then Spring.SendMessageToPlayer(playerID, "Invalid teamID: " .. tostring(teamParam) .. ". Use 'all' or a valid team number.") return nil end - return {targetTeamID} + return { targetTeamID } end end @@ -269,15 +270,15 @@ if gadgetHandler:IsSyncedCode() then end end - gadgetHandler:AddChatAction('buildblock', commandBuildBlock, "Block units from being built by reason") - gadgetHandler:AddChatAction('buildunblock', commandBuildUnblock, "Unblock units from being built by reason") + gadgetHandler:AddChatAction("buildblock", commandBuildBlock, "Block units from being built by reason") + gadgetHandler:AddChatAction("buildunblock", commandBuildUnblock, "Unblock units from being built by reason") gadgetHandler:RegisterAllowCommand(CMD.BUILD) end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('buildblock') - gadgetHandler:RemoveChatAction('buildunblock') + gadgetHandler:RemoveChatAction("buildblock") + gadgetHandler:RemoveChatAction("buildunblock") end function GG.BuildBlocking.AddBlockedUnit(unitDefID, teamID, reasonKey) @@ -348,7 +349,6 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- Unsynced Code -------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------- elseif not gadgetHandler:IsSyncedCode() then --elseif for readability - local myPlayerID = Spring.GetMyPlayerID() local myTeamID = Spring.GetMyTeamID() @@ -363,7 +363,9 @@ elseif not gadgetHandler:IsSyncedCode() then --elseif for readability end local function UpdateSyncActions() - if myTeamID then gadgetHandler:RemoveSyncAction("BuildBlocked_" .. myTeamID) end + if myTeamID then + gadgetHandler:RemoveSyncAction("BuildBlocked_" .. myTeamID) + end myPlayerID = Spring.GetMyPlayerID() myTeamID = Spring.GetMyTeamID() @@ -384,6 +386,8 @@ elseif not gadgetHandler:IsSyncedCode() then --elseif for readability end function gadget:Shutdown() - if myTeamID then gadgetHandler:RemoveSyncAction("BuildBlocked_" .. myTeamID) end + if myTeamID then + gadgetHandler:RemoveSyncAction("BuildBlocked_" .. myTeamID) + end end end diff --git a/luarules/gadgets/api_damage_stats.lua b/luarules/gadgets/api_damage_stats.lua index 834a032afe2..c4fc5c213d3 100644 --- a/luarules/gadgets/api_damage_stats.lua +++ b/luarules/gadgets/api_damage_stats.lua @@ -1,117 +1,141 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Stats", - desc = "Collect stats, send to LuaUI on GameOver", - author = "Bluestone", - date = "", - license = "GNU GPL, v2 or later", - layer = -999990, - enabled = true, - } + return { + name = "Stats", + desc = "Collect stats, send to LuaUI on GameOver", + author = "Bluestone", + date = "", + license = "GNU GPL, v2 or later", + layer = -999990, + enabled = true, + } end if gadgetHandler:IsSyncedCode() then - return + return end local unitMetalCost = {} local unitEnergyCost = {} for unitDefID, defs in pairs(UnitDefs) do - unitMetalCost[unitDefID] = defs.metalCost - unitEnergyCost[unitDefID] = defs.energyCost + unitMetalCost[unitDefID] = defs.metalCost + unitEnergyCost[unitDefID] = defs.energyCost end local info = {} local gameType function gadget:Initialize() - local tList = Spring.GetTeamList() - - if Spring.Utilities.Gametype.IsFFA() then - gameType = "free for all" - return - end - - local nHumanTeams = 0 - local nAITeams = 0 - local nRaptorTeams = 0 - for _,teamID in pairs(tList) do - local luaAI = Spring.GetTeamLuaAI(teamID) or '' - local aiRaptor = (luaAI:find("Raptor") ~= nil) - local aiTeam = select(4,Spring.GetTeamInfo(teamID,false)) - local gaiaTeam = (teamID == Spring.GetGaiaTeamID()) - if aiRaptor then - nRaptorTeams = nRaptorTeams + 1 - end - if aiTeam then - nAITeams = nAITeams + 1 - end - if not aiTeam and not aiRaptor and not gaiaTeam then - nHumanTeams = nHumanTeams + 1 - end - end - - if nRaptorTeams >=1 then - gameType = "raptor defence" - return - end - - if nHumanTeams <= 1 then gameType = "single player" -- and gaia - elseif nHumanTeams == 2 and nAITeams == 0 then gameType = "1v1" - else gameType = "team" - end + local tList = Spring.GetTeamList() + + if Spring.Utilities.Gametype.IsFFA() then + gameType = "free for all" + return + end + + local nHumanTeams = 0 + local nAITeams = 0 + local nRaptorTeams = 0 + for _, teamID in pairs(tList) do + local luaAI = Spring.GetTeamLuaAI(teamID) or "" + local aiRaptor = (luaAI:find("Raptor") ~= nil) + local aiTeam = select(4, Spring.GetTeamInfo(teamID, false)) + local gaiaTeam = (teamID == Spring.GetGaiaTeamID()) + if aiRaptor then + nRaptorTeams = nRaptorTeams + 1 + end + if aiTeam then + nAITeams = nAITeams + 1 + end + if not aiTeam and not aiRaptor and not gaiaTeam then + nHumanTeams = nHumanTeams + 1 + end + end + + if nRaptorTeams >= 1 then + gameType = "raptor defence" + return + end + + if nHumanTeams <= 1 then + gameType = "single player" -- and gaia + elseif nHumanTeams == 2 and nAITeams == 0 then + gameType = "1v1" + else + gameType = "team" + end end function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) - local pList = Spring.GetPlayerList(teamID) - local playerID = pList[1] - local customtable = false - if playerID then - customtable = select(11,Spring.GetPlayerInfo(playerID)) or {} - end - local tsMu = customtable and customtable.skill or "" - local mu = tsMu and tonumber(tsMu:match("%d+%.?%d*")) or 25 - - info[unitDefID] = info[unitDefID] or {dmg_dealt=0,dmg_rec=0,kills=0,killed_cost=0,n=0,ts=0,minutes=0} - - info[unitDefID].n = info[unitDefID].n + 1 - info[unitDefID].ts = info[unitDefID].ts + mu - info[unitDefID].minutes = info[unitDefID].minutes + Spring.GetGameFrame()/(30*60) + local pList = Spring.GetPlayerList(teamID) + local playerID = pList[1] + local customtable = false + if playerID then + customtable = select(11, Spring.GetPlayerInfo(playerID)) or {} + end + local tsMu = customtable and customtable.skill or "" + local mu = tsMu and tonumber(tsMu:match("%d+%.?%d*")) or 25 + + info[unitDefID] = info[unitDefID] or { dmg_dealt = 0, dmg_rec = 0, kills = 0, killed_cost = 0, n = 0, ts = 0, minutes = 0 } + + info[unitDefID].n = info[unitDefID].n + 1 + info[unitDefID].ts = info[unitDefID].ts + mu + info[unitDefID].minutes = info[unitDefID].minutes + Spring.GetGameFrame() / (30 * 60) end function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) - if not attackerDefID then return end - if not unitDefID then return end - if not info[attackerDefID] then return end - if not info[unitDefID] then return end - if Spring.AreTeamsAllied(unitTeam,attackerTeam) then return end - local h,_,_ = Spring.GetUnitHealth(unitID) - if h > damage then damage = h end - - info[attackerDefID].dmg_dealt = info[attackerDefID].dmg_dealt + damage - info[unitDefID].dmg_rec = info[unitDefID].dmg_rec + damage + if not attackerDefID then + return + end + if not unitDefID then + return + end + if not info[attackerDefID] then + return + end + if not info[unitDefID] then + return + end + if Spring.AreTeamsAllied(unitTeam, attackerTeam) then + return + end + local h, _, _ = Spring.GetUnitHealth(unitID) + if h > damage then + damage = h + end + + info[attackerDefID].dmg_dealt = info[attackerDefID].dmg_dealt + damage + info[unitDefID].dmg_rec = info[unitDefID].dmg_rec + damage end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if not attackerDefID then return end - if not unitDefID then return end - if not info[attackerDefID] then return end - if not info[unitDefID] then return end - if unitTeam==attackerTeam then return end - - info[attackerDefID].kills = info[attackerDefID].kills + 1 - info[attackerDefID].killed_cost = info[attackerDefID].killed_cost + unitMetalCost[unitDefID] + unitEnergyCost[unitDefID]/60 + if not attackerDefID then + return + end + if not unitDefID then + return + end + if not info[attackerDefID] then + return + end + if not info[unitDefID] then + return + end + if unitTeam == attackerTeam then + return + end + + info[attackerDefID].kills = info[attackerDefID].kills + 1 + info[attackerDefID].killed_cost = info[attackerDefID].killed_cost + unitMetalCost[unitDefID] + unitEnergyCost[unitDefID] / 60 end function gadget:GameOver() - -- send totals to luaui - if Script.LuaUI("SendStats") and Script.LuaUI("SendStats_GameMode") then - Script.LuaUI.SendStats_GameMode(gameType) - for uDID,t in pairs(info) do - Script.LuaUI.SendStats(uDID, t.n, t.ts, t.dmg_dealt, t.dmg_rec, t.minutes, t.kills, t.killed_cost) - end - end + -- send totals to luaui + if Script.LuaUI("SendStats") and Script.LuaUI("SendStats_GameMode") then + Script.LuaUI.SendStats_GameMode(gameType) + for uDID, t in pairs(info) do + Script.LuaUI.SendStats(uDID, t.n, t.ts, t.dmg_dealt, t.dmg_rec, t.minutes, t.kills, t.killed_cost) + end + end end diff --git a/luarules/gadgets/api_enemyunitdestroyed.lua b/luarules/gadgets/api_enemyunitdestroyed.lua index 83bfe48d99c..ebbe78d892e 100644 --- a/luarules/gadgets/api_enemyunitdestroyed.lua +++ b/luarules/gadgets/api_enemyunitdestroyed.lua @@ -1,20 +1,19 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "EnemyUnitDestroyed", - desc = 'Calls Script.LuaUI.EnemyUnitDestroyed for enemy units dying in allied LOS', - author = 'Beherith', - date = '20211029', - license = 'GNU GPL, v2 or later', - layer = -999999, - enabled = false -- api_widget_events.lua exists + name = "EnemyUnitDestroyed", + desc = "Calls Script.LuaUI.EnemyUnitDestroyed for enemy units dying in allied LOS", + author = "Beherith", + date = "20211029", + license = "GNU GPL, v2 or later", + layer = -999999, + enabled = false, -- api_widget_events.lua exists } end if not gadgetHandler:IsSyncedCode() then - local spGetUnitAllyTeam = Spring.GetUnitAllyTeam + local spGetUnitAllyTeam = Spring.GetUnitAllyTeam local myAllyTeamID = Spring.GetMyAllyTeamID() local spec, fullView = Spring.GetSpectatingState() diff --git a/luarules/gadgets/api_garbage_collector.lua b/luarules/gadgets/api_garbage_collector.lua index c5fc2fad560..e985e5dff1e 100644 --- a/luarules/gadgets/api_garbage_collector.lua +++ b/luarules/gadgets/api_garbage_collector.lua @@ -16,25 +16,20 @@ if not gadgetHandler:IsSyncedCode() then local basememlimit = 700000 local garbagelimit = basememlimit -- in kilobytes, will adjust upwards as needed local checkFrequency = 29 - + local function CheckRamLimitGC() local ramuse = gcinfo() --Spring.Echo("RAMUSE",i,n, RAMUSE) - if ramuse > garbagelimit then + if ramuse > garbagelimit then collectgarbage("collect") collectgarbage("collect") local notgarbagemem = gcinfo() local newgarbagelimit = math.min(1200000, basememlimit + notgarbagemem) -- peak 1 GB - Spring.Echo(string.format("BAR using %d MB RAM > %d MB limit, performing garbage collection down to %d MB and adjusting limit to %d MB", - math.floor(ramuse/1000), - math.floor(garbagelimit/1000), - math.floor(notgarbagemem/1000), - math.floor(newgarbagelimit/1000) - )) + Spring.Echo(string.format("BAR using %d MB RAM > %d MB limit, performing garbage collection down to %d MB and adjusting limit to %d MB", math.floor(ramuse / 1000), math.floor(garbagelimit / 1000), math.floor(notgarbagemem / 1000), math.floor(newgarbagelimit / 1000))) garbagelimit = newgarbagelimit end end - + function gadget:GameStart() CheckRamLimitGC() end @@ -42,9 +37,9 @@ if not gadgetHandler:IsSyncedCode() then function gadget:Initialize() CheckRamLimitGC() end - + function gadget:GameFrame(n) - if n % checkFrequency == 0 then + if n % checkFrequency == 0 then CheckRamLimitGC() end end diff --git a/luarules/gadgets/api_missions.lua b/luarules/gadgets/api_missions.lua index 0005f0f6479..96cbfdc515d 100644 --- a/luarules/gadgets/api_missions.lua +++ b/luarules/gadgets/api_missions.lua @@ -26,37 +26,37 @@ local function loadMission() triggersController.PreprocessRawTriggers(rawTriggers) actionsController.PreprocessRawActions(rawActions) - GG['MissionAPI'].Triggers = triggersController.GetTriggers() - GG['MissionAPI'].Actions = actionsController.GetActions() + GG["MissionAPI"].Triggers = triggersController.GetTriggers() + GG["MissionAPI"].Actions = actionsController.GetActions() triggersController.PostprocessTriggers() end function gadget:Initialize() -- TODO: Actually pass script path in modoptions - scriptPath = 'test_mission.lua'-- Spring.GetModOptions().mission_path + scriptPath = "test_mission.lua" -- Spring.GetModOptions().mission_path if not scriptPath then gadgetHandler:RemoveGadget() return end - GG['MissionAPI'] = {} - GG['MissionAPI'].Difficulty = Spring.GetModOptions().mission_difficulty --TODO: add mission difficulty modoption + GG["MissionAPI"] = {} + GG["MissionAPI"].Difficulty = Spring.GetModOptions().mission_difficulty --TODO: add mission difficulty modoption - local triggersSchema = VFS.Include('luarules/mission_api/triggers_schema.lua') - local actionsSchema = VFS.Include('luarules/mission_api/actions_schema.lua') - GG['MissionAPI'].TriggerTypes = triggersSchema.Types - GG['MissionAPI'].ActionTypes = actionsSchema.Types + local triggersSchema = VFS.Include("luarules/mission_api/triggers_schema.lua") + local actionsSchema = VFS.Include("luarules/mission_api/actions_schema.lua") + GG["MissionAPI"].TriggerTypes = triggersSchema.Types + GG["MissionAPI"].ActionTypes = actionsSchema.Types - GG['MissionAPI'].TrackedUnits = {} + GG["MissionAPI"].TrackedUnits = {} - triggersController = VFS.Include('luarules/mission_api/triggers_loader.lua') - actionsController = VFS.Include('luarules/mission_api/actions_loader.lua') + triggersController = VFS.Include("luarules/mission_api/triggers_loader.lua") + actionsController = VFS.Include("luarules/mission_api/actions_loader.lua") - loadMission(); + loadMission() end function gadget:Shutdown() - GG['MissionAPI'] = nil -end \ No newline at end of file + GG["MissionAPI"] = nil +end diff --git a/luarules/gadgets/api_missions_triggers.lua b/luarules/gadgets/api_missions_triggers.lua index bf785289374..4bf8e0a1417 100644 --- a/luarules/gadgets/api_missions_triggers.lua +++ b/luarules/gadgets/api_missions_triggers.lua @@ -60,15 +60,25 @@ end ]] local function triggerValid(trigger) - if not trigger.settings.active then return false end + if not trigger.settings.active then + return false + end for _, prerequisiteTrigger in pairs(trigger.settings.prerequisites) do - if not prerequisiteTrigger.triggered then return false end + if not prerequisiteTrigger.triggered then + return false + end end - if trigger.triggered and not trigger.settings.repeating then return false end - if trigger.settings.repeating and trigger.settings.maxRepeats ~= nil and trigger.repeatCount > trigger.settings.maxRepeats then return false end - if trigger.settings.difficulties ~= nil and not trigger.settings.difficulties[GG['MissionAPI'].Difficulty] then return false end + if trigger.triggered and not trigger.settings.repeating then + return false + end + if trigger.settings.repeating and trigger.settings.maxRepeats ~= nil and trigger.repeatCount > trigger.settings.maxRepeats then + return false + end + if trigger.settings.difficulties ~= nil and not trigger.settings.difficulties[GG["MissionAPI"].Difficulty] then + return false + end --[[ --TODO: co-op check @@ -92,15 +102,15 @@ local function activateTrigger(trigger) end function gadget:Initialize() - if not GG['MissionAPI'] then + if not GG["MissionAPI"] then gadgetHandler:RemoveGadget() return end - actionsDispatcher = VFS.Include('luarules/mission_api/actions_dispatcher.lua') - types = GG['MissionAPI'].TriggerTypes - triggers = GG['MissionAPI'].Triggers - trackedUnits = GG['MissionAPI'].TrackedUnits + actionsDispatcher = VFS.Include("luarules/mission_api/actions_dispatcher.lua") + types = GG["MissionAPI"].TriggerTypes + triggers = GG["MissionAPI"].Triggers + trackedUnits = GG["MissionAPI"].TrackedUnits end function gadget:GameFrame(n) @@ -129,4 +139,4 @@ function gadget:MetaUnitAdded(unitId, unitDefId, unitTeam) end end end -end \ No newline at end of file +end diff --git a/luarules/gadgets/api_pbr_enabler.lua b/luarules/gadgets/api_pbr_enabler.lua index 225faf5b330..224422e6d03 100644 --- a/luarules/gadgets/api_pbr_enabler.lua +++ b/luarules/gadgets/api_pbr_enabler.lua @@ -2,17 +2,17 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "PBR enabler", - desc = "Generates BRDF Lookup table for PBR shaders and sets necessary spring configuration parameters", - author = "ivand", - date = "2019", - license = "PD", - layer = -1, - enabled = true, + name = "PBR enabler", + desc = "Generates BRDF Lookup table for PBR shaders and sets necessary spring configuration parameters", + author = "ivand", + date = "2019", + license = "PD", + layer = -1, + enabled = true, } end -if (not gadgetHandler:IsSyncedCode()) then --unsynced gadget +if not gadgetHandler:IsSyncedCode() then --unsynced gadget GG.GetBrdfTexture = nil GG.GetEnvTexture = nil @@ -55,7 +55,7 @@ if (not gadgetHandler:IsSyncedCode()) then --unsynced gadget end local envLutDebug = false - + function gadget:DrawWorldPreUnit() --after IBL textures are rendered into, but before units are drawn if envLut then envLut:Execute(envLutDebug) @@ -103,4 +103,3 @@ if (not gadgetHandler:IsSyncedCode()) then --unsynced gadget end end end - diff --git a/luarules/gadgets/api_permissions.lua b/luarules/gadgets/api_permissions.lua index 89ac352ee29..5ede68cbe18 100644 --- a/luarules/gadgets/api_permissions.lua +++ b/luarules/gadgets/api_permissions.lua @@ -1,19 +1,17 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Permissions", - desc = 'provides a list of user permissions to other gadgets', - author = 'Floris', - date = 'February 2021', - license = 'GNU GPL, v2 or later', - layer = -999000, - enabled = true + name = "Permissions", + desc = "provides a list of user permissions to other gadgets", + author = "Floris", + date = "February 2021", + license = "GNU GPL, v2 or later", + layer = -999000, + enabled = true, } end - local powerusers = include("LuaRules/configs/powerusers.lua") local singleplayerPermissions = powerusers[-1] local isSinglePlayer = false @@ -89,7 +87,9 @@ end local function ResolveTrustedName(playerID) local name = Spring.GetPlayerInfo(playerID) - if not name or not trustedNames[name] then return false end + if not name or not trustedNames[name] then + return false + end local accountID = originalGetAccountID(playerID) if accountID == -1 then -- Late joiner: assign/reuse a synthetic accountID for synced gadget compatibility @@ -122,9 +122,13 @@ end local resolvedAccountIDs = {} function gadget:PlayerChanged(playerID) - if not trustedNames then return end + if not trustedNames then + return + end local name = Spring.GetPlayerInfo(playerID) - if not name or not trustedNames[name] then return end + if not name or not trustedNames[name] then + return + end local currentAccountID = originalGetAccountID(playerID) local prevAccountID = resolvedAccountIDs[playerID] -- Re-resolve if never seen, or if a real accountID became available (was <0, now >=0) @@ -137,8 +141,12 @@ end function gadget:GameFrame(frame) -- Poll periodically in case PlayerChanged did not fire for a late joiner. - if not trustedNames then return end - if frame % 150 ~= 0 then return end + if not trustedNames then + return + end + if frame % 150 ~= 0 then + return + end for _, playerID in ipairs(Spring.GetPlayerList()) do local name = Spring.GetPlayerInfo(playerID) if name and trustedNames[name] then diff --git a/luarules/gadgets/api_widget_events.lua b/luarules/gadgets/api_widget_events.lua index 50665509a17..bb4971d3669 100644 --- a/luarules/gadgets/api_widget_events.lua +++ b/luarules/gadgets/api_widget_events.lua @@ -1,23 +1,25 @@ -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Widget Events", - desc = "Tells widgets about events they can know about", - author = "Sprung, Klon, Beherith", - date = "2015-05-27", - license = "PD", - layer = 0, - enabled = true, + name = "Widget Events", + desc = "Tells widgets about events they can know about", + author = "Sprung, Klon, Beherith", + date = "2015-05-27", + license = "PD", + layer = 0, + enabled = true, } end -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetUnitLosState = Spring.GetUnitLosState +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetUnitLosState = Spring.GetUnitLosState local myAllyTeamID, myTeamID, spec, specFullView @@ -33,39 +35,38 @@ function gadget:PlayerChanged() spec, specFullView = spGetSpectatingState() end - --[[ NB: these are proxies, not the actual lua functions currently linked LuaUI-side, so it is safe to cache them here even if the underlying func changes afterwards ]] -local scriptUnitDestroyed = Script.LuaUI.UnitDestroyed -local scriptUnitDestroyedByTeam = Script.LuaUI.UnitDestroyedByTeam +local scriptUnitDestroyed = Script.LuaUI.UnitDestroyed +local scriptUnitDestroyedByTeam = Script.LuaUI.UnitDestroyedByTeam -function gadget:UnitDestroyed (unitID, unitDefID, unitTeam, attUnitID, attUnitDefID, attTeamID) +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attUnitID, attUnitDefID, attTeamID) local isAllyUnit = spAreTeamsAllied(unitTeam, myTeamID) --Spring.Echo("Gadget:UnitDest", unitID, Script.LuaUI('UnitDestroyedByTeam') , "isAllyUnit", isAllyUnit, "spec", spec, "specFullView", specFullView) -- we need to check if any widget uses the callin, otherwise it is not bound and will produce error spam - if Script.LuaUI('UnitDestroyedByTeam') then + if Script.LuaUI("UnitDestroyedByTeam") then if spec then - scriptUnitDestroyedByTeam (unitID, unitDefID, unitTeam, attTeamID) + scriptUnitDestroyedByTeam(unitID, unitDefID, unitTeam, attTeamID) if not specFullView and not isAllyUnit and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 1) then - scriptUnitDestroyed (unitID, unitDefID, unitTeam) + scriptUnitDestroyed(unitID, unitDefID, unitTeam) end else local attackerInLos = attUnitID and (spGetUnitLosState(attUnitID, myAllyTeamID, true) % 2 == 1) if isAllyUnit then - scriptUnitDestroyedByTeam (unitID, unitDefID, unitTeam, attackerInLos and attTeamID or nil) + scriptUnitDestroyedByTeam(unitID, unitDefID, unitTeam, attackerInLos and attTeamID or nil) elseif spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 1 then - scriptUnitDestroyed (unitID, unitDefID, unitTeam) - scriptUnitDestroyedByTeam (unitID, unitDefID, unitTeam, attackerInLos and attTeamID or nil) + scriptUnitDestroyed(unitID, unitDefID, unitTeam) + scriptUnitDestroyedByTeam(unitID, unitDefID, unitTeam, attackerInLos and attTeamID or nil) end end else if not isAllyUnit and (not (spec and specFullView) and (spGetUnitLosState(unitID, spGetMyAllyTeamID(), true) % 2 == 1)) then - scriptUnitDestroyed (unitID, unitDefID, unitTeam) + scriptUnitDestroyed(unitID, unitDefID, unitTeam) end end end -local scriptUnitTaken = Script.LuaUI.UnitTaken +local scriptUnitTaken = Script.LuaUI.UnitTaken function gadget:UnitTaken(unitID, unitDefID, oldTeamID, newTeamID) -- we need to notify my team if a unit transfer between two other teams happens, within my radar or los local unitwasandisenemy = not (spAreTeamsAllied(oldTeamID, myTeamID) or spAreTeamsAllied(newTeamID, myTeamID)) @@ -76,7 +77,7 @@ function gadget:UnitTaken(unitID, unitDefID, oldTeamID, newTeamID) end end -local scriptUnitGiven = Script.LuaUI.UnitGiven +local scriptUnitGiven = Script.LuaUI.UnitGiven function gadget:UnitGiven(unitID, unitDefID, newTeamID, oldTeamID) -- we need to notify my team if a unit transfer between two other teams happens, within my radar or los local unitwasandisenemy = not (spAreTeamsAllied(oldTeamID, myTeamID) or spAreTeamsAllied(newTeamID, myTeamID)) @@ -87,9 +88,11 @@ function gadget:UnitGiven(unitID, unitDefID, newTeamID, oldTeamID) end end -local scriptUnitFinished = Script.LuaUI.UnitFinished +local scriptUnitFinished = Script.LuaUI.UnitFinished function gadget:UnitFinished(unitID, unitDefID, unitTeam) - if spec and specFullView then return end + if spec and specFullView then + return + end -- Important: Enemy units finished within LOS do not get the respective widget:UnitFinished calls! -- Also important: units that are created and finished in the same gameframe (like /give, or created fully built) are not in los yet, so this wont trigger! local unitisenemy = not spAreTeamsAllied(unitTeam, myTeamID) @@ -105,7 +108,7 @@ function gadget:FeatureCreated(featureID, allyTeam) -- assume that features are local isAllyUnit = (allyTeam == myAllyTeamID) --Spring.Echo("Gadget:FeatureCreated", featureID, FeatureDefs[Spring.GetFeatureDefID(featureID)].name, Script.LuaUI('FeatureCreated') , "isAllyUnit", isAllyUnit, "spec", spec, "specFullView", specFullView) -- we need to check if any widget uses the callin, otherwise it is not bound and will produce error spam - if not isAllyUnit and (not (spec and specFullView)) and Script.LuaUI('FeatureCreated') then + if not isAllyUnit and not (spec and specFullView) and Script.LuaUI("FeatureCreated") then --Spring.Echo("gadget:FeatureCreated",featureID, allyTeam) scriptFeatureCreated(featureID, allyTeam) end @@ -119,7 +122,7 @@ function gadget:FeatureDestroyed(featureID, allyTeam) local isAllyUnit = (allyTeam == myAllyTeamID) --Spring.Echo("Gadget:FeatureDestroyed", featureID, FeatureDefs[Spring.GetFeatureDefID(featureID)].name, Script.LuaUI('FeatureDestroyed') , "isAllyUnit", isAllyUnit, "spec", spec, "specFullView", specFullView, allyTeam, Spring.GetMyTeamID()) -- we need to check if any widget uses the callin, otherwise it is not bound and will produce error spam - if not isAllyUnit and (not (spec and specFullView)) and Script.LuaUI('FeatureDestroyed') then + if not isAllyUnit and not (spec and specFullView) and Script.LuaUI("FeatureDestroyed") then --Spring.Echo("gadget:FeatureDestroyed",featureID, allyTeam) scriptFeatureDestroyed(featureID, allyTeam) end diff --git a/luarules/gadgets/camera_lockcamera.lua b/luarules/gadgets/camera_lockcamera.lua index d3e19b135b6..e1d49592c84 100644 --- a/luarules/gadgets/camera_lockcamera.lua +++ b/luarules/gadgets/camera_lockcamera.lua @@ -8,17 +8,16 @@ function gadget:GetInfo() date = "16 January 2009", license = "GNU LGPL, v2.1 or later", layer = -5, - enabled = true + enabled = true, } end -local broadcastPeriod = 0.1 -- will send packet in this interval (s) for non-spectators -local spectatorBroadcastPeriod = 0.2 -- will send packet in this interval (s) for spectators +local broadcastPeriod = 0.1 -- will send packet in this interval (s) for non-spectators +local spectatorBroadcastPeriod = 0.2 -- will send packet in this interval (s) for spectators local PACKET_HEADER = "=" if gadgetHandler:IsSyncedCode() then - local strSub = string.sub local validation = string.randomString(2) @@ -32,17 +31,17 @@ if gadgetHandler:IsSyncedCode() then local ep1, ep2, ep3 = string.byte(expectedPrefix, 1, 3) function gadget:RecvLuaMsg(msg, playerID) - if #msg < expectedPrefixLen then return end + if #msg < expectedPrefixLen then + return + end local b1, b2, b3 = string.byte(msg, 1, 3) - if b1 ~= ep1 or b2 ~= ep2 or b3 ~= ep3 then return end - SendToUnsynced("cameraBroadcast",playerID,msg) + if b1 ~= ep1 or b2 ~= ep2 or b3 ~= ep3 then + return + end + SendToUnsynced("cameraBroadcast", playerID, msg) return true end - - -else -- UNSYNCED - - +else -- UNSYNCED local GetCameraState = Spring.GetCameraState local SetCameraState = Spring.SetCameraState local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds @@ -123,7 +122,9 @@ else -- UNSYNCED offset = offset or 1 local byte1, byte2 = strByte(s, offset, offset + 1) - if not (byte1 and byte2) then return nil end + if not (byte1 and byte2) then + return nil + end local sign = 1 local exponent = byte1 @@ -155,14 +156,18 @@ else -- UNSYNCED local stateFormat = CAMERA_STATE_FORMATS[name] local cameraID = CAMERA_IDS[name] - if not stateFormat or not cameraID then return nil end + if not stateFormat or not cameraID then + return nil + end local parts = { msgPrefix, CustomPackU8(cameraID), CustomPackU8(s.mode) } local n = 3 - for i=1, #stateFormat do + for i = 1, #stateFormat do local num = s[stateFormat[i]] - if not num then return end + if not num then + return + end n = n + 1 parts[n] = CustomPackF16(num) end @@ -186,10 +191,12 @@ else -- UNSYNCED offset = offset + 2 - for i=1, #stateFormat do + for i = 1, #stateFormat do local num = CustomUnpackF16(p, offset) - if not num then return nil end + if not num then + return nil + end result[stateFormat[i]] = num offset = offset + 2 @@ -198,24 +205,23 @@ else -- UNSYNCED return result end - Spring.Echo(": Sorry for the camera switch spam, but this is the only reliable way to list camera states other than hardcoding them") local prevCameraState = GetCameraState() for name, num in pairs(CAMERA_IDS) do CAMERA_NAMES[num] = name - SetCameraState({name=name,mode=num},0) + SetCameraState({ name = name, mode = num }, 0) local packetFormat = {} local packetFormatIndex = 1 for stateindex in pairs(GetCameraState()) do if stateindex ~= "mode" and stateindex ~= "name" then packetFormat[packetFormatIndex] = stateindex - packetFormatIndex = packetFormatIndex +1 + packetFormatIndex = packetFormatIndex + 1 end end table.sort(packetFormat) CAMERA_STATE_FORMATS[name] = packetFormat end - SetCameraState(prevCameraState,0) + SetCameraState(prevCameraState, 0) -- workaround a bug where minimap remains minimized because we switched to overview cam SendCommands("minimap minimize") @@ -236,7 +242,7 @@ else -- UNSYNCED myAllyTeamID = GetMyAllyTeamID() end - function handleCameraBroadcastEvent(_,playerID,msg) + function handleCameraBroadcastEvent(_, playerID, msg) local cameraState -- a packet consisting only of the header indicates that transmission has stopped if msg ~= PACKET_HEADER then @@ -247,13 +253,13 @@ else -- UNSYNCED end end if not spec or not fullView then - local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID,false) + local _, _, targetSpec, _, allyTeamID = GetPlayerInfo(playerID, false) if targetSpec or allyTeamID ~= myAllyTeamID then return end end if Script.LuaUI("CameraBroadcastEvent") then - Script.LuaUI.CameraBroadcastEvent(playerID,cameraState) + Script.LuaUI.CameraBroadcastEvent(playerID, cameraState) end end @@ -274,7 +280,9 @@ else -- UNSYNCED return true end local stateFormat = CAMERA_STATE_FORMATS[name] - if not stateFormat then return false end + if not stateFormat then + return false + end for i = 1, #stateFormat do local key = stateFormat[i] if state[key] ~= lastCameraValues[key] then @@ -312,4 +320,3 @@ else -- UNSYNCED SendLuaRulesMsg(msg) end end - diff --git a/luarules/gadgets/cmd_alliance_break.lua b/luarules/gadgets/cmd_alliance_break.lua index ebe3c71c1bc..76b3d9945fc 100644 --- a/luarules/gadgets/cmd_alliance_break.lua +++ b/luarules/gadgets/cmd_alliance_break.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "-", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -17,7 +17,6 @@ if Spring.GetModOptions().fixedallies then end if gadgetHandler:IsSyncedCode() then - local GetUnitDefID = Spring.GetUnitDefID local AreTeamsAllied = Spring.AreTeamsAllied local GetUnitsInSphere = Spring.GetUnitsInSphere @@ -141,7 +140,6 @@ if gadgetHandler:IsSyncedCode() then end end end - else ---------------------------------------------------------------- -- Unsynced @@ -158,22 +156,22 @@ else end local function allianceMade(_, teamA, teamB) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.dynamicAlly.create', { player = getTeamLeaderName(teamB) }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.dynamicAlly.create", { player = getTeamLeaderName(teamB) }) SendMessageToTeam(teamA, message) end end local function allianceBroken(_, teamA, teamB) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.dynamicAlly.destroy', { player = getTeamLeaderName(teamB) }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.dynamicAlly.destroy", { player = getTeamLeaderName(teamB) }) SendMessageToTeam(teamA, message) end end local function backstab(_, victimTeam, traitorTeam) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.dynamicAlly.backstab', { player = getTeamLeaderName(traitorTeam) }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.dynamicAlly.backstab", { player = getTeamLeaderName(traitorTeam) }) SendMessageToTeam(victimTeam, message) end end @@ -183,5 +181,4 @@ else gadgetHandler:AddSyncAction("AllianceBroken", allianceBroken) gadgetHandler:AddSyncAction("Backstab", backstab) end - end diff --git a/luarules/gadgets/cmd_area_mex.lua b/luarules/gadgets/cmd_area_mex.lua index 14258ce1e89..fa15c09c63d 100644 --- a/luarules/gadgets/cmd_area_mex.lua +++ b/luarules/gadgets/cmd_area_mex.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end diff --git a/luarules/gadgets/cmd_build_bugger_off.lua b/luarules/gadgets/cmd_build_bugger_off.lua index b49c5de4147..85453533197 100644 --- a/luarules/gadgets/cmd_build_bugger_off.lua +++ b/luarules/gadgets/cmd_build_bugger_off.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Builder buggeroff", - desc = "Enables busy builders and moving units to buggeroff", - author = "Flameink", - date = "March 14, 2025", + name = "Builder buggeroff", + desc = "Enables busy builders and moving units to buggeroff", + author = "Flameink", + date = "March 14, 2025", version = "1.0", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end @@ -55,39 +55,39 @@ for unitDefID, unitDef in pairs(UnitDefs) do cachedUnitDefs[unitDefID] = { isImmobile = unitDef.isImmobile, isBlocking = not unitDef.reclaimable and unitDef.customParams.decoration and unitDef.customParams.subfolder ~= "other/hats", - isBuilder = unitDef.isBuilder, - radius = unitDef.radius, - semiAxisX = unitDef.xsize * footprint * 0.5, - semiAxisZ = unitDef.zsize * footprint * 0.5, + isBuilder = unitDef.isBuilder, + radius = unitDef.radius, + semiAxisX = unitDef.xsize * footprint * 0.5, + semiAxisZ = unitDef.zsize * footprint * 0.5, } end local gameFrame = 0 local mostRecentCommandFrame = {} -local slowUpdateBuilders = {} -local watchedBuilders = {} -local builderRadiusOffsets = {} -local needsUpdate = false -local areaCommandCooldown = {} +local slowUpdateBuilders = {} +local watchedBuilders = {} +local builderRadiusOffsets = {} +local needsUpdate = false +local areaCommandCooldown = {} -local FAST_UPDATE_RADIUS = 400 +local FAST_UPDATE_RADIUS = 400 -- builders take about this much to enter build stance; determined empirically local BUILDER_DELAY_SECONDS = 3.3 -local BUILDER_BUILD_RADIUS = 200 * Spring.GetModOptions().multiplier_builddistance -- ! varies per-unit +local BUILDER_BUILD_RADIUS = 200 * Spring.GetModOptions().multiplier_builddistance -- ! varies per-unit -- Assume the units are super-fast and medium-sized. -local SEARCH_RADIUS_OFFSET = unitSpeedMax + 2 * footprint +local SEARCH_RADIUS_OFFSET = unitSpeedMax + 2 * footprint local FAST_UPDATE_FREQUENCY = gameSpeed * 0.5 local SLOW_UPDATE_FREQUENCY = FAST_UPDATE_FREQUENCY * 3 -- NB: must be a multiple local BUGGEROFF_RADIUS_INCREMENT = footprint -- Move away based on predicted position with lookahead: -local BUGGEROFF_LOOKAHEAD = (1/6) * gameSpeed +local BUGGEROFF_LOOKAHEAD = (1 / 6) * gameSpeed -- The max buggeroff radius = increment * (time * update rate - 1), so we set a max time here also, implicitly. -- Prevent units from roaming by maintaining a max radius <= 400, the engine's max leash radius (see e.g. CMobileCAI::ExecuteFight). -local MAX_BUGGEROFF_TIME = 13 -local MAX_BUGGEROFF_RADIUS = BUGGEROFF_RADIUS_INCREMENT * (MAX_BUGGEROFF_TIME * gameSpeed / FAST_UPDATE_FREQUENCY - 1) -- => 400 elmos +local MAX_BUGGEROFF_TIME = 13 +local MAX_BUGGEROFF_RADIUS = BUGGEROFF_RADIUS_INCREMENT * (MAX_BUGGEROFF_TIME * gameSpeed / FAST_UPDATE_FREQUENCY - 1) -- => 400 elmos -- Don't buggeroff units that were ordered to do something recently -local USER_COMMAND_TIMEOUT = 2 * gameSpeed +local USER_COMMAND_TIMEOUT = 2 * gameSpeed -- Cooldown for area commands to prevent mass slowWatchBuilder calls local AREA_COMMAND_COOLDOWN = 2 * gameSpeed @@ -108,7 +108,7 @@ local function willBeNearTarget(ux, uz, vx, vz, tx, tz, maxDistance) local ix = tx - ux local iz = tz - uz - if math_diag(ix , iz) > maxDistance then + if math_diag(ix, iz) > maxDistance then -- The unit starts within the area but does not end in it. return false else @@ -122,7 +122,9 @@ end local function isInTargetArea(unitID, x, z, radius) local ux, uy, uz = spGetUnitPosition(unitID) - if not ux then return false end + if not ux then + return false + end return math_diag(ux - x, uz - z) <= radius end @@ -132,30 +134,27 @@ local function IsUnitRepeatOn(unitID) end local function watchBuilder(builderID) - slowUpdateBuilders[builderID] = nil - watchedBuilders[builderID] = true + slowUpdateBuilders[builderID] = nil + watchedBuilders[builderID] = true builderRadiusOffsets[builderID] = 0 end local function removeBuilder(builderID) - slowUpdateBuilders[builderID] = nil - watchedBuilders[builderID] = nil + slowUpdateBuilders[builderID] = nil + watchedBuilders[builderID] = nil builderRadiusOffsets[builderID] = nil end local function slowWatchBuilder(builderID) - watchedBuilders[builderID] = nil - slowUpdateBuilders[builderID] = true + watchedBuilders[builderID] = nil + slowUpdateBuilders[builderID] = true builderRadiusOffsets[builderID] = nil -- Give builder initial slow update right away in case the builder is already close needsUpdate = true end local function ignoreBuggeroff(unitID, unitDefData) - return unitDefData.isImmobile - or spGetUnitIsDead(unitID) ~= false - or spGetUnitIsBeingBuilt(unitID) ~= false - or gameFrame - (mostRecentCommandFrame[unitID] or -USER_COMMAND_TIMEOUT) < USER_COMMAND_TIMEOUT + return unitDefData.isImmobile or spGetUnitIsDead(unitID) ~= false or spGetUnitIsBeingBuilt(unitID) ~= false or gameFrame - (mostRecentCommandFrame[unitID] or -USER_COMMAND_TIMEOUT) < USER_COMMAND_TIMEOUT end local function shouldBuggeroff(unitID, unitDefData, visitedUnits, builderTeam) @@ -168,7 +167,6 @@ local function shouldBuggeroff(unitID, unitDefData, visitedUnits, builderTeam) if ignoreBuggeroff(unitID, unitDefData) then visitedUnits[unitID] = true return false - elseif spAreTeamsAllied(spGetUnitTeam(unitID), builderTeam) then visitedUnits[unitID] = true return true @@ -183,7 +181,7 @@ function gadget:GameFrame(frame) local visitedTeams = {} local visitedUnits = {} - local cylinderCache = {} -- Cache GetUnitsInCylinder results per location + local cylinderCache = {} -- Cache GetUnitsInCylinder results per location local moveParams = insertMoveParams @@ -195,23 +193,21 @@ function gadget:GameFrame(frame) for builderID, _ in pairs(watchedBuilders) do local cmdID, _, _, targetX, targetY, targetZ = spGetUnitCurrentCommand(builderID, 1) - local isBuilding = spGetUnitIsBuilding(builderID) ~= nil - local x, y, z = spGetUnitPosition(builderID) - local builderTeam = spGetUnitTeam(builderID); + local isBuilding = spGetUnitIsBuilding(builderID) ~= nil + local x, y, z = spGetUnitPosition(builderID) + local builderTeam = spGetUnitTeam(builderID) local targetDistance = targetZ and x and math_diag(targetX - x, targetZ - z) local buildUnitDefData = cmdID and cachedUnitDefs[-cmdID] if not x then deferRemoveCount = deferRemoveCount + 1 deferRemove[deferRemoveCount] = builderID - elseif not buildUnitDefData or targetDistance > FAST_UPDATE_RADIUS then deferSlowCount = deferSlowCount + 1 deferSlow[deferSlowCount] = builderID - elseif not isBuilding and targetDistance < BUILDER_BUILD_RADIUS + buildUnitDefData.radius and spGetUnitIsBeingBuilt(builderID) == false then - local buildDefRadius = buildUnitDefData.radius - local searchRadius = SEARCH_RADIUS_OFFSET + buildDefRadius + local buildDefRadius = buildUnitDefData.radius + local searchRadius = SEARCH_RADIUS_OFFSET + buildDefRadius -- Use cached cylinder lookup to reduce redundant API calls -- Nested numeric tables avoid string format allocation/GC overhead @@ -233,7 +229,7 @@ function gadget:GameFrame(frame) local buggerOffRadiusOffset = builderRadiusOffsets[builderID] + BUGGEROFF_RADIUS_INCREMENT -- Make sure at least one builder per player is never told to move - if (visitedTeams[builderTeam] == nil) then + if visitedTeams[builderTeam] == nil then visitedTeams[builderTeam] = true visitedUnits[builderID] = true end @@ -273,7 +269,6 @@ function gadget:GameFrame(frame) else builderRadiusOffsets[builderID] = buggerOffRadiusOffset end - elseif isBuilding then -- We want to keep updating in case the builder has got another job nearby builderRadiusOffsets[builderID] = 0 @@ -306,7 +301,9 @@ function gadget:GameFrame(frame) for idx = 1, 5 do local cmdID, _, _, px, _, pz = spGetUnitCurrentCommand(builderID, idx) - if not cmdID then break end + if not cmdID then + break + end if cmdID < 0 then hasBuildCommand = true if idx == 1 and px and pz then @@ -347,7 +344,7 @@ end function gadget:UnitCommand(unitID, unitDefID, unitTeamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) if cachedUnitDefs[unitDefID].isBuilder then -- Throttle area command processing to avoid performance spikes with many builders - if cmdID < 0 then -- Build command + if cmdID < 0 then -- Build command local lastAreaCommand = areaCommandCooldown[unitID] if not lastAreaCommand or gameFrame - lastAreaCommand >= AREA_COMMAND_COOLDOWN then slowWatchBuilder(unitID) diff --git a/luarules/gadgets/cmd_commander_dance.lua b/luarules/gadgets/cmd_commander_dance.lua index 53e43598ad8..0c378d25ff0 100644 --- a/luarules/gadgets/cmd_commander_dance.lua +++ b/luarules/gadgets/cmd_commander_dance.lua @@ -1,19 +1,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Commander Dance Command", - desc = "Handles /dance requests and triggers commander dance animations", - author = "PtaQ", - date = "2026", - license = "GNU GPL v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Commander Dance Command", + desc = "Handles /dance requests and triggers commander dance animations", + author = "PtaQ", + date = "2026", + license = "GNU GPL v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local strSub = string.sub @@ -52,109 +52,109 @@ local CMD_RESURRECT = CMD.RESURRECT local lastDanceFrame = {} -- per-player cooldown local function IsCommander(unitDefID) - local unitDef = UnitDefs[unitDefID] - return unitDef and unitDef.customParams and unitDef.customParams.iscommander + local unitDef = UnitDefs[unitDefID] + return unitDef and unitDef.customParams and unitDef.customParams.iscommander end local function IsUnitBusy(unitID) - -- Check movement - local vx, _, vz = spGetUnitVelocity(unitID) - if vx and (mathAbs(vx) > 0.1 or mathAbs(vz) > 0.1) then - return true, "moving" - end - - -- Check building - if spGetUnitIsBuilding(unitID) then - return true, "building" - end - - -- Check current command for combat/assist - local cmdID = spGetUnitCurrentCommand(unitID) - if cmdID then - if cmdID == CMD_ATTACK or cmdID == CMD_FIGHT or cmdID == CMD_MANUALFIRE then - return true, "attacking" - end - if cmdID == CMD_GUARD or cmdID == CMD_REPAIR or cmdID == CMD_RECLAIM or cmdID == CMD_RESURRECT then - return true, "assisting" - end - if cmdID < 0 then - return true, "building" - end - end - - return false, nil + -- Check movement + local vx, _, vz = spGetUnitVelocity(unitID) + if vx and (mathAbs(vx) > 0.1 or mathAbs(vz) > 0.1) then + return true, "moving" + end + + -- Check building + if spGetUnitIsBuilding(unitID) then + return true, "building" + end + + -- Check current command for combat/assist + local cmdID = spGetUnitCurrentCommand(unitID) + if cmdID then + if cmdID == CMD_ATTACK or cmdID == CMD_FIGHT or cmdID == CMD_MANUALFIRE then + return true, "attacking" + end + if cmdID == CMD_GUARD or cmdID == CMD_REPAIR or cmdID == CMD_RECLAIM or cmdID == CMD_RESURRECT then + return true, "assisting" + end + if cmdID < 0 then + return true, "building" + end + end + + return false, nil end local function TriggerCommanderDance(unitID) - if spGetCOBScriptID(unitID, "TriggerDance") then - spCallCOBScript(unitID, "TriggerDance", 0) - return true - end - - local scriptEnv = usGetScriptEnv(unitID) - if scriptEnv and scriptEnv.TriggerDance and usCallAsUnit then - usCallAsUnit(unitID, scriptEnv.TriggerDance) - return true - end - - return false + if spGetCOBScriptID(unitID, "TriggerDance") then + spCallCOBScript(unitID, "TriggerDance", 0) + return true + end + + local scriptEnv = usGetScriptEnv(unitID) + if scriptEnv and scriptEnv.TriggerDance and usCallAsUnit then + usCallAsUnit(unitID, scriptEnv.TriggerDance) + return true + end + + return false end function gadget:RecvLuaMsg(msg, playerID) - if #msg < HEADER_LEN or string.byte(msg, 1) ~= RH_B1 or strSub(msg, 1, HEADER_LEN) ~= REQUEST_HEADER then - return - end - - local _, _, spec, teamID = spGetPlayerInfo(playerID, false) - if spec then - return true - end - - -- Cooldown check - local frame = spGetGameFrame() - if lastDanceFrame[playerID] and (frame - lastDanceFrame[playerID]) < COOLDOWN_FRAMES then - spSendMessageToPlayer(playerID, "[Dance] Cooldown - wait a moment") - return true - end - - local idStr = strSub(msg, HEADER_LEN + 1) - if idStr == "" then - return true - end - - local danced = 0 - local busyReason = nil - for token in idStr:gmatch("[^,]+") do - local unitID = tonumber(token) - if unitID and spValidUnitID(unitID) then - local unitTeam = spGetUnitTeam(unitID) - local unitDefID = spGetUnitDefID(unitID) - if (unitTeam == teamID or spIsCheatingEnabled()) and unitDefID and IsCommander(unitDefID) then - local busy, reason = IsUnitBusy(unitID) - if busy then - busyReason = reason - else - if TriggerCommanderDance(unitID) then - danced = danced + 1 - end - end - end - end - end - - if danced > 0 then - lastDanceFrame[playerID] = frame - elseif busyReason then - spSendMessageToPlayer(playerID, "[Dance] Commander is " .. busyReason) - end - - return true + if #msg < HEADER_LEN or string.byte(msg, 1) ~= RH_B1 or strSub(msg, 1, HEADER_LEN) ~= REQUEST_HEADER then + return + end + + local _, _, spec, teamID = spGetPlayerInfo(playerID, false) + if spec then + return true + end + + -- Cooldown check + local frame = spGetGameFrame() + if lastDanceFrame[playerID] and (frame - lastDanceFrame[playerID]) < COOLDOWN_FRAMES then + spSendMessageToPlayer(playerID, "[Dance] Cooldown - wait a moment") + return true + end + + local idStr = strSub(msg, HEADER_LEN + 1) + if idStr == "" then + return true + end + + local danced = 0 + local busyReason = nil + for token in idStr:gmatch("[^,]+") do + local unitID = tonumber(token) + if unitID and spValidUnitID(unitID) then + local unitTeam = spGetUnitTeam(unitID) + local unitDefID = spGetUnitDefID(unitID) + if (unitTeam == teamID or spIsCheatingEnabled()) and unitDefID and IsCommander(unitDefID) then + local busy, reason = IsUnitBusy(unitID) + if busy then + busyReason = reason + else + if TriggerCommanderDance(unitID) then + danced = danced + 1 + end + end + end + end + end + + if danced > 0 then + lastDanceFrame[playerID] = frame + elseif busyReason then + spSendMessageToPlayer(playerID, "[Dance] Commander is " .. busyReason) + end + + return true end function gadget:Initialize() - gadgetHandler:RemoveCallIn("RecvLuaMsg") + gadgetHandler:RemoveCallIn("RecvLuaMsg") end function gadget:GameStart() - gadgetHandler:UpdateCallIn("RecvLuaMsg") + gadgetHandler:UpdateCallIn("RecvLuaMsg") end diff --git a/luarules/gadgets/cmd_dev_helpers.lua b/luarules/gadgets/cmd_dev_helpers.lua index 8a516eda96e..2bc15cc1f82 100644 --- a/luarules/gadgets/cmd_dev_helpers.lua +++ b/luarules/gadgets/cmd_dev_helpers.lua @@ -3,7 +3,8 @@ local msg = 'luar_uels ihatelua -100 200' for word in msg:gmatch("[%-_%w]+") do print (word) end -]]-- +]] +-- local gadget = gadget ---@type Gadget @@ -15,7 +16,7 @@ function gadget:GetInfo() date = "", license = "GNU GPL, v2 or later, Horses", layer = -1999999999, - enabled = true + enabled = true, } end @@ -35,8 +36,7 @@ function isAuthorized(playerID, subPermission) local accountID = Spring.Utilities.GetAccountID(playerID) local hasPermission = false -- check catch-all devhelpers permission (by accountID and by name for late joiners) - if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or - (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then + if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then hasPermission = true end -- check the devhelpers_ sub-permission OR a matching top-level permission @@ -44,8 +44,7 @@ function isAuthorized(playerID, subPermission) -- (moderators/event managers) are authorized too if not hasPermission and subPermission then for _, permKey in ipairs({ "devhelpers_" .. subPermission, subPermission }) do - if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or - (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then + if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then hasPermission = true break end @@ -59,9 +58,7 @@ function isAuthorized(playerID, subPermission) return false end - if gadgetHandler:IsSyncedCode() then - function checkStartPlayers() for _, playerID in ipairs(Spring.GetPlayerList()) do -- update player infos @@ -101,7 +98,8 @@ if gadgetHandler:IsSyncedCode() then -- invertmap, flips the heightmap, where the height defined is the lowest point, invalid is autotuned to turn land new lowest point at height 0 invertmap = function(value) local minHeight - if value[1] and value[1] == "wet" then minHeight = 0 + if value[1] and value[1] == "wet" then + minHeight = 0 else minHeight = tonumber(value[1]) if not minHeight then @@ -109,31 +107,35 @@ if gadgetHandler:IsSyncedCode() then end end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, ( minHeight-Spring.GetGroundHeight( x, z ))) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, (minHeight - Spring.GetGroundHeight(x, z))) end end end) end, minheight = function(value) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, ( math.abs( Spring.GetGroundHeight( x, z ) - height ) + height ) ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, (math.abs(Spring.GetGroundHeight(x, z) - height) + height)) end end end) end, maxheight = function(value) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, -( math.abs( -Spring.GetGroundHeight( x, z ) + height ) - height ) ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, -(math.abs(-Spring.GetGroundHeight(x, z) + height) - height)) end end end) @@ -142,9 +144,9 @@ if gadgetHandler:IsSyncedCode() then extreme = function(value) local multiplier = math.clamp(tonumber(value[1]) or 2, -10, 10) Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, Spring.GetGroundHeight( x, z ) * multiplier) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, Spring.GetGroundHeight(x, z) * multiplier) end end end) @@ -152,13 +154,15 @@ if gadgetHandler:IsSyncedCode() then extremeabove = function(value) local multiplier = math.clamp(tonumber(value[2]) or 2, -10, 10) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - local tmp = Spring.GetGroundHeight( x, z ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + local tmp = Spring.GetGroundHeight(x, z) if tmp > height then - Spring.SetHeightMap( x, z, ( tmp - height ) * multiplier + height ) + Spring.SetHeightMap(x, z, (tmp - height) * multiplier + height) end end end @@ -167,13 +171,15 @@ if gadgetHandler:IsSyncedCode() then extremebelow = function(value) local multiplier = math.clamp(tonumber(value[2]) or 2, -10, 10) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - local tmp = Spring.GetGroundHeight( x, z ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + local tmp = Spring.GetGroundHeight(x, z) if tmp < height then - Spring.SetHeightMap( x, z, ( tmp - height ) * multiplier + height ) + Spring.SetHeightMap(x, z, (tmp - height) * multiplier + height) end end end @@ -182,22 +188,26 @@ if gadgetHandler:IsSyncedCode() then -- flatten anything above/bellow these extremes flatten = function(value) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, math.min( Spring.GetGroundHeight( x, z ), height ) ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, math.min(Spring.GetGroundHeight(x, z), height)) end end end) end, floor = function(value) local height = tonumber(value[1]) - if height == nil then return end + if height == nil then + return + end Spring.SetHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, z, math.max( Spring.GetGroundHeight( x, z ), height ) ) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, z, math.max(Spring.GetGroundHeight(x, z), height)) end end end) @@ -246,22 +256,22 @@ if gadgetHandler:IsSyncedCode() then -- e.g. maxheight mode, minheight mode 2, extremeabove mode 1 + 15 2, zero -20 local function terrainMods(debugString) - local commands = string.split(debugString,",") + local commands = string.split(debugString, ",") -- do we need a list of most common heights? and if so sample it once for all functions -- mode, math mode as in mean, median, and mode, where mode is the most commonly occuring value -- height gets rounded into stepsize of MODESTEPSIZE variable, counted, and sorted based on that count, using the flatest surface found within that step as the representitive height - local modeArray = {[1]=0} + local modeArray = { [1] = 0 } if string.find(debugString, "mode") then -- count the most common heights, in height groups step sized MODESTEPSIZE variable local normal, height, smallestStepHeight = 0, 0, 0 local tempModeArray = {} local MODESTEPSIZE = 16 - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - height = Spring.GetGroundHeight ( x, z ) or 0 - _, normal, _ = Spring.GetGroundNormal ( x, z ) - smallestStepHeight = math.floor((height)/MODESTEPSIZE) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + height = Spring.GetGroundHeight(x, z) or 0 + _, normal, _ = Spring.GetGroundNormal(x, z) + smallestStepHeight = math.floor(height / MODESTEPSIZE) if tempModeArray[smallestStepHeight] then tempModeArray[smallestStepHeight][1] = tempModeArray[smallestStepHeight][1] + 1 if tempModeArray[smallestStepHeight][2] < normal then @@ -269,9 +279,7 @@ if gadgetHandler:IsSyncedCode() then tempModeArray[smallestStepHeight][3] = height end else - tempModeArray[smallestStepHeight] = {1, - normal, height - } + tempModeArray[smallestStepHeight] = { 1, normal, height } end end end @@ -279,12 +287,12 @@ if gadgetHandler:IsSyncedCode() then -- drop the step and sort the heights modeArray = {} for _, val in pairs(tempModeArray) do - table.insert(modeArray, {val[1],val[3]}) + table.insert(modeArray, { val[1], val[3] }) end tempModeArray = {} - table.sort(modeArray, - function(a,b) return a[1] > b[1] end - ) + table.sort(modeArray, function(a, b) + return a[1] > b[1] + end) -- log the table of mode heights, might be useful for users who wish to fish them out Spring.Echo("cmd_dev_helpers, terrainMods; generating table format mode height sampling") @@ -292,19 +300,19 @@ if gadgetHandler:IsSyncedCode() then Spring.Echo("id: | height: |\tid: | height: |\tid: | height:") local tableDebth = math.floor(#modeArray / 3) for j = 1, tableDebth do - Spring.Echo( - j.."\t"..modeArray[j][2].."\t\t\t".. - j+tableDebth.."\t"..modeArray[j+tableDebth][2].."\t\t\t".. - j+tableDebth+tableDebth.."\t"..modeArray[j+tableDebth+tableDebth][2] - ) + Spring.Echo(j .. "\t" .. modeArray[j][2] .. "\t\t\t" .. j + tableDebth .. "\t" .. modeArray[j + tableDebth][2] .. "\t\t\t" .. j + tableDebth + tableDebth .. "\t" .. modeArray[j + tableDebth + tableDebth][2]) end Spring.Echo("cmd_dev_helpers, terrainMods, end of table") end -- used for reading mode position within the array's constraints or 0 local function sampleMode(pos) - if pos == nil then return modeArray[1][2] end - if pos == -1 then return modeArray[#modeArray][2] end + if pos == nil then + return modeArray[1][2] + end + if pos == -1 then + return modeArray[#modeArray][2] + end return modeArray[math.clamp(pos, 1, #modeArray)][2] or 0 end -- end of mode height related sampling @@ -313,7 +321,6 @@ if gadgetHandler:IsSyncedCode() then local command local commandProc for i = 1, #commands do - command = string.split(commands[i], " ") local func = terrainTerraformers[command[1]] if func then @@ -322,27 +329,25 @@ if gadgetHandler:IsSyncedCode() then local j = 2 commandProc = {} for k = 1, #command do - -- if mode is used, it requests most common height, substitue it if command[j] == "mode" then - -- find which mode value to use, and if we're offsetting it local offset = 0.0 local modePtr = 1 - if command[j+1] == "+" then - offset = tonumber(command[j+2]) + if command[j + 1] == "+" then + offset = tonumber(command[j + 2]) j = j + 2 - elseif command[j+1] == "-" then - offset = -tonumber(command[j+2]) + elseif command[j + 1] == "-" then + offset = -tonumber(command[j + 2]) j = j + 2 else - modePtr = tonumber(command[j+1],10) + modePtr = tonumber(command[j + 1], 10) if modePtr then - if command[j+2] == "+" then - offset = tonumber(command[j+3]) + if command[j + 2] == "+" then + offset = tonumber(command[j + 3]) j = j + 2 - elseif command[j+2] == "-" then - offset = -tonumber(command[j+3]) + elseif command[j + 2] == "-" then + offset = -tonumber(command[j + 3]) j = j + 2 end j = j + 1 @@ -369,41 +374,37 @@ if gadgetHandler:IsSyncedCode() then do -- Edge patchwork, something is not right with map edges, i don't know if its the above functions that fail, or if it is during map making Spring.SetHeightMapFunc(function() - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetHeightMap( x, Game.mapSizeZ, (Spring.GetGroundHeight ( x, Game.mapSizeZ - Game.squareSize ))) + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetHeightMap(x, Game.mapSizeZ, (Spring.GetGroundHeight(x, Game.mapSizeZ - Game.squareSize))) end - for z=0,Game.mapSizeZ, Game.squareSize do - Spring.SetHeightMap( Game.mapSizeX, z, (Spring.GetGroundHeight ( Game.mapSizeX - Game.squareSize, z ))) + for z = 0, Game.mapSizeZ, Game.squareSize do + Spring.SetHeightMap(Game.mapSizeX, z, (Spring.GetGroundHeight(Game.mapSizeX - Game.squareSize, z))) end end) - -- orginal height map so that restore ground command doesn't dig trenches or construct mountains Spring.SetOriginalHeightMapFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetOriginalHeightMap( x, z, Spring.GetGroundHeight ( x, z )) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetOriginalHeightMap(x, z, Spring.GetGroundHeight(x, z)) end end end) - -- temporary smooth mesh, as on some maps it can take up to a minute and a half for it to be created Spring.SetSmoothMeshFunc(function() - for z=0,Game.mapSizeZ, Game.squareSize do - for x=0,Game.mapSizeX, Game.squareSize do - Spring.SetSmoothMesh( x, z, 50+Spring.GetGroundHeight ( x, z )) + for z = 0, Game.mapSizeZ, Game.squareSize do + for x = 0, Game.mapSizeX, Game.squareSize do + Spring.SetSmoothMesh(x, z, 50 + Spring.GetGroundHeight(x, z)) end end end) end - end local debugcommands = nil function gadget:Initialize() if Spring.GetModOptions() and Spring.GetModOptions().debugcommands then - local debugString = Spring.GetModOptions().debugcommands -- "for fun" terrain moddifiers @@ -416,24 +417,21 @@ if gadgetHandler:IsSyncedCode() then return end - debugcommands = {} - local commands = string.split(Spring.GetModOptions().debugcommands, '|') + local commands = string.split(Spring.GetModOptions().debugcommands, "|") for i, command in ipairs(commands) do - local cmdsplit = string.split(command,':') + local cmdsplit = string.split(command, ":") if cmdsplit[1] and cmdsplit[2] and tonumber(cmdsplit[1]) then - if not string.find(string.lower(cmdsplit[2]), 'execute', nil, true) then + if not string.find(string.lower(cmdsplit[2]), "execute", nil, true) then debugcommands[tonumber(cmdsplit[1])] = cmdsplit[2] - Spring.Echo("Adding debug command",cmdsplit[1], cmdsplit[2]) + Spring.Echo("Adding debug command", cmdsplit[1], cmdsplit[2]) end end end - end checkStartPlayers() - gadgetHandler:AddChatAction('loadmissiles', LoadMissiles, "") - gadgetHandler:AddChatAction('halfhealth', HalfHealth, "") - + gadgetHandler:AddChatAction("loadmissiles", LoadMissiles, "") + gadgetHandler:AddChatAction("halfhealth", HalfHealth, "") end function gadget:RecvLuaMsg(msg, playerID) @@ -453,9 +451,7 @@ if gadgetHandler:IsSyncedCode() then local subPermission if cmd == "desync" then subPermission = "test" - elseif cmd == "givecat" or cmd == "xpunits" or cmd == "destroyunits" or cmd == "removeunits" or - cmd == "removenearbyunits" or cmd == "reclaimunits" or cmd == "transferunits" or - cmd == "wreckunits" or cmd == "spawnceg" or cmd == "spawnunitexplosion" or cmd == "removeunitdef" then + elseif cmd == "givecat" or cmd == "xpunits" or cmd == "destroyunits" or cmd == "removeunits" or cmd == "removenearbyunits" or cmd == "reclaimunits" or cmd == "transferunits" or cmd == "wreckunits" or cmd == "spawnceg" or cmd == "spawnunitexplosion" or cmd == "removeunitdef" then subPermission = "units" elseif cmd == "playertoteam" or cmd == "killteam" then subPermission = "teams" @@ -469,7 +465,7 @@ if gadgetHandler:IsSyncedCode() then return end - if cmd == 'desync' then + if cmd == "desync" then Spring.Echo("Synced: Attempting to trigger a /desync") Spring.SendCommands("desync") end @@ -477,31 +473,31 @@ if gadgetHandler:IsSyncedCode() then if cmd == "givecat" then GiveCat(words) elseif cmd == "xpunits" then - local parts = string.split(msg, ':') + local parts = string.split(msg, ":") local words = {} - msg = parts[1]..':'..parts[2] + msg = parts[1] .. ":" .. parts[2] for word in msg:gmatch("[%-_%w]+") do table.insert(words, word) end - ExecuteSelUnits(words, playerID, 'xp', parts[3]) + ExecuteSelUnits(words, playerID, "xp", parts[3]) elseif cmd == "destroyunits" then ExecuteSelUnits(words, playerID) elseif cmd == "removeunits" then - ExecuteSelUnits(words, playerID, 'remove') + ExecuteSelUnits(words, playerID, "remove") elseif cmd == "removenearbyunits" then - ExecuteSelUnits(words, playerID, 'removenearbyunits') + ExecuteSelUnits(words, playerID, "removenearbyunits") elseif cmd == "reclaimunits" then - ExecuteSelUnits(words, playerID, 'reclaim') + ExecuteSelUnits(words, playerID, "reclaim") elseif cmd == "transferunits" then - local parts = string.split(msg, ':') + local parts = string.split(msg, ":") local words = {} - msg = parts[1]..':'..parts[2] + msg = parts[1] .. ":" .. parts[2] for word in msg:gmatch("[%-_%w]+") do table.insert(words, word) end - ExecuteSelUnits(words, playerID, 'transfer', parts[3]) + ExecuteSelUnits(words, playerID, "transfer", parts[3]) elseif cmd == "wreckunits" then - ExecuteSelUnits(words, playerID, 'wreck') + ExecuteSelUnits(words, playerID, "wreck") elseif cmd == "spawnceg" then spawnceg(words) elseif cmd == "spawnunitexplosion" then @@ -523,7 +519,7 @@ if gadgetHandler:IsSyncedCode() then -- the gmatch words[] above would truncate it to the first token. After the -- header strip msg is "$:modmarker:x:y:z:label", so parts = -- {"$","modmarker",x,y,z,label}. - local parts = string.split(msg, ':') + local parts = string.split(msg, ":") local x = tonumber(parts[3]) local y = tonumber(parts[4]) local z = tonumber(parts[5]) @@ -535,15 +531,15 @@ if gadgetHandler:IsSyncedCode() then end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('loadmissiles') - gadgetHandler:RemoveChatAction('halfhealth') + gadgetHandler:RemoveChatAction("loadmissiles") + gadgetHandler:RemoveChatAction("halfhealth") end function globallos(words) local allyteams = Spring.GetAllyTeamList() - for i = 1,#allyteams do - local allyTeamID = allyteams[i] + for i = 1, #allyteams do + local allyTeamID = allyteams[i] if not words[3] or allyTeamID == tonumber(words[3]) then - Spring.SetGlobalLos(allyTeamID, words[2] == '1') + Spring.SetGlobalLos(allyTeamID, words[2] == "1") end end end @@ -560,7 +556,7 @@ if gadgetHandler:IsSyncedCode() then local x, y, z for i = 1, #featuretable do x, y, z = Spring.GetFeaturePosition(featuretable[i]) - Spring.SetFeaturePosition(featuretable[i], x, Spring.GetGroundHeight(x, z), z , true) -- snaptoground = true + Spring.SetFeaturePosition(featuretable[i], x, Spring.GetGroundHeight(x, z), z, true) -- snaptoground = true end end @@ -616,26 +612,26 @@ if gadgetHandler:IsSyncedCode() then local h, mh = Spring.GetUnitHealth(unitID) if not action then Spring.DestroyUnit(unitID, false, false, unitID) - elseif action == 'xp' and params then + elseif action == "xp" and params then --Spring.SetUnitExperience(unitID, select(1, Spring.GetUnitExperience(unitID)) + tonumber(params)) - if type(tonumber(params)) == 'number' then + if type(tonumber(params)) == "number" then Spring.SetUnitExperience(unitID, tonumber(params)) end - elseif action == 'remove' then + elseif action == "remove" then Spring.DestroyUnit(unitID, false, true) - elseif action == 'removenearbyunits' then + elseif action == "removenearbyunits" then Spring.DestroyUnit(unitID, false, true) - elseif action == 'transfer' then - if type(tonumber(params)) == 'number' then + elseif action == "transfer" then + if type(tonumber(params)) == "number" then Spring.TransferUnit(unitID, tonumber(params), true) end - elseif action == 'reclaim' then + elseif action == "reclaim" then local teamID = Spring.GetUnitTeam(unitID) local unitDefID = Spring.GetUnitDefID(unitID) - Spring.DestroyUnit(unitID, false, true) -- this doesnt give back resources in itself - Spring.AddTeamResource(teamID, 'metal', UnitDefs[unitDefID].metalCost) - Spring.AddTeamResource(teamID, 'energy', UnitDefs[unitDefID].energyCost) - elseif action == 'wreck' then + Spring.DestroyUnit(unitID, false, true) -- this doesnt give back resources in itself + Spring.AddTeamResource(teamID, "metal", UnitDefs[unitDefID].metalCost) + Spring.AddTeamResource(teamID, "energy", UnitDefs[unitDefID].energyCost) + elseif action == "wreck" then local unitDefID = Spring.GetUnitDefID(unitID) local x, y, z = Spring.GetUnitPosition(unitID) local heading = Spring.GetUnitHeading(unitID) @@ -655,18 +651,28 @@ if gadgetHandler:IsSyncedCode() then function spawnceg(words) Spring.Echo("SYNCED spawnceg", words[1], words[2], words[3], words[4], words[5]) - Spring.SpawnCEG(words[2], --cegname - tonumber(words[3]), tonumber(words[4]), tonumber(words[5]), --pos - 0, 0, 0, --dir + Spring.SpawnCEG( + words[2], --cegname + tonumber(words[3]), + tonumber(words[4]), + tonumber(words[5]), --pos + 0, + 0, + 0, --dir 0 --radius ) end function spawnunitexplosion(words, playerID) Spring.Echo("SYNCED spawnunitexplosion", words[1], words[2], words[3], words[4], words[5], words[6]) - Spring.SpawnCEG(words[2], --cegname - tonumber(words[3]), tonumber(words[4]), tonumber(words[5]), --pos - 0, 0, 0, --dir + Spring.SpawnCEG( + words[2], --cegname + tonumber(words[3]), + tonumber(words[4]), + tonumber(words[5]), --pos + 0, + 0, + 0, --dir 0 --radius ) local unitDefID = UnitDefNames[words[2]] and UnitDefNames[words[2]].id or false @@ -674,14 +680,14 @@ if gadgetHandler:IsSyncedCode() then local _, _, _, teamID = Spring.GetPlayerInfo(playerID, false) local unitID = Spring.CreateUnit(unitDefID, tonumber(words[3]), tonumber(words[4]), tonumber(words[5]), "n", teamID) if unitID then - Spring.DestroyUnit(unitID, words[6] == '1' and true or false, false) + Spring.DestroyUnit(unitID, words[6] == "1" and true or false, false) --if words[6] ~= '1' then -- this wont clear up the wreck of the above destroyed unit, but its maybe even bettter this way :) - local featuresInRange = Spring.GetFeaturesInSphere(tonumber(words[3]), tonumber(words[4]), tonumber(words[5]), 220) - for j = 1, #featuresInRange do - Spring.DestroyFeature(featuresInRange[j]) - end + local featuresInRange = Spring.GetFeaturesInSphere(tonumber(words[3]), tonumber(words[4]), tonumber(words[5]), 220) + for j = 1, #featuresInRange do + Spring.DestroyFeature(featuresInRange[j]) + end --end end end @@ -719,7 +725,7 @@ if gadgetHandler:IsSyncedCode() then end end - Spring.Echo(string.format("Removed %i units, %i wrecks, %i heaps for unitDefName %s",removedunits, removedwrecks, removedheaps, unitdefname )) + Spring.Echo(string.format("Removed %i units, %i wrecks, %i heaps for unitDefName %s", removedunits, removedwrecks, removedheaps, unitdefname)) else Spring.Echo("Removeunitdef:", unitdefname, "is not a valid UnitDefName") end @@ -755,40 +761,34 @@ if gadgetHandler:IsSyncedCode() then end Spring.Echo(string.format("Removed %i wrecks and %i heaps", removedwrecks, removedheaps)) end - - - -else -- UNSYNCED - - - +else -- UNSYNCED function gadget:Initialize() -- doing it via GotChatMsg ensures it will only listen to the caller - gadgetHandler:AddChatAction('givecat', GiveCat, "") -- Give a category of units, options /luarules givecat [cor|arm|scav|raptor] or /luarules givecat unitname [teamid] - gadgetHandler:AddChatAction('destroyunits', destroyUnits, "") -- self-destrucs the selected units /luarules destroyunits - gadgetHandler:AddChatAction('wreckunits', wreckUnits, "") -- turns the selected units into wrecks /luarules wreckunits - gadgetHandler:AddChatAction('reclaimunits', reclaimUnits, "") -- reclaims and refunds the selected units /luarules reclaimUnits - gadgetHandler:AddChatAction('removeunits', removeUnits, "") -- removes the selected units /luarules removeunits - gadgetHandler:AddChatAction('removenearbyunits', removeNearbyUnits, "") -- removes the selected units /luarules removenearbyunits radius #teamid - gadgetHandler:AddChatAction('transferunits', transferUnits, "") -- transfers the selected units /luarules transferunits - - gadgetHandler:AddChatAction('xp', xpUnits, "") -- gives the selected units experience, /luarules xp [int] - - gadgetHandler:AddChatAction('spawnceg', spawnceg, "") -- --/luarules spawnceg newnuke [int] -- spawns at cursor at height - gadgetHandler:AddChatAction('spawnunitexplosion', spawnunitexplosion, "") -- --/luarules spawnunitexplosion armbull - - gadgetHandler:AddChatAction('dumpunits', dumpUnits, "") -- /luarules dumpunits dumps all units on may into infolog.txt - gadgetHandler:AddChatAction('dumpfeatures', dumpFeatures, "") -- /luarules dumpfeatures dumps all features into infolog.txt - gadgetHandler:AddChatAction('dumploadout', dumpLoadout, "") -- /luarules dumploadout dumps all units and features in loadout.lua format - gadgetHandler:AddChatAction('removeunitdef', removeUnitDef, "") -- /luarules removeunitdef armflash removes all units, their wrecks and heaps too - gadgetHandler:AddChatAction('clearwrecks', clearWrecks, "") -- /luarules clearwrecks removes all wrecks and heaps from the map - gadgetHandler:AddChatAction('reducewrecks', reduceWrecks, "") -- /luarules reducewrecks applies damage to reduce wrecks to heaps and to destroy heaps - - gadgetHandler:AddChatAction('globallos', globallos, "") -- /luarules globallos [1|0] [allyteam] -- sets global los for all teams, 1 = on, 0 = off (allyteam is optional) - gadgetHandler:AddChatAction('playertoteam', playertoteam, "") -- /luarules playertoteam [playerID] [teamID] -- playerID+teamID are optional, no playerID given = your own playerID, no teamID = selected unit team or hovered unit team - gadgetHandler:AddChatAction('killteam', killteam, "") -- /luarules killteam [teamID] -- kills the team - gadgetHandler:AddChatAction('desync', desync) -- /luarules desync - gadgetHandler:AddChatAction('modmarker', modmarker, "") -- /luarules modmarker [label] -- places a broadcast marker at cursor visible to all players + gadgetHandler:AddChatAction("givecat", GiveCat, "") -- Give a category of units, options /luarules givecat [cor|arm|scav|raptor] or /luarules givecat unitname [teamid] + gadgetHandler:AddChatAction("destroyunits", destroyUnits, "") -- self-destrucs the selected units /luarules destroyunits + gadgetHandler:AddChatAction("wreckunits", wreckUnits, "") -- turns the selected units into wrecks /luarules wreckunits + gadgetHandler:AddChatAction("reclaimunits", reclaimUnits, "") -- reclaims and refunds the selected units /luarules reclaimUnits + gadgetHandler:AddChatAction("removeunits", removeUnits, "") -- removes the selected units /luarules removeunits + gadgetHandler:AddChatAction("removenearbyunits", removeNearbyUnits, "") -- removes the selected units /luarules removenearbyunits radius #teamid + gadgetHandler:AddChatAction("transferunits", transferUnits, "") -- transfers the selected units /luarules transferunits + + gadgetHandler:AddChatAction("xp", xpUnits, "") -- gives the selected units experience, /luarules xp [int] + + gadgetHandler:AddChatAction("spawnceg", spawnceg, "") -- --/luarules spawnceg newnuke [int] -- spawns at cursor at height + gadgetHandler:AddChatAction("spawnunitexplosion", spawnunitexplosion, "") -- --/luarules spawnunitexplosion armbull + + gadgetHandler:AddChatAction("dumpunits", dumpUnits, "") -- /luarules dumpunits dumps all units on may into infolog.txt + gadgetHandler:AddChatAction("dumpfeatures", dumpFeatures, "") -- /luarules dumpfeatures dumps all features into infolog.txt + gadgetHandler:AddChatAction("dumploadout", dumpLoadout, "") -- /luarules dumploadout dumps all units and features in loadout.lua format + gadgetHandler:AddChatAction("removeunitdef", removeUnitDef, "") -- /luarules removeunitdef armflash removes all units, their wrecks and heaps too + gadgetHandler:AddChatAction("clearwrecks", clearWrecks, "") -- /luarules clearwrecks removes all wrecks and heaps from the map + gadgetHandler:AddChatAction("reducewrecks", reduceWrecks, "") -- /luarules reducewrecks applies damage to reduce wrecks to heaps and to destroy heaps + + gadgetHandler:AddChatAction("globallos", globallos, "") -- /luarules globallos [1|0] [allyteam] -- sets global los for all teams, 1 = on, 0 = off (allyteam is optional) + gadgetHandler:AddChatAction("playertoteam", playertoteam, "") -- /luarules playertoteam [playerID] [teamID] -- playerID+teamID are optional, no playerID given = your own playerID, no teamID = selected unit team or hovered unit team + gadgetHandler:AddChatAction("killteam", killteam, "") -- /luarules killteam [teamID] -- kills the team + gadgetHandler:AddChatAction("desync", desync) -- /luarules desync + gadgetHandler:AddChatAction("modmarker", modmarker, "") -- /luarules modmarker [label] -- places a broadcast marker at cursor visible to all players -- Moderator broadcast ping: the synced modmarker handler relays here, and -- every client draws it locally (localOnly=true) so ALL players see it. gadgetHandler:AddSyncAction("modmarker", function(_, x, y, z, label) @@ -797,49 +797,49 @@ else -- UNSYNCED end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('givecat') - gadgetHandler:RemoveChatAction('destroyunits') - gadgetHandler:RemoveChatAction('reclaimunits') - gadgetHandler:RemoveChatAction('removeunits') - gadgetHandler:RemoveChatAction('removenearbyunits') - gadgetHandler:RemoveChatAction('transferunits') - gadgetHandler:RemoveChatAction('xp') - gadgetHandler:RemoveChatAction('spawnceg') - gadgetHandler:RemoveChatAction('spawnunitexplosion') - - gadgetHandler:RemoveChatAction('dumpunits') - gadgetHandler:RemoveChatAction('dumpfeatures') - gadgetHandler:RemoveChatAction('removeunitdefs') - gadgetHandler:RemoveChatAction('clearwrecks') - gadgetHandler:RemoveChatAction('reducewrecks') - gadgetHandler:RemoveChatAction('globallos') - gadgetHandler:RemoveChatAction('playertoteam') - gadgetHandler:RemoveChatAction('killteam') - gadgetHandler:RemoveChatAction('desync') - gadgetHandler:RemoveChatAction('modmarker') + gadgetHandler:RemoveChatAction("givecat") + gadgetHandler:RemoveChatAction("destroyunits") + gadgetHandler:RemoveChatAction("reclaimunits") + gadgetHandler:RemoveChatAction("removeunits") + gadgetHandler:RemoveChatAction("removenearbyunits") + gadgetHandler:RemoveChatAction("transferunits") + gadgetHandler:RemoveChatAction("xp") + gadgetHandler:RemoveChatAction("spawnceg") + gadgetHandler:RemoveChatAction("spawnunitexplosion") + + gadgetHandler:RemoveChatAction("dumpunits") + gadgetHandler:RemoveChatAction("dumpfeatures") + gadgetHandler:RemoveChatAction("removeunitdefs") + gadgetHandler:RemoveChatAction("clearwrecks") + gadgetHandler:RemoveChatAction("reducewrecks") + gadgetHandler:RemoveChatAction("globallos") + gadgetHandler:RemoveChatAction("playertoteam") + gadgetHandler:RemoveChatAction("killteam") + gadgetHandler:RemoveChatAction("desync") + gadgetHandler:RemoveChatAction("modmarker") gadgetHandler:RemoveSyncAction("modmarker") end function xpUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'xpunits') + processUnits(_, line, words, playerID, "xpunits") end function destroyUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'destroyunits') + processUnits(_, line, words, playerID, "destroyunits") end function wreckUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'wreckunits') + processUnits(_, line, words, playerID, "wreckunits") end function reclaimUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'reclaimunits') + processUnits(_, line, words, playerID, "reclaimunits") end function removeUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'removeunits') + processUnits(_, line, words, playerID, "removeunits") end function removeNearbyUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'removenearbyunits') + processUnits(_, line, words, playerID, "removenearbyunits") end function transferUnits(_, line, words, playerID) - processUnits(_, line, words, playerID, 'transferunits') + processUnits(_, line, words, playerID, "transferunits") end function removeUnitDef(_, line, words, playerID) @@ -854,7 +854,7 @@ else -- UNSYNCED -- Spring.Echo(words[2]) -- Spring.Echo(words[3]) if words[1] and UnitDefNames[words[1]] then - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':removeunitdef '.. words[1]) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":removeunitdef " .. words[1]) end end @@ -865,7 +865,7 @@ else -- UNSYNCED if not isAuthorized(playerID, "terrain") then return end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':clearwrecks') + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":clearwrecks") end function reduceWrecks(_, line, words, playerID) @@ -875,7 +875,7 @@ else -- UNSYNCED if not isAuthorized(playerID, "terrain") then return end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':reducewrecks') + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":reducewrecks") end function processUnits(_, line, words, playerID, action) @@ -885,21 +885,21 @@ else -- UNSYNCED if not isAuthorized(playerID, "units") then return end - local msg = '' + local msg = "" local units = {} - if action == 'removenearbyunits' then - local mx,my = Spring.GetMouseState() - local targetType, pos = Spring.TraceScreenRay(mx,my,true) - if type(pos) == 'table' then + if action == "removenearbyunits" then + local mx, my = Spring.GetMouseState() + local targetType, pos = Spring.TraceScreenRay(mx, my, true) + if type(pos) == "table" then units = Spring.GetUnitsInSphere(pos[1], pos[2], pos[3], words[1] and words[1] or 24, words[2] and words[2] or nil) end else - if not words[1] and action == 'transferunits' then - local mx,my = Spring.GetMouseState() + if not words[1] and action == "transferunits" then + local mx, my = Spring.GetMouseState() Script.LuaUI.RestoreSelectionVolume() -- Fence calls to TraceScreenRay without onlyCoords == true. - local targetType, unitID = Spring.TraceScreenRay(mx,my) + local targetType, unitID = Spring.TraceScreenRay(mx, my) Script.LuaUI.RemoveSelectionVolume() - if targetType == 'unit' then + if targetType == "unit" then words[1] = Spring.GetUnitTeam(unitID) end end @@ -909,9 +909,9 @@ else -- UNSYNCED msg = msg .. " " .. tostring(unitID) end if words[1] then - msg = msg .. ':'.. words[1] + msg = msg .. ":" .. words[1] end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. action .. msg) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. action .. msg) end function dumpFeatures(_, line, words, playerID) @@ -921,15 +921,19 @@ else -- UNSYNCED if not isAuthorized(playerID, "units") then return end - local features=Spring.GetAllFeatures() + local features = Spring.GetAllFeatures() Spring.Echo("Dumping all features") - for k,featureID in pairs(features) do + for k, featureID in pairs(features) do local featureName = (FeatureDefs[Spring.GetFeatureDefID(featureID)].name or "nil") local x, y, z = Spring.GetFeaturePosition(featureID) local r = Spring.GetFeatureHeading(featureID) local resurrectas = Spring.GetFeatureResurrect(featureID) - if resurrectas then resurrectas = "\"" .. resurrectas .. "\"" else resurrectas = 'nil' end - Spring.Echo(string.format("{name = \'%s\', x = %d, y = %d, z = %d, rot = %d , scale = 1.0, resurrectas = %s},\n",featureName,x,y,z,r, resurrectas)) --{ name = 'ad0_aleppo_2', x = 2900, z = 52, rot = "-1" }, + if resurrectas then + resurrectas = '"' .. resurrectas .. '"' + else + resurrectas = "nil" + end + Spring.Echo(string.format("{name = '%s', x = %d, y = %d, z = %d, rot = %d , scale = 1.0, resurrectas = %s},\n", featureName, x, y, z, r, resurrectas)) --{ name = 'ad0_aleppo_2', x = 2900, z = 52, rot = "-1" }, end end @@ -941,14 +945,14 @@ else -- UNSYNCED return end Spring.Echo("Dumping all units") - local units=Spring.GetAllUnits() - for k,unitID in pairs(units) do + local units = Spring.GetAllUnits() + for k, unitID in pairs(units) do local unitname = (UnitDefs[Spring.GetUnitDefID(unitID)].name or "nil") local x, y, z = Spring.GetUnitPosition(unitID) local r = Spring.GetUnitHeading(unitID) local tid = Spring.GetUnitTeam(unitID) local isneutral = tostring(Spring.GetUnitNeutral(unitID)) - Spring.Echo(string.format("{name = \'%s\', x = %d, y = %d, z = %d, rot = %d , team = %d, neutral = %s},\n",unitname,x,y,z,r,tid, isneutral)) --{ name = 'ad0_aleppo_2', x = 2900, z = 52, rot = "-1" }, + Spring.Echo(string.format("{name = '%s', x = %d, y = %d, z = %d, rot = %d , team = %d, neutral = %s},\n", unitname, x, y, z, r, tid, isneutral)) --{ name = 'ad0_aleppo_2', x = 2900, z = 52, rot = "-1" }, end end @@ -973,10 +977,13 @@ else -- UNSYNCED local isBeingBuilt = Spring.GetUnitIsBeingBuilt(unitID) local isNeutral = Spring.GetUnitNeutral(unitID) local extras = "" - if isBeingBuilt then extras = extras .. ", construction = true" end - if isNeutral then extras = extras .. ", neutral = true" end - Spring.Echo(string.format("\t{ unitDefName = '%s', x = %d, z = %d, facing = '%s', team = %d%s },", - unitDefName, math.floor(x), math.floor(z), facing, team, extras)) + if isBeingBuilt then + extras = extras .. ", construction = true" + end + if isNeutral then + extras = extras .. ", neutral = true" + end + Spring.Echo(string.format("\t{ unitDefName = '%s', x = %d, z = %d, facing = '%s', team = %d%s },", unitDefName, math.floor(x), math.floor(z), facing, team, extras)) end Spring.Echo("}") @@ -985,8 +992,7 @@ else -- UNSYNCED local featureDefName = (FeatureDefs[Spring.GetFeatureDefID(featureID)].name or "nil") local x, y, z = Spring.GetFeaturePosition(featureID) local facing = headingToFacing(Spring.GetFeatureHeading(featureID)) - Spring.Echo(string.format("\t{ featureDefName = '%s', x = %d, z = %d, facing = '%s' },", - featureDefName, math.floor(x), math.floor(z), facing)) + Spring.Echo(string.format("\t{ featureDefName = '%s', x = %d, z = %d, facing = '%s' },", featureDefName, math.floor(x), math.floor(z), facing)) end Spring.Echo("}") end @@ -994,9 +1000,9 @@ else -- UNSYNCED local function centerCamera() local camState = Spring.GetCameraState() if camState then - local mapcx = Game.mapSizeX/2 - local mapcz = Game.mapSizeZ/2 - local mapcy = Spring.GetGroundHeight(mapcx,mapcz) + local mapcx = Game.mapSizeX / 2 + local mapcz = Game.mapSizeZ / 2 + local mapcy = Spring.GetGroundHeight(mapcx, mapcz) camState["px"] = mapcx camState["py"] = mapcy @@ -1016,7 +1022,6 @@ else -- UNSYNCED local fightertestactive = false local fighterteststats - -- An Update is always done before a Draw Frame -- An Update always Start with Gadget:Update -- A draw frame actually spans from DrawGenesis to DrawScreenPost! @@ -1026,13 +1031,12 @@ else -- UNSYNCED -- A - -- Spring.DiffTimers(Spring.GetTimerMicros(),tus) local lastDrawTimerUS = Spring.GetTimerMicros() local lastSimTimerUS = Spring.GetTimerMicros() local lastUpdateTimerUs = Spring.GetTimerMicros() - local lastFrameType = 'draw' -- can be draw, sim, update + local lastFrameType = "draw" -- can be draw, sim, update local simTime = 0 local drawTime = 0 local updateTime = 0 @@ -1052,13 +1056,13 @@ else -- UNSYNCED function gadget:Update() -- START OF UPDATE if fightertestactive then local now = Spring.GetTimerMicros() - if lastFrameType == 'draw' then + if lastFrameType == "draw" then -- We are doing a double draw else -- We are ending a sim frame, so better push the sim frame time number simTime = Spring.DiffTimers(now, lastSimTimerUS) fighterteststats.simFrameTimes[#fighterteststats.simFrameTimes + 1] = simTime - ss = alpha * ss + (1-alpha) * simTime + ss = alpha * ss + (1 - alpha) * simTime end lastUpdateTimerUs = Spring.GetTimerMicros() end @@ -1067,16 +1071,15 @@ else -- UNSYNCED function gadget:GameFrame(n) -- START OF SIM FRAME if fightertestactive then local now = Spring.GetTimerMicros() - if lastFrameType == 'sim' then + if lastFrameType == "sim" then -- We are doing double sim, push a sim frame time number simTime = Spring.DiffTimers(now, lastSimTimerUS) fighterteststats.simFrameTimes[#fighterteststats.simFrameTimes + 1] = simTime - ss = alpha * ss + (1-alpha) * simTime + ss = alpha * ss + (1 - alpha) * simTime else -- we are coming off a draw frame - end lastSimTimerUS = now - lastFrameType = 'sim' + lastFrameType = "sim" end end @@ -1085,7 +1088,7 @@ else -- UNSYNCED local now = Spring.GetTimerMicros() updateTime = Spring.DiffTimers(now, lastUpdateTimerUs) fighterteststats.updateFrameTimes[#fighterteststats.updateFrameTimes + 1] = updateTime - su = alpha * su + (1-alpha) * updateTime + su = alpha * su + (1 - alpha) * updateTime lastDrawTimerUS = now end end @@ -1094,9 +1097,9 @@ else -- UNSYNCED if fightertestactive then drawTime = Spring.DiffTimers(Spring.GetTimerMicros(), lastDrawTimerUS) fighterteststats.drawFrameTimes[#fighterteststats.drawFrameTimes + 1] = drawTime - sd = alpha * sd + (1-alpha) * drawTime + sd = alpha * sd + (1 - alpha) * drawTime - lastFrameType = 'draw' + lastFrameType = "draw" dt = drawTime end end @@ -1105,10 +1108,10 @@ else -- UNSYNCED if fightertestactive or isBenchMark then local s = "" if isBenchMark then - s = s .. string.format("Benchmark Frame %d/%d\n", #fighterteststats.simFrameTimes,benchMarkFrames) + s = s .. string.format("Benchmark Frame %d/%d\n", #fighterteststats.simFrameTimes, benchMarkFrames) end - s = s .. string.format("Sim = ~%3.2fms (%3.2fms)\nUpdate = ~%3.2fms (%3.2fms)\nDraw = ~%3.2fms (%3.2fms)", ss, simTime, su, updateTime, sd, drawTime) - gl.Text(s, 600*uiScale, 600*uiScale, 16*uiScale) + s = s .. string.format("Sim = ~%3.2fms (%3.2fms)\nUpdate = ~%3.2fms (%3.2fms)\nDraw = ~%3.2fms (%3.2fms)", ss, simTime, su, updateTime, sd, drawTime) + gl.Text(s, 600 * uiScale, 600 * uiScale, 16 * uiScale) end end @@ -1128,29 +1131,28 @@ else -- UNSYNCED if playerID ~= Spring.GetMyPlayerID() then return end - Spring.Echo("Fightertest",line, words, playerID, action) + Spring.Echo("Fightertest", line, words, playerID, action) if not isAuthorized(playerID, "terrain") then return end if fightertestactive then -- We need to dump the stats - local s1 = string.format("Fightertest complete, #created = %d, #destroyed = %d", fighterteststats.numunitscreated, fighterteststats.numunitsdestroyed) + local s1 = string.format("Fightertest complete, #created = %d, #destroyed = %d", fighterteststats.numunitscreated, fighterteststats.numunitsdestroyed) Spring.Echo(s1) local res = {} local stats = {} - for n, t in pairs({Sim = fighterteststats.simFrameTimes, Draw = fighterteststats.drawFrameTimes, Update = fighterteststats.updateFrameTimes}) do + for n, t in pairs({ Sim = fighterteststats.simFrameTimes, Draw = fighterteststats.drawFrameTimes, Update = fighterteststats.updateFrameTimes }) do local ms = { count = 0, total = 0, mean = 0, spread = 0, percentiles = {}, - - } --mystats + } --mystats -- Discard first 10% local ct = {} -- cleantable local oldtotal = #t - for i,v in ipairs(t) do + for i, v in ipairs(t) do if i > (oldtotal * 0.1) then ms.count = ms.count + 1 ct[ms.count] = v @@ -1158,28 +1160,27 @@ else -- UNSYNCED end end - ms.mean = ms.total/ms.count + ms.mean = ms.total / ms.count table.sort(ct) for i, v in ipairs(ct) do - ms.spread = ms.spread + math.abs( v - ms.mean) + ms.spread = ms.spread + math.abs(v - ms.mean) end - ms.spread = ms.spread/ms.count + ms.spread = ms.spread / ms.count - for _,i in ipairs({0,1,2,5,10,20,35,50,65,80,90,95,98,99,100}) do - ms.percentiles[i] = ct[math.min(#ct, 1 + math.floor(i*0.01 * #ct))] + for _, i in ipairs({ 0, 1, 2, 5, 10, 20, 35, 50, 65, 80, 90, 95, 98, 99, 100 }) do + ms.percentiles[i] = ct[math.min(#ct, 1 + math.floor(i * 0.01 * #ct))] end stats[n] = ms local total = 0 - for i,v in ipairs(t) do + for i, v in ipairs(t) do total = total + v end - local s2 = string.format("%s %d frames, %3.2fms per frame, %4.2fs total", - n, ms.count, ms.mean, ms.total) - res[#res+1] = s2 + local s2 = string.format("%s %d frames, %3.2fms per frame, %4.2fs total", n, ms.count, ms.mean, ms.total) + res[#res + 1] = s2 Spring.Echo(s2) end @@ -1191,7 +1192,7 @@ else -- UNSYNCED stats.engineVersion = Engine.versionFull stats.gpu = Platform.gpu stats.cpu = Platform.hwConfig - stats.display = tostring(vsx) ..'x' .. tostring(vsy) + stats.display = tostring(vsx) .. "x" .. tostring(vsy) Spring.Echo("Benchmark Results") Spring.Echo(stats) @@ -1203,7 +1204,6 @@ else -- UNSYNCED end end - -- clean up --fighterteststats = {} else @@ -1226,16 +1226,18 @@ else -- UNSYNCED drawFrameTimes = {}, updateFrameTimes = {}, numunitscreated = 0, - numunitsdestroyed= 0, + numunitsdestroyed = 0, } lastDrawTimerUS = Spring.GetTimerMicros() lastSimTimerUS = Spring.GetTimerMicros() lastUpdateTimerUs = Spring.GetTimerMicros() end fightertestactive = not fightertestactive - local msg = PACKET_HEADER .. ':fightertest' - for i=1,5 do - if words[i] then msg = msg .. " " .. tostring(words[i]) end + local msg = PACKET_HEADER .. ":fightertest" + for i = 1, 5 do + if words[i] then + msg = msg .. " " .. tostring(words[i]) + end end centerCamera() Spring.SendLuaRulesMsg(msg) @@ -1249,11 +1251,10 @@ else -- UNSYNCED return end if words[2] then - end - local globallos = (not words[1] or words[1] ~= '0') or false - Spring.Echo("Globallos: " .. (globallos and 'enabled' or 'disabled')) - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':globallos:' .. (globallos and ' 1' or ' 0')..(words[2] and ':'..words[2] or '')) + local globallos = (not words[1] or words[1] ~= "0") or false + Spring.Echo("Globallos: " .. (globallos and "enabled" or "disabled")) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":globallos:" .. (globallos and " 1" or " 0") .. (words[2] and ":" .. words[2] or "")) end function playertoteam(_, line, words, playerID, action) @@ -1268,9 +1269,9 @@ else -- UNSYNCED if #units > 0 then words[1] = Spring.GetUnitTeam(units[1]) else - local mx,my = Spring.GetMouseState() - local targetType, unitID = Spring.TraceScreenRay(mx,my) - if targetType == 'unit' then + local mx, my = Spring.GetMouseState() + local targetType, unitID = Spring.TraceScreenRay(mx, my) + if targetType == "unit" then words[1] = Spring.GetUnitTeam(unitID) end end @@ -1279,8 +1280,8 @@ else -- UNSYNCED words[2] = words[1] words[1] = Spring.GetMyPlayerID() end - if tonumber(words[2]) < (#Spring.GetTeamList())-1 then - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':playertoteam:' .. words[1] .. ':' .. words[2]) + if tonumber(words[2]) < (#Spring.GetTeamList()) - 1 then + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":playertoteam:" .. words[1] .. ":" .. words[2]) end end @@ -1294,7 +1295,7 @@ else -- UNSYNCED if not words[1] then return end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':killteam:' .. words[1]) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":killteam:" .. words[1]) end function desync(_, line, words, playerID) @@ -1305,7 +1306,7 @@ else -- UNSYNCED return end Spring.Echo("Unsynced: Attempting to trigger a /desync") - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':desync') + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":desync") end function spawnceg(_, line, words, playerID) @@ -1324,14 +1325,14 @@ else -- UNSYNCED end local mx, my = Spring.GetMouseState() local t, pos = Spring.TraceScreenRay(mx, my, true) - if type(pos) == 'table' then + if type(pos) == "table" then local n = 0 local ox, oy, oz = math.floor(pos[1]), math.floor(pos[2] + height), math.floor(pos[3]) local x, y, z = ox, oy, oz - local msg = "spawnceg " .. tostring(words[1]) .. ' ' .. tostring(x) .. ' ' .. tostring(y) .. ' ' .. tostring(z) + local msg = "spawnceg " .. tostring(words[1]) .. " " .. tostring(x) .. " " .. tostring(y) .. " " .. tostring(z) - Spring.Echo('Spawning CEG:', line, playerID, msg) - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. msg) + Spring.Echo("Spawning CEG:", line, playerID, msg) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. msg) end end @@ -1346,12 +1347,12 @@ else -- UNSYNCED end local mx, my = Spring.GetMouseState() local t, pos = Spring.TraceScreenRay(mx, my, true) - if type(pos) == 'table' then + if type(pos) == "table" then local x = math.floor(pos[1]) local y = math.floor(pos[2]) local z = math.floor(pos[3]) local label = words[1] and table.concat(words, " ", 1) or "" - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':modmarker:' .. x .. ':' .. y .. ':' .. z .. ':' .. label) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":modmarker:" .. x .. ":" .. y .. ":" .. z .. ":" .. label) end end @@ -1367,10 +1368,10 @@ else -- UNSYNCED local t, pos = Spring.TraceScreenRay(mx, my, true) local ox, oy, oz = math.floor(pos[1]), math.floor(pos[2]), math.floor(pos[3]) local x, y, z = ox, oy, oz - local msg = "spawnunitexplosion " .. tostring(words[1]) .. ' ' .. tostring(x) .. ' ' .. tostring(y) .. ' ' .. tostring(z) .. ((words[2] and words[2] == '1' ) and ' 1' or ' 0') + local msg = "spawnunitexplosion " .. tostring(words[1]) .. " " .. tostring(x) .. " " .. tostring(y) .. " " .. tostring(z) .. ((words[2] and words[2] == "1") and " 1" or " 0") --Spring.Echo('Spawning unit explosion:', line, playerID, msg) - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. msg) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. msg) end function GiveCat(_, line, words, playerID) @@ -1403,20 +1404,22 @@ else -- UNSYNCED end collectBuildOptions(rootDef.id, 0) Spring.Echo("givecat: giving " .. #result .. " unique units from '" .. unitName .. "'") - if #result == 0 then return end + if #result == 0 then + return + end local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) if words[2] and tonumber(words[2]) then teamID = tonumber(words[2]) end local mx, my = Spring.GetMouseState() local t, pos = Spring.TraceScreenRay(mx, my, true) - if type(pos) == 'table' then + if type(pos) == "table" then local x, z = math.floor(pos[1]), math.floor(pos[3]) local msg = "givecat " .. x .. " " .. z .. " " .. teamID for _, uDID in ipairs(result) do msg = msg .. " " .. uDID end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. msg) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. msg) end return end @@ -1425,10 +1428,14 @@ else -- UNSYNCED local techLevels = {} local facSuffix = { --ignore t3 - ["veh"] = "vp", ["bot"] = "lab", ["ship"] = "sy", ["hover"] = "hp" --hover are special case, no t2 fac + ["veh"] = "vp", + ["bot"] = "lab", + ["ship"] = "sy", + ["hover"] = "hp", --hover are special case, no t2 fac } local techSuffix = { - ["t1"] = "", ["t2"] = "a" --t3 added later + ["t1"] = "", + ["t2"] = "a", --t3 added later } for t, suffix in pairs(facSuffix) do local acceptableUDIDs = {} @@ -1470,39 +1477,39 @@ else -- UNSYNCED for _, uDID in ipairs(UnitDefNames["armshltx"].buildOptions) do t3Units[uDID] = true end - techLevels['t3'] = t3Units - techSuffix['t3'] = 't3' + techLevels["t3"] = t3Units + techSuffix["t3"] = "t3" local Accept = {} -- table of conditions that must be satisfied for the unitDef to be given -- factions if string.find(line, "arm") then local Condition = function(ud) - return ud.name:sub(1, 3) == "arm" and not string.find(ud.name, '_scav') + return ud.name:sub(1, 3) == "arm" and not string.find(ud.name, "_scav") end Accept[#Accept + 1] = Condition end if string.find(line, "cor") then local Condition = function(ud) - return ud.name:sub(1, 3) == "cor" and not string.find(ud.name, '_scav') + return ud.name:sub(1, 3) == "cor" and not string.find(ud.name, "_scav") end Accept[#Accept + 1] = Condition end if string.find(line, "leg") then local Condition = function(ud) - return ud.name:sub(1, 3) == "leg" and not string.find(ud.name, '_scav') + return ud.name:sub(1, 3) == "leg" and not string.find(ud.name, "_scav") end Accept[#Accept + 1] = Condition end if string.find(line, "scav") then local Condition = function(ud) - return string.find(ud.name, '_scav') + return string.find(ud.name, "_scav") end Accept[#Accept + 1] = Condition end if string.find(line, "raptor") then local Condition = function(ud) - return string.find(ud.name, 'raptor') + return string.find(ud.name, "raptor") end Accept[#Accept + 1] = Condition end @@ -1579,17 +1586,16 @@ else -- UNSYNCED -- team local _, _, _, teamID = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) - if string.match(line, ' ([0-9].*)') then - teamID = string.match(line, ' ([0-9].*)') + if string.match(line, " ([0-9].*)") then + teamID = string.match(line, " ([0-9].*)") end - -- give units local exlusions = { meteor = true, raptor_hive = true, nuketest = true, nuketestcor = true, nuketestcororg = true, nuketestorg = true, scavtacnukespawner = true, scavempspawner = true } local newExlusions = {} for k, v in pairs(exlusions) do newExlusions[k] = true - newExlusions[k..'_scav'] = true + newExlusions[k .. "_scav"] = true end exlusions = newExlusions newExlusions = nil @@ -1614,7 +1620,7 @@ else -- UNSYNCED local mx, my = Spring.GetMouseState() local t, pos = Spring.TraceScreenRay(mx, my, true) - if type(pos) == 'table' then + if type(pos) == "table" then local n = 0 local ox, oz = math.floor(pos[1]), math.floor(pos[3]) local x, z = ox, oz @@ -1624,8 +1630,7 @@ else -- UNSYNCED msg = msg .. " " .. uDID end - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. msg) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. msg) end end - end diff --git a/luarules/gadgets/cmd_factory_stop_production.lua b/luarules/gadgets/cmd_factory_stop_production.lua index 353082c5cb4..f9ecaa53579 100644 --- a/luarules/gadgets/cmd_factory_stop_production.lua +++ b/luarules/gadgets/cmd_factory_stop_production.lua @@ -15,7 +15,6 @@ end local identifier = "StopProduction" if gadgetHandler:IsSyncedCode() then - local isFactory = {} for udid = 1, #UnitDefs do local ud = UnitDefs[udid] @@ -54,7 +53,7 @@ if gadgetHandler:IsSyncedCode() then while count > 0 do local opts = DEQUEUE_OPTS if count >= 100 then - count = count - 100 + count = count - 100 opts = opts + CMD.OPT_SHIFT + CMD.OPT_CTRL elseif count >= 20 then count = count - 20 @@ -87,7 +86,7 @@ if gadgetHandler:IsSyncedCode() then local keepDefID if total > 1 then local firstCommand = Spring.GetFactoryCommands(unitID, 1) - local firstID = firstCommand[1]['id'] + local firstID = firstCommand[1]["id"] if firstID < 0 then keepDefID = -firstID end @@ -129,7 +128,7 @@ else local function stopProduction(_, unitID, unitDefID, unitTeam, cmdID) if isSpec or Spring.AreTeamsAllied(unitTeam, myTeamID) then - Script.LuaUI.UnitCommand(unitID, unitDefID, unitTeam, cmdID, {}, {coded = 0}) + Script.LuaUI.UnitCommand(unitID, unitDefID, unitTeam, cmdID, {}, { coded = 0 }) end end diff --git a/luarules/gadgets/cmd_get_player_data.lua b/luarules/gadgets/cmd_get_player_data.lua index 9df04ef0734..a03b685c53d 100644 --- a/luarules/gadgets/cmd_get_player_data.lua +++ b/luarules/gadgets/cmd_get_player_data.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "July 2018", license = "GNU GPL, v2 or later", layer = -999999, - enabled = true + enabled = true, } end @@ -25,9 +25,7 @@ local screenshotRequestTimeoutMs = 60000 local isSingleplayer = Spring.Utilities.Gametype.IsSinglePlayer() - if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationPlayerData = validation @@ -38,11 +36,17 @@ if gadgetHandler:IsSyncedCode() then function gadget:RecvLuaMsg(msg, player) -- Fast allocation-free checks: length guard + byte comparisons before any sub() - if #msg < 5 then return end + if #msg < 5 then + return + end local b3, b4 = string.byte(msg, 3, 4) - if b3 ~= vb1 or b4 ~= vb2 then return end + if b3 ~= vb1 or b4 ~= vb2 then + return + end local b1, b2 = string.byte(msg, 1, 2) - if b1 ~= sb1 then return end + if b1 ~= sb1 then + return + end if b2 == sb2_d then -- "sd" local name = Spring.GetPlayerInfo(player, false) local semicolonPos = string.find(msg, ";", 5) @@ -58,9 +62,7 @@ if gadgetHandler:IsSyncedCode() then return true end end - else - local validation = SYNCED.validationPlayerData -- Screenshot capture variables @@ -95,9 +97,9 @@ else function gadget:Initialize() gadgetHandler:AddSyncAction("ReceiveScreenshot", ReceiveScreenshot) gadgetHandler:AddSyncAction("StartScreenshot", StartScreenshot) - gadgetHandler:AddChatAction('getscreenshot', GetScreenshot, "") - gadgetHandler:AddChatAction('getscreenshotlq', GetScreenshotLq, "") - gadgetHandler:AddChatAction('getscreenshothq', GetScreenshotHq, "") + gadgetHandler:AddChatAction("getscreenshot", GetScreenshot, "") + gadgetHandler:AddChatAction("getscreenshotlq", GetScreenshotLq, "") + gadgetHandler:AddChatAction("getscreenshothq", GetScreenshotHq, "") gadget:ViewResize() end @@ -108,9 +110,9 @@ else if font then gl.DeleteFont(font) end - gadgetHandler:RemoveChatAction('getscreenshot') - gadgetHandler:RemoveChatAction('getscreenshotlq') - gadgetHandler:RemoveChatAction('getscreenshothq') + gadgetHandler:RemoveChatAction("getscreenshot") + gadgetHandler:RemoveChatAction("getscreenshotlq") + gadgetHandler:RemoveChatAction("getscreenshothq") end function gadget:ViewResize() @@ -192,8 +194,12 @@ else function DEC_CHAR(IN) -- Convert 0-63 range to single base64 character local idx = math.floor(IN) + 1 - if idx < 1 then idx = 1 end - if idx > 64 then idx = 64 end + if idx < 1 then + idx = 1 + end + if idx > 64 then + idx = 64 + end return string.sub(ENCODE_CHARS, idx, idx) end @@ -229,7 +235,7 @@ else -- Allow screenshot if: singleplayer OR (requesting player is a spec) OR (I'm a spec) if not isSingleplayer and not requestingSpec and not mySpec then - return -- Silently reject if conditions not met + return -- Silently reject if conditions not met end -- Clamp screenshot width to screen width @@ -258,7 +264,6 @@ else end -- First frame: just prepare textures, don't capture yet if not screenshotInitialized then - -- Create a downscaled texture with FBO support for later reading queueScreenShotTexture = gl.CreateTexture(queueScreenShotWidth, queueScreenShotHeight, { border = false, @@ -305,7 +310,7 @@ else while currentW / targetW > 2 or currentH / targetH > 2 do currentW = math.max(targetW, math.floor(currentW / 2)) currentH = math.max(targetH, math.floor(currentH / 2)) - table.insert(passes, {currentW, currentH}) + table.insert(passes, { currentW, currentH }) end -- Apply multi-pass downscaling @@ -330,12 +335,12 @@ else gl.TexRect(-1, -1, 1, 1) gl.Texture(false) gl.BlendFunc(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- Restore default blending - end) -- Clean up previous intermediate texture (but not the original) + end) -- Clean up previous intermediate texture (but not the original) if sourceTexture ~= fullSizeTexture then gl.DeleteTexture(sourceTexture) end - sourceTexture = intermediateTexture - end + sourceTexture = intermediateTexture + end -- Final pass - flip only if even number of passes (odd already flipped, even needs flip) local needsFlip = (#passes % 2 == 0) @@ -438,17 +443,17 @@ else end if queueScreenShotBroadcastChars >= queueScreenShotCharsPerBroadcast or queueScreenShotH >= queueScreenShotHeight then - local finished = '0' + local finished = "0" if queueScreenShotH >= queueScreenShotHeight then - finished = '1' + finished = "1" end - local data = finished .. ';' .. queueScreenShotWidth .. ';' .. queueScreenShotHeight .. ';' .. queueScreenshotGameframe .. ';' .. table.concat(queueScreenShotPixels) + local data = finished .. ";" .. queueScreenShotWidth .. ";" .. queueScreenShotHeight .. ";" .. queueScreenshotGameframe .. ";" .. table.concat(queueScreenShotPixels) local message = "sd" .. validation .. queueScreenShotRequestingPlayerID .. ";screenshot;" .. VFS.ZlibCompress(data) Spring.SendLuaRulesMsg(message) queueScreenShotBroadcastChars = 0 queueScreenShotPixels = {} data = nil - if finished == '1' then + if finished == "1" then if queueScreenShotTexture then gl.DeleteTexture(queueScreenShotTexture) queueScreenShotTexture = nil @@ -492,7 +497,7 @@ else local thirdSemicolonPos = string.find(data, ";") local screenshotTypeCheck = thirdSemicolonPos and string.sub(data, thirdSemicolonPos + 1, thirdSemicolonPos + 1) or "" - if isAuthorized() and (mySpec or isSingleplayer or screenshotTypeCheck == '1') then + if isAuthorized() and (mySpec or isSingleplayer or screenshotTypeCheck == "1") then PlayerDataBroadcast(myPlayerName, fullMsg) end end @@ -551,9 +556,9 @@ else b2 = b2 < 0 and 0 or (b2 > 1 and 1 or b2) pixelsCount = pixelsCount + 1 - pixels[pixelsCount] = {r1, g1, b1} + pixels[pixelsCount] = { r1, g1, b1 } pixelsCount = pixelsCount + 1 - pixels[pixelsCount] = {r2, g2, b2} + pixels[pixelsCount] = { r2, g2, b2 } end i = i + 4 elseif i + 2 <= strLen then @@ -577,7 +582,7 @@ else b = b < 0 and 0 or (b > 1 and 1 or b) pixelsCount = pixelsCount + 1 - pixels[pixelsCount] = {r, g, b} + pixels[pixelsCount] = { r, g, b } end i = i + 3 else @@ -588,13 +593,13 @@ else end function PlayerDataBroadcast(playerName, msg) - local data = '' + local data = "" local count = 0 local startPos = 0 local msgType for i = 1, string.len(msg) do - if string.sub(msg, i, i) == ';' then + if string.sub(msg, i, i) == ";" then count = count + 1 if count == 1 then startPos = i + 1 @@ -608,17 +613,17 @@ else end if data then - if msgType == 'screenshot' then + if msgType == "screenshot" then local compressedSize = string.len(data) screenshotCompressedBytes = screenshotCompressedBytes + compressedSize data = VFS.ZlibDecompress(data) count = 0 for i = 1, string.len(data) do - if string.sub(data, i, i) == ';' then + if string.sub(data, i, i) == ";" then count = count + 1 if count == 1 then local finished = string.sub(data, 1, i - 1) - screenshotVars.finished = (finished == '1') + screenshotVars.finished = (finished == "1") startPos = i + 1 elseif count == 2 then screenshotVars.width = tonumber(string.sub(data, startPos, i - 1)) @@ -650,20 +655,20 @@ else local minutes = math.floor((screenshotVars.gameframe / 30 / 60)) local seconds = math.floor((screenshotVars.gameframe - ((minutes * 60) * 30)) / 30) if seconds == 0 then - seconds = '00' + seconds = "00" elseif seconds < 10 then - seconds = '0' .. seconds + seconds = "0" .. seconds end screenshotVars.pixels = toPixels(screenshotVars.data) screenshotVars.player = playerName - screenshotVars.filename = playerName .. "_" .. minutes .. '.' .. seconds + screenshotVars.filename = playerName .. "_" .. minutes .. "." .. seconds if Spring.GetModOptions().date_year then - screenshotVars.filename = Spring.GetModOptions().date_year .. "-" .. Spring.GetModOptions().date_month .. "-" .. Spring.GetModOptions().date_day .. "_".. screenshotVars.filename + screenshotVars.filename = Spring.GetModOptions().date_year .. "-" .. Spring.GetModOptions().date_month .. "-" .. Spring.GetModOptions().date_day .. "_" .. screenshotVars.filename else screenshotVars.filename = "_" .. screenshotVars.filename end - screenshotVars.filename = string.gsub(screenshotVars.filename, '[<>:"/\\|?*]', '_') + screenshotVars.filename = string.gsub(screenshotVars.filename, '[<>:"/\\|?*]', "_") -- Get team color for player name local playerList = Spring.GetPlayerList() @@ -678,7 +683,7 @@ else break end end - screenshotVars.teamColor = (r and g and b) and {r, g, b} or {1, 1, 1} + screenshotVars.teamColor = (r and g and b) and { r, g, b } or { 1, 1, 1 } screenshotVars.saveQueued = true screenshotVars.posX = (vsx - screenshotVars.width * uiScale) / 2 screenshotVars.posY = (vsy - screenshotVars.height * uiScale) / 2 @@ -714,7 +719,7 @@ else end font:Begin() - font:Print("\255\160\160\160"..screenshotVars.filename .. '.png', screenshotVars.width - 4, screenshotVars.height + 6.5, 11, "orn") + font:Print("\255\160\160\160" .. screenshotVars.filename .. ".png", screenshotVars.width - 4, screenshotVars.height + 6.5, 11, "orn") local tc = screenshotVars.teamColor font:Print(string.char(255, math.floor(tc[1] * 255), math.floor(tc[2] * 255), math.floor(tc[3] * 255)) .. screenshotVars.player, 4, screenshotVars.height + 6.5, 11, "on") font:End() @@ -738,9 +743,9 @@ else local bottom = 0 - margin local width = screenshotVars.width + margin + margin local height = screenshotVars.height + margin + margin + 17 - local file = 'screenshots/' .. screenshotVars.filename .. '.png' + local file = "screenshots/" .. screenshotVars.filename .. ".png" gl.SaveImage(left, bottom, width, height, file) - Spring.Echo('Screenshot saved to: ' .. file) + Spring.Echo("Screenshot saved to: " .. file) screenshotVars.saveQueued = nil else -- Normal rendering with scaling diff --git a/luarules/gadgets/cmd_give.lua b/luarules/gadgets/cmd_give.lua index 2529cfe519e..a52725ea369 100644 --- a/luarules/gadgets/cmd_give.lua +++ b/luarules/gadgets/cmd_give.lua @@ -2,39 +2,37 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Give Command", - desc = 'Give units (only availible to a select few playernames in testhost only)', - author = 'Floris', - date = 'June 2017', - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true + name = "Give Command", + desc = "Give units (only availible to a select few playernames in testhost only)", + author = "Floris", + date = "June 2017", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end - -- usage: /luarules give 1 armcom 0 -local cmdname = 'give' +local cmdname = "give" local PACKET_HEADER = "$g$" local PACKET_HEADER_LENGTH = string.len(PACKET_HEADER) local PH_B1 = string.byte(PACKET_HEADER, 1) local isSilentUnitGift = {} -for udefID,def in ipairs(UnitDefs) do - if def.modCategories['object'] or def.customParams.objectify then +for udefID, def in ipairs(UnitDefs) do + if def.modCategories["object"] or def.customParams.objectify then isSilentUnitGift[udefID] = true end end -local givenSomethingAtFrame = -1 -- used to fix double spawns when multiple authorized users are present +local givenSomethingAtFrame = -1 -- used to fix double spawns when multiple authorized users are present if gadgetHandler:IsSyncedCode() then - local startPlayers = {} local function checkStartPlayers() - for _,playerID in ipairs(Spring.GetPlayerList()) do -- update player infos - local playername,_,spec = Spring.GetPlayerInfo(playerID,false) + for _, playerID in ipairs(Spring.GetPlayerList()) do -- update player infos + local playername, _, spec = Spring.GetPlayerInfo(playerID, false) if not spec then startPlayers[playername] = true end @@ -48,42 +46,45 @@ if gadgetHandler:IsSyncedCode() then end local function giveunits(amount, unitName, teamID, x, z, playerID, xp) - if not Spring.GetTeamInfo(teamID,false) then - Spring.SendMessageToPlayer(playerID, "TeamID '"..teamID.."' isn't valid") + if not Spring.GetTeamInfo(teamID, false) then + Spring.SendMessageToPlayer(playerID, "TeamID '" .. teamID .. "' isn't valid") return end -- give resources if unitName == "metal" or unitName == "energy" then -- Give resources instead of units Spring.AddTeamResource(teamID, unitName, amount) - Spring.SendMessageToTeam(teamID, "You have been given: "..amount.." "..unitName) - Spring.SendMessageToPlayer(playerID, "You have given team "..teamID..": "..amount.." "..unitName) + Spring.SendMessageToTeam(teamID, "You have been given: " .. amount .. " " .. unitName) + Spring.SendMessageToPlayer(playerID, "You have given team " .. teamID .. ": " .. amount .. " " .. unitName) return end -- give units local unitDefID for udid, unitDef in pairs(UnitDefs) do - if unitDef.name == unitName then unitDefID = udid break end + if unitDef.name == unitName then + unitDefID = udid + break + end end if unitDefID == nil then - Spring.SendMessageToPlayer(playerID, "Unitname '"..unitName.."' isnt valid") + Spring.SendMessageToPlayer(playerID, "Unitname '" .. unitName .. "' isnt valid") return end local succesfullyCreated = 0 - for i=1, amount do + for i = 1, amount do local unitID = Spring.CreateUnit(unitDefID, x, Spring.GetGroundHeight(x, z), z, 0, teamID) if unitID ~= nil then succesfullyCreated = succesfullyCreated + 1 - if xp and type(xp) == 'number' then + if xp and type(xp) == "number" then Spring.SetUnitExperience(unitID, xp) end end end if succesfullyCreated > 0 then if isSilentUnitGift[unitDefID] == nil then - Spring.SendMessageToTeam(teamID, "You have been given: "..succesfullyCreated.." "..unitName) + Spring.SendMessageToTeam(teamID, "You have been given: " .. succesfullyCreated .. " " .. unitName) end - Spring.SendMessageToPlayer(playerID, "You have given team "..teamID..": "..succesfullyCreated.." "..unitName) + Spring.SendMessageToPlayer(playerID, "You have given team " .. teamID .. ": " .. succesfullyCreated .. " " .. unitName) end end @@ -111,13 +112,11 @@ if gadgetHandler:IsSyncedCode() then Spring.SendMessageToPlayer(playerID, "You arent allowed to give units when you have been a player") return end - local params = string.split(msg, ':') + local params = string.split(msg, ":") giveunits(tonumber(params[2]), params[3], tonumber(params[4]), tonumber(params[5]), tonumber(params[6]), playerID, (params[7] and tonumber(params[7]) or nil)) return true end - -else -- UNSYNCED - +else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() @@ -128,15 +127,15 @@ else -- UNSYNCED local function RequestGive(cmd, line, words, playerID) if isAuthorized() and playerID == myPlayerID then - local mx,my = Spring.GetMouseState() - local targettype,pos = Spring.TraceScreenRay(mx,my) - if targettype == 'unit' then - pos = {Spring.GetUnitPosition(pos)} - elseif targettype == 'feature' then - pos = {Spring.GetFeaturePosition(pos)} + local mx, my = Spring.GetMouseState() + local targettype, pos = Spring.TraceScreenRay(mx, my) + if targettype == "unit" then + pos = { Spring.GetUnitPosition(pos) } + elseif targettype == "feature" then + pos = { Spring.GetFeaturePosition(pos) } end - if type(pos) == 'table' and pos[1] ~= nil and pos[3] ~= nil and pos[1] > 0 and pos[3] > 0 and words[1] ~= nil and words[2] ~= nil and words[3] ~= nil then - Spring.SendLuaRulesMsg(PACKET_HEADER..':'..words[1]..':'..words[2]..':'..words[3]..':'..pos[1]..':'..pos[3]..(words[4] ~= nil and ':'..words[4] or '')) + if type(pos) == "table" and pos[1] ~= nil and pos[3] ~= nil and pos[1] > 0 and pos[3] > 0 and words[1] ~= nil and words[2] ~= nil and words[3] ~= nil then + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. words[1] .. ":" .. words[2] .. ":" .. words[3] .. ":" .. pos[1] .. ":" .. pos[3] .. (words[4] ~= nil and ":" .. words[4] or "")) else Spring.SendMessageToPlayer(playerID, "failed to give, check syntax or cursor position") end @@ -150,4 +149,3 @@ else -- UNSYNCED gadgetHandler:RemoveChatAction(cmdname) end end - diff --git a/luarules/gadgets/cmd_idle_players.lua b/luarules/gadgets/cmd_idle_players.lua index df103085fac..e173eb75e29 100644 --- a/luarules/gadgets/cmd_idle_players.lua +++ b/luarules/gadgets/cmd_idle_players.lua @@ -1,4 +1,3 @@ - if Spring.Utilities.Gametype.IsSinglePlayer() then return end @@ -6,15 +5,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Take Manager", - desc = "Handles players AFK and drops", - author = "BrainDamage", - date = "2012", - license = "WTFPL", - layer = 1, - enabled = true - } + return { + name = "Take Manager", + desc = "Handles players AFK and drops", + author = "BrainDamage", + date = "2012", + license = "WTFPL", + layer = 1, + enabled = true, + } end local maxIdleTreshold = 80 --in seconds @@ -28,17 +27,16 @@ local checkQueueTime = 25 -- in seconds -- in chose ingame startpostype, players must place beforehand, so take an action, grace period can be shorter minTimeToTake = Spring.GetModOptions().startpostype == 2 and 1 or minTimeToTake -local AFKMessage = 'idleplayers ' +local AFKMessage = "idleplayers " local AFKMessageSize = #AFKMessage local errorKeys = { - shareAFK = 'shareAFK', - takeEnemies = 'takeEnemies', - nothingToTake = 'nothingToTake', + shareAFK = "shareAFK", + takeEnemies = "takeEnemies", + nothingToTake = "nothingToTake", } if gadgetHandler:IsSyncedCode() then - local playerInfoTable = {} local currentGameFrame = 0 @@ -56,7 +54,7 @@ if gadgetHandler:IsSyncedCode() then local GetTeamList = Spring.GetTeamList local IsCheatingEnabled = Spring.IsCheatingEnabled - local resourceList = {"metal","energy"} + local resourceList = { "metal", "energy" } local gaiaTeamID = Spring.GetGaiaTeamID() local gameSpeed = Game.gameSpeed @@ -83,12 +81,12 @@ if gadgetHandler:IsSyncedCode() then local function updatePlayersInfo() local TeamToRemainingPlayers = {} local aiOwners = {} - for _,teamID in ipairs(GetTeamList()) do --initialize team count - if select(4,GetTeamInfo(teamID,false)) then + for _, teamID in ipairs(GetTeamList()) do --initialize team count + if select(4, GetTeamInfo(teamID, false)) then -- store who hosts that engine ai, team will be controlled if player is present - local aiHost = select(3,GetAIInfo(teamID)) + local aiHost = select(3, GetAIInfo(teamID)) local hostedAis = aiOwners[aiHost] or {} - hostedAis[#hostedAis+1] = teamID + hostedAis[#hostedAis + 1] = teamID aiOwners[aiHost] = hostedAis end -- lua ai and gaia are always controlled @@ -99,8 +97,8 @@ if gadgetHandler:IsSyncedCode() then TeamToRemainingPlayers[teamID] = 0 end end - for _,playerID in ipairs(GetPlayerList()) do -- update player infos - local name,active,spectator,teamID,allyTeamID,ping = GetPlayerInfo(playerID,false) + for _, playerID in ipairs(GetPlayerList()) do -- update player infos + local name, active, spectator, teamID, allyTeamID, ping = GetPlayerInfo(playerID, false) local playerInfoTableEntry = playerInfoTable[playerID] or {} playerInfoTableEntry.connected = active playerInfoTableEntry.player = not spectator @@ -126,8 +124,8 @@ if gadgetHandler:IsSyncedCode() then local hostedAis = aiOwners[playerID] if hostedAis then -- a player only needs to be connected and low enough ping to host an ai - if playerInfoTableEntry.connected and playerInfoTableEntry.pingOK then - for _,aiTeamID in ipairs(hostedAis) do + if playerInfoTableEntry.connected and playerInfoTableEntry.pingOK then + for _, aiTeamID in ipairs(hostedAis) do TeamToRemainingPlayers[aiTeamID] = TeamToRemainingPlayers[aiTeamID] + 1 end end @@ -140,7 +138,7 @@ if gadgetHandler:IsSyncedCode() then for teamID, teamCount in pairs(TeamToRemainingPlayers) do -- set to a public readable value that there's nobody controlling the team - SetTeamRulesParam(teamID, "numActivePlayers", teamCount ) + SetTeamRulesParam(teamID, "numActivePlayers", teamCount) end end @@ -150,7 +148,7 @@ if gadgetHandler:IsSyncedCode() then return -- exclude taking rights from lagged players, etc end local targetTeam = tonumber(words[1]) - local _,_,_,takerID,allyTeamID = GetPlayerInfo(playerID,false) + local _, _, _, takerID, allyTeamID = GetPlayerInfo(playerID, false) local teamList = GetTeamList(allyTeamID) if targetTeam then if select(6, GetTeamInfo(targetTeam, false)) ~= allyTeamID then @@ -158,25 +156,25 @@ if gadgetHandler:IsSyncedCode() then SendToUnsynced("NotifyError", playerID, errorKeys.takeEnemies) return end - teamList = {targetTeam} + teamList = { targetTeam } end local numToTake = 0 - for _,teamID in ipairs(teamList) do + for _, teamID in ipairs(teamList) do local luaAI = GetTeamLuaAI(teamID) local isAiTeam = select(4, GetTeamInfo(teamID, false)) - if not isAiTeam and (not luaAI or luaAI == "") and GetTeamRulesParam(teamID,"numActivePlayers") == 0 then + if not isAiTeam and (not luaAI or luaAI == "") and GetTeamRulesParam(teamID, "numActivePlayers") == 0 then numToTake = numToTake + 1 -- transfer all units local teamUnits = GetTeamUnits(teamID) - for i=1, #teamUnits do + for i = 1, #teamUnits do TransferUnit(teamUnits[i], takerID) end -- send all resources en-block to the taker for _, resourceName in ipairs(resourceList) do local shareAmount = GetTeamResources(teamID, resourceName) - local current,storage,_,_,_,shareSlider = GetTeamResources(takerID, resourceName) - shareAmount = math.min(shareAmount,shareSlider*storage-current) - ShareTeamResource( teamID, takerID, resourceName, shareAmount ) + local current, storage, _, _, _, shareSlider = GetTeamResources(takerID, resourceName) + shareAmount = math.min(shareAmount, shareSlider * storage - current) + ShareTeamResource(teamID, takerID, resourceName, shareAmount) end end end @@ -194,7 +192,6 @@ if gadgetHandler:IsSyncedCode() then gadgetHandler:RemoveChatAction(takeCommand) end - function gadget:GameFrame(currentFrame) currentGameFrame = currentFrame if currentFrame == 10 then @@ -207,18 +204,24 @@ if gadgetHandler:IsSyncedCode() then end function gadget:RecvLuaMsg(msg, playerID) - if #msg < 2 + AFKMessageSize then return end + if #msg < 2 + AFKMessageSize then + return + end local b1, b2, b3 = string.byte(msg, 1, 3) - if b1 ~= vb1 or b2 ~= vb2 or b3 ~= afk_b1 then return end -- invalid message - if msg:sub(3, 2+AFKMessageSize) ~= AFKMessage then return end - local afk = tonumber(msg:sub(2+AFKMessageSize+1)) + if b1 ~= vb1 or b2 ~= vb2 or b3 ~= afk_b1 then + return + end -- invalid message + if msg:sub(3, 2 + AFKMessageSize) ~= AFKMessage then + return + end + local afk = tonumber(msg:sub(2 + AFKMessageSize + 1)) local playerInfoTableEntry = playerInfoTable[playerID] or {} local previousPresent = playerInfoTableEntry.present playerInfoTableEntry.present = afk == 0 playerInfoTable[playerID] = playerInfoTableEntry - local name,active,spectator,teamID,allyTeamID,ping = GetPlayerInfo(playerID, false) + local name, active, spectator, teamID, allyTeamID, ping = GetPlayerInfo(playerID, false) if not spectator and name ~= nil then - if currentGameFrame > minTimeToTake*gameSpeed then + if currentGameFrame > minTimeToTake * gameSpeed then if previousPresent and not playerInfoTableEntry.present then SendToUnsynced("PlayerAFK", allyTeamID, name) elseif not previousPresent and playerInfoTableEntry.present then @@ -230,18 +233,14 @@ if gadgetHandler:IsSyncedCode() then function gadget:AllowResourceTransfer(fromTeamID, toTeamID, restype, level) -- prevent resources to leak to uncontrolled teams - return GetTeamRulesParam(toTeamID,"numActivePlayers") ~= 0 or IsCheatingEnabled() + return GetTeamRulesParam(toTeamID, "numActivePlayers") ~= 0 or IsCheatingEnabled() end function gadget:AllowUnitTransfer(unitID, unitDefID, fromTeamID, toTeamID, capture) -- prevent units to be shared to uncontrolled teams - return capture or GetTeamRulesParam(toTeamID,"numActivePlayers") ~= 0 or IsCheatingEnabled() + return capture or GetTeamRulesParam(toTeamID, "numActivePlayers") ~= 0 or IsCheatingEnabled() end - - -else -- UNSYNCED - - +else -- UNSYNCED local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds local SendLuaRulesMsg = Spring.SendLuaRulesMsg local GetMouseState = Spring.GetMouseState @@ -259,7 +258,7 @@ else -- UNSYNCED local isIdle = true local updateRefreshTime = 1 --in seconds local initialQueueTime - local mx,my = GetMouseState() + local mx, my = GetMouseState() local validation = SYNCED.validationIdle local warningGiven = false local myTeamID = Spring.GetMyTeamID() @@ -276,19 +275,19 @@ else -- UNSYNCED unitBuildSpeedTime[unitDefID] = unitDef.buildTime / unitDef.buildSpeed end - local function onInitialQueueTime(_,_,words) + local function onInitialQueueTime(_, _, words) initialQueueTime = tonumber(words[1]) if initialQueueTime then - initialQueueTime = min(initialQueueTime,maxInitialQueueSlack) + initialQueueTime = min(initialQueueTime, maxInitialQueueSlack) end return true end local function notIdle() - lastActionTime = max(timer,lastActionTime) + lastActionTime = max(timer, lastActionTime) warningGiven = false if isIdle then - SendLuaRulesMsg(validation..AFKMessage.. "0") + SendLuaRulesMsg(validation .. AFKMessage .. "0") isIdle = false end end @@ -304,40 +303,40 @@ else -- UNSYNCED local function wentIdle() if not isIdle then - SendLuaRulesMsg(validation..AFKMessage.. "1") + SendLuaRulesMsg(validation .. AFKMessage .. "1") isIdle = true end end local function notifyError(_, playerID, errorKey) - if Script.LuaUI('GadgetMessageProxy') then - local translationKey = 'ui.idlePlayers.' .. errorKey + if Script.LuaUI("GadgetMessageProxy") then + local translationKey = "ui.idlePlayers." .. errorKey Spring.SendMessageToPlayer(playerID, Script.LuaUI.GadgetMessageProxy(translationKey)) end end local function playerLagging(_, playerName) - if Script.LuaUI('GadgetMessageProxy') then - Spring.Echo( Script.LuaUI.GadgetMessageProxy('ui.idlePlayers.lagging', { name = playerName }) ) + if Script.LuaUI("GadgetMessageProxy") then + Spring.Echo(Script.LuaUI.GadgetMessageProxy("ui.idlePlayers.lagging", { name = playerName })) end end local function playerResumed(_, playerName) - if Script.LuaUI('GadgetMessageProxy') then - Spring.Echo( Script.LuaUI.GadgetMessageProxy('ui.idlePlayers.resumed', { name = playerName }) ) + if Script.LuaUI("GadgetMessageProxy") then + Spring.Echo(Script.LuaUI.GadgetMessageProxy("ui.idlePlayers.resumed", { name = playerName })) end end local function playerAFK(_, allyTeamID, playerName) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.idlePlayers.afk', { name = playerName }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.idlePlayers.afk", { name = playerName }) Spring.SendMessageToAllyTeam(allyTeamID, message) end end local function playerReturned(_, allyTeamID, playerName) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.idlePlayers.returned', { name = playerName }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.idlePlayers.returned", { name = playerName }) Spring.SendMessageToAllyTeam(allyTeamID, message) end end @@ -349,7 +348,7 @@ else -- UNSYNCED gadgetHandler:AddSyncAction("PlayerResumed", playerResumed) gadgetHandler:AddSyncAction("PlayerAFK", playerAFK) gadgetHandler:AddSyncAction("PlayerReturned", playerReturned) - gadgetHandler:AddChatAction("initialQueueTime",onInitialQueueTime) + gadgetHandler:AddChatAction("initialQueueTime", onInitialQueueTime) notIdle() end @@ -360,7 +359,7 @@ else -- UNSYNCED function gadget:Update() local dt = GetLastUpdateSeconds() - timer = timer+dt + timer = timer + dt updateTimer = updateTimer + dt if updateTimer < updateRefreshTime then return @@ -371,13 +370,13 @@ else -- UNSYNCED local teamID = Spring.GetMyTeamID() local myUnits = Spring.GetTeamUnits(teamID) local queueTime = 0 - for i=1, #myUnits do + for i = 1, #myUnits do local unitID = myUnits[i] local thisQueueTime = 0 if isBuilder[GetUnitDefID(unitID)] then local buildQueue = GetRealBuildQueue(unitID) if buildQueue then - for uDID,_ in pairs(buildQueue) do + for uDID, _ in pairs(buildQueue) do thisQueueTime = thisQueueTime + unitBuildSpeedTime[uDID] end end @@ -386,35 +385,35 @@ else -- UNSYNCED queueTime = thisQueueTime end end - lastActionTime = min(max(lastActionTime, timer+queueTime),gameStartTime+maxInitialQueueSlack) --treat this queue as though is was an initial queue + lastActionTime = min(max(lastActionTime, timer + queueTime), gameStartTime + maxInitialQueueSlack) --treat this queue as though is was an initial queue checkQueueTime = nil end -- check if the mouse moved - local x,y = GetMouseState() + local x, y = GetMouseState() if mx ~= x or my ~= y then notIdle() end my = y mx = x - if timer-lastActionTime > maxIdleTreshold-warningPeriod then + if timer - lastActionTime > maxIdleTreshold - warningPeriod then if not warningGiven then warningGiven = true local spectator = Spring.GetSpectatingState() if not spectator then -- check first if user has team players... that could possibly take... and then give warning local teamList = Spring.GetTeamList(myAllyTeamID) - for _,teamID in ipairs(teamList) do + for _, teamID in ipairs(teamList) do local luaAI = Spring.GetTeamLuaAI(teamID) local _, leader, isDead, isAiTeam, side, allyTeamID, incomeMultiplier, customTeamKeys = Spring.GetTeamInfo(teamID, false) - if Script.LuaUI('GadgetMessageProxy') and teamID ~= myTeamID and teamID ~= gaiaTeamID and not isDead and not isAiTeam and (not luaAI or luaAI == "") and Spring.GetTeamRulesParam(teamID, "numActivePlayers") > 0 then - Spring.Echo("\255\255\166\166" .. Script.LuaUI.GadgetMessageProxy('ui.idlePlayers.warning')) + if Script.LuaUI("GadgetMessageProxy") and teamID ~= myTeamID and teamID ~= gaiaTeamID and not isDead and not isAiTeam and (not luaAI or luaAI == "") and Spring.GetTeamRulesParam(teamID, "numActivePlayers") > 0 then + Spring.Echo("\255\255\166\166" .. Script.LuaUI.GadgetMessageProxy("ui.idlePlayers.warning")) break end end end - elseif timer-lastActionTime > maxIdleTreshold then + elseif timer - lastActionTime > maxIdleTreshold then wentIdle() end end @@ -431,5 +430,4 @@ else -- UNSYNCED function gadget:KeyPress() notIdle() end - end diff --git a/luarules/gadgets/cmd_limiter.lua b/luarules/gadgets/cmd_limiter.lua index dbebba85e47..bbe60380837 100644 --- a/luarules/gadgets/cmd_limiter.lua +++ b/luarules/gadgets/cmd_limiter.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "CMD limiter", - desc = "", - author = "Floris", - version = "1", - date = "September 2023", - license = "GNU GPL, v2 or later", - layer = -999999, - enabled = true, + name = "CMD limiter", + desc = "", + author = "Floris", + version = "1", + date = "September 2023", + license = "GNU GPL, v2 or later", + layer = -999999, + enabled = true, } end @@ -29,7 +29,7 @@ local history = {} local totalCmdCount = 0 local totalOffence = 0 local offenceBuckets = {} -local currentTime = 0 -- accumulated real time in seconds +local currentTime = 0 -- accumulated real time in seconds local spec = Spring.GetSpectatingState() function gadget:PlayerChanged(playerID) @@ -37,9 +37,9 @@ function gadget:PlayerChanged(playerID) end function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) - if cmdID < 0 and not spec then -- is build order + if cmdID < 0 and not spec then -- is build order if cmdOpts.shift then - local bucket = mathFloor(currentTime * 30) -- ~30fps granularity buckets + local bucket = mathFloor(currentTime * 30) -- ~30fps granularity buckets if offenceBuckets[bucket] then return true end @@ -58,7 +58,7 @@ function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) Spring.Echo("\255\255\085\085YOU HAVE QUEUED TOO MUCH BUILDINGS IN A SHORT PERIOD, KEEP DOING THIS AND YOU WILL GET AUTO RESIGNED!") end end - totalCmdCount = totalCmdCount - mathFloor(maxCommands/2) -- remove some so user can instantly queue something next without instantly being warned again + totalCmdCount = totalCmdCount - mathFloor(maxCommands / 2) -- remove some so user can instantly queue something next without instantly being warned again return true end end @@ -66,7 +66,6 @@ function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) return false end - function gadget:Update(dt) currentTime = currentTime + dt local cutoffBucket = mathFloor((currentTime - historySeconds) * 30) diff --git a/luarules/gadgets/cmd_luaui_reload.lua b/luarules/gadgets/cmd_luaui_reload.lua index 6c7cd7e64cf..68a557a68fd 100644 --- a/luarules/gadgets/cmd_luaui_reload.lua +++ b/luarules/gadgets/cmd_luaui_reload.lua @@ -1,38 +1,34 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "LuaUI Reload", - desc = "Implements /luarules reloadluaui (because luaui cannot reload itself)", - author = "Bluestone", - date = "Feb 2015", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "LuaUI Reload", + desc = "Implements /luarules reloadluaui (because luaui cannot reload itself)", + author = "Bluestone", + date = "Feb 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -if (gadgetHandler:IsSyncedCode()) then +if gadgetHandler:IsSyncedCode() then return end function LuaUIReload(cmd, line, words, playerID) - if playerID and playerID==Spring.GetMyPlayerID() then - Spring.SendCommands("luaui reload") - end + if playerID and playerID == Spring.GetMyPlayerID() then + Spring.SendCommands("luaui reload") + end end - function gadget:Initialize() - gadgetHandler:AddChatAction('reloadluaui', LuaUIReload, "") + gadgetHandler:AddChatAction("reloadluaui", LuaUIReload, "") end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('reloadluaui') + gadgetHandler:RemoveChatAction("reloadluaui") end - - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luarules/gadgets/cmd_manual_launch.lua b/luarules/gadgets/cmd_manual_launch.lua index 3bce1240cbd..e070b8b5826 100644 --- a/luarules/gadgets/cmd_manual_launch.lua +++ b/luarules/gadgets/cmd_manual_launch.lua @@ -2,10 +2,10 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Manual launch command", - desc = "Replaces manual fire command with a distinct Launch command for manually fired missiles", - date = "December 2021", - layer = 0, + name = "Manual launch command", + desc = "Replaces manual fire command with a distinct Launch command for manually fired missiles", + date = "December 2021", + layer = 0, enabled = true, } end @@ -31,7 +31,7 @@ end local launchCommand = { id = CMD_MANUAL_LAUNCH, action = "manuallaunch", - cursor = 'cursorattack', + cursor = "cursorattack", type = CMDTYPE.ICON_UNIT_OR_MAP, } diff --git a/luarules/gadgets/cmd_mex_denier.lua b/luarules/gadgets/cmd_mex_denier.lua index 05801ed8dfc..8a2a3335b3b 100644 --- a/luarules/gadgets/cmd_mex_denier.lua +++ b/luarules/gadgets/cmd_mex_denier.lua @@ -50,7 +50,7 @@ local function mexExists(spot, allyTeamID, cmdX, cmdZ) for _, unit in ipairs(units) do if isMex[spGetUnitDefID(unit)] then local ux, _, uz = spGetUnitPosition(unit) - if not(ux == cmdX and uz == cmdZ) and spGetUnitAllyTeam(unit) == allyTeamID then -- exclude upgrading mexes + if not (ux == cmdX and uz == cmdZ) and spGetUnitAllyTeam(unit) == allyTeamID then -- exclude upgrading mexes return true end end @@ -87,6 +87,6 @@ function gadget:AllowUnitCreation(unitDefID, _, teamID, x, _, z) if not closestSpot then return false end - + return not mexExists(closestSpot, spGetTeamAllyTeamID(teamID), x, z) end diff --git a/luarules/gadgets/cmd_mouse_pos_broadcast.lua b/luarules/gadgets/cmd_mouse_pos_broadcast.lua index f23785ccf6f..f40ebdc5197 100644 --- a/luarules/gadgets/cmd_mouse_pos_broadcast.lua +++ b/luarules/gadgets/cmd_mouse_pos_broadcast.lua @@ -11,27 +11,26 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Cursor Broadcast", - desc = "Shows the mouse pos of allied players", - author = "jK,TheFatController", - date = "Apr,2009", - license = "GNU GPL, v2 or later", - layer = 0, + name = "Cursor Broadcast", + desc = "Shows the mouse pos of allied players", + author = "jK,TheFatController", + date = "Apr,2009", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end -------------------------------------------------------------------------------- -local numMousePos = 1 -- num mouse pos in 1 packet -local sendPacketEvery = 0.12 -local sendPacketEveryWhenSpec = 0.35 +local numMousePos = 1 -- num mouse pos in 1 packet +local sendPacketEvery = 0.12 +local sendPacketEveryWhenSpec = 0.35 -------------------------------------------------------------------------------- -local PackU16 = VFS.PackU16 -local UnpackU16 = VFS.UnpackU16 - +local PackU16 = VFS.PackU16 +local UnpackU16 = VFS.UnpackU16 if gadgetHandler:IsSyncedCode() then local validation = string.randomString(2) @@ -47,9 +46,13 @@ if gadgetHandler:IsSyncedCode() then local ep1, ep2, ep3, ep4 = string.byte(expectedPrefix, 1, 4) function gadget:RecvLuaMsg(msg, playerID) - if #msg < EXPECTED_PREFIX_LEN then return end + if #msg < EXPECTED_PREFIX_LEN then + return + end local b1, b2, b3, b4 = string.byte(msg, 1, 4) - if b1 ~= ep1 or b2 ~= ep2 or b3 ~= ep3 or b4 ~= ep4 then return end + if b1 ~= ep1 or b2 ~= ep2 or b3 ~= ep3 or b4 ~= ep4 then + return + end local xz = strSub(msg, EXPECTED_PREFIX_LEN + 2) if #xz ~= numMousePos * 4 then return @@ -62,24 +65,20 @@ if gadgetHandler:IsSyncedCode() then SendToUnsynced("mouseBroadcast", playerID, x1, z1, x2, z2, click) return true end - - else - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local GetMouseState = Spring.GetMouseState - local TraceScreenRay = Spring.TraceScreenRay - local SendLuaRulesMsg = Spring.SendLuaRulesMsg - local GetSpectatingState = Spring.GetSpectatingState - local GetPlayerInfo = Spring.GetPlayerInfo - local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local GetMouseState = Spring.GetMouseState + local TraceScreenRay = Spring.TraceScreenRay + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetSpectatingState = Spring.GetSpectatingState + local GetPlayerInfo = Spring.GetPlayerInfo + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds - local floor = math.floor - local abs = math.abs + local floor = math.floor + local abs = math.abs local validation = SYNCED.validationMouse local msgPrefix = "£" .. validation @@ -94,11 +93,11 @@ else local updateTimer = 0 local poshistory = {} - local lastx,lastz = 0,0 + local lastx, lastz = 0, 0 local n = 0 local tableConcat = table.concat - local sendParts = {msgPrefix, false, false, false, false, false} + local sendParts = { msgPrefix, false, false, false, false, false } local function sendPositionPacket(clickChar) sendParts[2] = clickChar @@ -107,8 +106,10 @@ else local xStr = poshistory[i * 2] local zStr = poshistory[i * 2 + 1] if xStr and zStr then - pn = pn + 1; sendParts[pn] = xStr - pn = pn + 1; sendParts[pn] = zStr + pn = pn + 1 + sendParts[pn] = xStr + pn = pn + 1 + sendParts[pn] = zStr end end SendLuaRulesMsg(tableConcat(sendParts, "", 1, pn)) @@ -127,21 +128,21 @@ else spec, _ = Spring.GetSpectatingState() myAllyTeamID = select(5, GetPlayerInfo(myPlayerID, false)) if spec then - saveEach = sendPacketEveryWhenSpec/numMousePos + saveEach = sendPacketEveryWhenSpec / numMousePos updateTick = saveEach end end end - function handleMousePosEvent(_,playerID,x1,z1,x2,z2,click) + function handleMousePosEvent(_, playerID, x1, z1, x2, z2, click) if not spec then - local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID,false) + local _, _, targetSpec, _, allyTeamID = GetPlayerInfo(playerID, false) if targetSpec or allyTeamID ~= myAllyTeamID then return end end if Script.LuaUI("MouseCursorEvent") then - Script.LuaUI.MouseCursorEvent(playerID,x1,z1,x2,z2,click) + Script.LuaUI.MouseCursorEvent(playerID, x1, z1, x2, z2, click) end end @@ -149,14 +150,14 @@ else updateTimer = updateTimer + GetLastUpdateSeconds() if updateTimer > updateTick then - local mx,my = GetMouseState() - local _,pos = TraceScreenRay(mx,my,true) + local mx, my = GetMouseState() + local _, pos = TraceScreenRay(mx, my, true) - if pos and (n == 1 or pos[1] ~= lastx or pos[3] ~= lastz) then -- only record change in position unless packet is already being instigated previous update tick + if pos and (n == 1 or pos[1] ~= lastx or pos[3] ~= lastz) then -- only record change in position unless packet is already being instigated previous update tick local historyIdx = (n + 1) * 2 - poshistory[historyIdx] = PackU16(floor(pos[1])) + poshistory[historyIdx] = PackU16(floor(pos[1])) poshistory[historyIdx + 1] = PackU16(floor(pos[3])) - lastx,lastz = pos[1],pos[3] + lastx, lastz = pos[1], pos[3] n = n + 1 end updateTick = updateTimer + saveEach @@ -170,29 +171,26 @@ else end end - - function gadget:MousePress(x,y,button) + function gadget:MousePress(x, y, button) if button == 2 then return end - local mx,my = GetMouseState() - local _,pos = TraceScreenRay(mx,my,true) + local mx, my = GetMouseState() + local _, pos = TraceScreenRay(mx, my, true) if not pos then return end if abs(pos[1] - lastx) > 300 or abs(pos[3] - lastz) > 300 then - for i=0,5 do - local posindex = i%2 == 0 and 1 or 3 + for i = 0, 5 do + local posindex = i % 2 == 0 and 1 or 3 poshistory[i] = PackU16(floor(pos[posindex])) end - lastx,lastz = pos[1],pos[3] + lastx, lastz = pos[1], pos[3] updateTick = saveEach updateTimer = 0 n = 0 sendPositionPacket("0") end end - end - diff --git a/luarules/gadgets/cmd_no_enemy_guard.lua b/luarules/gadgets/cmd_no_enemy_guard.lua index 24a9a1aa9ee..1df5d0bab25 100644 --- a/luarules/gadgets/cmd_no_enemy_guard.lua +++ b/luarules/gadgets/cmd_no_enemy_guard.lua @@ -6,36 +6,36 @@ local spAreTeamsAllied = Spring.AreTeamsAllied local spGetUnitTeam = Spring.GetUnitTeam function gadget:GetInfo() - return { - name = "No Enemy Guard", - desc = "Block 'CMD_GUARD' command for enemy units", - author = "uBdead", - date = "May 2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "No Enemy Guard", + desc = "Block 'CMD_GUARD' command for enemy units", + author = "uBdead", + date = "May 2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end function gadget:Initialize() - gadgetHandler:RegisterAllowCommand(CMD_GUARD) + gadgetHandler:RegisterAllowCommand(CMD_GUARD) end function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) - local targetUnitID = cmdParams[1] - if not targetUnitID then - return true -- No target unit, allow the command - end + local targetUnitID = cmdParams[1] + if not targetUnitID then + return true -- No target unit, allow the command + end - local targetTeamID = spGetUnitTeam(targetUnitID) + local targetTeamID = spGetUnitTeam(targetUnitID) - if targetTeamID == nil then - return true -- Target unit doesn't exist, allow the command - end + if targetTeamID == nil then + return true -- Target unit doesn't exist, allow the command + end - return spAreTeamsAllied(unitTeam, targetTeamID) + return spAreTeamsAllied(unitTeam, targetTeamID) end diff --git a/luarules/gadgets/cmd_onoffdesc.lua b/luarules/gadgets/cmd_onoffdesc.lua index c9b9a2de28d..3d9cf4eb38c 100644 --- a/luarules/gadgets/cmd_onoffdesc.lua +++ b/luarules/gadgets/cmd_onoffdesc.lua @@ -5,19 +5,19 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "On/Off descriptions", - desc = "Replaces On/Off toggle with description", - author = "Doo", - date = "09 January 2018", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "On/Off descriptions", + desc = "Replaces On/Off toggle with description", + author = "Doo", + date = "09 January 2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local spEditUnitCmdDesc = Spring.EditUnitCmdDesc -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc VFS.Include("luarules/configs/onoffdescs.lua") onoffNames = {} @@ -31,11 +31,11 @@ end function gadget:UnitCreated(unitID, unitDefID) if onoffNames[unitDefID] then - local cmdDesc = spFindUnitCmdDesc(unitID, CMD.ONOFF) - if cmdDesc then - spEditUnitCmdDesc(unitID, cmdDesc, cmdArray[onoffNames[unitDefID]]) - end + local cmdDesc = spFindUnitCmdDesc(unitID, CMD.ONOFF) + if cmdDesc then + spEditUnitCmdDesc(unitID, cmdDesc, cmdArray[onoffNames[unitDefID]]) end + end end function gadget:Initialize() @@ -43,4 +43,4 @@ function gadget:Initialize() local unitDefID = Spring.GetUnitDefID(unitID) gadget:UnitCreated(unitID, unitDefID) end -end \ No newline at end of file +end diff --git a/luarules/gadgets/cmd_paused_is_paused.lua b/luarules/gadgets/cmd_paused_is_paused.lua index a3d24b84dd5..9cb72e912fb 100644 --- a/luarules/gadgets/cmd_paused_is_paused.lua +++ b/luarules/gadgets/cmd_paused_is_paused.lua @@ -10,12 +10,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Paused is paused", - desc = "Prevent commands being queued while paused", - author = "Floris", - date = "May 2023", - license = "GNU GPL, v2 or later", - layer = 0, + name = "Paused is paused", + desc = "Prevent commands being queued while paused", + author = "Floris", + date = "May 2023", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end diff --git a/luarules/gadgets/cmd_place_target_on_ground.lua b/luarules/gadgets/cmd_place_target_on_ground.lua index 55a45a2f2a1..88a88d3a15e 100644 --- a/luarules/gadgets/cmd_place_target_on_ground.lua +++ b/luarules/gadgets/cmd_place_target_on_ground.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Place Target On Ground', - desc = 'Make some units, like nukes, target ground instead of units', - author = 'Itanthias, Chronographer', - date = 'August 2023', - license = 'GNU GPL, v2 or later', - layer = -12, - enabled = true + name = "Place Target On Ground", + desc = "Make some units, like nukes, target ground instead of units", + author = "Itanthias, Chronographer", + date = "August 2023", + license = "GNU GPL, v2 or later", + layer = -12, + enabled = true, } end @@ -19,7 +19,7 @@ end local place_target_on_ground = {} for uDefID, uDef in pairs(UnitDefs) do local weapons = uDef.weapons - for i=1, #weapons do + for i = 1, #weapons do local wDef = WeaponDefs[weapons[i].weaponDef] if wDef.customParams then if wDef.customParams.place_target_on_ground then @@ -41,15 +41,15 @@ local mapz = Game.mapSizeZ local CMD_ATTACK = CMD.ATTACK local CMD_UNIT_SET_TARGET = GameCMD.UNIT_SET_TARGET local CMD_UNIT_SET_TARGET_NO_GROUND = GameCMD.UNIT_SET_TARGET_NO_GROUND -local CMD_UNIT_SET_TARGET_RECTANGLE = GameCMD.UNIT_SET_TARGET_RECTANGLE +local CMD_UNIT_SET_TARGET_RECTANGLE = GameCMD.UNIT_SET_TARGET_RECTANGLE local CMDTYPE_ICON_MAP = CMDTYPE.ICON_MAP -local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs +local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs local hasVoid = false if success and type(mapinfo) == "table" and mapinfo.voidwater then - hasVoid = true + hasVoid = true elseif not success then - Spring.Echo("Place Target On Ground failed to load the mapinfo.lua") + Spring.Echo("Place Target On Ground failed to load the mapinfo.lua") end function gadget:Initialize() @@ -61,46 +61,46 @@ function gadget:Initialize() end function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if place_target_on_ground[unitDefID] then + if place_target_on_ground[unitDefID] then local cmdDesc - local cmdIdx = spFindUnitCmdDesc(unitID, CMD_ATTACK) - if cmdIdx then - cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - if cmdDesc then - cmdDesc.type = CMDTYPE_ICON_MAP -- Forces attack commands to accept (x,y,z) spatial coordinates, and not allow unitIDs as valid parameters. + local cmdIdx = spFindUnitCmdDesc(unitID, CMD_ATTACK) + if cmdIdx then + cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + if cmdDesc then + cmdDesc.type = CMDTYPE_ICON_MAP -- Forces attack commands to accept (x,y,z) spatial coordinates, and not allow unitIDs as valid parameters. -- HOWEVER, this does not seem to propogate to default right click commands. - -- so the below AllowCommand function checks for any attacks just targeting a unitID and places the command on the floor. - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - end - end + -- so the below AllowCommand function checks for any attacks just targeting a unitID and places the command on the floor. + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + end + end cmdIdx = spFindUnitCmdDesc(unitID, CMD_UNIT_SET_TARGET) - if cmdIdx then - cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - if cmdDesc then - cmdDesc.type = CMDTYPE_ICON_MAP - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - end - end + if cmdIdx then + cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + if cmdDesc then + cmdDesc.type = CMDTYPE_ICON_MAP + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + end + end cmdIdx = spFindUnitCmdDesc(unitID, CMD_UNIT_SET_TARGET_NO_GROUND) - if cmdIdx then - cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - if cmdDesc then - cmdDesc.type = CMDTYPE_ICON_MAP - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - end - end + if cmdIdx then + cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + if cmdDesc then + cmdDesc.type = CMDTYPE_ICON_MAP + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + end + end cmdIdx = spFindUnitCmdDesc(unitID, CMD_UNIT_SET_TARGET_RECTANGLE) - if cmdIdx then - cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - if cmdDesc then - cmdDesc.type = CMDTYPE_ICON_MAP - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - end - end - end + if cmdIdx then + cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + if cmdDesc then + cmdDesc.type = CMDTYPE_ICON_MAP + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + end + end + end end function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced) @@ -108,19 +108,19 @@ function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdO -- usually from user side DefaultCommand widget function if place_target_on_ground[unitDefID] then -- no need to check cmdID due to RegisterAllowCommand above - if hasVoid and (#cmdParams == 3 or #cmdParams == 4) then - local x,y,z = cmdParams[1], cmdParams[2], cmdParams[3] - if x ~= nil and (y < 0) and ( x >= 0 and x <= mapx ) and (z >= 0 and z <= mapz) then + if hasVoid and (#cmdParams == 3 or #cmdParams == 4) then + local x, y, z = cmdParams[1], cmdParams[2], cmdParams[3] + if x ~= nil and (y < 0) and (x >= 0 and x <= mapx) and (z >= 0 and z <= mapz) then return false end - elseif (#cmdParams == 1) then -- give an attack command at the ground, and deny the intial attack unit command + elseif #cmdParams == 1 then -- give an attack command at the ground, and deny the intial attack unit command local basePointX, basePointY, basePointZ = spGetUnitPosition(cmdParams[1]) if basePointX and basePointZ then local yGround = spGetGroundHeight(basePointX, basePointZ) if hasVoid and (yGround < 0) then return false - end - spGiveOrderToUnit(unitID, cmdID, {basePointX, yGround, basePointZ}, cmdOptions) + end + spGiveOrderToUnit(unitID, cmdID, { basePointX, yGround, basePointZ }, cmdOptions) return false end end diff --git a/luarules/gadgets/cmd_remove_stop.lua b/luarules/gadgets/cmd_remove_stop.lua index c0cc41aeb4a..2e8dc22cd4a 100644 --- a/luarules/gadgets/cmd_remove_stop.lua +++ b/luarules/gadgets/cmd_remove_stop.lua @@ -6,18 +6,18 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Remove Stop", - desc = "Removes stop from structures which have no need for the command.", - author = "GoogleFrog", - date = "3 April 2015", - license = "GNU GPL, v2 or later", - layer = 0, + name = "Remove Stop", + desc = "Removes stop from structures which have no need for the command.", + author = "GoogleFrog", + date = "3 April 2015", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end local spRemoveUnitCmdDesc = Spring.RemoveUnitCmdDesc -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc local CMD_STOP = CMD.STOP local removeCommands = { @@ -36,7 +36,7 @@ for unitDefID = 1, #UnitDefs do end function gadget:AllowCommand_GetWantedCommand() - return {[CMD_STOP] = true} + return { [CMD_STOP] = true } end function gadget:AllowCommand_GetWantedUnitDefID() diff --git a/luarules/gadgets/cmd_remove_wait.lua b/luarules/gadgets/cmd_remove_wait.lua index 00f0bccedf3..707ac6db32f 100644 --- a/luarules/gadgets/cmd_remove_wait.lua +++ b/luarules/gadgets/cmd_remove_wait.lua @@ -6,18 +6,18 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Remove Wait", - desc = "Removes wait from structures which have no need for the command.", - author = "GoogleFrog", - date = "3 April 2015", - license = "GNU GPL, v2 or later", - layer = 0, + name = "Remove Wait", + desc = "Removes wait from structures which have no need for the command.", + author = "GoogleFrog", + date = "3 April 2015", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end local spRemoveUnitCmdDesc = Spring.RemoveUnitCmdDesc -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc local CMD_WAIT = CMD.WAIT local removeCommands = { @@ -36,7 +36,7 @@ for unitDefID = 1, #UnitDefs do end function gadget:AllowCommand_GetWantedCommand() - return {[CMD_WAIT] = true} + return { [CMD_WAIT] = true } end function gadget:AllowCommand_GetWantedUnitDefID() diff --git a/luarules/gadgets/cmd_selected_units.lua b/luarules/gadgets/cmd_selected_units.lua index ae16ed2a312..99e06364be5 100644 --- a/luarules/gadgets/cmd_selected_units.lua +++ b/luarules/gadgets/cmd_selected_units.lua @@ -1,28 +1,26 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { name = "Ally Selected Units", desc = "sends your selected units to others", - author = "very_bad_soldier", - date = "August 1, 2008", - license = "GNU GPL v2", - layer = 0, - enabled = true + author = "very_bad_soldier", + date = "August 1, 2008", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end local updateDelay = 0.25 local unitLimitPerFrame = 400 -- controls how many units will be send per frame local fullSelectionUpdateInt = 0 -- refresh full selection info once in n seconds, 0 = disabled -local minZlibSize = 130 --minimum size threshold of msg to use zlib (msg smaller than this will not be compressed before sending) +local minZlibSize = 130 --minimum size threshold of msg to use zlib (msg smaller than this will not be compressed before sending) local HEADER_SEL_UNCOMPRESSED = "cosu" local HEADER_SEL_COMPRESSED = "cosc" local HEADER_LENGTH = string.len(HEADER_SEL_UNCOMPRESSED) - if gadgetHandler:IsSyncedCode() then local validation = string.randomString(2) _G.validationSelunits = validation @@ -33,13 +31,19 @@ if gadgetHandler:IsSyncedCode() then -- First 3 chars shared: 'c'=99, 'o'=111, 's'=115; 4th differs: 'u'=117 vs 'c'=99 local h3, h4, h5 = string.byte(HEADER_SEL_UNCOMPRESSED, 1, 3) -- 99, 111, 115 local hu6 = string.byte(HEADER_SEL_UNCOMPRESSED, 4) -- 117 ('u') - local hc6 = string.byte(HEADER_SEL_COMPRESSED, 4) -- 99 ('c') + local hc6 = string.byte(HEADER_SEL_COMPRESSED, 4) -- 99 ('c') function gadget:RecvLuaMsg(inMsg, playerID) - if #inMsg < HEADER_LENGTH + 2 then return end + if #inMsg < HEADER_LENGTH + 2 then + return + end local b1, b2, b3, b4, b5, b6 = string.byte(inMsg, 1, 6) - if b1 ~= vb1 or b2 ~= vb2 or b3 ~= h3 or b4 ~= h4 or b5 ~= h5 then return end - if b6 ~= hu6 and b6 ~= hc6 then return end + if b1 ~= vb1 or b2 ~= vb2 or b3 ~= h3 or b4 ~= h4 or b5 ~= h5 then + return + end + if b6 ~= hu6 and b6 ~= hc6 then + return + end SendToUnsynced("selectionUpdate", playerID, inMsg:sub(7), b6 == hc6) return true end @@ -97,20 +101,20 @@ else end end - function handleSelectionUpdateEvent(_,playerID,msg,compressed) + function handleSelectionUpdateEvent(_, playerID, msg, compressed) local spec = GetSpectatingState() if not spec then - local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID,false) + local _, _, targetSpec, _, allyTeamID = GetPlayerInfo(playerID, false) if targetSpec or allyTeamID ~= myAllyTeamID then return end end - if compressed then -- we have a compressed msg here - msg = ZlibDeCompress( msg ) + if compressed then -- we have a compressed msg here + msg = ZlibDeCompress(msg) end - local counts = UnpackU16( msg, 1, 2 ) + local counts = UnpackU16(msg, 1, 2) if counts[1] == counts[2] and counts[1] == 0xffff then --clear all if LuaUICallIn("SelectedUnitsClear") then @@ -123,11 +127,11 @@ else local remUnits if addCount > 0 then - addUnits = UnpackU16( msg, 5, addCount ) + addUnits = UnpackU16(msg, 5, addCount) end if removeCount > 0 then - remUnits = UnpackU16( msg, 5 + addCount * 2, removeCount ) + remUnits = UnpackU16(msg, 5 + addCount * 2, removeCount) end if LuaUICallIn("SelectedUnitsBatchUpdate") then @@ -136,30 +140,30 @@ else end if removeCount > 0 and LuaUICallIn("SelectedUnitsRemove") then - for i=1,removeCount do - LuaUI.SelectedUnitsRemove(playerID,remUnits[i]) + for i = 1, removeCount do + LuaUI.SelectedUnitsRemove(playerID, remUnits[i]) end end if addCount > 0 and LuaUICallIn("SelectedUnitsAdd") then - for i=1,addCount do - LuaUI.SelectedUnitsAdd(playerID,addUnits[i]) + for i = 1, addCount do + LuaUI.SelectedUnitsAdd(playerID, addUnits[i]) end end end end - function gadget:CommandsChanged( id, params, options ) + function gadget:CommandsChanged(id, params, options) sendSelectedUnits() end - function gadget:UnitDestroyed(unitID, attacker ) - myLastSelectedUnits[ unitID ] = nil + function gadget:UnitDestroyed(unitID, attacker) + myLastSelectedUnits[unitID] = nil end function gadget:Update() local deltaTime = GetLastUpdateSeconds() - if time+deltaTime == time then + if time + deltaTime == time then time = 0 --prevent floating point errors end time = time + deltaTime @@ -187,11 +191,11 @@ else --FORMAT: compressed msg "cosc{[addCount][removeCount]([unitIdToAdd]*)([unitIdToRemove]*)}" the part in curly braces has to be zlib compressed --FORMAT clear all: "cosu[0xffffff][0xffffff]" --magic value. impossible to have as normal message - function sendUnitsMsg( msg ) + function sendUnitsMsg(msg) local finalMsg = msg local header = HEADER_SEL_UNCOMPRESSED if ZlibCompress and msg:len() >= minZlibSize then - finalMsg = ZlibCompress( finalMsg ) + finalMsg = ZlibCompress(finalMsg) header = HEADER_SEL_COMPRESSED end @@ -210,13 +214,13 @@ else return end - for i=1,unitCount do + for i = 1, unitCount do selectedNowMap[units[i]] = true end local addPacked = addPackedBuffer local addCount = 0 - for i=1,unitCount do + for i = 1, unitCount do local unitId = units[i] --check if unit is new this time if not myLastSelectedUnits[unitId] then @@ -247,12 +251,12 @@ else end --remove not anymore selected units - for i=1,remCount do + for i = 1, remCount do myLastSelectedUnits[remUnitIDs[i]] = nil remUnitIDs[i] = nil end - for i=1,unitCount do + for i = 1, unitCount do selectedNowMap[units[i]] = nil end @@ -264,13 +268,13 @@ else -- More efficient to rebase state than send many removals. sendUnitsMsg(CLEAR_ALL_MSG) myLastSelectedUnits = {} - for i=1,unitCount do + for i = 1, unitCount do local unitId = units[i] myLastSelectedUnits[unitId] = true end addCount = unitCount - for i=1,unitCount do + for i = 1, unitCount do addPacked[i] = PackUnitIDCached(units[i]) end remCount = 0 diff --git a/luarules/gadgets/cmd_sendcommand.lua b/luarules/gadgets/cmd_sendcommand.lua index 9febd425a9c..0168819e126 100644 --- a/luarules/gadgets/cmd_sendcommand.lua +++ b/luarules/gadgets/cmd_sendcommand.lua @@ -1,31 +1,29 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Send Command", - desc = 'execute a console command for any player', - author = 'Floris', - date = 'march 2021', - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true + name = "Send Command", + desc = "execute a console command for any player", + author = "Floris", + date = "march 2021", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end -- usage: /luarules cmd playername disticon 900 -local cmdname = 'cmd' +local cmdname = "cmd" local PACKET_HEADER = "$c$" local PACKET_HEADER_LENGTH = string.len(PACKET_HEADER) local PH_B1 = string.byte(PACKET_HEADER, 1) if gadgetHandler:IsSyncedCode() then - local startPlayers = {} function checkStartPlayers() - for _,playerID in ipairs(Spring.GetPlayerList()) do -- update player infos - local playername,_,spec = Spring.GetPlayerInfo(playerID,false) + for _, playerID in ipairs(Spring.GetPlayerList()) do -- update player infos + local playername, _, spec = Spring.GetPlayerInfo(playerID, false) if not spec then startPlayers[playername] = true end @@ -58,13 +56,11 @@ if gadgetHandler:IsSyncedCode() then Spring.SendMessageToPlayer(playerID, "You arent allowed to send commands when you have been a player") return end - local params = string.split(msg, ':') + local params = string.split(msg, ":") SendToUnsynced("execCmd", params[2], params[3]) return true end - -else -- UNSYNCED - +else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() @@ -74,7 +70,7 @@ else -- UNSYNCED end local function execCmd(_, playername, cmd) - if playername == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) or playername == '*' then + if playername == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) or playername == "*" then Spring.SendCommands(cmd) end end @@ -86,11 +82,11 @@ else -- UNSYNCED if #words > 2 then for k, v in ipairs(words) do if k >= 3 then - command = command .. ' ' .. v + command = command .. " " .. v end end end - Spring.SendLuaRulesMsg(PACKET_HEADER..':'..words[1]..':'..command) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. words[1] .. ":" .. command) else Spring.SendMessageToPlayer(playerID, "failed to execute, check syntax") end @@ -106,4 +102,3 @@ else -- UNSYNCED gadgetHandler:AddSyncAction("execCmd") end end - diff --git a/luarules/gadgets/cmd_undo.lua b/luarules/gadgets/cmd_undo.lua index 6aa693ec084..c10a5bf8ab8 100644 --- a/luarules/gadgets/cmd_undo.lua +++ b/luarules/gadgets/cmd_undo.lua @@ -10,13 +10,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Undo Self Destruction Havoc", - desc = 'Restore selfdestructed units and the ones those killed (only availible to a select few playernames)', - author = 'Floris', - date = 'June 2017', - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true + name = "Undo Self Destruction Havoc", + desc = "Restore selfdestructed units and the ones those killed (only availible to a select few playernames)", + author = "Floris", + date = "June 2017", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end @@ -25,11 +25,11 @@ end -- only works when being spectator and you werent a player before -- only availible to a select few playernames -local cmdname = 'undo' +local cmdname = "undo" local rememberGameframes = 9000 -- 9000 -> 5 minutes local enableAlertEchos = false -local nullifyFriendlySelfdDgunDamage = false -- only used for big events +local nullifyFriendlySelfdDgunDamage = false -- only used for big events local mathFloor = math.floor @@ -59,7 +59,7 @@ if gadgetHandler:IsSyncedCode() then local dgunDef = {} for weaponDefID, weaponDef in ipairs(WeaponDefs) do - if weaponDef.type == 'DGun' then + if weaponDef.type == "DGun" then dgunDef[weaponDefID] = true end end @@ -125,11 +125,11 @@ if gadgetHandler:IsSyncedCode() then local function restoreUnits(teamID, seconds, toTeamID, playerID) if not Spring.GetTeamInfo(toTeamID, false) then - Spring.SendMessageToPlayer(playerID, 'Invalid receiving teamID: ' .. tostring(toTeamID)) + Spring.SendMessageToPlayer(playerID, "Invalid receiving teamID: " .. tostring(toTeamID)) return end if teamSelfdUnits[teamID] == nil then - Spring.SendMessageToPlayer(playerID, 'There is no self destruct unit history for team ' .. teamID) + Spring.SendMessageToPlayer(playerID, "There is no self destruct unit history for team " .. teamID) return end @@ -176,7 +176,7 @@ if gadgetHandler:IsSyncedCode() then jobs = {} sceduledRestoreHeightmap[scheduleHeightmapFrame] = jobs end - jobs[#jobs + 1] = {unitX - radius, unitZ - radius, unitX + radius, unitZ + radius} + jobs[#jobs + 1] = { unitX - radius, unitZ - radius, unitX + radius, unitZ + radius } end end end @@ -189,16 +189,20 @@ if gadgetHandler:IsSyncedCode() then end teamSelfdUnits[teamID] = leftovers - Spring.SendMessageToPlayer(playerID, 'Restored: ' .. numRestoredUnits .. ' units') + Spring.SendMessageToPlayer(playerID, "Restored: " .. numRestoredUnits .. " units") end function gadget:RecvLuaMsg(msg, playerID) - if #msg < 4 then return end + if #msg < 4 then + return + end local b1, b2, b3, b4 = string.byte(msg, 1, 4) - if b1 ~= un1 or b2 ~= un2 or b3 ~= vb1 or b4 ~= vb2 then return end + if b1 ~= un1 or b2 ~= un2 or b3 ~= vb1 or b4 ~= vb2 then + return + end local accountID = Spring.Utilities.GetAccountID(playerID) if _G.permissions.undo[accountID] then - local params = string.split(msg, ':') + local params = string.split(msg, ":") restoreUnits(tonumber(params[2]), tonumber(params[3]), tonumber(params[4]), playerID) return true end @@ -225,44 +229,44 @@ if gadgetHandler:IsSyncedCode() then if isDgun or isSelfD or hasNoEnemy then if enableAlertEchos then local _, playerID, _, victimIsAi = Spring.GetTeamInfo(unitTeam, false) - local victimName = Spring.GetPlayerInfo(playerID, false) or '---' + local victimName = Spring.GetPlayerInfo(playerID, false) or "---" if victimIsAi then - local aiName = Spring.GetGameRulesParam('ainame_' .. unitTeam) + local aiName = Spring.GetGameRulesParam("ainame_" .. unitTeam) if aiName then - victimName = aiName .. ' (AI)' + victimName = aiName .. " (AI)" end end local _, attackerPlayerID, _, attackerIsAi = Spring.GetTeamInfo(attackerTeam, false) - local attackerName = Spring.GetPlayerInfo(attackerPlayerID, false) or '---' + local attackerName = Spring.GetPlayerInfo(attackerPlayerID, false) or "---" if attackerIsAi then - local aiName = Spring.GetGameRulesParam('ainame_' .. attackerTeam) + local aiName = Spring.GetGameRulesParam("ainame_" .. attackerTeam) if aiName then - attackerName = aiName .. ' (AI)' + attackerName = aiName .. " (AI)" end end local x, _, z = Spring.GetUnitPosition(unitID) local unitName = UnitDefs[unitDefID].name - local atPosition = (x and z) and (' (pos: ' .. mathFloor(mathFloor(x / 100) * 100) .. ', ' .. mathFloor(mathFloor(z / 100) * 100) .. ')') or '' + local atPosition = (x and z) and (" (pos: " .. mathFloor(mathFloor(x / 100) * 100) .. ", " .. mathFloor(mathFloor(z / 100) * 100) .. ")") or "" if isDgun then if victimName == attackerName then - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. ' tried to DGUN their own ' .. unitName .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to DGUN their own " .. unitName .. atPosition) else - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. " tried to DGUN " .. victimName .. "'s " .. unitName .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to DGUN " .. victimName .. "'s " .. unitName .. atPosition) end elseif isSelfD then if victimName == attackerName then - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. ' tried to damage their own ' .. unitName .. ' (via a SELFD)' .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to damage their own " .. unitName .. " (via a SELFD)" .. atPosition) else - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. " tried to damage " .. victimName .. "'s " .. unitName .. ' (via a SELFD)' .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to damage " .. victimName .. "'s " .. unitName .. " (via a SELFD)" .. atPosition) end else if victimName == attackerName then - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. ' tried to damage their own ' .. unitName .. ' without nearby enemy' .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to damage their own " .. unitName .. " without nearby enemy" .. atPosition) else - notify('\255\255\100\100 -- ALERT -- ' .. attackerName .. " tried to damage " .. victimName .. "'s " .. unitName .. ' without nearby enemy' .. atPosition) + notify("\255\255\100\100 -- ALERT -- " .. attackerName .. " tried to damage " .. victimName .. "'s " .. unitName .. " without nearby enemy" .. atPosition) end end end @@ -292,7 +296,7 @@ if gadgetHandler:IsSyncedCode() then local health, maxHealth = Spring.GetUnitHealth(unitID) local buildFacing = Spring.GetUnitBuildFacing(unitID) local dx, dy, dz = Spring.GetUnitDirection(unitID) - local originalTeamID = teamID -- capture before potential overwrite below + local originalTeamID = teamID -- capture before potential overwrite below if attackerID ~= nil then teamID = attackerTeamID or Spring.GetUnitTeam(attackerID) or teamID health = maxHealth -- health only applicable to actual selfd units @@ -301,7 +305,7 @@ if gadgetHandler:IsSyncedCode() then if teamSelfdUnits[teamID] == nil then teamSelfdUnits[teamID] = {} end - teamSelfdUnits[teamID][unitID] = {Spring.GetGameFrame(), unitDefID, health, ux, uy, uz, buildFacing, dx, dy, dz, originalTeamID} + teamSelfdUnits[teamID][unitID] = { Spring.GetGameFrame(), unitDefID, health, ux, uy, uz, buildFacing, dx, dy, dz, originalTeamID } end selfdCmdUnits[unitID] = nil @@ -337,9 +341,7 @@ if gadgetHandler:IsSyncedCode() then end end end - else -- UNSYNCED - local validation = SYNCED.validationUndo function gadget:Initialize() @@ -356,7 +358,7 @@ else -- UNSYNCED if words[3] ~= nil then targetTeamID = words[3] end - Spring.SendLuaRulesMsg('un' .. validation .. ':' .. words[1] .. ':' .. words[2] .. ':' .. targetTeamID) + Spring.SendLuaRulesMsg("un" .. validation .. ":" .. words[1] .. ":" .. words[2] .. ":" .. targetTeamID) end end end diff --git a/luarules/gadgets/cus_gl4.lua b/luarules/gadgets/cus_gl4.lua index e7d8376c48f..212092f3ba5 100644 --- a/luarules/gadgets/cus_gl4.lua +++ b/luarules/gadgets/cus_gl4.lua @@ -2,15 +2,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "CUS GL4", - desc = "Implements CustomUnitShaders for GL4 rendering pipeline", + name = "CUS GL4", + desc = "Implements CustomUnitShaders for GL4 rendering pipeline", version = "0.5", - author = "ivand, Beherith", - date = "20220310", + author = "ivand, Beherith", + date = "20220310", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - depends = {'gl4'}, + layer = 0, + enabled = true, + depends = { "gl4" }, } end @@ -21,201 +21,196 @@ end -- Beheriths notes -- Bins / separate VAO and IBO : - -- Flags (drawpass): - -- forward opaque + reflections - -- deferred opaque, all units - -- shadows. Now all units need their vertex displacement for efficient shadows, so better to bind a separate shader for this - -- Shaders / shaderconfig via bitoptions uniform: - -- Features - -- simplefeatures: metallic nonwrecks - -- treepbr: Real Trees with proper tex2 - -- tree: Shitty Trees - -- wrecks: BAR wrecks - -- Units - -- tanks : -- these are units actually - -- barunits : - -- raptors - -- scavengers - -- - - -- Cloakedunits for alpha - -- Underconstructionunits - - - -- Textures: - -- arm/cor - -- 10x raptorsets - -- 5x featuresets - -- scavengers? - -- Objects (the VAO) - -- 8x 8x 16x -> 8192 different VAOs? damn thats horrible - -- Note that Units and Features cant share a VAO! - - -- Can we assume that all BAR units wont have transparency? - -- if yes then we can say that forward and deferred can share! - -- https://stackoverflow.com/questions/8923174/opengl-vao-best-practices - -- Some shader optimization info: https://community.khronos.org/t/profiling-optimizing-a-fragment-shader-in-linux/105144/3 - - - --- TODO: - -- Under construction shader via uniform - -- (READ THE ONE FROM HEALTHBARS!) - -- DONE treadoffset unitUniform - -- DONE: BITOPTIONS UNIFOOOOORM! - -- normalmapping - -- raptors - -- tanktracks - -- Reflection camera - -- refraction camera - -- texture LOD bias of -0.5, maybe adaptive for others - -- still extremely perf heavy - -- 1440p, Red Comet, fullscreen zoomed onto a corvp, SSAO on, Bloom On - -- 110 FPS on corvp with oldcus - -- 180 FPS without disablecus - -- 1440p, Red Comet, fullscreen zoomed onto a corvp, SSAO off, Bloom off - -- 130 fps oldcus - -- 256 fps disablecus - - -- separate VAO and IBO for each 'bin' for less heavy updates - -- Do alpha units also get drawn into deferred pass? Seems like no, because only flag == 1 is draw into that - -- DONE: dynamically size IBOS instead of using the max of 8192! - -- Starts from 32 - -- DONE new engine callins needed: - -- get the number of drawflaggable units (this is kind of gettable already from the API anyway) - -- get the number of changed drawFlags - -- if the number of changed drawflags > log(numdrawflags) then do a full rebuild instead of push-popping - -- e.g if there are 100 units of a bin in view, then a change of ~ 8 units will trigger a full rebuild? - -- cant know ahead of time how many per-bin changes this will trigger though - - -- DONE: write an engine callin that, instead of the full list of unitdrawflags, only returns the list of units whos drawflags have changed! - -- reset this 'hashmap' when reading it - -- also a problem is handling units that died, what 'drawflag' should they get? - -- probably 0 - - -- TODO: handle fast rebuilds of the IBO's when large-magnitude changes happen - -- this is made difficult by the negative featureID crap - - - -- TODO: faster bitops maybe? - -- DONE: we dont handle shaderOptions yet for batches, where we are to keep the same shader, but only change its relevant options uniform - - -- NOTE: It seems that we are generally, and heavily fragment shader limited in most synthetic tests with large numbers of units spreading into full view - -- in this case, the perf of oldcus and gl4cus is actually similar, (similar FS), but vanilla still outperforms - - -- DONE: Too many varyings are passed from VS to FS. - -- Specify some as flat, to avoid interpolation (e.g. teamcolor and selfillummod and maybe even fogfactor - -- reduce total number of these varyings - -- we can save a varying here and there, but mostly done - - -- Done: GetTextures() is not the best implementation at the moment - - -- NOTE: in general, a function call is about 10x faster than a table lookup.... - - -- DONE: how to handle units under construction? They cant be their own completely separate shit, cause of textures... - -- might still make sense to do so - -- they are handled by completely ignoring them - - -- DONE: fully blank normal map for non-normal mapped units (or else risk having to write a shader for that bin, which wont even get used - - -- DONE: alpha cloaked unitses :/ - -- also handled by completely leaving them out - - -- Done: feature drawing bits too - - -- TODO: rewrite treewave +-- Flags (drawpass): +-- forward opaque + reflections +-- deferred opaque, all units +-- shadows. Now all units need their vertex displacement for efficient shadows, so better to bind a separate shader for this +-- Shaders / shaderconfig via bitoptions uniform: +-- Features +-- simplefeatures: metallic nonwrecks +-- treepbr: Real Trees with proper tex2 +-- tree: Shitty Trees +-- wrecks: BAR wrecks +-- Units +-- tanks : -- these are units actually +-- barunits : +-- raptors +-- scavengers +-- - -- DONE: feature override metalness/roughness via uniforms +-- Cloakedunits for alpha +-- Underconstructionunits - -- TODO: fix flashlights to be piece-unique +-- Textures: +-- arm/cor +-- 10x raptorsets +-- 5x featuresets +-- scavengers? +-- Objects (the VAO) +-- 8x 8x 16x -> 8192 different VAOs? damn thats horrible +-- Note that Units and Features cant share a VAO! - -- DONE: AVOID DISCARD in FS AT ALL COST! - -- 500 armcom fullview is 82 vs 108 fps with nodiscard! - -- Even if discard is in a never-called dynamically uniform! - -- only transparent features need discard +-- Can we assume that all BAR units wont have transparency? +-- if yes then we can say that forward and deferred can share! +-- https://stackoverflow.com/questions/8923174/opengl-vao-best-practices +-- Some shader optimization info: https://community.khronos.org/t/profiling-optimizing-a-fragment-shader-in-linux/105144/3 - -- DONE: - -- only ever use discard in deferred pass, dont use it in forward refl or shadow though - -- DEFERRED FEATURE TREE DRAW IS WRONG +-- TODO: +-- Under construction shader via uniform +-- (READ THE ONE FROM HEALTHBARS!) +-- DONE treadoffset unitUniform +-- DONE: BITOPTIONS UNIFOOOOORM! +-- normalmapping +-- raptors +-- tanktracks +-- Reflection camera +-- refraction camera +-- texture LOD bias of -0.5, maybe adaptive for others +-- still extremely perf heavy +-- 1440p, Red Comet, fullscreen zoomed onto a corvp, SSAO on, Bloom On +-- 110 FPS on corvp with oldcus +-- 180 FPS without disablecus +-- 1440p, Red Comet, fullscreen zoomed onto a corvp, SSAO off, Bloom off +-- 130 fps oldcus +-- 256 fps disablecus + +-- separate VAO and IBO for each 'bin' for less heavy updates +-- Do alpha units also get drawn into deferred pass? Seems like no, because only flag == 1 is draw into that +-- DONE: dynamically size IBOS instead of using the max of 8192! +-- Starts from 32 +-- DONE new engine callins needed: +-- get the number of drawflaggable units (this is kind of gettable already from the API anyway) +-- get the number of changed drawFlags +-- if the number of changed drawflags > log(numdrawflags) then do a full rebuild instead of push-popping +-- e.g if there are 100 units of a bin in view, then a change of ~ 8 units will trigger a full rebuild? +-- cant know ahead of time how many per-bin changes this will trigger though + +-- DONE: write an engine callin that, instead of the full list of unitdrawflags, only returns the list of units whos drawflags have changed! +-- reset this 'hashmap' when reading it +-- also a problem is handling units that died, what 'drawflag' should they get? +-- probably 0 + +-- TODO: handle fast rebuilds of the IBO's when large-magnitude changes happen +-- this is made difficult by the negative featureID crap + +-- TODO: faster bitops maybe? +-- DONE: we dont handle shaderOptions yet for batches, where we are to keep the same shader, but only change its relevant options uniform + +-- NOTE: It seems that we are generally, and heavily fragment shader limited in most synthetic tests with large numbers of units spreading into full view +-- in this case, the perf of oldcus and gl4cus is actually similar, (similar FS), but vanilla still outperforms + +-- DONE: Too many varyings are passed from VS to FS. +-- Specify some as flat, to avoid interpolation (e.g. teamcolor and selfillummod and maybe even fogfactor +-- reduce total number of these varyings +-- we can save a varying here and there, but mostly done + +-- Done: GetTextures() is not the best implementation at the moment + +-- NOTE: in general, a function call is about 10x faster than a table lookup.... + +-- DONE: how to handle units under construction? They cant be their own completely separate shit, cause of textures... +-- might still make sense to do so +-- they are handled by completely ignoring them + +-- DONE: fully blank normal map for non-normal mapped units (or else risk having to write a shader for that bin, which wont even get used + +-- DONE: alpha cloaked unitses :/ +-- also handled by completely leaving them out + +-- Done: feature drawing bits too + +-- TODO: rewrite treewave + +-- DONE: feature override metalness/roughness via uniforms + +-- TODO: fix flashlights to be piece-unique + +-- DONE: AVOID DISCARD in FS AT ALL COST! +-- 500 armcom fullview is 82 vs 108 fps with nodiscard! +-- Even if discard is in a never-called dynamically uniform! +-- only transparent features need discard - -- DONE: investigate why/how refraction pass doesnt ever seem to get called - -- killed: refraction bins removed from unitDrawBins (they were never populated; - -- drawBinKeys never includes the refraction flag) +-- DONE: +-- only ever use discard in deferred pass, dont use it in forward refl or shadow though +-- DEFERRED FEATURE TREE DRAW IS WRONG - -- TODO: reduce the amount of deferred buffers being used from 6 to 4 - -- already at 5 (NORM, DIFF, SPEC, EMIT, MISC). Going to 4 would require - -- dropping EMIT or MISC, which both have semantic meaning in the lighting pass. +-- DONE: investigate why/how refraction pass doesnt ever seem to get called +-- killed: refraction bins removed from unitDrawBins (they were never populated; +-- drawBinKeys never includes the refraction flag) - -- DONE: check if LuaShader UniformLocations are cached - -- they are NOT - we now cache them ourselves per-shader in uniformLocCache +-- TODO: reduce the amount of deferred buffers being used from 6 to 4 +-- already at 5 (NORM, DIFF, SPEC, EMIT, MISC). Going to 4 would require +-- dropping EMIT or MISC, which both have semantic meaning in the lighting pass. - -- DONE: add a wreck texture to raptors! It uses lavadistortion texture, its fine +-- DONE: check if LuaShader UniformLocations are cached +-- they are NOT - we now cache them ourselves per-shader in uniformLocCache - -- TODO: Use a 3d texture lookup instead of perlin implementation for damage shading +-- DONE: add a wreck texture to raptors! It uses lavadistortion texture, its fine - -- TODO: separate out damaged units for better perf, damage shading is not free! (as damage is not dynamically uniform across all shader invocations) - -- very difficult, unsure if worth anything in the long run +-- TODO: Use a 3d texture lookup instead of perlin implementation for damage shading - -- TODO: Also add alpha units to deferred pass somehow? +-- TODO: separate out damaged units for better perf, damage shading is not free! (as damage is not dynamically uniform across all shader invocations) +-- very difficult, unsure if worth anything in the long run - -- TODO: engine side: optimize shadow camera as it massively overdraws +-- TODO: Also add alpha units to deferred pass somehow? - -- Done: reflection camera is also totally fucked up - -- It seems that aircraft get removed from reflection pass if water depth is < -70 - -- hovers randomly do and dont get reflections based on water depth - -- fixed in-engine, seems like a reasonably good fix too, though could be better - -- is checking 5 groundheights within drawradius better than some minor overdraw cause of not-too-high above water ground shit? +-- TODO: engine side: optimize shadow camera as it massively overdraws - -- DONE: increase bumpwaterreflectcubetex size - -- TODO: make lava disable drawing reflections! +-- Done: reflection camera is also totally fucked up +-- It seems that aircraft get removed from reflection pass if water depth is < -70 +-- hovers randomly do and dont get reflections based on water depth +-- fixed in-engine, seems like a reasonably good fix too, though could be better +-- is checking 5 groundheights within drawradius better than some minor overdraw cause of not-too-high above water ground shit? - -- TODO: shared bins for deferred and forward and maybe even reflection? - -- The sharing could be done on the uniformbin level, and this is quite elegant in general too, as tables are shared by reference.... - -- DONE: shared deferred and forward via ultimate cleverness! +-- DONE: increase bumpwaterreflectcubetex size +-- TODO: make lava disable drawing reflections! - -- DONE: Specular highlights should also bloom, not just emissive! +-- TODO: shared bins for deferred and forward and maybe even reflection? +-- The sharing could be done on the uniformbin level, and this is quite elegant in general too, as tables are shared by reference.... +-- DONE: shared deferred and forward via ultimate cleverness! - -- DONE: Cleaner Shutdown and reloadcusgl4 and disablecusgl4 +-- DONE: Specular highlights should also bloom, not just emissive! - -- TODO: Get BRDFLUT from API_PBR_ENABLER (OR build your own float16 texture) +-- DONE: Cleaner Shutdown and reloadcusgl4 and disablecusgl4 - -- TODO: WE ARE DRAWING ALL IN THE UNITS PASS INSTEAD OF BOTH FEATURE AND UNITS PASS! (can that bite us in the ass?) +-- TODO: Get BRDFLUT from API_PBR_ENABLER (OR build your own float16 texture) +-- TODO: WE ARE DRAWING ALL IN THE UNITS PASS INSTEAD OF BOTH FEATURE AND UNITS PASS! (can that bite us in the ass?) - -- DONE: Reimplement featureFade, as it can kill perf on heavily forested maps and potatos - -- implemented via VS distance-based fade (shrink-to-nothing between FeatureFadeDistance and FeatureDrawDistance) +-- DONE: Reimplement featureFade, as it can kill perf on heavily forested maps and potatos +-- implemented via VS distance-based fade (shrink-to-nothing between FeatureFadeDistance and FeatureDrawDistance) - -- DONE: GetTexturesKey is probably slow too! +-- DONE: GetTexturesKey is probably slow too! - -- TODO: Shadows are 1 drawframe late, maybe update lists in DrawGenesis instead of DrawWorldPreUnit - -- NOTE: tested, DrawGenesis still 1 frame late, and spreading across frames is actually beneficial - -- TODO: we need to update things earlier, to get the shadow stuff in on time +-- TODO: Shadows are 1 drawframe late, maybe update lists in DrawGenesis instead of DrawWorldPreUnit +-- NOTE: tested, DrawGenesis still 1 frame late, and spreading across frames is actually beneficial +-- TODO: we need to update things earlier, to get the shadow stuff in on time - -- Done: GetTextures : - -- should return array table instead of hash table - -- fill in unused stuff with 'false' for contiguous array table - -- index -1 - -- oddly enough, accessing array tables instead of hash tables is only 25% faster, so the overhead of -1 might not even result in any perf gains +-- Done: GetTextures : +-- should return array table instead of hash table +-- fill in unused stuff with 'false' for contiguous array table +-- index -1 +-- oddly enough, accessing array tables instead of hash tables is only 25% faster, so the overhead of -1 might not even result in any perf gains - -- Should also get the normalmaps for each unit! - -- PBR textures: - -- uniform sampler2D brdfLUT; //9 - -- uniform sampler2D envLUT; //10 - -- uniform samplerCube reflectTex; // 7 +-- Should also get the normalmaps for each unit! +-- PBR textures: +-- uniform sampler2D brdfLUT; //9 +-- uniform sampler2D envLUT; //10 +-- uniform samplerCube reflectTex; // 7 - -- uniform sampler2D losMapTex; //8 for features out of los maybe? +-- uniform sampler2D losMapTex; //8 for features out of los maybe? - -- We also need the skybox cubemap for PBR (samplerCube reflectTex) - -- We also need wrecktex for damaged units! +-- We also need the skybox cubemap for PBR (samplerCube reflectTex) +-- We also need wrecktex for damaged units! - -- Create a default 'wrecktex' for features too? +-- Create a default 'wrecktex' for features too? - -- TODO: Check the double-calls that happens when a unit is destroyed and fucks with out flags on update too +-- TODO: Check the double-calls that happens when a unit is destroyed and fucks with out flags on update too -- DONE: - -- unit uniforms +-- unit uniforms -- KNOWN BUGS: - -- Unitdestroyed doesnt trigger removal? +-- Unitdestroyed doesnt trigger removal? -- Export important things @@ -224,10 +219,8 @@ end -- We can use the SUniformsBuffer vec4 uni[instData.y].userDefined[5] to pass data persistent unit-info -- floats 0-5 are already in use by HealthBars - - -- Set autoReload.enabled = true to enable on-the-fly editing of shaders. -local autoReload = {enabled = false, vssrc = "", fssrc = "", lastUpdate = Spring.GetTimer(), updateRate = 0.5} +local autoReload = { enabled = false, vssrc = "", fssrc = "", lastUpdate = Spring.GetTimer(), updateRate = 0.5 } -- Indicates wether the first round of getting units should grab all instead of delta local manualReload = autoReload.enabled or false @@ -256,7 +249,7 @@ local function GetUniformBinID(objectDefID, reason) if debugmode then Spring.Echo("Failed to find a uniform bin id for objectDefID", objectDefID, reason) end - return 'otherunit' + return "otherunit" end end @@ -280,22 +273,22 @@ end updateFeatureFadeDistances() do --save a ton of locals - local OPTION_SHADOWMAPPING = 1 - local OPTION_NORMALMAPPING = 2 - local OPTION_SHIFT_RGBHSV = 4 -- userDefined[2].rgb (gl.SetUnitBufferUniforms(unitID, {math.random(),math.random()-0.5,math.random()-0.5}, 8) -- shift Hue, saturation, valence ) - local OPTION_VERTEX_AO = 8 - local OPTION_FLASHLIGHTS = 16 - local OPTION_TREADS_ARM = 32 - local OPTION_TREADS_CORE = 64 + local OPTION_SHADOWMAPPING = 1 + local OPTION_NORMALMAPPING = 2 + local OPTION_SHIFT_RGBHSV = 4 -- userDefined[2].rgb (gl.SetUnitBufferUniforms(unitID, {math.random(),math.random()-0.5,math.random()-0.5}, 8) -- shift Hue, saturation, valence ) + local OPTION_VERTEX_AO = 8 + local OPTION_FLASHLIGHTS = 16 + local OPTION_TREADS_ARM = 32 + local OPTION_TREADS_CORE = 64 local OPTION_HEALTH_TEXTURING = 128 - local OPTION_HEALTH_DISPLACE = 256 + local OPTION_HEALTH_DISPLACE = 256 local OPTION_HEALTH_TEXRAPTORS = 512 - local OPTION_MODELSFOG = 1024 - local OPTION_TREEWIND = 2048 - local OPTION_PBROVERRIDE = 4096 - local OPTION_TREADS_LEG = 8192 + local OPTION_MODELSFOG = 1024 + local OPTION_TREEWIND = 2048 + local OPTION_PBROVERRIDE = 4096 + local OPTION_TREADS_LEG = 8192 - local defaultBitShaderOptions = OPTION_SHADOWMAPPING + OPTION_NORMALMAPPING + OPTION_MODELSFOG + local defaultBitShaderOptions = OPTION_SHADOWMAPPING + OPTION_NORMALMAPPING + OPTION_MODELSFOG uniformBins = { armunit = { @@ -329,7 +322,7 @@ do --save a ton of locals brightnessFactor = 1.5, }, raptor = { - bitOptions = defaultBitShaderOptions + OPTION_VERTEX_AO + OPTION_FLASHLIGHTS + OPTION_HEALTH_DISPLACE + OPTION_HEALTH_TEXRAPTORS + OPTION_TREEWIND + OPTION_SHIFT_RGBHSV, + bitOptions = defaultBitShaderOptions + OPTION_VERTEX_AO + OPTION_FLASHLIGHTS + OPTION_HEALTH_DISPLACE + OPTION_HEALTH_TEXRAPTORS + OPTION_TREEWIND + OPTION_SHIFT_RGBHSV, baseVertexDisplacement = 0.0, brightnessFactor = 1.5, }, @@ -367,14 +360,14 @@ do --save a ton of locals end local overrideDrawFlags = { - [0] = true , --SO_OPAQUE_FLAG = 1, deferred hack - [1] = true , --SO_OPAQUE_FLAG = 1, - [2] = true , --SO_ALPHAF_FLAG = 2, -- THIS IS MIXED DOWN INTO SO_OPAQUE_FLAG - [4] = true , --SO_REFLEC_FLAG = 4, - [8] = true , --SO_REFRAC_FLAG = 8, - [16] = true , --SO_SHADOW_FLAG = 16, - [32] = true , --SO_SHTRAN_FLAG = 32, -- this is shadow transparency flag, to draw shadows into transparent pass - --SO_DRICON_FLAG = 128, -- + [0] = true, --SO_OPAQUE_FLAG = 1, deferred hack + [1] = true, --SO_OPAQUE_FLAG = 1, + [2] = true, --SO_ALPHAF_FLAG = 2, -- THIS IS MIXED DOWN INTO SO_OPAQUE_FLAG + [4] = true, --SO_REFLEC_FLAG = 4, + [8] = true, --SO_REFRAC_FLAG = 8, + [16] = true, --SO_SHADOW_FLAG = 16, + [32] = true, --SO_SHTRAN_FLAG = 32, -- this is shadow transparency flag, to draw shadows into transparent pass + --SO_DRICON_FLAG = 128, -- } --implementation @@ -387,17 +380,17 @@ end -- deferred is handled by just copying fw -- refraction and alpha are just dumped -- local drawBinKeys = {1, 1 + 4, 1 + 8, 2, 2 + 4, 2 + 8, 16} -local drawBinKeys = {1, 1 + 4, 16} +local drawBinKeys = { 1, 1 + 4, 16 } local overrideDrawFlagsCombined = { - [0 ] = overrideDrawFlags[0], - [1 ] = overrideDrawFlags[1], + [0] = overrideDrawFlags[0], + [1] = overrideDrawFlags[1], [1 + 4] = overrideDrawFlags[1] and overrideDrawFlags[4], --[1 + 8] = overrideDrawFlags[1] and overrideDrawFlags[8], --[2 ] = overrideDrawFlags[2], --[2 + 4] = overrideDrawFlags[2] and overrideDrawFlags[4], --[2 + 8] = overrideDrawFlags[2] and overrideDrawFlags[8], - [16 ] = overrideDrawFlags[16], + [16] = overrideDrawFlags[16], } local cusUnitIDtoDrawFlag = {} -- {unitID = drawFlag,...}, these remain positive, as they are traversed separately @@ -414,31 +407,30 @@ local cusFeatureIDtoDrawFlag = {} -- {featureID = drawFlag,...}, this remains po -- This is the main table of all the unit drawbins: -- It is organized like so: -- unitDrawBins[drawFlag][shaderID][textureKey] = { - -- textures = { - -- 0 = %586:1 -- in this example, its just texture 1 - -- }, - -- objects = { - -- 31357 = true - -- 20174 = true - -- 29714 = true - -- 3024 = true - -- 24268 = true - -- 5584 = true - -- 5374 = true - -- 26687 = true - -- }, - -- VAO = vao, - -- IBO = ibo, - -- objectsArray = {}, -- {index: objectID} - -- objectsIndex = {}, -- {objectID : index} (this is needed for efficient removal of items, as RemoveFromSubmission takes an index as arg) - -- numobjects = 0, -- a 'pointer to the end' +-- textures = { +-- 0 = %586:1 -- in this example, its just texture 1 +-- }, +-- objects = { +-- 31357 = true +-- 20174 = true +-- 29714 = true +-- 3024 = true +-- 24268 = true +-- 5584 = true +-- 5374 = true +-- 26687 = true +-- }, +-- VAO = vao, +-- IBO = ibo, +-- objectsArray = {}, -- {index: objectID} +-- objectsIndex = {}, -- {objectID : index} (this is needed for efficient removal of items, as RemoveFromSubmission takes an index as arg) +-- numobjects = 0, -- a 'pointer to the end' -- } local unitDrawBins = nil -- this also controls wether cusgl4 is on at all! local objectIDtoDefID = {} - local shaders = {} -- double nested table of {drawflag : {"units":shaderID}} local modelsVertexVBO = nil @@ -451,7 +443,7 @@ local objectTypeAttribID = 6 -- this is the attribute index for instancedata in local initiated = false local function Bit(p) - return 2 ^ (p - 1) -- 1-based indexing + return 2 ^ (p - 1) -- 1-based indexing end -- Typical call: if hasbit(x, bit(3)) then ... @@ -481,15 +473,15 @@ local function GetShader(drawPass, objectDefID) end if objectDefID >= 0 then if unitDefsUseSkinning[objectDefID] then - return shaders[drawPass]['unitskinning'] + return shaders[drawPass]["unitskinning"] else - return shaders[drawPass]['unit'] + return shaders[drawPass]["unit"] end else if featuresDefsWithAlpha[objectDefID] then - return shaders[drawPass]['tree'] + return shaders[drawPass]["tree"] else - return shaders[drawPass]['feature'] + return shaders[drawPass]["feature"] end end end @@ -501,15 +493,15 @@ local function GetShaderName(drawPass, objectDefID) end if objectDefID >= 0 then if unitDefsUseSkinning[objectDefID] then - return 'unitskinning' + return "unitskinning" else - return 'unit' + return "unit" end else if featuresDefsWithAlpha[objectDefID] then - return 'tree' + return "tree" else - return 'feature' + return "feature" end end end @@ -543,7 +535,9 @@ local function SetShaderUniforms(drawPass, shaderID, uniformBinID) drawPassLoc = gl.GetUniformLocation(shaderID, "drawPass") locCache.drawPass = drawPassLoc or false end - if drawPassLoc then gl.UniformInt(drawPassLoc, drawPass) end + if drawPassLoc then + gl.UniformInt(drawPassLoc, drawPass) + end -- The clip plane is used for above/below water, for the reflection and refraction cameras only local clipLoc = locCache.clipPlane0 @@ -569,15 +563,13 @@ local function SetShaderUniforms(drawPass, shaderID, uniformBinID) locCache[uniformLocationName] = loc or false end if loc then - if uniformLocationName == 'bitOptions' then + if uniformLocationName == "bitOptions" then gl.UniformInt(loc, uniformValue) else gl.Uniform(loc, uniformValue) end end end - - end ------------------------- SHADERS ---------------------- ------------------------- LOADING OLD CUS MATERIALS ---------------------- @@ -598,29 +590,29 @@ local featuresNormalMapTemplate local treesNormalMapTemplate function deepcopy(orig) - local orig_type = type(orig) - local copy - if orig_type == 'table' then - copy = {} - for orig_key, orig_value in next, orig, nil do - copy[deepcopy(orig_key)] = deepcopy(orig_value) - end - setmetatable(copy, deepcopy(getmetatable(orig))) - else -- number, string, boolean, etc - copy = orig - end - return copy + local orig_type = type(orig) + local copy + if orig_type == "table" then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy end local function appendShaderDefinitionsToTemplate(template, alldefinitions) local copytemplate = deepcopy(template) - for i, singleShaderDefs in ipairs({"shaderDefinitions", "deferredDefinitions", "shadowDefinitions", "reflectionDefinitions"}) do + for i, singleShaderDefs in ipairs({ "shaderDefinitions", "deferredDefinitions", "shadowDefinitions", "reflectionDefinitions" }) do if alldefinitions[singleShaderDefs] then if copytemplate[singleShaderDefs] == nil then copytemplate[singleShaderDefs] = {} end for j, defline in ipairs(alldefinitions[singleShaderDefs]) do - copytemplate[singleShaderDefs][ #copytemplate[singleShaderDefs] + 1 ] = defline + copytemplate[singleShaderDefs][#copytemplate[singleShaderDefs] + 1] = defline end end end @@ -634,7 +626,6 @@ local function initMaterials() Spring.Echo("CUS GL4 enabled XMAS mode") end - unitsNormalMapTemplate = appendShaderDefinitionsToTemplate(defaultMaterialTemplate, { shaderDefinitions = { "#define ENABLE_OPTION_HEALTH_TEXTURING 1", @@ -659,7 +650,6 @@ local function initMaterials() }, }) - unitsSkinningTemplate = appendShaderDefinitionsToTemplate(defaultMaterialTemplate, { shaderDefinitions = { "#define ENABLE_OPTION_HEALTH_TEXTURING 1", @@ -733,7 +723,7 @@ local DEFAULT_VERSION = [[#version 430 core ]] local function dumpShaderCodeToFile(defs, src, filename) -- no IO in unsynced gadgets :/ - local vsfile = io.open('cus_' .. filename .. ".glsl","w+") + local vsfile = io.open("cus_" .. filename .. ".glsl", "w+") vsfile:write(defs .. src) vsfile:close() end @@ -774,7 +764,7 @@ local function CompileLuaShader(shader, definitions, plugIns, addName, recompila end if shader.vertex then - shader.vertex = shader.vertex:gsub("%%%%([%a_]+)%%%%", InsertPlugin) + shader.vertex = shader.vertex:gsub("%%%%([%a_]+)%%%%", InsertPlugin) end if shader.fragment then shader.fragment = shader.fragment:gsub("%%%%([%a_]+)%%%%", InsertPlugin) @@ -784,13 +774,12 @@ local function CompileLuaShader(shader, definitions, plugIns, addName, recompila end end - for i, program in ipairs({"vertex", "fragment", "geometry"}) do + for i, program in ipairs({ "vertex", "fragment", "geometry" }) do if shader[program] and QUATERNIONDEFS then - shader[program] = shader[program]:gsub("//__QUATERNIONDEFS__", QUATERNIONDEFS) + shader[program] = shader[program]:gsub("//__QUATERNIONDEFS__", QUATERNIONDEFS) end end - local luaShader = LuaShader(shader, "CUS_" .. addName) local compilationResult = luaShader:Initialize() if compilationResult ~= true then @@ -808,12 +797,12 @@ end local function compileMaterialShader(template, name, recompilation) --Spring.Echo("Compiling", template, name) - local forwardShader = CompileLuaShader(template.shader, template.shaderDefinitions, template.shaderPlugins, name .."_forward" , recompilation) - local shadowShader = CompileLuaShader(template.shadow, template.shadowDefinitions, template.shaderPlugins, name .."_shadow" , recompilation) - local deferredShader = CompileLuaShader(template.deferred, template.deferredDefinitions, template.shaderPlugins, name .."_deferred" , recompilation) - local reflectionShader = CompileLuaShader(template.reflection, template.reflectionDefinitions, template.shaderPlugins, name .."_reflection" , recompilation) + local forwardShader = CompileLuaShader(template.shader, template.shaderDefinitions, template.shaderPlugins, name .. "_forward", recompilation) + local shadowShader = CompileLuaShader(template.shadow, template.shadowDefinitions, template.shaderPlugins, name .. "_shadow", recompilation) + local deferredShader = CompileLuaShader(template.deferred, template.deferredDefinitions, template.shaderPlugins, name .. "_deferred", recompilation) + local reflectionShader = CompileLuaShader(template.reflection, template.reflectionDefinitions, template.shaderPlugins, name .. "_reflection", recompilation) if recompilation then - if (not forwardShader) or (not shadowShader) or (not deferredShader) or (not reflectionShader) then + if (not forwardShader) or not shadowShader or not deferredShader or not reflectionShader then -- This is a recompilation attempt that failed, so we are not going to replace the shader objects themselves return nil end @@ -823,32 +812,32 @@ local function compileMaterialShader(template, name, recompilation) local flag = drawBinKeys[k] shaders[flag][name] = forwardShader end - shaders[0 ][name] = deferredShader - shaders[5 ][name] = reflectionShader + shaders[0][name] = deferredShader + shaders[5][name] = reflectionShader shaders[16][name] = shadowShader return true end -- Order of textures in shader: - -- uniform sampler2D texture1; //0 - -- uniform sampler2D texture2; //1 - -- uniform sampler2D normalTex; //2 +-- uniform sampler2D texture1; //0 +-- uniform sampler2D texture2; //1 +-- uniform sampler2D normalTex; //2 - -- uniform sampler2D texture1w; //3 - -- uniform sampler2D texture2w; //4 - -- uniform sampler2D normalTexw; //5 +-- uniform sampler2D texture1w; //3 +-- uniform sampler2D texture2w; //4 +-- uniform sampler2D normalTexw; //5 - -- uniform sampler2DShadow shadowTex; //6 - -- uniform samplerCube reflectTex; //7 +-- uniform sampler2DShadow shadowTex; //6 +-- uniform samplerCube reflectTex; //7 - -- uniform sampler2D losMapTex; //8 +-- uniform sampler2D losMapTex; //8 - -- uniform sampler2D brdfLUT; //9 +-- uniform sampler2D brdfLUT; //9 local textureKeytoSet = {} -- table of {TextureKey : {textureTable}} local blankNormalMap = "unittextures/blank_normal.dds" -local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" +local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" local fastObjectDefIDtoTextureKey = {} -- table of {unitDefID : TextureKey, -featureDefID : TextureKey } local fastTextureKeyCache = {} -- a table of concatenated texture names to increasing integers @@ -866,13 +855,13 @@ local function GenFastTextureKey(objectDefID, objectDef, normaltexpath, texturet local tex2 = string.lower(objectDef.model.textures.tex2 or "") normaltexpath = string.lower(normaltexpath or "") local strkey = tex1 .. tex2 .. normaltexpath - for i=3, 20 do -- from 3 since 0-1-2 are tex12 and normals, and this guarantees order of the table + for i = 3, 20 do -- from 3 since 0-1-2 are tex12 and normals, and this guarantees order of the table if texturetable[i] then strkey = strkey .. texturetable[i] end end - if fastTextureKeyCache[strkey] then -- already exists + if fastTextureKeyCache[strkey] then -- already exists fastObjectDefIDtoTextureKey[objectDefID] = fastTextureKeyCache[strkey] else numfastTextureKeyCache = numfastTextureKeyCache + 1 @@ -901,7 +890,7 @@ local wreckAtlases = { }, ["raptor"] = { "luaui/images/lavadistortion.png", - } + }, } local brdfLUT = "modelmaterials_gl4/brdf_0.png" @@ -909,7 +898,7 @@ local brdfLUT = "modelmaterials_gl4/brdf_0.png" local existingfilecache = {} -- this speeds up the VFS calls local function GetNormal(unitDef, featureDef) - local FileExists = VFS.FileExists + local FileExists = VFS.FileExists local normalMap = blankNormalMap local unittextures = "unittextures/" @@ -938,10 +927,10 @@ local function GetNormal(unitDef, featureDef) -- cache them: if existingfilecache[tex1] == nil and FileExists(tex1) then - existingfilecache[tex1] = string.format("%%%i:0", -1*featureDef.id) + existingfilecache[tex1] = string.format("%%%i:0", -1 * featureDef.id) end if existingfilecache[tex2] == nil and FileExists(tex2) then - existingfilecache[tex2] = string.format("%%%i:1", -1*featureDef.id) + existingfilecache[tex2] = string.format("%%%i:1", -1 * featureDef.id) end if featureDef.customParams and featureDef.customParams.normaltex then @@ -952,26 +941,26 @@ local function GetNormal(unitDef, featureDef) return normaltex else if featureDef.model.textures.tex1 == "Arm_wreck_color.dds" then - return unittextures.."Arm_wreck_color_normal.dds" + return unittextures .. "Arm_wreck_color_normal.dds" end if featureDef.model.textures.tex1 == "cor_color_wreck.dds" then - return unittextures.."cor_color_wreck_normal.dds" + return unittextures .. "cor_color_wreck_normal.dds" end if featureDef.model.textures.tex1 == "leg_wreck_color.dds" then - return unittextures.."leg_wreck_normal.dds" + return unittextures .. "leg_wreck_normal.dds" end -- try to search for an appropriate normal - normalMap = tex1:gsub("%.","_normals.") + normalMap = tex1:gsub("%.", "_normals.") -- Spring.Echo(normalMap) - if (existingfilecache[normalMap] or FileExists(normalMap)) then + if existingfilecache[normalMap] or FileExists(normalMap) then existingfilecache[normalMap] = true return normalMap end - normalMap = tex1:gsub("%.","_normal.") + normalMap = tex1:gsub("%.", "_normal.") -- Spring.Echo(normalMap) - if (existingfilecache[normalMap] or FileExists(normalMap)) then + if existingfilecache[normalMap] or FileExists(normalMap) then existingfilecache[normalMap] = true return normalMap end @@ -987,11 +976,8 @@ end -- The problem here being hat tex1 and tex2 dont participate in texture key hashing. -- so e.g. raptors may have been drawn with incorrect textures all along, due to them being keyed - - local knowntrees = VFS.Include("modelmaterials_gl4/known_feature_trees.lua") local function initBinsAndTextures() - -- init features first, to gain access to stored wreck textures! Spring.Echo("[CUS GL4] Init Feature bins") for featureDefID, featureDef in pairs(FeatureDefs) do @@ -1011,19 +997,18 @@ local function initBinsAndTextures() [10] = noisetex3dcube, } - objectDefToUniformBin[-1 * featureDefID] = 'feature' + objectDefToUniformBin[-1 * featureDefID] = "feature" if featureDef.name:find("raptor_egg", nil, true) then - objectDefToUniformBin[-1 * featureDefID] = 'wreck' + objectDefToUniformBin[-1 * featureDefID] = "wreck" --featuresDefsWithAlpha[-1 * featureDefID] = "yes" - elseif (featureDef.customParams and featureDef.customParams.treeshader == 'yes') - or knowntrees[featureDef.name] then - objectDefToUniformBin[-1 * featureDefID] = 'tree' + elseif (featureDef.customParams and featureDef.customParams.treeshader == "yes") or knowntrees[featureDef.name] then + objectDefToUniformBin[-1 * featureDefID] = "tree" featuresDefsWithAlpha[-1 * featureDefID] = "yes" elseif featureDef.name:find("_dead", nil, true) or featureDef.name:find("_heap", nil, true) then - objectDefToUniformBin[-1 * featureDefID] = 'wreck' + objectDefToUniformBin[-1 * featureDefID] = "wreck" elseif featureDef.name:find("pilha_crystal", nil, true) or (featureDef.customParams and featureDef.customParams.cuspbr) then - objectDefToUniformBin[-1 * featureDefID] = 'featurepbr' + objectDefToUniformBin[-1 * featureDefID] = "featurepbr" end --Spring.Echo("Assigned normal map to", featureDef.name, normalTex) @@ -1043,15 +1028,15 @@ local function initBinsAndTextures() local lowercasenormaltex = string.lower(normalTex or "") -- bin units according to what faction's texture they use - local factionBinTag = lowercasetex1:sub(1,3) + local factionBinTag = lowercasetex1:sub(1, 3) objectDefToUniformBin[unitDefID] = "otherunit" - if factionBinTag == 'arm' then - objectDefToUniformBin[unitDefID] = 'armunit' - elseif factionBinTag == 'cor' then - objectDefToUniformBin[unitDefID] = 'corunit' - elseif factionBinTag == 'leg' then - objectDefToUniformBin[unitDefID] = 'legunit' + if factionBinTag == "arm" then + objectDefToUniformBin[unitDefID] = "armunit" + elseif factionBinTag == "cor" then + objectDefToUniformBin[unitDefID] = "corunit" + elseif factionBinTag == "leg" then + objectDefToUniformBin[unitDefID] = "legunit" end local textureTable = { @@ -1069,42 +1054,30 @@ local function initBinsAndTextures() [10] = noisetex3dcube, } - local wreckTex1 = - (lowercasetex1:find("arm_color", nil, true) and "unittextures/Arm_wreck_color.dds") or - (lowercasetex1:find("cor_color", nil, true) and "unittextures/cor_color_wreck.dds") or - (lowercasetex1:find("leg_color", nil, true) and "unittextures/leg_wreck_color.dds") or - false + local wreckTex1 = (lowercasetex1:find("arm_color", nil, true) and "unittextures/Arm_wreck_color.dds") or (lowercasetex1:find("cor_color", nil, true) and "unittextures/cor_color_wreck.dds") or (lowercasetex1:find("leg_color", nil, true) and "unittextures/leg_wreck_color.dds") or false if wreckTex1 and existingfilecache[wreckTex1] then -- this part is what ensures that these textures dont get loaded separately, but instead use ones provided by featuredefs wreckTex1 = existingfilecache[wreckTex1] end - local wreckTex2 = - (lowercasetex2:find("arm_other", nil, true) and "unittextures/Arm_wreck_other.dds") or - (lowercasetex2:find("cor_other", nil, true) and "unittextures/cor_other_wreck.dds") or - (lowercasetex2:find("leg_shader", nil, true) and "unittextures/leg_wreck_shader.dds") or - false - if wreckTex2 and existingfilecache[wreckTex2] then -- this part is what ensures that these textures dont get loaded separately, but instead use ones provided by featuredefs + local wreckTex2 = (lowercasetex2:find("arm_other", nil, true) and "unittextures/Arm_wreck_other.dds") or (lowercasetex2:find("cor_other", nil, true) and "unittextures/cor_other_wreck.dds") or (lowercasetex2:find("leg_shader", nil, true) and "unittextures/leg_wreck_shader.dds") or false + if wreckTex2 and existingfilecache[wreckTex2] then -- this part is what ensures that these textures dont get loaded separately, but instead use ones provided by featuredefs wreckTex2 = existingfilecache[wreckTex2] end - local wreckNormalTex = - (lowercasenormaltex:find("arm_normal") and "unittextures/Arm_wreck_color_normal.dds") or - (lowercasenormaltex:find("cor_normal") and "unittextures/cor_color_wreck_normal.dds") or - (lowercasenormaltex:find("leg_normal") and "unittextures/leg_wreck_normal.dds") or - false + local wreckNormalTex = (lowercasenormaltex:find("arm_normal") and "unittextures/Arm_wreck_color_normal.dds") or (lowercasenormaltex:find("cor_normal") and "unittextures/cor_color_wreck_normal.dds") or (lowercasenormaltex:find("leg_normal") and "unittextures/leg_wreck_normal.dds") or false if unitDef.name:find("_scav", nil, true) then -- it better be a scavenger unit, or ill kill you textureTable[3] = wreckTex1 textureTable[4] = wreckTex2 textureTable[5] = wreckNormalTex - if factionBinTag == 'arm' then - objectDefToUniformBin[unitDefID] = 'armscavenger' - elseif factionBinTag == 'cor' then - objectDefToUniformBin[unitDefID] = 'corscavenger' - elseif factionBinTag == 'leg' then - objectDefToUniformBin[unitDefID] = 'legscavenger' + if factionBinTag == "arm" then + objectDefToUniformBin[unitDefID] = "armscavenger" + elseif factionBinTag == "cor" then + objectDefToUniformBin[unitDefID] = "corscavenger" + elseif factionBinTag == "leg" then + objectDefToUniformBin[unitDefID] = "legscavenger" end elseif unitDef.name:find("raptor", nil, true) or unitDef.name:find("raptor_hive", nil, true) then - textureTable[5] = wreckAtlases['raptor'][1] - objectDefToUniformBin[unitDefID] = 'raptor' + textureTable[5] = wreckAtlases["raptor"][1] + objectDefToUniformBin[unitDefID] = "raptor" --Spring.Echo("Raptorwreck", textureTable[5]) elseif wreckTex1 and wreckTex2 then -- just a true unit: textureTable[3] = wreckTex1 @@ -1114,7 +1087,7 @@ local function initBinsAndTextures() if unitDef.customParams and unitDef.customParams.useskinning then unitDefsUseSkinning[unitDefID] = true - objectDefToUniformBin[unitDefID] = 'otherunit' -- This will temporarily disable raptor shader + objectDefToUniformBin[unitDefID] = "otherunit" -- This will temporarily disable raptor shader end local texKeyFast = GenFastTextureKey(unitDefID, unitDef, normalTex, textureTable) @@ -1123,9 +1096,6 @@ local function initBinsAndTextures() end end end - - - end local preloadedTextures = false @@ -1159,14 +1129,14 @@ local function GetObjectDefName(objectID) local udid = Spring.GetUnitDefID(objectID) return UnitDefs[udid].name else - return "Invalid UnitID:"..tostring(objectID) + return "Invalid UnitID:" .. tostring(objectID) end else if Spring.ValidFeatureID(-1 * objectID) then local fdid = Spring.GetFeatureDefID(-1 * objectID) return FeatureDefs[fdid].name else - return 'Invalid featuredefid:' .. tostring(objectID) + return "Invalid featuredefid:" .. tostring(objectID) end end end @@ -1183,28 +1153,32 @@ local assigncalls = 0 -- @param textures A table of {bindPosition:texturename} for this unit -- @param texKey A unique key hashed from the textures names, bindpositions local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom) - assigncalls = (assigncalls + 1 ) % (2^20) + assigncalls = (assigncalls + 1) % (2 ^ 20) -- Guard against stale/dying object IDs. Spring.GetUnitDefID can still return a defID for a unit -- that is in its death window (so AddObject/UpdateObject let it through), while InstanceDataFromUnitIDs -- below reports "Non-existing UnitID" and throws, aborting the whole DrawWorldPreUnit call-in and leaving -- the draw bins inconsistent (wrong models/attachments). Bail before inserting it into any bin. if objectID >= 0 then - if (not Spring.ValidUnitID(objectID)) or (Spring.GetUnitIsDead(objectID) == true) then return end + if (not Spring.ValidUnitID(objectID)) or (Spring.GetUnitIsDead(objectID) == true) then + return + end else - if not Spring.ValidFeatureID(-objectID) then return end + if not Spring.ValidFeatureID(-objectID) then + return + end end shader = shader or GetShaderName(flag, objectDefID) texKey = texKey or fastObjectDefIDtoTextureKey[objectDefID] if objectDefID == nil then - Spring.Echo("AssignObjectToBin",objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom) + Spring.Echo("AssignObjectToBin", objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom) end uniformBinID = uniformBinID or GetUniformBinID(objectDefID, "AssignObjectToBin") --Spring.Echo("AssignObjectToBin", objectID, objectDefID, flag, shader, textures, texKey, uniformBinID) -- Spring.Debug.TraceFullEcho() - if (texKey == nil or uniformBinID == nil) then + if texKey == nil or uniformBinID == nil then if badassigns[objectID] == nil then Spring.Echo("[CUS GL4]Failure to assign to ", objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom) Spring.Echo("REPORT THIS TO BEHERITH: bad object:", GetObjectDefName(objectID)) @@ -1238,7 +1212,7 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, end mybinIBO:Define(INITIAL_VAO_SIZE, { - {id = 6, name = "instData", type = GL.UNSIGNED_INT, size = 4}, + { id = 6, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, }) mybinVAO:AttachVertexBuffer(modelsVertexVBO) @@ -1251,7 +1225,7 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, VAO = mybinVAO, -- my own VBO, for incremental updating objectsArray = {}, -- {index: objectID} objectsIndex = {}, -- {objectID : index} (this is needed for efficient removal of items, as RemoveFromSubmission takes an index as arg) - numobjects = 0, -- a 'pointer to the end' + numobjects = 0, -- a 'pointer to the end' maxElements = INITIAL_VAO_SIZE, } @@ -1260,10 +1234,16 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, -- they could share up to the shader level, but I dont know why im not using that if flag == 1 then deferredrawBin = unitDrawBins[0] - if deferredrawBin[shader] == nil then deferredrawBin[shader] = {} end - if deferredrawBin[shader][uniformBinID] == nil then deferredrawBin[shader][uniformBinID] = unitDrawBinsFlagShader[uniformBinID] end + if deferredrawBin[shader] == nil then + deferredrawBin[shader] = {} + end + if deferredrawBin[shader][uniformBinID] == nil then + deferredrawBin[shader][uniformBinID] = unitDrawBinsFlagShader[uniformBinID] + end + end + if debugmode then + Spring.Echo("Init of bin", shader, flag, texKey, uniformBinID, "took", Spring.DiffTimers(Spring.GetTimerMicros(), t0, nil), "ms") end - if debugmode then Spring.Echo("Init of bin",shader, flag, texKey, uniformBinID, "took", Spring.DiffTimers(Spring.GetTimerMicros(),t0, nil), "ms" ) end end local unitDrawBinsFlagShaderUniformsTexKey = unitDrawBinsFlagShaderUniforms[texKey] @@ -1271,7 +1251,9 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, if unitDrawBinsFlagShaderUniformsTexKey.objectsIndex[objectID] then Spring.Echo("Trying to add a unit to a bin that it is already in!") else - if debugmode then Spring.Echo("AssignObjectToBin success:",objectID, objectDefID, flag, shader, texKey, uniformBinID ) end + if debugmode then + Spring.Echo("AssignObjectToBin success:", objectID, objectDefID, flag, shader, texKey, uniformBinID) + end end local maxElements = unitDrawBinsFlagShaderUniformsTexKey.maxElements @@ -1300,7 +1282,7 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, end mybinIBO:Define(maxElements, { - {id = 6, name = "instData", type = GL.UNSIGNED_INT, size = 4}, + { id = 6, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, }) mybinVAO:AttachVertexBuffer(modelsVertexVBO) @@ -1327,7 +1309,6 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, mybinIBO:InstanceDataFromUnitIDs(newObjectsArray, objectTypeAttribID) mybinVAO:AddUnitsToSubmission(newObjectsArray) - else -- this additional table is needed to allow for one-time translation of negative objectID to featureID local newFeaturesArray = {} @@ -1335,7 +1316,7 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, if Spring.ValidFeatureID(-featureID) then newObjectsCount = newObjectsCount + 1 newObjectsArray[newObjectsCount] = featureID - newObjectsIndex[featureID ] = newObjectsCount + newObjectsIndex[featureID] = newObjectsCount newFeaturesArray[newObjectsCount] = -1 * featureID end end @@ -1351,22 +1332,22 @@ local function AssignObjectToBin(objectID, objectDefID, flag, shader, textures, if objectID >= 0 then unitDrawBinsFlagShaderUniformsTexKey.IBO:InstanceDataFromUnitIDs(objectID, objectTypeAttribID, numobjects) - unitDrawBinsFlagShaderUniformsTexKey.VAO:AddUnitsToSubmission (objectID) + unitDrawBinsFlagShaderUniformsTexKey.VAO:AddUnitsToSubmission(objectID) else unitDrawBinsFlagShaderUniformsTexKey.IBO:InstanceDataFromFeatureIDs(-objectID, objectTypeAttribID, numobjects) - unitDrawBinsFlagShaderUniformsTexKey.VAO:AddFeaturesToSubmission (-objectID) + unitDrawBinsFlagShaderUniformsTexKey.VAO:AddFeaturesToSubmission(-objectID) end numobjects = numobjects + 1 unitDrawBinsFlagShaderUniformsTexKey.numobjects = numobjects unitDrawBinsFlagShaderUniformsTexKey.objectsArray[numobjects] = objectID - unitDrawBinsFlagShaderUniformsTexKey.objectsIndex[objectID ] = numobjects + unitDrawBinsFlagShaderUniformsTexKey.objectsIndex[objectID] = numobjects if debugmode and flag == 0 then - Spring.Echo("AssignObjectToBin", objectID, objectDefID, texKey,uniformBinID, shader,flag, numobjects) + Spring.Echo("AssignObjectToBin", objectID, objectDefID, texKey, uniformBinID, shader, flag, numobjects) local objids = "objectsArray " - for k,v in pairs(unitDrawBinsFlagShaderUniformsTexKey.objectsArray) do - objids = objids .. tostring(k) .. ":" ..tostring(v) .. " " + for k, v in pairs(unitDrawBinsFlagShaderUniformsTexKey.objectsArray) do + objids = objids .. tostring(k) .. ":" .. tostring(v) .. " " end Spring.Echo(objids) end @@ -1383,7 +1364,7 @@ local spSetFeatureFade = Spring.SetFeatureFade local glSetUnitBufferUniforms = gl.SetUnitBufferUniforms local function AddObject(objectID, drawFlag, reason) - if (drawFlag >= 128) then --icon + if drawFlag >= 128 then --icon return end @@ -1395,16 +1376,20 @@ local function AddObject(objectID, drawFlag, reason) objectDefID = -1 * spGetFeatureDefID(-1 * objectID) objectIDtoDefID[objectID] = objectDefID end - if debugmode then Spring.Echo("AddObject",objectID, objectDefID, drawFlag, reason) end - if objectDefID == nil then return end -- This bail is needed so that we dont add/update units that dont actually exist any more, when cached from the catchup phase + if debugmode then + Spring.Echo("AddObject", objectID, objectDefID, drawFlag, reason) + end + if objectDefID == nil then + return + end -- This bail is needed so that we dont add/update units that dont actually exist any more, when cached from the catchup phase local drawBinKeysLen = #drawBinKeys for k = 1, drawBinKeysLen do local flag = drawBinKeys[k] if HasAllBits(drawFlag, flag) then if overrideDrawFlagsCombined[flag] then - --objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom - AssignObjectToBin(objectID, objectDefID, flag, nil, nil, nil, nil, "addobject") + --objectID, objectDefID, flag, shader, textures, texKey, uniformBinID, calledfrom + AssignObjectToBin(objectID, objectDefID, flag, nil, nil, nil, nil, "addobject") end end end @@ -1415,17 +1400,21 @@ local function AddObject(objectID, drawFlag, reason) if health then uniformCache[1] = ((build < 1) and build) or -1 glSetUnitBufferUniforms(objectID, uniformCache, 0) -- buildprogress (0.x) - if build < 1 then buildProgresses[objectID] = build end + if build < 1 then + buildProgresses[objectID] = build + end --uniformCache[1] = spGetUnitHeight(objectID) --glSetUnitBufferUniforms(objectID, uniformCache, 11) -- height is 11 (2.w) end else - if spValidFeatureID(-1 * objectID) == false then Spring.Echo("Invalid feature for drawmask", objectID, objectDefID) end + if spValidFeatureID(-1 * objectID) == false then + Spring.Echo("Invalid feature for drawmask", objectID, objectDefID) + end spSetFeatureEngineDrawMask(-1 * objectID, 255 - overrideDrawFlag) -- ~overrideDrawFlag & 255 spSetFeatureNoDraw(-1 * objectID, false) -- ~overrideDrawFlag & 255 spSetFeatureFade(-1 * objectID, true) -- ~overrideDrawFlag & 255 - cusFeatureIDtoDrawFlag[-1 *objectID] = drawFlag + cusFeatureIDtoDrawFlag[-1 * objectID] = drawFlag end --cusUnitIDtoDrawFlag[unitID] = overrideDrawFlag end @@ -1433,12 +1422,13 @@ end local function RemoveObjectFromBin(objectID, objectDefID, texKey, shader, flag, uniformBinID, reason) shader = shader or GetShaderName(flag, objectDefID) texKey = texKey or fastObjectDefIDtoTextureKey[objectDefID] - if debugmode then Spring.Echo("RemoveObjectFromBin", objectID, objectDefID, texKey,shader,flag,uniformBinID, reason) end + if debugmode then + Spring.Echo("RemoveObjectFromBin", objectID, objectDefID, texKey, shader, flag, uniformBinID, reason) + end if unitDrawBins[flag][shader] then if unitDrawBins[flag][shader][uniformBinID] then if unitDrawBins[flag][shader][uniformBinID][texKey] then - -- do the pop magic local unitDrawBinsFlagShaderTexKey = unitDrawBins[flag][shader][uniformBinID][texKey] local objectIndex = unitDrawBinsFlagShaderTexKey.objectsIndex[objectID] @@ -1454,41 +1444,49 @@ local function RemoveObjectFromBin(objectID, objectDefID, texKey, shader, flag, if objectIndex == numobjects then -- last element unitDrawBinsFlagShaderTexKey.objectsIndex[objectID] = nil unitDrawBinsFlagShaderTexKey.objectsArray[numobjects] = nil - unitDrawBinsFlagShaderTexKey.numobjects = numobjects -1 + unitDrawBinsFlagShaderTexKey.numobjects = numobjects - 1 else local objectIDatEnd = unitDrawBinsFlagShaderTexKey.objectsArray[numobjects] - if debugmode and flag == 0 then Spring.Echo("Moving", objectIDatEnd, "from", numobjects, " to", objectIndex, "while removing", objectID) end - unitDrawBinsFlagShaderTexKey.objectsIndex[objectID ] = nil -- pop back + if debugmode and flag == 0 then + Spring.Echo("Moving", objectIDatEnd, "from", numobjects, " to", objectIndex, "while removing", objectID) + end + unitDrawBinsFlagShaderTexKey.objectsIndex[objectID] = nil -- pop back unitDrawBinsFlagShaderTexKey.objectsIndex[objectIDatEnd] = objectIndex -- bring the last objectID to to this one if objectID >= 0 then -- unit if Spring.ValidUnitID(objectIDatEnd) == true and Spring.GetUnitIsDead(objectIDatEnd) ~= true then unitDrawBinsFlagShaderTexKey.IBO:InstanceDataFromUnitIDs(objectIDatEnd, objectTypeAttribID, objectIndex - 1) else - if debugmode then Spring.Echo("Tried to remove invalid unitID", objectIDatEnd, "while removing", objectID) end + if debugmode then + Spring.Echo("Tried to remove invalid unitID", objectIDatEnd, "while removing", objectID) + end end else -- feauture if Spring.ValidFeatureID(-objectIDatEnd) == true then unitDrawBinsFlagShaderTexKey.IBO:InstanceDataFromFeatureIDs(-1 * objectIDatEnd, objectTypeAttribID, objectIndex - 1) else - if debugmode then Spring.Echo("Tried to remove invalid featureID", -objectIDatEnd, "while removing", -objectID) end + if debugmode then + Spring.Echo("Tried to remove invalid featureID", -objectIDatEnd, "while removing", -objectID) + end end end - unitDrawBinsFlagShaderTexKey.objectsArray[numobjects ] = nil -- pop back + unitDrawBinsFlagShaderTexKey.objectsArray[numobjects] = nil -- pop back unitDrawBinsFlagShaderTexKey.objectsArray[objectIndex] = objectIDatEnd -- Bring the last objectID here - unitDrawBinsFlagShaderTexKey.numobjects = numobjects -1 + unitDrawBinsFlagShaderTexKey.numobjects = numobjects - 1 end end else - if debugmode then Spring.Echo("Failed to find uniformBinID for", objectID, objectDefID, texKey, shader, flag, uniformBinID) end + if debugmode then + Spring.Echo("Failed to find uniformBinID for", objectID, objectDefID, texKey, shader, flag, uniformBinID) + end end else if debugmode then - local defName ='niiiil' + local defName = "niiiil" if objectDefID then if objectDefID >= 0 then - defName = UnitDefs[objectDefID].name + defName = UnitDefs[objectDefID].name else - defName = FeatureDefs[-1 * objectDefID].name + defName = FeatureDefs[-1 * objectDefID].name end end Spring.Echo("Failed to find shader for", objectID, objectDefID, texKey, shader, flag, uniformBinID, defName) @@ -1498,8 +1496,10 @@ local function RemoveObjectFromBin(objectID, objectDefID, texKey, shader, flag, end local function UpdateObject(objectID, drawFlag, reason) - if debugmode then Spring.Echo("UpdateObject", objectID, drawFlag, reason) end - if (drawFlag >= 128) then --icon + if debugmode then + Spring.Echo("UpdateObject", objectID, drawFlag, reason) + end + if drawFlag >= 128 then --icon return end @@ -1515,8 +1515,8 @@ local function UpdateObject(objectID, drawFlag, reason) if hasFlagOld ~= hasFlagNew and overrideDrawFlagsCombined[flag] then local shader = GetShaderName(flag, objectDefID) - local texKey = fastObjectDefIDtoTextureKey[objectDefID] - local uniformBinID = GetUniformBinID(objectDefID,'UpdateObject') + local texKey = fastObjectDefIDtoTextureKey[objectDefID] + local uniformBinID = GetUniformBinID(objectDefID, "UpdateObject") if hasFlagOld then --had this flag, but no longer have RemoveObjectFromBin(objectID, objectDefID, texKey, shader, flag, uniformBinID, "nolongerhasflag") @@ -1541,9 +1541,13 @@ end local function RemoveObject(objectID, reason) -- we get pos/neg objectID here --remove the object from every bin and table - if debugmode then Spring.Echo("RemoveObject", objectID, reason) end + if debugmode then + Spring.Echo("RemoveObject", objectID, reason) + end local objectDefID = objectIDtoDefID[objectID] - if objectDefID == nil then return end + if objectDefID == nil then + return + end --if objectID == nil then Spring.Debug.TraceFullEcho() end --if debugmode then Spring.Debug.TraceEcho("RemoveObject", objectID) end @@ -1558,13 +1562,17 @@ local function RemoveObject(objectID, reason) -- we get pos/neg objectID here local shader = GetShaderName(1, objectDefID) local texKey = fastObjectDefIDtoTextureKey[objectDefID] - local uniformBinID = GetUniformBinID(objectDefID,'RemoveObject') + local uniformBinID = GetUniformBinID(objectDefID, "RemoveObject") local drawBinKeysLen = #drawBinKeys for k = 1, drawBinKeysLen do --drawBinKeys = {1, 1 + 4, 16} local flag = drawBinKeys[k] - if (oldFlag < flag) then break end -- if shadows are off, then dont even try to remove from them - if debugmode then Spring.Echo("RemoveObject Flags", objectID, flag, overrideDrawFlagsCombined[flag] ) end + if oldFlag < flag then + break + end -- if shadows are off, then dont even try to remove from them + if debugmode then + Spring.Echo("RemoveObject Flags", objectID, flag, overrideDrawFlagsCombined[flag]) + end if overrideDrawFlagsCombined[flag] then RemoveObjectFromBin(objectID, objectDefID, texKey, shader, flag, uniformBinID, "removeobject") --if flag == 1 then @@ -1592,8 +1600,9 @@ local function ProcessUnits(units, drawFlags, reason) for i = 1, numUnits do local unitID = units[i] local drawFlag = drawFlags[i] - if debugmode then Spring.Echo("ProcessUnits", unitID, drawFlag, reason) end - + if debugmode then + Spring.Echo("ProcessUnits", unitID, drawFlag, reason) + end if math_bit_and(drawFlag, 34) > 0 then -- has alpha (2) or alphashadow(32) flag -- cloaked units get mapped to pure forward + deferred, no refl/refr either @@ -1630,7 +1639,6 @@ local function ProcessUnits(units, drawFlags, reason) end end end - end local spValidFeatureID = Spring.ValidFeatureID local spSetFeatureEngineDrawMask = Spring.SetFeatureEngineDrawMask @@ -1678,15 +1686,16 @@ local function ProcessFeatures(features, drawFlags, reason) end end end - end local shaderactivations = 0 -local shaderOrder = {'tree','feature','unit','unitskinning'} -- this forces ordering, no real reason to do so, just for testing +local shaderOrder = { "tree", "feature", "unit", "unitskinning" } -- this forces ordering, no real reason to do so, just for testing local drawpassstats = {} -- a table of drawpass number and the actual number of units and batches performed by that pass -for drawpass, _ in pairs(overrideDrawFlagsCombined) do drawpassstats[drawpass] = {shaders = 0, batches = 0, units = 0} end +for drawpass, _ in pairs(overrideDrawFlagsCombined) do + drawpassstats[drawpass] = { shaders = 0, batches = 0, units = 0 } +end local function printDrawPassStats() res = "" @@ -1703,7 +1712,7 @@ local function ExecuteDrawPass(drawPass) local shaderswaps = 0 local unbindtextures = false gl.Culling(GL.BACK) - if (drawPass == 1) then --forward opaque pass + if drawPass == 1 then --forward opaque pass gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- --gl.PolygonOffset(-2.0, -2.0); end @@ -1728,7 +1737,7 @@ local function ExecuteDrawPass(drawPass) shaderswaps = shaderswaps + 1 -- Set feature fade uniforms for tree/feature shaders - if shaderName == 'tree' or shaderName == 'feature' then + if shaderName == "tree" or shaderName == "feature" then local sObj = shaderTable.shaderObj local locCache = uniformLocCache[sObj] if locCache == nil then @@ -1745,12 +1754,15 @@ local function ExecuteDrawPass(drawPass) drawLoc = gl.GetUniformLocation(sObj, "featureDrawDistSq") locCache.featureDrawDistSq = drawLoc or false end - if fadeLoc then gl.Uniform(fadeLoc, featureFadeDistSq) end - if drawLoc then gl.Uniform(drawLoc, featureDrawDistSq) end + if fadeLoc then + gl.Uniform(fadeLoc, featureFadeDistSq) + end + if drawLoc then + gl.Uniform(drawLoc, featureDrawDistSq) + end end for uniformBinID, uniformBin in pairs(data) do - -- Skip uniform bins that have no objects to draw local binHasObjects = false for _, texAndObj in pairs(uniformBin) do @@ -1764,7 +1776,7 @@ local function ExecuteDrawPass(drawPass) SetShaderUniforms(drawPass, shaderTable.shaderObj, uniformBinID) for _, texAndObj in pairs(uniformBin) do - if texAndObj.numobjects > 0 then + if texAndObj.numobjects > 0 then batches = batches + 1 units = units + texAndObj.numobjects local mybinVAO = texAndObj.VAO @@ -1779,7 +1791,6 @@ local function ExecuteDrawPass(drawPass) SetFixedStatePost(drawPass, shaderTable) unbindtextures = true - end end end @@ -1791,7 +1802,7 @@ local function ExecuteDrawPass(drawPass) end if unbindtextures then - for i=0,10 do + for i = 0, 10 do gl.Texture(i, false) end end @@ -1818,32 +1829,33 @@ local function RecompileShaders(recompilation) compileMaterialShader(unitsNormalMapTemplate, "unit", recompilation) compileMaterialShader(unitsSkinningTemplate, "unitskinning", recompilation) compileMaterialShader(featuresNormalMapTemplate, "feature", recompilation) - compileMaterialShader(treesNormalMapTemplate, "tree",recompilation) + compileMaterialShader(treesNormalMapTemplate, "tree", recompilation) end - local function initGL4() - if initiated then return end + if initiated then + return + end if Platform.glHaveGL4 ~= true then Spring.Echo("[CUS GL4] No GL4 support for this gpu as indicated by Platform.glHaveGL4, disabling.") return end - shaders[0 ] = {} + shaders[0] = {} for k = 1, #drawBinKeys do local flag = drawBinKeys[k] shaders[flag] = {} end unitDrawBins = { - [0 ] = {}, -- deferred opaque - [1 ] = {}, -- forward opaque - [1 + 4] = {}, -- forward opaque + reflection + [0] = {}, -- deferred opaque + [1] = {}, -- forward opaque + [1 + 4] = {}, -- forward opaque + reflection -- refraction and alpha bins are intentionally not allocated: -- drawBinKeys does not include them, so they would never be populated. -- See overrideDrawFlagsCombined / drawBinKeys above. - [16 ] = {}, -- shadow + [16] = {}, -- shadow } Spring.Echo("[CUS GL4] Initializing materials") @@ -1872,9 +1884,10 @@ local function initGL4() initiated = true end - local function ReloadCUSGL4(optName, line, words, playerID) - if initiated and (not words) then return end + if initiated and not words then + return + end manualReload = true if playerID ~= Spring.GetMyPlayerID() then return @@ -1893,12 +1906,11 @@ local function DisableCUSGL4(optName, _, _, playerID) gadget:Shutdown() end - function gadget:GameFrame(n) if not itsXmas and SYNCED.itsXmas then itsXmas = true initiated = false - ReloadCUSGL4(nil,nil,nil, Spring.GetMyPlayerID()) + ReloadCUSGL4(nil, nil, nil, Spring.GetMyPlayerID()) end for unitID, buildProgress in pairs(buildProgresses) do local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) @@ -1941,36 +1953,38 @@ local function DumpCUSGL4(optName, line, words, playerID) end Spring.Echo("[CustomUnitShadersGL4] Dumping unit bins:", debugmode) - if unitDrawBins == nil then return end + if unitDrawBins == nil then + return + end for drawflag, bin in pairs(unitDrawBins) do - Spring.Echo(string.format("%i = { -- drawFlag",drawflag)) + Spring.Echo(string.format("%i = { -- drawFlag", drawflag)) for shadername, uniformbin in pairs(bin) do - Spring.Echo(string.format(" %s = { -- shadername",shadername)) + Spring.Echo(string.format(" %s = { -- shadername", shadername)) for uniformbinid, texandobjset in pairs(uniformbin) do - Spring.Echo(string.format(" %s = { -- uniformbin",uniformbinid)) + Spring.Echo(string.format(" %s = { -- uniformbin", uniformbinid)) for texturekey, minibin in pairs(texandobjset) do - Spring.Echo(string.format(" %i = { -- textureset",texturekey)) + Spring.Echo(string.format(" %i = { -- textureset", texturekey)) for minibinattr, minibinvalue in pairs(minibin) do - if type( minibinvalue ) == "table" then - Spring.Echo(string.format(" %s = {",minibinattr)) + if type(minibinvalue) == "table" then + Spring.Echo(string.format(" %s = {", minibinattr)) if minibinattr == "objectsIndex" then - for k,v in pairs(minibinvalue) do - local objdefname = (k>=0 and Spring.GetUnitDefID(k) and UnitDefs[Spring.GetUnitDefID(k)].name) or (Spring.GetFeatureDefID(-1 * k) and FeatureDefs[Spring.GetFeatureDefID(-1 * k) ].name) or "???" - Spring.Echo(string.format(" %i = %i, --(%s)", k,v,objdefname)) + for k, v in pairs(minibinvalue) do + local objdefname = (k >= 0 and Spring.GetUnitDefID(k) and UnitDefs[Spring.GetUnitDefID(k)].name) or (Spring.GetFeatureDefID(-1 * k) and FeatureDefs[Spring.GetFeatureDefID(-1 * k)].name) or "???" + Spring.Echo(string.format(" %i = %i, --(%s)", k, v, objdefname)) end elseif minibinattr == "objectsArray" then - for k,v in pairs(minibinvalue) do - local objdefname = (v>=0 and Spring.GetUnitDefID(v) and UnitDefs[Spring.GetUnitDefID(v)].name) or (Spring.GetFeatureDefID(-1 * v) and FeatureDefs[Spring.GetFeatureDefID(-1 * v) ].name) or "???" - Spring.Echo(string.format(" %i = %i, --(%s)", k,v,objdefname)) + for k, v in pairs(minibinvalue) do + local objdefname = (v >= 0 and Spring.GetUnitDefID(v) and UnitDefs[Spring.GetUnitDefID(v)].name) or (Spring.GetFeatureDefID(-1 * v) and FeatureDefs[Spring.GetFeatureDefID(-1 * v)].name) or "???" + Spring.Echo(string.format(" %i = %i, --(%s)", k, v, objdefname)) end else - for k,v in pairs(minibinvalue) do - Spring.Echo(string.format(" %s = %s,", tostring(k),tostring(v))) + for k, v in pairs(minibinvalue) do + Spring.Echo(string.format(" %s = %s,", tostring(k), tostring(v))) end end Spring.Echo(" },") else - Spring.Echo(string.format(" %s = %s,", tostring(minibinattr),tostring(minibinvalue))) + Spring.Echo(string.format(" %s = %s,", tostring(minibinattr), tostring(minibinvalue))) end end Spring.Echo(" },") @@ -1983,14 +1997,15 @@ local function DumpCUSGL4(optName, line, words, playerID) end end - local function MarkBinCUSGL4(optName, line, words, playerID) - if (playerID ~= Spring.GetMyPlayerID()) then + if playerID ~= Spring.GetMyPlayerID() then return end Spring.Echo("[CustomUnitShadersGL4] Marking Bins", optName, line, words, playerID) local passnum = tonumber(line) - if passnum == nil then return end + if passnum == nil then + return + end local function markBin(drawPass) local count = 0 @@ -2003,15 +2018,10 @@ local function MarkBinCUSGL4(optName, line, words, playerID) if objectID > 0 then px, py, pz = Spring.GetUnitPosition(objectID) else - px, py, pz = Spring.GetFeaturePosition(-1* objectID) + px, py, pz = Spring.GetFeaturePosition(-1 * objectID) end if px then - Spring.MarkerAddPoint(px,py,pz, - tostring(drawPass) .. "/" .. - tostring(shadername) .. "/" .. - tostring(uniformbinid) .. "/" .. - tostring(texturekey) .. "/" .. - tostring(objectID)) + Spring.MarkerAddPoint(px, py, pz, tostring(drawPass) .. "/" .. tostring(shadername) .. "/" .. tostring(uniformbinid) .. "/" .. tostring(texturekey) .. "/" .. tostring(objectID)) count = count + 1 end end @@ -2030,12 +2040,12 @@ local function FreeTextures() -- pre we are using 2200mb Spring.Echo("Freeing textures") --delete raptor texes if no raptors are present for unitDefID, uniformBin in pairs(objectDefToUniformBin) do - if uniformBin == 'raptor' then + if uniformBin == "raptor" then local textureTable = textureKeytoSet[fastObjectDefIDtoTextureKey[unitDefID]] local s1 = gl.DeleteTexture(textureTable[0]) local s2 = gl.DeleteTexture(textureTable[1]) - Spring.Echo("Freeing ",textureTable[0],textureTable[1], s1, s2) + Spring.Echo("Freeing ", textureTable[0], textureTable[1], s1, s2) end end @@ -2043,7 +2053,9 @@ local function FreeTextures() -- pre we are using 2200mb local features = Spring.GetAllFeatures() local delFeatureDefs = {} - for featureDefID, featureDef in pairs(FeatureDefs) do delFeatureDefs[featureDefID] = true end + for featureDefID, featureDef in pairs(FeatureDefs) do + delFeatureDefs[featureDefID] = true + end for i, featureID in ipairs(features) do local existingFeatureDefID = Spring.GetFeatureDefID(featureID) @@ -2052,27 +2064,22 @@ local function FreeTextures() -- pre we are using 2200mb for featureDefID, deleteme in pairs(delFeatureDefs) do local textureTable = textureKeytoSet[fastObjectDefIDtoTextureKey[-featureDefID]] - local s1 = gl.DeleteTexture(textureTable[0]) - local s2 = gl.DeleteTexture(textureTable[1]) + local s1 = gl.DeleteTexture(textureTable[0]) + local s2 = gl.DeleteTexture(textureTable[1]) - Spring.Echo("Freeing ",textureTable[0],textureTable[1], s1, s2) + Spring.Echo("Freeing ", textureTable[0], textureTable[1], s1, s2) end Spring.Echo("RawDelete") local unittexfiles = VFS.DirList("unittextures/") for i, fname in ipairs(unittexfiles) do - if string.find(fname,'chicken', nil, true) then + if string.find(fname, "chicken", nil, true) then local s1 = gl.DeleteTexture(fname) - Spring.Echo("Freeing ",fname, s1) - + Spring.Echo("Freeing ", fname, s1) end - end - - end - function gadget:Initialize() gadgetHandler:AddChatAction("reloadcusgl4", ReloadCUSGL4) gadgetHandler:AddChatAction("disablecusgl4", DisableCUSGL4) @@ -2098,11 +2105,12 @@ function gadget:Initialize() GG.CUSGL4.GetShaderName = GetShaderName GG.CUSGL4.SetShaderUniforms = SetShaderUniforms GG.CUSGL4.enabled = true - end function gadget:Shutdown() - if debugmode then Spring.Echo(unitDrawBins, 'unitDrawBins') end + if debugmode then + Spring.Echo(unitDrawBins, "unitDrawBins") + end for unitID, _ in pairs(cusUnitIDtoDrawFlag) do RemoveObject(unitID, "shutdown") @@ -2127,7 +2135,7 @@ function gadget:Shutdown() --gadgetHandler:RemoveChatAction("reloadcusgl4") --gadgetHandler:RemoveChatAction("cusgl4updaterate") if GG.CUSGL4 then - for k,v in pairs(GG.CUSGL4) do + for k, v in pairs(GG.CUSGL4) do GG.CUSGL4[k] = nil end end @@ -2135,22 +2143,17 @@ function gadget:Shutdown() GG.CUSGL4 = nil end - - local updateframe = 0 - - - local function countbintypes(flagarray) local fwcnt = 0 local defcnt = 0 local reflcnt = 0 local shadcnt = 0 - for i=1, #flagarray do + for i = 1, #flagarray do local flag = flagarray[i] - if HasBit(flag,1) then + if HasBit(flag, 1) then fwcnt = fwcnt + 1 defcnt = defcnt + 1 end @@ -2179,10 +2182,9 @@ local numdestroyedFeatures = 0 --On next Update: -- 3. next gadget:DrawWorldPreUnit is called -- 4. ProcessUnits(destroyedUnitIDs) - -- 4.1 can either AddUnit, UpdateUnit or RemoveUnit +-- 4.1 can either AddUnit, UpdateUnit or RemoveUnit -- 5. Regular draw flag changes are processed - local function UpdateUnit(unitID, flag) numdestroyedUnits = numdestroyedUnits + 1 destroyedUnitIDs[numdestroyedUnits] = unitID @@ -2198,9 +2200,9 @@ function gadget:RenderUnitDestroyed(unitID, unitDefID) end function gadget:UnitFinished(unitID) - gl.SetUnitBufferUniforms(unitID, {-1}, 0) -- set build progress to built + gl.SetUnitBufferUniforms(unitID, { -1 }, 0) -- set build progress to built buildProgresses[unitID] = nil - UpdateUnit(unitID,Spring.GetUnitDrawFlag(unitID)) + UpdateUnit(unitID, Spring.GetUnitDrawFlag(unitID)) end local unitDefModelMaxY = {} @@ -2217,7 +2219,7 @@ function gadget:UnitCreated(unitID, unitDefID) gl.SetUnitBufferUniforms(unitID, uniformCache, 12) -- clear cloak effect gl.SetUnitBufferUniforms(unitID, uniformCache, 6) -- clear selectedness effect - UpdateUnit(unitID,Spring.GetUnitDrawFlag(unitID)) + UpdateUnit(unitID, Spring.GetUnitDrawFlag(unitID)) end function gadget:UnitGiven(unitID) @@ -2239,14 +2241,14 @@ end function gadget:UnitCloaked(unitID) uniformCache[1] = Spring.GetGameFrame() gl.SetUnitBufferUniforms(unitID, uniformCache, 12) - UpdateUnit(unitID,Spring.GetUnitDrawFlag(unitID)) + UpdateUnit(unitID, Spring.GetUnitDrawFlag(unitID)) if debugmode then Spring.Echo("UnitCloaked", unitID, Spring.GetUnitDrawFlag(unitID)) end end function gadget:UnitDecloaked(unitID) - UpdateUnit(unitID,Spring.GetUnitDrawFlag(unitID)) + UpdateUnit(unitID, Spring.GetUnitDrawFlag(unitID)) uniformCache[1] = -1 * Spring.GetGameFrame() gl.SetUnitBufferUniforms(unitID, uniformCache, 12) if debugmode then @@ -2262,8 +2264,10 @@ end local firstDraw = false function gadget:DrawWorldPreUnit() ---function gadget:DrawGenesis() -- nope, shadow flags still a frame late https://github.com/beyond-all-reason/spring/issues/264 - if unitDrawBins == nil then return end + --function gadget:DrawGenesis() -- nope, shadow flags still a frame late https://github.com/beyond-all-reason/spring/issues/264 + if unitDrawBins == nil then + return + end updateFeatureFadeDistances() @@ -2280,8 +2284,7 @@ function gadget:DrawWorldPreUnit() autoReload.lastUpdate = Spring.GetTimer() local defaulttemplate = VFS.Include("modelmaterials_gl4/templates/defaultMaterialTemplate.lua") - if (defaulttemplate.shader.vertex ~= defaultMaterialTemplate.shader.vertex) or - (defaulttemplate.shader.fragment ~= defaultMaterialTemplate.shader.fragment) then + if (defaulttemplate.shader.vertex ~= defaultMaterialTemplate.shader.vertex) or (defaulttemplate.shader.fragment ~= defaultMaterialTemplate.shader.fragment) then -- recompile on change: Spring.Echo("Changes to CUS shaders detected, recompiling...") RecompileShaders(true) @@ -2289,7 +2292,6 @@ function gadget:DrawWorldPreUnit() end end - if manualReload then manualReload = false units, drawFlagsUnits = Spring.GetRenderUnits(overrideDrawFlag, true) @@ -2306,10 +2308,12 @@ function gadget:DrawWorldPreUnit() local totalobjects = #units + #features + numdestroyedUnits + numdestroyedFeatures -- Why do we also do this processing round if #units > 0? - if debugmode and (#destroyedUnitIDs>0 or #units > 0) then Spring.Echo("Processing destroyedUnitIDs", #units, #destroyedUnitIDs) end + if debugmode and (#destroyedUnitIDs > 0 or #units > 0) then + Spring.Echo("Processing destroyedUnitIDs", #units, #destroyedUnitIDs) + end if numdestroyedUnits > 0 then ProcessUnits(destroyedUnitIDs, destroyedUnitDrawFlags, "destroyed") - for i=numdestroyedUnits,1,-1 do + for i = numdestroyedUnits, 1, -1 do destroyedUnitIDs[i] = nil destroyedUnitDrawFlags[i] = nil end @@ -2317,9 +2321,8 @@ function gadget:DrawWorldPreUnit() end if numdestroyedFeatures > 0 then - ProcessFeatures(destroyedFeatureIDs, destroyedFeatureDrawFlags, "destroyed") - for i=numdestroyedFeatures,1,-1 do + for i = numdestroyedFeatures, 1, -1 do destroyedFeatureIDs[i] = nil destroyedFeatureDrawFlags[i] = nil end @@ -2337,55 +2340,57 @@ function gadget:DrawWorldPreUnit() validFirstFeatures[numfirstfeatures] = featureID firstdrawFlagsFeatures[numfirstfeatures] = flag end - end ProcessFeatures(validFirstFeatures, firstdrawFlagsFeatures, "firstDraw") local firstunits = Spring.GetVisibleUnits() local firstdrawFlagsUnits = {} - for i, unitID in ipairs(firstunits) do firstdrawFlagsUnits[i] = 1 + 4 + 16 end + for i, unitID in ipairs(firstunits) do + firstdrawFlagsUnits[i] = 1 + 4 + 16 + end ProcessUnits(firstunits, firstdrawFlagsUnits, "firstDraw") firstDraw = false end - ProcessUnits(units, drawFlagsUnits, "changed") ProcessFeatures(features, drawFlagsFeatures, "changed") - local deltat = Spring.DiffTimers(Spring.GetTimerMicros(),t0, nil) -- in ms + local deltat = Spring.DiffTimers(Spring.GetTimerMicros(), t0, nil) -- in ms --Spring.Echo(deltat) if (deltat > 2) and perfdebug then - local usecperobjectchange = (1000* deltat) / (totalobjects) - Spring.Echo("[CUS GL4] [",Spring.GetDrawFrame(),"]",totalobjects," Update time 2 < ", deltat, string.format("ms, per object change: %.2fus ", usecperobjectchange), totalobjects , 'objs') + local usecperobjectchange = (1000 * deltat) / totalobjects + Spring.Echo("[CUS GL4] [", Spring.GetDrawFrame(), "]", totalobjects, " Update time 2 < ", deltat, string.format("ms, per object change: %.2fus ", usecperobjectchange), totalobjects, "objs") -- PERF CONCULUSION: - -- Additions of units are about 30 uS - -- Removals of units is about 50 uS + -- Additions of units are about 30 uS + -- Removals of units is about 50 uS -- After faster texture key lookups, this has dropped significantly: - -- Additions of units are about 7 uS - -- Removals of units is about 10 uS + -- Additions of units are about 7 uS + -- Removals of units is about 10 uS -- Using shared deferred and forward bin perf is now even closer: - -- Addition 6 us - -- Removal 7 us + -- Addition 6 us + -- Removal 7 us -- Further optimizations: - -- addition is 2.2us per unit - -- removal is 3.2us per unit + -- addition is 2.2us per unit + -- removal is 3.2us per unit -- After only handling fw, refl and shadow: - -- Addition is 1.98us per unit - -- removal is 2.40 us per unit + -- Addition is 1.98us per unit + -- removal is 2.40 us per unit end end end -local nightFactorBins = {tree = 1.3, feature = 1.3, featurepbr = 1.3, treepbr = 1.3} +local nightFactorBins = { tree = 1.3, feature = 1.3, featurepbr = 1.3, treepbr = 1.3 } local lastSunChanged = -1 function gadget:SunChanged() -- Note that map_nightmode.lua gadget has to change sun twice in a single draw frame to update all local df = Spring.GetDrawFrame() - if df == lastSunChanged then return end + if df == lastSunChanged then + return + end lastSunChanged = df local nightFactor = 1.0 - if GG['NightFactor'] then - nightFactor = (GG['NightFactor'].red + GG['NightFactor'].green + GG['NightFactor'].blue) * 0.33 + if GG["NightFactor"] then + nightFactor = (GG["NightFactor"].red + GG["NightFactor"].green + GG["NightFactor"].blue) * 0.33 end for uniformBinName, defaultBrightnessFactor in pairs(nightFactorBins) do uniformBins[uniformBinName].brightnessFactor = defaultBrightnessFactor * nightFactor @@ -2396,7 +2401,9 @@ end -- bit 1 is the opaque forward pass local function drawPassBitsToNumber(opaquePass, deferredPass, drawReflection, drawRefraction) local drawPass = 0 - if deferredPass then return drawPass end + if deferredPass then + return drawPass + end if opaquePass then drawPass = drawPass + 1 @@ -2415,14 +2422,19 @@ local function drawPassBitsToNumber(opaquePass, deferredPass, drawReflection, dr end function gadget:DrawOpaqueUnitsLua(deferredPass, drawReflection, drawRefraction) - - if unitDrawBins == nil then return end - if preloadedTextures == false then PreloadTextures() end + if unitDrawBins == nil then + return + end + if preloadedTextures == false then + PreloadTextures() + end local drawPass = drawPassBitsToNumber(true, deferredPass, drawReflection, drawRefraction) local batches, units = ExecuteDrawPass(drawPass) end function gadget:DrawShadowUnitsLua() - if unitDrawBins == nil then return end + if unitDrawBins == nil then + return + end local batches, units = ExecuteDrawPass(16) end diff --git a/luarules/gadgets/dbg_benchmark.lua b/luarules/gadgets/dbg_benchmark.lua index 9c86ccf5f2a..62357b84a4e 100644 --- a/luarules/gadgets/dbg_benchmark.lua +++ b/luarules/gadgets/dbg_benchmark.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "", license = "GNU GPL, v2 or later", layer = -1999999999, - enabled = true + enabled = true, } end @@ -28,15 +28,13 @@ function isAuthorized(playerID, subPermission) local accountID = Spring.Utilities.GetAccountID(playerID) local hasPermission = false -- check catch-all devhelpers permission (by accountID and by name for late joiners) - if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or - (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then + if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then hasPermission = true end -- check specific sub-permission if not hasPermission and subPermission then local permKey = "devhelpers_" .. subPermission - if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or - (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then + if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then hasPermission = true end end @@ -48,9 +46,7 @@ function isAuthorized(playerID, subPermission) return false end - if gadgetHandler:IsSyncedCode() then - function checkStartPlayers() for _, playerID in ipairs(Spring.GetPlayerList()) do -- update player infos @@ -67,9 +63,9 @@ if gadgetHandler:IsSyncedCode() then local maxunits = 200 local feedstep = 20 - local mapcx = Game.mapSizeX/2 - local mapcz = Game.mapSizeZ/2 - local mapcy = Spring.GetGroundHeight(mapcx,mapcz) + local mapcx = Game.mapSizeX / 2 + local mapcz = Game.mapSizeZ / 2 + local mapcy = Spring.GetGroundHeight(mapcx, mapcz) local benchmarkenabled = false local placementradius = 2000 local keepfeatures = 150 @@ -79,21 +75,24 @@ if gadgetHandler:IsSyncedCode() then local team1unitDefName = "armbull" local team2unitDefName = "armbull" - local seededrand = {} local randindex = 1 local function initrandom(seed) math.randomseed(seed) - for i=1, 5000 do + for i = 1, 5000 do seededrand[i] = math.random() end randindex = 1 end local function getrandom() - if #seededrand < 1 then initrandom(7654321) end + if #seededrand < 1 then + initrandom(7654321) + end randindex = randindex + 1 - if randindex > #seededrand then randindex = 1 end + if randindex > #seededrand then + randindex = 1 + end return seededrand[randindex] end @@ -102,23 +101,22 @@ if gadgetHandler:IsSyncedCode() then --return: nil | number count local unitDefID = UnitDefNames[unitDefName].id - local unitcount = Spring.GetTeamUnitDefCount(teamID, unitDefID) - if (unitcount < maxunits) then - local cx = mapcx + placementradius*(getrandom() - 0.5) - local cz = mapcz + placementradius*(getrandom()- 0.5) + if unitcount < maxunits then + local cx = mapcx + placementradius * (getrandom() - 0.5) + local cz = mapcz + placementradius * (getrandom() - 0.5) local sqrtfeed = math.ceil(math.sqrt(feedstep)) local footprint = math.max(UnitDefs[unitDefID].xsize, UnitDefs[unitDefID].zsize) local newUnitIDs = {} local numspawned = 0 - for x=1,sqrtfeed do + for x = 1, sqrtfeed do for z = 1, sqrtfeed do if numspawned < feedstep then local px = cx + 12 * footprint * x local pz = cz + 12 * footprint * z - local py = Spring.GetGroundHeight(px,pz) + local py = Spring.GetGroundHeight(px, pz) local unitID = Spring.CreateUnit(unitDefID, px, py, pz, "n", teamID) if unitID then numspawned = numspawned + 1 @@ -133,18 +131,18 @@ if gadgetHandler:IsSyncedCode() then --CMD.MOVE, { p.x, p.y, p.z }, 0 ) Spring.GiveOrderToUnitArray(newUnitIDs, CMD.REPEAT, { 1 }, 0) - local ncx = mapcx + placementradius*(getrandom() - 0.5) - local ncz = mapcz + placementradius*(getrandom() - 0.5) - local gh = Spring.GetGroundHeight(ncx,ncz) - Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, {ncx,gh,ncz}, {"shift"}) + local ncx = mapcx + placementradius * (getrandom() - 0.5) + local ncz = mapcz + placementradius * (getrandom() - 0.5) + local gh = Spring.GetGroundHeight(ncx, ncz) + Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, { ncx, gh, ncz }, { "shift" }) - ncx = mapcx + placementradius*(getrandom() - 0.5) - ncz = mapcz + placementradius*(getrandom() - 0.5) - gh = Spring.GetGroundHeight(ncx,ncz) - Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, {ncx,gh,ncz}, {"shift"}) + ncx = mapcx + placementradius * (getrandom() - 0.5) + ncz = mapcz + placementradius * (getrandom() - 0.5) + gh = Spring.GetGroundHeight(ncx, ncz) + Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, { ncx, gh, ncz }, { "shift" }) - gh = Spring.GetGroundHeight(cx,cz) - Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, {cx,gh,cz}, {"shift"}) + gh = Spring.GetGroundHeight(cx, cz) + Spring.GiveOrderToUnitArray(newUnitIDs, CMD.MOVE, { cx, gh, cz }, { "shift" }) benchmarktotalunitsspawned = benchmarktotalunitsspawned + numspawned end @@ -184,7 +182,7 @@ if gadgetHandler:IsSyncedCode() then end end - Spring.Echo(string.format("Removed %i units, %i wrecks, %i heaps for unitDefName %s",removedunits, removedwrecks, removedheaps, unitdefname )) + Spring.Echo(string.format("Removed %i units, %i wrecks, %i heaps for unitDefName %s", removedunits, removedwrecks, removedheaps, unitdefname)) else Spring.Echo("Removeunitdef:", unitdefname, "is not a valid UnitDefName") end @@ -193,11 +191,7 @@ if gadgetHandler:IsSyncedCode() then function benchmark(words) benchmarkenabled = not benchmarkenabled if not benchmarkenabled then - Spring.Echo(string.format("Benchmark ended, %d units spawned over %d gameframes, Units/frame = %f", - benchmarktotalunitsspawned, - Spring.GetGameFrame() - benchmarkstartgameframe, - benchmarktotalunitsspawned * (1.0 / (Spring.GetGameFrame() - benchmarkstartgameframe)) - )) + Spring.Echo(string.format("Benchmark ended, %d units spawned over %d gameframes, Units/frame = %f", benchmarktotalunitsspawned, Spring.GetGameFrame() - benchmarkstartgameframe, benchmarktotalunitsspawned * (1.0 / (Spring.GetGameFrame() - benchmarkstartgameframe)))) ExecuteRemoveUnitDefName(team1unitDefName) ExecuteRemoveUnitDefName(team2unitDefName) return @@ -205,12 +199,17 @@ if gadgetHandler:IsSyncedCode() then benchmarkstartgameframe = Spring.GetGameFrame() benchmarktotalunitsspawned = 0 initrandom(7654321) - if words[2] and UnitDefNames[words[2]] then team1unitDefName = words[2] - else Spring.Echo(words[2], "is not a valid unitDefName, using", team1unitDefName, "instead") end - - if words[3] and UnitDefNames[words[3]] then team2unitDefName = words[3] - else Spring.Echo(words[3], "is not a valid unitDefName, using", team2unitDefName, "instead") end + if words[2] and UnitDefNames[words[2]] then + team1unitDefName = words[2] + else + Spring.Echo(words[2], "is not a valid unitDefName, using", team1unitDefName, "instead") + end + if words[3] and UnitDefNames[words[3]] then + team2unitDefName = words[3] + else + Spring.Echo(words[3], "is not a valid unitDefName, using", team2unitDefName, "instead") + end if words[4] then local maxunitsint = tonumber(words[4]) @@ -245,16 +244,10 @@ if gadgetHandler:IsSyncedCode() then end end - Spring.Echo(string.format("Starting benchmark %s vs %s with %i maxunits and %i units per step in a %d radius, features live %d frames", - team1unitDefName, - team2unitDefName, - maxunits, - feedstep, - placementradius, - keepfeatures)) + Spring.Echo(string.format("Starting benchmark %s vs %s with %i maxunits and %i units per step in a %d radius, features live %d frames", team1unitDefName, team2unitDefName, maxunits, feedstep, placementradius, keepfeatures)) featuredefstoremove = {} - for _, udn in ipairs({team1unitDefName,team2unitDefName}) do - for _, wreckheap in ipairs({'_dead','_heap'}) do + for _, udn in ipairs({ team1unitDefName, team2unitDefName }) do + for _, wreckheap in ipairs({ "_dead", "_heap" }) do if FeatureDefNames[udn .. wreckheap] and FeatureDefNames[udn .. wreckheap].id then featuredefstoremove[FeatureDefNames[udn .. wreckheap].id] = true Spring.Echo(udn .. wreckheap) @@ -263,7 +256,6 @@ if gadgetHandler:IsSyncedCode() then end end - local featurestoremove = {} function gadget:FeatureCreated(featureID, allyTeam) if benchmarkenabled then @@ -276,12 +268,12 @@ if gadgetHandler:IsSyncedCode() then function gadget:GameFrame(n) if benchmarkenabled then - if (n % 3 == 0) then + if n % 3 == 0 then SpawnUnitDefsForTeamSynced(0, team1unitDefName) SpawnUnitDefsForTeamSynced(1, team2unitDefName) end - if (n % 3 == 1) then + if n % 3 == 1 then for featureID, deathtime in pairs(featurestoremove) do if deathtime < n then if Spring.ValidFeatureID(featureID) then @@ -306,8 +298,12 @@ if gadgetHandler:IsSyncedCode() then table.insert(words, word) end - if words[1] ~= "benchmark" then return end - if not isAuthorized(playerID, "terrain") then return end + if words[1] ~= "benchmark" then + return + end + if not isAuthorized(playerID, "terrain") then + return + end benchmark(words) end @@ -315,20 +311,16 @@ if gadgetHandler:IsSyncedCode() then function gadget:Initialize() checkStartPlayers() end - - -else -- UNSYNCED - - - local vsx,vsy = Spring.GetViewGeometry() +else -- UNSYNCED + local vsx, vsy = Spring.GetViewGeometry() local uiScale = vsy / 1080 local function centerCamera() local camState = Spring.GetCameraState() if camState then - local mapcx = Game.mapSizeX/2 - local mapcz = Game.mapSizeZ/2 - local mapcy = Spring.GetGroundHeight(mapcx,mapcz) + local mapcx = Game.mapSizeX / 2 + local mapcz = Game.mapSizeZ / 2 + local mapcy = Spring.GetGroundHeight(mapcx, mapcz) camState["px"] = mapcx camState["py"] = mapcy @@ -349,7 +341,6 @@ else -- UNSYNCED local benchmarkactive = false local benchmarkstats - -- An Update is always done before a Draw Frame -- An Update always Start with Gadget:Update -- A draw frame actually spans from DrawGenesis to DrawScreenPost! @@ -359,13 +350,12 @@ else -- UNSYNCED -- A - -- Spring.DiffTimers(Spring.GetTimerMicros(),tus) local lastDrawTimerUS = Spring.GetTimerMicros() local lastSimTimerUS = Spring.GetTimerMicros() local lastUpdateTimerUs = Spring.GetTimerMicros() - local lastFrameType = 'draw' -- can be draw, sim, update + local lastFrameType = "draw" -- can be draw, sim, update local simTime = 0 local drawTime = 0 local updateTime = 0 @@ -373,14 +363,14 @@ else -- UNSYNCED local benchMarkFrames = 0 -- Exponential histogram (idea taken from Prometheus/OTel native histograms) - -- Record in a large number of histogram bucckets, + -- Record in a large number of histogram bucckets, -- then reduce until <= maxBuckets non-empty buckets or we hit ~20 buckets -- Returns table of {[bucketMin] = count} pairs local function buildExpHistogram(values, maxBuckets) - -- "schema" is the exponent of 2 that defines the bucket growth rate. + -- "schema" is the exponent of 2 that defines the bucket growth rate. -- Higher schema means more buckets but more precision. local schema = 5 - local scale = 2 ^ schema -- 32 + local scale = 2 ^ schema -- 32 -- Phase 1: Record each value into exponential buckets local hist = {} local numBuckets = 0 @@ -409,12 +399,14 @@ else -- UNSYNCED numBuckets = mergedCount end -- Phase 3: Emit as {[bucketMin] = count}, with trailing boundary - local base = 2 ^ (2 ^ (-schema)) + local base = 2 ^ (2 ^ -schema) local result = {} local maxIdx = -math.huge for idx, count in pairs(hist) do result[base ^ (idx - 1)] = count - if idx > maxIdx then maxIdx = idx end + if idx > maxIdx then + maxIdx = idx + end end if maxIdx > -math.huge then result[base ^ maxIdx] = 0 @@ -435,13 +427,13 @@ else -- UNSYNCED function gadget:Update() -- START OF UPDATE if benchmarkactive then local now = Spring.GetTimerMicros() - if lastFrameType == 'draw' then + if lastFrameType == "draw" then -- We are doing a double draw else -- We are ending a sim frame, so better push the sim frame time number simTime = Spring.DiffTimers(now, lastSimTimerUS) benchmarkstats.simFrameTimes[#benchmarkstats.simFrameTimes + 1] = simTime - ss = alpha * ss + (1-alpha) * simTime + ss = alpha * ss + (1 - alpha) * simTime end lastUpdateTimerUs = Spring.GetTimerMicros() end @@ -450,16 +442,15 @@ else -- UNSYNCED function gadget:GameFrame(n) -- START OF SIM FRAME if benchmarkactive then local now = Spring.GetTimerMicros() - if lastFrameType == 'sim' then + if lastFrameType == "sim" then -- We are doing double sim, push a sim frame time number simTime = Spring.DiffTimers(now, lastSimTimerUS) benchmarkstats.simFrameTimes[#benchmarkstats.simFrameTimes + 1] = simTime - ss = alpha * ss + (1-alpha) * simTime + ss = alpha * ss + (1 - alpha) * simTime else -- we are coming off a draw frame - end lastSimTimerUS = now - lastFrameType = 'sim' + lastFrameType = "sim" end end @@ -468,7 +459,7 @@ else -- UNSYNCED local now = Spring.GetTimerMicros() updateTime = Spring.DiffTimers(now, lastUpdateTimerUs) benchmarkstats.updateFrameTimes[#benchmarkstats.updateFrameTimes + 1] = updateTime - su = alpha * su + (1-alpha) * updateTime + su = alpha * su + (1 - alpha) * updateTime lastDrawTimerUS = now end end @@ -477,9 +468,9 @@ else -- UNSYNCED if benchmarkactive then drawTime = Spring.DiffTimers(Spring.GetTimerMicros(), lastDrawTimerUS) benchmarkstats.drawFrameTimes[#benchmarkstats.drawFrameTimes + 1] = drawTime - sd = alpha * sd + (1-alpha) * drawTime + sd = alpha * sd + (1 - alpha) * drawTime - lastFrameType = 'draw' + lastFrameType = "draw" dt = drawTime end end @@ -488,10 +479,10 @@ else -- UNSYNCED if benchmarkactive or isBenchMark then local s = "" if isBenchMark then - s = s .. string.format("Benchmark Frame %d/%d\n", #benchmarkstats.simFrameTimes,benchMarkFrames) + s = s .. string.format("Benchmark Frame %d/%d\n", #benchmarkstats.simFrameTimes, benchMarkFrames) end - s = s .. string.format("Sim = ~%3.2fms (%3.2fms)\nUpdate = ~%3.2fms (%3.2fms)\nDraw = ~%3.2fms (%3.2fms)", ss, simTime, su, updateTime, sd, drawTime) - gl.Text(s, 600*uiScale, 600*uiScale, 16*uiScale) + s = s .. string.format("Sim = ~%3.2fms (%3.2fms)\nUpdate = ~%3.2fms (%3.2fms)\nDraw = ~%3.2fms (%3.2fms)", ss, simTime, su, updateTime, sd, drawTime) + gl.Text(s, 600 * uiScale, 600 * uiScale, 16 * uiScale) end end @@ -511,17 +502,17 @@ else -- UNSYNCED if playerID ~= Spring.GetMyPlayerID() then return end - Spring.Echo("Benchmark",line, words, playerID, action) + Spring.Echo("Benchmark", line, words, playerID, action) if not isAuthorized(playerID, "terrain") then return end if benchmarkactive then -- We need to dump the stats - local s1 = string.format("Benchmark complete, #created = %d, #destroyed = %d", benchmarkstats.numunitscreated, benchmarkstats.numunitsdestroyed) + local s1 = string.format("Benchmark complete, #created = %d, #destroyed = %d", benchmarkstats.numunitscreated, benchmarkstats.numunitsdestroyed) Spring.Echo(s1) local res = {} local stats = {} - for n, t in pairs({Sim = benchmarkstats.simFrameTimes, Draw = benchmarkstats.drawFrameTimes, Update = benchmarkstats.updateFrameTimes}) do + for n, t in pairs({ Sim = benchmarkstats.simFrameTimes, Draw = benchmarkstats.drawFrameTimes, Update = benchmarkstats.updateFrameTimes }) do local ms = { count = 0, total = 0, @@ -529,12 +520,11 @@ else -- UNSYNCED spread = 0, buckets = {}, percentiles = {}, - - } --mystats + } --mystats -- Discard first 10% local ct = {} -- cleantable local oldtotal = #t - for i,v in ipairs(t) do + for i, v in ipairs(t) do if i > (oldtotal * 0.1) then ms.count = ms.count + 1 ct[ms.count] = v @@ -542,30 +532,29 @@ else -- UNSYNCED end end - ms.mean = ms.total/ms.count + ms.mean = ms.total / ms.count table.sort(ct) for i, v in ipairs(ct) do - ms.spread = ms.spread + math.abs( v - ms.mean) + ms.spread = ms.spread + math.abs(v - ms.mean) end - ms.spread = ms.spread/ms.count + ms.spread = ms.spread / ms.count ms.buckets = buildExpHistogram(ct, 20) - for _,i in ipairs({0,1,2,5,10,20,35,50,65,80,90,95,98,99,100}) do - ms.percentiles[i] = ct[math.min(#ct, 1 + math.floor(i*0.01 * #ct))] + for _, i in ipairs({ 0, 1, 2, 5, 10, 20, 35, 50, 65, 80, 90, 95, 98, 99, 100 }) do + ms.percentiles[i] = ct[math.min(#ct, 1 + math.floor(i * 0.01 * #ct))] end stats[n] = ms local total = 0 - for i,v in ipairs(t) do + for i, v in ipairs(t) do total = total + v end - local s2 = string.format("%s %d frames, %3.2fms per frame, %4.2fs total", - n, ms.count, ms.mean, ms.total) - res[#res+1] = s2 + local s2 = string.format("%s %d frames, %3.2fms per frame, %4.2fs total", n, ms.count, ms.mean, ms.total) + res[#res + 1] = s2 Spring.Echo(s2) end @@ -577,7 +566,7 @@ else -- UNSYNCED stats.engineVersion = Engine.versionFull stats.gpu = Platform.gpu stats.cpu = Platform.hwConfig - stats.display = tostring(vsx) ..'x' .. tostring(vsy) + stats.display = tostring(vsx) .. "x" .. tostring(vsy) Spring.Echo("Benchmark Results") Spring.Echo(stats) @@ -589,8 +578,10 @@ else -- UNSYNCED -- Percentiles are also redundant server-side: they're derivable -- from the buckets and, unlike buckets, can't be aggregated -- across runs, so keeping them would just waste bandwidth and DB space. - for _, key in ipairs({"Sim", "Draw", "Update"}) do - if stats[key] then stats[key].percentiles = nil end + for _, key in ipairs({ "Sim", "Draw", "Update" }) do + if stats[key] then + stats[key].percentiles = nil + end end local message = Json.encode(stats) --Spring.Echo("Sending Message", message) @@ -598,7 +589,6 @@ else -- UNSYNCED end end - -- clean up --benchmarkstats = {} else @@ -621,30 +611,31 @@ else -- UNSYNCED drawFrameTimes = {}, updateFrameTimes = {}, numunitscreated = 0, - numunitsdestroyed= 0, + numunitsdestroyed = 0, } lastDrawTimerUS = Spring.GetTimerMicros() lastSimTimerUS = Spring.GetTimerMicros() lastUpdateTimerUs = Spring.GetTimerMicros() end benchmarkactive = not benchmarkactive - local msg = PACKET_HEADER .. ':benchmark' - for i=1,5 do - if words[i] then msg = msg .. " " .. tostring(words[i]) end + local msg = PACKET_HEADER .. ":benchmark" + for i = 1, 5 do + if words[i] then + msg = msg .. " " .. tostring(words[i]) + end end centerCamera() Spring.SendLuaRulesMsg(msg) end function gadget:Initialize() - gadgetHandler:AddChatAction('benchmark', benchmark, "") -- /luarules benchmark unitdefname1 unitdefname2 count + gadgetHandler:AddChatAction("benchmark", benchmark, "") -- /luarules benchmark unitdefname1 unitdefname2 count -- TODO: remove once chobby is updated to use `/luarules benchmark`. - gadgetHandler:AddChatAction('fightertest', benchmark, "") + gadgetHandler:AddChatAction("fightertest", benchmark, "") end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('benchmark') - gadgetHandler:RemoveChatAction('fightertest') + gadgetHandler:RemoveChatAction("benchmark") + gadgetHandler:RemoveChatAction("fightertest") end - end diff --git a/luarules/gadgets/dbg_buildicons_run.lua b/luarules/gadgets/dbg_buildicons_run.lua index c2f23cae145..c274c6ba28f 100644 --- a/luarules/gadgets/dbg_buildicons_run.lua +++ b/luarules/gadgets/dbg_buildicons_run.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2015", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -23,8 +23,7 @@ end --cd.. --) - -if (not gadgetHandler:IsSyncedCode()) then +if not gadgetHandler:IsSyncedCode() then return end @@ -51,13 +50,13 @@ function buildslowly(_, _, params) index = tonumber(params[1]) end end - Spring.Echo('building icons all slow-like, starting from ' .. index) + Spring.Echo("building icons all slow-like, starting from " .. index) local counter = 1 for unitName, unitdefname in pairs(UnitDefNames) do counter = counter + 1 --Spring.Echo('unitdefname',i,unitdefname) - local filepath = '../buildicons/__256x256/' .. unitName .. '.png' + local filepath = "../buildicons/__256x256/" .. unitName .. ".png" if VFS.FileExists(filepath, VFS.RAW) then --Spring.Echo("File exists for: "..i.. ' '..filepath) else @@ -74,7 +73,7 @@ end local framenumLength = string.len(tostring(animationFrames)) function addZeros(number) for length = string.len(tostring(number)), framenumLength - 1 do - number = '0' .. number + number = "0" .. number end return number end @@ -82,7 +81,7 @@ end function buildUnitAnim(unitName) local angleStep = 360 / animationFrames for frame = 0, animationFrames - 1 do - unitnames[#unitnames + 1] = unitName .. ' ' .. (angleStep * frame) .. ' ' .. addZeros(frame) + unitnames[#unitnames + 1] = unitName .. " " .. (angleStep * frame) .. " " .. addZeros(frame) end end @@ -101,9 +100,9 @@ function buildanim(_, _, params) end end end - Spring.Echo('building icon with animation frames all slow-like, starting from ' .. index) + Spring.Echo("building icon with animation frames all slow-like, starting from " .. index) - local filepath = '../buildicons/__256x256/' .. unitName .. '.png' + local filepath = "../buildicons/__256x256/" .. unitName .. ".png" if VFS.FileExists(filepath, VFS.RAW) then --Spring.Echo("File exists for: "..unitName.. ' '..filepath) else @@ -120,15 +119,15 @@ function buildanimslowly(_, _, params) unitnumber = tonumber(params[1]) end end - Spring.Echo('building icons with animation frames all slow-like, starting from ' .. index) + Spring.Echo("building icons with animation frames all slow-like, starting from " .. index) local counter = 1 for unitName, _ in pairs(UnitDefNames) do counter = counter + 1 if not unitnumber or counter >= unitnumber then - local filepath = '../buildicons/256x256/' .. unitName .. '.png' + local filepath = "../buildicons/256x256/" .. unitName .. ".png" if VFS.FileExists(filepath, VFS.RAW) then - Spring.Echo("File exists for: " .. unitName .. ' ' .. filepath) + Spring.Echo("File exists for: " .. unitName .. " " .. filepath) else if not skipUnits[unitName] then Spring.Echo("Building filepath: " .. filepath) @@ -140,12 +139,12 @@ function buildanimslowly(_, _, params) end function gadget:Initialize() - gadgetHandler:AddChatAction('buildiconslow', buildslowly, "") - gadgetHandler:AddChatAction('buildiconanim', buildanim, "") - gadgetHandler:AddChatAction('buildiconanimslow', buildanimslowly, "") + gadgetHandler:AddChatAction("buildiconslow", buildslowly, "") + gadgetHandler:AddChatAction("buildiconanim", buildanim, "") + gadgetHandler:AddChatAction("buildiconanimslow", buildanimslowly, "") end -local unitConfigs = { -- copy from configs/icon_generator.lua, included.. because else it will miss frames when animating +local unitConfigs = { -- copy from configs/icon_generator.lua, included.. because else it will miss frames when animating [UnitDefNames.cormex.id] = { wait = 60, }, @@ -167,26 +166,25 @@ local unitConfigs = { -- copy from configs/icon_generator.lua, included.. beca [UnitDefNames.armplat.id] = { wait = 65, }, - } function gadget:GameFrame(n) - if (nextFrame and n > nextFrame and index <= #unitnames) then + if nextFrame and n > nextFrame and index <= #unitnames then Spring.SendCommands("luarules buildicon " .. unitnames[index]) index = index + 1 counter = counter + 1 - if not string.find(unitnames[index], ' ') then + if not string.find(unitnames[index], " ") then -- single buildpic nextFrame = n + timedelay else -- animation - if not string.find(unitnames[index], ' ') or string.match(unitnames[index], ' 1$') then + if not string.find(unitnames[index], " ") or string.match(unitnames[index], " 1$") then nextFrame = n + timedelayFirstFrame else nextFrame = n + timedelayFrame end -- added custom wait period on top, because else it will miss frames - local unitName = string.match(unitnames[index], '[a-zA-Z0-9]*') + local unitName = string.match(unitnames[index], "[a-zA-Z0-9]*") if unitName then if unitConfigs and unitConfigs[UnitDefNames[unitName].id] and unitConfigs[UnitDefNames[unitName].id].wait then nextFrame = nextFrame + unitConfigs[UnitDefNames[unitName].id].wait @@ -197,7 +195,7 @@ function gadget:GameFrame(n) end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('buildiconslow') - gadgetHandler:RemoveChatAction('buildiconanim') - gadgetHandler:RemoveChatAction('buildiconanimslow') + gadgetHandler:RemoveChatAction("buildiconslow") + gadgetHandler:RemoveChatAction("buildiconanim") + gadgetHandler:RemoveChatAction("buildiconanimslow") end diff --git a/luarules/gadgets/dbg_cob_debug.lua b/luarules/gadgets/dbg_cob_debug.lua index f3e9c24c941..5ad2d992778 100644 --- a/luarules/gadgets/dbg_cob_debug.lua +++ b/luarules/gadgets/dbg_cob_debug.lua @@ -12,113 +12,114 @@ function gadget:GetInfo() } end - if gadgetHandler:IsSyncedCode() then local callinids = { - [1] = "Debug", - [2] = "Open", - [3] = "Close", - [4] = "TryTransition", - [5] = "Killed", - [6] = "ExecuteRestoreAfterDelay", - [7] = "SetStunned", - [8] = "Walk", - [9] = "StopWalking", - [10] = "Create", - [11] = "Activate", - [12] = "Deactivate", - [13] = "StartMoving", - [14] = "StopMoving", - [15] = "SetSFXOccupy", - [16] = "MoveRate0", - [17] = "MoveRate1", - [18] = "MoveRate2", - [19] = "MoveRate3", - [20] = "SetDirection", - [21] = "SetSpeed", - [22] = "RockUnit", - [23] = "HitByWeapon", - [24] = "HitByWeaponID", - [25] = "SetMaxReloadTime", - [26] = "StartBuilding", - [27] = "StopBuilding", - [28] = "QueryNanoPiece", - [29] = "QueryBuildInfo", - [30] = "Falling", - [31] = "Landed", - [32] = "QueryTransport", - [33] = "BeginTransport", - [34] = "EndTransport", - [35] = "TransportPickup", - [36] = "TransportDrop", - [37] = "StartUnload", - [38] = "QueryLandingPadCount", - [39] = "QueryLandingPad", - [40] = "AimWeapon1", - [41] = "AimFromWeapon1", - [42] = "FireWeapon1", - [43] = "Shot1", - [44] = "QueryWeapon1", - [45] = "EndBurst1", - [46] = "BlockShot1", - [47] = "TargetWeight1", - [48] = "AimWeapon2", - [49] = "AimFromWeapon2", - [50] = "FireWeapon2", - [51] = "Shot2", - [52] = "QueryWeapon2", - [53] = "EndBurst2", - [54] = "BlockShot2", - [55] = "TargetWeight2", - [56] = "AimWeapon3", - [57] = "AimFromWeapon3", - [58] = "FireWeapon3", - [59] = "Shot3", - [60] = "QueryWeapon3", - [61] = "EndBurst3", - [62] = "BlockShot3", - [63] = "TargetWeight3", - [64] = "AimWeapon4", - [65] = "AimFromWeapon4", - [66] = "FireWeapon4", - [67] = "Shot4", - [68] = "QueryWeapon4", - [69] = "EndBurst4", - [70] = "BlockShot4", - [71] = "TargetWeight4", - [72] = "AimWeapon5", - [73] = "AimFromWeapon5", - [74] = "FireWeapon5", - [75] = "Shot5", - [76] = "QueryWeapon5", - [77] = "EndBurst5", - [78] = "BlockShot5", - [79] = "TargetWeight5", - [80] = "AimWeapon6", - [81] = "AimFromWeapon6", - [82] = "FireWeapon6", - [83] = "Shot6", - [84] = "QueryWeapon6", - [85] = "EndBurst6", - [86] = "BlockShot6", - [87] = "TargetWeight6", - [1000] = "SIGNAL", + [1] = "Debug", + [2] = "Open", + [3] = "Close", + [4] = "TryTransition", + [5] = "Killed", + [6] = "ExecuteRestoreAfterDelay", + [7] = "SetStunned", + [8] = "Walk", + [9] = "StopWalking", + [10] = "Create", + [11] = "Activate", + [12] = "Deactivate", + [13] = "StartMoving", + [14] = "StopMoving", + [15] = "SetSFXOccupy", + [16] = "MoveRate0", + [17] = "MoveRate1", + [18] = "MoveRate2", + [19] = "MoveRate3", + [20] = "SetDirection", + [21] = "SetSpeed", + [22] = "RockUnit", + [23] = "HitByWeapon", + [24] = "HitByWeaponID", + [25] = "SetMaxReloadTime", + [26] = "StartBuilding", + [27] = "StopBuilding", + [28] = "QueryNanoPiece", + [29] = "QueryBuildInfo", + [30] = "Falling", + [31] = "Landed", + [32] = "QueryTransport", + [33] = "BeginTransport", + [34] = "EndTransport", + [35] = "TransportPickup", + [36] = "TransportDrop", + [37] = "StartUnload", + [38] = "QueryLandingPadCount", + [39] = "QueryLandingPad", + [40] = "AimWeapon1", + [41] = "AimFromWeapon1", + [42] = "FireWeapon1", + [43] = "Shot1", + [44] = "QueryWeapon1", + [45] = "EndBurst1", + [46] = "BlockShot1", + [47] = "TargetWeight1", + [48] = "AimWeapon2", + [49] = "AimFromWeapon2", + [50] = "FireWeapon2", + [51] = "Shot2", + [52] = "QueryWeapon2", + [53] = "EndBurst2", + [54] = "BlockShot2", + [55] = "TargetWeight2", + [56] = "AimWeapon3", + [57] = "AimFromWeapon3", + [58] = "FireWeapon3", + [59] = "Shot3", + [60] = "QueryWeapon3", + [61] = "EndBurst3", + [62] = "BlockShot3", + [63] = "TargetWeight3", + [64] = "AimWeapon4", + [65] = "AimFromWeapon4", + [66] = "FireWeapon4", + [67] = "Shot4", + [68] = "QueryWeapon4", + [69] = "EndBurst4", + [70] = "BlockShot4", + [71] = "TargetWeight4", + [72] = "AimWeapon5", + [73] = "AimFromWeapon5", + [74] = "FireWeapon5", + [75] = "Shot5", + [76] = "QueryWeapon5", + [77] = "EndBurst5", + [78] = "BlockShot5", + [79] = "TargetWeight5", + [80] = "AimWeapon6", + [81] = "AimFromWeapon6", + [82] = "FireWeapon6", + [83] = "Shot6", + [84] = "QueryWeapon6", + [85] = "EndBurst6", + [86] = "BlockShot6", + [87] = "TargetWeight6", + [1000] = "SIGNAL", } local count = 0 -- ensures that identical calls within a frame dont get eaten from logs local lastgf = 0 - + local function ResolveLine(unitDefID, line) local cobname = string.sub(UnitDefs[unitDefID].scriptName, 1, -4) - + -- we have to reload and cant cache because the dev might have reloaded the cob script - local bosfile = VFS.LoadFile(cobname..'bos') - + local bosfile = VFS.LoadFile(cobname .. "bos") + local boslines = string.lines(bosfile) - - local function_pattern = '^[%w_]+%(' - - if boslines[line] == nil then return "included", -1 end + + local function_pattern = "^[%w_]+%(" + + if boslines[line] == nil then + return "included", -1 + end -- todo: walk up until you match a function declaration for i = line, 1, -1 do if string.find(boslines[i], function_pattern) then @@ -130,10 +131,9 @@ if gadgetHandler:IsSyncedCode() then --Spring.Echo(cobname, boslines[line]) end - local function CobDebug(unitID, unitDefID, team, cmdid, line, p1,p2,p3,p4,p5,p6,p7,p8) + local function CobDebug(unitID, unitDefID, team, cmdid, line, p1, p2, p3, p4, p5, p6, p7, p8) ResolveLine(unitDefID, line) - - + if lastgf == Spring.GetGameFrame() then count = count + 1 else @@ -142,24 +142,38 @@ if gadgetHandler:IsSyncedCode() then end -- f:<01368.000> u:27656 armstump.FireWeapon1:97 local funcname = "" - if cmdid == 1 then + if cmdid == 1 then funcname = ResolveLine(unitDefID, line) else funcname = callinids[cmdid] or tostring(cmdid) end - - local msg = string.format("f:<%05d.%03d> u:%05d %s.%s:%d ", - lastgf, count, unitID or -1, UnitDefs[unitDefID].name or "?", funcname, line or -1 - ) - if p1 then msg = msg .. " p1=" .. tostring(p1) end - if p2 then msg = msg .. " p2=" .. tostring(p2) end - if p3 then msg = msg .. " p3=" .. tostring(p3) end - if p4 then msg = msg .. " p4=" .. tostring(p4) end - if p5 then msg = msg .. " p5=" .. tostring(p5) end - if p6 then msg = msg .. " p6=" .. tostring(p6) end - if p7 then msg = msg .. " p7=" .. tostring(p7) end - if p8 then msg = msg .. " p8=" .. tostring(p8) end - + + local msg = string.format("f:<%05d.%03d> u:%05d %s.%s:%d ", lastgf, count, unitID or -1, UnitDefs[unitDefID].name or "?", funcname, line or -1) + if p1 then + msg = msg .. " p1=" .. tostring(p1) + end + if p2 then + msg = msg .. " p2=" .. tostring(p2) + end + if p3 then + msg = msg .. " p3=" .. tostring(p3) + end + if p4 then + msg = msg .. " p4=" .. tostring(p4) + end + if p5 then + msg = msg .. " p5=" .. tostring(p5) + end + if p6 then + msg = msg .. " p6=" .. tostring(p6) + end + if p7 then + msg = msg .. " p7=" .. tostring(p7) + end + if p8 then + msg = msg .. " p8=" .. tostring(p8) + end + Spring.Echo(msg) end @@ -170,7 +184,4 @@ if gadgetHandler:IsSyncedCode() then function gadget:Shutdown() gadgetHandler:DeregisterGlobal("CobDebug") end - - -end -- UNSYNCED - +end -- UNSYNCED diff --git a/luarules/gadgets/dbg_gadget_auto_reloader.lua b/luarules/gadgets/dbg_gadget_auto_reloader.lua index 1ceed7409ba..b07b72d3b2d 100644 --- a/luarules/gadgets/dbg_gadget_auto_reloader.lua +++ b/luarules/gadgets/dbg_gadget_auto_reloader.lua @@ -24,7 +24,7 @@ local spEcho = Spring.Echo local gadgetContents = {} local gadgetFileNames = {} local failedGadgets = {} -local gadgetDependents = {} -- gadgetName -> {dependentName1, dependentName2, ...} +local gadgetDependents = {} -- gadgetName -> {dependentName1, dependentName2, ...} local function CacheGadgets() for _, g in pairs(gadgetHandler.gadgets) do @@ -49,7 +49,9 @@ local pendingReHook = {} local function ReHookProfiler(gadgetName) local g = gadgetHandler:FindGadget(gadgetName) - if not g then return end + if not g then + return + end for key, value in pairs(gadgetHandler) do if type(value) == "table" then local i = string.find(key, "List", 1, true) @@ -76,7 +78,7 @@ local function CheckForChanges(gadgetName, fileName, label) gadgetContents[gadgetName] = newContents local chunk, err = loadstring(newContents, fileName) if chunk == nil then - spEcho('Failed to load: ' .. fileName .. ' (' .. err .. ')') + spEcho("Failed to load: " .. fileName .. " (" .. err .. ")") failedGadgets[gadgetName] = fileName return end @@ -96,7 +98,6 @@ local function CheckForChanges(gadgetName, fileName, label) end if gadgetHandler:IsSyncedCode() then - local updateQueue = {} function gadget:Initialize() @@ -138,9 +139,7 @@ if gadgetHandler:IsSyncedCode() then end end end - else - local spGetMouseState = Spring.GetMouseState local mouseOffscreen = select(6, spGetMouseState()) @@ -189,5 +188,4 @@ else end end end - end diff --git a/luarules/gadgets/dbg_gadget_profiler.lua b/luarules/gadgets/dbg_gadget_profiler.lua index a450dca5031..6a10260d2aa 100644 --- a/luarules/gadgets/dbg_gadget_profiler.lua +++ b/luarules/gadgets/dbg_gadget_profiler.lua @@ -53,17 +53,17 @@ local select = select local usePrefixedNames = true local prefixColor = { - gui = '\255\100\222\100', - gfx = '\255\222\160\100', - game = '\255\166\166\255', - cmd = '\255\166\255\255', - unit = '\255\255\166\255', - map = '\255\255\255\080', - dbg = '\255\120\120\120', + gui = "\255\100\222\100", + gfx = "\255\222\160\100", + game = "\255\166\166\255", + cmd = "\255\166\255\255", + unit = "\255\255\166\255", + map = "\255\255\255\080", + dbg = "\255\120\120\120", } local prefixedGnames = {} -local gadgetNameColors = {} -- Store RGB values for background tinting -local function ConstructPrefixedName (ghInfo) +local gadgetNameColors = {} -- Store RGB values for background tinting +local function ConstructPrefixedName(ghInfo) local gadgetName = ghInfo.name local baseName = ghInfo.basename local _pos = stringFind(baseName, "_", 1, true) @@ -88,7 +88,7 @@ local function ConstructPrefixedName (ghInfo) b = mathRandom(180, 255) end end - gadgetNameColors[gadgetName] = {r / 255, g / 255, b / 255} -- Store normalized RGB + gadgetNameColors[gadgetName] = { r / 255, g / 255, b / 255 } -- Store normalized RGB prefixedGnames[gadgetName] = prefix .. stringChar(255, r, g, b) .. gadgetName .. " " return prefixedGnames[gadgetName] end @@ -107,7 +107,9 @@ local retainSortTime = 10 local spGetTimer = Spring.GetTimer local spDiffTimers = Spring.DiffTimers -local spGetLuaMemUsage = Spring.GetLuaMemUsage or function() return 0, 0, 0, 0, 0, 0, 0, 0 end +local spGetLuaMemUsage = Spring.GetLuaMemUsage or function() + return 0, 0, 0, 0, 0, 0, 0, 0 +end local profilerEchoEnabled = Spring.GetConfigInt("profiler_echoes", 0) == 1 local function ProfilerEcho(...) @@ -164,7 +166,7 @@ local oldUpdateGadgetCallIn local inHook = false local listOfHooks = {} -setmetatable(listOfHooks, { __mode = 'k' }) +setmetatable(listOfHooks, { __mode = "k" }) local function IsHook(func) return listOfHooks[func] @@ -183,7 +185,7 @@ if gadgetHandler:IsSyncedCode() then else local t, s - if Spring.GetTimerMicros and Spring.GetConfigInt("UseHighResTimer", 0) == 1 then + if Spring.GetTimerMicros and Spring.GetConfigInt("UseHighResTimer", 0) == 1 then spGetTimer = Spring.GetTimerMicros highres = true end @@ -203,7 +205,7 @@ else local ds = new_s - s local gadgetCallinStats = ValueForKey_SetDefaultInOriginalTable(callinStats, gadgetName, {}) - local stats = ValueForKey_SetDefaultInOriginalTable(gadgetCallinStats, callinName, { 0, 0, 0, 0}) + local stats = ValueForKey_SetDefaultInOriginalTable(gadgetCallinStats, callinName, { 0, 0, 0, 0 }) stats[1] = stats[1] + dt stats[2] = stats[2] + dt @@ -212,7 +214,6 @@ else end end - local gname2name = {} Hook = function(gadget, callinName) local gadgetName = gadget.ghInfo.name @@ -222,7 +223,7 @@ Hook = function(gadget, callinName) return realFunc -- don't profile the profilers callins within synced (nothing to profile!) end - gadget['_old' .. callinName] = realFunc + gadget["_old" .. callinName] = realFunc local gname = prefixedGnames[gadgetName] or ConstructPrefixedName(gadget.ghInfo) gname2name[gname] = gadgetName @@ -290,7 +291,6 @@ local function AddHook(gadget, callin) end local function StartHook(optName, line, words, playerID) -- this one is synced? - if hookset then if not running then KillHook() @@ -309,11 +309,11 @@ local function StartHook(optName, line, words, playerID) -- this one is synced? --// hook the UpdateCallin function oldUpdateGadgetCallIn = gadgetHandler.UpdateGadgetCallIn gadgetHandler.UpdateGadgetCallIn = function(self, name, g) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then local func = g[name] - if type(func) == 'function' then + if type(func) == "function" then if not IsHook(func) then g[name] = Hook(g, name) end @@ -323,7 +323,7 @@ local function StartHook(optName, line, words, playerID) -- this one is synced? end self:UpdateCallIn(name) else - print('UpdateGadgetCallIn: bad name: ' .. name) + print("UpdateGadgetCallIn: bad name: " .. name) end end @@ -368,8 +368,8 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- function gadget:Initialize() - gadgetHandler.actionHandler.AddChatAction(gadget, 'profile', StartHook, " : starts the gadget profiler") -- first hook the synced callins, then synced will come back and tell us to (really) start - gadgetHandler.actionHandler.AddChatAction(gadget, 'kill_profiler', KillHook, " : kills the gadget profiler") -- removes the profiler for everyone currently running it + gadgetHandler.actionHandler.AddChatAction(gadget, "profile", StartHook, " : starts the gadget profiler") -- first hook the synced callins, then synced will come back and tell us to (really) start + gadgetHandler.actionHandler.AddChatAction(gadget, "kill_profiler", KillHook, " : kills the gadget profiler") -- removes the profiler for everyone currently running it end else -------------------------------------------------------------------------------- @@ -380,12 +380,12 @@ else -- Per-callin drill-down state (only populated for the gadget currently drilled into). -- Declared here, above Start/Kill, so every function captures the same upvalues. - local selectedGadget = nil -- plain prefixed gname currently drilled into, or nil - local selectedSynced = false -- which list (unsynced/synced) the selection came from + local selectedGadget = nil -- plain prefixed gname currently drilled into, or nil + local selectedSynced = false -- which list (unsynced/synced) the selection came from local selectedCallinAvgs = {} -- { [cname] = { tLoad, sLoad } } smoothed, reset on selection - local clickableRows = {} -- reused each frame: { {x1, y1, x2, y2, gname, synced}, ... } - local clickableRowCount = 0 -- how many entries of clickableRows are valid this frame - local columnReserve = 0 -- width reserved left of column 0 for the detail panel (0 when none) + local clickableRows = {} -- reused each frame: { {x1, y1, x2, y2, gname, synced}, ... } + local clickableRowCount = 0 -- how many entries of clickableRows are valid this frame + local columnReserve = 0 -- width reserved left of column 0 for the detail panel (0 when none) local detailColour = "\255\255\255\255" local timersSynced = {} @@ -445,14 +445,12 @@ else local endtime = Spring.GetTimer() local endtimeus = Spring.GetTimerMicros() - ProfilerEcho("GetTimer secs", Spring.DiffTimers( endtime,starttime, nil)) - ProfilerEcho("GetTimer msecs", Spring.DiffTimers( endtime, starttime,true)) - ProfilerEcho("GetTimerMicros secs", Spring.DiffTimers( endtimeus,starttimeus, nil, true)) - ProfilerEcho("GetTimerMicros msecs", Spring.DiffTimers( endtimeus, starttimeus,true, true)) + ProfilerEcho("GetTimer secs", Spring.DiffTimers(endtime, starttime, nil)) + ProfilerEcho("GetTimer msecs", Spring.DiffTimers(endtime, starttime, true)) + ProfilerEcho("GetTimerMicros secs", Spring.DiffTimers(endtimeus, starttimeus, nil, true)) + ProfilerEcho("GetTimerMicros msecs", Spring.DiffTimers(endtimeus, starttimeus, true, true)) end - - StartHook() -- the unsynced one! startTickTimer = spGetTimer() @@ -495,8 +493,6 @@ else -- Data -------------------------------------------------------------------------------- - - local timeLoadAverages = {} local spaceLoadAverages = {} local redStrength = {} @@ -573,7 +569,7 @@ else -- time local new_r = (tTime - minPerc) / percRange - local timeKey = name .. '_time' + local timeKey = name .. "_time" redStr[timeKey] = redStr[timeKey] or 0 redStr[timeKey] = u * redStr[timeKey] + oneMinusU * new_r local timeRedStrength = redStr[timeKey] @@ -589,7 +585,7 @@ else new_r = 0 end - local spaceKey = name .. '_space' + local spaceKey = name .. "_space" redStr[spaceKey] = redStr[spaceKey] or 0 redStr[spaceKey] = u * redStr[spaceKey] + oneMinusU * new_r local spaceColorFactor = 1 - redStr[spaceKey] * colorScaleFactor @@ -673,7 +669,7 @@ else avgTLoad[gname] = ((avgTLoad[gname] * framesMinusOne) + tLoad) / frames local tColourString, sColourString = GetRedColourStrings(tTime, sLoad, gname, redStr, deltaTime) if not sortByLoad or avgTLoad[gname] >= 0.02 or sLoad >= 2 then -- only show heavy ones - sorted[n] = { name = gname2name[gname] or gname, plainname = gname, fullname = gname .. ' \255\200\200\200(' .. cmaxname_t .. ',' .. cmaxname_space .. ')', tLoad = tLoad, sLoad = sLoad, tTime = tTime, tColourString = tColourString, sColourString = sColourString, avgTLoad = avgTLoad[gname] } + sorted[n] = { name = gname2name[gname] or gname, plainname = gname, fullname = gname .. " \255\200\200\200(" .. cmaxname_t .. "," .. cmaxname_space .. ")", tLoad = tLoad, sLoad = sLoad, tTime = tTime, tColourString = tColourString, sColourString = sColourString, avgTLoad = avgTLoad[gname] } n = n + 1 end allOverTime = allOverTime + tLoad @@ -682,7 +678,9 @@ else if sortByLoad then tableSort(sorted, SortFunc) else - tableSort(sorted, function(a, b) return a.name < b.name end) + tableSort(sorted, function(a, b) + return a.name < b.name + end) end sorted.allOverTime = allOverTime @@ -752,24 +750,18 @@ else end local function Text(color, string, dataColIndex) - gl.Text( - color .. string, - initialX + dataColWidth * dataColIndex - ColumnShift(), - initialY - lineSpace * currentLineIndex, - fontSize, - "no" - ) + gl.Text(color .. string, initialX + dataColWidth * dataColIndex - ColumnShift(), initialY - lineSpace * currentLineIndex, fontSize, "no") end -- Helper function to render percentage with dimmed leading zeros local function DrawPercentWithDimmedZeros(colorString, value, x, y, fontSize, decimalPlaces) - local formatStr = '%.' .. (decimalPlaces or 3) .. 'f%%' + local formatStr = "%." .. (decimalPlaces or 3) .. "f%%" local formatted = stringFormat(formatStr, value) - local leadingPart, significantPart = stringMatch(formatted, '^(0%.0*)(.+)$') + local leadingPart, significantPart = stringMatch(formatted, "^(0%.0*)(.+)$") if leadingPart then -- Has leading zeros - render them dimmed - gl.Text(colorString .. '\255\150\150\150' .. leadingPart, x, y, fontSize, "no") + gl.Text(colorString .. "\255\150\150\150" .. leadingPart, x, y, fontSize, "no") local leadingWidth = gl.GetTextWidth(leadingPart) * fontSize gl.Text(colorString .. significantPart, x + leadingWidth, y, fontSize, "no") else @@ -780,23 +772,23 @@ else -- Helper function to render memory allocation with dimmed leading zeros and right-alignment local function DrawMemoryWithDimmedZeros(colorString, value, x, y, fontSize, decimalPlaces, suffix) - local formatStr = '%.' .. (decimalPlaces or 1) .. 'f' + local formatStr = "%." .. (decimalPlaces or 1) .. "f" local formatted = stringFormat(formatStr, value) local fullText = formatted .. suffix -- Calculate total width for right alignment with left padding local totalWidth = gl.GetTextWidth(fullText) * fontSize - local rightAlignedX = x + (dataColWidth * 0.75) - totalWidth -- Adjust to 75% to add more spacing + local rightAlignedX = x + (dataColWidth * 0.75) - totalWidth -- Adjust to 75% to add more spacing -- Check if value is 0.0 (all zeros) if tonumber(formatted) == 0 then -- Render entire "0.0" dimmed and right-aligned - gl.Text(colorString .. '\255\150\150\150' .. fullText, rightAlignedX, y, fontSize, "no") + gl.Text(colorString .. "\255\150\150\150" .. fullText, rightAlignedX, y, fontSize, "no") else - local leadingPart, significantPart = stringMatch(formatted, '^(0%.0*)(.+)$') + local leadingPart, significantPart = stringMatch(formatted, "^(0%.0*)(.+)$") if leadingPart then -- Has leading zeros - render them dimmed and right-aligned - gl.Text(colorString .. '\255\150\150\150' .. leadingPart, rightAlignedX, y, fontSize, "no") + gl.Text(colorString .. "\255\150\150\150" .. leadingPart, rightAlignedX, y, fontSize, "no") local leadingWidth = gl.GetTextWidth(leadingPart) * fontSize gl.Text(colorString .. significantPart .. suffix, rightAlignedX + leadingWidth, y, fontSize, "no") else @@ -827,7 +819,7 @@ else gl.Color(gadgetColor[1], gadgetColor[2], gadgetColor[3], 0.25) gl.Rect(x - 5, textY - 3, x + colWidth - 15, textY + fontSize - 3) - gl.Color(1, 1, 1, 1) -- Reset color + gl.Color(1, 1, 1, 1) -- Reset color end end @@ -844,7 +836,9 @@ else local function NewSection(title) RequireSpace(15) - if currentLineIndex ~= 0 then currentLineIndex = currentLineIndex + 3 end + if currentLineIndex ~= 0 then + currentLineIndex = currentLineIndex + 3 + end Text(title_colour, title, 2) currentLineIndex = currentLineIndex + 1 end @@ -893,7 +887,7 @@ else b = mathRandom(180, 255) end end - gadgetColor = {r / 255, g / 255, b / 255} + gadgetColor = { r / 255, g / 255, b / 255 } gadgetNameColors[v.name] = gadgetColor end @@ -906,7 +900,7 @@ else gl.Color(gadgetColor[1], gadgetColor[2], gadgetColor[3], 0.25) gl.Rect(x - 5, textY - 3, x + colWidth - 15, textY + fontSize - 3) - gl.Color(1, 1, 1, 1) -- Reset color + gl.Color(1, 1, 1, 1) -- Reset color end -- Highlight the row that is currently drilled into @@ -930,7 +924,7 @@ else DrawPercentWithDimmedZeros(tColour, tLoad, x + dataColWidth * 0, textY, fontSize, 3) -- Draw memory with dimmed zeros - DrawMemoryWithDimmedZeros(sColour, sLoad, x + dataColWidth * 1, textY, fontSize, 1, 'kB/s') + DrawMemoryWithDimmedZeros(sColour, sLoad, x + dataColWidth * 1, textY, fontSize, 1, "kB/s") -- Draw gadget name Text(tColour, gname, 2) @@ -940,15 +934,9 @@ else currentLineIndex = currentLineIndex + 1 -- Draw totals with dimmed zeros - DrawPercentWithDimmedZeros(totals_colour, list.allOverTime, - initialX + dataColWidth * 0 - ColumnShift(), - initialY - lineSpace * currentLineIndex, - fontSize, 3) + DrawPercentWithDimmedZeros(totals_colour, list.allOverTime, initialX + dataColWidth * 0 - ColumnShift(), initialY - lineSpace * currentLineIndex, fontSize, 3) - DrawMemoryWithDimmedZeros(totals_colour, list.allOverSpace, - initialX + dataColWidth * 1 - ColumnShift(), - initialY - lineSpace * currentLineIndex, - fontSize, 1, 'kB/s') + DrawMemoryWithDimmedZeros(totals_colour, list.allOverSpace, initialX + dataColWidth * 1 - ColumnShift(), initialY - lineSpace * currentLineIndex, fontSize, 1, "kB/s") Text(totals_colour, "totals (" .. stringLower(name) .. ")", 2) end @@ -962,7 +950,7 @@ else -- Hide a callin only when BOTH its cpu and alloc rate are negligible; hidden -- callins still count towards the total so it stays accurate. local minCallinPerc = 0.003 -- % of running time - local minCallinKB = 0.1 -- kB/s allocated + local minCallinKB = 0.1 -- kB/s allocated local list = {} local hidden = 0 @@ -976,7 +964,9 @@ else hidden = hidden + 1 end end - tableSort(list, function(a, b) return a.tLoad > b.tLoad end) + tableSort(list, function(a, b) + return a.tLoad > b.tLoad + end) local colW = fontSize * 8 -- one column width, wide enough for "9999.9 kB/s" local timeColX = x @@ -1012,17 +1002,17 @@ else local v = list[i] local ry = line() DrawPercentWithDimmedZeros(detailColour, v.tLoad, timeColX, ry, fontSize, 3) - DrawMemoryWithDimmedZeros(detailColour, v.sLoad, allocsColX, ry, fontSize, 1, 'kB/s') + DrawMemoryWithDimmedZeros(detailColour, v.sLoad, allocsColX, ry, fontSize, 1, "kB/s") gl.Text(detailColour .. v.name, callinColX, ry, fontSize, "no") end local ty = line() DrawPercentWithDimmedZeros(totals_colour, total_t, timeColX, ty, fontSize, 2) - DrawMemoryWithDimmedZeros(totals_colour, total_s, allocsColX, ty, fontSize, 0, 'kB/s') + DrawMemoryWithDimmedZeros(totals_colour, total_s, allocsColX, ty, fontSize, 0, "kB/s") gl.Text(totals_colour .. "total", callinColX, ty, fontSize, "no") if hidden > 0 then - gl.Text(totals_colour .. '\255\140\140\140' .. stringFormat("(%d negligible callins hidden)", hidden), x, line(), fontSize, "no") + gl.Text(totals_colour .. "\255\140\140\140" .. stringFormat("(%d negligible callins hidden)", hidden), x, line(), fontSize, "no") end line() -- blank separator before the close hint @@ -1082,17 +1072,9 @@ else local totalTime = (sortedList.allOverTime or 0) + (sortedListSYNCED.allOverTime or 0) local totalSpace = (sortedList.allOverSpace or 0) + (sortedListSYNCED.allOverSpace or 0) - Line(0, totals_colour, - nil, - stringFormat('%.1f%%', totalTime), - "total percentage of running time spent in luarules callins" - ) + Line(0, totals_colour, nil, stringFormat("%.1f%%", totalTime), "total percentage of running time spent in luarules callins") - Line(0, totals_colour, - nil, - stringFormat('%.0f', totalSpace) .. 'kB/s', - "total rate of mem allocation by luarules callins" - ) + Line(0, totals_colour, nil, stringFormat("%.0f", totalSpace) .. "kB/s", "total rate of mem allocation by luarules callins") -- Cache memory calculations local globalMemMB = globalMemory / 1000 @@ -1100,11 +1082,11 @@ else local unsyncedPercent = 100 * unsyncedMemory / globalMemory local syncedPercent = 100 * syncedMemory / globalMemory - Line(1, title_colour, 'total lua memory usage is ' .. stringFormat('%.0f', globalMemMB) .. 'MB, of which:') + Line(1, title_colour, "total lua memory usage is " .. stringFormat("%.0f", globalMemMB) .. "MB, of which:") - Line(1, totals_colour, nil, stringFormat('%.0f', luarulesPercent) .. '% is from unsynced luarules') - Line(0, totals_colour, nil, stringFormat('%.0f', unsyncedPercent) .. '% is from unsynced states (luarules+luagaia+luaui)') - Line(0, totals_colour, nil, stringFormat('%.0f', syncedPercent) .. '% is from synced states (luarules+luagaia)') + Line(1, totals_colour, nil, stringFormat("%.0f", luarulesPercent) .. "% is from unsynced luarules") + Line(0, totals_colour, nil, stringFormat("%.0f", unsyncedPercent) .. "% is from unsynced states (luarules+luagaia+luaui)") + Line(0, totals_colour, nil, stringFormat("%.0f", syncedPercent) .. "% is from synced states (luarules+luagaia)") Line(1, title_colour, "All data excludes load from garbage collection & executing GL calls") Line(0, title_colour, "Callins in brackets are heaviest per gadget for (time,allocs)") diff --git a/luarules/gadgets/dbg_synced_proxy.lua b/luarules/gadgets/dbg_synced_proxy.lua index 4a7bf21f2cf..b1e7a71cf27 100644 --- a/luarules/gadgets/dbg_synced_proxy.lua +++ b/luarules/gadgets/dbg_synced_proxy.lua @@ -15,28 +15,24 @@ if not gadgetHandler:IsSyncedCode() then end if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then - Spring.SetGameRulesParam('isSyncedProxyEnabled', false) + Spring.SetGameRulesParam("isSyncedProxyEnabled", false) return end -Spring.SetGameRulesParam('isSyncedProxyEnabled', true) +Spring.SetGameRulesParam("isSyncedProxyEnabled", true) local LOG_LEVEL = LOG.INFO -local Proxy = VFS.Include('common/testing/synced_proxy.lua') +local Proxy = VFS.Include("common/testing/synced_proxy.lua") -local rpc = VFS.Include('common/testing/rpc.lua'):new() +local rpc = VFS.Include("common/testing/rpc.lua"):new() local function log(level, str, ...) if level < LOG_LEVEL then return end - Spring.Log( - gadget:GetInfo().name, - LOG.NOTICE, - str - ) + Spring.Log(gadget:GetInfo().name, LOG.NOTICE, str) end local function processFunctionCall(fn, returnID) @@ -80,5 +76,5 @@ function gadget:RecvLuaMsg(msg, playerID) end function gadget:Shutdown() - Spring.SetGameRulesParam('isSyncedProxyEnabled', false) + Spring.SetGameRulesParam("isSyncedProxyEnabled", false) end diff --git a/luarules/gadgets/dbg_synctest.lua b/luarules/gadgets/dbg_synctest.lua index 1a481b25f2c..8269395fbbe 100644 --- a/luarules/gadgets/dbg_synctest.lua +++ b/luarules/gadgets/dbg_synctest.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2026-04-13", license = "GNU GPL, v2 or later", layer = -1999999999, - enabled = true + enabled = true, } end @@ -29,14 +29,12 @@ local function isAuthorized(playerID, subPermission) local playername = Spring.GetPlayerInfo(playerID) local accountID = Spring.Utilities.GetAccountID(playerID) local hasPermission = false - if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or - (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then + if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then hasPermission = true end if not hasPermission and subPermission then local permKey = "devhelpers_" .. subPermission - if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or - (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then + if (_G and _G.permissions[permKey] and (_G.permissions[permKey][accountID] or (playername and _G.permissions[permKey][playername]))) or (SYNCED and SYNCED.permissions[permKey] and (SYNCED.permissions[permKey][accountID] or (playername and SYNCED.permissions[permKey][playername]))) then hasPermission = true end end @@ -48,9 +46,7 @@ local function isAuthorized(playerID, subPermission) return false end - if gadgetHandler:IsSyncedCode() then - -------------------------------------------------------------------- -- Run configuration and state -------------------------------------------------------------------- @@ -79,16 +75,15 @@ if gadgetHandler:IsSyncedCode() then -- TODO: add `cons` (with mex-build onSpawn) and `transports` (with -- load/unload onSpawn). local categoryDefs = { - { name = "bots", t1 = "armpw", t2 = "corak", max = 400, step = 28, class = "land" }, - { name = "tanks", t1 = "armbull", t2 = "armbull", max = 280, step = 14, class = "land" }, - { name = "fighters", t1 = "corvamp", t2 = "armhawk", max = 280, step = 14, class = "air" }, - { name = "bombers", t1 = "armpnix", t2 = "corshad", max = 140, step = 7, class = "air" }, - { name = "hover", t1 = "armanac", t2 = "corsh", max = 200, step = 14, class = "land" }, - { name = "subs", t1 = "armsub", t2 = "corsub", max = 200, step = 14, class = "water" }, - { name = "ships", t1 = "armpt", t2 = "corpt", max = 200, step = 14, class = "water" }, - { name = "spiders", t1 = "armspid", t2 = "armflea", max = 200, step = 14, class = "land" }, - { name = "commanders", t1 = "armcom", t2 = "corcom", max = 3, step = 1, class = "land", - noMultiplier = true }, + { name = "bots", t1 = "armpw", t2 = "corak", max = 400, step = 28, class = "land" }, + { name = "tanks", t1 = "armbull", t2 = "armbull", max = 280, step = 14, class = "land" }, + { name = "fighters", t1 = "corvamp", t2 = "armhawk", max = 280, step = 14, class = "air" }, + { name = "bombers", t1 = "armpnix", t2 = "corshad", max = 140, step = 7, class = "air" }, + { name = "hover", t1 = "armanac", t2 = "corsh", max = 200, step = 14, class = "land" }, + { name = "subs", t1 = "armsub", t2 = "corsub", max = 200, step = 14, class = "water" }, + { name = "ships", t1 = "armpt", t2 = "corpt", max = 200, step = 14, class = "water" }, + { name = "spiders", t1 = "armspid", t2 = "armflea", max = 200, step = 14, class = "land" }, + { name = "commanders", t1 = "armcom", t2 = "corcom", max = 3, step = 1, class = "land", noMultiplier = true }, } local enabledCats = {} @@ -121,26 +116,40 @@ if gadgetHandler:IsSyncedCode() then local function startRun(words) if words[2] then local f = tonumber(words[2]) - if f then totalFrames = math.max(60, math.floor(f)) end + if f then + totalFrames = math.max(60, math.floor(f)) + end end if words[3] then local af = tonumber(words[3]) - if af and af > 0 and af <= 1 then areaFraction = af end + if af and af > 0 and af <= 1 then + areaFraction = af + end end if words[4] then local ox = tonumber(words[4]) - if ox and ox >= 0 and ox <= 1 then areaOffsetX = ox end + if ox and ox >= 0 and ox <= 1 then + areaOffsetX = ox + end end if words[5] then local oz = tonumber(words[5]) - if oz and oz >= 0 and oz <= 1 then areaOffsetZ = oz end + if oz and oz >= 0 and oz <= 1 then + areaOffsetZ = oz + end end if words[6] then local m = tonumber(words[6]) - if m and m > 0 and m <= 8 then unitMultiplier = m end + if m and m > 0 and m <= 8 then + unitMultiplier = m + end + end + if areaOffsetX + areaFraction > 1 then + areaOffsetX = 1 - areaFraction + end + if areaOffsetZ + areaFraction > 1 then + areaOffsetZ = 1 - areaFraction end - if areaOffsetX + areaFraction > 1 then areaOffsetX = 1 - areaFraction end - if areaOffsetZ + areaFraction > 1 then areaOffsetZ = 1 - areaFraction end runStartFrame = Spring.GetGameFrame() initrandom(RUN_SEED) @@ -149,10 +158,7 @@ if gadgetHandler:IsSyncedCode() then computeFeatureDefsToRemove() featurestoremove = {} - Spring.Echo(string.format( - "[synctest] starting: totalframes=%d area=%.2f offset=%.2f,%.2f mult=%.2f categories=%d anchors land/water/air=%d/%d/%d", - totalFrames, areaFraction, areaOffsetX, areaOffsetZ, unitMultiplier, #enabledCats, - #anchorsByClass.land, #anchorsByClass.water, #anchorsByClass.air)) + Spring.Echo(string.format("[synctest] starting: totalframes=%d area=%.2f offset=%.2f,%.2f mult=%.2f categories=%d anchors land/water/air=%d/%d/%d", totalFrames, areaFraction, areaOffsetX, areaOffsetZ, unitMultiplier, #enabledCats, #anchorsByClass.land, #anchorsByClass.water, #anchorsByClass.air)) SendToUnsynced("synctest_synchash_begin", totalFrames, runStartFrame) active = true end @@ -165,7 +171,11 @@ if gadgetHandler:IsSyncedCode() then end local function toggleRun(words) - if active then endRun() else startRun(words) end + if active then + endRun() + else + startRun(words) + end end -------------------------------------------------------------------- @@ -173,7 +183,9 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------- function gadget:GameFrame(n) - if not active then return end + if not active then + return + end local runFrame = n - runStartFrame @@ -230,9 +242,13 @@ if gadgetHandler:IsSyncedCode() then anchorsByClass.water[#anchorsByClass.water + 1] = { x = x, z = z } pickedWater = true end - if pickedLand and pickedWater then break end + if pickedLand and pickedWater then + break + end + end + if pickedLand and pickedWater then + break end - if pickedLand and pickedWater then break end end end end @@ -248,7 +264,9 @@ if gadgetHandler:IsSyncedCode() then -- test is solid. function spawnBurstForCategoryAtAnchor(cat, teamID, udID, anchor) - if Spring.GetTeamUnitDefCount(teamID, udID) >= cat.effectiveMax then return {} end + if Spring.GetTeamUnitDefCount(teamID, udID) >= cat.effectiveMax then + return {} + end local footprint = math.max(UnitDefs[udID].xsize, UnitDefs[udID].zsize) local sqrtFeed = math.max(1, math.ceil(math.sqrt(cat.effectiveStep))) @@ -290,10 +308,12 @@ if gadgetHandler:IsSyncedCode() then function spawnBurstForCategory(cat) local anchors = anchorsByClass[cat.class] - if not anchors or #anchors == 0 then return end + if not anchors or #anchors == 0 then + return + end cat.anchorCounter = cat.anchorCounter + 1 local anchor = anchors[((cat.anchorCounter - 1) % #anchors) + 1] - + -- make sure we spawn for both teams spawnBurstForCategoryAtAnchor(cat, 0, cat.t1id, anchor) spawnBurstForCategoryAtAnchor(cat, 1, cat.t2id, anchor) @@ -314,18 +334,17 @@ if gadgetHandler:IsSyncedCode() then cat.t1id = UnitDefNames[cat.t1].id cat.t2id = UnitDefNames[cat.t2].id if cat.noMultiplier then - cat.effectiveMax = cat.max + cat.effectiveMax = cat.max cat.effectiveStep = cat.step else - cat.effectiveMax = math.max(1, math.floor(cat.max * unitMultiplier / 2.0)) + cat.effectiveMax = math.max(1, math.floor(cat.max * unitMultiplier / 2.0)) cat.effectiveStep = math.max(1, math.floor(cat.step * unitMultiplier / 2.0)) end enabledCats[#enabledCats + 1] = cat allTeamUnitDefNames[cat.t1] = true allTeamUnitDefNames[cat.t2] = true else - Spring.Echo(string.format( - "[synctest] skipping category %s: no %s anchors", cat.name, cat.class)) + Spring.Echo(string.format("[synctest] skipping category %s: no %s anchors", cat.name, cat.class)) end end end @@ -348,7 +367,9 @@ if gadgetHandler:IsSyncedCode() then end function gadget:FeatureCreated(featureID, allyTeam) - if not active then return end + if not active then + return + end local fdID = Spring.GetFeatureDefID(featureID) if fdID and featureDefsToRemove[fdID] then featurestoremove[featureID] = (Spring.GetGameFrame() - runStartFrame) + cleanupFeatureLife @@ -413,8 +434,12 @@ if gadgetHandler:IsSyncedCode() then for word in msg:gmatch("[%-_%w%.]+") do table.insert(words, word) end - if words[1] ~= "synctest" then return end - if not isAuthorized(playerID, "terrain") then return end + if words[1] ~= "synctest" then + return + end + if not isAuthorized(playerID, "terrain") then + return + end toggleRun(words) end @@ -424,23 +449,23 @@ if gadgetHandler:IsSyncedCode() then function initrandom(seed) math.randomseed(seed) - for i=1, 5000 do + for i = 1, 5000 do seededrand[i] = math.random() end randindex = 1 end function getrandom() - if #seededrand < 1 then initrandom(RUN_SEED) end + if #seededrand < 1 then + initrandom(RUN_SEED) + end randindex = randindex + 1 - if randindex > #seededrand then randindex = 1 end + if randindex > #seededrand then + randindex = 1 + end return seededrand[randindex] end - - -else -- UNSYNCED - - +else -- UNSYNCED -------------------------------------------------------------------- -- HUD -------------------------------------------------------------------- @@ -458,12 +483,13 @@ else -- UNSYNCED end function gadget:DrawScreen() - if not hudActive then return end + if not hudActive then + return + end local gameFrame = Spring.GetGameFrame() local runFrame = hudRunStartFrame and (gameFrame - hudRunStartFrame) or 0 gl.Color(1, 1, 1, 1) - gl.Text(string.format("Synctest frame %d / %d", runFrame, hudTotalFrames), - 600 * uiScale, 600 * uiScale, 16 * uiScale) + gl.Text(string.format("Synctest frame %d / %d", runFrame, hudTotalFrames), 600 * uiScale, 600 * uiScale, 16 * uiScale) end -------------------------------------------------------------------- @@ -484,14 +510,20 @@ else -- UNSYNCED end function gadget:GameFrame(n) - if not hudActive then return end - if not Engine.hasSyncChecksums then return end + if not hudActive then + return + end + if not Engine.hasSyncChecksums then + return + end local checksum = Spring.GetPrevFrameSyncChecksum() local runFrame = n - hudRunStartFrame local i = #checksumBuffer + 1 frameBuffer[i] = runFrame checksumBuffer[i] = checksum - if not synchashFirstFrame then synchashFirstFrame = runFrame end + if not synchashFirstFrame then + synchashFirstFrame = runFrame + end synchashLastFrame = runFrame end @@ -528,9 +560,7 @@ else -- UNSYNCED end f:write(content) f:close() - Spring.Echo(string.format( - "[synctest] sync-hash: wrote %s (md5=%s, %d frames %d..%d)", - path, digest, count, synchashFirstFrame or -1, synchashLastFrame or -1)) + Spring.Echo(string.format("[synctest] sync-hash: wrote %s (md5=%s, %d frames %d..%d)", path, digest, count, synchashFirstFrame or -1, synchashLastFrame or -1)) frameBuffer = {} checksumBuffer = {} end @@ -540,26 +570,31 @@ else -- UNSYNCED -------------------------------------------------------------------- local function synctest(_, line, words, playerID, action) - if playerID ~= Spring.GetMyPlayerID() then return end + if playerID ~= Spring.GetMyPlayerID() then + return + end Spring.Echo("[synctest]", line, playerID, action) - if not isAuthorized(playerID, "terrain") then return end - local msg = PACKET_HEADER .. ':synctest' + if not isAuthorized(playerID, "terrain") then + return + end + local msg = PACKET_HEADER .. ":synctest" for i = 1, 6 do - if words[i] then msg = msg .. " " .. tostring(words[i]) end + if words[i] then + msg = msg .. " " .. tostring(words[i]) + end end Spring.SendLuaRulesMsg(msg) end function gadget:Initialize() - gadgetHandler:AddChatAction('synctest', synctest, "") - gadgetHandler:AddSyncAction('synctest_synchash_begin', onSynchashBegin) - gadgetHandler:AddSyncAction('synctest_synchash_end', onSynchashEnd) + gadgetHandler:AddChatAction("synctest", synctest, "") + gadgetHandler:AddSyncAction("synctest_synchash_begin", onSynchashBegin) + gadgetHandler:AddSyncAction("synctest_synchash_end", onSynchashEnd) end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('synctest') - gadgetHandler:RemoveSyncAction('synctest_synchash_begin') - gadgetHandler:RemoveSyncAction('synctest_synchash_end') + gadgetHandler:RemoveChatAction("synctest") + gadgetHandler:RemoveSyncAction("synctest_synchash_begin") + gadgetHandler:RemoveSyncAction("synctest_synchash_end") end - end diff --git a/luarules/gadgets/dbg_test_env_helper.lua b/luarules/gadgets/dbg_test_env_helper.lua index 1cf874817a9..eb1ad70bbd3 100644 --- a/luarules/gadgets/dbg_test_env_helper.lua +++ b/luarules/gadgets/dbg_test_env_helper.lua @@ -11,15 +11,14 @@ function gadget:GetInfo() } end -local ENABLED_RULES_PARAM = 'isTestEnvironmentHelperEnabled' +local ENABLED_RULES_PARAM = "isTestEnvironmentHelperEnabled" if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then return end if gadgetHandler:IsSyncedCode() then - - local removeGadgets = {'Team Com Ends', 'Game End'} + local removeGadgets = { "Team Com Ends", "Game End" } Spring.SetGameRulesParam(ENABLED_RULES_PARAM, true) @@ -46,23 +45,23 @@ if gadgetHandler:IsSyncedCode() then end function gadget:Initialize() - gadgetHandler.actionHandler.AddChatAction(gadget, 'setTestEndConditions', SetTestEndConditionsCmd) - gadgetHandler.actionHandler.AddChatAction(gadget, 'setTestReadyPlayers', SetTestReadyPlayersCmd) + gadgetHandler.actionHandler.AddChatAction(gadget, "setTestEndConditions", SetTestEndConditionsCmd) + gadgetHandler.actionHandler.AddChatAction(gadget, "setTestReadyPlayers", SetTestReadyPlayersCmd) if Spring.GetGameRulesParam("testEndConditionsOverride") then SetTestEndConditionsCmd() end end function gadget:Shutdown() - gadgetHandler.actionHandler.RemoveChatAction(gadget, 'setTestEndConditions') - gadgetHandler.actionHandler.RemoveChatAction(gadget, 'setTestReadyPlayers') + gadgetHandler.actionHandler.RemoveChatAction(gadget, "setTestEndConditions") + gadgetHandler.actionHandler.RemoveChatAction(gadget, "setTestReadyPlayers") Spring.SetGameRulesParam(ENABLED_RULES_PARAM, false) end function gadget:RecvLuaMsg(msg, playerID) - if msg == 'testEnvironmentStarting' then - Spring.SetGameRulesParam('testEnvironmentStarting', true) - gadgetHandler:RemoveGadgetCallIn('RecvLuaMsg', self) + if msg == "testEnvironmentStarting" then + Spring.SetGameRulesParam("testEnvironmentStarting", true) + gadgetHandler:RemoveGadgetCallIn("RecvLuaMsg", self) end end else @@ -72,7 +71,7 @@ else function gadget:Update(n) if (Spring.GetPlayerTraffic(SYSTEM_ID, NETMSG_STARTPLAYING) or 0) > 0 then - Spring.SendLuaRulesMsg('testEnvironmentStarting') + Spring.SendLuaRulesMsg("testEnvironmentStarting") gadgetHandler:RemoveGadget(self) end end diff --git a/luarules/gadgets/dbg_unit_callins.lua b/luarules/gadgets/dbg_unit_callins.lua index 3f77cdcb740..2cecf37aedd 100644 --- a/luarules/gadgets/dbg_unit_callins.lua +++ b/luarules/gadgets/dbg_unit_callins.lua @@ -12,8 +12,9 @@ function gadget:GetInfo() } end -if gadgetHandler:IsSyncedCode() then return end - +if gadgetHandler:IsSyncedCode() then + return +end -- UNIT CALLINS: local showcallins = true @@ -25,32 +26,44 @@ local tagrise = 2 local eventlist = {} local numevents = 0 local startheight = 64 - -- is a dict of - -- life = gameframe to die on - -- +-- is a dict of +-- life = gameframe to die on +-- -local function addEvent(unitID,callin, param1, param2, param3, param4) - if unitID == nil then return end +local function addEvent(unitID, callin, param1, param2, param3, param4) + if unitID == nil then + return + end local px, py, pz - if type(unitID) == 'table' then + if type(unitID) == "table" then px = unitID[1] py = unitID[2] pz = unitID[3] elseif Spring.ValidUnitID(unitID) then px, py, pz = Spring.GetUnitPosition(unitID) end - if px == nil then return end - local caption = 'g:'..callin - if param1 ~= nil then caption = caption .. " " .. tostring(param1) end - if param2 ~= nil then caption = caption .. " " .. tostring(param2) end - if param3 ~= nil then caption = caption .. " " .. tostring(param3) end - if param4 ~= nil then caption = caption .. " " .. tostring(param4) end + if px == nil then + return + end + local caption = "g:" .. callin + if param1 ~= nil then + caption = caption .. " " .. tostring(param1) + end + if param2 ~= nil then + caption = caption .. " " .. tostring(param2) + end + if param3 ~= nil then + caption = caption .. " " .. tostring(param3) + end + if param4 ~= nil then + caption = caption .. " " .. tostring(param4) + end local newevent = { life = Spring.GetGameFrame() + taglife, caption = caption, - x = px , + x = px, y = py + startheight, - z = pz + (math.random()-0.5) * 32, + z = pz + (math.random() - 0.5) * 32, } table.insert(eventlist, newevent) numevents = numevents + 1 @@ -67,7 +80,7 @@ function gadget:GameFrame() v.y = v.y + tagrise end end - for k,v in pairs(removelist) do + for k, v in pairs(removelist) do eventlist[v] = nil numevents = numevents - 1 end @@ -77,174 +90,326 @@ end function gadget:DrawWorld() --Spring.Echo("g:drawing:", numevents) if numevents > 0 then - gl.Color(0.3,1,0.3,1) + gl.Color(0.3, 1, 0.3, 1) for key, event in pairs(eventlist) do if Spring.IsSphereInView(event.x, event.y, event.z, 128) then gl.PushMatrix() local w = gl.GetTextWidth(event.caption) * 16.0 gl.Translate(event.x - w, event.y, event.z) - gl.Text( event.caption,0,0,16,'n') + gl.Text(event.caption, 0, 0, 16, "n") gl.PopMatrix() end - end end end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if enabledcallins.UnitCreated == nil then return end - if printcallins then Spring.Echo("g:UnitCreated",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, builderID) end - if showcallins then addEvent(unitID, "UnitCreated") end + if enabledcallins.UnitCreated == nil then + return + end + if printcallins then + Spring.Echo("g:UnitCreated", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, builderID) + end + if showcallins then + addEvent(unitID, "UnitCreated") + end end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - if enabledcallins.UnitFinished == nil then return end - if printcallins then Spring.Echo("g:UnitFinished",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitFinished") end + if enabledcallins.UnitFinished == nil then + return + end + if printcallins then + Spring.Echo("g:UnitFinished", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitFinished") + end end function gadget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - if enabledcallins.UnitFromFactory == nil then return end - if printcallins then Spring.Echo("g:UnitFromFactory",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, factID, factDefID, userOrders) end - if showcallins then addEvent(unitID, "UnitFromFactory") end - + if enabledcallins.UnitFromFactory == nil then + return + end + if printcallins then + Spring.Echo("g:UnitFromFactory", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, factID, factDefID, userOrders) + end + if showcallins then + addEvent(unitID, "UnitFromFactory") + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if enabledcallins.UnitDestroyed == nil then return end - if printcallins then Spring.Echo("g:UnitDestroyed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitDestroyed") end + if enabledcallins.UnitDestroyed == nil then + return + end + if printcallins then + Spring.Echo("g:UnitDestroyed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitDestroyed") + end end function gadget:UnitReverseBuilt(unitID, unitDefID, unitTeam) - if enabledcallins.UnitReverseBuilt == nil then return end - if printcallins then Spring.Echo("g:UnitReverseBuilt",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitReverseBuilt") end + if enabledcallins.UnitReverseBuilt == nil then + return + end + if printcallins then + Spring.Echo("g:UnitReverseBuilt", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitReverseBuilt") + end end function gadget:UnitDestroyedByTeam(unitID, unitDefID, unitTeam, attackerTeamID) - if enabledcallins.UnitDestroyedByTeam == nil then return end - if printcallins then Spring.Echo("g:UnitDestroyedByTeam",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, attackerTeamID) end - if showcallins then addEvent(unitID, "UnitDestroyedByTeam") end + if enabledcallins.UnitDestroyedByTeam == nil then + return + end + if printcallins then + Spring.Echo("g:UnitDestroyedByTeam", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, attackerTeamID) + end + if showcallins then + addEvent(unitID, "UnitDestroyedByTeam") + end end function gadget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - if enabledcallins.UnitTaken == nil then return end - if printcallins then Spring.Echo("g:UnitTaken",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, newTeam) end - if showcallins then addEvent(unitID, "UnitTaken") end + if enabledcallins.UnitTaken == nil then + return + end + if printcallins then + Spring.Echo("g:UnitTaken", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, newTeam) + end + if showcallins then + addEvent(unitID, "UnitTaken") + end end function gadget:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) - if enabledcallins.UnitExperience == nil then return end - if printcallins then Spring.Echo("g:UnitExperience",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, experience, oldExperience) end - if showcallins then addEvent(unitID, "UnitExperience") end + if enabledcallins.UnitExperience == nil then + return + end + if printcallins then + Spring.Echo("g:UnitExperience", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, experience, oldExperience) + end + if showcallins then + addEvent(unitID, "UnitExperience") + end end function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) - if enabledcallins.UnitCommand == nil then return end - if printcallins then Spring.Echo("g:UnitCommand",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) end - if showcallins then addEvent(unitID, "UnitCommand") end + if enabledcallins.UnitCommand == nil then + return + end + if printcallins then + Spring.Echo("g:UnitCommand", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) + end + if showcallins then + addEvent(unitID, "UnitCommand") + end end function gadget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) - if enabledcallins.UnitCmdDone == nil then return end - if printcallins then Spring.Echo("g:UnitCmdDone",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) end - if showcallins then addEvent(unitID, "UnitCmdDone") end + if enabledcallins.UnitCmdDone == nil then + return + end + if printcallins then + Spring.Echo("g:UnitCmdDone", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) + end + if showcallins then + addEvent(unitID, "UnitCmdDone") + end end function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - if enabledcallins.UnitDamaged == nil then return end - if printcallins then Spring.Echo("g:UnitDamaged",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, damage, paralyzer) end - if showcallins then addEvent(unitID, "UnitDamaged") end + if enabledcallins.UnitDamaged == nil then + return + end + if printcallins then + Spring.Echo("g:UnitDamaged", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, damage, paralyzer) + end + if showcallins then + addEvent(unitID, "UnitDamaged") + end end function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - if enabledcallins.UnitGiven == nil then return end - if printcallins then Spring.Echo("g:UnitGiven",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, oldTeam) end - if showcallins then addEvent(unitID, "UnitGiven") end + if enabledcallins.UnitGiven == nil then + return + end + if printcallins then + Spring.Echo("g:UnitGiven", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, oldTeam) + end + if showcallins then + addEvent(unitID, "UnitGiven") + end end function gadget:UnitIdle(unitID, unitDefID, unitTeam) - if enabledcallins.UnitIdle == nil then return end - if printcallins then Spring.Echo("g:UnitIdle",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitIdle") end + if enabledcallins.UnitIdle == nil then + return + end + if printcallins then + Spring.Echo("g:UnitIdle", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitIdle") + end end function gadget:UnitEnteredRadar(unitID, unitTeam) - if enabledcallins.UnitEnteredRadar == nil then return end - if printcallins then Spring.Echo("g:UnitEnteredRadar",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredRadar") end + if enabledcallins.UnitEnteredRadar == nil then + return + end + if printcallins then + Spring.Echo("g:UnitEnteredRadar", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredRadar") + end end function gadget:UnitEnteredLos(unitID, unitTeam) - if enabledcallins.UnitEnteredLos == nil then return end - if printcallins then Spring.Echo("g:UnitEnteredLos",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredLos") end + if enabledcallins.UnitEnteredLos == nil then + return + end + if printcallins then + Spring.Echo("g:UnitEnteredLos", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredLos") + end end function gadget:UnitLeftRadar(unitID, unitTeam) - if enabledcallins.UnitLeftRadar == nil then return end - if printcallins then Spring.Echo("g:UnitLeftRadar",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftRadar") end + if enabledcallins.UnitLeftRadar == nil then + return + end + if printcallins then + Spring.Echo("g:UnitLeftRadar", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftRadar") + end end function gadget:UnitLeftLos(unitID, unitTeam) - if enabledcallins.UnitLeftLos == nil then return end - if printcallins then Spring.Echo("g:UnitLeftLos",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftLos") end + if enabledcallins.UnitLeftLos == nil then + return + end + if printcallins then + Spring.Echo("g:UnitLeftLos", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftLos") + end end function gadget:UnitEnteredWater(unitID, unitDefID, unitTeam) - if enabledcallins.UnitEnteredWater == nil then return end - if printcallins then Spring.Echo("g:UnitEnteredWater",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredWater") end + if enabledcallins.UnitEnteredWater == nil then + return + end + if printcallins then + Spring.Echo("g:UnitEnteredWater", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredWater") + end end function gadget:UnitEnteredAir(unitID, unitDefID, unitTeam) - if enabledcallins.UnitEnteredAir == nil then return end - if printcallins then Spring.Echo("g:UnitEnteredAir",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredAir") end + if enabledcallins.UnitEnteredAir == nil then + return + end + if printcallins then + Spring.Echo("g:UnitEnteredAir", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredAir") + end end function gadget:UnitLeftWater(unitID, unitDefID, unitTeam) - if enabledcallins.UnitLeftWater == nil then return end - if printcallins then Spring.Echo("g:UnitLeftWater",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftWater") end + if enabledcallins.UnitLeftWater == nil then + return + end + if printcallins then + Spring.Echo("g:UnitLeftWater", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftWater") + end end function gadget:UnitLeftAir(unitID, unitDefID, unitTeam) - if enabledcallins.UnitLeftAir == nil then return end - if printcallins then Spring.Echo("g:UnitLeftAir",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftAir") end + if enabledcallins.UnitLeftAir == nil then + return + end + if printcallins then + Spring.Echo("g:UnitLeftAir", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftAir") + end end function gadget:UnitSeismicPing(x, y, z, strength) - if enabledcallins.UnitSeismicPing == nil then return end - if printcallins then Spring.Echo("g:UnitSeismicPing",x, y, z, strength) end + if enabledcallins.UnitSeismicPing == nil then + return + end + if printcallins then + Spring.Echo("g:UnitSeismicPing", x, y, z, strength) + end --if showcallins then addEvent(unitID, "UnitGiven") end end function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) - if enabledcallins.UnitLoaded == nil then return end - if printcallins then Spring.Echo("g:UnitLoaded",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) end - if showcallins then addEvent(unitID, "UnitLoaded") end + if enabledcallins.UnitLoaded == nil then + return + end + if printcallins then + Spring.Echo("g:UnitLoaded", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) + end + if showcallins then + addEvent(unitID, "UnitLoaded") + end end function gadget:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) - if enabledcallins.UnitUnloaded == nil then return end - if printcallins then Spring.Echo("g:UnitUnloaded",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) end - if showcallins then addEvent(unitID, "UnitUnloaded") end + if enabledcallins.UnitUnloaded == nil then + return + end + if printcallins then + Spring.Echo("g:UnitUnloaded", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) + end + if showcallins then + addEvent(unitID, "UnitUnloaded") + end end function gadget:UnitCloaked(unitID, unitDefID, unitTeam) - if enabledcallins.UnitCloaked == nil then return end - if printcallins then Spring.Echo("g:UnitCloaked",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitCloaked") end + if enabledcallins.UnitCloaked == nil then + return + end + if printcallins then + Spring.Echo("g:UnitCloaked", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitCloaked") + end end function gadget:UnitDecloaked(unitID, unitDefID, unitTeam) - if enabledcallins.UnitDecloaked == nil then return end - if printcallins then Spring.Echo("g:UnitDecloaked",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitDecloaked") end + if enabledcallins.UnitDecloaked == nil then + return + end + if printcallins then + Spring.Echo("g:UnitDecloaked", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitDecloaked") + end end --function gadget:UnitMoveFailed(unitID, unitDefID, unitTeam) @@ -254,53 +419,91 @@ end --end function gadget:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount) - if enabledcallins.StockpileChanged == nil then return end - if printcallins then Spring.Echo("g:StockpileChanged",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, weaponNum, oldCount, newCount) end - if showcallins then addEvent(unitID, "StockpileChanged") end + if enabledcallins.StockpileChanged == nil then + return + end + if printcallins then + Spring.Echo("g:StockpileChanged", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, weaponNum, oldCount, newCount) + end + if showcallins then + addEvent(unitID, "StockpileChanged") + end end function gadget:RenderUnitDestroyed(unitID, unitDefID, unitTeam) - if enabledcallins.RenderUnitDestroyed == nil then return end - if printcallins then Spring.Echo("g:RenderUnitDestroyed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "RenderUnitDestroyed") end + if enabledcallins.RenderUnitDestroyed == nil then + return + end + if printcallins then + Spring.Echo("g:RenderUnitDestroyed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "RenderUnitDestroyed") + end end function gadget:UnitUnitCollision(colliderID, collideeID) - if enabledcallins.UnitUnitCollision == nil then return end - if printcallins then Spring.Echo("g:UnitUnitCollision",colliderID, collideeID) end - if showcallins then addEvent(colliderID, "UnitUnitCollision") end + if enabledcallins.UnitUnitCollision == nil then + return + end + if printcallins then + Spring.Echo("g:UnitUnitCollision", colliderID, collideeID) + end + if showcallins then + addEvent(colliderID, "UnitUnitCollision") + end end function gadget:UnitFeatureCollision(colliderID, collideeID) - if enabledcallins.UnitFeatureCollision == nil then return end - if printcallins then Spring.Echo("g:UnitFeatureCollision",colliderID, collideeID) end - if showcallins then addEvent(colliderID, "UnitFeatureCollision") end + if enabledcallins.UnitFeatureCollision == nil then + return + end + if printcallins then + Spring.Echo("g:UnitFeatureCollision", colliderID, collideeID) + end + if showcallins then + addEvent(colliderID, "UnitFeatureCollision") + end end function gadget:UnitFeatureCollision(colliderID, collideeID) - if enabledcallins.UnitFeatureCollision == nil then return end - if printcallins then Spring.Echo("g:UnitFeatureCollision",colliderID, collideeID) end - if showcallins then addEvent(colliderID, "UnitFeatureCollision") end + if enabledcallins.UnitFeatureCollision == nil then + return + end + if printcallins then + Spring.Echo("g:UnitFeatureCollision", colliderID, collideeID) + end + if showcallins then + addEvent(colliderID, "UnitFeatureCollision") + end end function gadget:FeatureCreated(featureID) - if enabledcallins.FeatureCreated == nil then return end + if enabledcallins.FeatureCreated == nil then + return + end local featureDefID = Spring.GetFeatureDefID(featureID) - if printcallins then Spring.Echo("g:FeatureCreated",featureID, FeatureDefs[featureDefID].name) end + if printcallins then + Spring.Echo("g:FeatureCreated", featureID, FeatureDefs[featureDefID].name) + end if showcallins then local fx, fy, fz = Spring.GetFeaturePosition(featureID) - local pos = {fx,fy,fz} + local pos = { fx, fy, fz } addEvent(pos, "FeatureCreated") end end function gadget:FeatureDestroyed(featureID) - if enabledcallins.FeatureDestroyed == nil then return end + if enabledcallins.FeatureDestroyed == nil then + return + end local featureDefID = Spring.GetFeatureDefID(featureID) - if printcallins then Spring.Echo("g:FeatureDestroyed",featureID, FeatureDefs[featureDefID].name) end + if printcallins then + Spring.Echo("g:FeatureDestroyed", featureID, FeatureDefs[featureDefID].name) + end if showcallins then local fx, fy, fz = Spring.GetFeaturePosition(featureID) - local pos = {fx,fy,fz} + local pos = { fx, fy, fz } addEvent(pos, "FeatureDestroyed") end end @@ -338,11 +541,11 @@ local function togglegadget() UnitCloaked = true, UnitDecloaked = true, UnitMoveFailed = true, - StockpileChanged = true, - RenderUnitDestroyed = true, - UnitReverseBuilt = true, - UnitUnitCollision = true, - UnitFeatureCollision = true, + StockpileChanged = true, + RenderUnitDestroyed = true, + UnitReverseBuilt = true, + UnitUnitCollision = true, + UnitFeatureCollision = true, FeatureCreated = true, FeatureDestroyed = true, } @@ -350,16 +553,15 @@ local function togglegadget() end function gadget:Initialize() - gadgetHandler:AddChatAction('unitcallinsgadget', togglegadget) + gadgetHandler:AddChatAction("unitcallinsgadget", togglegadget) end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('unitcallinsgadget') + gadgetHandler:RemoveChatAction("unitcallinsgadget") end function gadget:GetConfigData(data) return {} end -function gadget:SetConfigData(data) -end +function gadget:SetConfigData(data) end diff --git a/luarules/gadgets/dbg_unit_orders.lua b/luarules/gadgets/dbg_unit_orders.lua index 2326f8bd094..86e5692ea62 100644 --- a/luarules/gadgets/dbg_unit_orders.lua +++ b/luarules/gadgets/dbg_unit_orders.lua @@ -1,6 +1,5 @@ local gadget = gadget ---@type Gadget - --- TO USE: CHANGE THIS TO TRUE local ENABLED = false -- set to true to enable the gadget, it will print a lot of info about unit orders ------------------------------- @@ -40,12 +39,12 @@ end local function command(cmdID) local ret - + -- Typically negative IDs are build/construct commands if cmdID < 0 then if not UnitDefs[-cmdID] then - return "INVALID BUILD("..cmdID..")" - end + return "INVALID BUILD(" .. cmdID .. ")" + end local unitDefName = UnitDefs[-cmdID].name return "BUILD(" .. unitDefName .. ")" end @@ -60,8 +59,8 @@ local function command(cmdID) return "UNKNOWN(" .. cmdID .. ")" end --- Spring.SetCustomCommandDrawData --- +-- Spring.SetCustomCommandDrawData +-- if gadgetHandler:IsSyncedCode() then -- Synced @@ -69,22 +68,22 @@ if gadgetHandler:IsSyncedCode() then if unitTeam ~= 0 then return false end - Spring.Echo("CommandFallback", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) + Spring.Echo("CommandFallback", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) return false end - + function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, fromSynced, fromLua) if unitTeam ~= 0 then return true end - Spring.Echo("AllowCommand", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag, "synced", fromSynced, "lua", fromLua) + Spring.Echo("AllowCommand", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag, "synced", fromSynced, "lua", fromLua) return true end else -- Unsynced function gadget:CommandNotify(cmdID, cmdParams, cmdOptions) - Spring.Echo("CommandNotify", command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions)) + Spring.Echo("CommandNotify", command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions)) return false end @@ -99,21 +98,21 @@ else return nil end - + function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) if unitTeam ~= 0 then return end - - Spring.Echo("UnitCommand", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) + + Spring.Echo("UnitCommand", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) end - + function gadget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) if unitTeam ~= 0 then return end - Spring.Echo("UnitCmdDone", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) + Spring.Echo("UnitCmdDone", "uID", unitID, "defID", unitDefID, command(cmdID), "params", summaryOrSomething(cmdParams), "opts", summaryOrSomething(cmdOptions), "tag", cmdTag) local x, y, z = Spring.GetUnitPosition(unitID) if PING then Spring.MarkerAddPoint(x, y, z, "UnitCmdDone: " .. command(cmdID) .. " (tag: " .. tostring(cmdTag) .. ")") @@ -124,7 +123,7 @@ else if unitTeam ~= 0 then return end - + Spring.Echo("UnitIdle", "uID", unitID, "defID", unitDefID) Spring.Echo(" ") end diff --git a/luarules/gadgets/dbg_unitposition_logger.lua b/luarules/gadgets/dbg_unitposition_logger.lua index 65ea46dbc8d..3af7f53b475 100644 --- a/luarules/gadgets/dbg_unitposition_logger.lua +++ b/luarules/gadgets/dbg_unitposition_logger.lua @@ -23,19 +23,20 @@ end ]] if not gadgetHandler:IsSyncedCode() then + if Spring.IsReplay() then + return + end - if Spring.IsReplay() then return end - - local DEBUG = select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) == '[teh]Flow' + local DEBUG = select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) == "[teh]Flow" - local gameFramesPerSecond = 30 -- engine constant - local pingCutoff = 1500 -- players with higher ping wont participate in sending unit positions log - local pingCutoffFrames = math.ceil((pingCutoff / 1000) * gameFramesPerSecond ) + local gameFramesPerSecond = 30 -- engine constant + local pingCutoff = 1500 -- players with higher ping wont participate in sending unit positions log + local pingCutoffFrames = math.ceil((pingCutoff / 1000) * gameFramesPerSecond) -- based on the current number of units it will adjust the amount of gameframes between each log local minLogRate = math.floor(gameFramesPerSecond * 6) local maxLogRate = math.floor(gameFramesPerSecond * 30) - local maxLogRateUnits = 3000 -- # of units where maxLogRate gets reached + local maxLogRateUnits = 3000 -- # of units where maxLogRate gets reached local maxLogMemoryDuration = gameFramesPerSecond * 60 @@ -54,7 +55,7 @@ if not gadgetHandler:IsSyncedCode() then local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() local logRate = minLogRate - local lastLogFrame = 30-minLogRate + local lastLogFrame = 30 - minLogRate local log = {} local verifyQueue = {} @@ -62,16 +63,16 @@ if not gadgetHandler:IsSyncedCode() then local allUnitsTotal = 0 function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - allUnits[unitID] = {unitDefID, unitTeam} + allUnits[unitID] = { unitDefID, unitTeam } allUnitsTotal = allUnitsTotal + 1 end function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - allUnits[unitID] = {unitDefID, unitTeam} + allUnits[unitID] = { unitDefID, unitTeam } end function gadget:UnitTaken(unitID, unitDefID, oldTeam, newTeam) - allUnits[unitID] = {unitDefID, newTeam} + allUnits[unitID] = { unitDefID, newTeam } end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) @@ -80,14 +81,14 @@ if not gadgetHandler:IsSyncedCode() then end -- remember all unit positions (in case you're designated to send a missing part later) - local function updateLog(frame, participants) -- participants = playerID table + local function updateLog(frame, participants) -- participants = playerID table local numParticipants = #participants log[frame] = { attempts = 1, participants = participants, parts = {}, } - for part=1, numParticipants do + for part = 1, numParticipants do log[frame].parts[part] = {} end local part, teamID @@ -97,13 +98,13 @@ if not gadgetHandler:IsSyncedCode() then if px then i = i + 1 -- divide all units among participants/parts - part = math.min(numParticipants, math_ceil(i / (allUnitsTotal/numParticipants))) -- (used math.min cause sometimes the part is numParticipants+1 which will result in error) + part = math.min(numParticipants, math_ceil(i / (allUnitsTotal / numParticipants))) -- (used math.min cause sometimes the part is numParticipants+1 which will result in error) teamID = params[2] - if not log[frame].parts[part][teamID] then -- params[2] = teamID + if not log[frame].parts[part][teamID] then -- params[2] = teamID log[frame].parts[part][teamID] = {} end local count = #log[frame].parts[part][teamID] + 1 - log[frame].parts[part][teamID][count] = {unitID, params[1], math_floor(px), math_floor(pz)} + log[frame].parts[part][teamID][count] = { unitID, params[1], math_floor(px), math_floor(pz) } end end end @@ -113,7 +114,7 @@ if not gadgetHandler:IsSyncedCode() then frame, part = tonumber(frame), tonumber(part) if log[frame] then - log[frame].parts[part] = nil -- clear received part + log[frame].parts[part] = nil -- clear received part -- clear frame when all parts have been received local noParts = true @@ -123,23 +124,25 @@ if not gadgetHandler:IsSyncedCode() then end if noParts then log[frame] = nil - if DEBUG and (attempts ~= '1' or part > tonumber(numParts)) then - Spring.Echo('UNITLOG: "all received": frame:'..frame..' part:'..part..' parts:'..numParts..' attempts:'..attempts) + if DEBUG and (attempts ~= "1" or part > tonumber(numParts)) then + Spring.Echo('UNITLOG: "all received": frame:' .. frame .. " part:" .. part .. " parts:" .. numParts .. " attempts:" .. attempts) end end end end local function getFreeVerifyQueueKey(frame, depth) - if verifyQueue[frame] and (not depth or depth < 10) then -- limit recursion depth - if not depth then depth = 1 end + if verifyQueue[frame] and (not depth or depth < 10) then -- limit recursion depth + if not depth then + depth = 1 + end frame = getFreeVerifyQueueKey(frame + 1, depth + 1) end return frame end local function sendLog(frame, part, attempts) - Spring.SendLuaRulesMsg('log' .. validation .. frame ..';'.. part ..';'.. (#log[frame].participants) ..';'..attempts ..';'.. VFS.ZlibCompress(Json.encode(log[frame].parts[part]))) + Spring.SendLuaRulesMsg("log" .. validation .. frame .. ";" .. part .. ";" .. #log[frame].participants .. ";" .. attempts .. ";" .. VFS.ZlibCompress(Json.encode(log[frame].parts[part]))) end function gadget:Initialize() @@ -154,7 +157,9 @@ if not gadgetHandler:IsSyncedCode() then end function gadget:GameFrame(gf) - if gf < 30 then return end + if gf < 30 then + return + end -- check if all parts have been received, clear the logged frame if this is the case if verifyQueue[gf] then @@ -163,7 +168,7 @@ if not gadgetHandler:IsSyncedCode() then if log[frame] then log[frame].attempts = log[frame].attempts + 1 - if log[frame].attempts > #log[frame].participants then -- this should not happen... if so, something went wrong because we tried resending by all other participants already + if log[frame].attempts > #log[frame].participants then -- this should not happen... if so, something went wrong because we tried resending by all other participants already if DEBUG then local missingParts, missingUnits = 0, 0 for p, part in pairs(log[frame].parts) do @@ -172,7 +177,7 @@ if not gadgetHandler:IsSyncedCode() then missingUnits = missingUnits + #units end end - Spring.Echo('UNITLOG: "max attempts reached": frame:'..frame..' attempts:'..log[frame].attempts..'of '..(#log[frame].participants)..' missing parts:'..missingParts..' missing units:'..missingUnits) + Spring.Echo('UNITLOG: "max attempts reached": frame:' .. frame .. " attempts:" .. log[frame].attempts .. "of " .. #log[frame].participants .. " missing parts:" .. missingParts .. " missing units:" .. missingUnits) end log[frame] = nil else @@ -186,25 +191,25 @@ if not gadgetHandler:IsSyncedCode() then else -- start from first participant onwards local numParticipants = #log[frame].participants - designatedBackupParticipant = log[frame].participants[ log[frame].attempts - (numParticipants-part) ] + designatedBackupParticipant = log[frame].participants[log[frame].attempts - (numParticipants - part)] end if designatedBackupParticipant == myPlayerID then sendLog(frame, part, log[frame].attempts) end end - verifyQueue[ getFreeVerifyQueueKey(gf+verifyRate) ] = frame + verifyQueue[getFreeVerifyQueueKey(gf + verifyRate)] = frame end end end -- save and send you part of all unit positions - if gf >= lastLogFrame+logRate then + if gf >= lastLogFrame + logRate then lastLogFrame = gf -- cleanup incomplete old frames in case this has happened for some reason for frame, params in pairs(log) do - if frame < gf-maxLogMemoryDuration then + if frame < gf - maxLogMemoryDuration then if DEBUG then local missingParts, missingUnits = 0, 0 for p, part in pairs(log[frame].parts) do @@ -213,7 +218,7 @@ if not gadgetHandler:IsSyncedCode() then missingUnits = missingUnits + #units end end - Spring.Echo('UNITLOG: "timeout": frame:'..frame..' attempts:'..log[frame].attempts..'of '..(#log[frame].participants)..' missing parts:'..missingParts..' missing units:'..missingUnits) + Spring.Echo('UNITLOG: "timeout": frame:' .. frame .. " attempts:" .. log[frame].attempts .. "of " .. #log[frame].participants .. " missing parts:" .. missingParts .. " missing units:" .. missingUnits) end log[frame] = nil end @@ -225,31 +230,27 @@ if not gadgetHandler:IsSyncedCode() then -- find out which players/specs aren't lagged behind and available to send a part of all unit position data local participants = {} local myPart - for _,playerID in ipairs(Spring.GetPlayerList()) do - local name,_,_,teamID,_,ping = Spring.GetPlayerInfo(playerID,false) - -- exclude lagged out players and AI - -- NOTE: ping is 0 when player is catching up or playing local (local can be slightly above 0 when low fps 0.033) - local isDead = select(4, Spring.GetTeamInfo(teamID)) - if (ping > 0.01 or isSinglePlayer) and ping < pingCutoff/1000 and not Spring.GetTeamLuaAI(teamID) and not isDead then - participants[#participants+1] = playerID - if playerID == myPlayerID then - myPart = #participants + for _, playerID in ipairs(Spring.GetPlayerList()) do + local name, _, _, teamID, _, ping = Spring.GetPlayerInfo(playerID, false) + -- exclude lagged out players and AI + -- NOTE: ping is 0 when player is catching up or playing local (local can be slightly above 0 when low fps 0.033) + local isDead = select(4, Spring.GetTeamInfo(teamID)) + if (ping > 0.01 or isSinglePlayer) and ping < pingCutoff / 1000 and not Spring.GetTeamLuaAI(teamID) and not isDead then + participants[#participants + 1] = playerID + if playerID == myPlayerID then + myPart = #participants + end end - end - end -- send log when you're included as participant + end -- send log when you're included as participant if myPart then updateLog(gf, participants) sendLog(gf, myPart, 1) - verifyQueue[ getFreeVerifyQueueKey(gf+verifyRate) ] = gf + verifyQueue[getFreeVerifyQueueKey(gf + verifyRate)] = gf end end end - - -else -- SYNCED - - -local validation = string.randomString(2) +else -- SYNCED + local validation = string.randomString(2) _G.validationLogger = validation -- Cache prefix bytes: "log"(3) + validation(2) = 5 bytes @@ -258,12 +259,15 @@ local validation = string.randomString(2) -- Synced code here only listens to what has been received and thus logged in the demo, notifies unsynced so that can handle re-sending if necessary function gadget:RecvLuaMsg(msg, playerID) - if #msg < 5 then return end + if #msg < 5 then + return + end local b1, b2, b3, b4, b5 = string.byte(msg, 1, 5) - if b1 ~= lg1 or b2 ~= lg2 or b3 ~= lg3 or b4 ~= vb1 or b5 ~= vb2 then return end - local params = string.split(msg:sub(6, 40), ';') + if b1 ~= lg1 or b2 ~= lg2 or b3 ~= lg3 or b4 ~= vb1 or b5 ~= vb2 then + return + end + local params = string.split(msg:sub(6, 40), ";") SendToUnsynced("receivedPart", params[1], params[2], params[3], params[4]) return true end - end diff --git a/luarules/gadgets/dev_replay_data.lua b/luarules/gadgets/dev_replay_data.lua index 532c5f89293..135a9810e9b 100644 --- a/luarules/gadgets/dev_replay_data.lua +++ b/luarules/gadgets/dev_replay_data.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "UnitDamagedReplay", - desc = 'Expose full UnitDamaged to widgets only during replays', - author = 'Itanthias', - date = 'Sept 2022', - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true + name = "UnitDamagedReplay", + desc = "Expose full UnitDamaged to widgets only during replays", + author = "Itanthias", + date = "Sept 2022", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end @@ -88,4 +88,5 @@ function widget:Shutdown() end -]]-- +]] +-- diff --git a/luarules/gadgets/feature_dead_explosion.lua b/luarules/gadgets/feature_dead_explosion.lua index 166e03e19ca..cbac0c55701 100644 --- a/luarules/gadgets/feature_dead_explosion.lua +++ b/luarules/gadgets/feature_dead_explosion.lua @@ -12,32 +12,31 @@ function gadget:GetInfo() end if gadgetHandler:IsSyncedCode() then - - local effectsTable = { - [1] = {ceg = "corpsedestroyed", sound = "xplodragmetal"}, - [2] = {ceg = "corpsedestroyed", sound = "xplodragmetal"}, - [3] = {ceg = "corpsedestroyed", sound = "xplodragmetal"}, - [4] = {ceg = "corpsedestroyed", sound = "xplodragmetal"}, - [5] = {ceg = "corpsedestroyed", sound = "xplodragmetal"}, - } + local effectsTable = { + [1] = { ceg = "corpsedestroyed", sound = "xplodragmetal" }, + [2] = { ceg = "corpsedestroyed", sound = "xplodragmetal" }, + [3] = { ceg = "corpsedestroyed", sound = "xplodragmetal" }, + [4] = { ceg = "corpsedestroyed", sound = "xplodragmetal" }, + [5] = { ceg = "corpsedestroyed", sound = "xplodragmetal" }, + } local isCorpse = {} for featureDefID, featureDef in pairs(FeatureDefs) do - if featureDef.customParams.category and featureDef.customParams.category == 'corpses' then + if featureDef.customParams.category and featureDef.customParams.category == "corpses" then isCorpse[featureDefID] = math.min(featureDef.footprintX or 2, 5) end end - function gadget:FeatureDestroyed(featureID, allyTeamID) - local featureDefID = Spring.GetFeatureDefID(featureID) - if isCorpse[featureDefID] then - local _, _, resurrectProgress = Spring.GetFeatureHealth(featureID) - if resurrectProgress < 0.98 then - local x,y,z = Spring.GetFeaturePosition(featureID) + function gadget:FeatureDestroyed(featureID, allyTeamID) + local featureDefID = Spring.GetFeatureDefID(featureID) + if isCorpse[featureDefID] then + local _, _, resurrectProgress = Spring.GetFeatureHealth(featureID) + if resurrectProgress < 0.98 then + local x, y, z = Spring.GetFeaturePosition(featureID) local fsize = isCorpse[featureDefID] - Spring.SpawnCEG(effectsTable[fsize].ceg, x, y, z) - Spring.PlaySoundFile(effectsTable[fsize].sound, 1, x, y, z, 'sfx') - end - end - end + Spring.SpawnCEG(effectsTable[fsize].ceg, x, y, z) + Spring.PlaySoundFile(effectsTable[fsize].sound, 1, x, y, z, "sfx") + end + end + end end diff --git a/luarules/gadgets/feature_debris_physics.lua b/luarules/gadgets/feature_debris_physics.lua index 2945cb56839..8b02d1c7eaa 100644 --- a/luarules/gadgets/feature_debris_physics.lua +++ b/luarules/gadgets/feature_debris_physics.lua @@ -1,12 +1,14 @@ -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Debris physics", - desc = "Enable debris to move in directions other than Y", - enabled = true + name = "Debris physics", + desc = "Enable debris to move in directions other than Y", + enabled = true, } end @@ -18,12 +20,8 @@ for i = 1, #FeatureDefs do end end -function gadget:FeatureCreated (featureID) +function gadget:FeatureCreated(featureID) if validFeatureDefID[Spring.GetFeatureDefID(featureID)] then - Spring.SetFeatureMoveCtrl (featureID, false - , 1, 1, 1 - , 1, 1, 1 - , 1, 1, 1 - ) + Spring.SetFeatureMoveCtrl(featureID, false, 1, 1, 1, 1, 1, 1, 1, 1, 1) end end diff --git a/luarules/gadgets/feature_eta_widget_forwarding.lua b/luarules/gadgets/feature_eta_widget_forwarding.lua index 68fa841c4af..b752feebc8a 100644 --- a/luarules/gadgets/feature_eta_widget_forwarding.lua +++ b/luarules/gadgets/feature_eta_widget_forwarding.lua @@ -2,19 +2,17 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Feature ETA Widget Forwarding", - desc = "Notifies widgets that a feature reclaim or resurrect action has begun", - author = "Saul Goodman, copied from Beherith", -- ty Sprung - date = "March 2026", - license = "GNU GPL, v2 or later", - layer = -1, - enabled = true + name = "Feature ETA Widget Forwarding", + desc = "Notifies widgets that a feature reclaim or resurrect action has begun", + author = "Saul Goodman, copied from Beherith", -- ty Sprung + date = "March 2026", + license = "GNU GPL, v2 or later", + layer = -1, + enabled = true, } end - if gadgetHandler:IsSyncedCode() then - local SendToUnsynced = SendToUnsynced local spGetGameFrame = Spring.GetGameFrame local fps = Game.gameSpeed @@ -22,33 +20,32 @@ if gadgetHandler:IsSyncedCode() then local noProgressTimeout = 5 * fps -- ETAs will disappear after this many frames without progress -- Cached teamID to its allyTeamID local teamToAllyTeam = {} - + -- Map of featureID to map of allyTeamID to frame of last build step local forwardedFeatures = {} -- so we only forward the start event once -- Map of featureID to most recent build step frame for any ally team local featureLastStepTime = {} -- used to remove ETA's for ally teams that are no longer working on a feature - + function gadget:AllowFeatureBuildStep(builderID, builderTeamID, featureID, featureDefID, step) - local currentDayFrames, days = spGetGameFrame() local currentFrame = currentDayFrames + (days * dayFrames) local builderAllyTeamID = teamToAllyTeam[builderTeamID] - + local lastStepFrames = forwardedFeatures[featureID] if lastStepFrames == nil then lastStepFrames = {} forwardedFeatures[featureID] = lastStepFrames end - + if lastStepFrames[builderAllyTeamID] == nil then SendToUnsynced("etaFeatureReclaimStartFrame", featureID, builderAllyTeamID, step) end lastStepFrames[builderAllyTeamID] = currentFrame featureLastStepTime[featureID] = currentFrame - + return true end - + local updateInterval = 6 local updateCounter = updateInterval function gadget:GameFrame(frame) @@ -57,7 +54,7 @@ if gadgetHandler:IsSyncedCode() then return end updateCounter = updateInterval - + --Check if there are any ally teams that are no longer reclaiming or resurrecting a feature and --send a stop signal --There may be two ally teams reclaiming the same feature and we want to remove the ETA when an @@ -72,7 +69,6 @@ if gadgetHandler:IsSyncedCode() then end end end - end function gadget:FeatureDestroyed(featureID, allyTeamID) @@ -86,13 +82,11 @@ if gadgetHandler:IsSyncedCode() then end end end - else - local myPlayerID = Spring.GetMyPlayerID() local myAllyTeamID = Spring.GetMyAllyTeamID() local _, fullview = Spring.GetSpectatingState() - + --Map of allyTeamID to set of featureIDs. Used to resend ETAs when player changes ally team local featureETATeamCache = {} @@ -100,7 +94,7 @@ else if playerID == myPlayerID then myAllyTeamID = Spring.GetMyAllyTeamID() _, fullview = Spring.GetSpectatingState() - + --Resend feature ETAs when team changes so that we can see active ETAs of new team and stop seeing ETAs of old team local myAllyTeamCache = featureETATeamCache[myAllyTeamID] for _, featureIDs in pairs(featureETATeamCache) do diff --git a/luarules/gadgets/fx_atmosphere.lua b/luarules/gadgets/fx_atmosphere.lua index a7215f9a709..1a1ab05d20a 100644 --- a/luarules/gadgets/fx_atmosphere.lua +++ b/luarules/gadgets/fx_atmosphere.lua @@ -1,16 +1,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "GeoVent Sounds", - desc = "Plays sound effect over geovents", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - version = 1, - layer = 5, - enabled = true - } + return { + name = "GeoVent Sounds", + desc = "Plays sound effect over geovents", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = true, + } end if gadgetHandler:IsSyncedCode() then @@ -18,164 +18,149 @@ if gadgetHandler:IsSyncedCode() then end local data = { - map_sizeX = Game.mapSizeX, -- no touchies - map_sizeZ = Game.mapSizeZ, -- no touchies - map_minHeight = Spring.GetGroundExtremes(), -- no touchies - map_maxHeight = select(2, Spring.GetGroundExtremes()), -- no touchies - map_voidWater = false, -- no touchies - - geo_ventPositions = {}, -- no touchies - geo_currentGeoVentID = 1, -- no touchies - geo_numberOfGeoVentPositions = 0, -- no touchies - geo_soundDelay = 125, - - wind_lastSoundFrame = 0, -- no touchies - wind_soundDelay = 60, - wind_minHeight = select(2, Spring.GetGroundExtremes())*0.6, - wind_maxHeight = select(2, Spring.GetGroundExtremes()), - wind_soundBank = {"windy1", "windy2", "windy3", "windy4", "windy5", }, - wind_rareSoundBank = {"windy1", "windy2", "windy3", "windy4", "windy5", }, - - sea_lastSoundFrame = 0, -- no touchies - sea_soundDelay = 60, - sea_minDepth = -23, - sea_soundBank = {"beach1", "beach2", "beach3", "beach4", "beach5", "beach6", }, - sea_rareSoundBank = {"beach1", "beach2", "beach3", "beach4", "beach5", "beach6", }, - - beach_lastSoundFrame = 0, -- no touchies - beach_soundDelay = 60, - beach_maxDepth = -19, - beach_soundBank = {"ocean1", "ocean2", "ocean3", "ocean4", "ocean5", "ocean6", }, - beach_rareSoundBank = {"ocean1", "ocean2", "ocean3", "ocean4", "ocean5", "ocean6", }, + map_sizeX = Game.mapSizeX, -- no touchies + map_sizeZ = Game.mapSizeZ, -- no touchies + map_minHeight = Spring.GetGroundExtremes(), -- no touchies + map_maxHeight = select(2, Spring.GetGroundExtremes()), -- no touchies + map_voidWater = false, -- no touchies + + geo_ventPositions = {}, -- no touchies + geo_currentGeoVentID = 1, -- no touchies + geo_numberOfGeoVentPositions = 0, -- no touchies + geo_soundDelay = 125, + + wind_lastSoundFrame = 0, -- no touchies + wind_soundDelay = 60, + wind_minHeight = select(2, Spring.GetGroundExtremes()) * 0.6, + wind_maxHeight = select(2, Spring.GetGroundExtremes()), + wind_soundBank = { "windy1", "windy2", "windy3", "windy4", "windy5" }, + wind_rareSoundBank = { "windy1", "windy2", "windy3", "windy4", "windy5" }, + + sea_lastSoundFrame = 0, -- no touchies + sea_soundDelay = 60, + sea_minDepth = -23, + sea_soundBank = { "beach1", "beach2", "beach3", "beach4", "beach5", "beach6" }, + sea_rareSoundBank = { "beach1", "beach2", "beach3", "beach4", "beach5", "beach6" }, + + beach_lastSoundFrame = 0, -- no touchies + beach_soundDelay = 60, + beach_maxDepth = -19, + beach_soundBank = { "ocean1", "ocean2", "ocean3", "ocean4", "ocean5", "ocean6" }, + beach_rareSoundBank = { "ocean1", "ocean2", "ocean3", "ocean4", "ocean5", "ocean6" }, } local spawnWarpInFrame = Game.spawnWarpInFrame - - function UpdateAllData() - data.map_voidWater = gl.GetMapRendering("voidWater") + data.map_voidWater = gl.GetMapRendering("voidWater") end function CollectGeoVentPositions() - local allFeatures = Spring.GetAllFeatures() - for i = 1,#allFeatures do -- loop through all features on the map - if FeatureDefs[Spring.GetFeatureDefID(allFeatures[i])].geoThermal then -- isGeoSpot - local x,y,z = Spring.GetFeaturePosition(allFeatures[i]) - local allowGeo = true - for i = 1,#data.geo_ventPositions do -- Check for duplicate geo vent spots, we don't want that. - local posx = data.geo_ventPositions[i].x - local posz = data.geo_ventPositions[i].z - if (x > posx-64 and x < posx+64) and (z > posz-64 and z < posz+64) then - allowGeo = false - end - end - if allowGeo then -- it's not a duplicate, let's add it to the list - data.geo_ventPositions[#data.geo_ventPositions+1] = {x = x, y = y, z = z} - data.geo_numberOfGeoVentPositions = data.geo_numberOfGeoVentPositions + 1 - end - end - end - if data.geo_numberOfGeoVentPositions > 0 then -- avoid dividing by zero - data.geo_soundDelay = math.ceil(data.geo_soundDelay/data.geo_numberOfGeoVentPositions) - end + local allFeatures = Spring.GetAllFeatures() + for i = 1, #allFeatures do -- loop through all features on the map + if FeatureDefs[Spring.GetFeatureDefID(allFeatures[i])].geoThermal then -- isGeoSpot + local x, y, z = Spring.GetFeaturePosition(allFeatures[i]) + local allowGeo = true + for i = 1, #data.geo_ventPositions do -- Check for duplicate geo vent spots, we don't want that. + local posx = data.geo_ventPositions[i].x + local posz = data.geo_ventPositions[i].z + if (x > posx - 64 and x < posx + 64) and (z > posz - 64 and z < posz + 64) then + allowGeo = false + end + end + if allowGeo then -- it's not a duplicate, let's add it to the list + data.geo_ventPositions[#data.geo_ventPositions + 1] = { x = x, y = y, z = z } + data.geo_numberOfGeoVentPositions = data.geo_numberOfGeoVentPositions + 1 + end + end + end + if data.geo_numberOfGeoVentPositions > 0 then -- avoid dividing by zero + data.geo_soundDelay = math.ceil(data.geo_soundDelay / data.geo_numberOfGeoVentPositions) + end end function PlayGeoVentSound() - local randomposx = data.geo_ventPositions[data.geo_currentGeoVentID].x - local randomposz = data.geo_ventPositions[data.geo_currentGeoVentID].z - local randomposy = data.geo_ventPositions[data.geo_currentGeoVentID].y - if Spring.IsSphereInView(randomposx,randomposy,randomposz) then - Spring.PlaySoundFile("geoventshort", 0.25, randomposx, randomposy, randomposz, 'sfx') - end - data.geo_currentGeoVentID = data.geo_currentGeoVentID + 1 - if data.geo_currentGeoVentID > data.geo_numberOfGeoVentPositions then -- we've played sound for all of them, repeat the loop. - data.geo_currentGeoVentID = 1 - end + local randomposx = data.geo_ventPositions[data.geo_currentGeoVentID].x + local randomposz = data.geo_ventPositions[data.geo_currentGeoVentID].z + local randomposy = data.geo_ventPositions[data.geo_currentGeoVentID].y + if Spring.IsSphereInView(randomposx, randomposy, randomposz) then + Spring.PlaySoundFile("geoventshort", 0.25, randomposx, randomposy, randomposz, "sfx") + end + data.geo_currentGeoVentID = data.geo_currentGeoVentID + 1 + if data.geo_currentGeoVentID > data.geo_numberOfGeoVentPositions then -- we've played sound for all of them, repeat the loop. + data.geo_currentGeoVentID = 1 + end end function PlayWindSound(n) -- We want wind to play at volume depending on wind speed and height. - local randomposx = math.random(0, data.map_sizeX) - local randomposz = math.random(0, data.map_sizeZ) - local randomposy = Spring.GetGroundHeight(randomposx, randomposz) - if randomposy >= data.wind_minHeight and Spring.IsSphereInView(randomposx,randomposy + 400,randomposz) then - local windSpeed = select(4, Spring.GetWind())/25 - if math.random() > 0.1 then - Spring.PlaySoundFile(data.wind_soundBank[math.random(1,#data.wind_soundBank)], windSpeed*0.6, randomposx, (randomposy + 400), randomposz, 'sfx') - else - Spring.PlaySoundFile(data.wind_rareSoundBank[math.random(1,#data.wind_rareSoundBank)], windSpeed*0.6, randomposx, (randomposy + 400), randomposz, 'sfx') - end - data.wind_lastSoundFrame = n - end + local randomposx = math.random(0, data.map_sizeX) + local randomposz = math.random(0, data.map_sizeZ) + local randomposy = Spring.GetGroundHeight(randomposx, randomposz) + if randomposy >= data.wind_minHeight and Spring.IsSphereInView(randomposx, randomposy + 400, randomposz) then + local windSpeed = select(4, Spring.GetWind()) / 25 + if math.random() > 0.1 then + Spring.PlaySoundFile(data.wind_soundBank[math.random(1, #data.wind_soundBank)], windSpeed * 0.6, randomposx, (randomposy + 400), randomposz, "sfx") + else + Spring.PlaySoundFile(data.wind_rareSoundBank[math.random(1, #data.wind_rareSoundBank)], windSpeed * 0.6, randomposx, (randomposy + 400), randomposz, "sfx") + end + data.wind_lastSoundFrame = n + end end function PlaySeaSound(n) -- We want wind to play at volume depending on wind speed and height. - local randomposx = math.random(0, data.map_sizeX) - local randomposz = math.random(0, data.map_sizeZ) - local randomposy = Spring.GetGroundHeight(randomposx, randomposz) - if randomposy <= data.sea_minDepth and Spring.IsSphereInView(randomposx,randomposy + 400,randomposz) then - local windSpeed = select(4, Spring.GetWind())/25 - if math.random() > 0.1 then - Spring.PlaySoundFile(data.sea_soundBank[math.random(1,#data.sea_soundBank)], (0.10 + (windSpeed*0.75)), randomposx, (randomposy + 400), randomposz, 'sfx') - else - Spring.PlaySoundFile(data.sea_rareSoundBank[math.random(1,#data.sea_rareSoundBank)], (0.10 + (windSpeed*0.75)), randomposx, (randomposy + 400), randomposz, 'sfx') - end - data.sea_lastSoundFrame = n - end + local randomposx = math.random(0, data.map_sizeX) + local randomposz = math.random(0, data.map_sizeZ) + local randomposy = Spring.GetGroundHeight(randomposx, randomposz) + if randomposy <= data.sea_minDepth and Spring.IsSphereInView(randomposx, randomposy + 400, randomposz) then + local windSpeed = select(4, Spring.GetWind()) / 25 + if math.random() > 0.1 then + Spring.PlaySoundFile(data.sea_soundBank[math.random(1, #data.sea_soundBank)], (0.10 + (windSpeed * 0.75)), randomposx, (randomposy + 400), randomposz, "sfx") + else + Spring.PlaySoundFile(data.sea_rareSoundBank[math.random(1, #data.sea_rareSoundBank)], (0.10 + (windSpeed * 0.75)), randomposx, (randomposy + 400), randomposz, "sfx") + end + data.sea_lastSoundFrame = n + end end function PlayBeachSound(n) -- We want wind to play at volume depending on wind speed and height. - local randomposx = math.random(0, data.map_sizeX) - local randomposz = math.random(0, data.map_sizeZ) - local randomposy = Spring.GetGroundHeight(randomposx, randomposz) - if randomposy < 0 and randomposy >= data.beach_maxDepth and Spring.IsSphereInView(randomposx,randomposy,randomposz) then - local windSpeed = select(4, Spring.GetWind())/25 - if math.random() > 0.1 then - Spring.PlaySoundFile(data.beach_soundBank[math.random(1,#data.beach_soundBank)], (0.20 + (windSpeed*0.6)), randomposx, (randomposy + 400), randomposz, 'sfx') - else - Spring.PlaySoundFile(data.beach_rareSoundBank[math.random(1,#data.beach_rareSoundBank)], (0.20 + (windSpeed*0.6)), randomposx, (randomposy + 400), randomposz, 'sfx') - end - data.beach_lastSoundFrame = n - end + local randomposx = math.random(0, data.map_sizeX) + local randomposz = math.random(0, data.map_sizeZ) + local randomposy = Spring.GetGroundHeight(randomposx, randomposz) + if randomposy < 0 and randomposy >= data.beach_maxDepth and Spring.IsSphereInView(randomposx, randomposy, randomposz) then + local windSpeed = select(4, Spring.GetWind()) / 25 + if math.random() > 0.1 then + Spring.PlaySoundFile(data.beach_soundBank[math.random(1, #data.beach_soundBank)], (0.20 + (windSpeed * 0.6)), randomposx, (randomposy + 400), randomposz, "sfx") + else + Spring.PlaySoundFile(data.beach_rareSoundBank[math.random(1, #data.beach_rareSoundBank)], (0.20 + (windSpeed * 0.6)), randomposx, (randomposy + 400), randomposz, "sfx") + end + data.beach_lastSoundFrame = n + end end - - - - - - - function gadget:GameFrame(n) - -- Collect data for sounds. - if n == spawnWarpInFrame then - CollectGeoVentPositions() - UpdateAllData() - + -- Collect data for sounds. + if n == spawnWarpInFrame then + CollectGeoVentPositions() + UpdateAllData() elseif n > spawnWarpInFrame then - - if data.geo_numberOfGeoVentPositions > 0 then - if n%data.geo_soundDelay == 0 then -- play sound - PlayGeoVentSound() - end - end - - if n >= data.wind_lastSoundFrame+data.wind_soundDelay then - PlayWindSound(n) - end - - if not data.map_voidWater then -- Only play water sounds on maps with water - - if n >= data.sea_lastSoundFrame+data.sea_soundDelay then - PlaySeaSound(n) - end - - if n >= data.beach_lastSoundFrame+data.beach_soundDelay then - PlayBeachSound(n) - end - - end - - end - -end \ No newline at end of file + if data.geo_numberOfGeoVentPositions > 0 then + if n % data.geo_soundDelay == 0 then -- play sound + PlayGeoVentSound() + end + end + + if n >= data.wind_lastSoundFrame + data.wind_soundDelay then + PlayWindSound(n) + end + + if not data.map_voidWater then -- Only play water sounds on maps with water + if n >= data.sea_lastSoundFrame + data.sea_soundDelay then + PlaySeaSound(n) + end + + if n >= data.beach_lastSoundFrame + data.beach_soundDelay then + PlayBeachSound(n) + end + end + end +end diff --git a/luarules/gadgets/fx_depthcharge_splash.lua b/luarules/gadgets/fx_depthcharge_splash.lua index 8d9bece28ac..27e64850401 100644 --- a/luarules/gadgets/fx_depthcharge_splash.lua +++ b/luarules/gadgets/fx_depthcharge_splash.lua @@ -1,20 +1,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Depthcharge splash", - desc = "Makes splashes for depth-charges and torpedoes entering the water", - version = "cake", - author = "Bluestone", - date = "July 2014", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, - } + return { + name = "Depthcharge splash", + desc = "Makes splashes for depth-charges and torpedoes entering the water", + version = "cake", + author = "Bluestone", + date = "July 2014", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local GetProjectilePosition = Spring.GetProjectilePosition @@ -23,63 +23,63 @@ local waterIsLava = Spring.GetModOptions().map_waterislava local depthChargeWeapons = {} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'TorpedoLauncher' then - --if weaponDef.visuals.modelName == 'objects3d/minitorpedo.3do' then - -- depthChargeWeapons[weaponID] = 'splash-tiny' - if weaponDef.visuals.modelName == 'objects3d/torpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/cordepthcharge.s3o' - or weaponDef.visuals.modelName == 'objects3d/torpedo.3do' or weaponDef.visuals.modelName == 'objects3d/depthcharge.3do' then - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-torpedo' or 'splash-torpedo' - elseif weaponDef.visuals.modelName == 'objects3d/coradvtorpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/Advtorpedo.3do' then - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-tiny' or 'splash-tiny' - else - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-torpedo' or 'splash-torpedo' - end - end + if weaponDef.type == "TorpedoLauncher" then + --if weaponDef.visuals.modelName == 'objects3d/minitorpedo.3do' then + -- depthChargeWeapons[weaponID] = 'splash-tiny' + if weaponDef.visuals.modelName == "objects3d/torpedo.s3o" or weaponDef.visuals.modelName == "objects3d/cordepthcharge.s3o" or weaponDef.visuals.modelName == "objects3d/torpedo.3do" or weaponDef.visuals.modelName == "objects3d/depthcharge.3do" then + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-torpedo" or "splash-torpedo" + elseif weaponDef.visuals.modelName == "objects3d/coradvtorpedo.s3o" or weaponDef.visuals.modelName == "objects3d/Advtorpedo.3do" then + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-tiny" or "splash-tiny" + else + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-torpedo" or "splash-torpedo" + end + end end function gadget:Initialize() - for wDID,_ in pairs(depthChargeWeapons) do - Script.SetWatchProjectile(wDID, true) - end + for wDID, _ in pairs(depthChargeWeapons) do + Script.SetWatchProjectile(wDID, true) + end end local missiles = {} --Depthcharges that are above the surface still function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) - if depthChargeWeapons[weaponDefID] then - local _,y,_ = GetProjectilePosition(proID) - if y > 0 then - missiles[proID] = depthChargeWeapons[weaponDefID] - end - end + if depthChargeWeapons[weaponDefID] then + local _, y, _ = GetProjectilePosition(proID) + if y > 0 then + missiles[proID] = depthChargeWeapons[weaponDefID] + end + end end function gadget:ProjectileDestroyed(proID) missiles[proID] = nil end - function gadget:GameFrame(n) - local removeList - local removeCount = 0 - for proID,_ in pairs(missiles) do - local x,y,z = GetProjectilePosition(proID) - if y then - if y < 0 then - Spring.SpawnCEG(missiles[proID],x,0,z) - removeCount = removeCount + 1 - if not removeList then removeList = {} end - removeList[removeCount] = proID - end - else - removeCount = removeCount + 1 - if not removeList then removeList = {} end - removeList[removeCount] = proID - end - end - for i = 1, removeCount do - missiles[removeList[i]] = nil - end + local removeList + local removeCount = 0 + for proID, _ in pairs(missiles) do + local x, y, z = GetProjectilePosition(proID) + if y then + if y < 0 then + Spring.SpawnCEG(missiles[proID], x, 0, z) + removeCount = removeCount + 1 + if not removeList then + removeList = {} + end + removeList[removeCount] = proID + end + else + removeCount = removeCount + 1 + if not removeList then + removeList = {} + end + removeList[removeCount] = proID + end + end + for i = 1, removeCount do + missiles[removeList[i]] = nil + end end - - diff --git a/luarules/gadgets/fx_missile_smoke.lua b/luarules/gadgets/fx_missile_smoke.lua index 65cef89434d..0a16cc7d989 100644 --- a/luarules/gadgets/fx_missile_smoke.lua +++ b/luarules/gadgets/fx_missile_smoke.lua @@ -1,27 +1,25 @@ -- disabled it... cause not all missile weapons have flighttime defined, -- but can run out of fuel when they dont traight fly to maxrange - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Missile smoke", - desc = "addes smoke ceg after missile flighttime is over", - version = "tart", - author = "Floris", - date = "October 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, - } + return { + name = "Missile smoke", + desc = "addes smoke ceg after missile flighttime is over", + version = "tart", + author = "Floris", + date = "October 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end - local GetProjectilePosition = Spring.GetProjectilePosition local GetProjectileDirection = Spring.GetProjectileDirection @@ -29,70 +27,66 @@ local missiles = {} --subMissiles that are below the surface still local missileWeapons = {} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'MissileLauncher' then - if weaponDef.cegTag == 'missiletrailsmall' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-smoke' - elseif weaponDef.cegTag == 'missiletrailsmall-simple' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-simple-smoke' - elseif weaponDef.cegTag == 'missiletrailsmall-red' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-red-smoke' - elseif weaponDef.cegTag == 'missiletrailmedium' then - missileWeapons[weaponDef.id] = 'missiletrailmedium-smoke' - elseif weaponDef.cegTag == 'missiletrailmedium-red' then - missileWeapons[weaponDef.id] = 'missiletrailmedium-smoke' - elseif weaponDef.cegTag == 'missiletraillarge' then - missileWeapons[weaponDef.id] = 'missiletraillarge-smoke' - elseif weaponDef.cegTag == 'missiletraillarge-red' then - missileWeapons[weaponDef.id] = 'missiletraillarge-smoke' - elseif weaponDef.cegTag == 'missiletrailtiny' then - missileWeapons[weaponDef.id] = 'missiletrailtiny-smoke' - elseif weaponDef.cegTag == 'missiletrailaa' then - missileWeapons[weaponDef.id] = 'missiletrailaa-smoke' - --elseif weaponDef.cegTag == 'missiletrailfighter' then - -- missileWeapons[weaponDef.id] = 'missiletrailfighter-smoke' - end - end + if weaponDef.type == "MissileLauncher" then + if weaponDef.cegTag == "missiletrailsmall" then + missileWeapons[weaponDef.id] = "missiletrailsmall-smoke" + elseif weaponDef.cegTag == "missiletrailsmall-simple" then + missileWeapons[weaponDef.id] = "missiletrailsmall-simple-smoke" + elseif weaponDef.cegTag == "missiletrailsmall-red" then + missileWeapons[weaponDef.id] = "missiletrailsmall-red-smoke" + elseif weaponDef.cegTag == "missiletrailmedium" then + missileWeapons[weaponDef.id] = "missiletrailmedium-smoke" + elseif weaponDef.cegTag == "missiletrailmedium-red" then + missileWeapons[weaponDef.id] = "missiletrailmedium-smoke" + elseif weaponDef.cegTag == "missiletraillarge" then + missileWeapons[weaponDef.id] = "missiletraillarge-smoke" + elseif weaponDef.cegTag == "missiletraillarge-red" then + missileWeapons[weaponDef.id] = "missiletraillarge-smoke" + elseif weaponDef.cegTag == "missiletrailtiny" then + missileWeapons[weaponDef.id] = "missiletrailtiny-smoke" + elseif weaponDef.cegTag == "missiletrailaa" then + missileWeapons[weaponDef.id] = "missiletrailaa-smoke" + --elseif weaponDef.cegTag == 'missiletrailfighter' then + -- missileWeapons[weaponDef.id] = 'missiletrailfighter-smoke' + end + end end - function gadget:Initialize() - for wDID,_ in pairs(missileWeapons) do - Script.SetWatchProjectile(wDID, true) - end + for wDID, _ in pairs(missileWeapons) do + Script.SetWatchProjectile(wDID, true) + end end - function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) - if missileWeapons[weaponDefID] then - missiles[proID] = {Spring.GetGameFrame()-4 + Spring.GetProjectileTimeToLive(proID), missileWeapons[weaponDefID]} - end + if missileWeapons[weaponDefID] then + missiles[proID] = { Spring.GetGameFrame() - 4 + Spring.GetProjectileTimeToLive(proID), missileWeapons[weaponDefID] } + end end - function gadget:ProjectileDestroyed(proID) missiles[proID] = nil end - function gadget:GameFrame(gf) - local removeList - local removeCount = 0 - for proID, missile in pairs(missiles) do - if gf > missile[1] then - local x,y,z = GetProjectilePosition(proID) - if y and y > 0 then - local dirX,dirY,dirZ = GetProjectileDirection(proID) - Spring.SpawnCEG(missile[2],x,y,z,dirX,dirY,dirZ) - else - removeCount = removeCount + 1 - if not removeList then removeList = {} end - removeList[removeCount] = proID - end - end - end - for i = 1, removeCount do - missiles[removeList[i]] = nil - end + local removeList + local removeCount = 0 + for proID, missile in pairs(missiles) do + if gf > missile[1] then + local x, y, z = GetProjectilePosition(proID) + if y and y > 0 then + local dirX, dirY, dirZ = GetProjectileDirection(proID) + Spring.SpawnCEG(missile[2], x, y, z, dirX, dirY, dirZ) + else + removeCount = removeCount + 1 + if not removeList then + removeList = {} + end + removeList[removeCount] = proID + end + end + end + for i = 1, removeCount do + missiles[removeList[i]] = nil + end end - - diff --git a/luarules/gadgets/fx_missile_starburst_liftoff.lua b/luarules/gadgets/fx_missile_starburst_liftoff.lua index 7efffd47832..50f3b57e65d 100644 --- a/luarules/gadgets/fx_missile_starburst_liftoff.lua +++ b/luarules/gadgets/fx_missile_starburst_liftoff.lua @@ -1,7 +1,6 @@ -- disabled it... cause not all missile weapons have flighttime defined, -- but can run out of fuel when they dont traight fly to maxrange - local gadget = gadget ---@type Gadget function gadget:GetInfo() @@ -29,55 +28,97 @@ local missiles = {} --subMissiles that are below the surface still local missileWeapons = {} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'StarburstLauncher' then - if weaponDef.cegTag == 'missiletrailsmall-starburst' then + if weaponDef.type == "StarburstLauncher" then + if weaponDef.cegTag == "missiletrailsmall-starburst" then missileWeapons[weaponDef.id] = { 0, - 'missiletrailsmall-starburst-vertical', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundsmall-liftoff', 60, 90, - 'missilegroundsmall-liftoff-fire', 25, 45 + "missiletrailsmall-starburst-vertical", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundsmall-liftoff", + 60, + 90, + "missilegroundsmall-liftoff-fire", + 25, + 45, } - elseif weaponDef.cegTag == 'missiletrailmedium-starburst' then + elseif weaponDef.cegTag == "missiletrailmedium-starburst" then missileWeapons[weaponDef.id] = { 0, - 'missiletrailmedium-starburst-vertical', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundmedium-liftoff', 40, 60, - 'missilegroundmedium-liftoff-fire', 30, 40 + "missiletrailmedium-starburst-vertical", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundmedium-liftoff", + 40, + 60, + "missilegroundmedium-liftoff-fire", + 30, + 40, } - elseif weaponDef.cegTag == 'missiletrail-juno' then + elseif weaponDef.cegTag == "missiletrail-juno" then missileWeapons[weaponDef.id] = { 0, - 'missiletrail-juno-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 80, 120, - 'missilegroundlarge-liftoff-fire', 40, 80 + "missiletrail-juno-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 80, + 120, + "missilegroundlarge-liftoff-fire", + 40, + 80, } - elseif weaponDef.cegTag == 'antimissiletrail' then + elseif weaponDef.cegTag == "antimissiletrail" then missileWeapons[weaponDef.id] = { 0, - 'antimissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 80, 120, - 'missilegroundlarge-liftoff-fire', 40, 80 + "antimissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 80, + 120, + "missilegroundlarge-liftoff-fire", + 40, + 80, } - elseif weaponDef.cegTag == 'cruisemissiletrail-emp' then + elseif weaponDef.cegTag == "cruisemissiletrail-emp" then missileWeapons[weaponDef.id] = { 0, - 'cruisemissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 90, 166, - 'missilegroundlarge-liftoff-fire', 55, 120 + "cruisemissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 90, + 166, + "missilegroundlarge-liftoff-fire", + 55, + 120, } - elseif weaponDef.cegTag == 'cruisemissiletrail-tacnuke' then + elseif weaponDef.cegTag == "cruisemissiletrail-tacnuke" then missileWeapons[weaponDef.id] = { 15, - 'cruisemissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 90, 166, - 'missilegroundlarge-liftoff-fire', 55, 120 + "cruisemissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 90, + 166, + "missilegroundlarge-liftoff-fire", + 55, + 120, } - elseif weaponDef.cegTag == 'NUKETRAIL' then + elseif weaponDef.cegTag == "NUKETRAIL" then missileWeapons[weaponDef.id] = { 0, - 'nuketrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundhuge-liftoff', 120, 180, - 'missilegroundhuge-liftoff-fire', 60, 150 + "nuketrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundhuge-liftoff", + 120, + 180, + "missilegroundhuge-liftoff-fire", + 60, + 150, } end end @@ -142,12 +183,16 @@ function gadget:GameFrame(gf) end else removeCount = removeCount + 1 - if not removeList then removeList = {} end + if not removeList then + removeList = {} + end removeList[removeCount] = proID end else removeCount = removeCount + 1 - if not removeList then removeList = {} end + if not removeList then + removeList = {} + end removeList[removeCount] = proID end end @@ -155,5 +200,3 @@ function gadget:GameFrame(gf) missiles[removeList[i]] = nil end end - - diff --git a/luarules/gadgets/fx_projectile_effects.lua b/luarules/gadgets/fx_projectile_effects.lua index 7733ddefa0b..2de37e5b46e 100644 --- a/luarules/gadgets/fx_projectile_effects.lua +++ b/luarules/gadgets/fx_projectile_effects.lua @@ -1,16 +1,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Projectile Effects", - desc = "Unifies projectile effect CEG spawning", - version = "1", - author = "Beherith, Floris, Bluestone", - date = "2023.11.13", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Projectile Effects", + desc = "Unifies projectile effect CEG spawning", + version = "1", + author = "Beherith, Floris, Bluestone", + date = "2023.11.13", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end --- This gadget replaces: ----- @@ -21,7 +21,7 @@ end -- Also, it should check wether water is even possibly present on the map, and not even check for those if not gadgetHandler:IsSyncedCode() then - return false + return false end local GetProjectilePosition = Spring.GetProjectilePosition @@ -35,7 +35,6 @@ local mathMax = math.max -- Helpful debug wrapper: -- SpawnCEG = function(ceg,x,y,z,dx,dy,dz) Spring.Echo(ceg,x,y,z); Spring.SpawnCEG(ceg,x,y,z,dx,dy,dz) end - local gameFrame = 0 local mapHasWater = true @@ -50,29 +49,29 @@ local missileIDtoLifeEnd = {} local missileWeapons = {} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'MissileLauncher' then - if weaponDef.cegTag == 'missiletrailsmall' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-smoke' - elseif weaponDef.cegTag == 'missiletrailsmall-simple' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-simple-smoke' - elseif weaponDef.cegTag == 'missiletrailsmall-red' then - missileWeapons[weaponDef.id] = 'missiletrailsmall-red-smoke' - elseif weaponDef.cegTag == 'missiletrailmedium' then - missileWeapons[weaponDef.id] = 'missiletrailmedium-smoke' - elseif weaponDef.cegTag == 'missiletrailmedium-red' then - missileWeapons[weaponDef.id] = 'missiletrailmedium-smoke' - elseif weaponDef.cegTag == 'missiletraillarge' then - missileWeapons[weaponDef.id] = 'missiletraillarge-smoke' - elseif weaponDef.cegTag == 'missiletraillarge-red' then - missileWeapons[weaponDef.id] = 'missiletraillarge-smoke' - elseif weaponDef.cegTag == 'missiletrailtiny' then - missileWeapons[weaponDef.id] = 'missiletrailtiny-smoke' - elseif weaponDef.cegTag == 'missiletrailaa' then - missileWeapons[weaponDef.id] = 'missiletrailaa-smoke' - --elseif weaponDef.cegTag == 'missiletrailfighter' then - -- missileWeapons[weaponDef.id] = 'missiletrailfighter-smoke' - end - end + if weaponDef.type == "MissileLauncher" then + if weaponDef.cegTag == "missiletrailsmall" then + missileWeapons[weaponDef.id] = "missiletrailsmall-smoke" + elseif weaponDef.cegTag == "missiletrailsmall-simple" then + missileWeapons[weaponDef.id] = "missiletrailsmall-simple-smoke" + elseif weaponDef.cegTag == "missiletrailsmall-red" then + missileWeapons[weaponDef.id] = "missiletrailsmall-red-smoke" + elseif weaponDef.cegTag == "missiletrailmedium" then + missileWeapons[weaponDef.id] = "missiletrailmedium-smoke" + elseif weaponDef.cegTag == "missiletrailmedium-red" then + missileWeapons[weaponDef.id] = "missiletrailmedium-smoke" + elseif weaponDef.cegTag == "missiletraillarge" then + missileWeapons[weaponDef.id] = "missiletraillarge-smoke" + elseif weaponDef.cegTag == "missiletraillarge-red" then + missileWeapons[weaponDef.id] = "missiletraillarge-smoke" + elseif weaponDef.cegTag == "missiletrailtiny" then + missileWeapons[weaponDef.id] = "missiletrailtiny-smoke" + elseif weaponDef.cegTag == "missiletrailaa" then + missileWeapons[weaponDef.id] = "missiletrailaa-smoke" + --elseif weaponDef.cegTag == 'missiletrailfighter' then + -- missileWeapons[weaponDef.id] = 'missiletrailfighter-smoke' + end + end end ----------------------------------------------------------------------------------------- @@ -80,55 +79,97 @@ local starbursts = {} local starburstWeapons = {} -- {wDID = {startHeight, cegName, nofueltime, maxtime, }} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'StarburstLauncher' then - if weaponDef.cegTag == 'missiletrailsmall-starburst' then + if weaponDef.type == "StarburstLauncher" then + if weaponDef.cegTag == "missiletrailsmall-starburst" then starburstWeapons[weaponDef.id] = { 0, - 'missiletrailsmall-starburst-vertical', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundsmall-liftoff', 60, 90, - 'missilegroundsmall-liftoff-fire', 25, 45 + "missiletrailsmall-starburst-vertical", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundsmall-liftoff", + 60, + 90, + "missilegroundsmall-liftoff-fire", + 25, + 45, } - elseif weaponDef.cegTag == 'missiletrailmedium-starburst' then + elseif weaponDef.cegTag == "missiletrailmedium-starburst" then starburstWeapons[weaponDef.id] = { 0, - 'missiletrailmedium-starburst-vertical', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundmedium-liftoff', 40, 60, - 'missilegroundmedium-liftoff-fire', 30, 40 + "missiletrailmedium-starburst-vertical", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundmedium-liftoff", + 40, + 60, + "missilegroundmedium-liftoff-fire", + 30, + 40, } - elseif weaponDef.cegTag == 'missiletrail-juno' then + elseif weaponDef.cegTag == "missiletrail-juno" then starburstWeapons[weaponDef.id] = { 0, - 'missiletrail-juno-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 80, 120, - 'missilegroundlarge-liftoff-fire', 40, 80 + "missiletrail-juno-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 80, + 120, + "missilegroundlarge-liftoff-fire", + 40, + 80, } - elseif weaponDef.cegTag == 'antimissiletrail' then + elseif weaponDef.cegTag == "antimissiletrail" then starburstWeapons[weaponDef.id] = { 0, - 'antimissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 80, 120, - 'missilegroundlarge-liftoff-fire', 40, 80 + "antimissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 80, + 120, + "missilegroundlarge-liftoff-fire", + 40, + 80, } - elseif weaponDef.cegTag == 'cruisemissiletrail-emp' then + elseif weaponDef.cegTag == "cruisemissiletrail-emp" then starburstWeapons[weaponDef.id] = { 0, - 'cruisemissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 90, 166, - 'missilegroundlarge-liftoff-fire', 55, 120 + "cruisemissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 90, + 166, + "missilegroundlarge-liftoff-fire", + 55, + 120, } - elseif weaponDef.cegTag == 'cruisemissiletrail-tacnuke' then + elseif weaponDef.cegTag == "cruisemissiletrail-tacnuke" then starburstWeapons[weaponDef.id] = { 15, - 'cruisemissiletrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundlarge-liftoff', 90, 166, - 'missilegroundlarge-liftoff-fire', 55, 120 + "cruisemissiletrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundlarge-liftoff", + 90, + 166, + "missilegroundlarge-liftoff-fire", + 55, + 120, } - elseif weaponDef.cegTag == 'NUKETRAIL' then + elseif weaponDef.cegTag == "NUKETRAIL" then starburstWeapons[weaponDef.id] = { 0, - 'nuketrail-starburst', ((weaponDef.uptime + 0.1) * 30), ((weaponDef.uptime + 0.6) * 30), - 'missilegroundhuge-liftoff', 120, 180, - 'missilegroundhuge-liftoff-fire', 60, 150 + "nuketrail-starburst", + ((weaponDef.uptime + 0.1) * 30), + ((weaponDef.uptime + 0.6) * 30), + "missilegroundhuge-liftoff", + 120, + 180, + "missilegroundhuge-liftoff-fire", + 60, + 150, } end end @@ -147,50 +188,49 @@ function gadget:Initialize() end if mapHasWater then for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'TorpedoLauncher' then - if weaponDef.visuals.modelName == 'objects3d/torpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/cordepthcharge.s3o' - or weaponDef.visuals.modelName == 'objects3d/torpedo.3do' or weaponDef.visuals.modelName == 'objects3d/depthcharge.3do' then - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-torpedo' or 'splash-torpedo' - elseif weaponDef.visuals.modelName == 'objects3d/coradvtorpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/Advtorpedo.3do' then - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-tiny' or 'splash-tiny' + if weaponDef.type == "TorpedoLauncher" then + if weaponDef.visuals.modelName == "objects3d/torpedo.s3o" or weaponDef.visuals.modelName == "objects3d/cordepthcharge.s3o" or weaponDef.visuals.modelName == "objects3d/torpedo.3do" or weaponDef.visuals.modelName == "objects3d/depthcharge.3do" then + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-torpedo" or "splash-torpedo" + elseif weaponDef.visuals.modelName == "objects3d/coradvtorpedo.s3o" or weaponDef.visuals.modelName == "objects3d/Advtorpedo.3do" then + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-tiny" or "splash-tiny" else - depthChargeWeapons[weaponID] = waterIsLava and 'lavasplash-torpedo' or 'splash-torpedo' + depthChargeWeapons[weaponID] = waterIsLava and "lavasplash-torpedo" or "splash-torpedo" end end end - for wDID,_ in pairs(depthChargeWeapons) do + for wDID, _ in pairs(depthChargeWeapons) do Script.SetWatchProjectile(wDID, true) allWatchedWeaponDefIDs[wDID] = "depthCharge" end end - - for wDID,_ in pairs(missileWeapons) do - Script.SetWatchProjectile(wDID, true) + for wDID, _ in pairs(missileWeapons) do + Script.SetWatchProjectile(wDID, true) allWatchedWeaponDefIDs[wDID] = "missile" --Spring.Echo("Watching for missile",WeaponDefs[wDID].name, wDID) - end + end for wDID, _ in pairs(starburstWeapons) do Script.SetWatchProjectile(wDID, true) allWatchedWeaponDefIDs[wDID] = "starburst" end - end function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) --pre-opt mean 3.7 us --Spring.Echo("gadget:ProjectileCreated",proID, proOwnerID, weaponDefID) local watchedWeaponType = allWatchedWeaponDefIDs[weaponDefID] - if watchedWeaponType == nil then return end + if watchedWeaponType == nil then + return + end allWatchedProjectileIDs[proID] = watchedWeaponType if mapHasWater and watchedWeaponType == "depthCharge" then - local _,y,_ = GetProjectilePosition(proID) - if y > 0 then - depthCharges[proID] = depthChargeWeapons[weaponDefID] - end + local _, y, _ = GetProjectilePosition(proID) + if y > 0 then + depthCharges[proID] = depthChargeWeapons[weaponDefID] + end elseif watchedWeaponType == "missile" then - missileIDtoProjType[proID] = missileWeapons[weaponDefID] - missileIDtoLifeEnd[proID] = gameFrame-4 + GetProjectileTimeToLive(proID) + missileIDtoProjType[proID] = missileWeapons[weaponDefID] + missileIDtoLifeEnd[proID] = gameFrame - 4 + GetProjectileTimeToLive(proID) elseif watchedWeaponType == "starburst" then local x, y, z = GetProjectilePosition(proID) local groundHeight = mathMax(GetGroundHeight(x, z), 0) @@ -228,23 +268,26 @@ function gadget:ProjectileDestroyed(proID) --pre-opt mean 14 us end end - function gadget:GameFrame(gf) gameFrame = gf if mapHasWater then local removeDepth local removeDepthCount = 0 for proID, CEG in pairs(depthCharges) do - local x,y,z = GetProjectilePosition(proID) + local x, y, z = GetProjectilePosition(proID) if y then if y < 0 then - SpawnCEG(CEG,x,0,z) - if not removeDepth then removeDepth = {} end + SpawnCEG(CEG, x, 0, z) + if not removeDepth then + removeDepth = {} + end removeDepthCount = removeDepthCount + 1 removeDepth[removeDepthCount] = proID end else - if not removeDepth then removeDepth = {} end + if not removeDepth then + removeDepth = {} + end removeDepthCount = removeDepthCount + 1 removeDepth[removeDepthCount] = proID end @@ -259,18 +302,20 @@ function gadget:GameFrame(gf) local removeMissile local removeMissileCount = 0 for proID, missile in pairs(missileIDtoProjType) do - if gf > missileIDtoLifeEnd[proID] then - local x,y,z = GetProjectilePosition(proID) - if y and y > 0 then - local dirX,dirY,dirZ = GetProjectileDirection(proID) - SpawnCEG(missile,x,y,z,dirX,dirY,dirZ) - else - if not removeMissile then removeMissile = {} end + if gf > missileIDtoLifeEnd[proID] then + local x, y, z = GetProjectilePosition(proID) + if y and y > 0 then + local dirX, dirY, dirZ = GetProjectileDirection(proID) + SpawnCEG(missile, x, y, z, dirX, dirY, dirZ) + else + if not removeMissile then + removeMissile = {} + end removeMissileCount = removeMissileCount + 1 removeMissile[removeMissileCount] = proID - end - end - end + end + end + end for i = 1, removeMissileCount do local proID = removeMissile[i] missileIDtoProjType[proID] = nil @@ -298,12 +343,16 @@ function gadget:GameFrame(gf) end end else - if not removeStarburst then removeStarburst = {} end + if not removeStarburst then + removeStarburst = {} + end removeStarburstCount = removeStarburstCount + 1 removeStarburst[removeStarburstCount] = proID end else - if not removeStarburst then removeStarburst = {} end + if not removeStarburst then + removeStarburst = {} + end removeStarburstCount = removeStarburstCount + 1 removeStarburst[removeStarburstCount] = proID end @@ -314,5 +363,3 @@ function gadget:GameFrame(gf) allWatchedProjectileIDs[proID] = nil end end - - diff --git a/luarules/gadgets/fx_reclaim_shards.lua b/luarules/gadgets/fx_reclaim_shards.lua index 69ee673eef9..48d7cdc0bab 100644 --- a/luarules/gadgets/fx_reclaim_shards.lua +++ b/luarules/gadgets/fx_reclaim_shards.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "13 Feb 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -50,7 +50,7 @@ for featureDefID, featureDef in pairs(FeatureDefs) do maxZ = maxZ, y = math.floor(featureDef.model.maxy * 0.66), rangeX = maxX - minX, -- Pre-calculate range to avoid subtraction in hot path - rangeZ = maxZ - minZ + rangeZ = maxZ - minZ, } end end diff --git a/luarules/gadgets/fx_submissile_splash.lua b/luarules/gadgets/fx_submissile_splash.lua index a499b61aa28..6f84a7b82ad 100644 --- a/luarules/gadgets/fx_submissile_splash.lua +++ b/luarules/gadgets/fx_submissile_splash.lua @@ -1,20 +1,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "subMissile splash", - desc = "Makes splashes for missiles that emerge from the water", - version = "cake", - author = "Bluestone", - date = "July 2014", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, - } + return { + name = "subMissile splash", + desc = "Makes splashes for missiles that emerge from the water", + version = "cake", + author = "Bluestone", + date = "July 2014", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local GetProjectilePosition = Spring.GetProjectilePosition @@ -26,34 +26,33 @@ local splashCEG = "torpedo-launch" local subMissileWeapons = {} for weaponID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'TorpedoLauncher' then - --if weaponDef.visuals.modelName == 'objects3d/minitorpedo.3do' then - -- subMissileWeapons[weaponDef.id] = 'torpedotrail-tiny' - if weaponDef.visuals.modelName == 'objects3d/torpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/torpedo.3do' then - subMissileWeapons[weaponDef.id] = 'torpedotrail-small' - elseif weaponDef.visuals.modelName == 'objects3d/coradvtorpedo.s3o' or weaponDef.visuals.modelName == 'objects3d/Advtorpedo.3do' then - subMissileWeapons[weaponDef.id] = 'torpedotrail-large' - else - subMissileWeapons[weaponDef.id] = 'torpedotrail-small' - end - end + if weaponDef.type == "TorpedoLauncher" then + --if weaponDef.visuals.modelName == 'objects3d/minitorpedo.3do' then + -- subMissileWeapons[weaponDef.id] = 'torpedotrail-tiny' + if weaponDef.visuals.modelName == "objects3d/torpedo.s3o" or weaponDef.visuals.modelName == "objects3d/torpedo.3do" then + subMissileWeapons[weaponDef.id] = "torpedotrail-small" + elseif weaponDef.visuals.modelName == "objects3d/coradvtorpedo.s3o" or weaponDef.visuals.modelName == "objects3d/Advtorpedo.3do" then + subMissileWeapons[weaponDef.id] = "torpedotrail-large" + else + subMissileWeapons[weaponDef.id] = "torpedotrail-small" + end + end end - function gadget:Initialize() - for wDID,_ in pairs(subMissileWeapons) do - Script.SetWatchProjectile(wDID, true) - end + for wDID, _ in pairs(subMissileWeapons) do + Script.SetWatchProjectile(wDID, true) + end end local missiles = {} --subMissiles that are below the surface still function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) - if subMissileWeapons[weaponDefID] then - missiles[proID] = subMissileWeapons[weaponDefID] - local x,_,z = GetProjectilePosition(proID) - Spring.SpawnCEG(splashCEG,x,0,z) - end + if subMissileWeapons[weaponDefID] then + missiles[proID] = subMissileWeapons[weaponDefID] + local x, _, z = GetProjectilePosition(proID) + Spring.SpawnCEG(splashCEG, x, 0, z) + end end function gadget:ProjectileDestroyed(proID) @@ -61,22 +60,24 @@ function gadget:ProjectileDestroyed(proID) end function gadget:GameFrame(n) - local removeList - local removeCount = 0 - for proID, CEG in pairs(missiles) do - local x,y,z = GetProjectilePosition(proID) - if y then - if y < 0 and random() < 0.95 then - local dirX,dirY,dirZ = GetProjectileDirection(proID) - Spring.SpawnCEG(CEG,x,y,z,dirX,dirY,dirZ) - end - else - removeCount = removeCount + 1 - if not removeList then removeList = {} end - removeList[removeCount] = proID - end - end - for i = 1, removeCount do - missiles[removeList[i]] = nil - end + local removeList + local removeCount = 0 + for proID, CEG in pairs(missiles) do + local x, y, z = GetProjectilePosition(proID) + if y then + if y < 0 and random() < 0.95 then + local dirX, dirY, dirZ = GetProjectileDirection(proID) + Spring.SpawnCEG(CEG, x, y, z, dirX, dirY, dirZ) + end + else + removeCount = removeCount + 1 + if not removeList then + removeList = {} + end + removeList[removeCount] = proID + end + end + for i = 1, removeCount do + missiles[removeList[i]] = nil + end end diff --git a/luarules/gadgets/fx_watersplash.lua b/luarules/gadgets/fx_watersplash.lua index 6f9fa703e48..95c07e2aeb5 100644 --- a/luarules/gadgets/fx_watersplash.lua +++ b/luarules/gadgets/fx_watersplash.lua @@ -1,21 +1,20 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Watereffects", - desc = "Make splash sound in water", - version = "1.1", - author = "Jools ,Nixtux", - date = "April,2012", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Watereffects", + desc = "Make splash sound in water", + version = "1.1", + author = "Jools ,Nixtux", + date = "April,2012", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local abs = math.abs @@ -50,12 +49,12 @@ end local function getWeaponAOE(weaponDef, waterSplash) local aoe = weaponDef.damageAreaOfEffect -- add damage bonus, since LRPC dont have a lot of AoE, but do pack a punch - if weaponDef.type == 'DGun' then + if weaponDef.type == "DGun" then aoe = aoe + 80 else if weaponDef.damages and waterSplash ~= 0 then local maxDmg = 0 - for _,v in pairs(weaponDef.damages) do + for _, v in pairs(weaponDef.damages) do if v > maxDmg then maxDmg = v end @@ -63,7 +62,7 @@ local function getWeaponAOE(weaponDef, waterSplash) if weaponDef.paralyzer then maxDmg = maxDmg / 25 end - aoe = (aoe + (maxDmg/20)) + aoe = (aoe + (maxDmg / 20)) end end return aoe / 2 @@ -97,7 +96,6 @@ local weaponNoSplash = {} local weaponAoe = {} local weaponSplashCEG = {} for weaponDefID, def in pairs(WeaponDefs) do - local waterSplash = def.customParams.water_splash and tonumber(def.customParams.water_splash) waterSplash = waterSplash or (nonexplosiveWeapons[def.type] and 0 or 1) @@ -122,7 +120,7 @@ for weaponDefID, def in pairs(WeaponDefs) do end function gadget:Explosion(weaponID, px, py, pz, ownerID) - if Spring.GetGroundHeight(px,pz) < 0 then + if Spring.GetGroundHeight(px, pz) < 0 then local aoe = weaponAoe[weaponID] if not weaponNoSplash[weaponID] and abs(py) <= aoe and (not GetGroundBlocked(px, pz)) then local splashCEG = weaponSplashCEG[weaponID] @@ -142,7 +140,7 @@ function gadget:Initialize() local minHeight, maxHeight = Spring.GetGroundExtremes() if minHeight < 100 then for wDefID, wDef in pairs(WeaponDefs) do - if wDef.damageAreaOfEffect ~= nil and wDef.damageAreaOfEffect > 8 and (not weaponNoSplash[wDefID]) then + if wDef.damageAreaOfEffect ~= nil and wDef.damageAreaOfEffect > 8 and not weaponNoSplash[wDefID] then Script.SetWatchExplosion(wDef.id, true) end end diff --git a/luarules/gadgets/gaia_critters.lua b/luarules/gadgets/gaia_critters.lua index 416aa4f85ce..fdd4e3f7f32 100644 --- a/luarules/gadgets/gaia_critters.lua +++ b/luarules/gadgets/gaia_critters.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "gaia critter units", - desc = "units spawn and wander around the map", - author = "Floris (original: knorke, 2013)", - date = "2016", - license = "GNU GPL, v2 or later", - layer = -100, --negative, otherwise critters spawned by gadget do not disappear on death (spawned with /give they always die) - enabled = true, + name = "gaia critter units", + desc = "units spawn and wander around the map", + author = "Floris (original: knorke, 2013)", + date = "2016", + license = "GNU GPL, v2 or later", + layer = -100, --negative, otherwise critters spawned by gadget do not disappear on death (spawned with /give they always die) + enabled = true, } end @@ -32,14 +32,14 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end -local removeCritters = true -- gradually remove critters when unitcont gets higher -local addCrittersAgain = true -- re-add the removed critters again +local removeCritters = true -- gradually remove critters when unitcont gets higher +local addCrittersAgain = true -- re-add the removed critters again -local minTotalUnits = 3000 -- starting removing critters at this total unit count -local maxTotalunits = 6000 -- finished removing critters at this total unit count -local minimumCritters = 0.2 -- dont remove further than (0.1 == 10%) of critters -local minCritters -- dont remove below this amount -local companionRadiusStart = 140 -- if mapcritter is spawned this close it will be converted to companion critter +local minTotalUnits = 3000 -- starting removing critters at this total unit count +local maxTotalunits = 6000 -- finished removing critters at this total unit count +local minimumCritters = 0.2 -- dont remove further than (0.1 == 10%) of critters +local minCritters -- dont remove below this amount +local companionRadiusStart = 140 -- if mapcritter is spawned this close it will be converted to companion critter local companionRadiusAfterStart = 13 local companionPatrolRadius = 200 @@ -47,10 +47,10 @@ local amountMultiplier = Spring.GetModOptions().critters local minMulti = 0.2 local maxMulti = 5 -local GaiaTeamID = Spring.GetGaiaTeamID() +local GaiaTeamID = Spring.GetGaiaTeamID() local critterConfig = include("LuaRules/configs/critters.lua") -local critterUnits = {} --critter units that are currently alive +local critterUnits = {} --critter units that are currently alive local critterBackup = {} --critter units to restore local companionCritters = {} local sceduledOrders = {} @@ -73,7 +73,7 @@ local CMD_PATROL = CMD.PATROL local CMD_FIRE_STATE = CMD.FIRE_STATE local CMD_ATTACK = CMD.ATTACK -minCritters = ceil((Game.mapSizeX*Game.mapSizeZ)/6000000) +minCritters = ceil((Game.mapSizeX * Game.mapSizeZ) / 6000000) local totalCritters = 0 local aliveCritters = 0 @@ -83,29 +83,37 @@ local addedInitialCritters local ownCritterDestroy = false -local function randomPatrolInBox(unitID, box, minWaterDepth) -- only define minWaterDepth if unit is a submarine - local ux,_,uz = GetUnitPosition(unitID,true,true) +local function randomPatrolInBox(unitID, box, minWaterDepth) -- only define minWaterDepth if unit is a submarine + local ux, _, uz = GetUnitPosition(unitID, true, true) local orders = 6 local attempts = orders local ordersGiven = 0 - local x,z + local x, z local modifiers = {} local box_x1, box_x2, box_z1, box_z2 = box.x1, box.x2, box.z1, box.z2 if minWaterDepth ~= nil then attempts = 150 - local waterRadius = 1000 -- max distance a submarine unit will travel + local waterRadius = 1000 -- max distance a submarine unit will travel local x1 = ux - waterRadius - if x1 < box_x1 then x1 = box_x1 end + if x1 < box_x1 then + x1 = box_x1 + end local x2 = ux + waterRadius - if x2 > box_x2 then x2 = box_x2 end + if x2 > box_x2 then + x2 = box_x2 + end local z1 = uz - waterRadius - if z1 < box_z1 then z1 = box_z1 end + if z1 < box_z1 then + z1 = box_z1 + end local z2 = uz + waterRadius - if z2 > box_z2 then z2 = box_z2 end + if z2 > box_z2 then + z2 = box_z2 + end box_x1, box_x2, box_z1, box_z2 = x1, x2, z1, z2 end - for i=1,attempts do + for i = 1, attempts do x = random(box_x1, box_x2) z = random(box_z1, box_z2) if x > 0 and z > 0 and x < mapSizeX and z < mapSizeZ then @@ -115,13 +123,15 @@ local function randomPatrolInBox(unitID, box, minWaterDepth) -- only define minW sceduledOrders[unitID] = {} end processOrders = true - sceduledOrders[unitID][#sceduledOrders[unitID]+1] = {unitID=unitID, type=CMD_PATROL, location={x, y, z}, modifiers=modifiers} + sceduledOrders[unitID][#sceduledOrders[unitID] + 1] = { unitID = unitID, type = CMD_PATROL, location = { x, y, z }, modifiers = modifiers } --table.insert(sceduledOrders[unitID], {unitID=unitID, type=CMD_PATROL, location={x, y, z}, modifiers=modifiers}) - modifiers = {"shift"} + modifiers = { "shift" } ordersGiven = ordersGiven + 1 end end - if ordersGiven == orders then break end + if ordersGiven == orders then + break + end end end @@ -138,7 +148,9 @@ local function processSceduledOrders() local removeUnitsCount = 0 for unitID, UnitOrders in pairs(sceduledOrders) do if not ValidUnitID(unitID) then - if not removeUnits then removeUnits = {} end + if not removeUnits then + removeUnits = {} + end removeUnitsCount = removeUnitsCount + 1 removeUnits[removeUnitsCount] = unitID else @@ -154,7 +166,9 @@ local function processSceduledOrders() if removeOrder then sceduledOrders[unitID][removeOrder] = nil elseif orders == 0 then - if not removeUnits then removeUnits = {} end + if not removeUnits then + removeUnits = {} + end removeUnitsCount = removeUnitsCount + 1 removeUnits[removeUnitsCount] = unitID end @@ -165,37 +179,39 @@ local function processSceduledOrders() end end -local function randomPatrolInCircle(unitID, ux, uz, ur, minWaterDepth) -- only define minWaterDepth if unit is a submarine +local function randomPatrolInCircle(unitID, ux, uz, ur, minWaterDepth) -- only define minWaterDepth if unit is a submarine local orders = 6 local attempts = orders local ordersGiven = 0 local modifiers = {} if minWaterDepth ~= nil then - local waterRadius = 1000 -- max distance a submarine unit will travel + local waterRadius = 1000 -- max distance a submarine unit will travel attempts = 150 if waterRadius <= ur then ux, _, uz = GetUnitPosition(unitID, true, true) ur = waterRadius end end - for i=1,attempts do + for i = 1, attempts do local a = rad(random(0, 360)) local r = random(0, ur) - local x = ux + r*sin(a) - local z = uz + r*cos(a) + local x = ux + r * sin(a) + local z = uz + r * cos(a) if x > 0 and z > 0 and x < mapSizeX and z < mapSizeZ then local y = GetGroundHeight(x, z) if minWaterDepth == nil or y < minWaterDepth then if sceduledOrders[unitID] == nil then sceduledOrders[unitID] = {} end - sceduledOrders[unitID][#sceduledOrders[unitID]+1] = {unitID=unitID, type=CMD_PATROL, location={x, y, z}, modifiers=modifiers} - modifiers = {"shift"} + sceduledOrders[unitID][#sceduledOrders[unitID] + 1] = { unitID = unitID, type = CMD_PATROL, location = { x, y, z }, modifiers = modifiers } + modifiers = { "shift" } processOrders = true ordersGiven = ordersGiven + 1 end end - if ordersGiven == orders then break end + if ordersGiven == orders then + break + end end end @@ -206,12 +222,12 @@ local function setGaiaUnitSpecifics(unitID) Spring.SetUnitNoMinimap(unitID, true) Spring.SetUnitMaxHealth(unitID, 2) Spring.SetUnitBlocking(unitID, false) - Spring.SetUnitSensorRadius(unitID, 'los', 0) - Spring.SetUnitSensorRadius(unitID, 'airLos', 0) - Spring.SetUnitSensorRadius(unitID, 'radar', 0) - Spring.SetUnitSensorRadius(unitID, 'sonar', 0) + Spring.SetUnitSensorRadius(unitID, "los", 0) + Spring.SetUnitSensorRadius(unitID, "airLos", 0) + Spring.SetUnitSensorRadius(unitID, "radar", 0) + Spring.SetUnitSensorRadius(unitID, "sonar", 0) for weaponID, _ in pairs(UnitDefs[GetUnitDefID(unitID)].weapons) do - GiveOrderToUnit(unitID, CMD_FIRE_STATE, {0}, 0) + GiveOrderToUnit(unitID, CMD_FIRE_STATE, { 0 }, 0) --Spring.UnitWeaponHoldFire(unitID, weaponID) -- doesnt seem to work :S (maybe because they still patrol) end end @@ -223,7 +239,6 @@ local function makeUnitCritter(unitID) aliveCritters = aliveCritters + 1 end - local mapConfig function gadget:Initialize() @@ -232,8 +247,8 @@ function gadget:Initialize() for _, unitID in pairs(allUnits) do local unitDefID = GetUnitDefID(unitID) if unitDefID and isCommander[unitDefID] then - local x,_,z = GetUnitPosition(unitID) - commanders[unitID] = {x,z} + local x, _, z = GetUnitPosition(unitID) + commanders[unitID] = { x, z } end end @@ -256,8 +271,12 @@ function gadget:Initialize() --gadgetHandler:RemoveGadget(self) -- disabled so if you /give critters they still will be auto patrolled end - if amountMultiplier < minMulti then amountMultiplier = minMulti end - if amountMultiplier > maxMulti then amountMultiplier = maxMulti end + if amountMultiplier < minMulti then + amountMultiplier = minMulti + end + if amountMultiplier > maxMulti then + amountMultiplier = maxMulti + end end local unitDefNameToID = {} @@ -283,7 +302,9 @@ local function getTotalUnits() end local function adjustCritters(newAliveCritters) - if newAliveCritters == aliveCritters then return end + if newAliveCritters == aliveCritters then + return + end local critterDifference = newAliveCritters - aliveCritters local add = false @@ -291,13 +312,15 @@ local function adjustCritters(newAliveCritters) if critterDifference > 0 then add = true critterArrayFrom = critterBackup - if not addCrittersAgain then return end + if not addCrittersAgain then + return + end end local changed = false for unitID, critter in pairs(critterArrayFrom) do if add then - if critter.x ~= nil and critter.y ~= nil and critter.z ~= nil then -- had nil error once so yeah... + if critter.x ~= nil and critter.y ~= nil and critter.z ~= nil then -- had nil error once so yeah... CreateUnit(critter.unitName, critter.x, critter.y, critter.z, 0, GaiaTeamID) critterDifference = critterDifference - 1 critterArrayFrom[unitID] = nil @@ -305,7 +328,7 @@ local function adjustCritters(newAliveCritters) changed = true end else - local x,y,z = GetUnitPosition(unitID,true,true) + local x, y, z = GetUnitPosition(unitID, true, true) critterDifference = critterDifference + 1 critterBackup[unitID] = critter @@ -313,13 +336,17 @@ local function adjustCritters(newAliveCritters) critterBackup[unitID].y = y critterBackup[unitID].z = z - Spring.DestroyUnit(unitID, false, true) -- reclaimed + Spring.DestroyUnit(unitID, false, true) -- reclaimed totalCritters = totalCritters + 1 -- DestroyUnit callin substracts 1 here but we want to keep it constant, so re-adding changed = true - if aliveCritters <= minCritters then break end + if aliveCritters <= minCritters then + break + end + end + if critterDifference > -1 and critterDifference < 1 then + break end - if critterDifference > -1 and critterDifference < 1 then break end end if changed then --if totalCritters > 800 then -- occasional cleanup (leaving this in will make ´critterDifference´ useless) @@ -340,8 +367,8 @@ end local function nearUnits(x, z, radius, units) for unitID, pos in pairs(units) do - if pos[1] and pos[2] then -- had nil error once so yeah... - if abs(x-pos[1]) < radius and abs(z-pos[2]) < radius then + if pos[1] and pos[2] then -- had nil error once so yeah... + if abs(x - pos[1]) < radius and abs(z - pos[2]) < radius then return unitID end end @@ -349,9 +376,9 @@ local function nearUnits(x, z, radius, units) return false end -local function pairCompanionToUnit(companionID,unitID) +local function pairCompanionToUnit(companionID, unitID) local companions = companionCritters[unitID] or {} - companions[#companions+1] = companionID + companions[#companions + 1] = companionID companionCritters[unitID] = companions if critterUnits[unitID] ~= nil then critterUnits[unitID] = nil @@ -360,11 +387,11 @@ local function pairCompanionToUnit(companionID,unitID) end local function critterToCompanion(unitID) - local x,y,z = GetUnitPosition(unitID) - if x ~= nil and y ~= nil and z ~= nil then -- had nil error once so yeah... + local x, y, z = GetUnitPosition(unitID) + if x ~= nil and y ~= nil and z ~= nil then -- had nil error once so yeah... local commanderID = nearUnits(x, z, companionRadius, commanders) if commanderID ~= false then - pairCompanionToUnit(unitID,commanderID) + pairCompanionToUnit(unitID, commanderID) end end end @@ -392,14 +419,18 @@ local function addMapCritters() end local minWaterDepth = 0 - UnitDefs[unitDefID].minWaterDepth local waterunit = false - if minWaterDepth < 0 then waterunit = true end + if minWaterDepth < 0 then + waterunit = true + end -- to make sure at least 1 critter is placed (to prevent when the multiplier is small, that a small critter-amount always gets diminished to zero) local amount = unitAmount * amountMultiplier - if amount > 0 and amount < 1 then amount = 1 end + if amount > 0 and amount < 1 then + amount = 1 + end amount = round(amount) - for i=1, amount do + for i = 1, amount do local unitID = nil local x = random(cC.spawnBox.x1, cC.spawnBox.x2) local z = random(cC.spawnBox.z1, cC.spawnBox.z2) @@ -429,19 +460,23 @@ local function addMapCritters() end local minWaterDepth = 0 - UnitDefs[unitDefID].minWaterDepth local waterunit = false - if minWaterDepth < 0 then waterunit = true end + if minWaterDepth < 0 then + waterunit = true + end -- to make sure at least 1 critter is placed (to prevent when the multiplier is small, that a small critter-amount always gets diminished to zero) local amount = unitAmount * amountMultiplier - if amount > 0 and amount < 1 then amount = 1 end + if amount > 0 and amount < 1 then + amount = 1 + end amount = round(amount) local unitID = nil - for i=1, amount do + for i = 1, amount do local a = rad(random(0, 360)) local r = random(0, spawnCircle.r) - local x = spawnCircle.x + r*sin(a) - local z = spawnCircle.z + r*cos(a) + local x = spawnCircle.x + r * sin(a) + local z = spawnCircle.z + r * cos(a) local y = GetGroundHeight(x, z) if not waterunit or cC.nowatercheck ~= nil or y < minWaterDepth then local supplyMinWaterDepth = nil @@ -465,24 +500,25 @@ local function addMapCritters() companionRadius = companionRadiusAfterStart end - -- increase/decrease critters according to unitcount function gadget:GameFrame(gameFrame) - if gameFrame == 1 and addedInitialCritters == nil then -- using gameframe 1 cause at GameStart commanders arent spawn yet + if gameFrame == 1 and addedInitialCritters == nil then -- using gameframe 1 cause at GameStart commanders arent spawn yet addedInitialCritters = true addMapCritters() end -- update companion critters if totalCritters > 0 then - if gameFrame%77==1 then + if gameFrame % 77 == 1 then local removeOwners local removeOwnersCount = 0 for unitID, critters in pairs(companionCritters) do - local x,y,z = GetUnitPosition(unitID) + local x, y, z = GetUnitPosition(unitID) local radius = companionPatrolRadius if not ValidUnitID(unitID) then - if not removeOwners then removeOwners = {} end + if not removeOwners then + removeOwners = {} + end removeOwnersCount = removeOwnersCount + 1 removeOwners[removeOwnersCount] = unitID else @@ -490,12 +526,14 @@ function gadget:GameFrame(gameFrame) local removeCritterCount = 0 for _, critterID in pairs(critters) do if not ValidUnitID(critterID) then - if not removeCritterIDs then removeCritterIDs = {} end + if not removeCritterIDs then + removeCritterIDs = {} + end removeCritterCount = removeCritterCount + 1 removeCritterIDs[removeCritterCount] = critterID else - local cx,cy,cz = GetUnitPosition(critterID) - if abs(x-cx) > radius*1.1 or abs(z-cz) > radius*1.1 then + local cx, cy, cz = GetUnitPosition(critterID) + if abs(x - cx) > radius * 1.1 or abs(z - cz) > radius * 1.1 then randomPatrolInCircle(critterID, x, z, radius) end end @@ -513,17 +551,23 @@ function gadget:GameFrame(gameFrame) end end - if removeCritters == false then return end + if removeCritters == false then + return + end if processOrders then processSceduledOrders() end - if gameFrame%202==0 then + if gameFrame % 202 == 0 then local totalUnits = getTotalUnits() -- is without critters - local multiplier = 1 - ((totalUnits-minTotalUnits) / (maxTotalunits-minTotalUnits)) - if multiplier < minimumCritters then multiplier = minimumCritters end - if multiplier > 1 then multiplier = 1 end + local multiplier = 1 - ((totalUnits - minTotalUnits) / (maxTotalunits - minTotalUnits)) + if multiplier < minimumCritters then + multiplier = minimumCritters + end + if multiplier > 1 then + multiplier = 1 + end local newAliveCritters = ceil(totalCritters * multiplier) if newAliveCritters < minCritters then local mc = minCritters @@ -538,13 +582,13 @@ function gadget:GameFrame(gameFrame) end function round(num, idp) - local mult = 10^(idp or 0) - return floor(num * mult + 0.5) / mult + local mult = 10 ^ (idp or 0) + return floor(num * mult + 0.5) / mult end function gadget:UnitIdle(unitID, unitDefID, unitTeam) if isCritter[unitDefID] and not sceduledOrders[unitID] then - local x,y,z = GetUnitPosition(unitID,true,true) + local x, y, z = GetUnitPosition(unitID, true, true) local radius = 220 if isFlyingCritter[unitDefID] then radius = 750 @@ -569,10 +613,10 @@ end function gadget:UnitCreated(unitID, unitDefID, unitTeam) if isCommander[unitDefID] then - local x,_,z = GetUnitPosition(unitID,true,true) - commanders[unitID] = {x,z} + local x, _, z = GetUnitPosition(unitID, true, true) + commanders[unitID] = { x, z } elseif isCritter[unitDefID] then - local x,_,z = GetUnitPosition(unitID,true,true) + local x, _, z = GetUnitPosition(unitID, true, true) local radius = 300 if isFlyingCritter[unitDefID] then radius = 1500 @@ -583,19 +627,19 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) companionRadius = companionRadiusStart if unitTeam == GaiaTeamID then --if critterUnits[unitID] == nil then - makeUnitCritter(unitID) - critterUnits[unitID].unitName = UnitDefs[unitDefID].name - --end + makeUnitCritter(unitID) + critterUnits[unitID].unitName = UnitDefs[unitDefID].name + --end critterToCompanion(unitID) else local commanderID = getTeamCommanderUnitID(unitTeam) if commanderID then - local cx,cy,cz = GetUnitPosition(commanderID,true,true) + local cx, cy, cz = GetUnitPosition(commanderID, true, true) local comlist = {} - comlist[commanderID] = {cx,cz} + comlist[commanderID] = { cx, cz } commanderID = nearUnits(x, z, companionRadius, comlist) if commanderID ~= false then - pairCompanionToUnit(unitID,commanderID) + pairCompanionToUnit(unitID, commanderID) end end end diff --git a/luarules/gadgets/game_allyteam_ranking.lua b/luarules/gadgets/game_allyteam_ranking.lua index 9b39d6b4181..51459d45e1e 100644 --- a/luarules/gadgets/game_allyteam_ranking.lua +++ b/luarules/gadgets/game_allyteam_ranking.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "AllyTeam ranking", - desc = "broadcast the allyteam ranking order by total unit value, can be used to order playerlist", - author = "Floris", - date = "February 2025", - license = "GNU GPL, v2 or later", - layer = 0, + name = "AllyTeam ranking", + desc = "broadcast the allyteam ranking order by total unit value, can be used to order playerlist", + author = "Floris", + date = "February 2025", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end @@ -41,7 +41,9 @@ local spGetTeamList = Spring.GetTeamList local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local mathFloor = math.floor local tableSort = table.sort -local rankSortFunc = function(m1, m2) return m1.totalCost > m2.totalCost end +local rankSortFunc = function(m1, m2) + return m1.totalCost > m2.totalCost +end local unitCost = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -50,7 +52,9 @@ end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) local allyTeamID = teamAllyteam[unitTeam] - if not allyTeamID then return end + if not allyTeamID then + return + end if spGetUnitIsBeingBuilt(unitID) then unfinishedUnits[allyTeamID][unitID] = unitDefID else @@ -60,7 +64,9 @@ end function gadget:UnitFinished(unitID, unitDefID, unitTeam) local allyTeamID = teamAllyteam[unitTeam] - if not allyTeamID then return end + if not allyTeamID then + return + end if unfinishedUnits[allyTeamID][unitID] then allyteamCost[allyTeamID] = allyteamCost[allyTeamID] + unitCost[unitDefID] unfinishedUnits[allyTeamID][unitID] = nil @@ -69,7 +75,9 @@ end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) local allyTeamID = teamAllyteam[unitTeam] - if not allyTeamID then return end + if not allyTeamID then + return + end if unfinishedUnits[allyTeamID][unitID] then unfinishedUnits[allyTeamID][unitID] = nil else @@ -80,7 +88,9 @@ end function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) local allyTeamID = teamAllyteam[unitTeam] local oldAllyTeamID = teamAllyteam[oldTeam] - if not allyTeamID or not oldAllyTeamID then return end + if not allyTeamID or not oldAllyTeamID then + return + end if spGetUnitIsBeingBuilt(unitID) then unfinishedUnits[oldAllyTeamID][unitID] = nil @@ -94,7 +104,9 @@ end function gadget:UnitTaken(unitID, unitDefID, unitTeam, oldTeam) local allyTeamID = teamAllyteam[unitTeam] local oldAllyTeamID = teamAllyteam[oldTeam] - if not allyTeamID or not oldAllyTeamID then return end + if not allyTeamID or not oldAllyTeamID then + return + end if spGetUnitIsBeingBuilt(unitID) then unfinishedUnits[oldAllyTeamID][unitID] = nil @@ -128,13 +140,13 @@ function gadget:GameFrame(gf) local totalConstructionCost = 0 for unitID, unitDefID in pairs(unfinishedUnits[allyTeamID]) do local completeness = select(2, spGetUnitIsBeingBuilt(unitID)) - if not completeness then -- this shouldnt occur + if not completeness then -- this shouldnt occur unfinishedUnits[allyTeamID][unitID] = nil else totalConstructionCost = totalConstructionCost + mathFloor(unitCost[unitDefID] * completeness) end end - temp[#temp+1] = { allyTeamID = allyTeamID, totalCost = totalCost + totalResCost + totalConstructionCost } + temp[#temp + 1] = { allyTeamID = allyTeamID, totalCost = totalCost + totalResCost + totalConstructionCost } end tableSort(temp, rankSortFunc) local rankingChanged = false @@ -152,4 +164,3 @@ function gadget:GameFrame(gf) end end end - diff --git a/luarules/gadgets/game_apm_broadcast.lua b/luarules/gadgets/game_apm_broadcast.lua index e82c1ea3f43..c0e00bc8e1e 100644 --- a/luarules/gadgets/game_apm_broadcast.lua +++ b/luarules/gadgets/game_apm_broadcast.lua @@ -2,23 +2,21 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "APM Broadcast", - desc = "Broadcasts ActionsPerMinute", - author = "Floris", - date = "May 2024", - license = "GNU GPL, v2 or later", - layer = 99999999, + name = "APM Broadcast", + desc = "Broadcasts ActionsPerMinute", + author = "Floris", + date = "May 2024", + license = "GNU GPL, v2 or later", + layer = 99999999, enabled = true, } end - if gadgetHandler:IsSyncedCode() then - local teamAddedActionFrame = {} local ignoreUnits = {} local gameFrame = Spring.GetGameFrame() - local startFrame = Spring.GetGameFrame() -- used in case of luarules reload + local startFrame = Spring.GetGameFrame() -- used in case of luarules reload local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local totalTeamActions = {} @@ -38,8 +36,8 @@ if gadgetHandler:IsSyncedCode() then end function gadget:Initialize() - GG['apm'] = {} - GG['apm'].addSkipOrder = addSkipOrder + GG["apm"] = {} + GG["apm"].addSkipOrder = addSkipOrder gadgetHandler:RegisterAllowCommand(CMD.ANY) end @@ -52,22 +50,22 @@ if gadgetHandler:IsSyncedCode() then function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, fromSynced, fromLua) -- limit to 1 action per gameframe if not teamAddedActionFrame[teamID] and totalTeamActions[teamID] and not ignoreUnitDefs[unitDefID] then - if not ignoreUnits[unitID] and not spGetUnitIsBeingBuilt(unitID) then -- believe it or not but unitcreated can come after AllowCommand (with nocost at least) + if not ignoreUnits[unitID] and not spGetUnitIsBeingBuilt(unitID) then -- believe it or not but unitcreated can come after AllowCommand (with nocost at least) totalTeamActions[teamID] = totalTeamActions[teamID] + 1 teamAddedActionFrame[teamID] = true end end - ignoreUnits[unitID] = gameFrame + 7 -- dont count severe cmd spam + ignoreUnits[unitID] = gameFrame + 7 -- dont count severe cmd spam return true end local SendToUnsynced = SendToUnsynced local mathFloor = math.floor - + function gadget:GameFrame(gf) gameFrame = gf teamAddedActionFrame = {} - if gf % 300 == 1 then -- every 10 secs + if gf % 300 == 1 then -- every 10 secs local frameToMinute = 1 / ((gf - startFrame) / 1800) for teamID, totalActions in pairs(totalTeamActions) do local apm = mathFloor(totalActions * frameToMinute + 0.5) @@ -80,7 +78,9 @@ if gadgetHandler:IsSyncedCode() then local expiredCount = 0 for unitID, frame in pairs(ignoreUnits) do if frame <= gf then - if not expired then expired = {} end + if not expired then + expired = {} + end expiredCount = expiredCount + 1 expired[expiredCount] = unitID end @@ -94,11 +94,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:TeamDied(teamID) totalTeamActions[teamID] = nil end - - -else -- unsynced - - +else -- unsynced local function handleApmEvent(_, teamID, apm) if Script.LuaUI("ApmEvent") then Script.LuaUI.ApmEvent(teamID, apm) @@ -112,5 +108,4 @@ else -- unsynced function gadget:Shutdown() gadgetHandler:RemoveSyncAction("apmBroadcast") end - end diff --git a/luarules/gadgets/game_assistdronespawn.lua b/luarules/gadgets/game_assistdronespawn.lua index 877ed50f6bd..94cb1f076e6 100644 --- a/luarules/gadgets/game_assistdronespawn.lua +++ b/luarules/gadgets/game_assistdronespawn.lua @@ -5,15 +5,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "assistdrone spawn", - desc = "123", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = true, - } + return { + name = "assistdrone spawn", + desc = "123", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then @@ -26,11 +26,11 @@ local teamIDDroneList = {} local teamsList = Spring.GetTeamList() function CountItemsInArray(array) - local count = 0 - for k in pairs(array) do - count = count + 1 - end - return count + local count = 0 + for k in pairs(array) do + count = count + 1 + end + return count end local drones = {} @@ -43,7 +43,7 @@ if Spring.GetModOptions().assistdronesair == true then --} for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.iscommander then - drones[unitDefID] = string.sub(unitDef.name, 1, 3).."assistdrone" + drones[unitDefID] = string.sub(unitDef.name, 1, 3) .. "assistdrone" end end else @@ -54,52 +54,53 @@ else --} for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.iscommander then - drones[unitDefID] = string.sub(unitDef.name, 1, 3).."assistdrone_land" + drones[unitDefID] = string.sub(unitDef.name, 1, 3) .. "assistdrone_land" end end end - function SpawnAssistDrone(unitID, unitDefID, unitTeam) - if not teamIDDroneList[unitTeam] then teamIDDroneList[unitTeam] = {} end - local droneunit = drones[unitDefID] - if CountItemsInArray(teamIDDroneList[unitTeam]) < droneCount then - local posx, posy, posz = Spring.GetUnitPosition(unitID) - local droneID = Spring.CreateUnit(droneunit, posx, posy+100, posz, 0, unitTeam) - if droneID then - GG.ScavengersSpawnEffectUnitID(droneID) - Spring.GiveOrderToUnit(droneID, CMD.GUARD, unitID, {}) - teamIDDroneList[unitTeam][droneID] = true - Spring.SetUnitCosts(droneID, {buildTime = 500, metalCost = 1, energyCost = 1}) - end - end + if not teamIDDroneList[unitTeam] then + teamIDDroneList[unitTeam] = {} + end + local droneunit = drones[unitDefID] + if CountItemsInArray(teamIDDroneList[unitTeam]) < droneCount then + local posx, posy, posz = Spring.GetUnitPosition(unitID) + local droneID = Spring.CreateUnit(droneunit, posx, posy + 100, posz, 0, unitTeam) + if droneID then + GG.ScavengersSpawnEffectUnitID(droneID) + Spring.GiveOrderToUnit(droneID, CMD.GUARD, unitID, {}) + teamIDDroneList[unitTeam][droneID] = true + Spring.SetUnitCosts(droneID, { buildTime = 500, metalCost = 1, energyCost = 1 }) + end + end end local commandersList = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if drones[unitDefID] and not builderID then - commandersList[unitID] = true - end + if drones[unitDefID] and not builderID then + commandersList[unitID] = true + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if commandersList[unitID] then - commandersList[unitID] = nil - end - for _, teamID in pairs(teamsList) do - if teamIDDroneList[teamID] and teamIDDroneList[teamID][unitID] then - teamIDDroneList[teamID][unitID] = nil - break - end - end + if commandersList[unitID] then + commandersList[unitID] = nil + end + for _, teamID in pairs(teamsList) do + if teamIDDroneList[teamID] and teamIDDroneList[teamID][unitID] then + teamIDDroneList[teamID][unitID] = nil + break + end + end end function gadget:GameFrame(n) - if n == 150 or n > 150 and n%1800 == 0 then -- Drone respawn - for comID, _ in pairs(commandersList) do - local comDefID = Spring.GetUnitDefID(comID) - local comTeam = Spring.GetUnitTeam(comID) - SpawnAssistDrone(comID, comDefID, comTeam) - end - end + if n == 150 or n > 150 and n % 1800 == 0 then -- Drone respawn + for comID, _ in pairs(commandersList) do + local comDefID = Spring.GetUnitDefID(comID) + local comTeam = Spring.GetUnitTeam(comID) + SpawnAssistDrone(comID, comDefID, comTeam) + end + end end diff --git a/luarules/gadgets/game_autocolors.lua b/luarules/gadgets/game_autocolors.lua index 478598c31cd..3755feea89a 100644 --- a/luarules/gadgets/game_autocolors.lua +++ b/luarules/gadgets/game_autocolors.lua @@ -72,13 +72,12 @@ local ffaColors = { "#7EB900", -- 30 } -- delete excess so a table shuffe wont use the colors added on the bottom -if #ffaColors > #teamList-1 then +if #ffaColors > #teamList - 1 then for i = #teamList, #ffaColors do ffaColors[i] = nil end end - local survivalColors = { "#0B3EF3", -- 1 "#FF1005", -- 2 @@ -387,15 +386,14 @@ local teamColors = { }, } -local r = math.random(1,100000) -math.randomseed(1) -- make sure the next sequence of randoms can be reproduced +local r = math.random(1, 100000) +math.randomseed(1) -- make sure the next sequence of randoms can be reproduced local teamRandoms = {} for i = 1, #teamList do teamRandoms[teamList[i]] = { math.random(), math.random(), math.random() } end math.randomseed(r) - local iconDevModeColors = { armblue = armBlueColor, corred = corRedColor, @@ -407,7 +405,6 @@ local iconDevModeColors = { local iconDevMode = Spring.GetModOptions().teamcolors_icon_dev_mode local iconDevModeColor = iconDevModeColors[iconDevMode] - local function shuffleTable(Table) local originalTable = {} table.append(originalTable, Table) @@ -459,9 +456,7 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) } -- Simple Team Colors - elseif localRun and - (Spring.GetConfigInt("SimpleTeamColors", 0) == 1 or (anonymousMode == "allred" and not mySpecState)) - then + elseif localRun and (Spring.GetConfigInt("SimpleTeamColors", 0) == 1 or (anonymousMode == "allred" and not mySpecState)) then local brightnessVariation = 0 local maxColorVariation = 0 if Spring.GetConfigInt("SimpleTeamColorsUseGradient", 0) == 1 then @@ -472,10 +467,10 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) end end brightnessVariation = (0.7 - ((1 / #Spring.GetTeamList(allyTeamID)) * dimmingCount[allyTeamID])) * 255 - brightnessVariation = brightnessVariation * math.min((#Spring.GetTeamList(allyTeamID) * 0.8)-1, 1) -- dont change brightness too much in tiny teams + brightnessVariation = brightnessVariation * math.min((#Spring.GetTeamList(allyTeamID) * 0.8) - 1, 1) -- dont change brightness too much in tiny teams maxColorVariation = 60 end - local color = hex2RGB(ffaColors[allyTeamID+1] or '#333333') + local color = hex2RGB(ffaColors[allyTeamID + 1] or "#333333") if Spring.GetConfigInt("SimpleTeamColorsFactionSpecific", 0) == 1 then if isAI and string.find(isAI, "Scavenger") then color = hex2RGB(scavPurpColor) @@ -483,8 +478,8 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) color = hex2RGB(raptorOrangeColor) elseif teamID == gaiaTeamID then color = hex2RGB(gaiaGrayColor) - elseif Spring.GetTeamRulesParam(teamID, 'startUnit') and anonymousMode ~= "allred" then - local side = string.sub(UnitDefs[Spring.GetTeamRulesParam(teamID, 'startUnit')].name, 1, 3) + elseif Spring.GetTeamRulesParam(teamID, "startUnit") and anonymousMode ~= "allred" then + local side = string.sub(UnitDefs[Spring.GetTeamRulesParam(teamID, "startUnit")].name, 1, 3) if side == "arm" then color = hex2RGB(armBlueColor) elseif side == "cor" then @@ -500,11 +495,11 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) elseif teamID == myTeamID then brightnessVariation = 0 maxColorVariation = 0 - color = {Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0), Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77), Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255)} + color = { Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0), Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77), Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255) } elseif allyTeamID == myAllyTeamID then - color = {Spring.GetConfigInt("SimpleTeamColorsAllyR", 0), Spring.GetConfigInt("SimpleTeamColorsAllyG", 255), Spring.GetConfigInt("SimpleTeamColorsAllyB", 0)} + color = { Spring.GetConfigInt("SimpleTeamColorsAllyR", 0), Spring.GetConfigInt("SimpleTeamColorsAllyG", 255), Spring.GetConfigInt("SimpleTeamColorsAllyB", 0) } elseif allyTeamID ~= myAllyTeamID then - color = {Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255), Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16), Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5)} + color = { Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255), Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16), Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5) } end color[1] = math.min(color[1] + brightnessVariation, 255) + ((teamRandoms[teamID][1] * (maxColorVariation * 2)) - maxColorVariation) color[2] = math.min(color[2] + brightnessVariation, 255) + ((teamRandoms[teamID][2] * (maxColorVariation * 2)) - maxColorVariation) @@ -514,7 +509,6 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) g = color[2], b = color[3], } - elseif isAI and string.find(isAI, "Scavenger") then teamColorsTable[teamID] = { r = hex2RGB(scavPurpColor)[1], @@ -533,37 +527,29 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) g = hex2RGB(gaiaGrayColor)[2], b = hex2RGB(gaiaGrayColor)[3], } - - elseif isSurvival and survivalColors[(#Spring.GetTeamList())-2] then + elseif isSurvival and survivalColors[(#Spring.GetTeamList()) - 2] then teamColorsTable[teamID] = { - r = hex2RGB(survivalColors[survivalColorNum])[1] - + math.random(-survivalColorVariation, survivalColorVariation), - g = hex2RGB(survivalColors[survivalColorNum])[2] - + math.random(-survivalColorVariation, survivalColorVariation), - b = hex2RGB(survivalColors[survivalColorNum])[3] - + math.random(-survivalColorVariation, survivalColorVariation), + r = hex2RGB(survivalColors[survivalColorNum])[1] + math.random(-survivalColorVariation, survivalColorVariation), + g = hex2RGB(survivalColors[survivalColorNum])[2] + math.random(-survivalColorVariation, survivalColorVariation), + b = hex2RGB(survivalColors[survivalColorNum])[3] + math.random(-survivalColorVariation, survivalColorVariation), } survivalColorNum = survivalColorNum + 1 -- Will start from the next color next time -- auto ffa gradient colored for huge player games - elseif useFFAColors or - (#Spring.GetTeamList(allyTeamCount-1) > 1 and (not teamColors[allyTeamCount] or not teamColors[allyTeamCount][1][#Spring.GetTeamList(allyTeamCount-1)])) - or #Spring.GetTeamList() > 30 - or (#Spring.GetTeamList(allyTeamCount-1) == 1 and not ffaColors[allyTeamCount]) - then - local color = hex2RGB(ffaColors[allyTeamID+1] or '#333333') - local maxIterations = math.floor((#teamList-1) / #ffaColors) + elseif useFFAColors or (#Spring.GetTeamList(allyTeamCount - 1) > 1 and (not teamColors[allyTeamCount] or not teamColors[allyTeamCount][1][#Spring.GetTeamList(allyTeamCount - 1)])) or #Spring.GetTeamList() > 30 or (#Spring.GetTeamList(allyTeamCount - 1) == 1 and not ffaColors[allyTeamCount]) then + local color = hex2RGB(ffaColors[allyTeamID + 1] or "#333333") + local maxIterations = math.floor((#teamList - 1) / #ffaColors) local brightnessVariation = (0.6 - ((1 / #Spring.GetTeamList(allyTeamID)) * dimmingCount[allyTeamID])) * 255 - brightnessVariation = brightnessVariation * math.min((#Spring.GetTeamList(allyTeamID) * 0.7)-1, 1) -- dont change brightness too much in tiny teams - local maxColorVariation = (120 / math.max(1, allyTeamCount-1)) + brightnessVariation = brightnessVariation * math.min((#Spring.GetTeamList(allyTeamID) * 0.7) - 1, 1) -- dont change brightness too much in tiny teams + local maxColorVariation = (120 / math.max(1, allyTeamCount - 1)) if #Spring.GetTeamList(allyTeamID) == 1 then brightnessVariation = 0 maxColorVariation = 0 end if maxIterations > 1 then - local iteration = 1 + math.floor((allyTeamID+1)/(#ffaColors)) - local ffaColor = (allyTeamID+1) - (#ffaColors*(iteration-1)) + 1 + local iteration = 1 + math.floor((allyTeamID + 1) / #ffaColors) + local ffaColor = (allyTeamID + 1) - (#ffaColors * (iteration - 1)) + 1 if iteration ~= 1 then color = hex2RGB(ffaColors[ffaColor]) end @@ -600,7 +586,8 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) teamSizes[allyTeamID] = { allyTeamNum, 1, 0 } -- Team number, Starting color number, Color variation end - if teamColors[allyTeamCount] -- If we have the color set for this number of teams + if + teamColors[allyTeamCount] -- If we have the color set for this number of teams and teamColors[allyTeamCount][teamSizes[allyTeamID][1]] then -- And this team number exists in the color set if not teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]] then -- If we have no color for this player anymore @@ -609,15 +596,11 @@ local function setupTeamColor(teamID, allyTeamID, isAI, localRun) -- Assigning R,G,B values with specified color variations teamColorsTable[teamID] = { - r = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[1] - + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), - g = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[2] - + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), - b = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[3] - + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), + r = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[1] + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), + g = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[2] + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), + b = hex2RGB(teamColors[allyTeamCount][teamSizes[allyTeamID][1]][teamSizes[allyTeamID][2]])[3] + math.random(-teamSizes[allyTeamID][3], teamSizes[allyTeamID][3]), } teamSizes[allyTeamID][2] = teamSizes[allyTeamID][2] + 1 -- Will start from the next color next time - else Spring.Echo("[AUTOCOLORS] Error: Team Colors Table is broken or missing for this allyteam set") teamColorsTable[teamID] = { @@ -650,9 +633,7 @@ end setupAllTeamColors(false) trueTeamColorsTable = table.copy(teamColorsTable) -- store the true team colors so we can restore them when we become a spec - -if gadgetHandler:IsSyncedCode() then --- NOTE: STUFF DONE IN SYNCED IS FOR REPLAY WEBSITE - +if gadgetHandler:IsSyncedCode() then --- NOTE: STUFF DONE IN SYNCED IS FOR REPLAY WEBSITE local AutoColors = {} for i = 1, #teamList do local teamID = teamList[i] @@ -664,10 +645,7 @@ if gadgetHandler:IsSyncedCode() then --- NOTE: STUFF DONE IN SYNCED IS FOR REPLA } end Spring.SendLuaRulesMsg("AutoColors" .. Json.encode(AutoColors)) - - -else -- UNSYNCED - +else -- UNSYNCED local myPlayerID = Spring.GetLocalPlayerID() local mySpecState = Spring.GetSpectatingState() @@ -743,13 +721,13 @@ else -- UNSYNCED myTeamID = Spring.GetMyTeamID() if mySpecState and prevMyTeamID ~= myTeamID and Spring.GetConfigInt("SimpleTeamColors", 0) == 1 then Spring.SetConfigInt("UpdateTeamColors", 1) - end + end if mySpecState ~= Spring.GetSpectatingState() then mySpecState = Spring.GetSpectatingState() teamColorsTable = table.copy(trueTeamColorsTable) ffaColors = table.copy(trueFfaColors) survivalColors = table.copy(trueSurvivalColors) - updateTeamColors() -- apply true colors directly; avoids setupAllTeamColors(true) re-computing with live game state + updateTeamColors() -- apply true colors directly; avoids setupAllTeamColors(true) re-computing with live game state end end end diff --git a/luarules/gadgets/game_commander_builder.lua b/luarules/gadgets/game_commander_builder.lua index 5c369a4fe7e..cef40b34ed0 100644 --- a/luarules/gadgets/game_commander_builder.lua +++ b/luarules/gadgets/game_commander_builder.lua @@ -15,15 +15,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "commander builder spawn", - desc = "123", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = spawnpadSpawnEnabled, - } + return { + name = "commander builder spawn", + desc = "123", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = spawnpadSpawnEnabled, + } end local UDN = UnitDefNames @@ -35,8 +35,8 @@ end local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") local spawnpads = { - [UDN.armcom.id] = "armrespawn", - [UDN.corcom.id] = "correspawn", + [UDN.armcom.id] = "armrespawn", + [UDN.corcom.id] = "correspawn", } if Spring.GetModOptions().experimentallegionfaction then spawnpads[UDN.legcom.id] = "legnanotcbase" @@ -46,51 +46,51 @@ local spawnFrame = Game.spawnWarpInFrame + Game.gameSpeed * 2 -- add time to dec function SpawnAssistTurret(unitID, unitDefID, unitTeam) local posx, posy, posz = Spring.GetUnitPosition(unitID) - local spawnpadunit = spawnpads[unitDefID] - local spawnpadID - for k = 1,10000 do - posx = math.ceil((posx + math.random(-k-64, k+64))/16)*16 - posz = math.ceil((posz + math.random(-k-64, k+64))/16)*16 - posy = Spring.GetGroundHeight(posx, posz) - local canSpawnTurret = positionCheckLibrary.FlatAreaCheck(posx, posy, posz, 96) - if canSpawnTurret then - canSpawnTurret = positionCheckLibrary.OccupancyCheck(posx, posy, posz, 96) - end - if canSpawnTurret then - canSpawnTurret = positionCheckLibrary.ResourceCheck(posx, posz, 96) - end - if canSpawnTurret then - spawnpadID = Spring.CreateUnit(spawnpadunit, posx, posy, posz, 0, unitTeam) - break - end - end + local spawnpadunit = spawnpads[unitDefID] + local spawnpadID + for k = 1, 10000 do + posx = math.ceil((posx + math.random(-k - 64, k + 64)) / 16) * 16 + posz = math.ceil((posz + math.random(-k - 64, k + 64)) / 16) * 16 + posy = Spring.GetGroundHeight(posx, posz) + local canSpawnTurret = positionCheckLibrary.FlatAreaCheck(posx, posy, posz, 96) + if canSpawnTurret then + canSpawnTurret = positionCheckLibrary.OccupancyCheck(posx, posy, posz, 96) + end + if canSpawnTurret then + canSpawnTurret = positionCheckLibrary.ResourceCheck(posx, posz, 96) + end + if canSpawnTurret then + spawnpadID = Spring.CreateUnit(spawnpadunit, posx, posy, posz, 0, unitTeam) + break + end + end if spawnpadID then - GG.ScavengersSpawnEffectUnitID(spawnpadID) + GG.ScavengersSpawnEffectUnitID(spawnpadID) Spring.GiveOrderToUnit(spawnpadID, CMD.GUARD, unitID, {}) - Spring.SetUnitCosts(spawnpadID, {buildTime = 20000, metalCost = 100, energyCost = 1000}) + Spring.SetUnitCosts(spawnpadID, { buildTime = 20000, metalCost = 100, energyCost = 1000 }) --Spring.SetUnitBlocking(spawnpadID, false) end end local commandersList = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if spawnpads[unitDefID] and not builderID then - commandersList[unitID] = true - end + if spawnpads[unitDefID] and not builderID then + commandersList[unitID] = true + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if commandersList[unitID] then - commandersList[unitID] = nil - end + if commandersList[unitID] then + commandersList[unitID] = nil + end end function gadget:GameFrame(n) - if n == spawnFrame then - for comID, _ in pairs(commandersList) do - local comDefID = Spring.GetUnitDefID(comID) - local comTeam = Spring.GetUnitTeam(comID) - SpawnAssistTurret(comID, comDefID, comTeam) - end - end + if n == spawnFrame then + for comID, _ in pairs(commandersList) do + local comDefID = Spring.GetUnitDefID(comID) + local comTeam = Spring.GetUnitTeam(comID) + SpawnAssistTurret(comID, comDefID, comTeam) + end + end end diff --git a/luarules/gadgets/game_custom_map_tidal.lua b/luarules/gadgets/game_custom_map_tidal.lua index 072978983f5..ccec5aa4a7c 100644 --- a/luarules/gadgets/game_custom_map_tidal.lua +++ b/luarules/gadgets/game_custom_map_tidal.lua @@ -1,4 +1,6 @@ -if not gadgetHandler:IsSyncedCode() then return false end +if not gadgetHandler:IsSyncedCode() then + return false +end local gadget = gadget ---@type Gadget @@ -10,20 +12,20 @@ function gadget:GetInfo() date = "December 2023", license = "GPLv2 or late", layer = 0, - enabled = true + enabled = true, } end function gadget:Initialize() local newTidal = Spring.GetModOptions().map_tidal local tidalSpeeds = { - high=23, - medium=18, - low=13, - unchanged=nil, + high = 23, + medium = 18, + low = 13, + unchanged = nil, } local newValue = tidalSpeeds[newTidal] if newValue then Spring.SetTidal(newValue) end -end \ No newline at end of file +end diff --git a/luarules/gadgets/game_disable_assist_ally.lua b/luarules/gadgets/game_disable_assist_ally.lua index 17535cad71d..cbbc2ac7986 100644 --- a/luarules/gadgets/game_disable_assist_ally.lua +++ b/luarules/gadgets/game_disable_assist_ally.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Disable Assist Ally Construction', - desc = 'Disable assisting allied units (e.g. labs and units/buildings under construction) when modoption is enabled', - author = 'Rimilel', - date = 'April 2024', - license = 'GNU GPL, v2 or later', - layer = 1, -- after unit_mex_upgrade_reclaimer and unit_geo_upgrade_reclaimer + name = "Disable Assist Ally Construction", + desc = "Disable assisting allied units (e.g. labs and units/buildings under construction) when modoption is enabled", + author = "Rimilel", + date = "April 2024", + license = "GNU GPL, v2 or later", + layer = 1, -- after unit_mex_upgrade_reclaimer and unit_geo_upgrade_reclaimer enabled = Spring.GetModOptions().disable_assist_ally_construction, -- or Spring.GetModOptions().easytax, -- disabled for easytax and replaced with tax in game_tax_resource_sharing.lua } end @@ -34,7 +34,11 @@ local footprintSize = Game.squareSize * Game.footprintScale -- Local state local builderMoveStateCmdDesc = { - params = { 1, "Hold pos", "Maneuver", --[["Roam"]] }, + params = { + 1, + "Hold pos", + "Maneuver", --[["Roam"]] + }, } local gaiaTeam = Spring.GetGaiaTeamID() @@ -172,22 +176,22 @@ end -- Temp anti-cheat-esque guard. We check on random frames for units bypassing the rules. local function AllowUnitBuildStep(self, builderID, builderTeam, unitID, unitDefID, part) - if part > 0 and builderTeam ~= spGetUnitTeam(unitID) and spGetUnitIsBeingBuilt(unitID) then + if part > 0 and builderTeam ~= spGetUnitTeam(unitID) and spGetUnitIsBeingBuilt(unitID) then checkUnitCommandList[builderID] = builderTeam return false - end + end return true end local seed = mathRandom(Game.spawnWarpInFrame + 1, Game.spawnWarpInFrame + Game.gameSpeed - 1) function gadget:GameFrame(frame) - if frame % seed == 0 then - gadget.AllowUnitBuildStep = AllowUnitBuildStep - gadgetHandler:UpdateCallIn("AllowUnitBuildStep") - elseif gadget.AllowUnitBuildStep then - gadget.AllowUnitBuildStep = nil - gadgetHandler:UpdateCallIn("AllowUnitBuildStep") - seed = mathRandom(1, 119) - end + if frame % seed == 0 then + gadget.AllowUnitBuildStep = AllowUnitBuildStep + gadgetHandler:UpdateCallIn("AllowUnitBuildStep") + elseif gadget.AllowUnitBuildStep then + gadget.AllowUnitBuildStep = nil + gadgetHandler:UpdateCallIn("AllowUnitBuildStep") + seed = mathRandom(1, 119) + end end diff --git a/luarules/gadgets/game_disable_unit_sharing.lua b/luarules/gadgets/game_disable_unit_sharing.lua index 8629fa5d24c..d1691c7975e 100644 --- a/luarules/gadgets/game_disable_unit_sharing.lua +++ b/luarules/gadgets/game_disable_unit_sharing.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Disable Unit Sharing', - desc = 'Disable unit sharing when modoption is enabled', - author = 'Rimilel', - date = 'April 2024', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true + name = "Disable Unit Sharing", + desc = "Disable unit sharing when modoption is enabled", + author = "Rimilel", + date = "April 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -24,7 +24,7 @@ if not Spring.GetModOptions().disable_unit_sharing then end function gadget:AllowUnitTransfer(unitID, unitDefID, fromTeamID, toTeamID, capture) - if (capture) then + if capture then return true end return false diff --git a/luarules/gadgets/game_draft_spawn_order.lua b/luarules/gadgets/game_draft_spawn_order.lua index 29f0ea12837..7b7224a3ccb 100644 --- a/luarules/gadgets/game_draft_spawn_order.lua +++ b/luarules/gadgets/game_draft_spawn_order.lua @@ -31,7 +31,7 @@ local function FindPlayerID(teamID) -- Fallback: Search for player ID using Spring functions (no skill data available) local players = Spring.GetPlayerList() for _, playerID in ipairs(players) do - local playerTeamID = select(4,spGetPlayerInfo(playerID, false)) + local playerTeamID = select(4, spGetPlayerInfo(playerID, false)) if playerTeamID == teamID then return playerID end @@ -46,7 +46,7 @@ local function FindPlayerName(teamID) else local players = Spring.GetPlayerList() for _, playerID in ipairs(players) do - local name,_,_,playerTeamID = spGetPlayerInfo(playerID, false) + local name, _, _, playerTeamID = spGetPlayerInfo(playerID, false) if playerTeamID == teamID and name then return name end @@ -57,7 +57,9 @@ end local function shuffleArray(array) local n = (array and #array) or 0 - if n <= 1 then return array end + if n <= 1 then + return array + end local random = math.random for i = 1, n do local j = random(i, n) @@ -74,12 +76,18 @@ local function GetSkillByTeam(teamID) end local function GetSkillByPlayer(playerID) - if playerID == nil then return 0 end -- uhh + if playerID == nil then + return 0 + end -- uhh local customtable = select(11, spGetPlayerInfo(playerID)) - if type(customtable) == 'table' then + if type(customtable) == "table" then local tsMu = customtable.skill local ts = tsMu and tonumber(tsMu:match("%d+%.?%d*")) - if (ts == nil) then return 0 else return ts end + if ts == nil then + return 0 + else + return ts + end end return 0 end @@ -87,7 +95,7 @@ end local function compareSkills(teamA, teamB) local skillA = GetSkillByTeam(teamA) local skillB = GetSkillByTeam(teamB) - return skillA > skillB -- Sort in descending order of skill + return skillA > skillB -- Sort in descending order of skill end local function isAllyTeamSkillZero(allyTeamID) @@ -105,7 +113,9 @@ local function isAllyTeamSkillZero(allyTeamID) end local function sendTeamOrder(teamOrder, allyTeamID_ready, log) - if (teamOrder == nil or #teamOrder <= 0) then return end -- do not send empty order ever + if teamOrder == nil or #teamOrder <= 0 then + return + end -- do not send empty order ever -- we send to allyTeamID Turn1 Turn2 Turn3 {...} local orderMsg = "" local orderIds = "" @@ -113,19 +123,21 @@ local function sendTeamOrder(teamOrder, allyTeamID_ready, log) for i, teamID in ipairs(teamOrder) do local playerID = FindPlayerID(teamID) local tname = FindPlayerName(teamID) or "unknown" -- "unknown" should not happen if we create the order after everyone connects, so we are good in the most cases - if (playerID) then + if playerID then if i == 1 then orderMsg = tname orderIds = playerID else - if alone then alone = false end + if alone then + alone = false + end orderMsg = orderMsg .. ", " .. tname orderIds = orderIds .. " " .. playerID end end end if log and not alone then - Spring.Log(gadget:GetInfo().name, LOG.INFO, "Order [id:"..allyTeamID_ready.."]: "..orderMsg) + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Order [id:" .. allyTeamID_ready .. "]: " .. orderMsg) end Spring.SendLuaUIMsg("DraftOrderPlayersOrder " .. allyTeamID_ready .. " " .. orderIds) end @@ -141,7 +153,9 @@ local function calculateVotedPercentage(allyTeamID, votesArray) votedPlayers = votedPlayers + 1 end end - if totalPlayers < VOTE_QUORUM or (totalPlayers == 0) then return 0 end -- auto-fail + if totalPlayers < VOTE_QUORUM or (totalPlayers == 0) then + return 0 + end -- auto-fail return (votedPlayers / totalPlayers) * 100 end @@ -151,16 +165,18 @@ local function SendDraftMessageToPlayer(allyTeamID, target_num) end local function checkVotesAndAdvanceTurn(allyTeamID) - if allyTeamSpawnOrderPlaced[allyTeamID] > #allyTeamSpawnOrder[allyTeamID] then return end -- allow skip last one, but no more + if allyTeamSpawnOrderPlaced[allyTeamID] > #allyTeamSpawnOrder[allyTeamID] then + return + end -- allow skip last one, but no more local votedPercentage = calculateVotedPercentage(allyTeamID, votedToForceSkipTurn) if votedPercentage >= VOTE_YES_PRCTN_REQ then if announceVoteResults then - Spring.Echo(""..votedPercentage.."% (req: "..VOTE_YES_PRCTN_REQ.."%) of players on ally team " .. allyTeamID .. " have voted to skip current player turn.") + Spring.Echo("" .. votedPercentage .. "% (req: " .. VOTE_YES_PRCTN_REQ .. "%) of players on ally team " .. allyTeamID .. " have voted to skip current player turn.") end for teamID, _ in pairs(votedToForceSkipTurn[allyTeamID]) do votedToForceSkipTurn[allyTeamID][teamID] = false -- reset vote end -- and advance turn - allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID]+1 + allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID] + 1 SendDraftMessageToPlayer(allyTeamID, allyTeamSpawnOrderPlaced[allyTeamID]) end end @@ -172,7 +188,7 @@ local function isTurnToPlace(allyTeamID, teamID) -- 2 - Your turn has passed local teamOrder = allyTeamSpawnOrder[allyTeamID] if not teamOrder then - return 2 -- No spawn order defined for this team; you can place whenever then + return 2 -- No spawn order defined for this team; you can place whenever then end local placedIndex = allyTeamSpawnOrderPlaced[allyTeamID] if placedIndex <= 0 then @@ -186,7 +202,9 @@ local function isTurnToPlace(allyTeamID, teamID) break end end - if not teamIndex then return 2 end -- The team is not in the spawn order; you can place whenever then + if not teamIndex then + return 2 + end -- The team is not in the spawn order; you can place whenever then if teamIndex == placedIndex then -- Your turn return 1 elseif teamIndex < placedIndex then -- Skipped your turn? @@ -227,7 +245,9 @@ local function PreInitDraftOrderData() end local function putLateJoinersLast(array) - if not array then return end + if not array then + return + end local lateJoiners = false for _, teamID in ipairs(array) do if not teamPlayerData[teamID] then @@ -235,7 +255,9 @@ local function putLateJoinersLast(array) break end end - if not lateJoiners then return end + if not lateJoiners then + return + end local teamsWithPlayerData = {} local teamsWithoutPlayerData = {} @@ -260,7 +282,9 @@ local function putLateJoinersLast(array) end local function InitDraftOrderData(allyTeamID_ready) - if not allyTeamID_ready or allyTeamIsInGame[allyTeamID_ready] == true then return end -- already started + if not allyTeamID_ready or allyTeamIsInGame[allyTeamID_ready] == true then + return + end -- already started allyTeamIsInGame[allyTeamID_ready] = true if draftMode == "random" or draftMode == "captain" then local tteams = Spring.GetTeamList() @@ -306,15 +330,17 @@ local function InitDraftOrderData(allyTeamID_ready) end end for i = 1, #allyTeamSpawnOrder[allyTeamID_ready] - 1 do - if GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i]) <= 0 then break end - if GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i]) == GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i+1]) then - randomlySwap(allyTeamSpawnOrder[allyTeamID_ready], i, i+1) + if GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i]) <= 0 then + break + end + if GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i]) == GetSkillByTeam(allyTeamSpawnOrder[allyTeamID_ready][i + 1]) then + randomlySwap(allyTeamSpawnOrder[allyTeamID_ready], i, i + 1) end end end putLateJoinersLast(allyTeamSpawnOrder[allyTeamID_ready]) end - Spring.SendLuaUIMsg("DraftOrderAllyTeamJoined "..allyTeamID_ready) + Spring.SendLuaUIMsg("DraftOrderAllyTeamJoined " .. allyTeamID_ready) if draftMode == "skill" or draftMode == "random" or draftMode == "captain" then canVoteSkipTurn = true allyTeamSpawnOrderPlaced[allyTeamID_ready] = 1 -- First team in the order queue must place now @@ -327,7 +353,7 @@ local function checkVotesAndStartDraft(allyTeamID) local votedPercentage = calculateVotedPercentage(allyTeamID, votedToForceStartDraft) if votedPercentage >= VOTE_YES_PRCTN_REQ then if announceVoteResults then - Spring.Echo(""..votedPercentage.."% (req: "..VOTE_YES_PRCTN_REQ.."%) of players on ally team " .. allyTeamID .. " have voted to skip wait for late-joiners.") + Spring.Echo("" .. votedPercentage .. "% (req: " .. VOTE_YES_PRCTN_REQ .. "%) of players on ally team " .. allyTeamID .. " have voted to skip wait for late-joiners.") end for teamID, _ in pairs(votedToForceStartDraft[allyTeamID]) do votedToForceStartDraft[allyTeamID][teamID] = false -- reset vote @@ -372,7 +398,7 @@ end function Draft_PostAllowStartPosition(myTurn, allyTeamID) if myTurn then - allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID]+1 + allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID] + 1 SendDraftMessageToPlayer(allyTeamID, allyTeamSpawnOrderPlaced[allyTeamID]) end end @@ -382,13 +408,13 @@ function DraftRecvLuaMsg(msg, playerID, playerIsSpec, playerTeam, allyTeamID) votedToForceStartDraft[allyTeamID][playerTeam] = true checkVotesAndStartDraft(allyTeamID) -- in fair mode it simply unlocks placing after latejoin timeout end - if (draftMode == "skill" or draftMode == "random" or draftMode == "captain") then + if draftMode == "skill" or draftMode == "random" or draftMode == "captain" then if allyTeamSpawnOrderPlaced[allyTeamID] and allyTeamSpawnOrderPlaced[allyTeamID] > 0 then if msg == "skip_my_turn" then if allyTeamIsInGame[allyTeamID] and playerTeam and allyTeamID then local turnCheck = isTurnToPlace(allyTeamID, playerTeam) if turnCheck == 1 then -- your turn and you skip? sure thing then! - allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID]+1 -- if it "overflows", that means all teams inside the allyteam can place, which is OK + allyTeamSpawnOrderPlaced[allyTeamID] = allyTeamSpawnOrderPlaced[allyTeamID] + 1 -- if it "overflows", that means all teams inside the allyteam can place, which is OK SendDraftMessageToPlayer(allyTeamID, allyTeamSpawnOrderPlaced[allyTeamID]) end end @@ -399,9 +425,9 @@ function DraftRecvLuaMsg(msg, playerID, playerIsSpec, playerTeam, allyTeamID) end end if msg == "i_have_joined_fair" then - local playerName = select(1,spGetPlayerInfo(playerID, false)) + local playerName = select(1, spGetPlayerInfo(playerID, false)) if playerID > -1 and playerName ~= nil then - teamPlayerData[playerTeam] = {id = playerID, name = playerName, skill = GetSkillByPlayer(playerID)} -- Save data + teamPlayerData[playerTeam] = { id = playerID, name = playerName, skill = GetSkillByPlayer(playerID) } -- Save data end -- Check if all allies have joined and start the draft automatically if allyTeamIsInGame[allyTeamID] ~= true then @@ -424,12 +450,12 @@ function DraftRecvLuaMsg(msg, playerID, playerIsSpec, playerTeam, allyTeamID) InitDraftOrderData(allyTeamID) end if not waitIsMandatory and tcount >= VOTE_QUORUM and count > 0 and tcount > 0 and (((count / tcount) * 100) >= VOTE_YES_PRCTN_REQ) then - Spring.SendLuaUIMsg("DraftOrderShowCountdown "..allyTeamID) + Spring.SendLuaUIMsg("DraftOrderShowCountdown " .. allyTeamID) end end elseif msg == "send_me_the_info_again" then -- someone luaui /reload'ed, send them the queue and index again if allyTeamIsInGame[allyTeamID] then - Spring.SendLuaUIMsg("DraftOrderAllyTeamJoined "..allyTeamID) + Spring.SendLuaUIMsg("DraftOrderAllyTeamJoined " .. allyTeamID) if draftMode ~= "fair" and allyTeamSpawnOrderPlaced[allyTeamID] then sendTeamOrder(allyTeamSpawnOrder[allyTeamID], allyTeamID, false) -- Send order FIRST SendDraftMessageToPlayer(allyTeamID, allyTeamSpawnOrderPlaced[allyTeamID]) diff --git a/luarules/gadgets/game_dynamic_maxunits.lua b/luarules/gadgets/game_dynamic_maxunits.lua index 268a0ed7a4b..67b2eab5a97 100644 --- a/luarules/gadgets/game_dynamic_maxunits.lua +++ b/luarules/gadgets/game_dynamic_maxunits.lua @@ -1,4 +1,3 @@ - if not Spring.TransferTeamMaxUnits then return end @@ -6,19 +5,19 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Dynamic Maxunits", - desc = "redistributes unit limit", - author = "Floris", - date = "May 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Dynamic Maxunits", + desc = "redistributes unit limit", + author = "Floris", + date = "May 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end --[[ @@ -56,12 +55,13 @@ end - Takes back maxunits from alive teammates proportionally - Aims to restore the rejoining team to the standard maxunits limit - Ensures fair distribution within the allyteam -]]-- +]] +-- local maxunits = tonumber(Spring.GetModOptions().maxunits) or 2000 local engineLimit = 32000 local gaiaLimit = 500 -if (Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins == "scav_only" and Spring.Utilities.Gametype.IsScavengers())) then +if Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins == "scav_only" and Spring.Utilities.Gametype.IsScavengers()) then if Spring.GetModOptions().ruins_density == "normal" then gaiaLimit = 750 elseif Spring.GetModOptions().ruins_density == "dense" then @@ -70,8 +70,8 @@ if (Spring.GetModOptions().ruins == "enabled" or (Spring.GetModOptions().ruins = gaiaLimit = 2000 end end -local scavengerRaptorLimit = 3500 -- Minimum maxunits for Scavenger/Raptor teams -local equalizationFactor = 0.25 -- How much to equalize (0 = no equalization, 1 = full equalization). 0.25 means go 25% of the way toward equal allyteam totals +local scavengerRaptorLimit = 3500 -- Minimum maxunits for Scavenger/Raptor teams +local equalizationFactor = 0.25 -- How much to equalize (0 = no equalization, 1 = full equalization). 0.25 means go 25% of the way toward equal allyteam totals local mathFloor = math.floor local mathMin = math.min @@ -214,7 +214,7 @@ function gadget:Initialize() -- Calculate remaining units for regular teams local remainingMaxUnits = totalMaxUnits - scavRaptorAllocation - + -- Cap the remaining pool based on the modoption maxunits limit -- This ensures we don't distribute more than intended per team local cappedRemainingMaxUnits = mathMin(remainingMaxUnits, totalRegularTeams * maxunits) @@ -248,7 +248,7 @@ function gadget:Initialize() adjustments[teamID] = { current = currentMaxUnits, target = scavengerRaptorLimit, - isScavRaptor = true + isScavRaptor = true, } end @@ -273,7 +273,7 @@ function gadget:Initialize() adjustments[teamID] = { current = currentMaxUnits, target = adjustedShare, - isScavRaptor = false + isScavRaptor = false, } end end @@ -360,49 +360,49 @@ function gadget:Initialize() end end elseif gaiaCurrentMax > gaiaExpected then - -- Transfer excess from Gaia fairly to all alive regular (non-scav/raptor) teams - local gaiaExcess = gaiaCurrentMax - gaiaExpected - local regularTeams = {} - for _, teams in pairs(allyTeamTeams) do - for _, teamID in ipairs(teams) do - if not isScavengerOrRaptor(teamID) then - regularTeams[#regularTeams + 1] = teamID - end + -- Transfer excess from Gaia fairly to all alive regular (non-scav/raptor) teams + local gaiaExcess = gaiaCurrentMax - gaiaExpected + local regularTeams = {} + for _, teams in pairs(allyTeamTeams) do + for _, teamID in ipairs(teams) do + if not isScavengerOrRaptor(teamID) then + regularTeams[#regularTeams + 1] = teamID end end - -- Sort to ensure consistent ordering - table.sort(regularTeams) + end + -- Sort to ensure consistent ordering + table.sort(regularTeams) - if #regularTeams > 0 then - local perTeam = mathFloor(gaiaExcess / #regularTeams) - local remaining = gaiaExcess + if #regularTeams > 0 then + local perTeam = mathFloor(gaiaExcess / #regularTeams) + local remaining = gaiaExcess - -- Give each team their fair share (respecting maxunits cap) - for _, teamID in ipairs(regularTeams) do - if remaining > 0 then - local currentMaxUnits = Spring.GetTeamMaxUnits(teamID) - local transferAmount = mathMin(perTeam, remaining, maxunits - currentMaxUnits) - if transferAmount > 0 then - Spring.TransferTeamMaxUnits(gaiaTeamID, teamID, transferAmount) - remaining = remaining - transferAmount - end + -- Give each team their fair share (respecting maxunits cap) + for _, teamID in ipairs(regularTeams) do + if remaining > 0 then + local currentMaxUnits = Spring.GetTeamMaxUnits(teamID) + local transferAmount = mathMin(perTeam, remaining, maxunits - currentMaxUnits) + if transferAmount > 0 then + Spring.TransferTeamMaxUnits(gaiaTeamID, teamID, transferAmount) + remaining = remaining - transferAmount end end + end - -- Distribute any leftover from rounding (respecting maxunits cap) - if remaining > 0 then - for _, teamID in ipairs(regularTeams) do - if remaining <= 0 then - break - end - local currentMaxUnits = Spring.GetTeamMaxUnits(teamID) - if currentMaxUnits < maxunits then - Spring.TransferTeamMaxUnits(gaiaTeamID, teamID, 1) - remaining = remaining - 1 - end + -- Distribute any leftover from rounding (respecting maxunits cap) + if remaining > 0 then + for _, teamID in ipairs(regularTeams) do + if remaining <= 0 then + break + end + local currentMaxUnits = Spring.GetTeamMaxUnits(teamID) + if currentMaxUnits < maxunits then + Spring.TransferTeamMaxUnits(gaiaTeamID, teamID, 1) + remaining = remaining - 1 end end end + end end end @@ -421,14 +421,14 @@ function gadget:TeamDied(teamID) local teams = Spring.GetTeamList(allyID) local aliveTeams = 0 for i = 1, #teams do - if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor + if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor aliveTeams = aliveTeams + 1 end end if aliveTeams > 0 then for i = 1, #teams do - if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor + if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor local targetTeamID = teams[i] local currentMaxUnits = Spring.GetTeamMaxUnits(targetTeamID) local portionSize = mathFloor(redistributionAmount / aliveTeams) @@ -447,14 +447,14 @@ function gadget:TeamDied(teamID) teams = Spring.GetTeamList() aliveTeams = 0 for i = 1, #teams do - if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor + if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor aliveTeams = aliveTeams + 1 end end if aliveTeams > 0 then for i = 1, #teams do - if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor + if teams[i] ~= teamID and teams[i] ~= gaiaTeamID and not isScavengerOrRaptor(teams[i]) and not select(3, Spring.GetTeamInfo(teams[i], false)) then -- not dead, not gaia, not scav/raptor local targetTeamID = teams[i] local currentMaxUnits = Spring.GetTeamMaxUnits(targetTeamID) local portionSize = mathFloor(redistributionAmount / aliveTeams) @@ -472,7 +472,7 @@ end function gadget:TeamChanged(teamID) local gaiaTeamID = Spring.GetGaiaTeamID() - + -- Don't handle Gaia or Scavenger/Raptor teams if teamID == gaiaTeamID or isScavengerOrRaptor(teamID) then return @@ -485,7 +485,7 @@ function gadget:TeamChanged(teamID) local hasActivePlayer = teamHasActivePlayer(teamID) local hadActivePlayer = teamHadActivePlayer[teamID] teamHadActivePlayer[teamID] = hasActivePlayer - + -- Rebalance when a team becomes alive again OR when an active player rejoins that team. if (hadBeenDead and not isDead) or (hadActivePlayer == false and hasActivePlayer) then local allyID = select(6, Spring.GetTeamInfo(teamID, false)) diff --git a/luarules/gadgets/game_easter_eggs.lua b/luarules/gadgets/game_easter_eggs.lua index 56904bb5c45..c06609ef560 100644 --- a/luarules/gadgets/game_easter_eggs.lua +++ b/luarules/gadgets/game_easter_eggs.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Easter Eggs Spawner", - desc = "Spawns Easter Eggs around metal deposits", - author = "Damgam", - date = "2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Easter Eggs Spawner", + desc = "Spawns Easter Eggs around metal deposits", + author = "Damgam", + date = "2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not Spring.Utilities.Gametype.GetCurrentHolidays()["easter"] then @@ -17,61 +17,58 @@ if not Spring.Utilities.Gametype.GetCurrentHolidays()["easter"] then end if not gadgetHandler:IsSyncedCode() then - return false + return false end -local colors = {"pink","white","red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen"} - -function spawnRandomEggField(x,y,z, spread) +local colors = { "pink", "white", "red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen" } - local featureValueMetal = 4 - local featureValueEnergy = 40 - local size - local color +function spawnRandomEggField(x, y, z, spread) + local featureValueMetal = 4 + local featureValueEnergy = 40 + local size + local color - for i = 1,8 do - if i <= 1 then - size = "l" - color = colors[math.random(#colors)] - elseif i <= 3 then - size = "m" - color = colors[math.random(#colors)] - else - size = "s" - color = colors[math.random(#colors)] - end - x = x+math.random(-spread,spread) - y = y + 20 - z = z+math.random(-spread,spread) - if x > 0 and x < Game.mapSizeX and z > 0 and z < Game.mapSizeZ then - local egg = Spring.CreateFeature("raptor_egg_"..size.."_"..color, x, y, z, math.random(-999999,999999), Spring.GetGaiaTeamID()) - if egg then - Spring.SetFeatureMoveCtrl(egg, false,1,1,1,1,1,1,1,1,1) - Spring.SetFeatureResources(egg, featureValueMetal, featureValueEnergy, featureValueMetal*10, 1.0, featureValueMetal, featureValueEnergy) - end - end - - end + for i = 1, 8 do + if i <= 1 then + size = "l" + color = colors[math.random(#colors)] + elseif i <= 3 then + size = "m" + color = colors[math.random(#colors)] + else + size = "s" + color = colors[math.random(#colors)] + end + x = x + math.random(-spread, spread) + y = y + 20 + z = z + math.random(-spread, spread) + if x > 0 and x < Game.mapSizeX and z > 0 and z < Game.mapSizeZ then + local egg = Spring.CreateFeature("raptor_egg_" .. size .. "_" .. color, x, y, z, math.random(-999999, 999999), Spring.GetGaiaTeamID()) + if egg then + Spring.SetFeatureMoveCtrl(egg, false, 1, 1, 1, 1, 1, 1, 1, 1, 1) + Spring.SetFeatureResources(egg, featureValueMetal, featureValueEnergy, featureValueMetal * 10, 1.0, featureValueMetal, featureValueEnergy) + end + end + end end function gadget:GameFrame(frame) - - if frame == 7 then - local metalSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].metalSpotsList or nil - if metalSpots then - for i = 1, #metalSpots do - local spot = metalSpots[i] - if spot then - spawnRandomEggField(spot.x, Spring.GetGroundHeight(spot.x, spot.z), spot.z, 600) - end - end - else - for i = 1,100 do - local x = math.random(0, Game.mapSizeX) - local z = math.random(0, Game.mapSizeZ) - local y = Spring.GetGroundHeight(x, z) - spawnRandomEggField(x, y, z, 1000) - end - end - end + if frame == 7 then + local metalSpots = GG["resource_spot_finder"] and GG["resource_spot_finder"].metalSpotsList or nil + if metalSpots then + for i = 1, #metalSpots do + local spot = metalSpots[i] + if spot then + spawnRandomEggField(spot.x, Spring.GetGroundHeight(spot.x, spot.z), spot.z, 600) + end + end + else + for i = 1, 100 do + local x = math.random(0, Game.mapSizeX) + local z = math.random(0, Game.mapSizeZ) + local y = Spring.GetGroundHeight(x, z) + spawnRandomEggField(x, y, z, 1000) + end + end + end end diff --git a/luarules/gadgets/game_end.lua b/luarules/gadgets/game_end.lua index 45d71dcdbe0..37c3078b962 100644 --- a/luarules/gadgets/game_end.lua +++ b/luarules/gadgets/game_end.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "June, 2013", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -20,7 +20,6 @@ end - has no alive teams ]] if gadgetHandler:IsSyncedCode() then - local sharedDynamicAllianceVictory = Spring.GetModOptions().shareddynamicalliancevictory local fixedallies = Spring.GetModOptions().fixedallies @@ -51,7 +50,7 @@ if gadgetHandler:IsSyncedCode() then local isCommander = {} local unitDecoration = {} - for udefID,def in ipairs(UnitDefs) do + for udefID, def in ipairs(UnitDefs) do if def.customParams.iscommander then isCommander[udefID] = true end @@ -74,7 +73,7 @@ if gadgetHandler:IsSyncedCode() then local GetGameFrame = Spring.GetGameFrame local EMPTY_TABLE = {} - local playerQuitIsDead = true -- gets turned off for 1v1's + local playerQuitIsDead = true -- gets turned off for 1v1's local oneTeamWasActive = false local teamToAllyTeam = { [gaiaTeamID] = gaiaAllyTeamID } local playerIDtoAIs = {} @@ -115,10 +114,13 @@ if gadgetHandler:IsSyncedCode() then dead, }, } - ]]-- + ]] + -- local function UpdateAllyTeamIsDead(allyTeamID, gf) - if gf == 0 then return end + if gf == 0 then + return + end local wipeout = true local allyTeamInfo = allyTeamInfos[allyTeamID] @@ -129,8 +131,8 @@ if gadgetHandler:IsSyncedCode() then if isFFA and gf < earlyDropGrace then for teamID, team in pairs(allyTeamInfos[allyTeamID].teams) do local teamUnits = GetTeamUnits(teamID) or EMPTY_TABLE - for i=1, #teamUnits do - Spring.DestroyUnit(teamUnits[i], false, true) -- reclaim, dont want to leave FFA comwreck for idling starts + for i = 1, #teamUnits do + Spring.DestroyUnit(teamUnits[i], false, true) -- reclaim, dont want to leave FFA comwreck for idling starts end end else @@ -182,7 +184,7 @@ if gadgetHandler:IsSyncedCode() then else if not team.hasLeader and not team.dead then if not killTeamQueue[teamID] then - killTeamQueue[teamID] = gf + (Game.gameSpeed * (isFFA and 20 or 12)) -- add a grace period before killing the team + killTeamQueue[teamID] = gf + (Game.gameSpeed * (isFFA and 20 or 12)) -- add a grace period before killing the team end elseif killTeamQueue[teamID] then killTeamQueue[teamID] = nil @@ -238,7 +240,7 @@ if gadgetHandler:IsSyncedCode() then end function gadget:Initialize() - if Spring.GetModOptions().deathmode == 'neverend' then + if Spring.GetModOptions().deathmode == "neverend" then gadgetHandler:RemoveGadget(self) return end @@ -249,10 +251,10 @@ if gadgetHandler:IsSyncedCode() then teamCount = teamCount + 1 end end - if #allyteamList-1 < 2 then -- sandbox mode + if #allyteamList - 1 < 2 then -- sandbox mode gadgetHandler:RemoveGadget(self) return - elseif teamCount == 2 or isFFA then -- let player quit & rejoin in 1v1 + elseif teamCount == 2 or isFFA then -- let player quit & rejoin in 1v1 playerQuitIsDead = false end @@ -286,7 +288,7 @@ if gadgetHandler:IsSyncedCode() then end -- lua AI local luaAi = GetTeamLuaAI(teamID) - if luaAi and luaAi ~= '' then + if luaAi and luaAi ~= "" then teamInfo.isAI = true teamInfo.isControlled = true end @@ -390,12 +392,12 @@ if gadgetHandler:IsSyncedCode() then if gf == gameoverAnimFrame then for unitID, _ in pairs(gameoverAnimUnits) do if Spring.ValidUnitID(unitID) then - if Spring.GetCOBScriptID(unitID, 'GameOverAnim') then - Spring.CallCOBScript(unitID, 'GameOverAnim', 0, true) + if Spring.GetCOBScriptID(unitID, "GameOverAnim") then + Spring.CallCOBScript(unitID, "GameOverAnim", 0, true) else local scriptEnv = Spring.UnitScript.GetScriptEnv(unitID) - if scriptEnv and scriptEnv['GameOverAnim'] then - Spring.UnitScript.CallAsUnit(unitID, scriptEnv['GameOverAnim'], true) + if scriptEnv and scriptEnv["GameOverAnim"] then + Spring.UnitScript.CallAsUnit(unitID, scriptEnv["GameOverAnim"], true) end end end @@ -427,9 +429,9 @@ if gadgetHandler:IsSyncedCode() then gameoverWinners = winners -- make all winner commanders dance! - gameoverAnimFrame = gf + 55 -- delay a bit because walking commanders need to stop walking + a delay look nice + gameoverAnimFrame = gf + 55 -- delay a bit because walking commanders need to stop walking + a delay look nice gameoverAnimUnits = {} - if type(winners) == 'table' then + if type(winners) == "table" then local winnerSet = {} for u = 1, #winners do winnerSet[winners[u]] = true @@ -438,7 +440,7 @@ if gadgetHandler:IsSyncedCode() then for i = 1, #units do local unitID = units[i] if isCommander[Spring.GetUnitDefID(unitID)] and winnerSet[Spring.GetUnitAllyTeam(unitID)] then - Spring.GiveOrderToUnit(unitID, CMD.STOP, 0, 0) -- give stop cmd so commanders can animate in place + Spring.GiveOrderToUnit(unitID, CMD.STOP, 0, 0) -- give stop cmd so commanders can animate in place gameoverAnimUnits[unitID] = true end end @@ -494,7 +496,6 @@ if gadgetHandler:IsSyncedCode() then gadget.UnitTaken = gadget.UnitDestroyed function gadget:RecvLuaMsg(msg, playerID) - -- detect when no players are ingame (thus only specs remain) and shutdown the game if GetGameFrame() == 0 and string.byte(msg, 1) == 112 and string.byte(msg, 2) == 99 then -- 'p'=112, 'c'=99 local activeTeams = 0 @@ -518,9 +519,7 @@ if gadgetHandler:IsSyncedCode() then end end end - -else -- Unsynced - +else -- Unsynced local sec = 0 local cheated = false local IsCheatingEnabled = Spring.IsCheatingEnabled @@ -530,7 +529,7 @@ else -- Unsynced sec = sec + Spring.GetLastUpdateSeconds() if sec > 3 then sec = 0 - Spring.SendLuaRulesMsg('pc') + Spring.SendLuaRulesMsg("pc") end end end @@ -555,7 +554,7 @@ else -- Unsynced stats.endtime = Spring.GetGameFrame() / 30 stats.scenariooptions = Spring.GetModOptions().scenariooptions -- pass it back so we know difficulty - if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil then + if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") ~= nil then local message = Json.encode(stats) Spring.SendLuaMenuMsg("ScenarioGameEnd " .. message) end diff --git a/luarules/gadgets/game_energy_conversion.lua b/luarules/gadgets/game_energy_conversion.lua index 0b7f7bc0663..0b25fa1f422 100644 --- a/luarules/gadgets/game_energy_conversion.lua +++ b/luarules/gadgets/game_energy_conversion.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Energy Conversion', - desc = 'Handles converting energy to metal', - author = 'Niobium(modified by TheFatController, Finkky)', - version = 'v2.3', - date = 'May 2011', - license = 'GNU GPL, v2 or later', + name = "Energy Conversion", + desc = "Handles converting energy to metal", + author = "Niobium(modified by TheFatController, Finkky)", + version = "v2.3", + date = "May 2011", + license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -25,11 +25,11 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end -local alterLevelRegex = '^' .. string.char(137) .. '(%d+)$' -local mmLevelParamName = 'mmLevel' -local mmCapacityParamName = 'mmCapacity' -local mmUseParamName = 'mmUse' -local mmAvgEffiParamName = 'mmAvgEffi' +local alterLevelRegex = "^" .. string.char(137) .. "(%d+)$" +local mmLevelParamName = "mmLevel" +local mmCapacityParamName = "mmCapacity" +local mmUseParamName = "mmUse" +local mmAvgEffiParamName = "mmAvgEffi" local function SetMMRulesParams() -- make convertCapacities accessible to all for uDID, conv in pairs(convertCapacities) do @@ -80,7 +80,7 @@ local tableSort = table.sort ---------------------------------------------------------------- local function prototype(t) - local u = { } + local u = {} for k, v in pairs(t) do u[k] = v end @@ -194,7 +194,9 @@ function EmpedVector:process(currentFrame) for uID, frameID in pairs(self.unitBuffer) do if currentFrame >= frameID then UnitParalysisOver(uID, spGetUnitDefID(uID), spGetUnitTeam(uID)) - if not toRemove then toRemove = {} end + if not toRemove then + toRemove = {} + end removeCount = removeCount + 1 toRemove[removeCount] = uID end @@ -269,7 +271,6 @@ function gadget:Initialize() spSetTeamRulesParam(tID, mmCapacityParamName, 0) spSetTeamRulesParam(tID, mmUseParamName, 0) spSetTeamRulesParam(tID, mmAvgEffiParamName, teamEfficiencies[tID]:avg()) - end end @@ -288,12 +289,11 @@ function BuildeSteps() end end tableSort(eSteps, function(m1, m2) - return m1 > m2; + return m1 > m2 end) end function gadget:GameFrame(n) - -- process emped in the least likely used frame by the actual per team maker computations if n % resourceRefreshRate == resourceRefreshRate - 1 then currentFrameStamp = currentFrameStamp + 1 @@ -313,7 +313,7 @@ function gadget:GameFrame(n) if tpos <= teamListCount then tID = teamList[tpos] - local eCur, eStor = spGetTeamResources(tID, 'energy') + local eCur, eStor = spGetTeamResources(tID, "energy") local mmLevel = spGetTeamRulesParam(tID, mmLevelParamName) local convertAmount = eCur - eStor * mmLevel local eConverted, mConverted, teamUsages = 0, 0, 0 @@ -443,14 +443,16 @@ function gadget:UnitGiven(uID, uDefID, newTeam, oldTeam) capacity = oldUnitData.capacity, status = oldUnitData.status, emped = oldUnitData.emped, - built = oldUnitData.built + built = oldUnitData.built, } oldTeamMM[uID] = nil end function gadget:RecvLuaMsg(msg, playerID) - if string.byte(msg, 1) ~= 137 then return end -- fast guard: first byte must be char(137) + if string.byte(msg, 1) ~= 137 then + return + end -- fast guard: first byte must be char(137) local newLevel = tonumber(msg:match(alterLevelRegex)) if newLevel and newLevel >= 0 and newLevel <= 100 then local _, _, playerIsSpec, playerTeam = spGetPlayerInfo(playerID, false) diff --git a/luarules/gadgets/game_ffa_start_setup.lua b/luarules/gadgets/game_ffa_start_setup.lua index fbec20224cf..8031722e2df 100644 --- a/luarules/gadgets/game_ffa_start_setup.lua +++ b/luarules/gadgets/game_ffa_start_setup.lua @@ -8,21 +8,21 @@ context, and runs in one-shot before disabling itself. ]] if not Spring.Utilities.Gametype.IsFFA() or not gadgetHandler:IsSyncedCode() then - return + return end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'FFA start setup', - desc = 'Set up start points and start boxes for FFA and TeamFFA games', - author = 'nbusseneau', - date = '2023-08-19', - license = 'GPL-2.0-or-later', - layer = -1000, -- should run before anything else needs to call `GetAllyTeamStartBox` - enabled = true - } + return { + name = "FFA start setup", + desc = "Set up start points and start boxes for FFA and TeamFFA games", + author = "nbusseneau", + date = "2023-08-19", + license = "GPL-2.0-or-later", + layer = -1000, -- should run before anything else needs to call `GetAllyTeamStartBox` + enabled = true, + } end -- set default logging to INFO since it's kinda important to know when this @@ -33,144 +33,131 @@ Spring.SetLogSectionFilterLevel(gadget:GetInfo().name, LOG.INFO) -------------------------------------------------------------------------------- local function tryLoadConfigFromBAR(currentMapName) - local sanitizedCurrentMapName = currentMapName:gsub("_", " "):lower() - local configsDirectory = "luarules/configs/ffa_startpoints/" - local availableConfigFiles = VFS.DirList(configsDirectory, "*.lua") - - for _, configFile in pairs(availableConfigFiles) do - local basename = configFile:gsub(configsDirectory, ""):gsub(".lua", ""):gsub("_", " "):lower() - if string.find(sanitizedCurrentMapName, basename) then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - string.format("found FFA start points config %s provided by BAR for current map %s", configFile, currentMapName)) - return VFS.Include(configFile), true - end - end - return nil, false + local sanitizedCurrentMapName = currentMapName:gsub("_", " "):lower() + local configsDirectory = "luarules/configs/ffa_startpoints/" + local availableConfigFiles = VFS.DirList(configsDirectory, "*.lua") + + for _, configFile in pairs(availableConfigFiles) do + local basename = configFile:gsub(configsDirectory, ""):gsub(".lua", ""):gsub("_", " "):lower() + if string.find(sanitizedCurrentMapName, basename) then + Spring.Log(gadget:GetInfo().name, LOG.INFO, string.format("found FFA start points config %s provided by BAR for current map %s", configFile, currentMapName)) + return VFS.Include(configFile), true + end + end + return nil, false end local function tryLoadConfigFromMap(currentMapName) - local configFile = "luarules/configs/ffa_startpoints.lua" - if VFS.FileExists(configFile) then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - string.format("found FFA start points config %s provided by current map %s", configFile, - currentMapName)) - return VFS.Include(configFile), true - end - return nil, false + local configFile = "luarules/configs/ffa_startpoints.lua" + if VFS.FileExists(configFile) then + Spring.Log(gadget:GetInfo().name, LOG.INFO, string.format("found FFA start points config %s provided by current map %s", configFile, currentMapName)) + return VFS.Include(configFile), true + end + return nil, false end local function tryLoadConfig(currentMapName, requiredStartPointCount) - -- first, try to use the FFA start points config provided by BAR for current map, if available - local config, found = tryLoadConfigFromBAR(currentMapName) - -- failing that, try to use the FFA start points config provided by the map itself, if available - if not found then - config, found = tryLoadConfigFromMap(currentMapName) - end - if not found then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - string.format("did not find a FFA start points config for current map %s", currentMapName)) - return nil - end - - local layout = nil - - -- backwards compatibility layer - -- Previously, FFA start points configs were setting a "ffaStartPoints" global variable themselves, with logic - -- duplicated in every file. We now properly pass local variables up the stack via VFS.Include and handle logic only - -- here, but we also add additional backwards compatibility logic in case any such legacy start points config exists - -- in the wild. - if ffaStartPoints and ffaStartPoints[requiredStartPointCount] then - Spring.Log(gadget:GetInfo().name, LOG.WARNING, - string.format("backwards compatibility layer: using legacy FFA start points config for %s start points", - requiredStartPointCount)) - layout = ffaStartPoints[requiredStartPointCount] - end - - -- if a FFA start points config file has been found and a layout for the required number of start points is available - if config and config.startPoints and config.byAllyTeamCount and config.byAllyTeamCount[requiredStartPointCount] then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - string.format("using FFA start points config for %s start points", requiredStartPointCount)) - - -- pick a random layout from the ones available - local layouts = config.byAllyTeamCount[requiredStartPointCount] - local randomLayout = math.random(#(layouts)) - - -- map actual start points to the layout indexes - layout = {} - for i, startPointId in ipairs(layouts[randomLayout]) do - local startPoint = config.startPoints[startPointId] - layout[i] = { x = startPoint.x, z = startPoint.z } - end - end - - if not layout then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - string.format("did not find a layout for %s start points for current map %s", requiredStartPointCount, - currentMapName)) - return nil - elseif #layout ~= requiredStartPointCount then - Spring.Log(gadget:GetInfo().name, LOG.ERROR, - string.format("incorrect number of start points found in layout (actual: %s, expected: %s)", - #layout, requiredStartPointCount)) - Spring.Log(gadget:GetInfo().name, LOG.ERROR, "FFA start points config is malformed and will NOT be used") - return nil - else - return layout - end + -- first, try to use the FFA start points config provided by BAR for current map, if available + local config, found = tryLoadConfigFromBAR(currentMapName) + -- failing that, try to use the FFA start points config provided by the map itself, if available + if not found then + config, found = tryLoadConfigFromMap(currentMapName) + end + if not found then + Spring.Log(gadget:GetInfo().name, LOG.INFO, string.format("did not find a FFA start points config for current map %s", currentMapName)) + return nil + end + + local layout = nil + + -- backwards compatibility layer + -- Previously, FFA start points configs were setting a "ffaStartPoints" global variable themselves, with logic + -- duplicated in every file. We now properly pass local variables up the stack via VFS.Include and handle logic only + -- here, but we also add additional backwards compatibility logic in case any such legacy start points config exists + -- in the wild. + if ffaStartPoints and ffaStartPoints[requiredStartPointCount] then + Spring.Log(gadget:GetInfo().name, LOG.WARNING, string.format("backwards compatibility layer: using legacy FFA start points config for %s start points", requiredStartPointCount)) + layout = ffaStartPoints[requiredStartPointCount] + end + + -- if a FFA start points config file has been found and a layout for the required number of start points is available + if config and config.startPoints and config.byAllyTeamCount and config.byAllyTeamCount[requiredStartPointCount] then + Spring.Log(gadget:GetInfo().name, LOG.INFO, string.format("using FFA start points config for %s start points", requiredStartPointCount)) + + -- pick a random layout from the ones available + local layouts = config.byAllyTeamCount[requiredStartPointCount] + local randomLayout = math.random(#layouts) + + -- map actual start points to the layout indexes + layout = {} + for i, startPointId in ipairs(layouts[randomLayout]) do + local startPoint = config.startPoints[startPointId] + layout[i] = { x = startPoint.x, z = startPoint.z } + end + end + + if not layout then + Spring.Log(gadget:GetInfo().name, LOG.INFO, string.format("did not find a layout for %s start points for current map %s", requiredStartPointCount, currentMapName)) + return nil + elseif #layout ~= requiredStartPointCount then + Spring.Log(gadget:GetInfo().name, LOG.ERROR, string.format("incorrect number of start points found in layout (actual: %s, expected: %s)", #layout, requiredStartPointCount)) + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "FFA start points config is malformed and will NOT be used") + return nil + else + return layout + end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function setFFAStartPoints(allyTeamList) - -- try to find FFA start points for current map and desired number of start points - -- if found, try and get the layout matching the desired number of start points - local layout = tryLoadConfig(Game.mapName, #allyTeamList) - - if layout then - table.shuffle(layout) - - -- map layout to a list of start points for ally teams, and set it up in GG - -- for `game_initial_spawn` to use later when spawning units - GG.ffaStartPoints = {} - for i, allyTeamID in ipairs(allyTeamList) do - GG.ffaStartPoints[allyTeamID] = layout[i] - end - - Spring.Log(gadget:GetInfo().name, LOG.INFO, - "set up start points from FFA start points config for current map") - end + -- try to find FFA start points for current map and desired number of start points + -- if found, try and get the layout matching the desired number of start points + local layout = tryLoadConfig(Game.mapName, #allyTeamList) + + if layout then + table.shuffle(layout) + + -- map layout to a list of start points for ally teams, and set it up in GG + -- for `game_initial_spawn` to use later when spawning units + GG.ffaStartPoints = {} + for i, allyTeamID in ipairs(allyTeamList) do + GG.ffaStartPoints[allyTeamID] = layout[i] + end + + Spring.Log(gadget:GetInfo().name, LOG.INFO, "set up start points from FFA start points config for current map") + end end local function shuffleStartBoxes(allyTeamList) - local startBoxes = {} - for _, allyTeamID in pairs(allyTeamList) do - local xmin, zmin, xmax, zmax = Spring.GetAllyTeamStartBox(allyTeamID) - startBoxes[allyTeamID] = { xmin, zmin, xmax, zmax } - end - - table.shuffle(startBoxes, 0) - - for _, allyTeamID in pairs(allyTeamList) do - if startBoxes[allyTeamID] then - local xmin, zmin, xmax, zmax = unpack(startBoxes[allyTeamID]) - Spring.SetAllyTeamStartBox(allyTeamID, xmin, zmin, xmax, zmax) + local startBoxes = {} + for _, allyTeamID in pairs(allyTeamList) do + local xmin, zmin, xmax, zmax = Spring.GetAllyTeamStartBox(allyTeamID) + startBoxes[allyTeamID] = { xmin, zmin, xmax, zmax } end - end - Spring.Log(gadget:GetInfo().name, LOG.INFO, - "shuffled start boxes for ally teams (humans and AIs, but not Raptors and Scavengers)") + table.shuffle(startBoxes, 0) + + for _, allyTeamID in pairs(allyTeamList) do + if startBoxes[allyTeamID] then + local xmin, zmin, xmax, zmax = unpack(startBoxes[allyTeamID]) + Spring.SetAllyTeamStartBox(allyTeamID, xmin, zmin, xmax, zmax) + end + end + + Spring.Log(gadget:GetInfo().name, LOG.INFO, "shuffled start boxes for ally teams (humans and AIs, but not Raptors and Scavengers)") end function gadget:Initialize() - -- list of ally teams (humans and AIs, but not Raptors and Scavengers) - local allyTeamList = Spring.Utilities.GetAllyTeamList() + -- list of ally teams (humans and AIs, but not Raptors and Scavengers) + local allyTeamList = Spring.Utilities.GetAllyTeamList() - setFFAStartPoints(allyTeamList) - if Spring.GetModOptions().teamffa_start_boxes_shuffle then - shuffleStartBoxes(allyTeamList) - end + setFFAStartPoints(allyTeamList) + if Spring.GetModOptions().teamffa_start_boxes_shuffle then + shuffleStartBoxes(allyTeamList) + end - -- our job here is done :) - gadgetHandler:RemoveGadget(self) + -- our job here is done :) + gadgetHandler:RemoveGadget(self) end diff --git a/luarules/gadgets/game_fogofwar_remover.lua b/luarules/gadgets/game_fogofwar_remover.lua index a3a1f28de0c..a4948386e9b 100644 --- a/luarules/gadgets/game_fogofwar_remover.lua +++ b/luarules/gadgets/game_fogofwar_remover.lua @@ -10,25 +10,25 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "FogOfWarRemover", - desc = "123", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = gadgetEnabled, - } + return { + name = "FogOfWarRemover", + desc = "123", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = gadgetEnabled, + } end -local spGetAllyTeamList= Spring.GetAllyTeamList +local spGetAllyTeamList = Spring.GetAllyTeamList function gadget:GameFrame(n) - if n%1800 == 10 then - local allyteams = spGetAllyTeamList() - for i = 1,#allyteams do - local allyTeamID = allyteams[i] - Spring.SetGlobalLos(allyTeamID, true) - end - end + if n % 1800 == 10 then + local allyteams = spGetAllyTeamList() + for i = 1, #allyteams do + local allyTeamID = allyteams[i] + Spring.SetGlobalLos(allyTeamID, true) + end + end end diff --git a/luarules/gadgets/game_fps_broadcast.lua b/luarules/gadgets/game_fps_broadcast.lua index ee4297ffc3b..96365669b4d 100644 --- a/luarules/gadgets/game_fps_broadcast.lua +++ b/luarules/gadgets/game_fps_broadcast.lua @@ -1,14 +1,13 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "FPS Broadcast", - desc = "Broadcasts FramesPerSecond", - author = "Floris", - date = "July,2016", - license = "GNU GPL, v2 or later", - layer = 0, + name = "FPS Broadcast", + desc = "Broadcasts FramesPerSecond", + author = "Floris", + date = "July,2016", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end @@ -17,13 +16,12 @@ end -- config -------------------------------------------------------------------------------- -local sendPacketEvery = 2 +local sendPacketEvery = 2 -------------------------------------------------------------------------------- -- synced -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationFps = validation @@ -31,24 +29,23 @@ if gadgetHandler:IsSyncedCode() then local vb1, vb2 = string.byte(validation, 1, 2) function gadget:RecvLuaMsg(msg, playerID) - if #msg >= 3 and string.byte(msg,1)==at_b and string.byte(msg,2)==vb1 and string.byte(msg,3)==vb2 then - SendToUnsynced("fpsBroadcast",playerID,tonumber(msg:sub(4))) + if #msg >= 3 and string.byte(msg, 1) == at_b and string.byte(msg, 2) == vb1 and string.byte(msg, 3) == vb2 then + SendToUnsynced("fpsBroadcast", playerID, tonumber(msg:sub(4))) return true end end - else -------------------------------------------------------------------------------- -- unsynced -------------------------------------------------------------------------------- - local GetLastUpdateSeconds= Spring.GetLastUpdateSeconds - local SendLuaRulesMsg = Spring.SendLuaRulesMsg - local GetFPS = Spring.GetFPS + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetFPS = Spring.GetFPS - local updateTimer = 0 - local avgFps = GetFPS() - local numFrames = 0 + local updateTimer = 0 + local avgFps = GetFPS() + local numFrames = 0 local validation = SYNCED.validationFps function gadget:Initialize() @@ -59,22 +56,21 @@ else gadgetHandler:RemoveSyncAction("fpsBroadcast") end - function handleFpsEvent(_,playerID,fps) + function handleFpsEvent(_, playerID, fps) if Script.LuaUI("FpsEvent") then - Script.LuaUI.FpsEvent(playerID,fps) + Script.LuaUI.FpsEvent(playerID, fps) end end function gadget:Update() updateTimer = updateTimer + GetLastUpdateSeconds() numFrames = numFrames + 1 - avgFps = ((avgFps*(numFrames-1))+GetFPS()) / numFrames + avgFps = ((avgFps * (numFrames - 1)) + GetFPS()) / numFrames if updateTimer > sendPacketEvery then - SendLuaRulesMsg("@"..validation..math.floor(avgFps+0.5)) + SendLuaRulesMsg("@" .. validation .. math.floor(avgFps + 0.5)) updateTimer = 0 avgFps = 0 numFrames = 0 end end - end diff --git a/luarules/gadgets/game_frametime_broadcast.lua b/luarules/gadgets/game_frametime_broadcast.lua index abbf454a454..b555ee37bdf 100644 --- a/luarules/gadgets/game_frametime_broadcast.lua +++ b/luarules/gadgets/game_frametime_broadcast.lua @@ -2,26 +2,28 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Frame Time Broadcast", - desc = "Broadcasts per-client sim and draw frame times into the demo packet stream", - author = "bruno-dasilva", - date = "2026-04", + name = "Frame Time Broadcast", + desc = "Broadcasts per-client sim and draw frame times into the demo packet stream", + author = "bruno-dasilva", + date = "2026-04", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end local sendPacketEverySeconds = 2 -local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds +local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds local GetProfilerTimeRecord = Spring.GetProfilerTimeRecord -local SendLuaRulesMsg = Spring.SendLuaRulesMsg +local SendLuaRulesMsg = Spring.SendLuaRulesMsg local updateTimer = 0 -local simN, simSum, simPeak = 0, 0, 0 +local simN, simSum, simPeak = 0, 0, 0 local drawN, drawSum, drawPeak = 0, 0, 0 -- `total` (1st return) is a monotonic accumulator of time spent in the zone, @@ -29,12 +31,14 @@ local drawN, drawSum, drawPeak = 0, 0, 0 local prevSimTotal, prevDrawTotal function gadget:GameFrame(_) - local simTotal = GetProfilerTimeRecord("Sim", false) + local simTotal = GetProfilerTimeRecord("Sim", false) if prevSimTotal then - local simFrame = simTotal - prevSimTotal - simN = simN + 1 - simSum = simSum + simFrame - if simFrame > simPeak then simPeak = simFrame end + local simFrame = simTotal - prevSimTotal + simN = simN + 1 + simSum = simSum + simFrame + if simFrame > simPeak then + simPeak = simFrame + end end prevSimTotal = simTotal end @@ -45,19 +49,20 @@ function gadget:Update() local drawTotal = GetProfilerTimeRecord("Draw", false) if prevDrawTotal then local drawFrame = drawTotal - prevDrawTotal - drawN = drawN + 1 + drawN = drawN + 1 drawSum = drawSum + drawFrame - if drawFrame > drawPeak then drawPeak = drawFrame end + if drawFrame > drawPeak then + drawPeak = drawFrame + end end prevDrawTotal = drawTotal if updateTimer > sendPacketEverySeconds then - local avgSim = simN > 0 and (simSum / simN) or 0 + local avgSim = simN > 0 and (simSum / simN) or 0 local avgDraw = drawN > 0 and (drawSum / drawN) or 0 - SendLuaRulesMsg(string.format("#ft%d/%d/%.1f/%.1f/%.1f/%.1f", - simN, drawN, avgSim, simPeak, avgDraw, drawPeak)) + SendLuaRulesMsg(string.format("#ft%d/%d/%.1f/%.1f/%.1f/%.1f", simN, drawN, avgSim, simPeak, avgDraw, drawPeak)) updateTimer = 0 - simN, simSum, simPeak = 0, 0, 0 + simN, simSum, simPeak = 0, 0, 0 drawN, drawSum, drawPeak = 0, 0, 0 end end diff --git a/luarules/gadgets/game_initial_spawn.lua b/luarules/gadgets/game_initial_spawn.lua index fc8d8956109..705f9c55ead 100644 --- a/luarules/gadgets/game_initial_spawn.lua +++ b/luarules/gadgets/game_initial_spawn.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Initial Spawn', - desc = 'Handles initial spawning of units', - author = 'Niobium, nbusseneau, SethDGamre', - version = 'v2.0', - date = 'April 2011', - license = 'GNU GPL, v2 or later', + name = "Initial Spawn", + desc = "Handles initial spawning of units", + author = "Niobium, nbusseneau, SethDGamre", + version = "v2.0", + date = "April 2011", + license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -40,8 +40,8 @@ if gadgetHandler:IsSyncedCode() then ---------------------------------------------------------------- -- Config ---------------------------------------------------------------- - local changeStartUnitRegex = 'changeStartUnit(%d+)$' - local startUnitParamName = 'startUnit' + local changeStartUnitRegex = "changeStartUnit(%d+)$" + local startUnitParamName = "startUnit" local tooCloseToSpawn = 350 local allowEnemyAIPlacement = Spring.GetModOptions().allow_enemy_ai_spawn_placement or false @@ -59,12 +59,12 @@ if gadgetHandler:IsSyncedCode() then local SPAWN_CHOOSE_BEFORE_GAME = 1 local SPAWN_CHOOSE_IN_GAME = 2 - local READYSTATE_UNPLACED_UNREADY = 0 -- player did not place startpoint, is unready - local READYSTATE_READY = 1 -- game starting, player is ready - local READYSTATE_READY_FORCED = 2 -- player pressed ready OR game is starting and player is forcibly readied - local READYSTATE_FORCESTART_ABSENT = 3 -- game forcestarted & player absent - local READYSTATE_AUTO_READY = -1 -- players will not be allowed to place startpoints; automatically readied once ingame - local READYSTATE_PLACED_UNREADY = 4 -- player has placed a startpoint but is not yet ready + local READYSTATE_UNPLACED_UNREADY = 0 -- player did not place startpoint, is unready + local READYSTATE_READY = 1 -- game starting, player is ready + local READYSTATE_READY_FORCED = 2 -- player pressed ready OR game is starting and player is forcibly readied + local READYSTATE_FORCESTART_ABSENT = 3 -- game forcestarted & player absent + local READYSTATE_AUTO_READY = -1 -- players will not be allowed to place startpoints; automatically readied once ingame + local READYSTATE_PLACED_UNREADY = 4 -- player has placed a startpoint but is not yet ready local getValidRandom, isUnitValid @@ -81,7 +81,7 @@ if gadgetHandler:IsSyncedCode() then local function updateAIManualPlacement(teamID, x, z) if allowEnemyAIPlacement then if x and z then - spSetTeamRulesParam(teamID, "aiManualPlacement", x .. "," .. z, {public=true}) + spSetTeamRulesParam(teamID, "aiManualPlacement", x .. "," .. z, { public = true }) else spSetTeamRulesParam(teamID, "aiManualPlacement", nil) end @@ -95,9 +95,9 @@ if gadgetHandler:IsSyncedCode() then local legcomDefID = modoptions.experimentallegionfaction and UnitDefNames.legcom and UnitDefNames.legcom.id local armcomDefID = UnitDefNames.armcom and UnitDefNames.armcom.id local corcomDefID = UnitDefNames.corcom and UnitDefNames.corcom.id - local ARM_MASK = 2^0 - local COR_MASK = 2^1 - local LEG_MASK = 2^2 + local ARM_MASK = 2 ^ 0 + local COR_MASK = 2 ^ 1 + local LEG_MASK = 2 ^ 2 local FULL_BITMASK = mathBitOr(ARM_MASK, COR_MASK, LEG_MASK) local allyTeams = Spring.GetAllyTeamList() @@ -106,7 +106,7 @@ if gadgetHandler:IsSyncedCode() then local allyStartUnits = {} local unitsCount = 1 - local allyTeamBitmask = mathBitAnd(mathFloor(factionlimiter/2^(allyTeam*3)), FULL_BITMASK) + local allyTeamBitmask = mathBitAnd(mathFloor(factionlimiter / 2 ^ (allyTeam * 3)), FULL_BITMASK) allyTeamBitmask = allyTeamBitmask == 0 and FULL_BITMASK or allyTeamBitmask if legcomDefID then @@ -130,9 +130,9 @@ if gadgetHandler:IsSyncedCode() then local packedOptions = allyStartUnits[1] if unitsCount > 1 then for j = 2, #allyStartUnits do - packedOptions = packedOptions.."|"..allyStartUnits[j] + packedOptions = packedOptions .. "|" .. allyStartUnits[j] end - packedOptions = packedOptions.."|"..RANDOM_DUMMY + packedOptions = packedOptions .. "|" .. RANDOM_DUMMY end validStartUnits[allyTeam] = allyStartUnits @@ -160,19 +160,18 @@ if gadgetHandler:IsSyncedCode() then return true end end - else local armcomDefID = UnitDefNames.armcom and UnitDefNames.armcom.id if armcomDefID then - validStartUnits[#validStartUnits+1] = armcomDefID + validStartUnits[#validStartUnits + 1] = armcomDefID end local corcomDefID = UnitDefNames.corcom and UnitDefNames.corcom.id if corcomDefID then - validStartUnits[#validStartUnits+1] = corcomDefID + validStartUnits[#validStartUnits + 1] = corcomDefID end local legcomDefID = modoptions.experimentallegionfaction and UnitDefNames.legcom and UnitDefNames.legcom.id if legcomDefID then - validStartUnits[#validStartUnits+1] = legcomDefID + validStartUnits[#validStartUnits + 1] = legcomDefID end getValidRandom = function(allyTeamID) @@ -195,12 +194,11 @@ if gadgetHandler:IsSyncedCode() then local packedOptions = validStartUnits[1] if #validStartUnits > 1 then for j = 2, #validStartUnits do - packedOptions = packedOptions.."|"..validStartUnits[j] + packedOptions = packedOptions .. "|" .. validStartUnits[j] end - packedOptions = packedOptions.."|"..RANDOM_DUMMY + packedOptions = packedOptions .. "|" .. RANDOM_DUMMY end Spring.SetGameRulesParam("validStartUnits", packedOptions) - end end @@ -295,7 +293,7 @@ if gadgetHandler:IsSyncedCode() then else initState = 0 -- players will be allowed to place startpoints - if (draftMode ~= nil and draftMode ~= "disabled") then + if draftMode ~= nil and draftMode ~= "disabled" then draftModeInitialize() end end @@ -309,7 +307,6 @@ if gadgetHandler:IsSyncedCode() then --for _, playerID in pairs(playerList) do -- Spring.SetGameRulesParam("player_" .. playerID .. "_ready_status", 0) --end - end ---------------------------------------------------------------- @@ -380,11 +377,11 @@ if gadgetHandler:IsSyncedCode() then local aiAllyTeamID = select(6, Spring.GetTeamInfo(teamID, false)) - if playerIsSpec or (aiAllyTeamID ~= allyTeamID and not allowEnemyAIPlacement) then - return false - end + if playerIsSpec or (aiAllyTeamID ~= allyTeamID and not allowEnemyAIPlacement) then + return false + end - local isValid = validateSpawnPosition(x, z, teamID, playerID) + local isValid = validateSpawnPosition(x, z, teamID, playerID) if not isValid then local currentPos = startPointTable[teamID] @@ -403,7 +400,7 @@ if gadgetHandler:IsSyncedCode() then else local y = spGetGroundHeight(x, z) Spring.SetTeamStartPosition(teamID, x, y, z) - startPointTable[teamID] = {x, z} + startPointTable[teamID] = { x, z } updateAIManualPlacement(teamID, x, z) end return true @@ -430,18 +427,13 @@ if gadgetHandler:IsSyncedCode() then end if type == 2 then - return not (Spring.TestMoveOrder(unitDefID, x, y, z) and - Spring.TestMoveOrder(unitDefID, x, y, z, 1, 0, 0) and - Spring.TestMoveOrder(unitDefID, x, y, z, 0, 0, 1) and - Spring.TestMoveOrder(unitDefID, x, y, z,-1, 0, 0) and - Spring.TestMoveOrder(unitDefID, x, y, z, 0, 0,-1)) + return not (Spring.TestMoveOrder(unitDefID, x, y, z) and Spring.TestMoveOrder(unitDefID, x, y, z, 1, 0, 0) and Spring.TestMoveOrder(unitDefID, x, y, z, 0, 0, 1) and Spring.TestMoveOrder(unitDefID, x, y, z, -1, 0, 0) and Spring.TestMoveOrder(unitDefID, x, y, z, 0, 0, -1)) end return Spring.TestBuildOrder(unitDefID, x, y, z, "s") == 0 end function gadget:AllowStartPosition(playerID, teamID, readyState, x, y, z) - --[[ -- for debugging local name,_,_,tID = Spring.GetPlayerInfo(playerID,false) @@ -464,10 +456,12 @@ if gadgetHandler:IsSyncedCode() then end --fail local myTurn - if (draftMode ~= nil and draftMode ~= "disabled") then + if draftMode ~= nil and draftMode ~= "disabled" then local allowToPlace myTurn, allowToPlace = Draft_PreAllowStartPosition(teamID, allyTeamID) - if allowToPlace == false then return false end + if allowToPlace == false then + return false + end end -- The rest of the code remains untouched; it's a simple implementation -- don't allow player to place startpoint unless its inside the startbox, if we have a startbox @@ -485,15 +479,14 @@ if gadgetHandler:IsSyncedCode() then if xmin >= xmax or zmin >= zmax then -- no startbox defined, allow placement anywhere else - local isOutsideStartbox = (xmin + 1 >= x) or (x >= xmax - 1) or (zmin + 1 >= z) or - (z >= zmax - 1) -- the engine rounds startpoints to integers but does not round the startbox (wtf) + local isOutsideStartbox = (xmin + 1 >= x) or (x >= xmax - 1) or (zmin + 1 >= z) or (z >= zmax - 1) -- the engine rounds startpoints to integers but does not round the startbox (wtf) if isOutsideStartbox then return false end end end - if isFootingUntraversable(x,y,z, tonumber(spGetTeamRulesParam(teamID, startUnitParamName))) then + if isFootingUntraversable(x, y, z, tonumber(spGetTeamRulesParam(teamID, startUnitParamName))) then return false end @@ -533,7 +526,7 @@ if gadgetHandler:IsSyncedCode() then end end - if (draftMode ~= nil and draftMode ~= "disabled") then + if draftMode ~= nil and draftMode ~= "disabled" then Draft_PostAllowStartPosition(myTurn, allyTeamID) end return true @@ -587,7 +580,6 @@ if gadgetHandler:IsSyncedCode() then end end - if not scenarioSpawnsUnits then if not (luaAI and (string.find(luaAI, "Scavengers") or luaAI == "RaptorsAI")) then local unitID = spCreateUnit(startUnit, x, y, z, 0, teamID) @@ -678,7 +670,7 @@ if gadgetHandler:IsSyncedCode() then if guessedX and guessedZ then local y = spGetGroundHeight(guessedX, guessedZ) Spring.SetTeamStartPosition(teamID, guessedX, y, guessedZ) - startPointTable[teamID] = {guessedX, guessedZ} + startPointTable[teamID] = { guessedX, guessedZ } end end end @@ -694,14 +686,11 @@ if gadgetHandler:IsSyncedCode() then else -- otherwise default to spawning regularly if Game.startPosType == SPAWN_CHOOSE_IN_GAME then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - "manual spawning based on positions chosen by players in start boxes") + Spring.Log(gadget:GetInfo().name, LOG.INFO, "manual spawning based on positions chosen by players in start boxes") elseif Game.startPosType == SPAWN_CHOOSE_BEFORE_GAME then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - "automatic spawning using default map start positions, in random order") + Spring.Log(gadget:GetInfo().name, LOG.INFO, "automatic spawning using default map start positions, in random order") elseif Game.startPosType == SPAWN_FIXED then - Spring.Log(gadget:GetInfo().name, LOG.INFO, - "automatic spawning using default map start positions, in fixed order") + Spring.Log(gadget:GetInfo().name, LOG.INFO, "automatic spawning using default map start positions, in fixed order") end for teamID, allyTeamID in pairs(teams) do spawnRegularly(teamID, allyTeamID) @@ -712,33 +701,32 @@ if gadgetHandler:IsSyncedCode() then local lastGameFrame = 0 function gadget:GameFrame(n) if not scenarioSpawnsUnits then - if n == spawnInitialFrame then - - for i = 1, #startUnitList do - local x = startUnitList[i].x - local y = startUnitList[i].y - local z = startUnitList[i].z - Spring.SpawnCEG("commander-spawn", x, y, z, 0, 0, 0) - if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("commanderspawn", x, y, z) - end - if GG.ComSpawnDefoliate then + if n == spawnInitialFrame then + for i = 1, #startUnitList do + local x = startUnitList[i].x + local y = startUnitList[i].y + local z = startUnitList[i].z + Spring.SpawnCEG("commander-spawn", x, y, z, 0, 0, 0) + if GG.SpawnEnvironmentalLightning then + GG.SpawnEnvironmentalLightning("commanderspawn", x, y, z) + end + if GG.ComSpawnDefoliate then GG.ComSpawnDefoliate(x, y, z) end - end - end - if n == spawnWarpInFrame then - for i = 1, #startUnitList do - local unitID = startUnitList[i].unitID - Spring.MoveCtrl.Disable(unitID) - Spring.SetUnitNoDraw(unitID, false) - Spring.SetUnitHealth(unitID, { paralyze = 0 }) + end + end + if n == spawnWarpInFrame then + for i = 1, #startUnitList do + local unitID = startUnitList[i].unitID + Spring.MoveCtrl.Disable(unitID) + Spring.SetUnitNoDraw(unitID, false) + Spring.SetUnitHealth(unitID, { paralyze = 0 }) local unitBlocking = startUnitBlocking[unitID] if unitBlocking then Spring.SetUnitBlocking(unitID, unpack(unitBlocking)) end - end - end + end + end end -- for debug purpose -- if GG.SpawnEnvironmentalLightning then @@ -747,7 +735,7 @@ if gadgetHandler:IsSyncedCode() then -- for _, unitID in ipairs(Spring.GetAllUnits()) do -- local x, y, z = Spring.GetUnitPosition(unitID) -- GG.SpawnEnvironmentalLightning("commanderspawn", x, y, z) - -- Spring.SpawnCEG("commander-spawn", x, y, z, 0, 0, 0) + -- Spring.SpawnCEG("commander-spawn", x, y, z, 0, 0, 0) -- end -- end -- end @@ -760,8 +748,8 @@ if gadgetHandler:IsSyncedCode() then ------------------------------------------------------------------------------ else -- UNSYNCED local function positionTooClose(_, playerID) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.initialSpawn.tooClose') + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.initialSpawn.tooClose") Spring.SendMessageToPlayer(playerID, message) end end @@ -775,7 +763,7 @@ else -- UNSYNCED function gadget:GameFrame(n) if n == spawnInitialFrame then - Spring.PlaySoundFile("commanderspawn", 0.6, 'ui') + Spring.PlaySoundFile("commanderspawn", 0.6, "ui") end if n > spawnWarpInFrame then gadgetHandler:RemoveGadget(self) diff --git a/luarules/gadgets/game_logger.lua b/luarules/gadgets/game_logger.lua index 3dc1a5c2d74..e4f3eb2e07b 100644 --- a/luarules/gadgets/game_logger.lua +++ b/luarules/gadgets/game_logger.lua @@ -1,4 +1,3 @@ - if Spring.Utilities.Gametype.IsSinglePlayer() then return end @@ -6,24 +5,21 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Logger", - desc = "log certain events of interest", - author = "Floris", - date = "April 2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Logger", + desc = "log certain events of interest", + author = "Floris", + date = "April 2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationLog = validation - else - local spSendLuaRulesMsg = Spring.SendLuaRulesMsg local spAreTeamsAllied = Spring.AreTeamsAllied local validation = SYNCED.validationLog @@ -43,7 +39,7 @@ else local isDgun = {} for weaponDefID, weaponDef in pairs(WeaponDefs) do - if weaponDef.type == 'DGun' and weaponDef.damages then -- to filter out decoy comm -- and weaponDef.damage.default > 5000 + if weaponDef.type == "DGun" and weaponDef.damages then -- to filter out decoy comm -- and weaponDef.damage.default > 5000 for _, v in pairs(weaponDef.damages) do if v > 99000 then isDgun[weaponDefID] = true @@ -70,9 +66,7 @@ else -- Check if its a commander doing shenanigan to others eco units if (isEcoUnit[unitDefID] or isCommander[unitDefID]) and spAreTeamsAllied(unitTeam, attackerTeam) and isCommander[attackerDefID] then -- This is an 'only attack friendlies with commander' type thing - local msg = string.format("l0g%s:friendlyfire:%d:%s:%d:%d:%d", validation, - Spring.GetGameFrame(), 'ud', - unitTeam, attackerTeam, unitDefID) + local msg = string.format("l0g%s:friendlyfire:%d:%s:%d:%d:%d", validation, Spring.GetGameFrame(), "ud", unitTeam, attackerTeam, unitDefID) --Spring.Echo(msg) spSendLuaRulesMsg(msg) end @@ -82,10 +76,10 @@ else function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) if not mySpec and transportTeam == myTeamID and unitTeam ~= transportTeam and isCommander[unitDefID] then local _, _, _, isAiTeam = Spring.GetTeamInfo(unitTeam, false) - if isAiTeam then return end - local msg = string.format("l0g%s:allycommloaded:%d:%s:%d:%d:%d", validation, - Spring.GetGameFrame(), 'ud', - unitTeam, transportTeam, unitDefID) + if isAiTeam then + return + end + local msg = string.format("l0g%s:allycommloaded:%d:%s:%d:%d:%d", validation, Spring.GetGameFrame(), "ud", unitTeam, transportTeam, unitDefID) spSendLuaRulesMsg(msg) end end diff --git a/luarules/gadgets/game_message.lua b/luarules/gadgets/game_message.lua index df113cf78e7..3f38d098098 100644 --- a/luarules/gadgets/game_message.lua +++ b/luarules/gadgets/game_message.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Message", - desc = 'allow sending messages using the i18n library so everyone can see them in their own language', - author = 'Floris', - date = 'May 2024', - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true + name = "Message", + desc = "allow sending messages using the i18n library so everyone can see them in their own language", + author = "Floris", + date = "May 2024", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end @@ -20,7 +19,6 @@ local PACKET_HEADER_LENGTH = string.len(PACKET_HEADER) local PH_B1 = string.byte(PACKET_HEADER, 1) if gadgetHandler:IsSyncedCode() then - function gadget:RecvLuaMsg(msg, playerID) if #msg < PACKET_HEADER_LENGTH or string.byte(msg, 1) ~= PH_B1 or string.sub(msg, 1, PACKET_HEADER_LENGTH) ~= PACKET_HEADER then return @@ -28,14 +26,12 @@ if gadgetHandler:IsSyncedCode() then SendToUnsynced("sendMsg", playerID, string.sub(msg, 4)) return true end - -else -- UNSYNCED - +else -- UNSYNCED local function sendMsg(_, playerID, msg) - local name,_,spec,_,playerAllyTeamID = Spring.GetPlayerInfo(playerID, false) + local name, _, spec, _, playerAllyTeamID = Spring.GetPlayerInfo(playerID, false) local mySpec = Spring.GetSpectatingState() if not spec and (playerAllyTeamID == Spring.GetMyAllyTeamID() or mySpec) then - Spring.SendMessageToPlayer(Spring.GetMyPlayerID(), '<'..name..'> Allies: > '..msg) + Spring.SendMessageToPlayer(Spring.GetMyPlayerID(), "<" .. name .. "> Allies: > " .. msg) end end @@ -46,4 +42,3 @@ else -- UNSYNCED gadgetHandler:AddSyncAction("sendMsg") end end - diff --git a/luarules/gadgets/game_no_rush_mode.lua b/luarules/gadgets/game_no_rush_mode.lua index 84b828eed29..89c5344a5fd 100644 --- a/luarules/gadgets/game_no_rush_mode.lua +++ b/luarules/gadgets/game_no_rush_mode.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "No Rush Mode", - desc = "Stops players from executing commands out-of-their or within-an-enemy startbox for a set amount of time.", - author = "Damgam, Chemdude8", - date = "2026", + name = "No Rush Mode", + desc = "Stops players from executing commands out-of-their or within-an-enemy startbox for a set amount of time.", + author = "Damgam, Chemdude8", + date = "2026", license = "GNU GPL, v2 or later", - layer = -100, + layer = -100, enabled = Spring.GetModOptions().norushtimer > 0, } end @@ -22,7 +22,6 @@ local norushtimer = Spring.GetModOptions().norushtimer * 60 * Game.gameSpeed -- local confinedToBase = not Spring.GetModOptions().norushmiddlefree local teamToAllyTeamTable = {} - local CommandsToCatchMap = { -- CMDTYPES: ICON_MAP, ICON_AREA, ICON_UNIT_OR_MAP, ICON_UNIT_OR_AREA, ICON_UNIT_FEATURE_OR_AREA, ICON_BUILDING [CMD.MOVE] = true, [CMD.PATROL] = true, @@ -70,24 +69,24 @@ local function RushStartboxCheck(posx, posy, posz, allyTeamID) if confinedToBase then return positionCheckLibrary.StartboxCheck(posx, posy, posz, allyTeamID) end - return positionCheckLibrary.NotInEnemyStartboxCheck(posx, posy, posz, allyTeamID); + return positionCheckLibrary.NotInEnemyStartboxCheck(posx, posy, posz, allyTeamID) end for _, teamID in ipairs(Spring.GetTeamList()) do local teamLuaAI = Spring.GetTeamLuaAI(teamID) - if (teamLuaAI and LuaAIsToExclude[teamLuaAI]) then + if teamLuaAI and LuaAIsToExclude[teamLuaAI] then TeamIDsToExclude[teamID] = true end end if gadgetHandler:IsSyncedCode() then - local rushTimerComplete = false; + local rushTimerComplete = false function gadget:Initialize() gadgetHandler:RegisterAllowCommand(CMD.BUILD) local registered = { [CMD.BUILD] = true } - for _, commandList in ipairs { CommandsToCatchMap, CommandsToCatchUnit, CommandsToCatchFeature } do + for _, commandList in ipairs({ CommandsToCatchMap, CommandsToCatchUnit, CommandsToCatchFeature }) do for command in pairs(commandList) do if not registered[command] then gadgetHandler:RegisterAllowCommand(command) @@ -113,7 +112,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced) local allowed = true - if isNoRushRestricted() and (not TeamIDsToExclude[unitTeam]) then + if isNoRushRestricted() and not TeamIDsToExclude[unitTeam] then local _, _, _, _, _, allyTeamID = Spring.GetTeamInfo(unitTeam, false) if cmdID < 0 then @@ -128,10 +127,7 @@ if gadgetHandler:IsSyncedCode() then end if cmdParams[4] and not cmdParams[6] then -- might be map pos with radius, check radius range too - if not RushStartboxCheck(cmdParams[1] + cmdParams[4], cmdParams[2], cmdParams[3], allyTeamID) or - not RushStartboxCheck(cmdParams[1] - cmdParams[4], cmdParams[2], cmdParams[3], allyTeamID) or - not RushStartboxCheck(cmdParams[1], cmdParams[2], cmdParams[3] + cmdParams[4], allyTeamID) or - not RushStartboxCheck(cmdParams[1], cmdParams[2], cmdParams[3] - cmdParams[4], allyTeamID) then + if not RushStartboxCheck(cmdParams[1] + cmdParams[4], cmdParams[2], cmdParams[3], allyTeamID) or not RushStartboxCheck(cmdParams[1] - cmdParams[4], cmdParams[2], cmdParams[3], allyTeamID) or not RushStartboxCheck(cmdParams[1], cmdParams[2], cmdParams[3] + cmdParams[4], allyTeamID) or not RushStartboxCheck(cmdParams[1], cmdParams[2], cmdParams[3] - cmdParams[4], allyTeamID) then allowed = false end end @@ -161,9 +157,8 @@ if gadgetHandler:IsSyncedCode() then return allowed end - - function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, - attackerDefID, attackerTeam) + + function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) if not isNoRushRestricted() then return end diff --git a/luarules/gadgets/game_no_share_to_enemy.lua b/luarules/gadgets/game_no_share_to_enemy.lua index d18cbcdd2a4..3685bfcb04d 100644 --- a/luarules/gadgets/game_no_share_to_enemy.lua +++ b/luarules/gadgets/game_no_share_to_enemy.lua @@ -1,22 +1,22 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "game_no_share_to_enemy", - desc = "Disallows sharing to enemies", - author = "TheFatController", - date = "19 Jan 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "game_no_share_to_enemy", + desc = "Disallows sharing to enemies", + author = "TheFatController", + date = "19 Jan 2008", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- if not gadgetHandler:IsSyncedCode() then - return + return end local AreTeamsAllied = Spring.AreTeamsAllied @@ -24,26 +24,26 @@ local IsCheatingEnabled = Spring.IsCheatingEnabled local isNonPlayerTeam = { [Spring.GetGaiaTeamID()] = true } local teams = Spring.GetTeamList() -for i=1,#teams do - local _,_,_,isAiTeam = Spring.GetTeamInfo(teams[i],false) - local isLuaAI = (Spring.GetTeamLuaAI(teams[i]) ~= nil) - if isAiTeam or isLuaAI then - isNonPlayerTeam[teams[i]] = true - end +for i = 1, #teams do + local _, _, _, isAiTeam = Spring.GetTeamInfo(teams[i], false) + local isLuaAI = (Spring.GetTeamLuaAI(teams[i]) ~= nil) + if isAiTeam or isLuaAI then + isNonPlayerTeam[teams[i]] = true + end end function gadget:AllowResourceTransfer(oldTeam, newTeam, type, amount) - if isNonPlayerTeam[oldTeam] or AreTeamsAllied(newTeam, oldTeam) or IsCheatingEnabled() then - return true - end + if isNonPlayerTeam[oldTeam] or AreTeamsAllied(newTeam, oldTeam) or IsCheatingEnabled() then + return true + end - return false + return false end function gadget:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) - if isNonPlayerTeam[oldTeam] or AreTeamsAllied(newTeam, oldTeam) or capture or IsCheatingEnabled() then - return true - end + if isNonPlayerTeam[oldTeam] or AreTeamsAllied(newTeam, oldTeam) or capture or IsCheatingEnabled() then + return true + end - return false -end \ No newline at end of file + return false +end diff --git a/luarules/gadgets/game_prevent_excessive_share.lua b/luarules/gadgets/game_prevent_excessive_share.lua index 2b8a5885584..376803069eb 100644 --- a/luarules/gadgets/game_prevent_excessive_share.lua +++ b/luarules/gadgets/game_prevent_excessive_share.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Prevent Excessive Share', - desc = 'Prevents sharing more resources or units than the receiver can hold', - author = 'Niobium', - date = 'April 2012', - license = 'GNU GPL, v2 or later', - layer = 2, -- after 'Tax Resource Sharing' - enabled = true + name = "Prevent Excessive Share", + desc = "Prevents sharing more resources or units than the receiver can hold", + author = "Niobium", + date = "April 2012", + license = "GNU GPL, v2 or later", + layer = 2, -- after 'Tax Resource Sharing' + enabled = true, } end @@ -29,10 +29,10 @@ function gadget:AllowResourceTransfer(senderTeamId, receiverTeamId, resourceType -- Spring uses 'm' and 'e' instead of the full names that we need, so we need to convert the resourceType -- We also check for 'metal' or 'energy' incase Spring decides to use those in a later version local resourceName - if (resourceType == 'm') or (resourceType == 'metal') then - resourceName = 'metal' - elseif (resourceType == 'e') or (resourceType == 'energy') then - resourceName = 'energy' + if (resourceType == "m") or (resourceType == "metal") then + resourceName = "metal" + elseif (resourceType == "e") or (resourceType == "energy") then + resourceName = "energy" else -- We don't handle whatever this resource is, allow it return true diff --git a/luarules/gadgets/game_quick_start.lua b/luarules/gadgets/game_quick_start.lua index 664162866af..057a0ea9e31 100644 --- a/luarules/gadgets/game_quick_start.lua +++ b/luarules/gadgets/game_quick_start.lua @@ -6,53 +6,49 @@ function gadget:GetInfo() date = "July 2025", license = "GPLv2", layer = 0, - enabled = true + enabled = true, } end local isSynced = gadgetHandler:IsSyncedCode() local modOptions = Spring.GetModOptions() -if not isSynced then return false end -local shouldRunGadget = modOptions and modOptions.quick_start and ( - modOptions.quick_start == "enabled" or - modOptions.quick_start == "factory_discount" or - modOptions.quick_start == "factory_discount_only" or - (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) -) -if not shouldRunGadget then return false end +if not isSynced then + return false +end +local shouldRunGadget = modOptions and modOptions.quick_start and (modOptions.quick_start == "enabled" or modOptions.quick_start == "factory_discount" or modOptions.quick_start == "factory_discount_only" or (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination"))) +if not shouldRunGadget then + return false +end local overridesEnabled = modOptions.enable_quickstart_overrides local overrideQuickStartBudget = overridesEnabled and tonumber(modOptions.override_quick_start_budget) -local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" or - modOptions.quick_start == "factory_discount_only" or - (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) - +local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" or modOptions.quick_start == "factory_discount_only" or (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) local FACTORY_DISCOUNT_MULTIPLIER = 0.90 -- The factory discount will be the budget cost of the cheapest listed factory multiplied by this value. -local QUICK_START_COST_ENERGY = 400 --will be deducted from commander's energy upon start. -local QUICK_START_COST_METAL = 800 --will be deducted from commander's metal upon start. -local READY_REFUNDABLE_BUDGET = 800 -- Budget threshold when players are allowed to "ready" the game +local QUICK_START_COST_ENERGY = 400 --will be deducted from commander's energy upon start. +local QUICK_START_COST_METAL = 800 --will be deducted from commander's metal upon start. +local READY_REFUNDABLE_BUDGET = 800 -- Budget threshold when players are allowed to "ready" the game local quickStartAmountConfig = { small = { budget = 800, range = 435, baseGenerationRange = 435, - traversabilityGridRange = 480 --must match the value in gui_quick_start.lua. It has to be slightly larger than the instant build range to account for traversability_grid snapping at TRAVERSABILITY_GRID_RESOLUTION intervals + traversabilityGridRange = 480, --must match the value in gui_quick_start.lua. It has to be slightly larger than the instant build range to account for traversability_grid snapping at TRAVERSABILITY_GRID_RESOLUTION intervals }, normal = { budget = 1200, range = 435, baseGenerationRange = 435, - traversabilityGridRange = 480 + traversabilityGridRange = 480, }, large = { budget = 2400, range = 600, baseGenerationRange = 500, - traversabilityGridRange = 544 + traversabilityGridRange = 544, }, } @@ -72,11 +68,11 @@ local INSTANT_BUILD_RANGE = overrideQuickStartRange or selectedConfig.range local BASE_GENERATION_RANGE = selectedConfig.baseGenerationRange local TRAVERSABILITY_GRID_GENERATION_RANGE = selectedConfig.traversabilityGridRange -local BUILD_TIME_VALUE_CONVERSION_MULTIPLIER = 1/300 --300 being a representative of commander workertime, statically defined so future com unitdef adjustments don't change this. -local ENERGY_VALUE_CONVERSION_MULTIPLIER = 1/60 --60 being the energy conversion rate of t2 energy converters, statically defined so future changes not to affect this. -local aestheticCustomCostRound = VFS.Include('common/aestheticCustomCostRound.lua') +local BUILD_TIME_VALUE_CONVERSION_MULTIPLIER = 1 / 300 --300 being a representative of commander workertime, statically defined so future com unitdef adjustments don't change this. +local ENERGY_VALUE_CONVERSION_MULTIPLIER = 1 / 60 --60 being the energy conversion rate of t2 energy converters, statically defined so future changes not to affect this. +local aestheticCustomCostRound = VFS.Include("common/aestheticCustomCostRound.lua") local customRound = aestheticCustomCostRound.customRound -local windFunctions = VFS.Include('common/wind_functions.lua') +local windFunctions = VFS.Include("common/wind_functions.lua") ------------------------------------------------------------------------- @@ -127,9 +123,9 @@ local atan2 = math.atan2 local sin = math.sin local cos = math.cos -local config = VFS.Include('LuaRules/Configs/quick_start_build_defs.lua') -local traversabilityGrid = VFS.Include('common/traversability_grid.lua') -local overlapLines = VFS.Include('common/overlap_lines.lua') +local config = VFS.Include("LuaRules/Configs/quick_start_build_defs.lua") +local traversabilityGrid = VFS.Include("common/traversability_grid.lua") +local overlapLines = VFS.Include("common/overlap_lines.lua") local commanderNonLabOptions = config.commanderNonLabOptions local discountableFactories = config.discountableFactories local optionsToNodeType = config.optionsToNodeType @@ -155,7 +151,7 @@ local buildsInProgress = {} GG.quick_start = {} function GG.quick_start.transferCommanderData(oldUnitID, newUnitID) - if oldUnitID and newUnitID and spValidUnitID(oldUnitID) and spValidUnitID(newUnitID) then + if oldUnitID and newUnitID and spValidUnitID(oldUnitID) and spValidUnitID(newUnitID) then buildsInProgress[newUnitID] = buildsInProgress[oldUnitID] buildsInProgress[oldUnitID] = nil @@ -168,15 +164,13 @@ function GG.quick_start.transferCommanderData(oldUnitID, newUnitID) end local function getBuildSequence(isMetalMap, isInWater, isGoodWind) - return config.buildSequence[isMetalMap and "metalMap" or "nonMetalMap"][isInWater and "water" or "land"] - [isGoodWind and "goodWind" or "badWind"] + return config.buildSequence[isMetalMap and "metalMap" or "nonMetalMap"][isInWater and "water" or "land"][isGoodWind and "goodWind" or "badWind"] end local function generateLocalGrid(commanderID) local comData = commanders[commanderID] local originX, originY, originZ = comData.spawnX, comData.spawnY, comData.spawnZ - local buildDefID = comData.isInWater and (comData.buildDefs and comData.buildDefs.tidal) or - (comData.buildDefs and comData.buildDefs.windmill) + local buildDefID = comData.isInWater and (comData.buildDefs and comData.buildDefs.tidal) or (comData.buildDefs and comData.buildDefs.windmill) if not buildDefID then return {} end @@ -258,13 +252,13 @@ end local function calculateCheapestEconomicStructure() local cheapestCost = math.huge local uniqueUnitNames = {} - + for commanderName, nonLabOptions in pairs(commanderNonLabOptions) do for optionName, unitName in pairs(nonLabOptions) do uniqueUnitNames[unitName] = true end end - + for unitName, _ in pairs(uniqueUnitNames) do if unitDefNames[unitName] then local unitDefID = unitDefNames[unitName].id @@ -274,7 +268,7 @@ local function calculateCheapestEconomicStructure() end end end - + return cheapestCost == math.huge and 0 or cheapestCost end @@ -282,11 +276,16 @@ local function isBuildCommand(cmdID) return cmdID < 0 end - local function getFactoryDiscount(unitDef, builderID) - if not shouldApplyFactoryDiscount then return 0 end - if not unitDef or not unitDef.isFactory then return 0 end - if commanderFactoryDiscounts[builderID] and commanderFactoryDiscounts[builderID] == true then return 0 end + if not shouldApplyFactoryDiscount then + return 0 + end + if not unitDef or not unitDef.isFactory then + return 0 + end + if commanderFactoryDiscounts[builderID] and commanderFactoryDiscounts[builderID] == true then + return 0 + end return FACTORY_DISCOUNT end @@ -303,14 +302,16 @@ end local function generateOverlapLines(commanderID) local comData = commanders[commanderID] - if not comData then return end + if not comData then + return + end local neighbors = {} for _, otherTeamID in ipairs(allTeamsList) do if otherTeamID ~= comData.teamID and Spring.AreTeamsAllied(comData.teamID, otherTeamID) then local sx, sy, sz = Spring.GetTeamStartPosition(otherTeamID) if sx and sx >= 0 then -- Check for valid start pos (allow 0, ignore -100) - table.insert(neighbors, {x = sx, z = sz}) + table.insert(neighbors, { x = sx, z = sz }) end end end @@ -347,33 +348,33 @@ local function getCommanderBuildQueue(commanderID) traversableCheck = isTraversable, notPastLinesCheck = not isPastFriendlyLines, distance = distance, - maxDistance = INSTANT_BUILD_RANGE + maxDistance = INSTANT_BUILD_RANGE, } if distance <= INSTANT_BUILD_RANGE and isTraversable and not isPastFriendlyLines then local budgetCost = defMetergies[unitDefID] or 0 - + local currentDiscount = 0 if shouldApplyFactoryDiscount and unitDef.isFactory and not discountUsedLocal then currentDiscount = FACTORY_DISCOUNT end - + budgetCost = max(budgetCost - currentDiscount, 0) - + if currentDiscount > 0 then discountUsedLocal = true end table.insert(spawnQueue, spawnParams) comData.hasBuildsIntercepted = true - + totalBudgetCost = totalBudgetCost + budgetCost if totalBudgetCost > comData.budget then Spring.Echo(string.format(" [%d] %s at (%.1f, %.1f, %.1f) facing: %d - REJECTED (Budget exceeded: %.1f > %.1f)", i, unitDefName, spawnParams.x, spawnParams.y, spawnParams.z, spawnParams.facing, totalBudgetCost, comData.budget)) comData.commandsToRemove = commandsToRemove return spawnQueue end - + if cmd.tag then table.insert(commandsToRemove, cmd.tag) end @@ -400,7 +401,9 @@ end local function refreshAndCheckAvailableMexSpots(commanderID) local comData = commanders[commanderID] - if not comData or isMetalMap then return end + if not comData or isMetalMap then + return + end if not comData.nearbyMexes or #comData.nearbyMexes == 0 then return false @@ -437,7 +440,7 @@ local function getBuildSpace(commanderID, option) while #gridList > 0 do local candidate = gridList[1] table.remove(gridList, 1) - + if candidate.x and candidate.y and candidate.z then local unitDefID = comData.buildDefs[option] if unitDefID then @@ -451,14 +454,14 @@ local function getBuildSpace(commanderID, option) end end end - + comData.gridLists[nodeType] = gridList return nil, nil, nil else while comData.nearbyMexes and #comData.nearbyMexes > 0 do local mexSpot = comData.nearbyMexes[1] table.remove(comData.nearbyMexes, 1) - + if mexSpot.x and mexSpot.y and mexSpot.z then local mexDefID = comData.buildDefs.mex if mexDefID then @@ -508,7 +511,7 @@ local function generateBaseNodesFromLocalGrid(commanderID, localGrid) local spawnX, spawnZ = comData.spawnX, comData.spawnZ local nodes = createBaseNodes(spawnX, spawnZ) populateNodeGrids(nodes, localGrid) - + local minDistance = math.huge local maxDistance = 0 for i = 1, #nodes do @@ -516,7 +519,7 @@ local function generateBaseNodesFromLocalGrid(commanderID, localGrid) minDistance = min(minDistance, node.distanceFromCenter) maxDistance = max(maxDistance, node.distanceFromCenter) end - + for i = 1, #nodes do local node = nodes[i] local MIN_CENTER_WEIGHT, MAX_CENTER_WEIGHT = 0.5, 1.0 @@ -530,7 +533,7 @@ local function generateBaseNodesFromLocalGrid(commanderID, localGrid) end node.resultantScore = centerWeight * averageDistance end - + local selectedPair local bestResultantScore = math.huge for i = 1, BASE_NODE_COUNT do @@ -559,7 +562,7 @@ local function generateBaseNodesFromLocalGrid(commanderID, localGrid) converterKeys[p.x .. "_" .. p.z] = true end end - + local filteredOther = {} for i = 1, #localGrid do local p = localGrid[i] @@ -567,15 +570,19 @@ local function generateBaseNodesFromLocalGrid(commanderID, localGrid) table.insert(filteredOther, p) end end - + for i = 1, #filteredConverter do filteredConverter[i].d = distance2d(filteredConverter[i].x, filteredConverter[i].z, converterNode.x, converterNode.z) end for i = 1, #filteredOther do filteredOther[i].d = distance2d(filteredOther[i].x, filteredOther[i].z, otherNode.x, otherNode.z) end - table.sort(filteredConverter, function(a, b) return a.d < b.d end) - table.sort(filteredOther, function(a, b) return a.d < b.d end) + table.sort(filteredConverter, function(a, b) + return a.d < b.d + end) + table.sort(filteredOther, function(a, b) + return a.d < b.d + end) return { other = { x = otherNode.x, z = otherNode.z, grid = filteredOther }, converters = { x = converterNode.x, z = converterNode.z, grid = filteredConverter } } end @@ -603,13 +610,15 @@ local function populateNearbyMexes(commanderID) x = metalSpot.x, y = metalSpot.y, z = metalSpot.z, - distance = distance + distance = distance, }) end end end if #comData.nearbyMexes > 1 then - table.sort(comData.nearbyMexes, function(a, b) return a.distance < b.distance end) + table.sort(comData.nearbyMexes, function(a, b) + return a.distance < b.distance + end) end end @@ -666,7 +675,7 @@ local function initializeCommander(commanderID, teamID) nearbyMexes = {}, lastCommanderX = nil, lastCommanderZ = nil, - unitDefID = commanderDefID + unitDefID = commanderDefID, } Spring.SetTeamResource(teamID, "metal", max(0, currentMetal - QUICK_START_COST_METAL)) @@ -716,7 +725,7 @@ local function generateBuildCommands(commanderID) local cost = defMetergies[unitDefID] - discount local shouldQueue = true - if ((buildType == "mex" and not isMetalMap) and not refreshAndCheckAvailableMexSpots(commanderID)) then + if (buildType == "mex" and not isMetalMap) and not refreshAndCheckAvailableMexSpots(commanderID) then shouldQueue = false elseif comData.hasBuildsIntercepted and budgetRemaining <= READY_REFUNDABLE_BUDGET or cost > budgetRemaining then shouldQueue = false @@ -742,7 +751,6 @@ local function generateBuildCommands(commanderID) end end - local function removeCommanderCommands(commanderID) local comData = commanders[commanderID] if comData and comData.commandsToRemove and #comData.commandsToRemove > 0 then @@ -852,7 +860,7 @@ function gadget:GameFrame(frame) local failReasonsStr = table.concat(failReasons, ", ") local coordsStr = buildItem.x and string.format("(%.1f, %.1f, %.1f)", buildItem.x, buildItem.y or 0, buildItem.z) or "(no coords)" Spring.Echo(string.format(" SPAWN SKIPPED: %s at %s facing: %d - %s", unitDefName, coordsStr, facing, failReasonsStr)) - end + end end end end @@ -889,7 +897,7 @@ function gadget:GameFrame(frame) end elseif buildData.targetProgress > buildData.addedProgress then buildData.addedProgress = buildData.addedProgress + buildData.rate - spSetUnitHealth(unitID, { build = buildData.addedProgress, health = ceil(buildData.maxHealth * buildData.addedProgress)}) + spSetUnitHealth(unitID, { build = buildData.addedProgress, health = ceil(buildData.maxHealth * buildData.addedProgress) }) end end @@ -925,7 +933,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) local unitDef = unitDefs[unitDefID] local discount = not Spring.GetTeamRulesParam(unitTeam, "quickStartFactoryDiscountUsed") and getFactoryDiscount(unitDef, builderID) or 0 - if discount > 0 and builderID then + if discount > 0 and builderID then if builderID then commanderFactoryDiscounts[builderID] = true end diff --git a/luarules/gadgets/game_replace_afk_players.lua b/luarules/gadgets/game_replace_afk_players.lua index 585a6212fad..e9d06d02411 100644 --- a/luarules/gadgets/game_replace_afk_players.lua +++ b/luarules/gadgets/game_replace_afk_players.lua @@ -16,7 +16,7 @@ function gadget:GetInfo() date = "June 2014", license = "GNU GPL, v2 or later", layer = 2, --run after game initial spawn and coop (because we use readyStates) - enabled = false + enabled = false, } end @@ -28,7 +28,6 @@ if numPlayers <= 4 then end if gadgetHandler:IsSyncedCode() then - -- TS difference required for substitutions -- idealDiff is used if possible, validDiff as fall-back, otherwise no local validDiff = 6 @@ -47,20 +46,20 @@ if gadgetHandler:IsSyncedCode() then local SpIsCheatingEnabled = Spring.IsCheatingEnabled function gadget:RecvLuaMsg(msg, playerID) - local checkChange = (msg == '\144' or msg == '\145') + local checkChange = (msg == "\144" or msg == "\145") - if msg == '\145' then + if msg == "\145" then substitutes[playerID] = nil end - if msg == '\144' then + if msg == "\144" then -- do the same eligibility check as in unsynced local customtable = select(11, Spring.GetPlayerInfo(playerID)) - if type(customtable) == 'table' then + if type(customtable) == "table" then local tsMu = customtable.skill local tsSigma = customtable.skilluncertainty local ts = tsMu and tonumber(tsMu:match("%d+%.?%d*")) tsSigma = tonumber(tsSigma) - local eligible = tsMu and tsSigma and (tsSigma <= 2) and (not string.find(tsMu, ")", nil, true)) and (not players[playerID]) + local eligible = tsMu and tsSigma and (tsSigma <= 2) and (not string.find(tsMu, ")", nil, true)) and not players[playerID] if eligible then substitutes[playerID] = ts end @@ -107,7 +106,7 @@ if gadgetHandler:IsSyncedCode() then local _, active, spec = Spring.GetPlayerInfo(playerID, false) local readyState = Spring.GetGameRulesParam("player_" .. playerID .. "_readyState") local noStartPoint = (readyState == 3) or (readyState == 0) - local present = active and (not spec) and (not noStartPoint) + local present = active and not spec and not noStartPoint if not present then local customtable = select(11, Spring.GetPlayerInfo(playerID)) or {} local tsMu = customtable.skill @@ -168,7 +167,6 @@ if gadgetHandler:IsSyncedCode() then -- tell luaui that if would substitute if the game started now Spring.SetGameRulesParam("Player" .. playerID .. "willSub", wouldSub and 1 or 0) end - end function gadget:GameStart() @@ -238,7 +236,6 @@ if gadgetHandler:IsSyncedCode() then -- ForceSpec(jID) -- currently this is no use, because players who joinas see themselves as always having been present, so it doesn't get called... end - else ----------------------------- -- UNSYNCED @@ -265,8 +262,8 @@ else end local function substitutionOccurred(_, incoming, outgoing) - if Script.LuaUI('GadgetMessageProxy') then - Spring.Echo( Script.LuaUI.GadgetMessageProxy('ui.substitutePlayers.substitutedPlayers', { incoming = incoming, outgoing = outgoing }) ) + if Script.LuaUI("GadgetMessageProxy") then + Spring.Echo(Script.LuaUI.GadgetMessageProxy("ui.substitutePlayers.substitutedPlayers", { incoming = incoming, outgoing = outgoing })) end end @@ -285,8 +282,8 @@ else if n < 5 then return end - if revealed and Script.LuaUI('GadgetMessageProxy') then - Spring.Echo( Script.LuaUI.GadgetMessageProxy('ui.substitutePlayers.substituted') ) + if revealed and Script.LuaUI("GadgetMessageProxy") then + Spring.Echo(Script.LuaUI.GadgetMessageProxy("ui.substitutePlayers.substituted")) end gadgetHandler:RemoveGadget() end @@ -304,5 +301,4 @@ else gadgetHandler:RemoveSyncAction("SubstitutionOccurred") --gadgetHandler:RemoveSyncAction("ForceSpec") end - end diff --git a/luarules/gadgets/game_restart_with_state.lua b/luarules/gadgets/game_restart_with_state.lua index 60815d2f146..216598cff5f 100644 --- a/luarules/gadgets/game_restart_with_state.lua +++ b/luarules/gadgets/game_restart_with_state.lua @@ -6,13 +6,13 @@ end function gadget:GetInfo() return { - name = "Restart With State", - desc = "Saves all units, their states and command queues, restarts the game, then restores them", - author = "Floris", - date = "May 2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Restart With State", + desc = "Saves all units, their states and command queues, restarts the game, then restores them", + author = "Floris", + date = "May 2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -27,8 +27,6 @@ end 5. Best used in singleplayer. Reading raw-filesystem state in synced will desync multiplayer. ]] - - local STATE_FILE = "LuaUI/Config/restart_state.lua" -- minimal Lua-table serializer for the types we actually store: nil/number/boolean/string/table @@ -75,422 +73,446 @@ end ------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- - -local CHUNK_SIZE = 8000 - --- Commands that always target a unit (any number of params) -local UNIT_TARGET_ALWAYS = { [CMD.GUARD] = true } --- Commands that target a unit only when given with exactly 1 parameter -local UNIT_TARGET_SINGLE = { [CMD.ATTACK] = true, [CMD.REPAIR] = true } --- Wait-family commands carry OPT_INTERNAL while "active" (the engine flips it on --- once the wait is being processed). We still want to restore them, so exempt --- them from the OPT_INTERNAL skip below. -local WAIT_CMDS = { - [CMD.WAIT] = true, - [CMD.TIMEWAIT] = true, - [CMD.DEATHWAIT] = true, - [CMD.SQUADWAIT] = true, - [CMD.GATHERWAIT] = true, -} --- Commands that take no parameters and so must be re-issued with an empty --- params table; the engine flips their OPT_INTERNAL bit on while "active" --- (counting down / paused), so we also strip that bit before re-issuing. -local NO_PARAM_CMDS = { - [CMD.WAIT] = true, - [CMD.STOP] = true, - [CMD.SELFD] = true, -} - -local pendingRestore = nil -local restoreFrame = nil -local restoreBuffer = nil -- reassembly buffer for data arriving from LuaUI - -local function collectUnitState() - local data = { - gameFrame = Spring.GetGameFrame(), - units = {}, + ------------------------------------------------------------------------------- + + local CHUNK_SIZE = 8000 + + -- Commands that always target a unit (any number of params) + local UNIT_TARGET_ALWAYS = { [CMD.GUARD] = true } + -- Commands that target a unit only when given with exactly 1 parameter + local UNIT_TARGET_SINGLE = { [CMD.ATTACK] = true, [CMD.REPAIR] = true } + -- Wait-family commands carry OPT_INTERNAL while "active" (the engine flips it on + -- once the wait is being processed). We still want to restore them, so exempt + -- them from the OPT_INTERNAL skip below. + local WAIT_CMDS = { + [CMD.WAIT] = true, + [CMD.TIMEWAIT] = true, + [CMD.DEATHWAIT] = true, + [CMD.SQUADWAIT] = true, + [CMD.GATHERWAIT] = true, + } + -- Commands that take no parameters and so must be re-issued with an empty + -- params table; the engine flips their OPT_INTERNAL bit on while "active" + -- (counting down / paused), so we also strip that bit before re-issuing. + local NO_PARAM_CMDS = { + [CMD.WAIT] = true, + [CMD.STOP] = true, + [CMD.SELFD] = true, } - local allUnits = Spring.GetAllUnits() - -- Map each nanoframe that is actively being built to its builder. Nanoframes - -- with a builder are skipped on save; the builder's own command queue - -- (factory build orders / Repair / Guard) will recreate them after restart. - local beingBuilt = {} - for i = 1, #allUnits do - local bID = allUnits[i] - local targetID = Spring.GetUnitIsBuilding and Spring.GetUnitIsBuilding(bID) - if targetID then - beingBuilt[targetID] = bID + + local pendingRestore = nil + local restoreFrame = nil + local restoreBuffer = nil -- reassembly buffer for data arriving from LuaUI + + local function collectUnitState() + local data = { + gameFrame = Spring.GetGameFrame(), + units = {}, + } + local allUnits = Spring.GetAllUnits() + -- Map each nanoframe that is actively being built to its builder. Nanoframes + -- with a builder are skipped on save; the builder's own command queue + -- (factory build orders / Repair / Guard) will recreate them after restart. + local beingBuilt = {} + for i = 1, #allUnits do + local bID = allUnits[i] + local targetID = Spring.GetUnitIsBuilding and Spring.GetUnitIsBuilding(bID) + if targetID then + beingBuilt[targetID] = bID + end end - end - for i = 1, #allUnits do - local uID = allUnits[i] - local uDefID = Spring.GetUnitDefID(uID) - if uDefID then - local uDef = UnitDefs[uDefID] - local x, y, z = Spring.GetUnitPosition(uID) - local transporter = Spring.GetUnitTransporter and Spring.GetUnitTransporter(uID) - -- Skip units without a valid world position (nil), that are being - -- transported (their reported position is the transport's, not theirs), - -- or nanoframes that have an active builder (the builder's queue will - -- recreate them). - if x and not transporter and not beingBuilt[uID] then - local health, maxHealth, _, _, buildProgress = Spring.GetUnitHealth(uID) - local teamID = Spring.GetUnitTeam(uID) - local heading = Spring.GetUnitHeading(uID) or 0 - local buildFacing = Spring.GetUnitBuildFacing(uID) - local exp = Spring.GetUnitExperience(uID) or 0 - local states = Spring.GetUnitStates(uID) or {} - -- Builder Priority (low/high) is a custom command; the gadget stores - -- the active value in the "builderPriority" rules param (0=low, 1=high). - local builderPriority = Spring.GetUnitRulesParam(uID, "builderPriority") - -- BAR uses its own CMD_WANT_CLOAK (GameCMD.WANT_CLOAK) instead of - -- CMD.CLOAK; the active state lives in the "wantcloak" rules param. - local wantCloak = Spring.GetUnitRulesParam(uID, "wantcloak") - local commands = Spring.GetUnitCommands(uID, -1) or {} - local cmdsClean = {} - for j = 1, #commands do - local c = commands[j] - -- Copy params by explicit 1-based index to avoid any key-0 artifacts - -- from Spring's internal tables being serialised via pairs(). - local paramsCopy = nil - if c.params and #c.params > 0 then - paramsCopy = {} - for pi = 1, #c.params do - paramsCopy[pi] = c.params[pi] + for i = 1, #allUnits do + local uID = allUnits[i] + local uDefID = Spring.GetUnitDefID(uID) + if uDefID then + local uDef = UnitDefs[uDefID] + local x, y, z = Spring.GetUnitPosition(uID) + local transporter = Spring.GetUnitTransporter and Spring.GetUnitTransporter(uID) + -- Skip units without a valid world position (nil), that are being + -- transported (their reported position is the transport's, not theirs), + -- or nanoframes that have an active builder (the builder's queue will + -- recreate them). + if x and not transporter and not beingBuilt[uID] then + local health, maxHealth, _, _, buildProgress = Spring.GetUnitHealth(uID) + local teamID = Spring.GetUnitTeam(uID) + local heading = Spring.GetUnitHeading(uID) or 0 + local buildFacing = Spring.GetUnitBuildFacing(uID) + local exp = Spring.GetUnitExperience(uID) or 0 + local states = Spring.GetUnitStates(uID) or {} + -- Builder Priority (low/high) is a custom command; the gadget stores + -- the active value in the "builderPriority" rules param (0=low, 1=high). + local builderPriority = Spring.GetUnitRulesParam(uID, "builderPriority") + -- BAR uses its own CMD_WANT_CLOAK (GameCMD.WANT_CLOAK) instead of + -- CMD.CLOAK; the active state lives in the "wantcloak" rules param. + local wantCloak = Spring.GetUnitRulesParam(uID, "wantcloak") + local commands = Spring.GetUnitCommands(uID, -1) or {} + local cmdsClean = {} + for j = 1, #commands do + local c = commands[j] + -- Copy params by explicit 1-based index to avoid any key-0 artifacts + -- from Spring's internal tables being serialised via pairs(). + local paramsCopy = nil + if c.params and #c.params > 0 then + paramsCopy = {} + for pi = 1, #c.params do + paramsCopy[pi] = c.params[pi] + end end + cmdsClean[j] = { + id = c.id, + params = paramsCopy, + coded = (c.options and c.options.coded) or 0, + } end - cmdsClean[j] = { - id = c.id, - params = paramsCopy, - coded = (c.options and c.options.coded) or 0, - } - end - -- Factories keep their unit-build queue in a separate list. We save - -- it independently and re-issue after restart. - local factoryCmdsClean = nil - if uDef and uDef.isFactory and Spring.GetFactoryCommands then - local fcmds = Spring.GetFactoryCommands(uID, -1) or {} - if #fcmds > 0 then - factoryCmdsClean = {} - for j = 1, #fcmds do - local c = fcmds[j] - local paramsCopy = nil - if c.params and #c.params > 0 then - paramsCopy = {} - for pi = 1, #c.params do - paramsCopy[pi] = c.params[pi] + -- Factories keep their unit-build queue in a separate list. We save + -- it independently and re-issue after restart. + local factoryCmdsClean = nil + if uDef and uDef.isFactory and Spring.GetFactoryCommands then + local fcmds = Spring.GetFactoryCommands(uID, -1) or {} + if #fcmds > 0 then + factoryCmdsClean = {} + for j = 1, #fcmds do + local c = fcmds[j] + local paramsCopy = nil + if c.params and #c.params > 0 then + paramsCopy = {} + for pi = 1, #c.params do + paramsCopy[pi] = c.params[pi] + end end + factoryCmdsClean[j] = { + id = c.id, + params = paramsCopy, + coded = (c.options and c.options.coded) or 0, + } end - factoryCmdsClean[j] = { - id = c.id, - params = paramsCopy, - coded = (c.options and c.options.coded) or 0, - } - end end + -- canFly / isFloating units should keep their saved y (or the engine + -- will snap them); ground/sub units should be snapped to ground so they + -- don't fall from a stale mid-air position. + local canFly = uDef and uDef.canFly + data.units[#data.units + 1] = { + unitID = uID, + unitDefID = uDefID, + teamID = teamID, + canFly = canFly and true or false, + x = x, + y = y, + z = z, + heading = heading, + facing = buildFacing or 0, + health = health, + maxHealth = maxHealth, + buildProgress = buildProgress or 1, + experience = exp, + states = { + firestate = states.firestate, + movestate = states.movestate, + ["repeat"] = states["repeat"], + cloak = states.cloak, + active = states.active, + trajectory = states.trajectory, + }, + builderPriority = builderPriority, + wantCloak = wantCloak, + commands = cmdsClean, + factoryCommands = factoryCmdsClean, + } end - -- canFly / isFloating units should keep their saved y (or the engine - -- will snap them); ground/sub units should be snapped to ground so they - -- don't fall from a stale mid-air position. - local canFly = uDef and uDef.canFly - data.units[#data.units + 1] = { - unitID = uID, - unitDefID = uDefID, - teamID = teamID, - canFly = canFly and true or false, - x = x, y = y, z = z, - heading = heading, - facing = buildFacing or 0, - health = health, - maxHealth = maxHealth, - buildProgress = buildProgress or 1, - experience = exp, - states = { - firestate = states.firestate, - movestate = states.movestate, - ["repeat"] = states["repeat"], - cloak = states.cloak, - active = states.active, - trajectory = states.trajectory, - }, - builderPriority = builderPriority, - wantCloak = wantCloak, - commands = cmdsClean, - factoryCommands = factoryCmdsClean, - } end end + return data end - return data -end -local function sendStateToUnsynced(data) - local s = serialize(data) - SendToUnsynced("rws_begin") - for i = 1, #s, CHUNK_SIZE do - SendToUnsynced("rws_chunk", s:sub(i, i + CHUNK_SIZE - 1)) + local function sendStateToUnsynced(data) + local s = serialize(data) + SendToUnsynced("rws_begin") + for i = 1, #s, CHUNK_SIZE do + SendToUnsynced("rws_chunk", s:sub(i, i + CHUNK_SIZE - 1)) + end + SendToUnsynced("rws_commit") end - SendToUnsynced("rws_commit") -end -function gadget:RecvLuaMsg(msg, playerID) - if msg == "restart_with_state" then - local data = collectUnitState() - sendStateToUnsynced(data) - return true - end - if msg == "rws_restore_begin" then - restoreBuffer = {} - return true - end - local chunk = msg:match("^rws_restore_chunk:(.*)") - if chunk then - if restoreBuffer then restoreBuffer[#restoreBuffer + 1] = chunk end - return true - end - if msg == "rws_restore_commit" then - if not restoreBuffer then return true end - local content = table.concat(restoreBuffer) - restoreBuffer = nil - local fn, err = loadstring("return " .. content) - if not fn then - Spring.Echo("[Restart With State] Failed to parse state: " .. tostring(err)) + function gadget:RecvLuaMsg(msg, playerID) + if msg == "restart_with_state" then + local data = collectUnitState() + sendStateToUnsynced(data) return true end - local ok, data = pcall(fn) - if not ok or type(data) ~= "table" or type(data.units) ~= "table" then - Spring.Echo("[Restart With State] State data invalid; ignoring.") + if msg == "rws_restore_begin" then + restoreBuffer = {} return true end - pendingRestore = data - -- restore after initial commander warp-in is complete - restoreFrame = (Game.spawnWarpInFrame or 90) + 10 - Spring.Echo("[Restart With State] State received (" .. tostring(#data.units) .. " units). Will restore at frame " .. restoreFrame) - return true + local chunk = msg:match("^rws_restore_chunk:(.*)") + if chunk then + if restoreBuffer then + restoreBuffer[#restoreBuffer + 1] = chunk + end + return true + end + if msg == "rws_restore_commit" then + if not restoreBuffer then + return true + end + local content = table.concat(restoreBuffer) + restoreBuffer = nil + local fn, err = loadstring("return " .. content) + if not fn then + Spring.Echo("[Restart With State] Failed to parse state: " .. tostring(err)) + return true + end + local ok, data = pcall(fn) + if not ok or type(data) ~= "table" or type(data.units) ~= "table" then + Spring.Echo("[Restart With State] State data invalid; ignoring.") + return true + end + pendingRestore = data + -- restore after initial commander warp-in is complete + restoreFrame = (Game.spawnWarpInFrame or 90) + 10 + Spring.Echo("[Restart With State] State received (" .. tostring(#data.units) .. " units). Will restore at frame " .. restoreFrame) + return true + end + return false end - return false -end -local function restoreUnits() - if not pendingRestore then return end - local data = pendingRestore - pendingRestore = nil - - -- Snapshot existing units BEFORE creating any new ones. - -- We create restored units first so the engine never sees zero units - -- (which would immediately trigger a defeat condition). - local oldUnits = Spring.GetAllUnits() - - local idMap = {} - local createdCount = 0 - - -- Pass 1: create units, set health/progress/experience/states - for i = 1, #data.units do - local u = data.units[i] - if not UnitDefs[u.unitDefID] then - Spring.Echo("[Restart With State] Unknown unitDefID " .. tostring(u.unitDefID) .. ", skipping.") - else - local createY = u.y - -- For ground/sea units, snap to the actual ground height so they don't - -- spawn floating in mid-air at a stale position (the saved y is the - -- unit's last in-game y, which for moving units is mid-flight/jump). - if not u.canFly then - createY = Spring.GetGroundHeight(u.x, u.z) - end - -- Spawn unfinished units as nanoframes (build=true), otherwise as completed. - local isUnderConstruction = u.buildProgress and u.buildProgress < 1 - local ok, newID = pcall(Spring.CreateUnit, u.unitDefID, u.x, createY, u.z, u.facing or 0, u.teamID, isUnderConstruction and true or false) - if ok and newID then - idMap[u.unitID] = newID - createdCount = createdCount + 1 - Spring.SetUnitHeadingAndUpDir(newID, u.heading, 0, 1, 0) - - -- Restore health and build progress together so nanoframes keep both. - if u.health then - Spring.SetUnitHealth(newID, { health = u.health, build = u.buildProgress or 1 }) - end - if u.experience and u.experience > 0 then - Spring.SetUnitExperience(newID, u.experience) + local function restoreUnits() + if not pendingRestore then + return + end + local data = pendingRestore + pendingRestore = nil + + -- Snapshot existing units BEFORE creating any new ones. + -- We create restored units first so the engine never sees zero units + -- (which would immediately trigger a defeat condition). + local oldUnits = Spring.GetAllUnits() + + local idMap = {} + local createdCount = 0 + + -- Pass 1: create units, set health/progress/experience/states + for i = 1, #data.units do + local u = data.units[i] + if not UnitDefs[u.unitDefID] then + Spring.Echo("[Restart With State] Unknown unitDefID " .. tostring(u.unitDefID) .. ", skipping.") + else + local createY = u.y + -- For ground/sea units, snap to the actual ground height so they don't + -- spawn floating in mid-air at a stale position (the saved y is the + -- unit's last in-game y, which for moving units is mid-flight/jump). + if not u.canFly then + createY = Spring.GetGroundHeight(u.x, u.z) end + -- Spawn unfinished units as nanoframes (build=true), otherwise as completed. + local isUnderConstruction = u.buildProgress and u.buildProgress < 1 + local ok, newID = pcall(Spring.CreateUnit, u.unitDefID, u.x, createY, u.z, u.facing or 0, u.teamID, isUnderConstruction and true or false) + if ok and newID then + idMap[u.unitID] = newID + createdCount = createdCount + 1 + Spring.SetUnitHeadingAndUpDir(newID, u.heading, 0, 1, 0) + + -- Restore health and build progress together so nanoframes keep both. + if u.health then + Spring.SetUnitHealth(newID, { health = u.health, build = u.buildProgress or 1 }) + end + if u.experience and u.experience > 0 then + Spring.SetUnitExperience(newID, u.experience) + end - local s = u.states - if s then - if s.firestate then Spring.GiveOrderToUnit(newID, CMD.FIRE_STATE, { s.firestate }, 0) end - if s.movestate then Spring.GiveOrderToUnit(newID, CMD.MOVE_STATE, { s.movestate }, 0) end - if s["repeat"] ~= nil then Spring.GiveOrderToUnit(newID, CMD.REPEAT, { s["repeat"] and 1 or 0 }, 0) end - if s.active ~= nil then Spring.GiveOrderToUnit(newID, CMD.ONOFF, { s.active and 1 or 0 }, 0) end - if s.trajectory ~= nil then Spring.GiveOrderToUnit(newID, CMD.TRAJECTORY, { s.trajectory and 1 or 0 }, 0) end - end + local s = u.states + if s then + if s.firestate then + Spring.GiveOrderToUnit(newID, CMD.FIRE_STATE, { s.firestate }, 0) + end + if s.movestate then + Spring.GiveOrderToUnit(newID, CMD.MOVE_STATE, { s.movestate }, 0) + end + if s["repeat"] ~= nil then + Spring.GiveOrderToUnit(newID, CMD.REPEAT, { s["repeat"] and 1 or 0 }, 0) + end + if s.active ~= nil then + Spring.GiveOrderToUnit(newID, CMD.ONOFF, { s.active and 1 or 0 }, 0) + end + if s.trajectory ~= nil then + Spring.GiveOrderToUnit(newID, CMD.TRAJECTORY, { s.trajectory and 1 or 0 }, 0) + end + end - -- Builder Priority: re-issue via the custom CMD so the gadget - -- (unit_builder_priority) updates its rules param and cmd desc. - if u.builderPriority ~= nil and GameCMD and GameCMD.PRIORITY then - Spring.GiveOrderToUnit(newID, GameCMD.PRIORITY, { u.builderPriority }, 0) - end + -- Builder Priority: re-issue via the custom CMD so the gadget + -- (unit_builder_priority) updates its rules param and cmd desc. + if u.builderPriority ~= nil and GameCMD and GameCMD.PRIORITY then + Spring.GiveOrderToUnit(newID, GameCMD.PRIORITY, { u.builderPriority }, 0) + end - -- Cloak (BAR-specific): unit_cloak.lua rejects vanilla CMD.CLOAK - -- and only honors GameCMD.WANT_CLOAK, which sets the "wantcloak" - -- rules param and actually cloaks the unit. - if u.wantCloak ~= nil and GameCMD and GameCMD.WANT_CLOAK then - Spring.GiveOrderToUnit(newID, GameCMD.WANT_CLOAK, { u.wantCloak }, 0) + -- Cloak (BAR-specific): unit_cloak.lua rejects vanilla CMD.CLOAK + -- and only honors GameCMD.WANT_CLOAK, which sets the "wantcloak" + -- rules param and actually cloaks the unit. + if u.wantCloak ~= nil and GameCMD and GameCMD.WANT_CLOAK then + Spring.GiveOrderToUnit(newID, GameCMD.WANT_CLOAK, { u.wantCloak }, 0) + end + else + Spring.Echo("[Restart With State] CreateUnit failed for defID " .. tostring(u.unitDefID) .. ": " .. tostring(newID)) end - else - Spring.Echo("[Restart With State] CreateUnit failed for defID " .. tostring(u.unitDefID) .. ": " .. tostring(newID)) end end - end - -- Now that restored units exist, safely remove the old pre-restore units. - for i = 1, #oldUnits do - Spring.DestroyUnit(oldUnits[i], false, true) - end + -- Now that restored units exist, safely remove the old pre-restore units. + for i = 1, #oldUnits do + Spring.DestroyUnit(oldUnits[i], false, true) + end - -- Pass 2: re-issue command queues, remapping any old unitID params to new ones - for i = 1, #data.units do - local u = data.units[i] - local newID = idMap[u.unitID] - if newID and u.commands and #u.commands > 0 then - local firstIssued = false - for j = 1, #u.commands do - local c = u.commands[j] - local params = c.params - local origCoded = c.coded or 0 - -- Skip engine-internal sub-orders; they are managed by the engine - -- and re-issuing them confuses the AI/movement (e.g. nano-build, - -- internal attack-move steps, etc.). Exceptions: - -- * WAIT-family commands get the internal bit flipped on while - -- "active", but we still want to restore them. - -- * Factory unit-build orders (negative cmd IDs) have the internal - -- bit set while the unit is being built; we want them back so - -- the queue restarts where it was. - -- Strip the bit and re-issue. - local isInternal = (math.floor(origCoded / 8) % 2) == 1 - if isInternal and (WAIT_CMDS[c.id] or NO_PARAM_CMDS[c.id] or c.id < 0) then - origCoded = origCoded - 8 - isInternal = false - end - if isInternal then + -- Pass 2: re-issue command queues, remapping any old unitID params to new ones + for i = 1, #data.units do + local u = data.units[i] + local newID = idMap[u.unitID] + if newID and u.commands and #u.commands > 0 then + local firstIssued = false + for j = 1, #u.commands do + local c = u.commands[j] + local params = c.params + local origCoded = c.coded or 0 + -- Skip engine-internal sub-orders; they are managed by the engine + -- and re-issuing them confuses the AI/movement (e.g. nano-build, + -- internal attack-move steps, etc.). Exceptions: + -- * WAIT-family commands get the internal bit flipped on while + -- "active", but we still want to restore them. + -- * Factory unit-build orders (negative cmd IDs) have the internal + -- bit set while the unit is being built; we want them back so + -- the queue restarts where it was. + -- Strip the bit and re-issue. + local isInternal = (math.floor(origCoded / 8) % 2) == 1 + if isInternal and (WAIT_CMDS[c.id] or NO_PARAM_CMDS[c.id] or c.id < 0) then + origCoded = origCoded - 8 + isInternal = false + end + if isInternal then -- skip - else - -- Only remap unit-targeting commands (same whitelist as - -- unit_evolution.lua). Other single-param commands pass through. - local skip = false - local isUnitTarget = UNIT_TARGET_ALWAYS[c.id] or - (UNIT_TARGET_SINGLE[c.id] and params and #params == 1) - if isUnitTarget then - local mapped = idMap[params[1]] - if mapped then - params = { mapped } - else - skip = true -- target no longer exists + else + -- Only remap unit-targeting commands (same whitelist as + -- unit_evolution.lua). Other single-param commands pass through. + local skip = false + local isUnitTarget = UNIT_TARGET_ALWAYS[c.id] or (UNIT_TARGET_SINGLE[c.id] and params and #params == 1) + if isUnitTarget then + local mapped = idMap[params[1]] + if mapped then + params = { mapped } + else + skip = true -- target no longer exists + end + elseif params then + -- Position-type command: validate no param serialised as nil. + for pi = 1, #params do + if params[pi] == nil then + skip = true + break + end + end end - elseif params then - -- Position-type command: validate no param serialised as nil. - for pi = 1, #params do - if params[pi] == nil then skip = true; break end + if not skip then + -- First order clears the queue (use saved opts as-is); + -- subsequent ones must shift-append. + local coded + if not firstIssued then + coded = origCoded + firstIssued = true + else + -- preserve original flags AND ensure shift bit is set + local hasShift = (math.floor(origCoded / 32) % 2) == 1 + coded = hasShift and origCoded or (origCoded + CMD.OPT_SHIFT) + end + local issueParams = params or {} + + pcall(Spring.GiveOrderToUnit, newID, c.id, issueParams, coded) end end - if not skip then - -- First order clears the queue (use saved opts as-is); - -- subsequent ones must shift-append. - local coded - if not firstIssued then - coded = origCoded - firstIssued = true - else - -- preserve original flags AND ensure shift bit is set - local hasShift = (math.floor(origCoded / 32) % 2) == 1 - coded = hasShift and origCoded or (origCoded + CMD.OPT_SHIFT) + end + end + -- Re-issue factory unit-build queue (separate from the normal command + -- queue). Build orders use negative cmd IDs (-unitDefID). + if newID and u.factoryCommands and #u.factoryCommands > 0 then + for j = 1, #u.factoryCommands do + local c = u.factoryCommands[j] + local origCoded = c.coded or 0 + -- For factory build orders the modifier bits change meaning: + -- SHIFT = queue x5, CTRL = queue x20, ALT = insert at front. + -- The default (no modifier) is "append one to the end", which is + -- exactly what we want when re-issuing the saved queue. Strip + -- SHIFT/CTRL/ALT so each saved entry produces exactly one queued + -- unit, and strip OPT_INTERNAL (set on the unit currently being + -- built) so it re-enters the queue normally. + local function clearBit(v, bit) + if (math.floor(v / bit) % 2) == 1 then + return v - bit end - local issueParams = params or {} - - pcall(Spring.GiveOrderToUnit, newID, c.id, issueParams, coded) + return v end + local coded = clearBit(origCoded, 8) -- INTERNAL + coded = clearBit(coded, 32) -- SHIFT (x5) + coded = clearBit(coded, 64) -- CTRL (x20) + coded = clearBit(coded, 128) -- ALT (insert front) + pcall(Spring.GiveOrderToUnit, newID, c.id, c.params or {}, coded) end end end - -- Re-issue factory unit-build queue (separate from the normal command - -- queue). Build orders use negative cmd IDs (-unitDefID). - if newID and u.factoryCommands and #u.factoryCommands > 0 then - for j = 1, #u.factoryCommands do - local c = u.factoryCommands[j] - local origCoded = c.coded or 0 - -- For factory build orders the modifier bits change meaning: - -- SHIFT = queue x5, CTRL = queue x20, ALT = insert at front. - -- The default (no modifier) is "append one to the end", which is - -- exactly what we want when re-issuing the saved queue. Strip - -- SHIFT/CTRL/ALT so each saved entry produces exactly one queued - -- unit, and strip OPT_INTERNAL (set on the unit currently being - -- built) so it re-enters the queue normally. - local function clearBit(v, bit) if (math.floor(v / bit) % 2) == 1 then return v - bit end return v end - local coded = clearBit(origCoded, 8) -- INTERNAL - coded = clearBit(coded, 32) -- SHIFT (x5) - coded = clearBit(coded, 64) -- CTRL (x20) - coded = clearBit(coded, 128) -- ALT (insert front) - pcall(Spring.GiveOrderToUnit, newID, c.id, c.params or {}, coded) - end - end - end - Spring.Echo("[Restart With State] Restored " .. tostring(createdCount) .. "/" .. tostring(#data.units) .. " units.") -end + Spring.Echo("[Restart With State] Restored " .. tostring(createdCount) .. "/" .. tostring(#data.units) .. " units.") + end --- Restore path is driven by LuaUI sending chunks via Spring.SendLuaRulesMsg; --- no direct filesystem access needed in synced code. + -- Restore path is driven by LuaUI sending chunks via Spring.SendLuaRulesMsg; + -- no direct filesystem access needed in synced code. -function gadget:GameFrame(n) - if restoreFrame and n >= restoreFrame then - restoreFrame = nil - restoreUnits() + function gadget:GameFrame(n) + if restoreFrame and n >= restoreFrame then + restoreFrame = nil + restoreUnits() + end end -end ------------------------------------------------------------------------------- -else -- UNSYNCED -------------------------------------------------------------------------------- +else -- UNSYNCED + ------------------------------------------------------------------------------- -local saveBuffer = {} -local UI_CHUNK_SIZE = 4000 + local saveBuffer = {} + local UI_CHUNK_SIZE = 4000 -local function rwsBegin() - saveBuffer = {} -end + local function rwsBegin() + saveBuffer = {} + end -local function rwsChunk(_, s) - saveBuffer[#saveBuffer + 1] = s -end + local function rwsChunk(_, s) + saveBuffer[#saveBuffer + 1] = s + end -local function rwsCommit() - -- io/os are not available in LuaRules; forward to the companion widget via SendLuaUIMsg - local data = table.concat(saveBuffer) - saveBuffer = {} - Spring.SendLuaUIMsg("rws:begin") - for i = 1, #data, UI_CHUNK_SIZE do - Spring.SendLuaUIMsg("rws:chunk:" .. data:sub(i, i + UI_CHUNK_SIZE - 1)) + local function rwsCommit() + -- io/os are not available in LuaRules; forward to the companion widget via SendLuaUIMsg + local data = table.concat(saveBuffer) + saveBuffer = {} + Spring.SendLuaUIMsg("rws:begin") + for i = 1, #data, UI_CHUNK_SIZE do + Spring.SendLuaUIMsg("rws:chunk:" .. data:sub(i, i + UI_CHUNK_SIZE - 1)) + end + Spring.SendLuaUIMsg("rws:commit") end - Spring.SendLuaUIMsg("rws:commit") -end -local function rwsClear() - Spring.SendLuaUIMsg("rws:clear") -end + local function rwsClear() + Spring.SendLuaUIMsg("rws:clear") + end -function gadget:Initialize() - gadgetHandler:AddSyncAction("rws_begin", rwsBegin) - gadgetHandler:AddSyncAction("rws_chunk", rwsChunk) - gadgetHandler:AddSyncAction("rws_commit", rwsCommit) - gadgetHandler:AddSyncAction("rws_clear", rwsClear) -end + function gadget:Initialize() + gadgetHandler:AddSyncAction("rws_begin", rwsBegin) + gadgetHandler:AddSyncAction("rws_chunk", rwsChunk) + gadgetHandler:AddSyncAction("rws_commit", rwsCommit) + gadgetHandler:AddSyncAction("rws_clear", rwsClear) + end -function gadget:Shutdown() - gadgetHandler:RemoveSyncAction("rws_begin") - gadgetHandler:RemoveSyncAction("rws_chunk") - gadgetHandler:RemoveSyncAction("rws_commit") - gadgetHandler:RemoveSyncAction("rws_clear") -end + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("rws_begin") + gadgetHandler:RemoveSyncAction("rws_chunk") + gadgetHandler:RemoveSyncAction("rws_commit") + gadgetHandler:RemoveSyncAction("rws_clear") + end -------------------------------------------------------------------------------- + ------------------------------------------------------------------------------- end ------------------------------------------------------------------------------- diff --git a/luarules/gadgets/game_restrict_resurrection.lua b/luarules/gadgets/game_restrict_resurrection.lua index 5931128ef05..8e1e7b01478 100644 --- a/luarules/gadgets/game_restrict_resurrection.lua +++ b/luarules/gadgets/game_restrict_resurrection.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Restrict unit resurrection', - desc = 'Disable resurrecting partly reclaimed wrecks when modoption enabled.', - author = 'RebelNode', - date = 'January 2026', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = false -- disabled for now and replaced with tax in game_tax_resource_sharing.lua, delete this gadget if decision not reverted later + name = "Restrict unit resurrection", + desc = "Disable resurrecting partly reclaimed wrecks when modoption enabled.", + author = "RebelNode", + date = "January 2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, -- disabled for now and replaced with tax in game_tax_resource_sharing.lua, delete this gadget if decision not reverted later } end diff --git a/luarules/gadgets/game_restrict_unit_sharing.lua b/luarules/gadgets/game_restrict_unit_sharing.lua index da38796b386..cfea9723e71 100644 --- a/luarules/gadgets/game_restrict_unit_sharing.lua +++ b/luarules/gadgets/game_restrict_unit_sharing.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Restrict Unit Sharing', - desc = 'Stun/debuff economy and builder units when transferred to ally when modoption enabled.', - author = 'RebelNode', - date = 'January 2026', - license = 'GNU GPL, v2 or later', - layer = -2, -- before unit_healthbars_widget_forwarding so that AllowFeatureBuildStep will prevent reclaim bar from showing - enabled = true + name = "Restrict Unit Sharing", + desc = "Stun/debuff economy and builder units when transferred to ally when modoption enabled.", + author = "RebelNode", + date = "January 2026", + license = "GNU GPL, v2 or later", + layer = -2, -- before unit_healthbars_widget_forwarding so that AllowFeatureBuildStep will prevent reclaim bar from showing + enabled = true, } end @@ -44,7 +44,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do end function gadget:AllowUnitTransfer(unitID, unitDefID, fromTeamID, toTeamID, capture) - if (capture) and (not Spring.AreTeamsAllied(fromTeamID, toTeamID)) or fromTeamID == Spring.GetGaiaTeamID() or toTeamID == Spring.GetGaiaTeamID() then + if capture and (not Spring.AreTeamsAllied(fromTeamID, toTeamID)) or fromTeamID == Spring.GetGaiaTeamID() or toTeamID == Spring.GetGaiaTeamID() then return true end beingBuilt, buildProgress = spGetUnitIsBeingBuilt(unitID) @@ -56,7 +56,7 @@ function gadget:AllowUnitTransfer(unitID, unitDefID, fromTeamID, toTeamID, captu local startFrame = Spring.GetGameFrame() local expireFrame = startFrame + DEBUFF_FRAMES debuffedUnits[unitID] = { - expireFrame = expireFrame, + expireFrame = expireFrame, } SendToUnsynced("unitBuildspeedDebuff", unitID, startFrame, expireFrame) elseif ecoUnits[unitDefID] then @@ -103,4 +103,4 @@ function gadget:UnitDestroyed(unitID) debuffedUnits[unitID] = nil SendToUnsynced("unitBuildspeedDebuffEnd", unitID) end -end \ No newline at end of file +end diff --git a/luarules/gadgets/game_selfd_resign.lua b/luarules/gadgets/game_selfd_resign.lua index e4f3cbc4c3b..54ed48cc2b5 100644 --- a/luarules/gadgets/game_selfd_resign.lua +++ b/luarules/gadgets/game_selfd_resign.lua @@ -1,5 +1,3 @@ - - if Spring.Utilities.Gametype.IsSinglePlayer() then return end @@ -7,15 +5,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Self-Destruct Resign", - desc = "Cancel the order and resign players which try to self-destruct all their units", - author = "Floris", - date = "October 2021", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Self-Destruct Resign", + desc = "Cancel the order and resign players which try to self-destruct all their units", + author = "Floris", + date = "October 2021", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local spGetTeamInfo = Spring.GetTeamInfo @@ -62,7 +60,6 @@ local function hasActiveHumanTeammate(teamID) end if gadgetHandler:IsSyncedCode() then - local thresholdPercentage = 0.95 local allowedStrikes = 3 @@ -74,7 +71,7 @@ if gadgetHandler:IsSyncedCode() then local function cancelSelfDestructOrders(teamID) local units = spGetTeamUnits(teamID) - for i=1, #units do + for i = 1, #units do local unitID = units[i] if spGetUnitSelfDTime(unitID) > 0 then Spring.GiveOrderToUnit(unitID, CMD_SELFD, {}, 0) @@ -98,11 +95,11 @@ if gadgetHandler:IsSyncedCode() then forceResignStrikesByTeamID[teamID] = strikes if strikes < allowedStrikes then - notifyTeamPlayers(teamID, 'forceResignWarn') + notifyTeamPlayers(teamID, "forceResignWarn") return end - notifyTeamPlayers(teamID, 'forceResignMessage') + notifyTeamPlayers(teamID, "forceResignMessage") Spring.KillTeam(teamID) end @@ -120,7 +117,7 @@ if gadgetHandler:IsSyncedCode() then local skipResignAmount = unitCount - triggerResignAmount local selfdUnitCount = 0 local skippedUnitCount = 0 - for i=1, unitCount do + for i = 1, unitCount do local unitID = units[i] if spGetUnitSelfDTime(unitID) > 0 then selfdUnitCount = selfdUnitCount + 1 @@ -131,7 +128,7 @@ if gadgetHandler:IsSyncedCode() then break elseif selfdUnitCount >= triggerResignAmount then local LuaAI = Spring.GetTeamLuaAI(teamID) - if not LuaAI or not ( string.find(LuaAI, "Scavengers") or string.find(LuaAI, "Raptors") ) then + if not LuaAI or not (string.find(LuaAI, "Scavengers") or string.find(LuaAI, "Raptors")) then forceResignTeam(teamID) end break @@ -149,11 +146,7 @@ if gadgetHandler:IsSyncedCode() then end return true end - - else -- UNSYNCED - - local myPlayerID = Spring.GetMyPlayerID() local myTeamID = Spring.GetMyTeamID() @@ -165,26 +158,26 @@ else -- UNSYNCED return end - if hasActiveHumanTeammate(myTeamID) and Script.LuaUI('GadgetMessageProxy') then + if hasActiveHumanTeammate(myTeamID) and Script.LuaUI("GadgetMessageProxy") then Spring.Echo("\255\255\166\166" .. Script.LuaUI.GadgetMessageProxy(messageKey)) end end local function forceResignWarn(_, playerID) - showForceResignNotification(playerID, 'ui.forceResignWarn') + showForceResignNotification(playerID, "ui.forceResignWarn") end local function forceResignMessage(_, playerID) - showForceResignNotification(playerID, 'ui.forceResignMessage') + showForceResignNotification(playerID, "ui.forceResignMessage") end function gadget:Initialize() - gadgetHandler:AddSyncAction('forceResignWarn', forceResignWarn) - gadgetHandler:AddSyncAction('forceResignMessage', forceResignMessage) + gadgetHandler:AddSyncAction("forceResignWarn", forceResignWarn) + gadgetHandler:AddSyncAction("forceResignMessage", forceResignMessage) end function gadget:Shutdown() - gadgetHandler:RemoveSyncAction('forceResignWarn') - gadgetHandler:RemoveSyncAction('forceResignMessage') + gadgetHandler:RemoveSyncAction("forceResignWarn") + gadgetHandler:RemoveSyncAction("forceResignMessage") end end diff --git a/luarules/gadgets/game_startbox_config.lua b/luarules/gadgets/game_startbox_config.lua index b4b9772143c..d60a9467f67 100644 --- a/luarules/gadgets/game_startbox_config.lua +++ b/luarules/gadgets/game_startbox_config.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Startbox Config', - desc = 'Loads polygon startbox configurations and provides containment checks via GG', - author = 'Harkenn', - date = '2026', - license = 'GNU GPL, v2 or later', + name = "Startbox Config", + desc = "Loads polygon startbox configurations and provides containment checks via GG", + author = "Harkenn", + date = "2026", + license = "GNU GPL, v2 or later", layer = -999, -- after FFA start setup (-1000), before initial spawn (0) and no-rush (-100) - enabled = true + enabled = true, } end @@ -30,7 +30,7 @@ function gadget:Initialize() configSource = source isExplicitConfig = isExplicit else - Spring.Log(gadget:GetInfo().name, LOG.WARNING, 'Failed to parse startbox config: ' .. tostring(config)) + Spring.Log(gadget:GetInfo().name, LOG.WARNING, "Failed to parse startbox config: " .. tostring(config)) end -- Expand the engine AABB for each active allyTeam to cover the polygon bounds. diff --git a/luarules/gadgets/game_tax_debuff_forwarding.lua b/luarules/gadgets/game_tax_debuff_forwarding.lua index 2ab9708f912..68c1d7b5f31 100644 --- a/luarules/gadgets/game_tax_debuff_forwarding.lua +++ b/luarules/gadgets/game_tax_debuff_forwarding.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Tax Debuff Forwarding', - desc = 'Forwards buildspeed debuff events from synced to LuaUI for the easytax modoption.', - author = 'RebelNode', - date = 'March 2026', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true + name = "Tax Debuff Forwarding", + desc = "Forwards buildspeed debuff events from synced to LuaUI for the easytax modoption.", + author = "RebelNode", + date = "March 2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -33,7 +33,7 @@ local function unitBuildspeedDebuffEnd(cmd, unitID) end function gadget:Initialize() - gadgetHandler:AddSyncAction("unitBuildspeedDebuff", unitBuildspeedDebuff) + gadgetHandler:AddSyncAction("unitBuildspeedDebuff", unitBuildspeedDebuff) gadgetHandler:AddSyncAction("unitBuildspeedDebuffEnd", unitBuildspeedDebuffEnd) end diff --git a/luarules/gadgets/game_tax_resource_sharing.lua b/luarules/gadgets/game_tax_resource_sharing.lua index 2699cb14011..34a6c512267 100644 --- a/luarules/gadgets/game_tax_resource_sharing.lua +++ b/luarules/gadgets/game_tax_resource_sharing.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Tax Resource Sharing', - desc = 'Tax Resource Sharing when modoption enabled. Modified from "Prevent Excessive Share" by Niobium', - author = 'Rimilel, RebelNode', - date = 'April 2024, January 2026', - license = 'GNU GPL, v2 or later', - layer = 1, -- Needs to occur before "Prevent Excessive Share" since their restriction on AllowResourceTransfer is not compatible - enabled = true + name = "Tax Resource Sharing", + desc = 'Tax Resource Sharing when modoption enabled. Modified from "Prevent Excessive Share" by Niobium', + author = "Rimilel, RebelNode", + date = "April 2024, January 2026", + license = "GNU GPL, v2 or later", + layer = 1, -- Needs to occur before "Prevent Excessive Share" since their restriction on AllowResourceTransfer is not compatible + enabled = true, } end @@ -18,7 +18,7 @@ end if not gadgetHandler:IsSyncedCode() then return false end -if Spring.GetModOptions().tax_resource_sharing_amount == 0 and (not Spring.GetModOptions().easytax) then +if Spring.GetModOptions().tax_resource_sharing_amount == 0 and not Spring.GetModOptions().easytax then return false end @@ -57,14 +57,13 @@ end ---------------------------------------------------------------- function gadget:AllowResourceTransfer(senderTeamId, receiverTeamId, resourceType, amount) - -- Spring uses 'm' and 'e' instead of the full names that we need, so we need to convert the resourceType -- We also check for 'metal' or 'energy' incase Spring decides to use those in a later version local resourceName - if (resourceType == 'm') or (resourceType == 'metal') then - resourceName = 'metal' - elseif (resourceType == 'e') or (resourceType == 'energy') then - resourceName = 'energy' + if (resourceType == "m") or (resourceType == "metal") then + resourceName = "metal" + elseif (resourceType == "e") or (resourceType == "energy") then + resourceName = "energy" else -- We don't handle whatever this resource is, allow it return true @@ -76,18 +75,18 @@ function gadget:AllowResourceTransfer(senderTeamId, receiverTeamId, resourceType -- rShare is the share slider setting, don't exceed their share slider max when sharing local maxShare = rStor * rShare - rCur - + if amount <= 0 or maxShare <= 0 then return false end - local taxedAmount = math_min((1-sharingTax)*amount, maxShare) - local totalAmount = taxedAmount / (1-sharingTax) + local taxedAmount = math_min((1 - sharingTax) * amount, maxShare) + local totalAmount = taxedAmount / (1 - sharingTax) local transferTax = totalAmount * sharingTax - spSetTeamResource(receiverTeamId, resourceName, rCur+taxedAmount) + spSetTeamResource(receiverTeamId, resourceName, rCur + taxedAmount) local sCur, _, _, _, _, _ = spGetTeamResources(senderTeamId, resourceName) - spSetTeamResource(senderTeamId, resourceName, sCur-totalAmount) + spSetTeamResource(senderTeamId, resourceName, sCur - totalAmount) -- Block the original transfer return false @@ -107,7 +106,7 @@ end -- team is the player who is overflowing, otherTeam are the allied players who receive resources UPDATE_PERIOD = 30 -- probably don't try to change this, apparently it's 30 in engine Team.cpp function gadget:GameFrame(f) - if (f-1) % UPDATE_PERIOD == 0 then + if (f - 1) % UPDATE_PERIOD == 0 then local teamList = spGetTeamList() for j, teamID in ipairs(teamList) do local teamEnergyCurrentLevel, teamEnergyStorage, teamEnergyPull, teamEnergyIncome, teamEnergyExpense, teamEnergyShare, teamEnergySent, teamEnergyReceived, teamEnergyExcess = spGetTeamResources(teamID, "energy") @@ -119,18 +118,18 @@ function gadget:GameFrame(f) -- calculate the total amount of resources that all -- allied teams can collectively receive through sharing for i, otherTeamID in ipairs(teamList) do - local _,_,isDead = spGetTeamInfo(otherTeamID,false) - if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and (not isDead) then - local otherTeamMetalCurrentLevel, otherTeamMetalStorage,_,_,_, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") - local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage,_,_,_, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") + local _, _, isDead = spGetTeamInfo(otherTeamID, false) + if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and not isDead then + local otherTeamMetalCurrentLevel, otherTeamMetalStorage, _, _, _, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") + local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage, _, _, _, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") eShare = eShare + math_max(0.0, (otherTeamEnergyStorage * math_min(0.99, otherTeamEnergyShare)) - otherTeamEnergyCurrentLevel) - mShare = mShare + math_max(0.0,(otherTeamMetalStorage * math_min(0.99, otherTeamMetalShare)) - otherTeamMetalCurrentLevel) + mShare = mShare + math_max(0.0, (otherTeamMetalStorage * math_min(0.99, otherTeamMetalShare)) - otherTeamMetalCurrentLevel) end end -- calculate how much we can share in total (resources above the red share slider) local eExcess = math_max(0.0, teamEnergyCurrentLevel - (teamEnergyStorage * teamEnergyShare)) - local mExcess = math_max(0.0, teamMetalCurrentLevel - (teamMetalStorage * teamMetalShare)) + local mExcess = math_max(0.0, teamMetalCurrentLevel - (teamMetalStorage * teamMetalShare)) local de = 0.0 local dm = 0.0 @@ -143,19 +142,19 @@ function gadget:GameFrame(f) -- now evenly distribute our excess resources among allied teams for i, otherTeamID in ipairs(teamList) do - local _,_,isDead = spGetTeamInfo(otherTeamID,false) - if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and (not isDead) then - local otherTeamMetalCurrentLevel, otherTeamMetalStorage,_,_,_, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") - local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage,_,_,_, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") + local _, _, isDead = spGetTeamInfo(otherTeamID, false) + if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and not isDead then + local otherTeamMetalCurrentLevel, otherTeamMetalStorage, _, _, _, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") + local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage, _, _, _, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") local edif = math_max(0.0, math_min(((otherTeamEnergyStorage * math_min(0.99, otherTeamEnergyShare)) - otherTeamEnergyCurrentLevel) * de, teamEnergyCurrentLevel)) local mdif = math_max(0.0, math_min(((otherTeamMetalStorage * math_min(0.99, otherTeamMetalShare)) - otherTeamMetalCurrentLevel) * dm, teamMetalCurrentLevel)) - + -- Tax the resources here. These count as used resources for in statistics, not sure what they should count as. spUseTeamResource(teamID, "energy", edif * sharingTax) spUseTeamResource(teamID, "metal", mdif * sharingTax) - spShareTeamResource(teamID, otherTeamID, "energy", edif * (1-sharingTax)) - spShareTeamResource(teamID, otherTeamID, "metal", mdif * (1-sharingTax)) + spShareTeamResource(teamID, otherTeamID, "energy", edif * (1 - sharingTax)) + spShareTeamResource(teamID, otherTeamID, "metal", mdif * (1 - sharingTax)) end end @@ -170,8 +169,8 @@ function gadget:GameFrame(f) mExcess = math_max(0.0, teamMetalExcess) --- Tax the extra overflow, these resources are not shared and were already wasted to full storage - eExcess = math_max(0.0, eExcess * (1-sharingTax)) - mExcess = math_max(0.0, mExcess * (1-sharingTax)) + eExcess = math_max(0.0, eExcess * (1 - sharingTax)) + mExcess = math_max(0.0, mExcess * (1 - sharingTax)) de = 0.0 dm = 0.0 @@ -184,13 +183,13 @@ function gadget:GameFrame(f) -- now evenly distribute our extra excess resources among allied teams for i, otherTeamID in ipairs(teamList) do - local _,_,isDead = spGetTeamInfo(otherTeamID,false) - if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and (not isDead) then - local otherTeamMetalCurrentLevel, otherTeamMetalStorage,_,_,_, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") - local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage,_,_,_, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") + local _, _, isDead = spGetTeamInfo(otherTeamID, false) + if otherTeamID ~= teamID and spAreTeamsAllied(teamID, otherTeamID) and not isDead then + local otherTeamMetalCurrentLevel, otherTeamMetalStorage, _, _, _, otherTeamMetalShare = spGetTeamResources(otherTeamID, "metal") + local otherTeamEnergyCurrentLevel, otherTeamEnergyStorage, _, _, _, otherTeamEnergyShare = spGetTeamResources(otherTeamID, "energy") local edif = math_max(0.0, math_min(((otherTeamEnergyStorage * math_min(0.99, otherTeamEnergyShare)) - otherTeamEnergyCurrentLevel) * de, teamEnergyCurrentLevel)) local mdif = math_max(0.0, math_min(((otherTeamMetalStorage * math_min(0.99, otherTeamMetalShare)) - otherTeamMetalCurrentLevel) * dm, teamMetalCurrentLevel)) - + -- These erroneously count as produced resources for allies in statistics. Not yet sure how to do this better, but this should be fine for modoption/testing at least. spAddTeamResource(otherTeamID, "energy", edif) spAddTeamResource(otherTeamID, "metal", mdif) diff --git a/luarules/gadgets/game_team_com_ends.lua b/luarules/gadgets/game_team_com_ends.lua index 2c5550d0508..5481feb8914 100644 --- a/luarules/gadgets/game_team_com_ends.lua +++ b/luarules/gadgets/game_team_com_ends.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2008-02-04", license = "Public domain", layer = 1, - enabled = true + enabled = true, } end @@ -105,8 +105,8 @@ end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if isCommander[unitDefID] and not ignoredTeams[unitTeam] then - local x,_,z = spGetUnitPosition(unitID) - commanderDeathQueue[unitID] = {unitTeam, x, z} + local x, _, z = spGetUnitPosition(unitID) + commanderDeathQueue[unitID] = { unitTeam, x, z } end end @@ -118,8 +118,8 @@ local function transferCommander(unitID, unitTeam, newTeam) aliveComCount[newAllyTeamID] = aliveComCount[newAllyTeamID] + 1 aliveTeamComCount[newTeam] = aliveTeamComCount[newTeam] + 1 -- remove from unitTeam - local x,_,z = spGetUnitPosition(unitID) - commanderDeathQueue[unitID] = {unitTeam, x, z} + local x, _, z = spGetUnitPosition(unitID) + commanderDeathQueue[unitID] = { unitTeam, x, z } end end @@ -138,7 +138,7 @@ end function gadget:Initialize() -- disable gadget when deathmode is "killall" or "none", or scoremode isnt regular local deathmode = Spring.GetModOptions().deathmode - if deathmode ~= 'com' and deathmode ~= 'own_com' and deathmode ~= 'territorial_domination' and deathmode ~= 'builders' then + if deathmode ~= "com" and deathmode ~= "own_com" and deathmode ~= "territorial_domination" and deathmode ~= "builders" then gadgetHandler:RemoveGadget(self) end diff --git a/luarules/gadgets/game_team_death_effect.lua b/luarules/gadgets/game_team_death_effect.lua index 4edb2de0577..2333d84aa1a 100644 --- a/luarules/gadgets/game_team_death_effect.lua +++ b/luarules/gadgets/game_team_death_effect.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "September 2021", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end @@ -19,11 +19,11 @@ if not gadgetHandler:IsSyncedCode() then end local wavePeriod = 550 -GG.wipeoutWithWreckage = false -- FFA can enable this +GG.wipeoutWithWreckage = false -- FFA can enable this local isCommander = {} local unitDecoration = {} -for udefID,def in ipairs(UnitDefs) do +for udefID, def in ipairs(UnitDefs) do if def.customParams.iscommander then isCommander[udefID] = true end @@ -35,30 +35,30 @@ end local spDestroyUnit = Spring.DestroyUnit local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitDefID = Spring.GetUnitDefID -local DISTANCE_LIMIT = math.max(Game.mapSizeX,Game.mapSizeZ) * math.max(Game.mapSizeX,Game.mapSizeZ) +local DISTANCE_LIMIT = math.max(Game.mapSizeX, Game.mapSizeZ) * math.max(Game.mapSizeX, Game.mapSizeZ) local destroyUnitQueue = {} local wipedoutTeams = {} -local function getSqrDistance(x1,z1,x2,z2) - local dx, dz = x1-x2, z1-z2 - return (dx*dx) + (dz*dz) +local function getSqrDistance(x1, z1, x2, z2) + local dx, dz = x1 - x2, z1 - z2 + return (dx * dx) + (dz * dz) end -local function wipeoutTeam(teamID, originX, originZ, attackerUnitID, periodMult) -- only teamID is required +local function wipeoutTeam(teamID, originX, originZ, attackerUnitID, periodMult) -- only teamID is required wipedoutTeams[teamID] = Spring.GetGameFrame() periodMult = periodMult or 1 local gf = Spring.GetGameFrame() local maxDeathFrame = 0 local teamUnits = Spring.GetTeamUnits(teamID) - for i=1, #teamUnits do + for i = 1, #teamUnits do local unitID = teamUnits[i] if not unitDecoration[spGetUnitDefID(unitID)] then - local x,_,z = spGetUnitPosition(unitID) + local x, _, z = spGetUnitPosition(unitID) local deathFrame if originX and originZ then - deathFrame = 6 + math.floor((math.min(((getSqrDistance(x, z, originX, originZ) / DISTANCE_LIMIT) * wavePeriod*0.6), wavePeriod) + math.random(0,wavePeriod/2.5)) * periodMult) + deathFrame = 6 + math.floor((math.min(((getSqrDistance(x, z, originX, originZ) / DISTANCE_LIMIT) * wavePeriod * 0.6), wavePeriod) + math.random(0, wavePeriod / 2.5)) * periodMult) else - deathFrame = 6 + math.floor((math.random(1, wavePeriod*0.3) + math.random(0,wavePeriod/2.5)) * periodMult) + deathFrame = 6 + math.floor((math.random(1, wavePeriod * 0.3) + math.random(0, wavePeriod / 2.5)) * periodMult) end maxDeathFrame = math.max(maxDeathFrame, deathFrame) if destroyUnitQueue[unitID] == nil then @@ -70,32 +70,33 @@ local function wipeoutTeam(teamID, originX, originZ, attackerUnitID, periodMult) -- neutralize units Spring.SetUnitNeutral(unitID, true) - Spring.SetUnitSensorRadius(unitID, 'los', 0) - Spring.SetUnitSensorRadius(unitID, 'airLos', 0) - Spring.SetUnitSensorRadius(unitID, 'radar', 0) - Spring.SetUnitSensorRadius(unitID, 'sonar', 0) + Spring.SetUnitSensorRadius(unitID, "los", 0) + Spring.SetUnitSensorRadius(unitID, "airLos", 0) + Spring.SetUnitSensorRadius(unitID, "radar", 0) + Spring.SetUnitSensorRadius(unitID, "sonar", 0) local i = 0 for weaponID, _ in pairs(UnitDefs[spGetUnitDefID(unitID)].weapons) do Spring.UnitWeaponHoldFire(unitID, weaponID) i = i + 1 end if i > 0 then - Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, {0}, 0) + Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, { 0 }, 0) Spring.SetUnitTarget(unitID, nil) - if GameCMD and GameCMD.UNIT_CANCEL_TARGET then -- remove any settarget cmd + if GameCMD and GameCMD.UNIT_CANCEL_TARGET then -- remove any settarget cmd Spring.GiveOrderToUnit(unitID, GameCMD.UNIT_CANCEL_TARGET, {}, {}) end end --Spring.SetUnitNoMinimap(unitID, true) end end - GG.maxDeathFrame = GG.maxDeathFrame and math.max(GG.maxDeathFrame, maxDeathFrame) or maxDeathFrame -- storing frame of total unit wipeout + GG.maxDeathFrame = GG.maxDeathFrame and math.max(GG.maxDeathFrame, maxDeathFrame) or maxDeathFrame -- storing frame of total unit wipeout end -local function wipeoutAllyTeam(allyTeamID, attackerUnitID, originX, originZ, periodMult) -- only allyTeamID is required - +local function wipeoutAllyTeam(allyTeamID, attackerUnitID, originX, originZ, periodMult) -- only allyTeamID is required -- xmas gadget uses this (to prevent creating xmasballs) - if not _G.destroyingTeam then _G.destroyingTeam = {} end + if not _G.destroyingTeam then + _G.destroyingTeam = {} + end _G.destroyingTeam[allyTeamID] = true -- define smaller destruction period when few units @@ -104,7 +105,7 @@ local function wipeoutAllyTeam(allyTeamID, attackerUnitID, originX, originZ, per local units = Spring.GetTeamUnits(teamID) totalUnits = totalUnits + #units end - periodMult = (periodMult or 1) * math.clamp(totalUnits / 300, 0.33, 1) -- make low unitcount blow up faster + periodMult = (periodMult or 1) * math.clamp(totalUnits / 300, 0.33, 1) -- make low unitcount blow up faster -- destroy all teams for _, teamID in ipairs(Spring.GetTeamList(allyTeamID)) do @@ -143,7 +144,7 @@ function gadget:GameFrame(gf) spDestroyUnit(unitID, selfD, false, defs.attackerUnitID) else if selfD and isCommander[spGetUnitDefID(unitID)] then - spDestroyUnit(unitID, false, false) -- always leave commander wreckage (ffa reclaims all on early dropped players now) + spDestroyUnit(unitID, false, false) -- always leave commander wreckage (ffa reclaims all on early dropped players now) else spDestroyUnit(unitID, selfD, false) -- if 4th arg is given, it cannot be nil (or engine complains) end @@ -156,7 +157,7 @@ end -- i've seen a resurrected unit being left-over so lets remove units being created after a team wipeout was initiated function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if wipedoutTeams[unitTeam] and wipedoutTeams[unitTeam]+300 > Spring.GetGameFrame() then + if wipedoutTeams[unitTeam] and wipedoutTeams[unitTeam] + 300 > Spring.GetGameFrame() then Spring.DestroyUnit(unitID, not GG.wipeoutWithWreckage, false) end end diff --git a/luarules/gadgets/game_team_power_watcher.lua b/luarules/gadgets/game_team_power_watcher.lua index 5c6f32e7178..d585c23fa7b 100644 --- a/luarules/gadgets/game_team_power_watcher.lua +++ b/luarules/gadgets/game_team_power_watcher.lua @@ -1,19 +1,19 @@ - - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { name = "Team Power Watcher", - desc = "Tracks power of individual and total units per team, useful for PvE dynamic difficulty", + desc = "Tracks power of individual and total units per team, useful for PvE dynamic difficulty", author = "SethDGamre", date = "2024-07-12", layer = -1, - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local teamIsOverPoweredRatio = 1.25 local alliesAreWinningRatio = 1.25 @@ -32,587 +32,586 @@ local peakTeamPowers = {} local unitsWithPower = {} local playerAllies = {} local powerThresholds = { - {techLevel = 0.5, threshold = 0}, - {techLevel = 1, threshold = 9000}, - {techLevel = 1.5, threshold = 45000}, - {techLevel = 2, threshold = 90000}, - {techLevel = 2.5, threshold = 230000}, - {techLevel = 3, threshold = 350000}, - {techLevel = 3.5, threshold = 475000}, - {techLevel = 4, threshold = 600000}, - {techLevel = 4.5, threshold = 725000} + { techLevel = 0.5, threshold = 0 }, + { techLevel = 1, threshold = 9000 }, + { techLevel = 1.5, threshold = 45000 }, + { techLevel = 2, threshold = 90000 }, + { techLevel = 2.5, threshold = 230000 }, + { techLevel = 3, threshold = 350000 }, + { techLevel = 3.5, threshold = 475000 }, + { techLevel = 4, threshold = 600000 }, + { techLevel = 4.5, threshold = 725000 }, } local pveTeamID = scavengerTeam or raptorTeam for _, teamID in ipairs(teamList) do - local allyID = select(6, Spring.GetTeamInfo(teamID)) - if teamID ~= scavengerTeam and teamID ~= raptorTeam and select (4, Spring.GetTeamInfo(teamID, false)) then - aiTeams[teamID] = true - playerTeams[teamID] = true - playerAllies[allyID] = playerAllies[allyID] or {} - playerAllies[allyID][teamID] = true - elseif teamID == tonumber(teamList[#teamList]) then - neutralTeam = teamID - else - humanTeams[teamID] = true - playerTeams[teamID] = true - playerAllies[allyID] = playerAllies[allyID] or {} - playerAllies[allyID][teamID] = true - end + local allyID = select(6, Spring.GetTeamInfo(teamID)) + if teamID ~= scavengerTeam and teamID ~= raptorTeam and select(4, Spring.GetTeamInfo(teamID, false)) then + aiTeams[teamID] = true + playerTeams[teamID] = true + playerAllies[allyID] = playerAllies[allyID] or {} + playerAllies[allyID][teamID] = true + elseif teamID == tonumber(teamList[#teamList]) then + neutralTeam = teamID + else + humanTeams[teamID] = true + playerTeams[teamID] = true + playerAllies[allyID] = playerAllies[allyID] or {} + playerAllies[allyID][teamID] = true + end end --assign team powers/peak powers to 0 to prevent nil for i = 1, #teamList do - local teamNumber = teamList[i] - teamPowers[teamNumber] = 0 - peakTeamPowers[teamNumber] = 0 + local teamNumber = teamList[i] + teamPowers[teamNumber] = 0 + peakTeamPowers[teamNumber] = 0 end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - unitsWithPower[unitID] = { power = UnitDefs[unitDefID].power, team = unitTeam} - teamPowers[unitTeam] = teamPowers[unitTeam] + UnitDefs[unitDefID].power - if peakTeamPowers[unitTeam] < teamPowers[unitTeam] then - peakTeamPowers[unitTeam] = teamPowers[unitTeam] - end + unitsWithPower[unitID] = { power = UnitDefs[unitDefID].power, team = unitTeam } + teamPowers[unitTeam] = teamPowers[unitTeam] + UnitDefs[unitDefID].power + if peakTeamPowers[unitTeam] < teamPowers[unitTeam] then + peakTeamPowers[unitTeam] = teamPowers[unitTeam] + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - unitsWithPower[unitID] = nil - teamPowers[unitTeam] = mathMax(teamPowers[unitTeam] - UnitDefs[unitDefID].power, 0) + unitsWithPower[unitID] = nil + teamPowers[unitTeam] = mathMax(teamPowers[unitTeam] - UnitDefs[unitDefID].power, 0) end --handles capture events on units already added to unitsWithPower by UnitFinished function gadget:MetaUnitAdded(unitID, unitDefID, unitTeam) - if unitsWithPower[unitID] then - local oldTeam = unitsWithPower[unitID].team + if unitsWithPower[unitID] then + local oldTeam = unitsWithPower[unitID].team - unitsWithPower[unitID] = { power = UnitDefs[unitDefID].power, team = unitTeam} - teamPowers[unitTeam] = teamPowers[unitTeam] + UnitDefs[unitDefID].power + unitsWithPower[unitID] = { power = UnitDefs[unitDefID].power, team = unitTeam } + teamPowers[unitTeam] = teamPowers[unitTeam] + UnitDefs[unitDefID].power - if teamPowers[oldTeam] <= UnitDefs[unitDefID].power then - teamPowers[oldTeam] = 0 - else - teamPowers[oldTeam] = teamPowers[unitTeam] - UnitDefs[unitDefID].power - end + if teamPowers[oldTeam] <= UnitDefs[unitDefID].power then + teamPowers[oldTeam] = 0 + else + teamPowers[oldTeam] = teamPowers[unitTeam] - UnitDefs[unitDefID].power + end - if teamPowers[unitTeam] and peakTeamPowers[unitTeam] < teamPowers[unitTeam] then - peakTeamPowers[unitTeam] = teamPowers[unitTeam] - end - end + if teamPowers[unitTeam] and peakTeamPowers[unitTeam] < teamPowers[unitTeam] then + peakTeamPowers[unitTeam] = teamPowers[unitTeam] + end + end end local function isPlayerTeam(teamID) - return teamID ~= neutralTeam and teamID ~= scavengerTeam and teamID ~= raptorTeam + return teamID ~= neutralTeam and teamID ~= scavengerTeam and teamID ~= raptorTeam end -- Returns the power of the input teamID as a number. local function teamPower(teamID) - return teamPowers[teamID] + return teamPowers[teamID] end -- Returns the total power of all non scavenger/raptor teams as a number. local function totalPlayerTeamsPower() - local totalPower = 0 + local totalPower = 0 - for teamID, power in pairs(teamPowers) do - if isPlayerTeam(teamID) then - totalPower = totalPower + power - end - end + for teamID, power in pairs(teamPowers) do + if isPlayerTeam(teamID) then + totalPower = totalPower + power + end + end - return totalPower + return totalPower end -- Returns the highest non scavenger/raptor team power as a table {teamID, power}. local function highestPlayerTeamPower() - local highestPower = 0 - local highestTeamID = nil + local highestPower = 0 + local highestTeamID = nil - for teamID, power in pairs(teamPowers) do - if isPlayerTeam(teamID) then - if power > highestPower then - highestPower = power - highestTeamID = teamID - end - end - end + for teamID, power in pairs(teamPowers) do + if isPlayerTeam(teamID) then + if power > highestPower then + highestPower = power + highestTeamID = teamID + end + end + end - return {teamID = highestTeamID, power = highestPower} + return { teamID = highestTeamID, power = highestPower } end -- Returns the average of all non scavenger/raptor teams as a number. local function averagePlayerTeamPower() - local totalPower = 0 - local teamCount = 0 + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if isPlayerTeam(id) and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if isPlayerTeam(id) and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 - return averagePower + local averagePower = teamCount > 0 and totalPower / teamCount or 0 + return averagePower end -- Returns the lowest non scavenger/raptor team power as a table {teamID, power}. local function lowestPlayerTeamPower() - local lowestPower = mathHuge - local lowestTeamID = nil + local lowestPower = mathHuge + local lowestTeamID = nil - for teamID, power in pairs(teamPowers) do - if isPlayerTeam(teamID) and power > 0 then - if power < lowestPower then - lowestPower = power - lowestTeamID = teamID - end - end - end + for teamID, power in pairs(teamPowers) do + if isPlayerTeam(teamID) and power > 0 then + if power < lowestPower then + lowestPower = power + lowestTeamID = teamID + end + end + end - return {teamID = lowestTeamID, power = lowestPower} + return { teamID = lowestTeamID, power = lowestPower } end -- Returns the highest non AI/scavenger/raptor team power as a table {teamID, power}. local function highestHumanTeamPower() - local highestPower = 0 - local highestTeamID = nil + local highestPower = 0 + local highestTeamID = nil - for teamID, power in pairs(teamPowers) do - if humanTeams[teamID] then - if power > highestPower then - highestPower = power - highestTeamID = teamID - end - end - end + for teamID, power in pairs(teamPowers) do + if humanTeams[teamID] then + if power > highestPower then + highestPower = power + highestTeamID = teamID + end + end + end - return {teamID = highestTeamID, power = highestPower} + return { teamID = highestTeamID, power = highestPower } end -- Returns the average of all non AI/scavenger/raptor teams as a number. local function averageHumanTeamPower() - local totalPower = 0 - local teamCount = 0 + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if humanTeams[id] and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if humanTeams[id] and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 - return averagePower + local averagePower = teamCount > 0 and totalPower / teamCount or 0 + return averagePower end -- Returns the lowest non AI/scavenger/raptor team power as a table {teamID, power}. local function lowestHumanTeamPower() - local lowestPower = mathHuge - local lowestTeamID = nil + local lowestPower = mathHuge + local lowestTeamID = nil - for teamID, power in pairs(teamPowers) do - if humanTeams[teamID] and power > 0 then - if power < lowestPower then - lowestPower = power - lowestTeamID = teamID - end - end - end + for teamID, power in pairs(teamPowers) do + if humanTeams[teamID] and power > 0 then + if power < lowestPower then + lowestPower = power + lowestTeamID = teamID + end + end + end - return {teamID = lowestTeamID, power = lowestPower} + return { teamID = lowestTeamID, power = lowestPower } end -- Returns the highest team power of the allies belonging to input team or allyID. Returns as a table {teamID, power}. local function highestAlliedTeamPower(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local highestPower = 0 - local highestTeamID = nil + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local highestPower = 0 + local highestTeamID = nil - for id, power in pairs(teamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then - if power > highestPower then - highestPower = power - highestTeamID = id - end - end - end + for id, power in pairs(teamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then + if power > highestPower then + highestPower = power + highestTeamID = id + end + end + end - return {teamID = highestTeamID, power = highestPower} + return { teamID = highestTeamID, power = highestPower } end -- Returns the average of all allies of the input teamID or allyID. Returns a number. -local function averageAlliedTeamPower(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local totalPower = 0 - local teamCount = 0 +local function averageAlliedTeamPower(teamID, allyID) + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 - return averagePower + local averagePower = teamCount > 0 and totalPower / teamCount or 0 + return averagePower end -- Returns the lowest of the teamID's allies or allyID's power as a table {teamID, power}. local function lowestAlliedTeamPower(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local lowestPower = mathHuge - local lowestTeamID = nil + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local lowestPower = mathHuge + local lowestTeamID = nil - for id, power in pairs(teamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then - if power < lowestPower then - lowestPower = power - lowestTeamID = id - end - end - end + for id, power in pairs(teamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then + if power < lowestPower then + lowestPower = power + lowestTeamID = id + end + end + end - return {teamID = lowestTeamID, power = lowestPower} + return { teamID = lowestTeamID, power = lowestPower } end -- Take an input of a power value and return an estimated tech level number. local function techGuesstimate(power) - local techLevel = 0 - for _, threshold in ipairs(powerThresholds) do - if power >= threshold.threshold then - techLevel = threshold.techLevel - else - break - end - end + local techLevel = 0 + for _, threshold in ipairs(powerThresholds) do + if power >= threshold.threshold then + techLevel = threshold.techLevel + else + break + end + end - return techLevel + return techLevel end -- Takes an input teamID return an estimated tech level number. local function teamTechGuesstimate(teamID) - local totalPower = teamPowers[teamID] - local techLevel = 0 - for _, threshold in ipairs(powerThresholds) do - if totalPower >= threshold.threshold then - techLevel = threshold.techLevel - else - break - end - end + local totalPower = teamPowers[teamID] + local techLevel = 0 + for _, threshold in ipairs(powerThresholds) do + if totalPower >= threshold.threshold then + techLevel = threshold.techLevel + else + break + end + end - return techLevel + return techLevel end -- Calculate all average powers of all non scavenger/raptor teams and return an estimated tech level number. local function averagePlayerTechGuesstimate() - local totalPower = 0 - local teamCount = 0 + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if isPlayerTeam(id) and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if isPlayerTeam(id) and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 + local averagePower = teamCount > 0 and totalPower / teamCount or 0 - local techLevel = 0 - for _, threshold in ipairs(powerThresholds) do - if averagePower >= threshold.threshold then - techLevel = threshold.techLevel - else - break - end - end + local techLevel = 0 + for _, threshold in ipairs(powerThresholds) do + if averagePower >= threshold.threshold then + techLevel = threshold.techLevel + else + break + end + end - return techLevel + return techLevel end -- Compares average powers of all non AI/scavenger/raptor teams return an estimated tech level number. local function averageHumanTechGuesstimate() - local totalPower = 0 - local teamCount = 0 + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if humanTeams[id] and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if humanTeams[id] and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 + local averagePower = teamCount > 0 and totalPower / teamCount or 0 - local techLevel = 0 - for _, threshold in ipairs(powerThresholds) do - if averagePower >= threshold.threshold then - techLevel = threshold.techLevel - else - break - end - end + local techLevel = 0 + for _, threshold in ipairs(powerThresholds) do + if averagePower >= threshold.threshold then + techLevel = threshold.techLevel + else + break + end + end - return techLevel + return techLevel end -- Compare average powers of all allied teams of the input teamID or allyID and return an estimated tech level number. local function averageAlliedTechGuesstimate(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local totalPower = 0 - local teamCount = 0 + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(teamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 + local averagePower = teamCount > 0 and totalPower / teamCount or 0 - local techLevel = 0 - for _, threshold in ipairs(powerThresholds) do - if averagePower >= threshold.threshold then - techLevel = threshold.techLevel - else - break - end - end + local techLevel = 0 + for _, threshold in ipairs(powerThresholds) do + if averagePower >= threshold.threshold then + techLevel = threshold.techLevel + else + break + end + end - return techLevel + return techLevel end -- Returns the highest power achieved by the the input teamID as a number. local function teamPeakPower(teamID) - for id, power in pairs(peakTeamPowers) do - if id == teamID then - return power - end - end - return 0 + for id, power in pairs(peakTeamPowers) do + if id == teamID then + return power + end + end + return 0 end -- Returns the total peak power achieved by all non scavenger/raptor teams as a number. local function totalPlayerPeakPower() - local totalPeakPower = 0 + local totalPeakPower = 0 - for id, power in pairs(peakTeamPowers) do - if isPlayerTeam(id) then - totalPeakPower = totalPeakPower + power - end - end + for id, power in pairs(peakTeamPowers) do + if isPlayerTeam(id) then + totalPeakPower = totalPeakPower + power + end + end - return totalPeakPower + return totalPeakPower end -- Returns the highest power achieved by any non scavenger/raptor team as a table {teamID, power}. -local function highestPlayerPeakPower() - local highestPower = 0 - local highestTeamID = nil +local function highestPlayerPeakPower() + local highestPower = 0 + local highestTeamID = nil - for id, power in pairs(peakTeamPowers) do - if isPlayerTeam(id) then - if power > highestPower then - highestPower = power - highestTeamID = id - end - end - end + for id, power in pairs(peakTeamPowers) do + if isPlayerTeam(id) then + if power > highestPower then + highestPower = power + highestTeamID = id + end + end + end - return {teamID = highestTeamID, power = highestPower} + return { teamID = highestTeamID, power = highestPower } end -- Returns the highest power achieved by any non scavenger/raptor team on the same team as the input teamID or allyID as a table {teamID, power}. -local function highestAlliedPeakPower(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local highestPower = 0 - local highestTeamID = nil +local function highestAlliedPeakPower(teamID, allyID) + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local highestPower = 0 + local highestTeamID = nil - for id, power in pairs(peakTeamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) then - if power > highestPower then - highestPower = power - highestTeamID = id - end - end - end + for id, power in pairs(peakTeamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) then + if power > highestPower then + highestPower = power + highestTeamID = id + end + end + end - return {teamID = highestTeamID, power = highestPower} + return { teamID = highestTeamID, power = highestPower } end -- Returns the average of all the peak powers achieved by non AI/scavenger/raptor teams as a number. local function averageHumanPeakPower() - local totalPower = 0 - local teamCount = 0 + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(peakTeamPowers) do - if humanTeams[id] then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(peakTeamPowers) do + if humanTeams[id] then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 - return averagePower + local averagePower = teamCount > 0 and totalPower / teamCount or 0 + return averagePower end -- Returns the average of all the peak powers achieved by allied teams of the input teamID or allyID as a number. local function averageAlliedPeakPower(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local totalPower = 0 - local teamCount = 0 + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local totalPower = 0 + local teamCount = 0 - for id, power in pairs(peakTeamPowers) do - if allyID == select(6, Spring.GetTeamInfo(id)) then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(peakTeamPowers) do + if allyID == select(6, Spring.GetTeamInfo(id)) then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 - return averagePower + local averagePower = teamCount > 0 and totalPower / teamCount or 0 + return averagePower end -- Returns the ratio number of the input teamID compared to the average of all players. local function teamComparedToAveragedPlayers(teamID) - local totalPower = 0 - local teamCount = 0 - local teamPower = teamPowers[teamID] + local totalPower = 0 + local teamCount = 0 + local teamPower = teamPowers[teamID] - for id, power in pairs(teamPowers) do - if playerTeams[id] and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if playerTeams[id] and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 + local averagePower = teamCount > 0 and totalPower / teamCount or 0 - local ratio = averagePower > 0 and teamPower / averagePower or 0 - return ratio + local ratio = averagePower > 0 and teamPower / averagePower or 0 + return ratio end -- Returns boolean true if the input teamID is considered significantly more powerful by the API. Second argument allows user-defined ratio. local function isTeamOverPowered(teamID, marginRatio) - marginRatio = marginRatio or teamIsOverPoweredRatio - local totalPower = 0 - local teamCount = 0 - local teamPower = teamPowers[teamID] + marginRatio = marginRatio or teamIsOverPoweredRatio + local totalPower = 0 + local teamCount = 0 + local teamPower = teamPowers[teamID] - for id, power in pairs(teamPowers) do - if playerTeams[id] and power > 0 then - totalPower = totalPower + power - teamCount = teamCount + 1 - end - end + for id, power in pairs(teamPowers) do + if playerTeams[id] and power > 0 then + totalPower = totalPower + power + teamCount = teamCount + 1 + end + end - local averagePower = teamCount > 0 and totalPower / teamCount or 0 + local averagePower = teamCount > 0 and totalPower / teamCount or 0 - local ratio = averagePower > 0 and teamPower / averagePower or 0 - if marginRatio and ratio > marginRatio then - return true - else - return false - end + local ratio = averagePower > 0 and teamPower / averagePower or 0 + if marginRatio and ratio > marginRatio then + return true + else + return false + end end -- Returns the ratio number of the input teamID's allies or allyID compared to the average of all player allies. local function alliesComparedToAverage(teamID, allyID) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - local allyPowers = {} - local allyCount = 0 - local totalPower = 0 - - for allyNumber, teams in pairs(playerAllies) do - local allyPower = 0 - for id, _ in pairs (teams) do - if playerTeams[id] then - local power = teamPowers[id] - allyPower = allyPower + power - end - end - if allyPower > 0 then - allyPowers[allyNumber] = allyPower - allyCount = allyCount + 1 - totalPower = totalPower + allyPower - end - end - - local averagePower = allyCount > 0 and totalPower / allyCount or 0 - - local ratio = averagePower > 0 and allyPowers[allyID] and allyPowers[allyID] / averagePower or 0 - return ratio + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + local allyPowers = {} + local allyCount = 0 + local totalPower = 0 + + for allyNumber, teams in pairs(playerAllies) do + local allyPower = 0 + for id, _ in pairs(teams) do + if playerTeams[id] then + local power = teamPowers[id] + allyPower = allyPower + power + end + end + if allyPower > 0 then + allyPowers[allyNumber] = allyPower + allyCount = allyCount + 1 + totalPower = totalPower + allyPower + end + end + + local averagePower = allyCount > 0 and totalPower / allyCount or 0 + + local ratio = averagePower > 0 and allyPowers[allyID] and allyPowers[allyID] / averagePower or 0 + return ratio end -- Returns boolean true if the input teamID's allies or allyID is considered significantly more powerful by the API. Third argument allows user-defined ratio. local function isAllyTeamWinning(teamID, allyID, marginRatio) - allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) - marginRatio = marginRatio or alliesAreWinningRatio - local allyPowers = {} - local allyCount = 0 - local totalPower = 0 - - for allyNumber, teams in pairs(playerAllies) do - local allyPower = 0 - for id, _ in pairs (teams) do - if playerTeams[id] then - local power = teamPowers[id] - allyPower = allyPower + power - end - end - if allyPower > 0 then - allyPowers[allyNumber] = allyPower - allyCount = allyCount + 1 - totalPower = totalPower + allyPower - end - end - - local averagePower = allyCount > 0 and totalPower / allyCount or 0 - local ratio = averagePower > 0 and allyPowers[allyID] and allyPowers[allyID] / averagePower or 0 - if ratio > marginRatio then - return true - else - return false - end + allyID = allyID or select(6, Spring.GetTeamInfo(teamID)) + marginRatio = marginRatio or alliesAreWinningRatio + local allyPowers = {} + local allyCount = 0 + local totalPower = 0 + + for allyNumber, teams in pairs(playerAllies) do + local allyPower = 0 + for id, _ in pairs(teams) do + if playerTeams[id] then + local power = teamPowers[id] + allyPower = allyPower + power + end + end + if allyPower > 0 then + allyPowers[allyNumber] = allyPower + allyCount = allyCount + 1 + totalPower = totalPower + allyPower + end + end + + local averagePower = allyCount > 0 and totalPower / allyCount or 0 + local ratio = averagePower > 0 and allyPowers[allyID] and allyPowers[allyID] / averagePower or 0 + if ratio > marginRatio then + return true + else + return false + end end - function gadget:Initialize() - GG.PowerLib = {} - GG.PowerLib["ScavengerTeam"] = scavengerTeam - GG.PowerLib["RaptorTeam"] = raptorTeam - GG.PowerLib["AiTeams"] = aiTeams - GG.PowerLib["NeutralTeam"] = neutralTeam - GG.PowerLib["HumanTeams"] = humanTeams - GG.PowerLib["PlayerTeams"] = playerTeams - GG.PowerLib["TeamPowers"] = teamPowers - GG.PowerLib["PeakTeamPowers"] = peakTeamPowers - GG.PowerLib["PowerThresholds"] = powerThresholds - GG.PowerLib["TeamPower"] = teamPower - GG.PowerLib["TotalPlayerTeamsPower"] = totalPlayerTeamsPower - GG.PowerLib["HighestPlayerTeamPower"] = highestPlayerTeamPower - GG.PowerLib["AveragePlayerTeamPower"] = averagePlayerTeamPower - GG.PowerLib["LowestPlayerTeamPower"] = lowestPlayerTeamPower - GG.PowerLib["HighestHumanTeamPower"] = highestHumanTeamPower - GG.PowerLib["AverageHumanTeamPower"] = averageHumanTeamPower - GG.PowerLib["LowestHumanTeamPower"] = lowestHumanTeamPower - GG.PowerLib["HighestAlliedTeamPower"] = highestAlliedTeamPower - GG.PowerLib["AverageAlliedTeamPower"] = averageAlliedTeamPower - GG.PowerLib["LowestAlliedTeamPower"] = lowestAlliedTeamPower - GG.PowerLib["TechGuesstimate"] = techGuesstimate - GG.PowerLib["TeamTechGuesstimate"] = teamTechGuesstimate - GG.PowerLib["AveragePlayerTechGuesstimate"] = averagePlayerTechGuesstimate - GG.PowerLib["AverageHumanTechGuesstimate"] = averageHumanTechGuesstimate - GG.PowerLib["AverageAlliedTechGuesstimate"] = averageAlliedTechGuesstimate - GG.PowerLib["TeamPeakPower"] = teamPeakPower - GG.PowerLib["TotalPlayerPeakPower"] = totalPlayerPeakPower - GG.PowerLib["HighestPlayerPeakPower"] = highestPlayerPeakPower - GG.PowerLib["HighestAlliedPeakPower"] = highestAlliedPeakPower - GG.PowerLib["AverageHumanPeakPower"] = averageHumanPeakPower - GG.PowerLib["AverageAlliedPeakPower"] = averageAlliedPeakPower - GG.PowerLib["TeamComparedToAveragedPlayers"] = teamComparedToAveragedPlayers - GG.PowerLib["IsTeamOverPowered"] = isTeamOverPowered - GG.PowerLib["AlliesComparedToAverage"] = alliesComparedToAverage - GG.PowerLib["IsAllyTeamWinning"] = isAllyTeamWinning -end \ No newline at end of file + GG.PowerLib = {} + GG.PowerLib["ScavengerTeam"] = scavengerTeam + GG.PowerLib["RaptorTeam"] = raptorTeam + GG.PowerLib["AiTeams"] = aiTeams + GG.PowerLib["NeutralTeam"] = neutralTeam + GG.PowerLib["HumanTeams"] = humanTeams + GG.PowerLib["PlayerTeams"] = playerTeams + GG.PowerLib["TeamPowers"] = teamPowers + GG.PowerLib["PeakTeamPowers"] = peakTeamPowers + GG.PowerLib["PowerThresholds"] = powerThresholds + GG.PowerLib["TeamPower"] = teamPower + GG.PowerLib["TotalPlayerTeamsPower"] = totalPlayerTeamsPower + GG.PowerLib["HighestPlayerTeamPower"] = highestPlayerTeamPower + GG.PowerLib["AveragePlayerTeamPower"] = averagePlayerTeamPower + GG.PowerLib["LowestPlayerTeamPower"] = lowestPlayerTeamPower + GG.PowerLib["HighestHumanTeamPower"] = highestHumanTeamPower + GG.PowerLib["AverageHumanTeamPower"] = averageHumanTeamPower + GG.PowerLib["LowestHumanTeamPower"] = lowestHumanTeamPower + GG.PowerLib["HighestAlliedTeamPower"] = highestAlliedTeamPower + GG.PowerLib["AverageAlliedTeamPower"] = averageAlliedTeamPower + GG.PowerLib["LowestAlliedTeamPower"] = lowestAlliedTeamPower + GG.PowerLib["TechGuesstimate"] = techGuesstimate + GG.PowerLib["TeamTechGuesstimate"] = teamTechGuesstimate + GG.PowerLib["AveragePlayerTechGuesstimate"] = averagePlayerTechGuesstimate + GG.PowerLib["AverageHumanTechGuesstimate"] = averageHumanTechGuesstimate + GG.PowerLib["AverageAlliedTechGuesstimate"] = averageAlliedTechGuesstimate + GG.PowerLib["TeamPeakPower"] = teamPeakPower + GG.PowerLib["TotalPlayerPeakPower"] = totalPlayerPeakPower + GG.PowerLib["HighestPlayerPeakPower"] = highestPlayerPeakPower + GG.PowerLib["HighestAlliedPeakPower"] = highestAlliedPeakPower + GG.PowerLib["AverageHumanPeakPower"] = averageHumanPeakPower + GG.PowerLib["AverageAlliedPeakPower"] = averageAlliedPeakPower + GG.PowerLib["TeamComparedToAveragedPlayers"] = teamComparedToAveragedPlayers + GG.PowerLib["IsTeamOverPowered"] = isTeamOverPowered + GG.PowerLib["AlliesComparedToAverage"] = alliesComparedToAverage + GG.PowerLib["IsAllyTeamWinning"] = isAllyTeamWinning +end diff --git a/luarules/gadgets/game_team_resources.lua b/luarules/gadgets/game_team_resources.lua index 06eb7a2d3ad..dd3006579e5 100644 --- a/luarules/gadgets/game_team_resources.lua +++ b/luarules/gadgets/game_team_resources.lua @@ -1,105 +1,104 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Team Resourcing', - desc = 'Sets up team resources', - author = 'Niobium, Maxie12', - date = 'May 2011', -- November 2025 - license = 'GNU GPL, v2 or later', - layer = 1, - enabled = true - } + return { + name = "Team Resourcing", + desc = "Sets up team resources", + author = "Niobium, Maxie12", + date = "May 2011", -- November 2025 + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local minStorageMetal = 1000 local minStorageEnergy = 1000 local mathMax = math.max - local function GetTeamPlayerCounts() - local teamPlayerCounts = {} - local playerList = Spring.GetPlayerList() - for i = 1, #playerList do - local playerID = playerList[i] - local _, _, isSpec, teamID = Spring.GetPlayerInfo(playerID, false) - if not isSpec then - teamPlayerCounts[teamID] = (teamPlayerCounts[teamID] or 0) + 1 - end - end - return teamPlayerCounts + local teamPlayerCounts = {} + local playerList = Spring.GetPlayerList() + for i = 1, #playerList do + local playerID = playerList[i] + local _, _, isSpec, teamID = Spring.GetPlayerInfo(playerID, false) + if not isSpec then + teamPlayerCounts[teamID] = (teamPlayerCounts[teamID] or 0) + 1 + end + end + return teamPlayerCounts end local function setup(addResources) - local startMetalStorage = Spring.GetModOptions().startmetalstorage - local startEnergyStorage = Spring.GetModOptions().startenergystorage - local startMetal = Spring.GetModOptions().startmetal - local startEnergy = Spring.GetModOptions().startenergy - local bonusMultiplierEnabled = Spring.GetModOptions().bonusstartresourcemultiplier; - - local commanderMinMetal, commanderMinEnergy = 0, 0 - - -- Coop mode specific modification. Store amount of non-spectating players per team - local teamPlayerCounts = {} - if GG.coopMode then - teamPlayerCounts = GetTeamPlayerCounts() - end - - local teamList = Spring.GetTeamList() - for i = 1, #teamList do - local teamID = teamList[i] - - -- If coopmode is enabled, multiplier depending on player count. - local multiplier = 1 - if GG.coopMode then - multiplier = teamPlayerCounts[teamID] or 1 -- Gaia has no players - end - - --If starting bonus multiplication is enabled, multiply it. - local teamMultiplier = 1; - if (bonusMultiplierEnabled) then - teamMultiplier = select(7, Spring.GetTeamInfo(teamID)); - end - - -- Get starting resources and storage including any bonuses from mods - local startingMetal = startMetal * teamMultiplier * multiplier - local startingEnergy = startEnergy * teamMultiplier * multiplier - local startingMetalStorage = startMetalStorage * teamMultiplier * multiplier - local startingEnergyStorage = startEnergyStorage * teamMultiplier * multiplier - - -- Get the player's start unit to make sure starting storage is no less than its storage - local com = UnitDefs[Spring.GetTeamRulesParam(teamID, 'startUnit')] - if com then - commanderMinMetal = com.metalStorage or 0 - commanderMinEnergy = com.energyStorage or 0 - end - - Spring.SetTeamResource(teamID, 'ms', mathMax(minStorageMetal, startingMetalStorage, startingMetal, commanderMinMetal)) - Spring.SetTeamResource(teamID, 'es', mathMax(minStorageEnergy, startingEnergyStorage, startingEnergy, commanderMinEnergy)) - if addResources then - Spring.SetTeamResource(teamID, 'm', startingMetal) - Spring.SetTeamResource(teamID, 'e', startingEnergy) - end - end + local startMetalStorage = Spring.GetModOptions().startmetalstorage + local startEnergyStorage = Spring.GetModOptions().startenergystorage + local startMetal = Spring.GetModOptions().startmetal + local startEnergy = Spring.GetModOptions().startenergy + local bonusMultiplierEnabled = Spring.GetModOptions().bonusstartresourcemultiplier + + local commanderMinMetal, commanderMinEnergy = 0, 0 + + -- Coop mode specific modification. Store amount of non-spectating players per team + local teamPlayerCounts = {} + if GG.coopMode then + teamPlayerCounts = GetTeamPlayerCounts() + end + + local teamList = Spring.GetTeamList() + for i = 1, #teamList do + local teamID = teamList[i] + + -- If coopmode is enabled, multiplier depending on player count. + local multiplier = 1 + if GG.coopMode then + multiplier = teamPlayerCounts[teamID] or 1 -- Gaia has no players + end + + --If starting bonus multiplication is enabled, multiply it. + local teamMultiplier = 1 + if bonusMultiplierEnabled then + teamMultiplier = select(7, Spring.GetTeamInfo(teamID)) + end + + -- Get starting resources and storage including any bonuses from mods + local startingMetal = startMetal * teamMultiplier * multiplier + local startingEnergy = startEnergy * teamMultiplier * multiplier + local startingMetalStorage = startMetalStorage * teamMultiplier * multiplier + local startingEnergyStorage = startEnergyStorage * teamMultiplier * multiplier + + -- Get the player's start unit to make sure starting storage is no less than its storage + local com = UnitDefs[Spring.GetTeamRulesParam(teamID, "startUnit")] + if com then + commanderMinMetal = com.metalStorage or 0 + commanderMinEnergy = com.energyStorage or 0 + end + + Spring.SetTeamResource(teamID, "ms", mathMax(minStorageMetal, startingMetalStorage, startingMetal, commanderMinMetal)) + Spring.SetTeamResource(teamID, "es", mathMax(minStorageEnergy, startingEnergyStorage, startingEnergy, commanderMinEnergy)) + if addResources then + Spring.SetTeamResource(teamID, "m", startingMetal) + Spring.SetTeamResource(teamID, "e", startingEnergy) + end + end end function gadget:Initialize() - if Spring.GetGameFrame() > 0 then - return - end - setup(true) + if Spring.GetGameFrame() > 0 then + return + end + setup(true) end function gadget:GameStart() - -- reset because commander added additional storage as well - setup() + -- reset because commander added additional storage as well + setup() end function gadget:TeamDied(teamID) - Spring.SetTeamShareLevel(teamID, 'metal', 0) - Spring.SetTeamShareLevel(teamID, 'energy', 0) + Spring.SetTeamShareLevel(teamID, "metal", 0) + Spring.SetTeamShareLevel(teamID, "energy", 0) end diff --git a/luarules/gadgets/game_territorial_domination.lua b/luarules/gadgets/game_territorial_domination.lua index f0af44aeabe..6ff372660c7 100644 --- a/luarules/gadgets/game_territorial_domination.lua +++ b/luarules/gadgets/game_territorial_domination.lua @@ -1,19 +1,21 @@ function gadget:GetInfo() return { - name = "Territorial Domination", - desc = "Implements territorial domination victory condition", - author = "SethDGamre", - date = "2025.02.08", + name = "Territorial Domination", + desc = "Implements territorial domination victory condition", + author = "SethDGamre", + date = "2025.02.08", license = "GNU GPL, v2", - layer = 0, + layer = 0, enabled = true, - depends = { 'gl4' }, + depends = { "gl4" }, } end local modOptions = Spring.GetModOptions() local isSynced = gadgetHandler:IsSyncedCode() -if modOptions.deathmode ~= "territorial_domination" or not isSynced then return false end +if modOptions.deathmode ~= "territorial_domination" or not isSynced then + return false +end local territorialDominationConfig = { ["20_minutes"] = { @@ -31,7 +33,7 @@ local territorialDominationConfig = { ["35_minutes"] = { maxRounds = 7, minutesPerRound = 5, - } + }, } local config = territorialDominationConfig[modOptions.territorial_domination_config] or territorialDominationConfig["25_minutes"] @@ -147,7 +149,9 @@ local function sortAllyPowersByStrength(allyPowers) end if teamCount > 1 then - table.sort(sortedTeams, function(a, b) return a.power > b.power end) + table.sort(sortedTeams, function(a, b) + return a.power > b.power + end) end return teamCount @@ -184,8 +188,7 @@ local function processNeighborData(currentSquareData) local neighborGridX = currentGridX + deltaX local neighborGridZ = currentGridZ + deltaZ - if neighborGridX >= 0 and neighborGridX < numberOfSquaresX and - neighborGridZ >= 0 and neighborGridZ < numberOfSquaresZ then + if neighborGridX >= 0 and neighborGridX < numberOfSquaresX and neighborGridZ >= 0 and neighborGridZ < numberOfSquaresZ then local neighborGridID = neighborGridX * numberOfSquaresZ + neighborGridZ + 1 local neighborSquareData = captureGrid[neighborGridID] @@ -258,20 +261,12 @@ local function initializeUnsyncedGrid() local initVisibilityArray = table.concat(allVisibleArray) for gridID, squareData in pairs(captureGrid) do - SendToUnsynced("InitializeGridSquare", - gridID, - gaiaAllyTeamID, - squareData.progress, - squareData.gridMidpointX, - squareData.gridMidpointZ, - initVisibilityArray - ) + SendToUnsynced("InitializeGridSquare", gridID, gaiaAllyTeamID, squareData.progress, squareData.gridMidpointX, squareData.gridMidpointZ, initVisibilityArray) end sentGridStructure = true end - local function setAllyTeamRanks() for i = 1, #rankedAllyScores do rankedAllyScores[i] = nil @@ -353,7 +348,6 @@ local function processLivingTeams() end end - local function createGridSquareData(x, z) local originX = x * GRID_SIZE local originZ = z * GRID_SIZE @@ -373,10 +367,10 @@ local function createGridSquareData(x, z) data.neighborAllyTeamCounts = {} data.totalNeighborCount = 0 data.corners = { - { x = data.mapOriginX, z = data.mapOriginZ }, + { x = data.mapOriginX, z = data.mapOriginZ }, { x = data.mapOriginX + GRID_SIZE, z = data.mapOriginZ }, - { x = data.mapOriginX, z = data.mapOriginZ + GRID_SIZE }, - { x = data.mapOriginX + GRID_SIZE, z = data.mapOriginZ + GRID_SIZE } + { x = data.mapOriginX, z = data.mapOriginZ + GRID_SIZE }, + { x = data.mapOriginX + GRID_SIZE, z = data.mapOriginZ + GRID_SIZE }, } return data end @@ -394,7 +388,9 @@ local function generateCaptureGrid() end local function defeatAlly(allyID) - if DEBUGMODE or not allyTeamsWatch[allyID] then return end + if DEBUGMODE or not allyTeamsWatch[allyID] then + return + end doomedAllies[allyID] = true for unitID, commanderAllyID in pairs(livingCommanders) do if commanderAllyID == allyID then @@ -449,8 +445,7 @@ end local function processGridSquareCapture(gridID) local data = captureGrid[gridID] - local units = spGetUnitsInRectangle(data.mapOriginX, data.mapOriginZ, data.mapOriginX + GRID_SIZE, - data.mapOriginZ + GRID_SIZE) + local units = spGetUnitsInRectangle(data.mapOriginX, data.mapOriginZ, data.mapOriginX + GRID_SIZE, data.mapOriginZ + GRID_SIZE) local allyPowers = {} local hasUnits = false @@ -618,7 +613,6 @@ function gadget:GameFrame(frame) elseif frameModulo == 1 then processNeighborsAndDecay() elseif frameModulo == 2 then - local seconds = spGetGameSeconds() if seconds >= roundTimestamp or currentRound > MAX_ROUNDS then local newHighestScore = 0 diff --git a/luarules/gadgets/game_volcano_pyroclastic.lua b/luarules/gadgets/game_volcano_pyroclastic.lua index 6b3fa9a3d49..2a6e3e40987 100644 --- a/luarules/gadgets/game_volcano_pyroclastic.lua +++ b/luarules/gadgets/game_volcano_pyroclastic.lua @@ -3,483 +3,453 @@ -------------------------------------------------------------------------------- function gadget:GetInfo() - return { - name = "Volcano Pyroclastic Eruptions", - desc = "Cinematic volcano eruption event for BAR", - author = "Steel", - date = "Dec 2025", - layer = 0, - enabled = true, - } + return { + name = "Volcano Pyroclastic Eruptions", + desc = "Cinematic volcano eruption event for BAR", + author = "Steel", + date = "Dec 2025", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- -- SYNCED -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - --------------------------------------------------------------------------------- --- Shortcuts --------------------------------------------------------------------------------- -local spCreateUnit = Spring.CreateUnit -local spDestroyUnit = Spring.DestroyUnit -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spSpawnCEG = Spring.SpawnCEG -local spGetGroundHeight = Spring.GetGroundHeight -local spSetUnitCloak = Spring.SetUnitCloak -local spMoveCtrlEnable = Spring.MoveCtrl.Enable -local spMoveCtrlSetPosition = Spring.MoveCtrl.SetPosition - -local GameFrame = Spring.GetGameFrame -local SendToUnsynced = SendToUnsynced - -local CMD_ATTACK = CMD.ATTACK -local CMD_FIRE_STATE = CMD.FIRE_STATE - --------------------------------------------------------------------------------- --- Volcano center --------------------------------------------------------------------------------- -local VX = Game.mapSizeX * 0.5 -local VZ = Game.mapSizeZ * 0.5 - -local VRIM = 600 -local LAUNCHER_Y = VRIM - 300 - --------------------------------------------------------------------------------- --- Timing control --------------------------------------------------------------------------------- -local VOLCANO_EJECT_DELAY_FRAMES = 86 -- << EDIT THIS ONLY - -local FIRST_MIN = 8 * 60 * 30 -- 8 minutes -local FIRST_MAX = 12 * 60 * 30 -- 12 minutes -local COOLDOWN_MIN = 8 * 60 * 30 -- 8 minutes -local COOLDOWN_MAX = 12 * 60 * 30 -- 12 minutes -local BUILDUP = 20 * 30 - --------------------------------------------------------------------------------- --- Runtime / map control --------------------------------------------------------------------------------- -local REQUIRED_MAP = "forge v2.3" -local volcanoActive = true - -local function Normalize(s) - s = tostring(s or "") - s = string.lower(s) - s = s:gsub(";", "") - s = s:gsub("%s+", " ") - s = s:gsub("^%s+", ""):gsub("%s+$", "") - return s -end - -local function IsVolcanoEnabled() - local modOpts = (Spring.GetModOptions and Spring.GetModOptions()) or {} - local v = modOpts.forge_volcano - return v == nil or v == true or v == 1 or v == "1" or v == "true" -end - --------------------------------------------------------------------------------- --- State --------------------------------------------------------------------------------- -local nextErupt = nil -local delayed = {} -local pendingDestroy = {} -local firstFireballFrame = nil -local ejectScheduled = false -local buildupSoundPlayed = false -local volcanoFireballWeaponDefID = nil - -local function R(a,b) return a + math.random()*(b-a) end - --------------------------------------------------------------------------------- --- DelayCall helper --------------------------------------------------------------------------------- -local function DelayCall(func, args, delay) - local f = GameFrame() + delay - delayed[f] = delayed[f] or {} - delayed[f][#delayed[f]+1] = {func,args} -end - --------------------------------------------------------------------------------- --- Volcano Controls "/luarules volcano" to pause/resume volcano explosion --------------------------------------------------------------------------------- - -local function ResetVolcanoState() - nextErupt = GameFrame() + R(COOLDOWN_MIN, COOLDOWN_MAX) - delayed = {} - pendingDestroy = {} - firstFireballFrame = nil - ejectScheduled = false - buildupSoundPlayed = false -end - -function gadget:Initialize() - if Normalize(Game.mapName) ~= REQUIRED_MAP then - gadgetHandler:RemoveGadget(self) - return - end - - if WeaponDefNames and WeaponDefNames["volcano_fireball"] then - volcanoFireballWeaponDefID = WeaponDefNames["volcano_fireball"].id - else - for weaponDefID, weaponDef in pairs(WeaponDefs) do - if weaponDef.name == "Volcano Fireball" then - volcanoFireballWeaponDefID = weaponDefID - break - end - end - end - - if volcanoFireballWeaponDefID then - Script.SetWatchProjectile(volcanoFireballWeaponDefID, true) - end - - volcanoActive = IsVolcanoEnabled() - if not volcanoActive then - ResetVolcanoState() - end - - gadgetHandler:AddChatAction("volcano", function(cmd, line, words, playerID) -local accountID = Spring.Utilities.GetAccountID(playerID) - local authorized = _G.permissions.volcano[accountID] - - if not (authorized or Spring.IsCheatingEnabled()) then - Spring.Echo("[Volcano] Unauthorized command.") - return - end - - volcanoActive = not volcanoActive - if volcanoActive then - nextErupt = GameFrame() + R(COOLDOWN_MIN, COOLDOWN_MAX) - Spring.Echo("[Volcano] Volcano system resumed.") - else - ResetVolcanoState() - Spring.Echo("[Volcano] Volcano system paused.") - end - end) -end - -function gadget:Shutdown() - if volcanoFireballWeaponDefID then - Script.SetWatchProjectile(volcanoFireballWeaponDefID, false) - end - gadgetHandler:RemoveChatAction("volcano") -end - --------------------------------------------------------------------------------- --- Ash helpers --------------------------------------------------------------------------------- -local function spawnAshBuild() - local x = VX + math.random(-160,160) - local z = VZ + math.random(-160,160) - spSpawnCEG("volcano_ash_build", x, spGetGroundHeight(x,z) + VRIM, z) -end - -local function spawnAshBig() - local x = VX + math.random(-260,260) - local z = VZ + math.random(-260,260) - spSpawnCEG("volcano_ash_big", x, spGetGroundHeight(x,z) + VRIM + 50, z) -end - -local function spawnAshSmall() - local x = VX + math.random(-320,320) - local z = VZ + math.random(-320,320) - spSpawnCEG("volcano_ash_small", x, spGetGroundHeight(x,z) + VRIM, z) -end - --------------------------------------------------------------------------------- --- FIRE HELPERS --------------------------------------------------------------------------------- -local FIRE_CEG = "volcano_fire-area" - -local FIRE_RIM_RADIUS = 160 * 1.20 -local VRIM_FIRE_HEIGHT = VRIM - -local function spawnFireRimCEG() - local a = math.random() * math.pi * 2 - local x = VX + math.cos(a) * FIRE_RIM_RADIUS - local z = VZ + math.sin(a) * FIRE_RIM_RADIUS - local y = spGetGroundHeight(VX, VZ) + VRIM_FIRE_HEIGHT - spSpawnCEG(FIRE_CEG, x, y, z) -end - -local function spawnFireMouthCEG() - local y = spGetGroundHeight(VX, VZ) + VRIM - spSpawnCEG( - FIRE_CEG, - VX + math.random(-30,30), - y, - VZ + math.random(-30,30) - ) -end - -local FIRE_OUTER_RADIUS_MIN = 220 -local FIRE_OUTER_RADIUS_MAX = 900 - -local function spawnFireSlopeCEG() - local a = math.random() * math.pi * 2 - local d = FIRE_OUTER_RADIUS_MIN + - math.random() * (FIRE_OUTER_RADIUS_MAX - FIRE_OUTER_RADIUS_MIN) - - local x = VX + math.cos(a) * d - local z = VZ + math.sin(a) * d - local y = spGetGroundHeight(x, z) + 14 - - spSpawnCEG(FIRE_CEG, x, y, z) -end - --------------------------------------------------------------------------------- --- Fireball launcher --------------------------------------------------------------------------------- -local function launchFireball() - if not firstFireballFrame then - firstFireballFrame = GameFrame() - ejectScheduled = false - end - - local uid = spCreateUnit( - "volcano_projectile_unit", - VX, LAUNCHER_Y, VZ, 0, - Spring.GetGaiaTeamID() - ) - if not uid then return end - - spSetUnitCloak(uid, true, 100000) - spMoveCtrlEnable(uid) - spMoveCtrlSetPosition(uid, VX, LAUNCHER_Y, VZ) - spGiveOrderToUnit(uid, CMD_FIRE_STATE, {2}, {}) - - local a = math.random()*math.pi*2 - local d = 900 + math.random(900) - spGiveOrderToUnit( - uid, - CMD_ATTACK, - { VX + math.cos(a)*d, - spGetGroundHeight(VX,VZ) + 20, - VZ + math.sin(a)*d }, - {} - ) - - pendingDestroy[uid] = GameFrame() + 90 -end - --------------------------------------------------------------------------------- --- Main loop --------------------------------------------------------------------------------- -function gadget:GameFrame(f) - - if not volcanoActive then - return - end - - if delayed[f] then - for _,d in ipairs(delayed[f]) do - local fn,args = d[1],d[2] - if args then fn(unpack(args)) else fn() end - end - delayed[f] = nil - end - - for uid,kill in pairs(pendingDestroy) do - if f >= kill then - spDestroyUnit(uid,false,true) - pendingDestroy[uid] = nil - end - end - - if not nextErupt then - nextErupt = f + R(FIRST_MIN,FIRST_MAX) - return - end - - local remain = nextErupt - f - - if remain > 0 and remain <= BUILDUP then - if f % 4 == 0 then spawnAshBuild() end - if math.random() < 0.02 then spawnFireRimCEG() end - if math.random() < 0.03 then spawnFireSlopeCEG() end - - if not buildupSoundPlayed then - SendToUnsynced("volcano_buildup_rumble") - SendToUnsynced("quake_warning", "SEISMIC ACTIVITY DETECTED") - buildupSoundPlayed = true - end - return - end - - if f >= nextErupt then - buildupSoundPlayed = false - - for b = 1, 3 do - DelayCall(function() - for i = 1, math.random(3,5) do - spawnFireRimCEG() - end - end, nil, b * (3 * 30)) - end - - math.random() - local n = math.random(5,11) -- number of fireballs - local step = math.max(1, math.floor(60 / n)) - local start = 30 + math.random(0,4) - - for i=1,n do - DelayCall(launchFireball, nil, - start + (i-1)*step + math.random(0,4)) - end - - for i = 1, math.random(10,16) do - DelayCall(spawnFireMouthCEG, nil, math.random(0,150)) - end - - for i = 1, math.random(12,18) do - DelayCall(spawnFireSlopeCEG, nil, math.random(0,180)) - end - - DelayCall(function() - for i=1,28 do spawnAshBig() end - end, nil, start) - - for i=1,18 do spawnAshSmall() end - - nextErupt = f + R(COOLDOWN_MIN,COOLDOWN_MAX) - end - - ------------------------------------------------------------------ - -- EJECT PLUME + LAVA SPLASHES + SHOCKWAVE - ------------------------------------------------------------------ - if firstFireballFrame and not ejectScheduled then - if f >= firstFireballFrame + VOLCANO_EJECT_DELAY_FRAMES then - ejectScheduled = true - firstFireballFrame = nil - - SendToUnsynced("volcano_eject_sound") - - local groundY = spGetGroundHeight(VX, VZ) - local baseY = groundY + VRIM - - -- Eject plume (unchanged) - for i=1,math.random(3,5) do - DelayCall(function() - spSpawnCEG( - "volcano_eject", - VX + math.random(-40,40), - baseY + math.random(180,420), - VZ + math.random(-40,40) - ) - end, nil, math.random(0,25)) - end - - -- Lava splashes (nukexl) - local splashBaseY = baseY + 34 - local splashCount = math.random(2,3) - - for i = 1, splashCount do - DelayCall(function() - spSpawnCEG( - "volcano_lava_splash_nukexl", - VX + math.random(-45,45), - splashBaseY, - VZ + math.random(-45,45) - ) - end, nil, (i-1) * math.random(2,4)) - end - - -- Shockwave (single, anchored) - spSpawnCEG( - "shockwaveceg", - VX, - baseY, - VZ - ) - - -- Additional fire effects (same height as shockwave) - spSpawnCEG( - "volcano1_flames", - VX, - baseY, - VZ - ) - spSpawnCEG( - "volcano_rising_fireball_spawner", - VX, - baseY, - VZ - ) - - end - end -end - --------------------------------------------------------------------------------- --- Projectile visuals --------------------------------------------------------------------------------- -local activeFireballs = {} - -function gadget:ProjectileCreated(id, ownerID, weaponDefID) - if weaponDefID == volcanoFireballWeaponDefID then - activeFireballs[id] = true - end -end - -function gadget:ProjectileDestroyed(id) - activeFireballs[id] = nil -end - -function gadget:ProjectileMoved(id,x,y,z) - if activeFireballs[id] then - spSpawnCEG(FIRE_CEG, x,y,z) - end -end + -------------------------------------------------------------------------------- + -- Shortcuts + -------------------------------------------------------------------------------- + local spCreateUnit = Spring.CreateUnit + local spDestroyUnit = Spring.DestroyUnit + local spGiveOrderToUnit = Spring.GiveOrderToUnit + local spSpawnCEG = Spring.SpawnCEG + local spGetGroundHeight = Spring.GetGroundHeight + local spSetUnitCloak = Spring.SetUnitCloak + local spMoveCtrlEnable = Spring.MoveCtrl.Enable + local spMoveCtrlSetPosition = Spring.MoveCtrl.SetPosition + + local GameFrame = Spring.GetGameFrame + local SendToUnsynced = SendToUnsynced + + local CMD_ATTACK = CMD.ATTACK + local CMD_FIRE_STATE = CMD.FIRE_STATE + + -------------------------------------------------------------------------------- + -- Volcano center + -------------------------------------------------------------------------------- + local VX = Game.mapSizeX * 0.5 + local VZ = Game.mapSizeZ * 0.5 + + local VRIM = 600 + local LAUNCHER_Y = VRIM - 300 + + -------------------------------------------------------------------------------- + -- Timing control + -------------------------------------------------------------------------------- + local VOLCANO_EJECT_DELAY_FRAMES = 86 -- << EDIT THIS ONLY + + local FIRST_MIN = 8 * 60 * 30 -- 8 minutes + local FIRST_MAX = 12 * 60 * 30 -- 12 minutes + local COOLDOWN_MIN = 8 * 60 * 30 -- 8 minutes + local COOLDOWN_MAX = 12 * 60 * 30 -- 12 minutes + local BUILDUP = 20 * 30 + + -------------------------------------------------------------------------------- + -- Runtime / map control + -------------------------------------------------------------------------------- + local REQUIRED_MAP = "forge v2.3" + local volcanoActive = true + + local function Normalize(s) + s = tostring(s or "") + s = string.lower(s) + s = s:gsub(";", "") + s = s:gsub("%s+", " ") + s = s:gsub("^%s+", ""):gsub("%s+$", "") + return s + end + + local function IsVolcanoEnabled() + local modOpts = (Spring.GetModOptions and Spring.GetModOptions()) or {} + local v = modOpts.forge_volcano + return v == nil or v == true or v == 1 or v == "1" or v == "true" + end + + -------------------------------------------------------------------------------- + -- State + -------------------------------------------------------------------------------- + local nextErupt = nil + local delayed = {} + local pendingDestroy = {} + local firstFireballFrame = nil + local ejectScheduled = false + local buildupSoundPlayed = false + local volcanoFireballWeaponDefID = nil + + local function R(a, b) + return a + math.random() * (b - a) + end + + -------------------------------------------------------------------------------- + -- DelayCall helper + -------------------------------------------------------------------------------- + local function DelayCall(func, args, delay) + local f = GameFrame() + delay + delayed[f] = delayed[f] or {} + delayed[f][#delayed[f] + 1] = { func, args } + end + + -------------------------------------------------------------------------------- + -- Volcano Controls "/luarules volcano" to pause/resume volcano explosion + -------------------------------------------------------------------------------- + + local function ResetVolcanoState() + nextErupt = GameFrame() + R(COOLDOWN_MIN, COOLDOWN_MAX) + delayed = {} + pendingDestroy = {} + firstFireballFrame = nil + ejectScheduled = false + buildupSoundPlayed = false + end + + function gadget:Initialize() + if Normalize(Game.mapName) ~= REQUIRED_MAP then + gadgetHandler:RemoveGadget(self) + return + end + + if WeaponDefNames and WeaponDefNames["volcano_fireball"] then + volcanoFireballWeaponDefID = WeaponDefNames["volcano_fireball"].id + else + for weaponDefID, weaponDef in pairs(WeaponDefs) do + if weaponDef.name == "Volcano Fireball" then + volcanoFireballWeaponDefID = weaponDefID + break + end + end + end + + if volcanoFireballWeaponDefID then + Script.SetWatchProjectile(volcanoFireballWeaponDefID, true) + end + + volcanoActive = IsVolcanoEnabled() + if not volcanoActive then + ResetVolcanoState() + end + + gadgetHandler:AddChatAction("volcano", function(cmd, line, words, playerID) + local accountID = Spring.Utilities.GetAccountID(playerID) + local authorized = _G.permissions.volcano[accountID] + + if not (authorized or Spring.IsCheatingEnabled()) then + Spring.Echo("[Volcano] Unauthorized command.") + return + end + + volcanoActive = not volcanoActive + if volcanoActive then + nextErupt = GameFrame() + R(COOLDOWN_MIN, COOLDOWN_MAX) + Spring.Echo("[Volcano] Volcano system resumed.") + else + ResetVolcanoState() + Spring.Echo("[Volcano] Volcano system paused.") + end + end) + end + + function gadget:Shutdown() + if volcanoFireballWeaponDefID then + Script.SetWatchProjectile(volcanoFireballWeaponDefID, false) + end + gadgetHandler:RemoveChatAction("volcano") + end + + -------------------------------------------------------------------------------- + -- Ash helpers + -------------------------------------------------------------------------------- + local function spawnAshBuild() + local x = VX + math.random(-160, 160) + local z = VZ + math.random(-160, 160) + spSpawnCEG("volcano_ash_build", x, spGetGroundHeight(x, z) + VRIM, z) + end + + local function spawnAshBig() + local x = VX + math.random(-260, 260) + local z = VZ + math.random(-260, 260) + spSpawnCEG("volcano_ash_big", x, spGetGroundHeight(x, z) + VRIM + 50, z) + end + + local function spawnAshSmall() + local x = VX + math.random(-320, 320) + local z = VZ + math.random(-320, 320) + spSpawnCEG("volcano_ash_small", x, spGetGroundHeight(x, z) + VRIM, z) + end + + -------------------------------------------------------------------------------- + -- FIRE HELPERS + -------------------------------------------------------------------------------- + local FIRE_CEG = "volcano_fire-area" + + local FIRE_RIM_RADIUS = 160 * 1.20 + local VRIM_FIRE_HEIGHT = VRIM + + local function spawnFireRimCEG() + local a = math.random() * math.pi * 2 + local x = VX + math.cos(a) * FIRE_RIM_RADIUS + local z = VZ + math.sin(a) * FIRE_RIM_RADIUS + local y = spGetGroundHeight(VX, VZ) + VRIM_FIRE_HEIGHT + spSpawnCEG(FIRE_CEG, x, y, z) + end + + local function spawnFireMouthCEG() + local y = spGetGroundHeight(VX, VZ) + VRIM + spSpawnCEG(FIRE_CEG, VX + math.random(-30, 30), y, VZ + math.random(-30, 30)) + end + + local FIRE_OUTER_RADIUS_MIN = 220 + local FIRE_OUTER_RADIUS_MAX = 900 + + local function spawnFireSlopeCEG() + local a = math.random() * math.pi * 2 + local d = FIRE_OUTER_RADIUS_MIN + math.random() * (FIRE_OUTER_RADIUS_MAX - FIRE_OUTER_RADIUS_MIN) + + local x = VX + math.cos(a) * d + local z = VZ + math.sin(a) * d + local y = spGetGroundHeight(x, z) + 14 + + spSpawnCEG(FIRE_CEG, x, y, z) + end + + -------------------------------------------------------------------------------- + -- Fireball launcher + -------------------------------------------------------------------------------- + local function launchFireball() + if not firstFireballFrame then + firstFireballFrame = GameFrame() + ejectScheduled = false + end + + local uid = spCreateUnit("volcano_projectile_unit", VX, LAUNCHER_Y, VZ, 0, Spring.GetGaiaTeamID()) + if not uid then + return + end + + spSetUnitCloak(uid, true, 100000) + spMoveCtrlEnable(uid) + spMoveCtrlSetPosition(uid, VX, LAUNCHER_Y, VZ) + spGiveOrderToUnit(uid, CMD_FIRE_STATE, { 2 }, {}) + + local a = math.random() * math.pi * 2 + local d = 900 + math.random(900) + spGiveOrderToUnit(uid, CMD_ATTACK, { VX + math.cos(a) * d, spGetGroundHeight(VX, VZ) + 20, VZ + math.sin(a) * d }, {}) + + pendingDestroy[uid] = GameFrame() + 90 + end + + -------------------------------------------------------------------------------- + -- Main loop + -------------------------------------------------------------------------------- + function gadget:GameFrame(f) + if not volcanoActive then + return + end + + if delayed[f] then + for _, d in ipairs(delayed[f]) do + local fn, args = d[1], d[2] + if args then + fn(unpack(args)) + else + fn() + end + end + delayed[f] = nil + end + + for uid, kill in pairs(pendingDestroy) do + if f >= kill then + spDestroyUnit(uid, false, true) + pendingDestroy[uid] = nil + end + end + + if not nextErupt then + nextErupt = f + R(FIRST_MIN, FIRST_MAX) + return + end + + local remain = nextErupt - f + + if remain > 0 and remain <= BUILDUP then + if f % 4 == 0 then + spawnAshBuild() + end + if math.random() < 0.02 then + spawnFireRimCEG() + end + if math.random() < 0.03 then + spawnFireSlopeCEG() + end + + if not buildupSoundPlayed then + SendToUnsynced("volcano_buildup_rumble") + SendToUnsynced("quake_warning", "SEISMIC ACTIVITY DETECTED") + buildupSoundPlayed = true + end + return + end + + if f >= nextErupt then + buildupSoundPlayed = false + + for b = 1, 3 do + DelayCall(function() + for i = 1, math.random(3, 5) do + spawnFireRimCEG() + end + end, nil, b * (3 * 30)) + end + + math.random() + local n = math.random(5, 11) -- number of fireballs + local step = math.max(1, math.floor(60 / n)) + local start = 30 + math.random(0, 4) + + for i = 1, n do + DelayCall(launchFireball, nil, start + (i - 1) * step + math.random(0, 4)) + end + + for i = 1, math.random(10, 16) do + DelayCall(spawnFireMouthCEG, nil, math.random(0, 150)) + end + + for i = 1, math.random(12, 18) do + DelayCall(spawnFireSlopeCEG, nil, math.random(0, 180)) + end + + DelayCall(function() + for i = 1, 28 do + spawnAshBig() + end + end, nil, start) + + for i = 1, 18 do + spawnAshSmall() + end + + nextErupt = f + R(COOLDOWN_MIN, COOLDOWN_MAX) + end + + ------------------------------------------------------------------ + -- EJECT PLUME + LAVA SPLASHES + SHOCKWAVE + ------------------------------------------------------------------ + if firstFireballFrame and not ejectScheduled then + if f >= firstFireballFrame + VOLCANO_EJECT_DELAY_FRAMES then + ejectScheduled = true + firstFireballFrame = nil + + SendToUnsynced("volcano_eject_sound") + + local groundY = spGetGroundHeight(VX, VZ) + local baseY = groundY + VRIM + + -- Eject plume (unchanged) + for i = 1, math.random(3, 5) do + DelayCall(function() + spSpawnCEG("volcano_eject", VX + math.random(-40, 40), baseY + math.random(180, 420), VZ + math.random(-40, 40)) + end, nil, math.random(0, 25)) + end + + -- Lava splashes (nukexl) + local splashBaseY = baseY + 34 + local splashCount = math.random(2, 3) + + for i = 1, splashCount do + DelayCall(function() + spSpawnCEG("volcano_lava_splash_nukexl", VX + math.random(-45, 45), splashBaseY, VZ + math.random(-45, 45)) + end, nil, (i - 1) * math.random(2, 4)) + end + + -- Shockwave (single, anchored) + spSpawnCEG("shockwaveceg", VX, baseY, VZ) + + -- Additional fire effects (same height as shockwave) + spSpawnCEG("volcano1_flames", VX, baseY, VZ) + spSpawnCEG("volcano_rising_fireball_spawner", VX, baseY, VZ) + end + end + end + + -------------------------------------------------------------------------------- + -- Projectile visuals + -------------------------------------------------------------------------------- + local activeFireballs = {} + + function gadget:ProjectileCreated(id, ownerID, weaponDefID) + if weaponDefID == volcanoFireballWeaponDefID then + activeFireballs[id] = true + end + end + + function gadget:ProjectileDestroyed(id) + activeFireballs[id] = nil + end + + function gadget:ProjectileMoved(id, x, y, z) + if activeFireballs[id] then + spSpawnCEG(FIRE_CEG, x, y, z) + end + end -------------------------------------------------------------------------------- -- UNSYNCED (SOUNDS + WARNING UI) -------------------------------------------------------------------------------- else - -local spPlaySoundFile = Spring.PlaySoundFile -local spGetGameFrame = Spring.GetGameFrame -local spGetViewGeometry = Spring.GetViewGeometry - -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glTranslate = gl.Translate -local glText = gl.Text - -local WARNING_FRAMES = 90 -- ~3 seconds at 30 fps - -local warningText, warningEnd - -function gadget:Initialize() - gadgetHandler:AddSyncAction("volcano_buildup_rumble", function() - spPlaySoundFile("sounds/atmos/lavarumble2.wav", 1.0, "ui") - end) - - gadgetHandler:AddSyncAction("volcano_eject_sound", function() - spPlaySoundFile("sounds/atmos-local/lavaburst2.wav", 1.5, "ui") - spPlaySoundFile("sounds/atmos/lavarumble3.wav", 0.9, "ui") - spPlaySoundFile("sounds/weapons/xplolrg1.wav", 0.55, "ui") - end) - - gadgetHandler:AddSyncAction("quake_warning", function(_, msg) - warningText = msg or "SEISMIC ACTIVITY DETECTED" - warningEnd = spGetGameFrame() + WARNING_FRAMES - - Spring.Echo("[Volcano] Warning: " .. warningText) - spPlaySoundFile("sounds/voice-soundeffects/LavaAlert.wav", 1.0, "ui") - end) -end - --- Big warning text at top of screen during WARNING_FRAMES -function gadget:DrawScreen() - local frame = spGetGameFrame() - if warningText and frame < warningEnd then - local vsx, vsy = spGetViewGeometry() - glPushMatrix() - glTranslate(vsx * 0.5, vsy * 0.7, 0) - glText(warningText, 0, 0, 36, "oc") - glPopMatrix() - end -end - + local spPlaySoundFile = Spring.PlaySoundFile + local spGetGameFrame = Spring.GetGameFrame + local spGetViewGeometry = Spring.GetViewGeometry + + local glPushMatrix = gl.PushMatrix + local glPopMatrix = gl.PopMatrix + local glTranslate = gl.Translate + local glText = gl.Text + + local WARNING_FRAMES = 90 -- ~3 seconds at 30 fps + + local warningText, warningEnd + + function gadget:Initialize() + gadgetHandler:AddSyncAction("volcano_buildup_rumble", function() + spPlaySoundFile("sounds/atmos/lavarumble2.wav", 1.0, "ui") + end) + + gadgetHandler:AddSyncAction("volcano_eject_sound", function() + spPlaySoundFile("sounds/atmos-local/lavaburst2.wav", 1.5, "ui") + spPlaySoundFile("sounds/atmos/lavarumble3.wav", 0.9, "ui") + spPlaySoundFile("sounds/weapons/xplolrg1.wav", 0.55, "ui") + end) + + gadgetHandler:AddSyncAction("quake_warning", function(_, msg) + warningText = msg or "SEISMIC ACTIVITY DETECTED" + warningEnd = spGetGameFrame() + WARNING_FRAMES + + Spring.Echo("[Volcano] Warning: " .. warningText) + spPlaySoundFile("sounds/voice-soundeffects/LavaAlert.wav", 1.0, "ui") + end) + end + + -- Big warning text at top of screen during WARNING_FRAMES + function gadget:DrawScreen() + local frame = spGetGameFrame() + if warningText and frame < warningEnd then + local vsx, vsy = spGetViewGeometry() + glPushMatrix() + glTranslate(vsx * 0.5, vsy * 0.7, 0) + glText(warningText, 0, 0, 36, "oc") + glPopMatrix() + end + end end -------------------------------------------------------------------------------- diff --git a/luarules/gadgets/gfx_beam_laser_gl4.lua b/luarules/gadgets/gfx_beam_laser_gl4.lua index cb5cb9efa51..89cc96a81cf 100644 --- a/luarules/gadgets/gfx_beam_laser_gl4.lua +++ b/luarules/gadgets/gfx_beam_laser_gl4.lua @@ -5,7 +5,9 @@ -- edge glow, and range-based intensity falloff. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { @@ -22,37 +24,37 @@ end -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spIsPosInLos = Spring.IsPosInLos -local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetGameFrame = Spring.GetGameFrame -local spGetFrameTimeOffset = Spring.GetFrameTimeOffset -local spGetGameSpeed = Spring.GetGameSpeed -local spGetProjectileOwnerID = Spring.GetProjectileOwnerID +local spEcho = Spring.Echo +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spIsPosInLos = Spring.IsPosInLos +local spIsPosInAirLos = Spring.IsPosInAirLos +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetGameFrame = Spring.GetGameFrame +local spGetFrameTimeOffset = Spring.GetFrameTimeOffset +local spGetGameSpeed = Spring.GetGameSpeed +local spGetProjectileOwnerID = Spring.GetProjectileOwnerID local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle -local spIsAABBInView = Spring.IsAABBInView +local spIsAABBInView = Spring.IsAABBInView -local glBlending = gl.Blending -local glTexture = gl.Texture +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA -local mathMin = math.min -local mathMax = math.max -local mathSqrt = math.sqrt -local mathFloor = math.floor +local mathMin = math.min +local mathMax = math.max +local mathSqrt = math.sqrt +local mathFloor = math.floor local LuaShader = gl.LuaShader local uploadAllElements = gl.InstanceVBOTable.uploadAllElements @@ -63,15 +65,15 @@ local uploadAllElements = gl.InstanceVBOTable.uploadAllElements -------------------------------------------------------------------------------- -- Limits -local INITIAL_VBO_SIZE = 64 -- starting VBO capacity (doubles automatically when exceeded) -local IDLE_SKIP_FRAMES = 3 -- draw-frames to skip polling when no beams active +local INITIAL_VBO_SIZE = 64 -- starting VBO capacity (doubles automatically when exceeded) +local IDLE_SKIP_FRAMES = 3 -- draw-frames to skip polling when no beams active -- Per-weapon ghost frames: scaled by beam thickness so small lasers fade fast -local GHOST_FRAMES_MIN = 3 -- ghost frames for thinnest beams -local GHOST_FRAMES_MAX = 8 -- ghost frames for thickest beams -local GHOST_THICKNESS_MIN = 1.5 -- thickness at or below which gets min ghost frames -local GHOST_THICKNESS_MAX = 5.0 -- thickness at or above which gets max ghost frames -local FLARE_GHOST_FRAC = 0.4 -- fraction of weapon ghostFrames where flare stays visible (0..1) +local GHOST_FRAMES_MIN = 3 -- ghost frames for thinnest beams +local GHOST_FRAMES_MAX = 8 -- ghost frames for thickest beams +local GHOST_THICKNESS_MIN = 1.5 -- thickness at or below which gets min ghost frames +local GHOST_THICKNESS_MAX = 5.0 -- thickness at or above which gets max ghost frames +local FLARE_GHOST_FRAC = 0.4 -- fraction of weapon ghostFrames where flare stays visible (0..1) -- Hardpoint bucketing: muzzle position is quantized into a coarse grid and the -- bucket index is part of the tracking key. This lets multiple hardpoints on @@ -80,18 +82,18 @@ local FLARE_GHOST_FRAC = 0.4 -- fraction of weapon ghostFrames where flar -- one rotating turret (whose muzzle moves only a few elmos between shots) -- onto the same key -- avoiding the "stuttering rapid-fire trail" that a -- per-shot key would produce. -local HARDPOINT_BUCKET_SIZE = 12 -- elmos per bucket on each axis -local INV_HARDPOINT_BUCKET = 1 / HARDPOINT_BUCKET_SIZE +local HARDPOINT_BUCKET_SIZE = 12 -- elmos per bucket on each axis +local INV_HARDPOINT_BUCKET = 1 / HARDPOINT_BUCKET_SIZE -- Textures -local beamTexture = "bitmaps/projectiletextures/largebeam.tga" +local beamTexture = "bitmaps/projectiletextures/largebeam.tga" local flareTexture = "bitmaps/projectiletextures/flare2.tga" -- LOS clipping -local CLIP_BEAM_TO_LOS = true -- when true, only the portion of enemy beams inside LOS is rendered -local USE_AIR_LOS = true -- use air los instead of regular los -local LOS_CLIP_STEPS = 6 -- binary search iterations to find the LOS boundary (6 ≈ 1.5% precision) -local LOS_BONUS_RANGE = 100 -- when not USE_AIR_LOS then extra elmos of beam shown beyond strict LOS boundary (so beams always render a bit more) +local CLIP_BEAM_TO_LOS = true -- when true, only the portion of enemy beams inside LOS is rendered +local USE_AIR_LOS = true -- use air los instead of regular los +local LOS_CLIP_STEPS = 6 -- binary search iterations to find the LOS boundary (6 ≈ 1.5% precision) +local LOS_BONUS_RANGE = 100 -- when not USE_AIR_LOS then extra elmos of beam shown beyond strict LOS boundary (so beams always render a bit more) -- Resolve LOS check function once (avoids per-call branch in hot loop) local spLosCheck = USE_AIR_LOS and spIsPosInAirLos or spIsPosInLos @@ -104,127 +106,134 @@ local spLosCheck = USE_AIR_LOS and spIsPosInAirLos or spIsPosInLos -- every target switch, which was more disruptive than the original snap. -- Beam body -local BEAM_WIDTH_MULT = 0.3 -- multiplier on weapon thickness for beam quad width -local BEAM_SUSTAIN_LIFEFRAC = 0.33 -- lifeFrac value for live beams (must be between FADE_IN_END and FADE_OUT_START) -local BEAM_RANGE_FALLOFF_BASE = 0.1 -- minimum intensity falloff along beam length -local BEAM_RANGE_FALLOFF_MULT = 0.5 -- additional falloff scaled by beam-length / weapon-range +local BEAM_WIDTH_MULT = 0.3 -- multiplier on weapon thickness for beam quad width +local BEAM_SUSTAIN_LIFEFRAC = 0.33 -- lifeFrac value for live beams (must be between FADE_IN_END and FADE_OUT_START) +local BEAM_RANGE_FALLOFF_BASE = 0.1 -- minimum intensity falloff along beam length +local BEAM_RANGE_FALLOFF_MULT = 0.5 -- additional falloff scaled by beam-length / weapon-range -- Core color boost (applied in weaponConfigs build) -local CORE_COLOR_ADD = 0.5 -- added to weapon RGB to create brighter core color (clamped to 1) +local CORE_COLOR_ADD = 0.5 -- added to weapon RGB to create brighter core color (clamped to 1) -- Flare billboard -local FLARE_SIZE_MULT = 0.7 -- multiplier on (laserflaresize * thickness) -local FLARE_COLOR_MULT = 1.0 -- multiplier on core color for flare RGB -local FLARE_LIFE_DIM = 0.7 -- how much flare dims over beam lifetime (0 = none, 1 = fully dark at end) +local FLARE_SIZE_MULT = 0.7 -- multiplier on (laserflaresize * thickness) +local FLARE_COLOR_MULT = 1.0 -- multiplier on core color for flare RGB +local FLARE_LIFE_DIM = 0.7 -- how much flare dims over beam lifetime (0 = none, 1 = fully dark at end) -- Beam glow halo -local GLOW_WIDTH_MULT = 8.0 -- glow quad width as multiple of beam width -local GLOW_BRIGHTNESS = 0.17 -- glow intensity (additive) -local GLOW_FALLOFF_POWER = 1.8 -- falloff curve exponent (<1 = fast initial drop + long tail, 1 = linear, >1 = slow start + sharp cutoff) -local GLOW_THICKNESS_DIM = 2.0 -- beams thinner than this get minimum glow -local GLOW_THICKNESS_FULL = 4.0 -- beams thicker than this get full glow -local GLOW_DIM_FACTOR = 0.2 -- glow brightness multiplier for thinnest beams (0..1) +local GLOW_WIDTH_MULT = 8.0 -- glow quad width as multiple of beam width +local GLOW_BRIGHTNESS = 0.17 -- glow intensity (additive) +local GLOW_FALLOFF_POWER = 1.8 -- falloff curve exponent (<1 = fast initial drop + long tail, 1 = linear, >1 = slow start + sharp cutoff) +local GLOW_THICKNESS_DIM = 2.0 -- beams thinner than this get minimum glow +local GLOW_THICKNESS_FULL = 4.0 -- beams thicker than this get full glow +local GLOW_DIM_FACTOR = 0.2 -- glow brightness multiplier for thinnest beams (0..1) -- Traveling pulse -local PULSE_WIDTH_MULT = 2.0 -- pulse quad width as multiple of beam width -local PULSE_BRIGHTNESS = 3.3 -- pulse intensity (additive, on top of beam) -local PULSE_SPEED = 950.0 -- pulse travel speed in world units (elmos) per second -local PULSE_SPACING = 200.0 -- distance between pulse centers in world units (elmos) -local PULSE_SIGMA = 35.0 -- gaussian half-width of each pulse in world units (elmos) -local PULSE_CORE_FRAC = 0.3 -- fraction of pulse width that is bright core (0..1) +local PULSE_WIDTH_MULT = 2.0 -- pulse quad width as multiple of beam width +local PULSE_BRIGHTNESS = 3.3 -- pulse intensity (additive, on top of beam) +local PULSE_SPEED = 950.0 -- pulse travel speed in world units (elmos) per second +local PULSE_SPACING = 200.0 -- distance between pulse centers in world units (elmos) +local PULSE_SIGMA = 35.0 -- gaussian half-width of each pulse in world units (elmos) +local PULSE_CORE_FRAC = 0.3 -- fraction of pulse width that is bright core (0..1) -- Paralyzer beam pulse overrides (faster, brighter, tighter) -local PULSE_PARA_BRIGHTNESS = 8.0 -- pulse intensity for paralyzer beams -local PULSE_PARA_SPEED = 250.0 -- pulse travel speed for paralyzer beams (elmos/sec) -local PULSE_PARA_SPACING = 15.0 -- distance between pulses for paralyzer beams (elmos) -local PULSE_PARA_SIGMA = 1.1 -- gaussian half-width of each pulse for paralyzer beams (elmos) -local PULSE_PARA_WIDTH_MULT = 2.5 -- pulse quad width as multiple of beam width for paralyzer beams +local PULSE_PARA_BRIGHTNESS = 8.0 -- pulse intensity for paralyzer beams +local PULSE_PARA_SPEED = 250.0 -- pulse travel speed for paralyzer beams (elmos/sec) +local PULSE_PARA_SPACING = 15.0 -- distance between pulses for paralyzer beams (elmos) +local PULSE_PARA_SIGMA = 1.1 -- gaussian half-width of each pulse for paralyzer beams (elmos) +local PULSE_PARA_WIDTH_MULT = 2.5 -- pulse quad width as multiple of beam width for paralyzer beams -- Shader config (injected as #defines into beam vertex+fragment shaders) local shaderConfig = { - FADE_IN_END = 0.1, -- lifeFrac where width/alpha fade-in completes - FADE_OUT_START = 0.85, -- lifeFrac where width/alpha fade-out begins - RANGE_TAPER = 0.3, -- width reduction at beam end (0 = none, 1 = full taper to zero) - SHIMMER_AMPLITUDE = 0.13, -- width oscillation strength (0 = off) - SHIMMER_SPEED = 40.0, -- width oscillation speed (timeInfo.z multiplier) - CORE_EDGE_START = 0.02, -- |x| distance where core-to-edge color blend starts (0 = only center pixel) - CORE_EDGE_END = 0.44, -- |x| distance where blend is fully edge color - CORE_BRIGHTNESS = 1.1, -- extra brightness multiplier for core (squared falloff) - BRIGHTNESS_MULT = 1.5, -- overall beam brightness multiplier - MIN_PIXEL_WIDTH = 0.0018, -- minimum beam width as fraction of camera distance (prevents sub-pixel aliasing at distance) - TIP_FADE_START = 0.93, -- beam length fraction (0..1) where tip fade-out begins + FADE_IN_END = 0.1, -- lifeFrac where width/alpha fade-in completes + FADE_OUT_START = 0.85, -- lifeFrac where width/alpha fade-out begins + RANGE_TAPER = 0.3, -- width reduction at beam end (0 = none, 1 = full taper to zero) + SHIMMER_AMPLITUDE = 0.13, -- width oscillation strength (0 = off) + SHIMMER_SPEED = 40.0, -- width oscillation speed (timeInfo.z multiplier) + CORE_EDGE_START = 0.02, -- |x| distance where core-to-edge color blend starts (0 = only center pixel) + CORE_EDGE_END = 0.44, -- |x| distance where blend is fully edge color + CORE_BRIGHTNESS = 1.1, -- extra brightness multiplier for core (squared falloff) + BRIGHTNESS_MULT = 1.5, -- overall beam brightness multiplier + MIN_PIXEL_WIDTH = 0.0018, -- minimum beam width as fraction of camera distance (prevents sub-pixel aliasing at distance) + TIP_FADE_START = 0.93, -- beam length fraction (0..1) where tip fade-out begins } -------------------------------------------------------------------------------- -- Build weaponDefID -> beam config lookup -- Reads weapon colors, thickness, flare size, range, beamtime from WeaponDefs -------------------------------------------------------------------------------- -local weaponConfigs = {} -- weaponDefID -> config table -local LIVE_FLARE_PULSE_INIT = 1.0 - BEAM_SUSTAIN_LIFEFRAC * FLARE_LIFE_DIM -- pre-computed for weaponConfigs +local weaponConfigs = {} -- weaponDefID -> config table +local LIVE_FLARE_PULSE_INIT = 1.0 - BEAM_SUSTAIN_LIFEFRAC * FLARE_LIFE_DIM -- pre-computed for weaponConfigs for weaponID, weaponDef in pairs(WeaponDefs) do if weaponDef.type == "BeamLaser" then local cp = weaponDef.customParams or {} if not cp.bogus then - local vis = weaponDef.visuals or {} - local r = vis.colorR or 1 - local g = vis.colorG or 1 - local b = vis.colorB or 1 - - -- Core is brighter, edge is the weapon color - local coreR = mathMin(1, r + CORE_COLOR_ADD) - local coreG = mathMin(1, g + CORE_COLOR_ADD) - local coreB = mathMin(1, b + CORE_COLOR_ADD) - - -- Read original visual properties from customparams (alldefs_post stores them before zeroing) - local thickness = tonumber(cp.beam_thickness_orig) or weaponDef.thickness or 2 - local corethickness = tonumber(cp.beam_corethickness_orig) or weaponDef.corethickness or 0.3 - local laserflaresize = tonumber(cp.beam_laserflaresize_orig) or weaponDef.laserflaresize or 7 - local range = weaponDef.range or 300 - local beamttl = weaponDef.beamttl or 3 - local beamtime = weaponDef.beamtime or 0.1 - - -- Paralyzer beams get a unique tint - local isParalyzer = weaponDef.paralyzer or false - - -- Per-weapon ghost frames based on thickness - local ghostFrac = mathMin(1, mathMax(0, (thickness - GHOST_THICKNESS_MIN) / (GHOST_THICKNESS_MAX - GHOST_THICKNESS_MIN))) - local ghostFrames = math.floor(GHOST_FRAMES_MIN + ghostFrac * (GHOST_FRAMES_MAX - GHOST_FRAMES_MIN) + 0.5) - local flareGhostFrames = mathMax(1, math.floor(ghostFrames * FLARE_GHOST_FRAC + 0.5)) - - weaponConfigs[weaponID] = { - colorR = r, colorG = g, colorB = b, - coreR = coreR, coreG = coreG, coreB = coreB, - thickness = thickness, - corethickness = corethickness, - flareSize = laserflaresize * thickness, - range = range, - beamttl = beamttl, - beamtime = beamtime, - isParalyzer = isParalyzer, - -- Per-weapon ghost config - ghostFrames = ghostFrames, - flareGhostFrames = flareGhostFrames, - invGhostFrames = 1.0 / ghostFrames, - -- Pre-computed for hot loop - beamWidth = thickness * BEAM_WIDTH_MULT, - invRangeSq = 1.0 / mathMax(range * range, 1), - aabbPad = thickness * BEAM_WIDTH_MULT * GLOW_WIDTH_MULT, -- padding for AABB view check (covers glow quad) - flareColorR = coreR * FLARE_COLOR_MULT, - flareColorG = coreG * FLARE_COLOR_MULT, - flareColorB = coreB * FLARE_COLOR_MULT, - liveFlareSize = laserflaresize * thickness * LIVE_FLARE_PULSE_INIT * FLARE_SIZE_MULT, - liveFlareR = coreR * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, - liveFlareG = coreG * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, - liveFlareB = coreB * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, - } + local vis = weaponDef.visuals or {} + local r = vis.colorR or 1 + local g = vis.colorG or 1 + local b = vis.colorB or 1 + + -- Core is brighter, edge is the weapon color + local coreR = mathMin(1, r + CORE_COLOR_ADD) + local coreG = mathMin(1, g + CORE_COLOR_ADD) + local coreB = mathMin(1, b + CORE_COLOR_ADD) + + -- Read original visual properties from customparams (alldefs_post stores them before zeroing) + local thickness = tonumber(cp.beam_thickness_orig) or weaponDef.thickness or 2 + local corethickness = tonumber(cp.beam_corethickness_orig) or weaponDef.corethickness or 0.3 + local laserflaresize = tonumber(cp.beam_laserflaresize_orig) or weaponDef.laserflaresize or 7 + local range = weaponDef.range or 300 + local beamttl = weaponDef.beamttl or 3 + local beamtime = weaponDef.beamtime or 0.1 + + -- Paralyzer beams get a unique tint + local isParalyzer = weaponDef.paralyzer or false + + -- Per-weapon ghost frames based on thickness + local ghostFrac = mathMin(1, mathMax(0, (thickness - GHOST_THICKNESS_MIN) / (GHOST_THICKNESS_MAX - GHOST_THICKNESS_MIN))) + local ghostFrames = math.floor(GHOST_FRAMES_MIN + ghostFrac * (GHOST_FRAMES_MAX - GHOST_FRAMES_MIN) + 0.5) + local flareGhostFrames = mathMax(1, math.floor(ghostFrames * FLARE_GHOST_FRAC + 0.5)) + + weaponConfigs[weaponID] = { + colorR = r, + colorG = g, + colorB = b, + coreR = coreR, + coreG = coreG, + coreB = coreB, + thickness = thickness, + corethickness = corethickness, + flareSize = laserflaresize * thickness, + range = range, + beamttl = beamttl, + beamtime = beamtime, + isParalyzer = isParalyzer, + -- Per-weapon ghost config + ghostFrames = ghostFrames, + flareGhostFrames = flareGhostFrames, + invGhostFrames = 1.0 / ghostFrames, + -- Pre-computed for hot loop + beamWidth = thickness * BEAM_WIDTH_MULT, + invRangeSq = 1.0 / mathMax(range * range, 1), + aabbPad = thickness * BEAM_WIDTH_MULT * GLOW_WIDTH_MULT, -- padding for AABB view check (covers glow quad) + flareColorR = coreR * FLARE_COLOR_MULT, + flareColorG = coreG * FLARE_COLOR_MULT, + flareColorB = coreB * FLARE_COLOR_MULT, + liveFlareSize = laserflaresize * thickness * LIVE_FLARE_PULSE_INIT * FLARE_SIZE_MULT, + liveFlareR = coreR * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, + liveFlareG = coreG * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, + liveFlareB = coreB * FLARE_COLOR_MULT * LIVE_FLARE_PULSE_INIT, + } end end end -- Check if we have any beam weapons local hasConfigs = false -for _ in pairs(weaponConfigs) do hasConfigs = true; break end +for _ in pairs(weaponConfigs) do + hasConfigs = true + break +end if not hasConfigs then function gadget:Initialize() gadgetHandler:RemoveGadget() @@ -245,21 +254,21 @@ end -- liveBeamSlot / liveKeysList dicts (each of which cost a string concat per beam -- per frame). "Live this call" test is simply rec.liveStamp == callStamp; the -- dedupe slot is rec.liveSlot, only meaningful when liveStamp matches. -local weaponBeams = {} -- [ownerID] = { [innerKey] = rec } +local weaponBeams = {} -- [ownerID] = { [innerKey] = rec } local beamCleanupFrame = 0 -local hasGhosts = false -- true when weaponBeams has any entries (skip ghost loop when empty) +local hasGhosts = false -- true when weaponBeams has any entries (skip ghost loop when empty) local removeOwnerList = {} -- reused across cleanup cycles -local removeKeyList = {} -- parallel to removeOwnerList +local removeKeyList = {} -- parallel to removeOwnerList local removeCount = 0 -- Object pools: avoid allocating fresh tracked records / ownerBeams sub-tables -- every time a hardpoint resumes firing after a pause (or a unit fires for the -- first time). Reused entries are reset on acquire; on release we strip cfg -- (the only field that might pin a stale reference). -local trackedPool = {} -local trackedPoolN = 0 -local ownerBeamsPool = {} -local ownerBeamsPoolN = 0 +local trackedPool = {} +local trackedPoolN = 0 +local ownerBeamsPool = {} +local ownerBeamsPoolN = 0 local function releaseTrackedBeam(rec) rec.cfg = nil @@ -568,17 +577,17 @@ void main(void) -- Smooth radial falloff + soft ends at both start and tip. -------------------------------------------------------------------------------- local glowShaderConfig = { - FADE_IN_END = shaderConfig.FADE_IN_END, - FADE_OUT_START = shaderConfig.FADE_OUT_START, - SHIMMER_AMPLITUDE = shaderConfig.SHIMMER_AMPLITUDE * 0.5, - SHIMMER_SPEED = shaderConfig.SHIMMER_SPEED, - GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, - GLOW_BRIGHTNESS = GLOW_BRIGHTNESS, + FADE_IN_END = shaderConfig.FADE_IN_END, + FADE_OUT_START = shaderConfig.FADE_OUT_START, + SHIMMER_AMPLITUDE = shaderConfig.SHIMMER_AMPLITUDE * 0.5, + SHIMMER_SPEED = shaderConfig.SHIMMER_SPEED, + GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, + GLOW_BRIGHTNESS = GLOW_BRIGHTNESS, GLOW_FALLOFF_POWER = GLOW_FALLOFF_POWER, - GLOW_WIDTH_DIM = GLOW_THICKNESS_DIM * BEAM_WIDTH_MULT, - GLOW_WIDTH_FULL = GLOW_THICKNESS_FULL * BEAM_WIDTH_MULT, - GLOW_DIM_FACTOR = GLOW_DIM_FACTOR, - MIN_PIXEL_WIDTH = shaderConfig.MIN_PIXEL_WIDTH, + GLOW_WIDTH_DIM = GLOW_THICKNESS_DIM * BEAM_WIDTH_MULT, + GLOW_WIDTH_FULL = GLOW_THICKNESS_FULL * BEAM_WIDTH_MULT, + GLOW_DIM_FACTOR = GLOW_DIM_FACTOR, + MIN_PIXEL_WIDTH = shaderConfig.MIN_PIXEL_WIDTH, } local glowVsSrc = [[ @@ -729,20 +738,20 @@ void main(void) -- Reuses the same VBO. Renders bright spots that travel from origin to target. -------------------------------------------------------------------------------- local pulseShaderConfig = { - FADE_IN_END = shaderConfig.FADE_IN_END, - FADE_OUT_START = shaderConfig.FADE_OUT_START, - PULSE_WIDTH_MULT = PULSE_WIDTH_MULT, - PULSE_BRIGHTNESS = PULSE_BRIGHTNESS, - PULSE_SPEED = PULSE_SPEED, - PULSE_SPACING = PULSE_SPACING, - PULSE_SIGMA = PULSE_SIGMA, - PULSE_CORE_FRAC = PULSE_CORE_FRAC, - PULSE_PARA_BRIGHTNESS = PULSE_PARA_BRIGHTNESS, - PULSE_PARA_SPEED = PULSE_PARA_SPEED, - PULSE_PARA_SPACING = PULSE_PARA_SPACING, - PULSE_PARA_SIGMA = PULSE_PARA_SIGMA, - PULSE_PARA_WIDTH_MULT = PULSE_PARA_WIDTH_MULT, - MIN_PIXEL_WIDTH = shaderConfig.MIN_PIXEL_WIDTH, + FADE_IN_END = shaderConfig.FADE_IN_END, + FADE_OUT_START = shaderConfig.FADE_OUT_START, + PULSE_WIDTH_MULT = PULSE_WIDTH_MULT, + PULSE_BRIGHTNESS = PULSE_BRIGHTNESS, + PULSE_SPEED = PULSE_SPEED, + PULSE_SPACING = PULSE_SPACING, + PULSE_SIGMA = PULSE_SIGMA, + PULSE_CORE_FRAC = PULSE_CORE_FRAC, + PULSE_PARA_BRIGHTNESS = PULSE_PARA_BRIGHTNESS, + PULSE_PARA_SPEED = PULSE_PARA_SPEED, + PULSE_PARA_SPACING = PULSE_PARA_SPACING, + PULSE_PARA_SIGMA = PULSE_PARA_SIGMA, + PULSE_PARA_WIDTH_MULT = PULSE_PARA_WIDTH_MULT, + MIN_PIXEL_WIDTH = shaderConfig.MIN_PIXEL_WIDTH, } local pulseVsSrc = [[ @@ -949,7 +958,7 @@ local lastDrawWorldSimFrame = -1 -- projectile IDs on the first paused frame and iterate that small cache on -- subsequent paused frames. local lastUpdateWasPaused = false -local pausedBeamCache = {} -- list of proIDs (beam-laser only) +local pausedBeamCache = {} -- list of proIDs (beam-laser only) local pausedBeamCacheCount = 0 -- Paused-state camera tracking: while paused, only rebuild when camera moves @@ -968,8 +977,7 @@ local function pausedShouldSkipRebuild(usePausedCache, isPaused) if usePausedCache then local cx, cy, cz = Spring.GetCameraPosition() local dx, dy, dz = Spring.GetCameraDirection() - if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ - and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then + if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then return true end -- Camera moved while paused: cap rebuild rate to ~20Hz wall-clock @@ -1085,20 +1093,16 @@ local function initGL4() end -- Shared quad VBOs - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "beamLaserQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "beamLaserQuadVBO") local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("beamLaserIndexVBO") -- Beam VBO layout: beam data + flare data local beamLayout = { - {id = 1, name = 'startPosAndWidth', size = 4}, - {id = 2, name = 'endPosAndLife', size = 4}, - {id = 3, name = 'coreColor', size = 4}, - {id = 4, name = 'edgeColor', size = 4}, - {id = 5, name = 'flareData', size = 4}, + { id = 1, name = "startPosAndWidth", size = 4 }, + { id = 2, name = "endPosAndLife", size = 4 }, + { id = 3, name = "coreColor", size = 4 }, + { id = 4, name = "edgeColor", size = 4 }, + { id = 5, name = "flareData", size = 4 }, } beamVBO = gl.InstanceVBOTable.makeInstanceVBOTable(beamLayout, INITIAL_VBO_SIZE, "beamLaserVBO") if not beamVBO then @@ -1117,7 +1121,9 @@ end local function resizeBeamVBO(needed) local newMax = beamVBO.maxElements - while newMax < needed do newMax = newMax * 2 end + while newMax < needed do + newMax = newMax * 2 + end beamVBO.maxElements = newMax local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(newMax, beamVBO.layout) @@ -1126,7 +1132,9 @@ local function resizeBeamVBO(needed) -- Extend instanceData array local data = beamVBO.instanceData local step = beamVBO.instanceStep - for i = #data + 1, step * newMax do data[i] = 0 end + for i = #data + 1, step * newMax do + data[i] = 0 + end -- Reattach VAO beamVBO.VAO:Delete() beamVBO.VAO = beamVBO:makeVAOandAttach(beamVBO.vertexVBO, beamVBO.instanceVBO) @@ -1134,14 +1142,19 @@ local function resizeBeamVBO(needed) end local function cleanupGL4() - if beamVBO then beamVBO:Delete(); beamVBO = nil end + if beamVBO then + beamVBO:Delete() + beamVBO = nil + end end -------------------------------------------------------------------------------- -- Drawing -------------------------------------------------------------------------------- local function drawAll() - if beamVBO.usedElements == 0 then return end + if beamVBO.usedElements == 0 then + return + end glDepthTest(true) glDepthMask(false) @@ -1228,7 +1241,9 @@ local function updateBeams() -- unchanged (or throttle-gated during a pan); the existing VBO contents are -- replayed by drawAll(). Kept as a separate function so this function stays -- under Lua's 60-upvalue limit. - if pausedShouldSkipRebuild(usePausedCache, isPaused) then return end + if pausedShouldSkipRebuild(usePausedCache, isPaused) then + return + end -- Idle skip: throttle when no beams or ghosts active. Disabled while paused -- so camera pans always re-cull. (When using the paused cache the cost is @@ -1302,26 +1317,25 @@ local function updateBeams() if px then local vx, vy, vz = spGetProjectileVelocity(proID) if vx then - local endX = px + vx - local endY = py + vy - local endZ = pz + vz - - -- LOS check: beam is visible if start OR end is in LOS - local visible = true - local startInLos = true - local endInLos = true - local proAlly - if needLosCheck then - local proTeam = spGetProjectileTeamID(proID) - proAlly = proTeam and spGetTeamAllyTeamID(proTeam) - if proAlly ~= myAllyTeam then - startInLos = spLosCheck(px, 0, pz, myAllyTeam) - endInLos = spLosCheck(endX, 0, endZ, myAllyTeam) - visible = startInLos or endInLos + local endX = px + vx + local endY = py + vy + local endZ = pz + vz + + -- LOS check: beam is visible if start OR end is in LOS + local visible = true + local startInLos = true + local endInLos = true + local proAlly + if needLosCheck then + local proTeam = spGetProjectileTeamID(proID) + proAlly = proTeam and spGetTeamAllyTeamID(proTeam) + if proAlly ~= myAllyTeam then + startInLos = spLosCheck(px, 0, pz, myAllyTeam) + endInLos = spLosCheck(endX, 0, endZ, myAllyTeam) + visible = startInLos or endInLos + end end - end - if visible then - + if visible then -- Save original (unclipped) positions for ghost beam tracking local origPx, origPy, origPz = px, py, pz local origEndX, origEndY, origEndZ = endX, endY, endZ @@ -1332,7 +1346,7 @@ local function updateBeams() local t = findLosBoundary(px, pz, endX, endZ, myAllyTeam, startInLos) -- Extend visible portion by bonus range (ground LOS only) if not USE_AIR_LOS and LOS_BONUS_RANGE > 0 then - local beamLen = mathSqrt(vx*vx + vy*vy + vz*vz) + local beamLen = mathSqrt(vx * vx + vy * vy + vz * vz) local bonusFrac = LOS_BONUS_RANGE / mathMax(beamLen, 1) if startInLos then t = mathMin(1, t + bonusFrac) @@ -1356,10 +1370,7 @@ local function updateBeams() -- Check if any part of the beam is in the camera view (padded for glow quad) local pad = cfg.aabbPad - if spIsAABBInView( - mathMin(px, endX) - pad, mathMin(py, endY) - pad, mathMin(pz, endZ) - pad, - mathMax(px, endX) + pad, mathMax(py, endY) + pad, mathMax(pz, endZ) + pad - ) then + if spIsAABBInView(mathMin(px, endX) - pad, mathMin(py, endY) - pad, mathMin(pz, endZ) - pad, mathMax(px, endX) + pad, mathMax(py, endY) + pad, mathMax(pz, endZ) + pad) then local ownerID = spGetProjectileOwnerID(proID) or 0 -- Key = ownerID -> packed(wDefID, bx, by, bz) where bx/by/bz quantize -- the muzzle position into HARDPOINT_BUCKET_SIZE-elmo cells. Multiple @@ -1374,10 +1385,7 @@ local function updateBeams() local bx = mathFloor(origPx * INV_HARDPOINT_BUCKET) local by = mathFloor(origPy * INV_HARDPOINT_BUCKET) local bz = mathFloor(origPz * INV_HARDPOINT_BUCKET) - local innerKey = wDefID * BEAM_KEY_WDEFID_MUL - + (bx + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BX_MUL - + (by + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BY_MUL - + (bz + BEAM_KEY_AXIS_OFFSET) + local innerKey = wDefID * BEAM_KEY_WDEFID_MUL + (bx + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BX_MUL + (by + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BY_MUL + (bz + BEAM_KEY_AXIS_OFFSET) local ownerBeams = weaponBeams[ownerID] if not ownerBeams then if ownerBeamsPoolN > 0 then @@ -1404,13 +1412,17 @@ local function updateBeams() hasGhosts = true end - tracked.px = origPx; tracked.py = origPy; tracked.pz = origPz - tracked.endX = origEndX; tracked.endY = origEndY; tracked.endZ = origEndZ + tracked.px = origPx + tracked.py = origPy + tracked.pz = origPz + tracked.endX = origEndX + tracked.endY = origEndY + tracked.endZ = origEndZ tracked.lastSeenFrame = gameFrame tracked.ownerAllyTeam = proAlly -- Range falloff: use squared length (avoid sqrt) - local beamLenSq = vx*vx + vy*vy + vz*vz + local beamLenSq = vx * vx + vy * vy + vz * vz local rangeFracSq = beamLenSq * cfg.invRangeSq local intensityFalloff = BEAM_RANGE_FALLOFF_BASE + BEAM_RANGE_FALLOFF_MULT * mathMin(rangeFracSq, 1.0) @@ -1427,15 +1439,15 @@ local function updateBeams() tracked.liveSlot = offset beamCount = beamCount + 1 end - beamData[offset + 1] = px - beamData[offset + 2] = py - beamData[offset + 3] = pz - beamData[offset + 4] = cfg.beamWidth - beamData[offset + 5] = endX - beamData[offset + 6] = endY - beamData[offset + 7] = endZ - beamData[offset + 8] = LIVE_LIFEFRAC - beamData[offset + 9] = cfg.coreR + beamData[offset + 1] = px + beamData[offset + 2] = py + beamData[offset + 3] = pz + beamData[offset + 4] = cfg.beamWidth + beamData[offset + 5] = endX + beamData[offset + 6] = endY + beamData[offset + 7] = endZ + beamData[offset + 8] = LIVE_LIFEFRAC + beamData[offset + 9] = cfg.coreR beamData[offset + 10] = cfg.coreG beamData[offset + 11] = cfg.coreB beamData[offset + 12] = 1.0 @@ -1451,7 +1463,7 @@ local function updateBeams() beamData[offset + 20] = 0 else beamData[offset + 17] = cfg.liveFlareSize - beamData[offset + 18] = cfg.isParalyzer and 1.0 or 0.0 -- flareData.y: paralyzer flag for pulse shader + beamData[offset + 18] = cfg.isParalyzer and 1.0 or 0.0 -- flareData.y: paralyzer flag for pulse shader beamData[offset + 19] = cfg.liveFlareG beamData[offset + 20] = cfg.liveFlareB end @@ -1461,7 +1473,7 @@ local function updateBeams() offset = offset + 20 end end -- spIsAABBInView - end -- visible + end -- visible end -- vx end -- px end -- cfg @@ -1472,91 +1484,88 @@ local function updateBeams() if hasGhosts then for _, ownerBeams in pairs(weaponBeams) do for _, tracked in pairs(ownerBeams) do - if tracked.liveStamp ~= callStamp and tracked.px then - local cfg = tracked.cfg - local ghostAge = gameFrame - tracked.lastSeenFrame - if ghostAge >= 1 and ghostAge <= cfg.ghostFrames then - local gpx, gpy, gpz = tracked.px, tracked.py, tracked.pz - local gex, gey, gez = tracked.endX, tracked.endY, tracked.endZ - - -- LOS check for ghost beams (skip for own allyteam) - local ghostVisible = true - local ghostClipStart = false - if needLosCheck and tracked.ownerAllyTeam ~= myAllyTeam then - local startInLos = spLosCheck(gpx, 0, gpz, myAllyTeam) - local endInLos = spLosCheck(gex, 0, gez, myAllyTeam) - ghostVisible = startInLos or endInLos - if ghostVisible and CLIP_BEAM_TO_LOS and startInLos ~= endInLos then - local dvx = gex - gpx - local dvy = gey - gpy - local dvz = gez - gpz - local t = findLosBoundary(gpx, gpz, gex, gez, myAllyTeam, startInLos) - -- Extend visible portion by bonus range (ground LOS only) - if not USE_AIR_LOS and LOS_BONUS_RANGE > 0 then - local beamLen = mathSqrt(dvx*dvx + dvy*dvy + dvz*dvz) - local bonusFrac = LOS_BONUS_RANGE / mathMax(beamLen, 1) + if tracked.liveStamp ~= callStamp and tracked.px then + local cfg = tracked.cfg + local ghostAge = gameFrame - tracked.lastSeenFrame + if ghostAge >= 1 and ghostAge <= cfg.ghostFrames then + local gpx, gpy, gpz = tracked.px, tracked.py, tracked.pz + local gex, gey, gez = tracked.endX, tracked.endY, tracked.endZ + + -- LOS check for ghost beams (skip for own allyteam) + local ghostVisible = true + local ghostClipStart = false + if needLosCheck and tracked.ownerAllyTeam ~= myAllyTeam then + local startInLos = spLosCheck(gpx, 0, gpz, myAllyTeam) + local endInLos = spLosCheck(gex, 0, gez, myAllyTeam) + ghostVisible = startInLos or endInLos + if ghostVisible and CLIP_BEAM_TO_LOS and startInLos ~= endInLos then + local dvx = gex - gpx + local dvy = gey - gpy + local dvz = gez - gpz + local t = findLosBoundary(gpx, gpz, gex, gez, myAllyTeam, startInLos) + -- Extend visible portion by bonus range (ground LOS only) + if not USE_AIR_LOS and LOS_BONUS_RANGE > 0 then + local beamLen = mathSqrt(dvx * dvx + dvy * dvy + dvz * dvz) + local bonusFrac = LOS_BONUS_RANGE / mathMax(beamLen, 1) + if startInLos then + t = mathMin(1, t + bonusFrac) + else + t = mathMax(0, t - bonusFrac) + end + end if startInLos then - t = mathMin(1, t + bonusFrac) + gex = gpx + dvx * t + gey = gpy + dvy * t + gez = gpz + dvz * t else - t = mathMax(0, t - bonusFrac) + gpx = gpx + dvx * t + gpy = gpy + dvy * t + gpz = gpz + dvz * t + ghostClipStart = true end end - if startInLos then - gex = gpx + dvx * t - gey = gpy + dvy * t - gez = gpz + dvz * t - else - gpx = gpx + dvx * t - gpy = gpy + dvy * t - gpz = gpz + dvz * t - ghostClipStart = true - end end - end - if ghostVisible then - -- Check if any part of the ghost beam is in the camera view (padded for glow quad) - local pad = cfg.aabbPad - if spIsAABBInView( - mathMin(gpx, gex) - pad, mathMin(gpy, gey) - pad, mathMin(gpz, gez) - pad, - mathMax(gpx, gex) + pad, mathMax(gpy, gey) + pad, mathMax(gpz, gez) + pad - ) then - local lifeFrac = FADE_OUT_START_CACHED + (ghostAge * cfg.invGhostFrames) * ONE_MINUS_FADE_OUT - - local vx = gex - gpx - local vy = gey - gpy - local vz = gez - gpz - local beamLenSq = vx*vx + vy*vy + vz*vz - local intensityFalloff = BEAM_RANGE_FALLOFF_BASE + BEAM_RANGE_FALLOFF_MULT * mathMin(beamLenSq * cfg.invRangeSq, 1.0) - local flareVisible = ghostAge <= cfg.flareGhostFrames - local flarePulse = (flareVisible and not ghostClipStart) and (1.0 - lifeFrac * FLARE_LIFE_DIM) or 0 - - beamCount = beamCount + 1 - beamData[offset + 1] = gpx - beamData[offset + 2] = gpy - beamData[offset + 3] = gpz - beamData[offset + 4] = cfg.beamWidth - beamData[offset + 5] = gex - beamData[offset + 6] = gey - beamData[offset + 7] = gez - beamData[offset + 8] = lifeFrac - beamData[offset + 9] = cfg.coreR - beamData[offset + 10] = cfg.coreG - beamData[offset + 11] = cfg.coreB - beamData[offset + 12] = 1.0 - beamData[offset + 13] = cfg.colorR - beamData[offset + 14] = cfg.colorG - beamData[offset + 15] = cfg.colorB - beamData[offset + 16] = intensityFalloff - beamData[offset + 17] = cfg.flareSize * flarePulse * FLARE_SIZE_MULT - beamData[offset + 18] = cfg.isParalyzer and 1.0 or 0.0 -- flareData.y: paralyzer flag for pulse shader - beamData[offset + 19] = cfg.flareColorG * flarePulse - beamData[offset + 20] = cfg.flareColorB * flarePulse - offset = offset + 20 + if ghostVisible then + -- Check if any part of the ghost beam is in the camera view (padded for glow quad) + local pad = cfg.aabbPad + if spIsAABBInView(mathMin(gpx, gex) - pad, mathMin(gpy, gey) - pad, mathMin(gpz, gez) - pad, mathMax(gpx, gex) + pad, mathMax(gpy, gey) + pad, mathMax(gpz, gez) + pad) then + local lifeFrac = FADE_OUT_START_CACHED + (ghostAge * cfg.invGhostFrames) * ONE_MINUS_FADE_OUT + + local vx = gex - gpx + local vy = gey - gpy + local vz = gez - gpz + local beamLenSq = vx * vx + vy * vy + vz * vz + local intensityFalloff = BEAM_RANGE_FALLOFF_BASE + BEAM_RANGE_FALLOFF_MULT * mathMin(beamLenSq * cfg.invRangeSq, 1.0) + local flareVisible = ghostAge <= cfg.flareGhostFrames + local flarePulse = (flareVisible and not ghostClipStart) and (1.0 - lifeFrac * FLARE_LIFE_DIM) or 0 + + beamCount = beamCount + 1 + beamData[offset + 1] = gpx + beamData[offset + 2] = gpy + beamData[offset + 3] = gpz + beamData[offset + 4] = cfg.beamWidth + beamData[offset + 5] = gex + beamData[offset + 6] = gey + beamData[offset + 7] = gez + beamData[offset + 8] = lifeFrac + beamData[offset + 9] = cfg.coreR + beamData[offset + 10] = cfg.coreG + beamData[offset + 11] = cfg.coreB + beamData[offset + 12] = 1.0 + beamData[offset + 13] = cfg.colorR + beamData[offset + 14] = cfg.colorG + beamData[offset + 15] = cfg.colorB + beamData[offset + 16] = intensityFalloff + beamData[offset + 17] = cfg.flareSize * flarePulse * FLARE_SIZE_MULT + beamData[offset + 18] = cfg.isParalyzer and 1.0 or 0.0 -- flareData.y: paralyzer flag for pulse shader + beamData[offset + 19] = cfg.flareColorG * flarePulse + beamData[offset + 20] = cfg.flareColorB * flarePulse + offset = offset + 20 + end + end -- ghostVisible end - end -- ghostVisible end - end end -- inner for over ownerBeams end end @@ -1579,9 +1588,13 @@ end -------------------------------------------------------------------------------- function gadget:Initialize() - if not initGL4() then return end + if not initGL4() then + return + end local n = 0 - for _ in pairs(weaponConfigs) do n = n + 1 end + for _ in pairs(weaponConfigs) do + n = n + 1 + end -- Subscribe to the shared projectile dispatcher (map-wide weapon scan). -- When loaded, GetMatches returns the pre-filtered beam projectile list @@ -1590,7 +1603,9 @@ function gadget:Initialize() local PS = GG.ProjectileScan if PS then local defIDSet = {} - for wDefID in pairs(weaponConfigs) do defIDSet[wDefID] = true end + for wDefID in pairs(weaponConfigs) do + defIDSet[wDefID] = true + end dispatchHandle = PS.Subscribe("beam_laser", defIDSet, PS.SCAN_MAP_WEAPONS) end end @@ -1604,78 +1619,79 @@ function gadget:GameFrame(n) if lastDrawWorldSimFrame >= n - 1 then -- fall through to cleanup only else - local simProjectiles, simMatchDefIDs, simCount - local PS = GG.ProjectileScan - local dispatcherFiltered = (PS ~= nil and dispatchHandle ~= nil) - if dispatcherFiltered then - simProjectiles, simMatchDefIDs, simCount = PS.GetMatchesWithDefIDs(dispatchHandle) - else - simProjectiles = spGetProjectilesInRectangle(0, 0, mapSizeX, mapSizeZ, false, true) - simCount = simProjectiles and #simProjectiles or 0 - end - if simProjectiles then - for i = 1, simCount do - local proID = simProjectiles[i] - local wDefID, cfg - if dispatcherFiltered then - wDefID = simMatchDefIDs[i] - cfg = weaponConfigs[wDefID] - else - wDefID = spGetProjectileDefID(proID) - cfg = wDefID and weaponConfigs[wDefID] - end - if cfg then - local px, py, pz = spGetProjectilePosition(proID) - if px then - local vx, vy, vz = spGetProjectileVelocity(proID) - if vx then - local ownerID = spGetProjectileOwnerID(proID) or 0 - -- Bucketed muzzle position in key disambiguates multiple hardpoints - -- sharing one wDefID on the same unit. See DrawWorld for rationale. - local bx = mathFloor(px * INV_HARDPOINT_BUCKET) - local by = mathFloor(py * INV_HARDPOINT_BUCKET) - local bz = mathFloor(pz * INV_HARDPOINT_BUCKET) - local innerKey = wDefID * BEAM_KEY_WDEFID_MUL - + (bx + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BX_MUL - + (by + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BY_MUL - + (bz + BEAM_KEY_AXIS_OFFSET) - local ownerBeams = weaponBeams[ownerID] - if not ownerBeams then - if ownerBeamsPoolN > 0 then - ownerBeams = ownerBeamsPool[ownerBeamsPoolN] - ownerBeamsPool[ownerBeamsPoolN] = nil - ownerBeamsPoolN = ownerBeamsPoolN - 1 - else - ownerBeams = {} + local simProjectiles, simMatchDefIDs, simCount + local PS = GG.ProjectileScan + local dispatcherFiltered = (PS ~= nil and dispatchHandle ~= nil) + if dispatcherFiltered then + simProjectiles, simMatchDefIDs, simCount = PS.GetMatchesWithDefIDs(dispatchHandle) + else + simProjectiles = spGetProjectilesInRectangle(0, 0, mapSizeX, mapSizeZ, false, true) + simCount = simProjectiles and #simProjectiles or 0 + end + if simProjectiles then + for i = 1, simCount do + local proID = simProjectiles[i] + local wDefID, cfg + if dispatcherFiltered then + wDefID = simMatchDefIDs[i] + cfg = weaponConfigs[wDefID] + else + wDefID = spGetProjectileDefID(proID) + cfg = wDefID and weaponConfigs[wDefID] + end + if cfg then + local px, py, pz = spGetProjectilePosition(proID) + if px then + local vx, vy, vz = spGetProjectileVelocity(proID) + if vx then + local ownerID = spGetProjectileOwnerID(proID) or 0 + -- Bucketed muzzle position in key disambiguates multiple hardpoints + -- sharing one wDefID on the same unit. See DrawWorld for rationale. + local bx = mathFloor(px * INV_HARDPOINT_BUCKET) + local by = mathFloor(py * INV_HARDPOINT_BUCKET) + local bz = mathFloor(pz * INV_HARDPOINT_BUCKET) + local innerKey = wDefID * BEAM_KEY_WDEFID_MUL + (bx + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BX_MUL + (by + BEAM_KEY_AXIS_OFFSET) * BEAM_KEY_BY_MUL + (bz + BEAM_KEY_AXIS_OFFSET) + local ownerBeams = weaponBeams[ownerID] + if not ownerBeams then + if ownerBeamsPoolN > 0 then + ownerBeams = ownerBeamsPool[ownerBeamsPoolN] + ownerBeamsPool[ownerBeamsPoolN] = nil + ownerBeamsPoolN = ownerBeamsPoolN - 1 + else + ownerBeams = {} + end + weaponBeams[ownerID] = ownerBeams end - weaponBeams[ownerID] = ownerBeams - end - local tracked = ownerBeams[innerKey] - if not tracked then - if trackedPoolN > 0 then - tracked = trackedPool[trackedPoolN] - trackedPool[trackedPoolN] = nil - trackedPoolN = trackedPoolN - 1 - tracked.cfg = cfg - tracked.liveStamp = 0 - else - tracked = { cfg = cfg } + local tracked = ownerBeams[innerKey] + if not tracked then + if trackedPoolN > 0 then + tracked = trackedPool[trackedPoolN] + trackedPool[trackedPoolN] = nil + trackedPoolN = trackedPoolN - 1 + tracked.cfg = cfg + tracked.liveStamp = 0 + else + tracked = { cfg = cfg } + end + ownerBeams[innerKey] = tracked + hasGhosts = true end - ownerBeams[innerKey] = tracked - hasGhosts = true + tracked.px = px + tracked.py = py + tracked.pz = pz + tracked.endX = px + vx + tracked.endY = py + vy + tracked.endZ = pz + vz + tracked.lastSeenFrame = n + local proTeam = spGetProjectileTeamID(proID) + tracked.ownerAllyTeam = proTeam and spGetTeamAllyTeamID(proTeam) + -- Wake DrawWorld so the idle-skip doesn't suppress ghost rendering + idleSkipCounter = 0 end - tracked.px = px; tracked.py = py; tracked.pz = pz - tracked.endX = px + vx; tracked.endY = py + vy; tracked.endZ = pz + vz - tracked.lastSeenFrame = n - local proTeam = spGetProjectileTeamID(proID) - tracked.ownerAllyTeam = proTeam and spGetTeamAllyTeamID(proTeam) - -- Wake DrawWorld so the idle-skip doesn't suppress ghost rendering - idleSkipCounter = 0 end end end end - end end -- low-FPS scan -- Periodic cleanup of stale weapon beam entries (expired ghosts). @@ -1713,13 +1729,17 @@ function gadget:GameFrame(n) if innerKey == false then local ownerBeams = weaponBeams[ownerID] weaponBeams[ownerID] = nil - if ownerBeams then releaseOwnerBeams(ownerBeams) end + if ownerBeams then + releaseOwnerBeams(ownerBeams) + end else local ownerBeams = weaponBeams[ownerID] if ownerBeams then local rec = ownerBeams[innerKey] ownerBeams[innerKey] = nil - if rec then releaseTrackedBeam(rec) end + if rec then + releaseTrackedBeam(rec) + end end end end diff --git a/luarules/gadgets/gfx_debrisexplosions.lua b/luarules/gadgets/gfx_debrisexplosions.lua index cc512f1d35d..a8ed0504d9a 100644 --- a/luarules/gadgets/gfx_debrisexplosions.lua +++ b/luarules/gadgets/gfx_debrisexplosions.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Debris Explosions", - desc = "Spawns CEG for debris explosions", - author = "Doo", - date = "Dec 9th 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Debris Explosions", + desc = "Spawns CEG for debris explosions", + author = "Doo", + date = "Dec 9th 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -- TODO: Fold this into one gadget with all the other silly projectile ceg spawners! @@ -18,34 +18,32 @@ end -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then + --CEG setup: For more spawn chance of a certain ceg, copy it multiple times in the table... + local cegtospawn = { + "genericshellexplosion-debris", + "genericshellexplosion-debris2", + } + local numcegtospawn = #cegtospawn + + function gadget:Initialize() + Script.SetWatchExplosion(-1, true) -- well that doesnt register anything! + end ---CEG setup: For more spawn chance of a certain ceg, copy it multiple times in the table... -local cegtospawn = { - "genericshellexplosion-debris", - "genericshellexplosion-debris2", -} -local numcegtospawn = #cegtospawn - -function gadget:Initialize() - Script.SetWatchExplosion(-1, true) -- well that doesnt register anything! -end - -local spGetProjectileType = Spring.GetProjectileType -local spSpawnCEG = Spring.SpawnCEG -local spGetProjectilePosition = Spring.GetProjectilePosition - -function gadget:ProjectileDestroyed(proID) -- Catch debris explosions, get position, pick random ceg, spawn it at position. - local weapon, piece = spGetProjectileType(proID) - --Spring.Echo(proID, piece) - - if piece then - --Spring.Echo("explosion") - local px, py, pz = spGetProjectilePosition(proID) - local i = (proID % numcegtospawn) + 1 -- pseudo random - if px and py and pz then - spSpawnCEG(cegtospawn[i], px, py, pz, 0, 1, 0, 50, 0) - end + local spGetProjectileType = Spring.GetProjectileType + local spSpawnCEG = Spring.SpawnCEG + local spGetProjectilePosition = Spring.GetProjectilePosition + + function gadget:ProjectileDestroyed(proID) -- Catch debris explosions, get position, pick random ceg, spawn it at position. + local weapon, piece = spGetProjectileType(proID) + --Spring.Echo(proID, piece) + + if piece then + --Spring.Echo("explosion") + local px, py, pz = spGetProjectilePosition(proID) + local i = (proID % numcegtospawn) + 1 -- pseudo random + if px and py and pz then + spSpawnCEG(cegtospawn[i], px, py, pz, 0, 1, 0, 50, 0) + end + end end end - -end \ No newline at end of file diff --git a/luarules/gadgets/gfx_emp_lightning.lua b/luarules/gadgets/gfx_emp_lightning.lua index 9430680b2e5..97dd163a594 100644 --- a/luarules/gadgets/gfx_emp_lightning.lua +++ b/luarules/gadgets/gfx_emp_lightning.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "EMP Lightning", - desc = "Spawns environmental lightning at/around paralyzer (EMP) weapon impacts. Amount and size scale with weapon AoE and damage.", - author = "Floris", - date = "June 2026", + name = "EMP Lightning", + desc = "Spawns environmental lightning at/around paralyzer (EMP) weapon impacts. Amount and size scale with weapon AoE and damage.", + author = "Floris", + date = "June 2026", license = "GNU GPL v2", - layer = 0, + layer = 0, enabled = true, } end @@ -31,8 +31,8 @@ local config = { lightningConfig = "empimpact", -- A "reference" EMP that maps to sizeScale ~1 and the middle of the range. - referenceAoE = 128, -- weapon AoE (elmos) considered an average EMP - referenceDamage = 1500, -- paralyze damage considered a big EMP + referenceAoE = 128, -- weapon AoE (elmos) considered an average EMP + referenceDamage = 1500, -- paralyze damage considered a big EMP -- SIZE/AMOUNT TIERS -- Tier selection is AoE-first to keep intuitive ordering (e.g. armemp always @@ -50,16 +50,16 @@ local config = { highDamageTierBump = 0.92, -- damageNorm threshold to bump one tier (except top tier) -- INTENSITY (driven by damage). Brightness multiplier passed to the bursts. - baseIntensity = 1.0, + baseIntensity = 1.0, intensityFromDamage = 0.5, -- up to +this fraction of brightness at reference damage -- NORMALISATION (damage only, for intensity / optional tier bump). -- AoE directly selects baseline tier. -- Where the extra (non-central) bursts are scattered around the impact. - scatterSizeMin = 0.4, -- extra bursts are smaller than the central one + scatterSizeMin = 0.4, -- extra bursts are smaller than the central one scatterSizeMax = 0.8, - heightOffset = 10, -- raise bursts slightly off the impact point + heightOffset = 10, -- raise bursts slightly off the impact point heightJitter = 12, -- AFTERSHOCK TAIL (largest tier only) @@ -86,23 +86,25 @@ local config = { local spGetGroundHeight = Spring.GetGroundHeight local spGetGameFrame = Spring.GetGameFrame local spGetUnitTeam = Spring.GetUnitTeam -local mathLog = math.log -local mathMin = math.min -local mathMax = math.max -local mathFloor = math.floor -local mathSqrt = math.sqrt -local mathSin = math.sin -local mathCos = math.cos -local mathPi = math.pi +local mathLog = math.log +local mathMin = math.min +local mathMax = math.max +local mathFloor = math.floor +local mathSqrt = math.sqrt +local mathSin = math.sin +local mathCos = math.cos +local mathPi = math.pi local mathRandom = math.random -local function clamp(v, lo, hi) return v < lo and lo or (v > hi and hi or v) end +local function clamp(v, lo, hi) + return v < lo and lo or (v > hi and hi or v) +end -------------------------------------------------------------------------------- -- State -------------------------------------------------------------------------------- -local empWeapons = {} -- [weaponDefID] = { aoe, damage } -local watched = {} -- [weaponDefID] = true +local empWeapons = {} -- [weaponDefID] = { aoe, damage } +local watched = {} -- [weaponDefID] = true local pendingTailPulses = {} -- [{frame, x,y,z, aoe, sizeScale, intensityScale, burstCount, scatterRadiusScale}] -------------------------------------------------------------------------------- @@ -125,7 +127,9 @@ end -- Normalise paralyze damage to roughly 0..1 on a log scale. local function damageNorm(damage) - if damage <= 0 then return 0.4 end + if damage <= 0 then + return 0.4 + end local ref = mathMax(config.referenceDamage, 1) return mathMin(1.0, mathLog(1 + damage) / mathLog(1 + ref)) end @@ -153,13 +157,15 @@ end local function spawnImpactCluster(spawn, px, py, pz, aoe, sizeScale, intensityScale, burstCount, scatterRadiusScale, ownerTeamID) spawn(config.lightningConfig, px, py + config.heightOffset, pz, sizeScale, intensityScale, ownerTeamID) - if burstCount <= 1 then return end + if burstCount <= 1 then + return + end local scatterRadius = aoe * scatterRadiusScale local sizeRange = config.scatterSizeMax - config.scatterSizeMin for _ = 2, burstCount do local ang = mathRandom() * 2.0 * mathPi - local rad = mathSqrt(mathRandom()) * scatterRadius -- uniform over the disc + local rad = mathSqrt(mathRandom()) * scatterRadius -- uniform over the disc local sx = px + mathCos(ang) * rad local sz = pz + mathSin(ang) * rad local sy = mathMax(spGetGroundHeight(sx, sz), py) + config.heightOffset + mathRandom() * config.heightJitter @@ -169,7 +175,9 @@ local function spawnImpactCluster(spawn, px, py, pz, aoe, sizeScale, intensitySc end local function scheduleTailPulses(nowFrame, px, py, pz, aoe, sizeScale, intensityScale, burstCount, scatterRadiusScale, ownerTeamID) - if not config.tailEnabled then return end + if not config.tailEnabled then + return + end for i = 1, config.tailPulseCount do if #pendingTailPulses >= config.maxPendingTailPulses then @@ -183,12 +191,16 @@ local function scheduleTailPulses(nowFrame, px, py, pz, aoe, sizeScale, intensit local pulseScatter = scatterRadiusScale * (config.tailScatterDecay ^ decayPow) local interval = config.tailIntervalFrames + mathFloor((mathRandom() * 2.0 - 1.0) * config.tailIntervalJitterFrames) - if interval < 1 then interval = 1 end + if interval < 1 then + interval = 1 + end local delay = config.tailStartDelayFrames + i * interval pendingTailPulses[#pendingTailPulses + 1] = { frame = nowFrame + delay, - x = px, y = py, z = pz, + x = px, + y = py, + z = pz, aoe = aoe, sizeScale = pulseSize, intensityScale = pulseIntensity, @@ -204,10 +216,14 @@ end -------------------------------------------------------------------------------- function gadget:Explosion(weaponDefID, px, py, pz, attackerID, projectileID) local info = empWeapons[weaponDefID] - if not info then return end + if not info then + return + end local spawn = GG.SpawnEnvironmentalLightning - if not spawn then return end + if not spawn then + return + end local aoe = info.aoe local tier, tierIndex, dn = resolveTier(aoe, info.damage) @@ -231,10 +247,14 @@ function gadget:Explosion(weaponDefID, px, py, pz, attackerID, projectileID) end function gadget:GameFrame(frame) - if #pendingTailPulses == 0 then return end + if #pendingTailPulses == 0 then + return + end local spawn = GG.SpawnEnvironmentalLightning - if not spawn then return end + if not spawn then + return + end local write = 1 for read = 1, #pendingTailPulses do diff --git a/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua b/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua index d1aa8095efd..ffebffd2c53 100644 --- a/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua +++ b/luarules/gadgets/gfx_energy_explosion_particles_gl4.lua @@ -16,18 +16,20 @@ function gadget:GetInfo() return { - name = "Energy Explosion Particles GL4", - desc = "Nano-style particle burst when energy producers/storers die", - author = "Floris", - date = "May 2026", - license = "GNU GPL v2", - layer = 0, - enabled = true, + name = "Energy Explosion Particles GL4", + desc = "Nano-style particle burst when energy producers/storers die", + author = "Floris", + date = "May 2026", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end -- Synced side: nothing to do. The gadget runs unsynced only. -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end -------------------------------------------------------------------------------- -- CONFIG (edit these freely) @@ -43,11 +45,11 @@ local CONFIG = { -- Weights map UnitDef resource fields to a single "energy score". The -- score is also the baseline particle count for that def (before the -- master multiplier). Tune these to taste. - weightEnergyMake = 0.16, -- particles per energy/sec produced - weightEnergyStorage = 0.006, -- particles per energy stored - weightWindGenerator = 0.05, -- particles per max-wind output - weightTidalGenerator = 0.05, -- particles per tidal output - weightEnergyConv = 0.05, -- particles per customParams.energyconv_capacity + weightEnergyMake = 0.16, -- particles per energy/sec produced + weightEnergyStorage = 0.006, -- particles per energy stored + weightWindGenerator = 0.05, -- particles per max-wind output + weightTidalGenerator = 0.05, -- particles per tidal output + weightEnergyConv = 0.05, -- particles per customParams.energyconv_capacity -- Defs whose total score is below this threshold get no burst. minEnergyScore = 15, @@ -70,14 +72,14 @@ local CONFIG = { maxParticleCount = 250, -- Global cap so a wave of dying fusions can't blow the pool. - maxLiveParticles = 6000, + maxLiveParticles = 6000, -- Hard cap on bursts processed per render frame (extras are dropped). maxBurstsPerFrame = 16, -- Frames to wait after UnitDestroyed before spawning energy particles. -- 0 = spawn immediately (no delay). Increase to let the initial CEG fireball -- start dispersing before energy particles appear (trades visual "lateness" -- for less CEG obstruction at spawn). - spawnDelayFrames = 1, + spawnDelayFrames = 1, ------------------------------------------------------------------ -- Velocity / spawn geometry @@ -86,9 +88,9 @@ local CONFIG = { -- [minSpeed, maxSpeed] with `rand ^ speedPower` -- speedPower > 1 means -- most particles are slow with a long high-speed tail ("shrapnel" feel), -- < 1 means most fly fast. - minSpeed = 0.2, - maxSpeed = 2, - speedPower = 1.5, + minSpeed = 0.2, + maxSpeed = 2, + speedPower = 1.5, -- Direction bias. 1.0 = strictly +Y, 0.0 = uniform full sphere, -- intermediate values blend (cosTheta = (2r-1)*(1-bias) + bias). upwardBias = 0.15, @@ -107,19 +109,19 @@ local CONFIG = { -- more speed. Set useDeathExplosion=false to ignore the weapon entirely. ------------------------------------------------------------------ useDeathExplosion = true, - aoeJitterMul = 0.15, -- spawn jitter += aoe * mul (elmos); keep tiny so AoE widens velocity range, not spawn origin - aoeSpeedMul = 0.0035, -- maxSpeed += aoe * mul - damageSpeedMul = 0.0035, -- maxSpeed += damage * mul - damageCountMul = 0.022, -- extra particles per damage point - damageCountMax = 2.5, -- hard cap on the damage/aoe particle bonus - maxSpeedBonus = 3.3, -- hard cap on the aoe+damage speed bonus (elmos/frame) + aoeJitterMul = 0.15, -- spawn jitter += aoe * mul (elmos); keep tiny so AoE widens velocity range, not spawn origin + aoeSpeedMul = 0.0035, -- maxSpeed += aoe * mul + damageSpeedMul = 0.0035, -- maxSpeed += damage * mul + damageCountMul = 0.022, -- extra particles per damage point + damageCountMax = 2.5, -- hard cap on the damage/aoe particle bonus + maxSpeedBonus = 3.3, -- hard cap on the aoe+damage speed bonus (elmos/frame) ------------------------------------------------------------------ -- Physics (applied in vertex shader, global) -- pos(t) = spawn + vel*t*(1 - 0.5*drag*t) + 0.5*gravity*t^2 -- t is in sim frames since spawn; vel/gravity in elmos/frame[^2]. ------------------------------------------------------------------ - drag = 0.008, + drag = 0.008, gravityY = -0.003, ------------------------------------------------------------------ @@ -130,9 +132,9 @@ local CONFIG = { -- Lifetime scales with burst size: at count == maxParticleCount the -- min/max lifetime are multiplied by this value. At minimum count, scale -- is 1.0 (no extension). Set to 1.0 to disable. - lifetimeBigMul = 1.8, - fadeFramesMin = 11, - fadeFramesMax = 44, + lifetimeBigMul = 1.8, + fadeFramesMin = 11, + fadeFramesMax = 44, -- Frames over which a freshly-spawned particle ramps from invisible to full -- alpha. Hides the "pop into existence" at the unit center while the -- explosion debris is still bright. @@ -140,7 +142,7 @@ local CONFIG = { -- particles invisible for the first N frames -- against the dim coreBoost -- and small alpha the burst then appears to "pop in late". Set to a small -- value (e.g. 2) if you want a brief soft attack instead of an instant start. - fadeInFrames = 2, + fadeInFrames = 2, ------------------------------------------------------------------ -- Visual @@ -190,49 +192,49 @@ local CONFIG = { -- Locals -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitRadius = Spring.GetUnitRadius -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spEcho = Spring.Echo +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState -local spIsPosInLos = Spring.IsPosInLos -local spIsSphereInView = Spring.IsSphereInView -local spGetTeamColor = Spring.GetTeamColor - -local glBlending = gl.Blending -local glDepthTest = gl.DepthTest -local glDepthMask = gl.DepthMask -local glCulling = gl.Culling -local glAlphaTest = gl.AlphaTest -local glColor = gl.Color -local glColorMask = gl.ColorMask -local glScissor = gl.Scissor +local spIsPosInLos = Spring.IsPosInLos +local spIsSphereInView = Spring.IsSphereInView +local spGetTeamColor = Spring.GetTeamColor + +local glBlending = gl.Blending +local glDepthTest = gl.DepthTest +local glDepthMask = gl.DepthMask +local glCulling = gl.Culling +local glAlphaTest = gl.AlphaTest +local glColor = gl.Color +local glColorMask = gl.ColorMask +local glScissor = gl.Scissor local glPolygonOffset = gl.PolygonOffset -local glPolygonMode = gl.PolygonMode -local glStencilTest = gl.StencilTest +local glPolygonMode = gl.PolygonMode +local glStencilTest = gl.StencilTest -local GL_ONE = GL.ONE +local GL_ONE = GL.ONE local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA -local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK -local GL_FILL = GL.FILL -local GL_LEQUAL = GL.LEQUAL +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK +local GL_FILL = GL.FILL +local GL_LEQUAL = GL.LEQUAL -local LuaShader = gl.LuaShader -local InstanceVBOTable = gl.InstanceVBOTable -local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance -local uploadElementRange = InstanceVBOTable.uploadElementRange +local LuaShader = gl.LuaShader +local InstanceVBOTable = gl.InstanceVBOTable +local pushElementInstance = InstanceVBOTable.pushElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance +local uploadElementRange = InstanceVBOTable.uploadElementRange local mathRandom = math.random -local mathSqrt = math.sqrt -local mathFloor = math.floor -local mathPi = math.pi -local mathSin = math.sin -local mathCos = math.cos -local mathMax = math.max -local mathMin = math.min -local mathHuge = math.huge +local mathSqrt = math.sqrt +local mathFloor = math.floor +local mathPi = math.pi +local mathSin = math.sin +local mathCos = math.cos +local mathMax = math.max +local mathMin = math.min +local mathHuge = math.huge local stringFind = string.find -- Cube/GS path -- no texture sampled. @@ -240,10 +242,10 @@ local stringFind = string.find -- VBO ceiling (instance slots allocated once at Init). local MAX_PARTICLES_VBO = CONFIG.maxLiveParticles local liveCount = 0 -local nextID = 1 +local nextID = 1 -- Per-instance scratch buffer (4 vec4 = 16 floats), reused per spawn. -local instanceScratch = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 } +local instanceScratch = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } -- death-frame buckets for cheap O(1) cull local deathBuckets = {} @@ -274,7 +276,7 @@ local reclaimedWeaponDefID = Game and Game.envDamageTypes and Game.envDamageType local killedByLuaWeaponDefID = Game and Game.envDamageTypes and Game.envDamageTypes.KilledByLua -- Cached view state (refreshed each GameFrame). -local cachedAllyTeamID = spGetMyAllyTeamID() +local cachedAllyTeamID = spGetMyAllyTeamID() local cachedSpecFullView = false -- Dirty range for batched per-frame upload (updated inline in processBurst). @@ -284,7 +286,6 @@ local dirtyMin, dirtyMax = mathHuge, -1 -- Shaders -------------------------------------------------------------------------------- - local vsSrc = [[ #version 430 core #line 10000 @@ -698,37 +699,40 @@ local function goodbye(reason) gadgetHandler:RemoveGadget() end -local useGeometryShader = true -- cant set it here, will be overwritten in initGL4() +local useGeometryShader = true -- cant set it here, will be overwritten in initGL4() -- Visual constants taken verbatim from gfx_nano_particles_gl4.lua -- (MODE_SETTINGS.shape) so the chunks look identical to nano spray. -local SHAPE_ID = 0 -- 0 = cube, 1 = octahedron -local DRAW_RADIUS = 1.5 -- shape spans ~2 * drawRadius elmos +local SHAPE_ID = 0 -- 0 = cube, 1 = octahedron +local DRAW_RADIUS = 1.5 -- shape spans ~2 * drawRadius elmos local CUBE_SHOW_INSIDE = 4.0 -local CUBE_NOISE = 6.0 +local CUBE_NOISE = 6.0 local CUBE_NOISE_SPEED = 25.0 local CUBE_NOISE_SCALE = 1.75 -local GLOW_SCALE = 11.0 -local GLOW_INTENSITY = 0.15 -local GLOW_FALLOFF = 9.5 -local CORE_BOOST = 0.3 -local HUE_JITTER = 0.1 -local GLOW_BREATH = 4.0 +local GLOW_SCALE = 11.0 +local GLOW_INTENSITY = 0.15 +local GLOW_FALLOFF = 9.5 +local CORE_BOOST = 0.3 +local HUE_JITTER = 0.1 +local GLOW_BREATH = 4.0 local GLOW_BREATH_FREQ = 2.0 -local GLOW_BREATH_VAR = 0.5 +local GLOW_BREATH_VAR = 0.5 local GLOW_BREATH_FREQ_VAR = 0.5 -local WOBBLE_AMP = 2.5 -local WOBBLE_VAR = 0.5 -local WOBBLE_FREQ = 0.2 -local WOBBLE_FREQ_VAR = 0.5 +local WOBBLE_AMP = 2.5 +local WOBBLE_VAR = 0.5 +local WOBBLE_FREQ = 0.2 +local WOBBLE_FREQ_VAR = 0.5 local WOBBLE_RAMP_FRAMES = 7.0 -local WHITE_HOTSPOT = 1.5 +local WHITE_HOTSPOT = 1.5 local WHITE_HOTSPOT_THRESHOLD = 0.6 -local ALPHA_VAR = 2.5 -local ROT_VAL_BASE = -180 local ROT_VAL_RANGE = 360 -local ROT_VEL_BASE = -40 local ROT_VEL_RANGE = 80 +local ALPHA_VAR = 2.5 +local ROT_VAL_BASE = -180 +local ROT_VAL_RANGE = 360 +local ROT_VEL_BASE = -40 +local ROT_VEL_RANGE = 80 -- rotAcc in deg/sec² converted to deg/frame² (GAME_SPEED = 30) -local ROT_ACC_BASE = -40 / (30*30) local ROT_ACC_RANGE = 80 / (30*30) +local ROT_ACC_BASE = -40 / (30 * 30) +local ROT_ACC_RANGE = 80 / (30 * 30) local function initGL4() local shaderCacheGS = { @@ -736,45 +740,45 @@ local function initGL4() fsSrc = fsSrc, gsSrc = gsSrc, shaderName = "UnitEnergyExplosionParticlesGL4", - uniformInt = { u_shape = SHAPE_ID }, + uniformInt = { u_shape = SHAPE_ID }, uniformFloat = { - drag = CONFIG.drag, - gravity = { 0, CONFIG.gravityY, 0 }, + drag = CONFIG.drag, + gravity = { 0, CONFIG.gravityY, 0 }, fadeInFrames = CONFIG.fadeInFrames, - drawRadius = DRAW_RADIUS, + drawRadius = DRAW_RADIUS, cubeShowInside = CUBE_SHOW_INSIDE, - cubeNoise = CUBE_NOISE, + cubeNoise = CUBE_NOISE, cubeNoiseSpeed = CUBE_NOISE_SPEED, cubeNoiseScale = CUBE_NOISE_SCALE, - glowScale = GLOW_SCALE, + glowScale = GLOW_SCALE, glowIntensity = GLOW_INTENSITY, - glowFalloff = GLOW_FALLOFF, - coreBoost = CORE_BOOST, - hueJitter = HUE_JITTER, - glowBreath = GLOW_BREATH, + glowFalloff = GLOW_FALLOFF, + coreBoost = CORE_BOOST, + hueJitter = HUE_JITTER, + glowBreath = GLOW_BREATH, glowBreathFreq = GLOW_BREATH_FREQ, - glowBreathVar = GLOW_BREATH_VAR, + glowBreathVar = GLOW_BREATH_VAR, glowBreathFreqVar = GLOW_BREATH_FREQ_VAR, - wobbleAmp = WOBBLE_AMP, - wobbleVar = WOBBLE_VAR, - wobbleFreq = WOBBLE_FREQ, + wobbleAmp = WOBBLE_AMP, + wobbleVar = WOBBLE_VAR, + wobbleFreq = WOBBLE_FREQ, wobbleFreqVar = WOBBLE_FREQ_VAR, wobbleRampFrames = WOBBLE_RAMP_FRAMES, - whiteHotspot = WHITE_HOTSPOT, + whiteHotspot = WHITE_HOTSPOT, whiteHotspotThreshold = WHITE_HOTSPOT_THRESHOLD, }, shaderConfig = {}, - forceupdate = true, + forceupdate = true, } local shaderCacheNoGS = { vssrcpath = "LuaUI/Shaders/energy_explosion_particles_gl4_nogs.vert.glsl", fsSrc = fsSrc, shaderName = "UnitEnergyExplosionParticlesGL4_NoGS", - uniformInt = { u_shape = SHAPE_ID }, + uniformInt = { u_shape = SHAPE_ID }, uniformFloat = shaderCacheGS.uniformFloat, shaderConfig = {}, - forceupdate = true, + forceupdate = true, } -- AMD GPUs have no native geometry-shader stage. Mesa emulates this GS by translating it @@ -804,22 +808,18 @@ local function initGL4() end if useGeometryShader then - local quadVBO, numVertices = InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "eepQuadVBO" - ) + local quadVBO, numVertices = InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "eepQuadVBO") -- Shape GS only needs ONE triangle per instance; use a 3-index VBO so the -- GS doesn't get invoked twice per particle. local indexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) indexVBO:Define(3) - indexVBO:Upload({0, 1, 2}) + indexVBO:Upload({ 0, 1, 2 }) local layout = { - { id = 1, name = "spawnPosAndSize", size = 4 }, + { id = 1, name = "spawnPosAndSize", size = 4 }, { id = 2, name = "velAndSpawnFrame", size = 4 }, - { id = 3, name = "instColor", size = 4 }, - { id = 4, name = "rotData", size = 4 }, + { id = 3, name = "instColor", size = 4 }, + { id = 4, name = "rotData", size = 4 }, } particleVBO = InstanceVBOTable.makeInstanceVBOTable(layout, MAX_PARTICLES_VBO, "eepParticleVBO") if not particleVBO then @@ -827,9 +827,9 @@ local function initGL4() return false end particleVBO.numVertices = numVertices - particleVBO.vertexVBO = quadVBO - particleVBO.indexVBO = indexVBO - particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO, indexVBO) + particleVBO.vertexVBO = quadVBO + particleVBO.indexVBO = indexVBO + particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO, indexVBO) particleVBO.primitiveType = GL.TRIANGLES else -- No-GS fallback: build a template indexed mesh with one vertex per @@ -838,12 +838,12 @@ local function initGL4() -- quad. We use independent triangles, so each template vertex is emitted -- exactly once and indexed in GL order. local NUM_SHAPE_VERTS = 24 - local NUM_GLOW_VERTS = 4 + local NUM_GLOW_VERTS = 4 local NUM_VERTS = NUM_SHAPE_VERTS + NUM_GLOW_VERTS local isOcta = (SHAPE_ID == 1) local templateVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - templateVBO:Define(NUM_VERTS, {{ id = 0, name = "vertexSlot", size = 1 }}) -- float slot, cast to int in VS + templateVBO:Define(NUM_VERTS, { { id = 0, name = "vertexSlot", size = 1 } }) -- float slot, cast to int in VS local vertexData = {} for i = 0, NUM_VERTS - 1 do vertexData[#vertexData + 1] = i @@ -885,10 +885,10 @@ local function initGL4() indexVBO:Upload(indexData) local layout = { - { id = 1, name = "spawnPosAndSize", size = 4 }, + { id = 1, name = "spawnPosAndSize", size = 4 }, { id = 2, name = "velAndSpawnFrame", size = 4 }, - { id = 3, name = "instColor", size = 4 }, - { id = 4, name = "rotData", size = 4 }, + { id = 3, name = "instColor", size = 4 }, + { id = 4, name = "rotData", size = 4 }, } particleVBO = InstanceVBOTable.makeInstanceVBOTable(layout, MAX_PARTICLES_VBO, "eepParticleVBO_NoGS") if not particleVBO then @@ -905,7 +905,7 @@ local function initGL4() -- Anchor the template/index VBOs so Lua GC cannot collect them while -- the VAO is alive (same GC fix as DrawPrimitiveAtUnit, commit 2b51f6e863). particleVBO.nogsTemplateVBO = templateVBO - particleVBO.nogsIndexVBO = indexVBO + particleVBO.nogsIndexVBO = indexVBO local indexCount = #indexData particleVBO.VAO = { @@ -931,7 +931,10 @@ local function initGL4() end local function cleanupGL4() - if particleVBO then particleVBO:Delete(); particleVBO = nil end + if particleVBO then + particleVBO:Delete() + particleVBO = nil + end particleShader = nil end @@ -944,13 +947,15 @@ local function computeScore(ud) -- Energy production in BAR can be expressed either as positive `energyMake` -- (most generators) or as negative `energyUpkeep` (solar collectors and a -- handful of others). Take whichever is larger so both styles count. - local make = ud.energyMake or 0 + local make = ud.energyMake or 0 local upkeep = ud.energyUpkeep or 0 local production = make - if upkeep < 0 and -upkeep > production then production = -upkeep end - s = s + production * CONFIG.weightEnergyMake - s = s + (ud.energyStorage or 0) * CONFIG.weightEnergyStorage - s = s + (ud.windGenerator or 0) * CONFIG.weightWindGenerator + if upkeep < 0 and -upkeep > production then + production = -upkeep + end + s = s + production * CONFIG.weightEnergyMake + s = s + (ud.energyStorage or 0) * CONFIG.weightEnergyStorage + s = s + (ud.windGenerator or 0) * CONFIG.weightWindGenerator s = s + (ud.tidalGenerator or 0) * CONFIG.weightTidalGenerator local cp = ud.customParams if cp then @@ -966,12 +971,11 @@ local function classifyDefs() local n = 0 for defID, ud in pairs(UnitDefs) do local cp = ud.customParams - local isRaptor = (ud.category and stringFind(ud.category, "RAPTOR", 1, true)) - or (cp and cp.subfolder == "other/raptors") + local isRaptor = (ud.category and stringFind(ud.category, "RAPTOR", 1, true)) or (cp and cp.subfolder == "other/raptors") if not CONFIG.excludeUnitDefs[ud.name] and not isRaptor then local score = computeScore(ud) - local ov = CONFIG.overrides[ud.name] + local ov = CONFIG.overrides[ud.name] -- Energy converters/metal-makers qualify via their energyconv_capacity -- regardless of the energy score threshold. local hasConverter = cp and tonumber(cp.energyconv_capacity) and tonumber(cp.energyconv_capacity) > 0 @@ -979,8 +983,7 @@ local function classifyDefs() -- relative to its build cost. This prevents combat units with a small -- passive generator (e.g. armbanth) from triggering the effect. local metalCost = ud.metalCost or 0 - local scoreQualifies = score >= CONFIG.minEnergyScore - and (metalCost == 0 or score / metalCost >= CONFIG.minEnergyScoreRatio) + local scoreQualifies = score >= CONFIG.minEnergyScore and (metalCost == 0 or score / metalCost >= CONFIG.minEnergyScoreRatio) if (ov and ov.particleCount) or scoreQualifies or hasConverter then -- Look up the unit's death-explosion weapon (if any) so we can -- scale spread/speed/count by the weapon's AoE and damage. @@ -997,7 +1000,9 @@ local function classifyDefs() deathDmg = dmgs[0] or dmgs.default or 0 if deathDmg == 0 then for _, v in pairs(dmgs) do - if type(v) == "number" and v > deathDmg then deathDmg = v end + if type(v) == "number" and v > deathDmg then + deathDmg = v + end end end end @@ -1014,22 +1019,26 @@ local function classifyDefs() local dmgBonus = mathMin(deathDmg * CONFIG.damageCountMul, CONFIG.damageCountMax) count = mathFloor((score ^ pow) * mul + dmgBonus + 0.5) end - if count < CONFIG.minParticleCount then count = CONFIG.minParticleCount end - if count > CONFIG.maxParticleCount then count = CONFIG.maxParticleCount end + if count < CONFIG.minParticleCount then + count = CONFIG.minParticleCount + end + if count > CONFIG.maxParticleCount then + count = CONFIG.maxParticleCount + end --Spring.Echo(ud.name, count, score, aoe, deathDmg) - local jf = (ov and ov.spawnJitterFrac) or CONFIG.spawnJitterFrac - local jitter = (ud.radius or 32) * jf + aoe * CONFIG.aoeJitterMul + local jf = (ov and ov.spawnJitterFrac) or CONFIG.spawnJitterFrac + local jitter = (ud.radius or 32) * jf + aoe * CONFIG.aoeJitterMul local speedBonus = mathMin(aoe * CONFIG.aoeSpeedMul + deathDmg * CONFIG.damageSpeedMul, CONFIG.maxSpeedBonus) qualifyingDefs[defID] = { - count = count, - overrideRef = ov, + count = count, + overrideRef = ov, jitterRadius = jitter, - speedBonus = speedBonus, - aoe = aoe, - deathDamage = deathDmg, + speedBonus = speedBonus, + aoe = aoe, + deathDamage = deathDmg, } n = n + 1 @@ -1047,12 +1056,16 @@ end local function fetchTeamColor(teamID) local cached = teamColorCache[teamID] - if cached then return cached[1], cached[2], cached[3] end + if cached then + return cached[1], cached[2], cached[3] + end local r, g, b = spGetTeamColor(teamID) - if not r then r, g, b = 1, 1, 1 end + if not r then + r, g, b = 1, 1, 1 + end local eq = CONFIG.colorEqualize if eq > 0.001 then - local luma = 0.2126*r + 0.7152*g + 0.0722*b + local luma = 0.2126 * r + 0.7152 * g + 0.0722 * b local target = 0.55 local boost = (luma > 0.001) and (target / luma) or 1.0 boost = mathMin(boost, 4.0) @@ -1071,65 +1084,74 @@ end -- Resolve effective per-burst parameters. ov may be nil. local function paramOr(ov, key) - if ov and ov[key] ~= nil then return ov[key] end + if ov and ov[key] ~= nil then + return ov[key] + end return CONFIG[key] end local function processBurst(px, py, pz, teamID, meta, frame) - local count = meta.count + local count = meta.count local jitterRadius = meta.jitterRadius - local overrideRef = meta.overrideRef - local speedBonus = meta.speedBonus or 0 + local overrideRef = meta.overrideRef + local speedBonus = meta.speedBonus or 0 -- Frustum gate: if the burst sphere isn't in view, skip entirely. - if not spIsSphereInView(px, py, pz, jitterRadius + 64) then return end + if not spIsSphereInView(px, py, pz, jitterRadius + 64) then + return + end local r, g, b = fetchTeamColor(teamID) - local minS = paramOr(overrideRef, "minSpeed") - local maxS = paramOr(overrideRef, "maxSpeed") + speedBonus - local speedPow = paramOr(overrideRef, "speedPower") - local szMin = paramOr(overrideRef, "sizeMin") - local szMax = paramOr(overrideRef, "sizeMax") - local lifeMin = paramOr(overrideRef, "minLifetimeFrames") - local lifeMax = paramOr(overrideRef, "maxLifetimeFrames") + local minS = paramOr(overrideRef, "minSpeed") + local maxS = paramOr(overrideRef, "maxSpeed") + speedBonus + local speedPow = paramOr(overrideRef, "speedPower") + local szMin = paramOr(overrideRef, "sizeMin") + local szMax = paramOr(overrideRef, "sizeMax") + local lifeMin = paramOr(overrideRef, "minLifetimeFrames") + local lifeMax = paramOr(overrideRef, "maxLifetimeFrames") -- Scale lifetime range with burst size: small bursts use the configured -- range; large bursts (approaching maxParticleCount) get up to lifetimeBigMul -- times longer life so fusion-sized explosions linger. - local lifeScale = 1.0 + (CONFIG.lifetimeBigMul - 1.0) - * mathMin(count / CONFIG.maxParticleCount, 1.0) + local lifeScale = 1.0 + (CONFIG.lifetimeBigMul - 1.0) * mathMin(count / CONFIG.maxParticleCount, 1.0) lifeMax = lifeMax * lifeScale - local bias = paramOr(overrideRef, "upwardBias") - local alpha = paramOr(overrideRef, "alpha") + local bias = paramOr(overrideRef, "upwardBias") + local alpha = paramOr(overrideRef, "alpha") local fadeFramesMin = paramOr(overrideRef, "fadeFramesMin") local fadeFramesMax = paramOr(overrideRef, "fadeFramesMax") - local fadeInFrames = paramOr(overrideRef, "fadeInFrames") - local jyFrac = paramOr(overrideRef, "spawnJitterYFrac") + local fadeInFrames = paramOr(overrideRef, "fadeInFrames") + local jyFrac = paramOr(overrideRef, "spawnJitterYFrac") -- Cache the VBO reference; bail early if it disappeared. local _pVBO = particleVBO - if not _pVBO then return end + if not _pVBO then + return + end local _liveCount = liveCount local budget = MAX_PARTICLES_VBO - _liveCount - if budget <= 0 then return end - if count > budget then count = budget end + if budget <= 0 then + return + end + if count > budget then + count = budget + end -- Hoist frequently-mutated upvalues into locals so the tight per-particle -- loop avoids repeated upvalue indirection (each upvalue access requires an -- extra pointer dereference vs a plain local stack slot). - local _nextID = nextID + local _nextID = nextID local _dirtyMin = dirtyMin local _dirtyMax = dirtyMax - local _scratch = instanceScratch - local _buckets = deathBuckets + local _scratch = instanceScratch + local _buckets = deathBuckets -- Pre-compute per-burst invariants so they aren't recomputed each iteration. local speedRange = maxS - minS - local szRange = szMax - szMin - local lifeRange = lifeMax - lifeMin - local fadeRange = fadeFramesMax - fadeFramesMin - local biasTerm = 1.0 - bias -- weight for the (2r-1) term in cosTheta - local twoPi = 2.0 * mathPi + local szRange = szMax - szMin + local lifeRange = lifeMax - lifeMin + local fadeRange = fadeFramesMax - fadeFramesMin + local biasTerm = 1.0 - bias -- weight for the (2r-1) term in cosTheta + local twoPi = 2.0 * mathPi local hasAlphaVar = ALPHA_VAR > 0 for _ = 1, count do @@ -1139,7 +1161,7 @@ local function processBurst(px, py, pz, teamID, meta, frame) jx = mathRandom() * 2 - 1 jy = mathRandom() * 2 - 1 jz = mathRandom() * 2 - 1 - until (jx*jx + jy*jy + jz*jz) <= 1.0 + until (jx * jx + jy * jy + jz * jz) <= 1.0 local sx = px + jx * jitterRadius local sy = py + jy * jitterRadius * jyFrac local sz = pz + jz * jitterRadius @@ -1147,11 +1169,15 @@ local function processBurst(px, py, pz, teamID, meta, frame) -- Inlined sampleExplosionDir: uniform sphere biased toward +Y. -- bias=0 -> full sphere, bias=1 -> straight up. local cosT = (2.0 * mathRandom() - 1.0) * biasTerm + bias - if cosT < -1 then cosT = -1 elseif cosT > 1 then cosT = 1 end + if cosT < -1 then + cosT = -1 + elseif cosT > 1 then + cosT = 1 + end local sinT = mathSqrt(mathMax(0.0, 1.0 - cosT * cosT)) - local phi = mathRandom() * twoPi - local dx = sinT * mathCos(phi) - local dz = sinT * mathSin(phi) + local phi = mathRandom() * twoPi + local dx = sinT * mathCos(phi) + local dz = sinT * mathSin(phi) -- Power-law speed sample: rand^speedPow biases distribution toward minS -- when speedPow > 1 (long high-speed tail = "shrapnel"). @@ -1163,7 +1189,7 @@ local function processBurst(px, py, pz, teamID, meta, frame) -- Fade window scales linearly with the particle's own lifetime so -- short-lived particles don't get a disproportionately long tail. - local lifeFrac = (lifeRange > 0) and (lifetime - lifeMin) / lifeRange or 0.0 + local lifeFrac = (lifeRange > 0) and (lifetime - lifeMin) / lifeRange or 0.0 local fadeFrames = mathFloor(fadeFramesMin + fadeRange * lifeFrac + 0.5) -- Per-particle alpha jitter (matches nano gadget look). Centred on the @@ -1171,7 +1197,7 @@ local function processBurst(px, py, pz, teamID, meta, frame) local pa = hasAlphaVar and (alpha * (1.0 + ALPHA_VAR * (mathRandom() * 2 - 1))) or alpha -- Inlined spawnParticle: pack size+fade, randomise rotation, push VBO slot. - local death = frame + lifetime + local death = frame + lifetime local packed = mathFloor(sizeMult * 256 + 0.5) + (fadeFrames or 0) * 1024 local rotVal = ROT_VAL_BASE + ROT_VAL_RANGE * (mathRandom() * 2 - 1) local rotVel = ROT_VEL_BASE + ROT_VEL_RANGE * (mathRandom() * 2 - 1) @@ -1180,10 +1206,22 @@ local function processBurst(px, py, pz, teamID, meta, frame) local id = _nextID _nextID = _nextID + 1 - _scratch[1] = sx; _scratch[2] = sy; _scratch[3] = sz; _scratch[4] = packed - _scratch[5] = vx; _scratch[6] = vy; _scratch[7] = vz; _scratch[8] = frame - _scratch[9] = r; _scratch[10] = g; _scratch[11] = b; _scratch[12] = pa - _scratch[13] = rotVal; _scratch[14] = rotVel; _scratch[15] = rotAcc; _scratch[16] = death + _scratch[1] = sx + _scratch[2] = sy + _scratch[3] = sz + _scratch[4] = packed + _scratch[5] = vx + _scratch[6] = vy + _scratch[7] = vz + _scratch[8] = frame + _scratch[9] = r + _scratch[10] = g + _scratch[11] = b + _scratch[12] = pa + _scratch[13] = rotVal + _scratch[14] = rotVel + _scratch[15] = rotAcc + _scratch[16] = death -- noUpload=true: we batch the GPU upload at end of GameFrame. -- pushElementInstance returns the instanceID (not the slot index!), so we @@ -1201,20 +1239,23 @@ local function processBurst(px, py, pz, teamID, meta, frame) end _liveCount = _liveCount + 1 local slot = _pVBO.usedElements - 1 - if slot < _dirtyMin then _dirtyMin = slot end - if slot > _dirtyMax then _dirtyMax = slot end + if slot < _dirtyMin then + _dirtyMin = slot + end + if slot > _dirtyMax then + _dirtyMax = slot + end end end -- Write back the upvalues that changed inside the loop. liveCount = _liveCount - nextID = _nextID - dirtyMin = _dirtyMin - dirtyMax = _dirtyMax + nextID = _nextID + dirtyMin = _dirtyMin + dirtyMax = _dirtyMax if CONFIG.debug then - spEcho(("EEP: burst @ (%d, %d, %d) team=%d count=%d aoe=%d dmg=%d") - :format(px, py, pz, teamID, count, meta.aoe or 0, meta.deathDamage or 0)) + spEcho(("EEP: burst @ (%d, %d, %d) team=%d count=%d aoe=%d dmg=%d"):format(px, py, pz, teamID, count, meta.aoe or 0, meta.deathDamage or 0)) end end @@ -1224,7 +1265,9 @@ end local function cullDead(frame) local bucket = deathBuckets[frame] - if not bucket then return end + if not bucket then + return + end local nb = #bucket local _pVBO = particleVBO if not _pVBO then @@ -1247,8 +1290,15 @@ end -------------------------------------------------------------------------------- function gadget:Initialize() - if not CONFIG.enabled then spEcho("EEP: disabled in CONFIG, removing"); gadgetHandler:RemoveGadget(); return end - if not initGL4() then spEcho("EEP: initGL4 failed, bailing"); return end + if not CONFIG.enabled then + spEcho("EEP: disabled in CONFIG, removing") + gadgetHandler:RemoveGadget() + return + end + if not initGL4() then + spEcho("EEP: initGL4 failed, bailing") + return + end classifyDefs() -- Populate finishedUnits for any qualifying units already on the map -- (handles mid-game widget reloads and gadget restarts). @@ -1274,26 +1324,42 @@ function gadget:UnitFinished(unitID, unitDefID) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, _attackerDefID, _attackerTeam, weaponDefID) - if nanoParticleMode == 0 then return end + if nanoParticleMode == 0 then + return + end -- Skip units that were still under construction when they died. local wasFinished = finishedUnits[unitID] finishedUnits[unitID] = nil - if not wasFinished then return end - if weaponDefID == reclaimedWeaponDefID then return end + if not wasFinished then + return + end + if weaponDefID == reclaimedWeaponDefID then + return + end -- Geo-upgrade reclaim cleanup currently arrives as KilledByLua with no attacker. -- Treat that specific scripted geothermal removal as non-explosive. if not attackerID and weaponDefID == killedByLuaWeaponDefID then local ud = UnitDefs[unitDefID] - if ud and ud.customParams and ud.customParams.geothermal then return end + if ud and ud.customParams and ud.customParams.geothermal then + return + end end -- Legacy fallback used by other BAR visuals: builder attacker with no valid weapon. - if attackerID and attackerID ~= unitID and (not weaponDefID or weaponDefID < 0) then return end + if attackerID and attackerID ~= unitID and (not weaponDefID or weaponDefID < 0) then + return + end local meta = qualifyingDefs[unitDefID] - if not meta then return end + if not meta then + return + end local px, py, pz = spGetUnitPosition(unitID) - if not px then return end + if not px then + return + end -- LOS gate: skip if the local player can't see the unit's position. - if not cachedSpecFullView and not spIsPosInLos(px, py, pz, cachedAllyTeamID) then return end + if not cachedSpecFullView and not spIsPosInLos(px, py, pz, cachedAllyTeamID) then + return + end -- Lift slightly above the model base so particles emerge from the volume. local r = spGetUnitRadius(unitID) or 32 py = py + r * 0.35 @@ -1314,14 +1380,18 @@ function gadget:GameFrame(n) end -- Engine-spray mode: GL4 nano particles are off, so skip our burst too. - if nanoParticleMode == 0 then return end + if nanoParticleMode == 0 then + return + end -- Drain burst queue, capped per frame. local processed = 0 local cap = CONFIG.maxBurstsPerFrame while burstHead <= burstTail and processed < cap do local b = burstQueue[burstHead] - if b[6] > n then break end -- delay not yet elapsed; queue is FIFO so no later entry is ready + if b[6] > n then + break + end -- delay not yet elapsed; queue is FIFO so no later entry is ready burstQueue[burstHead] = nil burstHead = burstHead + 1 processBurst(b[1], b[2], b[3], b[4], b[5], n) @@ -1341,9 +1411,13 @@ function gadget:GameFrame(n) end function gadget:DrawWorld() - if nanoParticleMode == 0 then return end + if nanoParticleMode == 0 then + return + end local _pVBO = particleVBO - if not _pVBO or _pVBO.usedElements == 0 then return end + if not _pVBO or _pVBO.usedElements == 0 then + return + end -- Defensive GL state (same rationale as nano gadget). glDepthTest(GL_LEQUAL) diff --git a/luarules/gadgets/gfx_environmental_lightning_gl4.lua b/luarules/gadgets/gfx_environmental_lightning_gl4.lua index 0e1f17c5e7a..1dd0456a6d9 100644 --- a/luarules/gadgets/gfx_environmental_lightning_gl4.lua +++ b/luarules/gadgets/gfx_environmental_lightning_gl4.lua @@ -22,12 +22,12 @@ function gadget:GetInfo() return { - name = "Environmental Lightning GL4", - desc = "GL4 instanced procedural environmental lightning bursts", - author = "Floris", - date = "June 2026", + name = "Environmental Lightning GL4", + desc = "GL4 instanced procedural environmental lightning bursts", + author = "Floris", + date = "June 2026", license = "GNU GPL v2", - layer = 0, + layer = 0, enabled = true, } end @@ -36,20 +36,16 @@ end -- SYNCED: expose the spawn API and forward spawn requests to the renderer. -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - local SendToUnsynced = SendToUnsynced local spGetTeamInfo = Spring.GetTeamInfo function gadget:Initialize() GG.SpawnEnvironmentalLightning = function(configName, x, y, z, sizeScale, intensityScale, ownerTeamID) - if not configName or not x or not y or not z then return end + if not configName or not x or not y or not z then + return + end local ownerAllyTeamID = ownerTeamID and select(6, spGetTeamInfo(ownerTeamID, false)) - SendToUnsynced("envLightningSpawn", - tostring(configName), - x, y, z, - sizeScale or 1.0, - intensityScale or 1.0, - ownerAllyTeamID or -1) + SendToUnsynced("envLightningSpawn", tostring(configName), x, y, z, sizeScale or 1.0, intensityScale or 1.0, ownerAllyTeamID or -1) end end @@ -148,117 +144,129 @@ end local lightningConfigs = { scavradiation = { alwaysVisible = true, - r = 0.50, g = 0.4, b = 1.00, - coreR = 0.82, coreG = 0.7, coreB = 1.00, - lifeFrames = 9, - intensity = 0.20, - feather = 0.4, - baseWidth = 2.3, - reach = 425, - branchCount = 1, - childCount = 1.5, - childDecay = 0.6, -- forks thin out with depth (1.2 -> 0.72 -> 0.43 ...) - maxDepth = 5, - segments = 8, - jitterAmp = 20, + r = 0.50, + g = 0.4, + b = 1.00, + coreR = 0.82, + coreG = 0.7, + coreB = 1.00, + lifeFrames = 9, + intensity = 0.20, + feather = 0.4, + baseWidth = 2.3, + reach = 425, + branchCount = 1, + childCount = 1.5, + childDecay = 0.6, -- forks thin out with depth (1.2 -> 0.72 -> 0.43 ...) + maxDepth = 5, + segments = 8, + jitterAmp = 20, glowBrightness = 0.4, - vbias = 0.20, - spread = 1.57, - growFrac = 0.15, - flowFrac = 0.08, - tipTaper = 0.1, - rootTaper = 0.1, - sizeVarMin = 0.72, - sizeVarMax = 1.14, - intensityVar = 0.75, - lifeVar = 0.8, - maxStrikes = 3, - strikeOverlap = 0.25, - restrikeChance = 0.6, -- only ~half of eligible bursts get extra strikes - strikeFullDist = 2200, -- full strike count within this camera distance - strikeCullDist = 5000, -- forced to a single strike beyond this distance + vbias = 0.20, + spread = 1.57, + growFrac = 0.15, + flowFrac = 0.08, + tipTaper = 0.1, + rootTaper = 0.1, + sizeVarMin = 0.72, + sizeVarMax = 1.14, + intensityVar = 0.75, + lifeVar = 0.8, + maxStrikes = 3, + strikeOverlap = 0.25, + restrikeChance = 0.6, -- only ~half of eligible bursts get extra strikes + strikeFullDist = 2200, -- full strike count within this camera distance + strikeCullDist = 5000, -- forced to a single strike beyond this distance -- deferred GL4 point light flashed at the burst origin (0 brightness = off) - lightRadius = 450, - lightBrightness = 0.08, - lightSustainFrac = 0.6, -- hold full brightness for 60% of life, then fade - lightColor = {0.88, 0.5, 1.0}, -- override; default follows core color - lightLifeFrames = 6, -- override base; default = burst lifetime - lightRadiusComplexity = 0.65, -- big/rich bolts: up to +50% radius - lightLifeComplexity = 0.4, -- big/rich bolts: up to +50% light lifetime + lightRadius = 450, + lightBrightness = 0.08, + lightSustainFrac = 0.6, -- hold full brightness for 60% of life, then fade + lightColor = { 0.88, 0.5, 1.0 }, -- override; default follows core color + lightLifeFrames = 6, -- override base; default = burst lifetime + lightRadiusComplexity = 0.65, -- big/rich bolts: up to +50% radius + lightLifeComplexity = 0.4, -- big/rich bolts: up to +50% light lifetime lightModelFactor = 0.5, -- lightSpecular = 1.0, - lightScattering = 1.0, + lightScattering = 1.0, -- lightLensflare = 0.0, }, junoareastorm = { - r = 0.44, g = 0.94, b = 0.5, - coreR = 0.66, coreG = 1.00, coreB = 0.7, - lifeFrames = 10, - intensity = 0.66, - feather = 0.42, - baseWidth = 1.25, - reach = 280, - branchCount = 1, - childCount = 1.0, - maxDepth = 2, - segments = 6, - jitterAmp = 28, + r = 0.44, + g = 0.94, + b = 0.5, + coreR = 0.66, + coreG = 1.00, + coreB = 0.7, + lifeFrames = 10, + intensity = 0.66, + feather = 0.42, + baseWidth = 1.25, + reach = 280, + branchCount = 1, + childCount = 1.0, + maxDepth = 2, + segments = 6, + jitterAmp = 28, glowBrightness = 0.35, - vbias = 0.18, - spread = 1.4, - growFrac = 0.2, - flowFrac = 0.08, - tipTaper = 0.1, - rootTaper = 0.1, - sizeVarMin = 0.82, - sizeVarMax = 1.08, - intensityVar = 0.6, - lifeVar = 0.4, - maxStrikes = 1, - lightRadius = 340, - lightBrightness = 0.05, + vbias = 0.18, + spread = 1.4, + growFrac = 0.2, + flowFrac = 0.08, + tipTaper = 0.1, + rootTaper = 0.1, + sizeVarMin = 0.82, + sizeVarMax = 1.08, + intensityVar = 0.6, + lifeVar = 0.4, + maxStrikes = 1, + lightRadius = 340, + lightBrightness = 0.05, lightSustainFrac = 0.58, - lightColor = {0.55, 1.0, 0.58}, - lightLifeFrames = 6, + lightColor = { 0.55, 1.0, 0.58 }, + lightLifeFrames = 6, lightRadiusComplexity = 0.4, - lightLifeComplexity = 0.25, + lightLifeComplexity = 0.25, lightModelFactor = 0.45, - lightScattering = 1.0, + lightScattering = 1.0, }, junodamagezap = { - r = 0.30, g = 0.8, b = 0.35, - coreR = 0.70, coreG = 1.00, coreB = 0.75, - lifeFrames = 6, - intensity = 0.2, - feather = 0.45, - baseWidth = 0.9, - reach = 50, - branchCount = 2, - childCount = 0.5, - maxDepth = 1, - segments = 3, - jitterAmp = 12, + r = 0.30, + g = 0.8, + b = 0.35, + coreR = 0.70, + coreG = 1.00, + coreB = 0.75, + lifeFrames = 6, + intensity = 0.2, + feather = 0.45, + baseWidth = 0.9, + reach = 50, + branchCount = 2, + childCount = 0.5, + maxDepth = 1, + segments = 3, + jitterAmp = 12, glowBrightness = 0.26, - vbias = 0.3, - spread = 1.8, - growFrac = 0.35, - flowFrac = 0.14, - tipTaper = 0.18, - rootTaper = 0.12, - sizeVarMin = 0.9, - sizeVarMax = 1.1, - intensityVar = 0.2, - lifeVar = 0.2, - maxStrikes = 1, - lightRadius = 120, - lightBrightness = 0.04, + vbias = 0.3, + spread = 1.8, + growFrac = 0.35, + flowFrac = 0.14, + tipTaper = 0.18, + rootTaper = 0.12, + sizeVarMin = 0.9, + sizeVarMax = 1.1, + intensityVar = 0.2, + lifeVar = 0.2, + maxStrikes = 1, + lightRadius = 120, + lightBrightness = 0.04, lightSustainFrac = 0.45, - lightColor = {0.65, 1.0, 0.72}, - lightLifeFrames = 4, + lightColor = { 0.65, 1.0, 0.72 }, + lightLifeFrames = 4, lightModelFactor = 0.4, - lightScattering = 1.0, + lightScattering = 1.0, }, -- Electric burst for paralyzer (EMP) weapon impacts. A single burst is a @@ -267,54 +275,58 @@ local lightningConfigs = { -- and fires several of these around the blast for larger weapons, so the look -- here is intentionally one self-contained "zap" rather than an area effect. empimpact = { - r = 0.40, g = 0.60, b = 1.00, - coreR = 0.80, coreG = 0.90, coreB = 1.00, - lifeFrames = 7, - intensity = 0.2, - feather = 0.42, - baseWidth = 1.5, - reach = 40, -- reach at sizeScale 1; the gadget scales by AoE - branchCount = 2, - childCount = 1, - childDecay = 0.6, - maxDepth = 3, - segments = 6, - jitterAmp = 16, + r = 0.40, + g = 0.60, + b = 1.00, + coreR = 0.80, + coreG = 0.90, + coreB = 1.00, + lifeFrames = 7, + intensity = 0.2, + feather = 0.42, + baseWidth = 1.5, + reach = 40, -- reach at sizeScale 1; the gadget scales by AoE + branchCount = 2, + childCount = 1, + childDecay = 0.6, + maxDepth = 3, + segments = 6, + jitterAmp = 16, glowBrightness = 0.4, - vbias = 0.10, -- mostly outward, with a slight upward bias - spread = 1.7, - growFrac = 0.18, - flowFrac = 0.1, - tipTaper = 0.1, - rootTaper = 0.1, - sizeVarMin = 0.4, - sizeVarMax = 1.3, - intensityVar = 0.4, - lifeVar = 0.4, - maxStrikes = 8, - strikeOverlap = 0.3, + vbias = 0.10, -- mostly outward, with a slight upward bias + spread = 1.7, + growFrac = 0.18, + flowFrac = 0.1, + tipTaper = 0.1, + rootTaper = 0.1, + sizeVarMin = 0.4, + sizeVarMax = 1.3, + intensityVar = 0.4, + lifeVar = 0.4, + maxStrikes = 8, + strikeOverlap = 0.3, restrikeChance = 0.7, strikeFullDist = 2600, strikeCullDist = 5200, -- deferred GL4 point light flashed at the impact - lightRadius = 70, - lightBrightness = 0.025, + lightRadius = 70, + lightBrightness = 0.025, lightSustainFrac = 0.5, - lightColor = {0.6, 0.78, 1.0}, - lightLifeFrames = 4, + lightColor = { 0.6, 0.78, 1.0 }, + lightLifeFrames = 4, lightRadiusComplexity = 0.6, - lightLifeComplexity = 0.35, + lightLifeComplexity = 0.35, lightModelFactor = 0.5, - lightScattering = 1.0, - scatterCount = 1, - scatterFrames = 40, - scatterRadius = 40, - scatterHeightMin = 10, - scatterHeightMax = 20, - scatterSizeMin = 0.4, - scatterSizeMax = 0.7, + lightScattering = 1.0, + scatterCount = 1, + scatterFrames = 40, + scatterRadius = 40, + scatterHeightMin = 10, + scatterHeightMax = 20, + scatterSizeMin = 0.4, + scatterSizeMax = 0.7, scatterIntensityScale = 0.4, - scatterWidthScale = 1.0, + scatterWidthScale = 1.0, }, -- Centered on a freshly spawned unit (commander spawn / warp-in). Unlike the @@ -322,84 +334,92 @@ local lightningConfigs = { -- plus a stream of smaller electric sparks crackling across the surrounding -- area over roughly two seconds. commanderspawn = { - r = 0.55, g = 0.66, b = 1.00, - coreR = 0.92, coreG = 0.96, coreB = 1.00, - lifeFrames = 12, - intensity = 0.14, - feather = 0.5, - baseWidth = 1.4, - reach = 150, - branchCount = 3, - childCount = 2, - maxDepth = 2, - segments = 2, - jitterAmp = 24, + r = 0.55, + g = 0.66, + b = 1.00, + coreR = 0.92, + coreG = 0.96, + coreB = 1.00, + lifeFrames = 12, + intensity = 0.14, + feather = 0.5, + baseWidth = 1.4, + reach = 150, + branchCount = 3, + childCount = 2, + maxDepth = 2, + segments = 2, + jitterAmp = 24, glowBrightness = 0.35, - vbias = 0.35, - spread = 3.5, - growFrac = 0.45, - flowFrac = 0.3, - tipTaper = 0.1, - rootTaper = 0.1, - sizeVarMin = 0.85, - sizeVarMax = 1.5, - intensityVar = 0.4, - lifeVar = 0.15, - maxStrikes = 2, - strikeOverlap = 0.25, + vbias = 0.35, + spread = 3.5, + growFrac = 0.45, + flowFrac = 0.3, + tipTaper = 0.1, + rootTaper = 0.1, + sizeVarMin = 0.85, + sizeVarMax = 1.5, + intensityVar = 0.4, + lifeVar = 0.15, + maxStrikes = 2, + strikeOverlap = 0.25, restrikeChance = 0.8, maxIntensityScale = 1.35, - startDelay = 18, + startDelay = 18, -- scatter / area behaviour - centerHeight = 20, - centerSizeScale = 1.25, - centerIntensityScale = 1.45, - scatterCount = 12, - scatterFrames = 105, - scatterRadius = 30, - scatterHeightMin = 10, - scatterHeightMax = 20, - scatterSizeMin = 0.4, - scatterSizeMax = 0.7, + centerHeight = 20, + centerSizeScale = 1.25, + centerIntensityScale = 1.45, + scatterCount = 12, + scatterFrames = 105, + scatterRadius = 30, + scatterHeightMin = 10, + scatterHeightMax = 20, + scatterSizeMin = 0.4, + scatterSizeMax = 0.7, scatterIntensityScale = 1.0, - scatterWidthScale = 2.0, + scatterWidthScale = 2.0, }, } -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spGetGameFrame = Spring.GetGameFrame -local spIsAABBInView = Spring.IsAABBInView +local spGetGameFrame = Spring.GetGameFrame +local spIsAABBInView = Spring.IsAABBInView local spGetCameraPosition = Spring.GetCameraPosition -local spIsPosInLos = Spring.IsPosInLos +local spIsPosInLos = Spring.IsPosInLos local spGetMyAllyTeamID = Spring.GetMyAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState -local glBlending = gl.Blending +local glBlending = gl.Blending local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE +local GL_ONE = GL.ONE local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA - -local mathMin = math.min -local mathMax = math.max -local mathSqrt = math.sqrt -local mathSin = math.sin -local mathCos = math.cos -local mathPi = math.pi -local mathFloor = math.floor -local mathAbs = math.abs +local GL_SRC_ALPHA = GL.SRC_ALPHA + +local mathMin = math.min +local mathMax = math.max +local mathSqrt = math.sqrt +local mathSin = math.sin +local mathCos = math.cos +local mathPi = math.pi +local mathFloor = math.floor +local mathAbs = math.abs local mathRandom = math.random local LuaShader = gl.LuaShader local uploadAllElements = gl.InstanceVBOTable.uploadAllElements -local function clamp(v, lo, hi) return v < lo and lo or (v > hi and hi or v) end -local function lerp(a, b, t) return a + (b - a) * t end +local function clamp(v, lo, hi) + return v < lo and lo or (v > hi and hi or v) +end +local function lerp(a, b, t) + return a + (b - a) * t +end -- Probabilistic rounding: the fractional part becomes the chance of rounding up. -- e.g. 1.5 -> 1 or 2 with equal odds, 1.2 -> mostly 1 (20% chance of 2). local function probRound(v) @@ -417,41 +437,41 @@ local ENABLE_DYNAMIC_ANIMATION = false -------------------------------------------------------------------------------- local INITIAL_VBO_SIZE = 512 local IDLE_SKIP_FRAMES = 3 -local MAX_ACTIVE = 256 -- hard cap on simultaneous bursts (oldest dropped) +local MAX_ACTIVE = 256 -- hard cap on simultaneous bursts (oldest dropped) -- Lifetime envelope (fractions of each burst's lifeFrames) -local FADE_IN_FRAC = 0.04 -- burst fades in over this fraction of life -local FADE_OUT_FRAC = 0.19 -- burst fades out over the final fraction of life -local BRANCH_APPEAR = 0.03 -- per-arm pop-in fade window (life fraction) +local FADE_IN_FRAC = 0.04 -- burst fades in over this fraction of life +local FADE_OUT_FRAC = 0.19 -- burst fades out over the final fraction of life +local BRANCH_APPEAR = 0.03 -- per-arm pop-in fade window (life fraction) -- Per-restrike envelope (fractions of each strike's own time window) -local STRIKE_FADE_IN = 0.06 -- a restrike pops in over this fraction of its window -local STRIKE_FADE_OUT = 0.15 -- a restrike fades out over the final fraction of its window +local STRIKE_FADE_IN = 0.06 -- a restrike pops in over this fraction of its window +local STRIKE_FADE_OUT = 0.15 -- a restrike fades out over the final fraction of its window -- Dynamic animation reroll rate (steps per second) when ENABLE_DYNAMIC_ANIMATION -- is on. 30 = rerolls 30x/sec (fast tesla buzz); lower = slower, calmer crackle. local ANIMATE_RATE = 6.0 -- Bolt body look -local FLICKER_AMPLITUDE = 0.25 +local FLICKER_AMPLITUDE = 0.25 local THICKNESS_VARIATION = 0.5 -local SEGMENT_LENGTH_VAR = 1.75 -local JITTER_MAX_BOLT_FRAC = 0.10 +local SEGMENT_LENGTH_VAR = 1.75 +local JITTER_MAX_BOLT_FRAC = 0.10 local BRUSH_MAX_JITTER_FRAC = 0.5 -local CORE_EDGE_START = 0.03 -local CORE_EDGE_END = 0.3 -local CORE_BRIGHTNESS = 2.3 -local BRIGHTNESS_MULT = 2.5 -local MIN_PIXEL_WIDTH = 0.0018 -local TIP_TAPER_START = 0.6 -- segPos where tip taper begins (taper toward tip) -local ROOT_TAPER_END = 0.6 -- segPos where root taper ends (taper from origin) -local LENGTH_FALLOFF = 0.45 -- constant dimming toward the tip along each arm +local CORE_EDGE_START = 0.03 +local CORE_EDGE_END = 0.3 +local CORE_BRIGHTNESS = 2.3 +local BRIGHTNESS_MULT = 2.5 +local MIN_PIXEL_WIDTH = 0.0018 +local TIP_TAPER_START = 0.6 -- segPos where tip taper begins (taper toward tip) +local ROOT_TAPER_END = 0.6 -- segPos where root taper ends (taper from origin) +local LENGTH_FALLOFF = 0.45 -- constant dimming toward the tip along each arm -- Glow halo -local GLOW_WIDTH_MULT = 14.0 -local GLOW_FALLOFF_POWER = 5.0 +local GLOW_WIDTH_MULT = 14.0 +local GLOW_FALLOFF_POWER = 5.0 local GLOW_MIN_PIXEL_WIDTH = 0.005 -local INSTANCE_STRIDE = 24 -- 6 vec4 attributes +local INSTANCE_STRIDE = 24 -- 6 vec4 attributes -------------------------------------------------------------------------------- -- Precompute derived per-config fields (core color fallback, length falloff). @@ -460,17 +480,17 @@ for _, cfg in pairs(lightningConfigs) do cfg.coreR = cfg.coreR or mathMin(1, cfg.r + 0.4) cfg.coreG = cfg.coreG or mathMin(1, cfg.g + 0.4) cfg.coreB = cfg.coreB or mathMin(1, cfg.b + 0.4) - cfg.feather = cfg.feather or 0.5 - cfg.intensity = cfg.intensity or 1.0 + cfg.feather = cfg.feather or 0.5 + cfg.intensity = cfg.intensity or 1.0 cfg.childCount = cfg.childCount or 0 cfg.childDecay = clamp(cfg.childDecay or 1.0, 0.0, 1.0) - cfg.maxDepth = cfg.maxDepth or 0 - cfg.growFrac = cfg.growFrac or 0.4 - cfg.flowFrac = clamp(cfg.flowFrac or 0.0, 0.0, 0.95) - cfg.tipTaper = cfg.tipTaper or 0.15 - cfg.rootTaper = cfg.rootTaper or 1.0 - cfg.vbias = cfg.vbias or 0.0 - cfg.spread = cfg.spread or 0.8 + cfg.maxDepth = cfg.maxDepth or 0 + cfg.growFrac = cfg.growFrac or 0.4 + cfg.flowFrac = clamp(cfg.flowFrac or 0.0, 0.0, 0.95) + cfg.tipTaper = cfg.tipTaper or 0.15 + cfg.rootTaper = cfg.rootTaper or 1.0 + cfg.vbias = cfg.vbias or 0.0 + cfg.spread = cfg.spread or 0.8 cfg.sizeVarMin = cfg.sizeVarMin or 1.0 cfg.sizeVarMax = cfg.sizeVarMax or 1.0 cfg.intensityVar = cfg.intensityVar or 0.0 @@ -478,8 +498,8 @@ for _, cfg in pairs(lightningConfigs) do cfg.maxStrikes = mathMax(1, cfg.maxStrikes or 1) cfg.strikeOverlap = clamp(cfg.strikeOverlap or 0.25, 0.0, 0.9) cfg.restrikeChance = clamp(cfg.restrikeChance or 1.0, 0.0, 1.0) - cfg.strikeFullDist = cfg.strikeFullDist or 2200 -- within this dist: full strikes - cfg.strikeCullDist = cfg.strikeCullDist or 5000 -- beyond this dist: single strike + cfg.strikeFullDist = cfg.strikeFullDist or 2200 -- within this dist: full strikes + cfg.strikeCullDist = cfg.strikeCullDist or 5000 -- beyond this dist: single strike end -------------------------------------------------------------------------------- @@ -811,32 +831,32 @@ local function ensureFloatDefines(cfg) end local boltShaderConfig = { - FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, + FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, THICKNESS_VARIATION = THICKNESS_VARIATION, - SEGMENT_LENGTH_VAR = SEGMENT_LENGTH_VAR, + SEGMENT_LENGTH_VAR = SEGMENT_LENGTH_VAR, ENV_LIGHTNING_ANIMATE = ENABLE_DYNAMIC_ANIMATION and 1 or 0, - ANIMATE_RATE = ANIMATE_RATE, - JITTER_MAX_BOLT_FRAC = JITTER_MAX_BOLT_FRAC, + ANIMATE_RATE = ANIMATE_RATE, + JITTER_MAX_BOLT_FRAC = JITTER_MAX_BOLT_FRAC, BRUSH_MAX_JITTER_FRAC = BRUSH_MAX_JITTER_FRAC, - CORE_EDGE_START = CORE_EDGE_START, - CORE_EDGE_END = CORE_EDGE_END, - CORE_BRIGHTNESS = CORE_BRIGHTNESS, - BRIGHTNESS_MULT = BRIGHTNESS_MULT, - MIN_PIXEL_WIDTH = MIN_PIXEL_WIDTH, - TIP_TAPER_START = TIP_TAPER_START, - ROOT_TAPER_END = ROOT_TAPER_END, - LENGTH_FALLOFF = LENGTH_FALLOFF, + CORE_EDGE_START = CORE_EDGE_START, + CORE_EDGE_END = CORE_EDGE_END, + CORE_BRIGHTNESS = CORE_BRIGHTNESS, + BRIGHTNESS_MULT = BRIGHTNESS_MULT, + MIN_PIXEL_WIDTH = MIN_PIXEL_WIDTH, + TIP_TAPER_START = TIP_TAPER_START, + ROOT_TAPER_END = ROOT_TAPER_END, + LENGTH_FALLOFF = LENGTH_FALLOFF, } local glowShaderConfig = { - FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, + FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, ENV_LIGHTNING_ANIMATE = ENABLE_DYNAMIC_ANIMATION and 1 or 0, - ANIMATE_RATE = ANIMATE_RATE, - GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, - GLOW_FALLOFF_POWER = GLOW_FALLOFF_POWER, + ANIMATE_RATE = ANIMATE_RATE, + GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, + GLOW_FALLOFF_POWER = GLOW_FALLOFF_POWER, GLOW_MIN_PIXEL_WIDTH = GLOW_MIN_PIXEL_WIDTH, JITTER_MAX_BOLT_FRAC = JITTER_MAX_BOLT_FRAC, - LENGTH_FALLOFF = LENGTH_FALLOFF, + LENGTH_FALLOFF = LENGTH_FALLOFF, } -------------------------------------------------------------------------------- @@ -863,7 +883,10 @@ local function initGL4() shaderConfig = boltShaderConfig, forceupdate = true, }) - if not boltShader then goodbye("Failed to compile bolt shader"); return false end + if not boltShader then + goodbye("Failed to compile bolt shader") + return false + end glowShader = LuaShader.CheckShaderUpdates({ vsSrc = glowVsSrc, @@ -873,23 +896,27 @@ local function initGL4() shaderConfig = glowShaderConfig, forceupdate = true, }) - if not glowShader then goodbye("Failed to compile glow shader"); return false end + if not glowShader then + goodbye("Failed to compile glow shader") + return false + end - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, 0, 0, 1, 1, "envLightningQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "envLightningQuadVBO") local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("envLightningIndexVBO") local boltLayout = { - {id = 1, name = "startPosAndWidth", size = 4}, - {id = 2, name = "endPosAndTip", size = 4}, - {id = 3, name = "coreColor", size = 4}, - {id = 4, name = "edgeColor", size = 4}, - {id = 5, name = "boltParams", size = 4}, - {id = 6, name = "extraParams", size = 4}, + { id = 1, name = "startPosAndWidth", size = 4 }, + { id = 2, name = "endPosAndTip", size = 4 }, + { id = 3, name = "coreColor", size = 4 }, + { id = 4, name = "edgeColor", size = 4 }, + { id = 5, name = "boltParams", size = 4 }, + { id = 6, name = "extraParams", size = 4 }, } boltVBO = gl.InstanceVBOTable.makeInstanceVBOTable(boltLayout, INITIAL_VBO_SIZE, "envLightningVBO") - if not boltVBO then goodbye("Failed to create bolt VBO"); return false end + if not boltVBO then + goodbye("Failed to create bolt VBO") + return false + end boltVBO.numVertices = numVertices boltVBO.vertexVBO = quadVBO boltVBO.VAO = boltVBO:makeVAOandAttach(quadVBO, boltVBO.instanceVBO) @@ -901,7 +928,9 @@ end local function resizeBoltVBO(needed) local newMax = boltVBO.maxElements - while newMax < needed do newMax = newMax * 2 end + while newMax < needed do + newMax = newMax * 2 + end boltVBO.maxElements = newMax local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(newMax, boltVBO.layout) @@ -909,14 +938,19 @@ local function resizeBoltVBO(needed) boltVBO.instanceVBO = newInstanceVBO local data = boltVBO.instanceData local step = boltVBO.instanceStep - for i = #data + 1, step * newMax do data[i] = 0 end + for i = #data + 1, step * newMax do + data[i] = 0 + end boltVBO.VAO:Delete() boltVBO.VAO = boltVBO:makeVAOandAttach(boltVBO.vertexVBO, boltVBO.instanceVBO) boltVBO.VAO:AttachIndexBuffer(boltVBO.indexVBO) end local function cleanupGL4() - if boltVBO then boltVBO:Delete(); boltVBO = nil end + if boltVBO then + boltVBO:Delete() + boltVBO = nil + end end -------------------------------------------------------------------------------- @@ -925,10 +959,10 @@ end -- aabbPad, branches = { {sx,sy,sz, dx,dy,dz, len, startFrac, -- growFrac, seed, widthScale} ... } } -------------------------------------------------------------------------------- -local active = {} -- array of bursts -local nActive = 0 +local active = {} -- array of bursts +local nActive = 0 local idleSkipCounter = 0 -local lastBuildFrame = -1 +local lastBuildFrame = -1 local cachedAllyTeamID = -1 local cachedSpecFullView = false @@ -942,12 +976,16 @@ end -- Build an arbitrary perpendicular basis around a unit forward vector. local function perpBasis(fx, fy, fz) local upX, upY, upZ = 0, 1, 0 - if mathAbs(fy) > 0.9 then upX, upY, upZ = 1, 0, 0 end + if mathAbs(fy) > 0.9 then + upX, upY, upZ = 1, 0, 0 + end local ax = fy * upZ - fz * upY local ay = fz * upX - fx * upZ local az = fx * upY - fy * upX - local al = mathSqrt(ax*ax + ay*ay + az*az) - if al > 0.001 then ax, ay, az = ax/al, ay/al, az/al end + local al = mathSqrt(ax * ax + ay * ay + az * az) + if al > 0.001 then + ax, ay, az = ax / al, ay / al, az / al + end local bx = fy * az - fz * ay local by = fz * ax - fx * az local bz = fx * ay - fy * ax @@ -972,17 +1010,25 @@ local function buildBranches(cfg, sizeScale, branchCount, childCount, maxDepth, local function addBranch(sx, sy, sz, dx, dy, dz, len, startFrac, growFrac, depth, widthScale, childrem) n = n + 1 branches[n] = { - sx = sx, sy = sy, sz = sz, - dx = dx, dy = dy, dz = dz, + sx = sx, + sy = sy, + sz = sz, + dx = dx, + dy = dy, + dz = dz, len = len, startFrac = startFrac, growFrac = growFrac, seed = mathRandom() * 1000.0, widthScale = widthScale, } - if depth >= maxDepth then return end + if depth >= maxDepth then + return + end local kids = probRound(childrem) - if kids <= 0 then return end + if kids <= 0 then + return + end local childremNext = childrem * childDecay local ax, ay, az, bx, by, bz = perpBasis(dx, dy, dz) for _ = 1, kids do @@ -1003,14 +1049,17 @@ local function buildBranches(cfg, sizeScale, branchCount, childCount, maxDepth, local ndy = dy * c + pmy * s local ndz = dz * c + pmz * s -- Keep forks from pointing below horizontal too. - if ndy < 0.0 then ndy = 0.0 end - local nl = mathSqrt(ndx*ndx + ndy*ndy + ndz*ndz) - if nl > 0.001 then ndx, ndy, ndz = ndx/nl, ndy/nl, ndz/nl end + if ndy < 0.0 then + ndy = 0.0 + end + local nl = mathSqrt(ndx * ndx + ndy * ndy + ndz * ndz) + if nl > 0.001 then + ndx, ndy, ndz = ndx / nl, ndy / nl, ndz / nl + end local childLen = len * (0.45 + mathRandom() * 0.30) local childStart = startFrac + growFrac * anchorFrac if childStart < 0.98 then - addBranch(cx, cy, cz, ndx, ndy, ndz, childLen, - childStart, growFrac * 0.7, depth + 1, widthScale * 0.7, childremNext) + addBranch(cx, cy, cz, ndx, ndy, ndz, childLen, childStart, growFrac * 0.7, depth + 1, widthScale * 0.7, childremNext) end end end @@ -1020,15 +1069,19 @@ local function buildBranches(cfg, sizeScale, branchCount, childCount, maxDepth, local rx = mathRandom() * 2.0 - 1.0 local ry = mathRandom() * 2.0 - 1.0 local rz = mathRandom() * 2.0 - 1.0 - local rl = mathSqrt(rx*rx + ry*ry + rz*rz) - if rl < 0.001 then rx, ry, rz, rl = 0, 1, 0, 1 end - rx, ry, rz = rx/rl, ry/rl, rz/rl + local rl = mathSqrt(rx * rx + ry * ry + rz * rz) + if rl < 0.001 then + rx, ry, rz, rl = 0, 1, 0, 1 + end + rx, ry, rz = rx / rl, ry / rl, rz / rl -- blend vertical component toward the bias ry = ry * (1.0 - mathAbs(vbias)) + vbias -- Never point below horizontal: horizontal is the lowest allowed direction. - if ry < 0.0 then ry = 0.0 end - local bl = mathSqrt(rx*rx + ry*ry + rz*rz) - rx, ry, rz = rx/bl, ry/bl, rz/bl + if ry < 0.0 then + ry = 0.0 + end + local bl = mathSqrt(rx * rx + ry * ry + rz * rz) + rx, ry, rz = rx / bl, ry / bl, rz / bl local armLen = reach * (0.70 + mathRandom() * 0.30) -- positions are origin-relative; the burst origin is added at emit time. -- Depth 0 nodes start with the full childCount; it decays each level deeper. @@ -1044,14 +1097,18 @@ end local ScriptLuaUI = Script.LuaUI local function emitBurstLight(cfg, x, y, z, burstSizeScale, burstIntensity, burstLifeFrames, complexity01) local brightness = cfg.lightBrightness - if not brightness or brightness <= 0 then return end - if not ScriptLuaUI("EnvLightningPointLight") then return end + if not brightness or brightness <= 0 then + return + end + if not ScriptLuaUI("EnvLightningPointLight") then + return + end -- Bigger/richer/longer/brighter bursts get a larger, longer-lived light. -- complexity01 (0..1) already aggregates size, branching, lifetime and intensity. -- The *Complexity fields add up to that fraction extra at full complexity. local radiusBoost = 1.0 + (cfg.lightRadiusComplexity or 0.0) * complexity01 - local lifeBoost = 1.0 + (cfg.lightLifeComplexity or 0.0) * complexity01 + local lifeBoost = 1.0 + (cfg.lightLifeComplexity or 0.0) * complexity01 local radius = (cfg.lightRadius or 200) * burstSizeScale * radiusBoost local a = brightness * burstIntensity @@ -1059,30 +1116,29 @@ local function emitBurstLight(cfg, x, y, z, burstSizeScale, burstIntensity, burs -- Light color: explicit lightColor {r,g,b}, else follow the bolt core color. local lc = cfg.lightColor local lr, lg, lb - if lc then lr, lg, lb = lc[1], lc[2], lc[3] - else lr, lg, lb = cfg.coreR, cfg.coreG, cfg.coreB end + if lc then + lr, lg, lb = lc[1], lc[2], lc[3] + else + lr, lg, lb = cfg.coreR, cfg.coreG, cfg.coreB + end -- Lifetime: explicit lightLifeFrames, else follow the burst's own lifetime; -- then extend by the complexity boost so large bolts linger a bit longer. local lifetime = mathFloor((cfg.lightLifeFrames or burstLifeFrames) * lifeBoost + 0.5) - if lifetime < 1 then lifetime = 1 end + if lifetime < 1 then + lifetime = 1 + end -- Sustain: fraction of lifetime held at full brightness before fading out. local sustain = mathMax(1, mathFloor(lifetime * (cfg.lightSustainFrac or 0.6))) - ScriptLuaUI.EnvLightningPointLight( - x, y, z, radius, - lr, lg, lb, a, - lifetime, sustain, - cfg.lightModelFactor or 1.0, - cfg.lightSpecular or 1.0, - cfg.lightScattering or 1.0, - cfg.lightLensflare or 0.0, - spGetGameFrame()) + ScriptLuaUI.EnvLightningPointLight(x, y, z, radius, lr, lg, lb, a, lifetime, sustain, cfg.lightModelFactor or 1.0, cfg.lightSpecular or 1.0, cfg.lightScattering or 1.0, cfg.lightLensflare or 0.0, spGetGameFrame()) end local function spawnBurst(configName, x, y, z, sizeScale, intensityScale, widthScale) local cfg = lightningConfigs[configName] - if not cfg then return end + if not cfg then + return + end sizeScale = (sizeScale and sizeScale > 0) and sizeScale or 1.0 intensityScale = intensityScale or 1.0 widthScale = widthScale or 1.0 @@ -1126,7 +1182,9 @@ local function spawnBurst(configName, x, y, z, sizeScale, intensityScale, widthS local intensityJitter = 1.0 + ((mathRandom() * 2.0 - 1.0) * cfg.intensityVar) local burstIntensity = intensityScale * lerp(0.78, 1.25, complexity01) * intensityJitter - if burstIntensity < 0.05 then burstIntensity = 0.05 end + if burstIntensity < 0.05 then + burstIntensity = 0.05 + end if cfg.maxIntensityScale and burstIntensity > cfg.maxIntensityScale then burstIntensity = cfg.maxIntensityScale end @@ -1147,13 +1205,13 @@ local function spawnBurst(configName, x, y, z, sizeScale, intensityScale, widthS -- distance gate: cap allowed strikes by how far the burst is from camera local cx, cy, cz = spGetCameraPosition() local dx, dy, dz = x - cx, y - cy, z - cz - local dist = mathSqrt(dx*dx + dy*dy + dz*dz) + local dist = mathSqrt(dx * dx + dy * dy + dz * dz) if dist > cfg.strikeFullDist then - local fade = clamp( - (dist - cfg.strikeFullDist) / mathMax(1, cfg.strikeCullDist - cfg.strikeFullDist), - 0.0, 1.0) + local fade = clamp((dist - cfg.strikeFullDist) / mathMax(1, cfg.strikeCullDist - cfg.strikeFullDist), 0.0, 1.0) local distMax = mathMax(1, mathFloor(lerp(cfg.maxStrikes, 1, fade) + 0.5)) - if nStrikes > distMax then nStrikes = distMax end + if nStrikes > distMax then + nStrikes = distMax + end end end end @@ -1173,7 +1231,9 @@ local function spawnBurst(configName, x, y, z, sizeScale, intensityScale, widthS for i = 1, nStrikes do local t0 = (i - 1) * span local t1 = t0 + span * (1.0 + overlap) - if t1 > 1.0 then t1 = 1.0 end + if t1 > 1.0 then + t1 = 1.0 + end -- seedJitter shifts the shader's per-arm jitter pattern for this strike strikes[i] = { t0 = t0, t1 = t1, seedJitter = (i - 1) * 137.13 } end @@ -1184,7 +1244,9 @@ local function spawnBurst(configName, x, y, z, sizeScale, intensityScale, widthS local burst = { cfg = cfg, - x = x, y = y, z = z, + x = x, + y = y, + z = z, birthFrame = spGetGameFrame(), lifeFrames = burstLifeFrames, intensity = cfg.intensity * burstIntensity, @@ -1218,7 +1280,7 @@ end -- commander-spawn crackle). Pending entries are kept in a queue and emitted by -- updateBolts() once their target frame is reached. -------------------------------------------------------------------------------- -local pending = {} +local pending = {} local nPending = 0 local nextPendingFrame = math.huge @@ -1226,7 +1288,9 @@ local function schedule(configName, x, y, z, sizeScale, intensityScale, widthSca nPending = nPending + 1 pending[nPending] = { configName = configName, - x = x, y = y, z = z, + x = x, + y = y, + z = z, sizeScale = sizeScale, intensityScale = intensityScale, widthScale = widthScale, @@ -1242,7 +1306,9 @@ end -- burst plus any scattered area sparks it defines. local function requestLightning(configName, x, y, z, sizeScale, intensityScale) local cfg = lightningConfigs[configName] - if not cfg then return end + if not cfg then + return + end sizeScale = (sizeScale and sizeScale > 0) and sizeScale or 1.0 intensityScale = intensityScale or 1.0 @@ -1254,7 +1320,7 @@ local function requestLightning(configName, x, y, z, sizeScale, intensityScale) local cy = y + (cfg.centerHeight or 0) local cz = z local cSize = sizeScale * (cfg.centerSizeScale or 1.0) - local cInt = intensityScale * (cfg.centerIntensityScale or 1.0) + local cInt = intensityScale * (cfg.centerIntensityScale or 1.0) local cWidth = cfg.centerWidthScale or 1.0 if startDelay <= 0 then spawnBurst(configName, cx, cy, cz, cSize, cInt, cWidth) @@ -1275,7 +1341,7 @@ local function requestLightning(configName, x, y, z, sizeScale, intensityScale) local sWidth = cfg.scatterWidthScale or 1.0 for _ = 1, scatterCount do local ang = mathRandom() * 2.0 * mathPi - local rad = mathSqrt(mathRandom()) * scatterRadius -- uniform over disc + local rad = mathSqrt(mathRandom()) * scatterRadius -- uniform over disc local sx = x + mathCos(ang) * rad local sz = z + mathSin(ang) * rad local sy = y + hMin + mathRandom() * (hMax - hMin) @@ -1305,7 +1371,9 @@ local function processPending(frame) end end end - for i = w + 1, nPending do pending[i] = nil end + for i = w + 1, nPending do + pending[i] = nil + end nPending = w nextPendingFrame = nextFrame end @@ -1319,15 +1387,25 @@ local function pushArm(beamData, offset, burst, br, life, alphaMul, seedJitter) -- current grown length of this arm local local01 = (life - br.startFrac) / br.growFrac - if local01 <= 0 then return offset, 0 end - if local01 > 1 then local01 = 1 end + if local01 <= 0 then + return offset, 0 + end + if local01 > 1 then + local01 = 1 + end -- ease-out growth for a snappier "reaching" feel local grown = br.len * (1.0 - (1.0 - local01) * (1.0 - local01)) - if grown < 1 then return offset, 0 end + if grown < 1 then + return offset, 0 + end -- per-arm pop-in alpha local appear = (life - br.startFrac) / BRANCH_APPEAR - if appear > 1 then appear = 1 elseif appear < 0 then appear = 0 end + if appear > 1 then + appear = 1 + elseif appear < 0 then + appear = 0 + end local armAlpha = alphaMul * appear local ox, oy, oz = burst.x, burst.y, burst.z @@ -1369,15 +1447,15 @@ local function pushArm(beamData, offset, burst, br, life, alphaMul, seedJitter) local seed = br.seed + (seedJitter or 0.0) local count = 0 for s = 0, segs - 1 do - beamData[offset + 1] = sx - beamData[offset + 2] = sy - beamData[offset + 3] = sz - beamData[offset + 4] = baseWidth - beamData[offset + 5] = ex - beamData[offset + 6] = ey - beamData[offset + 7] = ez - beamData[offset + 8] = tipTaper - beamData[offset + 9] = cr + beamData[offset + 1] = sx + beamData[offset + 2] = sy + beamData[offset + 3] = sz + beamData[offset + 4] = baseWidth + beamData[offset + 5] = ex + beamData[offset + 6] = ey + beamData[offset + 7] = ez + beamData[offset + 8] = tipTaper + beamData[offset + 9] = cr beamData[offset + 10] = cg beamData[offset + 11] = cb beamData[offset + 12] = armAlpha @@ -1389,7 +1467,7 @@ local function pushArm(beamData, offset, burst, br, life, alphaMul, seedJitter) beamData[offset + 18] = s beamData[offset + 19] = segs beamData[offset + 20] = jitterAmp - beamData[offset + 21] = intensityW -- widthMul (brightness/size intensity) + beamData[offset + 21] = intensityW -- widthMul (brightness/size intensity) beamData[offset + 22] = widthScale beamData[offset + 23] = glowMult beamData[offset + 24] = feather @@ -1428,16 +1506,13 @@ local function updateBolts() active[w] = burst -- overall fade envelope (across the whole burst lifetime) - local envIn = life < FADE_IN_FRAC and (life / FADE_IN_FRAC) or 1.0 + local envIn = life < FADE_IN_FRAC and (life / FADE_IN_FRAC) or 1.0 local envOut = (1.0 - life) < FADE_OUT_FRAC and ((1.0 - life) / FADE_OUT_FRAC) or 1.0 local burstAlpha = envIn * envOut * burst.intensity if burstAlpha > 0.001 then local pad = burst.aabbPad - if spIsAABBInView( - burst.x - pad, burst.y - pad, burst.z - pad, - burst.x + pad, burst.y + pad, burst.z + pad - ) then + if spIsAABBInView(burst.x - pad, burst.y - pad, burst.z - pad, burst.x + pad, burst.y + pad, burst.z + pad) then -- Capacity: at most two strikes overlap at a time, but reserve for -- all of them at once to stay safe regardless of overlap setting. local need = beamCount + burst.nStrikes * burst.nBranches * burst.segments @@ -1458,7 +1533,7 @@ local function updateBolts() local span = strike.t1 - strike.t0 local strikeLife = (life - strike.t0) / span -- per-strike fade-in/out so each restrike pops in and dims - local sIn = strikeLife < STRIKE_FADE_IN and (strikeLife / STRIKE_FADE_IN) or 1.0 + local sIn = strikeLife < STRIKE_FADE_IN and (strikeLife / STRIKE_FADE_IN) or 1.0 local sOut = (1.0 - strikeLife) < STRIKE_FADE_OUT and ((1.0 - strikeLife) / STRIKE_FADE_OUT) or 1.0 local strikeAlpha = burstAlpha * sIn * sOut if strikeAlpha > 0.001 then @@ -1478,7 +1553,9 @@ local function updateBolts() end end -- clear any leftover slots after compaction - for i = w + 1, nActive do active[i] = nil end + for i = w + 1, nActive do + active[i] = nil + end nActive = w boltVBO.usedElements = beamCount @@ -1494,7 +1571,9 @@ end -- Drawing -------------------------------------------------------------------------------- local function drawAll() - if boltVBO.usedElements == 0 then return end + if boltVBO.usedElements == 0 then + return + end glDepthTest(true) glDepthMask(false) @@ -1528,7 +1607,9 @@ local function handleSpawn(_, configName, x, y, z, sizeScale, intensityScale, ow end function gadget:Initialize() - if not initGL4() then return end + if not initGL4() then + return + end updateViewCache() gadgetHandler:AddSyncAction("envLightningSpawn", handleSpawn) end @@ -1543,7 +1624,9 @@ function gadget:Shutdown() end function gadget:DrawWorld() - if not boltVBO then return end + if not boltVBO then + return + end local simFrame = spGetGameFrame() if simFrame ~= lastBuildFrame then lastBuildFrame = simFrame diff --git a/luarules/gadgets/gfx_explosion_lights.lua b/luarules/gadgets/gfx_explosion_lights.lua index d317ef405c4..28e2dff71be 100644 --- a/luarules/gadgets/gfx_explosion_lights.lua +++ b/luarules/gadgets/gfx_explosion_lights.lua @@ -1,118 +1,112 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Explosion_lights", - desc = "", - author = "Floris", - date = "April 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Explosion_lights", + desc = "", + author = "Floris", + date = "April 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if gadgetHandler:IsSyncedCode() then + local SendToUnsynced = SendToUnsynced + local spGetProjectilePosition = Spring.GetProjectilePosition + + local explosionTypes = { + Flame = true, + Cannon = true, + LaserCannon = true, + BeamLaser = true, + MissileLauncher = true, + AircraftBomb = true, + StarburstLauncher = true, + TorpedoLauncher = true, + } + + local cannonWeapons = {} + local watchedExplosions = {} + local watchedProjectiles = {} + + function gadget:Initialize() + for wdid, wd in pairs(WeaponDefs) do + if explosionTypes[wd.type] then + Script.SetWatchExplosion(wdid, true) + watchedExplosions[wdid] = true + end + if wd.type == "Cannon" or wd.type == "LaserCannon" then + cannonWeapons[wdid] = true + end + if wd.type == "Cannon" and wd.damages[0] >= 20 then + Script.SetWatchProjectile(wdid, true) + watchedProjectiles[wdid] = true + elseif wd.type == "LaserCannon" and wd.damages[0] >= 10 then + Script.SetWatchProjectile(wdid, true) + watchedProjectiles[wdid] = true + end + end + end - local SendToUnsynced = SendToUnsynced - local spGetProjectilePosition = Spring.GetProjectilePosition - - local explosionTypes = { - Flame = true, - Cannon = true, - LaserCannon = true, - BeamLaser = true, - MissileLauncher = true, - AircraftBomb = true, - StarburstLauncher = true, - TorpedoLauncher = true, - } - - local cannonWeapons = {} - local watchedExplosions = {} - local watchedProjectiles = {} - - function gadget:Initialize() - for wdid, wd in pairs(WeaponDefs) do - if explosionTypes[wd.type] then - Script.SetWatchExplosion(wdid, true) - watchedExplosions[wdid] = true - end - if wd.type == "Cannon" or wd.type == "LaserCannon" then - cannonWeapons[wdid] = true - end - if wd.type == "Cannon" and wd.damages[0] >= 20 then - Script.SetWatchProjectile(wdid, true) - watchedProjectiles[wdid] = true - elseif wd.type == "LaserCannon" and wd.damages[0] >= 10 then - Script.SetWatchProjectile(wdid, true) - watchedProjectiles[wdid] = true - end - end - end - - function gadget:Shutdown() - for wdid in pairs(watchedExplosions) do - Script.SetWatchExplosion(wdid, false) - end - for wdid in pairs(watchedProjectiles) do - Script.SetWatchProjectile(wdid, false) - end - end + function gadget:Shutdown() + for wdid in pairs(watchedExplosions) do + Script.SetWatchExplosion(wdid, false) + end + for wdid in pairs(watchedProjectiles) do + Script.SetWatchProjectile(wdid, false) + end + end - function gadget:Explosion(weaponID, px, py, pz, ownerID, projectileID) - SendToUnsynced("explosion_light", px, py, pz, weaponID, ownerID) - end + function gadget:Explosion(weaponID, px, py, pz, ownerID, projectileID) + SendToUnsynced("explosion_light", px, py, pz, weaponID, ownerID) + end - function gadget:ProjectileCreated(projectileID, ownerID, weaponID) + function gadget:ProjectileCreated(projectileID, ownerID, weaponID) if cannonWeapons[weaponID] then local px, py, pz = spGetProjectilePosition(projectileID) SendToUnsynced("barrelfire_light", px, py, pz, weaponID, ownerID) end - end - - -else -- Unsynced - - - local myPlayerID = Spring.GetMyPlayerID() - local myAllyID = Spring.GetMyAllyTeamID() - local fullView = select(2, Spring.GetSpectatingState()) - local spGetUnitAllyTeam = Spring.GetUnitAllyTeam + end +else -- Unsynced + local myPlayerID = Spring.GetMyPlayerID() + local myAllyID = Spring.GetMyAllyTeamID() + local fullView = select(2, Spring.GetSpectatingState()) + local spGetUnitAllyTeam = Spring.GetUnitAllyTeam local spIsPosInLos = Spring.IsPosInLos - function gadget:PlayerChanged(playerID) - if playerID == myPlayerID then - myPlayerID = Spring.GetMyPlayerID() - myAllyID = Spring.GetMyAllyTeamID() - fullView = select(2, Spring.GetSpectatingState()) - end - end + function gadget:PlayerChanged(playerID) + if playerID == myPlayerID then + myPlayerID = Spring.GetMyPlayerID() + myAllyID = Spring.GetMyAllyTeamID() + fullView = select(2, Spring.GetSpectatingState()) + end + end - local function SpawnExplosion(_,px,py,pz, weaponID, ownerID) + local function SpawnExplosion(_, px, py, pz, weaponID, ownerID) if ownerID ~= nil and Script.LuaUI("VisibleExplosion") then if fullView or spGetUnitAllyTeam(ownerID) == myAllyID or spIsPosInLos(px, py, pz, myAllyID) then Script.LuaUI.VisibleExplosion(px, py, pz, weaponID, ownerID) end end - end + end - local function SpawnBarrelfire(_,px,py,pz, weaponID, ownerID) + local function SpawnBarrelfire(_, px, py, pz, weaponID, ownerID) if ownerID ~= nil and Script.LuaUI("Barrelfire") then if fullView or spGetUnitAllyTeam(ownerID) == myAllyID or spIsPosInLos(px, py, pz, myAllyID) then Script.LuaUI.Barrelfire(px, py, pz, weaponID, ownerID) end end - end + end - function gadget:Initialize() - gadgetHandler:AddSyncAction("explosion_light", SpawnExplosion) - gadgetHandler:AddSyncAction("barrelfire_light", SpawnBarrelfire) - end + function gadget:Initialize() + gadgetHandler:AddSyncAction("explosion_light", SpawnExplosion) + gadgetHandler:AddSyncAction("barrelfire_light", SpawnBarrelfire) + end - function gadget:Shutdown() - gadgetHandler.RemoveSyncAction("explosion_light") - gadgetHandler.RemoveSyncAction("barrelfire_light") - end + function gadget:Shutdown() + gadgetHandler.RemoveSyncAction("explosion_light") + gadgetHandler.RemoveSyncAction("barrelfire_light") + end end diff --git a/luarules/gadgets/gfx_fire_gl4.lua b/luarules/gadgets/gfx_fire_gl4.lua index 924d380c7bc..e55e4056271 100644 --- a/luarules/gadgets/gfx_fire_gl4.lua +++ b/luarules/gadgets/gfx_fire_gl4.lua @@ -19,16 +19,18 @@ -- Modeled on gfx_flamethrower_gl4.lua (Floris) for the GL4 instancing pipeline. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { - name = "Fire GL4", - desc = "GL4 instanced fire/smoke/ember particle effects + GG.Fire API", - author = "Floris", - date = "May 2026", + name = "Fire GL4", + desc = "GL4 instanced fire/smoke/ember particle effects + GG.Fire API", + author = "Floris", + date = "May 2026", license = "GNU GPL v2", - layer = 0, + layer = 0, enabled = true, } end @@ -36,36 +38,36 @@ end -------------------------------------------------------------------------------- -- Localized engine functions -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetUnitPosition = Spring.GetUnitPosition -local spIsSphereInView = Spring.IsSphereInView -local spGetWind = Spring.GetWind -local spGetFPS = Spring.GetFPS +local spEcho = Spring.Echo +local spGetUnitPosition = Spring.GetUnitPosition +local spIsSphereInView = Spring.IsSphereInView +local spGetWind = Spring.GetWind +local spGetFPS = Spring.GetFPS -- Unsynced-only: forces a feature's draw matrix to refresh each frame so that -- synced SetFeatureDirection spins (e.g. falling trees) are actually rendered. local spSetFeatureAlwaysUpdateMatrix = Spring.SetFeatureAlwaysUpdateMatrix -local glBlending = gl.Blending -local glTexture = gl.Texture +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE +local GL_ONE = GL.ONE local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA local mathRandom = math.random -local mathMin = math.min -local mathMax = math.max -local mathFloor = math.floor -local mathCeil = math.ceil -local mathSqrt = math.sqrt -local mathSin = math.sin -local mathCos = math.cos -local mathPi = math.pi -local mathHuge = math.huge -local TWO_PI = mathPi * 2 +local mathMin = math.min +local mathMax = math.max +local mathFloor = math.floor +local mathCeil = math.ceil +local mathSqrt = math.sqrt +local mathSin = math.sin +local mathCos = math.cos +local mathPi = math.pi +local mathHuge = math.huge +local TWO_PI = mathPi * 2 ---@diagnostic disable-next-line: undefined-global local ScriptLuaUI = Script.LuaUI @@ -74,7 +76,7 @@ local selfdWeaponDefID = Game and Game.envDamageTypes and Game.envDamageTypes.Se local LuaShader = gl.LuaShader local pushElementInstance = gl.InstanceVBOTable.pushElementInstance -local popElementInstance = gl.InstanceVBOTable.popElementInstance +local popElementInstance = gl.InstanceVBOTable.popElementInstance local function isFinite(v) return v and v == v and v > -mathHuge and v < mathHuge @@ -84,17 +86,17 @@ end -- CONFIG -------------------------------------------------------------------------------- local CONFIG = { - enabled = true, - maxParticles = 6000, -- VBO capacity / hard cap + enabled = true, + maxParticles = 6000, -- VBO capacity / hard cap -- Fire (ptype 0) - fireSizeBase = 8.0, - fireSizeRand = 6.0, - fireGrowth = 4, - fireBuoyancy = 8.5, -- shader rise: FIRE_BUOY * t*t - fireLifeMin = 8, - fireLifeSpan = 12, -- life in [min, min+span] - fireAlpha = 0.95, + fireSizeBase = 8.0, + fireSizeRand = 6.0, + fireGrowth = 4, + fireBuoyancy = 8.5, -- shader rise: FIRE_BUOY * t*t + fireLifeMin = 8, + fireLifeSpan = 12, -- life in [min, min+span] + fireAlpha = 0.95, fireBrightness = 1.55, fireWobbleMin = 0.5, fireWobbleMax = 2.5, @@ -102,28 +104,28 @@ local CONFIG = { -- Smoke (ptype 1) smokeSizeBase = 3.0, smokeSizeRand = 3.3, - smokeGrowth = 4.0, - smokeBuoyancy = 0.02, -- shader rise: SMOKE_BUOY * age*age - smokeLifeMin = 40, + smokeGrowth = 4.0, + smokeBuoyancy = 0.02, -- shader rise: SMOKE_BUOY * age*age + smokeLifeMin = 40, smokeLifeSpan = 70, - smokeAlpha = 0.2, - smokeWobble = 3.5, - smokeTint = { 0.3, 0.28, 0.26 }, + smokeAlpha = 0.2, + smokeWobble = 3.5, + smokeTint = { 0.3, 0.28, 0.26 }, smokeUpVelMin = 0.20, smokeUpVelSpan = 0.30, -- Ember (ptype 2) -- upward wobbly flaky glowing flecks emberSizeBase = 2.0, emberSizeRand = 1.6, - emberGrowth = 0.0, + emberGrowth = 0.0, emberBuoyancy = 0.004, - emberLifeMin = 16, + emberLifeMin = 16, emberLifeSpan = 26, - emberAlpha = 0.9, + emberAlpha = 0.9, emberBrightness = 1.5, - emberWobble = 1.6, -- strong constant wobble => flaky drifting - emberVyMin = 1.8, - emberVySpan = 3.0, + emberWobble = 1.6, -- strong constant wobble => flaky drifting + emberVyMin = 1.8, + emberVySpan = 3.0, -- Wind influence windFlameMult = 0.0008, @@ -131,78 +133,78 @@ local CONFIG = { windEmberMult = 0.0016, -- Default emitter timings (frames @30Hz) - unitFireFrames = 40, -- how long after a hit a unit keeps burning - unitSmokeExtra = 120, -- smoke lingers this much longer than the fire - wreckFireFrames = 30, -- ~1s strong fire on wreckage - wreckFireFadeTail = 60, -- ~2s diminishing fire after the strong phase - wreckSmokeFrames = 320, -- long smoke on wreckage - wreckBridgeFrames = 22, -- short bridge fire while waiting for corpse spawn - wreckAwaitFrames = 240, -- max wait for delayed corpse spawn (long death animations) + unitFireFrames = 40, -- how long after a hit a unit keeps burning + unitSmokeExtra = 120, -- smoke lingers this much longer than the fire + wreckFireFrames = 30, -- ~1s strong fire on wreckage + wreckFireFadeTail = 60, -- ~2s diminishing fire after the strong phase + wreckSmokeFrames = 320, -- long smoke on wreckage + wreckBridgeFrames = 22, -- short bridge fire while waiting for corpse spawn + wreckAwaitFrames = 240, -- max wait for delayed corpse spawn (long death animations) unitDeathLifeMult = 1.2, -- global multiplier for how long unit death fire effects last (stacks with ftDurationMult and sdDurationMult) -- Bonus multipliers for flamethrower units (stacks on top of other multipliers) - ftScaleMult = 2.0, -- extra fire duration when a flamethrower unit dies - ftDurationMult = 1.2, -- extra fire duration when a flamethrower unit dies + ftScaleMult = 2.0, -- extra fire duration when a flamethrower unit dies + ftDurationMult = 1.2, -- extra fire duration when a flamethrower unit dies -- Bonus multipliers for self-destructed units (stacks on top of other multipliers) - sdScaleMult = 1.4, -- extra visual scale when a unit self-destructs - sdDurationMult = 1.2, -- extra fire duration when a unit self-destructs + sdScaleMult = 1.4, -- extra visual scale when a unit self-destructs + sdDurationMult = 1.2, -- extra fire duration when a unit self-destructs -- Default emitter emission rates (particles per sim frame, fractional ok) - fireRate = 1.1, + fireRate = 1.1, smokeRate = 0.35, emberRate = 0.5, -- Tree fire: a column of flame that grows up a burning tree and topples -- with it into a line of fire on the ground (driven by gfx_tree_feller). treeFire = { - growFrames = 55, -- fallback climb time if synced sends none - startHeightFrac = 0.18, -- fire height at ignite (fraction of tree height) - canopyFrac = 0.60, -- default height fraction of canopy (where fuel is) - trunkRadiusFrac = 0.18, -- trunk radius vs canopy radius - radiusMult = 0.72, -- tighten tree fire into a denser core instead of a broad sheet - fireRate = 1.55, - smokeRate = 0.5, - emberRate = 0.42, - fireSizeMult = 0.4, -- individual flames are small; volume comes from many particles - smokeAlphaMult = 0.67, - smokeSizeMult = 1.206, - smokeTail = 150, -- smoke lingers this long after the fire stops + growFrames = 55, -- fallback climb time if synced sends none + startHeightFrac = 0.18, -- fire height at ignite (fraction of tree height) + canopyFrac = 0.60, -- default height fraction of canopy (where fuel is) + trunkRadiusFrac = 0.18, -- trunk radius vs canopy radius + radiusMult = 0.72, -- tighten tree fire into a denser core instead of a broad sheet + fireRate = 1.55, + smokeRate = 0.5, + emberRate = 0.42, + fireSizeMult = 0.4, -- individual flames are small; volume comes from many particles + smokeAlphaMult = 0.67, + smokeSizeMult = 1.206, + smokeTail = 150, -- smoke lingers this long after the fire stops light = { - intervalMin = 4, -- minimum frames between deferred-light pulses - intervalJitter = 4, -- extra randomized frame spacing (0..n) - lifeFrames = 12, -- per-pulse light lifetime in frames - lifeJitter = 5, -- random extra lifetime (0..n) - sustainFrac = 0.2, -- hold full intensity for this life fraction + intervalMin = 4, -- minimum frames between deferred-light pulses + intervalJitter = 4, -- extra randomized frame spacing (0..n) + lifeFrames = 12, -- per-pulse light lifetime in frames + lifeJitter = 5, -- random extra lifetime (0..n) + sustainFrac = 0.2, -- hold full intensity for this life fraction radiusCanopyMult = 2.6, radiusHeightMult = 0.35, brightnessBase = 0.1, secondaryBrightnessMult = 0.6, - heightOffset = 45, - modelFactor = 0.45, - specular = 0.8, - scattering = 1.0, - lensflare = 0.0, + heightOffset = 45, + modelFactor = 0.45, + specular = 0.8, + scattering = 1.0, + lensflare = 0.0, }, }, -- Generic fire (unit/wreck/spawned) deferred lighting pulses. fireLight = { - intervalMin = 6, + intervalMin = 6, intervalJitter = 6, - lifeFrames = 12, - lifeJitter = 4, - sustainFrac = 0.25, - radiusMult = 1.7, + lifeFrames = 12, + lifeJitter = 4, + sustainFrac = 0.25, + radiusMult = 1.7, radiusScaleMult = 17.0, brightnessBase = 0.2, secondaryBrightnessMult = 0.55, - heightOffset = 12, - modelFactor = 0.45, - specular = 0.8, - scattering = 1.0, - lensflare = 0.0, + heightOffset = 12, + modelFactor = 0.45, + specular = 0.8, + scattering = 1.0, + lensflare = 0.0, }, -- Culling @@ -210,7 +212,9 @@ local CONFIG = { } if not CONFIG.enabled then - function gadget:Initialize() gadgetHandler:RemoveGadget() end + function gadget:Initialize() + gadgetHandler:RemoveGadget() + end return end @@ -419,15 +423,15 @@ void main() { -------------------------------------------------------------------------------- -- GL state -------------------------------------------------------------------------------- -local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" +local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" local smokeTexture = "bitmaps/projectiletextures/smoke-beh-anim.tga" -local particleVBO = nil +local particleVBO = nil local particleShader = nil local nextParticleID = 0 -local particleRemoveQueue = {} -- [deathFrame] = { n = count, id, id, ... } -local lastRemovedFrame = 0 +local particleRemoveQueue = {} -- [deathFrame] = { n = count, id, id, ... } +local lastRemovedFrame = 0 local cachedGameFrame = 0 local windX, windZ = 0, 0 @@ -444,25 +448,25 @@ end local function initGL4() local shaderSource = { - vsSrc = vsSrc, - fsSrc = fsSrc, - shaderName = "FireGL4", - uniformInt = { fireTex = 0, smokeTex = 1 }, + vsSrc = vsSrc, + fsSrc = fsSrc, + shaderName = "FireGL4", + uniformInt = { fireTex = 0, smokeTex = 1 }, uniformFloat = {}, shaderConfig = { - FIRE_BUOY = CONFIG.fireBuoyancy, - SMOKE_BUOY = CONFIG.smokeBuoyancy, - EMBER_BUOY = CONFIG.emberBuoyancy, + FIRE_BUOY = CONFIG.fireBuoyancy, + SMOKE_BUOY = CONFIG.smokeBuoyancy, + EMBER_BUOY = CONFIG.emberBuoyancy, WIND_FLAME_MULT = CONFIG.windFlameMult, WIND_SMOKE_MULT = CONFIG.windSmokeMult, WIND_EMBER_MULT = CONFIG.windEmberMult, FIRE_WOBBLE_MIN = CONFIG.fireWobbleMin, FIRE_WOBBLE_MAX = CONFIG.fireWobbleMax, - SMOKE_WOBBLE = CONFIG.smokeWobble, - EMBER_WOBBLE = CONFIG.emberWobble, - FIRE_GROWTH = CONFIG.fireGrowth, - SMOKE_GROWTH = CONFIG.smokeGrowth, - EMBER_GROWTH = CONFIG.emberGrowth, + SMOKE_WOBBLE = CONFIG.smokeWobble, + EMBER_WOBBLE = CONFIG.emberWobble, + FIRE_GROWTH = CONFIG.fireGrowth, + SMOKE_GROWTH = CONFIG.smokeGrowth, + EMBER_GROWTH = CONFIG.emberGrowth, }, forceupdate = true, } @@ -473,30 +477,24 @@ local function initGL4() return false end - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "fireQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "fireQuadVBO") local layout = { - { id = 1, name = "worldPos", size = 4 }, - { id = 2, name = "velLife", size = 4 }, - { id = 3, name = "sizeData", size = 4 }, + { id = 1, name = "worldPos", size = 4 }, + { id = 2, name = "velLife", size = 4 }, + { id = 3, name = "sizeData", size = 4 }, { id = 4, name = "tintAlpha", size = 4 }, } - particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable( - layout, CONFIG.maxParticles, "fireParticleVBO" - ) + particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable(layout, CONFIG.maxParticles, "fireParticleVBO") if not particleVBO then goodbye("VBO creation failed") return false end - particleVBO.numVertices = numVertices - particleVBO.vertexVBO = quadVBO - particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO) + particleVBO.numVertices = numVertices + particleVBO.vertexVBO = quadVBO + particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO) particleVBO.primitiveType = GL.TRIANGLES local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("fireIndexVBO") @@ -516,7 +514,7 @@ end -------------------------------------------------------------------------------- -- Particle spawn / expiry -------------------------------------------------------------------------------- -local particleData = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,1,1,1 } +local particleData = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, alpha) if particleVBO.usedElements >= MAX_PARTICLES then @@ -524,15 +522,15 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, end local deathFrame = cachedGameFrame + mathCeil(life) + 2 - particleData[1] = px - particleData[2] = py - particleData[3] = pz - particleData[4] = cachedGameFrame - particleData[5] = vx - particleData[6] = vy - particleData[7] = vz - particleData[8] = life - particleData[9] = size + particleData[1] = px + particleData[2] = py + particleData[3] = pz + particleData[4] = cachedGameFrame + particleData[5] = vx + particleData[6] = vy + particleData[7] = vz + particleData[8] = life + particleData[9] = size particleData[10] = ptype particleData[11] = mathRandom() particleData[12] = (mathRandom() * 2 - 1) * mathPi @@ -544,11 +542,15 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, -- Wrap nextParticleID well below the float32 precision ceiling (2^23) and -- skip any still-live IDs (see gfx_flamethrower_gl4.lua for the rationale). local nid = nextParticleID + 1 - if nid >= 8388608 then nid = 1 end + if nid >= 8388608 then + nid = 1 + end local idToIndex = particleVBO.instanceIDtoIndex while idToIndex[nid] do nid = nid + 1 - if nid >= 8388608 then nid = 1 end + if nid >= 8388608 then + nid = 1 + end end nextParticleID = nid local id = nid @@ -561,14 +563,16 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, end local qn = q.n + 1 q[qn] = id - q.n = qn + q.n = qn return id end local function removeExpiredParticles(gameFrame) local startFrame = lastRemovedFrame + 1 if gameFrame - startFrame > 600 then - for f = startFrame, gameFrame - 601 do particleRemoveQueue[f] = nil end + for f = startFrame, gameFrame - 601 do + particleRemoveQueue[f] = nil + end startFrame = gameFrame - 600 end for f = startFrame, gameFrame do @@ -592,29 +596,21 @@ end -------------------------------------------------------------------------------- -- Color helpers (pre-multiplied by brightness) -------------------------------------------------------------------------------- -local FIRE_BRI = CONFIG.fireBrightness +local FIRE_BRI = CONFIG.fireBrightness local EMBER_BRI = CONFIG.emberBrightness local function fireColor(scavenger) if scavenger then - return (0.88 + 0.18 * mathRandom()) * FIRE_BRI, - (0.22 + 0.20 * mathRandom()) * FIRE_BRI, - (0.62 + 0.34 * mathRandom()) * FIRE_BRI + return (0.88 + 0.18 * mathRandom()) * FIRE_BRI, (0.22 + 0.20 * mathRandom()) * FIRE_BRI, (0.62 + 0.34 * mathRandom()) * FIRE_BRI end - return FIRE_BRI, - (0.37 + 0.22 * mathRandom()) * FIRE_BRI, - (0.07 + 0.12 * mathRandom()) * FIRE_BRI + return FIRE_BRI, (0.37 + 0.22 * mathRandom()) * FIRE_BRI, (0.07 + 0.12 * mathRandom()) * FIRE_BRI end local function emberColor(scavenger) if scavenger then - return (0.92 + 0.14 * mathRandom()) * EMBER_BRI, - (0.36 + 0.24 * mathRandom()) * EMBER_BRI, - (0.68 + 0.28 * mathRandom()) * EMBER_BRI + return (0.92 + 0.14 * mathRandom()) * EMBER_BRI, (0.36 + 0.24 * mathRandom()) * EMBER_BRI, (0.68 + 0.28 * mathRandom()) * EMBER_BRI end - return EMBER_BRI, - (0.62 + 0.30 * mathRandom()) * EMBER_BRI, - (0.14 + 0.24 * mathRandom()) * EMBER_BRI + return EMBER_BRI, (0.62 + 0.30 * mathRandom()) * EMBER_BRI, (0.14 + 0.24 * mathRandom()) * EMBER_BRI end local SMOKE_R = CONFIG.smokeTint[1] @@ -624,28 +620,28 @@ local SMOKE_B = CONFIG.smokeTint[3] -- Hot-loop CONFIG constants hoisted to upvalues. Particle emit functions spawn -- hundreds of particles per frame; a direct upvalue read is much cheaper than a -- per-particle CONFIG table hash lookup. -local FIRE_SIZE_BASE = CONFIG.fireSizeBase -local FIRE_SIZE_RAND = CONFIG.fireSizeRand -local FIRE_LIFE_MIN = CONFIG.fireLifeMin -local FIRE_LIFE_SPAN = CONFIG.fireLifeSpan -local FIRE_ALPHA = CONFIG.fireAlpha +local FIRE_SIZE_BASE = CONFIG.fireSizeBase +local FIRE_SIZE_RAND = CONFIG.fireSizeRand +local FIRE_LIFE_MIN = CONFIG.fireLifeMin +local FIRE_LIFE_SPAN = CONFIG.fireLifeSpan +local FIRE_ALPHA = CONFIG.fireAlpha local EMBER_SIZE_BASE = CONFIG.emberSizeBase local EMBER_SIZE_RAND = CONFIG.emberSizeRand -local EMBER_LIFE_MIN = CONFIG.emberLifeMin +local EMBER_LIFE_MIN = CONFIG.emberLifeMin local EMBER_LIFE_SPAN = CONFIG.emberLifeSpan -local EMBER_ALPHA = CONFIG.emberAlpha -local EMBER_VY_MIN = CONFIG.emberVyMin -local EMBER_VY_SPAN = CONFIG.emberVySpan +local EMBER_ALPHA = CONFIG.emberAlpha +local EMBER_VY_MIN = CONFIG.emberVyMin +local EMBER_VY_SPAN = CONFIG.emberVySpan local SMOKE_SIZE_BASE = CONFIG.smokeSizeBase local SMOKE_SIZE_RAND = CONFIG.smokeSizeRand -local SMOKE_LIFE_MIN = CONFIG.smokeLifeMin +local SMOKE_LIFE_MIN = CONFIG.smokeLifeMin local SMOKE_LIFE_SPAN = CONFIG.smokeLifeSpan local SMOKE_UPVEL_MIN = CONFIG.smokeUpVelMin local SMOKE_UPVEL_SPAN = CONFIG.smokeUpVelSpan -local SMOKE_ALPHA = CONFIG.smokeAlpha +local SMOKE_ALPHA = CONFIG.smokeAlpha local TREE_SMOKE_ALPHA_MULT = CONFIG.treeFire.smokeAlphaMult or 1.0 local TREE_SMOKE_SIZE_MULT = CONFIG.treeFire.smokeSizeMult or 1.0 -local CULL_PAD = CONFIG.cullPad +local CULL_PAD = CONFIG.cullPad -------------------------------------------------------------------------------- -- Emitters @@ -653,16 +649,20 @@ local CULL_PAD = CONFIG.cullPad -- Each emitter spawns fire / smoke / ember particles at a position each frame -- until its per-type end frame passes. Emitters can be attached to a unit, in -- which case the spawn position follows the unit while it burns. -local emitters = {} -- dense array -local emitterCount = 0 -local unitFireEmitter = {} -- [unitID] = emitter (for hit-refresh dedupe) -local treeFireEmitters = {} -- [featureID] = emitter (burning trees) -local pendingWreckFire = {} -- [unitID] = pending transition data +local emitters = {} -- dense array +local emitterCount = 0 +local unitFireEmitter = {} -- [unitID] = emitter (for hit-refresh dedupe) +local treeFireEmitters = {} -- [featureID] = emitter (burning trees) +local pendingWreckFire = {} -- [unitID] = pending transition data local function rateCount(rate) - if rate <= 0 then return 0 end + if rate <= 0 then + return 0 + end local n = mathFloor(rate) - if mathRandom() < (rate - n) then n = n + 1 end + if mathRandom() < (rate - n) then + n = n + 1 + end return n end @@ -677,15 +677,25 @@ local SMOKE_TB = CONFIG.smokeTint[3] local function emitTreeFire(e, n) local elapsed = n - e.startFrame local fallT = elapsed / e.fallFrames - if fallT < 0 then fallT = 0 elseif fallT > 1 then fallT = 1 end + if fallT < 0 then + fallT = 0 + elseif fallT > 1 then + fallT = 1 + end local growT = elapsed / e.growFrames - if growT < 0 then growT = 0 elseif growT > 1 then growT = 1 end + if growT < 0 then + growT = 0 + elseif growT > 1 then + growT = 1 + end local sizeLifeMult = 1.0 if e.fireSizeFadeStart and n > e.fireSizeFadeStart then local fadeSpan = e.fireSizeFadeEnd - e.fireSizeFadeStart if fadeSpan > 0 then sizeLifeMult = 1.0 - mathMin(1.0, (n - e.fireSizeFadeStart) / fadeSpan) - if sizeLifeMult < 0.0 then sizeLifeMult = 0.0 end + if sizeLifeMult < 0.0 then + sizeLifeMult = 0.0 + end end end local emberLifeMult = 0.20 + 0.80 * sizeLifeMult @@ -694,7 +704,9 @@ local function emitTreeFire(e, n) local fadeMult = 1.0 if e.fadeStart then fadeMult = 1.0 - mathMin(1.0, (n - e.fadeStart) / (e.fadeDuration or 150)) - if fadeMult < 0.0 then fadeMult = 0.0 end + if fadeMult < 0.0 then + fadeMult = 0.0 + end end local smokeFireDiminishMult = 1.0 if n <= e.fireEnd then @@ -706,20 +718,22 @@ local function emitTreeFire(e, n) local sHF = CONFIG.treeFire.startHeightFrac local curH = e.height * (sHF + (1.0 - sHF) * growT) - if curH < 1 then curH = 1 end + if curH < 1 then + curH = 1 + end -- Axis interpolates from straight up (fallT 0) to horizontal fall dir (fallT 1). - local ang = fallT * (mathPi * 0.5) + local ang = fallT * (mathPi * 0.5) local axisUp = mathCos(ang) - local axisH = mathSin(ang) + local axisH = mathSin(ang) local dirx, dirz = e.dirx, e.dirz - local cf = e.canopyFrac - local trunkR = e.trunkR + local cf = e.canopyFrac + local trunkR = e.trunkR local canopyR = e.canopyR - local scale = e.scale + local scale = e.scale local lifeScale = e.lifeScale or scale - local inten = e.intensity + local inten = e.intensity -- FIRE -- denser and larger toward the center of the tree's length, tapering at both ends. if n <= e.fireEnd then @@ -732,7 +746,11 @@ local function emitTreeFire(e, n) else hf = mathRandom() end - if hf < 0 then hf = 0 elseif hf > 1 then hf = 1 end + if hf < 0 then + hf = 0 + elseif hf > 1 then + hf = 1 + end local rad if hf < cf then rad = trunkR + (canopyR - trunkR) * (hf / cf) @@ -752,9 +770,7 @@ local function emitTreeFire(e, n) local life = (FIRE_LIFE_MIN + mathRandom() * FIRE_LIFE_SPAN) * lifeScale local vy = (0.4 + mathRandom() * 0.8) * scale local r, g, b = fireColor() - spawnParticle(cx + mathCos(a2) * rr, cy + mathRandom() * rad * 0.3, cz + mathSin(a2) * rr, - (mathRandom() - 0.5) * 0.4, vy, (mathRandom() - 0.5) * 0.4, - size, 0, life, r, g, b, FIRE_ALPHA * (0.82 + 0.18 * mathRandom())) + spawnParticle(cx + mathCos(a2) * rr, cy + mathRandom() * rad * 0.3, cz + mathSin(a2) * rr, (mathRandom() - 0.5) * 0.4, vy, (mathRandom() - 0.5) * 0.4, size, 0, life, r, g, b, FIRE_ALPHA * (0.82 + 0.18 * mathRandom())) end end @@ -763,7 +779,11 @@ local function emitTreeFire(e, n) local cnt = rateCount(e.emberRate * inten * fadeMult * emberLifeMult) for _ = 1, cnt do local hf = cf + (mathRandom() - mathRandom()) * 0.5 - if hf < 0 then hf = 0 elseif hf > 1 then hf = 1 end + if hf < 0 then + hf = 0 + elseif hf > 1 then + hf = 1 + end local rad = trunkR + (canopyR - trunkR) * mathMin(1.0, hf / cf) local along = hf * curH local cx = e.x + dirx * along * axisH @@ -775,9 +795,7 @@ local function emitTreeFire(e, n) local life = (EMBER_LIFE_MIN + mathRandom() * EMBER_LIFE_SPAN) * lifeScale local vy = EMBER_VY_MIN + mathRandom() * EMBER_VY_SPAN local r, g, b = emberColor() - spawnParticle(cx + mathCos(a2) * rr, cy, cz + mathSin(a2) * rr, - (mathRandom() - 0.5) * 0.5, vy, (mathRandom() - 0.5) * 0.5, - size, 2, life, r, g, b, EMBER_ALPHA) + spawnParticle(cx + mathCos(a2) * rr, cy, cz + mathSin(a2) * rr, (mathRandom() - 0.5) * 0.5, vy, (mathRandom() - 0.5) * 0.5, size, 2, life, r, g, b, EMBER_ALPHA) end end @@ -788,13 +806,17 @@ local function emitTreeFire(e, n) local span = e.smokeEnd - e.smokeDecayStart if span > 0 then smokeDecayMult = 1.0 - (n - e.smokeDecayStart) / span * 0.80 - if smokeDecayMult < 0.20 then smokeDecayMult = 0.20 end + if smokeDecayMult < 0.20 then + smokeDecayMult = 0.20 + end end end local cnt = rateCount(e.smokeRate * inten * smokeDecayMult * smokeFireDiminishMult) for _ = 1, cnt do local hf = cf + mathRandom() * (1.0 - cf) * 0.8 + 0.1 - if hf > 1 then hf = 1 end + if hf > 1 then + hf = 1 + end local rad = canopyR local along = hf * curH local cx = e.x + dirx * along * axisH @@ -805,11 +827,8 @@ local function emitTreeFire(e, n) local size = (SMOKE_SIZE_BASE + mathRandom() * SMOKE_SIZE_RAND) * scale * TREE_SMOKE_SIZE_MULT * smokeFireDiminishMult local life = (SMOKE_LIFE_MIN + mathRandom() * SMOKE_LIFE_SPAN) * lifeScale local svy = SMOKE_UPVEL_MIN + mathRandom() * SMOKE_UPVEL_SPAN - local sv = 0.25 + mathRandom() * 1.10 - spawnParticle(cx + mathCos(a2) * rr, cy + rad * 0.4, cz + mathSin(a2) * rr, - (mathRandom() - 0.5) * 0.15, svy, (mathRandom() - 0.5) * 0.15, - size, 1, life, SMOKE_TR * sv, SMOKE_TG * sv, SMOKE_TB * sv, - SMOKE_ALPHA * TREE_SMOKE_ALPHA_MULT * smokeDecayMult) + local sv = 0.25 + mathRandom() * 1.10 + spawnParticle(cx + mathCos(a2) * rr, cy + rad * 0.4, cz + mathSin(a2) * rr, (mathRandom() - 0.5) * 0.15, svy, (mathRandom() - 0.5) * 0.15, size, 1, life, SMOKE_TR * sv, SMOKE_TG * sv, SMOKE_TB * sv, SMOKE_ALPHA * TREE_SMOKE_ALPHA_MULT * smokeDecayMult) end end @@ -822,11 +841,17 @@ local function emitTreeFire(e, n) e.nextLightFrame = n + lcfg.intervalMin + mathFloor(mathRandom() * (lcfg.intervalJitter + 1)) local life = lcfg.lifeFrames + mathFloor(mathRandom() * (lcfg.lifeJitter + 1)) - if life < 1 then life = 1 end + if life < 1 then + life = 1 + end local sustain = mathMax(1, mathFloor(life * lcfg.sustainFrac)) local scaleNorm = (e.scale - 0.16) / 0.84 - if scaleNorm < 0 then scaleNorm = 0 elseif scaleNorm > 1 then scaleNorm = 1 end + if scaleNorm < 0 then + scaleNorm = 0 + elseif scaleNorm > 1 then + scaleNorm = 1 + end local burnLifeMult = smokeFireDiminishMult local flicker = 0.72 + mathRandom() * 0.56 local brightness = lcfg.brightnessBase * e.intensity * burnLifeMult * flicker * (0.7 + 0.5 * scaleNorm) @@ -843,15 +868,7 @@ local function emitTreeFire(e, n) local warm = 0.84 + 0.14 * mathRandom() local lg = 0.36 + 0.22 * mathRandom() - ScriptLuaUI.EnvLightningPointLight( - lx, ly, lz, radius, - warm, lg, 0.10, brightness, - life, sustain, - lcfg.modelFactor, - lcfg.specular, - lcfg.scattering, - lcfg.lensflare, - n) + ScriptLuaUI.EnvLightningPointLight(lx, ly, lz, radius, warm, lg, 0.10, brightness, life, sustain, lcfg.modelFactor, lcfg.specular, lcfg.scattering, lcfg.lensflare, n) -- Secondary dimmer pulse near canopy / leading fire front. if curH > 10 and burnLifeMult > 0.22 then @@ -862,15 +879,7 @@ local function emitTreeFire(e, n) local cz = e.z + dirz * canopyAlong * axisH local cBright = brightness * lcfg.secondaryBrightnessMult * (0.85 + 0.3 * mathRandom()) local cRadius = radius * (0.74 + 0.22 * mathRandom()) - ScriptLuaUI.EnvLightningPointLight( - cx, cy, cz, cRadius, - 1.0, 0.46, 0.12, cBright, - life, sustain, - lcfg.modelFactor, - lcfg.specular, - lcfg.scattering, - lcfg.lensflare, - n) + ScriptLuaUI.EnvLightningPointLight(cx, cy, cz, cRadius, 1.0, 0.46, 0.12, cBright, life, sustain, lcfg.modelFactor, lcfg.specular, lcfg.scattering, lcfg.lensflare, n) end end end @@ -879,12 +888,14 @@ local function emitTreeFire(e, n) end local function emitFromEmitter(e, n) - if e.treeFire then return emitTreeFire(e, n) end + if e.treeFire then + return emitTreeFire(e, n) + end local x, y, z = e.x, e.y, e.z - local radius = e.radius - local scale = e.scale - local lifeScale = e.lifeScale or scale -- lifetime scales with unit size, NOT with scaleMult boost - local inten = e.intensity + local radius = e.radius + local scale = e.scale + local lifeScale = e.lifeScale or scale -- lifetime scales with unit size, NOT with scaleMult boost + local inten = e.intensity local spreadPoints = e.spreadPoints local spreadCount = spreadPoints and #spreadPoints or 0 local spreadSizeMult = e.spreadSizeMult or 1.0 @@ -894,7 +905,9 @@ local function emitFromEmitter(e, n) local fadeSpan = (e.fadeEnd or e.smokeEnd) - e.fadeStart if fadeSpan > 0 then emitterFadeMult = 1.0 - (n - e.fadeStart) / fadeSpan - if emitterFadeMult < 0 then emitterFadeMult = 0 end + if emitterFadeMult < 0 then + emitterFadeMult = 0 + end end end local emitterFadeVisual = emitterFadeMult * emitterFadeMult @@ -912,7 +925,9 @@ local function emitFromEmitter(e, n) local decaySpan = decayEnd - e.fireDecayStart if decaySpan > 0 and n > e.fireDecayStart then fireDecayMult = 1.0 - (n - e.fireDecayStart) / decaySpan - if fireDecayMult < 0 then fireDecayMult = 0 end + if fireDecayMult < 0 then + fireDecayMult = 0 + end if e.fireDecayPower and e.fireDecayPower ~= 1.0 then fireDecayMult = fireDecayMult ^ e.fireDecayPower end @@ -944,18 +959,17 @@ local function emitFromEmitter(e, n) sz = sz + p[2] end local ang = mathRandom() * TWO_PI - local rr = mathSqrt(mathRandom()) * radius * fireRadiusDecayMult * emitterFadeVisual - local ox = mathCos(ang) * rr - local oz = mathSin(ang) * rr - local oy = mathRandom() * radius * 0.3 * fireRadiusDecayMult * emitterFadeVisual + local rr = mathSqrt(mathRandom()) * radius * fireRadiusDecayMult * emitterFadeVisual + local ox = mathCos(ang) * rr + local oz = mathSin(ang) * rr + local oy = mathRandom() * radius * 0.3 * fireRadiusDecayMult * emitterFadeVisual local size = (FIRE_SIZE_BASE + (mathRandom() - 0.5) * FIRE_SIZE_RAND) * scale * fireSizeDecayMult * spreadSizeMult * (0.05 + 0.95 * emitterFadeVisual) local life = (FIRE_LIFE_MIN + mathRandom() * FIRE_LIFE_SPAN) * lifeScale * fireLifeDecayMult * (0.04 + 0.96 * emitterFadeVisual) local vx = (mathRandom() - 0.5) * 0.4 - local vy = (0.4 + mathRandom() * 0.8) * scale * (0.45 + 0.55 * fireRadiusDecayMult) * (0.08 + 0.92 * emitterFadeVisual) -- lower rise as the wreck fire collapses + local vy = (0.4 + mathRandom() * 0.8) * scale * (0.45 + 0.55 * fireRadiusDecayMult) * (0.08 + 0.92 * emitterFadeVisual) -- lower rise as the wreck fire collapses local vz = (mathRandom() - 0.5) * 0.4 local r, g, b = fireColor(scavenger) - spawnParticle(sx + ox, y + oy, sz + oz, vx, vy, vz, size, 0, life, - r, g, b, FIRE_ALPHA * fireAlphaMult * fireAlphaDecayMult * emitterFadeVisual * (0.82 + 0.18 * mathRandom())) + spawnParticle(sx + ox, y + oy, sz + oz, vx, vy, vz, size, 0, life, r, g, b, FIRE_ALPHA * fireAlphaMult * fireAlphaDecayMult * emitterFadeVisual * (0.82 + 0.18 * mathRandom())) end end @@ -969,7 +983,9 @@ local function emitFromEmitter(e, n) if decaySpan > 0 then local emberMinDecay = e.emberMinDecayMult or 0.05 emberDecayMult = 1.0 - (n - e.emberDecayStart) / decaySpan * 0.85 - if emberDecayMult < emberMinDecay then emberDecayMult = emberMinDecay end + if emberDecayMult < emberMinDecay then + emberDecayMult = emberMinDecay + end emberRateDecayMult = emberDecayMult if e.emberRateDecayPower and e.emberRateDecayPower ~= 1.0 then emberRateDecayMult = emberRateDecayMult ^ e.emberRateDecayPower @@ -991,18 +1007,17 @@ local function emitFromEmitter(e, n) sz = sz + p[2] end local ang = mathRandom() * TWO_PI - local rr = mathSqrt(mathRandom()) * radius * 0.8 * emitterFadeVisual - local ox = mathCos(ang) * rr - local oz = mathSin(ang) * rr - local oy = (radius * 0.2 + mathRandom() * radius * 0.3) * (0.08 + 0.92 * emitterFadeVisual) + local rr = mathSqrt(mathRandom()) * radius * 0.8 * emitterFadeVisual + local ox = mathCos(ang) * rr + local oz = mathSin(ang) * rr + local oy = (radius * 0.2 + mathRandom() * radius * 0.3) * (0.08 + 0.92 * emitterFadeVisual) local size = (EMBER_SIZE_BASE + (mathRandom() - 0.5) * EMBER_SIZE_RAND) * scale * spreadSizeMult * (0.04 + 0.96 * emitterFadeVisual) local life = (EMBER_LIFE_MIN + mathRandom() * EMBER_LIFE_SPAN) * lifeScale * (0.03 + 0.97 * emitterFadeVisual) local vx = (mathRandom() - 0.5) * 0.5 local vy = EMBER_VY_MIN + mathRandom() * EMBER_VY_SPAN local vz = (mathRandom() - 0.5) * 0.5 local r, g, b = emberColor(scavenger) - spawnParticle(sx + ox, y + oy, sz + oz, vx, vy, vz, size, 2, life, - r, g, b, EMBER_ALPHA * emberAlphaMult * emberAlphaDecayMult * emitterFadeVisual) + spawnParticle(sx + ox, y + oy, sz + oz, vx, vy, vz, size, 2, life, r, g, b, EMBER_ALPHA * emberAlphaMult * emberAlphaDecayMult * emitterFadeVisual) end end @@ -1015,7 +1030,9 @@ local function emitFromEmitter(e, n) if decaySpan > 0 then local smokeMinDecay = e.smokeMinDecayMult or 0.20 smokeDecayMult = 1.0 - (n - e.smokeDecayStart) / decaySpan * 0.80 - if smokeDecayMult < smokeMinDecay then smokeDecayMult = smokeMinDecay end + if smokeDecayMult < smokeMinDecay then + smokeDecayMult = smokeMinDecay + end end end local cnt = rateCount(e.smokeRate * inten * smokeDecayMult) @@ -1027,19 +1044,16 @@ local function emitFromEmitter(e, n) sz = sz + p[2] end local ang = mathRandom() * TWO_PI - local rr = mathSqrt(mathRandom()) * radius - local ox = mathCos(ang) * rr - local oz = mathSin(ang) * rr - local oy = radius * 0.4 + mathRandom() * radius * 0.6 + local rr = mathSqrt(mathRandom()) * radius + local ox = mathCos(ang) * rr + local oz = mathSin(ang) * rr + local oy = radius * 0.4 + mathRandom() * radius * 0.6 local size = (SMOKE_SIZE_BASE + mathRandom() * SMOKE_SIZE_RAND) * scale * spreadSizeMult local life = (SMOKE_LIFE_MIN + mathRandom() * SMOKE_LIFE_SPAN) * lifeScale - local svy = SMOKE_UPVEL_MIN + mathRandom() * SMOKE_UPVEL_SPAN + local svy = SMOKE_UPVEL_MIN + mathRandom() * SMOKE_UPVEL_SPAN -- Per-particle brightness: dark sooty cores (~0.25) to lighter billows (~1.35) - local sv = 0.25 + mathRandom() * 1.10 - spawnParticle(sx + ox, y + oy, sz + oz, - (mathRandom() - 0.5) * 0.15, svy, (mathRandom() - 0.5) * 0.15, - size, 1, life, SMOKE_R * sv, SMOKE_G * sv, SMOKE_B * sv, - SMOKE_ALPHA * smokeDecayMult) + local sv = 0.25 + mathRandom() * 1.10 + spawnParticle(sx + ox, y + oy, sz + oz, (mathRandom() - 0.5) * 0.15, svy, (mathRandom() - 0.5) * 0.15, size, 1, life, SMOKE_R * sv, SMOKE_G * sv, SMOKE_B * sv, SMOKE_ALPHA * smokeDecayMult) end end @@ -1056,7 +1070,9 @@ local function emitFromEmitter(e, n) local decaySpan = decayEnd - e.fireDecayStart if decaySpan > 0 then local decayMult = 1.0 - (n - e.fireDecayStart) / decaySpan - if decayMult < 0 then decayMult = 0 end + if decayMult < 0 then + decayMult = 0 + end if e.fireDecayPower and e.fireDecayPower ~= 1.0 then decayMult = decayMult ^ e.fireDecayPower end @@ -1070,11 +1086,17 @@ local function emitFromEmitter(e, n) if lightLifeMult > 0.02 then local life = lcfg.lifeFrames + mathFloor(mathRandom() * (lcfg.lifeJitter + 1)) - if life < 1 then life = 1 end + if life < 1 then + life = 1 + end local sustain = mathMax(1, mathFloor(life * lcfg.sustainFrac)) local scaleNorm = (e.scale - 0.55) / 1.85 - if scaleNorm < 0 then scaleNorm = 0 elseif scaleNorm > 1 then scaleNorm = 1 end + if scaleNorm < 0 then + scaleNorm = 0 + elseif scaleNorm > 1 then + scaleNorm = 1 + end local flicker = 0.72 + mathRandom() * 0.56 local radius = (e.radius * lcfg.radiusMult + e.scale * lcfg.radiusScaleMult) radius = radius * (e.lightRadiusMult or 1.0) * (0.70 + 0.55 * lightLifeMult) * (0.88 + 0.26 * mathRandom()) @@ -1085,30 +1107,14 @@ local function emitFromEmitter(e, n) local lz = z + (mathRandom() - 0.5) * radius * 0.22 local ly = y + lcfg.heightOffset + radius * 0.15 local lg = 0.35 + 0.20 * mathRandom() - ScriptLuaUI.EnvLightningPointLight( - lx, ly, lz, radius, - 1.0, lg, 0.10, brightness, - life, sustain, - lcfg.modelFactor, - lcfg.specular, - lcfg.scattering, - lcfg.lensflare, - n) + ScriptLuaUI.EnvLightningPointLight(lx, ly, lz, radius, 1.0, lg, 0.10, brightness, life, sustain, lcfg.modelFactor, lcfg.specular, lcfg.scattering, lcfg.lensflare, n) if radius > 12 and lightLifeMult > 0.35 then local cBright = brightness * lcfg.secondaryBrightnessMult * (0.85 + 0.30 * mathRandom()) local cRadius = radius * (0.66 + 0.28 * mathRandom()) local cx = x + (mathRandom() - 0.5) * cRadius * 0.38 local cz = z + (mathRandom() - 0.5) * cRadius * 0.38 - ScriptLuaUI.EnvLightningPointLight( - cx, ly, cz, cRadius, - 1.0, 0.45, 0.12, cBright, - life, sustain, - lcfg.modelFactor, - lcfg.specular, - lcfg.scattering, - lcfg.lensflare, - n) + ScriptLuaUI.EnvLightningPointLight(cx, ly, cz, cRadius, 1.0, 0.45, 0.12, cBright, life, sustain, lcfg.modelFactor, lcfg.specular, lcfg.scattering, lcfg.lensflare, n) end end end @@ -1154,7 +1160,7 @@ local function updateEmitters(n) e.mappedUnit = nil end if not e.keepAfterUnitGone then - e.fireEnd = mathMin(e.fireEnd, n) + e.fireEnd = mathMin(e.fireEnd, n) e.emberEnd = mathMin(e.emberEnd, n) e.smokeEnd = mathMin(e.smokeEnd, n + 10) end @@ -1172,22 +1178,36 @@ end -------------------------------------------------------------------------------- -- Per-unitDef precomputed emit params + wreckage detection -------------------------------------------------------------------------------- -local unitFireParams = {} -- [unitDefID] = { radius, yOffset, scale, wreckScale, wreckLifeScale } -local leavesWreck = {} -- [unitDefID] = true +local unitFireParams = {} -- [unitDefID] = { radius, yOffset, scale, wreckScale, wreckLifeScale } +local leavesWreck = {} -- [unitDefID] = true local corpseFeatureDefID = {} -- [unitDefID] = featureDefID for udid, ud in pairs(UnitDefs) do local r = ud.radius or 32 local sc = r / 42 - if sc < 0.55 then sc = 0.55 elseif sc > 2.4 then sc = 2.4 end + if sc < 0.55 then + sc = 0.55 + elseif sc > 2.4 then + sc = 2.4 + end -- Wreck fires need a lower floor than hit-fire to avoid tiny units (armflea) -- spawning oversized plumes, and should scale lifetime up harder for big wrecks. local wrs = r / 42 - if wrs < 0.001 then wrs = 0.001 end + if wrs < 0.001 then + wrs = 0.001 + end local wreckScale = wrs ^ 0.90 - if wreckScale < 0.20 then wreckScale = 0.20 elseif wreckScale > 2.8 then wreckScale = 2.8 end + if wreckScale < 0.20 then + wreckScale = 0.20 + elseif wreckScale > 2.8 then + wreckScale = 2.8 + end local wreckLifeScale = wrs ^ 1.20 - if wreckLifeScale < 0.40 then wreckLifeScale = 0.40 elseif wreckLifeScale > 3.8 then wreckLifeScale = 3.8 end + if wreckLifeScale < 0.40 then + wreckLifeScale = 0.40 + elseif wreckLifeScale > 3.8 then + wreckLifeScale = 3.8 + end local footprint = (ud.xsize or 4) * (ud.zsize or 4) local wreckSpreadBias = 1.0 if ud.isBuilding then @@ -1197,9 +1217,9 @@ for udid, ud in pairs(UnitDefs) do local scavenger = cp and cp.isscavenger scavenger = (scavenger == true) or (scavenger == 1) or (scavenger == "1") or (scavenger == "true") unitFireParams[udid] = { - radius = mathMax(6, r * 0.34), + radius = mathMax(6, r * 0.34), yOffset = (ud.height or r) * 0.4, - scale = sc, + scale = sc, wreckScale = wreckScale, wreckLifeScale = wreckLifeScale, wreckSpreadBias = wreckSpreadBias, @@ -1244,26 +1264,28 @@ end local function spawnFire(x, y, z, opts) opts = opts or {} local now = cachedGameFrame - local fireDur = opts.duration or CONFIG.unitFireFrames - local smokeDur = opts.smokeDuration or (fireDur + CONFIG.unitSmokeExtra) - local emberDur = opts.emberDuration or fireDur + local fireDur = opts.duration or CONFIG.unitFireFrames + local smokeDur = opts.smokeDuration or (fireDur + CONFIG.unitSmokeExtra) + local emberDur = opts.emberDuration or fireDur local e = { - unitID = opts.unitID, + unitID = opts.unitID, mappedUnit = nil, - scavenger = opts.scavenger and true or nil, - x = x or 0, y = y or 0, z = z or 0, - yOffset = opts.yOffset or 0, - radius = opts.radius or 14, - scale = opts.scale or 1.0, - intensity = opts.intensity or 1.0, - lightIntensity = opts.lightIntensity or 1.0, + scavenger = opts.scavenger and true or nil, + x = x or 0, + y = y or 0, + z = z or 0, + yOffset = opts.yOffset or 0, + radius = opts.radius or 14, + scale = opts.scale or 1.0, + intensity = opts.intensity or 1.0, + lightIntensity = opts.lightIntensity or 1.0, lightRadiusMult = opts.lightRadiusMult or 1.0, - fireRate = (opts.fire == false) and 0 or (opts.fireRate or CONFIG.fireRate), - smokeRate = (opts.smoke == false) and 0 or (opts.smokeRate or CONFIG.smokeRate), - emberRate = (opts.embers == false) and 0 or (opts.emberRate or CONFIG.emberRate), - fireEnd = now + fireDur, - smokeEnd = now + smokeDur, - emberEnd = now + emberDur, + fireRate = (opts.fire == false) and 0 or (opts.fireRate or CONFIG.fireRate), + smokeRate = (opts.smoke == false) and 0 or (opts.smokeRate or CONFIG.smokeRate), + emberRate = (opts.embers == false) and 0 or (opts.emberRate or CONFIG.emberRate), + fireEnd = now + fireDur, + smokeEnd = now + smokeDur, + emberEnd = now + emberDur, } return addEmitter(e) end @@ -1277,36 +1299,40 @@ local function addUnitFire(unitID, unitDefID, durationFrames) local e = unitFireEmitter[unitID] if e then -- Refresh burn timers (continuous flame keeps it alight). - e.fireEnd = now + fireDur + e.fireEnd = now + fireDur e.emberEnd = now + fireDur e.smokeEnd = mathMax(e.smokeEnd, now + fireDur + CONFIG.unitSmokeExtra) return e end - local radius = p and p.radius or 14 + local radius = p and p.radius or 14 local yOffset = p and p.yOffset or 12 - local scale = p and p.scale or 1.0 + local scale = p and p.scale or 1.0 local scavenger = p and p.scavenger e = { - unitID = unitID, + unitID = unitID, mappedUnit = unitID, - scavenger = scavenger and true or nil, - x = 0, y = 0, z = 0, - yOffset = yOffset, - radius = radius, - scale = scale, - intensity = 1.0, - lightIntensity = 1.0, + scavenger = scavenger and true or nil, + x = 0, + y = 0, + z = 0, + yOffset = yOffset, + radius = radius, + scale = scale, + intensity = 1.0, + lightIntensity = 1.0, lightRadiusMult = 1.0, - fireRate = CONFIG.fireRate, - smokeRate = CONFIG.smokeRate, - emberRate = CONFIG.emberRate, - fireEnd = now + fireDur, - emberEnd = now + fireDur, - smokeEnd = now + fireDur + CONFIG.unitSmokeExtra, + fireRate = CONFIG.fireRate, + smokeRate = CONFIG.smokeRate, + emberRate = CONFIG.emberRate, + fireEnd = now + fireDur, + emberEnd = now + fireDur, + smokeEnd = now + fireDur + CONFIG.unitSmokeExtra, } local ux, uy, uz = spGetUnitPosition(unitID) if ux then - e.x = ux; e.y = uy + yOffset; e.z = uz + e.x = ux + e.y = uy + yOffset + e.z = uz end unitFireEmitter[unitID] = e return addEmitter(e) @@ -1318,12 +1344,20 @@ end local function makeWreckSpreadPoints(visualScale, spreadBias) local bias = spreadBias or 1.0 local spreadStrength = ((visualScale * bias) - 1.05) / 1.25 - if spreadStrength < 0 then spreadStrength = 0 elseif spreadStrength > 1 then spreadStrength = 1 end - if spreadStrength <= 0 then return nil, 1.0, 1.0 end + if spreadStrength < 0 then + spreadStrength = 0 + elseif spreadStrength > 1 then + spreadStrength = 1 + end + if spreadStrength <= 0 then + return nil, 1.0, 1.0 + end local spreadCount = 3 + mathFloor(spreadStrength * 3.99) local spreadRad = (5.0 + 9.0 * spreadStrength) * visualScale local spreadSizeMult = 1.0 - 0.5 * spreadStrength - if spreadSizeMult < 0.5 then spreadSizeMult = 0.5 end + if spreadSizeMult < 0.5 then + spreadSizeMult = 0.5 + end local spreadPoints = {} for i = 1, spreadCount do local ang = (i - 1) / spreadCount * TWO_PI + (mathRandom() - 0.5) * (TWO_PI / spreadCount) @@ -1337,7 +1371,7 @@ end local function spawnWreckageFire(x, y, z, scale, opts) local now = cachedGameFrame scale = scale or 1.0 - local sm = (opts and opts.scaleMult) or 1.0 + local sm = (opts and opts.scaleMult) or 1.0 local dm = (opts and opts.durationMult) or 1.0 local lifeScale = (opts and opts.lifeScale) or scale local visualScale = scale * sm @@ -1348,60 +1382,70 @@ local function spawnWreckageFire(x, y, z, scale, opts) if spreadPoints == nil and coreRadiusMult == nil and spreadSizeMult == nil then spreadPoints, coreRadiusMult, spreadSizeMult = makeWreckSpreadPoints(visualScale, opts and opts.spreadBias) end - if coreRadiusMult == nil then coreRadiusMult = spreadPoints and 0.60 or 1.0 end - if spreadSizeMult == nil then spreadSizeMult = spreadPoints and 0.7 or 1.0 end + if coreRadiusMult == nil then + coreRadiusMult = spreadPoints and 0.60 or 1.0 + end + if spreadSizeMult == nil then + spreadSizeMult = spreadPoints and 0.7 or 1.0 + end local fireCoreDur = CONFIG.wreckFireFrames * dm local fireTailDur = CONFIG.wreckFireFadeTail * dm -- Smoke tail (after fire) stays the same fixed length regardless of durationMult. local smokeDur = fireCoreDur + (CONFIG.wreckSmokeFrames - CONFIG.wreckFireFrames) -- Fire profile: short intense phase, then short fade. - local fireDur = fireCoreDur + fireTailDur + local fireDur = fireCoreDur + fireTailDur local fadeStartFrac = spreadPoints and 0.20 or (fireCoreDur / fireDur) - if fadeStartFrac < 0.05 then fadeStartFrac = 0.05 end - if fadeStartFrac > 0.95 then fadeStartFrac = 0.95 end + if fadeStartFrac < 0.05 then + fadeStartFrac = 0.05 + end + if fadeStartFrac > 0.95 then + fadeStartFrac = 0.95 + end local fadeStart = now + fireDur * fadeStartFrac local fireDecayStart = fadeStart return addEmitter({ - unitID = nil, - mappedUnit = nil, - x = x, y = y, z = z, - yOffset = 0, - radius = mathMax(3.5, 10 * visualScale * coreRadiusMult), - scale = visualScale, - lifeScale = lifeScale, -- lifetime uses unit class, not scaleMult boost - intensity = 1.0, - lightIntensity = 1.0, - lightRadiusMult = 1.0, - scavenger = scavenger and true or nil, - fireRate = CONFIG.fireRate * 0.82 * sm, - smokeRate = CONFIG.smokeRate * 1.3 * sm, - emberRate = CONFIG.emberRate * 0.62 * sm, - spreadPoints = spreadPoints, - spreadSizeMult = spreadSizeMult, - fireEnd = now + fireDur, - emberEnd = now + fireDur, - smokeEnd = now + smokeDur, - fadeStart = fadeStart, - fadeEnd = now + fireDur, - fireDecayEnd = now + fireDur, - fireDecayPower = 1.0, + unitID = nil, + mappedUnit = nil, + x = x, + y = y, + z = z, + yOffset = 0, + radius = mathMax(3.5, 10 * visualScale * coreRadiusMult), + scale = visualScale, + lifeScale = lifeScale, -- lifetime uses unit class, not scaleMult boost + intensity = 1.0, + lightIntensity = 1.0, + lightRadiusMult = 1.0, + scavenger = scavenger and true or nil, + fireRate = CONFIG.fireRate * 0.82 * sm, + smokeRate = CONFIG.smokeRate * 1.3 * sm, + emberRate = CONFIG.emberRate * 0.62 * sm, + spreadPoints = spreadPoints, + spreadSizeMult = spreadSizeMult, + fireEnd = now + fireDur, + emberEnd = now + fireDur, + smokeEnd = now + smokeDur, + fadeStart = fadeStart, + fadeEnd = now + fireDur, + fireDecayEnd = now + fireDur, + fireDecayPower = 1.0, fireRateDecayPower = 1.0, fireAlphaDecayPower = 1.0, - fireMinSizeMult = 0.03, + fireMinSizeMult = 0.03, fireMinRadiusMult = 0.03, - fireMinLifeMult = 0.10, - fireAlphaMult = 0.55, - emberAlphaMult = 0.45, + fireMinLifeMult = 0.10, + fireAlphaMult = 0.55, + emberAlphaMult = 0.45, emberRateDecayPower = 1.0, emberAlphaDecayPower = 1.0, emberMinDecayMult = 0.0, -- Smoke fades over the same broad 80% window so it doesn't mask fire taper. - smokeDecayStart = now + smokeDur * 0.20, + smokeDecayStart = now + smokeDur * 0.20, smokeMinDecayMult = 0.03, -- Embers follow the same 80% fade window idea as flames. - emberDecayStart = fireDecayStart, + emberDecayStart = fireDecayStart, -- Fire decays linearly from the start so it dies out completely by fireEnd. - fireDecayStart = fireDecayStart, + fireDecayStart = fireDecayStart, }) end @@ -1416,8 +1460,12 @@ local TREE_FIRE_MAX_RADIUS = 80 local TREE_FIRE_RELATIVE_MAX_MULT = 3.5 local function spawnTreeFire(featureID, x, y, z, height, radius, canopyFrac, dirx, dirz, fallFrames, burnFrames) - if not x or not featureID then return end - if not isFinite(x) or not isFinite(y) or not isFinite(z) then return end + if not x or not featureID then + return + end + if not isFinite(x) or not isFinite(y) or not isFinite(z) then + return + end local baseHeight = height if not isFinite(baseHeight) or baseHeight <= 0 then baseHeight = TREE_FIRE_DEFAULT_HEIGHT @@ -1452,11 +1500,13 @@ local function spawnTreeFire(featureID, x, y, z, height, radius, canopyFrac, dir spSetFeatureAlwaysUpdateMatrix(featureID, true) end local now = cachedGameFrame - if not burnFrames or burnFrames < 1 then burnFrames = 210 end + if not burnFrames or burnFrames < 1 then + burnFrames = 210 + end local existing = treeFireEmitters[featureID] if existing then -- Re-ignite / keep burning: extend timers, keep geometry & fall progress. - existing.fireEnd = now + 1000000 + existing.fireEnd = now + 1000000 existing.emberEnd = now + 1000000 existing.smokeEnd = now + 1000000 existing.smokeDecayStart = nil @@ -1464,11 +1514,18 @@ local function spawnTreeFire(featureID, x, y, z, height, radius, canopyFrac, dir existing.fireSizeFadeEnd = now + burnFrames return existing end - dirx = dirx or 1; dirz = dirz or 0 + dirx = dirx or 1 + dirz = dirz or 0 local dl = mathSqrt(dirx * dirx + dirz * dirz) - if dl > 0.0001 then dirx, dirz = dirx / dl, dirz / dl else dirx, dirz = 1, 0 end + if dl > 0.0001 then + dirx, dirz = dirx / dl, dirz / dl + else + dirx, dirz = 1, 0 + end local tf = CONFIG.treeFire - if not canopyFrac or canopyFrac <= 0 then canopyFrac = tf.canopyFrac end + if not canopyFrac or canopyFrac <= 0 then + canopyFrac = tf.canopyFrac + end -- Use a simple tree-volume proxy (height * radius^2) so a tree that's only a -- small fraction of a large tree's volume does not inherit a near-large fire. local heightRatio = mathMax(0.22, mathMin(1.0, height / 60)) @@ -1478,11 +1535,11 @@ local function spawnTreeFire(featureID, x, y, z, height, radius, canopyFrac, dir local treeRadiusMult = tf.radiusMult * (1.0 - 0.18 * treeVisualNorm) -- scale drives particle base size and rise velocity; visual size follows the -- cube root of volume, which better matches how tree dimensions read on screen. - local scale = 0.16 + 0.84 * treeVisualNorm -- 0.16 (tiny) .. 1.0 (large) + local scale = 0.16 + 0.84 * treeVisualNorm -- 0.16 (tiny) .. 1.0 (large) -- fireSizeMult: individual flame billboard size tracks visual tree size. local fireSizeMult = tf.fireSizeMult * (0.52 + 1.38 * treeVisualNorm) -- Particle counts track estimated fuel volume more directly than visual size. - local fireRate = tf.fireRate * (0.04 + 2.16 * treeVolumeNorm) + local fireRate = tf.fireRate * (0.04 + 2.16 * treeVolumeNorm) local smokeRate = tf.smokeRate * (0.42 + 0.98 * treeVisualNorm) local emberRate = tf.emberRate * (0.03 + 1.37 * treeVolumeNorm) -- Hard low-end clamps: tiny trees should look categorically smaller and less @@ -1511,31 +1568,34 @@ local function spawnTreeFire(featureID, x, y, z, height, radius, canopyFrac, dir end local frames = (fallFrames and fallFrames > 1) and fallFrames or tf.growFrames local e = { - treeFire = true, - featureID = featureID, - x = x, y = y, z = z, - yOffset = 0, - height = height, - canopyR = radius * treeRadiusMult, - trunkR = mathMax(2, radius * tf.trunkRadiusFrac * treeRadiusMult), - canopyFrac = canopyFrac, - dirx = dirx, dirz = dirz, - startFrame = now, - fallFrames = frames, - growFrames = frames, - scale = scale, - lifeScale = scale, - intensity = 1.0, - radius = height, -- cull sphere radius around the base - fireRate = fireRate, - smokeRate = smokeRate, - emberRate = emberRate, - fireSizeMult = fireSizeMult, + treeFire = true, + featureID = featureID, + x = x, + y = y, + z = z, + yOffset = 0, + height = height, + canopyR = radius * treeRadiusMult, + trunkR = mathMax(2, radius * tf.trunkRadiusFrac * treeRadiusMult), + canopyFrac = canopyFrac, + dirx = dirx, + dirz = dirz, + startFrame = now, + fallFrames = frames, + growFrames = frames, + scale = scale, + lifeScale = scale, + intensity = 1.0, + radius = height, -- cull sphere radius around the base + fireRate = fireRate, + smokeRate = smokeRate, + emberRate = emberRate, + fireSizeMult = fireSizeMult, fireSizeFadeStart = now + burnFrames * 0.5, fireSizeFadeEnd = now + burnFrames, - fireEnd = now + 1000000, - emberEnd = now + 1000000, - smokeEnd = now + 1000000, + fireEnd = now + 1000000, + emberEnd = now + 1000000, + smokeEnd = now + 1000000, } treeFireEmitters[featureID] = e return addEmitter(e) @@ -1544,9 +1604,11 @@ end -- Begin a gradual fade of fire size and spawn rate (called when the felled tree starts sinking). local function fadeTreeFire(featureID) local e = treeFireEmitters[featureID] - if not e or e.fadeStart then return end - e.fadeStart = cachedGameFrame - e.fadeDuration = 150 -- ~5 seconds to fully taper off + if not e or e.fadeStart then + return + end + e.fadeStart = cachedGameFrame + e.fadeDuration = 150 -- ~5 seconds to fully taper off end -- Stop a tree fire: kill flames/embers immediately, let smoke fade out. @@ -1555,13 +1617,15 @@ local function stopTreeFire(featureID) spSetFeatureAlwaysUpdateMatrix(featureID, false) end local e = treeFireEmitters[featureID] - if not e then return end + if not e then + return + end local now = cachedGameFrame - e.fireEnd = now + e.fireEnd = now e.emberEnd = now e.smokeDecayStart = now e.smokeEnd = now + CONFIG.treeFire.smokeTail - treeFireEmitters[featureID] = nil -- detach so a later re-ignite makes a fresh one + treeFireEmitters[featureID] = nil -- detach so a later re-ignite makes a fresh one end -- For units with death animations: track the bridge emitter position while the @@ -1577,13 +1641,13 @@ local function updatePendingWreckFire(n) if bridge and not bridge.fadeStart and p.bridgeFadeStartFrame and n >= p.bridgeFadeStartFrame then local tail = p.fadeTail or CONFIG.wreckFireFadeTail bridge.fadeStart = n - bridge.fadeEnd = n + tail - bridge.fireEnd = n + tail - bridge.emberEnd = n + tail - bridge.smokeEnd = n + tail + 40 + bridge.fadeEnd = n + tail + bridge.fireEnd = n + tail + bridge.emberEnd = n + tail + bridge.smokeEnd = n + tail + 40 -- Nil unitID so updateEmitters stops refreshing fireEnd and overriding the fade window. - bridge.unitID = nil - bridge.mappedUnit = nil + bridge.unitID = nil + bridge.mappedUnit = nil bridge.keepAfterUnitGone = nil end @@ -1594,7 +1658,7 @@ local function updatePendingWreckFire(n) bridge.keepAfterUnitGone = true if not bridge.fadeStart then local tail = CONFIG.wreckBridgeFrames - bridge.fireEnd = mathMax(bridge.fireEnd, n + tail) + bridge.fireEnd = mathMax(bridge.fireEnd, n + tail) bridge.emberEnd = mathMax(bridge.emberEnd, n + tail) bridge.smokeEnd = mathMax(bridge.smokeEnd, n + tail + CONFIG.unitSmokeExtra) end @@ -1604,10 +1668,10 @@ local function updatePendingWreckFire(n) if bridge and not bridge.fadeStart then local tail = p.fadeTail or CONFIG.wreckFireFadeTail bridge.fadeStart = n - bridge.fadeEnd = n + tail - bridge.fireEnd = n + tail - bridge.emberEnd = n + tail - bridge.smokeEnd = n + tail + 40 + bridge.fadeEnd = n + tail + bridge.fireEnd = n + tail + bridge.emberEnd = n + tail + bridge.smokeEnd = n + tail + 40 end -- Clear unitID so updateEmitters stops trying to follow a gone unit. if bridge then @@ -1625,10 +1689,10 @@ local function updatePendingWreckFire(n) bridge.mappedUnit = nil bridge.keepAfterUnitGone = nil bridge.fadeStart = n - bridge.fadeEnd = n + tail - bridge.fireEnd = n + tail - bridge.emberEnd = n + tail - bridge.smokeEnd = n + tail + 40 + bridge.fadeEnd = n + tail + bridge.fireEnd = n + tail + bridge.emberEnd = n + tail + bridge.smokeEnd = n + tail + 40 end pendingWreckFire[unitID] = nil end @@ -1639,8 +1703,12 @@ end -- Draw -------------------------------------------------------------------------------- local function drawParticles() - if not particleVBO or particleVBO.usedElements == 0 then return end - if not particleShader then return end + if not particleVBO or particleVBO.usedElements == 0 then + return + end + if not particleShader then + return + end glDepthTest(true) glDepthMask(false) @@ -1671,16 +1739,20 @@ function gadget:Initialize() goodbye("OpenGL shaders not supported") return end - if not initGL4() then return end + if not initGL4() then + return + end GG.Fire = { -- SpawnFire(x, y, z, opts) -> handle. See spawnFire above for opts. - SpawnFire = function(x, y, z, opts) return spawnFire(x, y, z, opts) end, + SpawnFire = function(x, y, z, opts) + return spawnFire(x, y, z, opts) + end, -- StopFire(handle): immediately stop spawning new particles (existing -- ones fade out naturally). StopFire = function(handle) if type(handle) == "table" then - handle.fireEnd = cachedGameFrame + handle.fireEnd = cachedGameFrame handle.smokeEnd = cachedGameFrame handle.emberEnd = cachedGameFrame end @@ -1689,13 +1761,23 @@ function gadget:Initialize() -- follows the unit. Refreshes the timer if already burning. AddUnitFire = function(unitID, durationFrames) local udid = Spring.GetUnitDefID(unitID) - if udid then return addUnitFire(unitID, udid, durationFrames) end + if udid then + return addUnitFire(unitID, udid, durationFrames) + end end, -- SpawnWreck(x, y, z[, scale]): short fire + long smoke at a position. - SpawnWreck = function(x, y, z, scale) return spawnWreckageFire(x, y, z, scale) end, - GetParticleCount = function() return particleVBO and particleVBO.usedElements or 0 end, - GetMaxParticles = function() return MAX_PARTICLES end, - GetConfig = function() return CONFIG end, + SpawnWreck = function(x, y, z, scale) + return spawnWreckageFire(x, y, z, scale) + end, + GetParticleCount = function() + return particleVBO and particleVBO.usedElements or 0 + end, + GetMaxParticles = function() + return MAX_PARTICLES + end, + GetConfig = function() + return CONFIG + end, } end @@ -1706,22 +1788,25 @@ end -- A unit hit by a Flame weapon catches fire (effect follows the unit). function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID) - if not weaponDefID or not flameWeapons[weaponDefID] then return end - if damage and damage < 1 then return end + if not weaponDefID or not flameWeapons[weaponDefID] then + return + end + if damage and damage < 1 then + return + end local ux, uy, uz = spGetUnitPosition(unitID) - if not ux or uy < 0 then return end -- underwater: no fire + if not ux or uy < 0 then + return + end -- underwater: no fire addUnitFire(unitID, unitDefID) end -- A unit that leaves a wreckage spawns short fire + long smoke at its position. function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - -- Skip effects when the unit was reclaimed. Prefer the engine reclaim damage -- type, but keep fallbacks for older/scripted env-death paths. local nilAttackerEnvRemoval = attackerID == nil and weaponDefID and weaponDefID < 0 and weaponDefID ~= selfdWeaponDefID - local isReclaimed = weaponDefID == reclaimedWeaponDefID - or nilAttackerEnvRemoval - or (attackerID and attackerID ~= unitID and (not weaponDefID or weaponDefID < 0)) + local isReclaimed = weaponDefID == reclaimedWeaponDefID or nilAttackerEnvRemoval or (attackerID and attackerID ~= unitID and (not weaponDefID or weaponDefID < 0)) -- Skip effects for unfinished (still-being-built) units. local _, _, _, _, buildProgress = Spring.GetUnitHealth(unitID) local isUnfinished = buildProgress and buildProgress < 1.0 @@ -1732,7 +1817,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD e.unitID = nil unitFireEmitter[unitID] = nil e.mappedUnit = nil - e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) + e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) e.emberEnd = mathMin(e.emberEnd, cachedGameFrame) end return @@ -1742,14 +1827,14 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD if (not x) and e then x, y, z = e.x, e.y, e.z end - if x and y and y >= -4 then -- no wreck fire underwater - local p = unitFireParams[unitDefID] + if x and y and y >= -4 then -- no wreck fire underwater + local p = unitFireParams[unitDefID] local wreckScale = (p and p.wreckScale) or (p and p.scale) or 1.0 local wreckLifeScale = (p and p.wreckLifeScale) or wreckScale local wreckSpreadBias = (p and p.wreckSpreadBias) or 1.0 local scavenger = p and p.scavenger - local sm = 1.0 - local dm = 1.0 + local sm = 1.0 + local dm = 1.0 -- Smaller units burn for less time: scale duration by unit size, -- clamped so the tiniest units (armflea) get ~half duration. dm = dm * mathMax(0.5, mathMin(1.0, wreckScale)) @@ -1787,7 +1872,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD local fadeTail = mathFloor(CONFIG.wreckFireFadeTail * mathMax(0.5, mathMin(1.0, wreckScale))) local bridgeFollowDur = mathFloor(50 * mathMax(0.2, mathMin(0.8, wreckScale))) local bridgeFadeStart = cachedGameFrame + bridgeFollowDur - local bridgeMax = bridgeFadeStart + fadeTail + local bridgeMax = bridgeFadeStart + fadeTail pendingWreckFire[unitID] = { unitDefID = unitDefID, wreckScale = wreckScale, @@ -1795,29 +1880,31 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD scaleMult = sm, durationMult = dm, bridgeEmitter = e, - lastX = x, lastY = y, lastZ = z, - expireFrame = cachedGameFrame + CONFIG.wreckAwaitFrames, - fadeTail = fadeTail, - bridgeMaxFrame = bridgeMax, + lastX = x, + lastY = y, + lastZ = z, + expireFrame = cachedGameFrame + CONFIG.wreckAwaitFrames, + fadeTail = fadeTail, + bridgeMaxFrame = bridgeMax, bridgeFadeStartFrame = bridgeFadeStart, } local deathDuration = CONFIG.wreckBridgeFrames local function applyWreckFadeParams(em) - em.fireAlphaMult = 0.55 - em.emberAlphaMult = 0.45 - em.fireMinSizeMult = 0.03 - em.fireMinRadiusMult = 0.03 - em.fireMinLifeMult = 0.10 - em.fireDecayPower = 1.0 + em.fireAlphaMult = 0.55 + em.emberAlphaMult = 0.45 + em.fireMinSizeMult = 0.03 + em.fireMinRadiusMult = 0.03 + em.fireMinLifeMult = 0.10 + em.fireDecayPower = 1.0 em.fireRateDecayPower = 1.0 em.fireAlphaDecayPower = 1.0 em.emberRateDecayPower = 1.0 em.emberAlphaDecayPower = 1.0 - em.emberMinDecayMult = 0.0 - em.scavenger = scavenger and true or nil - em.spreadPoints = spreadPoints - em.spreadSizeMult = spreadSizeMult + em.emberMinDecayMult = 0.0 + em.scavenger = scavenger and true or nil + em.spreadPoints = spreadPoints + em.spreadSizeMult = spreadSizeMult if spreadPoints then em.radius = em.radius * coreRadiusMult else @@ -1855,7 +1942,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD e.unitID = nil unitFireEmitter[unitID] = nil e.mappedUnit = nil - e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) + e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) e.emberEnd = mathMin(e.emberEnd, cachedGameFrame) end else @@ -1864,7 +1951,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD e.unitID = nil unitFireEmitter[unitID] = nil e.mappedUnit = nil - e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) + e.fireEnd = mathMin(e.fireEnd, cachedGameFrame) e.emberEnd = mathMin(e.emberEnd, cachedGameFrame) end end @@ -1894,7 +1981,9 @@ local fpsUpdateInterval = 1 local lastFpsCheckFrame = 0 function gadget:GameFrame(n) - if not particleVBO then return end + if not particleVBO then + return + end cachedGameFrame = n @@ -1924,4 +2013,3 @@ end function gadget:DrawWorld() drawParticles() end - diff --git a/luarules/gadgets/gfx_fire_smoke_gl4.lua b/luarules/gadgets/gfx_fire_smoke_gl4.lua index b1575ec916a..ebbb597468b 100644 --- a/luarules/gadgets/gfx_fire_smoke_gl4.lua +++ b/luarules/gadgets/gfx_fire_smoke_gl4.lua @@ -9,7 +9,9 @@ -- - Public GG.FireSmoke API for other gadgets -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { @@ -28,10 +30,10 @@ local debugEcho = false -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spGetGroundHeight = Spring.GetGroundHeight -local spEcho = Spring.Echo -local spGetTimer = Spring.GetTimer -local spDiffTimers = Spring.DiffTimers +local spGetGroundHeight = Spring.GetGroundHeight +local spEcho = Spring.Echo +local spGetTimer = Spring.GetTimer +local spDiffTimers = Spring.DiffTimers local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle -- Subscription handle for the shared projectile dispatcher (set in Initialize). @@ -39,200 +41,200 @@ local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle local dispatchHandle = nil local spGetProjectilePosition = Spring.GetProjectilePosition local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spIsSphereInView = Spring.IsSphereInView -local spGetCameraPosition = Spring.GetCameraPosition -local spGetProjectileOwnerID = Spring.GetProjectileOwnerID -local spGetFPS = Spring.GetFPS -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitVelocity = Spring.GetUnitVelocity -local spValidUnitID = Spring.ValidUnitID -local spGetWind = Spring.GetWind -local spGetConfigInt = Spring.GetConfigInt -local spGetGameSpeed = Spring.GetGameSpeed +local spIsSphereInView = Spring.IsSphereInView +local spGetCameraPosition = Spring.GetCameraPosition +local spGetProjectileOwnerID = Spring.GetProjectileOwnerID +local spGetFPS = Spring.GetFPS +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitVelocity = Spring.GetUnitVelocity +local spValidUnitID = Spring.ValidUnitID +local spGetWind = Spring.GetWind +local spGetConfigInt = Spring.GetConfigInt +local spGetGameSpeed = Spring.GetGameSpeed local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ -local glBlending = gl.Blending -local glTexture = gl.Texture +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA local mathRandom = math.random -local mathMin = math.min -local mathMax = math.max -local mathFloor = math.floor -local mathCeil = math.ceil -local mathSqrt = math.sqrt -local mathPi = math.pi +local mathMin = math.min +local mathMax = math.max +local mathFloor = math.floor +local mathCeil = math.ceil +local mathSqrt = math.sqrt +local mathPi = math.pi local LuaShader = gl.LuaShader -local pushElementInstance = gl.InstanceVBOTable.pushElementInstance -local popElementInstance = gl.InstanceVBOTable.popElementInstance +local pushElementInstance = gl.InstanceVBOTable.pushElementInstance +local popElementInstance = gl.InstanceVBOTable.popElementInstance -------------------------------------------------------------------------------- -- Priority levels for particle budgeting -------------------------------------------------------------------------------- -local PRIORITY_ESSENTIAL = 1 -- always emit: crash trails, wreck fires (gameplay-relevant) -local PRIORITY_NORMAL = 2 -- standard: piece debris trails -local PRIORITY_COSMETIC = 3 -- reduced first: ambient fluff, extra detail +local PRIORITY_ESSENTIAL = 1 -- always emit: crash trails, wreck fires (gameplay-relevant) +local PRIORITY_NORMAL = 2 -- standard: piece debris trails +local PRIORITY_COSMETIC = 3 -- reduced first: ambient fluff, extra detail -------------------------------------------------------------------------------- -- Configuration -------------------------------------------------------------------------------- -- Textures -local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" +local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" local smokeTexture = "bitmaps/projectiletextures/smoke-beh-anim.tga" -- General (MAX_PARTICLES read from configint so the options widget can expose a slider) -local minFireSmokeParticles = 10000 -- before MaxParticles is added -local MAX_PARTICLES = ((spGetConfigInt("MaxParticles", 10000)-7000)*2) + minFireSmokeParticles -- NOTE: actual calc is in func updateMaxParticles +local minFireSmokeParticles = 10000 -- before MaxParticles is added +local MAX_PARTICLES = ((spGetConfigInt("MaxParticles", 10000) - 7000) * 2) + minFireSmokeParticles -- NOTE: actual calc is in func updateMaxParticles -local VBO_CAPACITY = MAX_PARTICLES -- fixed at init; VBO cannot be resized -local PARTICLE_SIZE_MIN = 1 -local PARTICLE_SIZE_MAX = 4 +local VBO_CAPACITY = MAX_PARTICLES -- fixed at init; VBO cannot be resized +local PARTICLE_SIZE_MIN = 1 +local PARTICLE_SIZE_MAX = 4 -- Priority-based budget: each priority level can fill the VBO up to this fraction -local BUDGET_ESSENTIAL = 1.0 -- essential emitters can use 100% of VBO -local BUDGET_NORMAL = 0.85 -- normal emitters can use up to 85% -local BUDGET_COSMETIC = 0.60 -- cosmetic emitters can use up to 60% +local BUDGET_ESSENTIAL = 1.0 -- essential emitters can use 100% of VBO +local BUDGET_NORMAL = 0.85 -- normal emitters can use up to 85% +local BUDGET_COSMETIC = 0.60 -- cosmetic emitters can use up to 60% -- Shared smoke physics (used by all emitter types) -local SMOKE_VEL_UP_MIN = 0.04 -- minimum upward velocity for smoke -local SMOKE_VEL_UP_MAX = 0.20 -- maximum upward velocity -local SMOKE_VEL_RANDOM = 0.1 -- random velocity offset per axis +local SMOKE_VEL_UP_MIN = 0.04 -- minimum upward velocity for smoke +local SMOKE_VEL_UP_MAX = 0.20 -- maximum upward velocity +local SMOKE_VEL_RANDOM = 0.1 -- random velocity offset per axis -- Smoke highlight: lighter particle layered above each smoke particle (simulates sunlit top) -local SMOKE_HIGHLIGHT_OFFSET_Y = 2.2 -- vertical offset above base smoke (elmos) -local SMOKE_HIGHLIGHT_BRIGHT = 2.8 -- brightness multiplier for highlight (via colorTint.rgb) -local SMOKE_HIGHLIGHT_SIZE = 0.85 -- size relative to base smoke particle -local SMOKE_HIGHLIGHT_LIFE = 0.7 -- lifetime relative to base smoke particle +local SMOKE_HIGHLIGHT_OFFSET_Y = 2.2 -- vertical offset above base smoke (elmos) +local SMOKE_HIGHLIGHT_BRIGHT = 2.8 -- brightness multiplier for highlight (via colorTint.rgb) +local SMOKE_HIGHLIGHT_SIZE = 0.85 -- size relative to base smoke particle +local SMOKE_HIGHLIGHT_LIFE = 0.7 -- lifetime relative to base smoke particle -- Wind influence (WIND_SMOKE_MULT=0.0012, WIND_FIRE_MULT=0.2 defined in shaderConfig) -- Frustum culling margin (elmos beyond visible sphere to still spawn) -local CULLING_MARGIN = 200 +local CULLING_MARGIN = 200 -- Fire particle settings (shared base, each trail type can scale) -local FIRE_LIFETIME_MIN = 20 -- min fire particle lifetime in frames -local FIRE_LIFETIME_RANGE = 100 -- fire lifetime variation -local FIRE_SIZE_MULT = 7.5 -- fire particles relative to smoke -local FIRE_ALPHA_MIN = 0.55 -- fire particles base alpha +local FIRE_LIFETIME_MIN = 20 -- min fire particle lifetime in frames +local FIRE_LIFETIME_RANGE = 100 -- fire lifetime variation +local FIRE_SIZE_MULT = 7.5 -- fire particles relative to smoke +local FIRE_ALPHA_MIN = 0.55 -- fire particles base alpha -- Piece projectile trails (smoke and fire on flying debris) -local PIECE_SPAWN_COUNT_MAX = 3 -local PIECE_SPAWN_TAPER = 2 -local PIECE_SKIP_CHANCE = 0.4 -local PIECE_VEL_SCALE = 6.0 -local PIECE_LIFETIME_MIN = 35 -local PIECE_LIFETIME_MAX = 85 -local PIECE_SIZE_SCALE_MIN = 0.18 -local PIECE_SIZE_SCALE_MAX = 0.5 -local PIECE_SIZE_SCALE_REF = 25.0 -local PIECE_LIFE_BASE = 200 -local PIECE_LIFE_PER_RADIUS = 1.5 -local PIECE_ALPHA_FADE = 0.66 -local PIECE_ALPHA_MIN = 0.25 +local PIECE_SPAWN_COUNT_MAX = 3 +local PIECE_SPAWN_TAPER = 2 +local PIECE_SKIP_CHANCE = 0.4 +local PIECE_VEL_SCALE = 6.0 +local PIECE_LIFETIME_MIN = 35 +local PIECE_LIFETIME_MAX = 85 +local PIECE_SIZE_SCALE_MIN = 0.18 +local PIECE_SIZE_SCALE_MAX = 0.5 +local PIECE_SIZE_SCALE_REF = 25.0 +local PIECE_LIFE_BASE = 200 +local PIECE_LIFE_PER_RADIUS = 1.5 +local PIECE_ALPHA_FADE = 0.66 +local PIECE_ALPHA_MIN = 0.25 local PIECE_GROUND_SKIP_HEIGHT = 5 -local PIECE_FIRE_CHANCE = 0.3 +local PIECE_FIRE_CHANCE = 0.3 -- Distance LOD: reduce spawn count when camera is far away (piece trails) -local LOD_DIST_NEAR = 4000 -local LOD_DIST_FAR = 10000 -local LOD_MIN_MULT = 0.33 -local LOD_DIST_RANGE_INV = 1.0 / (LOD_DIST_FAR - LOD_DIST_NEAR) -local LOD_MULT_RANGE = 1.0 - LOD_MIN_MULT -local LOD_DIST_NEAR_SQ = LOD_DIST_NEAR * LOD_DIST_NEAR +local LOD_DIST_NEAR = 4000 +local LOD_DIST_FAR = 10000 +local LOD_MIN_MULT = 0.33 +local LOD_DIST_RANGE_INV = 1.0 / (LOD_DIST_FAR - LOD_DIST_NEAR) +local LOD_MULT_RANGE = 1.0 - LOD_MIN_MULT +local LOD_DIST_NEAR_SQ = LOD_DIST_NEAR * LOD_DIST_NEAR -- Crashing aircraft trails -local CRASH_SPAWN_COUNT = 2 -local CRASH_VEL_INHERIT = 0.6 -local CRASH_ALPHA_FADE = 0.66 -local CRASH_ALPHA_MIN = 0.25 -local CRASH_SKIP_CHANCE = 0.05 +local CRASH_SPAWN_COUNT = 2 +local CRASH_VEL_INHERIT = 0.6 +local CRASH_ALPHA_FADE = 0.66 +local CRASH_ALPHA_MIN = 0.25 +local CRASH_SKIP_CHANCE = 0.05 local CRASH_FIRE_LIFETIME_MULT = 1.6 -local CRASH_FIRE_SIZE_MULT = 1 -local CRASH_CULLING_RADIUS = 200 -local CRASH_MAX_DURATION = 450 -local CRASH_LIFETIME_MIN = 120 -local CRASH_LIFETIME_RANGE = 90 +local CRASH_FIRE_SIZE_MULT = 1 +local CRASH_CULLING_RADIUS = 200 +local CRASH_MAX_DURATION = 450 +local CRASH_LIFETIME_MIN = 120 +local CRASH_LIFETIME_RANGE = 90 -- Unit-based crash trail scaling (+ fire chance/intensity thresholds) local crashScale = { - RADIUS_REF = 30, - COST_REF = 250, - RADIUS_WEIGHT = 0.4, - COST_WEIGHT = 0.7, - MIN = 0.77, - MAX = 1.3, - SIZE_EXP = 0.8, - LIFE_EXP = 0.5, - SPAWN_EXP = 0.6, - FIRE_CHANCE = 0.66, - FIRE_INT_MIN = 0.66, + RADIUS_REF = 30, + COST_REF = 250, + RADIUS_WEIGHT = 0.4, + COST_WEIGHT = 0.7, + MIN = 0.77, + MAX = 1.3, + SIZE_EXP = 0.8, + LIFE_EXP = 0.5, + SPAWN_EXP = 0.6, + FIRE_CHANCE = 0.66, + FIRE_INT_MIN = 0.66, } -- Distance LOD for crashing aircraft (stored in crashScale to reduce top-level local count) -crashScale.LOD_DIST_NEAR_SQ = 6000 * 6000 +crashScale.LOD_DIST_NEAR_SQ = 6000 * 6000 crashScale.LOD_DIST_RANGE_INV = 1.0 / (15000 - 6000) -crashScale.LOD_MIN_MULT = 0.45 -crashScale.LOD_MULT_RANGE = 1.0 - 0.45 +crashScale.LOD_MIN_MULT = 0.45 +crashScale.LOD_MULT_RANGE = 1.0 - 0.45 -- Point emitter defaults (for generic fire/smoke sources) -local POINT_SPAWN_INTERVAL = 2 -- frames between spawns -local POINT_SPAWN_COUNT = 2 -- particles per interval -local POINT_SMOKE_LIFE_MIN = 60 -- min smoke particle lifetime -local POINT_SMOKE_LIFE_RANGE = 60 -- lifetime variation -local POINT_POS_SPREAD = 2.0 -- random position offset (elmos) -local POINT_CULLING_RADIUS = 100 -- view frustum check radius +local POINT_SPAWN_INTERVAL = 2 -- frames between spawns +local POINT_SPAWN_COUNT = 2 -- particles per interval +local POINT_SMOKE_LIFE_MIN = 60 -- min smoke particle lifetime +local POINT_SMOKE_LIFE_RANGE = 60 -- lifetime variation +local POINT_POS_SPREAD = 2.0 -- random position offset (elmos) +local POINT_CULLING_RADIUS = 100 -- view frustum check radius -- Pre-computed constants (avoid repeated arithmetic in hot loops) -local SMOKE_VEL_UP_RANGE = SMOKE_VEL_UP_MAX - SMOKE_VEL_UP_MIN -local SMOKE_VEL_RANDOM_2 = SMOKE_VEL_RANDOM * 2 -local PIECE_VEL_COMBINED = PIECE_VEL_SCALE * 0.05 -local PARTICLE_SIZE_RANGE = PARTICLE_SIZE_MAX - PARTICLE_SIZE_MIN -local PIECE_ALPHA_RANGE = 1.0 - PIECE_ALPHA_MIN -local PIECE_LIFETIME_RANGE = PIECE_LIFETIME_MAX - PIECE_LIFETIME_MIN -local PARTICLE_SIZE_INV_RANGE = 1.0 / PARTICLE_SIZE_RANGE -local CRASH_ALPHA_RANGE = 1.0 - CRASH_ALPHA_MIN -local CRASH_CULLING_TOTAL = CRASH_CULLING_RADIUS + CULLING_MARGIN -local POINT_CULLING_TOTAL = POINT_CULLING_RADIUS + CULLING_MARGIN +local SMOKE_VEL_UP_RANGE = SMOKE_VEL_UP_MAX - SMOKE_VEL_UP_MIN +local SMOKE_VEL_RANDOM_2 = SMOKE_VEL_RANDOM * 2 +local PIECE_VEL_COMBINED = PIECE_VEL_SCALE * 0.05 +local PARTICLE_SIZE_RANGE = PARTICLE_SIZE_MAX - PARTICLE_SIZE_MIN +local PIECE_ALPHA_RANGE = 1.0 - PIECE_ALPHA_MIN +local PIECE_LIFETIME_RANGE = PIECE_LIFETIME_MAX - PIECE_LIFETIME_MIN +local PARTICLE_SIZE_INV_RANGE = 1.0 / PARTICLE_SIZE_RANGE +local CRASH_ALPHA_RANGE = 1.0 - CRASH_ALPHA_MIN +local CRASH_CULLING_TOTAL = CRASH_CULLING_RADIUS + CULLING_MARGIN +local POINT_CULLING_TOTAL = POINT_CULLING_RADIUS + CULLING_MARGIN -- Priority budget limits (computed from MAX_PARTICLES) local budgetLimits = { [PRIORITY_ESSENTIAL] = mathFloor(MAX_PARTICLES * BUDGET_ESSENTIAL), - [PRIORITY_NORMAL] = mathFloor(MAX_PARTICLES * BUDGET_NORMAL), - [PRIORITY_COSMETIC] = mathFloor(MAX_PARTICLES * BUDGET_COSMETIC), + [PRIORITY_NORMAL] = mathFloor(MAX_PARTICLES * BUDGET_NORMAL), + [PRIORITY_COSMETIC] = mathFloor(MAX_PARTICLES * BUDGET_COSMETIC), } -- Quality presets: auto-switch based on average particle count local QUALITY_PRESETS = { [1] = { - name = "Low", - spawnMult = 0.35, - pieceCountMult = 0.5, - lifetimeMult = 0.25, - maxPct = 1.0, + name = "Low", + spawnMult = 0.35, + pieceCountMult = 0.5, + lifetimeMult = 0.25, + maxPct = 1.0, }, [2] = { - name = "Medium", - spawnMult = 0.65, - pieceCountMult = 0.75, - lifetimeMult = 0.33, - maxPct = 0.75, + name = "Medium", + spawnMult = 0.65, + pieceCountMult = 0.75, + lifetimeMult = 0.33, + maxPct = 0.75, }, [3] = { - name = "High", - spawnMult = 1.0, - pieceCountMult = 1.0, - lifetimeMult = 0.4, - maxPct = 0.45, + name = "High", + spawnMult = 1.0, + pieceCountMult = 1.0, + lifetimeMult = 0.4, + maxPct = 0.45, }, } @@ -474,7 +476,7 @@ void main(void) -------------------------------------------------------------------------------- -- State -------------------------------------------------------------------------------- -local particleVBO = nil +local particleVBO = nil local particleShader = nil local nextParticleID = 0 @@ -495,9 +497,12 @@ local particleRemoveQueue = {} -------------------------------------------------------------------------------- -- Consolidated into one table to stay under Lua 5.1's 200-local-per-chunk cap. local pools = { - tracker = {}, trackerN = 0, - queue = {}, queueN = 0, - buffer = {}, bufferN = 0, + tracker = {}, + trackerN = 0, + queue = {}, + queueN = 0, + buffer = {}, + bufferN = 0, } function pools.acquireTracker() @@ -505,7 +510,7 @@ function pools.acquireTracker() if n > 0 then local t = pools.tracker[n] pools.tracker[n] = nil - pools.trackerN = n - 1 + pools.trackerN = n - 1 return t end return {} @@ -514,18 +519,18 @@ end function pools.releaseTracker(t) -- Clear every field we ever set; leftover entries would survive into the -- next user via `if tracked.x` checks and corrupt state. - t.gen = nil - t.excluded = nil - t.sizeScale = nil - t.birthFrame = nil - t.lifeFrames = nil - t.fireIntensity = nil - t.lifeBias = nil - t.offscreenSkip = nil + t.gen = nil + t.excluded = nil + t.sizeScale = nil + t.birthFrame = nil + t.lifeFrames = nil + t.fireIntensity = nil + t.lifeBias = nil + t.offscreenSkip = nil t.offscreenBuffer = nil - t.bufferLen = nil + t.bufferLen = nil local n = pools.trackerN + 1 - pools.trackerN = n + pools.trackerN = n pools.tracker[n] = t end @@ -534,7 +539,7 @@ function pools.acquireQueue() if n > 0 then local q = pools.queue[n] pools.queue[n] = nil - pools.queueN = n - 1 + pools.queueN = n - 1 return q end return {} @@ -542,9 +547,11 @@ end function pools.releaseQueue(q) -- Truncate without holding references to the popped particleIDs. - for i = 1, #q do q[i] = nil end + for i = 1, #q do + q[i] = nil + end local n = pools.queueN + 1 - pools.queueN = n + pools.queueN = n pools.queue[n] = q end @@ -553,25 +560,29 @@ function pools.acquireBuffer() if n > 0 then local b = pools.buffer[n] pools.buffer[n] = nil - pools.bufferN = n - 1 + pools.bufferN = n - 1 return b end return {} end function pools.releaseBuffer(b) - for i = 1, #b do b[i] = nil end + for i = 1, #b do + b[i] = nil + end local n = pools.bufferN + 1 - pools.bufferN = n + pools.bufferN = n pools.buffer[n] = b end -- Cache of unit death effect sizes -local unitDeathSizeCache = {} -- [unitDefID] = radius +local unitDeathSizeCache = {} -- [unitDefID] = radius -- Quality preset state local currentPreset = spGetConfigInt("GfxFireSmokeQuality", 3) -if not QUALITY_PRESETS[currentPreset] then currentPreset = 3 end +if not QUALITY_PRESETS[currentPreset] then + currentPreset = 3 +end local particleCountSamples = {} local sampleIndex = 0 local sampleCount = 0 @@ -608,7 +619,7 @@ local cachedCamX, cachedCamY, cachedCamZ = 0, 0, 0 local cachedPreset = QUALITY_PRESETS[currentPreset] local cachedBudgetNormal = budgetLimits[PRIORITY_NORMAL] local cachedBudgetEssential = budgetLimits[PRIORITY_ESSENTIAL] -local fastForward = false -- true when gamespeed > 1.5 or catching up (rejoining) +local fastForward = false -- true when gamespeed > 1.5 or catching up (rejoining) -------------------------------------------------------------------------------- -- Helper functions @@ -622,22 +633,28 @@ for i = 1, #QUALITY_PRESETS do presetThresholds[i] = QUALITY_PRESETS[i].maxPct * MAX_PARTICLES end -local maxSamples = mathCeil(15 / 4) -- AVG_WINDOW_FRAMES / AVG_SAMPLE_INTERVAL +local maxSamples = mathCeil(15 / 4) -- AVG_WINDOW_FRAMES / AVG_SAMPLE_INTERVAL local function updateQualityPreset(gameFrame) - if not particleVBO then return end + if not particleVBO then + return + end - if gameFrame % 4 == 0 then -- AVG_SAMPLE_INTERVAL + if gameFrame % 4 == 0 then -- AVG_SAMPLE_INTERVAL sampleIndex = (sampleIndex % maxSamples) + 1 local oldVal = particleCountSamples[sampleIndex] or 0 local newVal = particleVBO.usedElements particleCountSamples[sampleIndex] = newVal runningSum = runningSum - oldVal + newVal - if sampleCount < maxSamples then sampleCount = sampleCount + 1 end + if sampleCount < maxSamples then + sampleCount = sampleCount + 1 + end avgParticleCount = runningSum / sampleCount end - if gameFrame - lastPresetSwitchFrame < 15 then return end -- PRESET_SWITCH_COOLDOWN + if gameFrame - lastPresetSwitchFrame < 15 then + return + end -- PRESET_SWITCH_COOLDOWN local newPreset = 1 for i = #QUALITY_PRESETS, 1, -1 do @@ -654,16 +671,22 @@ local function updateQualityPreset(gameFrame) end local function updateMaxParticles(gameFrame) - if gameFrame % 90 ~= 0 then return end -- re-read configint every ~3 seconds - local newMax = ((spGetConfigInt("MaxParticles", 10000)-7000)*2) + minFireSmokeParticles + if gameFrame % 90 ~= 0 then + return + end -- re-read configint every ~3 seconds + local newMax = ((spGetConfigInt("MaxParticles", 10000) - 7000) * 2) + minFireSmokeParticles - if newMax == MAX_PARTICLES then return end + if newMax == MAX_PARTICLES then + return + end newMax = mathMin(newMax, VBO_CAPACITY) - if newMax < 1 then newMax = 1 end + if newMax < 1 then + newMax = 1 + end MAX_PARTICLES = newMax budgetLimits[PRIORITY_ESSENTIAL] = mathFloor(MAX_PARTICLES * BUDGET_ESSENTIAL) - budgetLimits[PRIORITY_NORMAL] = mathFloor(MAX_PARTICLES * BUDGET_NORMAL) - budgetLimits[PRIORITY_COSMETIC] = mathFloor(MAX_PARTICLES * BUDGET_COSMETIC) + budgetLimits[PRIORITY_NORMAL] = mathFloor(MAX_PARTICLES * BUDGET_NORMAL) + budgetLimits[PRIORITY_COSMETIC] = mathFloor(MAX_PARTICLES * BUDGET_COSMETIC) cachedBudgetNormal = budgetLimits[PRIORITY_NORMAL] cachedBudgetEssential = budgetLimits[PRIORITY_ESSENTIAL] for i = 1, #QUALITY_PRESETS do @@ -672,7 +695,9 @@ local function updateMaxParticles(gameFrame) end local function updateWind(gameFrame) - if gameFrame % 10 ~= 0 then return end -- WIND_UPDATE_INTERVAL + if gameFrame % 10 ~= 0 then + return + end -- WIND_UPDATE_INTERVAL local _, _, _, strength, wx, _, wz = spGetWind() windX = wx or 0 windZ = wz or 0 @@ -698,14 +723,18 @@ end -- Particle spawning -------------------------------------------------------------------------------- -local particleData = {0,0,0,0, 0,0,0,0, 0,0,0,0, 1,1,1,0} +local particleData = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 } local function spawnParticle(px, py, pz, vx, vy, vz, size, cmapVariant, lifetime, alphaMult, tintBrightness, birthFrame) - if particleVBO.usedElements >= currentBudgetLimit then return end + if particleVBO.usedElements >= currentBudgetLimit then + return + end local bf = birthFrame or cachedGameFrame local deathFrame = bf + mathCeil(lifetime) + 2 - if deathFrame <= cachedGameFrame then return end -- already expired (retroactive particle) + if deathFrame <= cachedGameFrame then + return + end -- already expired (retroactive particle) local seed = mathRandom() @@ -752,19 +781,19 @@ local shaderSourceCache = { fsSrc = fsSrc, shaderName = "FireSmokeGL4", uniformInt = { - fireTex = 0, + fireTex = 0, smokeTex = 1, }, uniformFloat = {}, shaderConfig = { - SMOKE_GROWTH_MULT = 1.05, -- growth over lifetime - SMOKE_GROWTH_RATE = 0.11, -- time-based growth per frame (elmos) - SMOKE_WOBBLE_START = 0.6, -- initial turbulence amplitude (elmos) - SMOKE_WOBBLE_RAMP = 0.4, -- wobble ramp over lifetime, scaled by particle size - SMOKE_WOBBLE_RATE = 0.1, -- time-based wobble growth per frame (elmos) - WIND_SMOKE_MULT = 0.0012, -- wind push on smoke (per frame * wind speed) - WIND_FIRE_MULT = 0.2, -- fire wind resistance (fraction of smoke) - HIGHLIGHT_BRIGHT = SMOKE_HIGHLIGHT_BRIGHT, -- highlight brightness multiplier + SMOKE_GROWTH_MULT = 1.05, -- growth over lifetime + SMOKE_GROWTH_RATE = 0.11, -- time-based growth per frame (elmos) + SMOKE_WOBBLE_START = 0.6, -- initial turbulence amplitude (elmos) + SMOKE_WOBBLE_RAMP = 0.4, -- wobble ramp over lifetime, scaled by particle size + SMOKE_WOBBLE_RATE = 0.1, -- time-based wobble growth per frame (elmos) + WIND_SMOKE_MULT = 0.0012, -- wind push on smoke (per frame * wind speed) + WIND_FIRE_MULT = 0.2, -- fire wind resistance (fraction of smoke) + HIGHLIGHT_BRIGHT = SMOKE_HIGHLIGHT_BRIGHT, -- highlight brightness multiplier }, forceupdate = true, } @@ -776,22 +805,16 @@ local function initGL4() return false end - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "fireSmokeQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "fireSmokeQuadVBO") local particleLayout = { - {id = 1, name = 'worldPos', size = 4}, - {id = 2, name = 'velocity', size = 4}, - {id = 3, name = 'sizeAndType', size = 4}, - {id = 4, name = 'colorTint', size = 4}, + { id = 1, name = "worldPos", size = 4 }, + { id = 2, name = "velocity", size = 4 }, + { id = 3, name = "sizeAndType", size = 4 }, + { id = 4, name = "colorTint", size = 4 }, } - particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable( - particleLayout, MAX_PARTICLES, "fireSmokeVBO" - ) + particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable(particleLayout, MAX_PARTICLES, "fireSmokeVBO") if not particleVBO then goodbye("Failed to create particle VBO") return false @@ -820,11 +843,15 @@ end -- Drawing -------------------------------------------------------------------------------- -- Pre-computed highlight pass uniform values -local HIGHLIGHT_LIFE_INV = 1.0 / SMOKE_HIGHLIGHT_LIFE -- = 1/0.7 ≈ 1.4286 +local HIGHLIGHT_LIFE_INV = 1.0 / SMOKE_HIGHLIGHT_LIFE -- = 1/0.7 ≈ 1.4286 local function DrawParticles() - if not particleVBO or particleVBO.usedElements == 0 then return end - if not particleShader then return end + if not particleVBO or particleVBO.usedElements == 0 then + return + end + if not particleShader then + return + end glDepthTest(true) glDepthMask(false) @@ -894,7 +921,7 @@ end -- Other gadgets create them via GG.FireSmoke.AddPointEmitter(). -- Used for: wreck fires, burning trees, burning buildings, etc. -------------------------------------------------------------------------------- -local pointEmitters = {} -- [emitterID] = emitter data +local pointEmitters = {} -- [emitterID] = emitter data local nextEmitterID = 0 local pointEmitterCount = 0 @@ -902,20 +929,26 @@ local function spawnPointEmitterParticles(emitter, gameFrame, preset) local age = gameFrame - emitter.birthFrame -- Check duration (0 = permanent until removed) - if emitter.duration > 0 and age > emitter.duration then return false end + if emitter.duration > 0 and age > emitter.duration then + return false + end emitter.spawnTimer = emitter.spawnTimer + 1 - if emitter.spawnTimer < emitter.spawnInterval then return true end + if emitter.spawnTimer < emitter.spawnInterval then + return true + end emitter.spawnTimer = 0 local px, py, pz = emitter.x, emitter.y, emitter.z -- View frustum culling - if not spIsSphereInView(px, py, pz, POINT_CULLING_TOTAL) then return true end + if not spIsSphereInView(px, py, pz, POINT_CULLING_TOTAL) then + return true + end -- Distance LOD local dx, dy, dz = px - cachedCamX, py - cachedCamY, pz - cachedCamZ - local distSq = dx*dx + dy*dy + dz*dz + local distSq = dx * dx + dy * dy + dz * dz local lodMult = 1.0 if distSq > LOD_DIST_NEAR_SQ then local t = (mathSqrt(distSq) - LOD_DIST_NEAR) * LOD_DIST_RANGE_INV @@ -924,7 +957,7 @@ local function spawnPointEmitterParticles(emitter, gameFrame, preset) -- Age-based decay: intensity reduces over lifetime local ageFrac = emitter.duration > 0 and (age / emitter.duration) or 0 - local decayMult = 1.0 - ageFrac * 0.5 -- 50% reduction at end of life + local decayMult = 1.0 - ageFrac * 0.5 -- 50% reduction at end of life local presetLifeMult = preset.lifetimeMult * lodMult local spawnCount = mathMax(1, mathFloor(emitter.spawnCount * preset.spawnMult * lodMult * decayMult + 0.5)) @@ -957,24 +990,16 @@ local function spawnPointEmitterParticles(emitter, gameFrame, preset) if fi > 0 and mathRandom() < fi * decayMult then local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * sc * FIRE_SIZE_MULT * emitter.fireSizeMult * fi - spawnParticle( - px + (mathRandom() * 2 - 1) * spread * 0.5, - py + mathRandom() * spread * 0.3, - pz + (mathRandom() * 2 - 1) * spread * 0.5, - (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM) * emitter.velocityScale, - (mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN) * emitter.velocityScale, - (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM) * emitter.velocityScale, - particleSize, 1, - (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * emitter.fireLifeMult * fi, - (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi) * decayMult - ) - end - - return true -- emitter still alive + spawnParticle(px + (mathRandom() * 2 - 1) * spread * 0.5, py + mathRandom() * spread * 0.3, pz + (mathRandom() * 2 - 1) * spread * 0.5, (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM) * emitter.velocityScale, (mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN) * emitter.velocityScale, (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM) * emitter.velocityScale, particleSize, 1, (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * emitter.fireLifeMult * fi, (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi) * decayMult) + end + + return true -- emitter still alive end local function updatePointEmitters(gameFrame) - if pointEmitterCount == 0 then return end + if pointEmitterCount == 0 then + return + end for emitterID, emitter in pairs(pointEmitters) do local alive = spawnPointEmitterParticles(emitter, gameFrame, cachedPreset) @@ -994,8 +1019,8 @@ local excludedDeathUnits = {} local pieceGeneration = 0 -- Buffer stride: each entry is 7 values (frame, px, py, pz, vx, vy, vz) -local PIECE_BUFFER_MAX = 350 -- 50 entries * 7 stride -local CRASH_BUFFER_MAX = 1050 -- 150 entries * 7 stride +local PIECE_BUFFER_MAX = 350 -- 50 entries * 7 stride +local CRASH_BUFFER_MAX = 1050 -- 150 entries * 7 stride -- Count of entities with active off-screen buffers (skip DrawWorld flush when 0) local offscreenBufferCount = 0 @@ -1024,15 +1049,17 @@ local function replayPieceBuffer(tracked, gameFrame) local startIdx = bufLen - 6 while startIdx > 1 do local prevStart = startIdx - 7 - if gameFrame - buf[prevStart] > maxReplayAge then break end + if gameFrame - buf[prevStart] > maxReplayAge then + break + end startIdx = prevStart end local replayedCount = 0 for i = startIdx, bufLen, 7 do local frame = buf[i] - local bpx, bpy, bpz = buf[i+1], buf[i+2], buf[i+3] - local bvx, bvy, bvz = buf[i+4], buf[i+5], buf[i+6] + local bpx, bpy, bpz = buf[i + 1], buf[i + 2], buf[i + 3] + local bvx, bvy, bvz = buf[i + 4], buf[i + 5], buf[i + 6] local pieceAge = frame - tracked.birthFrame local ageFrac = pieceAge / tracked.lifeFrames @@ -1049,14 +1076,18 @@ local function replayPieceBuffer(tracked, gameFrame) local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * smokeSizeSc spawnParticle( - bpx + mathRandom() - 0.5, bpy + mathRandom(), bpz + mathRandom() - 0.5, + bpx + mathRandom() - 0.5, + bpy + mathRandom(), + bpz + mathRandom() - 0.5, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 0, + particleSize, + 0, (PIECE_LIFETIME_MIN + (tracked.lifeBias + mathRandom() * 0.3) * PIECE_LIFETIME_RANGE) * (1.0 + sizeRand * PARTICLE_SIZE_INV_RANGE) * smokeLifeBase, (PIECE_ALPHA_MIN + mathRandom() * PIECE_ALPHA_RANGE) * smokeAlphaBase, - nil, frame -- birthFrame override + nil, + frame -- birthFrame override ) replayedCount = replayedCount + 1 end @@ -1066,14 +1097,18 @@ local function replayPieceBuffer(tracked, gameFrame) local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * sc * FIRE_SIZE_MULT * fi spawnParticle( - bpx + mathRandom() * 0.6 - 0.3, bpy + mathRandom() * 0.5, bpz + mathRandom() * 0.6 - 0.3, + bpx + mathRandom() * 0.6 - 0.3, + bpy + mathRandom() * 0.5, + bpz + mathRandom() * 0.6 - 0.3, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 1, + particleSize, + 1, (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * fi, (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi), - nil, frame -- birthFrame override + nil, + frame -- birthFrame override ) replayedCount = replayedCount + 1 end @@ -1090,22 +1125,31 @@ local debugPiece = { spawn = 0, call = 0, skipGround = 0, skipOffscreen = 0, ski local function spawnPieceTrailParticles(tracked, proID, gameFrame) local pieceAge = gameFrame - tracked.birthFrame - if pieceAge > tracked.lifeFrames then debugPiece.skipExpired = debugPiece.skipExpired + 1 return end + if pieceAge > tracked.lifeFrames then + debugPiece.skipExpired = debugPiece.skipExpired + 1 + return + end local px, py, pz = spGetProjectilePosition(proID) - if not px then debugPiece.skipNoPos = debugPiece.skipNoPos + 1 return end + if not px then + debugPiece.skipNoPos = debugPiece.skipNoPos + 1 + return + end local aboveGround = py > PIECE_GROUND_SKIP_HEIGHT if not aboveGround then local groundY = spGetGroundHeight(px, pz) or 0 aboveGround = py > groundY + 1 end - if not aboveGround then debugPiece.skipGround = debugPiece.skipGround + 1 return end + if not aboveGround then + debugPiece.skipGround = debugPiece.skipGround + 1 + return + end local inView = spIsSphereInView(px, py, pz, PIECE_CULLING_RADIUS) if not inView then debugPiece.skipOffscreen = debugPiece.skipOffscreen + 1 - tracked.offscreenSkip = 2 -- skip next 2 frames without re-querying position + tracked.offscreenSkip = 2 -- skip next 2 frames without re-querying position -- Buffer position/velocity every 3rd frame for retroactive spawning if not fastForward and gameFrame % 3 == 0 then local pvx, pvy, pvz = spGetProjectileVelocity(proID) @@ -1118,13 +1162,13 @@ local function spawnPieceTrailParticles(tracked, proID, gameFrame) n = 0 end if n < PIECE_BUFFER_MAX then - buf[n+1] = gameFrame - buf[n+2] = px - buf[n+3] = py - buf[n+4] = pz - buf[n+5] = pvx or 0 - buf[n+6] = pvy or 0 - buf[n+7] = pvz or 0 + buf[n + 1] = gameFrame + buf[n + 2] = px + buf[n + 3] = py + buf[n + 4] = pz + buf[n + 5] = pvx or 0 + buf[n + 6] = pvy or 0 + buf[n + 7] = pvz or 0 tracked.bufferLen = n + 7 end end @@ -1140,7 +1184,7 @@ local function spawnPieceTrailParticles(tracked, proID, gameFrame) debugPiece.call = debugPiece.call + 1 local dx, dy, dz = px - cachedCamX, py - cachedCamY, pz - cachedCamZ - local distSq = dx*dx + dy*dy + dz*dz + local distSq = dx * dx + dy * dy + dz * dz local lodMult = 1.0 if distSq > LOD_DIST_NEAR_SQ then local t = (mathSqrt(distSq) - LOD_DIST_NEAR) * LOD_DIST_RANGE_INV @@ -1188,15 +1232,7 @@ local function spawnPieceTrailParticles(tracked, proID, gameFrame) if fi > 0 then local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * sc * FIRE_SIZE_MULT * fi - spawnParticle( - px + mathRandom() * 0.6 - 0.3, py + mathRandom() * 0.5, pz + mathRandom() * 0.6 - 0.3, - vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, - vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 1, - (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * fi, - (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi) - ) + spawnParticle(px + mathRandom() * 0.6 - 0.3, py + mathRandom() * 0.5, pz + mathRandom() * 0.6 - 0.3, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), particleSize, 1, (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * fi, (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi)) debugPiece.spawn = debugPiece.spawn + 1 end end @@ -1213,7 +1249,9 @@ local function updatePieceProjectiles(gameFrame) projectiles = spGetProjectilesInRectangle(0, 0, mapSizeX, mapSizeZ, true, false) numProjectiles = projectiles and #projectiles or 0 end - if not projectiles then return end + if not projectiles then + return + end local _, ownerRadius = next(pendingDeathUnitRadii) @@ -1226,7 +1264,7 @@ local function updatePieceProjectiles(gameFrame) local ownerID = spGetProjectileOwnerID(proID) if ownerID and excludedDeathUnits[ownerID] then local t = pools.acquireTracker() - t.gen = gen + t.gen = gen t.excluded = true trackedPieceProjectiles[proID] = t else @@ -1237,12 +1275,12 @@ local function updatePieceProjectiles(gameFrame) local fi = mathRandom() < PIECE_FIRE_CHANCE and (0.3 + mathRandom() * 0.7) or 0 local lifeScale = fi > 0 and (1.0 + 0.3 * fi) or 0.7 local t = pools.acquireTracker() - t.sizeScale = sizeScale - t.birthFrame = gameFrame - t.lifeFrames = mathFloor((PIECE_LIFE_BASE + pieceRadius * PIECE_LIFE_PER_RADIUS) * lifeScale) - t.gen = gen + t.sizeScale = sizeScale + t.birthFrame = gameFrame + t.lifeFrames = mathFloor((PIECE_LIFE_BASE + pieceRadius * PIECE_LIFE_PER_RADIUS) * lifeScale) + t.gen = gen t.fireIntensity = fi - t.lifeBias = mathRandom() * 0.7 + t.lifeBias = mathRandom() * 0.7 trackedPieceProjectiles[proID] = t end end @@ -1306,7 +1344,9 @@ end local function replayCrashBuffer(tracked, gameFrame) local buf = tracked.offscreenBuffer local bufLen = tracked.bufferLen - if not buf or bufLen == 0 then return end + if not buf or bufLen == 0 then + return + end local preset = cachedPreset local sc = tracked.sizeScale @@ -1322,8 +1362,8 @@ local function replayCrashBuffer(tracked, gameFrame) local replayedCount = 0 for i = 1, bufLen, 7 do local frame = buf[i] - local bpx, bpy, bpz = buf[i+1], buf[i+2], buf[i+3] - local bvx, bvy, bvz = buf[i+4], buf[i+5], buf[i+6] + local bpx, bpy, bpz = buf[i + 1], buf[i + 2], buf[i + 3] + local bvx, bvy, bvz = buf[i + 4], buf[i + 5], buf[i + 6] local crashAge = frame - tracked.birthFrame local ageFrac = crashAge / CRASH_MAX_DURATION @@ -1338,14 +1378,18 @@ local function replayCrashBuffer(tracked, gameFrame) local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * smokeSizeSc spawnParticle( - bpx + mathRandom() * 4 - 2, bpy + mathRandom() * 2, bpz + mathRandom() * 4 - 2, + bpx + mathRandom() * 4 - 2, + bpy + mathRandom() * 2, + bpz + mathRandom() * 4 - 2, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 0, + particleSize, + 0, (CRASH_LIFETIME_MIN + mathRandom() * CRASH_LIFETIME_RANGE) * (1.0 + sizeRand * PARTICLE_SIZE_INV_RANGE) * smokeLifeBase, (CRASH_ALPHA_MIN + mathRandom() * CRASH_ALPHA_RANGE) * smokeAlphaBase, - nil, frame -- birthFrame override + nil, + frame -- birthFrame override ) replayedCount = replayedCount + 1 end @@ -1354,14 +1398,18 @@ local function replayCrashBuffer(tracked, gameFrame) local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * sc * FIRE_SIZE_MULT * CRASH_FIRE_SIZE_MULT * fi spawnParticle( - bpx + mathRandom() * 2 - 1, bpy + mathRandom(), bpz + mathRandom() * 2 - 1, + bpx + mathRandom() * 2 - 1, + bpy + mathRandom(), + bpz + mathRandom() * 2 - 1, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 1, + particleSize, + 1, (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * CRASH_FIRE_LIFETIME_MULT * fi * unitLifeMult, (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi), - nil, frame -- birthFrame override + nil, + frame -- birthFrame override ) replayedCount = replayedCount + 1 end @@ -1374,10 +1422,14 @@ end local function spawnCrashTrailParticles(tracked, unitID, gameFrame) local crashAge = gameFrame - tracked.birthFrame - if crashAge > CRASH_MAX_DURATION then return end + if crashAge > CRASH_MAX_DURATION then + return + end local px, py, pz = spGetUnitPosition(unitID) - if not px then return end + if not px then + return + end local inView = spIsSphereInView(px, py, pz, CRASH_CULLING_TOTAL) if not inView then @@ -1393,13 +1445,13 @@ local function spawnCrashTrailParticles(tracked, unitID, gameFrame) n = 0 end if n < CRASH_BUFFER_MAX then - buf[n+1] = gameFrame - buf[n+2] = px - buf[n+3] = py - buf[n+4] = pz - buf[n+5] = uvx or 0 - buf[n+6] = uvy or 0 - buf[n+7] = uvz or 0 + buf[n + 1] = gameFrame + buf[n + 2] = px + buf[n + 3] = py + buf[n + 4] = pz + buf[n + 5] = uvx or 0 + buf[n + 6] = uvy or 0 + buf[n + 7] = uvz or 0 tracked.bufferLen = n + 7 end end @@ -1412,7 +1464,7 @@ local function spawnCrashTrailParticles(tracked, unitID, gameFrame) end local dx, dy, dz = px - cachedCamX, py - cachedCamY, pz - cachedCamZ - local distSq = dx*dx + dy*dy + dz*dz + local distSq = dx * dx + dy * dy + dz * dz local lodMult = 1.0 if distSq > crashScale.LOD_DIST_NEAR_SQ then local t = (mathSqrt(distSq) - 6000) * crashScale.LOD_DIST_RANGE_INV @@ -1462,28 +1514,26 @@ local function spawnCrashTrailParticles(tracked, unitID, gameFrame) if fi > 0 then local sizeRand = mathRandom() * PARTICLE_SIZE_RANGE local particleSize = (PARTICLE_SIZE_MIN + sizeRand) * sc * FIRE_SIZE_MULT * CRASH_FIRE_SIZE_MULT * fi - spawnParticle( - px + mathRandom() * 2 - 1, py + mathRandom(), pz + mathRandom() * 2 - 1, - vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, - vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), - particleSize, 1, - (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * CRASH_FIRE_LIFETIME_MULT * fi * unitLifeMult, - (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi) - ) + spawnParticle(px + mathRandom() * 2 - 1, py + mathRandom(), pz + mathRandom() * 2 - 1, vxs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), vys + mathRandom() * SMOKE_VEL_UP_RANGE + SMOKE_VEL_UP_MIN, vzs + (mathRandom() * SMOKE_VEL_RANDOM_2 - SMOKE_VEL_RANDOM), particleSize, 1, (FIRE_LIFETIME_MIN + mathRandom() * FIRE_LIFETIME_RANGE) * presetLifeMult * CRASH_FIRE_LIFETIME_MULT * fi * unitLifeMult, (FIRE_ALPHA_MIN + mathRandom() * 0.2) * (0.5 + 0.5 * fi)) end end local function updateCrashingAircraft(gameFrame) - if crashingAircraftCount == 0 then return end + if crashingAircraftCount == 0 then + return + end for unitID, tracked in pairs(trackedCrashingAircraft) do if not spValidUnitID(unitID) then - if tracked.offscreenBuffer then offscreenBufferCount = offscreenBufferCount - 1 end + if tracked.offscreenBuffer then + offscreenBufferCount = offscreenBufferCount - 1 + end trackedCrashingAircraft[unitID] = nil crashingAircraftCount = crashingAircraftCount - 1 elseif gameFrame - tracked.birthFrame > CRASH_MAX_DURATION then - if tracked.offscreenBuffer then offscreenBufferCount = offscreenBufferCount - 1 end + if tracked.offscreenBuffer then + offscreenBufferCount = offscreenBufferCount - 1 + end trackedCrashingAircraft[unitID] = nil crashingAircraftCount = crashingAircraftCount - 1 else @@ -1498,8 +1548,12 @@ end -------------------------------------------------------------------------------- local function apiCrashingAircraft(unitID, unitDefID, teamID) - if not particleVBO then return end - if trackedCrashingAircraft[unitID] then return end + if not particleVBO then + return + end + if trackedCrashingAircraft[unitID] then + return + end local data = aircraftDataCache[unitDefID] local unitScale = data and data.unitScale or 1.0 @@ -1540,31 +1594,35 @@ end -- posSpread - random position offset radius in elmos (default: POINT_POS_SPREAD) -- velocityScale - multiplier on particle velocity (default: 1.0) local function apiAddPointEmitter(params) - if not particleVBO then return nil end - if not params or not params.x then return nil end + if not particleVBO then + return nil + end + if not params or not params.x then + return nil + end nextEmitterID = nextEmitterID + 1 local id = nextEmitterID pointEmitters[id] = { - x = params.x, - y = params.y or (spGetGroundHeight(params.x, params.z or 0) or 0), - z = params.z or 0, - birthFrame = cachedGameFrame, - duration = params.duration or 300, - sizeScale = params.sizeScale or 1.0, + x = params.x, + y = params.y or (spGetGroundHeight(params.x, params.z or 0) or 0), + z = params.z or 0, + birthFrame = cachedGameFrame, + duration = params.duration or 300, + sizeScale = params.sizeScale or 1.0, fireIntensity = params.fireIntensity or 0, - spawnCount = params.spawnCount or POINT_SPAWN_COUNT, + spawnCount = params.spawnCount or POINT_SPAWN_COUNT, spawnInterval = params.spawnInterval or POINT_SPAWN_INTERVAL, - priority = params.priority or PRIORITY_NORMAL, + priority = params.priority or PRIORITY_NORMAL, smokeSizeMult = params.smokeSizeMult or 1.0, smokeLifeMult = params.smokeLifeMult or 1.0, - smokeAlpha = params.smokeAlpha or 1.0, - fireSizeMult = params.fireSizeMult or 1.0, - fireLifeMult = params.fireLifeMult or 1.0, - posSpread = params.posSpread or POINT_POS_SPREAD, + smokeAlpha = params.smokeAlpha or 1.0, + fireSizeMult = params.fireSizeMult or 1.0, + fireLifeMult = params.fireLifeMult or 1.0, + posSpread = params.posSpread or POINT_POS_SPREAD, velocityScale = params.velocityScale or 1.0, - spawnTimer = 0, + spawnTimer = 0, } pointEmitterCount = pointEmitterCount + 1 @@ -1584,7 +1642,9 @@ end -- Update emitter position (for moving sources) local function apiUpdateEmitterPos(emitterID, x, y, z) local emitter = pointEmitters[emitterID] - if not emitter then return false end + if not emitter then + return false + end emitter.x = x emitter.y = y emitter.z = z @@ -1594,7 +1654,9 @@ end -- Spawn a single particle directly (one-shot, no emitter tracking) -- priority: PRIORITY_ESSENTIAL/NORMAL/COSMETIC (default: NORMAL) local function apiSpawnParticle(px, py, pz, vx, vy, vz, size, isFireType, lifetime, alpha, priority) - if not particleVBO then return end + if not particleVBO then + return + end currentBudgetLimit = budgetLimits[priority or PRIORITY_NORMAL] spawnParticle(px, py, pz, vx or 0, vy or 0, vz or 0, size or 2, isFireType and 1 or 0, lifetime or 60, alpha or 1.0) end @@ -1639,25 +1701,25 @@ function gadget:Initialize() -- Expose public API for other gadgets GG.FireSmoke = { -- Emitter management - AddPointEmitter = apiAddPointEmitter, - RemoveEmitter = apiRemoveEmitter, - UpdateEmitterPos = apiUpdateEmitterPos, + AddPointEmitter = apiAddPointEmitter, + RemoveEmitter = apiRemoveEmitter, + UpdateEmitterPos = apiUpdateEmitterPos, -- Direct particle spawn - SpawnParticle = apiSpawnParticle, + SpawnParticle = apiSpawnParticle, -- Crashing aircraft integration (called from unit_crashing_aircraft.lua) - CrashingAircraft = apiCrashingAircraft, + CrashingAircraft = apiCrashingAircraft, -- Query - GetParticleCount = apiGetParticleCount, - GetMaxParticles = apiGetMaxParticles, - GetWindState = apiGetWindState, + GetParticleCount = apiGetParticleCount, + GetMaxParticles = apiGetMaxParticles, + GetWindState = apiGetWindState, -- Priority constants (for callers to reference) PRIORITY_ESSENTIAL = PRIORITY_ESSENTIAL, - PRIORITY_NORMAL = PRIORITY_NORMAL, - PRIORITY_COSMETIC = PRIORITY_COSMETIC, + PRIORITY_NORMAL = PRIORITY_NORMAL, + PRIORITY_COSMETIC = PRIORITY_COSMETIC, } end @@ -1667,11 +1729,15 @@ function gadget:Shutdown() end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - if not particleVBO then return end + if not particleVBO then + return + end -- Stop tracking crashing aircraft on death if trackedCrashingAircraft[unitID] then - if trackedCrashingAircraft[unitID].offscreenBuffer then offscreenBufferCount = offscreenBufferCount - 1 end + if trackedCrashingAircraft[unitID].offscreenBuffer then + offscreenBufferCount = offscreenBufferCount - 1 + end trackedCrashingAircraft[unitID] = nil crashingAircraftCount = crashingAircraftCount - 1 end @@ -1685,9 +1751,11 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) end function gadget:GameFrame(n) - if not particleVBO then return end + if not particleVBO then + return + end - local t0, t1, tStart -- debug timer locals (only used when debugEcho is true) + local t0, t1, tStart -- debug timer locals (only used when debugEcho is true) if debugEcho then tStart = spGetTimer() t0 = tStart @@ -1702,8 +1770,12 @@ function gadget:GameFrame(n) -- Periodic housekeeping (staggered across frames) local nMod = n % 90 - if nMod == 0 then updateMaxParticles(n) end - if n % 10 == 0 then updateWind(n) end + if nMod == 0 then + updateMaxParticles(n) + end + if n % 10 == 0 then + updateWind(n) + end if debugEcho then t1 = spGetTimer() @@ -1757,13 +1829,10 @@ function gadget:GameFrame(n) if debugEcho then if n % 30 == 0 then local trackedCount = 0 - for _ in pairs(trackedPieceProjectiles) do trackedCount = trackedCount + 1 end - spEcho(string.format( - "[PieceTrails-OLD] spawned=%d calls=%d tracked=%d skipGround=%d skipOffscreen=%d skipExpired=%d skipNoPos=%d preset=%s interval=%d", - debugPiece.spawn, debugPiece.call, trackedCount, - debugPiece.skipGround, debugPiece.skipOffscreen, debugPiece.skipExpired, debugPiece.skipNoPos, - cachedPreset.name, updateInterval - )) + for _ in pairs(trackedPieceProjectiles) do + trackedCount = trackedCount + 1 + end + spEcho(string.format("[PieceTrails-OLD] spawned=%d calls=%d tracked=%d skipGround=%d skipOffscreen=%d skipExpired=%d skipNoPos=%d preset=%s interval=%d", debugPiece.spawn, debugPiece.call, trackedCount, debugPiece.skipGround, debugPiece.skipOffscreen, debugPiece.skipExpired, debugPiece.skipNoPos, cachedPreset.name, updateInterval)) debugPiece.spawn = 0 debugPiece.call = 0 debugPiece.skipGround = 0 @@ -1817,29 +1886,16 @@ function gadget:GameFrame(n) debugTimingSamples = debugTimingSamples + 1 if n % 30 == 0 and debugTimingSamples > 0 then - local inv = 1000 / debugTimingSamples -- convert to microseconds per frame + local inv = 1000 / debugTimingSamples -- convert to microseconds per frame local trackedPieceCount = 0 - for _ in pairs(trackedPieceProjectiles) do trackedPieceCount = trackedPieceCount + 1 end - spEcho(string.format( - "Fire Smoke GL4 timing (us/frame avg over %d frames): TOTAL=%.1f housekeep=%.1f quality=%.1f removeExp=%.1f pieces=%.1f crash=%.1f pointEm=%.1f cleanup=%.1f | particles=%d pieces=%d crashes=%d emitters=%d preset=%s wind=%d", - debugTimingSamples, - debugTimings.totalFrame * inv, - debugTimings.housekeeping * inv, - debugTimings.qualityPreset * inv, - debugTimings.removeExpired * inv, - debugTimings.pieceProjectiles * inv, - debugTimings.crashingAircraft * inv, - debugTimings.pointEmitters * inv, - debugTimings.cleanup * inv, - mathFloor(avgParticleCount), - trackedPieceCount, - crashingAircraftCount, - pointEmitterCount, - cachedPreset.name, - mathFloor(windStrength) - )) + for _ in pairs(trackedPieceProjectiles) do + trackedPieceCount = trackedPieceCount + 1 + end + spEcho(string.format("Fire Smoke GL4 timing (us/frame avg over %d frames): TOTAL=%.1f housekeep=%.1f quality=%.1f removeExp=%.1f pieces=%.1f crash=%.1f pointEm=%.1f cleanup=%.1f | particles=%d pieces=%d crashes=%d emitters=%d preset=%s wind=%d", debugTimingSamples, debugTimings.totalFrame * inv, debugTimings.housekeeping * inv, debugTimings.qualityPreset * inv, debugTimings.removeExpired * inv, debugTimings.pieceProjectiles * inv, debugTimings.crashingAircraft * inv, debugTimings.pointEmitters * inv, debugTimings.cleanup * inv, mathFloor(avgParticleCount), trackedPieceCount, crashingAircraftCount, pointEmitterCount, cachedPreset.name, mathFloor(windStrength))) -- Reset accumulators - for k in pairs(debugTimings) do debugTimings[k] = 0 end + for k in pairs(debugTimings) do + debugTimings[k] = 0 + end debugTimingSamples = 0 end end diff --git a/luarules/gadgets/gfx_flamethrower_gl4.lua b/luarules/gadgets/gfx_flamethrower_gl4.lua index 2e4bbad2cf8..3fbed0f1b16 100644 --- a/luarules/gadgets/gfx_flamethrower_gl4.lua +++ b/luarules/gadgets/gfx_flamethrower_gl4.lua @@ -22,16 +22,18 @@ -- and saved originals as customparams.flame_orig_*. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { - name = "Flamethrower GL4", - desc = "GL4 instanced replacement effect for Flame weapontype projectiles", - author = "Floris", - date = "May 2026", + name = "Flamethrower GL4", + desc = "GL4 instanced replacement effect for Flame weapontype projectiles", + author = "Floris", + date = "May 2026", license = "GNU GPL v2", - layer = 0, + layer = 0, enabled = true, } end @@ -39,55 +41,55 @@ end -------------------------------------------------------------------------------- -- Localized engine functions -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetVisibleProjectiles = Spring.GetVisibleProjectiles -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetProjectileOwnerID = Spring.GetProjectileOwnerID -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spIsPosInLos = Spring.IsPosInLos -local spIsSphereInView = Spring.IsSphereInView -local spGetCameraPosition = Spring.GetCameraPosition -local spGetFPS = Spring.GetFPS -local spGetWind = Spring.GetWind -local spGetGameSpeed = Spring.GetGameSpeed - -local glBlending = gl.Blending -local glTexture = gl.Texture +local spEcho = Spring.Echo +local spGetVisibleProjectiles = Spring.GetVisibleProjectiles +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetProjectileOwnerID = Spring.GetProjectileOwnerID +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spIsPosInLos = Spring.IsPosInLos +local spIsSphereInView = Spring.IsSphereInView +local spGetCameraPosition = Spring.GetCameraPosition +local spGetFPS = Spring.GetFPS +local spGetWind = Spring.GetWind +local spGetGameSpeed = Spring.GetGameSpeed + +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA local mathRandom = math.random -local mathMin = math.min -local mathMax = math.max -local mathFloor = math.floor -local mathCeil = math.ceil -local mathSqrt = math.sqrt -local mathPi = math.pi +local mathMin = math.min +local mathMax = math.max +local mathFloor = math.floor +local mathCeil = math.ceil +local mathSqrt = math.sqrt +local mathPi = math.pi local LuaShader = gl.LuaShader local pushElementInstance = gl.InstanceVBOTable.pushElementInstance -local popElementInstance = gl.InstanceVBOTable.popElementInstance +local popElementInstance = gl.InstanceVBOTable.popElementInstance -------------------------------------------------------------------------------- -- CONFIG: tweak these to taste -------------------------------------------------------------------------------- local CONFIG = { -- Global - enabled = true, - maxParticles = 8000, -- VBO capacity (also hard cap). Fewer particles than before but each is larger/denser for a more 'real flamethrower' look (and cheaper). - losCullingEnabled = true, -- skip streams whose head is not in LOS + enabled = true, + maxParticles = 8000, -- VBO capacity (also hard cap). Fewer particles than before but each is larger/denser for a more 'real flamethrower' look (and cheaper). + losCullingEnabled = true, -- skip streams whose head is not in LOS -- Tiered particle budget. As the pool fills up, lower-priority decorations -- are dropped first so core flame (the actual visible projectile trail) @@ -96,9 +98,9 @@ local CONFIG = { -- >= budgetSoftFrac : drop smoke + head-smoke + tail-chaos (tier 1) -- >= budgetMediumFrac : also thin jets and cores to every other frame per projectile (tier 2) -- >= budgetHardFrac : essentials only -- 1 core per projectile per frame, no jet, no smoke (tier 3) - budgetSoftFrac = 0.5, - budgetMediumFrac = 0.7, - budgetHardFrac = 0.85, + budgetSoftFrac = 0.5, + budgetMediumFrac = 0.7, + budgetHardFrac = 0.85, -- Overflow headroom above maxParticles reserved EXCLUSIVELY for tier-3 -- essential core flame. When the pool is past budgetHardFrac, every tracked -- projectile still wants its 1 core/frame so the stream doesn't visibly @@ -111,77 +113,77 @@ local CONFIG = { -- with fewer but larger particles -- the 'painterly chunks' approach -- reads much better as real fire than a fine particle cloud, and is far -- cheaper for the GPU. - coreSpawnPerFrame = 1, -- core fire chunks per projectile per frame - jetSpawnPerFrame = 1, -- subtle blue nozzle jet (very brief, only at muzzle) - jetMaxLifeFrac = 0.6, -- only emit jet particles while projectile lifeFrac < this (tight nozzle, not the whole stream) - smokeChance = 0.08, -- chance per projectile per frame to spawn dark smoke (subtle -- the stream should read as FIRE first, smoke second) - smokeChanceHead = 0.05, -- additional chance to spawn a near-head smoke puff (only after the fire has had time to combust) - tailEmitChance = 0.10, -- chance per frame to spawn an extra 'chaotic tail' particle from the back of the stream - burstMultiplier = 1.0, -- overall emission multiplier - emitOffsetForward = -8, -- spawn slight behind projectile pos (elmos, scaled by speed) + coreSpawnPerFrame = 1, -- core fire chunks per projectile per frame + jetSpawnPerFrame = 1, -- subtle blue nozzle jet (very brief, only at muzzle) + jetMaxLifeFrac = 0.6, -- only emit jet particles while projectile lifeFrac < this (tight nozzle, not the whole stream) + smokeChance = 0.08, -- chance per projectile per frame to spawn dark smoke (subtle -- the stream should read as FIRE first, smoke second) + smokeChanceHead = 0.05, -- additional chance to spawn a near-head smoke puff (only after the fire has had time to combust) + tailEmitChance = 0.10, -- chance per frame to spawn an extra 'chaotic tail' particle from the back of the stream + burstMultiplier = 1.0, -- overall emission multiplier + emitOffsetForward = -8, -- spawn slight behind projectile pos (elmos, scaled by speed) -- Sizes (larger -> fewer particles needed to look dense) - sizeAoeRef = 48, -- areaofeffect that maps to sizeScale = 1.0 - sizeScaleMin = 0.7, - sizeScaleMax = 2.7, + sizeAoeRef = 48, -- areaofeffect that maps to sizeScale = 1.0 + sizeScaleMin = 0.7, + sizeScaleMax = 2.7, -- Core flame size taper from muzzle (0 dist) to max range (1 dist). -- muzzleTaperMin: relative size right at the emit point (0=invisible, 1=full size). -- muzzleTaperMax: relative size at max weapon range (normally 1.0 for full size). -- Curve is quadratic (distT^2) so growth is gentle near the nozzle and -- accelerates downrange, giving a thin-jet-to-fat-fire profile. - muzzleTaperMin = 0.32, -- size fraction at muzzle (0 = nothing at nozzle, 1 = full size at nozzle) - muzzleTaperMax = 1.0, -- size fraction at max weapon range + muzzleTaperMin = 0.32, -- size fraction at muzzle (0 = nothing at nozzle, 1 = full size at nozzle) + muzzleTaperMax = 1.0, -- size fraction at max weapon range - coreSizeBase = 7.0, -- base elmos for core flame chunks (large, dense, painterly) - smokeSizeBase = 10.0, -- big dark smoke puffs - jetSizeBase = 1.3, -- base elmos for nozzle jet stream particles (small, tight) - sizeRandRange = 0.6, -- +/- random size variance + coreSizeBase = 7.0, -- base elmos for core flame chunks (large, dense, painterly) + smokeSizeBase = 10.0, -- big dark smoke puffs + jetSizeBase = 1.3, -- base elmos for nozzle jet stream particles (small, tight) + sizeRandRange = 0.6, -- +/- random size variance -- Per-type growth & physics - coreGrowthMult = 3.5, -- core flame grows with age (chunky expansion as fuel combusts) - smokeGrowthMult = 3.0, -- smoke expands a lot (turns into a plume) - jetGrowthMult = 0.25, -- jet barely grows -- stays a clean stream - flameBuoyancy = 8.0, -- elmos of rise at end-of-life for core flame. Applied in shader as FLAME_BUOY*t*t (t = age/life), so visible rise is uniform across weapons regardless of per-weapon lifeMult (cormaw vs short-range flamers). Was previously units/frame^2 which scaled with life^2 -- long-life weapons would billow up to 16x more. - smokeBuoyancy = 0.01, -- strong upward acceleration for smoke (makes it billow above the stream) - smokeUpwardVelMin = 0.20, - smokeUpwardVelMax = 0.45, + coreGrowthMult = 3.5, -- core flame grows with age (chunky expansion as fuel combusts) + smokeGrowthMult = 3.0, -- smoke expands a lot (turns into a plume) + jetGrowthMult = 0.25, -- jet barely grows -- stays a clean stream + flameBuoyancy = 8.0, -- elmos of rise at end-of-life for core flame. Applied in shader as FLAME_BUOY*t*t (t = age/life), so visible rise is uniform across weapons regardless of per-weapon lifeMult (cormaw vs short-range flamers). Was previously units/frame^2 which scaled with life^2 -- long-life weapons would billow up to 16x more. + smokeBuoyancy = 0.01, -- strong upward acceleration for smoke (makes it billow above the stream) + smokeUpwardVelMin = 0.20, + smokeUpwardVelMax = 0.45, -- Lifetime (frames). Core/smoke are scaled per-weapon by -- (expectedLife / lifeScaleRef) so a particle's life roughly matches -- the projectile's flight time -- the oldest still-living particle sits -- back at the muzzle while the newest is at the projectile, filling the -- full path from nozzle to target. Jet particles stay short on purpose. - coreLifeMin = 6, -- multiplied by per-weapon lifeMult - coreLifeMax = 12, - smokeLifeMin = 50, - smokeLifeMax = 100, - jetLifeMin = 6, -- jet particles are short-lived (clean streak) - jetLifeMax = 13, - expectedLifeFallback = 30, -- frames to use when range/velocity unknown - lifeScaleRef = 30, -- reference flight-time (frames). lifeMult = clamp(expectedLife / lifeScaleRef, lifeMultMin, lifeMultMax) - lifeMultMin = 0.7, - lifeMultMax = 3.0, - coreLifeApplyMult = true, -- scale core flame lifetime by per-weapon lifeMult + coreLifeMin = 6, -- multiplied by per-weapon lifeMult + coreLifeMax = 12, + smokeLifeMin = 50, + smokeLifeMax = 100, + jetLifeMin = 6, -- jet particles are short-lived (clean streak) + jetLifeMax = 13, + expectedLifeFallback = 30, -- frames to use when range/velocity unknown + lifeScaleRef = 30, -- reference flight-time (frames). lifeMult = clamp(expectedLife / lifeScaleRef, lifeMultMin, lifeMultMax) + lifeMultMin = 0.7, + lifeMultMax = 3.0, + coreLifeApplyMult = true, -- scale core flame lifetime by per-weapon lifeMult -- Velocity inheritance / spread -- Lower forward inheritance: particles linger near their spawn point so -- the trail visibly spans the projectile path (muzzle->target) instead -- of collapsing into a small clump that rides along with the head. - velocityForwardMult = 0.32, -- core flame inherits ~1/3 projectile velocity per frame (lower = less overshoot past target) - velocityForwardRand = 0.12, -- random +/- variation on forward velocity inheritance (0 = uniform) - jetVelocityMult = 1.00, -- jet particles inherit full projectile velocity (smooth stream along path) - velocityRandTangent = 0.35, -- random tangential push (elmos/frame) -- slightly tighter than before - spreadFromSprayMult = 0.0005, -- sprayangle * this = additional tangential offset (tighter -> reads as a concentrated stream) - jetSpreadMult = 0.12, -- jet particles have minimal lateral spread + velocityForwardMult = 0.32, -- core flame inherits ~1/3 projectile velocity per frame (lower = less overshoot past target) + velocityForwardRand = 0.12, -- random +/- variation on forward velocity inheritance (0 = uniform) + jetVelocityMult = 1.00, -- jet particles inherit full projectile velocity (smooth stream along path) + velocityRandTangent = 0.35, -- random tangential push (elmos/frame) -- slightly tighter than before + spreadFromSprayMult = 0.0005, -- sprayangle * this = additional tangential offset (tighter -> reads as a concentrated stream) + jetSpreadMult = 0.12, -- jet particles have minimal lateral spread -- Wind influence - windFlameMult = 0.0006, - windSmokeMult = 0.0028, + windFlameMult = 0.0006, + windSmokeMult = 0.0028, -- Turbulence (added in shader, scales with age) - wobbleAmpMin = 0.3, - wobbleAmpMax = 1.2, -- max wobble at end of life for core flame (tighter = more directed stream) - smokeWobbleAmp = 3.2, -- smoke wobbles more (turbulent rising column) + wobbleAmpMin = 0.3, + wobbleAmpMax = 1.2, -- max wobble at end of life for core flame (tighter = more directed stream) + smokeWobbleAmp = 3.2, -- smoke wobbles more (turbulent rising column) -- Fire tint gradient (along projectile life: t in [0,1]). Tuned from -- reference photos of real flamethrowers: a mostly saturated yellow-to- @@ -189,53 +191,53 @@ local CONFIG = { -- muzzle. The blue is handled separately by the nozzle jet. -- Stops are: (t, r, g, b) tintStops = { - { 0.00, 1.00, 0.93, 0.68 }, -- near-white hot pinch at the nozzle - { 0.12, 1.00, 0.92, 0.57 }, -- bright pale yellow - { 0.32, 1.00, 0.79, 0.43 }, -- saturated yellow-orange (main body) + { 0.00, 1.00, 0.93, 0.68 }, -- near-white hot pinch at the nozzle + { 0.12, 1.00, 0.92, 0.57 }, -- bright pale yellow + { 0.32, 1.00, 0.79, 0.43 }, -- saturated yellow-orange (main body) --{ 0.58, 1.00, 0.55, 0.12 }, -- orange --{ 1.00, 0.55, 0.10, 0.04 }, -- dying ember }, - tintBrightness = 1.75, -- global multiplier on tint rgb (brighter for a hot, glowing look) - tintMicroJitter = 0.3, -- per-particle jitter on lifeT used to sample the tint LUT (wider = more color variation between neighbouring particles) - tintRGBJitter = 0.12, -- per-particle multiplicative RGB jitter (channel +/- this, makes individual chunks read warmer/cooler/brighter/darker) - smokeTint = { 0.18, 0.17, 0.15 }, -- medium gray-brown smoke (not pitch black -- still reads as smoke without darkening the scene) - smokeTintHead = { 0.32, 0.30, 0.27 }, -- lighter for head smoke (mixed with hot air -- almost a haze) + tintBrightness = 1.75, -- global multiplier on tint rgb (brighter for a hot, glowing look) + tintMicroJitter = 0.3, -- per-particle jitter on lifeT used to sample the tint LUT (wider = more color variation between neighbouring particles) + tintRGBJitter = 0.12, -- per-particle multiplicative RGB jitter (channel +/- this, makes individual chunks read warmer/cooler/brighter/darker) + smokeTint = { 0.18, 0.17, 0.15 }, -- medium gray-brown smoke (not pitch black -- still reads as smoke without darkening the scene) + smokeTintHead = { 0.32, 0.30, 0.27 }, -- lighter for head smoke (mixed with hot air -- almost a haze) -- Nozzle jet stream (the smooth procedural blue effect at the muzzle). -- Rendered as a soft additive radial disc -- no fire/smoke sprite -- to -- give a clean, jet-like look that contrasts with the chaotic flame. - jetColor = { 0.55, 0.80, 1.00 }, -- base blue color of the jet stream - jetBrightness = 1.25, -- additive intensity of the jet (drives bloom feel) - jetAlphaBase = 0.6, - jetWobble = 0.33, -- jet wobble amplitude (kept very small for clean look) - jetStretchMult = 2.0, -- jet billboards are stretched along the projectile velocity by this factor (length = baseSize * jetStretchMult, width = baseSize). Lets a single particle cover the screen-space distance the projectile would otherwise need 8 round particles for -- the jet reads as a streak rather than a chain of dots, and the per-frame particle budget for jets effectively pays for ~8x its visible coverage. + jetColor = { 0.55, 0.80, 1.00 }, -- base blue color of the jet stream + jetBrightness = 1.25, -- additive intensity of the jet (drives bloom feel) + jetAlphaBase = 0.6, + jetWobble = 0.33, -- jet wobble amplitude (kept very small for clean look) + jetStretchMult = 2.0, -- jet billboards are stretched along the projectile velocity by this factor (length = baseSize * jetStretchMult, width = baseSize). Lets a single particle cover the screen-space distance the projectile would otherwise need 8 round particles for -- the jet reads as a streak rather than a chain of dots, and the per-frame particle budget for jets effectively pays for ~8x its visible coverage. -- Scavenger tint: applied when the projectile owner unit has -- customParams.isscavenger. scavJetColor REPLACES the blue jet RGB, and -- scavTintStops REPLACES the fire-gradient LUT for scav projectiles -- -- same shape as tintStops above (white-hot pinch at nozzle, then ramping -- through the warm body of the stream) but tinted pink/magenta/purple. - scavJetColor = { 0.3, 0.0, 0.8 }, -- magenta-purple jet + scavJetColor = { 0.3, 0.0, 0.8 }, -- magenta-purple jet scavTintStops = { - { 0.00, 0.93, 0.85, 1.00 }, -- pure white hot pinch at the nozzle - { 0.12, 0.9, 0.78, 0.95 }, -- pale pink - { 0.32, 0.8, 0.64, 0.92 }, -- saturated pink + { 0.00, 0.93, 0.85, 1.00 }, -- pure white hot pinch at the nozzle + { 0.12, 0.9, 0.78, 0.95 }, -- pale pink + { 0.32, 0.8, 0.64, 0.92 }, -- saturated pink }, -- Alpha - coreAlphaBase = 0.95, -- very opaque -- reads as dense fire - smokeAlphaBase = 0.30, -- light, translucent smoke (don't blot out the scene) + coreAlphaBase = 0.95, -- very opaque -- reads as dense fire + smokeAlphaBase = 0.30, -- light, translucent smoke (don't blot out the scene) -- LOD: distance falloff - lodDistNear = 3000, - lodDistFar = 9000, - lodMinMult = 0.30, - lodDistCull = 24000, -- hard cull: beyond this camera distance the projectile is skipped entirely (no emit, no LOS check, no per-particle work). At this distance the stream is far below 1px so there's nothing to see. - losCacheInterval = 12, -- frames between fresh spIsPosInLos lookups per tracked projectile (the cached visibility flag is reused in between). 12 frames = ~0.4s at 30fps; flames are short-lived enough that one stale frame is invisible. - staleGcInterval = 30, -- frames between sweeps that drop tracked/ignored entries whose engine projectile has died off-screen. Was every frame -- this is pure bookkeeping with no visual effect. + lodDistNear = 3000, + lodDistFar = 9000, + lodMinMult = 0.30, + lodDistCull = 24000, -- hard cull: beyond this camera distance the projectile is skipped entirely (no emit, no LOS check, no per-particle work). At this distance the stream is far below 1px so there's nothing to see. + losCacheInterval = 12, -- frames between fresh spIsPosInLos lookups per tracked projectile (the cached visibility flag is reused in between). 12 frames = ~0.4s at 30fps; flames are short-lived enough that one stale frame is invisible. + staleGcInterval = 30, -- frames between sweeps that drop tracked/ignored entries whose engine projectile has died off-screen. Was every frame -- this is pure bookkeeping with no visual effect. -- Frustum culling padding (elmos) - cullingPad = 200, + cullingPad = 200, } -------------------------------------------------------------------------------- @@ -246,7 +248,7 @@ local CONFIG = { local weaponConfigs = {} local hasFlameWeapons = false -local missingAlldefsPost = 0 -- count of flame weapons missing the flame_orig_* customparams +local missingAlldefsPost = 0 -- count of flame weapons missing the flame_orig_* customparams for weaponID, wd in pairs(WeaponDefs) do if wd.type == "Flame" then @@ -257,33 +259,34 @@ for weaponID, wd in pairs(WeaponDefs) do -- will visually compete with them. missingAlldefsPost = missingAlldefsPost + 1 end - local origRange = tonumber(cp.flame_orig_range) or wd.range or 200 - local origVelocity = tonumber(cp.flame_orig_velocity) or wd.projectilespeed or 250 - local origAoe = tonumber(cp.flame_orig_areaofeffect) or wd.damageAreaOfEffect or 48 - local origSprayDeg = tonumber(cp.flame_orig_sprayangle) or 0 - local origDamage = tonumber(cp.flame_orig_damage) or 0 + local origRange = tonumber(cp.flame_orig_range) or wd.range or 200 + local origVelocity = tonumber(cp.flame_orig_velocity) or wd.projectilespeed or 250 + local origAoe = tonumber(cp.flame_orig_areaofeffect) or wd.damageAreaOfEffect or 48 + local origSprayDeg = tonumber(cp.flame_orig_sprayangle) or 0 + local origDamage = tonumber(cp.flame_orig_damage) or 0 local origIntensity = tonumber(cp.flame_orig_intensity) or 0.5 -- velocity returned by WeaponDefs is already in elmos/frame local velPerFrame = origVelocity / 30 - local sizeScale = mathMax(CONFIG.sizeScaleMin, - mathMin(CONFIG.sizeScaleMax, origAoe / CONFIG.sizeAoeRef)) + local sizeScale = mathMax(CONFIG.sizeScaleMin, mathMin(CONFIG.sizeScaleMax, origAoe / CONFIG.sizeAoeRef)) -- Damage scales intensity slightly (more dmg = denser stream) local damageMult = 1.0 + mathMin(0.8, origDamage / 80) -- Expected projectile life in frames (range / per-frame speed) - local expectedLife = velPerFrame > 0 - and mathMax(8, mathFloor(origRange / velPerFrame)) - or CONFIG.expectedLifeFallback + local expectedLife = velPerFrame > 0 and mathMax(8, mathFloor(origRange / velPerFrame)) or CONFIG.expectedLifeFallback -- Per-weapon lifetime multiplier so particles cover the full -- projectile flight path (longer-range/slower weapons get longer-lived -- particles so the visual stream stretches from muzzle to target). local lifeMult = expectedLife / CONFIG.lifeScaleRef - if lifeMult < CONFIG.lifeMultMin then lifeMult = CONFIG.lifeMultMin end - if lifeMult > CONFIG.lifeMultMax then lifeMult = CONFIG.lifeMultMax end + if lifeMult < CONFIG.lifeMultMin then + lifeMult = CONFIG.lifeMultMin + end + if lifeMult > CONFIG.lifeMultMax then + lifeMult = CONFIG.lifeMultMax + end -- Precompute 1/range^2 for the distance-based muzzleTaper. Avoids -- recomputing it every frame per projectile in emitStream. @@ -291,19 +294,19 @@ for weaponID, wd in pairs(WeaponDefs) do local invRangeSq = 1 / (rangeRef * rangeRef) weaponConfigs[weaponID] = { - range = origRange, - invRangeSq = invRangeSq, - velocity = origVelocity, - velPerFrame = velPerFrame, - areaOfEffect = origAoe, - sprayAngle = origSprayDeg, - damage = origDamage, - intensity = origIntensity, - sizeScale = sizeScale, - damageMult = damageMult, - expectedLife = expectedLife, - lifeMult = lifeMult, - spreadOffset = origSprayDeg * CONFIG.spreadFromSprayMult, + range = origRange, + invRangeSq = invRangeSq, + velocity = origVelocity, + velPerFrame = velPerFrame, + areaOfEffect = origAoe, + sprayAngle = origSprayDeg, + damage = origDamage, + intensity = origIntensity, + sizeScale = sizeScale, + damageMult = damageMult, + expectedLife = expectedLife, + lifeMult = lifeMult, + spreadOffset = origSprayDeg * CONFIG.spreadFromSprayMult, } hasFlameWeapons = true end @@ -585,15 +588,15 @@ void main() { -------------------------------------------------------------------------------- -- GL state -------------------------------------------------------------------------------- -local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" +local fireTexture = "bitmaps/projectiletextures/BARFlame02.tga" local smokeTexture = "bitmaps/projectiletextures/smoke-beh-anim.tga" -local particleVBO = nil +local particleVBO = nil local particleShader = nil local nextParticleID = 0 -local particleRemoveQueue = {} -- [deathFrame] = { id, id, ... } -local lastRemovedFrame = 0 +local particleRemoveQueue = {} -- [deathFrame] = { id, id, ... } +local lastRemovedFrame = 0 -- Free list of recyclable particleRemoveQueue arrays. Under heavy load each -- distinct deathFrame previously allocated a fresh table that became garbage @@ -602,22 +605,22 @@ local lastRemovedFrame = 0 -- spikes. Each pooled table stores its current logical length in slot `n` -- (so spawnParticle can append in O(1) without `#q`) and clears its array -- region back to nil on release so we don't keep stale ids reachable. -local removeQueuePool = {} -local removeQueuePoolN = 0 -local REMOVE_QUEUE_POOL_MAX = 256 -- bounded so we don't hoard tables forever +local removeQueuePool = {} +local removeQueuePoolN = 0 +local REMOVE_QUEUE_POOL_MAX = 256 -- bounded so we don't hoard tables forever -- Pool of per-projectile `info` hash tables. Under heavy fire (84+ streams) -- projectile churn allocates ~150-200 fresh info tables/sec, each becoming -- garbage on projectile death -- a major remaining GC source after the -- removeQueue pool. Pre-allocated and bounded so we never grow without limit. -local infoPool = {} -local infoPoolN = 0 +local infoPool = {} +local infoPoolN = 0 local INFO_POOL_MAX = 512 -- Pool of per-projectile `info.particles` attribution arrays. Same churn -- pattern: one allocated per tracked projectile, becomes garbage on death. -local particlesPool = {} -local particlesPoolN = 0 +local particlesPool = {} +local particlesPoolN = 0 local PARTICLES_POOL_MAX = 512 -- Reset every field that may be set on an info table during its lifetime. @@ -627,29 +630,31 @@ local PARTICLES_POOL_MAX = 512 local function releaseInfo(info) local p = info.particles if p then - for k = 1, #p do p[k] = nil end + for k = 1, #p do + p[k] = nil + end if particlesPoolN < PARTICLES_POOL_MAX then particlesPoolN = particlesPoolN + 1 particlesPool[particlesPoolN] = p end end - info.cfg = nil - info.wDefID = nil - info.birthFrame = nil - info.ownerAllyTeam = nil - info.ownerID = nil - info.isScav = nil - info.gen = nil - info.emitX = nil - info.emitY = nil - info.emitZ = nil - info.midFlightAcquired = nil - info.noKillNeeded = nil - info.allyFastPathFrame = nil - info.losHiddenFrame = nil - info.losVisibleFrame = nil - info.losSmokeCached = nil - info.particles = nil + info.cfg = nil + info.wDefID = nil + info.birthFrame = nil + info.ownerAllyTeam = nil + info.ownerID = nil + info.isScav = nil + info.gen = nil + info.emitX = nil + info.emitY = nil + info.emitZ = nil + info.midFlightAcquired = nil + info.noKillNeeded = nil + info.allyFastPathFrame = nil + info.losHiddenFrame = nil + info.losVisibleFrame = nil + info.losSmokeCached = nil + info.particles = nil if infoPoolN < INFO_POOL_MAX then infoPoolN = infoPoolN + 1 infoPool[infoPoolN] = info @@ -672,22 +677,22 @@ local windX, windZ = 0, 0 local cachedAllyTeamID = -1 local cachedFullView = false -local LOD_DIST_NEAR_SQ = CONFIG.lodDistNear * CONFIG.lodDistNear -local LOD_DIST_FAR_SQ = CONFIG.lodDistFar * CONFIG.lodDistFar -local LOD_DIST_CULL_SQ = CONFIG.lodDistCull * CONFIG.lodDistCull +local LOD_DIST_NEAR_SQ = CONFIG.lodDistNear * CONFIG.lodDistNear +local LOD_DIST_FAR_SQ = CONFIG.lodDistFar * CONFIG.lodDistFar +local LOD_DIST_CULL_SQ = CONFIG.lodDistCull * CONFIG.lodDistCull local LOD_DIST_RANGE_INV_SQ = 1 / mathMax(1, LOD_DIST_FAR_SQ - LOD_DIST_NEAR_SQ) -local LOD_MULT_RANGE = 1 - CONFIG.lodMinMult -local CULL_RADIUS = CONFIG.cullingPad + 80 +local LOD_MULT_RANGE = 1 - CONFIG.lodMinMult +local CULL_RADIUS = CONFIG.cullingPad + 80 local LOS_CACHE_INTERVAL = CONFIG.losCacheInterval -local STALE_GC_INTERVAL = CONFIG.staleGcInterval +local STALE_GC_INTERVAL = CONFIG.staleGcInterval -- Short reuse window for *visible* LOS verdicts. Trades a tiny fog-leak window -- (visible particles linger this many extra frames after sudden LOS loss) for -- a ~3x reduction in spIsPosInLos calls on every visible-enemy flame stream. -local LOS_VISIBLE_CACHE_INTERVAL = 3 +local LOS_VISIBLE_CACHE_INTERVAL = 3 -- Reuse window for the friendly ally fast-path verdict. Friendly shooters -- don't teleport, so a 15-frame (~0.5s) cache is invisible in practice and -- skips a Spring.GetUnitPosition call per friendly flame projectile per frame. -local ALLY_FASTPATH_CACHE_INTERVAL = 15 +local ALLY_FASTPATH_CACHE_INTERVAL = 15 -------------------------------------------------------------------------------- -- Hot-path constants bundled into a SINGLE local table. @@ -701,77 +706,77 @@ local ALLY_FASTPATH_CACHE_INTERVAL = 15 -- If you need a new constant, ADD A FIELD TO K -- never a new `local`. -------------------------------------------------------------------------------- local K = { - MAX_PARTICLES = CONFIG.maxParticles, + MAX_PARTICLES = CONFIG.maxParticles, -- Absolute wall: only tier-3 essential cores may push past MAX_PARTICLES, -- and even they stop at this value. Sized so a few hundred tracked -- projectiles can each get their 1 core/frame for a few frames before -- expirations claw the pool back below the soft cap. - HARD_MAX_PARTICLES = mathFloor(CONFIG.maxParticles * (1 + (CONFIG.essentialOverflowFrac or 0))), - LOS_CULL_ENABLED = CONFIG.losCullingEnabled, - LOD_MIN_MULT = CONFIG.lodMinMult, + HARD_MAX_PARTICLES = mathFloor(CONFIG.maxParticles * (1 + (CONFIG.essentialOverflowFrac or 0))), + LOS_CULL_ENABLED = CONFIG.losCullingEnabled, + LOD_MIN_MULT = CONFIG.lodMinMult, -- Absolute particle counts at which each budget tier engages (precomputed -- from maxParticles * budget*Frac so emitStream just does an integer compare). - BUDGET_SOFT = mathFloor(CONFIG.maxParticles * CONFIG.budgetSoftFrac), - BUDGET_MEDIUM = mathFloor(CONFIG.maxParticles * CONFIG.budgetMediumFrac), - BUDGET_HARD = mathFloor(CONFIG.maxParticles * CONFIG.budgetHardFrac), - - CORE_SPAWN_PF = CONFIG.coreSpawnPerFrame, - JET_SPAWN_PF = CONFIG.jetSpawnPerFrame, - JET_MAX_LIFE_FRAC = CONFIG.jetMaxLifeFrac, - SMOKE_CHANCE = CONFIG.smokeChance, - SMOKE_CHANCE_HEAD = CONFIG.smokeChanceHead, - TAIL_EMIT_CHANCE = CONFIG.tailEmitChance, - BURST_MULT = CONFIG.burstMultiplier, - EMIT_OFFSET_FWD = CONFIG.emitOffsetForward, - - MUZZLE_TAPER_MIN = CONFIG.muzzleTaperMin, - MUZZLE_TAPER_RANGE = (CONFIG.muzzleTaperMax or 1.0) - (CONFIG.muzzleTaperMin or 0.25), - - CORE_SIZE_BASE = CONFIG.coreSizeBase, - SMOKE_SIZE_BASE = CONFIG.smokeSizeBase, - JET_SIZE_BASE = CONFIG.jetSizeBase, - SIZE_RAND_RANGE = CONFIG.sizeRandRange, - - CORE_LIFE_MIN = CONFIG.coreLifeMin, - CORE_LIFE_MAX = CONFIG.coreLifeMax, - CORE_LIFE_SPAN = CONFIG.coreLifeMax - CONFIG.coreLifeMin, - SMOKE_LIFE_MIN = CONFIG.smokeLifeMin, - SMOKE_LIFE_SPAN = CONFIG.smokeLifeMax - CONFIG.smokeLifeMin, - JET_LIFE_MIN = CONFIG.jetLifeMin, - JET_LIFE_SPAN = CONFIG.jetLifeMax - CONFIG.jetLifeMin, + BUDGET_SOFT = mathFloor(CONFIG.maxParticles * CONFIG.budgetSoftFrac), + BUDGET_MEDIUM = mathFloor(CONFIG.maxParticles * CONFIG.budgetMediumFrac), + BUDGET_HARD = mathFloor(CONFIG.maxParticles * CONFIG.budgetHardFrac), + + CORE_SPAWN_PF = CONFIG.coreSpawnPerFrame, + JET_SPAWN_PF = CONFIG.jetSpawnPerFrame, + JET_MAX_LIFE_FRAC = CONFIG.jetMaxLifeFrac, + SMOKE_CHANCE = CONFIG.smokeChance, + SMOKE_CHANCE_HEAD = CONFIG.smokeChanceHead, + TAIL_EMIT_CHANCE = CONFIG.tailEmitChance, + BURST_MULT = CONFIG.burstMultiplier, + EMIT_OFFSET_FWD = CONFIG.emitOffsetForward, + + MUZZLE_TAPER_MIN = CONFIG.muzzleTaperMin, + MUZZLE_TAPER_RANGE = (CONFIG.muzzleTaperMax or 1.0) - (CONFIG.muzzleTaperMin or 0.25), + + CORE_SIZE_BASE = CONFIG.coreSizeBase, + SMOKE_SIZE_BASE = CONFIG.smokeSizeBase, + JET_SIZE_BASE = CONFIG.jetSizeBase, + SIZE_RAND_RANGE = CONFIG.sizeRandRange, + + CORE_LIFE_MIN = CONFIG.coreLifeMin, + CORE_LIFE_MAX = CONFIG.coreLifeMax, + CORE_LIFE_SPAN = CONFIG.coreLifeMax - CONFIG.coreLifeMin, + SMOKE_LIFE_MIN = CONFIG.smokeLifeMin, + SMOKE_LIFE_SPAN = CONFIG.smokeLifeMax - CONFIG.smokeLifeMin, + JET_LIFE_MIN = CONFIG.jetLifeMin, + JET_LIFE_SPAN = CONFIG.jetLifeMax - CONFIG.jetLifeMin, CORE_LIFE_APPLY_MULT = CONFIG.coreLifeApplyMult and true or false, - VEL_FWD_MULT = CONFIG.velocityForwardMult, - VEL_FWD_RAND = CONFIG.velocityForwardRand, - VEL_RAND_TAN = CONFIG.velocityRandTangent, - JET_VEL_MULT = CONFIG.jetVelocityMult, - JET_SPREAD_MULT = CONFIG.jetSpreadMult, + VEL_FWD_MULT = CONFIG.velocityForwardMult, + VEL_FWD_RAND = CONFIG.velocityForwardRand, + VEL_RAND_TAN = CONFIG.velocityRandTangent, + JET_VEL_MULT = CONFIG.jetVelocityMult, + JET_SPREAD_MULT = CONFIG.jetSpreadMult, - SMOKE_UP_VEL_MIN = CONFIG.smokeUpwardVelMin, - SMOKE_UP_VEL_SPAN = CONFIG.smokeUpwardVelMax - CONFIG.smokeUpwardVelMin, + SMOKE_UP_VEL_MIN = CONFIG.smokeUpwardVelMin, + SMOKE_UP_VEL_SPAN = CONFIG.smokeUpwardVelMax - CONFIG.smokeUpwardVelMin, - TINT_MICRO_JITTER = CONFIG.tintMicroJitter, - TINT_RGB_JITTER = CONFIG.tintRGBJitter, + TINT_MICRO_JITTER = CONFIG.tintMicroJitter, + TINT_RGB_JITTER = CONFIG.tintRGBJitter, - CORE_ALPHA_BASE = CONFIG.coreAlphaBase, - SMOKE_ALPHA_BASE = CONFIG.smokeAlphaBase, - JET_ALPHA_BASE = CONFIG.jetAlphaBase, + CORE_ALPHA_BASE = CONFIG.coreAlphaBase, + SMOKE_ALPHA_BASE = CONFIG.smokeAlphaBase, + JET_ALPHA_BASE = CONFIG.jetAlphaBase, - SMOKE_TINT_R = CONFIG.smokeTint[1], - SMOKE_TINT_G = CONFIG.smokeTint[2], - SMOKE_TINT_B = CONFIG.smokeTint[3], - SMOKE_TINT_HEAD_R = (CONFIG.smokeTintHead or CONFIG.smokeTint)[1], - SMOKE_TINT_HEAD_G = (CONFIG.smokeTintHead or CONFIG.smokeTint)[2], - SMOKE_TINT_HEAD_B = (CONFIG.smokeTintHead or CONFIG.smokeTint)[3], + SMOKE_TINT_R = CONFIG.smokeTint[1], + SMOKE_TINT_G = CONFIG.smokeTint[2], + SMOKE_TINT_B = CONFIG.smokeTint[3], + SMOKE_TINT_HEAD_R = (CONFIG.smokeTintHead or CONFIG.smokeTint)[1], + SMOKE_TINT_HEAD_G = (CONFIG.smokeTintHead or CONFIG.smokeTint)[2], + SMOKE_TINT_HEAD_B = (CONFIG.smokeTintHead or CONFIG.smokeTint)[3], - JET_R = CONFIG.jetColor[1] * CONFIG.jetBrightness, - JET_G = CONFIG.jetColor[2] * CONFIG.jetBrightness, - JET_B = CONFIG.jetColor[3] * CONFIG.jetBrightness, + JET_R = CONFIG.jetColor[1] * CONFIG.jetBrightness, + JET_G = CONFIG.jetColor[2] * CONFIG.jetBrightness, + JET_B = CONFIG.jetColor[3] * CONFIG.jetBrightness, - SCAV_JET_R = CONFIG.scavJetColor[1] * CONFIG.jetBrightness, - SCAV_JET_G = CONFIG.scavJetColor[2] * CONFIG.jetBrightness, - SCAV_JET_B = CONFIG.scavJetColor[3] * CONFIG.jetBrightness, + SCAV_JET_R = CONFIG.scavJetColor[1] * CONFIG.jetBrightness, + SCAV_JET_G = CONFIG.scavJetColor[2] * CONFIG.jetBrightness, + SCAV_JET_B = CONFIG.scavJetColor[3] * CONFIG.jetBrightness, } -------------------------------------------------------------------------------- @@ -784,24 +789,24 @@ end local function initGL4() local shaderSource = { - vsSrc = vsSrc, - fsSrc = fsSrc, - shaderName = "FlamethrowerGL4", - uniformInt = { fireTex = 0, smokeTex = 1 }, + vsSrc = vsSrc, + fsSrc = fsSrc, + shaderName = "FlamethrowerGL4", + uniformInt = { fireTex = 0, smokeTex = 1 }, uniformFloat = {}, shaderConfig = { - FLAME_BUOY = CONFIG.flameBuoyancy, - SMOKE_BUOY = CONFIG.smokeBuoyancy, + FLAME_BUOY = CONFIG.flameBuoyancy, + SMOKE_BUOY = CONFIG.smokeBuoyancy, WIND_FLAME_MULT = CONFIG.windFlameMult, WIND_SMOKE_MULT = CONFIG.windSmokeMult, - WOBBLE_MIN = CONFIG.wobbleAmpMin, - WOBBLE_MAX = CONFIG.wobbleAmpMax, - SMOKE_WOBBLE = CONFIG.smokeWobbleAmp, - JET_WOBBLE = CONFIG.jetWobble, - CORE_GROWTH = CONFIG.coreGrowthMult, - SMOKE_GROWTH = CONFIG.smokeGrowthMult, - JET_GROWTH = CONFIG.jetGrowthMult, - JET_STRETCH = CONFIG.jetStretchMult, + WOBBLE_MIN = CONFIG.wobbleAmpMin, + WOBBLE_MAX = CONFIG.wobbleAmpMax, + SMOKE_WOBBLE = CONFIG.smokeWobbleAmp, + JET_WOBBLE = CONFIG.jetWobble, + CORE_GROWTH = CONFIG.coreGrowthMult, + SMOKE_GROWTH = CONFIG.smokeGrowthMult, + JET_GROWTH = CONFIG.jetGrowthMult, + JET_STRETCH = CONFIG.jetStretchMult, }, forceupdate = true, } @@ -812,31 +817,25 @@ local function initGL4() return false end - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "flameQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "flameQuadVBO") local layout = { - { id = 1, name = "worldPos", size = 4 }, - { id = 2, name = "velLife", size = 4 }, - { id = 3, name = "sizeData", size = 4 }, + { id = 1, name = "worldPos", size = 4 }, + { id = 2, name = "velLife", size = 4 }, + { id = 3, name = "sizeData", size = 4 }, { id = 4, name = "tintAlpha", size = 4 }, } - particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable( - layout, CONFIG.maxParticles, "flameParticleVBO" - ) + particleVBO = gl.InstanceVBOTable.makeInstanceVBOTable(layout, CONFIG.maxParticles, "flameParticleVBO") if not particleVBO then goodbye("VBO creation failed") return false end - particleVBO.numVertices = numVertices - particleVBO.vertexVBO = quadVBO - particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO) - particleVBO.primitiveType = GL.TRIANGLES + particleVBO.numVertices = numVertices + particleVBO.vertexVBO = quadVBO + particleVBO.VAO = particleVBO:makeVAOandAttach(quadVBO, particleVBO.instanceVBO) + particleVBO.primitiveType = GL.TRIANGLES local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("flameIndexVBO") particleVBO.VAO:AttachIndexBuffer(indexVBO) @@ -877,42 +876,49 @@ local function bakeTintLut(stops, outR, outG, outB) outB[i + 1] = (a[4] + (b[4] - a[4]) * k) * bri end end -bakeTintLut(CONFIG.tintStops, tintR, tintG, tintB) +bakeTintLut(CONFIG.tintStops, tintR, tintG, tintB) bakeTintLut(CONFIG.scavTintStops, scavTintR, scavTintG, scavTintB) -- silence unused local _ = buildTintLut local function sampleTint(t) - if t < 0 then t = 0 elseif t > 1 then t = 1 end + if t < 0 then + t = 0 + elseif t > 1 then + t = 1 + end local f = t * (TINT_LUT_SIZE - 1) local i = mathFloor(f) local k = f - i local i1, i2 = i + 1, i + 2 - if i2 > TINT_LUT_SIZE then i2 = TINT_LUT_SIZE end + if i2 > TINT_LUT_SIZE then + i2 = TINT_LUT_SIZE + end local r1, g1, b1 = tintR[i1], tintG[i1], tintB[i1] - return r1 + (tintR[i2] - r1) * k, - g1 + (tintG[i2] - g1) * k, - b1 + (tintB[i2] - b1) * k + return r1 + (tintR[i2] - r1) * k, g1 + (tintG[i2] - g1) * k, b1 + (tintB[i2] - b1) * k end local function sampleScavTint(t) - if t < 0 then t = 0 elseif t > 1 then t = 1 end + if t < 0 then + t = 0 + elseif t > 1 then + t = 1 + end local f = t * (TINT_LUT_SIZE - 1) local i = mathFloor(f) local k = f - i local i1, i2 = i + 1, i + 2 - if i2 > TINT_LUT_SIZE then i2 = TINT_LUT_SIZE end + if i2 > TINT_LUT_SIZE then + i2 = TINT_LUT_SIZE + end local r1, g1, b1 = scavTintR[i1], scavTintG[i1], scavTintB[i1] - return r1 + (scavTintR[i2] - r1) * k, - g1 + (scavTintG[i2] - g1) * k, - b1 + (scavTintB[i2] - b1) * k + return r1 + (scavTintR[i2] - r1) * k, g1 + (scavTintG[i2] - g1) * k, b1 + (scavTintB[i2] - b1) * k end -------------------------------------------------------------------------------- -- Particle spawn -------------------------------------------------------------------------------- -local particleData = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,1,1,1 } - +local particleData = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } -- Set by emitStream before spawning so spawnParticle can attribute each new -- particle to its owning projectile (for bulk-kill on LOS loss). Reset to nil @@ -962,11 +968,15 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, -- with a still-live ID just keep incrementing. With <=10k live particles -- in 8M slots the average collision rate is ~0.1%. local nid = nextParticleID + 1 - if nid >= 8388608 then nid = 1 end + if nid >= 8388608 then + nid = 1 + end local idToIndex = particleVBO.instanceIDtoIndex while idToIndex[nid] do nid = nid + 1 - if nid >= 8388608 then nid = 1 end + if nid >= 8388608 then + nid = 1 + end end nextParticleID = nid local id = nid @@ -998,7 +1008,7 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, end local qn = q.n + 1 q[qn] = id - q.n = qn + q.n = qn -- Attribute this particle to the currently-emitting projectile, so we can -- pop it early if/when that projectile loses LOS. Skipped when @@ -1022,8 +1032,12 @@ local function spawnParticle(px, py, pz, vx, vy, vz, size, ptype, life, r, g, b, -- already gone (natural expiry), and even if some are still alive -- they're near end-of-life. Dropping the oldest 50% is harmless. if n >= 1024 then - for i = 1, 512 do plist[i] = plist[i + 512] end - for i = 513, 1024 do plist[i] = nil end + for i = 1, 512 do + plist[i] = plist[i + 512] + end + for i = 513, 1024 do + plist[i] = nil + end n = 512 end plist[n + 1] = id @@ -1034,7 +1048,9 @@ end local function removeExpiredParticles(gameFrame) local startFrame = lastRemovedFrame + 1 if gameFrame - startFrame > 600 then - for f = startFrame, gameFrame - 601 do particleRemoveQueue[f] = nil end + for f = startFrame, gameFrame - 601 do + particleRemoveQueue[f] = nil + end startFrame = gameFrame - 600 end for f = startFrame, gameFrame do @@ -1047,7 +1063,7 @@ local function removeExpiredParticles(gameFrame) if idToIndex[id] then popElementInstance(particleVBO, id) end - q[i] = nil -- drop reference so id values can be GC'd + q[i] = nil -- drop reference so id values can be GC'd end q.n = 0 particleRemoveQueue[f] = nil @@ -1065,8 +1081,8 @@ end -------------------------------------------------------------------------------- -- Projectile tracking -------------------------------------------------------------------------------- -local tracked = {} -- [proID] = { wcfg, birthFrame, gen } -local ignored = {} -- [proID] = lastSeenGen (negative cache: non-flame projectiles) +local tracked = {} -- [proID] = { wcfg, birthFrame, gen } +local ignored = {} -- [proID] = lastSeenGen (negative cache: non-flame projectiles) local trackGen = 0 -- Subscription handle for the shared projectile dispatcher (set in Initialize). @@ -1094,11 +1110,15 @@ local dispatchHandle = nil -- exactly the symptom we kept seeing). local function killProjectileParticles(info) local list = info.particles - if not list then return end + if not list then + return + end local idToIndex = particleVBO.instanceIDtoIndex for i = 1, #list do local id = list[i] - if idToIndex[id] then popElementInstance(particleVBO, id) end + if idToIndex[id] then + popElementInstance(particleVBO, id) + end list[i] = nil end end @@ -1141,7 +1161,9 @@ local function visibleToLocalPlayer(proID, info, px, py, pz, dirX, dirY, dirZ, s end end end - if not K.LOS_CULL_ENABLED then return true, true end + if not K.LOS_CULL_ENABLED then + return true, true + end -- Reuse a recent *hidden* result only. if info.losHiddenFrame and (gameFrame - info.losHiddenFrame) < LOS_CACHE_INTERVAL then return false, false @@ -1176,13 +1198,15 @@ local function visibleToLocalPlayer(proID, info, px, py, pz, dirX, dirY, dirZ, s end end if vis then - info.losHiddenFrame = nil - info.losVisibleFrame = gameFrame - info.losSmokeCached = smokeVis + info.losHiddenFrame = nil + info.losVisibleFrame = gameFrame + info.losSmokeCached = smokeVis else -- Transition visible -> hidden: nuke any particles already in flight, -- otherwise they'd render in fog until they expire naturally. - if not info.losHiddenFrame then killProjectileParticles(info) end + if not info.losHiddenFrame then + killProjectileParticles(info) + end info.losHiddenFrame = gameFrame end return vis, smokeVis @@ -1207,7 +1231,9 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- pauseBurstEmitted records per-burst emissions so the multi-pass -- densification within one burst is allowed. if pausedEmitMode then - if pauseEmittedFor[proID] then return end + if pauseEmittedFor[proID] then + return + end pauseBurstEmitted[proID] = true end -- No early-exit on pool fullness: cores (ptype 0) are uncapped in @@ -1231,14 +1257,18 @@ local function emitStream(proID, info, gameFrame, throttleMult) end local px, py, pz = spGetProjectilePosition(proID) - if not px then return end + if not px then + return + end -- Hard distance cull: at extreme camera distance the stream is well below -- a pixel; skip ALL per-projectile work (emit, LOS, frustum, particle math). local _dx = px - cachedCamX local _dy = py - cachedCamY local _dz = pz - cachedCamZ - if (_dx*_dx + _dy*_dy + _dz*_dz) > LOD_DIST_CULL_SQ then return end + if (_dx * _dx + _dy * _dy + _dz * _dz) > LOD_DIST_CULL_SQ then + return + end -- Budget tier: 0=normal, 1=soft (drop smoke), 2=medium (also thin jet/core), -- 3=hard (essentials only -- one core/frame). Sampled per projectile rather @@ -1246,29 +1276,40 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- gracefully as the pool fills up. local used = particleVBO.usedElements local budgetTier = 0 - if used >= K.BUDGET_HARD then budgetTier = 3 - elseif used >= K.BUDGET_MEDIUM then budgetTier = 2 - elseif used >= K.BUDGET_SOFT then budgetTier = 1 + if used >= K.BUDGET_HARD then + budgetTier = 3 + elseif used >= K.BUDGET_MEDIUM then + budgetTier = 2 + elseif used >= K.BUDGET_SOFT then + budgetTier = 1 end -- Paused snapshot ignores tier-based thinning: a one-shot static fill -- isn't subject to per-frame budget pressure, and we want cores everywhere. - if pausedEmitMode then budgetTier = 0 end + if pausedEmitMode then + budgetTier = 0 + end -- View frustum cull - if not spIsSphereInView(px, py, pz, CULL_RADIUS) then return end + if not spIsSphereInView(px, py, pz, CULL_RADIUS) then + return + end -- Velocity fetched here (instead of post-LOS) because the LOS gate needs -- the projectile's forward direction to do a downrange-trajectory sample -- ("is the spot where my particles will drift to in LOS?"). local vx, vy, vz = spGetProjectileVelocity(proID) - vx = vx or 0; vy = vy or 0; vz = vz or 0 + vx = vx or 0 + vy = vy or 0 + vz = vz or 0 local speed = mathSqrt(vx * vx + vy * vy + vz * vz) local invSpeed = speed > 0.001 and (1 / speed) or 0 local dirX, dirY, dirZ = vx * invSpeed, vy * invSpeed, vz * invSpeed -- LOS / spectator cull (cached per projectile, refreshed every LOS_CACHE_INTERVAL frames) local losVis, losSmokeVis = visibleToLocalPlayer(proID, info, px, py, pz, dirX, dirY, dirZ, speed, info.ownerAllyTeam, gameFrame) - if not losVis then return end + if not losVis then + return + end -- Past all culls -- attribute any particles spawned below to this projectile. emitInfoRef = info @@ -1303,10 +1344,10 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- owner-position emit overrides, none of which should legitimately push -- distFromEmit beyond 1.5x weapon range. if (distFromEmitSq * cfg.invRangeSq) > 2.25 then - info.birthFrame = gameFrame - info.emitX = px - info.emitY = py - info.emitZ = pz + info.birthFrame = gameFrame + info.emitX = px + info.emitY = py + info.emitZ = pz info.midFlightAcquired = false emitInfoRef = nil return @@ -1314,7 +1355,9 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- distT^2 = clamp01( distSq / rangeSq ). cfg.invRangeSq is precomputed. local distT2 = distFromEmitSq * cfg.invRangeSq - if distT2 > 1 then distT2 = 1 end + if distT2 > 1 then + distT2 = 1 + end -- Distance LOD (squared-distance compare to avoid sqrt per projectile per frame) local dx, dy, dz = px - cachedCamX, py - cachedCamY, pz - cachedCamZ @@ -1328,7 +1371,9 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- 2 frames at any LOD. Skip the parity gate during paused mode: gameFrame -- is constant across all densification passes, so half of far-zoom streams -- would receive zero particles otherwise. - if not pausedEmitMode and (gameFrame + proID) % 2 == 0 then return end + if not pausedEmitMode and (gameFrame + proID) % 2 == 0 then + return + end elseif distSq > LOD_DIST_NEAR_SQ then local k = (distSq - LOD_DIST_NEAR_SQ) * LOD_DIST_RANGE_INV_SQ lodMult = 1 - k * LOD_MULT_RANGE @@ -1360,19 +1405,19 @@ local function emitStream(proID, info, gameFrame, throttleMult) local invCLen = 1 / mathSqrt(cLenSq) cx = -dirZ * invCLen cy = 0 - cz = dirX * invCLen + cz = dirX * invCLen end -- second perp = dir x crossDir local tx = dirY * cz - dirZ * cy local ty = dirZ * cx - dirX * cz local tz = dirX * cy - dirY * cx - local sizeScale = cfg.sizeScale + local sizeScale = cfg.sizeScale local damageMult = cfg.damageMult - local spreadOff = cfg.spreadOffset - local lifeMult = cfg.lifeMult or 1.0 - local coreLifeM = K.CORE_LIFE_APPLY_MULT and lifeMult or 1.0 - local randTan = K.VEL_RAND_TAN + local spreadOff = cfg.spreadOffset + local lifeMult = cfg.lifeMult or 1.0 + local coreLifeM = K.CORE_LIFE_APPLY_MULT and lifeMult or 1.0 + local randTan = K.VEL_RAND_TAN local velFwdMult = K.VEL_FWD_MULT local velFwdRand = K.VEL_FWD_RAND @@ -1444,66 +1489,66 @@ local function emitStream(proID, info, gameFrame, throttleMult) jetCount = 0 end if jetCount > 0 then - local jetSpread = K.JET_SPREAD_MULT - -- Jet alpha fades along the stream, but with a floor so jets emitted - -- in the later portion of the projectile's life (the only ones you - -- ever see when the camera is framing the target end of the stream) - -- are still clearly visible. Without the floor, jetAlpha goes linearly - -- from JET_ALPHA_BASE at lifeT=0 to 0 at JET_MAX_LIFE_FRAC, so framing - -- the target makes jets look washed out compared to framing the muzzle. - -- A 0.55 floor keeps target-end jets readable without making the - -- muzzle-end look any different (the freshest jets still get full alpha). - local fadeT = lifeT / K.JET_MAX_LIFE_FRAC - if fadeT > 1 then fadeT = 1 end - local jetAlpha = K.JET_ALPHA_BASE * (1 - 0.45 * fadeT) - local invJetCount = 1 / jetCount - - for i = 1, jetCount do - -- Very tight tangential offset (clean jet shape) - local r1 = (mathRandom() * 2 - 1) * jetSpread * sizeScale - local r2 = (mathRandom() * 2 - 1) * jetSpread * sizeScale - local ox = cx * r1 + tx * r2 - local oy = cy * r1 + ty * r2 - local oz = cz * r1 + tz * r2 - - -- Sub-frame interpolation so multiple jet particles spread along - -- the projectile's path within a single frame (filling the stream - -- continuously even when the projectile moves fast) - local backStep = (i - 1) * invJetCount * speed - ox = ox - dirX * backStep - oy = oy - dirY * backStep - oz = oz - dirZ * backStep - - local size = (K.JET_SIZE_BASE + (mathRandom() - 0.5) * K.SIZE_RAND_RANGE * 0.5) * sizeScale - -- Zoom-out compensation: JET_SIZE_BASE is only ~1.3 elmos so the - -- jet shrinks to sub-pixel when the camera is far. Modest boost - -- (up to ~1.5x at full LOD distance, lodMult=0.30) to keep the - -- jet visually present when zoomed out without it ballooning - -- into a dominant blob -- changing the near-zoom appearance - -- not at all (boost == 1 when lodMult == 1). - size = size * (1 + 0.7 * (1 - lodMult)) - local life = K.JET_LIFE_MIN + mathRandom() * K.JET_LIFE_SPAN - - spawnParticle( - epx + ox, epy + oy, epz + oz, - vx * K.JET_VEL_MULT, vy * K.JET_VEL_MULT, vz * K.JET_VEL_MULT, - size, 3, life, - jetR, jetG, jetB, - jetAlpha - ) - end + local jetSpread = K.JET_SPREAD_MULT + -- Jet alpha fades along the stream, but with a floor so jets emitted + -- in the later portion of the projectile's life (the only ones you + -- ever see when the camera is framing the target end of the stream) + -- are still clearly visible. Without the floor, jetAlpha goes linearly + -- from JET_ALPHA_BASE at lifeT=0 to 0 at JET_MAX_LIFE_FRAC, so framing + -- the target makes jets look washed out compared to framing the muzzle. + -- A 0.55 floor keeps target-end jets readable without making the + -- muzzle-end look any different (the freshest jets still get full alpha). + local fadeT = lifeT / K.JET_MAX_LIFE_FRAC + if fadeT > 1 then + fadeT = 1 + end + local jetAlpha = K.JET_ALPHA_BASE * (1 - 0.45 * fadeT) + local invJetCount = 1 / jetCount + + for i = 1, jetCount do + -- Very tight tangential offset (clean jet shape) + local r1 = (mathRandom() * 2 - 1) * jetSpread * sizeScale + local r2 = (mathRandom() * 2 - 1) * jetSpread * sizeScale + local ox = cx * r1 + tx * r2 + local oy = cy * r1 + ty * r2 + local oz = cz * r1 + tz * r2 + + -- Sub-frame interpolation so multiple jet particles spread along + -- the projectile's path within a single frame (filling the stream + -- continuously even when the projectile moves fast) + local backStep = (i - 1) * invJetCount * speed + ox = ox - dirX * backStep + oy = oy - dirY * backStep + oz = oz - dirZ * backStep + + local size = (K.JET_SIZE_BASE + (mathRandom() - 0.5) * K.SIZE_RAND_RANGE * 0.5) * sizeScale + -- Zoom-out compensation: JET_SIZE_BASE is only ~1.3 elmos so the + -- jet shrinks to sub-pixel when the camera is far. Modest boost + -- (up to ~1.5x at full LOD distance, lodMult=0.30) to keep the + -- jet visually present when zoomed out without it ballooning + -- into a dominant blob -- changing the near-zoom appearance + -- not at all (boost == 1 when lodMult == 1). + size = size * (1 + 0.7 * (1 - lodMult)) + local life = K.JET_LIFE_MIN + mathRandom() * K.JET_LIFE_SPAN + + spawnParticle(epx + ox, epy + oy, epz + oz, vx * K.JET_VEL_MULT, vy * K.JET_VEL_MULT, vz * K.JET_VEL_MULT, size, 3, life, jetR, jetG, jetB, jetAlpha) + end end -- if jetCount > 0 end ---- Core flame particles ---- local tintMicro = K.TINT_MICRO_JITTER - local tintJit = K.TINT_RGB_JITTER + local tintJit = K.TINT_RGB_JITTER for i = 1, nCore do -- Per-particle micro age offset to add variance along the stream. -- Wider jitter -> each chunk samples a different point on the LUT so -- the stream isn't a uniform colour at a given distance. local microT = lifeT + (mathRandom() - 0.5) * tintMicro - if microT < 0 then microT = 0 elseif microT > 1 then microT = 1 end + if microT < 0 then + microT = 0 + elseif microT > 1 then + microT = 1 + end local pR, pG, pB = tintSampler(microT) -- Additional per-channel multiplicative jitter so two particles at the -- same microT still differ slightly in warmth/brightness. @@ -1544,10 +1589,18 @@ local function emitStream(proID, info, gameFrame, throttleMult) local rvz = vz * fMult + (mathRandom() * 2 - 1) * pushScale + cz * r1 * 0.05 spawnParticle( - epx + ox, epy + oy, epz + oz, - rvx, rvy, rvz, - size, 0, life, - pR, pG, pB, + epx + ox, + epy + oy, + epz + oz, + rvx, + rvy, + rvz, + size, + 0, + life, + pR, + pG, + pB, K.CORE_ALPHA_BASE * (0.85 + 0.15 * mathRandom()), -- Tier-3 cores are the ONE thing allowed to cross the soft cap into -- the essential-overflow region; everything else respects MAX_PARTICLES. @@ -1561,7 +1614,9 @@ local function emitStream(proID, info, gameFrame, throttleMult) -- Skipped entirely once the particle pool is under pressure (tier >= 1). if budgetTier < 1 and not farMode and mathRandom() < K.TAIL_EMIT_CHANCE * burstMult * muzzleTaper then local microT = mathMin(1, lifeT + 0.15 + (mathRandom() - 0.5) * tintMicro) - if microT < 0 then microT = 0 end + if microT < 0 then + microT = 0 + end local pR, pG, pB = tintSampler(microT) pR = pR * (1 + (mathRandom() - 0.5) * tintJit) pG = pG * (1 + (mathRandom() - 0.5) * tintJit) @@ -1574,15 +1629,7 @@ local function emitStream(proID, info, gameFrame, throttleMult) local size = (K.CORE_SIZE_BASE * 1.4) * sizeScale * muzzleTaper local life = K.CORE_LIFE_MAX * 0.9 * coreLifeM local pushScale = randTan * 2.0 - spawnParticle( - epx + ox, epy + oy, epz + oz, - pvx * 0.5 + (mathRandom() * 2 - 1) * pushScale, - pvy * 0.5 + (mathRandom() * 2 - 1) * pushScale, - pvz * 0.5 + (mathRandom() * 2 - 1) * pushScale, - size, 0, life, - pR, pG, pB, - K.CORE_ALPHA_BASE - ) + spawnParticle(epx + ox, epy + oy, epz + oz, pvx * 0.5 + (mathRandom() * 2 - 1) * pushScale, pvy * 0.5 + (mathRandom() * 2 - 1) * pushScale, pvz * 0.5 + (mathRandom() * 2 - 1) * pushScale, size, 0, life, pR, pG, pB, K.CORE_ALPHA_BASE) end ---- Smoke ---- @@ -1604,15 +1651,21 @@ local function emitStream(proID, info, gameFrame, throttleMult) local life = K.SMOKE_LIFE_MIN + mathRandom() * K.SMOKE_LIFE_SPAN local svy = K.SMOKE_UP_VEL_MIN + mathRandom() * K.SMOKE_UP_VEL_SPAN spawnParticle( - epx + ox, epy + oy + 0.6, epz + oz, + epx + ox, + epy + oy + 0.6, + epz + oz, -- Smoke rides forward at nearly the same rate as the core flame so -- the smoke trail visually covers the same downrange area instead of -- being left behind where the fire passed. pvx * 0.85 + (mathRandom() - 0.5) * 0.2, svy, pvz * 0.85 + (mathRandom() - 0.5) * 0.2, - size, 1, life, - K.SMOKE_TINT_R, K.SMOKE_TINT_G, K.SMOKE_TINT_B, + size, + 1, + life, + K.SMOKE_TINT_R, + K.SMOKE_TINT_G, + K.SMOKE_TINT_B, K.SMOKE_ALPHA_BASE ) end @@ -1620,35 +1673,41 @@ local function emitStream(proID, info, gameFrame, throttleMult) ---- Head smoke (light haze just behind the projectile, only mid-flight onward) ---- -- Head smoke fades in from lifeT=0.2 (0%) to lifeT=0.45 (100%) if losSmokeVis and budgetTier < 1 and not farMode then - local headSmokeFade = mathMin(1.0, mathMax(0.0, (lifeT - 0.2) / 0.25)) - if headSmokeFade > 0 and mathRandom() < K.SMOKE_CHANCE_HEAD * burstMult * intensity * headSmokeFade then - local r1 = (mathRandom() * 2 - 1) * 1.0 * sizeScale - local r2 = (mathRandom() * 2 - 1) * 1.0 * sizeScale - -- Bias the offset upward so the smoke cloud sits above the bright core - local upBias = 0.8 + mathRandom() * 1.4 - local ox = cx * r1 + tx * r2 - local oy = cy * r1 + ty * r2 + upBias * sizeScale - local oz = cz * r1 + tz * r2 - -- Slight backward bias so the cloud sits just behind the projectile head - local back = (0.2 + mathRandom() * 0.4) * speed - ox = ox - dirX * back - oy = oy - dirY * back - oz = oz - dirZ * back - local size = (K.SMOKE_SIZE_BASE * 0.85 + mathRandom() * K.SIZE_RAND_RANGE) * sizeScale - local life = (K.SMOKE_LIFE_MIN * 0.7) + mathRandom() * K.SMOKE_LIFE_SPAN * 0.6 - local svy = (K.SMOKE_UP_VEL_MIN + mathRandom() * K.SMOKE_UP_VEL_SPAN) * 1.3 - spawnParticle( - epx + ox, epy + oy, epz + oz, - -- Head smoke also rides forward with the projectile so it reaches - -- all the way to where the fire lands. - pvx * 0.95 + (mathRandom() - 0.5) * 0.15, - svy, - pvz * 0.95 + (mathRandom() - 0.5) * 0.15, - size, 1, life, - K.SMOKE_TINT_HEAD_R, K.SMOKE_TINT_HEAD_G, K.SMOKE_TINT_HEAD_B, - K.SMOKE_ALPHA_BASE * 0.6 - ) - end + local headSmokeFade = mathMin(1.0, mathMax(0.0, (lifeT - 0.2) / 0.25)) + if headSmokeFade > 0 and mathRandom() < K.SMOKE_CHANCE_HEAD * burstMult * intensity * headSmokeFade then + local r1 = (mathRandom() * 2 - 1) * 1.0 * sizeScale + local r2 = (mathRandom() * 2 - 1) * 1.0 * sizeScale + -- Bias the offset upward so the smoke cloud sits above the bright core + local upBias = 0.8 + mathRandom() * 1.4 + local ox = cx * r1 + tx * r2 + local oy = cy * r1 + ty * r2 + upBias * sizeScale + local oz = cz * r1 + tz * r2 + -- Slight backward bias so the cloud sits just behind the projectile head + local back = (0.2 + mathRandom() * 0.4) * speed + ox = ox - dirX * back + oy = oy - dirY * back + oz = oz - dirZ * back + local size = (K.SMOKE_SIZE_BASE * 0.85 + mathRandom() * K.SIZE_RAND_RANGE) * sizeScale + local life = (K.SMOKE_LIFE_MIN * 0.7) + mathRandom() * K.SMOKE_LIFE_SPAN * 0.6 + local svy = (K.SMOKE_UP_VEL_MIN + mathRandom() * K.SMOKE_UP_VEL_SPAN) * 1.3 + spawnParticle( + epx + ox, + epy + oy, + epz + oz, + -- Head smoke also rides forward with the projectile so it reaches + -- all the way to where the fire lands. + pvx * 0.95 + (mathRandom() - 0.5) * 0.15, + svy, + pvz * 0.95 + (mathRandom() - 0.5) * 0.15, + size, + 1, + life, + K.SMOKE_TINT_HEAD_R, + K.SMOKE_TINT_HEAD_G, + K.SMOKE_TINT_HEAD_B, + K.SMOKE_ALPHA_BASE * 0.6 + ) + end end -- if not farMode (head smoke) end @@ -1671,7 +1730,9 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) projectiles = spGetVisibleProjectiles() nProjectiles = projectiles and #projectiles or 0 end - if not projectiles or nProjectiles == 0 then return end + if not projectiles or nProjectiles == 0 then + return + end trackGen = trackGen + 1 local gen = trackGen @@ -1721,7 +1782,7 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) -- ~1.5x the weapon's projectile flight time, it MUST be a recycle. -- Refresh birthFrame so lifeT restarts at 0. if info and (gameFrame - info.birthFrame) > info.cfg.expectedLife * 1.5 then - info.birthFrame = gameFrame + info.birthFrame = gameFrame info.midFlightAcquired = false local ex, ey, ez = spGetProjectilePosition(proID) if ex then @@ -1770,7 +1831,7 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) local ox, oy, oz = spGetUnitPosition(ownerID) if ox then local dx, dy, dz = ex - ox, ey - oy, ez - oz - local distFromOwnerSq = dx*dx + dy*dy + dz*dz + local distFromOwnerSq = dx * dx + dy * dy + dz * dz -- Adaptive midFlight threshold: must clear both -- (a) a generous absolute floor that exceeds even -- the longest unit barrel offset (~120 elmos for @@ -1786,7 +1847,9 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) -- ("large orange chunks at the nozzle from frame -- one" symptom). local mfThresh = cfg.range * 0.30 - if mfThresh < 120 then mfThresh = 120 end + if mfThresh < 120 then + mfThresh = 120 + end local mfThreshSq = mfThresh * mfThresh if distFromOwnerSq > mfThreshSq then midFlight = true @@ -1805,7 +1868,7 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) -- are buildings or slow units). local vx, vy, vz = spGetProjectileVelocity(proID) if vx then - local speed = mathSqrt(vx*vx + vy*vy + vz*vz) + local speed = mathSqrt(vx * vx + vy * vy + vz * vz) if speed > 0.001 then local travelled = mathSqrt(distFromOwnerSq) birthFrame = gameFrame - mathFloor(travelled / speed + 0.5) @@ -1827,17 +1890,17 @@ local function updateProjectiles(gameFrame, throttleMult, iterFrac) end info = acquireInfo() - info.cfg = cfg - info.wDefID = wDefID - info.birthFrame = birthFrame - info.ownerAllyTeam = ownerAllyTeam - info.ownerID = ownerID - info.isScav = isScav - info.gen = gen - info.emitX = ex or 0 - info.emitY = ey or 0 - info.emitZ = ez or 0 - info.midFlightAcquired = midFlight + info.cfg = cfg + info.wDefID = wDefID + info.birthFrame = birthFrame + info.ownerAllyTeam = ownerAllyTeam + info.ownerID = ownerID + info.isScav = isScav + info.gen = gen + info.emitX = ex or 0 + info.emitY = ey or 0 + info.emitZ = ez or 0 + info.midFlightAcquired = midFlight tracked[proID] = info emitStream(proID, info, gameFrame, throttleMult) else @@ -1890,8 +1953,12 @@ end -- Draw -------------------------------------------------------------------------------- local function drawParticles() - if not particleVBO or particleVBO.usedElements == 0 then return end - if not particleShader then return end + if not particleVBO or particleVBO.usedElements == 0 then + return + end + if not particleShader then + return + end glDepthTest(true) glDepthMask(false) @@ -1922,7 +1989,9 @@ function gadget:Initialize() goodbye("OpenGL shaders not supported") return end - if not initGL4() then return end + if not initGL4() then + return + end cachedAllyTeamID = spGetMyAllyTeamID() _, cachedFullView = spGetSpectatingState() @@ -1936,23 +2005,29 @@ function gadget:Initialize() local PS = GG.ProjectileScan if PS then local defIDSet = {} - for wDefID in pairs(weaponConfigs) do defIDSet[wDefID] = true end + for wDefID in pairs(weaponConfigs) do + defIDSet[wDefID] = true + end dispatchHandle = PS.Subscribe("flamethrower", defIDSet, PS.SCAN_VISIBLE) end if missingAlldefsPost > 0 then - Spring.Echo(string.format( - "[gfx_flamethrower_gl4] WARNING: %d flame weapon(s) still have engine flame visuals + cegtag active. " .. - "gamedata/alldefs_post.lua only runs at GAME START -- /luarules reload does NOT re-run it. " .. - "Quit to menu and start a new game to fully suppress the engine flame billboard and cegtag smoke trail.", - missingAlldefsPost)) + Spring.Echo(string.format("[gfx_flamethrower_gl4] WARNING: %d flame weapon(s) still have engine flame visuals + cegtag active. " .. "gamedata/alldefs_post.lua only runs at GAME START -- /luarules reload does NOT re-run it. " .. "Quit to menu and start a new game to fully suppress the engine flame billboard and cegtag smoke trail.", missingAlldefsPost)) end GG.Flamethrower = { - GetParticleCount = function() return particleVBO and particleVBO.usedElements or 0 end, - GetMaxParticles = function() return CONFIG.maxParticles end, - GetConfig = function() return CONFIG end, - IsTracked = function(weaponDefID) return weaponConfigs[weaponDefID] ~= nil end, + GetParticleCount = function() + return particleVBO and particleVBO.usedElements or 0 + end, + GetMaxParticles = function() + return CONFIG.maxParticles + end, + GetConfig = function() + return CONFIG + end, + IsTracked = function(weaponDefID) + return weaponConfigs[weaponDefID] ~= nil + end, } end @@ -2001,36 +2076,29 @@ local lastFpsCheckFrame = 0 -- and the user can keep playing while we investigate. No-op cost when -- everything is healthy (one pairs() walk per minute). -- ---------------------------------------------------------------------------- -local DIAG_ENABLED = false -local DIAG_INTERVAL = 300 -- 30s at 30Hz +local DIAG_ENABLED = false +local DIAG_INTERVAL = 300 -- 30s at 30Hz local SAFETY_INTERVAL = 1800 -- 60s at 30Hz -local SAFETY_DRIFT_TOLERANCE = 4 -- |used - idMap| above this triggers heal +local SAFETY_DRIFT_TOLERANCE = 4 -- |used - idMap| above this triggers heal local function countTable(t) local n = 0 - for _ in pairs(t) do n = n + 1 end + for _ in pairs(t) do + n = n + 1 + end return n end local function dumpDiagnostics(n) - local trackedCount = countTable(tracked) - local ignoredCount = countTable(ignored) + local trackedCount = countTable(tracked) + local ignoredCount = countTable(ignored) local queueKeys, queueTotal = 0, 0 for _, q in pairs(particleRemoveQueue) do - queueKeys = queueKeys + 1 + queueKeys = queueKeys + 1 queueTotal = queueTotal + #q end - local idMapSize = particleVBO and particleVBO.instanceIDtoIndex - and countTable(particleVBO.instanceIDtoIndex) or 0 - Spring.Echo(string.format( - "[flameDiag] f=%d used=%d/%d(%d) idMap=%d tracked=%d ignored=%d rmQ=%d(%dids) nextID=%d fpsInt=%d", - n, - particleVBO and particleVBO.usedElements or -1, - K.MAX_PARTICLES, K.HARD_MAX_PARTICLES, - idMapSize, - trackedCount, ignoredCount, - queueKeys, queueTotal, - nextParticleID, fpsUpdateInterval)) + local idMapSize = particleVBO and particleVBO.instanceIDtoIndex and countTable(particleVBO.instanceIDtoIndex) or 0 + Spring.Echo(string.format("[flameDiag] f=%d used=%d/%d(%d) idMap=%d tracked=%d ignored=%d rmQ=%d(%dids) nextID=%d fpsInt=%d", n, particleVBO and particleVBO.usedElements or -1, K.MAX_PARTICLES, K.HARD_MAX_PARTICLES, idMapSize, trackedCount, ignoredCount, queueKeys, queueTotal, nextParticleID, fpsUpdateInterval)) end -- Force-clear the entire particle VBO and all per-projectile attribution @@ -2050,7 +2118,7 @@ local function emergencyResetParticles(reason) -- clearInstanceTable, fall through to a manual reset of just the -- accounting maps. Slots will be reclaimed lazily as new pushes -- swap-replace them. - particleVBO.usedElements = 0 + particleVBO.usedElements = 0 particleVBO.instanceIDtoIndex = {} particleVBO.indextoInstanceID = {} end @@ -2058,7 +2126,7 @@ local function emergencyResetParticles(reason) -- Drop every queued death-frame entry so future expirations don't try to -- pop IDs that no longer exist in the VBO. particleRemoveQueue = {} - lastRemovedFrame = cachedGameFrame + lastRemovedFrame = cachedGameFrame -- Detach particle attribution from every tracked projectile so they emit -- fresh from this frame onward without dangling references to dead IDs. -- Recycle the per-projectile lists into the pool instead of dropping @@ -2066,7 +2134,9 @@ local function emergencyResetParticles(reason) for _, info in pairs(tracked) do local p = info.particles if p then - for k = 1, #p do p[k] = nil end + for k = 1, #p do + p[k] = nil + end if particlesPoolN < PARTICLES_POOL_MAX then particlesPoolN = particlesPoolN + 1 particlesPool[particlesPoolN] = p @@ -2077,25 +2147,30 @@ local function emergencyResetParticles(reason) end local function runSafetyNet(n) - if not particleVBO then return end - local used = particleVBO.usedElements - local idMap = particleVBO.instanceIDtoIndex - if not idMap then return end - local mapSize = countTable(idMap) - local drift = used - mapSize - if drift < 0 then drift = -drift end + if not particleVBO then + return + end + local used = particleVBO.usedElements + local idMap = particleVBO.instanceIDtoIndex + if not idMap then + return + end + local mapSize = countTable(idMap) + local drift = used - mapSize + if drift < 0 then + drift = -drift + end if drift > SAFETY_DRIFT_TOLERANCE then - Spring.Echo(string.format( - "[gfx_flamethrower_gl4] ACCOUNTING DRIFT detected: usedElements=%d idMap=%d (diff=%d). " .. - "This is the suspected long-run leak. Triggering self-heal.", - used, mapSize, used - mapSize)) + Spring.Echo(string.format("[gfx_flamethrower_gl4] ACCOUNTING DRIFT detected: usedElements=%d idMap=%d (diff=%d). " .. "This is the suspected long-run leak. Triggering self-heal.", used, mapSize, used - mapSize)) emergencyResetParticles("accounting drift used=" .. used .. " idMap=" .. mapSize) return end end function gadget:GameFrame(n) - if not particleVBO then return end + if not particleVBO then + return + end cachedGameFrame = n cachedCamX, cachedCamY, cachedCamZ = spGetCameraPosition() @@ -2148,18 +2223,22 @@ end -- Particles spawned during pause will simply expire en masse on unpause when -- the engine gameframe jumps forward past their deathFrame; not pretty but -- acceptable, and bounded by the existing MAX_PARTICLES pool cap. -local PAUSE_EMIT_CAM_MOVE_SQ = 400 -- 20^2 elmos camera move re-triggers emit for newly-visible streams -local pauseEmitDone = false -- have we already produced one snapshot for the current pause? +local PAUSE_EMIT_CAM_MOVE_SQ = 400 -- 20^2 elmos camera move re-triggers emit for newly-visible streams +local pauseEmitDone = false -- have we already produced one snapshot for the current pause? local lastPauseCamX, lastPauseCamY, lastPauseCamZ = 0, 0, 0 function gadget:Update() - if not particleVBO then return end + if not particleVBO then + return + end local _, _, paused = spGetGameSpeed() if not paused then -- Reset so the first paused Update after unpause/re-pause emits again. pauseEmitDone = false lastPauseCamX, lastPauseCamY, lastPauseCamZ = 0, 0, 0 - for k in pairs(pauseEmittedFor) do pauseEmittedFor[k] = nil end + for k in pairs(pauseEmittedFor) do + pauseEmittedFor[k] = nil + end return end @@ -2171,7 +2250,9 @@ function gadget:Update() -- enough that previously off-screen streams may now be visible. The -- pauseEmittedFor table prevents already-emitted streams from receiving -- additional particles on camera-move re-emits. - if pauseEmitDone and camMovedSq < PAUSE_EMIT_CAM_MOVE_SQ then return end + if pauseEmitDone and camMovedSq < PAUSE_EMIT_CAM_MOVE_SQ then + return + end local firstPausedEmit = not pauseEmitDone pauseEmitDone = true lastPauseCamX, lastPauseCamY, lastPauseCamZ = cx, cy, cz @@ -2214,9 +2295,9 @@ function gadget:Update() -- shrink passes/density so every stream gets at least its first pass. cachedCamX, cachedCamY, cachedCamZ = cx, cy, cz local realGameFrame = cachedGameFrame - local MAX_PASSES = 6 - local MAX_DENSITY = 3 - local PAUSE_EMIT_STRIDE = 4 -- frames between backdated passes + local MAX_PASSES = 6 + local MAX_DENSITY = 3 + local PAUSE_EMIT_STRIDE = 4 -- frames between backdated passes -- Estimate streams to snapshot: visible-now minus already-gated. Each -- stream produces roughly density cores per pass; budget against the @@ -2239,7 +2320,7 @@ function gadget:Update() end end end - local pauseEmitPasses = MAX_PASSES + local pauseEmitPasses = MAX_PASSES local pauseEmitDensity = MAX_DENSITY -- Minimum passes regardless of headroom pressure: each pass uses a -- backdated cachedGameFrame, so the shader renders those particles at @@ -2254,7 +2335,9 @@ function gadget:Update() local MIN_PASSES = 3 if pendingCount > 0 then local headroom = K.HARD_MAX_PARTICLES - particleVBO.usedElements - if headroom < 0 then headroom = 0 end + if headroom < 0 then + headroom = 0 + end -- Reserve ~1 core per stream per pass; pick the largest pass*density -- product that fits. Always allow >=1 pass with density 1 so every -- stream gets at least one core (cores ignore the soft cap during @@ -2262,15 +2345,17 @@ function gadget:Update() local maxParticlesPerStream = mathMax(1, mathFloor(headroom / pendingCount)) -- particles per stream = passes * density (cores), so cap product. local product = maxParticlesPerStream - if product > MAX_PASSES * MAX_DENSITY then product = MAX_PASSES * MAX_DENSITY end + if product > MAX_PASSES * MAX_DENSITY then + product = MAX_PASSES * MAX_DENSITY + end -- Prefer more passes (variety/lifeT spread) over density when small. if product >= MAX_PASSES * MAX_DENSITY then pauseEmitPasses, pauseEmitDensity = MAX_PASSES, MAX_DENSITY elseif product >= MAX_PASSES then - pauseEmitPasses = MAX_PASSES + pauseEmitPasses = MAX_PASSES pauseEmitDensity = mathMax(1, mathFloor(product / MAX_PASSES)) else - pauseEmitPasses = mathMax(1, product) + pauseEmitPasses = mathMax(1, product) pauseEmitDensity = 1 end -- Enforce MIN_PASSES so every stream gets shader-age variety even @@ -2278,12 +2363,14 @@ function gadget:Update() -- projectile, which can push the VBO past MAX_PARTICLES into the -- essential-overflow zone -- intended. if pauseEmitPasses < MIN_PASSES then - pauseEmitPasses = MIN_PASSES + pauseEmitPasses = MIN_PASSES pauseEmitDensity = 1 end end - for k in pairs(pauseBurstEmitted) do pauseBurstEmitted[k] = nil end + for k in pairs(pauseBurstEmitted) do + pauseBurstEmitted[k] = nil + end pausedEmitMode = true -- Rotate the per-pass iteration starting position so every stream gets -- a pass where it's iterated early (before the VBO fills past diff --git a/luarules/gadgets/gfx_lightning_cannon_gl4.lua b/luarules/gadgets/gfx_lightning_cannon_gl4.lua index 4404e73ec53..27d563d0b95 100644 --- a/luarules/gadgets/gfx_lightning_cannon_gl4.lua +++ b/luarules/gadgets/gfx_lightning_cannon_gl4.lua @@ -6,7 +6,9 @@ -- Also picks up the visual chain bolts spawned by unit_lightning_splash_dmg.lua. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { @@ -23,38 +25,38 @@ end -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spIsPosInLos = Spring.IsPosInLos -local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetGameFrame = Spring.GetGameFrame -local spGetGameSpeed = Spring.GetGameSpeed -local spGetProjectileOwnerID = Spring.GetProjectileOwnerID +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spIsPosInLos = Spring.IsPosInLos +local spIsPosInAirLos = Spring.IsPosInAirLos +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetGameFrame = Spring.GetGameFrame +local spGetGameSpeed = Spring.GetGameSpeed +local spGetProjectileOwnerID = Spring.GetProjectileOwnerID local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle -- Subscription handle for the shared projectile dispatcher (set in Initialize). -- When nil, we fall back to calling Spring.GetProjectilesInRectangle directly. local dispatchHandle = nil -local spIsAABBInView = Spring.IsAABBInView +local spIsAABBInView = Spring.IsAABBInView -local glBlending = gl.Blending +local glBlending = gl.Blending local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA -local mathMin = math.min -local mathMax = math.max -local mathSqrt = math.sqrt -local mathFloor = math.floor +local mathMin = math.min +local mathMax = math.max +local mathSqrt = math.sqrt +local mathFloor = math.floor local mathRandom = math.random local LuaShader = gl.LuaShader @@ -69,81 +71,83 @@ local uploadAllElements = gl.InstanceVBOTable.uploadAllElements -------------------------------------------------------------------------------- -- VBO sizing -local INITIAL_VBO_SIZE = 256 -local IDLE_SKIP_FRAMES = 3 +local INITIAL_VBO_SIZE = 256 +local IDLE_SKIP_FRAMES = 3 -- Bolt geometry -local SEGMENTS_MIN = 3 -- minimum segments per bolt (short close-range bolts) -local SEGMENTS_MAX = 10 -- maximum segments per bolt (long high-range bolts) -local SEGMENTS_PER_ELMO = 0.04 -- segments added per elmo of bolt length +local SEGMENTS_MIN = 3 -- minimum segments per bolt (short close-range bolts) +local SEGMENTS_MAX = 10 -- maximum segments per bolt (long high-range bolts) +local SEGMENTS_PER_ELMO = 0.04 -- segments added per elmo of bolt length -- Branch / fork generation (CPU side, deterministic per-bolt seed) -local BRANCH_COUNT_MIN = 1 -- min forks for low-damage weapons -local BRANCH_COUNT_MAX = 3 -- max forks for high-damage weapons -local BRANCH_DAMAGE_REF = 200 -- damage at which BRANCH_COUNT_MAX is reached -local BRANCH_LENGTH_FRAC = 0.15 -- branch length as fraction of main-bolt length -local BRANCH_LENGTH_VAR = 0.40 -- random variation around BRANCH_LENGTH_FRAC (0..1) -local BRANCH_ANCHOR_MIN = 0.20 -- earliest spawn point on main bolt (0..1) -local BRANCH_ANCHOR_MAX = 0.95 -- latest spawn point on main bolt (0..1) -local BRANCH_ANGLE_SPREAD = 0.85 -- max angular deviation from main direction (radians ~= 49deg) -local BRANCH_WIDTH_FRAC = 0.55 -- branch width as fraction of main width -local BRANCH_JITTER_FRAC = 0.65 -- branch jitter as fraction of main jitter -local BRANCH_GLOW_FRAC = 0.55 -- branch glow brightness fraction -local BRANCH_SEGMENTS_FRAC = 0.55 -- branch segment count as fraction of main count +local BRANCH_COUNT_MIN = 1 -- min forks for low-damage weapons +local BRANCH_COUNT_MAX = 3 -- max forks for high-damage weapons +local BRANCH_DAMAGE_REF = 200 -- damage at which BRANCH_COUNT_MAX is reached +local BRANCH_LENGTH_FRAC = 0.15 -- branch length as fraction of main-bolt length +local BRANCH_LENGTH_VAR = 0.40 -- random variation around BRANCH_LENGTH_FRAC (0..1) +local BRANCH_ANCHOR_MIN = 0.20 -- earliest spawn point on main bolt (0..1) +local BRANCH_ANCHOR_MAX = 0.95 -- latest spawn point on main bolt (0..1) +local BRANCH_ANGLE_SPREAD = 0.85 -- max angular deviation from main direction (radians ~= 49deg) +local BRANCH_WIDTH_FRAC = 0.55 -- branch width as fraction of main width +local BRANCH_JITTER_FRAC = 0.65 -- branch jitter as fraction of main jitter +local BRANCH_GLOW_FRAC = 0.55 -- branch glow brightness fraction +local BRANCH_SEGMENTS_FRAC = 0.55 -- branch segment count as fraction of main count -- Width (base thickness for the bolt core quad) -local WIDTH_MIN = 0.25 -- minimum bolt width in elmos -local WIDTH_MAX = 1.2 -- maximum bolt width in elmos -local WIDTH_DAMAGE_REF = 250 -- damage at which WIDTH_MAX is reached -local WIDTH_THICKNESS_MULT = 0.45 -- multiplier on weapon's `thickness` to add on top +local WIDTH_MIN = 0.25 -- minimum bolt width in elmos +local WIDTH_MAX = 1.2 -- maximum bolt width in elmos +local WIDTH_DAMAGE_REF = 250 -- damage at which WIDTH_MAX is reached +local WIDTH_THICKNESS_MULT = 0.45 -- multiplier on weapon's `thickness` to add on top -- Jitter (perpendicular offset amplitude in elmos) -local JITTER_MIN = 2 -- baseline jitter amplitude in elmos -local JITTER_MAX = 6 -- maximum jitter for highest-damage weapons -local JITTER_DAMAGE_REF = 250 -- damage at which JITTER_MAX is reached -local JITTER_RANGE_BONUS = 0.012 -- extra jitter per elmo of bolt length -local JITTER_RANGE_BONUS_MAX = 12 -- cap on the range-derived bonus +local JITTER_MIN = 2 -- baseline jitter amplitude in elmos +local JITTER_MAX = 6 -- maximum jitter for highest-damage weapons +local JITTER_DAMAGE_REF = 250 -- damage at which JITTER_MAX is reached +local JITTER_RANGE_BONUS = 0.012 -- extra jitter per elmo of bolt length +local JITTER_RANGE_BONUS_MAX = 12 -- cap on the range-derived bonus -- Glow (wide soft halo around the bolt) -local GLOW_WIDTH_MULT = 13.0 -- glow quad width as multiple of bolt width (drawn along straight bolt axis) -local GLOW_BRIGHTNESS = 0.2 -- base additive glow brightness -local GLOW_DAMAGE_BONUS = 0.4 -- extra brightness scaling with damage (multiplier) -local GLOW_FALLOFF_POWER = 5.0 -- gaussian falloff sharpness (higher = tighter core) +local GLOW_WIDTH_MULT = 13.0 -- glow quad width as multiple of bolt width (drawn along straight bolt axis) +local GLOW_BRIGHTNESS = 0.2 -- base additive glow brightness +local GLOW_DAMAGE_BONUS = 0.4 -- extra brightness scaling with damage (multiplier) +local GLOW_FALLOFF_POWER = 5.0 -- gaussian falloff sharpness (higher = tighter core) -- Core brightness / color mixing -local CORE_COLOR_ADD = 0.4 -- added to weapon RGB to create the bright core color (clamped) -local CORE_BRIGHTNESS = 2.3 -- extra brightness multiplier for hot core pixels -local BRIGHTNESS_MULT = 2.5 -- overall bolt brightness multiplier -local CORE_EDGE_START = 0.03 -- |x| where core->edge color mix begins -local CORE_EDGE_END = 0.3 -- |x| where mix is fully edge color -local MIN_PIXEL_WIDTH = 0.0018 -- minimum bolt screen width (anti-aliasing at distance) -local GLOW_MIN_PIXEL_WIDTH = 0.005 -- minimum glow halo screen width (keeps glow visible far away) +local CORE_COLOR_ADD = 0.4 -- added to weapon RGB to create the bright core color (clamped) +local CORE_BRIGHTNESS = 2.3 -- extra brightness multiplier for hot core pixels +local BRIGHTNESS_MULT = 2.5 -- overall bolt brightness multiplier +local CORE_EDGE_START = 0.03 -- |x| where core->edge color mix begins +local CORE_EDGE_END = 0.3 -- |x| where mix is fully edge color +local MIN_PIXEL_WIDTH = 0.0018 -- minimum bolt screen width (anti-aliasing at distance) +local GLOW_MIN_PIXEL_WIDTH = 0.005 -- minimum glow halo screen width (keeps glow visible far away) -- Lifetime / fading -local BOLT_LIFE_FRAMES = 3 -- total render-frame lifetime per bolt (including ghosts) -local FADE_IN_END = 0.15 -- lifeFrac where width/alpha fade-in completes -local FADE_OUT_START = 0.5 -- lifeFrac where fade-out begins -local FLICKER_AMPLITUDE = 0.45 -- per-frame brightness flicker amplitude (0..1) -local THICKNESS_VARIATION = 0.7 -- per-segment random thickness variation (0..1) -local SEGMENT_LENGTH_VAR = 0.75 -- per-segment length variation (0..1, fraction of base segment length) -local JITTER_MAX_BOLT_FRAC = 0.07 -- cap jitter amplitude to this fraction of bolt length (keeps silhouette consistent at any zoom) -local BRUSH_MAX_JITTER_FRAC = 0.5 -- cap brush width to this fraction of jitter amplitude (prevents fat-brush chunky saw at distance) +local BOLT_LIFE_FRAMES = 3 -- total render-frame lifetime per bolt (including ghosts) +local FADE_IN_END = 0.15 -- lifeFrac where width/alpha fade-in completes +local FADE_OUT_START = 0.5 -- lifeFrac where fade-out begins +local FLICKER_AMPLITUDE = 0.45 -- per-frame brightness flicker amplitude (0..1) +local THICKNESS_VARIATION = 0.7 -- per-segment random thickness variation (0..1) +local SEGMENT_LENGTH_VAR = 0.75 -- per-segment length variation (0..1, fraction of base segment length) +local JITTER_MAX_BOLT_FRAC = 0.07 -- cap jitter amplitude to this fraction of bolt length (keeps silhouette consistent at any zoom) +local BRUSH_MAX_JITTER_FRAC = 0.5 -- cap brush width to this fraction of jitter amplitude (prevents fat-brush chunky saw at distance) -- Endpoint impact spark (additive billboard at the bolt's far endpoint) -local IMPACT_SIZE_MIN = 5 -- spark billboard min size in elmos -local IMPACT_SIZE_MAX = 18 -- spark billboard max size in elmos +local IMPACT_SIZE_MIN = 5 -- spark billboard min size in elmos +local IMPACT_SIZE_MAX = 18 -- spark billboard max size in elmos local IMPACT_SIZE_DAMAGE_REF = 250 -local IMPACT_BRIGHTNESS = 1.5 -- additive brightness of impact billboard +local IMPACT_BRIGHTNESS = 1.5 -- additive brightness of impact billboard -- LOS -local USE_AIR_LOS = true -- if true, use air-LOS (less restrictive) -local spLosCheck = USE_AIR_LOS and spIsPosInAirLos or spIsPosInLos +local USE_AIR_LOS = true -- if true, use air-LOS (less restrictive) +local spLosCheck = USE_AIR_LOS and spIsPosInAirLos or spIsPosInLos -- Textures local impactTexture = "bitmaps/projectiletextures/flare2.tga" -- Per-weapon segment cap (must not exceed SEGMENTS_MAX) -if SEGMENTS_MAX > 64 then SEGMENTS_MAX = 64 end +if SEGMENTS_MAX > 64 then + SEGMENTS_MAX = 64 +end -------------------------------------------------------------------------------- -- Per-weapon configuration table @@ -162,12 +166,18 @@ if SEGMENTS_MAX > 64 then SEGMENTS_MAX = 64 end -------------------------------------------------------------------------------- local weaponConfigs = {} -local function clamp(v, lo, hi) return v < lo and lo or (v > hi and hi or v) end +local function clamp(v, lo, hi) + return v < lo and lo or (v > hi and hi or v) +end local function buildWeaponConfig(weaponID, weaponDef) - if weaponDef.type ~= "LightningCannon" then return end + if weaponDef.type ~= "LightningCannon" then + return + end local cp = weaponDef.customParams or {} - if cp.lightning_no_render == "1" or cp.bogus then return end + if cp.lightning_no_render == "1" or cp.bogus then + return + end -- Visual params (read originals stashed by alldefs_post; fall back to live values) local vis = weaponDef.visuals or {} @@ -180,8 +190,8 @@ local function buildWeaponConfig(weaponID, weaponDef) local coreB = tonumber(cp.lightning_core_color_b) or mathMin(1, b + CORE_COLOR_ADD) local origThickness = tonumber(cp.lightning_thickness_orig) or weaponDef.thickness or 1.5 - local damage = (weaponDef.damages and tonumber(weaponDef.damages[0])) or 30 - local range = weaponDef.range or 300 + local damage = (weaponDef.damages and tonumber(weaponDef.damages[0])) or 30 + local range = weaponDef.range or 300 -- Normalized damage / range factors (0..1, capped) local damageNorm = clamp(damage / WIDTH_DAMAGE_REF, 0, 1) @@ -191,8 +201,7 @@ local function buildWeaponConfig(weaponID, weaponDef) -- Width: damage-scaled base + thickness contribution, all user-multipliable local widthMult = tonumber(cp.lightning_thickness) or 1.0 - local baseWidth = (WIDTH_MIN + (WIDTH_MAX - WIDTH_MIN) * damageNorm - + origThickness * WIDTH_THICKNESS_MULT) * widthMult + local baseWidth = (WIDTH_MIN + (WIDTH_MAX - WIDTH_MIN) * damageNorm + origThickness * WIDTH_THICKNESS_MULT) * widthMult -- Jitter: damage-scaled, with range bonus, user-multipliable local jitterMult = tonumber(cp.lightning_jitter) or 1.0 @@ -223,31 +232,34 @@ local function buildWeaponConfig(weaponID, weaponDef) local branchSegments = clamp(mathFloor(segments * BRANCH_SEGMENTS_FRAC + 0.5), 4, SEGMENTS_MAX) -- Endpoint impact spark - local impactSize = tonumber(cp.lightning_impact_size) - or (IMPACT_SIZE_MIN + (IMPACT_SIZE_MAX - IMPACT_SIZE_MIN) * damageNormI) + local impactSize = tonumber(cp.lightning_impact_size) or (IMPACT_SIZE_MIN + (IMPACT_SIZE_MAX - IMPACT_SIZE_MIN) * damageNormI) -- AABB padding accounts for glow quad + max jitter offset local aabbPad = baseWidth * GLOW_WIDTH_MULT + jitterAmp + impactSize weaponConfigs[weaponID] = { - r = r, g = g, b = b, - coreR = coreR, coreG = coreG, coreB = coreB, - baseWidth = baseWidth, - jitterAmp = jitterAmp, - glowBrightness = glowBrightness, - branchCount = branchCount, - branchLengthFrac = branchLengthFrac, + r = r, + g = g, + b = b, + coreR = coreR, + coreG = coreG, + coreB = coreB, + baseWidth = baseWidth, + jitterAmp = jitterAmp, + glowBrightness = glowBrightness, + branchCount = branchCount, + branchLengthFrac = branchLengthFrac, branchAngleSpread = branchAngleSpread, - segments = segments, - branchSegments = branchSegments, - branchWidth = baseWidth * BRANCH_WIDTH_FRAC, - branchJitter = jitterAmp * BRANCH_JITTER_FRAC, - branchGlow = glowBrightness * BRANCH_GLOW_FRAC, - impactSize = impactSize, - damage = damage, - range = range, - invRangeSq = 1.0 / mathMax(range * range, 1), - aabbPad = aabbPad, + segments = segments, + branchSegments = branchSegments, + branchWidth = baseWidth * BRANCH_WIDTH_FRAC, + branchJitter = jitterAmp * BRANCH_JITTER_FRAC, + branchGlow = glowBrightness * BRANCH_GLOW_FRAC, + impactSize = impactSize, + damage = damage, + range = range, + invRangeSq = 1.0 / mathMax(range * range, 1), + aabbPad = aabbPad, } end @@ -257,9 +269,14 @@ end -- Bail out early if there are no LightningCannon weapons local hasConfigs = false -for _ in pairs(weaponConfigs) do hasConfigs = true; break end +for _ in pairs(weaponConfigs) do + hasConfigs = true + break +end if not hasConfigs then - function gadget:Initialize() gadgetHandler:RemoveGadget() end + function gadget:Initialize() + gadgetHandler:RemoveGadget() + end return end @@ -269,25 +286,27 @@ end -- consistent across the few frames it remains on screen. Tracked by proID; -- ghost rendering continues for BOLT_LIFE_FRAMES after the projectile is gone. -------------------------------------------------------------------------------- -local tracked = {} -- proID -> { cfg, px,py,pz, ex,ey,ez, seed, firstSeen, lastSeenFrame, ownerAllyTeam } -local liveSet = {} -- proID -> true (reused; cleared each frame) -local liveList = {} -local removeList = {} -local hasTracked = false +local tracked = {} -- proID -> { cfg, px,py,pz, ex,ey,ez, seed, firstSeen, lastSeenFrame, ownerAllyTeam } +local liveSet = {} -- proID -> true (reused; cleared each frame) +local liveList = {} +local removeList = {} +local hasTracked = false -- Object pools: lightning bolts are short-lived (a few sim frames each), so the -- per-bolt tracked record and its branch geometry array would otherwise be -- allocated and discarded continuously, producing significant GC pressure -- under sustained lightning fire. Recycle them through free lists. -local recPool = {} -local recPoolN = 0 +local recPool = {} +local recPoolN = 0 local branchListPool = {} local branchListPoolN = 0 -local branchPool = {} -local branchPoolN = 0 +local branchPool = {} +local branchPoolN = 0 local function releaseBranchList(list) - if not list then return end + if not list then + return + end for i = 1, #list do local b = list[i] if b then @@ -310,7 +329,7 @@ local function releaseRec(rec) recPool[recPoolN] = rec end local idleSkipCounter = 0 -local lastBuildFrame = -1 -- last sim frame for which the VBO was rebuilt +local lastBuildFrame = -1 -- last sim frame for which the VBO was rebuilt -- Paused-state camera tracking: while paused, only rebuild when camera moves -- (bolt state is frozen, so unchanged camera == unchanged output). @@ -321,7 +340,7 @@ local pausedLastRebuildTimer = nil local PAUSED_MOVE_MIN_INTERVAL = 0.05 -- Cached spectating / ally -local cachedAllyTeamID = spGetMyAllyTeamID() +local cachedAllyTeamID = spGetMyAllyTeamID() local cachedSpecFullView = false -- Last sim frame in which DrawWorld ran (skip GameFrame redundant scan when keeping up) @@ -838,35 +857,35 @@ local function ensureFloatDefines(cfg) end local boltShaderConfig = { - FADE_IN_END = FADE_IN_END, - FADE_OUT_START = FADE_OUT_START, - FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, + FADE_IN_END = FADE_IN_END, + FADE_OUT_START = FADE_OUT_START, + FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, THICKNESS_VARIATION = THICKNESS_VARIATION, - SEGMENT_LENGTH_VAR = SEGMENT_LENGTH_VAR, + SEGMENT_LENGTH_VAR = SEGMENT_LENGTH_VAR, JITTER_MAX_BOLT_FRAC = JITTER_MAX_BOLT_FRAC, BRUSH_MAX_JITTER_FRAC = BRUSH_MAX_JITTER_FRAC, - CORE_EDGE_START = CORE_EDGE_START, - CORE_EDGE_END = CORE_EDGE_END, - CORE_BRIGHTNESS = CORE_BRIGHTNESS, - BRIGHTNESS_MULT = BRIGHTNESS_MULT, - MIN_PIXEL_WIDTH = MIN_PIXEL_WIDTH, + CORE_EDGE_START = CORE_EDGE_START, + CORE_EDGE_END = CORE_EDGE_END, + CORE_BRIGHTNESS = CORE_BRIGHTNESS, + BRIGHTNESS_MULT = BRIGHTNESS_MULT, + MIN_PIXEL_WIDTH = MIN_PIXEL_WIDTH, } local glowShaderConfig = { - FADE_IN_END = FADE_IN_END, - FADE_OUT_START = FADE_OUT_START, - FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, - GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, + FADE_IN_END = FADE_IN_END, + FADE_OUT_START = FADE_OUT_START, + FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, + GLOW_WIDTH_MULT = GLOW_WIDTH_MULT, GLOW_FALLOFF_POWER = GLOW_FALLOFF_POWER, GLOW_MIN_PIXEL_WIDTH = GLOW_MIN_PIXEL_WIDTH, } local impactShaderConfig = { - FADE_IN_END = FADE_IN_END, - FADE_OUT_START = FADE_OUT_START, + FADE_IN_END = FADE_IN_END, + FADE_OUT_START = FADE_OUT_START, FLICKER_AMPLITUDE = FLICKER_AMPLITUDE, IMPACT_BRIGHTNESS = IMPACT_BRIGHTNESS, - BRIGHTNESS_MULT = BRIGHTNESS_MULT, + BRIGHTNESS_MULT = BRIGHTNESS_MULT, } -------------------------------------------------------------------------------- @@ -895,7 +914,10 @@ local function initGL4() shaderConfig = boltShaderConfig, forceupdate = true, }) - if not boltShader then goodbye("Failed to compile bolt shader"); return false end + if not boltShader then + goodbye("Failed to compile bolt shader") + return false + end glowShader = LuaShader.CheckShaderUpdates({ vsSrc = glowVsSrc, @@ -905,7 +927,10 @@ local function initGL4() shaderConfig = glowShaderConfig, forceupdate = true, }) - if not glowShader then goodbye("Failed to compile glow shader"); return false end + if not glowShader then + goodbye("Failed to compile glow shader") + return false + end impactShader = LuaShader.CheckShaderUpdates({ vsSrc = impactVsSrc, @@ -916,23 +941,27 @@ local function initGL4() shaderConfig = impactShaderConfig, forceupdate = true, }) - if not impactShader then goodbye("Failed to compile impact shader"); return false end + if not impactShader then + goodbye("Failed to compile impact shader") + return false + end - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, 0, 0, 1, 1, "lightningCannonQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "lightningCannonQuadVBO") local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("lightningCannonIndexVBO") local boltLayout = { - {id = 1, name = "startPosAndWidth", size = 4}, - {id = 2, name = "endPosAndLife", size = 4}, - {id = 3, name = "coreColor", size = 4}, - {id = 4, name = "edgeColor", size = 4}, - {id = 5, name = "boltParams", size = 4}, - {id = 6, name = "extraParams", size = 4}, + { id = 1, name = "startPosAndWidth", size = 4 }, + { id = 2, name = "endPosAndLife", size = 4 }, + { id = 3, name = "coreColor", size = 4 }, + { id = 4, name = "edgeColor", size = 4 }, + { id = 5, name = "boltParams", size = 4 }, + { id = 6, name = "extraParams", size = 4 }, } boltVBO = gl.InstanceVBOTable.makeInstanceVBOTable(boltLayout, INITIAL_VBO_SIZE, "lightningCannonVBO") - if not boltVBO then goodbye("Failed to create bolt VBO"); return false end + if not boltVBO then + goodbye("Failed to create bolt VBO") + return false + end boltVBO.numVertices = numVertices boltVBO.vertexVBO = quadVBO boltVBO.VAO = boltVBO:makeVAOandAttach(quadVBO, boltVBO.instanceVBO) @@ -944,7 +973,9 @@ end local function resizeBoltVBO(needed) local newMax = boltVBO.maxElements - while newMax < needed do newMax = newMax * 2 end + while newMax < needed do + newMax = newMax * 2 + end boltVBO.maxElements = newMax local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(newMax, boltVBO.layout) @@ -952,14 +983,19 @@ local function resizeBoltVBO(needed) boltVBO.instanceVBO = newInstanceVBO local data = boltVBO.instanceData local step = boltVBO.instanceStep - for i = #data + 1, step * newMax do data[i] = 0 end + for i = #data + 1, step * newMax do + data[i] = 0 + end boltVBO.VAO:Delete() boltVBO.VAO = boltVBO:makeVAOandAttach(boltVBO.vertexVBO, boltVBO.instanceVBO) boltVBO.VAO:AttachIndexBuffer(boltVBO.indexVBO) end local function cleanupGL4() - if boltVBO then boltVBO:Delete(); boltVBO = nil end + if boltVBO then + boltVBO:Delete() + boltVBO = nil + end end -------------------------------------------------------------------------------- @@ -967,18 +1003,16 @@ end -------------------------------------------------------------------------------- -- Push one segment-instance into beamData -local function pushSegment(beamData, offset, cfg, px, py, pz, ex, ey, ez, - lifeFrac, seed, segIndex, segCount, jitterAmp, - isBranch, widthScale, glowMult, impactSize, intensityFalloff) - beamData[offset + 1] = px - beamData[offset + 2] = py - beamData[offset + 3] = pz - beamData[offset + 4] = cfg.baseWidth - beamData[offset + 5] = ex - beamData[offset + 6] = ey - beamData[offset + 7] = ez - beamData[offset + 8] = lifeFrac - beamData[offset + 9] = cfg.coreR +local function pushSegment(beamData, offset, cfg, px, py, pz, ex, ey, ez, lifeFrac, seed, segIndex, segCount, jitterAmp, isBranch, widthScale, glowMult, impactSize, intensityFalloff) + beamData[offset + 1] = px + beamData[offset + 2] = py + beamData[offset + 3] = pz + beamData[offset + 4] = cfg.baseWidth + beamData[offset + 5] = ex + beamData[offset + 6] = ey + beamData[offset + 7] = ez + beamData[offset + 8] = lifeFrac + beamData[offset + 9] = cfg.coreR beamData[offset + 10] = cfg.coreG beamData[offset + 11] = cfg.coreB beamData[offset + 12] = 1.0 @@ -1004,7 +1038,7 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) local vx = t.ex - t.px local vy = t.ey - t.py local vz = t.ez - t.pz - local boltLenSq = vx*vx + vy*vy + vz*vz + local boltLenSq = vx * vx + vy * vy + vz * vz local intensity = 0.1 + 0.4 * mathMin(boltLenSq * cfg.invRangeSq, 1.0) -- Localize all per-bolt cfg fields once (avoid table lookups in the hot inner loop) @@ -1021,15 +1055,15 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) -- Main bolt: segCount segment-instances (inlined pushSegment for hot path) local segs = cfg.segments for s = 0, segs - 1 do - beamData[offset + 1] = tPx - beamData[offset + 2] = tPy - beamData[offset + 3] = tPz - beamData[offset + 4] = cBaseWidth - beamData[offset + 5] = tEx - beamData[offset + 6] = tEy - beamData[offset + 7] = tEz - beamData[offset + 8] = lifeFrac - beamData[offset + 9] = cCoreR + beamData[offset + 1] = tPx + beamData[offset + 2] = tPy + beamData[offset + 3] = tPz + beamData[offset + 4] = cBaseWidth + beamData[offset + 5] = tEx + beamData[offset + 6] = tEy + beamData[offset + 7] = tEz + beamData[offset + 8] = lifeFrac + beamData[offset + 9] = cCoreR beamData[offset + 10] = cCoreG beamData[offset + 11] = cCoreB beamData[offset + 12] = 1.0 @@ -1041,8 +1075,8 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) beamData[offset + 18] = s beamData[offset + 19] = segs beamData[offset + 20] = cJitterAmp - beamData[offset + 21] = 0.0 -- isBranch - beamData[offset + 22] = 1.0 -- widthScale + beamData[offset + 21] = 0.0 -- isBranch + beamData[offset + 22] = 1.0 -- widthScale beamData[offset + 23] = cGlowB beamData[offset + 24] = (s == 0) and cImpactSize or 0.0 offset = offset + INSTANCE_STRIDE @@ -1071,12 +1105,16 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) local fwx, fwy, fwz = vx / boltLen, vy / boltLen, vz / boltLen -- Build an arbitrary stable perpendicular basis local upRefX, upRefY, upRefZ = 0, 1, 0 - if math.abs(fwy) > 0.9 then upRefX, upRefY, upRefZ = 1, 0, 0 end + if math.abs(fwy) > 0.9 then + upRefX, upRefY, upRefZ = 1, 0, 0 + end local pAx = fwy * upRefZ - fwz * upRefY local pAy = fwz * upRefX - fwx * upRefZ local pAz = fwx * upRefY - fwy * upRefX - local pALen = mathSqrt(pAx*pAx + pAy*pAy + pAz*pAz) - if pALen > 0.001 then pAx, pAy, pAz = pAx/pALen, pAy/pALen, pAz/pALen end + local pALen = mathSqrt(pAx * pAx + pAy * pAy + pAz * pAz) + if pALen > 0.001 then + pAx, pAy, pAz = pAx / pALen, pAy / pALen, pAz / pALen + end local pBx = fwy * pAz - fwz * pAy local pBy = fwz * pAx - fwx * pAz local pBz = fwx * pAy - fwy * pAx @@ -1087,13 +1125,21 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) branches = {} for b = 1, nBranches do local r1 = (math.sin(seed * 12.9 + b * 91.7) * 43758.5) % 1.0 - if r1 < 0 then r1 = r1 + 1 end + if r1 < 0 then + r1 = r1 + 1 + end local r2 = (math.sin(seed * 41.7 + b * 17.3) * 43758.5) % 1.0 - if r2 < 0 then r2 = r2 + 1 end + if r2 < 0 then + r2 = r2 + 1 + end local r3 = (math.sin(seed * 5.3 + b * 53.1) * 43758.5) % 1.0 - if r3 < 0 then r3 = r3 + 1 end + if r3 < 0 then + r3 = r3 + 1 + end local r4 = (math.sin(seed * 23.7 + b * 7.1) * 43758.5) % 1.0 - if r4 < 0 then r4 = r4 + 1 end + if r4 < 0 then + r4 = r4 + 1 + end local anchorT = BRANCH_ANCHOR_MIN + r1 * (BRANCH_ANCHOR_MAX - BRANCH_ANCHOR_MIN) local angle = (r2 * 2.0 - 1.0) * angleSpread @@ -1115,13 +1161,17 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) branchPool[branchPoolN] = nil branchPoolN = branchPoolN - 1 br.anchorT = anchorT - br.dirX = dirX; br.dirY = dirY; br.dirZ = dirZ + br.dirX = dirX + br.dirY = dirY + br.dirZ = dirZ br.lenFrac = lenFrac br.branchSeed = seed * 0.71 + b * 13.7 else br = { anchorT = anchorT, - dirX = dirX, dirY = dirY, dirZ = dirZ, + dirX = dirX, + dirY = dirY, + dirZ = dirZ, lenFrac = lenFrac, branchSeed = seed * 0.71 + b * 13.7, } @@ -1149,15 +1199,15 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) local branchSeed = br.branchSeed for s = 0, bsegs - 1 do -- Inlined pushSegment for hot path (eliminates closure call per segment) - beamData[offset + 1] = ax - beamData[offset + 2] = ay - beamData[offset + 3] = az - beamData[offset + 4] = cBaseWidth - beamData[offset + 5] = bex - beamData[offset + 6] = bey - beamData[offset + 7] = bez - beamData[offset + 8] = lifeFrac - beamData[offset + 9] = cCoreR + beamData[offset + 1] = ax + beamData[offset + 2] = ay + beamData[offset + 3] = az + beamData[offset + 4] = cBaseWidth + beamData[offset + 5] = bex + beamData[offset + 6] = bey + beamData[offset + 7] = bez + beamData[offset + 8] = lifeFrac + beamData[offset + 9] = cCoreR beamData[offset + 10] = cCoreG beamData[offset + 11] = cCoreB beamData[offset + 12] = 1.0 @@ -1169,10 +1219,10 @@ local function emitBolt(beamData, offset, beamCount, cfg, t, lifeFrac) beamData[offset + 18] = s beamData[offset + 19] = bsegs beamData[offset + 20] = cBranchJitter - beamData[offset + 21] = 1.0 -- isBranch - beamData[offset + 22] = cBranchWidthFrac -- widthScale - beamData[offset + 23] = cBranchGlow -- glowMult - beamData[offset + 24] = 0.0 -- impactSize (no spark on branches) + beamData[offset + 21] = 1.0 -- isBranch + beamData[offset + 22] = cBranchWidthFrac -- widthScale + beamData[offset + 23] = cBranchGlow -- glowMult + beamData[offset + 24] = 0.0 -- impactSize (no spark on branches) offset = offset + INSTANCE_STRIDE beamCount = beamCount + 1 end @@ -1200,8 +1250,12 @@ local function getOrTrack(proID, cfg, px, py, pz, ex, ey, ez, frame, ownerAllyTe else rec = { cfg = cfg, - px = px, py = py, pz = pz, - ex = ex, ey = ey, ez = ez, + px = px, + py = py, + pz = pz, + ex = ex, + ey = ey, + ez = ez, seed = mathRandom() * 1000.0 + (proID % 997), firstSeen = frame, lastSeenFrame = frame, @@ -1241,8 +1295,7 @@ local function updateBolts() if usePausedCache then local cx, cy, cz = Spring.GetCameraPosition() local dx, dy, dz = Spring.GetCameraDirection() - if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ - and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then + if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then return end local now = Spring.GetTimer() @@ -1267,7 +1320,9 @@ local function updateBolts() local frame = spGetGameFrame() -- Clear previous live set - for i = 1, #liveList do liveSet[liveList[i]] = nil end + for i = 1, #liveList do + liveSet[liveList[i]] = nil + end local liveCount = 0 -- Scan map-wide for projectiles ONCE (at sim rate via DrawWorld gate). @@ -1341,10 +1396,7 @@ local function updateBolts() if visible then -- AABB cull (padded for glow + jitter + impact spark) local pad = cfg.aabbPad - if spIsAABBInView( - mathMin(px, ex) - pad, mathMin(py, ey) - pad, mathMin(pz, ez) - pad, - mathMax(px, ex) + pad, mathMax(py, ey) + pad, mathMax(pz, ez) + pad - ) then + if spIsAABBInView(mathMin(px, ex) - pad, mathMin(py, ey) - pad, mathMin(pz, ez) - pad, mathMax(px, ex) + pad, mathMax(py, ey) + pad, mathMax(pz, ez) + pad) then rec = getOrTrack(proID, cfg, px, py, pz, ex, ey, ez, frame, proAlly) if not liveSet[proID] then liveSet[proID] = true @@ -1366,7 +1418,9 @@ local function updateBolts() end end end - for i = liveCount + 1, #liveList do liveList[i] = nil end + for i = liveCount + 1, #liveList do + liveList[i] = nil + end -- Ghost bolts: projectile is gone but we keep rendering the fade-out tail if hasTracked then @@ -1380,10 +1434,7 @@ local function updateBolts() if needLos and rec.ownerAllyTeam and rec.ownerAllyTeam ~= myAlly then visible = spLosCheck(rec.px, 0, rec.pz, myAlly) or spLosCheck(rec.ex, 0, rec.ez, myAlly) end - if visible and spIsAABBInView( - mathMin(rec.px, rec.ex) - pad, mathMin(rec.py, rec.ey) - pad, mathMin(rec.pz, rec.ez) - pad, - mathMax(rec.px, rec.ex) + pad, mathMax(rec.py, rec.ey) + pad, mathMax(rec.pz, rec.ez) + pad - ) then + if visible and spIsAABBInView(mathMin(rec.px, rec.ex) - pad, mathMin(rec.py, rec.ey) - pad, mathMin(rec.pz, rec.ez) - pad, mathMax(rec.px, rec.ex) + pad, mathMax(rec.py, rec.ey) + pad, mathMax(rec.pz, rec.ez) + pad) then -- lifeFrac sweeps from sustain through FADE_OUT_START to 1.0 across BOLT_LIFE_FRAMES local lifeFrac = FADE_OUT_START + (age / BOLT_LIFE_FRAMES) * (1.0 - FADE_OUT_START) if beamCount + cfg.segments + cfg.branchCount * cfg.branchSegments > boltVBO.maxElements then @@ -1410,7 +1461,9 @@ end -- Drawing -------------------------------------------------------------------------------- local function drawAll() - if boltVBO.usedElements == 0 then return end + if boltVBO.usedElements == 0 then + return + end glDepthTest(true) glDepthMask(false) @@ -1445,14 +1498,18 @@ end local cleanupFrame = 0 function gadget:Initialize() - if not initGL4() then return end + if not initGL4() then + return + end -- Subscribe to the shared projectile dispatcher (map-wide weapon scan, -- shared with the beam laser gadget). local PS = GG.ProjectileScan if PS then local defIDSet = {} - for wDefID in pairs(weaponConfigs) do defIDSet[wDefID] = true end + for wDefID in pairs(weaponConfigs) do + defIDSet[wDefID] = true + end dispatchHandle = PS.Subscribe("lightning_cannon", defIDSet, PS.SCAN_MAP_WEAPONS) end end @@ -1480,7 +1537,9 @@ function gadget:GameFrame(n) local rec = tracked[proID] tracked[proID] = nil removeList[i] = nil - if rec then releaseRec(rec) end + if rec then + releaseRec(rec) + end end hasTracked = anyRemain end diff --git a/luarules/gadgets/gfx_missile_thruster_gl4.lua b/luarules/gadgets/gfx_missile_thruster_gl4.lua index 503a2bc2d6b..0f7fa2c7a24 100644 --- a/luarules/gadgets/gfx_missile_thruster_gl4.lua +++ b/luarules/gadgets/gfx_missile_thruster_gl4.lua @@ -4,7 +4,9 @@ -- Renders velocity-aligned textured quads (muzzle flame) + additive glow billboards. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { @@ -21,37 +23,37 @@ end -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetVisibleProjectiles = Spring.GetVisibleProjectiles -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetProjectileTimeToLive = Spring.GetProjectileTimeToLive -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetFrameTimeOffset = Spring.GetFrameTimeOffset -local spGetGameSpeed = Spring.GetGameSpeed -local spGetCameraPosition = Spring.GetCameraPosition -local spGetCameraDirection = Spring.GetCameraDirection - -local glBlending = gl.Blending -local glTexture = gl.Texture +local spEcho = Spring.Echo +local spGetVisibleProjectiles = Spring.GetVisibleProjectiles +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetProjectileTimeToLive = Spring.GetProjectileTimeToLive +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spIsPosInAirLos = Spring.IsPosInAirLos +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetFrameTimeOffset = Spring.GetFrameTimeOffset +local spGetGameSpeed = Spring.GetGameSpeed +local spGetCameraPosition = Spring.GetCameraPosition +local spGetCameraDirection = Spring.GetCameraDirection + +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA local mathRandom = math.random -local mathSqrt = math.sqrt +local mathSqrt = math.sqrt local LuaShader = gl.LuaShader -local uploadAllElements = gl.InstanceVBOTable.uploadAllElements +local uploadAllElements = gl.InstanceVBOTable.uploadAllElements -------------------------------------------------------------------------------- -- Configuration @@ -62,11 +64,11 @@ local MAX_FLAMES = 4096 -- Textures local muzzleTexture = "bitmaps/projectiletextures/muzzleside.tga" -local glowTexture = "bitmaps/projectiletextures/glow2.tga" +local glowTexture = "bitmaps/projectiletextures/glow2.tga" -- Global glow multiplier (scales glow color intensity for all missiles) local GLOW_MULT = 1.1 -local GLOW_SIZE_MULT = 1.1 -- global multiplier on glow billboard size +local GLOW_SIZE_MULT = 1.1 -- global multiplier on glow billboard size -------------------------------------------------------------------------------- -- Thruster flame configs (shared config file, loadable by other gadgets/widgets) @@ -93,143 +95,279 @@ local THRUSTER_CONFIGS = { -- Standard small missiles (orange flame trailing behind) missiletrailsmall = { length = -20, - size = 1.8, sizeGrowth = 0.15, - colorR = 1.0, colorG = 0.7, colorB = 0.4, - colorEndR = 1.0, colorEndG = 0.4, colorEndB = 0.1, - glowSize = 28, glowR = 0.09, glowG = 0.06, glowB = 0.012, + size = 1.8, + sizeGrowth = 0.15, + colorR = 1.0, + colorG = 0.7, + colorB = 0.4, + colorEndR = 1.0, + colorEndG = 0.4, + colorEndB = 0.1, + glowSize = 28, + glowR = 0.09, + glowG = 0.06, + glowB = 0.012, thrusterOffset = 3, }, ["missiletrailsmall-simple"] = { length = -20, - size = 1.8, sizeGrowth = 0.15, - colorR = 1.0, colorG = 0.7, colorB = 0.4, - colorEndR = 1.0, colorEndG = 0.4, colorEndB = 0.1, - glowSize = 28, glowR = 0.09, glowG = 0.06, glowB = 0.012, + size = 1.8, + sizeGrowth = 0.15, + colorR = 1.0, + colorG = 0.7, + colorB = 0.4, + colorEndR = 1.0, + colorEndG = 0.4, + colorEndB = 0.1, + glowSize = 28, + glowR = 0.09, + glowG = 0.06, + glowB = 0.012, thrusterOffset = 3, }, ["missiletrailsmall-red"] = { length = -19, - size = 2.5, sizeGrowth = 0.2, - colorR = 1.0, colorG = 0.33, colorB = 0.17, - colorEndR = 1.0, colorEndG = 0.22, colorEndB = 0.05, - glowSize = 28, glowR = 0.1, glowG = 0.025, glowB = 0.005, + size = 2.5, + sizeGrowth = 0.2, + colorR = 1.0, + colorG = 0.33, + colorB = 0.17, + colorEndR = 1.0, + colorEndG = 0.22, + colorEndB = 0.05, + glowSize = 28, + glowR = 0.1, + glowG = 0.025, + glowB = 0.005, thrusterOffset = 0, }, -- Tiny missiles missiletrailtiny = { length = -13, - size = 1.2, sizeGrowth = 0, - colorR = 1.0, colorG = 0.66, colorB = 0.25, - colorEndR = 0.55, colorEndG = 0.3, colorEndB = 0.05, - glowSize = 22, glowR = 0.1, glowG = 0.06, glowB = 0.01, + size = 1.2, + sizeGrowth = 0, + colorR = 1.0, + colorG = 0.66, + colorB = 0.25, + colorEndR = 0.55, + colorEndG = 0.3, + colorEndB = 0.05, + glowSize = 22, + glowR = 0.1, + glowG = 0.06, + glowB = 0.01, thrusterOffset = -5.5, }, -- Medium missiles missiletrailmedium = { length = -24, - size = 3.3, sizeGrowth = 0.15, - colorR = 1.0, colorG = 0.7, colorB = 0.4, - colorEndR = 1.0, colorEndG = 0.4, colorEndB = 0.1, - glowSize = 50, glowR = 0.12, glowG = 0.08, glowB = 0.02, + size = 3.3, + sizeGrowth = 0.15, + colorR = 1.0, + colorG = 0.7, + colorB = 0.4, + colorEndR = 1.0, + colorEndG = 0.4, + colorEndB = 0.1, + glowSize = 50, + glowR = 0.12, + glowG = 0.08, + glowB = 0.02, thrusterOffset = -1, }, ["missiletrailmedium-red"] = { length = -24, - size = 3.3, sizeGrowth = 0.15, - colorR = 1.0, colorG = 0.33, colorB = 0.17, - colorEndR = 1.0, colorEndG = 0.22, colorEndB = 0.05, - glowSize = 50, glowR = 0.13, glowG = 0.06, glowB = 0.01, + size = 3.3, + sizeGrowth = 0.15, + colorR = 1.0, + colorG = 0.33, + colorB = 0.17, + colorEndR = 1.0, + colorEndG = 0.22, + colorEndB = 0.05, + glowSize = 50, + glowR = 0.13, + glowG = 0.06, + glowB = 0.01, thrusterOffset = 3, }, ["missiletraillarge-red"] = { length = -28, - size = 3.7, sizeGrowth = 0.15, - colorR = 1.0, colorG = 0.33, colorB = 0.11, - colorEndR = 1.0, colorEndG = 0.12, colorEndB = 0.05, - glowSize = 50, glowR = 0.13, glowG = 0.06, glowB = 0.01, + size = 3.7, + sizeGrowth = 0.15, + colorR = 1.0, + colorG = 0.33, + colorB = 0.11, + colorEndR = 1.0, + colorEndG = 0.12, + colorEndB = 0.05, + glowSize = 50, + glowR = 0.13, + glowG = 0.06, + glowB = 0.01, thrusterOffset = -2, }, missiletrailviper = { length = -32, - size = 2.8, sizeGrowth = 0.33, - colorR = 1.0, colorG = 0.7, colorB = 0.4, - colorEndR = 1.0, colorEndG = 0.4, colorEndB = 0.1, - glowSize = 50, glowR = 0.12, glowG = 0.07, glowB = 0.02, + size = 2.8, + sizeGrowth = 0.33, + colorR = 1.0, + colorG = 0.7, + colorB = 0.4, + colorEndR = 1.0, + colorEndG = 0.4, + colorEndB = 0.1, + glowSize = 50, + glowR = 0.12, + glowG = 0.07, + glowB = 0.02, thrusterOffset = 4, }, -- Fighter missiles (pinkish/purple-tinted, forward-facing) missiletrailfighter = { length = -20, - size = 1.65, sizeGrowth = 0, - colorR = 1.0, colorG = 0.5, colorB = 0.85, - colorEndR = 0.5, colorEndG = 0.1, colorEndB = 0.4, - glowSize = 22, glowR = 0.1, glowG = 0.045, glowB = 0.09, + size = 1.65, + sizeGrowth = 0, + colorR = 1.0, + colorG = 0.5, + colorB = 0.85, + colorEndR = 0.5, + colorEndG = 0.1, + colorEndB = 0.4, + glowSize = 22, + glowR = 0.1, + glowG = 0.045, + glowB = 0.09, thrusterOffset = -16, }, -- AA missiles (pinkish, forward-facing, with large engineglow) missiletrailaa = { length = -32, - size = 2.3, sizeGrowth = 0, - colorR = 1.0, colorG = 0.5, colorB = 0.85, - colorEndR = 0.5, colorEndG = 0.1, colorEndB = 0.4, - glowSize = 32, glowR = 0.1, glowG = 0.045, glowB = 0.09, + size = 2.3, + sizeGrowth = 0, + colorR = 1.0, + colorG = 0.5, + colorB = 0.85, + colorEndR = 0.5, + colorEndG = 0.1, + colorEndB = 0.4, + glowSize = 32, + glowR = 0.1, + glowG = 0.045, + glowB = 0.09, thrusterOffset = -8, }, ["missiletrailaa-medium"] = { length = -60, - size = 3.7, sizeGrowth = 0, - colorR = 1.0, colorG = 0.5, colorB = 0.85, - colorEndR = 0.5, colorEndG = 0.1, colorEndB = 0.4, - glowSize = 48, glowR = 0.11, glowG = 0.045, glowB = 0.1, + size = 3.7, + sizeGrowth = 0, + colorR = 1.0, + colorG = 0.5, + colorB = 0.85, + colorEndR = 0.5, + colorEndG = 0.1, + colorEndB = 0.4, + glowSize = 48, + glowR = 0.11, + glowG = 0.045, + glowB = 0.1, thrusterOffset = 0, }, ["missiletrailaa-large"] = { length = -100, - size = 7.5, sizeGrowth = 0, - colorR = 1.0, colorG = 0.5, colorB = 0.85, - colorEndR = 0.5, colorEndG = 0.1, colorEndB = 0.4, - glowSize = 60, glowR = 0.14, glowG = 0.045, glowB = 0.125, + size = 7.5, + sizeGrowth = 0, + colorR = 1.0, + colorG = 0.5, + colorB = 0.85, + colorEndR = 0.5, + colorEndG = 0.1, + colorEndB = 0.4, + glowSize = 60, + glowR = 0.14, + glowG = 0.045, + glowB = 0.125, thrusterOffset = -35, }, -- Mship (corroyspecial) - larger, redder missiletrailmship = { length = -7, - size = 4.0, sizeGrowth = 0.2, - colorR = 1.0, colorG = 0.25, colorB = 0.05, - colorEndR = 1.0, colorEndG = 0.15, colorEndB = 0.03, - glowSize = 44, glowR = 0.1, glowG = 0.05, glowB = 0.02, + size = 4.0, + sizeGrowth = 0.2, + colorR = 1.0, + colorG = 0.25, + colorB = 0.05, + colorEndR = 1.0, + colorEndG = 0.15, + colorEndB = 0.03, + glowSize = 44, + glowR = 0.1, + glowG = 0.05, + glowB = 0.02, thrusterOffset = 3, }, ["missiletrail-juno"] = { length = -50, - size = 3.5, sizeGrowth = 0.2, - colorR = 0.75, colorG = 1.0, colorB = 0.5, - colorEndR = 0.15, colorEndG = 1.0, colorEndB = 0.03, - glowSize = 44, glowR = 0.03, glowG = 0.15, glowB = 0.01, + size = 3.5, + sizeGrowth = 0.2, + colorR = 0.75, + colorG = 1.0, + colorB = 0.5, + colorEndR = 0.15, + colorEndG = 1.0, + colorEndB = 0.03, + glowSize = 44, + glowR = 0.03, + glowG = 0.15, + glowB = 0.01, thrusterOffset = 3, }, ["cruisemissiletrail-tacnuke"] = { length = -72, - size = 5.0, sizeGrowth = 0.2, - colorR = 1.0, colorG = 0.3, colorB = 0.1, - colorEndR = 1.0, colorEndG = 0.15, colorEndB = 0.03, - glowSize = 44, glowR = 0.1, glowG = 0.05, glowB = 0.02, + size = 5.0, + sizeGrowth = 0.2, + colorR = 1.0, + colorG = 0.3, + colorB = 0.1, + colorEndR = 1.0, + colorEndG = 0.15, + colorEndB = 0.03, + glowSize = 44, + glowR = 0.1, + glowG = 0.05, + glowB = 0.02, thrusterOffset = 3, }, ["cruisemissiletrail-emp"] = { length = -66, - size = 4.5, sizeGrowth = 0.2, - colorR = 0.6, colorG = 0.6, colorB = 1.0, - colorEndR = 0.1, colorEndG = 0.1, colorEndB = 1.0, - glowSize = 44, glowR = 0.03, glowG = 0.03, glowB = 0.15, + size = 4.5, + sizeGrowth = 0.2, + colorR = 0.6, + colorG = 0.6, + colorB = 1.0, + colorEndR = 0.1, + colorEndG = 0.1, + colorEndB = 1.0, + glowSize = 44, + glowR = 0.03, + glowG = 0.03, + glowB = 0.15, thrusterOffset = 3, }, nuketrail = { length = -105, - size = 7, sizeGrowth = 0.2, - colorR = 1.0, colorG = 0.66, colorB = 0.2, - colorEndR = 1.0, colorEndG = 0, colorEndB = 0, - glowSize = 44, glowR = 0.15, glowG = 0.06, glowB = 0.03, + size = 7, + sizeGrowth = 0.2, + colorR = 1.0, + colorG = 0.66, + colorB = 0.2, + colorEndR = 1.0, + colorEndG = 0, + colorEndB = 0, + glowSize = 44, + glowR = 0.15, + glowG = 0.06, + glowB = 0.03, thrusterOffset = -8, }, @@ -241,46 +379,48 @@ local THRUSTER_CONFIGS = { THRUSTER_CONFIGS["missiletrailsmall-starburst"] = THRUSTER_CONFIGS["missiletrailsmall"] THRUSTER_CONFIGS["missiletrailmedium-starburst"] = THRUSTER_CONFIGS["missiletrailmedium"] - -- Build weaponDefID -> config lookup -local weaponConfigs = {} -- weaponDefID -> thruster config table +local weaponConfigs = {} -- weaponDefID -> thruster config table for weaponID, weaponDef in pairs(WeaponDefs) do if weaponDef.type == "MissileLauncher" or weaponDef.type == "StarburstLauncher" then local cp = weaponDef.customParams or {} if not cp.bogus then - local tag = weaponDef.cegTag:lower() - if tag then - local cfg = THRUSTER_CONFIGS[tag] - if cfg then - weaponConfigs[weaponID] = cfg + local tag = weaponDef.cegTag:lower() + if tag then + local cfg = THRUSTER_CONFIGS[tag] + if cfg then + weaponConfigs[weaponID] = cfg + end end end - end end end -- Precompute config defaults and per-frame constants to avoid per-missile overhead for _, cfg in pairs(weaponConfigs) do - cfg.sizeGrowth = cfg.sizeGrowth or 0.15 - cfg.glowSize = cfg.glowSize or 0 - cfg.glowR = cfg.glowR or 0.1 - cfg.glowG = cfg.glowG or 0.06 - cfg.glowB = cfg.glowB or 0.02 - cfg.lengthRand = cfg.lengthRand or defaultLengthRand - cfg.widthRand = cfg.widthRand or defaultWidthRand - cfg.hasRand = cfg.lengthRand > 0 or cfg.widthRand > 0 + cfg.sizeGrowth = cfg.sizeGrowth or 0.15 + cfg.glowSize = cfg.glowSize or 0 + cfg.glowR = cfg.glowR or 0.1 + cfg.glowG = cfg.glowG or 0.06 + cfg.glowB = cfg.glowB or 0.02 + cfg.lengthRand = cfg.lengthRand or defaultLengthRand + cfg.widthRand = cfg.widthRand or defaultWidthRand + cfg.hasRand = cfg.lengthRand > 0 or cfg.widthRand > 0 cfg.thrusterOffset = cfg.thrusterOffset or 0 -- Pre-multiply glow values with global multipliers (avoids 4 muls per missile per frame) - cfg.glowSizeFinal = cfg.glowSize * GLOW_SIZE_MULT - cfg.glowRFinal = cfg.glowR * GLOW_MULT - cfg.glowGFinal = cfg.glowG * GLOW_MULT - cfg.glowBFinal = cfg.glowB * GLOW_MULT + cfg.glowSizeFinal = cfg.glowSize * GLOW_SIZE_MULT + cfg.glowRFinal = cfg.glowR * GLOW_MULT + cfg.glowGFinal = cfg.glowG * GLOW_MULT + cfg.glowBFinal = cfg.glowB * GLOW_MULT end -- Check if we have any missiles to render local hasConfigs = false -for _ in pairs(weaponConfigs) do hasConfigs = true; break end +for _ in pairs(weaponConfigs) do + hasConfigs = true + break +end if not hasConfigs then function gadget:Initialize() spEcho("Missile Thruster GL4: No missile weapons with matching cegTags found, exiting.") @@ -679,12 +819,12 @@ void main(void) -------------------------------------------------------------------------------- local flameVBO local flameShader -local crossFlameShader -- 90-degree rotated flame for volume from all angles -local crossSectionShader -- camera-facing billboard for head-on view +local crossFlameShader -- 90-degree rotated flame for volume from all angles +local crossSectionShader -- camera-facing billboard for head-on view local glowShader -- Per-projectile persistent state (direction + position cache for pause fallback) -local projectileCache = {} -- proID -> {dx, dy, dz, px, py, pz} +local projectileCache = {} -- proID -> {dx, dy, dz, px, py, pz} -- Subscription handle for the shared projectile dispatcher (set in Initialize). -- When nil, we fall back to calling Spring.GetVisibleProjectiles directly. @@ -692,12 +832,12 @@ local dispatchHandle = nil local cacheCleanupFrame = 0 -- Cross-section billboard (camera-facing, visible when looking along missile velocity) -local CROSS_SECTION_BRIGHTNESS = 0.5 -- brightness for head-on cross-section glow -local CROSS_SECTION_SIZE_MULT = 1.5 -- cross-section billboard size relative to flame width +local CROSS_SECTION_BRIGHTNESS = 0.5 -- brightness for head-on cross-section glow +local CROSS_SECTION_SIZE_MULT = 1.5 -- cross-section billboard size relative to flame width -- Idle skip: when no missiles found, throttle GetVisibleProjectiles polling local idleSkipCounter = 0 -local IDLE_SKIP_FRAMES = 5 -- only poll every Nth draw frame when idle +local IDLE_SKIP_FRAMES = 5 -- only poll every Nth draw frame when idle -- Paused-state camera tracking: while paused, only rebuild when camera moves local pausedCamX, pausedCamY, pausedCamZ = 0, 0, 0 @@ -723,16 +863,16 @@ local function initGL4() uniformInt = { flameTex = 0 }, uniformFloat = {}, shaderConfig = { - SHIMMER_AMPLITUDE = 0.2, -- width oscillation strength (0 = off) - SHIMMER_SPEED = 0.2, -- width oscillation speed - SHIMMER_TAIL_BIAS = 0.5, -- how much shimmer at base vs tail (0 = tail only, 1 = uniform) - BREATHE_BASE = 0.9, -- minimum brightness (pulse trough) - BREATHE_RANGE = 0.13, -- brightness pulse range (peak = base + range) - BREATHE_SPEED = 0.13, -- brightness pulse speed - COLOR_GRADIENT_END = 0.7, -- normalized position where color fully transitions to endColor - TAIL_FADE_START = 0.6, -- normalized position where tail alpha begins fading - TAIL_FADE_END = 0.999, -- normalized position where tail alpha reaches zero - BRIGHTNESS_MULT = 2.0, -- overall brightness multiplier + SHIMMER_AMPLITUDE = 0.2, -- width oscillation strength (0 = off) + SHIMMER_SPEED = 0.2, -- width oscillation speed + SHIMMER_TAIL_BIAS = 0.5, -- how much shimmer at base vs tail (0 = tail only, 1 = uniform) + BREATHE_BASE = 0.9, -- minimum brightness (pulse trough) + BREATHE_RANGE = 0.13, -- brightness pulse range (peak = base + range) + BREATHE_SPEED = 0.13, -- brightness pulse speed + COLOR_GRADIENT_END = 0.7, -- normalized position where color fully transitions to endColor + TAIL_FADE_START = 0.6, -- normalized position where tail alpha begins fading + TAIL_FADE_END = 0.999, -- normalized position where tail alpha reaches zero + BRIGHTNESS_MULT = 2.0, -- overall brightness multiplier }, forceupdate = true, } @@ -767,7 +907,7 @@ local function initGL4() uniformFloat = {}, shaderConfig = { CROSS_SECTION_BRIGHTNESS = CROSS_SECTION_BRIGHTNESS, - CROSS_SECTION_SIZE_MULT = CROSS_SECTION_SIZE_MULT, + CROSS_SECTION_SIZE_MULT = CROSS_SECTION_SIZE_MULT, }, forceupdate = true, } @@ -794,20 +934,16 @@ local function initGL4() end -- Shared quad VBOs - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "missileThrusterQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "missileThrusterQuadVBO") local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("missileThrusterIndexVBO") -- Flame VBO (combined layout: flame data + embedded glow data, UV flip via alpha sign) local flameLayout = { - {id = 1, name = 'posAndSize', size = 4}, - {id = 2, name = 'dirAndLength', size = 4}, - {id = 3, name = 'color1', size = 4}, - {id = 4, name = 'color2', size = 4}, - {id = 5, name = 'glowData', size = 4}, + { id = 1, name = "posAndSize", size = 4 }, + { id = 2, name = "dirAndLength", size = 4 }, + { id = 3, name = "color1", size = 4 }, + { id = 4, name = "color2", size = 4 }, + { id = 5, name = "glowData", size = 4 }, } flameVBO = gl.InstanceVBOTable.makeInstanceVBOTable(flameLayout, MAX_FLAMES, "missileThrusterFlameVBO") if not flameVBO then @@ -825,14 +961,19 @@ local function initGL4() end local function cleanupGL4() - if flameVBO then flameVBO:Delete(); flameVBO = nil end + if flameVBO then + flameVBO:Delete() + flameVBO = nil + end end -------------------------------------------------------------------------------- -- Drawing -------------------------------------------------------------------------------- local function drawAll() - if flameVBO.usedElements == 0 then return end + if flameVBO.usedElements == 0 then + return + end glDepthTest(true) glDepthMask(false) @@ -882,8 +1023,7 @@ local function updateMissiles() if isPaused then local cx, cy, cz = spGetCameraPosition() local dx, dy, dz = spGetCameraDirection() - if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ - and dx == pausedCamRX and dy == pausedCamRY and dz == pausedCamRZ then + if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ and dx == pausedCamRX and dy == pausedCamRY and dz == pausedCamRZ then return end -- Camera moved while paused: cap rebuild rate by wall clock (FPS-indep). @@ -927,7 +1067,7 @@ local function updateMissiles() end local flameData = flameVBO.instanceData - local flameStep = 20 -- posAndSize(4) + dirAndLength(4) + color1(4) + color2(4) + glowData(4) + local flameStep = 20 -- posAndSize(4) + dirAndLength(4) + color1(4) + color2(4) + glowData(4) local flameCount = 0 local myAllyTeam = cachedAllyTeamID local needLosCheck = not cachedSpecFullView @@ -944,94 +1084,96 @@ local function updateMissiles() -- Skip thruster if missile has run out of propulsion (TTL expired) local ttl = spGetProjectileTimeToLive(proID) if not ttl or ttl > 0 then - local px, py, pz = spGetProjectilePosition(proID) - if px then - -- LOS check: own allyteam projectiles always visible, enemy ones need LOS - local visible = true - if needLosCheck then - local proTeam = spGetProjectileTeamID(proID) - local proAlly = proTeam and spGetTeamAllyTeamID(proTeam) - if proAlly ~= myAllyTeam then - visible = spIsPosInAirLos(px, 0, pz, myAllyTeam) + local px, py, pz = spGetProjectilePosition(proID) + if px then + -- LOS check: own allyteam projectiles always visible, enemy ones need LOS + local visible = true + if needLosCheck then + local proTeam = spGetProjectileTeamID(proID) + local proAlly = proTeam and spGetTeamAllyTeamID(proTeam) + if proAlly ~= myAllyTeam then + visible = spIsPosInAirLos(px, 0, pz, myAllyTeam) + end end - end - if visible then - local vx, vy, vz = spGetProjectileVelocity(proID) - if vx then - local speedSq = vx*vx + vy*vy + vz*vz - local dx, dy, dz - - if speedSq > 0.0001 then - local invSpeed = 1.0 / mathSqrt(speedSq) - dx, dy, dz = vx * invSpeed, vy * invSpeed, vz * invSpeed - px = px + vx * ftoAdj - py = py + vy * ftoAdj - pz = pz + vz * ftoAdj - local ofs = cfg.thrusterOffset - px = px - dx * ofs - py = py - dy * ofs - pz = pz - dz * ofs - local cached = projectileCache[proID] - if cached then - cached[1], cached[2], cached[3] = dx, dy, dz - cached[4], cached[5], cached[6] = px, py, pz + if visible then + local vx, vy, vz = spGetProjectileVelocity(proID) + if vx then + local speedSq = vx * vx + vy * vy + vz * vz + local dx, dy, dz + + if speedSq > 0.0001 then + local invSpeed = 1.0 / mathSqrt(speedSq) + dx, dy, dz = vx * invSpeed, vy * invSpeed, vz * invSpeed + px = px + vx * ftoAdj + py = py + vy * ftoAdj + pz = pz + vz * ftoAdj + local ofs = cfg.thrusterOffset + px = px - dx * ofs + py = py - dy * ofs + pz = pz - dz * ofs + local cached = projectileCache[proID] + if cached then + cached[1], cached[2], cached[3] = dx, dy, dz + cached[4], cached[5], cached[6] = px, py, pz + else + projectileCache[proID] = { dx, dy, dz, px, py, pz } + end else - projectileCache[proID] = {dx, dy, dz, px, py, pz} - end - else - local cached = projectileCache[proID] - if cached then - dx, dy, dz = cached[1], cached[2], cached[3] - px, py, pz = cached[4], cached[5], cached[6] + local cached = projectileCache[proID] + if cached then + dx, dy, dz = cached[1], cached[2], cached[3] + px, py, pz = cached[4], cached[5], cached[6] + end end - end - if dx then - local length = cfg.length - local size = cfg.size - if cfg.hasRand then - local rand = mathRandom() - length = length * (1 + rand * cfg.lengthRand) - size = size * (1 + rand * cfg.widthRand) + if dx then + local length = cfg.length + local size = cfg.size + if cfg.hasRand then + local rand = mathRandom() + length = length * (1 + rand * cfg.lengthRand) + size = size * (1 + rand * cfg.widthRand) + end + + flameCount = flameCount + 1 + if flameCount > MAX_FLAMES then + break + end + local offset = (flameCount - 1) * flameStep + flameData[offset + 1] = px + flameData[offset + 2] = py + flameData[offset + 3] = pz + flameData[offset + 4] = size + flameData[offset + 5] = dx + flameData[offset + 6] = dy + flameData[offset + 7] = dz + flameData[offset + 8] = length + flameData[offset + 9] = cfg.colorR + flameData[offset + 10] = cfg.colorG + flameData[offset + 11] = cfg.colorB + flameData[offset + 12] = 1.0 + flameData[offset + 13] = cfg.colorEndR + flameData[offset + 14] = cfg.colorEndG + flameData[offset + 15] = cfg.colorEndB + flameData[offset + 16] = cfg.sizeGrowth + flameData[offset + 17] = cfg.glowSizeFinal + flameData[offset + 18] = cfg.glowRFinal + flameData[offset + 19] = cfg.glowGFinal + flameData[offset + 20] = cfg.glowBFinal end - - flameCount = flameCount + 1 - if flameCount > MAX_FLAMES then break end - local offset = (flameCount - 1) * flameStep - flameData[offset + 1] = px - flameData[offset + 2] = py - flameData[offset + 3] = pz - flameData[offset + 4] = size - flameData[offset + 5] = dx - flameData[offset + 6] = dy - flameData[offset + 7] = dz - flameData[offset + 8] = length - flameData[offset + 9] = cfg.colorR - flameData[offset + 10] = cfg.colorG - flameData[offset + 11] = cfg.colorB - flameData[offset + 12] = 1.0 - flameData[offset + 13] = cfg.colorEndR - flameData[offset + 14] = cfg.colorEndG - flameData[offset + 15] = cfg.colorEndB - flameData[offset + 16] = cfg.sizeGrowth - flameData[offset + 17] = cfg.glowSizeFinal - flameData[offset + 18] = cfg.glowRFinal - flameData[offset + 19] = cfg.glowGFinal - flameData[offset + 20] = cfg.glowBFinal end end end - end end -- ttl check end -- cfg check end flameVBO.usedElements = flameCount if flameCount > 0 then - idleSkipCounter = 0 -- missiles active, poll every frame + idleSkipCounter = 0 -- missiles active, poll every frame uploadAllElements(flameVBO) else - idleSkipCounter = IDLE_SKIP_FRAMES -- no matching missiles, throttle + idleSkipCounter = IDLE_SKIP_FRAMES -- no matching missiles, throttle end end @@ -1040,9 +1182,13 @@ end -------------------------------------------------------------------------------- function gadget:Initialize() - if not initGL4() then return end + if not initGL4() then + return + end local n = 0 - for _ in pairs(weaponConfigs) do n = n + 1 end + for _ in pairs(weaponConfigs) do + n = n + 1 + end -- Subscribe to the shared projectile dispatcher so we share the per-frame -- GetVisibleProjectiles + GetProjectileDefID scan with the other gfx_*_gl4 @@ -1050,7 +1196,9 @@ function gadget:Initialize() local PS = GG.ProjectileScan if PS then local defIDSet = {} - for wDefID in pairs(weaponConfigs) do defIDSet[wDefID] = true end + for wDefID in pairs(weaponConfigs) do + defIDSet[wDefID] = true + end dispatchHandle = PS.Subscribe("missile_thruster", defIDSet, PS.SCAN_VISIBLE) end @@ -1065,7 +1213,7 @@ function gadget:GameFrame(n) local hasEntries = false for proID in pairs(projectileCache) do if not spGetProjectilePosition(proID) then - projectileCache[proID] = false -- mark for removal + projectileCache[proID] = false -- mark for removal else hasEntries = true end diff --git a/luarules/gadgets/gfx_nano_particles_gl4.lua b/luarules/gadgets/gfx_nano_particles_gl4.lua index 3f97d2c969a..c014b042b79 100644 --- a/luarules/gadgets/gfx_nano_particles_gl4.lua +++ b/luarules/gadgets/gfx_nano_particles_gl4.lua @@ -26,73 +26,75 @@ function gadget:GetInfo() return { - name = "Nano Particles GL4", - desc = "Nano build particles rendered with a custom GL4 shader for enhanced visuals and effects. Drop-in replacement for the engine's built-in nano spray", - author = "Floris", - date = "April 2026", - license = "GNU GPL v2", - layer = 0, - enabled = true, + name = "Nano Particles GL4", + desc = "Nano build particles rendered with a custom GL4 shader for enhanced visuals and effects. Drop-in replacement for the engine's built-in nano spray", + author = "Floris", + date = "April 2026", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end -- Synced half is empty: gadget runs entirely in unsynced space. -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end -------------------------------------------------------------------------------- -- Imports / locals -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetAllUnits = Spring.GetAllUnits -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitNanoPieces = Spring.GetUnitNanoPieces -local spGetUnitPiecePosDir = Spring.GetUnitPiecePosDir -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitRadius = Spring.GetUnitRadius -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt -local spGetFeaturePosition = Spring.GetFeaturePosition -local spGetFeatureRadius = Spring.GetFeatureRadius -local spGetFeatureHealth = Spring.GetFeatureHealth -local spGetFeatureResources = Spring.GetFeatureResources -local spValidFeatureID = Spring.ValidFeatureID -local spValidUnitID = Spring.ValidUnitID -local spGetTeamColor = Spring.GetTeamColor +local spEcho = Spring.Echo +local spGetAllUnits = Spring.GetAllUnits +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetUnitNanoPieces = Spring.GetUnitNanoPieces +local spGetUnitPiecePosDir = Spring.GetUnitPiecePosDir +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt +local spGetFeaturePosition = Spring.GetFeaturePosition +local spGetFeatureRadius = Spring.GetFeatureRadius +local spGetFeatureHealth = Spring.GetFeatureHealth +local spGetFeatureResources = Spring.GetFeatureResources +local spValidFeatureID = Spring.ValidFeatureID +local spValidUnitID = Spring.ValidUnitID +local spGetTeamColor = Spring.GetTeamColor local spGetUnitCurrentBuildPower = Spring.GetUnitCurrentBuildPower -local spGetUnitWorkerTask = Spring.GetUnitWorkerTask -local spGetUnitHealth = Spring.GetUnitHealth -local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData -local spIsUnitVisible = Spring.IsUnitVisible +local spGetUnitWorkerTask = Spring.GetUnitWorkerTask +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData +local spIsUnitVisible = Spring.IsUnitVisible local spGetUnitCollisionVolumeData = Spring.GetUnitCollisionVolumeData -local spGetGroundHeight = Spring.GetGroundHeight +local spGetGroundHeight = Spring.GetGroundHeight -- Engine encodes feature targets in worker-task results as (featureID + MaxUnits()). -- Used for CMD_RESURRECT (always) and CMD_RECLAIM of features. See engine -- LuaSyncedRead.cpp::GetBuilderWorkerTask. local MAX_UNITS = Game.maxUnits or 32000 -local GL_ONE = GL.ONE +local GL_ONE = GL.ONE local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA -local LuaShader = gl.LuaShader -local InstanceVBOTable = gl.InstanceVBOTable -local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance -local uploadElementRange = InstanceVBOTable.uploadElementRange +local LuaShader = gl.LuaShader +local InstanceVBOTable = gl.InstanceVBOTable +local pushElementInstance = InstanceVBOTable.pushElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance +local uploadElementRange = InstanceVBOTable.uploadElementRange local mathRandom = math.random -local mathSqrt = math.sqrt -local mathFloor = math.floor -local mathCeil = math.ceil -local mathLog = math.log +local mathSqrt = math.sqrt +local mathFloor = math.floor +local mathCeil = math.ceil +local mathLog = math.log -local CMD_RECLAIM = CMD.RECLAIM +local CMD_RECLAIM = CMD.RECLAIM local CMD_RESURRECT = CMD.RESURRECT -local CMD_CAPTURE = CMD.CAPTURE -local CMD_REPAIR = CMD.REPAIR +local CMD_CAPTURE = CMD.CAPTURE +local CMD_REPAIR = CMD.REPAIR -------------------------------------------------------------------------------- -- Configuration @@ -118,8 +120,8 @@ local function refreshMaxParticles() MAX_PARTICLES = computeMaxParticles() end -local NANO_TEXTURE = "bitmaps/projectiletextures/nanopart.tga" -local LOS_FILTER = true -- drop emissions outside our LOS +local NANO_TEXTURE = "bitmaps/projectiletextures/nanopart.tga" +local LOS_FILTER = true -- drop emissions outside our LOS -- Render mode: "shape" (3D polyhedra via geometry shader; specific shape in -- MODE_SETTINGS). Driven by the "NanoParticleMode" springsetting (gfx options UI): @@ -132,11 +134,10 @@ end local NANO_PARTICLE_MODE = Spring.GetConfigInt("NanoParticleMode", 1) local RENDER_MODE = "shape" - -- Color brightness equalization, in [0..1]: -local NanoParticleColorEqualize = 0.7 -- [0..1] +local NanoParticleColorEqualize = 0.7 -- [0..1] -- Global unit particle rate/amount multiplier. 1.0 = unchanged. 0.5 = half particles per unit -local NanoParticleRate = 0.4 -- [0..1] +local NanoParticleRate = 0.4 -- [0..1] -- Reclaiming units: tighten target-radius spawn spread so the cloud doesn't -- fill the whole unit footprint. 0.6 = 40% less spread. local RECLAIM_UNIT_JITTER_SCALE = 0.6 @@ -146,7 +147,9 @@ local RECLAIM_UNIT_JITTER_SCALE = 0.6 local NanoParticleResurrectExtraRate = 0.5 local function takeScaledEmitCount(info, accumKey, emits, scale) - if emits <= 0 or not scale or scale <= 0 then return 0 end + if emits <= 0 or not scale or scale <= 0 then + return 0 + end local accum = (info[accumKey] or 0) + emits * scale local out = mathFloor(accum) info[accumKey] = accum - out @@ -157,35 +160,38 @@ end -- isolation. local MODE_SETTINGS = { shape = { - shape = "cube", -- "cube" | "octahedron" - drawRadius = 1.5, -- shape spans ~2*drawRadius edge-to-edge - nanoAlpha = 50 / 255, - dirJitter = 0.10, -- chunks read better with less spread + shape = "cube", -- "cube" | "octahedron" + drawRadius = 1.5, -- shape spans ~2*drawRadius edge-to-edge + nanoAlpha = 50 / 255, + dirJitter = 0.10, -- chunks read better with less spread -- Shapes benefit from visible variation -- they read as discrete chunks. - sizeVar = 0.3, - speedVar = 0.14, - alphaVar = 2.5, + sizeVar = 0.3, + speedVar = 0.14, + alphaVar = 2.5, -- View-dependent face shading: 0 = flat, 1 = full 3D depth (back faces visible-but-dimmed). cubeShowInside = 4.0, - cubeNoise = 6, - cubeNoiseSpeed = 25.0, - cubeNoiseScale = 1.75, - whiteHotspot = 1.5, + cubeNoise = 6, + cubeNoiseSpeed = 25.0, + cubeNoiseScale = 1.75, + whiteHotspot = 1.5, whiteHotspotThreshold = 0.6, -- GS adds its own per-axis 3D tumble, so base 2D rotation can be slower. - rotValBase = -180, rotValRange = 360, - rotVelBase = -40, rotVelRange = 80, - rotAccBase = -40, rotAccRange = 80, + rotValBase = -180, + rotValRange = 360, + rotVelBase = -40, + rotVelRange = 80, + rotAccBase = -40, + rotAccRange = 80, glowIntensity = 0.15, glowFalloff = 9.5, glowScale = 11.0, - glowBreath = 4.0, + glowBreath = 4.0, glowBreathFreq = 2.0, - glowBreathVar = 0.5, -- ± per-particle amplitude variation (0..1 fraction) - glowBreathFreqVar = 0.5, -- ± per-particle frequency variation (0..1 fraction) + glowBreathVar = 0.5, -- ± per-particle amplitude variation (0..1 fraction) + glowBreathFreqVar = 0.5, -- ± per-particle frequency variation (0..1 fraction) -- Energy enhancement (sizePulse not wired through GS; halo+jitter+breath suffice). - coreBoost = 0.3, -- multiplies face shading; modest so dark faces still read - hueJitter = 0.1, + coreBoost = 0.3, -- multiplies face shading; modest so dark faces still read + hueJitter = 0.1, }, } @@ -194,9 +200,9 @@ local MODE_SETTINGS = { -- the fade. Different values per emission type so reclaim doesn't fade as it -- lands on the builder, while repair gets a soft tail-off and target-death -- gets a snappier dissolve. -local FADE_FRAMES_REPAIR = 4 -- gentle polish on outbound repair/capture -local FADE_FRAMES_RECLAIM = 3 -- no fade -- particles converge fully -local FADE_FRAMES_DEATH = 35 -- dissolve when target unit dies or fully repaired +local FADE_FRAMES_REPAIR = 4 -- gentle polish on outbound repair/capture +local FADE_FRAMES_RECLAIM = 3 -- no fade -- particles converge fully +local FADE_FRAMES_DEATH = 35 -- dissolve when target unit dies or fully repaired -- Reclaim-completion burst: when a tracked unit finishes being reclaimed by -- our builders, spit a one-shot cluster of inverse particles emanating from @@ -205,17 +211,17 @@ local FADE_FRAMES_DEATH = 35 -- dissolve when target unit dies or fully repa -- Particle count is logarithmic in the unit's metal cost AND scales with the -- number of active reclaimers: each builder contributes its own share, so a -- solo reclaimer fires a modest puff while a coordinated swarm fires much more. -local RECLAIM_BURST_BASE = 1 -- particles per builder regardless of unit cost (the minimum each builder adds) -local RECLAIM_BURST_LOG_K = 40 -- controls how quickly each builder's share grows as units get more expensive. - -- raise to get more particles on mid/high-cost units; lower to flatten the curve. -local RECLAIM_BURST_LOG_NORM = 250 -- the "cheap" threshold: units at or below this metal cost produce close to - -- RECLAIM_BURST_BASE particles per builder. Units significantly above it start climbing. - -- raise to shift the ramp toward more expensive units; lower to ramp up sooner. -local RECLAIM_BURST_BUILDER_EXP = 0.5 -- sub-linear exponent for builder count: total = perBuilder * nb^EXP. - -- 1.0 = fully linear (4 reclaimers → 4× particles), 0.5 = square-root curve. - -- 0.7 is a reasonable middle ground. -local RECLAIM_BURST_MAX = 1500 -- absolute hard cap on total particles across all builders combined -local RECLAIM_BURST_VOL_FRAC = 0.55 -- spawn within this fraction of collvol radius +local RECLAIM_BURST_BASE = 1 -- particles per builder regardless of unit cost (the minimum each builder adds) +local RECLAIM_BURST_LOG_K = 40 -- controls how quickly each builder's share grows as units get more expensive. +-- raise to get more particles on mid/high-cost units; lower to flatten the curve. +local RECLAIM_BURST_LOG_NORM = 250 -- the "cheap" threshold: units at or below this metal cost produce close to +-- RECLAIM_BURST_BASE particles per builder. Units significantly above it start climbing. +-- raise to shift the ramp toward more expensive units; lower to ramp up sooner. +local RECLAIM_BURST_BUILDER_EXP = 0.5 -- sub-linear exponent for builder count: total = perBuilder * nb^EXP. +-- 1.0 = fully linear (4 reclaimers → 4× particles), 0.5 = square-root curve. +-- 0.7 is a reasonable middle ground. +local RECLAIM_BURST_MAX = 1500 -- absolute hard cap on total particles across all builders combined +local RECLAIM_BURST_VOL_FRAC = 0.55 -- spawn within this fraction of collvol radius -- Skip forward-homing registration when the target unit is still being built -- (buildProgress < 1). Avoids the visually odd effect of particles chasing a @@ -226,7 +232,7 @@ local RECLAIM_BURST_VOL_FRAC = 0.55 -- spawn within this fraction of collvol -- complete, so the final few particles emitted as the unit rolls off the -- factory pad don't suddenly start chasing it. local HOMING_SKIP_INCOMPLETE = true -local HOMING_SKIP_GRACE_FRAMES = 60 -- ~2s at 30Hz +local HOMING_SKIP_GRACE_FRAMES = 60 -- ~2s at 30Hz -- Range gating for emission. Builders normally only emit when the target is -- within buildDistance, but fast targets (planes, jumpjets) can leave that @@ -252,62 +258,62 @@ local EMIT_REF_BUILDSPEED = 100 -- player still sees that something is happening (e.g. repair/build progressing -- on a tiny fraction of buildpower). The forced emit is debited from the -- accumulator so long-term proportionality is preserved. -local FEEDBACK_EMIT_MIN_GAP = 60 -- ~2s at 30 sim Hz +local FEEDBACK_EMIT_MIN_GAP = 60 -- ~2s at 30 sim Hz -- Throttling knobs. These trade a small amount of visual latency for a large -- CPU win in builder-heavy games (hundreds of active nanos): -- * HOMING_RUN_EVERY: run per-frame in-place re-aim every Nth frame instead -- of every frame. Particle speed is small vs typical unit movement over -- 1-2 frames so this is visually identical. -local LOS_CACHE_FRAMES = 7 +local LOS_CACHE_FRAMES = 7 -- When an enemy builder is detected by radar/sonar but not visually visible -- (e.g. a submarine), show only this fraction of its particles. Gives a -- subtle hint that something is happening there without revealing full detail. -- Set to 0 to suppress entirely when only detected, 1.0 to show in full. -local ENEMY_RADAR_EMIT_SCALE = 0.20 -local HOMING_RUN_EVERY = 4 +local ENEMY_RADAR_EMIT_SCALE = 0.20 +local HOMING_RUN_EVERY = 4 -- Repair-completion poll cadence (sim frames). At 2Hz, HP/buildProgress polls -- are visually indistinguishable from per-pass and cut Spring->C calls by ~80% -- in mass-repair scenarios. UnitFinished/UnitDestroyed callins fade -- immediately, so this only catches the slow "repaired to full HP" edge. -local HEALTH_CHECK_EVERY = 15 +local HEALTH_CHECK_EVERY = 15 -- Run the per-frame builder scan only every Nth sim frame. Scales with pool -- saturation: empty -> every frame, full -> every MAX_SCAN_RUN_EVERY frames -- (the saturation gate would drop most emissions anyway). Per-builder emit -- count is multiplied by the chosen value so total emission rate is preserved. -local MIN_SCAN_RUN_EVERY = 1 -local MAX_SCAN_RUN_EVERY = 3 +local MIN_SCAN_RUN_EVERY = 1 +local MAX_SCAN_RUN_EVERY = 3 -- Cache lifetime for spGetUnitCurrentBuildPower. Only trusted while bp > 0 -- (continuous-build steady state where stale samples are harmless). Idle -- visits always re-fetch so 0 -> non-zero edges fire on the next visit. The -- emit accumulator absorbs the worst-case over-emit on the falling edge. -local BUILD_POWER_CACHE_FRAMES = 8 +local BUILD_POWER_CACHE_FRAMES = 8 -- Forward homing: skip per-particle re-aim once a target has been stationary -- this many homing passes. Spawn-time aim is correct as long as the target -- hasn't moved, collapsing repair-of-static-unit cases to a near-no-op. -local STATIONARY_SKIP_AFTER = 4 +local STATIONARY_SKIP_AFTER = 4 -- Off-screen emission throttle. Builders whose spray endpoints are outside -- the view frustum keep only this fraction of emissions. Frustum visibility -- is cached for OFFSCREEN_VIS_CACHE_FRAMES (camera moves slowly vs emit rate). -- Keep-fraction scales with pool saturation: MAX at/below SAT_PIVOT, ramping -- linearly to MIN at full saturation. -local OFFSCREEN_EMIT_KEEP_MAX = 0.4 -local OFFSCREEN_EMIT_KEEP_MIN = 0.20 +local OFFSCREEN_EMIT_KEEP_MAX = 0.4 +local OFFSCREEN_EMIT_KEEP_MIN = 0.20 local OFFSCREEN_EMIT_KEEP_SAT_PIVOT = 0.25 -local OFFSCREEN_EMIT_KEEP_BAND_INV = 1.0 / (1.0 - OFFSCREEN_EMIT_KEEP_SAT_PIVOT) +local OFFSCREEN_EMIT_KEEP_BAND_INV = 1.0 / (1.0 - OFFSCREEN_EMIT_KEEP_SAT_PIVOT) local OFFSCREEN_VIS_CACHE_FRAMES = 6 -- Distance-based emission throttle. Linear keep-fraction ramp from 1.0 at -- DISTANT_EMIT_NEAR_RANGE down to DISTANT_EMIT_KEEP at DISTANT_EMIT_RANGE. -- Composes with the offscreen gate. Two squared-distance compares + lerp per -- emission; camera position sampled once per scan frame. -local DISTANT_EMIT_KEEP = 0.25 -local DISTANT_EMIT_NEAR_RANGE = 2500 -- elmos: full emission inside this -local DISTANT_EMIT_RANGE = 9000 -- elmos: floor reached at this +local DISTANT_EMIT_KEEP = 0.25 +local DISTANT_EMIT_NEAR_RANGE = 2500 -- elmos: full emission inside this +local DISTANT_EMIT_RANGE = 9000 -- elmos: floor reached at this -- Precomputed at file load (DISTANT_EMIT_* are constants). -local DISTANT_EMIT_NEAR_SQ = DISTANT_EMIT_NEAR_RANGE * DISTANT_EMIT_NEAR_RANGE -local DISTANT_EMIT_FAR_SQ = DISTANT_EMIT_RANGE * DISTANT_EMIT_RANGE +local DISTANT_EMIT_NEAR_SQ = DISTANT_EMIT_NEAR_RANGE * DISTANT_EMIT_NEAR_RANGE +local DISTANT_EMIT_FAR_SQ = DISTANT_EMIT_RANGE * DISTANT_EMIT_RANGE local DISTANT_EMIT_BAND_INV = 1.0 / (DISTANT_EMIT_FAR_SQ - DISTANT_EMIT_NEAR_SQ) -local DISTANT_EMIT_DROP = 1.0 - DISTANT_EMIT_KEEP +local DISTANT_EMIT_DROP = 1.0 - DISTANT_EMIT_KEEP -- Dynamic scan stride: builders are scanned 1/stride per sim frame. Per-builder -- emit count is multiplied by stride so total rate is preserved. Grows with @@ -316,7 +322,7 @@ local MIN_SCAN_STRIDE = 1 local MAX_SCAN_STRIDE = 2 -- Engine constants (rts/Sim/Projectiles/ProjectileHandler.cpp) -local NANO_SPEED = 4.0 -- engine default: 3.0 +local NANO_SPEED = 4.0 -- engine default: 3.0 -- Anti-clump: half-width (elmos) of the symmetric stagger window around the -- nanopiece. Particles in a batch are spread along their velocity in @@ -352,7 +358,7 @@ end -- The engine API takes rotVel in deg/sec and rotAcc in deg/sec^2 and internally -- divides by GAME_SPEED to convert to per-frame units. We integrate per-frame in -- the shader, so apply the same conversion here. -local GAME_SPEED = Game.gameSpeed or 30 +local GAME_SPEED = Game.gameSpeed or 30 -- All mode-derived constants live on this single table (`U` = "uniforms") -- instead of as ~30 separate top-level locals. The 200 active-locals limit on @@ -365,19 +371,19 @@ local U = {} -- Optional terrain clamp for particle paths. Disabled by default because it -- adds extra ground-height queries in hot paths. U.GROUND_CLAMP_ENABLED = true -U.GROUND_CLAMP_MARGIN = 11.0 +U.GROUND_CLAMP_MARGIN = 11.0 -- In-flight correction cadence. Enabled mode can periodically reproject active -- particles above terrain to prevent straight-line tunneling through cliffs. -- 0 means "all active particles each pass". -U.GROUND_CLAMP_RUN_EVERY = 6 +U.GROUND_CLAMP_RUN_EVERY = 6 U.GROUND_CLAMP_MAX_PER_STEP = 0 -U.GROUND_CLAMP_RECHECK_HIT = 6 +U.GROUND_CLAMP_RECHECK_HIT = 6 U.GROUND_CLAMP_RECHECK_MISS = 12 U.GROUND_CLAMP_USE_WAYPOINT = true -- Smart gate: only enable clamp for builders/targets in rough terrain. -U.GROUND_CLAMP_SMART = true -U.GROUND_CLAMP_SMART_DELTA = 4.0 -U.GROUND_CLAMP_SMART_RADIUS = 128.0 +U.GROUND_CLAMP_SMART = true +U.GROUND_CLAMP_SMART_DELTA = 4.0 +U.GROUND_CLAMP_SMART_RADIUS = 128.0 U.GROUND_CLAMP_SMART_CACHE_FRAMES = 45 U.GROUND_CACHE_INV_CELL = 1 / 16 @@ -417,16 +423,26 @@ local function getGroundYMargin(x, z, frame) end local function clampYAboveGround(x, y, z, frame) - if not U.GROUND_CLAMP_ENABLED then return y end + if not U.GROUND_CLAMP_ENABLED then + return y + end local gy = getGroundYMargin(x, z, frame) - if y < gy then return gy end + if y < gy then + return gy + end return y end local function shouldClampEmit(builderID, sx, sy, sz, ex, ey, ez, frame) - if not U.GROUND_CLAMP_ENABLED then return false end - if not U.GROUND_CLAMP_SMART then return true end - if CLAMP_DEBUG then clampDbg.emitChecks = clampDbg.emitChecks + 1 end + if not U.GROUND_CLAMP_ENABLED then + return false + end + if not U.GROUND_CLAMP_SMART then + return true + end + if CLAMP_DEBUG then + clampDbg.emitChecks = clampDbg.emitChecks + 1 + end local qex = mathFloor(ex * U.GROUND_CACHE_INV_CELL + 0.5) local qez = mathFloor(ez * U.GROUND_CACHE_INV_CELL + 0.5) local targetKey = qex * U.GROUND_CACHE_STRIDE + qez @@ -446,24 +462,39 @@ local function shouldClampEmit(builderID, sx, sy, sz, ex, ey, ez, frame) for i = 1, n do local t if longPath then - if i == 1 then t = 0.12 - elseif i == 2 then t = 0.22 - elseif i == 3 then t = 0.35 - elseif i == 4 then t = 0.50 - elseif i == 5 then t = 0.65 - elseif i == 6 then t = 0.78 - elseif i == 7 then t = 0.90 - else t = 0.96 end + if i == 1 then + t = 0.12 + elseif i == 2 then + t = 0.22 + elseif i == 3 then + t = 0.35 + elseif i == 4 then + t = 0.50 + elseif i == 5 then + t = 0.65 + elseif i == 6 then + t = 0.78 + elseif i == 7 then + t = 0.90 + else + t = 0.96 + end else - if i == 1 then t = 0.35 - elseif i == 2 then t = 0.50 - else t = 0.65 end + if i == 1 then + t = 0.35 + elseif i == 2 then + t = 0.50 + else + t = 0.65 + end end local mx = sx + dx * t local mz = sz + dz * t local my = sy + dy * t local gy = getGroundYMargin(mx, mz, frame) - if gy > guideY then guideY = gy end + if gy > guideY then + guideY = gy + end local pen = gy - my if pen > maxPen then maxPen = pen @@ -471,7 +502,9 @@ local function shouldClampEmit(builderID, sx, sy, sz, ex, ey, ez, frame) end end local enable = maxPen > delta - if CLAMP_DEBUG and enable then clampDbg.emitEnabled = clampDbg.emitEnabled + 1 end + if CLAMP_DEBUG and enable then + clampDbg.emitEnabled = clampDbg.emitEnabled + 1 + end U._groundClampGateCache[builderID] = { frame, enable, targetKey, guideY, peakT } return enable, guideY, peakT end @@ -498,7 +531,9 @@ local function registerGroundClampParticle(id, death, wp, fx, fy, fz, targetID) entry.targetID = targetID entry.next = wp or 0 groundClampParticles[#groundClampParticles + 1] = entry - if CLAMP_DEBUG then clampDbg.registered = clampDbg.registered + 1 end + if CLAMP_DEBUG then + clampDbg.registered = clampDbg.registered + 1 + end end -- Populate every mode-derived value from MODE_SETTINGS[name]. Called once at @@ -506,38 +541,38 @@ end -- (callers are responsible for tearing down / rebuilding GL objects via -- cleanupGL4 + initGL4 since the shader pair depends on RENDER_MODE). local function applyRenderMode(name) - RENDER_MODE = name - local MODE = MODE_SETTINGS[name] or MODE_SETTINGS.shape - U.DRAW_RADIUS = MODE.drawRadius - U.DIR_JITTER = MODE.dirJitter - U.NANO_ALPHA = MODE.nanoAlpha - U.SIZE_VAR = MODE.sizeVar or 0.0 - U.SPEED_VAR = MODE.speedVar or 0.0 - U.ALPHA_VAR = MODE.alphaVar or 0.0 - U.CUBE_SHOW_INSIDE = MODE.cubeShowInside or 0.0 - U.CUBE_NOISE = MODE.cubeNoise or 0.0 - U.CUBE_NOISE_SPEED = MODE.cubeNoiseSpeed or 0.0 - U.CUBE_NOISE_SCALE = MODE.cubeNoiseScale or 0.5 - U.GLOW_SCALE = MODE.glowScale or 1.0 - U.GLOW_INTENSITY = MODE.glowIntensity or 0.0 - U.GLOW_FALLOFF = MODE.glowFalloff or 2.0 - U.CORE_BOOST = MODE.coreBoost or 1.0 - U.HUE_JITTER = MODE.hueJitter or 0.0 - U.GLOW_BREATH = MODE.glowBreath or 0.0 - U.GLOW_BREATH_FREQ = MODE.glowBreathFreq or 0.0 - U.GLOW_BREATH_VAR = MODE.glowBreathVar or 0.0 - U.GLOW_BREATH_FREQ_VAR = MODE.glowBreathFreqVar or 0.0 - U.SIZE_PULSE_AMP = MODE.sizePulseAmp or 0.0 - U.SIZE_PULSE_FREQ = MODE.sizePulseFreq or 0.0 - U.WHITE_HOTSPOT = MODE.whiteHotspot or 0.0 + RENDER_MODE = name + local MODE = MODE_SETTINGS[name] or MODE_SETTINGS.shape + U.DRAW_RADIUS = MODE.drawRadius + U.DIR_JITTER = MODE.dirJitter + U.NANO_ALPHA = MODE.nanoAlpha + U.SIZE_VAR = MODE.sizeVar or 0.0 + U.SPEED_VAR = MODE.speedVar or 0.0 + U.ALPHA_VAR = MODE.alphaVar or 0.0 + U.CUBE_SHOW_INSIDE = MODE.cubeShowInside or 0.0 + U.CUBE_NOISE = MODE.cubeNoise or 0.0 + U.CUBE_NOISE_SPEED = MODE.cubeNoiseSpeed or 0.0 + U.CUBE_NOISE_SCALE = MODE.cubeNoiseScale or 0.5 + U.GLOW_SCALE = MODE.glowScale or 1.0 + U.GLOW_INTENSITY = MODE.glowIntensity or 0.0 + U.GLOW_FALLOFF = MODE.glowFalloff or 2.0 + U.CORE_BOOST = MODE.coreBoost or 1.0 + U.HUE_JITTER = MODE.hueJitter or 0.0 + U.GLOW_BREATH = MODE.glowBreath or 0.0 + U.GLOW_BREATH_FREQ = MODE.glowBreathFreq or 0.0 + U.GLOW_BREATH_VAR = MODE.glowBreathVar or 0.0 + U.GLOW_BREATH_FREQ_VAR = MODE.glowBreathFreqVar or 0.0 + U.SIZE_PULSE_AMP = MODE.sizePulseAmp or 0.0 + U.SIZE_PULSE_FREQ = MODE.sizePulseFreq or 0.0 + U.WHITE_HOTSPOT = MODE.whiteHotspot or 0.0 U.WHITE_HOTSPOT_THRESHOLD = MODE.whiteHotspotThreshold or 0.7 - U.SHAPE_ID = SHAPE_IDS[MODE.shape or "cube"] or 0 - U.ROT_VAL_BASE = MODE.rotValBase - U.ROT_VEL_BASE = MODE.rotVelBase / GAME_SPEED - U.ROT_ACC_BASE = MODE.rotAccBase / (GAME_SPEED * GAME_SPEED) - U.ROT_VAL_RANGE = MODE.rotValRange - U.ROT_VEL_RANGE = MODE.rotVelRange / GAME_SPEED - U.ROT_ACC_RANGE = MODE.rotAccRange / (GAME_SPEED * GAME_SPEED) + U.SHAPE_ID = SHAPE_IDS[MODE.shape or "cube"] or 0 + U.ROT_VAL_BASE = MODE.rotValBase + U.ROT_VEL_BASE = MODE.rotVelBase / GAME_SPEED + U.ROT_ACC_BASE = MODE.rotAccBase / (GAME_SPEED * GAME_SPEED) + U.ROT_VAL_RANGE = MODE.rotValRange + U.ROT_VEL_RANGE = MODE.rotVelRange / GAME_SPEED + U.ROT_ACC_RANGE = MODE.rotAccRange / (GAME_SPEED * GAME_SPEED) end applyRenderMode(RENDER_MODE) @@ -548,7 +583,7 @@ applyRenderMode(RENDER_MODE) local nanoVBO local nanoShader -local lastLosUniform = -1 -- cache to skip redundant SetUniform calls +local lastLosUniform = -1 -- cache to skip redundant SetUniform calls -- Active particle bookkeeping. The InstanceVBOTable instanceID is our handle. local nextID = 1 @@ -557,11 +592,11 @@ local nextID = 1 -- Cull walks the bucket for the current frame only -> O(deaths/frame) instead -- of O(live) per cull pass. local deathBuckets = {} -local liveCount = 0 -- approximate live (incremented on spawn, decremented on cull) +local liveCount = 0 -- approximate live (incremented on spawn, decremented on cull) -- Shared scratch table reused for every pushElementInstance call -- avoids -- allocating a fresh 16-element array per spawn (thousands per second). -local instanceScratch = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 } +local instanceScratch = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } -- Per-builder cache: avoids re-fetching nano pieces / team color every frame. -- builderID -> info table, or false sentinel for non-builders / teamless units. @@ -571,32 +606,32 @@ local builderCache = {} -- Maintained via Unit{Created,Finished,Destroyed,Given,Taken,EnteredLos} callins. -- Stored as both a hash (for O(1) membership tests) and an array (for fast -- numeric-for iteration in the per-frame scan). -local trackedBuilders = {} -- unitID -> arrayIndex (also used as membership set) -local trackedBuildersList = {} -- arrayIndex -> unitID +local trackedBuilders = {} -- unitID -> arrayIndex (also used as membership set) +local trackedBuildersList = {} -- arrayIndex -> unitID -- Forward declaration so the Initialize/GameFrame callins can call into it. local trackUnit -- Cached visibility state -local cachedAllyTeamID = Spring.GetMyAllyTeamID() +local cachedAllyTeamID = Spring.GetMyAllyTeamID() local cachedSpecFullView = false -- Debug instrumentation: timers + per-30f Echo. Toggle to true to profile. -local DEBUG = false -local _dbgFrame = 0 -local _dbgEmits = 0 +local DEBUG = false +local _dbgFrame = 0 +local _dbgEmits = 0 local _dbgBuilders = 0 local _dbgWithTask = 0 -local _dbgTRescan = 0 -- GetAllUnits rescan time -local _dbgTScan = 0 -- scanBuilders time -local _dbgTCull = 0 -- cullDead time -local _dbgTDraw = 0 -- DrawWorld time (incl. cull) -local _dbgDraws = 0 +local _dbgTRescan = 0 -- GetAllUnits rescan time +local _dbgTScan = 0 -- scanBuilders time +local _dbgTCull = 0 -- cullDead time +local _dbgTDraw = 0 -- DrawWorld time (incl. cull) +local _dbgDraws = 0 local function refreshSpec() local spec, fullView = Spring.GetSpectatingState() cachedSpecFullView = spec and fullView - cachedAllyTeamID = Spring.GetMyAllyTeamID() + cachedAllyTeamID = Spring.GetMyAllyTeamID() end -- High gamespeed throttle. When the engine runs faster than 1x (catchup after @@ -604,11 +639,11 @@ end -- can dominate the Lua budget. Ramps from 0 at *_START to 1 at *_FULL and is -- used at scan time to cap effective particle pool and cut emitProb. -- Refreshed in GameFrame on a 1s cadence (cheap, one Spring.GetGameSpeed call). -local GAMESPEED_THROTTLE_START = 1.5 -- below this, no extra throttle -local GAMESPEED_THROTTLE_FULL = 5.0 -- at or above this, full throttle -local GAMESPEED_EMIT_CUT = 0.66 -- emitProb cut at full throttle (0..1) -local GAMESPEED_MAX_CUT = 0.85 -- effective-max cut at full throttle (0..1) -local speedThrottle = 0.0 -- 0 = none, 1 = max (set in GameFrame) +local GAMESPEED_THROTTLE_START = 1.5 -- below this, no extra throttle +local GAMESPEED_THROTTLE_FULL = 5.0 -- at or above this, full throttle +local GAMESPEED_EMIT_CUT = 0.66 -- emitProb cut at full throttle (0..1) +local GAMESPEED_MAX_CUT = 0.85 -- effective-max cut at full throttle (0..1) +local speedThrottle = 0.0 -- 0 = none, 1 = max (set in GameFrame) local function refreshSpeedThrottle() local _, speedFactor = Spring.GetGameSpeed() @@ -616,9 +651,12 @@ local function refreshSpeedThrottle() speedThrottle = 0.0 return end - local t = (speedFactor - GAMESPEED_THROTTLE_START) - / (GAMESPEED_THROTTLE_FULL - GAMESPEED_THROTTLE_START) - if t < 0 then t = 0 elseif t > 1 then t = 1 end + local t = (speedFactor - GAMESPEED_THROTTLE_START) / (GAMESPEED_THROTTLE_FULL - GAMESPEED_THROTTLE_START) + if t < 0 then + t = 0 + elseif t > 1 then + t = 1 + end speedThrottle = t end @@ -1068,14 +1106,7 @@ local function initGL4() gsSrc = gsSrcCube, shaderName = "NanoParticlesGL4_Shape", uniformInt = { infoTex = 1, u_shape = U.SHAPE_ID }, - uniformFloat = { losAlwaysVisible = 0, drawRadius = U.DRAW_RADIUS, cubeShowInside = U.CUBE_SHOW_INSIDE, - cubeNoise = U.CUBE_NOISE, cubeNoiseSpeed = U.CUBE_NOISE_SPEED, cubeNoiseScale = U.CUBE_NOISE_SCALE, - glowScale = U.GLOW_SCALE, glowIntensity = U.GLOW_INTENSITY, glowFalloff = U.GLOW_FALLOFF, - coreBoost = U.CORE_BOOST, - hueJitter = U.HUE_JITTER, glowBreath = U.GLOW_BREATH, glowBreathFreq = U.GLOW_BREATH_FREQ, - glowBreathVar = U.GLOW_BREATH_VAR, glowBreathFreqVar = U.GLOW_BREATH_FREQ_VAR, - sizePulseAmp = U.SIZE_PULSE_AMP, sizePulseFreq = U.SIZE_PULSE_FREQ, - whiteHotspot = U.WHITE_HOTSPOT, whiteHotspotThreshold = U.WHITE_HOTSPOT_THRESHOLD }, + uniformFloat = { losAlwaysVisible = 0, drawRadius = U.DRAW_RADIUS, cubeShowInside = U.CUBE_SHOW_INSIDE, cubeNoise = U.CUBE_NOISE, cubeNoiseSpeed = U.CUBE_NOISE_SPEED, cubeNoiseScale = U.CUBE_NOISE_SCALE, glowScale = U.GLOW_SCALE, glowIntensity = U.GLOW_INTENSITY, glowFalloff = U.GLOW_FALLOFF, coreBoost = U.CORE_BOOST, hueJitter = U.HUE_JITTER, glowBreath = U.GLOW_BREATH, glowBreathFreq = U.GLOW_BREATH_FREQ, glowBreathVar = U.GLOW_BREATH_VAR, glowBreathFreqVar = U.GLOW_BREATH_FREQ_VAR, sizePulseAmp = U.SIZE_PULSE_AMP, sizePulseFreq = U.SIZE_PULSE_FREQ, whiteHotspot = U.WHITE_HOTSPOT, whiteHotspotThreshold = U.WHITE_HOTSPOT_THRESHOLD }, shaderConfig = {}, forceupdate = true, } @@ -1118,23 +1149,19 @@ local function initGL4() if useGeometryShader then -- Quad: xy in [-1,1] (corner), uv in [0,1] - local quadVBO, numVertices = InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "nanoQuadVBO" - ) + local quadVBO, numVertices = InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "nanoQuadVBO") -- Shape GS only needs ONE triangle per instance; using the rect's 2-tri -- index buffer would invoke the GS twice per particle. A 3-index VBO -- (the rect's first triangle: bl,tl,tr) cuts GS work in half. local indexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) indexVBO:Define(3) - indexVBO:Upload({0, 1, 2}) + indexVBO:Upload({ 0, 1, 2 }) local layout = { - { id = 1, name = "spawnPosAndSize", size = 4 }, + { id = 1, name = "spawnPosAndSize", size = 4 }, { id = 2, name = "velAndSpawnFrame", size = 4 }, - { id = 3, name = "instColor", size = 4 }, - { id = 4, name = "rotData", size = 4 }, + { id = 3, name = "instColor", size = 4 }, + { id = 4, name = "rotData", size = 4 }, } nanoVBO = InstanceVBOTable.makeInstanceVBOTable(layout, MAX_PARTICLES_VBO, "nanoParticleVBO") if not nanoVBO then @@ -1142,9 +1169,9 @@ local function initGL4() return false end nanoVBO.numVertices = numVertices - nanoVBO.vertexVBO = quadVBO - nanoVBO.indexVBO = indexVBO - nanoVBO.VAO = nanoVBO:makeVAOandAttach(quadVBO, nanoVBO.instanceVBO, indexVBO) + nanoVBO.vertexVBO = quadVBO + nanoVBO.indexVBO = indexVBO + nanoVBO.VAO = nanoVBO:makeVAOandAttach(quadVBO, nanoVBO.instanceVBO, indexVBO) nanoVBO.primitiveType = GL.TRIANGLES else -- No-GS fallback: build a template indexed mesh with one vertex per @@ -1153,12 +1180,12 @@ local function initGL4() -- quad. We use independent triangles, so each template vertex is emitted -- exactly once and indexed in GL order. local NUM_SHAPE_VERTS = 24 - local NUM_GLOW_VERTS = 4 + local NUM_GLOW_VERTS = 4 local NUM_VERTS = NUM_SHAPE_VERTS + NUM_GLOW_VERTS local isOcta = (U.SHAPE_ID == 1) local templateVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - templateVBO:Define(NUM_VERTS, {{ id = 0, name = "vertexSlot", size = 1 }}) -- float slot, cast to int in VS + templateVBO:Define(NUM_VERTS, { { id = 0, name = "vertexSlot", size = 1 } }) -- float slot, cast to int in VS local vertexData = {} for i = 0, NUM_VERTS - 1 do vertexData[#vertexData + 1] = i @@ -1200,10 +1227,10 @@ local function initGL4() indexVBO:Upload(indexData) local layout = { - { id = 1, name = "spawnPosAndSize", size = 4 }, + { id = 1, name = "spawnPosAndSize", size = 4 }, { id = 2, name = "velAndSpawnFrame", size = 4 }, - { id = 3, name = "instColor", size = 4 }, - { id = 4, name = "rotData", size = 4 }, + { id = 3, name = "instColor", size = 4 }, + { id = 4, name = "rotData", size = 4 }, } nanoVBO = InstanceVBOTable.makeInstanceVBOTable(layout, MAX_PARTICLES_VBO, "nanoParticleVBO_NoGS") if not nanoVBO then @@ -1223,7 +1250,7 @@ local function initGL4() -- reference the GC can finalize the userdata and delete the GL buffers -- (fixed in commit 2b51f6e863 for DrawPrimitiveAtUnit). nanoVBO.nogsTemplateVBO = templateVBO - nanoVBO.nogsIndexVBO = indexVBO + nanoVBO.nogsIndexVBO = indexVBO local indexCount = #indexData nanoVBO.VAO = { @@ -1250,7 +1277,10 @@ local function initGL4() end local function cleanupGL4() - if nanoVBO then nanoVBO:Delete(); nanoVBO = nil end + if nanoVBO then + nanoVBO:Delete() + nanoVBO = nil + end end -------------------------------------------------------------------------------- @@ -1271,7 +1301,7 @@ for udid, def in pairs(UnitDefs) do if def.canFly then isAirUnitDef[udid] = true end - if ((def.maxVelocity or def.speed or 0) > 0) and (not def.isFactory) then + if ((def.maxVelocity or def.speed or 0) > 0) and not def.isFactory then isMobileUnitDef[udid] = true end end @@ -1280,21 +1310,29 @@ end -- Colors can change mid-game (commshare, alliance, modoptions), so a periodic -- refresh in GameFrame re-fetches every cached team and propagates any change -- into the per-builder info entries via builderCacheByTeam[team] = {info, ...}. -local teamColorCache = {} -local builderCacheByTeam = {} -- teamID -> array of info tables (for color propagation) +local teamColorCache = {} +local builderCacheByTeam = {} -- teamID -> array of info tables (for color propagation) local function equalizeColor(r, g, b) local eq = NanoParticleColorEqualize or 0.0 - if eq <= 0.0 or not (r and g and b) then return r, g, b end + if eq <= 0.0 or not (r and g and b) then + return r, g, b + end local luma = 0.2126 * r + 0.7152 * g + 0.0722 * b - if luma < 0.001 then return r, g, b end + if luma < 0.001 then + return r, g, b + end local scale = (0.55 / luma) ^ eq local nr, ng, nb = r * scale, g * scale, b * scale -- If any channel would clip past 1.0, dampen the whole vector so we keep -- the original hue (uniform desaturation toward white would shift hue). local m = nr - if ng > m then m = ng end - if nb > m then m = nb end + if ng > m then + m = ng + end + if nb > m then + m = nb + end if m > 1.0 then local k = 1.0 / m nr, ng, nb = nr * k, ng * k, nb * k @@ -1304,7 +1342,9 @@ end local function getTeamColor(team) local c = teamColorCache[team] - if c then return c[1], c[2], c[3] end + if c then + return c[1], c[2], c[3] + end local r, g, b = spGetTeamColor(team) r, g, b = equalizeColor(r, g, b) teamColorCache[team] = { r, g, b } @@ -1341,8 +1381,12 @@ local function refreshTeamColors() local scale = 0.55 / luma lr, lg, lb = r * scale, g * scale, b * scale local m = lr - if lg > m then m = lg end - if lb > m then m = lb end + if lg > m then + m = lg + end + if lb > m then + m = lb + end if m > 1.0 then local k = 1.0 / m lr, lg, lb = lr * k, lg * k, lb * k @@ -1353,8 +1397,12 @@ local function refreshTeamColors() if infos then for i = 1, #infos do local info = infos[i] - info.r = r; info.g = g; info.b = b - info.lr = lr; info.lg = lg; info.lb = lb + info.r = r + info.g = g + info.b = b + info.lr = lr + info.lg = lg + info.lb = lb end end end @@ -1370,14 +1418,24 @@ end teamColorCache.__lastEqualize = NanoParticleColorEqualize local function refreshColorEqualize() local v = NanoParticleColorEqualize or 0.0 - if type(v) ~= "number" then v = 0.0 end - if v < 0.0 then v = 0.0 end - if v > 1.0 then v = 1.0 end + if type(v) ~= "number" then + v = 0.0 + end + if v < 0.0 then + v = 0.0 + end + if v > 1.0 then + v = 1.0 + end NanoParticleColorEqualize = v - if v == teamColorCache.__lastEqualize then return false end + if v == teamColorCache.__lastEqualize then + return false + end teamColorCache.__lastEqualize = v for team in pairs(teamColorCache) do - if team ~= "__lastEqualize" then teamColorCache[team] = nil end + if team ~= "__lastEqualize" then + teamColorCache[team] = nil + end end return true end @@ -1387,7 +1445,7 @@ end -- per frame from the same piece, and even cycles a small set of pieces. Cache -- by (builderID, pieceIdx) for the duration of one scan frame; invalidated by -- bumping the epoch each frame instead of clearing the table. -local piecePosCache = {} -- key = builderID * 256 + pieceIdx -> [epoch, x, y, z] +local piecePosCache = {} -- key = builderID * 256 + pieceIdx -> [epoch, x, y, z] local piecePosEpoch = 0 -- Per-frame target position cache for the emit path. Many builders frequently @@ -1404,16 +1462,16 @@ local emitTargetPosCache = {} -- spawnFrame = current frame. Death stays the same. -- homingByBuilder[builderID] = { {id=, pieceIdx=, death=}, ... } local homingByBuilder = {} -local HOMING_MAX_PER_BUILDER = 96 -- safety cap; oldest entries drop off +local HOMING_MAX_PER_BUILDER = 96 -- safety cap; oldest entries drop off -- Forward homing: outbound particles aimed at a UNIT target (repair, capture) -- bend toward the target's CURRENT mid-position. Same rewrite trick as inverse. -- Keyed by target so each target's position resolves once per frame. -- homingFwdByTarget[targetUnitID] = { {id=, death=}, ... } local homingFwdByTarget = {} -local targetPosCache = {} -- unitID -> [epoch, x, y, z] +local targetPosCache = {} -- unitID -> [epoch, x, y, z] local targetIncompleteCache = {} -- unitID -> [epoch, isBeingBuilt] -local HOMING_FWD_MAX_PER_TARGET = 192 -- safety cap per repaired/captured unit +local HOMING_FWD_MAX_PER_TARGET = 192 -- safety cap per repaired/captured unit -- Reclaim-completion burst tracking. While a tracked unit is being reclaimed -- by one or more of our builders, we record the builder set so that on @@ -1441,11 +1499,17 @@ local FADE_FWD_MAX_PER_TARGET = HOMING_FWD_MAX_PER_TARGET local function getBuilderInfo(builderID) local cached = builderCache[builderID] - if cached then return cached end + if cached then + return cached + end local udid = spGetUnitDefID(builderID) - if not udid then return nil end - if nonBuilderDefs[udid] then return nil end + if not udid then + return nil + end + if nonBuilderDefs[udid] then + return nil + end local pieces = spGetUnitNanoPieces(builderID) if not pieces or #pieces == 0 then @@ -1454,7 +1518,9 @@ local function getBuilderInfo(builderID) return nil end local team = spGetUnitTeam(builderID) - if not team then return nil end -- transient (e.g. during creation), retry next frame + if not team then + return nil + end -- transient (e.g. during creation), retry next frame local r, g, b = getTeamColor(team) local lr, lg, lb = r, g, b @@ -1464,8 +1530,12 @@ local function getBuilderInfo(builderID) local scale = 0.55 / luma lr, lg, lb = r * scale, g * scale, b * scale local m = lr - if lg > m then m = lg end - if lb > m then m = lb end + if lg > m then + m = lg + end + if lb > m then + m = lb + end if m > 1.0 then local k = 1.0 / m lr, lg, lb = lr * k, lg * k, lb * k @@ -1481,17 +1551,21 @@ local function getBuilderInfo(builderID) buildDistance = nil end local info = { - pieces = pieces, - nPieces = #pieces, - r = r, g = g, b = b, - lr = lr, lg = lg, lb = lb, - team = team, - allyTeam = spGetUnitAllyTeam(builderID), - isFactory = ud and ud.isFactory or false, - isMobile = isMobileUnitDef[udid] and true or false, + pieces = pieces, + nPieces = #pieces, + r = r, + g = g, + b = b, + lr = lr, + lg = lg, + lb = lb, + team = team, + allyTeam = spGetUnitAllyTeam(builderID), + isFactory = ud and ud.isFactory or false, + isMobile = isMobileUnitDef[udid] and true or false, buildDistance = buildDistance, - buildSpeed = (ud and ud.buildSpeed) or 0, - emitAccum = 0, + buildSpeed = (ud and ud.buildSpeed) or 0, + emitAccum = 0, } builderCache[builderID] = info local bucket = builderCacheByTeam[team] @@ -1510,9 +1584,13 @@ end -- emitters are active. local function pickNanoPiece(info) local n = info.nPieces - if n == 1 then return info.pieces[1] end + if n == 1 then + return info.pieces[1] + end local cursor = (info.pieceCursor or 0) + 1 - if cursor > n then cursor = 1 end + if cursor > n then + cursor = 1 + end info.pieceCursor = cursor return info.pieces[cursor] end @@ -1522,7 +1600,9 @@ end -------------------------------------------------------------------------------- local function spawnParticle(px, py, pz, vx, vy, vz, lifetime, r, g, b, frame, fadeFrames, inverse) - if not nanoVBO then return end + if not nanoVBO then + return + end local death = frame + lifetime @@ -1532,21 +1612,35 @@ local function spawnParticle(px, py, pz, vx, vy, vz, lifetime, r, g, b, frame, f -- Per-particle size and alpha jitter. Size is packed into w alongside -- fadeFrames; alpha replaces the flat NANO_ALPHA in the color attribute. - local sizeVar = U.SIZE_VAR + local sizeVar = U.SIZE_VAR local nanoAlpha = U.NANO_ALPHA local alphaVar = U.ALPHA_VAR - local sizeMult = (sizeVar > 0) and (1.0 + sizeVar * (mathRandom() * 2 - 1)) or 1.0 - local alpha = (alphaVar > 0) and (nanoAlpha * (1.0 + alphaVar * (mathRandom() * 2 - 1))) or nanoAlpha - if alpha < 0 then alpha = 0 end + local sizeMult = (sizeVar > 0) and (1.0 + sizeVar * (mathRandom() * 2 - 1)) or 1.0 + local alpha = (alphaVar > 0) and (nanoAlpha * (1.0 + alphaVar * (mathRandom() * 2 - 1))) or nanoAlpha + if alpha < 0 then + alpha = 0 + end local id = nextID nextID = nextID + 1 local s = instanceScratch - s[1]=px; s[2]=py; s[3]=pz; s[4]=packSizeFade(sizeMult, fadeFrames, inverse) - s[5]=vx; s[6]=vy; s[7]=vz; s[8]=frame - s[9]=r; s[10]=g; s[11]=b; s[12]=alpha - s[13]=rotVal; s[14]=rotVel; s[15]=frame; s[16]=death + s[1] = px + s[2] = py + s[3] = pz + s[4] = packSizeFade(sizeMult, fadeFrames, inverse) + s[5] = vx + s[6] = vy + s[7] = vz + s[8] = frame + s[9] = r + s[10] = g + s[11] = b + s[12] = alpha + s[13] = rotVal + s[14] = rotVel + s[15] = frame + s[16] = death if pushElementInstance(nanoVBO, s, id, false, true, nil) then local bucket = deathBuckets[death] @@ -1594,16 +1688,20 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius sx, sy, sz = entry[2], entry[3], entry[4] else sx, sy, sz = spGetUnitPiecePosDir(builderID, pieceIdx) - if not sx then return end + if not sx then + return + end if entry then entry[1] = piecePosEpoch - entry[2] = sx; entry[3] = sy; entry[4] = sz + entry[2] = sx + entry[3] = sy + entry[4] = sz else piecePosCache[key] = { piecePosEpoch, sx, sy, sz } end end - if U.GROUND_CLAMP_ENABLED and (not info.isFactory) then + if U.GROUND_CLAMP_ENABLED and not info.isFactory then clampThisEmit, clampGuideY, clampPeakT = shouldClampEmit(builderID, sx, sy, sz, endX, endY, endZ, frame) if clampThisEmit then endY = clampYAboveGround(endX, endY, endZ, frame) @@ -1611,8 +1709,10 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius end local dx, dy, dz = endX - sx, endY - sy, endZ - sz - local lenSq = dx*dx + dy*dy + dz*dz - if lenSq < 1.0 then return end + local lenSq = dx * dx + dy * dy + dz * dz + if lenSq < 1.0 then + return + end local len = mathSqrt(lenSq) -- Range gate for moving-unit targets. Engine reach is (buildDistance + @@ -1626,9 +1726,11 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius if targetUnitID then local effectiveBD = info.targetMeta and info.targetMeta.effectiveBD if effectiveBD then - local horzLen = mathSqrt(dx*dx + dz*dz) + local horzLen = mathSqrt(dx * dx + dz * dz) local maxLen = effectiveBD * BUILD_RANGE_MAX_EXTENSION - if horzLen > maxLen then return end + if horzLen > maxLen then + return + end if horzLen > effectiveBD then fadeBandKeep = (maxLen - horzLen) / (effectiveBD * (BUILD_RANGE_MAX_EXTENSION - 1.0)) end @@ -1649,7 +1751,7 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius -- LOS check needed at all? Per-particle result is still cached on info -- because position varies for inverse emissions, but most visits skip the -- gate entirely (full view, ally builder, or LOS filter disabled). - local needLosCheck = LOS_FILTER and (not cachedSpecFullView) and (info.allyTeam ~= cachedAllyTeamID) + local needLosCheck = LOS_FILTER and not cachedSpecFullView and (info.allyTeam ~= cachedAllyTeamID) -- Three-tier enemy-builder visibility filter, evaluated once per emitNano -- call and cached for LOS_CACHE_FRAMES frames: @@ -1659,7 +1761,7 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius -- particles as a faint hint; per-particle IsPosInLos cull is skipped -- because the nanopiece/target position may be underwater. -- tier 0 (not detected at all): no particles. - local builderVisTier = 2 -- default: fully visible (only matters when needLosCheck) + local builderVisTier = 2 -- default: fully visible (only matters when needLosCheck) if needLosCheck then local visFrame = info.visCheckFrame if visFrame and (frame - visFrame) < LOS_CACHE_FRAMES then @@ -1673,10 +1775,12 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius -- regardless of higher bits (PREVLOS = 4, CONTRADAR = 8). builderVisTier = (losBits % 4 >= 2) and 1 or 0 end - info.visCheckFrame = frame + info.visCheckFrame = frame info.builderVisTier = builderVisTier end - if builderVisTier == 0 then return end + if builderVisTier == 0 then + return + end end -- Stagger denominator: divide the symmetric spread window @@ -1691,10 +1795,14 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius -- underflow, HOMING_SKIP_INCOMPLETE branches) without aborting the batch. for i = 1, count do repeat - if fadeBandKeep and mathRandom() > fadeBandKeep then break end + if fadeBandKeep and mathRandom() > fadeBandKeep then + break + end -- Radar/sonar-only builder: stochastically drop most particles so -- only a faint ghost-spray hints at the undetected unit's activity. - if builderVisTier == 1 and mathRandom() > ENEMY_RADAR_EMIT_SCALE then break end + if builderVisTier == 1 and mathRandom() > ENEMY_RADAR_EMIT_SCALE then + break + end -- jitter rejection sampling (~1.91 random calls on average) local jx, jy, jz @@ -1702,7 +1810,7 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius jx = mathRandom() * 2 - 1 jy = mathRandom() * 2 - 1 jz = mathRandom() * 2 - 1 - until (jx*jx + jy*jy + jz*jz) <= 1.0 + until (jx * jx + jy * jy + jz * jz) <= 1.0 local fdx = ndx + jx * jitterScale local fdy = ndy + jy * jitterScale local fdz = ndz + jz * jitterScale @@ -1711,10 +1819,14 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius local speedVar = U.SPEED_VAR if speedVar > 0 then speed = NANO_SPEED * (1.0 + speedVar * (mathRandom() * 2 - 1)) - if speed < 0.1 then speed = 0.1 end + if speed < 0.1 then + speed = 0.1 + end end local lifetime = mathCeil(len / speed) - if lifetime < 1 then break end + if lifetime < 1 then + break + end local vx, vy, vz = fdx * speed, fdy * speed, fdz * speed -- Engine (ProjectileHandler::AddNanoParticle, inverse branch): @@ -1746,7 +1858,9 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius if spreadInv > 0 then local tOff = spreadBase + ((i - 1) + mathRandom()) * spreadInv local newLifetime = lifetime - mathFloor(tOff) - if newLifetime < 1 then break end + if newLifetime < 1 then + break + end px = px + vx * tOff py = py + vy * tOff pz = pz + vz * tOff @@ -1765,27 +1879,37 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius visible = info.losVisible else visible = Spring.IsPosInLos(px, py, pz, cachedAllyTeamID) and true or false - info.losFrame = frame + info.losFrame = frame info.losVisible = visible end - if not visible then break end + if not visible then + break + end end local wpFrame, finalX, finalY, finalZ - local useWaypoint = clampThisEmit and U.GROUND_CLAMP_USE_WAYPOINT and clampGuideY and (not inverse) + local useWaypoint = clampThisEmit and U.GROUND_CLAMP_USE_WAYPOINT and clampGuideY and not inverse if useWaypoint then finalX = px + vx * lifetime finalY = py + vy * lifetime finalZ = pz + vz * lifetime local peak = clampPeakT or 0.5 - if peak < 0.15 then peak = 0.15 elseif peak > 0.85 then peak = 0.85 end + if peak < 0.15 then + peak = 0.15 + elseif peak > 0.85 then + peak = 0.85 + end local leg1 = mathFloor(lifetime * peak) - if leg1 < 1 then leg1 = 1 end + if leg1 < 1 then + leg1 = 1 + end if leg1 < lifetime then local wpX = px + (finalX - px) * peak local wpY = py + (finalY - py) * peak local wpZ = pz + (finalZ - pz) * peak - if clampGuideY > wpY then wpY = clampGuideY end + if clampGuideY > wpY then + wpY = clampGuideY + end local invLeg1 = 1.0 / leg1 vx = (wpX - px) * invLeg1 vy = (wpY - py) * invLeg1 @@ -1810,24 +1934,22 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius local lightLifetime = mathFloor(lifetime * (nl.lifeMult or 2.2) + 0.5) local minLifetime = nl.minLifetime or 14 local maxLifetime = nl.maxLifetime or 96 - if lightLifetime < minLifetime then lightLifetime = minLifetime end - if lightLifetime > maxLifetime then lightLifetime = maxLifetime end + if lightLifetime < minLifetime then + lightLifetime = minLifetime + end + if lightLifetime > maxLifetime then + lightLifetime = maxLifetime + end if lightLifetime > 1 then local sustain = mathFloor(lightLifetime * (nl.sustainFrac or 0.7) + 0.5) - if sustain < 1 then sustain = 1 end - if sustain > lightLifetime then sustain = lightLifetime end + if sustain < 1 then + sustain = 1 + end + if sustain > lightLifetime then + sustain = lightLifetime + end local lightID = "NANOP_" .. pid - Script.LuaUI.EnvNanoBallisticLightSpawn( - lightID, - px, py, pz, - vx, vy, vz, - nl.spawnRadius or 25, - info.lr or r, info.lg or g, info.lb or b, nl.alpha, - lightLifetime, - sustain, - 0.35, 0.15, 0.20, 0.0, - frame - ) + Script.LuaUI.EnvNanoBallisticLightSpawn(lightID, px, py, pz, vx, vy, vz, nl.spawnRadius or 25, info.lr or r, info.lg or g, info.lb or b, nl.alpha, lightLifetime, sustain, 0.35, 0.15, 0.20, 0.0, frame) nl.active[pid] = frame nl.activeCount = nl.activeCount + 1 end @@ -1845,7 +1967,9 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius end local nL = #list if nL >= HOMING_MAX_PER_BUILDER then - for i = 1, nL - 1 do list[i] = list[i + 1] end + for i = 1, nL - 1 do + list[i] = list[i + 1] + end list[nL] = { id = pid, pieceIdx = pieceIdx, death = frame + lifetime, gc = clampThisEmit, lc = info.isMobile } else list[nL + 1] = { id = pid, pieceIdx = pieceIdx, death = frame + lifetime, gc = clampThisEmit, lc = info.isMobile } @@ -1862,8 +1986,11 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius else beingBuilt = spGetUnitIsBeingBuilt(targetUnitID) and true or false if ient then - ient[1] = piecePosEpoch; ient[2] = beingBuilt - if beingBuilt then ient[3] = frame end + ient[1] = piecePosEpoch + ient[2] = beingBuilt + if beingBuilt then + ient[3] = frame + end else targetIncompleteCache[targetUnitID] = { piecePosEpoch, beingBuilt, beingBuilt and frame or -1 } end @@ -1879,7 +2006,9 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius end local fn = #flist if fn >= FADE_FWD_MAX_PER_TARGET then - for i = 1, fn - 1 do flist[i] = flist[i + 1] end + for i = 1, fn - 1 do + flist[i] = flist[i + 1] + end flist[fn] = { id = pid, death = frame + lifetime, gc = clampThisEmit } else flist[fn + 1] = { id = pid, death = frame + lifetime, gc = clampThisEmit } @@ -1914,7 +2043,9 @@ local function emitNano(builderID, info, endX, endY, endZ, inverse, jitterRadius end local nL = #list if nL >= HOMING_FWD_MAX_PER_TARGET then - for i = 1, nL - 1 do list[i] = list[i + 1] end + for i = 1, nL - 1 do + list[i] = list[i + 1] + end list[nL] = { id = pid, death = frame + lifetime, ox = offX, oy = offY, oz = offZ, gc = clampThisEmit, builderID = builderID, pieceIdx = pieceIdx, maxRangeSq = maxRangeSq, lc = info.targetMeta and info.targetMeta.isMobileUnit } else list[nL + 1] = { id = pid, death = frame + lifetime, ox = offX, oy = offY, oz = offZ, gc = clampThisEmit, builderID = builderID, pieceIdx = pieceIdx, maxRangeSq = maxRangeSq, lc = info.targetMeta and info.targetMeta.isMobileUnit } @@ -1935,7 +2066,9 @@ end local function fireReclaimBurst(targetUnitID, targetUnitDefID, attackerTeam, buildProgress, frame) local set = reclaimedTargets[targetUnitID] - if not set then return end + if not set then + return + end reclaimedTargets[targetUnitID] = nil -- Collect the builders that are still alive AND belong to the team that @@ -1956,7 +2089,9 @@ local function fireReclaimBurst(targetUnitID, targetUnitDefID, attackerTeam, bui builders[nb] = { id = builderID, info = info } end end - if nb == 0 then return end + if nb == 0 then + return + end -- Particle count: per-builder share follows a log curve in metal cost, then -- scaled by nb^BUILDER_EXP so more reclaimers always add more particles but @@ -1966,10 +2101,16 @@ local function fireReclaimBurst(targetUnitID, targetUnitDefID, attackerTeam, bui local ud = targetUnitDefID and UnitDefs[targetUnitDefID] or nil local metalCost = ((ud and ud.metalCost) or 0) * (buildProgress or 1.0) local perBuilder = RECLAIM_BURST_BASE + mathFloor(RECLAIM_BURST_LOG_K * mathLog(1 + metalCost / RECLAIM_BURST_LOG_NORM) + 0.5) - if perBuilder < 1 then perBuilder = 1 end + if perBuilder < 1 then + perBuilder = 1 + end local total = mathFloor(perBuilder * (nb ^ RECLAIM_BURST_BUILDER_EXP) + 0.5) - if total > RECLAIM_BURST_MAX then total = RECLAIM_BURST_MAX end - if total < 1 then return end + if total > RECLAIM_BURST_MAX then + total = RECLAIM_BURST_MAX + end + if total < 1 then + return + end -- Burst origin: collision volume center if available, else mid-position. -- GetUnitCollisionVolumeData returns scale, offset, type, axis, disabled. @@ -1988,20 +2129,26 @@ local function fireReclaimBurst(targetUnitID, targetUnitDefID, attackerTeam, bui -- Use the smallest axis as the spawn radius so we stay inside thin -- volumes (e.g. flat factories) instead of poking through. local r = sx - if sy and sy < r then r = sy end - if sz and sz < r then r = sz end + if sy and sy < r then + r = sy + end + if sz and sz < r then + r = sz + end radius = (r or 0) * 0.5 * RECLAIM_BURST_VOL_FRAC else radius = (spGetUnitRadius(targetUnitID) or 32) * RECLAIM_BURST_VOL_FRAC end - if not cx or radius <= 0 then return end + if not cx or radius <= 0 then + return + end -- Distribute particles round-robin across contributing builders. Each -- particle gets its own random spawn point inside the volume sphere -- (rejection-sampled), so the cluster is spatially varied even though all -- particles converge back to one builder per slot. local base = mathFloor(total / nb) - local rem = total - base * nb + local rem = total - base * nb for bi = 1, nb do local b = builders[bi] local cnt = base + (bi <= rem and 1 or 0) @@ -2016,7 +2163,7 @@ local function fireReclaimBurst(targetUnitID, targetUnitDefID, attackerTeam, bui jx = mathRandom() * 2 - 1 jy = mathRandom() * 2 - 1 jz = mathRandom() * 2 - 1 - until (jx*jx + jy*jy + jz*jz) <= 1.0 + until (jx * jx + jy * jy + jz * jz) <= 1.0 local ex = cx + jx * radius local ey = cy + jy * radius local ez = cz + jz * radius @@ -2038,7 +2185,9 @@ end -------------------------------------------------------------------------------- local function resolveTarget(info, cmdID, targetID) - if not targetID then return nil end + if not targetID then + return nil + end local meta = info.targetMeta if not meta or meta.cmdID ~= cmdID or meta.targetID ~= targetID then @@ -2083,16 +2232,16 @@ local function resolveTarget(info, cmdID, targetID) end meta = { - cmdID = cmdID, - targetID = targetID, -- raw value from GetUnitWorkerTask (for cache key) - resolvedID = resolvedID, -- engine ID (with MaxUnits offset stripped) - isFeature = isFeature or false, + cmdID = cmdID, + targetID = targetID, -- raw value from GetUnitWorkerTask (for cache key) + resolvedID = resolvedID, -- engine ID (with MaxUnits offset stripped) + isFeature = isFeature or false, isMobileUnit = isUnit and isMobileUnitDef[spGetUnitDefID(resolvedID)] and true or false, jitterRadius = jitterRadius, targetRadius = radius or 0, -- raw radius for build-range gate (engine reach is buildDistance + target radius) - effectiveBD = info.buildDistance and (info.buildDistance + (radius or 0)) or nil, - isReclaim = isReclaim, - isResurrect = isResurrect, + effectiveBD = info.buildDistance and (info.buildDistance + (radius or 0)) or nil, + isReclaim = isReclaim, + isResurrect = isResurrect, } info.targetMeta = meta end @@ -2112,7 +2261,9 @@ local function resolveTarget(info, cmdID, targetID) if px then if cached then cached[1] = piecePosEpoch - cached[2] = px; cached[3] = py; cached[4] = pz + cached[2] = px + cached[3] = py + cached[4] = pz else emitTargetPosCache[meta.targetID] = { piecePosEpoch, px, py, pz } end @@ -2145,12 +2296,16 @@ end -------------------------------------------------------------------------------- local function applyHoming(frame, dirtyMin, dirtyMax) - if not nanoVBO then return dirtyMin, dirtyMax end + if not nanoVBO then + return dirtyMin, dirtyMax + end -- Fast-path: avoid pairs() VM setup when nothing is in flight. - if next(homingByBuilder) == nil then return dirtyMin, dirtyMax end - local data = nanoVBO.instanceData - local idtoIndex = nanoVBO.instanceIDtoIndex - local step = nanoVBO.instanceStep + if next(homingByBuilder) == nil then + return dirtyMin, dirtyMax + end + local data = nanoVBO.instanceData + local idtoIndex = nanoVBO.instanceIDtoIndex + local step = nanoVBO.instanceStep for builderID, list in pairs(homingByBuilder) do local info = builderCache[builderID] @@ -2188,7 +2343,7 @@ local function applyHoming(frame, dirtyMin, dirtyMax) local mdx = nx - px local mdy = ny - py local mdz = nz - pz - pieceMoving = (mdx*mdx + mdy*mdy + mdz*mdz) >= 1.0 + pieceMoving = (mdx * mdx + mdy * mdy + mdz * mdz) >= 1.0 else pieceMoving = true end @@ -2196,13 +2351,19 @@ local function applyHoming(frame, dirtyMin, dirtyMax) end else local ox, oy, oz - if entry then ox, oy, oz = entry[2], entry[3], entry[4] end + if entry then + ox, oy, oz = entry[2], entry[3], entry[4] + end nx, ny, nz = spGetUnitPiecePosDir(builderID, pieceIdx) if nx then if entry then entry[1] = piecePosEpoch - entry[2] = nx; entry[3] = ny; entry[4] = nz - entry[5] = ox or nx; entry[6] = oy or ny; entry[7] = oz or nz + entry[2] = nx + entry[3] = ny + entry[4] = nz + entry[5] = ox or nx + entry[6] = oy or ny + entry[7] = oz or nz else piecePosCache[key] = { piecePosEpoch, nx, ny, nz, nx, ny, nz } end @@ -2211,7 +2372,7 @@ local function applyHoming(frame, dirtyMin, dirtyMax) local mdx = nx - ox local mdy = ny - oy local mdz = nz - oz - pieceMoving = (mdx*mdx + mdy*mdy + mdz*mdz) >= 1.0 + pieceMoving = (mdx * mdx + mdy * mdy + mdz * mdz) >= 1.0 else pieceMoving = true end @@ -2225,65 +2386,77 @@ local function applyHoming(frame, dirtyMin, dirtyMax) end if nx then - if pieceMoving == false and (not p.gc) then + if pieceMoving == false and not p.gc then writeIdx = writeIdx + 1 list[writeIdx] = p else - local base = (slot - 1) * step - local sx, sy, sz = data[base+1], data[base+2], data[base+3] - local vx, vy, vz = data[base+5], data[base+6], data[base+7] - local spawnF = data[base+8] - local elapsed = frame - spawnF - local cpx = sx + vx * elapsed - local cpy = sy + vy * elapsed - local cpz = sz + vz * elapsed - local aimY = ny - if p.gc then - -- For reclaim on high-to-low terrain, keep particles above current - -- ground during homing updates so they travel along the upper - -- surface before descending at the cliff break. - local gyCur = getGroundYMargin(cpx, cpz, frame) - if cpy < gyCur then cpy = gyCur end - local gyDst = pieceGroundYByKey[key] - if gyDst == nil then - gyDst = getGroundYMargin(nx, nz, frame) - pieceGroundYByKey[key] = gyDst + local base = (slot - 1) * step + local sx, sy, sz = data[base + 1], data[base + 2], data[base + 3] + local vx, vy, vz = data[base + 5], data[base + 6], data[base + 7] + local spawnF = data[base + 8] + local elapsed = frame - spawnF + local cpx = sx + vx * elapsed + local cpy = sy + vy * elapsed + local cpz = sz + vz * elapsed + local aimY = ny + if p.gc then + -- For reclaim on high-to-low terrain, keep particles above current + -- ground during homing updates so they travel along the upper + -- surface before descending at the cliff break. + local gyCur = getGroundYMargin(cpx, cpz, frame) + if cpy < gyCur then + cpy = gyCur + end + local gyDst = pieceGroundYByKey[key] + if gyDst == nil then + gyDst = getGroundYMargin(nx, nz, frame) + pieceGroundYByKey[key] = gyDst + end + if aimY < gyDst then + aimY = gyDst + end + if gyCur > (aimY + clampDelta) then + aimY = gyCur + end end - if aimY < gyDst then aimY = gyDst end - if gyCur > (aimY + clampDelta) then - aimY = gyCur + -- Inverse particles all converge on the builder piece (engine + -- behaviour: speed = -dif*3 makes pos arrive at startPos exactly). + -- Visual spread comes from staggered spawn positions, not from + -- the velocity direction, so simple aim is correct here. + local invR = 1.0 / remaining + data[base + 1] = cpx + data[base + 2] = cpy + data[base + 3] = cpz + data[base + 5] = (nx - cpx) * invR + data[base + 6] = (aimY - cpy) * invR + data[base + 7] = (nz - cpz) * invR + data[base + 8] = frame + local nl = deathBuckets.__nanoLight + if p.lc and nl and nl.bridgeReady then + local lastFix = nl.active[p.id] + local minFrames = nl.correctEvery or 10 + if lastFix and (frame - lastFix) >= minFrames then + nl.active[p.id] = frame + Script.LuaUI.EnvNanoBallisticLightCorrect("NANOP_" .. p.id, cpx, cpy, cpz, (nx - cpx) * invR, (aimY - cpy) * invR, (nz - cpz) * invR, frame) + end end - end - -- Inverse particles all converge on the builder piece (engine - -- behaviour: speed = -dif*3 makes pos arrive at startPos exactly). - -- Visual spread comes from staggered spawn positions, not from - -- the velocity direction, so simple aim is correct here. - local invR = 1.0 / remaining - data[base+1] = cpx; data[base+2] = cpy; data[base+3] = cpz - data[base+5] = (nx - cpx) * invR - data[base+6] = (aimY - cpy) * invR - data[base+7] = (nz - cpz) * invR - data[base+8] = frame - local nl = deathBuckets.__nanoLight - if p.lc and nl and nl.bridgeReady then - local lastFix = nl.active[p.id] - local minFrames = nl.correctEvery or 10 - if lastFix and (frame - lastFix) >= minFrames then - nl.active[p.id] = frame - Script.LuaUI.EnvNanoBallisticLightCorrect("NANOP_" .. p.id, cpx, cpy, cpz, (nx - cpx) * invR, (aimY - cpy) * invR, (nz - cpz) * invR, frame) + local s0 = slot - 1 + if s0 < dirtyMin then + dirtyMin = s0 end - end - local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end - writeIdx = writeIdx + 1 - list[writeIdx] = p + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end + writeIdx = writeIdx + 1 + list[writeIdx] = p end end end end -- Trim dropped entries (dead, missing slot, or no piece pos). - for j = #list, writeIdx + 1, -1 do list[j] = nil end + for j = #list, writeIdx + 1, -1 do + list[j] = nil + end if writeIdx == 0 then homingByBuilder[builderID] = nil end @@ -2305,29 +2478,43 @@ local fadeOutHomingFwd local targetPosEpoch = 0 local function applyForwardHoming(frame, dirtyMin, dirtyMax) - if not nanoVBO then return dirtyMin, dirtyMax end - if next(homingFwdByTarget) == nil then return dirtyMin, dirtyMax end - local data = nanoVBO.instanceData - local idtoIndex = nanoVBO.instanceIDtoIndex - local step = nanoVBO.instanceStep + if not nanoVBO then + return dirtyMin, dirtyMax + end + if next(homingFwdByTarget) == nil then + return dirtyMin, dirtyMax + end + local data = nanoVBO.instanceData + local idtoIndex = nanoVBO.instanceIDtoIndex + local step = nanoVBO.instanceStep local function fadeParticle(slot, p) local remaining = p.death - frame - if remaining <= 0 then return false end + if remaining <= 0 then + return false + end local fadeFrames = mathFloor(FADE_FRAMES_DEATH * (0.4 + mathRandom())) - if fadeFrames < 1 then fadeFrames = 1 end - if fadeFrames > remaining then fadeFrames = remaining end + if fadeFrames < 1 then + fadeFrames = 1 + end + if fadeFrames > remaining then + fadeFrames = remaining + end local newDeath = frame + fadeFrames local base = (slot - 1) * step - data[base+16] = newDeath - local packed = data[base+4] + data[base + 16] = newDeath + local packed = data[base + 4] local absPacked = packed < 0 and -packed or packed local oldFade = mathFloor(absPacked / 1024) local sizeBits = absPacked - oldFade * 1024 local newPacked = sizeBits + fadeFrames * 1024 - data[base+4] = packed < 0 and -newPacked or newPacked + data[base + 4] = packed < 0 and -newPacked or newPacked local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end return true end @@ -2369,183 +2556,201 @@ local function applyForwardHoming(frame, dirtyMin, dirtyMax) if mt and mt.aircraftState == "crashing" then fadeOutHomingFwd(targetID) homingFwdByTarget[targetID] = nil - targetPosCache[targetID] = nil + targetPosCache[targetID] = nil fadedOut = true end end end end if not fadedOut then - local isAir = list._isAir - if isAir == nil then - isAir = isAirUnitDef[spGetUnitDefID(targetID)] and true or false - list._isAir = isAir - end + local isAir = list._isAir + if isAir == nil then + isAir = isAirUnitDef[spGetUnitDefID(targetID)] and true or false + list._isAir = isAir + end local maxSpeed = NANO_SPEED * (isAir and 1.35 or 2.0) - local maxSpeedSq = maxSpeed * maxSpeed - -- Cache layout per target: { epoch, tx, ty, tz, lastTx, lastTy, lastTz, stationaryStreak } - -- stationaryStreak counts consecutive homing passes the target has - -- not moved. Once it crosses STATIONARY_SKIP_AFTER, we skip the - -- per-particle rewrite entirely until the target moves again -- - -- spawn-time aim is already correct for stationary targets. - local entry = targetPosCache[targetID] - local tx, ty, tz - if entry and entry[1] == targetPosEpoch then - tx, ty, tz = entry[2], entry[3], entry[4] - else - -- spGetUnitPosition(uid, true) returns 6 values; want mid (4,5,6). - local _, _, _, mx, my, mz = spGetUnitPosition(targetID, true) - tx, ty, tz = mx, my, mz - if tx then - if entry then - entry[1] = targetPosEpoch - entry[2] = tx; entry[3] = ty; entry[4] = tz - entry[9] = frame - else - entry = { targetPosEpoch, tx, ty, tz, tx, ty, tz, 0, frame } - targetPosCache[targetID] = entry + local maxSpeedSq = maxSpeed * maxSpeed + -- Cache layout per target: { epoch, tx, ty, tz, lastTx, lastTy, lastTz, stationaryStreak } + -- stationaryStreak counts consecutive homing passes the target has + -- not moved. Once it crosses STATIONARY_SKIP_AFTER, we skip the + -- per-particle rewrite entirely until the target moves again -- + -- spawn-time aim is already correct for stationary targets. + local entry = targetPosCache[targetID] + local tx, ty, tz + if entry and entry[1] == targetPosEpoch then + tx, ty, tz = entry[2], entry[3], entry[4] + else + -- spGetUnitPosition(uid, true) returns 6 values; want mid (4,5,6). + local _, _, _, mx, my, mz = spGetUnitPosition(targetID, true) + tx, ty, tz = mx, my, mz + if tx then + if entry then + entry[1] = targetPosEpoch + entry[2] = tx + entry[3] = ty + entry[4] = tz + entry[9] = frame + else + entry = { targetPosEpoch, tx, ty, tz, tx, ty, tz, 0, frame } + targetPosCache[targetID] = entry + end end end - end - if not tx then - homingFwdByTarget[targetID] = nil - targetPosCache[targetID] = nil - else - -- Stationary detection: compare current pos to last-seen pos. - -- Threshold is generous (1 elmo) -- builders sub-elmo drift doesn't - -- count as movement. Streak resets on any movement. - local moved = true - if entry[5] then - local ddx = tx - entry[5] - local ddy = ty - entry[6] - local ddz = tz - entry[7] - if ddx*ddx + ddy*ddy + ddz*ddz < 1.0 then moved = false end - end - if moved then - entry[5] = tx; entry[6] = ty; entry[7] = tz - entry[8] = 0 + if not tx then + homingFwdByTarget[targetID] = nil + targetPosCache[targetID] = nil else - entry[8] = (entry[8] or 0) + 1 - end - - if entry[8] >= STATIONARY_SKIP_AFTER then - -- Stationary: just trim dead/missing particles from list, - -- skip the expensive per-particle rewrite. Spawn-time - -- velocity already aims at the (still-correct) target. - local writeIdx = 0 - for i = 1, #list do - local p = list[i] - if (p.death - frame) >= 1 and idtoIndex[p.id] then - writeIdx = writeIdx + 1 - list[writeIdx] = p + -- Stationary detection: compare current pos to last-seen pos. + -- Threshold is generous (1 elmo) -- builders sub-elmo drift doesn't + -- count as movement. Streak resets on any movement. + local moved = true + if entry[5] then + local ddx = tx - entry[5] + local ddy = ty - entry[6] + local ddz = tz - entry[7] + if ddx * ddx + ddy * ddy + ddz * ddz < 1.0 then + moved = false end end - for j = #list, writeIdx + 1, -1 do list[j] = nil end - if writeIdx == 0 then - homingFwdByTarget[targetID] = nil - targetPosCache[targetID] = nil + if moved then + entry[5] = tx + entry[6] = ty + entry[7] = tz + entry[8] = 0 + else + entry[8] = (entry[8] or 0) + 1 end - else - local writeIdx = 0 - local piecePosByKey = {} - for i = 1, #list do - local p = list[i] - local remaining = p.death - frame - local slot = (remaining >= 1) and idtoIndex[p.id] or nil - if slot then - local fadeParticleOut = false - local maxRangeSq = p.maxRangeSq - if maxRangeSq and p.builderID and p.pieceIdx then - local key = p.builderID * 256 + p.pieceIdx - local pos = piecePosByKey[key] - local bx, bz - if pos then - bx, bz = pos[1], pos[2] - else - local pent = piecePosCache[key] - if pent and pent[1] == piecePosEpoch then - bx, bz = pent[2], pent[4] - else - local px, py, pz = spGetUnitPiecePosDir(p.builderID, p.pieceIdx) - if px then - if pent then - pent[1] = piecePosEpoch - pent[2] = px; pent[3] = py; pent[4] = pz + + if entry[8] >= STATIONARY_SKIP_AFTER then + -- Stationary: just trim dead/missing particles from list, + -- skip the expensive per-particle rewrite. Spawn-time + -- velocity already aims at the (still-correct) target. + local writeIdx = 0 + for i = 1, #list do + local p = list[i] + if (p.death - frame) >= 1 and idtoIndex[p.id] then + writeIdx = writeIdx + 1 + list[writeIdx] = p + end + end + for j = #list, writeIdx + 1, -1 do + list[j] = nil + end + if writeIdx == 0 then + homingFwdByTarget[targetID] = nil + targetPosCache[targetID] = nil + end + else + local writeIdx = 0 + local piecePosByKey = {} + for i = 1, #list do + local p = list[i] + local remaining = p.death - frame + local slot = (remaining >= 1) and idtoIndex[p.id] or nil + if slot then + local fadeParticleOut = false + local maxRangeSq = p.maxRangeSq + if maxRangeSq and p.builderID and p.pieceIdx then + local key = p.builderID * 256 + p.pieceIdx + local pos = piecePosByKey[key] + local bx, bz + if pos then + bx, bz = pos[1], pos[2] + else + local pent = piecePosCache[key] + if pent and pent[1] == piecePosEpoch then + bx, bz = pent[2], pent[4] else - piecePosCache[key] = { piecePosEpoch, px, py, pz } + local px, py, pz = spGetUnitPiecePosDir(p.builderID, p.pieceIdx) + if px then + if pent then + pent[1] = piecePosEpoch + pent[2] = px + pent[3] = py + pent[4] = pz + else + piecePosCache[key] = { piecePosEpoch, px, py, pz } + end + bx, bz = px, pz + end + end + if bx then + piecePosByKey[key] = { bx, bz } + end + end + if bx then + local rdx = tx - bx + local rdz = tz - bz + if (rdx * rdx + rdz * rdz) > maxRangeSq then + fadeParticleOut = fadeParticle(slot, p) end - bx, bz = px, pz end end - if bx then - piecePosByKey[key] = { bx, bz } + if not fadeParticleOut then + local base = (slot - 1) * step + local sx, sy, sz = data[base + 1], data[base + 2], data[base + 3] + local vx, vy, vz = data[base + 5], data[base + 6], data[base + 7] + local spawnF = data[base + 8] + local elapsed = frame - spawnF + local cpx = sx + vx * elapsed + local cpy = sy + vy * elapsed + local cpz = sz + vz * elapsed + -- Aim at target + per-particle landing offset. The offset is the + -- engine's jitter-driven spread point for this specific particle, + -- so the spray width at the destination is preserved as the + -- target moves. + local aimX = tx + p.ox + local aimZ = tz + p.oz + local aimY = ty + p.oy + local dvx = aimX - cpx + local dvy = aimY - cpy + local dvz = aimZ - cpz + local invR = 1.0 / remaining + local needSpeedSq = (dvx * dvx + dvy * dvy + dvz * dvz) * (invR * invR) + if needSpeedSq > maxSpeedSq then + fadeParticleOut = fadeParticle(slot, p) + else + data[base + 1] = cpx + data[base + 2] = cpy + data[base + 3] = cpz + data[base + 5] = dvx * invR + data[base + 6] = dvy * invR + data[base + 7] = dvz * invR + data[base + 8] = frame + local nl = deathBuckets.__nanoLight + if p.lc and nl and nl.bridgeReady then + local lastFix = nl.active[p.id] + local minFrames = nl.correctEvery or 10 + if lastFix and (frame - lastFix) >= minFrames then + nl.active[p.id] = frame + Script.LuaUI.EnvNanoBallisticLightCorrect("NANOP_" .. p.id, cpx, cpy, cpz, dvx * invR, dvy * invR, dvz * invR, frame) + end + end + local s0 = slot - 1 + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end + end end - end - if bx then - local rdx = tx - bx - local rdz = tz - bz - if (rdx * rdx + rdz * rdz) > maxRangeSq then - fadeParticleOut = fadeParticle(slot, p) + if not fadeParticleOut then + writeIdx = writeIdx + 1 + list[writeIdx] = p end end end - if not fadeParticleOut then - local base = (slot - 1) * step - local sx, sy, sz = data[base+1], data[base+2], data[base+3] - local vx, vy, vz = data[base+5], data[base+6], data[base+7] - local spawnF = data[base+8] - local elapsed = frame - spawnF - local cpx = sx + vx * elapsed - local cpy = sy + vy * elapsed - local cpz = sz + vz * elapsed - -- Aim at target + per-particle landing offset. The offset is the - -- engine's jitter-driven spread point for this specific particle, - -- so the spray width at the destination is preserved as the - -- target moves. - local aimX = tx + p.ox - local aimZ = tz + p.oz - local aimY = ty + p.oy - local dvx = aimX - cpx - local dvy = aimY - cpy - local dvz = aimZ - cpz - local invR = 1.0 / remaining - local needSpeedSq = (dvx*dvx + dvy*dvy + dvz*dvz) * (invR * invR) - if needSpeedSq > maxSpeedSq then - fadeParticleOut = fadeParticle(slot, p) - else - data[base+1] = cpx; data[base+2] = cpy; data[base+3] = cpz - data[base+5] = dvx * invR - data[base+6] = dvy * invR - data[base+7] = dvz * invR - data[base+8] = frame - local nl = deathBuckets.__nanoLight - if p.lc and nl and nl.bridgeReady then - local lastFix = nl.active[p.id] - local minFrames = nl.correctEvery or 10 - if lastFix and (frame - lastFix) >= minFrames then - nl.active[p.id] = frame - Script.LuaUI.EnvNanoBallisticLightCorrect("NANOP_" .. p.id, cpx, cpy, cpz, dvx * invR, dvy * invR, dvz * invR, frame) - end - end - local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end + for j = #list, writeIdx + 1, -1 do + list[j] = nil end + if writeIdx == 0 then + homingFwdByTarget[targetID] = nil + targetPosCache[targetID] = nil end - if not fadeParticleOut then - writeIdx = writeIdx + 1 - list[writeIdx] = p - end - end - end - for j = #list, writeIdx + 1, -1 do list[j] = nil end - if writeIdx == 0 then - homingFwdByTarget[targetID] = nil - targetPosCache[targetID] = nil - end - end -- end of stationary-skip if/else - end -- end of "not tx" else + end -- end of stationary-skip if/else + end -- end of "not tx" else end -- end of "not fully repaired" else end end @@ -2559,21 +2764,33 @@ end -------------------------------------------------------------------------------- local function applyGroundClamp(frame, dirtyMin, dirtyMax) - if not U.GROUND_CLAMP_ENABLED then return dirtyMin, dirtyMax end - if not nanoVBO then return dirtyMin, dirtyMax end + if not U.GROUND_CLAMP_ENABLED then + return dirtyMin, dirtyMax + end + if not nanoVBO then + return dirtyMin, dirtyMax + end local runEvery = U.GROUND_CLAMP_RUN_EVERY or 1 - if runEvery < 1 then runEvery = 1 end - if (frame % runEvery) ~= 0 then return dirtyMin, dirtyMax end + if runEvery < 1 then + runEvery = 1 + end + if (frame % runEvery) ~= 0 then + return dirtyMin, dirtyMax + end local total = #groundClampParticles - if CLAMP_DEBUG and total > clampDbg.maxSubset then clampDbg.maxSubset = total end + if CLAMP_DEBUG and total > clampDbg.maxSubset then + clampDbg.maxSubset = total + end if total == 0 then groundClampCursor = 1 return dirtyMin, dirtyMax end local maxPer = U.GROUND_CLAMP_MAX_PER_STEP or 0 - if maxPer < 1 or maxPer > total then maxPer = total end + if maxPer < 1 or maxPer > total then + maxPer = total + end local data = nanoVBO.instanceData local step = nanoVBO.instanceStep @@ -2581,7 +2798,9 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) local recheckHit = U.GROUND_CLAMP_RECHECK_HIT or 2 local recheckMiss = U.GROUND_CLAMP_RECHECK_MISS or 4 local idx = groundClampCursor - if idx < 1 or idx > total then idx = 1 end + if idx < 1 or idx > total then + idx = 1 + end local processed = 0 local checked = 0 @@ -2592,7 +2811,9 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) idx = 1 break end - if idx > n then idx = 1 end + if idx > n then + idx = 1 + end local entry = groundClampParticles[idx] local slot = idtoIndex[entry.id] if (not slot) or entry.death <= frame + 1 then @@ -2601,7 +2822,9 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) groundClampParticles[n] = nil n = n - 1 groundClampFree[#groundClampFree + 1] = removed - if CLAMP_DEBUG then clampDbg.dropped = clampDbg.dropped + 1 end + if CLAMP_DEBUG then + clampDbg.dropped = clampDbg.dropped + 1 + end elseif entry.next and frame < entry.next then idx = idx + 1 elseif entry.wp then @@ -2631,9 +2854,15 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) data[base + 7] = (fz - cpz) * invR data[base + 8] = frame local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end - if CLAMP_DEBUG then clampDbg.corrected = clampDbg.corrected + 1 end + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end + if CLAMP_DEBUG then + clampDbg.corrected = clampDbg.corrected + 1 + end end local removed = entry groundClampParticles[idx] = groundClampParticles[n] @@ -2641,7 +2870,9 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) n = n - 1 groundClampFree[#groundClampFree + 1] = removed processed = processed + 1 - if CLAMP_DEBUG then clampDbg.processed = clampDbg.processed + 1 end + if CLAMP_DEBUG then + clampDbg.processed = clampDbg.processed + 1 + end else local base = (slot - 1) * step local remaining = entry.death - frame @@ -2667,16 +2898,24 @@ local function applyGroundClamp(frame, dirtyMin, dirtyMax) data[base + 7] = (aimZ - cpz) * invR data[base + 8] = frame local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end - if CLAMP_DEBUG then clampDbg.corrected = clampDbg.corrected + 1 end + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end + if CLAMP_DEBUG then + clampDbg.corrected = clampDbg.corrected + 1 + end entry.next = frame + recheckHit else entry.next = frame + recheckMiss end processed = processed + 1 - if CLAMP_DEBUG then clampDbg.processed = clampDbg.processed + 1 end + if CLAMP_DEBUG then + clampDbg.processed = clampDbg.processed + 1 + end idx = idx + 1 end checked = checked + 1 @@ -2723,358 +2962,384 @@ local function scanBuilders(frame) -- MAX_SCAN_RUN_EVERY frames. emitProb scales by runEvery so total emission -- rate is preserved. local runEvery = MIN_SCAN_RUN_EVERY + math.floor(saturation * (MAX_SCAN_RUN_EVERY - MIN_SCAN_RUN_EVERY) + 0.5) - if runEvery < 1 then runEvery = 1 end - if (frame % runEvery) ~= 0 then skipEmit = true end - - if not skipEmit then - -- Camera position for the per-emit distance throttle. One call per scan; - -- DISTANT_EMIT_* squared bands live at module scope. - local camX, camY, camZ = Spring.GetCameraPosition() - - -- Dynamic stride: empty pool -> 1 (full fidelity), near full -> MAX_SCAN_STRIDE. - -- Per-builder elapsed-frames-based emit count compensates so total rate is constant. - local stride = MIN_SCAN_STRIDE + math.floor(saturation * (MAX_SCAN_STRIDE - MIN_SCAN_STRIDE) + 0.5) - if stride < 1 then stride = 1 end - - -- Pool-saturation-driven offscreen keep-fraction. Recomputed once per scan - -- so all per-emit checks below use the same value. - local offscreenKeep - if saturation <= OFFSCREEN_EMIT_KEEP_SAT_PIVOT then - offscreenKeep = OFFSCREEN_EMIT_KEEP_MAX - else - local t = (saturation - OFFSCREEN_EMIT_KEEP_SAT_PIVOT) * OFFSCREEN_EMIT_KEEP_BAND_INV - offscreenKeep = OFFSCREEN_EMIT_KEEP_MAX + t * (OFFSCREEN_EMIT_KEEP_MIN - OFFSCREEN_EMIT_KEEP_MAX) - end - - local list = trackedBuildersList - local n = #list - -- Use scan-call counter (frame/runEvery) for the stride offset rather than - -- raw frame: otherwise runEvery=2 + stride=2 makes frame always even, - -- frame%stride always 0, and even-indexed builders never visited. - local scanTick = mathFloor(frame / runEvery) - local start = (scanTick % stride) + 1 - -- Iterate this scan's stride-coset (indices start, start+stride, ..., <= n) - -- starting from a per-scan rotating offset rather than always ascending. - -- The mid-scan saturation early-out otherwise consistently starves the - -- highest-indexed builders within each coset -- highly visible at large - -- stride where each visit emits a big batch and the cap is hit early. - -- Rotating the start position spreads the "tail position" evenly across - -- coset members over successive scans. - local cosetCount = mathFloor((n - start) / stride) + 1 - local rotation = (cosetCount > 0) and (scanTick % cosetCount) or 0 - for k = 0, cosetCount - 1 do - -- Mid-scan saturation early-out: emissions from earlier builders may push - -- liveCount over effectiveMax. Bail rather than do per-builder work for - -- emissions the gate would drop. Skipped builders catch up next tick via - -- the elapsed-frames-based emit rate. - if liveCount >= effectiveMax then break end - local cosetIdx = (k + rotation) % cosetCount - local i = start + cosetIdx * stride - do - local unitID = list[i] - -- Cheap idle filter: a builder with no current build power is not - -- emitting (walking, queued, blocked, paused, no orders). Skipping - -- saves the worker-task lookup, which together with this dominates - -- per-builder cost when most builders sit idle. bp is cached for a - -- few frames but ONLY while non-zero -- see BUILD_POWER_CACHE_FRAMES. - local info = getBuilderInfo(unitID) - if info then - local bp - local bpRefetched = false - local bpCacheUntil = info.bpCacheUntil - if bpCacheUntil and frame < bpCacheUntil then - bp = info.bpCached - else - bp = spGetUnitCurrentBuildPower(unitID) - bpRefetched = true - if bp and bp > 0 then - info.bpCached = bp - info.bpCacheUntil = frame + BUILD_POWER_CACHE_FRAMES + if runEvery < 1 then + runEvery = 1 + end + if (frame % runEvery) ~= 0 then + skipEmit = true + end + + if not skipEmit then + -- Camera position for the per-emit distance throttle. One call per scan; + -- DISTANT_EMIT_* squared bands live at module scope. + local camX, camY, camZ = Spring.GetCameraPosition() + + -- Dynamic stride: empty pool -> 1 (full fidelity), near full -> MAX_SCAN_STRIDE. + -- Per-builder elapsed-frames-based emit count compensates so total rate is constant. + local stride = MIN_SCAN_STRIDE + math.floor(saturation * (MAX_SCAN_STRIDE - MIN_SCAN_STRIDE) + 0.5) + if stride < 1 then + stride = 1 + end + + -- Pool-saturation-driven offscreen keep-fraction. Recomputed once per scan + -- so all per-emit checks below use the same value. + local offscreenKeep + if saturation <= OFFSCREEN_EMIT_KEEP_SAT_PIVOT then + offscreenKeep = OFFSCREEN_EMIT_KEEP_MAX + else + local t = (saturation - OFFSCREEN_EMIT_KEEP_SAT_PIVOT) * OFFSCREEN_EMIT_KEEP_BAND_INV + offscreenKeep = OFFSCREEN_EMIT_KEEP_MAX + t * (OFFSCREEN_EMIT_KEEP_MIN - OFFSCREEN_EMIT_KEEP_MAX) + end + + local list = trackedBuildersList + local n = #list + -- Use scan-call counter (frame/runEvery) for the stride offset rather than + -- raw frame: otherwise runEvery=2 + stride=2 makes frame always even, + -- frame%stride always 0, and even-indexed builders never visited. + local scanTick = mathFloor(frame / runEvery) + local start = (scanTick % stride) + 1 + -- Iterate this scan's stride-coset (indices start, start+stride, ..., <= n) + -- starting from a per-scan rotating offset rather than always ascending. + -- The mid-scan saturation early-out otherwise consistently starves the + -- highest-indexed builders within each coset -- highly visible at large + -- stride where each visit emits a big batch and the cap is hit early. + -- Rotating the start position spreads the "tail position" evenly across + -- coset members over successive scans. + local cosetCount = mathFloor((n - start) / stride) + 1 + local rotation = (cosetCount > 0) and (scanTick % cosetCount) or 0 + for k = 0, cosetCount - 1 do + -- Mid-scan saturation early-out: emissions from earlier builders may push + -- liveCount over effectiveMax. Bail rather than do per-builder work for + -- emissions the gate would drop. Skipped builders catch up next tick via + -- the elapsed-frames-based emit rate. + if liveCount >= effectiveMax then + break + end + local cosetIdx = (k + rotation) % cosetCount + local i = start + cosetIdx * stride + do + local unitID = list[i] + -- Cheap idle filter: a builder with no current build power is not + -- emitting (walking, queued, blocked, paused, no orders). Skipping + -- saves the worker-task lookup, which together with this dominates + -- per-builder cost when most builders sit idle. bp is cached for a + -- few frames but ONLY while non-zero -- see BUILD_POWER_CACHE_FRAMES. + local info = getBuilderInfo(unitID) + if info then + local bp + local bpRefetched = false + local bpCacheUntil = info.bpCacheUntil + if bpCacheUntil and frame < bpCacheUntil then + bp = info.bpCached else - info.bpCacheUntil = nil - end - end - if not (bp and bp > 0) then - -- Resurrectors refilling a wreck's metal before the actual - -- resurrect step can still be actively working while reporting - -- zero current build power. GetUnitWorkerTask still exposes the - -- CMD_RESURRECT feature target, and the feature's resurrect - -- progress advances in that phase, so treat it as active with a - -- conservative fallback multiplier instead of dropping emission. - local fallbackCmdID, fallbackTargetID = spGetUnitWorkerTask(unitID) - if fallbackCmdID == CMD_RESURRECT and fallbackTargetID then - local featureID = fallbackTargetID - if featureID >= MAX_UNITS then - featureID = featureID - MAX_UNITS - end - if spValidFeatureID(featureID) then - local featureMetal, featureMaxMetal = spGetFeatureResources(featureID) - local _, _, resurrectProgress = spGetFeatureHealth(featureID) - local isRefilling = featureMetal and featureMaxMetal and featureMaxMetal > 0 and featureMetal < featureMaxMetal - local isResurrecting = resurrectProgress and resurrectProgress > 0 and resurrectProgress < 1 - if isRefilling or isResurrecting then - bp = 1 - bpRefetched = true - info.cmdID = fallbackCmdID - info.targetID = fallbackTargetID - end - end - end - end - if not (bp and bp > 0) then - -- Idle visit: clear lastVisitFrame so the next bp>0 visit - -- doesn't credit the idle gap as build time and dump a burst. - info.lastVisitFrame = nil - -- Drop the builder from any reclaim tracking -- it's no longer - -- contributing, so the burst shouldn't travel to it. - local prev = info.reclaimTarget - if prev then - local prevSet = reclaimedTargets[prev] - if prevSet then - prevSet[unitID] = nil - if next(prevSet) == nil then reclaimedTargets[prev] = nil end + bp = spGetUnitCurrentBuildPower(unitID) + bpRefetched = true + if bp and bp > 0 then + info.bpCached = bp + info.bpCacheUntil = frame + BUILD_POWER_CACHE_FRAMES + else + info.bpCacheUntil = nil end - info.reclaimTarget = nil end - end - if bp and bp > 0 then - if DEBUG then _dbgBuilders = _dbgBuilders + 1 end - -- Lazy nano-piece refresh: the COB/LUS script may not have - -- registered all nano pieces by the time getBuilderInfo is first - -- called (lazy, on first active scan). Re-fetch on first activity - -- (stage 0→1) and once more ~3s later (stage 1→2) to catch - -- scripts that register pieces inside QueryNanoPiece. Applies to - -- ALL builders, not just factories -- constructors with multiple - -- arms can also return a partial list on the first scan. - local refreshStage = info.piecesRefreshStage or 0 - if refreshStage < 2 then - local refreshAt = info.piecesRefreshAt - if refreshStage == 0 or (refreshAt and frame >= refreshAt) then - local fresh = spGetUnitNanoPieces(unitID) - if fresh and #fresh > info.nPieces then - info.pieces = fresh - info.nPieces = #fresh + if not (bp and bp > 0) then + -- Resurrectors refilling a wreck's metal before the actual + -- resurrect step can still be actively working while reporting + -- zero current build power. GetUnitWorkerTask still exposes the + -- CMD_RESURRECT feature target, and the feature's resurrect + -- progress advances in that phase, so treat it as active with a + -- conservative fallback multiplier instead of dropping emission. + local fallbackCmdID, fallbackTargetID = spGetUnitWorkerTask(unitID) + if fallbackCmdID == CMD_RESURRECT and fallbackTargetID then + local featureID = fallbackTargetID + if featureID >= MAX_UNITS then + featureID = featureID - MAX_UNITS end - if refreshStage == 0 then - info.piecesRefreshStage = 1 - info.piecesRefreshAt = frame + 90 -- ~3s @ 30Hz - else - info.piecesRefreshStage = 2 - info.piecesRefreshAt = nil + if spValidFeatureID(featureID) then + local featureMetal, featureMaxMetal = spGetFeatureResources(featureID) + local _, _, resurrectProgress = spGetFeatureHealth(featureID) + local isRefilling = featureMetal and featureMaxMetal and featureMaxMetal > 0 and featureMetal < featureMaxMetal + local isResurrecting = resurrectProgress and resurrectProgress > 0 and resurrectProgress < 1 + if isRefilling or isResurrecting then + bp = 1 + bpRefetched = true + info.cmdID = fallbackCmdID + info.targetID = fallbackTargetID + end end end end - -- Worker-task lookup. Cached in lockstep with bp -- the - -- (cmdID, targetID) pair is even more stable during a continuous - -- build. Mid-build changes are handled out-of-band: UnitFinished - -- clears info.cmdID/targetID/targetMeta on every dependent builder - -- (queue advance picked up next visit), and manual order changes - -- are rare (worst case = BUILD_POWER_CACHE_FRAMES of stale aim). - local cmdID, targetID = info.cmdID, info.targetID - if bpRefetched or not cmdID then - cmdID, targetID = spGetUnitWorkerTask(unitID) - info.cmdID = cmdID - info.targetID = targetID + if not (bp and bp > 0) then + -- Idle visit: clear lastVisitFrame so the next bp>0 visit + -- doesn't credit the idle gap as build time and dump a burst. + info.lastVisitFrame = nil + -- Drop the builder from any reclaim tracking -- it's no longer + -- contributing, so the burst shouldn't travel to it. + local prev = info.reclaimTarget + if prev then + local prevSet = reclaimedTargets[prev] + if prevSet then + prevSet[unitID] = nil + if next(prevSet) == nil then + reclaimedTargets[prev] = nil + end + end + info.reclaimTarget = nil + end end - if cmdID then - if DEBUG then _dbgWithTask = _dbgWithTask + 1 end - local ex, ey, ez, inverse, jitterRadius, isResurrect, targetUnitID = resolveTarget(info, cmdID, targetID) - -- Record this builder as actively reclaiming `targetUnitID` - -- so the UnitDestroyed callin can fire a finishing burst - -- only from builders that contributed (= teams that got - -- the metal). Tracked even when this scan's emission gets - -- throttled away, so the burst still fires off-screen. - -- If the builder switched targets (or away from reclaim), - -- drop its membership in the previous target's set so a - -- later reclaim of that earlier unit doesn't credit a - -- builder that long-since moved on. - local nowReclaiming = (targetUnitID and inverse and info.targetMeta and info.targetMeta.isReclaim) and targetUnitID or nil - local prevReclaiming = info.reclaimTarget - if prevReclaiming ~= nowReclaiming then - if prevReclaiming then - local prevSet = reclaimedTargets[prevReclaiming] - if prevSet then - prevSet[unitID] = nil - if next(prevSet) == nil then - reclaimedTargets[prevReclaiming] = nil - end + if bp and bp > 0 then + if DEBUG then + _dbgBuilders = _dbgBuilders + 1 + end + -- Lazy nano-piece refresh: the COB/LUS script may not have + -- registered all nano pieces by the time getBuilderInfo is first + -- called (lazy, on first active scan). Re-fetch on first activity + -- (stage 0→1) and once more ~3s later (stage 1→2) to catch + -- scripts that register pieces inside QueryNanoPiece. Applies to + -- ALL builders, not just factories -- constructors with multiple + -- arms can also return a partial list on the first scan. + local refreshStage = info.piecesRefreshStage or 0 + if refreshStage < 2 then + local refreshAt = info.piecesRefreshAt + if refreshStage == 0 or (refreshAt and frame >= refreshAt) then + local fresh = spGetUnitNanoPieces(unitID) + if fresh and #fresh > info.nPieces then + info.pieces = fresh + info.nPieces = #fresh + end + if refreshStage == 0 then + info.piecesRefreshStage = 1 + info.piecesRefreshAt = frame + 90 -- ~3s @ 30Hz + else + info.piecesRefreshStage = 2 + info.piecesRefreshAt = nil end end - info.reclaimTarget = nowReclaiming end - if nowReclaiming then - local set = reclaimedTargets[nowReclaiming] - if set then - set[unitID] = true - else - reclaimedTargets[nowReclaiming] = { [unitID] = true } + -- Worker-task lookup. Cached in lockstep with bp -- the + -- (cmdID, targetID) pair is even more stable during a continuous + -- build. Mid-build changes are handled out-of-band: UnitFinished + -- clears info.cmdID/targetID/targetMeta on every dependent builder + -- (queue advance picked up next visit), and manual order changes + -- are rare (worst case = BUILD_POWER_CACHE_FRAMES of stale aim). + local cmdID, targetID = info.cmdID, info.targetID + if bpRefetched or not cmdID then + cmdID, targetID = spGetUnitWorkerTask(unitID) + info.cmdID = cmdID + info.targetID = targetID + end + if cmdID then + if DEBUG then + _dbgWithTask = _dbgWithTask + 1 end - -- Keep build-progress fresh so UnitDestroyed can scale - -- the burst even though the unit is already dead then. - local isBuilt, bp = spGetUnitIsBeingBuilt(nowReclaiming) - if isBuilt and bp then - reclaimTargetBuildProgress[nowReclaiming] = bp - else - reclaimTargetBuildProgress[nowReclaiming] = nil + local ex, ey, ez, inverse, jitterRadius, isResurrect, targetUnitID = resolveTarget(info, cmdID, targetID) + -- Record this builder as actively reclaiming `targetUnitID` + -- so the UnitDestroyed callin can fire a finishing burst + -- only from builders that contributed (= teams that got + -- the metal). Tracked even when this scan's emission gets + -- throttled away, so the burst still fires off-screen. + -- If the builder switched targets (or away from reclaim), + -- drop its membership in the previous target's set so a + -- later reclaim of that earlier unit doesn't credit a + -- builder that long-since moved on. + local nowReclaiming = (targetUnitID and inverse and info.targetMeta and info.targetMeta.isReclaim) and targetUnitID or nil + local prevReclaiming = info.reclaimTarget + if prevReclaiming ~= nowReclaiming then + if prevReclaiming then + local prevSet = reclaimedTargets[prevReclaiming] + if prevSet then + prevSet[unitID] = nil + if next(prevSet) == nil then + reclaimedTargets[prevReclaiming] = nil + end + end + end + info.reclaimTarget = nowReclaiming end - end - if ex then - -- Off-screen throttle. Test view-frustum at the target - -- endpoint (covers the whole spray for a builder near its - -- target). Cached on targetMeta + invalidated by - -- piecePosEpoch -> at most one IsSphereInView per builder - -- per scan, dropped emissions skip emitNano entirely. - if offscreenKeep < 1.0 then - local meta = info.targetMeta - local visible - if meta and meta.visEpoch == piecePosEpoch then - visible = meta.visible + if nowReclaiming then + local set = reclaimedTargets[nowReclaiming] + if set then + set[unitID] = true else - visible = Spring.IsSphereInView(ex, ey, ez, 64) and true or false - if meta then - meta.visEpoch = piecePosEpoch - meta.visible = visible - end + reclaimedTargets[nowReclaiming] = { [unitID] = true } end - if not visible and mathRandom() > offscreenKeep then - ex = nil + -- Keep build-progress fresh so UnitDestroyed can scale + -- the burst even though the unit is already dead then. + local isBuilt, bp = spGetUnitIsBeingBuilt(nowReclaiming) + if isBuilt and bp then + reclaimTargetBuildProgress[nowReclaiming] = bp + else + reclaimTargetBuildProgress[nowReclaiming] = nil end end - -- Distance throttle. Below near-range we keep all; in the - -- ramp band we lerp keep-fraction in squared distance - -- (more aggressive culling at the far end); beyond far-range - -- we clamp to DISTANT_EMIT_KEEP. - if ex and DISTANT_EMIT_KEEP < 1.0 then - local ddx = ex - camX - local ddy = ey - camY - local ddz = ez - camZ - local d2 = ddx*ddx + ddy*ddy + ddz*ddz - if d2 > DISTANT_EMIT_NEAR_SQ then - local keep - if d2 >= DISTANT_EMIT_FAR_SQ then - keep = DISTANT_EMIT_KEEP + if ex then + -- Off-screen throttle. Test view-frustum at the target + -- endpoint (covers the whole spray for a builder near its + -- target). Cached on targetMeta + invalidated by + -- piecePosEpoch -> at most one IsSphereInView per builder + -- per scan, dropped emissions skip emitNano entirely. + if offscreenKeep < 1.0 then + local meta = info.targetMeta + local visible + if meta and meta.visEpoch == piecePosEpoch then + visible = meta.visible else - local t = (d2 - DISTANT_EMIT_NEAR_SQ) * DISTANT_EMIT_BAND_INV - keep = 1.0 - DISTANT_EMIT_DROP * t + visible = Spring.IsSphereInView(ex, ey, ez, 64) and true or false + if meta then + meta.visEpoch = piecePosEpoch + meta.visible = visible + end end - if mathRandom() > keep then + if not visible and mathRandom() > offscreenKeep then ex = nil end end - end - end - if ex then - if DEBUG then _dbgEmits = _dbgEmits + 1 end - -- Factories always use the engine's fixed 0.15 jitter regardless of buildee size. - if info.isFactory then jitterRadius = nil end - -- Per-visit emission count scales with actual buildpower - -- throughput (buildSpeed * bp), so a 100-BP commander - -- assisting a 3000-BP factory emits ~1/30th as many - -- particles -- not the same number, which would visually - -- erase its contribution. Integrated over real elapsed - -- frames since this builder's last visit so the count is - -- proportional regardless of stride/runEvery throttling - -- and per-builder visit-skip RNG. - info.lastVisitFrame = frame - -- Always emit only this frame's share. No catch-up burst - -- when a builder was skipped due to pool saturation. - local elapsed = 1 - local rate = (info.buildSpeed * bp / EMIT_REF_BUILDSPEED) * elapsed * (NanoParticleRate or 1.0) - -- Deterministic accumulator: carries the fractional - -- remainder across visits. Eliminates the Bernoulli jitter - -- / "guaranteed at least 1" floors that previously - -- equalised low-BP and high-BP builders working the same target. - local accum = (info.emitAccum or 0) + rate - local emits = mathFloor(accum) - info.emitAccum = accum - emits - -- Feedback floor: ensure low-BP builders still spit a - -- particle every FEEDBACK_EMIT_MIN_GAP frames so the - -- player sees that work is happening. Debit the forced - -- emit from the accumulator (allowed to go negative) so - -- the long-run rate stays proportional to bp. - if emits == 0 and bp > 0 then - local lastEmit = info.lastEmitFrame or 0 - if frame - lastEmit >= FEEDBACK_EMIT_MIN_GAP then - emits = 1 - info.emitAccum = info.emitAccum - 1 + -- Distance throttle. Below near-range we keep all; in the + -- ramp band we lerp keep-fraction in squared distance + -- (more aggressive culling at the far end); beyond far-range + -- we clamp to DISTANT_EMIT_KEEP. + if ex and DISTANT_EMIT_KEEP < 1.0 then + local ddx = ex - camX + local ddy = ey - camY + local ddz = ez - camZ + local d2 = ddx * ddx + ddy * ddy + ddz * ddz + if d2 > DISTANT_EMIT_NEAR_SQ then + local keep + if d2 >= DISTANT_EMIT_FAR_SQ then + keep = DISTANT_EMIT_KEEP + else + local t = (d2 - DISTANT_EMIT_NEAR_SQ) * DISTANT_EMIT_BAND_INV + keep = 1.0 - DISTANT_EMIT_DROP * t + end + if mathRandom() > keep then + ex = nil + end + end end end - if emits > 0 then - info.lastEmitFrame = frame - end - -- Spread window (half-width in frames) for the in-batch - -- stagger inside emitNano. Particles end up in - -- [-spreadWindow, +spreadWindow] frames of velocity - -- around the nanopiece -- a few slightly behind (model - -- occlusion) and a few slightly ahead. Hard-capped at - -- MAX_SPREAD_AHEAD_FRAMES so the cluster stays close to - -- the source, never partway to the target. Direction - -- jitter already provides lateral spread -- this just - -- breaks the on-axis pile-up of a multi-particle batch. - -- Count compensation still uses full `elapsed`, so total - -- emission rate is preserved. - local spreadWindow = math.min(MAX_SPREAD_AHEAD_FRAMES, elapsed) - local resurrectEmits = isResurrect and takeScaledEmitCount(info, "resurrectEmitAccum", emits, NanoParticleResurrectExtraRate) or emits - if resurrectEmits > 0 then - local n = info.nPieces - if n == 1 then - -- Single-piece batched: amortise piece-pos - -- lookup, sqrt, range gate, normalize, jitter - -- scale across all particles in this emission. - local p1 = info.pieces[1] - emitNano(unitID, info, ex, ey, ez, inverse, jitterRadius, frame, targetUnitID, p1, resurrectEmits, spreadWindow) - if isResurrect then - emitNano(unitID, info, ex, ey, ez, true, jitterRadius, frame, nil, p1, resurrectEmits, spreadWindow) + if ex then + if DEBUG then + _dbgEmits = _dbgEmits + 1 + end + -- Factories always use the engine's fixed 0.15 jitter regardless of buildee size. + if info.isFactory then + jitterRadius = nil + end + -- Per-visit emission count scales with actual buildpower + -- throughput (buildSpeed * bp), so a 100-BP commander + -- assisting a 3000-BP factory emits ~1/30th as many + -- particles -- not the same number, which would visually + -- erase its contribution. Integrated over real elapsed + -- frames since this builder's last visit so the count is + -- proportional regardless of stride/runEvery throttling + -- and per-builder visit-skip RNG. + info.lastVisitFrame = frame + -- Always emit only this frame's share. No catch-up burst + -- when a builder was skipped due to pool saturation. + local elapsed = 1 + local rate = (info.buildSpeed * bp / EMIT_REF_BUILDSPEED) * elapsed * (NanoParticleRate or 1.0) + -- Deterministic accumulator: carries the fractional + -- remainder across visits. Eliminates the Bernoulli jitter + -- / "guaranteed at least 1" floors that previously + -- equalised low-BP and high-BP builders working the same target. + local accum = (info.emitAccum or 0) + rate + local emits = mathFloor(accum) + info.emitAccum = accum - emits + -- Feedback floor: ensure low-BP builders still spit a + -- particle every FEEDBACK_EMIT_MIN_GAP frames so the + -- player sees that work is happening. Debit the forced + -- emit from the accumulator (allowed to go negative) so + -- the long-run rate stays proportional to bp. + if emits == 0 and bp > 0 then + local lastEmit = info.lastEmitFrame or 0 + if frame - lastEmit >= FEEDBACK_EMIT_MIN_GAP then + emits = 1 + info.emitAccum = info.emitAccum - 1 end - else - -- Multi-piece: distribute `emits` across all nano - -- pieces in round-robin from the saved cursor, then - -- ONE batched emitNano per piece. The naive - -- one-per-iteration loop missed the piecePosCache - -- on every call (different pieceIdx -> different - -- key) so each particle paid full piece-pos / - -- sqrt / range / normalize cost. - local pieces = info.pieces - local startCursor = info.pieceCursor or 0 - local base = mathFloor(resurrectEmits / n) - local rem = resurrectEmits - base * n - for i = 1, n do - local cnt = base - if i <= rem then cnt = cnt + 1 end - if cnt > 0 then - local cursor = startCursor + i - if cursor > n then cursor = cursor - n end - local pIdx = pieces[cursor] - emitNano(unitID, info, ex, ey, ez, inverse, jitterRadius, frame, targetUnitID, pIdx, cnt, spreadWindow) - if isResurrect then - emitNano(unitID, info, ex, ey, ez, true, jitterRadius, frame, nil, pIdx, cnt, spreadWindow) + end + if emits > 0 then + info.lastEmitFrame = frame + end + -- Spread window (half-width in frames) for the in-batch + -- stagger inside emitNano. Particles end up in + -- [-spreadWindow, +spreadWindow] frames of velocity + -- around the nanopiece -- a few slightly behind (model + -- occlusion) and a few slightly ahead. Hard-capped at + -- MAX_SPREAD_AHEAD_FRAMES so the cluster stays close to + -- the source, never partway to the target. Direction + -- jitter already provides lateral spread -- this just + -- breaks the on-axis pile-up of a multi-particle batch. + -- Count compensation still uses full `elapsed`, so total + -- emission rate is preserved. + local spreadWindow = math.min(MAX_SPREAD_AHEAD_FRAMES, elapsed) + local resurrectEmits = isResurrect and takeScaledEmitCount(info, "resurrectEmitAccum", emits, NanoParticleResurrectExtraRate) or emits + if resurrectEmits > 0 then + local n = info.nPieces + if n == 1 then + -- Single-piece batched: amortise piece-pos + -- lookup, sqrt, range gate, normalize, jitter + -- scale across all particles in this emission. + local p1 = info.pieces[1] + emitNano(unitID, info, ex, ey, ez, inverse, jitterRadius, frame, targetUnitID, p1, resurrectEmits, spreadWindow) + if isResurrect then + emitNano(unitID, info, ex, ey, ez, true, jitterRadius, frame, nil, p1, resurrectEmits, spreadWindow) + end + else + -- Multi-piece: distribute `emits` across all nano + -- pieces in round-robin from the saved cursor, then + -- ONE batched emitNano per piece. The naive + -- one-per-iteration loop missed the piecePosCache + -- on every call (different pieceIdx -> different + -- key) so each particle paid full piece-pos / + -- sqrt / range / normalize cost. + local pieces = info.pieces + local startCursor = info.pieceCursor or 0 + local base = mathFloor(resurrectEmits / n) + local rem = resurrectEmits - base * n + for i = 1, n do + local cnt = base + if i <= rem then + cnt = cnt + 1 end + if cnt > 0 then + local cursor = startCursor + i + if cursor > n then + cursor = cursor - n + end + local pIdx = pieces[cursor] + emitNano(unitID, info, ex, ey, ez, inverse, jitterRadius, frame, targetUnitID, pIdx, cnt, spreadWindow) + if isResurrect then + emitNano(unitID, info, ex, ey, ez, true, jitterRadius, frame, nil, pIdx, cnt, spreadWindow) + end + end + end + local newCursor = startCursor + resurrectEmits + while newCursor > n do + newCursor = newCursor - n end + info.pieceCursor = newCursor end - local newCursor = startCursor + resurrectEmits - while newCursor > n do newCursor = newCursor - n end - info.pieceCursor = newCursor end end - end - elseif info.targetMeta then - info.targetMeta = nil -- builder went idle; drop stale cache - info.lastVisitFrame = nil -- prevent burst on resume - local prev = info.reclaimTarget - if prev then - local prevSet = reclaimedTargets[prev] - if prevSet then - prevSet[unitID] = nil - if next(prevSet) == nil then reclaimedTargets[prev] = nil end + elseif info.targetMeta then + info.targetMeta = nil -- builder went idle; drop stale cache + info.lastVisitFrame = nil -- prevent burst on resume + local prev = info.reclaimTarget + if prev then + local prevSet = reclaimedTargets[prev] + if prevSet then + prevSet[unitID] = nil + if next(prevSet) == nil then + reclaimedTargets[prev] = nil + end + end + info.reclaimTarget = nil end - info.reclaimTarget = nil end end end end end - end - end -- if not skipEmit + end -- if not skipEmit -- Flush all spawns AND in-place homing rewrites in a single upload. Spawns -- are at the tail [preUsed..postUsed); homing rewrites can touch arbitrary @@ -3091,8 +3356,12 @@ local function scanBuilders(frame) dirtyMin, dirtyMax = applyGroundClamp(frame, dirtyMin, dirtyMax) local postUsed = nanoVBO.usedElements if postUsed > preUsed then - if preUsed < dirtyMin then dirtyMin = preUsed end - if postUsed > dirtyMax then dirtyMax = postUsed end + if preUsed < dirtyMin then + dirtyMin = preUsed + end + if postUsed > dirtyMax then + dirtyMax = postUsed + end end if dirtyMax > dirtyMin then uploadElementRange(nanoVBO, dirtyMin, dirtyMax) @@ -3107,7 +3376,9 @@ end local function cullDead(frame) local bucket = deathBuckets[frame] - if not bucket then return end + if not bucket then + return + end local nl = deathBuckets.__nanoLight local canRemove = Script.LuaUI("EnvNanoBallisticLightRemove") local nb = #bucket @@ -3156,8 +3427,12 @@ end -- and keeps the engine's MaxNanoParticles budget in sync so we never -- double-spray. local function applyParticleMode(newMode, force) - if (not force) and newMode == NANO_PARTICLE_MODE and nanoVBO ~= nil then return end - if (not force) and newMode == NANO_PARTICLE_MODE and newMode == 0 then return end + if (not force) and newMode == NANO_PARTICLE_MODE and nanoVBO ~= nil then + return + end + if (not force) and newMode == NANO_PARTICLE_MODE and newMode == 0 then + return + end local nl = deathBuckets.__nanoLight if nl and nl.active then local canRemove = Script.LuaUI("EnvNanoBallisticLightRemove") @@ -3174,13 +3449,27 @@ local function applyParticleMode(newMode, force) -- Clear all in-flight homing references; their VBO slots are about to be -- destroyed (or we're entering mode 0 where they're meaningless). - for k in pairs(homingByBuilder) do homingByBuilder[k] = nil end - for k in pairs(homingFwdByTarget) do homingFwdByTarget[k] = nil end - for k in pairs(fadeFwdByTarget) do fadeFwdByTarget[k] = nil end - for k in pairs(targetPosCache) do targetPosCache[k] = nil end - for k in pairs(targetIncompleteCache) do targetIncompleteCache[k] = nil end - for k in pairs(reclaimTargetBuildProgress) do reclaimTargetBuildProgress[k] = nil end - for k in pairs(deathBuckets) do deathBuckets[k] = nil end + for k in pairs(homingByBuilder) do + homingByBuilder[k] = nil + end + for k in pairs(homingFwdByTarget) do + homingFwdByTarget[k] = nil + end + for k in pairs(fadeFwdByTarget) do + fadeFwdByTarget[k] = nil + end + for k in pairs(targetPosCache) do + targetPosCache[k] = nil + end + for k in pairs(targetIncompleteCache) do + targetIncompleteCache[k] = nil + end + for k in pairs(reclaimTargetBuildProgress) do + reclaimTargetBuildProgress[k] = nil + end + for k in pairs(deathBuckets) do + deathBuckets[k] = nil + end liveCount = 0 cleanupGL4() @@ -3240,7 +3529,6 @@ function gadget:PlayerChanged() refreshTeamColors() end - -- Emission once per gameframe (matches the engine's per-frame AddNanoParticle -- cadence for an active builder). function gadget:GameFrame(n) @@ -3253,7 +3541,7 @@ function gadget:GameFrame(n) -- NanoParticleLights = 0/1 enables bridge to deferred lights widget. local nl = deathBuckets.__nanoLight if not nl then - nl = {activeCount = 0, active = {} } + nl = { activeCount = 0, active = {} } deathBuckets.__nanoLight = nl end nl.enabled = (Spring.GetConfigInt("NanoParticleLights", 1) == 1) @@ -3265,9 +3553,7 @@ function gadget:GameFrame(n) nl.minLifetime = 14 nl.maxLifetime = 96 nl.sustainFrac = 0.7 - nl.bridgeReady = Script.LuaUI("EnvNanoBallisticLightSpawn") - and Script.LuaUI("EnvNanoBallisticLightCorrect") - and Script.LuaUI("EnvNanoBallisticLightRemove") + nl.bridgeReady = Script.LuaUI("EnvNanoBallisticLightSpawn") and Script.LuaUI("EnvNanoBallisticLightCorrect") and Script.LuaUI("EnvNanoBallisticLightRemove") else if nl.activeCount > 0 then local canRemove = Script.LuaUI("EnvNanoBallisticLightRemove") @@ -3310,16 +3596,24 @@ function gadget:GameFrame(n) -- rate. do local a = NanoParticleRate or 1.0 - if type(a) ~= "number" then a = 1.0 end - if a < 0.0 then a = 0.0 end - if a > 1.0 then a = 1.0 end + if type(a) ~= "number" then + a = 1.0 + end + if a < 0.0 then + a = 0.0 + end + if a > 1.0 then + a = 1.0 + end NanoParticleRate = a end end -- Mode 0 = engine renders the spray; we just track builders for a quick -- restart if the user switches back to gadget mode. - if NANO_PARTICLE_MODE == 0 then return end + if NANO_PARTICLE_MODE == 0 then + return + end -- Periodic team-color refresh: colors can change mid-game (commshare, -- alliance, custom recolor widgets). Cheap (one Spring call per cached @@ -3369,12 +3663,7 @@ function gadget:GameFrame(n) _dbgFrame = _dbgFrame + 1 if _dbgFrame % 30 == 0 then - spEcho(string.format( - "[NanoGL4] f=%d tracked=%d busy/30=%d task=%d emit=%d live=%d used=%d | scan=%.2fms cull=%.2fms draw=%.2fms(x%d) rescan=%.2fms", - n, #trackedBuildersList, _dbgBuilders, _dbgWithTask, _dbgEmits, - liveCount, nanoVBO and nanoVBO.usedElements or -1, - _dbgTScan * 1000, _dbgTCull * 1000, _dbgTDraw * 1000, _dbgDraws, - _dbgTRescan * 1000)) + spEcho(string.format("[NanoGL4] f=%d tracked=%d busy/30=%d task=%d emit=%d live=%d used=%d | scan=%.2fms cull=%.2fms draw=%.2fms(x%d) rescan=%.2fms", n, #trackedBuildersList, _dbgBuilders, _dbgWithTask, _dbgEmits, liveCount, nanoVBO and nanoVBO.usedElements or -1, _dbgTScan * 1000, _dbgTCull * 1000, _dbgTDraw * 1000, _dbgDraws, _dbgTRescan * 1000)) _dbgBuilders, _dbgWithTask, _dbgEmits = 0, 0, 0 _dbgTScan, _dbgTCull, _dbgTDraw, _dbgTRescan, _dbgDraws = 0, 0, 0, 0, 0 end @@ -3386,19 +3675,7 @@ function gadget:GameFrame(n) if CLAMP_DEBUG and (n % 90 == 0) then local checks = clampDbg.emitChecks local enabledPct = (checks > 0) and (100.0 * clampDbg.emitEnabled / checks) or 0.0 - spEcho(string.format( - "[NanoGL4 ClampDbg] f=%d checks=%d enabled=%d(%.1f%%) reg=%d subsetNow=%d subsetMax=%d proc=%d corr=%d drop=%d", - n, - checks, - clampDbg.emitEnabled, - enabledPct, - clampDbg.registered, - #groundClampParticles, - clampDbg.maxSubset, - clampDbg.processed, - clampDbg.corrected, - clampDbg.dropped - )) + spEcho(string.format("[NanoGL4 ClampDbg] f=%d checks=%d enabled=%d(%.1f%%) reg=%d subsetNow=%d subsetMax=%d proc=%d corr=%d drop=%d", n, checks, clampDbg.emitEnabled, enabledPct, clampDbg.registered, #groundClampParticles, clampDbg.maxSubset, clampDbg.processed, clampDbg.corrected, clampDbg.dropped)) clampDbg.emitChecks = 0 clampDbg.emitEnabled = 0 clampDbg.registered = 0 @@ -3412,10 +3689,16 @@ end -- Builder tracking ---------------------------------------------------------- function trackUnit(unitID, unitDefID) - if trackedBuilders[unitID] then return end + if trackedBuilders[unitID] then + return + end unitDefID = unitDefID or Spring.GetUnitDefID(unitID) - if not unitDefID then return end - if nonBuilderDefs[unitDefID] then return end + if not unitDefID then + return + end + if nonBuilderDefs[unitDefID] then + return + end local ud = UnitDefs[unitDefID] -- Accept anything that can build (buildSpeed > 0): covers commanders, -- construction units, factories, nano turrets, resurrectors, etc. The @@ -3426,20 +3709,22 @@ function trackUnit(unitID, unitDefID) end local idx = #trackedBuildersList + 1 trackedBuildersList[idx] = unitID - trackedBuilders[unitID] = idx + trackedBuilders[unitID] = idx end local function untrackUnit(unitID) local idx = trackedBuilders[unitID] - if not idx then return end + if not idx then + return + end local n = #trackedBuildersList if idx ~= n then local swapID = trackedBuildersList[n] - trackedBuildersList[idx] = swapID - trackedBuilders[swapID] = idx + trackedBuildersList[idx] = swapID + trackedBuilders[swapID] = idx end - trackedBuildersList[n] = nil - trackedBuilders[unitID] = nil + trackedBuildersList[n] = nil + trackedBuilders[unitID] = nil end function gadget:UnitCreated(unitID, unitDefID) @@ -3451,8 +3736,8 @@ function gadget:UnitFinished(unitID, unitDefID) -- letting them coast into the now-finished unit and pop on natural death. fadeOutHomingFwd(unitID) homingFwdByTarget[unitID] = nil - fadeFwdByTarget[unitID] = nil - targetPosCache[unitID] = nil + fadeFwdByTarget[unitID] = nil + targetPosCache[unitID] = nil -- Keep a completion timestamp so HOMING_SKIP_GRACE_FRAMES still applies -- after UnitFinished; clearing this here made fresh emissions immediately -- re-enter forward homing and chase units as they roll out of factories. @@ -3466,8 +3751,8 @@ function gadget:UnitFinished(unitID, unitDefID) local bid = trackedBuildersList[i] local info = builderCache[bid] if info and info.targetID == unitID then - info.cmdID = nil - info.targetID = nil + info.cmdID = nil + info.targetID = nil info.targetMeta = nil end end @@ -3479,7 +3764,9 @@ end -- builderCache is nilled so we still have nPieces to bound the sweep. local function clearPiecePosCache(unitID) local info = builderCache[unitID] - if not info then return end + if not info then + return + end local base = unitID * 256 for i = 1, info.nPieces do piecePosCache[base + info.pieces[i]] = nil @@ -3504,13 +3791,17 @@ end -- already dead so applyHoming will nil the list on the next pass; we only need -- to touch the VBO data here. local function fadeOutHomingInverse(builderID) - if not nanoVBO then return end + if not nanoVBO then + return + end local list = homingByBuilder[builderID] - if not list then return end - local data = nanoVBO.instanceData + if not list then + return + end + local data = nanoVBO.instanceData local idtoIndex = nanoVBO.instanceIDtoIndex - local step = nanoVBO.instanceStep - local frame = Spring.GetGameFrame() + local step = nanoVBO.instanceStep + local frame = Spring.GetGameFrame() local dirtyMin, dirtyMax = math.huge, -1 for i = 1, #list do local p = list[i] @@ -3519,20 +3810,28 @@ local function fadeOutHomingInverse(builderID) local remaining = p.death - frame if remaining > 0 then local fadeFrames = mathFloor(FADE_FRAMES_DEATH * (0.4 + mathRandom())) - if fadeFrames < 1 then fadeFrames = 1 end - if fadeFrames > remaining then fadeFrames = remaining end + if fadeFrames < 1 then + fadeFrames = 1 + end + if fadeFrames > remaining then + fadeFrames = remaining + end local newDeath = frame + fadeFrames local base = (slot - 1) * step - data[base+16] = newDeath - local packed = data[base+4] + data[base + 16] = newDeath + local packed = data[base + 4] local absPacked = packed < 0 and -packed or packed - local oldFade = mathFloor(absPacked / 1024) - local sizeBits = absPacked - oldFade * 1024 + local oldFade = mathFloor(absPacked / 1024) + local sizeBits = absPacked - oldFade * 1024 local newPacked = sizeBits + fadeFrames * 1024 - data[base+4] = packed < 0 and -newPacked or newPacked + data[base + 4] = packed < 0 and -newPacked or newPacked local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end end end end @@ -3547,19 +3846,25 @@ end -- trajectory while fading out. Slot reclamation still happens at the original -- death frame (deathBuckets is untouched); the shader renders nothing in the gap. fadeOutHomingFwd = function(unitID, includeSkipList) - if not nanoVBO then return end - local list = homingFwdByTarget[unitID] + if not nanoVBO then + return + end + local list = homingFwdByTarget[unitID] local flist = includeSkipList and fadeFwdByTarget[unitID] or nil - if not list and not flist then return end - local data = nanoVBO.instanceData + if not list and not flist then + return + end + local data = nanoVBO.instanceData local idtoIndex = nanoVBO.instanceIDtoIndex - local step = nanoVBO.instanceStep - local frame = Spring.GetGameFrame() + local step = nanoVBO.instanceStep + local frame = Spring.GetGameFrame() -- Per-particle fade duration: FADE_FRAMES_DEATH * (0.4..1.6). Staggers the -- dissolve so particles don't all wink out on the same frame. local dirtyMin, dirtyMax = math.huge, -1 local function fadeList(plist) - if not plist then return end + if not plist then + return + end for i = 1, #plist do local p = plist[i] local slot = idtoIndex[p.id] @@ -3567,27 +3872,35 @@ fadeOutHomingFwd = function(unitID, includeSkipList) local remaining = p.death - frame if remaining > 0 then local fadeFrames = mathFloor(FADE_FRAMES_DEATH * (0.4 + mathRandom())) - if fadeFrames < 1 then fadeFrames = 1 end + if fadeFrames < 1 then + fadeFrames = 1 + end -- Clamp to remaining lifetime: never extend a particle's life, -- only shorten/replace it. - if fadeFrames > remaining then fadeFrames = remaining end + if fadeFrames > remaining then + fadeFrames = remaining + end local newDeath = frame + fadeFrames local base = (slot - 1) * step - data[base+16] = newDeath + data[base + 16] = newDeath -- Force per-particle fade window so reclaim-style (fadeFrames=0) -- particles also dissolve. w is packed: preserve sizeMult bits, -- replace only the fadeFrames portion. -- NOTE: inverse (reclaim) particles store a negative value; use -- abs before bit-manipulation and restore the sign afterward. - local packed = data[base+4] + local packed = data[base + 4] local absPacked = packed < 0 and -packed or packed - local oldFade = mathFloor(absPacked / 1024) + local oldFade = mathFloor(absPacked / 1024) local sizeBits = absPacked - oldFade * 1024 local newPacked = sizeBits + fadeFrames * 1024 - data[base+4] = packed < 0 and -newPacked or newPacked + data[base + 4] = packed < 0 and -newPacked or newPacked local s0 = slot - 1 - if s0 < dirtyMin then dirtyMin = s0 end - if s0 + 1 > dirtyMax then dirtyMax = s0 + 1 end + if s0 < dirtyMin then + dirtyMin = s0 + end + if s0 + 1 > dirtyMax then + dirtyMax = s0 + 1 + end end end end @@ -3623,8 +3936,8 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD builderCache[unitID] = nil homingByBuilder[unitID] = nil homingFwdByTarget[unitID] = nil - fadeFwdByTarget[unitID] = nil - targetPosCache[unitID] = nil + fadeFwdByTarget[unitID] = nil + targetPosCache[unitID] = nil targetIncompleteCache[unitID] = nil untrackUnit(unitID) end @@ -3639,17 +3952,21 @@ function gadget:RenderUnitDestroyed(unitID) builderCache[unitID] = nil homingByBuilder[unitID] = nil homingFwdByTarget[unitID] = nil - fadeFwdByTarget[unitID] = nil - targetPosCache[unitID] = nil + fadeFwdByTarget[unitID] = nil + targetPosCache[unitID] = nil targetIncompleteCache[unitID] = nil untrackUnit(unitID) end function gadget:DrawWorld() - if not nanoVBO or nanoVBO.usedElements == 0 then return end + if not nanoVBO or nanoVBO.usedElements == 0 then + return + end local t0 - if DEBUG then t0 = Spring.GetTimer() end + if DEBUG then + t0 = Spring.GetTimer() + end -- Defensive GL state setup. DrawWorld is a shared pass -- other widgets/ -- gadgets (placement preview, ghost overlays, range rings, command UI) can @@ -3711,7 +4028,7 @@ function gadget:DrawWorld() -- Bit value must match GHOST_STENCIL_BIT in gfx_DrawUnitShape_GL4.lua. local GHOST_STENCIL_BIT = 0x40 gl.StencilTest(true) - gl.StencilMask(0) -- never write stencil + gl.StencilMask(0) -- never write stencil gl.StencilOp(GL.KEEP, GL.KEEP, GL.KEEP) -- Pass 1. gl.StencilFunc(GL.NOTEQUAL, GHOST_STENCIL_BIT, GHOST_STENCIL_BIT) diff --git a/luarules/gadgets/gfx_plasma_cannon_gl4.lua b/luarules/gadgets/gfx_plasma_cannon_gl4.lua index 8227fcce9a7..b4bdbb581c6 100644 --- a/luarules/gadgets/gfx_plasma_cannon_gl4.lua +++ b/luarules/gadgets/gfx_plasma_cannon_gl4.lua @@ -5,7 +5,9 @@ -- energy shapes that mimic the old staged trailing ball look. -------------------------------------------------------------------------------- -if gadgetHandler:IsSyncedCode() then return end +if gadgetHandler:IsSyncedCode() then + return +end function gadget:GetInfo() return { @@ -22,31 +24,31 @@ end -------------------------------------------------------------------------------- -- Localized functions -------------------------------------------------------------------------------- -local spEcho = Spring.Echo -local spGetVisibleProjectiles = Spring.GetVisibleProjectiles -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spIsPosInAirLos = Spring.IsPosInAirLos -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetGameFrame = Spring.GetGameFrame -local spGetFrameTimeOffset = Spring.GetFrameTimeOffset - -local glBlending = gl.Blending -local glTexture = gl.Texture +local spEcho = Spring.Echo +local spGetVisibleProjectiles = Spring.GetVisibleProjectiles +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spIsPosInAirLos = Spring.IsPosInAirLos +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetGameFrame = Spring.GetGameFrame +local spGetFrameTimeOffset = Spring.GetFrameTimeOffset + +local glBlending = gl.Blending +local glTexture = gl.Texture local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local glCulling = gl.Culling +local glCulling = gl.Culling -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA -local mathMin = math.min -local mathSqrt = math.sqrt +local mathMin = math.min +local mathSqrt = math.sqrt local LuaShader = gl.LuaShader local uploadAllElements = gl.InstanceVBOTable.uploadAllElements @@ -56,53 +58,53 @@ local uploadAllElements = gl.InstanceVBOTable.uploadAllElements -------------------------------------------------------------------------------- -- Limits -local INITIAL_VBO_SIZE = 128 -- starting VBO capacity (doubles automatically when exceeded) -local IDLE_SKIP_FRAMES = 3 -- draw-frames to skip polling when no projectiles active +local INITIAL_VBO_SIZE = 128 -- starting VBO capacity (doubles automatically when exceeded) +local IDLE_SKIP_FRAMES = 3 -- draw-frames to skip polling when no projectiles active -- Textures local plasmaTexture = "bitmaps/projectiletextures/plasmaball.tga" -local glowTexture = "bitmaps/projectiletextures/glow2.tga" +local glowTexture = "bitmaps/projectiletextures/glow2.tga" -- Glow billboard config -local GLOW_SIZE_MULT = 10 -- glow billboard size as multiple of projectile cross-section size -local GLOW_BRIGHTNESS = 0.1 -- glow color multiplier (faint) -local GLOW_REF_SIZE = 5.0 -- weapons at this size (after SIZE_MULT) get full glow; smaller ones dim proportionally +local GLOW_SIZE_MULT = 10 -- glow billboard size as multiple of projectile cross-section size +local GLOW_BRIGHTNESS = 0.1 -- glow color multiplier (faint) +local GLOW_REF_SIZE = 5.0 -- weapons at this size (after SIZE_MULT) get full glow; smaller ones dim proportionally -- Cross-section billboard (camera-facing round blob, visible when looking along velocity) -local CROSS_SECTION_BRIGHTNESS = 0.7 -- brightness multiplier for the head-on cross-section +local CROSS_SECTION_BRIGHTNESS = 0.7 -- brightness multiplier for the head-on cross-section -- Projectile sizing: the quad is elongated along velocity to create the trail shape -local SIZE_MULT = 1.5 -- global multiplier on weapon projectile size (cross-section width) -local RANGE_SIZE_BONUS = 2.0 -- max extra size added for long-range weapons (at RANGE_SIZE_REF range) -local RANGE_SIZE_REF = 1500 -- weapon range (elmos) at which full RANGE_SIZE_BONUS is applied +local SIZE_MULT = 1.5 -- global multiplier on weapon projectile size (cross-section width) +local RANGE_SIZE_BONUS = 2.0 -- max extra size added for long-range weapons (at RANGE_SIZE_REF range) +local RANGE_SIZE_REF = 1500 -- weapon range (elmos) at which full RANGE_SIZE_BONUS is applied -- Core color boost -local CORE_COLOR_ADD = 0.4 -- added to weapon RGB to create brighter core color +local CORE_COLOR_ADD = 0.4 -- added to weapon RGB to create brighter core color -- Shader config (injected as #defines) local shaderConfig = { -- Shape (elongation scales with speed: min at rest, max at ELONGATION_SPEED_REF elmos/frame) - ELONGATION_MIN = 2.2, -- elongation at zero speed (nearly round) - ELONGATION_MAX = 6.5, -- elongation at or above reference speed + ELONGATION_MIN = 2.2, -- elongation at zero speed (nearly round) + ELONGATION_MAX = 6.5, -- elongation at or above reference speed ELONGATION_SPEED_REF = 25, -- speed (elmos/frame) at which max elongation is reached -- Noise displacement for blobby organic shape - NOISE_SCALE = 4.5, -- frequency of noise pattern (lower = bigger blobs) - NOISE_STRENGTH = 1.1, -- how much noise distorts the shape (higher = more blobby) - NOISE_SPEED = 50.0, -- animation speed of noise - SWIRL_SPEED = 365.0, -- rotation speed of swirl effect - SWIRL_STRENGTH = 5, -- intensity of swirl distortion (higher = more visible rotation) + NOISE_SCALE = 4.5, -- frequency of noise pattern (lower = bigger blobs) + NOISE_STRENGTH = 1.1, -- how much noise distorts the shape (higher = more blobby) + NOISE_SPEED = 50.0, -- animation speed of noise + SWIRL_SPEED = 365.0, -- rotation speed of swirl effect + SWIRL_STRENGTH = 5, -- intensity of swirl distortion (higher = more visible rotation) -- Core/edge color blending (radially from center) - CORE_EDGE_START = 0.1, -- radial distance where core-to-edge blend starts - CORE_EDGE_END = 0.25, -- radial distance where blend is fully edge color - CORE_BRIGHTNESS = 1.0, -- extra brightness for core center - BRIGHTNESS_MULT = 0.75, -- overall brightness multiplier (compensates for 2 additive cross passes) - EDGE_SOFTNESS = 0.22, -- how soft the outer edge is + CORE_EDGE_START = 0.1, -- radial distance where core-to-edge blend starts + CORE_EDGE_END = 0.25, -- radial distance where blend is fully edge color + CORE_BRIGHTNESS = 1.0, -- extra brightness for core center + BRIGHTNESS_MULT = 0.75, -- overall brightness multiplier (compensates for 2 additive cross passes) + EDGE_SOFTNESS = 0.22, -- how soft the outer edge is -- Trail shape: the blob is shifted forward and fades toward the back - TRAIL_SHIFT = 0, -- how much the bright center shifts toward the front (0 = centered) - TRAIL_FALLOFF = 2, -- how quickly brightness drops off toward the back (higher = sharper tail) + TRAIL_SHIFT = 0, -- how much the bright center shifts toward the front (0 = centered) + TRAIL_FALLOFF = 2, -- how quickly brightness drops off toward the back (higher = sharper tail) } -------------------------------------------------------------------------------- @@ -123,24 +125,31 @@ for weaponID, weaponDef in pairs(WeaponDefs) do local cp = weaponDef.customParams or {} if not cp.bogus then - local size = tonumber(cp.plasma_size_orig) or weaponDef.size or 1.5 - local range = weaponDef.range or 300 - - size = (size * 0.55) + (weaponDef.damageAreaOfEffect / 66) -- add blast radius to size for better core/edge color distribution - size = size + RANGE_SIZE_BONUS * mathMin(1, range / RANGE_SIZE_REF) -- longer-range weapons get bigger projectiles - - weaponConfigs[weaponID] = { - colorR = r, colorG = g, colorB = b, - coreR = coreR, coreG = coreG, coreB = coreB, - size = size * SIZE_MULT, - } + local size = tonumber(cp.plasma_size_orig) or weaponDef.size or 1.5 + local range = weaponDef.range or 300 + + size = (size * 0.55) + (weaponDef.damageAreaOfEffect / 66) -- add blast radius to size for better core/edge color distribution + size = size + RANGE_SIZE_BONUS * mathMin(1, range / RANGE_SIZE_REF) -- longer-range weapons get bigger projectiles + + weaponConfigs[weaponID] = { + colorR = r, + colorG = g, + colorB = b, + coreR = coreR, + coreG = coreG, + coreB = coreB, + size = size * SIZE_MULT, + } end end end -- Check if we have any cannon weapons local hasConfigs = false -for _ in pairs(weaponConfigs) do hasConfigs = true; break end +for _ in pairs(weaponConfigs) do + hasConfigs = true + break +end if not hasConfigs then function gadget:Initialize() gadgetHandler:RemoveGadget() @@ -151,7 +160,7 @@ end -------------------------------------------------------------------------------- -- Projectile tracking (stable noise seed per projectile) -------------------------------------------------------------------------------- -local projectileSeeds = {} -- proID -> random seed +local projectileSeeds = {} -- proID -> random seed -- Subscription handle for the shared projectile dispatcher (set in Initialize). -- When nil, we fall back to calling Spring.GetVisibleProjectiles directly. @@ -685,7 +694,7 @@ void main(void) -------------------------------------------------------------------------------- local plasmaVBO local plasmaShader -local crossShader -- 90-degree rotated copy for volume from all angles +local crossShader -- 90-degree rotated copy for volume from all angles local crossSectionShader -- camera-facing circular billboard for head-on view local glowShader @@ -788,19 +797,15 @@ local function initGL4() end -- Shared quad VBOs - local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO( - -1, -1, 1, 1, - 0, 0, 1, 1, - "plasmaQuadVBO" - ) + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, -1, 1, 1, 0, 0, 1, 1, "plasmaQuadVBO") local indexVBO = gl.InstanceVBOTable.makeRectIndexVBO("plasmaIndexVBO") -- Instance VBO layout: 4 vec4s = stride 16 local plasmaLayout = { - {id = 1, name = 'posAndSize', size = 4}, -- xyz = pos, w = size - {id = 2, name = 'coreColor', size = 4}, -- rgb = core, a = alpha - {id = 3, name = 'edgeColorAndSeed', size = 4}, -- rgb = edge, a = noise seed - {id = 4, name = 'velocityAndLife', size = 4}, -- xyz = velDir (normalized), w = speed + { id = 1, name = "posAndSize", size = 4 }, -- xyz = pos, w = size + { id = 2, name = "coreColor", size = 4 }, -- rgb = core, a = alpha + { id = 3, name = "edgeColorAndSeed", size = 4 }, -- rgb = edge, a = noise seed + { id = 4, name = "velocityAndLife", size = 4 }, -- xyz = velDir (normalized), w = speed } plasmaVBO = gl.InstanceVBOTable.makeInstanceVBOTable(plasmaLayout, INITIAL_VBO_SIZE, "plasmaCannonVBO") if not plasmaVBO then @@ -819,7 +824,9 @@ end local function resizePlasmaVBO(needed) local newMax = plasmaVBO.maxElements - while newMax < needed do newMax = newMax * 2 end + while newMax < needed do + newMax = newMax * 2 + end plasmaVBO.maxElements = newMax local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(newMax, plasmaVBO.layout) @@ -827,21 +834,28 @@ local function resizePlasmaVBO(needed) plasmaVBO.instanceVBO = newInstanceVBO local data = plasmaVBO.instanceData local step = plasmaVBO.instanceStep - for i = #data + 1, step * newMax do data[i] = 0 end + for i = #data + 1, step * newMax do + data[i] = 0 + end plasmaVBO.VAO:Delete() plasmaVBO.VAO = plasmaVBO:makeVAOandAttach(plasmaVBO.vertexVBO, plasmaVBO.instanceVBO) plasmaVBO.VAO:AttachIndexBuffer(plasmaVBO.indexVBO) end local function cleanupGL4() - if plasmaVBO then plasmaVBO:Delete(); plasmaVBO = nil end + if plasmaVBO then + plasmaVBO:Delete() + plasmaVBO = nil + end end -------------------------------------------------------------------------------- -- Drawing -------------------------------------------------------------------------------- local function drawAll() - if plasmaVBO.usedElements == 0 then return end + if plasmaVBO.usedElements == 0 then + return + end glDepthTest(true) glDepthMask(false) @@ -895,8 +909,7 @@ local function updateProjectiles() if usePausedCache then local cx, cy, cz = Spring.GetCameraPosition() local dx, dy, dz = Spring.GetCameraDirection() - if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ - and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then + if cx == pausedCamX and cy == pausedCamY and cz == pausedCamZ and dx == pausedCamDX and dy == pausedCamDY and dz == pausedCamDZ then return end local now = Spring.GetTimer() @@ -967,13 +980,13 @@ local function updateProjectiles() local proTeam = spGetProjectileTeamID(proID) local proAlly = proTeam and spGetTeamAllyTeamID(proTeam) if proAlly ~= myAllyTeam and not spIsPosInAirLos(px, 0, pz, myAllyTeam) then - cfg = nil -- reuse variable to skip without deep nesting + cfg = nil -- reuse variable to skip without deep nesting end end if cfg then local vx, vy, vz = spGetProjectileVelocity(proID) if vx then - local speed = mathSqrt(vx*vx + vy*vy + vz*vz) + local speed = mathSqrt(vx * vx + vy * vy + vz * vz) local dirX, dirY, dirZ if speed > 0.001 then local invSpeed = 1.0 / speed @@ -995,15 +1008,15 @@ local function updateProjectiles() count = count + 1 local offset = (count - 1) * 16 - data[offset + 1] = px - data[offset + 2] = py - data[offset + 3] = pz - data[offset + 4] = cfg.size - data[offset + 5] = cfg.coreR - data[offset + 6] = cfg.coreG - data[offset + 7] = cfg.coreB - data[offset + 8] = 1.0 - data[offset + 9] = cfg.colorR + data[offset + 1] = px + data[offset + 2] = py + data[offset + 3] = pz + data[offset + 4] = cfg.size + data[offset + 5] = cfg.coreR + data[offset + 6] = cfg.coreG + data[offset + 7] = cfg.coreB + data[offset + 8] = 1.0 + data[offset + 9] = cfg.colorR data[offset + 10] = cfg.colorG data[offset + 11] = cfg.colorB data[offset + 12] = seed @@ -1046,9 +1059,13 @@ end -------------------------------------------------------------------------------- function gadget:Initialize() - if not initGL4() then return end + if not initGL4() then + return + end local n = 0 - for _ in pairs(weaponConfigs) do n = n + 1 end + for _ in pairs(weaponConfigs) do + n = n + 1 + end -- Subscribe to the shared projectile dispatcher so we share the per-frame -- GetVisibleProjectiles + GetProjectileDefID scan with the other gfx_*_gl4 @@ -1056,7 +1073,9 @@ function gadget:Initialize() local PS = GG.ProjectileScan if PS then local defIDSet = {} - for wDefID in pairs(weaponConfigs) do defIDSet[wDefID] = true end + for wDefID in pairs(weaponConfigs) do + defIDSet[wDefID] = true + end dispatchHandle = PS.Subscribe("plasma_cannon", defIDSet, PS.SCAN_VISIBLE) end diff --git a/luarules/gadgets/gfx_projectile_dispatch.lua b/luarules/gadgets/gfx_projectile_dispatch.lua index 9c21054e86c..04bdee9964d 100644 --- a/luarules/gadgets/gfx_projectile_dispatch.lua +++ b/luarules/gadgets/gfx_projectile_dispatch.lua @@ -70,14 +70,14 @@ function gadget:GetInfo() return { - name = "Projectile Dispatch", - desc = "Shared per-frame projectile scan + defID filter for other gadgets", - author = "Floris", - date = "May 2026", + name = "Projectile Dispatch", + desc = "Shared per-frame projectile scan + defID filter for other gadgets", + author = "Floris", + date = "May 2026", license = "GNU GPL v2", -- Loaded before all gfx_*_gl4 visual gadgets (which use layer = 0) so -- GG.ProjectileScan exists at their Initialize time. - layer = -50, + layer = -50, enabled = true, } end @@ -90,11 +90,11 @@ end -------------------------------------------------------------------------------- -- Localized engine calls -------------------------------------------------------------------------------- -local spGetVisibleProjectiles = Spring.GetVisibleProjectiles +local spGetVisibleProjectiles = Spring.GetVisibleProjectiles local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetGameFrame = Spring.GetGameFrame -local spGetGameSpeed = Spring.GetGameSpeed +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetGameFrame = Spring.GetGameFrame +local spGetGameSpeed = Spring.GetGameSpeed local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ @@ -102,30 +102,30 @@ local mapSizeZ = Game.mapSizeZ -------------------------------------------------------------------------------- -- Scan IDs -------------------------------------------------------------------------------- -local SCAN_VISIBLE = 1 +local SCAN_VISIBLE = 1 local SCAN_MAP_WEAPONS = 2 -local SCAN_MAP_PIECES = 3 +local SCAN_MAP_PIECES = 3 -------------------------------------------------------------------------------- -- State -------------------------------------------------------------------------------- -- scanState[scanID] = { lastTick, projectiles, projectileCount } local scanState = { - [SCAN_VISIBLE] = { lastTick = -1, projectiles = nil, projectileCount = 0 }, + [SCAN_VISIBLE] = { lastTick = -1, projectiles = nil, projectileCount = 0 }, [SCAN_MAP_WEAPONS] = { lastTick = -1, projectiles = nil, projectileCount = 0 }, - [SCAN_MAP_PIECES] = { lastTick = -1, projectiles = nil, projectileCount = 0 }, + [SCAN_MAP_PIECES] = { lastTick = -1, projectiles = nil, projectileCount = 0 }, } -- subscribersByScan[scanID] = { sub, sub, ... } local subscribersByScan = { - [SCAN_VISIBLE] = {}, + [SCAN_VISIBLE] = {}, [SCAN_MAP_WEAPONS] = {}, - [SCAN_MAP_PIECES] = {}, + [SCAN_MAP_PIECES] = {}, } -- handle -> { name, defIDSet, scanID, matches, matchCount, lastTick } local subscribers = {} -local nextHandle = 0 +local nextHandle = 0 -- Tick monotonically bumps on every sim frame (GameFrame) and on every render -- frame while paused (Update). Each scanID runs at most once per tick. @@ -137,7 +137,9 @@ local lastBumpedSimFrame = -1 -------------------------------------------------------------------------------- local function runScan(scanID) local state = scanState[scanID] - if state.lastTick == currentTick then return end + if state.lastTick == currentTick then + return + end state.lastTick = currentTick local projectiles @@ -157,19 +159,21 @@ local function runScan(scanID) projectiles = spGetProjectilesInRectangle(0, 0, mapSizeX, mapSizeZ, false, true) end - state.projectiles = projectiles + state.projectiles = projectiles state.projectileCount = projectiles and #projectiles or 0 -- Reset all subscribers' match arrays for this scan. - local subs = subscribersByScan[scanID] + local subs = subscribersByScan[scanID] local nSubs = #subs for s = 1, nSubs do local sub = subs[s] sub.matchCount = 0 - sub.lastTick = currentTick + sub.lastTick = currentTick end - if not projectiles or nSubs == 0 then return end + if not projectiles or nSubs == 0 then + return + end -- Single pass: one GetProjectileDefID per projectile, dispatched to every -- interested subscriber. Piece projectiles have no weapon-def ID, so for @@ -182,13 +186,13 @@ local function runScan(scanID) for s = 1, nSubs do local sub = subs[s] local c = sub.matchCount + 1 - sub.matchCount = c - sub.matches[c] = proID + sub.matchCount = c + sub.matches[c] = proID end end else for i = 1, n do - local proID = projectiles[i] + local proID = projectiles[i] local wDefID = spGetProjectileDefID(proID) if wDefID then for s = 1, nSubs do @@ -196,8 +200,8 @@ local function runScan(scanID) local set = sub.defIDSet if not set or set[wDefID] then local c = sub.matchCount + 1 - sub.matchCount = c - sub.matches[c] = proID + sub.matchCount = c + sub.matches[c] = proID sub.matchDefIDs[c] = wDefID end end @@ -217,13 +221,13 @@ local function Subscribe(name, defIDSet, scanID) end nextHandle = nextHandle + 1 local sub = { - name = name, - defIDSet = defIDSet, - scanID = scanID, - matches = {}, + name = name, + defIDSet = defIDSet, + scanID = scanID, + matches = {}, matchDefIDs = {}, - matchCount = 0, - lastTick = -1, + matchCount = 0, + lastTick = -1, } subscribers[nextHandle] = sub subs[#subs + 1] = sub @@ -232,7 +236,9 @@ end local function GetMatches(handle) local sub = subscribers[handle] - if not sub then return nil, 0 end + if not sub then + return nil, 0 + end if sub.lastTick ~= currentTick then runScan(sub.scanID) end @@ -241,7 +247,9 @@ end local function GetMatchesWithDefIDs(handle) local sub = subscribers[handle] - if not sub then return nil, nil, 0 end + if not sub then + return nil, nil, 0 + end if sub.lastTick ~= currentTick then runScan(sub.scanID) end @@ -250,7 +258,9 @@ end local function GetScan(scanID) local state = scanState[scanID] - if not state then return nil, 0 end + if not state then + return nil, 0 + end if state.lastTick ~= currentTick then runScan(scanID) end @@ -265,13 +275,13 @@ function gadget:Initialize() lastBumpedSimFrame = spGetGameFrame() GG.ProjectileScan = { - SCAN_VISIBLE = SCAN_VISIBLE, + SCAN_VISIBLE = SCAN_VISIBLE, SCAN_MAP_WEAPONS = SCAN_MAP_WEAPONS, - SCAN_MAP_PIECES = SCAN_MAP_PIECES, - Subscribe = Subscribe, - GetMatches = GetMatches, - GetMatchesWithDefIDs = GetMatchesWithDefIDs, - GetScan = GetScan, + SCAN_MAP_PIECES = SCAN_MAP_PIECES, + Subscribe = Subscribe, + GetMatches = GetMatches, + GetMatchesWithDefIDs = GetMatchesWithDefIDs, + GetScan = GetScan, } end diff --git a/luarules/gadgets/gfx_raptor_scum_gl4.lua b/luarules/gadgets/gfx_raptor_scum_gl4.lua index 67f6f03e32b..220a9947a88 100644 --- a/luarules/gadgets/gfx_raptor_scum_gl4.lua +++ b/luarules/gadgets/gfx_raptor_scum_gl4.lua @@ -13,11 +13,10 @@ function gadget:GetInfo() end -- TODO: - -- maybe even use parallax - -- add a moving distortion texture - -- also write to deferred buffers maybe? - -- fix stencil testing - +-- maybe even use parallax +-- add a moving distortion texture +-- also write to deferred buffers maybe? +-- fix stencil testing if gadgetHandler:IsSyncedCode() then local pveTeamID = Spring.Utilities.GetScavTeamID() or Spring.Utilities.GetRaptorTeamID() @@ -47,44 +46,46 @@ if gadgetHandler:IsSyncedCode() then if scum.growthrate > 0 then return clamp((gf - scum.spawnframe) * scum.growthrate, 0, scum.radius) else - return clamp(scum.radius - (gf - scum.spawnframe) *(-1.0 * scum.growthrate), 0, scum.radius) + return clamp(scum.radius - (gf - scum.spawnframe) * (-1.0 * scum.growthrate), 0, scum.radius) end end local function GetMapSquareKey(posx, posz) - if posx < 0 or posz < 0 or posx > mapSizeX or posz > mapSizeZ then return nil end - return (floor(posx*0.0009765625) * 1024 + floor(posz* 0.0009765625)) + if posx < 0 or posz < 0 or posx > mapSizeX or posz > mapSizeZ then + return nil + end + return (floor(posx * 0.0009765625) * 1024 + floor(posz * 0.0009765625)) end - for x= 0, math.ceil(mapSizeX/1024) do - for z = 0, math.ceil(mapSizeZ/1024) do - scumBins[x*1024+z] = {} + for x = 0, math.ceil(mapSizeX / 1024) do + for z = 0, math.ceil(mapSizeZ / 1024) do + scumBins[x * 1024 + z] = {} end end function gadget:Initialize() local scumGenerators = { - raptor_hive = {radius = 800, growthrate = 0.8}, - raptor_turret_basic_t3_v1 = {radius = 600, growthrate = 0.4}, - raptor_turret_basic_t2_v1 = {radius = 400, growthrate = 0.2}, - raptor_turret_basic_t4_v1 = {radius = 800, growthrate = 0.8}, - raptor_turret_antiair_t3_v1 = {radius = 600, growthrate = 0.4}, - raptor_turret_antiair_t2_v1 = {radius = 400, growthrate = 0.2}, - raptor_turret_antiair_t4_v1 = {radius = 800, growthrate = 0.8}, - raptor_turret_acid_t3_v1 = {radius = 600, growthrate = 0.4}, - raptor_turret_acid_t2_v1 = {radius = 400, growthrate = 0.2}, - raptor_turret_acid_t4_v1 = {radius = 800, growthrate = 0.8}, - raptor_turret_emp_t3_v1 = {radius = 600, growthrate = 0.4}, - raptor_turret_emp_t2_v1 = {radius = 400, growthrate = 0.2}, - raptor_turret_emp_t4_v1 = {radius = 800, growthrate = 0.8}, - raptor_turret_antinuke_t3_v1 = {radius = 600, growthrate = 0.4}, - raptor_turret_antinuke_t2_v1 = {radius = 400, growthrate = 0.2}, - raptor_turret_meteor_t4_v1 = {radius = 800, growthrate = 0.8}, - - scavbeacon_t1_scav = {radius = 600, growthrate = 0.74}, - scavbeacon_t2_scav = {radius = 800, growthrate = 0.88}, - scavbeacon_t3_scav = {radius = 1000, growthrate = 1}, - scavbeacon_t4_scav = {radius = 1200, growthrate = 1.36}, + raptor_hive = { radius = 800, growthrate = 0.8 }, + raptor_turret_basic_t3_v1 = { radius = 600, growthrate = 0.4 }, + raptor_turret_basic_t2_v1 = { radius = 400, growthrate = 0.2 }, + raptor_turret_basic_t4_v1 = { radius = 800, growthrate = 0.8 }, + raptor_turret_antiair_t3_v1 = { radius = 600, growthrate = 0.4 }, + raptor_turret_antiair_t2_v1 = { radius = 400, growthrate = 0.2 }, + raptor_turret_antiair_t4_v1 = { radius = 800, growthrate = 0.8 }, + raptor_turret_acid_t3_v1 = { radius = 600, growthrate = 0.4 }, + raptor_turret_acid_t2_v1 = { radius = 400, growthrate = 0.2 }, + raptor_turret_acid_t4_v1 = { radius = 800, growthrate = 0.8 }, + raptor_turret_emp_t3_v1 = { radius = 600, growthrate = 0.4 }, + raptor_turret_emp_t2_v1 = { radius = 400, growthrate = 0.2 }, + raptor_turret_emp_t4_v1 = { radius = 800, growthrate = 0.8 }, + raptor_turret_antinuke_t3_v1 = { radius = 600, growthrate = 0.4 }, + raptor_turret_antinuke_t2_v1 = { radius = 400, growthrate = 0.2 }, + raptor_turret_meteor_t4_v1 = { radius = 800, growthrate = 0.8 }, + + scavbeacon_t1_scav = { radius = 600, growthrate = 0.74 }, + scavbeacon_t2_scav = { radius = 800, growthrate = 0.88 }, + scavbeacon_t3_scav = { radius = 1000, growthrate = 1 }, + scavbeacon_t4_scav = { radius = 1200, growthrate = 1.36 }, } for unitDefName, scumParams in pairs(scumGenerators) do if UnitDefNames[unitDefName] then @@ -102,48 +103,53 @@ if gadgetHandler:IsSyncedCode() then scavempspawner_scav = true, scavengerdroppod_scav = true, scavengerdroppodfriendly_scav = true, - scavtacnukespawner_scav = true + scavtacnukespawner_scav = true, } for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.isscavenger and not scumSpawnerExclusions[unitDef.name] and not unitDef.canMove and not string.find(unitDef.name, "lootbox") and not scumSpawnerIDs[unitDefID] and not unitDef.customParams.objectify and not unitDef.canCloak then if unitDef.xsize and unitDef.zsize then - scumSpawnerIDs[unitDefID] = {radius = math.min(600, math.max(150, unitDef.xsize*unitDef.zsize*10)), growthrate = 1.2} + scumSpawnerIDs[unitDefID] = { radius = math.min(600, math.max(150, unitDef.xsize * unitDef.zsize * 10)), growthrate = 1.2 } else - scumSpawnerIDs[unitDefID] = {radius = math.random(150,400), growthrate = 1.2} + scumSpawnerIDs[unitDefID] = { radius = math.random(150, 400), growthrate = 1.2 } end end end - for x = 0, math.ceil(mapSizeX/1024) do - for z = 0, math.ceil(mapSizeZ/1024) do - scumBins[x*1024+z] = {} + for x = 0, math.ceil(mapSizeX / 1024) do + for z = 0, math.ceil(mapSizeZ / 1024) do + scumBins[x * 1024 + z] = {} end end end - -- This checks wether the unit is under any scum - local function IsPosInScum(unitx,unity, unitz) + local function IsPosInScum(unitx, unity, unitz) -- out of bounds check, no scum outside of map bounds - if unitx < 0 or unitz < 0 or unitx > mapSizeX or unitz > mapSizeZ then return nil end + if unitx < 0 or unitz < 0 or unitx > mapSizeX or unitz > mapSizeZ then + return nil + end -- underwater scum doesnt count for hovers, ships unity = unity or 1 - if unity > -1 and spGetGroundHeight(unitx, unitz) < 0 then return nil end + if unity > -1 and spGetGroundHeight(unitx, unitz) < 0 then + return nil + end -- Empty bins also return local scumBinID = GetMapSquareKey(unitx, unitz) - if scumBinID == nil or scumBins[scumBinID] == nil then return nil end + if scumBinID == nil or scumBins[scumBinID] == nil then + return nil + end local gf = spGetGameFrame() for scumID, scum in pairs(scumBins[scumBinID]) do local dx = (unitx - scum.posx) local dz = (unitz - scum.posz) - local sqrdistance = (dx*dx + dz*dz) + local sqrdistance = (dx * dx + dz * dz) local scumradius = scum.radius if sqrdistance < (scumradius * scumradius) then local currentscumradius = GetScumCurrentRadius(scum, gf) --Spring.Echo("testing ScumID", scumID, sqrt(sqrdistance), scumradius, currentscumradius) - if currentscumradius - sqrt(sqrdistance) > boundary then + if currentscumradius - sqrt(sqrdistance) > boundary then return scumID end end @@ -154,9 +160,13 @@ if gadgetHandler:IsSyncedCode() then GG.IsPosInRaptorScum = IsPosInScum --(x,y,z) local function GetRandomScumID(startID) - if numscums < 1 then return end + if numscums < 1 then + return + end local scumID = startID or next(scums) -- so we can start iterating from anywhere - if not scumID then return end -- return nil on no scums + if not scumID then + return + end -- return nil on no scums local randomindex = math.random(1, numscums) for i = 1, randomindex do scumID = next(scums) @@ -164,14 +174,16 @@ if gadgetHandler:IsSyncedCode() then return scumID end - GG.GetRandomScumID = GetRandomScumID -- Returns nil or scumID + GG.GetRandomScumID = GetRandomScumID -- Returns nil or scumID local function GetRandomPositionInScum() local scumID = GetRandomScumID() - if not scumID then return end + if not scumID then + return + end local px, pz - local scum = scums[scumID] + local scum = scums[scumID] local radius = GetScumCurrentRadius(scum) local attempts = 0 repeat @@ -181,10 +193,10 @@ if gadgetHandler:IsSyncedCode() then local x = scum.posx + r * math.cos(theta) local z = scum.posz + r * math.sin(theta) if x > 128 and x < Game.mapSizeX - 128 and z > 128 and z < Game.mapSizeZ - 128 and r > 32 then - px,pz = x,z + px, pz = x, z end until (px and pz) and (attempts < 10) - return px,pz + return px, pz end GG.GetRandomPositionInScum = GetRandomPositionInScum -- Returns nil or (X, Z) @@ -218,7 +230,9 @@ if gadgetHandler:IsSyncedCode() then end local function AddOrUpdateScum(posx, posy, posz, radius, growthrate, scumID) - if debugmode then Spring.Echo("AddOrUpdateScum",posx, posy, posz, radius, growthrate, scumID) end + if debugmode then + Spring.Echo("AddOrUpdateScum", posx, posy, posz, radius, growthrate, scumID) + end -- if scumID is supplied, we are updateing an existing scum instance! local gf = spGetGameFrame() @@ -227,11 +241,11 @@ if gadgetHandler:IsSyncedCode() then -- thus we need to make a new scum, and register it in our scumBins if scums[scumID] == nil then posy = posy or Spring.GetGroundHeight(posx, posz) - scum = {posx = posx, posz = posz, radius = radius, spawnframe = gf, growthrate = growthrate, scumID = scumID} + scum = { posx = posx, posz = posz, radius = radius, spawnframe = gf, growthrate = growthrate, scumID = scumID } scums[scumID] = scum UpdateBins(scumID) numscums = numscums + 1 - else-- a scumID is supplied, meaning we just update an existing instance + else -- a scumID is supplied, meaning we just update an existing instance scum = scums[scumID] -- well then, seems we have to do this after all, when we update a scum, we need to check how long its been alive -- this is the nastiest garbage ive ever done @@ -243,20 +257,24 @@ if gadgetHandler:IsSyncedCode() then end if growthrate > 0 then - scum.spawnframe = gf - ( currentradius/growthrate) + scum.spawnframe = gf - (currentradius / growthrate) -- remove it from the death queue, no matter where it is, cause its 'growing' else - scum.spawnframe = gf - ((scum.radius - currentradius)/ (-1 * growthrate) ) - deathtime = math.floor( gf + (currentradius/(-1 * growthrate))) + scum.spawnframe = gf - ((scum.radius - currentradius) / (-1 * growthrate)) + deathtime = math.floor(gf + (currentradius / (-1 * growthrate))) end scum.growthrate = growthrate - if debugmode then Spring.Echo("Updated scum", scumID, "it was", currentradius,"/", scum.radius, "sized, growing at", growthrate) end + if debugmode then + Spring.Echo("Updated scum", scumID, "it was", currentradius, "/", scum.radius, "sized, growing at", growthrate) + end end --Spring.Echo(scumID, growthrate, radius, gf) if scum.growthrate < 0 then - if debugmode then Spring.Echo("Removal of scum ID", scumID,"Scheduled for ", deathtime - gf , "from now" ) end + if debugmode then + Spring.Echo("Removal of scum ID", scumID, "Scheduled for ", deathtime - gf, "from now") + end if scumRemoveQueue[deathtime] == nil then scumRemoveQueue[deathtime] = {} end @@ -273,15 +291,14 @@ if gadgetHandler:IsSyncedCode() then local scumID = AddOrUpdateScum(px, py, pz, scumSpawnerIDs[unitDefID].radius, scumSpawnerIDs[unitDefID].growthrate, unitID) local scum = scums[scumID] - SendToUnsynced("ScumCreated",scum.posx, scum.posz, scum.radius, scum.growthrate, gf, scumID) + SendToUnsynced("ScumCreated", scum.posx, scum.posz, scum.radius, scum.growthrate, gf, scumID) --Spring.Echo("Scum Created Synced") end end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if scumSpawnerIDs[unitDefID] and scums[unitID] then - AddOrUpdateScum(nil,nil,nil,nil, -10*math.abs(scums[unitID].growthrate), unitID) + AddOrUpdateScum(nil, nil, nil, nil, -10 * math.abs(scums[unitID].growthrate), unitID) SendToUnsynced("ScumRemoved", unitID) end end @@ -303,27 +320,20 @@ if gadgetHandler:IsSyncedCode() then scumRemoveQueue[n] = nil end end - - - -elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED - - - +elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local textureresolution = "low" -- low or high local textures = { low = { texcolorheight = "LuaUI/images/raptor_scum/alien_guts_colorheight.dds", - texnormalspec = "LuaUI/images/raptor_scum/alien_guts_normalspec.dds", - texdistortion = "LuaUI/images/lavadistortion.dds" - }, + texnormalspec = "LuaUI/images/raptor_scum/alien_guts_normalspec.dds", + texdistortion = "LuaUI/images/lavadistortion.dds", + }, high = { texcolorheight = "LuaUI/images/raptor_scum/alien_guts_colorheight.dds", - texnormalspec = "LuaUI/images/raptor_scum/alien_guts_normalspec_u8888.dds", - texdistortion = "LuaUI/images/lavadistortion.png" - }, - } - + texnormalspec = "LuaUI/images/raptor_scum/alien_guts_normalspec_u8888.dds", + texdistortion = "LuaUI/images/lavadistortion.png", + }, + } local resolution = 32 local gameFrame = -1 @@ -338,19 +348,19 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local glTexture = gl.Texture local glCulling = gl.Culling local GL_LEQUAL = GL.LEQUAL - local glStencilFunc = gl.StencilFunc - local glStencilOp = gl.StencilOp - local glStencilMask = gl.StencilMask - local glDepthTest = gl.DepthTest - local glClear = gl.Clear - local GL_ALWAYS = GL.ALWAYS - local GL_NOTEQUAL = GL.NOTEQUAL - local GL_KEEP = 0x1E00 --GL.KEEP + local glStencilFunc = gl.StencilFunc + local glStencilOp = gl.StencilOp + local glStencilMask = gl.StencilMask + local glDepthTest = gl.DepthTest + local glClear = gl.Clear + local GL_ALWAYS = GL.ALWAYS + local GL_NOTEQUAL = GL.NOTEQUAL + local GL_KEEP = 0x1E00 --GL.KEEP local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT - local GL_REPLACE = GL.REPLACE + local GL_REPLACE = GL.REPLACE local shaderConfig = { - SPECULAREXPONENT = 64.0, -- the specular exponent of the lava plane + SPECULAREXPONENT = 64.0, -- the specular exponent of the lava plane SPECULARSTRENGTH = 1.0, -- The peak brightness of specular highlights LOSDARKNESS = 0.5, -- how much to darken the out-of-los areas of the lava plane @@ -360,19 +370,18 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED VOIDWATER = (gl.GetMapRendering("voidWater") and 1 or 0), } - local nightFactor = {1,1,1,1} + local nightFactor = { 1, 1, 1, 1 } ---- GL4 Backend Stuff---- local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable - local uploadAllElements = InstanceVBOTable.uploadAllElements - local popElementInstance = InstanceVBOTable.popElementInstance + local uploadAllElements = InstanceVBOTable.uploadAllElements + local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance - - local vsSrc = [[ + local vsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shader_storage_buffer_object : require @@ -446,8 +455,7 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED } ]] - local fsSrc = - [[ + local fsSrc = [[ #version 330 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -564,8 +572,8 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED ]] local function goodbye(reason) - Spring.Echo("Scum GL4 gadget exiting with reason: "..reason) - gadgetHandler:RemoveGadget() + Spring.Echo("Scum GL4 gadget exiting with reason: " .. reason) + gadgetHandler:RemoveGadget() end local function initGL4(shaderConfig, DPATname) @@ -577,11 +585,10 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - scumShader = LuaShader( - { - vertex = vsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderConfig)), - fragment = fsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderConfig)), - uniformInt = { + scumShader = LuaShader({ + vertex = vsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderConfig)), + fragment = fsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderConfig)), + uniformInt = { heightmapTex = 0, mapnormalsTex = 1, infoTex = 2, @@ -589,24 +596,22 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED colorheight = 4, normalspec = 5, distortion = 6, - }, + }, uniformFloat = { - nightFactor = {1,1,1,1}, + nightFactor = { 1, 1, 1, 1 }, --fadeDistance = 3000, - }, }, - DPATname .. "Shader" - ) + }, DPATname .. "Shader") local shaderCompiled = scumShader:Initialize() if not shaderCompiled then - goodbye("Failed to compile ".. DPATname .." GL4 ") + goodbye("Failed to compile " .. DPATname .. " GL4 ") return end scumVBO = InstanceVBOTable.makeInstanceVBOTable( { - {id = 1, name = 'worldposradius', size = 4}, -- xpos, ypos, zpos, radius - {id = 2, name = 'lifeparams', size = 4}, -- lifestart, lifeend, growthrate, unused + { id = 1, name = "worldposradius", size = 4 }, -- xpos, ypos, zpos, radius + { id = 2, name = "lifeparams", size = 4 }, -- lifestart, lifeend, growthrate, unused }, 64, -- maxelements DPATname .. "VBO" -- name @@ -616,17 +621,13 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED return end - local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1,1,resolution,resolution) - local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution,resolution, true) + local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1, 1, resolution, resolution) + local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution, resolution, true) scumVBO.vertexVBO = planeVBO scumVBO.indexVBO = planeIndexVBO - scumVBO.VAO = InstanceVBOTable.makeVAOandAttach( - scumVBO.vertexVBO, - scumVBO.instanceVBO, - scumVBO.indexVBO) - + scumVBO.VAO = InstanceVBOTable.makeVAOandAttach(scumVBO.vertexVBO, scumVBO.instanceVBO, scumVBO.indexVBO) end local scumRemoveQueue = {} -- maps gameframes to list of scums that will be removed @@ -643,13 +644,15 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local boundary = 32 -- how many elmos closer to the center of the scum than the actual edge of the scum the unit must be to be considered on the scum local function GetMapSquareKey(posx, posz) - if posx < 0 or posz < 0 or posx > mapSizeX or posz > mapSizeZ then return nil end - return (floor(posx*0.0009765625) * 1024 + floor(posz* 0.0009765625)) + if posx < 0 or posz < 0 or posx > mapSizeX or posz > mapSizeZ then + return nil + end + return (floor(posx * 0.0009765625) * 1024 + floor(posz * 0.0009765625)) end - for x= 0, math.ceil(mapSizeX/1024) do - for z = 0, math.ceil(mapSizeZ/1024) do - scumBins[x*1024+z] = {} + for x = 0, math.ceil(mapSizeX / 1024) do + for z = 0, math.ceil(mapSizeZ / 1024) do + scumBins[x * 1024 + z] = {} end end @@ -658,33 +661,41 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED if scum.growthrate > 0 then return clamp((gf - scum.spawnframe) * scum.growthrate, 0, scum.radius) else - return clamp(scum.radius - (gf - scum.spawnframe) *(-1.0 * scum.growthrate), 0, scum.radius) + return clamp(scum.radius - (gf - scum.spawnframe) * (-1.0 * scum.growthrate), 0, scum.radius) end end -- This checks wether the unit is under any scum - local function IsPosInScum(unitx,unity, unitz) + local function IsPosInScum(unitx, unity, unitz) -- out of bounds check, no scum outside of map bounds - if unitx < 0 or unitz < 0 or unitx > mapSizeX or unitz > mapSizeZ then return nil end + if unitx < 0 or unitz < 0 or unitx > mapSizeX or unitz > mapSizeZ then + return nil + end -- underwater scum doesnt count for hovers, ships unity = unity or 1 - if unity > -1 and spGetGroundHeight(unitx, unitz) < 0 then return nil end + if unity > -1 and spGetGroundHeight(unitx, unitz) < 0 then + return nil + end -- Empty bins also return local scumBinID = GetMapSquareKey(unitx, unitz) - if scumBinID == nil or scumBins[scumBinID] == nil then return nil end + if scumBinID == nil or scumBins[scumBinID] == nil then + return nil + end local gf = gameFrame for scumID, scum in pairs(scumBins[scumBinID]) do local dx = (unitx - scum.posx) local dz = (unitz - scum.posz) - local sqrdistance = (dx*dx + dz*dz) + local sqrdistance = (dx * dx + dz * dz) local scumradius = scum.radius -- edges are not fully covered, so they shouldn't count, - if scumradius < 1 then scumradius = 1 end + if scumradius < 1 then + scumradius = 1 + end if sqrdistance < (scumradius * scumradius) then local currentscumradius = GetScumCurrentRadius(scum, gf) --Spring.Echo("testing ScumID", scumID, sqrdistance, scumradius, currentscumradius) - if currentscumradius - sqrt(sqrdistance) > boundary then + if currentscumradius - sqrt(sqrdistance) > boundary then return scumID end end @@ -709,20 +720,32 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED end local binID = GetMapSquareKey(posx, posz) - if binID then scumBins[binID][scumID] = scumTable end + if binID then + scumBins[binID][scumID] = scumTable + end binID = GetMapSquareKey(posx + radius, posz + radius) - if binID then scumBins[binID][scumID] = scumTable end + if binID then + scumBins[binID][scumID] = scumTable + end binID = GetMapSquareKey(posx - radius, posz + radius) - if binID then scumBins[binID][scumID] = scumTable end + if binID then + scumBins[binID][scumID] = scumTable + end binID = GetMapSquareKey(posx + radius, posz - radius) - if binID then scumBins[binID][scumID] = scumTable end + if binID then + scumBins[binID][scumID] = scumTable + end binID = GetMapSquareKey(posx - radius, posz - radius) - if binID then scumBins[binID][scumID] = scumTable end + if binID then + scumBins[binID][scumID] = scumTable + end end -- growthrate is in elmos per frame, negative for shrinking scums local function AddOrUpdateScum(posx, posy, posz, radius, growthrate, scumID) - if debugmode then Spring.Echo("AddOrUpdateScum",posx, posy, posz, radius, growthrate, scumID) end + if debugmode then + Spring.Echo("AddOrUpdateScum", posx, posy, posz, radius, growthrate, scumID) + end -- if scumID is supplied, we are updateing an existing scum instance! local gf = Spring.GetGameFrame() @@ -731,11 +754,11 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED -- thus we need to make a new scum, and register it in our scumBins if scumID == nil or scums[scumID] == nil then posy = posy or Spring.GetGroundHeight(posx, posz) - scum = {posx = posx, posz = posz, radius = radius, spawnframe = gf, growthrate = growthrate, scumID = scumID, atmaxsize = false } + scum = { posx = posx, posz = posz, radius = radius, spawnframe = gf, growthrate = growthrate, scumID = scumID, atmaxsize = false } scums[scumID] = scum UpdateBins(scumID) numscums = numscums + 1 - else-- a scumID is supplied, meaning we just update an existing instance + else -- a scumID is supplied, meaning we just update an existing instance scum = scums[scumID] -- well then, seems we have to do this after all, when we update a scum, we need to check how long its been alive -- this is the nastiest garbage ive ever done @@ -747,30 +770,42 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED end if growthrate > 0 then - scum.spawnframe = gf - ( currentradius/growthrate) + scum.spawnframe = gf - (currentradius / growthrate) -- remove it from the death queue, no matter where it is, cause its 'growing' else - scum.spawnframe = gf - ((scum.radius - currentradius)/ (-1 * growthrate) ) - deathtime = math.floor( gf + (currentradius/(-1 * growthrate))) + scum.spawnframe = gf - ((scum.radius - currentradius) / (-1 * growthrate)) + deathtime = math.floor(gf + (currentradius / (-1 * growthrate))) end scum.growthrate = growthrate - if debugmode then Spring.Echo("Updated scum", scumID, "it was", currentradius,"/", scum.radius, "sized, growing at", growthrate) end + if debugmode then + Spring.Echo("Updated scum", scumID, "it was", currentradius, "/", scum.radius, "sized, growing at", growthrate) + end end --Spring.Echo(scumID, growthrate, radius, gf) if not headless then pushElementInstance( scumVBO, -- push into this Instance VBO Table - {scum.posx, scum.posy, scum.posz, scum.radius , -- - scum.spawnframe, scum.growthrate, 0, 0, -- alphastart_alphadecay_heatstart_heatdecay - }, + { + scum.posx, + scum.posy, + scum.posz, + scum.radius, -- + scum.spawnframe, + scum.growthrate, + 0, + 0, -- alphastart_alphadecay_heatstart_heatdecay + }, scumID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element - false) -- noupload, dont use unless you know what you are doing and want to batch push/pop + false + ) -- noupload, dont use unless you know what you are doing and want to batch push/pop end if scum.growthrate < 0 then - if debugmode then Spring.Echo("Removal of scum ID", scumID,"Scheduled for ", deathtime - gf , "from now" ) end + if debugmode then + Spring.Echo("Removal of scum ID", scumID, "Scheduled for ", deathtime - gf, "from now") + end if scumRemoveQueue[deathtime] == nil then scumRemoveQueue[deathtime] = {} end @@ -800,7 +835,7 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED for smallScumID, smallScum in pairs(scumBin) do if not overlapped[smallScumID] and scumRadii[smallScumID] < bigRadius then comparisons = comparisons + 1 - if diag(bigScum.posx - smallScum.posx, bigScum.posz - smallScum.posz) < (bigRadius - scumRadii[smallScumID] - 128) then + if diag(bigScum.posx - smallScum.posx, bigScum.posz - smallScum.posz) < (bigRadius - scumRadii[smallScumID] - 128) then overlapped[smallScumID] = true end end @@ -811,14 +846,16 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local overlapcount = 0 for scumID, overlaps in pairs(overlapped) do - if overlaps then overlapcount = overlapcount + 1 end + if overlaps then + overlapcount = overlapcount + 1 + end end if debugmode then Spring.Echo(string.format("Of %d scums, %d overlaps found in %d comparisons", numscums, overlapcount, comparisons)) end -- update the VBO - for i = 0, scumVBO.usedElements -1 do + for i = 0, scumVBO.usedElements - 1 do local scumID = scumVBO.indextoInstanceID[i + 1] scumVBO.instanceData[(i * scumVBO.instanceStep) + 7] = (overlapped[scumID] and optimizeoverlaps) and 1 or 0 end @@ -826,22 +863,22 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED return overlapcount, comparisons end - local usestencil = false function gadget:DrawWorldPreUnit() - - if headless then return end + if headless then + return + end if debugmode then local mx, my, mb = Spring.GetMouseState() local _, coords = Spring.TraceScreenRay(mx, my, true) - if coords and (IsPosInScum(coords[1], coords[2],coords[3])) then - Spring.Echo("Inscum", numscums, IsPosInScum(coords[1], coords[2],coords[3])) + if coords and (IsPosInScum(coords[1], coords[2], coords[3])) then + Spring.Echo("Inscum", numscums, IsPosInScum(coords[1], coords[2], coords[3])) end end if drawScum and scumVBO.usedElements > 0 then - if optimizeoverlaps and gameFrame%63 == 0 and lastoverlapframe ~= gameFrame then + if optimizeoverlaps and gameFrame % 63 == 0 and lastoverlapframe ~= gameFrame then lastoverlapframe = gameFrame UpdateScumOverlaps() end @@ -852,13 +889,13 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED glDepthTest(GL_LEQUAL) --glDepthTest(false) --gl.DepthMask(true) - glTexture(0, '$heightmap') - glTexture(1, '$normals') - glTexture(2, "$info")-- Texture file - glTexture(3, "$shadow")-- Texture file + glTexture(0, "$heightmap") + glTexture(1, "$normals") + glTexture(2, "$info") -- Texture file + glTexture(3, "$shadow") -- Texture file glTexture(4, textures[textureresolution].texcolorheight) glTexture(5, textures[textureresolution].texnormalspec) - glTexture(6, textures[textureresolution].texdistortion)-- Texture file + glTexture(6, textures[textureresolution].texdistortion) -- Texture file scumShader:Activate() scumShader:SetUniform("nightFactor", nightFactor[1], nightFactor[2], nightFactor[3], nightFactor[4]) @@ -873,7 +910,7 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED end --scumShader:SetUniform("fadeDistance",disticon * 1000) - scumVBO.VAO:DrawElements(GL.TRIANGLES,nil,0,scumVBO.usedElements, 0) + scumVBO.VAO:DrawElements(GL.TRIANGLES, nil, 0, scumVBO.usedElements, 0) scumShader:Deactivate() if usestencil then glStencilMask(1) @@ -882,7 +919,9 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED glClear(GL_STENCIL_BUFFER_BIT) -- set stencil buffer to 0 glStencilMask(0) end - for i = 0, 6 do glTexture(i, false) end + for i = 0, 6 do + glTexture(i, false) + end glCulling(false) --glDepthTest(false) end @@ -891,32 +930,36 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED local lastSunChanged = -1 function gadget:SunChanged() -- Note that map_nightmode.lua gadget has to change sun twice in a single draw frame to update all local df = Spring.GetDrawFrame() - if df == lastSunChanged then return end + if df == lastSunChanged then + return + end lastSunChanged = df - if GG['NightFactor'] then + if GG["NightFactor"] then local altitudefactor = 1.0 --+ (1.0 - WG['NightFactor'].altitude) * 0.5 - nightFactor[1] = GG['NightFactor'].red - nightFactor[2] = GG['NightFactor'].green - nightFactor[3] = GG['NightFactor'].blue - nightFactor[4] = GG['NightFactor'].shadow + nightFactor[1] = GG["NightFactor"].red + nightFactor[2] = GG["NightFactor"].green + nightFactor[3] = GG["NightFactor"].blue + nightFactor[4] = GG["NightFactor"].shadow end end local function RemoveScum(instanceID) - if debugmode then Spring.Echo("Removing scum", instanceID) end + if debugmode then + Spring.Echo("Removing scum", instanceID) + end if scums[instanceID] then numscums = numscums - 1 end UpdateBins(instanceID, true) - if scumVBO.instanceIDtoIndex[instanceID] and (not headless) then + if scumVBO.instanceIDtoIndex[instanceID] and not headless then popElementInstance(scumVBO, instanceID) end end local function AddRandomScum() - local posx = Game.mapSizeX * math.random() * 0.8 - local posz = Game.mapSizeZ * math.random() * 0.8 - local posy = Spring.GetGroundHeight(posx, posz) + local posx = Game.mapSizeX * math.random() * 0.8 + local posz = Game.mapSizeZ * math.random() * 0.8 + local posy = Spring.GetGroundHeight(posx, posz) local radius = math.random() * 256 + 128 local growthrate = math.random() * 0.5 -- in elmos per frame local scumID = math.random() @@ -936,15 +979,16 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED if n % 39 == 1 and Script.LuaUI("GadgetRemoveGrass") then scumModulo = (scumModulo + 1) % 4 for scumID, scum in pairs(scums) do - if ((scumID % 4) == scumModulo) and scum.growthrate > 0 and (not scum.atmaxsize) then + if ((scumID % 4) == scumModulo) and scum.growthrate > 0 and not scum.atmaxsize then local currentRadius = GetScumCurrentRadius(scum, n) if currentRadius < scum.radius then Script.LuaUI.GadgetRemoveGrass(scum.posx, scum.posz, currentRadius * 0.87) else - if debugmode then Spring.Echo("Scum ID", scumID, "reached max size", currentRadius, '>=', scum.radius) end + if debugmode then + Spring.Echo("Scum ID", scumID, "reached max size", currentRadius, ">=", scum.radius) + end scum.atmaxsize = true end - end end end @@ -957,7 +1001,7 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED else for scumID, scumData in pairs(scums) do if math.random() < 1.0 / numscums then - AddOrUpdateScum(nil,nil,nil,nil, math.random() * 1 -0.5, scumID) + AddOrUpdateScum(nil, nil, nil, nil, math.random() * 1 - 0.5, scumID) break end end @@ -971,23 +1015,25 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED AddOrUpdateScum(posx, nil, posz, radius, growthrate, scumID) end - local function HandleScumRemoved(cmd, scumID ) + local function HandleScumRemoved(cmd, scumID) if scums[scumID] then - AddOrUpdateScum(nil,nil,nil,nil, -10 * math.abs( scums[scumID].growthrate), scumID) + AddOrUpdateScum(nil, nil, nil, nil, -10 * math.abs(scums[scumID].growthrate), scumID) end end local function ScumTextures() - textureresolution = ((textureresolution == 'low') and 'high') or 'low' + textureresolution = ((textureresolution == "low") and "high") or "low" Spring.Echo("Scum textureresolution set to ", textureresolution) end local function ScumStats() - for x= 0, math.ceil(mapSizeX/1024) do - for z = 0, math.ceil(mapSizeZ/1024) do - local scumBin = scumBins[GetMapSquareKey(x*1024, z * 1024)] + for x = 0, math.ceil(mapSizeX / 1024) do + for z = 0, math.ceil(mapSizeZ / 1024) do + local scumBin = scumBins[GetMapSquareKey(x * 1024, z * 1024)] local scumCount = 0 - for _ in pairs(scumBin) do scumCount = scumCount + 1 end + for _ in pairs(scumBin) do + scumCount = scumCount + 1 + end Spring.Echo(string.format("%d scums are in bin %d x %d", scumCount, x, z)) end end @@ -1010,7 +1056,6 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED UpdateScumOverlaps() end - function gadget:Initialize() initGL4(shaderConfig, "scum") @@ -1018,10 +1063,10 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED gadgetHandler:AddSyncAction("ScumRemoved", HandleScumRemoved) gadgetHandler:AddChatAction("scumtextures", ScumTextures, "Toggle between texture resolutions") - gadgetHandler:AddChatAction("scumreloadshader" , ScumReloadShader, "Reload the Scum Shader") - gadgetHandler:AddChatAction("scumstats" , ScumStats, "Print statistics about scum" ) - gadgetHandler:AddChatAction("scumdraw" , ScumDrawToggle, "Toggles drawing the scom" ) - gadgetHandler:AddChatAction("scumoptimizeoverlap" , ScumOptimizeOverlap, "Toggles drawing the scom" ) + gadgetHandler:AddChatAction("scumreloadshader", ScumReloadShader, "Reload the Scum Shader") + gadgetHandler:AddChatAction("scumstats", ScumStats, "Print statistics about scum") + gadgetHandler:AddChatAction("scumdraw", ScumDrawToggle, "Toggles drawing the scom") + gadgetHandler:AddChatAction("scumoptimizeoverlap", ScumOptimizeOverlap, "Toggles drawing the scom") end function gadget:ShutDown() @@ -1029,9 +1074,9 @@ elseif not Spring.Utilities.Gametype.IsScavengers() then -- UNSYNCED gadgetHandler:RemoveSyncAction("ScumRemoved") gadgetHandler:RemoveChatAction("scumhighrestextures", ScumTextures) - gadgetHandler:RemoveChatAction("scumreloadshader" , ScumReloadShader ) - gadgetHandler:RemoveChatAction("scumstats" , ScumStats ) - gadgetHandler:RemoveChatAction("scumdraw" , ScumDrawToggle ) - gadgetHandler:RemoveChatAction("scumoptimizeoverlap" , ScumOptimizeOverlap ) + gadgetHandler:RemoveChatAction("scumreloadshader", ScumReloadShader) + gadgetHandler:RemoveChatAction("scumstats", ScumStats) + gadgetHandler:RemoveChatAction("scumdraw", ScumDrawToggle) + gadgetHandler:RemoveChatAction("scumoptimizeoverlap", ScumOptimizeOverlap) end end diff --git a/luarules/gadgets/gfx_reclaim_fx.lua b/luarules/gadgets/gfx_reclaim_fx.lua index e104c12ae1c..417414dbf67 100644 --- a/luarules/gadgets/gfx_reclaim_fx.lua +++ b/luarules/gadgets/gfx_reclaim_fx.lua @@ -2,31 +2,30 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Reclaim effect", - desc = "Unit/feature reclaim effect", - author = "Floris", - date = "December 2016", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Reclaim effect", + desc = "Unit/feature reclaim effect", + author = "Floris", + date = "December 2016", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end if gadgetHandler:IsSyncedCode() then - - local random = math.random local featureList = {} for featureDefID, fdef in pairs(FeatureDefs) do if fdef.model and fdef.model.minx and fdef.model.maxx then featureList[featureDefID] = { - minx=fdef.model.minx, - maxx=math.max(fdef.model.maxx+1, fdef.model.minx+ 1), - miny=fdef.model.miny, - maxy=math.max(fdef.model.maxy+1, fdef.model.miny + 1), - minz=fdef.model.minz, - maxz=math.max(fdef.model.maxz+1, fdef.model.minz + 1) } + minx = fdef.model.minx, + maxx = math.max(fdef.model.maxx + 1, fdef.model.minx + 1), + miny = fdef.model.miny, + maxy = math.max(fdef.model.maxy + 1, fdef.model.miny + 1), + minz = fdef.model.minz, + maxz = math.max(fdef.model.maxz + 1, fdef.model.minz + 1), + } end end @@ -38,10 +37,10 @@ if gadgetHandler:IsSyncedCode() then local unitMaxY = {} local ignoreUnits = {} for unitDefID, unitDef in ipairs(UnitDefs) do - if unitDef.modCategories['object'] or unitDef.customParams.objectify then + if unitDef.modCategories["object"] or unitDef.customParams.objectify then ignoreUnits[unitDefID] = true else - unitNumFx[unitDefID] = math.min(1 + math.ceil(unitDef.metalCost/250), 30) + unitNumFx[unitDefID] = math.min(1 + math.ceil(unitDef.metalCost / 250), 30) unitMinX[unitDefID] = unitDef.model.minx unitMaxX[unitDefID] = unitDef.model.maxx unitMinZ[unitDefID] = unitDef.model.minz @@ -52,18 +51,18 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if attackerID == nil and not ignoreUnits[unitDefID] then -- if reclaimed - local ux,uy,uz = Spring.GetUnitPosition(unitID) + local ux, uy, uz = Spring.GetUnitPosition(unitID) if ux ~= nil then - local x,y,z = ux,uy,uz + local x, y, z = ux, uy, uz Spring.SpawnCEG("metalshards1", x, y, z) -- add more effects depending on unit cost local posMultiplier = 0.5 - for i=1, unitNumFx[unitDefID], 1 do - x = ux + (random(unitMinX[unitDefID], unitMaxX[unitDefID])*posMultiplier) - z = uz + (random(unitMinZ[unitDefID], unitMaxX[unitDefID])*posMultiplier) - y = uy + (random(0,1) * unitMaxY[unitDefID]*posMultiplier) - Spring.SpawnCEG("metalshards"..(((i+1)%3)+1), x, y, z) + for i = 1, unitNumFx[unitDefID], 1 do + x = ux + (random(unitMinX[unitDefID], unitMaxX[unitDefID]) * posMultiplier) + z = uz + (random(unitMinZ[unitDefID], unitMaxX[unitDefID]) * posMultiplier) + y = uy + (random(0, 1) * unitMaxY[unitDefID] * posMultiplier) + Spring.SpawnCEG("metalshards" .. (((i + 1) % 3) + 1), x, y, z) end end end @@ -71,33 +70,33 @@ if gadgetHandler:IsSyncedCode() then local damagedFeatures = {} function gadget:FeatureDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) - if damage > 4 and (damagedFeatures[featureID] == nil or Spring.GetGameFrame() - damagedFeatures[featureID] > 15) and select(1,Spring.GetFeatureHealth(featureID)) > 0 then -- not sure if "select(1,Spring.GetFeatureHealth(featureID)) > 0" is needed because if featuredestroyed, featuredamaged wont be called probably - local fx,fy,fz = Spring.GetFeaturePosition(featureID) + if damage > 4 and (damagedFeatures[featureID] == nil or Spring.GetGameFrame() - damagedFeatures[featureID] > 15) and select(1, Spring.GetFeatureHealth(featureID)) > 0 then -- not sure if "select(1,Spring.GetFeatureHealth(featureID)) > 0" is needed because if featuredestroyed, featuredamaged wont be called probably + local fx, fy, fz = Spring.GetFeaturePosition(featureID) if fx ~= nil then local fdef = featureList[featureDefID] if fdef and fdef.minx and fdef.maxx then - local x,y,z = fx,fy,fz + local x, y, z = fx, fy, fz local _, mm, _, me, _ = Spring.GetFeatureResources(featureID) if me ~= nil and me > 0 then - local numFx = math.min(25, math.floor(me/250)) + local numFx = math.min(25, math.floor(me / 250)) local posMultiplier = 0.5 Spring.SpawnCEG("energyshards1", x, y, z) - for i=1, numFx, 1 do - x = fx + (random(fdef.minx, fdef.maxx)*posMultiplier) - z = fz + (random(fdef.minz, fdef.maxz)*posMultiplier) - y = fy + (random(0,1) * fdef.maxy*posMultiplier) - Spring.SpawnCEG("energyshards"..(((i+1)%3)+1), x, y, z) + for i = 1, numFx, 1 do + x = fx + (random(fdef.minx, fdef.maxx) * posMultiplier) + z = fz + (random(fdef.minz, fdef.maxz) * posMultiplier) + y = fy + (random(0, 1) * fdef.maxy * posMultiplier) + Spring.SpawnCEG("energyshards" .. (((i + 1) % 3) + 1), x, y, z) end end if mm ~= nil and mm > 0 then - local numFx = math.min(25,math.floor(mm/90)) + local numFx = math.min(25, math.floor(mm / 90)) local posMultiplier = 0.5 Spring.SpawnCEG("metalshards1", x, y, z) - for i=1, numFx, 1 do - x = fx + (random(fdef.minx, fdef.maxx)*posMultiplier) - z = fz + (random(fdef.minz, fdef.maxz)*posMultiplier) - y = fy + (random(0,1) * fdef.maxy*posMultiplier) - Spring.SpawnCEG("metalshards"..(((i+1)%3)+1), x, y, z) + for i = 1, numFx, 1 do + x = fx + (random(fdef.minx, fdef.maxx) * posMultiplier) + z = fz + (random(fdef.minz, fdef.maxz) * posMultiplier) + y = fy + (random(0, 1) * fdef.maxy * posMultiplier) + Spring.SpawnCEG("metalshards" .. (((i + 1) % 3) + 1), x, y, z) end end end @@ -110,59 +109,53 @@ if gadgetHandler:IsSyncedCode() then if damagedFeatures[featureID] ~= nil then damagedFeatures[featureID] = nil end - local fx,fy,fz = Spring.GetFeaturePosition(featureID) - if fy ~= nil and fy+15 > Spring.GetGroundHeight(fx, fz) then + local fx, fy, fz = Spring.GetFeaturePosition(featureID) + if fy ~= nil and fy + 15 > Spring.GetGroundHeight(fx, fz) then local fdef = featureList[Spring.GetFeatureDefID(featureID)] if fdef and fdef.minx then - local x,y,z = fx,fy,fz + local x, y, z = fx, fy, fz local rm, mm, re, me, rl = Spring.GetFeatureResources(featureID) if me ~= nil and me > 0 then - local numFx = math.max(math.floor(me/250), 15) + local numFx = math.max(math.floor(me / 250), 15) local posMultiplier = 0.5 Spring.SpawnCEG("energyshards1", x, y, z) - for i=1, numFx, 1 do - x = fx + (random(fdef.minx, fdef.maxx)*posMultiplier) - z = fz + (random(fdef.minz, fdef.maxz)*posMultiplier) - y = fy + (random(fdef.miny, fdef.maxy)*posMultiplier) - Spring.SpawnCEG("energyshards"..(((i+1)%3)+1), x, y, z) + for i = 1, numFx, 1 do + x = fx + (random(fdef.minx, fdef.maxx) * posMultiplier) + z = fz + (random(fdef.minz, fdef.maxz) * posMultiplier) + y = fy + (random(fdef.miny, fdef.maxy) * posMultiplier) + Spring.SpawnCEG("energyshards" .. (((i + 1) % 3) + 1), x, y, z) end end if mm ~= nil and mm > 0 then - local numFx = math.max(math.floor(mm/90), 15) + local numFx = math.max(math.floor(mm / 90), 15) local posMultiplier = 0.5 Spring.SpawnCEG("metalshards1", x, y, z) - for i=1, numFx, 1 do - x = fx + (random(fdef.minx, fdef.maxx)*posMultiplier) - z = fz + (random(fdef.minz, fdef.maxz)*posMultiplier) - y = fy + (random(fdef.miny, fdef.maxy)*posMultiplier) - Spring.SpawnCEG("metalshards"..(((i+1)%3)+1), x, y, z) + for i = 1, numFx, 1 do + x = fx + (random(fdef.minx, fdef.maxx) * posMultiplier) + z = fz + (random(fdef.minz, fdef.maxz) * posMultiplier) + y = fy + (random(fdef.miny, fdef.maxy) * posMultiplier) + Spring.SpawnCEG("metalshards" .. (((i + 1) % 3) + 1), x, y, z) end end - if rm ~= nil and mm==0 and re==0 then + if rm ~= nil and mm == 0 and re == 0 then Spring.SpawnCEG("sparklegreen", fx, fy, fz) SendToUnsynced("reclaimfx", fx, fy, fz) end end end end - - -else -- UNSYNCED - - +else -- UNSYNCED local function reclaimfx(_, fx, fy, fz) local mySpec, fullview = Spring.GetSpectatingState() if fullview or Spring.IsPosInLos(fx, fy, fz, Spring.GetMyAllyTeamID()) then - Spring.PlaySoundFile("reclaimate", 1, fx, fy, fz, 'sfx') + Spring.PlaySoundFile("reclaimate", 1, fx, fy, fz, "sfx") end end - function gadget:Initialize() gadgetHandler:AddSyncAction("reclaimfx", reclaimfx) end function gadget:Shutdown() gadgetHandler:AddSyncAction("reclaimfx") end - end diff --git a/luarules/gadgets/gfx_tree_feller.lua b/luarules/gadgets/gfx_tree_feller.lua index c8854a132a3..b116af5c903 100644 --- a/luarules/gadgets/gfx_tree_feller.lua +++ b/luarules/gadgets/gfx_tree_feller.lua @@ -5,7 +5,7 @@ function gadget:GetInfo() name = "Tree feller", desc = "Destroys features that have 0 m and >0 energy", author = "Beherith", - date = "march 201",--ye olde code + date = "march 201", --ye olde code license = "GNU GPL, v2 or later", layer = 0, enabled = true, @@ -13,7 +13,6 @@ function gadget:GetInfo() end if gadgetHandler:IsSyncedCode() then - local math_sqrt = math.sqrt local math_random = math.random local math_max = math.max @@ -40,7 +39,7 @@ if gadgetHandler:IsSyncedCode() then local treefireExplosion = { tiny = { - weaponDef = WeaponDefNames['treefire_tiny'].id, + weaponDef = WeaponDefNames["treefire_tiny"].id, -- owner = -1, hitUnit = 1, hitFeature = 1, @@ -53,7 +52,7 @@ if gadgetHandler:IsSyncedCode() then damageGround = true, }, small = { - weaponDef = WeaponDefNames['treefire_small'].id, + weaponDef = WeaponDefNames["treefire_small"].id, -- owner = -1, hitUnit = 1, hitFeature = 1, @@ -66,7 +65,7 @@ if gadgetHandler:IsSyncedCode() then damageGround = true, }, medium = { - weaponDef = WeaponDefNames['treefire_medium'].id, + weaponDef = WeaponDefNames["treefire_medium"].id, -- owner = -1, hitUnit = 1, hitFeature = 1, @@ -79,7 +78,7 @@ if gadgetHandler:IsSyncedCode() then damageGround = true, }, large = { - weaponDef = WeaponDefNames['treefire_large'].id, + weaponDef = WeaponDefNames["treefire_large"].id, -- owner = -1, hitUnit = 1, hitFeature = 1, @@ -93,10 +92,10 @@ if gadgetHandler:IsSyncedCode() then }, } local treeWeapons = {} - treeWeapons[WeaponDefNames['treefire_tiny'].id] = true - treeWeapons[WeaponDefNames['treefire_small'].id] = true - treeWeapons[WeaponDefNames['treefire_medium'].id] = true - treeWeapons[WeaponDefNames['treefire_large'].id] = true + treeWeapons[WeaponDefNames["treefire_tiny"].id] = true + treeWeapons[WeaponDefNames["treefire_small"].id] = true + treeWeapons[WeaponDefNames["treefire_medium"].id] = true + treeWeapons[WeaponDefNames["treefire_large"].id] = true local noFireWeapons = {} for id, wDefs in pairs(WeaponDefs) do @@ -155,10 +154,12 @@ if gadgetHandler:IsSyncedCode() then if not mult then local jitter = (math_random() * 2 - 1) * treeFireLifeRandFrac mult = treeFireLifeMultBase * (1 + jitter) - if featureinfo.size == 'large' then + if featureinfo.size == "large" then mult = mult * (1 + math_random() * treeFireLargeLifeBonusMax) end - if mult < 0.55 then mult = 0.55 end + if mult < 0.55 then + mult = 0.55 + end featureinfo.treeFireLifeMult = mult end return math_max(1, math_floor(baseFrames * mult + 0.5)) @@ -169,19 +170,18 @@ if gadgetHandler:IsSyncedCode() then local treeRadius = {} local geothermals = {} for featureDefID, featureDef in pairs(FeatureDefs) do - if featureDef.geoThermal then geothermals[featureDefID] = featureDefID end --if featureDef.name:find('treetype') == nil then - treeMass[featureDefID] = math_max(1, featureDef.mass) - if featureDef.collisionVolume then - treeScaleY[featureDefID] = featureDef.collisionVolume.scaleY - local sx = featureDef.collisionVolume.scaleX or 0 - local sz = featureDef.collisionVolume.scaleZ or 0 - treeRadius[featureDefID] = math_max(6, math_max(sx, sz) * 0.5) - end + treeMass[featureDefID] = math_max(1, featureDef.mass) + if featureDef.collisionVolume then + treeScaleY[featureDefID] = featureDef.collisionVolume.scaleY + local sx = featureDef.collisionVolume.scaleX or 0 + local sz = featureDef.collisionVolume.scaleZ or 0 + treeRadius[featureDefID] = math_max(6, math_max(sx, sz) * 0.5) + end --end end @@ -229,12 +229,19 @@ if gadgetHandler:IsSyncedCode() then local oz = info.offset and info.offset[3] or 0 local lo = info.min[2] + oy local hi = info.max[2] + oy - if lo < minY then minY = lo end - if hi > maxY then maxY = hi end + if lo < minY then + minY = lo + end + if hi > maxY then + maxY = hi + end local rx = math_max(math_abs(info.min[1] + ox), math_abs(info.max[1] + ox)) local rz = math_max(math_abs(info.min[3] + oz), math_abs(info.max[3] + oz)) local r = math_max(rx, rz) - if r > widestR then widestR = r; widestY = (lo + hi) * 0.5 end + if r > widestR then + widestR = r + widestY = (lo + hi) * 0.5 + end end end if maxY > minY then @@ -308,67 +315,64 @@ if gadgetHandler:IsSyncedCode() then return maxMetal == 0 and maxEnergy > 0 end - local function ComSpawnDefoliate(spawnx,spawny,spawnz) - - - local blasted_trees = Spring.GetFeaturesInCylinder ( spawnx, spawnz, 125) + local function ComSpawnDefoliate(spawnx, spawny, spawnz) + local blasted_trees = Spring.GetFeaturesInCylinder(spawnx, spawnz, 125) for i, tree in pairs(blasted_trees) do - local featureDefID = Spring.GetFeatureDefID(tree) if geothermals[featureDefID] then return 0 end - local fx, fy, fz = GetFeaturePosition(tree) local dx, dy, dz = GetFeatureDirection(tree) if true and fx ~= nil then - - local dissapearSpeed = 1.7 - local size = 'medium' - if treeScaleY[featureDefID] then - if treeScaleY[featureDefID] < 40 then - size = 'tiny' - elseif treeScaleY[featureDefID] < 50 then - size = 'small' - elseif treeScaleY[featureDefID] > 65 then - size = 'large' - end - dissapearSpeed = 0.15 + Spring.GetFeatureHeight(tree) / math_random(3700, 4700) + local dissapearSpeed = 1.7 + local size = "medium" + if treeScaleY[featureDefID] then + if treeScaleY[featureDefID] < 40 then + size = "tiny" + elseif treeScaleY[featureDefID] < 50 then + size = "small" + elseif treeScaleY[featureDefID] > 65 then + size = "large" end + dissapearSpeed = 0.15 + Spring.GetFeatureHeight(tree) / math_random(3700, 4700) + end - local destroyFrame = GetGameFrame() + falltime + 150 + (dissapearSpeed * 4000) + local destroyFrame = GetGameFrame() + falltime + 150 + (dissapearSpeed * 4000) local dmg = treeMass[featureDefID] * 2 - Spring.SetFeatureResources(0,0,0,0) + Spring.SetFeatureResources(0, 0, 0, 0) Spring.SetFeatureNoSelect(tree, true) - Spring.PlaySoundFile("treefall", 2, fx, fy, fz, 'sfx') + Spring.PlaySoundFile("treefall", 2, fx, fy, fz, "sfx") treesdying[tree] = { frame = GetGameFrame(), - posx = fx, posy = fy, posz = fz, + posx = fx, + posy = fy, + posz = fz, fDefID = featureDefID, - dirx = dx, diry = dy, dirz = dz, - px = spawnx, py = spawny, pz = spawnz, + dirx = dx, + diry = dy, + dirz = dz, + px = spawnx, + py = spawny, + pz = spawnz, strength = math_max(1, treeMass[featureDefID] / dmg), fire = false, size = size, - treeburnCEG = 'treeburn-' .. size, + treeburnCEG = "treeburn-" .. size, dissapearSpeed = dissapearSpeed, - destroyFrame = destroyFrame + destroyFrame = destroyFrame, } --Spring.Debug.TableEcho(treesdying[tree]) + end end end - end - - - GG.ComSpawnDefoliate = ComSpawnDefoliate - local lastLavaLevel = -99999 local lavaCheckInterval = 30 @@ -411,14 +415,14 @@ if gadgetHandler:IsSyncedCode() then if fx and fy <= lavaLevel then local dx, dy, dz = GetFeatureDirection(featureID) local dissapearSpeed = 1.7 - local size = 'medium' + local size = "medium" if treeScaleY[featureDefID] then if treeScaleY[featureDefID] < 40 then - size = 'tiny' + size = "tiny" elseif treeScaleY[featureDefID] < 50 then - size = 'small' + size = "small" elseif treeScaleY[featureDefID] > 65 then - size = 'large' + size = "large" end dissapearSpeed = 0.15 + Spring.GetFeatureHeight(featureID) / math_random(3700, 4700) end @@ -428,14 +432,20 @@ if gadgetHandler:IsSyncedCode() then Spring.SetFeatureNoSelect(featureID, true) treesdying[featureID] = { frame = gf, - posx = fx, posy = fy, posz = fz, + posx = fx, + posy = fy, + posz = fz, fDefID = featureDefID, - dirx = dx, diry = dy, dirz = dz, - px = fx + math_random(-10, 10), py = fy, pz = fz + math_random(-10, 10), + dirx = dx, + diry = dy, + dirz = dz, + px = fx + math_random(-10, 10), + py = fy, + pz = fz + math_random(-10, 10), strength = 1, fire = true, size = size, - treeburnCEG = 'treeburn-' .. size, + treeburnCEG = "treeburn-" .. size, dissapearSpeed = dissapearSpeed, destroyFrame = destroyFrame, } @@ -473,8 +483,6 @@ if gadgetHandler:IsSyncedCode() then end end - - function gadget:FeaturePreDamaged(featureID, featureDefID, featureTeam, Damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if not treeMass[featureDefID] then return Damage, 0 @@ -484,7 +492,7 @@ if gadgetHandler:IsSyncedCode() then -- dying trees dont take more damage, and will be removed later if treesdying[featureID] then - if weaponDefID >= 0 and not (noFireWeapons[weaponDefID]) then + if weaponDefID >= 0 and not noFireWeapons[weaponDefID] then -- UNITEXPLOSION if fy and fy >= 0 then treesdying[featureID].fire = true @@ -495,20 +503,19 @@ if gadgetHandler:IsSyncedCode() then local ppx, ppy, ppz if fx ~= nil then - local health, maxhealth, _ = GetFeatureHealth(featureID) if dmg >= health then local fire local _, maxMetal, _, maxEnergy, reclaimLeft = GetFeatureResources(featureID) local dissapearSpeed = 1.7 - local size = 'medium' + local size = "medium" if treeScaleY[featureDefID] then if treeScaleY[featureDefID] < 40 then - size = 'tiny' + size = "tiny" elseif treeScaleY[featureDefID] < 50 then - size = 'small' + size = "small" elseif treeScaleY[featureDefID] > 65 then - size = 'large' + size = "large" end dissapearSpeed = 0.15 + Spring.GetFeatureHeight(featureID) / math_random(3700, 4700) end @@ -525,7 +532,7 @@ if gadgetHandler:IsSyncedCode() then --weapon is crush --crushed features cannot be saved by returning 0 damage. Must create new one! DestroyFeature(featureID) - treesdying[featureID] = { frame = GetGameFrame(), posx = fx, posy = fy, posz = fz, fDefID = featureDefID, dirx = dx, diry = dy, dirz = dz, px = ppx, py = ppy, pz = ppz, strength = treeMass[featureDefID] / dmg, fire = fire, size = size, treeburnCEG = 'treeburn-' .. size, dissapearSpeed = dissapearSpeed, destroyFrame = destroyFrame } -- this prevents this tobedestroyed feature to be replaced multiple times + treesdying[featureID] = { frame = GetGameFrame(), posx = fx, posy = fy, posz = fz, fDefID = featureDefID, dirx = dx, diry = dy, dirz = dz, px = ppx, py = ppy, pz = ppz, strength = treeMass[featureDefID] / dmg, fire = fire, size = size, treeburnCEG = "treeburn-" .. size, dissapearSpeed = dissapearSpeed, destroyFrame = destroyFrame } -- this prevents this tobedestroyed feature to be replaced multiple times featureID = CreateFeature(featureDefID, fx, fy, fz) SetFeatureDirection(featureID, dx, dy, dz) SetFeatureBlocking(featureID, false, false, false, false, false, false, false) @@ -553,7 +560,7 @@ if gadgetHandler:IsSyncedCode() then end -- PROJECTILE EXPLOSION - elseif projectileID > 0 and weaponDefID and not (noFireWeapons[weaponDefID]) then + elseif projectileID > 0 and weaponDefID and not noFireWeapons[weaponDefID] then ppx, ppy, ppz = Spring.GetProjectilePosition(projectileID) local vpx, vpy, vpz = Spring.GetProjectileVelocity(projectileID) ppx = ppx - 2 * vpx @@ -575,38 +582,38 @@ if gadgetHandler:IsSyncedCode() then fire = false -- UNITEXPLOSION - elseif attackerID and weaponDefID and not (noFireWeapons[weaponDefID]) then + elseif attackerID and weaponDefID and not noFireWeapons[weaponDefID] then ppx, ppy, ppz = Spring.GetUnitPosition(attackerID) dmg = math_min(treeMass[featureDefID] * 2, dmg) if fy >= 0 then fire = true end end - spSetFeatureResources(0,0,0,0) + spSetFeatureResources(0, 0, 0, 0) Spring.SetFeatureNoSelect(featureID, true) - Spring.PlaySoundFile("treefall", 2, fx, fy, fz, 'sfx') + Spring.PlaySoundFile("treefall", 2, fx, fy, fz, "sfx") treesdying[featureID] = { frame = GetGameFrame(), - posx = fx, posy = fy, posz = fz, + posx = fx, + posy = fy, + posz = fz, fDefID = featureDefID, - dirx = dx, diry = dy, dirz = dz, - px = ppx, py = ppy, pz = ppz, + dirx = dx, + diry = dy, + dirz = dz, + px = ppx, + py = ppy, + pz = ppz, strength = math_max(1, treeMass[featureDefID] / dmg), fire = fire, size = size, - treeburnCEG = 'treeburn-' .. size, + treeburnCEG = "treeburn-" .. size, dissapearSpeed = dissapearSpeed, - destroyFrame = destroyFrame + destroyFrame = destroyFrame, } if TREEFELLER_DEBUG then local pdx, pdz = (ppx or fx) - fx, (ppz or fz) - fz - dbg("ADD fID=" .. tostring(featureID), - "fire=" .. tostring(fire), - "strength=" .. string.format("%.2f", math_max(1, treeMass[featureDefID] / dmg)), - "dir=(" .. string.format("%.2f,%.2f,%.2f", dx or -99, dy or -99, dz or -99) .. ")", - "px/pz=" .. tostring(ppx) .. "/" .. tostring(ppz), - "fallDir=(" .. string.format("%.1f,%.1f", pdx, pdz) .. ")", - "weaponDefID=" .. tostring(weaponDefID)) + dbg("ADD fID=" .. tostring(featureID), "fire=" .. tostring(fire), "strength=" .. string.format("%.2f", math_max(1, treeMass[featureDefID] / dmg)), "dir=(" .. string.format("%.2f,%.2f,%.2f", dx or -99, dy or -99, dz or -99) .. ")", "px/pz=" .. tostring(ppx) .. "/" .. tostring(ppz), "fallDir=(" .. string.format("%.1f,%.1f", pdx, pdz) .. ")", "weaponDefID=" .. tostring(weaponDefID)) end --Spring.Echo('Hornet poi treesdying') --Spring.Debug.TableEcho(treesdying[featureID]) @@ -636,12 +643,14 @@ if gadgetHandler:IsSyncedCode() then spSendToUnsynced("treefire_stop", featureID) featureinfo.fireSent = false end - if not removeFeatures then removeFeatures = {} end + if not removeFeatures then + removeFeatures = {} + end removeCount = removeCount + 1 removeFeatures[removeCount] = featureID DestroyFeature(featureID) else - spSetFeatureResources(0,0,0,0) + spSetFeatureResources(0, 0, 0, 0) -- Resolve a SINGLE, stable fall direction once and cache it. Recomputing -- this every frame (and having separate fallbacks in the fire-send vs the -- trunk tilt) is what let the trunk and the line of fire point different @@ -669,9 +678,7 @@ if gadgetHandler:IsSyncedCode() then featureinfo.falldirz = 0 end end - dbg("FALLDIR fID=" .. tostring(featureID), - "dir=(" .. string.format("%.2f,%.2f", featureinfo.falldirx, featureinfo.falldirz) .. ")", - "fromBlast=" .. tostring(d2 > 0.0001)) + dbg("FALLDIR fID=" .. tostring(featureID), "dir=(" .. string.format("%.2f,%.2f", featureinfo.falldirx, featureinfo.falldirz) .. ")", "fromBlast=" .. tostring(d2 > 0.0001)) end local thisfeaturefalltime = math_min(falltime * featureinfo.strength, maxFallFrames) -- Keep per-tree timing cached so post-extinguish phases (like sinking) @@ -696,14 +703,9 @@ if gadgetHandler:IsSyncedCode() then -- -falldir. The line of fire must lie down that same way. local fdx = -featureinfo.falldirx local fdz = -featureinfo.falldirz - spSendToUnsynced("treefire_start", featureID, fx, fy, fz, height, radius, canopyFrac, - fdx, fdz, fallVisualFrames, burnFrames) + spSendToUnsynced("treefire_start", featureID, fx, fy, fz, height, radius, canopyFrac, fdx, fdz, fallVisualFrames, burnFrames) featureinfo.fireSent = true - dbg("FIRE_SEND fID=" .. tostring(featureID), - "h=" .. string.format("%.0f", height or -1), - "r=" .. string.format("%.0f", radius or -1), - "canopy=" .. string.format("%.2f", canopyFrac or -1), - "fireDir=(" .. string.format("%.1f,%.1f", fdx, fdz) .. ")") + dbg("FIRE_SEND fID=" .. tostring(featureID), "h=" .. string.format("%.0f", height or -1), "r=" .. string.format("%.0f", radius or -1), "canopy=" .. string.format("%.2f", canopyFrac or -1), "fireDir=(" .. string.format("%.1f,%.1f", fdx, fdz) .. ")") end -- While a tree burns, drive its health fraction down so the CUS GL4 tree -- shader chars the bark to charcoal (with ember glow). The shader reads @@ -717,7 +719,11 @@ if gadgetHandler:IsSyncedCode() then featureinfo.maxhealth = (mh and mh > 0) and mh or 1 end local charT = (gf - featureinfo.frame) / charFrames - if charT < 0 then charT = 0 elseif charT > 1 then charT = 1 end + if charT < 0 then + charT = 0 + elseif charT > 1 then + charT = 1 + end SetFeatureHealth(featureID, featureinfo.maxhealth * (1 - 0.97 * charT), false) end local fireFrequency = 5 @@ -732,7 +738,11 @@ if gadgetHandler:IsSyncedCode() then -- so every tree visibly falls promptly. 0 = upright, accelerates like a -- real toppling tree and reaches strongly horizontal. local vt = (gf - featureinfo.frame) / fallVisualFrames - if vt < 0 then vt = 0 elseif vt > 1 then vt = 1 end + if vt < 0 then + vt = 0 + elseif vt > 1 then + vt = 1 + end local fallY = 0.1 + (vt * vt) * 6.0 if fy ~= nil then if featureinfo.fire then @@ -756,11 +766,7 @@ if gadgetHandler:IsSyncedCode() then SetFeatureDirection(featureID, featureinfo.falldirx, fallY, featureinfo.falldirz) if TREEFELLER_DEBUG and (gf % 5 == 0) then local rdx, rdy, rdz, _, _, _, udx, udy, udz = GetFeatureDirection(featureID) - dbg("FALL fID=" .. tostring(featureID), - "vt=" .. string.format("%.2f", vt), - "fallY=" .. string.format("%.2f", fallY), - "front=(" .. string.format("%.2f,%.2f,%.2f", rdx or -99, rdy or -99, rdz or -99) .. ")", - "up=(" .. string.format("%.2f,%.2f,%.2f", udx or -99, udy or -99, udz or -99) .. ")") + dbg("FALL fID=" .. tostring(featureID), "vt=" .. string.format("%.2f", vt), "fallY=" .. string.format("%.2f", fallY), "front=(" .. string.format("%.2f,%.2f,%.2f", rdx or -99, rdy or -99, rdz or -99) .. ")", "up=(" .. string.format("%.2f,%.2f,%.2f", udx or -99, udy or -99, udz or -99) .. ")") end end @@ -778,55 +784,57 @@ if gadgetHandler:IsSyncedCode() then end end - local fallenFrame = featureinfo.frame + thisfeaturefalltime - local fadeFrame = fallenFrame + fireFadeFrames - local extinguishFrame = fallenFrame + fireExtinguishFrames - local sinkStartFrame = fallenFrame + fireSinkStartFrames + local fallenFrame = featureinfo.frame + thisfeaturefalltime + local fadeFrame = fallenFrame + fireFadeFrames + local extinguishFrame = fallenFrame + fireExtinguishFrames + local sinkStartFrame = fallenFrame + fireSinkStartFrames + + if featureinfo.fire and not featureinfo.fadeSent and gf >= fadeFrame then + spSendToUnsynced("treefire_fade", featureID) + featureinfo.fadeSent = true + end + if featureinfo.fire and gf >= extinguishFrame then + featureinfo.fire = false + if featureinfo.fireSent then + spSendToUnsynced("treefire_stop", featureID) + featureinfo.fireSent = false + end + end - if featureinfo.fire and (not featureinfo.fadeSent) and gf >= fadeFrame then - spSendToUnsynced("treefire_fade", featureID) - featureinfo.fadeSent = true + if gf >= sinkStartFrame then + if not featureinfo.sinkStartedFrame then + featureinfo.sinkStartedFrame = gf end - if featureinfo.fire and gf >= extinguishFrame then - featureinfo.fire = false - if featureinfo.fireSent then - spSendToUnsynced("treefire_stop", featureID) - featureinfo.fireSent = false - end + local dx, dy, dz = GetFeatureDirection(featureID) + if featureinfo.fire then + SetFeaturePosition(featureID, fx, fy - featureinfo.dissapearSpeed * sinkSpeedMultBurning, fz, false) + else + SetFeaturePosition(featureID, fx, fy - featureinfo.dissapearSpeed * sinkSpeedMultExtinguished, fz, false) end - if gf >= sinkStartFrame then - if not featureinfo.sinkStartedFrame then - featureinfo.sinkStartedFrame = gf - end - local dx, dy, dz = GetFeatureDirection(featureID) - if featureinfo.fire then - SetFeaturePosition(featureID, fx, fy - featureinfo.dissapearSpeed * sinkSpeedMultBurning, fz, false) - else - SetFeaturePosition(featureID, fx, fy - featureinfo.dissapearSpeed * sinkSpeedMultExtinguished, fz, false) - end + -- NOTE: this can create twitchy tree movement + -- Note 2: disabling this because I saw no reset issue, but this does fix gimbal induced twitch. + -- note 3 (Hornet): enabling this because 'some trees' absolutely do need it. Eg, Tangerine is fine, but Isthmus trees are not. Might be map feature setting issue in some way? + SetFeatureDirection(featureID, dx, dy, dz) -- gets reset so we re-apply + end - -- NOTE: this can create twitchy tree movement - -- Note 2: disabling this because I saw no reset issue, but this does fix gimbal induced twitch. - -- note 3 (Hornet): enabling this because 'some trees' absolutely do need it. Eg, Tangerine is fine, but Isthmus trees are not. Might be map feature setting issue in some way? - SetFeatureDirection(featureID, dx, dy, dz) -- gets reset so we re-apply + local gh = spGetGroundHeight(fx, fz) + local sinkStartedFrame = featureinfo.sinkStartedFrame or sinkStartFrame + local sinkMature = gf >= (sinkStartedFrame + minSinkFramesBeforeDestroy) + local canDestroyByTime = (featureinfo.destroyFrame <= gf) and not featureinfo.fire and sinkMature + local canDestroyByTerrain = (gh > fy + 48) and not featureinfo.fire and sinkMature + if canDestroyByTime or canDestroyByTerrain then + if featureinfo.fireSent then + spSendToUnsynced("treefire_stop", featureID) + featureinfo.fireSent = false end - - local gh = spGetGroundHeight(fx, fz) - local sinkStartedFrame = featureinfo.sinkStartedFrame or sinkStartFrame - local sinkMature = gf >= (sinkStartedFrame + minSinkFramesBeforeDestroy) - local canDestroyByTime = (featureinfo.destroyFrame <= gf) and (not featureinfo.fire) and sinkMature - local canDestroyByTerrain = (gh > fy + 48) and (not featureinfo.fire) and sinkMature - if canDestroyByTime or canDestroyByTerrain then - if featureinfo.fireSent then - spSendToUnsynced("treefire_stop", featureID) - featureinfo.fireSent = false - end - if not removeFeatures then removeFeatures = {} end - removeCount = removeCount + 1 - removeFeatures[removeCount] = featureID - DestroyFeature(featureID) + if not removeFeatures then + removeFeatures = {} end + removeCount = removeCount + 1 + removeFeatures[removeCount] = featureID + DestroyFeature(featureID) + end end end end diff --git a/luarules/gadgets/gfx_unit_glass.lua b/luarules/gadgets/gfx_unit_glass.lua index 22f728f2f8e..ef1087d56e9 100644 --- a/luarules/gadgets/gfx_unit_glass.lua +++ b/luarules/gadgets/gfx_unit_glass.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Unit glass pieces", - desc = "Draws semitransparent glass-like unit pieces", - author = "ivand", - date = "2019", - license = "PD", - layer = 0, - enabled = false, + name = "Unit glass pieces", + desc = "Draws semitransparent glass-like unit pieces", + author = "ivand", + date = "2019", + license = "PD", + layer = 0, + enabled = false, } end @@ -23,102 +23,96 @@ local spSetUnitPieceVisible = Spring.SetUnitPieceVisible local spGetUnitIsCloaked = Spring.GetUnitIsCloaked if gadgetHandler:IsSyncedCode() then -- Synced + local glassUnitDefs = {} -local glassUnitDefs = {} - -function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - SendToUnsynced("GlassUnitDestroyed", unitID) --TODO: figure out if it's worth performance toll -end - -local function ShowHideGlassPiece(unitID, pieceID, show) - spSetUnitPieceVisible(unitID, pieceID, show) -end + function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) + SendToUnsynced("GlassUnitDestroyed", unitID) --TODO: figure out if it's worth performance toll + end -local pieceList -local function FillGlassUnitDefs(unitID, unitDefID) - if not glassUnitDefs[unitDefID] then - pieceList = spGetUnitPieceList(unitID) - for pieceID, pieceName in ipairs(pieceList) do - if pieceName:find("_glass") then + local function ShowHideGlassPiece(unitID, pieceID, show) + spSetUnitPieceVisible(unitID, pieceID, show) + end - if not glassUnitDefs[unitDefID] then - glassUnitDefs[unitDefID] = {} + local pieceList + local function FillGlassUnitDefs(unitID, unitDefID) + if not glassUnitDefs[unitDefID] then + pieceList = spGetUnitPieceList(unitID) + for pieceID, pieceName in ipairs(pieceList) do + if pieceName:find("_glass") then + if not glassUnitDefs[unitDefID] then + glassUnitDefs[unitDefID] = {} + end + --Spring.Echo(UnitDefs[unitDefID].name,unitID, unitDefID, pieceID, pieceName) + table.insert(glassUnitDefs[unitDefID], pieceID) end - --Spring.Echo(UnitDefs[unitDefID].name,unitID, unitDefID, pieceID, pieceName) - table.insert(glassUnitDefs[unitDefID], pieceID) end end end -end -function gadget:UnitFinished(unitID, unitDefID) - FillGlassUnitDefs(unitID, unitDefID) - if glassUnitDefs[unitDefID] then - for _, pieceID in ipairs(glassUnitDefs[unitDefID]) do - ShowHideGlassPiece(unitID, pieceID, false) + function gadget:UnitFinished(unitID, unitDefID) + FillGlassUnitDefs(unitID, unitDefID) + if glassUnitDefs[unitDefID] then + for _, pieceID in ipairs(glassUnitDefs[unitDefID]) do + ShowHideGlassPiece(unitID, pieceID, false) + end end end -end -function gadget:Initialize() - local allUnits = Spring.GetAllUnits() - for _, unitID in ipairs(allUnits) do - local unitDefID = spGetUnitDefID(unitID) - local unitTeamID = spGetUnitTeam(unitID) - gadget:UnitFinished(unitID, unitDefID, unitTeamID) + function gadget:Initialize() + local allUnits = Spring.GetAllUnits() + for _, unitID in ipairs(allUnits) do + local unitDefID = spGetUnitDefID(unitID) + local unitTeamID = spGetUnitTeam(unitID) + gadget:UnitFinished(unitID, unitDefID, unitTeamID) + end end -end -function gadget:Shutdown() - local allUnits = Spring.GetAllUnits() - for _, unitID in ipairs(allUnits) do - local unitDefID = spGetUnitDefID(unitID) - if glassUnitDefs[unitDefID] then - for _, pieceID in ipairs(glassUnitDefs[unitDefID]) do - ShowHideGlassPiece(unitID, pieceID, true) + function gadget:Shutdown() + local allUnits = Spring.GetAllUnits() + for _, unitID in ipairs(allUnits) do + local unitDefID = spGetUnitDefID(unitID) + if glassUnitDefs[unitDefID] then + for _, pieceID in ipairs(glassUnitDefs[unitDefID]) do + ShowHideGlassPiece(unitID, pieceID, true) + end end end end -end - - else -- Unsynced + ----------------------------------------------------------------- + -- Includes + ----------------------------------------------------------------- ------------------------------------------------------------------ --- Includes ------------------------------------------------------------------ - -local LuaShader = gl.LuaShader + local LuaShader = gl.LuaShader ------------------------------------------------------------------ --- Acceleration ------------------------------------------------------------------ + ----------------------------------------------------------------- + -- Acceleration + ----------------------------------------------------------------- -local spGetVisibleUnits = Spring.GetVisibleUnits -local spGetTeamColor = Spring.GetTeamColor + local spGetVisibleUnits = Spring.GetVisibleUnits + local spGetTeamColor = Spring.GetTeamColor -local glGetSun = gl.GetSun + local glGetSun = gl.GetSun -local glDepthTest = gl.DepthTest -local glCulling = gl.Culling + local glDepthTest = gl.DepthTest + local glCulling = gl.Culling -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glUnitMultMatrix = gl.UnitMultMatrix -local glUnitPieceMultMatrix = gl.UnitPieceMultMatrix -local glUnitPiece = gl.UnitPiece -local glTexture = gl.Texture -local glUnitShapeTextures = gl.UnitShapeTextures + local glPushMatrix = gl.PushMatrix + local glPopMatrix = gl.PopMatrix + local glUnitMultMatrix = gl.UnitMultMatrix + local glUnitPieceMultMatrix = gl.UnitPieceMultMatrix + local glUnitPiece = gl.UnitPiece + local glTexture = gl.Texture + local glUnitShapeTextures = gl.UnitShapeTextures -local GL_BACK = GL.BACK -local GL_FRONT = GL.FRONT + local GL_BACK = GL.BACK + local GL_FRONT = GL.FRONT ------------------------------------------------------------------ --- Shader sources ------------------------------------------------------------------ + ----------------------------------------------------------------- + -- Shader sources + ----------------------------------------------------------------- -vertGlass = -[[ + vertGlass = [[ #version 150 compatibility #line 100054 @@ -157,8 +151,7 @@ void main() { } ]] -fragGlass = -[[ + fragGlass = [[ #version 150 compatibility #line 200094 @@ -267,270 +260,263 @@ void main(void){ ]] ------------------------------------------------------------------ --- Global variables ------------------------------------------------------------------ - -local udIDs = {} + ----------------------------------------------------------------- + -- Global variables + ----------------------------------------------------------------- -local solidUnitDefs = {} -local glassUnitDefs = {} + local udIDs = {} -local teamColors = {} -local glassUnits = {} + local solidUnitDefs = {} + local glassUnitDefs = {} -local pieceList + local teamColors = {} + local glassUnits = {} -local sunChanged = true -local glassShader + local pieceList -local isSpec, fullview = Spring.GetSpectatingState() -local myAllyTeamID = Spring.GetMyAllyTeamID() -local myTeamID = Spring.GetMyTeamID() + local sunChanged = true + local glassShader -local unitTextureFilesArray = VFS.DirList("unittextures/") -local unitTextureFiles = {} -for _, path in pairs(unitTextureFilesArray) do - unitTextureFiles[path] = true -end + local isSpec, fullview = Spring.GetSpectatingState() + local myAllyTeamID = Spring.GetMyAllyTeamID() + local myTeamID = Spring.GetMyTeamID() -local normalMaps = {} -for unitDefID, unitDef in pairs(UnitDefs) do - local unitNormalTexture = unitDef.customParams.normaltex - if unitNormalTexture and ( - unitTextureFiles[string.lower(unitNormalTexture)] or - VFS.FileExists(unitNormalTexture)) then - normalMaps[unitDefID] = unitNormalTexture - else - normalMaps[unitDefID] = "unittextures/blank_normal.dds" + local unitTextureFilesArray = VFS.DirList("unittextures/") + local unitTextureFiles = {} + for _, path in pairs(unitTextureFilesArray) do + unitTextureFiles[path] = true end -end -function gadget:PlayerChanged(playerID) - local prevFullview = fullview - local prevMyAllyTeamID = myAllyTeamID - isSpec, fullview = Spring.GetSpectatingState() - myAllyTeamID = Spring.GetMyAllyTeamID() - myTeamID = Spring.GetMyTeamID() - if fullview ~= prevFullview or myAllyTeamID ~= prevMyAllyTeamID then - UpdateAllGlassUnits() + local normalMaps = {} + for unitDefID, unitDef in pairs(UnitDefs) do + local unitNormalTexture = unitDef.customParams.normaltex + if unitNormalTexture and (unitTextureFiles[string.lower(unitNormalTexture)] or VFS.FileExists(unitNormalTexture)) then + normalMaps[unitDefID] = unitNormalTexture + else + normalMaps[unitDefID] = "unittextures/blank_normal.dds" + end end -end - - -local function RenderGlassUnits() - if #glassUnits == 0 then - return + function gadget:PlayerChanged(playerID) + local prevFullview = fullview + local prevMyAllyTeamID = myAllyTeamID + isSpec, fullview = Spring.GetSpectatingState() + myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetMyTeamID() + if fullview ~= prevFullview or myAllyTeamID ~= prevMyAllyTeamID then + UpdateAllGlassUnits() + end end + local function RenderGlassUnits() + if #glassUnits == 0 then + return + end - glDepthTest(true) - - glassShader:ActivateWith( function() - glTexture(3, "$reflection") - - glassShader:SetUniformMatrix("viewInvMat", "viewinverse") + glDepthTest(true) - if sunChanged then - glassShader:SetUniformFloatAlways("sunSpecular", glGetSun("specular" ,"unit")) - glassShader:SetUniformFloatAlways("sunPos", glGetSun("pos")) + glassShader:ActivateWith(function() + glTexture(3, "$reflection") - glassShader:SetUniformFloatArrayAlways("pbrParams", { - Spring.GetConfigFloat("tonemapA", 4.8), - Spring.GetConfigFloat("tonemapB", 0.8), - Spring.GetConfigFloat("tonemapC", 3.35), - Spring.GetConfigFloat("tonemapD", 1.0), - Spring.GetConfigFloat("tonemapE", 1.15), - Spring.GetConfigFloat("envAmbient", 0.3), - Spring.GetConfigFloat("unitSunMult", 1.35), - Spring.GetConfigFloat("unitExposureMult", 1.0), - }) + glassShader:SetUniformMatrix("viewInvMat", "viewinverse") - sunChanged = false - end - for i = 1, #glassUnits do - local unitID = glassUnits[i] - local unitDefID = udIDs[unitID] - glUnitShapeTextures(unitDefID, true) - glTexture(2, normalMaps[unitDefID]) + if sunChanged then + glassShader:SetUniformFloatAlways("sunSpecular", glGetSun("specular", "unit")) + glassShader:SetUniformFloatAlways("sunPos", glGetSun("pos")) - local glassUnitDef = glassUnitDefs[unitDefID] + glassShader:SetUniformFloatArrayAlways("pbrParams", { + Spring.GetConfigFloat("tonemapA", 4.8), + Spring.GetConfigFloat("tonemapB", 0.8), + Spring.GetConfigFloat("tonemapC", 3.35), + Spring.GetConfigFloat("tonemapD", 1.0), + Spring.GetConfigFloat("tonemapE", 1.15), + Spring.GetConfigFloat("envAmbient", 0.3), + Spring.GetConfigFloat("unitSunMult", 1.35), + Spring.GetConfigFloat("unitExposureMult", 1.0), + }) - glCulling(GL_FRONT) - for j = 1, #glassUnitDef do - local pieceID = glassUnitDef[j] - glPushMatrix() + sunChanged = false + end + for i = 1, #glassUnits do + local unitID = glassUnits[i] + local unitDefID = udIDs[unitID] + glUnitShapeTextures(unitDefID, true) + glTexture(2, normalMaps[unitDefID]) + + local glassUnitDef = glassUnitDefs[unitDefID] + + glCulling(GL_FRONT) + for j = 1, #glassUnitDef do + local pieceID = glassUnitDef[j] + glPushMatrix() glUnitMultMatrix(unitID) glUnitPieceMultMatrix(unitID, pieceID) glUnitPiece(unitID, pieceID) - glPopMatrix() - end + glPopMatrix() + end - glCulling(GL_BACK) - for j = 1, #glassUnitDef do - local pieceID = glassUnitDef[j] - glPushMatrix() + glCulling(GL_BACK) + for j = 1, #glassUnitDef do + local pieceID = glassUnitDef[j] + glPushMatrix() glUnitMultMatrix(unitID) glUnitPieceMultMatrix(unitID, pieceID) glUnitPiece(unitID, pieceID) - glPopMatrix() + glPopMatrix() + end + --glUnitShapeTextures(unitDefID, false) + --glTexture(2, false) end - --glUnitShapeTextures(unitDefID, false) - --glTexture(2, false) + + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) + end) + + glDepthTest(false) + glCulling(false) + end + + local function UpdateGlassUnit(unitID) + if not udIDs[unitID] then + udIDs[unitID] = spGetUnitDefID(unitID) end + local unitDefID = udIDs[unitID] - glTexture(0, false) - glTexture(1, false) - glTexture(2, false) - glTexture(3, false) + if not unitDefID then --unidentified object ? + return + end - end) + if solidUnitDefs[unitDefID] then --a known solid unitDef + return + end - glDepthTest(false) - glCulling(false) + if spGetUnitIsCloaked(unitID) then --cloaked unit + return + end -end + if not glassUnitDefs[unitDefID] then -- unknown unitdef + pieceList = spGetUnitPieceList(unitID) + for pieceID, pieceName in ipairs(pieceList) do + if pieceName:find("_glass") then + if not glassUnitDefs[unitDefID] then + glassUnitDefs[unitDefID] = {} + end + --Spring.Echo(unitID, unitDefID, pieceID, pieceName) + table.insert(glassUnitDefs[unitDefID], pieceID) + end + end + if not glassUnitDefs[unitDefID] then --no glass pieces found + solidUnitDefs[unitDefID] = true + end + end -local function UpdateGlassUnit(unitID) - if not udIDs[unitID] then - udIDs[unitID] = spGetUnitDefID(unitID) + if glassUnitDefs[unitDefID] then --unitdef with glass pieces + glassUnits[#glassUnits + 1] = unitID + teamColors[unitID] = { spGetTeamColor(spGetUnitTeam(unitID)) } + end end - local unitDefID = udIDs[unitID] - if not unitDefID then --unidentified object ? - return + function UpdateAllGlassUnits() + -- Wipe tables in-place to avoid per-call table allocation + for i = 1, #glassUnits do + glassUnits[i] = nil + end + for k in pairs(teamColors) do + teamColors[k] = nil + end + local units + if fullview then + units = Spring.GetAllUnits() + else + units = CallAsTeam(myTeamID, spGetVisibleUnits, -1, nil, false) + end + for i = 1, #units do + UpdateGlassUnit(units[i]) + end end - if solidUnitDefs[unitDefID] then --a known solid unitDef - return - end + ---------------------------------------------------------------------- - if spGetUnitIsCloaked(unitID) then --cloaked unit - return + local function GlassUnitDestroyed(unitID) + udIDs[unitID] = nil + --glassUnits[unitID] = nil + teamColors[unitID] = nil end - if not glassUnitDefs[unitDefID] then -- unknown unitdef - pieceList = spGetUnitPieceList(unitID) - for pieceID, pieceName in ipairs(pieceList) do - if pieceName:find("_glass") then + function gadget:UnitTaken(unitID, unitDefID, newTeam, oldTeam) + teamColors[unitID] = { spGetTeamColor(newTeam) } + end - if not glassUnitDefs[unitDefID] then - glassUnitDefs[unitDefID] = {} - end - --Spring.Echo(unitID, unitDefID, pieceID, pieceName) - table.insert(glassUnitDefs[unitDefID], pieceID) - end + function gadget:UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) + if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then + UpdateGlassUnit(unitID) end + end - if not glassUnitDefs[unitDefID] then --no glass pieces found - solidUnitDefs[unitDefID] = true + function gadget:UnitLeftLos(unitID, unitTeam, allyTeam, unitDefID) + if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and not CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then + GlassUnitDestroyed(unitID) end end - if glassUnitDefs[unitDefID] then --unitdef with glass pieces - glassUnits[#glassUnits + 1] = unitID - teamColors[unitID] = { spGetTeamColor(spGetUnitTeam(unitID)) } + function gadget:UnitCloaked(unitID, unitDefID, unitTeam) + if glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID] then + GlassUnitDestroyed(unitID) + end end -end -function UpdateAllGlassUnits() - -- Wipe tables in-place to avoid per-call table allocation - for i = 1, #glassUnits do glassUnits[i] = nil end - for k in pairs(teamColors) do teamColors[k] = nil end - local units - if fullview then - units = Spring.GetAllUnits() - else - units = CallAsTeam(myTeamID, spGetVisibleUnits, -1, nil, false) - end - for i=1, #units do - UpdateGlassUnit(units[i]) + function gadget:UnitDecloaked(unitID, unitDefID, unitTeam) + if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then + UpdateGlassUnit(unitID) + end end -end - ----------------------------------------------------------------------- - -local function GlassUnitDestroyed(unitID) - udIDs[unitID] = nil - --glassUnits[unitID] = nil - teamColors[unitID] = nil -end - -function gadget:UnitTaken(unitID, unitDefID, newTeam, oldTeam) - teamColors[unitID] = { spGetTeamColor(newTeam) } -end -function gadget:UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) - if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then - UpdateGlassUnit(unitID) + ---------------------------------------------------------------------- + function gadget:GameFrame(gf) + if gf % 7 == 1 then + UpdateAllGlassUnits() + end end -end -function gadget:UnitLeftLos(unitID, unitTeam, allyTeam, unitDefID) - if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and not CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then - GlassUnitDestroyed(unitID) + function gadget:DrawWorld() + RenderGlassUnits() end -end -function gadget:UnitCloaked(unitID, unitDefID, unitTeam) - if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) then - GlassUnitDestroyed(unitID) + local function GlassUpdateSun() + sunChanged = true end -end -function gadget:UnitDecloaked(unitID, unitDefID, unitTeam) - if (glassUnitDefs[unitDefID] or not solidUnitDefs[unitDefID]) and CallAsTeam(myTeamID, Spring.IsUnitVisible, unitID, nil, false) then - UpdateGlassUnit(unitID) + function gadget:SunChanged() + GlassUpdateSun() end -end ----------------------------------------------------------------------- -function gadget:GameFrame(gf) - if gf % 7 == 1 then + function gadget:Initialize() + glassShader = LuaShader({ + vertex = vertGlass, + fragment = fragGlass, + uniformInt = { + tex1 = 0, + tex2 = 1, + normalTex = 2, + reflectTex = 3, + }, + uniformFloat = {}, + }, "Glass Shader") + + glassShader:Initialize() + + gadgetHandler:AddSyncAction("GlassUnitDestroyed", GlassUnitDestroyed) + gadgetHandler:AddChatAction("GlassUpdateSun", GlassUpdateSun) UpdateAllGlassUnits() end -end - -function gadget:DrawWorld() - RenderGlassUnits() -end - -local function GlassUpdateSun() - sunChanged = true -end - -function gadget:SunChanged() - GlassUpdateSun() -end - -function gadget:Initialize() - glassShader = LuaShader({ - vertex = vertGlass, - fragment = fragGlass, - uniformInt = { - tex1 = 0, - tex2 = 1, - normalTex = 2, - reflectTex = 3, - }, - uniformFloat = { - }, - }, "Glass Shader") - - glassShader:Initialize() - - gadgetHandler:AddSyncAction("GlassUnitDestroyed", GlassUnitDestroyed) - gadgetHandler:AddChatAction("GlassUpdateSun", GlassUpdateSun) - UpdateAllGlassUnits() -end -function gadget:Shutdown() - glassShader:Finalize() - - gadgetHandler.RemoveSyncAction("GlassUnitDestroyed") - gadgetHandler:RemoveChatAction("GlassUpdateSun") -end + function gadget:Shutdown() + glassShader:Finalize() + gadgetHandler.RemoveSyncAction("GlassUnitDestroyed") + gadgetHandler:RemoveChatAction("GlassUpdateSun") + end end -- unsynced diff --git a/luarules/gadgets/gfx_unit_script_decals.lua b/luarules/gadgets/gfx_unit_script_decals.lua index 6a035added0..dd313955d31 100644 --- a/luarules/gadgets/gfx_unit_script_decals.lua +++ b/luarules/gadgets/gfx_unit_script_decals.lua @@ -12,13 +12,12 @@ function gadget:GetInfo() } end - if gadgetHandler:IsSyncedCode() then local SendToUnsynced = SendToUnsynced - local function UnitScriptDecal(unitID, unitDefID, _, lightIndex, posx,posz, heading) + local function UnitScriptDecal(unitID, unitDefID, _, lightIndex, posx, posz, heading) --Spring.Echo("Synced Gadget UnitScriptDecal", unitID, unitDefID, lightIndex, posx,posz, heading) - SendToUnsynced("cob_UnitScriptDecal", unitID, unitDefID, lightIndex, posx,posz, heading) + SendToUnsynced("cob_UnitScriptDecal", unitID, unitDefID, lightIndex, posx, posz, heading) end function gadget:Initialize() @@ -28,9 +27,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:Shutdown() gadgetHandler:DeregisterGlobal("UnitScriptDecal") end - -else -- UNSYNCED - +else -- UNSYNCED local myAllyTeamID = Spring.GetMyAllyTeamID() local myPlayerID = Spring.GetMyPlayerID() local mySpec, fullview = Spring.GetSpectatingState() @@ -42,16 +39,16 @@ else -- UNSYNCED mySpec, fullview = Spring.GetSpectatingState() end end - + local scriptUnitScriptDecal = Script.LuaUI.UnitScriptDecal - - local function UnitScriptDecal(_, unitID, unitDefID, lightIndex, posx,posz, heading) + + local function UnitScriptDecal(_, unitID, unitDefID, lightIndex, posx, posz, heading) if not fullview and not spIsUnitInLos(unitID, myAllyTeamID) then return end --Spring.Echo("Unsynced UnitScriptDecal", unitID, unitDefID, lightIndex, posx,posz, heading) - if Script.LuaUI('UnitScriptDecal') then - Script.LuaUI.UnitScriptDecal(unitID, unitDefID, lightIndex, posx,posz, heading) + if Script.LuaUI("UnitScriptDecal") then + Script.LuaUI.UnitScriptDecal(unitID, unitDefID, lightIndex, posx, posz, heading) end end @@ -62,5 +59,4 @@ else -- UNSYNCED function gadget:Shutdown() gadgetHandler:RemoveSyncAction("cob_UnitScriptDecal") end - end diff --git a/luarules/gadgets/gfx_unit_script_lights.lua b/luarules/gadgets/gfx_unit_script_lights.lua index c7271e7767f..c39edff8b85 100644 --- a/luarules/gadgets/gfx_unit_script_lights.lua +++ b/luarules/gadgets/gfx_unit_script_lights.lua @@ -12,7 +12,6 @@ function gadget:GetInfo() } end - if gadgetHandler:IsSyncedCode() then local SendToUnsynced = SendToUnsynced @@ -20,7 +19,7 @@ if gadgetHandler:IsSyncedCode() then --Spring.Echo("Synced Gadget UnitScriptLight", unitID, unitDefID, lightIndex, param) SendToUnsynced("cob_UnitScriptLight", unitID, unitDefID, lightIndex, param) end - + local function UnitScriptDistortion(unitID, unitDefID, _, lightIndex, param) --Spring.Echo("Synced Gadget UnitScriptDistortion", unitID, unitDefID, lightIndex, param) SendToUnsynced("cob_UnitScriptDistortion", unitID, unitDefID, lightIndex, param) @@ -35,10 +34,7 @@ if gadgetHandler:IsSyncedCode() then gadgetHandler:DeregisterGlobal("UnitScriptLight") gadgetHandler:DeregisterGlobal("UnitScriptDistortion") end - - - -else -- UNSYNCED +else -- UNSYNCED local myAllyTeamID = Spring.GetMyAllyTeamID() local myPlayerID = Spring.GetMyPlayerID() local mySpec, fullview = Spring.GetSpectatingState() @@ -50,31 +46,31 @@ else -- UNSYNCED mySpec, fullview = Spring.GetSpectatingState() end end - + local scriptUnitScriptLight = Script.LuaUI.UnitScriptLight - + local function UnitScriptLight(_, unitID, unitDefID, lightIndex, param) if not fullview and not spIsUnitInLos(unitID, myAllyTeamID) then return end --Spring.Echo("Unsynced UnitScriptLight", unitID, unitDefID, lightIndex, param) - if Script.LuaUI('UnitScriptLight') then + if Script.LuaUI("UnitScriptLight") then Script.LuaUI.UnitScriptLight(unitID, unitDefID, lightIndex, param) end end local scriptUnitScriptDistortion = Script.LuaUI.UnitScriptDistortion - + local function UnitScriptDistortion(_, unitID, unitDefID, lightIndex, param) if not fullview and not spIsUnitInLos(unitID, myAllyTeamID) then return end --Spring.Echo("Unsynced UnitScriptDistortion", unitID, unitDefID, lightIndex, param) - if Script.LuaUI('UnitScriptDistortion') then + if Script.LuaUI("UnitScriptDistortion") then Script.LuaUI.UnitScriptDistortion(unitID, unitDefID, lightIndex, param) end end - + function gadget:Initialize() gadgetHandler:AddSyncAction("cob_UnitScriptLight", UnitScriptLight) gadgetHandler:AddSyncAction("cob_UnitScriptDistortion", UnitScriptDistortion) @@ -84,5 +80,4 @@ else -- UNSYNCED gadgetHandler:RemoveSyncAction("cob_UnitScriptLight") gadgetHandler:RemoveSyncAction("cob_UnitScriptDistortion") end - end diff --git a/luarules/gadgets/gfx_unit_shield_effects.lua b/luarules/gadgets/gfx_unit_shield_effects.lua index 9716c103ab6..bf45bd10624 100644 --- a/luarules/gadgets/gfx_unit_shield_effects.lua +++ b/luarules/gadgets/gfx_unit_shield_effects.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Shield Effects", - desc = "Draws variable shields for shielded units", - author = "ivand, GoogleFrog", - date = "2019", + name = "Shield Effects", + desc = "Draws variable shields for shielded units", + author = "ivand, GoogleFrog", + date = "2019", license = "GNU GPL, v2 or later", - layer = 1500, -- Call ShieldPreDamaged after gadgets which change whether interception occurs + layer = 1500, -- Call ShieldPreDamaged after gadgets which change whether interception occurs enabled = true, } end @@ -27,11 +27,11 @@ local SHIELDONRULESPARAMINDEX = 531313 -- not a string due to perfmaxxing local sqrt = math.sqrt local function Norm(x, y, z) - return sqrt(x*x + y*y + z*z) + return sqrt(x * x + y * y + z * z) end local function DotProduct(x1, y1, z1, x2, y2, z2) - return x1*x2 + y1*y2 + z1*z2 + return x1 * x2 + y1 * y2 + z1 * z2 end -- Spherical linear interpolation for impact points @@ -67,7 +67,7 @@ end if gadgetHandler:IsSyncedCode() then local spSetUnitRulesParam = Spring.SetUnitRulesParam local SendToUnsynced = SendToUnsynced - local INLOS_ACCESS = {inlos = true} + local INLOS_ACCESS = { inlos = true } local gameFrame = 0 function gadget:GameFrame(n) @@ -78,16 +78,15 @@ if gadgetHandler:IsSyncedCode() then for unitDefID, unitDef in pairs(UnitDefs) do local weapons = unitDef.weapons local hasbeamweapon = false - for i=1,#weapons do + for i = 1, #weapons do local weaponDefID = weapons[i].weaponDef - if WeaponDefs[weaponDefID].type == "LightningCannon" or - WeaponDefs[weaponDefID].type == "BeamLaser" then + if WeaponDefs[weaponDefID].type == "LightningCannon" or WeaponDefs[weaponDefID].type == "BeamLaser" then hasbeamweapon = true end end if hasbeamweapon then unitBeamWeapons[unitDefID] = {} - for i=1,#weapons do + for i = 1, #weapons do unitBeamWeapons[unitDefID][i] = weapons[i].weaponDef end end @@ -97,7 +96,7 @@ if gadgetHandler:IsSyncedCode() then local weaponBeamtime = {} for weaponDefID, weaponDef in pairs(WeaponDefs) do weaponType[weaponDefID] = weaponDef.type - weaponDamages[weaponDefID] = {[SHIELDARMORIDALT] = weaponDef.damages[SHIELDARMORIDALT], [SHIELDARMORID] = weaponDef.damages[SHIELDARMORID]} + weaponDamages[weaponDefID] = { [SHIELDARMORIDALT] = weaponDef.damages[SHIELDARMORIDALT], [SHIELDARMORID] = weaponDef.damages[SHIELDARMORID] } weaponBeamtime[weaponDefID] = weaponDef.beamtime end @@ -108,8 +107,8 @@ if gadgetHandler:IsSyncedCode() then weaponDefID = Spring.GetProjectileDefID(proID) elseif beamEmitterUnitID then -- hitscan weapons local uDefID = Spring.GetUnitDefID(beamEmitterUnitID) - if unitBeamWeapons[ uDefID ] and unitBeamWeapons[ uDefID ][beamEmitterWeaponNum] then - weaponDefID = unitBeamWeapons[ uDefID ][beamEmitterWeaponNum] + if unitBeamWeapons[uDefID] and unitBeamWeapons[uDefID][beamEmitterWeaponNum] then + weaponDefID = unitBeamWeapons[uDefID][beamEmitterWeaponNum] if weaponType[weaponDefID] ~= "LightningCannon" then dmgMod = 1 / (weaponBeamtime[weaponDefID] * GAMESPEED) end @@ -145,16 +144,16 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetSpectatingState = Spring.GetSpectatingState -local spGetUnitPosition = Spring.GetUnitPosition -local spIsSphereInView = Spring.IsSphereInView -local spGetUnitRotation = Spring.GetUnitRotation -local spGetUnitShieldState = Spring.GetUnitShieldState -local spGetUnitIsStunned = Spring.GetUnitIsStunned -local spGetGameFrame = Spring.GetGameFrame -local spGetFrameTimeOffset = Spring.GetFrameTimeOffset -local spGetCameraPosition = Spring.GetCameraPosition +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetUnitPosition = Spring.GetUnitPosition +local spIsSphereInView = Spring.IsSphereInView +local spGetUnitRotation = Spring.GetUnitRotation +local spGetUnitShieldState = Spring.GetUnitShieldState +local spGetUnitIsStunned = Spring.GetUnitIsStunned +local spGetGameFrame = Spring.GetGameFrame +local spGetFrameTimeOffset = Spring.GetFrameTimeOffset +local spGetCameraPosition = Spring.GetCameraPosition local IterableMap = VFS.Include("LuaRules/Gadgets/Include/IterableMap.lua") @@ -175,10 +174,10 @@ local SHIELD_FADE_EPSILON = 0.001 -- multiplies opacity by OVERLAP_FALLOFF. Shields that sit *behind* another -- (relative to the camera) dim a bit more so the front shield stays readable. -- Tune higher (closer to 1.0) for less aggressive dimming. -local OVERLAP_FALLOFF = 0.93 -- per overlapping neighbour, front shield -local OVERLAP_FALLOFF_BEHIND = 0.9 -- per neighbour that is in front of this one -local OVERLAP_MIN_SCALE = 0.6 -- absolute floor so shields never fully vanish -local OVERLAP_LERP_RATE = 0.18 -- per-frame smoothing toward target scalar +local OVERLAP_FALLOFF = 0.93 -- per overlapping neighbour, front shield +local OVERLAP_FALLOFF_BEHIND = 0.9 -- per neighbour that is in front of this one +local OVERLAP_MIN_SCALE = 0.6 -- absolute floor so shields never fully vanish +local OVERLAP_LERP_RATE = 0.18 -- per-frame smoothing toward target scalar ----------------------------------------------------------------- -- Shield rendering state @@ -204,7 +203,7 @@ local checkStunnedTime = 0 local impactInfoStringTable = {} local impactInfoUniformCache = {} for i = 1, MAX_POINTS + 1 do - impactInfoStringTable[i-1] = string.format("impactInfo.impactInfoArray[%d]", i - 1) + impactInfoStringTable[i - 1] = string.format("impactInfo.impactInfoArray[%d]", i - 1) end -- Cached uniform locations (set after shader initialization) @@ -219,10 +218,7 @@ local function UpdateVisibility(unitID, unitData, fullview, forceUpdate) -- spectator fullview, own allyteam, direct LoS / AirLoS on the unit itself, -- or LoS / AirLoS on a point on the shield surface (so partial visibility -- of a large shield reveals the whole sphere). - local unitVisible = fullview - or (myAllyTeamID == unitData.allyTeamID) - or Spring.IsUnitInLos(unitID, myAllyTeamID) - or Spring.IsUnitInAirLos(unitID, myAllyTeamID) + local unitVisible = fullview or (myAllyTeamID == unitData.allyTeamID) or Spring.IsUnitInLos(unitID, myAllyTeamID) or Spring.IsUnitInAirLos(unitID, myAllyTeamID) if not unitVisible then local ux, uy, uz = Spring.GetUnitPosition(unitID) @@ -237,8 +233,7 @@ local function UpdateVisibility(unitID, unitData, fullview, forceUpdate) for i = 1, #samples do local sx = ux + samples[i][1] local sz = uz + samples[i][2] - if Spring.IsPosInLos(sx, cy, sz, myAllyTeamID) - or Spring.IsPosInAirLos(sx, cy, sz, myAllyTeamID) then + if Spring.IsPosInLos(sx, cy, sz, myAllyTeamID) or Spring.IsPosInAirLos(sx, cy, sz, myAllyTeamID) then unitVisible = true break end @@ -246,10 +241,7 @@ local function UpdateVisibility(unitID, unitData, fullview, forceUpdate) end if not unitVisible and r > 0 then -- Also check top and bottom of the shield sphere - if Spring.IsPosInLos(ux, uy + r, uz, myAllyTeamID) - or Spring.IsPosInAirLos(ux, uy + r, uz, myAllyTeamID) - or Spring.IsPosInLos(ux, uy - r, uz, myAllyTeamID) - or Spring.IsPosInAirLos(ux, uy - r, uz, myAllyTeamID) then + if Spring.IsPosInLos(ux, uy + r, uz, myAllyTeamID) or Spring.IsPosInAirLos(ux, uy + r, uz, myAllyTeamID) or Spring.IsPosInLos(ux, uy - r, uz, myAllyTeamID) or Spring.IsPosInAirLos(ux, uy - r, uz, myAllyTeamID) then unitVisible = true end end @@ -301,16 +293,16 @@ local function AddUnit(unitID, unitDefID) shieldInfo.overlapScale = 1.0 local unitData = { - unitDefID = unitDefID, - search = def.search, - capacity = def.shieldCapacity, - radius = def.shieldRadius, + unitDefID = unitDefID, + search = def.search, + capacity = def.shieldCapacity, + radius = def.shieldRadius, shieldInfo = shieldInfo, - allyTeamID = Spring.GetUnitAllyTeam(unitID) + allyTeamID = Spring.GetUnitAllyTeam(unitID), } if highEnoughQuality then - unitData.shieldPos = def.shieldPos + unitData.shieldPos = def.shieldPos unitData.hitData = {} unitData.needsUpdate = false end @@ -345,7 +337,7 @@ local function CalcAoE(dmg, capacity) return 0 end - local aoe = (BIASLOG + math.log(ratio)/LOG10) * LOGMUL + local aoe = (BIASLOG + math.log(ratio) / LOG10) * LOGMUL return (aoe > 0 and aoe or 0) end @@ -353,7 +345,9 @@ local AOE_SAME_SPOT = AOE_MAX / 3 -- ~0.13, angle threshold in radians. local AOE_SAME_SPOT_COS = math.cos(AOE_SAME_SPOT) -- about 0.99 -- Pre-hoisted sort comparator to avoid closure allocation every 2 frames -local hitDataSortFunc = function(a, b) return (((a and b) and a.dmg > b.dmg) or false) end +local hitDataSortFunc = function(a, b) + return (((a and b) and a.dmg > b.dmg) or false) +end --x, y, z here are normalized vectors local function DoAddShieldHitData(unitData, hitFrame, dmg, x, y, z, onlyMove) @@ -363,8 +357,7 @@ local function DoAddShieldHitData(unitData, hitFrame, dmg, x, y, z, onlyMove) for _, hitInfo in ipairs(hitData) do if hitInfo then - - local dist = hitInfo.x * x + hitInfo.y * y + hitInfo.z * z -- take dot product of normed vectors to get the cosine of their angle + local dist = hitInfo.x * x + hitInfo.y * y + hitInfo.z * z -- take dot product of normed vectors to get the cosine of their angle -- AoE radius in radians if dist >= AOE_SAME_SPOT_COS then @@ -415,7 +408,7 @@ local function ProcessHitTable(unitData, gameFrame) for i = #hitData, 1, -1 do local hitInfo = hitData[i] if hitInfo then - local mult = math.exp(-DECAY_FACTOR*(gameFrame - hitInfo.hitFrame)) + local mult = math.exp(-DECAY_FACTOR * (gameFrame - hitInfo.hitFrame)) hitInfo.dmg = hitInfo.dmg * mult hitInfo.hitFrame = gameFrame @@ -460,13 +453,13 @@ local function DrawIcosahedron(subd, cw) local acos = math.acos local function normalize(vertex) - local r = sqrt(vertex[1]*vertex[1] + vertex[2]*vertex[2] + vertex[3]*vertex[3]) + local r = sqrt(vertex[1] * vertex[1] + vertex[2] * vertex[2] + vertex[3] * vertex[3]) vertex[1], vertex[2], vertex[3] = vertex[1] / r, vertex[2] / r, vertex[3] / r return vertex end local function midpoint(pt1, pt2) - return { (pt1[1] + pt2[1]) / 2, (pt1[2] + pt2[2]) / 2, (pt1[3] + pt2[3]) / 2} + return { (pt1[1] + pt2[1]) / 2, (pt1[2] + pt2[2]) / 2, (pt1[3] + pt2[3]) / 2 } end local function subdivide(pt1, pt2, pt3) @@ -476,10 +469,10 @@ local function DrawIcosahedron(subd, cw) -- CCW order, starting from leftmost return { - {pt12, pt13, pt1}, - {pt2, pt23, pt12}, - {pt12, pt23, pt13}, - {pt23, pt3, pt13}, + { pt12, pt13, pt1 }, + { pt2, pt23, pt12 }, + { pt12, pt23, pt13 }, + { pt23, pt3, pt13 }, } end @@ -495,9 +488,18 @@ local function DrawIcosahedron(subd, cw) local Z = (1 + sqrt(5)) / 2 local vertexes0 = { - {-X, 0.0, Z}, {X, 0.0, Z}, {-X, 0.0, -Z}, {X, 0.0, -Z}, - {0.0, Z, X}, {0.0, Z, -X}, {0.0, -Z, X}, {0.0, -Z, -X}, - {Z, X, 0.0}, {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0}, + { -X, 0.0, Z }, + { X, 0.0, Z }, + { -X, 0.0, -Z }, + { X, 0.0, -Z }, + { 0.0, Z, X }, + { 0.0, Z, -X }, + { 0.0, -Z, X }, + { 0.0, -Z, -X }, + { Z, X, 0.0 }, + { -Z, X, 0.0 }, + { Z, -X, 0.0 }, + { -Z, -X, 0.0 }, } for _, vert in ipairs(vertexes0) do @@ -505,10 +507,26 @@ local function DrawIcosahedron(subd, cw) end local fi0 = { - {1,5,2}, {1,10,5}, {10,6,5}, {5,6,9}, {5,9,2}, - {9,11,2}, {9,4,11}, {6,4,9}, {6,3,4}, {3,8,4}, - {8,11,4}, {8,7,11}, {8,12,7}, {12,1,7}, {1,2,7}, - {7,2,11}, {10,1,12}, {10,12,3}, {10,3,6}, {8,3,12}, + { 1, 5, 2 }, + { 1, 10, 5 }, + { 10, 6, 5 }, + { 5, 6, 9 }, + { 5, 9, 2 }, + { 9, 11, 2 }, + { 9, 4, 11 }, + { 6, 4, 9 }, + { 6, 3, 4 }, + { 3, 8, 4 }, + { 8, 11, 4 }, + { 8, 7, 11 }, + { 8, 12, 7 }, + { 12, 1, 7 }, + { 1, 2, 7 }, + { 7, 2, 11 }, + { 10, 1, 12 }, + { 10, 12, 3 }, + { 10, 3, 6 }, + { 8, 3, 12 }, } if cw then -- re-wind to clockwise order @@ -519,7 +537,7 @@ local function DrawIcosahedron(subd, cw) local faces0 = {} for i = 1, #fi0 do - faces0[i] = {vertexes0[fi0[i][1]], vertexes0[fi0[i][2]], vertexes0[fi0[i][3]]} + faces0[i] = { vertexes0[fi0[i][1]], vertexes0[fi0[i][2]], vertexes0[fi0[i][3]] } end local faces = faces0 @@ -560,8 +578,8 @@ end local function LoadShieldConfig() local ShieldSphereBase = { - colormap1 = {{0.99, 0.99, 0.90, 0.002}, {0.6, 0.30, 0.09, 0.0}}, - colormap2 = {{0.7, 0.7, 0.7, 0.001}, {0.05, 0.03, 0.0, 0.0}}, + colormap1 = { { 0.99, 0.99, 0.90, 0.002 }, { 0.6, 0.30, 0.09, 0.0 } }, + colormap2 = { { 0.7, 0.7, 0.7, 0.001 }, { 0.05, 0.03, 0.0, 0.0 } }, terrainOutline = true, unitsOutline = true, impactAnimation = true, @@ -574,27 +592,27 @@ local function LoadShieldConfig() } local SEARCH_SMALL = { - {0, 0}, - {1, 0}, - {-1, 0}, - {0, 1}, - {0, -1}, + { 0, 0 }, + { 1, 0 }, + { -1, 0 }, + { 0, 1 }, + { 0, -1 }, } local SEARCH_MULT = 1 local SEARCH_BASE = 16 - local DIAG = 1/math.sqrt(2) + local DIAG = 1 / math.sqrt(2) local SEARCH_LARGE = { - {0, 0}, - {1, 0}, - {-1, 0}, - {0, 1}, - {0, -1}, - {DIAG, DIAG}, - {-DIAG, DIAG}, - {DIAG, -DIAG}, - {-DIAG, -DIAG}, + { 0, 0 }, + { 1, 0 }, + { -1, 0 }, + { 0, 1 }, + { 0, -1 }, + { DIAG, DIAG }, + { -DIAG, DIAG }, + { DIAG, -DIAG }, + { -DIAG, -DIAG }, } local searchSizes = {} @@ -608,7 +626,7 @@ local function LoadShieldConfig() local searchType = (radius > 250 and SEARCH_LARGE) or SEARCH_SMALL local search = {} for i = 1, #searchType do - search[i] = {SEARCH_MULT*(radius + SEARCH_BASE)*searchType[i][1], SEARCH_MULT*(radius + SEARCH_BASE)*searchType[i][2]} + search[i] = { SEARCH_MULT * (radius + SEARCH_BASE) * searchType[i][1], SEARCH_MULT * (radius + SEARCH_BASE) * searchType[i][2] } end searchSizes[radius] = search end @@ -622,7 +640,7 @@ local function LoadShieldConfig() myShield.margin = 0.2 end myShield.radius = radius - myShield.pos = {0, tonumber(ud.customParams.shield_emit_height) or 0, tonumber(ud.customParams.shield_emit_offset) or 0} + myShield.pos = { 0, tonumber(ud.customParams.shield_emit_height) or 0, tonumber(ud.customParams.shield_emit_offset) or 0 } local strengthMult = tonumber(ud.customParams.shield_color_mult) if strengthMult then @@ -632,7 +650,7 @@ local function LoadShieldConfig() -- Special handling for raptors if string.find(ud.name, "raptor_", nil, true) then - myShield.colormap1 = {{0.3, 0.9, 0.2, 1.2}, {0.6, 0.4, 0.1, 1.2}} + myShield.colormap1 = { { 0.3, 0.9, 0.2, 1.2 }, { 0.6, 0.4, 0.1, 1.2 } } end configTable[unitDefID] = { @@ -680,16 +698,16 @@ local function InitializeShader() shieldShaderFrag = shieldShaderFrag:gsub("###MAX_POINTS###", MAX_POINTS) local uniformFloats = { - color1 = {1,1,1,1}, - color2 = {1,1,1,1}, - translationScale = {1,1,1,1}, - rotMargin = {1,1,1,1}, + color1 = { 1, 1, 1, 1 }, + color2 = { 1, 1, 1, 1 }, + translationScale = { 1, 1, 1, 1 }, + rotMargin = { 1, 1, 1, 1 }, shieldFade = 1.0, overlapScale = 1.0, ["impactInfo.count"] = 1, } for i = 1, MAX_POINTS + 1 do - uniformFloats[impactInfoStringTable[i-1]] = {0,0,0,0} + uniformFloats[impactInfoStringTable[i - 1]] = { 0, 0, 0, 0 } end shieldShader = LuaShader({ @@ -721,16 +739,16 @@ local function InitializeShader() local uniformLocations = shieldShader.uniformLocations uTranslationScale = uniformLocations["translationScale"] uRotMargin = uniformLocations["rotMargin"] - uEffects = uniformLocations['effects'] - uColor1 = uniformLocations['color1'] - uColor2 = uniformLocations['color2'] + uEffects = uniformLocations["effects"] + uColor1 = uniformLocations["color1"] + uColor2 = uniformLocations["color2"] uImpactCount = uniformLocations["impactInfo.count"] uShieldFade = uniformLocations["shieldFade"] uOverlapScale = uniformLocations["overlapScale"] -- Cache impact info uniform locations for i = 1, MAX_POINTS do - impactInfoUniformCache[i] = uniformLocations[impactInfoStringTable[i-1]] + impactInfoUniformCache[i] = uniformLocations[impactInfoStringTable[i - 1]] end geometryLists = { @@ -769,7 +787,9 @@ function gadget:DrawWorld() -- Clear renderBuckets in-place to avoid per-frame table allocation for k, bucket in pairs(renderBuckets) do - for i = 1, #bucket do bucket[i] = nil end + for i = 1, #bucket do + bucket[i] = nil + end renderBuckets[k] = nil end haveTerrainOutline = false @@ -799,10 +819,14 @@ function gadget:DrawWorld() local fa = info.fadeAlpha or 0.0 if fa < fadeTarget then fa = fa + SHIELD_FADE_STEP - if fa > fadeTarget then fa = fadeTarget end + if fa > fadeTarget then + fa = fadeTarget + end elseif fa > fadeTarget then fa = fa - SHIELD_FADE_STEP - if fa < fadeTarget then fa = fadeTarget end + if fa < fadeTarget then + fa = fadeTarget + end end info.fadeAlpha = fa @@ -850,22 +874,24 @@ function gadget:DrawWorld() do local n = overlapScratchN local cx, cy, cz = spGetCameraPosition() - cx = cx or 0; cy = cy or 0; cz = cz or 0 + cx = cx or 0 + cy = cy or 0 + cz = cz or 0 for i = 1, n, 5 do local infoA = overlapScratch[i] - local ax, ay, az, ar = overlapScratch[i+1], overlapScratch[i+2], overlapScratch[i+3], overlapScratch[i+4] + local ax, ay, az, ar = overlapScratch[i + 1], overlapScratch[i + 2], overlapScratch[i + 3], overlapScratch[i + 4] local dxA, dyA, dzA = ax - cx, ay - cy, az - cz - local camDistA = dxA*dxA + dyA*dyA + dzA*dzA + local camDistA = dxA * dxA + dyA * dyA + dzA * dzA local target = 1.0 for j = 1, n, 5 do if j ~= i then - local bx, by, bz, br = overlapScratch[j+1], overlapScratch[j+2], overlapScratch[j+3], overlapScratch[j+4] + local bx, by, bz, br = overlapScratch[j + 1], overlapScratch[j + 2], overlapScratch[j + 3], overlapScratch[j + 4] local ddx, ddy, ddz = ax - bx, ay - by, az - bz - local d2 = ddx*ddx + ddy*ddy + ddz*ddz + local d2 = ddx * ddx + ddy * ddy + ddz * ddz local sumR = ar + br if d2 < sumR * sumR then local dxB, dyB, dzB = bx - cx, by - cy, bz - cz - local camDistB = dxB*dxB + dyB*dyB + dzB*dzB + local camDistB = dxB * dxB + dyB * dyB + dzB * dzB if camDistA > camDistB then -- A is behind B: dim more aggressively target = target * OVERLAP_FALLOFF_BEHIND @@ -875,10 +901,12 @@ function gadget:DrawWorld() end end end - if target < OVERLAP_MIN_SCALE then target = OVERLAP_MIN_SCALE end + if target < OVERLAP_MIN_SCALE then + target = OVERLAP_MIN_SCALE + end local cur = infoA.overlapScale or 1.0 infoA.overlapScale = cur + (target - cur) * OVERLAP_LERP_RATE - overlapScratch[i] = nil -- release table ref + overlapScratch[i] = nil -- release table ref end overlapScratchN = 0 end @@ -888,7 +916,9 @@ function gadget:DrawWorld() return end - if tracy then tracy.ZoneBeginN("Shield:EndDraw") end + if tracy then + tracy.ZoneBeginN("Shield:EndDraw") + end gl.Blending("alpha") gl.DepthTest(GL.LEQUAL) @@ -930,8 +960,12 @@ function gadget:DrawWorld() glUniform(uTranslationScale, posx, posy, posz, info.radius) glUniform(uRotMargin, pitch, yaw, roll, info.margin) - if uShieldFade then glUniform(uShieldFade, fadeAlpha) end - if uOverlapScale then glUniform(uOverlapScale, info.overlapScale or 1.0) end + if uShieldFade then + glUniform(uShieldFade, fadeAlpha) + end + if uOverlapScale then + glUniform(uOverlapScale, info.overlapScale or 1.0) + end if not info.optionX then local optionX = 0 @@ -953,10 +987,16 @@ function gadget:DrawWorld() if charge and info.shieldCapacity and info.shieldCapacity > 0 then local frac = charge / info.shieldCapacity - if frac > 1 then frac = 1 elseif frac < 0 then frac = 0 end + if frac > 1 then + frac = 1 + elseif frac < 0 then + frac = 0 + end -- Additional NaN safety check - if frac ~= frac then frac = 0 end -- NaN check (NaN != NaN) + if frac ~= frac then + frac = 0 + end -- NaN check (NaN != NaN) local fracinv = 1.0 - frac @@ -1023,7 +1063,9 @@ function gadget:DrawWorld() gl.DepthTest(false) gl.DepthMask(false) - if tracy then tracy.ZoneEnd() end + if tracy then + tracy.ZoneEnd() + end end -------------------------------------------------------------------------------- diff --git a/luarules/gadgets/gfx_wade_fx.lua b/luarules/gadgets/gfx_wade_fx.lua index b9c8f104fda..1aa6aa48dc7 100644 --- a/luarules/gadgets/gfx_wade_fx.lua +++ b/luarules/gadgets/gfx_wade_fx.lua @@ -1,4 +1,3 @@ - if not gadgetHandler:IsSyncedCode() then return end @@ -7,13 +6,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Wade Effects", - desc = "Spawn wakes when non-ship ground units move while partially, but not completely submerged", - author = "Anarchid", - date = "March 2016", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Wade Effects", + desc = "Spawn wakes when non-ship ground units move while partially, but not completely submerged", + author = "Anarchid", + date = "March 2016", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -26,8 +25,8 @@ local n_folds = 3 -- check every X-th unit local current_fold = 1 local spGetUnitIsCloaked = Spring.GetUnitIsCloaked -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitVelocity = Spring.GetUnitVelocity +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitVelocity = Spring.GetUnitVelocity local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitDefDimensions = Spring.GetUnitDefDimensions local spSpawnCEG = Spring.SpawnCEG @@ -35,7 +34,7 @@ local spSpawnCEG = Spring.SpawnCEG local wadeDepth = {} local wadeSfxID = {} -local smc = Game.speedModClasses -- Accepted values are 0 = Tank, 1 = KBot, 2 = Hover, 3 = Ship. +local smc = Game.speedModClasses -- Accepted values are 0 = Tank, 1 = KBot, 2 = Hover, 3 = Ship. local wadingSMC = { [smc.Tank] = true, [smc.KBot] = true, @@ -43,7 +42,7 @@ local wadingSMC = { local SFXTYPE_WAKE1 = 2 local SFXTYPE_WAKE2 = 3 -local cegSizes = {"waterwake-tiny", "waterwake-small", "waterwake-medium", "waterwake-large", "waterwake-huge"} +local cegSizes = { "waterwake-tiny", "waterwake-small", "waterwake-medium", "waterwake-large", "waterwake-huge" } local unitWadeCeg = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -86,7 +85,7 @@ function gadget:UnitCreated(unitID, unitDefID) if maxDepth then unitsCount = unitsCount + 1 unitsData[unitsCount] = unitID - unit[unitID] = {id = unitsCount, h = maxDepth, fx = wadeSfxID[unitDefID], defid = unitDefID} + unit[unitID] = { id = unitsCount, h = maxDepth, fx = wadeSfxID[unitDefID], defid = unitDefID } end end @@ -110,7 +109,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end function gadget:GameFrame(n) - if n%fold_frames == 0 then + if n % fold_frames == 0 then if n <= fold_frames then local minheight = Spring.GetGroundExtremes() if minheight > 20 then @@ -121,11 +120,11 @@ function gadget:GameFrame(n) local listData = unitsData if current_fold and unitsCount then - for i = current_fold, unitsCount, n_folds do -- this line errors sometimes: "attempt to compare number with nil" therefore the nil check above + for i = current_fold, unitsCount, n_folds do -- this line errors sometimes: "attempt to compare number with nil" therefore the nil check above local unitID = listData[i] local data = unit[unitID] if data and unitWadeCeg[data.defid] then - local x,y,z = spGetUnitPosition(unitID) + local x, y, z = spGetUnitPosition(unitID) if y and y > data.h and y <= 0 then local _, _, _, speed = spGetUnitVelocity(unitID) if speed and speed > 0 and not spGetUnitIsCloaked(unitID) then diff --git a/luarules/gadgets/gpumem_broadcast.lua b/luarules/gadgets/gpumem_broadcast.lua index 79d93331dd5..17b38ec8456 100644 --- a/luarules/gadgets/gpumem_broadcast.lua +++ b/luarules/gadgets/gpumem_broadcast.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "GPU mem Broadcast", - desc = "Broadcasts GPU mem usage", - author = "Floris", - date = "May 2018", + name = "GPU mem Broadcast", + desc = "Broadcasts GPU mem usage", + author = "Floris", + date = "May 2018", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end @@ -16,13 +16,12 @@ end -- config -------------------------------------------------------------------------------- -local sendPacketEvery = 15 +local sendPacketEvery = 15 -------------------------------------------------------------------------------- -- synced -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationGpuMem = validation @@ -30,12 +29,11 @@ if gadgetHandler:IsSyncedCode() then local vb1, vb2 = string.byte(validation, 1, 2) function gadget:RecvLuaMsg(msg, playerID) - if #msg >= 3 and string.byte(msg,1)==at_b and string.byte(msg,2)==vb1 and string.byte(msg,3)==vb2 then - SendToUnsynced("gpumemBroadcast",playerID,tonumber(msg:sub(4))) + if #msg >= 3 and string.byte(msg, 1) == at_b and string.byte(msg, 2) == vb1 and string.byte(msg, 3) == vb2 then + SendToUnsynced("gpumemBroadcast", playerID, tonumber(msg:sub(4))) return true end end - else -------------------------------------------------------------------------------- -- unsynced @@ -54,9 +52,9 @@ else gadgetHandler:RemoveSyncAction("gpumemBroadcast") end - function handleEvent(_,playerID,mem) + function handleEvent(_, playerID, mem) if Script.LuaUI("GpuMemEvent") then - Script.LuaUI.GpuMemEvent(playerID,mem) + Script.LuaUI.GpuMemEvent(playerID, mem) end end @@ -64,11 +62,10 @@ else updateTimer = updateTimer + GetLastUpdateSeconds() if updateTimer > sendPacketEvery then local used, max = Spring.GetVidMemUsage() - if type(used) == 'number' and used > 0 then - SendLuaRulesMsg("@"..validation..math.ceil((used/max)*100)) + if type(used) == "number" and used > 0 then + SendLuaRulesMsg("@" .. validation .. math.ceil((used / max) * 100)) updateTimer = 0 end end end - end diff --git a/luarules/gadgets/graphics_territorial_domination.lua b/luarules/gadgets/graphics_territorial_domination.lua index d6d7e210640..c68a103cc4d 100644 --- a/luarules/gadgets/graphics_territorial_domination.lua +++ b/luarules/gadgets/graphics_territorial_domination.lua @@ -7,13 +7,15 @@ function gadget:GetInfo() license = "GNU GPL, v2", layer = 1, --after game_territorial_domination.lua enabled = true, - depends = { 'gl4' }, + depends = { "gl4" }, } end local modOptions = Spring.GetModOptions() local isSynced = gadgetHandler:IsSyncedCode() -if modOptions.deathmode ~= "territorial_domination" or isSynced then return false end +if modOptions.deathmode ~= "territorial_domination" or isSynced then + return false +end if Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers() then return false @@ -73,9 +75,9 @@ local glTexture = gl.Texture local spPlaySoundFile = Spring.PlaySoundFile local planeLayout = { - { id = 1, name = 'posscale', size = 4 }, -- a vec4 for pos + scale - { id = 2, name = 'ownercolor', size = 4 }, -- vec4 the color of this square - { id = 3, name = 'capturestate', size = 4 }, -- vec4 speed, progress, startframe, showSquareTimestamp + { id = 1, name = "posscale", size = 4 }, -- a vec4 for pos + scale + { id = 2, name = "ownercolor", size = 4 }, -- vec4 the color of this square + { id = 3, name = "capturestate", size = 4 }, -- vec4 speed, progress, startframe, showSquareTimestamp } local vertexShaderSource = [[ @@ -342,16 +344,26 @@ local function createShader() end local function makeSquareVBO(xsize, ysize, xresolution, yresolution) - if not xsize then xsize = 1 end - if not ysize then ysize = xsize end - if not xresolution then xresolution = 1 end - if not yresolution then yresolution = xresolution end + if not xsize then + xsize = 1 + end + if not ysize then + ysize = xsize + end + if not xresolution then + xresolution = 1 + end + if not yresolution then + yresolution = xresolution + end xresolution = math.floor(xresolution) yresolution = math.floor(yresolution) local squareVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - if squareVBO == nil then return nil end + if squareVBO == nil then + return nil + end local VBOLayout = { { id = 0, name = "position", size = 4 }, @@ -408,9 +420,18 @@ end local function updateGridSquareInstanceVBO(gridID, posScale, instanceColor, captureState) local instanceData = { - posScale[1], posScale[2], posScale[3], posScale[4], -- posscale: x, y, z, scale - instanceColor[1], instanceColor[2], instanceColor[3], instanceColor[4], -- instanceColor: r, g, b, a - captureState[1], captureState[2], captureState[3], captureState[4] -- capturestate: speed, progress, startframe, showSquareTimestamp + posScale[1], + posScale[2], + posScale[3], + posScale[4], -- posscale: x, y, z, scale + instanceColor[1], + instanceColor[2], + instanceColor[3], + instanceColor[4], -- instanceColor: r, g, b, a + captureState[1], + captureState[2], + captureState[3], + captureState[4], -- capturestate: speed, progress, startframe, showSquareTimestamp } pushElementInstance(instanceVBO, instanceData, gridID, true, false) end @@ -418,7 +439,9 @@ end local function initializeOpenGL4() local planeResolution = 32 local squareVBO, numVertices, squareIndexVBO, numIndices = makeSquareVBO(1, 1, planeResolution, planeResolution) - if not squareVBO then return false end + if not squareVBO then + return false + end instanceVBO = makeInstanceVBOTable(planeLayout, 12, "territory_square_shader") instanceVBO.vertexVBO = squareVBO @@ -441,7 +464,7 @@ function gadget:Initialize() amSpectating = Spring.GetSpectatingState() myAllyID = Spring.GetMyAllyTeamID() initializeAllyColors() - + cameraHeightUpdateNeeded = true end @@ -508,12 +531,7 @@ local function updateGridSquareVisuals() captureChangePerFrame = gridData.captureChange / UPDATE_FRAME_RATE_INTERVAL end - updateGridSquareInstanceVBO( - gridID, - { gridData.gridMidpointX, SQUARE_HEIGHT, gridData.gridMidpointZ, SQUARE_SIZE }, - gridData.currentColor, - { captureChangePerFrame, gridData.oldProgress, currentFrame, gridData.showSquareTimestamp } - ) + updateGridSquareInstanceVBO(gridID, { gridData.gridMidpointX, SQUARE_HEIGHT, gridData.gridMidpointZ, SQUARE_SIZE }, gridData.currentColor, { captureChangePerFrame, gridData.oldProgress, currentFrame, gridData.showSquareTimestamp }) gridData.captureChange = nil end @@ -534,7 +552,7 @@ function gadget:RecvFromSynced(messageName, ...) gridMidpointZ = gridMidpointZ, isVisible = isVisible, currentColor = blankColor, - showSquareTimestamp = 0 + showSquareTimestamp = 0, } elseif messageName == "InitializeConfigs" then SQUARE_SIZE, UPDATE_FRAME_RATE_INTERVAL = ... @@ -602,8 +620,10 @@ local function updateMinimapFlipUniform() end local function updateIsMinimapRenderingUniform(isMinimapRendering) - if not squareShader then return end - + if not squareShader then + return + end + if cachedIsMinimapRendering ~= isMinimapRendering then cachedIsMinimapRendering = isMinimapRendering squareShader:SetUniformInt("isMinimapRendering", isMinimapRendering) @@ -611,10 +631,14 @@ local function updateIsMinimapRenderingUniform(isMinimapRendering) end local function updateCameraHeightUniforms() - if not squareShader then return end - - if not cameraHeightUpdateNeeded then return end - + if not squareShader then + return + end + + if not cameraHeightUpdateNeeded then + return + end + local minCameraHeight, maxCameraHeight = getMaxCameraHeight() if cachedCameraHeights.min ~= minCameraHeight or cachedCameraHeights.max ~= maxCameraHeight then cachedCameraHeights.min = minCameraHeight @@ -622,12 +646,14 @@ local function updateCameraHeightUniforms() squareShader:SetUniformFloat("minCameraDrawHeight", minCameraHeight) squareShader:SetUniformFloat("maxCameraDrawHeight", maxCameraHeight) end - + cameraHeightUpdateNeeded = false end local function updateCameraHeightMultiplierUniform() - if not squareShader then return end + if not squareShader then + return + end local cameraHeightMultiplier = Spring.GetConfigFloat(HEIGHT_OPACITY_CONFIG_KEY, DEFAULT_CAMERA_HEIGHT_MULTIPLIER) if cachedCameraHeightMultiplier ~= cameraHeightMultiplier then @@ -637,8 +663,10 @@ local function updateCameraHeightMultiplierUniform() end local function updateHeightmapTextureUniform() - if not squareShader then return end - + if not squareShader then + return + end + if cachedHeightmapTexture == nil then cachedHeightmapTexture = 0 squareShader:SetUniformInt("heightmapTexture", 0) @@ -654,9 +682,13 @@ function gadget:CameraPositionChanged(posX, posY, posZ) end function gadget:DrawWorldPreUnit() - if not squareShader or not squareVAO or not instanceVBO then return end + if not squareShader or not squareVAO or not instanceVBO then + return + end - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end glTexture(0, "$heightmap") glDepthTest(true) @@ -675,9 +707,13 @@ function gadget:DrawWorldPreUnit() end function gadget:DrawInMiniMap() - if not squareShader or not squareVAO or not instanceVBO then return end + if not squareShader or not squareVAO or not instanceVBO then + return + end - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end squareShader:Activate() updateIsMinimapRenderingUniform(1) @@ -701,4 +737,4 @@ function gadget:Shutdown() if squareShader then squareShader:Finalize() end -end \ No newline at end of file +end diff --git a/luarules/gadgets/gui_awards.lua b/luarules/gadgets/gui_awards.lua index dfe226df8f9..6700c833bce 100644 --- a/luarules/gadgets/gui_awards.lua +++ b/luarules/gadgets/gui_awards.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2013-07-06", license = "GNU GPL, v2 or later", layer = -1, - enabled = true + enabled = true, } end @@ -90,8 +90,8 @@ if gadgetHandler:IsSyncedCode() then end if numPlayers > 0 then present[teamIDs[j]] = true - teamInfo[teamIDs[j]] = { allDmg = 0, ecoDmg = 0, fightDmg = 0, otherDmg = 0, dmgDealt = 0, ecoUsed = 0, effScore = 0, ecoProd = 0, lastKill = 0, dmgRec = 0, sleepTime = 0, present = true, teamDmg = 0, } - coopInfo[teamIDs[j]] = { players = numPlayers, } + teamInfo[teamIDs[j]] = { allDmg = 0, ecoDmg = 0, fightDmg = 0, otherDmg = 0, dmgDealt = 0, ecoUsed = 0, effScore = 0, ecoProd = 0, lastKill = 0, dmgRec = 0, sleepTime = 0, present = true, teamDmg = 0 } + coopInfo[teamIDs[j]] = { players = numPlayers } else present[teamIDs[j]] = false end @@ -228,7 +228,7 @@ if gadgetHandler:IsSyncedCode() then for teamID, _ in pairs(teamInfo) do --deal with sleep times local curTime = Spring.GetGameSeconds() - if (curTime - teamInfo[teamID].lastKill > teamInfo[teamID].sleepTime) then + if curTime - teamInfo[teamID].lastKill > teamInfo[teamID].sleepTime then teamInfo[teamID].sleepTime = curTime - teamInfo[teamID].lastKill end @@ -250,12 +250,12 @@ if gadgetHandler:IsSyncedCode() then if teamInfo[teamID].teamDmg > 0 then table.insert(awards.traitor, { teamID = teamID, score = teamInfo[teamID].teamDmg }) end - if (teamInfo[teamID].sleepTime > 12 * 60) then + if teamInfo[teamID].sleepTime > 12 * 60 then table.insert(awards.sleep, { teamID = teamID, score = teamInfo[teamID].sleepTime }) end end - local awardSortFunction = function (award1, award2) + local awardSortFunction = function(award1, award2) return award1.score > award2.score end @@ -263,7 +263,7 @@ if gadgetHandler:IsSyncedCode() then table.sort(entries, awardSortFunction) for index = #entries, topPlacementsCount + 1, -1 do - table.remove(entries, index) + table.remove(entries, index) end for index = 1, topPlacementsCount do @@ -293,16 +293,15 @@ if gadgetHandler:IsSyncedCode() then ------------------------------------------------------------------------------------- else - local function ProcessAwards(_) local awards = SYNCED.awards -- record who won which awards in chat message (for demo parsing by replays.springrts.com) -- make all values positive, as unsigned ints are easier to parse - local ecoKillLine = '\161' .. tostring(1 + awards.ecoKill[1].teamID) .. ':' .. tostring(awards.ecoKill[1].score) .. '\161' .. tostring(1 + awards.ecoKill[2].teamID) .. ':' .. tostring(awards.ecoKill[2].score) .. '\161' .. tostring(1 + awards.ecoKill[3].teamID) .. ':' .. tostring(awards.ecoKill[3].score) - local fightKillLine = '\162' .. tostring(1 + awards.fightKill[1].teamID) .. ':' .. tostring(awards.fightKill[1].score) .. '\162' .. tostring(1 + awards.fightKill[2].teamID) .. ':' .. tostring(awards.fightKill[2].score) .. '\162' .. tostring(1 + awards.fightKill[3].teamID) .. ':' .. tostring(awards.fightKill[3].score) - local efficientKillLine = '\163' .. tostring(1 + awards.efficiency[1].teamID) .. ':' .. tostring(awards.efficiency[1].score) .. '\163' .. tostring(1 + awards.efficiency[2].teamID) .. ':' .. tostring(awards.efficiency[2].score) .. '\163' .. tostring(1 + awards.efficiency[3].teamID) .. ':' .. tostring(awards.efficiency[3].score) - local otherLine = '\164' .. tostring(1 + awards.goldenCow[1].teamID) .. '\165' .. tostring(1 + awards.eco[1].teamID) .. ':' .. tostring(awards.eco[1].score) .. '\166' .. tostring(1 + awards.damageReceived[1].teamID) .. ':' .. tostring(awards.damageReceived[1].score) .. '\167' .. tostring(1 + awards.sleep[1].teamID) .. ':' .. tostring(awards.sleep[1].score) + local ecoKillLine = "\161" .. tostring(1 + awards.ecoKill[1].teamID) .. ":" .. tostring(awards.ecoKill[1].score) .. "\161" .. tostring(1 + awards.ecoKill[2].teamID) .. ":" .. tostring(awards.ecoKill[2].score) .. "\161" .. tostring(1 + awards.ecoKill[3].teamID) .. ":" .. tostring(awards.ecoKill[3].score) + local fightKillLine = "\162" .. tostring(1 + awards.fightKill[1].teamID) .. ":" .. tostring(awards.fightKill[1].score) .. "\162" .. tostring(1 + awards.fightKill[2].teamID) .. ":" .. tostring(awards.fightKill[2].score) .. "\162" .. tostring(1 + awards.fightKill[3].teamID) .. ":" .. tostring(awards.fightKill[3].score) + local efficientKillLine = "\163" .. tostring(1 + awards.efficiency[1].teamID) .. ":" .. tostring(awards.efficiency[1].score) .. "\163" .. tostring(1 + awards.efficiency[2].teamID) .. ":" .. tostring(awards.efficiency[2].score) .. "\163" .. tostring(1 + awards.efficiency[3].teamID) .. ":" .. tostring(awards.efficiency[3].score) + local otherLine = "\164" .. tostring(1 + awards.goldenCow[1].teamID) .. "\165" .. tostring(1 + awards.eco[1].teamID) .. ":" .. tostring(awards.eco[1].score) .. "\166" .. tostring(1 + awards.damageReceived[1].teamID) .. ":" .. tostring(awards.damageReceived[1].score) .. "\167" .. tostring(1 + awards.sleep[1].teamID) .. ":" .. tostring(awards.sleep[1].score) local awardsMsg = ecoKillLine .. fightKillLine .. efficientKillLine .. otherLine Spring.SendLuaRulesMsg(awardsMsg) @@ -320,5 +319,4 @@ else function gadget:Shutdown() gadgetHandler:RemoveSyncAction("ReceiveAwards") end - end diff --git a/luarules/gadgets/gui_display_dps.lua b/luarules/gadgets/gui_display_dps.lua index e1a4b04888d..9b0c69cddf2 100644 --- a/luarules/gadgets/gui_display_dps.lua +++ b/luarules/gadgets/gui_display_dps.lua @@ -21,7 +21,7 @@ function gadget:GetInfo() date = "May 27, 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -63,7 +63,9 @@ local math_ceil = math.ceil local math_random = math.random local math_max = math.max local math_min = math.min -local damageSortFunc = function(m1, m2) return m1.damage < m2.damage end +local damageSortFunc = function(m1, m2) + return m1.damage < m2.damage +end local GL_GREATER = GL.GREATER local GL_SRC_ALPHA = GL.SRC_ALPHA @@ -267,9 +269,9 @@ local function drawDeathDPS(damage, ux, uy, uz, textSize, red, alpha) drawTextListsDeath[damage] = gl.CreateList(function() font:Begin() font:SetTextColor(1, 0.5, 0.5) - font:Print(damage, 0, 0, textSize, 'cnO') + font:Print(damage, 0, 0, textSize, "cnO") font:End() - end) -- rare error on this line: "table index is NaN" + end) -- rare error on this line: "table index is NaN" end glCallList(drawTextListsDeath[damage]) else @@ -277,7 +279,7 @@ local function drawDeathDPS(damage, ux, uy, uz, textSize, red, alpha) drawTextLists[damage] = gl.CreateList(function() font:Begin() font:SetTextColor(1, 1, 1) - font:Print(damage, 0, 0, textSize, 'cnO') + font:Print(damage, 0, 0, textSize, "cnO") font:End() end) end @@ -296,7 +298,7 @@ local function DrawUnitFunc(yshift, xshift, damage, textSize, alpha, paralyze) drawTextListsEmp[damage] = gl.CreateList(function() font:Begin() font:SetTextColor(0.5, 0.5, 1) - font:Print(damage, 0, 0, textSize, 'cnO') + font:Print(damage, 0, 0, textSize, "cnO") font:End() end) end @@ -306,7 +308,7 @@ local function DrawUnitFunc(yshift, xshift, damage, textSize, alpha, paralyze) drawTextLists[damage] = gl.CreateList(function() font:Begin() font:SetTextColor(1, 1, 1) - font:Print(damage, 0, 0, textSize, 'cnO') + font:Print(damage, 0, 0, textSize, "cnO") font:End() end) end @@ -319,11 +321,13 @@ function gadget:PlayerChanged(playerID) _, fullview = Spring.GetSpectatingState() end -local LOA_B1 = string.byte('L') -- 76, first byte of 'LobbyOverlayActive' +local LOA_B1 = string.byte("L") -- 76, first byte of 'LobbyOverlayActive' function gadget:RecvLuaMsg(msg, playerID) - if #msg < 18 or string.byte(msg, 1) ~= LOA_B1 or msg:sub(1, 18) ~= 'LobbyOverlayActive' then return end - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if #msg < 18 or string.byte(msg, 1) ~= LOA_B1 or msg:sub(1, 18) ~= "LobbyOverlayActive" then + return + end + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end function checkEnabled() @@ -405,8 +409,7 @@ function gadget:DrawWorld() damageTable[i] = nil else if fullview or CallAsTeam(myTeamID, IsUnitInView, damage.unitID) then - glDrawFuncAtUnit(damage.unitID, false, DrawUnitFunc, (damage.height + damage.heightOffset), - damage.offset, damage.damage, damage.textSize, damage.lifeSpan, damage.paralyze) + glDrawFuncAtUnit(damage.unitID, false, DrawUnitFunc, (damage.height + damage.heightOffset), damage.offset, damage.damage, damage.textSize, damage.lifeSpan, damage.paralyze) end if not paused then --if damage.paralyze then @@ -414,7 +417,7 @@ function gadget:DrawWorld() -- damage.textSize = (damage.textSize + 0.2) --else damage.heightOffset = (damage.heightOffset + damage.riseTime) - if (damage.heightOffset > 25) then + if damage.heightOffset > 25 then damage.lifeSpan = (damage.lifeSpan - damage.fadeTime) end --end @@ -424,7 +427,7 @@ function gadget:DrawWorld() for i, death in pairs(deadList) do if death.lifeSpan <= 0 then deadList[i] = nil - elseif type(death.damage) == "number" then -- checking this cause someone got an error that this was being NaN ...UPDATE: STILL ERRORS REGARDLESS + elseif type(death.damage) == "number" then -- checking this cause someone got an error that this was being NaN ...UPDATE: STILL ERRORS REGARDLESS drawDeathDPS(death.damage, death.x, death.y, death.z, death.textSize, death.red, death.lifeSpan) if not paused then death.y = (death.y + death.riseTime) diff --git a/luarules/gadgets/gui_soundeffects.lua b/luarules/gadgets/gui_soundeffects.lua index 3f3b80ceca6..1577c89f981 100644 --- a/luarules/gadgets/gui_soundeffects.lua +++ b/luarules/gadgets/gui_soundeffects.lua @@ -1,4 +1,3 @@ - if gadgetHandler:IsSyncedCode() then return end @@ -7,12 +6,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "GUI Sound Effects player", - desc = "Custom sound effects for your units!", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = 0, + name = "GUI Sound Effects player", + desc = "Custom sound effects for your units!", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end @@ -56,26 +55,26 @@ local AllyUnitCreatedSoundDelayLastFrame = 0 local AllyCommandUnitDelayLastFrame = 0 local CommandSoundEffects = { - [CMD.GROUPSELECT] = {'cmd-reclaim', 0.8}, -- not working yet - [CMD.RESURRECT] = {'cmd-rez', 0.8}, - [CMD.RECLAIM] = {'cmd-reclaim', 0.8}, - [CMD.REPAIR] = {'cmd-repair', 0.6}, - [CMD.REPEAT] = {'cmd-repeat', 0.8}, - [CMD.ATTACK] = {'cmd-attack', 0.8}, - [CMD.PATROL] = {'cmd-patrol', 0.8}, - [CMD.FIGHT] = {'cmd-fight', 0.8}, - [CMD.GUARD] = {'cmd-guard', 0.8}, - [CMD.SELFD] = {'cmd-selfd', 0.8}, - [CMD.STOP] = {'cmd-stop', 0.7}, - [CMD.WAIT] = {'cmd-wait', 0.6}, - [CMD.DGUN] = {'cmd-dgun', 0.6}, - [CMD.MOVE] = {'cmd-move-supershort', 0.4}, - [-1] = {'cmd-build', 0.5}, -- build (cmd < 0 == -unitdefid) - [GameCMD.UNIT_SET_TARGET] = {'cmd-settarget', 0.7}, - [GameCMD.UNIT_SET_TARGET_NO_GROUND] = {'cmd-settarget', 0.7}, + [CMD.GROUPSELECT] = { "cmd-reclaim", 0.8 }, -- not working yet + [CMD.RESURRECT] = { "cmd-rez", 0.8 }, + [CMD.RECLAIM] = { "cmd-reclaim", 0.8 }, + [CMD.REPAIR] = { "cmd-repair", 0.6 }, + [CMD.REPEAT] = { "cmd-repeat", 0.8 }, + [CMD.ATTACK] = { "cmd-attack", 0.8 }, + [CMD.PATROL] = { "cmd-patrol", 0.8 }, + [CMD.FIGHT] = { "cmd-fight", 0.8 }, + [CMD.GUARD] = { "cmd-guard", 0.8 }, + [CMD.SELFD] = { "cmd-selfd", 0.8 }, + [CMD.STOP] = { "cmd-stop", 0.7 }, + [CMD.WAIT] = { "cmd-wait", 0.6 }, + [CMD.DGUN] = { "cmd-dgun", 0.6 }, + [CMD.MOVE] = { "cmd-move-supershort", 0.4 }, + [-1] = { "cmd-build", 0.5 }, -- build (cmd < 0 == -unitdefid) + [GameCMD.UNIT_SET_TARGET] = { "cmd-settarget", 0.7 }, + [GameCMD.UNIT_SET_TARGET_NO_GROUND] = { "cmd-settarget", 0.7 }, [GameCMD.WANT_CLOAK] = { - on = {'cmd-on', 0.6}, - off = {'cmd-off', 0.5}, + on = { "cmd-on", 0.6 }, + off = { "cmd-off", 0.5 }, }, --[CMD.ONOFF] = {'cmd-onoff', 0.8}, @@ -89,7 +88,7 @@ local CMD_UNIT_SET_TARGET_NO_GROUND = GameCMD.UNIT_SET_TARGET_NO_GROUND local CMD_UNIT_SET_TARGET_RECTANGLE = GameCMD.UNIT_SET_TARGET_RECTANGLE local CMD_WANT_CLOAK = GameCMD.WANT_CLOAK -VFS.Include('luarules/configs/gui_soundeffects.lua') +VFS.Include("luarules/configs/gui_soundeffects.lua") -- convert key: name -> unitdefid -- + add scavenger units @@ -97,8 +96,8 @@ local newGUIUnitSoundEffects = {} for name, defs in pairs(GUIUnitSoundEffects) do if UnitDefNames[name] then newGUIUnitSoundEffects[UnitDefNames[name].id] = defs - if UnitDefNames[name..'_scav'] then - newGUIUnitSoundEffects[UnitDefNames[name..'_scav'].id] = defs + if UnitDefNames[name .. "_scav"] then + newGUIUnitSoundEffects[UnitDefNames[name .. "_scav"].id] = defs end -- ensure activate-able units have deactivate sounds if not defs.BaseSoundDeactivate and defs.BaseSoundActivate then @@ -146,7 +145,7 @@ local function playSetTargetSounds(preferredUnitID, cmdID, forceUi) CurrentGameFrame = spGetGameFrame() local soundDef = CommandSoundEffects[cmdID] or CommandSoundEffects[CMD_UNIT_SET_TARGET] if soundDef and (forceUi or CurrentGameFrame >= CommandUISoundDelayLastFrame + CommandUISoundDelayFrames) then - spPlaySoundFile(soundDef[1], soundDef[2], 'ui') + spPlaySoundFile(soundDef[1], soundDef[2], "ui") if not forceUi then CommandUISoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end @@ -172,19 +171,18 @@ local function playSetTargetSounds(preferredUnitID, cmdID, forceUi) if posx then if GUIUnitSoundEffects[unitDefID].BaseSoundMovementType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundMovementType - spPlaySoundFile(pickSound(sound), 0.8, posx, posy, posz, 'sfx') - CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.8, posx, posy, posz, "sfx") + CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, 'sfx') - CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, "sfx") + CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end end - local function PlaySelectSound(unitID) local unitDefID = spGetUnitDefID(unitID) @@ -193,13 +191,13 @@ local function PlaySelectSound(unitID) local posx, posy, posz = spGetUnitPosition(unitID) if GUIUnitSoundEffects[unitDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundSelectType - spPlaySoundFile(pickSound(sound), 0.35, posx, posy, posz, 'sfx') - SelectSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.35, posx, posy, posz, "sfx") + SelectSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.7, posx, posy, posz, 'sfx') - SelectSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.7, posx, posy, posz, "sfx") + SelectSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end selectionChanged = false @@ -220,7 +218,9 @@ function gadget:Initialize() -- Line/rectangle set-target is initiated in synced code (unit_target_on_the_move.lua). -- single sound trigger to unsynced via this sync action gadgetHandler:AddSyncAction("settarget_line_sound", function(_, teamID, playerID, unitID, cmdID) - if not enabled then return end + if not enabled then + return + end if playerID ~= spGetMyPlayerID() then if playerID ~= nil and playerID ~= -1 then return @@ -238,7 +238,9 @@ function gadget:Shutdown() end function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) - if not enabled then return end + if not enabled then + return + end if cmdID ~= CMD_UNIT_SET_TARGET and cmdID ~= CMD_UNIT_SET_TARGET_NO_GROUND and cmdID ~= CMD_UNIT_SET_TARGET_RECTANGLE then return end @@ -269,7 +271,9 @@ function gadget:Update() end function gadget:GameFrame(n) - if not enabled then return end + if not enabled then + return + end CurrentGameFrame = spGetGameFrame() if not selectionChanged then @@ -285,7 +289,7 @@ function gadget:GameFrame(n) selectionChanged = true PreviouslySelectedUnits = selectedUnits else - for i = 1,selectedUnitsCount do + for i = 1, selectedUnitsCount do if not PreviouslySelectedUnits[i] then selectionChanged = true PreviouslySelectedUnits = selectedUnits @@ -301,7 +305,7 @@ function gadget:GameFrame(n) end end elseif selectionChanged then - local _,_,LMBPress,_,_,offscreen = spGetMouseState() + local _, _, LMBPress, _, _, offscreen = spGetMouseState() if not LMBPress and not offscreen then selectionChanged = false local units = spGetSelectedUnits() @@ -309,7 +313,7 @@ function gadget:GameFrame(n) PreviouslySelectedUnits = units local unitcount = #units if unitcount > 1 then - local unitID = units[math_random(1,unitcount)] + local unitID = units[math_random(1, unitcount)] PlaySelectSound(unitID) elseif unitcount == 1 then local unitID = units[1] @@ -323,56 +327,58 @@ function gadget:GameFrame(n) local currentlyActive = spGetUnitIsActive(unitID) and 2 or 1 - if previousActiveState ~= currentlyActive then - local posx, posy, posz = spGetUnitPosition(unitID) - if currentlyActive == 1 then - ActiveStateTrackingUnitList[unitID] = 1 - if myTeamID == unitsTeam[unitID] then - if GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate then - local sound = GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate - spPlaySoundFile(pickSound(sound), 1, posx, posy, posz, 'sfx') - end - elseif spIsUnitInView(unitID) and (spIsUnitInLos(unitID, myAllyTeamID) or fullview) then - if GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate then - local sound = GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate - spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, 'sfx') - end + if previousActiveState ~= currentlyActive then + local posx, posy, posz = spGetUnitPosition(unitID) + if currentlyActive == 1 then + ActiveStateTrackingUnitList[unitID] = 1 + if myTeamID == unitsTeam[unitID] then + if GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate then + local sound = GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate + spPlaySoundFile(pickSound(sound), 1, posx, posy, posz, "sfx") end - elseif currentlyActive == 2 then - ActiveStateTrackingUnitList[unitID] = 2 - if myTeamID == unitsTeam[unitID] then - if GUIUnitSoundEffects[unitDefID].BaseSoundActivate then - local sound = GUIUnitSoundEffects[unitDefID].BaseSoundActivate - spPlaySoundFile(pickSound(sound), 1, posx, posy, posz, 'sfx') - end - elseif spIsUnitInView(unitID) and (spIsUnitInLos(unitID, myAllyTeamID) or fullview) then - if GUIUnitSoundEffects[unitDefID].BaseSoundActivate then - local sound = GUIUnitSoundEffects[unitDefID].BaseSoundActivate - spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, 'sfx') - end + elseif spIsUnitInView(unitID) and (spIsUnitInLos(unitID, myAllyTeamID) or fullview) then + if GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate then + local sound = GUIUnitSoundEffects[unitDefID].BaseSoundDeactivate + spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, "sfx") + end + end + elseif currentlyActive == 2 then + ActiveStateTrackingUnitList[unitID] = 2 + if myTeamID == unitsTeam[unitID] then + if GUIUnitSoundEffects[unitDefID].BaseSoundActivate then + local sound = GUIUnitSoundEffects[unitDefID].BaseSoundActivate + spPlaySoundFile(pickSound(sound), 1, posx, posy, posz, "sfx") + end + elseif spIsUnitInView(unitID) and (spIsUnitInLos(unitID, myAllyTeamID) or fullview) then + if GUIUnitSoundEffects[unitDefID].BaseSoundActivate then + local sound = GUIUnitSoundEffects[unitDefID].BaseSoundActivate + spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, "sfx") end end end + end end end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if not enabled then return end - if builderID and GUIUnitSoundEffects[unitDefID]then + if not enabled then + return + end + if builderID and GUIUnitSoundEffects[unitDefID] then local _, buildProgress = Spring.GetUnitIsBeingBuilt(unitID) - if buildProgress < 0.05 then --buildProgress + if buildProgress < 0.05 then --buildProgress if myTeamID == spGetUnitTeam(builderID) then local posx, posy, posz = spGetUnitPosition(unitID) if CurrentGameFrame >= UnitCreatedSoundDelayLastFrame + UnitCreatedSoundDelayFrames then if GUIUnitSoundEffects[unitDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundSelectType - spPlaySoundFile(pickSound(sound), 0.4, posx, posy, posz, 'sfx') - UnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.4, posx, posy, posz, "sfx") + UnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.1, posx, posy, posz, 'sfx') - UnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.1, posx, posy, posz, "sfx") + UnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end elseif spIsUnitInView(unitID) and (unitsAllyTeam[unitID] == myAllyTeamID or (spectator and fullview)) then @@ -380,13 +386,13 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) if CurrentGameFrame >= AllyUnitFinishedSoundDelayLastFrame + AllyUnitCreatedSoundDelayFrames and spIsUnitInView(unitID) then if GUIUnitSoundEffects[unitDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundSelectType - spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, 'sfx') - AllyUnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, "sfx") + AllyUnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.05, posx, posy, posz, 'sfx') - AllyUnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.05, posx, posy, posz, "sfx") + AllyUnitCreatedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end @@ -395,7 +401,9 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - if not enabled then return end + if not enabled then + return + end if GUIUnitSoundEffects[unitDefID] then units[unitID] = unitDefID unitsTeam[unitID] = unitTeam @@ -405,25 +413,25 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) if myTeamID == unitTeam then local posx, posy, posz = spGetUnitPosition(unitID) if CurrentGameFrame >= UnitFinishedSoundDelayLastFrame + UnitFinishedSoundDelayFrames then - UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) if GUIUnitSoundEffects[unitDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundSelectType if sound[2] then - spPlaySoundFile(sound[math_random(1,#sound)], 0.8, posx, posy, posz, 'sfx') - UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(sound[math_random(1, #sound)], 0.8, posx, posy, posz, "sfx") + UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) else - spPlaySoundFile(sound, 0.8, posx, posy, posz, 'sfx') - UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(sound, 0.8, posx, posy, posz, "sfx") + UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType if sound[2] then - spPlaySoundFile(sound[math_random(1,#sound)], 0.2, posx, posy, posz, 'sfx') - UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(sound[math_random(1, #sound)], 0.2, posx, posy, posz, "sfx") + UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) else - spPlaySoundFile(sound, 0.2, posx, posy, posz, 'sfx') - UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(sound, 0.2, posx, posy, posz, "sfx") + UnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end @@ -432,13 +440,13 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) local posx, posy, posz = spGetUnitPosition(unitID) if GUIUnitSoundEffects[unitDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundSelectType - spPlaySoundFile(pickSound(sound), 0.4, posx, posy, posz, 'sfx') - AllyUnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.4, posx, posy, posz, "sfx") + AllyUnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.1, posx, posy, posz, 'sfx') - AllyUnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.1, posx, posy, posz, "sfx") + AllyUnitFinishedSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end @@ -459,7 +467,9 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) - if not enabled then return end + if not enabled then + return + end if CurrentGameFrame ~= UsedFrame and commandSoundCount > 1 then commandSoundCount = commandSoundCount - 1 @@ -467,12 +477,14 @@ function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp if spIsUnitSelected(unitID) then local selectedUnitCount = spGetSelectedUnitsCount() if selectedUnitCount > 1 then - local selUnits = spGetSelectedUnits() - unitDefID = spGetUnitDefID(selUnits[math_random(1,#selUnits)]) + local selUnits = spGetSelectedUnits() + unitDefID = spGetUnitDefID(selUnits[math_random(1, #selUnits)]) end local posx, posy, posz = spGetUnitPosition(unitID) - if not posz then return end + if not posz then + return + end local ValidCommandSound = false @@ -481,30 +493,29 @@ function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp --allows two different cloak sounds for on and off if cmdID == CMD_WANT_CLOAK and cmdParams and cmdParams[1] ~= nil then if cmdParams[1] == 1 then - spPlaySoundFile(CommandSoundEffects[cmdID].on[1], CommandSoundEffects[cmdID].on[2], 'ui') + spPlaySoundFile(CommandSoundEffects[cmdID].on[1], CommandSoundEffects[cmdID].on[2], "ui") else - spPlaySoundFile(CommandSoundEffects[cmdID].off[1], CommandSoundEffects[cmdID].off[2], 'ui') + spPlaySoundFile(CommandSoundEffects[cmdID].off[1], CommandSoundEffects[cmdID].off[2], "ui") end elseif cmdID == CMD_MOVE and GUIUnitSoundEffects[unitDefID] and GUIUnitSoundEffects[unitDefID].Move then - spPlaySoundFile(GUIUnitSoundEffects[unitDefID].Move, CommandSoundEffects[cmdID][2], 'ui') + spPlaySoundFile(GUIUnitSoundEffects[unitDefID].Move, CommandSoundEffects[cmdID][2], "ui") else - spPlaySoundFile(CommandSoundEffects[cmdID][1], CommandSoundEffects[cmdID][2], 'ui') + spPlaySoundFile(CommandSoundEffects[cmdID][1], CommandSoundEffects[cmdID][2], "ui") end CommandUISoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) ValidCommandSound = true - - elseif cmdID < 0 then -- unit build + elseif cmdID < 0 then -- unit build local buildingDefID = -cmdID if GUIUnitSoundEffects[buildingDefID] and CurrentGameFrame >= UnitBuildOrderSoundDelayLastFrame + UnitBuildOrderSoundDelayFrames then if GUIUnitSoundEffects[buildingDefID].BaseSoundSelectType then local sound = GUIUnitSoundEffects[buildingDefID].BaseSoundSelectType - spPlaySoundFile(pickSound(sound), 0.3, posx, posy, posz, 'sfx') - UnitBuildOrderSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.3, posx, posy, posz, "sfx") + UnitBuildOrderSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[buildingDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[buildingDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, 'sfx') - UnitBuildOrderSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.5, posx, posy, posz, "sfx") + UnitBuildOrderSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end --spPlaySoundFile(CommandSoundEffects[-1][1], CommandSoundEffects[-1][2], 2) @@ -514,19 +525,18 @@ function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp if CurrentGameFrame >= CommandUnitSoundDelayLastFrame + CommandUnitSoundDelayFrames then if ValidCommandSound and GUIUnitSoundEffects[unitDefID] then - if GUIUnitSoundEffects[unitDefID].BaseSoundMovementType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundMovementType - spPlaySoundFile(pickSound(sound), 0.8, posx, posy, posz, 'sfx') + spPlaySoundFile(pickSound(sound), 0.8, posx, posy, posz, "sfx") UsedFrame = CurrentGameFrame - CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, 'sfx') + spPlaySoundFile(pickSound(sound), 0.2, posx, posy, posz, "sfx") UsedFrame = CurrentGameFrame - CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + CommandUnitSoundDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end @@ -534,28 +544,24 @@ function gadget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp end if unitTeam ~= myTeamID then - if spIsUnitInView(unitID) and (unitsAllyTeam[unitID] == myAllyTeamID or (spectator and fullview)) then - if CurrentGameFrame >= AllyCommandUnitDelayLastFrame + AllyCommandUnitDelayFrames then - if GUIUnitSoundEffects[unitDefID] then local posx, posy, posz = spGetUnitPosition(unitID) if GUIUnitSoundEffects[unitDefID].BaseSoundMovementType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundMovementType - spPlaySoundFile(pickSound(sound), 0.3, posx, posy, posz, 'sfx') - AllyCommandUnitDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.3, posx, posy, posz, "sfx") + AllyCommandUnitDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end if GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType then local sound = GUIUnitSoundEffects[unitDefID].BaseSoundWeaponType - spPlaySoundFile(pickSound(sound), 0.075, posx, posy, posz, 'sfx') - AllyCommandUnitDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization,DelayRandomization)) + spPlaySoundFile(pickSound(sound), 0.075, posx, posy, posz, "sfx") + AllyCommandUnitDelayLastFrame = CurrentGameFrame + (math_random(-DelayRandomization, DelayRandomization)) end end end end end end - diff --git a/luarules/gadgets/include/DirectionsUtil.lua b/luarules/gadgets/include/DirectionsUtil.lua index 1ae22e85c50..f33bdb5d72d 100644 --- a/luarules/gadgets/include/DirectionsUtil.lua +++ b/luarules/gadgets/include/DirectionsUtil.lua @@ -19,21 +19,21 @@ DirectionsUtil.Directions = {} local spherePackings = { {}, - { 1, 0, 0, -1, 0, 0 }, - { 1, 0, 0, -0.5, 0, 0.866025403784439, -0.5, 0, -0.866025403784438 }, - { -0.577350269072, 0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072 }, - { -1.478255937088018300e-01, 8.557801392177640800e-01, 4.957700547280610200e-01, 9.298520676823500700e-01, -3.330452755499895800e-01, -1.563840677968503200e-01, -7.820264758448114400e-01, -5.227348665222011400e-01, -3.393859902820995400e-01, -3.612306945786420600e-02, -5.056147808319168000e-01, 8.620027942282061400e-01, 3.612306958303366400e-02, 5.056147801034870400e-01, -8.620027946502272200e-01 }, - { 0.2125482559, -0.819507424, 0.5321943438, -0.9771505706, -0.1782579665, 0.115762077, -0.2125482559, 0.819507424, -0.5321943438, 0.9771505706, 0.1782579665, -0.115762077, 0, 0.544639035, 0.8386705679, 0, -0.544639035, -0.8386705679 }, - { -9.476914051796328000e-01, -2.052179514558175300e-01, 2.444720698749264500e-01, 8.503710682661692600e-01, 4.830848344829018500e-01, 2.085619547004717300e-01, -4.995609516538522300e-01, 3.276811928816584800e-01, -8.019126457503652500e-01, -3.344875986220292000e-01, 8.899589445240678700e-01, 3.099856826204648300e-01, 2.420381484495352800e-02, -9.924430055046316000e-01, 1.202957030483007100e-01, 5.426485704335360500e-02, -8.987314180840469400e-02, 9.944738024058507000e-01, 5.948684088498340500e-01, -2.881863468134767100e-01, -7.503867040818149600e-01 }, - { -7.941044876934105800e-01, 3.289288487526511000e-01, 5.110810846464987100e-01, 3.289288487526511000e-01, -7.941044876934105800e-01, -5.110810846464987100e-01, 7.941044876934105800e-01, 3.289288487526511000e-01, -5.110810846464987100e-01, -3.289288487526511000e-01, -7.941044876934105800e-01, 5.110810846464987100e-01, -7.941044876934105800e-01, -3.289288487526511000e-01, -5.110810846464987100e-01, 3.289288487526511000e-01, 7.941044876934105800e-01, 5.110810846464987100e-01, 7.941044876934105800e-01, -3.289288487526511000e-01, 5.110810846464987100e-01, -3.289288487526511000e-01, 7.941044876934105800e-01, -5.110810846464987100e-01 }, - { -8.643506667047617900e-01, 5.383237842631424800e-02, -5.000000000000000000e-01, -5.299022434190759900e-01, 7.798028605204248000e-01, 3.333333333820566700e-01, -6.225653123557293200e-01, -7.080263559415142000e-01, 3.333333333820566700e-01, -4.633153446832672500e-02, -7.439146082309695500e-01, -6.666666667641134600e-01, -1.814158190933165000e-20, -3.736015732192668700e-20, 1.000000000000000000e+00, 8.643506667047617900e-01, -5.383237842631424800e-02, -5.000000000000000000e-01, 5.299022434190759900e-01, -7.798028605204248000e-01, 3.333333333820566700e-01, 6.225653123557293200e-01, 7.080263559415142000e-01, 3.333333333820566700e-01, 4.633153446832672500e-02, 7.439146082309695500e-01, -6.666666667641134600e-01 }, - { 1.272017215942770300e-01, -8.282613625701686900e-01, -5.457131456148549600e-01, 1.272017215942770300e-01, 8.282613625701686900e-01, 5.457131456148549600e-01, -7.924432042767676200e-01, -6.099457090557890400e-01, -2.741585411849682600e-20, 8.379720535542102300e-01, -1.947788276596200700e-27, -5.457131457662900400e-01, 1.272017215942770300e-01, -8.282613625701686900e-01, 5.457131456148549600e-01, 8.379720535542102300e-01, 1.058131978332546100e-19, 5.457131457662900400e-01, -5.103133233369202500e-01, -3.373110909106216600e-19, -8.599885534266302800e-01, -7.924432042767676200e-01, 6.099457090557890400e-01, -6.234852139790438900e-20, 1.272017215942770300e-01, 8.282613625701686900e-01, -5.457131456148549600e-01, -5.103133233369202500e-01, 1.058052789347472700e-19, 8.599885534266302800e-01 }, - { -8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, 0.000000000000000000e+00, -8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 5.257311121715058100e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 5.257311121715058100e-01, 5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 8.506508083196721000e-01, 5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 5.257311121715058100e-01, 0.000000000000000000e+00 }, - { 8.506508083520922800e-01, 8.461919126260937200e-21, -5.257311121190491000e-01, 5.257311121190491000e-01, -8.506508083520922800e-01, 0.000000000000000000e+00, 1.266847532837018700e-20, -5.257311121190491000e-01, 8.506508083520922800e-01, 8.506508083520922800e-01, 2.117154529536468700e-20, 5.257311121190491000e-01, -5.257311121190491000e-01, -8.506508083520922800e-01, 3.303943689239743800e-23, -4.393463640892673700e-21, 5.257311121190491000e-01, -8.506508083520922800e-01, -8.506508083520922800e-01, -8.452634485559703400e-21, -5.257311121190491000e-01, -5.257311121190491000e-01, 8.506508083520922800e-01, 6.548656517555661000e-21, 1.691455361231732600e-20, 5.257311121190491000e-01, 8.506508083520922800e-01, -8.506508083520922800e-01, 1.437620000877874100e-20, 5.257311121190491000e-01, 5.257311121190491000e-01, 8.506508083520922800e-01, -1.769525700386171300e-21, -1.447394738531641700e-20, -5.257311121190491000e-01, -8.506508083520922800e-01 }, - { -3.662782754263035300e-01, 7.559006998770361200e-01, 5.426364868640331000e-01, -9.408369689587646700e-01, 3.266601753606225300e-01, -9.010509238579085500e-02, 2.949031158172585300e-01, -6.086014011689210300e-01, -7.366386405670685100e-01, -7.408675404485654300e-20, 1.131011890285944400e-19, 1.000000000000000000e+00, -7.559006998770361200e-01, -3.662782754263035300e-01, 5.426364868640331000e-01, -3.266601753606225300e-01, -9.408369689587646700e-01, -9.010509238579085500e-02, 6.086014011689210300e-01, 2.949031158172585300e-01, -7.366386405670685100e-01, 3.662782754263035300e-01, -7.559006998770361200e-01, 5.426364868640331000e-01, 9.408369689587646700e-01, -3.266601753606225300e-01, -9.010509238579085500e-02, -2.949031158172585300e-01, 6.086014011689210300e-01, -7.366386405670685100e-01, 7.559006998770361200e-01, 3.662782754263035300e-01, 5.426364868640331000e-01, 3.266601753606225300e-01, 9.408369689587646700e-01, -9.010509238579085500e-02, -6.086014011689210300e-01, -2.949031158172585300e-01, -7.366386405670685100e-01 }, - { 6.946907954011297700e-01, 6.946907954011297700e-01, -1.865727674927167300e-01, -1.514598564738553500e-01, -8.118004501805740100e-01, 5.639503000828500800e-01, 8.118004501805740100e-01, 1.514598564738553500e-01, 5.639503000828500800e-01, -9.244833579897193300e-20, 1.696363851953479400e-20, 1.000000000000000000e+00, 3.564164657663047900e-20, 5.579881977585050800e-22, -1.000000000000000000e+00, -6.946907954011297700e-01, 6.946907954011297700e-01, 1.865727674927167300e-01, 1.514598564738553500e-01, -8.118004501805740100e-01, -5.639503000828500800e-01, -8.118004501805740100e-01, 1.514598564738553500e-01, -5.639503000828500800e-01, 6.946907954011297700e-01, -6.946907954011297700e-01, 1.865727674927167300e-01, -1.514598564738553500e-01, 8.118004501805740100e-01, -5.639503000828500800e-01, 8.118004501805740100e-01, -1.514598564738553500e-01, -5.639503000828500800e-01, -6.946907954011297700e-01, -6.946907954011297700e-01, -1.865727674927167300e-01, 1.514598564738553500e-01, 8.118004501805740100e-01, 5.639503000828500800e-01, -8.118004501805740100e-01, -1.514598564738553500e-01, 5.639503000828500800e-01 }, - { 3.051769020044634000e-01, -1.827216208011631400e-01, 9.346014486265010700e-01, -4.907082900156075600e-01, -4.074541928305096000e-01, -7.701859871841322300e-01, -8.509184718243962800e-01, -5.229714314530596900e-01, 4.938254946812591100e-02, 7.012202810984599100e-01, -6.570858127633901800e-01, 2.766375824816142400e-01, 9.555627298013018600e-01, -6.205070554219331900e-03, -2.947225246127304600e-01, 4.640178136061391400e-01, 7.161624359518460300e-01, -5.213432976338108200e-01, 3.293077595811665400e-01, -7.129347262317069200e-02, -9.415272912884480300e-01, -9.197709483984433100e-01, 3.744800967201638600e-01, 1.174140521517120100e-01, -1.486192639405116700e-01, -8.424318278596852900e-01, 5.179005018290389100e-01, -5.847106287835063300e-01, -1.058298387139187500e-01, 8.043093470956201900e-01, 2.450588634219090800e-01, -8.423966818187401700e-01, -4.799103915515254800e-01, -3.651725826023697900e-01, 4.861143234505876400e-01, -7.939407090278801600e-01, -5.940876942043927400e-02, 6.276928285275815700e-01, 7.761908986396279800e-01, -2.557474796815069600e-01, 9.660236791779427400e-01, -3.730251873625246900e-02, 7.271391725044883400e-01, 5.996412865218138100e-01, 3.342139304516675300e-01 }, - { 1.266109423779690200e-01, 9.635507195418956400e-01, -2.356685811483104400e-01, -5.918057918773704800e-01, 7.708607037331326500e-01, 2.356685811483104100e-01, 8.112044025054730700e-02, 6.173531063344418500e-01, 7.824925662731709900e-01, -3.791737544816633500e-01, 4.938953812696635900e-01, -7.824925662731708800e-01, -9.635507195418956400e-01, 1.266109423779690200e-01, -2.356685811483104400e-01, -7.708607037331326500e-01, -5.918057918773704800e-01, 2.356685811483104100e-01, -6.173531063344418500e-01, 8.112044025054730700e-02, 7.824925662731709900e-01, -4.938953812696635900e-01, -3.791737544816633500e-01, -7.824925662731708800e-01, -1.266109423779690200e-01, -9.635507195418956400e-01, -2.356685811483104400e-01, 5.918057918773704800e-01, -7.708607037331326500e-01, 2.356685811483104100e-01, -8.112044025054730700e-02, -6.173531063344418500e-01, 7.824925662731709900e-01, 3.791737544816633500e-01, -4.938953812696635900e-01, -7.824925662731708800e-01, 9.635507195418956400e-01, -1.266109423779690200e-01, -2.356685811483104400e-01, 7.708607037331326500e-01, 5.918057918773704800e-01, 2.356685811483104100e-01, 6.173531063344418500e-01, -8.112044025054730700e-02, 7.824925662731709900e-01, 4.938953812696635900e-01, 3.791737544816633500e-01, -7.824925662731708800e-01 } + { 1, 0, 0, -1, 0, 0 }, + { 1, 0, 0, -0.5, 0, 0.866025403784439, -0.5, 0, -0.866025403784438 }, + { -0.577350269072, 0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072 }, + { -1.478255937088018300e-01, 8.557801392177640800e-01, 4.957700547280610200e-01, 9.298520676823500700e-01, -3.330452755499895800e-01, -1.563840677968503200e-01, -7.820264758448114400e-01, -5.227348665222011400e-01, -3.393859902820995400e-01, -3.612306945786420600e-02, -5.056147808319168000e-01, 8.620027942282061400e-01, 3.612306958303366400e-02, 5.056147801034870400e-01, -8.620027946502272200e-01 }, + { 0.2125482559, -0.819507424, 0.5321943438, -0.9771505706, -0.1782579665, 0.115762077, -0.2125482559, 0.819507424, -0.5321943438, 0.9771505706, 0.1782579665, -0.115762077, 0, 0.544639035, 0.8386705679, 0, -0.544639035, -0.8386705679 }, + { -9.476914051796328000e-01, -2.052179514558175300e-01, 2.444720698749264500e-01, 8.503710682661692600e-01, 4.830848344829018500e-01, 2.085619547004717300e-01, -4.995609516538522300e-01, 3.276811928816584800e-01, -8.019126457503652500e-01, -3.344875986220292000e-01, 8.899589445240678700e-01, 3.099856826204648300e-01, 2.420381484495352800e-02, -9.924430055046316000e-01, 1.202957030483007100e-01, 5.426485704335360500e-02, -8.987314180840469400e-02, 9.944738024058507000e-01, 5.948684088498340500e-01, -2.881863468134767100e-01, -7.503867040818149600e-01 }, + { -7.941044876934105800e-01, 3.289288487526511000e-01, 5.110810846464987100e-01, 3.289288487526511000e-01, -7.941044876934105800e-01, -5.110810846464987100e-01, 7.941044876934105800e-01, 3.289288487526511000e-01, -5.110810846464987100e-01, -3.289288487526511000e-01, -7.941044876934105800e-01, 5.110810846464987100e-01, -7.941044876934105800e-01, -3.289288487526511000e-01, -5.110810846464987100e-01, 3.289288487526511000e-01, 7.941044876934105800e-01, 5.110810846464987100e-01, 7.941044876934105800e-01, -3.289288487526511000e-01, 5.110810846464987100e-01, -3.289288487526511000e-01, 7.941044876934105800e-01, -5.110810846464987100e-01 }, + { -8.643506667047617900e-01, 5.383237842631424800e-02, -5.000000000000000000e-01, -5.299022434190759900e-01, 7.798028605204248000e-01, 3.333333333820566700e-01, -6.225653123557293200e-01, -7.080263559415142000e-01, 3.333333333820566700e-01, -4.633153446832672500e-02, -7.439146082309695500e-01, -6.666666667641134600e-01, -1.814158190933165000e-20, -3.736015732192668700e-20, 1.000000000000000000e+00, 8.643506667047617900e-01, -5.383237842631424800e-02, -5.000000000000000000e-01, 5.299022434190759900e-01, -7.798028605204248000e-01, 3.333333333820566700e-01, 6.225653123557293200e-01, 7.080263559415142000e-01, 3.333333333820566700e-01, 4.633153446832672500e-02, 7.439146082309695500e-01, -6.666666667641134600e-01 }, + { 1.272017215942770300e-01, -8.282613625701686900e-01, -5.457131456148549600e-01, 1.272017215942770300e-01, 8.282613625701686900e-01, 5.457131456148549600e-01, -7.924432042767676200e-01, -6.099457090557890400e-01, -2.741585411849682600e-20, 8.379720535542102300e-01, -1.947788276596200700e-27, -5.457131457662900400e-01, 1.272017215942770300e-01, -8.282613625701686900e-01, 5.457131456148549600e-01, 8.379720535542102300e-01, 1.058131978332546100e-19, 5.457131457662900400e-01, -5.103133233369202500e-01, -3.373110909106216600e-19, -8.599885534266302800e-01, -7.924432042767676200e-01, 6.099457090557890400e-01, -6.234852139790438900e-20, 1.272017215942770300e-01, 8.282613625701686900e-01, -5.457131456148549600e-01, -5.103133233369202500e-01, 1.058052789347472700e-19, 8.599885534266302800e-01 }, + { -8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, 0.000000000000000000e+00, -8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 5.257311121715058100e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 5.257311121715058100e-01, 5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 8.506508083196721000e-01, -5.257311121715058100e-01, 0.000000000000000000e+00, -5.257311121715058100e-01, 0.000000000000000000e+00, 8.506508083196721000e-01, 8.506508083196721000e-01, 5.257311121715058100e-01, 0.000000000000000000e+00, -8.506508083196721000e-01, 5.257311121715058100e-01, 0.000000000000000000e+00 }, + { 8.506508083520922800e-01, 8.461919126260937200e-21, -5.257311121190491000e-01, 5.257311121190491000e-01, -8.506508083520922800e-01, 0.000000000000000000e+00, 1.266847532837018700e-20, -5.257311121190491000e-01, 8.506508083520922800e-01, 8.506508083520922800e-01, 2.117154529536468700e-20, 5.257311121190491000e-01, -5.257311121190491000e-01, -8.506508083520922800e-01, 3.303943689239743800e-23, -4.393463640892673700e-21, 5.257311121190491000e-01, -8.506508083520922800e-01, -8.506508083520922800e-01, -8.452634485559703400e-21, -5.257311121190491000e-01, -5.257311121190491000e-01, 8.506508083520922800e-01, 6.548656517555661000e-21, 1.691455361231732600e-20, 5.257311121190491000e-01, 8.506508083520922800e-01, -8.506508083520922800e-01, 1.437620000877874100e-20, 5.257311121190491000e-01, 5.257311121190491000e-01, 8.506508083520922800e-01, -1.769525700386171300e-21, -1.447394738531641700e-20, -5.257311121190491000e-01, -8.506508083520922800e-01 }, + { -3.662782754263035300e-01, 7.559006998770361200e-01, 5.426364868640331000e-01, -9.408369689587646700e-01, 3.266601753606225300e-01, -9.010509238579085500e-02, 2.949031158172585300e-01, -6.086014011689210300e-01, -7.366386405670685100e-01, -7.408675404485654300e-20, 1.131011890285944400e-19, 1.000000000000000000e+00, -7.559006998770361200e-01, -3.662782754263035300e-01, 5.426364868640331000e-01, -3.266601753606225300e-01, -9.408369689587646700e-01, -9.010509238579085500e-02, 6.086014011689210300e-01, 2.949031158172585300e-01, -7.366386405670685100e-01, 3.662782754263035300e-01, -7.559006998770361200e-01, 5.426364868640331000e-01, 9.408369689587646700e-01, -3.266601753606225300e-01, -9.010509238579085500e-02, -2.949031158172585300e-01, 6.086014011689210300e-01, -7.366386405670685100e-01, 7.559006998770361200e-01, 3.662782754263035300e-01, 5.426364868640331000e-01, 3.266601753606225300e-01, 9.408369689587646700e-01, -9.010509238579085500e-02, -6.086014011689210300e-01, -2.949031158172585300e-01, -7.366386405670685100e-01 }, + { 6.946907954011297700e-01, 6.946907954011297700e-01, -1.865727674927167300e-01, -1.514598564738553500e-01, -8.118004501805740100e-01, 5.639503000828500800e-01, 8.118004501805740100e-01, 1.514598564738553500e-01, 5.639503000828500800e-01, -9.244833579897193300e-20, 1.696363851953479400e-20, 1.000000000000000000e+00, 3.564164657663047900e-20, 5.579881977585050800e-22, -1.000000000000000000e+00, -6.946907954011297700e-01, 6.946907954011297700e-01, 1.865727674927167300e-01, 1.514598564738553500e-01, -8.118004501805740100e-01, -5.639503000828500800e-01, -8.118004501805740100e-01, 1.514598564738553500e-01, -5.639503000828500800e-01, 6.946907954011297700e-01, -6.946907954011297700e-01, 1.865727674927167300e-01, -1.514598564738553500e-01, 8.118004501805740100e-01, -5.639503000828500800e-01, 8.118004501805740100e-01, -1.514598564738553500e-01, -5.639503000828500800e-01, -6.946907954011297700e-01, -6.946907954011297700e-01, -1.865727674927167300e-01, 1.514598564738553500e-01, 8.118004501805740100e-01, 5.639503000828500800e-01, -8.118004501805740100e-01, -1.514598564738553500e-01, 5.639503000828500800e-01 }, + { 3.051769020044634000e-01, -1.827216208011631400e-01, 9.346014486265010700e-01, -4.907082900156075600e-01, -4.074541928305096000e-01, -7.701859871841322300e-01, -8.509184718243962800e-01, -5.229714314530596900e-01, 4.938254946812591100e-02, 7.012202810984599100e-01, -6.570858127633901800e-01, 2.766375824816142400e-01, 9.555627298013018600e-01, -6.205070554219331900e-03, -2.947225246127304600e-01, 4.640178136061391400e-01, 7.161624359518460300e-01, -5.213432976338108200e-01, 3.293077595811665400e-01, -7.129347262317069200e-02, -9.415272912884480300e-01, -9.197709483984433100e-01, 3.744800967201638600e-01, 1.174140521517120100e-01, -1.486192639405116700e-01, -8.424318278596852900e-01, 5.179005018290389100e-01, -5.847106287835063300e-01, -1.058298387139187500e-01, 8.043093470956201900e-01, 2.450588634219090800e-01, -8.423966818187401700e-01, -4.799103915515254800e-01, -3.651725826023697900e-01, 4.861143234505876400e-01, -7.939407090278801600e-01, -5.940876942043927400e-02, 6.276928285275815700e-01, 7.761908986396279800e-01, -2.557474796815069600e-01, 9.660236791779427400e-01, -3.730251873625246900e-02, 7.271391725044883400e-01, 5.996412865218138100e-01, 3.342139304516675300e-01 }, + { 1.266109423779690200e-01, 9.635507195418956400e-01, -2.356685811483104400e-01, -5.918057918773704800e-01, 7.708607037331326500e-01, 2.356685811483104100e-01, 8.112044025054730700e-02, 6.173531063344418500e-01, 7.824925662731709900e-01, -3.791737544816633500e-01, 4.938953812696635900e-01, -7.824925662731708800e-01, -9.635507195418956400e-01, 1.266109423779690200e-01, -2.356685811483104400e-01, -7.708607037331326500e-01, -5.918057918773704800e-01, 2.356685811483104100e-01, -6.173531063344418500e-01, 8.112044025054730700e-02, 7.824925662731709900e-01, -4.938953812696635900e-01, -3.791737544816633500e-01, -7.824925662731708800e-01, -1.266109423779690200e-01, -9.635507195418956400e-01, -2.356685811483104400e-01, 5.918057918773704800e-01, -7.708607037331326500e-01, 2.356685811483104100e-01, -8.112044025054730700e-02, -6.173531063344418500e-01, 7.824925662731709900e-01, 3.791737544816633500e-01, -4.938953812696635900e-01, -7.824925662731708800e-01, 9.635507195418956400e-01, -1.266109423779690200e-01, -2.356685811483104400e-01, 7.708607037331326500e-01, 5.918057918773704800e-01, 2.356685811483104100e-01, 6.173531063344418500e-01, -8.112044025054730700e-02, 7.824925662731709900e-01, 4.938953812696635900e-01, 3.791737544816633500e-01, -7.824925662731708800e-01 }, } -------------------------------------------------------------------------------------------------------------- @@ -61,9 +61,9 @@ DirectionsUtil.GetRandomDirections = function(n) m4 = math_sqrt(1 - m3) - vecs[i ] = 2 * m1 * m4 -- x + vecs[i] = 2 * m1 * m4 -- x vecs[i + 1] = 2 * m2 * m4 -- y - vecs[i + 2] = 1 - 2 * m3 -- z + vecs[i + 2] = 1 - 2 * m3 -- z end return vecs diff --git a/luarules/gadgets/include/GenBrdfLut.lua b/luarules/gadgets/include/GenBrdfLut.lua index ef347a220c9..9c4404bed53 100644 --- a/luarules/gadgets/include/GenBrdfLut.lua +++ b/luarules/gadgets/include/GenBrdfLut.lua @@ -1,5 +1,4 @@ -local lutVS = -[[ +local lutVS = [[ #version 150 compatibility void main() { @@ -7,8 +6,7 @@ local lutVS = } ]] -local lutFS = -[[ +local lutFS = [[ #version 150 compatibility const uint NUM_SAMPLES = 1024u; @@ -127,26 +125,25 @@ local lutFS = } ]] - local GL_RG16F = 0x822F local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 local function new(class, textureSize, gOption) - return setmetatable( - { + return setmetatable({ gOption = math.clamp(gOption or 3, 1, 4), --clamp between 1 and 3 textureSize = textureSize or 512, shader = nil, tex = nil, fbo = nil, - }, class) end local GenBrdfLut = setmetatable({}, { - __call = function(self, ...) return new(self, ...) end, - }) + __call = function(self, ...) + return new(self, ...) + end, +}) GenBrdfLut.__index = GenBrdfLut function GenBrdfLut:Initialize() @@ -165,7 +162,7 @@ function GenBrdfLut:Initialize() self.fbo = gl.CreateFBO({ color0 = self.tex, - drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + drawbuffers = { GL_COLOR_ATTACHMENT0_EXT }, }) if not self.fbo then @@ -178,7 +175,7 @@ function GenBrdfLut:Initialize() vertex = lutVS, fragment = lutFS, uniformInt = { - texSize = {self.textureSize, self.textureSize}, + texSize = { self.textureSize, self.textureSize }, }, }) @@ -198,13 +195,15 @@ end function GenBrdfLut:Execute(saveDebug) if self.shader and gl.IsValidFBO(self.fbo) then - gl.ActiveShader(self.shader, function () + gl.ActiveShader(self.shader, function() gl.ActiveFBO(self.fbo, function() gl.DepthTest(false) gl.Blending(false) gl.PushPopMatrix(function() - gl.MatrixMode(GL.PROJECTION); gl.LoadIdentity(); - gl.MatrixMode(GL.MODELVIEW); gl.LoadIdentity(); + gl.MatrixMode(GL.PROJECTION) + gl.LoadIdentity() + gl.MatrixMode(GL.MODELVIEW) + gl.LoadIdentity() gl.TexRect(-1, -1, 1, 1) end) if saveDebug then diff --git a/luarules/gadgets/include/GenEnvLut.lua b/luarules/gadgets/include/GenEnvLut.lua index b94b897aa41..fcf71b59212 100644 --- a/luarules/gadgets/include/GenEnvLut.lua +++ b/luarules/gadgets/include/GenEnvLut.lua @@ -1,5 +1,4 @@ -local lutVS = -[[ +local lutVS = [[ #version 150 compatibility #line 10004 @@ -8,8 +7,7 @@ local lutVS = } ]] -local lutFS = -[[ +local lutFS = [[ #version 150 compatibility #line 20014 @@ -143,26 +141,25 @@ local lutFS = } ]] - local GL_RGB16F = 0x881B local GL_RGB32F = 0x8815 local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 local function new(class, numSamples) - return setmetatable( - { + return setmetatable({ numSamples = numSamples or 64, shader = nil, tex = nil, - }, class) end local GenEnvLut = setmetatable({}, { - __call = function(self, ...) return new(self, ...) end, - }) + __call = function(self, ...) + return new(self, ...) + end, +}) GenEnvLut.__index = GenEnvLut function GenEnvLut:Initialize() @@ -202,7 +199,6 @@ function GenEnvLut:Initialize() elseif shLog ~= "" then Spring.Echo(string.format("GenEnvLut: [%s] shader warnings:\n%s", "GenEnvLut", shLog)) end - end function GenEnvLut:GetTexture() @@ -214,20 +210,20 @@ function GenEnvLut:Execute(saveDebug) gl.Texture(7, "$reflection") --reflectTex gl.UseShader(self.shader) - gl.RenderToTexture(self.tex, function() - gl.DepthTest(false) - gl.Blending(false) - --gl.PushMatrix() - --gl.MatrixMode(GL.PROJECTION); gl.LoadIdentity(); - --gl.MatrixMode(GL.MODELVIEW); gl.LoadIdentity(); - gl.TexRect(-1, -1, 1, 1) - --gl.PopMatrix() - if saveDebug then - local gf = Spring.GetGameFrame() - gl.SaveImage(0, 0, 3, 3, string.format("envLut_%s.png", gf)) - end - gl.Blending(true) - end) + gl.RenderToTexture(self.tex, function() + gl.DepthTest(false) + gl.Blending(false) + --gl.PushMatrix() + --gl.MatrixMode(GL.PROJECTION); gl.LoadIdentity(); + --gl.MatrixMode(GL.MODELVIEW); gl.LoadIdentity(); + gl.TexRect(-1, -1, 1, 1) + --gl.PopMatrix() + if saveDebug then + local gf = Spring.GetGameFrame() + gl.SaveImage(0, 0, 3, 3, string.format("envLut_%s.png", gf)) + end + gl.Blending(true) + end) gl.UseShader(0) gl.Texture(7, false) end diff --git a/luarules/gadgets/include/IterableMap.lua b/luarules/gadgets/include/IterableMap.lua index c0dfa15de8e..6be01850d70 100644 --- a/luarules/gadgets/include/IterableMap.lua +++ b/luarules/gadgets/include/IterableMap.lua @@ -112,7 +112,7 @@ end -- of iteration. function IterableMap.Iterator(self) local i = 0 - return function () + return function() i = i + 1 if i <= self.indexMax then local key = self.keyByIndex[i] diff --git a/luarules/gadgets/include/LuaShader.lua b/luarules/gadgets/include/LuaShader.lua index 9ff4a67fe7c..a8c3c6d133d 100644 --- a/luarules/gadgets/include/LuaShader.lua +++ b/luarules/gadgets/include/LuaShader.lua @@ -1,12 +1,10 @@ - if not LuaShaderNewLocationMessageShown then local dest = widget or gadget local info = dest and dest.GetInfo() - local name = info and info.name or 'unknown' + local name = info and info.name or "unknown" local msg = "A user widget (" .. name .. ") is including LuaRules/Gadgets/Include/LuaShader.lua directly, please change it to use gl.LuaShader instead." - Spring.Log('UserWidget', LOG.DEPRECATED, msg) + Spring.Log("UserWidget", LOG.DEPRECATED, msg) LuaShaderNewLocationMessageShown = true end return gl.LuaShader - diff --git a/luarules/gadgets/include/SpawnerEnemyLib.lua b/luarules/gadgets/include/SpawnerEnemyLib.lua index 1f245cfd23c..60d2d55a12d 100644 --- a/luarules/gadgets/include/SpawnerEnemyLib.lua +++ b/luarules/gadgets/include/SpawnerEnemyLib.lua @@ -6,13 +6,12 @@ local adjustSide = function(sideMin, sideMax, mapSize, spread) return sideMin, sideMax end - local incrementBy = math.ceil((spread - sideSize)/2) + local incrementBy = math.ceil((spread - sideSize) / 2) sideMin = sideMin - incrementBy sideMax = sideMax + incrementBy sideMin = math.max(sideMin, 0) sideMax = math.min(sideMax, mapSize) return sideMin, sideMax - end local adjustStartBox = function(startBoxXMin, startBoxZMin, startBoxXMax, startBoxZMax, spread) diff --git a/luarules/gadgets/include/startbox_utilities.lua b/luarules/gadgets/include/startbox_utilities.lua index e4475e3b79f..e2743057b38 100644 --- a/luarules/gadgets/include/startbox_utilities.lua +++ b/luarules/gadgets/include/startbox_utilities.lua @@ -14,26 +14,26 @@ local SplineLib = VFS.Include("common/lib_spline.lua") local base64 = VFS.Include("common/luaUtilities/base64.lua") local function GetStartboxName(midX, midZ) - if (midX < 0.33) then - if (midZ < 0.33) then + if midX < 0.33 then + if midZ < 0.33 then return "North-West", "NW" - elseif (midZ > 0.66) then + elseif midZ > 0.66 then return "South-West", "SW" else return "West", "W" end - elseif (midX > 0.66) then - if (midZ < 0.33) then + elseif midX > 0.66 then + if midZ < 0.33 then return "North-East", "NE" - elseif (midZ > 0.66) then + elseif midZ > 0.66 then return "South-East", "SE" else return "East", "E" end else - if (midZ < 0.33) then + if midZ < 0.33 then return "North", "N" - elseif (midZ > 0.66) then + elseif midZ > 0.66 then return "South", "S" else return "Center", "Center" @@ -90,13 +90,17 @@ local function matchOverride(override, numTeams) end local function matchSetExact(set, numTeams) - if not set then return nil end + if not set then + return nil + end return set[tostring(numTeams)] end local function matchSetLarger(set, numTeams) - if not set then return nil end + if not set then + return nil + end local bestKey, bestNum for k in pairs(set) do @@ -111,7 +115,9 @@ local function matchSetLarger(set, numTeams) end local function matchSetSmaller(set, numTeams) - if not set then return nil end + if not set then + return nil + end local bestKey, bestNum for k in pairs(set) do @@ -127,16 +133,24 @@ end local function resolveArrangement(override, set, numTeams) local match = matchOverride(override, numTeams) - if match then return match, "modoption_override" end + if match then + return match, "modoption_override" + end match = matchSetExact(set, numTeams) - if match then return match, "modoption_set" end + if match then + return match, "modoption_set" + end match = matchSetLarger(set, numTeams) - if match then return match, "modoption_set" end + if match then + return match, "modoption_set" + end match = matchSetSmaller(set, numTeams) - if match then return match, "modoption_set" end + if match then + return match, "modoption_set" + end -- No modoption arrangement applies; defer to the engine startrect. return nil, nil @@ -217,24 +231,24 @@ local function buildFallback() if mapSizeZ > mapSizeX then return { [0] = { - boxes = {{ - {0, 0}, - {0, mapSizeZ * 0.2}, - {mapSizeX, mapSizeZ * 0.2}, - {mapSizeX, 0}, - }}, - startpoints = {{ mapSizeX * 0.5, mapSizeZ * 0.1 }}, + boxes = { { + { 0, 0 }, + { 0, mapSizeZ * 0.2 }, + { mapSizeX, mapSizeZ * 0.2 }, + { mapSizeX, 0 }, + } }, + startpoints = { { mapSizeX * 0.5, mapSizeZ * 0.1 } }, nameLong = "North", nameShort = "N", }, [1] = { - boxes = {{ - {0, mapSizeZ * 0.8}, - {0, mapSizeZ}, - {mapSizeX, mapSizeZ}, - {mapSizeX, mapSizeZ * 0.8}, - }}, - startpoints = {{ mapSizeX * 0.5, mapSizeZ * 0.9 }}, + boxes = { { + { 0, mapSizeZ * 0.8 }, + { 0, mapSizeZ }, + { mapSizeX, mapSizeZ }, + { mapSizeX, mapSizeZ * 0.8 }, + } }, + startpoints = { { mapSizeX * 0.5, mapSizeZ * 0.9 } }, nameLong = "South", nameShort = "S", }, @@ -243,24 +257,24 @@ local function buildFallback() return { [0] = { - boxes = {{ - {0, 0}, - {0, mapSizeZ}, - {mapSizeX * 0.2, mapSizeZ}, - {mapSizeX * 0.2, 0}, - }}, - startpoints = {{ mapSizeX * 0.1, mapSizeZ * 0.5 }}, + boxes = { { + { 0, 0 }, + { 0, mapSizeZ }, + { mapSizeX * 0.2, mapSizeZ }, + { mapSizeX * 0.2, 0 }, + } }, + startpoints = { { mapSizeX * 0.1, mapSizeZ * 0.5 } }, nameLong = "West", nameShort = "W", }, [1] = { - boxes = {{ - {mapSizeX * 0.8, 0}, - {mapSizeX * 0.8, mapSizeZ - 1}, - {mapSizeX, mapSizeZ - 1}, - {mapSizeX, 0}, - }}, - startpoints = {{ mapSizeX * 0.9, mapSizeZ * 0.5 }}, + boxes = { { + { mapSizeX * 0.8, 0 }, + { mapSizeX * 0.8, mapSizeZ - 1 }, + { mapSizeX, mapSizeZ - 1 }, + { mapSizeX, 0 }, + } }, + startpoints = { { mapSizeX * 0.9, mapSizeZ * 0.5 } }, nameLong = "East", nameShort = "E", }, diff --git a/luarules/gadgets/luamem_broadcast.lua b/luarules/gadgets/luamem_broadcast.lua index 07414a8fc34..6de06e24f88 100644 --- a/luarules/gadgets/luamem_broadcast.lua +++ b/luarules/gadgets/luamem_broadcast.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Lua mem Broadcast", - desc = "Broadcasts Lua mem usage", - author = "Floris", - date = "June 2026", + name = "Lua mem Broadcast", + desc = "Broadcasts Lua mem usage", + author = "Floris", + date = "June 2026", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end @@ -22,7 +22,6 @@ local sendPacketEvery = 10 -- synced -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationLuaMem = validation @@ -30,7 +29,7 @@ if gadgetHandler:IsSyncedCode() then local vb1, vb2 = string.byte(validation, 1, 2) function gadget:RecvLuaMsg(msg, playerID) - if #msg >= 3 and string.byte(msg,1)==pct_b and string.byte(msg,2)==vb1 and string.byte(msg,3)==vb2 then + if #msg >= 3 and string.byte(msg, 1) == pct_b and string.byte(msg, 2) == vb1 and string.byte(msg, 3) == vb2 then local um = tonumber(msg:sub(4)) if um then SendToUnsynced("luamemBroadcast", playerID, um) @@ -38,7 +37,6 @@ if gadgetHandler:IsSyncedCode() then end end end - else -------------------------------------------------------------------------------- -- unsynced @@ -68,11 +66,10 @@ else updateTimer = updateTimer + GetLastUpdateSeconds() if updateTimer > sendPacketEvery then local _, _, _, _, um = GetLuaMemUsage() - if type(um) == 'number' then + if type(um) == "number" then SendLuaRulesMsg("%" .. validation .. math.ceil(um / 1024)) updateTimer = 0 end end end - end diff --git a/luarules/gadgets/map_atmosphere_cegs.lua b/luarules/gadgets/map_atmosphere_cegs.lua index e611c87cf5f..bf3b39619df 100644 --- a/luarules/gadgets/map_atmosphere_cegs.lua +++ b/luarules/gadgets/map_atmosphere_cegs.lua @@ -1,4 +1,3 @@ - if not Spring.GetModOptions().map_atmosphere then return end @@ -26,25 +25,23 @@ local enableGenericConfig = Spring.GetModOptions().mapatmospherics or "enabled" local currentMapname = Game.mapName:lower() local mapList = VFS.DirList("luarules/configs/Atmosphereconfigs/", "*.lua") -Spring.Echo("[ATMOSPHERIC] Current map: "..currentMapname) -local mapFileName = '' -- (Include at bottom of this file) -for i = 1,#mapList+1 do - if i == #mapList+1 then +Spring.Echo("[ATMOSPHERIC] Current map: " .. currentMapname) +local mapFileName = "" -- (Include at bottom of this file) +for i = 1, #mapList + 1 do + if i == #mapList + 1 then Spring.Echo("[ATMOSPHERIC] No map config found. Turning off the gadget") return end - mapFileName = string.sub(mapList[i], 36, string.len(mapList[i])-4):lower() + mapFileName = string.sub(mapList[i], 36, string.len(mapList[i]) - 4):lower() if string.find(currentMapname, mapFileName) then - Spring.Echo("[ATMOSPHERIC] Success! Map names match!: " ..mapFileName) + Spring.Echo("[ATMOSPHERIC] Success! Map names match!: " .. mapFileName) break else --Spring.Echo("[ATMOSPHERIC] Map names don't match: " ..mapFileName) end end - if not gadgetHandler:IsSyncedCode() then - --[[ Spring.SetSunLighting({ groundAmbientColor = { transitionred * gar, transitiongreen * gag, transitionblue * gab } }) Spring.SetSunLighting({ unitAmbientColor = { transitionred * uar, transitiongreen * uag, transitionblue * uab } }) @@ -59,45 +56,51 @@ if not gadgetHandler:IsSyncedCode() then Spring.SetAtmosphere({ fogColor = { transitionred * fogcr, transitiongreen * fogcg, transitionblue * fogcb } }) Spring.SetSunLighting({ groundShadowDensity = transition * shadowdensity, modelShadowDensity = transition * shadowdensity }) - ]]-- + ]] + -- - - local function GetLightingAndAtmosphere() -- returns a table of the common parameters - local res = { + local function GetLightingAndAtmosphere() -- returns a table of the common parameters + local res = { lighting = { - groundAmbientColor = {gl.GetSun("ambient")}, - groundDiffuseColor = {gl.GetSun("diffuse")}, - groundSpecularColor = {gl.GetSun("specular")}, + groundAmbientColor = { gl.GetSun("ambient") }, + groundDiffuseColor = { gl.GetSun("diffuse") }, + groundSpecularColor = { gl.GetSun("specular") }, - unitAmbientColor = {gl.GetSun("ambient","unit")}, - unitDiffuseColor = {gl.GetSun("diffuse","unit")}, - unitSpecularColor = {gl.GetSun("specular","unit")}, + unitAmbientColor = { gl.GetSun("ambient", "unit") }, + unitDiffuseColor = { gl.GetSun("diffuse", "unit") }, + unitSpecularColor = { gl.GetSun("specular", "unit") }, groundShadowDensity = gl.GetSun("shadowDensity"), - modelShadowDensity = gl.GetSun("shadowDensity","unit"), + modelShadowDensity = gl.GetSun("shadowDensity", "unit"), }, atmosphere = { - skyColor = {gl.GetAtmosphere("skyColor")}, - sunColor = {gl.GetAtmosphere("sunColor")}, - cloudColor = {gl.GetAtmosphere("cloudColor")}, - fogColor = {gl.GetAtmosphere("fogColor")}, - fogColor = {gl.GetAtmosphere("fogColor")}, + skyColor = { gl.GetAtmosphere("skyColor") }, + sunColor = { gl.GetAtmosphere("sunColor") }, + cloudColor = { gl.GetAtmosphere("cloudColor") }, + fogColor = { gl.GetAtmosphere("fogColor") }, + fogColor = { gl.GetAtmosphere("fogColor") }, fogStart = gl.GetAtmosphere("fogStart"), fogEnd = gl.GetAtmosphere("fogEnd"), }, - sunDir = {gl.GetSun("pos")}, + sunDir = { gl.GetSun("pos") }, } return res end local function SetLightingAndAtmosphere(lightandatmos) - if lightandatmos.atmosphere then Spring.SetAtmosphere(lightandatmos.atmosphere) end - if lightandatmos.lighting then Spring.SetSunLighting(lightandatmos.lighting) end - if lightandatmos.sunDir then Spring.SetSunDirection(lightandatmos.sunDir[1], lightandatmos.sunDir[2], lightandatmos.sunDir[3] ) end + if lightandatmos.atmosphere then + Spring.SetAtmosphere(lightandatmos.atmosphere) + end + if lightandatmos.lighting then + Spring.SetSunLighting(lightandatmos.lighting) + end + if lightandatmos.sunDir then + Spring.SetSunDirection(lightandatmos.sunDir[1], lightandatmos.sunDir[2], lightandatmos.sunDir[3]) + end end - local atmosphere_lighting = {"atmosphere","lighting"} + local atmosphere_lighting = { "atmosphere", "lighting" } local atan2 = math.atan2 local diag = math.diag local mix = math.mix @@ -105,16 +108,19 @@ if not gadgetHandler:IsSyncedCode() then local cos = math.cos -- Mix everything specified in A into B, if not specified in B, then replace with A local function MixLightingAndAtmosphere(a, b, mixfactor, target) - if target == nil then target = b end - for _,k in ipairs(atmosphere_lighting) do + if target == nil then + target = b + end + for _, k in ipairs(atmosphere_lighting) do if a[k] and b[k] then local aa = a[k] local bb = b[k] for ka, va in pairs(aa) do - if bb[ka] == nil then target[ka] = aa[ka] + if bb[ka] == nil then + target[ka] = aa[ka] else - if type(va) == 'table' then - for i=1,#va do + if type(va) == "table" then + for i = 1, #va do --Spring.Echo(k, ka, i, aa[ka][i],bb[ka][i], mixfactor ) target[k][ka][i] = mix(aa[ka][i], bb[ka][i], mixfactor) end @@ -125,14 +131,14 @@ if not gadgetHandler:IsSyncedCode() then end end end - if a['sunDir'] and b['sunDir'] then - local asun = a['sunDir'] - local bsun = b['sunDir'] + if a["sunDir"] and b["sunDir"] then + local asun = a["sunDir"] + local bsun = b["sunDir"] local alength = 1.0 / diag(asun[1], asun[2], asun[3]) local blength = 1.0 / diag(bsun[1], bsun[2], bsun[3]) - local aworldrot = atan2(asun[1]*alength, asun[3]*alength) --https://en.wikipedia.org/wiki/Atan2 - local bworldrot = atan2(bsun[1]*blength, bsun[3]*blength) + local aworldrot = atan2(asun[1] * alength, asun[3] * alength) --https://en.wikipedia.org/wiki/Atan2 + local bworldrot = atan2(bsun[1] * blength, bsun[3] * blength) --Spring.Echo(("Arot = %.2f, Brot = %.2f"):format(aworldrot, bworldrot)) @@ -145,18 +151,19 @@ if not gadgetHandler:IsSyncedCode() then bworldrot = bworldrot - 2 * math.pi end - local aheight = atan2(asun[2]*alength, diag(asun[1]*alength, asun[3]*alength)) - local bheight = atan2(bsun[2]*blength, diag(bsun[1]*blength, bsun[3]*blength)) + local aheight = atan2(asun[2] * alength, diag(asun[1] * alength, asun[3] * alength)) + local bheight = atan2(bsun[2] * blength, diag(bsun[1] * blength, bsun[3] * blength)) local targetrot = mix(aworldrot, bworldrot, mixfactor) local targetheight = mix(aheight, bheight, mixfactor) - if target['sunDir'] == nil then target['sunDir'] = {0,1,0} end - target['sunDir'][1] = sin(targetrot) * cos(targetheight) - target['sunDir'][2] = sin(targetheight) - target['sunDir'][3] = cos(targetrot) * cos(targetheight) + if target["sunDir"] == nil then + target["sunDir"] = { 0, 1, 0 } + end + target["sunDir"][1] = sin(targetrot) * cos(targetheight) + target["sunDir"][2] = sin(targetheight) + target["sunDir"][3] = cos(targetrot) * cos(targetheight) --Spring.Echo("sunDir", mixfactor, "targetrot",targetrot, "targetheight", targetheight, aworldrot , bworldrot) - end end @@ -167,7 +174,9 @@ if not gadgetHandler:IsSyncedCode() then local mixedlight function gadget:GameFrame(n) - if true then return end + if true then + return + end if initlight == nil then --Spring.Echo("Loaded Sun Conf for: " .. Game.mapName) initlight = GetLightingAndAtmosphere() @@ -176,11 +185,11 @@ if not gadgetHandler:IsSyncedCode() then endlight.sunDir[1] = -1 * endlight.sunDir[1] --endlight.sunDir[2] = 0.3 * endlight.sunDir[2] endlight.sunDir[3] = -1 * endlight.sunDir[3] - local nightfactor = {0.3, 0.3, 0.45, 1.0} - for _,k in ipairs(atmosphere_lighting) do + local nightfactor = { 0.3, 0.3, 0.45, 1.0 } + for _, k in ipairs(atmosphere_lighting) do for k2, v2 in pairs(endlight[k]) do if string.find(k2, "Color", nil, true) then - for i =1, #v2 do + for i = 1, #v2 do endlight[k][k2][i] = endlight[k][k2][i] * nightfactor[i] end end @@ -191,18 +200,17 @@ if not gadgetHandler:IsSyncedCode() then local tstart = 60 if n > tstart then - local tfloor = math.floor((n-tstart)/dt) - local mixfac = ((n-tstart) % dt) / dt + local tfloor = math.floor((n - tstart) / dt) + local mixfac = ((n - tstart) % dt) / dt --mixfac = math.smoothstep(0,1,mixfac); --Spring.Echo(n,mixfac) - if tfloor % 2 ==0 then + if tfloor % 2 == 0 then MixLightingAndAtmosphere(initlight, endlight, mixfac, mixedlight) else MixLightingAndAtmosphere(endlight, initlight, mixfac, mixedlight) end SetLightingAndAtmosphere(mixedlight) end - end local gar, gag, gab = gl.GetSun("ambient") @@ -291,7 +299,6 @@ if not gadgetHandler:IsSyncedCode() then if sundir then -- try to calculate an 'orbit', while attempting to local origworldrot = math.atan2(sundirx, sundirz) local origheight = math.atan2(sundirx, sundiry) - end Spring.SetSunLighting({ groundAmbientColor = { transitionred * gar, transitiongreen * gag, transitionblue * gab } }) @@ -337,7 +344,7 @@ if not gadgetHandler:IsSyncedCode() then function gadget:TextCommand(msg) if string.sub(msg, 1, 18) == "atmosplaysoundfile" then - Spring.PlaySoundFile(string.sub(msg, 20), 0.85, 'ui') + Spring.PlaySoundFile(string.sub(msg, 20), 0.85, "ui") end end @@ -357,8 +364,6 @@ if not gadgetHandler:IsSyncedCode() then gadgetHandler:RemoveSyncAction("MixLightingAndAtmosphere") SetLightingAndAtmosphere(initial_atmosphere_lighting) end - - else -- SYNCED @@ -370,7 +375,6 @@ else local spSpawnCEG = Spring.SpawnCEG local spGetGroundHeight = Spring.GetGroundHeight - function AtmosSendMessage(_, msg) if Script.LuaUI("GadgetAddMessage") then Script.LuaUI.GadgetAddMessage(msg) @@ -384,7 +388,7 @@ else function SpawnCEGInPosition(cegname, posx, posy, posz, damage, paralyzetime, damageradius, sound, soundvolume) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -417,7 +421,7 @@ else local posy = spGetGroundHeight(posx, posz) + (groundOffset or 0) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -451,7 +455,7 @@ else local posz = midposz + math_random(-radius, radius) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -486,7 +490,7 @@ else local posy = spGetGroundHeight(posx, posz) + (groundOffset or 0) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -521,7 +525,7 @@ else local posy = spGetGroundHeight(posx, posz) + (groundOffset or 0) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -551,7 +555,7 @@ else end function SpawnCEGInRandomMapPosAvoidUnits(cegname, groundOffset, radius, sound, soundvolume) - for y = 1,50 do + for y = 1, 50 do local posx = math_random(0, mapsizeX) local posz = math_random(0, mapsizeZ) local posy = spGetGroundHeight(posx, posz) + (groundOffset or 0) @@ -559,7 +563,7 @@ else if #units == 0 then spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end break end @@ -575,7 +579,7 @@ else if groundposy <= spawnOnlyBelowY then spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end break end @@ -614,7 +618,7 @@ else local posz = math_random(0, mapsizeZ) spSpawnCEG(cegname, posx, posy, posz) if sound then - Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, 'sfx') + Spring.PlaySoundFile(sound, soundvolume, posx, posy, posz, "sfx") end if damage or paralyzetime then local units = Spring.GetUnitsInCylinder(posx, posz, damageradius) @@ -645,5 +649,3 @@ else VFS.Include("luarules/configs/Atmosphereconfigs/" .. mapFileName .. ".lua") end - - diff --git a/luarules/gadgets/map_explosion_deformation_fix.lua b/luarules/gadgets/map_explosion_deformation_fix.lua index b3dc8cc33fc..6cb9aa0b022 100644 --- a/luarules/gadgets/map_explosion_deformation_fix.lua +++ b/luarules/gadgets/map_explosion_deformation_fix.lua @@ -13,7 +13,7 @@ function gadget:GetInfo() end if not gadgetHandler:IsSyncedCode() then - return + return end function gadget:UnitCreated(unitID, unitDefID) diff --git a/luarules/gadgets/map_geofix.lua b/luarules/gadgets/map_geofix.lua index 685c0d4351a..7ff9fa59b2b 100644 --- a/luarules/gadgets/map_geofix.lua +++ b/luarules/gadgets/map_geofix.lua @@ -14,7 +14,6 @@ function gadget:GetInfo() end if gadgetHandler:IsSyncedCode() then - function gadget:GameFrame(gf) local geoFeatureDefs = {} for defID, def in pairs(FeatureDefs) do @@ -31,5 +30,4 @@ if gadgetHandler:IsSyncedCode() then end gadgetHandler:RemoveGadget(self) end - end diff --git a/luarules/gadgets/map_lava.lua b/luarules/gadgets/map_lava.lua index d9fceb21ee8..8e01ee2f989 100644 --- a/luarules/gadgets/map_lava.lua +++ b/luarules/gadgets/map_lava.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Map Lava Gadget 2.5", - desc = "lava", - author = "knorke, Beherith, The_Yak, Anarchid, Kloot, Gajop, ivand, Damgam, Chronographer", - date = "Feb 2011, Nov 2013, 2022!", - license = "GNU GPL v2", - layer = -3, - enabled = true + name = "Map Lava Gadget 2.5", + desc = "lava", + author = "knorke, Beherith, The_Yak, Anarchid, Kloot, Gajop, ivand, Damgam, Chronographer", + date = "Feb 2011, Nov 2013, 2022!", + license = "GNU GPL v2", + layer = -3, + enabled = true, } end @@ -20,7 +20,6 @@ local gameSpeed = Game.gameSpeed --_G.Game.mapSizeY = Game.mapSizeY if gadgetHandler:IsSyncedCode() then - local tideIndex = 1 local tideContinueFrame = 0 local gameframe = 0 @@ -95,12 +94,12 @@ if gadgetHandler:IsSyncedCode() then end end - local function addTideRhythm (targetLevel, speed, remainTime) + local function addTideRhythm(targetLevel, speed, remainTime) local newTide = {} newTide.targetLevel = targetLevel newTide.speed = speed newTide.remainTime = remainTime - table.insert (tideRhythm, newTide) + table.insert(tideRhythm, newTide) end for _, rhythm in ipairs(lava.tideRhythm) do @@ -108,9 +107,8 @@ if gadgetHandler:IsSyncedCode() then end function updateLava() - if (lavaGrow < 0 and lavaLevel < tideRhythm[tideIndex].targetLevel) - or (lavaGrow > 0 and lavaLevel > tideRhythm[tideIndex].targetLevel) then - tideContinueFrame = gameframe + math.round(tideRhythm[tideIndex].remainTime*gameSpeed) + if (lavaGrow < 0 and lavaLevel < tideRhythm[tideIndex].targetLevel) or (lavaGrow > 0 and lavaLevel > tideRhythm[tideIndex].targetLevel) then + tideContinueFrame = gameframe + math.round(tideRhythm[tideIndex].remainTime * gameSpeed) lavaGrow = 0 --Spring.Echo ("Next LAVA LEVEL change in " .. (tideContinueFrame-gameframe)/30 .. " seconds") end @@ -131,7 +129,9 @@ if gadgetHandler:IsSyncedCode() then end function updateSlow(unitID, unitDefID, unitSlow) - if spMoveCtrlEnabled(unitID) then return false end + if spMoveCtrlEnabled(unitID) then + return false + end local baseSpeed = speedDefs[unitDefID] local baseTurnRate = turnDefs[unitDefID] local baseAccRate = accDefs[unitDefID] @@ -142,7 +142,7 @@ if gadgetHandler:IsSyncedCode() then local slowedTurnRate = baseTurnRate * unitSlow local slowedAccRate = baseAccRate * unitSlow local sucess = pcall(function() - spSetMoveData(unitID, {maxSpeed = slowedMaxSpeed, turnRate = slowedTurnRate, accRate = slowedAccRate}) + spSetMoveData(unitID, { maxSpeed = slowedMaxSpeed, turnRate = slowedTurnRate, accRate = slowedAccRate }) end) return sucess end @@ -171,7 +171,7 @@ if gadgetHandler:IsSyncedCode() then if not speedDefs[unitDefID] or not turnDefs[unitDefID] or not accDefs[unitDefID] or not unitHeight[unitDefID] then data.slowed = false else - local unitSlow = clamp(1-(((lavaLevel-y) / unitHeight[unitDefID])*lavaSlow), 1-lavaSlow, .9) + local unitSlow = clamp(1 - (((lavaLevel - y) / unitHeight[unitDefID]) * lavaSlow), 1 - lavaSlow, 0.9) if unitSlow ~= data.currentSlow then local sucess = updateSlow(unitID, unitDefID, unitSlow) if sucess then @@ -181,7 +181,7 @@ if gadgetHandler:IsSyncedCode() then end end spAddUnitDamage(unitID, lavaDamage, nil, nil) - spSpawnCEG(lavaEffectDamage, x, y+5, z) + spSpawnCEG(lavaEffectDamage, x, y + 5, z) else -- unit exited lava if data.slowed then updateSlow(unitID, unitDefID, 1) @@ -202,25 +202,25 @@ if gadgetHandler:IsSyncedCode() then -- skip decoration units elseif canFly[unitDefID] then if lavaDamageAirUnits then - local x,y,z = spGetUnitBasePosition(unitID) + local x, y, z = spGetUnitBasePosition(unitID) if y and y < lavaLevel then spAddUnitDamage(unitID, lavaDamage, nil, nil) - spSpawnCEG(lavaEffectDamage, x, y+5, z) + spSpawnCEG(lavaEffectDamage, x, y + 5, z) end end else - local x,y,z = spGetUnitBasePosition(unitID) + local x, y, z = spGetUnitBasePosition(unitID) if y and y < lavaLevel then - local unitSlow = clamp(1-(((lavaLevel-y) / unitHeight[unitDefID])*lavaSlow) , 1-lavaSlow , .9) + local unitSlow = clamp(1 - (((lavaLevel - y) / unitHeight[unitDefID]) * lavaSlow), 1 - lavaSlow, 0.9) if not lavaUnits[unitID] then -- first entry into lava local moveType = spGetMoveData(unitID).name local maxSpeed = speedDefs[unitDefID] local turnRate = turnDefs[unitDefID] local accelRate = accDefs[unitDefID] - if (moveType == "ground") and (maxSpeed and maxSpeed ~= 0) and (turnRate and turnRate ~= 0) and (accelRate and accelRate ~= 0)then - lavaUnits[unitID] = {currentSlow = 1, slowed = true} + if (moveType == "ground") and (maxSpeed and maxSpeed ~= 0) and (turnRate and turnRate ~= 0) and (accelRate and accelRate ~= 0) then + lavaUnits[unitID] = { currentSlow = 1, slowed = true } else - lavaUnits[unitID] = {slowed = false} + lavaUnits[unitID] = { slowed = false } end end if lavaUnits[unitID].slowed and (unitSlow ~= lavaUnits[unitID].currentSlow) then @@ -229,8 +229,8 @@ if gadgetHandler:IsSyncedCode() then lavaUnits[unitID].currentSlow = unitSlow end end - spAddUnitDamage(unitID, lavaDamage, nil, nil) - spSpawnCEG(lavaEffectDamage, x, y+5, z) + spAddUnitDamage(unitID, lavaDamage, nil, nil) + spSpawnCEG(lavaEffectDamage, x, y + 5, z) elseif lavaUnits[unitID] then -- unit exited lava if lavaUnits[unitID].slowed then updateSlow(unitID, unitDefID, 1) @@ -244,10 +244,10 @@ if gadgetHandler:IsSyncedCode() then local FeatureDefID = spGetFeatureDefID(featureID) -- always damage non-metal features (trees, foliage); metal features only if lavaDamageFeatures is set if not geoThermal[FeatureDefID] and (lavaDamageFeatures or not featureHasMetal[FeatureDefID]) then - x,y,z = spGetFeaturePosition(featureID) - if (y and y < lavaLevel) then + x, y, z = spGetFeaturePosition(featureID) + if y and y < lavaLevel then spAddFeatureDamage(featureID, lavaDamage, nil, nil) - spSpawnCEG(lavaEffectDamage, x, y+5, z) + spSpawnCEG(lavaEffectDamage, x, y + 5, z) end end end @@ -266,7 +266,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:GameFrame(f) gameframe = f - _G.lavaLevel = lavaLevel+math.sin(f/gameSpeed)*0.5 + _G.lavaLevel = lavaLevel + math.sin(f / gameSpeed) * 0.5 --_G.lavaLevel = lavaLevel + clamp(math.sin(f / 30), -0.95, 0.95) * 0.5 -- clamp to avoid jittering when sin(x) is around +-1 -- Periodically refresh cached min ground height (handles terraforming) @@ -292,7 +292,7 @@ if gadgetHandler:IsSyncedCode() then end updateLava() - lavaLevel = lavaLevel+(lavaGrow/gameSpeed) + lavaLevel = lavaLevel + (lavaGrow / gameSpeed) Spring.SetGameRulesParam("lavaLevel", lavaLevel) -- burst and sound effects (skip entirely when lava is below the map surface) @@ -306,28 +306,28 @@ if gadgetHandler:IsSyncedCode() then local y = spGetGroundHeight(x, z) if y < lavaLevel then - spSpawnCEG(lavaEffectBurst, x, lavaLevel+5, z) + spSpawnCEG(lavaEffectBurst, x, lavaLevel + 5, z) local lavaEffectBurstSounds = lava.effectBurstSounds if lavaEffectBurstSounds and #lavaEffectBurstSounds > 0 then local soundIndex = random(1, #lavaEffectBurstSounds) local sound = lavaEffectBurstSounds[soundIndex] - Spring.PlaySoundFile(sound[1], random(sound[2], sound[3])/100, x, y, z, 'sfx') + Spring.PlaySoundFile(sound[1], random(sound[2], sound[3]) / 100, x, y, z, "sfx") end end end -- ambient sounds local lavaAmbientSounds = lava.ambientSounds if lavaAmbientSounds and #lavaAmbientSounds > 0 then - for i = 1,10 do + for i = 1, 10 do if random(1, 3) == 1 then local x = random(1, mapSizeX) local z = random(1, mapSizeY) - local y = spGetGroundHeight(x,z) + local y = spGetGroundHeight(x, z) if y < lavaLevel then local soundIndex = random(1, #lavaAmbientSounds) local sound = lavaAmbientSounds[soundIndex] - Spring.PlaySoundFile(sound[1], random(sound[2], sound[3])/100, x, y, z, 'sfx') + Spring.PlaySoundFile(sound[1], random(sound[2], sound[3]) / 100, x, y, z, "sfx") break end end @@ -335,18 +335,18 @@ if gadgetHandler:IsSyncedCode() then end end - -- new to use notif system - -- if lavaGrow then - -- if lavaGrow > 0 and not lavaNotificationPlayed then - -- lavaNotificationPlayed = true - -- LavaGrowsNotificationHere - -- elseif lavaGrow < 0 and not lavaNotificationPlayed then - -- lavaNotificationPlayed = true - -- LavaFallsNotificationHere - -- elseif lavaGrow == 0 and lavaNotificationPlayed then - -- lavaNotificationPlayed = false - -- end - -- end + -- new to use notif system + -- if lavaGrow then + -- if lavaGrow > 0 and not lavaNotificationPlayed then + -- lavaNotificationPlayed = true + -- LavaGrowsNotificationHere + -- elseif lavaGrow < 0 and not lavaNotificationPlayed then + -- lavaNotificationPlayed = true + -- LavaFallsNotificationHere + -- elseif lavaGrow == 0 and lavaNotificationPlayed then + -- lavaNotificationPlayed = false + -- end + -- end -- old lava rise/drop echos -- if lavaGrow and lavaGrow > 0 then @@ -360,8 +360,8 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID) if weaponDefID ~= DAMAGE_EXTSOURCE_WATER then - -- not water damage, do not modify - return damage, 1.0 + -- not water damage, do not modify + return damage, 1.0 end local moveDef = unitMoveDef[unitDefID] if moveDef == nil or moveDef.family ~= "hover" then -- Out of date use of family to be removed post GDT discussion @@ -374,10 +374,8 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) lavaUnits[unitID] = nil end - -else -- UNSYCNED - - local texturesamplingmode = '' -- ':l:' causes MASSIVE load on zoom out and downsampling textures! +else -- UNSYCNED + local texturesamplingmode = "" -- ':l:' causes MASSIVE load on zoom out and downsampling textures! local lavaDiffuseEmit = texturesamplingmode .. lava.diffuseEmitTex -- pack emissiveness into alpha channel (this is also used as heat for distortion) local lavaNormalHeight = texturesamplingmode .. lava.normalHeightTex -- pack height into normals alpha local lavaDistortion = texturesamplingmode .. "LuaUI/images/lavadistortion.png" @@ -389,7 +387,7 @@ else -- UNSYCNED local foglightenabled = lava.fogEnabled local fogheightabovelava = lava.fogHeight - local allowDeferredMapRendering = (Spring.GetConfigInt("AllowDeferredMapRendering") == 1) -- map depth buffer is required for the foglight shader pass + local allowDeferredMapRendering = (Spring.GetConfigInt("AllowDeferredMapRendering") == 1) -- map depth buffer is required for the foglight shader pass local tideamplitude = lava.tideAmplitude local tideperiod = lava.tidePeriod @@ -401,7 +399,6 @@ else -- UNSYCNED local elmosPerSquare = 256 -- The resolution of the lava - local autoreload = false -- set to true to reload the shader every time it is edited local LuaShader = gl.LuaShader @@ -409,11 +406,11 @@ else -- UNSYCNED local unifiedShaderConfig = { -- for lavaplane - HEIGHTOFFSET = 2.0, -- how many elmos above the 'actual' lava height we should render, to avoid ROAM clipping artifacts + HEIGHTOFFSET = 2.0, -- how many elmos above the 'actual' lava height we should render, to avoid ROAM clipping artifacts COASTWIDTH = lava.coastWidth, -- how wide the coast of the lava should be WORLDUVSCALE = lava.uvScale, -- How many times to tile the lava texture across the entire map COASTCOLOR = lava.coastColor, -- the color of the lava coast - SPECULAREXPONENT = lava.specularExp, -- the specular exponent of the lava plane + SPECULAREXPONENT = lava.specularExp, -- the specular exponent of the lava plane SPECULARSTRENGTH = 1.0, -- The peak brightness of specular highlights LOSDARKNESS = lava.losDarkness, -- how much to darken the out-of-los areas of the lava plane SHADOWSTRENGTH = lava.shadowStrength, -- how much light a shadowed fragment can recieve @@ -434,10 +431,9 @@ else -- UNSYCNED FOGABOVELAVA = lava.fogAbove, -- the multiplier for how much fog should be above lava fragments, ~0.2 means the lava itself gets hardly any fog, while 2.0 would mean the lava gets a lot of extra fog -- for both: - SWIZZLECOLORS = 'fragColor.rgb = (fragColor.rgb * '..lava.colorCorrection..').rgb;', -- yes you can swap around and weight color channels, right after final color, default is 'rgb' + SWIZZLECOLORS = "fragColor.rgb = (fragColor.rgb * " .. lava.colorCorrection .. ").rgb;", -- yes you can swap around and weight color channels, right after final color, default is 'rgb' } - local lavaVSSrcPath = "shaders/GLSL/lava/lava.vert.glsl" local lavaFSSrcPath = "shaders/GLSL/lava/lava.frag.glsl" local fogLightVSSrcPath = "shaders/GLSL/lava/lava_fog_light.vert.glsl" @@ -459,7 +455,7 @@ else -- UNSYCNED lavaHeight = 1, heatdistortx = 1, heatdistortz = 1, - }, + }, shaderConfig = unifiedShaderConfig, } @@ -476,7 +472,7 @@ else -- UNSYCNED lavaHeight = 1, heatdistortx = 1, heatdistortz = 1, - }, + }, shaderConfig = unifiedShaderConfig, } @@ -491,12 +487,12 @@ else -- UNSYCNED if lavaGrow > 0 and not lavaRisingNotificationPlayed then lavaRisingNotificationPlayed = true if Script.LuaUI("NotificationEvent") then - Script.LuaUI.NotificationEvent("LavaRising "..myPlayerID) + Script.LuaUI.NotificationEvent("LavaRising " .. myPlayerID) end elseif lavaGrow < 0 and not lavaDroppingNotificationPlayed then lavaDroppingNotificationPlayed = true if Script.LuaUI("NotificationEvent") then - Script.LuaUI.NotificationEvent("LavaDropping "..myPlayerID) + Script.LuaUI.NotificationEvent("LavaDropping " .. myPlayerID) end elseif lavaGrow == 0 and (lavaRisingNotificationPlayed or lavaDroppingNotificationPlayed) then lavaRisingNotificationPlayed = false @@ -523,13 +519,12 @@ else -- UNSYCNED -- numverts = 128 * 384 * 384 *2 tris then we will get 280k tris .... local xsquares = 3 * Game.mapSizeX / elmosPerSquare local zsquares = 3 * Game.mapSizeZ / elmosPerSquare - local vertexBuffer, vertexBufferSize = InstanceVBOTable.makePlaneVBO(1, 1, xsquares, zsquares) + local vertexBuffer, vertexBufferSize = InstanceVBOTable.makePlaneVBO(1, 1, xsquares, zsquares) local indexBuffer, indexBufferSize = InstanceVBOTable.makePlaneIndexVBO(xsquares, zsquares) lavaPlaneVAO = gl.GetVAO() lavaPlaneVAO:AttachVertexBuffer(vertexBuffer) lavaPlaneVAO:AttachIndexBuffer(indexBuffer) - lavaShader = LuaShader.CheckShaderUpdates(lavaShaderSourceCache) if not lavaShader then @@ -552,7 +547,7 @@ else -- UNSYCNED local _, gameSpeed, isPaused = Spring.GetGameSpeed() if not isPaused then local camX, camY, camZ = Spring.GetCameraDirection() - local camvlength = math.sqrt(camX*camX + camZ *camZ + 0.01) + local camvlength = math.sqrt(camX * camX + camZ * camZ + 0.01) smoothFPS = 0.9 * smoothFPS + 0.1 * math.max(Spring.GetFPS(), 15) heatdistortx = heatdistortx - camX / (camvlength * smoothFPS) heatdistortz = heatdistortz - camZ / (camvlength * smoothFPS) @@ -570,16 +565,16 @@ else -- UNSYCNED end lavaShader:Activate() - lavaShader:SetUniform("lavaHeight",lavatidelevel) - lavaShader:SetUniform("heatdistortx",heatdistortx) - lavaShader:SetUniform("heatdistortz",heatdistortz) + lavaShader:SetUniform("lavaHeight", lavatidelevel) + lavaShader:SetUniform("heatdistortx", heatdistortx) + lavaShader:SetUniform("heatdistortz", heatdistortz) - gl.Texture(0, "$heightmap")-- Texture file - gl.Texture(1, lavaDiffuseEmit)-- Texture file - gl.Texture(2, lavaNormalHeight)-- Texture file - gl.Texture(3, lavaDistortion)-- Texture file - gl.Texture(4, "$shadow")-- Texture file - gl.Texture(5, "$info")-- Texture file + gl.Texture(0, "$heightmap") -- Texture file + gl.Texture(1, lavaDiffuseEmit) -- Texture file + gl.Texture(2, lavaNormalHeight) -- Texture file + gl.Texture(3, lavaDistortion) -- Texture file + gl.Texture(4, "$shadow") -- Texture file + gl.Texture(5, "$info") -- Texture file gl.DepthTest(GL.LEQUAL) -- dont draw fragments below terrain gl.DepthMask(true) -- actually write to the depth buffer, because otherwise units below lava will fully render over this @@ -590,26 +585,26 @@ else -- UNSYCNED gl.DepthTest(false) gl.DepthMask(false) - gl.Texture(0, false)-- Texture file - gl.Texture(1, false)-- Texture file - gl.Texture(2, false)-- Texture file - gl.Texture(3, false)-- Texture file - gl.Texture(4, false)-- Texture file - gl.Texture(5, false)-- Texture file + gl.Texture(0, false) -- Texture file + gl.Texture(1, false) -- Texture file + gl.Texture(2, false) -- Texture file + gl.Texture(3, false) -- Texture file + gl.Texture(4, false) -- Texture file + gl.Texture(5, false) -- Texture file end end function gadget:DrawWorld() if lavatidelevel and foglightenabled and allowDeferredMapRendering then - --Now to draw the fog light a good 32 elmos above it :) + --Now to draw the fog light a good 32 elmos above it :) foglightShader:Activate() - foglightShader:SetUniform("lavaHeight",lavatidelevel + fogheightabovelava) - foglightShader:SetUniform("heatdistortx",heatdistortx) - foglightShader:SetUniform("heatdistortz",heatdistortz) + foglightShader:SetUniform("lavaHeight", lavatidelevel + fogheightabovelava) + foglightShader:SetUniform("heatdistortx", heatdistortx) + foglightShader:SetUniform("heatdistortz", heatdistortz) - gl.Texture(0, "$map_gbuffer_zvaltex")-- Texture file - gl.Texture(1, "$model_gbuffer_zvaltex")-- Texture file - gl.Texture(2, lavaDistortion)-- Texture file + gl.Texture(0, "$map_gbuffer_zvaltex") -- Texture file + gl.Texture(1, "$model_gbuffer_zvaltex") -- Texture file + gl.Texture(2, lavaDistortion) -- Texture file gl.Blending(GL.SRC_ALPHA, GL.ONE) -- this will additively blend the foglight above everything gl.DepthTest(GL.LEQUAL) -- dont draw fragments below the foglightlevel @@ -621,9 +616,9 @@ else -- UNSYCNED gl.DepthTest(false) gl.DepthMask(false) - gl.Texture(0, false)-- Texture file - gl.Texture(1, false)-- Texture file - gl.Texture(2, false)-- Texture file + gl.Texture(0, false) -- Texture file + gl.Texture(1, false) -- Texture file + gl.Texture(2, false) -- Texture file gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end @@ -632,5 +627,4 @@ else -- UNSYCNED function gadget:Shutdown() Spring.SetDrawWater(true) end - -end--ende unsync +end --ende unsync diff --git a/luarules/gadgets/map_metal_spot_placer.lua b/luarules/gadgets/map_metal_spot_placer.lua index 0551269c078..526321c343a 100644 --- a/luarules/gadgets/map_metal_spot_placer.lua +++ b/luarules/gadgets/map_metal_spot_placer.lua @@ -13,7 +13,7 @@ function gadget:GetInfo() date = "2017", license = "PD", layer = -10, - enabled = true + enabled = true, } end @@ -48,7 +48,6 @@ function gadget:Initialize() end if not hasMetalmap and mapConfig and Spring.GetGameFrame() == 0 then - Spring.Log(gadget:GetInfo().name, LOG.INFO, "Loading map-side lua metal spot configuration...") local spots = mapConfig.spots local metalFactor = 0.43 * 9 / 21 @@ -63,7 +62,6 @@ function gadget:Initialize() -- place metal for spot if px and pz and metal then - --Spring.Echo("metal set for x="..px.." z="..pz.." metal="..metal) xIndex = math.floor(px / METAL_MAP_SQUARE_SIZE) zIndex = math.floor(pz / METAL_MAP_SQUARE_SIZE) diff --git a/luarules/gadgets/map_nightmode.lua b/luarules/gadgets/map_nightmode.lua index fc3785c08f3..db8a80c9534 100644 --- a/luarules/gadgets/map_nightmode.lua +++ b/luarules/gadgets/map_nightmode.lua @@ -16,64 +16,61 @@ end -- A widget (or user command) needs to 'request' a nightlight -- This nightlight should always be prepped from the true lighting (e.g. initial_atmosphere_lighting) -- TODO LIST - -- Maybe fuck with shadowdensity? - -- Needs a callin for widgets on sunchange! - -- Minimap slowly updates only - -- Water Does not update correctly - Ask ivand for some uniforms into bumpwater - -- Spring.SendCommands("luarules updatesun") - check if widget/devshit changed the sun! - -- skybox darkening - +-- Maybe fuck with shadowdensity? +-- Needs a callin for widgets on sunchange! +-- Minimap slowly updates only +-- Water Does not update correctly - Ask ivand for some uniforms into bumpwater +-- Spring.SendCommands("luarules updatesun") - check if widget/devshit changed the sun! +-- skybox darkening + -- Effects needing fixing/info on sunchange - -- Map edge extension - DONE - -- Map Grass - DONE - -- Decals - Fine as is! - -- Features brightness - DONE - -- Creep shader - DONE - -- Lava - -- Fog - -- snow? - -- volclouds - +-- Map edge extension - DONE +-- Map Grass - DONE +-- Decals - Fine as is! +-- Features brightness - DONE +-- Creep shader - DONE +-- Lava +-- Fog +-- snow? +-- volclouds -- Configuration options: - -- Definition of a nightmode is: - --Nightfactor RGBA - --nightsun azimuth altitude - -- since sun is always best behind, this is non trivial - -- Azimuth - defined in radians, and will rotate to the opposite direction of current sun X - -- altitude - defined as a ratio of nightheight/Dayheight (original) - - -- Single triggers - -- Periodic changes to nightmode should be defined as: - -- Nightfactor rgba tuple - -- azimuth -- how much to rotate the sun around, in radians - -- altitude -- how much to increase/decrease sun height relative to original sun height - -- dayDuration - how long the day is, in integer seconds - -- nightDuration -- how long the night is, in seconds - -- transitionDuration -- how long each transition takes - -- Repeats: X times - -- Fromtime : nil for now - -- NO CONFLICTING CONFIGS ALLOWED YET! - -- cant have periodic + single being active at the same time! +-- Definition of a nightmode is: +--Nightfactor RGBA +--nightsun azimuth altitude +-- since sun is always best behind, this is non trivial +-- Azimuth - defined in radians, and will rotate to the opposite direction of current sun X +-- altitude - defined as a ratio of nightheight/Dayheight (original) +-- Single triggers +-- Periodic changes to nightmode should be defined as: +-- Nightfactor rgba tuple +-- azimuth -- how much to rotate the sun around, in radians +-- altitude -- how much to increase/decrease sun height relative to original sun height +-- dayDuration - how long the day is, in integer seconds +-- nightDuration -- how long the night is, in seconds +-- transitionDuration -- how long each transition takes +-- Repeats: X times +-- Fromtime : nil for now +-- NO CONFLICTING CONFIGS ALLOWED YET! +-- cant have periodic + single being active at the same time! local currentMapname = Game.mapName:lower() local mapList = VFS.DirList("luarules/configs/Atmosphereconfigs/", "*.lua") --Spring.Echo("[Map NightMode] Current map: "..currentMapname) -local mapFileName = '' -- (Include at bottom of this file) -for i = 1,#mapList+1 do - if i == #mapList+1 then +local mapFileName = "" -- (Include at bottom of this file) +for i = 1, #mapList + 1 do + if i == #mapList + 1 then --Spring.Echo("[Map NightMode] No map config found. Turning off the gadget") end if string.find(currentMapname, mapFileName) then - mapFileName = string.sub(mapList[i], 36, string.len(mapList[i])-4):lower() + mapFileName = string.sub(mapList[i], 36, string.len(mapList[i]) - 4):lower() --Spring.Echo("[Map NightMode] Success! Map names match!: " ..mapFileName) break end end - if not gadgetHandler:IsSyncedCode() then --[[ Spring.SetSunLighting({ groundAmbientColor = { transitionred * gar, transitiongreen * gag, transitionblue * gab } }) @@ -89,8 +86,8 @@ if not gadgetHandler:IsSyncedCode() then Spring.SetAtmosphere({ fogColor = { transitionred * fogcr, transitiongreen * fogcg, transitionblue * fogcb } }) Spring.SetSunLighting({ groundShadowDensity = transition * shadowdensity, modelShadowDensity = transition * shadowdensity }) - ]]-- - + ]] + -- local function tablecopy(t) local copy = {} @@ -105,47 +102,47 @@ if not gadgetHandler:IsSyncedCode() then end local function EchoSun(l) - local function quicktablestring(t) - local tuple = '' - for _,v2 in ipairs(t) do - tuple = tuple .. string.format('%.3f, ',v2) + local function quicktablestring(t) + local tuple = "" + for _, v2 in ipairs(t) do + tuple = tuple .. string.format("%.3f, ", v2) end return tuple end - - for _,s in ipairs({'lighting','atmosphere'}) do + + for _, s in ipairs({ "lighting", "atmosphere" }) do Spring.Echo(s) - for k,v in pairs(l[s]) do - if type(v) == 'table' then + for k, v in pairs(l[s]) do + if type(v) == "table" then Spring.Echo(string.format(" %s = {%s},", k, quicktablestring(v))) else Spring.Echo(string.format(" %s = %s,", k, tostring(v))) end end end - Spring.Echo('sunDir = '..quicktablestring(l['sunDir'])) + Spring.Echo("sunDir = " .. quicktablestring(l["sunDir"])) end - local function GetLightingAndAtmosphere() -- returns a table of the common parameters - local res = { + local function GetLightingAndAtmosphere() -- returns a table of the common parameters + local res = { lighting = { - groundAmbientColor = {gl.GetSun("ambient")}, - groundDiffuseColor = {gl.GetSun("diffuse")}, - groundSpecularColor = {gl.GetSun("specular")}, - - unitAmbientColor = {gl.GetSun("ambient","unit")}, - unitDiffuseColor = {gl.GetSun("diffuse","unit")}, - unitSpecularColor = {gl.GetSun("specular","unit")}, - + groundAmbientColor = { gl.GetSun("ambient") }, + groundDiffuseColor = { gl.GetSun("diffuse") }, + groundSpecularColor = { gl.GetSun("specular") }, + + unitAmbientColor = { gl.GetSun("ambient", "unit") }, + unitDiffuseColor = { gl.GetSun("diffuse", "unit") }, + unitSpecularColor = { gl.GetSun("specular", "unit") }, + groundShadowDensity = gl.GetSun("shadowDensity"), - modelShadowDensity = gl.GetSun("shadowDensity","unit"), + modelShadowDensity = gl.GetSun("shadowDensity", "unit"), }, atmosphere = { - skyColor = {gl.GetAtmosphere("skyColor")}, - sunColor = {gl.GetAtmosphere("sunColor")}, - cloudColor = {gl.GetAtmosphere("cloudColor")}, - fogColor = {gl.GetAtmosphere("fogColor")}, - fogColor = {gl.GetAtmosphere("fogColor")}, + skyColor = { gl.GetAtmosphere("skyColor") }, + sunColor = { gl.GetAtmosphere("sunColor") }, + cloudColor = { gl.GetAtmosphere("cloudColor") }, + fogColor = { gl.GetAtmosphere("fogColor") }, + fogColor = { gl.GetAtmosphere("fogColor") }, fogStart = gl.GetAtmosphere("fogStart"), fogEnd = gl.GetAtmosphere("fogEnd"), }, @@ -154,46 +151,53 @@ if not gadgetHandler:IsSyncedCode() then diffuseFactor = gl.GetWaterRendering("diffuseFactor"), specularFactor = gl.GetWaterRendering("specularFactor"), }, - sunDir = {gl.GetSun("pos")}, - nightFactor = {red = 1, green = 1, blue = 1, shadow = 1, altitude = 1}, + sunDir = { gl.GetSun("pos") }, + nightFactor = { red = 1, green = 1, blue = 1, shadow = 1, altitude = 1 }, } return res - end - - local currentNightFactor = {red = 1, green = 1, blue = 1, shadow = 1, altitude = 1} - GG['NightFactor'] = currentNightFactor - - + end + + local currentNightFactor = { red = 1, green = 1, blue = 1, shadow = 1, altitude = 1 } + GG["NightFactor"] = currentNightFactor + local function SetLightingAndAtmosphere(lightandatmos) - for k,_ in pairs(currentNightFactor) do - GG['NightFactor'][k] = lightandatmos.nightFactor[k] + for k, _ in pairs(currentNightFactor) do + GG["NightFactor"][k] = lightandatmos.nightFactor[k] end - - if Script.LuaUI("NightFactorChanged") then + + if Script.LuaUI("NightFactorChanged") then Script.LuaUI.NightFactorChanged(lightandatmos.nightFactor.red, lightandatmos.nightFactor.green, lightandatmos.nightFactor.blue, lightandatmos.nightFactor.shadow, lightandatmos.nightFactor.altitude) end - + -- This is disabled because these are all #defined params, so they cant be changed without recompiling the bumpwater shader -- The bumpwaterUseUniforms was deprecated in 2022.10 by ivand - --if lightandatmos.water then Spring.SetWaterParams(lightandatmos.water) end - - if lightandatmos.lighting then Spring.SetSunLighting(lightandatmos.lighting) end - if lightandatmos.sunDir then Spring.SetSunDirection(lightandatmos.sunDir[1], lightandatmos.sunDir[2], lightandatmos.sunDir[3] ) end - if lightandatmos.atmosphere then Spring.SetAtmosphere(lightandatmos.atmosphere) end + --if lightandatmos.water then Spring.SetWaterParams(lightandatmos.water) end + + if lightandatmos.lighting then + Spring.SetSunLighting(lightandatmos.lighting) + end + if lightandatmos.sunDir then + Spring.SetSunDirection(lightandatmos.sunDir[1], lightandatmos.sunDir[2], lightandatmos.sunDir[3]) + end + if lightandatmos.atmosphere then + Spring.SetAtmosphere(lightandatmos.atmosphere) + end --if lightandatmos.lighting then Spring.SetSunLighting({groundShadowDensity = lightandatmos.lighting.groundShadowDensity}) end -- for some godforsaken reason, this needs to be set TWICE! - if lightandatmos.lighting then Spring.SetSunLighting({}) end -- for some godforsaken reason, this needs to be set TWICE! + if lightandatmos.lighting then + Spring.SetSunLighting({}) + end -- for some godforsaken reason, this needs to be set TWICE! --gadgetHandler:SetGlobal("NightModeParams", {r=1, g=1, b=1, s=1, a= 1}) end - local atmosphere_lighting = {"atmosphere","lighting"} + local atmosphere_lighting = { "atmosphere", "lighting" } local atan2 = math.atan2 local diag = math.diag local mix = math.mix local sin = math.sin local cos = math.cos - + -- Mix everything specified in A into B, if not specified in B, then replace with A -- If target is not specified, target is B -- Returns aworldrot in radians where if sun is to the right (x>0) @@ -204,96 +208,103 @@ if not gadgetHandler:IsSyncedCode() then -- -2.03 -2.36 -3.14 2.36 2.03 -- -1.57 -1.57 -0.00 1.57 1.57 Z -- -1.11 -0.79 -0.00 0.79 1.11 - -- -0.79 -0.46 -0.00 0.46 0.79 + -- -0.79 -0.46 -0.00 0.46 0.79 -- X - + local function SunDirToAzimuthHeight(sunDir) local alength = 1.0 / diag(sunDir[1], sunDir[2], sunDir[3]) - local aworldrot = atan2(sunDir[1]*alength, sunDir[3]*alength) --https://en.wikipedia.org/wiki/Atan2 - local aheight = atan2(sunDir[2]*alength, diag(sunDir[1]*alength, sunDir[3]*alength)) + local aworldrot = atan2(sunDir[1] * alength, sunDir[3] * alength) --https://en.wikipedia.org/wiki/Atan2 + local aheight = atan2(sunDir[2] * alength, diag(sunDir[1] * alength, sunDir[3] * alength)) return aworldrot, aheight end - + local function SunAzimuthHeightToDir(azimuth, height, result) - if result == nil then result = {0,1,0} end - result[1] = sin(azimuth) * cos(height) - result[2] = sin(height) + if result == nil then + result = { 0, 1, 0 } + end + result[1] = sin(azimuth) * cos(height) + result[2] = sin(height) result[3] = cos(azimuth) * cos(height) return result end - + local function MixLightingAndAtmosphere(a, b, mixfactor, target) - if target == nil then target = b end - for _,k in ipairs(atmosphere_lighting) do + if target == nil then + target = b + end + for _, k in ipairs(atmosphere_lighting) do if a[k] and b[k] then local aa = a[k] - local bb = b[k] + local bb = b[k] for ka, va in pairs(aa) do - if bb[ka] == nil then target[ka] = aa[ka] + if bb[ka] == nil then + target[ka] = aa[ka] else - if type(va) == 'table' then - for i=1,#va do + if type(va) == "table" then + for i = 1, #va do --Spring.Echo(k, ka, i, aa[ka][i],bb[ka][i], mixfactor ) - target[k][ka][i] = mix(aa[ka][i], bb[ka][i], mixfactor) + target[k][ka][i] = mix(aa[ka][i], bb[ka][i], mixfactor) end else - target[k][ka] = mix(aa[ka], bb[ka], mixfactor) + target[k][ka] = mix(aa[ka], bb[ka], mixfactor) end end end end end - if a['sunDir'] and b['sunDir'] then - local asun = a['sunDir'] - local bsun = b['sunDir'] - - local aworldrot, aheight = SunDirToAzimuthHeight(a['sunDir'] ) - local bworldrot, bheight = SunDirToAzimuthHeight(b['sunDir'] ) + if a["sunDir"] and b["sunDir"] then + local asun = a["sunDir"] + local bsun = b["sunDir"] + + local aworldrot, aheight = SunDirToAzimuthHeight(a["sunDir"]) + local bworldrot, bheight = SunDirToAzimuthHeight(b["sunDir"]) --Spring.Echo(("Arot = %.2f, Brot = %.2f"):format(aworldrot, bworldrot)) -- if close to 180 degrees, then rotate clockwise if (aworldrot - bworldrot) > math.pi - 0.01 then bworldrot = bworldrot + 2 * math.pi end - + if (bworldrot - aworldrot) > math.pi - 0.01 then bworldrot = bworldrot - 2 * math.pi end - + local targetrot = mix(aworldrot, bworldrot, mixfactor) local targetheight = mix(aheight, bheight, mixfactor) - - SunAzimuthHeightToDir(targetrot, targetheight, target['sunDir']) + + SunAzimuthHeightToDir(targetrot, targetheight, target["sunDir"]) --Spring.Echo("sunDir", mixfactor, "targetrot",targetrot, "targetheight", targetheight, aworldrot , bworldrot) end - if a.nightFactor and b.nightFactor then - for k,_ in pairs(currentNightFactor) do + if a.nightFactor and b.nightFactor then + for k, _ in pairs(currentNightFactor) do target.nightFactor[k] = mix(a.nightFactor[k], b.nightFactor[k], mixfactor) end end return target end - + local initial_atmosphere_lighting = GetLightingAndAtmosphere() - + local initlight local endlight local mixedlight - + local function GetNightLight(fromlight, nightfactor, azimuth, altitude) - if fromlight == nil then + if fromlight == nil then fromlight = tablecopy(initial_atmosphere_lighting) - end + end local endlight = tablecopy(fromlight) - for _,atmlight in ipairs(atmosphere_lighting) do + for _, atmlight in ipairs(atmosphere_lighting) do for k2, v2 in pairs(endlight[atmlight]) do - if string.find(k2, "Color", nil, true) then + if string.find(k2, "Color", nil, true) then local unitmod = 0 - if string.find(k2, "unit", nil, true) then unitmod = 0.66 end - for i =1, #v2 do + if string.find(k2, "unit", nil, true) then + unitmod = 0.66 + end + for i = 1, #v2 do endlight[atmlight][k2][i] = endlight[atmlight][k2][i] * math.mix(nightfactor[i], 1.0, unitmod) end - elseif string.find(k2, "ShadowDensity", nil, true) then + elseif string.find(k2, "ShadowDensity", nil, true) then -- New shadow factor is a product of old and nightfactor[4] endlight[atmlight][k2] = endlight[atmlight][k2] * (nightfactor[4] or 1) end @@ -308,50 +319,53 @@ if not gadgetHandler:IsSyncedCode() then -- New sun height is weighted factor of old sun height endlight.sunDir[2] = fromlight.sunDir[2] * altitude - + local fromazimuth, fromheight = SunDirToAzimuthHeight(fromlight.sunDir) -- if the original sun is to the right, then we need to turn it left --Spring.Echo("Setting azimuth from", fromazimuth) local toazimuth = 0 if fromazimuth > 0 then toazimuth = fromazimuth + azimuth - if toazimuth > math.pi then toazimuth = toazimuth - 2 * math.pi end + if toazimuth > math.pi then + toazimuth = toazimuth - 2 * math.pi + end else -- turn it right toazimuth = fromazimuth - azimuth - if toazimuth < -1 * math.pi then toazimuth = toazimuth + 2 * math.pi end + if toazimuth < -1 * math.pi then + toazimuth = toazimuth + 2 * math.pi + end end SunAzimuthHeightToDir(toazimuth, fromheight * altitude, endlight.sunDir) - endlight.nightFactor = {red = nightfactor[1], green = nightfactor[2], blue = nightfactor[3], shadow = nightfactor[4], altitude = altitude} + endlight.nightFactor = { red = nightfactor[1], green = nightfactor[2], blue = nightfactor[3], shadow = nightfactor[4], altitude = altitude } return endlight end - + local transitionenabled = false local nightModeConfig = { { - nightFactor = {0.15, 0.15, 0.18, 0.5}, + nightFactor = { 0.15, 0.15, 0.18, 0.5 }, azimuth = 1.5, altitude = 0.5, dayDuration = 180, - nightDuration = 180, - transitionDuration = 120, - repeats = 10000, - startTime = 5, + nightDuration = 180, + transitionDuration = 120, + repeats = 10000, + startTime = 5, endLight = nil, -- this will be filled in on initialize! period = nil, -- init: nightConf.dayDuration + nightConf.nightDuration + 2 * nightConf.transitionDuration - } + }, } - local function SetNightMode(cmd, line, words, playerID) -- line is the full line -- words is a table here, of each of the words AFTER /luarules NightMode a b c -> {a,b,c} - Spring.Echo("SetNightMode",cmd, line, words, playerID) - if #words <= 1 then + Spring.Echo("SetNightMode", cmd, line, words, playerID) + if #words <= 1 then Spring.Echo("Resetting Lighting") SetLightingAndAtmosphere(initial_atmosphere_lighting) return end - + Spring.Echo("Expecting /luarules NightMode nightR nightG nightB azimuth altitude shadowfactor") local nightR = (words[1] and tonumber(words[1])) or 1 local nightG = (words[2] and tonumber(words[2])) or 1 @@ -359,71 +373,74 @@ if not gadgetHandler:IsSyncedCode() then local azimuth = (words[4] and tonumber(words[4])) or 0 local altitude = (words[5] and tonumber(words[5])) or 1 local shadowfactor = (words[6] and tonumber(words[6])) or 1 - - local newNightLight = GetNightLight(nil, { nightR, nightG,nightB,shadowfactor}, azimuth, altitude) + + local newNightLight = GetNightLight(nil, { nightR, nightG, nightB, shadowfactor }, azimuth, altitude) Spring.Echo(newNightLight) -- If this command is recieved, immediately stop any existing nightModeConfig transitionenabled = false SetLightingAndAtmosphere(newNightLight) end - + local function NightModeToggle(cmd, line, words, playerID) transitionenabled = not transitionenabled end - - + local function PrintSun(cmd, line, words, playerID) Spring.Echo("Current sun settings are") local sun = GetLightingAndAtmosphere() EchoSun(sun) end - function gadget:GameFrame(n) - if transitionenabled == false then return end - for i, nc in ipairs(nightModeConfig) do + if transitionenabled == false then + return + end + for i, nc in ipairs(nightModeConfig) do local currentseconds = n / 30 - nc.startTime -- see if this light can still have an effct - if currentseconds < nc.repeats * (nc.period) then + if currentseconds < nc.repeats * nc.period then --calculate phase: local phase = math.fmod(currentseconds, nc.period) - if phase < nc.dayDuration then + if phase < nc.dayDuration then -- still day, dont do shit - elseif phase > nc.dayDuration + nc.transitionDuration and - phase < nc.dayDuration + nc.transitionDuration + nc.nightDuration then + elseif phase > nc.dayDuration + nc.transitionDuration and phase < nc.dayDuration + nc.transitionDuration + nc.nightDuration then -- still night, dont do shit else -- we are in transition - if nc.mixedlight == nil then nc.mixedlight = tablecopy(nc.endLight) end - - local transitionfactor = 0 + if nc.mixedlight == nil then + nc.mixedlight = tablecopy(nc.endLight) + end + + local transitionfactor = 0 if phase <= nc.dayDuration + nc.transitionDuration then -- moving to night - mixfac = math.smoothstep(nc.dayDuration,nc.dayDuration + nc.transitionDuration,phase); + mixfac = math.smoothstep(nc.dayDuration, nc.dayDuration + nc.transitionDuration, phase) else - mixfac = 1.0 - math.smoothstep(nc.dayDuration + nc.transitionDuration + nc.nightDuration, nc.period,phase); + mixfac = 1.0 - math.smoothstep(nc.dayDuration + nc.transitionDuration + nc.nightDuration, nc.period, phase) end --Spring.Echo(mixfac, nc.mixedlight, initial_atmosphere_lighting, nc.endLight) MixLightingAndAtmosphere(initial_atmosphere_lighting, nc.endLight, mixfac, nc.mixedlight) - if nc.mixedlight == nil then return end + if nc.mixedlight == nil then + return + end SetLightingAndAtmosphere(nc.mixedlight) - end - end end end - - local lastSunChanged = -1 + + local lastSunChanged = -1 function gadget:SunChanged() -- Note that map_nightmode.lua gadget has to change sun twice in a single draw frame to update all local df = Spring.GetDrawFrame() - if df == lastSunChanged then return end + if df == lastSunChanged then + return + end lastSunChanged = df end function gadget:Initialize() initial_atmosphere_lighting = GetLightingAndAtmosphere() - for i, nightConf in ipairs(nightModeConfig) do + for i, nightConf in ipairs(nightModeConfig) do nightConf.endLight = GetNightLight(initial_atmosphere_lighting, nightConf.nightFactor, nightConf.azimuth, nightConf.altitude) nightConf.period = nightConf.dayDuration + nightConf.nightDuration + 2 * nightConf.transitionDuration end @@ -433,17 +450,15 @@ if not gadgetHandler:IsSyncedCode() then gadgetHandler:AddChatAction("NightMode", SetNightMode) gadgetHandler:AddChatAction("NightModeToggle", NightModeToggle) gadgetHandler:AddChatAction("PrintSun", PrintSun) - gadgetHandler:RegisterGlobal("NightModeParams", {r=1, g=1, b=1, s=1, a= 1}) + gadgetHandler:RegisterGlobal("NightModeParams", { r = 1, g = 1, b = 1, s = 1, a = 1 }) end function gadget:Shutdown() gadgetHandler:RemoveSyncAction("SetLightingAndAtmosphere") gadgetHandler:RemoveSyncAction("GetLightingAndAtmosphere") gadgetHandler:RemoveSyncAction("MixLightingAndAtmosphere") - gadgetHandler:RemoveChatAction('NightMode') - gadgetHandler:RemoveChatAction('NightModeToggle') + gadgetHandler:RemoveChatAction("NightMode") + gadgetHandler:RemoveChatAction("NightModeToggle") SetLightingAndAtmosphere(initial_atmosphere_lighting) end end - - diff --git a/luarules/gadgets/map_sun_handler.lua b/luarules/gadgets/map_sun_handler.lua index bca01203233..84ba20f2fec 100644 --- a/luarules/gadgets/map_sun_handler.lua +++ b/luarules/gadgets/map_sun_handler.lua @@ -5,20 +5,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Sun Handler", - version = "v0.00001", - desc = "Removes additional groundSpecularColor from older maps (Pre 101)", - author = "GoogleFrog, Beherith", - date = "2 March 2016", - license = "GNU GPL, v2 or later", - layer = -1, --higher layer is loaded last - enabled = true, + name = "Sun Handler", + version = "v0.00001", + desc = "Removes additional groundSpecularColor from older maps (Pre 101)", + author = "GoogleFrog, Beherith", + date = "2 March 2016", + license = "GNU GPL, v2 or later", + layer = -1, --higher layer is loaded last + enabled = true, } end - -- unsynced only -if (gadgetHandler:IsSyncedCode()) then +if gadgetHandler:IsSyncedCode() then return false end @@ -26,11 +25,11 @@ end -------------------------------------------------------------------------------- function gadget:Initialize() - if (Spring.SetSunLighting ~= nil) and (gl.GetAtmosphere ~= nil) and (Spring.GetConfigInt('AdvMapShading', 1) == 1) then + if (Spring.SetSunLighting ~= nil) and (gl.GetAtmosphere ~= nil) and (Spring.GetConfigInt("AdvMapShading", 1) == 1) then local mapSpecR, mapSpecG, mapSpecB = gl.GetSun("specular") if (math.abs(mapSpecR - 0.1) + math.abs(mapSpecG - 0.1) + math.abs(mapSpecB - 0.1)) < 0.0001 then --default groundSpecularColor is (0.1, 0.1, 0.1) Spring.Echo("Map Sun Handler: Clearing groundSpecularColor via SetSunLighting because map does not change it from default.") - Spring.SetSunLighting({groundSpecularColor = {0,0,0,0}}) + Spring.SetSunLighting({ groundSpecularColor = { 0, 0, 0, 0 } }) end end gadgetHandler:RemoveGadget() diff --git a/luarules/gadgets/map_voidground.lua b/luarules/gadgets/map_voidground.lua index 44d4591a3e1..46b39e9cbb3 100644 --- a/luarules/gadgets/map_voidground.lua +++ b/luarules/gadgets/map_voidground.lua @@ -16,17 +16,17 @@ function gadget:GetInfo() } end -local success, mapinfo= pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs +local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs if not success or mapinfo == nil then - Spring.Echo("Map VoidWater failed to load the mapinfo.lua") - return + Spring.Echo("Map VoidWater failed to load the mapinfo.lua") + return end if mapinfo.voidwater then - --Spring.Echo("Map has voidwater") +--Spring.Echo("Map has voidwater") else - --Spring.Echo("Map does not have voidwater") - return + --Spring.Echo("Map does not have voidwater") + return end local isVoidGroundTarget = {} @@ -42,7 +42,6 @@ local spGetFeaturePosition = Spring.GetFeaturePosition local mapx = Game.mapSizeX local mapz = Game.mapSizeZ - function gadget:FeatureCreated(featureID) if select(2, spGetFeaturePosition(featureID)) <= 1 then Spring.DestroyFeature(featureID, false) @@ -51,14 +50,13 @@ end -- periodically destroy units that end up in the void function gadget:GameFrame(gf) - if gf % 49 == 1 then local units = Spring.GetAllUnits() for k = 1, #units do local unitID = units[k] if isVoidGroundTarget[spGetUnitDefID(unitID)] then - local x,y,z = spGetUnitPosition(unitID) - if x ~= nil and (y < 0) and ( x > 0 and x < mapx ) and (z > 0 and z < mapz) then + local x, y, z = spGetUnitPosition(unitID) + if x ~= nil and (y < 0) and (x > 0 and x < mapx) and (z > 0 and z < mapz) then Spring.DestroyUnit(unitID) end end diff --git a/luarules/gadgets/map_waterlevel.lua b/luarules/gadgets/map_waterlevel.lua index 55400156ec8..a1893839ec9 100644 --- a/luarules/gadgets/map_waterlevel.lua +++ b/luarules/gadgets/map_waterlevel.lua @@ -21,7 +21,6 @@ local PACKET_HEADER_LENGTH = string.len(PACKET_HEADER) local PH_B1 = string.byte(PACKET_HEADER, 1) if gadgetHandler:IsSyncedCode() then - local waterlevel = Spring.GetModOptions().map_waterlevel function adjustFeatureHeight() @@ -29,13 +28,13 @@ if gadgetHandler:IsSyncedCode() then local x, y, z for i = 1, #featuretable do x, y, z = Spring.GetFeaturePosition(featuretable[i]) - Spring.SetFeaturePosition(featuretable[i], x, y, z ,true) -- snaptoground = true + Spring.SetFeaturePosition(featuretable[i], x, y, z, true) -- snaptoground = true end end function adjustWaterlevel() -- Spring.SetMapRenderingParams({ voidWater = false}) - Spring.Echo("Map Waterlevel: adjusting water level with: "..waterlevel) + Spring.Echo("Map Waterlevel: adjusting water level with: " .. waterlevel) Spring.AdjustHeightMap(0, 0, Game.mapSizeX, Game.mapSizeZ, -waterlevel) Spring.AdjustOriginalHeightMap(0, 0, Game.mapSizeX, Game.mapSizeZ, -waterlevel) Spring.AdjustSmoothMesh(0, 0, Game.mapSizeX, Game.mapSizeZ, -waterlevel) @@ -49,11 +48,8 @@ if gadgetHandler:IsSyncedCode() then waterlevel = modOptions.map_waterlevel -- adjust tidal strength if previosuly not present and applicable - if (modOptions.map_tidal == nil or modOptions.map_tidal == "unchanged") - and Spring.GetTidal() == 0 - and select(1, Spring.GetGroundExtremes()) > 0 - then - Spring.SetTidal( 15 ) + if (modOptions.map_tidal == nil or modOptions.map_tidal == "unchanged") and Spring.GetTidal() == 0 and select(1, Spring.GetGroundExtremes()) > 0 then + Spring.SetTidal(15) end adjustWaterlevel() @@ -85,14 +81,12 @@ if gadgetHandler:IsSyncedCode() then return end - local params = string.split(msg, ':') + local params = string.split(msg, ":") waterlevel = tonumber(params[2]) adjustWaterlevel() - Spring.Echo('Changed waterlevel: ' .. waterlevel) + Spring.Echo("Changed waterlevel: " .. waterlevel) end - -else -- UNSYNCED - +else -- UNSYNCED local myPlayerID = Spring.GetMyPlayerID() local myPlayerName = Spring.GetPlayerInfo(myPlayerID) local function isAuthorized() @@ -104,15 +98,15 @@ else -- UNSYNCED local function waterlevel(cmd, line, words, playerID) if words[1] then if (isAuthorized() or Spring.IsCheatingEnabled()) and playerID == myPlayerID then - Spring.SendLuaRulesMsg(PACKET_HEADER .. ':' .. words[1]) + Spring.SendLuaRulesMsg(PACKET_HEADER .. ":" .. words[1]) end end end function gadget:Initialize() - gadgetHandler:AddChatAction('waterlevel', waterlevel) + gadgetHandler:AddChatAction("waterlevel", waterlevel) end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('waterlevel') + gadgetHandler:RemoveChatAction("waterlevel") end end diff --git a/luarules/gadgets/mo_battle_royale.lua b/luarules/gadgets/mo_battle_royale.lua index aa7f08d08ad..4567685501b 100644 --- a/luarules/gadgets/mo_battle_royale.lua +++ b/luarules/gadgets/mo_battle_royale.lua @@ -2,17 +2,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Battle Royale", - desc = "Implements a shrinking cylinder of death with configurable rate that destroys all units", - author = "Beherith", - date = "20210827", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false -- still WIP + name = "Battle Royale", + desc = "Implements a shrinking cylinder of death with configurable rate that destroys all units", + author = "Beherith", + date = "20210827", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, -- still WIP } end - --[[ { key = "battle_royale_starttime", @@ -31,19 +30,20 @@ end def = 2, section= 'options', }, -]]-- +]] +-- -- in minutes local starttime = tonumber(Spring.GetModOptions().battle_royale_starttime) or -1 -- in minutes, hopefully never less than the commander's walk rate -local shrinktime =tonumber(Spring.GetModOptions().battle_royale_shrinktime) or 5 +local shrinktime = tonumber(Spring.GetModOptions().battle_royale_shrinktime) or 5 -if (starttime <= 0) then +if starttime <= 0 then return false end local startframe = starttime * 60 * 30 -local radiussquared = math.pow(Game.mapSizeX * 0.5 , 2) + math.pow(Game.mapSizeZ * 0.5 , 2) +local radiussquared = math.pow(Game.mapSizeX * 0.5, 2) + math.pow(Game.mapSizeZ * 0.5, 2) local radius = math.sqrt(radiussquared) local startradius = radius local shrinkrate = radius / (shrinktime * 60 * 30) @@ -51,71 +51,73 @@ local mapCenterX = Game.mapSizeX * 0.5 local mapCenterZ = Game.mapSizeZ * 0.5 if gadgetHandler:IsSyncedCode() then - local function distsqrgreater (a,b,threshold) - return (a * a + b * b) > threshold - end + local function distsqrgreater(a, b, threshold) + return (a * a + b * b) > threshold + end - local function BattleRoyaleDebug() - Spring.Echo("Battle Royale reset to", startradius/2) - radius = startradius/2 - end + local function BattleRoyaleDebug() + Spring.Echo("Battle Royale reset to", startradius / 2) + radius = startradius / 2 + end - function gadget:Initialize() - gadgetHandler:AddChatAction('battleroyaledebug', BattleRoyaleDebug ) - end + function gadget:Initialize() + gadgetHandler:AddChatAction("battleroyaledebug", BattleRoyaleDebug) + end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('battleroyaledebug') + gadgetHandler:RemoveChatAction("battleroyaledebug") end - function gadget:GameFrame(gameFrame) - if gameFrame < startframe then return end - radius = radius - shrinkrate - radius = math.max(radius,0) - radiussquared = radius * radius - if gameFrame % 11 == 0 then - local allunits = Spring.GetAllUnits() - local numdestroyed = 0 - for _,unitID in ipairs(allunits) do - local ux,uy,uz = Spring.GetUnitPosition(unitID) - if ux and distsqrgreater(ux - mapCenterX, uz - mapCenterZ, radiussquared) then - --Spring.DestroyUnit(unitID, true, false) - numdestroyed = numdestroyed + 1 + function gadget:GameFrame(gameFrame) + if gameFrame < startframe then + return + end + radius = radius - shrinkrate + radius = math.max(radius, 0) + radiussquared = radius * radius + if gameFrame % 11 == 0 then + local allunits = Spring.GetAllUnits() + local numdestroyed = 0 + for _, unitID in ipairs(allunits) do + local ux, uy, uz = Spring.GetUnitPosition(unitID) + if ux and distsqrgreater(ux - mapCenterX, uz - mapCenterZ, radiussquared) then + --Spring.DestroyUnit(unitID, true, false) + numdestroyed = numdestroyed + 1 + end end + --Spring.Echo("BattleRoyale radius =", radius, "destroyed", numdestroyed) end - --Spring.Echo("BattleRoyale radius =", radius, "destroyed", numdestroyed) - end - SendToUnsynced("BattleRoyaleRadius", radius) + SendToUnsynced("BattleRoyaleRadius", radius) end function gadget:GameOver() gadgetHandler:RemoveGadget(self) end - - else ------------------------- -- UNSYNCED CODE -- ------------------------- - local LuaShader = gl.LuaShader - local InstanceVBOTable = gl.InstanceVBOTable + local LuaShader = gl.LuaShader + local InstanceVBOTable = gl.InstanceVBOTable - local pushElementInstance = InstanceVBOTable.pushElementInstance + local pushElementInstance = InstanceVBOTable.pushElementInstance - local circleSegments = 1024 - local circleShader = nil - local circleInstanceVBO = nil + local circleSegments = 1024 + local circleShader = nil + local circleInstanceVBO = nil - local minY, maxY - local hextexture = "LuaUI/Images/hexgrid.tga" + local minY, maxY + local hextexture = "LuaUI/Images/hexgrid.tga" - local function goodbye(reason) - Spring.Echo("Ground Circle GL4 widget exiting with reason: "..reason) - if circleShader then circleShader:Finalize() end - end + local function goodbye(reason) + Spring.Echo("Ground Circle GL4 widget exiting with reason: " .. reason) + if circleShader then + circleShader:Finalize() + end + end - local vsSrc = [[ + local vsSrc = [[ #version 420 #line 10000 //__DEFINES__ @@ -160,7 +162,7 @@ else } ]] - local fsSrc = [[ + local fsSrc = [[ #version 330 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -202,81 +204,76 @@ else } ]] - local function initgl4() - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() - vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - circleShader = LuaShader( - { - vertex = vsSrc:gsub("//__DEFINES__", "#define MYGRAVITY " .. tostring(Game.gravity+0.1)), - fragment = fsSrc:gsub("//__DEFINES__", "#define USE_STIPPLE ".. tostring(0) ), - --geometry = gsSrc, no geom shader for now - uniformInt = { - hexTex = 0, - }, - uniformFloat = { - circleuniforms = {1,1,1,1}, -- unused - }, - }, - "ground circles shader GL4" - ) - shaderCompiled = circleShader:Initialize() - if not shaderCompiled then goodbye("Failed to compile circleShader GL4 ") end - local circleVBO,numVertices = InstanceVBOTable.makeCylinderVBO(circleSegments) - local circleInstanceVBOLayout = { - {id = 1, name = 'posrad', size = 4}, -- the start pos + radius - {id = 2, name = 'color', size = 4}, --- color - } - circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout,32, "groundcirclevbo") - circleInstanceVBO.numVertices = numVertices - circleInstanceVBO.vertexVBO = circleVBO - circleInstanceVBO.VAO = InstanceVBOTable.makeVAOandAttach(circleInstanceVBO.vertexVBO, circleInstanceVBO.instanceVBO) - end - - local battleroyaleradius = -1 + local function initgl4() + local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() + vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) + fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) + circleShader = LuaShader({ + vertex = vsSrc:gsub("//__DEFINES__", "#define MYGRAVITY " .. tostring(Game.gravity + 0.1)), + fragment = fsSrc:gsub("//__DEFINES__", "#define USE_STIPPLE " .. tostring(0)), + --geometry = gsSrc, no geom shader for now + uniformInt = { + hexTex = 0, + }, + uniformFloat = { + circleuniforms = { 1, 1, 1, 1 }, -- unused + }, + }, "ground circles shader GL4") + shaderCompiled = circleShader:Initialize() + if not shaderCompiled then + goodbye("Failed to compile circleShader GL4 ") + end + local circleVBO, numVertices = InstanceVBOTable.makeCylinderVBO(circleSegments) + local circleInstanceVBOLayout = { + { id = 1, name = "posrad", size = 4 }, -- the start pos + radius + { id = 2, name = "color", size = 4 }, --- color + } + circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 32, "groundcirclevbo") + circleInstanceVBO.numVertices = numVertices + circleInstanceVBO.vertexVBO = circleVBO + circleInstanceVBO.VAO = InstanceVBOTable.makeVAOandAttach(circleInstanceVBO.vertexVBO, circleInstanceVBO.instanceVBO) + end + + local battleroyaleradius = -1 local function BattleRoyaleRadius(_, radius) - if battleroyaleradius == -1 then - Spring.SendMessage("Battle Royale has begun, you have ".. tostring(shrinktime) .. " minutes left") - end - battleroyaleradius = radius - pushElementInstance(circleInstanceVBO, - {Game.mapSizeX/2, 0, Game.mapSizeZ/2, battleroyaleradius, - 1.0,0.0,0.0, 1.0, - }, - 0, -- key is gonna be zero for my dummy face - true -- overwrite - ) + if battleroyaleradius == -1 then + Spring.SendMessage("Battle Royale has begun, you have " .. tostring(shrinktime) .. " minutes left") + end + battleroyaleradius = radius + pushElementInstance( + circleInstanceVBO, + { Game.mapSizeX / 2, 0, Game.mapSizeZ / 2, battleroyaleradius, 1.0, 0.0, 0.0, 1.0 }, + 0, -- key is gonna be zero for my dummy face + true -- overwrite + ) end - local function BattleRoyaleDebug() - end + local function BattleRoyaleDebug() end - function gadget:Initialize() - minY, maxY = Spring.GetGroundExtremes ( ) + function gadget:Initialize() + minY, maxY = Spring.GetGroundExtremes() gadgetHandler:AddSyncAction("BattleRoyaleRadius", BattleRoyaleRadius) - initgl4() - end - - function gadget:Shutdown() - end - - function gadget:DrawWorld() - if circleInstanceVBO.usedElements > 0 then - gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove - gl.DepthTest(true) - gl.AlphaTest(GL.GREATER, 0) - gl.Blending(GL.SRC_ALPHA, GL.ONE) - gl.Texture(0,hextexture) - circleShader:Activate() - circleShader:SetUniform("circleuniforms", minY, maxY + 32, 1.0, 1.0) -- unused - circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLES, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) - circleShader:Deactivate() - gl.Texture(0, false) - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.AlphaTest(false) - gl.DepthTest(false) - --gl.DepthMask(false) --"BK OpenGL state resets", already set as false - end - end + initgl4() + end + function gadget:Shutdown() end + + function gadget:DrawWorld() + if circleInstanceVBO.usedElements > 0 then + gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove + gl.DepthTest(true) + gl.AlphaTest(GL.GREATER, 0) + gl.Blending(GL.SRC_ALPHA, GL.ONE) + gl.Texture(0, hextexture) + circleShader:Activate() + circleShader:SetUniform("circleuniforms", minY, maxY + 32, 1.0, 1.0) -- unused + circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLES, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) + circleShader:Deactivate() + gl.Texture(0, false) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.AlphaTest(false) + gl.DepthTest(false) + --gl.DepthMask(false) --"BK OpenGL state resets", already set as false + end + end end diff --git a/luarules/gadgets/mo_com_counter.lua b/luarules/gadgets/mo_com_counter.lua index 9e28450c962..d1f9416389a 100644 --- a/luarules/gadgets/mo_com_counter.lua +++ b/luarules/gadgets/mo_com_counter.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Com Counter", - desc = "Tells each team the total number of commanders alive in enemy allyteams", - author = "Bluestone", - date = "08/03/2014", - license = "GNU GPL, v2 or later, Horses", - layer = 0, - enabled = true + name = "Com Counter", + desc = "Tells each team the total number of commanders alive in enemy allyteams", + author = "Bluestone", + date = "08/03/2014", + license = "GNU GPL, v2 or later, Horses", + layer = 0, + enabled = true, } end @@ -28,10 +28,10 @@ end local teamComs = {} local teamAllyTeam = {} local teamList = Spring.GetTeamList() -for _,teamID in pairs(teamList) do - teamAllyTeam[teamID] = select(6,Spring.GetTeamInfo(teamID,false)) +for _, teamID in pairs(teamList) do + teamAllyTeam[teamID] = select(6, Spring.GetTeamInfo(teamID, false)) local newCount = 0 - for unitDefID,_ in pairs(isCommander) do + for unitDefID, _ in pairs(isCommander) do newCount = newCount + Spring.GetTeamUnitDefCount(teamID, unitDefID) end teamComs[teamID] = newCount @@ -39,16 +39,16 @@ end teamList = nil local function updateEnemyComCount() - for teamID,_ in pairs(teamComs) do + for teamID, _ in pairs(teamComs) do -- count all coms in enemy teams, to get enemy allyteam com count local enemyComCount = 0 - for otherTeamID,_ in pairs(teamComs) do + for otherTeamID, _ in pairs(teamComs) do if teamAllyTeam[teamID] ~= teamAllyTeam[otherTeamID] then enemyComCount = enemyComCount + teamComs[otherTeamID] end end -- for each teamID, set a TeamRulesParam containing the # of coms in enemy allyteams - spSetTeamRulesParam(teamID, "enemyComCount", enemyComCount, {private=true, allied=false}) + spSetTeamRulesParam(teamID, "enemyComCount", enemyComCount, { private = true, allied = false }) end end diff --git a/luarules/gadgets/mo_coop_II.lua b/luarules/gadgets/mo_coop_II.lua index 4db5957442f..29187fe4419 100644 --- a/luarules/gadgets/mo_coop_II.lua +++ b/luarules/gadgets/mo_coop_II.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Coop II', - desc = 'Implements coop modoption', - author = 'Niobium', - date = 'May 2011', - license = 'GNU GPL, v2 or later', - layer = 1, --should run after game_initial_spawn - enabled = true + name = "Coop II", + desc = "Implements coop modoption", + author = "Niobium", + date = "May 2011", + license = "GNU GPL, v2 or later", + layer = 1, --should run after game_initial_spawn + enabled = true, } end @@ -19,7 +18,6 @@ if not Spring.GetModOptions().coop then end if gadgetHandler:IsSyncedCode() then - ---------------------------------------------------------------- -- Synced Var ---------------------------------------------------------------- @@ -35,7 +33,7 @@ if gadgetHandler:IsSyncedCode() then ---------------------------------------------------------------- local function SetCoopStartPoint(playerID, x, y, z) - coopStartPoints[playerID] = {x, y, z} + coopStartPoints[playerID] = { x, y, z } SendToUnsynced("CoopStartPoint", playerID, x, y, z) end @@ -45,7 +43,7 @@ if gadgetHandler:IsSyncedCode() then local playerList = Spring.GetPlayerList() for i = 1, #playerList do local playerID = playerList[i] - local _, _, isSpec, teamID = Spring.GetPlayerInfo(playerID,false) + local _, _, isSpec, teamID = Spring.GetPlayerInfo(playerID, false) if not isSpec then if teamHasPlayers[teamID] then SetCoopStartPoint(playerID, -1, -1, -1) @@ -65,9 +63,9 @@ if gadgetHandler:IsSyncedCode() then -- Synced Callins ---------------------------------------------------------------- - function gadget:AllowStartPosition(playerID,teamID,readyState,x,y,z) + function gadget:AllowStartPosition(playerID, teamID, readyState, x, y, z) for otherplayerID, startPos in pairs(coopStartPoints) do - if startPos[1]==x and startPos[3]==z then + if startPos[1] == x and startPos[3] == z then return false end end @@ -80,7 +78,7 @@ if gadgetHandler:IsSyncedCode() then -- his coop buddy readies up after, then the first will have his start point overwritten by the second. -- This can be prevented by not allowing the first to place on second, either. - local _, _, _, teamID, allyID = Spring.GetPlayerInfo(playerID,false) + local _, _, _, teamID, allyID = Spring.GetPlayerInfo(playerID, false) local osx, _, osz = Spring.GetTeamStartPosition(teamID) if x ~= osx or z ~= osz then local xmin, zmin, xmax, zmax = Spring.GetAllyTeamStartBox(allyID) @@ -95,20 +93,28 @@ if gadgetHandler:IsSyncedCode() then return true end - function IsSteep(x,z) + function IsSteep(x, z) -- check if the position (x,z) is too step to start a commander on or not local mtta = math.acos(1.0 - 0.41221) - 0.02 -- http://springrts.com/wiki/Movedefs.lua#How_slope_is_determined & the -0.02 is for safety - local a1,a2,a3,a4 = 0,0,0,0 + local a1, a2, a3, a4 = 0, 0, 0, 0 local d = 5 - local y = Spring.GetGroundHeight(x,z) - local y1 = Spring.GetGroundHeight(x+d,z) - if math.abs(y1 - y) > 0.1 then a1 = math.atan((y1-y)/d) end - local y2 = Spring.GetGroundHeight(x,z+d) - if math.abs(y2 - y) > 0.1 then a2 = math.atan((y2-y)/d) end - local y3 = Spring.GetGroundHeight(x-d,z) - if math.abs(y3 - y) > 0.1 then a3 = math.atan((y3-y)/d) end - local y4 = Spring.GetGroundHeight(x,z+d) - if math.abs(y4 - y) > 0.1 then a4 = math.atan((y4-y)/d) end + local y = Spring.GetGroundHeight(x, z) + local y1 = Spring.GetGroundHeight(x + d, z) + if math.abs(y1 - y) > 0.1 then + a1 = math.atan((y1 - y) / d) + end + local y2 = Spring.GetGroundHeight(x, z + d) + if math.abs(y2 - y) > 0.1 then + a2 = math.atan((y2 - y) / d) + end + local y3 = Spring.GetGroundHeight(x - d, z) + if math.abs(y3 - y) > 0.1 then + a3 = math.atan((y3 - y) / d) + end + local y4 = Spring.GetGroundHeight(x, z + d) + if math.abs(y4 - y) > 0.1 then + a4 = math.atan((y4 - y) / d) + end if math.abs(a1) > mtta or math.abs(a2) > mtta or math.abs(a3) > mtta or math.abs(a4) > mtta then return true --too steep else @@ -116,8 +122,8 @@ if gadgetHandler:IsSyncedCode() then end end - local function SpawnTeamStartUnit(playerID,teamID, allyID, x, z) - local startUnit = Spring.GetTeamRulesParam(teamID, 'startUnit') + local function SpawnTeamStartUnit(playerID, teamID, allyID, x, z) + local startUnit = Spring.GetTeamRulesParam(teamID, "startUnit") if GG.playerStartingUnits then --use that player specific start unit if available startUnit = GG.playerStartingUnits[playerID] or startUnit end @@ -135,53 +141,49 @@ if gadgetHandler:IsSyncedCode() then if x <= 0 or z <= 0 then --TODO: improve this local xmin, zmin, xmax, zmax = Spring.GetAllyTeamStartBox(allyID) - local tx,tz + local tx, tz if GG.teamStartPoints then tx = GG.teamStartPoints[teamID][1] tz = GG.teamStartPoints[teamID][3] else - tx = (xmin+xmax)/2 - tz = (zmin+zmax)/2 + tx = (xmin + xmax) / 2 + tz = (zmin + zmax) / 2 end - local thetaStart = math.random(15)-1 - for theta = thetaStart,15+thetaStart do - local sx = tx + 45*math.cos((math.pi/8)*theta) - local sz = tz + 45*math.sin((math.pi/8)*theta) - if not IsSteep(sx,sz) then + local thetaStart = math.random(15) - 1 + for theta = thetaStart, 15 + thetaStart do + local sx = tx + 45 * math.cos((math.pi / 8) * theta) + local sz = tz + 45 * math.sin((math.pi / 8) * theta) + if not IsSteep(sx, sz) then x = math.clamp(sx, xmin, xmax) x = math.clamp(sz, zmin, zmax) break else -- fallback - x=tx - z=tz + x = tx + z = tz end end end -- create local unitID = Spring.CreateUnit(startUnit, x, Spring.GetGroundHeight(x, z), z, 0, teamID) - coopStartPoints[playerID] = {x,z} + coopStartPoints[playerID] = { x, z } GG.playerStartingUnits[playerID] = startUnit -- we set unit rule to mark who belongs to, so initial queue knows which com unitID belongs to which player's initial queue - Spring.SetUnitRulesParam(unitID, "startingOwner", playerID ) + Spring.SetUnitRulesParam(unitID, "startingOwner", playerID) end function gadget:GameFrame(n) -- spawn cooped coms - if n==0 and GG.coopMode then + if n == 0 and GG.coopMode then for playerID, startPos in pairs(coopStartPoints) do - local _, _, _, teamID, allyID = Spring.GetPlayerInfo(playerID,false) - SpawnTeamStartUnit(playerID,teamID, allyID, startPos[1], startPos[3]) + local _, _, _, teamID, allyID = Spring.GetPlayerInfo(playerID, false) + SpawnTeamStartUnit(playerID, teamID, allyID, startPos[1], startPos[3]) end end gadgetHandler:RemoveGadget(self) end - - else - - local function CoopStartPoint(epicwtf, playerID, x, y, z) --this epicwtf param is used because it seem that when a registered function is locaal, then the registration name is passed too. if the function is part of gadget: then it is not passed. if Script.LuaUI("GadgetCoopStartPoint") then Script.LuaUI.GadgetCoopStartPoint(playerID, x, y, z) @@ -199,5 +201,4 @@ else function gadget:GameFrame(n) gadgetHandler:RemoveGadget(self) end - end diff --git a/luarules/gadgets/mo_ffa.lua b/luarules/gadgets/mo_ffa.lua index 00b882d2b50..1205ddff340 100644 --- a/luarules/gadgets/mo_ffa.lua +++ b/luarules/gadgets/mo_ffa.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "19 Jan 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -17,7 +17,6 @@ if not Spring.Utilities.Gametype.IsFFA() then end if gadgetHandler:IsSyncedCode() then - local earlyDropLimit = Game.gameSpeed * 60 * 2 -- after this gameframe: lateDropGrace is used instead of earlyDropGrace local earlyDropGrace = Game.gameSpeed * 60 * 1 -- in frames local lateDropGrace = Game.gameSpeed * 60 * 2 -- in frames @@ -54,7 +53,6 @@ if gadgetHandler:IsSyncedCode() then end local function destroyTeam(teamID) - -- Check if the entire allyteam is dead and wipeout their units if so local allyTeamDead = true local allyTeamID = select(6, Spring.GetTeamInfo(teamID)) @@ -73,9 +71,9 @@ if gadgetHandler:IsSyncedCode() then GG.wipeoutAllyTeam(wipeoutAllyID) else local teams = Spring.GetTeamList(wipeoutAllyID) - for _,tID in pairs(teams) do + for _, tID in pairs(teams) do local teamUnits = Spring.GetTeamUnits(tID) - for i=1, #teamUnits do + for i = 1, #teamUnits do Spring.DestroyUnit(teamUnits[i], false, leaveWreckage) end end @@ -98,7 +96,7 @@ if gadgetHandler:IsSyncedCode() then end local allResigned, noneControlling - for i=1, #teamList do + for i = 1, #teamList do local teamID = teamList[i] if not deadTeam[teamID] then if not teamInfo[teamID] then @@ -150,8 +148,8 @@ if gadgetHandler:IsSyncedCode() then if gameFrame < leaveWreckageFromFrame then -- silent removal local teamUnits = Spring.GetTeamUnits(teamID) - for i=1, #teamUnits do - Spring.DestroyUnit(teamUnits[i], false, true) -- reclaim, dont want to leave FFA comwreck for idling starts + for i = 1, #teamUnits do + Spring.DestroyUnit(teamUnits[i], false, true) -- reclaim, dont want to leave FFA comwreck for idling starts end end destroyTeam(teamID) @@ -167,26 +165,24 @@ if gadgetHandler:IsSyncedCode() then function gadget:GameOver() gadgetHandler:RemoveGadget(self) end - -else -- UNSYNCED - +else -- UNSYNCED local function teamDestroyed(_, teamID) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.ffaNoOwner.destroyed', { team = teamID }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.ffaNoOwner.destroyed", { team = teamID }) Spring.SendMessage(message) end end local function playerWarned(_, teamID, gracePeriod) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.ffaNoOwner.disconnected', { team = teamID, gracePeriod = gracePeriod }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.ffaNoOwner.disconnected", { team = teamID, gracePeriod = gracePeriod }) Spring.SendMessage(message) end end local function playerReconnected(_, teamID) - if Script.LuaUI('GadgetMessageProxy') then - local message = Script.LuaUI.GadgetMessageProxy('ui.ffaNoOwner.reconnected', { team = teamID }) + if Script.LuaUI("GadgetMessageProxy") then + local message = Script.LuaUI.GadgetMessageProxy("ui.ffaNoOwner.reconnected", { team = teamID }) Spring.SendMessage(message) end end diff --git a/luarules/gadgets/mo_preventcombomb.lua b/luarules/gadgets/mo_preventcombomb.lua index fd5ef253f89..5c13e9a7bd4 100644 --- a/luarules/gadgets/mo_preventcombomb.lua +++ b/luarules/gadgets/mo_preventcombomb.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "preventcombomb", - desc = "Commanders survive commander blast", - author = "TheFatController", - date = "Aug 31, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "preventcombomb", + desc = "Commanders survive commander blast", + author = "TheFatController", + date = "Aug 31, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -38,7 +38,7 @@ local cantFall = {} local commCountCache = {} local commCountCacheFrame = -1 -local COM_BLAST = WeaponDefNames['commanderexplosion'].id +local COM_BLAST = WeaponDefNames["commanderexplosion"].id local isCommander = {} local commanderDefIDs = {} @@ -51,21 +51,21 @@ end local function CommCount(unitTeam) local currentFrame = GetGameFrame() - + -- Use cached result if available for this frame if commCountCacheFrame == currentFrame and commCountCache[unitTeam] then return commCountCache[unitTeam] end - + -- Clear cache if this is a new frame if commCountCacheFrame ~= currentFrame then commCountCache = {} commCountCacheFrame = currentFrame end - + local allyTeamID = select(6, GetTeamInfo(unitTeam, false)) local teamsInAlly = GetTeamList(allyTeamID) - + local count = 0 if teamsInAlly then for i = 1, #teamsInAlly do @@ -75,7 +75,7 @@ local function CommCount(unitTeam) end end end - + -- Cache the result commCountCache[unitTeam] = count return count @@ -92,7 +92,7 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w if not hp then return damage end - + local combombDamage = hp - 200 - math_random(1, 10) if combombDamage < 0 then combombDamage = 0 @@ -106,7 +106,7 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w if weaponID == COM_BLAST and isCommander[unitDefID] and attackerID then local unitTeamID = GetUnitTeam(unitID) local attackerTeamID = GetUnitTeam(attackerID) - + if unitTeamID and attackerTeamID and CommCount(unitTeamID) <= 1 and CommCount(attackerTeamID) <= 1 then if unitID ~= attackerID then -- make unitID immune to DGun @@ -134,7 +134,7 @@ function gadget:GameFrame(currentFrame) immuneDgunList[unitID] = nil end end - + for unitID, expirationTime in pairs(ctrlCom) do if currentFrame > expirationTime then local x, _, z = GetUnitPosition(unitID) @@ -149,7 +149,7 @@ function gadget:GameFrame(currentFrame) ctrlCom[unitID] = nil end end - + for unitID, expirationTime in pairs(cantFall) do if currentFrame > expirationTime then cantFall[unitID] = nil diff --git a/luarules/gadgets/pve_areahealers.lua b/luarules/gadgets/pve_areahealers.lua index b781b24abf3..3b82461c39e 100644 --- a/luarules/gadgets/pve_areahealers.lua +++ b/luarules/gadgets/pve_areahealers.lua @@ -1,25 +1,25 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Raptor Area Healers", - desc = "Area Heal raptors around raptor healers - healers don't heal each other.", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- we don't need it for now, but might need it later. - } + return { + name = "Raptor Area Healers", + desc = "Area Heal raptors around raptor healers - healers don't heal each other.", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, -- we don't need it for now, but might need it later. + } end if not gadgetHandler:IsSyncedCode() then - return + return end if Spring.Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") elseif Spring.Utilities.Gametype.IsScavengers() then - Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") return false @@ -35,7 +35,6 @@ local spSetUnitHealth = Spring.SetUnitHealth local spSpawnCEG = Spring.SpawnCEG local mathCeil = math.ceil - local unitTeams = {} local pveTeamID = Spring.Utilities.GetRaptorTeamID() or Spring.Utilities.GetScavTeamID() @@ -43,39 +42,39 @@ local pveTeamID = Spring.Utilities.GetRaptorTeamID() or Spring.Utilities.GetScav local aliveHealers = {} local healersTable = {} if Spring.Utilities.Gametype.IsRaptors() then - healersTable[UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].buildDistance*2, - canbehealed = false, - } - healersTable[UnitDefNames["raptor_land_swarmer_heal_t2_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].buildDistance*2, - canbehealed = false, - } - healersTable[UnitDefNames["raptor_land_swarmer_heal_t3_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].buildDistance*2, - canbehealed = false, - } - healersTable[UnitDefNames["raptor_land_swarmer_heal_t4_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].buildDistance*2, - canbehealed = false, - } - healersTable[UnitDefNames["raptor_matriarch_healer"].id] = { - healingpower = UnitDefNames["raptor_matriarch_healer"].repairSpeed, - healingrange = UnitDefNames["raptor_matriarch_healer"].buildDistance*2, - canbehealed = false, - } + healersTable[UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].buildDistance * 2, + canbehealed = false, + } + healersTable[UnitDefNames["raptor_land_swarmer_heal_t2_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].buildDistance * 2, + canbehealed = false, + } + healersTable[UnitDefNames["raptor_land_swarmer_heal_t3_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].buildDistance * 2, + canbehealed = false, + } + healersTable[UnitDefNames["raptor_land_swarmer_heal_t4_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].buildDistance * 2, + canbehealed = false, + } + healersTable[UnitDefNames["raptor_matriarch_healer"].id] = { + healingpower = UnitDefNames["raptor_matriarch_healer"].repairSpeed, + healingrange = UnitDefNames["raptor_matriarch_healer"].buildDistance * 2, + canbehealed = false, + } end local unitBuildtime = {} for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.isscavenger and unitDef.canRepair and unitDef.repairSpeed and unitDef.buildDistance then healersTable[unitDefID] = { - healingpower = unitDef.repairSpeed*0.4, - healingrange = unitDef.buildDistance*1.5, + healingpower = unitDef.repairSpeed * 0.4, + healingrange = unitDef.buildDistance * 1.5, canbehealed = true, } end @@ -83,14 +82,14 @@ for unitDefID, unitDef in pairs(UnitDefs) do end function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if healersTable[unitDefID] and (unitTeam == pveTeamID) then - aliveHealers[unitID] = { + if healersTable[unitDefID] and (unitTeam == pveTeamID) then + aliveHealers[unitID] = { teamID = unitTeam, - healingpower = healersTable[unitDefID].healingpower, - healingrange = healersTable[unitDefID].healingrange, - canbehealed = healersTable[unitDefID].canbehealed, - } - end + healingpower = healersTable[unitDefID].healingpower, + healingrange = healersTable[unitDefID].healingrange, + canbehealed = healersTable[unitDefID].canbehealed, + } + end unitTeams[unitID] = unitTeam end @@ -100,29 +99,29 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) end function gadget:GameFrame(frame) - local x,y,z,surroundingUnits,surroundingUnitID - for unitID, statsTable in pairs(aliveHealers) do - if unitID % 30 == frame % 30 then - x,y,z = spGetUnitPosition(unitID) - surroundingUnits = spGetUnitsInSphere(x, y, z, statsTable.healingrange, pveTeamID) - for i = 1, #surroundingUnits do - surroundingUnitID = surroundingUnits[i] - if not aliveHealers[surroundingUnitID] or (aliveHealers[surroundingUnitID].canbehealed and unitID ~= surroundingUnitID) then - if pveTeamID or spAreTeamsAllied(statsTable.teamID, unitTeams[surroundingUnitID]) then - local oldHP, maxHP, _, _, oldBuild= spGetUnitHealth(surroundingUnitID) - if oldHP < maxHP then - local x2, y2, z2 = spGetUnitPosition(surroundingUnitID) + local x, y, z, surroundingUnits, surroundingUnitID + for unitID, statsTable in pairs(aliveHealers) do + if unitID % 30 == frame % 30 then + x, y, z = spGetUnitPosition(unitID) + surroundingUnits = spGetUnitsInSphere(x, y, z, statsTable.healingrange, pveTeamID) + for i = 1, #surroundingUnits do + surroundingUnitID = surroundingUnits[i] + if not aliveHealers[surroundingUnitID] or (aliveHealers[surroundingUnitID].canbehealed and unitID ~= surroundingUnitID) then + if pveTeamID or spAreTeamsAllied(statsTable.teamID, unitTeams[surroundingUnitID]) then + local oldHP, maxHP, _, _, oldBuild = spGetUnitHealth(surroundingUnitID) + if oldHP < maxHP then + local x2, y2, z2 = spGetUnitPosition(surroundingUnitID) if not spGetUnitNearestEnemy(surroundingUnitID, mathCeil(statsTable.healingrange)) then - local healedUnitBuildTime = unitBuildtime[spGetUnitDefID(surroundingUnitID)] - local healValue = (maxHP/healedUnitBuildTime)*statsTable.healingpower - local buildValue = (statsTable.healingpower/healedUnitBuildTime)*2 - spSetUnitHealth(surroundingUnitID, {health = oldHP+healValue, build = oldBuild+buildValue}) - spSpawnCEG("heal", x2, y2+10, z2, 0,1,0) - end - end - end - end - end - end - end + local healedUnitBuildTime = unitBuildtime[spGetUnitDefID(surroundingUnitID)] + local healValue = (maxHP / healedUnitBuildTime) * statsTable.healingpower + local buildValue = (statsTable.healingpower / healedUnitBuildTime) * 2 + spSetUnitHealth(surroundingUnitID, { health = oldHP + healValue, build = oldBuild + buildValue }) + spSpawnCEG("heal", x2, y2 + 10, z2, 0, 1, 0) + end + end + end + end + end + end + end end diff --git a/luarules/gadgets/pve_attachments.lua b/luarules/gadgets/pve_attachments.lua index 05af427f792..e11538184b0 100644 --- a/luarules/gadgets/pve_attachments.lua +++ b/luarules/gadgets/pve_attachments.lua @@ -1,83 +1,81 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Unit Attachments", - desc = "Allows to attach structures to other structures, merging their healthbars", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false -- we don't need it for now, but might need it later. - } + return { + name = "Unit Attachments", + desc = "Allows to attach structures to other structures, merging their healthbars", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, -- we don't need it for now, but might need it later. + } end if not gadgetHandler:IsSyncedCode() then - return + return end local unitAttachments = { - -- [UnitDefNames["raptor_hive"].id] = { - -- { unitType = "raptor_antinuke", posx = 0, posz = 0, dir = 0 }, - -- }, + -- [UnitDefNames["raptor_hive"].id] = { + -- { unitType = "raptor_antinuke", posx = 0, posz = 0, dir = 0 }, + -- }, } local deleteAttachments = {} local unitAttachedTo = {} - -function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, - attackerDefID, attackerTeam) - if unitAttachedTo[unitID] and (not paralyzer) then - local h, mh = Spring.GetUnitHealth(unitAttachedTo[unitID]) - if h and mh then - Spring.SetUnitHealth(unitAttachedTo[unitID], h - damage) - end - damage = 0 - end - return damage, 1 +function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) + if unitAttachedTo[unitID] and not paralyzer then + local h, mh = Spring.GetUnitHealth(unitAttachedTo[unitID]) + if h and mh then + Spring.SetUnitHealth(unitAttachedTo[unitID], h - damage) + end + damage = 0 + end + return damage, 1 end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) - for attachment, attachedTo in pairs(unitAttachedTo) do - if unitAttachedTo[attachment] == unitID then - table.insert(deleteAttachments, attachment) - end - end - if #deleteAttachments > 0 then - for i = 1, #deleteAttachments do - if deleteAttachments[i] then - unitAttachedTo[deleteAttachments[i]] = nil - Spring.DestroyUnit(deleteAttachments[i], false, true) - end - end - deleteAttachments = {} - end + for attachment, attachedTo in pairs(unitAttachedTo) do + if unitAttachedTo[attachment] == unitID then + table.insert(deleteAttachments, attachment) + end + end + if #deleteAttachments > 0 then + for i = 1, #deleteAttachments do + if deleteAttachments[i] then + unitAttachedTo[deleteAttachments[i]] = nil + Spring.DestroyUnit(deleteAttachments[i], false, true) + end + end + deleteAttachments = {} + end end function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if unitAttachments[unitDefID] then - for i = 1, #unitAttachments[unitDefID] do - local unitType = unitAttachments[unitDefID][i].unitType - local posx = unitAttachments[unitDefID][i].posx - local posz = unitAttachments[unitDefID][i].posz - local dir = unitAttachments[unitDefID][i].dir or 0 - local bx, by, bz = Spring.GetUnitPosition(unitID) - local attachmentID = Spring.CreateUnit(unitType, bx + posx, by, bz + posz, dir, unitTeam) - if attachmentID then - Spring.SetUnitBlocking(attachmentID, false, false) - unitAttachedTo[attachmentID] = unitID - end - end - end + if unitAttachments[unitDefID] then + for i = 1, #unitAttachments[unitDefID] do + local unitType = unitAttachments[unitDefID][i].unitType + local posx = unitAttachments[unitDefID][i].posx + local posz = unitAttachments[unitDefID][i].posz + local dir = unitAttachments[unitDefID][i].dir or 0 + local bx, by, bz = Spring.GetUnitPosition(unitID) + local attachmentID = Spring.CreateUnit(unitType, bx + posx, by, bz + posz, dir, unitTeam) + if attachmentID then + Spring.SetUnitBlocking(attachmentID, false, false) + unitAttachedTo[attachmentID] = unitID + end + end + end end function gadget:GameFrame(frame) - for attachment, attachedTo in pairs(unitAttachedTo) do - local h, mh = Spring.GetUnitHealth(attachedTo) - if h and mh then - Spring.SetUnitMaxHealth(attachment, mh) - Spring.SetUnitHealth(attachment, h) - end - end + for attachment, attachedTo in pairs(unitAttachedTo) do + local h, mh = Spring.GetUnitHealth(attachedTo) + if h and mh then + Spring.SetUnitMaxHealth(attachment, mh) + Spring.SetUnitHealth(attachment, h) + end + end end diff --git a/luarules/gadgets/pve_boss_drones.lua b/luarules/gadgets/pve_boss_drones.lua index aef5734479a..9a38e5a5abc 100644 --- a/luarules/gadgets/pve_boss_drones.lua +++ b/luarules/gadgets/pve_boss_drones.lua @@ -1,24 +1,24 @@ if not (Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers()) then - Spring.Echo("REMOVED PVE BOSS DRONES") + Spring.Echo("REMOVED PVE BOSS DRONES") return false end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "PvE Boss Drones", - desc = "Spawns and controls drones/minions for PvE enemies", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "PvE Boss Drones", + desc = "Spawns and controls drones/minions for PvE enemies", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local pveTeamID = Spring.Utilities.GetScavTeamID() or Spring.Utilities.GetRaptorTeamID() @@ -27,489 +27,489 @@ local raptorQueenCount = Spring.GetModOptions().raptor_queen_count local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") local unitListNames = { - -- Brood Raptors - ["raptor_land_swarmer_brood_t4_v1"] = { - [1] = { - name = "raptor_land_swarmer_brood_t3_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 120, - }, - [2] = { - name = "raptor_land_swarmer_brood_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 4, - maxAllowed = 4, - spawnTimer = 60, - }, - }, - ["raptor_land_swarmer_brood_t3_v1"] = { - [1] = { - name = "raptor_land_swarmer_brood_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 2, - maxAllowed = 2, - spawnTimer = 120, - }, - }, + -- Brood Raptors + ["raptor_land_swarmer_brood_t4_v1"] = { + [1] = { + name = "raptor_land_swarmer_brood_t3_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 120, + }, + [2] = { + name = "raptor_land_swarmer_brood_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 4, + maxAllowed = 4, + spawnTimer = 60, + }, + }, + ["raptor_land_swarmer_brood_t3_v1"] = { + [1] = { + name = "raptor_land_swarmer_brood_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 2, + maxAllowed = 2, + spawnTimer = 120, + }, + }, - -- Miniqueens - ["raptor_matriarch_basic"] = { - [1] = { - name = "raptor_land_swarmer_basic_t3_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_swarmer_basic_t3_v2", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - [3] = { - name = "raptor_land_swarmer_basic_t3_v3", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - [4] = { - name = "raptor_land_swarmer_basic_t4_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - [5] = { - name = "raptor_land_swarmer_basic_t4_v2", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - }, - ["raptor_matriarch_healer"] = { - [1] = { - name = "raptor_land_swarmer_heal_t1_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 4, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_swarmer_heal_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10, - }, - [3] = { - name = "raptor_land_swarmer_heal_t3_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10, - }, - [4] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 10, - }, - }, - ["raptor_matriarch_acid"] = { - [1] = { - name = "raptor_land_swarmer_acids_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 10, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_assault_acid_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10, - }, - [3] = { - name = "raptor_allterrain_arty_acid_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 10, - }, - }, - ["raptor_matriarch_electric"] = { - [1] = { - name = "raptor_land_swarmer_emp_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 10, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_assault_emp_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10, - }, - [3] = { - name = "raptor_allterrain_arty_emp_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 10, - }, - }, - ["raptor_matriarch_fire"] = { - [1] = { - name = "raptor_land_swarmer_fire_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 10, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_swarmer_fire_t4_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10, - }, - }, - ["raptor_matriarch_spectre"] = { - [1] = { - name = "raptor_land_swarmer_spectre_t3_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 5, - spawnTimer = 10, - }, - [2] = { - name = "raptor_land_assault_spectre_t2_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10, - }, - [3] = { - name = "raptor_land_spiker_spectre_t4_v1", - type = "ground", - spawnRadius = 100, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 5, - spawnTimer = 10, - }, - }, + -- Miniqueens + ["raptor_matriarch_basic"] = { + [1] = { + name = "raptor_land_swarmer_basic_t3_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_swarmer_basic_t3_v2", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + [3] = { + name = "raptor_land_swarmer_basic_t3_v3", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + [4] = { + name = "raptor_land_swarmer_basic_t4_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + [5] = { + name = "raptor_land_swarmer_basic_t4_v2", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + }, + ["raptor_matriarch_healer"] = { + [1] = { + name = "raptor_land_swarmer_heal_t1_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 4, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_swarmer_heal_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10, + }, + [3] = { + name = "raptor_land_swarmer_heal_t3_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10, + }, + [4] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 10, + }, + }, + ["raptor_matriarch_acid"] = { + [1] = { + name = "raptor_land_swarmer_acids_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 10, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_assault_acid_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10, + }, + [3] = { + name = "raptor_allterrain_arty_acid_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 10, + }, + }, + ["raptor_matriarch_electric"] = { + [1] = { + name = "raptor_land_swarmer_emp_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 10, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_assault_emp_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10, + }, + [3] = { + name = "raptor_allterrain_arty_emp_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 10, + }, + }, + ["raptor_matriarch_fire"] = { + [1] = { + name = "raptor_land_swarmer_fire_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 10, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_swarmer_fire_t4_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10, + }, + }, + ["raptor_matriarch_spectre"] = { + [1] = { + name = "raptor_land_swarmer_spectre_t3_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 5, + spawnTimer = 10, + }, + [2] = { + name = "raptor_land_assault_spectre_t2_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10, + }, + [3] = { + name = "raptor_land_spiker_spectre_t4_v1", + type = "ground", + spawnRadius = 100, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 5, + spawnTimer = 10, + }, + }, - -- Queens - ["raptor_queen_veryeasy"] = { - [1] = { - name = "raptor_air_fighter_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 1000, - spawnedPerWave = 1, - maxAllowed = 8, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 1000, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 1, - spawnTimer = 10*raptorQueenCount, - }, - }, - ["raptor_queen_easy"] = { - [1] = { - name = "raptor_air_fighter_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 12, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 2, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 2, - maxAllowed = 2, - spawnTimer = 10*raptorQueenCount, - }, - }, - ["raptor_queen_normal"] = { - [1] = { - name = "raptor_air_fighter_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 16, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t1_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 4, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 3, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 3, - maxAllowed = 3, - spawnTimer = 10*raptorQueenCount, - }, - }, - ["raptor_queen_hard"] = { - [1] = { - name = "raptor_air_fighter_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 20, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 5, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_air_kamikaze_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 10, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 4, - spawnTimer = 10*raptorQueenCount, - }, - [5] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 4, - maxAllowed = 4, - spawnTimer = 10*raptorQueenCount, - }, - }, - ["raptor_queen_veryhard"] = { - [1] = { - name = "raptor_air_fighter_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 24, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 6, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_air_kamikaze_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 12, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 5, - spawnTimer = 10*raptorQueenCount, - }, - [5] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 5, - maxAllowed = 5, - spawnTimer = 10*raptorQueenCount, - }, - }, - ["raptor_queen_epic"] = { - [1] = { - name = "raptor_air_fighter_basic_t4_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 28, - spawnTimer = 10*raptorQueenCount, - }, - [2] = { - name = "raptor_air_bomber_basic_t4_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 7, - spawnTimer = 10*raptorQueenCount, - }, - [3] = { - name = "raptor_air_kamikaze_basic_t2_v1", - type = "air", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 14, - spawnTimer = 10*raptorQueenCount, - }, - [4] = { - name = "raptor_land_swarmer_brood_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 1, - maxAllowed = 6, - spawnTimer = 10*raptorQueenCount, - }, - [5] = { - name = "raptor_land_swarmer_heal_t4_v1", - type = "ground", - spawnRadius = 500, - fightRadius = 500, - spawnedPerWave = 6, - maxAllowed = 6, - spawnTimer = 10*raptorQueenCount, - }, - }, + -- Queens + ["raptor_queen_veryeasy"] = { + [1] = { + name = "raptor_air_fighter_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 1000, + spawnedPerWave = 1, + maxAllowed = 8, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 1000, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 1, + spawnTimer = 10 * raptorQueenCount, + }, + }, + ["raptor_queen_easy"] = { + [1] = { + name = "raptor_air_fighter_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 12, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 2, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 2, + maxAllowed = 2, + spawnTimer = 10 * raptorQueenCount, + }, + }, + ["raptor_queen_normal"] = { + [1] = { + name = "raptor_air_fighter_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 16, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t1_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 4, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 3, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 3, + maxAllowed = 3, + spawnTimer = 10 * raptorQueenCount, + }, + }, + ["raptor_queen_hard"] = { + [1] = { + name = "raptor_air_fighter_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 20, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 5, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_air_kamikaze_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 10, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 4, + spawnTimer = 10 * raptorQueenCount, + }, + [5] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 4, + maxAllowed = 4, + spawnTimer = 10 * raptorQueenCount, + }, + }, + ["raptor_queen_veryhard"] = { + [1] = { + name = "raptor_air_fighter_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 24, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 6, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_air_kamikaze_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 12, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 5, + spawnTimer = 10 * raptorQueenCount, + }, + [5] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 5, + maxAllowed = 5, + spawnTimer = 10 * raptorQueenCount, + }, + }, + ["raptor_queen_epic"] = { + [1] = { + name = "raptor_air_fighter_basic_t4_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 28, + spawnTimer = 10 * raptorQueenCount, + }, + [2] = { + name = "raptor_air_bomber_basic_t4_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 7, + spawnTimer = 10 * raptorQueenCount, + }, + [3] = { + name = "raptor_air_kamikaze_basic_t2_v1", + type = "air", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 14, + spawnTimer = 10 * raptorQueenCount, + }, + [4] = { + name = "raptor_land_swarmer_brood_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 1, + maxAllowed = 6, + spawnTimer = 10 * raptorQueenCount, + }, + [5] = { + name = "raptor_land_swarmer_heal_t4_v1", + type = "ground", + spawnRadius = 500, + fightRadius = 500, + spawnedPerWave = 6, + maxAllowed = 6, + spawnTimer = 10 * raptorQueenCount, + }, + }, } -- convert unitname -> unitDefID local unitList = {} @@ -520,88 +520,84 @@ for name, params in pairs(unitListNames) do end unitListNames = nil - local aliveCarriers = {} local aliveDrones = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if unitList[unitDefID] and (unitTeam == pveTeamID) then - aliveCarriers[unitID] = {} - for i = 1,#unitList[unitDefID] do - aliveCarriers[unitID][i] = { - aliveDrones = 0, - lastSpawned = Spring.GetGameSeconds() - } - end - end + if unitList[unitDefID] and (unitTeam == pveTeamID) then + aliveCarriers[unitID] = {} + for i = 1, #unitList[unitDefID] do + aliveCarriers[unitID][i] = { + aliveDrones = 0, + lastSpawned = Spring.GetGameSeconds(), + } + end + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if aliveCarriers[unitID] then - aliveCarriers[unitID] = nil - for droneID, stats in pairs(aliveDrones) do - if stats.owner == unitID then - aliveDrones[droneID].owner = nil - aliveDrones[droneID].ownerDefID = nil - end - end - end - if aliveDrones[unitID] then - if aliveCarriers[aliveDrones[unitID].owner] then - aliveCarriers[aliveDrones[unitID].owner][aliveDrones[unitID].index].aliveDrones = aliveCarriers[aliveDrones[unitID].owner][aliveDrones[unitID].index].aliveDrones - 1 - end - aliveDrones[unitID] = nil - end + if aliveCarriers[unitID] then + aliveCarriers[unitID] = nil + for droneID, stats in pairs(aliveDrones) do + if stats.owner == unitID then + aliveDrones[droneID].owner = nil + aliveDrones[droneID].ownerDefID = nil + end + end + end + if aliveDrones[unitID] then + if aliveCarriers[aliveDrones[unitID].owner] then + aliveCarriers[aliveDrones[unitID].owner][aliveDrones[unitID].index].aliveDrones = aliveCarriers[aliveDrones[unitID].owner][aliveDrones[unitID].index].aliveDrones - 1 + end + aliveDrones[unitID] = nil + end end function gadget:GameFrame(frame) - if frame%30 == 13 then - for unitID, unitDroneStats in pairs(aliveCarriers) do - local unitDefID = Spring.GetUnitDefID(unitID) - for index, stats in pairs(unitDroneStats) do - if stats.aliveDrones <= (unitList[unitDefID][index].maxAllowed - unitList[unitDefID][index].spawnedPerWave) and Spring.GetGameSeconds() >= stats.lastSpawned + unitList[unitDefID][index].spawnTimer then - for _ = 1,unitList[unitDefID][index].spawnedPerWave do - local x,y,z = Spring.GetUnitPosition(unitID) - local spawnx = x + math.random(-unitList[unitDefID][index].spawnRadius, unitList[unitDefID][index].spawnRadius) - local spawny = y - local spawnz = z + math.random(-unitList[unitDefID][index].spawnRadius, unitList[unitDefID][index].spawnRadius) - if (unitList[unitDefID][index].type == "air" and UnitDefNames[unitList[unitDefID][index].name].canFly) or - (unitList[unitDefID][index].type == "ground" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true)) or - (unitList[unitDefID][index].type == "land" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true) and Spring.GetGroundHeight(spawnx, spawnz) > 0) or - (unitList[unitDefID][index].type == "sea" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true) and Spring.GetGroundHeight(spawnx, spawnz) <= 0) then - local droneID = Spring.CreateUnit(unitList[unitDefID][index].name, spawnx, spawny, spawnz, math.random(0,3), Spring.GetUnitTeam(unitID)) - if droneID then - aliveDrones[droneID] = { - owner = unitID, - ownerDefID = unitDefID, - index = index, - fightRadius = unitList[unitDefID][index].fightRadius, - } - aliveCarriers[unitID][index].aliveDrones = aliveCarriers[unitID][index].aliveDrones + 1 - aliveCarriers[unitID][index].lastSpawned = Spring.GetGameSeconds() - Spring.GiveOrderToUnit(droneID,37382,{1},0) - --Spring.GiveOrderToUnit(droneID, CMD.MOVE_STATE, 2, 0) - end - end - end - end - end - end - end + if frame % 30 == 13 then + for unitID, unitDroneStats in pairs(aliveCarriers) do + local unitDefID = Spring.GetUnitDefID(unitID) + for index, stats in pairs(unitDroneStats) do + if stats.aliveDrones <= (unitList[unitDefID][index].maxAllowed - unitList[unitDefID][index].spawnedPerWave) and Spring.GetGameSeconds() >= stats.lastSpawned + unitList[unitDefID][index].spawnTimer then + for _ = 1, unitList[unitDefID][index].spawnedPerWave do + local x, y, z = Spring.GetUnitPosition(unitID) + local spawnx = x + math.random(-unitList[unitDefID][index].spawnRadius, unitList[unitDefID][index].spawnRadius) + local spawny = y + local spawnz = z + math.random(-unitList[unitDefID][index].spawnRadius, unitList[unitDefID][index].spawnRadius) + if (unitList[unitDefID][index].type == "air" and UnitDefNames[unitList[unitDefID][index].name].canFly) or (unitList[unitDefID][index].type == "ground" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true)) or (unitList[unitDefID][index].type == "land" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true) and Spring.GetGroundHeight(spawnx, spawnz) > 0) or (unitList[unitDefID][index].type == "sea" and positionCheckLibrary.FlatAreaCheck(spawnx, spawny, spawnz, 64, 30, true) and Spring.GetGroundHeight(spawnx, spawnz) <= 0) then + local droneID = Spring.CreateUnit(unitList[unitDefID][index].name, spawnx, spawny, spawnz, math.random(0, 3), Spring.GetUnitTeam(unitID)) + if droneID then + aliveDrones[droneID] = { + owner = unitID, + ownerDefID = unitDefID, + index = index, + fightRadius = unitList[unitDefID][index].fightRadius, + } + aliveCarriers[unitID][index].aliveDrones = aliveCarriers[unitID][index].aliveDrones + 1 + aliveCarriers[unitID][index].lastSpawned = Spring.GetGameSeconds() + Spring.GiveOrderToUnit(droneID, 37382, { 1 }, 0) + --Spring.GiveOrderToUnit(droneID, CMD.MOVE_STATE, 2, 0) + end + end + end + end + end + end + end - if frame%30 == 14 then - for droneID, stats in pairs(aliveDrones) do - if stats.owner then - local x,y,z = Spring.GetUnitPosition(stats.owner) - if math.random(0,4) == 0 then - Spring.GiveOrderToUnit(droneID, CMD.PATROL, {x+math.random(-stats.fightRadius, stats.fightRadius), y, z+math.random(-stats.fightRadius, stats.fightRadius)} , {"shift"}) - elseif math.random(0,6) == 0 then - Spring.GiveOrderToUnit(droneID, CMD.PATROL, {x+math.random(-stats.fightRadius, stats.fightRadius), y, z+math.random(-stats.fightRadius, stats.fightRadius)} , {}) - end - else - if math.random(0,10) == 0 then - Spring.GiveOrderToUnit(droneID, CMD.PATROL, {math.random(0, Game.mapSizeX), 0, math.random(0, Game.mapSizeZ)} , {"shift"}) - end - end - end - end + if frame % 30 == 14 then + for droneID, stats in pairs(aliveDrones) do + if stats.owner then + local x, y, z = Spring.GetUnitPosition(stats.owner) + if math.random(0, 4) == 0 then + Spring.GiveOrderToUnit(droneID, CMD.PATROL, { x + math.random(-stats.fightRadius, stats.fightRadius), y, z + math.random(-stats.fightRadius, stats.fightRadius) }, { "shift" }) + elseif math.random(0, 6) == 0 then + Spring.GiveOrderToUnit(droneID, CMD.PATROL, { x + math.random(-stats.fightRadius, stats.fightRadius), y, z + math.random(-stats.fightRadius, stats.fightRadius) }, {}) + end + else + if math.random(0, 10) == 0 then + Spring.GiveOrderToUnit(droneID, CMD.PATROL, { math.random(0, Game.mapSizeX), 0, math.random(0, Game.mapSizeZ) }, { "shift" }) + end + end + end + end end diff --git a/luarules/gadgets/pve_boss_priority_targetting.lua b/luarules/gadgets/pve_boss_priority_targetting.lua index 07f63796e31..4454e1ee9c3 100644 --- a/luarules/gadgets/pve_boss_priority_targetting.lua +++ b/luarules/gadgets/pve_boss_priority_targetting.lua @@ -1,45 +1,44 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Raptor Queen Anti-Dgun behavior", - desc = "Queen will prioritize targetting nearby commander so it doesn't let itself be dgunned", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Raptor Queen Anti-Dgun behavior", + desc = "Queen will prioritize targetting nearby commander so it doesn't let itself be dgunned", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local queenUnitDefs = { - raptor_queen_veryeasy = true, - raptor_queen_easy = true, - raptor_queen_normal = true, - raptor_queen_hard = true, - raptor_queen_veryhard = true, - raptor_queen_epic = true, + raptor_queen_veryeasy = true, + raptor_queen_easy = true, + raptor_queen_normal = true, + raptor_queen_hard = true, + raptor_queen_veryhard = true, + raptor_queen_epic = true, - raptor_matriarch_spectre = true, + raptor_matriarch_spectre = true, raptor_matriarch_electric = true, raptor_matriarch_acid = true, raptor_matriarch_healer = true, raptor_matriarch_basic = true, raptor_matriarch_fire = true, - scavengerbossv4_veryeasy_scav = true, - scavengerbossv4_easy_scav = true, - scavengerbossv4_normal_scav = true, - scavengerbossv4_hard_scav = true, - scavengerbossv4_veryhard_scav = true, - scavengerbossv4_epic_scav = true, + scavengerbossv4_veryeasy_scav = true, + scavengerbossv4_easy_scav = true, + scavengerbossv4_normal_scav = true, + scavengerbossv4_hard_scav = true, + scavengerbossv4_veryhard_scav = true, + scavengerbossv4_epic_scav = true, } - local queenUnits = {} for unitDefName, isqueen in pairs(queenUnitDefs) do if UnitDefNames[unitDefName] then @@ -50,45 +49,44 @@ queenUnitDefs = nil local queenTargets = {} for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.customParams.iscommander or unitDef.customParams.isscavcommander then - queenTargets[unitDefID] = true - end + if unitDef.customParams.iscommander or unitDef.customParams.isscavcommander then + queenTargets[unitDefID] = true + end end - local aliveQueens = {} local aliveTargets = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if queenUnits[unitDefID] then - aliveQueens[unitID] = true - end - if queenTargets[unitDefID] then - aliveTargets[unitID] = true - end + if queenUnits[unitDefID] then + aliveQueens[unitID] = true + end + if queenTargets[unitDefID] then + aliveTargets[unitID] = true + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if aliveQueens[unitID] then - aliveQueens[unitID] = nil - end - if aliveTargets[unitID] then - aliveTargets[unitID] = nil - end + if aliveQueens[unitID] then + aliveQueens[unitID] = nil + end + if aliveTargets[unitID] then + aliveTargets[unitID] = nil + end end function gadget:GameFrame(frame) - if frame%30 == 21 then - for queenID, _ in pairs(aliveQueens) do - local queenx,queeny,queenz = Spring.GetUnitPosition(queenID) - local queenTeamID = Spring.GetUnitTeam(queenID) - local surroundingUnits = CallAsTeam(queenTeamID, Spring.GetUnitsInSphere, queenx, queeny, queenz, 750, -4) - for i = 1,#surroundingUnits do + if frame % 30 == 21 then + for queenID, _ in pairs(aliveQueens) do + local queenx, queeny, queenz = Spring.GetUnitPosition(queenID) + local queenTeamID = Spring.GetUnitTeam(queenID) + local surroundingUnits = CallAsTeam(queenTeamID, Spring.GetUnitsInSphere, queenx, queeny, queenz, 750, -4) + for i = 1, #surroundingUnits do if aliveTargets[surroundingUnits[i]] then - Spring.GiveOrderToUnit(queenID, CMD.STOP, 0, 0) - Spring.GiveOrderToUnit(queenID, CMD.ATTACK, {surroundingUnits[i]}, 0) - break - end - end - end - end + Spring.GiveOrderToUnit(queenID, CMD.STOP, 0, 0) + Spring.GiveOrderToUnit(queenID, CMD.ATTACK, { surroundingUnits[i] }, 0) + break + end + end + end + end end diff --git a/luarules/gadgets/pve_builder_controller.lua b/luarules/gadgets/pve_builder_controller.lua index 9844ef4be28..b21955ff6b1 100644 --- a/luarules/gadgets/pve_builder_controller.lua +++ b/luarules/gadgets/pve_builder_controller.lua @@ -8,18 +8,18 @@ function gadget:GetInfo() date = "2024", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end if not gadgetHandler:IsSyncedCode() then - return + return end if Spring.Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") elseif Spring.Utilities.Gametype.IsScavengers() then - Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") return false @@ -29,66 +29,66 @@ local scavengerAITeamID = Spring.Utilities.GetScavTeamID() local builderDefs = {} for unitDefID, data in pairs(UnitDefs) do - if data.buildOptions and #data.buildOptions > 0 and (not data.customParams.nopvebuilder) then + if data.buildOptions and #data.buildOptions > 0 and not data.customParams.nopvebuilder then builderDefs[unitDefID] = { - range = data.builddistance or 256, - buildOptions = data.buildOptions, - unitDefID = unitDefID, - unitDefName = data.name, - isFactory = data.isFactory, - } + range = data.builddistance or 256, + buildOptions = data.buildOptions, + unitDefID = unitDefID, + unitDefName = data.name, + isFactory = data.isFactory, + } end end local aliveBuilders = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam) - --if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID or unitTeam == raptorsAITeamID) then - if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID) then - aliveBuilders[unitID] = builderDefs[unitDefID] - end + --if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID or unitTeam == raptorsAITeamID) then + if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID) then + aliveBuilders[unitID] = builderDefs[unitDefID] + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) - if aliveBuilders[unitID] then - aliveBuilders[unitID] = nil - end + if aliveBuilders[unitID] then + aliveBuilders[unitID] = nil + end end local lastTurretFrame = 0 function gadget:GameFrame(frame) - if frame > lastTurretFrame + 150 then - if frame%30 == 9 then - for unitID, data in pairs(aliveBuilders) do - if (Spring.GetUnitNearestEnemy(unitID, data.range*5, true) and math.random(0,15) == 0) or (data.isFactory) then - --Spring.Echo(data.unitDefName, "NearestEnemyInRange") + if frame > lastTurretFrame + 150 then + if frame % 30 == 9 then + for unitID, data in pairs(aliveBuilders) do + if (Spring.GetUnitNearestEnemy(unitID, data.range * 5, true) and math.random(0, 15) == 0) or data.isFactory then + --Spring.Echo(data.unitDefName, "NearestEnemyInRange") local unitCommands = not data.isFactory and Spring.GetUnitCommands(unitID, 1) or {} - if (data.isFactory and #Spring.GetFullBuildQueue(unitID) < 5) or (not data.isFactory and (not unitCommands[1] or (unitCommands[1] and unitCommands[1].id > 0 and unitCommands[1].id ~= CMD.REPAIR))) then - --Spring.Echo(data.unitDefName, "Isn't building anything") - local turretOptions = {} - for buildOptionIndex, buildOptionID in pairs(data.buildOptions) do - --Spring.Echo("buildOptionID", buildOptionID, UnitDefs[buildOptionID].name) - if buildOptionID and (((not UnitDefs[buildOptionID].canAssist) and (not UnitDefs[buildOptionID].isFactory)) or (math.random(1,20) == 1 and UnitDefs[buildOptionID].isFactory)) then - turretOptions[#turretOptions+1] = buildOptionID - --Spring.Echo(data.unitDefName, UnitDefs[buildOptionID].name, "Is a turret") - end - end - if #turretOptions > 1 then - local turret = turretOptions[math.random(1, #turretOptions)] - local x,y,z = Spring.GetUnitPosition(unitID) - Spring.GiveOrderToUnit(unitID, -turret, {x+math.random(-data.range, data.range), y, z+math.random(-data.range, data.range)}, {}) - if data.isFactory then - for i = 1,math.random(1,5) do - Spring.GiveOrderToUnit(unitID, -turret, {x+math.random(-data.range, data.range), y, z+math.random(-data.range, data.range)}, {}) - end - else - lastTurretFrame = frame - break - end - end - end - end - end - end - end + if (data.isFactory and #Spring.GetFullBuildQueue(unitID) < 5) or (not data.isFactory and (not unitCommands[1] or (unitCommands[1] and unitCommands[1].id > 0 and unitCommands[1].id ~= CMD.REPAIR))) then + --Spring.Echo(data.unitDefName, "Isn't building anything") + local turretOptions = {} + for buildOptionIndex, buildOptionID in pairs(data.buildOptions) do + --Spring.Echo("buildOptionID", buildOptionID, UnitDefs[buildOptionID].name) + if buildOptionID and (((not UnitDefs[buildOptionID].canAssist) and not UnitDefs[buildOptionID].isFactory) or (math.random(1, 20) == 1 and UnitDefs[buildOptionID].isFactory)) then + turretOptions[#turretOptions + 1] = buildOptionID + --Spring.Echo(data.unitDefName, UnitDefs[buildOptionID].name, "Is a turret") + end + end + if #turretOptions > 1 then + local turret = turretOptions[math.random(1, #turretOptions)] + local x, y, z = Spring.GetUnitPosition(unitID) + Spring.GiveOrderToUnit(unitID, -turret, { x + math.random(-data.range, data.range), y, z + math.random(-data.range, data.range) }, {}) + if data.isFactory then + for i = 1, math.random(1, 5) do + Spring.GiveOrderToUnit(unitID, -turret, { x + math.random(-data.range, data.range), y, z + math.random(-data.range, data.range) }, {}) + end + else + lastTurretFrame = frame + break + end + end + end + end + end + end + end end diff --git a/luarules/gadgets/pve_nuke_controller.lua b/luarules/gadgets/pve_nuke_controller.lua index 8b290b6e718..c4331e922c2 100644 --- a/luarules/gadgets/pve_nuke_controller.lua +++ b/luarules/gadgets/pve_nuke_controller.lua @@ -8,22 +8,22 @@ function gadget:GetInfo() date = "2023", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end if not gadgetHandler:IsSyncedCode() then - return + return end local difficulty = "normal" if Spring.Utilities.Gametype.IsRaptors() then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") - difficulty = Spring.GetModOptions().raptor_difficulty + difficulty = Spring.GetModOptions().raptor_difficulty elseif Spring.Utilities.Gametype.IsScavengers() then - Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") - difficulty = Spring.GetModOptions().scav_difficulty + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") + difficulty = Spring.GetModOptions().scav_difficulty else Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") return false @@ -54,138 +54,140 @@ end local aliveNukeLaunchers = {} local targetUnits = {} local targetUnitIndex = {} -local attackCmdParams = {0, 0, 0} +local attackCmdParams = { 0, 0, 0 } local function AddTargetUnit(unitID) - if not targetUnitIndex[unitID] then - targetUnits[#targetUnits + 1] = unitID - targetUnitIndex[unitID] = #targetUnits - end + if not targetUnitIndex[unitID] then + targetUnits[#targetUnits + 1] = unitID + targetUnitIndex[unitID] = #targetUnits + end end local function RemoveTargetUnit(unitID) - local index = targetUnitIndex[unitID] - if not index then - return - end - - local lastIndex = #targetUnits - local lastUnitID = targetUnits[lastIndex] - targetUnits[index] = lastUnitID - targetUnitIndex[lastUnitID] = index - targetUnits[lastIndex] = nil - targetUnitIndex[unitID] = nil + local index = targetUnitIndex[unitID] + if not index then + return + end + + local lastIndex = #targetUnits + local lastUnitID = targetUnits[lastIndex] + targetUnits[index] = lastUnitID + targetUnitIndex[lastUnitID] = index + targetUnits[lastIndex] = nil + targetUnitIndex[unitID] = nil end local function UpdateTrackedUnit(unitID, unitDefID, unitTeam) - if nukeDefs[unitDefID] and unitTeam == pveTeamID then - aliveNukeLaunchers[unitID] = GetGameSeconds() + math.random(5,10) - RemoveTargetUnit(unitID) - return - end - - aliveNukeLaunchers[unitID] = nil - if unitTeam ~= pveTeamID then - AddTargetUnit(unitID) - else - RemoveTargetUnit(unitID) - end + if nukeDefs[unitDefID] and unitTeam == pveTeamID then + aliveNukeLaunchers[unitID] = GetGameSeconds() + math.random(5, 10) + RemoveTargetUnit(unitID) + return + end + + aliveNukeLaunchers[unitID] = nil + if unitTeam ~= pveTeamID then + AddTargetUnit(unitID) + else + RemoveTargetUnit(unitID) + end end function gadget:Initialize() - local allUnits = GetAllUnits() - for i = 1, #allUnits do - local unitID = allUnits[i] - UpdateTrackedUnit(unitID, GetUnitDefID(unitID), GetUnitTeam(unitID)) - end + local allUnits = GetAllUnits() + for i = 1, #allUnits do + local unitID = allUnits[i] + UpdateTrackedUnit(unitID, GetUnitDefID(unitID), GetUnitTeam(unitID)) + end end function gadget:UnitGiven(unitID, unitDefID, unitTeam) - UpdateTrackedUnit(unitID, unitDefID, unitTeam) + UpdateTrackedUnit(unitID, unitDefID, unitTeam) end function gadget:UnitTaken(unitID, unitDefID, unitTeam) - UpdateTrackedUnit(unitID, unitDefID, unitTeam) + UpdateTrackedUnit(unitID, unitDefID, unitTeam) end function gadget:UnitCreated(unitID, unitDefID, unitTeam) - UpdateTrackedUnit(unitID, unitDefID, unitTeam) + UpdateTrackedUnit(unitID, unitDefID, unitTeam) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) - aliveNukeLaunchers[unitID] = nil - RemoveTargetUnit(unitID) + aliveNukeLaunchers[unitID] = nil + RemoveTargetUnit(unitID) end local difficulties = { veryeasy = 1500, - easy = 1000, - normal = 800, - hard = 700, + easy = 1000, + normal = 800, + hard = 700, veryhard = 600, - epic = 500, + epic = 500, } local gridSize = difficulties[difficulty] local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ local targetGridCells = {} -local numOfCellsX = math.ceil(mapSizeX/gridSize) -local numOfCellsZ = math.ceil(mapSizeZ/gridSize) +local numOfCellsX = math.ceil(mapSizeX / gridSize) +local numOfCellsZ = math.ceil(mapSizeZ / gridSize) for cellX = 1, numOfCellsX do - for cellZ = 1, numOfCellsZ do - if not targetGridCells[cellX] then targetGridCells[cellX] = {} end - targetGridCells[cellX][cellZ] = { - -- xmin = (cellX-1)*gridSize, - -- zmin = (cellZ-1)*gridSize, - -- xmax = cellX*gridSize, - -- zmax = cellZ*gridSize, - locked = 0, - } - end + for cellZ = 1, numOfCellsZ do + if not targetGridCells[cellX] then + targetGridCells[cellX] = {} + end + targetGridCells[cellX][cellZ] = { + -- xmin = (cellX-1)*gridSize, + -- zmin = (cellZ-1)*gridSize, + -- xmax = cellX*gridSize, + -- zmax = cellZ*gridSize, + locked = 0, + } + end end local function checkTargetCell(posx, posz, now) - local cellX = math.ceil(posx/gridSize) - local cellZ = math.ceil(posz/gridSize) - local cellData = targetGridCells[cellX][cellZ] - if cellData.locked < now then - cellData.locked = now + math.random(180,300) - return true - end - return false + local cellX = math.ceil(posx / gridSize) + local cellZ = math.ceil(posz / gridSize) + local cellData = targetGridCells[cellX][cellZ] + if cellData.locked < now then + cellData.locked = now + math.random(180, 300) + return true + end + return false end function gadget:GameFrame(frame) - if frame%30 ~= 17 then - return - end - - local now = GetGameSeconds() - local targetCount = #targetUnits - if targetCount == 0 then - return - end - - for nukeID, cooldown in pairs(aliveNukeLaunchers) do - if cooldown <= now then - local targetID = targetUnits[math.random(1, targetCount)] - if targetID and GetUnitTeam(targetID) ~= GetUnitTeam(nukeID) then - local x, y, z = GetUnitPosition(targetID) - if x and z then - x = x + math.random(-1024,1024) - z = z + math.random(-1024,1024) - if x > 0 and x < mapSizeX and z > 0 and z < mapSizeZ and checkTargetCell(x, z, now) then - y = math.max(GetGroundHeight(x, z), 0) - attackCmdParams[1] = x - attackCmdParams[2] = y - attackCmdParams[3] = z - GiveOrderToUnit(nukeID, CMD.ATTACK, attackCmdParams, 0) - aliveNukeLaunchers[nukeID] = now + math.random(10,90) - end - end - end - end - end + if frame % 30 ~= 17 then + return + end + + local now = GetGameSeconds() + local targetCount = #targetUnits + if targetCount == 0 then + return + end + + for nukeID, cooldown in pairs(aliveNukeLaunchers) do + if cooldown <= now then + local targetID = targetUnits[math.random(1, targetCount)] + if targetID and GetUnitTeam(targetID) ~= GetUnitTeam(nukeID) then + local x, y, z = GetUnitPosition(targetID) + if x and z then + x = x + math.random(-1024, 1024) + z = z + math.random(-1024, 1024) + if x > 0 and x < mapSizeX and z > 0 and z < mapSizeZ and checkTargetCell(x, z, now) then + y = math.max(GetGroundHeight(x, z), 0) + attackCmdParams[1] = x + attackCmdParams[2] = y + attackCmdParams[3] = z + GiveOrderToUnit(nukeID, CMD.ATTACK, attackCmdParams, 0) + aliveNukeLaunchers[nukeID] = now + math.random(10, 90) + end + end + end + end + end end diff --git a/luarules/gadgets/pve_supply_drops.lua b/luarules/gadgets/pve_supply_drops.lua index 5752a38b10f..abfca829da2 100644 --- a/luarules/gadgets/pve_supply_drops.lua +++ b/luarules/gadgets/pve_supply_drops.lua @@ -21,26 +21,24 @@ else lootboxSpawnEnabled = false end - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "supply drops", - desc = "123", - author = "Damgam", - date = "2020", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = true, - } + return { + name = "supply drops", + desc = "123", + author = "Damgam", + date = "2020", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then return false end - local isLootbox = {} local lootboxTierByName = {} -- Map lootbox name to tier for fast lookup local unitDefNameCache = {} -- Cache unit names by unitDefID @@ -67,46 +65,45 @@ local lootboxesListT2 = {} local lootboxesListT3 = {} local lootboxesListT4 = {} if scavengersAIEnabled then - lootboxesListT1[#lootboxesListT1+1] = "lootboxbronze_scav" - lootboxesListT2[#lootboxesListT2+1] = "lootboxsilver_scav" - lootboxesListT3[#lootboxesListT3+1] = "lootboxgold_scav" - lootboxesListT4[#lootboxesListT4+1] = "lootboxplatinum_scav" + lootboxesListT1[#lootboxesListT1 + 1] = "lootboxbronze_scav" + lootboxesListT2[#lootboxesListT2 + 1] = "lootboxsilver_scav" + lootboxesListT3[#lootboxesListT3 + 1] = "lootboxgold_scav" + lootboxesListT4[#lootboxesListT4 + 1] = "lootboxplatinum_scav" else - lootboxesListT1[#lootboxesListT1+1] = "lootboxbronze" - lootboxesListT2[#lootboxesListT2+1] = "lootboxsilver" - lootboxesListT3[#lootboxesListT3+1] = "lootboxgold" - lootboxesListT4[#lootboxesListT4+1] = "lootboxplatinum" + lootboxesListT1[#lootboxesListT1 + 1] = "lootboxbronze" + lootboxesListT2[#lootboxesListT2 + 1] = "lootboxsilver" + lootboxesListT3[#lootboxesListT3 + 1] = "lootboxgold" + lootboxesListT4[#lootboxesListT4 + 1] = "lootboxplatinum" end - -- locals -local mapsizeX = Game.mapSizeX -local mapsizeZ = Game.mapSizeZ -local xBorder = math.floor(mapsizeX/10) -local zBorder = math.floor(mapsizeZ/10) -local math_random = math.random -local spGroundHeight = Spring.GetGroundHeight -local spGaiaTeam = Spring.GetGaiaTeamID() -local spGaiaAllyTeam = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID())) -local spCreateUnit = Spring.CreateUnit -local spSetUnitNeutral = Spring.SetUnitNeutral +local mapsizeX = Game.mapSizeX +local mapsizeZ = Game.mapSizeZ +local xBorder = math.floor(mapsizeX / 10) +local zBorder = math.floor(mapsizeZ / 10) +local math_random = math.random +local spGroundHeight = Spring.GetGroundHeight +local spGaiaTeam = Spring.GetGaiaTeamID() +local spGaiaAllyTeam = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID())) +local spCreateUnit = Spring.CreateUnit +local spSetUnitNeutral = Spring.SetUnitNeutral local spSetUnitAlwaysVisible = Spring.SetUnitAlwaysVisible -local spSpawnCEG = Spring.SpawnCEG -local spPlaySoundFile = Spring.PlaySoundFile -local spGetUnitPosition = Spring.GetUnitPosition +local spSpawnCEG = Spring.SpawnCEG +local spPlaySoundFile = Spring.PlaySoundFile +local spGetUnitPosition = Spring.GetUnitPosition -- Use hash tables instead of arrays for O(1) lookup -local aliveLootboxes = {} -local aliveLootboxesCount = 0 - -local aliveLootboxesT1 = {} -local aliveLootboxesCountT1 = 0 -local aliveLootboxesT2 = {} -local aliveLootboxesCountT2 = 0 -local aliveLootboxesT3 = {} -local aliveLootboxesCountT3 = 0 -local aliveLootboxesT4 = {} -local aliveLootboxesCountT4 = 0 +local aliveLootboxes = {} +local aliveLootboxesCount = 0 + +local aliveLootboxesT1 = {} +local aliveLootboxesCountT1 = 0 +local aliveLootboxesT2 = {} +local aliveLootboxesCountT2 = 0 +local aliveLootboxesT3 = {} +local aliveLootboxesCountT3 = 0 +local aliveLootboxesT4 = {} +local aliveLootboxesCountT4 = 0 local aliveLootboxCaptureDifficulty = {} local aliveLootboxTier = {} -- Cache tier for each lootbox @@ -123,7 +120,7 @@ elseif lootboxesDensity == "normal" then end local numTeams = math.max(#teams - 1, 1) -local SpawnChance = math.ceil((150/lootboxDensityMultiplier)/numTeams) +local SpawnChance = math.ceil((150 / lootboxDensityMultiplier) / numTeams) if scavengersAIEnabled then spGaiaTeam = scavengerAITeamID @@ -142,24 +139,23 @@ local nearbyCaptureLibrary = VFS.Include("luarules/utilities/damgam_lib/nearby_c -- end -- end - -- callins local function SpawnLootbox(posx, posy, posz) - if math.random() < math.min(0.8, (aliveLootboxesCountT3*0.4)/(#teams-1)) then - lootboxToSpawn = lootboxesListT4[math_random(1,#lootboxesListT4)] - elseif math.random() < math.min(0.8, (aliveLootboxesCountT2*0.4)/(#teams-1)) then - lootboxToSpawn = lootboxesListT3[math_random(1,#lootboxesListT3)] - elseif math.random() < math.min(0.8, (aliveLootboxesCountT1*0.4)/(#teams-1)) then - lootboxToSpawn = lootboxesListT2[math_random(1,#lootboxesListT2)] + if math.random() < math.min(0.8, (aliveLootboxesCountT3 * 0.4) / (#teams - 1)) then + lootboxToSpawn = lootboxesListT4[math_random(1, #lootboxesListT4)] + elseif math.random() < math.min(0.8, (aliveLootboxesCountT2 * 0.4) / (#teams - 1)) then + lootboxToSpawn = lootboxesListT3[math_random(1, #lootboxesListT3)] + elseif math.random() < math.min(0.8, (aliveLootboxesCountT1 * 0.4) / (#teams - 1)) then + lootboxToSpawn = lootboxesListT2[math_random(1, #lootboxesListT2)] else - lootboxToSpawn = lootboxesListT1[math_random(1,#lootboxesListT1)] + lootboxToSpawn = lootboxesListT1[math_random(1, #lootboxesListT1)] end - local spawnedUnit = spCreateUnit(lootboxToSpawn, posx, posy, posz, math_random(0,3), spGaiaTeam) + local spawnedUnit = spCreateUnit(lootboxToSpawn, posx, posy, posz, math_random(0, 3), spGaiaTeam) if scavengersAIEnabled then - spCreateUnit("lootdroppod_gold_scav", posx, posy, posz, math_random(0,3), spGaiaTeam) + spCreateUnit("lootdroppod_gold_scav", posx, posy, posz, math_random(0, 3), spGaiaTeam) else - spCreateUnit("lootdroppod_gold", posx, posy, posz, math_random(0,3), spGaiaTeam) + spCreateUnit("lootdroppod_gold", posx, posy, posz, math_random(0, 3), spGaiaTeam) end if spawnedUnit then spSetUnitNeutral(spawnedUnit, true) @@ -174,26 +170,25 @@ local function SpawnLootbox(posx, posy, posz) end function gadget:GameFrame(n) - - if n%30 == 0 and n > 2 then - if SpawnChance < 1 or math.random(0,SpawnChance) == 0 then - LootboxesToSpawn = LootboxesToSpawn+0.1 + if n % 30 == 0 and n > 2 then + if SpawnChance < 1 or math.random(0, SpawnChance) == 0 then + LootboxesToSpawn = LootboxesToSpawn + 0.1 if LootboxesToSpawn < 0 then LootboxesToSpawn = 0 end end - if aliveLootboxesCount > 0 then + if aliveLootboxesCount > 0 then for lootboxID, _ in pairs(aliveLootboxes) do nearbyCaptureLibrary.NearbyCapture(lootboxID, aliveLootboxCaptureDifficulty[lootboxID], 1024) end - end - if LootboxesToSpawn >= 1 and lootboxSpawnEnabled then + end + if LootboxesToSpawn >= 1 and lootboxSpawnEnabled then --Spring.Echo("LOOTBOXES ENABLED, We're Spawning!") - for k = 1,20 do - local posx = math.floor(math_random(xBorder,mapsizeX-xBorder)/16)*16 - local posz = math.floor(math_random(zBorder,mapsizeZ-zBorder)/16)*16 - local posy = spGroundHeight(posx, posz) + for k = 1, 20 do + local posx = math.floor(math_random(xBorder, mapsizeX - xBorder) / 16) * 16 + local posz = math.floor(math_random(zBorder, mapsizeZ - zBorder) / 16) * 16 + local posy = spGroundHeight(posx, posz) local canSpawnLootbox = positionCheckLibrary.FlatAreaCheck(posx, posy, posz, 128) if canSpawnLootbox then canSpawnLootbox = positionCheckLibrary.OccupancyCheck(posx, posy, posz, 128) @@ -201,22 +196,21 @@ function gadget:GameFrame(n) if canSpawnLootbox then canSpawnLootbox = positionCheckLibrary.VisibilityCheckEnemy(posx, posy, posz, 32, spGaiaAllyTeam, true, true, false) end - if canSpawnLootbox then + if canSpawnLootbox then SpawnLootbox(posx, posy, posz) - break - end - end - end - end + break + end + end + end + end end - function gadget:UnitCreated(unitID, unitDefID, unitTeam) local UnitName = unitDefNameCache[unitDefID] if isLootbox[unitDefID] then spSetUnitNeutral(unitID, true) spSetUnitAlwaysVisible(unitID, true) - LootboxesToSpawn = LootboxesToSpawn-1 + LootboxesToSpawn = LootboxesToSpawn - 1 aliveLootboxes[unitID] = true aliveLootboxesCount = aliveLootboxesCount + 1 @@ -246,14 +240,13 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) if UnitName == "lootdroppod_gold" or UnitName == "lootdroppod_gold_scav" then spSetUnitNeutral(unitID, true) spSetUnitAlwaysVisible(unitID, true) - Spring.GiveOrderToUnit(unitID, CMD.SELFD,{}, {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.SELFD, {}, { "shift" }) end end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if aliveLootboxes[unitID] then - LootboxesToSpawn = LootboxesToSpawn+0.5 + LootboxesToSpawn = LootboxesToSpawn + 0.5 aliveLootboxes[unitID] = nil aliveLootboxesCount = aliveLootboxesCount - 1 aliveLootboxCaptureDifficulty[unitID] = nil @@ -282,7 +275,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD local posx, posy, posz = spGetUnitPosition(unitID) SpawnLootbox(posx, posy, posz) else - LootboxesToSpawn = LootboxesToSpawn+0.33 + LootboxesToSpawn = LootboxesToSpawn + 0.33 end end end diff --git a/luarules/gadgets/raptor_spawner_defense.lua b/luarules/gadgets/raptor_spawner_defense.lua index 5b345cbed76..aad55650b05 100644 --- a/luarules/gadgets/raptor_spawner_defense.lua +++ b/luarules/gadgets/raptor_spawner_defense.lua @@ -1,4 +1,3 @@ - if Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers() then Spring.Log("Raptor Defense Spawner", LOG.INFO, "Raptor Defense Spawner Activated!") else @@ -16,12 +15,12 @@ function gadget:GetInfo() date = "27 February, 2012", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end -local config = VFS.Include('LuaRules/Configs/raptor_spawn_defs.lua') -local EnemyLib = VFS.Include('LuaRules/Gadgets/Include/SpawnerEnemyLib.lua') +local config = VFS.Include("LuaRules/Configs/raptor_spawn_defs.lua") +local EnemyLib = VFS.Include("LuaRules/Gadgets/Include/SpawnerEnemyLib.lua") -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -34,12 +33,24 @@ if gadgetHandler:IsSyncedCode() then if tracy == nil then --Spring.Echo("Gadgetside tracy: No support detected, replacing tracy.* with function stubs.") tracy = {} - tracy.ZoneBeginN = function () return end - tracy.ZoneBegin = function () return end - tracy.ZoneEnd = function () return end --Spring.Echo("No Tracy") return end - tracy.Message = function () return end - tracy.ZoneName = function () return end - tracy.ZoneText = function () return end + tracy.ZoneBeginN = function() + return + end + tracy.ZoneBegin = function() + return + end + tracy.ZoneEnd = function() + return + end --Spring.Echo("No Tracy") return end + tracy.Message = function() + return + end + tracy.ZoneName = function() + return + end + tracy.ZoneText = function() + return + end end -- @@ -106,7 +117,7 @@ if gadgetHandler:IsSyncedCode() then local nSpawnedQueens = 0 local nTotalQueens = modOptions.raptor_queen_count or 1 local maxTries = 30 - local raptorUnitCap = math.floor(Game.maxUnits*0.8) + local raptorUnitCap = math.floor(Game.maxUnits * 0.8) local minBurrows = 1 local timeOfLastSpawn = -999999 local timeOfLastWave = 0 @@ -128,26 +139,26 @@ if gadgetHandler:IsSyncedCode() then waveAirPercentage = 20, waveSpecialPercentage = 33, airWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, specialWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, basicWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, smallWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, largerWave = { - cooldown = mRandom(10,30), + cooldown = mRandom(10, 30), }, hugeWave = { - cooldown = mRandom(15,50), + cooldown = mRandom(15, 50), }, epicWave = { - cooldown = mRandom(20,75), - } + cooldown = mRandom(20, 75), + }, } local squadSpawnOptions = config.squadSpawnOptionsTable --local miniBossCooldown = 0 @@ -169,7 +180,7 @@ if gadgetHandler:IsSyncedCode() then currentlyStaggered = false, } local queenIDs = {} - local bosses = {resistances = queenResistance, statuses = {}, playerDamages = {}} + local bosses = { resistances = queenResistance, statuses = {}, playerDamages = {} } local raptorTeamID = Spring.Utilities.GetRaptorTeamID() local raptorAllyTeamID = Spring.Utilities.GetRaptorAllyTeamID() local lsx1, lsz1, lsx2, lsz2 = 0, 0, Game.mapSizeX, Game.mapSizeZ @@ -184,7 +195,7 @@ if gadgetHandler:IsSyncedCode() then local squadCreationQueue = { units = {}, role = false, - life = math.ceil(10*modOptions.raptor_spawntimemult), + life = math.ceil(10 * modOptions.raptor_spawntimemult), regroupenabled = true, regrouping = false, needsregroup = false, @@ -193,18 +204,17 @@ if gadgetHandler:IsSyncedCode() then squadCreationQueueDefaults = { units = {}, role = false, - life = math.ceil(10*modOptions.raptor_spawntimemult), + life = math.ceil(10 * modOptions.raptor_spawntimemult), regroupenabled = true, regrouping = false, needsregroup = false, needsrefresh = true, } - local isObject = {} UnitDefStaggerMultiplier = {} for udefID, def in ipairs(UnitDefs) do - if def.modCategories['object'] or def.customParams.objectify then + if def.modCategories["object"] or def.customParams.objectify then isObject[udefID] = true end if def.customParams.bossStaggerMultiplier then @@ -232,14 +242,14 @@ if gadgetHandler:IsSyncedCode() then local function PutRaptorAlliesInRaptorTeam(n) local players = GetPlayerList() - for i = 1,#players do + for i = 1, #players do local player = players[i] local name, active, spectator, teamID, allyTeamID = GetPlayerInfo(player, false) - if allyTeamID == raptorAllyTeamID and (not spectator) then + if allyTeamID == raptorAllyTeamID and not spectator then AssignPlayerToTeam(player, raptorTeamID) local units = GetTeamUnits(teamID) raptorteamhasplayers = true - for u = 1,#units do + for u = 1, #units do DestroyUnit(units[u], false, true) end KillTeam(teamID) @@ -247,12 +257,12 @@ if gadgetHandler:IsSyncedCode() then end local raptorAllies = GetTeamList(raptorAllyTeamID) - for i = 1,#raptorAllies do - local _,_,_,AI = GetTeamInfo(raptorAllies[i], false) + for i = 1, #raptorAllies do + local _, _, _, AI = GetTeamInfo(raptorAllies[i], false) local LuaAI = GetTeamLuaAI(raptorAllies[i]) if (AI or LuaAI) and raptorAllies[i] ~= raptorTeamID then local units = GetTeamUnits(raptorAllies[i]) - for u = 1,#units do + for u = 1, #units do DestroyUnit(units[u], false, true) KillTeam(raptorAllies[i]) end @@ -265,7 +275,7 @@ if gadgetHandler:IsSyncedCode() then -- -- Utility - local SetListUtilities = VFS.Include('common/SetList.lua') + local SetListUtilities = VFS.Include("common/SetList.lua") function SetToList(set) local list = {} @@ -301,7 +311,7 @@ if gadgetHandler:IsSyncedCode() then local ecoTierMaxProbability = 1 - for weight,units in pairs(squadTargetsByEcoWeight) do + for weight, units in pairs(squadTargetsByEcoWeight) do ecoTierMaxProbability = ecoTierMaxProbability + weight * units.count end @@ -310,8 +320,7 @@ if gadgetHandler:IsSyncedCode() then -- 10 tries to find a valid target for try = 1, 10 do - - for weight,units in pairs(squadTargetsByEcoWeight) do + for weight, units in pairs(squadTargetsByEcoWeight) do if units.count then ecoTierMaxProbability = ecoTierMaxProbability + weight * units.count @@ -320,8 +329,8 @@ if gadgetHandler:IsSyncedCode() then if ValidUnitID(target) and not GetUnitIsDead(target) and not GetUnitNeutral(target) then -- Spring.Echo("Targetting eco: " .. random .. " found " .. UnitDefs[Spring.GetUnitDefID(target)].name); - local x,y,z = GetUnitPosition(target) - pos = {x = x+mRandom(-32,32), y = y, z = z+mRandom(-32,32)} + local x, y, z = GetUnitPosition(target) + pos = { x = x + mRandom(-32, 32), y = y, z = z + mRandom(-32, 32) } pickedTarget = target break end @@ -344,29 +353,28 @@ if gadgetHandler:IsSyncedCode() then function setRaptorXP(unitID) local maxXP = config.maxXP local queenAnger = queenAnger or 0 - local xp = mRandom(0, math.ceil((queenAnger*0.01) * maxXP * 1000))*0.001 + local xp = mRandom(0, math.ceil((queenAnger * 0.01) * maxXP * 1000)) * 0.001 SetUnitExperience(unitID, xp) return xp end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Difficulty - -- + -- config.gracePeriodInitial = config.gracePeriod + 0 - local maxBurrows = ((config.maxBurrows*(1-config.raptorPerPlayerMultiplier))+(config.maxBurrows*config.raptorPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)))*config.raptorSpawnMultiplier + local maxBurrows = ((config.maxBurrows * (1 - config.raptorPerPlayerMultiplier)) + (config.maxBurrows * config.raptorPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8))) * config.raptorSpawnMultiplier local queenTime = (config.queenTime + config.gracePeriod) - local maxWaveSize = ((config.maxRaptors*(1-config.raptorPerPlayerMultiplier))+(config.maxRaptors*config.raptorPerPlayerMultiplier)*SetCount(humanTeams))*config.raptorSpawnMultiplier - local minWaveSize = ((config.minRaptors*(1-config.raptorPerPlayerMultiplier))+(config.minRaptors*config.raptorPerPlayerMultiplier)*SetCount(humanTeams))*config.raptorSpawnMultiplier + local maxWaveSize = ((config.maxRaptors * (1 - config.raptorPerPlayerMultiplier)) + (config.maxRaptors * config.raptorPerPlayerMultiplier) * SetCount(humanTeams)) * config.raptorSpawnMultiplier + local minWaveSize = ((config.minRaptors * (1 - config.raptorPerPlayerMultiplier)) + (config.minRaptors * config.raptorPerPlayerMultiplier) * SetCount(humanTeams)) * config.raptorSpawnMultiplier local currentMaxWaveSize = minWaveSize local endlessLoopCounter = 1 local pastFirstQueen = false function updateDifficultyForSurvival() t = GetGameSeconds - config.gracePeriod = t-1 - queenAnger = 0 -- reenable raptor spawning + config.gracePeriod = t - 1 + queenAnger = 0 -- reenable raptor spawning techAnger = 0 playerAggression = 0 queenAngerAggressionLevel = 0 @@ -390,10 +398,10 @@ if gadgetHandler:IsSyncedCode() then else difficultyCounter = difficultyCounter - 1 nextDifficulty = config.difficultyParameters[difficultyCounter] - config.raptorSpawnMultiplier = config.raptorSpawnMultiplier+1 - config.queenResistanceMult = config.queenResistanceMult+0.5 - config.damageMod = config.damageMod+0.25 - config.healthMod = config.healthMod+0.25 + config.raptorSpawnMultiplier = config.raptorSpawnMultiplier + 1 + config.queenResistanceMult = config.queenResistanceMult + 0.5 + config.damageMod = config.damageMod + 0.25 + config.healthMod = config.healthMod + 0.25 end config.queenName = nextDifficulty.queenName config.burrowSpawnRate = nextDifficulty.burrowSpawnRate @@ -405,7 +413,7 @@ if gadgetHandler:IsSyncedCode() then config.maxBurrows = nextDifficulty.maxBurrows config.maxXP = nextDifficulty.maxXP config.angerBonus = nextDifficulty.angerBonus - config.queenTime = math.ceil(nextDifficulty.queenTime/(endlessLoopCounter/2)) + config.queenTime = math.ceil(nextDifficulty.queenTime / (endlessLoopCounter / 2)) queenStagger = { Health = nextDifficulty.queenStagger.health, CurrentHealth = nextDifficulty.queenStagger.health - 1, @@ -415,12 +423,12 @@ if gadgetHandler:IsSyncedCode() then } queenTime = (config.queenTime + config.gracePeriod) - maxBurrows = ((config.maxBurrows*(1-config.raptorPerPlayerMultiplier))+(config.maxBurrows*config.raptorPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)))*config.raptorSpawnMultiplier - maxWaveSize = ((config.maxRaptors*(1-config.raptorPerPlayerMultiplier))+(config.maxRaptors*config.raptorPerPlayerMultiplier)*SetCount(humanTeams))*config.raptorSpawnMultiplier - minWaveSize = ((config.minRaptors*(1-config.raptorPerPlayerMultiplier))+(config.minRaptors*config.raptorPerPlayerMultiplier)*SetCount(humanTeams))*config.raptorSpawnMultiplier + maxBurrows = ((config.maxBurrows * (1 - config.raptorPerPlayerMultiplier)) + (config.maxBurrows * config.raptorPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8))) * config.raptorSpawnMultiplier + maxWaveSize = ((config.maxRaptors * (1 - config.raptorPerPlayerMultiplier)) + (config.maxRaptors * config.raptorPerPlayerMultiplier) * SetCount(humanTeams)) * config.raptorSpawnMultiplier + minWaveSize = ((config.minRaptors * (1 - config.raptorPerPlayerMultiplier)) + (config.minRaptors * config.raptorPerPlayerMultiplier) * SetCount(humanTeams)) * config.raptorSpawnMultiplier config.raptorSpawnRate = nextDifficulty.raptorSpawnRate currentMaxWaveSize = minWaveSize - SetGameRulesParam("RaptorQueenAngerGain_Base", 100/config.queenTime) + SetGameRulesParam("RaptorQueenAngerGain_Base", 100 / config.queenTime) end -------------------------------------------------------------------------------- @@ -434,11 +442,10 @@ if gadgetHandler:IsSyncedCode() then SetGameRulesParam("raptorTechAnger", math.floor(techAnger)) SetGameRulesParam("raptorGracePeriod", config.gracePeriod) SetGameRulesParam("raptorDifficulty", config.difficulty) - SetGameRulesParam("RaptorQueenAngerGain_Base", 100/config.queenTime) + SetGameRulesParam("RaptorQueenAngerGain_Base", 100 / config.queenTime) SetGameRulesParam("RaptorQueenAngerGain_Aggression", 0) SetGameRulesParam("RaptorQueenAngerGain_Eco", 0) - local function raptorEvent(type, num, tech) SendToUnsynced("RaptorEvent", type, num, tech) end @@ -450,7 +457,7 @@ if gadgetHandler:IsSyncedCode() then -- local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") - local RaptorStartboxXMin, RaptorStartboxZMin, RaptorStartboxXMax, RaptorStartboxZMax = EnemyLib.GetAdjustedStartBox(raptorAllyTeamID, config.burrowSize*1.5*spawnAreaMultiplier) + local RaptorStartboxXMin, RaptorStartboxZMin, RaptorStartboxXMax, RaptorStartboxZMax = EnemyLib.GetAdjustedStartBox(raptorAllyTeamID, config.burrowSize * 1.5 * spawnAreaMultiplier) --[[ @@ -472,8 +479,7 @@ if gadgetHandler:IsSyncedCode() then ]] function squadManagerKillerLoop() -- Kills squads that have been alive for too long (most likely stuck somewhere on the map) --squadsTable - for i = 1,#squadsTable do - + for i = 1, #squadsTable do squadsTable[i].squadLife = squadsTable[i].squadLife - 1 if squadsTable[i].squadLife < 3 and squadsTable[i].squadRegroupEnabled then squadsTable[i].squadRegroupEnabled = false @@ -493,11 +499,11 @@ if gadgetHandler:IsSyncedCode() then local destroyQueue = {} for j, unitID in pairs(squadsTable[i].squadUnits) do if unitID then - destroyQueue[#destroyQueue+1] = unitID + destroyQueue[#destroyQueue + 1] = unitID -- Spring.Echo("Killing old unit. ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) end end - for j = 1,#destroyQueue do + for j = 1, #destroyQueue do -- Spring.Echo("Destroying Unit. ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) if GetUnitTeam(destroyQueue[j]) == raptorTeamID then DestroyUnit(destroyQueue[j], true, false) @@ -510,7 +516,6 @@ if gadgetHandler:IsSyncedCode() then end end - --or GetGameSeconds <= config.gracePeriod function squadCommanderGiveOrders(squadID, targetx, targety, targetz) tracy.ZoneBeginN("Raptors:squadCommanderGiveOrders") @@ -527,11 +532,19 @@ if gadgetHandler:IsSyncedCode() then local count = 0 for i, unitID in pairs(units) do if ValidUnitID(unitID) and not GetUnitIsDead(unitID) and not GetUnitNeutral(unitID) then - local x,y,z = GetUnitPosition(unitID) - if x < xmin then xmin = x end - if z < zmin then zmin = z end - if x > xmax then xmax = x end - if z > zmax then zmax = z end + local x, y, z = GetUnitPosition(unitID) + if x < xmin then + xmin = x + end + if z < zmin then + zmin = z + end + if x > xmax then + xmax = x + end + if z > zmax then + zmax = z + end xsum = xsum + x zsum = zsum + z count = count + 1 @@ -539,9 +552,9 @@ if gadgetHandler:IsSyncedCode() then end -- Calculate average unit position if count > 0 then - local xaverage = xsum/count - local zaverage = zsum/count - if xmin < xaverage-512 or xmax > xaverage+512 or zmin < zaverage-512 or zmax > zaverage+512 then + local xaverage = xsum / count + local zaverage = zsum / count + if xmin < xaverage - 512 or xmax > xaverage + 512 or zmin < zaverage - 512 or zmax > zaverage + 512 then targetx = xaverage targetz = zaverage targety = GetGroundHeight(targetx, targetz) @@ -555,19 +568,18 @@ if gadgetHandler:IsSyncedCode() then squadsTable[squadID].squadNeedsRegroup = false end - - if (squadsTable[squadID].squadNeedsRefresh) or (squadsTable[squadID].squadNeedsRegroup == true and squadsTable[squadID].squadRegrouping == false) or (squadsTable[squadID].squadNeedsRegroup == false and squadsTable[squadID].squadRegrouping == true) then + if squadsTable[squadID].squadNeedsRefresh or (squadsTable[squadID].squadNeedsRegroup == true and squadsTable[squadID].squadRegrouping == false) or (squadsTable[squadID].squadNeedsRegroup == false and squadsTable[squadID].squadRegrouping == true) then for i, unitID in pairs(units) do if ValidUnitID(unitID) and not GetUnitIsDead(unitID) and not GetUnitNeutral(unitID) then -- Spring.Echo("GiveOrderToUnit #" .. i) if not unitCowardCooldown[unitID] then if role == "assault" or role == "healer" or role == "artillery" then - GiveOrderToUnit(unitID, CMD.FIGHT, {targetx+mRandom(-256, 256), targety, targetz+mRandom(-256, 256)} , {}) + GiveOrderToUnit(unitID, CMD.FIGHT, { targetx + mRandom(-256, 256), targety, targetz + mRandom(-256, 256) }, {}) elseif role == "raid" then - GiveOrderToUnit(unitID, CMD.MOVE, {targetx+mRandom(-256, 256), targety, targetz+mRandom(-256, 256)} , {}) + GiveOrderToUnit(unitID, CMD.MOVE, { targetx + mRandom(-256, 256), targety, targetz + mRandom(-256, 256) }, {}) elseif role == "aircraft" or role == "kamikaze" then local pos = getRandomEnemyPos() - GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x, pos.y, pos.z} , {}) + GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x, pos.y, pos.z }, {}) end end end @@ -604,14 +616,14 @@ if gadgetHandler:IsSyncedCode() then squadID = 1 -- Spring.Echo("First squad, #".. squadID) else - for i = 1,#squadsTable do + for i = 1, #squadsTable do -- Spring.Echo("Attempt to recycle squad #" .. i .. ". Containing " .. SetCount(squadsTable[i].squadUnits) .. " units.") if SetCount(squadsTable[i].squadUnits) == 0 then -- Yes, we found one empty squad to recycle squadID = i -- Spring.Echo("Recycled squad, #".. squadID) break elseif i == #squadsTable then -- No, there's no empty squad, we need to create new one - squadID = i+1 + squadID = i + 1 -- Spring.Echo("Created new squad, #".. squadID) end end @@ -620,17 +632,16 @@ if gadgetHandler:IsSyncedCode() then if squadID ~= 0 then -- If it's 0 then we f***** up somewhere local role = "assault" if not newSquad.role then - if mRandom(0,100) <= 60 then + if mRandom(0, 100) <= 60 then role = "raid" end else role = newSquad.role end if not newSquad.life then - newSquad.life = math.ceil(10*modOptions.raptor_spawntimemult) + newSquad.life = math.ceil(10 * modOptions.raptor_spawntimemult) end - squadsTable[squadID] = { squadUnits = newSquad.units, squadLife = newSquad.life, @@ -645,7 +656,7 @@ if gadgetHandler:IsSyncedCode() then -- Spring.Echo("Created Raptor Squad, containing " .. #squadsTable[squadID].squadUnits .. " units!") -- Spring.Echo("Role: " .. squadsTable[squadID].squadRole) -- Spring.Echo("Lifetime: " .. squadsTable[squadID].squadLife) - for i = 1,SetCount(squadsTable[squadID].squadUnits) do + for i = 1, SetCount(squadsTable[squadID].squadUnits) do local unitID = squadsTable[squadID].squadUnits[i] unitSquadTable[unitID] = squadID -- Spring.Echo("#".. i ..", ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) @@ -660,8 +671,8 @@ if gadgetHandler:IsSyncedCode() then end function manageAllSquads() -- Get new target for all squads that need it - for i = 1,#squadsTable do - if mRandom(1,100) == 1 then + for i = 1, #squadsTable do + if mRandom(1, 100) == 1 then local hasTarget = false for squad, target in pairs(unitTargetPool) do if i == squad then @@ -676,7 +687,6 @@ if gadgetHandler:IsSyncedCode() then end end - function getRaptorSpawnLoc(burrowID, size) if not burrowID then return false @@ -697,19 +707,18 @@ if gadgetHandler:IsSyncedCode() then tries = tries + 1 if x >= MAPSIZEX then x = (MAPSIZEX - mRandom(1, 40)) - elseif (x <= 0) then + elseif x <= 0 then x = mRandom(1, 40) end if z >= MAPSIZEZ then z = (MAPSIZEZ - mRandom(1, 40)) - elseif (z <= 0) then + elseif z <= 0 then z = mRandom(1, 40) end until (TestBuildOrder(size, x, by, z, 1) == 2 and not GetGroundBlocked(x, z)) or (tries > maxTries) y = GetGroundHeight(x, z) return x, y, z - end function SpawnRandomOffWaveSquad(burrowID, raptorType, count) @@ -718,7 +727,9 @@ if gadgetHandler:IsSyncedCode() then end local squadCounter = 0 if raptorType then - if not count then count = 1 end + if not count then + count = 1 + end if UnitDefNames[raptorType] then for j = 1, count, 1 do if mRandom() <= config.spawnChance or j == 1 then @@ -734,12 +745,11 @@ if gadgetHandler:IsSyncedCode() then else squadCounter = 0 local squad - local specialRandom = mRandom(1,100) - for _ = 1,1000 do + local specialRandom = mRandom(1, 100) + for _ = 1, 1000 do if specialRandom <= waveParameters.waveSpecialPercentage then local potentialSquad = squadSpawnOptions.special[mRandom(1, #squadSpawnOptions.special)] - if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= techAnger and math.max(40, potentialSquad.maxAnger-30) >= techAnger) then -- Super Squad + if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= techAnger and math.max(40, potentialSquad.maxAnger - 30) >= techAnger) then -- Super Squad squad = potentialSquad break end @@ -784,12 +794,12 @@ if gadgetHandler:IsSyncedCode() then tracy.ZoneBeginN("Raptors:SpawnBurrow") for i = 1, (number or 1) do local canSpawnBurrow = false - local spread = config.burrowSize*1.5 + local spread = config.burrowSize * 1.5 local spawnPosX, spawnPosY, spawnPosZ if config.useScum then -- Attempt #1, find position in creep/scum (skipped if creep is disabled or alwaysbox is enabled) if spread < MAPSIZEX - spread and spread < MAPSIZEZ - spread then - for _ = 1,100 do + for _ = 1, 100 do spawnPosX = mRandom(spread, MAPSIZEX - spread) spawnPosZ = mRandom(spread, MAPSIZEZ - spread) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -809,7 +819,7 @@ if gadgetHandler:IsSyncedCode() then if (not canSpawnBurrow) and config.burrowSpawnType ~= "avoid" then -- Attempt #2 Force spawn in Startbox, ignore any kind of player vision local spreadStartBox = math.clamp(spread, 0, 0.5 * math.min(RaptorStartboxXMax - RaptorStartboxXMin, RaptorStartboxZMax - RaptorStartboxZMin)) - for _ = 1,100 do + for _ = 1, 100 do spawnPosX = mRandom(RaptorStartboxXMin + spreadStartBox, RaptorStartboxXMax - spreadStartBox) spawnPosZ = mRandom(RaptorStartboxZMin + spreadStartBox, RaptorStartboxZMax - spreadStartBox) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -834,8 +844,8 @@ if gadgetHandler:IsSyncedCode() then spawnMinX, spawnMaxX = math.min(spawnMinX, spawnMaxX), math.max(spawnMinX, spawnMaxX) spawnMinZ, spawnMaxZ = math.min(spawnMinZ, spawnMaxZ), math.max(spawnMinZ, spawnMaxZ) - if (not canSpawnBurrow) then -- Attempt #3 Find some good position in Spawnbox (not Startbox) - for _ = 1,100 do + if not canSpawnBurrow then -- Attempt #3 Find some good position in Spawnbox (not Startbox) + for _ = 1, 100 do spawnPosX = mRandom(spawnMinX, spawnMaxX) spawnPosZ = mRandom(spawnMinZ, spawnMaxZ) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -856,8 +866,7 @@ if gadgetHandler:IsSyncedCode() then end if config.burrowSpawnType == "avoid" then -- Last Resort for Avoid Players burrow setup. Spawns anywhere that isn't in player sensor range - - for _ = 1,100 do -- Attempt #1 Avoid all sensors + for _ = 1, 100 do -- Attempt #1 Avoid all sensors spawnPosX = mRandom(spawnMinX, spawnMaxX) spawnPosZ = mRandom(spawnMinZ, spawnMaxZ) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -873,8 +882,8 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #2 Don't avoid radars - for _ = 1,100 do + if not canSpawnBurrow then -- Attempt #2 Don't avoid radars + for _ = 1, 100 do spawnPosX = mRandom(spawnMinX, spawnMaxX) spawnPosZ = mRandom(spawnMinZ, spawnMaxZ) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -891,8 +900,8 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #3 Only avoid LoS - for _ = 1,100 do + if not canSpawnBurrow then -- Attempt #3 Only avoid LoS + for _ = 1, 100 do spawnPosX = mRandom(spawnMinX, spawnMaxX) spawnPosZ = mRandom(spawnMinZ, spawnMaxZ) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -909,13 +918,13 @@ if gadgetHandler:IsSyncedCode() then end end end - if (canSpawnBurrow and GetGameSeconds < config.gracePeriodInitial*0.9) or (canSpawnBurrow and config.burrowSpawnType == "avoid") then -- Don't spawn new burrows in existing creep during grace period - Force them to spread as much as they can..... AT LEAST THAT'S HOW IT'S SUPPOSED TO WORK, lol. + if (canSpawnBurrow and GetGameSeconds < config.gracePeriodInitial * 0.9) or (canSpawnBurrow and config.burrowSpawnType == "avoid") then -- Don't spawn new burrows in existing creep during grace period - Force them to spread as much as they can..... AT LEAST THAT'S HOW IT'S SUPPOSED TO WORK, lol. canSpawnBurrow = not GG.IsPosInRaptorScum(spawnPosX, spawnPosY, spawnPosZ) end if canSpawnBurrow then foundLocation = true - local burrowID = CreateUnit(config.burrowName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0,3), raptorTeamID) + local burrowID = CreateUnit(config.burrowName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0, 3), raptorTeamID) if burrowID then SetupBurrow(burrowID, spawnPosX, spawnPosY, spawnPosZ) end @@ -937,7 +946,7 @@ if gadgetHandler:IsSyncedCode() then totalMaxHealth = totalMaxHealth + status.maxHealth else local health, maxHealth = GetUnitHealth(bossID) - table.mergeInPlace(status, {health = health, maxHealth = maxHealth}) + table.mergeInPlace(status, { health = health, maxHealth = maxHealth }) totalHealth = totalHealth + health aliveBossesMaxHealth = aliveBossesMaxHealth + maxHealth @@ -946,12 +955,11 @@ if gadgetHandler:IsSyncedCode() then end if SetCount(queenIDs) > 0 then - if queenStagger.currentlyStaggered == false then if queenStagger.CurrentHealth > 0 then - SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((queenStagger.CurrentHealth/queenStagger.Health)*100)) + SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((queenStagger.CurrentHealth / queenStagger.Health) * 100)) for queenID, _ in pairs(queenIDs) do - Spring.SetUnitHealth(queenID, {paralyze = 0}) + Spring.SetUnitHealth(queenID, { paralyze = 0 }) end else queenStagger.currentlyStaggered = true @@ -959,32 +967,32 @@ if gadgetHandler:IsSyncedCode() then for queenID, _ in pairs(queenIDs) do local ux, uy, uz = Spring.GetUnitPosition(queenID) Spring.AddUnitDamage(queenID, 0, 1600000) - Spring.SetUnitHealth(queenID, {paralyze = 16000000}) - for j = 1,50 do + Spring.SetUnitHealth(queenID, { paralyze = 16000000 }) + for j = 1, 50 do if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-1000, 1000), uy+100, uz+math.random(-1000, 1000)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-1000, 1000), uy + 100, uz + math.random(-1000, 1000)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-1000, 1000), uy+100, uz+math.random(-1000, 1000), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-1000, 1000), uy + 100, uz + math.random(-1000, 1000), 0, 0, 0) end end end - SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((1 - (queenStagger.CurrentTimer/queenStagger.Time))*100)) + SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((1 - (queenStagger.CurrentTimer / queenStagger.Time)) * 100)) end end if queenStagger.currentlyStaggered == true then queenStagger.CurrentTimer = queenStagger.CurrentTimer - 1 if queenStagger.CurrentTimer > 0 then - SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((1 - (queenStagger.CurrentTimer/queenStagger.Time))*100)) + SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((1 - (queenStagger.CurrentTimer / queenStagger.Time)) * 100)) for queenID, _ in pairs(queenIDs) do local ux, uy, uz = Spring.GetUnitPosition(queenID) Spring.AddUnitDamage(queenID, 0, 1600000) - Spring.SetUnitHealth(queenID, {paralyze = 16000000}) - for j = 1,10 do + Spring.SetUnitHealth(queenID, { paralyze = 16000000 }) + for j = 1, 10 do if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500), 0, 0, 0) end end end @@ -992,9 +1000,9 @@ if gadgetHandler:IsSyncedCode() then queenStagger.currentlyStaggered = false queenStagger.Time = queenStagger.Time + 5 queenStagger.CurrentTimer = queenStagger.Time + 0 - queenStagger.Health = queenStagger.Health*1.1 + queenStagger.Health = queenStagger.Health * 1.1 queenStagger.CurrentHealth = queenStagger.Health - SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((queenStagger.CurrentHealth/queenStagger.Health)*100)) + SetGameRulesParam("raptorQueenStaggerPercentage", math.ceil((queenStagger.CurrentHealth / queenStagger.Health) * 100)) end end @@ -1012,7 +1020,7 @@ if gadgetHandler:IsSyncedCode() then SetGameRulesParam("raptorQueenHealth", 0) RaptorQueenHealthPercentage = 0 end - + SetGameRulesParam("pveBossInfo", Json.encode(bosses)) end @@ -1025,7 +1033,7 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(burrowID) if x and y and z and not queenIDs[burrowID] then local score = 0 - score = mRandom(1,1000) + score = mRandom(1, 1000) if score > bestScore then bestScore = score bestBurrowID = burrowID @@ -1040,7 +1048,7 @@ if gadgetHandler:IsSyncedCode() then --if bestBurrowID then -- DestroyUnit(bestBurrowID, true, false) --end - return CreateUnit(config.queenName, sx, sy, sz, mRandom(0,3), raptorTeamID), burrowID + return CreateUnit(config.queenName, sx, sy, sz, mRandom(0, 3), raptorTeamID), burrowID end local x, z, y @@ -1054,7 +1062,7 @@ if gadgetHandler:IsSyncedCode() then canSpawnQueen = positionCheckLibrary.FlatAreaCheck(x, y, z, 128, 30, true) if canSpawnQueen then - if tries < maxTries*3 then + if tries < maxTries * 3 then canSpawnQueen = positionCheckLibrary.VisibilityCheckEnemy(x, y, z, config.burrowSize, raptorAllyTeamID, true, true, true) else canSpawnQueen = positionCheckLibrary.VisibilityCheckEnemy(x, y, z, config.burrowSize, raptorAllyTeamID, true, true, false) @@ -1062,19 +1070,19 @@ if gadgetHandler:IsSyncedCode() then end if canSpawnQueen then - canSpawnQueen = positionCheckLibrary.OccupancyCheck(x, y, z, config.burrowSize*0.25) + canSpawnQueen = positionCheckLibrary.OccupancyCheck(x, y, z, config.burrowSize * 0.25) end if canSpawnQueen then canSpawnQueen = positionCheckLibrary.MapEdgeCheck(x, y, z, 256) end - until (canSpawnQueen == true or tries >= maxTries * 6) + until canSpawnQueen == true or tries >= maxTries * 6 if canSpawnQueen then - return CreateUnit(config.queenName, x, y, z, mRandom(0,3), raptorTeamID) + return CreateUnit(config.queenName, x, y, z, mRandom(0, 3), raptorTeamID) else - for i = 1,100 do + for i = 1, 100 do x = mRandom(RaptorStartboxXMin, RaptorStartboxXMax) z = mRandom(RaptorStartboxZMin, RaptorStartboxZMax) y = GetGroundHeight(x, z) @@ -1090,7 +1098,7 @@ if gadgetHandler:IsSyncedCode() then canSpawnQueen = positionCheckLibrary.OccupancyCheck(x, y, z, 128) end if canSpawnQueen then - return CreateUnit(config.queenName, x, y, z, mRandom(0,3), raptorTeamID) + return CreateUnit(config.queenName, x, y, z, mRandom(0, 3), raptorTeamID) end end end @@ -1098,8 +1106,6 @@ if gadgetHandler:IsSyncedCode() then end function Wave() - - if gameOver then return end @@ -1115,92 +1121,77 @@ if gadgetHandler:IsSyncedCode() then waveParameters.hugeWave.cooldown = waveParameters.hugeWave.cooldown - 1 waveParameters.epicWave.cooldown = waveParameters.epicWave.cooldown - 1 - waveParameters.waveSpecialPercentage = mRandom(5,25) - waveParameters.waveAirPercentage = mRandom(5,33) + waveParameters.waveSpecialPercentage = mRandom(5, 25) + waveParameters.waveAirPercentage = mRandom(5, 33) - waveParameters.waveSizeMultiplier = mRandom(5,20)*0.1 - waveParameters.waveTimeMultiplier = mRandom(5,20)*0.1 + waveParameters.waveSizeMultiplier = mRandom(5, 20) * 0.1 + waveParameters.waveTimeMultiplier = mRandom(5, 20) * 0.1 if waveParameters.baseCooldown <= 0 then -- special waves if techAnger > config.airStartAnger and waveParameters.airWave.cooldown <= 0 and mRandom() <= config.spawnChance then + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.airWave.cooldown = mRandom(0, 10) - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.airWave.cooldown = mRandom(0,10) - - waveParameters.waveSpecialPercentage = mRandom(5,25) + waveParameters.waveSpecialPercentage = mRandom(5, 25) waveParameters.waveAirPercentage = 75 waveParameters.waveSizeMultiplier = 2 waveParameters.waveTimeMultiplier = 2 - elseif waveParameters.specialWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.specialWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.specialWave.cooldown = mRandom(0, 10) waveParameters.waveSpecialPercentage = 50 - waveParameters.waveAirPercentage = mRandom(5,33) + waveParameters.waveAirPercentage = mRandom(5, 33) waveParameters.waveSizeMultiplier = 2 waveParameters.waveTimeMultiplier = 2 - elseif waveParameters.basicWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.basicWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.basicWave.cooldown = mRandom(0, 10) waveParameters.waveSpecialPercentage = 0 waveParameters.waveAirPercentage = 0 waveParameters.waveSizeMultiplier = 2 waveParameters.waveTimeMultiplier = 2 - elseif waveParameters.smallWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.smallWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.smallWave.cooldown = mRandom(0, 10) waveParameters.waveSizeMultiplier = 0.5 waveParameters.waveTimeMultiplier = 0.5 - elseif waveParameters.largerWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.largerWave.cooldown = mRandom(0,25) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.largerWave.cooldown = mRandom(0, 25) waveParameters.waveSizeMultiplier = 1.5 waveParameters.waveTimeMultiplier = 1.5 - waveParameters.waveAirPercentage = mRandom(5,20) - waveParameters.waveSpecialPercentage = mRandom(5,20) - + waveParameters.waveAirPercentage = mRandom(5, 20) + waveParameters.waveSpecialPercentage = mRandom(5, 20) elseif waveParameters.hugeWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.hugeWave.cooldown = mRandom(0,50) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.hugeWave.cooldown = mRandom(0, 50) waveParameters.waveSizeMultiplier = 3 waveParameters.waveTimeMultiplier = 2 - waveParameters.waveAirPercentage = mRandom(5,15) - waveParameters.waveSpecialPercentage = mRandom(5,15) - + waveParameters.waveAirPercentage = mRandom(5, 15) + waveParameters.waveSpecialPercentage = mRandom(5, 15) elseif waveParameters.epicWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.epicWave.cooldown = mRandom(0,100) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.epicWave.cooldown = mRandom(0, 100) waveParameters.waveSizeMultiplier = 5 waveParameters.waveTimeMultiplier = 2.5 - waveParameters.waveAirPercentage = mRandom(5,10) - waveParameters.waveSpecialPercentage = mRandom(5,10) - + waveParameters.waveAirPercentage = mRandom(5, 10) + waveParameters.waveSpecialPercentage = mRandom(5, 10) end - end - waveParameters.waveSizeMultiplier = waveParameters.waveSizeMultiplier*waveParameters.firstWavesBoost + waveParameters.waveSizeMultiplier = waveParameters.waveSizeMultiplier * waveParameters.firstWavesBoost local cCount = 0 local loopCounter = 0 @@ -1211,15 +1202,14 @@ if gadgetHandler:IsSyncedCode() then for burrowID in pairs(burrows) do if mRandom() <= config.spawnChance then squadCounter = 0 - local airRandom = mRandom(1,100) - local specialRandom = mRandom(1,100) + local airRandom = mRandom(1, 100) + local specialRandom = mRandom(1, 100) local squad if techAnger > config.airStartAnger and airRandom <= waveParameters.waveAirPercentage then - for _ = 1,1000 do + for _ = 1, 1000 do if specialRandom <= waveParameters.waveSpecialPercentage then local potentialSquad = squadSpawnOptions.specialAir[mRandom(1, #squadSpawnOptions.specialAir)] - if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= techAnger and math.max(40, potentialSquad.maxAnger-30) >= techAnger) then -- Super Squad + if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= techAnger and math.max(40, potentialSquad.maxAnger - 30) >= techAnger) then -- Super Squad squad = potentialSquad break end @@ -1232,11 +1222,10 @@ if gadgetHandler:IsSyncedCode() then end end else - for _ = 1,1000 do + for _ = 1, 1000 do if specialRandom <= waveParameters.waveSpecialPercentage then local potentialSquad = squadSpawnOptions.special[mRandom(1, #squadSpawnOptions.special)] - if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= techAnger and math.max(40, potentialSquad.maxAnger-30) >= techAnger) then -- Super Squad + if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= techAnger and math.max(40, potentialSquad.maxAnger - 30) >= techAnger) then -- Super Squad squad = potentialSquad break end @@ -1271,9 +1260,9 @@ if gadgetHandler:IsSyncedCode() then if loopCounter <= 1 then squad = nil squadCounter = 0 - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad = squadSpawnOptions.healer[mRandom(1, #squadSpawnOptions.healer)] - if (potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger) then -- Super Squad + if potentialSquad.minAnger <= techAnger and potentialSquad.maxAnger >= techAnger then -- Super Squad squad = potentialSquad break end @@ -1300,7 +1289,7 @@ if gadgetHandler:IsSyncedCode() then end end end - until (cCount > currentMaxWaveSize*waveParameters.waveSizeMultiplier or loopCounter >= 200*config.raptorSpawnMultiplier) + until cCount > currentMaxWaveSize * waveParameters.waveSizeMultiplier or loopCounter >= 200 * config.raptorSpawnMultiplier if config.useWaveMsg then raptorEvent("wave", cCount) @@ -1319,8 +1308,8 @@ if gadgetHandler:IsSyncedCode() then if config.useScum then -- If creep/scum is enabled, only allow to spawn turrets on the creep if spread < MAPSIZEX - spread and spread < MAPSIZEZ - spread then - local flatCheck, occupancyCheck, scumCheck = 0,0,0 - for _ = 1,5 do + local flatCheck, occupancyCheck, scumCheck = 0, 0, 0 + for _ = 1, 5 do spawnPosX = mRandom(spread, MAPSIZEX - spread) spawnPosZ = mRandom(spread, MAPSIZEZ - spread) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -1344,7 +1333,7 @@ if gadgetHandler:IsSyncedCode() then -- testing determined that its mostly occupancy and scum check failing, as expected end else -- Otherwise use Raptor LoS as creep with Players sensors being the safety zone - for _ = 1,5 do + for _ = 1, 5 do spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = GetGroundHeight(spawnPosX, spawnPosZ) @@ -1365,14 +1354,14 @@ if gadgetHandler:IsSyncedCode() then end if canSpawnStructure then - local structureUnitID = CreateUnit(unitDefName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0,3), raptorTeamID) + local structureUnitID = CreateUnit(unitDefName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0, 3), raptorTeamID) if structureUnitID then SetUnitBlocking(structureUnitID, false, false) tracy.ZoneEnd() return structureUnitID, spawnPosX, spawnPosY, spawnPosZ else if tracy then - tracy.Message(string.format("spawnCreepStructure: Failed to spawn %s at %d*%d*%d ", unitDefName, spawnPosX, spawnPosY, spawnPosZ )) + tracy.Message(string.format("spawnCreepStructure: Failed to spawn %s at %d*%d*%d ", unitDefName, spawnPosX, spawnPosY, spawnPosZ)) end end end @@ -1385,44 +1374,46 @@ if gadgetHandler:IsSyncedCode() then if not UnitDefNames[uName] then -- skip unknown unit names from config else - if not uSettings.maxQueenAnger then uSettings.maxQueenAnger = uSettings.minQueenAnger + 100 end - if uSettings.minQueenAnger <= techAnger and uSettings.maxQueenAnger >= techAnger then - local numOfTurrets = (uSettings.spawnedPerWave*(1-config.raptorPerPlayerMultiplier))+(uSettings.spawnedPerWave*config.raptorPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)) - local maxExisting = (uSettings.maxExisting*(1-config.raptorPerPlayerMultiplier))+(uSettings.maxExisting*config.raptorPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)) - local maxAllowedToSpawn - if techAnger <= 100 then -- i don't know how this works but it does. scales maximum amount of turrets allowed to spawn with techAnger. - maxAllowedToSpawn = math.ceil(maxExisting*((techAnger-uSettings.minQueenAnger)/(math.min(100-uSettings.minQueenAnger, uSettings.maxQueenAnger-uSettings.minQueenAnger)))) - else - maxAllowedToSpawn = math.ceil(maxExisting*(techAnger*0.01)) - end - --Spring.Echo(uName,"MaxExisting",maxExisting,"MaxAllowed",maxAllowedToSpawn) - local currentCountOfTurretDef = GetTeamUnitDefCount(raptorTeamID, UnitDefNames[uName].id) - - if currentCountOfTurretDef < UnitDefNames[uName].maxThisUnit then -- cause nutty raptors sets maxThisUnit which results in nil returns from Spring.CreateUnit! - for i = 1, math.ceil(numOfTurrets) do - if mRandom() < config.spawnChance*math.min((GetGameSeconds/config.gracePeriodInitial),1) and (currentCountOfTurretDef <= maxAllowedToSpawn) then - if i <= numOfTurrets or mRandom() <= numOfTurrets%1 then - local attempts = 0 - local footprintX = UnitDefNames[uName].xsize -- why the fuck is this footprint *2?????? - local footprintZ = UnitDefNames[uName].zsize -- why the fuck is this footprint *2?????? - local footprintAvg = 128 - if footprintX and footprintZ then - footprintAvg = ((footprintX+footprintZ))*4 -- this is about (8 + 8) * 4 == 64 on average - end - repeat - attempts = attempts + 1 - local turretUnitID, spawnPosX, spawnPosY, spawnPosZ = spawnCreepStructure(uName, footprintAvg+32) -- call with 96 on average - if turretUnitID then - currentCountOfTurretDef = currentCountOfTurretDef + 1 - setRaptorXP(turretUnitID) - GiveOrderToUnit(turretUnitID, CMD.PATROL, {spawnPosX + mRandom(-128,128), spawnPosY, spawnPosZ + mRandom(-128,128)}, {"meta"}) + if not uSettings.maxQueenAnger then + uSettings.maxQueenAnger = uSettings.minQueenAnger + 100 + end + if uSettings.minQueenAnger <= techAnger and uSettings.maxQueenAnger >= techAnger then + local numOfTurrets = (uSettings.spawnedPerWave * (1 - config.raptorPerPlayerMultiplier)) + (uSettings.spawnedPerWave * config.raptorPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8)) + local maxExisting = (uSettings.maxExisting * (1 - config.raptorPerPlayerMultiplier)) + (uSettings.maxExisting * config.raptorPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8)) + local maxAllowedToSpawn + if techAnger <= 100 then -- i don't know how this works but it does. scales maximum amount of turrets allowed to spawn with techAnger. + maxAllowedToSpawn = math.ceil(maxExisting * ((techAnger - uSettings.minQueenAnger) / (math.min(100 - uSettings.minQueenAnger, uSettings.maxQueenAnger - uSettings.minQueenAnger)))) + else + maxAllowedToSpawn = math.ceil(maxExisting * (techAnger * 0.01)) + end + --Spring.Echo(uName,"MaxExisting",maxExisting,"MaxAllowed",maxAllowedToSpawn) + local currentCountOfTurretDef = GetTeamUnitDefCount(raptorTeamID, UnitDefNames[uName].id) + + if currentCountOfTurretDef < UnitDefNames[uName].maxThisUnit then -- cause nutty raptors sets maxThisUnit which results in nil returns from Spring.CreateUnit! + for i = 1, math.ceil(numOfTurrets) do + if mRandom() < config.spawnChance * math.min((GetGameSeconds / config.gracePeriodInitial), 1) and (currentCountOfTurretDef <= maxAllowedToSpawn) then + if i <= numOfTurrets or mRandom() <= numOfTurrets % 1 then + local attempts = 0 + local footprintX = UnitDefNames[uName].xsize -- why the fuck is this footprint *2?????? + local footprintZ = UnitDefNames[uName].zsize -- why the fuck is this footprint *2?????? + local footprintAvg = 128 + if footprintX and footprintZ then + footprintAvg = (footprintX + footprintZ) * 4 -- this is about (8 + 8) * 4 == 64 on average end - until turretUnitID or attempts > 10 + repeat + attempts = attempts + 1 + local turretUnitID, spawnPosX, spawnPosY, spawnPosZ = spawnCreepStructure(uName, footprintAvg + 32) -- call with 96 on average + if turretUnitID then + currentCountOfTurretDef = currentCountOfTurretDef + 1 + setRaptorXP(turretUnitID) + GiveOrderToUnit(turretUnitID, CMD.PATROL, { spawnPosX + mRandom(-128, 128), spawnPosY, spawnPosZ + mRandom(-128, 128) }, { "meta" }) + end + until turretUnitID or attempts > 10 + end end end end end - end end -- if UnitDefNames[uName] end tracy.ZoneEnd() @@ -1431,7 +1422,7 @@ if gadgetHandler:IsSyncedCode() then function SpawnMinions(unitID, unitDefID) local unitName = UnitDefs[unitDefID].name if config.raptorMinions[unitName] then - local minion = config.raptorMinions[unitName][mRandom(1,#config.raptorMinions[unitName])] + local minion = config.raptorMinions[unitName][mRandom(1, #config.raptorMinions[unitName])] SpawnRandomOffWaveSquad(unitID, minion, 4) end end @@ -1441,19 +1432,18 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- function gadget:UnitCreated(unitID, unitDefID, unitTeam) - local unitDef = UnitDefs[unitDefID] if unitTeam == raptorTeamID then - GiveOrderToUnit(unitID,CMD.FIRE_STATE,{config.defaultRaptorFirestate},0) + GiveOrderToUnit(unitID, CMD.FIRE_STATE, { config.defaultRaptorFirestate }, 0) if unitDef.canCloak then - GiveOrderToUnit(unitID,37382,{1},0) + GiveOrderToUnit(unitID, 37382, { 1 }, 0) end return end -- For each squadTargetsByEcoWeight, remove them - for _,unitList in pairs(squadTargetsByEcoWeight) do + for _, unitList in pairs(squadTargetsByEcoWeight) do unitList:Remove(unitID) end @@ -1472,10 +1462,10 @@ if gadgetHandler:IsSyncedCode() then ecoValue = ecoValue - unitDef.energyUpkeep end if unitDef.windGenerator then - ecoValue = ecoValue + unitDef.windGenerator*0.75 + ecoValue = ecoValue + unitDef.windGenerator * 0.75 end if unitDef.tidalGenerator then - ecoValue = ecoValue + unitDef.tidalGenerator*15 + ecoValue = ecoValue + unitDef.tidalGenerator * 15 end if unitDef.extractsMetal and unitDef.extractsMetal > 0 then ecoValue = ecoValue + 200 @@ -1517,14 +1507,13 @@ if gadgetHandler:IsSyncedCode() then end if config.ecoBuildingsPenalty[unitDefID] then - playerAggressionEcoValue = playerAggressionEcoValue + (config.ecoBuildingsPenalty[unitDefID]/(config.queenTime/3600)) -- scale to 60minutes = 3600seconds queen time + playerAggressionEcoValue = playerAggressionEcoValue + (config.ecoBuildingsPenalty[unitDefID] / (config.queenTime / 3600)) -- scale to 60minutes = 3600seconds queen time end end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) - if unitTeam == raptorTeamID then - if attackerTeam == raptorTeamID and (not (attackerDefID and config.raptorBehaviours.ALLOWFRIENDLYFIRE[attackerDefID])) then + if attackerTeam == raptorTeamID and not (attackerDefID and config.raptorBehaviours.ALLOWFRIENDLYFIRE[attackerDefID]) then return 0 end damage = damage / config.healthMod @@ -1558,7 +1547,7 @@ if gadgetHandler:IsSyncedCode() then if not queenResistance[attackerDefID] then queenResistance[attackerDefID] = { damage = damage * 5 * resistMult, - notify = 0 + notify = 0, } end local qr = queenResistance[attackerDefID] @@ -1568,22 +1557,21 @@ if gadgetHandler:IsSyncedCode() then raptorEvent("queenResistance", tonumber(attackerDefID)) qr.notify = 1 end - end if UnitDefStaggerMultiplier[attackerDefID] then - queenStagger.CurrentHealth = queenStagger.CurrentHealth - (math.max(damage*0.25, (math.min((damage * (1-resistPercent) * 2), damage)) / nTotalQueens) * UnitDefStaggerMultiplier[attackerDefID]) + queenStagger.CurrentHealth = queenStagger.CurrentHealth - (math.max(damage * 0.25, (math.min((damage * (1 - resistPercent) * 2), damage)) / nTotalQueens) * UnitDefStaggerMultiplier[attackerDefID]) else - queenStagger.CurrentHealth = queenStagger.CurrentHealth - (math.max(damage*0.25, math.min((damage * (1-resistPercent) * 2), damage)) / nTotalQueens) + queenStagger.CurrentHealth = queenStagger.CurrentHealth - (math.max(damage * 0.25, math.min((damage * (1 - resistPercent) * 2), damage)) / nTotalQueens) end if queenStagger.currentlyStaggered then damage = damage - (damage * resistPercent * 0.5) - queenStagger.CurrentTimer = queenStagger.CurrentTimer - (damage*0.0001) + queenStagger.CurrentTimer = queenStagger.CurrentTimer - (damage * 0.0001) local ux, uy, uz = Spring.GetUnitPosition(unitID) if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500), 0, 0, 0) end else damage = damage - (damage * resistPercent) @@ -1591,7 +1579,6 @@ if gadgetHandler:IsSyncedCode() then qr.damage = qr.damage + (damage * 5 * resistMult) qr.percent = resistPercent - else damage = 1 end @@ -1620,7 +1607,7 @@ if gadgetHandler:IsSyncedCode() then if not UnitReactionsTimeout[unitID] then UnitReactionsTimeout[unitID] = 0 end - if UnitReactionsTimeout[unitID] < GetGameSeconds-2 then + if UnitReactionsTimeout[unitID] < GetGameSeconds - 2 then if config.raptorBehaviours.SKIRMISH[attackerDefID] and (unitTeam ~= raptorTeamID) and attackerID and (mRandom() < config.raptorBehaviours.SKIRMISH[attackerDefID].chance) and unitTeam ~= attackerTeam then UnitReactionsTimeout[unitID] = GetGameSeconds local ux, uy, uz = GetUnitPosition(unitID) @@ -1628,16 +1615,16 @@ if gadgetHandler:IsSyncedCode() then if x and ux then local angle = math.atan2(ux - x, uz - z) local sinA, cosA = math.sin(angle), math.cos(angle) - local distance = mRandom(math.ceil(config.raptorBehaviours.SKIRMISH[attackerDefID].distance*0.75), math.floor(config.raptorBehaviours.SKIRMISH[attackerDefID].distance*1.25)) + local distance = mRandom(math.ceil(config.raptorBehaviours.SKIRMISH[attackerDefID].distance * 0.75), math.floor(config.raptorBehaviours.SKIRMISH[attackerDefID].distance * 1.25)) local dx, dz = sinA * distance, cosA * distance if config.raptorBehaviours.SKIRMISH[attackerDefID].teleport and (unitTeleportCooldown[attackerID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(x - dx, y, z - dz, 64, 30, false) and positionCheckLibrary.MapEdgeCheck(x - dx, y, z - dz, 64) then GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x, y, z) SetUnitPosition(attackerID, x - dx, z - dz) GiveOrderToUnit(attackerID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x - dx, y, z - dz) - unitTeleportCooldown[attackerID] = GetGameFrame + config.raptorBehaviours.SKIRMISH[attackerDefID].teleportcooldown*30 + unitTeleportCooldown[attackerID] = GetGameFrame + config.raptorBehaviours.SKIRMISH[attackerDefID].teleportcooldown * 30 else - GiveOrderToUnit(attackerID, CMD.MOVE, { x - dx, y, z - dz}, {}) + GiveOrderToUnit(attackerID, CMD.MOVE, { x - dx, y, z - dz }, {}) end unitCowardCooldown[attackerID] = GetGameFrame + 900 end @@ -1650,16 +1637,16 @@ if gadgetHandler:IsSyncedCode() then if x and ax then local angle = math.atan2(ax - x, az - z) local sinA, cosA = math.sin(angle), math.cos(angle) - local distance = mRandom(math.ceil(config.raptorBehaviours.COWARD[unitDefID].distance*0.75), math.floor(config.raptorBehaviours.COWARD[unitDefID].distance*1.25)) + local distance = mRandom(math.ceil(config.raptorBehaviours.COWARD[unitDefID].distance * 0.75), math.floor(config.raptorBehaviours.COWARD[unitDefID].distance * 1.25)) local dx, dz = sinA * distance, cosA * distance if config.raptorBehaviours.COWARD[unitDefID].teleport and (unitTeleportCooldown[unitID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(x - dx, y, z - dz, 64, 30, false) and positionCheckLibrary.MapEdgeCheck(x - dx, y, z - dz, 64) and positionCheckLibrary.OccupancyCheck(x - dx, y, z - dz, 64) then GG.ScavengersSpawnEffectUnitDefID(unitDefID, x, y, z) SetUnitPosition(unitID, x - dx, z - dz) GiveOrderToUnit(unitID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(unitDefID, x - dx, y, z - dz) - unitTeleportCooldown[unitID] = GetGameFrame + config.raptorBehaviours.COWARD[unitDefID].teleportcooldown*30 + unitTeleportCooldown[unitID] = GetGameFrame + config.raptorBehaviours.COWARD[unitDefID].teleportcooldown * 30 else - GiveOrderToUnit(unitID, CMD.MOVE, { x - dx, y, z - dz}, {}) + GiveOrderToUnit(unitID, CMD.MOVE, { x - dx, y, z - dz }, {}) end unitCowardCooldown[unitID] = GetGameFrame + 900 end @@ -1670,16 +1657,16 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(unitID) local separation = GetUnitSeparation(unitID, attackerID) if ax and separation < (config.raptorBehaviours.BERSERK[unitDefID].distance or 10000) then - ax = ax + mRandom(-128,128) - az = az + mRandom(-128,128) + ax = ax + mRandom(-128, 128) + az = az + mRandom(-128, 128) if config.raptorBehaviours.BERSERK[unitDefID].teleport and (unitTeleportCooldown[unitID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(ax, ay, az, 128, 30, false) and positionCheckLibrary.MapEdgeCheck(ax, ay, az, 128) and positionCheckLibrary.OccupancyCheck(ax, ay, az, 64) then GG.ScavengersSpawnEffectUnitDefID(unitDefID, x, y, z) SetUnitPosition(unitID, ax, ay, az) GiveOrderToUnit(unitID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(attackerDefID, ax, ay, az) - unitTeleportCooldown[unitID] = GetGameFrame + config.raptorBehaviours.BERSERK[unitDefID].teleportcooldown*30 + unitTeleportCooldown[unitID] = GetGameFrame + config.raptorBehaviours.BERSERK[unitDefID].teleportcooldown * 30 else - GiveOrderToUnit(unitID, CMD.MOVE, {ax, ay, az}, {}) + GiveOrderToUnit(unitID, CMD.MOVE, { ax, ay, az }, {}) end unitCowardCooldown[unitID] = GetGameFrame + 900 end @@ -1689,16 +1676,16 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(attackerID) local separation = GetUnitSeparation(unitID, attackerID) if ax and separation < (config.raptorBehaviours.BERSERK[attackerDefID].distance or 10000) then - ax = ax + mRandom(-128,128) - az = az + mRandom(-128,128) + ax = ax + mRandom(-128, 128) + az = az + mRandom(-128, 128) if config.raptorBehaviours.BERSERK[attackerDefID].teleport and (unitTeleportCooldown[attackerID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(ax, ay, az, 128, 30, false) and positionCheckLibrary.MapEdgeCheck(ax, ay, az, 128) and positionCheckLibrary.OccupancyCheck(ax, ay, az, 64) then GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x, y, z) SetUnitPosition(attackerID, ax, ay, az) GiveOrderToUnit(attackerID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(unitDefID, ax, ay, az) - unitTeleportCooldown[attackerID] = GetGameFrame + config.raptorBehaviours.BERSERK[attackerDefID].teleportcooldown*30 + unitTeleportCooldown[attackerID] = GetGameFrame + config.raptorBehaviours.BERSERK[attackerDefID].teleportcooldown * 30 else - GiveOrderToUnit(attackerID, CMD.MOVE, {ax, ay, az}, {}) + GiveOrderToUnit(attackerID, CMD.MOVE, { ax, ay, az }, {}) end unitCowardCooldown[attackerID] = GetGameFrame + 900 end @@ -1714,12 +1701,12 @@ if gadgetHandler:IsSyncedCode() then if not UnitLifetimeResetTimeout[unitID] then UnitLifetimeResetTimeout[unitID] = 0 end - if (unitTeam == raptorTeamID or attackerTeam == raptorTeamID) and UnitLifetimeResetTimeout[unitID] < GetGameSeconds-60 then + if (unitTeam == raptorTeamID or attackerTeam == raptorTeamID) and UnitLifetimeResetTimeout[unitID] < GetGameSeconds - 60 then UnitLifetimeResetTimeout[unitID] = GetGameSeconds - if (unitID and unitSquadTable[unitID] and squadsTable[unitSquadTable[unitID]] and squadsTable[unitSquadTable[unitID]].squadLife and squadsTable[unitSquadTable[unitID]].squadLife < 2) then + if unitID and unitSquadTable[unitID] and squadsTable[unitSquadTable[unitID]] and squadsTable[unitSquadTable[unitID]].squadLife and squadsTable[unitSquadTable[unitID]].squadLife < 2 then squadsTable[unitSquadTable[unitID]].squadLife = 10 end - if (attackerID and unitSquadTable[attackerID] and squadsTable[unitSquadTable[attackerID]] and squadsTable[unitSquadTable[attackerID]].squadLife and squadsTable[unitSquadTable[attackerID]].squadLife < 2) then + if attackerID and unitSquadTable[attackerID] and squadsTable[unitSquadTable[attackerID]] and squadsTable[unitSquadTable[attackerID]].squadLife and squadsTable[unitSquadTable[attackerID]].squadLife < 2 then squadsTable[unitSquadTable[attackerID]].squadLife = 10 end end @@ -1745,10 +1732,18 @@ if gadgetHandler:IsSyncedCode() then end end end - if not lsx1 then lsx1 = 0 end - if not lsz1 then lsz1 = 0 end - if not lsx2 then lsx2 = Game.mapSizeX end - if not lsz2 then lsz2 = Game.mapSizeZ end + if not lsx1 then + lsx1 = 0 + end + if not lsz1 then + lsz1 = 0 + end + if not lsx2 then + lsx2 = Game.mapSizeX + end + if not lsz2 then + lsz2 = Game.mapSizeZ + end end local function SpawnRaptors() @@ -1757,7 +1752,7 @@ if gadgetHandler:IsSyncedCode() then local i, defs = next(spawnQueue) if not i or not defs then if #squadCreationQueue.units > 0 then - if mRandom(1,5) == 1 then + if mRandom(1, 5) == 1 then squadCreationQueue.regroupenabled = false end local squadID = createSquad(squadCreationQueue) @@ -1775,48 +1770,48 @@ if gadgetHandler:IsSyncedCode() then spawnQueue[i] = nil return end - local unitID = CreateUnit(defs.unitName, x, y, z, mRandom(0,3), defs.team) + local unitID = CreateUnit(defs.unitName, x, y, z, mRandom(0, 3), defs.team) if unitID then if (not defs.squadID) or (defs.squadID and defs.squadID == 1) then if #squadCreationQueue.units > 0 then - if mRandom(1,5) == 1 then + if mRandom(1, 5) == 1 then squadCreationQueue.regroupenabled = false end createSquad(squadCreationQueue) squadDone = true end end - if defs.burrow and (not squadCreationQueue.burrow) then + if defs.burrow and not squadCreationQueue.burrow then squadCreationQueue.burrow = defs.burrow end - squadCreationQueue.units[#squadCreationQueue.units+1] = unitID + squadCreationQueue.units[#squadCreationQueue.units + 1] = unitID if config.raptorBehaviours.HEALER[UnitDefNames[defs.unitName].id] then squadCreationQueue.role = "healer" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*modOptions.raptor_spawntimemult) then - squadCreationQueue.life = math.ceil(100*modOptions.raptor_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * modOptions.raptor_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * modOptions.raptor_spawntimemult) end end if config.raptorBehaviours.ARTILLERY[UnitDefNames[defs.unitName].id] then squadCreationQueue.role = "artillery" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*modOptions.raptor_spawntimemult) then - squadCreationQueue.life = math.ceil(100*modOptions.raptor_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * modOptions.raptor_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * modOptions.raptor_spawntimemult) end end if config.raptorBehaviours.KAMIKAZE[UnitDefNames[defs.unitName].id] then squadCreationQueue.role = "kamikaze" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*modOptions.raptor_spawntimemult) then - squadCreationQueue.life = math.ceil(100*modOptions.raptor_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * modOptions.raptor_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * modOptions.raptor_spawntimemult) end end if UnitDefNames[defs.unitName].canFly then squadCreationQueue.role = "aircraft" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*modOptions.raptor_spawntimemult) then - squadCreationQueue.life = math.ceil(100*modOptions.raptor_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * modOptions.raptor_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * modOptions.raptor_spawntimemult) end end @@ -1838,18 +1833,18 @@ if gadgetHandler:IsSyncedCode() then local queenSquad = table.copy(squadCreationQueueDefaults) queenSquad.life = 999999 queenSquad.role = "raid" - queenSquad.units = {queenID} + queenSquad.units = { queenID } createSquad(queenSquad) spawnQueue = {} raptorEvent("queen") -- notify unsynced about queen spawn local _, queenMaxHP = GetUnitHealth(queenID) - SetUnitHealth(queenID, math.max(queenMaxHP*(techAnger*0.01), queenMaxHP*0.2)) + SetUnitHealth(queenID, math.max(queenMaxHP * (techAnger * 0.01), queenMaxHP * 0.2)) SetUnitExperience(queenID, 0) timeOfLastWave = t if nSpawnedQueens == 1 then for burrowID, _ in pairs(burrows) do if mRandom() < config.spawnChance then - SpawnRandomOffWaveSquad(burrowID, config.miniBosses[mRandom(1,#config.miniBosses)], 1) + SpawnRandomOffWaveSquad(burrowID, config.miniBosses[mRandom(1, #config.miniBosses)], 1) SpawnRandomOffWaveSquad(burrowID) else SpawnRandomOffWaveSquad(burrowID) @@ -1865,7 +1860,7 @@ if gadgetHandler:IsSyncedCode() then if not queenStagger.currentlyStaggered then for queenID, _ in pairs(queenIDs) do if mRandom() < config.spawnChance / 15 then - for i = 1,config.queenSpawnMult do + for i = 1, config.queenSpawnMult do SpawnMinions(queenID, GetUnitDefID(queenID)) SpawnMinions(queenID, GetUnitDefID(queenID)) end @@ -1876,25 +1871,24 @@ if gadgetHandler:IsSyncedCode() then function updateRaptorSpawnBox() if config.burrowSpawnType == "initialbox_post" then - lsx1 = math.max(RaptorStartboxXMin - ((MAPSIZEX*0.01) * techAnger), 0) - lsz1 = math.max(RaptorStartboxZMin - ((MAPSIZEZ*0.01) * techAnger), 0) - lsx2 = math.min(RaptorStartboxXMax + ((MAPSIZEX*0.01) * techAnger), MAPSIZEX) - lsz2 = math.min(RaptorStartboxZMax + ((MAPSIZEZ*0.01) * techAnger), MAPSIZEZ) - if not lsx2 or lsx2-lsx1 < 512 then + lsx1 = math.max(RaptorStartboxXMin - ((MAPSIZEX * 0.01) * techAnger), 0) + lsz1 = math.max(RaptorStartboxZMin - ((MAPSIZEZ * 0.01) * techAnger), 0) + lsx2 = math.min(RaptorStartboxXMax + ((MAPSIZEX * 0.01) * techAnger), MAPSIZEX) + lsz2 = math.min(RaptorStartboxZMax + ((MAPSIZEZ * 0.01) * techAnger), MAPSIZEZ) + if not lsx2 or lsx2 - lsx1 < 512 then lsx1 = math.max(0, math.floor((lsx1 + lsx2) / 2) - 256) lsx2 = lsx1 + 512 end - if not lsz2 or lsz2-lsz1 < 512 then + if not lsz2 or lsz2 - lsz1 < 512 then lsz1 = math.max(0, math.floor((lsz1 + lsz2) / 2) - 256) lsz2 = lsz1 + 512 end end end - local raptorEggColors = {"pink","white","red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen"} - - function spawnRandomEgg(x,y,z,name) + local raptorEggColors = { "pink", "white", "red", "blue", "darkgreen", "purple", "green", "yellow", "darkred", "acidgreen" } + function spawnRandomEgg(x, y, z, name) local unit = UnitDefNames[name] local featureValueMetal = math.ceil(unit.metalCost) @@ -1910,38 +1904,35 @@ if gadgetHandler:IsSyncedCode() then elseif featureValueMetal <= 7500 then size = "m" chance = 0.66 - featureValueMetal = math.ceil(featureValueMetal*0.66) - featureValueEnergy = math.ceil(featureValueEnergy*0.66) + featureValueMetal = math.ceil(featureValueMetal * 0.66) + featureValueEnergy = math.ceil(featureValueEnergy * 0.66) else size = "l" chance = 1 - featureValueMetal = math.ceil(featureValueMetal*0.33) - featureValueEnergy = math.ceil(featureValueEnergy*0.33) + featureValueMetal = math.ceil(featureValueMetal * 0.33) + featureValueEnergy = math.ceil(featureValueEnergy * 0.33) end if mRandom() <= chance then - if config.raptorEggs[name] and config.raptorEggs[name] ~= "" then color = config.raptorEggs[name] else - color = raptorEggColors[mRandom(1,#raptorEggColors)] + color = raptorEggColors[mRandom(1, #raptorEggColors)] end - local egg = CreateFeature("raptor_egg_"..size.."_"..color, x, y + 20, z, mRandom(-999999,999999), raptorTeamID) + local egg = CreateFeature("raptor_egg_" .. size .. "_" .. color, x, y + 20, z, mRandom(-999999, 999999), raptorTeamID) if egg then - SetFeatureMoveCtrl(egg, false,1,1,1,1,1,1,1,1,1) - SetFeatureVelocity(egg, mRandom(-30,30)*0.01, mRandom(150,350)*0.01, mRandom(-30,30)*0.01) - SetFeatureResources(egg, featureValueMetal, featureValueEnergy, featureValueMetal*10, 1.0, featureValueMetal, featureValueEnergy) + SetFeatureMoveCtrl(egg, false, 1, 1, 1, 1, 1, 1, 1, 1, 1) + SetFeatureVelocity(egg, mRandom(-30, 30) * 0.01, mRandom(150, 350) * 0.01, mRandom(-30, 30) * 0.01) + SetFeatureResources(egg, featureValueMetal, featureValueEnergy, featureValueMetal * 10, 1.0, featureValueMetal, featureValueEnergy) end - end - end function decayRandomEggs() tracy.ZoneBeginN("Raptors:decayRandomEggs") for eggID, _ in pairs(aliveEggsTable) do - if mRandom(1,18) == 1 then -- scaled to decay 1000hp egg in about 1 and half minutes +/- RNG + if mRandom(1, 18) == 1 then -- scaled to decay 1000hp egg in about 1 and half minutes +/- RNG --local fx, fy, fz = Spring.GetFeaturePosition(eggID) SetFeatureHealth(eggID, GetFeatureHealth(eggID) - 40) if GetFeatureHealth(eggID) <= 0 then @@ -1953,7 +1944,7 @@ if gadgetHandler:IsSyncedCode() then end function gadget:TrySpawnBurrow(t) - local maxSpawnRetries = math.floor((config.gracePeriodInitial-t)/spawnRetryTimeDiv) + local maxSpawnRetries = math.floor((config.gracePeriodInitial - t) / spawnRetryTimeDiv) local spawned = SpawnBurrow() timeOfLastSpawn = t if not fullySpawned then @@ -1962,7 +1953,7 @@ if gadgetHandler:IsSyncedCode() then fullySpawned = true elseif spawnRetries >= maxSpawnRetries or firstSpawn then spawnAreaMultiplier = spawnAreaMultiplier + 1 - RaptorStartboxXMin, RaptorStartboxZMin, RaptorStartboxXMax, RaptorStartboxZMax = EnemyLib.GetAdjustedStartBox(raptorAllyTeamID, config.burrowSize*1.5*spawnAreaMultiplier) + RaptorStartboxXMin, RaptorStartboxZMin, RaptorStartboxXMax, RaptorStartboxZMax = EnemyLib.GetAdjustedStartBox(raptorAllyTeamID, config.burrowSize * 1.5 * spawnAreaMultiplier) gadget:SetInitialSpawnBox() spawnRetries = 0 else @@ -1977,8 +1968,7 @@ if gadgetHandler:IsSyncedCode() then local announcedFirstWave = false function gadget:GameFrame(n) - - GetGameSeconds = n/30 + GetGameSeconds = n / 30 GetGameFrame = n if announcedFirstWave == false and GetGameSeconds > config.gracePeriodInitial then @@ -1999,7 +1989,7 @@ if gadgetHandler:IsSyncedCode() then end local raptorTeamUnitCount = GetTeamUnitCount(raptorTeamID) or 0 - if raptorTeamUnitCount < raptorUnitCap and (n%5 == 4 or waveParameters.firstWavesBoost > 1) then + if raptorTeamUnitCount < raptorUnitCap and (n % 5 == 4 or waveParameters.firstWavesBoost > 1) then tracy.ZoneBeginN("Raptors:SpawnRaptors") SpawnRaptors() tracy.ZoneEnd() @@ -2011,29 +2001,29 @@ if gadgetHandler:IsSyncedCode() then end end - if n%30 == 16 then + if n % 30 == 16 then t = GetGameSeconds local burrowCount = SetCount(burrows) - playerAggression = playerAggression*0.995 + playerAggression = playerAggression * 0.995 playerAggressionLevel = math.floor(playerAggression) SetGameRulesParam("raptorPlayerAggressionLevel", playerAggressionLevel) if nSpawnedQueens == 0 then - currentMaxWaveSize = (minWaveSize + math.ceil((techAnger*0.01)*(maxWaveSize - minWaveSize))) + currentMaxWaveSize = (minWaveSize + math.ceil((techAnger * 0.01) * (maxWaveSize - minWaveSize))) else - currentMaxWaveSize = math.ceil((minWaveSize + math.ceil((techAnger*0.01)*(maxWaveSize - minWaveSize)))*(config.bossFightWaveSizeScale*0.01)) + currentMaxWaveSize = math.ceil((minWaveSize + math.ceil((techAnger * 0.01) * (maxWaveSize - minWaveSize))) * (config.bossFightWaveSizeScale * 0.01)) end if pastFirstQueen or modOptions.raptor_graceperiodmult <= 1 then - techAnger = (t - config.gracePeriodInitial) / ((queenTime/(modOptions.raptor_queentimemult)) - config.gracePeriodInitial) * 100 + techAnger = (t - config.gracePeriodInitial) / ((queenTime / modOptions.raptor_queentimemult) - config.gracePeriodInitial) * 100 else - techAnger = (t - (config.gracePeriodInitial/modOptions.raptor_graceperiodmult)) / ((queenTime/(modOptions.raptor_queentimemult)) - (config.gracePeriodInitial/modOptions.raptor_graceperiodmult)) * 100 + techAnger = (t - (config.gracePeriodInitial / modOptions.raptor_graceperiodmult)) / ((queenTime / modOptions.raptor_queentimemult) - (config.gracePeriodInitial / modOptions.raptor_graceperiodmult)) * 100 end - techAnger = math.ceil(techAnger*((config.economyScale*0.5)+0.5)) + techAnger = math.ceil(techAnger * ((config.economyScale * 0.5) + 0.5)) techAnger = math.clamp(techAnger, 0, 999) if t < config.gracePeriod then queenAnger = 0 - minBurrows = math.ceil(math.max(4, 2*(math.min(SetCount(humanTeams), 8)))*(t/config.gracePeriodInitial)) + minBurrows = math.ceil(math.max(4, 2 * (math.min(SetCount(humanTeams), 8))) * (t / config.gracePeriodInitial)) else if nSpawnedQueens == 0 then queenAnger = math.clamp(math.ceil((t - config.gracePeriod) / (queenTime - config.gracePeriod) * 100) + queenAngerAggressionLevel, 0, 100) @@ -2046,8 +2036,8 @@ if gadgetHandler:IsSyncedCode() then minBurrows = 1 end end - queenAngerAggressionLevel = queenAngerAggressionLevel + ((playerAggression*0.01)/(config.queenTime/3600)) + playerAggressionEcoValue - SetGameRulesParam("RaptorQueenAngerGain_Aggression", (playerAggression*0.01)/(config.queenTime/3600)) + queenAngerAggressionLevel = queenAngerAggressionLevel + ((playerAggression * 0.01) / (config.queenTime / 3600)) + playerAggressionEcoValue + SetGameRulesParam("RaptorQueenAngerGain_Aggression", (playerAggression * 0.01) / (config.queenTime / 3600)) SetGameRulesParam("RaptorQueenAngerGain_Eco", playerAggressionEcoValue) end SetGameRulesParam("raptorQueenAnger", math.floor(queenAnger)) @@ -2074,10 +2064,8 @@ if gadgetHandler:IsSyncedCode() then timeOfLastSpawn = t end - if t > config.gracePeriodInitial+5 then - if burrowCount > 0 - and SetCount(spawnQueue) == 0 - and ((config.raptorSpawnRate*waveParameters.waveTimeMultiplier) < (t - timeOfLastWave)) then + if t > config.gracePeriodInitial + 5 then + if burrowCount > 0 and SetCount(spawnQueue) == 0 and ((config.raptorSpawnRate * waveParameters.waveTimeMultiplier) < (t - timeOfLastWave)) then Wave() timeOfLastWave = t end @@ -2085,10 +2073,10 @@ if gadgetHandler:IsSyncedCode() then updateRaptorSpawnBox() end - if n%((math.ceil(config.turretSpawnRate))*30) == 0 and n > 900 and raptorTeamUnitCount < raptorUnitCap then + if n % ((math.ceil(config.turretSpawnRate)) * 30) == 0 and n > 900 and raptorTeamUnitCount < raptorUnitCap then spawnCreepStructuresWave() end - local squadID = ((n % (#squadsTable*3))+1)/3 --*3 and /3 for lowering the rate of commands + local squadID = ((n % (#squadsTable * 3)) + 1) / 3 --*3 and /3 for lowering the rate of commands if squadID and squadsTable[squadID] and squadsTable[squadID].squadRegroupEnabled then local targetx, targety, targetz = squadsTable[squadID].target.x, squadsTable[squadID].target.y, squadsTable[squadID].target.z if targetx then @@ -2097,19 +2085,19 @@ if gadgetHandler:IsSyncedCode() then refreshSquad(squadID) end end - if n%7 == 3 then + if n % 7 == 3 then local raptors = GetTeamUnits(raptorTeamID) - for i = 1,#raptors do + for i = 1, #raptors do local unitID = raptors[i] local defID = GetUnitDefID(unitID) - if defID and mRandom(1,math.ceil((33*math.max(1, GetTeamUnitDefCount(raptorTeamID, defID))))) == 1 and mRandom() < config.spawnChance then + if defID and mRandom(1, math.ceil((33 * math.max(1, GetTeamUnitDefCount(raptorTeamID, defID))))) == 1 and mRandom() < config.spawnChance then SpawnMinions(unitID, defID) end - if math.random(1,10) == 1 and unitCowardCooldown[unitID] and (n > unitCowardCooldown[unitID]) then + if math.random(1, 10) == 1 and unitCowardCooldown[unitID] and (n > unitCowardCooldown[unitID]) then unitCowardCooldown[unitID] = nil GiveOrderToUnit(unitID, CMD.STOP, 0, 0) end - if ((math.random(1,10) == 1 or queenIDs[unitID]) and GetUnitCommandCount(unitID) == 0) then + if (math.random(1, 10) == 1 or queenIDs[unitID]) and GetUnitCommandCount(unitID) == 0 then if unitCowardCooldown[unitID] then unitCowardCooldown[unitID] = nil end @@ -2124,23 +2112,22 @@ if gadgetHandler:IsSyncedCode() then end else local pos = getRandomEnemyPos() - GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x, pos.y, pos.z}, {}) + GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x, pos.y, pos.z }, {}) end end end end - if n%6 == 2 then + if n % 6 == 2 then decayRandomEggs() end manageAllSquads() end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) - if unitTeam == raptorTeamID then if config.useEggs then - local x,y,z = GetUnitPosition(unitID) - spawnRandomEgg(x,y,z, UnitDefs[unitDefID].name) + local x, y, z = GetUnitPosition(unitID) + spawnRandomEgg(x, y, z, UnitDefs[unitDefID].name) end if unitDefID == config.burrowDef then if mRandom() <= config.spawnChance then @@ -2165,7 +2152,7 @@ if gadgetHandler:IsSyncedCode() then end end - for _,unitList in pairs(squadTargetsByEcoWeight) do + for _, unitList in pairs(squadTargetsByEcoWeight) do unitList:Remove(unitID) end @@ -2183,7 +2170,7 @@ if gadgetHandler:IsSyncedCode() then if queenIDs[unitID] then nKilledQueens = nKilledQueens + 1 queenIDs[unitID] = nil - table.mergeInPlace(bosses.statuses, {[tostring(unitID)] = {isDead = true, health = 0}}) + table.mergeInPlace(bosses.statuses, { [tostring(unitID)] = { isDead = true, health = 0 } }) SetGameRulesParam("raptorQueensKilled", nKilledQueens) if nKilledQueens >= nTotalQueens then @@ -2234,8 +2221,8 @@ if gadgetHandler:IsSyncedCode() then burrows[unitID] = nil if attackerID and GetUnitTeam(attackerID) ~= raptorTeamID then - playerAggression = playerAggression + (config.angerBonus/config.raptorSpawnMultiplier) - config.maxXP = config.maxXP*1.01 + playerAggression = playerAggression + (config.angerBonus / config.raptorSpawnMultiplier) + config.maxXP = config.maxXP * 1.01 end for i, defs in pairs(spawnQueue) do @@ -2246,13 +2233,13 @@ if gadgetHandler:IsSyncedCode() then SetGameRulesParam("raptor_hiveCount", SetCount(burrows)) elseif unitTeam == raptorTeamID and UnitDefs[unitDefID].isBuilding and (attackerID and GetUnitTeam(attackerID) ~= raptorTeamID) then - playerAggression = playerAggression + ((config.angerBonus/config.raptorSpawnMultiplier)*0.1) + playerAggression = playerAggression + ((config.angerBonus / config.raptorSpawnMultiplier) * 0.1) end if unitTeleportCooldown[unitID] then unitTeleportCooldown[unitID] = nil end if unitTeam ~= raptorTeamID and config.ecoBuildingsPenalty[unitDefID] then - playerAggressionEcoValue = playerAggressionEcoValue - (config.ecoBuildingsPenalty[unitDefID]/(config.queenTime/3600)) -- scale to 60minutes = 3600seconds queen time + playerAggressionEcoValue = playerAggressionEcoValue - (config.ecoBuildingsPenalty[unitDefID] / (config.queenTime / 3600)) -- scale to 60minutes = 3600seconds queen time end end @@ -2298,9 +2285,7 @@ if gadgetHandler:IsSyncedCode() then -- return true -- end -- end - -else -- UNSYNCED - +else -- UNSYNCED local hasRaptorEvent = false local mRandom = math.random @@ -2325,7 +2310,7 @@ else -- UNSYNCED end function gadget:Initialize() - gadgetHandler:AddSyncAction('RaptorEvent', WrapToLuaUI) + gadgetHandler:AddSyncAction("RaptorEvent", WrapToLuaUI) gadgetHandler:AddChatAction("HasRaptorEvent", HasRaptorEvent, "toggles hasRaptorEvent setting") end @@ -2333,19 +2318,17 @@ else -- UNSYNCED gadgetHandler:RemoveChatAction("HasRaptorEvent") end - - local nocolorshift = {0,0,0} - local colorshiftcache = {0,0,0} + local nocolorshift = { 0, 0, 0 } + local colorshiftcache = { 0, 0, 0 } if gl.SetUnitBufferUniforms then function gadget:UnitCreated(unitID, unitDefID, unitTeam) if string.find(UnitDefs[unitDefID].name, "raptor") then gl.SetUnitBufferUniforms(unitID, nocolorshift, 8) - colorshiftcache[1] = mRandom(-100,100)*0.0001 -- hue (hue hue) - colorshiftcache[2] = mRandom(-200,200)*0.0001 -- saturation - colorshiftcache[3] = mRandom(-200,200)*0.0001 -- brightness + colorshiftcache[1] = mRandom(-100, 100) * 0.0001 -- hue (hue hue) + colorshiftcache[2] = mRandom(-200, 200) * 0.0001 -- saturation + colorshiftcache[3] = mRandom(-200, 200) * 0.0001 -- brightness gl.SetUnitBufferUniforms(unitID, colorshiftcache, 8) end end end - end diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_Basic_Sea.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_Basic_Sea.lua index 5fa92a9e176..1b289552158 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_Basic_Sea.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_Basic_Sea.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -6,20 +6,20 @@ local UDN = UnitDefNames -- Tech 1 local function t1SeaBase1() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corfmkr_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.corfmkr_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.corfmkr_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.corfmkr_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.corfmkr_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.corfmkr_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.corfmkr_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.corfmkr_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, } else buildings = { - { unitDefID = UDN.armfmkr_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armfmkr_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armfmkr_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.armfmkr_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armfmkr_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armfmkr_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armfmkr_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armfmkr_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, } end @@ -33,24 +33,24 @@ end local function t1SeaBase2() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwms_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.coruwms_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.coruwms_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.coruwms_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.coruwms_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.coruwms_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.coruwms_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.coruwms_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, } else buildings = { - { unitDefID = UDN.armuwms_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.armuwms_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.armuwms_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.armuwms_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.armuwms_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.armuwms_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.armuwms_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.armuwms_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, } end - return { + return { type = types.Sea, tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 100, @@ -60,24 +60,24 @@ end local function t1SeaBase3() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.cortide_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.cortide_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.cortide_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.cortide_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.cortide_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.cortide_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.cortide_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.cortide_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, } else buildings = { - { unitDefID = UDN.armtide_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armtide_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.armtide_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armtide_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armtide_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armtide_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armtide_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armtide_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, } end - return { + return { type = types.Sea, tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 100, @@ -87,20 +87,20 @@ end local function t1SeaBase4() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwes_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.coruwes_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.coruwes_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.coruwes_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.coruwes_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.coruwes_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.coruwes_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.coruwes_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, } else buildings = { - { unitDefID = UDN.armuwes_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, - { unitDefID = UDN.armuwes_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.armuwes_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, - { unitDefID = UDN.armuwes_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.armuwes_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = UDN.armuwes_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.armuwes_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UDN.armuwes_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, } end @@ -114,20 +114,20 @@ end local function t1SeaBase5() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, } else buildings = { - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, } end @@ -141,38 +141,38 @@ end local function t1seaBase6() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corfrt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = -16, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -16, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 16, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = 16, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 16, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -16, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corfrt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 16, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corfdrag_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, } else buildings = { - { unitDefID = UDN.armfrt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 16, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = -16, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = 16, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 16, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -16, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armfdrag_scav.id, xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armfrt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 16, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armfdrag_scav.id, xOffset = -16, zOffset = 48, direction = 1 }, } end @@ -186,18 +186,18 @@ end local function t1SeaBase7() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.cortl_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corfrad_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.cortl_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.cortl_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corfrad_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.cortl_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, } else buildings = { - { unitDefID = UDN.armfrad_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armtl_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armtl_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armfrad_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armtl_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armtl_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, } end @@ -211,18 +211,18 @@ end local function t1SeaBase8() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.cortl_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corfhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.cortl_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = UDN.cortl_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corfhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.cortl_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, } else buildings = { - { unitDefID = UDN.armtl_scav.id, xOffset = 8, zOffset = 56, direction = 1 }, - { unitDefID = UDN.armtl_scav.id, xOffset = -8, zOffset = -56, direction = 1 }, - { unitDefID = UDN.armfhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armtl_scav.id, xOffset = 8, zOffset = 56, direction = 1 }, + { unitDefID = UDN.armtl_scav.id, xOffset = -8, zOffset = -56, direction = 1 }, + { unitDefID = UDN.armfhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, } end @@ -237,20 +237,20 @@ end -- Tech 2 local function t2SeaBase1() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwmmm_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, - { unitDefID = UDN.coruwmmm_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, - { unitDefID = UDN.coruwmmm_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, - { unitDefID = UDN.coruwmmm_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwmmm_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwmmm_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwmmm_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwmmm_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, } else buildings = { - { unitDefID = UDN.armuwmmm_scav.id, xOffset = -40, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwmmm_scav.id, xOffset = -40, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armuwmmm_scav.id, xOffset = 40, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armuwmmm_scav.id, xOffset = 40, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwmmm_scav.id, xOffset = -40, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwmmm_scav.id, xOffset = -40, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwmmm_scav.id, xOffset = 40, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwmmm_scav.id, xOffset = 40, zOffset = 32, direction = 0 }, } end @@ -264,20 +264,20 @@ end local function t2SeaBase2() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwadvms_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, - { unitDefID = UDN.coruwadvms_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, - { unitDefID = UDN.coruwadvms_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, - { unitDefID = UDN.coruwadvms_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.coruwadvms_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.coruwadvms_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.coruwadvms_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.coruwadvms_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, } else buildings = { - { unitDefID = UDN.armuwadvms_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwadvms_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armuwadvms_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwadvms_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwadvms_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwadvms_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwadvms_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwadvms_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, } end @@ -291,20 +291,20 @@ end local function t2SeaBase3() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwfus_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, - { unitDefID = UDN.coruwfus_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, - { unitDefID = UDN.coruwfus_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, - { unitDefID = UDN.coruwfus_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwfus_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwfus_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwfus_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwfus_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, } else buildings = { - { unitDefID = UDN.armuwfus_scav.id, xOffset = 48, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armuwfus_scav.id, xOffset = -48, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwfus_scav.id, xOffset = 48, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwfus_scav.id, xOffset = -48, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwfus_scav.id, xOffset = 48, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwfus_scav.id, xOffset = -48, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwfus_scav.id, xOffset = 48, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwfus_scav.id, xOffset = -48, zOffset = -32, direction = 0 }, } end @@ -317,22 +317,21 @@ local function t2SeaBase3() end local function t2SeaBase4() - local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coruwadves_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = -40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = 40, zOffset = -40, direction = 0 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = -40, zOffset = 40, direction = 0 }, } else buildings = { - { unitDefID = UDN.armuwadves_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, } end @@ -346,22 +345,22 @@ end local function t2SeaBase5() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corfdoom_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.corenaa_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, - { unitDefID = UDN.coratl_scav.id, xOffset = -72, zOffset = 8, direction = 0 }, - { unitDefID = UDN.corenaa_scav.id, xOffset = 0, zOffset = -80, direction = 0 }, - { unitDefID = UDN.coratl_scav.id, xOffset = 72, zOffset = -8, direction = 0 }, + { unitDefID = UDN.corfdoom_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.corenaa_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, + { unitDefID = UDN.coratl_scav.id, xOffset = -72, zOffset = 8, direction = 0 }, + { unitDefID = UDN.corenaa_scav.id, xOffset = 0, zOffset = -80, direction = 0 }, + { unitDefID = UDN.coratl_scav.id, xOffset = 72, zOffset = -8, direction = 0 }, } else buildings = { - { unitDefID = UDN.corfdoom_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armatl_scav.id, xOffset = -80, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armfflak_scav.id, xOffset = -8, zOffset = -72, direction = 0 }, - { unitDefID = UDN.armatl_scav.id, xOffset = 80, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armfflak_scav.id, xOffset = 8, zOffset = 72, direction = 0 }, + { unitDefID = UDN.corfdoom_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armatl_scav.id, xOffset = -80, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armfflak_scav.id, xOffset = -8, zOffset = -72, direction = 0 }, + { unitDefID = UDN.armatl_scav.id, xOffset = 80, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armfflak_scav.id, xOffset = 8, zOffset = 72, direction = 0 }, } end @@ -375,18 +374,18 @@ end local function t2SeaFactory1() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corsy_scav.id, xOffset = 0, zOffset = 6, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = -2, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = -2, direction = 0 }, + { unitDefID = UDN.corsy_scav.id, xOffset = 0, zOffset = 6, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = -2, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = -2, direction = 0 }, } else buildings = { - { unitDefID = UDN.armsy_scav.id, xOffset = 0, zOffset = 6, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 104, zOffset = -2, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -104, zOffset = -2, direction = 0 }, + { unitDefID = UDN.armsy_scav.id, xOffset = 0, zOffset = 6, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 104, zOffset = -2, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -104, zOffset = -2, direction = 0 }, } end @@ -400,18 +399,18 @@ end local function t2SeaFactory2() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corfhp_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = 0, direction = 0 }, + { unitDefID = UDN.corfhp_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = 0, direction = 0 }, } else buildings = { - { unitDefID = UDN.armfhp_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 104, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -104, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armfhp_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 104, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -104, zOffset = 0, direction = 0 }, } end @@ -425,18 +424,18 @@ end local function t2SeaFactory3() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.coramsub_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = 3, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = 3, direction = 0 }, + { unitDefID = UDN.coramsub_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 104, zOffset = 3, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -104, zOffset = 3, direction = 0 }, } else buildings = { - { unitDefID = UDN.armamsub_scav.id, xOffset = 6, zOffset = -16, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 94, zOffset = 8, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -98, zOffset = 8, direction = 0 }, + { unitDefID = UDN.armamsub_scav.id, xOffset = 6, zOffset = -16, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 94, zOffset = 8, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -98, zOffset = 8, direction = 0 }, } end @@ -450,18 +449,18 @@ end local function t2SeaFactory4() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corplat_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 96, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -96, zOffset = 0, direction = 0 }, + { unitDefID = UDN.corplat_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -96, zOffset = 0, direction = 0 }, } else buildings = { - { unitDefID = UDN.armplat_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -96, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armplat_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -96, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 96, zOffset = 0, direction = 0 }, } end @@ -475,18 +474,18 @@ end local function t2SeaFactory5() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corasy_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -136, zOffset = 3, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 136, zOffset = 3, direction = 0 }, + { unitDefID = UDN.corasy_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -136, zOffset = 3, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 136, zOffset = 3, direction = 0 }, } else buildings = { - { unitDefID = UDN.armasy_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 136, zOffset = 3, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -136, zOffset = 3, direction = 0 }, + { unitDefID = UDN.armasy_scav.id, xOffset = 0, zOffset = -5, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 136, zOffset = 3, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -136, zOffset = 3, direction = 0 }, } end @@ -501,26 +500,26 @@ end -- Tech 3 local function t3SeaFactory1() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.corgantuw_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = -48, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = -48, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = 48, direction = 0 }, - { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = 48, direction = 0 }, + { unitDefID = UDN.corgantuw_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = -48, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = -48, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = 112, zOffset = 48, direction = 0 }, + { unitDefID = UDN.cornanotcplat_scav.id, xOffset = -112, zOffset = 48, direction = 0 }, } else buildings = { - { unitDefID = UDN.armshltxuw_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = -48, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = 48, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = 48, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = -48, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = 0, direction = 0 }, - { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armshltxuw_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = -48, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = 48, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = 48, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = -48, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = -112, zOffset = 0, direction = 0 }, + { unitDefID = UDN.armnanotcplat_scav.id, xOffset = 112, zOffset = 0, direction = 0 }, } end @@ -552,4 +551,4 @@ return { t2SeaFactory4, t2SeaFactory5, t3SeaFactory1, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_factory_centers.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_factory_centers.lua index 2676754cfda..1c28601de13 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_factory_centers.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Damgam_factory_centers.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -16,216 +16,216 @@ local function t1UnitSpammer() local r = math_random(0, 2) if r == 0 then buildings = { - { unitDefID = UDN.cormadsam_scav.id, xOffset = -24, zOffset = -24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -24, zOffset = 24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 24, zOffset = -24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 24, zOffset = 24, direction = 2 }, - - { unitDefID = UDN.corlab_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corlab_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, - { unitDefID = UDN.corlab_scav.id, xOffset = 0, zOffset = 96, direction = 0 }, - { unitDefID = UDN.corlab_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, - - { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = -120, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -120, zOffset = -72, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = 120, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = 120, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = 72, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 120, zOffset = -72, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = -72, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = 72, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = -120, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -120, zOffset = 72, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 120, zOffset = 72, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = -72, direction = 1 }, - - { unitDefID = UDN.corpun_scav.id, xOffset = -128, zOffset = -128, direction = 3 }, - { unitDefID = UDN.corpun_scav.id, xOffset = -128, zOffset = 128, direction = 3 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 128, zOffset = 128, direction = 1 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 128, zOffset = -128, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -24, zOffset = -24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -24, zOffset = 24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 24, zOffset = -24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 24, zOffset = 24, direction = 2 }, + + { unitDefID = UDN.corlab_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corlab_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = UDN.corlab_scav.id, xOffset = 0, zOffset = 96, direction = 0 }, + { unitDefID = UDN.corlab_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, + + { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = -120, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -120, zOffset = -72, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = 120, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = 120, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = 72, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 120, zOffset = -72, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 72, zOffset = -72, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = 72, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = -120, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -120, zOffset = 72, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 120, zOffset = 72, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -72, zOffset = -72, direction = 1 }, + + { unitDefID = UDN.corpun_scav.id, xOffset = -128, zOffset = -128, direction = 3 }, + { unitDefID = UDN.corpun_scav.id, xOffset = -128, zOffset = 128, direction = 3 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 128, zOffset = 128, direction = 1 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 128, zOffset = -128, direction = 1 }, } elseif r == 1 then buildings = { - { unitDefID = UDN.cormadsam_scav.id, xOffset = -32, zOffset = 32, direction = 3 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -32, zOffset = -32, direction = 3 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 32, zOffset = -32, direction = 3 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 32, zOffset = 32, direction = 3 }, - - { unitDefID = UDN.corvp_scav.id, xOffset = 0, zOffset = -112, direction = 2 }, - { unitDefID = UDN.corvp_scav.id, xOffset = 0, zOffset = 112, direction = 0 }, - { unitDefID = UDN.corvp_scav.id, xOffset = 112, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corvp_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, - - { unitDefID = UDN.cornanotc_scav.id, xOffset = -128, zOffset = 80, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -128, zOffset = -80, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = 80, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 128, zOffset = 80, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = 80, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 128, zOffset = -80, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = 128, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = -128, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = 128, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = -80, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = -80, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = -128, direction = 2 }, - - { unitDefID = UDN.corpun_scav.id, xOffset = -136, zOffset = 136, direction = 3 }, - { unitDefID = UDN.corpun_scav.id, xOffset = -136, zOffset = -136, direction = 3 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 136, zOffset = 136, direction = 1 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 136, zOffset = -136, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -32, zOffset = 32, direction = 3 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -32, zOffset = -32, direction = 3 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 32, zOffset = -32, direction = 3 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 32, zOffset = 32, direction = 3 }, + + { unitDefID = UDN.corvp_scav.id, xOffset = 0, zOffset = -112, direction = 2 }, + { unitDefID = UDN.corvp_scav.id, xOffset = 0, zOffset = 112, direction = 0 }, + { unitDefID = UDN.corvp_scav.id, xOffset = 112, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corvp_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, + + { unitDefID = UDN.cornanotc_scav.id, xOffset = -128, zOffset = 80, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -128, zOffset = -80, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 128, zOffset = 80, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = 80, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 128, zOffset = -80, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = 128, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = -128, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = 128, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = -80, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -80, zOffset = -80, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 80, zOffset = -128, direction = 2 }, + + { unitDefID = UDN.corpun_scav.id, xOffset = -136, zOffset = 136, direction = 3 }, + { unitDefID = UDN.corpun_scav.id, xOffset = -136, zOffset = -136, direction = 3 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 136, zOffset = 136, direction = 1 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 136, zOffset = -136, direction = 1 }, } elseif r == 2 then buildings = { - { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = 32, direction = 0 }, - { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = -32, direction = 2 }, - - { unitDefID = UDN.cormadsam_scav.id, xOffset = 40, zOffset = 24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -40, zOffset = 24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 40, zOffset = -24, direction = 2 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -40, zOffset = -24, direction = 2 }, - - { unitDefID = UDN.corap_scav.id, xOffset = 128, zOffset = 0, direction = 2 }, - { unitDefID = UDN.corap_scav.id, xOffset = -128, zOffset = 0, direction = 2 }, - { unitDefID = UDN.corap_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, - { unitDefID = UDN.corap_scav.id, xOffset = 0, zOffset = 96, direction = 2 }, - - { unitDefID = UDN.cornanotc_scav.id, xOffset = -136, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 184, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = 120, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = -120, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = 72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 136, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -136, zOffset = 72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = 72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -184, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 184, zOffset = 72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = -72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 136, zOffset = 72, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = -120, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = 120, direction = 2 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -184, zOffset = 72, direction = 2 }, - - { unitDefID = UDN.corpun_scav.id, xOffset = -144, zOffset = 128, direction = 0 }, - { unitDefID = UDN.corpun_scav.id, xOffset = -208, zOffset = 128, direction = 0 }, - { unitDefID = UDN.corpun_scav.id, xOffset = -144, zOffset = -128, direction = 2 }, - { unitDefID = UDN.corpun_scav.id, xOffset = -208, zOffset = -128, direction = 2 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 208, zOffset = -128, direction = 2 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 144, zOffset = 128, direction = 0 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 208, zOffset = 128, direction = 0 }, - { unitDefID = UDN.corpun_scav.id, xOffset = 144, zOffset = -128, direction = 2 }, + { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = 32, direction = 0 }, + { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corhlt_scav.id, xOffset = 0, zOffset = -32, direction = 2 }, + + { unitDefID = UDN.cormadsam_scav.id, xOffset = 40, zOffset = 24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -40, zOffset = 24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 40, zOffset = -24, direction = 2 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -40, zOffset = -24, direction = 2 }, + + { unitDefID = UDN.corap_scav.id, xOffset = 128, zOffset = 0, direction = 2 }, + { unitDefID = UDN.corap_scav.id, xOffset = -128, zOffset = 0, direction = 2 }, + { unitDefID = UDN.corap_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = UDN.corap_scav.id, xOffset = 0, zOffset = 96, direction = 2 }, + + { unitDefID = UDN.cornanotc_scav.id, xOffset = -136, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 184, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = 120, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = -120, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = 72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 136, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -136, zOffset = 72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = 72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -184, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 184, zOffset = 72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = -72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 136, zOffset = 72, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 88, zOffset = -120, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -88, zOffset = 120, direction = 2 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -184, zOffset = 72, direction = 2 }, + + { unitDefID = UDN.corpun_scav.id, xOffset = -144, zOffset = 128, direction = 0 }, + { unitDefID = UDN.corpun_scav.id, xOffset = -208, zOffset = 128, direction = 0 }, + { unitDefID = UDN.corpun_scav.id, xOffset = -144, zOffset = -128, direction = 2 }, + { unitDefID = UDN.corpun_scav.id, xOffset = -208, zOffset = -128, direction = 2 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 208, zOffset = -128, direction = 2 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 144, zOffset = 128, direction = 0 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 208, zOffset = 128, direction = 0 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 144, zOffset = -128, direction = 2 }, } elseif r == 3 then buildings = { - { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = 24, direction = 3 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = -24, direction = 3 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = -24, direction = 3 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = 24, direction = 3 }, - - { unitDefID = UDN.armlab_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, - { unitDefID = UDN.armlab_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armlab_scav.id, xOffset = 0, zOffset = 96, direction = 0 }, - { unitDefID = UDN.armlab_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, - - { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, - - { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = -120, direction = 1 }, - { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = 120, direction = 1 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = 120, direction = 3 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = 24, direction = 3 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = -24, direction = 3 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = -24, direction = 3 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = 24, direction = 3 }, + + { unitDefID = UDN.armlab_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = UDN.armlab_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armlab_scav.id, xOffset = 0, zOffset = 96, direction = 0 }, + { unitDefID = UDN.armlab_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, + + { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, + + { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = -120, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = 120, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = -120, direction = 3 }, } elseif r == 4 then buildings = { - { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = 24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = -24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = -24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = 24, direction = 2 }, - - { unitDefID = UDN.armvp_scav.id, xOffset = 0, zOffset = -104, direction = 2 }, - { unitDefID = UDN.armvp_scav.id, xOffset = -104, zOffset = 0, direction = 3 }, - { unitDefID = UDN.armvp_scav.id, xOffset = 0, zOffset = 104, direction = 0 }, - { unitDefID = UDN.armvp_scav.id, xOffset = 104, zOffset = 0, direction = 1 }, - - { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 120, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, - - { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = 120, direction = 1 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = -120, direction = 3 }, - { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = -120, direction = 1 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = 24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = -24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 24, zOffset = -24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -24, zOffset = 24, direction = 2 }, + + { unitDefID = UDN.armvp_scav.id, xOffset = 0, zOffset = -104, direction = 2 }, + { unitDefID = UDN.armvp_scav.id, xOffset = -104, zOffset = 0, direction = 3 }, + { unitDefID = UDN.armvp_scav.id, xOffset = 0, zOffset = 104, direction = 0 }, + { unitDefID = UDN.armvp_scav.id, xOffset = 104, zOffset = 0, direction = 1 }, + + { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 120, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 120, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -120, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, + + { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = 120, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = -120, direction = 3 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 120, zOffset = -120, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -120, zOffset = 120, direction = 3 }, } elseif r == 5 then buildings = { - { unitDefID = UDN.armferret_scav.id, xOffset = 0, zOffset = 24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = 24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -48, zOffset = -24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = -24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -48, zOffset = 24, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 0, zOffset = -24, direction = 2 }, - - { unitDefID = UDN.armap_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, - { unitDefID = UDN.armap_scav.id, xOffset = -144, zOffset = 0, direction = 2 }, - { unitDefID = UDN.armap_scav.id, xOffset = 144, zOffset = 0, direction = 2 }, - { unitDefID = UDN.armap_scav.id, xOffset = 0, zOffset = 96, direction = 2 }, - - { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = -120, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 144, zOffset = 72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = 72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = -120, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = 120, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 192, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -144, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = 120, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -192, zOffset = 72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -192, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = 72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 144, zOffset = -72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 192, zOffset = 72, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -144, zOffset = 72, direction = 2 }, - - { unitDefID = UDN.armguard_scav.id, xOffset = 144, zOffset = 120, direction = 0 }, - { unitDefID = UDN.armguard_scav.id, xOffset = 144, zOffset = -120, direction = 2 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -144, zOffset = 120, direction = 0 }, - { unitDefID = UDN.armguard_scav.id, xOffset = 192, zOffset = 120, direction = 0 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -192, zOffset = 120, direction = 0 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -144, zOffset = -120, direction = 2 }, - { unitDefID = UDN.armguard_scav.id, xOffset = -192, zOffset = -120, direction = 2 }, - { unitDefID = UDN.armguard_scav.id, xOffset = 192, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 0, zOffset = 24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = 24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -48, zOffset = -24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = -24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -48, zOffset = 24, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 0, zOffset = -24, direction = 2 }, + + { unitDefID = UDN.armap_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = UDN.armap_scav.id, xOffset = -144, zOffset = 0, direction = 2 }, + { unitDefID = UDN.armap_scav.id, xOffset = 144, zOffset = 0, direction = 2 }, + { unitDefID = UDN.armap_scav.id, xOffset = 0, zOffset = 96, direction = 2 }, + + { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 144, zOffset = 72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = 72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = 120, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 192, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -96, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -144, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = 120, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -192, zOffset = 72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -192, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 96, zOffset = 72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 144, zOffset = -72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 192, zOffset = 72, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -144, zOffset = 72, direction = 2 }, + + { unitDefID = UDN.armguard_scav.id, xOffset = 144, zOffset = 120, direction = 0 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 144, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -144, zOffset = 120, direction = 0 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 192, zOffset = 120, direction = 0 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -192, zOffset = 120, direction = 0 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -144, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armguard_scav.id, xOffset = -192, zOffset = -120, direction = 2 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 192, zOffset = -120, direction = 2 }, } end return { type = types.Land, tiers = { tiers.T3, tiers.T4 }, - radius = 192, + radius = 192, buildings = buildings, } end return { t1UnitSpammer, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/IronFist_Defences.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/IronFist_Defences.lua index bc2414f2957..c38fa1ff6b3 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/IronFist_Defences.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/IronFist_Defences.lua @@ -1,28 +1,27 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames - local function blueprint0() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 48, direction = 2}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 48, direction = 2 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, }, } end @@ -30,36 +29,36 @@ end local function blueprint1() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 146, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -78, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 18, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 82, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 146, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -110, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -142, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 50, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 114, zOffset = 62, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -14, zOffset = 62, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -70, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 138, zOffset = 6, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 42, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -150, zOffset = 6, direction = 0}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -126, zOffset = -98, direction = 0}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 114, zOffset = -98, direction = 0}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 50, zOffset = -98, direction = 0}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -102, zOffset = -42, direction = 0}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 106, zOffset = -42, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 58, zOffset = -138, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -70, zOffset = -90, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 50, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -46, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -94, zOffset = 14, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 98, zOffset = 14, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 2, zOffset = 14, direction = 0}, - { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -14, zOffset = -50, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -78, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 18, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 82, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 146, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -110, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -142, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 50, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 114, zOffset = 62, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -14, zOffset = 62, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -70, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 138, zOffset = 6, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 42, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -150, zOffset = 6, direction = 0 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -126, zOffset = -98, direction = 0 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 114, zOffset = -98, direction = 0 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 50, zOffset = -98, direction = 0 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -102, zOffset = -42, direction = 0 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 106, zOffset = -42, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 58, zOffset = -138, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -70, zOffset = -90, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 50, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -46, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -94, zOffset = 14, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 98, zOffset = 14, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 2, zOffset = 14, direction = 0 }, + { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -14, zOffset = -50, direction = 0 }, }, } end @@ -67,48 +66,47 @@ end local function blueprint2() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 156, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 153, zOffset = -36, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = -4, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -7, zOffset = 60, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 153, zOffset = -100, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 89, zOffset = -36, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 153, zOffset = -68, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 121, zOffset = -36, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = -36, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = 28, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = 60, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = 92, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -95, zOffset = -60, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -127, zOffset = 116, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 113, zOffset = -140, direction = 0}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -15, zOffset = -28, direction = 0}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -55, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 9, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = -135, zOffset = -68, direction = 0}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -127, zOffset = 52, direction = 0}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 49, zOffset = -124, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -127, zOffset = -12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -15, zOffset = -124, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -71, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 57, zOffset = -68, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 9, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 105, zOffset = -84, direction = 0}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -87, zOffset = 108, direction = 0}, - { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -55, zOffset = -52, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 153, zOffset = -36, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = -4, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -7, zOffset = 60, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 153, zOffset = -100, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 89, zOffset = -36, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 153, zOffset = -68, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 121, zOffset = -36, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = -36, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = 28, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = 60, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = 92, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -95, zOffset = -60, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -127, zOffset = 116, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 113, zOffset = -140, direction = 0 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -15, zOffset = -28, direction = 0 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -55, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 9, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = -135, zOffset = -68, direction = 0 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -127, zOffset = 52, direction = 0 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 49, zOffset = -124, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -127, zOffset = -12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -15, zOffset = -124, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -71, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 57, zOffset = -68, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 9, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 105, zOffset = -84, direction = 0 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -87, zOffset = 108, direction = 0 }, + { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -55, zOffset = -52, direction = 0 }, }, } end - return { - blueprint0, - blueprint1, - blueprint2, -} \ No newline at end of file + blueprint0, + blueprint1, + blueprint2, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_land.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_land.lua index 700639fd94e..ebae2f9458e 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_land.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_land.lua @@ -1,100 +1,99 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames - local function IRON_BEAM_RING() return { type = types.Land, tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 144, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -144, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -144, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 144, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 144, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -144, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -144, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 144, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -105,21 +104,21 @@ local function PROTECTED_REACTOR() tiers = { tiers.T3, tiers.T4 }, radius = 127, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 63, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 63, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -129, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 127, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -88, zOffset = 7, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 88, zOffset = 7, direction = 1}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 0, zOffset = -1, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 63, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 63, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -129, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 127, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -88, zOffset = 7, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 88, zOffset = 7, direction = 1 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 0, zOffset = -1, direction = 1 }, }, } end @@ -130,34 +129,34 @@ local function PROTECTED_FAST_GANTRY() tiers = { tiers.T4 }, radius = 136, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = -88, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -2, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 94, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -82, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = 88, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -34, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -82, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -82, zOffset = 24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 62, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -2, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -34, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 62, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -82, zOffset = -24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 94, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 102, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 6, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 54, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 6, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 102, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 54, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -34, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -34, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.corgant_scav.id, xOffset = 54, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = -88, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -2, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 94, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -82, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = 88, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -34, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -82, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -82, zOffset = 24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 62, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -2, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -34, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 62, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -82, zOffset = -24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 94, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 102, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 6, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 54, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 6, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 102, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 54, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -42, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -34, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -34, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.corgant_scav.id, xOffset = 54, zOffset = 0, direction = 1 }, }, } end @@ -168,28 +167,28 @@ local function VIPER_PIT() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 154, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -154, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = -53, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -58, zOffset = 91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 22, zOffset = 91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = 123, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = -149, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = 27, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 6, zOffset = -149, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -154, zOffset = 11, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = 11, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = -53, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = 27, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 22, zOffset = -117, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 6, zOffset = 123, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -58, zOffset = -117, direction = 2}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -26, zOffset = -21, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -18, zOffset = -109, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 78, zOffset = -13, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -18, zOffset = 83, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -114, zOffset = -13, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 6, zOffset = -21, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -154, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = -53, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -58, zOffset = 91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 22, zOffset = 91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = 123, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = -149, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = 27, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 6, zOffset = -149, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -154, zOffset = 11, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = 11, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = -53, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = 27, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 22, zOffset = -117, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 6, zOffset = 123, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -58, zOffset = -117, direction = 2 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -26, zOffset = -21, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -18, zOffset = -109, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 78, zOffset = -13, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -18, zOffset = 83, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -114, zOffset = -13, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 6, zOffset = -21, direction = 0 }, }, } end @@ -200,31 +199,31 @@ local function PROTECTED_ARTI_X() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 152, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -112, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 112, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 112, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -112, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 64, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -64, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -64, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 64, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 0, zOffset = 0, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -112, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 112, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 112, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -112, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 64, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -64, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -64, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 64, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, }, } end @@ -235,27 +234,27 @@ local function PROTECTED_ARTI() tiers = { tiers.T3, tiers.T4 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 80, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -80, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 80, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -80, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corbuzz_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 80, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -80, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -80, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corbuzz_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -266,30 +265,30 @@ local function ANTI_AA_ANTI_NUKE() tiers = { tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 292, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -44, zOffset = 105, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 84, zOffset = -23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -108, zOffset = 41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 20, zOffset = 105, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -108, zOffset = -23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 20, zOffset = -87, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -44, zOffset = -87, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 84, zOffset = 41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 52, zOffset = 105, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = 105, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 84, zOffset = 9, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = -55, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 73, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = -87, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 84, zOffset = 73, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 9, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = -87, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = 105, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 84, zOffset = -55, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 52, zOffset = -87, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -60, zOffset = 57, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 36, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 36, zOffset = 57, direction = 1}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -60, zOffset = -39, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -44, zOffset = 105, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 84, zOffset = -23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -108, zOffset = 41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 20, zOffset = 105, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -108, zOffset = -23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 20, zOffset = -87, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -44, zOffset = -87, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 84, zOffset = 41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 52, zOffset = 105, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = 105, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 84, zOffset = 9, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = -55, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 73, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = -87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 84, zOffset = 73, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 9, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = -87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = 105, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 84, zOffset = -55, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 52, zOffset = -87, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -60, zOffset = 57, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 36, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 36, zOffset = 57, direction = 1 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -60, zOffset = -39, direction = 1 }, }, } end @@ -300,23 +299,23 @@ local function QUAD_LTT_OUTPOST() tiers = { tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 0, zOffset = 0, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 0, zOffset = 0, direction = 2 }, }, } end @@ -327,39 +326,39 @@ local function PROTECTED_BOTS() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = -96, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = 96, direction = 0}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 96, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 32, zOffset = 32, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -32, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -32, zOffset = 32, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 32, zOffset = -32, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = -96, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = 96, direction = 0 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 32, zOffset = 32, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -32, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -32, zOffset = 32, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 32, zOffset = -32, direction = 2 }, }, } end @@ -370,27 +369,27 @@ local function EMP_LASER() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 117, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -107, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = -107, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 53, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 21, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 117, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 21, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -75, zOffset = -11, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -11, zOffset = 117, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -11, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 21, zOffset = 117, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 117, zOffset = -11, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -75, zOffset = 117, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -107, zOffset = 85, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 117, zOffset = 21, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 85, zOffset = -107, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -75, zOffset = 21, direction = 1}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 85, zOffset = 85, direction = 1}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -75, zOffset = -75, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -59, zOffset = 69, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 69, zOffset = -59, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 5, zOffset = 5, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = -107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 53, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 21, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 117, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 21, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -75, zOffset = -11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -11, zOffset = 117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -11, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 21, zOffset = 117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 117, zOffset = -11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -75, zOffset = 117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -107, zOffset = 85, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 117, zOffset = 21, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 85, zOffset = -107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -75, zOffset = 21, direction = 1 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 85, zOffset = 85, direction = 1 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -75, zOffset = -75, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -59, zOffset = 69, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 69, zOffset = -59, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 5, zOffset = 5, direction = 1 }, }, } end @@ -401,46 +400,46 @@ local function CLOAKED_FORT() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 168, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -72, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 72, zOffset = -104, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 64, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = -64, zOffset = -96, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -72, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 72, zOffset = -104, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 64, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = -64, zOffset = -96, direction = 1 }, }, } end @@ -451,31 +450,31 @@ local function ROCKET_STATION() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 64, zOffset = -48, direction = 2}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -64, zOffset = 48, direction = 2}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = 48, zOffset = 64, direction = 2}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -48, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 8, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -8, zOffset = 64, direction = 2}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 64, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -64, zOffset = -8, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -128, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 0, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 0, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 128, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 64, zOffset = -48, direction = 2 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -64, zOffset = 48, direction = 2 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = 48, zOffset = 64, direction = 2 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -48, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 8, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -8, zOffset = 64, direction = 2 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 64, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -64, zOffset = -8, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -128, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 0, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 0, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 128, zOffset = 0, direction = 1 }, }, } end @@ -486,22 +485,22 @@ local function Snake_Missle() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 118, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -2, zOffset = 67, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = -29, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = 35, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = 67, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -34, zOffset = -29, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -34, zOffset = 67, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -2, zOffset = -29, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = -29, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -66, zOffset = 67, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 30, zOffset = 35, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 6, zOffset = -117, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 118, zOffset = -117, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 118, zOffset = -5, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -18, zOffset = 19, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -2, zOffset = 67, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = -29, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = 35, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = 67, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -34, zOffset = -29, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -34, zOffset = 67, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -2, zOffset = -29, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = -29, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -66, zOffset = 67, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 30, zOffset = 35, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 6, zOffset = -117, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 118, zOffset = -117, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 118, zOffset = -5, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -18, zOffset = 19, direction = 1 }, }, } end @@ -512,24 +511,24 @@ local function Power_fort_1() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 188, buildings = { - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 180, zOffset = -108, direction = 1}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -108, zOffset = 164, direction = 1}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 52, zOffset = 20, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -132, zOffset = 172, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -68, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 44, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 76, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 188, zOffset = -132, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 60, zOffset = -4, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = -36, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 28, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 108, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 156, zOffset = -100, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -100, zOffset = 140, direction = 1}, - { unitDefID = UnitDefNames.corscreamer_scav.id, xOffset = -148, zOffset = -116, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 4, zOffset = -156, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -92, zOffset = -60, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -188, zOffset = 36, direction = 1}, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 180, zOffset = -108, direction = 1 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -108, zOffset = 164, direction = 1 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 52, zOffset = 20, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -132, zOffset = 172, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -68, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 44, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 76, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 188, zOffset = -132, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 60, zOffset = -4, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = -36, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 28, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 108, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 156, zOffset = -100, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -100, zOffset = 140, direction = 1 }, + { unitDefID = UnitDefNames.corscreamer_scav.id, xOffset = -148, zOffset = -116, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 4, zOffset = -156, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -92, zOffset = -60, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = -188, zOffset = 36, direction = 1 }, }, } end @@ -540,34 +539,34 @@ local function Power_fort_2() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 172, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 108, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = -20, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 172, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = 172, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -68, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -132, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -164, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = 76, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = -68, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = -52, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = -52, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 76, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -100, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 12, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 140, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 44, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = -164, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 44, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -212, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -164, zOffset = -4, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -228, zOffset = -4, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -212, zOffset = -36, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -180, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -180, zOffset = -36, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -196, zOffset = -4, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 76, zOffset = -116, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 76, zOffset = 124, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -52, zOffset = -4, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 108, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = -20, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 172, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = 172, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -68, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -132, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -164, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = 76, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = -68, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = -52, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = -52, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 76, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -100, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 12, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 140, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 44, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = -164, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 44, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -212, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -164, zOffset = -4, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -228, zOffset = -4, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -212, zOffset = -36, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -180, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -180, zOffset = -36, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -196, zOffset = -4, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 76, zOffset = -116, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 76, zOffset = 124, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -52, zOffset = -4, direction = 1 }, }, } end @@ -578,13 +577,13 @@ local function T1_short_def() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 168, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 34, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 2, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 2, direction = 1}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 0, zOffset = -6, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 136, zOffset = 2, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -136, zOffset = 2, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 34, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 2, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 2, direction = 1 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 0, zOffset = -6, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 136, zOffset = 2, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -136, zOffset = 2, direction = 1 }, }, } end @@ -595,20 +594,20 @@ local function Punisher_wall() tiers = { tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 124, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 60, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 60, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 92, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 92, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 28, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -36, zOffset = 60, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -84, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -52, zOffset = -116, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -4, zOffset = -132, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = 60, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = -36, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = -132, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 60, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 60, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 92, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 92, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 28, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -36, zOffset = 60, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -84, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -52, zOffset = -116, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -4, zOffset = -132, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = 60, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = -36, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 124, zOffset = -132, direction = 1 }, }, } end @@ -619,19 +618,19 @@ local function T1_long_def() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 98, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 66, zOffset = -62, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 98, zOffset = 66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -62, zOffset = 66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 66, zOffset = 98, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 98, zOffset = -30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = 98, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 50, zOffset = 50, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -14, zOffset = 50, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 50, zOffset = -14, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -78, zOffset = -78, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -142, zOffset = -142, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -190, zOffset = -190, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 98, zOffset = 98, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 66, zOffset = -62, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 98, zOffset = 66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -62, zOffset = 66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 66, zOffset = 98, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 98, zOffset = -30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = 98, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 50, zOffset = 50, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -14, zOffset = 50, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 50, zOffset = -14, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -78, zOffset = -78, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -142, zOffset = -142, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -190, zOffset = -190, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 98, zOffset = 98, direction = 1 }, }, } end @@ -642,21 +641,21 @@ local function T1_short_def() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -101, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -37, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -133, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -165, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 27, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -5, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -101, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 27, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -165, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -37, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 107, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 171, zOffset = -144, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -101, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -37, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -133, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -165, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 27, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -5, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -101, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 27, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -165, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -37, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 107, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 171, zOffset = -144, direction = 1 }, }, } end @@ -667,18 +666,18 @@ local function Rocket_AA_R() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 87, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 23, zOffset = -41, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 55, zOffset = -9, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 87, zOffset = -41, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -73, zOffset = 55, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 55, zOffset = -73, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -41, zOffset = 23, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -41, zOffset = 87, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -9, zOffset = 55, direction = 1}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -73, zOffset = -73, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -41, zOffset = 55, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 55, zOffset = -41, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 7, zOffset = 7, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 23, zOffset = -41, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 55, zOffset = -9, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 87, zOffset = -41, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -73, zOffset = 55, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 55, zOffset = -73, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -41, zOffset = 23, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -41, zOffset = 87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -9, zOffset = 55, direction = 1 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -73, zOffset = -73, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -41, zOffset = 55, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 55, zOffset = -41, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 7, zOffset = 7, direction = 1 }, }, } end @@ -689,25 +688,25 @@ local function RES_AA_hidden() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 90, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -198, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -166, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -70, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 154, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 154, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -102, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -198, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 58, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 106, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.corsd_scav.id, xOffset = -150, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 10, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -54, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 10, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 74, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -70, zOffset = 64, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 90, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -198, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -166, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -70, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 154, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 154, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -102, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -198, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 58, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 106, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.corsd_scav.id, xOffset = -150, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 10, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -54, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 10, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 74, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -70, zOffset = 64, direction = 1 }, }, } end @@ -718,30 +717,30 @@ local function Punisher_3x() tiers = { tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 152, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -150, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -150, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -150, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -118, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -118, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -214, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -214, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -102, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 26, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 26, zOffset = 24, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -150, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -150, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -150, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -118, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -118, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -214, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -214, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = -102, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 26, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 26, zOffset = 24, direction = 1 }, }, } end @@ -752,43 +751,43 @@ local function Front_gate_1() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 0, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 88, zOffset = 88, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 88, zOffset = 88, direction = 1 }, }, } end return { - IRON_BEAM_RING, - PROTECTED_GANTRY, - PROTECTED_FAST_GANTRY, - VIPER_PIT, - PROTECTED_ARTI_X, - PROTECTED_ARTI, - ANTI_AA_ANTI_NUKE, - QUAD_LTT_OUTPOST, - PROTECTED_BOTS, - EMP_LASER, - CLOAKED_FORT, - ROCKET_STATION, - Snake_Missle, + IRON_BEAM_RING, + PROTECTED_GANTRY, + PROTECTED_FAST_GANTRY, + VIPER_PIT, + PROTECTED_ARTI_X, + PROTECTED_ARTI, + ANTI_AA_ANTI_NUKE, + QUAD_LTT_OUTPOST, + PROTECTED_BOTS, + EMP_LASER, + CLOAKED_FORT, + ROCKET_STATION, + Snake_Missle, Power_fort_1, - Power_fort_2, - T1_short_def, - Punisher_wall, - T1_long_def, - T1_short_def, - Rocket_AA_R, - RES_AA_hidden, - Punisher_3x, - Front_gate_1, + Power_fort_2, + T1_short_def, + Punisher_wall, + T1_long_def, + T1_short_def, + Rocket_AA_R, + RES_AA_hidden, + Punisher_3x, + Front_gate_1, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_sea.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_sea.lua index 97e2389593b..b2808b58a67 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_sea.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/KrashKourse_sea.lua @@ -1,41 +1,40 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames - local function WATER_OUTPOST() return { type = types.Sea, tiers = { tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 183, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 56, zOffset = -169, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 23, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -56, zOffset = -169, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = 183, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -9, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 183, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = -137, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = 183, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -9, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -41, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 23, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 24, zOffset = -169, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 183, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -24, zOffset = -169, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -41, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = -137, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 151, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 151, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -56, zOffset = 135, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 56, zOffset = 135, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -48, zOffset = -129, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 48, zOffset = -129, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 0, zOffset = 79, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 96, zOffset = -33, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = -96, zOffset = -33, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 0, zOffset = -33, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 56, zOffset = -169, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 23, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -56, zOffset = -169, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = 183, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -9, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 183, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = -137, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = 183, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -9, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -41, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 23, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 24, zOffset = -169, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 183, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -24, zOffset = -169, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -41, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = -137, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 151, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 151, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -56, zOffset = 135, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 56, zOffset = 135, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -48, zOffset = -129, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 48, zOffset = -129, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 0, zOffset = 79, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 96, zOffset = -33, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = -96, zOffset = -33, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 0, zOffset = -33, direction = 0 }, }, } end @@ -46,40 +45,40 @@ local function AMPHIB_FACTORY() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 191, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 95, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 63, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -193, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -33, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -129, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -33, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -129, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -97, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 31, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 127, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -161, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 191, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 127, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -1, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 63, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 159, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -161, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 159, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 191, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 31, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 95, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -65, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -65, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -97, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -1, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -193, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -169, zOffset = -47, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 183, zOffset = -47, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 183, zOffset = 49, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -169, zOffset = 49, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 7, zOffset = 49, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 7, zOffset = -47, direction = 0}, - { unitDefID = UnitDefNames.coramsub_scav.id, xOffset = 95, zOffset = -7, direction = 0}, - { unitDefID = UnitDefNames.coramsub_scav.id, xOffset = -81, zOffset = -7, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 95, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 63, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -193, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -33, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -129, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -33, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -129, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -97, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 31, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 127, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -161, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 191, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 127, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -1, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 63, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 159, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -161, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 159, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 191, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 31, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 95, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -65, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -65, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -97, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -1, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -193, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -169, zOffset = -47, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 183, zOffset = -47, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 183, zOffset = 49, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -169, zOffset = 49, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 7, zOffset = 49, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 7, zOffset = -47, direction = 0 }, + { unitDefID = UnitDefNames.coramsub_scav.id, xOffset = 95, zOffset = -7, direction = 0 }, + { unitDefID = UnitDefNames.coramsub_scav.id, xOffset = -81, zOffset = -7, direction = 0 }, }, } end @@ -90,48 +89,48 @@ local function SEA_PLANE_SPAM() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 168, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = -104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = -104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = 136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = -136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = -136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = 136, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 72, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 168, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 72, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -120, zOffset = -120, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 120, zOffset = 120, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -120, zOffset = 120, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 120, zOffset = -120, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 32, zOffset = -32, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -32, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 0, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 112, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corplat_scav.id, xOffset = -112, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 0, zOffset = -112, direction = 2}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = -104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = -104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = 136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = -136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 168, zOffset = -136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = 136, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = -72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -168, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = -168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 136, zOffset = 72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 72, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 168, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -136, zOffset = 72, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -120, zOffset = -120, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 120, zOffset = 120, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -120, zOffset = 120, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 120, zOffset = -120, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 0, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 112, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corplat_scav.id, xOffset = -112, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corplat_scav.id, xOffset = 0, zOffset = -112, direction = 2 }, }, } end @@ -142,31 +141,31 @@ local function WATER_FORT() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -96, zOffset = 148, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -64, zOffset = 180, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 208, zOffset = -108, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -96, zOffset = 116, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 32, zOffset = 180, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -208, zOffset = -140, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -144, zOffset = -172, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 208, zOffset = -140, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 64, zOffset = 180, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 96, zOffset = 148, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 144, zOffset = -172, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -32, zOffset = 180, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 96, zOffset = 116, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 176, zOffset = -172, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -208, zOffset = -108, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -176, zOffset = -172, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 24, zOffset = -20, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = -24, zOffset = -20, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -56, zOffset = 140, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 168, zOffset = -132, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 56, zOffset = 140, direction = 0}, - { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -168, zOffset = -132, direction = 0}, - { unitDefID = UnitDefNames.corenaa_scav.id, xOffset = 0, zOffset = 84, direction = 0}, - { unitDefID = UnitDefNames.corfdoom_scav.id, xOffset = 96, zOffset = -60, direction = 0}, - { unitDefID = UnitDefNames.corfdoom_scav.id, xOffset = -96, zOffset = -60, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -96, zOffset = 148, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -64, zOffset = 180, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 208, zOffset = -108, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -96, zOffset = 116, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 32, zOffset = 180, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -208, zOffset = -140, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -144, zOffset = -172, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 208, zOffset = -140, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 64, zOffset = 180, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 96, zOffset = 148, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 144, zOffset = -172, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -32, zOffset = 180, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 96, zOffset = 116, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 176, zOffset = -172, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -208, zOffset = -108, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -176, zOffset = -172, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 24, zOffset = -20, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = -24, zOffset = -20, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -56, zOffset = 140, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 168, zOffset = -132, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = 56, zOffset = 140, direction = 0 }, + { unitDefID = UnitDefNames.coratl_scav.id, xOffset = -168, zOffset = -132, direction = 0 }, + { unitDefID = UnitDefNames.corenaa_scav.id, xOffset = 0, zOffset = 84, direction = 0 }, + { unitDefID = UnitDefNames.corfdoom_scav.id, xOffset = 96, zOffset = -60, direction = 0 }, + { unitDefID = UnitDefNames.corfdoom_scav.id, xOffset = -96, zOffset = -60, direction = 0 }, }, } end @@ -177,29 +176,29 @@ local function HOVER_FACTORY() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 258, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 92, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -4, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 28, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 92, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -68, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 28, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -4, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -68, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 34, zOffset = 44, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -30, zOffset = -20, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 218, zOffset = -12, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -214, zOffset = -12, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 218, zOffset = -60, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -214, zOffset = -60, direction = 0}, - { unitDefID = UnitDefNames.corcsa_scav.id, xOffset = -34, zOffset = -69, direction = 1}, - { unitDefID = UnitDefNames.corfhp_scav.id, xOffset = 130, zOffset = 20, direction = 0}, - { unitDefID = UnitDefNames.corfhp_scav.id, xOffset = -126, zOffset = 20, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = -38, zOffset = 36, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 42, zOffset = -12, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 92, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -4, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 28, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -206, zOffset = 92, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 258, zOffset = -68, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 210, zOffset = 28, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -4, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -254, zOffset = -68, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 34, zOffset = 44, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -30, zOffset = -20, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 218, zOffset = -12, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -214, zOffset = -12, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 218, zOffset = -60, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -214, zOffset = -60, direction = 0 }, + { unitDefID = UnitDefNames.corcsa_scav.id, xOffset = -34, zOffset = -69, direction = 1 }, + { unitDefID = UnitDefNames.corfhp_scav.id, xOffset = 130, zOffset = 20, direction = 0 }, + { unitDefID = UnitDefNames.corfhp_scav.id, xOffset = -126, zOffset = 20, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = -38, zOffset = 36, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 42, zOffset = -12, direction = 0 }, }, } end @@ -210,38 +209,38 @@ local function WATER_BLOCKAID() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -176, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -184, zOffset = 16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 184, zOffset = 16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -208, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 184, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 120, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 120, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -208, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 208, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -152, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = -144, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 208, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -176, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 152, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = 144, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -120, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -184, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 176, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = 16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 152, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = -144, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = 16, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -152, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 176, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = 144, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -120, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -136, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 136, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 0, zOffset = -104, direction = 0}, - { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 0, zOffset = 104, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = -176, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -184, zOffset = 16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 184, zOffset = 16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = -208, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 184, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 120, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 120, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = -208, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -104, zOffset = 208, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -152, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = -144, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 104, zOffset = 208, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = -176, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 152, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -40, zOffset = 144, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -120, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -184, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 72, zOffset = 176, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -88, zOffset = 16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 152, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = -144, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 88, zOffset = 16, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -152, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -72, zOffset = 176, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 40, zOffset = 144, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -120, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = -136, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 136, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 0, zOffset = -104, direction = 0 }, + { unitDefID = UnitDefNames.corfhlt_scav.id, xOffset = 0, zOffset = 104, direction = 0 }, }, } end @@ -252,45 +251,45 @@ local function REPAIR_BLOCKAID() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 174, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = -151, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = 25, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = 153, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = 57, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 46, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -18, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = -23, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = 25, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -146, zOffset = -55, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 174, zOffset = -55, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -146, zOffset = 57, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = -23, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = -55, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = 153, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -18, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = -87, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 46, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 174, zOffset = 57, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = -55, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -514, zOffset = -23, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = -119, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = 89, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = -151, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = 57, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = 121, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -10, zOffset = -47, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -10, zOffset = 49, direction = 0}, - { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 38, zOffset = 1, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 38, zOffset = 49, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = -10, zOffset = 1, direction = 0}, - { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 38, zOffset = -47, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = -151, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = 25, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = 153, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = 57, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 46, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -18, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = -23, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = 25, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -146, zOffset = -55, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 174, zOffset = -55, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -146, zOffset = 57, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = -23, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = -55, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 78, zOffset = 153, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -18, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -114, zOffset = -87, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 46, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 174, zOffset = 57, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 110, zOffset = -55, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 142, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -514, zOffset = -23, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = -119, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = 89, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -50, zOffset = -151, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = 57, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -82, zOffset = 121, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -10, zOffset = -47, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = -10, zOffset = 49, direction = 0 }, + { unitDefID = UnitDefNames.cortl_scav.id, xOffset = 38, zOffset = 1, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 38, zOffset = 49, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = -10, zOffset = 1, direction = 0 }, + { unitDefID = UnitDefNames.cornanotcplat_scav.id, xOffset = 38, zOffset = -47, direction = 0 }, }, } end @@ -301,28 +300,28 @@ local function POWER_STORAGE() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3, tiers.T4 }, radius = 116, buildings = { - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -76, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 20, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 116, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -76, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 20, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 116, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corfrad_scav.id, xOffset = -36, zOffset = 8, direction = 0}, - { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 68, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -28, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -28, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -92, zOffset = 0, direction = 0}, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -76, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 20, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 116, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = -76, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 20, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.corfdrag_scav.id, xOffset = 116, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corfrad_scav.id, xOffset = -36, zOffset = 8, direction = 0 }, + { unitDefID = UnitDefNames.corfrt_scav.id, xOffset = 68, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -28, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -28, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.coruwes_scav.id, xOffset = -92, zOffset = 0, direction = 0 }, }, } end return { - WATER_OUTPOST, - AMPHIB_FACTORY, - SEA_PLANE_SPAM, - WATER_FORT, - HOVER_FACTORY, - WATER_BLOCKAID, - REPAIR_BLOCKAID, - POWER_STORAGE, -} \ No newline at end of file + WATER_OUTPOST, + AMPHIB_FACTORY, + SEA_PLANE_SPAM, + WATER_FORT, + HOVER_FACTORY, + WATER_BLOCKAID, + REPAIR_BLOCKAID, + POWER_STORAGE, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Nikuksis_land.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Nikuksis_land.lua index 2cafe3fa12c..519c21dedfe 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Nikuksis_land.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/Nikuksis_land.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,31 +9,31 @@ local function Nikuksis_land0() tiers = { tiers.T0, tiers.T1 }, radius = 168, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = -8, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 8, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 8, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -136, zOffset = -8, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 136, zOffset = 8, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -8, zOffset = -136, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = -8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 8, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -136, zOffset = -8, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 136, zOffset = 8, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -8, zOffset = -136, direction = 1 }, }, } end @@ -44,13 +44,13 @@ local function Nikuksis_land1() tiers = { tiers.T0, tiers.T1 }, radius = 72, buildings = { - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 72, zOffset = 27, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -72, zOffset = -37, direction = 1}, - { unitDefID = UnitDefNames.armestor_scav.id, xOffset = -8, zOffset = 59, direction = 1}, - { unitDefID = UnitDefNames.armestor_scav.id, xOffset = 8, zOffset = -53, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -64, zOffset = 67, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 0, zOffset = 3, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 64, zOffset = -61, direction = 1}, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 72, zOffset = 27, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -72, zOffset = -37, direction = 1 }, + { unitDefID = UnitDefNames.armestor_scav.id, xOffset = -8, zOffset = 59, direction = 1 }, + { unitDefID = UnitDefNames.armestor_scav.id, xOffset = 8, zOffset = -53, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -64, zOffset = 67, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 0, zOffset = 3, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 64, zOffset = -61, direction = 1 }, }, } end @@ -61,17 +61,17 @@ local function Nikuksis_land2() tiers = { tiers.T0, tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -32, zOffset = -32, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, }, } end @@ -82,28 +82,26 @@ local function Nikuksis_land3() tiers = { tiers.T1, tiers.T2 }, radius = 96, buildings = { - { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = -92, direction = 1}, - { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 96, zOffset = 4, direction = 1}, - { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = 4, direction = 1}, - { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = -96, zOffset = 4, direction = 1}, - { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = 84, direction = 1}, + { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = -92, direction = 1 }, + { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 96, zOffset = 4, direction = 1 }, + { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = 4, direction = 1 }, + { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = -96, zOffset = 4, direction = 1 }, + { unitDefID = UnitDefNames.armmine3_scav.id, xOffset = 0, zOffset = 84, direction = 1 }, }, } end - - local function Nikuksis_land5() return { type = types.Land, tiers = { tiers.T2 }, radius = 32, buildings = { - { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 0, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = -32, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = -32, direction = 0}, + { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = -32, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = -32, direction = 0 }, }, } end @@ -114,17 +112,17 @@ local function Nikuksis_land6() tiers = { tiers.T2, tiers.T3 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -135,27 +133,27 @@ local function Nikuksis_land7() tiers = { tiers.T2, tiers.T3 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 64, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -64, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 64, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -166,33 +164,33 @@ local function Nikuksis_land8() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 192, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 48, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -144, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -48, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 144, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 48, zOffset = 0, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 192, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -144, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -48, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 144, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = 48, zOffset = 0, direction = 0 }, }, } end @@ -203,23 +201,23 @@ local function Nikuksis_land9() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 80, buildings = { - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 0, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 80, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -80, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 0, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 80, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -80, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end return { - Nikuksis_land0, - Nikuksis_land1, - Nikuksis_land2, - Nikuksis_land3, - Nikuksis_land5, - Nikuksis_land6, - Nikuksis_land7, - Nikuksis_land8, - Nikuksis_land9, -} \ No newline at end of file + Nikuksis_land0, + Nikuksis_land1, + Nikuksis_land2, + Nikuksis_land3, + Nikuksis_land5, + Nikuksis_land6, + Nikuksis_land7, + Nikuksis_land8, + Nikuksis_land9, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_HLT_defences.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_HLT_defences.lua index bad96f47375..d56157a4ef5 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_HLT_defences.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_HLT_defences.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,34 +9,33 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function HLTDefences0() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 126, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -7, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = 62, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 94, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -7, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -2, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -98, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -34, direction = 1}, - { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -63, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -63, zOffset = -42, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -15, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -63, zOffset = 54, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -7, zOffset = 62, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -7, zOffset = -50, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -7, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = 62, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 94, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -7, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -2, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -98, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -34, direction = 1 }, + { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -63, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -63, zOffset = -42, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -15, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -63, zOffset = 54, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -7, zOffset = 62, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -7, zOffset = -50, direction = 1 }, }, } end @@ -44,30 +43,30 @@ end local function HLTDefences1() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 126, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -7, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -7, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -39, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -98, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = -130, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -34, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = 62, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 94, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -2, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -63, zOffset = 54, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -63, zOffset = -42, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -15, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -63, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -7, zOffset = -50, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -7, zOffset = 62, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -7, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -7, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -39, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -98, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = -130, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -34, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = 62, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 94, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -2, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -63, zOffset = 54, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -63, zOffset = -42, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -15, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = -63, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -7, zOffset = -50, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -7, zOffset = 62, direction = 1 }, }, } end @@ -75,26 +74,26 @@ end local function HLTDefences2() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 126, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -29, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -61, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = -2, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 94, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -93, zOffset = -82, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -125, zOffset = -82, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = 30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = 62, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -5, zOffset = 86, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -85, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 51, zOffset = 94, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -93, zOffset = -50, direction = 2}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 35, zOffset = 30, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -29, zOffset = -34, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -29, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -61, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = -2, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 94, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -93, zOffset = -82, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -125, zOffset = -82, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = 30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = 62, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -5, zOffset = 86, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -85, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 51, zOffset = 94, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -93, zOffset = -50, direction = 2 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 35, zOffset = 30, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -29, zOffset = -34, direction = 2 }, }, } end @@ -102,26 +101,26 @@ end local function HLTDefences3() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 126, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -61, zOffset = -66, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -125, zOffset = -82, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 94, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 126, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -93, zOffset = -82, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = 62, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = 30, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = -2, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -29, zOffset = -66, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = 86, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -85, zOffset = 6, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -29, zOffset = -34, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -93, zOffset = -50, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 51, zOffset = 94, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 35, zOffset = 30, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -61, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -125, zOffset = -82, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 94, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 126, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -93, zOffset = -82, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = 62, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = 30, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = -2, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -29, zOffset = -66, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = 86, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -85, zOffset = 6, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -29, zOffset = -34, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -93, zOffset = -50, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 51, zOffset = 94, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 35, zOffset = 30, direction = 1 }, }, } end @@ -129,42 +128,42 @@ end local function HLTDefences4() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 183, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = 151, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = 183, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -105, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = 55, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 183, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 148, zOffset = -89, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = -25, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 148, zOffset = -25, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 84, zOffset = -201, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = 87, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 151, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = -201, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -137, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = 183, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = -89, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = -169, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = -201, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = 183, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 148, zOffset = -57, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = 151, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = -201, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 44, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 44, zOffset = 31, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = 31, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 116, zOffset = -57, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -76, zOffset = 151, direction = 0}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -92, zOffset = -89, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -92, zOffset = 39, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -92, zOffset = -25, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 52, zOffset = 103, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 52, zOffset = 151, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 20, zOffset = -121, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = 183, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -105, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = 55, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 183, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 148, zOffset = -89, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = -25, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 148, zOffset = -25, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 84, zOffset = -201, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = 87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = -201, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -137, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = 183, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = -89, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = -169, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = -201, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = 183, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 148, zOffset = -57, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = -201, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 44, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 44, zOffset = 31, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = 31, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 116, zOffset = -57, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -76, zOffset = 151, direction = 0 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -92, zOffset = -89, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -92, zOffset = 39, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -92, zOffset = -25, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 52, zOffset = 103, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 52, zOffset = 151, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 20, zOffset = -121, direction = 1 }, }, } end @@ -172,56 +171,56 @@ end local function HLTDefences5() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 184, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 172, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 44, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -100, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 172, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -4, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 140, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -228, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -36, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -100, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 140, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -228, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = 28, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -132, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -68, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -184, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -20, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -228, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -164, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -84, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -164, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -196, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 156, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -164, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 40, zOffset = 140, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 104, zOffset = 124, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -152, zOffset = 140, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -88, zOffset = 124, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -24, zOffset = 124, direction = 0}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 40, zOffset = -196, direction = 2}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -168, zOffset = -132, direction = 3}, - { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -48, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -96, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 4, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -16, zOffset = 4, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -16, zOffset = -44, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = -44, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -88, zOffset = -116, direction = 0}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -88, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 152, zOffset = 12, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 152, zOffset = -52, direction = 1}, - { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -8, zOffset = -116, direction = 2}, - { unitDefID = UnitDefNames.armguard_scav.id, xOffset = 24, zOffset = 76, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 172, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 44, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -100, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 172, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -4, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 140, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -228, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -36, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -100, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 140, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -228, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = 28, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -132, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -68, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -184, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -20, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -228, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -164, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -84, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -164, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -196, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 156, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -164, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 40, zOffset = 140, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 104, zOffset = 124, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -152, zOffset = 140, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -88, zOffset = 124, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -24, zOffset = 124, direction = 0 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 40, zOffset = -196, direction = 2 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -168, zOffset = -132, direction = 3 }, + { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -48, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.armferret_scav.id, xOffset = -96, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 4, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -16, zOffset = 4, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -16, zOffset = -44, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = -44, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -88, zOffset = -116, direction = 0 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -88, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 152, zOffset = 12, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 152, zOffset = -52, direction = 1 }, + { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -8, zOffset = -116, direction = 2 }, + { unitDefID = UnitDefNames.armguard_scav.id, xOffset = 24, zOffset = 76, direction = 0 }, }, } end @@ -229,49 +228,49 @@ end local function HLTDefences6() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 187, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 19, zOffset = 187, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = -213, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = 27, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -157, zOffset = 11, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -45, zOffset = 187, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = 43, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = -181, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = -37, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = -213, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = 187, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -109, zOffset = -165, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -13, zOffset = 155, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 155, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -77, zOffset = 155, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 19, zOffset = 155, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -77, zOffset = -197, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = -213, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 59, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = -21, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -157, zOffset = 75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -5, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = -149, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -45, zOffset = -229, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = -133, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -77, zOffset = 187, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 187, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -13, zOffset = 187, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -13, zOffset = -5, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -21, zOffset = 35, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -21, zOffset = 83, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 27, zOffset = 35, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 27, zOffset = 83, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 19, zOffset = -5, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -77, zOffset = -165, direction = 2}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -29, zOffset = -181, direction = 1}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -93, zOffset = -117, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 51, zOffset = 155, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -45, zOffset = 155, direction = 0}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 83, zOffset = -181, direction = 1}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 3, zOffset = -85, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 19, zOffset = 187, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = -213, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = 27, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -157, zOffset = 11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -45, zOffset = 187, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = 43, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = -181, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = -37, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = -213, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = 187, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -109, zOffset = -165, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -13, zOffset = 155, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 155, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -77, zOffset = 155, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 19, zOffset = 155, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -77, zOffset = -197, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = -213, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 59, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = -21, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -157, zOffset = 75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -5, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = -149, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -45, zOffset = -229, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = -133, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -77, zOffset = 187, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 187, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -13, zOffset = 187, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -13, zOffset = -5, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -21, zOffset = 35, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -21, zOffset = 83, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 27, zOffset = 35, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 27, zOffset = 83, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 19, zOffset = -5, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -77, zOffset = -165, direction = 2 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -29, zOffset = -181, direction = 1 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = -93, zOffset = -117, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 51, zOffset = 155, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -45, zOffset = 155, direction = 0 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 83, zOffset = -181, direction = 1 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 3, zOffset = -85, direction = 1 }, }, } end @@ -279,49 +278,49 @@ end local function HLTDefences7() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 160, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = -160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -128, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 128, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 43, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 43, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = -160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 32, direction = 3}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 11, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 107, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -77, zOffset = 120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -77, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -21, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 75, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 75, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -85, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -5, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -5, zOffset = -48, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 43, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 43, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 32, direction = 3 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 11, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 107, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -77, zOffset = 120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -77, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -21, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 75, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 75, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -85, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -5, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armguard_scav.id, xOffset = -5, zOffset = -48, direction = 1 }, }, } end @@ -329,36 +328,36 @@ end local function HLTDefences8() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 108, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -93, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -61, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 44, zOffset = -61, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 19, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -116, zOffset = 67, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 76, zOffset = 83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -100, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 51, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 108, zOffset = 83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -116, zOffset = 35, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 60, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -125, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -52, zOffset = 83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = 19, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 108, zOffset = 51, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -61, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -84, zOffset = 83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -125, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 28, zOffset = 3, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 60, zOffset = -29, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 44, zOffset = 35, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -76, zOffset = 43, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -4, zOffset = -29, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -20, zOffset = -93, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 76, zOffset = 51, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 28, zOffset = -29, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -93, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -61, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 44, zOffset = -61, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 19, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -116, zOffset = 67, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 76, zOffset = 83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -100, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 51, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 108, zOffset = 83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -116, zOffset = 35, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 60, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -125, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -52, zOffset = 83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = 19, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 108, zOffset = 51, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -61, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -84, zOffset = 83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -125, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 28, zOffset = 3, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 60, zOffset = -29, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 44, zOffset = 35, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -76, zOffset = 43, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -4, zOffset = -29, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -20, zOffset = -93, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 76, zOffset = 51, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 28, zOffset = -29, direction = 1 }, }, } end @@ -366,36 +365,36 @@ end local function HLTDefences9() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 111, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = 111, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 47, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = 15, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = 47, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 20, zOffset = 111, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -17, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -124, zOffset = -49, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 4, zOffset = 47, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 20, zOffset = 79, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 100, zOffset = -81, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = -1, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -81, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = -65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 100, zOffset = -49, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 15, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 15, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -124, zOffset = -17, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -60, zOffset = -65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = -17, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 100, zOffset = -17, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = -33, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 4, zOffset = 15, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = -25, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 4, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -12, zOffset = 79, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 68, zOffset = -49, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 36, zOffset = 15, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = 111, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 47, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = 15, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = 47, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 20, zOffset = 111, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -17, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -124, zOffset = -49, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 4, zOffset = 47, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 20, zOffset = 79, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 100, zOffset = -81, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = -1, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -81, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = -65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 100, zOffset = -49, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 15, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 15, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -124, zOffset = -17, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -60, zOffset = -65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = -17, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 100, zOffset = -17, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = -33, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 4, zOffset = 15, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = -25, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 4, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -12, zOffset = 79, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 68, zOffset = -49, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 36, zOffset = 15, direction = 1 }, }, } end @@ -403,24 +402,24 @@ end local function HLTDefences10() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 122, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = 43, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = -117, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = 75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 82, zOffset = 43, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = 107, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 82, zOffset = -37, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = -53, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = 11, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = -85, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = -21, direction = 1}, - { unitDefID = UnitDefNames.armferret_scav.id, xOffset = 122, zOffset = 3, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 74, zOffset = 3, direction = 3}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = 11, direction = 3}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = 75, direction = 3}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = -53, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = 43, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = -117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = 75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 82, zOffset = 43, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = 107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 82, zOffset = -37, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = -53, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = 11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = -85, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = -21, direction = 1 }, + { unitDefID = UnitDefNames.armferret_scav.id, xOffset = 122, zOffset = 3, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 74, zOffset = 3, direction = 3 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = 11, direction = 3 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = 75, direction = 3 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = -14, zOffset = -53, direction = 3 }, }, } end @@ -428,24 +427,24 @@ end local function HLTDefences11() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 122, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 82, zOffset = -37, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 82, zOffset = 43, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = -117, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = -53, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = 43, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = -85, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = -21, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = 75, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -46, zOffset = 11, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -30, zOffset = 107, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 74, zOffset = 3, direction = 3}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 122, zOffset = 3, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = 75, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = 11, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = -53, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 82, zOffset = -37, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 82, zOffset = 43, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = -117, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = -53, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = 43, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = -85, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = -21, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = 75, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -46, zOffset = 11, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -30, zOffset = 107, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 74, zOffset = 3, direction = 3 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 122, zOffset = 3, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = 75, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = 11, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -14, zOffset = -53, direction = 3 }, }, } end @@ -453,22 +452,22 @@ end local function HLTDefences12() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 64, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 64, direction = 1 }, }, } end @@ -476,21 +475,21 @@ end local function HLTDefences13() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 32, zOffset = -32, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 32, zOffset = -32, direction = 1 }, }, } end @@ -498,22 +497,22 @@ end local function HLTDefences14() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 74, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -54, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -38, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -6, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -6, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -38, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -54, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -22, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 42, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -22, zOffset = 32, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -54, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -38, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -6, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -6, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -38, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -54, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -22, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 42, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -22, zOffset = 32, direction = 1 }, }, } end @@ -521,44 +520,43 @@ end local function HLTDefences15() return { type = types.Land, - tiers = {tiers.T1}, + tiers = { tiers.T1 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 64, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -64, zOffset = 64, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 64, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -64, zOffset = 64, direction = 1 }, }, } end - return { HLTDefences0, HLTDefences1, - HLTDefences2, + HLTDefences2, HLTDefences3, HLTDefences4, HLTDefences5, - HLTDefences6, + HLTDefences6, HLTDefences7, - HLTDefences8, + HLTDefences8, HLTDefences9, - HLTDefences10, + HLTDefences10, HLTDefences11, HLTDefences12, HLTDefences13, - HLTDefences14, + HLTDefences14, HLTDefences15, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_Jammers.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_Jammers.lua index b8251fa6c52..8ab96bd473e 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_Jammers.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_Jammers.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,20 +9,19 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function Jammer0() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 32, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -30,24 +29,24 @@ end local function Jammer1() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 80, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -48, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -48, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -55,19 +54,19 @@ end local function Jammer2() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -16, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -16, zOffset = 0, direction = 1 }, }, } end @@ -75,23 +74,23 @@ end local function Jammer3() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 72, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armeyes_scav.id, xOffset = -32, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armeyes_scav.id, xOffset = 32, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -24, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 24, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armeyes_scav.id, xOffset = -32, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armeyes_scav.id, xOffset = 32, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -24, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 24, zOffset = 0, direction = 1 }, }, } end @@ -99,32 +98,32 @@ end local function Jammer4() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 97, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 33, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 1, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -63, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -31, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 97, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -111, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -111, zOffset = 41, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 17, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -47, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 25, zOffset = 33, direction = 1}, - { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -39, zOffset = 33, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 33, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 1, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -63, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -31, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 97, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -111, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -111, zOffset = 41, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 17, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -47, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 25, zOffset = 33, direction = 1 }, + { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -39, zOffset = 33, direction = 1 }, }, } end @@ -132,16 +131,16 @@ end local function Jammer5() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 32, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -149,24 +148,24 @@ end local function Jammer6() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 80, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -48, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -48, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -174,19 +173,19 @@ end local function Jammer7() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = -16, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = -16, zOffset = 0, direction = 1 }, }, } end @@ -194,23 +193,23 @@ end local function Jammer8() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 72, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 32, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -32, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -24, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 24, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = 32, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.coreyes_scav.id, xOffset = -32, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -24, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 24, zOffset = 0, direction = 1 }, }, } end @@ -218,32 +217,32 @@ end local function Jammer9() return { type = types.Land, - tiers = {tiers.T1, tiers.T2}, + tiers = { tiers.T1, tiers.T2 }, radius = 97, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 65, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -31, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 33, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = -95, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -63, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 1, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 97, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 97, direction = 1}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -111, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -111, zOffset = 41, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -47, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 17, zOffset = -39, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 25, zOffset = 33, direction = 1}, - { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -39, zOffset = 33, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -31, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 33, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = -95, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -63, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 1, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 97, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 97, direction = 1 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -111, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -111, zOffset = 41, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -47, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 17, zOffset = -39, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 25, zOffset = 33, direction = 1 }, + { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = -39, zOffset = 33, direction = 1 }, }, } end @@ -251,16 +250,16 @@ end local function Jammer10() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 32, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -268,19 +267,19 @@ end local function Jammer11() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armarad_scav.id, xOffset = -16, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armarad_scav.id, xOffset = -16, zOffset = 0, direction = 1 }, }, } end @@ -288,22 +287,22 @@ end local function Jammer12() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 32, direction = 3}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = 0, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 32, direction = 3 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 32, zOffset = 0, direction = 3 }, }, } end @@ -311,32 +310,32 @@ end local function Jammer13() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = -56, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = 56, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 64, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -64, zOffset = -48, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = -56, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = 56, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 64, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -64, zOffset = -48, direction = 3 }, }, } end @@ -344,34 +343,34 @@ end local function Jammer14() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 16, direction = 1}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armsd_scav.id, xOffset = 64, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -64, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 16, direction = 1 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armsd_scav.id, xOffset = 64, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -64, zOffset = 0, direction = 1 }, }, } end @@ -379,16 +378,16 @@ end local function Jammer15() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 32, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -396,19 +395,19 @@ end local function Jammer16() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -16, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -16, zOffset = 0, direction = 1 }, }, } end @@ -416,22 +415,22 @@ end local function Jammer17() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -32, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 32, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -32, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 32, zOffset = 0, direction = 1 }, }, } end @@ -439,34 +438,34 @@ end local function Jammer18() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -80, direction = 3}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -64, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 64, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -80, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 80, zOffset = 48, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -80, direction = 3 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -64, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 64, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -80, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 80, zOffset = 48, direction = 1 }, }, } end @@ -474,53 +473,53 @@ end local function Jammer19() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -32, direction = 3}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corsd_scav.id, xOffset = 64, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -64, zOffset = 0, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -32, direction = 3 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corsd_scav.id, xOffset = 64, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -64, zOffset = 0, direction = 3 }, }, } end return { - Jammer0, - Jammer1, - Jammer2, - Jammer3, - Jammer4, - Jammer5, - Jammer6, - Jammer7, - Jammer8, - Jammer9, - Jammer10, - Jammer11, - Jammer12, - Jammer13, - Jammer14, - Jammer15, - Jammer16, - Jammer17, - Jammer18, - Jammer19, + Jammer0, + Jammer1, + Jammer2, + Jammer3, + Jammer4, + Jammer5, + Jammer6, + Jammer7, + Jammer8, + Jammer9, + Jammer10, + Jammer11, + Jammer12, + Jammer13, + Jammer14, + Jammer15, + Jammer16, + Jammer17, + Jammer18, + Jammer19, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_LLT_defences.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_LLT_defences.lua index af513a86ffc..8b7ff47ac8e 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_LLT_defences.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_LLT_defences.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -12,21 +12,21 @@ local UDN = UnitDefNames local function lltCornerArm1() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 59, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 6, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 38, zOffset = 59, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 38, zOffset = 27, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -58, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -26, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 38, zOffset = -5, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 38, zOffset = -37, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -26, zOffset = -5, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 6, zOffset = 27, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -58, zOffset = -5, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 6, zOffset = 59, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 6, zOffset = -5, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 6, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 38, zOffset = 59, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 38, zOffset = 27, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -58, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -26, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 38, zOffset = -5, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 38, zOffset = -37, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -26, zOffset = -5, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 6, zOffset = 27, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -58, zOffset = -5, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 6, zOffset = 59, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 6, zOffset = -5, direction = 2 }, }, } end @@ -34,22 +34,22 @@ end local function lltCornerCor1() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 55, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = 55, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -22, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -54, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = -9, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 10, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 10, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -22, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -54, zOffset = 55, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -54, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 10, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 10, zOffset = 55, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = 55, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -22, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -54, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = -9, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 10, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 10, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -22, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = -54, zOffset = 55, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -54, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 10, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 10, zOffset = 55, direction = 2 }, }, } end @@ -57,20 +57,20 @@ end local function lltCornerArm2() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = 48, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 41, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 41, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -23, zOffset = 0, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = 48, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 41, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 41, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -23, zOffset = 0, direction = 3 }, }, } end @@ -78,20 +78,20 @@ end local function lltCornerCor2() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -16, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 16, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 24, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -16, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 16, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 24, zOffset = 0, direction = 1 }, }, } end @@ -99,22 +99,22 @@ end local function lltCrossCor1() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = 16, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -32, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 32, zOffset = 48, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = 16, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -32, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 32, zOffset = 48, direction = 1 }, }, } end @@ -122,22 +122,22 @@ end local function lltCrossArm1() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 64, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -16, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -64, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 32, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 0, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 64, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -32, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -32, zOffset = 16, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 32, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 32, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -32, zOffset = -48, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -32, zOffset = 16, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 32, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 32, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -32, zOffset = -48, direction = 3 }, }, } end @@ -145,38 +145,38 @@ end local function lltCrossArm2() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 141, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 13, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 109, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 141, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 141, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -19, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -19, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -115, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -115, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 77, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 13, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -83, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 77, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -115, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -115, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 109, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = -75, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 64, zOffset = 37, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 64, zOffset = -43, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 5, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -64, zOffset = 37, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -64, zOffset = -43, direction = 3}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 85, direction = 3}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = 85, direction = 3}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = 85, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -40, zOffset = -83, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = -3, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 40, zOffset = -83, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 13, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 109, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 141, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 141, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -19, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -19, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -115, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -115, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 77, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 13, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -83, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 77, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -115, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -115, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 109, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = -75, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 64, zOffset = 37, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 64, zOffset = -43, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 5, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -64, zOffset = 37, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -64, zOffset = -43, direction = 3 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 85, direction = 3 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -48, zOffset = 85, direction = 3 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 48, zOffset = 85, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -40, zOffset = -83, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = -3, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 40, zOffset = -83, direction = 1 }, }, } end @@ -184,43 +184,43 @@ end local function lltCrossCor2() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 280, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -451, zOffset = 280, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -483, zOffset = 248, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -3, zOffset = -120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 173, zOffset = -152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -3, zOffset = -152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -35, zOffset = -24, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -515, zOffset = 248, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 109, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 13, zOffset = 40, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 205, zOffset = -24, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 45, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -547, zOffset = 248, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 13, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -35, zOffset = -56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 40, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 205, zOffset = -56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 173, zOffset = -120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -451, zOffset = 248, direction = 2}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 149, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 21, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 21, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 149, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 133, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 37, zOffset = -128, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 45, zOffset = 40, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 125, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 157, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 13, zOffset = -40, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -451, zOffset = 280, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -483, zOffset = 248, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -3, zOffset = -120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 173, zOffset = -152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -3, zOffset = -152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -35, zOffset = -24, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -515, zOffset = 248, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 109, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 13, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 205, zOffset = -24, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 45, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -547, zOffset = 248, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 13, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -35, zOffset = -56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 205, zOffset = -56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 173, zOffset = -120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -451, zOffset = 248, direction = 2 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 149, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 21, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 21, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 149, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 85, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 133, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 37, zOffset = -128, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 45, zOffset = 40, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 125, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 157, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 13, zOffset = -40, direction = 3 }, }, } end @@ -228,58 +228,58 @@ end local function lltCrossArm3() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 269, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -11, zOffset = 89, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -75, zOffset = -7, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 85, zOffset = -55, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 173, zOffset = 33, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 93, zOffset = 161, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 141, zOffset = 97, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -195, zOffset = 97, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -227, zOffset = 65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 253, zOffset = -63, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 141, zOffset = -191, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -115, zOffset = -111, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -147, zOffset = -111, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 205, zOffset = 1, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 45, zOffset = -159, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -51, zOffset = -143, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 45, zOffset = 225, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -243, zOffset = -79, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -179, zOffset = 129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -211, zOffset = -95, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -83, zOffset = -127, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 109, zOffset = 129, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -147, zOffset = 161, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -19, zOffset = -143, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = 193, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 77, zOffset = -175, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -115, zOffset = 193, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -179, zOffset = -95, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -83, zOffset = 225, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 13, zOffset = -159, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 109, zOffset = -175, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 65, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 269, zOffset = -95, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -259, zOffset = 33, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 221, zOffset = -31, direction = 3}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -11, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 21, zOffset = -39, direction = 2}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 53, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 109, zOffset = 97, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -227, zOffset = 33, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 141, zOffset = -159, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 221, zOffset = -63, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -211, zOffset = -63, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 173, zOffset = 1, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -83, zOffset = -95, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -147, zOffset = 129, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 61, zOffset = 161, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -83, zOffset = 193, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 141, zOffset = 33, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 13, zOffset = -127, direction = 2}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -11, zOffset = 89, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -75, zOffset = -7, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 85, zOffset = -55, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 173, zOffset = 33, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 93, zOffset = 161, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 141, zOffset = 97, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -195, zOffset = 97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -227, zOffset = 65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 253, zOffset = -63, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 141, zOffset = -191, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -115, zOffset = -111, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -147, zOffset = -111, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 205, zOffset = 1, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 45, zOffset = -159, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -51, zOffset = -143, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 45, zOffset = 225, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -243, zOffset = -79, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -179, zOffset = 129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -211, zOffset = -95, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -83, zOffset = -127, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 109, zOffset = 129, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -147, zOffset = 161, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -19, zOffset = -143, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = 193, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 77, zOffset = -175, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -115, zOffset = 193, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -179, zOffset = -95, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -83, zOffset = 225, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 13, zOffset = -159, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 109, zOffset = -175, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 65, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 269, zOffset = -95, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -259, zOffset = 33, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 221, zOffset = -31, direction = 3 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -11, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 21, zOffset = -39, direction = 2 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 53, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 109, zOffset = 97, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -227, zOffset = 33, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 141, zOffset = -159, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 221, zOffset = -63, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -211, zOffset = -63, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 173, zOffset = 1, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -83, zOffset = -95, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -147, zOffset = 129, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 61, zOffset = 161, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -83, zOffset = 193, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 141, zOffset = 33, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 13, zOffset = -127, direction = 2 }, }, } end @@ -287,55 +287,55 @@ end local function lltCrossCor3() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 251, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 35, zOffset = 76, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 51, zOffset = -36, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -45, zOffset = -4, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 123, zOffset = 132, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 59, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 219, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -213, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -37, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 59, zOffset = 196, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -69, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -165, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 251, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 219, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -133, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -197, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 187, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 27, zOffset = 228, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -133, zOffset = 148, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 123, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -101, zOffset = -172, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 187, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -5, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 27, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -229, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -165, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = 164, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -133, zOffset = -172, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -213, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -149, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 212, direction = 2}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -45, zOffset = 60, direction = 2}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 99, zOffset = 12, direction = 2}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 19, zOffset = 12, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 59, zOffset = -108, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 155, zOffset = 84, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -101, zOffset = 180, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -133, zOffset = 52, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 219, zOffset = 20, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -37, zOffset = -124, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 155, zOffset = -108, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -181, zOffset = -44, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 59, zOffset = 164, direction = 1}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 35, zOffset = 76, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 51, zOffset = -36, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -45, zOffset = -4, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 123, zOffset = 132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 59, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 219, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -213, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -37, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 59, zOffset = 196, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -69, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -165, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 251, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 219, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -133, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -197, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 187, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 27, zOffset = 228, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -133, zOffset = 148, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 123, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -101, zOffset = -172, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 187, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -5, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 27, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -229, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -165, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = 164, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -133, zOffset = -172, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -213, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -149, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 212, direction = 2 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = -45, zOffset = 60, direction = 2 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 99, zOffset = 12, direction = 2 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 19, zOffset = 12, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 59, zOffset = -108, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 155, zOffset = 84, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -101, zOffset = 180, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -133, zOffset = 52, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 219, zOffset = 20, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -37, zOffset = -124, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 155, zOffset = -108, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -181, zOffset = -44, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 59, zOffset = 164, direction = 1 }, }, } end @@ -343,43 +343,43 @@ end local function lltCrossArm4() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 152, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 0, zOffset = -56, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 0, zOffset = 56, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = 72, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = 40, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = -72, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = -40, direction = 2}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 112, zOffset = 56, direction = 0}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 112, zOffset = -120, direction = 2}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -112, zOffset = -56, direction = 2}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -112, zOffset = 120, direction = 0}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 56, direction = 3}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -56, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 0, zOffset = -56, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 0, zOffset = 56, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = 72, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = 40, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 32, zOffset = -72, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -32, zOffset = -40, direction = 2 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 112, zOffset = 56, direction = 0 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 112, zOffset = -120, direction = 2 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -112, zOffset = -56, direction = 2 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -112, zOffset = 120, direction = 0 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 56, direction = 3 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -56, direction = 3 }, }, } end @@ -387,38 +387,38 @@ end local function lltCrossCor4() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 160, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = 96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = 64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -60, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = -160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = 32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -128, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = 0, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -60, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = 128, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -60, zOffset = 64, direction = 3}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -60, zOffset = 32, direction = 3}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -60, zOffset = -32, direction = 3}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -44, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 20, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -44, zOffset = 112, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = 96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -60, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = 32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -60, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = 128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -60, zOffset = 64, direction = 3 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 36, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -60, zOffset = 32, direction = 3 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -60, zOffset = -32, direction = 3 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -44, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 20, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -44, zOffset = 112, direction = 0 }, }, } end @@ -426,34 +426,34 @@ end local function lltCrossCor5() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 120, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -24, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 24, zOffset = 32, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = -48, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 40, zOffset = -48, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = 24, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 64, zOffset = 24, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = -40, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -24, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 24, zOffset = 32, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -40, zOffset = -48, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 40, zOffset = -48, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = 24, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 64, zOffset = 24, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = -40, direction = 3 }, }, } end @@ -461,57 +461,55 @@ end local function lltCrossArm5() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 168, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -60, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -60, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 24, zOffset = -44, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = -44, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = -44, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -64, zOffset = 12, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 64, zOffset = 12, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 12, direction = 2}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 24, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -24, zOffset = -44, direction = 2}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -24, zOffset = 68, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -60, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -60, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 24, zOffset = -44, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -72, zOffset = -44, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 72, zOffset = -44, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -64, zOffset = 12, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 64, zOffset = 12, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 12, direction = 2 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 24, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -24, zOffset = -44, direction = 2 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = -24, zOffset = 68, direction = 2 }, }, } end - - return { lltCornerArm1, lltCornerCor1, - lltCornerArm2, + lltCornerArm2, lltCornerCor2, lltCrossArm1, lltCrossCor1, - lltCrossArm2, + lltCrossArm2, lltCrossCor2, - lltCrossArm3, + lltCrossArm3, lltCrossCor3, - lltCrossArm4, + lltCrossArm4, lltCrossCor4, - lltCrossArm5, + lltCrossArm5, lltCrossCor5, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_T2_Eco.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_T2_Eco.lua index d48c3d27d09..c4105b6511f 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_T2_Eco.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_T2_Eco.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,38 +9,37 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function T2Eco0() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 38, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 70, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = -64, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = -112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = -96, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = -32, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 70, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = -112, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 62, zOffset = 136, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = -72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 94, zOffset = -56, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = -24, direction = 3}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -2, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -34, zOffset = 80, direction = 3}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 86, zOffset = 40, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 38, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 70, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = -112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = -32, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 70, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = -112, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 62, zOffset = 136, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = -72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 94, zOffset = -56, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = -24, direction = 3 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -2, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -34, zOffset = 80, direction = 3 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 86, zOffset = 40, direction = 0 }, }, } end @@ -48,31 +47,31 @@ end local function T2Eco1() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 132, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 132, zOffset = -136, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = 40, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 100, zOffset = -168, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = 40, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 68, zOffset = -168, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 132, zOffset = -168, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 36, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 132, zOffset = -104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -76, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 20, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -140, zOffset = 104, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -140, zOffset = 72, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -100, zOffset = 64, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 92, zOffset = -128, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = 32, direction = 3}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -20, zOffset = -64, direction = 3}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -100, zOffset = -32, direction = 3}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 92, zOffset = -32, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 132, zOffset = -136, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 100, zOffset = -168, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 68, zOffset = -168, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 132, zOffset = -168, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 36, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 132, zOffset = -104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -76, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 20, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -140, zOffset = 104, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -140, zOffset = 72, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -100, zOffset = 64, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 92, zOffset = -128, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -4, zOffset = 32, direction = 3 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -20, zOffset = -64, direction = 3 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -100, zOffset = -32, direction = 3 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 92, zOffset = -32, direction = 3 }, }, } end @@ -80,44 +79,44 @@ end local function T2Eco2() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 200, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -81, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -129, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -129, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 143, zOffset = -72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 111, zOffset = 136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 127, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -49, zOffset = -200, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -129, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -129, zOffset = 120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -49, zOffset = 200, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 79, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = -88, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = 88, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -81, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 143, zOffset = 72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 111, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = 24, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 143, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 127, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 143, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 79, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -113, zOffset = -24, direction = 2}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 111, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 111, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -49, zOffset = 168, direction = 0}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -49, zOffset = -168, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = 32, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = 96, direction = 2}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = 96, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -81, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -129, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -129, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 143, zOffset = -72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 111, zOffset = 136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 127, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -49, zOffset = -200, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -129, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -129, zOffset = 120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -49, zOffset = 200, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 79, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = -88, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = 88, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -81, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 143, zOffset = 72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 111, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = 24, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 143, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 127, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 143, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 79, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -113, zOffset = -24, direction = 2 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 111, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 111, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -49, zOffset = 168, direction = 0 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -49, zOffset = -168, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = 32, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 71, zOffset = 96, direction = 2 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -49, zOffset = 96, direction = 2 }, }, } end @@ -125,52 +124,52 @@ end local function T2Eco3() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -36, zOffset = 192, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = 112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 60, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -100, zOffset = 192, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = 160, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -52, zOffset = -208, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 140, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -132, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 108, zOffset = -176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 28, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -132, zOffset = -176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -84, zOffset = -208, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 140, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 140, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -68, zOffset = 192, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 92, zOffset = -208, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -4, zOffset = 176, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -116, zOffset = -208, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -148, zOffset = -112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 124, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 140, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -76, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -76, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -28, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -28, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -100, zOffset = -176, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 92, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -36, zOffset = 160, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = -32, direction = 3}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = 32, direction = 3}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = 96, direction = 3}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = -96, direction = 3}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -44, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -44, zOffset = 88, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -36, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = 112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 60, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -100, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -52, zOffset = -208, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 140, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -132, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 108, zOffset = -176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 28, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -132, zOffset = -176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -84, zOffset = -208, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 140, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 140, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -68, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 92, zOffset = -208, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -4, zOffset = 176, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -116, zOffset = -208, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -148, zOffset = -112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 124, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 140, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -76, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -76, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -28, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -28, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -100, zOffset = -176, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 92, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = -36, zOffset = 160, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = -32, direction = 3 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = 32, direction = 3 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = 96, direction = 3 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 76, zOffset = -96, direction = 3 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -44, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -44, zOffset = 88, direction = 3 }, }, } end @@ -178,22 +177,22 @@ end local function T2Eco4() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -201,22 +200,22 @@ end local function T2Eco5() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 88, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 8, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 88, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -8, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 88, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -224,40 +223,40 @@ end local function T2Eco6() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 171, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = 25, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -103, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 43, zOffset = -151, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -21, zOffset = -151, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = -7, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 11, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 89, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = -119, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 43, zOffset = 137, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 11, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = -135, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -149, zOffset = -87, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = 169, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = 121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = 57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = -151, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = -23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -165, zOffset = -55, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -21, zOffset = 169, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 105, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -13, zOffset = -79, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 3, zOffset = 81, direction = 2}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 27, zOffset = 9, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 91, zOffset = 25, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -101, zOffset = -23, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -37, zOffset = -7, direction = 0}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 75, zOffset = -79, direction = 2}, - { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -85, zOffset = 81, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = 25, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -103, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 43, zOffset = -151, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -21, zOffset = -151, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = -7, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 11, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 89, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = -119, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 43, zOffset = 137, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 11, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = -135, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -149, zOffset = -87, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = 169, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = 121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = 57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = -151, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = -23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -165, zOffset = -55, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -21, zOffset = 169, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 105, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -13, zOffset = -79, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 3, zOffset = 81, direction = 2 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 27, zOffset = 9, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 91, zOffset = 25, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -101, zOffset = -23, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = -37, zOffset = -7, direction = 0 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = 75, zOffset = -79, direction = 2 }, + { unitDefID = UnitDefNames.armfus_scav.id, xOffset = -85, zOffset = 81, direction = 2 }, }, } end @@ -265,43 +264,43 @@ end local function T2Eco7() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 88, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 120, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -120, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -88, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 56, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -24, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 24, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 152, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = -56, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 96, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -8, zOffset = 80, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 8, zOffset = -80, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 8, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 24, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = -8, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = -24, direction = 2}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -88, zOffset = 80, direction = 2}, - { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 88, zOffset = -80, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 88, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 120, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -120, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -88, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 56, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -24, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 24, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 152, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = -56, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 96, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -8, zOffset = 80, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 8, zOffset = -80, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 8, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 24, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = -8, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = -24, direction = 2 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = -88, zOffset = 80, direction = 2 }, + { unitDefID = UnitDefNames.corfus_scav.id, xOffset = 88, zOffset = -80, direction = 2 }, }, } end @@ -309,34 +308,34 @@ end local function T2Eco8() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 120, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -10, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 54, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -10, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -74, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 54, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -74, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 54, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -74, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -42, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -74, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -42, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 54, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -74, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 22, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 22, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 54, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -120, zOffset = -66, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 120, zOffset = -66, direction = 0}, - { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = -40, zOffset = 110, direction = 0}, - { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = 40, zOffset = 110, direction = 2}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 112, zOffset = -10, direction = 0}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -112, zOffset = -10, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -112, zOffset = 54, direction = 0}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 112, zOffset = 54, direction = 0}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = -10, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -10, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 54, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -10, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -74, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 54, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -74, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 54, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -74, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -42, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -74, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -42, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 54, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -74, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 22, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 22, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 54, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -120, zOffset = -66, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 120, zOffset = -66, direction = 0 }, + { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = -40, zOffset = 110, direction = 0 }, + { unitDefID = UnitDefNames.armtarg_scav.id, xOffset = 40, zOffset = 110, direction = 2 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = 112, zOffset = -10, direction = 0 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -112, zOffset = -10, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -112, zOffset = 54, direction = 0 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 112, zOffset = 54, direction = 0 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = -10, direction = 0 }, }, } end @@ -344,34 +343,34 @@ end local function T2Eco9() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 120, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -9, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 55, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -73, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 55, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -9, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -73, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 55, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -73, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -41, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -73, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 23, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 23, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 55, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -73, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -41, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 55, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -120, zOffset = -81, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 120, zOffset = -81, direction = 0}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 112, zOffset = -9, direction = 0}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -112, zOffset = -9, direction = 0}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 56, zOffset = 119, direction = 0}, - { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -56, zOffset = 119, direction = 0}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -112, zOffset = 55, direction = 0}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = 55, direction = 0}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 0, zOffset = -9, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -9, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 55, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -73, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 55, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -9, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -73, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 55, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -73, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -41, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -73, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 23, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 23, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 55, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -73, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -41, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 55, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -120, zOffset = -81, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 120, zOffset = -81, direction = 0 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = 112, zOffset = -9, direction = 0 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -112, zOffset = -9, direction = 0 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = 56, zOffset = 119, direction = 0 }, + { unitDefID = UnitDefNames.cortarg_scav.id, xOffset = -56, zOffset = 119, direction = 0 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -112, zOffset = 55, direction = 0 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = 55, direction = 0 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 0, zOffset = -9, direction = 0 }, }, } end @@ -379,51 +378,51 @@ end local function T2Eco10() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 198, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 182, zOffset = -82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 198, zOffset = -114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -170, zOffset = 158, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -154, zOffset = -130, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 70, zOffset = -194, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = 142, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 182, zOffset = -146, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 22, zOffset = 142, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 166, zOffset = 110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = -162, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -186, zOffset = -114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -162, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = 190, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -90, zOffset = 158, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -210, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = -194, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -218, zOffset = 110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = 158, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -186, zOffset = -50, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -154, zOffset = 190, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 54, zOffset = 158, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -202, zOffset = 142, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -202, zOffset = -82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = -178, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 198, zOffset = -50, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 182, zOffset = -18, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 78, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -10, zOffset = -194, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 142, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -234, zOffset = 78, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -162, zOffset = 118, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 110, zOffset = -154, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = 86, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = 118, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 102, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 102, zOffset = 94, direction = 0}, - { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 38, zOffset = 94, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -122, zOffset = -66, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -10, zOffset = -114, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 102, zOffset = -66, direction = 0}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -122, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -10, zOffset = -18, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 182, zOffset = -82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 198, zOffset = -114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -170, zOffset = 158, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -154, zOffset = -130, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 70, zOffset = -194, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = 142, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 182, zOffset = -146, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 22, zOffset = 142, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 166, zOffset = 110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = -162, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -186, zOffset = -114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -162, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = 190, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -90, zOffset = 158, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -210, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = -194, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -218, zOffset = 110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = 158, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -186, zOffset = -50, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -154, zOffset = 190, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 54, zOffset = 158, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -202, zOffset = 142, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -202, zOffset = -82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = -178, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 198, zOffset = -50, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 182, zOffset = -18, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 78, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -10, zOffset = -194, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 142, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -234, zOffset = 78, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -162, zOffset = 118, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 110, zOffset = -154, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = 86, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -98, zOffset = 118, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 102, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 102, zOffset = 94, direction = 0 }, + { unitDefID = UnitDefNames.armmmkr_scav.id, xOffset = 38, zOffset = 94, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -122, zOffset = -66, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -10, zOffset = -114, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 102, zOffset = -66, direction = 0 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -122, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -10, zOffset = -18, direction = 0 }, }, } end @@ -431,96 +430,96 @@ end local function T2Eco11() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 216, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -184, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = 168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = -168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 40, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 120, zOffset = -168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 88, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 8, zOffset = -168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 56, zOffset = 168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = 168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 120, zOffset = 168, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 24, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -40, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 88, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 168, zOffset = 120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 168, zOffset = 56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 200, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = -120, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 144, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -128, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = -16, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -120, zOffset = 40, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -120, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -56, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 104, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 40, zOffset = 40, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 104, zOffset = 40, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -56, zOffset = 40, direction = 0}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 40, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -104, zOffset = -88, direction = 0}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 8, zOffset = -88, direction = 0}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 120, zOffset = -88, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = 168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = -168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 40, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 120, zOffset = -168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 88, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 8, zOffset = -168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 56, zOffset = 168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = 168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 120, zOffset = 168, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 24, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -40, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 88, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 168, zOffset = 120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 168, zOffset = 56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 200, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = -120, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 144, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -128, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = -16, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -120, zOffset = 40, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -120, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -56, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 104, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 40, zOffset = 40, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 104, zOffset = 40, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -56, zOffset = 40, direction = 0 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 40, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -104, zOffset = -88, direction = 0 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 8, zOffset = -88, direction = 0 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 120, zOffset = -88, direction = 0 }, }, } end return { - T2Eco0, - T2Eco1, - T2Eco2, - T2Eco3, - T2Eco4, - T2Eco5, - T2Eco6, - T2Eco7, - T2Eco8, - T2Eco9, - T2Eco10, - T2Eco11, -} \ No newline at end of file + T2Eco0, + T2Eco1, + T2Eco2, + T2Eco3, + T2Eco4, + T2Eco5, + T2Eco6, + T2Eco7, + T2Eco8, + T2Eco9, + T2Eco10, + T2Eco11, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_bases.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_bases.lua index b453a671255..8636e67c579 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_bases.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_bases.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -10,10 +10,10 @@ local UDN = UnitDefNames -- 3 - west local function redBase1() - local randomturrets = {UDN.corllt_scav.id, UDN.corllt_scav.id, UDN.corhllt_scav.id, UDN.corhlt_scav.id, BPWallOrPopup('scav', 1, "land"), UDN.corrl_scav.id, UDN.cornanotc_scav.id,} + local randomturrets = { UDN.corllt_scav.id, UDN.corllt_scav.id, UDN.corhllt_scav.id, UDN.corhlt_scav.id, BPWallOrPopup("scav", 1, "land"), UDN.corrl_scav.id, UDN.cornanotc_scav.id } local factoryID - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then factoryID = UDN.corlab_scav.id else @@ -26,46 +26,46 @@ local function redBase1() radius = 196, buildings = { -- Defences / Nanos - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -64, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 64, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -128, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 128, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -64, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 64, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -128, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 128, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, - { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, -- Utility - { unitDefID = factoryID, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = factoryID, xOffset = 0, zOffset = 0, direction = 0 }, -- Walls - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 64, direction = 0 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 64, direction = 0 }, + }, } end local function blueBase1() - local randomturrets = {UDN.armllt_scav.id, UDN.armllt_scav.id, UDN.armhlt_scav.id, BPWallOrPopup('scav', 1, "land"), UDN.armrl_scav.id, UDN.armnanotc_scav.id,} + local randomturrets = { UDN.armllt_scav.id, UDN.armllt_scav.id, UDN.armhlt_scav.id, BPWallOrPopup("scav", 1, "land"), UDN.armrl_scav.id, UDN.armnanotc_scav.id } local factoryID - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then factoryID = UDN.armlab_scav.id else @@ -78,38 +78,38 @@ local function blueBase1() radius = 196, buildings = { -- Defences / Nanos - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -196, zOffset = -64, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -196, zOffset = 64, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -196, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -196, zOffset = -128, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -196, zOffset = 128, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 196, zOffset = -64, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 196, zOffset = 64, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 196, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 196, zOffset = -128, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 196, zOffset = 128, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -96, zOffset = -48, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -96, zOffset = 48, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = -96, zOffset = 0, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, - { unitDefID = randomturrets[math.random(1,#randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = -128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -196, zOffset = 128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 64, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = -128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 196, zOffset = 128, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -96, zOffset = -48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -96, zOffset = 48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = -96, zOffset = 0, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = -48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 48, direction = 0 }, + { unitDefID = randomturrets[math.random(1, #randomturrets)], xOffset = 96, zOffset = 0, direction = 0 }, -- Utility - { unitDefID = factoryID, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = factoryID, xOffset = 0, zOffset = 0, direction = 0 }, -- Walls - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 32, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 64, direction = 0 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 32, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 64, direction = 0 }, + }, } end @@ -120,71 +120,71 @@ local function blueBase2() radius = 192, buildings = { -- Nanos - { unitDefID = UDN.armnanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, -- Defences - { unitDefID = UDN.armllt_scav.id, xOffset = -64, zOffset = -160, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armbeamer_scav.id, xOffset = -160, zOffset = -128, direction = 3 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 128, zOffset = 160, direction = 0 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = 64, direction = 1 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 64, zOffset = 160, direction = 0 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armbeamer_scav.id, xOffset = 128, zOffset = -160, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, - { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = 128, direction = 3 }, - { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = -64, direction = 3 }, - { unitDefID = UDN.armllt_scav.id, xOffset = -128, zOffset = -160, direction = 2 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 64, zOffset = -160, direction = 2 }, - { unitDefID = UDN.armbeamer_scav.id, xOffset = 160, zOffset = 128, direction = 1 }, - { unitDefID = UDN.armbeamer_scav.id, xOffset = -128, zOffset = 160, direction = 0 }, - { unitDefID = UDN.armllt_scav.id, xOffset = -64, zOffset = 160, direction = 0 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = -64, direction = 1 }, - { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = -128, direction = 1 }, - { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = 64, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -64, zOffset = -160, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 72, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armbeamer_scav.id, xOffset = -160, zOffset = -128, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 128, zOffset = 160, direction = 0 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = 64, direction = 1 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 64, zOffset = 160, direction = 0 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 72, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armbeamer_scav.id, xOffset = 128, zOffset = -160, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -72, zOffset = 72, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = 128, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = -64, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -128, zOffset = -160, direction = 2 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 64, zOffset = -160, direction = 2 }, + { unitDefID = UDN.armbeamer_scav.id, xOffset = 160, zOffset = 128, direction = 1 }, + { unitDefID = UDN.armbeamer_scav.id, xOffset = -128, zOffset = 160, direction = 0 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -64, zOffset = 160, direction = 0 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -72, zOffset = -72, direction = 3 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = -64, direction = 1 }, + { unitDefID = UDN.armllt_scav.id, xOffset = 160, zOffset = -128, direction = 1 }, + { unitDefID = UDN.armllt_scav.id, xOffset = -160, zOffset = 64, direction = 3 }, -- Walls - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 192, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 192, direction = 1 }, + }, } end @@ -195,69 +195,69 @@ local function redBase2() radius = 192, buildings = { -- Nanos - { unitDefID = UDN.cornanotc_scav.id, xOffset = 24, zOffset = 24, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 24, zOffset = -24, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -24, zOffset = 24, direction = 3 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -24, zOffset = -24, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 24, zOffset = 24, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 24, zOffset = -24, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -24, zOffset = 24, direction = 3 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -24, zOffset = -24, direction = 3 }, -- Defences - { unitDefID = UDN.corerad_scav.id, xOffset = -80, zOffset = -80, direction = 0 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -128, zOffset = 160, direction = 0 }, - { unitDefID = UDN.corerad_scav.id, xOffset = 80, zOffset = -80, direction = 0 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = -64, direction = 3 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = 64, direction = 3 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 128, zOffset = -160, direction = 2 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = 128, direction = 3 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = -64, direction = 1 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 64, zOffset = 160, direction = 0 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 64, zOffset = -160, direction = 2 }, - { unitDefID = UDN.corerad_scav.id, xOffset = -80, zOffset = 80, direction = 0 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 128, zOffset = 160, direction = 0 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -64, zOffset = 160, direction = 0 }, - { unitDefID = UDN.corerad_scav.id, xOffset = 80, zOffset = 80, direction = 0 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -160, zOffset = -128, direction = 3 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 160, zOffset = 128, direction = 1 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = -128, direction = 1 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -128, zOffset = -160, direction = 2 }, - { unitDefID = UDN.corllt_scav.id, xOffset = -64, zOffset = -160, direction = 2 }, - { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = 64, direction = 1 }, + { unitDefID = UDN.corerad_scav.id, xOffset = -80, zOffset = -80, direction = 0 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -128, zOffset = 160, direction = 0 }, + { unitDefID = UDN.corerad_scav.id, xOffset = 80, zOffset = -80, direction = 0 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = -64, direction = 3 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = 64, direction = 3 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 128, zOffset = -160, direction = 2 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -160, zOffset = 128, direction = 3 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = -64, direction = 1 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 64, zOffset = 160, direction = 0 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 64, zOffset = -160, direction = 2 }, + { unitDefID = UDN.corerad_scav.id, xOffset = -80, zOffset = 80, direction = 0 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 128, zOffset = 160, direction = 0 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -64, zOffset = 160, direction = 0 }, + { unitDefID = UDN.corerad_scav.id, xOffset = 80, zOffset = 80, direction = 0 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -160, zOffset = -128, direction = 3 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 160, zOffset = 128, direction = 1 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = -128, direction = 1 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -128, zOffset = -160, direction = 2 }, + { unitDefID = UDN.corllt_scav.id, xOffset = -64, zOffset = -160, direction = 2 }, + { unitDefID = UDN.corllt_scav.id, xOffset = 160, zOffset = 64, direction = 1 }, -- Walls - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -128, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 96, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -96, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 128, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 128, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -160, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -128, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 160, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 96, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -64, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 64, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -96, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -192, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -160, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 64, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -64, direction = 3 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -128, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -96, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -192, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -160, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 64, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -64, direction = 3 }, + }, } end @@ -266,4 +266,4 @@ return { redBase2, blueBase1, blueBase2, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_ecoStuff.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_ecoStuff.lua index 5d5d9f7f5b3..c75c657cfa0 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_ecoStuff.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_ecoStuff.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -16,25 +16,25 @@ local function t1Energy1() tiers = { tiers.T1 }, radius = 160, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -128, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -128, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -160, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 160, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -128, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -128, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -160, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 160, direction = 1 }, + }, } end @@ -44,25 +44,25 @@ local function t1Energy2() tiers = { tiers.T1 }, radius = 168, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -136, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -168, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 136, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 168, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -136, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -168, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 136, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 168, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armsolar_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, + }, } end @@ -72,26 +72,26 @@ local function t1Energy3() tiers = { tiers.T1 }, radius = 121, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 121, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 89, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 121, zOffset = 64, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = 41, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 121, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = -112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 57, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 89, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = -112, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = -39, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armadvsol_scav.id, xOffset = -39, zOffset = -48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 25, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -71, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -103, zOffset = 0, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 121, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 89, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 121, zOffset = 64, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = 41, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 121, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 57, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 89, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = -112, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = -39, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armadvsol_scav.id, xOffset = -39, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 25, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -71, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -103, zOffset = 0, direction = 1 }, + }, } end @@ -102,25 +102,25 @@ local function t1Energy4() tiers = { tiers.T1 }, radius = 160, buildings = { - { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -160, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 128, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -160, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -128, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 160, direction = 1 }, - } + { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -160, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 128, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -160, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -128, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 160, direction = 1 }, + }, } end @@ -130,25 +130,25 @@ local function t1Energy5() tiers = { tiers.T1 }, radius = 168, buildings = { - { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 168, direction = 1 }, - { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 136, direction = 1 }, - { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, - { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 168, direction = 1 }, - { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -168, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 168, direction = 1 }, - } + { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 168, direction = 1 }, + { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 136, direction = 1 }, + { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = -96, direction = 1 }, + { unitDefID = UDN.corsolar_scav.id, xOffset = -48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 168, direction = 1 }, + { unitDefID = UDN.corsolar_scav.id, xOffset = 48, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 168, direction = 1 }, + }, } end @@ -158,24 +158,24 @@ local function t1Energy6() tiers = { tiers.T1 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 64, direction = 1 }, - { unitDefID = UDN.cormaw_scav.id, xOffset = -104, zOffset = 0, direction = 3 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = 24, zOffset = -48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 64, direction = 1 }, - { unitDefID = UDN.cormaw_scav.id, xOffset = 88, zOffset = 0, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = 24, zOffset = 48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -64, direction = 1 }, - { unitDefID = UDN.coradvsol_scav.id, xOffset = -56, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -80, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 64, direction = 1 }, + { unitDefID = UDN.cormaw_scav.id, xOffset = -104, zOffset = 0, direction = 3 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = 24, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 64, direction = 1 }, + { unitDefID = UDN.cormaw_scav.id, xOffset = 88, zOffset = 0, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = 24, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -64, direction = 1 }, + { unitDefID = UDN.coradvsol_scav.id, xOffset = -56, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -80, direction = 1 }, + }, } end @@ -186,21 +186,21 @@ local function t2Energy1() tiers = { tiers.T2 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -48, direction = 3 }, - { unitDefID = UDN.armfus_scav.id, xOffset = -56, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 80, direction = 3 }, - { unitDefID = UDN.armfus_scav.id, xOffset = 56, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 80, direction = 3 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -48, direction = 3 }, + { unitDefID = UDN.armfus_scav.id, xOffset = -56, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 80, direction = 3 }, + { unitDefID = UDN.armfus_scav.id, xOffset = 56, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 80, direction = 3 }, + }, } end @@ -208,22 +208,22 @@ local function t2Energy2() return { type = types.Land, tiers = { tiers.T2 }, - radius = 80, + radius = 80, buildings = { - { unitDefID = UDN.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 80, direction = 3 }, - } + { unitDefID = UDN.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 80, direction = 3 }, + }, } end @@ -234,21 +234,21 @@ local function t2Energy3() tiers = { tiers.T2 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -40, direction = 3 }, - { unitDefID = UDN.corfus_scav.id, xOffset = 56, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -40, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -72, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 40, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 40, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 72, direction = 3 }, - { unitDefID = UDN.corfus_scav.id, xOffset = -56, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 72, direction = 3 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -40, direction = 3 }, + { unitDefID = UDN.corfus_scav.id, xOffset = 56, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 40, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 72, direction = 3 }, + { unitDefID = UDN.corfus_scav.id, xOffset = -56, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 72, direction = 3 }, + }, } end @@ -256,22 +256,22 @@ local function t2Energy4() return { type = types.Land, tiers = { tiers.T2 }, - radius = 80, + radius = 80, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -48, direction = 3 }, - { unitDefID = UDN.corafus_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 48, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -80, direction = 3 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -48, direction = 3 }, + { unitDefID = UDN.corafus_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -80, direction = 3 }, + }, } end @@ -282,50 +282,50 @@ local function t2ResourcesBase1() tiers = { tiers.T3 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -48, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -48, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = -144, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 48, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 144, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 48, direction = 0 }, - { unitDefID = UDN.armflak_scav.id, xOffset = -64, zOffset = 96, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 144, direction = 0 }, - { unitDefID = UDN.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = 64, zOffset = 96, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 144, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -144, direction = 0 }, - { unitDefID = UDN.armflak_scav.id, xOffset = 64, zOffset = -96, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 16, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = 64, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = -64, zOffset = -96, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 144, direction = 0 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 144, direction = 0 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = -144, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 48, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 144, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 48, direction = 0 }, + { unitDefID = UDN.armflak_scav.id, xOffset = -64, zOffset = 96, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 144, direction = 0 }, + { unitDefID = UDN.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = 64, zOffset = 96, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 144, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -144, direction = 0 }, + { unitDefID = UDN.armflak_scav.id, xOffset = 64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 16, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 128, zOffset = 64, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = -64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 144, direction = 0 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = -128, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 144, direction = 0 }, + }, } end @@ -335,55 +335,55 @@ local function t2ResourcesBase2() tiers = { tiers.T3 }, radius = 270, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 174, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -98, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 62, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 126, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -34, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -194, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -66, zOffset = 192, direction = 1 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 206, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 126, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -194, zOffset = -192, direction = 1 }, - { unitDefID = UDN.armbrtha_scav.id, xOffset = -146, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -162, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 126, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 94, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 64, direction = 1 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 206, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armfus_scav.id, xOffset = -114, zOffset = 104, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 30, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 206, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = -192, direction = 1 }, - { unitDefID = UDN.armveil_scav.id, xOffset = -146, zOffset = -64, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = 142, zOffset = 48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -98, zOffset = -192, direction = 1 }, - { unitDefID = UDN.armfus_scav.id, xOffset = -42, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armpb_scav.id, xOffset = 166, zOffset = -136, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -162, zOffset = -192, direction = 1 }, - { unitDefID = UDN.armmmkr_scav.id, xOffset = 142, zOffset = 112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 238, zOffset = 192, direction = 1 }, - { unitDefID = UDN.armfus_scav.id, xOffset = 54, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -66, zOffset = -192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 32, direction = 1 }, - { unitDefID = UDN.armpb_scav.id, xOffset = -26, zOffset = 184, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 270, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -226, zOffset = -192, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 174, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -98, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 62, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 126, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -34, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -194, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -66, zOffset = 192, direction = 1 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 206, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 126, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -194, zOffset = -192, direction = 1 }, + { unitDefID = UDN.armbrtha_scav.id, xOffset = -146, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -162, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 126, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 94, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 64, direction = 1 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 206, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armfus_scav.id, xOffset = -114, zOffset = 104, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 30, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 206, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = -192, direction = 1 }, + { unitDefID = UDN.armveil_scav.id, xOffset = -146, zOffset = -64, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = 142, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -98, zOffset = -192, direction = 1 }, + { unitDefID = UDN.armfus_scav.id, xOffset = -42, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armpb_scav.id, xOffset = 166, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -162, zOffset = -192, direction = 1 }, + { unitDefID = UDN.armmmkr_scav.id, xOffset = 142, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 238, zOffset = 192, direction = 1 }, + { unitDefID = UDN.armfus_scav.id, xOffset = 54, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -66, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 32, direction = 1 }, + { unitDefID = UDN.armpb_scav.id, xOffset = -26, zOffset = 184, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 270, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -226, zOffset = -192, direction = 1 }, + }, } end @@ -393,43 +393,43 @@ local function t2EnergyBase1() tiers = { tiers.T3 }, radius = 214, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -122, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 166, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 214, zOffset = -58, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 54, zOffset = 166, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = -154, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -10, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -58, direction = 1 }, - { unitDefID = UDN.armtarg_scav.id, xOffset = 62, zOffset = 94, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 102, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -26, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = -154, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 182, zOffset = -154, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 214, zOffset = -154, direction = 2 }, - { unitDefID = UDN.armanni_scav.id, xOffset = 134, zOffset = 102, direction = 1 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = -58, zOffset = -58, direction = 0 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = 70, zOffset = -58, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 134, direction = 1 }, - { unitDefID = UDN.armanni_scav.id, xOffset = 22, zOffset = -138, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = -154, direction = 2 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = 134, zOffset = -58, direction = 0 }, - { unitDefID = UDN.armuwadves_scav.id, xOffset = 6, zOffset = -58, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = -154, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 54, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -90, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -154, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 214, zOffset = -90, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -154, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 22, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = -154, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 70, direction = 1 }, - { unitDefID = UDN.armafus_scav.id, xOffset = -42, zOffset = 102, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 214, zOffset = -122, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 198, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = 198, direction = 2 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -122, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 166, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 214, zOffset = -58, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 54, zOffset = 166, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = -154, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -10, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -58, direction = 1 }, + { unitDefID = UDN.armtarg_scav.id, xOffset = 62, zOffset = 94, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 102, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -26, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = -154, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 182, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 214, zOffset = -154, direction = 2 }, + { unitDefID = UDN.armanni_scav.id, xOffset = 134, zOffset = 102, direction = 1 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = -58, zOffset = -58, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = 70, zOffset = -58, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 134, direction = 1 }, + { unitDefID = UDN.armanni_scav.id, xOffset = 22, zOffset = -138, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = -154, direction = 2 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = 134, zOffset = -58, direction = 0 }, + { unitDefID = UDN.armuwadves_scav.id, xOffset = 6, zOffset = -58, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 54, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -90, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 214, zOffset = -90, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -154, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 22, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = -154, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 70, direction = 1 }, + { unitDefID = UDN.armafus_scav.id, xOffset = -42, zOffset = 102, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 214, zOffset = -122, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = 198, direction = 2 }, + }, } end @@ -440,50 +440,50 @@ local function t2MetalBase1() tiers = { tiers.T3 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 144, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = -64, zOffset = 96, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -48, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = 64, zOffset = -96, direction = 2 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = 64, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = -64, zOffset = -96, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 48, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -112, direction = 0 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = 0, direction = 0 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -80, direction = 0 }, - { unitDefID = UDN.corafus_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 144, direction = 0 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = 0, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 144, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = 64, zOffset = 96, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 80, direction = 0 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = 64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = -48, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 16, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 48, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 80, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = -144, direction = 0 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = -64, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -144, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 112, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = -144, direction = 0 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 144, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = -64, zOffset = 96, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -48, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = 64, zOffset = -96, direction = 2 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = 64, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = -64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -112, direction = 0 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = 0, direction = 0 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -80, direction = 0 }, + { unitDefID = UDN.corafus_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 144, direction = 0 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = 0, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 144, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = 64, zOffset = 96, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 80, direction = 0 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -128, zOffset = 64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = -48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 16, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 48, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 80, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = -144, direction = 0 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = 128, zOffset = -64, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -144, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 112, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = -144, direction = 0 }, + }, } end @@ -493,31 +493,31 @@ local function t2ResourceBase3() tiers = { tiers.T3 }, radius = 170, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 110, zOffset = -141, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = -45, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 78, zOffset = -141, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = 179, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = -77, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 46, zOffset = -141, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = -13, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -178, zOffset = 115, direction = 1 }, - { unitDefID = UDN.corfus_scav.id, xOffset = 54, zOffset = -53, direction = 1 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -50, zOffset = 115, direction = 1 }, - { unitDefID = UDN.corvipe_scav.id, xOffset = -170, zOffset = -133, direction = 1 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -50, zOffset = 51, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = -109, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = 147, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -141, direction = 1 }, - { unitDefID = UDN.corfus_scav.id, xOffset = -42, zOffset = -53, direction = 1 }, - { unitDefID = UDN.corvipe_scav.id, xOffset = 134, zOffset = 171, direction = 1 }, - { unitDefID = UDN.corarad_scav.id, xOffset = 30, zOffset = 131, direction = 1 }, - { unitDefID = UDN.corfus_scav.id, xOffset = 54, zOffset = 43, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = 115, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 142, zOffset = -141, direction = 1 }, - { unitDefID = UDN.cormmkr_scav.id, xOffset = -114, zOffset = 51, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -146, zOffset = 115, direction = 1 }, - { unitDefID = UDN.corshroud_scav.id, xOffset = -130, zOffset = -29, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 110, zOffset = -141, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = -45, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 78, zOffset = -141, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = 179, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = -77, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 46, zOffset = -141, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = -13, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -178, zOffset = 115, direction = 1 }, + { unitDefID = UDN.corfus_scav.id, xOffset = 54, zOffset = -53, direction = 1 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -50, zOffset = 115, direction = 1 }, + { unitDefID = UDN.corvipe_scav.id, xOffset = -170, zOffset = -133, direction = 1 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -50, zOffset = 51, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = -109, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = 147, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -141, direction = 1 }, + { unitDefID = UDN.corfus_scav.id, xOffset = -42, zOffset = -53, direction = 1 }, + { unitDefID = UDN.corvipe_scav.id, xOffset = 134, zOffset = 171, direction = 1 }, + { unitDefID = UDN.corarad_scav.id, xOffset = 30, zOffset = 131, direction = 1 }, + { unitDefID = UDN.corfus_scav.id, xOffset = 54, zOffset = 43, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = 115, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 142, zOffset = -141, direction = 1 }, + { unitDefID = UDN.cormmkr_scav.id, xOffset = -114, zOffset = 51, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -146, zOffset = 115, direction = 1 }, + { unitDefID = UDN.corshroud_scav.id, xOffset = -130, zOffset = -29, direction = 1 }, + }, } end @@ -527,43 +527,43 @@ local function t2EnergyBase2() tiers = { tiers.T3 }, radius = 181, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -149, zOffset = -153, direction = 2 }, - { unitDefID = UDN.corvipe_scav.id, xOffset = -93, zOffset = 159, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 151, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = -153, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = -153, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 55, direction = 1 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = -109, zOffset = 79, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 87, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 123, zOffset = -153, direction = 2 }, - { unitDefID = UDN.corscreamer_scav.id, xOffset = 75, zOffset = -57, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = -89, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = -121, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 59, zOffset = -153, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -149, zOffset = 151, direction = 1 }, - { unitDefID = UDN.cortarg_scav.id, xOffset = -5, zOffset = -65, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 151, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 119, direction = 1 }, - { unitDefID = UDN.corvipe_scav.id, xOffset = 19, zOffset = 159, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = -57, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 55, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = -153, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 151, direction = 1 }, - { unitDefID = UDN.corafus_scav.id, xOffset = -101, zOffset = -73, direction = 2 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = 51, zOffset = 79, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 119, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = 151, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 87, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 155, zOffset = -153, direction = 2 }, - { unitDefID = UDN.coruwadves_scav.id, xOffset = -29, zOffset = 79, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = -153, direction = 2 }, - { unitDefID = UDN.corvipe_scav.id, xOffset = -13, zOffset = -145, direction = 2 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -149, zOffset = -153, direction = 2 }, + { unitDefID = UDN.corvipe_scav.id, xOffset = -93, zOffset = 159, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 55, direction = 1 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = -109, zOffset = 79, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 123, zOffset = -153, direction = 2 }, + { unitDefID = UDN.corscreamer_scav.id, xOffset = 75, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = -89, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 59, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -149, zOffset = 151, direction = 1 }, + { unitDefID = UDN.cortarg_scav.id, xOffset = -5, zOffset = -65, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 119, direction = 1 }, + { unitDefID = UDN.corvipe_scav.id, xOffset = 19, zOffset = 159, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 55, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 151, direction = 1 }, + { unitDefID = UDN.corafus_scav.id, xOffset = -101, zOffset = -73, direction = 2 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = 51, zOffset = 79, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 119, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = 151, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 87, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 155, zOffset = -153, direction = 2 }, + { unitDefID = UDN.coruwadves_scav.id, xOffset = -29, zOffset = 79, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = -153, direction = 2 }, + { unitDefID = UDN.corvipe_scav.id, xOffset = -13, zOffset = -145, direction = 2 }, + }, } end local function t2Wind1() - local r = math.random(0,1) + local r = math.random(0, 1) local unitDefID if r == 0 then unitDefID = UDN.armwint2_scav.id @@ -574,27 +574,26 @@ local function t2Wind1() return { type = types.Land, tiers = { tiers.T1, tiers.T2, tiers.T3 }, - radius = 48, + radius = 48, buildings = { - { unitDefID = unitDefID, xOffset = 0, zOffset = 0, direction = 1 }, - } + { unitDefID = unitDefID, xOffset = 0, zOffset = 0, direction = 1 }, + }, } end - local function t1Eco1() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 48, buildings = { - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 48, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 48, zOffset = 16, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = -48, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = -48, direction = 1}, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 48, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = -48, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.corwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, }, } end @@ -602,16 +601,16 @@ end local function t1Eco2() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 48, buildings = { - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 48, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -48, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 48, zOffset = 16, direction = 1}, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 48, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = -48, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armwin_scav.id, xOffset = 48, zOffset = 16, direction = 1 }, }, } end @@ -619,20 +618,20 @@ end local function t1Eco3() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 88, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 72, zOffset = 8, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -72, zOffset = -8, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 72, zOffset = 8, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -72, zOffset = -8, direction = 1 }, }, } end @@ -640,20 +639,20 @@ end local function t1Eco4() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 88, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -72, zOffset = -8, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 72, zOffset = 8, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -72, zOffset = -8, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 72, zOffset = 8, direction = 1 }, }, } end @@ -661,31 +660,31 @@ end local function t1Eco5() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.corestor_scav.id, xOffset = 96, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.corestor_scav.id, xOffset = -96, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 96, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.corestor_scav.id, xOffset = 96, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.corestor_scav.id, xOffset = -96, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = 96, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.coradvsol_scav.id, xOffset = -96, zOffset = 96, direction = 1 }, }, } end @@ -693,31 +692,31 @@ end local function t1Eco6() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armestor_scav.id, xOffset = -88, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armestor_scav.id, xOffset = 88, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 96, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -96, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -96, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 96, zOffset = -96, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armestor_scav.id, xOffset = -88, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armestor_scav.id, xOffset = 88, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 96, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -96, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = -96, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armadvsol_scav.id, xOffset = 96, zOffset = -96, direction = 1 }, }, } end @@ -725,33 +724,33 @@ end local function t1Eco7() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 104, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 54, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 24, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -10, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 22, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -8, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -66, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -66, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = 46, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -18, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -18, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = 46, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.cormstor_scav.id, xOffset = -146, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.cormstor_scav.id, xOffset = -146, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 38, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -66, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -66, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -18, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -18, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 54, zOffset = 56, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 54, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 24, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -10, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 22, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -66, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -66, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = 46, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -18, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = -18, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.cormakr_scav.id, xOffset = 46, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.cormstor_scav.id, xOffset = -146, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.cormstor_scav.id, xOffset = -146, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 38, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -66, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -66, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -18, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -18, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 54, zOffset = 56, direction = 1 }, }, } end @@ -759,33 +758,33 @@ end local function t1Eco8() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 107, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 101, zOffset = -69, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = 107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 101, zOffset = 27, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 101, zOffset = -37, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = 107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = 107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = 107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 101, zOffset = -5, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 101, zOffset = 59, direction = 3}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -19, zOffset = 51, direction = 0}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -67, zOffset = 51, direction = 0}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -19, zOffset = -125, direction = 0}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = 45, zOffset = -13, direction = 3}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -67, zOffset = -125, direction = 0}, - { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = 45, zOffset = -61, direction = 3}, - { unitDefID = UnitDefNames.armmstor_scav.id, xOffset = -139, zOffset = -5, direction = 1}, - { unitDefID = UnitDefNames.armmstor_scav.id, xOffset = -139, zOffset = -69, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -61, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -13, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -61, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -13, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 37, zOffset = -117, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 53, zOffset = 59, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 101, zOffset = -69, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = 107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 101, zOffset = 27, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 101, zOffset = -37, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = 107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = 107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = 107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 101, zOffset = -5, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 101, zOffset = 59, direction = 3 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -19, zOffset = 51, direction = 0 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -67, zOffset = 51, direction = 0 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -19, zOffset = -125, direction = 0 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = 45, zOffset = -13, direction = 3 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = -67, zOffset = -125, direction = 0 }, + { unitDefID = UnitDefNames.armmakr_scav.id, xOffset = 45, zOffset = -61, direction = 3 }, + { unitDefID = UnitDefNames.armmstor_scav.id, xOffset = -139, zOffset = -5, direction = 1 }, + { unitDefID = UnitDefNames.armmstor_scav.id, xOffset = -139, zOffset = -69, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -61, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -13, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -61, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -13, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 37, zOffset = -117, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 53, zOffset = 59, direction = 1 }, }, } end @@ -793,23 +792,23 @@ end local function t1Eco9() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 80, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = -56, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = -56, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = 56, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = 56, zOffset = -56, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = -56, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = -56, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = 56, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armsolar_scav.id, xOffset = 56, zOffset = -56, direction = 1 }, }, } end @@ -817,30 +816,27 @@ end local function t1Eco10() return { type = types.Land, - tiers = { tiers.T0, tiers.T1}, + tiers = { tiers.T0, tiers.T1 }, radius = 80, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = 56, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = -56, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = -56, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = 56, zOffset = 56, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = 56, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = -56, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = -56, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.corsolar_scav.id, xOffset = 56, zOffset = 56, direction = 1 }, }, } end - - - return { t1Energy1, t1Energy2, @@ -869,4 +865,4 @@ return { t1Eco8, t1Eco9, t1Eco10, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_epic_defences.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_epic_defences.lua index 89273e257e7..1c3fd469e73 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_epic_defences.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_epic_defences.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,58 +9,57 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function EpicDefence0() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 144, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -112, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 112, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -112, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 112, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -68,46 +67,46 @@ end local function EpicDefence1() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 155, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 35, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -77, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -109, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -45, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -45, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 35, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 67, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 99, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -77, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 131, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 99, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -141, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -109, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -53, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 91, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 43, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -101, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 43, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -53, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 91, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -101, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -93, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -93, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 155, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 155, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 51, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 35, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -77, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -109, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -45, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -45, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 35, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 67, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 99, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -77, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 131, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 99, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -141, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -109, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -53, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 91, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 43, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -101, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 43, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -5, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -53, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 91, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -101, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -93, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = -93, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 155, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 155, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 51, zOffset = 0, direction = 1 }, }, } end @@ -115,87 +114,87 @@ end local function EpicDefence2() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 224, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 88, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 88, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -8, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 56, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 24, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 56, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -40, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 120, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -8, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 24, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 120, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -40, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 144, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 144, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 152, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 152, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 120, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 120, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = 176, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = -176, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = -112, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = 112, direction = 3}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 88, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = -40, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = -40, zOffset = -128, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 88, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 88, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -8, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 56, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 24, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 56, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -40, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 120, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -8, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 24, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 120, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -40, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 144, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 144, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 152, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 152, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 120, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 120, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 88, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = 176, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = -176, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = -112, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -136, zOffset = 112, direction = 3 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 88, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = -40, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = -40, zOffset = -128, direction = 1 }, }, } end @@ -203,61 +202,61 @@ end local function EpicDefence3() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -59, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -91, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -91, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -59, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -27, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -27, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -83, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -35, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -35, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -83, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -83, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -35, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -35, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -83, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 21, zOffset = 144, direction = 0}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 85, zOffset = -144, direction = 2}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 85, zOffset = 144, direction = 0}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 21, zOffset = -144, direction = 2}, - { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 53, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -59, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -91, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -91, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -59, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -27, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -27, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -83, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -35, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -35, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = -83, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -83, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -35, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -35, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -83, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 21, zOffset = 144, direction = 0 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 85, zOffset = -144, direction = 2 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 85, zOffset = 144, direction = 0 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 21, zOffset = -144, direction = 2 }, + { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 53, zOffset = 0, direction = 1 }, }, } end @@ -265,78 +264,78 @@ end local function EpicDefence4() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 245, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 229, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 181, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 229, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -171, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 213, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -171, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 213, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 229, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 229, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 181, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -163, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -163, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -115, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -115, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -155, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -155, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 181, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 181, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -83, zOffset = -104, direction = 2}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -35, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -83, zOffset = 104, direction = 0}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -35, zOffset = -104, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 85, zOffset = 96, direction = 0}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 85, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 165, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 229, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 181, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 229, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -171, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 213, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -171, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 213, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 229, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 229, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 181, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -163, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 29, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -163, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -67, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 77, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -115, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -19, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -115, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -155, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armmercury_scav.id, xOffset = -155, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 181, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 181, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -83, zOffset = -104, direction = 2 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -35, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -83, zOffset = 104, direction = 0 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = -35, zOffset = -104, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 85, zOffset = 96, direction = 0 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 85, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 165, zOffset = 0, direction = 1 }, }, } end @@ -344,157 +343,155 @@ end local function EpicDefence5() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = 120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = -104, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = 56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -176, zOffset = -136, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 136, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -136, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -176, zOffset = 136, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 56, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -176, zOffset = 40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = -120, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = 104, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -176, zOffset = -40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = -72, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = 72, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = 24, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 176, zOffset = 152, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 152, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = -112, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = -64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 112, direction = 0}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -144, zOffset = 88, direction = 0}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -144, zOffset = -88, direction = 0}, - { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 112, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 112, zOffset = -88, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = 120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = -104, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = 56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -176, zOffset = -136, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 136, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -136, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -176, zOffset = 136, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 56, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -176, zOffset = 40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = -120, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = 104, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -176, zOffset = -40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = -72, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = 72, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = 24, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 176, zOffset = 152, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 152, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = -112, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -40, zOffset = -64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 112, direction = 0 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -144, zOffset = 88, direction = 0 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -144, zOffset = -88, direction = 0 }, + { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 112, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 112, zOffset = -88, direction = 1 }, }, } end - - local function EpicDefence6() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 157, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 29, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -35, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -99, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 29, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -3, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -67, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -67, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 93, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -35, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -3, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 93, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -99, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -51, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -19, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -51, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -83, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 125, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -83, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -19, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 125, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 125, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -83, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -83, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 5, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -91, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -91, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 5, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -43, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -43, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -35, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 77, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 77, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 61, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 29, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -35, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -99, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 29, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -3, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -67, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -67, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 93, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -35, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -3, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 93, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -99, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -51, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -19, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -51, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -83, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 125, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -83, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -19, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 125, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 125, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -83, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -83, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 5, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -91, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -91, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 5, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -43, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -43, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -35, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 77, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 77, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 61, zOffset = 0, direction = 1 }, }, } end @@ -502,80 +499,80 @@ end local function EpicDefence7() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 144, direction = 1}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 16, zOffset = -144, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = -168, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -136, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = 168, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 104, zOffset = -136, direction = 1}, - { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 104, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 80, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 144, direction = 1 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 16, zOffset = -144, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = -168, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -136, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = 168, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 112, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 104, zOffset = -136, direction = 1 }, + { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 104, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, }, } end @@ -583,127 +580,126 @@ end local function EpicDefence8() return { type = types.Land, - tiers = {tiers.T3, tiers.T4}, + tiers = { tiers.T3, tiers.T4 }, radius = 216, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 51, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -125, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -29, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 104, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -29, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -125, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -61, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 72, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -61, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 3, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = -168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -93, zOffset = 56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -93, zOffset = -56, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 136, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 115, zOffset = 168, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 83, zOffset = -40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 147, zOffset = 40, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = -120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -61, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -29, zOffset = 216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -93, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = -88, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 3, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = 184, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = 120, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -29, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = 88, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -61, zOffset = 216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = -184, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = 152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = 216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -125, zOffset = -152, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -93, zOffset = 216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 3, zOffset = 216, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -5, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 91, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 43, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -101, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -53, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 139, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -149, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -13, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -13, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = -168, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = 168, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -13, zOffset = -168, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -13, zOffset = 168, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 83, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 83, zOffset = 104, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 51, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -125, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -29, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 104, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -29, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -125, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -61, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -61, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 3, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = -168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -93, zOffset = 56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -93, zOffset = -56, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 136, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 115, zOffset = 168, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 83, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 147, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = -120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -61, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -29, zOffset = 216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -93, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = -88, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 3, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = 184, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = 120, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -29, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = 88, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -61, zOffset = 216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = -184, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = 152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = 216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -125, zOffset = -152, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -93, zOffset = 216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 3, zOffset = 216, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -5, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 91, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 43, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -101, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -53, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 139, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -149, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -13, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -13, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = -168, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = 168, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -13, zOffset = -168, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -13, zOffset = 168, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -77, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 83, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 83, zOffset = 104, direction = 1 }, }, } end - local function EpicDefence9() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 158, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 126, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 158, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 158, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 30, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 30, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 94, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 94, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 158, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -114, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 62, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 126, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 62, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -130, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 158, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -2, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -50, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 62, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 62, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -178, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 78, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 158, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 126, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 158, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 158, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 30, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 30, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 94, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 94, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 158, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -114, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 62, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 126, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 62, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -130, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 158, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -2, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = -50, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -26, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -74, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 62, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 62, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -178, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 78, zOffset = 0, direction = 1 }, }, } end @@ -711,40 +707,40 @@ end local function EpicDefence10() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.armannit3_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -752,46 +748,46 @@ end local function EpicDefence11() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armbotrail_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -799,40 +795,40 @@ end local function EpicDefence12() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 96, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.cordoomt3_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -840,84 +836,84 @@ end local function EpicDefence13() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 304, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -272, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = -304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = -288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 272, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 304, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -288, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 240, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 80, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 128, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 80, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 128, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 136, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -136, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = 256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = 256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = 256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = -256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = -256, direction = 1}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -200, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -200, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -200, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 120, zOffset = -192, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 8, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 56, zOffset = 240, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 200, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 200, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 120, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 8, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 56, zOffset = -240, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -272, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = -304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = -288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 272, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 304, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -288, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 240, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 80, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 128, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 80, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 128, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 136, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -144, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -136, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = 256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = 256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = 256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = -256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -72, zOffset = -256, direction = 1 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -136, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -200, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -200, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -200, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 120, zOffset = -192, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 8, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 56, zOffset = 240, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 200, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 200, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 168, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 120, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 8, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 56, zOffset = -240, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -24, zOffset = 0, direction = 1 }, }, } end @@ -925,93 +921,93 @@ end local function EpicDefence14() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 344, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 169, zOffset = -280, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -151, zOffset = -328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = -344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -151, zOffset = 328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = 344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -119, zOffset = 344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = -328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 9, zOffset = 344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = 328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = -328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 137, zOffset = 312, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 265, zOffset = -184, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 137, zOffset = -312, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = -344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 233, zOffset = -216, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -183, zOffset = -344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 169, zOffset = 280, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 265, zOffset = 184, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 201, zOffset = 248, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 41, zOffset = -328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -119, zOffset = -344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -55, zOffset = -344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -183, zOffset = 344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 105, zOffset = 328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 201, zOffset = -248, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 105, zOffset = -328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 73, zOffset = 344, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -23, zOffset = 328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -87, zOffset = 328, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 233, zOffset = 216, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = -296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = 296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = -296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = -232, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = -232, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = 296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = 232, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = -232, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = 232, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = 296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = -296, direction = 1}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = 232, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 161, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 161, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 32, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -32, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -215, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -215, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = 272, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 113, zOffset = -256, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 113, zOffset = 256, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 241, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 241, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = -272, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 169, zOffset = -280, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -151, zOffset = -328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = -344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -151, zOffset = 328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = 344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -119, zOffset = 344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = -328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 9, zOffset = 344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = 328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = -328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 137, zOffset = 312, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 265, zOffset = -184, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 137, zOffset = -312, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = -344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 233, zOffset = -216, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -183, zOffset = -344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 169, zOffset = 280, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 265, zOffset = 184, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 201, zOffset = 248, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 41, zOffset = -328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -119, zOffset = -344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -55, zOffset = -344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -183, zOffset = 344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 105, zOffset = 328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 201, zOffset = -248, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 105, zOffset = -328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 73, zOffset = 344, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -23, zOffset = 328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -87, zOffset = 328, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 233, zOffset = 216, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = -296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = 296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = -296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = -232, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = -232, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = 296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = 232, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = -232, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -23, zOffset = 232, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -87, zOffset = 296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = -296, direction = 1 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -151, zOffset = 232, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 161, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 161, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 32, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -159, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 65, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -111, zOffset = -32, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 113, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -215, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -215, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = 272, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 113, zOffset = -256, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 113, zOffset = 256, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 193, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 241, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -15, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 241, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 33, zOffset = -272, direction = 1 }, }, } end @@ -1019,77 +1015,77 @@ end local function EpicDefence15() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 256, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -216, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -216, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -240, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 80, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 80, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 144, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 144, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -104, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -104, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -8, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -88, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -8, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -88, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -8, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -88, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -216, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -216, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -240, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -160, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 80, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 80, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 144, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 144, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -104, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -104, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -8, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -88, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -8, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -88, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 72, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -8, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = -88, zOffset = 0, direction = 1 }, }, } end @@ -1097,93 +1093,92 @@ end local function EpicDefence16() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 256, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -200, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -184, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -216, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -240, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -240, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -16, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -16, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 128, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 64, zOffset = -184, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 128, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 64, zOffset = 184, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -168, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -120, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -120, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -168, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -104, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -24, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -24, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -24, zOffset = 112, direction = 1}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = -112, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -200, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -184, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -216, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -240, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -240, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -64, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -16, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -16, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -176, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 128, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 64, zOffset = -184, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 128, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 64, zOffset = 184, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -168, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -120, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -120, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -168, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = -104, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -24, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 56, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -24, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -24, zOffset = 112, direction = 1 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = -112, direction = 1 }, }, } end - return { EpicDefence0, EpicDefence1, - EpicDefence2, + EpicDefence2, EpicDefence3, EpicDefence4, EpicDefence5, - EpicDefence6, + EpicDefence6, EpicDefence7, - EpicDefence8, + EpicDefence8, EpicDefence9, - EpicDefence10, + EpicDefence10, EpicDefence11, EpicDefence12, EpicDefence13, - EpicDefence14, + EpicDefence14, EpicDefence15, - EpicDefence16, -} \ No newline at end of file + EpicDefence16, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_factory_centers_2.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_factory_centers_2.lua index 6db28bdb9b4..41d18bb15f2 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_factory_centers_2.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_factory_centers_2.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,48 +9,47 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function FactoryCenter0() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 69, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 5, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 69, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -59, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 69, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -27, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 69, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -59, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 37, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 5, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 101, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 37, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -91, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -123, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -123, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -123, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -27, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 80, zOffset = 69, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -80, zOffset = 69, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = 29, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = 29, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = -19, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = -19, direction = 0}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -59, direction = 2}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -59, direction = 2}, - { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = 5, direction = 0}, - { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 0, zOffset = -75, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 69, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 5, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 69, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -59, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 69, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -27, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 69, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -59, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 37, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 5, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 37, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -123, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -123, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -123, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -27, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 80, zOffset = 69, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -80, zOffset = 69, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = 29, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = 29, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = -19, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = -19, direction = 0 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -59, direction = 2 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -59, direction = 2 }, + { unitDefID = UnitDefNames.armlab_scav.id, xOffset = 0, zOffset = 5, direction = 0 }, + { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 0, zOffset = -75, direction = 0 }, }, } end @@ -58,91 +57,90 @@ end local function FactoryCenter1() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 115, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -93, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -93, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -93, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 67, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -29, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -125, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 67, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 35, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 35, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -125, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -93, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -125, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -61, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -61, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -29, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -125, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 3, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 3, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 99, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 99, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 80, zOffset = 83, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -80, zOffset = 83, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = 43, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = 43, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = -21, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = -21, direction = 0}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -61, direction = 2}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -61, direction = 2}, - { unitDefID = UnitDefNames.armvp_scav.id, xOffset = 0, zOffset = 11, direction = 0}, - { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 0, zOffset = -77, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -93, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -93, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -93, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 67, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -29, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 67, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 35, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 35, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -93, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -61, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -61, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -29, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 3, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 3, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 99, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 99, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 80, zOffset = 83, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -80, zOffset = 83, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = 43, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = 43, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -72, zOffset = -21, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 72, zOffset = -21, direction = 0 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = -48, zOffset = -61, direction = 2 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 48, zOffset = -61, direction = 2 }, + { unitDefID = UnitDefNames.armvp_scav.id, xOffset = 0, zOffset = 11, direction = 0 }, + { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 0, zOffset = -77, direction = 0 }, }, } end - local function FactoryCenter3() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 92, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -4, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -36, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -36, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -68, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -68, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -68, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 60, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 76, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 60, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 28, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 76, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 92, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 28, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -68, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -4, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -96, zOffset = -68, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 96, zOffset = -68, direction = 2}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 96, zOffset = 76, direction = 0}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -96, zOffset = 76, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -28, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -28, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 36, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = 36, direction = 0}, - { unitDefID = UnitDefNames.armhp_scav.id, xOffset = 0, zOffset = 4, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 92, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -4, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -36, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -36, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -68, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -68, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -68, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 60, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 76, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 60, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 28, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 76, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 92, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 28, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -68, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -4, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -96, zOffset = -68, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 96, zOffset = -68, direction = 2 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 96, zOffset = 76, direction = 0 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = -96, zOffset = 76, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -28, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -28, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = 36, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = 36, direction = 0 }, + { unitDefID = UnitDefNames.armhp_scav.id, xOffset = 0, zOffset = 4, direction = 0 }, }, } end @@ -150,44 +148,44 @@ end local function FactoryCenter4() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 112, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 64, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -80, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -80, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = 24, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 72, zOffset = 24, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = -24, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 72, zOffset = -24, direction = 2}, - { unitDefID = UnitDefNames.corlab_scav.id, xOffset = 0, zOffset = 0, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 64, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -80, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -80, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 80, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = 24, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 72, zOffset = 24, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -72, zOffset = -24, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 72, zOffset = -24, direction = 2 }, + { unitDefID = UnitDefNames.corlab_scav.id, xOffset = 0, zOffset = 0, direction = 0 }, }, } end @@ -195,95 +193,94 @@ end local function FactoryCenter5() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 120, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -51, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = -83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 45, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 77, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -19, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 77, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 45, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 77, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -115, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -83, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -19, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 13, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 77, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = -51, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 13, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 88, zOffset = -3, direction = 1}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -88, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 88, zOffset = 77, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -88, zOffset = 77, direction = 0}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 0, zOffset = -91, direction = 0}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 40, zOffset = -83, direction = 2}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -40, zOffset = -83, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = 37, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 80, zOffset = -43, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = -43, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 80, zOffset = 37, direction = 0}, - { unitDefID = UnitDefNames.corvp_scav.id, xOffset = 0, zOffset = 5, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -51, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = -83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 45, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 77, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -19, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 77, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 45, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 77, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -115, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -19, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 13, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 77, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = -51, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 13, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 88, zOffset = -3, direction = 1 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -88, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 88, zOffset = 77, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -88, zOffset = 77, direction = 0 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 0, zOffset = -91, direction = 0 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 40, zOffset = -83, direction = 2 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = -40, zOffset = -83, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = 37, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 80, zOffset = -43, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -80, zOffset = -43, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 80, zOffset = 37, direction = 0 }, + { unitDefID = UnitDefNames.corvp_scav.id, xOffset = 0, zOffset = 5, direction = 0 }, }, } end - local function FactoryCenter7() return { type = types.Land, - tiers = {tiers.T2}, + tiers = { tiers.T2 }, radius = 128, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -46, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -78, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -78, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 18, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 18, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 50, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 50, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -14, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 82, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -14, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -46, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 114, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -78, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -110, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -78, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 96, zOffset = -78, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = -78, direction = 2}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = 82, direction = 0}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 96, zOffset = 82, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = -38, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -38, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 26, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 26, direction = 0}, - { unitDefID = UnitDefNames.corhp_scav.id, xOffset = 0, zOffset = -6, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -46, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -78, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -78, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 18, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 18, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 50, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 50, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -14, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 82, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -14, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -46, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 114, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -78, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -110, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -78, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 96, zOffset = -78, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = -78, direction = 2 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = -96, zOffset = 82, direction = 0 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 96, zOffset = 82, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = -38, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -38, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 26, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 26, direction = 0 }, + { unitDefID = UnitDefNames.corhp_scav.id, xOffset = 0, zOffset = -6, direction = 0 }, }, } end @@ -291,59 +288,59 @@ end local function FactoryCenter8() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 198, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 38, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 134, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 6, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 166, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 38, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -90, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -58, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 70, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 70, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 102, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -58, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 102, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -26, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -90, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -122, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 6, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -26, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 166, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 134, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = 198, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -122, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = -154, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -154, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -18, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -18, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 78, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 78, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.armalab_scav.id, xOffset = 0, zOffset = 38, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = -106, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = 150, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = -106, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = 150, direction = 0}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -48, zOffset = -106, direction = 2}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 48, zOffset = -106, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 38, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 134, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 6, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 166, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 38, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -90, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -58, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 70, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 70, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 102, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -58, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 102, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -26, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -90, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -122, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 6, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -26, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 166, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 134, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = 198, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -122, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = -154, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -154, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = -18, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = -18, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 78, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 104, zOffset = 78, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -104, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.armalab_scav.id, xOffset = 0, zOffset = 38, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = -106, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = 150, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = -106, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = 150, direction = 0 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -48, zOffset = -106, direction = 2 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 48, zOffset = -106, direction = 2 }, }, } end @@ -351,58 +348,58 @@ end local function FactoryCenter9() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 195, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -81, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 35, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 99, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 15, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 67, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -17, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 163, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -61, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 131, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 99, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -125, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -61, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -113, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 79, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -93, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 35, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -125, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -29, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 79, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -29, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 3, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -113, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -93, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 131, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 3, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 47, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 163, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 67, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = -157, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 195, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -81, zOffset = -157, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = -21, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = -21, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = 75, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = 27, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = 27, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = 75, direction = 0}, - { unitDefID = UnitDefNames.armavp_scav.id, xOffset = 7, zOffset = 35, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -97, zOffset = 147, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 95, zOffset = -109, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 95, zOffset = 147, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -97, zOffset = -109, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -33, zOffset = -109, direction = 2}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 31, zOffset = -109, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -81, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 35, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 99, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 15, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 67, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -17, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 163, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -61, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 131, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 99, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -125, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -61, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -113, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 79, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -93, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 35, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -125, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -29, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 79, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -29, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 3, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -113, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -93, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 131, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 3, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 47, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 163, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 67, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = -157, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 195, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -81, zOffset = -157, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = -21, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = -21, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = 75, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 103, zOffset = 27, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = 27, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -89, zOffset = 75, direction = 0 }, + { unitDefID = UnitDefNames.armavp_scav.id, xOffset = 7, zOffset = 35, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -97, zOffset = 147, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 95, zOffset = -109, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 95, zOffset = 147, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -97, zOffset = -109, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -33, zOffset = -109, direction = 2 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 31, zOffset = -109, direction = 2 }, }, } end @@ -410,61 +407,61 @@ end local function FactoryCenter10() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 190, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -66, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 95, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 95, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 63, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -2, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -98, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 94, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 62, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -1, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 158, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -98, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 126, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 63, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -66, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 31, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -2, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -130, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 62, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -130, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = -34, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -65, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 127, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 159, zOffset = 30, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 158, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 30, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 127, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -34, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 126, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 94, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = -162, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -65, zOffset = 190, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -162, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 22, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = 70, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = 22, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 70, direction = 0}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.armaap_scav.id, xOffset = 15, zOffset = 30, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -113, zOffset = 142, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 111, zOffset = 142, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 111, zOffset = -114, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -113, zOffset = -114, direction = 0}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -49, zOffset = -114, direction = 0}, - { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 47, zOffset = -114, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -66, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 95, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 95, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 63, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -2, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -98, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 94, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 62, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -1, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 158, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -98, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 126, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 63, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -66, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 31, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -2, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -130, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 62, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -130, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = -34, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -65, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 127, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 159, zOffset = 30, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 158, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 30, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 127, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -34, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 126, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 94, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = -162, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -65, zOffset = 190, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -162, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 22, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = 70, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = 22, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 70, direction = 0 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 119, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.armaap_scav.id, xOffset = 15, zOffset = 30, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -113, zOffset = 142, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 111, zOffset = 142, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 111, zOffset = -114, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -113, zOffset = -114, direction = 0 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -49, zOffset = -114, direction = 0 }, + { unitDefID = UnitDefNames.armamd_scav.id, xOffset = 47, zOffset = -114, direction = 0 }, }, } end @@ -472,56 +469,56 @@ end local function FactoryCenter11() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 180, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 81, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 49, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = -108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 52, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = -76, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -79, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = -44, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 17, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = -140, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 84, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = -12, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 52, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 148, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 84, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = -12, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = -108, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -15, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 148, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -111, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 116, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 20, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 113, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 113, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = -44, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 145, zOffset = 20, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = -76, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -79, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -111, zOffset = 180, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -47, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 81, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -143, zOffset = 116, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.coralab_scav.id, xOffset = -7, zOffset = 4, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -31, zOffset = -92, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -95, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -95, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 97, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 97, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 33, zOffset = -92, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 81, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 49, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = -108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 52, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = -76, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -79, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = -44, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 17, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = -140, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 84, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = -12, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 52, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 148, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 84, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = -12, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = -108, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -15, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 148, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -111, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 116, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 20, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 113, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 113, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = -44, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 145, zOffset = 20, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = -76, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -79, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -111, zOffset = 180, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -47, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 81, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -143, zOffset = 116, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 105, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.coralab_scav.id, xOffset = -7, zOffset = 4, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -31, zOffset = -92, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -95, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -95, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 97, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 97, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 33, zOffset = -92, direction = 0 }, }, } end @@ -529,58 +526,58 @@ end local function FactoryCenter12() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 179, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = -45, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = -77, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 51, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 83, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 83, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = -77, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = -45, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 115, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 19, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 147, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 97, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = -13, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -63, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 19, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = -13, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 65, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 147, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -63, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -127, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 1, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 51, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 129, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 115, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -127, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -31, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 33, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -95, zOffset = -141, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 97, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 161, zOffset = -109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -95, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = -109, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 129, zOffset = 179, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -159, zOffset = 179, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = -37, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = 59, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = -37, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = 11, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 11, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 59, direction = 0}, - { unitDefID = UnitDefNames.coravp_scav.id, xOffset = 9, zOffset = 27, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -47, zOffset = -93, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -111, zOffset = 131, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 113, zOffset = -93, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 113, zOffset = 131, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -111, zOffset = -93, direction = 2}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 49, zOffset = -93, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = -45, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = -77, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 51, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 83, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 83, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = -77, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = -45, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 115, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 19, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 147, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 97, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = -13, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -63, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 19, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = -13, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 65, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 147, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -63, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -127, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 1, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 51, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 129, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 115, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -127, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -31, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 33, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -95, zOffset = -141, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 97, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 161, zOffset = -109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -95, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = -109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 129, zOffset = 179, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -159, zOffset = 179, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = -37, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = 59, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = -37, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 121, zOffset = 11, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 11, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -103, zOffset = 59, direction = 0 }, + { unitDefID = UnitDefNames.coravp_scav.id, xOffset = 9, zOffset = 27, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -47, zOffset = -93, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -111, zOffset = 131, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 113, zOffset = -93, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 113, zOffset = 131, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -111, zOffset = -93, direction = 2 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 49, zOffset = -93, direction = 2 }, }, } end @@ -588,158 +585,157 @@ end local function FactoryCenter13() return { type = types.Land, - tiers = {tiers.T3}, + tiers = { tiers.T3 }, radius = 180, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 148, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = 148, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -140, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -144, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 116, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 144, zOffset = 20, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = -36, direction = 0}, - { unitDefID = UnitDefNames.coraap_scav.id, xOffset = 0, zOffset = 4, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -96, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 96, zOffset = -92, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -96, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 96, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 32, zOffset = -92, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 148, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = 148, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -144, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 144, zOffset = 20, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 104, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -104, zOffset = -36, direction = 0 }, + { unitDefID = UnitDefNames.coraap_scav.id, xOffset = 0, zOffset = 4, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -96, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 96, zOffset = -92, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -96, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 96, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.corfmd_scav.id, xOffset = 32, zOffset = -92, direction = 2 }, }, } end - local function FactoryCenter14() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 235, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = 69, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = 229, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -139, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 165, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 69, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = -235, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 229, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = 69, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 197, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -107, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = -75, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -203, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = -235, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = 229, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -235, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 101, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = 133, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 235, zOffset = -171, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = 165, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = 101, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = 133, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = 197, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -197, zOffset = -171, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = -171, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = -107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -165, zOffset = 197, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -101, zOffset = -203, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = 37, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -69, zOffset = -203, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 59, zOffset = 165, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = 165, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 27, zOffset = -171, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = -107, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 59, zOffset = -171, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = 69, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = 133, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -133, zOffset = 133, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = -203, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -5, zOffset = 165, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = -171, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -5, zOffset = -171, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = -43, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -261, zOffset = -75, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 27, zOffset = 165, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -229, zOffset = -139, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 91, zOffset = -171, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = -107, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -133, zOffset = 197, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = 101, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -133, zOffset = 165, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -229, zOffset = 133, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -101, zOffset = 197, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = -139, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -37, zOffset = -139, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 91, zOffset = 165, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -197, zOffset = 165, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -133, zOffset = -203, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -165, zOffset = -203, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 123, zOffset = 101, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -69, zOffset = 197, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = 45, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = -51, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = -51, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = -51, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = 45, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = 45, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = -3, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = 45, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = -51, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -133, zOffset = 101, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -101, zOffset = -107, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -133, zOffset = -107, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -69, zOffset = 101, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -101, zOffset = 101, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -69, zOffset = -107, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 11, zOffset = 117, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 75, zOffset = 117, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 75, zOffset = -123, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 11, zOffset = -123, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -85, zOffset = 149, direction = 3}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -85, zOffset = -155, direction = 3}, - { unitDefID = UnitDefNames.armshltx_scav.id, xOffset = 35, zOffset = -3, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = -123, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = 181, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = 117, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = -187, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = 69, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = 229, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -139, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 165, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 69, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = -235, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 229, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = 69, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 197, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = -75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -203, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = -235, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = 229, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -235, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 101, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = 133, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 235, zOffset = -171, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = 165, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = 101, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = 133, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = 197, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -197, zOffset = -171, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = -171, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = -107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -165, zOffset = 197, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -101, zOffset = -203, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = 37, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -69, zOffset = -203, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 59, zOffset = 165, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = 165, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 27, zOffset = -171, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = -107, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 59, zOffset = -171, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = 69, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = 133, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -133, zOffset = 133, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = -203, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -5, zOffset = 165, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = -171, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -5, zOffset = -171, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = -43, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -261, zOffset = -75, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 27, zOffset = 165, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -229, zOffset = -139, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 91, zOffset = -171, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = -107, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -133, zOffset = 197, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = 101, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -133, zOffset = 165, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -229, zOffset = 133, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -101, zOffset = 197, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = -139, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -37, zOffset = -139, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 91, zOffset = 165, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -197, zOffset = 165, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -133, zOffset = -203, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -165, zOffset = -203, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 123, zOffset = 101, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -69, zOffset = 197, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = 45, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -157, zOffset = -51, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = -51, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = -51, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = 45, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -61, zOffset = 45, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = -3, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -109, zOffset = 45, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -205, zOffset = -51, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -133, zOffset = 101, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -101, zOffset = -107, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -133, zOffset = -107, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -69, zOffset = 101, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -101, zOffset = 101, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -69, zOffset = -107, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 11, zOffset = 117, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 75, zOffset = 117, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 75, zOffset = -123, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 11, zOffset = -123, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -85, zOffset = 149, direction = 3 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -85, zOffset = -155, direction = 3 }, + { unitDefID = UnitDefNames.armshltx_scav.id, xOffset = 35, zOffset = -3, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = -123, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = 181, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = 117, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 187, zOffset = -187, direction = 1 }, }, } end @@ -747,94 +743,94 @@ end local function FactoryCenter15() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 255, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 255, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 255, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 207, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 207, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 79, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 15, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 208, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 47, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -160, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 160, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 224, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -17, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 0, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -17, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 15, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -161, zOffset = -240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 192, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -128, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 79, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -224, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -208, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -192, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 47, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = 208, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = -208, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = 240, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 32, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = 72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = 120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = 72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = 120, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = -72, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = -72, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -97, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -129, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -65, zOffset = 176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -97, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -65, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -129, zOffset = -176, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -1, zOffset = 192, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 127, zOffset = 192, direction = 0}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -1, zOffset = -192, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 127, zOffset = -192, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -65, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -129, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.armapt3_scav.id, xOffset = 63, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 207, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 255, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 255, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 207, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 207, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 79, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 15, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 208, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 47, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -160, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 160, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 224, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -17, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 0, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -17, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 15, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -161, zOffset = -240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 192, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -128, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 79, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -224, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -208, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -192, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 47, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = 208, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = -208, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = 240, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 32, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = 72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = 120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = 120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -105, zOffset = -120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = 72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = 120, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -153, zOffset = -72, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -57, zOffset = -72, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -97, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -129, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -65, zOffset = 176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -97, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -65, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -129, zOffset = -176, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.armamb_scav.id, xOffset = 199, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -1, zOffset = 192, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 127, zOffset = 192, direction = 0 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -1, zOffset = -192, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 127, zOffset = -192, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -65, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -129, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.armapt3_scav.id, xOffset = 63, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 207, zOffset = 0, direction = 1 }, }, } end @@ -842,97 +838,97 @@ end local function FactoryCenter16() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 248, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = -72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = 184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = 152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = -120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 216, zOffset = -72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = -152, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = 120, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 248, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 184, zOffset = 72, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -40, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 40, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 8, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -232, zOffset = 40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 40, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = -200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -168, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 8, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 104, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -200, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -232, zOffset = 72, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -104, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -56, zOffset = 200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -72, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -88, zOffset = 200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -56, zOffset = -200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = 136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -232, zOffset = -72, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -88, zOffset = -200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -136, zOffset = 88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = -136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 72, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 104, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -200, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -40, zOffset = -88, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -232, zOffset = -40, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 72, zOffset = 168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = -168, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 136, zOffset = 136, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -24, zOffset = 200, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 48, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = -48, direction = 0}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -240, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = -136, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -136, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = -168, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -168, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = 136, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = 168, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 136, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 168, direction = 3}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 24, zOffset = -120, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 88, zOffset = -120, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 88, zOffset = 120, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 24, zOffset = 120, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -72, zOffset = -152, direction = 2}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -72, zOffset = 152, direction = 2}, - { unitDefID = UnitDefNames.corgant_scav.id, xOffset = 48, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 192, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 192, zOffset = -128, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = 184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = 152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = -120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 216, zOffset = -72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = -152, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = 120, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 248, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 184, zOffset = 72, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -40, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 40, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 8, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -232, zOffset = 40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 40, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = -200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -168, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 8, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 104, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -200, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -232, zOffset = 72, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -104, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -56, zOffset = 200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -72, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -88, zOffset = 200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -56, zOffset = -200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = 136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -232, zOffset = -72, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -88, zOffset = -200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -136, zOffset = 88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = -136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 72, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 104, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -200, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -40, zOffset = -88, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -232, zOffset = -40, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 72, zOffset = 168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = -168, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 136, zOffset = 136, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -24, zOffset = 200, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -144, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -192, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 48, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = -48, direction = 0 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -240, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = -136, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -136, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = -168, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = -168, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = 136, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -120, zOffset = 168, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 136, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -152, zOffset = 168, direction = 3 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 24, zOffset = -120, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 88, zOffset = -120, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 88, zOffset = 120, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 24, zOffset = 120, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -72, zOffset = -152, direction = 2 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -72, zOffset = 152, direction = 2 }, + { unitDefID = UnitDefNames.corgant_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 192, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 192, zOffset = -128, direction = 1 }, }, } end @@ -940,99 +936,98 @@ end local function FactoryCenter17() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 272, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 207, zOffset = -144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 207, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 144, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = -48, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 112, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 239, zOffset = 80, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -160, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = -192, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -97, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -81, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -1, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 160, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -113, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 192, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -81, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = 192, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -1, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 111, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -177, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -65, zOffset = -272, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -65, zOffset = 272, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 31, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = 256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -209, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -49, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 31, zOffset = -224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -113, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -129, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = -256, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -177, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 143, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -193, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -145, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -209, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -33, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = 224, direction = 0}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 175, zOffset = -192, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -129, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -161, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -65, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -97, zOffset = 0, direction = 0}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 15, zOffset = -176, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 15, zOffset = 176, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 127, zOffset = 176, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 127, zOffset = -176, direction = 2}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -81, zOffset = -208, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -81, zOffset = 208, direction = 1}, - { unitDefID = UnitDefNames.corapt3_scav.id, xOffset = 63, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 207, zOffset = -144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 207, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 144, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = -48, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 112, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 239, zOffset = 80, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -160, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = -192, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -97, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -81, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -1, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 160, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -113, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 192, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -81, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = 192, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -1, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 111, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -177, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -65, zOffset = -272, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -65, zOffset = 272, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 31, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = 256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -209, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -49, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 31, zOffset = -224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -113, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -129, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = -256, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -177, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 143, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -193, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -145, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -209, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -33, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = 224, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 175, zOffset = -192, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -105, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -57, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -153, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -129, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -161, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -65, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -97, zOffset = 0, direction = 0 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.cortoast_scav.id, xOffset = 199, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 15, zOffset = -176, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 15, zOffset = 176, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 127, zOffset = 176, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 127, zOffset = -176, direction = 2 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -81, zOffset = -208, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -81, zOffset = 208, direction = 1 }, + { unitDefID = UnitDefNames.corapt3_scav.id, xOffset = 63, zOffset = 0, direction = 1 }, }, } end - return { FactoryCenter0, FactoryCenter1, @@ -1040,14 +1035,14 @@ return { FactoryCenter4, FactoryCenter5, FactoryCenter7, - FactoryCenter8, + FactoryCenter8, FactoryCenter9, - FactoryCenter10, + FactoryCenter10, FactoryCenter11, - FactoryCenter12, - FactoryCenter13, + FactoryCenter12, + FactoryCenter13, FactoryCenter14, FactoryCenter15, FactoryCenter16, FactoryCenter17, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_rectors.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_rectors.lua index d288f36639e..74bc21ee894 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_rectors.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_rectors.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -13,49 +13,48 @@ local math_random = math.random local function t1ResurrectorGroup1() local unitID - local r = math_random(0,1) + local r = math_random(0, 1) if r == 0 then unitID = UDN.armrectr_scav.id else - unitID = UDN.cornecro_scav.id + unitID = UDN.cornecro_scav.id end - return { + return { type = types.Land, tiers = { tiers.T0, tiers.T1, tiers.T2 }, radius = 64, buildings = { - { unitDefID = unitID, xOffset = 16, zOffset = 16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -16, zOffset = 16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = 16, zOffset = -16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -16, zOffset = -16, direction = math_random(0,3) }, + { unitDefID = unitID, xOffset = 16, zOffset = 16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -16, zOffset = 16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = 16, zOffset = -16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -16, zOffset = -16, direction = math_random(0, 3) }, }, - } + } end - local function t1ResurrectorGroup2() local unitID - local r = math_random(0,1) + local r = math_random(0, 1) if r == 0 then unitID = UDN.armrectr_scav.id else - unitID = UDN.cornecro_scav.id + unitID = UDN.cornecro_scav.id end - return { + return { type = types.Land, tiers = { tiers.T1, tiers.T1, tiers.T2, tiers.T2, tiers.T2, tiers.T3, tiers.T3, tiers.T3 }, radius = 128, buildings = { - { unitDefID = unitID, xOffset = 16, zOffset = 16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -16, zOffset = 16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = 16, zOffset = -16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -16, zOffset = -16, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = 32, zOffset = 32, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -32, zOffset = 32, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = 32, zOffset = -32, direction = math_random(0,3) }, - { unitDefID = unitID, xOffset = -32, zOffset = -32, direction = math_random(0,3) }, + { unitDefID = unitID, xOffset = 16, zOffset = 16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -16, zOffset = 16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = 16, zOffset = -16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -16, zOffset = -16, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = 32, zOffset = 32, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -32, zOffset = 32, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = 32, zOffset = -32, direction = math_random(0, 3) }, + { unitDefID = unitID, xOffset = -32, zOffset = -32, direction = math_random(0, 3) }, }, } end @@ -63,4 +62,4 @@ end return { t1ResurrectorGroup1, t1ResurrectorGroup2, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_shielded_LRPCs.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_shielded_LRPCs.lua index 26a648de738..241905f9765 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_shielded_LRPCs.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_shielded_LRPCs.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,70 +9,69 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function ShieldedLRPC_Outpost0() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 15, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 127, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 15, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -17, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -49, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 63, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 127, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -17, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 31, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 31, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 63, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -49, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -97, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -97, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -73, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -9, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 39, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -73, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 39, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -9, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 47, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 80, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 112, zOffset = 47, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 48, zOffset = 111, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -112, zOffset = 47, direction = 3}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -144, zOffset = -17, direction = 3}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -80, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 0, zOffset = -129, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 144, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -48, zOffset = 111, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -17, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -49, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 63, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -17, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 31, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 31, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 63, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -49, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -97, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -73, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -9, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 39, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -73, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 39, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -9, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 47, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 80, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 112, zOffset = 47, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 48, zOffset = 111, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -112, zOffset = 47, direction = 3 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -144, zOffset = -17, direction = 3 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -80, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 0, zOffset = -129, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 144, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -48, zOffset = 111, direction = 3 }, }, } end @@ -80,70 +79,70 @@ end local function ShieldedLRPC_Outpost1() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 132, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 132, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 164, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 164, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -108, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 32, zOffset = 4, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = 4, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -152, zOffset = 44, direction = 3}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 72, zOffset = 124, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 40, zOffset = -132, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -40, zOffset = -132, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -104, zOffset = -52, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 104, zOffset = -52, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 152, zOffset = 44, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -72, zOffset = 124, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 164, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 164, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -108, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 32, zOffset = 4, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = 4, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -152, zOffset = 44, direction = 3 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 72, zOffset = 124, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 40, zOffset = -132, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -40, zOffset = -132, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -104, zOffset = -52, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 104, zOffset = -52, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 152, zOffset = 44, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -72, zOffset = 124, direction = 3 }, }, } end @@ -151,18 +150,18 @@ end local function ShieldedLRPC_Outpost2() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 64, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 56, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 8, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = -8, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -8, zOffset = -56, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -64, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 48, zOffset = -64, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -48, zOffset = 64, direction = 0}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 64, zOffset = 48, direction = 1}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 8, zOffset = 56, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 8, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = -8, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -8, zOffset = -56, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -64, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 48, zOffset = -64, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -48, zOffset = 64, direction = 0 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 64, zOffset = 48, direction = 1 }, }, } end @@ -170,18 +169,18 @@ end local function ShieldedLRPC_Outpost3() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 72, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 8, zOffset = 56, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -8, zOffset = -56, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 56, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 72, zOffset = 56, direction = 0}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -72, zOffset = -56, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -56, zOffset = 72, direction = 3}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 8, zOffset = 56, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -8, zOffset = -56, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 56, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 72, zOffset = 56, direction = 0 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -72, zOffset = -56, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -56, zOffset = 72, direction = 3 }, }, } end @@ -189,47 +188,47 @@ end local function ShieldedLRPC_Outpost4() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 176, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 90, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -208, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 90, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -144, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 200, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -200, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -86, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -64, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 192, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 128, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -192, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 90, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -208, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 90, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 200, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -200, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -78, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -86, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -64, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 192, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = 128, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -22, zOffset = -192, direction = 1 }, }, } end @@ -237,46 +236,46 @@ end local function ShieldedLRPC_Outpost5() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 224, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 33, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 65, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 200, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -200, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -95, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -40, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 200, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -200, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 40, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -120, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 33, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 65, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = 200, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -87, zOffset = -200, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -95, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -40, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 200, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -200, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = 40, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -23, zOffset = -120, direction = 1 }, }, } end @@ -284,45 +283,45 @@ end local function ShieldedLRPC_Outpost6() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 150, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -26, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -26, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -90, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -58, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -90, zOffset = 112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 102, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -122, zOffset = 80, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -58, zOffset = -112, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 134, zOffset = -112, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -10, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 70, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 38, zOffset = -80, direction = 1}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 38, zOffset = 80, direction = 1}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 110, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 110, zOffset = 72, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -26, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -26, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -90, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -58, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -90, zOffset = 112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 102, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -122, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -58, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 134, zOffset = -112, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -34, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -82, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -10, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 70, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 38, zOffset = -80, direction = 1 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 38, zOffset = 80, direction = 1 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 110, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.armminivulc_scav.id, xOffset = 110, zOffset = 72, direction = 1 }, }, } end @@ -330,49 +329,49 @@ end local function ShieldedLRPC_Outpost7() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 160, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 118, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -106, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -42, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 86, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -74, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 150, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -138, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = -120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = 120, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 102, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 30, zOffset = 88, direction = 1}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 30, zOffset = -88, direction = 1}, - { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 110, zOffset = -56, direction = 1}, - { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 110, zOffset = 56, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 118, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -106, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -42, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 86, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -74, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 150, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -138, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = -120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -98, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = 120, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -50, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 102, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 30, zOffset = 88, direction = 1 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 30, zOffset = -88, direction = 1 }, + { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 110, zOffset = -56, direction = 1 }, + { unitDefID = UnitDefNames.corminibuzz_scav.id, xOffset = 110, zOffset = 56, direction = 1 }, }, } end @@ -380,66 +379,66 @@ end local function ShieldedLRPC_Outpost8() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 192, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 15, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -17, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 127, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 127, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 15, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 31, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 63, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -177, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -129, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -97, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 31, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -17, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -65, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -97, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -49, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 63, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 95, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 159, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -49, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -73, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -73, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 39, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -9, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -9, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 39, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -48, zOffset = 111, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 80, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 144, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -144, zOffset = -17, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 0, zOffset = -129, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = 47, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = 47, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 48, zOffset = 111, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -80, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = -17, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 47, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -17, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 31, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 63, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 31, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -17, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -49, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 63, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 95, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -49, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -24, zOffset = -73, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 24, zOffset = -73, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -56, zOffset = 39, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -88, zOffset = -9, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 88, zOffset = -9, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 56, zOffset = 39, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -48, zOffset = 111, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 80, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 144, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -144, zOffset = -17, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 0, zOffset = -129, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -112, zOffset = 47, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 112, zOffset = 47, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 48, zOffset = 111, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -80, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = -17, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 47, direction = 1 }, }, } end @@ -447,70 +446,70 @@ end local function ShieldedLRPC_Outpost9() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 208, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 132, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 132, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -124, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 164, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = -156, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -64, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 84, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 96, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -76, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -96, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 208, zOffset = 52, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = 100, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -108, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -44, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 164, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -12, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 180, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -208, zOffset = 20, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 64, zOffset = -188, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 100, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -52, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 60, direction = 0}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 12, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 112, zOffset = -60, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -80, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -112, zOffset = -60, direction = 3}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -160, zOffset = 52, direction = 3}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 160, zOffset = 52, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -48, zOffset = -140, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 80, zOffset = 132, direction = 0}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 48, zOffset = -140, direction = 2}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 68, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = 4, direction = 0}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 32, zOffset = 4, direction = 0}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -124, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 164, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = -156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -64, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 96, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -96, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 208, zOffset = 52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = 100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 164, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 180, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -208, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 64, zOffset = -188, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 100, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 24, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -56, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -24, zOffset = -52, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 56, zOffset = 60, direction = 0 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 12, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 112, zOffset = -60, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -80, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -112, zOffset = -60, direction = 3 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -160, zOffset = 52, direction = 3 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 160, zOffset = 52, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -48, zOffset = -140, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 80, zOffset = 132, direction = 0 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 48, zOffset = -140, direction = 2 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 68, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -32, zOffset = 4, direction = 0 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 32, zOffset = 4, direction = 0 }, }, } end @@ -518,22 +517,22 @@ end local function ShieldedLRPC_Outpost10() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -541,22 +540,22 @@ end local function ShieldedLRPC_Outpost11() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 48, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = 48, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = 16, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = 16, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, }, } end @@ -564,60 +563,60 @@ end local function ShieldedLRPC_Outpost12() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 224, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -224, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -107, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.armarad_scav.id, xOffset = -107, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -91, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.armvulc_scav.id, xOffset = 37, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -224, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -3, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -99, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -51, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -107, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.armarad_scav.id, xOffset = -107, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -155, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -91, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.armvulc_scav.id, xOffset = 37, zOffset = 0, direction = 1 }, }, } end @@ -625,60 +624,60 @@ end local function ShieldedLRPC_Outpost13() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 224, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -64, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -160, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 32, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = 224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = -96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 0, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -11, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 21, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -128, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -192, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = 96, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -43, zOffset = -224, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 53, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = -152, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = -104, direction = 1}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -107, zOffset = 48, direction = 1}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -107, zOffset = -48, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = 160, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = -96, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = 96, direction = 1}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = -160, direction = 1}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -91, zOffset = 0, direction = 1}, - { unitDefID = UnitDefNames.corbuzz_scav.id, xOffset = 37, zOffset = 0, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = 224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -11, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 21, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -43, zOffset = -224, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 53, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -3, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -99, zOffset = -152, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = -104, direction = 1 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -51, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -107, zOffset = 48, direction = 1 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = -107, zOffset = -48, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = 160, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = -96, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = 96, direction = 1 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -155, zOffset = -160, direction = 1 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -91, zOffset = 0, direction = 1 }, + { unitDefID = UnitDefNames.corbuzz_scav.id, xOffset = 37, zOffset = 0, direction = 1 }, }, } end @@ -686,75 +685,75 @@ end local function ShieldedLRPC_Outpost14() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 280, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 119, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 88, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -185, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 120, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -185, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 24, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -185, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 56, zOffset = 151, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -185, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -153, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 119, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 248, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = -25, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -248, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -41, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -73, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 216, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = -25, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = -73, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 55, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -41, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = 7, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 216, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 55, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 248, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 23, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -152, zOffset = 71, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -9, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -152, zOffset = -73, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 23, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -248, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = 71, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -216, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = 7, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -9, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -216, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -73, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = 15, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = -33, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = -33, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = 63, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 63, direction = 2}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 15, direction = 2}, - { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -24, zOffset = 103, direction = 3}, - { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 24, zOffset = 103, direction = 3}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 104, zOffset = -105, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -104, zOffset = -105, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 232, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -232, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -104, zOffset = 103, direction = 3}, - { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 104, zOffset = 103, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 119, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 88, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -185, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 120, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -185, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 24, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -185, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 56, zOffset = 151, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -185, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -153, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 119, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 248, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = -25, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -248, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -41, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -73, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 216, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = -25, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = -73, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 55, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -41, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = 7, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 216, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 55, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 248, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 23, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -152, zOffset = 71, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -9, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -152, zOffset = -73, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 23, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -248, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = 71, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -216, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = 7, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -9, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -216, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -73, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = 15, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = -33, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = -33, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -32, zOffset = 63, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 63, direction = 2 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 32, zOffset = 15, direction = 2 }, + { unitDefID = UnitDefNames.armveil_scav.id, xOffset = -24, zOffset = 103, direction = 3 }, + { unitDefID = UnitDefNames.armarad_scav.id, xOffset = 24, zOffset = 103, direction = 3 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 104, zOffset = -105, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -104, zOffset = -105, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 232, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -232, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = -104, zOffset = 103, direction = 3 }, + { unitDefID = UnitDefNames.armbrtha_scav.id, xOffset = 104, zOffset = 103, direction = 1 }, --{ unitDefID = UnitDefNames.armsilo_scav.id, xOffset = 0, zOffset = -113, direction = 2}, --{ unitDefID = UnitDefNames.armsilo_scav.id, xOffset = 112, zOffset = -1, direction = 2}, --{ unitDefID = UnitDefNames.armsilo_scav.id, xOffset = -112, zOffset = -1, direction = 2}, @@ -765,77 +764,77 @@ end local function ShieldedLRPC_Outpost15() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 280, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -136, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -185, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 135, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 152, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 103, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -185, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -104, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 135, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 103, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -185, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -185, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -168, zOffset = 167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 248, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -73, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -9, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 152, zOffset = -73, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = 7, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -248, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 216, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -216, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = -25, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = -25, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 280, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 248, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = 7, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 216, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -216, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = -73, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -248, zOffset = -57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -152, zOffset = -73, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -280, zOffset = 39, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -9, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = -41, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 184, zOffset = 55, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -184, zOffset = 55, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = 63, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = 63, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = -33, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = 15, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = 15, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = -33, direction = 3}, - { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -24, zOffset = 103, direction = 3}, - { unitDefID = UnitDefNames.corarad_scav.id, xOffset = 24, zOffset = 103, direction = 3}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 104, zOffset = -105, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -104, zOffset = -105, direction = 2}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 232, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -232, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = -112, zOffset = 111, direction = 3}, - { unitDefID = UnitDefNames.corint_scav.id, xOffset = 112, zOffset = 111, direction = 1}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -136, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -185, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 135, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 152, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 103, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -185, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -104, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 135, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 103, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -185, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -185, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -168, zOffset = 167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 248, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -73, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -9, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 152, zOffset = -73, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = 7, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -248, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 216, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -216, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = -25, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = -25, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 280, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 248, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = 7, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 216, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -216, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = -73, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -248, zOffset = -57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -152, zOffset = -73, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -280, zOffset = 39, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -9, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = -41, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 184, zOffset = 55, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -184, zOffset = 55, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = 63, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = 63, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = -33, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -32, zOffset = 15, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = 15, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 32, zOffset = -33, direction = 3 }, + { unitDefID = UnitDefNames.corshroud_scav.id, xOffset = -24, zOffset = 103, direction = 3 }, + { unitDefID = UnitDefNames.corarad_scav.id, xOffset = 24, zOffset = 103, direction = 3 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 104, zOffset = -105, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -104, zOffset = -105, direction = 2 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = 232, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.corgate_scav.id, xOffset = -232, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = -112, zOffset = 111, direction = 3 }, + { unitDefID = UnitDefNames.corint_scav.id, xOffset = 112, zOffset = 111, direction = 1 }, --{ unitDefID = UnitDefNames.corsilo_scav.id, xOffset = 112, zOffset = -1, direction = 3}, --{ unitDefID = UnitDefNames.corsilo_scav.id, xOffset = -112, zOffset = -1, direction = 3}, --{ unitDefID = UnitDefNames.corsilo_scav.id, xOffset = 0, zOffset = -113, direction = 3}, @@ -843,22 +842,21 @@ local function ShieldedLRPC_Outpost15() } end - return { ShieldedLRPC_Outpost0, ShieldedLRPC_Outpost1, - ShieldedLRPC_Outpost2, + ShieldedLRPC_Outpost2, ShieldedLRPC_Outpost3, ShieldedLRPC_Outpost4, ShieldedLRPC_Outpost5, - ShieldedLRPC_Outpost6, + ShieldedLRPC_Outpost6, ShieldedLRPC_Outpost7, - ShieldedLRPC_Outpost8, + ShieldedLRPC_Outpost8, ShieldedLRPC_Outpost9, - ShieldedLRPC_Outpost10, + ShieldedLRPC_Outpost10, ShieldedLRPC_Outpost11, - ShieldedLRPC_Outpost12, + ShieldedLRPC_Outpost12, ShieldedLRPC_Outpost13, - ShieldedLRPC_Outpost14, - ShieldedLRPC_Outpost15, + ShieldedLRPC_Outpost14, + ShieldedLRPC_Outpost15, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_small_outposts.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_small_outposts.lua index eb5170f3ab2..162e49b7baa 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_small_outposts.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_small_outposts.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -15,70 +15,70 @@ end local function t1Firebase1() local buildings - local r = math.random(0,3) + local r = math.random(0, 3) if r == 0 then buildings = { - { unitDefID = UDN.armguard_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 40, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 8, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -40, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -8, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -72, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -72, direction = 1 }, } elseif r == 1 then buildings = { - { unitDefID = UDN.armguard_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -40, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 8, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -72, zOffset = 40, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -8, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -8, zOffset = 72, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -40, direction = 1 }, + { unitDefID = UDN.armguard_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -40, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -72, zOffset = 40, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -8, zOffset = 72, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -40, direction = 1 }, } elseif r == 2 then buildings = { - { unitDefID = UDN.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -16, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 16, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 80, direction = 1 }, } else buildings = { - { unitDefID = UDN.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -16, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 16, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corpun_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = 80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -80, direction = 1 }, } end @@ -92,78 +92,78 @@ end local function windFarm1() local buildings - local r = math.random(0,3) + local r = math.random(0, 3) if r == 0 then buildings = { - { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = -80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = 80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = -80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = 80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = 80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = 80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = -80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -80, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = -80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = -80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = 80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = -80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = 80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = 80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = 80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 96, zOffset = -80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -48, zOffset = -80, direction = 1 }, } elseif r == 1 then buildings = { - { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -96, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 96, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 96, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 96, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = -48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 0, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 48, direction = 1 }, - { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 96, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = -48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = 80, zOffset = 48, direction = 1 }, + { unitDefID = UDN.armwin_scav.id, xOffset = -80, zOffset = -96, direction = 1 }, } elseif r == 2 then buildings = { - { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = -80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = 80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = -80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = 80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = 80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = -80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = 80, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 48, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = -80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -96, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -48, zOffset = 80, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 96, zOffset = -80, direction = 1 }, } else buildings = { - { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -96, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 96, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = -48, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 96, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = -96, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = -96, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, - { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = -96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = 96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = -48, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = -96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = -80, zOffset = -96, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 0, zOffset = 0, direction = 1 }, + { unitDefID = UDN.corwin_scav.id, xOffset = 80, zOffset = 96, direction = 1 }, } end @@ -181,14 +181,14 @@ local function minefield1() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3 }, radius = 192, buildings = { - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-192,192), zOffset = math.random(-192,192), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-192, 192), zOffset = math.random(-192, 192), direction = 0 }, }, } end @@ -199,10 +199,10 @@ local function minefield2() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3 }, radius = 96, buildings = { - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-96,96), zOffset = math.random(-96,96), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-96,96), zOffset = math.random(-96,96), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-96,96), zOffset = math.random(-96,96), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-96,96), zOffset = math.random(-96,96), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-96, 96), zOffset = math.random(-96, 96), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-96, 96), zOffset = math.random(-96, 96), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-96, 96), zOffset = math.random(-96, 96), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-96, 96), zOffset = math.random(-96, 96), direction = 0 }, }, } end @@ -213,26 +213,26 @@ local function minefield3() tiers = { tiers.T0, tiers.T1, tiers.T2, tiers.T3 }, radius = 384, buildings = { - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, - { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384,384), zOffset = math.random(-384,384), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine1_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.armmine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, + { unitDefID = UDN.cormine3_scav.id, xOffset = math.random(-384, 384), zOffset = math.random(-384, 384), direction = 0 }, }, } end - + local function randomNanoTowerDuo() local unitID = getRandomNanoTowerID() @@ -241,12 +241,12 @@ local function randomNanoTowerDuo() tiers = { tiers.T1, tiers.T2 }, radius = 48, buildings = { - { unitDefID = unitID, xOffset = 24, zOffset = 0, direction = 0 }, - { unitDefID = unitID, xOffset = -24, zOffset = 0, direction = 0 }, + { unitDefID = unitID, xOffset = 24, zOffset = 0, direction = 0 }, + { unitDefID = unitID, xOffset = -24, zOffset = 0, direction = 0 }, }, } end - + local function randomNanoTowerQuad() local unitID = getRandomNanoTowerID() @@ -255,36 +255,36 @@ local function randomNanoTowerQuad() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 56, buildings = { - { unitDefID = unitID, xOffset = 24, zOffset = 24, direction = 0 }, - { unitDefID = unitID, xOffset = -24, zOffset = 24, direction = 0 }, - { unitDefID = unitID, xOffset = 24, zOffset = -24, direction = 0 }, - { unitDefID = unitID, xOffset = -24, zOffset = -24, direction = 0 }, + { unitDefID = unitID, xOffset = 24, zOffset = 24, direction = 0 }, + { unitDefID = unitID, xOffset = -24, zOffset = 24, direction = 0 }, + { unitDefID = unitID, xOffset = 24, zOffset = -24, direction = 0 }, + { unitDefID = unitID, xOffset = -24, zOffset = -24, direction = 0 }, }, } end - + local function t3Gantry1() local buildings - local r = math.random(0,1) + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.armnanotc_scav.id, xOffset = -112, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 112, zOffset = -32, direction = 0 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -112, zOffset = 16, direction = 0 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 112, zOffset = 16, direction = 0 }, - { unitDefID = UDN.armgate_scav.id, xOffset = 40, zOffset = -24, direction = 0 }, - { unitDefID = UDN.armamd_scav.id, xOffset = -40, zOffset = -24, direction = 0 }, - { unitDefID = UDN.armshltx_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -112, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 112, zOffset = -32, direction = 0 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -112, zOffset = 16, direction = 0 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 112, zOffset = 16, direction = 0 }, + { unitDefID = UDN.armgate_scav.id, xOffset = 40, zOffset = -24, direction = 0 }, + { unitDefID = UDN.armamd_scav.id, xOffset = -40, zOffset = -24, direction = 0 }, + { unitDefID = UDN.armshltx_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, } else buildings = { - { unitDefID = UDN.cornanotc_scav.id, xOffset = -112, zOffset = 16, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 112, zOffset = 16, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -112, zOffset = -32, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 112, zOffset = -32, direction = 0 }, - { unitDefID = UDN.corgant_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, - { unitDefID = UDN.corgate_scav.id, xOffset = 40, zOffset = -24, direction = 0 }, - { unitDefID = UDN.corfmd_scav.id, xOffset = -40, zOffset = -24, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -112, zOffset = 16, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 112, zOffset = 16, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -112, zOffset = -32, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 112, zOffset = -32, direction = 0 }, + { unitDefID = UDN.corgant_scav.id, xOffset = 0, zOffset = 80, direction = 0 }, + { unitDefID = UDN.corgate_scav.id, xOffset = 40, zOffset = -24, direction = 0 }, + { unitDefID = UDN.corfmd_scav.id, xOffset = -40, zOffset = -24, direction = 0 }, } end @@ -297,46 +297,46 @@ local function t3Gantry1() end local function t3Gantry2() - local buildings - local r = math.random(0,1) + local buildings + local r = math.random(0, 1) if r == 0 then buildings = { - { unitDefID = UDN.armapt3_scav.id, xOffset = 0, zOffset = 20, direction = 0 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -116, zOffset = -128, direction = 1 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -196, zOffset = -64, direction = 1 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 188, zOffset = -64, direction = 3 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 124, zOffset = -128, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = -204, zOffset = -8, direction = 3 }, - { unitDefID = UDN.armbrtha_scav.id, xOffset = 4, zOffset = 184, direction = 0 }, - { unitDefID = UDN.armgate_scav.id, xOffset = 4, zOffset = -136, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = 196, zOffset = 88, direction = 1 }, - { unitDefID = UDN.armflak_scav.id, xOffset = 196, zOffset = -8, direction = 1 }, - { unitDefID = UDN.armmercury_scav.id, xOffset = -188, zOffset = 40, direction = 3 }, - { unitDefID = UDN.armmercury_scav.id, xOffset = 180, zOffset = 40, direction = 1 }, - { unitDefID = UDN.armamb_scav.id, xOffset = 60, zOffset = -144, direction = 2 }, - { unitDefID = UDN.armamb_scav.id, xOffset = -52, zOffset = -144, direction = 2 }, - { unitDefID = UDN.armanni_scav.id, xOffset = -108, zOffset = 184, direction = 0 }, - { unitDefID = UDN.armanni_scav.id, xOffset = 116, zOffset = 184, direction = 0 }, - { unitDefID = UDN.armflak_scav.id, xOffset = -204, zOffset = 88, direction = 3 }, + { unitDefID = UDN.armapt3_scav.id, xOffset = 0, zOffset = 20, direction = 0 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -116, zOffset = -128, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -196, zOffset = -64, direction = 1 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 188, zOffset = -64, direction = 3 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 124, zOffset = -128, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = -204, zOffset = -8, direction = 3 }, + { unitDefID = UDN.armbrtha_scav.id, xOffset = 4, zOffset = 184, direction = 0 }, + { unitDefID = UDN.armgate_scav.id, xOffset = 4, zOffset = -136, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = 196, zOffset = 88, direction = 1 }, + { unitDefID = UDN.armflak_scav.id, xOffset = 196, zOffset = -8, direction = 1 }, + { unitDefID = UDN.armmercury_scav.id, xOffset = -188, zOffset = 40, direction = 3 }, + { unitDefID = UDN.armmercury_scav.id, xOffset = 180, zOffset = 40, direction = 1 }, + { unitDefID = UDN.armamb_scav.id, xOffset = 60, zOffset = -144, direction = 2 }, + { unitDefID = UDN.armamb_scav.id, xOffset = -52, zOffset = -144, direction = 2 }, + { unitDefID = UDN.armanni_scav.id, xOffset = -108, zOffset = 184, direction = 0 }, + { unitDefID = UDN.armanni_scav.id, xOffset = 116, zOffset = 184, direction = 0 }, + { unitDefID = UDN.armflak_scav.id, xOffset = -204, zOffset = 88, direction = 3 }, } else buildings = { - { unitDefID = UDN.corapt3_scav.id, xOffset = 1, zOffset = 11, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -96, zOffset = -140, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 192, zOffset = -60, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -192, zOffset = -60, direction = 0 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 96, zOffset = -140, direction = 0 }, - { unitDefID = UDN.cordoom_scav.id, xOffset = 104, zOffset = 172, direction = 0 }, - { unitDefID = UDN.corint_scav.id, xOffset = 0, zOffset = 180, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = -200, zOffset = 76, direction = 3 }, - { unitDefID = UDN.corscreamer_scav.id, xOffset = -184, zOffset = 28, direction = 3 }, - { unitDefID = UDN.cordoom_scav.id, xOffset = -104, zOffset = 172, direction = 0 }, - { unitDefID = UDN.cortoast_scav.id, xOffset = 32, zOffset = -140, direction = 2 }, - { unitDefID = UDN.corflak_scav.id, xOffset = 200, zOffset = -20, direction = 1 }, - { unitDefID = UDN.corflak_scav.id, xOffset = 200, zOffset = 76, direction = 1 }, - { unitDefID = UDN.corgate_scav.id, xOffset = -24, zOffset = -148, direction = 0 }, - { unitDefID = UDN.corflak_scav.id, xOffset = -200, zOffset = -20, direction = 3 }, - { unitDefID = UDN.corscreamer_scav.id, xOffset = 184, zOffset = 28, direction = 1 }, + { unitDefID = UDN.corapt3_scav.id, xOffset = 1, zOffset = 11, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -96, zOffset = -140, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 192, zOffset = -60, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -192, zOffset = -60, direction = 0 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 96, zOffset = -140, direction = 0 }, + { unitDefID = UDN.cordoom_scav.id, xOffset = 104, zOffset = 172, direction = 0 }, + { unitDefID = UDN.corint_scav.id, xOffset = 0, zOffset = 180, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = -200, zOffset = 76, direction = 3 }, + { unitDefID = UDN.corscreamer_scav.id, xOffset = -184, zOffset = 28, direction = 3 }, + { unitDefID = UDN.cordoom_scav.id, xOffset = -104, zOffset = 172, direction = 0 }, + { unitDefID = UDN.cortoast_scav.id, xOffset = 32, zOffset = -140, direction = 2 }, + { unitDefID = UDN.corflak_scav.id, xOffset = 200, zOffset = -20, direction = 1 }, + { unitDefID = UDN.corflak_scav.id, xOffset = 200, zOffset = 76, direction = 1 }, + { unitDefID = UDN.corgate_scav.id, xOffset = -24, zOffset = -148, direction = 0 }, + { unitDefID = UDN.corflak_scav.id, xOffset = -200, zOffset = -20, direction = 3 }, + { unitDefID = UDN.corscreamer_scav.id, xOffset = 184, zOffset = 28, direction = 1 }, } end @@ -354,19 +354,19 @@ local function t2HeavyFirebase1() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 134, buildings = { - { unitDefID = UDN.armminivulc_scav.id, xOffset = -14, zOffset = 13, direction = 0 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = -91, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 90, zOffset = -59, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 26, zOffset = 101, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -134, zOffset = 53, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -86, zOffset = -43, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = -75, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 58, zOffset = 85, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = 53, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 90, zOffset = 69, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -118, zOffset = 21, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -102, zOffset = -11, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -6, zOffset = -107, direction = 2 }, + { unitDefID = UDN.armminivulc_scav.id, xOffset = -14, zOffset = 13, direction = 0 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = -91, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 90, zOffset = -59, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 26, zOffset = 101, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -134, zOffset = 53, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -86, zOffset = -43, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = -75, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 58, zOffset = 85, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = 53, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 90, zOffset = 69, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -118, zOffset = 21, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -102, zOffset = -11, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -6, zOffset = -107, direction = 2 }, }, } end @@ -377,27 +377,27 @@ local function t2HeavyFirebase2() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 172, buildings = { - { unitDefID = UDN.armminivulc_scav.id, xOffset = -14, zOffset = 20, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = -132, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = 12, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = 76, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -102, zOffset = 156, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 10, zOffset = -100, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -150, zOffset = -52, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -70, zOffset = 156, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -6, zOffset = 172, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -134, zOffset = -84, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -38, zOffset = 172, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 74, zOffset = -132, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 138, zOffset = 44, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = 108, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -118, zOffset = -116, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 122, zOffset = -20, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -134, zOffset = 140, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 42, zOffset = -116, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -166, zOffset = -20, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -86, zOffset = -132, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 106, zOffset = -148, direction = 2 }, + { unitDefID = UDN.armminivulc_scav.id, xOffset = -14, zOffset = 20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = -132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = 12, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = 76, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -102, zOffset = 156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 10, zOffset = -100, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -150, zOffset = -52, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -70, zOffset = 156, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -6, zOffset = 172, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -134, zOffset = -84, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -38, zOffset = 172, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 74, zOffset = -132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 138, zOffset = 44, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = 108, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -118, zOffset = -116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 122, zOffset = -20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -134, zOffset = 140, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 42, zOffset = -116, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -166, zOffset = -20, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -86, zOffset = -132, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 106, zOffset = -148, direction = 2 }, }, } end @@ -408,40 +408,40 @@ local function t2HeavyFirebase3() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 196, buildings = { - { unitDefID = UDN.armminivulc_scav.id, xOffset = -4, zOffset = -11, direction = 3 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 148, zOffset = 157, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 100, zOffset = -131, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 212, zOffset = 13, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = -163, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 132, zOffset = -131, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 180, zOffset = 93, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -147, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -140, zOffset = -147, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -35, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -124, zOffset = 93, direction = 2 }, - { unitDefID = UDN.armrad_scav.id, xOffset = 180, zOffset = -115, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -132, zOffset = -107, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 180, zOffset = 157, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 132, zOffset = -99, direction = 2 }, - { unitDefID = UDN.armjamt_scav.id, xOffset = -92, zOffset = 93, direction = 2 }, - { unitDefID = UDN.armrad_scav.id, xOffset = -172, zOffset = 109, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -44, zOffset = -147, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -156, zOffset = 29, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -108, zOffset = -147, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -124, zOffset = 125, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 180, zOffset = 125, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 20, zOffset = 173, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -12, zOffset = 157, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -3, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 140, zOffset = 117, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 20, zOffset = -179, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -115, direction = 2 }, - { unitDefID = UDN.armjamt_scav.id, xOffset = 100, zOffset = -99, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -172, zOffset = -83, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 196, zOffset = -19, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 52, zOffset = 173, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -92, zOffset = 125, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 116, zOffset = 157, direction = 2 }, + { unitDefID = UDN.armminivulc_scav.id, xOffset = -4, zOffset = -11, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 148, zOffset = 157, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 100, zOffset = -131, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 212, zOffset = 13, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = -163, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 132, zOffset = -131, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 180, zOffset = 93, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -147, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -140, zOffset = -147, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -35, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -124, zOffset = 93, direction = 2 }, + { unitDefID = UDN.armrad_scav.id, xOffset = 180, zOffset = -115, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -132, zOffset = -107, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 180, zOffset = 157, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 132, zOffset = -99, direction = 2 }, + { unitDefID = UDN.armjamt_scav.id, xOffset = -92, zOffset = 93, direction = 2 }, + { unitDefID = UDN.armrad_scav.id, xOffset = -172, zOffset = 109, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -44, zOffset = -147, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -156, zOffset = 29, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -108, zOffset = -147, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -124, zOffset = 125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 180, zOffset = 125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 20, zOffset = 173, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -12, zOffset = 157, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -3, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 140, zOffset = 117, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 20, zOffset = -179, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -115, direction = 2 }, + { unitDefID = UDN.armjamt_scav.id, xOffset = 100, zOffset = -99, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -172, zOffset = -83, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 196, zOffset = -19, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 52, zOffset = 173, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -92, zOffset = 125, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 116, zOffset = 157, direction = 2 }, }, } end @@ -452,80 +452,79 @@ local function t2HeavyFirebase4() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 328, buildings = { - { unitDefID = UDN.armnanotc_scav.id, xOffset = -208, zOffset = 9, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 160, zOffset = -39, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -160, zOffset = 9, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -208, zOffset = -39, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 160, zOffset = 9, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 208, zOffset = -39, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = -160, zOffset = -39, direction = 2 }, - { unitDefID = UDN.armnanotc_scav.id, xOffset = 208, zOffset = 9, direction = 2 }, - { unitDefID = UDN.armminivulc_scav.id, xOffset = -16, zOffset = -7, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -208, zOffset = 9, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 160, zOffset = -39, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -160, zOffset = 9, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -208, zOffset = -39, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 160, zOffset = 9, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 208, zOffset = -39, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = -160, zOffset = -39, direction = 2 }, + { unitDefID = UDN.armnanotc_scav.id, xOffset = 208, zOffset = 9, direction = 2 }, + { unitDefID = UDN.armminivulc_scav.id, xOffset = -16, zOffset = -7, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 312, zOffset = 49, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 312, zOffset = 17, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 8, zOffset = 177, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -328, zOffset = -15, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 312, zOffset = 81, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = 105, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -312, zOffset = -47, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = -111, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = -143, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = 145, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = 97, direction = 2 }, - { unitDefID = UDN.armrad_scav.id, xOffset = 152, zOffset = 81, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -56, zOffset = -143, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 136, zOffset = -159, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -248, zOffset = 81, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 296, zOffset = -15, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 168, zOffset = 129, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = 161, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = 145, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -216, zOffset = 81, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = -127, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -360, zOffset = 1, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = 113, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = 112, zOffset = -103, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 40, zOffset = 177, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -120, zOffset = 113, direction = 2 }, - { unitDefID = UDN.armferret_scav.id, xOffset = -272, zOffset = 25, direction = 2 }, - { unitDefID = UDN.armjamt_scav.id, xOffset = 232, zOffset = 65, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = 113, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 232, zOffset = 97, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -280, zOffset = -111, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -24, zOffset = -159, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 296, zOffset = -47, direction = 2 }, - { unitDefID = UDN.armjamt_scav.id, xOffset = -168, zOffset = 49, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -296, zOffset = -79, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -152, zOffset = -127, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 104, zOffset = -175, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -280, zOffset = 81, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -88, zOffset = -143, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 72, zOffset = -191, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -184, zOffset = -127, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -184, zOffset = 97, direction = 2 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 200, zOffset = -127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 312, zOffset = 49, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 312, zOffset = 17, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 8, zOffset = 177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -328, zOffset = -15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 312, zOffset = 81, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 48, zOffset = 105, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -312, zOffset = -47, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = -111, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = -143, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = 145, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = 97, direction = 2 }, + { unitDefID = UDN.armrad_scav.id, xOffset = 152, zOffset = 81, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -56, zOffset = -143, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 136, zOffset = -159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -248, zOffset = 81, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 296, zOffset = -15, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 168, zOffset = 129, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = 161, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = 145, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -216, zOffset = 81, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = -127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -360, zOffset = 1, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = 113, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = 112, zOffset = -103, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 40, zOffset = 177, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -120, zOffset = 113, direction = 2 }, + { unitDefID = UDN.armferret_scav.id, xOffset = -272, zOffset = 25, direction = 2 }, + { unitDefID = UDN.armjamt_scav.id, xOffset = 232, zOffset = 65, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = 113, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 232, zOffset = 97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -280, zOffset = -111, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -24, zOffset = -159, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 296, zOffset = -47, direction = 2 }, + { unitDefID = UDN.armjamt_scav.id, xOffset = -168, zOffset = 49, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -296, zOffset = -79, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -152, zOffset = -127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 104, zOffset = -175, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -280, zOffset = 81, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -88, zOffset = -143, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 72, zOffset = -191, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -184, zOffset = -127, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -184, zOffset = 97, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 200, zOffset = -127, direction = 2 }, }, } end - local function t2HeavyFirebase5() return { type = types.Land, tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 110, buildings = { - { unitDefID = UDN.corminibuzz_scav.id, xOffset = 3, zOffset = -10, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 11, zOffset = 110, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = -98, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -53, zOffset = 62, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -21, zOffset = 94, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = -18, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = 14, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = -34, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -69, zOffset = -66, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = -50, direction = 1 }, + { unitDefID = UDN.corminibuzz_scav.id, xOffset = 3, zOffset = -10, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 11, zOffset = 110, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = -98, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -53, zOffset = 62, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -21, zOffset = 94, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = -18, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = 14, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = -34, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -69, zOffset = -66, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = -50, direction = 1 }, }, } end @@ -536,38 +535,38 @@ local function t2HeavyFirebase6() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 245, buildings = { - { unitDefID = UDN.corminibuzz_scav.id, xOffset = 19, zOffset = 8, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 123, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -245, zOffset = -48, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -5, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -181, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 187, zOffset = -32, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -165, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 139, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 59, zOffset = -128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -101, zOffset = -176, direction = 1 }, - { unitDefID = UDN.corerad_scav.id, xOffset = -85, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = 32, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -213, zOffset = 48, direction = 1 }, - { unitDefID = UDN.corrad_scav.id, xOffset = -69, zOffset = -96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -197, zOffset = -112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 203, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 187, zOffset = -64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -149, zOffset = 96, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -85, zOffset = 144, direction = 1 }, - { unitDefID = UDN.corjamt_scav.id, xOffset = 139, zOffset = 0, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 219, zOffset = 64, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 107, zOffset = 144, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 11, zOffset = 192, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -133, zOffset = -160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 91, zOffset = -112, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -229, zOffset = -80, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 43, zOffset = 176, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 27, zOffset = -144, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -117, zOffset = 128, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 75, zOffset = 160, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 171, zOffset = 112, direction = 1 }, - } + { unitDefID = UDN.corminibuzz_scav.id, xOffset = 19, zOffset = 8, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 123, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -245, zOffset = -48, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -5, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -181, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 187, zOffset = -32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -165, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 139, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 59, zOffset = -128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -101, zOffset = -176, direction = 1 }, + { unitDefID = UDN.corerad_scav.id, xOffset = -85, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = 32, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -213, zOffset = 48, direction = 1 }, + { unitDefID = UDN.corrad_scav.id, xOffset = -69, zOffset = -96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -197, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 203, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 187, zOffset = -64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -149, zOffset = 96, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -85, zOffset = 144, direction = 1 }, + { unitDefID = UDN.corjamt_scav.id, xOffset = 139, zOffset = 0, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 219, zOffset = 64, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 107, zOffset = 144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 11, zOffset = 192, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -133, zOffset = -160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 91, zOffset = -112, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -229, zOffset = -80, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 43, zOffset = 176, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 27, zOffset = -144, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -117, zOffset = 128, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 75, zOffset = 160, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 171, zOffset = 112, direction = 1 }, + }, } end @@ -577,58 +576,58 @@ local function t2HeavyFirebase7() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 325, buildings = { - { unitDefID = UDN.cornanotc_scav.id, xOffset = -3, zOffset = 140, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -131, zOffset = 12, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -3, zOffset = -116, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 125, zOffset = 12, direction = 1 }, - { unitDefID = UDN.corminibuzz_scav.id, xOffset = -3, zOffset = 12, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -3, zOffset = 140, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -131, zOffset = 12, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -3, zOffset = -116, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 125, zOffset = 12, direction = 1 }, + { unitDefID = UDN.corminibuzz_scav.id, xOffset = -3, zOffset = 12, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 277, zOffset = 100, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 149, zOffset = -188, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 133, zOffset = 260, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 117, zOffset = -252, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = 292, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -235, zOffset = -124, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 213, zOffset = 164, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -123, zOffset = 260, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -75, zOffset = -268, direction = 1 }, - { unitDefID = UDN.corrad_scav.id, xOffset = 85, zOffset = 116, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -331, zOffset = 52, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -155, zOffset = 228, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -139, zOffset = -188, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 309, zOffset = -76, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -219, zOffset = 180, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 245, zOffset = -108, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -283, zOffset = 116, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 149, zOffset = 196, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -107, zOffset = -252, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 325, zOffset = 36, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = 132, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 213, zOffset = -172, direction = 1 }, - { unitDefID = UDN.corjamt_scav.id, xOffset = -75, zOffset = 100, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -251, zOffset = 148, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -283, zOffset = 84, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = 277, zOffset = 68, direction = 1 }, - { unitDefID = UDN.corjamt_scav.id, xOffset = 85, zOffset = -76, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = 228, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -187, zOffset = 196, direction = 1 }, - { unitDefID = UDN.corrad_scav.id, xOffset = -91, zOffset = -60, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -299, zOffset = -92, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -315, zOffset = 84, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 149, zOffset = -220, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -171, zOffset = -188, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 85, zOffset = -268, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 277, zOffset = -108, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -203, zOffset = -124, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -139, zOffset = -220, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -203, zOffset = -156, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 245, zOffset = -140, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 309, zOffset = 68, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 181, zOffset = 196, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 181, zOffset = -188, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -267, zOffset = -92, direction = 1 }, - { unitDefID = UDN.corhllt_scav.id, xOffset = -123, zOffset = 228, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 277, zOffset = 100, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 149, zOffset = -188, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 133, zOffset = 260, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 117, zOffset = -252, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = 292, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -235, zOffset = -124, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 213, zOffset = 164, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -123, zOffset = 260, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -75, zOffset = -268, direction = 1 }, + { unitDefID = UDN.corrad_scav.id, xOffset = 85, zOffset = 116, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -331, zOffset = 52, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -155, zOffset = 228, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -139, zOffset = -188, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 309, zOffset = -76, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -219, zOffset = 180, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 245, zOffset = -108, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -283, zOffset = 116, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 149, zOffset = 196, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -107, zOffset = -252, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 325, zOffset = 36, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = 132, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 213, zOffset = -172, direction = 1 }, + { unitDefID = UDN.corjamt_scav.id, xOffset = -75, zOffset = 100, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -251, zOffset = 148, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -283, zOffset = 84, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = 277, zOffset = 68, direction = 1 }, + { unitDefID = UDN.corjamt_scav.id, xOffset = 85, zOffset = -76, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = 228, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -187, zOffset = 196, direction = 1 }, + { unitDefID = UDN.corrad_scav.id, xOffset = -91, zOffset = -60, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -299, zOffset = -92, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -315, zOffset = 84, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 149, zOffset = -220, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -171, zOffset = -188, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 85, zOffset = -268, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 277, zOffset = -108, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -203, zOffset = -124, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -139, zOffset = -220, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -203, zOffset = -156, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 245, zOffset = -140, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 309, zOffset = 68, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 181, zOffset = 196, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 181, zOffset = -188, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -267, zOffset = -92, direction = 1 }, + { unitDefID = UDN.corhllt_scav.id, xOffset = -123, zOffset = 228, direction = 1 }, + }, } end @@ -638,57 +637,57 @@ local function t2HeavyFirebase8() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 333, buildings = { - { unitDefID = UDN.cornanotc_scav.id, xOffset = -75, zOffset = 131, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -123, zOffset = 83, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -75, zOffset = 83, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 85, zOffset = -61, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 133, zOffset = -61, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = -123, zOffset = 131, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 133, zOffset = -109, direction = 1 }, - { unitDefID = UDN.cornanotc_scav.id, xOffset = 85, zOffset = -109, direction = 1 }, - { unitDefID = UDN.corminibuzz_scav.id, xOffset = 5, zOffset = 3, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -75, zOffset = 131, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -123, zOffset = 83, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -75, zOffset = 83, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 85, zOffset = -61, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 133, zOffset = -61, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = -123, zOffset = 131, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 133, zOffset = -109, direction = 1 }, + { unitDefID = UDN.cornanotc_scav.id, xOffset = 85, zOffset = -109, direction = 1 }, + { unitDefID = UDN.corminibuzz_scav.id, xOffset = 5, zOffset = 3, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 93, zOffset = -325, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -163, zOffset = -53, direction = 1 }, - { unitDefID = UDN.corjamt_scav.id, xOffset = 189, zOffset = -69, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -83, zOffset = 299, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = 139, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -99, zOffset = -117, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 221, zOffset = -21, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -19, zOffset = -213, direction = 1 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -123, zOffset = 211, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 189, zOffset = 11, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 269, zOffset = -85, direction = 1 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 133, zOffset = -189, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -179, zOffset = -21, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -67, zOffset = -149, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -243, zOffset = 43, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -19, zOffset = 235, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -259, zOffset = 75, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 237, zOffset = -53, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 157, zOffset = 43, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -211, zOffset = 11, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -323, zOffset = 123, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 13, zOffset = -245, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 29, zOffset = -277, direction = 1 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = 85, zOffset = -189, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -115, zOffset = 315, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 93, zOffset = 107, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 29, zOffset = 171, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -51, zOffset = 267, direction = 1 }, - { unitDefID = UDN.corrad_scav.id, xOffset = -179, zOffset = 139, direction = 1 }, - { unitDefID = UDN.corjamt_scav.id, xOffset = -179, zOffset = 91, direction = 1 }, - { unitDefID = UDN.corrad_scav.id, xOffset = 189, zOffset = -117, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -131, zOffset = -85, direction = 1 }, - { unitDefID = UDN.cormadsam_scav.id, xOffset = -75, zOffset = 211, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 61, zOffset = -309, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 13, zOffset = 203, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -291, zOffset = 107, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -51, zOffset = -181, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 125, zOffset = 75, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 301, zOffset = -117, direction = 1 }, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 333, zOffset = -133, direction = 1 }, - } + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 93, zOffset = -325, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -163, zOffset = -53, direction = 1 }, + { unitDefID = UDN.corjamt_scav.id, xOffset = 189, zOffset = -69, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -83, zOffset = 299, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = 139, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -99, zOffset = -117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 221, zOffset = -21, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -19, zOffset = -213, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -123, zOffset = 211, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 189, zOffset = 11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 269, zOffset = -85, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 133, zOffset = -189, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -179, zOffset = -21, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -67, zOffset = -149, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -243, zOffset = 43, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -19, zOffset = 235, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -259, zOffset = 75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 237, zOffset = -53, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 157, zOffset = 43, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -211, zOffset = 11, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -323, zOffset = 123, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 13, zOffset = -245, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 29, zOffset = -277, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = 85, zOffset = -189, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -115, zOffset = 315, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 93, zOffset = 107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 29, zOffset = 171, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -51, zOffset = 267, direction = 1 }, + { unitDefID = UDN.corrad_scav.id, xOffset = -179, zOffset = 139, direction = 1 }, + { unitDefID = UDN.corjamt_scav.id, xOffset = -179, zOffset = 91, direction = 1 }, + { unitDefID = UDN.corrad_scav.id, xOffset = 189, zOffset = -117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -131, zOffset = -85, direction = 1 }, + { unitDefID = UDN.cormadsam_scav.id, xOffset = -75, zOffset = 211, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 61, zOffset = -309, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 13, zOffset = 203, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -291, zOffset = 107, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -51, zOffset = -181, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 125, zOffset = 75, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 301, zOffset = -117, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 333, zOffset = -133, direction = 1 }, + }, } end @@ -710,4 +709,4 @@ return { t2HeavyFirebase6, t2HeavyFirebase7, t2HeavyFirebase8, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tacnukes.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tacnukes.lua index e67a3145ef9..07c7eba458e 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tacnukes.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tacnukes.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,49 +9,48 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function tacnukes0() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 232, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -24, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -136, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -232, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 136, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -232, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 232, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 232, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 24, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -168, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -232, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 168, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 184, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -88, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 200, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -56, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 232, direction = 3}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 48, zOffset = -24, direction = 1}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -48, zOffset = 24, direction = 1}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -144, zOffset = 72, direction = 1}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 144, zOffset = -72, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -48, zOffset = -104, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 48, zOffset = -152, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 48, zOffset = 104, direction = 1}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -48, zOffset = 152, direction = 1}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 144, zOffset = 40, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 144, zOffset = -184, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -144, zOffset = 184, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -144, zOffset = -40, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -24, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -136, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -232, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 136, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -232, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 232, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 232, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 24, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -168, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -232, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 168, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 184, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -88, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 200, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -56, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 232, direction = 3 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 48, zOffset = -24, direction = 1 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -48, zOffset = 24, direction = 1 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -144, zOffset = 72, direction = 1 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 144, zOffset = -72, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -48, zOffset = -104, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 48, zOffset = -152, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 48, zOffset = 104, direction = 1 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -48, zOffset = 152, direction = 1 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 144, zOffset = 40, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 144, zOffset = -184, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -144, zOffset = 184, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -144, zOffset = -40, direction = 3 }, }, } end @@ -59,45 +58,45 @@ end local function tacnukes1() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 219, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 27, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 59, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = -229, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -85, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = 219, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -53, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = 91, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = -85, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -133, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = -21, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 155, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 219, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -160, zOffset = -85, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -128, zOffset = 219, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = 91, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = 187, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 139, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -197, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 160, zOffset = 91, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 128, zOffset = -229, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -192, zOffset = 187, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = -181, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -229, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 192, zOffset = -165, direction = 3}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -144, zOffset = 75, direction = 1}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 48, zOffset = -21, direction = 1}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 144, zOffset = -69, direction = 1}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -48, zOffset = 27, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 48, zOffset = 107, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -48, zOffset = 155, direction = 1}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -48, zOffset = -101, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 48, zOffset = -149, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -144, zOffset = 171, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 144, zOffset = -181, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 144, zOffset = 43, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -144, zOffset = -37, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 27, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 59, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = -229, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -85, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = 219, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -53, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = 91, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = -85, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -133, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = -21, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 155, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 219, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -160, zOffset = -85, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -128, zOffset = 219, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = 91, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = 187, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 139, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -197, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 160, zOffset = 91, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 128, zOffset = -229, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -192, zOffset = 187, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = -181, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -229, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 192, zOffset = -165, direction = 3 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -144, zOffset = 75, direction = 1 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 48, zOffset = -21, direction = 1 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 144, zOffset = -69, direction = 1 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -48, zOffset = 27, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 48, zOffset = 107, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -48, zOffset = 155, direction = 1 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -48, zOffset = -101, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 48, zOffset = -149, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -144, zOffset = 171, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 144, zOffset = -181, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 144, zOffset = 43, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -144, zOffset = -37, direction = 3 }, }, } end @@ -105,34 +104,34 @@ end local function tacnukes2() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 104, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -96, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 48, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 48, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -96, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 96, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 96, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 8, zOffset = 88, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 88, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -88, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 88, zOffset = -56, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -56, zOffset = -88, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -88, zOffset = 56, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -88, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 56, zOffset = 88, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -40, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 8, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -8, zOffset = 40, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 40, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 104, zOffset = 40, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 40, zOffset = -104, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -40, zOffset = 104, direction = 3}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = -96, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -48, zOffset = 48, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 48, zOffset = 48, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = -96, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 96, zOffset = 96, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -96, zOffset = 96, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 8, zOffset = 88, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 88, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -8, zOffset = -88, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 88, zOffset = -56, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -56, zOffset = -88, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -88, zOffset = 56, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -88, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 56, zOffset = 88, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -40, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 8, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -8, zOffset = 40, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 40, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 104, zOffset = 40, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 40, zOffset = -104, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -104, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -40, zOffset = 104, direction = 3 }, }, } end @@ -140,27 +139,27 @@ end local function tacnukes3() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 116, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 108, zOffset = 68, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -36, zOffset = 20, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -84, zOffset = -124, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -84, zOffset = 68, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 12, zOffset = -28, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -36, zOffset = -76, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 60, zOffset = 20, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 100, zOffset = -36, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -76, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 68, zOffset = 60, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 20, zOffset = 60, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -76, zOffset = 28, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 52, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -28, zOffset = -36, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 4, zOffset = 12, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -28, zOffset = 76, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -92, zOffset = -68, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 116, zOffset = 12, direction = 3}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 108, zOffset = 68, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -36, zOffset = 20, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -84, zOffset = -124, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -84, zOffset = 68, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 12, zOffset = -28, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -36, zOffset = -76, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 60, zOffset = 20, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 100, zOffset = -36, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -76, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 68, zOffset = 60, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 20, zOffset = 60, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -76, zOffset = 28, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 52, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -28, zOffset = -36, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 4, zOffset = 12, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -28, zOffset = 76, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -92, zOffset = -68, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 116, zOffset = 12, direction = 3 }, }, } end @@ -168,21 +167,21 @@ end local function tacnukes4() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 84, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -20, zOffset = -54, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 76, zOffset = 42, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -68, zOffset = -6, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -116, zOffset = 42, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 28, zOffset = -6, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -12, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 68, zOffset = -62, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 36, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -28, zOffset = -14, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 20, zOffset = -46, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -60, zOffset = 50, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 84, zOffset = -14, direction = 3}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -20, zOffset = -54, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 76, zOffset = 42, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -68, zOffset = -6, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -116, zOffset = 42, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 28, zOffset = -6, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = -12, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 68, zOffset = -62, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 36, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = -28, zOffset = -14, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 20, zOffset = -46, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -60, zOffset = 50, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = 84, zOffset = -14, direction = 3 }, }, } end @@ -190,15 +189,15 @@ end local function tacnukes5() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 42, buildings = { - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -17, zOffset = -14, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -65, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 31, zOffset = -62, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 39, zOffset = 26, direction = 3}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 23, zOffset = -22, direction = 3}, - { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -9, zOffset = 42, direction = 3}, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -17, zOffset = -14, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = -65, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 31, zOffset = -62, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 39, zOffset = 26, direction = 3 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 23, zOffset = -22, direction = 3 }, + { unitDefID = UnitDefNames.armemp_scav.id, xOffset = -9, zOffset = 42, direction = 3 }, }, } end @@ -206,34 +205,34 @@ end local function tacnukes6() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 104, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = 96, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = -96, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = 48, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = -48, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = -96, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 96, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = 0, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 48, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 56, zOffset = 88, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 8, zOffset = 88, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -56, zOffset = -88, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -88, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 88, zOffset = -56, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 88, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -88, zOffset = 56, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -8, zOffset = -88, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 40, zOffset = 8, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -40, zOffset = -8, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 8, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -8, zOffset = 40, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -40, zOffset = 104, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 40, zOffset = -104, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -104, zOffset = -40, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 104, zOffset = 40, direction = 3}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = 96, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = -96, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 48, zOffset = 48, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = -48, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 96, zOffset = -96, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -96, zOffset = 96, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 0, zOffset = 0, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -48, zOffset = 48, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 56, zOffset = 88, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 8, zOffset = 88, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -56, zOffset = -88, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -88, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 88, zOffset = -56, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 88, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -88, zOffset = 56, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -8, zOffset = -88, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 40, zOffset = 8, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -40, zOffset = -8, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 8, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -8, zOffset = 40, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -40, zOffset = 104, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 40, zOffset = -104, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -104, zOffset = -40, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 104, zOffset = 40, direction = 3 }, }, } end @@ -241,27 +240,27 @@ end local function tacnukes7() return { type = types.Land, - tiers = {tiers.T3, tiers.T4 }, + tiers = { tiers.T3, tiers.T4 }, radius = 116, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = 68, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 60, zOffset = 20, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -36, zOffset = -76, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 12, zOffset = -28, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = -124, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -36, zOffset = 20, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 108, zOffset = 68, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 68, zOffset = 60, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 20, zOffset = 60, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -76, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -76, zOffset = 28, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 100, zOffset = -36, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -28, zOffset = -36, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 52, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 4, zOffset = 12, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -92, zOffset = -68, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -28, zOffset = 76, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 116, zOffset = 12, direction = 3}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = 68, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 60, zOffset = 20, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -36, zOffset = -76, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 12, zOffset = -28, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -84, zOffset = -124, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -36, zOffset = 20, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 108, zOffset = 68, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 68, zOffset = 60, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 20, zOffset = 60, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -76, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -76, zOffset = 28, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 100, zOffset = -36, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -28, zOffset = -36, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 52, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 4, zOffset = 12, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -92, zOffset = -68, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -28, zOffset = 76, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 116, zOffset = 12, direction = 3 }, }, } end @@ -269,21 +268,21 @@ end local function tacnukes8() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 84, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 28, zOffset = -6, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 76, zOffset = 42, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -20, zOffset = -54, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -116, zOffset = 42, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -68, zOffset = -6, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 68, zOffset = -62, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -12, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 36, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 20, zOffset = -46, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -28, zOffset = -14, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 84, zOffset = -14, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -60, zOffset = 50, direction = 3}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 28, zOffset = -6, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 76, zOffset = 42, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -20, zOffset = -54, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -116, zOffset = 42, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -68, zOffset = -6, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 68, zOffset = -62, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = -12, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 36, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 20, zOffset = -46, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -28, zOffset = -14, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = 84, zOffset = -14, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -60, zOffset = 50, direction = 3 }, }, } end @@ -291,28 +290,28 @@ end local function tacnukes9() return { type = types.Land, - tiers = {tiers.T2, tiers.T3, tiers.T4 }, + tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 42, buildings = { - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 31, zOffset = -62, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -17, zOffset = -14, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -65, zOffset = 34, direction = 3}, - { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 39, zOffset = 26, direction = 3}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 23, zOffset = -22, direction = 3}, - { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -9, zOffset = 42, direction = 3}, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 31, zOffset = -62, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -17, zOffset = -14, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -65, zOffset = 34, direction = 3 }, + { unitDefID = UnitDefNames.corhllllt_scav.id, xOffset = 39, zOffset = 26, direction = 3 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 23, zOffset = -22, direction = 3 }, + { unitDefID = UnitDefNames.cortron_scav.id, xOffset = -9, zOffset = 42, direction = 3 }, }, } end return { - tacnukes0, - tacnukes1, - tacnukes2, - tacnukes3, - tacnukes4, - tacnukes5, - tacnukes6, - tacnukes7, - tacnukes8, - tacnukes9, + tacnukes0, + tacnukes1, + tacnukes2, + tacnukes3, + tacnukes4, + tacnukes5, + tacnukes6, + tacnukes7, + tacnukes8, + tacnukes9, } diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tiny_defences_T1.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tiny_defences_T1.lua index 6936428be0d..f61c87877b4 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tiny_defences_T1.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/damgam_tiny_defences_T1.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,17 +9,16 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function tinyDefences0() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 1}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 1}, - { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 1 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 1 }, + { unitDefID = UnitDefNames.armllt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -27,13 +26,13 @@ end local function tinyDefences1() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = UnitDefNames.corllt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -41,13 +40,13 @@ end local function tinyDefences2() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.armbeamer_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -55,13 +54,13 @@ end local function tinyDefences3() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.corhllt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -69,13 +68,13 @@ end local function tinyDefences4() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = UnitDefNames.armhlt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -83,13 +82,13 @@ end local function tinyDefences5() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.corhlt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -97,13 +96,13 @@ end local function tinyDefences6() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.armguard_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.armguard_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -111,13 +110,13 @@ end local function tinyDefences7() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.corpun_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -125,13 +124,13 @@ end local function tinyDefences8() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = UnitDefNames.armrl_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end @@ -139,13 +138,13 @@ end local function tinyDefences9() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = UnitDefNames.corrl_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end @@ -153,13 +152,13 @@ end local function tinyDefences10() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = UnitDefNames.armferret_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = UnitDefNames.armferret_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end @@ -167,13 +166,13 @@ end local function tinyDefences11() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = UnitDefNames.cormadsam_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end @@ -181,13 +180,13 @@ end local function tinyDefences12() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = UnitDefNames.armcir_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -195,13 +194,13 @@ end local function tinyDefences13() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = UnitDefNames.corerad_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -209,13 +208,13 @@ end local function tinyDefences14() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.legmg_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -223,13 +222,13 @@ end local function tinyDefences15() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.corrad_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -237,13 +236,13 @@ end local function tinyDefences16() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.armrad_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -251,13 +250,13 @@ end local function tinyDefences17() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.corjamt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -265,13 +264,13 @@ end local function tinyDefences18() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 16, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = 16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -16, zOffset = -16, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 16, zOffset = -16, direction = 3}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 16, zOffset = 16, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = 16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -16, zOffset = -16, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 16, zOffset = -16, direction = 3 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 16, zOffset = 16, direction = 3 }, }, } end @@ -279,13 +278,13 @@ end local function tinyDefences19() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = UnitDefNames.corjuno_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -293,13 +292,13 @@ end local function tinyDefences20() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 28, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = -20, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -20, zOffset = 12, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 12, zOffset = -20, direction = 3}, - { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = 28, zOffset = 28, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = -20, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -20, zOffset = 12, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 12, zOffset = -20, direction = 3 }, + { unitDefID = UnitDefNames.armjuno_scav.id, xOffset = 28, zOffset = 28, direction = 3 }, }, } end @@ -307,13 +306,13 @@ end local function tinyDefences21() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end @@ -321,39 +320,39 @@ end local function tinyDefences22() return { type = types.Land, - tiers = { tiers.T0}, + tiers = { tiers.T0 }, radius = 22, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 14, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = -18, direction = 3}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -18, zOffset = 14, direction = 3}, - { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 22, zOffset = 22, direction = 3}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 14, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = -18, direction = 3 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -18, zOffset = 14, direction = 3 }, + { unitDefID = UnitDefNames.armnanotc_scav.id, xOffset = 22, zOffset = 22, direction = 3 }, }, } end return { - tinyDefences0, + tinyDefences0, tinyDefences1, - tinyDefences2, - tinyDefences3, - tinyDefences4, - tinyDefences5, - tinyDefences6, - tinyDefences7, - tinyDefences8, - tinyDefences9, - tinyDefences10, - tinyDefences11, - tinyDefences12, - tinyDefences13, - tinyDefences14, - tinyDefences15, - tinyDefences16, - tinyDefences17, - tinyDefences18, - --tinyDefences19, - --tinyDefences20, - tinyDefences21, - tinyDefences22, -} \ No newline at end of file + tinyDefences2, + tinyDefences3, + tinyDefences4, + tinyDefences5, + tinyDefences6, + tinyDefences7, + tinyDefences8, + tinyDefences9, + tinyDefences10, + tinyDefences11, + tinyDefences12, + tinyDefences13, + tinyDefences14, + tinyDefences15, + tinyDefences16, + tinyDefences17, + tinyDefences18, + --tinyDefences19, + --tinyDefences20, + tinyDefences21, + tinyDefences22, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/hermano_T2_Eco.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/hermano_T2_Eco.lua index 9c7664b9040..c4be9eb61cc 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/hermano_T2_Eco.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/hermano_T2_Eco.lua @@ -1,4 +1,4 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames @@ -9,58 +9,57 @@ local UDN = UnitDefNames -- 2 - north -- 3 - west - local function HermanoT2Eco0() return { type = types.Land, tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 224, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 89, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -71, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -103, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -128, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -135, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 57, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -135, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = -167, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 128, zOffset = 153, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -167, direction = 2}, - { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = -23, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 201, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = -215, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 89, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 89, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = 89, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 25, direction = 2}, - { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = 89, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 224, zOffset = -151, direction = 2}, - { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -224, zOffset = 137, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 64, zOffset = -87, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -64, zOffset = -87, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 89, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -71, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -103, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -128, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -135, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 57, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -135, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = -167, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 128, zOffset = 153, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -167, direction = 2 }, + { unitDefID = UnitDefNames.armjamt_scav.id, xOffset = 0, zOffset = -23, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 201, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = -215, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 89, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 32, zOffset = 89, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -32, zOffset = 89, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = 96, zOffset = 25, direction = 2 }, + { unitDefID = UnitDefNames.cormmkr_scav.id, xOffset = -96, zOffset = 89, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = 224, zOffset = -151, direction = 2 }, + { unitDefID = UnitDefNames.cordoom_scav.id, xOffset = -224, zOffset = 137, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 64, zOffset = -87, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -64, zOffset = -87, direction = 2 }, }, } end @@ -71,79 +70,79 @@ local function HermanoT2Eco1() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 304, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -272, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 272, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -240, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 240, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 240, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 272, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -272, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 32, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 0, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -240, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -32, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 304, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -304, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 64, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 192, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 0, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -96, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = 32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -64, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = -32, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 224, zOffset = -64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -224, zOffset = 64, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -32, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 192, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 160, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -192, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -160, zOffset = 96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 96, zOffset = -96, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 32, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -264, zOffset = -136, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 264, zOffset = 136, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 264, zOffset = -136, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -264, zOffset = 136, direction = 2}, - { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 0, zOffset = -144, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 144, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 128, zOffset = 0, direction = 2}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -128, zOffset = 0, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -272, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 272, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -240, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 240, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 240, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 272, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -272, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 32, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 0, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -240, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -32, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 304, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -304, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 192, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 0, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -96, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = 32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -64, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = -32, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 224, zOffset = -64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -224, zOffset = 64, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -32, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 192, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 160, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -192, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -160, zOffset = 96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 96, zOffset = -96, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 32, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -264, zOffset = -136, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 264, zOffset = 136, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 264, zOffset = -136, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -264, zOffset = 136, direction = 2 }, + { unitDefID = UnitDefNames.armflak_scav.id, xOffset = 0, zOffset = -144, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 0, zOffset = 144, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 0, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = 128, zOffset = 0, direction = 2 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -128, zOffset = 0, direction = 2 }, }, } end @@ -154,28 +153,28 @@ local function HermanoT2Eco2() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 176, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 176, zOffset = -176, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -176, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 48, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -48, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 48, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -40, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 40, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -136, zOffset = 136, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 136, zOffset = -136, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 48, zOffset = -48, direction = 2}, - { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -48, zOffset = 48, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 176, zOffset = -176, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -176, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 48, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -48, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 48, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -40, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 40, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -136, zOffset = 136, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 136, zOffset = -136, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 48, zOffset = -48, direction = 2 }, + { unitDefID = UnitDefNames.corafus_scav.id, xOffset = -48, zOffset = 48, direction = 2 }, }, } end @@ -186,24 +185,24 @@ local function HermanoT2Eco3() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 152, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -40, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -72, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 104, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -104, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 152, zOffset = -112, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -152, zOffset = 112, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = -80, zOffset = -40, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 80, zOffset = 40, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 0, zOffset = 40, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 80, zOffset = -40, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = -80, zOffset = 40, direction = 2}, - { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 0, zOffset = -40, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -40, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -72, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 104, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -104, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 152, zOffset = -112, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -152, zOffset = 112, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = -80, zOffset = -40, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 80, zOffset = 40, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 0, zOffset = 40, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 80, zOffset = -40, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = -80, zOffset = 40, direction = 2 }, + { unitDefID = UnitDefNames.armuwadvms_scav.id, xOffset = 0, zOffset = -40, direction = 2 }, }, } end @@ -214,30 +213,30 @@ local function HermanoT2Eco4() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 239, buildings = { - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 71, zOffset = 119, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -169, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 231, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -137, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -73, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 167, zOffset = 119, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 135, zOffset = 119, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -105, zOffset = -121, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 103, zOffset = 119, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 231, zOffset = -9, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -217, zOffset = 23, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -217, zOffset = -9, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -241, zOffset = 79, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 239, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 239, zOffset = 79, direction = 2}, - { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -241, zOffset = -81, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 47, zOffset = 47, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 143, zOffset = 47, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 143, zOffset = -49, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -145, zOffset = 47, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -49, zOffset = -49, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -49, zOffset = 47, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -145, zOffset = -49, direction = 2}, - { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 47, zOffset = -49, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 71, zOffset = 119, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -169, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 231, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -137, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -73, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 167, zOffset = 119, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 135, zOffset = 119, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -105, zOffset = -121, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 103, zOffset = 119, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 231, zOffset = -9, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -217, zOffset = 23, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -217, zOffset = -9, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -241, zOffset = 79, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 239, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = 239, zOffset = 79, direction = 2 }, + { unitDefID = UnitDefNames.armpb_scav.id, xOffset = -241, zOffset = -81, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 47, zOffset = 47, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 143, zOffset = 47, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 143, zOffset = -49, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -145, zOffset = 47, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -49, zOffset = -49, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -49, zOffset = 47, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = -145, zOffset = -49, direction = 2 }, + { unitDefID = UnitDefNames.coruwadves_scav.id, xOffset = 47, zOffset = -49, direction = 2 }, }, } end @@ -248,40 +247,40 @@ local function HermanoT2Eco5() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 144, buildings = { - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 80, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 112, zOffset = 144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -80, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -144, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = -112, zOffset = -144, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 1, "land"), xOffset = 144, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 16, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 48, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -48, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 80, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -16, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 16, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -80, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -112, zOffset = 48, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = 112, zOffset = -112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -16, zOffset = 112, direction = 2}, - { unitDefID = BPWallOrPopup('scav', 2), xOffset = -80, zOffset = 112, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -88, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 40, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 88, direction = 2}, - { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -40, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = 32, direction = 2}, - { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -32, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -96, zOffset = -96, direction = 2}, - { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 96, zOffset = 96, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 48, zOffset = -48, direction = 2}, - { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -48, zOffset = 48, direction = 2}, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 80, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 112, zOffset = 144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -80, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -144, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = -112, zOffset = -144, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 1, "land"), xOffset = 144, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 16, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 48, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -48, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 80, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -16, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 16, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -80, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -112, zOffset = 48, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = 112, zOffset = -112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -16, zOffset = 112, direction = 2 }, + { unitDefID = BPWallOrPopup("scav", 2), xOffset = -80, zOffset = 112, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -40, zOffset = -88, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 88, zOffset = 40, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = 40, zOffset = 88, direction = 2 }, + { unitDefID = UnitDefNames.cornanotc_scav.id, xOffset = -88, zOffset = -40, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = 32, zOffset = 32, direction = 2 }, + { unitDefID = UnitDefNames.armgate_scav.id, xOffset = -32, zOffset = -32, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = -96, zOffset = -96, direction = 2 }, + { unitDefID = UnitDefNames.armanni_scav.id, xOffset = 96, zOffset = 96, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = 48, zOffset = -48, direction = 2 }, + { unitDefID = UnitDefNames.armafus_scav.id, xOffset = -48, zOffset = 48, direction = 2 }, }, } end @@ -292,34 +291,34 @@ local function HermanoT2Eco6() tiers = { tiers.T2, tiers.T3, tiers.T4 }, radius = 206, buildings = { - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 134, zOffset = -15, direction = 2}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -186, zOffset = 129, direction = 2}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -90, zOffset = -95, direction = 2}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 38, zOffset = 193, direction = 2}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 22, zOffset = -47, direction = 2}, - { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -74, zOffset = 161, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 166, zOffset = -127, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -26, zOffset = -191, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -26, zOffset = 49, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 70, zOffset = -159, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -122, zOffset = 17, direction = 2}, - { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 70, zOffset = 81, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -162, zOffset = -71, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 110, zOffset = 169, direction = 2}, - { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 206, zOffset = -39, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -90, zOffset = -159, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 150, zOffset = 49, direction = 2}, - { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -186, zOffset = 65, direction = 2}, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 134, zOffset = -15, direction = 2 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -186, zOffset = 129, direction = 2 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -90, zOffset = -95, direction = 2 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 38, zOffset = 193, direction = 2 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = 22, zOffset = -47, direction = 2 }, + { unitDefID = UnitDefNames.armwint2_scav.id, xOffset = -74, zOffset = 161, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 166, zOffset = -127, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -26, zOffset = -191, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -26, zOffset = 49, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 70, zOffset = -159, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = -122, zOffset = 17, direction = 2 }, + { unitDefID = UnitDefNames.corwint2_scav.id, xOffset = 70, zOffset = 81, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = -162, zOffset = -71, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 110, zOffset = 169, direction = 2 }, + { unitDefID = UnitDefNames.corvipe_scav.id, xOffset = 206, zOffset = -39, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -90, zOffset = -159, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = 150, zOffset = 49, direction = 2 }, + { unitDefID = UnitDefNames.corflak_scav.id, xOffset = -186, zOffset = 65, direction = 2 }, }, } end return { - HermanoT2Eco0, - HermanoT2Eco1, - HermanoT2Eco2, - HermanoT2Eco3, - HermanoT2Eco4, - HermanoT2Eco5, - HermanoT2Eco6, -} \ No newline at end of file + HermanoT2Eco0, + HermanoT2Eco1, + HermanoT2Eco2, + HermanoT2Eco3, + HermanoT2Eco4, + HermanoT2Eco5, + HermanoT2Eco6, +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/link_sea.lua b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/link_sea.lua index c17dedb8fe4..7101aea6dbe 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/link_sea.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/Blueprints/link_sea.lua @@ -1,37 +1,36 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local UDN = UnitDefNames - local function t1RadarOutpost() return { type = types.Sea, tiers = { tiers.T0, tiers.T1 }, radius = 166, buildings = { - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 54, zOffset = -74, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 118, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 102, zOffset = -74, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 54, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 150, direction = 0}, - { unitDefID = UnitDefNames.armfrt_scav.id, xOffset = 86, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -42, zOffset = -26, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 134, zOffset = -74, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 86, direction = 0}, - { unitDefID = UnitDefNames.armfrad_scav.id, xOffset = -34, zOffset = 78, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 166, zOffset = -74, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = -58, direction = 0}, - { unitDefID = UnitDefNames.armfrt_scav.id, xOffset = 54, zOffset = 70, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 22, zOffset = -74, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = -10, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 22, direction = 0}, - { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -26, zOffset = -58, direction = 0}, - { unitDefID = UnitDefNames.armfrad_scav.id, xOffset = 14, zOffset = -18, direction = 0}, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 54, zOffset = -74, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 118, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 102, zOffset = -74, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 54, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 150, direction = 0 }, + { unitDefID = UnitDefNames.armfrt_scav.id, xOffset = 86, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -42, zOffset = -26, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 134, zOffset = -74, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 86, direction = 0 }, + { unitDefID = UnitDefNames.armfrad_scav.id, xOffset = -34, zOffset = 78, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 166, zOffset = -74, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = -58, direction = 0 }, + { unitDefID = UnitDefNames.armfrt_scav.id, xOffset = 54, zOffset = 70, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = 22, zOffset = -74, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = -10, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -74, zOffset = 22, direction = 0 }, + { unitDefID = UnitDefNames.armfdrag_scav.id, xOffset = -26, zOffset = -58, direction = 0 }, + { unitDefID = UnitDefNames.armfrad_scav.id, xOffset = 14, zOffset = -18, direction = 0 }, }, } end return { t1RadarOutpost, -} \ No newline at end of file +} diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua index 8dd7e5850d7..2572e6a8678 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_controller.lua @@ -1,43 +1,42 @@ -local blueprintConfig = VFS.Include('luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/blueprint_tiers.lua') +local blueprintConfig = VFS.Include("luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/blueprint_tiers.lua") local tiers = blueprintConfig.Tiers local types = blueprintConfig.BlueprintTypes local blueprintTypes = { Constructor = 1, - Spawner = 2, - Ruin = 3, + Spawner = 2, + Ruin = 3, } local dummyBlueprint = function() return { type = types.Land, - tiers = { }, + tiers = {}, radius = 0, - buildings = { } + buildings = {}, } end local constructorBlueprints = { [types.Land] = { - [tiers.T0] = { }, - [tiers.T1] = { }, - [tiers.T2] = { }, - [tiers.T3] = { }, - [tiers.T4] = { }, + [tiers.T0] = {}, + [tiers.T1] = {}, + [tiers.T2] = {}, + [tiers.T3] = {}, + [tiers.T4] = {}, }, [types.Sea] = { - [tiers.T0] = { }, - [tiers.T1] = { }, - [tiers.T2] = { }, - [tiers.T3] = { }, - [tiers.T4] = { }, + [tiers.T0] = {}, + [tiers.T1] = {}, + [tiers.T2] = {}, + [tiers.T3] = {}, + [tiers.T4] = {}, }, } - local blueprintsConfig = { - [1] = { table = constructorBlueprints, tiered = true, directory = 'luarules/gadgets/ruins/Blueprints/' .. Game.gameShortName .. '/Blueprints/', }, + [1] = { table = constructorBlueprints, tiered = true, directory = "luarules/gadgets/ruins/Blueprints/" .. Game.gameShortName .. "/Blueprints/" }, } local function insertDummyBlueprints(blueprintType) @@ -59,7 +58,7 @@ local function insertDummyBlueprints(blueprintType) end local function populateBlueprints(blueprintType) - local blueprintsDirectory = VFS.DirList(blueprintsConfig[1].directory, '*.lua') + local blueprintsDirectory = VFS.DirList(blueprintsConfig[1].directory, "*.lua") local blueprintTable = blueprintsConfig[1].table for _, blueprintFile in ipairs(blueprintsDirectory) do @@ -83,7 +82,6 @@ local function populateBlueprints(blueprintType) end end end - end end diff --git a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua index 70561fd5c16..2e7c4f2ae08 100644 --- a/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua +++ b/luarules/gadgets/ruins/Blueprints/BYAR/blueprint_tiers.lua @@ -5,100 +5,104 @@ local wallUnitDefs = { ["arm"] = { [1] = { ["land"] = { - unarmed = {"armdrag"}, - armed = {"armclaw"}, + unarmed = { "armdrag" }, + armed = { "armclaw" }, }, ["sea"] = { - unarmed = {"armfdrag"}, - armed = {"armfdrag"}, -- placeholder, + unarmed = { "armfdrag" }, + armed = { "armfdrag" }, -- placeholder, }, }, [2] = { ["land"] = { - unarmed = {"armfort"}, - armed = {"armlwall"}, + unarmed = { "armfort" }, + armed = { "armlwall" }, }, ["sea"] = { - unarmed = {"armfdrag"}, -- placeholder, - armed = {"armfdrag"}, -- placeholder, + unarmed = { "armfdrag" }, -- placeholder, + armed = { "armfdrag" }, -- placeholder, }, }, }, ["cor"] = { [1] = { ["land"] = { - unarmed = {"cordrag"}, - armed = {"cormaw"}, + unarmed = { "cordrag" }, + armed = { "cormaw" }, }, ["sea"] = { - unarmed = {"corfdrag"}, - armed = {"corfdrag"}, -- placeholder, + unarmed = { "corfdrag" }, + armed = { "corfdrag" }, -- placeholder, }, }, [2] = { ["land"] = { - unarmed = {"corfort"}, - armed = {"cormwall"}, + unarmed = { "corfort" }, + armed = { "cormwall" }, }, ["sea"] = { - unarmed = {"corfdrag"}, -- placeholder, - armed = {"corfdrag"}, -- placeholder, + unarmed = { "corfdrag" }, -- placeholder, + armed = { "corfdrag" }, -- placeholder, }, }, }, ["leg"] = { [1] = { ["land"] = { - unarmed = {"legdrag"}, - armed = {"legdtr"}, + unarmed = { "legdrag" }, + armed = { "legdtr" }, }, ["sea"] = { - unarmed = {"legfdrag"}, - armed = {"legfdrag"}, -- placeholder, + unarmed = { "legfdrag" }, + armed = { "legfdrag" }, -- placeholder, }, }, [2] = { ["land"] = { - unarmed = {"legforti"}, - armed = {"legrwall"}, + unarmed = { "legforti" }, + armed = { "legrwall" }, }, ["sea"] = { - unarmed = {"legfdrag"}, -- placeholder, - armed = {"legfdrag"}, -- placeholder, + unarmed = { "legfdrag" }, -- placeholder, + armed = { "legfdrag" }, -- placeholder, }, }, }, ["scav"] = { [1] = { ["land"] = { - unarmed = {"corscavdrag"}, - armed = {"corscavdtf", "corscavdtl", "corscavdtm"}, + unarmed = { "corscavdrag" }, + armed = { "corscavdtf", "corscavdtl", "corscavdtm" }, }, ["sea"] = { - unarmed = {"corfdrag"}, -- placeholder, - armed = {"corfdrag"}, -- placeholder, + unarmed = { "corfdrag" }, -- placeholder, + armed = { "corfdrag" }, -- placeholder, }, }, [2] = { ["land"] = { - unarmed = {"corscavfort"}, - armed = {"corscavfort"}, -- placeholder, + unarmed = { "corscavfort" }, + armed = { "corscavfort" }, -- placeholder, }, ["sea"] = { - unarmed = {"corfdrag"}, -- placeholder, - armed = {"corfdrag"}, -- placeholder, + unarmed = { "corfdrag" }, -- placeholder, + armed = { "corfdrag" }, -- placeholder, }, }, }, } - function BPWallOrPopup(faction, tier, surface) local wallRandom = math.random() - if not faction then faction = "scav" end - if not tier then tier = 1 end - if not surface then surface = "land" end - + if not faction then + faction = "scav" + end + if not tier then + tier = 1 + end + if not surface then + surface = "land" + end if wallRandom <= 0.1 and wallUnitDefs[faction][tier][surface].armed[1] then -- armed return UDN[wallUnitDefs[faction][tier][surface].armed[math.random(1, #wallUnitDefs[faction][tier][surface].armed)]].id diff --git a/luarules/gadgets/scav_cloud_spawner.lua b/luarules/gadgets/scav_cloud_spawner.lua index e92f923596e..12b0e78c3b0 100644 --- a/luarules/gadgets/scav_cloud_spawner.lua +++ b/luarules/gadgets/scav_cloud_spawner.lua @@ -1,213 +1,212 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Scav Cloud Spawner", - desc = "Spawns Cloud that represents Scav spawning area", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Scav Cloud Spawner", + desc = "Spawns Cloud that represents Scav spawning area", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not Spring.Utilities.Gametype.IsScavengers() then - return + return end if gadgetHandler:IsSyncedCode() then -- Synced - local teams = Spring.GetTeamList() - local scavTeamID = Spring.Utilities.GetScavTeamID() - local mapx = Game.mapSizeX - local mapz = Game.mapSizeZ - local cloudMult = math.ceil((math.ceil(((mapx+mapz)*0.5)/512)^2)/18) - local maxMists = (#teams-2)*(cloudMult*0.25) - local aliveMists = {} - local aliveWrecks = {} - local mistDefIDs = { - [UnitDefNames["scavmist_scav"].id] = true, - [UnitDefNames["scavmistxl_scav"].id] = true, - [UnitDefNames["scavmistxxl_scav"].id] = true, - } - - VFS.Include('common/wav.lua') - local cooldown = 0 -- 1 minute cooldown at the start - - local mRandom = math.random - local spGetGroundHeight = Spring.GetGroundHeight - local spSpawnCEG = Spring.SpawnCEG - local spPlaySoundFile = Spring.PlaySoundFile - local spGetUnitPosition = Spring.GetUnitPosition - local spDestroyUnit = Spring.DestroyUnit - local spGetTeamUnitDefCount = Spring.GetTeamUnitDefCount - local spGetFeaturePosition = Spring.GetFeaturePosition - local spGetFeatureResurrect = Spring.GetFeatureResurrect - local spGetFeatureHealth = Spring.GetFeatureHealth - local spSetFeatureResurrect = Spring.SetFeatureResurrect - local spSetFeatureHealth = Spring.SetFeatureHealth - local spDestroyFeature = Spring.DestroyFeature - local spCreateUnit = Spring.CreateUnit - local SendToUnsynced = SendToUnsynced - - function gadget:GameFrame(frame) - for _ = 1, cloudMult do - if mRandom(0,10) == 0 then - local randomx = mRandom(0, mapx) - local randomz = mRandom(0, mapz) - local randomy = spGetGroundHeight(randomx, randomz) - if GG.IsPosInRaptorScum(randomx, randomy, randomz) then - spSpawnCEG("scavradiation",randomx,randomy+100,randomz,0,0,0) - end - - randomx = mRandom(0, mapx) - randomz = mRandom(0, mapz) - randomy = spGetGroundHeight(randomx, randomz) - - if GG.IsPosInRaptorScum(randomx, randomy, randomz) then - if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", randomx, randomy+100, randomz) - else - spSpawnCEG("scavradiation-lightning",randomx,randomy+100,randomz,0,0,0) - end - spPlaySoundFile("thunder" .. mRandom(1,5), 1.5, randomx, randomy+100, randomz) - - --if math.random(0, 10) == 0 then - -- if Spring.GetGameRulesParam("scavTechAnger") > 10 and Spring.GetGameRulesParam("scavTechAnger") < 50 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmist_scav"].id) < maxMists then - -- local mist = Spring.CreateUnit("scavmist_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) - -- if mist then - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- end - -- end - --elseif math.random(0, 10) == 0 then - -- if Spring.GetGameRulesParam("scavTechAnger") > 40 and Spring.GetGameRulesParam("scavTechAnger") < 90 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmistxl_scav"].id) < maxMists then - -- local mist = Spring.CreateUnit("scavmistxl_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) - -- if mist then - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- end - -- end - --elseif math.random(0, 10) == 0 then - -- if Spring.GetGameRulesParam("scavTechAnger") > 80 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmistxxl_scav"].id) < maxMists then - -- local mist = Spring.CreateUnit("scavmistxxl_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) - -- if mist then - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) - -- end - -- end - --end - end - - for i = 1,5 do - randomx = mRandom(0, mapx) - randomz = mRandom(0, mapz) - randomy = spGetGroundHeight(randomx, randomz) - - if GG.IsPosInRaptorScum(randomx, randomy, randomz) then - spSpawnCEG("scavmistxl",randomx,randomy+100,randomz,0,0,0) - end - end - end - end - - if frame%30 == 21 then - for unitID, unitDefID in pairs(aliveMists) do - local posx, posy, posz = spGetUnitPosition(unitID) - if not GG.IsPosInRaptorScum(posx, posy, posz) then - spDestroyUnit(unitID, true, true) - elseif mRandom(0,360) == 0 and spGetTeamUnitDefCount(scavTeamID, unitDefID) > maxMists - math.ceil(maxMists*0.05) then - spDestroyUnit(unitID, true, true) - end - end - end - - for featureID, data in pairs(aliveWrecks) do - if featureID%30 == frame%30 then - --Spring.Echo("featureID", featureID, frame) - local posx, posy, posz = spGetFeaturePosition(featureID) - if GG.IsPosInRaptorScum(posx, posy, posz) then - --Spring.Echo("isInScum", GG.IsPosInRaptorScum(posx, posy, posz)) - aliveWrecks[featureID].resurrectable = spGetFeatureResurrect(featureID) - if data.resurrectable and data.resurrectable ~= "" then - --Spring.Echo("resurrectable", data.resurrectable) - if data.lastResurrectionCheck == select(3, spGetFeatureHealth(featureID)) then - local random = mRandom() - spSetFeatureResurrect(featureID, data.ressurectable, data.facing, data.lastResurrectionCheck+(0.05*random*data.age)) - GG.ScavengersSpawnEffectFeatureID(featureID) - --Spring.Echo("resurrecting", data.lastResurrectionCheck) - SendToUnsynced("featureReclaimFrame", featureID, data.lastResurrectionCheck+(0.05*random*data.age)) - end - if aliveWrecks[featureID].lastResurrectionCheck >= 1 then - spCreateUnit(data.resurrectable, posx, posy, posz, data.facing, scavTeamID) - spDestroyFeature(featureID) - end - aliveWrecks[featureID].lastResurrectionCheck = select(3, spGetFeatureHealth(featureID)) - aliveWrecks[featureID].age = aliveWrecks[featureID].age+0.0083 - else - local featureHealth, featureMaxHealth = spGetFeatureHealth(featureID) - spSpawnCEG("scaspawn-trail", posx, posy, posz, 0,0,0) - local random = mRandom() - spSetFeatureHealth(featureID, featureHealth-(featureMaxHealth*0.05*random)) - SendToUnsynced("featureReclaimFrame", featureID, featureHealth-(featureMaxHealth*0.05*random)) - --Spring.Echo("killing", featureHealth) - if featureHealth <= 0 then - spDestroyFeature(featureID) - end - end - end - end - end - - cooldown = cooldown - 1 - --Spring.Echo("SoundStreamTime", Spring.GetSoundStreamTime()) - local randomx = mRandom(0, mapx) - local randomz = mRandom(0, mapz) - local randomy = spGetGroundHeight(randomx, randomz) - if GG.IsPosInRaptorScum(randomx, randomy, randomz) then - if cooldown < 0 then - local synth = "scavsynth" .. mRandom(1,12) - spPlaySoundFile(synth, 4, randomx, randomy, randomz) - cooldown = mRandom(20,40)*30 - --cooldown = ReadWAV("sounds/atmos/scavsynth1").Length*30 - else - cooldown = cooldown - 2 - end - end - end - - function gadget:UnitCreated(unitID, unitDefID) - if mistDefIDs[unitDefID] then - aliveMists[unitID] = unitDefID - end - end - - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if mistDefIDs[unitDefID] then - aliveMists[unitID] = nil - end - end - - function gadget:FeatureCreated(featureID, featureAllyTeamID) - local resurrectable, facing = spGetFeatureResurrect(featureID) - aliveWrecks[featureID] = {age = 0, resurrectable = resurrectable, facing = facing, lastResurrectionCheck = 0} - end - - function gadget:FeatureDestroyed(featureID, featureAllyTeamID) - aliveWrecks[featureID] = nil - end + local teams = Spring.GetTeamList() + local scavTeamID = Spring.Utilities.GetScavTeamID() + local mapx = Game.mapSizeX + local mapz = Game.mapSizeZ + local cloudMult = math.ceil((math.ceil(((mapx + mapz) * 0.5) / 512) ^ 2) / 18) + local maxMists = (#teams - 2) * (cloudMult * 0.25) + local aliveMists = {} + local aliveWrecks = {} + local mistDefIDs = { + [UnitDefNames["scavmist_scav"].id] = true, + [UnitDefNames["scavmistxl_scav"].id] = true, + [UnitDefNames["scavmistxxl_scav"].id] = true, + } + + VFS.Include("common/wav.lua") + local cooldown = 0 -- 1 minute cooldown at the start + + local mRandom = math.random + local spGetGroundHeight = Spring.GetGroundHeight + local spSpawnCEG = Spring.SpawnCEG + local spPlaySoundFile = Spring.PlaySoundFile + local spGetUnitPosition = Spring.GetUnitPosition + local spDestroyUnit = Spring.DestroyUnit + local spGetTeamUnitDefCount = Spring.GetTeamUnitDefCount + local spGetFeaturePosition = Spring.GetFeaturePosition + local spGetFeatureResurrect = Spring.GetFeatureResurrect + local spGetFeatureHealth = Spring.GetFeatureHealth + local spSetFeatureResurrect = Spring.SetFeatureResurrect + local spSetFeatureHealth = Spring.SetFeatureHealth + local spDestroyFeature = Spring.DestroyFeature + local spCreateUnit = Spring.CreateUnit + local SendToUnsynced = SendToUnsynced + + function gadget:GameFrame(frame) + for _ = 1, cloudMult do + if mRandom(0, 10) == 0 then + local randomx = mRandom(0, mapx) + local randomz = mRandom(0, mapz) + local randomy = spGetGroundHeight(randomx, randomz) + if GG.IsPosInRaptorScum(randomx, randomy, randomz) then + spSpawnCEG("scavradiation", randomx, randomy + 100, randomz, 0, 0, 0) + end + + randomx = mRandom(0, mapx) + randomz = mRandom(0, mapz) + randomy = spGetGroundHeight(randomx, randomz) + + if GG.IsPosInRaptorScum(randomx, randomy, randomz) then + if GG.SpawnEnvironmentalLightning then + GG.SpawnEnvironmentalLightning("scavradiation", randomx, randomy + 100, randomz) + else + spSpawnCEG("scavradiation-lightning", randomx, randomy + 100, randomz, 0, 0, 0) + end + spPlaySoundFile("thunder" .. mRandom(1, 5), 1.5, randomx, randomy + 100, randomz) + + --if math.random(0, 10) == 0 then + -- if Spring.GetGameRulesParam("scavTechAnger") > 10 and Spring.GetGameRulesParam("scavTechAnger") < 50 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmist_scav"].id) < maxMists then + -- local mist = Spring.CreateUnit("scavmist_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) + -- if mist then + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- end + -- end + --elseif math.random(0, 10) == 0 then + -- if Spring.GetGameRulesParam("scavTechAnger") > 40 and Spring.GetGameRulesParam("scavTechAnger") < 90 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmistxl_scav"].id) < maxMists then + -- local mist = Spring.CreateUnit("scavmistxl_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) + -- if mist then + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- end + -- end + --elseif math.random(0, 10) == 0 then + -- if Spring.GetGameRulesParam("scavTechAnger") > 80 and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames["scavmistxxl_scav"].id) < maxMists then + -- local mist = Spring.CreateUnit("scavmistxxl_scav", randomx, randomy, randomz, math.random(0,3), scavTeamID) + -- if mist then + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- Spring.GiveOrderToUnit(mist, CMD.PATROL, {randomx+math.random(-256,256), randomy, randomz+math.random(-256,256)}, {"shift"}) + -- end + -- end + --end + end + + for i = 1, 5 do + randomx = mRandom(0, mapx) + randomz = mRandom(0, mapz) + randomy = spGetGroundHeight(randomx, randomz) + + if GG.IsPosInRaptorScum(randomx, randomy, randomz) then + spSpawnCEG("scavmistxl", randomx, randomy + 100, randomz, 0, 0, 0) + end + end + end + end + + if frame % 30 == 21 then + for unitID, unitDefID in pairs(aliveMists) do + local posx, posy, posz = spGetUnitPosition(unitID) + if not GG.IsPosInRaptorScum(posx, posy, posz) then + spDestroyUnit(unitID, true, true) + elseif mRandom(0, 360) == 0 and spGetTeamUnitDefCount(scavTeamID, unitDefID) > maxMists - math.ceil(maxMists * 0.05) then + spDestroyUnit(unitID, true, true) + end + end + end + + for featureID, data in pairs(aliveWrecks) do + if featureID % 30 == frame % 30 then + --Spring.Echo("featureID", featureID, frame) + local posx, posy, posz = spGetFeaturePosition(featureID) + if GG.IsPosInRaptorScum(posx, posy, posz) then + --Spring.Echo("isInScum", GG.IsPosInRaptorScum(posx, posy, posz)) + aliveWrecks[featureID].resurrectable = spGetFeatureResurrect(featureID) + if data.resurrectable and data.resurrectable ~= "" then + --Spring.Echo("resurrectable", data.resurrectable) + if data.lastResurrectionCheck == select(3, spGetFeatureHealth(featureID)) then + local random = mRandom() + spSetFeatureResurrect(featureID, data.ressurectable, data.facing, data.lastResurrectionCheck + (0.05 * random * data.age)) + GG.ScavengersSpawnEffectFeatureID(featureID) + --Spring.Echo("resurrecting", data.lastResurrectionCheck) + SendToUnsynced("featureReclaimFrame", featureID, data.lastResurrectionCheck + (0.05 * random * data.age)) + end + if aliveWrecks[featureID].lastResurrectionCheck >= 1 then + spCreateUnit(data.resurrectable, posx, posy, posz, data.facing, scavTeamID) + spDestroyFeature(featureID) + end + aliveWrecks[featureID].lastResurrectionCheck = select(3, spGetFeatureHealth(featureID)) + aliveWrecks[featureID].age = aliveWrecks[featureID].age + 0.0083 + else + local featureHealth, featureMaxHealth = spGetFeatureHealth(featureID) + spSpawnCEG("scaspawn-trail", posx, posy, posz, 0, 0, 0) + local random = mRandom() + spSetFeatureHealth(featureID, featureHealth - (featureMaxHealth * 0.05 * random)) + SendToUnsynced("featureReclaimFrame", featureID, featureHealth - (featureMaxHealth * 0.05 * random)) + --Spring.Echo("killing", featureHealth) + if featureHealth <= 0 then + spDestroyFeature(featureID) + end + end + end + end + end + + cooldown = cooldown - 1 + --Spring.Echo("SoundStreamTime", Spring.GetSoundStreamTime()) + local randomx = mRandom(0, mapx) + local randomz = mRandom(0, mapz) + local randomy = spGetGroundHeight(randomx, randomz) + if GG.IsPosInRaptorScum(randomx, randomy, randomz) then + if cooldown < 0 then + local synth = "scavsynth" .. mRandom(1, 12) + spPlaySoundFile(synth, 4, randomx, randomy, randomz) + cooldown = mRandom(20, 40) * 30 + --cooldown = ReadWAV("sounds/atmos/scavsynth1").Length*30 + else + cooldown = cooldown - 2 + end + end + end + + function gadget:UnitCreated(unitID, unitDefID) + if mistDefIDs[unitDefID] then + aliveMists[unitID] = unitDefID + end + end + + function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) + if mistDefIDs[unitDefID] then + aliveMists[unitID] = nil + end + end + + function gadget:FeatureCreated(featureID, featureAllyTeamID) + local resurrectable, facing = spGetFeatureResurrect(featureID) + aliveWrecks[featureID] = { age = 0, resurrectable = resurrectable, facing = facing, lastResurrectionCheck = 0 } + end + + function gadget:FeatureDestroyed(featureID, featureAllyTeamID) + aliveWrecks[featureID] = nil + end else -- Unsynced - end diff --git a/luarules/gadgets/scav_lootbox_collector.lua b/luarules/gadgets/scav_lootbox_collector.lua index 7bd09d47c12..9ec7ebfb298 100644 --- a/luarules/gadgets/scav_lootbox_collector.lua +++ b/luarules/gadgets/scav_lootbox_collector.lua @@ -8,48 +8,47 @@ function gadget:GetInfo() date = "2023", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end if (not gadgetHandler:IsSyncedCode()) or (not Spring.Utilities.Gametype.IsScavengers()) or Spring.GetModOptions().unit_restrictions_noair then return false elseif Spring.Utilities.Gametype.IsRaptors() then - return false + return false end function SetCount(set) - local count = 0 - for k in pairs(set) do - count = count + 1 - end - return count + local count = 0 + for k in pairs(set) do + count = count + 1 + end + return count end -- number represents maximum tier of lootbox that can be picked up local transportsList = {} -for unitDefName, tier in pairs({armatlas_scav = 1, corvalk_scav = 1, legatrans_scav = 1, armdfly_scav = 2, corseah_scav = 2, legstronghold_scav = 2}) do - if UnitDefNames[unitDefName] then +for unitDefName, tier in pairs({ armatlas_scav = 1, corvalk_scav = 1, legatrans_scav = 1, armdfly_scav = 2, corseah_scav = 2, legstronghold_scav = 2 }) do + if UnitDefNames[unitDefName] then transportsList[UnitDefNames[unitDefName].id] = tier end end - local lootboxList = {} -for unitDefName, tier in pairs({lootboxbronze_scav = 1, lootboxsilver_scav = 1, lootboxgold_scav = 2, lootboxplatinum_scav = 2}) do - if UnitDefNames[unitDefName] then +for unitDefName, tier in pairs({ lootboxbronze_scav = 1, lootboxsilver_scav = 1, lootboxgold_scav = 2, lootboxplatinum_scav = 2 }) do + if UnitDefNames[unitDefName] then lootboxList[UnitDefNames[unitDefName].id] = tier end end local spawnerList = {} -if UnitDefNames["scavbeacon_t1_scav"] then +if UnitDefNames["scavbeacon_t1_scav"] then spawnerList[UnitDefNames["scavbeacon_t1_scav"].id] = true - spawnerList[UnitDefNames["scavbeacon_t2_scav"].id] = true - spawnerList[UnitDefNames["scavbeacon_t3_scav"].id] = true - spawnerList[UnitDefNames["scavbeacon_t4_scav"].id] = true + spawnerList[UnitDefNames["scavbeacon_t2_scav"].id] = true + spawnerList[UnitDefNames["scavbeacon_t3_scav"].id] = true + spawnerList[UnitDefNames["scavbeacon_t4_scav"].id] = true end local scavTeamID = Spring.Utilities.GetScavTeamID() @@ -62,88 +61,88 @@ local lastTransportSentFrame = 0 local handledLootboxesList = {} local RaptorStartboxXMin, RaptorStartboxZMin, RaptorStartboxXMax, RaptorStartboxZMax = Spring.GetAllyTeamStartBox(scavAllyTeamID) -local config = VFS.Include('LuaRules/Configs/scav_spawn_defs.lua') +local config = VFS.Include("LuaRules/Configs/scav_spawn_defs.lua") function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if lootboxList[unitDefID] then - aliveLootboxes[unitID] = lootboxList[unitDefID] - aliveLootboxesCount = aliveLootboxesCount + 1 - end + if lootboxList[unitDefID] then + aliveLootboxes[unitID] = lootboxList[unitDefID] + aliveLootboxesCount = aliveLootboxesCount + 1 + end - if spawnerList[unitDefID] then - aliveSpawners[unitID] = true - aliveSpawnersCount = aliveSpawnersCount + 1 - end + if spawnerList[unitDefID] then + aliveSpawners[unitID] = true + aliveSpawnersCount = aliveSpawnersCount + 1 + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if aliveLootboxes[unitID] then - aliveLootboxes[unitID] = nil - aliveLootboxesCount = aliveLootboxesCount - 1 - end + if aliveLootboxes[unitID] then + aliveLootboxes[unitID] = nil + aliveLootboxesCount = aliveLootboxesCount - 1 + end - if aliveSpawners[unitID] then - aliveSpawners[unitID] = nil - aliveSpawnersCount = aliveSpawnersCount - 1 - end + if aliveSpawners[unitID] then + aliveSpawners[unitID] = nil + aliveSpawnersCount = aliveSpawnersCount - 1 + end end function gadget:GameFrame(frame) - if frame%30 == 12 and Spring.GetGameRulesParam("scavBossAnger") >= 1 and Spring.GetGameRulesParam("scavTechAnger") >= config.airStartAnger then - if aliveLootboxesCount > 0 and aliveSpawnersCount > 0 then - if SetCount(handledLootboxesList) > 0 then - handledLootboxesList = {} - end - if frame-math.ceil(18000/aliveLootboxesCount) > lastTransportSentFrame then -- 10 minutes for 1 lootbox alive - local targetLootboxID = -1 - local loopCount = 0 - local success = false - for lootboxID, lootboxTier in pairs(aliveLootboxes) do - local lootboxPosX, lootboxPosY, lootboxPosZ = Spring.GetUnitPosition(lootboxID) - if (lootboxPosX) and not GG.IsPosInRaptorScum(lootboxPosX, lootboxPosY, lootboxPosZ) then - if math.random(0,aliveLootboxesCount) == 0 and not handledLootboxesList[lootboxID] then - for transportDefID, transportTier in pairs(transportsList) do - if math.random(0,SetCount(transportsList)) == 0 and transportTier == lootboxTier and not handledLootboxesList[lootboxID] then - for spawnerID, _ in pairs(aliveSpawners) do - if math.random(0,SetCount(aliveSpawners)) == 0 and not handledLootboxesList[lootboxID] then - targetLootboxID = lootboxID - local spawnerPosX, spawnerPosY, spawnerPosZ = Spring.GetUnitPosition(spawnerID) - for j = 1,5 do - if math.random() <= config.spawnChance then - local transportID = Spring.CreateUnit(transportDefID, spawnerPosX+math.random(-1024, 1024), spawnerPosY+100, spawnerPosZ+math.random(-1024, 1024), math.random(0,3), scavTeamID) - if transportID then - handledLootboxesList[targetLootboxID] = true - success = true - lastTransportSentFrame = frame - Spring.GiveOrderToUnit(transportID, CMD.LOAD_UNITS, {targetLootboxID}, {"shift"}) - for i = 1,100 do - local randomX = math.random(0, Game.mapSizeX) - local randomZ = math.random(0, Game.mapSizeZ) - local randomY = math.max(0, Spring.GetGroundHeight(randomX, randomZ)) - if GG.IsPosInRaptorScum(randomX, randomY, randomZ) then - Spring.GiveOrderToUnit(transportID, CMD.UNLOAD_UNITS, {randomX, randomY, randomZ, 1024}, {"shift"}) - end - if i == 100 then - Spring.GiveOrderToUnit(transportID, CMD.MOVE, {randomX+math.random(-256,256), randomY, randomZ+math.random(-256,256)}, {"shift"}) - end - end - end - end - end - end - if success == true then - break - end - end - end - if success == true then - break - end - end - end - end - end - end - end - end -end \ No newline at end of file + if frame % 30 == 12 and Spring.GetGameRulesParam("scavBossAnger") >= 1 and Spring.GetGameRulesParam("scavTechAnger") >= config.airStartAnger then + if aliveLootboxesCount > 0 and aliveSpawnersCount > 0 then + if SetCount(handledLootboxesList) > 0 then + handledLootboxesList = {} + end + if frame - math.ceil(18000 / aliveLootboxesCount) > lastTransportSentFrame then -- 10 minutes for 1 lootbox alive + local targetLootboxID = -1 + local loopCount = 0 + local success = false + for lootboxID, lootboxTier in pairs(aliveLootboxes) do + local lootboxPosX, lootboxPosY, lootboxPosZ = Spring.GetUnitPosition(lootboxID) + if lootboxPosX and not GG.IsPosInRaptorScum(lootboxPosX, lootboxPosY, lootboxPosZ) then + if math.random(0, aliveLootboxesCount) == 0 and not handledLootboxesList[lootboxID] then + for transportDefID, transportTier in pairs(transportsList) do + if math.random(0, SetCount(transportsList)) == 0 and transportTier == lootboxTier and not handledLootboxesList[lootboxID] then + for spawnerID, _ in pairs(aliveSpawners) do + if math.random(0, SetCount(aliveSpawners)) == 0 and not handledLootboxesList[lootboxID] then + targetLootboxID = lootboxID + local spawnerPosX, spawnerPosY, spawnerPosZ = Spring.GetUnitPosition(spawnerID) + for j = 1, 5 do + if math.random() <= config.spawnChance then + local transportID = Spring.CreateUnit(transportDefID, spawnerPosX + math.random(-1024, 1024), spawnerPosY + 100, spawnerPosZ + math.random(-1024, 1024), math.random(0, 3), scavTeamID) + if transportID then + handledLootboxesList[targetLootboxID] = true + success = true + lastTransportSentFrame = frame + Spring.GiveOrderToUnit(transportID, CMD.LOAD_UNITS, { targetLootboxID }, { "shift" }) + for i = 1, 100 do + local randomX = math.random(0, Game.mapSizeX) + local randomZ = math.random(0, Game.mapSizeZ) + local randomY = math.max(0, Spring.GetGroundHeight(randomX, randomZ)) + if GG.IsPosInRaptorScum(randomX, randomY, randomZ) then + Spring.GiveOrderToUnit(transportID, CMD.UNLOAD_UNITS, { randomX, randomY, randomZ, 1024 }, { "shift" }) + end + if i == 100 then + Spring.GiveOrderToUnit(transportID, CMD.MOVE, { randomX + math.random(-256, 256), randomY, randomZ + math.random(-256, 256) }, { "shift" }) + end + end + end + end + end + end + if success == true then + break + end + end + end + if success == true then + break + end + end + end + end + end + end + end + end +end diff --git a/luarules/gadgets/scav_spawn_effect.lua b/luarules/gadgets/scav_spawn_effect.lua index 5f699f8e694..19ba8a62c5e 100644 --- a/luarules/gadgets/scav_spawn_effect.lua +++ b/luarules/gadgets/scav_spawn_effect.lua @@ -1,83 +1,81 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Scav Spawn Effect", - desc = "Handles picking Scav spawn effects so we don't need to figure that out everywhere", - author = "Damgam", - date = "2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Scav Spawn Effect", + desc = "Handles picking Scav spawn effects so we don't need to figure that out everywhere", + author = "Damgam", + date = "2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -if gadgetHandler:IsSyncedCode() then -- Synced - local function getUnitSize(unitDefID) - if UnitDefs[unitDefID] then - local size = math.ceil((UnitDefs[unitDefID].xsize / 2 + UnitDefs[unitDefID].zsize / 2) / 2) - if size > 4.5 then - return "huge" - elseif size > 3.5 then - return "large" - elseif size > 2.5 then - return "medium" - elseif size > 1.5 then - return "small" - else - return "tiny" - end - else - return "small" - end - end +if gadgetHandler:IsSyncedCode() then -- Synced + local function getUnitSize(unitDefID) + if UnitDefs[unitDefID] then + local size = math.ceil((UnitDefs[unitDefID].xsize / 2 + UnitDefs[unitDefID].zsize / 2) / 2) + if size > 4.5 then + return "huge" + elseif size > 3.5 then + return "large" + elseif size > 2.5 then + return "medium" + elseif size > 1.5 then + return "small" + else + return "tiny" + end + else + return "small" + end + end - local function getFeatureSize(featureDefID) - if FeatureDefs[featureDefID] then - local size = math.ceil((FeatureDefs[featureDefID].xsize / 2 + FeatureDefs[featureDefID].zsize / 2) / 2) - if size > 4.5 then - return "huge" - elseif size > 3.5 then - return "large" - elseif size > 2.5 then - return "medium" - elseif size > 1.5 then - return "small" - else - return "tiny" - end - else - return "small" - end - end + local function getFeatureSize(featureDefID) + if FeatureDefs[featureDefID] then + local size = math.ceil((FeatureDefs[featureDefID].xsize / 2 + FeatureDefs[featureDefID].zsize / 2) / 2) + if size > 4.5 then + return "huge" + elseif size > 3.5 then + return "large" + elseif size > 2.5 then + return "medium" + elseif size > 1.5 then + return "small" + else + return "tiny" + end + else + return "small" + end + end + function ScavengersSpawnEffectUnitID(unitID) + local posx, posy, posz = Spring.GetUnitPosition(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + local size = getUnitSize(unitDefID) + Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0, 0, 0) + end + GG.ScavengersSpawnEffectUnitID = ScavengersSpawnEffectUnitID + function ScavengersSpawnEffectUnitDefID(unitDefID, posx, posy, posz) + local size = getUnitSize(unitDefID) + Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0, 0, 0) + end + GG.ScavengersSpawnEffectUnitDefID = ScavengersSpawnEffectUnitDefID - function ScavengersSpawnEffectUnitID(unitID) - local posx, posy, posz = Spring.GetUnitPosition(unitID) - local unitDefID = Spring.GetUnitDefID(unitID) - local size = getUnitSize(unitDefID) - Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0,0,0) - end - GG.ScavengersSpawnEffectUnitID = ScavengersSpawnEffectUnitID + function ScavengersSpawnEffectFeatureID(featureID) + local posx, posy, posz = Spring.GetFeaturePosition(featureID) + local featureDefID = Spring.GetFeatureDefID(featureID) + local size = getFeatureSize(featureDefID) + Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0, 0, 0) + end + GG.ScavengersSpawnEffectFeatureID = ScavengersSpawnEffectFeatureID - function ScavengersSpawnEffectUnitDefID(unitDefID, posx, posy, posz) - local size = getUnitSize(unitDefID) - Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0,0,0) - end - GG.ScavengersSpawnEffectUnitDefID = ScavengersSpawnEffectUnitDefID - - function ScavengersSpawnEffectFeatureID(featureID) - local posx, posy, posz = Spring.GetFeaturePosition(featureID) - local featureDefID = Spring.GetFeatureDefID(featureID) - local size = getFeatureSize(featureDefID) - Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0,0,0) - end - GG.ScavengersSpawnEffectFeatureID = ScavengersSpawnEffectFeatureID - - function ScavengersSpawnEffectFeatureDefID(featureDefID, posx, posy, posz) - local size = getFeatureSize(featureDefID) - Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0,0,0) - end - GG.ScavengersSpawnEffectFeatureDefID = ScavengersSpawnEffectFeatureDefID -end \ No newline at end of file + function ScavengersSpawnEffectFeatureDefID(featureDefID, posx, posy, posz) + local size = getFeatureSize(featureDefID) + Spring.SpawnCEG("scav-spawnexplo-" .. size, posx, posy, posz, 0, 0, 0) + end + GG.ScavengersSpawnEffectFeatureDefID = ScavengersSpawnEffectFeatureDefID +end diff --git a/luarules/gadgets/scav_spawner_defense.lua b/luarules/gadgets/scav_spawner_defense.lua index 90ed57db41f..a35072c9460 100644 --- a/luarules/gadgets/scav_spawner_defense.lua +++ b/luarules/gadgets/scav_spawner_defense.lua @@ -20,8 +20,8 @@ else end Spring.SetLogSectionFilterLevel("Dynamic Difficulty", LOG.INFO) -local config = VFS.Include('LuaRules/Configs/scav_spawn_defs.lua') -local EnemyLib = VFS.Include('LuaRules/Gadgets/Include/SpawnerEnemyLib.lua') +local config = VFS.Include("LuaRules/Configs/scav_spawn_defs.lua") +local EnemyLib = VFS.Include("LuaRules/Gadgets/Include/SpawnerEnemyLib.lua") -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -82,7 +82,7 @@ if gadgetHandler:IsSyncedCode() then local nSpawnedBosses = 0 local nTotalBosses = Spring.GetModOptions().scav_boss_count or 1 local maxTries = 30 - local scavUnitCap = math.floor(Game.maxUnits*0.80) + local scavUnitCap = math.floor(Game.maxUnits * 0.80) local minBurrows = 1 local timeOfLastSpawn = -999999 local timeOfLastWave = 0 @@ -103,25 +103,25 @@ if gadgetHandler:IsSyncedCode() then waveSpecialPercentage = 33, waveTechAnger = 0, airWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, specialWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, basicWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, smallWave = { - cooldown = mRandom(5,15), + cooldown = mRandom(5, 15), }, largerWave = { - cooldown = mRandom(10,30), + cooldown = mRandom(10, 30), }, hugeWave = { - cooldown = mRandom(15,50), + cooldown = mRandom(15, 50), }, epicWave = { - cooldown = mRandom(20,75), + cooldown = mRandom(20, 75), }, --frontbusters = { -- cooldown = mRandom(5,10), @@ -155,7 +155,7 @@ if gadgetHandler:IsSyncedCode() then currentlyStaggered = false, } local bossIDs = {} - local bosses = {resistances = bossResistance, statuses = {}, playerDamages = {}} + local bosses = { resistances = bossResistance, statuses = {}, playerDamages = {} } local scavTeamID = Spring.Utilities.GetScavTeamID() local scavAllyTeamID = Spring.Utilities.GetScavAllyTeamID() local lsx1, lsz1, lsx2, lsz2 @@ -171,7 +171,7 @@ if gadgetHandler:IsSyncedCode() then local squadCreationQueue = { units = {}, role = false, - life = math.ceil(10*Spring.GetModOptions().scav_spawntimemult), + life = math.ceil(10 * Spring.GetModOptions().scav_spawntimemult), regroupenabled = true, regrouping = false, needsregroup = false, @@ -180,7 +180,7 @@ if gadgetHandler:IsSyncedCode() then squadCreationQueueDefaults = { units = {}, role = false, - life = math.ceil(10*Spring.GetModOptions().scav_spawntimemult), + life = math.ceil(10 * Spring.GetModOptions().scav_spawntimemult), regroupenabled = true, regrouping = false, needsregroup = false, @@ -196,7 +196,6 @@ if gadgetHandler:IsSyncedCode() then end end - CommandersPopulation = 0 DecoyCommandersPopulation = 0 --FrontbusterPopulation = 0 @@ -209,8 +208,8 @@ if gadgetHandler:IsSyncedCode() then local totalPlayerTeamPower --config calculateDifficultyMultiplier - local lowerScavPowerRatio = 1/6 - local upperScavPowerRatio = 1/2 + local lowerScavPowerRatio = 1 / 6 + local upperScavPowerRatio = 1 / 2 local minDynamicDifficulty = 0.85 local maxDynamicDifficulty = 1.05 @@ -219,7 +218,7 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- local teams = GetTeamList() - for _,teamID in ipairs(teams) do + for _, teamID in ipairs(teams) do if teamID ~= scavTeamID then humanTeams[teamID] = true end @@ -235,14 +234,14 @@ if gadgetHandler:IsSyncedCode() then function PutScavAlliesInScavTeam(n) local players = Spring.GetPlayerList() - for i = 1,#players do + for i = 1, #players do local player = players[i] local name, active, spectator, teamID, allyTeamID = Spring.GetPlayerInfo(player, false) - if allyTeamID == scavAllyTeamID and (not spectator) then + if allyTeamID == scavAllyTeamID and not spectator then Spring.AssignPlayerToTeam(player, scavTeamID) local units = GetTeamUnits(teamID) scavteamhasplayers = true - for u = 1,#units do + for u = 1, #units do DestroyUnit(units[u], false, true) end Spring.KillTeam(teamID) @@ -250,12 +249,12 @@ if gadgetHandler:IsSyncedCode() then end local scavAllies = Spring.GetTeamList(scavAllyTeamID) - for i = 1,#scavAllies do - local _,_,_,AI = Spring.GetTeamInfo(scavAllies[i], false) + for i = 1, #scavAllies do + local _, _, _, AI = Spring.GetTeamInfo(scavAllies[i], false) local LuaAI = Spring.GetTeamLuaAI(scavAllies[i]) if (AI or LuaAI) and scavAllies[i] ~= scavTeamID then local units = GetTeamUnits(scavAllies[i]) - for u = 1,#units do + for u = 1, #units do DestroyUnit(units[u], false, true) Spring.KillTeam(scavAllies[i]) end @@ -300,15 +299,15 @@ if gadgetHandler:IsSyncedCode() then local highValueTargetCount = SetCount(squadPotentialHighValueTarget) local pos = {} local pickedTarget = nil - local highValueTargetPickChance = math.min(0.75, highValueTargetCount*0.15) + local highValueTargetPickChance = math.min(0.75, highValueTargetCount * 0.15) repeat loops = loops + 1 if highValueTargetCount > 0 and mRandom() <= highValueTargetPickChance then for target in pairs(squadPotentialHighValueTarget) do - if mRandom(1,highValueTargetCount) == 1 then + if mRandom(1, highValueTargetCount) == 1 then if ValidUnitID(target) and not GetUnitIsDead(target) and not GetUnitNeutral(target) then - local x,y,z = Spring.GetUnitPosition(target) - pos = {x = x+mRandom(-32,32), y = y, z = z+mRandom(-32,32)} + local x, y, z = Spring.GetUnitPosition(target) + pos = { x = x + mRandom(-32, 32), y = y, z = z + mRandom(-32, 32) } pickedTarget = target break end @@ -316,10 +315,10 @@ if gadgetHandler:IsSyncedCode() then end else for target in pairs(squadPotentialTarget) do - if mRandom(1,targetCount) == 1 then + if mRandom(1, targetCount) == 1 then if ValidUnitID(target) and not GetUnitIsDead(target) and not GetUnitNeutral(target) then - local x,y,z = Spring.GetUnitPosition(target) - pos = {x = x+mRandom(-32,32), y = y, z = z+mRandom(-32,32)} + local x, y, z = Spring.GetUnitPosition(target) + pos = { x = x + mRandom(-32, 32), y = y, z = z + mRandom(-32, 32) } pickedTarget = target break end @@ -339,29 +338,28 @@ if gadgetHandler:IsSyncedCode() then function setScavXP(unitID) local maxXP = config.maxXP local bossAnger = bossAnger or 0 - local xp = mRandom(0, math.ceil((bossAnger*0.01) * maxXP * 1000))*0.001 + local xp = mRandom(0, math.ceil((bossAnger * 0.01) * maxXP * 1000)) * 0.001 SetUnitExperience(unitID, xp) return xp end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Difficulty - -- + -- config.gracePeriodInitial = config.gracePeriod + 0 - local maxBurrows = ((config.maxBurrows*(1-config.scavPerPlayerMultiplier))+(config.maxBurrows*config.scavPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)))*config.scavSpawnMultiplier + local maxBurrows = ((config.maxBurrows * (1 - config.scavPerPlayerMultiplier)) + (config.maxBurrows * config.scavPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8))) * config.scavSpawnMultiplier local bossTime = (config.bossTime + config.gracePeriod) - local maxWaveSize = ((config.maxScavs*(1-config.scavPerPlayerMultiplier))+(config.maxScavs*config.scavPerPlayerMultiplier)*SetCount(humanTeams))*config.scavSpawnMultiplier - local minWaveSize = ((config.minScavs*(1-config.scavPerPlayerMultiplier))+(config.minScavs*config.scavPerPlayerMultiplier)*SetCount(humanTeams))*config.scavSpawnMultiplier + local maxWaveSize = ((config.maxScavs * (1 - config.scavPerPlayerMultiplier)) + (config.maxScavs * config.scavPerPlayerMultiplier) * SetCount(humanTeams)) * config.scavSpawnMultiplier + local minWaveSize = ((config.minScavs * (1 - config.scavPerPlayerMultiplier)) + (config.minScavs * config.scavPerPlayerMultiplier) * SetCount(humanTeams)) * config.scavSpawnMultiplier local currentMaxWaveSize = minWaveSize local endlessLoopCounter = 1 local pastFirstBoss = false function updateDifficultyForSurvival() t = GetGameSeconds - config.gracePeriod = t-1 - bossAnger = 0 -- reenable scav spawning + config.gracePeriod = t - 1 + bossAnger = 0 -- reenable scav spawning techAnger = 0 waveParameters.waveTechAnger = 0 playerAggression = 0 @@ -386,10 +384,10 @@ if gadgetHandler:IsSyncedCode() then else difficultyCounter = difficultyCounter - 1 nextDifficulty = config.difficultyParameters[difficultyCounter] - config.scavSpawnMultiplier = config.scavSpawnMultiplier+1 - config.bossResistanceMult = config.bossResistanceMult+0.5 - config.damageMod = config.damageMod+0.25 - config.healthMod = config.healthMod+0.25 + config.scavSpawnMultiplier = config.scavSpawnMultiplier + 1 + config.bossResistanceMult = config.bossResistanceMult + 0.5 + config.damageMod = config.damageMod + 0.25 + config.healthMod = config.healthMod + 0.25 end config.bossName = nextDifficulty.bossName config.burrowSpawnRate = nextDifficulty.burrowSpawnRate @@ -401,7 +399,7 @@ if gadgetHandler:IsSyncedCode() then config.maxBurrows = nextDifficulty.maxBurrows config.maxXP = nextDifficulty.maxXP config.angerBonus = nextDifficulty.angerBonus - config.bossTime = math.ceil(nextDifficulty.bossTime/(endlessLoopCounter/2)) + config.bossTime = math.ceil(nextDifficulty.bossTime / (endlessLoopCounter / 2)) bossStagger = { Health = nextDifficulty.bossStagger.health, CurrentHealth = nextDifficulty.bossStagger.health - 1, @@ -411,12 +409,12 @@ if gadgetHandler:IsSyncedCode() then } bossTime = (config.bossTime + config.gracePeriod) - maxBurrows = ((config.maxBurrows*(1-config.scavPerPlayerMultiplier))+(config.maxBurrows*config.scavPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)))*config.scavSpawnMultiplier - maxWaveSize = ((config.maxScavs*(1-config.scavPerPlayerMultiplier))+(config.maxScavs*config.scavPerPlayerMultiplier)*SetCount(humanTeams))*config.scavSpawnMultiplier - minWaveSize = ((config.minScavs*(1-config.scavPerPlayerMultiplier))+(config.minScavs*config.scavPerPlayerMultiplier)*SetCount(humanTeams))*config.scavSpawnMultiplier + maxBurrows = ((config.maxBurrows * (1 - config.scavPerPlayerMultiplier)) + (config.maxBurrows * config.scavPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8))) * config.scavSpawnMultiplier + maxWaveSize = ((config.maxScavs * (1 - config.scavPerPlayerMultiplier)) + (config.maxScavs * config.scavPerPlayerMultiplier) * SetCount(humanTeams)) * config.scavSpawnMultiplier + minWaveSize = ((config.minScavs * (1 - config.scavPerPlayerMultiplier)) + (config.minScavs * config.scavPerPlayerMultiplier) * SetCount(humanTeams)) * config.scavSpawnMultiplier config.scavSpawnRate = nextDifficulty.scavSpawnRate currentMaxWaveSize = minWaveSize - SetGameRulesParam("ScavBossAngerGain_Base", 100/config.bossTime) + SetGameRulesParam("ScavBossAngerGain_Base", 100 / config.bossTime) end -------------------------------------------------------------------------------- @@ -430,11 +428,10 @@ if gadgetHandler:IsSyncedCode() then SetGameRulesParam("scavTechAnger", math.floor(techAnger)) SetGameRulesParam("scavGracePeriod", config.gracePeriod) SetGameRulesParam("scavDifficulty", config.difficulty) - SetGameRulesParam("ScavBossAngerGain_Base", 100/config.bossTime) + SetGameRulesParam("ScavBossAngerGain_Base", 100 / config.bossTime) SetGameRulesParam("ScavBossAngerGain_Aggression", 0) SetGameRulesParam("ScavBossAngerGain_Eco", 0) - function scavEvent(type, num, tech) SendToUnsynced("ScavEvent", type, num, tech) end @@ -446,7 +443,7 @@ if gadgetHandler:IsSyncedCode() then -- local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua") - local ScavStartboxXMin, ScavStartboxZMin, ScavStartboxXMax, ScavStartboxZMax = EnemyLib.GetAdjustedStartBox(scavAllyTeamID, config.burrowSize*1.5) + local ScavStartboxXMin, ScavStartboxZMin, ScavStartboxXMax, ScavStartboxZMax = EnemyLib.GetAdjustedStartBox(scavAllyTeamID, config.burrowSize * 1.5) --[[ @@ -468,8 +465,7 @@ if gadgetHandler:IsSyncedCode() then ]] function squadManagerKillerLoop() -- Kills squads that have been alive for too long (most likely stuck somewhere on the map) --squadsTable - for i = 1,#squadsTable do - + for i = 1, #squadsTable do squadsTable[i].squadLife = squadsTable[i].squadLife - 1 if squadsTable[i].squadLife < 3 and squadsTable[i].squadRegroupEnabled then squadsTable[i].squadRegroupEnabled = false @@ -489,11 +485,11 @@ if gadgetHandler:IsSyncedCode() then local destroyQueue = {} for j, unitID in pairs(squadsTable[i].squadUnits) do if unitID then - destroyQueue[#destroyQueue+1] = unitID + destroyQueue[#destroyQueue + 1] = unitID -- Spring.Echo("Killing old unit. ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) end end - for j = 1,#destroyQueue do + for j = 1, #destroyQueue do -- Spring.Echo("Destroying Unit. ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) if Spring.GetUnitTeam(destroyQueue[j]) == scavTeamID then DestroyUnit(destroyQueue[j], true, false) @@ -506,7 +502,6 @@ if gadgetHandler:IsSyncedCode() then end end - --or Spring.GetGameSeconds() <= config.gracePeriod function squadCommanderGiveOrders(squadID, targetx, targety, targetz) local units = squadsTable[squadID].squadUnits @@ -522,11 +517,19 @@ if gadgetHandler:IsSyncedCode() then local count = 0 for i, unitID in pairs(units) do if ValidUnitID(unitID) and not GetUnitIsDead(unitID) and not GetUnitNeutral(unitID) then - local x,y,z = Spring.GetUnitPosition(unitID) - if x < xmin then xmin = x end - if z < zmin then zmin = z end - if x > xmax then xmax = x end - if z > zmax then zmax = z end + local x, y, z = Spring.GetUnitPosition(unitID) + if x < xmin then + xmin = x + end + if z < zmin then + zmin = z + end + if x > xmax then + xmax = x + end + if z > zmax then + zmax = z + end xsum = xsum + x zsum = zsum + z count = count + 1 @@ -534,9 +537,9 @@ if gadgetHandler:IsSyncedCode() then end -- Calculate average unit position if count > 0 then - local xaverage = xsum/count - local zaverage = zsum/count - if xmin < xaverage-512 or xmax > xaverage+512 or zmin < zaverage-512 or zmax > zaverage+512 then + local xaverage = xsum / count + local zaverage = zsum / count + if xmin < xaverage - 512 or xmax > xaverage + 512 or zmin < zaverage - 512 or zmax > zaverage + 512 then targetx = xaverage targetz = zaverage targety = Spring.GetGroundHeight(targetx, targetz) @@ -550,41 +553,40 @@ if gadgetHandler:IsSyncedCode() then squadsTable[squadID].squadNeedsRegroup = false end - - if (squadsTable[squadID].squadNeedsRefresh) or (squadsTable[squadID].squadNeedsRegroup == true and squadsTable[squadID].squadRegrouping == false) or (squadsTable[squadID].squadNeedsRegroup == false and squadsTable[squadID].squadRegrouping == true) then + if squadsTable[squadID].squadNeedsRefresh or (squadsTable[squadID].squadNeedsRegroup == true and squadsTable[squadID].squadRegrouping == false) or (squadsTable[squadID].squadNeedsRegroup == false and squadsTable[squadID].squadRegrouping == true) then for i, unitID in pairs(units) do if ValidUnitID(unitID) and not GetUnitIsDead(unitID) and not GetUnitNeutral(unitID) then -- Spring.Echo("GiveOrderToUnit #" .. i) if not unitCowardCooldown[unitID] then if config.scavBehaviours.ALWAYSMOVE[Spring.GetUnitDefID(unitID)] then local pos = getRandomEnemyPos() - Spring.GiveOrderToUnit(unitID, CMD.MOVE, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) elseif config.scavBehaviours.ALWAYSFIGHT[Spring.GetUnitDefID(unitID)] then local pos = getRandomEnemyPos() - Spring.GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) elseif role == "assault" or role == "artillery" then - Spring.GiveOrderToUnit(unitID, CMD.FIGHT, {targetx+mRandom(-256, 256), targety, targetz+mRandom(-256, 256)} , {}) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { targetx + mRandom(-256, 256), targety, targetz + mRandom(-256, 256) }, {}) elseif role == "raid" then - Spring.GiveOrderToUnit(unitID, CMD.MOVE, {targetx+mRandom(-256, 256), targety, targetz+mRandom(-256, 256)} , {}) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { targetx + mRandom(-256, 256), targety, targetz + mRandom(-256, 256) }, {}) elseif role == "aircraft" then local pos = getRandomEnemyPos() - Spring.GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {}) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, {}) elseif role == "kamikaze" then - Spring.GiveOrderToUnit(unitID, CMD.MOVE, {targetx+mRandom(-256, 256), targety, targetz+mRandom(-256, 256)} , {}) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { targetx + mRandom(-256, 256), targety, targetz + mRandom(-256, 256) }, {}) elseif role == "healer" then local pos = getRandomEnemyPos() Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, {}) if math.random() < 0.75 then - Spring.GiveOrderToUnit(unitID, CMD.RESURRECT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.RESURRECT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end if math.random() < 0.75 then - Spring.GiveOrderToUnit(unitID, CMD.CAPTURE, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.CAPTURE, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end if math.random() < 0.75 then - Spring.GiveOrderToUnit(unitID, CMD.REPAIR, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.REPAIR, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end - Spring.GiveOrderToUnit(unitID, CMD.RESURRECT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) - Spring.GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) + Spring.GiveOrderToUnit(unitID, CMD.RESURRECT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) end end end @@ -616,14 +618,14 @@ if gadgetHandler:IsSyncedCode() then squadID = 1 -- Spring.Echo("First squad, #".. squadID) else - for i = 1,#squadsTable do + for i = 1, #squadsTable do -- Spring.Echo("Attempt to recycle squad #" .. i .. ". Containing " .. SetCount(squadsTable[i].squadUnits) .. " units.") if SetCount(squadsTable[i].squadUnits) == 0 then -- Yes, we found one empty squad to recycle squadID = i -- Spring.Echo("Recycled squad, #".. squadID) break elseif i == #squadsTable then -- No, there's no empty squad, we need to create new one - squadID = i+1 + squadID = i + 1 -- Spring.Echo("Created new squad, #".. squadID) end end @@ -632,17 +634,16 @@ if gadgetHandler:IsSyncedCode() then if squadID ~= 0 then -- If it's 0 then we f***** up somewhere local role = "assault" if not newSquad.role then - if mRandom(0,100) <= 60 then + if mRandom(0, 100) <= 60 then role = "raid" end else role = newSquad.role end if not newSquad.life then - newSquad.life = math.ceil(10*Spring.GetModOptions().scav_spawntimemult) + newSquad.life = math.ceil(10 * Spring.GetModOptions().scav_spawntimemult) end - squadsTable[squadID] = { squadUnits = newSquad.units, squadLife = newSquad.life, @@ -657,7 +658,7 @@ if gadgetHandler:IsSyncedCode() then -- Spring.Echo("Created Scav Squad, containing " .. #squadsTable[squadID].squadUnits .. " units!") -- Spring.Echo("Role: " .. squadsTable[squadID].squadRole) -- Spring.Echo("Lifetime: " .. squadsTable[squadID].squadLife) - for i = 1,SetCount(squadsTable[squadID].squadUnits) do + for i = 1, SetCount(squadsTable[squadID].squadUnits) do local unitID = squadsTable[squadID].squadUnits[i] unitSquadTable[unitID] = squadID -- Spring.Echo("#".. i ..", ID: ".. unitID .. ", Name:" .. UnitDefs[Spring.GetUnitDefID(unitID)].name) @@ -672,8 +673,8 @@ if gadgetHandler:IsSyncedCode() then end function manageAllSquads() -- Get new target for all squads that need it - for i = 1,#squadsTable do - if mRandom(1,100) == 1 then + for i = 1, #squadsTable do + if mRandom(1, 100) == 1 then local hasTarget = false for squad, target in pairs(unitTargetPool) do if i == squad then @@ -688,7 +689,6 @@ if gadgetHandler:IsSyncedCode() then end end - function getScavSpawnLoc(burrowID, size) local x, y, z local bx, by, bz = GetUnitPosition(burrowID) @@ -706,19 +706,18 @@ if gadgetHandler:IsSyncedCode() then tries = tries + 1 if x >= MAPSIZEX then x = (MAPSIZEX - mRandom(1, 40)) - elseif (x <= 0) then + elseif x <= 0 then x = mRandom(1, 40) end if z >= MAPSIZEZ then z = (MAPSIZEZ - mRandom(1, 40)) - elseif (z <= 0) then + elseif z <= 0 then z = mRandom(1, 40) end until (TestBuildOrder(size, x, by, z, 1) == 2 and not GetGroundBlocked(x, z)) or (tries > maxTries) y = GetGroundHeight(x, z) return x, y, z - end function getNearestScavBeacon(tx, ty, tz) @@ -727,7 +726,7 @@ if gadgetHandler:IsSyncedCode() then for burrowID, burrow in pairs(burrows) do local bx, by, bz = GetUnitPosition(burrowID) if bx and by and bz then - local distance = math.ceil((math.abs(tx-bx) + math.abs(ty-by) + math.abs(tz-bz))*0.5) + local distance = math.ceil((math.abs(tx - bx) + math.abs(ty - by) + math.abs(tz - bz)) * 0.5) if distance < nearestDistance then nearestDistance = distance nearestBurrow = burrowID @@ -747,7 +746,9 @@ if gadgetHandler:IsSyncedCode() then local squadCounter = 0 if scavType then - if not count then count = 1 end + if not count then + count = 1 + end if UnitDefNames[scavType] then for j = 1, count, 1 do if mRandom() <= config.spawnChance or j == 1 then @@ -763,13 +764,13 @@ if gadgetHandler:IsSyncedCode() then else squadCounter = 0 local squad - local airRandom = mRandom(1,100) - local specialRandom = mRandom(1,100) + local airRandom = mRandom(1, 100) + local specialRandom = mRandom(1, 100) local burrowX, burrowY, burrowZ = Spring.GetUnitPosition(burrowID) local surface = positionCheckLibrary.LandOrSeaCheck(burrowX, burrowY, burrowZ, config.burrowSize) if waveParameters.waveTechAnger > config.airStartAnger and airRandom <= waveParameters.waveAirPercentage then - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if specialRandom <= waveParameters.waveSpecialPercentage then if surface == "land" then @@ -785,15 +786,14 @@ if gadgetHandler:IsSyncedCode() then end end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end end end else - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if specialRandom <= waveParameters.waveSpecialPercentage then if surface == "land" then @@ -802,8 +802,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.specialSea[mRandom(1, #squadSpawnOptions.specialSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end @@ -815,8 +814,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.basicSea[mRandom(1, #squadSpawnOptions.basicSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end @@ -845,7 +843,7 @@ if gadgetHandler:IsSyncedCode() then if mRandom() <= config.spawnChance then squad = nil squadCounter = 0 - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if surface == "land" then potentialSquad = squadSpawnOptions.healerLand[mRandom(1, #squadSpawnOptions.healerLand)] @@ -853,7 +851,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.healerSea[mRandom(1, #squadSpawnOptions.healerSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) then -- Super Squad + if potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger then -- Super Squad squad = potentialSquad break end @@ -880,7 +878,7 @@ if gadgetHandler:IsSyncedCode() then end if mRandom() <= 0.5 then for name, data in pairs(squadSpawnOptions.commanders) do - if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.commanders)) == 1 and (not waveParameters.commanders.waveCommanders[name]) and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and CommandersPopulation+waveParameters.commanders.waveCommanderCount < SetCount(humanTeams)*0.5*(techAnger*0.01) then + if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.commanders)) == 1 and not waveParameters.commanders.waveCommanders[name] and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and CommandersPopulation + waveParameters.commanders.waveCommanderCount < SetCount(humanTeams) * 0.5 * (techAnger * 0.01) then waveParameters.commanders.waveCommanders[name] = true waveParameters.commanders.waveCommanderCount = waveParameters.commanders.waveCommanderCount + 1 table.insert(spawnQueue, { burrow = burrowID, unitName = name, team = scavTeamID, squadID = 1 }) @@ -889,7 +887,7 @@ if gadgetHandler:IsSyncedCode() then end else for name, data in pairs(squadSpawnOptions.decoyCommanders) do - if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.decoyCommanders)) == 1 and (not waveParameters.commanders.waveDecoyCommanders[name]) and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and DecoyCommandersPopulation+waveParameters.commanders.waveDecoyCommanderCount < SetCount(humanTeams)*0.5*(techAnger*0.01) then + if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.decoyCommanders)) == 1 and not waveParameters.commanders.waveDecoyCommanders[name] and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and DecoyCommandersPopulation + waveParameters.commanders.waveDecoyCommanderCount < SetCount(humanTeams) * 0.5 * (techAnger * 0.01) then waveParameters.commanders.waveDecoyCommanders[name] = true waveParameters.commanders.waveDecoyCommanderCount = waveParameters.commanders.waveDecoyCommanderCount + 1 table.insert(spawnQueue, { burrow = burrowID, unitName = name, team = scavTeamID, squadID = 1 }) @@ -911,13 +909,13 @@ if gadgetHandler:IsSyncedCode() then local foundLocation = false for i = 1, (number or 1) do local canSpawnBurrow = false - local spread = config.burrowSize*1.5 + local spread = config.burrowSize * 1.5 local spawnPosX, spawnPosY, spawnPosZ if config.burrowSpawnType ~= "avoid" then if config.useScum and (canSpawnBurrow and GetGameSeconds >= config.gracePeriodInitial) then -- Attempt #1, find position in creep/scum (skipped if creep is disabled) if spread < MAPSIZEX - spread and spread < MAPSIZEZ - spread then - for _ = 1,1000 do + for _ = 1, 1000 do spawnPosX = mRandom(spread, MAPSIZEX - spread) spawnPosZ = mRandom(spread, MAPSIZEZ - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -938,9 +936,9 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #3 Find some good position in Spawnbox (not Startbox) + if not canSpawnBurrow then -- Attempt #3 Find some good position in Spawnbox (not Startbox) if lsx1 + spread < lsx2 - spread and lsz1 + spread < lsz2 - spread then - for _ = 1,1000 do + for _ = 1, 1000 do spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -961,9 +959,9 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #2 Force spawn in Startbox, ignore any kind of player vision + if not canSpawnBurrow then -- Attempt #2 Force spawn in Startbox, ignore any kind of player vision if ScavStartboxXMin + spread < ScavStartboxXMax - spread and ScavStartboxZMin + spread < ScavStartboxZMax - spread then - for _ = 1,100 do + for _ = 1, 100 do spawnPosX = mRandom(ScavStartboxXMin + spread, ScavStartboxXMax - spread) spawnPosZ = mRandom(ScavStartboxZMin + spread, ScavStartboxZMax - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -980,11 +978,9 @@ if gadgetHandler:IsSyncedCode() then end end end - else -- Avoid Players burrow setup. Spawns anywhere that isn't in player sensor range. - if lsx1 + spread < lsx2 - spread and lsz1 + spread < lsz2 - spread then - for _ = 1,100 do -- Attempt #1 Avoid all sensors + for _ = 1, 100 do -- Attempt #1 Avoid all sensors spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -1000,8 +996,8 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #2 Don't avoid radars - for _ = 1,100 do + if not canSpawnBurrow then -- Attempt #2 Don't avoid radars + for _ = 1, 100 do spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -1018,8 +1014,8 @@ if gadgetHandler:IsSyncedCode() then end end - if (not canSpawnBurrow) then -- Attempt #3 Only avoid LoS - for _ = 1,100 do + if not canSpawnBurrow then -- Attempt #3 Only avoid LoS + for _ = 1, 100 do spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -1042,15 +1038,15 @@ if gadgetHandler:IsSyncedCode() then canSpawnBurrow = false end - if (canSpawnBurrow and GetGameSeconds < config.gracePeriodInitial*0.9) then -- Don't spawn new burrows in existing creep during grace period - Force them to spread as much as they can..... AT LEAST THAT'S HOW IT'S SUPPOSED TO WORK, lol. + if canSpawnBurrow and GetGameSeconds < config.gracePeriodInitial * 0.9 then -- Don't spawn new burrows in existing creep during grace period - Force them to spread as much as they can..... AT LEAST THAT'S HOW IT'S SUPPOSED TO WORK, lol. canSpawnBurrow = not GG.IsPosInRaptorScum(spawnPosX, spawnPosY, spawnPosZ) end if canSpawnBurrow then foundLocation = true - for name,data in pairs(config.burrowUnitsList) do + for name, data in pairs(config.burrowUnitsList) do if math.random() <= config.spawnChance and data.minAnger < math.max(1, techAnger) and data.maxAnger > math.max(1, techAnger) then - local burrowID = CreateUnit(name, spawnPosX, spawnPosY, spawnPosZ, mRandom(0,3), scavTeamID) + local burrowID = CreateUnit(name, spawnPosX, spawnPosY, spawnPosZ, mRandom(0, 3), scavTeamID) if burrowID then SetupBurrow(burrowID, spawnPosX, spawnPosY, spawnPosZ) Spring.SpawnCEG("commander-spawn-alwaysvisible", spawnPosX, spawnPosY, spawnPosZ, 0, 0, 0) @@ -1084,7 +1080,7 @@ if gadgetHandler:IsSyncedCode() then status.isDead = true totalMaxHealth = totalMaxHealth + status.maxHealth else - table.mergeInPlace(status, {health = health, maxHealth = maxHealth}) + table.mergeInPlace(status, { health = health, maxHealth = maxHealth }) totalHealth = totalHealth + health aliveBossesMaxHealth = aliveBossesMaxHealth + maxHealth @@ -1094,13 +1090,11 @@ if gadgetHandler:IsSyncedCode() then end if SetCount(bossIDs) > 0 then - if bossStagger.currentlyStaggered == false then - if bossStagger.CurrentHealth > 0 then - SetGameRulesParam("scavBossStaggerPercentage", math.ceil((bossStagger.CurrentHealth/bossStagger.Health)*100)) + SetGameRulesParam("scavBossStaggerPercentage", math.ceil((bossStagger.CurrentHealth / bossStagger.Health) * 100)) for bossID, _ in pairs(bossIDs) do - Spring.SetUnitHealth(bossID, {paralyze = 0}) + Spring.SetUnitHealth(bossID, { paralyze = 0 }) end else bossStagger.currentlyStaggered = true @@ -1108,32 +1102,32 @@ if gadgetHandler:IsSyncedCode() then for bossID, _ in pairs(bossIDs) do local ux, uy, uz = Spring.GetUnitPosition(bossID) Spring.AddUnitDamage(bossID, 0, 1600000) - Spring.SetUnitHealth(bossID, {paralyze = 16000000}) - for j = 1,50 do + Spring.SetUnitHealth(bossID, { paralyze = 16000000 }) + for j = 1, 50 do if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-1000, 1000), uy+100, uz+math.random(-1000, 1000)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-1000, 1000), uy + 100, uz + math.random(-1000, 1000)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-1000, 1000), uy+100, uz+math.random(-1000, 1000), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-1000, 1000), uy + 100, uz + math.random(-1000, 1000), 0, 0, 0) end end end - SetGameRulesParam("scavBossStaggerPercentage", math.ceil((1 - (bossStagger.CurrentTimer/bossStagger.Time))*100)) + SetGameRulesParam("scavBossStaggerPercentage", math.ceil((1 - (bossStagger.CurrentTimer / bossStagger.Time)) * 100)) end end if bossStagger.currentlyStaggered == true then bossStagger.CurrentTimer = bossStagger.CurrentTimer - 1 if bossStagger.CurrentTimer > 0 then - SetGameRulesParam("scavBossStaggerPercentage", math.ceil((1 - (bossStagger.CurrentTimer/bossStagger.Time))*100)) + SetGameRulesParam("scavBossStaggerPercentage", math.ceil((1 - (bossStagger.CurrentTimer / bossStagger.Time)) * 100)) for bossID, _ in pairs(bossIDs) do local ux, uy, uz = Spring.GetUnitPosition(bossID) Spring.AddUnitDamage(bossID, 0, 1600000) - Spring.SetUnitHealth(bossID, {paralyze = 16000000}) - for j = 1,10 do + Spring.SetUnitHealth(bossID, { paralyze = 16000000 }) + for j = 1, 10 do if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500), 0, 0, 0) end end end @@ -1141,9 +1135,9 @@ if gadgetHandler:IsSyncedCode() then bossStagger.currentlyStaggered = false bossStagger.Time = bossStagger.Time + 5 bossStagger.CurrentTimer = bossStagger.Time + 0 - bossStagger.Health = bossStagger.Health*1.1 + bossStagger.Health = bossStagger.Health * 1.1 bossStagger.CurrentHealth = bossStagger.Health - SetGameRulesParam("scavBossStaggerPercentage", math.ceil((bossStagger.CurrentHealth/bossStagger.Health)*100)) + SetGameRulesParam("scavBossStaggerPercentage", math.ceil((bossStagger.CurrentHealth / bossStagger.Health) * 100)) end end @@ -1172,7 +1166,7 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(burrowID) if x and y and z and not bossIDs[burrowID] then local score = 0 - score = mRandom(1,1000) + score = mRandom(1, 1000) if score > bestScore then bestScore = score bestBurrowID = burrowID @@ -1187,7 +1181,7 @@ if gadgetHandler:IsSyncedCode() then --if bestBurrowID then -- Spring.DestroyUnit(bestBurrowID, true, false) --end - return CreateUnit(config.bossName, sx, sy, sz, mRandom(0,3), scavTeamID), burrowID + return CreateUnit(config.bossName, sx, sy, sz, mRandom(0, 3), scavTeamID), burrowID end local x, z, y @@ -1201,7 +1195,7 @@ if gadgetHandler:IsSyncedCode() then canSpawnBoss = positionCheckLibrary.FlatAreaCheck(x, y, z, 128, 30, true) if canSpawnBoss then - if tries < maxTries*3 then + if tries < maxTries * 3 then canSpawnBoss = positionCheckLibrary.VisibilityCheckEnemy(x, y, z, config.burrowSize, scavAllyTeamID, true, true, true) else canSpawnBoss = positionCheckLibrary.VisibilityCheckEnemy(x, y, z, config.burrowSize, scavAllyTeamID, true, true, false) @@ -1209,19 +1203,19 @@ if gadgetHandler:IsSyncedCode() then end if canSpawnBoss then - canSpawnBoss = positionCheckLibrary.OccupancyCheck(x, y, z, config.burrowSize*0.25) + canSpawnBoss = positionCheckLibrary.OccupancyCheck(x, y, z, config.burrowSize * 0.25) end if canSpawnBoss then canSpawnBoss = positionCheckLibrary.MapEdgeCheck(x, y, z, 256) end - until (canSpawnBoss == true or tries >= maxTries * 6) + until canSpawnBoss == true or tries >= maxTries * 6 if canSpawnBoss then - return CreateUnit(config.bossName, x, y, z, mRandom(0,3), scavTeamID) + return CreateUnit(config.bossName, x, y, z, mRandom(0, 3), scavTeamID) else - for i = 1,100 do + for i = 1, 100 do x = mRandom(ScavStartboxXMin, ScavStartboxXMax) z = mRandom(ScavStartboxZMin, ScavStartboxZMax) y = GetGroundHeight(x, z) @@ -1237,7 +1231,7 @@ if gadgetHandler:IsSyncedCode() then canSpawnBoss = positionCheckLibrary.OccupancyCheck(x, y, z, 128) end if canSpawnBoss then - return CreateUnit(config.bossName, x, y, z, mRandom(0,3), scavTeamID) + return CreateUnit(config.bossName, x, y, z, mRandom(0, 3), scavTeamID) end end end @@ -1245,7 +1239,7 @@ if gadgetHandler:IsSyncedCode() then end local function calculateDifficultyMultiplier(peakScavPower, totalPlayerTeamPower) - if peakScavPower == 0 or peakScavPower == nil or totalPlayerTeamPower == 0 or totalPlayerTeamPower == nil then + if peakScavPower == 0 or peakScavPower == nil or totalPlayerTeamPower == 0 or totalPlayerTeamPower == nil then return false end @@ -1264,7 +1258,6 @@ if gadgetHandler:IsSyncedCode() then end function Wave() - if gameOver then return end @@ -1274,7 +1267,7 @@ if gadgetHandler:IsSyncedCode() then local couldDetermineDifficulty = calculateDifficultyMultiplier(peakScavPower, totalPlayerTeamPower) squadManagerKillerLoop() - Spring.Log("Dynamic Difficulty", LOG.INFO, 'Scavengers dynamicDifficultyClamped: ' .. tostring(dynamicDifficultyClamped)) + Spring.Log("Dynamic Difficulty", LOG.INFO, "Scavengers dynamicDifficultyClamped: " .. tostring(dynamicDifficultyClamped)) waveParameters.baseCooldown = waveParameters.baseCooldown - 1 waveParameters.airWave.cooldown = waveParameters.airWave.cooldown - 1 @@ -1290,8 +1283,8 @@ if gadgetHandler:IsSyncedCode() then return -- scavs were reported to have zero peak power, most likely end - waveParameters.waveSpecialPercentage = mRandom(5,50) - waveParameters.waveAirPercentage = mRandom(10,25) + waveParameters.waveSpecialPercentage = mRandom(5, 50) + waveParameters.waveAirPercentage = mRandom(10, 25) waveParameters.waveSizeMultiplier = 1 waveParameters.waveTimeMultiplier = 1 @@ -1305,85 +1298,67 @@ if gadgetHandler:IsSyncedCode() then waveParameters.commanders.waveDecoyCommanders = {} waveParameters.commanders.waveDecoyCommanderCount = 0 - - if waveParameters.baseCooldown <= 0 or math.max(1, techAnger) < config.tierConfiguration[2].minAnger then -- special waves if math.max(1, techAnger) < config.tierConfiguration[2].minAnger then - - waveParameters.waveSizeMultiplier = math.min(waveParameters.waveSizeMultiplier, math.max(1, techAnger)*0.1) - waveParameters.waveTimeMultiplier = math.min(waveParameters.waveTimeMultiplier, math.max(1, techAnger)*0.1) + waveParameters.waveSizeMultiplier = math.min(waveParameters.waveSizeMultiplier, math.max(1, techAnger) * 0.1) + waveParameters.waveTimeMultiplier = math.min(waveParameters.waveTimeMultiplier, math.max(1, techAnger) * 0.1) waveParameters.waveAirPercentage = 20 waveParameters.waveSpecialPercentage = 0 - elseif waveParameters.waveTechAnger > config.airStartAnger and waveParameters.airWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.airWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.airWave.cooldown = mRandom(0, 10) waveParameters.waveSpecialPercentage = 0 waveParameters.waveAirPercentage = 50 waveParameters.waveSizeMultiplier = 2 waveParameters.waveTimeMultiplier = 0.5 - elseif waveParameters.specialWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.specialWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.specialWave.cooldown = mRandom(0, 10) waveParameters.waveSpecialPercentage = 50 waveParameters.waveAirPercentage = 0 - elseif waveParameters.basicWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.basicWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.basicWave.cooldown = mRandom(0, 10) waveParameters.waveSpecialPercentage = 0 waveParameters.waveAirPercentage = 0 - elseif waveParameters.smallWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.smallWave.cooldown = mRandom(0,10) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.smallWave.cooldown = mRandom(0, 10) waveParameters.waveSizeMultiplier = 0.5 waveParameters.waveTimeMultiplier = 0.5 - elseif waveParameters.largerWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.largerWave.cooldown = mRandom(0,25) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.largerWave.cooldown = mRandom(0, 25) waveParameters.waveSizeMultiplier = 1.5 waveParameters.waveTimeMultiplier = 1.25 - waveParameters.waveAirPercentage = mRandom(5,20) - waveParameters.waveSpecialPercentage = mRandom(5,40) - + waveParameters.waveAirPercentage = mRandom(5, 20) + waveParameters.waveSpecialPercentage = mRandom(5, 40) elseif waveParameters.hugeWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.hugeWave.cooldown = mRandom(0,50) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.hugeWave.cooldown = mRandom(0, 50) waveParameters.waveSizeMultiplier = 3 waveParameters.waveTimeMultiplier = 1.5 - waveParameters.waveAirPercentage = mRandom(5,15) - waveParameters.waveSpecialPercentage = mRandom(5,25) - + waveParameters.waveAirPercentage = mRandom(5, 15) + waveParameters.waveSpecialPercentage = mRandom(5, 25) elseif waveParameters.epicWave.cooldown <= 0 and mRandom() <= config.spawnChance then - - waveParameters.baseCooldown = mRandom(0,2) - waveParameters.epicWave.cooldown = mRandom(0,100) + waveParameters.baseCooldown = mRandom(0, 2) + waveParameters.epicWave.cooldown = mRandom(0, 100) waveParameters.waveSizeMultiplier = 5 waveParameters.waveTimeMultiplier = 2.5 - waveParameters.waveAirPercentage = mRandom(5,10) - waveParameters.waveSpecialPercentage = mRandom(5,10) - + waveParameters.waveAirPercentage = mRandom(5, 10) + waveParameters.waveSpecialPercentage = mRandom(5, 10) end end @@ -1391,21 +1366,21 @@ if gadgetHandler:IsSyncedCode() then local loopCounter = 0 local squadCounter = 0 - waveParameters.waveTechAnger = math.min(999, techAnger*dynamicDifficultyClamped) - waveParameters.waveSizeMultiplier = waveParameters.waveSizeMultiplier*dynamicDifficultyClamped + waveParameters.waveTechAnger = math.min(999, techAnger * dynamicDifficultyClamped) + waveParameters.waveSizeMultiplier = waveParameters.waveSizeMultiplier * dynamicDifficultyClamped repeat loopCounter = loopCounter + 1 for burrowID in pairs(burrows) do if mRandom() <= config.spawnChance then squadCounter = 0 - local airRandom = mRandom(1,100) - local specialRandom = mRandom(1,100) + local airRandom = mRandom(1, 100) + local specialRandom = mRandom(1, 100) local squad local burrowX, burrowY, burrowZ = Spring.GetUnitPosition(burrowID) local surface = positionCheckLibrary.LandOrSeaCheck(burrowX, burrowY, burrowZ, config.burrowSize) if waveParameters.waveTechAnger > config.airStartAnger and airRandom <= waveParameters.waveAirPercentage then - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if specialRandom <= waveParameters.waveSpecialPercentage then if surface == "land" then @@ -1421,15 +1396,14 @@ if gadgetHandler:IsSyncedCode() then end end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end end end else - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if specialRandom <= waveParameters.waveSpecialPercentage then if surface == "land" then @@ -1438,8 +1412,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.specialSea[mRandom(1, #squadSpawnOptions.specialSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end @@ -1451,8 +1424,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.basicSea[mRandom(1, #squadSpawnOptions.basicSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) - or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger-30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger-30) >= waveParameters.waveTechAnger) then -- Super Squad + if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) or (specialRandom <= 1 and math.max(10, potentialSquad.minAnger - 30) <= waveParameters.waveTechAnger and math.max(40, potentialSquad.maxAnger - 30) >= waveParameters.waveTechAnger) then -- Super Squad squad = potentialSquad break end @@ -1482,7 +1454,7 @@ if gadgetHandler:IsSyncedCode() then if mRandom() <= config.spawnChance and loopCounter == 1 then squad = nil squadCounter = 0 - for _ = 1,1000 do + for _ = 1, 1000 do local potentialSquad if surface == "land" then potentialSquad = squadSpawnOptions.healerLand[mRandom(1, #squadSpawnOptions.healerLand)] @@ -1490,7 +1462,7 @@ if gadgetHandler:IsSyncedCode() then potentialSquad = squadSpawnOptions.healerSea[mRandom(1, #squadSpawnOptions.healerSea)] end if potentialSquad then - if (potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger) then -- Super Squad + if potentialSquad.minAnger <= waveParameters.waveTechAnger and potentialSquad.maxAnger >= waveParameters.waveTechAnger then -- Super Squad squad = potentialSquad break end @@ -1518,7 +1490,7 @@ if gadgetHandler:IsSyncedCode() then end if mRandom() <= 0.5 then for name, data in pairs(squadSpawnOptions.commanders) do - if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.commanders)) == 1 and (not waveParameters.commanders.waveCommanders[name]) and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and CommandersPopulation+waveParameters.commanders.waveCommanderCount < SetCount(humanTeams)*(techAnger*0.01) then + if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.commanders)) == 1 and not waveParameters.commanders.waveCommanders[name] and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and CommandersPopulation + waveParameters.commanders.waveCommanderCount < SetCount(humanTeams) * (techAnger * 0.01) then waveParameters.commanders.waveCommanders[name] = true waveParameters.commanders.waveCommanderCount = waveParameters.commanders.waveCommanderCount + 1 table.insert(spawnQueue, { burrow = burrowID, unitName = name, team = scavTeamID, squadID = 1 }) @@ -1528,7 +1500,7 @@ if gadgetHandler:IsSyncedCode() then end else for name, data in pairs(squadSpawnOptions.decoyCommanders) do - if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.decoyCommanders)) == 1 and (not waveParameters.commanders.waveDecoyCommanders[name]) and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and DecoyCommandersPopulation+waveParameters.commanders.waveDecoyCommanderCount < SetCount(humanTeams)*(techAnger*0.01) then + if mRandom() <= config.spawnChance and mRandom(1, SetCount(squadSpawnOptions.decoyCommanders)) == 1 and not waveParameters.commanders.waveDecoyCommanders[name] and data.minAnger <= waveParameters.waveTechAnger and data.maxAnger >= waveParameters.waveTechAnger and Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[name].id) < data.maxAlive and DecoyCommandersPopulation + waveParameters.commanders.waveDecoyCommanderCount < SetCount(humanTeams) * (techAnger * 0.01) then waveParameters.commanders.waveDecoyCommanders[name] = true waveParameters.commanders.waveDecoyCommanderCount = waveParameters.commanders.waveDecoyCommanderCount + 1 table.insert(spawnQueue, { burrow = burrowID, unitName = name, team = scavTeamID, squadID = 1 }) @@ -1556,7 +1528,7 @@ if gadgetHandler:IsSyncedCode() then --end end end - until (cCount > currentMaxWaveSize*waveParameters.waveSizeMultiplier or loopCounter >= 200*config.scavSpawnMultiplier) + until cCount > currentMaxWaveSize * waveParameters.waveSizeMultiplier or loopCounter >= 200 * config.scavSpawnMultiplier if config.useWaveMsg then scavEvent("wave", cCount) @@ -1572,7 +1544,7 @@ if gadgetHandler:IsSyncedCode() then if config.useScum then -- If creep/scum is enabled, only allow to spawn turrets on the creep if spread < MAPSIZEX - spread and spread < MAPSIZEZ - spread then - for _ = 1,5 do + for _ = 1, 5 do spawnPosX = mRandom(spread, MAPSIZEX - spread) spawnPosZ = mRandom(spread, MAPSIZEZ - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -1592,7 +1564,7 @@ if gadgetHandler:IsSyncedCode() then end end else -- Otherwise use Scav LoS as creep with Players sensors being the safety zone - for _ = 1,5 do + for _ = 1, 5 do spawnPosX = mRandom(lsx1 + spread, lsx2 - spread) spawnPosZ = mRandom(lsz1 + spread, lsz2 - spread) spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) @@ -1616,7 +1588,7 @@ if gadgetHandler:IsSyncedCode() then end if canSpawnStructure then - local structureUnitID = Spring.CreateUnit(unitDefName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0,3), scavTeamID) + local structureUnitID = Spring.CreateUnit(unitDefName, spawnPosX, spawnPosY, spawnPosZ, mRandom(0, 3), scavTeamID) if structureUnitID then SetUnitBlocking(structureUnitID, false, false) return structureUnitID, spawnPosX, spawnPosY, spawnPosZ @@ -1626,36 +1598,38 @@ if gadgetHandler:IsSyncedCode() then function spawnCreepStructuresWave() for uName, uSettings in pairs(config.scavTurrets) do - if not uSettings.maxBossAnger then uSettings.maxBossAnger = uSettings.minBossAnger + 100 end + if not uSettings.maxBossAnger then + uSettings.maxBossAnger = uSettings.minBossAnger + 100 + end if uSettings.minBossAnger <= waveParameters.waveTechAnger and uSettings.maxBossAnger >= waveParameters.waveTechAnger then - local numOfTurrets = (uSettings.spawnedPerWave*(1-config.scavPerPlayerMultiplier))+(uSettings.spawnedPerWave*config.scavPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)) - local maxExisting = (uSettings.maxExisting*(1-config.scavPerPlayerMultiplier))+(uSettings.maxExisting*config.scavPerPlayerMultiplier)*(math.min(SetCount(humanTeams), 8)) + local numOfTurrets = (uSettings.spawnedPerWave * (1 - config.scavPerPlayerMultiplier)) + (uSettings.spawnedPerWave * config.scavPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8)) + local maxExisting = (uSettings.maxExisting * (1 - config.scavPerPlayerMultiplier)) + (uSettings.maxExisting * config.scavPerPlayerMultiplier) * (math.min(SetCount(humanTeams), 8)) local maxAllowedToSpawn - if waveParameters.waveTechAnger <= 100 then -- i don't know how this works but it does. scales maximum amount of turrets allowed to spawn with techAnger. - maxAllowedToSpawn = math.ceil(maxExisting*((waveParameters.waveTechAnger-uSettings.minBossAnger)/(math.min(100-uSettings.minBossAnger, uSettings.maxBossAnger-uSettings.minBossAnger)))) + if waveParameters.waveTechAnger <= 100 then -- i don't know how this works but it does. scales maximum amount of turrets allowed to spawn with techAnger. + maxAllowedToSpawn = math.ceil(maxExisting * ((waveParameters.waveTechAnger - uSettings.minBossAnger) / (math.min(100 - uSettings.minBossAnger, uSettings.maxBossAnger - uSettings.minBossAnger)))) else - maxAllowedToSpawn = math.ceil(maxExisting*(waveParameters.waveTechAnger*0.01)) + maxAllowedToSpawn = math.ceil(maxExisting * (waveParameters.waveTechAnger * 0.01)) end --Spring.Echo(uName,"MaxExisting",maxExisting,"MaxAllowed",maxAllowedToSpawn) for i = 1, math.ceil(numOfTurrets) do - if mRandom() < config.spawnChance*math.min((GetGameSeconds/config.gracePeriodInitial),1) and UnitDefNames[uName] and (Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[uName].id) <= maxAllowedToSpawn) then - if i <= numOfTurrets or math.random() <= numOfTurrets%1 then + if mRandom() < config.spawnChance * math.min((GetGameSeconds / config.gracePeriodInitial), 1) and UnitDefNames[uName] and (Spring.GetTeamUnitDefCount(scavTeamID, UnitDefNames[uName].id) <= maxAllowedToSpawn) then + if i <= numOfTurrets or math.random() <= numOfTurrets % 1 then local attempts = 0 local footprintX = UnitDefNames[uName].xsize -- why the fuck is this footprint *2?????? local footprintZ = UnitDefNames[uName].zsize -- why the fuck is this footprint *2?????? local footprintAvg = 128 if footprintX and footprintZ then - footprintAvg = ((footprintX+footprintZ))*4 + footprintAvg = (footprintX + footprintZ) * 4 end repeat attempts = attempts + 1 - local turretUnitID, spawnPosX, spawnPosY, spawnPosZ = spawnCreepStructure(uName, uSettings, footprintAvg+32) + local turretUnitID, spawnPosX, spawnPosY, spawnPosZ = spawnCreepStructure(uName, uSettings, footprintAvg + 32) if turretUnitID then setScavXP(turretUnitID) if UnitDefNames[uName].isFactory then - Spring.GiveOrderToUnit(turretUnitID, CMD.FIGHT, {spawnPosX + mRandom(-256,256), spawnPosY, spawnPosZ + mRandom(-256,256)}, {"meta"}) + Spring.GiveOrderToUnit(turretUnitID, CMD.FIGHT, { spawnPosX + mRandom(-256, 256), spawnPosY, spawnPosZ + mRandom(-256, 256) }, { "meta" }) else - Spring.GiveOrderToUnit(turretUnitID, CMD.PATROL, {spawnPosX + mRandom(-128,128), spawnPosY, spawnPosZ + mRandom(-128,128)}, {"meta"}) + Spring.GiveOrderToUnit(turretUnitID, CMD.PATROL, { spawnPosX + mRandom(-128, 128), spawnPosY, spawnPosZ + mRandom(-128, 128) }, { "meta" }) end end until turretUnitID or attempts > 10 @@ -1669,7 +1643,7 @@ if gadgetHandler:IsSyncedCode() then function SpawnMinions(unitID, unitDefID) local unitName = UnitDefs[unitDefID].name if config.scavMinions[unitName] then - local minion = config.scavMinions[unitName][mRandom(1,#config.scavMinions[unitName])] + local minion = config.scavMinions[unitName][mRandom(1, #config.scavMinions[unitName])] SpawnRandomOffWaveSquad(unitID, minion, 4) end end @@ -1682,28 +1656,28 @@ if gadgetHandler:IsSyncedCode() then if unitTeam == scavTeamID then local _, maxH = Spring.GetUnitHealth(unitID) Spring.SetUnitHealth(unitID, maxH) - local x,y,z = Spring.GetUnitPosition(unitID) + local x, y, z = Spring.GetUnitPosition(unitID) if not UnitDefs[unitDefID].customParams.isscavenger then --Spring.Echo(UnitDefs[unitDefID].name, "unit created swap", UnitDefs[unitDefID].customParams.scav_swap_override_created) if not UnitDefs[unitDefID].customParams.scav_swap_override_created then if UnitDefs[unitDefID] and UnitDefs[unitDefID].name and UnitDefNames[UnitDefs[unitDefID].name .. "_scav"] then - createUnitQueue[#createUnitQueue+1] = {UnitDefs[unitDefID].name .. "_scav", x, y, z, Spring.GetUnitBuildFacing(unitID) or 0, scavTeamID} + createUnitQueue[#createUnitQueue + 1] = { UnitDefs[unitDefID].name .. "_scav", x, y, z, Spring.GetUnitBuildFacing(unitID) or 0, scavTeamID } DestroyUnit(unitID, true, true) end elseif UnitDefs[unitDefID].customParams.scav_swap_override_created == "delete" then Spring.DestroyUnit(unitID, true, true) elseif UnitDefs[unitDefID].customParams.scav_swap_override_created ~= "null" then if UnitDefNames[UnitDefs[unitDefID].customParams.scav_swap_override_created] then - createUnitQueue[#createUnitQueue+1] = {UnitDefs[unitDefID].customParams.scav_swap_override_created, x, y, z, Spring.GetUnitBuildFacing(unitID) or 0, scavTeamID} + createUnitQueue[#createUnitQueue + 1] = { UnitDefs[unitDefID].customParams.scav_swap_override_created, x, y, z, Spring.GetUnitBuildFacing(unitID) or 0, scavTeamID } end DestroyUnit(unitID, true, true) end return else - Spring.GiveOrderToUnit(unitID,CMD.FIRE_STATE,{config.defaultScavFirestate},0) + Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, { config.defaultScavFirestate }, 0) GG.ScavengersSpawnEffectUnitID(unitID) if UnitDefs[unitDefID].canCloak then - Spring.GiveOrderToUnit(unitID,37382,{1},0) + Spring.GiveOrderToUnit(unitID, 37382, { 1 }, 0) end if squadSpawnOptions.commanders[UnitDefs[unitDefID].name] then CommandersPopulation = CommandersPopulation + 1 @@ -1729,12 +1703,11 @@ if gadgetHandler:IsSyncedCode() then end end if config.ecoBuildingsPenalty[unitDefID] then - playerAggressionEcoValue = playerAggressionEcoValue + (config.ecoBuildingsPenalty[unitDefID]/(config.bossTime/3600)) -- scale to 60minutes = 3600seconds boss time + playerAggressionEcoValue = playerAggressionEcoValue + (config.ecoBuildingsPenalty[unitDefID] / (config.bossTime / 3600)) -- scale to 60minutes = 3600seconds boss time end end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) - if attackerTeam == scavTeamID then damage = damage * config.damageMod end @@ -1767,7 +1740,7 @@ if gadgetHandler:IsSyncedCode() then if not bossResistance[attackerDefID] then bossResistance[attackerDefID] = { damage = damage * 5 * resistMult, - notify = 0 + notify = 0, } end local br = bossResistance[attackerDefID] @@ -1781,19 +1754,19 @@ if gadgetHandler:IsSyncedCode() then end if UnitDefStaggerMultiplier[attackerDefID] then - bossStagger.CurrentHealth = bossStagger.CurrentHealth - ((math.max(damage*0.25, math.min((damage * (1-resistPercent) * 2), damage)) / math.sqrt(nTotalBosses)) * UnitDefStaggerMultiplier[attackerDefID]) + bossStagger.CurrentHealth = bossStagger.CurrentHealth - ((math.max(damage * 0.25, math.min((damage * (1 - resistPercent) * 2), damage)) / math.sqrt(nTotalBosses)) * UnitDefStaggerMultiplier[attackerDefID]) else - bossStagger.CurrentHealth = bossStagger.CurrentHealth - (math.max(damage*0.25,math.min((damage * (1-resistPercent) * 2), damage)) / math.sqrt(nTotalBosses)) + bossStagger.CurrentHealth = bossStagger.CurrentHealth - (math.max(damage * 0.25, math.min((damage * (1 - resistPercent) * 2), damage)) / math.sqrt(nTotalBosses)) end if bossStagger.currentlyStaggered then damage = damage - (damage * resistPercent * 0.5) - bossStagger.CurrentTimer = bossStagger.CurrentTimer - (damage*0.0001) + bossStagger.CurrentTimer = bossStagger.CurrentTimer - (damage * 0.0001) local ux, uy, uz = Spring.GetUnitPosition(unitID) if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500)) + GG.SpawnEnvironmentalLightning("scavradiation", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500)) else - SpawnCEG("scavradiation-lightning", ux+math.random(-500, 500), uy+100, uz+math.random(-500, 500), 0,0,0) + SpawnCEG("scavradiation-lightning", ux + math.random(-500, 500), uy + 100, uz + math.random(-500, 500), 0, 0, 0) end else damage = damage - (damage * resistPercent) @@ -1830,7 +1803,7 @@ if gadgetHandler:IsSyncedCode() then if not UnitReactionsTimeout[unitID] then UnitReactionsTimeout[unitID] = 0 end - if UnitReactionsTimeout[unitID] and UnitReactionsTimeout[unitID] < GetGameSeconds-2 then + if UnitReactionsTimeout[unitID] and UnitReactionsTimeout[unitID] < GetGameSeconds - 2 then if config.scavBehaviours.SKIRMISH[attackerDefID] and (unitTeam ~= scavTeamID) and attackerID and (mRandom() < config.scavBehaviours.SKIRMISH[attackerDefID].chance) and unitTeam ~= attackerTeam then UnitReactionsTimeout[unitID] = GetGameSeconds local ux, uy, uz = GetUnitPosition(unitID) @@ -1838,16 +1811,16 @@ if gadgetHandler:IsSyncedCode() then if x and ux then local angle = math.atan2(ux - x, uz - z) local sinA, cosA = math.sin(angle), math.cos(angle) - local distance = mRandom(math.ceil(config.scavBehaviours.SKIRMISH[attackerDefID].distance*0.75), math.floor(config.scavBehaviours.SKIRMISH[attackerDefID].distance*1.25)) + local distance = mRandom(math.ceil(config.scavBehaviours.SKIRMISH[attackerDefID].distance * 0.75), math.floor(config.scavBehaviours.SKIRMISH[attackerDefID].distance * 1.25)) local dx, dz = sinA * distance, cosA * distance if config.scavBehaviours.SKIRMISH[attackerDefID].teleport and (unitTeleportCooldown[attackerID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(x - dx, y, z - dz, 64, 30, false) and positionCheckLibrary.MapEdgeCheck(x - dx, y, z - dz, 64) and positionCheckLibrary.OccupancyCheck(x - dx, y, z - dz, 64) then GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x, y, z) SetUnitPosition(attackerID, x - dx, z - dz) GiveOrderToUnit(attackerID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x - dx, y, z - dz) - unitTeleportCooldown[attackerID] = GetGameFrame + config.scavBehaviours.SKIRMISH[attackerDefID].teleportcooldown*30 + unitTeleportCooldown[attackerID] = GetGameFrame + config.scavBehaviours.SKIRMISH[attackerDefID].teleportcooldown * 30 else - GiveOrderToUnit(attackerID, CMD.MOVE, { x - dx, y, z - dz}, {}) + GiveOrderToUnit(attackerID, CMD.MOVE, { x - dx, y, z - dz }, {}) end unitCowardCooldown[attackerID] = GetGameFrame + 900 end @@ -1860,16 +1833,16 @@ if gadgetHandler:IsSyncedCode() then if x and ax then local angle = math.atan2(ax - x, az - z) local sinA, cosA = math.sin(angle), math.cos(angle) - local distance = mRandom(math.ceil(config.scavBehaviours.COWARD[unitDefID].distance*0.75), math.floor(config.scavBehaviours.COWARD[unitDefID].distance*1.25)) + local distance = mRandom(math.ceil(config.scavBehaviours.COWARD[unitDefID].distance * 0.75), math.floor(config.scavBehaviours.COWARD[unitDefID].distance * 1.25)) local dx, dz = sinA * distance, cosA * distance if config.scavBehaviours.COWARD[unitDefID].teleport and (unitTeleportCooldown[unitID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(x - dx, y, z - dz, 64, 30, false) and positionCheckLibrary.MapEdgeCheck(x - dx, y, z - dz, 64) and positionCheckLibrary.OccupancyCheck(x - dx, y, z - dz, 64) then GG.ScavengersSpawnEffectUnitDefID(unitDefID, x, y, z) SetUnitPosition(unitID, x - dx, z - dz) GiveOrderToUnit(unitID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(unitDefID, x - dx, y, z - dz) - unitTeleportCooldown[unitID] = GetGameFrame + config.scavBehaviours.COWARD[unitDefID].teleportcooldown*30 + unitTeleportCooldown[unitID] = GetGameFrame + config.scavBehaviours.COWARD[unitDefID].teleportcooldown * 30 else - GiveOrderToUnit(unitID, CMD.MOVE, { x - dx, y, z - dz}, {}) + GiveOrderToUnit(unitID, CMD.MOVE, { x - dx, y, z - dz }, {}) end unitCowardCooldown[unitID] = GetGameFrame + 900 end @@ -1880,16 +1853,16 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(unitID) local separation = GetUnitSeparation(unitID, attackerID) if ax and separation < (config.scavBehaviours.BERSERK[unitDefID].distance or 10000) then - ax = ax + mRandom(-256,256) - az = az + mRandom(-256,256) + ax = ax + mRandom(-256, 256) + az = az + mRandom(-256, 256) if config.scavBehaviours.BERSERK[unitDefID].teleport and (unitTeleportCooldown[unitID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(ax, ay, az, 128, 30, false) and positionCheckLibrary.MapEdgeCheck(ax, ay, az, 128) and positionCheckLibrary.OccupancyCheck(ax, ay, az, 64) then GG.ScavengersSpawnEffectUnitDefID(unitDefID, x, y, z) SetUnitPosition(unitID, ax, ay, az) GiveOrderToUnit(unitID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(attackerDefID, ax, ay, az) - unitTeleportCooldown[unitID] = GetGameFrame + config.scavBehaviours.BERSERK[unitDefID].teleportcooldown*30 + unitTeleportCooldown[unitID] = GetGameFrame + config.scavBehaviours.BERSERK[unitDefID].teleportcooldown * 30 else - GiveOrderToUnit(unitID, CMD.MOVE, {ax, ay, az}, {}) + GiveOrderToUnit(unitID, CMD.MOVE, { ax, ay, az }, {}) end unitCowardCooldown[unitID] = GetGameFrame + 900 end @@ -1899,16 +1872,16 @@ if gadgetHandler:IsSyncedCode() then local x, y, z = GetUnitPosition(attackerID) local separation = GetUnitSeparation(unitID, attackerID) if ax and separation < (config.scavBehaviours.BERSERK[attackerDefID].distance or 10000) then - ax = ax + mRandom(-256,256) - az = az + mRandom(-256,256) + ax = ax + mRandom(-256, 256) + az = az + mRandom(-256, 256) if config.scavBehaviours.BERSERK[attackerDefID].teleport and (unitTeleportCooldown[attackerID] or 1) < GetGameFrame and positionCheckLibrary.FlatAreaCheck(ax, ay, az, 128, 30, false) and positionCheckLibrary.MapEdgeCheck(ax, ay, az, 128) and positionCheckLibrary.OccupancyCheck(ax, ay, az, 64) then GG.ScavengersSpawnEffectUnitDefID(attackerDefID, x, y, z) SetUnitPosition(attackerID, ax, ay, az) GiveOrderToUnit(attackerID, CMD.STOP, 0, 0) GG.ScavengersSpawnEffectUnitDefID(unitDefID, ax, ay, az) - unitTeleportCooldown[attackerID] = GetGameFrame + config.scavBehaviours.BERSERK[attackerDefID].teleportcooldown*30 + unitTeleportCooldown[attackerID] = GetGameFrame + config.scavBehaviours.BERSERK[attackerDefID].teleportcooldown * 30 else - GiveOrderToUnit(attackerID, CMD.MOVE, {ax, ay, az}, {}) + GiveOrderToUnit(attackerID, CMD.MOVE, { ax, ay, az }, {}) end unitCowardCooldown[attackerID] = GetGameFrame + 900 end @@ -1924,11 +1897,11 @@ if gadgetHandler:IsSyncedCode() then if not UnitLifetimeResetTimeout[unitID] then UnitLifetimeResetTimeout[unitID] = 0 end - if (unitTeam == scavTeamID or attackerTeam == scavTeamID) and UnitLifetimeResetTimeout[unitID] < GetGameSeconds-60 then - if (unitID and unitSquadTable[unitID] and squadsTable[unitSquadTable[unitID]] and squadsTable[unitSquadTable[unitID]].squadLife and squadsTable[unitSquadTable[unitID]].squadLife < 2) then + if (unitTeam == scavTeamID or attackerTeam == scavTeamID) and UnitLifetimeResetTimeout[unitID] < GetGameSeconds - 60 then + if unitID and unitSquadTable[unitID] and squadsTable[unitSquadTable[unitID]] and squadsTable[unitSquadTable[unitID]].squadLife and squadsTable[unitSquadTable[unitID]].squadLife < 2 then squadsTable[unitSquadTable[unitID]].squadLife = 10 end - if (attackerID and unitSquadTable[attackerID] and squadsTable[unitSquadTable[attackerID]] and squadsTable[unitSquadTable[attackerID]].squadLife and squadsTable[unitSquadTable[attackerID]].squadLife < 2) then + if attackerID and unitSquadTable[attackerID] and squadsTable[unitSquadTable[attackerID]] and squadsTable[unitSquadTable[attackerID]].squadLife and squadsTable[unitSquadTable[attackerID]].squadLife < 2 then squadsTable[unitSquadTable[attackerID]].squadLife = 10 end end @@ -1954,10 +1927,18 @@ if gadgetHandler:IsSyncedCode() then end end end - if not lsx1 then lsx1 = 0 end - if not lsz1 then lsz1 = 0 end - if not lsx2 then lsx2 = Game.mapSizeX end - if not lsz2 then lsz2 = Game.mapSizeZ end + if not lsx1 then + lsx1 = 0 + end + if not lsz1 then + lsz1 = 0 + end + if not lsx2 then + lsx2 = Game.mapSizeX + end + if not lsz2 then + lsz2 = Game.mapSizeZ + end end function SpawnScavs() @@ -1966,7 +1947,7 @@ if gadgetHandler:IsSyncedCode() then local i, defs = next(spawnQueue) if not i or not defs then if #squadCreationQueue.units > 0 then - if mRandom(1,5) == 1 then + if mRandom(1, 5) == 1 then squadCreationQueue.regroupenabled = false end local squadID = createSquad(squadCreationQueue) @@ -1982,14 +1963,14 @@ if gadgetHandler:IsSyncedCode() then local unitID - local x,y,z + local x, y, z if UnitDefNames[defs.unitName] then x, y, z = getScavSpawnLoc(defs.burrow, UnitDefNames[defs.unitName].id) if not x or not y or not z then spawnQueue[i] = nil return end - unitID = CreateUnit(defs.unitName, x, y, z, mRandom(0,3), defs.team) + unitID = CreateUnit(defs.unitName, x, y, z, mRandom(0, 3), defs.team) else --Spring.Echo("Error: Cannot spawn unit " .. defs.unitName .. ", invalid name.") spawnQueue[i] = nil @@ -2003,15 +1984,15 @@ if gadgetHandler:IsSyncedCode() then squadDone = true end end - if defs.burrow and (not squadCreationQueue.burrow) then + if defs.burrow and not squadCreationQueue.burrow then squadCreationQueue.burrow = defs.burrow end - squadCreationQueue.units[#squadCreationQueue.units+1] = unitID + squadCreationQueue.units[#squadCreationQueue.units + 1] = unitID if config.scavBehaviours.HEALER[UnitDefNames[defs.unitName].id] then squadCreationQueue.role = "healer" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(20*Spring.GetModOptions().scav_spawntimemult) then - squadCreationQueue.life = math.ceil(20*Spring.GetModOptions().scav_spawntimemult) + if squadCreationQueue.life < math.ceil(20 * Spring.GetModOptions().scav_spawntimemult) then + squadCreationQueue.life = math.ceil(20 * Spring.GetModOptions().scav_spawntimemult) end end if config.scavBehaviours.ARTILLERY[UnitDefNames[defs.unitName].id] then @@ -2021,15 +2002,15 @@ if gadgetHandler:IsSyncedCode() then if config.scavBehaviours.KAMIKAZE[UnitDefNames[defs.unitName].id] then squadCreationQueue.role = "kamikaze" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*Spring.GetModOptions().scav_spawntimemult) then - squadCreationQueue.life = math.ceil(100*Spring.GetModOptions().scav_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * Spring.GetModOptions().scav_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * Spring.GetModOptions().scav_spawntimemult) end end if UnitDefNames[defs.unitName].canFly then squadCreationQueue.role = "aircraft" squadCreationQueue.regroupenabled = false - if squadCreationQueue.life < math.ceil(100*Spring.GetModOptions().scav_spawntimemult) then - squadCreationQueue.life = math.ceil(100*Spring.GetModOptions().scav_spawntimemult) + if squadCreationQueue.life < math.ceil(100 * Spring.GetModOptions().scav_spawntimemult) then + squadCreationQueue.life = math.ceil(100 * Spring.GetModOptions().scav_spawntimemult) end end if defs.alwaysVisible then @@ -2054,12 +2035,12 @@ if gadgetHandler:IsSyncedCode() then local bossSquad = table.copy(squadCreationQueueDefaults) bossSquad.life = 999999 bossSquad.role = "raid" - bossSquad.units = {bossID} + bossSquad.units = { bossID } createSquad(bossSquad) spawnQueue = {} scavEvent("boss") -- notify unsynced about boss spawn local _, bossMaxHP = GetUnitHealth(bossID) - Spring.SetUnitHealth(bossID, math.max(bossMaxHP*(techAnger*0.01), bossMaxHP*0.2)) + Spring.SetUnitHealth(bossID, math.max(bossMaxHP * (techAnger * 0.01), bossMaxHP * 0.2)) SetUnitExperience(bossID, 0) timeOfLastWave = t burrows[bossID] = {} @@ -2081,15 +2062,15 @@ if gadgetHandler:IsSyncedCode() then function updateScavSpawnBox() if config.burrowSpawnType == "initialbox_post" or config.burrowSpawnType == "initialbox" then - lsx1 = math.max(ScavStartboxXMin - ((MAPSIZEX*0.01) * (techAnger+15)), 0) - lsz1 = math.max(ScavStartboxZMin - ((MAPSIZEZ*0.01) * (techAnger+15)), 0) - lsx2 = math.min(ScavStartboxXMax + ((MAPSIZEX*0.01) * (techAnger+15)), MAPSIZEX) - lsz2 = math.min(ScavStartboxZMax + ((MAPSIZEZ*0.01) * (techAnger+15)), MAPSIZEZ) - if not lsx2 or lsx2-lsx1 < 512 then + lsx1 = math.max(ScavStartboxXMin - ((MAPSIZEX * 0.01) * (techAnger + 15)), 0) + lsz1 = math.max(ScavStartboxZMin - ((MAPSIZEZ * 0.01) * (techAnger + 15)), 0) + lsx2 = math.min(ScavStartboxXMax + ((MAPSIZEX * 0.01) * (techAnger + 15)), MAPSIZEX) + lsz2 = math.min(ScavStartboxZMax + ((MAPSIZEZ * 0.01) * (techAnger + 15)), MAPSIZEZ) + if not lsx2 or lsx2 - lsx1 < 512 then lsx1 = math.max(0, math.floor((lsx1 + lsx2) / 2) - 256) lsx2 = lsx1 + 512 end - if not lsz2 or lsz2-lsz1 < 512 then + if not lsz2 or lsz2 - lsz1 < 512 then lsz1 = math.max(0, math.floor((lsz1 + lsz2) / 2) - 256) lsz2 = lsz1 + 512 end @@ -2097,7 +2078,7 @@ if gadgetHandler:IsSyncedCode() then end function gadget:TrySpawnBurrow() - local maxSpawnRetries = math.floor((config.gracePeriodInitial-t)/spawnRetryTimeDiv) + local maxSpawnRetries = math.floor((config.gracePeriodInitial - t) / spawnRetryTimeDiv) local spawned = SpawnBurrow() timeOfLastSpawn = t if not fullySpawned then @@ -2106,7 +2087,7 @@ if gadgetHandler:IsSyncedCode() then fullySpawned = true elseif spawnRetries >= maxSpawnRetries or firstSpawn then spawnAreaMultiplier = spawnAreaMultiplier + 1 - ScavStartboxXMin, ScavStartboxZMin, ScavStartboxXMax, ScavStartboxZMax = EnemyLib.GetAdjustedStartBox(scavAllyTeamID, config.burrowSize*1.5*spawnAreaMultiplier) + ScavStartboxXMin, ScavStartboxZMin, ScavStartboxXMax, ScavStartboxZMax = EnemyLib.GetAdjustedStartBox(scavAllyTeamID, config.burrowSize * 1.5 * spawnAreaMultiplier) gadget:SetInitialSpawnBox() spawnRetries = 0 else @@ -2121,13 +2102,12 @@ if gadgetHandler:IsSyncedCode() then local announcedFirstWave = false function gadget:GameFrame(n) - - GetGameSeconds = n/30 + GetGameSeconds = n / 30 GetGameFrame = n if #createUnitQueue > 0 then - for i = 1,#createUnitQueue do - CreateUnit(createUnitQueue[i][1],createUnitQueue[i][2],createUnitQueue[i][3],createUnitQueue[i][4],createUnitQueue[i][5],createUnitQueue[i][6]) + for i = 1, #createUnitQueue do + CreateUnit(createUnitQueue[i][1], createUnitQueue[i][2], createUnitQueue[i][3], createUnitQueue[i][4], createUnitQueue[i][5], createUnitQueue[i][6]) end createUnitQueue = {} end @@ -2150,7 +2130,7 @@ if gadgetHandler:IsSyncedCode() then end local scavTeamUnitCount = GetTeamUnitCount(scavTeamID) or 0 - if scavTeamUnitCount < scavUnitCap and n%5 == 4 then + if scavTeamUnitCount < scavUnitCap and n % 5 == 4 then SpawnScavs() end @@ -2160,29 +2140,29 @@ if gadgetHandler:IsSyncedCode() then end end - if n%30 == 16 then + if n % 30 == 16 then t = GetGameSeconds local burrowCount = SetCount(burrows) - playerAggression = playerAggression*0.995 + playerAggression = playerAggression * 0.995 playerAggressionLevel = math.floor(playerAggression) SetGameRulesParam("scavPlayerAggressionLevel", playerAggressionLevel) if nSpawnedBosses == 0 then - currentMaxWaveSize = (minWaveSize + math.ceil((techAnger*0.01)*(maxWaveSize - minWaveSize))) + currentMaxWaveSize = (minWaveSize + math.ceil((techAnger * 0.01) * (maxWaveSize - minWaveSize))) else - currentMaxWaveSize = math.ceil((minWaveSize + math.ceil((techAnger*0.01)*(maxWaveSize - minWaveSize)))*(config.bossFightWaveSizeScale*0.01)) + currentMaxWaveSize = math.ceil((minWaveSize + math.ceil((techAnger * 0.01) * (maxWaveSize - minWaveSize))) * (config.bossFightWaveSizeScale * 0.01)) end if pastFirstBoss or Spring.GetModOptions().scav_graceperiodmult <= 1 then - techAnger = (t - config.gracePeriodInitial) / ((bossTime/(Spring.GetModOptions().scav_bosstimemult)) - config.gracePeriodInitial) * 100 + techAnger = (t - config.gracePeriodInitial) / ((bossTime / Spring.GetModOptions().scav_bosstimemult) - config.gracePeriodInitial) * 100 else - techAnger = (t - (config.gracePeriodInitial/Spring.GetModOptions().scav_graceperiodmult)) / ((bossTime/(Spring.GetModOptions().scav_bosstimemult)) - (config.gracePeriodInitial/Spring.GetModOptions().scav_graceperiodmult)) * 100 + techAnger = (t - (config.gracePeriodInitial / Spring.GetModOptions().scav_graceperiodmult)) / ((bossTime / Spring.GetModOptions().scav_bosstimemult) - (config.gracePeriodInitial / Spring.GetModOptions().scav_graceperiodmult)) * 100 end --techAnger = (t - config.gracePeriodInitial) / ((bossTime/(Spring.GetModOptions().scav_bosstimemult)) - config.gracePeriodInitial) * 100 - techAnger = math.ceil(techAnger*((config.economyScale*0.5)+0.5)) + techAnger = math.ceil(techAnger * ((config.economyScale * 0.5) + 0.5)) techAnger = math.clamp(techAnger, 0, 999) if t < config.gracePeriodInitial then bossAnger = 0 - minBurrows = math.ceil(math.max(4, 2*(math.min(SetCount(humanTeams), 8)))*(t/config.gracePeriodInitial)) + minBurrows = math.ceil(math.max(4, 2 * (math.min(SetCount(humanTeams), 8))) * (t / config.gracePeriodInitial)) else if nSpawnedBosses == 0 then bossAnger = math.max(math.ceil(math.min((t - config.gracePeriod) / (bossTime - config.gracePeriod) * 100) + bossAngerAggressionLevel, 100), 0) @@ -2195,14 +2175,14 @@ if gadgetHandler:IsSyncedCode() then minBurrows = 1 end end - bossAngerAggressionLevel = bossAngerAggressionLevel + ((playerAggression*0.01)/(config.bossTime/3600)) + playerAggressionEcoValue - SetGameRulesParam("ScavBossAngerGain_Aggression", (playerAggression*0.01)/(config.bossTime/3600)) + bossAngerAggressionLevel = bossAngerAggressionLevel + ((playerAggression * 0.01) / (config.bossTime / 3600)) + playerAggressionEcoValue + SetGameRulesParam("ScavBossAngerGain_Aggression", (playerAggression * 0.01) / (config.bossTime / 3600)) SetGameRulesParam("ScavBossAngerGain_Eco", playerAggressionEcoValue) end SetGameRulesParam("scavBossAnger", math.floor(bossAnger)) SetGameRulesParam("scavTechAnger", math.floor(techAnger)) - if bossAnger >= 100 or (burrowCount <= 1 and t > config.gracePeriod+60) then + if bossAnger >= 100 or (burrowCount <= 1 and t > config.gracePeriod + 60) then -- check if the boss should be alive updateSpawnBoss() end @@ -2223,10 +2203,8 @@ if gadgetHandler:IsSyncedCode() then timeOfLastSpawn = t end - if t > config.gracePeriodInitial+5 then - if burrowCount > 0 - and SetCount(spawnQueue) == 0 - and ((config.scavSpawnRate*waveParameters.waveTimeMultiplier) < (t - timeOfLastWave)) then + if t > config.gracePeriodInitial + 5 then + if burrowCount > 0 and SetCount(spawnQueue) == 0 and ((config.scavSpawnRate * waveParameters.waveTimeMultiplier) < (t - timeOfLastWave)) then Wave() timeOfLastWave = t end @@ -2234,10 +2212,10 @@ if gadgetHandler:IsSyncedCode() then updateScavSpawnBox() end - if n%((math.ceil(config.turretSpawnRate))*30) == 0 and n > 900 and scavTeamUnitCount < scavUnitCap then + if n % ((math.ceil(config.turretSpawnRate)) * 30) == 0 and n > 900 and scavTeamUnitCount < scavUnitCap then spawnCreepStructuresWave() end - local squadID = ((n % (#squadsTable*3))+1)/3 --*3 and /3 for lowering the rate of commands + local squadID = ((n % (#squadsTable * 3)) + 1) / 3 --*3 and /3 for lowering the rate of commands if squadID and squadsTable[squadID] and squadsTable[squadID].squadRegroupEnabled then local targetx, targety, targetz = squadsTable[squadID].target.x, squadsTable[squadID].target.y, squadsTable[squadID].target.z if targetx then @@ -2246,19 +2224,19 @@ if gadgetHandler:IsSyncedCode() then refreshSquad(squadID) end end - if n%7 == 3 then + if n % 7 == 3 then local scavs = GetTeamUnits(scavTeamID) - for i = 1,#scavs do + for i = 1, #scavs do local unitID = scavs[i] local defID = GetUnitDefID(unitID) - if defID and mRandom(1,math.ceil((33*math.max(1, GetTeamUnitDefCount(scavTeamID, defID))))) == 1 and mRandom() < config.spawnChance then + if defID and mRandom(1, math.ceil((33 * math.max(1, GetTeamUnitDefCount(scavTeamID, defID))))) == 1 and mRandom() < config.spawnChance then SpawnMinions(unitID, defID) end - if math.random(1,10) == 1 and unitCowardCooldown[unitID] and (n > unitCowardCooldown[unitID]) then + if math.random(1, 10) == 1 and unitCowardCooldown[unitID] and (n > unitCowardCooldown[unitID]) then unitCowardCooldown[unitID] = nil GiveOrderToUnit(unitID, CMD.STOP, 0, 0) end - if ((math.random(1,10) == 1 or bossIDs[unitID]) and GetUnitCommandCount(unitID) == 0) then + if (math.random(1, 10) == 1 or bossIDs[unitID]) and GetUnitCommandCount(unitID) == 0 then if unitCowardCooldown[unitID] then unitCowardCooldown[unitID] = nil end @@ -2276,73 +2254,71 @@ if gadgetHandler:IsSyncedCode() then GiveOrderToUnit(unitID, CMD.STOP, {}, {}) if defID and config.scavBehaviours.HEALER[defID] then if mRandom() < 0.75 then - GiveOrderToUnit(unitID, CMD.RESURRECT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + GiveOrderToUnit(unitID, CMD.RESURRECT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end if mRandom() < 0.75 then - GiveOrderToUnit(unitID, CMD.CAPTURE, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + GiveOrderToUnit(unitID, CMD.CAPTURE, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end if mRandom() < 0.75 then - GiveOrderToUnit(unitID, CMD.REPAIR, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + GiveOrderToUnit(unitID, CMD.REPAIR, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end - GiveOrderToUnit(unitID, CMD.RESURRECT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256), 20000} , {"shift"}) + GiveOrderToUnit(unitID, CMD.RESURRECT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256), 20000 }, { "shift" }) end if config.scavBehaviours.ALWAYSMOVE[defID] then - GiveOrderToUnit(unitID, CMD.MOVE, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) + GiveOrderToUnit(unitID, CMD.MOVE, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) elseif config.scavBehaviours.ALWAYSFIGHT[defID] then - GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) - elseif mRandom() <= 0.5 and ( - config.scavBehaviours.SKIRMISH[defID] or - config.scavBehaviours.COWARD[defID] or - config.scavBehaviours.HEALER[defID] or - config.scavBehaviours.ARTILLERY[defID]) then - GiveOrderToUnit(unitID, CMD.FIGHT, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift", "meta"}) + GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) + elseif mRandom() <= 0.5 and (config.scavBehaviours.SKIRMISH[defID] or config.scavBehaviours.COWARD[defID] or config.scavBehaviours.HEALER[defID] or config.scavBehaviours.ARTILLERY[defID]) then + GiveOrderToUnit(unitID, CMD.FIGHT, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift", "meta" }) else - GiveOrderToUnit(unitID, CMD.MOVE, {pos.x+mRandom(-256, 256), pos.y, pos.z+mRandom(-256, 256)} , {"shift"}) + GiveOrderToUnit(unitID, CMD.MOVE, { pos.x + mRandom(-256, 256), pos.y, pos.z + mRandom(-256, 256) }, { "shift" }) end end end end end - if n%7 == 2 then - if not captureRuns then captureRuns = 0 end - captureRuns = (captureRuns + 1)%4 + if n % 7 == 2 then + if not captureRuns then + captureRuns = 0 + end + captureRuns = (captureRuns + 1) % 4 for unitID, _ in pairs(capturableUnits) do - if unitID%4 == captureRuns then + if unitID % 4 == captureRuns then local ux, uy, uz = GetUnitPosition(unitID) local health, maxHealth, _, captureLevel = GetUnitHealth(unitID) if health then - local captureProgress = 0.016667 * (3/math.ceil(math.sqrt(math.sqrt(UnitDefs[GetUnitDefID(unitID)].health)))) * math.max(0.1, (techAnger/100)) -- really wack formula that i really don't want to explain. + local captureProgress = 0.016667 * (3 / math.ceil(math.sqrt(math.sqrt(UnitDefs[GetUnitDefID(unitID)].health)))) * math.max(0.1, (techAnger / 100)) -- really wack formula that i really don't want to explain. if health < maxHealth then - captureProgress = captureProgress/math.max(0.000001, (health/maxHealth)^3) + captureProgress = captureProgress / math.max(0.000001, (health / maxHealth) ^ 3) end captureProgress = math.min(0.05, captureProgress) if Spring.GetUnitTeam(unitID) ~= scavTeamID and GG.IsPosInRaptorScum(ux, uy, uz) then - if captureLevel+captureProgress >= 0.99 then - SpawnCEG("scavmist", ux, uy+100, uz, 0,0,0) - SpawnCEG("scavradiation", ux, uy+100, uz, 0,0,0) + if captureLevel + captureProgress >= 0.99 then + SpawnCEG("scavmist", ux, uy + 100, uz, 0, 0, 0) + SpawnCEG("scavradiation", ux, uy + 100, uz, 0, 0, 0) if GG.SpawnEnvironmentalLightning then - GG.SpawnEnvironmentalLightning("scavradiation", ux, uy+100, uz) + GG.SpawnEnvironmentalLightning("scavradiation", ux, uy + 100, uz) else - SpawnCEG("scavradiation-lightning", ux, uy+100, uz, 0,0,0) + SpawnCEG("scavradiation-lightning", ux, uy + 100, uz, 0, 0, 0) end -- UnitGiven may destroy and replace this unit with a _scav variant TransferUnit(unitID, scavTeamID, false) if ValidUnitID(unitID) then - SetUnitHealth(unitID, {capture = 0.95}) - SetUnitHealth(unitID, {health = maxHealth}) + SetUnitHealth(unitID, { capture = 0.95 }) + SetUnitHealth(unitID, { health = maxHealth }) SendToUnsynced("unitCaptureFrame", unitID, 0.95) GG.ScavengersSpawnEffectUnitID(unitID) GG.addUnitToCaptureDecay(unitID) end else - SetUnitHealth(unitID, {capture = math.min(captureLevel+captureProgress, 1)}) - SendToUnsynced("unitCaptureFrame", unitID, math.min(captureLevel+captureProgress, 1)) - SpawnCEG("scaspawn-trail", ux, uy, uz, 0,0,0) + SetUnitHealth(unitID, { capture = math.min(captureLevel + captureProgress, 1) }) + SendToUnsynced("unitCaptureFrame", unitID, math.min(captureLevel + captureProgress, 1)) + SpawnCEG("scaspawn-trail", ux, uy, uz, 0, 0, 0) GG.ScavengersSpawnEffectUnitID(unitID) if mRandom() <= 0.1 then - SpawnCEG("scavmist", ux, uy+100, uz, 0,0,0) + SpawnCEG("scavmist", ux, uy + 100, uz, 0, 0, 0) end GG.addUnitToCaptureDecay(unitID) end @@ -2357,7 +2333,6 @@ if gadgetHandler:IsSyncedCode() then end function gadget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) - if oldTeam == scavTeamID then if unitSquadTable[unitID] then for index, id in ipairs(squadsTable[unitSquadTable[unitID]].squadUnits) do @@ -2380,28 +2355,28 @@ if gadgetHandler:IsSyncedCode() then end end - local x,y,z = GetUnitPosition(unitID) + local x, y, z = GetUnitPosition(unitID) if not UnitDefs[unitDefID].customParams.isscavenger then --Spring.Echo(UnitDefs[unitDefID].name, "unit captured swap", UnitDefs[unitDefID].customParams.scav_swap_override_captured) if not UnitDefs[unitDefID].customParams.scav_swap_override_captured then if UnitDefs[unitDefID] and UnitDefs[unitDefID].name and UnitDefNames[UnitDefs[unitDefID].name .. "_scav"] then - createUnitQueue[#createUnitQueue+1] = {UnitDefs[unitDefID].name .. "_scav", x, y, z, GetUnitBuildFacing(unitID) or 0, scavTeamID} + createUnitQueue[#createUnitQueue + 1] = { UnitDefs[unitDefID].name .. "_scav", x, y, z, GetUnitBuildFacing(unitID) or 0, scavTeamID } DestroyUnit(unitID, true, true) end elseif UnitDefs[unitDefID].customParams.scav_swap_override_captured == "delete" then DestroyUnit(unitID, true, true) elseif UnitDefs[unitDefID].customParams.scav_swap_override_captured ~= "null" then if UnitDefNames[UnitDefs[unitDefID].customParams.scav_swap_override_captured] then - createUnitQueue[#createUnitQueue+1] = {UnitDefs[unitDefID].customParams.scav_swap_override_captured, x, y, z, GetUnitBuildFacing(unitID) or 0, scavTeamID} + createUnitQueue[#createUnitQueue + 1] = { UnitDefs[unitDefID].customParams.scav_swap_override_captured, x, y, z, GetUnitBuildFacing(unitID) or 0, scavTeamID } end DestroyUnit(unitID, true, true) end return else - GiveOrderToUnit(unitID,CMD.FIRE_STATE,{config.defaultScavFirestate},0) + GiveOrderToUnit(unitID, CMD.FIRE_STATE, { config.defaultScavFirestate }, 0) GG.ScavengersSpawnEffectUnitID(unitID) if UnitDefs[unitDefID].canCloak then - GiveOrderToUnit(unitID,37382,{1},0) + GiveOrderToUnit(unitID, 37382, { 1 }, 0) end if squadSpawnOptions.commanders[UnitDefs[unitDefID].name] then CommandersPopulation = CommandersPopulation + 1 @@ -2468,7 +2443,7 @@ if gadgetHandler:IsSyncedCode() then if bossIDs[unitID] then nKilledBosses = nKilledBosses + 1 bossIDs[unitID] = nil - table.mergeInPlace(bosses.statuses, {[tostring(unitID)] = {isDead = true, health = 0}}) + table.mergeInPlace(bosses.statuses, { [tostring(unitID)] = { isDead = true, health = 0 } }) SetGameRulesParam("scavBossesKilled", nKilledBosses) if nKilledBosses >= nTotalBosses then @@ -2515,11 +2490,10 @@ if gadgetHandler:IsSyncedCode() then end if burrows[unitID] and not gameOver then - burrows[unitID] = nil if attackerID and Spring.GetUnitTeam(attackerID) ~= scavTeamID then - playerAggression = playerAggression + (config.angerBonus/config.scavSpawnMultiplier) - config.maxXP = config.maxXP*1.01 + playerAggression = playerAggression + (config.angerBonus / config.scavSpawnMultiplier) + config.maxXP = config.maxXP * 1.01 end for i, defs in pairs(spawnQueue) do @@ -2529,14 +2503,14 @@ if gadgetHandler:IsSyncedCode() then end SetGameRulesParam("scav_hiveCount", SetCount(burrows)) - -- elseif unitTeam == scavTeamID and UnitDefs[unitDefID].isBuilding and (attackerID and Spring.GetUnitTeam(attackerID) ~= scavTeamID) then - -- playerAggression = playerAggression + ((config.angerBonus/config.scavSpawnMultiplier)*0.01) + -- elseif unitTeam == scavTeamID and UnitDefs[unitDefID].isBuilding and (attackerID and Spring.GetUnitTeam(attackerID) ~= scavTeamID) then + -- playerAggression = playerAggression + ((config.angerBonus/config.scavSpawnMultiplier)*0.01) end if unitTeleportCooldown[unitID] then unitTeleportCooldown[unitID] = nil end if unitTeam ~= scavTeamID and config.ecoBuildingsPenalty[unitDefID] then - playerAggressionEcoValue = playerAggressionEcoValue - (config.ecoBuildingsPenalty[unitDefID]/(config.bossTime/3600)) -- scale to 60minutes = 3600seconds boss time + playerAggressionEcoValue = playerAggressionEcoValue - (config.ecoBuildingsPenalty[unitDefID] / (config.bossTime / 3600)) -- scale to 60minutes = 3600seconds boss time end end @@ -2556,11 +2530,11 @@ if gadgetHandler:IsSyncedCode() then end --function gadget:FeatureCreated(featureID, featureAllyTeamID) --- + -- --end --- + -- --function gadget:FeatureDestroyed(featureID, featureAllyTeamID) --- + -- --end function gadget:GameOver() @@ -2577,9 +2551,7 @@ if gadgetHandler:IsSyncedCode() then -- return true -- end -- end - -else -- UNSYNCED - +else -- UNSYNCED local hasScavEvent = false function HasScavEvent(ce) @@ -2603,12 +2575,11 @@ else -- UNSYNCED end function gadget:Initialize() - gadgetHandler:AddSyncAction('ScavEvent', WrapToLuaUI) + gadgetHandler:AddSyncAction("ScavEvent", WrapToLuaUI) gadgetHandler:AddChatAction("HasScavEvent", HasScavEvent, "toggles hasScavEvent setting") end function gadget:Shutdown() gadgetHandler:RemoveChatAction("HasScavEvent") end - end diff --git a/luarules/gadgets/sfx_notifications.lua b/luarules/gadgets/sfx_notifications.lua index ef0c1cd710f..dd7141c2dca 100644 --- a/luarules/gadgets/sfx_notifications.lua +++ b/luarules/gadgets/sfx_notifications.lua @@ -1,29 +1,29 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Notifications", - desc = "Plays various voice notifications", - author = "Doo, Floris", - date = "2018", - license = "GNU GPL, v2 or later", - version = 1, - layer = 5, - enabled = true - } + return { + name = "Notifications", + desc = "Plays various voice notifications", + author = "Doo, Floris", + date = "2018", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = true, + } end local spGetPlayerInfo = Spring.GetPlayerInfo local function GetAllyTeamID(teamID) - return select(6,Spring.GetTeamInfo(teamID,false)) + return select(6, Spring.GetTeamInfo(teamID, false)) end local function PlayersInAllyTeamID(allyTeamID) local players = Spring.GetPlayerList() - local _,_,spec,_,allyTeam + local _, _, spec, _, allyTeam for ct, id in pairs(players) do - _,_,spec,_,allyTeam = spGetPlayerInfo(id,false) + _, _, spec, _, allyTeam = spGetPlayerInfo(id, false) if not spec and allyTeam ~= allyTeamID then players[ct] = nil end @@ -33,9 +33,9 @@ end local function AllButAllyTeamID(allyTeamID) local players = Spring.GetPlayerList() - local _,_,spec,_,allyTeam + local _, _, spec, _, allyTeam for ct, id in pairs(players) do - _,_,spec,_,allyTeam = spGetPlayerInfo(id,false) + _, _, spec, _, allyTeam = spGetPlayerInfo(id, false) if not spec and allyTeam == allyTeamID then players[ct] = nil end @@ -45,9 +45,9 @@ end local function AlliedPlayersExceptTeamID(allyTeamID, excludedTeamID) local players = Spring.GetPlayerList() - local _,_,spec,teamID,allyTeam + local _, _, spec, teamID, allyTeam for ct, id in pairs(players) do - _,_,spec,teamID,allyTeam = spGetPlayerInfo(id,false) + _, _, spec, teamID, allyTeam = spGetPlayerInfo(id, false) if not spec and (allyTeam ~= allyTeamID or teamID == excludedTeamID) then players[ct] = nil end @@ -56,11 +56,10 @@ local function AlliedPlayersExceptTeamID(allyTeamID, excludedTeamID) end if gadgetHandler:IsSyncedCode() then - local isT2Mex = {} for unitDefID, unitDef in pairs(UnitDefs) do -- not critter/raptor/object - if not string.find(unitDef.name, 'critter') and not string.find(unitDef.name, 'raptor') and (not unitDef.modCategories or not unitDef.modCategories.object) then + if not string.find(unitDef.name, "critter") and not string.find(unitDef.name, "raptor") and (not unitDef.modCategories or not unitDef.modCategories.object) then if unitDef.extractsMetal >= 0.004 then isT2Mex[unitDefID] = unitDef.extractsMetal end @@ -74,20 +73,20 @@ if gadgetHandler:IsSyncedCode() then end function gadget:Initialize() - for k,v in pairs(nukeWeapons) do + for k, v in pairs(nukeWeapons) do Script.SetWatchProjectile(k, true) end end -- UNITS RECEIVED send to all in team function gadget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) - if not _G.transferredUnits or not _G.transferredUnits[unitID] then -- exclude upgraded units (t2 mex/geo) because allied players could have done this + if not _G.transferredUnits or not _G.transferredUnits[unitID] then -- exclude upgraded units (t2 mex/geo) because allied players could have done this local players = Spring.GetPlayerList(newTeam) - for ct, player in pairs (players) do + for ct, player in pairs(players) do if tostring(player) then if GetAllyTeamID(newTeam) == GetAllyTeamID(oldTeam) then -- We got it from a teammate GG["notifications"].queueNotification("UnitsReceived", "playerID", tostring(player)) - else -- We got it from an enemy + else -- We got it from an enemy GG["notifications"].queueNotification("UnitsCaptured", "playerID", tostring(player)) end end @@ -105,14 +104,14 @@ if gadgetHandler:IsSyncedCode() then local ownerAllyTeamID = GetAllyTeamID(ownerTeamID) local players = AllButAllyTeamID(ownerAllyTeamID) - for ct, player in pairs (players) do + for ct, player in pairs(players) do if tostring(player) then GG["notifications"].queueNotification("NukeLaunched", "playerID", tostring(player)) end end local players = AlliedPlayersExceptTeamID(ownerAllyTeamID, ownerTeamID) - for ct, player in pairs (players) do + for ct, player in pairs(players) do if tostring(player) then GG["notifications"].queueNotification("AlliedNukeLaunched", "playerID", tostring(player)) end @@ -120,13 +119,12 @@ if gadgetHandler:IsSyncedCode() then end end - function gadget:UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unitDefID) local event = "UnitDetected/StealthyUnitsDetected" local players = Spring.GetPlayerList() local unitAllyTeam = Spring.GetUnitAllyTeam(unitID) local _, _, spec, _, playerAllyTeam - for ct, playerID in pairs (players) do + for ct, playerID in pairs(players) do if tostring(playerID) then _, _, spec, _, playerAllyTeam = spGetPlayerInfo(playerID, false) if not spec and playerAllyTeam == allyTeam and unitAllyTeam ~= playerAllyTeam then @@ -135,10 +133,8 @@ if gadgetHandler:IsSyncedCode() then end end end - else - - local enableLastcomNotif = (Spring.GetModOptions().deathmode == 'com') + local enableLastcomNotif = (Spring.GetModOptions().deathmode == "com") local isCommander = {} local isRadar = {} @@ -152,12 +148,12 @@ else local isDefenseTurret = {} for unitDefID, unitDef in pairs(UnitDefs) do -- not critter/raptor/object - if not string.find(unitDef.name, 'critter') and not string.find(unitDef.name, 'raptor') and (not unitDef.modCategories or not unitDef.modCategories.object) then + if not string.find(unitDef.name, "critter") and not string.find(unitDef.name, "raptor") and (not unitDef.modCategories or not unitDef.modCategories.object) then isBuilding[unitDefID] = unitDef.isBuilding or unitDef.isFactory if unitDef.customParams.iscommander or unitDef.customParams.isscavcommander then isCommander[unitDefID] = true end - if string.find(unitDef.name,'corint') or string.find(unitDef.name,'armbrtha') or string.find(unitDef.name,'corbuzz') or string.find(unitDef.name,'armvulc') or string.find(unitDef.name,'legstarfall') then + if string.find(unitDef.name, "corint") or string.find(unitDef.name, "armbrtha") or string.find(unitDef.name, "corbuzz") or string.find(unitDef.name, "armvulc") or string.find(unitDef.name, "legstarfall") then isLrpc[unitDefID] = true end if unitDef.isBuilding and unitDef.radarDistance > 1900 then @@ -202,10 +198,10 @@ else local myAllyTeamList = Spring.GetTeamList(myAllyTeamID) for _, teamID in ipairs(myAllyTeamList) do numTeams = numTeams + 1 - if select(4,Spring.GetTeamInfo(teamID,false)) then -- is AI? + if select(4, Spring.GetTeamInfo(teamID, false)) then -- is AI? local luaAI = Spring.GetTeamLuaAI(teamID) if luaAI and luaAI ~= "" then - if string.find(luaAI, 'Scavengers') or string.find(luaAI, 'Raptors') then + if string.find(luaAI, "Scavengers") or string.find(luaAI, "Raptors") then playingAsHorde = true end end @@ -220,43 +216,41 @@ else return end if unitTeam == myTeamID and isLrpc[attackerDefID] and attackerTeam and GetAllyTeamID(attackerTeam) ~= myAllyTeamID then - GG["notifications"].queueNotification('LrpcTargetUnits', "playerID", tostring(myPlayerID)) + GG["notifications"].queueNotification("LrpcTargetUnits", "playerID", tostring(myPlayerID)) end if isCommander[unitDefID] then commanderLastDamaged[unitID] = Spring.GetGameFrame() end - if unitTeam == myTeamID and attackerTeam and GetAllyTeamID(attackerTeam) ~= myAllyTeamID and (not isObjectified[unitDefID]) then + if unitTeam == myTeamID and attackerTeam and GetAllyTeamID(attackerTeam) ~= myAllyTeamID and not isObjectified[unitDefID] then if isCommander[unitDefID] then local health, maxhealth = Spring.GetUnitHealth(unitID) - local healthPercent = health/maxhealth + local healthPercent = health / maxhealth if healthPercent < 0.2 then - GG["notifications"].queueNotification('ComHeavyDamage', "playerID", tostring(myPlayerID)) + GG["notifications"].queueNotification("ComHeavyDamage", "playerID", tostring(myPlayerID)) else - GG["notifications"].queueNotification('CommanderUnderAttack', "playerID", tostring(myPlayerID)) + GG["notifications"].queueNotification("CommanderUnderAttack", "playerID", tostring(myPlayerID)) end elseif isFactory[unitDefID] then - GG["notifications"].queueNotification('FactoryUnderAttack', "playerID", tostring(myPlayerID)) - elseif isBuilding[unitDefID] == true and (not isMex[unitDefID]) and (isEconomy[unitDefID]) then - GG["notifications"].queueNotification('EconomyUnderAttack', "playerID", tostring(myPlayerID)) - elseif isBuilding[unitDefID] == true and (not isMex[unitDefID]) and isDefenseTurret[unitDefID] then - GG["notifications"].queueNotification('DefenseUnderAttack', "playerID", tostring(myPlayerID)) + GG["notifications"].queueNotification("FactoryUnderAttack", "playerID", tostring(myPlayerID)) + elseif isBuilding[unitDefID] == true and not isMex[unitDefID] and isEconomy[unitDefID] then + GG["notifications"].queueNotification("EconomyUnderAttack", "playerID", tostring(myPlayerID)) + elseif isBuilding[unitDefID] == true and not isMex[unitDefID] and isDefenseTurret[unitDefID] then + GG["notifications"].queueNotification("DefenseUnderAttack", "playerID", tostring(myPlayerID)) else - GG["notifications"].queueNotification('UnitsUnderAttack', "playerID", tostring(myPlayerID)) + GG["notifications"].queueNotification("UnitsUnderAttack", "playerID", tostring(myPlayerID)) end end end - function gadget:GameFrame(frame) - - end + function gadget:GameFrame(frame) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) --local unitInView = Spring.IsUnitInView(unitID) -- if own and not killed by yourself - if not isSpec and unitTeam == myTeamID and attackerTeam and attackerTeam ~= unitTeam and (not isObjectified[unitDefID]) then -- and not unitInView + if not isSpec and unitTeam == myTeamID and attackerTeam and attackerTeam ~= unitTeam and not isObjectified[unitDefID] then -- and not unitInView if isRadar[unitDefID] then - local event = isRadar[unitDefID] > 2800 and 'AdvRadarLost' or 'RadarLost' + local event = isRadar[unitDefID] > 2800 and "AdvRadarLost" or "RadarLost" GG["notifications"].queueNotification(event, "playerID", tostring(myPlayerID)) return end @@ -276,12 +270,12 @@ else local myAllyTeamList = Spring.GetTeamList(myAllyTeamID) for _, teamID in ipairs(myAllyTeamList) do if unitTeam == teamID then - allyComCount = allyComCount - 1 -- current com death has not been subtracted from GetTeamUnitDefCount yet, so we do this manually + allyComCount = allyComCount - 1 -- current com death has not been subtracted from GetTeamUnitDefCount yet, so we do this manually if unitTeam == myTeamID then myComCount = myComCount - 1 end end - for unitDefID,_ in pairs(isCommander) do + for unitDefID, _ in pairs(isCommander) do local comCount = Spring.GetTeamUnitDefCount(teamID, unitDefID) allyComCount = allyComCount + comCount if teamID == myTeamID and comCount > 0 then @@ -291,17 +285,16 @@ else end if (not isSpec) and (unitTeam ~= myTeamID) then if numTeams > 1 and not playingAsHorde then - local players = PlayersInAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) - for ct, player in pairs (players) do + local players = PlayersInAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) + for ct, player in pairs(players) do if tostring(player) then --if not unitInView then - if Spring.GetUnitRulesParam(unitID, "unit_evolved") then - - elseif not attackerTeam and select(6, Spring.GetTeamInfo(unitTeam, false)) == myAllyTeamID and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID]+150 < Spring.GetGameFrame()) then - GG["notifications"].queueNotification("FriendlyCommanderSelfD", "playerID", tostring(player)) - else - GG["notifications"].queueNotification("FriendlyCommanderDied", "playerID", tostring(player)) - end + if Spring.GetUnitRulesParam(unitID, "unit_evolved") then + elseif not attackerTeam and select(6, Spring.GetTeamInfo(unitTeam, false)) == myAllyTeamID and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID] + 150 < Spring.GetGameFrame()) then + GG["notifications"].queueNotification("FriendlyCommanderSelfD", "playerID", tostring(player)) + else + GG["notifications"].queueNotification("FriendlyCommanderDied", "playerID", tostring(player)) + end --end if enableLastcomNotif and allyComCount == 1 then if myComCount == 1 then @@ -314,19 +307,19 @@ else end end --if not unitInView then - local players = AllButAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) - for ct, player in pairs (players) do - if tostring(player) and not Spring.GetUnitRulesParam(unitID, "unit_evolved") then - GG["notifications"].queueNotification("EnemyCommanderDied", "playerID", tostring(player)) - end + local players = AllButAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) + for ct, player in pairs(players) do + if tostring(player) and not Spring.GetUnitRulesParam(unitID, "unit_evolved") then + GG["notifications"].queueNotification("EnemyCommanderDied", "playerID", tostring(player)) end + end --end else local players = PlayersInAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) - for ct, player in pairs (players) do + for ct, player in pairs(players) do if tostring(player) then if Spring.GetUnitRulesParam(unitID, "unit_evolved") then - elseif not attackerTeam and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID]+150 < Spring.GetGameFrame()) then + elseif not attackerTeam and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID] + 150 < Spring.GetGameFrame()) then GG["notifications"].queueNotification("NeutralCommanderSelfD", "playerID", tostring(player), true) else GG["notifications"].queueNotification("NeutralCommanderDied", "playerID", tostring(player), true) @@ -334,10 +327,10 @@ else end end local players = AllButAllyTeamID(GetAllyTeamID(Spring.GetUnitTeam(unitID))) - for ct, player in pairs (players) do + for ct, player in pairs(players) do if tostring(player) then if Spring.GetUnitRulesParam(unitID, "unit_evolved") then - elseif not attackerTeam and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID]+150 < Spring.GetGameFrame()) then + elseif not attackerTeam and (not commanderLastDamaged[unitID] or commanderLastDamaged[unitID] + 150 < Spring.GetGameFrame()) then GG["notifications"].queueNotification("NeutralCommanderSelfD", "playerID", tostring(player), true) else GG["notifications"].queueNotification("NeutralCommanderDied", "playerID", tostring(player), true) diff --git a/luarules/gadgets/sfx_notifications_broadcaster.lua b/luarules/gadgets/sfx_notifications_broadcaster.lua index 6ce48ae921a..f3da5a94215 100644 --- a/luarules/gadgets/sfx_notifications_broadcaster.lua +++ b/luarules/gadgets/sfx_notifications_broadcaster.lua @@ -1,23 +1,23 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Notifications Broadcaster", - desc = "Plays various voice notifications", - author = "Damgam, Floris", - date = "2025", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true - } + return { + name = "Notifications Broadcaster", + desc = "Plays various voice notifications", + author = "Damgam, Floris", + date = "2025", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - function gadget:Initialize() + function gadget:Initialize() gadgetHandler:AddSyncAction("NotificationEvent", BroadcastEvent) end - function BroadcastEvent(_,event, player, forceplay) + function BroadcastEvent(_, event, player, forceplay) if Script.LuaUI("NotificationEvent") and (forceplay or (tonumber(player) and ((tonumber(player) == Spring.GetMyPlayerID()) or Spring.GetSpectatingState()))) then if forceplay then forceplay = " y" @@ -34,43 +34,45 @@ GG["notifications"] = {} ---@param idtype "playerID"|"teamID"|"allyTeamID"|nil Type of ID to target: "playerID" for specific player, "teamID" for all players on a team, "allyTeamID" for all players in an ally team, nil to send it to everyone. ---@param id number|string|nil PlayerID, TeamID, or AllyTeamID (converted to number internally) ---@param forceplay boolean|nil If true, skips spectator check and allows playing in pregame -GG["notifications"].queueNotification = function(event, idtype, id, forceplay) - local playerIDs = {} - if not id then id = -1 end - id = tonumber(id) +GG["notifications"].queueNotification = function(event, idtype, id, forceplay) + local playerIDs = {} + if not id then + id = -1 + end + id = tonumber(id) - if idtype == "playerID" then - playerIDs[#playerIDs+1] = id - elseif idtype == "teamID" then - local playerList = Spring.GetPlayerList(id) - for i = 1,#playerList do - playerIDs[#playerIDs+1] = playerList[i] - end - elseif idtype == "allyTeamID" then - local teamList = Spring.GetTeamList(id) - for i = 1,#teamList do - local playerList = Spring.GetPlayerList(teamList[i]) - for j = 1,#playerList do - playerIDs[#playerIDs+1] = playerList[j] - end - end - else - local teamList = Spring.GetTeamList() - for i = 1,#teamList do - local playerList = Spring.GetPlayerList(teamList[i]) - for j = 1,#playerList do - playerIDs[#playerIDs+1] = playerList[j] - end - end - end + if idtype == "playerID" then + playerIDs[#playerIDs + 1] = id + elseif idtype == "teamID" then + local playerList = Spring.GetPlayerList(id) + for i = 1, #playerList do + playerIDs[#playerIDs + 1] = playerList[i] + end + elseif idtype == "allyTeamID" then + local teamList = Spring.GetTeamList(id) + for i = 1, #teamList do + local playerList = Spring.GetPlayerList(teamList[i]) + for j = 1, #playerList do + playerIDs[#playerIDs + 1] = playerList[j] + end + end + else + local teamList = Spring.GetTeamList() + for i = 1, #teamList do + local playerList = Spring.GetPlayerList(teamList[i]) + for j = 1, #playerList do + playerIDs[#playerIDs + 1] = playerList[j] + end + end + end - if #playerIDs > 0 then - for i = 1,#playerIDs do - if gadgetHandler:IsSyncedCode() then - SendToUnsynced("NotificationEvent", event, tostring(playerIDs[i]), forceplay) - else - BroadcastEvent("NotificationEvent", event, tostring(playerIDs[i]), forceplay) - end - end - end -end \ No newline at end of file + if #playerIDs > 0 then + for i = 1, #playerIDs do + if gadgetHandler:IsSyncedCode() then + SendToUnsynced("NotificationEvent", event, tostring(playerIDs[i]), forceplay) + else + BroadcastEvent("NotificationEvent", event, tostring(playerIDs[i]), forceplay) + end + end + end +end diff --git a/luarules/gadgets/snd_battle_volume_controller.lua b/luarules/gadgets/snd_battle_volume_controller.lua index 3db5a982fd3..86a7f9b1d13 100644 --- a/luarules/gadgets/snd_battle_volume_controller.lua +++ b/luarules/gadgets/snd_battle_volume_controller.lua @@ -1,16 +1,16 @@ function gadget:GetInfo() - return { - name = "Battle Volume Controller", - desc = "Controls Volume of Battle sounds based on camera zoom", - author = "Damgam", - date = "2025", - layer = 5, - enabled = true -- loaded by default? - } + return { + name = "Battle Volume Controller", + desc = "Controls Volume of Battle sounds based on camera zoom", + author = "Damgam", + date = "2025", + layer = 5, + enabled = true, -- loaded by default? + } end if gadgetHandler:IsSyncedCode() then - return false + return false end local math_clamp = math.clamp @@ -31,50 +31,52 @@ local cameraHeight = 0 local unitDamagedScale = 1 function gadget:Update(dt) - timer = timer + dt - if timer > 0.2 then - timer = 0 - local camera = spGetCameraState() - if camera.name == "spring" then - cameraHeight = camera.dist - elseif camera.name == "ta" then - cameraHeight = camera.height - elseif camera.name == "rot" or camera.name == "fps" or camera.name == "free" then - cameraHeight = camera.py - end - cameraHeight = (cameraHeight/2) * spGetConfigFloat("snd_zoomVolume", 1.00) - VolumeSetting = spGetConfigInt("snd_volbattle_options", 100) + timer = timer + dt + if timer > 0.2 then + timer = 0 + local camera = spGetCameraState() + if camera.name == "spring" then + cameraHeight = camera.dist + elseif camera.name == "ta" then + cameraHeight = camera.height + elseif camera.name == "rot" or camera.name == "fps" or camera.name == "free" then + cameraHeight = camera.py + end + cameraHeight = (cameraHeight / 2) * spGetConfigFloat("snd_zoomVolume", 1.00) + VolumeSetting = spGetConfigInt("snd_volbattle_options", 100) - local cameraScale = math_clamp((100-math_sqrt(cameraHeight)), 3, 100)/100 + local cameraScale = math_clamp((100 - math_sqrt(cameraHeight)), 3, 100) / 100 - VolumeTarget = math_round(math_clamp(VolumeSetting * cameraScale * unitDamagedScale, 1, 100)) - if VolumeTarget ~= PreviousVolumeTarget then - spSetConfigInt("snd_volbattle", VolumeTarget) - PreviousVolumeTarget = VolumeTarget - end - end + VolumeTarget = math_round(math_clamp(VolumeSetting * cameraScale * unitDamagedScale, 1, 100)) + if VolumeTarget ~= PreviousVolumeTarget then + spSetConfigInt("snd_volbattle", VolumeTarget) + PreviousVolumeTarget = VolumeTarget + end + end - if unitDamagedScale < 1 then - unitDamagedScale = math_clamp(unitDamagedScale + dt*(0.1-(unitDamagedScale*0.1)), 0.4, 1) - if unitDamagedScale > 0.9999 then unitDamagedScale = 1 end - end + if unitDamagedScale < 1 then + unitDamagedScale = math_clamp(unitDamagedScale + dt * (0.1 - (unitDamagedScale * 0.1)), 0.4, 1) + if unitDamagedScale > 0.9999 then + unitDamagedScale = 1 + end + end end function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) - if paralyzer or damage <= 0 or unitDamagedScale <= 0.4 then - return - end + if paralyzer or damage <= 0 or unitDamagedScale <= 0.4 then + return + end - if spIsUnitInView(unitID) then - -- collapse cascading thresholds into a single multiplier - local mult = 0.9995 - if damage > 100000 then - mult = 0.9995 * 0.9995 * 0.9995 * 0.9995 -- ~0.998 - elseif damage > 10000 then - mult = 0.9995 * 0.9995 * 0.9995 -- ~0.9985 - elseif damage > 1000 then - mult = 0.9995 * 0.9995 -- ~0.999 - end - unitDamagedScale = unitDamagedScale * mult - end + if spIsUnitInView(unitID) then + -- collapse cascading thresholds into a single multiplier + local mult = 0.9995 + if damage > 100000 then + mult = 0.9995 * 0.9995 * 0.9995 * 0.9995 -- ~0.998 + elseif damage > 10000 then + mult = 0.9995 * 0.9995 * 0.9995 -- ~0.9985 + elseif damage > 1000 then + mult = 0.9995 * 0.9995 -- ~0.999 + end + unitDamagedScale = unitDamagedScale * mult + end end diff --git a/luarules/gadgets/system_info.lua b/luarules/gadgets/system_info.lua index eb30a319462..edf261223c8 100644 --- a/luarules/gadgets/system_info.lua +++ b/luarules/gadgets/system_info.lua @@ -1,20 +1,18 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "System info", - desc = "", - author = "Floris", - date = "July,2016", + name = "System info", + desc = "", + author = "Floris", + date = "July,2016", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end if gadgetHandler:IsSyncedCode() then - local validation = string.randomString(2) _G.validationSys = validation @@ -23,16 +21,18 @@ if gadgetHandler:IsSyncedCode() then local vb1, vb2 = string.byte(validation, 1, 2) function gadget:RecvLuaMsg(msg, playerID) - if #msg < 5 then return end + if #msg < 5 then + return + end local b1, b2, b3, b4, b5 = string.byte(msg, 1, 5) - if b1 ~= sy1 or b2 ~= sy2 or b3 ~= sy3 or b4 ~= vb1 or b5 ~= vb2 then return end - SendToUnsynced("systemBroadcast",playerID,msg:sub(6)) + if b1 ~= sy1 or b2 ~= sy2 or b3 ~= sy3 or b4 ~= vb1 or b5 ~= vb2 then + return + end + SendToUnsynced("systemBroadcast", playerID, msg:sub(6)) return true end - else - - local chobbyLoaded = (Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil) + local chobbyLoaded = (Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") ~= nil) local SendLuaRulesMsg = Spring.SendLuaRulesMsg local systems = {} @@ -46,20 +46,23 @@ else return perms and (perms[acID] or (myPlayerName and perms[myPlayerName])) end - local function handleSystemEvent(_,playerID,system) + local function handleSystemEvent(_, playerID, system) if isAuthorized() then if Script.LuaUI("SystemEvent") then if systems[playerID] == nil and system ~= nil then systems[playerID] = system end - Script.LuaUI.SystemEvent(playerID,systems[playerID]) + Script.LuaUI.SystemEvent(playerID, systems[playerID]) end end end local function lines(str) local t = {} - local function helper(line) table.insert(t, line) return "" end + local function helper(line) + table.insert(t, line) + return "" + end helper((str:gsub("(.-)\r?\n", helper))) return t end @@ -70,18 +73,13 @@ else function gadget:Initialize() gadgetHandler:AddSyncAction("systemBroadcast", handleSystemEvent) - Spring.Echo(string.format("infologVersionTags:engine=%s,game=%s,lobby=%s,map=%s", - Engine.version or "", - (Game.gameName or "") .. " " .. (Game.gameVersion or ""), - (VFS and VFS.GetNameFromRapidTag and VFS.GetNameFromRapidTag("byar-chobby:test") or ""), - Game.mapName or "" - )) + Spring.Echo(string.format("infologVersionTags:engine=%s,game=%s,lobby=%s,map=%s", Engine.version or "", (Game.gameName or "") .. " " .. (Game.gameVersion or ""), (VFS and VFS.GetNameFromRapidTag and VFS.GetNameFromRapidTag("byar-chobby:test") or ""), Game.mapName or "")) local myvalidation = validation local s_cpu, s_gpu, s_gpuVram, s_ram, s_os, s_resolution, s_displaymode, s_displays, s_config, s_configs_os, s_cpuCoresLogical, s_cpuCoresPhysical, ds, nl, configEnd - if Engine ~= nil and Platform ~= nil then -- v104 + if Engine ~= nil and Platform ~= nil then -- v104 if Platform.gpu ~= nil then s_gpu = Platform.gpu s_gpu = string.gsub(s_gpu, "/PCIe", "") @@ -89,26 +87,26 @@ else s_gpu = string.gsub(s_gpu, " Series", "") s_gpu = string.gsub(s_gpu, "%((.*)%)", "") s_gpu = string.gsub(s_gpu, "Gallium ([0-9].*) on ", "") - if Platform.gpuVendor == 'Nvidia' or Platform.gpuMemorySize and Platform.gpuMemorySize > 10 then - s_gpuVram = math.floor(Platform.gpuMemorySize/1000)..'MB' + if Platform.gpuVendor == "Nvidia" or Platform.gpuMemorySize and Platform.gpuMemorySize > 10 then + s_gpuVram = math.floor(Platform.gpuMemorySize / 1000) .. "MB" end end if Platform.osFamily ~= nil then s_os = Platform.osFamily if Platform.osVersion ~= nil then - s_os = s_os .. ' ' .. Platform.osVersion + s_os = s_os .. " " .. Platform.osVersion end end if Platform.hwConfig ~= nil then - s_cpu = string.match(Platform.hwConfig, '([%+a-zA-Z0-9 ()@._-]*)') + s_cpu = string.match(Platform.hwConfig, "([%+a-zA-Z0-9 ()@._-]*)") s_cpu = string.gsub(s_cpu, " Processor", "") s_cpu = string.gsub(s_cpu, " Eight[-]Core", "") s_cpu = string.gsub(s_cpu, " Six[-]Core", "") s_cpu = string.gsub(s_cpu, " Quad[-]Core", "") s_cpu = string.gsub(s_cpu, " CPU", "") s_cpu = string.gsub(s_cpu, "%((.*)%)", "") - s_ram = string.match(Platform.hwConfig, '([0-9]*MB RAM)') + s_ram = string.match(Platform.hwConfig, "([0-9]*MB RAM)") if s_ram ~= nil then s_ram = string.gsub(s_ram, " RAM", "") end @@ -117,72 +115,74 @@ else local maxheight = 0 local maxwidth = 0 for i, mode in pairs(Platform.availableVideoModes) do - if mode.h > maxheight then maxheight = mode.h end - if mode.w > maxwidth then maxwidth = mode.h end + if mode.h > maxheight then + maxheight = mode.h + end + if mode.w > maxwidth then + maxwidth = mode.h + end end - s_resolution = tostring(maxwidth) .. 'x' .. tostring(maxheight) + s_resolution = tostring(maxwidth) .. "x" .. tostring(maxheight) end end local infolog = VFS.LoadFile("infolog.txt") if infolog then - local fileLines = lines(infolog) for i, line in ipairs(fileLines) do - - if string.sub(line, 1, 3) == '[F=' then + if string.sub(line, 1, 3) == "[F=" then break end -- Spring v104 - if s_gpu ~= nil and string.match(line, 'current=%{[0-9]*x[0-9]*') then - s_resolution = string.sub(string.match(line, 'current=%{[0-9]*x[0-9]*'), 10) + if s_gpu ~= nil and string.match(line, "current=%{[0-9]*x[0-9]*") then + s_resolution = string.sub(string.match(line, "current=%{[0-9]*x[0-9]*"), 10) end - if line:find('(display%-mode set to )') then - s_displaymode = line:sub( line:find('(display%-mode set to )') + 20) - if s_displaymode:find('%(') then - local basepart = s_displaymode:sub(1, s_displaymode:find('%(')-1) - if s_displaymode:find('windowed::borderless') then - s_displaymode = basepart..'borderless' - elseif s_displaymode:find('windowed::decorated') then - s_displaymode = basepart..' windowed' - elseif s_displaymode:find('fullscreen::decorated') then - s_displaymode = basepart..' fullscreen' + if line:find("(display%-mode set to )") then + s_displaymode = line:sub(line:find("(display%-mode set to )") + 20) + if s_displaymode:find("%(") then + local basepart = s_displaymode:sub(1, s_displaymode:find("%(") - 1) + if s_displaymode:find("windowed::borderless") then + s_displaymode = basepart .. "borderless" + elseif s_displaymode:find("windowed::decorated") then + s_displaymode = basepart .. " windowed" + elseif s_displaymode:find("fullscreen::decorated") then + s_displaymode = basepart .. " fullscreen" end end end - if s_gpu == nil and string.find(line, '(Supported Video modes on Display )') then + if s_gpu == nil and string.find(line, "(Supported Video modes on Display )") then if s_displays == nil then - s_displays = '' - ds = '' + s_displays = "" + ds = "" end - s_displays = s_displays .. ds .. string.gsub(string.match(line, '([0-9].*)'), ':','') - ds = ' | ' + s_displays = s_displays .. ds .. string.gsub(string.match(line, "([0-9].*)"), ":", "") + ds = " | " end - if string.find(line, 'Physical CPU Cores') then - s_cpuCoresPhysical = string.match(string.sub(line, string.len(line)-10), '([0-9].*)') + if string.find(line, "Physical CPU Cores") then + s_cpuCoresPhysical = string.match(string.sub(line, string.len(line) - 10), "([0-9].*)") end - if string.find(line, 'Logical CPU Cores') then - s_cpuCoresLogical = string.match(string.sub(line, string.len(line)-10), '([0-9].*)') + if string.find(line, "Logical CPU Cores") then + s_cpuCoresLogical = string.match(string.sub(line, string.len(line) - 10), "([0-9].*)") end - if string.find(line:lower(), 'hardware config: ') then - s_cpu = string.sub(line, select(2, string.find(line:lower(), 'hardware config: '))) - s_cpu = string.match(s_cpu, '([%+a-zA-Z0-9 ()@._-]*)') + if string.find(line:lower(), "hardware config: ") then + s_cpu = string.sub(line, select(2, string.find(line:lower(), "hardware config: "))) + s_cpu = string.match(s_cpu, "([%+a-zA-Z0-9 ()@._-]*)") s_cpu = string.gsub(s_cpu, " Processor", "") s_cpu = string.gsub(s_cpu, " Eight[-]Core", "") s_cpu = string.gsub(s_cpu, " Six[-]Core", "") s_cpu = string.gsub(s_cpu, " Quad[-]Core", "") s_cpu = string.gsub(s_cpu, " CPU", "") s_cpu = string.gsub(s_cpu, "%((.*)%)", "") - s_ram = string.match(line, '([0-9]*MB RAM)') + s_ram = string.match(line, "([0-9]*MB RAM)") if s_ram ~= nil then s_ram = string.gsub(s_ram, " RAM", "") end end - if string.find(line:lower(), 'operating system: ') then - s_os = string.sub(line, select(2, string.find(line:lower(), 'operating system: '))) + if string.find(line:lower(), "operating system: ") then + s_os = string.sub(line, select(2, string.find(line:lower(), "operating system: "))) end --if s_os == nil and s_configs_os == nil and string.find(line, 'Operating System:') then @@ -190,75 +190,71 @@ else -- s_os = string.sub(line, 18 + charStart) --end - if s_config ~= nil and configEnd == nil and line == '============== ==============' then + if s_config ~= nil and configEnd == nil and line == "============== ==============" then configEnd = true end - if s_config ~= nil and configEnd == nil then - s_config = s_config..nl..line - nl = '\n' + if s_config ~= nil and configEnd == nil then + s_config = s_config .. nl .. line + nl = "\n" end - if s_config == nil and line == '============== ==============' then - s_config = '' - nl = '' + if s_config == nil and line == "============== ==============" then + s_config = "" + nl = "" end end end if s_os then - if string.find(s_os, 'Windows') then -- simplyfy, also for some privacy (hiding build number) + if string.find(s_os, "Windows") then -- simplyfy, also for some privacy (hiding build number) s_os = string.match(s_os, "(Windows [0-9.]*)") - elseif string.find(s_os, 'Linux') then -- simplyfy, also for some privacy (hiding build number) - s_os = 'Linux' + elseif string.find(s_os, "Linux") then -- simplyfy, also for some privacy (hiding build number) + s_os = "Linux" end end - local system = '' + local system = "" if s_cpu ~= nil then - system = system..'\nCPU: '..string.gsub(s_cpu, " ", " ") + system = system .. "\nCPU: " .. string.gsub(s_cpu, " ", " ") end if s_cpuCoresPhysical ~= nil then - system = system..'\nCPU cores: '..s_cpuCoresPhysical..' / '..s_cpuCoresLogical + system = system .. "\nCPU cores: " .. s_cpuCoresPhysical .. " / " .. s_cpuCoresLogical end if s_ram ~= nil then - system = system..'\nRAM: '..string.gsub(s_ram, " ", " ") + system = system .. "\nRAM: " .. string.gsub(s_ram, " ", " ") end if s_gpu ~= nil then - system = system..'\nGPU: '..string.gsub(s_gpu, " ", " ") + system = system .. "\nGPU: " .. string.gsub(s_gpu, " ", " ") end if s_gpuVram ~= nil then - system = system..'\nGPU VRAM: '..string.gsub(s_gpuVram, " ", " ") + system = system .. "\nGPU VRAM: " .. string.gsub(s_gpuVram, " ", " ") end if s_resolution ~= nil then - system = system..'\nDisplay max: '..string.gsub(s_resolution, " ", " ") + system = system .. "\nDisplay max: " .. string.gsub(s_resolution, " ", " ") end if s_displaymode ~= nil then - system = system..'\n'..s_displaymode + system = system .. "\n" .. s_displaymode end if s_os ~= nil then - system = system..'\nOS: '..s_os + system = system .. "\nOS: " .. s_os end if Platform and Platform.architecture then - system = system..'\nArchitecture: '..Platform.architecture + system = system .. "\nArchitecture: " .. Platform.architecture end if chobbyLoaded then - system = system..'\nLobby: Chobby' + system = system .. "\nLobby: Chobby" end system = string.sub(system, 2) - if system ~= '' then - SendLuaRulesMsg("$y$"..myvalidation..system) + if system ~= "" then + SendLuaRulesMsg("$y$" .. myvalidation .. system) end end function gadget:MapDrawCmd(playerID, cmdType, px, py, pz, labelText) - if playerID == myPlayerID and cmdType == 'point' and string.len(labelText) > 2 then - local msg = string.format("m@pm@rk%s:%d:%d:%d:%d:%s:%s", - validation, - Spring.GetGameFrame(), - playerID, px, pz, - myPlayerName, labelText) + if playerID == myPlayerID and cmdType == "point" and string.len(labelText) > 2 then + local msg = string.format("m@pm@rk%s:%d:%d:%d:%d:%s:%s", validation, Spring.GetGameFrame(), playerID, px, pz, myPlayerName, labelText) SendLuaRulesMsg(msg) end end @@ -269,6 +265,4 @@ else SendLuaRulesMsg(msg) end end - end - diff --git a/luarules/gadgets/unit_aa_targeting_priority.lua b/luarules/gadgets/unit_aa_targeting_priority.lua index 0de1e5c8df5..64af0d1f898 100644 --- a/luarules/gadgets/unit_aa_targeting_priority.lua +++ b/luarules/gadgets/unit_aa_targeting_priority.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'AA Targeting Priority', - desc = '', - author = 'Doo', --additions wilkubyk - version = 'v1.0', - date = 'May 2018', - license = 'GNU GPL, v2 or later', + name = "AA Targeting Priority", + desc = "", + author = "Doo", --additions wilkubyk + version = "v1.0", + date = "May 2018", + license = "GNU GPL, v2 or later", layer = -1, --must run before game_initial_spawn, because game_initial_spawn must control the return of GameSteup - enabled = true + enabled = true, } end @@ -31,8 +31,8 @@ if gadgetHandler:IsSyncedCode() then } local nonAntiAirTypes = { - AircraftBomb = true, - Shield = true, + AircraftBomb = true, + Shield = true, TorpedoLauncher = true, } @@ -41,13 +41,16 @@ if gadgetHandler:IsSyncedCode() then end local function hasAntiAirTargeting(weapon) - return table.any(weapon.onlyTargets, function(v, k) return isAirCategory[k] end) and not - table.any(weapon.badTargets, function(v, k) return isAirCategory[k] end) + return table.any(weapon.onlyTargets, function(v, k) + return isAirCategory[k] + end) and not table.any(weapon.badTargets, function(v, k) + return isAirCategory[k] + end) end local function isBomberWeapon(weapon) local weaponDef = WeaponDefs[weapon.weaponDef] - return weaponDef.type == 'AircraftBomb' or weaponDef.type == 'TorpedoLauncher' or stringFind(weaponDef.name, 'arm_pidr', 1, true) + return weaponDef.type == "AircraftBomb" or weaponDef.type == "TorpedoLauncher" or stringFind(weaponDef.name, "arm_pidr", 1, true) end local function isFighterWeapon(weapon) diff --git a/luarules/gadgets/unit_air_attacksafetydistance.lua b/luarules/gadgets/unit_air_attacksafetydistance.lua index c69239189d0..bb4da658182 100644 --- a/luarules/gadgets/unit_air_attacksafetydistance.lua +++ b/luarules/gadgets/unit_air_attacksafetydistance.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Air AttackSafetyDistance", - desc = "Allows the setting of attackSafetyDistance for strafe runninng aircraft, so fighters and bombers", - author = "Doo, Floris", - date = "Sept 19th 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Air AttackSafetyDistance", + desc = "Allows the setting of attackSafetyDistance for strafe runninng aircraft, so fighters and bombers", + author = "Doo, Floris", + date = "Sept 19th 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -17,7 +17,8 @@ end try to climb back to normal altitude while still moving toward target. It's disabled by default. Set to half of the minimum weapon range to avoid collisions, enemy fire, AOE damage. If set to greater than the weapon range, the unit will fly over the target like a bomber. -]]-- +]] +-- if not gadgetHandler:IsSyncedCode() then return false diff --git a/luarules/gadgets/unit_air_plants.lua b/luarules/gadgets/unit_air_plants.lua index 06ddc3312fb..bb9e7cda851 100644 --- a/luarules/gadgets/unit_air_plants.lua +++ b/luarules/gadgets/unit_air_plants.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "15 Dec 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -41,8 +41,8 @@ local isAirplantNames = { legsplab = true, } local isAirplantNamesCopy = table.copy(isAirplantNames) -for name,v in pairs(isAirplantNamesCopy) do - isAirplantNames[name..'_scav'] = true +for name, v in pairs(isAirplantNamesCopy) do + isAirplantNames[name .. "_scav"] = true end -- convert unitname -> unitDefID local isAirplant = {} @@ -62,7 +62,7 @@ local landCmd = { action = "aplandat", type = CMDTYPE.ICON_MODE, tooltip = "setting for Aircraft leaving the plant", - params = { '1', ' Fly ', 'Land' } + params = { "1", " Fly ", "Land" }, } function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) @@ -113,4 +113,4 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt return false end return true -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_airtransport_load_unload.lua b/luarules/gadgets/unit_airtransport_load_unload.lua index 57c3450c925..9566127431b 100644 --- a/luarules/gadgets/unit_airtransport_load_unload.lua +++ b/luarules/gadgets/unit_airtransport_load_unload.lua @@ -1,4 +1,3 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() @@ -14,18 +13,17 @@ function gadget:GetInfo() end local isAirTransport = {} -for udefID,def in ipairs(UnitDefs) do +for udefID, def in ipairs(UnitDefs) do if def.canFly and def.isTransport then if def.customParams.techlevel then - isAirTransport[udefID] = 30 -- 15 elmos + isAirTransport[udefID] = 30 -- 15 elmos else - isAirTransport[udefID] = 20 -- 10 elmos + isAirTransport[udefID] = 20 -- 10 elmos end end end -if (gadgetHandler:IsSyncedCode()) then - +if gadgetHandler:IsSyncedCode() then local mathSqrt = math.sqrt local spGetUnitPosition = Spring.GetUnitPosition local spAreTeamsAllied = Spring.AreTeamsAllied @@ -37,20 +35,20 @@ if (gadgetHandler:IsSyncedCode()) then local difX = pos1[1] - pos2[1] local difY = pos1[2] - pos2[2] local difZ = pos1[3] - pos2[3] - local sqDist = difX*difX + difY*difY + difZ*difZ + local sqDist = difX * difX + difY * difY + difZ * difZ local dist = mathSqrt(sqDist) - return (dist) + return dist end function gadget:AllowUnitTransportLoad(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam, goalX, goalY, goalZ) if isAirTransport[transporterUnitDefID] then --local terDefs = UnitDefs[transporterUnitDefID] --local teeDefs = UnitDefs[transporteeUnitDefID] - local pos1 = {spGetUnitPosition(transporterID)} - local pos2 = {goalX, goalY, goalZ} + local pos1 = { spGetUnitPosition(transporterID) } + local pos2 = { goalX, goalY, goalZ } if gadget:Distance(pos1, pos2) <= isAirTransport[transporterUnitDefID] then - if spAreTeamsAllied(spGetUnitTeam(transporterID), spGetUnitTeam(transporteeID)) or select(4, spGetUnitVelocity(transporteeID)) < 0.5 then -- make it hard for moving enemy units to be picked up - spSetUnitVelocity(transporterID, 0,0,0) + if spAreTeamsAllied(spGetUnitTeam(transporterID), spGetUnitTeam(transporteeID)) or select(4, spGetUnitVelocity(transporteeID)) < 0.5 then -- make it hard for moving enemy units to be picked up + spSetUnitVelocity(transporterID, 0, 0, 0) return true else return false @@ -67,10 +65,10 @@ if (gadgetHandler:IsSyncedCode()) then if isAirTransport[transporterUnitDefID] then --local terDefs = UnitDefs[transporterUnitDefID] --local teeDefs = UnitDefs[transporteeUnitDefID] - local pos1 = {spGetUnitPosition(transporterID)} - local pos2 = {goalX, goalY, goalZ} + local pos1 = { spGetUnitPosition(transporterID) } + local pos2 = { goalX, goalY, goalZ } if gadget:Distance(pos1, pos2) <= isAirTransport[transporterUnitDefID] then - spSetUnitVelocity(transporterID, 0,0,0) + spSetUnitVelocity(transporterID, 0, 0, 0) return true else return false diff --git a/luarules/gadgets/unit_airunitsturnradius.lua b/luarules/gadgets/unit_airunitsturnradius.lua index 831628ea25a..b3eedafc5c7 100644 --- a/luarules/gadgets/unit_airunitsturnradius.lua +++ b/luarules/gadgets/unit_airunitsturnradius.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "TurnRadius", - desc = "Fixes TurnRadius Dynamically for bombers", - author = "Doo", - date = "Sept 19th 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "TurnRadius", + desc = "Fixes TurnRadius Dynamically for bombers", + author = "Doo", + date = "Sept 19th 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end diff --git a/luarules/gadgets/unit_allow_builder_hold_fire.lua b/luarules/gadgets/unit_allow_builder_hold_fire.lua index 794f0c6d2f7..6c2d6b3be25 100644 --- a/luarules/gadgets/unit_allow_builder_hold_fire.lua +++ b/luarules/gadgets/unit_allow_builder_hold_fire.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- -if (not gadgetHandler:IsSyncedCode()) then - return +if not gadgetHandler:IsSyncedCode() then + return end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- @@ -9,19 +9,17 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Allow Builder Hold Fire", - desc = "Sets whether a builder can fire while doing anything nanolathe related.", - author = "Google Frog", - date = "22 June 2014", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Allow Builder Hold Fire", + desc = "Sets whether a builder can fire while doing anything nanolathe related.", + author = "Google Frog", + date = "22 June 2014", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - - function gadget:AllowBuilderHoldFire(unitID, unitDefID, action) --Spring.Echo("gadget:AllowBuilderHoldFire(unitID, unitDefID, action)", unitID, unitDefID, action) return false -- false means that a unit can build and shoot at the same time diff --git a/luarules/gadgets/unit_area_timed_damage.lua b/luarules/gadgets/unit_area_timed_damage.lua index 175135e97db..11c4f169143 100644 --- a/luarules/gadgets/unit_area_timed_damage.lua +++ b/luarules/gadgets/unit_area_timed_damage.lua @@ -1,20 +1,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Area Timed Damage Handler', - desc = '', - author = 'Damgam', - version = '1.0', - date = '2022', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true - } + return { + name = "Area Timed Damage Handler", + desc = "", + author = "Damgam", + version = "1.0", + date = "2022", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end -------------------------------------------------------------------------------- @@ -30,13 +30,25 @@ local factoryWaitTime = damageInterval ---@type number in seconds, immunity peri -- Since I couldn't figure out totally arbitrary-radius variable CEGs for fire, -- we're left with this static list, which is repeated in the expgen def files: local areaSizePresets = { - 37.5, 46, 54, 63, 75, - 88, 100, 125, 150, 175, - 200, 225, 250, 275, 300, + 37.5, + 46, + 54, + 63, + 75, + 88, + 100, + 125, + 150, + 175, + 200, + 225, + 250, + 275, + 300, } -- Customparams and defaults: -local prefixes = { unit = 'area_ondeath_', weapon = 'area_onhit_' } +local prefixes = { unit = "area_ondeath_", weapon = "area_onhit_" } --[[ customparams = { _damage := The damage done per second @@ -50,46 +62,47 @@ local prefixes = { unit = 'area_ondeath_', weapon = 'area_onhit_' } When adding timed areas to existing weapons, you should tweak the weapon's explosion ceg, too. There's a short delay between the hit and the area ceg, which you can mask/make look nice with an explosion lasting about 0.5 secs. -]]-- +]] +-- -------------------------------------------------------------------------------- -- Cached globals -------------------------------------------------------------- -local abs = math.abs -local max = math.max -local min = math.min -local floor = math.floor -local round = math.round -local sqrt = math.sqrt -local diag = math.diag -local normalize = math.normalize -local stringFind = string.find -local stringGsub = string.gsub -local stringLower = string.lower -local tableInsert = table.insert -local tableRemove = table.remove - -local spAddUnitDamage = Spring.AddUnitDamage -local spAddFeatureDamage = Spring.AddFeatureDamage -local spGetFeaturePosition = Spring.GetFeaturePosition +local abs = math.abs +local max = math.max +local min = math.min +local floor = math.floor +local round = math.round +local sqrt = math.sqrt +local diag = math.diag +local normalize = math.normalize +local stringFind = string.find +local stringGsub = string.gsub +local stringLower = string.lower +local tableInsert = table.insert +local tableRemove = table.remove + +local spAddUnitDamage = Spring.AddUnitDamage +local spAddFeatureDamage = Spring.AddFeatureDamage +local spGetFeaturePosition = Spring.GetFeaturePosition local spGetFeaturesInCylinder = Spring.GetFeaturesInCylinder -local spGetFeatureRadius = Spring.GetFeatureRadius -local spGetGroundHeight = Spring.GetGroundHeight -local spGetGroundNormal = Spring.GetGroundNormal +local spGetFeatureRadius = Spring.GetFeatureRadius +local spGetGroundHeight = Spring.GetGroundHeight +local spGetGroundNormal = Spring.GetGroundNormal local spGetProjectileAllyTeam = Spring.GetProjectileAllyTeamID -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitRadius = Spring.GetUnitRadius -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spGetWaterPlaneLevel = Spring.GetWaterPlaneLevel -local spSpawnCEG = Spring.SpawnCEG +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spGetWaterPlaneLevel = Spring.GetWaterPlaneLevel +local spSpawnCEG = Spring.SpawnCEG -local gameSpeed = Game.gameSpeed +local gameSpeed = Game.gameSpeed -local waterPlaneLevel = spGetWaterPlaneLevel() -local lavaWater = Spring.Lava.isLavaMap -local voidWater = false +local waterPlaneLevel = spGetWaterPlaneLevel() +local lavaWater = Spring.Lava.isLavaMap +local voidWater = false local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") if success and mapinfo and mapinfo.voidwater then @@ -129,10 +142,10 @@ local featDamageReset = {} local inExplosion = table.new(1, 0) -- lua trick for ref passing -local regexArea, regexRepeat = '%-area%-', '%-repeat' +local regexArea, regexRepeat = "%-area%-", "%-repeat" local regexDigits = "%d+" -local regexCegRadius = regexArea..regexDigits..regexRepeat -local regexCegToRadius = regexArea.."("..regexDigits..")"..regexRepeat +local regexCegRadius = regexArea .. regexDigits .. regexRepeat +local regexCegToRadius = regexArea .. "(" .. regexDigits .. ")" .. regexRepeat local areaDamageType = "LuaAreaDamage_" local areaDamageTypes = {} @@ -144,9 +157,9 @@ local areaDamageTypes = {} ---avoid drawbacks of single-stack area damage — differences in area damage, and ---accidental area overlap arbitrarily halving/thirdsing/etc. your total damage. local function getLimitedDamage(incoming, accumulated) - local ignoreLimit = max(0, incoming * damageBypassScale - damageLimit) - local belowLimit = max(0, min(incoming - ignoreLimit, damageLimit - accumulated)) - local aboveLimit = incoming - belowLimit - ignoreLimit + local ignoreLimit = max(0, incoming * damageBypassScale - damageLimit) + local belowLimit = max(0, min(incoming - ignoreLimit, damageLimit - accumulated)) + local aboveLimit = incoming - belowLimit - ignoreLimit local damageDealt = ignoreLimit + belowLimit + aboveLimit * damageExcessRate local showDamageCeg = (damageDealt >= incoming * damageCegMinMultiple) or (damageDealt >= damageCegMinScalar) @@ -155,16 +168,16 @@ local function getLimitedDamage(incoming, accumulated) end local function getExplosionParams(def, prefix) - local ceg = def.customParams[prefix .. "ceg" ] - local damageCeg = def.customParams[prefix .. "damageceg" ] + local ceg = def.customParams[prefix .. "ceg"] + local damageCeg = def.customParams[prefix .. "damageceg"] local resistance = def.customParams[prefix .. "resistance"] - local dpsWanted = def.customParams[prefix .. "damage" ] - local duration = def.customParams[prefix .. "time" ] - local range = def.customParams[prefix .. "range" ] - local penetrates = def.customParams[prefix .. "shieldpen" ] + local dpsWanted = def.customParams[prefix .. "damage"] + local duration = def.customParams[prefix .. "time"] + local range = def.customParams[prefix .. "range"] + local penetrates = def.customParams[prefix .. "shieldpen"] - resistance = stringLower(resistance or "none") - range = tonumber(range) + resistance = stringLower(resistance or "none") + range = tonumber(range) dpsWanted = tonumber(dpsWanted) duration = tonumber(duration) @@ -176,7 +189,9 @@ local function getExplosionParams(def, prefix) -- These are used for scripted damages both by the engine and Lua. local envDamageTypeMin = table.reduce( Game.envDamageTypes, - function(acc, index) return index < acc and index or acc end, + function(acc, index) + return index < acc and index or acc + end, -1 -- The "real" weaponDefIDs start at 0. ) weaponDefID = envDamageTypeMin - 1 @@ -199,87 +214,87 @@ local function getExplosionParams(def, prefix) local damageTotal = 0 local damageFrames = frameInterval local accumulated, accumulateFrames = 0, gameSpeed - for _ = 1, floor(framesFull) do + for _ = 1, floor(framesFull) do accumulateFrames, damageFrames = accumulateFrames - 1, damageFrames - 1 - if damageFrames == 0 then + if damageFrames == 0 then damageFrames = frameInterval local damage = getLimitedDamage(damagePerTick, accumulated) - damageTotal = damageTotal + damage + damageTotal = damageTotal + damage accumulated = accumulated + damage - end + end if accumulateFrames == 0 then accumulateFrames = gameSpeed accumulated = 0 end - end + end local framesPartial = round(framesWanted) - framesFull local damagePartial = (dpsWanted * duration) - damageTotal return { - ceg = ceg, - damageCeg = damageCeg, - range = range, + ceg = ceg, + damageCeg = damageCeg, + range = range, resistance = resistance, penetrates = penetrates, - weapon = weaponDefID, - damage = damagePerTick, - frames = framesFull, + weapon = weaponDefID, + damage = damagePerTick, + frames = framesFull, lastFrames = framesPartial, lastDamage = damagePartial, } end local function getNearestCEG(params) - local ceg, range = params.ceg, params.range - - -- We can't check properties of the ceg, so use the name to compare 'size'. Yes, "that is bad". - if stringFind(ceg, "-"..floor(range).."-", nil, true) then - local _, _, _, namedRange = stringFind(ceg, regexCegToRadius, nil, true) - if tonumber(namedRange) == floor(range) then - return ceg, range - end - end - - -- User tweaks have modified the ceg and/or range; update both to the best-fitting preset. - local sizeBest, diffBest = math.huge, math.huge - for ii = 1, #areaSizePresets do - local size = areaSizePresets[ii] - local diff = abs(range / size - size / range) - if diff < diffBest then - diffBest = diff - sizeBest = size - end - end - if sizeBest < math.huge then - ceg = stringGsub(ceg, regexDigits, sizeBest, 1) - return ceg, sizeBest - end + local ceg, range = params.ceg, params.range + + -- We can't check properties of the ceg, so use the name to compare 'size'. Yes, "that is bad". + if stringFind(ceg, "-" .. floor(range) .. "-", nil, true) then + local _, _, _, namedRange = stringFind(ceg, regexCegToRadius, nil, true) + if tonumber(namedRange) == floor(range) then + return ceg, range + end + end + + -- User tweaks have modified the ceg and/or range; update both to the best-fitting preset. + local sizeBest, diffBest = math.huge, math.huge + for ii = 1, #areaSizePresets do + local size = areaSizePresets[ii] + local diff = abs(range / size - size / range) + if diff < diffBest then + diffBest = diff + sizeBest = size + end + end + if sizeBest < math.huge then + ceg = stringGsub(ceg, regexDigits, sizeBest, 1) + return ceg, sizeBest + end end ---The ordering of areas, if left arbitrary, penalizes high-damage areas. ---This gives a faster insert when ordering areas from low to high damage ---without favoring newly created areas (effectively penalizing duration). local function bisectDamage(array, damage, low, high) - if low < high then - local indexMiddle = floor((low + high) * 0.5) - local areaMiddle = array[indexMiddle] - local damageMiddle = areaMiddle and areaMiddle.damage - - if damageMiddle then - if damageMiddle == damage then - return indexMiddle - else - if damageMiddle > damage then - high = indexMiddle - 1 - else - low = indexMiddle + 1 - end - return bisectDamage(array, damage, low, high) - end - end - end - return low + if low < high then + local indexMiddle = floor((low + high) * 0.5) + local areaMiddle = array[indexMiddle] + local damageMiddle = areaMiddle and areaMiddle.damage + + if damageMiddle then + if damageMiddle == damage then + return indexMiddle + else + if damageMiddle > damage then + high = indexMiddle - 1 + else + low = indexMiddle + 1 + end + return bisectDamage(array, damage, low, high) + end + end + end + return low end local function addToExplosions(explosions, area) @@ -298,35 +313,34 @@ local function getBlockingShieldUnits(x, y, z, radius, onlyAlive) end local function getAllyTeam(attackerID, projectileID) - return (attackerID and spGetUnitAllyTeam(attackerID)) - or (projectileID and spGetProjectileAllyTeam(projectileID)) + return (attackerID and spGetUnitAllyTeam(attackerID)) or (projectileID and spGetProjectileAllyTeam(projectileID)) end local function addTimedExplosion(weaponDefID, px, py, pz, attackerID, projectileID) - local explosion = timedDamageWeapons[weaponDefID] - local elevation = max(spGetGroundHeight(px, pz), waterPlaneLevel) + local explosion = timedDamageWeapons[weaponDefID] + local elevation = max(spGetGroundHeight(px, pz), waterPlaneLevel) local dispersal = abs(py - elevation) -- death explosions can be underneath lava - local areaRange = explosion.range + local areaRange = explosion.range - if dispersal <= areaRange then - local frames = explosion.frames - local dx, dy, dz - if elevation > waterPlaneLevel then - dx, dy, dz = spGetGroundNormal(px, pz, true) + if dispersal <= areaRange then + local frames = explosion.frames + local dx, dy, dz + if elevation > waterPlaneLevel then + dx, dy, dz = spGetGroundNormal(px, pz, true) else if voidWater then return end - -- Napalm and acid on water are not entirely wanted so we cut the duration. - -- Reduce the duration by half and then up to 1/8th penalty from dispersal: - frames = round(frames * 0.5 * (1 - 0.5 * dispersal / areaRange)) - dx, dy, dz = 0, 1, 0 - end + -- Napalm and acid on water are not entirely wanted so we cut the duration. + -- Reduce the duration by half and then up to 1/8th penalty from dispersal: + frames = round(frames * 0.5 * (1 - 0.5 * dispersal / areaRange)) + dx, dy, dz = 0, 1, 0 + end - local minY = elevation - areaRange - if minY < waterPlaneLevel then - minY = minY * (1 - dy * 0.5) -- avoid damage to submerged targets - end + local minY = elevation - areaRange + if minY < waterPlaneLevel then + minY = minY * (1 - dy * 0.5) -- avoid damage to submerged targets + end -- Shields and area damages express slightly different types of containment of units, -- and the explosion volume and resulting area volume have some discrepancy, as well. @@ -339,30 +353,30 @@ local function addTimedExplosion(weaponDefID, px, py, pz, attackerID, projectile end end - local area = { - weapon = explosion.weapon, - owner = attackerID, - x = px, - y = elevation, - z = pz, - ymin = minY, - ymax = elevation + areaRange, - dx = dx, - dy = dy, - dz = dz, - ceg = explosion.ceg, - range = areaRange, - damage = explosion.damage, - damageCeg = explosion.damageCeg, + local area = { + weapon = explosion.weapon, + owner = attackerID, + x = px, + y = elevation, + z = pz, + ymin = minY, + ymax = elevation + areaRange, + dx = dx, + dy = dy, + dz = dz, + ceg = explosion.ceg, + range = areaRange, + damage = explosion.damage, + damageCeg = explosion.damageCeg, -- Use water-adjusted duration if we shortened frames above. - endFrame = frames + frameNumber, - lastFrames = explosion.lastFrames, - lastDamage = explosion.lastDamage, - suppressed = blockingShields, - } + endFrame = frames + frameNumber, + lastFrames = explosion.lastFrames, + lastDamage = explosion.lastDamage, + suppressed = blockingShields, + } addToExplosions(frameExplosions, area) - end + end end ---Add any remaining frames of area duration and any remaining damage to the final damage tick. @@ -376,11 +390,11 @@ local function extendTimedExplosion(area, gameFrame) end local function spawnAreaCEGs(loopIndex) - local areas = aliveExplosions[loopIndex] - for index = 1, #areas do + local areas = aliveExplosions[loopIndex] + for index = 1, #areas do local area = areas[index] - spSpawnCEG(area.ceg, area.x, area.y, area.z, area.dx, area.dy, area.dz) - end + spSpawnCEG(area.ceg, area.x, area.y, area.z, area.dx, area.dy, area.dz) + end end local function getUnitHitData(unitID) @@ -425,10 +439,7 @@ local function getAreaHitPosition(area, targetRadius, baseX, baseY, baseZ, midX, local discriminant = b * b - 4 * a * c local t = (b + sqrt(discriminant)) / (2 * a) - return - midX + t * rx, - midY + t * ry, - midZ + t * rz + return midX + t * rx, midY + t * ry, midZ + t * rz end end else @@ -447,22 +458,22 @@ local function getAreaHitPosition(area, targetRadius, baseX, baseY, baseZ, midX, end local function damageTargetsInAreas(timedAreas, gameFrame) - local length = #timedAreas + local length = #timedAreas - local reset = {} - local count = 0 + local reset = {} + local count = 0 - for index = length, 1, -1 do - local area = timedAreas[index] - local x, z, radius = area.x, area.z, area.range + for index = length, 1, -1 do + local area = timedAreas[index] + local x, z, radius = area.x, area.z, area.range - local unitsInRange = spGetUnitsInCylinder(x, z, max(radius, unitRadiusMax)) + local unitsInRange = spGetUnitsInCylinder(x, z, max(radius, unitRadiusMax)) - for j = 1, #unitsInRange do - local unitID = unitsInRange[j] + for j = 1, #unitsInRange do + local unitID = unitsInRange[j] local data = unitData[unitID] - if data and not data.resistances[area.weapon] and data.immuneUntil < gameFrame then - local hitX, hitY, hitZ = getAreaHitPosition(area, getUnitHitData(unitID)) + if data and not data.resistances[area.weapon] and data.immuneUntil < gameFrame then + local hitX, hitY, hitZ = getAreaHitPosition(area, getUnitHitData(unitID)) if hitX then local damageTaken = data.damageTaken @@ -480,65 +491,65 @@ local function damageTargetsInAreas(timedAreas, gameFrame) spAddUnitDamage(unitID, damage, nil, area.owner ~= unitID and area.owner or nil, area.weapon) inExplosion[1] = nil end - end - end - end + end + end + end - for _, data in ipairs(unitDamageReset[gameFrame] or {}) do + for _, data in ipairs(unitDamageReset[gameFrame] or {}) do data.damageTaken = 0 end - unitDamageReset[gameFrame] = nil - unitDamageReset[gameFrame + gameSpeed] = reset + unitDamageReset[gameFrame] = nil + unitDamageReset[gameFrame + gameSpeed] = reset - reset = {} - count = 0 + reset = {} + count = 0 - for index = length, 1, -1 do - local area = timedAreas[index] - local x, z, radius = area.x, area.z, area.range + for index = length, 1, -1 do + local area = timedAreas[index] + local x, z, radius = area.x, area.z, area.range - local featuresInRange = spGetFeaturesInCylinder(x, z, max(radius, featureRadiusMax)) + local featuresInRange = spGetFeaturesInCylinder(x, z, max(radius, featureRadiusMax)) - for j = 1, #featuresInRange do - local featureID = featuresInRange[j] + for j = 1, #featuresInRange do + local featureID = featuresInRange[j] local data = featureData[featureID] - if data and not data.damageImmune then - local hitX, hitY, hitZ = getAreaHitPosition(area, getFeatureHitData(featureID)) - - if hitX then - local damageTaken = data.damageTaken - if damageTaken == 0 then - count = count + 1 - reset[count] = data - end - local damageDealt, showDamageCeg = getLimitedDamage(area.damage, damageTaken) - if showDamageCeg then - spSpawnCEG(area.damageCeg, hitX, hitY, hitZ) - end + if data and not data.damageImmune then + local hitX, hitY, hitZ = getAreaHitPosition(area, getFeatureHitData(featureID)) + + if hitX then + local damageTaken = data.damageTaken + if damageTaken == 0 then + count = count + 1 + reset[count] = data + end + local damageDealt, showDamageCeg = getLimitedDamage(area.damage, damageTaken) + if showDamageCeg then + spSpawnCEG(area.damageCeg, hitX, hitY, hitZ) + end data.damageTaken = damageTaken + damageDealt inExplosion[1] = area spAddFeatureDamage(featureID, damageDealt, nil, area.owner, area.weapon) inExplosion[1] = nil - end - end - end + end + end + end - if area.endFrame <= gameFrame then - tableRemove(timedAreas, index) + if area.endFrame <= gameFrame then + tableRemove(timedAreas, index) if area.lastFrames then extendTimedExplosion(area, gameFrame) end - end - end + end + end - for _, data in ipairs(featDamageReset[gameFrame] or {}) do + for _, data in ipairs(featDamageReset[gameFrame] or {}) do data.damageTaken = 0 end - featDamageReset[gameFrame] = nil - featDamageReset[gameFrame + gameSpeed] = reset + featDamageReset[gameFrame] = nil + featDamageReset[gameFrame + gameSpeed] = reset end -------------------------------------------------------------------------------- @@ -551,45 +562,45 @@ function gadget:Initialize() GG.InTimedDamageArea = inExplosion timedDamageWeapons = {} - for weaponDefID = 0, #WeaponDefs do - local weaponDef = WeaponDefs[weaponDefID] - if weaponDef.customParams and weaponDef.customParams[prefixes.weapon.."ceg"] then - timedDamageWeapons[weaponDefID] = getExplosionParams(weaponDef, prefixes.weapon) - end - end - for unitDefID, unitDef in ipairs(UnitDefs) do - if unitDef.customParams[prefixes.unit.."ceg"] then - local params = getExplosionParams(unitDef, prefixes.unit) - timedDamageWeapons[WeaponDefNames[unitDef.deathExplosion].id] = params - timedDamageWeapons[WeaponDefNames[unitDef.selfDExplosion].id] = params - end - if unitDef.isFactory then - isFactory[unitDefID] = true - end - end - - -- This simplifies writing tweakdefs to modify area_on[x]_range for balance, - -- e.g. setting all ranges to 80% their original amount will work correctly. - for weaponDefID, params in pairs(timedDamageWeapons) do - if string.find(params.ceg, regexCegRadius, nil, false) then - local ceg, range = getNearestCEG(params) - local name = WeaponDefs[weaponDefID].name - if ceg and range then - if params.ceg ~= ceg or params.range ~= range then - params.ceg = ceg - params.range = range - Spring.Log(gadget:GetInfo().name, LOG.INFO, 'Set '..name..' to range, ceg = '..range..', '..ceg) - end - else - timedDamageWeapons[weaponDefID] = nil - Spring.Log(gadget:GetInfo().name, LOG.WARN, 'Removed '..name..' from area timed damage weapons.') - end - end - end - - if not next(timedDamageWeapons) then + for weaponDefID = 0, #WeaponDefs do + local weaponDef = WeaponDefs[weaponDefID] + if weaponDef.customParams and weaponDef.customParams[prefixes.weapon .. "ceg"] then + timedDamageWeapons[weaponDefID] = getExplosionParams(weaponDef, prefixes.weapon) + end + end + for unitDefID, unitDef in ipairs(UnitDefs) do + if unitDef.customParams[prefixes.unit .. "ceg"] then + local params = getExplosionParams(unitDef, prefixes.unit) + timedDamageWeapons[WeaponDefNames[unitDef.deathExplosion].id] = params + timedDamageWeapons[WeaponDefNames[unitDef.selfDExplosion].id] = params + end + if unitDef.isFactory then + isFactory[unitDefID] = true + end + end + + -- This simplifies writing tweakdefs to modify area_on[x]_range for balance, + -- e.g. setting all ranges to 80% their original amount will work correctly. + for weaponDefID, params in pairs(timedDamageWeapons) do + if string.find(params.ceg, regexCegRadius, nil, false) then + local ceg, range = getNearestCEG(params) + local name = WeaponDefs[weaponDefID].name + if ceg and range then + if params.ceg ~= ceg or params.range ~= range then + params.ceg = ceg + params.range = range + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Set " .. name .. " to range, ceg = " .. range .. ", " .. ceg) + end + else + timedDamageWeapons[weaponDefID] = nil + Spring.Log(gadget:GetInfo().name, LOG.WARN, "Removed " .. name .. " from area timed damage weapons.") + end + end + end + + if not next(timedDamageWeapons) then Spring.Log(gadget:GetInfo().name, LOG.INFO, "No timed areas found. Removing gadget.") - gadgetHandler:RemoveGadget(self) + gadgetHandler:RemoveGadget(self) return end @@ -597,41 +608,41 @@ function gadget:Initialize() Script.SetWatchExplosion(weaponDefID, true) end - unitDamageImmunity = {} - local areaResistances = {} - for weaponDefID, params in pairs(timedDamageWeapons) do - if params.resistance ~= "none" then - areaResistances[areaDamageTypes[areaDamageType .. params.resistance]] = true - end - end - local immunities = { all = areaResistances, none = {} } - for unitDefID, unitDef in ipairs(UnitDefs) do - local unitImmunity - if unitDef.isSubmarine or unitDef.canFly or unitDef.armorType == Game.armorTypes.indestructible then - unitImmunity = immunities.all - elseif unitDef.customParams.areadamageresistance == nil then - unitImmunity = immunities.none - else - local resistance = string.lower(unitDef.customParams.areadamageresistance) - if immunities[resistance] then - unitImmunity = immunities[resistance] - else - unitImmunity = {} - for weaponDefID in pairs(areaResistances) do - if string.find(resistance, areaDamageTypes[weaponDefID], nil, false) then - unitImmunity[weaponDefID] = true - end - end - if not next(unitImmunity) then - unitImmunity = immunities.none - end - immunities[resistance] = unitImmunity - end - end - unitDamageImmunity[unitDefID] = unitImmunity - end - - featureDamageImmunity = {} + unitDamageImmunity = {} + local areaResistances = {} + for weaponDefID, params in pairs(timedDamageWeapons) do + if params.resistance ~= "none" then + areaResistances[areaDamageTypes[areaDamageType .. params.resistance]] = true + end + end + local immunities = { all = areaResistances, none = {} } + for unitDefID, unitDef in ipairs(UnitDefs) do + local unitImmunity + if unitDef.isSubmarine or unitDef.canFly or unitDef.armorType == Game.armorTypes.indestructible then + unitImmunity = immunities.all + elseif unitDef.customParams.areadamageresistance == nil then + unitImmunity = immunities.none + else + local resistance = string.lower(unitDef.customParams.areadamageresistance) + if immunities[resistance] then + unitImmunity = immunities[resistance] + else + unitImmunity = {} + for weaponDefID in pairs(areaResistances) do + if string.find(resistance, areaDamageTypes[weaponDefID], nil, false) then + unitImmunity[weaponDefID] = true + end + end + if not next(unitImmunity) then + unitImmunity = immunities.none + end + immunities[resistance] = unitImmunity + end + end + unitDamageImmunity[unitDefID] = unitImmunity + end + + featureDamageImmunity = {} for featureDefID, featureDef in ipairs(FeatureDefs) do featureDamageImmunity[featureDefID] = featureDef.indestructible or featureDef.geoThermal end @@ -672,23 +683,23 @@ function gadget:Initialize() end function gadget:Explosion(weaponDefID, px, py, pz, attackerID, projectileID) - if timedDamageWeapons[weaponDefID] then - addTimedExplosion(weaponDefID, px, py, pz, attackerID, projectileID) - end + if timedDamageWeapons[weaponDefID] then + addTimedExplosion(weaponDefID, px, py, pz, attackerID, projectileID) + end end function gadget:GameFrame(frame) updateWaterPlane() - local indexDamage = 1 + (frame % frameInterval) - local indexExpGen = 1 + ((frame + frameCegShift) % frameInterval) - local frameAreas = aliveExplosions[indexDamage] + local indexDamage = 1 + (frame % frameInterval) + local indexExpGen = 1 + ((frame + frameCegShift) % frameInterval) + local frameAreas = aliveExplosions[indexDamage] - spawnAreaCEGs(indexExpGen) - damageTargetsInAreas(frameAreas, frame) + spawnAreaCEGs(indexExpGen) + damageTargetsInAreas(frameAreas, frame) - frameExplosions = frameAreas - frameNumber = frame + frameExplosions = frameAreas + frameNumber = frame end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) @@ -728,23 +739,23 @@ if lavaWater then local areaRange = area.range local dx, dy, dz - if elevation > lavaLevel then - dx, dy, dz = spGetGroundNormal(area.x, area.z, true) + if elevation > lavaLevel then + dx, dy, dz = spGetGroundNormal(area.x, area.z, true) else - dx, dy, dz = 0, 1, 0 - end + dx, dy, dz = 0, 1, 0 + end - local minY = elevation - areaRange - if minY < lavaLevel then - minY = minY * (1 - dy * 0.5) - end + local minY = elevation - areaRange + if minY < lavaLevel then + minY = minY * (1 - dy * 0.5) + end - area.y = elevation + area.y = elevation area.ymin = minY area.ymax = elevation + areaRange - area.dx = dx - area.dy = dy - area.dz = dz + area.dx = dx + area.dy = dy + area.dz = dz end updateWaterPlane = function() diff --git a/luarules/gadgets/unit_areaattack.lua b/luarules/gadgets/unit_areaattack.lua index 67b1c74e7e1..7a0bc1541e9 100644 --- a/luarules/gadgets/unit_areaattack.lua +++ b/luarules/gadgets/unit_areaattack.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2008-01-20", license = "Public domain", layer = 1, - enabled = true + enabled = true, } end @@ -17,7 +17,6 @@ end local CMD_AREA_ATTACK_GROUND = GameCMD.AREA_ATTACK_GROUND if gadgetHandler:IsSyncedCode() then - local attackList = {} local closeList = {} @@ -48,17 +47,17 @@ if gadgetHandler:IsSyncedCode() then } function gadget:GameFrame(f) - for i,o in pairs(attackList) do + for i, o in pairs(attackList) do attackList[i] = nil - local phase = math_random(200*math_pi)/100.0 + local phase = math_random(200 * math_pi) / 100.0 if o.radius > 0 then local amp = math_random(o.radius) - Spring.GiveOrderToUnit(o.unit, CMD.INSERT, {0, CMD.ATTACK, 0, o.x + math_cos(phase)*amp, o.y, o.z + math_sin(phase)*amp}, {"alt"}) + Spring.GiveOrderToUnit(o.unit, CMD.INSERT, { 0, CMD.ATTACK, 0, o.x + math_cos(phase) * amp, o.y, o.z + math_sin(phase) * amp }, { "alt" }) end end - for i,o in pairs(closeList) do + for i, o in pairs(closeList) do closeList[i] = nil - Spring.SetUnitMoveGoal(o.unit,o.x,o.y,o.z,o.radius) + Spring.SetUnitMoveGoal(o.unit, o.x, o.y, o.z, o.radius) end end @@ -74,17 +73,17 @@ if gadgetHandler:IsSyncedCode() then return false end - function gadget:CommandFallback(u,ud,team,cmd,param,opt) + function gadget:CommandFallback(u, ud, team, cmd, param, opt) if cmd == CMD_AREA_ATTACK_GROUND then - local x,_,z = Spring.GetUnitPosition(u) + local x, _, z = Spring.GetUnitPosition(u) if not x then return true, true end - local dist = math_sqrt((x-param[1])*(x-param[1]) + (z-param[3])*(z-param[3])) + local dist = math_sqrt((x - param[1]) * (x - param[1]) + (z - param[3]) * (z - param[3])) if dist <= range[ud] - param[4] then - attackList[#attackList+1] = {unit = u, x=param[1], y=param[2], z=param[3], radius=param[4]} + attackList[#attackList + 1] = { unit = u, x = param[1], y = param[2], z = param[3], radius = param[4] } else - closeList[#closeList+1] ={unit = u, x=param[1], y=param[2], z=param[3], radius=range[ud]-param[4]} + closeList[#closeList + 1] = { unit = u, x = param[1], y = param[2], z = param[3], radius = range[ud] - param[4] } end return true, false end @@ -93,7 +92,7 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitCreated(u, ud, team) if canAreaAttack[ud] then - Spring.InsertUnitCmdDesc(u,aadesc) + Spring.InsertUnitCmdDesc(u, aadesc) end end @@ -101,11 +100,8 @@ if gadgetHandler:IsSyncedCode() then gadgetHandler:RegisterCMDID(CMD_AREA_ATTACK_GROUND) gadgetHandler:RegisterAllowCommand(CMD_AREA_ATTACK_GROUND) end - -else -- UNSYNCED - +else -- UNSYNCED function gadget:Initialize() - Spring.SetCustomCommandDrawData(CMD_AREA_ATTACK_GROUND, CMDTYPE.ICON_UNIT_OR_AREA, {1,0,0,.8},true) + Spring.SetCustomCommandDrawData(CMD_AREA_ATTACK_GROUND, CMDTYPE.ICON_UNIT_OR_AREA, { 1, 0, 0, 0.8 }, true) end - end diff --git a/luarules/gadgets/unit_areaattack_limiter.lua b/luarules/gadgets/unit_areaattack_limiter.lua index 063224ba6f8..ba9e893f543 100644 --- a/luarules/gadgets/unit_areaattack_limiter.lua +++ b/luarules/gadgets/unit_areaattack_limiter.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "2026", license = "GNU GPL, v2 or later", layer = -999999, - enabled = true + enabled = true, } end @@ -34,10 +34,7 @@ end local isBomberUnitDef = {} for unitDefID, unitDef in pairs(UnitDefs) do - if (unitDef.weapons and unitDef.weapons[1] and isBombWeapon[unitDef.weapons[1].weaponDef]) - or string.find(unitDef.name, "armlance") - or string.find(unitDef.name, "cortitan") - or string.find(unitDef.name, "legatorpbomber") then + if (unitDef.weapons and unitDef.weapons[1] and isBombWeapon[unitDef.weapons[1].weaponDef]) or string.find(unitDef.name, "armlance") or string.find(unitDef.name, "cortitan") or string.find(unitDef.name, "legatorpbomber") then isBomberUnitDef[unitDefID] = true end end @@ -52,7 +49,9 @@ local isReissuing = false function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) -- Guard against re-entrancy: GiveOrderArrayToUnitArray can trigger CommandNotify again - if isReissuing then return end + if isReissuing then + return + end -- Only intercept area-format commands (4 params: x, y, z, radius) if (cmdID ~= CMD_ATTACK and cmdID ~= CMD_AREA_ATTACK) or #cmdParams ~= 4 or cmdParams[4] <= 0 then @@ -64,10 +63,18 @@ function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) -- Preserve command options local opts = 0 - if cmdOpts.alt then opts = opts + CMD.OPT_ALT end - if cmdOpts.ctrl then opts = opts + CMD.OPT_CTRL end - if cmdOpts.meta then opts = opts + CMD.OPT_META end - if cmdOpts.right then opts = opts + CMD.OPT_RIGHT end + if cmdOpts.alt then + opts = opts + CMD.OPT_ALT + end + if cmdOpts.ctrl then + opts = opts + CMD.OPT_CTRL + end + if cmdOpts.meta then + opts = opts + CMD.OPT_META + end + if cmdOpts.right then + opts = opts + CMD.OPT_RIGHT + end local x, y, z = cmdParams[1], cmdParams[2], cmdParams[3] @@ -111,10 +118,10 @@ function gadget:CommandNotify(cmdID, cmdParams, cmdOpts) Spring.SelectUnitArray(fightUnits) if cmdOpts.shift then - Spring.GiveOrder(CMD_FIGHT, {x, y, z}, opts + CMD.OPT_SHIFT) + Spring.GiveOrder(CMD_FIGHT, { x, y, z }, opts + CMD.OPT_SHIFT) else Spring.GiveOrder(CMD_STOP, {}, 0) - Spring.GiveOrder(CMD_FIGHT, {x, y, z}, opts + CMD.OPT_SHIFT) + Spring.GiveOrder(CMD_FIGHT, { x, y, z }, opts + CMD.OPT_SHIFT) end Spring.SelectUnitArray(selUnits) diff --git a/luarules/gadgets/unit_attached_con_turret.lua b/luarules/gadgets/unit_attached_con_turret.lua index e99a461ac92..95e83a79b13 100644 --- a/luarules/gadgets/unit_attached_con_turret.lua +++ b/luarules/gadgets/unit_attached_con_turret.lua @@ -1,23 +1,22 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Attached Construction Turret', - desc = 'Attaches a builder to another mobile unit, so builder can repair while moving', - author = 'Itanthias', - version = 'v1.1', - date = 'July 2023', - license = 'GNU GPL, v2 or later', - layer = 12, - enabled = true - } + return { + name = "Attached Construction Turret", + desc = "Attaches a builder to another mobile unit, so builder can repair while moving", + author = "Itanthias", + version = "v1.1", + date = "July 2023", + license = "GNU GPL, v2 or later", + layer = 12, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end - local CMD_REPAIR = CMD.REPAIR local CMD_RECLAIM = CMD.RECLAIM local CMD_STOP = CMD.STOP @@ -48,63 +47,61 @@ local SpCallCOBScript = Spring.CallCOBScript --so we need to increase our search radius by the maximum unit radius local max_unit_radius = 0 function gadget:Initialize() - local radius = 0 for ix, udef in pairs(UnitDefs) do dimensions = SpGetUnitDefDimensions(udef.id) radius = dimensions.radius max_unit_radius = math.max(radius, max_unit_radius) end - end local function auto_repair_routine(nanoID, unitDefID, baseUnitID) local transporterID = SpGetUnitTransporter(baseUnitID) if transporterID then Spring.GiveOrderToUnit(nanoID, CMD_STOP, {}, 0) - return + return end -- first, check command the body is performing local commandQueue = SpGetUnitCommands(attached_builders[nanoID], 1) - if (commandQueue[1] ~= nil and commandQueue[1]["id"] < 0) then - -- build command + if commandQueue[1] ~= nil and commandQueue[1]["id"] < 0 then + -- build command -- The attached turret must have the same buildlist as the body for this to work correctly --for XX, YY, baseUnitID in pairs(commandQueue[1]["params"]) do -- Spring.Echo(XX, YY) --end - SpGiveOrderToUnit(nanoID, commandQueue[1]["id"], commandQueue[1]["params"]) - end - if (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_REPAIR) then - -- repair command + SpGiveOrderToUnit(nanoID, commandQueue[1]["id"], commandQueue[1]["params"]) + end + if commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_REPAIR then + -- repair command --for XX, YY, baseUnitID in pairs(commandQueue[1]["params"]) do -- Spring.Echo(XX, YY) --end if #commandQueue[1]["params"] ~= 4 then SpGiveOrderToUnit(nanoID, CMD_REPAIR, commandQueue[1]["params"]) end - end - if (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_RECLAIM) then - -- reclaim command + end + if commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_RECLAIM then + -- reclaim command if #commandQueue[1]["params"] ~= 4 then SpGiveOrderToUnit(nanoID, CMD_RECLAIM, commandQueue[1]["params"]) end - end + end -- next, check to see if current command (including command from chassis) is in range commandQueue = SpGetUnitCommands(nanoID, 1) local ux, uy, uz = SpGetUnitPosition(nanoID) local tx, ty, tz local radius = UnitDefs[unitDefID].buildDistance - local distance = radius^2 + 1 + local distance = radius ^ 2 + 1 local object_radius = 0 - if (commandQueue[1] ~= nil and commandQueue[1]["id"] < 0) then - -- out of range build command + if commandQueue[1] ~= nil and commandQueue[1]["id"] < 0 then + -- out of range build command object_radius = SpGetUnitDefDimensions(-commandQueue[1]["id"]).radius - distance = math.sqrt((ux-commandQueue[1]["params"][1])^2 + (uz-commandQueue[1]["params"][3])^2) - object_radius - end - if (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_REPAIR) then - -- out of range repair command - if (commandQueue[1]["params"][1] >= Game.maxUnits) then + distance = math.sqrt((ux - commandQueue[1]["params"][1]) ^ 2 + (uz - commandQueue[1]["params"][3]) ^ 2) - object_radius + end + if commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_REPAIR then + -- out of range repair command + if commandQueue[1]["params"][1] >= Game.maxUnits then tx, ty, tz = SpGetFeaturePosition(commandQueue[1]["params"][1] - Game.maxUnits) object_radius = SpGetFeatureRadius(commandQueue[1]["params"][1] - Game.maxUnits) else @@ -112,12 +109,12 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) object_radius = SpGetUnitRadius(commandQueue[1]["params"][1]) end if tx ~= nil then - distance = math.sqrt((ux-tx)^2 + (uz-tz)^2) - object_radius + distance = math.sqrt((ux - tx) ^ 2 + (uz - tz) ^ 2) - object_radius end - end - if (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_RECLAIM) then + end + if commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_RECLAIM then -- out of range reclaim command - if (commandQueue[1]["params"][1] >= Game.maxUnits) then + if commandQueue[1]["params"][1] >= Game.maxUnits then tx, ty, tz = SpGetFeaturePosition(commandQueue[1]["params"][1] - Game.maxUnits) object_radius = SpGetFeatureRadius(commandQueue[1]["params"][1] - Game.maxUnits) else @@ -125,15 +122,15 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) object_radius = SpGetUnitRadius(commandQueue[1]["params"][1]) end if tx ~= nil then - distance = math.sqrt((ux-tx)^2 + (uz-tz)^2) - object_radius + distance = math.sqrt((ux - tx) ^ 2 + (uz - tz) ^ 2) - object_radius end - end + end if tx and distance <= radius then --let auto con turret continue its thing --update heading, by calling into unit script - heading1 = SpGetHeadingFromVector(ux-tx, uz-tz) + heading1 = SpGetHeadingFromVector(ux - tx, uz - tz) heading2 = SpGetUnitHeading(nanoID) - SpCallCOBScript(nanoID, 'UpdateHeading', 0, heading1-heading2+32768) + SpCallCOBScript(nanoID, "UpdateHeading", 0, heading1 - heading2 + 32768) return end @@ -144,10 +141,10 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) -- check for free repairs local near_defid = SpGetUnitDefID(near_unit) if SpGetUnitAllyTeam(near_unit) == SpGetUnitAllyTeam(nanoID) then - if ( (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius) then + if (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius then local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = SpGetUnitHealth(near_unit) if buildProgress == 1 and health < maxHealth and UnitDefs[near_defid].repairable and near_unit ~= attached_builders[nanoID] then - SpGiveOrderToUnit(nanoID, CMD_REPAIR, {near_unit}) + SpGiveOrderToUnit(nanoID, CMD_REPAIR, { near_unit }) return end end @@ -158,9 +155,9 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) -- check for enemy to reclaim local near_defid = SpGetUnitDefID(near_unit) if SpGetUnitAllyTeam(near_unit) ~= SpGetUnitAllyTeam(nanoID) then - if ( (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius) then + if (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius then if UnitDefs[near_defid].reclaimable then - SpGiveOrderToUnit(nanoID, CMD_RECLAIM, {near_unit}) + SpGiveOrderToUnit(nanoID, CMD_RECLAIM, { near_unit }) return end end @@ -171,9 +168,9 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) for XX, near_feature in pairs(near_features) do -- check for non resurrectable feature to reclaim local near_defid = SpGetFeatureDefID(near_feature) - if ( (SpGetUnitFeatureSeparation(nanoID, near_feature, true) - SpGetFeatureRadius(near_feature)) < radius) then + if (SpGetUnitFeatureSeparation(nanoID, near_feature, true) - SpGetFeatureRadius(near_feature)) < radius then if FeatureDefs[near_defid].reclaimable and SpGetFeatureResurrect(near_feature) == "" then - SpGiveOrderToUnit(nanoID, CMD_RECLAIM, {near_feature+Game.maxUnits}) + SpGiveOrderToUnit(nanoID, CMD_RECLAIM, { near_feature + Game.maxUnits }) return end end @@ -182,9 +179,9 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) for XX, near_unit in pairs(near_units) do -- check for nanoframe to build if SpGetUnitAllyTeam(near_unit) == SpGetUnitAllyTeam(nanoID) then - if ( (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius) then + if (SpGetUnitSeparation(near_unit, nanoID, true) - SpGetUnitRadius(near_unit)) < radius then if SpGetUnitIsBeingBuilt(near_unit) then - SpGiveOrderToUnit(nanoID, CMD_REPAIR, {near_unit}) + SpGiveOrderToUnit(nanoID, CMD_REPAIR, { near_unit }) return end end @@ -193,7 +190,6 @@ local function auto_repair_routine(nanoID, unitDefID, baseUnitID) -- give stop command to attached con turret if nothing to do SpGiveOrderToUnit(nanoID, CMD.STOP) - end attached_builders = {} @@ -204,12 +200,11 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - local unitDef = UnitDefs[unitDefID] -- for now, just corvac gets an attached con turret if unitDef.name == "corvac" then local xx, yy, zz = SpGetUnitPosition(unitID) - nanoID = Spring.CreateUnit("corvacct", xx, yy, zz, 0, Spring.GetUnitTeam(unitID) ) + nanoID = Spring.CreateUnit("corvacct", xx, yy, zz, 0, Spring.GetUnitTeam(unitID)) if not nanoID then -- unit limit hit or invalid spawn surface return @@ -223,28 +218,25 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) end if unitDef.name == "legmohobp" then local xx, yy, zz = SpGetUnitPosition(unitID) - nanoID = Spring.CreateUnit("legmohobpct", xx, yy, zz, 0, Spring.GetUnitTeam(unitID) ) + nanoID = Spring.CreateUnit("legmohobpct", xx, yy, zz, 0, Spring.GetUnitTeam(unitID)) if not nanoID then -- unit limit hit or invalid spawn surface return end Spring.UnitAttach(unitID, nanoID, 3) - -- makes the attached con turret as non-interacting as possible + -- makes the attached con turret as non-interacting as possible Spring.SetUnitBlocking(nanoID, false, false, false) - Spring.SetUnitNoSelect(nanoID, false) + Spring.SetUnitNoSelect(nanoID, false) attached_builders[nanoID] = unitID attached_builder_def[nanoID] = SpGetUnitDefID(nanoID) end - end function gadget:GameFrame(gameFrame) - if gameFrame % 15 == 0 then - -- go on a slowupdate cycle - for nanoID, baseUnitID in pairs(attached_builders) do + -- go on a slowupdate cycle + for nanoID, baseUnitID in pairs(attached_builders) do auto_repair_routine(nanoID, attached_builder_def[nanoID], baseUnitID) end end - end diff --git a/luarules/gadgets/unit_attached_con_turret_mex.lua b/luarules/gadgets/unit_attached_con_turret_mex.lua index 8dbc2ac0a85..74e74284fdb 100644 --- a/luarules/gadgets/unit_attached_con_turret_mex.lua +++ b/luarules/gadgets/unit_attached_con_turret_mex.lua @@ -1,20 +1,20 @@ local gadget = gadget ---@class Gadget function gadget:GetInfo() - return { - name = 'Legion Con Turret Metal Extractor', - desc = 'Allows the mex to function as a con turret by replacing it with a fake mex with a con turret attached', - author = 'EnderRobo', - version = 'v2', - date = 'September 2024', - license = 'GNU GPL, v2 or later', - layer = 12, -- TODO: Why? - enabled = true, -- auto-disables - } + return { + name = "Legion Con Turret Metal Extractor", + desc = "Allows the mex to function as a con turret by replacing it with a fake mex with a con turret attached", + author = "EnderRobo", + version = "v2", + date = "September 2024", + license = "GNU GPL, v2 or later", + layer = 12, -- TODO: Why? + enabled = true, -- auto-disables + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local spGetUnitHealth = Spring.GetUnitHealth @@ -148,15 +148,15 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) mexesToSwap[unitID] = { swapDefs = swapDefs, - x = ux, - y = uy, - z = uz, - facing = Spring.GetUnitBuildFacing(unitID), - metal = metalCost, - energy = energyCost, - frame = Spring.GetGameFrame() + 1, + x = ux, + y = uy, + z = uz, + facing = Spring.GetUnitBuildFacing(unitID), + metal = metalCost, + energy = energyCost, + frame = Spring.GetGameFrame() + 1, } - end + end end function gadget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) @@ -168,7 +168,7 @@ function gadget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) if pairedID and pairedID ~= 0 then Spring.TransferUnit(pairedID, newTeam) end - end + end end local function doUnitDamaged(unitID, unitDefID, unitTeam, damage) @@ -181,7 +181,7 @@ local function doUnitDamaged(unitID, unitDefID, unitTeam, damage) -- todo: "damage" is not "recent damage" is not "damage severity" if damage < maxHealth * 0.25 then - local featureID = Spring.CreateFeature(buildAsUnitName .. "_dead" , xx, yy, zz, facing, unitTeam) + local featureID = Spring.CreateFeature(buildAsUnitName .. "_dead", xx, yy, zz, facing, unitTeam) if featureID then Spring.SetFeatureResurrect(featureID, buildAsUnitName, facing, 0) end @@ -192,8 +192,8 @@ local function doUnitDamaged(unitID, unitDefID, unitTeam, damage) end function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if mexTurretDefID[unitDefID] and not paralyzer then - doUnitDamaged(unitID, unitDefID, unitTeam, damage) - end + doUnitDamaged(unitID, unitDefID, unitTeam, damage) + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) diff --git a/luarules/gadgets/unit_attributes.lua b/luarules/gadgets/unit_attributes.lua index ef2cd69b074..90837eb8117 100644 --- a/luarules/gadgets/unit_attributes.lua +++ b/luarules/gadgets/unit_attributes.lua @@ -1,4 +1,3 @@ - if not Spring.GetModOptions().emprework then return end @@ -6,23 +5,21 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Attributes", - desc = "Handles UnitRulesParam attributes.", - author = "CarRepairer & Google Frog", - date = "2009-11-27", --last update 2014-2-19 - license = "GNU GPL, v2 or later", - layer = -1, - enabled = true, - } + return { + name = "Attributes", + desc = "Handles UnitRulesParam attributes.", + author = "CarRepairer & Google Frog", + date = "2009-11-27", --last update 2014-2-19 + license = "GNU GPL, v2 or later", + layer = -1, + enabled = true, + } end - if not gadgetHandler:IsSyncedCode() then return end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -32,28 +29,28 @@ local UPDATE_PERIOD = 3 -------------------------------------------------------------------------------- local floor = math.floor -local spValidUnitID = Spring.ValidUnitID -local spGetUnitDefID = Spring.GetUnitDefID -local spGetGameFrame = Spring.GetGameFrame -local spGetUnitRulesParam = Spring.GetUnitRulesParam -local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spValidUnitID = Spring.ValidUnitID +local spGetUnitDefID = Spring.GetUnitDefID +local spGetGameFrame = Spring.GetGameFrame +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spSetUnitBuildSpeed = Spring.SetUnitBuildSpeed -local spSetUnitWeaponState = Spring.SetUnitWeaponState -local spGetUnitWeaponState = Spring.GetUnitWeaponState +local spSetUnitBuildSpeed = Spring.SetUnitBuildSpeed +local spSetUnitWeaponState = Spring.SetUnitWeaponState +local spGetUnitWeaponState = Spring.GetUnitWeaponState -local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData -local spMoveCtrlGetTag = Spring.MoveCtrl.GetTag -local spSetAirMoveTypeData = Spring.MoveCtrl.SetAirMoveTypeData +local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData +local spMoveCtrlGetTag = Spring.MoveCtrl.GetTag +local spSetAirMoveTypeData = Spring.MoveCtrl.SetAirMoveTypeData local spSetGunshipMoveTypeData = Spring.MoveCtrl.SetGunshipMoveTypeData -local spSetGroundMoveTypeData = Spring.MoveCtrl.SetGroundMoveTypeData +local spSetGroundMoveTypeData = Spring.MoveCtrl.SetGroundMoveTypeData -local INLOS_ACCESS = {inlos = true} +local INLOS_ACCESS = { inlos = true } local spSetUnitCOBValue = Spring.SetUnitCOBValue local WACKY_CONVERSION_FACTOR_1 = 2184.53 -local HALF_FRAME = 1/60 +local HALF_FRAME = 1 / 60 local mathMin = math.min local mathFloor = math.floor local mathCeil = math.ceil @@ -62,12 +59,12 @@ local mathMax = math.max local workingGroundMoveType = true -- not ((Spring.GetModOptions() and (Spring.GetModOptions().pathfinder == "classic") and true) or false) -- For generic attributes support -GG.att_moveMult = GG.att_moveMult or {} -GG.att_turnMult = GG.att_turnMult or {} -GG.att_accelMult = GG.att_accelMult or {} +GG.att_moveMult = GG.att_moveMult or {} +GG.att_turnMult = GG.att_turnMult or {} +GG.att_accelMult = GG.att_accelMult or {} GG.att_reloadMult = GG.att_reloadMult or {} -GG.att_econMult = GG.att_econMult or {} -GG.att_buildMult = GG.att_buildMult or {} +GG.att_econMult = GG.att_econMult or {} +GG.att_buildMult = GG.att_buildMult or {} GG.att_weaponMods = GG.att_weaponMods or {} -- To tell other gadgets things without creating RulesParams @@ -75,14 +72,6 @@ GG.att_out_buildSpeed = {} local allowUnitCoast = {} - - - - - - - - local function getMovetype(ud) if ud.canFly or ud.isAirUnit then if ud.isHoveringAirUnit then @@ -96,8 +85,6 @@ local function getMovetype(ud) return false -- For structures or any other invalid movetype end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- UnitDefs caching @@ -106,7 +93,6 @@ local shieldWeaponDef = {} local buildSpeedDef = {} local reclaimSpeedDef = {} - for i = 1, #UnitDefs do local ud = UnitDefs[i] if ud.shieldWeaponDef then @@ -114,10 +100,8 @@ for i = 1, #UnitDefs do end --Spring.Echo(ud.name) if (ud.buildSpeed or 0) ~= 0 then - buildSpeedDef[i] = ud.buildSpeed reclaimSpeedDef[i] = ud.reclaimSpeed or 0 - end end @@ -129,7 +113,7 @@ for unitDefID, ud in pairs(UnitDefs) do if (ud.radarDistance or 0) > 0 then radarUnitDef[unitDefID] = ud.radarDistance end - if (ud.sonarDistance or 0) > 0 then-- and tobool(ud.customParams.sonar_can_be_disabled) + if (ud.sonarDistance or 0) > 0 then -- and tobool(ud.customParams.sonar_can_be_disabled) sonarUnitDef[unitDefID] = ud.sonarDistance end if (ud.radarDistanceJam or 0) > 0 then @@ -141,7 +125,6 @@ end -------------------------------------------------------------------------------- -- Sensor Handling - local function UpdateSensorAndJamm(unitID, unitDefID, enabled, radarOverride, sonarOverride, jammerOverride, sightOverride) if radarUnitDef[unitDefID] or radarOverride then Spring.SetUnitSensorRadius(unitID, "radar", (enabled and (radarOverride or radarUnitDef[unitDefID])) or 0) @@ -162,7 +145,6 @@ end -------------------------------------------------------------------------------- -- Build Speed Handling - local function UpdateBuildSpeed(unitID, unitDefID, speedFactor) local buildSpeed = (buildSpeedDef[unitDefID] or 0) local reclaimSpeed = (reclaimSpeedDef[unitDefID] or 0) @@ -170,20 +152,20 @@ local function UpdateBuildSpeed(unitID, unitDefID, speedFactor) return end - --Spring.Echo('hornet debug updatebuildspeed') --Spring.Echo(speedFactor) --Spring.Echo(buildSpeed*speedFactor / REPAIR_ENERGY_COST_FACTOR) --Spring.Echo(buildSpeed) - GG.att_out_buildSpeed[unitID] = buildSpeed*speedFactor - - spSetUnitBuildSpeed(unitID, - buildSpeed*speedFactor, -- build - buildSpeed*speedFactor, -- repair - reclaimSpeed*speedFactor, -- reclaim - buildSpeed*speedFactor) -- rezz + GG.att_out_buildSpeed[unitID] = buildSpeed * speedFactor + spSetUnitBuildSpeed( + unitID, + buildSpeed * speedFactor, -- build + buildSpeed * speedFactor, -- repair + reclaimSpeed * speedFactor, -- reclaim + buildSpeed * speedFactor + ) -- rezz end -------------------------------------------------------------------------------- @@ -191,7 +173,7 @@ end -- Economy Handling local function UpdateEconomy(unitID, unitDefID, factor) - spSetUnitRulesParam(unitID,"resourceGenerationFactor", factor, INLOS_ACCESS) + spSetUnitRulesParam(unitID, "resourceGenerationFactor", factor, INLOS_ACCESS) end -------------------------------------------------------------------------------- @@ -205,15 +187,15 @@ local function UpdatePausedReload(unitID, unitDefID, gameFrame) local state = origUnitReload[unitDefID] for i = 1, state.weaponCount do - local reloadState = spGetUnitWeaponState(unitID, i , 'reloadState') + local reloadState = spGetUnitWeaponState(unitID, i, "reloadState") if reloadState then - local reloadTime = spGetUnitWeaponState(unitID, i , 'reloadTime') + local reloadTime = spGetUnitWeaponState(unitID, i, "reloadTime") local newReload = 100000 -- set a high reload time so healthbars don't judder. NOTE: math.huge is TOO LARGE if reloadState < 0 then -- unit is already reloaded, so set unit to almost reloaded - spSetUnitWeaponState(unitID, i, {reloadTime = newReload, reloadState = gameFrame+UPDATE_PERIOD+1}) + spSetUnitWeaponState(unitID, i, { reloadTime = newReload, reloadState = gameFrame + UPDATE_PERIOD + 1 }) else - local nextReload = gameFrame+(reloadState-gameFrame)*newReload/reloadTime - spSetUnitWeaponState(unitID, i, {reloadTime = newReload, reloadState = nextReload+UPDATE_PERIOD}) + local nextReload = gameFrame + (reloadState - gameFrame) * newReload / reloadTime + spSetUnitWeaponState(unitID, i, { reloadTime = newReload, reloadState = nextReload + UPDATE_PERIOD }) end end end @@ -235,13 +217,12 @@ local function UpdateReloadSpeed(unitID, unitDefID, weaponMods, speedFactor, gam state.weapon[i] = { reload = reload, burstRate = wd.salvoDelay, - oldReloadFrames = mathFloor(reload*30), + oldReloadFrames = mathFloor(reload * 30), } if wd.type == "BeamLaser" then state.weapon[i].burstRate = false -- beamlasers go screwy if you mess with their burst length end end - end local state = origUnitReload[unitDefID] @@ -249,18 +230,18 @@ local function UpdateReloadSpeed(unitID, unitDefID, weaponMods, speedFactor, gam for i = 1, weaponCount do local w = state.weapon[i] - local reloadState = spGetUnitWeaponState(unitID, i , 'reloadState') - local reloadTime = spGetUnitWeaponState(unitID, i , 'reloadTime') + local reloadState = spGetUnitWeaponState(unitID, i, "reloadState") + local reloadTime = spGetUnitWeaponState(unitID, i, "reloadTime") if speedFactor <= 0 then if not unitReloadPaused[unitID] then local newReload = 100000 -- set a high reload time so healthbars don't judder. NOTE: math.huge is TOO LARGE unitReloadPaused[unitID] = unitDefID spSetUnitRulesParam(unitID, "reloadPaused", 1, INLOS_ACCESS) if reloadState < gameFrame then -- unit is already reloaded, so set unit to almost reloaded - spSetUnitWeaponState(unitID, i, {reloadTime = newReload, reloadState = gameFrame+UPDATE_PERIOD+1}) + spSetUnitWeaponState(unitID, i, { reloadTime = newReload, reloadState = gameFrame + UPDATE_PERIOD + 1 }) else - local nextReload = gameFrame+(reloadState-gameFrame)*newReload/reloadTime - spSetUnitWeaponState(unitID, i, {reloadTime = newReload, reloadState = nextReload+UPDATE_PERIOD}) + local nextReload = gameFrame + (reloadState - gameFrame) * newReload / reloadTime + spSetUnitWeaponState(unitID, i, { reloadTime = newReload, reloadState = nextReload + UPDATE_PERIOD }) end -- add UPDATE_PERIOD so that the reload time never advances past what it is now end @@ -269,14 +250,14 @@ local function UpdateReloadSpeed(unitID, unitDefID, weaponMods, speedFactor, gam unitReloadPaused[unitID] = nil spSetUnitRulesParam(unitID, "reloadPaused", 0, INLOS_ACCESS) end - local moddedSpeed = ((weaponMods and weaponMods[i] and weaponMods[i].reloadMult) or 1)*speedFactor - local newReload = w.reload/moddedSpeed - local nextReload = gameFrame+(reloadState-gameFrame)*newReload/reloadTime + local moddedSpeed = ((weaponMods and weaponMods[i] and weaponMods[i].reloadMult) or 1) * speedFactor + local newReload = w.reload / moddedSpeed + local nextReload = gameFrame + (reloadState - gameFrame) * newReload / reloadTime -- Add HALF_FRAME to round reloadTime to the closest multiple of 1/30, since the the engine rounds down to a multiple of 1/30. if w.burstRate then - spSetUnitWeaponState(unitID, i, {reloadTime = newReload + HALF_FRAME, reloadState = nextReload, burstRate = w.burstRate/moddedSpeed + HALF_FRAME}) + spSetUnitWeaponState(unitID, i, { reloadTime = newReload + HALF_FRAME, reloadState = nextReload, burstRate = w.burstRate / moddedSpeed + HALF_FRAME }) else - spSetUnitWeaponState(unitID, i, {reloadTime = newReload + HALF_FRAME, reloadState = nextReload}) + spSetUnitWeaponState(unitID, i, { reloadTime = newReload + HALF_FRAME, reloadState = nextReload }) end end end @@ -304,23 +285,14 @@ local function UpdateMovementSpeed(unitID, unitDefID, speedFactor, turnAccelFact local state = origUnitSpeed[unitDefID] - - - --Spring.Echo('hornetdebug movedata') --Spring.Echo(moveData) --for k,v in pairs(moveData) do - -- Spring.Echo(k,v) + -- Spring.Echo(k,v) --end - - --- - - - - state.movetype = getMovetype(ud) end @@ -339,7 +311,7 @@ local function UpdateMovementSpeed(unitID, unitDefID, speedFactor, turnAccelFact if x then local h = Spring.GetGroundHeight(x, z) if h and h >= y then - Spring.SetUnitVelocity(unitID, 0,0,0) + Spring.SetUnitVelocity(unitID, 0, 0, 0) -- Perhaps attributes should do this: --local env = Spring.UnitScript.GetScriptEnv(unitID) @@ -363,46 +335,45 @@ local function UpdateMovementSpeed(unitID, unitDefID, speedFactor, turnAccelFact if spMoveCtrlGetTag(unitID) == nil then if state.movetype == 0 then local attribute = { - maxSpeed = state.origSpeed *speedFactor, - maxAcc = state.origMaxAcc *maxAccelerationFactor, --(speedFactor > 0.001 and speedFactor or 0.001) + maxSpeed = state.origSpeed * speedFactor, + maxAcc = state.origMaxAcc * maxAccelerationFactor, --(speedFactor > 0.001 and speedFactor or 0.001) } - spSetAirMoveTypeData (unitID, attribute) + spSetAirMoveTypeData(unitID, attribute) elseif state.movetype == 1 then - local attribute = { - maxSpeed = state.origSpeed *speedFactor, + local attribute = { + maxSpeed = state.origSpeed * speedFactor, --maxReverseSpeed = state.origReverseSpeed*speedFactor, - turnRate = state.origTurnRate *turnFactor, - accRate = state.origMaxAcc *maxAccelerationFactor, - decRate = state.origMaxDec *maxAccelerationFactor + turnRate = state.origTurnRate * turnFactor, + accRate = state.origMaxAcc * maxAccelerationFactor, + decRate = state.origMaxDec * maxAccelerationFactor, } - spSetGunshipMoveTypeData (unitID, attribute) + spSetGunshipMoveTypeData(unitID, attribute) GG.ForceUpdateWantedMaxSpeed(unitID, unitDefID) elseif state.movetype == 2 then if workingGroundMoveType then - local accRate = state.origMaxAcc*maxAccelerationFactor + local accRate = state.origMaxAcc * maxAccelerationFactor if isSlowed and accRate > speedFactor then -- Clamp acceleration to mitigate prevent brief speedup when executing new order -- 1 is here as an arbitary factor, there is no nice conversion which means that 1 is a good value. accRate = speedFactor end - local attribute = { - maxSpeed = state.origSpeed *speedFactor, + local attribute = { + maxSpeed = state.origSpeed * speedFactor, maxReverseSpeed = (isSlowed and 0) or state.origReverseSpeed, --disallow reverse while slowed - turnRate = state.origTurnRate *turnFactor, - accRate = accRate, - decRate = state.origMaxDec *decFactor, - turnAccel = state.origTurnRate *turnAccelFactor*1.2, + turnRate = state.origTurnRate * turnFactor, + accRate = accRate, + decRate = state.origMaxDec * decFactor, + turnAccel = state.origTurnRate * turnAccelFactor * 1.2, } - spSetGroundMoveTypeData (unitID, attribute) + spSetGroundMoveTypeData(unitID, attribute) GG.ForceUpdateWantedMaxSpeed(unitID, unitDefID) else --Spring.Echo(state.origSpeed*speedFactor*WACKY_CONVERSION_FACTOR_1) --Spring.Echo(Spring.GetUnitCOBValue(unitID, COB.MAX_SPEED)) - spSetUnitCOBValue(unitID, COB.MAX_SPEED, math.ceil(state.origSpeed*speedFactor*WACKY_CONVERSION_FACTOR_1)) + spSetUnitCOBValue(unitID, COB.MAX_SPEED, math.ceil(state.origSpeed * speedFactor * WACKY_CONVERSION_FACTOR_1)) end end end - end -------------------------------------------------------------------------------- @@ -443,7 +414,6 @@ local function removeUnit(unitID) GG.att_out_buildSpeed[unitID] = nil end - --Spring.Echo("Hornet debug UpdateUnitAttributes defined") function UpdateUnitAttributes(unitID, frame) @@ -461,65 +431,64 @@ function UpdateUnitAttributes(unitID, frame) local changedAtt = false -- Increased reload from CAPTURE -- - local selfReloadSpeedChange = spGetUnitRulesParam(unitID,"selfReloadSpeedChange") + local selfReloadSpeedChange = spGetUnitRulesParam(unitID, "selfReloadSpeedChange") - local disarmed = spGetUnitRulesParam(unitID,"disarmed") or 0 - local completeDisable = (spGetUnitRulesParam(unitID,"morphDisable") or 0) - if spGetUnitRulesParam(unitID,"planetwarsDisable") == 1 then + local disarmed = spGetUnitRulesParam(unitID, "disarmed") or 0 + local completeDisable = (spGetUnitRulesParam(unitID, "morphDisable") or 0) + if spGetUnitRulesParam(unitID, "planetwarsDisable") == 1 then completeDisable = 1 end - local crashing = spGetUnitRulesParam(unitID,"crashing") or 0 + local crashing = spGetUnitRulesParam(unitID, "crashing") or 0 -- Unit speed change (like sprint) -- - local upgradesSpeedMult = spGetUnitRulesParam(unitID, "upgradesSpeedMult") + local upgradesSpeedMult = spGetUnitRulesParam(unitID, "upgradesSpeedMult") local selfMoveSpeedChange = spGetUnitRulesParam(unitID, "selfMoveSpeedChange") local selfTurnSpeedChange = spGetUnitRulesParam(unitID, "selfTurnSpeedChange") local selfIncomeChange = (spGetUnitRulesParam(unitID, "selfIncomeChange") or 1) local selfMaxAccelerationChange = spGetUnitRulesParam(unitID, "selfMaxAccelerationChange") --only exist in airplane?? -- SLOW -- - local slowState = spGetUnitRulesParam(unitID,"slowState") + local slowState = spGetUnitRulesParam(unitID, "slowState") local reloadslowState = slowState if slowState and slowState > 0.9 then slowState = 0.9 -- Maximum slow --maybe tie to global ? end - local zombieSpeedMult = spGetUnitRulesParam(unitID,"zombieSpeedMult") + local zombieSpeedMult = spGetUnitRulesParam(unitID, "zombieSpeedMult") local buildpowerMult = spGetUnitRulesParam(unitID, "buildpower_mult") -- Disable local shieldDisabled = (spGetUnitRulesParam(unitID, "shield_disabled") == 1) - local fullDisable = (spGetUnitRulesParam(unitID, "fulldisable") == 1) + local fullDisable = (spGetUnitRulesParam(unitID, "fulldisable") == 1) local weaponMods = false if GG.att_genericUsed and GG.att_moveMult[unitID] then - selfMoveSpeedChange = (selfMoveSpeedChange or 1)*GG.att_moveMult[unitID] - selfTurnSpeedChange = (selfTurnSpeedChange or 1)*GG.att_turnMult[unitID]/GG.att_moveMult[unitID] - selfMaxAccelerationChange = (selfMaxAccelerationChange or 1)*GG.att_accelMult[unitID] + selfMoveSpeedChange = (selfMoveSpeedChange or 1) * GG.att_moveMult[unitID] + selfTurnSpeedChange = (selfTurnSpeedChange or 1) * GG.att_turnMult[unitID] / GG.att_moveMult[unitID] + selfMaxAccelerationChange = (selfMaxAccelerationChange or 1) * GG.att_accelMult[unitID] - selfReloadSpeedChange = (selfReloadSpeedChange or 1)*GG.att_reloadMult[unitID] - selfIncomeChange = (selfIncomeChange or 1)*GG.att_econMult[unitID] - buildpowerMult = (buildpowerMult or 1)*GG.att_buildMult[unitID]/GG.att_econMult[unitID] + selfReloadSpeedChange = (selfReloadSpeedChange or 1) * GG.att_reloadMult[unitID] + selfIncomeChange = (selfIncomeChange or 1) * GG.att_econMult[unitID] + buildpowerMult = (buildpowerMult or 1) * GG.att_buildMult[unitID] / GG.att_econMult[unitID] weaponMods = GG.att_weaponMods[unitID] end - if weaponMods or fullDisable or selfReloadSpeedChange or selfMoveSpeedChange or slowState or zombieSpeedMult or buildpowerMult or - selfTurnSpeedChange or selfIncomeChange or disarmed or completeDisable or selfMaxAccelerationChange then - - local baseSpeedMult = (1 - (slowState or 0))*(zombieSpeedMult or 1) + if weaponMods or fullDisable or selfReloadSpeedChange or selfMoveSpeedChange or slowState or zombieSpeedMult or buildpowerMult or selfTurnSpeedChange or selfIncomeChange or disarmed or completeDisable or selfMaxAccelerationChange then + local baseSpeedMult = (1 - (slowState or 0)) * (zombieSpeedMult or 1) - local econMult = (baseSpeedMult)*(1 - disarmed)*(1 - completeDisable)*(selfIncomeChange or 1) - local buildMult = (baseSpeedMult)*(1 - disarmed)*(1 - completeDisable)*(selfIncomeChange or 1)*(buildpowerMult or 1) - local moveMult = (baseSpeedMult)*(selfMoveSpeedChange or 1)*(1 - completeDisable)*(upgradesSpeedMult or 1) - local turnMult = (baseSpeedMult)*(selfMoveSpeedChange or 1)*(selfTurnSpeedChange or 1)*(1 - completeDisable) + local econMult = baseSpeedMult * (1 - disarmed) * (1 - completeDisable) * (selfIncomeChange or 1) + local buildMult = baseSpeedMult * (1 - disarmed) * (1 - completeDisable) * (selfIncomeChange or 1) * (buildpowerMult or 1) + local moveMult = baseSpeedMult * (selfMoveSpeedChange or 1) * (1 - completeDisable) * (upgradesSpeedMult or 1) + local turnMult = baseSpeedMult * (selfMoveSpeedChange or 1) * (selfTurnSpeedChange or 1) * (1 - completeDisable) --local reloadMult = (baseSpeedMult)*(selfReloadSpeedChange or 1)*(1 - disarmed)*(1 - completeDisable) - local reloadMult = mathMin(1, (1 - (reloadslowState*2))) *(1 - disarmed)*(1 - completeDisable) - local maxAccMult = (baseSpeedMult)*(selfMaxAccelerationChange or 1)*(upgradesSpeedMult or 1) - + local reloadMult = mathMin(1, (1 - (reloadslowState * 2))) * (1 - disarmed) * (1 - completeDisable) + local maxAccMult = baseSpeedMult * (selfMaxAccelerationChange or 1) * (upgradesSpeedMult or 1) if reloadslowState then - if reloadMult<0 then reloadMult = 0 end + if reloadMult < 0 then + reloadMult = 0 + end else reloadMult = 0 end @@ -555,7 +524,7 @@ function UpdateUnitAttributes(unitID, frame) end if currentMovement[unitID] ~= moveMult or currentTurn[unitID] ~= turnMult or currentAcc[unitID] ~= maxAccMult then - UpdateMovementSpeed(unitID, unitDefID, moveMult, turnMult, maxAccMult*moveMult) + UpdateMovementSpeed(unitID, unitDefID, moveMult, turnMult, maxAccMult * moveMult) currentMovement[unitID] = moveMult currentTurn[unitID] = turnMult currentAcc[unitID] = maxAccMult @@ -611,7 +580,7 @@ function UpdateUnitAttributes(unitID, frame) UpdateSensorAndJamm(unitID, unitDefID, not abilityDisabled, radarOverride, sonarOverride, jammerOverride, sightOverride) end - local cloakBlocked = (spGetUnitRulesParam(unitID,"on_fire") == 1) or (disarmed == 1) or (completeDisable == 1) + local cloakBlocked = (spGetUnitRulesParam(unitID, "on_fire") == 1) or (disarmed == 1) or (completeDisable == 1) if cloakBlocked then GG.PokeDecloakUnit(unitID, unitDefID) end @@ -632,7 +601,6 @@ function gadget:Initialize() GG.SetAllowUnitCoast = SetAllowUnitCoast --Spring.Echo("Hornetdebug UpdateUnitAttributes pinned to GG.") - end function gadget:GameFrame(f) @@ -654,4 +622,3 @@ end function gadget:AllowCommand_GetWantedUnitDefID() return true end - diff --git a/luarules/gadgets/unit_block_fake_geo.lua b/luarules/gadgets/unit_block_fake_geo.lua index 03af27b95d8..79eec29b6aa 100644 --- a/luarules/gadgets/unit_block_fake_geo.lua +++ b/luarules/gadgets/unit_block_fake_geo.lua @@ -6,12 +6,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Block ventless geo", - desc = "Fixes an engine bug that lets you place geos anywhere", - author = "Sprung", - date = "2023-10-16", + name = "Block ventless geo", + desc = "Fixes an engine bug that lets you place geos anywhere", + author = "Sprung", + date = "2023-10-16", license = "Public Domain", - layer = 0, + layer = 0, enabled = not Script.IsEngineMinVersion(105, 0, 2032), } end @@ -19,7 +19,7 @@ end local function isNearGeo(x, z) -- modded geos can be bigger than 40 elmo but w/e, this gadget only lives -- until next engine anyway, plus centered placement still works - local features = Spring.GetFeaturesInCylinder(x, z, 40*math.sqrt(2)) + local features = Spring.GetFeaturesInCylinder(x, z, 40 * math.sqrt(2)) for i = 1, #features do if FeatureDefs[Spring.GetFeatureDefID(features[i])].geoThermal then return true diff --git a/luarules/gadgets/unit_bomber_hide_move_state.lua b/luarules/gadgets/unit_bomber_hide_move_state.lua index 8e8b541ff86..4e71588fb2c 100644 --- a/luarules/gadgets/unit_bomber_hide_move_state.lua +++ b/luarules/gadgets/unit_bomber_hide_move_state.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Bomber Move State", - desc = "Hides the Move State button for bombers", - author = "Pexo", - date = "2026-03-03", + name = "Bomber Move State", + desc = "Hides the Move State button for bombers", + author = "Pexo", + date = "2026-03-03", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end diff --git a/luarules/gadgets/unit_bomber_no_air_target.lua b/luarules/gadgets/unit_bomber_no_air_target.lua index 84dfa2b7fe0..b5ba003cb50 100644 --- a/luarules/gadgets/unit_bomber_no_air_target.lua +++ b/luarules/gadgets/unit_bomber_no_air_target.lua @@ -2,24 +2,23 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Bomber No Air Target", - desc = "Prevents bombers from targeting air units", - author = "Floris", - date = "2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Bomber No Air Target", + desc = "Prevents bombers from targeting air units", + author = "Floris", + date = "2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- air bombers can still attack air units cause their onlytargetcategory doesnt exclude them (notsub) local isBomber = {} local isAir = {} for udid, unitDef in pairs(UnitDefs) do - if unitDef.modCategories and unitDef.modCategories['vtol'] then + if unitDef.modCategories and unitDef.modCategories["vtol"] then isAir[udid] = true end if unitDef.canFly and not unitDef.hoverAttack and unitDef.weapons and unitDef.weapons[1] then @@ -40,7 +39,7 @@ end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) -- accepts: CMD.ATTACK -- Block bombers from attacking air units (single-target only, not ground attack) - if isBomber[unitDefID] and cmdParams[2] == nil and type(cmdParams[1]) == 'number' then + if isBomber[unitDefID] and cmdParams[2] == nil and type(cmdParams[1]) == "number" then local targetDefID = Spring.GetUnitDefID(cmdParams[1]) if targetDefID and isAir[targetDefID] then return false diff --git a/luarules/gadgets/unit_builder_priority.lua b/luarules/gadgets/unit_builder_priority.lua index 557ec94e303..cb1772e7799 100644 --- a/luarules/gadgets/unit_builder_priority.lua +++ b/luarules/gadgets/unit_builder_priority.lua @@ -18,20 +18,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Builder Priority', -- this once was named: Passive Builders v3 - desc = 'Builders marked as low priority only use resources after others builder have taken their share', - author = 'BrainDamage, Bluestone', - version = '1.01', - date = '2024', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true - } + return { + name = "Builder Priority", -- this once was named: Passive Builders v3 + desc = "Builders marked as low priority only use resources after others builder have taken their share", + author = "BrainDamage, Bluestone", + version = "1.01", + date = "2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end -- These values are supposedly engine-backed: @@ -53,12 +53,12 @@ local costID = {} -- costID[unitID] (contains all non-finished units) local ruleName = "builderPriority" local CMD_PRIORITY = GameCMD.PRIORITY local cmdPassiveDesc = { - id = CMD_PRIORITY, - name = 'priority', - action = 'priority', - type = CMDTYPE.ICON_MODE, - tooltip = 'Builder Mode: Low Priority restricts build when stalling on resources', - params = {1, 'Low Prio', 'High Prio'} + id = CMD_PRIORITY, + name = "priority", + action = "priority", + type = CMDTYPE.ICON_MODE, + tooltip = "Builder Mode: Low Priority restricts build when stalling on resources", + params = { 1, "Low Prio", "High Prio" }, } local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc @@ -103,12 +103,12 @@ end for unitDefID, unitDef in pairs(UnitDefs) do -- All builders can have their build speeds changed via lua - if unitDef.buildSpeed > 0 then - unitBuildSpeed[unitDefID] = unitDef.buildSpeed - end - -- Units that can only repair, ressurrect, or capture don't have a passive mode (in this gadget) + if unitDef.buildSpeed > 0 then + unitBuildSpeed[unitDefID] = unitDef.buildSpeed + end + -- Units that can only repair, ressurrect, or capture don't have a passive mode (in this gadget) local prioritizes = ((unitDef.canAssist and unitDef.buildSpeed > 0) or #unitDef.buildOptions > 0) - canPassive[unitDefID] = prioritizes and true or nil + canPassive[unitDefID] = prioritizes and true or nil -- Minor speedup for determining total resource drain per frame/interval cost[unitDefID] = { unitDef.metalCost, unitDef.energyCost, unitDef.buildTime } end @@ -139,18 +139,18 @@ function gadget:Initialize() local allUnits = spGetAllUnits() for i = 1, #allUnits do local unitID = allUnits[i] - gadget:UnitCreated(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID)) + gadget:UnitCreated(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID)) if currentBuildSpeed[unitID] then spSetUnitBuildSpeed(unitID, currentBuildSpeed[unitID]) -- needed for luarules reloads end - end + end end function gadget:UnitCreated(unitID, unitDefID, teamID) -- Units use their full build speed, by default. - if unitBuildSpeed[unitDefID] then - canBuild[teamID][unitID] = true - realBuildSpeed[unitID] = unitBuildSpeed[unitDefID] or 0 + if unitBuildSpeed[unitDefID] then + canBuild[teamID][unitID] = true + realBuildSpeed[unitID] = unitBuildSpeed[unitDefID] or 0 -- Only units that can build other units can use passive build priority. if canPassive[unitDefID] then @@ -162,9 +162,9 @@ function gadget:UnitCreated(unitID, unitDefID, teamID) end currentBuildSpeed[unitID] = realBuildSpeed[unitID] end - end + end - costID[unitID] = cost[unitDefID] + costID[unitID] = cost[unitDefID] end function gadget:UnitFinished(unitID, unitDefID, teamID, builderID) @@ -172,48 +172,47 @@ function gadget:UnitFinished(unitID, unitDefID, teamID, builderID) end function gadget:UnitGiven(unitID, unitDefID, newTeamID, oldTeamID) - if passiveCons[oldTeamID] and passiveCons[oldTeamID][unitID] then - passiveCons[newTeamID][unitID] = passiveCons[oldTeamID][unitID] - passiveCons[oldTeamID][unitID] = nil + if passiveCons[oldTeamID] and passiveCons[oldTeamID][unitID] then + passiveCons[newTeamID][unitID] = passiveCons[oldTeamID][unitID] + passiveCons[oldTeamID][unitID] = nil passiveConsCount[oldTeamID] = (passiveConsCount[oldTeamID] or 1) - 1 passiveConsCount[newTeamID] = (passiveConsCount[newTeamID] or 0) + 1 - end + end - if canBuild[oldTeamID] and canBuild[oldTeamID][unitID] then - canBuild[newTeamID][unitID] = true - canBuild[oldTeamID][unitID] = nil - end + if canBuild[oldTeamID] and canBuild[oldTeamID][unitID] then + canBuild[newTeamID][unitID] = true + canBuild[oldTeamID][unitID] = nil + end end function gadget:UnitTaken(unitID, unitDefID, oldTeamID, newTeamID) - gadget:UnitGiven(unitID, unitDefID, newTeamID, oldTeamID) + gadget:UnitGiven(unitID, unitDefID, newTeamID, oldTeamID) end function gadget:UnitDestroyed(unitID, unitDefID, teamID) - canBuild[teamID][unitID] = nil + canBuild[teamID][unitID] = nil - if passiveCons[teamID][unitID] then + if passiveCons[teamID][unitID] then passiveCons[teamID][unitID] = nil passiveConsCount[teamID] = passiveConsCount[teamID] - 1 end - realBuildSpeed[unitID] = nil - currentBuildSpeed[unitID] = nil + realBuildSpeed[unitID] = nil + currentBuildSpeed[unitID] = nil - costID[unitID] = nil + costID[unitID] = nil end - function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) - -- accepts CMD_PRIORITY - -- track which cons are set to passive - if canPassive[unitDefID] then - local cmdIdx = spFindUnitCmdDesc(unitID, CMD_PRIORITY) - local suspend = spGetTeamRulesParam(teamID, "suspendbuilderpriority") or 0 - if cmdIdx and suspend == 0 then - local cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - cmdDesc.params[1] = cmdParams[1] - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - spSetUnitRulesParam(unitID,ruleName,cmdParams[1]) + -- accepts CMD_PRIORITY + -- track which cons are set to passive + if canPassive[unitDefID] then + local cmdIdx = spFindUnitCmdDesc(unitID, CMD_PRIORITY) + local suspend = spGetTeamRulesParam(teamID, "suspendbuilderpriority") or 0 + if cmdIdx and suspend == 0 then + local cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + cmdDesc.params[1] = cmdParams[1] + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + spSetUnitRulesParam(unitID, ruleName, cmdParams[1]) if cmdParams[1] == 0 then if not passiveCons[teamID][unitID] then passiveCons[teamID][unitID] = true @@ -227,10 +226,10 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt passiveConsCount[teamID] = passiveConsCount[teamID] - 1 end end - end - return false -- Allowing command causes command queue to be lost if command is unshifted - end - return true + end + return false -- Allowing command causes command queue to be lost if command is unshifted + end + return true end local function UpdatePassiveBuilders(teamID, interval, mCur, mStor, mInc, mShare, mSent, mRec, eCur, eStor, eInc, eShare, eSent, eRec) @@ -315,10 +314,10 @@ local function UpdatePassiveBuilders(teamID, interval, mCur, mStor, mInc, mShare local intervalOverSpeed = interval / simSpeed local mStorEff = mStor * mShare - local teamStallingMetal = mCur - mathMax(mInc*stallMarginInc, mStorEff*stallMarginSto) - 1 + (interval)*(nonPassiveConsTotalExpenseMetal+mInc+mRec-mSent)/simSpeed + local teamStallingMetal = mCur - mathMax(mInc * stallMarginInc, mStorEff * stallMarginSto) - 1 + interval * (nonPassiveConsTotalExpenseMetal + mInc + mRec - mSent) / simSpeed local eStorEff = eStor * eShare - local teamStallingEnergy = eCur - mathMax(eInc*stallMarginInc, eStorEff*stallMarginSto) - 1 + (interval)*(nonPassiveConsTotalExpenseEnergy+eInc+eRec-eSent)/simSpeed + local teamStallingEnergy = eCur - mathMax(eInc * stallMarginInc, eStorEff * stallMarginSto) - 1 + interval * (nonPassiveConsTotalExpenseEnergy + eInc + eRec - eSent) / simSpeed -- work through passive cons allocating as much expense as we have left for builderID in pairs(passiveTeamCons) do @@ -329,8 +328,7 @@ local function UpdatePassiveBuilders(teamID, interval, mCur, mStor, mInc, mShare local passivePullMetal = pMetal * intervalOverSpeed local passivePullEnergy = _passiveEnergy[builderID] * intervalOverSpeed if passivePullMetal > 0 or passivePullEnergy > 0 then - if (teamStallingMetal - passivePullMetal <= 0 and passivePullMetal > 0) or - (teamStallingEnergy - passivePullEnergy <= 0 and passivePullEnergy > 0) then + if (teamStallingMetal - passivePullMetal <= 0 and passivePullMetal > 0) or (teamStallingEnergy - passivePullEnergy <= 0 and passivePullEnergy > 0) then wouldStall = true else teamStallingMetal = teamStallingMetal - passivePullMetal @@ -355,7 +353,6 @@ local function UpdatePassiveBuilders(teamID, interval, mCur, mStor, mInc, mShare end end - function gadget:GameFrame(n) -- Process buildTargetOwners — restore speeds from previous frame's 0.001 override -- Only iterate teams that actually had owners set @@ -392,13 +389,19 @@ function gadget:GameFrame(n) local interval = 1 if mInc > 0 then local mi = mathFloor(mStor * simSpeed / mInc) + 1 - if mi > interval then interval = mi end + if mi > interval then + interval = mi + end end if interval < 6 and eInc > 0 then local ei = mathFloor(eStor * simSpeed / eInc) + 1 - if ei > interval then interval = ei end + if ei > interval then + interval = ei + end + end + if interval > 6 then + interval = 6 end - if interval > 6 then interval = 6 end UpdatePassiveBuilders(teamID, interval, mCur, mStor, mInc, mShare, mSent, mRec, eCur, eStor, eInc, eShare, eSent, eRec) updateFrame[teamID] = n + interval end diff --git a/luarules/gadgets/unit_cancel_orders_on_share.lua b/luarules/gadgets/unit_cancel_orders_on_share.lua index 686227baf03..48cb8769ceb 100644 --- a/luarules/gadgets/unit_cancel_orders_on_share.lua +++ b/luarules/gadgets/unit_cancel_orders_on_share.lua @@ -1,55 +1,50 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Cancel orders on share", - desc = "Prevents units carrying on with orders once shared/taken and turns on mexes that have been captured", - author = "Bluestone, Beherith", - date = "Jan 2015", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Cancel orders on share", + desc = "Prevents units carrying on with orders once shared/taken and turns on mexes that have been captured", + author = "Bluestone, Beherith", + date = "Jan 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -if (not gadgetHandler:IsSyncedCode()) then - - function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - -- give all shared units a stop command - Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, 0) - - -- remove their build queue - local buildQ = Spring.GetFullBuildQueue(unitID) or {} - for _,buildOrder in pairs(buildQ) do - for uDID,count in pairs(buildOrder) do - for i=1,count do - Spring.GiveOrderToUnit(unitID, -uDID, {}, {"right"}) - end - end - end - end - +if not gadgetHandler:IsSyncedCode() then + function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + -- give all shared units a stop command + Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, 0) + + -- remove their build queue + local buildQ = Spring.GetFullBuildQueue(unitID) or {} + for _, buildOrder in pairs(buildQ) do + for uDID, count in pairs(buildOrder) do + for i = 1, count do + Spring.GiveOrderToUnit(unitID, -uDID, {}, { "right" }) + end + end + end + end else -- SYNCED - - local recievedMexes = {} - - function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - -- if the unit is a metal extractor, turn it on: - if UnitDefs[unitDefID] and UnitDefs[unitDefID].extractsMetal and UnitDefs[unitDefID].extractsMetal > 0 then - recievedMexes[#recievedMexes+1] = unitID - end - end - - function gadget:GameFrame(n) - if n%37 == 0 and #recievedMexes > 0 then - for i, unitID in ipairs(recievedMexes) do - if Spring.ValidUnitID(unitID) then - Spring.GiveOrderToUnit( unitID, CMD.ONOFF, { 1 }, 0 ) - end - end - recievedMexes = {} - end - end - + local recievedMexes = {} + + function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + -- if the unit is a metal extractor, turn it on: + if UnitDefs[unitDefID] and UnitDefs[unitDefID].extractsMetal and UnitDefs[unitDefID].extractsMetal > 0 then + recievedMexes[#recievedMexes + 1] = unitID + end + end + + function gadget:GameFrame(n) + if n % 37 == 0 and #recievedMexes > 0 then + for i, unitID in ipairs(recievedMexes) do + if Spring.ValidUnitID(unitID) then + Spring.GiveOrderToUnit(unitID, CMD.ONOFF, { 1 }, 0) + end + end + recievedMexes = {} + end + end end diff --git a/luarules/gadgets/unit_capture_decay.lua b/luarules/gadgets/unit_capture_decay.lua index 0c0e4064fa1..172107cffa3 100644 --- a/luarules/gadgets/unit_capture_decay.lua +++ b/luarules/gadgets/unit_capture_decay.lua @@ -1,61 +1,60 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Unit Capture Decay", - desc = "Decays capture progress if there was none done over the past 10 seconds", - author = "Damgam", - date = "2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Unit Capture Decay", + desc = "Decays capture progress if there was none done over the past 10 seconds", + author = "Damgam", + date = "2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local unitsWithCaptureProgress = {} function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - unitsWithCaptureProgress[unitID] = nil + unitsWithCaptureProgress[unitID] = nil end function gadget:GameFrame(frame) - for unitID, data in pairs(unitsWithCaptureProgress) do - if unitID%30 == frame%30 then - local captureLevel = select(4, Spring.GetUnitHealth(unitID)) - if captureLevel and captureLevel > 0 then - if captureLevel <= data.previousCaptureProgress then - unitsWithCaptureProgress[unitID].ticksFromLastCapture = unitsWithCaptureProgress[unitID].ticksFromLastCapture+1 - else - unitsWithCaptureProgress[unitID].ticksFromLastCapture = 0 - SendToUnsynced("unitCaptureFrame", unitID, math.max(captureLevel, 0)) - end - unitsWithCaptureProgress[unitID].previousCaptureProgress = captureLevel - if unitsWithCaptureProgress[unitID].ticksFromLastCapture >= 10 then -- with how things are set up, that will be about 10 seconds - Spring.SetUnitHealth(unitID, {capture = math.max(captureLevel-((unitsWithCaptureProgress[unitID].ticksFromLastCapture-10)*0.001), 0)}) - end - else - unitsWithCaptureProgress[unitID] = nil - end - end - end + for unitID, data in pairs(unitsWithCaptureProgress) do + if unitID % 30 == frame % 30 then + local captureLevel = select(4, Spring.GetUnitHealth(unitID)) + if captureLevel and captureLevel > 0 then + if captureLevel <= data.previousCaptureProgress then + unitsWithCaptureProgress[unitID].ticksFromLastCapture = unitsWithCaptureProgress[unitID].ticksFromLastCapture + 1 + else + unitsWithCaptureProgress[unitID].ticksFromLastCapture = 0 + SendToUnsynced("unitCaptureFrame", unitID, math.max(captureLevel, 0)) + end + unitsWithCaptureProgress[unitID].previousCaptureProgress = captureLevel + if unitsWithCaptureProgress[unitID].ticksFromLastCapture >= 10 then -- with how things are set up, that will be about 10 seconds + Spring.SetUnitHealth(unitID, { capture = math.max(captureLevel - ((unitsWithCaptureProgress[unitID].ticksFromLastCapture - 10) * 0.001), 0) }) + end + else + unitsWithCaptureProgress[unitID] = nil + end + end + end end - function gadget:AllowUnitCaptureStep(builderID, builderTeam, unitID, unitDefID, part) - if not unitsWithCaptureProgress[unitID] then - unitsWithCaptureProgress[unitID] = {previousCaptureProgress = 0, ticksFromLastCapture = 999} - end - return true + if not unitsWithCaptureProgress[unitID] then + unitsWithCaptureProgress[unitID] = { previousCaptureProgress = 0, ticksFromLastCapture = 999 } + end + return true end function addUnitToCaptureDecay(unitID) - if not unitsWithCaptureProgress[unitID] then - unitsWithCaptureProgress[unitID] = {previousCaptureProgress = 0, ticksFromLastCapture = 999} - end + if not unitsWithCaptureProgress[unitID] then + unitsWithCaptureProgress[unitID] = { previousCaptureProgress = 0, ticksFromLastCapture = 999 } + end end -GG.addUnitToCaptureDecay = addUnitToCaptureDecay \ No newline at end of file +GG.addUnitToCaptureDecay = addUnitToCaptureDecay diff --git a/luarules/gadgets/unit_carrier_spawner.lua b/luarules/gadgets/unit_carrier_spawner.lua index a88532978bf..18e61a748c8 100644 --- a/luarules/gadgets/unit_carrier_spawner.lua +++ b/luarules/gadgets/unit_carrier_spawner.lua @@ -1,4 +1,3 @@ - if not gadgetHandler:IsSyncedCode() then return false end @@ -13,65 +12,64 @@ function gadget:GetInfo() date = "2023-03-15", license = "None", layer = 55, - enabled = true + enabled = true, } end -local spCreateUnit = Spring.CreateUnit -local spDestroyUnit = Spring.DestroyUnit -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spGetUnitPosition = Spring.GetUnitPosition -local SetUnitNoSelect = Spring.SetUnitNoSelect -local spGetUnitRulesParam = Spring.GetUnitRulesParam -local spUseTeamResource = Spring.UseTeamResource -local spGetTeamResources = Spring.GetTeamResources -local GetUnitCommands = Spring.GetUnitCommands -local spSetUnitArmored = Spring.SetUnitArmored -local spGetUnitStates = Spring.GetUnitStates -local spGetUnitDefID = Spring.GetUnitDefID -local spSetUnitVelocity = Spring.SetUnitVelocity -local spUnitAttach = Spring.UnitAttach -local spUnitDetach = Spring.UnitDetach -local spSetUnitHealth = Spring.SetUnitHealth -local spSetUnitMaxHealth = Spring.SetUnitMaxHealth -local spSetUnitUseAirLos = Spring.SetUnitUseAirLos -local spGetGroundHeight = Spring.GetGroundHeight -local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy -local spTransferUnit = Spring.TransferUnit -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitHealth = Spring.GetUnitHealth -local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand -local spGetUnitWeaponTarget = Spring.GetUnitWeaponTarget -local EditUnitCmdDesc = Spring.EditUnitCmdDesc -local FindUnitCmdDesc = Spring.FindUnitCmdDesc -local InsertUnitCmdDesc = Spring.InsertUnitCmdDesc -local spGetGameSeconds = Spring.GetGameSeconds -local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitStockpile = Spring.GetUnitStockpile -local spSetUnitStockpile = Spring.SetUnitStockpile -local spCallCOBScript = Spring.CallCOBScript -local spSetUnitCOBValue = Spring.SetUnitCOBValue -local spGetUnitPiecePosDir = Spring.GetUnitPiecePosDir -local spGetUnitPiecePosition = Spring.GetUnitPiecePosition -local spGetGameFrame = Spring.GetGameFrame - - -local mcEnable = Spring.MoveCtrl.Enable -local mcDisable = Spring.MoveCtrl.Disable -local mcSetPosition = Spring.MoveCtrl.SetPosition -local mcSetRotation = Spring.MoveCtrl.SetRotation -local mcSetAirMoveTypeData = Spring.MoveCtrl.SetAirMoveTypeData - -local mapsizeX = Game.mapSizeX -local mapsizeZ = Game.mapSizeZ +local spCreateUnit = Spring.CreateUnit +local spDestroyUnit = Spring.DestroyUnit +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitPosition = Spring.GetUnitPosition +local SetUnitNoSelect = Spring.SetUnitNoSelect +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spUseTeamResource = Spring.UseTeamResource +local spGetTeamResources = Spring.GetTeamResources +local GetUnitCommands = Spring.GetUnitCommands +local spSetUnitArmored = Spring.SetUnitArmored +local spGetUnitStates = Spring.GetUnitStates +local spGetUnitDefID = Spring.GetUnitDefID +local spSetUnitVelocity = Spring.SetUnitVelocity +local spUnitAttach = Spring.UnitAttach +local spUnitDetach = Spring.UnitDetach +local spSetUnitHealth = Spring.SetUnitHealth +local spSetUnitMaxHealth = Spring.SetUnitMaxHealth +local spSetUnitUseAirLos = Spring.SetUnitUseAirLos +local spGetGroundHeight = Spring.GetGroundHeight +local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy +local spTransferUnit = Spring.TransferUnit +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand +local spGetUnitWeaponTarget = Spring.GetUnitWeaponTarget +local EditUnitCmdDesc = Spring.EditUnitCmdDesc +local FindUnitCmdDesc = Spring.FindUnitCmdDesc +local InsertUnitCmdDesc = Spring.InsertUnitCmdDesc +local spGetGameSeconds = Spring.GetGameSeconds +local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetUnitStockpile = Spring.GetUnitStockpile +local spSetUnitStockpile = Spring.SetUnitStockpile +local spCallCOBScript = Spring.CallCOBScript +local spSetUnitCOBValue = Spring.SetUnitCOBValue +local spGetUnitPiecePosDir = Spring.GetUnitPiecePosDir +local spGetUnitPiecePosition = Spring.GetUnitPiecePosition +local spGetGameFrame = Spring.GetGameFrame + +local mcEnable = Spring.MoveCtrl.Enable +local mcDisable = Spring.MoveCtrl.Disable +local mcSetPosition = Spring.MoveCtrl.SetPosition +local mcSetRotation = Spring.MoveCtrl.SetRotation +local mcSetAirMoveTypeData = Spring.MoveCtrl.SetAirMoveTypeData + +local mapsizeX = Game.mapSizeX +local mapsizeZ = Game.mapSizeZ local random = math.random local mathMin = math.min -local sin = math.sin -local cos = math.cos +local sin = math.sin +local cos = math.cos local diag = math.diag local stringFind = string.find local strSplit = string.split @@ -88,22 +86,20 @@ local spawnDefs = {} local shieldCollide = {} local wantedList = {} - local spawnCmd = { id = CMD_CARRIER_SPAWN_ONOFF, name = "csspawning", action = "csspawning", type = CMDTYPE.ICON_MODE, tooltip = "Enable/Disable drone spawning", - params = { '1', 'Spawning Disabled', 'Spawning Enabled' } + params = { "1", "Spawning Disabled", "Spawning Enabled" }, } - local carrierDockingList = {} local carrierQueuedDockingCount = 0 local previousHealFrame = 0 -local carrierAvailableDockingCount = 1000 -- Limits the amount of drones that can dock simultaneously. Lowering this will increase overall game performance, but some drones might not be able to dock in time. Increasing this above 1500 could cause memory issues in large battles. +local carrierAvailableDockingCount = 1000 -- Limits the amount of drones that can dock simultaneously. Lowering this will increase overall game performance, but some drones might not be able to dock in time. Increasing this above 1500 could cause memory issues in large battles. local dockingQueueOffset = 0 local carrierMetaList = {} @@ -118,103 +114,93 @@ local inUnitDestroyed = false local gaiaTeam local coroutine = coroutine -local Sleep = coroutine.yield -local assert = assert +local Sleep = coroutine.yield +local assert = assert local coroutines = {} - --TEMPORARY for debugging local totalDroneCount = 0 -- For ZECRUS: -- These control the frequency, in gameframes, of different actions. Increasing these will improve overall game performance at the cost of this gadgets responsiveness. -local DEFAULT_UPDATE_ORDER_FREQUENCY = 60 -- Idle movement orders for drones. How frequently the drones change direction when idling around the carrier. -local CARRIER_UPDATE_FREQUENCY = 15 -- Update dronestates and orders. Increasing this will decrease responsiveness when issuing new commands. -local DEFAULT_SPAWN_CHECK_FREQUENCY = 3 -- Controls the minimum possible spawnrate. Increasing this will give less accurate spawnrates. -local DEFAULT_DOCK_CHECK_FREQUENCY = 15 -- Checks the docking queue. Increasing this will decrease docking responsiveness, and may cause some drones to dock too late. - +local DEFAULT_UPDATE_ORDER_FREQUENCY = 60 -- Idle movement orders for drones. How frequently the drones change direction when idling around the carrier. +local CARRIER_UPDATE_FREQUENCY = 15 -- Update dronestates and orders. Increasing this will decrease responsiveness when issuing new commands. +local DEFAULT_SPAWN_CHECK_FREQUENCY = 3 -- Controls the minimum possible spawnrate. Increasing this will give less accurate spawnrates. +local DEFAULT_DOCK_CHECK_FREQUENCY = 15 -- Checks the docking queue. Increasing this will decrease docking responsiveness, and may cause some drones to dock too late. -- These values can be tuned in the unitdef file. Add the section below to a weaponDef list in the unitdef file. --customparams = { - -- -- Required: - -- carried_unit = "unitname" Name of the unit spawned by this carrier unit. For multiple different drones: "unitname1 unitname2 unitname3..." - - - -- -- Optional: - -- controlradius = 200, The spawned units are recalled when exceeding this range. Radius = 0 to disable control range limit. - -- engagementrange = 100, The spawned units will adopt any active combat commands within this range. Best paired with a weapon of equal range. - -- spawns_surface = "LAND", "LAND" or "SEA". If not enabled, any surface will be accepted. - -- buildcostenergy = 0, Custom spawn cost. If not set, it will inherit the cost from the carried_unit unitDef. "0 0 0..." - -- buildcostmetal = 0, Custom spawn cost. If not set, it will inherit the cost from the carried_unit unitDef. "0 0 0..." - -- enabledocking = true, If enabled, docking behavior is used. - -- dockingarmor = 0.4, Multiplier for damage taken while docked. Does not work against napalm (this might be fixed now?). - - -- -- Has a default value, as indicated, if not chosen: - -- spawnrate = 1, Spawnrate roughly in seconds. Different spawn rates for multiple drones is not yet implemented. - -- maxunits = 3, Will spawn units until this amount has been reached. "3 3 2..." - -- dockingpieces = "1 2 3", Model pieces to be used for docking. "1 2 3,5 7 8,11 12..." - -- dockingradius = 100, The range at which the units are helped onto the carrier unit when docking. - -- dockingHelperSpeed = 10, The speed used when helping the unit onto the carrier. Set this to 0 to disable the helper and just snap to the carrier unit when within the docking range. - -- dockinghealrate = 0, Healing per second while docked. - -- docktohealthreshold = 30, If health percentage drops below the threshold the unit will attempt to dock for healing. - -- attackformationspread = 0, Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - -- attackformationoffset = 0, Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. - -- decayrate = 0, health loss per second while not docked. - -- deathdecayrate = 0, health loss per second while not docked, and no carrier to land on. - -- carrierdeaththroe = "death", Behaviour for the drones when the carrier dies. "death": destroy the drones. "control": gain manual control of the drones. "capture": same as "control", but if an enemy is within control range, they get control of the drones instead. - -- holdfireradius = 0, Defines the wandering distance of drones from the carrier when "holdfire" command is issued. If it isn't defined, 0 default will dock drones on holdfire by default. - -- droneminimumidleradius = 0, Defines the wandering distance of drones from the carrier when it otherwise would have docked the drones, but docking is not enabled. - - - - -- -- Experimental. Please ping Xehrath in the BAR discord if you encounter any issues while using any of these options, or would like some changes to any of them. These are all subject to change or removal depending on interest, and are not considered finished features. - -- dronetype = "default" Experimental types: nano, bomber, fighter, turret - -- dockingsections = strSplit(dockingpieces, ","), - -- dronebombingruns = 2, Defines the number of bombing runs a bomber drone initiates before returning to the carrier.. - -- dronebombingoffset, Used to make bomber drones go off to the side before heading directly towards the target. Multiple bomber drones will alternate which side to move to. Given as a percentage of the distance to the target. - -- dronebomberinterval, Used to stagger the launch of multiple bomber drones. - -- dronebomberminengagementrange = 200, Bomber drones will not launch to attack targets within this radius. - -- manualdrones Allows manual control of drones within the control radius - -- stockpilelimit = 1 Used for stockpile weapons, but for carriers it also enables stockpile for dronespawning. - -- stockpilemetal = 10 Set it to the same as the drone cost when using stockpile for drones - -- stockpileenergy = 10 Set it to the same as the drone cost when using stockpile for drones - -- droneairtime = 30 - -- dronedocktime = 2 Set the minimum docking time for drones - -- droneammo = 10 - - - - -- }, - - - - -- Notes: - --todo: - -- add docking time - -- clean up bomberStage and fighterStage - -- multiple different drones on one carrier. Partially implemented, but the current implementation is merely a proof of concept. End goal is to have each drone type tied to separate weapons for targeting. - -- Performance updates - -- clarity updates. Removing clutter, removing deprecated code bits, restructuring, adding comments - - --Known bugs: - -- Land carriers struggling with the attack formations - -- Drones occationally stuck hovering near the carrier instead of following the active command +-- -- Required: +-- carried_unit = "unitname" Name of the unit spawned by this carrier unit. For multiple different drones: "unitname1 unitname2 unitname3..." + +-- -- Optional: +-- controlradius = 200, The spawned units are recalled when exceeding this range. Radius = 0 to disable control range limit. +-- engagementrange = 100, The spawned units will adopt any active combat commands within this range. Best paired with a weapon of equal range. +-- spawns_surface = "LAND", "LAND" or "SEA". If not enabled, any surface will be accepted. +-- buildcostenergy = 0, Custom spawn cost. If not set, it will inherit the cost from the carried_unit unitDef. "0 0 0..." +-- buildcostmetal = 0, Custom spawn cost. If not set, it will inherit the cost from the carried_unit unitDef. "0 0 0..." +-- enabledocking = true, If enabled, docking behavior is used. +-- dockingarmor = 0.4, Multiplier for damage taken while docked. Does not work against napalm (this might be fixed now?). + +-- -- Has a default value, as indicated, if not chosen: +-- spawnrate = 1, Spawnrate roughly in seconds. Different spawn rates for multiple drones is not yet implemented. +-- maxunits = 3, Will spawn units until this amount has been reached. "3 3 2..." +-- dockingpieces = "1 2 3", Model pieces to be used for docking. "1 2 3,5 7 8,11 12..." +-- dockingradius = 100, The range at which the units are helped onto the carrier unit when docking. +-- dockingHelperSpeed = 10, The speed used when helping the unit onto the carrier. Set this to 0 to disable the helper and just snap to the carrier unit when within the docking range. +-- dockinghealrate = 0, Healing per second while docked. +-- docktohealthreshold = 30, If health percentage drops below the threshold the unit will attempt to dock for healing. +-- attackformationspread = 0, Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. +-- attackformationoffset = 0, Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. +-- decayrate = 0, health loss per second while not docked. +-- deathdecayrate = 0, health loss per second while not docked, and no carrier to land on. +-- carrierdeaththroe = "death", Behaviour for the drones when the carrier dies. "death": destroy the drones. "control": gain manual control of the drones. "capture": same as "control", but if an enemy is within control range, they get control of the drones instead. +-- holdfireradius = 0, Defines the wandering distance of drones from the carrier when "holdfire" command is issued. If it isn't defined, 0 default will dock drones on holdfire by default. +-- droneminimumidleradius = 0, Defines the wandering distance of drones from the carrier when it otherwise would have docked the drones, but docking is not enabled. + +-- -- Experimental. Please ping Xehrath in the BAR discord if you encounter any issues while using any of these options, or would like some changes to any of them. These are all subject to change or removal depending on interest, and are not considered finished features. +-- dronetype = "default" Experimental types: nano, bomber, fighter, turret +-- dockingsections = strSplit(dockingpieces, ","), +-- dronebombingruns = 2, Defines the number of bombing runs a bomber drone initiates before returning to the carrier.. +-- dronebombingoffset, Used to make bomber drones go off to the side before heading directly towards the target. Multiple bomber drones will alternate which side to move to. Given as a percentage of the distance to the target. +-- dronebomberinterval, Used to stagger the launch of multiple bomber drones. +-- dronebomberminengagementrange = 200, Bomber drones will not launch to attack targets within this radius. +-- manualdrones Allows manual control of drones within the control radius +-- stockpilelimit = 1 Used for stockpile weapons, but for carriers it also enables stockpile for dronespawning. +-- stockpilemetal = 10 Set it to the same as the drone cost when using stockpile for drones +-- stockpileenergy = 10 Set it to the same as the drone cost when using stockpile for drones +-- droneairtime = 30 +-- dronedocktime = 2 Set the minimum docking time for drones +-- droneammo = 10 + +-- }, + +-- Notes: +--todo: +-- add docking time +-- clean up bomberStage and fighterStage +-- multiple different drones on one carrier. Partially implemented, but the current implementation is merely a proof of concept. End goal is to have each drone type tied to separate weapons for targeting. +-- Performance updates +-- clarity updates. Removing clutter, removing deprecated code bits, restructuring, adding comments + +--Known bugs: +-- Land carriers struggling with the attack formations +-- Drones occationally stuck hovering near the carrier instead of following the active command for weaponDefID = 1, #WeaponDefs do local wdcp = WeaponDefs[weaponDefID].customParams if wdcp.carried_unit then - - local dronetype = wdcp.dronetype or "default" - local dockingpieces = wdcp.dockingpieces or "1" - local maxunits = wdcp.maxunits or "1" - local startingDroneCount = wdcp.startingdronecount or "0" - local metalCost = wdcp.buildcostmetal or wdcp.metalcost or "" - local energyCost = wdcp.buildcostenergy or wdcp.energycost or "" - local droneAirTime = wdcp.droneairtime or "" - local droneDockTime = wdcp.dronedocktime or "" - local droneAmmo = wdcp.droneammo or "0" + local dronetype = wdcp.dronetype or "default" + local dockingpieces = wdcp.dockingpieces or "1" + local maxunits = wdcp.maxunits or "1" + local startingDroneCount = wdcp.startingdronecount or "0" + local metalCost = wdcp.buildcostmetal or wdcp.metalcost or "" + local energyCost = wdcp.buildcostenergy or wdcp.energycost or "" + local droneAirTime = wdcp.droneairtime or "" + local droneDockTime = wdcp.dronedocktime or "" + local droneAmmo = wdcp.droneammo or "0" spawnDefs[weaponDefID] = { name = strSplit(wdcp.carried_unit), dronetype = strSplit(dronetype), @@ -256,7 +242,6 @@ for weaponDefID = 1, #WeaponDefs do droneAirTime = strSplit(droneAirTime), droneDockTime = strSplit(droneDockTime), droneAmmo = strSplit(droneAmmo), - } if wdcp.spawn_blocked_by_shield then @@ -266,9 +251,6 @@ for weaponDefID = 1, #WeaponDefs do end end - - - local function randomPointInUnitCircle(offset) local startpointoffset = 0 if offset then @@ -279,14 +261,12 @@ local function randomPointInUnitCircle(offset) elseif startpointoffset < 0 then startpointoffset = 0 end - local angle = random(0, 2*PI) + local angle = random(0, 2 * PI) --local distance = power(random((startpointoffset/100), 1), 0.5) - local distance = (random(startpointoffset, 100)/100)^0.5 - return cos(angle)*distance, sin(angle)*distance + local distance = (random(startpointoffset, 100) / 100) ^ 0.5 + return cos(angle) * distance, sin(angle) * distance end - - local function startScript(fn) local co = coroutine.create(fn) coroutines[#coroutines + 1] = co @@ -294,24 +274,23 @@ end local function updateCoroutines() local newCoroutines = {} - for i=1, #coroutines do + for i = 1, #coroutines do local co = coroutines[i] - if (coroutine.status(co) ~= "dead") then + if coroutine.status(co) ~= "dead" then newCoroutines[#newCoroutines + 1] = co end end coroutines = newCoroutines - for i=1, #coroutines do + for i = 1, #coroutines do assert(coroutine.resume(coroutines[i])) end end - local function healUnit(unitID, healrate, resourceFrames, currentHealth, maxHealth) if (resourceFrames <= 0) or not currentHealth then return true end - local healthGain = healrate*resourceFrames + local healthGain = healrate * resourceFrames local newHealth = mathMin(currentHealth + healthGain, maxHealth) if maxHealth < newHealth then newHealth = maxHealth @@ -335,7 +314,6 @@ local function validCarrierAndDrone(unitID, subUnitID) end end - local function dockUnitQueue(unitID, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then @@ -351,8 +329,6 @@ local function dockUnitQueue(unitID, subUnitID) carrierMetaList[unitID].subUnitsList[subUnitID].activeDocking = true end - - local function undockUnit(unitID, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then @@ -383,13 +359,12 @@ local function undockUnit(unitID, subUnitID) if dronetype == "printer" then SetUnitNoSelect(subUnitID, false) spSetUnitRulesParam(subUnitID, "carrier_host_unit_id", nil, PRIVATE) - RemoveDrone(unitID,subUnitID) + RemoveDrone(unitID, subUnitID) end end end end - local function undockSequence(unitID, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then @@ -410,7 +385,6 @@ local function undockSequence(unitID, subUnitID) end end - local function CobUndockSequenceFinished(unitID, unitDefID, team, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then @@ -421,7 +395,6 @@ local function CobUndockSequenceFinished(unitID, unitDefID, team, subUnitID) end end - local function droneSpawnSequence(unitID, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then @@ -442,21 +415,18 @@ local function droneSpawnSequence(unitID, subUnitID) end end - local function CobDroneSpawnSequenceFinished(unitID, unitDefID, team, subUnitID) local validDrone = validCarrierAndDrone(unitID, subUnitID) if not validDrone then return else local dockingPiece = carrierMetaList[unitID].subUnitsList[subUnitID].dockingPiece - local _, pieceAngle = spCallCOBScript(unitID, "DroneDocked", 5, pieceAngle, dockingPiece) + local _, pieceAngle = spCallCOBScript(unitID, "DroneDocked", 5, pieceAngle, dockingPiece) spCallCOBScript(subUnitID, "Docked", 0, carrierMetaList[unitID].cobdockparam, dockingPiece, pieceAngle) return end end - - local function spawnUnit(spawnData) if spawnData then local validSurface = false @@ -475,7 +445,6 @@ local function spawnUnit(spawnData) local ownerID = spawnData.ownerID local carrierData = carrierMetaList[spawnData.ownerID] if validSurface == true and ownerID then - local stockpilecount = spGetUnitStockpile(spawnData.ownerID) or 0 local stockpilechange = stockpilecount - carrierMetaList[spawnData.ownerID].stockpilecount local stockpiledMetal = 0 @@ -492,7 +461,7 @@ local function spawnUnit(spawnData) local carriedDroneType = carrierData.dronetypes[dronetypeIndex] local startingDroneCount = carrierData.startingDroneCount[dronetypeIndex] - if not(carrierData.usestockpile) or carrierData.subUnitCount[dronetypeIndex] < stockpilecount or carrierData.startingWithDrones then + if not carrierData.usestockpile or carrierData.subUnitCount[dronetypeIndex] < stockpilecount or carrierData.startingWithDrones then if carrierData.printerUnitDefID and carriedDroneType == "printer" then dronename = carrierData.printerUnitDefID end @@ -504,7 +473,6 @@ local function spawnUnit(spawnData) if carrierData.metalCost[dronetypeIndex] and carrierData.energyCost[dronetypeIndex] then metalCost = carrierData.metalCost[dronetypeIndex] energyCost = carrierData.energyCost[dronetypeIndex] - else local subUnitDef = UnitDefNames[dronename] if subunitDef then @@ -523,10 +491,10 @@ local function spawnUnit(spawnData) if subUnitID then startingDroneCount = startingDroneCount - 1 if carrierData.usestockpile then - local stockpile,_,stockpilepercentage = spGetUnitStockpile(ownerID) + local stockpile, _, stockpilepercentage = spGetUnitStockpile(ownerID) stockpile = stockpile + 1 spSetUnitStockpile(ownerID, stockpile, stockpilepercentage) - spGiveOrderToUnit(ownerID, CMD.STOCKPILE, {}, {"right"}) + spGiveOrderToUnit(ownerID, CMD.STOCKPILE, {}, { "right" }) carrierMetaList[ownerID].stockpilecount = carrierMetaList[ownerID].stockpilecount + 1 end if startingDroneCount > 0 then @@ -551,7 +519,6 @@ local function spawnUnit(spawnData) end end - ------ if not subUnitID then @@ -559,13 +526,12 @@ local function spawnUnit(spawnData) return end - local spareDock = false local dockingpiece if ownerID then spSetUnitRulesParam(subUnitID, "carrier_host_unit_id", ownerID, PRIVATE) local subUnitCount = carrierData.subUnitCount[dronetypeIndex] - local subunitDefID = spGetUnitDefID(subUnitID) + local subunitDefID = spGetUnitDefID(subUnitID) local subUnitDef = UnitDefs[subunitDefID] subUnitCount = subUnitCount + 1 carrierData.subUnitCount[dronetypeIndex] = subUnitCount @@ -581,7 +547,7 @@ local function spawnUnit(spawnData) end local _, droneMaxHealth = spGetUnitHealth(subUnitID) local droneData = { - dronetype = carriedDroneType, + dronetype = carriedDroneType, dronetypeIndex = dronetypeIndex, active = true, docked = false, @@ -611,7 +577,6 @@ local function spawnUnit(spawnData) totalDroneCount = totalDroneCount + 1 end - mcEnable(subUnitID) if spareDock == false then mcSetPosition(subUnitID, spawnData.x, spawnData.y, spawnData.z) @@ -624,9 +589,9 @@ local function spawnUnit(spawnData) local carrierx local carriery local carrierz - dockPointx,dockPointy, dockPointz = spGetUnitPiecePosition(ownerID, dockingpiece)--Spring.GetUnitPieceInfo (ownerID, dockingpieceindex) - carrierx,carriery, carrierz = spGetUnitPosition(ownerID) - mcSetPosition(subUnitID, carrierx+dockPointx, carriery+dockPointy, carrierz+dockPointz) + dockPointx, dockPointy, dockPointz = spGetUnitPiecePosition(ownerID, dockingpiece) --Spring.GetUnitPieceInfo (ownerID, dockingpieceindex) + carrierx, carriery, carrierz = spGetUnitPosition(ownerID) + mcSetPosition(subUnitID, carrierx + dockPointx, carriery + dockPointy, carrierz + dockPointz) end mcDisable(subUnitID) @@ -656,7 +621,7 @@ local function spawnUnit(spawnData) spCallCOBScript(subUnitID, "Docked", 0, carrierData.cobdockparam, droneMetaData.dockingPiece, pieceAngle) end else - spGiveOrderToUnit(subUnitID, CMD.MOVE, {spawnData.x, spawnData.y, spawnData.z}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { spawnData.x, spawnData.y, spawnData.z }, 0) spSetUnitUseAirLos(subUnitID, droneMetaData.isAirUnit) end @@ -664,7 +629,7 @@ local function spawnUnit(spawnData) SetUnitNoSelect(subUnitID, true) end elseif carriedDroneType == "printer" and carrierData.docking then - for subUnitID,value in pairsNext, carrierData.subUnitsList do + for subUnitID, value in pairsNext, carrierData.subUnitsList do if carrierData.subUnitsList[subUnitID] and carrierData.subUnitsList[subUnitID].dronetype == "printer" then undockSequence(ownerID, subUnitID) end @@ -678,7 +643,6 @@ local function spawnUnit(spawnData) end local function attachToNewCarrier(newCarrier, subUnitID) - if carrierMetaList[newCarrier] then spSetUnitRulesParam(subUnitID, "carrier_host_unit_id", newCarrier, PRIVATE) droneCarrierIdList[subUnitID] = newCarrier @@ -724,8 +688,6 @@ local function attachToNewCarrier(newCarrier, subUnitID) carrierMetaList[newCarrier].subInitialSpawnData.ownerID = newCarrier end end - - end function gadget:UnitCreated(unitID, unitDefID, unitTeam) @@ -739,7 +701,6 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) local spawnDef = spawnDefs[weaponDefID] if spawnDef.radius then - local spawnData = {} local x, y, z = spGetUnitPosition(unitID) spawnData.x = x @@ -749,7 +710,6 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) spawnData.teamID = unitTeam spawnData.surface = spawnDef.surface - if carrierMetaList[unitID] == nil then local dronenames = spawnDef.name local dronetypes = spawnDef.dronetype @@ -768,7 +728,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) for sectionIndex, dockingpieces in pairs(dockingsections) do local availableSectionsData = { - availablePieces = {} + availablePieces = {}, } local availablePieces = {} local piecenumbers = strSplit(dockingpieces) @@ -781,7 +741,6 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) end availableSectionsData.availablePieces = availablePieces availableSections[sectionIndex] = availableSectionsData - end local carrierData = { @@ -815,7 +774,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) activeRecall = false, activeSpawning = 1, availableSections = availableSections, - carrierDeaththroe =spawnDef.carrierdeaththroe or "death", + carrierDeaththroe = spawnDef.carrierdeaththroe or "death", parasite = "all", holdfireRadius = spawnDef.holdfireRadius or 0, droneminimumidleradius = spawnDef.droneminimumidleradius or 0, @@ -847,14 +806,13 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) carrierData.startingDroneCount[dronetypeIndex] = tonumber(startingDroneCount[dronetypeIndex]) or 0 carrierData.metalCost[dronetypeIndex] = tonumber(metalCost[dronetypeIndex]) carrierData.energyCost[dronetypeIndex] = tonumber(energyCost[dronetypeIndex]) - carrierData.droneAirTime[dronetypeIndex] = droneAirTime[dronetypeIndex] and tonumber(droneAirTime[dronetypeIndex])*30 - carrierData.droneDockTime[dronetypeIndex] = droneDockTime[dronetypeIndex] and tonumber(droneDockTime[dronetypeIndex])*30 + carrierData.droneAirTime[dronetypeIndex] = droneAirTime[dronetypeIndex] and tonumber(droneAirTime[dronetypeIndex]) * 30 + carrierData.droneDockTime[dronetypeIndex] = droneDockTime[dronetypeIndex] and tonumber(droneDockTime[dronetypeIndex]) * 30 carrierData.droneAmmo[dronetypeIndex] = tonumber(droneAmmo[dronetypeIndex]) if carrierData.startingDroneCount[dronetypeIndex] > 0 then carrierData.startingWithDrones = true end - end carrierMetaList[unitID] = carrierData local states = spGetUnitStates(unitID) @@ -863,7 +821,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) carrierData.cachedMoveState = states.movestate end --spSetUnitRulesParam(unitID, "is_carrier_unit", "enabled", PRIVATE) - if not(carrierMetaList[unitID].usestockpile) then + if not carrierMetaList[unitID].usestockpile then InsertUnitCmdDesc(unitID, 500, spawnCmd) --temporary end end @@ -875,23 +833,21 @@ end function gadget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) if carrierMetaList[unitID] then carrierMetaList[unitID].subInitialSpawnData.teamID = newTeam - for subUnitID,value in pairsNext, carrierMetaList[unitID].subUnitsList do + for subUnitID, value in pairsNext, carrierMetaList[unitID].subUnitsList do spTransferUnit(subUnitID, newTeam, false) end end - end function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) if carrierMetaList[unitID] then carrierMetaList[unitID].subInitialSpawnData.teamID = unitTeam - for subUnitID,value in pairsNext, carrierMetaList[unitID].subUnitsList do + for subUnitID, value in pairsNext, carrierMetaList[unitID].subUnitsList do spTransferUnit(subUnitID, unitTeam, false) end end end - function gadget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) local carrierUnitID = droneCarrierIdList[unitID] if carrierUnitID and carrierMetaList[carrierUnitID] then @@ -934,8 +890,8 @@ function gadget:ProjectileCreated(proID, proOwnerID, proWeaponDefID) local bomberStage = droneMetaData.bomberStage local lastBombing = droneMetaData.lastBombing if droneMetaData.dronetype == "bomber" and bomberStage > 0 then - local currentTime = spGetGameSeconds() - if ((currentTime - lastBombing) >= 4) then + local currentTime = spGetGameSeconds() + if (currentTime - lastBombing) >= 4 then Spring.MoveCtrl.SetAirMoveTypeData(proOwnerID, "maxRudder", droneMetaData.originalmaxrudder) bomberStage = bomberStage + 1 lastBombing = spGetGameSeconds() @@ -947,13 +903,10 @@ function gadget:ProjectileCreated(proID, proOwnerID, proWeaponDefID) end end - - - function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) -- accepts: CMD_CARRIER_SPAWN_ONOFF if carrierMetaList[unitID] then - if not(carrierMetaList[unitID].usestockpile) then + if not carrierMetaList[unitID].usestockpile then local cmdDescID = FindUnitCmdDesc(unitID, CMD_CARRIER_SPAWN_ONOFF) spawnCmd.params[1] = cmdParams[1] EditUnitCmdDesc(unitID, cmdDescID, spawnCmd) @@ -965,9 +918,7 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt return true end - function RemoveDrone(carrierUnitID, unitID) - if carrierMetaList[carrierUnitID].subUnitsList[unitID] then local droneMetaData = carrierMetaList[carrierUnitID].subUnitsList[unitID] local dronetypeIndex = droneMetaData.dronetypeIndex @@ -978,14 +929,13 @@ function RemoveDrone(carrierUnitID, unitID) end carrierMetaList[carrierUnitID].subUnitCount[dronetypeIndex] = carrierMetaList[carrierUnitID].subUnitCount[dronetypeIndex] - 1 if carrierMetaList[carrierUnitID].usestockpile and carrierMetaList[carrierUnitID].stockpilecount > 0 then - local stockpile,_,stockpilepercentage = spGetUnitStockpile(carrierUnitID) + local stockpile, _, stockpilepercentage = spGetUnitStockpile(carrierUnitID) if stockpile > 0 then stockpile = stockpile - 1 spSetUnitStockpile(carrierUnitID, stockpile, stockpilepercentage) spGiveOrderToUnit(carrierUnitID, CMD.STOCKPILE, {}, 0) end carrierMetaList[carrierUnitID].stockpilecount = carrierMetaList[carrierUnitID].stockpilecount - 1 - end end if carrierMetaList[carrierUnitID] and carrierMetaList[carrierUnitID].subUnitsList and carrierMetaList[carrierUnitID].subUnitsList[unitID] then @@ -996,10 +946,8 @@ function RemoveDrone(carrierUnitID, unitID) end end end - end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) inUnitDestroyed = true local carrierUnitID = droneCarrierIdList[unitID] @@ -1017,7 +965,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD local evolvedCarrierID = spGetUnitRulesParam(unitID, "unit_evolved") if carrierMetaList[unitID].subUnitsList then - for subUnitID,droneMetaData in pairsNext, carrierMetaList[unitID].subUnitsList do + for subUnitID, droneMetaData in pairsNext, carrierMetaList[unitID].subUnitsList do if carrierMetaList[unitID].subUnitsList[subUnitID] then local standalone = false local wild = false @@ -1026,7 +974,6 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD attachToNewCarrier(evolvedCarrierID, subUnitID) elseif carrierMetaList[unitID].carrierDeaththroe == "death" then spDestroyUnit(subUnitID, true) - elseif carrierMetaList[unitID].carrierDeaththroe == "capture" then standalone = true local enemyunitID = spGetUnitNearestEnemy(subUnitID, carrierMetaList[unitID].controlRadius) @@ -1053,15 +1000,12 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD if not spGetUnitAllyTeam(newCarrierCandidate) then newCarrier = newCarrierCandidate end - elseif carrierMetaList[unitID].parasite == "all" then newCarrier = newCarrierCandidate end end - end - if newCarrier then if carrierMetaList[newCarrier] then standalone = true @@ -1076,11 +1020,9 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD spSetUnitRulesParam(subUnitID, "carrier_host_unit_id", newCarrier, PRIVATE) droneCarrierIdList[subUnitID] = newCarrier end - else standalone = true end - end if standalone then @@ -1100,8 +1042,8 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD decayRate = carrierMetaList[unitID].deathdecayRate, idleRadius = carrierMetaList[unitID].radius, originalMaxHealth = droneMetaData.originalMaxHealth, - lastOrderUpdate = 0; - droneAirTime = droneMetaData.droneAirTime*0.5, + lastOrderUpdate = 0, + droneAirTime = droneMetaData.droneAirTime * 0.5, lastLiftOff = droneMetaData.lastLiftOff, remainingAmmo = droneMetaData.remainingAmmo, maxAmmo = droneMetaData.maxAmmo, @@ -1117,19 +1059,17 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD inUnitDestroyed = false end - local function updateStandaloneDrones(frame) local resourceFrames = (frame - previousHealFrame) / 30 for unitID, droneData in pairsNext, droneMetaList do if droneData.wild then -- move around unless in combat local dronex, droney, dronez = spGetUnitPosition(unitID) - if not dronez then -- this can happen so make sure its dealt with + if not dronez then -- this can happen so make sure its dealt with gadget:UnitDestroyed(unitID) elseif (droneData.maxAmmo > 0 and droneData.remainingAmmo <= 0) or (droneData.droneAirTime and ((droneData.droneAirTime + droneData.lastLiftOff) < frame)) then spDestroyUnit(unitID, false) else - local cQueue = GetUnitCommands(unitID, 4) local engaged = false for j = 1, (cQueue and #cQueue or 0) do @@ -1142,10 +1082,10 @@ local function updateStandaloneDrones(frame) droneData.engaged = engaged if not engaged and ((DEFAULT_UPDATE_ORDER_FREQUENCY + droneData.lastOrderUpdate) < frame) then - local idleRadius = droneData.idleRadius*0.2 + local idleRadius = droneData.idleRadius * 0.2 droneData.lastOrderUpdate = frame rx, rz = randomPointInUnitCircle(5) - spGiveOrderToUnit(unitID, CMD.MOVE, {dronex + rx*idleRadius, droney, dronez + rz*idleRadius}, 0) + spGiveOrderToUnit(unitID, CMD.MOVE, { dronex + rx * idleRadius, droney, dronez + rz * idleRadius }, 0) end end end @@ -1158,7 +1098,6 @@ local function updateStandaloneDrones(frame) end local function updateCarrier(carrierID, carrierMetaData, frame) - local carrierx, carriery, carrierz = spGetUnitPosition(carrierID) if not carrierx then if not inUnitDestroyed then @@ -1196,9 +1135,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) idleRadius = carrierMetaData.droneminimumidleradius end - - - local weapontargettype,_,weapontarget = Spring.GetUnitWeaponTarget(carrierID,carrierMetaData.weaponNr) + local weapontargettype, _, weapontarget = Spring.GetUnitWeaponTarget(carrierID, carrierMetaData.weaponNr) --Handles an attack order given to the carrier. if not recallDrones and cmdID == CMD.ATTACK or weapontarget then @@ -1207,7 +1144,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) target = cmdParam_1 targetx, targety, targetz = spGetUnitPosition(cmdParam_1) else - target = {cmdParam_1, cmdParam_2, cmdParam_3} + target = { cmdParam_1, cmdParam_2, cmdParam_3 } targetx, targety, targetz = cmdParam_1, cmdParam_2, cmdParam_3 fightOrder = true end @@ -1216,25 +1153,24 @@ local function updateCarrier(carrierID, carrierMetaData, frame) targetx, targety, targetz = spGetUnitPosition(weapontarget) end if targetx and carrierx then - droneSendDistance = diag((carrierx-targetx), (carrierz-targetz)) + droneSendDistance = diag((carrierx - targetx), (carrierz - targetz)) attackOrder = true --attack order overrides set target end end - --Handles a fight order given to the carrier. if not recallDrones and cmdID == CMD.FIGHT then targetx, targety, targetz = cmdParam_1, cmdParam_2, cmdParam_3 - target = {cmdParam_1, cmdParam_2, cmdParam_3} + target = { cmdParam_1, cmdParam_2, cmdParam_3 } if targetx and carrierx then - droneSendDistance = diag((carrierx-targetx), (carrierz-targetz)) + droneSendDistance = diag((carrierx - targetx), (carrierz - targetz)) end fightOrder = true end --Handles a setTarget order given to the carrier. if not recallDrones and not attackOrder then - local targetType,_,setTarget = spGetUnitWeaponTarget(carrierID, 1) + local targetType, _, setTarget = spGetUnitWeaponTarget(carrierID, 1) if targetType and targetType > 0 then if targetType == 2 then --targeting ground targetx = setTarget[1] @@ -1249,7 +1185,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) targetx, targety, targetz = spGetUnitPosition(target_id) end if targetx and carrierx then - droneSendDistance = diag((carrierx-targetx), (carrierz-targetz)) + droneSendDistance = diag((carrierx - targetx), (carrierz - targetz)) end setTargetOrder = true end @@ -1264,16 +1200,16 @@ local function updateCarrier(carrierID, carrierMetaData, frame) local targetvectorx, targetvectorz local perpendicularvectorx, perpendicularvectorz if targetx and carrierx then - magnitude = diag((carrierx-targetx), (carrierz-targetz)) + magnitude = diag((carrierx - targetx), (carrierz - targetz)) if magnitude == 0 then magnitude = 0.0001 end - targetvectorx, targetvectorz = targetx-carrierx, targetz-carrierz - targetvectorx, targetvectorz = carrierMetaData.attackFormationOffset*targetvectorx/100, carrierMetaData.attackFormationOffset*targetvectorz/100 + targetvectorx, targetvectorz = targetx - carrierx, targetz - carrierz + targetvectorx, targetvectorz = carrierMetaData.attackFormationOffset * targetvectorx / 100, carrierMetaData.attackFormationOffset * targetvectorz / 100 perpendicularvectorx, perpendicularvectorz = -targetvectorz, targetvectorx end local orderUpdate = false - for subUnitID,droneData in pairsNext, carrierMetaData.subUnitsList do + for subUnitID, droneData in pairsNext, carrierMetaData.subUnitsList do local sx, sy, sz = spGetUnitPosition(subUnitID) if not sy then droneData = nil @@ -1281,7 +1217,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) local droneType = droneData.dronetype local droneDocked = droneData.docked local droneInFormation = droneData.inFormation - local droneDistance = diag((carrierx-sx), (carrierz-sz)) + local droneDistance = diag((carrierx - sx), (carrierz - sz)) local droneCurrentHealth, droneMaxHealth = spGetUnitHealth(subUnitID) local droneAlive = true @@ -1304,12 +1240,12 @@ local function updateCarrier(carrierID, carrierMetaData, frame) elseif droneData.activeDocking == false then droneAlive = healUnit(subUnitID, -carrierMetaData.decayRate, resourceFrames, droneCurrentHealth, droneData.originalMaxHealth) end - if droneAlive and carrierMetaData.docking and 100*droneCurrentHealth/droneData.originalMaxHealth < carrierMetaData.dockToHealThreshold or (droneData.droneAirTime and ((droneData.droneAirTime + droneData.lastLiftOff) < frame)) then + if droneAlive and carrierMetaData.docking and 100 * droneCurrentHealth / droneData.originalMaxHealth < carrierMetaData.dockToHealThreshold or (droneData.droneAirTime and ((droneData.droneAirTime + droneData.lastLiftOff) < frame)) then dockUnitQueue(carrierID, subUnitID) end end if droneAlive and carrierMetaList[carrierID] then - if droneType == "printer" or droneType == "passenger" then + if droneType == "printer" or droneType == "passenger" then elseif droneData and droneType == "turret" then spGiveOrderToUnit(subUnitID, CMD.FIRE_STATE, cachedFireState, 0) elseif droneData and droneDistance then @@ -1327,26 +1263,25 @@ local function updateCarrier(carrierID, carrierMetaData, frame) --if carrierMetaData.docking and idleRadius == 0 then -- dockUnitQueue(carrierID, subUnitID) --else - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) - spGiveOrderToUnit(subUnitID, CMD.GUARD, carrierID, CMD.OPT_SHIFT) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) + spGiveOrderToUnit(subUnitID, CMD.GUARD, carrierID, CMD.OPT_SHIFT) --end elseif carrierMetaData.manualDrones or (droneData.maxAmmo > 0 and droneData.remainingAmmo <= 0) then return elseif droneSendDistance and droneSendDistance <= carrierMetaData.radius or droneType == "bomber" then -- attacking if target and not (droneType == "nano") then - if droneType == "bomber" then local currenttime = spGetGameSeconds() local bomberStage = droneData.bomberStage if bomberStage == 0 and (currenttime - carrierMetaData.dronebombertimer) > carrierMetaData.dronebomberinterval and droneSendDistance > carrierMetaData.dronebomberminengagementrange then undockSequence(carrierID, subUnitID) - local p2tvx, p2tvz = carrierMetaData.dronebombingside*carrierMetaData.dronebombingoffset*droneSendDistance*carrierMetaData.attackFormationSpread*perpendicularvectorx/magnitude, carrierMetaData.dronebombingside*carrierMetaData.dronebombingoffset*droneSendDistance*carrierMetaData.attackFormationSpread*perpendicularvectorz/magnitude + local p2tvx, p2tvz = carrierMetaData.dronebombingside * carrierMetaData.dronebombingoffset * droneSendDistance * carrierMetaData.attackFormationSpread * perpendicularvectorx / magnitude, carrierMetaData.dronebombingside * carrierMetaData.dronebombingoffset * droneSendDistance * carrierMetaData.attackFormationSpread * perpendicularvectorz / magnitude - local formationx, formationz = carrierx+targetvectorx+p2tvx, carrierz+targetvectorz+p2tvz + local formationx, formationz = carrierx + targetvectorx + p2tvx, carrierz + targetvectorz + p2tvz - spGiveOrderToUnit(subUnitID, CMD.MOVE, {formationx, targety, formationz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { formationx, targety, formationz }, 0) if not droneDocked then if carrierMetaData.dronebombingside == -1 then carrierMetaData.dronebombingside = 1 @@ -1361,31 +1296,30 @@ local function updateCarrier(carrierID, carrierMetaData, frame) spGiveOrderToUnit(subUnitID, CMD.ATTACK, target, 0) bomberStage = 3 elseif bomberStage == 3 + carrierMetaData.dronebombingruns then - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx, carriery, carrierz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx, carriery, carrierz }, 0) if carrierMetaData.docking then dockUnitQueue(carrierID, subUnitID) end elseif bomberStage == 4 + carrierMetaData.dronebombingruns then - rx, rz = randomPointInUnitCircle(5) - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius*0.2, carriery, carrierz + rz*idleRadius*0.2}, 0) + rx, rz = randomPointInUnitCircle(5) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius * 0.2, carriery, carrierz + rz * idleRadius * 0.2 }, 0) end droneData.bomberStage = bomberStage else if droneDocked and magnitude then - undockSequence(carrierID, subUnitID) droneInFormation = true - local p2tvx, p2tvz = attackFormationPosition*attackFormationSide*perpendicularvectorx/magnitude, attackFormationPosition*attackFormationSide*perpendicularvectorz/magnitude + local p2tvx, p2tvz = attackFormationPosition * attackFormationSide * perpendicularvectorx / magnitude, attackFormationPosition * attackFormationSide * perpendicularvectorz / magnitude - local formationx, formationz = carrierx+targetvectorx+p2tvx, carrierz+targetvectorz+p2tvz + local formationx, formationz = carrierx + targetvectorx + p2tvx, carrierz + targetvectorz + p2tvz - spGiveOrderToUnit(subUnitID, CMD.MOVE, {formationx, targety, formationz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { formationx, targety, formationz }, 0) if fightOrder then - local figthRadius = carrierMetaData.radius*0.2 + local figthRadius = carrierMetaData.radius * 0.2 rx, rz = randomPointInUnitCircle(5) - spGiveOrderToUnit(subUnitID, CMD.FIGHT, {targetx+rx*figthRadius, targety, targetz+rz*figthRadius}, CMD.OPT_SHIFT) + spGiveOrderToUnit(subUnitID, CMD.FIGHT, { targetx + rx * figthRadius, targety, targetz + rz * figthRadius }, CMD.OPT_SHIFT) else if droneType == "abductor" then spGiveOrderToUnit(subUnitID, CMD.LOAD_UNITS, target, CMD.OPT_SHIFT) @@ -1405,16 +1339,15 @@ local function updateCarrier(carrierID, carrierMetaData, frame) end if droneInFormation then - if droneDistance > (magnitude*carrierMetaData.attackFormationOffset/100) then + if droneDistance > (magnitude * carrierMetaData.attackFormationOffset / 100) then droneInFormation = false - end else if fightOrder then local cQueue = GetUnitCommands(subUnitID, 4) for j = 1, (cQueue and #cQueue or 0) do if cQueue[j].id == CMD.ATTACK and cachedFireState > 0 then - idleTarget = cQueue[j].params + idleTarget = cQueue[j].params break end end @@ -1422,9 +1355,9 @@ local function updateCarrier(carrierID, carrierMetaData, frame) if idleTarget then spGiveOrderToUnit(subUnitID, CMD.ATTACK, idleTarget, 0) else - local figthRadius = carrierMetaData.radius*0.2 + local figthRadius = carrierMetaData.radius * 0.2 rx, rz = randomPointInUnitCircle(5) - spGiveOrderToUnit(subUnitID, CMD.FIGHT, {targetx+rx*figthRadius, targety, targetz+rz*figthRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.FIGHT, { targetx + rx * figthRadius, targety, targetz + rz * figthRadius }, 0) end else if droneType == "abductor" then @@ -1444,7 +1377,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) end droneData.inFormation = droneInFormation end - elseif ((DEFAULT_UPDATE_ORDER_FREQUENCY + carrierMetaData.lastOrderUpdate) < frame) then + elseif (DEFAULT_UPDATE_ORDER_FREQUENCY + carrierMetaData.lastOrderUpdate) < frame then orderUpdate = true if carrierMetaData.docking and (idleRadius == 0 or droneType == "bomber") then dockUnitQueue(carrierID, subUnitID) @@ -1452,15 +1385,15 @@ local function updateCarrier(carrierID, carrierMetaData, frame) undockSequence(carrierID, subUnitID) rx, rz = randomPointInUnitCircle(5) if droneType == "bomber" then - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius*0.2, carriery, carrierz + rz*idleRadius*0.2}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius * 0.2, carriery, carrierz + rz * idleRadius * 0.2 }, 0) elseif droneType == "nano" then - spGiveOrderToUnit(subUnitID, CMD.REPAIR, {carrierx, carriery, carrierz, carrierMetaData.radius}, 0) + spGiveOrderToUnit(subUnitID, CMD.REPAIR, { carrierx, carriery, carrierz, carrierMetaData.radius }, 0) elseif droneType == "fighter" then if droneData.fighterStage == 0 then - spGiveOrderToUnit(subUnitID, CMD.FIGHT, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.FIGHT, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) end else - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) end end end @@ -1491,7 +1424,7 @@ local function updateCarrier(carrierID, carrierMetaData, frame) rx, rz = randomPointInUnitCircle(5) undockSequence(carrierID, subUnitID) if droneType == "nano" then - spGiveOrderToUnit(subUnitID, CMD.REPAIR, {carrierx, carriery, carrierz, carrierMetaData.radius}, 0) + spGiveOrderToUnit(subUnitID, CMD.REPAIR, { carrierx, carriery, carrierz, carrierMetaData.radius }, 0) local cQueue = GetUnitCommands(subUnitID, 4) local engaged = false for j = 1, (cQueue and #cQueue or 0) do @@ -1501,16 +1434,16 @@ local function updateCarrier(carrierID, carrierMetaData, frame) end end if not engaged then - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) end else if idleTarget then spGiveOrderToUnit(subUnitID, CMD.ATTACK, idleTarget, 0) else if droneType == "fighter" then - spGiveOrderToUnit(subUnitID, CMD.FIGHT, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.FIGHT, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) else - spGiveOrderToUnit(subUnitID, CMD.MOVE, {carrierx + rx*idleRadius, carriery, carrierz + rz*idleRadius}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { carrierx + rx * idleRadius, carriery, carrierz + rz * idleRadius }, 0) spGiveOrderToUnit(subUnitID, CMD.GUARD, carrierID, CMD.OPT_SHIFT) end end @@ -1527,7 +1460,6 @@ local function updateCarrier(carrierID, carrierMetaData, frame) end end - local inUnitCommand = false function gadget:UnitCommand(unitID, unitDefID, unitTeamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) @@ -1543,11 +1475,11 @@ function gadget:UnitCommand(unitID, unitDefID, unitTeamID, cmdID, cmdParams, cmd end end if carrierMetaList[unitID] and cmdID == CMD.STOP then - for subUnitID,value in pairsNext, carrierMetaList[unitID].subUnitsList do + for subUnitID, value in pairsNext, carrierMetaList[unitID].subUnitsList do if unitID == droneCarrierIdList[subUnitID] then spGiveOrderToUnit(subUnitID, cmdID, cmdParams, cmdOptions) local px, py, pz = spGetUnitPosition(unitID) - spGiveOrderToUnit(subUnitID, CMD.MOVE, {px, py, pz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { px, py, pz }, 0) end end elseif carrierMetaList[unitID] and (cmdID ~= CMD.MOVE and cmdID ~= CMD.FIRE_STATE and cmdID ~= CMD.STOCKPILE) then @@ -1567,7 +1499,6 @@ local function dockUnits(dockingqueue, queuestart, queueend) local dockingSnapRange if unitID and subUnitID and carrierMetaList[unitID] then - if carrierMetaList[unitID].subUnitsList[subUnitID] then local droneMetaData = carrierMetaList[unitID].subUnitsList[subUnitID] if droneMetaData.dockingPiece then @@ -1583,44 +1514,43 @@ local function dockUnits(dockingqueue, queuestart, queueend) while not droneDocked do local px, py, pz = spGetUnitPiecePosDir(unitID, pieceNumber) subx, suby, subz = spGetUnitPosition(subUnitID) - local distance = diag((px-subx), (pz-subz)) - local heightDifference = diag(py-suby) + local distance = diag((px - subx), (pz - subz)) + local heightDifference = diag(py - suby) if not distance then return end if distance < 25 and droneMetaData.isAirUnit then local landingspeed = carrierMetaList[unitID].dockHelperSpeed - if 0.2*heightDifference > landingspeed then - landingspeed = 0.2*heightDifference + if 0.2 * heightDifference > landingspeed then + landingspeed = 0.2 * heightDifference end - local magnitude = diag((subx-px), (suby-py), (subz-pz)) + local magnitude = diag((subx - px), (suby - py), (subz - pz)) if magnitude == 0 then magnitude = 0.0001 end - local vx, vy, vz = px-subx, py-suby, pz-subz - vx, vy, vz = landingspeed*vx/magnitude, landingspeed*vy/magnitude, landingspeed*vz/magnitude + local vx, vy, vz = px - subx, py - suby, pz - subz + vx, vy, vz = landingspeed * vx / magnitude, landingspeed * vy / magnitude, landingspeed * vz / magnitude spSetUnitVelocity(subUnitID, vx, vy, vz) elseif distance < carrierMetaList[unitID].dockRadius then local landingspeed = carrierMetaList[unitID].dockHelperSpeed - local magnitude = diag((subx-px), (suby-py), (subz-pz)) + local magnitude = diag((subx - px), (suby - py), (subz - pz)) if magnitude == 0 then magnitude = 0.0001 end - local vx, vy, vz = px-subx, py-suby, pz-subz - vx, vy, vz = landingspeed*vx/magnitude, landingspeed*vy/magnitude, landingspeed*vz/magnitude + local vx, vy, vz = px - subx, py - suby, pz - subz + vx, vy, vz = landingspeed * vx / magnitude, landingspeed * vy / magnitude, landingspeed * vz / magnitude Spring.MoveCtrl.Enable(subUnitID) - mcSetPosition(subUnitID, subx+vx, suby, subz+vz) + mcSetPosition(subUnitID, subx + vx, suby, subz + vz) Spring.MoveCtrl.Disable(subUnitID) spSetUnitVelocity(subUnitID, vx, 0, vz) heightDifference = 0 - else if dronetype == "bomber" then - spGiveOrderToUnit(subUnitID, CMD.MOVE, {px, py, pz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { px, py, pz }, 0) else spGiveOrderToUnit(subUnitID, CMD.STOP, {}, 0) - spGiveOrderToUnit(subUnitID, CMD.MOVE, {px, py, pz}, 0) + spGiveOrderToUnit(subUnitID, CMD.MOVE, { px, py, pz }, 0) end end @@ -1648,7 +1578,7 @@ local function dockUnits(dockingqueue, queuestart, queueend) if carrierMetaList[unitID].dockArmor then spSetUnitArmored(subUnitID, true, carrierMetaList[unitID].dockArmor) end - local _, pieceAngle = spCallCOBScript(unitID, "DroneDocked", 5, pieceAngle, pieceNumber) + local _, pieceAngle = spCallCOBScript(unitID, "DroneDocked", 5, pieceAngle, pieceNumber) spCallCOBScript(subUnitID, "Docked", 0, carrierMetaList[unitID].cobdockparam, pieceNumber, pieceAngle) if dronetype == "abductor" then @@ -1685,7 +1615,6 @@ local function dockUnits(dockingqueue, queuestart, queueend) return end end - end end @@ -1702,13 +1631,13 @@ function gadget:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCoun return elseif carrierMetaList[unitID].usestockpile and newCount > oldCount then local spawnData = carrierMetaList[unitID].subInitialSpawnData - local x, y, z = spGetUnitPosition(unitID) - spawnData.x = x - spawnData.y = y - spawnData.z = z - if x then - spawnUnit(spawnData) - end + local x, y, z = spGetUnitPosition(unitID) + spawnData.x = x + spawnData.y = y + spawnData.z = z + if x then + spawnUnit(spawnData) + end end end end @@ -1718,7 +1647,7 @@ function gadget:GameFrame(f) if f % GAME_SPEED ~= 0 then return end - if ((DEFAULT_SPAWN_CHECK_FREQUENCY + lastSpawnCheck) < f) then + if (DEFAULT_SPAWN_CHECK_FREQUENCY + lastSpawnCheck) < f then lastSpawnCheck = f for unitID, _ in pairs(carrierMetaList) do local isDoneBuilding = not spGetUnitIsBeingBuilt(unitID) @@ -1735,7 +1664,7 @@ function gadget:GameFrame(f) spawnUnit(spawnData) end elseif carrierMetaList[unitID].spawnRateFrames == 0 then - elseif ((carrierMetaList[unitID].spawnRateFrames + carrierMetaList[unitID].lastSpawn) < f and carrierMetaList[unitID].activeSpawning == 1 and isDoneBuilding) and not(carrierMetaList[unitID].usestockpile) then + elseif ((carrierMetaList[unitID].spawnRateFrames + carrierMetaList[unitID].lastSpawn) < f and carrierMetaList[unitID].activeSpawning == 1 and isDoneBuilding) and not carrierMetaList[unitID].usestockpile then local spawnData = carrierMetaList[unitID].subInitialSpawnData local x, y, z = spGetUnitPosition(unitID) spawnData.x = x @@ -1749,8 +1678,7 @@ function gadget:GameFrame(f) end end - - if ((CARRIER_UPDATE_FREQUENCY + lastCarrierUpdate) < f) then + if (CARRIER_UPDATE_FREQUENCY + lastCarrierUpdate) < f then lastCarrierUpdate = f for unitID, _ in pairsNext, carrierMetaList do updateCarrier(unitID, carrierMetaList[unitID], f) @@ -1759,27 +1687,25 @@ function gadget:GameFrame(f) previousHealFrame = f end - - if ((DEFAULT_DOCK_CHECK_FREQUENCY + lastDockCheck) < f) then + if (DEFAULT_DOCK_CHECK_FREQUENCY + lastDockCheck) < f then lastDockCheck = f if carrierQueuedDockingCount > 0 then -- Initiate docking for units in the docking queue and reset the queue. - local availableDockingCount = (carrierAvailableDockingCount-#coroutines) + local availableDockingCount = (carrierAvailableDockingCount - #coroutines) local carrierActiveDockingList = {} local carrierDockingCount = 0 if (carrierQueuedDockingCount - dockingQueueOffset) > availableDockingCount then carrierActiveDockingList = carrierDockingList - dockUnits(carrierActiveDockingList, (dockingQueueOffset+1), (dockingQueueOffset+availableDockingCount)) - dockingQueueOffset = dockingQueueOffset+availableDockingCount + dockUnits(carrierActiveDockingList, (dockingQueueOffset + 1), (dockingQueueOffset + availableDockingCount)) + dockingQueueOffset = dockingQueueOffset + availableDockingCount else carrierActiveDockingList = carrierDockingList carrierDockingCount = carrierQueuedDockingCount carrierQueuedDockingCount = 0 - dockUnits(carrierActiveDockingList, (dockingQueueOffset+1), carrierDockingCount) + dockUnits(carrierActiveDockingList, (dockingQueueOffset + 1), carrierDockingCount) dockingQueueOffset = 0 end end end - end function gadget:Initialize() @@ -1793,12 +1719,11 @@ function gadget:Initialize() gaiaTeam = Spring.GetGaiaTeamID() gadgetHandler:RegisterGlobal("CobUndockSequenceFinished", CobUndockSequenceFinished) gadgetHandler:RegisterGlobal("CobDroneSpawnSequenceFinished", CobDroneSpawnSequenceFinished) - end function gadget:Shutdown() for unitID, _ in pairsNext, carrierMetaList do - for subUnitID,value in pairsNext, carrierMetaList[unitID].subUnitsList do + for subUnitID, value in pairsNext, carrierMetaList[unitID].subUnitsList do spDestroyUnit(subUnitID, true, true) end end diff --git a/luarules/gadgets/unit_cheat_no_waste.lua b/luarules/gadgets/unit_cheat_no_waste.lua index 901a490c23a..56539ef9aae 100644 --- a/luarules/gadgets/unit_cheat_no_waste.lua +++ b/luarules/gadgets/unit_cheat_no_waste.lua @@ -8,16 +8,20 @@ function gadget:GetInfo() date = "January 2025", license = "GPLv2", layer = 1, - enabled = true + enabled = true, } end --early exits -if not gadgetHandler:IsSyncedCode() then return false end +if not gadgetHandler:IsSyncedCode() then + return false +end local modOptions = Spring.GetModOptions() -if modOptions.nowasting == "default" or modOptions.nowasting == "disabled" then return false end +if modOptions.nowasting == "default" or modOptions.nowasting == "disabled" then + return false +end --static variables @@ -63,14 +67,14 @@ local function updateTeamOverflowing(allyID, oldMultiplier) --variables local teamIDs = boostableAllies[allyID] - local totalMetal = 0 - local totalMetalStorage = 0 + local totalMetal = 0 + local totalMetalStorage = 0 local totalMetalReceived = 0 - local metalPercentile = 0 + local metalPercentile = 0 local wastingMetal = true for teamID, _ in pairs(teamIDs) do - local metal, metalStorage, pull, metalIncome, metalExpense,share, metalSent, metalReceived = spGetTeamResources(teamID, "metal") + local metal, metalStorage, pull, metalIncome, metalExpense, share, metalSent, metalReceived = spGetTeamResources(teamID, "metal") totalMetal = totalMetal + metal totalMetalStorage = totalMetalStorage + metalStorage totalMetalReceived = totalMetalReceived + metalReceived @@ -86,8 +90,7 @@ local function updateTeamOverflowing(allyID, oldMultiplier) if totalMetalStorage * metalToStorageRatioMultiplier > totalMetal or (modOptions.dynamiccheats == true and alliesAreWinning == true) then local newMultiplier = math.max(oldMultiplier / buildPowerCompounder, 1) return newMultiplier - elseif wastingMetal == true and (modOptions.dynamiccheats == false or - (alliesAreWinning == false and averageAlliedTechGuesstimate(_, allyID) >= minimumTechLvlToCheat)) then + elseif wastingMetal == true and (modOptions.dynamiccheats == false or (alliesAreWinning == false and averageAlliedTechGuesstimate(_, allyID) >= minimumTechLvlToCheat)) then local newMultiplier = math.min(oldMultiplier * buildPowerCompounder, maxBuildPowerMultiplier) return newMultiplier else @@ -125,7 +128,7 @@ end function gadget:GameFrame(frame) if frame % 600 == 0 then for allyID, oldBuildPowerMultiplier in pairs(overflowingAllies) do - local newBuildPowerMultiplier = updateTeamOverflowing(allyID, oldBuildPowerMultiplier) + local newBuildPowerMultiplier = updateTeamOverflowing(allyID, oldBuildPowerMultiplier) if newBuildPowerMultiplier ~= 1 then updateAllyUnitsBuildPowers(allyID, newBuildPowerMultiplier) overflowingAllies[allyID] = newBuildPowerMultiplier @@ -145,12 +148,12 @@ end function gadget:Initialize() aiTeams = GG.PowerLib.AiTeams - for teamID, _ in pairs (aiTeams) do + for teamID, _ in pairs(aiTeams) do boostableTeams[teamID] = true end humanTeams = GG.PowerLib.HumanTeams if modOptions.nowasting == "all" then - for teamID, _ in pairs (humanTeams) do + for teamID, _ in pairs(humanTeams) do boostableTeams[teamID] = true end end @@ -165,4 +168,4 @@ function gadget:Initialize() isAllyTeamWinning = GG.PowerLib.IsAllyTeamWinning averageAlliedTechGuesstimate = GG.PowerLib.AverageAlliedTechGuesstimate -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_cloak.lua b/luarules/gadgets/unit_cloak.lua index 87a07622ce6..a73f5956a90 100644 --- a/luarules/gadgets/unit_cloak.lua +++ b/luarules/gadgets/unit_cloak.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Cloak", -- gadget copy from: Decloak when damaged - desc = "optionally: decloaks units when they are damged", - author = "Google Frog", - date = "Nov 25, 2009", -- Major rework 12 Feb 2014 - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Cloak", -- gadget copy from: Decloak when damaged + desc = "optionally: decloaks units when they are damged", + author = "Google Frog", + date = "Nov 25, 2009", -- Major rework 12 Feb 2014 + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -22,16 +21,16 @@ local decloakWhenDamaged = false include("LuaRules/Configs/customcmds.h.lua") local unitWantCloakCommandDesc = { - id = CMD_WANT_CLOAK, - type = CMDTYPE.ICON_MODE, - name = 'Cloak State', - action = 'wantcloak', + id = CMD_WANT_CLOAK, + type = CMDTYPE.ICON_MODE, + name = "Cloak State", + action = "wantcloak", queueing = false, - tooltip = 'invisiblility state', - params = {0, 'Decloaked', 'Cloaked'} + tooltip = "invisiblility state", + params = { 0, "Decloaked", "Cloaked" }, } -local alliedTrueTable = {allied = true} +local alliedTrueTable = { allied = true } local spGetUnitIsStunned = Spring.GetUnitIsStunned local spAreTeamsAllied = Spring.AreTeamsAllied @@ -70,11 +69,10 @@ function PokeDecloakUnit(unitID, duration) if recloakUnit[unitID] then recloakUnit[unitID] = duration or DEFAULT_DECLOAK_TIME else - spSetUnitRulesParam(unitID, 'cannotcloak', 1, alliedTrueTable) + spSetUnitRulesParam(unitID, "cannotcloak", 1, alliedTrueTable) spSetUnitCloak(unitID, 0) recloakUnit[unitID] = duration or DEFAULT_DECLOAK_TIME end - end GG.PokeDecloakUnit = PokeDecloakUnit @@ -87,13 +85,8 @@ if decloakWhenDamaged then noFFWeaponDefs[i] = true end end - function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam) - if damage > 0 and - not (attackerTeam and - weaponID and - noFFWeaponDefs[weaponID] and - attackerID ~= unitID and - spAreTeamsAllied(unitTeam, attackerTeam)) then + function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam) + if damage > 0 and not (attackerTeam and weaponID and noFFWeaponDefs[weaponID] and attackerID ~= unitID and spAreTeamsAllied(unitTeam, attackerTeam)) then PokeDecloakUnit(unitID) end end @@ -101,15 +94,15 @@ end function gadget:GameFrame(n) currentFrame = n - if n%UPDATE_FREQUENCY == 2 then + if n % UPDATE_FREQUENCY == 2 then for unitID, frames in pairs(recloakUnit) do if frames <= UPDATE_FREQUENCY then - local onFire = spGetUnitRulesParam(unitID,'on_fire') - local disarmed = spGetUnitRulesParam(unitID,'disarmed') + local onFire = spGetUnitRulesParam(unitID, "on_fire") + local disarmed = spGetUnitRulesParam(unitID, "disarmed") if not (onFire == 1 or disarmed == 1) then - local wantCloakState = spGetUnitRulesParam(unitID, 'wantcloak') - local areaCloaked = spGetUnitRulesParam(unitID, 'areacloaked') - spSetUnitRulesParam(unitID, 'cannotcloak', 0, alliedTrueTable) + local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") + spSetUnitRulesParam(unitID, "cannotcloak", 0, alliedTrueTable) if wantCloakState == 1 or areaCloaked == 1 then spSetUnitCloak(unitID, 1) end @@ -119,7 +112,6 @@ function gadget:GameFrame(n) recloakUnit[unitID] = frames - UPDATE_FREQUENCY end end - end end @@ -146,13 +138,13 @@ function gadget:AllowUnitCloak(unitID, enemyID) return false end - local areaCloaked = (spGetUnitRulesParam(unitID, 'areacloaked') == 1) and ((spGetUnitRulesParam(unitID, 'cloak_shield') or 0) == 0) + local areaCloaked = (spGetUnitRulesParam(unitID, "areacloaked") == 1) and ((spGetUnitRulesParam(unitID, "cloak_shield") or 0) == 0) if not areaCloaked then local speed = select(4, spGetUnitVelocity(unitID)) local moving = speed and speed > CLOAK_MOVE_THRESHOLD local cost = moving and canCloak[unitDefID][2] or canCloak[unitDefID][3] - if not spUseUnitResource(unitID, "e", cost/2) then -- SlowUpdate happens twice a second. + if not spUseUnitResource(unitID, "e", cost / 2) then -- SlowUpdate happens twice a second. return false end end @@ -169,32 +161,32 @@ local function SetWantedCloaked(unitID, state) return end - local wantCloakState = spGetUnitRulesParam(unitID, 'wantcloak') + local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") local cmdDescID = spFindUnitCmdDesc(unitID, CMD_WANT_CLOAK) if cmdDescID then - spEditUnitCmdDesc(unitID, cmdDescID, { params = {state, 'Decloaked', 'Cloaked'}}) + spEditUnitCmdDesc(unitID, cmdDescID, { params = { state, "Decloaked", "Cloaked" } }) end if state == 1 and wantCloakState ~= 1 then - local cannotCloak = spGetUnitRulesParam(unitID, 'cannotcloak') - local areaCloaked = spGetUnitRulesParam(unitID, 'areacloaked') + local cannotCloak = spGetUnitRulesParam(unitID, "cannotcloak") + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") if cannotCloak ~= 1 and areaCloaked ~= 1 then spSetUnitCloak(unitID, 1) end - spSetUnitRulesParam(unitID, 'wantcloak', 1, alliedTrueTable) + spSetUnitRulesParam(unitID, "wantcloak", 1, alliedTrueTable) elseif state == 0 and wantCloakState == 1 then - local areaCloaked = spGetUnitRulesParam(unitID, 'areacloaked') + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") if areaCloaked ~= 1 then spSetUnitCloak(unitID, 0) end - spSetUnitRulesParam(unitID, 'wantcloak', 0, alliedTrueTable) + spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) end end GG.SetWantedCloaked = SetWantedCloaked function gadget:AllowCommand_GetWantedCommand() - return {[CMD_CLOAK] = true, [CMD_WANT_CLOAK] = true} + return { [CMD_CLOAK] = true, [CMD_WANT_CLOAK] = true } end function gadget:AllowCommand_GetWantedUnitDefID() @@ -218,7 +210,7 @@ function gadget:UnitCreated(unitID, unitDefID) if cloakDescID then spInsertUnitCmdDesc(unitID, unitWantCloakCommandDesc) spRemoveUnitCmdDesc(unitID, cloakDescID) - spSetUnitRulesParam(unitID, 'wantcloak', 0, alliedTrueTable) + spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) if canCloak[unitDefID][1] then SetWantedCloaked(unitID, 1) end diff --git a/luarules/gadgets/unit_collision_damage_behavior.lua b/luarules/gadgets/unit_collision_damage_behavior.lua index 8a08cb4bcf3..d228d5d1ca3 100644 --- a/luarules/gadgets/unit_collision_damage_behavior.lua +++ b/luarules/gadgets/unit_collision_damage_behavior.lua @@ -8,11 +8,13 @@ function gadget:GetInfo() date = "2024.8.29", license = "GNU GPL, v2 or later", layer = -1, - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end --customparams.fall_damage_multiplier = a multiplier that's applied to defaultDamageMultiplier which affects the amount of damage taken from falling/collisions. @@ -99,7 +101,7 @@ end for weaponDefID, wDef in ipairs(WeaponDefs) do if wDef.damages and wDef.damages.impulseBoost and wDef.damages.impulseFactor then - weaponDefIDImpulses[weaponDefID] = {impulseBoost = wDef.damages.impulseBoost, impulseFactor = wDef.damages.impulseFactor} + weaponDefIDImpulses[weaponDefID] = { impulseBoost = wDef.damages.impulseBoost, impulseFactor = wDef.damages.impulseFactor } if wDef.beamtime then weaponDefIDImpulses[weaponDefID].impulseBoost = weaponDefIDImpulses[weaponDefID].impulseBoost * 1 / math.floor(wDef.beamtime * Game.gameSpeed) --this splits up impulseBoost across the number of frames that damage is dealt end @@ -112,10 +114,9 @@ for weaponDefID, wDef in ipairs(WeaponDefs) do end return damage end - + --generate list of exempted weapons to improve performance - if wDef.damages and wDef.damages.impulseFactor == 0 or - (wDef.damages.impulseFactor < minImpulseFactor and wDef.damages.impulseBoost < maxDamage(wDef.damages) * minImpulseToDamageRatio) then + if wDef.damages and wDef.damages.impulseFactor == 0 or (wDef.damages.impulseFactor < minImpulseFactor and wDef.damages.impulseBoost < maxDamage(wDef.damages) * minImpulseToDamageRatio) then weaponDefIgnored[weaponDefID] = true end end @@ -132,7 +133,7 @@ local function getImpulseMultiplier(unitDefID, weaponDefID, damage) if impulse < unitsMinImpulse[unitDefID] then impulseMultiplier = 0 else - impulseMultiplier = mathMin(unitsMaxImpulse[unitDefID]/impulse, 1) -- negative impulse values are not capped. + impulseMultiplier = mathMin(unitsMaxImpulse[unitDefID] / impulse, 1) -- negative impulse values are not capped. end return impulseMultiplier end @@ -159,18 +160,18 @@ end local function isValidCollisionDirection(unitID) local velX, velY, velZ, velLength = spGetUnitVelocity(unitID) - -- y-velocity check prevents mostly horizontal object collisions from taking damage, allows damage if dropped from above - return velLength > collisionVelocityThreshold and -velY > (velLength * validCollisionAngleMultiplier) + -- y-velocity check prevents mostly horizontal object collisions from taking damage, allows damage if dropped from above + return velLength > collisionVelocityThreshold and -velY > (velLength * validCollisionAngleMultiplier) end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if not weaponDefIgnored[weaponDefID] and weaponDefID >= 0 then --this section handles limiting maximum impulse local impulseMultiplier = 1 - impulseMultiplier = getImpulseMultiplier(unitDefID, weaponDefID, damage) - if not unitInertiaCheckFlags[unitID] and impulseMultiplier ~= 0 then - unitInertiaCheckFlags[unitID] = {expirationFrame = gameFrame + velocityWatchFrames, velocityCap = unitDefData[unitDefID].velocityCap} - end - return damage, impulseMultiplier + impulseMultiplier = getImpulseMultiplier(unitDefID, weaponDefID, damage) + if not unitInertiaCheckFlags[unitID] and impulseMultiplier ~= 0 then + unitInertiaCheckFlags[unitID] = { expirationFrame = gameFrame + velocityWatchFrames, velocityCap = unitDefData[unitDefID].velocityCap } + end + return damage, impulseMultiplier elseif (weaponDefID == groundCollisionDefID or weaponDefID == objectCollisionDefID) and (isValidCollisionDirection(unitID) or fallingUnits[unitID]) then local healthRatioMultiplier, health = massToHealthRatioMultiplier(unitID, unitDefID) damage = preventOverkillDamage(unitID, damage, health, healthRatioMultiplier) @@ -184,7 +185,7 @@ function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTe transportedUnits[unitID] = true end -function gadget:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) +function gadget:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) transportedUnits[unitID] = nil fallingUnits[unitID] = true --units falling from transports should take collision damagee from any trajectory, including when bouncing off of other objects. end @@ -213,11 +214,11 @@ function gadget:GameFrame(frame) local velX, velY, velZ, velocityLength = spGetUnitVelocity(unitID) if not data.velocityReduced and velocityLength > data.velocityCap then local verticalVelocityCapThreshold = 0.07 --value derived from empirical testing to prevent fall damage and goofy trajectories from impulse - local horizontalVelocity = mathSqrt(velX^2 + velZ^2) + local horizontalVelocity = mathSqrt(velX ^ 2 + velZ ^ 2) local newVelY = mathAbs(mathMin(horizontalVelocity * verticalVelocityCapThreshold, velY)) local newVelYToOldVelYRatio if velY ~= 0 then - newVelYToOldVelYRatio = mathMin(mathAbs(newVelY/velY), 1) + newVelYToOldVelYRatio = mathMin(mathAbs(newVelY / velY), 1) else newVelYToOldVelYRatio = 1 end @@ -265,7 +266,7 @@ local function setVelocityControl(unitID, enabled) elseif not unitInertiaCheckFlags[unitID] then unitInertiaCheckFlags[unitID] = { expirationFrame = gameFrame + velocityWatchFrames, - velocityCap = unitDefData[Spring.GetUnitDefID(unitID)].velocityCap, + velocityCap = unitDefData[Spring.GetUnitDefID(unitID)].velocityCap, } end end diff --git a/luarules/gadgets/unit_combomb_full_damage.lua b/luarules/gadgets/unit_combomb_full_damage.lua index ac56505e257..2ef91700b4c 100644 --- a/luarules/gadgets/unit_combomb_full_damage.lua +++ b/luarules/gadgets/unit_combomb_full_damage.lua @@ -6,33 +6,31 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "unit_combomb_full_damage", - desc = "Flying Combombs Do Less Damage", - author = "TheFatController, Bluestone", - date = "Dec 2012", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "unit_combomb_full_damage", + desc = "Flying Combombs Do Less Damage", + author = "TheFatController, Bluestone", + date = "Dec 2012", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - if not gadgetHandler:IsSyncedCode() then return false end -local COM_BLAST = WeaponDefNames['commanderexplosion'].id +local COM_BLAST = WeaponDefNames["commanderexplosion"].id function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) --we use UnitPreDamaged so as we get in before unit_transportfix has its effect - --Spring.Echo("UnitPreDamaged called with unitID " .. unitID .. " and attackerID ", attackerID) if weaponDefID == COM_BLAST and attackerID ~= nil and Spring.ValidUnitID(attackerID) then -- we control the damage inflicted on units by the COM_BLAST. Very rarely an invalid attackerID is returned with weaponID=COM_BLAST, I have no idea why/how. --Spring.Echo("weapon is comblast from unloaded com " .. attackerID) - local x,y,z = Spring.GetUnitBasePosition(attackerID) - local h = Spring.GetGroundHeight(x,z) + local x, y, z = Spring.GetUnitBasePosition(attackerID) + local h = Spring.GetGroundHeight(x, z) --Spring.Echo(x .. " " .. y .. " " .. z .. " " .. h) - if y-h > 10 then + if y - h > 10 then local newdamage = select(2, Spring.GetUnitHealth(unitID)) * 0.6 if newdamage < 400 then newdamage = 400 @@ -41,10 +39,8 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w newdamage = damage end --Spring.Echo("new damage is " .. newdamage .. ", old damage is " .. damage .. ", hp is " .. hp) - return newdamage,0 + return newdamage, 0 end end - return damage,1 + return damage, 1 end - - diff --git a/luarules/gadgets/unit_commando_watch.lua b/luarules/gadgets/unit_commando_watch.lua index 7976a8fe377..e9556ee58f9 100644 --- a/luarules/gadgets/unit_commando_watch.lua +++ b/luarules/gadgets/unit_commando_watch.lua @@ -11,7 +11,7 @@ function gadget:GetInfo() date = "Aug 17, 2010", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -31,7 +31,7 @@ MINE_BLAST[WeaponDefNames["mine_heavy"].id] = true local isBuilding = {} local isCommando = {} for udid, ud in pairs(UnitDefs) do - if string.find(ud.name, 'cormando') then + if string.find(ud.name, "cormando") then isCommando[udid] = true end if ud.isBuilding then diff --git a/luarules/gadgets/unit_continuous_aim.lua b/luarules/gadgets/unit_continuous_aim.lua index b43efc70994..a637e4be5d8 100644 --- a/luarules/gadgets/unit_continuous_aim.lua +++ b/luarules/gadgets/unit_continuous_aim.lua @@ -19,142 +19,140 @@ end local spSetUnitWeaponState = Spring.SetUnitWeaponState local tableCopy = table.copy - local convertedUnitsNames = { -- value is reaimtime in frames, engine default is 15 - ['armfav'] = 3, - ['armbeamer'] = 3, - ['armpw'] = 2, - ['armpwt4'] = 2, - ['armflea'] = 2, - ['armrock'] = 2, - ['armham'] = 2, - ['armwar'] = 6, - ['armjeth'] = 2, - ['corfav'] = 3, - ['corak'] = 2, - ['corthud'] = 2, - ['corstorm'] = 2, - ['corcrash'] = 5, - ['legkark'] = 2, - ['corkark'] = 2, - ['cordeadeye'] =2, - ['armsnipe'] = 2, - ['armfido'] = 3, - ['armfboy'] = 2, - ['armfast'] = 2, - ['armamph'] = 3, - ['armmav'] = 2, - ['armspid'] = 3, - ['armsptk'] = 5, - ['armzeus'] = 3, - ['coramph'] = 3, - ['corcan'] = 2, - ['corhrk'] = 5, - ['cormando'] = 2, - ['cormort'] = 2, - ['corpyro'] = 2, - ['cortermite'] = 2, - ['armraz'] = 6, - ['armmar'] = 3, - ['armbanth'] = 1, - ['corkorg'] = 1, - ['armvang'] = 3, - ['armcrus'] = 5, - ['corsala'] = 6, - ['corsiegebreaker'] = 5, - ['legerailtank'] = 9, + ["armfav"] = 3, + ["armbeamer"] = 3, + ["armpw"] = 2, + ["armpwt4"] = 2, + ["armflea"] = 2, + ["armrock"] = 2, + ["armham"] = 2, + ["armwar"] = 6, + ["armjeth"] = 2, + ["corfav"] = 3, + ["corak"] = 2, + ["corthud"] = 2, + ["corstorm"] = 2, + ["corcrash"] = 5, + ["legkark"] = 2, + ["corkark"] = 2, + ["cordeadeye"] = 2, + ["armsnipe"] = 2, + ["armfido"] = 3, + ["armfboy"] = 2, + ["armfast"] = 2, + ["armamph"] = 3, + ["armmav"] = 2, + ["armspid"] = 3, + ["armsptk"] = 5, + ["armzeus"] = 3, + ["coramph"] = 3, + ["corcan"] = 2, + ["corhrk"] = 5, + ["cormando"] = 2, + ["cormort"] = 2, + ["corpyro"] = 2, + ["cortermite"] = 2, + ["armraz"] = 6, + ["armmar"] = 3, + ["armbanth"] = 1, + ["corkorg"] = 1, + ["armvang"] = 3, + ["armcrus"] = 5, + ["corsala"] = 6, + ["corsiegebreaker"] = 5, + ["legerailtank"] = 9, -- the following units get a faster reaimtime to counteract their turret acceleration - ['armthor'] = 4, - ['armflash'] = 6, - ['corgator'] = 6, - ['armdecade'] = 6, - ['coresupp'] = 6, - ['corhlt'] = 5, - ['corfhlt'] = 5, - ['cordoom'] = 5, - ['corshiva'] = 5, - ['corcat'] = 5, - ['corkarg'] = 5, - ['corbhmth'] = 5, - ['armguard'] = 5, - ['armamb'] = 5, - ['corpun'] = 5, - ['cortoast'] = 5, - ['corbats'] = 5, - ['corblackhy'] = 6, - ['corscreamer'] = 5, - ['corcom'] = 5, - ['armcom'] = 5, - ['cordecom'] = 5, - ['armdecom'] = 5, - ['legcom'] = 5, - ['legdecom'] = 5, - ['legcomlvl2'] = 5, - ['legcomlvl3'] = 5, - ['legcomlvl4'] = 5, - ['legcomlvl5'] = 5, - ['legcomlvl6'] = 5, - ['legcomlvl7'] = 5, - ['legcomlvl8'] = 5, - ['legcomlvl9'] = 5, - ['legcomlvl10'] = 5, - ['legah'] = 5, - ['legbal'] = 5, - ['legbastion'] = 5, - ['legcen'] = 3, - ['legfloat'] = 5, - ['leggat'] = 5, - ['leggob'] = 5, - ['leginc'] = 1, - ['cordemon'] = 6, - ['corcrwh'] = 7, - ['leglob'] = 5, - ['legmos'] = 5, - ['leghades'] = 5, - ['leghelios'] = 5, - ['legheavydrone'] = 5, - ['legkeres'] = 5, - ['legrail'] = 5, - ['legbar'] = 5, - ['legcomoff'] = 5, - ['legcomt2off'] = 5, - ['legcomt2com'] = 5, - ['legstr'] = 3, - ['legamph'] = 4, - ['legbart'] = 5, - ['legmrv'] = 5, - ['legsco'] = 5, - ['leegmech'] = 5, - ['legionnaire'] = 5, - ['legafigdef'] = 5, - ['legvenator'] = 5, - ['legmed'] = 5, - ['legaskirmtank'] = 5, - ['legaheattank'] = 3, - ['legeheatraymech'] = 1, - ['legtriariusdrone'] = 1, - ['legnavydestro'] = 4, - ['legeheatraymech_old'] = 1, - ['legbunk'] = 3, - ['legrwall'] = 4, - ['legjav'] = 1, - ['legeshotgunmech'] = 3, - ['legehovertank'] = 4, - ['armanavaldefturret'] = 4, - ['leganavyflagship'] = 4, - ['leganavyantiswarm'] = 5, - ['leganavycruiser'] = 5, + ["armthor"] = 4, + ["armflash"] = 6, + ["corgator"] = 6, + ["armdecade"] = 6, + ["coresupp"] = 6, + ["corhlt"] = 5, + ["corfhlt"] = 5, + ["cordoom"] = 5, + ["corshiva"] = 5, + ["corcat"] = 5, + ["corkarg"] = 5, + ["corbhmth"] = 5, + ["armguard"] = 5, + ["armamb"] = 5, + ["corpun"] = 5, + ["cortoast"] = 5, + ["corbats"] = 5, + ["corblackhy"] = 6, + ["corscreamer"] = 5, + ["corcom"] = 5, + ["armcom"] = 5, + ["cordecom"] = 5, + ["armdecom"] = 5, + ["legcom"] = 5, + ["legdecom"] = 5, + ["legcomlvl2"] = 5, + ["legcomlvl3"] = 5, + ["legcomlvl4"] = 5, + ["legcomlvl5"] = 5, + ["legcomlvl6"] = 5, + ["legcomlvl7"] = 5, + ["legcomlvl8"] = 5, + ["legcomlvl9"] = 5, + ["legcomlvl10"] = 5, + ["legah"] = 5, + ["legbal"] = 5, + ["legbastion"] = 5, + ["legcen"] = 3, + ["legfloat"] = 5, + ["leggat"] = 5, + ["leggob"] = 5, + ["leginc"] = 1, + ["cordemon"] = 6, + ["corcrwh"] = 7, + ["leglob"] = 5, + ["legmos"] = 5, + ["leghades"] = 5, + ["leghelios"] = 5, + ["legheavydrone"] = 5, + ["legkeres"] = 5, + ["legrail"] = 5, + ["legbar"] = 5, + ["legcomoff"] = 5, + ["legcomt2off"] = 5, + ["legcomt2com"] = 5, + ["legstr"] = 3, + ["legamph"] = 4, + ["legbart"] = 5, + ["legmrv"] = 5, + ["legsco"] = 5, + ["leegmech"] = 5, + ["legionnaire"] = 5, + ["legafigdef"] = 5, + ["legvenator"] = 5, + ["legmed"] = 5, + ["legaskirmtank"] = 5, + ["legaheattank"] = 3, + ["legeheatraymech"] = 1, + ["legtriariusdrone"] = 1, + ["legnavydestro"] = 4, + ["legeheatraymech_old"] = 1, + ["legbunk"] = 3, + ["legrwall"] = 4, + ["legjav"] = 1, + ["legeshotgunmech"] = 3, + ["legehovertank"] = 4, + ["armanavaldefturret"] = 4, + ["leganavyflagship"] = 4, + ["leganavyantiswarm"] = 5, + ["leganavycruiser"] = 5, } --add entries for scavboss -local scavengerBossV4Table = {'scavengerbossv4_veryeasy', 'scavengerbossv4_easy', 'scavengerbossv4_normal', 'scavengerbossv4_hard', 'scavengerbossv4_veryhard', 'scavengerbossv4_epic', - 'scavengerbossv4_veryeasy_scav', 'scavengerbossv4_easy_scav', 'scavengerbossv4_normal_scav', 'scavengerbossv4_hard_scav', 'scavengerbossv4_veryhard_scav', 'scavengerbossv4_epic_scav'} +local scavengerBossV4Table = { "scavengerbossv4_veryeasy", "scavengerbossv4_easy", "scavengerbossv4_normal", "scavengerbossv4_hard", "scavengerbossv4_veryhard", "scavengerbossv4_epic", "scavengerbossv4_veryeasy_scav", "scavengerbossv4_easy_scav", "scavengerbossv4_normal_scav", "scavengerbossv4_hard_scav", "scavengerbossv4_veryhard_scav", "scavengerbossv4_epic_scav" } for _, name in pairs(scavengerBossV4Table) do convertedUnitsNames[name] = 4 end --if Spring.GetModOptions().emprework then - --convertedUnitsNames['armdfly'] = 50 +--convertedUnitsNames['armdfly'] = 50 --end -- convert unitname -> unitDefID local convertedUnits = {} @@ -165,13 +163,12 @@ for name, params in pairs(convertedUnitsNames) do end convertedUnitsNames = nil - local spamUnitsTeamsNames = { --{unitDefID = {teamID = totalcreated,...}} - ['armpw'] = {}, - ['armflea'] = {}, - ['armfav'] = {}, - ['corak'] = {}, - ['corfav'] = {}, + ["armpw"] = {}, + ["armflea"] = {}, + ["armfav"] = {}, + ["corak"] = {}, + ["corfav"] = {}, } -- convert unitname -> unitDefID local spamUnitsTeams = {} @@ -182,10 +179,8 @@ for name, params in pairs(spamUnitsTeamsNames) do end spamUnitsTeamsNames = nil - local spamUnitsTeamsReaimTimes = {} --{unitDefID = {teamID = currentReAimTime,...}} - -- for every spamThreshold'th spammable unit type built by this team, increase reaimtime by 1 for that team local spamThreshold = 100 local maxReAimTime = 15 @@ -193,15 +188,15 @@ local maxReAimTime = 15 -- add for scavengers copies local convertedUnitsCopy = tableCopy(convertedUnits) for id, v in pairs(convertedUnitsCopy) do - if UnitDefNames[UnitDefs[id].name..'_scav'] then - convertedUnits[UnitDefNames[UnitDefs[id].name..'_scav'].id] = v + if UnitDefNames[UnitDefs[id].name .. "_scav"] then + convertedUnits[UnitDefNames[UnitDefs[id].name .. "_scav"].id] = v end end local spamUnitsTeamsCopy = tableCopy(spamUnitsTeams) -for id,v in pairs(spamUnitsTeamsCopy) do - if UnitDefNames[UnitDefs[id].name..'_scav'] then - spamUnitsTeams[UnitDefNames[UnitDefs[id].name..'_scav'].id] = {} +for id, v in pairs(spamUnitsTeamsCopy) do + if UnitDefNames[UnitDefs[id].name .. "_scav"] then + spamUnitsTeams[UnitDefNames[UnitDefs[id].name .. "_scav"].id] = {} end end @@ -217,7 +212,7 @@ for unitDefID, _ in pairs(convertedUnits) do if #weapons > 0 then unitWeapons[unitDefID] = {} for id, _ in pairs(weapons) do - unitWeapons[unitDefID][id] = true -- no need to store weapondefid + unitWeapons[unitDefID][id] = true -- no need to store weapondefid end else -- units with no weapons shouldnt even be here diff --git a/luarules/gadgets/unit_corpse_link.lua b/luarules/gadgets/unit_corpse_link.lua index cd54bc9fd20..059e35b5045 100644 --- a/luarules/gadgets/unit_corpse_link.lua +++ b/luarules/gadgets/unit_corpse_link.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Corpse link", - desc = "Links corpses to their previous owner", - author = "SethDGamre", - date = "4 November 2025", + name = "Corpse link", + desc = "Links corpses to their previous owner", + author = "SethDGamre", + date = "4 November 2025", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, handler = true, enabled = not Engine.FeatureSupport.FeatureCreatedPassesSourceUnitID, } @@ -75,7 +75,7 @@ function gadget:UnitDestroyed(unitID, unitDefID) local positionHash = getPositionHash(x, z) unitDefLink[positionHash] = { unitID = unitID, - timeout = Spring.GetGameFrame() + CORPSE_LINK_TIMEOUT + timeout = Spring.GetGameFrame() + CORPSE_LINK_TIMEOUT, } end @@ -109,4 +109,4 @@ end function gadget:Shutdown() gadgetHandler.FeatureCreated = originalFeatureCreated -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_crashing_aircraft.lua b/luarules/gadgets/unit_crashing_aircraft.lua index 55a7d68fe89..d9d2aeae2fa 100644 --- a/luarules/gadgets/unit_crashing_aircraft.lua +++ b/luarules/gadgets/unit_crashing_aircraft.lua @@ -2,18 +2,17 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Crashing Aircraft", - desc = "Make aircraft crashing down instead of just exploding", - author = "Beherith", - date = "aug 2012", - license = "GNU GPL, v2 or later", - layer = 1000, - enabled = true, + name = "Crashing Aircraft", + desc = "Make aircraft crashing down instead of just exploding", + author = "Beherith", + date = "aug 2012", + license = "GNU GPL, v2 or later", + layer = 1000, + enabled = true, } end if gadgetHandler:IsSyncedCode() then - local gravityMult = 1.7 local SetUnitSensorRadius = Spring.SetUnitSensorRadius @@ -38,18 +37,18 @@ if gadgetHandler:IsSyncedCode() then local SetUnitCrashing = Spring.SetUnitCrashing local COB_CRASHING = COB.CRASHING - local COM_BLAST = WeaponDefNames['commanderexplosion'].id -- used to prevent them being boosted and flying far away + local COM_BLAST = WeaponDefNames["commanderexplosion"].id -- used to prevent them being boosted and flying far away local CMD_STOP = CMD.STOP local crashing = {} - GG.Crashing = crashing -- read-only reference for other gadgets + GG.Crashing = crashing -- read-only reference for other gadgets local crashingCount = 0 local isAircon = {} - local crashable = {} + local crashable = {} local unitWeaponCount = {} - for udid,UnitDef in pairs(UnitDefs) do - if UnitDef.canFly == true and (not UnitDef.customParams.crashable or UnitDef.customParams.crashable ~= '0') then + for udid, UnitDef in pairs(UnitDefs) do + if UnitDef.canFly == true and (not UnitDef.customParams.crashable or UnitDef.customParams.crashable ~= "0") then crashable[UnitDef.id] = true if UnitDef.buildSpeed > 1 then isAircon[udid] = true @@ -62,16 +61,18 @@ if gadgetHandler:IsSyncedCode() then end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) - if paralyzer then return damage,1 end + if paralyzer then + return damage, 1 + end if crashing[unitID] then - return 0,0 + return 0, 0 end if crashable[unitDefID] and (damage > GetUnitHealth(unitID)) and weaponDefID ~= COM_BLAST then -- increase gravity so it crashes faster local moveTypeData = GetUnitMoveTypeData(unitID) - if moveTypeData['myGravity'] then - SetAirMoveTypeData(unitID, 'myGravity', moveTypeData['myGravity'] * gravityMult) + if moveTypeData["myGravity"] then + SetAirMoveTypeData(unitID, "myGravity", moveTypeData["myGravity"] * gravityMult) end -- make it crash crashingCount = crashingCount + 1 @@ -115,7 +116,7 @@ if gadgetHandler:IsSyncedCode() then SetUnitRulesParam(attackerID, "kills", kills + 1) end end - return damage,1 + return damage, 1 end local crashDestroyList = {} @@ -145,11 +146,7 @@ if gadgetHandler:IsSyncedCode() then crashing[unitID] = nil end end - - -else -- UNSYNCED - - +else -- UNSYNCED local GetSpectatingState = Spring.GetSpectatingState local GetUnitLosState = Spring.GetUnitLosState local GetMyAllyTeamID = Spring.GetMyAllyTeamID @@ -184,5 +181,4 @@ else -- UNSYNCED function gadget:Shutdown() gadgetHandler:RemoveSyncAction("crashingAircraft") end - end diff --git a/luarules/gadgets/unit_cursors.lua b/luarules/gadgets/unit_cursors.lua index 1bbce5a7693..a9df3798d88 100644 --- a/luarules/gadgets/unit_cursors.lua +++ b/luarules/gadgets/unit_cursors.lua @@ -6,20 +6,22 @@ function gadget:GetInfo() desc = "Assigns some UI related mouse cursors", author = "Floris", date = "August 2021", - license = "GNU GPL, v2 or later", + license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local cursors = { - 'uiresizev', - 'uiresizeh', - 'uiresized1', - 'uiresized2', - 'uimove', + "uiresizev", + "uiresizeh", + "uiresized1", + "uiresized2", + "uimove", } function gadget:Initialize() @@ -27,4 +29,3 @@ function gadget:Initialize() Spring.AssignMouseCursor(cursor, cursor, false) end end - diff --git a/luarules/gadgets/unit_custom_weapons_behaviours.lua b/luarules/gadgets/unit_custom_weapons_behaviours.lua index da5ff3f04d9..668f471f7c1 100644 --- a/luarules/gadgets/unit_custom_weapons_behaviours.lua +++ b/luarules/gadgets/unit_custom_weapons_behaviours.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Custom weapon behaviours", - desc = "Handler for special weapon behaviours", - author = "Doo", - date = "Sept 19th 2017", + name = "Custom weapon behaviours", + desc = "Handler for special weapon behaviours", + author = "Doo", + date = "Sept 19th 2017", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end @@ -53,8 +53,8 @@ local spSpawnProjectile = Spring.SpawnProjectile local gravityPerFrame = -Game.gravity / (Game.gameSpeed * Game.gameSpeed) -local targetedGround = string.byte('g') -local targetedUnit = string.byte('u') +local targetedGround = string.byte("g") +local targetedUnit = string.byte("u") -------------------------------------------------------------------------------- -- Initialization -------------------------------------------------------------- @@ -136,13 +136,7 @@ local function isProjectileInWater(projectileID) end local function equalTargets(target1, target2) - return target1 == target2 or ( - type(target1) == "table" and - type(target2) == "table" and - target1[1] == target2[1] and - target1[2] == target2[2] and - target1[3] == target2[3] - ) + return target1 == target2 or (type(target1) == "table" and type(target2) == "table" and target1[1] == target2[1] and target1[2] == target2[2] and target1[3] == target2[3]) end local readAs = { read = -1 } @@ -185,12 +179,12 @@ local getProjectileArgs do ---@class ProjectileParams local projectileParams = { - pos = { 0, 0, 0 }, - speed = { 0, 0, 0 }, + pos = { 0, 0, 0 }, + speed = { 0, 0, 0 }, gravity = gravityPerFrame, - ttl = 3000, - owner = -1, - team = -1, + ttl = 3000, + owner = -1, + team = -1, } ---@return integer weaponDefID @@ -208,7 +202,7 @@ do vel[1], vel[2], vel[3], parentSpeed = spGetProjectileVelocity(projectileID) projectile.owner = spGetProjectileOwnerID(projectileID) or -1 - projectile.team = spGetProjectileTeamID(projectileID) or spGetUnitTeam(projectile.owner) or -1 + projectile.team = spGetProjectileTeamID(projectileID) or spGetUnitTeam(projectile.owner) or -1 projectile.cegTag = params.cegtag projectile.model = params.model @@ -223,7 +217,7 @@ end weaponCustomParamKeys.cruise = { cruise_min_height = toPositiveNumber, -- Minimum ground clearance. Checked each frame, but no lookahead. cruise_max_height = toPositiveNumber, -- Maximum ground clearance. Checked each frame, but no lookahead. - lockon_dist = toPositiveNumber, -- Within this radius, disables the auto ground clearance. + lockon_dist = toPositiveNumber, -- Within this radius, disables the auto ground clearance. } local useSmoothMeshHeight = 40 -- altitude used to switch between actual and smoothed terrain normals @@ -488,11 +482,11 @@ end -- Use with a weapon with a high firing arc, or it can cause strange behaviors, e.g. when firing down. weaponCustomParamKeys.split = { - speceffect_def = toWeaponDefID, -- name of spawned weapondef (weapon type must be non-hitscan) - number = tonumber, -- count of projectiles to spawn + speceffect_def = toWeaponDefID, -- name of spawned weapondef (weapon type must be non-hitscan) + number = tonumber, -- count of projectiles to spawn splitexplosionceg = tostring, -- name of spawned CEG (use a small puff, there is no damage) - cegtag = tostring, -- as `projectileParams.cegTag` - model = tostring, -- as `projectileParams.model` + cegtag = tostring, -- as `projectileParams.cegTag` + model = tostring, -- as `projectileParams.model` } local function split(params, projectileID) @@ -531,9 +525,9 @@ end weaponCustomParamKeys.cannonwaterpen = { speceffect_def = toWeaponDefID, -- name of spawned weapondef (weapon type must be non-hitscan) - waterpenceg = tostring, -- name of spawned CEG (use a small splash, there is no damage) - cegtag = tostring, -- as `projectileParams.cegTag` - model = tostring, -- as `projectileParams.model` + waterpenceg = tostring, -- name of spawned CEG (use a small splash, there is no damage) + cegtag = tostring, -- as `projectileParams.cegTag` + model = tostring, -- as `projectileParams.model` } local function cannonWaterPen(params, projectileID) diff --git a/luarules/gadgets/unit_custom_weapons_cluster.lua b/luarules/gadgets/unit_custom_weapons_cluster.lua index f75e14bb6f2..edc85106652 100644 --- a/luarules/gadgets/unit_custom_weapons_cluster.lua +++ b/luarules/gadgets/unit_custom_weapons_cluster.lua @@ -2,33 +2,35 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Cluster Munitions', - desc = 'Projectiles split and scatter on impact.', - author = 'efrec', - version = '1.1', - date = '2024-06-07', - license = 'GNU GPL, v2 or later', - layer = 10, -- before fx_watersplash; Explosion is reverse iterated - enabled = true + name = "Cluster Munitions", + desc = "Projectiles split and scatter on impact.", + author = "efrec", + version = "1.1", + date = "2024-06-07", + license = "GNU GPL, v2 or later", + layer = 10, -- before fx_watersplash; Explosion is reverse iterated + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return false end +if not gadgetHandler:IsSyncedCode() then + return false +end -------------------------------------------------------------------------------- -- Configuration --------------------------------------------------------------- -- Default settings ------------------------------------------------------------ -local defaultSpawnTtl = 5 -- detonate projectiles after time = ttl, by default +local defaultSpawnTtl = 5 -- detonate projectiles after time = ttl, by default -- General settings ------------------------------------------------------------ -local minSpawnNumber = 3 -- minimum number of spawned projectiles -local maxSpawnNumber = 24 -- protect game performance against stupid ideas -local minUnitBounces = "armpw" -- smallest unit (name) that "bounces" projectiles at all -local minBulkReflect = 800 -- smallest unit bulk that "reflects" as if terrain -local waterDepthCoef = 0.1 -- reduce "separation" from ground in water by a multiple +local minSpawnNumber = 3 -- minimum number of spawned projectiles +local maxSpawnNumber = 24 -- protect game performance against stupid ideas +local minUnitBounces = "armpw" -- smallest unit (name) that "bounces" projectiles at all +local minBulkReflect = 800 -- smallest unit bulk that "reflects" as if terrain +local waterDepthCoef = 0.1 -- reduce "separation" from ground in water by a multiple -- CustomParams setup ---------------------------------------------------------- -- @@ -51,30 +53,30 @@ local waterDepthCoef = 0.1 -- reduce "separation" from ground in water by local DirectionsUtil = VFS.Include("LuaRules/Gadgets/Include/DirectionsUtil.lua") local clamp = math.clamp -local max = math.max -local min = math.min -local rand = math.random -local diag = math.diag -local sqrt = math.sqrt -local cos = math.cos -local sin = math.sin +local max = math.max +local min = math.min +local rand = math.random +local diag = math.diag +local sqrt = math.sqrt +local cos = math.cos +local sin = math.sin local atan2 = math.atan2 -local spGetGroundHeight = Spring.GetGroundHeight -local spGetGroundNormal = Spring.GetGroundNormal -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitRadius = Spring.GetUnitRadius -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitsInSphere = Spring.GetUnitsInSphere -local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetGroundHeight = Spring.GetGroundHeight +local spGetGroundNormal = Spring.GetGroundNormal +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitsInSphere = Spring.GetUnitsInSphere +local spGetProjectileTeamID = Spring.GetProjectileTeamID local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID -local spSpawnProjectile = Spring.SpawnProjectile -local spDeleteProjectile = Spring.DeleteProjectile +local spGetTeamAllyTeamID = Spring.GetTeamAllyTeamID +local spSpawnProjectile = Spring.SpawnProjectile +local spDeleteProjectile = Spring.DeleteProjectile -local gameSpeed = Game.gameSpeed +local gameSpeed = Game.gameSpeed local mapGravity = Game.gravity / (gameSpeed * gameSpeed) * -1 local addShieldDamage, damageToShields, getShieldPosition, getBlockingShieldUnits, isInShield -- see unit_shield_behaviour @@ -106,7 +108,7 @@ for unitDefID, unitDef in ipairs(UnitDefs) do local clusterCount = tonumber(weaponDef.customParams.cluster_number) if clusterCount < minSpawnNumber or clusterCount > maxSpawnNumber then - Spring.Log(gadget:GetInfo().name, LOG.WARNING, weaponDef.name .. ': cluster_count of ' .. clusterCount .. ', clamping to ' .. minSpawnNumber .. '-' .. maxSpawnNumber) + Spring.Log(gadget:GetInfo().name, LOG.WARNING, weaponDef.name .. ": cluster_count of " .. clusterCount .. ", clamping to " .. minSpawnNumber .. "-" .. maxSpawnNumber) clusterCount = clamp(clusterCount, minSpawnNumber, maxSpawnNumber) end @@ -121,16 +123,16 @@ for unitDefID, unitDef in ipairs(UnitDefs) do end clusterWeaponDefs[weaponDefID] = { - number = clusterCount, - weaponID = clusterDef.id, + number = clusterCount, + weaponID = clusterDef.id, weaponSpeed = clusterSpeed, - weaponTtl = clusterDef.flighttime or defaultSpawnTtl, + weaponTtl = clusterDef.flighttime or defaultSpawnTtl, } else - Spring.Log(gadget:GetInfo().name, LOG.ERROR, 'Invalid weapon spawn type: ' .. clusterDef.type) + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "Invalid weapon spawn type: " .. clusterDef.type) end else - Spring.Log(gadget:GetInfo().name, LOG.ERROR, 'Could not find weapon def matching cluster_def: ' .. clusterDefName) + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "Could not find weapon def matching cluster_def: " .. clusterDefName) end end end @@ -143,7 +145,7 @@ for weaponDefID, weaponData in pairs(clusterWeaponDefs) do end end for weaponDefID in pairs(removeIDs) do - Spring.Log(gadget:GetInfo().name, LOG.ERROR, 'Preventing nested explosions: ' .. WeaponDefs[weaponDefID].name) + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "Preventing nested explosions: " .. WeaponDefs[weaponDefID].name) clusterWeaponDefs[weaponDefID] = nil end @@ -170,7 +172,7 @@ local function getUnitVolume(unitDef) end local useCrushingMass = { - wall = true, + wall = true, indestructable = true, } @@ -229,24 +231,26 @@ for unitDefID in ipairs(UnitDefs) do end end -local spawnCache = { - pos = { 0, 0, 0 }, - speed = { 0, 0, 0 }, - owner = -1, - team = -1, - ttl = defaultSpawnTtl, +local spawnCache = { + pos = { 0, 0, 0 }, + speed = { 0, 0, 0 }, + owner = -1, + team = -1, + ttl = defaultSpawnTtl, gravity = mapGravity, } local directions = DirectionsUtil.Directions local maxDataNum = 2 for _, data in pairs(clusterWeaponDefs) do - if data.number > maxDataNum then maxDataNum = data.number end + if data.number > maxDataNum then + maxDataNum = data.number + end end DirectionsUtil.ProvisionDirections(maxDataNum) -- When not using the engine's shield bounce, clusters add their own deflection. -local customShieldDeflect = table.contains({"unchanged", "absorbeverything"}, Spring.GetModOptions().experimentalshields) +local customShieldDeflect = table.contains({ "unchanged", "absorbeverything" }, Spring.GetModOptions().experimentalshields) local projectileHitShield = {} -- Metatable for lookup on projectiles, rather than on our weaponDefIDs. @@ -256,7 +260,7 @@ local projectiles = setmetatable({ }, { __index = function(tbl, key) return clusterWeaponDefs[spGetProjectileDefID(key)] - end + end, }) -------------------------------------------------------------------------------- @@ -325,7 +329,7 @@ local function getSurfaceDeflection(x, y, z) for _, unitID in ipairs(unitsNearby) do bounce = unitBulks[spGetUnitDefID(unitID)] if bounce then - _,_,_,unitX,unitY,unitZ = spGetUnitPosition(unitID, true) + _, _, _, unitX, unitY, unitZ = spGetUnitPosition(unitID, true) radius = spGetUnitRadius(unitID) if unitY + radius > 0 then unitX, unitY, unitZ = x - unitX, y - unitY, z - unitZ diff --git a/luarules/gadgets/unit_custom_weapons_overpen.lua b/luarules/gadgets/unit_custom_weapons_overpen.lua index 6ef0d024aae..f3fd5590736 100644 --- a/luarules/gadgets/unit_custom_weapons_overpen.lua +++ b/luarules/gadgets/unit_custom_weapons_overpen.lua @@ -2,19 +2,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Penetrator Weapons', - desc = 'Customizes weapons to overpenetrate targets that they destroy.', - author = 'efrec', - version = '1.0', - date = '2024-10', - license = 'GNU GPL, v2 or later', - layer = 0, + name = "Penetrator Weapons", + desc = "Customizes weapons to overpenetrate targets that they destroy.", + author = "efrec", + version = "1.0", + date = "2024-10", + license = "GNU GPL, v2 or later", + layer = 0, enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return false end - +if not gadgetHandler:IsSyncedCode() then + return false +end -------------------------------------------------------------------------------- -- Configuration --------------------------------------------------------------- @@ -25,30 +26,30 @@ local damageThreshold = 0.1 -- Minimum damage% vs. max health that will penetrat local penaltyDefault = 0.01 -- Additional damage% loss per hit. -local falloffPerType = { -- Whether the projectile loses damage per hit. - DGun = false , - Cannon = true , - LaserCannon = true , - BeamLaser = true , - LightningCannon = false , -- Use customparams.spark_forkdamage instead. - Flame = false , - MissileLauncher = true , - StarburstLauncher = true , - TorpedoLauncher = true , - AircraftBomb = true , +local falloffPerType = { -- Whether the projectile loses damage per hit. + DGun = false, + Cannon = true, + LaserCannon = true, + BeamLaser = true, + LightningCannon = false, -- Use customparams.spark_forkdamage instead. + Flame = false, + MissileLauncher = true, + StarburstLauncher = true, + TorpedoLauncher = true, + AircraftBomb = true, } local slowingPerType = { -- Whether the projectile loses velocity, as well. - DGun = false , - Cannon = true , - LaserCannon = false , - BeamLaser = false , - LightningCannon = false , -- Use customparams.spark_forkdamage instead. - Flame = false , - MissileLauncher = true , - StarburstLauncher = true , - TorpedoLauncher = true , - AircraftBomb = true , + DGun = false, + Cannon = true, + LaserCannon = false, + BeamLaser = false, + LightningCannon = false, -- Use customparams.spark_forkdamage instead. + Flame = false, + MissileLauncher = true, + StarburstLauncher = true, + TorpedoLauncher = true, + AircraftBomb = true, } -------------------------------------------------------------------------------- @@ -65,33 +66,33 @@ local slowingPerType = { -- Whether the projectile loses velocity, as well. -------------------------------------------------------------------------------- -- Locals ---------------------------------------------------------------------- -local abs = math.abs -local max = math.max -local min = math.min +local abs = math.abs +local max = math.max +local min = math.min local sqrt = math.sqrt -local spGetFeatureHealth = Spring.GetFeatureHealth -local spGetFeaturePosition = Spring.GetFeaturePosition -local spGetFeatureRadius = Spring.GetFeatureRadius -local spGetGroundHeight = Spring.GetGroundHeight +local spGetFeatureHealth = Spring.GetFeatureHealth +local spGetFeaturePosition = Spring.GetFeaturePosition +local spGetFeatureRadius = Spring.GetFeatureRadius +local spGetGroundHeight = Spring.GetGroundHeight local spGetProjectileDirection = Spring.GetProjectileDirection -local spGetProjectilePosition = Spring.GetProjectilePosition -local spGetProjectileVelocity = Spring.GetProjectileVelocity -local spGetUnitHealth = Spring.GetUnitHealth -local spGetUnitIsDead = Spring.GetUnitIsDead -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitRadius = Spring.GetUnitRadius -local spGetWaterLevel = Spring.GetWaterLevel - -local spSetProjectilePosition = Spring.SetProjectilePosition -local spSetProjectileVelocity = Spring.SetProjectileVelocity -local spSetProjectileMoveCtrl = Spring.SetProjectileMoveControl - -local spAddUnitDamage = Spring.AddUnitDamage -local spAddFeatureDamage = Spring.AddFeatureDamage -local spDeleteProjectile = Spring.DeleteProjectile -local spValidFeatureID = Spring.ValidFeatureID -local spValidUnitID = Spring.ValidUnitID +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitIsDead = Spring.GetUnitIsDead +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetWaterLevel = Spring.GetWaterLevel + +local spSetProjectilePosition = Spring.SetProjectilePosition +local spSetProjectileVelocity = Spring.SetProjectileVelocity +local spSetProjectileMoveCtrl = Spring.SetProjectileMoveControl + +local spAddUnitDamage = Spring.AddUnitDamage +local spAddFeatureDamage = Spring.AddFeatureDamage +local spDeleteProjectile = Spring.DeleteProjectile +local spValidFeatureID = Spring.ValidFeatureID +local spValidUnitID = Spring.ValidUnitID local armorDefault = Game.armorTypes.default local armorShields = Game.armorTypes.shields @@ -140,11 +141,11 @@ local function loadPenetratorWeaponDefs() params[i] = damages[i] end - params.falloff = tobool(custom.overpenetrate_falloff == nil and falloffPerType[weaponDef.type] or custom.overpenetrate_falloff) - params.slowing = tobool(custom.overpenetrate_slowing == nil and slowingPerType[weaponDef.type] or custom.overpenetrate_slowing) - params.penalty = max(0, tonumber(custom.overpenetrate_penalty or penaltyDefault)) + params.falloff = tobool(custom.overpenetrate_falloff == nil and falloffPerType[weaponDef.type] or custom.overpenetrate_falloff) + params.slowing = tobool(custom.overpenetrate_slowing == nil and slowingPerType[weaponDef.type] or custom.overpenetrate_slowing) + params.penalty = max(0, tonumber(custom.overpenetrate_penalty or penaltyDefault)) params.weaponID = weaponDefID - params.impulse = weaponDef.damages.impulseFactor + params.impulse = weaponDef.damages.impulseFactor if params.slowing and not params.falloff then params.slowing = false @@ -221,8 +222,7 @@ local function getCollisionPosition(projectileID, targetID, isUnit) return mx + ax, my + ay, mz + az -- ray-sphere approach else local separation = sqrt(radiusSq - a) - return - mx - ax - dx * separation, -- ray-sphere intersection + return mx - ax - dx * separation, -- ray-sphere intersection my - ay - dy * separation, mz - az - dz * separation end @@ -234,14 +234,14 @@ local function addPenetratorProjectile(projectileID, ownerID, params) projectiles[projectileID] = { collisions = {}, damageLeft = 1, - ownerID = ownerID, - params = params, - posX = px, - posY = py, - posZ = pz, - dirX = dx, - dirY = dy, - dirZ = dz, + ownerID = ownerID, + params = params, + posX = px, + posY = py, + posZ = pz, + dirX = dx, + dirY = dy, + dirZ = dz, } end @@ -254,13 +254,13 @@ local function addPenetratorCollision(targetID, isUnit, armorType, damage, proje end projectileHits[projectileID] = penetrator local collisions = penetrator.collisions - collisions[#collisions+1] = { - targetID = targetID, - isUnit = isUnit, - health = max(health, 1), + collisions[#collisions + 1] = { + targetID = targetID, + isUnit = isUnit, + health = max(health, 1), healthMax = healthMax, armorType = armorType, - damage = damage, + damage = damage, } end @@ -308,16 +308,7 @@ local function hitUnit(weapon, penetrator, damageLeft, collision, targetID) local damageDealt, damageBase = damageEngine * damageLeft, min(damageEngine, damageArmor) * damageLeft local impulse = damageBase * weapon.impulse * falloffRatio(damageLeft, 1) -- inverse ratio - spAddUnitDamage( - targetID, - damageDealt, - 0, - penetrator.ownerID, - weapon.weaponID, - penetrator.dirX * impulse, - penetrator.dirY * impulse, - penetrator.dirZ * impulse - ) + spAddUnitDamage(targetID, damageDealt, 0, penetrator.ownerID, weapon.weaponID, penetrator.dirX * impulse, penetrator.dirY * impulse, penetrator.dirZ * impulse) if setVelocityControl then setVelocityControl(targetID, true) end @@ -411,7 +402,8 @@ local function executeCollisions(projectileID, penetrator) collide = spGetUnitIsDead(targetID) == false and hitUnit elseif collision.shieldID then -- A dead shield unit's shield lasts until the end of the frame. - collide = --[[spGetUnitIsDead(targetID) == false and]] hitShield + collide = --[[spGetUnitIsDead(targetID) == false and]] + hitShield else collide = spValidFeatureID(targetID) and hitFeature end @@ -474,7 +466,7 @@ function gadget:Explosion(weaponDefID, px, py, pz, attackerID, projectileID) local penetrator = projectiles[projectileID] projectileHits[projectileID] = penetrator local collisions = penetrator.collisions - collisions[#collisions+1] = { + collisions[#collisions + 1] = { hitX = px, hitY = py, hitZ = pz, @@ -516,15 +508,15 @@ local function shieldPreDamaged(projectileID, attackerID, shieldWeaponIndex, shi local _, power = getUnitShieldState(shieldUnitID, shieldWeaponIndex) local collisions = penetrator.collisions - collisions[#collisions+1] = { - targetID = shieldUnitID, - shieldID = shieldWeaponIndex, + collisions[#collisions + 1] = { + targetID = shieldUnitID, + shieldID = shieldWeaponIndex, armorType = armorShields, healthMax = power, - damage = damageToShields[penetrator.params.weaponID], - hitX = hitX, - hitY = hitY, - hitZ = hitZ, + damage = damageToShields[penetrator.params.weaponID], + hitX = hitX, + hitY = hitY, + hitZ = hitZ, } projectileHits[projectileID] = penetrator diff --git a/luarules/gadgets/unit_custommaxranges.lua b/luarules/gadgets/unit_custommaxranges.lua index c0df164850f..3e9ad7cfaab 100644 --- a/luarules/gadgets/unit_custommaxranges.lua +++ b/luarules/gadgets/unit_custommaxranges.lua @@ -9,15 +9,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Controls Unit's maxrange", - desc = "Fixes some aa/ground units not closing in on target when given attack order", - author = "Doo", - date = "06 dec 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Controls Unit's maxrange", + desc = "Fixes some aa/ground units not closing in on target when given attack order", + author = "Doo", + date = "06 dec 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end ------------------------------------------------------------------------------------- @@ -29,9 +29,9 @@ local spSetUnitMaxRange = Spring.SetUnitMaxRange local unitMaxRange = {} for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.customParams.maxrange then - unitMaxRange[unitDefID] = tonumber(unitDef.customParams.maxrange) - end + if unitDef.customParams.maxrange then + unitMaxRange[unitDefID] = tonumber(unitDef.customParams.maxrange) + end end function gadget:Initialize() @@ -46,4 +46,4 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) if unitMaxRange[unitDefID] then spSetUnitMaxRange(unitID, unitMaxRange[unitDefID]) end -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_dead.lua b/luarules/gadgets/unit_dead.lua index 16a50275c28..337587fffb8 100644 --- a/luarules/gadgets/unit_dead.lua +++ b/luarules/gadgets/unit_dead.lua @@ -2,11 +2,11 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Dead Unit", - desc = "Remove behaviours from dead units", - license = "GNU GPL, v2 or later", - layer = -1999999, - enabled = true, + name = "Dead Unit", + desc = "Remove behaviours from dead units", + license = "GNU GPL, v2 or later", + layer = -1999999, + enabled = true, } end diff --git a/luarules/gadgets/unit_death_animations.lua b/luarules/gadgets/unit_death_animations.lua index 2ddc0f2e9c1..3ca6836f210 100644 --- a/luarules/gadgets/unit_death_animations.lua +++ b/luarules/gadgets/unit_death_animations.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Death Animations", - desc = "Prevent moving of Dying units", - author = "Beherith", - date = "2020", - license = "GNU GPL, v2 or later", - layer = 1000, - enabled = true, + name = "Death Animations", + desc = "Prevent moving of Dying units", + author = "Beherith", + date = "2020", + license = "GNU GPL, v2 or later", + layer = 1000, + enabled = true, } end @@ -43,8 +43,8 @@ local units = { corck = true, } local unitsCopy = tableCopy(units) -for name,v in pairs(unitsCopy) do - units[name..'_scav'] = true +for name, v in pairs(unitsCopy) do + units[name .. "_scav"] = true end local hasDeathAnim = {} for udid, ud in pairs(UnitDefs) do @@ -67,16 +67,16 @@ end function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) if hasDeathAnim[unitDefID] then - spSetUnitBlocking(unitID, false) -- non blocking while dying + spSetUnitBlocking(unitID, false) -- non blocking while dying spSetUnitIconDraw(unitID, false) -- dont draw icons spGiveOrderToUnit(unitID, CMD_STOP, 0, 0) spMoveCtrlEnable(unitID) spMoveCtrlSetVelocity(unitID, 0, 0, 0) - dyingUnits[unitID] = true + dyingUnits[unitID] = true end end - -- do not allow dying units to be moved +-- do not allow dying units to be moved function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) return dyingUnits[unitID] and false or true end diff --git a/luarules/gadgets/unit_defend_firestate.lua b/luarules/gadgets/unit_defend_firestate.lua index 9014e729f7a..a554b5149da 100644 --- a/luarules/gadgets/unit_defend_firestate.lua +++ b/luarules/gadgets/unit_defend_firestate.lua @@ -13,7 +13,7 @@ function gadget:GetInfo() date = "2026.06.28", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end diff --git a/luarules/gadgets/unit_dgun_behaviour.lua b/luarules/gadgets/unit_dgun_behaviour.lua index f21bdb44ca3..e73cdce15a8 100644 --- a/luarules/gadgets/unit_dgun_behaviour.lua +++ b/luarules/gadgets/unit_dgun_behaviour.lua @@ -6,7 +6,7 @@ function gadget:GetInfo() desc = "D-Gun projectiles hug ground, volumetric damage, deterministic damage against Commanders, override interactions with shields", author = "Anarchid, Sprung, SethDGamre", layer = 0, - enabled = true + enabled = true, } end @@ -63,7 +63,7 @@ end for weaponDefID = 0, #WeaponDefs do local weaponDef = WeaponDefs[weaponDefID] - if weaponDef.type == 'DGun' then + if weaponDef.type == "DGun" then Script.SetWatchProjectile(weaponDefID, true) dgunDef[weaponDefID] = weaponDef dgunDef[weaponDefID].ttl = generateWeaponTtlFunction(weaponDef) @@ -160,8 +160,7 @@ function gadget:GameFramePost(frame) end end -function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, - attackerDefID, attackerTeam) +function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if dgunDef[weaponDefID] and isCommander[attackerDefID] and (isCommander[unitDefID] or isDecoyCommander[unitDefID]) then if isDecoyCommander[unitDefID] then return dgunDef[weaponDefID].damages[0] diff --git a/luarules/gadgets/unit_dgun_cmdtype_fix.lua b/luarules/gadgets/unit_dgun_cmdtype_fix.lua index f4a8460779b..970d10eb1be 100644 --- a/luarules/gadgets/unit_dgun_cmdtype_fix.lua +++ b/luarules/gadgets/unit_dgun_cmdtype_fix.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'DGun CmdType Fix', - desc = 'Fixed DGun CmdType so it can target units', - author = 'Niobium', - date = 'April 2011', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true + name = "DGun CmdType Fix", + desc = "Fixed DGun CmdType so it can target units", + author = "Niobium", + date = "April 2011", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -31,14 +31,14 @@ local CMD_DGUN = CMD.MANUALFIRE local CMDTYPE_ICON_UNIT_OR_MAP = CMDTYPE.ICON_UNIT_OR_MAP function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if canDGun[unitDefID] then - local cmdIdx = spFindUnitCmdDesc(unitID, CMD_DGUN) - if cmdIdx then - local cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] - if cmdDesc then - cmdDesc.type = CMDTYPE_ICON_UNIT_OR_MAP - spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) - end - end - end + if canDGun[unitDefID] then + local cmdIdx = spFindUnitCmdDesc(unitID, CMD_DGUN) + if cmdIdx then + local cmdDesc = spGetUnitCmdDescs(unitID, cmdIdx, cmdIdx)[1] + if cmdDesc then + cmdDesc.type = CMDTYPE_ICON_UNIT_OR_MAP + spEditUnitCmdDesc(unitID, cmdIdx, cmdDesc) + end + end + end end diff --git a/luarules/gadgets/unit_direct_control.lua b/luarules/gadgets/unit_direct_control.lua index 0ff2d361ad1..7bc44379070 100644 --- a/luarules/gadgets/unit_direct_control.lua +++ b/luarules/gadgets/unit_direct_control.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "DirectControl", - desc = "Block direct control (FPS) for units", - author = "trepan", - date = "Jul 10, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "DirectControl", + desc = "Block direct control (FPS) for units", + author = "trepan", + date = "Jul 10, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -- Direct control ("fps mode") is disabled for players because: @@ -17,10 +17,10 @@ end -- It is buggy and unpolished local enabled = Spring.Utilities.IsDevMode() -if (not gadgetHandler:IsSyncedCode()) then - return false +if not gadgetHandler:IsSyncedCode() then + return false end function gadget:AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID) - return enabled + return enabled end diff --git a/luarules/gadgets/unit_disallow_underwater_load.lua b/luarules/gadgets/unit_disallow_underwater_load.lua index d9c7466024f..463e17d612a 100644 --- a/luarules/gadgets/unit_disallow_underwater_load.lua +++ b/luarules/gadgets/unit_disallow_underwater_load.lua @@ -1,4 +1,3 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() @@ -15,7 +14,7 @@ end if gadgetHandler:IsSyncedCode() then function gadget:AllowUnitTransport(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam) - local _,y,_ = Spring.GetUnitPosition(transporteeID) + local _, y, _ = Spring.GetUnitPosition(transporteeID) local height = Spring.GetUnitHeight(transporteeID) if not height or y + height < 0 then return false diff --git a/luarules/gadgets/unit_dragons_disguise.lua b/luarules/gadgets/unit_dragons_disguise.lua index e43cdfc9f8f..d911b3b5793 100644 --- a/luarules/gadgets/unit_dragons_disguise.lua +++ b/luarules/gadgets/unit_dragons_disguise.lua @@ -1,19 +1,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Dragons Disguise", - desc = "Sets Dragons claw & dragons maw to Neutral when closed", - author = "TheFatController", - date = "25 Nov 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Dragons Disguise", + desc = "Sets Dragons claw & dragons maw to Neutral when closed", + author = "TheFatController", + date = "25 Nov 2008", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local GetUnitCOBValue = Spring.GetUnitCOBValue @@ -21,7 +21,7 @@ local SetUnitNeutral = Spring.SetUnitNeutral local ValidUnitID = Spring.ValidUnitID local neutralUnits = {} local armourTurrets = {} -for udid,ud in ipairs(UnitDefs) do +for udid, ud in ipairs(UnitDefs) do if ud.customParams then if ud.customParams.neutral_when_closed then armourTurrets[udid] = true @@ -41,40 +41,39 @@ function gadget:Initialize() end function gadget:GameFrame(n) - if (n >= timeCounter) then - timeCounter = (n + UPDATE) - for unitID,neutral in pairs(neutralUnits) do - if not ValidUnitID(unitID) then - neutralUnits[unitID] = nil - else - local cobValue = GetUnitCOBValue(unitID, 20) - if cobValue then - local armoured = (cobValue > 0) - if neutral and (not armoured) then - SetUnitNeutral(unitID, false) - neutralUnits[unitID] = false - elseif (not neutral) and armoured then - SetUnitNeutral(unitID, true) - neutralUnits[unitID] = true - end - end - end - end - end + if n >= timeCounter then + timeCounter = (n + UPDATE) + for unitID, neutral in pairs(neutralUnits) do + if not ValidUnitID(unitID) then + neutralUnits[unitID] = nil + else + local cobValue = GetUnitCOBValue(unitID, 20) + if cobValue then + local armoured = (cobValue > 0) + if neutral and not armoured then + SetUnitNeutral(unitID, false) + neutralUnits[unitID] = false + elseif (not neutral) and armoured then + SetUnitNeutral(unitID, true) + neutralUnits[unitID] = true + end + end + end + end + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - neutralUnits[unitID] = nil + neutralUnits[unitID] = nil end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - if armourTurrets[unitDefID] then - if GetUnitCOBValue(unitID, 20) == 1 then - SetUnitNeutral(unitID, true) - neutralUnits[unitID] = true - else - neutralUnits[unitID] = false - end - end + if armourTurrets[unitDefID] then + if GetUnitCOBValue(unitID, 20) == 1 then + SetUnitNeutral(unitID, true) + neutralUnits[unitID] = true + else + neutralUnits[unitID] = false + end + end end - diff --git a/luarules/gadgets/unit_dynamic_collision_volume.lua b/luarules/gadgets/unit_dynamic_collision_volume.lua index fc638e2b335..9e92de4cbc2 100644 --- a/luarules/gadgets/unit_dynamic_collision_volume.lua +++ b/luarules/gadgets/unit_dynamic_collision_volume.lua @@ -2,20 +2,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Dynamic collision volume & Hitsphere Scaledown", - desc = "Adjusts collision volume for pop-up style units & Reduces the diameter of default sphere collision volume for 3DO models", - author = "Deadnight Warrior", - date = "Nov 26, 2011", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Dynamic collision volume & Hitsphere Scaledown", + desc = "Adjusts collision volume for pop-up style units & Reduces the diameter of default sphere collision volume for 3DO models", + author = "Deadnight Warrior", + date = "Nov 26, 2011", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end if gadgetHandler:IsSyncedCode() then - -- Pop-up style unit and per piece collision volume definitions - local popupUnits = {} --list of pop-up style units + local popupUnits = {} --list of pop-up style units local unitCollisionVolume, pieceCollisionVolume, dynamicPieceCollisionVolume -- Localization and speedups @@ -37,41 +36,49 @@ if gadgetHandler:IsSyncedCode() then local spArmor = Spring.GetUnitArmored local pairs = pairs local pieceIndexStr = {} - for i = 0, 99 do pieceIndexStr[i] = tostring(i) end - - local unitDefMidAndAimPos = {} -- this is a table read from customparams mapping unitDefID to - local featureDefMidAndAimPos = {} -- this is a table read from customparams mapping unitDefID to - -- {unitDefID = {aimx, aimz, aimy, midx, midy, midz}} + for i = 0, 99 do + pieceIndexStr[i] = tostring(i) + end + + local unitDefMidAndAimPos = {} -- this is a table read from customparams mapping unitDefID to + local featureDefMidAndAimPos = {} -- this is a table read from customparams mapping unitDefID to + -- {unitDefID = {aimx, aimz, aimy, midx, midy, midz}} local function parseMidAndAimPos(defID, def, midAimPosTable, prefix) if def.customParams then - if def.customParams['unit'..prefix..'pos'] then - if midAimPosTable[defID] == nil then + if def.customParams["unit" .. prefix .. "pos"] then + if midAimPosTable[defID] == nil then midAimPosTable[defID] = {} - end - local midaimpossplit = string.split(def.customParams['unit'..prefix..'pos'], " ") - if midaimpossplit[1] and tonumber(midaimpossplit[1]) then midAimPosTable[defID][prefix..'x'] = tonumber(midaimpossplit[1]) end - if midaimpossplit[2] and tonumber(midaimpossplit[2]) then midAimPosTable[defID][prefix..'y'] = tonumber(midaimpossplit[2]) end - if midaimpossplit[3] and tonumber(midaimpossplit[3]) then midAimPosTable[defID][prefix..'z'] = tonumber(midaimpossplit[3]) end + end + local midaimpossplit = string.split(def.customParams["unit" .. prefix .. "pos"], " ") + if midaimpossplit[1] and tonumber(midaimpossplit[1]) then + midAimPosTable[defID][prefix .. "x"] = tonumber(midaimpossplit[1]) + end + if midaimpossplit[2] and tonumber(midaimpossplit[2]) then + midAimPosTable[defID][prefix .. "y"] = tonumber(midaimpossplit[2]) + end + if midaimpossplit[3] and tonumber(midaimpossplit[3]) then + midAimPosTable[defID][prefix .. "z"] = tonumber(midaimpossplit[3]) + end --Spring.Echo("Setting", 'unit'..prefix..'pos','to', midaimpossplit[1],midaimpossplit[2],midaimpossplit[3]) end end end - + local is3doFeature = {} for featureDefID, def in pairs(FeatureDefs) do - parseMidAndAimPos(featureDefID, def, featureDefMidAndAimPos, 'aim') - parseMidAndAimPos(featureDefID, def, featureDefMidAndAimPos, 'mid') + parseMidAndAimPos(featureDefID, def, featureDefMidAndAimPos, "aim") + parseMidAndAimPos(featureDefID, def, featureDefMidAndAimPos, "mid") if def.modelpath:lower():find(".3do") then is3doFeature[featureDefID] = true end end local unitName = {} - local unitModeltype ={} + local unitModeltype = {} local canFly = {} for unitDefID, def in pairs(UnitDefs) do - parseMidAndAimPos(unitDefID, def, unitDefMidAndAimPos, 'aim') - parseMidAndAimPos(unitDefID, def, unitDefMidAndAimPos, 'mid') + parseMidAndAimPos(unitDefID, def, unitDefMidAndAimPos, "aim") + parseMidAndAimPos(unitDefID, def, unitDefMidAndAimPos, "mid") unitName[unitDefID] = def.name unitModeltype[unitDefID] = def.modeltype if def.canFly then @@ -86,36 +93,36 @@ if gadgetHandler:IsSyncedCode() then unitCollisionVolume, pieceCollisionVolume, dynamicPieceCollisionVolume = include("LuaRules/Configs/CollisionVolumes.lua") local allFeatures = Spring.GetAllFeatures() - for i=1,#allFeatures do + for i = 1, #allFeatures do local featID = allFeatures[i] local modelpath = FeatureDefs[Spring.GetFeatureDefID(featID)].modelpath local featureModel = modelpath:lower() if featureModel:find(".3do") then local rs, hs - if (spGetFeatureRadius(featID)>47) then + if spGetFeatureRadius(featID) > 47 then rs, hs = 0.68, 0.60 else rs, hs = 0.75, 0.67 end local xs, ys, zs, xo, yo, zo, vtype, htype, axis, _ = spGetFeatureCollisionData(featID) - if (vtype>=3 and xs==ys and ys==zs) then - spSetFeatureCollisionData(featID, xs*rs, ys*hs, zs*rs, xo, yo-ys*0.1323529*rs, zo, vtype, htype, axis) + if vtype >= 3 and xs == ys and ys == zs then + spSetFeatureCollisionData(featID, xs * rs, ys * hs, zs * rs, xo, yo - ys * 0.1323529 * rs, zo, vtype, htype, axis) end - spSetFeatureRadiusAndHeight(featID, spGetFeatureRadius(featID)*rs, spGetFeatureHeight(featID)*hs) + spSetFeatureRadiusAndHeight(featID, spGetFeatureRadius(featID) * rs, spGetFeatureHeight(featID) * hs) elseif featureModel:find(".s3o") then local xs, ys, zs, xo, yo, zo, vtype, htype, axis, _ = spGetFeatureCollisionData(featID) - if (vtype>=3 and xs==ys and ys==zs) then - spSetFeatureCollisionData(featID, xs, ys*0.75, zs, xo, yo-ys*0.09, zo, vtype, htype, axis) + if vtype >= 3 and xs == ys and ys == zs then + spSetFeatureCollisionData(featID, xs, ys * 0.75, zs, xo, yo - ys * 0.09, zo, vtype, htype, axis) end end end local allUnits = Spring.GetAllUnits() - for i=1,#allUnits do + for i = 1, #allUnits do local unitID = allUnits[i] gadget:UnitCreated(unitID, spGetUnitDefID(unitID)) --gadget:UnitFinished(unitID, spGetUnitDefID(unitID)) end - for i=1,#allFeatures do + for i = 1, #allFeatures do gadget:FeatureCreated(allFeatures[i]) end end @@ -125,20 +132,22 @@ if gadgetHandler:IsSyncedCode() then --also handles per piece collision volume definitions --also makes sure subs are underwater function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if unitDefMidAndAimPos[unitDefID] then + if unitDefMidAndAimPos[unitDefID] then local midAndAimPos = unitDefMidAndAimPos[unitDefID] - Spring.SetUnitMidAndAimPos(unitID, - midAndAimPos['midx'] or 0, - midAndAimPos['midy'] or 0, - midAndAimPos['midz'] or 0, - (midAndAimPos['aimx'] or 0) * -1, -- because engine is bugged - midAndAimPos['aimy'] or 0, - midAndAimPos['aimz'] or 0, -- relative? - true) + Spring.SetUnitMidAndAimPos( + unitID, + midAndAimPos["midx"] or 0, + midAndAimPos["midy"] or 0, + midAndAimPos["midz"] or 0, + (midAndAimPos["aimx"] or 0) * -1, -- because engine is bugged + midAndAimPos["aimy"] or 0, + midAndAimPos["aimz"] or 0, -- relative? + true + ) end if pieceCollisionVolume[unitName[unitDefID]] then local t = pieceCollisionVolume[unitName[unitDefID]] - for pieceIndex=0, #spGetPieceList(unitID)-1 do + for pieceIndex = 0, #spGetPieceList(unitID) - 1 do local p = t[tostring(pieceIndex)] if p then spSetPieceCollisionData(unitID, pieceIndex + 1, true, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]) @@ -147,12 +156,12 @@ if gadgetHandler:IsSyncedCode() then end if t.offsets then p = t.offsets - spSetUnitMidAndAimPos(unitID, 0, spGetUnitHeight(unitID)/2, 0, p[1], p[2], p[3],true) + spSetUnitMidAndAimPos(unitID, 0, spGetUnitHeight(unitID) / 2, 0, p[1], p[2], p[3], true) end end elseif dynamicPieceCollisionVolume[unitName[unitDefID]] then local t = dynamicPieceCollisionVolume[unitName[unitDefID]].on - for pieceIndex=0, #spGetPieceList(unitID)-1 do + for pieceIndex = 0, #spGetPieceList(unitID) - 1 do local p = t[tostring(pieceIndex)] if p then spSetPieceCollisionData(unitID, pieceIndex + 1, true, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]) @@ -163,7 +172,7 @@ if gadgetHandler:IsSyncedCode() then elseif unitModeltype[unitDefID] == "3do" then local rs, hs, ws local r = spGetUnitRadius(unitID) - if r>47 and not canFly[unitDefID] then + if r > 47 and not canFly[unitDefID] then rs, hs, ws = 0.68, 0.68, 0.68 elseif not canFly[unitDefID] then rs, hs, ws = 0.73, 0.73, 0.73 @@ -171,45 +180,45 @@ if gadgetHandler:IsSyncedCode() then rs, hs, ws = 0.53, 0.17, 0.53 end local xs, ys, zs, xo, yo, zo, vtype, htype, axis, _ = spGetUnitCollisionData(unitID) - if vtype>=3 and xs==ys and ys==zs then - if ys*hs < 13 and canFly[unitDefID] then -- Limit Max V height - spSetUnitCollisionData(unitID, xs*ws, 13, zs*rs, xo, yo, zo, 1, htype, 1) - elseif canFly[unitDefID] then - spSetUnitCollisionData(unitID, xs*ws, ys*hs, zs*rs, xo, yo, zo, 1, htype, 1) - else - spSetUnitCollisionData(unitID, xs*ws, ys*hs, zs*rs, xo, yo, zo, vtype, htype, axis) - end + if vtype >= 3 and xs == ys and ys == zs then + if ys * hs < 13 and canFly[unitDefID] then -- Limit Max V height + spSetUnitCollisionData(unitID, xs * ws, 13, zs * rs, xo, yo, zo, 1, htype, 1) + elseif canFly[unitDefID] then + spSetUnitCollisionData(unitID, xs * ws, ys * hs, zs * rs, xo, yo, zo, 1, htype, 1) + else + spSetUnitCollisionData(unitID, xs * ws, ys * hs, zs * rs, xo, yo, zo, vtype, htype, axis) + end end -- set aircraft size - if canFly[unitDefID] and UnitDefs[unitDefID].transportCapacity>0 then + if canFly[unitDefID] and UnitDefs[unitDefID].transportCapacity > 0 then spSetUnitRadiusAndHeight(unitID, 16, 16) else - spSetUnitRadiusAndHeight(unitID, spGetUnitRadius(unitID)*rs, spGetUnitHeight(unitID)*hs) + spSetUnitRadiusAndHeight(unitID, spGetUnitRadius(unitID) * rs, spGetUnitHeight(unitID) * hs) end -- make sure underwater units are really underwater (need midpoint + model radius <0) local h = spGetUnitHeight(unitID) local wd = UnitDefs[unitDefID].minWaterDepth - if UnitDefs[unitDefID].modCategories['underwater'] and wd and wd+r>0 then - spSetUnitRadiusAndHeight(unitID, wd-1, h) + if UnitDefs[unitDefID].modCategories["underwater"] and wd and wd + r > 0 then + spSetUnitRadiusAndHeight(unitID, wd - 1, h) end elseif unitModeltype[unitDefID] == "s3o" then if canFly[unitDefID] then - local rs, hs, ws = 1.15, 0.33, 1.15 -- dont know why 3do uses: 0.53, 0.17, 0.53 + local rs, hs, ws = 1.15, 0.33, 1.15 -- dont know why 3do uses: 0.53, 0.17, 0.53 local xs, ys, zs, xo, yo, zo, vtype, htype, axis, _ = spGetUnitCollisionData(unitID) - if vtype>=3 and xs==ys and ys==zs then - if ys*hs < 13 then -- Limit Max V height - spSetUnitCollisionData(unitID, xs*ws, 13, zs*rs, xo, yo, zo, 3, htype, 0) + if vtype >= 3 and xs == ys and ys == zs then + if ys * hs < 13 then -- Limit Max V height + spSetUnitCollisionData(unitID, xs * ws, 13, zs * rs, xo, yo, zo, 3, htype, 0) elseif canFly[unitDefID] then - spSetUnitCollisionData(unitID, xs*ws, ys*hs, zs*rs, xo, yo, zo, 3, htype, 0) + spSetUnitCollisionData(unitID, xs * ws, ys * hs, zs * rs, xo, yo, zo, 3, htype, 0) else - spSetUnitCollisionData(unitID, xs*ws, ys*hs, zs*rs, xo, yo, zo, vtype, htype, axis) + spSetUnitCollisionData(unitID, xs * ws, ys * hs, zs * rs, xo, yo, zo, vtype, htype, axis) end end end end - + -- Check if a unit is pop-up type (the list must be entered manually) -- If a building was constructed add it to the list for later radius and height scaling -- Changed from UnitFinished to UnitCreated @@ -217,42 +226,42 @@ if gadgetHandler:IsSyncedCode() then -- These buildings should be added to the list of popupUnits to update when they are created, not when finished local un = unitName[unitDefID] if unitCollisionVolume[un] then - popupUnits[unitID]={name=un, state=-1, perPiece=false} + popupUnits[unitID] = { name = un, state = -1, perPiece = false } elseif dynamicPieceCollisionVolume[un] then - popupUnits[unitID]={name=un, state=-1, perPiece=true, numPieces = #spGetPieceList(unitID)-1} + popupUnits[unitID] = { name = un, state = -1, perPiece = true, numPieces = #spGetPieceList(unitID) - 1 } end end - -- Same as for 3DO units, but for features function gadget:FeatureCreated(featureID, allyTeam) - if featureDefMidAndAimPos[featureDefID] then + if featureDefMidAndAimPos[featureDefID] then --Spring.SetFeatureMidAndAimPos ( number featureID, number mpX, number mpY, number mpZ, number apX, number apY, number apZ [, bool relative ) local midAndAimPos = featureDefMidAndAimPos[featureDefID] - Spring.SetFeatureMidAndAimPos(featureID, - midAndAimPos['midx'] or 0, - midAndAimPos['midy'] or 0, - midAndAimPos['midz'] or 0, - (midAndAimPos['aimx'] or 0) * -1, -- because engine is bugged - midAndAimPos['aimy'] or 0, - midAndAimPos['aimz'] or 0-- relative? - ) + Spring.SetFeatureMidAndAimPos( + featureID, + midAndAimPos["midx"] or 0, + midAndAimPos["midy"] or 0, + midAndAimPos["midz"] or 0, + (midAndAimPos["aimx"] or 0) * -1, -- because engine is bugged + midAndAimPos["aimy"] or 0, + midAndAimPos["aimz"] or 0 -- relative? + ) end if is3doFeature[Spring.GetFeatureDefID(featureID)] then local rs, hs - if spGetFeatureRadius(featureID)>47 then + if spGetFeatureRadius(featureID) > 47 then rs, hs = 0.68, 0.60 else rs, hs = 0.75, 0.67 end local xs, ys, zs, xo, yo, zo, vtype, htype, axis, _ = spGetFeatureCollisionData(featureID) - if vtype>=3 and xs==ys and ys==zs then - spSetFeatureCollisionData(featureID, xs*rs, ys*hs, zs*rs, xo, yo-ys*0.09, zo, vtype, htype, axis) + if vtype >= 3 and xs == ys and ys == zs then + spSetFeatureCollisionData(featureID, xs * rs, ys * hs, zs * rs, xo, yo - ys * 0.09, zo, vtype, htype, axis) end - spSetFeatureRadiusAndHeight(featureID, spGetFeatureRadius(featureID)*rs, spGetFeatureHeight(featureID)*hs) + spSetFeatureRadiusAndHeight(featureID, spGetFeatureRadius(featureID) * rs, spGetFeatureHeight(featureID) * hs) end end - + --check if a pop-up type unit was destroyed function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if popupUnits[unitID] then @@ -260,15 +269,14 @@ if gadgetHandler:IsSyncedCode() then end end - --Dynamic adjustment of pop-up style of units' collision volumes based on unit's ARMORED status, runs twice per second --rescaling of radius and height of 3DO buildings function gadget:GameFrame(n) - if n%15 ~= 0 then + if n % 15 ~= 0 then return end local p, t, stateString, stateInt - for unitID,defs in pairs(popupUnits) do + for unitID, defs in pairs(popupUnits) do if spArmor(unitID) then stateString = "off" stateInt = 0 @@ -279,7 +287,7 @@ if gadgetHandler:IsSyncedCode() then if defs.state ~= stateInt then if defs.perPiece then t = dynamicPieceCollisionVolume[defs.name][stateString] - for pieceIndex=0, defs.numPieces do + for pieceIndex = 0, defs.numPieces do p = t[pieceIndexStr[pieceIndex]] if p then spSetPieceCollisionData(unitID, pieceIndex + 1, true, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]) @@ -290,21 +298,21 @@ if gadgetHandler:IsSyncedCode() then if t.offsets then p = t.offsets local unitHeight = spGetUnitHeight(unitID) - if unitHeight == nil then -- had error once, hope this nil check helps + if unitHeight == nil then -- had error once, hope this nil check helps popupUnits[unitID] = nil else - spSetUnitMidAndAimPos(unitID, 0, unitHeight/2, 0, p[1], p[2], p[3],true) + spSetUnitMidAndAimPos(unitID, 0, unitHeight / 2, 0, p[1], p[2], p[3], true) end end else local unitHeight = spGetUnitHeight(unitID) - if unitHeight == nil then -- had error once, hope this nil check helps + if unitHeight == nil then -- had error once, hope this nil check helps popupUnits[unitID] = nil else p = unitCollisionVolume[defs.name][stateString] spSetUnitCollisionData(unitID, p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9]) if p[10] then - spSetUnitMidAndAimPos(unitID, 0, unitHeight/2, 0, p[10], p[11], p[12],true) + spSetUnitMidAndAimPos(unitID, 0, unitHeight / 2, 0, p[10], p[11], p[12], true) end end end @@ -314,5 +322,4 @@ if gadgetHandler:IsSyncedCode() then end end end - end diff --git a/luarules/gadgets/unit_evolution.lua b/luarules/gadgets/unit_evolution.lua index 7026fc044c6..226914ed20f 100644 --- a/luarules/gadgets/unit_evolution.lua +++ b/luarules/gadgets/unit_evolution.lua @@ -8,26 +8,25 @@ function gadget:GetInfo() date = "2023-03-31", license = "None", layer = 50, - enabled = true + enabled = true, } end if gadgetHandler:IsSyncedCode() then - - local spCreateUnit = Spring.CreateUnit - local spDestroyUnit = Spring.DestroyUnit - local spGiveOrderToUnit = Spring.GiveOrderToUnit - local spSetUnitRulesParam = Spring.SetUnitRulesParam - local spGetUnitPosition = Spring.GetUnitPosition + local spCreateUnit = Spring.CreateUnit + local spDestroyUnit = Spring.DestroyUnit + local spGiveOrderToUnit = Spring.GiveOrderToUnit + local spSetUnitRulesParam = Spring.SetUnitRulesParam + local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitStates = Spring.GetUnitStates - local spGetUnitHealth = Spring.GetUnitHealth - local spGetUnitTransporter = Spring.GetUnitTransporter - - local spGetTeamList = Spring.GetTeamList - local spGetUnitExperience = Spring.GetUnitExperience - local spGetUnitTeam = Spring.GetUnitTeam - local spGetUnitDirection = Spring.GetUnitDirection - local spGetUnitStockpile = Spring.GetUnitStockpile + local spGetUnitHealth = Spring.GetUnitHealth + local spGetUnitTransporter = Spring.GetUnitTransporter + + local spGetTeamList = Spring.GetTeamList + local spGetUnitExperience = Spring.GetUnitExperience + local spGetUnitTeam = Spring.GetUnitTeam + local spGetUnitDirection = Spring.GetUnitDirection + local spGetUnitStockpile = Spring.GetUnitStockpile local spEcho = Spring.Echo local spSetUnitHealth = Spring.SetUnitHealth @@ -52,37 +51,30 @@ if gadgetHandler:IsSyncedCode() then -- ZECRUS, values can be tuned in the unitdef file. Add the section below to the unitdef list in the unitdef file. --customparams = { - -- -- Required: - -- evolution_target = "unitname" Name of the unit this unit will evolve into. - - - -- -- Optional: - -- evolution_announcement = "Unit Evolved", -- Announcement printed when the unit is evolved. - -- evolution_announcement_size = 18.5, -- Size of the onscreen announcement - - -- -- Has a default value, as indicated, if not chosen: - -- evolution_condition = "timer", -- condition type for the evolution. "timer", "timer_global", "health", "power", or "xp" - -- evolution_timer = 600, -- set the timer used for the timer condition. Given in secons from when the unit was created. - -- evolution_health_threshold = 0, -- threshold for triggering the "health" evolution condition. - -- evolution_power_threshold = 600, -- threshold for triggering the "power" evolution condition. - -- evolution_xp_threshold = 0.8, -- threshold for triggering the "xp" evolution condition. Max rank icon reached at 0.8 - -- evolution_power_enemy_multiplier = 1, -- Scales the power calculated based on the average enemy combined power. - -- evolution_power_multiplier = 1, -- Scales the power calculated based on your own combined power. - -- combatradius = 1000, -- Range for setting in-combat status if enemies are within range, and disabling evolution while in-combat. - -- evolution_health_transfer = "flat", -- "flat", "percentage", or "full" - - - -- }, - - - - - - --------------------------------------------------------------------------------- ---from Zero-K Morph --------------------------------------------------------------------------------- --- This function is terrible. The data structure of commands does not lend itself to a fundamentally nicer system though. + -- -- Required: + -- evolution_target = "unitname" Name of the unit this unit will evolve into. + + -- -- Optional: + -- evolution_announcement = "Unit Evolved", -- Announcement printed when the unit is evolved. + -- evolution_announcement_size = 18.5, -- Size of the onscreen announcement + + -- -- Has a default value, as indicated, if not chosen: + -- evolution_condition = "timer", -- condition type for the evolution. "timer", "timer_global", "health", "power", or "xp" + -- evolution_timer = 600, -- set the timer used for the timer condition. Given in secons from when the unit was created. + -- evolution_health_threshold = 0, -- threshold for triggering the "health" evolution condition. + -- evolution_power_threshold = 600, -- threshold for triggering the "power" evolution condition. + -- evolution_xp_threshold = 0.8, -- threshold for triggering the "xp" evolution condition. Max rank icon reached at 0.8 + -- evolution_power_enemy_multiplier = 1, -- Scales the power calculated based on the average enemy combined power. + -- evolution_power_multiplier = 1, -- Scales the power calculated based on your own combined power. + -- combatradius = 1000, -- Range for setting in-combat status if enemies are within range, and disabling evolution while in-combat. + -- evolution_health_transfer = "flat", -- "flat", "percentage", or "full" + + -- }, + + -------------------------------------------------------------------------------- + --from Zero-K Morph + -------------------------------------------------------------------------------- + -- This function is terrible. The data structure of commands does not lend itself to a fundamentally nicer system though. local unitTargetCommand = { [CMD.GUARD] = true, @@ -93,9 +85,9 @@ if gadgetHandler:IsSyncedCode() then [CMD.ATTACK] = true, } - local function reAssignAssists(newUnit,oldUnit) + local function reAssignAssists(newUnit, oldUnit) local allUnits = Spring.GetAllUnits() - for _,unitID in pairs(allUnits) do + for _, unitID in pairs(allUnits) do if GG.GetUnitTarget and GG.GetUnitTarget(unitID) == oldUnit and newUnit then -- GG.SetUnitTarget(unitID, newUnit) -- FIXME: unit_target_on_the_move provides only GetUnitTarget Spring.SetUnitTarget(unitID, newUnit) @@ -108,26 +100,26 @@ if gadgetHandler:IsSyncedCode() then if (unitTargetCommand[cmd.id] or (singleParamUnitTargetCommand[cmd.id] and #params == 1)) and (params[1] == oldUnit) then params[1] = newUnit local opts = (cmd.options.meta and CMD.OPT_META or 0) + (cmd.options.ctrl and CMD.OPT_CTRL or 0) + (cmd.options.alt and CMD.OPT_ALT or 0) - Spring.GiveOrderToUnit(unitID, CMD.INSERT, {cmd.tag, cmd.id, opts, params[1], params[2], params[3]}, 0) + Spring.GiveOrderToUnit(unitID, CMD.INSERT, { cmd.tag, cmd.id, opts, params[1], params[2], params[3] }, 0) Spring.GiveOrderToUnit(unitID, CMD.REMOVE, cmd.tag, 0) end end end end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- local function skipEvolutions(evolutionCurrent) local newUnitName = evolutionCurrent.evolution_target - if evolutionCurrent.evolution_condition ~= 'timer' and evolutionCurrent.evolution_condition ~= 'timer_global' then + if evolutionCurrent.evolution_condition ~= "timer" and evolutionCurrent.evolution_condition ~= "timer_global" then return newUnitName, 0 end local now = spGetGameSeconds() local evolution = UnitDefNames[newUnitName] and UnitDefNames[newUnitName].customParams local delayedSeconds = 0 - if evolutionCurrent.evolution_condition == 'timer' then + if evolutionCurrent.evolution_condition == "timer" then delayedSeconds = (now - (evolutionCurrent.timeCreated or 0)) - (evolutionCurrent.evolution_timer or 0) end @@ -180,16 +172,12 @@ if gadgetHandler:IsSyncedCode() then return end - local newUnitID = spCreateUnit(toUnitNameSkipped, x, y, z , face, team) + local newUnitID = spCreateUnit(toUnitNameSkipped, x, y, z, face, team) if not newUnitID then return end - if (not evolution.evolution_condition - or evolution.evolution_condition == 'timer' - or evolution.evolution_condition == 'timer_global') - and evolutionMetaList[newUnitID] and evolutionMetaList[newUnitID].timeCreated - and delayedSeconds > 0 then + if (not evolution.evolution_condition or evolution.evolution_condition == "timer" or evolution.evolution_condition == "timer_global") and evolutionMetaList[newUnitID] and evolutionMetaList[newUnitID].timeCreated and delayedSeconds > 0 then evolutionMetaList[newUnitID].timeCreated = spGetGameSeconds() - delayedSeconds end @@ -207,11 +195,11 @@ if gadgetHandler:IsSyncedCode() then GG.quick_start.transferCommanderData(unitID, newUnitID) end - SendToUnsynced("unit_evolve_finished", unitID, newUnitID, announcement,announcementSize) + SendToUnsynced("unit_evolve_finished", unitID, newUnitID, announcement, announcementSize) if evolution.evolution_health_transfer == "full" then elseif evolution.evolution_health_transfer == "percentage" then local _, newUnitMaxHealth = spGetUnitHealth(newUnitID) - local pHealth = (health/maxHealth) * newUnitMaxHealth + local pHealth = (health / maxHealth) * newUnitMaxHealth spSetUnitHealth(newUnitID, pHealth) else spSetUnitHealth(newUnitID, health) @@ -222,8 +210,8 @@ if gadgetHandler:IsSyncedCode() then spSetUnitStockpile(newUnitID, stockpile, stockpilebuildpercent) spSetUnitDirection(newUnitID, dx, dy, dz) - spGiveOrderToUnit(newUnitID, CMD.FIRE_STATE, states.firestate, {}) - spGiveOrderToUnit(newUnitID, CMD.MOVE_STATE, states.movestate, {}) + spGiveOrderToUnit(newUnitID, CMD.FIRE_STATE, states.firestate, {}) + spGiveOrderToUnit(newUnitID, CMD.MOVE_STATE, states.movestate, {}) -- TODO Untested spGiveOrderToUnit(newUnitID, CMD.TRAJECTORY, states.trajectory and 1 or 0, {}) -- FIXME TODO Does not work. Could also use GiveOrderArrayToUnit. @@ -231,11 +219,11 @@ if gadgetHandler:IsSyncedCode() then -- spGiveOrderToUnit(newUnitID, CMD.CLOAK, states.cloak and 1 or 0, {}) -- spGiveOrderToUnit(newUnitID, CMD.ONOFF, 1, {}) - reAssignAssists(newUnitID,unitID) + reAssignAssists(newUnitID, unitID) if commandQueue[1] then local teamID = Spring.GetUnitTeam(unitID) - for _,command in pairs(commandQueue) do + for _, command in pairs(commandQueue) do local coded = command.options.coded + (command.options.shift and 0 or CMD.OPT_SHIFT) -- orders without SHIFT can appear at positions other than the 1st due to CMD.INSERT; they'd cancel any previous commands if added raw if command.id < 0 then -- repair case for construction local units = CallAsTeam(teamID, Spring.GetUnitsInRectangle, command.params[1] - 16, command.params[3] - 16, command.params[1] + 16, command.params[3] + 16, -3) @@ -260,22 +248,21 @@ if gadgetHandler:IsSyncedCode() then if transporter then spGiveOrderToUnit(transporter, CMD.LOAD_UNITS, { newUnitID }, 0) end - end function gadget:UnitCreated(unitID, unitDefID, unitTeam) local udcp = UnitDefs[unitDefID].customParams if udcp.evolution_target then evolutionMetaList[unitID] = table.merge(udcp, { - combatradius = tonumber(udcp.combatradius), - evolution_announcement_size = tonumber(udcp.evolution_announcement_size), - evolution_health_threshold = tonumber(udcp.evolution_health_threshold), + combatradius = tonumber(udcp.combatradius), + evolution_announcement_size = tonumber(udcp.evolution_announcement_size), + evolution_health_threshold = tonumber(udcp.evolution_health_threshold), evolution_power_enemy_multiplier = tonumber(udcp.evolution_power_enemy_multiplier), - evolution_power_multiplier = tonumber(udcp.evolution_power_multiplier), - evolution_power_threshold = tonumber(udcp.evolution_power_threshold), - evolution_xp_threshold = tonumber(udcp.evolution_xp_threshold), - evolution_timer = tonumber(udcp.evolution_timer), - timeCreated = spGetGameSeconds(), + evolution_power_multiplier = tonumber(udcp.evolution_power_multiplier), + evolution_power_threshold = tonumber(udcp.evolution_power_threshold), + evolution_xp_threshold = tonumber(udcp.evolution_xp_threshold), + evolution_timer = tonumber(udcp.evolution_timer), + timeCreated = spGetGameSeconds(), }) end end @@ -290,7 +277,6 @@ if gadgetHandler:IsSyncedCode() then end end end - end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) @@ -318,9 +304,9 @@ if gadgetHandler:IsSyncedCode() then if evolution then if evolution.evolution_condition == "health" then local h = spGetUnitHealth(unitID) - if (h-damage) <= evolution.evolution_health_threshold then - evolve(unitID) - return 0, 0 + if (h - damage) <= evolution.evolution_health_threshold then + evolve(unitID) + return 0, 0 end end end @@ -333,14 +319,16 @@ if gadgetHandler:IsSyncedCode() then toCheckUnitIDs = {} local i = 0 for unitID, evolution in pairs(evolutionMetaList) do - i = i + 1 + i = i + 1 toCheckUnitIDs[i] = { id = unitID, - timeCreated = evolution.timeCreated + timeCreated = evolution.timeCreated, } end - table.sort(toCheckUnitIDs, function(a,b) return a.timeCreated < b.timeCreated end) + table.sort(toCheckUnitIDs, function(a, b) + return a.timeCreated < b.timeCreated + end) lastCheckIndex = 1 nToCheckUnitIDs = i @@ -359,7 +347,7 @@ if gadgetHandler:IsSyncedCode() then local function unitsToBatchSizeInterpolation(value, minLoadUnits, maxLoadUnits, minLoadBatchSize, maxLoadBatchSize) value = math.clamp(value, minLoadUnits, maxLoadUnits) local t = (value - minLoadUnits) / (maxLoadUnits - minLoadUnits) - return minLoadBatchSize * ((maxLoadBatchSize / minLoadBatchSize) ^ (t^0.1)) + return minLoadBatchSize * ((maxLoadBatchSize / minLoadBatchSize) ^ (t ^ 0.1)) end local function combatCheckUpdate(unitID, evolution, currentTime) @@ -377,12 +365,11 @@ if gadgetHandler:IsSyncedCode() then end local function isEvolutionTimePassed(evolution, currentTime) - return (evolution.evolution_condition == 'timer' and (currentTime - evolution.timeCreated) >= evolution.evolution_timer) - or (evolution.evolution_condition == 'timer_global' and currentTime >= evolution.evolution_timer) + return (evolution.evolution_condition == "timer" and (currentTime - evolution.timeCreated) >= evolution.evolution_timer) or (evolution.evolution_condition == "timer_global" and currentTime >= evolution.evolution_timer) end local function isEvolutionPowerPassed(evolution) - if evolution.evolution_condition ~= 'power' then + if evolution.evolution_condition ~= "power" then return false end @@ -393,7 +380,7 @@ if gadgetHandler:IsSyncedCode() then end local function isEvolutionXPPassed(unitID, evolution) - if evolution.evolution_condition ~= 'xp' then + if evolution.evolution_condition ~= "xp" then return false end local threshold = evolution.evolution_xp_threshold @@ -424,19 +411,15 @@ if gadgetHandler:IsSyncedCode() then local unitID = toCheckUnitIDs[lastCheckIndex].id local evolution = evolutionMetaList[unitID] - if evolution and not combatCheckUpdate(unitID, evolution, currentTime) - and not spGetUnitTransporter(unitID) - and (isEvolutionTimePassed(evolution, currentTime) or isEvolutionPowerPassed(evolution) or isEvolutionXPPassed(unitID, evolution)) then - evolve(unitID) + if evolution and not combatCheckUpdate(unitID, evolution, currentTime) and not spGetUnitTransporter(unitID) and (isEvolutionTimePassed(evolution, currentTime) or isEvolutionPowerPassed(evolution) or isEvolutionXPPassed(unitID, evolution)) then + evolve(unitID) end lastCheckIndex = lastCheckIndex + 1 batchSize = batchSize + 1 end end - else - local spSelectUnitArray = Spring.SelectUnitArray local spGetSelectedUnits = Spring.GetSelectedUnits local spGetGameSeconds = Spring.GetGameSeconds @@ -475,12 +458,12 @@ else if unitGroup then Spring.SetUnitGroup(newID, unitGroup) end - for i=1,#selUnits do + for i = 1, #selUnits do local unitID = selUnits[i] - if (unitID == oldID) then - selUnits[i] = newID - spSelectUnitArray(selUnits) - break + if unitID == oldID then + selUnits[i] = newID + spSelectUnitArray(selUnits) + break end end if newAnnouncement then @@ -497,7 +480,7 @@ else end if announcementEnabled then local currentTime = spGetGameSeconds() - if currentTime-announcementStart < 3 then + if currentTime - announcementStart < 3 then draw(announcement, announcementSize) else announcementEnabled = false @@ -517,12 +500,10 @@ else gl.Texture(1, "LuaUI/images/gradient_alpha_2.png") gl.TexRect(0, 0, w, h) end) - end function gadget:Shutdown() gadgetHandler:RemoveSyncAction("unit_evolve_finished") gl.DeleteList(displayList) end - end diff --git a/luarules/gadgets/unit_explosion_spawner.lua b/luarules/gadgets/unit_explosion_spawner.lua index 35776bfc483..973d22e5b2a 100644 --- a/luarules/gadgets/unit_explosion_spawner.lua +++ b/luarules/gadgets/unit_explosion_spawner.lua @@ -1,5 +1,4 @@ - -if (not gadgetHandler:IsSyncedCode()) then +if not gadgetHandler:IsSyncedCode() then return false end @@ -13,7 +12,7 @@ function gadget:GetInfo() date = "2007-11-18", license = "None", layer = 50, - enabled = true + enabled = true, } end @@ -25,33 +24,32 @@ end -- spawns_ceg = use to spawn an arbitrary ceg in addition to the explosion effect used in the weapondefs. uses Spring.SpawnCEG() -- spawns_stun = a number, use it to define how long a unit will be stunned for after landing. - -local spCreateFeature = Spring.CreateFeature -local spCreateUnit = Spring.CreateUnit -local spDestroyUnit = Spring.DestroyUnit -local spGetGameFrame = Spring.GetGameFrame -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetProjectileTeamID = Spring.GetProjectileTeamID -local spGetUnitShieldState = Spring.GetUnitShieldState -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spSetFeatureDirection = Spring.SetFeatureDirection -local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spSpawnCEG = Spring.SpawnCEG -local spGetUnitHealth = Spring.GetUnitHealth -local spSetUnitHealth = Spring.SetUnitHealth -local spGetUnitPosition = Spring.GetUnitPosition -local spGetGroundHeight = Spring.GetGroundHeight -local spGetUnitTeam = Spring.GetUnitTeam -local spSetUnitDirection = Spring.SetUnitDirection -local spAddUnitImpulse = Spring.AddUnitImpulse -local spEcho = Spring.Echo - -local mapsizeX = Game.mapSizeX -local mapsizeZ = Game.mapSizeZ +local spCreateFeature = Spring.CreateFeature +local spCreateUnit = Spring.CreateUnit +local spDestroyUnit = Spring.DestroyUnit +local spGetGameFrame = Spring.GetGameFrame +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetUnitShieldState = Spring.GetUnitShieldState +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spSetFeatureDirection = Spring.SetFeatureDirection +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spSpawnCEG = Spring.SpawnCEG +local spGetUnitHealth = Spring.GetUnitHealth +local spSetUnitHealth = Spring.SetUnitHealth +local spGetUnitPosition = Spring.GetUnitPosition +local spGetGroundHeight = Spring.GetGroundHeight +local spGetUnitTeam = Spring.GetUnitTeam +local spSetUnitDirection = Spring.SetUnitDirection +local spAddUnitImpulse = Spring.AddUnitImpulse +local spEcho = Spring.Echo + +local mapsizeX = Game.mapSizeX +local mapsizeZ = Game.mapSizeZ local random = math.random -local sin = math.sin -local cos = math.cos +local sin = math.sin +local cos = math.cos local mathMax = math.max local mathSqrt = math.sqrt local stringFind = string.find @@ -105,7 +103,7 @@ local scavengerAITeamID = 999 local teams = Spring.GetTeamList() for i = 1, #teams do local luaAI = Spring.GetTeamLuaAI(teams[i]) - if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'ScavengersAI' then + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == "ScavengersAI" then scavengerAITeamID = i - 1 break end @@ -138,7 +136,7 @@ local function SpawnUnit(spawnData) if not spawnDef.surface then validSurface = true - elseif spawnData.y < mathMax(y+32, 32) then + elseif spawnData.y < mathMax(y + 32, 32) then local surface = spawnDef.surface if stringFind(surface, "LAND", 1, true) and y > minWaterDepth then validSurface = true @@ -182,7 +180,7 @@ local function SpawnUnit(spawnData) end if not spawnUnitName or not UnitDefNames[spawnUnitName] then - spEcho('INVALID UNIT NAME IN UNIT EXPLOSION SPAWNER', spawnUnitName) + spEcho("INVALID UNIT NAME IN UNIT EXPLOSION SPAWNER", spawnUnitName) return end @@ -192,13 +190,13 @@ local function SpawnUnit(spawnData) end if spawnDef.ceg then - spSpawnCEG(spawnDef.ceg, x, spawnData.y, z, 0,0,0) + spSpawnCEG(spawnDef.ceg, x, spawnData.y, z, 0, 0, 0) end if spawnDef.stun then local maxHealth = select(2, spGetUnitHealth(unitID)) - local paralyzeTime = maxHealth + ((maxHealth/30)*spawnDef.stun) - spSetUnitHealth(unitID, {paralyze = paralyzeTime }) + local paralyzeTime = maxHealth + ((maxHealth / 30) * spawnDef.stun) + spSetUnitHealth(unitID, { paralyze = paralyzeTime }) end if ownerID then @@ -208,10 +206,10 @@ local function SpawnUnit(spawnData) if ownx then local dx = (x - ownx) local dz = (z - ownz) - local l = mathSqrt((dx*dx) + (dz*dz)) + local l = mathSqrt((dx * dx) + (dz * dz)) if l > 0 then - dx = dx/l - dz = dz/l + dx = dx / l + dz = dz / l spSetUnitDirection(unitID, dx, 0, dz) spAddUnitImpulse(unitID, dx, 0.5, dz, 1.0) end @@ -233,8 +231,6 @@ local function SpawnUnit(spawnData) -- Force a slowupdate to make the unit act immediately spGiveOrderToUnit(unitID, CMD_WAIT, EMPTY_TABLE, 0) spGiveOrderToUnit(unitID, CMD_WAIT, EMPTY_TABLE, 0) - - end end end @@ -252,7 +248,6 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w end end end - end function gadget:Initialize() @@ -311,7 +306,6 @@ function gadget:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shie noCreate = true -- not a per-projectile map because Explosion() is guaranteed to follow end - function gadget:UnitCreated(unitID, unitDefID, unitTeam) local unitDef = UnitDefs[unitDefID] local weaponList = unitDef.weapons @@ -321,33 +315,30 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam) local weapon = weaponList[i] local weaponDefID = weapon.weaponDef if weaponDefID and spawnDefs[weaponDefID] then - local spawnDef = spawnDefs[weaponDefID] if not spawnNames[unitID] then - spawnNames[unitID] = { - weapon = {} - } + spawnNames[unitID] = { + weapon = {}, + } end if spawnNames[unitID] then - -- Use pre-split unitNames from spawnDef instead of splitting on every unit creation - spawnNames[unitID].weapon[weaponDefID] = { - names = spawnDef.unitNames, - unitSequence = 1, - } - if spawnDef.mode == "random_locked" then - spawnNames[unitID].weapon[weaponDefID].unitSequence = random(#spawnNames[unitID].weapon[weaponDefID].names) - end - end - + -- Use pre-split unitNames from spawnDef instead of splitting on every unit creation + spawnNames[unitID].weapon[weaponDefID] = { + names = spawnDef.unitNames, + unitSequence = 1, + } + if spawnDef.mode == "random_locked" then + spawnNames[unitID].weapon[weaponDefID].unitSequence = random(#spawnNames[unitID].weapon[weaponDefID].names) + end + end end end end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) -- Clean up spawn names if spawnNames[unitID] then - spawnNames[unitID] = nil + spawnNames[unitID] = nil end -- Clean up expire tracking diff --git a/luarules/gadgets/unit_factory_guard.lua b/luarules/gadgets/unit_factory_guard.lua index cb6767a0269..f9e5c1af2cf 100644 --- a/luarules/gadgets/unit_factory_guard.lua +++ b/luarules/gadgets/unit_factory_guard.lua @@ -1,31 +1,28 @@ - if not gadgetHandler:IsSyncedCode() then return end - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Factory Guard", - desc = "Adds a factory guard state command to factories", - author = "Hobo Joe", - date = "Feb 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Factory Guard", + desc = "Adds a factory guard state command to factories", + author = "Hobo Joe", + date = "Feb 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - local spGetUnitBuildFacing = Spring.GetUnitBuildFacing local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitRadius = Spring.GetUnitRadius local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc -local spEditUnitCmdDesc = Spring.EditUnitCmdDesc -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc +local spEditUnitCmdDesc = Spring.EditUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc local spTestMoveOrder = Spring.TestMoveOrder local CMD_FACTORY_GUARD = GameCMD.FACTORY_GUARD @@ -35,14 +32,13 @@ local CMD_MOVE = CMD.MOVE local factoryGuardCmdDesc = { id = CMD_FACTORY_GUARD, type = CMDTYPE.ICON_MODE, - tooltip = 'factoryguard_tooltip', - name = 'factoryguard', - cursor = 'cursornormal', - action = 'factoryguard', + tooltip = "factoryguard_tooltip", + name = "factoryguard", + cursor = "cursornormal", + action = "factoryguard", params = { 0, "factoryguard", "factoryguard" }, -- named like this for translation - 0 is off, 1 is on } - local isFactory = {} local isAssistBuilder = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -53,8 +49,8 @@ for unitDefID, unitDef in pairs(UnitDefs) do local buildOptDefID = buildOptions[i] local buildOpt = UnitDefs[buildOptDefID] - if (buildOpt and buildOpt.isBuilder and buildOpt.canAssist) then - isFactory[unitDefID] = true -- only factories that can build builders are included + if buildOpt and buildOpt.isBuilder and buildOpt.canAssist then + isFactory[unitDefID] = true -- only factories that can build builders are included break end end @@ -64,31 +60,27 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end - local function setFactoryGuardState(unitID, state) local cmdDescID = spFindUnitCmdDesc(unitID, CMD_FACTORY_GUARD) if cmdDescID then factoryGuardCmdDesc.params[1] = state - spEditUnitCmdDesc(unitID, cmdDescID, {params = factoryGuardCmdDesc.params}) + spEditUnitCmdDesc(unitID, cmdDescID, { params = factoryGuardCmdDesc.params }) end end - function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) --accepts: CMD_FACTORY_GUARD if isFactory[unitDefID] then setFactoryGuardState(unitID, cmdParams[1]) - return false -- command was used + return false -- command was used end - return true -- command was not used + return true -- command was not used end - -------------------------------------------------------------------------------- -- Guard Command Handling local function GuardFactory(unitID, unitDefID, factID, factDefID) - if not isFactory[factDefID] then -- is this a factory? return @@ -99,31 +91,31 @@ local function GuardFactory(unitID, unitDefID, factID, factDefID) end local x, y, z = spGetUnitPosition(factID) - if (not x) then + if not x then return end local radius = spGetUnitRadius(factID) - if (not radius) then + if not radius then return end local dist = radius * 2 local facing = spGetUnitBuildFacing(factID) - if (not facing) then + if not facing then return end -- facing values { S = 0, E = 1, N = 2, W = 3 } local dx, dz -- down vector local rx, rz -- right vector - if (facing == 0) then + if facing == 0 then dx, dz = 0, dist rx, rz = dist, 0 - elseif (facing == 1) then + elseif facing == 1 then dx, dz = dist, 0 rx, rz = 0, -dist - elseif (facing == 2) then + elseif facing == 2 then dx, dz = 0, -dist rx, rz = -dist, 0 else @@ -148,10 +140,8 @@ local function GuardFactory(unitID, unitDefID, factID, factDefID) OrderUnit(unitID, CMD_GUARD, { factID }, { "shift" }) end - -function gadget:UnitFromFactory(unitID, unitDefID, unitTeam, - factID, factDefID, userOrders) - if (userOrders) then +function gadget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) + if userOrders then return -- already has user assigned orders end @@ -165,7 +155,6 @@ function gadget:UnitFromFactory(unitID, unitDefID, unitTeam, GuardFactory(unitID, unitDefID, factID, factDefID) end - -------------------------------------------------------------------------------- -- Unit Handling diff --git a/luarules/gadgets/unit_factory_quota.lua b/luarules/gadgets/unit_factory_quota.lua index 4e4f9ce2605..e108658ebc3 100644 --- a/luarules/gadgets/unit_factory_quota.lua +++ b/luarules/gadgets/unit_factory_quota.lua @@ -6,13 +6,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Factory Quotas", - desc = "Adds a queue mode toggle to factories", - author = "hihoman23", - date = "Aug 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Factory Quotas", + desc = "Adds a queue mode toggle to factories", + author = "hihoman23", + date = "Aug 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -26,30 +26,30 @@ local CMD_QUOTA_BUILD_TOGGLE = GameCMD.QUOTA_BUILD_TOGGLE local isFactory = {} for unitDefID, unitDef in pairs(UnitDefs) do - isFactory[unitDefID] = unitDef.isFactory + isFactory[unitDefID] = unitDef.isFactory end local factoryQuotaCmdDesc = { id = CMD_QUOTA_BUILD_TOGGLE, type = CMDTYPE.ICON_MODE, - tooltip = 'factoryqueuemode_tooltip', - name = 'Factory Queue Mode', - cursor = 'cursornormal', - action = 'factoryqueuemode', + tooltip = "factoryqueuemode_tooltip", + name = "Factory Queue Mode", + cursor = "cursornormal", + action = "factoryqueuemode", params = { 0, "factoryqueuemode_normal", "factoryqueuemode_quota" }, -- named like this for translation - 0 is off, 1 is on } function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) -- accepts: CMD_QUOTA_BUILD_TOGGLE if isFactory[unitDefID] then - local cmdDescID = SpringFindUnitCmdDesc(unitID, CMD_QUOTA_BUILD_TOGGLE) - if cmdDescID then - factoryQuotaCmdDesc.params[1] = cmdParams[1] - SpringEditUnitCmdDesc(unitID, cmdDescID, {params = factoryQuotaCmdDesc.params}) - end - return false -- command was used + local cmdDescID = SpringFindUnitCmdDesc(unitID, CMD_QUOTA_BUILD_TOGGLE) + if cmdDescID then + factoryQuotaCmdDesc.params[1] = cmdParams[1] + SpringEditUnitCmdDesc(unitID, cmdDescID, { params = factoryQuotaCmdDesc.params }) + end + return false -- command was used end - return true -- command was not used + return true -- command was not used end function gadget:UnitCreated(unitID, unitDefID, _) diff --git a/luarules/gadgets/unit_factory_unblocking.lua b/luarules/gadgets/unit_factory_unblocking.lua index 196ac08d1d6..9b055808784 100644 --- a/luarules/gadgets/unit_factory_unblocking.lua +++ b/luarules/gadgets/unit_factory_unblocking.lua @@ -1,4 +1,3 @@ - if not gadgetHandler:IsSyncedCode() then return end @@ -6,15 +5,15 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Factory Unblocking", - desc = "This prevents exiting units get stuck on the newly initiated (big) unit", - author = "Floris", - date = "September 2020", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Factory Unblocking", + desc = "This prevents exiting units get stuck on the newly initiated (big) unit", + author = "Floris", + date = "September 2020", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local setBlockingOnFinished = {} diff --git a/luarules/gadgets/unit_firestate_handler.lua b/luarules/gadgets/unit_firestate_handler.lua index 87d64732f6d..27b2634b413 100644 --- a/luarules/gadgets/unit_firestate_handler.lua +++ b/luarules/gadgets/unit_firestate_handler.lua @@ -13,7 +13,7 @@ function gadget:GetInfo() date = "2026.06.28", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -68,8 +68,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) local state local builderDefID = builderID and spGetUnitDefID(builderID) if builderDefID and UnitDefs[builderDefID].isFactory then - state = spGetUnitRulesParam(builderID, Firestates.RULES_PARAM) - or Firestates.fromEngineFirestate(spGetUnitStates(builderID, false)) + state = spGetUnitRulesParam(builderID, Firestates.RULES_PARAM) or Firestates.fromEngineFirestate(spGetUnitStates(builderID, false)) end if state == nil then state = Firestates.fromEngineFirestate(spGetUnitStates(unitID, false)) diff --git a/luarules/gadgets/unit_footprint_clearance.lua b/luarules/gadgets/unit_footprint_clearance.lua index bef4e64aba3..ed81372b683 100644 --- a/luarules/gadgets/unit_footprint_clearance.lua +++ b/luarules/gadgets/unit_footprint_clearance.lua @@ -1,16 +1,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Footprint clearance', - desc = 'Clears ground under newly build units any features that are under its footprint', - author = '', - version = '', - date = 'April 2011', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true - } + return { + name = "Footprint clearance", + desc = "Clears ground under newly build units any features that are under its footprint", + author = "", + version = "", + date = "April 2011", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then @@ -27,15 +27,14 @@ for unitDefID, unitDef in pairs(UnitDefs) do end local gibFeatureDefs = {} for featureDefID, fDef in pairs(FeatureDefs) do - if not fDef.geoThermal and fDef.name ~= 'geovent' and fDef.name ~= 'xelnotgawatchtower' and fDef.name ~= 'crystalring' then + if not fDef.geoThermal and fDef.name ~= "geovent" and fDef.name ~= "xelnotgawatchtower" and fDef.name ~= "crystalring" then gibFeatureDefs[featureDefID] = true end end function gadget:UnitCreated(uID, uDefID, uTeam, bID) - --Instagibb any features that are unlucky enough to be in the build radius of new construction projects - if unitXsize5[uDefID] then -- buildings/factories + if unitXsize5[uDefID] then -- buildings/factories local xr, zr if Spring.GetUnitBuildFacing(uID) % 2 == 0 then xr, zr = unitXsize5[uDefID], unitZsize5[uDefID] @@ -44,13 +43,13 @@ function gadget:UnitCreated(uID, uDefID, uTeam, bID) end local ux, _, uz = Spring.GetUnitPosition(uID) - local features = Spring.GetFeaturesInRectangle(ux-xr, uz-zr, ux+xr, uz+zr) + local features = Spring.GetFeaturesInRectangle(ux - xr, uz - zr, ux + xr, uz + zr) for i = 1, #features do if gibFeatureDefs[Spring.GetFeatureDefID(features[i])] then local fx, fy, fz = Spring.GetFeaturePosition(features[i]) Spring.DestroyFeature(features[i]) - Spring.SpawnCEG('sparklegreen', fx, fy, fz) - Spring.PlaySoundFile('reclaimate', 1, fx, fy, fz, 'sfx') + Spring.SpawnCEG("sparklegreen", fx, fy, fz) + Spring.PlaySoundFile("reclaimate", 1, fx, fy, fz, "sfx") end end end diff --git a/luarules/gadgets/unit_geo_upgrade_reclaimer.lua b/luarules/gadgets/unit_geo_upgrade_reclaimer.lua index 1816777e489..1bd828d427b 100644 --- a/luarules/gadgets/unit_geo_upgrade_reclaimer.lua +++ b/luarules/gadgets/unit_geo_upgrade_reclaimer.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Geo Upgrade Reclaimer", - desc = "Insta reclaims/refunds t1 geo when t2 on top has finished, also shares t2 geos build upon ally t1 geo owner", - author = "Floris", - date = "February 2022", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Geo Upgrade Reclaimer", + desc = "Insta reclaims/refunds t1 geo when t2 on top has finished, also shares t2 geos build upon ally t1 geo owner", + author = "Floris", + date = "February 2022", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -16,9 +16,7 @@ if not gadgetHandler:IsSyncedCode() then return end - -local transferInstantly = true -- false = transfer geo on completion - +local transferInstantly = true -- false = transfer geo on completion _G.transferredUnits = {} @@ -29,7 +27,6 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end - local function hasGeoUnderneat(unitID) local x, _, z = Spring.GetUnitPosition(unitID) local units = Spring.GetUnitsInCylinder(x, z, 10) @@ -86,7 +83,6 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) end end - -- the mex upgrade reclaimer gadget already does this --function gadget:GameFrame(gf) -- if gf % 99 then diff --git a/luarules/gadgets/unit_hats.lua b/luarules/gadgets/unit_hats.lua index 411cf787d4e..e24e213ec9c 100644 --- a/luarules/gadgets/unit_hats.lua +++ b/luarules/gadgets/unit_hats.lua @@ -1,4 +1,3 @@ - if Spring.GetModOptions().teamcolors_anonymous_mode ~= "disabled" then return end @@ -11,7 +10,7 @@ function gadget:GetInfo() desc = "Handles cosmetic-only hat behaviour", author = "Beherith", date = "2020", - license = "GNU GPL, v2 or later", + license = "GNU GPL, v2 or later", layer = 1000, enabled = true, } @@ -19,15 +18,15 @@ end local DEBUG = false -function gadget:GameID(gameID) +function gadget:GameID(gameID) -- make sure gameID is a string because i'm not actually sure cachedGameID = tostring(gameID) -- Initialise this madness local FakeRandomSeed = "" -- because yes - for i = 1,1000 do + for i = 1, 1000 do -- Check if the next character in the game ID is a number - if tonumber(string.sub(cachedGameID, i, i)) then + if tonumber(string.sub(cachedGameID, i, i)) then -- Make sure the number we are creating doesn't grow beyond the 32bit integrer limits if (not tonumber(FakeRandomSeed)) or i <= 8 or (i > 8 and tonumber(FakeRandomSeed .. tonumber(string.sub(cachedGameID, i, i))) < 10) then -- Add the next character that is for sure a number @@ -151,10 +150,10 @@ PlayerCosmeticList = { "CortexNationWarsEECLeftShoulder", -- Nation Wars 2026 2nd Place }, [142011] = { -- [BAC]OutlawElite - "BronzeMedalNecklace" -- Last Season Top3 Finisher + "BronzeMedalNecklace", -- Last Season Top3 Finisher }, [144092] = { -- [DmE]Wraxell - "LegionChampionHat" -- Legion Fight Night winner + "LegionChampionHat", -- Legion Fight Night winner }, [151863] = { -- Blodir "VikingHat", -- Omega Series 4 Winner @@ -197,7 +196,7 @@ PlayerCosmeticList = { "CortexNationWarsGERLeftShoulder", "CortexNationWarsEECLeftShoulder", "CortexNationWarsUSLeftShoulder", - } + }, } -- Cosmetic Defs @@ -221,7 +220,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_hw and UnitDefNames.cor_hat_hw.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -229,7 +228,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_fightnight and UnitDefNames.cor_hat_fightnight.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -237,7 +236,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_legfn and UnitDefNames.cor_hat_legfn.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -245,7 +244,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_viking and UnitDefNames.cor_hat_viking.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -253,7 +252,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_pirate and UnitDefNames.cor_hat_pirate.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -261,7 +260,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "unit", unitDefID = UnitDefNames.cor_hat_gnome and UnitDefNames.cor_hat_gnome.id, - faction = {arm = true, cor = true, leg = true}, + faction = { arm = true, cor = true, leg = true }, conflictsWith = {}, }, @@ -269,7 +268,7 @@ CosmeticDefinitions = { slot = "hat", implementation = "baked", scriptCall = "ShowCrown", - faction = {arm = true, cor = true, leg = false}, -- we don't have this for Legion :/ + faction = { arm = true, cor = true, leg = false }, -- we don't have this for Legion :/ conflictsWith = {}, }, @@ -285,7 +284,7 @@ CosmeticDefinitions = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.arm_leftshoulder_nationwars_ger and UnitDefNames.arm_leftshoulder_nationwars_ger.id, - faction = {arm = true, cor = false, leg = false}, + faction = { arm = true, cor = false, leg = false }, conflictsWith = {}, }, @@ -293,7 +292,7 @@ CosmeticDefinitions = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.arm_leftshoulder_nationwars_eec and UnitDefNames.arm_leftshoulder_nationwars_eec.id, - faction = {arm = true, cor = false, leg = false}, + faction = { arm = true, cor = false, leg = false }, conflictsWith = {}, }, @@ -301,15 +300,15 @@ CosmeticDefinitions = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.arm_leftshoulder_nationwars_us and UnitDefNames.arm_leftshoulder_nationwars_us.id, - faction = {arm = true, cor = false, leg = false}, + faction = { arm = true, cor = false, leg = false }, conflictsWith = {}, }, - + CortexNationWarsGERLeftShoulder = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.cor_leftshoulder_nationwars_ger and UnitDefNames.cor_leftshoulder_nationwars_ger.id, - faction = {arm = false, cor = true, leg = false}, + faction = { arm = false, cor = true, leg = false }, conflictsWith = {}, }, @@ -317,7 +316,7 @@ CosmeticDefinitions = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.cor_leftshoulder_nationwars_eec and UnitDefNames.cor_leftshoulder_nationwars_eec.id, - faction = {arm = false, cor = true, leg = false}, + faction = { arm = false, cor = true, leg = false }, conflictsWith = {}, }, @@ -325,7 +324,7 @@ CosmeticDefinitions = { slot = "leftshoulder", implementation = "unit", unitDefID = UnitDefNames.cor_leftshoulder_nationwars_us and UnitDefNames.cor_leftshoulder_nationwars_us.id, - faction = {arm = false, cor = true, leg = false}, + faction = { arm = false, cor = true, leg = false }, conflictsWith = {}, }, @@ -337,7 +336,7 @@ CosmeticDefinitions = { slot = "necklace", implementation = "baked", scriptCall = "ShowMedalBronze", - faction = {arm = true, cor = true, leg = false}, -- we don't have this for Legion :/ + faction = { arm = true, cor = true, leg = false }, -- we don't have this for Legion :/ conflictsWith = {}, }, @@ -345,7 +344,7 @@ CosmeticDefinitions = { slot = "necklace", implementation = "baked", scriptCall = "ShowMedalSilver", - faction = {arm = true, cor = true, leg = false}, -- we don't have this for Legion :/ + faction = { arm = true, cor = true, leg = false }, -- we don't have this for Legion :/ conflictsWith = {}, }, @@ -353,14 +352,13 @@ CosmeticDefinitions = { slot = "necklace", implementation = "baked", scriptCall = "ShowMedalGold", - faction = {arm = true, cor = true, leg = false}, -- we don't have this for Legion :/ + faction = { arm = true, cor = true, leg = false }, -- we don't have this for Legion :/ conflictsWith = {}, }, ------------------------------------------ -- Belts ------------------------------------------ - } CosmeticUnitDefIDToPiece = {} @@ -398,7 +396,7 @@ end local unitsWearingHats = {} -- key unitID of wearer, value unitID of hat -local Hats = {} -- key of unitID of hat, value of wearer unitID +local Hats = {} -- key of unitID of hat, value of wearer unitID local spGetUnitHealth = Spring.GetUnitHealth local spSetUnitArmored = Spring.SetUnitArmored @@ -467,9 +465,8 @@ local function CreateAndGiveHat(hatDefID, unitPosX, unitPosY, unitPosZ, teamID) end function gadget:GameFrame(gf) - if (gf == spawnWarpInFrame and not spawnAwardsProcessed) then + if gf == spawnWarpInFrame and not spawnAwardsProcessed then for _, playerID in ipairs(spGetPlayerList() or {}) do - local accountID = nil local playerName, _, spec, teamID, _, _, _, _, _, _, accountInfo = spGetPlayerInfo(playerID) if accountInfo and accountInfo.accountid then @@ -493,7 +490,7 @@ function gadget:GameFrame(gf) for i = 1, #PlayerCosmeticList[accountID] do local cosmetic = PlayerCosmeticList[accountID][i] if CosmeticDefinitions[cosmetic] and CosmeticDefinitions[cosmetic].faction[playerFaction] then - playerCosmeticOptions[CosmeticDefinitions[cosmetic].slot][#playerCosmeticOptions[CosmeticDefinitions[cosmetic].slot]+1] = CosmeticDefinitions[cosmetic] + playerCosmeticOptions[CosmeticDefinitions[cosmetic].slot][#playerCosmeticOptions[CosmeticDefinitions[cosmetic].slot] + 1] = CosmeticDefinitions[cosmetic] end end @@ -519,7 +516,7 @@ function gadget:GameFrame(gf) local unitID = units[k] if not unitDefHat[unitID] then local unitDefID = spGetUnitDefID(unitID) - if stringSub(UnitDefs[unitDefID].name, 1, 3) == 'arm' then + if stringSub(UnitDefs[unitDefID].name, 1, 3) == "arm" then local scriptEnv = spGetUnitScriptEnv(unitID) if scriptEnv then if scriptEnv[list[pick].scriptCall] then @@ -564,11 +561,9 @@ end --Returns piece position and direction in world space. The direction (dirX, dirY, dirZ) is not necessarily normalized. The position is defined as the position of the first vertex of the piece and it defines direction as the direction in which the line --from the first vertex to the second vertex points. -> e.g. hats need two null vertices - function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) -- for unitID reuse, just in case if unitDefHat[unitDefID] then - if DEBUG then Spring.Echo("hat created", unitID, unitDefID, unitTeam, builderID) end @@ -615,7 +610,6 @@ function gadget:UnitGiven(unitID, unitDefID, unitTeam) unitsWearingHats[unitID] = nil end if Hats[unitID] then - local hatID = unitID if unitTeam == spGetGaiaTeamID() then if DEBUG then @@ -633,7 +627,6 @@ function gadget:UnitGiven(unitID, unitDefID, unitTeam) for ct, nearunitID in pairs(Spring.GetUnitsInCylinder(hx, hz, 200, unitTeam)) do local neardefID = Spring.GetUnitDefID(nearunitID) if unitDefCanWearHats[neardefID] then - if DEBUG then Spring.Echo("Found a wearer", nearunitID, hatID, unitDefID, unitTeam) end diff --git a/luarules/gadgets/unit_healthbars_widget_forwarding.lua b/luarules/gadgets/unit_healthbars_widget_forwarding.lua index a50c32e715d..aab3bfe6f7e 100644 --- a/luarules/gadgets/unit_healthbars_widget_forwarding.lua +++ b/luarules/gadgets/unit_healthbars_widget_forwarding.lua @@ -2,19 +2,17 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Healthbars Widget Forwarding", - desc = "Notifies widgets that a feature reclaim or resurrect action has begun, updates GL Uniforms, and also notifies on capture start, emp damage, reload", - author = "Beherith", -- ty Sprung - date = "2021.11.25", - license = "GNU GPL, v2 or later", - layer = -1, - enabled = true + name = "Healthbars Widget Forwarding", + desc = "Notifies widgets that a feature reclaim or resurrect action has begun, updates GL Uniforms, and also notifies on capture start, emp damage, reload", + author = "Beherith", -- ty Sprung + date = "2021.11.25", + license = "GNU GPL, v2 or later", + layer = -1, + enabled = true, } end - if gadgetHandler:IsSyncedCode() then - local SendToUnsynced = SendToUnsynced local spGetGameFrame = Spring.GetGameFrame local spGetUnitWeaponState = Spring.GetUnitWeaponState @@ -35,8 +33,8 @@ if gadgetHandler:IsSyncedCode() then local gf = spGetGameFrame() --Spring.Echo("AllowFeatureBuildStep",gf,builderID, builderTeam, featureID, featureDefID, step) if forwardedFeatureIDs[featureID] == nil or forwardedFeatureIDs[featureID] < gf then - forwardedFeatureIDs[featureID] = gf - SendToUnsynced("featureReclaimFrame", featureID, step) + forwardedFeatureIDs[featureID] = gf + SendToUnsynced("featureReclaimFrame", featureID, step) end return true end @@ -71,7 +69,7 @@ if gadgetHandler:IsSyncedCode() then for i = 1, #weapons do local WeaponDefID = weapons[i].weaponDef local WeaponDef = WeaponDefs[WeaponDefID] - if WeaponDef.reload and WeaponDef.reload >0 and WeaponDef.reload >= longestreloadtime then + if WeaponDef.reload and WeaponDef.reload > 0 and WeaponDef.reload >= longestreloadtime then longestreloadtime = WeaponDef.reload watchweaponID = WeaponDefID longestreloadindex = i @@ -85,14 +83,14 @@ if gadgetHandler:IsSyncedCode() then end end - function gadget:ProjectileCreated(projectileID, ownerID, weaponID) -- needs: Script.SetWatchProjectile(weaponDefID, true) + function gadget:ProjectileCreated(projectileID, ownerID, weaponID) -- needs: Script.SetWatchProjectile(weaponDefID, true) --local unitDef = Spring.GetUnitDefID(ownerID) --Spring.Echo("gadget:ProjectileCreated(",projectileID, ownerID, weaponID,weapondefsreload[weaponID],unitreloadframe[ownerID], ")") local weaponIndex = weapondefsreload[weaponID] if weaponIndex then local gf = spGetGameFrame() - local reloadFrame = spGetUnitWeaponState(ownerID, weaponIndex, 'reloadFrame') + local reloadFrame = spGetUnitWeaponState(ownerID, weaponIndex, "reloadFrame") if unitreloadframe[ownerID] == nil or unitreloadframe[ownerID] <= gf then SendToUnsynced("projetileCreatedReload", projectileID, ownerID, weaponID) @@ -100,14 +98,12 @@ if gadgetHandler:IsSyncedCode() then end end end - else - local glSetFeatureBufferUniforms = gl.SetFeatureBufferUniforms local GetFeatureResources = Spring.GetFeatureResources local GetFeaturePosition = Spring.GetFeaturePosition local IsPosInLos = Spring.IsPosInLos - local rezreclaim = {0.0, 1.0} -- this is just a small table cache, so we dont allocate a new table for every update + local rezreclaim = { 0.0, 1.0 } -- this is just a small table cache, so we dont allocate a new table for every update local forwardedFeatureIDsResurrect = {} -- so we only forward the start event once local forwardedFeatureIDsReclaim = {} -- so we only forward the start event once local myTeamID = Spring.GetMyTeamID() @@ -132,28 +128,32 @@ else end end - rezreclaim[1] = select(3, GetFeatureHealth( featureID )) -- resurrect progress + rezreclaim[1] = select(3, GetFeatureHealth(featureID)) -- resurrect progress rezreclaim[2] = select(5, GetFeatureResources(featureID)) -- reclaim percent --Spring.Echo('rezreclaim', rezreclaim[1], rezreclaim[2]) - if not headless then glSetFeatureBufferUniforms(featureID, rezreclaim, 1) end -- update GL, at offset of 1 + if not headless then + glSetFeatureBufferUniforms(featureID, rezreclaim, 1) + end -- update GL, at offset of 1 if step > 0 and forwardedFeatureIDsResurrect[featureID] == nil and Script.LuaUI("FeatureReclaimStartedHealthbars") then - forwardedFeatureIDsResurrect[featureID] = true - --Spring.Echo("HandleFeatureReclaimStartedHealthbars", featureID, step) - Script.LuaUI.FeatureReclaimStartedHealthbars(featureID, step) + forwardedFeatureIDsResurrect[featureID] = true + --Spring.Echo("HandleFeatureReclaimStartedHealthbars", featureID, step) + Script.LuaUI.FeatureReclaimStartedHealthbars(featureID, step) end if step < 0 and forwardedFeatureIDsReclaim[featureID] == nil and Script.LuaUI("FeatureReclaimStartedHealthbars") then - forwardedFeatureIDsReclaim[featureID] = true - --Spring.Echo("HandleFeatureReclaimStartedHealthbars", featureID, step) - Script.LuaUI.FeatureReclaimStartedHealthbars(featureID, step) + forwardedFeatureIDsReclaim[featureID] = true + --Spring.Echo("HandleFeatureReclaimStartedHealthbars", featureID, step) + Script.LuaUI.FeatureReclaimStartedHealthbars(featureID, step) end end function unitCaptureFrame(cmd, unitID, step) - if not fullview and not IsUnitInLos(unitID, myAllyTeamID) then return end + if not fullview and not IsUnitInLos(unitID, myAllyTeamID) then + return + end if Script.LuaUI("UnitCaptureStartedHealthbars") then --Spring.Echo("UnitCaptureStartedHealthbars", unitID, step) Script.LuaUI.UnitCaptureStartedHealthbars(unitID, step) @@ -178,7 +178,9 @@ else function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) --Spring.Echo("gadget:UnitDamaged",unitID, unitDefID, unitTeam, damage, paralyzer) if paralyzer then - if not fullview and not IsUnitInLos(unitID, myAllyTeamID) then return end + if not fullview and not IsUnitInLos(unitID, myAllyTeamID) then + return + end if damage > 0 then if Script.LuaUI("UnitParalyzeDamageHealthbars") then diff --git a/luarules/gadgets/unit_icongenerator.lua b/luarules/gadgets/unit_icongenerator.lua index fb480e5c83b..3c011bb4aa1 100644 --- a/luarules/gadgets/unit_icongenerator.lua +++ b/luarules/gadgets/unit_icongenerator.lua @@ -16,7 +16,8 @@ example usage (need cheats): /luarules buildicons all /luarules buildicon armcom -]]-- +]] +-- --TODO: --1. make blue water drop 256 --2. fix the culling of floating structures @@ -32,15 +33,13 @@ function gadget:GetInfo() date = "Oct 01, 2008", license = "GNU GPL, v2 or later", layer = -10, - enabled = true + enabled = true, } end --local renderOverlay = false if gadgetHandler:IsSyncedCode() then - - local units = {} local createunits = {} local curTeam @@ -75,13 +74,13 @@ if gadgetHandler:IsSyncedCode() then local lus = false local x, z = nextUnitX, nextUnitZ nextUnitX = nextUnitX + 200 - if (nextUnitX >= Game.mapSizeX) then + if nextUnitX >= Game.mapSizeX then nextUnitX, nextUnitZ = 100, nextUnitZ + 200 end local y = Spring.GetGroundHeight(0, 0) Spring.LevelHeightMap(x - 50, z - 50, x + 50, z + 50, y) - local uid = Spring.CreateUnit(cunit.defname, x, y, z, "south", 0) -- FIXME needs to be a non-gaia team if gaia doesn't have its unitlimit assigned + local uid = Spring.CreateUnit(cunit.defname, x, y, z, "south", 0) -- FIXME needs to be a non-gaia team if gaia doesn't have its unitlimit assigned if uid then units[#units + 1] = { id = uid, defname = cunit.defname, frame = n + cunit.time } @@ -125,7 +124,6 @@ if gadgetHandler:IsSyncedCode() then Spring.CallCOBScript(uid, "AimTertiary", 0, Spring.GetHeadingFromVector(0, 1), angle) Spring.CallCOBScript(uid, "AimWeapon3", 0, Spring.GetHeadingFromVector(0, 1), angle) - end end end @@ -141,7 +139,9 @@ if gadgetHandler:IsSyncedCode() then end function gadget:RecvLuaMsg(msg, playerID) - if #msg < 9 or string.byte(msg, 1) ~= 98 or msg:sub(1, 9) ~= "buildicon" then return end -- 98 = 'b' + if #msg < 9 or string.byte(msg, 1) ~= 98 or msg:sub(1, 9) ~= "buildicon" then + return + end -- 98 = 'b' if not Spring.IsCheatingEnabled() then Spring.SendMessageToPlayer(playerID, "Cheating must be enabled") return true @@ -169,7 +169,6 @@ if gadgetHandler:IsSyncedCode() then return true end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- else @@ -444,13 +443,13 @@ else gl_FragData[0] = color1; - ]] .. (((not textured) and '/*') or '') .. [[ - vec3 lightPos = vec3(]] .. (lightPos[1] .. ',' .. lightPos[2] .. ',' .. lightPos[3]) .. [[); - vec3 lightDiffuse = vec3(]] .. (lightDiffuse[1] .. ',' .. lightDiffuse[2] .. ',' .. lightDiffuse[3]) .. [[); - vec3 lightAmbient = vec3(]] .. (lightAmbient[1] .. ',' .. lightAmbient[2] .. ',' .. lightAmbient[3]) .. [[); + ]] .. (((not textured) and "/*") or "") .. [[ + vec3 lightPos = vec3(]] .. (lightPos[1] .. "," .. lightPos[2] .. "," .. lightPos[3]) .. [[); + vec3 lightDiffuse = vec3(]] .. (lightDiffuse[1] .. "," .. lightDiffuse[2] .. "," .. lightDiffuse[3]) .. [[); + vec3 lightAmbient = vec3(]] .. (lightAmbient[1] .. "," .. lightAmbient[2] .. "," .. lightAmbient[3]) .. [[); gl_FragData[0].rgb = albedo.rgb * (max(dot(normal.xyz,lightPos),0.0) * lightDiffuse + lightAmbient); gl_FragData[0].rgb *= min(vec3(1.0),color1.rgb); - ]] .. (((not textured) and '*/') or '') .. [[ + ]] .. (((not textured) and "*/") or "") .. [[ gl_FragData[0] = mix(gl_FragData[0], vec4(0.0,0.0,0.0,1.0), ol); // outline } @@ -536,7 +535,7 @@ else gl_FragData[0] = vec4(0.0); gl_FragData[1] = vec4(0.0); } - ]] + ]], }) if not clear_shader then @@ -635,7 +634,6 @@ else return top, left, bottom, right end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -694,7 +692,7 @@ else gl.PushMatrix() gl.LoadIdentity() - if (uid) then + if uid then gl.UnitTextures(uid, true) gl.UnitRaw(uid, true, -1) gl.UnitTextures(uid, false) @@ -767,7 +765,7 @@ else for i = 1, cnt - 1 do for n = 1, 4 do elements[#elements + 1] = { - v = {} + v = {}, } end end @@ -812,12 +810,11 @@ else if UnitDefs[unitdefid].levelGround == false then amfibianunit = true end - end if (UnitDefs[unitdefid].maxWaterDepth ~= nil and UnitDefs[unitdefid].maxWaterDepth >= 255 and (UnitDefs[unitdefid].waterline == nil or UnitDefs[unitdefid].waterline <= 0)) and (UnitDefs[unitdefid].minWaterDepth == nil or UnitDefs[unitdefid].minWaterDepth <= 0) then amfibianunit = true end - if (UnitDefs[unitdefid].isBuilder == true and UnitDefs[unitdefid].canMove == true) or (UnitDefs[unitdefid].name == 'armnanotc' or UnitDefs[unitdefid].name == 'armnanotcplat' or UnitDefs[unitdefid].name == 'cornanotc' or UnitDefs[unitdefid].name == 'cornanotcplat') then + if (UnitDefs[unitdefid].isBuilder == true and UnitDefs[unitdefid].canMove == true) or (UnitDefs[unitdefid].name == "armnanotc" or UnitDefs[unitdefid].name == "armnanotcplat" or UnitDefs[unitdefid].name == "cornanotc" or UnitDefs[unitdefid].name == "cornanotcplat") then builderunit = true end @@ -979,17 +976,17 @@ else local function GetFaction(unitdef) local name = unitdef.name if string.find(name, "_scav") then - return 'scav' + return "scav" elseif string.sub(name, 1, 3) == "arm" then - return 'arm' + return "arm" elseif string.sub(name, 1, 3) == "cor" then - return 'cor' + return "cor" elseif string.sub(name, 1, 3) == "leg" then - return 'legion' - elseif string.find(name, 'raptor') then - return 'raptor' + return "legion" + elseif string.find(name, "raptor") then + return "raptor" end - return 'unknown' + return "unknown" end local function CreateIcon(udid, uid) @@ -1002,7 +999,7 @@ else local left, bottom = 0, 0 local width, height = 0, 0 - if (not cfg.empty) then + if not cfg.empty then repeat myGLClear() @@ -1020,29 +1017,26 @@ else end) attempts = attempts + 1 - until (result or (attempts >= cfg.attempts)) + until result or (attempts >= cfg.attempts) else myGLClear() end --// take screenshot gl.ActiveFBO(final_fbo, true, function() - gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.Color(1, 1, 1, 1) - if (background) then + if background then Background(udid) end - if (halo) then + if halo then gl.UseShader(halo_shader) gl.Blending("add") gl.BlendEquationSeparate(0x8006, 0x8008) gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE) gl.Texture(2, depth_tex) - gl.TexRect(-1, -1, 1, 1, - left / (renderX), bottom / (renderY), - (left + width) / (renderX), (bottom + height) / (renderY)) + gl.TexRect(-1, -1, 1, 1, left / renderX, bottom / renderY, (left + width) / renderX, (bottom + height) / renderY) gl.Texture(2, false) gl.BlendEquationSeparate(0x8006, 0x8006) gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ZERO) @@ -1051,9 +1045,7 @@ else gl.Blending("reset") gl.Texture(post_tex) - gl.TexRect(-1, -1, 1, 1, - left / (renderX), bottom / (renderY), - (left + width) / (renderX), (bottom + height) / (renderY)) + gl.TexRect(-1, -1, 1, 1, left / renderX, bottom / renderY, (left + width) / renderX, (bottom + height) / renderY) --if renderOverlay then -- Overlay(udid) -- draw water drop if water unit --end @@ -1061,11 +1053,11 @@ else gl.Blending(false) gl.Texture(false) - local outfile = (outdir) .. "/" .. (UnitDefs[udid].name) + local outfile = outdir .. "/" .. UnitDefs[udid].name if cfg.frame ~= nil then - outfile = outfile .. '_' .. cfg.frame + outfile = outfile .. "_" .. cfg.frame end - outfile = outfile .. (imageExt) + outfile = outfile .. imageExt --if (VFS.FileExists(outfile, VFS.RAW)) then -- os.remove(outfile) @@ -1074,13 +1066,12 @@ else gl.SaveImage(0, 0, iconX, iconY, outfile, { alpha = true }) end) - if (not result and not cfg.empty) then - Spring.Log(gadget:GetInfo().name, LOG.ERROR, "icongen: " .. (UnitDefs[udid].name) .. ": give up :<") + if not result and not cfg.empty then + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "icongen: " .. UnitDefs[udid].name .. ": give up :<") end end local function AddUnitJob(udid, angle, frame) - --// generate unit icon settings (and merge defaults) local cfg = unitConfigs[udid] or {} autoConfigs[udid] = {} @@ -1095,7 +1086,7 @@ else unitConfigs[udid].frame = frame end - if (cfg.unfold) then + if cfg.unfold then --// unit does some unfolding/animation in cob, --// so we need to create it first @@ -1103,13 +1094,7 @@ else local factionTeam = factionTeams[GetFaction(UnitDefs[udid] or {})] - local msg = "buildicon " .. - UnitDefs[udid].name .. ";" .. - ((cfg.attack and "1") or "0") .. ";" .. - ((cfg.move and "1") or "0") .. ";" .. - factionTeam .. ";" .. - (cfg.wait) .. ";" .. - (cfg.shotangle or "0") .. ";" + local msg = "buildicon " .. UnitDefs[udid].name .. ";" .. ((cfg.attack and "1") or "0") .. ";" .. ((cfg.move and "1") or "0") .. ";" .. factionTeam .. ";" .. cfg.wait .. ";" .. (cfg.shotangle or "0") .. ";" Spring.SendLuaRulesMsg(msg) return @@ -1132,7 +1117,7 @@ else local schemes, resolutions, ratios = {}, {}, {} local function BuildIcon(cmd, line, words, playerID) - if (not Spring.IsCheatingEnabled()) then + if not Spring.IsCheatingEnabled() then Spring.Echo("Cheating must be enabled") return false end @@ -1140,12 +1125,12 @@ else -- Spring.Echo("ModUICtrl is needed (type /luamoduictrl 1)") -- return false --end - if (final_tex or #jobs > 0) then + if final_tex or #jobs > 0 then Spring.Echo("Wait until current process is finished") return false end - if (words[1] and words[1] ~= "all" and not UnitDefNames[words[1]]) then + if words[1] and words[1] ~= "all" and not UnitDefNames[words[1]] then Spring.Echo("No such unit found") return false end @@ -1154,8 +1139,6 @@ else for _, res in pairs(resolutions) do for _, _scheme in pairs(schemes) do for _ratio_name, _ratio in pairs(ratios) do - - AddJob(FreeResources) AddJob(WaitForSyncedJobs) @@ -1163,7 +1146,7 @@ else AddJob(function() AddUnitJob(UnitDefNames[words[1]].id, words[2], words[3]) end) - Spring.Echo('buildicon: ' .. words[1] .. ' ' .. (words[3] or '')) + Spring.Echo("buildicon: " .. words[1] .. " " .. (words[3] or "")) else for udid = #UnitDefs, 1, -1 do AddJob(function() @@ -1179,12 +1162,12 @@ else ratio, ratio_name = _ratio, _ratio_name iconX, iconY = res[1], res[2] - outdir = "buildicons/" .. (scheme) .. "_" .. (ratio_name) .. "_" .. (iconX) .. "x" .. (iconY) + outdir = "buildicons/" .. scheme .. "_" .. ratio_name .. "_" .. iconX .. "x" .. iconY Spring.CreateDir(outdir) if words[3] then -- if animation - outdir = "buildicons/" .. (scheme) .. "_" .. (ratio_name) .. "_" .. (iconX) .. "x" .. (iconY) .. '/' .. words[1] + outdir = "buildicons/" .. scheme .. "_" .. ratio_name .. "_" .. iconX .. "x" .. iconY .. "/" .. words[1] Spring.CreateDir(outdir) end diff --git a/luarules/gadgets/unit_infestor_spawn.lua b/luarules/gadgets/unit_infestor_spawn.lua index b88284d334f..c10123b0705 100644 --- a/luarules/gadgets/unit_infestor_spawn.lua +++ b/luarules/gadgets/unit_infestor_spawn.lua @@ -11,7 +11,7 @@ function gadget:GetInfo() date = "Nov 21, 2023", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -19,30 +19,27 @@ if not gadgetHandler:IsSyncedCode() then return false end - - local infestor = {} -- setup if UnitDefNames.leginfestor then - infestor[UnitDefNames.leginfestor.id] = true + infestor[UnitDefNames.leginfestor.id] = true - if (UnitDefNames.leginfestor_scav) then - infestor[UnitDefNames.leginfestor_scav.id] = true - end + if UnitDefNames.leginfestor_scav then + infestor[UnitDefNames.leginfestor_scav.id] = true + end end function gadget:Initialize() - if table.count(infestor) <= 0 then - gadgetHandler:RemoveGadget(self) - end + if table.count(infestor) <= 0 then + gadgetHandler:RemoveGadget(self) + end end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if (builderID) then - if infestor[unitDefID] and infestor[Spring.GetUnitDefID(builderID)] then - Spring.GiveOrderToUnit(unitID, CMD.GUARD, { builderID }, { "shift" }) - end - end + if builderID then + if infestor[unitDefID] and infestor[Spring.GetUnitDefID(builderID)] then + Spring.GiveOrderToUnit(unitID, CMD.GUARD, { builderID }, { "shift" }) + end + end end - diff --git a/luarules/gadgets/unit_inherit_creation_xp.lua b/luarules/gadgets/unit_inherit_creation_xp.lua index 984cdebb70e..3d360f7cee4 100644 --- a/luarules/gadgets/unit_inherit_creation_xp.lua +++ b/luarules/gadgets/unit_inherit_creation_xp.lua @@ -8,12 +8,14 @@ function gadget:GetInfo() date = "May 2024", license = "Public domain", layer = 0, - enabled = true + enabled = true, } end -- synced only -if not gadgetHandler:IsSyncedCode() then return false end +if not gadgetHandler:IsSyncedCode() then + return false +end --**********unit customparams to add to unitdef*********** -- inheritxpratemultiplier = 1, -- defined in unitdef customparams of the parent unit. It's a number by which XP gained by children is multiplied and passed to the parent after power difference calculations @@ -43,11 +45,13 @@ for id, def in pairs(UnitDefs) do end if def.customParams.parentsinheritxp then parentsInheritXP[id] = def.customParams.parentsinheritxp or " " - else parentsInheritXP[id] = " " + else + parentsInheritXP[id] = " " end if def.customParams.childreninheritxp then childrenInheritXP[id] = def.customParams.childreninheritxp or " " - else childrenInheritXP[id] = " " + else + childrenInheritXP[id] = " " end if def.speed and def.speed ~= 0 then mobileUnits[id] = true @@ -85,7 +89,7 @@ local initializeList = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) local createdDefID = spGetUnitDefID(unitID) local builderDefID = builderID and spGetUnitDefID(builderID) - if builderID and mobileUnits[createdDefID] and string.find(parentsInheritXP[builderDefID], "MOBILEBUILT") then -- only mobile combat units will pass xp + if builderID and mobileUnits[createdDefID] and string.find(parentsInheritXP[builderDefID], "MOBILEBUILT") then -- only mobile combat units will pass xp childrenWithParents[unitID] = { unitid = unitID, parentunitid = builderID, @@ -94,7 +98,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) childtype = "MOBILEBUILT", } end - if builderID and turretUnits[createdDefID] and string.find(parentsInheritXP[builderDefID], "TURRET") then -- only immobile combat units will pass xp + if builderID and turretUnits[createdDefID] and string.find(parentsInheritXP[builderDefID], "TURRET") then -- only immobile combat units will pass xp childrenWithParents[unitID] = { unitid = unitID, parentunitid = builderID, @@ -102,7 +106,7 @@ function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) childinheritsXP = childrenInheritXP[createdDefID], childtype = "TURRET", } -end + end end function gadget:UnitFinished(unitID, unitDefID, unitTeam) @@ -111,7 +115,7 @@ end local oldChildXPValues = {} function gadget:GameFrame(frame) - if frame%30 == 0 then + if frame % 30 == 0 then local parentID for unitID, value in pairs(initializeList) do local unitDefID = spGetUnitDefID(unitID) @@ -155,14 +159,13 @@ function gadget:GameFrame(frame) local initMult = inheritCreationXP[parentDefID] or 1 local childInitXP = parentXP * initMult spSetUnitExperience(unitID, childInitXP) - oldChildXPValues[unitID] = childInitXP --add parent xp to the oldxp value to exclude it from inheritance + oldChildXPValues[unitID] = childInitXP --add parent xp to the oldxp value to exclude it from inheritance end end initializeList[unitID] = nil -- this concludes innitialization end - for unitID, value in pairs(childrenWithParents) do local oldXP = oldChildXPValues[unitID] or 0 local newXP = spGetUnitExperience(unitID) or 0 @@ -170,7 +173,7 @@ function gadget:GameFrame(frame) parentID = childrenWithParents[unitID].parentunitid local parentXP = spGetUnitExperience(parentID) or 0 local multiplier = childrenWithParents[unitID].parentxpmultiplier - local gainedXP = parentXP+((newXP-oldXP)*multiplier) + local gainedXP = parentXP + ((newXP - oldXP) * multiplier) oldChildXPValues[unitID] = newXP spSetUnitExperience(parentID, gainedXP) end @@ -179,7 +182,6 @@ function gadget:GameFrame(frame) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - local evoID = Spring.GetUnitRulesParam(unitID, "unit_evolved") if evoID then for id, data in pairs(childrenWithParents) do diff --git a/luarules/gadgets/unit_instant_self_destruct.lua b/luarules/gadgets/unit_instant_self_destruct.lua index dfee4ed7870..da0e90690cf 100644 --- a/luarules/gadgets/unit_instant_self_destruct.lua +++ b/luarules/gadgets/unit_instant_self_destruct.lua @@ -4,25 +4,25 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Instant Self Destruct", - desc = "Replaces engine self-d behaviour for a set of units such that they self-destruct instantly.", - author = "Google Frog", - date = "21 September, 2013", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Instant Self Destruct", + desc = "Replaces engine self-d behaviour for a set of units such that they self-destruct instantly.", + author = "Google Frog", + date = "21 September, 2013", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (not gadgetHandler:IsSyncedCode()) then - return false -- no unsynced code +if not gadgetHandler:IsSyncedCode() then + return false -- no unsynced code end local selfddefs = {} -for i=1,#UnitDefs do +for i = 1, #UnitDefs do if UnitDefs[i].customParams and UnitDefs[i].customParams.instantselfd then selfddefs[i] = true end @@ -33,7 +33,7 @@ local spGetUnitIsStunned = Spring.GetUnitIsStunned local spDestroyUnit = Spring.DestroyUnit function gadget:AllowCommand_GetWantedCommand() - return {[CMD_SELFD] = true} + return { [CMD_SELFD] = true } end function gadget:AllowCommand_GetWantedUnitDefID() diff --git a/luarules/gadgets/unit_interceptors.lua b/luarules/gadgets/unit_interceptors.lua index 5b5c8a56c55..8509a08ad43 100644 --- a/luarules/gadgets/unit_interceptors.lua +++ b/luarules/gadgets/unit_interceptors.lua @@ -2,18 +2,18 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Don't target flyover nukes", - desc = "Antinukes can target flyover nukes, this gadget ensures that they dont.", - author = "Beherith", - date = "2023.11.09", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Don't target flyover nukes", + desc = "Antinukes can target flyover nukes, this gadget ensures that they dont.", + author = "Beherith", + date = "2023.11.09", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end if not gadgetHandler:IsSyncedCode() then - return false -- no unsynced code + return false -- no unsynced code end -- Localize and pre-compute things @@ -23,39 +23,39 @@ local spGetUnitPosition = Spring.GetUnitPosition local spGetFeaturePosition = Spring.GetFeaturePosition local spGetProjectilePosition = Spring.GetProjectilePosition -local unitTargetType = string.byte('u') -local featureTargetType = string.byte('f') -local groundTargetType = string.byte('g') -local projectileTargetType = string.byte('p') +local unitTargetType = string.byte("u") +local featureTargetType = string.byte("f") +local groundTargetType = string.byte("g") +local projectileTargetType = string.byte("p") -- Hashes (100000 * interceptorweaponID + unitDefID) to coveragesquared. This, along with other above optimizations make this significantly (100x) faster -local interceptorUnitDefWeapCovSqr = {} +local interceptorUnitDefWeapCovSqr = {} function gadget:AllowWeaponInterceptTarget(interceptorUnitID, interceptorWeaponID, targetProjectileID) --interceptorWeaponID is actually weaponNum, e.g.: gadget:AllowWeaponInterceptTarget( 24871, 1, 6540) --old method using the below method hammered cache hard: --local coverageRange = WeaponDefs[UnitDefs[Spring.GetUnitDefID(interceptorUnitID)].weapons[interceptorWeaponID].weaponDef].coverageRange - --Spring.GetProjectileTarget( number projectileID ) -> nil | [number targetTypeInt, number targetID | table targetPos = {x, y, z}] + --Spring.GetProjectileTarget( number projectileID ) -> nil | [number targetTypeInt, number targetID | table targetPos = {x, y, z}] local targetType, targetID = spGetProjectileTarget(targetProjectileID) - if targetType then + if targetType then local unitDefID = spGetUnitDefID(interceptorUnitID) local covSquared = interceptorUnitDefWeapCovSqr[100000 * interceptorWeaponID + unitDefID] - + local ox, _, oz = spGetUnitPosition(interceptorUnitID) local tx, ty, tz - if targetType == unitTargetType then -- unit - tx, ty, tz = spGetUnitPosition(targetID) - elseif targetType == featureTargetType then -- feature - tx, ty, tz = spGetFeaturePosition(targetID) - elseif targetType == projectileTargetType then --PROJECTILE - tx, ty, tz = spGetProjectilePosition(targetID) - elseif targetType == groundTargetType then -- ground - tx, tz = targetID[1], targetID[3] - end + if targetType == unitTargetType then -- unit + tx, ty, tz = spGetUnitPosition(targetID) + elseif targetType == featureTargetType then -- feature + tx, ty, tz = spGetFeaturePosition(targetID) + elseif targetType == projectileTargetType then --PROJECTILE + tx, ty, tz = spGetProjectilePosition(targetID) + elseif targetType == groundTargetType then -- ground + tx, tz = targetID[1], targetID[3] + end - return (ox - tx)*(ox - tx) + (oz - tz)*(oz - tz) < covSquared - end + return (ox - tx) * (ox - tx) + (oz - tz) * (oz - tz) < covSquared + end end function gadget:Initialize() @@ -64,7 +64,7 @@ function gadget:Initialize() for weaponNum = 1, #weapons do local WeaponDefID = weapons[weaponNum].weaponDef local WeaponDef = WeaponDefs[WeaponDefID] - if WeaponDef.coverageRange and WeaponDef.coverageRange > 0 then + if WeaponDef.coverageRange and WeaponDef.coverageRange > 0 then interceptorUnitDefWeapCovSqr[100000 * weaponNum + unitDefID] = WeaponDef.coverageRange * WeaponDef.coverageRange end if WeaponDef.interceptor > 0 and WeaponDef.coverageRange then diff --git a/luarules/gadgets/unit_intergrated_hats.lua b/luarules/gadgets/unit_intergrated_hats.lua index 9f7e1478e66..e63e95b1f57 100644 --- a/luarules/gadgets/unit_intergrated_hats.lua +++ b/luarules/gadgets/unit_intergrated_hats.lua @@ -2,21 +2,21 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Intergrated Hats", - desc = "Hides hats used for april and alike events, hats get baked into models swapped in in alldefs post", - author = "", - date = "1st Of April", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Intergrated Hats", + desc = "Hides hats used for april and alike events, hats get baked into models swapped in in alldefs post", + author = "", + date = "1st Of April", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end -- Authors: -- robert the pie; scripts, hats: --- baseball cap, football helmet, mini rocket pod, shoulder spikes, mahwak, pool floaty, +-- baseball cap, football helmet, mini rocket pod, shoulder spikes, mahwak, pool floaty, -- mini pawn head, chess pawn, party hat, fedora, tophat, weird arms, UNICORN CATHAT -- the silver hornet; hats: --- hard hat, construction cone, jester, proppeler hat, sunhat(unused), +-- hard hat, construction cone, jester, proppeler hat, sunhat(unused), -- synced space only, the hats arent part of the modified models, hiding them is a synced animation action if not gadgetHandler:IsSyncedCode() then @@ -38,33 +38,32 @@ do end if hats then - -- count of how many hats a unit has for the hat mode -- unit models should be swapped out to the appropate models via all defs post local hatCountsTemp = {} local hatTable = { april = { -- objects3d/units/events/aprilfools, AprilFools hats - corak=7, - corstorm=7, - corck=6, - corack=6, + corak = 7, + corstorm = 7, + corck = 6, + corack = 6, --correap=6, - corllt=8, - corhllt=8, - cordemon=4, - armpw=7, - armcv=5, - armrock=6, - armbull=6, - armllt=6, - corwin=7, - armwin=6, - armham=5, + corllt = 8, + corhllt = 8, + cordemon = 4, + armpw = 7, + armcv = 5, + armrock = 6, + armbull = 6, + armllt = 6, + corwin = 7, + armwin = 6, + armham = 5, --corthud=6, }, halloween = { - corcom=2, - } + corcom = 2, + }, } hatCountsTemp = hatTable[hats] @@ -86,7 +85,6 @@ do end function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) - -- we increment every time a unit is made, makes for a good rng in our case unitCount = unitCount + 1 @@ -98,11 +96,11 @@ function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) local hatRoll = unitCount % numberOfHats + 1 for i = 1, numberOfHats do if i ~= hatRoll then - Spring.SetUnitPieceVisible(unitID, unitPieceList["h"..i], false) + Spring.SetUnitPieceVisible(unitID, unitPieceList["h" .. i], false) else -- hats should be zeroed so that when on 0,0,0 they are where they should be, otherwise buried in the ground -- (the 16 numbers is a matrix that positions them at 0,0,0, of scale 1,1,1, unrotated (rotation gets baked in, in upspring)) - Spring.SetUnitPieceMatrix(unitID, unitPieceList["h"..i], { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}) + Spring.SetUnitPieceMatrix(unitID, unitPieceList["h" .. i], { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }) end end end diff --git a/luarules/gadgets/unit_juno_damage.lua b/luarules/gadgets/unit_juno_damage.lua index ab9e38fe186..6d1be4f9c80 100644 --- a/luarules/gadgets/unit_juno_damage.lua +++ b/luarules/gadgets/unit_juno_damage.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Juno Damage', - desc = 'Handles Juno damage', - author = 'Niobium, Bluestone', - version = 'v2.0', - date = '05/2013', - license = 'GNU GPL, v2 or later', + name = "Juno Damage", + desc = "Handles Juno damage", + author = "Niobium, Bluestone", + version = "v2.0", + date = "05/2013", + license = "GNU GPL, v2 or later", layer = 0, - enabled = not Spring.GetModOptions().junorework + enabled = not Spring.GetModOptions().junorework, } end @@ -17,72 +17,71 @@ end -- Synced only ---------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - ---------------------------------------------------------------- -- Config ---------------------------------------------------------------- local tokillUnitsNames = { - ['armarad'] = true, - ['armaser'] = true, - ['armason'] = true, - ['armeyes'] = true, - ['armfrad'] = true, - ['armjam'] = true, - ['armjamt'] = true, - ['armmark'] = true, - ['armrad'] = true, - ['armseer'] = true, - ['armsjam'] = true, - ['armsonar'] = true, - ['armveil'] = true, - ['corarad'] = true, - ['corason'] = true, - ['coreter'] = true, - ['coreyes'] = true, - ['corfrad'] = true, - ['corjamt'] = true, - ['corrad'] = true, - ['legjam'] = true, - ['legrad'] = true, - ['corshroud'] = true, - ['corsjam'] = true, - ['corsonar'] = true, - ['corspec'] = true, - ['corvoyr'] = true, - ['corvrad'] = true, - ['legarad'] = true, - ['legajam'] = true, - ['legavrad'] = true, - ['legavjam'] = true, - ['legaradk'] = true, - ['legajamk'] = true, - ['legfrad'] = true, - - ['armmine1'] = true, - ['armmine2'] = true, - ['armmine3'] = true, - ['armfmine3'] = true, - ['cormine1'] = true, - ['cormine2'] = true, - ['cormine3'] = true, - ['cormine4'] = true, - ['corfmine3'] = true, - ['legmine1'] = true, - ['legmine2'] = true, - ['legmine3'] = true, - - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['legscout'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, - ['scavmist'] = true, - ['scavmistxl'] = true, - ['scavmistxxl'] = true, + ["armarad"] = true, + ["armaser"] = true, + ["armason"] = true, + ["armeyes"] = true, + ["armfrad"] = true, + ["armjam"] = true, + ["armjamt"] = true, + ["armmark"] = true, + ["armrad"] = true, + ["armseer"] = true, + ["armsjam"] = true, + ["armsonar"] = true, + ["armveil"] = true, + ["corarad"] = true, + ["corason"] = true, + ["coreter"] = true, + ["coreyes"] = true, + ["corfrad"] = true, + ["corjamt"] = true, + ["corrad"] = true, + ["legjam"] = true, + ["legrad"] = true, + ["corshroud"] = true, + ["corsjam"] = true, + ["corsonar"] = true, + ["corspec"] = true, + ["corvoyr"] = true, + ["corvrad"] = true, + ["legarad"] = true, + ["legajam"] = true, + ["legavrad"] = true, + ["legavjam"] = true, + ["legaradk"] = true, + ["legajamk"] = true, + ["legfrad"] = true, + + ["armmine1"] = true, + ["armmine2"] = true, + ["armmine3"] = true, + ["armfmine3"] = true, + ["cormine1"] = true, + ["cormine2"] = true, + ["cormine3"] = true, + ["cormine4"] = true, + ["corfmine3"] = true, + ["legmine1"] = true, + ["legmine2"] = true, + ["legmine3"] = true, + + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["legscout"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + ["scavmist"] = true, + ["scavmistxl"] = true, + ["scavmistxxl"] = true, } -- convert unitname -> unitDefID local tokillUnits = {} @@ -94,18 +93,18 @@ if gadgetHandler:IsSyncedCode() then tokillUnitsNames = nil local todenyUnitsNames = { - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['legscout'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, - ['scavmist'] = true, - ['scavmistxl'] = true, - ['scavmistxxl'] = true, + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["legscout"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + ["scavmist"] = true, + ["scavmistxl"] = true, + ["scavmistxxl"] = true, } -- convert unitname -> unitDefID local todenyUnits = {} @@ -116,23 +115,21 @@ if gadgetHandler:IsSyncedCode() then end todenyUnitsNames = nil - for udid, ud in pairs(UnitDefs) do for id, v in pairs(tokillUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then tokillUnits[udid] = v end end for id, v in pairs(todenyUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then todenyUnits[udid] = v end end end - --config -- see also in unsynced local radius = 450 --outer radius of area denial ring. This value is used in gui_attack_aoe.lua, make sure to keep them in sync local width = 30 --width of area denial ring @@ -162,7 +159,7 @@ if gadgetHandler:IsSyncedCode() then local DEBUG_JUNO_IMPACT = false local debugImpactX = 1300 local debugImpactZ = 2900 - local debugIntervalFrames = (effectlength + 5) * 30 -- effectlength seconds + 5 idle seconds, at 30fps + local debugIntervalFrames = (effectlength + 5) * 30 -- effectlength seconds + 5 idle seconds, at 30fps local stormPulseIntervalFrames = 33 local stormPulseJitterFrames = 15 @@ -305,7 +302,9 @@ if gadgetHandler:IsSyncedCode() then local jitterSeed = (expl.f or frame) * 0.021 + counter * 4.913 + expl.pulseCount * 1.771 local signedJitter = (hash01(jitterSeed) * 2 - 1) * stormPulseJitterFrames local nextInterval = Mfloor(stormPulseIntervalFrames + signedJitter) - if nextInterval < 8 then nextInterval = 8 end + if nextInterval < 8 then + nextInterval = 8 + end expl.nextStormFrame = frame + nextInterval end end @@ -605,7 +604,6 @@ else end - ]]-- - + ]] + -- end - diff --git a/luarules/gadgets/unit_juno_damage_mini.lua b/luarules/gadgets/unit_juno_damage_mini.lua index 8cf9fef5f02..abaffbef570 100644 --- a/luarules/gadgets/unit_juno_damage_mini.lua +++ b/luarules/gadgets/unit_juno_damage_mini.lua @@ -6,14 +6,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Juno Damage Mini', - desc = 'Handles Juno_mini damage', - author = 'Niobium, Bluestone', - version = 'v2.0', - date = '05/2013', - license = 'GNU GPL, v2 or later', + name = "Juno Damage Mini", + desc = "Handles Juno_mini damage", + author = "Niobium, Bluestone", + version = "v2.0", + date = "05/2013", + license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -21,72 +21,71 @@ end -- Synced only ---------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - ---------------------------------------------------------------- -- Config ---------------------------------------------------------------- local tokillUnitsNames = { - ['armarad'] = true, - ['armaser'] = true, - ['armason'] = true, - ['armeyes'] = true, - ['armfrad'] = true, - ['armjam'] = true, - ['armjamt'] = true, - ['armmark'] = true, - ['armrad'] = true, - ['armseer'] = true, - ['armsjam'] = true, - ['armsonar'] = true, - ['armveil'] = true, - ['corarad'] = true, - ['corason'] = true, - ['coreter'] = true, - ['coreyes'] = true, - ['corfrad'] = true, - ['corjamt'] = true, - ['corrad'] = true, - ['legjam'] = true, - ['legrad'] = true, - ['corshroud'] = true, - ['corsjam'] = true, - ['corsonar'] = true, - ['corspec'] = true, - ['corvoyr'] = true, - ['corvrad'] = true, - ['legarad'] = true, - ['legajam'] = true, - ['legavrad'] = true, - ['legavjam'] = true, - ['legaradk'] = true, - ['legajamk'] = true, - ['legfrad'] = true, - - ['armmine1'] = true, - ['armmine2'] = true, - ['armmine3'] = true, - ['armfmine3'] = true, - ['cormine1'] = true, - ['cormine2'] = true, - ['cormine3'] = true, - ['cormine4'] = true, - ['corfmine3'] = true, - ['legmine1'] = true, - ['legmine2'] = true, - ['legmine3'] = true, - - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['legscout'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, - ['scavmist'] = true, - ['scavmistxl'] = true, - ['scavmistxxl'] = true, + ["armarad"] = true, + ["armaser"] = true, + ["armason"] = true, + ["armeyes"] = true, + ["armfrad"] = true, + ["armjam"] = true, + ["armjamt"] = true, + ["armmark"] = true, + ["armrad"] = true, + ["armseer"] = true, + ["armsjam"] = true, + ["armsonar"] = true, + ["armveil"] = true, + ["corarad"] = true, + ["corason"] = true, + ["coreter"] = true, + ["coreyes"] = true, + ["corfrad"] = true, + ["corjamt"] = true, + ["corrad"] = true, + ["legjam"] = true, + ["legrad"] = true, + ["corshroud"] = true, + ["corsjam"] = true, + ["corsonar"] = true, + ["corspec"] = true, + ["corvoyr"] = true, + ["corvrad"] = true, + ["legarad"] = true, + ["legajam"] = true, + ["legavrad"] = true, + ["legavjam"] = true, + ["legaradk"] = true, + ["legajamk"] = true, + ["legfrad"] = true, + + ["armmine1"] = true, + ["armmine2"] = true, + ["armmine3"] = true, + ["armfmine3"] = true, + ["cormine1"] = true, + ["cormine2"] = true, + ["cormine3"] = true, + ["cormine4"] = true, + ["corfmine3"] = true, + ["legmine1"] = true, + ["legmine2"] = true, + ["legmine3"] = true, + + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["legscout"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + ["scavmist"] = true, + ["scavmistxl"] = true, + ["scavmistxxl"] = true, } -- convert unitname -> unitDefID local tokillUnits = {} @@ -98,18 +97,18 @@ if gadgetHandler:IsSyncedCode() then tokillUnitsNames = nil local todenyUnitsNames = { - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['legscout'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, - ['scavmist'] = true, - ['scavmistxl'] = true, - ['scavmistxxl'] = true, + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["legscout"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + ["scavmist"] = true, + ["scavmistxl"] = true, + ["scavmistxxl"] = true, } -- convert unitname -> unitDefID local todenyUnits = {} @@ -123,19 +122,18 @@ if gadgetHandler:IsSyncedCode() then for udid, ud in pairs(UnitDefs) do for id, v in pairs(tokillUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then tokillUnits[udid] = v end end for id, v in pairs(todenyUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then todenyUnits[udid] = v end end end - --config -- see also in unsynced local radius = 315 --outer radius of area denial ring local width = 30 --width of area denial ring @@ -151,11 +149,10 @@ if gadgetHandler:IsSyncedCode() then local SpAddUnitExperience = Spring.AddUnitExperience local Mmin = math.min - -- kill appropriate things from initial juno blast -- local junoWeaponsNames = { - ['legcib_juno_pulse_mini'] = true, + ["legcib_juno_pulse_mini"] = true, } -- convert unitname -> unitDefID local junoWeapons = {} @@ -525,7 +522,6 @@ else end - ]]-- - + ]] + -- end - diff --git a/luarules/gadgets/unit_juno_rework_damage.lua b/luarules/gadgets/unit_juno_rework_damage.lua index fd9b0745c22..ca269768a7e 100644 --- a/luarules/gadgets/unit_juno_rework_damage.lua +++ b/luarules/gadgets/unit_juno_rework_damage.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Juno Rework Damage', - desc = 'Handles Juno damage', - author = 'Niobium, Bluestone, Hornet',--rework by Hornet, elements of older Juno code from prior authors - version = 'v3.0', - date = '05/2024',--original 05/2013 - license = 'GNU GPL, v2 or later', + name = "Juno Rework Damage", + desc = "Handles Juno damage", + author = "Niobium, Bluestone, Hornet", --rework by Hornet, elements of older Juno code from prior authors + version = "v3.0", + date = "05/2024", --original 05/2013 + license = "GNU GPL, v2 or later", layer = 0, - enabled = Spring.GetModOptions().junorework + enabled = Spring.GetModOptions().junorework, } end @@ -17,97 +17,87 @@ end -- Synced only ---------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then - - - ---hornet todo; ---deploy to juno_mini_damage when mechanics sorted ---tarpit pawns & grunts possibly. code added but glitched for now. - - + --hornet todo; + --deploy to juno_mini_damage when mechanics sorted + --tarpit pawns & grunts possibly. code added but glitched for now. ---------------------------------------------------------------- -- Config ---------------------------------------------------------------- + local tokillUnitsNames = { + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["legscout"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + } + + --emp these + local toStunUnitsNames = { --this could maybe use customparams later, at least in part to detect mines + ["armarad"] = true, + ["armaser"] = true, + ["armason"] = true, + ["armfrad"] = true, + ["armjam"] = true, + ["armjamt"] = true, + ["armmark"] = true, + ["armrad"] = true, + ["armseer"] = true, + ["armsjam"] = true, + ["armsonar"] = true, + ["armveil"] = true, + ["corarad"] = true, + ["corason"] = true, + ["coreter"] = true, + ["corfrad"] = true, + ["corjamt"] = true, + ["corrad"] = true, + ["corshroud"] = true, + ["corsjam"] = true, + ["corsonar"] = true, + ["corspec"] = true, + ["corvoyr"] = true, + ["corvrad"] = true, + + ["coreyes"] = true, + ["armeyes"] = true, + ["armmine1"] = true, + ["armmine2"] = true, + ["armmine3"] = true, + ["cormine1"] = true, + ["cormine2"] = true, + ["cormine3"] = true, + ["armfmine3"] = true, + ["corfmine3"] = true, + ["legmine1"] = true, + ["legmine2"] = true, + ["legmine3"] = true, + } + + local stunDuration = Spring.GetModOptions().emprework and 32 or 30 + --hornet todo, might leave this to be decided by EMP settings and just max it out? -local tokillUnitsNames = { - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['legscout'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, -} - ---emp these -local toStunUnitsNames = {--this could maybe use customparams later, at least in part to detect mines - ['armarad'] = true, - ['armaser'] = true, - ['armason'] = true, - ['armfrad'] = true, - ['armjam'] = true, - ['armjamt'] = true, - ['armmark'] = true, - ['armrad'] = true, - ['armseer'] = true, - ['armsjam'] = true, - ['armsonar'] = true, - ['armveil'] = true, - ['corarad'] = true, - ['corason'] = true, - ['coreter'] = true, - ['corfrad'] = true, - ['corjamt'] = true, - ['corrad'] = true, - ['corshroud'] = true, - ['corsjam'] = true, - ['corsonar'] = true, - ['corspec'] = true, - ['corvoyr'] = true, - ['corvrad'] = true, - - ['coreyes'] = true, - ['armeyes'] = true, - ['armmine1'] = true, - ['armmine2'] = true, - ['armmine3'] = true, - ['cormine1'] = true, - ['cormine2'] = true, - ['cormine3'] = true, - ['armfmine3'] = true, - ['corfmine3'] = true, - ['legmine1'] = true, - ['legmine2'] = true, - ['legmine3'] = true, - -} - - -local stunDuration = Spring.GetModOptions().emprework and 32 or 30 ---hornet todo, might leave this to be decided by EMP settings and just max it out? - - -local toTarpitUnitsNames = { - ['corak'] = true, - ['armpw'] = true, - ['leggob'] = true, -} - -local todenyUnitsNames = { - ['corfav'] = true, - ['armfav'] = true, - ['armflea'] = true, - ['raptor_land_swarmer_brood_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t2_v1'] = true, - ['raptor_land_kamikaze_emp_t2_v1'] = true, - ['raptor_land_kamikaze_basic_t4_v1'] = true, - ['raptor_land_kamikaze_emp_t4_v1'] = true, -} + local toTarpitUnitsNames = { + ["corak"] = true, + ["armpw"] = true, + ["leggob"] = true, + } + local todenyUnitsNames = { + ["corfav"] = true, + ["armfav"] = true, + ["armflea"] = true, + ["raptor_land_swarmer_brood_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t2_v1"] = true, + ["raptor_land_kamikaze_emp_t2_v1"] = true, + ["raptor_land_kamikaze_basic_t4_v1"] = true, + ["raptor_land_kamikaze_emp_t4_v1"] = true, + } -- convert unitname -> unitDefID local tokillUnits = {} @@ -144,32 +134,27 @@ local todenyUnitsNames = { toTarpitUnitsNames = nil --]] - - - for udid, ud in pairs(UnitDefs) do for id, v in pairs(tokillUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then tokillUnits[udid] = v end end for id, v in pairs(todenyUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then todenyUnits[udid] = v end end for id, v in pairs(toStunUnits) do if string.find("_scav", ud.name) and string.sub(UnitDefs[id].name, 1, -5) == ud.name then - --if string.find(ud.name, UnitDefs[id].name) then + --if string.find(ud.name, UnitDefs[id].name) then toStunUnits[udid] = v end end - end - --config -- see also in unsynced local radius = 450 --outer radius of area denial ring local width = 30 --width of area denial ring @@ -184,7 +169,6 @@ local todenyUnitsNames = { local SpValidUnitID = Spring.ValidUnitID local Mmin = math.min - -- kill appropriate things from initial juno blast -- local junoWeaponsNames = { @@ -205,8 +189,6 @@ local todenyUnitsNames = { junoWeaponsNames = nil function gadget:UnitDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, projID, aID, aDefID, aTeam) - - --[[ if junoWeapons[weaponID] and toTarpitUnits[uDefID] and aID~=99 then if uID and SpValidUnitID(uID) then @@ -218,22 +200,22 @@ local todenyUnitsNames = { local health, maxHealth, paralyzeDamage, capture, build = Spring.GetUnitHealth(uID) Spring.AddUnitDamage (uID, maxHealth/2, 5, 99, aDefID) end - end--]]-- + end--]] + -- - if junoWeapons[weaponID] and toStunUnits[uDefID] and aID~=99 and (paralyzer == false) then--needed to stop possible loops + if junoWeapons[weaponID] and toStunUnits[uDefID] and aID ~= 99 and (paralyzer == false) then --needed to stop possible loops if uID and SpValidUnitID(uID) then local px, py, pz = Spring.GetUnitPosition(uID) if px then Spring.SpawnCEG("juno-damage", px, py + 8, pz, 0, 1, 0) end - + local health, maxHealth, paralyzeDamage, capture, build = Spring.GetUnitHealth(uID) - Spring.AddUnitDamage (uID, maxHealth*3, stunDuration, 99, weaponID)--no weapon ID, no stun. with weapon ID, infinite loops, even with the 99 exclusion. -1 does not work. + Spring.AddUnitDamage(uID, maxHealth * 3, stunDuration, 99, weaponID) --no weapon ID, no stun. with weapon ID, infinite loops, even with the 99 exclusion. -1 does not work. --aID check removed as -probably- only useful for kill crediting? - end end - + if junoWeapons[weaponID] and tokillUnits[uDefID] then if uID and SpValidUnitID(uID) then local px, py, pz = Spring.GetUnitPosition(uID) @@ -289,7 +271,6 @@ local todenyUnitsNames = { local curtime = SpGetGameSeconds() if Spring.GetGameFrame() % 15 == 0 then - for counter, expl in pairs(centers) do if expl.t >= curtime - effectlength then local q = 1 @@ -314,7 +295,6 @@ local todenyUnitsNames = { end end - if toStunUnits[unitDefID] then local px, py, pz = Spring.GetUnitPosition(unitID) local dx = expl.x - px @@ -325,11 +305,11 @@ local todenyUnitsNames = { -- linear and not O(n^2) local health, maxHealth, paralyzeDamage, capture, build = Spring.GetUnitHealth(unitID) --Spring.Echo(paralyzeDamage, maxHealth*1.2) - if (paralyzeDamage < maxHealth*1.2) then--try to prevent excessive stun times, also needless restuns - Spring.AddUnitDamage (unitID, maxHealth*2, 5, 99, WeaponDefNames["corjuno_juno_pulse_ghost"].id)---...close enough? + if paralyzeDamage < maxHealth * 1.2 then --try to prevent excessive stun times, also needless restuns + Spring.AddUnitDamage(unitID, maxHealth * 2, 5, 99, WeaponDefNames["corjuno_juno_pulse_ghost"].id) ---...close enough? Spring.SpawnCEG("juno-damage", px, py + 8, pz, 0, 1, 0) end - + --SpDestroyUnit(unitID, true, false) end end @@ -346,7 +326,8 @@ local todenyUnitsNames = { local health, maxHealth, paralyzeDamage, capture, build = Spring.GetUnitHealth(unitID) Spring.AddUnitDamage (unitID, maxHealth*2, 5, 99, WeaponDefNames["corjuno_juno_pulse_ghost"].id)---...close enough? end - end--]]-- + end--]] + -- end else --SendToUnsynced("RemoveFromCenters", counter) @@ -356,7 +337,6 @@ local todenyUnitsNames = { if expl.t + fadetime >= curtime or expl.t + effectlength - fadetime <= curtime and curtime <= expl.t + effectlength then update = true -- fast update during fade in/out end - end end @@ -371,10 +351,4 @@ local todenyUnitsNames = { update = false end end - - - - - end - diff --git a/luarules/gadgets/unit_kill_count.lua b/luarules/gadgets/unit_kill_count.lua index a508db0f427..ba0bbf9349e 100644 --- a/luarules/gadgets/unit_kill_count.lua +++ b/luarules/gadgets/unit_kill_count.lua @@ -1,22 +1,21 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Unit kill count", - desc = "", - author = "Floris", - date = "February 2022", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true - } + return { + name = "Unit kill count", + desc = "", + author = "Floris", + date = "February 2022", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true, + } end if gadgetHandler:IsSyncedCode() then - local GetUnitRulesParam = Spring.GetUnitRulesParam local SetUnitRulesParam = Spring.SetUnitRulesParam - + local teamAllyteam = {} local teamList = Spring.GetTeamList() for i = 1, #teamList do @@ -30,5 +29,4 @@ if gadgetHandler:IsSyncedCode() then SetUnitRulesParam(attackerID, "kills", kills + 1) end end - end diff --git a/luarules/gadgets/unit_lightning_splash_dmg.lua b/luarules/gadgets/unit_lightning_splash_dmg.lua index 81e9d1b30f4..6f606c5048f 100644 --- a/luarules/gadgets/unit_lightning_splash_dmg.lua +++ b/luarules/gadgets/unit_lightning_splash_dmg.lua @@ -2,14 +2,14 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Lightning Splash Damage', - desc = 'Handles Lightning Weapons Splash Damage', - author = 'TheFatController, Itanthias', - version = 'v2.1', - date = 'April 2011 (V1.0), Jan 2023 (V2.1)', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true + name = "Lightning Splash Damage", + desc = "Handles Lightning Weapons Splash Damage", + author = "TheFatController, Itanthias", + version = "v2.1", + date = "April 2011 (V1.0), Jan 2023 (V2.1)", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -46,21 +46,21 @@ local projTablePool = {} local function GetProjTable() if projTablePoolSize == 0 then return { - weaponDefID = 0, - proOwnerID = 0, - spark_ceg = 0, - spark_basedamage = 0, - spark_forkdamage = 0, - spark_range = 0, - spark_maxunits = 0, - x = 0, - y = 0, - z = 0, - } + weaponDefID = 0, + proOwnerID = 0, + spark_ceg = 0, + spark_basedamage = 0, + spark_forkdamage = 0, + spark_range = 0, + spark_maxunits = 0, + x = 0, + y = 0, + z = 0, + } else local free = projTablePool[projTablePoolSize] projTablePool[projTablePoolSize] = nil - projTablePoolSize = projTablePoolSize -1 + projTablePoolSize = projTablePoolSize - 1 return free end end @@ -76,12 +76,12 @@ for wdid, wd in pairs(WeaponDefNames) do if wd.customParams ~= nil then if wd.customParams.spark_forkdamage ~= nil then Script.SetWatchProjectile(wd.id, true) -- watch so ProjectileCreated works - sparkWeapons[wd.id] = { + sparkWeapons[wd.id] = { ceg = wd.customParams.spark_ceg, -- currently overridden by above "global" options basedamage = tonumber(wd.damages[0]), --spark damage is assumed to be based on default damage forkdamage = tonumber(wd.customParams.spark_forkdamage), maxunits = tonumber(wd.customParams.spark_maxunits), - range = tonumber(wd.customParams.spark_range) + range = tonumber(wd.customParams.spark_range), } end end @@ -118,7 +118,7 @@ function gadget:GameFrame(frame) end -- this is a table that can be reused for each spawnprojectile -local projectileCacheTable = {pos = {0,0,0}, ["end"] = {0,0,0}, ttl = 2, owner = -1} +local projectileCacheTable = { pos = { 0, 0, 0 }, ["end"] = { 0, 0, 0 }, ttl = 2, owner = -1 } -- this part handles the actual spark and chaining effect and applies damage -- for a typical lighting bolt ttl = 1, main bolt strikes frame 1, spark bolts strike frame 2 @@ -126,9 +126,9 @@ function gadget:ProjectileDestroyed(proID) if lightningProjectiles[proID] then local lightning = lightningProjectiles[proID] -- localizing local count = lightning.spark_maxunits - local nearUnits = spGetUnitsInSphere(lightning.x,lightning.y,lightning.z,lightning.spark_range) -- get list of units in spark range + local nearUnits = spGetUnitsInSphere(lightning.x, lightning.y, lightning.z, lightning.spark_range) -- get list of units in spark range local nearUnit, nearUnitDefID - for i=1, #nearUnits do + for i = 1, #nearUnits do if count == 0 then -- exit if maximum chain is reached FreeProjTable(lightningProjectiles[proID]) lightningProjectiles[proID] = nil @@ -140,10 +140,10 @@ function gadget:ProjectileDestroyed(proID) if not immuneToSplash[nearUnitDefID] then -- check if unit is immune to sparking if not spGetUnitIsDead(nearUnit) then -- check if unit is in "death animation", so sparks do not chain to dying units. if lightning_shooter[lightning.proOwnerID] ~= nearUnit then --check if main bolt has hit this target or not - local bx,by,bz,mx,my,mz, ex, ey, ez = spGetUnitPosition(nearUnit,true,true) -- gets aimpoint of unit - if my+unitRadius[nearUnitDefID] > -10 then -- check if unit is above water (not underwater) - spSpawnCEG(terminal_spark_effect,ex,ey,ez,0,0,0) -- spawns "electric aura" at spark target - local spark_damage = lightning.spark_basedamage*lightning.spark_forkdamage -- figure out damage to apply to spark target + local bx, by, bz, mx, my, mz, ex, ey, ez = spGetUnitPosition(nearUnit, true, true) -- gets aimpoint of unit + if my + unitRadius[nearUnitDefID] > -10 then -- check if unit is above water (not underwater) + spSpawnCEG(terminal_spark_effect, ex, ey, ez, 0, 0, 0) -- spawns "electric aura" at spark target + local spark_damage = lightning.spark_basedamage * lightning.spark_forkdamage -- figure out damage to apply to spark target -- NB: weaponDefID -1 is debris damage which gets removed by engine_hotfixes.lua, use -7 (crush damage) arbitrarily instead spAddUnitDamage(nearUnit, spark_damage, 0, lightning.proOwnerID, -7) -- apply damage to spark target -- create visual lighting arc from main bolt termination point to spark target @@ -152,12 +152,12 @@ function gadget:ProjectileDestroyed(proID) projectileCacheTable.pos[1] = lightning.x projectileCacheTable.pos[2] = lightning.y projectileCacheTable.pos[3] = lightning.z - projectileCacheTable['end'][1] = ex - projectileCacheTable['end'][2] = ey - projectileCacheTable['end'][3] = ez + projectileCacheTable["end"][1] = ex + projectileCacheTable["end"][2] = ey + projectileCacheTable["end"][3] = ez -- NB: Lightning sparks have no team/owner. So are not subject to LOS (natural force). But they give no credit for damage (stats, xp, etc). - spSpawnProjectile(lightning.weaponDefID, {["pos"]={lightning.x,lightning.y,lightning.z},["end"] = {ex,ey,ez}, ["ttl"] = 2, ["owner"] = -1}) + spSpawnProjectile(lightning.weaponDefID, { ["pos"] = { lightning.x, lightning.y, lightning.z }, ["end"] = { ex, ey, ez }, ["ttl"] = 2, ["owner"] = -1 }) count = count - 1 -- spark target count accounting end end @@ -167,16 +167,16 @@ function gadget:ProjectileDestroyed(proID) -- special effects, for leftover chain local angle, pitch, newx, newz, height1, height2 - for i=1, count, 3 do - angle = math_random()*2*math_pi -- random angle, in radians - pitch = math_random()*math_pi/2 -- random pitch, in radians + for i = 1, count, 3 do + angle = math_random() * 2 * math_pi -- random angle, in radians + pitch = math_random() * math_pi / 2 -- random pitch, in radians -- convert to x,z and offset from main bolt termination point - newx = lightning.x + math_cos(pitch)*math_sin(angle)*lightning.spark_range - newz = lightning.z + math_cos(pitch)*math_cos(angle)*lightning.spark_range + newx = lightning.x + math_cos(pitch) * math_sin(angle) * lightning.spark_range + newz = lightning.z + math_cos(pitch) * math_cos(angle) * lightning.spark_range -- get height of random spark bolt termination point -- This may need to be tuned, steep slopes, cliffs, and uneven terrain may create weird visuals - height1 = math_max(spGetGroundHeight(lightning.x,lightning.z),lightning.y) -- no vertical offset from ground seems needed for ground-strike bolts - height2 = spGetGroundHeight(newx,newz)+5+(math_sin(pitch)*lightning.spark_range/2) + height1 = math_max(spGetGroundHeight(lightning.x, lightning.z), lightning.y) -- no vertical offset from ground seems needed for ground-strike bolts + height2 = spGetGroundHeight(newx, newz) + 5 + (math_sin(pitch) * lightning.spark_range / 2) -- offset by 5 units seems good for termination point of spark -- also pitch height is added, and squashed by a factor of 2 for an "ellipsoid" strike surface @@ -185,12 +185,12 @@ function gadget:ProjectileDestroyed(proID) projectileCacheTable.pos[1] = lightning.x projectileCacheTable.pos[2] = height1 projectileCacheTable.pos[3] = lightning.z - projectileCacheTable['end'][1] = newx -- note, the keyword 'end' is reserved - projectileCacheTable['end'][2] = height2 - projectileCacheTable['end'][3] = newz + projectileCacheTable["end"][1] = newx -- note, the keyword 'end' is reserved + projectileCacheTable["end"][2] = height2 + projectileCacheTable["end"][3] = newz --spSpawnProjectile(visual_chain_weapon, projectileCacheTable) - spSpawnProjectile(visual_chain_weapon, {["pos"]={lightning.x,height1,lightning.z},["end"] = {newx,height2,newz}, ["ttl"] = 2, ["owner"] = -1}) - spSpawnCEG(terminal_spark_effect,newx,height2,newz,0,0,0) + spSpawnProjectile(visual_chain_weapon, { ["pos"] = { lightning.x, height1, lightning.z }, ["end"] = { newx, height2, newz }, ["ttl"] = 2, ["owner"] = -1 }) + spSpawnCEG(terminal_spark_effect, newx, height2, newz, 0, 0, 0) end -- clear from table @@ -203,9 +203,8 @@ end function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) if sparkWeapons[weaponDefID] then -- make sure we are handling lightning weapons if proOwnerID ~= -1 then -- make sure we are handling a main bolt, and not a spark bolt - - local xp,yp,zp = spGetProjectilePosition(proID) -- get bolt start point - local xv,yv,zv = spGetProjectileVelocity(proID) -- get bolt length + local xp, yp, zp = spGetProjectilePosition(proID) -- get bolt start point + local xv, yv, zv = spGetProjectileVelocity(proID) -- get bolt length -- fill table, to be used in ProjectileDestroyed @@ -217,9 +216,9 @@ function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) projTable.spark_forkdamage = sparkWeapons[weaponDefID].forkdamage projTable.spark_range = sparkWeapons[weaponDefID].range projTable.spark_maxunits = sparkWeapons[weaponDefID].maxunits - projTable.x = xp+xv - projTable.y = yp+yv - projTable.z = zp+zv + projTable.x = xp + xv + projTable.y = yp + yv + projTable.z = zp + zv --[[lightningProjectiles[proID] = { weaponDefID = weaponDefID, @@ -233,7 +232,8 @@ function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) x = xp+xv, y = yp+yv, z = zp+zv, - }]]-- + }]] + -- lightningProjectiles[proID] = projTable end end @@ -243,11 +243,10 @@ end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) -- using UnitPreDamaged to try to catch a unit being hit by a lightning bolt as soon as possible. UnitDamaged should also work, if necessary if attackerID and sparkWeapons[weaponID] then - -- engine does not provide a projectileID for hitscan weapons, bleh -- as a workaround, if a unit is shot by a lightning unit, make it immune to that unit's chaining for 3 frames lightning_shooter[attackerID] = unitID lightning_shooter_ttl[attackerID] = 3 end - return damage,1 + return damage, 1 end diff --git a/luarules/gadgets/unit_mex_upgrade_reclaimer.lua b/luarules/gadgets/unit_mex_upgrade_reclaimer.lua index 3a0aa30a5d0..512985ed03c 100644 --- a/luarules/gadgets/unit_mex_upgrade_reclaimer.lua +++ b/luarules/gadgets/unit_mex_upgrade_reclaimer.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Mex Upgrade Reclaimer", - desc = "Insta reclaims/refunds a mex when another mex on top has finished, also shares mexes build upon ally mex owner", - author = "Floris", - date = "October 2021", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Mex Upgrade Reclaimer", + desc = "Insta reclaims/refunds a mex when another mex on top has finished, also shares mexes build upon ally mex owner", + author = "Floris", + date = "October 2021", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -16,9 +16,7 @@ if not gadgetHandler:IsSyncedCode() then return end - -local transferInstantly = true -- false = transfer mex on completion - +local transferInstantly = true -- false = transfer mex on completion _G.transferredUnits = {} -- table of all mex unitDefIDs @@ -84,13 +82,13 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD if mex then Spring.SetUnitNoSelect(mex, false) end - end + end end function gadget:UnitFinished(unitID, unitDefID, unitTeam) -- on completion open up yardmap to allow for another mex to built ontop if isMex[unitDefID] then - Spring.SetUnitCOBValue(unitID, COB.YARD_OPEN, 1) + Spring.SetUnitCOBValue(unitID, COB.YARD_OPEN, 1) -- if theres a mex below this one reclaim it, and donate this one to the owner of the previous mex local mex = hasMexBeneath(unitID) if mex then @@ -105,12 +103,11 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) end end - function gadget:GameFrame(gf) if gf % 99 then local newTransferredUnits = {} for unitID, frame in pairs(_G.transferredUnits) do - if frame+30 > gf then + if frame + 30 > gf then newTransferredUnits[unitID] = frame end end diff --git a/luarules/gadgets/unit_minesweeper_detection.lua b/luarules/gadgets/unit_minesweeper_detection.lua index b1b12d68734..a1a0e682a92 100644 --- a/luarules/gadgets/unit_minesweeper_detection.lua +++ b/luarules/gadgets/unit_minesweeper_detection.lua @@ -19,12 +19,12 @@ if not gadgetHandler:IsSyncedCode() then return false end -local spSetUnitLosState = Spring.SetUnitLosState -local spSetUnitLosMask = Spring.SetUnitLosMask -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitTeam = Spring.GetUnitTeam +local spSetUnitLosState = Spring.SetUnitLosState +local spSetUnitLosMask = Spring.SetUnitLosMask +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitTeam = Spring.GetUnitTeam local minesweeperRanges = {} local minesweepers = {} @@ -66,7 +66,7 @@ end local function processTeamsSweepers(teamID) local minesToReveal = {} - for sweeper, sweeperDef in pairs(minesweepers[teamID]) do + for sweeper, sweeperDef in pairs(minesweepers[teamID]) do local x, y, z = spGetUnitPosition(sweeper) if x and z then local nearUnits = spGetUnitsInCylinder(x, z, minesweeperRanges[sweeperDef]) @@ -115,4 +115,4 @@ function gadget:Initialize() minesweepers[unitTeam][unitID] = unitDefID end end -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_nanoradarpos.lua b/luarules/gadgets/unit_nanoradarpos.lua index 4099369eb96..2cc4ff3e4d4 100644 --- a/luarules/gadgets/unit_nanoradarpos.lua +++ b/luarules/gadgets/unit_nanoradarpos.lua @@ -1,32 +1,28 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Nano Radar Pos", - desc = "Removes radar icon wobble for nanos since these units are technically not buildings (no yardmap)", - author = "Floris", - date = "November 2019", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Nano Radar Pos", + desc = "Removes radar icon wobble for nanos since these units are technically not buildings (no yardmap)", + author = "Floris", + date = "November 2019", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end +if gadgetHandler:IsSyncedCode() then + local isNano = {} + for unitDefID, defs in pairs(UnitDefs) do + if string.find(defs.name, "nanotc") then + isNano[unitDefID] = true + end + end -if (gadgetHandler:IsSyncedCode()) then - - local isNano = {} - for unitDefID, defs in pairs(UnitDefs) do - if string.find(defs.name, "nanotc") then - isNano[unitDefID] = true - end - end - - function gadget:UnitCreated(uid, udid) - if isNano[udid] then - Spring.SetUnitPosErrorParams(udid, 0,0,0, 0,0,0, math.huge) - end - end - + function gadget:UnitCreated(uid, udid) + if isNano[udid] then + Spring.SetUnitPosErrorParams(udid, 0, 0, 0, 0, 0, 0, math.huge) + end + end end diff --git a/luarules/gadgets/unit_no_land_damage.lua b/luarules/gadgets/unit_no_land_damage.lua index cc8bfd88848..1205ddb2bed 100644 --- a/luarules/gadgets/unit_no_land_damage.lua +++ b/luarules/gadgets/unit_no_land_damage.lua @@ -4,45 +4,44 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "No Land Damage", - desc = "Stops torpedo bombers from damaging units when they're on land.", - author = "TheFatController", - date = "Aug 31, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "No Land Damage", + desc = "Stops torpedo bombers from damaging units when they're on land.", + author = "TheFatController", + date = "Aug 31, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false -- silent removal + return false -- silent removal end local GetUnitBasePosition = Spring.GetUnitBasePosition -local weapons = {'armair_torpedo', 'armseap_weapon'} +local weapons = { "armair_torpedo", "armseap_weapon" } local NO_LAND_DAMAGE = {} for wdid, wd in pairs(WeaponDefNames) do - for _, wname in pairs(weapons) do - if string.find(wd.name, wname) then - NO_LAND_DAMAGE[wdid] = true - end - end + for _, wname in pairs(weapons) do + if string.find(wd.name, wname) then + NO_LAND_DAMAGE[wdid] = true + end + end end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) - if NO_LAND_DAMAGE[weaponID] then - if select(2,GetUnitBasePosition(unitID)) > 0 then - return (damage * 0.2),1 - else - return damage,1 - end - else - return damage,1 - end + if NO_LAND_DAMAGE[weaponID] then + if select(2, GetUnitBasePosition(unitID)) > 0 then + return (damage * 0.2), 1 + else + return damage, 1 + end + else + return damage, 1 + end end - -------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------------- diff --git a/luarules/gadgets/unit_nonblocking_mines.lua b/luarules/gadgets/unit_nonblocking_mines.lua index 753834080c4..03c22c452d3 100644 --- a/luarules/gadgets/unit_nonblocking_mines.lua +++ b/luarules/gadgets/unit_nonblocking_mines.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = 'Nonblocking mines', - desc = 'For 92.+ mines need to be manually unblocked. But other units cannot be built on them.', - author = 'Beherith', - date = 'Jan 2013', - license = 'GNU GPL, v2 or later', + name = "Nonblocking mines", + desc = "For 92.+ mines need to be manually unblocked. But other units cannot be built on them.", + author = "Beherith", + date = "Jan 2013", + license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -23,7 +23,7 @@ for udid, ud in pairs(UnitDefs) do if ud.customParams.detonaterange then isMine[udid] = true end - unitSizing[udid] = {ud.xsize * 4 + 8, ud.zsize * 4 + 8} -- add 8 for the mines size too + unitSizing[udid] = { ud.xsize * 4 + 8, ud.zsize * 4 + 8 } -- add 8 for the mines size too end local spSetUnitBlocking = Spring.SetUnitBlocking diff --git a/luarules/gadgets/unit_objectify.lua b/luarules/gadgets/unit_objectify.lua index 08c48898304..23102b04d2b 100644 --- a/luarules/gadgets/unit_objectify.lua +++ b/luarules/gadgets/unit_objectify.lua @@ -1,23 +1,23 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Objectify", - desc = "Handle objects and decorations", - author = "Bluestone, Floris", - date = "Feb 2015", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Objectify", + desc = "Handle objects and decorations", + author = "Bluestone, Floris", + date = "Feb 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end --[[ Handle objects and decorations - Objects are things like walls, and they still need to receive damage - Decorations are things like hats and xmas baubles an should be invulnerable -]]-- +]] +-- local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt @@ -41,17 +41,17 @@ local canReclaim = {} local canRepair = {} local unitSize = {} -for udefID,def in ipairs(UnitDefs) do - if def.customParams.objectify then - isObject[udefID] = true - end - if def.customParams.decoration then - isDecoration[udefID] = tonumber(def.customParams.decoration) - end +for udefID, def in ipairs(UnitDefs) do + if def.customParams.objectify then + isObject[udefID] = true + end + if def.customParams.decoration then + isDecoration[udefID] = tonumber(def.customParams.decoration) + end if def.isBuilder then isBuilder[udefID] = true end - unitSize[udefID] = { ((def.xsize*8)+8)/2, ((def.zsize*8)+8)/2 } + unitSize[udefID] = { ((def.xsize * 8) + 8) / 2, ((def.zsize * 8) + 8) / 2 } -- NB: This is `true` for e.g. constructors if `canattack = false` is not set. -- todo -- Spring.Echo("ATTACK", UnitDefs[selectedID].name, UnitDefs[selectedID].canAttack) @@ -77,7 +77,6 @@ for udefID,def in ipairs(UnitDefs) do end if gadgetHandler:IsSyncedCode() then - local numDecorations = 0 local numObjects = 0 @@ -110,10 +109,10 @@ if gadgetHandler:IsSyncedCode() then Spring.SetUnitNoSelect(unitID, true) Spring.SetUnitNoMinimap(unitID, true) Spring.SetUnitIconDraw(unitID, false) - Spring.SetUnitSensorRadius(unitID, 'los', 0) - Spring.SetUnitSensorRadius(unitID, 'airLos', 0) - Spring.SetUnitSensorRadius(unitID, 'radar', 0) - Spring.SetUnitSensorRadius(unitID, 'sonar', 0) + Spring.SetUnitSensorRadius(unitID, "los", 0) + Spring.SetUnitSensorRadius(unitID, "airLos", 0) + Spring.SetUnitSensorRadius(unitID, "radar", 0) + Spring.SetUnitSensorRadius(unitID, "sonar", 0) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) @@ -125,7 +124,7 @@ if gadgetHandler:IsSyncedCode() then end end - function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) + function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) if isDecoration[unitDefID] then numDecorations = numDecorations + 1 decorationUnit(unitID) @@ -134,25 +133,25 @@ if gadgetHandler:IsSyncedCode() then numObjects = numObjects + 1 objectifyUnit(unitID) end - end + end - function gadget:UnitGiven(unitID, unitDefID, oldTeam, newTeam) - if isObject[unitDefID] then - objectifyUnit(unitID) - end - end + function gadget:UnitGiven(unitID, unitDefID, oldTeam, newTeam) + if isObject[unitDefID] then + objectifyUnit(unitID) + end + end - function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) + function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if isDecoration[unitDefID] then return 0, 0 elseif isObject[unitDefID] and not paralyzer then - local _,maxHealth,_,_,buildProgress = Spring.GetUnitHealth(unitID) - if buildProgress and maxHealth and buildProgress < 1 then - return (damage/100)*maxHealth, nil - end - end - return damage, nil - end + local _, maxHealth, _, _, buildProgress = Spring.GetUnitHealth(unitID) + if buildProgress and maxHealth and buildProgress < 1 then + return (damage / 100) * maxHealth, nil + end + end + return damage, nil + end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) if cmdID and (numObjects > 0 or numDecorations > 0) then @@ -169,8 +168,8 @@ if gadgetHandler:IsSyncedCode() then elseif cmdID < 0 and numDecorations > 0 then if cmdParams[3] and isBuilder[unitDefID] then local udefid = math.abs(cmdID) - local units = Spring.GetUnitsInBox(cmdParams[1]-unitSize[udefid][1],cmdParams[2]-200,cmdParams[3]-unitSize[udefid][2],cmdParams[1]+unitSize[udefid][1],cmdParams[2]+50,cmdParams[3]+unitSize[udefid][2]) - for i=1, #units do + local units = Spring.GetUnitsInBox(cmdParams[1] - unitSize[udefid][1], cmdParams[2] - 200, cmdParams[3] - unitSize[udefid][2], cmdParams[1] + unitSize[udefid][1], cmdParams[2] + 50, cmdParams[3] + unitSize[udefid][2]) + for i = 1, #units do if isDecoration[spGetUnitDefID(units[i])] == 1 then if Spring.GetUnitIsDead(units[i]) == false then Spring.DestroyUnit(units[i], false, true) @@ -182,11 +181,7 @@ if gadgetHandler:IsSyncedCode() then end return true end - - else -- UNSYNCED - - local myAllyTeam = Spring.GetMyAllyTeamID() local spectating = Spring.GetSpectatingState() function gadget:PlayerChanged(playerID) @@ -198,16 +193,16 @@ else -- UNSYNCED -- with early returns when the first check is matched: local allyBeingBuilt = { { check = canRepair, command = CMD_REPAIR }, -- so this is the priority - { check = canMove, command = CMD_MOVE }, -- and this is the fallback + { check = canMove, command = CMD_MOVE }, -- and this is the fallback } local allyObjectUnit = { { check = canReclaim, command = CMD_RECLAIM }, - { check = canMove, command = CMD_MOVE }, + { check = canMove, command = CMD_MOVE }, } local hideEnemyDecoy = { - { check = canAttack, command = CMD_ATTACK }, + { check = canAttack, command = CMD_ATTACK }, { check = canReclaim, command = CMD_RECLAIM }, - { check = canMove, command = CMD_MOVE }, + { check = canMove, command = CMD_MOVE }, } local function scanSelection(predicates) @@ -257,10 +252,9 @@ else -- UNSYNCED end end - function gadget:DefaultCommand(type, id, cmd) + function gadget:DefaultCommand(type, id, cmd) if type == "unit" and not spectating then return getUnitHoverCommand(id, spGetUnitDefID(id), cmd) end - end - + end end diff --git a/luarules/gadgets/unit_onlytargetcategory.lua b/luarules/gadgets/unit_onlytargetcategory.lua index 41d58952724..25a567cbadb 100644 --- a/luarules/gadgets/unit_onlytargetcategory.lua +++ b/luarules/gadgets/unit_onlytargetcategory.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Only Target onlytargetcategory", - desc = "Prevents attacking anything other than the only target category", - author = "Floris", - date = "September 2020", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Only Target onlytargetcategory", + desc = "Prevents attacking anything other than the only target category", + author = "Floris", + date = "September 2020", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -28,10 +28,10 @@ for udid, unitDef in pairs(UnitDefs) do for category, _ in pairs(weapon.onlyTargets) do if unitOnlyTargetsCategory[udid] == nil then unitOnlyTargetsCategory[udid] = category - if category == 'vtol' then + if category == "vtol" then unitDontAttackGround[udid] = true end - elseif unitOnlyTargetsCategory[udid] ~= category then -- multiple different onlytargetcategory used: disregard + elseif unitOnlyTargetsCategory[udid] ~= category then -- multiple different onlytargetcategory used: disregard unitOnlyTargetsCategory[udid] = nil unitDontAttackGround[udid] = nil -- If there are multiple categories, then it can shoot ground, and should be allowed to do so disregard = true @@ -51,10 +51,7 @@ end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) -- accepts: CMD.ATTACK - if cmdParams[2] == nil - and unitOnlyTargetsCategory[unitDefID] - and type(cmdParams[1]) == 'number' - and not (unitCategories[Spring.GetUnitDefID(cmdParams[1])] and unitCategories[Spring.GetUnitDefID(cmdParams[1])][unitOnlyTargetsCategory[unitDefID]]) then + if cmdParams[2] == nil and unitOnlyTargetsCategory[unitDefID] and type(cmdParams[1]) == "number" and not (unitCategories[Spring.GetUnitDefID(cmdParams[1])] and unitCategories[Spring.GetUnitDefID(cmdParams[1])][unitOnlyTargetsCategory[unitDefID]]) then return false else if cmdParams[2] and unitDontAttackGround[unitDefID] then diff --git a/luarules/gadgets/unit_onlytargetempable.lua b/luarules/gadgets/unit_onlytargetempable.lua index 7295cb17c85..d8af010ecdb 100644 --- a/luarules/gadgets/unit_onlytargetempable.lua +++ b/luarules/gadgets/unit_onlytargetempable.lua @@ -2,12 +2,12 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Only Target Emp-able units", - desc = "Prevents paralyzer units attacking anything other than empable units", - author = "Floris", - date = "February 2018", + name = "Only Target Emp-able units", + desc = "Prevents paralyzer units attacking anything other than empable units", + author = "Floris", + date = "February 2018", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end @@ -37,14 +37,11 @@ end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua) -- accepts: CMD.ATTACK - if empUnits[unitDefID] - and cmdParams[2] == nil - and type(cmdParams[1]) == 'number' - and UnitDefs[Spring.GetUnitDefID(cmdParams[1])] ~= nil then + if empUnits[unitDefID] and cmdParams[2] == nil and type(cmdParams[1]) == "number" and UnitDefs[Spring.GetUnitDefID(cmdParams[1])] ~= nil then if unEmpableUnits[Spring.GetUnitDefID(cmdParams[1])] then -- and UnitDefs[Spring.GetUnitDefID(cmdParams[1])].customParams.paralyzemultiplier == '0' then return false else - local _,_,_,_, y = Spring.GetUnitPosition(cmdParams[1], true) + local _, _, _, _, y = Spring.GetUnitPosition(cmdParams[1], true) local _, scaleY, _, _, offY = Spring.GetUnitCollisionVolumeData(cmdParams[1]) y = y + offY + (scaleY * 0.5) if y and y >= 0 then diff --git a/luarules/gadgets/unit_paralyze_damage_limit.lua b/luarules/gadgets/unit_paralyze_damage_limit.lua index 491afab980c..ea273273e60 100644 --- a/luarules/gadgets/unit_paralyze_damage_limit.lua +++ b/luarules/gadgets/unit_paralyze_damage_limit.lua @@ -1,39 +1,36 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Mobile Unit Paralyze Damage Handler', - desc = 'Limit mobile units max paralysis time', - author = 'Bluestone', - version = '', - date = 'Monkeya', - license = 'GNU GPL, v2 or later', - layer = 100, - enabled = true - } + return { + name = "Mobile Unit Paralyze Damage Handler", + desc = "Limit mobile units max paralysis time", + author = "Bluestone", + version = "", + date = "Monkeya", + license = "GNU GPL, v2 or later", + layer = 100, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local modOptions = Spring.GetModOptions() -local maxTime = modOptions.emprework==true and 10 or 20 --- bug fixed - +local maxTime = modOptions.emprework == true and 10 or 20 --- bug fixed local excluded = { - -- mobile units that are excluded from the maxTime limit - [UnitDefNames.armscab.id] = true, - [UnitDefNames.cormabm.id] = true, - [UnitDefNames.corcarry.id] = true, - [UnitDefNames.armcarry.id] = true, + -- mobile units that are excluded from the maxTime limit + [UnitDefNames.armscab.id] = true, + [UnitDefNames.cormabm.id] = true, + [UnitDefNames.corcarry.id] = true, + [UnitDefNames.armcarry.id] = true, [UnitDefNames.armantiship.id] = true, [UnitDefNames.corantiship.id] = true, } - local isBuilding = {} local unitOhms = {} -- rework related @@ -45,7 +42,9 @@ local weaponParalyzeTimeExceptions = {} -- Custom Stun Logic: Parse the stun condition strings in customparams (Using CSV since customparams doesn't support tables of tables) local function ParseStunConditionString(str) local result = {} - if type(str) ~= "string" then return result end + if type(str) ~= "string" then + return result + end for entry in string.gmatch(str, "[^,]+") do local keyVal, dur = string.match(entry, "([^:]+):([^:]+)") @@ -53,7 +52,11 @@ local function ParseStunConditionString(str) local key, val = string.match(keyVal, "([^=]+)=([^=]+)") if key and val then -- Convert val to boolean if needed - if val == "true" then val = true elseif val == "false" then val = false end + if val == "true" then + val = true + elseif val == "false" then + val = false + end table.insert(result, { unitconditionkey = key, unitconditionvalue = val, @@ -65,18 +68,16 @@ local function ParseStunConditionString(str) return result end - for weaponDefID, def in pairs(WeaponDefs) do - weaponParalyzeDamageTime[weaponDefID] = def.damages and def.damages.paralyzeDamageTime or maxTime + weaponParalyzeDamageTime[weaponDefID] = def.damages and def.damages.paralyzeDamageTime or maxTime -- Custom Stun Logic: Identify weapons with custom stun logic to avoid looping over all weapons again if def.customParams and (def.customParams.paralyzetime_exception or def.customParams.fixed_stun_duration) then weaponsWithCustomStunLogic[weaponDefID] = { paralyzetime_exception = ParseStunConditionString(def.customParams.paralyzetime_exception), - fixed_stun_duration = ParseStunConditionString(def.customParams.fixed_stun_duration) + fixed_stun_duration = ParseStunConditionString(def.customParams.fixed_stun_duration), } end - end -- Custom Stun Logic: Evaluate custom conditions to determine the stun duration of a weapon on a specific unit @@ -103,7 +104,6 @@ local function EvaluateCustomStunCondition(unitDef, unitConditionKey, unitCondit return false end - for udid, ud in pairs(UnitDefs) do for id, v in pairs(excluded) do if string.find(ud.name, UnitDefs[id].name) then @@ -137,19 +137,15 @@ for udid, ud in pairs(UnitDefs) do end end - if modOptions.emprework==true then - unitOhms[udid] = ud.customParams.paralyzemultiplier == nil and 1 or tonumber(ud.customParams.paralyzemultiplier)--it arrives as a string because WHY NOT + if modOptions.emprework == true then + unitOhms[udid] = ud.customParams.paralyzemultiplier == nil and 1 or tonumber(ud.customParams.paralyzemultiplier) --it arrives as a string because WHY NOT if tonumber(ud.customParams.paralyzemultiplier) or 0 > 0 then - --Spring.Echo('ohm', ud.name, ud.customParams.paralyzemultiplier) + --Spring.Echo('ohm', ud.name, ud.customParams.paralyzemultiplier) end end - end - - - local spGetUnitHealth = Spring.GetUnitHealth local spSetUnitHealth = Spring.SetUnitHealth local math_min = math.min @@ -180,8 +176,8 @@ function gadget:UnitPreDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, -- restrict the max paralysis time of mobile units if not isBuilding[uDefID] and not excluded[uDefID] then local ohm = 0 - if modOptions.emprework==true then - ohm = unitOhms[uDefID]-- or 0)) <= 0 and 0.6 or unitOhms[uDefID] + if modOptions.emprework == true then + ohm = unitOhms[uDefID] -- or 0)) <= 0 and 0.6 or unitOhms[uDefID] -- if default resistance, maxstun cap slightly lowered -- if nondefault, max stun affected by resistance -- as drain is static this is only way to limit that variably, which is needed for T3 impact of EMP. @@ -190,24 +186,20 @@ function gadget:UnitPreDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, --Spring.Echo('ohm',ohm) --nts, useless without raised caps on cont sources, mothball pending current playtests --if ((0.01+ohm)>1) then --type coerce - --ohm = ohm * 1.4 -- with 1.4, an EMP resistance of say 1.2 gains EMP only slightly faster but has nearly double max charge capacity relative to lesser units + --ohm = ohm * 1.4 -- with 1.4, an EMP resistance of say 1.2 gains EMP only slightly faster but has nearly double max charge capacity relative to lesser units --end thismaxtime = weaponParalyzeDamageTime[weaponID] * ((ohm == 1 and 0.85) or ohm) - - if ohm>0 then + if ohm > 0 then bufferdamage = hp / 200 --rootdamage = (damage / 50) * hp^0.5 --Spring.Echo('h damage rootdamage',hp,damage, rootdamage) damage = damage + bufferdamage --overcome relative effects drain (eg stunned unit with 90000 hp loses 900 emp damage a tick, whereas unit with 900 hp loses 9 a tick. impossible to balance low damage emp weapons to overcome this without making them OP vs low HP units) end - else thismaxtime = weaponParalyzeDamageTime[weaponID] end - - --Spring.Echo('raw stuntime, ohm, using mult value, thismaxtime (pre-minumum)', weaponParalyzeDamageTime[weaponID], ohm, ((ohm == 1 and 0.5) or ohm), thismaxtime) --thismaxtime = math.max(1, thismaxtime)--prevent microstuns (compounds oddly with shuri unfortunately) @@ -222,9 +214,8 @@ function gadget:UnitPreDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, --Spring.Echo('h mh ph wpt old new',hp,maxHP, currentEmp, thismaxtime, damage, newdamage) damage = newdamage - --damage = mh +6 + --damage = mh +6 --Spring.Echo('new',h,mh, ph, max_para_damage, max_para_time, damage) - end return damage, 1 end @@ -234,11 +225,11 @@ end -- -- Custom Stun Logic: Fixed_Stun_Duration - For specific weapon-unit combinations, apply a fixed stun duration, potentially exceeding the paralyzetime of the weapon by applying paralyzeDamage directly. -- --- Implementation Note: You can only exceed a weapon's paralyzetime by applying the paralyzedamage AFTER the ApplyDamage Spring Engine function (which +-- Implementation Note: You can only exceed a weapon's paralyzetime by applying the paralyzedamage AFTER the ApplyDamage Spring Engine function (which -- clamps the paralyzedamage to paralyzetime.) The UnitDamaged event handler happens right after ApplyDamage so we hook that for this feature. -- paralyzetime clamp: https://github.com/beyond-all-reason/spring/blob/95d591b7c91f26313b58187692bd4485b39cb050/rts/Sim/Units/Unit.cpp#L1257 -function gadget:UnitDamaged(unitID,unitDefID,unitTeam,damage,paralyzer,weaponDefID,projectileID,attackerID,attackerDefID,attackerTeam) +function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if not paralyzer then return end @@ -265,4 +256,4 @@ function gadget:UnitDamaged(unitID,unitDefID,unitTeam,damage,paralyzer,weaponDef -- Override the paralyzeDamage of the target to apply the fixed duration stun spSetUnitHealth(unitID, { paralyze = paralyzeDamage }) -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_paralyze_damage_multiplier.lua b/luarules/gadgets/unit_paralyze_damage_multiplier.lua index 2480e5c9ef8..2194eb249d1 100644 --- a/luarules/gadgets/unit_paralyze_damage_multiplier.lua +++ b/luarules/gadgets/unit_paralyze_damage_multiplier.lua @@ -1,21 +1,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Paralyze Damage Multiplier', - desc = 'Applies Paralyze damage resistance', - author = 'Niobium', - version = 'v1.0', - date = 'April 2011', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true - } + return { + name = "Paralyze Damage Multiplier", + desc = "Applies Paralyze damage resistance", + author = "Niobium", + version = "v1.0", + date = "April 2011", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - if not gadgetHandler:IsSyncedCode() then - return false + return false end local paralyzeMultipliers = {} -- paralyzeMultipliers[uDefID] = uDef.customParams.paralyzemultiplier or 1 @@ -24,19 +23,16 @@ for uDefID, uDef in pairs(UnitDefs) do end function gadget:UnitPreDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, projID, aID, aDefID, aTeam) - if paralyzer then - -- apply customParams paralyse multiplier - local paralyzeMultiplier = paralyzeMultipliers[uDefID] - - - if Spring.GetModOptions().emprework==true then - - if paralyzeMultiplier==1 then + if paralyzer then + -- apply customParams paralyse multiplier + local paralyzeMultiplier = paralyzeMultipliers[uDefID] + + if Spring.GetModOptions().emprework == true then + if paralyzeMultiplier == 1 then --paralyzeMultiplier = 0.6 --a new default EMP resistance for everything end - end return damage * paralyzeMultiplier, paralyzeMultiplier - end - return damage, 1 + end + return damage, 1 end diff --git a/luarules/gadgets/unit_paralyze_on_off.lua b/luarules/gadgets/unit_paralyze_on_off.lua index d0b90d7850a..9977e8da04e 100644 --- a/luarules/gadgets/unit_paralyze_on_off.lua +++ b/luarules/gadgets/unit_paralyze_on_off.lua @@ -1,24 +1,23 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Paralyze On Off Behavior', - desc = 'Turns units off if stunned in 1 hit', - author = 'Itanthias', - version = 'v1.0', - date = 'May 2023', - license = 'GNU GPL, v2 or later', - layer = 12, -- check after all paralyze damage modifiers - enabled = true - } + return { + name = "Paralyze On Off Behavior", + desc = "Turns units off if stunned in 1 hit", + author = "Itanthias", + version = "v1.0", + date = "May 2023", + license = "GNU GPL, v2 or later", + layer = 12, -- check after all paralyze damage modifiers + enabled = true, + } end - if not gadgetHandler:IsSyncedCode() then - return false + return false end -local off_on_stun = {} +local off_on_stun = {} for uDefID, uDef in pairs(UnitDefs) do -- should be mostly units, like jammers, that are scripted to turn off -- when stunned that should have this parameter set @@ -26,15 +25,15 @@ for uDefID, uDef in pairs(UnitDefs) do end function gadget:UnitPreDamaged(uID, uDefID, uTeam, damage, paralyzer, weaponID, projID, aID, aDefID, aTeam) - if paralyzer then --check if paralyzer + if paralyzer then --check if paralyzer if off_on_stun[uDefID] == "true" then --check if should be turned off on stun - -- check to see if this hit will stun + -- check to see if this hit will stun local health, maxHealth, paralyzeDamage = Spring.GetUnitHealth(uID) if paralyzeDamage + damage > maxHealth then -- turn off unit if it will stun Spring.SetUnitCOBValue(uID, COB.ACTIVATION, 0) end end - end - return damage, 1 + end + return damage, 1 end diff --git a/luarules/gadgets/unit_playable_raptor_manager.lua b/luarules/gadgets/unit_playable_raptor_manager.lua index 732c04dd2d9..ca96cca5ff6 100644 --- a/luarules/gadgets/unit_playable_raptor_manager.lua +++ b/luarules/gadgets/unit_playable_raptor_manager.lua @@ -15,7 +15,7 @@ function gadget:GetInfo() } end -local foundling = {} +local foundling = {} for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.prap_foundling then foundling[unitDefID] = true @@ -23,21 +23,18 @@ for unitDefID, unitDef in pairs(UnitDefs) do end if gadgetHandler:IsSyncedCode() then + -- Synced Space + function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) + if not builderID then + return + end --- Synced Space -function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) - if not builderID then - return + local builderDefID = Spring.GetUnitDefID(builderID) + if foundling[builderDefID] then + Spring.SetUnitHealth(unitID, { health = 2, build = 1 }) + Spring.DestroyUnit(builderID, false, true) + end end - - local builderDefID = Spring.GetUnitDefID(builderID) - if foundling[builderDefID] then - Spring.SetUnitHealth(unitID, {health=2,build=1}) - Spring.DestroyUnit(builderID, false, true) - end -end - else --- Unsynced Space - -end \ No newline at end of file + -- Unsynced Space +end diff --git a/luarules/gadgets/unit_prevent_aircraft_hax.lua b/luarules/gadgets/unit_prevent_aircraft_hax.lua index 70397daea14..8fca097953a 100644 --- a/luarules/gadgets/unit_prevent_aircraft_hax.lua +++ b/luarules/gadgets/unit_prevent_aircraft_hax.lua @@ -1,4 +1,3 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() @@ -9,7 +8,7 @@ function gadget:GetInfo() date = "3 27 2011", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -88,7 +87,7 @@ function gadget:GameFrame(f) end local function isInsideMap(unitID) - local x,_,z = spGetUnitPosition(unitID) + local x, _, z = spGetUnitPosition(unitID) return spIsPosInMap(x, z) end diff --git a/luarules/gadgets/unit_prevent_cloaked_unit_reclaim.lua b/luarules/gadgets/unit_prevent_cloaked_unit_reclaim.lua index 0423dd22935..7cf0f4bab7f 100644 --- a/luarules/gadgets/unit_prevent_cloaked_unit_reclaim.lua +++ b/luarules/gadgets/unit_prevent_cloaked_unit_reclaim.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Prevent Cloaked Unit Reclaim", - desc = "Prevents builders from reclaiming cloaked units", - author = "hihoman23", - date = "Apr 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Prevent Cloaked Unit Reclaim", + desc = "Prevents builders from reclaiming cloaked units", + author = "hihoman23", + date = "Apr 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local canReclaim = {} @@ -19,85 +19,84 @@ local checkedUnits = {} local maxBuildDist = 0 - if gadgetHandler:IsSyncedCode() then - local GetUnitAllyTeam = Spring.GetUnitAllyTeam - local GetUnitWorkerTask = Spring.GetUnitWorkerTask - local GiveOrderToUnit = Spring.GiveOrderToUnit - local GetUnitCurrentCommand = Spring.GetUnitCurrentCommand - local GetAllUnits = Spring.GetAllUnits - local IsUnitInRadar = Spring.IsUnitInRadar - local GetUnitPosition = Spring.GetUnitPosition - local GetUnitsInCylinder = Spring.GetUnitsInCylinder - local GetUnitDefID = Spring.GetUnitDefID - local GetUnitIsCloaked = Spring.GetUnitIsCloaked + local GetUnitAllyTeam = Spring.GetUnitAllyTeam + local GetUnitWorkerTask = Spring.GetUnitWorkerTask + local GiveOrderToUnit = Spring.GiveOrderToUnit + local GetUnitCurrentCommand = Spring.GetUnitCurrentCommand + local GetAllUnits = Spring.GetAllUnits + local IsUnitInRadar = Spring.IsUnitInRadar + local GetUnitPosition = Spring.GetUnitPosition + local GetUnitsInCylinder = Spring.GetUnitsInCylinder + local GetUnitDefID = Spring.GetUnitDefID + local GetUnitIsCloaked = Spring.GetUnitIsCloaked - function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams) - if (#cmdParams == 1) and GetUnitIsCloaked(cmdParams[1]) and (GetUnitAllyTeam(unitID) ~= GetUnitAllyTeam(cmdParams[1])) and not IsUnitInRadar(cmdParams[1], GetUnitAllyTeam(unitID)) then - return false - end - return true - end + function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams) + if (#cmdParams == 1) and GetUnitIsCloaked(cmdParams[1]) and (GetUnitAllyTeam(unitID) ~= GetUnitAllyTeam(cmdParams[1])) and not IsUnitInRadar(cmdParams[1], GetUnitAllyTeam(unitID)) then + return false + end + return true + end - function gadget:AllowUnitCloak(unitID) -- cancel reclaim commands - -- accepts: CMD.RECLAIM - if (cloakedUnits[unitID]) and (not checkedUnits[unitID]) then -- only needs to be checked when the unit barely is cloaked - checkedUnits[unitID] = true - local x, y, z = GetUnitPosition(unitID) - local units = GetUnitsInCylinder(x, z, maxBuildDist + unitRadius[GetUnitDefID(unitID)]) -- + unit radius since reclaim also works if only the edge of the unit is in range - for _, bID in pairs(units) do - local unitDefID = GetUnitDefID(bID) - if canReclaim[unitDefID] then - local cmd, target = GetUnitWorkerTask(bID) - if cmd == CMD.RECLAIM and target == unitID and (GetUnitAllyTeam(bID) ~= GetUnitAllyTeam(unitID)) and not IsUnitInRadar(unitID, GetUnitAllyTeam(bID)) then - local _, _, cmdTag = GetUnitCurrentCommand(bID, 1) - GiveOrderToUnit(bID, CMD.REMOVE, {cmdTag}, {}) - end - end - end - end - return true - end + function gadget:AllowUnitCloak(unitID) -- cancel reclaim commands + -- accepts: CMD.RECLAIM + if cloakedUnits[unitID] and not checkedUnits[unitID] then -- only needs to be checked when the unit barely is cloaked + checkedUnits[unitID] = true + local x, y, z = GetUnitPosition(unitID) + local units = GetUnitsInCylinder(x, z, maxBuildDist + unitRadius[GetUnitDefID(unitID)]) -- + unit radius since reclaim also works if only the edge of the unit is in range + for _, bID in pairs(units) do + local unitDefID = GetUnitDefID(bID) + if canReclaim[unitDefID] then + local cmd, target = GetUnitWorkerTask(bID) + if cmd == CMD.RECLAIM and target == unitID and (GetUnitAllyTeam(bID) ~= GetUnitAllyTeam(unitID)) and not IsUnitInRadar(unitID, GetUnitAllyTeam(bID)) then + local _, _, cmdTag = GetUnitCurrentCommand(bID, 1) + GiveOrderToUnit(bID, CMD.REMOVE, { cmdTag }, {}) + end + end + end + end + return true + end - local function initUnit(unitID, unitDefID) - if GetUnitIsCloaked(unitID) then - cloakedUnits[unitID] = true - end - if canReclaim[unitDefID] then - if canReclaim[unitDefID] > maxBuildDist then - maxBuildDist = canReclaim[unitDefID] - end - end - end + local function initUnit(unitID, unitDefID) + if GetUnitIsCloaked(unitID) then + cloakedUnits[unitID] = true + end + if canReclaim[unitDefID] then + if canReclaim[unitDefID] > maxBuildDist then + maxBuildDist = canReclaim[unitDefID] + end + end + end - function gadget:UnitCreated(unitID, unitDefID) - initUnit(unitID, unitDefID) - end + function gadget:UnitCreated(unitID, unitDefID) + initUnit(unitID, unitDefID) + end - function gadget:Initialize() - gadgetHandler:RegisterAllowCommand(CMD.RECLAIM) - for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.canReclaim then - canReclaim[unitDefID] = unitDef.buildDistance or 0 - end - if unitDef.canCloak then - unitRadius[unitDefID] = unitDef.radius - end - end - -- handle luarules reload - local units = GetAllUnits() - for _,unitID in ipairs(units) do - local unitDefID = GetUnitDefID(unitID) - initUnit(unitID, unitDefID) - end - end + function gadget:Initialize() + gadgetHandler:RegisterAllowCommand(CMD.RECLAIM) + for unitDefID, unitDef in pairs(UnitDefs) do + if unitDef.canReclaim then + canReclaim[unitDefID] = unitDef.buildDistance or 0 + end + if unitDef.canCloak then + unitRadius[unitDefID] = unitDef.radius + end + end + -- handle luarules reload + local units = GetAllUnits() + for _, unitID in ipairs(units) do + local unitDefID = GetUnitDefID(unitID) + initUnit(unitID, unitDefID) + end + end - function gadget:UnitCloaked(unitID) - cloakedUnits[unitID] = true - end + function gadget:UnitCloaked(unitID) + cloakedUnits[unitID] = true + end - function gadget:UnitDecloaked(unitID) - cloakedUnits[unitID] = nil - checkedUnits[unitID] = nil - end + function gadget:UnitDecloaked(unitID) + cloakedUnits[unitID] = nil + checkedUnits[unitID] = nil + end end diff --git a/luarules/gadgets/unit_prevent_lab_hax2.lua b/luarules/gadgets/unit_prevent_lab_hax2.lua index a63c538ed35..5ce004f267c 100644 --- a/luarules/gadgets/unit_prevent_lab_hax2.lua +++ b/luarules/gadgets/unit_prevent_lab_hax2.lua @@ -1,50 +1,48 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Prevent Lab Hax2", - desc = "Prevents units to keep being built after lab's death", - author = "Doo", - date = "Sept 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Prevent Lab Hax2", + desc = "Prevents units to keep being built after lab's death", + author = "Doo", + date = "Sept 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -if (gadgetHandler:IsSyncedCode()) then +if gadgetHandler:IsSyncedCode() then + local builder = {} + local destroyQueue = {} + local numtodestroy = 0 - local builder = {} - local destroyQueue = {} - local numtodestroy = 0 - - function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) -- destroy created unit if builder is dead - if Spring.ValidUnitID(builderID) and not Spring.GetUnitIsDead(builderID) then - else - local HP = Spring.GetUnitHealth(unitID) - if HP <= 1 then -- avoid killing /give and Spring.CreateUnit() - destroyQueue[numtodestroy + 1] = unitID - numtodestroy = numtodestroy + 1 - end - end - end + function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) -- destroy created unit if builder is dead + if Spring.ValidUnitID(builderID) and not Spring.GetUnitIsDead(builderID) then + else + local HP = Spring.GetUnitHealth(unitID) + if HP <= 1 then -- avoid killing /give and Spring.CreateUnit() + destroyQueue[numtodestroy + 1] = unitID + numtodestroy = numtodestroy + 1 + end + end + end -function gadget:GameFrame() - if numtodestroy > 0 then - for i = numtodestroy, 1, -1 do - Spring.DestroyUnit(destroyQueue[i], false, true) - destroyQueue[i] = nil - end - numtodestroy = 0 - end -end - - function gadget:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z, facing) -- do not allow create unit if builder is dead - if Spring.ValidUnitID(builderID) and not Spring.GetUnitIsDead(builderID) then - return true - else - return false - end - end + function gadget:GameFrame() + if numtodestroy > 0 then + for i = numtodestroy, 1, -1 do + Spring.DestroyUnit(destroyQueue[i], false, true) + destroyQueue[i] = nil + end + numtodestroy = 0 + end + end + function gadget:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z, facing) -- do not allow create unit if builder is dead + if Spring.ValidUnitID(builderID) and not Spring.GetUnitIsDead(builderID) then + return true + else + return false + end + end end diff --git a/luarules/gadgets/unit_prevent_load_hax.lua b/luarules/gadgets/unit_prevent_load_hax.lua index daf9f85a2b6..d91e75b36e6 100644 --- a/luarules/gadgets/unit_prevent_load_hax.lua +++ b/luarules/gadgets/unit_prevent_load_hax.lua @@ -4,22 +4,22 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Prevent Load Hax", - desc = "Prevent Load Hax", - author = "TheFatController", - date = "Jul 20, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Prevent Load Hax", + desc = "Prevent Load Hax", + author = "TheFatController", + date = "Jul 20, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (not gadgetHandler:IsSyncedCode()) then - return false +if not gadgetHandler:IsSyncedCode() then + return false end local GiveOrderToUnit = Spring.GiveOrderToUnit @@ -43,79 +43,83 @@ function gadget:Initialize() end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua, fromInsert) - if fromSynced then return true end - if fromInsert then - if watchList[unitID] then - return false - end - if (cmdID == CMD_LOAD_UNITS) then - fromInsert = nil - return gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua, fromInsert) - end - local cQueue = GetUnitCommands(unitID,20) - if (#cQueue > 0) then - for i=1,#cQueue do - local command = cQueue[i] - if (command.id == CMD_LOAD_UNITS) and (#command.params == 1) then - watchList[unitID] = GetGameFrame() + 30 - return false - end - end - end - elseif (cmdID == CMD_REMOVE) then - if watchList[unitID] then - return false - end - local cQueue = GetUnitCommands(unitID,20) - if (#cQueue > 0) then - for i=1,#cQueue do - local command = cQueue[i] - if (command.id == CMD_LOAD_UNITS) and (#command.params == 1) then - watchList[unitID] = GetGameFrame() + 30 - return false - end - end - end - elseif (cmdID == CMD_LOAD_UNITS) then - if cmdParams[4] then - local tx,ty,tz = GetUnitPosition(unitID) - local dist = math.sqrt(((cmdParams[1]-tx)*(cmdParams[1]-tx))+((cmdParams[3]-tz)*(cmdParams[3]-tz))) - if (dist < math.max(100,cmdParams[4])) then - local angle = (math.random()*6.28)-3.14 - GiveOrderToUnit(unitID, CMD_MOVE, {cmdParams[1] + (math.sin(angle) * 120),ty, cmdParams[3] + (math.cos(angle) * 120)}, cmdOptions.coded) - GiveOrderToUnit(unitID, CMD_LOAD_UNITS, cmdParams, {"shift"}) - watchList[unitID] = GetGameFrame() + 45 - return false - else - return true - end - else - local dist = GetUnitSeparation(unitID, cmdParams[1]) - if (not dist) then return false end - if ((dist < 80) and (GetUnitTeam(unitID) ~= GetUnitTeam(cmdParams[1]))) then - local tx,ty,tz = GetUnitPosition(unitID) - local ux,_,uz = GetUnitPosition(cmdParams[1]) - local angle = math.atan2((tx-ux),(tz-uz)) - if (cmdTag ~= "nr") then - GiveOrderToUnit(unitID, CMD_MOVE, {ux + (math.sin(angle) * 100),ty, uz + (math.cos(angle) * 100)}, cmdOptions.coded) - GiveOrderToUnit(unitID, CMD_LOAD_UNITS, cmdParams, {"shift"}) - watchList[unitID] = GetGameFrame() + 45 - end - return false - else - return true - end - end - end - return true + if fromSynced then + return true + end + if fromInsert then + if watchList[unitID] then + return false + end + if cmdID == CMD_LOAD_UNITS then + fromInsert = nil + return gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, cmdTag, playerID, fromSynced, fromLua, fromInsert) + end + local cQueue = GetUnitCommands(unitID, 20) + if #cQueue > 0 then + for i = 1, #cQueue do + local command = cQueue[i] + if (command.id == CMD_LOAD_UNITS) and (#command.params == 1) then + watchList[unitID] = GetGameFrame() + 30 + return false + end + end + end + elseif cmdID == CMD_REMOVE then + if watchList[unitID] then + return false + end + local cQueue = GetUnitCommands(unitID, 20) + if #cQueue > 0 then + for i = 1, #cQueue do + local command = cQueue[i] + if (command.id == CMD_LOAD_UNITS) and (#command.params == 1) then + watchList[unitID] = GetGameFrame() + 30 + return false + end + end + end + elseif cmdID == CMD_LOAD_UNITS then + if cmdParams[4] then + local tx, ty, tz = GetUnitPosition(unitID) + local dist = math.sqrt(((cmdParams[1] - tx) * (cmdParams[1] - tx)) + ((cmdParams[3] - tz) * (cmdParams[3] - tz))) + if dist < math.max(100, cmdParams[4]) then + local angle = (math.random() * 6.28) - 3.14 + GiveOrderToUnit(unitID, CMD_MOVE, { cmdParams[1] + (math.sin(angle) * 120), ty, cmdParams[3] + (math.cos(angle) * 120) }, cmdOptions.coded) + GiveOrderToUnit(unitID, CMD_LOAD_UNITS, cmdParams, { "shift" }) + watchList[unitID] = GetGameFrame() + 45 + return false + else + return true + end + else + local dist = GetUnitSeparation(unitID, cmdParams[1]) + if not dist then + return false + end + if (dist < 80) and (GetUnitTeam(unitID) ~= GetUnitTeam(cmdParams[1])) then + local tx, ty, tz = GetUnitPosition(unitID) + local ux, _, uz = GetUnitPosition(cmdParams[1]) + local angle = math.atan2((tx - ux), (tz - uz)) + if cmdTag ~= "nr" then + GiveOrderToUnit(unitID, CMD_MOVE, { ux + (math.sin(angle) * 100), ty, uz + (math.cos(angle) * 100) }, cmdOptions.coded) + GiveOrderToUnit(unitID, CMD_LOAD_UNITS, cmdParams, { "shift" }) + watchList[unitID] = GetGameFrame() + 45 + end + return false + else + return true + end + end + end + return true end function gadget:GameFrame(n) - for unitID,t in pairs(watchList) do - if (n > t) then - watchList[unitID] = nil - end - end + for unitID, t in pairs(watchList) do + if n > t then + watchList[unitID] = nil + end + end end -------------------------------------------------------------------------------- diff --git a/luarules/gadgets/unit_prevent_nanoframe_blocking_hax.lua b/luarules/gadgets/unit_prevent_nanoframe_blocking_hax.lua index 16a0159b8c2..b5486ed8c3e 100644 --- a/luarules/gadgets/unit_prevent_nanoframe_blocking_hax.lua +++ b/luarules/gadgets/unit_prevent_nanoframe_blocking_hax.lua @@ -2,17 +2,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Prevent Nanoframe Blocking Hax", - desc = "Prevents nanoframes from blocking projectiles until they have reached x% build progress", - author = "", - date = "", - license = "Hornswaggle", - layer = 0, - enabled = true + name = "Prevent Nanoframe Blocking Hax", + desc = "Prevents nanoframes from blocking projectiles until they have reached x% build progress", + author = "", + date = "", + license = "Hornswaggle", + layer = 0, + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local blockingBuildProgress = 0.05 @@ -22,10 +24,10 @@ local nanoFrameIdxToRemove = {} local CMD_ATTACK = CMD.ATTACK local function AddNanoFrame(unitID) - newNanoFrames[#newNanoFrames+1] = unitID + newNanoFrames[#newNanoFrames + 1] = unitID - local a,b,c,d,e,f,g = Spring.GetUnitBlocking(unitID) - Spring.SetUnitBlocking(unitID, a,b, false, d,e,f,g) -- non-blocking for projectiles + local a, b, c, d, e, f, g = Spring.GetUnitBlocking(unitID) + Spring.SetUnitBlocking(unitID, a, b, false, d, e, f, g) -- non-blocking for projectiles local neutral = Spring.GetUnitNeutral(unitID) newNanoFrameNeutralState[unitID] = neutral @@ -39,8 +41,8 @@ local function RemoveNanoFrame(i) --Spring.Echo("RemoveNanoFrame", i, unitID, newNanoFrameNeutralState[unitID]) if Spring.ValidUnitID(unitID) then - local a,b,c,d,e,f,g = Spring.GetUnitBlocking(unitID) - Spring.SetUnitBlocking(unitID, a,b, true, d,e,f,g) -- blocking for projectiles + local a, b, c, d, e, f, g = Spring.GetUnitBlocking(unitID) + Spring.SetUnitBlocking(unitID, a, b, true, d, e, f, g) -- blocking for projectiles local neutral = newNanoFrameNeutralState[unitID] Spring.SetUnitNeutral(unitID, neutral) @@ -53,10 +55,12 @@ end local function GetNanoFrameIdx(unitID) local i = 1 - while newNanoFrames[i] ~= unitID and i<=#newNanoFrames do + while newNanoFrames[i] ~= unitID and i <= #newNanoFrames do i = i + 1 end - if i>#newNanoFrames then return end + if i > #newNanoFrames then + return + end return i end @@ -83,7 +87,7 @@ end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) --local _,buildProgress = Spring.GetUnitIsBeingBuilt(unitID) if builderID then - local _,_,projectileBlocking = Spring.GetUnitBlocking(unitID) + local _, _, projectileBlocking = Spring.GetUnitBlocking(unitID) if projectileBlocking then AddNanoFrame(unitID) end @@ -113,9 +117,9 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, builderID) - if newNanoFrameNeutralState[unitID]~=nil then + if newNanoFrameNeutralState[unitID] ~= nil then --Spring.Echo("to remove (destroyed)", unitID) - nanoFrameIdxToRemove[#nanoFrameIdxToRemove+1] = GetNanoFrameIdx(unitID) + nanoFrameIdxToRemove[#nanoFrameIdxToRemove + 1] = GetNanoFrameIdx(unitID) end end @@ -123,10 +127,9 @@ function gadget:Initialize() gadgetHandler:RegisterAllowCommand(CMD_ATTACK) -- handle luarules reload local units = Spring.GetAllUnits() - for _,unitID in ipairs(units) do + for _, unitID in ipairs(units) do local unitDefID = Spring.GetUnitDefID(unitID) local unitTeam = Spring.GetUnitTeam(unitID) gadget:UnitCreated(unitID, unitDefID, unitTeam) end end - diff --git a/luarules/gadgets/unit_prevent_range_hax.lua b/luarules/gadgets/unit_prevent_range_hax.lua index 2179d30dbca..6cbeabf5db8 100644 --- a/luarules/gadgets/unit_prevent_range_hax.lua +++ b/luarules/gadgets/unit_prevent_range_hax.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "Jul 24, 2007", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end diff --git a/luarules/gadgets/unit_prevent_self_guard.lua b/luarules/gadgets/unit_prevent_self_guard.lua index 4ab2ce60f47..54c048fc0f1 100644 --- a/luarules/gadgets/unit_prevent_self_guard.lua +++ b/luarules/gadgets/unit_prevent_self_guard.lua @@ -1,17 +1,17 @@ function gadget:GetInfo() - return { - name = "Prevent Self Guard", - desc = "Prevents units from issuing guard commands on themselves", - author = "Trunks", - date = "2025", - enabled = true, - layer = 0, + return { + name = "Prevent Self Guard", + desc = "Prevents units from issuing guard commands on themselves", + author = "Trunks", + date = "2025", + enabled = true, + layer = 0, license = "GNU GPL, v2 or later", - } + } end if not gadgetHandler:IsSyncedCode() then - return + return end local isFactory = {} -- Factory order queue goes to built units, not themselves. @@ -20,7 +20,7 @@ for unitDefID, unitDef in ipairs(UnitDefs) do end function gadget:Initialize() - gadgetHandler:RegisterAllowCommand(CMD.GUARD) + gadgetHandler:RegisterAllowCommand(CMD.GUARD) end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams) diff --git a/luarules/gadgets/unit_prevent_share_load.lua b/luarules/gadgets/unit_prevent_share_load.lua index dbab2f0ecb1..57f85eac133 100644 --- a/luarules/gadgets/unit_prevent_share_load.lua +++ b/luarules/gadgets/unit_prevent_share_load.lua @@ -2,17 +2,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "No Share Load", - desc = "Prevents picking up units when a unit changes hands", - author = "Floris", - date = "May 2024", - license = "GNU GPL, v2 or later", - layer = -99999, - enabled = true + name = "No Share Load", + desc = "Prevents picking up units when a unit changes hands", + author = "Floris", + date = "May 2024", + license = "GNU GPL, v2 or later", + layer = -99999, + enabled = true, } end - if not gadgetHandler:IsSyncedCode() then return end diff --git a/luarules/gadgets/unit_prevent_share_self_d.lua b/luarules/gadgets/unit_prevent_share_self_d.lua index 9187c6cc339..f8a285056d0 100644 --- a/luarules/gadgets/unit_prevent_share_self_d.lua +++ b/luarules/gadgets/unit_prevent_share_self_d.lua @@ -2,17 +2,16 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "No Share Self-D", - desc = "Prevents self-destruction when a unit changes hands or a player leaves", - author = "quantum, Bluestone", - date = "July 13, 2008", - license = "GNU GPL, v2 or later", - layer = -99999, - enabled = true + name = "No Share Self-D", + desc = "Prevents self-destruction when a unit changes hands or a player leaves", + author = "quantum, Bluestone", + date = "July 13, 2008", + license = "GNU GPL, v2 or later", + layer = -99999, + enabled = true, } end - if not gadgetHandler:IsSyncedCode() then return end @@ -54,7 +53,7 @@ end function gadget:Initialize() local players = Spring.GetPlayerList() for _, playerID in pairs(players) do - local _,active,spec,teamID = spGetPlayerInfo(playerID,false) + local _, active, spec, teamID = spGetPlayerInfo(playerID, false) local leaderPlayerID, isDead, isAiTeam = Spring.GetTeamInfo(teamID, false) if isDead == 0 and not isAiTeam then --_, active, spec = spGetPlayerInfo(leaderPlayerID, false) @@ -66,9 +65,9 @@ function gadget:Initialize() end function gadget:GameFrame(gameFrame) - local active,spec,teamID + local active, spec, teamID for playerID, prevActive in pairs(monitorPlayers) do - _,active,spec,teamID = spGetPlayerInfo(playerID,false) + _, active, spec, teamID = spGetPlayerInfo(playerID, false) if spec then removeTeamSelfDOrders(teamID) monitorPlayers[playerID] = nil @@ -76,7 +75,7 @@ function gadget:GameFrame(gameFrame) if not active then removeTeamSelfDOrders(teamID) end - monitorPlayers[playerID] = active -- dont nil cause player could reconnect + monitorPlayers[playerID] = active -- dont nil cause player could reconnect end end end diff --git a/luarules/gadgets/unit_prevent_strange_orders.lua b/luarules/gadgets/unit_prevent_strange_orders.lua index a9d8f3f532d..dec4e7b0941 100644 --- a/luarules/gadgets/unit_prevent_strange_orders.lua +++ b/luarules/gadgets/unit_prevent_strange_orders.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "Aug 31, 2009", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end diff --git a/luarules/gadgets/unit_prevent_unload_hax.lua b/luarules/gadgets/unit_prevent_unload_hax.lua index 12d75e8adcb..ef9d4407ddc 100644 --- a/luarules/gadgets/unit_prevent_unload_hax.lua +++ b/luarules/gadgets/unit_prevent_unload_hax.lua @@ -1,26 +1,28 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Prevent Unload Hax", - desc = "removes unit velocity on unload (and prevents firing units across the map with 'stored' impulse)", - author = "Bluestone", - date = "12/08/2013", - license = "GNU GPL, v2 or later, horses", - layer = 0, - enabled = true - } + return { + name = "Prevent Unload Hax", + desc = "removes unit velocity on unload (and prevents firing units across the map with 'stored' impulse)", + author = "Bluestone", + date = "12/08/2013", + license = "GNU GPL, v2 or later, horses", + layer = 0, + enabled = true, + } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local frameMargin = 10 local isCommando = {} for udid, ud in pairs(UnitDefs) do - if string.find(ud.name, 'cormando') then - isCommando[udid] = true - end + if string.find(ud.name, "cormando") then + isCommando[udid] = true + end end local SpSetUnitVelocity = Spring.SetUnitVelocity @@ -34,41 +36,53 @@ local SpSetUnitDirection = Spring.SetUnitDirection local unloadedUnits = {} function gadget:UnitUnloaded(unitID, unitDefID, teamID, transportID) - if unitID == nil or unitDefID == nil or transportID == nil then return end - --FIXME: is this exception for commando this really necessary? + if unitID == nil or unitDefID == nil or transportID == nil then + return + end + --FIXME: is this exception for commando this really necessary? if isCommando[unitDefID] then - local x,y,z = SpGetUnitVelocity(transportID) - if x > 10 then x = 10 elseif x <- 10 then x = -10 end -- 10 is well above 'normal' air-trans velocity - if z > 10 then z = 10 elseif z <- 10 then z = -10 end - local bx,by,bz = SpGetUnitPosition(unitID) - if by-SpGetGroundHeight(bx,bz) < 5 then - x = 0; y = 0; z = 0 --in particular, don't give any velocity if the transport has placed the unit slightly underground (or wierdness...) - end + local x, y, z = SpGetUnitVelocity(transportID) + if x > 10 then + x = 10 + elseif x < -10 then + x = -10 + end -- 10 is well above 'normal' air-trans velocity + if z > 10 then + z = 10 + elseif z < -10 then + z = -10 + end + local bx, by, bz = SpGetUnitPosition(unitID) + if by - SpGetGroundHeight(bx, bz) < 5 then + x = 0 + y = 0 + z = 0 --in particular, don't give any velocity if the transport has placed the unit slightly underground (or wierdness...) + end SpSetUnitVelocity(unitID, x, y, z) else - -- prevent unloaded units from sliding across the map - local px,py,pz = Spring.GetUnitPosition(unitID) - local dx,dy,dz = Spring.GetUnitDirection(unitID) - local frame = SpGetGameFrame() + frameMargin - unloadedUnits[unitID] = {["px"]=px,["py"]=py,["pz"]=pz,["dx"]=dx,["dy"]=dy,["dz"]=dz,["frame"]=frame} + -- prevent unloaded units from sliding across the map + local px, py, pz = Spring.GetUnitPosition(unitID) + local dx, dy, dz = Spring.GetUnitDirection(unitID) + local frame = SpGetGameFrame() + frameMargin + unloadedUnits[unitID] = { ["px"] = px, ["py"] = py, ["pz"] = pz, ["dx"] = dx, ["dy"] = dy, ["dz"] = dz, ["frame"] = frame } - SpSetUnitVelocity(unitID, 0,0,0) + SpSetUnitVelocity(unitID, 0, 0, 0) end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - unloadedUnits[unitID] = nil + unloadedUnits[unitID] = nil end function gadget:GameFrame(frame) - -- prevent unloaded units from sliding across the map - for unitID,data in pairs(unloadedUnits) do - if data.frame == frame then - -- reset position - SpSetUnitPhysics(unitID,data.px,data.py,data.pz,0,0,0,0,0,0,0,0,0) - SpSetUnitDirection(unitID,data.dx,data.dy,data.dz) - --Spring.GiveOrderToUnit(unitID,CMD.MOVE,{data.px+10*data.dx,data.py,data.pz+10*data.dz},CMD.OPT_SHIFT) - data = nil - end - end + -- prevent unloaded units from sliding across the map + for unitID, data in pairs(unloadedUnits) do + if data.frame == frame then + -- reset position + SpSetUnitPhysics(unitID, data.px, data.py, data.pz, 0, 0, 0, 0, 0, 0, 0, 0, 0) + SpSetUnitDirection(unitID, data.dx, data.dy, data.dz) + --Spring.GiveOrderToUnit(unitID,CMD.MOVE,{data.px+10*data.dx,data.py,data.pz+10*data.dz},CMD.OPT_SHIFT) + data = nil + end + end end diff --git a/luarules/gadgets/unit_projectile_overrange.lua b/luarules/gadgets/unit_projectile_overrange.lua index 06e9656764f..080cf635eee 100644 --- a/luarules/gadgets/unit_projectile_overrange.lua +++ b/luarules/gadgets/unit_projectile_overrange.lua @@ -6,11 +6,13 @@ function gadget:GetInfo() desc = "Destroys projectiles if they exceed defined ranges", author = "SethDGamre", layer = 1, - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end ---- unit customParams ---- -- use weaponDef customparams overrange_distance to destroy projectiles exceeding its limit. @@ -67,11 +69,11 @@ local function calculateFlightFrames(initialVelocity, maximumVelocity, accelerat local framesToMaxVelocity = (maximumVelocity - initialVelocity) / accelerationRate -- Distance traveled while accelerating - local distanceAccelerating = initialVelocity * framesToMaxVelocity + 0.5 * accelerationRate * framesToMaxVelocity^2 + local distanceAccelerating = initialVelocity * framesToMaxVelocity + 0.5 * accelerationRate * framesToMaxVelocity ^ 2 if distanceAccelerating > totalDistance then -- We already traveled too much, so just calculate time with accelerated movement + quadratic equation formula - totalFrames = (mathSqrt(initialVelocity^2 + 2 * totalDistance * accelerationRate) - initialVelocity) / accelerationRate + totalFrames = (mathSqrt(initialVelocity ^ 2 + 2 * totalDistance * accelerationRate) - initialVelocity) / accelerationRate else -- Linear movement after accelerating totalFrames = framesToMaxVelocity + (totalDistance - distanceAccelerating) / maximumVelocity @@ -82,7 +84,7 @@ local function calculateFlightFrames(initialVelocity, maximumVelocity, accelerat end local function uptimeTurnFrames(turnRate) - local framesRequired = math.floor(math.rad(90) / turnRate)--the turning period is negated from uptime frames for StarburstMissiles + local framesRequired = math.floor(math.rad(90) / turnRate) --the turning period is negated from uptime frames for StarburstMissiles return framesRequired end @@ -102,8 +104,7 @@ for weaponDefID, weaponDef in pairs(WeaponDefs) do if weaponDef.type == "StarburstLauncher" then ascentFrames = math.floor(weaponDef.uptime * Game.gameSpeed - uptimeTurnFrames(weaponDef.turnRate)) end - watchParams.flightTimeFrames = calculateFlightFrames(weaponDef.startvelocity, weaponDef.projectilespeed, - weaponDef.weaponAcceleration, overRange) + ascentFrames + watchParams.flightTimeFrames = calculateFlightFrames(weaponDef.startvelocity, weaponDef.projectilespeed, weaponDef.weaponAcceleration, overRange) + ascentFrames watchParams.weaponDefID = weaponDefID --destruction methods @@ -119,7 +120,6 @@ for weaponDefID, weaponDef in pairs(WeaponDefs) do end end - local function leashCheck(maxRangeSq, proOwnerID, proX, proZ) local ownerX, _, ownerZ = spGetUnitPosition(proOwnerID) if ownerX then @@ -133,7 +133,6 @@ local function leashCheck(maxRangeSq, proOwnerID, proX, proZ) end end - local function recalculateFlightTime(proID, maxRange, x1, z1, x2, z2) local dx = x2 - x1 local dz = z2 - z1 @@ -142,7 +141,9 @@ local function recalculateFlightTime(proID, maxRange, x1, z1, x2, z2) -- Check if the projectile is within the max range if distance < maxRange then local vx, _, vz = spGetProjectileVelocity(proID) - if not vx or not vz then return false end --invalid projectile + if not vx or not vz then + return false + end --invalid projectile local remainingDistance = maxRange - distance @@ -163,7 +164,6 @@ local function setDestructionFrame(proID, newFlightTime) killQueue[triggerFrame][#killQueue[triggerFrame] + 1] = proID end - local function setFlightTimeFrame(proID, newFlightTime) local triggerFrame = gameFrame + newFlightTime @@ -171,10 +171,11 @@ local function setFlightTimeFrame(proID, newFlightTime) flightTimeWatch[triggerFrame][#flightTimeWatch[triggerFrame] + 1] = proID end - function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) local defData = defWatchTable[weaponDefID] - if not defData then return end + if not defData then + return + end setFlightTimeFrame(proID, defData.flightTimeFrames) @@ -182,7 +183,9 @@ function gadget:ProjectileCreated(proID, proOwnerID, weaponDefID) if not originX then originX, _, originZ = spGetProjectilePosition(proID) end - if not originX or not originZ then return end + if not originX or not originZ then + return + end proWeaponDefID[proID] = weaponDefID proOwnerByID[proID] = proOwnerID diff --git a/luarules/gadgets/unit_reactive_armor.lua b/luarules/gadgets/unit_reactive_armor.lua index 989ffcf6c9f..234fbb323a1 100644 --- a/luarules/gadgets/unit_reactive_armor.lua +++ b/luarules/gadgets/unit_reactive_armor.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Reactive Armor", - desc = "Ablative/reactive armor that degrades and restores.", - author = "efrec", + name = "Reactive Armor", + desc = "Ablative/reactive armor that degrades and restores.", + author = "efrec", version = "0.1.0", - date = "2025", + date = "2025", license = "GNU GPL, v2 or later", - layer = -100, -- early or late so armored state is consistent across damage events + layer = -100, -- early or late so armored state is consistent across damage events enabled = true, } end @@ -45,7 +45,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do local params = { health = tonumber(unitDef.customParams.reactive_armor_health), frames = tonumber(unitDef.customParams.reactive_armor_restore) * gameSpeed, - first = true, + first = true, } -- Units that are damaged are definitionally "in combat", so reduce the @@ -139,11 +139,9 @@ local function checkReactiveArmor(unitID, unitDefID, params) end -- Fix for the different argument types used between COB and LUS. - params.call = (not lusEnv and callFromCob) or ( - function(unitID, funcName, ...) - callFromLus(unitID, lusEnv[funcName], ...) - end - ) + params.call = (not lusEnv and callFromCob) or function(unitID, funcName, ...) + callFromLus(unitID, lusEnv[funcName], ...) + end return true end @@ -295,13 +293,13 @@ local function getUnitDebugInfo(unitID) x = x, y = y, z = z, - unitID = unitID, - unitDefID = unitDefID, - unitDefName = UnitDefs[unitDefID].name, + unitID = unitID, + unitDefID = unitDefID, + unitDefName = UnitDefs[unitDefID].name, unitDefParams = armoredUnitDefs[unitDefID] or "none", - health = Spring.GetUnitHealth(unitID), - armorFrames = unitArmorFrames[unitID] or "nil", - armorHealth = unitArmorHealth[unitID] or "nil", + health = Spring.GetUnitHealth(unitID), + armorFrames = unitArmorFrames[unitID] or "nil", + armorHealth = unitArmorHealth[unitID] or "nil", inCombatUntil = regenerateFrame[unitID] or "nil", unitCountdown = unitArmorFrames[unitID] and unitArmorFrames[unitID].countdown or "nil", } diff --git a/luarules/gadgets/unit_reclaim_fix.lua b/luarules/gadgets/unit_reclaim_fix.lua index e29aac735b6..6ed7179b512 100644 --- a/luarules/gadgets/unit_reclaim_fix.lua +++ b/luarules/gadgets/unit_reclaim_fix.lua @@ -1,19 +1,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Reclaim Fix", - desc = "Implements Old Style Reclaim.", - author = "TheFatController", -- lots of help from Lurker - date = "May 24th, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Reclaim Fix", + desc = "Implements Old Style Reclaim.", + author = "TheFatController", -- lots of help from Lurker + date = "May 24th, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return + return end local SetFeatureReclaim = Spring.SetFeatureReclaim @@ -27,47 +27,49 @@ local featureListReclaimTime = {} local unitListReclaimSpeed = {} for unitDefID, defs in pairs(UnitDefs) do - if defs.reclaimSpeed > 0 then - unitListReclaimSpeed[unitDefID] = defs.reclaimSpeed / Game.gameSpeed - end + if defs.reclaimSpeed > 0 then + unitListReclaimSpeed[unitDefID] = defs.reclaimSpeed / Game.gameSpeed + end end for featureDefID, fdefs in pairs(FeatureDefs) do - local maxResource = mathMax(fdefs.metal, fdefs.energy) - - if maxResource > 0 then + local maxResource = mathMax(fdefs.metal, fdefs.energy) + + if maxResource > 0 then featureListMaxResource[featureDefID] = maxResource featureListReclaimTime[featureDefID] = fdefs.reclaimTime - end + end end local function getStep(featureDefID, unitDefID) local maxResource = featureListMaxResource[featureDefID] local reclaimTime = featureListReclaimTime[featureDefID] local reclaimSpeed = unitListReclaimSpeed[unitDefID] - if maxResource == nil or reclaimTime == nil or reclaimSpeed == nil then return nil end + if maxResource == nil or reclaimTime == nil or reclaimSpeed == nil then + return nil + end return ((0.05 * reclaimSpeed + 4.5) / reclaimTime) --there's [reclaimSpeed / reclaimTime] amount of reclaim, added on top of this from engine end - function gadget:AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, step) - if step > 0 or featureListMaxResource[featureDefID] == nil then - return true - end - local unitDefID = GetUnitDefID(builderID) - + if step > 0 or featureListMaxResource[featureDefID] == nil then + return true + end + local unitDefID = GetUnitDefID(builderID) + local newstep = getStep(featureDefID, unitDefID) - if newstep == nil then return true end - - local newpercent = select(5, GetFeatureResources(featureID)) - newstep - SetFeatureReclaim(featureID, newpercent) - return true -end + if newstep == nil then + return true + end + local newpercent = select(5, GetFeatureResources(featureID)) - newstep + SetFeatureReclaim(featureID, newpercent) + return true +end -- when a wreck dies and becomes a heap, we need to set the reclaim % of the heap to be equal to its 'parent' wreck -- order of callins below: featurecreated (for heap), feature destroyed (for wreck), gameframe --- two features should not be able to occupy the same pos on the same frame +-- two features should not be able to occupy the same pos on the same frame -- so; keep track of features created on that frame, then when a feature dies in coord matching the feature created, transfer reclaim % onto it -- no need to transfer rez % since heaps are not rezzable local featuresCreatedThisFrame = {} @@ -75,30 +77,29 @@ local featuresCreatedThisFrame = {} function gadget:FeatureCreated(featureID, allyTeamID) --record feature creation --Spring.Echo("created:",featureID) - featuresCreatedThisFrame[#featuresCreatedThisFrame+1] = featureID + featuresCreatedThisFrame[#featuresCreatedThisFrame + 1] = featureID end function gadget:FeatureDestroyed(featureID, allyTeamID) - local bpx,bpy,bpz = GetFeaturePosition(featureID) - local _,_,_,_, reclaimLeft = GetFeatureResources(featureID) + local bpx, bpy, bpz = GetFeaturePosition(featureID) + local _, _, _, _, reclaimLeft = GetFeatureResources(featureID) --Spring.Echo("died:", featureID, bpx,bpy,bpz,reclaimLeft, heap) --seek out heap, if one exists local replaceFID - for i=1,#featuresCreatedThisFrame do + for i = 1, #featuresCreatedThisFrame do local nbpx, nbpy, nbpz = GetFeaturePosition(featuresCreatedThisFrame[i]) --Spring.Echo("possible", featuresCreatedThisFrame[i], bpx,bpy,bpz,nbpx,nbpy,nbpz) - if bpx==nbpx and bpy==nbpy and bpz==nbpz then --floating point errors + if bpx == nbpx and bpy == nbpy and bpz == nbpz then --floating point errors replaceFID = featuresCreatedThisFrame[i] end end - + --set heap reclaim % if replaceFID and reclaimLeft then --Spring.Echo("set:", replaceFID, reclaimLeft) SetFeatureReclaim(replaceFID, reclaimLeft) end - end function gadget:GameFrame() @@ -111,4 +112,4 @@ function gadget:GameFrame() end -------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------------- diff --git a/luarules/gadgets/unit_refund_on_lab_reclaimed.lua b/luarules/gadgets/unit_refund_on_lab_reclaimed.lua index 42a240ddd62..2845129d69e 100644 --- a/luarules/gadgets/unit_refund_on_lab_reclaimed.lua +++ b/luarules/gadgets/unit_refund_on_lab_reclaimed.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Refund on lab reclaimed", - desc = "Refunds metal when factory is reclaimed by ally while producing", - author = "Pexo", - date = "29.03.2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Refund on lab reclaimed", + desc = "Refunds metal when factory is reclaimed by ally while producing", + author = "Pexo", + date = "29.03.2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -60,11 +60,11 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD local queuedUnitDefID = queuedData.unitDefID factoryQueue[unitID] = nil - if weaponDefID ~= reclaimedWeaponDefID then + if weaponDefID ~= reclaimedWeaponDefID then return end - if not attackerTeam or not spAreTeamsAllied(unitTeam, attackerTeam) then + if not attackerTeam or not spAreTeamsAllied(unitTeam, attackerTeam) then return end @@ -96,4 +96,4 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD else spAddTeamResource(unitTeam, "m", refund) end -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_respawning.lua b/luarules/gadgets/unit_respawning.lua index af523790ec9..915f19954dd 100644 --- a/luarules/gadgets/unit_respawning.lua +++ b/luarules/gadgets/unit_respawning.lua @@ -1,5 +1,3 @@ - - local gadget = gadget ---@type Gadget function gadget:GetInfo() @@ -10,31 +8,27 @@ function gadget:GetInfo() date = "2023-05-12, 2026", license = "None", layer = 49, - enabled = true + enabled = true, } end if gadgetHandler:IsSyncedCode() then - - local spCreateUnit = Spring.CreateUnit - local spDestroyUnit = Spring.DestroyUnit - local spGiveOrderToUnit = Spring.GiveOrderToUnit - local spSetUnitRulesParam = Spring.SetUnitRulesParam - local spGetUnitPosition = Spring.GetUnitPosition + local spCreateUnit = Spring.CreateUnit + local spDestroyUnit = Spring.DestroyUnit + local spGiveOrderToUnit = Spring.GiveOrderToUnit + local spSetUnitRulesParam = Spring.SetUnitRulesParam + local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitRulesParam = Spring.GetUnitRulesParam - local spGetUnitHealth = Spring.GetUnitHealth - local spGetUnitTeam = Spring.GetUnitTeam + local spGetUnitHealth = Spring.GetUnitHealth + local spGetUnitTeam = Spring.GetUnitTeam local spSetUnitHealth = Spring.SetUnitHealth local spGetGameSeconds = Spring.GetGameSeconds local spGetGameFrame = Spring.GetGameFrame local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy local spGetUnitDefID = Spring.GetUnitDefID - - local diag = math.diag - local PRIVATE = { private = true } local respawnMetaList = {} @@ -59,31 +53,27 @@ if gadgetHandler:IsSyncedCode() then end end - --messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) - -- SethDGamre, values can be tuned in the unitdef file. Add the section below to the unitdef list in the unitdef file. --customparams = { - -- -- Required: - -- respawn_condition = "health", sets the respawn condition. Health is the only option implemented - - - -- -- Optional: - -- effigy = "unit_name", --Set this to spawn the effigy unit when the main unit is created. - -- minimum_respawn_stun = 5, --respawn stun duration, roughly in seconds. - -- distance_stun_multiplier = 1, --respawn stun duration based on distance from respawn location when dying. (distance * distance_stun_multiplier) - -- respawn_pad = true, --set this to true if you want the effigy to stay where it is when respawning. Use this if the effigy unit is a respawn pad or similar. - -- iseffigy = true, --set this in the unitdef of the effigies that are buildable by the player. + -- -- Required: + -- respawn_condition = "health", sets the respawn condition. Health is the only option implemented - -- -- Has a default value, as indicated, if not chosen: - -- respawn_health_threshold = 0, --The health value when the unit will initiate the respawn sequence. - -- destructive_respawn = true, 1, -- If this is set to true, the effigy unit will be destroyed when the unit respawns, can also be set to a number to provide that n-1 respawns or n instances of that unit with 0 for infinite - -- respawn_health = 1, -- If this is set to a number set the respawned units health to that number when respawning. - -- respawn_stun_duration = calculated by distance/maxHealth, -- Override the stun duration to a static value + -- -- Optional: + -- effigy = "unit_name", --Set this to spawn the effigy unit when the main unit is created. + -- minimum_respawn_stun = 5, --respawn stun duration, roughly in seconds. + -- distance_stun_multiplier = 1, --respawn stun duration based on distance from respawn location when dying. (distance * distance_stun_multiplier) + -- respawn_pad = true, --set this to true if you want the effigy to stay where it is when respawning. Use this if the effigy unit is a respawn pad or similar. + -- iseffigy = true, --set this in the unitdef of the effigies that are buildable by the player. + -- -- Has a default value, as indicated, if not chosen: + -- respawn_health_threshold = 0, --The health value when the unit will initiate the respawn sequence. + -- destructive_respawn = true, 1, -- If this is set to true, the effigy unit will be destroyed when the unit respawns, can also be set to a number to provide that n-1 respawns or n instances of that unit with 0 for infinite + -- respawn_health = 1, -- If this is set to a number set the respawned units health to that number when respawning. + -- respawn_stun_duration = calculated by distance/maxHealth, -- Override the stun duration to a static value - -- }, + -- }, for id, def in pairs(UnitDefs) do if def.customParams.respawn_condition or def.customParams.iseffigy then @@ -91,14 +81,14 @@ if gadgetHandler:IsSyncedCode() then end end - function ReturnToBase(unitID, friendlyFire) - local x,y,z = spGetUnitPosition(unitID) -- usefull if you want to spawn explosions or other effects where you were. + function ReturnToBase(unitID, friendlyFire) + local x, y, z = spGetUnitPosition(unitID) -- usefull if you want to spawn explosions or other effects where you were. local meta = respawnMetaList[unitID] if meta.effigyID then local health, maxHealth = spGetUnitHealth(unitID) local effigyID = meta.effigyID - local ex,ey,ez = spGetUnitPosition(effigyID) + local ex, ey, ez = spGetUnitPosition(effigyID) Spring.SetUnitPosition(unitID, ex, ez, true) Spring.SpawnCEG("commander-spawn", ex, ey, ez, 0, 0, 0) if GG.SpawnEnvironmentalLightning then @@ -124,13 +114,13 @@ if gadgetHandler:IsSyncedCode() then -- Cache stun parameters before destroying effigy, since the explosion -- could kill the commander and nil out respawnMetaList[unitID] - local stunDuration = maxHealth + ((maxHealth/30)*meta.minimum_respawn_stun) + (((maxHealth/30)*diag((x-ex), (z-ez))*meta.distance_stun_multiplier)/250)--250 is an arbitrary number that seems to produce desired results. + local stunDuration = maxHealth + ((maxHealth / 30) * meta.minimum_respawn_stun) + (((maxHealth / 30) * diag((x - ex), (z - ez)) * meta.distance_stun_multiplier) / 250) --250 is an arbitrary number that seems to produce desired results. if meta.destructive_respawn == 1 then - if friendlyFire then - destroyEffigy(effigyID, false, true) - else - destroyEffigy(effigyID, false, false) + if friendlyFire then + destroyEffigy(effigyID, false, true) + else + destroyEffigy(effigyID, false, false) end spSetUnitRulesParam(unitID, "unit_effigy", nil, PRIVATE) end @@ -149,7 +139,7 @@ if gadgetHandler:IsSyncedCode() then end -- Only apply stun if the unit survived the effigy destruction if respawnMetaList[unitID] then - spSetUnitHealth(unitID, {health = respawnHealth, capture = 0, paralyze = stunDuration}) + spSetUnitHealth(unitID, { health = respawnHealth, capture = 0, paralyze = stunDuration }) spGiveOrderToUnit(unitID, CMD.STOP, {}, 0) end end @@ -163,12 +153,12 @@ if gadgetHandler:IsSyncedCode() then for _, playerID in ipairs(allPlayers) do local playerName, active, isSpectator, teamID, allyTeamID = Spring.GetPlayerInfo(playerID, true) if teamID and unitTeam and not isSpectator then - if teamID == unitTeam then - notificationEvent = "RespawningCommanders/CommanderTransposed" - elseif teamID and Spring.AreTeamsAllied(teamID, unitTeam) then - notificationEvent = "RespawningCommanders/AlliedCommanderTransposed" - else - notificationEvent = "RespawningCommanders/EnemyCommanderTransposed" + if teamID == unitTeam then + notificationEvent = "RespawningCommanders/CommanderTransposed" + elseif teamID and Spring.AreTeamsAllied(teamID, unitTeam) then + notificationEvent = "RespawningCommanders/AlliedCommanderTransposed" + else + notificationEvent = "RespawningCommanders/EnemyCommanderTransposed" end elseif isSpectator then notificationEvent = "RespawningCommanders/CommanderTransposed" @@ -178,8 +168,7 @@ if gadgetHandler:IsSyncedCode() then end end end - end - + end function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) local udcp = defCustomParams[unitDefID] @@ -202,15 +191,15 @@ if gadgetHandler:IsSyncedCode() then respawnTimer = spGetGameSeconds(), effigyID = nil, respawn_health = tonumber(udcp.respawn_health), - respawn_stun_duration = tonumber(udcp.respawn_stun_duration), + respawn_stun_duration = tonumber(udcp.respawn_stun_duration), } if respawnMetaList[unitID].effigy ~= "none" then local blockedIncrement = 1 for i = 1, 500, blockedIncrement do local x, y, z = spGetUnitPosition(unitID) - local blockType, blockID = Spring.GetGroundBlocked(x-i, z-i) - local groundH = Spring.GetGroundHeight(x-i, z-i) + local blockType, blockID = Spring.GetGroundBlocked(x - i, z - i) + local groundH = Spring.GetGroundHeight(x - i, z - i) if respawnMetaList[unitID].effigy_offset == 0 then local newUnitID = spCreateUnit(respawnMetaList[unitID].effigy, x, groundH, z, 0, unitTeam) @@ -221,21 +210,21 @@ if gadgetHandler:IsSyncedCode() then return end elseif not blockType then - local newUnitID = spCreateUnit(respawnMetaList[unitID].effigy, x-i, groundH, z-i, 0, unitTeam) + local newUnitID = spCreateUnit(respawnMetaList[unitID].effigy, x - i, groundH, z - i, 0, unitTeam) spSetUnitRulesParam(unitID, "unit_effigy", newUnitID, PRIVATE) if newUnitID then respawnMetaList[unitID].effigyID = newUnitID effigyToCommander[newUnitID] = unitID return else - blockedIncrement = blockedIncrement+50 + blockedIncrement = blockedIncrement + 50 end end end end end - if udcp.iseffigy and builderID then + if udcp.iseffigy and builderID then if respawnMetaList[builderID] then local oldeffigyID = respawnMetaList[builderID].effigyID respawnMetaList[builderID].effigyID = unitID @@ -244,7 +233,7 @@ if gadgetHandler:IsSyncedCode() then if oldeffigyID then local oldEffigyBuildProgress = select(5, spGetUnitHealth(oldeffigyID)) if oldEffigyBuildProgress == 1 then - Spring.SetUnitCosts(unitID, {buildTime = 1, metalCost = 1, energyCost = 1}) + Spring.SetUnitCosts(unitID, { buildTime = 1, metalCost = 1, energyCost = 1 }) end destroyEffigy(oldeffigyID, false, true) end @@ -253,7 +242,6 @@ if gadgetHandler:IsSyncedCode() then for vipID, _ in pairs(respawnMetaList) do local team = spGetUnitTeam(vipID) if team == unitTeam then - local oldeffigyID = respawnMetaList[vipID].effigyID respawnMetaList[vipID].effigyID = unitID @@ -262,7 +250,7 @@ if gadgetHandler:IsSyncedCode() then if oldeffigyID then local oldEffigyBuildProgress = select(5, spGetUnitHealth(oldeffigyID)) if oldEffigyBuildProgress == 1 then - Spring.SetUnitCosts(unitID, {buildTime = 1, metalCost = 1, energyCost = 1}) + Spring.SetUnitCosts(unitID, { buildTime = 1, metalCost = 1, energyCost = 1 }) end destroyEffigy(oldeffigyID, false, true) end @@ -274,7 +262,6 @@ if gadgetHandler:IsSyncedCode() then end end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) enemyNearbyCacheFrame[unitID] = nil enemyNearbyCacheValue[unitID] = nil @@ -300,7 +287,7 @@ if gadgetHandler:IsSyncedCode() then if respawnMetaList[unitID] then if respawnMetaList[unitID].respawn_pad == "false" then local newID = spGetUnitRulesParam(unitID, "unit_evolved") - if newID then + if newID then if respawnMetaList[newID] and respawnMetaList[newID].effigyID then if respawnMetaList[unitID].effigyID then local effigyBuildProgress = select(5, spGetUnitHealth(respawnMetaList[unitID].effigyID)) @@ -313,7 +300,7 @@ if gadgetHandler:IsSyncedCode() then end if respawnMetaList[unitID].effigyID then if respawnMetaList[newID] and respawnMetaList[newID].effigyID then - local ex,ey,ez = spGetUnitPosition(respawnMetaList[unitID].effigyID) + local ex, ey, ez = spGetUnitPosition(respawnMetaList[unitID].effigyID) if ex then Spring.SetUnitPosition(respawnMetaList[newID].effigyID, ex, ez, true) else @@ -339,8 +326,8 @@ if gadgetHandler:IsSyncedCode() then if meta then if meta.respawn_condition == "health" then local h, mh = spGetUnitHealth(unitID) - local currentTime = spGetGameSeconds() - if meta.effigyID and (h-damage) <= meta.respawn_health_threshold and (currentTime-meta.respawnTimer) >= 5 then + local currentTime = spGetGameSeconds() + if meta.effigyID and (h - damage) <= meta.respawn_health_threshold and (currentTime - meta.respawnTimer) >= 5 then local effigyBuildProgress = select(5, spGetUnitHealth(meta.effigyID)) if effigyBuildProgress == 1 then if not attackerTeam then @@ -354,18 +341,13 @@ if gadgetHandler:IsSyncedCode() then meta.respawnTimer = spGetGameSeconds() return 0, 0 end - elseif (currentTime-meta.respawnTimer) <= 5 then + elseif (currentTime - meta.respawnTimer) <= 5 then return 0, 0 end end end end - - - else - - local spGetGameSeconds = Spring.GetGameSeconds local announcementStart = 0 @@ -383,7 +365,6 @@ else local fontfileOutlineStrength = 1.4 local font = gl.LoadFont(fontfile, fontfileSize * fontfileScale, fontfileOutlineSize * fontfileScale, fontfileOutlineStrength) - local function Draw(newAnnouncement, newAnnouncementSize) vsx, vsy = Spring.GetViewGeometry() local uiScale = (0.7 + (vsx * vsy / 6500000)) @@ -413,7 +394,7 @@ else end if announcementEnabled then local currentTime = spGetGameSeconds() - if currentTime-announcementStart < 3 then + if currentTime - announcementStart < 3 then Draw(announcement, announcementSize) else announcementEnabled = false @@ -433,12 +414,10 @@ else gl.Texture(1, "LuaUI/images/gradient_alpha_2.png") gl.TexRect(0, 0, w, h) end) - end function gadget:Shutdown() gadgetHandler:RemoveSyncAction("unit_respawned") gl.DeleteList(displayList) end - end diff --git a/luarules/gadgets/unit_resurrected.lua b/luarules/gadgets/unit_resurrected.lua index 97de32e5878..fc5d644ebfe 100644 --- a/luarules/gadgets/unit_resurrected.lua +++ b/luarules/gadgets/unit_resurrected.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Resurrection Behavior", - desc = "Handles starting health, wait until repair, and transferring oldUnit > corpse > newUnit data.", - author = "Floris, Chronographer, SethDGamre", - date = "4 November 2025", - license = "GNU GPL, v2 or later", - layer = 5, -- FIXME why? - enabled = true - } + return { + name = "Resurrection Behavior", + desc = "Handles starting health, wait until repair, and transferring oldUnit > corpse > newUnit data.", + author = "Floris, Chronographer, SethDGamre", + date = "4 November 2025", + license = "GNU GPL, v2 or later", + layer = 5, -- FIXME why? + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then @@ -20,7 +20,7 @@ local CMD_RESURRECT = CMD.RESURRECT local CMD_WAIT = CMD.WAIT local CMD_FIRE_STATE = CMD.FIRE_STATE local CMD_MOVE_STATE = CMD.MOVE_STATE -local VISIBILITY_INLOS = {inlos = true} +local VISIBILITY_INLOS = { inlos = true } local UPDATE_INTERVAL = Game.gameSpeed local TIMEOUT_FRAMES = Game.gameSpeed * 3 -- long enough to get grabbed by FeatureCreated callback @@ -36,7 +36,7 @@ local prevHealth = {} local priorStates = {} -- unitID = { timeout, firestate, movestate, xp } for unitDefID, unitDef in pairs(UnitDefs) do - shouldWaitForHealing[unitDefID] = (not unitDef.isBuilding) and (not unitDef.isBuilder) + shouldWaitForHealing[unitDefID] = (not unitDef.isBuilding) and not unitDef.isBuilder end local function RestoreStateMechanics(unitID, featureID) @@ -94,7 +94,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) timeout = Spring.GetGameFrame() + TIMEOUT_FRAMES, firestate = states.firestate, movestate = states.movestate, - xp = Spring.GetUnitExperience(unitID) + xp = Spring.GetUnitExperience(unitID), } end @@ -142,4 +142,4 @@ function gadget:GameFrame(frame) end end end -end \ No newline at end of file +end diff --git a/luarules/gadgets/unit_reverse_move.lua b/luarules/gadgets/unit_reverse_move.lua index 40236cd0193..c47af72495c 100644 --- a/luarules/gadgets/unit_reverse_move.lua +++ b/luarules/gadgets/unit_reverse_move.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "27 of July 2017", license = "GNU GPL, v2 or later", layer = 0, - enabled = false + enabled = false, } end diff --git a/luarules/gadgets/unit_scenario_loadout.lua b/luarules/gadgets/unit_scenario_loadout.lua index 2f9ea6263f2..53ad14c18e9 100644 --- a/luarules/gadgets/unit_scenario_loadout.lua +++ b/luarules/gadgets/unit_scenario_loadout.lua @@ -26,7 +26,8 @@ local function rot_to_facing(rotation) "east" | "e" | 1 == 16384 "north" | "n" | 2 == +32 or -32k "west" | "w" | 3 == -16384 - ]]-- + ]] + -- if rotation < 8192 and rotation > -8192 then return 0 end @@ -50,10 +51,10 @@ function gadget:Initialize() end function gadget:GamePreload() - if Spring.GetGameRulesParam("loadedGame") == 1 then - Spring.Echo("Scenario: Loading saved game, skipping loadout") + if Spring.GetGameRulesParam("loadedGame") == 1 then + Spring.Echo("Scenario: Loading saved game, skipping loadout") gadgetHandler:RemoveGadget(self) - end + end if Spring.GetGameFrame() < 1 and not loadoutcomplete then -- so that loaded savegames dont re-place @@ -68,23 +69,22 @@ function gadget:GamePreload() for k, unit in pairs(unitloadout) do -- make sure unitdefname is valid if UnitDefNames[unit.name] then - local rot = rot_to_facing(unit.rot) local unitID = Spring.CreateUnit(unit.name, unit.x, Spring.GetGroundHeight(unit.x, unit.z), unit.z, rot, unit.team) if unitID then Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, 0) if UnitDefNames[unit.name].energyStorage > 0 or UnitDefNames[unit.name].metalStorage > 0 then if additionalStorage[unit.team] == nil then - additionalStorage[unit.team] = {metal = 0, energy = 0} + additionalStorage[unit.team] = { metal = 0, energy = 0 } end - additionalStorage[unit.team].metal = additionalStorage[unit.team].metal + (UnitDefNames[unit.name].metalStorage or 0 ) - additionalStorage[unit.team].energy = additionalStorage[unit.team].energy + (UnitDefNames[unit.name].energyStorage or 0 ) + additionalStorage[unit.team].metal = additionalStorage[unit.team].metal + (UnitDefNames[unit.name].metalStorage or 0) + additionalStorage[unit.team].energy = additionalStorage[unit.team].energy + (UnitDefNames[unit.name].energyStorage or 0) end end if string.find(unit.name, "nanotc") then nanoturretunitIDs[unitID] = true end - if unit.neutral == true or unit.neutral == 'true' then + if unit.neutral == true or unit.neutral == "true" then Spring.SetUnitNeutral(unitID, true) end else @@ -112,11 +112,10 @@ function gadget:GamePreload() end end end - loadoutcomplete = true + loadoutcomplete = true --gadgetHandler:RemoveGadget(self) end - function gadget:GameFrame(n) if n == 1 then if next(nanoturretunitIDs) then @@ -128,8 +127,8 @@ function gadget:GameFrame(n) for teamID, additionalstorage in pairs(additionalStorage) do local m, mstore = Spring.GetTeamResources(teamID, "metal") local e, estore = Spring.GetTeamResources(teamID, "energy") - Spring.SetTeamResource(teamID, 'ms', mstore + additionalstorage.metal) - Spring.SetTeamResource(teamID, 'es', estore + additionalstorage.energy) + Spring.SetTeamResource(teamID, "ms", mstore + additionalstorage.metal) + Spring.SetTeamResource(teamID, "es", estore + additionalstorage.energy) end additionalStorage = nil end @@ -146,5 +145,6 @@ function gadget:GameFrame(n) if estore < 500 then Spring.SetTeamResource(teamID, 'es', 500) end end end - ]]-- + ]] + -- end diff --git a/luarules/gadgets/unit_scenario_script.lua b/luarules/gadgets/unit_scenario_script.lua index 7652c81fd72..2cc6b228dd2 100644 --- a/luarules/gadgets/unit_scenario_script.lua +++ b/luarules/gadgets/unit_scenario_script.lua @@ -2,29 +2,29 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Scenario Script", - desc = "Controller for Scenarios basic script & triggers", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = 999999, - enabled = true, + name = "Scenario Script", + desc = "Controller for Scenarios basic script & triggers", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = 999999, + enabled = true, } end if gadgetHandler:IsSyncedCode() then - isSynced = true + isSynced = true else - isSynced = false + isSynced = false end local function GetScenarioID() - if Spring.GetModOptions().scenariooptions then - local scenariooptions = string.base64Decode(Spring.GetModOptions().scenariooptions) - scenariooptions = Json.decode(scenariooptions) - return scenariooptions.scenarioid - end - return nil + if Spring.GetModOptions().scenariooptions then + local scenariooptions = string.base64Decode(Spring.GetModOptions().scenariooptions) + scenariooptions = Json.decode(scenariooptions) + return scenariooptions.scenarioid + end + return nil end local scenarioid = GetScenarioID() @@ -32,9 +32,9 @@ if not scenarioid then return end -if not VFS.FileExists("singleplayer/scenarios/scenarioscripts/"..scenarioid..".lua") then - return +if not VFS.FileExists("singleplayer/scenarios/scenarioscripts/" .. scenarioid .. ".lua") then + return end -Spring.Echo("Scenario ID: "..scenarioid) -VFS.Include("singleplayer/scenarios/scenarioscripts/"..scenarioid..".lua") \ No newline at end of file +Spring.Echo("Scenario ID: " .. scenarioid) +VFS.Include("singleplayer/scenarios/scenarioscripts/" .. scenarioid .. ".lua") diff --git a/luarules/gadgets/unit_script.lua b/luarules/gadgets/unit_script.lua index d6866395fa3..4454b8ef73f 100644 --- a/luarules/gadgets/unit_script.lua +++ b/luarules/gadgets/unit_script.lua @@ -18,29 +18,28 @@ Known issues: To do: - Test real world performance (compared to COB) -]]-- +]] +-- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { - name = "Lua unit script framework", - desc = "Manages Lua unit scripts", - author = "Tobi Vollebregt", - date = "2 September 2009", - license = "GPL v2", - layer = 0, - enabled = true -- loaded by default? + name = "Lua unit script framework", + desc = "Manages Lua unit scripts", + author = "Tobi Vollebregt", + date = "2 September 2009", + license = "GPL v2", + layer = 0, + enabled = true, -- loaded by default? } end - -if (not gadgetHandler:IsSyncedCode()) then +if not gadgetHandler:IsSyncedCode() then return false end - -- This lists all callins which may be wrapped in a coroutine (thread). -- The ones which should not be thread-wrapped are commented out. -- Create, Killed, AimWeapon and AimShield callins are always wrapped. @@ -132,7 +131,7 @@ local sp_GetUnitPieceMap = Spring.GetUnitPieceMap -- Keep local reference to engine's CallAsUnit/WaitForMove/WaitForTurn, -- as we overwrite them with (safer) framework version later on. -local sp_CallAsUnit = Spring.UnitScript.CallAsUnit +local sp_CallAsUnit = Spring.UnitScript.CallAsUnit local sp_WaitForMove = Spring.UnitScript.WaitForMove local sp_WaitForTurn = Spring.UnitScript.WaitForTurn local sp_WaitForScale = Spring.UnitScript.WaitForScale @@ -144,12 +143,12 @@ local LUA_WEAPON_MAX_INDEX = LUA_WEAPON_MIN_INDEX + 31 local UNITSCRIPT_DIR = (UNITSCRIPT_DIR or "scripts/"):lower() local VFSMODE = VFS.ZIP_ONLY -if (Spring.IsDevLuaEnabled()) then +if Spring.IsDevLuaEnabled() then VFSMODE = VFS.RAW_ONLY end -- needed here too, and gadget handler doesn't expose it -VFS.Include('LuaGadgets/system.lua', nil, VFSMODE) +VFS.Include("LuaGadgets/system.lua", nil, VFSMODE) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -191,7 +190,6 @@ Format: { --]] local units = {} - -- this keeps track of the unit that is active (ie. -- running a script) at the time a callin triggers -- @@ -212,7 +210,6 @@ local function GetActiveUnit() return units[activeUnitStack[#activeUnitStack]] end - --[[ This is the bed, it stores all the sleeping threads, indexed by the frame in which they need to be woken up. @@ -224,7 +221,7 @@ Format: { (inner tables are in order the calls to Sleep were made) --]] local sleepers = {} -local section = 'unit_script.lua' +local section = "unit_script.lua" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -236,8 +233,8 @@ local section = 'unit_script.lua' -- no holes --> uses table.remove() instead of tab[i] = nil. local function RemoveTableElement(tab, item) local n = #tab - for i = 1,n do - if (tab[i] == item) then + for i = 1, n do + if tab[i] == item then table_remove(tab, i) return end @@ -249,7 +246,7 @@ local function Destroy() local activeUnit = GetActiveUnit() if activeUnit ~= nil then - for _,thread in pairs(activeUnit.threads) do + for _, thread in pairs(activeUnit.threads) do if thread.container then RemoveTableElement(thread.container, thread) end @@ -293,7 +290,7 @@ local function AnimFinished(waitingForAnim, piece, axis) if wthreads then waitingForAnim[index] = {} - while (#wthreads > 0) do + while #wthreads > 0 do wthread = wthreads[#wthreads] wthreads[#wthreads] = nil @@ -326,7 +323,7 @@ end -- overwrites engine's CallAsUnit function Spring.UnitScript.CallAsUnit(unitID, fun, ...) PushActiveUnitID(unitID) - local ret = {sp_CallAsUnit(unitID, fun, ...)} + local ret = { sp_CallAsUnit(unitID, fun, ...) } PopActiveUnitID() return unpack(ret) @@ -343,12 +340,12 @@ end local function WaitForAnim(threads, waitingForAnim, piece, axis) local index = axis and (piece * 3 + axis) or piece local wthreads = waitingForAnim[index] - if (not wthreads) then + if not wthreads then wthreads = {} waitingForAnim[index] = wthreads end local thread = threads[co_running() or error("not in a thread", 2)] - wthreads[#wthreads+1] = thread + wthreads[#wthreads + 1] = thread thread.container = wthreads -- yield the running thread: -- it will be resumed once the wait finished (in AnimFinished). @@ -379,10 +376,11 @@ function Spring.UnitScript.WaitForScale(piece) end end - function Spring.UnitScript.Sleep(milliseconds) local n = floor(milliseconds * 0.03030303) -- faster than division by 33 - if n <= 0 then n = 1 end + if n <= 0 then + n = 1 + end n = n + sp_GetGameFrame() local zzz = sleepers[n] if not zzz then @@ -401,8 +399,6 @@ function Spring.UnitScript.Sleep(milliseconds) co_yield() end - - function Spring.UnitScript.StartThread(fun, ...) local activeUnit = units[activeUnitStack[#activeUnitStack]] local co = co_create(fun) @@ -452,7 +448,7 @@ function Spring.UnitScript.Signal(mask) -- beware, unsynced loop order -- (doesn't matter here as long as all threads get removed) if type(mask) == "number" then - for _,thread in pairs(activeUnit.threads) do + for _, thread in pairs(activeUnit.threads) do local container = thread.container if container then local signal_mask = thread.signal_mask @@ -462,7 +458,7 @@ function Spring.UnitScript.Signal(mask) end end else - for _,thread in pairs(activeUnit.threads) do + for _, thread in pairs(activeUnit.threads) do local container = thread.container if container and thread.signal_mask == mask then RemoveTableElement(container, thread) @@ -492,8 +488,12 @@ function Spring.UnitScript.GetLongestReloadTime(unitID) local longest = 0 for i = LUA_WEAPON_MIN_INDEX, LUA_WEAPON_MAX_INDEX do local reloadTime = sp_GetUnitWeaponState(unitID, i, "reloadTime") - if (not reloadTime) then break end - if (reloadTime > longest) then longest = reloadTime end + if not reloadTime then + break + end + if reloadTime > longest then + longest = reloadTime + end end return 1000 * longest end @@ -506,7 +506,6 @@ local scriptHeader = VFS.LoadFile("gamedata/unit_script_header.lua", VFSMODE) -- Newlines (and comments) are stripped to not change line numbers in stacktraces. scriptHeader = scriptHeader:gsub("%-%-[^\r\n]*", ""):gsub("[\r\n]", " ") - --[[ Dictionary mapping script name (without path or extension) to a Lua chunk which returns a new closure (read; instance) of this unitscript. @@ -517,49 +516,44 @@ Format: { --]] local scripts = {} - -- Creates a new prototype environment for a unit script. -- This environment is used as prototype for the unit script instances. -- (To save on time copying and space for a copy for each and every unit.) local prototypeEnv do local script = {} - for k,v in pairs(System) do + for k, v in pairs(System) do script[k] = v end --script._G = _G -- the global table. (Update: _G points to unit environment now) - script.GG = GG -- the shared table (shared with gadgets!) + script.GG = GG -- the shared table (shared with gadgets!) prototypeEnv = script end - local function Basename(filename) return filename:match("[^\\/:]*$") or filename end - local function LoadChunk(filename) local text = VFS.LoadFile(filename, VFSMODE) - if (text == nil) then + if text == nil then Spring.Log(section, LOG.ERROR, "Failed to load: " .. filename) return nil end local chunk, err = loadstring(scriptHeader .. text, filename) - if (chunk == nil) then + if chunk == nil then Spring.Log(section, LOG.ERROR, "Failed to load: " .. Basename(filename) .. " (" .. err .. ")") return nil end return chunk end - local function LoadScript(scriptName, filename) local chunk = LoadChunk(filename) scripts[scriptName] = chunk return chunk end - function gadget:Initialize() Spring.Log(section, LOG.INFO, string.format("Loading gadget: %-18s <%s>", ghInfo.name, ghInfo.basename)) @@ -573,10 +567,10 @@ function gadget:Initialize() -- Recursively collect files below UNITSCRIPT_DIR. local scriptFiles = {} - for _,filename in ipairs(VFS.DirList(UNITSCRIPT_DIR, "*.lua", VFSMODE, true)) do + for _, filename in ipairs(VFS.DirList(UNITSCRIPT_DIR, "*.lua", VFSMODE, true)) do local basename = Basename(filename) - scriptFiles[filename] = filename -- for exact match - scriptFiles[basename] = filename -- for basename match + scriptFiles[filename] = filename -- for exact match + scriptFiles[basename] = filename -- for basename match end -- Go through all UnitDefs and load scripts. @@ -585,15 +579,14 @@ function gadget:Initialize() -- * basename match -- * exact match where .cob->.lua -- * basename match where .cob->.lua - for i=1,#UnitDefs do + for i = 1, #UnitDefs do local unitDef = UnitDefs[i] - if (unitDef and not scripts[unitDef.scriptName]) then - local fn = UNITSCRIPT_DIR .. unitDef.scriptName:lower() - local bn = Basename(fn) + if unitDef and not scripts[unitDef.scriptName] then + local fn = UNITSCRIPT_DIR .. unitDef.scriptName:lower() + local bn = Basename(fn) local cfn = fn:gsub("%.cob$", "%.lua") local cbn = bn:gsub("%.cob$", "%.lua") - local filename = scriptFiles[fn] or scriptFiles[bn] or - scriptFiles[cfn] or scriptFiles[cbn] + local filename = scriptFiles[fn] or scriptFiles[bn] or scriptFiles[cfn] or scriptFiles[cbn] if filename then Spring.Log(section, LOG.INFO, " Loading unit script: " .. filename) LoadScript(unitDef.scriptName, filename) @@ -603,7 +596,7 @@ function gadget:Initialize() -- Fake UnitCreated events for existing units. (for '/luarules reload') local allUnits = sp_GetAllUnits() - for i=1,#allUnits do + for i = 1, #allUnits do local unitID = allUnits[i] gadget:UnitCreated(unitID, sp_GetUnitDefID(unitID)) end @@ -613,10 +606,11 @@ end local StartThread = Spring.UnitScript.StartThread - local function Wrap_AimWeapon(unitID, callins) local AimWeapon = callins["AimWeapon"] - if (not AimWeapon) then return end + if not AimWeapon then + return + end -- SetUnitShieldState wants true or false, while -- SetUnitWeaponState wants 1.0 or 0.0, niiice =) @@ -640,10 +634,11 @@ local function Wrap_AimWeapon(unitID, callins) end end - local function Wrap_AimShield(unitID, callins) local AimShield = callins["AimShield"] - if (not AimShield) then return end + if not AimShield then + return + end -- SetUnitShieldState wants true or false, while -- SetUnitWeaponState wants 1 or 0, niiice =) @@ -658,10 +653,11 @@ local function Wrap_AimShield(unitID, callins) end end - local function Wrap_Killed(unitID, callins) local Killed = callins["Killed"] - if (not Killed) then return end + if not Killed then + return + end local function KilledThread(recentDamage, maxHealth) -- It is *very* important the sp_SetDeathScriptFinished is executed, even on error. @@ -676,10 +672,11 @@ local function Wrap_Killed(unitID, callins) end end - local function Wrap(callins, name) local fun = callins[name] - if (not fun) then return end + if not fun then + return + end callins[name] = function(...) return StartThread(fun, ...) @@ -694,7 +691,6 @@ Format: { [filename] = chunk } --]] local include_cache = {} - -- core of include() function for unit scripts local function ScriptInclude(filename) --Spring.Echo(" Loading include: " .. UNITSCRIPT_DIR .. filename) @@ -705,7 +701,6 @@ local function ScriptInclude(filename) end end - -- memoize it so we don't need to decompress and parse the .lua file everytime.. local function MemoizedInclude(filename, env) local chunk = include_cache[filename] or ScriptInclude(filename) @@ -721,7 +716,9 @@ end function gadget:UnitCreated(unitID, unitDefID) local ud = UnitDefs[unitDefID] local chunk = scripts[ud.scriptName] - if (not chunk) then return end + if not chunk then + return + end -- Global variables in the script are still per unit. -- Set up a new environment that is an instance of the prototype @@ -735,7 +732,7 @@ function gadget:UnitCreated(unitID, unitDefID) local env = { unitID = unitID, unitDefID = unitDefID, - script = {}, -- will store the callins + script = {}, -- will store the callins } -- easy self-referencing (Note: use of _G differs from _G in gadgets & widgets) @@ -746,7 +743,7 @@ function gadget:UnitCreated(unitID, unitDefID) end env.piece = function(...) - local args = {...} + local args = { ... } local p = {} local n = 0 for i = 1, #args do @@ -773,13 +770,12 @@ function gadget:UnitCreated(unitID, unitDefID) -- AimWeapon/AimShield is required for a functional weapon/shield, -- so it doesn't hurt to not check other weapons. local numWeapons = #ud.weapons - if ((not callins.AimWeapon and callins.AimWeapon1) or - (not callins.AimShield and callins.AimShield1)) then - for j=1,#weapon_funcs do + if (not callins.AimWeapon and callins.AimWeapon1) or (not callins.AimShield and callins.AimShield1) then + for j = 1, #weapon_funcs do local name = weapon_funcs[j] local dispatch = {} local n = 0 - for i=1,numWeapons do + for i = 1, numWeapons do local fun = callins[name .. i] if fun then dispatch[i] = fun @@ -797,7 +793,9 @@ function gadget:UnitCreated(unitID, unitDefID) local ret = default_return_values[name] callins[name] = function(w, ...) local fun = dispatch[w] - if fun then return fun(...) end + if fun then + return fun(...) + end return ret end end @@ -805,7 +803,7 @@ function gadget:UnitCreated(unitID, unitDefID) end -- Wrap certain callins in a thread and/or safety net. - for i=1,#thread_wrap do + for i = 1, #thread_wrap do Wrap(callins, thread_wrap[i]) end Wrap_AimWeapon(unitID, callins) @@ -813,7 +811,7 @@ function gadget:UnitCreated(unitID, unitDefID) Wrap_Killed(unitID, callins) -- Wrap everything so activeUnit get's set properly. - for k,v in pairs(callins) do + for k, v in pairs(callins) do local fun = v callins[k] = function(...) @@ -835,7 +833,7 @@ function gadget:UnitCreated(unitID, unitDefID) waitingForMove = {}, waitingForTurn = {}, waitingForScale = {}, - threads = setmetatable({}, {__mode = "kv"}), -- weak table + threads = setmetatable({}, { __mode = "kv" }), -- weak table } -- Now it's safe to start a thread which will run Create(). @@ -845,7 +843,6 @@ function gadget:UnitCreated(unitID, unitDefID) end end - function gadget:GameFrame() local n = sp_GetGameFrame() local zzz = sleepers[n] @@ -862,7 +859,7 @@ function gadget:GameFrame() -- 4. therefore we cannot use the "for i = 1, #zzz" pattern since the -- container size/contents might change while we are iterating over -- it (and a Lua for-loop range expression is only evaluated once) - while (#zzz > 0) do + while #zzz > 0 do local sleeper = zzz[#zzz] local unitID = sleeper.unitID diff --git a/luarules/gadgets/unit_seismic_ping.lua b/luarules/gadgets/unit_seismic_ping.lua index 0d9c42fb173..0c40c0c398b 100644 --- a/luarules/gadgets/unit_seismic_ping.lua +++ b/luarules/gadgets/unit_seismic_ping.lua @@ -1,22 +1,20 @@ function gadget:GetInfo() - return { - name = "Seismic Ping", - desc = "Draw seismic pings effect", - author = "Floris", - date = "2026", - license = "GNU GPL, v2 or later", - version = 1, - layer = 5, - enabled = true - } + return { + name = "Seismic Ping", + desc = "Draw seismic pings effect", + author = "Floris", + date = "2026", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = true, + } end - if gadgetHandler:IsSyncedCode() then return end - -------------------------------------------------------------------------------- -- Speedups -------------------------------------------------------------------------------- @@ -70,10 +68,10 @@ local thicknessScale = 1.2 -- Display lists for arc geometry (pre-generated at unit radius with proportional thickness) -------------------------------------------------------------------------------- local displayLists = { - outerArcs = {}, -- 4 arcs at 60 degrees each - middleArcs = {}, -- 3 arcs at 80 degrees each - innerArcs = {}, -- 2 arcs at 120 degrees each - centerCircle = nil, -- Full circle + outerArcs = {}, -- 4 arcs at 60 degrees each + middleArcs = {}, -- 3 arcs at 80 degrees each + innerArcs = {}, -- 2 arcs at 120 degrees each + centerCircle = nil, -- Full circle -- Outlines (slightly larger versions for dark border) outerOutlines = {}, middleOutlines = {}, @@ -85,7 +83,7 @@ local outerThicknessRatio = baseThickness * 1.05 / baseRadius local middleThicknessRatio = baseThickness * 0.8 / baseRadius local innerThicknessRatio = baseThickness * 1 / baseRadius local centerThicknessRatio = baseThickness * 1.8 / baseRadius -local outlineExtra = 0.02 -- How much larger the outline is on each side +local outlineExtra = 0.02 -- How much larger the outline is on each side -------------------------------------------------------------------------------- -- Helper: Draw a thick arc as geometry (for display list creation) @@ -171,18 +169,32 @@ end -------------------------------------------------------------------------------- local function DeleteDisplayLists() for i = 0, 3 do - if displayLists.outerArcs[i] then glDeleteList(displayLists.outerArcs[i]) end - if displayLists.outerOutlines[i] then glDeleteList(displayLists.outerOutlines[i]) end + if displayLists.outerArcs[i] then + glDeleteList(displayLists.outerArcs[i]) + end + if displayLists.outerOutlines[i] then + glDeleteList(displayLists.outerOutlines[i]) + end end for i = 0, 2 do - if displayLists.middleArcs[i] then glDeleteList(displayLists.middleArcs[i]) end - if displayLists.middleOutlines[i] then glDeleteList(displayLists.middleOutlines[i]) end + if displayLists.middleArcs[i] then + glDeleteList(displayLists.middleArcs[i]) + end + if displayLists.middleOutlines[i] then + glDeleteList(displayLists.middleOutlines[i]) + end end for i = 0, 1 do - if displayLists.innerArcs[i] then glDeleteList(displayLists.innerArcs[i]) end - if displayLists.innerOutlines[i] then glDeleteList(displayLists.innerOutlines[i]) end + if displayLists.innerArcs[i] then + glDeleteList(displayLists.innerArcs[i]) + end + if displayLists.innerOutlines[i] then + glDeleteList(displayLists.innerOutlines[i]) + end + end + if displayLists.centerCircle then + glDeleteList(displayLists.centerCircle) end - if displayLists.centerCircle then glDeleteList(displayLists.centerCircle) end end -------------------------------------------------------------------------------- @@ -206,17 +218,17 @@ local function DrawPing(ping, currentTime, cameraDistance) local rotation1 = currentTime * 70 local outerProgress = min(1, progress * 1.3) local outerAlpha = max(0, (1 - outerProgress) * 0.7) - local outerRadius = radius*1.15-(radius*progress*0.25) + local outerRadius = radius * 1.15 - (radius * progress * 0.25) local rotation2 = -currentTime * 150 local middleProgress = max(0, min(1, (progress - 0.1) / 0.9)) local middleAlpha = max(0, (1 - middleProgress) * 0.85) - local middleRadius = radius+(radius*progress*0.4) + local middleRadius = radius + (radius * progress * 0.4) local rotation3 = currentTime * 90 local innerProgress = max(0, min(1, (progress - 0.15) / 0.85)) local innerAlpha = max(0, (1 - innerProgress)) - local innerRadius = radius-(radius*progress*0.45) + local innerRadius = radius - (radius * progress * 0.45) -- PASS 1: Draw all dark outlines with normal blending (skip when camera is far away for performance) if cameraDistance < 3000 then @@ -328,7 +340,9 @@ function gadget:UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unitDefID) if (spec or allyTeam == myAllyTeam) and unitAllyTeam ~= allyTeam then if spec and not fullview then - if allyTeam ~= myAllyTeam then return end + if allyTeam ~= myAllyTeam then + return + end end table.insert(pings, { @@ -360,7 +374,7 @@ function gadget:DrawWorld() -- Calculate visible world area based on camera state local viewDistance = cy / math.tan(math.rad(cs.fov or 45)) local viewWidth = viewDistance * (vsx / vsy) - local margin = maxRadius * thicknessScale * 3 -- Add margin for ping radius + local margin = maxRadius * thicknessScale * 3 -- Add margin for ping radius local minX = cx - viewWidth - margin local maxX = cx + viewWidth + margin diff --git a/luarules/gadgets/unit_shield_behaviour.lua b/luarules/gadgets/unit_shield_behaviour.lua index 2cea8ec3e61..a4446bfb57c 100644 --- a/luarules/gadgets/unit_shield_behaviour.lua +++ b/luarules/gadgets/unit_shield_behaviour.lua @@ -116,7 +116,9 @@ if Spring.GetModOptions().experimentalshields:find("bounce") then GG.Shields.GetShieldUnitsInSphere = getEmptyResultSet GG.Shields.GetBlockingShieldUnits = getEmptyResultSet GG.Shields.GetCoveringShieldUnits = getEmptyResultSet - GG.Shields.IsInShield = function() return false end -- unfortunate + GG.Shields.IsInShield = function() + return false + end -- unfortunate end return -- do not load custom shields gadget @@ -131,56 +133,56 @@ end local directHitQualifyingMultiplier = 0.95 -- the minimum number of frames before the shield is allowed to turn back on. Extra regenerated shield charge is applied to the shield when it comes back online. -local minDownTime = 1 * Game.gameSpeed +local minDownTime = 1 * Game.gameSpeed -- The maximum number of frames a shield is allowed to be offline from overkill. This is to handle very, very high single-attack damage which would otherwise cripple the shield for multiple minutes. -local maxDownTime = 20 * Game.gameSpeed +local maxDownTime = 20 * Game.gameSpeed -- Arbitrary large value used to ensure shield does not reactivate before we want it to, but using math.huge causes shield to instantly reactivate. -local engineRechargeDelayToDisable = 60 * Game.gameSpeed - -local shieldOnUnitRulesParamIndex = 531313 -local INLOS = { inlos = true } - -local mathCeil = math.ceil -local distanceSquared = math.distance3dSquared - -local spSetUnitShieldRechargeDelay = Spring.SetUnitShieldRechargeDelay -local spDeleteProjectile = Spring.DeleteProjectile -local spGetProjectileDefID = Spring.GetProjectileDefID -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitWeaponVectors = Spring.GetUnitWeaponVectors -local spGetUnitsInSphere = Spring.GetUnitsInSphere -local spGetProjectilesInSphere = Spring.GetProjectilesInSphere -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetUnitIsActive = Spring.GetUnitIsActive -local spGetUnitIsDead = Spring.GetUnitIsDead -local spUseUnitResource = Spring.UseUnitResource -local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spGetUnitArmored = Spring.GetUnitArmored - -local shieldUnitDefs = {} -local shieldUnitsData = {} -local forceDeleteWeapons = {} -local unitDefIDCache = {} -local unitDefWeaponDefs = {} -local unitCoverages = {} -- [unitID] = {[shieldUnitID] = true, ...} -local shieldCoverages = {} -- [shieldUnitID] = {[unitID] = true, ...} -local weaponIgnoreCoverage = {} -local projectileIgnoreCoverage = {} -local highestWeapDefDamages = {} -local armoredUnitDefs = {} -local destroyedUnitData = {} -local hasDestroyedData = false -local shieldsNeedingUpdate = {} -- shields that are disabled or recovering from overkill - -local gameFrame = 0 +local engineRechargeDelayToDisable = 60 * Game.gameSpeed + +local shieldOnUnitRulesParamIndex = 531313 +local INLOS = { inlos = true } + +local mathCeil = math.ceil +local distanceSquared = math.distance3dSquared + +local spSetUnitShieldRechargeDelay = Spring.SetUnitShieldRechargeDelay +local spDeleteProjectile = Spring.DeleteProjectile +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitWeaponVectors = Spring.GetUnitWeaponVectors +local spGetUnitsInSphere = Spring.GetUnitsInSphere +local spGetProjectilesInSphere = Spring.GetProjectilesInSphere +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetUnitIsActive = Spring.GetUnitIsActive +local spGetUnitIsDead = Spring.GetUnitIsDead +local spUseUnitResource = Spring.UseUnitResource +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitArmored = Spring.GetUnitArmored + +local shieldUnitDefs = {} +local shieldUnitsData = {} +local forceDeleteWeapons = {} +local unitDefIDCache = {} +local unitDefWeaponDefs = {} +local unitCoverages = {} -- [unitID] = {[shieldUnitID] = true, ...} +local shieldCoverages = {} -- [shieldUnitID] = {[unitID] = true, ...} +local weaponIgnoreCoverage = {} +local projectileIgnoreCoverage = {} +local highestWeapDefDamages = {} +local armoredUnitDefs = {} +local destroyedUnitData = {} +local hasDestroyedData = false +local shieldsNeedingUpdate = {} -- shields that are disabled or recovering from overkill + +local gameFrame = 0 for weaponDefID = 0, #WeaponDefs do local weaponDef = WeaponDefs[weaponDefID] - if weaponDef.type == 'Flame' then -- flame projectiles aren't deleted when striking the shield. For compatibility with shield blocking type overrides. + if weaponDef.type == "Flame" then -- flame projectiles aren't deleted when striking the shield. For compatibility with shield blocking type overrides. forceDeleteWeapons[weaponDefID] = weaponDef end @@ -217,7 +219,6 @@ for weaponDefID = 0, #WeaponDefs do beamtimeReductionMultiplier = 1 / math.floor(weaponDef.beamtime * Game.gameSpeed) end - local minimumMinIntensity = 0.65 --impirically tested to work the majority of the time with normal damage falloff. local hasDamageFalloff = false local damageFalloffUnitTypes = { @@ -352,12 +353,12 @@ function gadget:UnitFinished(unitID, unitDefID, unitTeam) shieldPowerRegenEnergy = data.shieldPowerRegenEnergy, shieldWeaponNumber = data.shieldWeaponNumber, -- This is replaced with the real shieldWeaponNumber as soon as the shield is damaged radius = data.shieldRadius, - shieldEnabled = false, -- Virtualized enabled/disabled state until engine equivalent is changed - shieldDamage = 0, -- This stores the value of damages populated in ShieldPreDamaged(), then applied in GameFrame() all at once - shieldCoverageChecked = false, -- Used to prevent expensive unit coverage checks being performed more than once per cycle + shieldEnabled = false, -- Virtualized enabled/disabled state until engine equivalent is changed + shieldDamage = 0, -- This stores the value of damages populated in ShieldPreDamaged(), then applied in GameFrame() all at once + shieldCoverageChecked = false, -- Used to prevent expensive unit coverage checks being performed more than once per cycle overKillDamage = 0, shieldDownTime = 0, - maxDownTime = 0 + maxDownTime = 0, } destroyedUnitData[unitID] = nil -- Handle (maybe) units being recreated and reusing their original ID shieldsNeedingUpdate[unitID] = true -- starts disabled, needs activation on next 30-frame tick @@ -522,7 +523,6 @@ function gadget:GameFrame(frame) shieldData.overKillDamage = 0 end activateShield(shieldUnitID, shieldData) - elseif shieldData.maxDownTime < frame then activateShield(shieldUnitID, shieldData) shieldData.overKillDamage = 0 @@ -628,8 +628,7 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w end end -function gadget:ShieldPreDamaged(proID, proOwnerID, shieldWeaponNum, shieldUnitID, bounceProjectile, beamEmitterWeaponNum, - beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) +function gadget:ShieldPreDamaged(proID, proOwnerID, shieldWeaponNum, shieldUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) local weaponDefID local shieldData = shieldUnitsData[shieldUnitID] if not shieldData or not shieldData.shieldEnabled then @@ -669,9 +668,13 @@ function gadget:ShieldPreDamaged(proID, proOwnerID, shieldWeaponNum, shieldUnitI end local weapons = unitDefWeaponDefs[beamEmitterUnitDefID] - if not weapons then return false end + if not weapons then + return false + end weaponDefID = weapons[beamEmitterWeaponNum] - if not weaponDefID then return false end + if not weaponDefID then + return false + end shieldData.shieldDamage = (shieldData.shieldDamage + originalShieldDamages[weaponDefID]) end @@ -747,8 +750,7 @@ end local function isBallShellIntersection(dx, dy, dz, ballRadius, shellRadius) local distanceSq = dx * dx + dy * dy + dz * dz - return distanceSq >= (shellRadius - ballRadius) * (shellRadius - ballRadius) - and distanceSq <= (shellRadius + ballRadius) * (shellRadius + ballRadius) + return distanceSq >= (shellRadius - ballRadius) * (shellRadius - ballRadius) and distanceSq <= (shellRadius + ballRadius) * (shellRadius + ballRadius) end local function isExternalBallShellIntersection(dx, dy, dz, ballRadius, shellRadius) diff --git a/luarules/gadgets/unit_sinking_ship.lua b/luarules/gadgets/unit_sinking_ship.lua index 6acf9cf8261..4bfd8a0f2ee 100644 --- a/luarules/gadgets/unit_sinking_ship.lua +++ b/luarules/gadgets/unit_sinking_ship.lua @@ -26,13 +26,24 @@ local spSetFeaturePhysics = Spring.SetFeaturePhysics local spGetGameFrame = Spring.GetGameFrame function gadget:FeatureCreated(featureID) - if spGetGameFrame() < 1 then return end + if spGetGameFrame() < 1 then + return + end local x, y, z = spGetFeaturePosition(featureID) if spGetGroundHeight(x, z) < -25 then local vx, vy, vz = spGetFeatureVelocity(featureID) local rx, ry, rz = spGetFeatureRotation(featureID) --> nil | number pitch, number yaw, number roll - spSetFeaturePhysics(featureID, x, y, z, vx * damping, 0, vz * damping, -- setting vanlue for Y doesnt have effect, - rx, ry, rz) --, 0, 0, 0 ) --number dragx, number dragy, number dragz, + spSetFeaturePhysics( + featureID, + x, + y, + z, + vx * damping, + 0, + vz * damping, -- setting vanlue for Y doesnt have effect, + rx, + ry, + rz + ) --, 0, 0, 0 ) --number dragx, number dragy, number dragz, end end - diff --git a/luarules/gadgets/unit_stack_hack_fix.lua b/luarules/gadgets/unit_stack_hack_fix.lua index faf716fa4fa..80faf3c11c1 100644 --- a/luarules/gadgets/unit_stack_hack_fix.lua +++ b/luarules/gadgets/unit_stack_hack_fix.lua @@ -1,15 +1,15 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Anti Stacking Hax", - desc = "123", - author = "Damgam", - date = "2021", - license = "GNU GPL, v2 or later", - layer = -100, - enabled = true, - } + return { + name = "Anti Stacking Hax", + desc = "123", + author = "Damgam", + date = "2021", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then @@ -24,7 +24,7 @@ local canMove = {} for udid, ud in pairs(UnitDefs) do if string.find(ud.id, "nanotc") then isAffectedUnit[udid] = { - math.floor(((ud.xsize + ud.zsize)*0.5)*6), + math.floor(((ud.xsize + ud.zsize) * 0.5) * 6), ud.minWaterDepth, ud.maxWaterDepth, } @@ -38,7 +38,7 @@ local affectedUnits = {} function gadget:UnitCreated(unitID, unitDefID) if isAffectedUnit[unitDefID] then - table.insert(affectedUnits, {unitID, unitDefID}) + table.insert(affectedUnits, { unitID, unitDefID }) end end @@ -60,9 +60,9 @@ function gadget:GameFrame(n) if nearestAlly then if not canMove[Spring.GetUnitDefID(nearestAlly)] then if not Spring.GetUnitTransporter(unitID) then - local x,_,z = Spring.GetUnitPosition(unitID) - local ax,_,az = Spring.GetUnitPosition(nearestAlly) - local r = math.random(1,3) + local x, _, z = Spring.GetUnitPosition(unitID) + local ax, _, az = Spring.GetUnitPosition(nearestAlly) + local r = math.random(1, 3) local movementTargetX = 0 local movementTargetZ = 0 @@ -74,32 +74,32 @@ function gadget:GameFrame(n) end elseif r == 2 then if x > ax then - movementTargetX = math.random(1,10) + movementTargetX = math.random(1, 10) end if x < ax then - movementTargetX = -math.random(1,10) + movementTargetX = -math.random(1, 10) end elseif r == 3 then if z > az then - movementTargetZ = math.random(1,10) + movementTargetZ = math.random(1, 10) end if z < az then - movementTargetZ = -math.random(1,10) + movementTargetZ = -math.random(1, 10) end end - local movementTargetY = Spring.GetGroundHeight(x+movementTargetX, z+movementTargetZ) - local aboveMinWaterDepth = -(isAffectedUnit[unitDefID][2]) > movementTargetY - local belowMaxWaterDepth = -(isAffectedUnit[unitDefID][3]) < movementTargetY + local movementTargetY = Spring.GetGroundHeight(x + movementTargetX, z + movementTargetZ) + local aboveMinWaterDepth = -isAffectedUnit[unitDefID][2] > movementTargetY + local belowMaxWaterDepth = -isAffectedUnit[unitDefID][3] < movementTargetY local onMap = true - if x+movementTargetX > mapsizeX or x+movementTargetX < 0 then + if x + movementTargetX > mapsizeX or x + movementTargetX < 0 then onMap = false - elseif z+movementTargetZ > mapsizeZ or z+movementTargetZ < 0 then + elseif z + movementTargetZ > mapsizeZ or z + movementTargetZ < 0 then onMap = false end if aboveMinWaterDepth and belowMaxWaterDepth and onMap then - Spring.SetUnitPosition(unitID, x+movementTargetX, z+movementTargetZ) + Spring.SetUnitPosition(unitID, x + movementTargetX, z + movementTargetZ) end end end diff --git a/luarules/gadgets/unit_stealthy_passengers.lua b/luarules/gadgets/unit_stealthy_passengers.lua index 9a5b9d96f2c..be039c670ed 100644 --- a/luarules/gadgets/unit_stealthy_passengers.lua +++ b/luarules/gadgets/unit_stealthy_passengers.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Stealthy Passengers", - desc = "Makes passengers of stealthy transports stealthy themselves", - author = "Niobium", - date = "Jul 24, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Stealthy Passengers", + desc = "Makes passengers of stealthy transports stealthy themselves", + author = "Niobium", + date = "Jul 24, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end diff --git a/luarules/gadgets/unit_stockpile_limit.lua b/luarules/gadgets/unit_stockpile_limit.lua index 00dfcd02457..f64a546778c 100644 --- a/luarules/gadgets/unit_stockpile_limit.lua +++ b/luarules/gadgets/unit_stockpile_limit.lua @@ -1,21 +1,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = 'Stockpile control', - desc = 'Limits Stockpile to set amount', - author = 'Bluestone, Damgam', - version = 'v1.0', - date = '23/04/2013', - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Stockpile control", + desc = "Limits Stockpile to set amount", + author = "Bluestone, Damgam", + version = "v1.0", + date = "23/04/2013", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - if gadgetHandler:IsSyncedCode() then - local defaultStockpileLimit = 99 local CMD_STOCKPILE = CMD.STOCKPILE @@ -23,8 +21,8 @@ if gadgetHandler:IsSyncedCode() then local StockpileDesiredTarget = {} local unitStockpileLimit = {} - local GetUnitStockpile = Spring.GetUnitStockpile - local GiveOrderToUnit = Spring.GiveOrderToUnit + local GetUnitStockpile = Spring.GetUnitStockpile + local GiveOrderToUnit = Spring.GiveOrderToUnit local mathClamp = math.clamp for udid, ud in pairs(UnitDefs) do @@ -47,7 +45,7 @@ if gadgetHandler:IsSyncedCode() then end local MaxStockpile = mathClamp(unitStockpileLimit[unitDefID], 0, StockpileDesiredTarget[unitID]) - local stock,queued = GetUnitStockpile(unitID) + local stock, queued = GetUnitStockpile(unitID) if queued and stock then local count = stock + queued - MaxStockpile while count < 0 do @@ -103,7 +101,7 @@ if gadgetHandler:IsSyncedCode() then if cmdOptions.right then addQ = -addQ end - if fromLua == true and fromSynced == true then -- fromLua is *true* if command is sent from a gadget and *false* if it's sent by a player. + if fromLua == true and fromSynced == true then -- fromLua is *true* if command is sent from a gadget and *false* if it's sent by a player. return true else if StockpileDesiredTarget[unitID] and unitStockpileLimit[unitDefID] then @@ -141,4 +139,3 @@ if gadgetHandler:IsSyncedCode() then end end end - diff --git a/luarules/gadgets/unit_stockpile_script.lua b/luarules/gadgets/unit_stockpile_script.lua index 2f1b61a81c0..f7107a60cb3 100644 --- a/luarules/gadgets/unit_stockpile_script.lua +++ b/luarules/gadgets/unit_stockpile_script.lua @@ -1,23 +1,22 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Stockpile Script", - desc = "makes unit stockpile status known to unit scripts", - author = "Floris", - date = "July 2022", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Stockpile Script", + desc = "makes unit stockpile status known to unit scripts", + author = "Floris", + date = "July 2022", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then return false end -local hasSetStockpile = {} +local hasSetStockpile = {} for udid, ud in pairs(UnitDefs) do if ud.canStockpile then hasSetStockpile[udid] = true @@ -29,22 +28,22 @@ local spCallCOBScript = Spring.CallCOBScript local spGetCOBScriptID = Spring.GetCOBScriptID function gadget:Initialize() - for i, unitID in pairs(Spring.GetAllUnits()) do - gadget:UnitCreated(unitID, Spring.GetUnitDefID(unitID)) + for i, unitID in pairs(Spring.GetAllUnits()) do + gadget:UnitCreated(unitID, Spring.GetUnitDefID(unitID)) if hasSetStockpile[Spring.GetUnitDefID(unitID)] then - spCallCOBScript(unitID, 'SetStockpile', 0, spGetUnitStockpile(unitID)) + spCallCOBScript(unitID, "SetStockpile", 0, spGetUnitStockpile(unitID)) end - end + end end function gadget:UnitCreated(unitID, unitDefID, unitTeam) if hasSetStockpile[unitDefID] ~= nil then - hasSetStockpile[unitDefID] = spGetCOBScriptID(unitID, 'SetStockpile') and true or false + hasSetStockpile[unitDefID] = spGetCOBScriptID(unitID, "SetStockpile") and true or false end end function gadget:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount) if hasSetStockpile[unitDefID] then - spCallCOBScript(unitID, 'SetStockpile', 0, newCount) + spCallCOBScript(unitID, "SetStockpile", 0, newCount) end end diff --git a/luarules/gadgets/unit_stomp.lua b/luarules/gadgets/unit_stomp.lua index 6d9e9bf2502..2e42a779f22 100644 --- a/luarules/gadgets/unit_stomp.lua +++ b/luarules/gadgets/unit_stomp.lua @@ -2,13 +2,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Experimental Bots Steps Damages", - desc = "Controls damages done by exp units footsteps", - author = "Doo", - date = "July 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Experimental Bots Steps Damages", + desc = "Controls damages done by exp units footsteps", + author = "Doo", + date = "July 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -22,11 +22,11 @@ local stompable = { armflea = true, corak = true, armpw = true, - leggob = true + leggob = true, } local stompableCopy = table.copy(stompable) -for name,v in pairs(stompableCopy) do - stompable[name..'_scav'] = true +for name, v in pairs(stompableCopy) do + stompable[name .. "_scav"] = true end local stompableDefs = {} for udid, ud in pairs(UnitDefs) do @@ -37,7 +37,7 @@ end local krogkickWeapon = {} for weaponDefID, def in pairs(WeaponDefs) do - if string.find(def.name, 'krogkick') then + if string.find(def.name, "krogkick") then krogkickWeapon[weaponDefID] = true end end diff --git a/luarules/gadgets/unit_stun_control.lua b/luarules/gadgets/unit_stun_control.lua index 9ca435e9824..cafb191c8ab 100644 --- a/luarules/gadgets/unit_stun_control.lua +++ b/luarules/gadgets/unit_stun_control.lua @@ -5,20 +5,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Stun Control", - desc = "Disables on/off for Stunned Units", - author = "Nixtux", - date = "Apr 13, 2014", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Stun Control", + desc = "Disables on/off for Stunned Units", + author = "Nixtux", + date = "Apr 13, 2014", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- -if (not gadgetHandler:IsSyncedCode()) then +if not gadgetHandler:IsSyncedCode() then return false end @@ -40,6 +40,5 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt end end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luarules/gadgets/unit_stun_script.lua b/luarules/gadgets/unit_stun_script.lua index 8e55ec33cb3..377af44beb9 100644 --- a/luarules/gadgets/unit_stun_script.lua +++ b/luarules/gadgets/unit_stun_script.lua @@ -1,16 +1,15 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Stun Script", - desc = "makes unit stun status known to unit scripts", - author = "Floris", - date = "April 2020", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Stun Script", + desc = "makes unit stun status known to unit scripts", + author = "Floris", + date = "April 2020", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then @@ -21,9 +20,9 @@ local stunnedUnits = {} local hasSetStunned = {} for udid, ud in pairs(UnitDefs) do - if ud.customParams.paralyzemultiplier == 0 then - hasSetStunned[udid] = false - end + if ud.customParams.paralyzemultiplier == 0 then + hasSetStunned[udid] = false + end end local spGetUnitIsStunned = Spring.GetUnitIsStunned @@ -31,40 +30,40 @@ local spCallCOBScript = Spring.CallCOBScript local spGetCOBScriptID = Spring.GetCOBScriptID function gadget:GameFrame(n) - -- check if stunned units have become deparalyzed - if n % 10 == 3 then - for unitID, _ in pairs(stunnedUnits) do - if not select(2, spGetUnitIsStunned(unitID)) then - stunnedUnits[unitID] = nil - spCallCOBScript(unitID, 'SetStunned', 0, false) - end - end - end + -- check if stunned units have become deparalyzed + if n % 10 == 3 then + for unitID, _ in pairs(stunnedUnits) do + if not select(2, spGetUnitIsStunned(unitID)) then + stunnedUnits[unitID] = nil + spCallCOBScript(unitID, "SetStunned", 0, false) + end + end + end end function gadget:Initialize() - for i, unitID in pairs(Spring.GetAllUnits()) do - gadget:UnitCreated(unitID, Spring.GetUnitDefID(unitID)) - end + for i, unitID in pairs(Spring.GetAllUnits()) do + gadget:UnitCreated(unitID, Spring.GetUnitDefID(unitID)) + end end function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if hasSetStunned[unitDefID] == nil then - hasSetStunned[unitDefID] = spGetCOBScriptID(unitID, 'SetStunned') and true or false - end + if hasSetStunned[unitDefID] == nil then + hasSetStunned[unitDefID] = spGetCOBScriptID(unitID, "SetStunned") and true or false + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if stunnedUnits[unitDefID] then - stunnedUnits[unitID] = nil + stunnedUnits[unitID] = nil end end -function gadget:UnitDamaged(unitID,unitDefID,unitTeam,damage,paralyzer,weaponDefID,projectileID,attackerID,attackerDefID,attackerTeam) - if paralyzer and hasSetStunned[unitDefID] then - if select(2, spGetUnitIsStunned(unitID)) then - stunnedUnits[unitID] = true - spCallCOBScript(unitID, 'SetStunned', 0, true) - end - end +function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) + if paralyzer and hasSetStunned[unitDefID] then + if select(2, spGetUnitIsStunned(unitID)) then + stunnedUnits[unitID] = true + spCallCOBScript(unitID, "SetStunned", 0, true) + end + end end diff --git a/luarules/gadgets/unit_stun_storage.lua b/luarules/gadgets/unit_stun_storage.lua index 978f849dc92..f8b6bb761b2 100644 --- a/luarules/gadgets/unit_stun_storage.lua +++ b/luarules/gadgets/unit_stun_storage.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "June 15, 2014", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -24,8 +24,7 @@ local paralyzedUnits = {} local storageDefs = {} local isCommander = {} for udid, ud in pairs(UnitDefs) do - if not ud.canMove then -- this is to exclude transportable units since they get stunned while being transported - + if not ud.canMove then -- this is to exclude transportable units since they get stunned while being transported -- instead of checking every unit to see if it is a commander we add them in late, except we don't cause they move -- i don't understand our decision making but i'm future proofing this -- commanders were tested to be excluded for the first 150 game frames @@ -33,7 +32,6 @@ for udid, ud in pairs(UnitDefs) do if ud.customParams.iscommander then isCommander[udid] = true else - if ud.metalStorage >= 50 then if not storageDefs[udid] then storageDefs[udid] = {} diff --git a/luarules/gadgets/unit_sunfacing.lua b/luarules/gadgets/unit_sunfacing.lua index 5b077167a15..070df0b7d0b 100644 --- a/luarules/gadgets/unit_sunfacing.lua +++ b/luarules/gadgets/unit_sunfacing.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "March 18, 2024", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -36,7 +36,7 @@ end function gadget:Initialize() gadgetHandler:RegisterGlobal("solarpoint", solarpoint) - success, mapinfo = pcall(VFS.Include,"mapinfo.lua") + success, mapinfo = pcall(VFS.Include, "mapinfo.lua") if success and mapinfo then if mapinfo.lighting and mapinfo.lighting.sundir then sundir = mapinfo.lighting.sundir diff --git a/luarules/gadgets/unit_target_on_the_move.lua b/luarules/gadgets/unit_target_on_the_move.lua index 73c9df09df9..c4b714f2e98 100644 --- a/luarules/gadgets/unit_target_on_the_move.lua +++ b/luarules/gadgets/unit_target_on_the_move.lua @@ -18,7 +18,6 @@ local CMD_UNIT_CANCEL_TARGET = GameCMD.UNIT_CANCEL_TARGET local CMD_UNIT_SET_TARGET_RECTANGLE = GameCMD.UNIT_SET_TARGET_RECTANGLE if gadgetHandler:IsSyncedCode() then - local deleteMaxDistance = 30 local targetListLengthMax = 128 @@ -62,8 +61,8 @@ if gadgetHandler:IsSyncedCode() then local FIRESTATE_RETURNFIRE = CMD.FIRESTATE_RETURNFIRE local isAttackCommand = { - [CMD_ATTACK] = true, - [CMD.MANUALFIRE] = true, + [CMD_ATTACK] = true, + [CMD.MANUALFIRE] = true, [CMD.AREA_ATTACK] = true, [GameCMD.AREA_ATTACK_GROUND] = true, } @@ -78,10 +77,7 @@ if gadgetHandler:IsSyncedCode() then local function hasTargeting(weapon, canManualFire) local weaponDef = WeaponDefs[weapon.weaponDef] - return weapon.slavedTo == 0 - and weaponDef.type ~= "Shield" - and not (canManualFire and weaponDef.manualFire) - and weaponDef.range > 10 + return weapon.slavedTo == 0 and weaponDef.type ~= "Shield" and not (canManualFire and weaponDef.manualFire) and weaponDef.range > 10 end local function canSetTarget(unitDef) @@ -163,14 +159,14 @@ if gadgetHandler:IsSyncedCode() then -------------------------------------------------------------------------------- -- Commands - local tooltipText = 'Set a priority attack target,\nto be used when within range\n(not removed by move commands)' + local tooltipText = "Set a priority attack target,\nto be used when within range\n(not removed by move commands)" local unitSetTargetNoGroundCmdDesc = { id = CMD_UNIT_SET_TARGET_NO_GROUND, type = CMDTYPE.ICON_UNIT_OR_AREA, - name = 'Set Unit Target', - action = 'settargetnoground', - cursor = 'settarget', + name = "Set Unit Target", + action = "settargetnoground", + cursor = "settarget", tooltip = tooltipText, hidden = true, queueing = false, @@ -179,9 +175,9 @@ if gadgetHandler:IsSyncedCode() then local unitSetTargetCircleCmdDesc = { id = CMD_UNIT_SET_TARGET, type = CMDTYPE.ICON_UNIT_OR_AREA, - name = 'Set Target', --extra spaces center the 'Set' text - action = 'settarget', - cursor = 'settarget', + name = "Set Target", --extra spaces center the 'Set' text + action = "settarget", + cursor = "settarget", tooltip = tooltipText, hidden = false, queueing = false, @@ -190,15 +186,13 @@ if gadgetHandler:IsSyncedCode() then local unitCancelTargetCmdDesc = { id = CMD_UNIT_CANCEL_TARGET, type = CMDTYPE.ICON, - name = 'Cancel Target', - action = 'canceltarget', - tooltip = 'Removes top priority target, if set', + name = "Cancel Target", + action = "canceltarget", + tooltip = "Removes top priority target, if set", hidden = false, queueing = false, } - - -------------------------------------------------------------------------------- -- Target Handling @@ -217,12 +211,7 @@ if gadgetHandler:IsSyncedCode() then local function testTargetPos(unitID, weaponList, x, y, z) for weaponNum = 1, #weaponList do - if - weaponList[weaponNum] - and spGetUnitWeaponTestTarget(unitID, weaponNum, x, y, z) - and spGetUnitWeaponTestRange(unitID, weaponNum, x, y, z) - and spGetUnitWeaponHaveFreeLineOfFire(unitID, weaponNum, nil, nil, nil, x, y, z) - then + if weaponList[weaponNum] and spGetUnitWeaponTestTarget(unitID, weaponNum, x, y, z) and spGetUnitWeaponTestRange(unitID, weaponNum, x, y, z) and spGetUnitWeaponHaveFreeLineOfFire(unitID, weaponNum, nil, nil, nil, x, y, z) then return weaponNum end end @@ -564,7 +553,6 @@ if gadgetHandler:IsSyncedCode() then removeUnit(unitID) end - -------------------------------------------------------------------------------- -- Command Tracking @@ -689,25 +677,25 @@ if gadgetHandler:IsSyncedCode() then target[2] = spGetGroundHeight(target[1], target[3]) end if allowTargetPos(unitID, weaponList, target) then - addTargetList = {{ + addTargetList = { { alwaysSeen = true, ignoreStop = ignoreStop, userTarget = userTarget, target = target, sent = false, - }} + } } end elseif nParams == 1 then local target = cmdParams[1] if spValidUnitID(target) and not spAreTeamsAllied(unitTeam, spGetUnitTeam(target)) then if allowTargetUnit(unitID, weaponList, target) then - addTargetList = {{ + addTargetList = { { alwaysSeen = unitAlwaysSeen[spGetUnitDefID(target)], ignoreStop = ignoreStop, userTarget = userTarget, target = target, sent = false, - }} + } } end end end @@ -901,11 +889,7 @@ if gadgetHandler:IsSyncedCode() then processTargetListChunk() end end - - -else -- UNSYNCED - - +else -- UNSYNCED -- How many units' target lists are fully drawn before any are skipped. -- We then skip units in small batches/chunks that slowly grow in size. local unitsFullDrawCount = 100 -- So we then skip n+1 and draw n+2 etc. @@ -999,7 +983,7 @@ else -- UNSYNCED function handleFailCommand(_, teamID) if teamID == myTeam and not mySpec then spPlaySoundFile("FailedCommand", 0.75, "ui") - spSetActiveCommand('settargetnoground') + spSetActiveCommand("settargetnoground") end end @@ -1011,8 +995,8 @@ else -- UNSYNCED local unitData = targetList[unitID] if not unitData then unitData = { - targets = {}, - targetIndex = 1, + targets = {}, + targetIndex = 1, targetActive = false, } targetList[unitID] = unitData @@ -1036,7 +1020,7 @@ else -- UNSYNCED if unitData then unitData.targets[index] = { userTarget = userTarget, - target = (not targetB and targetA) or { targetA, targetB, targetC }, + target = (not targetB and targetA) or { targetA, targetB, targetC }, } if index == unitData.targetIndex then unitData.targetActive = false @@ -1093,7 +1077,7 @@ else -- UNSYNCED elseif not isUnitTarget and target then -- 3d coordinate target local x2, y2, z2 = target[1], target[2], target[3] - drawUnitTarget(x2+y2+z2, x2, y2, z2) + drawUnitTarget(x2 + y2 + z2, x2, y2, z2) end end end @@ -1133,9 +1117,7 @@ else -- UNSYNCED weaponNum = weaponNum + 1 local _, _, currentTarget = spGetUnitWeaponTarget(unitID, weaponNum) if type(currentTarget) == "table" then - result = currentTarget[1] == x - and currentTarget[2] == y - and currentTarget[3] == z + result = currentTarget[1] == x and currentTarget[2] == y and currentTarget[3] == z else result = nil end @@ -1198,9 +1180,7 @@ else -- UNSYNCED end local function shouldDrawDecorations(unitID) - return spIsUnitSelected(unitID) - or drawTarget[unitID] - or drawAllTargets[spGetUnitTeam(unitID)] + return spIsUnitSelected(unitID) or drawTarget[unitID] or drawAllTargets[spGetUnitTeam(unitID)] end local function drawDecorations() @@ -1249,5 +1229,4 @@ else -- UNSYNCED CallAsTeam(myTeam, drawDecorations) end end - end diff --git a/luarules/gadgets/unit_timeslow.lua b/luarules/gadgets/unit_timeslow.lua index 25a65bf9847..29e39683ed7 100644 --- a/luarules/gadgets/unit_timeslow.lua +++ b/luarules/gadgets/unit_timeslow.lua @@ -1,4 +1,3 @@ - if not Spring.GetModOptions().emprework then return end @@ -6,52 +5,50 @@ end local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Unit Slowing", - desc = "Unit movement and firerate slowing effects, used by EMP Rework", - author = "Google Frog , (MidKnight made orig)", - date = "2010-05-31", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Unit Slowing", + desc = "Unit movement and firerate slowing effects, used by EMP Rework", + author = "Google Frog , (MidKnight made orig)", + date = "2010-05-31", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - if not gadgetHandler:IsSyncedCode() then - return + return end - -local spValidUnitID = Spring.ValidUnitID -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spGetUnitHealth = Spring.GetUnitHealth -local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spGetUnitTeam = Spring.GetUnitTeam -local spSetUnitTarget = Spring.SetUnitTarget -local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy +local spValidUnitID = Spring.ValidUnitID +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitHealth = Spring.GetUnitHealth +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitTeam = Spring.GetUnitTeam +local spSetUnitTarget = Spring.SetUnitTarget +local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy local CMD_ATTACK = CMD.ATTACK local CMD_REMOVE = CMD.REMOVE -local CMD_MOVE = CMD.MOVE -local CMD_FIGHT = CMD.FIGHT +local CMD_MOVE = CMD.MOVE +local CMD_FIGHT = CMD.FIGHT local CMD_SET_WANTED_MAX_SPEED = CMD.SET_WANTED_MAX_SPEED -local LOS_ACCESS = {inlos = true} +local LOS_ACCESS = { inlos = true } local gaiaTeamID = Spring.GetGaiaTeamID() local attritionWeaponDefs, MAX_SLOW_FACTOR, DEGRADE_TIMER, DEGRADE_FACTOR, UPDATE_PERIOD = include("LuaRules/Configs/timeslow_defs.lua") local slowedUnits = {} -Spring.SetGameRulesParam("slowState",1) +Spring.SetGameRulesParam("slowState", 1) local function updateSlow(unitID, state) --Spring.Echo("hornet upd slow unit id " .. unitID .. " state.slowDamage " .. state.slowDamage)-- .. " max slow factor " .. MAX_SLOW_FACTOR) -- overslow seems to be a stacked slow aside from the existing, purpose unclear - local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) + local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) if health then - local maxSlow = health*(MAX_SLOW_FACTOR + (state.extraSlowBound or 0)) + local maxSlow = health * (MAX_SLOW_FACTOR + (state.extraSlowBound or 0)) if paralyzeDamage > maxSlow then paralyzeDamage = maxSlow end @@ -61,27 +58,26 @@ local function updateSlow(unitID, state) -- 0.5 == 50% ? --Spring.Echo("hornet pd=" .. (paralyzeDamage or 0)) - local percentSlow = paralyzeDamage/maxHealth + local percentSlow = paralyzeDamage / maxHealth if paralyzeDamage < 5 then percentSlow = 0 end --Spring.Echo("hornet updateSlow unit id " .. unitID .. " slowperc " .. percentSlow) - spSetUnitRulesParam(unitID,"slowState",percentSlow, LOS_ACCESS) + spSetUnitRulesParam(unitID, "slowState", percentSlow, LOS_ACCESS) GG.UpdateUnitAttributes(unitID) --if paralyzeDamage < 5 then - --Spring.Echo("hornetdebug removing unit" .. unitID) + --Spring.Echo("hornetdebug removing unit" .. unitID) - --slowedUnits[unitID] = nil - ----reset speeds to max in case something lingered? - --spSetUnitRulesParam(unitID,"slowState",0, LOS_ACCESS) - --GG.UpdateUnitAttributes(unitID) + --slowedUnits[unitID] = nil + ----reset speeds to max in case something lingered? + --spSetUnitRulesParam(unitID,"slowState",0, LOS_ACCESS) + --GG.UpdateUnitAttributes(unitID) --end end end - --nani the what now --function gadget:UnitPreDamaged_GetWantedWeaponDef() -- local wantedWeaponList = {} @@ -93,7 +89,6 @@ end -- return wantedWeaponList --end - function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam) --if (not spValidUnitID(unitID)) or (not weaponID) or (not attritionWeaponDefs[weaponID]) or ((not attackerID) and attritionWeaponDefs[weaponID].noDeathBlast) @@ -118,19 +113,19 @@ local function removeUnit(unitID) end function gadget:GameFrame(f) - if (f-1) % UPDATE_PERIOD == 0 then + if (f - 1) % UPDATE_PERIOD == 0 then for unitID, state in pairs(slowedUnits) do --if state.extraSlowBound then - --state.extraSlowBound = state.extraSlowBound - DEGRADE_FACTOR - --if state.extraSlowBound <= 0 then - --state.extraSlowBound = nil - --end + --state.extraSlowBound = state.extraSlowBound - DEGRADE_FACTOR + --if state.extraSlowBound <= 0 then + --state.extraSlowBound = nil + --end --end if state.degradeTimer <= 0 then --local health = spGetUnitHealth(unitID) or 0 --state.slowDamage = state.slowDamage - health*DEGRADE_FACTOR else - state.degradeTimer = state.degradeTimer-1 + state.degradeTimer = state.degradeTimer - 1 end local _, _, paralyzeDamage = spGetUnitHealth(unitID) @@ -146,7 +141,6 @@ function gadget:GameFrame(f) end end - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - removeUnit(unitID) + removeUnit(unitID) end diff --git a/luarules/gadgets/unit_tombstones.lua b/luarules/gadgets/unit_tombstones.lua index 40e98b00847..9f164a912fe 100644 --- a/luarules/gadgets/unit_tombstones.lua +++ b/luarules/gadgets/unit_tombstones.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Tombstones", - desc = "Adds a tombstone next to commander wreck", - author = "Floris", - date = "December 2021", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Tombstones", + desc = "Adds a tombstone next to commander wreck", + author = "Floris", + date = "December 2021", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -20,11 +19,11 @@ end local isCommander = {} for defID, def in ipairs(UnitDefs) do if def.customParams.iscommander ~= nil and not string.find(def.name, "scav") then - if string.sub(def.name, 1, 6) == 'corcom' and FeatureDefNames.corstone then + if string.sub(def.name, 1, 6) == "corcom" and FeatureDefNames.corstone then isCommander[defID] = FeatureDefNames.corstone.id - elseif string.sub(def.name, 1, 6) == 'armcom' and FeatureDefNames.armstone then + elseif string.sub(def.name, 1, 6) == "armcom" and FeatureDefNames.armstone then isCommander[defID] = FeatureDefNames.armstone.id - elseif string.sub(def.name, 1, 6) == 'legcom' and FeatureDefNames.legstone then + elseif string.sub(def.name, 1, 6) == "legcom" and FeatureDefNames.legstone then isCommander[defID] = FeatureDefNames.legstone.id end end @@ -32,16 +31,16 @@ end function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) if isCommander[unitDefID] then - local px,py,pz = Spring.GetUnitPosition(unitID) + local px, py, pz = Spring.GetUnitPosition(unitID) pz = pz - 40 if not Spring.GetUnitRulesParam(unitID, "unit_evolved") then - local tombstoneID = Spring.CreateFeature(isCommander[unitDefID], px, Spring.GetGroundHeight(px,pz), pz, 0, teamID) + local tombstoneID = Spring.CreateFeature(isCommander[unitDefID], px, Spring.GetGroundHeight(px, pz), pz, 0, teamID) if tombstoneID then - local rx,ry,rz = Spring.GetFeatureRotation(tombstoneID) + local rx, ry, rz = Spring.GetFeatureRotation(tombstoneID) rx = rx + 0.18 + (math.random(0, 6) / 50) rz = rz - 0.12 + (math.random(0, 12) / 50) ry = ry - 0.12 + (math.random(0, 12) / 50) - Spring.SetFeatureRotation(tombstoneID, rx,ry,rz) + Spring.SetFeatureRotation(tombstoneID, rx, ry, rz) end end end diff --git a/luarules/gadgets/unit_transport_dies_load_dies.lua b/luarules/gadgets/unit_transport_dies_load_dies.lua index 19e0d4799fc..9e6d350be1d 100644 --- a/luarules/gadgets/unit_transport_dies_load_dies.lua +++ b/luarules/gadgets/unit_transport_dies_load_dies.lua @@ -9,19 +9,21 @@ --when trans is self d'ed, on the frame it dies it has both Spring.GetUnitHealth(ID)>0 and Spring.UnitSelfDTime(ID)=0 --when trans is crashing it isn't dead -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "transport_dies_load_dies", - desc = "kills units in transports when transports dies (except commandos, lootboxes, scavengerbeacons and hats)", - author = "knorke, bluestone, icexuick, beherith", - date = "Dec 2012", - license = "GNU GPL, v2 or later, horses", - layer = 0, - enabled = true + name = "transport_dies_load_dies", + desc = "kills units in transports when transports dies (except commandos, lootboxes, scavengerbeacons and hats)", + author = "knorke, bluestone, icexuick, beherith", + date = "Dec 2012", + license = "GNU GPL, v2 or later, horses", + layer = 0, + enabled = true, } end @@ -36,8 +38,7 @@ end local maybeDead = {} local function isDeadOrCrashing(unitID) - return Spring.GetUnitIsDead(unitID) ~= false - or Spring.GetUnitMoveTypeData(unitID).aircraftState == "crashing" + return Spring.GetUnitIsDead(unitID) ~= false or Spring.GetUnitMoveTypeData(unitID).aircraftState == "crashing" end function gadget:UnitUnloaded(unitID, unitDefID, teamID, transportID) diff --git a/luarules/gadgets/unit_transportable_nanos.lua b/luarules/gadgets/unit_transportable_nanos.lua index af0dfbbfe8a..1350b03bab2 100644 --- a/luarules/gadgets/unit_transportable_nanos.lua +++ b/luarules/gadgets/unit_transportable_nanos.lua @@ -1,19 +1,19 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() - return { - name = "Unit transportable nanos", - desc = "Prevent loading of ally nanos, prevent unloading onto cliffs and underwater", - author = "Beherith, Chronographer", - date = "Jul 2012", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Unit transportable nanos", + desc = "Prevent loading of ally nanos, prevent unloading onto cliffs and underwater", + author = "Beherith, Chronographer", + date = "Jul 2012", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end if not gadgetHandler:IsSyncedCode() then - return false + return false end local spGetUnitTeam = Spring.GetUnitTeam @@ -35,12 +35,12 @@ if Spring.GetModOptions().experimentallegionfaction then Nanos[UnitDefNames.legnanotc.id] = true end for udid, ud in pairs(UnitDefs) do - for id in pairs(Nanos) do - if stringFind(ud.name, UnitDefs[id].name, 1, true) then - Nanos[udid] = true - break - end - end + for id in pairs(Nanos) do + if stringFind(ud.name, UnitDefs[id].name, 1, true) then + Nanos[udid] = true + break + end + end end function gadget:Initialize() @@ -52,7 +52,7 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt if not UnitDefs[unitDefID].isTransport then return false end - + if cmdID == CMD_LOAD_UNITS then if #cmdParams == 1 then -- if unit is target local targetId = cmdParams[1] @@ -63,17 +63,17 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt return false end end - else -- CMD_UNLOAD_UNITS + else -- CMD_UNLOAD_UNITS if cmdParams[1] and cmdParams[3] and spGetUnitIsTransporting(unitID) then local intrans = spGetUnitIsTransporting(unitID) if #intrans >= 1 then -- no unloading underwater - local _,y,_ = spGetGroundNormal(cmdParams[1], cmdParams[3]) + local _, y, _ = spGetGroundNormal(cmdParams[1], cmdParams[3]) if Nanos[spGetUnitDefID(intrans[1])] and (cmdParams[2] < 0 or y < 0.9) then return false end end end end - return true + return true end diff --git a/luarules/gadgets/unit_transported_building_ghost.lua b/luarules/gadgets/unit_transported_building_ghost.lua index e822ed3dd32..26831810559 100644 --- a/luarules/gadgets/unit_transported_building_ghost.lua +++ b/luarules/gadgets/unit_transported_building_ghost.lua @@ -2,19 +2,21 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Transported building Ghost Remover", - desc = "Removes the ghosts left by transported buildings", - author = "Chronographer", - date = "Nov 2025", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Transported building Ghost Remover", + desc = "Removes the ghosts left by transported buildings", + author = "Chronographer", + date = "Nov 2025", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end spSetUnitLeavesGhost = Spring.SetUnitLeavesGhost -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local leavesGhost = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -25,7 +27,7 @@ end function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) if leavesGhost[unitDefID] then - spSetUnitLeavesGhost(unitID, false, true) -- Old ghost persists until position re-enters LOS + spSetUnitLeavesGhost(unitID, false, true) -- Old ghost persists until position re-enters LOS end end diff --git a/luarules/gadgets/unit_transportee_hider.lua b/luarules/gadgets/unit_transportee_hider.lua index 69562c9049d..d9923d7d108 100644 --- a/luarules/gadgets/unit_transportee_hider.lua +++ b/luarules/gadgets/unit_transportee_hider.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "09/02/10", license = "PD", layer = 0, - enabled = false + enabled = false, } end diff --git a/luarules/gadgets/unit_transports_air_speed.lua b/luarules/gadgets/unit_transports_air_speed.lua index 836447bfa42..3531dea7202 100644 --- a/luarules/gadgets/unit_transports_air_speed.lua +++ b/luarules/gadgets/unit_transports_air_speed.lua @@ -4,7 +4,7 @@ function gadget:GetInfo() return { name = "Air Transports Speed", desc = "Slows down transport depending on loaded mass", - author = "raaar, Hornet",--added com mod 13/06/24 + author = "raaar, Hornet", --added com mod 13/06/24 date = "2015", license = "PD", layer = 0, @@ -12,7 +12,9 @@ function gadget:GetInfo() } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local TRANSPORTED_MASS_SPEED_PENALTY = 0.2 -- higher makes unit slower local FRAMES_PER_SECOND = Game.gameSpeed @@ -55,21 +57,20 @@ local function updateAllowedSpeed(transportId) local transportspeedmult = 0.0 if 1 == 2 then --stops the gadget from doing anything. CHANGE TO GET ACTUAL SLOWDOWN -- This gadget has done nothing for one year if units then - for _,tUnitId in pairs(units) do + for _, tUnitId in pairs(units) do tunitdefid = spGetUnitDefID(tUnitId) - tunitdefcustom = UnitDefs[tunitdefid].customParams - if (tunitdefcustom ~=nil) then - transportspeedmult = tunitdefcustom.transportspeedmult ~=nil and tunitdefcustom.transportspeedmult or transportspeedmult--use custom if present (can be tweaked) - iscom = tunitdefcustom.iscommander=='1' + tunitdefcustom = UnitDefs[tunitdefid].customParams + if tunitdefcustom ~= nil then + transportspeedmult = tunitdefcustom.transportspeedmult ~= nil and tunitdefcustom.transportspeedmult or transportspeedmult --use custom if present (can be tweaked) + iscom = tunitdefcustom.iscommander == "1" end - + currentMassUsage = currentMassUsage + unitMass[tunitdefid] end massUsageFraction = (currentMassUsage / unitTransportMass[uDefID]) - if (iscom) then - - allowedSpeed = unitSpeed[uDefID] * (1 - massUsageFraction * (TRANSPORTED_MASS_SPEED_PENALTY+transportspeedmult)) / FRAMES_PER_SECOND + if iscom then + allowedSpeed = unitSpeed[uDefID] * (1 - massUsageFraction * (TRANSPORTED_MASS_SPEED_PENALTY + transportspeedmult)) / FRAMES_PER_SECOND else allowedSpeed = unitSpeed[uDefID] * (1 - massUsageFraction * TRANSPORTED_MASS_SPEED_PENALTY) / FRAMES_PER_SECOND --Spring.Echo("unit "..transportUnitDef.name.." is air transport at "..(massUsageFraction*100).."%".." load, curSpeed="..vw.." allowedSpeed="..allowedSpeed) @@ -79,7 +80,6 @@ local function updateAllowedSpeed(transportId) end end - -- add transports to table when they load a unit function gadget:UnitLoaded(unitId, unitDefId, unitTeam, transportId, transportTeam) if canFly[spGetUnitDefID(transportId)] and not airTransports[transportId] then @@ -96,22 +96,20 @@ end -- every frame, adjust speed of air transports according to transported mass, if any function gadget:GameFrame(n) - -- for each air transport with units loaded, reduce speed if currently greater than allowed local factor = 1 - local vx,vy,vz,vw = 0 + local vx, vy, vz, vw = 0 local alSpeed = 0 - for unitId,_ in pairs(airTransports) do - vx,vy,vz,vw = spGetUnitVelocity(unitId) + for unitId, _ in pairs(airTransports) do + vx, vy, vz, vw = spGetUnitVelocity(unitId) alSpeed = airTransportMaxSpeeds[unitId] if alSpeed and vw and vw > alSpeed then factor = alSpeed / vw - spSetUnitVelocity(unitId,vx * factor,vy * factor,vz * factor) + spSetUnitVelocity(unitId, vx * factor, vy * factor, vz * factor) end end end - function gadget:UnitUnloaded(unitId, unitDefId, teamId, transportId) if canFly[spGetUnitDefID(transportId)] then local units = airTransports[transportId] and spGetUnitIsTransporting(transportId) or {} diff --git a/luarules/gadgets/unit_turretspeed.lua b/luarules/gadgets/unit_turretspeed.lua index c7154c6680d..daa9b735f2d 100644 --- a/luarules/gadgets/unit_turretspeed.lua +++ b/luarules/gadgets/unit_turretspeed.lua @@ -1,15 +1,14 @@ - local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "UnitDefs Turret TurnSpeeds", - desc = "Allows to set units' turret turnspeeds from UnitDefs tables", - author = "Doo", - date = "May 2018", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "UnitDefs Turret TurnSpeeds", + desc = "Allows to set units' turret turnspeeds from UnitDefs tables", + author = "Doo", + date = "May 2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -42,7 +41,9 @@ in bos. noone uses that. -- finds fields weapon1turretx/weapon1turrety, up to 10. -- if these are renamed please update this comment accordingly so no sneaky code is lost :) -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end local spGetAllUnits = Spring.GetAllUnits local spGetUnitDefID = Spring.GetUnitDefID @@ -55,14 +56,14 @@ for unitDefID, unitDef in pairs(UnitDefs) do local weapons = unitDef.weapons if weapons and not stringFind((stringLower(unitDef.scriptName)), "lua", 1, true) then for weaponID, weapon in pairs(weapons) do - local customParamName = 'weapon'..weaponID..'turret' - if unitDef.customParams[customParamName..'x'] and unitDef.customParams[customParamName..'y'] then - local TurretX = (tonumber(unitDef.customParams[customParamName..'x']))*182 - local TurretY = (tonumber(unitDef.customParams[customParamName..'y']))*182 + local customParamName = "weapon" .. weaponID .. "turret" + if unitDef.customParams[customParamName .. "x"] and unitDef.customParams[customParamName .. "y"] then + local TurretX = (tonumber(unitDef.customParams[customParamName .. "x"])) * 182 + local TurretY = (tonumber(unitDef.customParams[customParamName .. "y"])) * 182 if not unitConf[unitDefID] then unitConf[unitDefID] = {} end - unitConf[unitDefID][#unitConf[unitDefID]+1] = {'SetWeapon'..weaponID..'TurretSpeed', 0, TurretX, TurretY} + unitConf[unitDefID][#unitConf[unitDefID] + 1] = { "SetWeapon" .. weaponID .. "TurretSpeed", 0, TurretX, TurretY } end end end @@ -78,7 +79,7 @@ end function gadget:UnitCreated(unitID, unitDefID) if unitConf[unitDefID] then - for i=1, #unitConf[unitDefID] do + for i = 1, #unitConf[unitDefID] do spCallCOBScript(unitID, unitConf[unitDefID][i][1], unitConf[unitDefID][i][2], unitConf[unitDefID][i][3], unitConf[unitDefID][i][4]) end end diff --git a/luarules/gadgets/unit_wanted_speed.lua b/luarules/gadgets/unit_wanted_speed.lua index 3c8f1bf5313..a2aabc2df5c 100644 --- a/luarules/gadgets/unit_wanted_speed.lua +++ b/luarules/gadgets/unit_wanted_speed.lua @@ -1,4 +1,3 @@ - if not Spring.GetModOptions().emprework then return end @@ -7,33 +6,28 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Wanted Speed", - desc = "Adds a command which sets maxWantedSpeed.", - author = "GoogleFrog", - date = "11 November 2018", - license = "GNU GPL, v2 or later", - layer = -1000000, -- Before every state toggle gadget. - enabled = true, + name = "Wanted Speed", + desc = "Adds a command which sets maxWantedSpeed.", + author = "GoogleFrog", + date = "11 November 2018", + license = "GNU GPL, v2 or later", + layer = -1000000, -- Before every state toggle gadget. + enabled = true, } end - if not gadgetHandler:IsSyncedCode() then return end - --I have no idea what this is trying to do or why ---local CMD_WANTED_SPEED = Spring.Utilities.CMD.WANTED_SPEED --local wantedCommand = { - --[CMD_WANTED_SPEED] = true, +--[CMD_WANTED_SPEED] = true, --} - - - local function getMovetype(ud) if ud.canFly or ud.isAirUnit then if ud.isHoveringAirUnit then @@ -47,18 +41,12 @@ local function getMovetype(ud) return false -- For structures or any other invalid movetype end - - - --Spring.Echo('hornet debug wanted_speed loaded') - - +--Spring.Echo('hornet debug wanted_speed loaded') local units = {} local moveTypeByDefID = {} local moveType = 0 do - - --local moveData = {} --local moveType = 0 @@ -68,30 +56,25 @@ do moveTypeByDefID[i] = getMovetype(UnitDefs[i]) end - --local getMovetype = Spring.Utilities.getMovetype --for i = 1, #UnitDefs do - --moveTypeByDefID[i] = getMovetype(UnitDefs[i]) - --moveData = spGetUnitMoveTypeData(i) - - - --Spring.Echo("hornet movedef name" .. UnitDefs[i].moveDef.name) - --Spring.Echo("hornet movedef name") - - - --Spring.Echo('hornetdebug UnitDefs[i]') - --Spring.Echo(UnitDefs[i]) - --for k,v in pairs(UnitDefs[i]) do - -- Spring.Echo(k,v) - --end + --moveTypeByDefID[i] = getMovetype(UnitDefs[i]) + --moveData = spGetUnitMoveTypeData(i) + --Spring.Echo("hornet movedef name" .. UnitDefs[i].moveDef.name) + --Spring.Echo("hornet movedef name") - --moveType = 0 - --moveType = SU.getMovetypeByID(UnitDefs[i]) + --Spring.Echo('hornetdebug UnitDefs[i]') + --Spring.Echo(UnitDefs[i]) + --for k,v in pairs(UnitDefs[i]) do + -- Spring.Echo(k,v) + --end + --moveType = 0 + --moveType = SU.getMovetypeByID(UnitDefs[i]) - --if UnitDefs[i].moveDef.name == "ground" then moveType = 2 end - --moveTypeByDefID[i] = moveType + --if UnitDefs[i].moveDef.name == "ground" then moveType = 2 end + --moveTypeByDefID[i] = moveType --end end @@ -99,9 +82,7 @@ end ------------------------------------------------------------------------------------- local function SetUnitWantedSpeed(unitID, unitDefID, wantedSpeed, forceUpdate) - - ---Spring.Echo("hornet SetUnitWantedSpeed" .. unitID .. "wanted speed " .. (wantedSpeed or 'nil')) + --Spring.Echo("hornet SetUnitWantedSpeed" .. unitID .. "wanted speed " .. (wantedSpeed or 'nil')) if not unitDefID then return @@ -139,8 +120,6 @@ local function SetUnitWantedSpeed(unitID, unitDefID, wantedSpeed, forceUpdate) end end - - ---this makes no sense, why does this chain exist function GG.ForceUpdateWantedMaxSpeed(unitID, unitDefID, clearWanted) SetUnitWantedSpeed(unitID, unitDefID, (not clearWanted) and units and units[unitID] and units[unitID].lastWantedSpeed, true) diff --git a/luarules/gadgets/unit_water_depth_damage.lua b/luarules/gadgets/unit_water_depth_damage.lua index f1e98252ba5..907e8e5bbdb 100644 --- a/luarules/gadgets/unit_water_depth_damage.lua +++ b/luarules/gadgets/unit_water_depth_damage.lua @@ -8,11 +8,13 @@ function gadget:GetInfo() date = "2024.9.22", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end --use customParams.water_fall_damage_multiplier = 1.0 to change the amount of fall damage taken by specific units. @@ -51,8 +53,8 @@ local spGetUnitHealth = Spring.GetUnitHealth local spDestroyUnit = Spring.DestroyUnit local waterIsLava = Spring.GetModOptions().map_waterislava -local largeSplashCEG = waterIsLava and 'lavasplash_large' or 'watersplash_large' -local smallSplashCEG = waterIsLava and 'lavasplash_small' or 'watersplash_small' +local largeSplashCEG = waterIsLava and "lavasplash_large" or "watersplash_large" +local smallSplashCEG = waterIsLava and "lavasplash_small" or "watersplash_small" local unitDefData = {} local transportDrops = {} @@ -67,7 +69,7 @@ for unitDefID, unitDef in ipairs(UnitDefs) do defData.fallDamage = unitDef.health * fallDamage * defData.fallDamageMultiplier defData.unitDefID = unitDefID if unitDef.moveDef.depth and unitDef.moveDef.smClass ~= Game.speedModClasses.Boat and unitDef.moveDef.smClass ~= Game.speedModClasses.ship then - if unitDef.moveDef.depth >= isDrownableMaxWaterDepth then + if unitDef.moveDef.depth >= isDrownableMaxWaterDepth then if unitDef.moveDef.smClass == Game.speedModClasses.Hover then --units must have "hover" in their movedef name in order to be treated as hovercraft defData.isHover = true else @@ -104,7 +106,7 @@ function gadget:UnitEnteredWater(unitID, unitDefID, unitTeam) local posX, posY, posZ = spGetUnitBasePosition(unitID) if velLength > velocityThreshold then spSpawnCEG(largeSplashCEG, posX, posY, posZ) - spPlaySoundFile('xplodep3', 0.5, posX, posY, posZ, 'sfx') + spPlaySoundFile("xplodep3", 0.5, posX, posY, posZ, "sfx") if unitDefData[unitDefID] then local health, maxHealth = spGetUnitHealth(unitID) local damage = (unitDefData[unitDefID].fallDamage * velLength) * (fallDamageCompoundingFactor ^ velLength) @@ -116,7 +118,7 @@ function gadget:UnitEnteredWater(unitID, unitDefID, unitTeam) end else spSpawnCEG(smallSplashCEG, posX, posY, posZ) - spPlaySoundFile('xplodep3', 0.3, posX, posY, posZ, 'sfx') + spPlaySoundFile("xplodep3", 0.3, posX, posY, posZ, "sfx") end transportDrops[unitID] = nil else @@ -140,7 +142,9 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end local function getUnitPositionHeight(unitID) -- returns nil for invalid units - if spGetUnitIsDead(unitID) ~= false or spValidUnitID(unitID) ~= true then return nil, nil, nil end + if spGetUnitIsDead(unitID) ~= false or spValidUnitID(unitID) ~= true then + return nil, nil, nil + end local posX, posY, posZ = spGetUnitPosition(unitID) if posX and posY and posZ then return posX, posY, posZ @@ -165,10 +169,10 @@ function gadget:GameFrame(frame) if posX then local movableSpot = spTestMoveOrder(data.unitDefID, posX, posY, posZ, nil, nil, nil, true, true, true) --somehow, this works. Copied from elsewhere in the code, spring wiki and recoil and game repo didn't have any info on this format. if not movableSpot then - spSpawnCEG('blacksmoke', posX, posY, posZ) --actually looks like tiny bubbles underwater - spPlaySoundFile('lavarumbleshort1', 0.40, posX, posY, posZ, 'sfx') + spSpawnCEG("blacksmoke", posX, posY, posZ) --actually looks like tiny bubbles underwater + spPlaySoundFile("lavarumbleshort1", 0.40, posX, posY, posZ, "sfx") if math.random(1, 6) == 1 then - spPlaySoundFile('alien_electric', 0.50, posX, posY, posZ, 'sfx') + spPlaySoundFile("alien_electric", 0.50, posX, posY, posZ, "sfx") end spAddUnitDamage(unitID, data.drowningDamage, 0, nil, waterDamageDefID) end diff --git a/luarules/gadgets/unit_waterspeedmultiplier.lua b/luarules/gadgets/unit_waterspeedmultiplier.lua index 9039895c9d4..924058eb7b0 100644 --- a/luarules/gadgets/unit_waterspeedmultiplier.lua +++ b/luarules/gadgets/unit_waterspeedmultiplier.lua @@ -2,22 +2,22 @@ local gadget = gadget ---@type Gadget local enabled = true do - local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") - if success and mapinfo and mapinfo.voidwater then - enabled = false - end + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") + if success and mapinfo and mapinfo.voidwater then + enabled = false + end end function gadget:GetInfo() - return { - name = "Water Speed Multiplier", - desc = "Speeds up or slows down units on water compared to their default land speed.", - author = "ZephyrSkies", - date = "2025-09-14", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = enabled, - } + return { + name = "Water Speed Multiplier", + desc = "Speeds up or slows down units on water compared to their default land speed.", + author = "ZephyrSkies", + date = "2025-09-14", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = enabled, + } end if not gadgetHandler:IsSyncedCode() then @@ -50,7 +50,7 @@ local function canHaveGroundMoveType(unitDef) end for defID, ud in pairs(UnitDefs) do - local params = ud.customParams + local params = ud.customParams local speedFactorInWater = tonumber(params.speedfactorinwater or 1) or 1 local speedFactorAtDepth = math.abs(params.speedfactoratdepth and tonumber(params.speedfactoratdepth) or 0) * -1 @@ -61,15 +61,15 @@ for defID, ud in pairs(UnitDefs) do end unitDefData[defID] = { - speedFactorInWater = speedFactorInWater, + speedFactorInWater = speedFactorInWater, speedFactorAtDepth = speedFactorAtDepth, - speed = ud.speed, - turn = ud.turnRate, - acc = ud.maxAcc, - dec = ud.maxDec, - } - end + speed = ud.speed, + turn = ud.turnRate, + acc = ud.maxAcc, + dec = ud.maxDec, + } + end end local unitDepthSlowUpdate = {} @@ -79,11 +79,11 @@ local fastUpdateFrames = math.round(depthUpdateRate * Game.gameSpeed) ---@type GroundMoveType local moveTypeData = { - maxSpeed = 0, + maxSpeed = 0, maxWantedSpeed = 0, - turnRate = 0, - accRate = 0, - decRate = 0, + turnRate = 0, + accRate = 0, + decRate = 0, } -- Local functions @@ -98,15 +98,15 @@ local moveTypeData = { local function setMoveTypeData(unitID, unitData, factor) local data = moveTypeData - --these factor effectiveness values for the given unit stats were chosen arbitrarily for the best mechanical feel and balance, - --as well as to avoid strange jerky visuals + --these factor effectiveness values for the given unit stats were chosen arbitrarily for the best mechanical feel and balance, + --as well as to avoid strange jerky visuals local speed = unitData.speed * factor - data.maxSpeed = speed + data.maxSpeed = speed data.maxWantedSpeed = speed - data.turnRate = unitData.turn * (factor * 0.50 + 0.50) - data.accRate = unitData.acc * (factor * 0.75 + 0.25) - data.decRate = unitData.dec * (factor * 0.75 + 0.25) + data.turnRate = unitData.turn * (factor * 0.50 + 0.50) + data.accRate = unitData.acc * (factor * 0.75 + 0.25) + data.decRate = unitData.dec * (factor * 0.75 + 0.25) spSetGroundMoveTypeData(unitID, data) end @@ -175,15 +175,15 @@ function gadget:GameFrame(frame) end function gadget:UnitFinished(unitID, unitDefID, unitTeam) - local unitData = unitDefData[unitDefID] - if unitData and getUnitDepth(unitID) <= 0 then + local unitData = unitDefData[unitDefID] + if unitData and getUnitDepth(unitID) <= 0 then if canSetSpeed(unitID) then applySpeed(unitID, unitData) end if unitData.speedFactorAtDepth ~= 0 then unitDepthFastUpdate[unitID] = unitData end - end + end end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) @@ -192,33 +192,33 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) end function gadget:UnitEnteredWater(unitID, unitDefID, unitTeam) - local unitData = unitDefData[unitDefID] - if unitData then + local unitData = unitDefData[unitDefID] + if unitData then if canSetSpeed(unitID) then applySpeed(unitID, unitData) end if unitData.speedFactorAtDepth ~= 0 then unitDepthFastUpdate[unitID] = unitData end - end + end end function gadget:UnitLeftWater(unitID, unitDefID, unitTeam) - local unitData = unitDefData[unitDefID] - if unitData then + local unitData = unitDefData[unitDefID] + if unitData then if canSetSpeed(unitID) then applySpeed(unitID, unitData, 1) end unitDepthSlowUpdate[unitID] = nil unitDepthFastUpdate[unitID] = nil - end + end end function gadget:Initialize() - if not next(unitDefData) then - gadgetHandler:RemoveGadget() + if not next(unitDefData) then + gadgetHandler:RemoveGadget() return - end + end local unitFinished = gadget.UnitFinished for _, unitID in ipairs(Spring.GetAllUnits()) do diff --git a/luarules/gadgets/unit_weapon_smart_select_helper.lua b/luarules/gadgets/unit_weapon_smart_select_helper.lua index 63bff0eea06..d70d91fedca 100644 --- a/luarules/gadgets/unit_weapon_smart_select_helper.lua +++ b/luarules/gadgets/unit_weapon_smart_select_helper.lua @@ -8,11 +8,13 @@ function gadget:GetInfo() date = "2024.12.7", license = "GNU GPL, v2 or later", layer = 1, --must layer after cmd_area_commands_filter.lua (and unit_alt_set_target_type.lua I assume?) - enabled = true + enabled = true, } end -if not gadgetHandler:IsSyncedCode() then return end +if not gadgetHandler:IsSyncedCode() then + return +end --[[ Integration Checklist: @@ -30,7 +32,7 @@ This may be necessary if the turret's turn speed is so slow it triggers false mi --static local frameCheckModulo = Game.gameSpeed -- once per second is sufficient local aggroDecayRate = 0.7 --aggro is multiplied by this until it falls within priority aiming state range -local aggroDecayCap = 10 -- this caps the aggro decay so that misfire state can last a significant amount of time +local aggroDecayCap = 10 -- this caps the aggro decay so that misfire state can last a significant amount of time local aggroPriorityCap = 1 --The maximum aggro that can be accumulated. This prevents manual targetting from getting stuck in a fire mode for too long. local aggroBackupCap = -16 --Like above, but a negative value because backup is triggered with negative aggro. local gameSpeed = Game.gameSpeed @@ -85,13 +87,13 @@ local spEditUnitCmdDesc = Spring.EditUnitCmdDesc local spFindUnitCmdDesc = Spring.FindUnitCmdDesc local trajectoryCmdDesc = { - id = CMD_SMART_TOGGLE, - type = CMDTYPE.ICON_MODE, - tooltip = 'trajectory_tooltip', - name = 'trajectory_toggle', - cursor = 'cursornormal', - action = 'trajectory_toggle', - params = { AUTO_TOGGLESTATE, "trajectory_low", "trajectory_high", "trajectory_auto" }, + id = CMD_SMART_TOGGLE, + type = CMDTYPE.ICON_MODE, + tooltip = "trajectory_tooltip", + name = "trajectory_toggle", + cursor = "cursornormal", + action = "trajectory_toggle", + params = { AUTO_TOGGLESTATE, "trajectory_low", "trajectory_high", "trajectory_auto" }, } local defaultCmdDesc = table.copy(trajectoryCmdDesc) @@ -120,10 +122,8 @@ for unitDefID, unitDef in ipairs(UnitDefs) do else unitDefData.smartCmdDesc = defaultCmdDesc end - elseif weaponDef.customParams.smart_backup and not unitDefData.backupWeapon then unitDefData.backupWeapon = weaponNumber - elseif weaponDef.customParams.smart_trajectory_checker and not unitDefData.trajectoryCheckWeapon then unitDefData.trajectoryCheckWeapon = weaponNumber end @@ -137,20 +137,18 @@ end local function updatePredictedShotFrame(attackerID, unitData, defData) if unitData.predictedShotFrame < gameFrame - defData.failedToFireFrameThreshold then - unitData.predictedShotFrame = mathMax( - spGetUnitWeaponState(attackerID, defData.priorityWeapon, 'reloadFrame'), - spGetUnitWeaponState(attackerID, defData.backupWeapon, 'reloadFrame') - ) + unitData.predictedShotFrame = mathMax(spGetUnitWeaponState(attackerID, defData.priorityWeapon, "reloadFrame"), spGetUnitWeaponState(attackerID, defData.backupWeapon, "reloadFrame")) end end local function failureToFireCheck(attackerID, data, defData) - if not data.suspendMisfireUntilFrame or data.aggroBias < prioritySwitchThreshold then return false end + if not data.suspendMisfireUntilFrame or data.aggroBias < prioritySwitchThreshold then + return false + end updatePredictedShotFrame(attackerID, data, defData) - if data.predictedShotFrame < gameFrame - defData.failedToFireFrameThreshold and - gameFrame > data.suspendMisfireUntilFrame then + if data.predictedShotFrame < gameFrame - defData.failedToFireFrameThreshold and gameFrame > data.suspendMisfireUntilFrame then return true else return false @@ -194,7 +192,6 @@ local function queueSwitchFrame(attackerID, data, defData, setState) else spCallCOBScript(attackerID, data.setStateScriptID, 0, setState) end - end data.state = setState @@ -293,19 +290,21 @@ local function updateAimingState(attackerID) end local function toggleTrajectory(unitID, state) - local cmdDescID = spFindUnitCmdDesc(unitID, CMD_SMART_TOGGLE) - if cmdDescID then + local cmdDescID = spFindUnitCmdDesc(unitID, CMD_SMART_TOGGLE) + if cmdDescID then local unitData = smartUnits[unitID] - if not unitData then return end - state = (state % 3) - trajectoryCmdDesc.params[1] = state - spEditUnitCmdDesc(unitID, cmdDescID, {params = trajectoryCmdDesc.params}) + if not unitData then + return + end + state = (state % 3) + trajectoryCmdDesc.params[1] = state + spEditUnitCmdDesc(unitID, cmdDescID, { params = trajectoryCmdDesc.params }) unitData.toggleState = state unitData.state = state if state ~= AUTO_TOGGLESTATE then spCallCOBScript(unitID, smartUnits[unitID].setStateScriptID, 0, state) end - end + end end function gadget:UnitCreated(unitID, unitDefID) @@ -321,7 +320,7 @@ function gadget:UnitCreated(unitID, unitDefID) lastTargetMatchNumber = 0, --this exists so that a player switching targets frequently doesn't trigger a faulty misfire. switchCooldownFrame = 0, state = PRIORITY_AIMINGSTATE, - toggleState = AUTO_TOGGLESTATE + toggleState = AUTO_TOGGLESTATE, } spCallCOBScript(unitID, smartUnits[unitID].setStateScriptID, 0, PRIORITY_AIMINGSTATE) @@ -354,9 +353,9 @@ function gadget:GameFrame(frame) end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) - if smartUnitDefs[unitDefID] then - toggleTrajectory(unitID, cmdParams[1]) - return false -- command was used - end - return true -- command was not used + if smartUnitDefs[unitDefID] then + toggleTrajectory(unitID, cmdParams[1]) + return false -- command was used + end + return true -- command was not used end diff --git a/luarules/gadgets/unit_windmill_control.lua b/luarules/gadgets/unit_windmill_control.lua index b611c1be3ab..46f0ebe1a00 100644 --- a/luarules/gadgets/unit_windmill_control.lua +++ b/luarules/gadgets/unit_windmill_control.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "June 29, 2007", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -16,7 +16,7 @@ if not gadgetHandler:IsSyncedCode() then return false end - -- Only apply these when resource multipliers are active, to save performance +-- Only apply these when resource multipliers are active, to save performance local energyMultActive = false if Spring.GetModOptions().multiplier_energyproduction * Spring.GetModOptions().multiplier_resourceincome ~= 1 then energyMultActive = true diff --git a/luarules/gadgets/unit_workertime_boost.lua b/luarules/gadgets/unit_workertime_boost.lua index 33dbd73e2a5..fd9358dcb76 100644 --- a/luarules/gadgets/unit_workertime_boost.lua +++ b/luarules/gadgets/unit_workertime_boost.lua @@ -8,14 +8,14 @@ function gadget:GetInfo() date = "April 2024", license = "Public domain", layer = 0, - enabled = true + enabled = true, } end - - -- synced only -if not gadgetHandler:IsSyncedCode() then return false end +if not gadgetHandler:IsSyncedCode() then + return false +end -- workertimeboost = number -- in the unitdefs of the builder. This is the mulitplier by which workertime is boosted. -- wtboostunittype = "MOBILE TURRET" defined in unitdef of builder which defines what units trigger workertime boost for that builder. @@ -26,11 +26,11 @@ local spSetUnitRulesParam = Spring.SetUnitRulesParam local boostableUnits = {} local builderWatchDefs = {} local builderWatch = {} - + for id, def in pairs(UnitDefs) do if def.buildSpeed then if def.customParams.workertimeboost and def.customParams.wtboostunittype then - builderWatchDefs[id] = {buildspeed = def.buildSpeed, boost = def.customParams.workertimeboost*def.buildSpeed, trigger = def.customParams.wtboostunittype, timestamp = 0} + builderWatchDefs[id] = { buildspeed = def.buildSpeed, boost = def.customParams.workertimeboost * def.buildSpeed, trigger = def.customParams.wtboostunittype, timestamp = 0 } end end boostableUnits[id] = {} @@ -68,7 +68,7 @@ function gadget:GameFrame(frame) if data.timestamp < frame then local project = spGetUnitIsBuilding(id) or nil if project then - local projectStrings = boostableUnits[spGetUnitDefID(project)] or {" "} + local projectStrings = boostableUnits[spGetUnitDefID(project)] or { " " } local enableBoost = false for _, string in pairs(projectStrings) do if projectStrings and string.find(data.trigger, string) then @@ -81,7 +81,7 @@ function gadget:GameFrame(frame) spSetUnitRulesParam(id, "workertimeBoosted", data.boost) else Spring.SetUnitBuildSpeed(id, data.buildspeed) - data.timestamp = frame+60 + data.timestamp = frame + 60 spSetUnitRulesParam(id, "workertimeBoosted", 0) end else diff --git a/luarules/gadgets/unit_xmas.lua b/luarules/gadgets/unit_xmas.lua index 66e5b95f80e..a012b17dde8 100644 --- a/luarules/gadgets/unit_xmas.lua +++ b/luarules/gadgets/unit_xmas.lua @@ -6,13 +6,13 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Xmas effects", - desc = "Adds unit explosion xmas-balls and places candycanes randomly on the map", - author = "Floris", - date = "October 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Xmas effects", + desc = "Adds unit explosion xmas-balls and places candycanes randomly on the map", + author = "Floris", + date = "October 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -21,23 +21,23 @@ _G.itsXmas = true local decorationUdefIDs = {} local decorationUdefIDlist = {} local decorationSizes = {} -for udefID,def in ipairs(UnitDefs) do - if string.sub(def.name, 1, 8) == 'xmasball' then - decorationUdefIDlist[#decorationUdefIDlist+1] = udefID +for udefID, def in ipairs(UnitDefs) do + if string.sub(def.name, 1, 8) == "xmasball" then + decorationUdefIDlist[#decorationUdefIDlist + 1] = udefID decorationUdefIDs[udefID] = true local size = tonumber(string.sub(def.name, 11)) if size then if not decorationSizes[size] then decorationSizes[size] = {} end - decorationSizes[size][#decorationSizes[size]+1] = udefID + decorationSizes[size][#decorationSizes[size] + 1] = udefID end end end ------------------------------------------------------------------------------- if not gadgetHandler:IsSyncedCode() then - local uniformcache = {0} + local uniformcache = { 0 } function gadget:UnitCreated(unitID, unitDefID) if decorationUdefIDs[unitDefID] then uniformcache[1] = math.random() * 0.6 - 0.25 @@ -49,20 +49,20 @@ end ------------------------------------------------------------------------------- local maxDecorations = 400 -local candycaneAmount = math.ceil((Game.mapSizeX*Game.mapSizeZ)/1800000) +local candycaneAmount = math.ceil((Game.mapSizeX * Game.mapSizeZ) / 1800000) local candycaneSnowMapMult = 2.5 -local addGaiaBalls = false -- if false, only own team colored balls are added +local addGaiaBalls = false -- if false, only own team colored balls are added -local enableUnitDecorations = true -- burst out xmas ball after unit death -for _,teamID in ipairs(Spring.GetTeamList()) do - if select(4,Spring.GetTeamInfo(teamID,false)) then -- is AI? +local enableUnitDecorations = true -- burst out xmas ball after unit death +for _, teamID in ipairs(Spring.GetTeamList()) do + if select(4, Spring.GetTeamInfo(teamID, false)) then -- is AI? enableUnitDecorations = false end end local isComWreck = {} local xmasComwreckDefID -for fdefID,def in ipairs(FeatureDefs) do +for fdefID, def in ipairs(FeatureDefs) do if def.name == "armcom_dead" or def.name == "corcom_dead" or def.name == "legcom_dead" or def.name == "legcomlvl2_dead" or def.name == "legcomlvl3_dead" or def.name == "legcomlvl4_dead" then isComWreck[fdefID] = true end @@ -72,46 +72,46 @@ for fdefID,def in ipairs(FeatureDefs) do end local costSettings = { - {0, 0, 1}, - {40, 1, 1}, - {100, 1, 1}, - {200, 1, 2}, - {350, 2, 2}, - {600, 2, 2}, - {900, 3, 3}, - {1200, 3, 3}, - {1500, 4, 3}, - {2000, 4, 4}, - {2500, 5, 4}, - {4000, 6, 5}, - {7000, 7, 5}, - {12000, 8, 6}, - {20000, 9, 6}, + { 0, 0, 1 }, + { 40, 1, 1 }, + { 100, 1, 1 }, + { 200, 1, 2 }, + { 350, 2, 2 }, + { 600, 2, 2 }, + { 900, 3, 3 }, + { 1200, 3, 3 }, + { 1500, 4, 3 }, + { 2000, 4, 4 }, + { 2500, 5, 4 }, + { 4000, 6, 5 }, + { 7000, 7, 5 }, + { 12000, 8, 6 }, + { 20000, 9, 6 }, } local hasDecoration = {} -for udefID,def in ipairs(UnitDefs) do +for udefID, def in ipairs(UnitDefs) do if not def.isAirUnit and not def.modCategories["ship"] and not def.modCategories["hover"] and not def.modCategories["underwater"] and not def.modCategories["object"] then if def.mass >= 35 then - local balls = math.floor(((def.radius-13) / 7.5)) - local cost = def.metalCost + (def.energyCost/100) + local balls = math.floor(((def.radius - 13) / 7.5)) + local cost = def.metalCost + (def.energyCost / 100) local impulse = 0.5 local radius = 0.8 - for _,v in ipairs(costSettings) do + for _, v in ipairs(costSettings) do if cost > v[1] then balls = v[2] radius = v[3] --+ impulse - impulse = impulse + (radius/#decorationSizes) + impulse = impulse + (radius / #decorationSizes) else break end end if balls > 0 then - hasDecoration[udefID] = {balls, impulse, 30*20, radius} + hasDecoration[udefID] = { balls, impulse, 30 * 20, radius } end end end if def.customParams.iscommander ~= nil then - hasDecoration[udefID] = {28, 9, 30*33, 1, true} -- always shows decorations for commander even if maxDecorations is reached + hasDecoration[udefID] = { 28, 9, 30 * 33, 1, true } -- always shows decorations for commander even if maxDecorations is reached end end @@ -133,7 +133,7 @@ function initiateXmas() if snowKeywords then local currentMapname = Game.mapName:lower() - for _,keyword in pairs(snowKeywords) do + for _, keyword in pairs(snowKeywords) do if string.find(currentMapname, keyword, nil, true) then candycaneAmount = math.floor(candycaneAmount * candycaneSnowMapMult) break @@ -146,22 +146,22 @@ function initiateXmas() local allfeatures = Spring.GetAllFeatures() for i, featureID in ipairs(allfeatures) do local featureDefID = Spring.GetFeatureDefID(featureID) - if string.find(FeatureDefs[featureDefID].name, 'candycane') then + if string.find(FeatureDefs[featureDefID].name, "candycane") then detectedCandycane = true break end end if not detectedCandycane then - for i=1, candycaneAmount do + for i = 1, candycaneAmount do local x = random(0, Game.mapSizeX) local z = random(0, Game.mapSizeZ) local y = GetGroundHeight(x, z) if y > 5 then - local groundType, groundType2 = Spring.GetGroundInfo(x,z) - if (type(groundType) == 'string' and groundType ~= "void" or groundType2 ~= "void") then -- 105 compatibility - local caneType = math.ceil(random(1,7)) - local featureID = Spring.CreateFeature('candycane'..caneType,x,y,z,random(0,360)) - Spring.SetFeatureRotation(featureID, random(-12,12), random(-12,12), random(-180,180)) + local groundType, groundType2 = Spring.GetGroundInfo(x, z) + if type(groundType) == "string" and groundType ~= "void" or groundType2 ~= "void" then -- 105 compatibility + local caneType = math.ceil(random(1, 7)) + local featureID = Spring.CreateFeature("candycane" .. caneType, x, y, z, random(0, 360)) + Spring.SetFeatureRotation(featureID, random(-12, 12), random(-12, 12), random(-180, 180)) end end end @@ -170,20 +170,19 @@ function initiateXmas() end function gadget:GameFrame(n) - if n % 30 == 1 then for unitID, frame in pairs(decorations) do if frame < n then decorations[unitID] = nil - local x,y,z = Spring.GetUnitPosition(unitID) + local x, y, z = Spring.GetUnitPosition(unitID) if x then - local gy = Spring.GetGroundHeight(x,z) - decorationsTerminal[unitID] = n+random(0,50)+225+((y - gy) * 33) -- allows if in sea to take longer to go under seafloor - if decorationsTerminal[unitID] > n+1500 then -- limit time - decorationsTerminal[unitID] = n+1500 + local gy = Spring.GetGroundHeight(x, z) + decorationsTerminal[unitID] = n + random(0, 50) + 225 + ((y - gy) * 33) -- allows if in sea to take longer to go under seafloor + if decorationsTerminal[unitID] > n + 1500 then -- limit time + decorationsTerminal[unitID] = n + 1500 end local env = Spring.UnitScript.GetScriptEnv(unitID) - Spring.UnitScript.CallAsUnit(unitID,env.Sink) + Spring.UnitScript.CallAsUnit(unitID, env.Sink) end end end @@ -210,16 +209,16 @@ function gadget:GameFrame(n) if addGaiaBalls and random() > 0.5 then teamID = gaiaTeamID end - local size = math.clamp(math.floor((hasDecoration[data[5]][4])), 1, #decorationSizes) -- retrieve max size - size = math.min(size, (math.ceil((size*0.35) + (math.random() * (size*0.65))))) -- pick a size - local decorationDefID = decorationSizes[size][math.floor(1 + (math.random() * (#decorationSizes[size]-0.001)))] -- pick one of 2 variants/textured baubles - uID = Spring.CreateUnit(decorationDefID, data[1],data[2],data[3], 0, teamID) + local size = math.clamp(math.floor(hasDecoration[data[5]][4]), 1, #decorationSizes) -- retrieve max size + size = math.min(size, (math.ceil((size * 0.35) + (math.random() * (size * 0.65))))) -- pick a size + local decorationDefID = decorationSizes[size][math.floor(1 + (math.random() * (#decorationSizes[size] - 0.001)))] -- pick one of 2 variants/textured baubles + uID = Spring.CreateUnit(decorationDefID, data[1], data[2], data[3], 0, teamID) if uID ~= nil then decorationCount = decorationCount + 1 - decorations[uID] = Spring.GetGameFrame() + hasDecoration[data[5]][3] + (random()*(hasDecoration[data[5]][3]*0.33)) - Spring.SetUnitRotation(uID,random()*360,random()*360,random()*360) + decorations[uID] = Spring.GetGameFrame() + hasDecoration[data[5]][3] + (random() * (hasDecoration[data[5]][3] * 0.33)) + Spring.SetUnitRotation(uID, random() * 360, random() * 360, random() * 360) local impulseMult = hasDecoration[data[5]][2] - Spring.AddUnitImpulse(uID, (random()-0.5)*(impulseMult/2), 1+(random()*impulseMult), (random()-0.5)*(impulseMult/2)) + Spring.AddUnitImpulse(uID, (random() - 0.5) * (impulseMult / 2), 1 + (random() * impulseMult), (random() - 0.5) * (impulseMult / 2)) end i = i + 1 end @@ -231,36 +230,35 @@ function gadget:GameFrame(n) for _, unitID in ipairs(createdDecorations) do if not decorations[unitID] then decorationCount = decorationCount + 1 - decorations[unitID] = Spring.GetGameFrame() + 2000 + (random()*1000) - Spring.SetUnitRotation(unitID,random()*360,random()*360,random()*360) + decorations[unitID] = Spring.GetGameFrame() + 2000 + (random() * 1000) + Spring.SetUnitRotation(unitID, random() * 360, random() * 360, random() * 360) --Spring.AddUnitImpulse(unitID, (random()-0.5)*2, 3.8+(random()*1), (random()-0.5)*2) local impulseMult = 80 - Spring.AddUnitImpulse(unitID, (random()-0.5)*(impulseMult/3), 1+(random()*(impulseMult/1.6)), (random()-0.5)*(impulseMult/3)) + Spring.AddUnitImpulse(unitID, (random() - 0.5) * (impulseMult / 3), 1 + (random() * (impulseMult / 1.6)), (random() - 0.5) * (impulseMult / 3)) end end createdDecorations = {} end - function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) if decorationUdefIDs[unitDefID] then - createdDecorations[#createdDecorations+1] = unitID + createdDecorations[#createdDecorations + 1] = unitID end end function gadget:FeatureCreated(featureID, allyTeam) -- replace comwreck with xmas comwreck if isComWreck[Spring.GetFeatureDefID(featureID)] then - local px,py,pz = Spring.GetFeaturePosition(featureID) - local rx,ry,rz = Spring.GetFeatureRotation(featureID) - local dx,dy,dz = Spring.GetFeatureDirection(featureID) + local px, py, pz = Spring.GetFeaturePosition(featureID) + local rx, ry, rz = Spring.GetFeatureRotation(featureID) + local dx, dy, dz = Spring.GetFeatureDirection(featureID) local heading = Spring.GetFeatureHeading(featureID) local teamID = Spring.GetFeatureTeam(featureID) Spring.DestroyFeature(featureID) local xmasFeatureID = Spring.CreateFeature(xmasComwreckDefID, px, py, pz, heading, teamID) if xmasFeatureID then - Spring.SetFeatureRotation(xmasFeatureID, rx,ry,rz) - Spring.SetFeatureDirection(xmasFeatureID, dx,dy,dz) + Spring.SetFeatureRotation(xmasFeatureID, rx, ry, rz) + Spring.SetFeatureDirection(xmasFeatureID, dx, dy, dz) local featureResurrect = Spring.GetFeatureResurrect(featureID) Spring.SetFeatureResurrect(xmasFeatureID, featureResurrect, "s", 0) end @@ -277,11 +275,10 @@ function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDef decorationCount = decorationCount - 1 elseif attackerID ~= nil then --and (not _G.destroyingTeam or not _G.destroyingTeam[select(6,Spring.GetTeamInfo(teamID,false))]) then -- is not reclaimed and not lastcom death chain ripple explosion if enableUnitDecorations and hasDecoration[unitDefID] ~= nil and (decorationCount < maxDecorations or hasDecoration[unitDefID][5]) then - local inProgress = Spring.GetUnitIsBeingBuilt(unitID) - if not inProgress then -- exclude incompleted nanoframes - local x,y,z = Spring.GetUnitPosition(unitID) - createDecorations[#createDecorations+1] = {x,y,z, teamID, unitDefID } + if not inProgress then -- exclude incompleted nanoframes + local x, y, z = Spring.GetUnitPosition(unitID) + createDecorations[#createDecorations + 1] = { x, y, z, teamID, unitDefID } --Spring.Echo(hasDecoration[unitDefID][1]) end end diff --git a/luarules/gadgets/unit_xp_range_bonus.lua b/luarules/gadgets/unit_xp_range_bonus.lua index f48bf5b059f..91b398384ca 100644 --- a/luarules/gadgets/unit_xp_range_bonus.lua +++ b/luarules/gadgets/unit_xp_range_bonus.lua @@ -2,22 +2,20 @@ local gadget = gadget ---@type Gadget function gadget:GetInfo() return { - name = "Unit Range XP Update", - desc = "Applies weapon range bonus when unit earns XP", - author = "BrainDamage, lonewolfdesign", - date = "", - license = "WTFPL", - layer = 0, - enabled = true + name = "Unit Range XP Update", + desc = "Applies weapon range bonus when unit earns XP", + author = "BrainDamage, lonewolfdesign", + date = "", + license = "WTFPL", + layer = 0, + enabled = true, } end - if not gadgetHandler:IsSyncedCode() then return false end - local spSetUnitWeaponState = Spring.SetUnitWeaponState local spSetUnitMaxRange = Spring.SetUnitMaxRange local unpack = unpack diff --git a/luarules/gadgets/unit_zombies.lua b/luarules/gadgets/unit_zombies.lua index ecf8ae0b48b..1ecce6c2690 100644 --- a/luarules/gadgets/unit_zombies.lua +++ b/luarules/gadgets/unit_zombies.lua @@ -1,12 +1,12 @@ function gadget:GetInfo() return { - name = "Zombies", - desc = "Resurrects corpses as Scavengers or hostile Gaia Zombies", - author = "SethDGamre, code snippets/inspiration from Rafal", - date = "March 2024", + name = "Zombies", + desc = "Resurrects corpses as Scavengers or hostile Gaia Zombies", + author = "SethDGamre, code snippets/inspiration from Rafal", + date = "March 2024", license = "GNU GPL, v2 or later", - layer = 2, -- after game_team_resources.lua - enabled = true + layer = 2, -- after game_team_resources.lua + enabled = true, } end @@ -14,137 +14,137 @@ if not gadgetHandler:IsSyncedCode() then return false end -local modOptions = Spring.GetModOptions() +local modOptions = Spring.GetModOptions() -local ZOMBIE_GUARD_RADIUS = 500 -- Radius for zombies to guard allies -local ZOMBIE_MAX_ORDER_ATTEMPTS = 10 -local ZOMBIE_MAX_ORDERS_ISSUED = 2 -local ZOMBIE_FACTORY_BUILD_COUNT = 20 -local ZOMBIE_GUARD_CHANCE = 0.75 -- Chance a zombie will guard allies -local WARNING_TIME = 15 * Game.gameSpeed -- Frames to start warning before reanimation +local ZOMBIE_GUARD_RADIUS = 500 -- Radius for zombies to guard allies +local ZOMBIE_MAX_ORDER_ATTEMPTS = 10 +local ZOMBIE_MAX_ORDERS_ISSUED = 2 +local ZOMBIE_FACTORY_BUILD_COUNT = 20 +local ZOMBIE_GUARD_CHANCE = 0.75 -- Chance a zombie will guard allies +local WARNING_TIME = 15 * Game.gameSpeed -- Frames to start warning before reanimation -local ZOMBIE_MAX_XP = 2 -- Maximum experience value for zombies, skewed towards median +local ZOMBIE_MAX_XP = 2 -- Maximum experience value for zombies, skewed towards median -local zombieModeConfigs = { +local zombieModeConfigs = { normal = { rezSpeed = 16, rezMin = 60, rezMax = 180, countMin = 1, - countMax = 1 + countMax = 1, }, hard = { rezSpeed = 24, rezMin = 30, rezMax = 90, countMin = 1, - countMax = 1 + countMax = 1, }, nightmare = { rezSpeed = 24, rezMin = 30, rezMax = 90, countMin = 2, - countMax = 5 + countMax = 5, }, extreme = { rezSpeed = 48, rezMin = 30, rezMax = 45, countMin = 4, - countMax = 10 - } + countMax = 10, + }, } -local currentZombieMode = "normal" -local currentZombieConfig = zombieModeConfigs.normal +local currentZombieMode = "normal" +local currentZombieConfig = zombieModeConfigs.normal local ZOMBIE_ORDER_CHECK_INTERVAL = Game.gameSpeed * 3 -- How often (in frames) to check if zombies need new orders -local ZOMBIE_CHECK_INTERVAL = Game.gameSpeed -- How often (in frames) everything else is checked -local STUCK_CHECK_INTERVAL = Game.gameSpeed * 12 -- How often (in frames) to check if zombies are stuck - -local STUCK_DISTANCE = 50 -- How far (in units) a zombie can move before being considered stuck -local MAX_NOGO_ZONES = 10 -- How many no-go zones a zombie can have before being considered stuck -local NOGO_ZONE_RADIUS = 600 -- How far (in units) a no-go zone is -local ENEMY_ATTACK_DISTANCE = 1000 -- How far (in units) a zombie will detect and choose to attack an enemy -local ORDER_DISTANCE = 800 -- How far (in units) a zombie moves per order - -local CMD_REPEAT = CMD.REPEAT -local CMD_MOVE_STATE = CMD.MOVE_STATE -local CMD_GUARD = CMD.GUARD -local CMD_FIRE_STATE = CMD.FIRE_STATE -local CMD_MOVE = CMD.MOVE -local CMD_RECLAIM = CMD.RECLAIM -local CMD_FIGHT = CMD.FIGHT -local CMD_OPT_SHIFT = {"shift"} - -local FIRE_STATE_FIRE_AT_ALL = 3 -local FIRE_STATE_RETURN_FIRE = 1 -local MOVE_STATE_HOLD_POSITION = 0 -local ENABLE_REPEAT = 1 -local NULL_ATTACKER = -1 -local ENVIRONMENTAL_DAMAGE_ID = Game.envDamageTypes.GroundCollision -local UNAUTHORIZED_TEXT = "You are not authorized to use zombie commands" --i18n library doesn't exist in gadget space. - -local MAP_SIZE_X = Game.mapSizeX -local MAP_SIZE_Z = Game.mapSizeZ - -local spGetUnitRotation = Spring.GetUnitRotation -local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy -local spValidUnitID = Spring.ValidUnitID -local spGetGroundHeight = Spring.GetGroundHeight -local spGetUnitPosition = Spring.GetUnitPosition -local spGetFeaturePosition = Spring.GetFeaturePosition -local spCreateUnit = Spring.CreateUnit -local spTransferUnit = Spring.TransferUnit -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitTeam = Spring.GetUnitTeam -local spGetAllUnits = Spring.GetAllUnits -local spGetGameFrame = Spring.GetGameFrame -local spGetAllFeatures = Spring.GetAllFeatures -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spGetUnitCommandCount = Spring.GetUnitCommandCount -local spDestroyFeature = Spring.DestroyFeature -local spGetUnitIsDead = Spring.GetUnitIsDead -local spGiveOrderArrayToUnit = Spring.GiveOrderArrayToUnit -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spSetTeamResource = Spring.SetTeamResource -local spGetUnitHealth = Spring.GetUnitHealth -local spSetUnitHealth = Spring.SetUnitHealth -local spSetUnitRulesParam = Spring.SetUnitRulesParam -local spGetUnitRulesParam = Spring.GetUnitRulesParam -local spGetFeatureDefID = Spring.GetFeatureDefID -local spTestMoveOrder = Spring.TestMoveOrder -local spSpawnCEG = Spring.SpawnCEG -local spGetFeatureResources = Spring.GetFeatureResources -local spGetFeatureHealth = Spring.GetFeatureHealth -local spDestroyUnit = Spring.DestroyUnit -local spGetUnitDirection = Spring.GetUnitDirection -local spCreateFeature = Spring.CreateFeature -local spSpawnExplosion = Spring.SpawnExplosion -local spPlaySoundFile = Spring.PlaySoundFile -local spGetFeatureRadius = Spring.GetFeatureRadius -local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand -local spSetUnitExperience = Spring.SetUnitExperience -local spGetUnitExperience = Spring.GetUnitExperience -local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt -local spGetUnitHeight = Spring.GetUnitHeight -local random = math.random -local distance2dSquared = math.distance2dSquared -local pi = math.pi -local tau = 2 * pi -local cos = math.cos -local sin = math.sin -local floor = math.floor -local clamp = math.clamp -local ceil = math.ceil - -local teams = Spring.GetTeamList() +local ZOMBIE_CHECK_INTERVAL = Game.gameSpeed -- How often (in frames) everything else is checked +local STUCK_CHECK_INTERVAL = Game.gameSpeed * 12 -- How often (in frames) to check if zombies are stuck + +local STUCK_DISTANCE = 50 -- How far (in units) a zombie can move before being considered stuck +local MAX_NOGO_ZONES = 10 -- How many no-go zones a zombie can have before being considered stuck +local NOGO_ZONE_RADIUS = 600 -- How far (in units) a no-go zone is +local ENEMY_ATTACK_DISTANCE = 1000 -- How far (in units) a zombie will detect and choose to attack an enemy +local ORDER_DISTANCE = 800 -- How far (in units) a zombie moves per order + +local CMD_REPEAT = CMD.REPEAT +local CMD_MOVE_STATE = CMD.MOVE_STATE +local CMD_GUARD = CMD.GUARD +local CMD_FIRE_STATE = CMD.FIRE_STATE +local CMD_MOVE = CMD.MOVE +local CMD_RECLAIM = CMD.RECLAIM +local CMD_FIGHT = CMD.FIGHT +local CMD_OPT_SHIFT = { "shift" } + +local FIRE_STATE_FIRE_AT_ALL = 3 +local FIRE_STATE_RETURN_FIRE = 1 +local MOVE_STATE_HOLD_POSITION = 0 +local ENABLE_REPEAT = 1 +local NULL_ATTACKER = -1 +local ENVIRONMENTAL_DAMAGE_ID = Game.envDamageTypes.GroundCollision +local UNAUTHORIZED_TEXT = "You are not authorized to use zombie commands" --i18n library doesn't exist in gadget space. + +local MAP_SIZE_X = Game.mapSizeX +local MAP_SIZE_Z = Game.mapSizeZ + +local spGetUnitRotation = Spring.GetUnitRotation +local spGetUnitNearestEnemy = Spring.GetUnitNearestEnemy +local spValidUnitID = Spring.ValidUnitID +local spGetGroundHeight = Spring.GetGroundHeight +local spGetUnitPosition = Spring.GetUnitPosition +local spGetFeaturePosition = Spring.GetFeaturePosition +local spCreateUnit = Spring.CreateUnit +local spTransferUnit = Spring.TransferUnit +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitTeam = Spring.GetUnitTeam +local spGetAllUnits = Spring.GetAllUnits +local spGetGameFrame = Spring.GetGameFrame +local spGetAllFeatures = Spring.GetAllFeatures +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitCommandCount = Spring.GetUnitCommandCount +local spDestroyFeature = Spring.DestroyFeature +local spGetUnitIsDead = Spring.GetUnitIsDead +local spGiveOrderArrayToUnit = Spring.GiveOrderArrayToUnit +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spSetTeamResource = Spring.SetTeamResource +local spGetUnitHealth = Spring.GetUnitHealth +local spSetUnitHealth = Spring.SetUnitHealth +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spGetFeatureDefID = Spring.GetFeatureDefID +local spTestMoveOrder = Spring.TestMoveOrder +local spSpawnCEG = Spring.SpawnCEG +local spGetFeatureResources = Spring.GetFeatureResources +local spGetFeatureHealth = Spring.GetFeatureHealth +local spDestroyUnit = Spring.DestroyUnit +local spGetUnitDirection = Spring.GetUnitDirection +local spCreateFeature = Spring.CreateFeature +local spSpawnExplosion = Spring.SpawnExplosion +local spPlaySoundFile = Spring.PlaySoundFile +local spGetFeatureRadius = Spring.GetFeatureRadius +local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand +local spSetUnitExperience = Spring.SetUnitExperience +local spGetUnitExperience = Spring.GetUnitExperience +local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt +local spGetUnitHeight = Spring.GetUnitHeight +local random = math.random +local distance2dSquared = math.distance2dSquared +local pi = math.pi +local tau = 2 * pi +local cos = math.cos +local sin = math.sin +local floor = math.floor +local clamp = math.clamp +local ceil = math.ceil + +local teams = Spring.GetTeamList() local scavTeamID -local gaiaTeamID = Spring.GetGaiaTeamID() +local gaiaTeamID = Spring.GetGaiaTeamID() for _, teamID in ipairs(teams) do local teamLuaAI = Spring.GetTeamLuaAI(teamID) - if (teamLuaAI and string.find(teamLuaAI, "ScavengersAI")) then + if teamLuaAI and string.find(teamLuaAI, "ScavengersAI") then scavTeamID = teamID end end @@ -315,8 +315,7 @@ local function updateAdjustedRezSpeed() if GG.PowerLib and GG.PowerLib.HighestPlayerTeamPower and GG.PowerLib.TechGuesstimate then local highestPowerData = GG.PowerLib.HighestPlayerTeamPower() if highestPowerData and highestPowerData.power then - adjustedRezSpeed = currentZombieConfig.rezSpeed * GG.PowerLib.TechGuesstimate(highestPowerData.power) * - techGuesstimateMultiplier + adjustedRezSpeed = currentZombieConfig.rezSpeed * GG.PowerLib.TechGuesstimate(highestPowerData.power) * techGuesstimateMultiplier end end end @@ -390,7 +389,7 @@ local function issueRandomFactoryBuildOrders(unitID, unitDefID) builds[#builds + 1] = { -combatOptions[random(1, #combatOptions)], 0, 0 } end - if (#builds > 0) then + if #builds > 0 then spGiveOrderArrayToUnit(unitID, builds) end end @@ -439,8 +438,7 @@ local function updateOrders(unitID, unitDefID, closestKnownEnemy, currentCommand return end local isAlreadyGuarding = currentCommand and currentCommand == CMD_GUARD - local nearAlly = currentCommand ~= CMD_MOVE and not isAlreadyGuarding and fightingDefs[unitDefID] and - GetUnitNearestReachableAlly(unitID, unitDefID, ZOMBIE_GUARD_RADIUS) or nil + local nearAlly = currentCommand ~= CMD_MOVE and not isAlreadyGuarding and fightingDefs[unitDefID] and GetUnitNearestReachableAlly(unitID, unitDefID, ZOMBIE_GUARD_RADIUS) or nil local weaponRange = unitDefWithWeaponRanges[unitDefID] local data = zombieWatch[unitID] @@ -582,8 +580,7 @@ local function spawnZombies(featureID, unitDefID, healthReductionRatio, x, y, z) local spawnCount = 1 if extraDefs[unitDefID].isMobile then --We bias downwards because lower values are preferred, it should be uncommon to find strong zombies but still possible - spawnCount = floor((random(currentZombieConfig.countMin, currentZombieConfig.countMax) + random(currentZombieConfig.countMin, - currentZombieConfig.countMax)) / 2) --skew results towards average to produce better gameplay + spawnCount = floor((random(currentZombieConfig.countMin, currentZombieConfig.countMax) + random(currentZombieConfig.countMin, currentZombieConfig.countMax)) / 2) --skew results towards average to produce better gameplay end local size = unitDef.xsize @@ -714,7 +711,7 @@ function gadget:GameFrame(frame) end if not featureX then --feature is gone corpsesData[featureID] = nil - else --feature is still there + else --feature is still there local featureDefData = zombieCorpseDefs[corpseData.featureDefID] if corpseData.tamperedFrame then resetSpawn(featureID, corpseData, featureDefData) @@ -754,9 +751,7 @@ function gadget:GameFrame(frame) local currentCommand = spGetUnitCurrentCommand(unitID) local refreshOrders = currentCommand ~= CMD_FIGHT and random() <= REFRESH_ORDERS_CHANCE - if ordersEnabled and (refreshOrders or - (currentCommand ~= CMD_FIGHT and currentCommand ~= CMD_GUARD and - (closestKnownEnemy or not (queueSize) or (queueSize < ZOMBIE_MAX_ORDERS_ISSUED)))) then + if ordersEnabled and (refreshOrders or (currentCommand ~= CMD_FIGHT and currentCommand ~= CMD_GUARD and (closestKnownEnemy or not queueSize or (queueSize < ZOMBIE_MAX_ORDERS_ISSUED)))) then clearUnitOrders(unitID) updateOrders(unitID, unitDefID, closestKnownEnemy, currentCommand) end @@ -764,7 +759,6 @@ function gadget:GameFrame(frame) end end - if frame % STUCK_CHECK_INTERVAL == 0 then for unitID, data in pairs(zombieWatch) do if spGetUnitIsDead(unitID) or not spValidUnitID(unitID) then @@ -866,7 +860,7 @@ function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, w local defData = zombieHeapDefs[unitDefID] if defData then spDestroyUnit(unitID, false, true, attackerID) - spSpawnExplosion(unitX, unitY, unitZ, 0, 0, 0, {weaponDef = defData.explosionDefID, owner = unitID}) + spSpawnExplosion(unitX, unitY, unitZ, 0, 0, 0, { weaponDef = defData.explosionDefID, owner = unitID }) if defData.heapDefID then spCreateFeature(defData.heapDefID, unitX, unitY, unitZ) end @@ -1013,8 +1007,7 @@ local function isAuthorized(playerID) end local playername = Spring.GetPlayerInfo(playerID) local accountID = Spring.Utilities.GetAccountID(playerID) - if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or - (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then + if (_G and _G.permissions.devhelpers and (_G.permissions.devhelpers[accountID] or (playername and _G.permissions.devhelpers[playername]))) or (SYNCED and SYNCED.permissions.devhelpers and (SYNCED.permissions.devhelpers[accountID] or (playername and SYNCED.permissions.devhelpers[playername]))) then return true end return false @@ -1315,35 +1308,37 @@ function gadget:Initialize() GG.Zombies.KillAllZombies = killAllZombies GG.Zombies.ClearAllOrders = clearAllOrders GG.Zombies.SetZombieMode = setZombieMode - GG.Zombies.GetZombieMode = function() return currentZombieMode end - - gadgetHandler:AddChatAction('zombiesetallgaia', commandSetAllGaiaToZombies, "Set all Gaia units as zombies") - gadgetHandler:AddChatAction('zombiequeueallcorpses', commandQueueAllCorpsesForReanimation, "Queue all corpses for spawning") - gadgetHandler:AddChatAction('zombieautospawn', commandToggleAutoReanimation, "Enable/disable auto spawning") - gadgetHandler:AddChatAction('zombieclearspawns', commandClearZombieSpawns, "Clear all queued zombie spawns") - gadgetHandler:AddChatAction('zombiepacify', commandPacifyZombies, "Pacify/unpacify zombies") - gadgetHandler:AddChatAction('zombiesuspendorders', commandSuspendAutoOrders, "Suspend/resume zombie auto-orders") - gadgetHandler:AddChatAction('zombieaggroteam', commandAggroZombiesToTeam, "Make zombies aggro to specific team") - gadgetHandler:AddChatAction('zombieaggroally', commandAggroZombiesToAlly, "Make zombies aggro to entire ally team") - gadgetHandler:AddChatAction('zombiekillall', commandKillAllZombies, "Kill all zombies") - gadgetHandler:AddChatAction('zombieclearallorders', commandClearAllZombieOrders, "Clear allzombie orders") - gadgetHandler:AddChatAction('zombiedebug', commandToggleDebugMode, "Enable/disable debug mode") - gadgetHandler:AddChatAction('zombiemode', commandSetZombieMode, "Set zombie mode (normal/hard/nightmare/extreme)") + GG.Zombies.GetZombieMode = function() + return currentZombieMode + end + + gadgetHandler:AddChatAction("zombiesetallgaia", commandSetAllGaiaToZombies, "Set all Gaia units as zombies") + gadgetHandler:AddChatAction("zombiequeueallcorpses", commandQueueAllCorpsesForReanimation, "Queue all corpses for spawning") + gadgetHandler:AddChatAction("zombieautospawn", commandToggleAutoReanimation, "Enable/disable auto spawning") + gadgetHandler:AddChatAction("zombieclearspawns", commandClearZombieSpawns, "Clear all queued zombie spawns") + gadgetHandler:AddChatAction("zombiepacify", commandPacifyZombies, "Pacify/unpacify zombies") + gadgetHandler:AddChatAction("zombiesuspendorders", commandSuspendAutoOrders, "Suspend/resume zombie auto-orders") + gadgetHandler:AddChatAction("zombieaggroteam", commandAggroZombiesToTeam, "Make zombies aggro to specific team") + gadgetHandler:AddChatAction("zombieaggroally", commandAggroZombiesToAlly, "Make zombies aggro to entire ally team") + gadgetHandler:AddChatAction("zombiekillall", commandKillAllZombies, "Kill all zombies") + gadgetHandler:AddChatAction("zombieclearallorders", commandClearAllZombieOrders, "Clear allzombie orders") + gadgetHandler:AddChatAction("zombiedebug", commandToggleDebugMode, "Enable/disable debug mode") + gadgetHandler:AddChatAction("zombiemode", commandSetZombieMode, "Set zombie mode (normal/hard/nightmare/extreme)") end function gadget:Shutdown() - gadgetHandler:RemoveChatAction('zombiesetallgaia') - gadgetHandler:RemoveChatAction('zombiequeueallcorpses') - gadgetHandler:RemoveChatAction('zombieautospawn') - gadgetHandler:RemoveChatAction('zombieclearspawns') - gadgetHandler:RemoveChatAction('zombiepacify') - gadgetHandler:RemoveChatAction('zombiesuspendorders') - gadgetHandler:RemoveChatAction('zombieaggroteam') - gadgetHandler:RemoveChatAction('zombieaggroally') - gadgetHandler:RemoveChatAction('zombiekillall') - gadgetHandler:RemoveChatAction('zombieclearallorders') - gadgetHandler:RemoveChatAction('zombiedebug') - gadgetHandler:RemoveChatAction('zombiemode') + gadgetHandler:RemoveChatAction("zombiesetallgaia") + gadgetHandler:RemoveChatAction("zombiequeueallcorpses") + gadgetHandler:RemoveChatAction("zombieautospawn") + gadgetHandler:RemoveChatAction("zombieclearspawns") + gadgetHandler:RemoveChatAction("zombiepacify") + gadgetHandler:RemoveChatAction("zombiesuspendorders") + gadgetHandler:RemoveChatAction("zombieaggroteam") + gadgetHandler:RemoveChatAction("zombieaggroally") + gadgetHandler:RemoveChatAction("zombiekillall") + gadgetHandler:RemoveChatAction("zombieclearallorders") + gadgetHandler:RemoveChatAction("zombiedebug") + gadgetHandler:RemoveChatAction("zombiemode") end function gadget:GameStart() diff --git a/luarules/main.lua b/luarules/main.lua index 6490d9a8c33..74d096662c9 100644 --- a/luarules/main.lua +++ b/luarules/main.lua @@ -1,9 +1,12 @@ -if (select == nil) then - select = function(n,...) - local arg = arg - if (not arg) then arg = {...}; arg.n = #arg end - return arg[((n=='#') and 'n')or n] - end +if select == nil then + select = function(n, ...) + local arg = arg + if not arg then + arg = { ... } + arg.n = #arg + end + return arg[((n == "#") and "n") or n] + end end -VFS.Include(Script.GetName() .. '/gadgets.lua', nil, VFS.ZIP_ONLY) +VFS.Include(Script.GetName() .. "/gadgets.lua", nil, VFS.ZIP_ONLY) diff --git a/luarules/mission_api/actions.lua b/luarules/mission_api/actions.lua index 99a25ea6381..d659c993373 100644 --- a/luarules/mission_api/actions.lua +++ b/luarules/mission_api/actions.lua @@ -1,5 +1,5 @@ -local trackedUnits = GG['MissionAPI'].TrackedUnits -local triggers = GG['MissionAPI'].Triggers +local trackedUnits = GG["MissionAPI"].TrackedUnits +local triggers = GG["MissionAPI"].Triggers local function enableTrigger(triggerId) triggers[triggerId].settings.active = true @@ -41,4 +41,4 @@ return { SendMessage = sendMessage, SpawnUnits = spawnUnits, DespawnUnits = despawnUnits, -} \ No newline at end of file +} diff --git a/luarules/mission_api/actions_dispatcher.lua b/luarules/mission_api/actions_dispatcher.lua index 246ff84cc2b..9ff2958baa9 100644 --- a/luarules/mission_api/actions_dispatcher.lua +++ b/luarules/mission_api/actions_dispatcher.lua @@ -1,8 +1,8 @@ -local actionsSchema = VFS.Include('luarules/mission_api/actions_schema.lua') -local actionFunctions = VFS.Include('luarules/mission_api/actions.lua') +local actionsSchema = VFS.Include("luarules/mission_api/actions_schema.lua") +local actionFunctions = VFS.Include("luarules/mission_api/actions.lua") local parameterSchema = actionsSchema.Parameters -local types = GG['MissionAPI'].ActionTypes -local actions = GG['MissionAPI'].Actions +local types = GG["MissionAPI"].ActionTypes +local actions = GG["MissionAPI"].Actions local typeMapping = { [types.EnableTrigger] = actionFunctions.EnableTrigger, @@ -53,4 +53,4 @@ end return { Invoke = invoke, -} \ No newline at end of file +} diff --git a/luarules/mission_api/actions_loader.lua b/luarules/mission_api/actions_loader.lua index 173c9107f4d..fabf7c9cc8b 100644 --- a/luarules/mission_api/actions_loader.lua +++ b/luarules/mission_api/actions_loader.lua @@ -1,4 +1,4 @@ -local schema = VFS.Include('luarules/mission_api/actions_schema.lua') +local schema = VFS.Include("luarules/mission_api/actions_schema.lua") local parameters = schema.Parameters --[[ @@ -15,7 +15,7 @@ local actions = {} local function prevalidateActions() for actionId, action in pairs(actions) do if not action.type then - Spring.Log('actions_loader.lua', LOG.ERROR, "[Mission API] Action missing type: " .. actionId) + Spring.Log("actions_loader.lua", LOG.ERROR, "[Mission API] Action missing type: " .. actionId) end for _, parameter in pairs(parameters[action.type]) do @@ -23,18 +23,18 @@ local function prevalidateActions() local type = type(value) if value == nil and parameter.required then - Spring.Log('actions_loader.lua', LOG.ERROR, "[Mission API] Action missing required parameter. Action: " .. actionId .. ", Parameter: " .. parameter.name) + Spring.Log("actions_loader.lua", LOG.ERROR, "[Mission API] Action missing required parameter. Action: " .. actionId .. ", Parameter: " .. parameter.name) end if value ~= nil and type ~= parameter.type then - Spring.Log('actions_loader.lua', LOG.ERROR, "[Mission API] Unexpected parameter type, expected " .. parameter.type .. ", got " .. type .. ". Action: " .. actionId .. ", Parameter: " .. parameter.name) + Spring.Log("actions_loader.lua", LOG.ERROR, "[Mission API] Unexpected parameter type, expected " .. parameter.type .. ", got " .. type .. ". Action: " .. actionId .. ", Parameter: " .. parameter.name) end end end end local function preprocessRawActions(rawActions) - for actionId, rawAction in pairs(rawActions) do + for actionId, rawAction in pairs(rawActions) do actions[actionId] = table.copy(rawAction) end @@ -48,4 +48,4 @@ end return { GetActions = getActions, PreprocessRawActions = preprocessRawActions, -} \ No newline at end of file +} diff --git a/luarules/mission_api/actions_schema.lua b/luarules/mission_api/actions_schema.lua index 7618022e783..20ed564e8aa 100644 --- a/luarules/mission_api/actions_schema.lua +++ b/luarules/mission_api/actions_schema.lua @@ -28,92 +28,92 @@ local actionTypes = { local parameters = { [actionTypes.EnableTrigger] = { [1] = { - name = 'triggerId', + name = "triggerId", required = true, - type = 'string', + type = "string", }, - }, + }, [actionTypes.DisableTrigger] = { [1] = { - name = 'triggerId', + name = "triggerId", required = true, - type = 'string', + type = "string", }, - }, + }, - [actionTypes.IssueOrders] = { }, - [actionTypes.AllowCommands] = { }, - [actionTypes.RestrictCommands] = { }, - [actionTypes.AlterBuildlist] = { }, - [actionTypes.EnableBuildOption] = { }, - [actionTypes.DisableBuildOption] = { }, + [actionTypes.IssueOrders] = {}, + [actionTypes.AllowCommands] = {}, + [actionTypes.RestrictCommands] = {}, + [actionTypes.AlterBuildlist] = {}, + [actionTypes.EnableBuildOption] = {}, + [actionTypes.DisableBuildOption] = {}, [actionTypes.SpawnUnits] = { [1] = { - name = 'name', + name = "name", required = false, - type = 'string', + type = "string", }, [2] = { - name = 'unitDefName', + name = "unitDefName", required = true, - type = 'string', + type = "string", }, [3] = { - name = 'quantity', + name = "quantity", required = false, - type = 'number', + type = "number", }, [4] = { - name = 'x', + name = "x", required = true, - type = 'number', + type = "number", }, [5] = { - name = 'y', + name = "y", required = false, - type = 'number', + type = "number", }, [6] = { - name = 'z', + name = "z", required = true, - type = 'number', + type = "number", }, }, - [actionTypes.SpawnConstruction] = { }, + [actionTypes.SpawnConstruction] = {}, [actionTypes.DespawnUnits] = { [1] = { - name = 'name', + name = "name", required = true, - type = 'string', + type = "string", }, - }, - [actionTypes.SpawnWeapons] = { }, - [actionTypes.SpawnEffects] = { }, - [actionTypes.RevealLOS] = { }, - [actionTypes.UnrevealLOS] = { }, - [actionTypes.AlterMapZones] = { }, - [actionTypes.TransferUnits] = { }, - [actionTypes.ControlCamera] = { }, - [actionTypes.Pause] = { }, - [actionTypes.Unpause] = { }, - [actionTypes.PlayMedia] = { }, + }, + [actionTypes.SpawnWeapons] = {}, + [actionTypes.SpawnEffects] = {}, + [actionTypes.RevealLOS] = {}, + [actionTypes.UnrevealLOS] = {}, + [actionTypes.AlterMapZones] = {}, + [actionTypes.TransferUnits] = {}, + [actionTypes.ControlCamera] = {}, + [actionTypes.Pause] = {}, + [actionTypes.Unpause] = {}, + [actionTypes.PlayMedia] = {}, [actionTypes.SendMessage] = { [1] = { - name = 'message', + name = "message", required = true, - type = 'string', - } + type = "string", + }, }, - [actionTypes.Victory] = { }, - [actionTypes.Defeat] = { }, + [actionTypes.Victory] = {}, + [actionTypes.Defeat] = {}, } return { Types = actionTypes, - Parameters = parameters -} \ No newline at end of file + Parameters = parameters, +} diff --git a/luarules/mission_api/triggers_loader.lua b/luarules/mission_api/triggers_loader.lua index 1ac6d187122..cbbdf17f024 100644 --- a/luarules/mission_api/triggers_loader.lua +++ b/luarules/mission_api/triggers_loader.lua @@ -1,4 +1,4 @@ -local schema = VFS.Include('luarules/mission_api/triggers_schema.lua') +local schema = VFS.Include("luarules/mission_api/triggers_schema.lua") local parameters = schema.Parameters --[[ @@ -25,11 +25,11 @@ local triggers = {} local function prevalidateTriggers() for triggerId, trigger in pairs(triggers) do if not trigger.type then - Spring.Log('triggers_loader.lua', LOG.ERROR, "[Mission API] Trigger missing type: " .. triggerId) + Spring.Log("triggers_loader.lua", LOG.ERROR, "[Mission API] Trigger missing type: " .. triggerId) end if not trigger.actions or next(trigger.actions) == nil then - Spring.Log('triggers_loader.lua', LOG.ERROR, "[Mission API] Trigger has no actions: " .. triggerId) + Spring.Log("triggers_loader.lua", LOG.ERROR, "[Mission API] Trigger has no actions: " .. triggerId) end for _, parameter in pairs(parameters[trigger.type]) do @@ -37,11 +37,11 @@ local function prevalidateTriggers() local type = type(value) if value == nil and parameter.required then - Spring.Log('triggers_loader.lua', LOG.ERROR, "[Mission API] Trigger missing required parameter. Trigger: " .. triggerId .. ", Parameter: " .. parameter.name) + Spring.Log("triggers_loader.lua", LOG.ERROR, "[Mission API] Trigger missing required parameter. Trigger: " .. triggerId .. ", Parameter: " .. parameter.name) end if value ~= nil and type ~= parameter.type then - Spring.Log('triggers_loader.lua', LOG.ERROR, "[Mission API] Unexpected parameter type, expected " .. parameter.type .. ", got " .. type .. ". Trigger: " .. triggerId .. ", Parameter: " .. parameter.name) + Spring.Log("triggers_loader.lua", LOG.ERROR, "[Mission API] Unexpected parameter type, expected " .. parameter.type .. ", got " .. type .. ". Trigger: " .. triggerId .. ", Parameter: " .. parameter.name) end end end @@ -68,11 +68,11 @@ local function preprocessRawTriggers(rawTriggers) end local function postvalidateTriggers() - local actions = GG['MissionAPI'].Actions + local actions = GG["MissionAPI"].Actions for triggerId, trigger in pairs(triggers) do for _, actionId in pairs(trigger.actions) do if not actions[actionId] then - Spring.Log('triggers_loader.lua', LOG.ERROR, "[Mission API] Trigger has action that does not exist. Trigger: " .. triggerId .. ", Action: " .. actionId) + Spring.Log("triggers_loader.lua", LOG.ERROR, "[Mission API] Trigger has action that does not exist. Trigger: " .. triggerId .. ", Action: " .. actionId) end end end diff --git a/luarules/mission_api/triggers_schema.lua b/luarules/mission_api/triggers_schema.lua index 092922a310a..8f171fab967 100644 --- a/luarules/mission_api/triggers_schema.lua +++ b/luarules/mission_api/triggers_schema.lua @@ -29,43 +29,43 @@ local triggerTypes = { local parameters = { [triggerTypes.TimeElapsed] = { [1] = { - name = 'gameFrame', + name = "gameFrame", required = true, - type = 'number', + type = "number", }, [2] = { - name = 'interval', + name = "interval", required = false, - type = 'number' + type = "number", }, }, - [triggerTypes.UnitExists] = { }, - [triggerTypes.UnitNotExists] = { }, - [triggerTypes.ConstructionStarted] = { }, - [triggerTypes.ConstructionFinished] = { }, - [triggerTypes.UnitKilled] = { }, - [triggerTypes.UnitCaptured] = { }, - [triggerTypes.UnitResurrected] = { }, - [triggerTypes.UnitEnteredLocation] = { }, - [triggerTypes.UnitLeftLocation] = { }, - [triggerTypes.UnitDwellLocation] = { }, - [triggerTypes.UnitSpotted] = { }, - [triggerTypes.UnitUnspotted] = { }, - [triggerTypes.FeatureNotExists] = { }, - [triggerTypes.FeatureReclaimed] = { }, - [triggerTypes.FeatureDestroyed] = { }, - [triggerTypes.ResourceStored] = { }, - [triggerTypes.ResourceProduction] = { }, - [triggerTypes.TotalUnitsLost] = { }, - [triggerTypes.TotalUnitsBuilt] = { }, - [triggerTypes.TotalUnitsKilled] = { }, - [triggerTypes.TotalUnitsCaptured] = { }, - [triggerTypes.TeamDestroyed] = { }, - [triggerTypes.Victory] = { }, - [triggerTypes.Defeat] = { }, + [triggerTypes.UnitExists] = {}, + [triggerTypes.UnitNotExists] = {}, + [triggerTypes.ConstructionStarted] = {}, + [triggerTypes.ConstructionFinished] = {}, + [triggerTypes.UnitKilled] = {}, + [triggerTypes.UnitCaptured] = {}, + [triggerTypes.UnitResurrected] = {}, + [triggerTypes.UnitEnteredLocation] = {}, + [triggerTypes.UnitLeftLocation] = {}, + [triggerTypes.UnitDwellLocation] = {}, + [triggerTypes.UnitSpotted] = {}, + [triggerTypes.UnitUnspotted] = {}, + [triggerTypes.FeatureNotExists] = {}, + [triggerTypes.FeatureReclaimed] = {}, + [triggerTypes.FeatureDestroyed] = {}, + [triggerTypes.ResourceStored] = {}, + [triggerTypes.ResourceProduction] = {}, + [triggerTypes.TotalUnitsLost] = {}, + [triggerTypes.TotalUnitsBuilt] = {}, + [triggerTypes.TotalUnitsKilled] = {}, + [triggerTypes.TotalUnitsCaptured] = {}, + [triggerTypes.TeamDestroyed] = {}, + [triggerTypes.Victory] = {}, + [triggerTypes.Defeat] = {}, } return { Types = triggerTypes, Parameters = parameters, -} \ No newline at end of file +} diff --git a/luarules/system.lua b/luarules/system.lua index 9fc498fb312..cac735976f2 100644 --- a/luarules/system.lua +++ b/luarules/system.lua @@ -10,18 +10,30 @@ -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (System == nil) then +if System == nil then if tracy == nil then Spring.Echo("Gadgetside tracy: No support detected, replacing tracy.* with function stubs.") tracy = {} - tracy.ZoneBeginN = function () return end - tracy.ZoneBegin = function () return end - tracy.ZoneEnd = function () return end --Spring.Echo("No Tracy") return end - tracy.Message = function () return end - tracy.ZoneName = function () return end - tracy.ZoneText = function () return end + tracy.ZoneBeginN = function() + return + end + tracy.ZoneBegin = function() + return + end + tracy.ZoneEnd = function() + return + end --Spring.Echo("No Tracy") return end + tracy.Message = function() + return + end + tracy.ZoneName = function() + return + end + tracy.ZoneText = function() + return + end end - + System = { -- -- Custom Spring tables @@ -41,12 +53,12 @@ if (System == nil) then VFS = VFS, LOG = LOG, - UnitDefs = UnitDefs, - UnitDefNames = UnitDefNames, - FeatureDefs = FeatureDefs, + UnitDefs = UnitDefs, + UnitDefNames = UnitDefNames, + FeatureDefs = FeatureDefs, FeatureDefNames = FeatureDefNames, - WeaponDefs = WeaponDefs, - WeaponDefNames = WeaponDefNames, + WeaponDefs = WeaponDefs, + WeaponDefNames = WeaponDefNames, -- -- Custom Constants @@ -62,9 +74,9 @@ if (System == nil) then -- -- Unsynced Utilities -- - SYNCED = SYNCED, - snext = next, -- the following 3 are deprecated, but defined in case any legacy code uses them - spairs = pairs, + SYNCED = SYNCED, + snext = next, -- the following 3 are deprecated, but defined in case any legacy code uses them + spairs = pairs, sipairs = ipairs, -- @@ -88,44 +100,44 @@ if (System == nil) then -- -- Standard functions and variables -- - assert = assert, - error = error, + assert = assert, + error = error, - print = print, + print = print, - next = next, - pairs = pairs, - pairsByKeys = pairsByKeys, -- custom: defined in `common\tablefunctions.lua` - ipairs = ipairs, + next = next, + pairs = pairs, + pairsByKeys = pairsByKeys, -- custom: defined in `common\tablefunctions.lua` + ipairs = ipairs, - tonumber = tonumber, - tostring = tostring, - type = type, + tonumber = tonumber, + tostring = tostring, + type = type, collectgarbage = collectgarbage, - gcinfo = gcinfo, + gcinfo = gcinfo, - unpack = unpack, - select = select, - dofile = dofile, - loadfile = loadfile, - loadlib = loadlib, - loadstring = loadstring, - require = require, + unpack = unpack, + select = select, + dofile = dofile, + loadfile = loadfile, + loadlib = loadlib, + loadstring = loadstring, + require = require, - getmetatable = getmetatable, - setmetatable = setmetatable, + getmetatable = getmetatable, + setmetatable = setmetatable, - rawequal = rawequal, - rawget = rawget, - rawset = rawset, + rawequal = rawequal, + rawget = rawget, + rawset = rawset, - getfenv = getfenv, - setfenv = setfenv, + getfenv = getfenv, + setfenv = setfenv, - pcall = pcall, - xpcall = xpcall, + pcall = pcall, + xpcall = xpcall, - _VERSION = _VERSION + _VERSION = _VERSION, } end diff --git a/luarules/utilities.lua b/luarules/utilities.lua index 64026f82d0b..7043da2dc45 100644 --- a/luarules/utilities.lua +++ b/luarules/utilities.lua @@ -4,10 +4,10 @@ -- -- Load utility files whose functionality is applicable to gadgets ONLY -- Utility files with global functionality should go in /common/Utilities/ --- +-- ------------------------------------------------------------------------------------- -local utilitiesFiles = VFS.DirList('luarules/Utilities/', "*.lua") +local utilitiesFiles = VFS.DirList("luarules/Utilities/", "*.lua") for i = 1, #utilitiesFiles do - VFS.Include(utilitiesFiles[i]) -end \ No newline at end of file + VFS.Include(utilitiesFiles[i]) +end diff --git a/luaui.lua b/luaui.lua index d5dbbddef30..49c536e681c 100644 --- a/luaui.lua +++ b/luaui.lua @@ -12,25 +12,23 @@ -------------------------------------------------------------------------------- LUAUI_VERSION = "LuaUI v0.3" -LUAUI_DIRNAME = 'LuaUI/' +LUAUI_DIRNAME = "LuaUI/" VFS.DEF_MODE = VFS.RAW_FIRST -local STARTUP_FILENAME = LUAUI_DIRNAME .. 'main.lua' - +local STARTUP_FILENAME = LUAUI_DIRNAME .. "main.lua" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- do - -- use a versionned directory name if it exists - local sansslash = string.sub(LUAUI_DIRNAME, 1, -2) - local versiondir = sansslash .. '-' .. ((Game and Game.version) or (Engine and Engine.version) or "Engine version error") .. '/' - if (VFS.FileExists(versiondir .. 'main.lua', VFS.ZIP)) then - LUAUI_DIRNAME = versiondir - end + -- use a versionned directory name if it exists + local sansslash = string.sub(LUAUI_DIRNAME, 1, -2) + local versiondir = sansslash .. "-" .. ((Game and Game.version) or (Engine and Engine.version) or "Engine version error") .. "/" + if VFS.FileExists(versiondir .. "main.lua", VFS.ZIP) then + LUAUI_DIRNAME = versiondir + end end -Spring.Echo('Using LUAUI_DIRNAME = ' .. LUAUI_DIRNAME) - +Spring.Echo("Using LUAUI_DIRNAME = " .. LUAUI_DIRNAME) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -39,19 +37,18 @@ Spring.Echo('Using LUAUI_DIRNAME = ' .. LUAUI_DIRNAME) -- do - local text = VFS.LoadFile(STARTUP_FILENAME, VFS.ZIP) - if (text == nil) then - Script.Kill('Failed to load ' .. STARTUP_FILENAME) - end - local chunk, err = loadstring(text) - if (chunk == nil) then - Script.Kill('Failed to load ' .. STARTUP_FILENAME .. ' (' .. err .. ')') - else - chunk() - return - end + local text = VFS.LoadFile(STARTUP_FILENAME, VFS.ZIP) + if text == nil then + Script.Kill("Failed to load " .. STARTUP_FILENAME) + end + local chunk, err = loadstring(text) + if chunk == nil then + Script.Kill("Failed to load " .. STARTUP_FILENAME .. " (" .. err .. ")") + else + chunk() + return + end end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/luaui/Headers/colors.h.lua b/luaui/Headers/colors.h.lua index 9c368cc8892..9f631fb9b0d 100644 --- a/luaui/Headers/colors.h.lua +++ b/luaui/Headers/colors.h.lua @@ -11,24 +11,24 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -WhiteStr = "\255\255\255\255" -BlackStr = "\255\001\001\001" -GreyStr = "\255\128\128\128" -RedStr = "\255\255\001\001" -PinkStr = "\255\255\064\064" -GreenStr = "\255\001\255\001" -BlueStr = "\255\001\001\255" -CyanStr = "\255\001\255\255" -YellowStr = "\255\255\255\001" +WhiteStr = "\255\255\255\255" +BlackStr = "\255\001\001\001" +GreyStr = "\255\128\128\128" +RedStr = "\255\255\001\001" +PinkStr = "\255\255\064\064" +GreenStr = "\255\001\255\001" +BlueStr = "\255\001\001\255" +CyanStr = "\255\001\255\255" +YellowStr = "\255\255\255\001" MagentaStr = "\255\255\001\255" Colors = {} -Colors.white = { 1.0, 1.0, 1.0, 1.0 } -Colors.black = { 0.0, 0.0, 0.0, 1.0 } -Colors.grey = { 0.5, 0.5, 0.5, 1.0 } -Colors.red = { 1.0, 0.0, 0.0, 1.0 } -Colors.green = { 0.0, 1.0, 0.0, 1.0 } -Colors.blue = { 0.0, 0.0, 1.0, 1.0 } -Colors.yellow = { 1.0, 1.0, 0.0, 1.0 } -Colors.cyan = { 0.0, 1.0, 1.0, 1.0 } +Colors.white = { 1.0, 1.0, 1.0, 1.0 } +Colors.black = { 0.0, 0.0, 0.0, 1.0 } +Colors.grey = { 0.5, 0.5, 0.5, 1.0 } +Colors.red = { 1.0, 0.0, 0.0, 1.0 } +Colors.green = { 0.0, 1.0, 0.0, 1.0 } +Colors.blue = { 0.0, 0.0, 1.0, 1.0 } +Colors.yellow = { 1.0, 1.0, 0.0, 1.0 } +Colors.cyan = { 0.0, 1.0, 1.0, 1.0 } Colors.magenta = { 1.0, 0.0, 1.0, 1.0 } diff --git a/luaui/Headers/keysym.h.lua b/luaui/Headers/keysym.h.lua index 3c58a6c7de7..4f6593c2c32 100644 --- a/luaui/Headers/keysym.h.lua +++ b/luaui/Headers/keysym.h.lua @@ -15,261 +15,261 @@ KEYSYMS = { - UNKNOWN = 0, - FIRST = 0, - BACKSPACE = 8, - TAB = 9, - CLEAR = 12, - RETURN = 13, - PAUSE = 19, - ESCAPE = 27, - SPACE = 32, - EXCLAIM = 33, - QUOTEDBL = 34, - HASH = 35, - DOLLAR = 36, - AMPERSAND = 38, - QUOTE = 39, - LEFTPAREN = 40, - RIGHTPAREN = 41, - ASTERISK = 42, - PLUS = 43, - COMMA = 44, - MINUS = 45, - PERIOD = 46, - SLASH = 47, + UNKNOWN = 0, + FIRST = 0, + BACKSPACE = 8, + TAB = 9, + CLEAR = 12, + RETURN = 13, + PAUSE = 19, + ESCAPE = 27, + SPACE = 32, + EXCLAIM = 33, + QUOTEDBL = 34, + HASH = 35, + DOLLAR = 36, + AMPERSAND = 38, + QUOTE = 39, + LEFTPAREN = 40, + RIGHTPAREN = 41, + ASTERISK = 42, + PLUS = 43, + COMMA = 44, + MINUS = 45, + PERIOD = 46, + SLASH = 47, - -- '0' to '9' - N_0 = 48, - N_1 = 49, - N_2 = 50, - N_3 = 51, - N_4 = 52, - N_5 = 53, - N_6 = 54, - N_7 = 55, - N_8 = 56, - N_9 = 57, + -- '0' to '9' + N_0 = 48, + N_1 = 49, + N_2 = 50, + N_3 = 51, + N_4 = 52, + N_5 = 53, + N_6 = 54, + N_7 = 55, + N_8 = 56, + N_9 = 57, - COLON = 58, - SEMICOLON = 59, - LESS = 60, - EQUALS = 61, - GREATER = 62, - QUESTION = 63, - AT = 64, + COLON = 58, + SEMICOLON = 59, + LESS = 60, + EQUALS = 61, + GREATER = 62, + QUESTION = 63, + AT = 64, - -- - -- Skip uppercase letters - -- + -- + -- Skip uppercase letters + -- - LEFTBRACKET = 91, - BACKSLASH = 92, - RIGHTBRACKET = 93, - CARET = 94, - UNDERSCORE = 95, - BACKQUOTE = 96, - A = 97, -- actually 'a' ascii - B = 98, - C = 99, - D = 100, - E = 101, - F = 102, - G = 103, - H = 104, - I = 105, - J = 106, - K = 107, - L = 108, - M = 109, - N = 110, - O = 111, - P = 112, - Q = 113, - R = 114, - S = 115, - T = 116, - U = 117, - V = 118, - W = 119, - X = 120, - Y = 121, - Z = 122, - DELETE = 127, - -- End of ASCII mapped keysyms + LEFTBRACKET = 91, + BACKSLASH = 92, + RIGHTBRACKET = 93, + CARET = 94, + UNDERSCORE = 95, + BACKQUOTE = 96, + A = 97, -- actually 'a' ascii + B = 98, + C = 99, + D = 100, + E = 101, + F = 102, + G = 103, + H = 104, + I = 105, + J = 106, + K = 107, + L = 108, + M = 109, + N = 110, + O = 111, + P = 112, + Q = 113, + R = 114, + S = 115, + T = 116, + U = 117, + V = 118, + W = 119, + X = 120, + Y = 121, + Z = 122, + DELETE = 127, + -- End of ASCII mapped keysyms - -- International keyboard syms - WORLD_0 = 160, -- 0xA0 - WORLD_1 = 161, - WORLD_2 = 162, - WORLD_3 = 163, - WORLD_4 = 164, - WORLD_5 = 165, - WORLD_6 = 166, - WORLD_7 = 167, - WORLD_8 = 168, - WORLD_9 = 169, - WORLD_10 = 170, - WORLD_11 = 171, - WORLD_12 = 172, - WORLD_13 = 173, - WORLD_14 = 174, - WORLD_15 = 175, - WORLD_16 = 176, - WORLD_17 = 177, - WORLD_18 = 178, - WORLD_19 = 179, - WORLD_20 = 180, - WORLD_21 = 181, - WORLD_22 = 182, - WORLD_23 = 183, - WORLD_24 = 184, - WORLD_25 = 185, - WORLD_26 = 186, - WORLD_27 = 187, - WORLD_28 = 188, - WORLD_29 = 189, - WORLD_30 = 190, - WORLD_31 = 191, - WORLD_32 = 192, - WORLD_33 = 193, - WORLD_34 = 194, - WORLD_35 = 195, - WORLD_36 = 196, - WORLD_37 = 197, - WORLD_38 = 198, - WORLD_39 = 199, - WORLD_40 = 200, - WORLD_41 = 201, - WORLD_42 = 202, - WORLD_43 = 203, - WORLD_44 = 204, - WORLD_45 = 205, - WORLD_46 = 206, - WORLD_47 = 207, - WORLD_48 = 208, - WORLD_49 = 209, - WORLD_50 = 210, - WORLD_51 = 211, - WORLD_52 = 212, - WORLD_53 = 213, - WORLD_54 = 214, - WORLD_55 = 215, - WORLD_56 = 216, - WORLD_57 = 217, - WORLD_58 = 218, - WORLD_59 = 219, - WORLD_60 = 220, - WORLD_61 = 221, - WORLD_62 = 222, - WORLD_63 = 223, - WORLD_64 = 224, - WORLD_65 = 225, - WORLD_66 = 226, - WORLD_67 = 227, - WORLD_68 = 228, - WORLD_69 = 229, - WORLD_70 = 230, - WORLD_71 = 231, - WORLD_72 = 232, - WORLD_73 = 233, - WORLD_74 = 234, - WORLD_75 = 235, - WORLD_76 = 236, - WORLD_77 = 237, - WORLD_78 = 238, - WORLD_79 = 239, - WORLD_80 = 240, - WORLD_81 = 241, - WORLD_82 = 242, - WORLD_83 = 243, - WORLD_84 = 244, - WORLD_85 = 245, - WORLD_86 = 246, - WORLD_87 = 247, - WORLD_88 = 248, - WORLD_89 = 249, - WORLD_90 = 250, - WORLD_91 = 251, - WORLD_92 = 252, - WORLD_93 = 253, - WORLD_94 = 254, - WORLD_95 = 255, -- 0xFF + -- International keyboard syms + WORLD_0 = 160, -- 0xA0 + WORLD_1 = 161, + WORLD_2 = 162, + WORLD_3 = 163, + WORLD_4 = 164, + WORLD_5 = 165, + WORLD_6 = 166, + WORLD_7 = 167, + WORLD_8 = 168, + WORLD_9 = 169, + WORLD_10 = 170, + WORLD_11 = 171, + WORLD_12 = 172, + WORLD_13 = 173, + WORLD_14 = 174, + WORLD_15 = 175, + WORLD_16 = 176, + WORLD_17 = 177, + WORLD_18 = 178, + WORLD_19 = 179, + WORLD_20 = 180, + WORLD_21 = 181, + WORLD_22 = 182, + WORLD_23 = 183, + WORLD_24 = 184, + WORLD_25 = 185, + WORLD_26 = 186, + WORLD_27 = 187, + WORLD_28 = 188, + WORLD_29 = 189, + WORLD_30 = 190, + WORLD_31 = 191, + WORLD_32 = 192, + WORLD_33 = 193, + WORLD_34 = 194, + WORLD_35 = 195, + WORLD_36 = 196, + WORLD_37 = 197, + WORLD_38 = 198, + WORLD_39 = 199, + WORLD_40 = 200, + WORLD_41 = 201, + WORLD_42 = 202, + WORLD_43 = 203, + WORLD_44 = 204, + WORLD_45 = 205, + WORLD_46 = 206, + WORLD_47 = 207, + WORLD_48 = 208, + WORLD_49 = 209, + WORLD_50 = 210, + WORLD_51 = 211, + WORLD_52 = 212, + WORLD_53 = 213, + WORLD_54 = 214, + WORLD_55 = 215, + WORLD_56 = 216, + WORLD_57 = 217, + WORLD_58 = 218, + WORLD_59 = 219, + WORLD_60 = 220, + WORLD_61 = 221, + WORLD_62 = 222, + WORLD_63 = 223, + WORLD_64 = 224, + WORLD_65 = 225, + WORLD_66 = 226, + WORLD_67 = 227, + WORLD_68 = 228, + WORLD_69 = 229, + WORLD_70 = 230, + WORLD_71 = 231, + WORLD_72 = 232, + WORLD_73 = 233, + WORLD_74 = 234, + WORLD_75 = 235, + WORLD_76 = 236, + WORLD_77 = 237, + WORLD_78 = 238, + WORLD_79 = 239, + WORLD_80 = 240, + WORLD_81 = 241, + WORLD_82 = 242, + WORLD_83 = 243, + WORLD_84 = 244, + WORLD_85 = 245, + WORLD_86 = 246, + WORLD_87 = 247, + WORLD_88 = 248, + WORLD_89 = 249, + WORLD_90 = 250, + WORLD_91 = 251, + WORLD_92 = 252, + WORLD_93 = 253, + WORLD_94 = 254, + WORLD_95 = 255, -- 0xFF - -- Numeric keypad - KP0 = 256, - KP1 = 257, - KP2 = 258, - KP3 = 259, - KP4 = 260, - KP5 = 261, - KP6 = 262, - KP7 = 263, - KP8 = 264, - KP9 = 265, - KP_PERIOD = 266, - KP_DIVIDE = 267, - KP_MULTIPLY = 268, - KP_MINUS = 269, - KP_PLUS = 270, - KP_ENTER = 271, - KP_EQUALS = 272, + -- Numeric keypad + KP0 = 256, + KP1 = 257, + KP2 = 258, + KP3 = 259, + KP4 = 260, + KP5 = 261, + KP6 = 262, + KP7 = 263, + KP8 = 264, + KP9 = 265, + KP_PERIOD = 266, + KP_DIVIDE = 267, + KP_MULTIPLY = 268, + KP_MINUS = 269, + KP_PLUS = 270, + KP_ENTER = 271, + KP_EQUALS = 272, - -- Arrows + Home/End pad - UP = 273, - DOWN = 274, - RIGHT = 275, - LEFT = 276, - INSERT = 277, - HOME = 278, - END = 279, - PAGEUP = 280, - PAGEDOWN = 281, + -- Arrows + Home/End pad + UP = 273, + DOWN = 274, + RIGHT = 275, + LEFT = 276, + INSERT = 277, + HOME = 278, + END = 279, + PAGEUP = 280, + PAGEDOWN = 281, - -- Function keys - F1 = 282, - F2 = 283, - F3 = 284, - F4 = 285, - F5 = 286, - F6 = 287, - F7 = 288, - F8 = 289, - F9 = 290, - F10 = 291, - F11 = 292, - F12 = 293, - F13 = 294, - F14 = 295, - F15 = 296, + -- Function keys + F1 = 282, + F2 = 283, + F3 = 284, + F4 = 285, + F5 = 286, + F6 = 287, + F7 = 288, + F8 = 289, + F9 = 290, + F10 = 291, + F11 = 292, + F12 = 293, + F13 = 294, + F14 = 295, + F15 = 296, - -- Key state modifier keys - NUMLOCK = 300, - CAPSLOCK = 301, - SCROLLOCK = 302, - RSHIFT = 303, - LSHIFT = 304, - RCTRL = 305, - LCTRL = 306, - RALT = 307, - LALT = 308, - RMETA = 309, - LMETA = 310, - LSUPER = 311, -- Left "Windows" key - RSUPER = 312, -- Right "Windows" key - MODE = 313, -- "Alt Gr" key - COMPOSE = 314, -- Multi-key compose key + -- Key state modifier keys + NUMLOCK = 300, + CAPSLOCK = 301, + SCROLLOCK = 302, + RSHIFT = 303, + LSHIFT = 304, + RCTRL = 305, + LCTRL = 306, + RALT = 307, + LALT = 308, + RMETA = 309, + LMETA = 310, + LSUPER = 311, -- Left "Windows" key + RSUPER = 312, -- Right "Windows" key + MODE = 313, -- "Alt Gr" key + COMPOSE = 314, -- Multi-key compose key - -- Miscellaneous function keys - HELP = 315, - PRINT = 316, - SYSREQ = 317, - BREAK = 318, - MENU = 319, - POWER = 320, -- Power Macintosh power key - EURO = 321, -- Some european keyboards - UNDO = 322, -- Atari keyboard has Undo + -- Miscellaneous function keys + HELP = 315, + PRINT = 316, + SYSREQ = 317, + BREAK = 318, + MENU = 319, + POWER = 320, -- Power Macintosh power key + EURO = 321, -- Some european keyboards + UNDO = 322, -- Atari keyboard has Undo - -- Add any other keys here - LAST = 323 + -- Add any other keys here + LAST = 323, } diff --git a/luaui/Include/AtlasOnDemand.lua b/luaui/Include/AtlasOnDemand.lua index 534d5ee7a0f..2802e5b6ab5 100644 --- a/luaui/Include/AtlasOnDemand.lua +++ b/luaui/Include/AtlasOnDemand.lua @@ -38,10 +38,10 @@ end local function widget:Shutdown() myAtlas:Delete() end -]]-- +]] +-- ---------------------------------------------------- - -- AtlasOnDemand class -- Size in the total size of the texture -- Resolution is the size of the splits (e.g. 128 size 'patches' @@ -65,26 +65,27 @@ end -- Add a return value for fonts that show the descender line, to consistently be able to position fontses // https://springrts.com/wiki/GetTextHeight -- Handle text Ascender too! - -- QuadTreePrototype: - -- Not always square! - -- Always split on power of two - +-- Not always square! +-- Always split on power of two -- UNIT TESTING: local UNITTEST = false if not Spring then UNITTEST = true Spring = { - Echo = function(s) print(s) end, + Echo = function(s) + print(s) + end, } gl = { - CreateTexture = function() return 0 end + CreateTexture = function() + return 0 + end, } GL = {} end - --- Create a new texture atlas for any image/text type -- The atlas is a regularly spaced grid, and items will occupy at least 1 cell of the grid -- You can queue any item to be added at any time, but they will only be finalized to atlas when told to do so @@ -108,7 +109,6 @@ local function MakeAtlasOnDemand(config) config.yresolution = config.yresolution or config.resolution or 128 config.name = config.name or "Unnamed Atlas" - --------------------------------- Below is the unfinished quadtree split implementation --------------------------- --[[ local QuadTreeNode = {} @@ -168,7 +168,8 @@ local function MakeAtlasOnDemand(config) end QuadTreeNode.metatable = QuadTreePrototype - ]]-- + ]] + -- --------------------------------- ABOVE is the unfinished quadtree split implementation --------------------------- local AtlasOnDemand = { @@ -177,8 +178,8 @@ local function MakeAtlasOnDemand(config) ysize = config.sizey, xresolution = config.xresolution, yresolution = config.yresolution, - xslots = config.sizex/config.xresolution, - yslots = config.sizey/config.yresolution, + xslots = config.sizex / config.xresolution, + yslots = config.sizey / config.yresolution, textureID = nil, fill = {}, -- double array of bools indicated used = true status uvcoords = {}, -- maps imgpath to padded UV set, in xXyY format @@ -186,14 +187,14 @@ local function MakeAtlasOnDemand(config) renderImageTaskList = {}, -- textID = 1, renderTextTaskList = {}, -- - padx = 0.5/config.sizex, - pady = 0.5/config.sizey, + padx = 0.5 / config.sizex, + pady = 0.5 / config.sizey, firstemptycolumn = 1, - freeslots = config.sizex/config.xresolution * config.sizey/config.yresolution, - blankimg = 'icons/blank.png', - blackimg = 'luaui/images/black.bmp', - aliasing_grid_test_image = 'luaui/images/aliasing_test_grid_128.tga', - drawmode = config.drawmode or '', -- can be any mode like ':n:' for nearest neighbour + freeslots = config.sizex / config.xresolution * config.sizey / config.yresolution, + blankimg = "icons/blank.png", + blackimg = "luaui/images/black.bmp", + aliasing_grid_test_image = "luaui/images/aliasing_test_grid_128.tga", + drawmode = config.drawmode or "", -- can be any mode like ':n:' for nearest neighbour defaultfont = config.defaultfont, config = config, -- store it, why not debug = config.debug, @@ -201,7 +202,7 @@ local function MakeAtlasOnDemand(config) } -- add an initial blanking command to the whole goddamned thing because AMD allocates garbage as texture memory - AtlasOnDemand.renderImageTaskList[1] = {id = AtlasOnDemand.blankimg, w = config.sizex , h = config.sizey, x = 0, y = 0 }--, srcmode = GL.ZERO, dstmode = GL.ZERO} + AtlasOnDemand.renderImageTaskList[1] = { id = AtlasOnDemand.blankimg, w = config.sizex, h = config.sizey, x = 0, y = 0 } --, srcmode = GL.ZERO, dstmode = GL.ZERO} for x = 1, AtlasOnDemand.xslots do AtlasOnDemand.fill[x] = {} for y = 1, AtlasOnDemand.yslots do @@ -211,13 +212,16 @@ local function MakeAtlasOnDemand(config) local GL_RGBA = 0x1908 local GL_TEXTURE_2D_MULTISAMPLE = 0x9100 AtlasOnDemand.texProps = config.texProps or { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, --min_filter = GL.NEAREST, mag_filter = GL.NEAREST, - wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, format = GL_RGBA, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + format = GL_RGBA, - --target = GL_TEXTURE_2D_MULTISAMPLE, + --target = GL_TEXTURE_2D_MULTISAMPLE, --samples = 1, - } + } AtlasOnDemand.texProps.fbo = true -- need so that we can RenderToTexture it AtlasOnDemand.textureID = gl.CreateTexture(config.sizex, config.sizey, AtlasOnDemand.texProps) @@ -246,8 +250,8 @@ local function MakeAtlasOnDemand(config) local xresolution = self.xresolution local yresolution = self.yresolution - local xstep = math.ceil(xsize/xresolution) - local ystep = math.ceil(ysize/yresolution) + local xstep = math.ceil(xsize / xresolution) + local ystep = math.ceil(ysize / yresolution) local foundspot = false local xpos = -1 local ypos = -1 @@ -255,19 +259,21 @@ local function MakeAtlasOnDemand(config) for xs = self.firstemptycolumn, self.xslots - xstep + 1 do for ys = 1, self.yslots - ystep + 1 do local fits = true - for w = 0, xstep -1 do - local fillRow = self.fill[xs+w] - for h = 0, ystep-1 do + for w = 0, xstep - 1 do + local fillRow = self.fill[xs + w] + for h = 0, ystep - 1 do iterations = iterations + 1 --Spring.Echo(xs+w, ys +h, iterations) - if fillRow[ys+h] then + if fillRow[ys + h] then --xpos = xs+w --ypos = ys+h fits = false break end end - if not fits then break end + if not fits then + break + end end if fits then @@ -277,57 +283,62 @@ local function MakeAtlasOnDemand(config) break end end - if foundspot then break end + if foundspot then + break + end end --Spring.Echo("Iterations", iterations, self.firstemptycolumn) if foundspot then - -- create render task - local task = {id =id, w = xsize, h = ysize, x = (xpos-1) * xresolution, y = (ypos-1) * yresolution} - local uvcoords = { - x = (xpos -1 ) / self.xslots + self.padx *0, - --(xpos + xstep - 1) / self.xslots - self.padx *0, -- this is incorrect, it should be up the extents only - X = (xpos -1 ) / self.xslots + self.padx *0 + xsize/self.xsize, - - y = (ypos -1) / self.yslots + self.pady *0, - Y = (ypos -1 ) / self.yslots - self.pady *0 + ysize/self.ysize, - --(ypos + ystep -1 ) / self.yslots - self.pady *0, - w = xsize, h = ysize, id = id, - } - -- Add it to uvcoords map - self.uvcoords[id] = uvcoords - - -- fill cells - for x = xpos, xpos + xstep - 1 do - local fillRow = self.fill[x] - for y = ypos, ypos + ystep - 1 do - fillRow[y] = id - end + -- create render task + local task = { id = id, w = xsize, h = ysize, x = (xpos - 1) * xresolution, y = (ypos - 1) * yresolution } + local uvcoords = { + x = (xpos - 1) / self.xslots + self.padx * 0, + --(xpos + xstep - 1) / self.xslots - self.padx *0, -- this is incorrect, it should be up the extents only + X = (xpos - 1) / self.xslots + self.padx * 0 + xsize / self.xsize, + + y = (ypos - 1) / self.yslots + self.pady * 0, + Y = (ypos - 1) / self.yslots - self.pady * 0 + ysize / self.ysize, + --(ypos + ystep -1 ) / self.yslots - self.pady *0, + w = xsize, + h = ysize, + id = id, + } + -- Add it to uvcoords map + self.uvcoords[id] = uvcoords + + -- fill cells + for x = xpos, xpos + xstep - 1 do + local fillRow = self.fill[x] + for y = ypos, ypos + ystep - 1 do + fillRow[y] = id end + end - -- maintain empty rows pointer + -- maintain empty rows pointer - for x = self.firstemptycolumn, self.firstemptycolumn + xstep -1 do - local columnfull = true - local fillRow = self.fill[x] - for y = 1, self.yslots do - if fillRow[y] == false then - columnfull = false - break - end + for x = self.firstemptycolumn, self.firstemptycolumn + xstep - 1 do + local columnfull = true + local fillRow = self.fill[x] + for y = 1, self.yslots do + if fillRow[y] == false then + columnfull = false + break end - if columnfull then - if self.debug then Spring.Echo("Column Full!", self.firstemptycolumn) end - self.firstemptycolumn = self.firstemptycolumn + 1 + end + if columnfull then + if self.debug then + Spring.Echo("Column Full!", self.firstemptycolumn) end + self.firstemptycolumn = self.firstemptycolumn + 1 end - --Spring.Echo(string.format("Found spot for %s at %d %d",tostring(img),xpos,ypos)) - -- return uv coords - self.hastasks = true - return uvcoords, task - + end + --Spring.Echo(string.format("Found spot for %s at %d %d",tostring(img),xpos,ypos)) + -- return uv coords + self.hastasks = true + return uvcoords, task else - Spring.Echo(string.format("AtlasOnDemand %s Error: cant find space for %s of size %d x %d", self.name, tostring(id), xsize, ysize)) - return {x = 0,y = 0,X =1, Y = 1,w = xsize, h = ysize,d = 0} + Spring.Echo(string.format("AtlasOnDemand %s Error: cant find space for %s of size %d x %d", self.name, tostring(id), xsize, ysize)) + return { x = 0, y = 0, X = 1, Y = 1, w = xsize, h = ysize, d = 0 } end end @@ -339,7 +350,7 @@ local function MakeAtlasOnDemand(config) -- @return an array of UV coordinates in xXyYwh format function AtlasOnDemand:AddImage(image, xsize, ysize) if gl.RenderToTexture == nil then - return {x = 0,X = 1,y = 0,Y = 1,w = 1,h = 1, id = image} + return { x = 0, X = 1, y = 0, Y = 1, w = 1, h = 1, id = image } end if self.uvcoords[image] then Spring.Echo(string.format("AtlasOnDemand %s Warning: image %s is already added to this atlas", self.name, tostring(image))) @@ -351,14 +362,18 @@ local function MakeAtlasOnDemand(config) local texInfo = gl.TextureInfo(image) if texInfo and (texInfo.xsize ~= xsize or texInfo.ysize ~= ysize) then Spring.Echo(string.format("AtlasOnDemand %s Warning: image %s size does not match %dx%d given, %dx%d from TextureInfo", self.name, tostring(image), xsize or -1, ysize or -1, texInfo.xsize, texInfo.ysize)) - if xsize == nil then xsize = texInfo.xsize end - if ysize == nil then ysize = texInfo.ysize end + if xsize == nil then + xsize = texInfo.xsize + end + if ysize == nil then + ysize = texInfo.ysize + end end end - local uvcoords, task = self:ReserveSpace(image,xsize,ysize) + local uvcoords, task = self:ReserveSpace(image, xsize, ysize) if task then - self.renderImageTaskList[#self.renderImageTaskList + 1 ] = task + self.renderImageTaskList[#self.renderImageTaskList + 1] = task end return uvcoords end @@ -373,12 +388,12 @@ local function MakeAtlasOnDemand(config) function AtlasOnDemand:PlaceImage(image, x, y, xsize, ysize) local texInfo = gl.TextureInfo(image) if texInfo then - local task = {id = image, w = xsize , h = ysize, x = x, y = y } - self.renderImageTaskList[#self.renderImageTaskList + 1 ] = task + local task = { id = image, w = xsize, h = ysize, x = x, y = y } + self.renderImageTaskList[#self.renderImageTaskList + 1] = task self.hastasks = true return #self.renderImageTaskList else - Spring.Echo(string.format("AtlasOnDemand %s Warning: unable to read gl.TextureInfo(%s)",self.name, tostring(image))) + Spring.Echo(string.format("AtlasOnDemand %s Warning: unable to read gl.TextureInfo(%s)", self.name, tostring(image))) end end -- This should return a width, height and UV set for pixel-perfect rendering @@ -394,7 +409,7 @@ local function MakeAtlasOnDemand(config) -- @return an array of {x,X,y,Y,w,h,descender} function AtlasOnDemand:AddText(text, params) if gl.RenderToTexture == nil then - return {x = 0,X = 1,y = 0,Y = 1,w = 1,h = 1, id = text} + return { x = 0, X = 1, y = 0, Y = 1, w = 1, h = 1, id = text } end local textparams if not params then -- render with default fot @@ -403,7 +418,7 @@ local function MakeAtlasOnDemand(config) else if not self.defaultfont then Spring.Echo(string.format("AtlasOnDemand %s Warning: text %s without font cannot be added because atlas has no default font set", self.name, tostring(id))) - self.uvcoords[text] = {x = 0,X = 1,y = 0,Y = 1,w = 1,h = 1, id = id} -- add a fallback so we only warn once per item + self.uvcoords[text] = { x = 0, X = 1, y = 0, Y = 1, w = 1, h = 1, id = id } -- add a fallback so we only warn once per item return self.uvcoords[text] else -- we have a default font @@ -412,10 +427,10 @@ local function MakeAtlasOnDemand(config) font = self.defaultfont.font, size = self.defaultfont.font.size, outlinewidth = self.defaultfont.font.outlinewidth, - outlineweight = self.defaultfont.font.outlineweight , - options = 'b' .. (self.defaultfont.options or "") , -- default bottom vertical alignment - textcolor = self.defaultfont.textcolor or {1,1,1,1}, - outlinecolor = self.defaultfont.outlinecolor or {0,0,0,1}, + outlineweight = self.defaultfont.font.outlineweight, + options = "b" .. (self.defaultfont.options or ""), -- default bottom vertical alignment + textcolor = self.defaultfont.textcolor or { 1, 1, 1, 1 }, + outlinecolor = self.defaultfont.outlinecolor or { 0, 0, 0, 1 }, id = text, pad = 0, } @@ -427,12 +442,12 @@ local function MakeAtlasOnDemand(config) text = text, font = params.font, --fontfilename = params.font.path or params.fontfilename or (self.defaultfont and self.defaultfont.fontfilename), - size = params.size or params.font.size , + size = params.size or params.font.size, outlinewidth = params.outlinewidth or params.font.outlinewidth, outlineweight = params.outlineweight or params.font.outlineweight, options = "b" .. (params.options or ""), -- default bottom vertical alignment - textcolor = params.textcolor or {1,1,1,1}, - outlinecolor = params.outlinecolor or {0,0,0,1}, + textcolor = params.textcolor or { 1, 1, 1, 1 }, + outlinecolor = params.outlinecolor or { 0, 0, 0, 1 }, id = params.id, pad = params.pad or 0, } @@ -442,50 +457,52 @@ local function MakeAtlasOnDemand(config) end end - -- case 'N': { options |= FONT_NORM; } break; -- case 'S': { options |= FONT_SCALE; } break; -- textparams.options = 'N' .. textparams.options - if self.uvcoords[textparams.id] then Spring.Echo(string.format("AtlasOnDemand %s Warning: text %s is already added to this atlas", self.name, tostring(textparams.id))) return self.uvcoords[textparams.id] end -- get the actual width and height of the text object: -- We need to fix the actual size of the font here! - local width = math.ceil(textparams.font:GetTextWidth(textparams.text) * textparams.size ) + local width = math.ceil(textparams.font:GetTextWidth(textparams.text) * textparams.size) -- Height needs to take into account outlines as well! (and maybe even local textheight, textdescender, numlines = textparams.font:GetTextHeight(textparams.text) -- See https://springrts.com/wiki/GetTextHeight local height = math.ceil((textheight + textdescender) * textparams.size) textdescender = -1 * textdescender * textparams.size -- descender is negative for 'b' ? - if self.debug then Spring.Echo(string.format("Pre adjusted textsize for %s at size %d is w=%d h=%d descender=%d", textparams.text, textparams.size, width, height, textdescender)) end + if self.debug then + Spring.Echo(string.format("Pre adjusted textsize for %s at size %d is w=%d h=%d descender=%d", textparams.text, textparams.size, width, height, textdescender)) + end local pad = 1 - if string.find(textparams.options ,'o', nil, true) then - textparams.options = textparams.options .. 'o' - pad = math.ceil(textparams.font.outlinewidth/2) + if string.find(textparams.options, "o", nil, true) then + textparams.options = textparams.options .. "o" + pad = math.ceil(textparams.font.outlinewidth / 2) end - if string.find(textparams.options ,'s', nil, true) then - textparams.options = textparams.options .. 's' + if string.find(textparams.options, "s", nil, true) then + textparams.options = textparams.options .. "s" end - if string.find(textparams.options ,'O', nil, true) then - textparams.options = textparams.options .. 'O' - pad = math.ceil(textparams.font.outlinewidth/2) + if string.find(textparams.options, "O", nil, true) then + textparams.options = textparams.options .. "O" + pad = math.ceil(textparams.font.outlinewidth / 2) end textparams.pad = pad + textparams.pad pad = textparams.pad - width = width + 2*pad - height = height + 2*pad + textdescender - textdescender = math.round(textdescender + pad,0) + width = width + 2 * pad + height = height + 2 * pad + textdescender + textdescender = math.round(textdescender + pad, 0) local vsx, vsy = Spring.GetViewGeometry() - if self.debug then Spring.Echo(string.format('AddText: "%s", size=%d, w=%d h=%d d=%d pad =%f', textparams.text, textparams.size, width, height, textdescender, pad)) end + if self.debug then + Spring.Echo(string.format('AddText: "%s", size=%d, w=%d h=%d d=%d pad =%f', textparams.text, textparams.size, width, height, textdescender, pad)) + end local uvcoords, task = self:ReserveSpace(textparams.id, width, height) if task then task.textparams = textparams - self.renderTextTaskList[#self.renderTextTaskList + 1 ] = task + self.renderTextTaskList[#self.renderTextTaskList + 1] = task end uvcoords.d = textdescender self.uvcoords[textparams.id] = uvcoords @@ -499,23 +516,21 @@ local function MakeAtlasOnDemand(config) function AtlasOnDemand:RemoveFromAtlas(uvcoords, id) -- since it kinda has to by dynamic, it would be nice if we could mark some space as free on this local xmin = math.floor(uvcoords.x * self.xslots) - local xmax = math.ceil(uvcoords.X * self.xslots) + local xmax = math.ceil(uvcoords.X * self.xslots) local ymin = math.floor(uvcoords.y * self.xslots) - local ymax = math.ceil(uvcoords.Y * self.xslots) - for x = xmin, xmax -1 do + local ymax = math.ceil(uvcoords.Y * self.xslots) + for x = xmin, xmax - 1 do self.firstemptyrow = math.min(self.firstemptyrow, x) local fillRow = self.fill[x] - for y = ymin, ymax -1 do + for y = ymin, ymax - 1 do fillRow[y] = nil end end if id then self.uvcoords[id] = nil end - local drawblanktask = {id = self.blankimg, w = xmax-xmin * self.xresolution, h = ymax - ymin * yresolution, - x = xmin * self.xresolution, y = ymin * self.yresolution, - } - self.renderImageTaskList[#self.renderImageTaskList+1] = drawblanktask + local drawblanktask = { id = self.blankimg, w = xmax - xmin * self.xresolution, h = ymax - ymin * yresolution, x = xmin * self.xresolution, y = ymin * self.yresolution } + self.renderImageTaskList[#self.renderImageTaskList + 1] = drawblanktask self.hastasks = true end @@ -529,23 +544,23 @@ local function MakeAtlasOnDemand(config) ---Internal function to execute the rendering of image tasks function AtlasOnDemand:RenderImageTasks() - gl.Color(1,1,1,1) -- sanity check + gl.Color(1, 1, 1, 1) -- sanity check --gl.Rect( 0,0,0.5,0.1) gl.Blending(GL.ONE, GL.ZERO) -- do full opaque for i, task in ipairs(self.renderImageTaskList) do gl.Blending(task.srcmode or GL.ONE, task.dstmode or GL.ZERO) - local drawmodeTexName = self.drawmode..task.id + local drawmodeTexName = self.drawmode .. task.id gl.Texture(0, drawmodeTexName) - local p = self.padx*0 - local o = self.padx*0 - local w = (task.w/self.xsize) * 2 - local h = (task.h/self.ysize) * 2 - local x = (task.x/self.xsize -0.5 ) * 2 - local y = (task.y/self.ysize -0.5 ) * 2 + local p = self.padx * 0 + local o = self.padx * 0 + local w = (task.w / self.xsize) * 2 + local h = (task.h / self.ysize) * 2 + local x = (task.x / self.xsize - 0.5) * 2 + local y = (task.y / self.ysize - 0.5) * 2 --Spring.Echo("AtlasOnDemand:RenderImageTasks", task.id,task.w, task.h, task.x, task.y,x,y,w,h) - gl.TexRect(x,y,x+w,y+h) - gl.Texture(0,false) + gl.TexRect(x, y, x + w, y + h) + gl.Texture(0, false) gl.DeleteTexture(drawmodeTexName) -- Maybe this helps free stuff? end gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- @@ -555,7 +570,7 @@ local function MakeAtlasOnDemand(config) function AtlasOnDemand:RenderTextTasks() local currentParams = {} - gl.Color(1,1,1,1) -- Set Color to default + gl.Color(1, 1, 1, 1) -- Set Color to default local taskList = self.renderTextTaskList gl.Blending(GL.ONE, GL.ZERO) -- do full opaque @@ -566,8 +581,8 @@ local function MakeAtlasOnDemand(config) local xscale = self.xsize local yscale = self.ysize -- The next two operators translate the [-1;1] NDC space into the self.xsize and self.ysize dimensions, I dont think Z needs scaling, but it doesnt matter really - gl.Translate(-1,-1,0) -- translate to -1 so that NDC is now in [0;2] space - gl.Scale(2/xscale, 2/yscale, 2/yscale) -- scale so that it should now be in [self.xsize,self.ysize] space + gl.Translate(-1, -1, 0) -- translate to -1 so that NDC is now in [0;2] space + gl.Scale(2 / xscale, 2 / yscale, 2 / yscale) -- scale so that it should now be in [self.xsize,self.ysize] space for i, task in ipairs(taskList) do local textparams = task.textparams if currentParams.font ~= textparams.font then @@ -576,7 +591,9 @@ local function MakeAtlasOnDemand(config) currentParams.font:End() end textparams.font:Begin() - if self.debug then Spring.Echo("Font set to", textparams.font.path,textparams.size) end + if self.debug then + Spring.Echo("Font set to", textparams.font.path, textparams.size) + end currentParams.font = textparams.font end @@ -588,7 +605,7 @@ local function MakeAtlasOnDemand(config) colormatches = false else local colormatches = true - for i=1, 4 do + for i = 1, 4 do if currentParams.textcolor[i] ~= textparams.textcolor[i] then colormatches = false break @@ -605,7 +622,7 @@ local function MakeAtlasOnDemand(config) if not currentParams.outlinecolor then outlinematches = false else - for i=1, 4 do + for i = 1, 4 do if currentParams.outlinecolor[i] ~= textparams.outlinecolor[i] then outlinematches = false break @@ -617,7 +634,6 @@ local function MakeAtlasOnDemand(config) currentParams.outlinecolor = textparams.outlinecolor end - local x = (task.x + textparams.pad) local y = (task.y + textparams.pad) --x = task.x * 0.01 @@ -626,11 +642,10 @@ local function MakeAtlasOnDemand(config) -- So, a big problem seems to be using fonts that are not size-allocated correctly! if self.debug then - - Spring.Echo(string.format("Task params: id = %s w=%.3f h=%.3f x=%.3f y=%.3f", task.id,task.w,task.h,task.x,task.y)) - Spring.Echo(string.format("renderText: text = %s, x = %f, y = %.3f, size = %.3f, opts = %s",textparams.text, x,y,textparams.size, textparams.options)) + Spring.Echo(string.format("Task params: id = %s w=%.3f h=%.3f x=%.3f y=%.3f", task.id, task.w, task.h, task.x, task.y)) + Spring.Echo(string.format("renderText: text = %s, x = %f, y = %.3f, size = %.3f, opts = %s", textparams.text, x, y, textparams.size, textparams.options)) end - font:Print(textparams.text, x,y, textparams.size, textparams.options) + font:Print(textparams.text, x, y, textparams.size, textparams.options) --font:Print(textparams.text, x,y, 36, textparams.options..'') end currentParams.font:End() @@ -642,25 +657,24 @@ local function MakeAtlasOnDemand(config) -- @param x x pos of left of text -- @param y y pos of bottom line of text (note that its without descender and padding) -- @param align x alignment override, one of 'c', 'r', 'l' - function AtlasOnDemand:TextRect(id,x,y, align) - local uvcoords = self.uvcoords[id] - if not uvcoords then - Spring.Echo("AtlasOnDemand:TextRect cannot find id", id) - return - end - local ypos = y - local xpos = x - if align then - if align == 'c' then - gl.TexRect(x - uvcoords.w/2,y - uvcoords.d, x + uvcoords.w/2, y + uvcoords.h - uvcoords.d,uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) - - elseif align == 'r' then - gl.TexRect(x - uvcoords.w,y - uvcoords.d, x, y + uvcoords.h - uvcoords.d,uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) - end - else - --Spring.Echo(id,x,y,uvcoords.w, uvcoords.h ) - gl.TexRect(x,y - uvcoords.d, x + uvcoords.w, y + uvcoords.h - uvcoords.d,uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) + function AtlasOnDemand:TextRect(id, x, y, align) + local uvcoords = self.uvcoords[id] + if not uvcoords then + Spring.Echo("AtlasOnDemand:TextRect cannot find id", id) + return + end + local ypos = y + local xpos = x + if align then + if align == "c" then + gl.TexRect(x - uvcoords.w / 2, y - uvcoords.d, x + uvcoords.w / 2, y + uvcoords.h - uvcoords.d, uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) + elseif align == "r" then + gl.TexRect(x - uvcoords.w, y - uvcoords.d, x, y + uvcoords.h - uvcoords.d, uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) end + else + --Spring.Echo(id,x,y,uvcoords.w, uvcoords.h ) + gl.TexRect(x, y - uvcoords.d, x + uvcoords.w, y + uvcoords.h - uvcoords.d, uvcoords.x, uvcoords.y, uvcoords.X, uvcoords.Y) + end end ---Perform the render target switch and draw all pending tasks @@ -691,7 +705,7 @@ local function MakeAtlasOnDemand(config) local parts = {} local fillRow = self.fill[x] for y = 1, self.yslots do - parts[y] = string.format('% 5s', fillRow[y]) + parts[y] = string.format("% 5s", fillRow[y]) end Spring.Echo(table.concat(parts)) end @@ -701,8 +715,8 @@ local function MakeAtlasOnDemand(config) -- very useful for debugging what is on the atlas iself -- @param aliastest i dont remember what this does, so dont use it -- @param noalpha draw the atlas without transparency - function AtlasOnDemand:DrawToScreen(aliastest,noalpha) - gl.Color(1,1,1,1.0) + function AtlasOnDemand:DrawToScreen(aliastest, noalpha) + gl.Color(1, 1, 1, 1.0) if noalpha then gl.Blending(GL.ONE, GL.ZERO) -- the default mode else @@ -716,21 +730,21 @@ local function MakeAtlasOnDemand(config) local vsx, vsy = Spring.GetViewGeometry() local o = 10 - gl.TexRect(o,o,math.min(vsx - o, self.xsize + o), math.min(vsy-o,self.ysize + o), 0,0,1,1) + gl.TexRect(o, o, math.min(vsx - o, self.xsize + o), math.min(vsy - o, self.ysize + o), 0, 0, 1, 1) if aliastest then local aliasUV = self.uvcoords[self.aliasing_grid_test_image] - Spring.Echo( aliasUV.x,aliasUV.y,aliasUV.X,aliasUV.Y,aliasUV.w,aliasUV.h) + Spring.Echo(aliasUV.x, aliasUV.y, aliasUV.X, aliasUV.Y, aliasUV.w, aliasUV.h) local xs = 0 - for i =1, 6 do - gl.TexRect(xs, vsy - i * aliasUV.h, xs + i*aliasUV.w, vsy, aliasUV.x,aliasUV.y, aliasUV.X, aliasUV.Y) + for i = 1, 6 do + gl.TexRect(xs, vsy - i * aliasUV.h, xs + i * aliasUV.w, vsy, aliasUV.x, aliasUV.y, aliasUV.X, aliasUV.Y) xs = xs + i * aliasUV.w end end gl.Texture(0, false) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) end --AtlasOnDemand:AddImage(AtlasOnDemand.aliasing_grid_test_image,256,256) @@ -738,10 +752,10 @@ local function MakeAtlasOnDemand(config) end if UNITTEST then - local atlas = MakeAtlasOnDemand({sizex = 124, sizey = 512, xresolution = 96, yresolution = 24, name = "QuadTree Atlas Tester"}) + local atlas = MakeAtlasOnDemand({ sizex = 124, sizey = 512, xresolution = 96, yresolution = 24, name = "QuadTree Atlas Tester" }) - for i = 1,10 do - for j = 1,10 do + for i = 1, 10 do + for j = 1, 10 do --atlas:ReserveSpace(string.format('%dx%d',i,j), 64,64) end end @@ -750,6 +764,3 @@ if UNITTEST then else return MakeAtlasOnDemand end - - - diff --git a/luaui/Include/DrawPrimitiveAtUnit.lua b/luaui/Include/DrawPrimitiveAtUnit.lua index f7e7066b37f..f8eab36e425 100644 --- a/luaui/Include/DrawPrimitiveAtUnit.lua +++ b/luaui/Include/DrawPrimitiveAtUnit.lua @@ -20,7 +20,7 @@ local shaderConfig = { POST_ANIM = " ", -- what you want to do in the animation post function (glsl snippet, see shader source) POST_VERTEX = "v_color = v_color;", -- noop ZPULL = 256.0, -- how much to pull the z (depth) value towards the camera , 256 is about 16 elmos - POST_GEOMETRY = "", --"g_uv.zw = dataIn[0].v_parameters.xy;", -- noop + POST_GEOMETRY = "", --"g_uv.zw = dataIn[0].v_parameters.xy;", -- noop POST_SHADING = "fragColor.rgba = fragColor.rgba;", -- noop MAXVERTICES = 64, -- The max number of vertices we can emit, make sure this is consistent with what you are trying to draw (tris 3, quads 4, corneredrect 8, circle 64 USE_CIRCLES = 1, -- set to nil if you dont want circles @@ -52,32 +52,32 @@ local fsSrcPath = "LuaUI/Shaders/DrawPrimitiveAtUnit.frag.glsl" local vsFallbackSrcPath = "LuaUI/Shaders/DrawPrimitiveAtUnit_nogs.vert.glsl" local shaderSourceCache = { - vssrcpath = vsSrcPath, - fssrcpath = fsSrcPath, - gssrcpath = gsSrcPath, - shaderName = "DrawPrimitiveAtUnit", - uniformInt = {}, - uniformFloat = { - addRadius = 0.0, - iconDistance = 20000.0, - }, - shaderConfig = shaderConfig, - } + vssrcpath = vsSrcPath, + fssrcpath = fsSrcPath, + gssrcpath = gsSrcPath, + shaderName = "DrawPrimitiveAtUnit", + uniformInt = {}, + uniformFloat = { + addRadius = 0.0, + iconDistance = 20000.0, + }, + shaderConfig = shaderConfig, +} local fallbackShaderSourceCache = { - vssrcpath = vsFallbackSrcPath, - fssrcpath = fsSrcPath, - shaderName = "DrawPrimitiveAtUnit (NoGS)", - uniformInt = {}, - uniformFloat = { - addRadius = 0.0, - iconDistance = 20000.0, - }, - shaderConfig = shaderConfig, - } + vssrcpath = vsFallbackSrcPath, + fssrcpath = fsSrcPath, + shaderName = "DrawPrimitiveAtUnit (NoGS)", + uniformInt = {}, + uniformFloat = { + addRadius = 0.0, + iconDistance = 20000.0, + }, + shaderConfig = shaderConfig, +} local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) - local uniformInt = shaderConfig.USETEXTURE and {DrawPrimitiveAtUnitTexture = 0,} or {} + local uniformInt = shaderConfig.USETEXTURE and { DrawPrimitiveAtUnitTexture = 0 } or {} shaderSourceCache.shaderName = DPATname .. "Shader GL4" shaderSourceCache.shaderConfig = shaderConfig @@ -117,22 +117,22 @@ local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) local unitIDattribID if useGeometryShaderForThisShader then instanceLayout = { - {id = 0, name = 'lengthwidthcorner', size = 4}, - {id = 1, name = 'teamID', size = 1, type = GL.UNSIGNED_INT}, - {id = 2, name = 'numvertices', size = 1, type = GL.UNSIGNED_INT}, - {id = 3, name = 'parameters', size = 4}, - {id = 4, name = 'uvoffsets', size = 4}, - {id = 5, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 0, name = "lengthwidthcorner", size = 4 }, + { id = 1, name = "teamID", size = 1, type = GL.UNSIGNED_INT }, + { id = 2, name = "numvertices", size = 1, type = GL.UNSIGNED_INT }, + { id = 3, name = "parameters", size = 4 }, + { id = 4, name = "uvoffsets", size = 4 }, + { id = 5, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDattribID = 5 else instanceLayout = { - {id = 1, name = 'lengthwidthcorner', size = 4}, - {id = 2, name = 'teamID', size = 1, type = GL.UNSIGNED_INT}, - {id = 3, name = 'numvertices', size = 1, type = GL.UNSIGNED_INT}, - {id = 4, name = 'parameters', size = 4}, - {id = 5, name = 'uvoffsets', size = 4}, - {id = 6, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 1, name = "lengthwidthcorner", size = 4 }, + { id = 2, name = "teamID", size = 1, type = GL.UNSIGNED_INT }, + { id = 3, name = "numvertices", size = 1, type = GL.UNSIGNED_INT }, + { id = 4, name = "parameters", size = 4 }, + { id = 5, name = "uvoffsets", size = 4 }, + { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDattribID = 6 end @@ -141,7 +141,7 @@ local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) instanceLayout, 64, -- maxelements DPATname .. "VBO", -- name - unitIDattribID -- unitIDattribID (instData) + unitIDattribID -- unitIDattribID (instData) ) if DrawPrimitiveAtUnitVBO == nil then Spring.Echo("Failed to create DrawPrimitiveAtUnitVBO for ", DPATname) @@ -159,7 +159,7 @@ local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) local numSlots = math.max(shaderConfig.MAXVERTICES or 64, 8) local templateVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - templateVBO:Define(numSlots, {{id = 0, name = 'vinfo', size = 1}}) + templateVBO:Define(numSlots, { { id = 0, name = "vinfo", size = 1 } }) local vertexData = {} for s = 0, numSlots - 1 do vertexData[#vertexData + 1] = s @@ -190,7 +190,7 @@ local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) -- memory pressure triggers a GC cycle), making the VAO draw from deleted -- buffers and breaking rendering intermittently. DrawPrimitiveAtUnitVBO.nogsTemplateVBO = templateVBO - DrawPrimitiveAtUnitVBO.nogsIndexVBO = indexVBO + DrawPrimitiveAtUnitVBO.nogsIndexVBO = indexVBO -- Wrap the real VAO so existing consumers can keep calling -- VBO.VAO:DrawArrays(GL.POINTS, usedElements); under the hood we draw the @@ -209,7 +209,7 @@ local function InitDrawPrimitiveAtUnit(shaderConfig, DPATname) end, } end - return DrawPrimitiveAtUnitVBO, DrawPrimitiveAtUnitShader + return DrawPrimitiveAtUnitVBO, DrawPrimitiveAtUnitShader end -return {InitDrawPrimitiveAtUnit = InitDrawPrimitiveAtUnit, shaderConfig = shaderConfig} +return { InitDrawPrimitiveAtUnit = InitDrawPrimitiveAtUnit, shaderConfig = shaderConfig } diff --git a/luaui/Include/LuaShader.lua b/luaui/Include/LuaShader.lua index 3e37e1608d7..ca618eb4e8d 100644 --- a/luaui/Include/LuaShader.lua +++ b/luaui/Include/LuaShader.lua @@ -1,10 +1,9 @@ - if not LuaShaderNewLocationMessageShown then local dest = widget or gadget local info = dest and dest.GetInfo() - local name = info and info.name or 'unknown' + local name = info and info.name or "unknown" local msg = "A user widget (" .. name .. ") is including LuaUI/Include/LuaShader.lua directly, please change it to use gl.LuaShader instead." - Spring.Log('UserWidget', LOG.DEPRECATED, msg) + Spring.Log("UserWidget", LOG.DEPRECATED, msg) LuaShaderNewLocationMessageShown = true end diff --git a/luaui/Include/blueprint_substitution/definitions.lua b/luaui/Include/blueprint_substitution/definitions.lua index 5960a020791..8c1835d18a1 100644 --- a/luaui/Include/blueprint_substitution/definitions.lua +++ b/luaui/Include/blueprint_substitution/definitions.lua @@ -6,157 +6,167 @@ local DefinitionsModule = {} local SIDES_ENUM = VFS.Include("gamedata/sides_enum.lua") if not SIDES_ENUM then - error("[BlueprintDefinitions] CRITICAL: Failed to load sides_enum.lua!") - -- Return an empty or minimal table if sides are critical and missing - return DefinitionsModule + error("[BlueprintDefinitions] CRITICAL: Failed to load sides_enum.lua!") + -- Return an empty or minimal table if sides are critical and missing + return DefinitionsModule end DefinitionsModule.SIDES = SIDES_ENUM DefinitionsModule.UNIT_CATEGORIES = {} -- Enum Name -> Category Name -DefinitionsModule.categoryUnits = {} -- Category Name -> { Side -> Unit Name } -DefinitionsModule.unitCategories = {} -- Unit Name -> Category Name +DefinitionsModule.categoryUnits = {} -- Category Name -> { Side -> Unit Name } +DefinitionsModule.unitCategories = {} -- Unit Name -> Category Name -- =================================================================== -- Define Unit Categories -- =================================================================== local function DefCat(enumKey, unitTable) -- Made local to definitions.lua - if DefinitionsModule.UNIT_CATEGORIES[enumKey] then - local errorMsg = string.format("[BlueprintDefinitions ERROR] Duplicate category key definition attempted: '%s'. The previous definition will be overwritten.", enumKey) - Spring.Log("BlueprintDefs", LOG.ERROR, errorMsg) - end - - DefinitionsModule.UNIT_CATEGORIES[enumKey] = enumKey - DefinitionsModule.categoryUnits[enumKey] = unitTable - - for _, unitName in pairs(unitTable) do -- side variable isn't used here - if unitName then - DefinitionsModule.unitCategories[unitName:lower()] = enumKey - end - end + if DefinitionsModule.UNIT_CATEGORIES[enumKey] then + local errorMsg = string.format("[BlueprintDefinitions ERROR] Duplicate category key definition attempted: '%s'. The previous definition will be overwritten.", enumKey) + Spring.Log("BlueprintDefs", LOG.ERROR, errorMsg) + end + + DefinitionsModule.UNIT_CATEGORIES[enumKey] = enumKey + DefinitionsModule.categoryUnits[enumKey] = unitTable + + for _, unitName in pairs(unitTable) do -- side variable isn't used here + if unitName then + DefinitionsModule.unitCategories[unitName:lower()] = enumKey + end + end end function DefinitionsModule.defineUnitCategories() - Spring.Log("BlueprintDefs", LOG.DEBUG, "Defining static unit categories START...") - local SIDES = DefinitionsModule.SIDES -- Use SIDES from the module - - -- Clear existing tables (important if this function could be called multiple times on the same module instance, though typically not) - for k in pairs(DefinitionsModule.UNIT_CATEGORIES) do DefinitionsModule.UNIT_CATEGORIES[k] = nil end - for k in pairs(DefinitionsModule.categoryUnits) do DefinitionsModule.categoryUnits[k] = nil end - for k in pairs(DefinitionsModule.unitCategories) do DefinitionsModule.unitCategories[k] = nil end - - -- Resource buildings - DefCat("METAL_EXTRACTOR", {[SIDES.ARMADA]="armmex", [SIDES.CORTEX]="cormex", [SIDES.LEGION]="legmex"}) - DefCat("EXPLOITER", {[SIDES.ARMADA]="armamex", [SIDES.CORTEX]="corexp", [SIDES.LEGION]="legmext15"}) - DefCat("ADVANCED_EXTRACTOR", {[SIDES.ARMADA]="armmoho", [SIDES.CORTEX]="cormoho", [SIDES.LEGION]="legmoho"}) - DefCat("ADVANCED_EXPLOITER", {[SIDES.ARMADA]="armmoho", [SIDES.CORTEX]="cormexp", [SIDES.LEGION]="legmohocon"}) - DefCat("UW_EXTRACTOR", {[SIDES.ARMADA]="armuwmex", [SIDES.CORTEX]="coruwmex", [SIDES.LEGION]="leguwmex"}) - DefCat("ADVANCED_UW_EXTRACTOR", {[SIDES.ARMADA]="armuwmme", [SIDES.CORTEX]="coruwmme", [SIDES.LEGION]="leguwmme"}) - DefCat("METAL_STORAGE", {[SIDES.ARMADA]="armmstor", [SIDES.CORTEX]="cormstor", [SIDES.LEGION]="legmstor"}) - DefCat("ADVANCED_METAL_STORAGE", {[SIDES.ARMADA]="armuwadvms", [SIDES.CORTEX]="coramstor", [SIDES.LEGION]="legamstor"}) - DefCat("UW_METAL_STORAGE", {[SIDES.ARMADA]="armuwms", [SIDES.CORTEX]="coruwms", [SIDES.LEGION]="leguwmstore"}) - DefCat("UW_ADVANCED_METAL_STORAGE", {[SIDES.ARMADA]="armuwadvms", [SIDES.CORTEX]="coruwadvms", [SIDES.LEGION]="coruwadvms"}) - - -- Energy buildings - DefCat("SOLAR", {[SIDES.ARMADA]="armsolar", [SIDES.CORTEX]="corsolar", [SIDES.LEGION]="legsolar"}) - DefCat("ENERGY_CONVERTER", {[SIDES.ARMADA]="armmakr", [SIDES.CORTEX]="cormakr", [SIDES.LEGION]="legeconv"}) - DefCat("ADVANCED_ENERGY_CONVERTER", {[SIDES.ARMADA]="armmmkr", [SIDES.CORTEX]="cormmkr", [SIDES.LEGION]="legadveconv"}) - DefCat("UW_ADVANCED_ENERGY_CONVERTER", {[SIDES.ARMADA]="armuwmmm", [SIDES.CORTEX]="coruwmmm", [SIDES.LEGION]="leganavaleconv"}) - DefCat("ADVANCED_SOLAR", {[SIDES.ARMADA]="armadvsol", [SIDES.CORTEX]="coradvsol", [SIDES.LEGION]="legadvsol"}) - DefCat("WIND", {[SIDES.ARMADA]="armwin", [SIDES.CORTEX]="corwin", [SIDES.LEGION]="legwin"}) - DefCat("TIDAL", {[SIDES.ARMADA]="armtide", [SIDES.CORTEX]="cortide", [SIDES.LEGION]="legtide"}) - DefCat("FUSION", {[SIDES.ARMADA]="armfus", [SIDES.CORTEX]="corfus", [SIDES.LEGION]="legfus"}) - DefCat("ADVANCED_FUSION", {[SIDES.ARMADA]="armafus", [SIDES.CORTEX]="corafus", [SIDES.LEGION]="legafus"}) - DefCat("UW_FUSION", {[SIDES.ARMADA]="armuwfus", [SIDES.CORTEX]="coruwfus", [SIDES.LEGION]="leguwfus"}) - DefCat("GEOTHERMAL", {[SIDES.ARMADA]="armageo", [SIDES.CORTEX]="corbhmth", [SIDES.LEGION]="leggeo"}) - DefCat("ADVANCED_GEO", {[SIDES.ARMADA]="armgmm", [SIDES.CORTEX]="corgmm", [SIDES.LEGION]="leggmm"}) - DefCat("UW_ADV_GEO", {[SIDES.ARMADA]="armuwageo", [SIDES.CORTEX]="coruwageo", [SIDES.LEGION]="leguwageo"}) - DefCat("ENERGY_STORAGE", {[SIDES.ARMADA]="armestor", [SIDES.CORTEX]="corestor", [SIDES.LEGION]="legestor"}) - DefCat("ADVANCED_ENERGY_STORAGE", {[SIDES.ARMADA]="armuwadves", [SIDES.CORTEX]="coradvestore", [SIDES.LEGION]="legadvestore"}) - DefCat("UW_ENERGY_STORAGE", {[SIDES.ARMADA]="armuwes", [SIDES.CORTEX]="coruwes", [SIDES.LEGION]="leguwes"}) - DefCat("UW_ADVANCED_ENERGY_STORAGE", {[SIDES.ARMADA]="armuwadves", [SIDES.CORTEX]="coruwadves", [SIDES.LEGION]="coruwadves"}) - - -- Factory buildings - DefCat("BOT_LAB", {[SIDES.ARMADA]="armlab", [SIDES.CORTEX]="corlab", [SIDES.LEGION]="leglab"}) - DefCat("VEHICLE_PLANT", {[SIDES.ARMADA]="armvp", [SIDES.CORTEX]="corvp", [SIDES.LEGION]="legvp"}) - DefCat("AIRCRAFT_PLANT", {[SIDES.ARMADA]="armap", [SIDES.CORTEX]="corap", [SIDES.LEGION]="legap"}) - DefCat("ADVANCED_AIRCRAFT_PLANT", {[SIDES.ARMADA]="armaap", [SIDES.CORTEX]="coraap", [SIDES.LEGION]="legaap"}) - DefCat("SHIPYARD", {[SIDES.ARMADA]="armsy", [SIDES.CORTEX]="corsy", [SIDES.LEGION]="corsy"}) - DefCat("ADVANCED_SHIPYARD", {[SIDES.ARMADA]="armasy", [SIDES.CORTEX]="corasy", [SIDES.LEGION]="legasy"}) - DefCat("HOVER_PLATFORM", {[SIDES.ARMADA]="armhp", [SIDES.CORTEX]="corhp", [SIDES.LEGION]="leghp"}) - DefCat("AMPHIBIOUS_COMPLEX", {[SIDES.ARMADA]="armamsub", [SIDES.CORTEX]="coramsub", [SIDES.LEGION]="legamphlab"}) - DefCat("EXPIREMENTAL_GANTRY", {[SIDES.ARMADA]="armshltx", [SIDES.CORTEX]="corgant", [SIDES.LEGION]="leggant"}) - DefCat("UW_EXPIREMENTAL_GANTRY", {[SIDES.ARMADA]="armshltxuw", [SIDES.CORTEX]="corgantuw", [SIDES.LEGION]="leggantuw"}) - DefCat("SEAPLANE_PLATFORM", {[SIDES.ARMADA]="armplat", [SIDES.CORTEX]="corplat", [SIDES.LEGION]="legsplab"}) - - -- Static defense buildings - DefCat("LIGHT_LASER", {[SIDES.ARMADA]="armllt", [SIDES.CORTEX]="corllt", [SIDES.LEGION]="leglht"}) - DefCat("HEAVY_LIGHT_LASER", {[SIDES.ARMADA]="armbeamer", [SIDES.CORTEX]="corhllt", [SIDES.LEGION]="legmg"}) - DefCat("HEAVY_LASER", {[SIDES.ARMADA]="armhlt", [SIDES.CORTEX]="corhlt", [SIDES.LEGION]="leghive"}) - DefCat("MISSILE_DEFENSE", {[SIDES.ARMADA]="armrl", [SIDES.CORTEX]="corrl", [SIDES.LEGION]="legrl"}) - DefCat("SAM_SITE", {[SIDES.ARMADA]="armcir", [SIDES.CORTEX]="cormadsam", [SIDES.LEGION]="legrhapsis"}) - DefCat("POPUP_AREA_DEFENSE", {[SIDES.ARMADA]="armpb", [SIDES.CORTEX]="corvipe", [SIDES.LEGION]="legbombard"}) - DefCat("POPUP_AIR_DEFENSE", {[SIDES.ARMADA]="armferret", [SIDES.CORTEX]="corerad", [SIDES.LEGION]="leglupara"}) - DefCat("FLAK", {[SIDES.ARMADA]="armflak", [SIDES.CORTEX]="corflak", [SIDES.LEGION]="legflak"}) - DefCat("FLOATING_FLAK", {[SIDES.ARMADA]="armfflak", [SIDES.CORTEX]="corenaa", [SIDES.LEGION]="leganavalaaturret"}) - DefCat("FLOATING_HEAVY_LASER", {[SIDES.ARMADA]="armfhlt", [SIDES.CORTEX]="corfhlt", [SIDES.LEGION]="legfhlt"}) - DefCat("FLOATING_MISSILE", {[SIDES.ARMADA]="armfrt", [SIDES.CORTEX]="corfrt", [SIDES.LEGION]="legfrl"}) - DefCat("LONG_RANGE_ANTI_AIR", {[SIDES.ARMADA]="armmercury", [SIDES.CORTEX]="corscreamer", [SIDES.LEGION]="leglraa"}) - DefCat("TORPEDO", {[SIDES.ARMADA]="armdl", [SIDES.CORTEX]="cordl", [SIDES.LEGION]="legctl"}) - DefCat("ADV_TORPEDO", {[SIDES.ARMADA]="armatl", [SIDES.CORTEX]="coratl", [SIDES.LEGION]="legatl"}) - DefCat("OFFSHORE_TORPEDO", {[SIDES.ARMADA]="armptl", [SIDES.CORTEX]="corptl", [SIDES.LEGION]="legptl"}) - DefCat("ARTILLERY", {[SIDES.ARMADA]="armguard", [SIDES.CORTEX]="corpun", [SIDES.LEGION]="legcluster"}) - DefCat("LONG_RANGE_PLASMA_CANNON", {[SIDES.ARMADA]="armbrtha", [SIDES.CORTEX]="corint", [SIDES.LEGION]="leglrpc"}) - DefCat("RAPID_FIRE_LONG_RANGE_PLASMA_CANNON", {[SIDES.ARMADA]="armvulc", [SIDES.CORTEX]="corbuzz", [SIDES.LEGION]="legstarfall"}) - DefCat("ANNIHILATOR", {[SIDES.ARMADA]="armanni", [SIDES.CORTEX]="cordoom", [SIDES.LEGION]="legbastion"}) - DefCat("ADV_FLOATING_ANNIHILATOR", {[SIDES.ARMADA]="armkraken", [SIDES.CORTEX]="corfdoom", [SIDES.LEGION]="leganavaldefturret"}) - DefCat("ADVANCED_PLASMA_ARTILLERY", {[SIDES.ARMADA]="armamb", [SIDES.CORTEX]="cortoast", [SIDES.LEGION]="legacluster"}) - DefCat("DRAGONS_CLAW", {[SIDES.ARMADA]="armclaw", [SIDES.CORTEX]="cormaw", [SIDES.LEGION]="legdtr"}) - DefCat("DRAGONS_TEETH", {[SIDES.ARMADA]="armdrag", [SIDES.CORTEX]="cordrag", [SIDES.LEGION]="legdrag"}) - DefCat("ADVANCED_DRAGONS_TEETH", {[SIDES.ARMADA]="armfort", [SIDES.CORTEX]="corfort", [SIDES.LEGION]="legforti"}) - DefCat("SHIELD", {[SIDES.ARMADA]="armgate", [SIDES.CORTEX]="corgate", [SIDES.LEGION]="legdeflector"}) - DefCat("MEDIUM_RANGE_MISSILE", {[SIDES.ARMADA]="armemp", [SIDES.CORTEX]="cortron", [SIDES.LEGION]="legperdition"}) - - -- Intel and special buildings - DefCat("RADAR", {[SIDES.ARMADA]="armrad", [SIDES.CORTEX]="corrad", [SIDES.LEGION]="legrad"}) - DefCat("ADVANCED_RADAR", {[SIDES.ARMADA]="armarad", [SIDES.CORTEX]="corarad", [SIDES.LEGION]="legarad"}) - DefCat("ADV_RADAR", {[SIDES.ARMADA]="armarad", [SIDES.CORTEX]="corarad", [SIDES.LEGION]="legarad"}) - DefCat("JAMMER", {[SIDES.ARMADA]="armjamt", [SIDES.CORTEX]="corjamt", [SIDES.LEGION]="legjam"}) - DefCat("ADVANCED_JAMMER", {[SIDES.ARMADA]="armveil", [SIDES.CORTEX]="corshroud", [SIDES.LEGION]="legajam"}) - DefCat("SONAR", {[SIDES.ARMADA]="armsonar", [SIDES.CORTEX]="corsonar", [SIDES.LEGION]="legsonar"}) - DefCat("ADV_SONAR", {[SIDES.ARMADA]="armason", [SIDES.CORTEX]="corason", [SIDES.LEGION]="legason"}) - DefCat("CAMERA", {[SIDES.ARMADA]="armeyes", [SIDES.CORTEX]="coreyes", [SIDES.LEGION]="legeyes"}) - DefCat("NUKE", {[SIDES.ARMADA]="armsilo", [SIDES.CORTEX]="corsilo", [SIDES.LEGION]="legsilo"}) - DefCat("ANTINUKE", {[SIDES.ARMADA]="armamd", [SIDES.CORTEX]="corfmd", [SIDES.LEGION]="legabm"}) - DefCat("JUNO", {[SIDES.ARMADA]="armjuno", [SIDES.CORTEX]="corjuno", [SIDES.LEGION]="legjuno"}) - DefCat("NANO_TOWER", {[SIDES.ARMADA]="armnanotc", [SIDES.CORTEX]="cornanotc", [SIDES.LEGION]="legnanotc"}) - DefCat("FLOATING_NANO_TOWER", {[SIDES.ARMADA]="armnanotcplat", [SIDES.CORTEX]="cornanotcplat", [SIDES.LEGION]="legnanotcplat"}) - DefCat("ADV_NANO_TOWER", {[SIDES.ARMADA]="armnanotct2", [SIDES.CORTEX]="cornanotct2", [SIDES.LEGION]="legnanotct2"}) - DefCat("STEALTH_DETECTION", {[SIDES.ARMADA]="armrsd", [SIDES.CORTEX]="corrsd", [SIDES.LEGION]="legsd"}) - DefCat("PINPOINTER", {[SIDES.ARMADA]="armtarg", [SIDES.CORTEX]="cortarg", [SIDES.LEGION]="legtarg"}) - DefCat("FLOATING_PINPOINTER", {[SIDES.ARMADA]="armfatf", [SIDES.CORTEX]="corfatf", [SIDES.LEGION]="leganavalpinpointer"}) - DefCat("FLOATING_TORPEDO_LAUNCHER_PG", {[SIDES.ARMADA]="armtl", [SIDES.CORTEX]="cortl", [SIDES.LEGION]="legtl"}) - DefCat("FLOATING_RADAR_PG", {[SIDES.ARMADA]="armfrad", [SIDES.CORTEX]="corfrad", [SIDES.LEGION]="legfrad"}) - DefCat("FLOATING_CONVERTER_PG", {[SIDES.ARMADA]="armfmkr", [SIDES.CORTEX]="corfmkr", [SIDES.LEGION]="legfmkr"}) - DefCat("FLOATING_DRAGONSTEETH_PG", {[SIDES.ARMADA]="armfdrag", [SIDES.CORTEX]="corfdrag", [SIDES.LEGION]="legfdrag"}) - DefCat("FLOATING_HOVER_PLATFORM_PG", {[SIDES.ARMADA]="armfhp", [SIDES.CORTEX]="corfhp", [SIDES.LEGION]="legfhp"}) - - -- NOT BUILDINGS - DefCat("COMMANDER", {[SIDES.ARMADA]="armcom", [SIDES.CORTEX]="corcom", [SIDES.LEGION]="legcom"}) - - local unitCount = 0 - for _, units in pairs(DefinitionsModule.categoryUnits) do - for _, unit in pairs(units) do - if unit then unitCount = unitCount + 1 end - end - end - local categoryCount = 0 - for _ in pairs(DefinitionsModule.UNIT_CATEGORIES) do categoryCount = categoryCount + 1 end - Spring.Log("BlueprintDefs", LOG.DEBUG, string.format("Defined %d categories covering %d units. END", categoryCount, unitCount)) + Spring.Log("BlueprintDefs", LOG.DEBUG, "Defining static unit categories START...") + local SIDES = DefinitionsModule.SIDES -- Use SIDES from the module + + -- Clear existing tables (important if this function could be called multiple times on the same module instance, though typically not) + for k in pairs(DefinitionsModule.UNIT_CATEGORIES) do + DefinitionsModule.UNIT_CATEGORIES[k] = nil + end + for k in pairs(DefinitionsModule.categoryUnits) do + DefinitionsModule.categoryUnits[k] = nil + end + for k in pairs(DefinitionsModule.unitCategories) do + DefinitionsModule.unitCategories[k] = nil + end + + -- Resource buildings + DefCat("METAL_EXTRACTOR", { [SIDES.ARMADA] = "armmex", [SIDES.CORTEX] = "cormex", [SIDES.LEGION] = "legmex" }) + DefCat("EXPLOITER", { [SIDES.ARMADA] = "armamex", [SIDES.CORTEX] = "corexp", [SIDES.LEGION] = "legmext15" }) + DefCat("ADVANCED_EXTRACTOR", { [SIDES.ARMADA] = "armmoho", [SIDES.CORTEX] = "cormoho", [SIDES.LEGION] = "legmoho" }) + DefCat("ADVANCED_EXPLOITER", { [SIDES.ARMADA] = "armmoho", [SIDES.CORTEX] = "cormexp", [SIDES.LEGION] = "legmohocon" }) + DefCat("UW_EXTRACTOR", { [SIDES.ARMADA] = "armuwmex", [SIDES.CORTEX] = "coruwmex", [SIDES.LEGION] = "leguwmex" }) + DefCat("ADVANCED_UW_EXTRACTOR", { [SIDES.ARMADA] = "armuwmme", [SIDES.CORTEX] = "coruwmme", [SIDES.LEGION] = "leguwmme" }) + DefCat("METAL_STORAGE", { [SIDES.ARMADA] = "armmstor", [SIDES.CORTEX] = "cormstor", [SIDES.LEGION] = "legmstor" }) + DefCat("ADVANCED_METAL_STORAGE", { [SIDES.ARMADA] = "armuwadvms", [SIDES.CORTEX] = "coramstor", [SIDES.LEGION] = "legamstor" }) + DefCat("UW_METAL_STORAGE", { [SIDES.ARMADA] = "armuwms", [SIDES.CORTEX] = "coruwms", [SIDES.LEGION] = "leguwmstore" }) + DefCat("UW_ADVANCED_METAL_STORAGE", { [SIDES.ARMADA] = "armuwadvms", [SIDES.CORTEX] = "coruwadvms", [SIDES.LEGION] = "coruwadvms" }) + + -- Energy buildings + DefCat("SOLAR", { [SIDES.ARMADA] = "armsolar", [SIDES.CORTEX] = "corsolar", [SIDES.LEGION] = "legsolar" }) + DefCat("ENERGY_CONVERTER", { [SIDES.ARMADA] = "armmakr", [SIDES.CORTEX] = "cormakr", [SIDES.LEGION] = "legeconv" }) + DefCat("ADVANCED_ENERGY_CONVERTER", { [SIDES.ARMADA] = "armmmkr", [SIDES.CORTEX] = "cormmkr", [SIDES.LEGION] = "legadveconv" }) + DefCat("UW_ADVANCED_ENERGY_CONVERTER", { [SIDES.ARMADA] = "armuwmmm", [SIDES.CORTEX] = "coruwmmm", [SIDES.LEGION] = "leganavaleconv" }) + DefCat("ADVANCED_SOLAR", { [SIDES.ARMADA] = "armadvsol", [SIDES.CORTEX] = "coradvsol", [SIDES.LEGION] = "legadvsol" }) + DefCat("WIND", { [SIDES.ARMADA] = "armwin", [SIDES.CORTEX] = "corwin", [SIDES.LEGION] = "legwin" }) + DefCat("TIDAL", { [SIDES.ARMADA] = "armtide", [SIDES.CORTEX] = "cortide", [SIDES.LEGION] = "legtide" }) + DefCat("FUSION", { [SIDES.ARMADA] = "armfus", [SIDES.CORTEX] = "corfus", [SIDES.LEGION] = "legfus" }) + DefCat("ADVANCED_FUSION", { [SIDES.ARMADA] = "armafus", [SIDES.CORTEX] = "corafus", [SIDES.LEGION] = "legafus" }) + DefCat("UW_FUSION", { [SIDES.ARMADA] = "armuwfus", [SIDES.CORTEX] = "coruwfus", [SIDES.LEGION] = "leguwfus" }) + DefCat("GEOTHERMAL", { [SIDES.ARMADA] = "armageo", [SIDES.CORTEX] = "corbhmth", [SIDES.LEGION] = "leggeo" }) + DefCat("ADVANCED_GEO", { [SIDES.ARMADA] = "armgmm", [SIDES.CORTEX] = "corgmm", [SIDES.LEGION] = "leggmm" }) + DefCat("UW_ADV_GEO", { [SIDES.ARMADA] = "armuwageo", [SIDES.CORTEX] = "coruwageo", [SIDES.LEGION] = "leguwageo" }) + DefCat("ENERGY_STORAGE", { [SIDES.ARMADA] = "armestor", [SIDES.CORTEX] = "corestor", [SIDES.LEGION] = "legestor" }) + DefCat("ADVANCED_ENERGY_STORAGE", { [SIDES.ARMADA] = "armuwadves", [SIDES.CORTEX] = "coradvestore", [SIDES.LEGION] = "legadvestore" }) + DefCat("UW_ENERGY_STORAGE", { [SIDES.ARMADA] = "armuwes", [SIDES.CORTEX] = "coruwes", [SIDES.LEGION] = "leguwes" }) + DefCat("UW_ADVANCED_ENERGY_STORAGE", { [SIDES.ARMADA] = "armuwadves", [SIDES.CORTEX] = "coruwadves", [SIDES.LEGION] = "coruwadves" }) + + -- Factory buildings + DefCat("BOT_LAB", { [SIDES.ARMADA] = "armlab", [SIDES.CORTEX] = "corlab", [SIDES.LEGION] = "leglab" }) + DefCat("VEHICLE_PLANT", { [SIDES.ARMADA] = "armvp", [SIDES.CORTEX] = "corvp", [SIDES.LEGION] = "legvp" }) + DefCat("AIRCRAFT_PLANT", { [SIDES.ARMADA] = "armap", [SIDES.CORTEX] = "corap", [SIDES.LEGION] = "legap" }) + DefCat("ADVANCED_AIRCRAFT_PLANT", { [SIDES.ARMADA] = "armaap", [SIDES.CORTEX] = "coraap", [SIDES.LEGION] = "legaap" }) + DefCat("SHIPYARD", { [SIDES.ARMADA] = "armsy", [SIDES.CORTEX] = "corsy", [SIDES.LEGION] = "corsy" }) + DefCat("ADVANCED_SHIPYARD", { [SIDES.ARMADA] = "armasy", [SIDES.CORTEX] = "corasy", [SIDES.LEGION] = "legasy" }) + DefCat("HOVER_PLATFORM", { [SIDES.ARMADA] = "armhp", [SIDES.CORTEX] = "corhp", [SIDES.LEGION] = "leghp" }) + DefCat("AMPHIBIOUS_COMPLEX", { [SIDES.ARMADA] = "armamsub", [SIDES.CORTEX] = "coramsub", [SIDES.LEGION] = "legamphlab" }) + DefCat("EXPIREMENTAL_GANTRY", { [SIDES.ARMADA] = "armshltx", [SIDES.CORTEX] = "corgant", [SIDES.LEGION] = "leggant" }) + DefCat("UW_EXPIREMENTAL_GANTRY", { [SIDES.ARMADA] = "armshltxuw", [SIDES.CORTEX] = "corgantuw", [SIDES.LEGION] = "leggantuw" }) + DefCat("SEAPLANE_PLATFORM", { [SIDES.ARMADA] = "armplat", [SIDES.CORTEX] = "corplat", [SIDES.LEGION] = "legsplab" }) + + -- Static defense buildings + DefCat("LIGHT_LASER", { [SIDES.ARMADA] = "armllt", [SIDES.CORTEX] = "corllt", [SIDES.LEGION] = "leglht" }) + DefCat("HEAVY_LIGHT_LASER", { [SIDES.ARMADA] = "armbeamer", [SIDES.CORTEX] = "corhllt", [SIDES.LEGION] = "legmg" }) + DefCat("HEAVY_LASER", { [SIDES.ARMADA] = "armhlt", [SIDES.CORTEX] = "corhlt", [SIDES.LEGION] = "leghive" }) + DefCat("MISSILE_DEFENSE", { [SIDES.ARMADA] = "armrl", [SIDES.CORTEX] = "corrl", [SIDES.LEGION] = "legrl" }) + DefCat("SAM_SITE", { [SIDES.ARMADA] = "armcir", [SIDES.CORTEX] = "cormadsam", [SIDES.LEGION] = "legrhapsis" }) + DefCat("POPUP_AREA_DEFENSE", { [SIDES.ARMADA] = "armpb", [SIDES.CORTEX] = "corvipe", [SIDES.LEGION] = "legbombard" }) + DefCat("POPUP_AIR_DEFENSE", { [SIDES.ARMADA] = "armferret", [SIDES.CORTEX] = "corerad", [SIDES.LEGION] = "leglupara" }) + DefCat("FLAK", { [SIDES.ARMADA] = "armflak", [SIDES.CORTEX] = "corflak", [SIDES.LEGION] = "legflak" }) + DefCat("FLOATING_FLAK", { [SIDES.ARMADA] = "armfflak", [SIDES.CORTEX] = "corenaa", [SIDES.LEGION] = "leganavalaaturret" }) + DefCat("FLOATING_HEAVY_LASER", { [SIDES.ARMADA] = "armfhlt", [SIDES.CORTEX] = "corfhlt", [SIDES.LEGION] = "legfhlt" }) + DefCat("FLOATING_MISSILE", { [SIDES.ARMADA] = "armfrt", [SIDES.CORTEX] = "corfrt", [SIDES.LEGION] = "legfrl" }) + DefCat("LONG_RANGE_ANTI_AIR", { [SIDES.ARMADA] = "armmercury", [SIDES.CORTEX] = "corscreamer", [SIDES.LEGION] = "leglraa" }) + DefCat("TORPEDO", { [SIDES.ARMADA] = "armdl", [SIDES.CORTEX] = "cordl", [SIDES.LEGION] = "legctl" }) + DefCat("ADV_TORPEDO", { [SIDES.ARMADA] = "armatl", [SIDES.CORTEX] = "coratl", [SIDES.LEGION] = "legatl" }) + DefCat("OFFSHORE_TORPEDO", { [SIDES.ARMADA] = "armptl", [SIDES.CORTEX] = "corptl", [SIDES.LEGION] = "legptl" }) + DefCat("ARTILLERY", { [SIDES.ARMADA] = "armguard", [SIDES.CORTEX] = "corpun", [SIDES.LEGION] = "legcluster" }) + DefCat("LONG_RANGE_PLASMA_CANNON", { [SIDES.ARMADA] = "armbrtha", [SIDES.CORTEX] = "corint", [SIDES.LEGION] = "leglrpc" }) + DefCat("RAPID_FIRE_LONG_RANGE_PLASMA_CANNON", { [SIDES.ARMADA] = "armvulc", [SIDES.CORTEX] = "corbuzz", [SIDES.LEGION] = "legstarfall" }) + DefCat("ANNIHILATOR", { [SIDES.ARMADA] = "armanni", [SIDES.CORTEX] = "cordoom", [SIDES.LEGION] = "legbastion" }) + DefCat("ADV_FLOATING_ANNIHILATOR", { [SIDES.ARMADA] = "armkraken", [SIDES.CORTEX] = "corfdoom", [SIDES.LEGION] = "leganavaldefturret" }) + DefCat("ADVANCED_PLASMA_ARTILLERY", { [SIDES.ARMADA] = "armamb", [SIDES.CORTEX] = "cortoast", [SIDES.LEGION] = "legacluster" }) + DefCat("DRAGONS_CLAW", { [SIDES.ARMADA] = "armclaw", [SIDES.CORTEX] = "cormaw", [SIDES.LEGION] = "legdtr" }) + DefCat("DRAGONS_TEETH", { [SIDES.ARMADA] = "armdrag", [SIDES.CORTEX] = "cordrag", [SIDES.LEGION] = "legdrag" }) + DefCat("ADVANCED_DRAGONS_TEETH", { [SIDES.ARMADA] = "armfort", [SIDES.CORTEX] = "corfort", [SIDES.LEGION] = "legforti" }) + DefCat("SHIELD", { [SIDES.ARMADA] = "armgate", [SIDES.CORTEX] = "corgate", [SIDES.LEGION] = "legdeflector" }) + DefCat("MEDIUM_RANGE_MISSILE", { [SIDES.ARMADA] = "armemp", [SIDES.CORTEX] = "cortron", [SIDES.LEGION] = "legperdition" }) + + -- Intel and special buildings + DefCat("RADAR", { [SIDES.ARMADA] = "armrad", [SIDES.CORTEX] = "corrad", [SIDES.LEGION] = "legrad" }) + DefCat("ADVANCED_RADAR", { [SIDES.ARMADA] = "armarad", [SIDES.CORTEX] = "corarad", [SIDES.LEGION] = "legarad" }) + DefCat("ADV_RADAR", { [SIDES.ARMADA] = "armarad", [SIDES.CORTEX] = "corarad", [SIDES.LEGION] = "legarad" }) + DefCat("JAMMER", { [SIDES.ARMADA] = "armjamt", [SIDES.CORTEX] = "corjamt", [SIDES.LEGION] = "legjam" }) + DefCat("ADVANCED_JAMMER", { [SIDES.ARMADA] = "armveil", [SIDES.CORTEX] = "corshroud", [SIDES.LEGION] = "legajam" }) + DefCat("SONAR", { [SIDES.ARMADA] = "armsonar", [SIDES.CORTEX] = "corsonar", [SIDES.LEGION] = "legsonar" }) + DefCat("ADV_SONAR", { [SIDES.ARMADA] = "armason", [SIDES.CORTEX] = "corason", [SIDES.LEGION] = "legason" }) + DefCat("CAMERA", { [SIDES.ARMADA] = "armeyes", [SIDES.CORTEX] = "coreyes", [SIDES.LEGION] = "legeyes" }) + DefCat("NUKE", { [SIDES.ARMADA] = "armsilo", [SIDES.CORTEX] = "corsilo", [SIDES.LEGION] = "legsilo" }) + DefCat("ANTINUKE", { [SIDES.ARMADA] = "armamd", [SIDES.CORTEX] = "corfmd", [SIDES.LEGION] = "legabm" }) + DefCat("JUNO", { [SIDES.ARMADA] = "armjuno", [SIDES.CORTEX] = "corjuno", [SIDES.LEGION] = "legjuno" }) + DefCat("NANO_TOWER", { [SIDES.ARMADA] = "armnanotc", [SIDES.CORTEX] = "cornanotc", [SIDES.LEGION] = "legnanotc" }) + DefCat("FLOATING_NANO_TOWER", { [SIDES.ARMADA] = "armnanotcplat", [SIDES.CORTEX] = "cornanotcplat", [SIDES.LEGION] = "legnanotcplat" }) + DefCat("ADV_NANO_TOWER", { [SIDES.ARMADA] = "armnanotct2", [SIDES.CORTEX] = "cornanotct2", [SIDES.LEGION] = "legnanotct2" }) + DefCat("STEALTH_DETECTION", { [SIDES.ARMADA] = "armrsd", [SIDES.CORTEX] = "corrsd", [SIDES.LEGION] = "legsd" }) + DefCat("PINPOINTER", { [SIDES.ARMADA] = "armtarg", [SIDES.CORTEX] = "cortarg", [SIDES.LEGION] = "legtarg" }) + DefCat("FLOATING_PINPOINTER", { [SIDES.ARMADA] = "armfatf", [SIDES.CORTEX] = "corfatf", [SIDES.LEGION] = "leganavalpinpointer" }) + DefCat("FLOATING_TORPEDO_LAUNCHER_PG", { [SIDES.ARMADA] = "armtl", [SIDES.CORTEX] = "cortl", [SIDES.LEGION] = "legtl" }) + DefCat("FLOATING_RADAR_PG", { [SIDES.ARMADA] = "armfrad", [SIDES.CORTEX] = "corfrad", [SIDES.LEGION] = "legfrad" }) + DefCat("FLOATING_CONVERTER_PG", { [SIDES.ARMADA] = "armfmkr", [SIDES.CORTEX] = "corfmkr", [SIDES.LEGION] = "legfmkr" }) + DefCat("FLOATING_DRAGONSTEETH_PG", { [SIDES.ARMADA] = "armfdrag", [SIDES.CORTEX] = "corfdrag", [SIDES.LEGION] = "legfdrag" }) + DefCat("FLOATING_HOVER_PLATFORM_PG", { [SIDES.ARMADA] = "armfhp", [SIDES.CORTEX] = "corfhp", [SIDES.LEGION] = "legfhp" }) + + -- NOT BUILDINGS + DefCat("COMMANDER", { [SIDES.ARMADA] = "armcom", [SIDES.CORTEX] = "corcom", [SIDES.LEGION] = "legcom" }) + + local unitCount = 0 + for _, units in pairs(DefinitionsModule.categoryUnits) do + for _, unit in pairs(units) do + if unit then + unitCount = unitCount + 1 + end + end + end + local categoryCount = 0 + for _ in pairs(DefinitionsModule.UNIT_CATEGORIES) do + categoryCount = categoryCount + 1 + end + Spring.Log("BlueprintDefs", LOG.DEBUG, string.format("Defined %d categories covering %d units. END", categoryCount, unitCount)) end function DefinitionsModule.getCategory(unitDefID) - return DefinitionsModule.unitCategories[unitDefID] + return DefinitionsModule.unitCategories[unitDefID] end ---Calculate default energy transfer data for pipeline context @@ -164,7 +174,7 @@ end ---@param side_enum string SIDES_ENUM.ARM ---@return string unitDefId function DefinitionsModule.getUnitByCategory(categoryName, side_enum) - return DefinitionsModule.categoryUnits[categoryName][side_enum] + return DefinitionsModule.categoryUnits[categoryName][side_enum] end DefinitionsModule.defineUnitCategories() -- Call it once to populate the module table diff --git a/luaui/Include/blueprint_substitution/logic.lua b/luaui/Include/blueprint_substitution/logic.lua index 46c96e2b94f..69ac0fb7bcd 100644 --- a/luaui/Include/blueprint_substitution/logic.lua +++ b/luaui/Include/blueprint_substitution/logic.lua @@ -7,7 +7,7 @@ local defPath = "luaui/Include/blueprint_substitution/definitions.lua" local BpDefs = VFS.Include(defPath) if not BpDefs then - error("[BlueprintSubLogic] CRITICAL: Failed to load required blueprint definitions from: " .. defPath .. ". Substitution logic cannot initialize.") + error("[BlueprintSubLogic] CRITICAL: Failed to load required blueprint definitions from: " .. defPath .. ". Substitution logic cannot initialize.") end BlueprintSubLogic.SIDES = BpDefs.SIDES @@ -21,186 +21,196 @@ BlueprintSubLogic.MasterBuildingData = {} local unitNameToDefIDMap = {} for defID, def in pairs(UnitDefs) do - if def and def.name then - unitNameToDefIDMap[def.name:lower()] = defID - end + if def and def.name then + unitNameToDefIDMap[def.name:lower()] = defID + end end function BlueprintSubLogic.validateCategoryDefinitions() - local categoryKeys = {} - local duplicateCategories = {} - for catKey in pairs(BlueprintSubLogic.UNIT_CATEGORIES) do - if categoryKeys[catKey] then - duplicateCategories[catKey] = true - else - categoryKeys[catKey] = true - end - end - if next(duplicateCategories) then - local dupes = {} - for dupe in pairs(duplicateCategories) do table.insert(dupes, dupe) end - Spring.Log("BlueprintSubLogic", LOG.ERROR, string.format("[BlueprintSubLogic ERROR] Found duplicate category keys: %s", table.concat(dupes, ", "))) - end - - Spring.Log("BlueprintSubLogic", LOG.DEBUG, "Validating category definitions (Unit Assignments)...") - local multiAssigned = {} - local unitAssignments = {} - for unitName, categoryName in pairs(BlueprintSubLogic.unitCategories) do - unitAssignments[unitName] = unitAssignments[unitName] or {} - table.insert(unitAssignments[unitName], categoryName) - if #unitAssignments[unitName] > 1 then - multiAssigned[unitName] = unitAssignments[unitName] - end - end - local count = 0 - for unitName, categories in pairs(multiAssigned) do - count = count + 1 - Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("Unit '%s' is assigned to multiple categories: %s", unitName, table.concat(categories, ", "))) - end - if count > 0 then - Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("Found %d units with multiple category assignments (This may be intended)", count)) - else - Spring.Log("BlueprintSubLogic", LOG.DEBUG, "No duplicate unit assignments found") - end + local categoryKeys = {} + local duplicateCategories = {} + for catKey in pairs(BlueprintSubLogic.UNIT_CATEGORIES) do + if categoryKeys[catKey] then + duplicateCategories[catKey] = true + else + categoryKeys[catKey] = true + end + end + if next(duplicateCategories) then + local dupes = {} + for dupe in pairs(duplicateCategories) do + table.insert(dupes, dupe) + end + Spring.Log("BlueprintSubLogic", LOG.ERROR, string.format("[BlueprintSubLogic ERROR] Found duplicate category keys: %s", table.concat(dupes, ", "))) + end + + Spring.Log("BlueprintSubLogic", LOG.DEBUG, "Validating category definitions (Unit Assignments)...") + local multiAssigned = {} + local unitAssignments = {} + for unitName, categoryName in pairs(BlueprintSubLogic.unitCategories) do + unitAssignments[unitName] = unitAssignments[unitName] or {} + table.insert(unitAssignments[unitName], categoryName) + if #unitAssignments[unitName] > 1 then + multiAssigned[unitName] = unitAssignments[unitName] + end + end + local count = 0 + for unitName, categories in pairs(multiAssigned) do + count = count + 1 + Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("Unit '%s' is assigned to multiple categories: %s", unitName, table.concat(categories, ", "))) + end + if count > 0 then + Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("Found %d units with multiple category assignments (This may be intended)", count)) + else + Spring.Log("BlueprintSubLogic", LOG.DEBUG, "No duplicate unit assignments found") + end end function BlueprintSubLogic.generateEquivalentUnits() - Spring.Log("BlueprintSubLogic", LOG.INFO, "Generating equivalent units...") - local categoryUnits = BlueprintSubLogic.categoryUnits - local equivalentUnits = BlueprintSubLogic.equivalentUnits - for k in pairs(equivalentUnits) do equivalentUnits[k] = nil end - local mappingCount = 0 - for _, sideUnits in pairs(categoryUnits) do - local sideCount = 0 - for _ in pairs(sideUnits) do sideCount = sideCount + 1 end - if sideCount > 1 then - for fromSide, fromUnit in pairs(sideUnits) do - if fromUnit then - local lowerFromUnit = fromUnit:lower() - if not equivalentUnits[lowerFromUnit] then - equivalentUnits[lowerFromUnit] = {} - mappingCount = mappingCount + 1 - end - for toSide, toUnit in pairs(sideUnits) do - if fromSide ~= toSide and toUnit then - equivalentUnits[lowerFromUnit][toSide] = toUnit:lower() - end - end - end - end - end - end - Spring.Log("BlueprintSubLogic", LOG.INFO, string.format("Generated %d unit mappings.", mappingCount)) + Spring.Log("BlueprintSubLogic", LOG.INFO, "Generating equivalent units...") + local categoryUnits = BlueprintSubLogic.categoryUnits + local equivalentUnits = BlueprintSubLogic.equivalentUnits + for k in pairs(equivalentUnits) do + equivalentUnits[k] = nil + end + local mappingCount = 0 + for _, sideUnits in pairs(categoryUnits) do + local sideCount = 0 + for _ in pairs(sideUnits) do + sideCount = sideCount + 1 + end + if sideCount > 1 then + for fromSide, fromUnit in pairs(sideUnits) do + if fromUnit then + local lowerFromUnit = fromUnit:lower() + if not equivalentUnits[lowerFromUnit] then + equivalentUnits[lowerFromUnit] = {} + mappingCount = mappingCount + 1 + end + for toSide, toUnit in pairs(sideUnits) do + if fromSide ~= toSide and toUnit then + equivalentUnits[lowerFromUnit][toSide] = toUnit:lower() + end + end + end + end + end + end + Spring.Log("BlueprintSubLogic", LOG.INFO, string.format("Generated %d unit mappings.", mappingCount)) end function BlueprintSubLogic.getSideFromUnitName(unitName) - if not unitName then return nil end - if unitName == 'dummycom' then - -- special exception for dummycom when player is still 'random' faction, will - -- behave as arm and be converted later - return BlueprintSubLogic.SIDES.ARMADA - end - local lowerName = unitName:lower() - for side, prefix in pairs(BlueprintSubLogic.SIDES) do - if lowerName:find("^" .. prefix) then - return prefix - end - end - return nil + if not unitName then + return nil + end + if unitName == "dummycom" then + -- special exception for dummycom when player is still 'random' faction, will + -- behave as arm and be converted later + return BlueprintSubLogic.SIDES.ARMADA + end + local lowerName = unitName:lower() + for side, prefix in pairs(BlueprintSubLogic.SIDES) do + if lowerName:find("^" .. prefix) then + return prefix + end + end + return nil end function BlueprintSubLogic.analyzeBlueprintSides(blueprint) - if not blueprint or not blueprint.units then - return { - unitCount = 0, - buildingUnitCount = 0, - primarySourceSide = nil, - numSourceSides = 0, - sourceSideInfo = "Empty/No Units", - sideCounts = {} - } - end - - local sourceSidesFound = {} - local sideCounts = {} - local buildingUnitCount = 0 - - for _, unit in ipairs(blueprint.units) do + if not blueprint or not blueprint.units then + return { + unitCount = 0, + buildingUnitCount = 0, + primarySourceSide = nil, + numSourceSides = 0, + sourceSideInfo = "Empty/No Units", + sideCounts = {}, + } + end + + local sourceSidesFound = {} + local sideCounts = {} + local buildingUnitCount = 0 + + for _, unit in ipairs(blueprint.units) do local unitNameLower = nil - if unit.originalName then - unitNameLower = unit.originalName:lower() - elseif unit.unitDefID and UnitDefs[unit.unitDefID] and UnitDefs[unit.unitDefID].name then - unitNameLower = UnitDefs[unit.unitDefID].name:lower() - end - - if unitNameLower then - local buildingData = BlueprintSubLogic.MasterBuildingData[unitNameLower] - - if buildingData and buildingData.side then - buildingUnitCount = buildingUnitCount + 1 - local side = buildingData.side - sourceSidesFound[side] = true - sideCounts[side] = (sideCounts[side] or 0) + 1 - end - end - end - - local numSourceSides = 0 - local primarySourceSide = nil - local maxCount = 0 - if buildingUnitCount > 0 then - for side, count in pairs(sideCounts) do - if sourceSidesFound[side] then numSourceSides = numSourceSides + 1 end - if count > maxCount then - primarySourceSide = side - maxCount = count - end - end - end - - local sourceSideInfo = "Empty/No Relevant Buildings" - if buildingUnitCount > 0 then - if primarySourceSide then - sourceSideInfo = primarySourceSide - if numSourceSides > 1 then - sourceSideInfo = sourceSideInfo .. " (Mixed)" - end - else - sourceSideInfo = "Unknown Side Buildings" - end - end - - if not primarySourceSide then - local allUnitSideCounts = {} - local maxCountAll = 0 - for _, unit in ipairs(blueprint.units) do - local unitNameLower = nil - if unit.originalName then - unitNameLower = unit.originalName:lower() - elseif unit.unitDefID and UnitDefs[unit.unitDefID] and UnitDefs[unit.unitDefID].name then - unitNameLower = UnitDefs[unit.unitDefID].name:lower() - end - if unitNameLower then - local unitSide = BlueprintSubLogic.getSideFromUnitName(unitNameLower) - if unitSide then - allUnitSideCounts[unitSide] = (allUnitSideCounts[unitSide] or 0) + 1 - if allUnitSideCounts[unitSide] > maxCountAll then - primarySourceSide = unitSide - maxCountAll = allUnitSideCounts[unitSide] - end - end - end - end - end - - return { - unitCount = #blueprint.units, - buildingUnitCount = buildingUnitCount, - primarySourceSide = primarySourceSide, - numSourceSides = numSourceSides, - sourceSideInfo = sourceSideInfo, - sideCounts = sideCounts - } + if unit.originalName then + unitNameLower = unit.originalName:lower() + elseif unit.unitDefID and UnitDefs[unit.unitDefID] and UnitDefs[unit.unitDefID].name then + unitNameLower = UnitDefs[unit.unitDefID].name:lower() + end + + if unitNameLower then + local buildingData = BlueprintSubLogic.MasterBuildingData[unitNameLower] + + if buildingData and buildingData.side then + buildingUnitCount = buildingUnitCount + 1 + local side = buildingData.side + sourceSidesFound[side] = true + sideCounts[side] = (sideCounts[side] or 0) + 1 + end + end + end + + local numSourceSides = 0 + local primarySourceSide = nil + local maxCount = 0 + if buildingUnitCount > 0 then + for side, count in pairs(sideCounts) do + if sourceSidesFound[side] then + numSourceSides = numSourceSides + 1 + end + if count > maxCount then + primarySourceSide = side + maxCount = count + end + end + end + + local sourceSideInfo = "Empty/No Relevant Buildings" + if buildingUnitCount > 0 then + if primarySourceSide then + sourceSideInfo = primarySourceSide + if numSourceSides > 1 then + sourceSideInfo = sourceSideInfo .. " (Mixed)" + end + else + sourceSideInfo = "Unknown Side Buildings" + end + end + + if not primarySourceSide then + local allUnitSideCounts = {} + local maxCountAll = 0 + for _, unit in ipairs(blueprint.units) do + local unitNameLower = nil + if unit.originalName then + unitNameLower = unit.originalName:lower() + elseif unit.unitDefID and UnitDefs[unit.unitDefID] and UnitDefs[unit.unitDefID].name then + unitNameLower = UnitDefs[unit.unitDefID].name:lower() + end + if unitNameLower then + local unitSide = BlueprintSubLogic.getSideFromUnitName(unitNameLower) + if unitSide then + allUnitSideCounts[unitSide] = (allUnitSideCounts[unitSide] or 0) + 1 + if allUnitSideCounts[unitSide] > maxCountAll then + primarySourceSide = unitSide + maxCountAll = allUnitSideCounts[unitSide] + end + end + end + end + end + + return { + unitCount = #blueprint.units, + buildingUnitCount = buildingUnitCount, + primarySourceSide = primarySourceSide, + numSourceSides = numSourceSides, + sourceSideInfo = sourceSideInfo, + sideCounts = sideCounts, + } end BlueprintSubLogic.validateCategoryDefinitions() @@ -209,250 +219,256 @@ BlueprintSubLogic.generateEquivalentUnits() Spring.Log("BlueprintSubLogic", LOG.INFO, "Generating Master Building Data...") local buildingCount = 0 if BlueprintSubLogic.unitCategories then - for unitNameLower, categoryName in pairs(BlueprintSubLogic.unitCategories) do - local side = BlueprintSubLogic.getSideFromUnitName(unitNameLower) - local equivalents = BlueprintSubLogic.equivalentUnits[unitNameLower] or {} - local unitDefID = unitNameToDefIDMap[unitNameLower] - local translatedHumanName = "N/A" - if unitDefID and UnitDefs[unitDefID] then - translatedHumanName = UnitDefs[unitDefID].translatedHumanName or UnitDefs[unitDefID].name - end - - BlueprintSubLogic.MasterBuildingData[unitNameLower] = { - unitDefID = unitDefID, - name = unitNameLower, - translatedHumanName = translatedHumanName, - side = side, - categoryName = categoryName, - equivalents = equivalents, - } - buildingCount = buildingCount + 1 - end + for unitNameLower, categoryName in pairs(BlueprintSubLogic.unitCategories) do + local side = BlueprintSubLogic.getSideFromUnitName(unitNameLower) + local equivalents = BlueprintSubLogic.equivalentUnits[unitNameLower] or {} + local unitDefID = unitNameToDefIDMap[unitNameLower] + local translatedHumanName = "N/A" + if unitDefID and UnitDefs[unitDefID] then + translatedHumanName = UnitDefs[unitDefID].translatedHumanName or UnitDefs[unitDefID].name + end + + BlueprintSubLogic.MasterBuildingData[unitNameLower] = { + unitDefID = unitDefID, + name = unitNameLower, + translatedHumanName = translatedHumanName, + side = side, + categoryName = categoryName, + equivalents = equivalents, + } + buildingCount = buildingCount + 1 + end end Spring.Log("BlueprintSubLogic", LOG.INFO, string.format("Generated Master Building Data for %d buildings.", buildingCount)) Spring.Log("BlueprintSubLogic", LOG.INFO, "Internal data structures for substitution logic generated. Module ready to be used.") local function _getActualSubstitutedUnitName(originalUnitName, targetSide) - if not originalUnitName or not targetSide then - return originalUnitName - end + if not originalUnitName or not targetSide then + return originalUnitName + end - local unitNameLower = originalUnitName:lower() - local buildingData = BlueprintSubLogic.MasterBuildingData[unitNameLower] + local unitNameLower = originalUnitName:lower() + local buildingData = BlueprintSubLogic.MasterBuildingData[unitNameLower] - if not buildingData then - return originalUnitName - end + if not buildingData then + return originalUnitName + end - if buildingData.side == targetSide then - return originalUnitName - end + if buildingData.side == targetSide then + return originalUnitName + end - local equivalentUnitName = buildingData.equivalents[targetSide] - if not equivalentUnitName or equivalentUnitName == "" then - Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("_getActualSubstitutedUnitDefID: No mapping for unit '%s' to target side '%s'.", unitNameLower, targetSide)) - return originalUnitName - end + local equivalentUnitName = buildingData.equivalents[targetSide] + if not equivalentUnitName or equivalentUnitName == "" then + Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("_getActualSubstitutedUnitDefID: No mapping for unit '%s' to target side '%s'.", unitNameLower, targetSide)) + return originalUnitName + end - return equivalentUnitName + return equivalentUnitName end local function _getBuildingSubstitutionOutcome(originalUnitName, buildingData, targetSide, sourceSideOrNil) - local newUnitName = originalUnitName - local status = "unknown" - local equivalentUnitNameAttempted = nil - - if sourceSideOrNil and buildingData.side == targetSide then - status = "unchanged_same_side" - else - equivalentUnitNameAttempted = buildingData.equivalents[targetSide] - if not equivalentUnitNameAttempted then - status = "failed_no_mapping" - newUnitName = _getActualSubstitutedUnitName(originalUnitName, targetSide) - else - newUnitName = _getActualSubstitutedUnitName(originalUnitName, targetSide) - if newUnitName == originalUnitName then - status = "failed_invalid_equivalent" - else - status = "substituted" - end - end - end - - return { newUnitName = newUnitName, status = status, equivalentUnitNameAttempted = equivalentUnitNameAttempted } + local newUnitName = originalUnitName + local status = "unknown" + local equivalentUnitNameAttempted = nil + + if sourceSideOrNil and buildingData.side == targetSide then + status = "unchanged_same_side" + else + equivalentUnitNameAttempted = buildingData.equivalents[targetSide] + if not equivalentUnitNameAttempted then + status = "failed_no_mapping" + newUnitName = _getActualSubstitutedUnitName(originalUnitName, targetSide) + else + newUnitName = _getActualSubstitutedUnitName(originalUnitName, targetSide) + if newUnitName == originalUnitName then + status = "failed_invalid_equivalent" + else + status = "substituted" + end + end + end + + return { newUnitName = newUnitName, status = status, equivalentUnitNameAttempted = equivalentUnitNameAttempted } end local function _generateSubstitutionSummary(aggregatedStats, itemTypeString, sourceSide, targetSide) - local stats = aggregatedStats - local substitutionActuallyFailed = (stats.failedNoMapping > 0 or stats.failedInvalidEquivalent > 0) - local numFailedToMap = stats.failedNoMapping + stats.failedInvalidEquivalent - - stats.totalConsidered = stats.totalConsidered or 0 - stats.substituted = stats.substituted or 0 - stats.unchangedSameSide = stats.unchangedSameSide or 0 - stats.unchangedOther = stats.unchangedOther or 0 - stats.unchangedNotBuilding = stats.unchangedNotBuilding or 0 - local numSkippedOrUnchangedConsidered = stats.unchangedSameSide + stats.unchangedOther - - local verboseMessage = string.format( - "%s processed from %s to %s. Items considered (buildings): %d, Substituted: %d, Failed to map: %d, Skipped/Unchanged (buildings): %d, Not buildings/commands: %d.", - itemTypeString, sourceSide, targetSide, stats.totalConsidered, stats.substituted, - numFailedToMap, numSkippedOrUnchangedConsidered, stats.unchangedNotBuilding - ) - if substitutionActuallyFailed then - verboseMessage = verboseMessage .. string.format(" (FAIL - %d item(s) could not be mapped)", numFailedToMap) - elseif stats.substituted > 0 then - verboseMessage = verboseMessage .. " (OK)" - elseif stats.totalConsidered > 0 then - verboseMessage = verboseMessage .. string.format(" (No %s items substituted)", itemTypeString:lower()) - else - verboseMessage = verboseMessage .. string.format(" (No relevant %s items to process for substitution)", itemTypeString:lower()) - end - - Spring.Log("BlueprintSubLogic", LOG.INFO, verboseMessage) - - local simpleMessage - if stats.totalConsidered > 0 then - local details - if substitutionActuallyFailed then - details = string.format("%d/%d substituted, %d failed", - stats.substituted, stats.totalConsidered, numFailedToMap) - else - if stats.substituted > 0 then - details = string.format("%d/%d substituted successfully", stats.substituted, stats.totalConsidered) - else - details = "No units substituted" - end - end - simpleMessage = string.format("%s from %s to %s: %s.", itemTypeString, sourceSide, targetSide, details) - else - simpleMessage = string.format("%s from %s to %s: No relevant units to process.", itemTypeString, sourceSide, targetSide) - end - - if substitutionActuallyFailed then - simpleMessage = simpleMessage .. " (FAIL)" - elseif stats.substituted > 0 then - simpleMessage = simpleMessage .. " (OK)" - end - - return simpleMessage, substitutionActuallyFailed + local stats = aggregatedStats + local substitutionActuallyFailed = (stats.failedNoMapping > 0 or stats.failedInvalidEquivalent > 0) + local numFailedToMap = stats.failedNoMapping + stats.failedInvalidEquivalent + + stats.totalConsidered = stats.totalConsidered or 0 + stats.substituted = stats.substituted or 0 + stats.unchangedSameSide = stats.unchangedSameSide or 0 + stats.unchangedOther = stats.unchangedOther or 0 + stats.unchangedNotBuilding = stats.unchangedNotBuilding or 0 + local numSkippedOrUnchangedConsidered = stats.unchangedSameSide + stats.unchangedOther + + local verboseMessage = string.format("%s processed from %s to %s. Items considered (buildings): %d, Substituted: %d, Failed to map: %d, Skipped/Unchanged (buildings): %d, Not buildings/commands: %d.", itemTypeString, sourceSide, targetSide, stats.totalConsidered, stats.substituted, numFailedToMap, numSkippedOrUnchangedConsidered, stats.unchangedNotBuilding) + if substitutionActuallyFailed then + verboseMessage = verboseMessage .. string.format(" (FAIL - %d item(s) could not be mapped)", numFailedToMap) + elseif stats.substituted > 0 then + verboseMessage = verboseMessage .. " (OK)" + elseif stats.totalConsidered > 0 then + verboseMessage = verboseMessage .. string.format(" (No %s items substituted)", itemTypeString:lower()) + else + verboseMessage = verboseMessage .. string.format(" (No relevant %s items to process for substitution)", itemTypeString:lower()) + end + + Spring.Log("BlueprintSubLogic", LOG.INFO, verboseMessage) + + local simpleMessage + if stats.totalConsidered > 0 then + local details + if substitutionActuallyFailed then + details = string.format("%d/%d substituted, %d failed", stats.substituted, stats.totalConsidered, numFailedToMap) + else + if stats.substituted > 0 then + details = string.format("%d/%d substituted successfully", stats.substituted, stats.totalConsidered) + else + details = "No units substituted" + end + end + simpleMessage = string.format("%s from %s to %s: %s.", itemTypeString, sourceSide, targetSide, details) + else + simpleMessage = string.format("%s from %s to %s: No relevant units to process.", itemTypeString, sourceSide, targetSide) + end + + if substitutionActuallyFailed then + simpleMessage = simpleMessage .. " (FAIL)" + elseif stats.substituted > 0 then + simpleMessage = simpleMessage .. " (OK)" + end + + return simpleMessage, substitutionActuallyFailed end function BlueprintSubLogic.getEquivalentUnitDefID(originalUnitDefID, targetSide) - local originalUnitDef = UnitDefs[originalUnitDefID] - if not originalUnitDef then - return originalUnitDefID - end - local substitutedName = _getActualSubstitutedUnitName(originalUnitDef.name, targetSide) - local result = unitNameToDefIDMap[substitutedName:lower()] - return result or originalUnitDefID + local originalUnitDef = UnitDefs[originalUnitDefID] + if not originalUnitDef then + return originalUnitDefID + end + local substitutedName = _getActualSubstitutedUnitName(originalUnitDef.name, targetSide) + local result = unitNameToDefIDMap[substitutedName:lower()] + return result or originalUnitDefID end function BlueprintSubLogic.processBlueprintSubstitution(originalBlueprint, targetSide) - local sourceSide = originalBlueprint and originalBlueprint.sourceInfo and originalBlueprint.sourceInfo.primarySourceSide - - if not (originalBlueprint and originalBlueprint.units and targetSide) then - Spring.Log("BlueprintSubLogic", LOG.ERROR, "processBlueprintSubstitution: Called with invalid arguments (nil blueprint, units, or targetSide).") - local errorStats = {totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true} - return { stats = errorStats, summaryMessage = "Internal error: Invalid arguments for substitution.", substitutionFailed = true } - end - - if not sourceSide then - local summary = "Blueprint substitution failed: The original faction of the blueprint is unclear." - local errorStats = {totalConsidered = originalBlueprint.units and #originalBlueprint.units or 0, substituted = 0, failedNoMapping = originalBlueprint.units and #originalBlueprint.units or 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true} - return { stats = errorStats, summaryMessage = summary, substitutionFailed = true } - end - - Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("Processing blueprint substitution (in-place) from %s to %s for %d units.", - tostring(sourceSide), tostring(targetSide), originalBlueprint and #originalBlueprint.units or 0)) - - local aggregatedStats = { - totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, - unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0 - } - - for _, unit in ipairs(originalBlueprint.units) do - local originalUnitName = unit.originalName - if not originalUnitName then - aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 - else - aggregatedStats.totalConsidered = aggregatedStats.totalConsidered + 1 - local buildingData = BlueprintSubLogic.MasterBuildingData[originalUnitName:lower()] - if not buildingData then - aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 - else - local outcome = _getBuildingSubstitutionOutcome(originalUnitName, buildingData, targetSide, sourceSide) - unit.originalName = outcome.newUnitName - if outcome.status == "substituted" then - aggregatedStats.substituted = aggregatedStats.substituted + 1 - elseif outcome.status == "failed_no_mapping" then - aggregatedStats.failedNoMapping = aggregatedStats.failedNoMapping + 1 - elseif outcome.status == "failed_invalid_equivalent" then - aggregatedStats.failedInvalidEquivalent = aggregatedStats.failedInvalidEquivalent + 1 - elseif outcome.status == "unchanged_same_side" then - aggregatedStats.unchangedSameSide = aggregatedStats.unchangedSameSide + 1 - else - aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 - end - end - end - end - - local summaryMsg, subFailed = _generateSubstitutionSummary(aggregatedStats, "Blueprint", sourceSide, targetSide) - return { stats = aggregatedStats, summaryMessage = summaryMsg, substitutionFailed = subFailed } + local sourceSide = originalBlueprint and originalBlueprint.sourceInfo and originalBlueprint.sourceInfo.primarySourceSide + + if not (originalBlueprint and originalBlueprint.units and targetSide) then + Spring.Log("BlueprintSubLogic", LOG.ERROR, "processBlueprintSubstitution: Called with invalid arguments (nil blueprint, units, or targetSide).") + local errorStats = { totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true } + return { stats = errorStats, summaryMessage = "Internal error: Invalid arguments for substitution.", substitutionFailed = true } + end + + if not sourceSide then + local summary = "Blueprint substitution failed: The original faction of the blueprint is unclear." + local errorStats = { totalConsidered = originalBlueprint.units and #originalBlueprint.units or 0, substituted = 0, failedNoMapping = originalBlueprint.units and #originalBlueprint.units or 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true } + return { stats = errorStats, summaryMessage = summary, substitutionFailed = true } + end + + Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("Processing blueprint substitution (in-place) from %s to %s for %d units.", tostring(sourceSide), tostring(targetSide), originalBlueprint and #originalBlueprint.units or 0)) + + local aggregatedStats = { + totalConsidered = 0, + substituted = 0, + failedNoMapping = 0, + failedInvalidEquivalent = 0, + unchangedSameSide = 0, + unchangedOther = 0, + unchangedNotBuilding = 0, + } + + for _, unit in ipairs(originalBlueprint.units) do + local originalUnitName = unit.originalName + if not originalUnitName then + aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 + else + aggregatedStats.totalConsidered = aggregatedStats.totalConsidered + 1 + local buildingData = BlueprintSubLogic.MasterBuildingData[originalUnitName:lower()] + if not buildingData then + aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 + else + local outcome = _getBuildingSubstitutionOutcome(originalUnitName, buildingData, targetSide, sourceSide) + unit.originalName = outcome.newUnitName + if outcome.status == "substituted" then + aggregatedStats.substituted = aggregatedStats.substituted + 1 + elseif outcome.status == "failed_no_mapping" then + aggregatedStats.failedNoMapping = aggregatedStats.failedNoMapping + 1 + elseif outcome.status == "failed_invalid_equivalent" then + aggregatedStats.failedInvalidEquivalent = aggregatedStats.failedInvalidEquivalent + 1 + elseif outcome.status == "unchanged_same_side" then + aggregatedStats.unchangedSameSide = aggregatedStats.unchangedSameSide + 1 + else + aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 + end + end + end + end + + local summaryMsg, subFailed = _generateSubstitutionSummary(aggregatedStats, "Blueprint", sourceSide, targetSide) + return { stats = aggregatedStats, summaryMessage = summaryMsg, substitutionFailed = subFailed } end function BlueprintSubLogic.processBuildQueueSubstitution(originalBuildQueue, sourceSide, targetSide) - if not (originalBuildQueue and sourceSide and targetSide) then - Spring.Log("BlueprintSubLogic", LOG.ERROR, "processBuildQueueSubstitution: Called with incomplete arguments (nil sourceSide or targetSide). Review caller logic.") - local errorStats = {totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true} - return { stats = errorStats, summaryMessage = "Internal error: Incomplete arguments for substitution.", substitutionFailed = true } - end - - Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("Processing build queue substitution (in-place) from %s to %s for %d items.", - sourceSide, targetSide, #originalBuildQueue)) - - local aggregatedStats = { - totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, - unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0 - } - for _, bq_item in ipairs(originalBuildQueue) do - if type(bq_item) == "table" and #bq_item >= 1 then - local originalUnitDefID = bq_item[1] - if originalUnitDefID and originalUnitDefID > 0 then - local originalUnitDef = UnitDefs[originalUnitDefID] - if not originalUnitDef then - aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 - else - local originalUnitName = originalUnitDef.name - aggregatedStats.totalConsidered = aggregatedStats.totalConsidered + 1 - local buildingData = BlueprintSubLogic.MasterBuildingData[originalUnitName:lower()] - if buildingData then - local outcome = _getBuildingSubstitutionOutcome(originalUnitName, buildingData, targetSide, sourceSide) - if outcome.status == "substituted" then - bq_item[1] = unitNameToDefIDMap[outcome.newUnitName:lower()] - aggregatedStats.substituted = aggregatedStats.substituted + 1 - elseif outcome.status == "failed_no_mapping" then aggregatedStats.failedNoMapping = aggregatedStats.failedNoMapping + 1 - elseif outcome.status == "failed_invalid_equivalent" then aggregatedStats.failedInvalidEquivalent = aggregatedStats.failedInvalidEquivalent + 1 - elseif outcome.status == "unchanged_same_side" then aggregatedStats.unchangedSameSide = aggregatedStats.unchangedSameSide + 1 - else - aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 - end - else - aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 - Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("processBuildQueueSubstitution: No MasterBuildingData for %s. Item not substituted.", originalUnitName:lower())) - end - end - else - aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 - end - else - aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 - Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("processBuildQueueSubstitution: Skipping malformed item: %s", tostring(bq_item))) - end - end - local summaryMsg, subFailed = _generateSubstitutionSummary(aggregatedStats, "Build queue", sourceSide, targetSide) - return { stats = aggregatedStats, summaryMessage = summaryMsg, substitutionFailed = subFailed } + if not (originalBuildQueue and sourceSide and targetSide) then + Spring.Log("BlueprintSubLogic", LOG.ERROR, "processBuildQueueSubstitution: Called with incomplete arguments (nil sourceSide or targetSide). Review caller logic.") + local errorStats = { totalConsidered = 0, substituted = 0, failedNoMapping = 0, failedInvalidEquivalent = 0, unchangedSameSide = 0, unchangedOther = 0, unchangedNotBuilding = 0, hadMappingFailures = true } + return { stats = errorStats, summaryMessage = "Internal error: Incomplete arguments for substitution.", substitutionFailed = true } + end + + Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("Processing build queue substitution (in-place) from %s to %s for %d items.", sourceSide, targetSide, #originalBuildQueue)) + + local aggregatedStats = { + totalConsidered = 0, + substituted = 0, + failedNoMapping = 0, + failedInvalidEquivalent = 0, + unchangedSameSide = 0, + unchangedOther = 0, + unchangedNotBuilding = 0, + } + for _, bq_item in ipairs(originalBuildQueue) do + if type(bq_item) == "table" and #bq_item >= 1 then + local originalUnitDefID = bq_item[1] + if originalUnitDefID and originalUnitDefID > 0 then + local originalUnitDef = UnitDefs[originalUnitDefID] + if not originalUnitDef then + aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 + else + local originalUnitName = originalUnitDef.name + aggregatedStats.totalConsidered = aggregatedStats.totalConsidered + 1 + local buildingData = BlueprintSubLogic.MasterBuildingData[originalUnitName:lower()] + if buildingData then + local outcome = _getBuildingSubstitutionOutcome(originalUnitName, buildingData, targetSide, sourceSide) + if outcome.status == "substituted" then + bq_item[1] = unitNameToDefIDMap[outcome.newUnitName:lower()] + aggregatedStats.substituted = aggregatedStats.substituted + 1 + elseif outcome.status == "failed_no_mapping" then + aggregatedStats.failedNoMapping = aggregatedStats.failedNoMapping + 1 + elseif outcome.status == "failed_invalid_equivalent" then + aggregatedStats.failedInvalidEquivalent = aggregatedStats.failedInvalidEquivalent + 1 + elseif outcome.status == "unchanged_same_side" then + aggregatedStats.unchangedSameSide = aggregatedStats.unchangedSameSide + 1 + else + aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 + end + else + aggregatedStats.unchangedOther = aggregatedStats.unchangedOther + 1 + Spring.Log("BlueprintSubLogic", LOG.DEBUG, string.format("processBuildQueueSubstitution: No MasterBuildingData for %s. Item not substituted.", originalUnitName:lower())) + end + end + else + aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 + end + else + aggregatedStats.unchangedNotBuilding = aggregatedStats.unchangedNotBuilding + 1 + Spring.Log("BlueprintSubLogic", LOG.WARNING, string.format("processBuildQueueSubstitution: Skipping malformed item: %s", tostring(bq_item))) + end + end + local summaryMsg, subFailed = _generateSubstitutionSummary(aggregatedStats, "Build queue", sourceSide, targetSide) + return { stats = aggregatedStats, summaryMessage = summaryMsg, substitutionFailed = subFailed } end -return BlueprintSubLogic \ No newline at end of file +return BlueprintSubLogic diff --git a/luaui/Include/blueprint_substitution/reports.lua b/luaui/Include/blueprint_substitution/reports.lua index 1f4c95ce31c..bb0b17094ad 100644 --- a/luaui/Include/blueprint_substitution/reports.lua +++ b/luaui/Include/blueprint_substitution/reports.lua @@ -12,37 +12,37 @@ local sideComplete = {} local uncategorizedUnits = {} local function escapeCsvField(value) - local str = tostring(value or "") - if string.find(str, '[,\"\n]') then - str = string.gsub(str, '"', '""') - return '"' .. str .. '"' - else - return str - end + local str = tostring(value or "") + if string.find(str, '[,"\n]') then + str = string.gsub(str, '"', '""') + return '"' .. str .. '"' + else + return str + end end -- Helper function to echo a table of lines in chunks local function echoChunked(lines, chunkSize) - chunkSize = chunkSize or 20 -- Default chunk size - local numLines = #lines - for i = 1, numLines, chunkSize do - local chunkEnd = math.min(i + chunkSize - 1, numLines) - local chunkLines = {} - for j = i, chunkEnd do - table.insert(chunkLines, lines[j]) - end - Spring.Echo(table.concat(chunkLines, "\n")) - end + chunkSize = chunkSize or 20 -- Default chunk size + local numLines = #lines + for i = 1, numLines, chunkSize do + local chunkEnd = math.min(i + chunkSize - 1, numLines) + local chunkLines = {} + for j = i, chunkEnd do + table.insert(chunkLines, lines[j]) + end + Spring.Echo(table.concat(chunkLines, "\n")) + end end function REPORTS.SetDependencies(subLogic) - Spring.Log("BlueprintReports", "info", "Receiving dependencies via SetDependencies...") - substitutionLogic = subLogic - if not substitutionLogic then - Spring.Log("BlueprintReports", "error", "Failed to receive necessary logic tables via SetDependencies!") - else - Spring.Log("BlueprintReports", "info", "Dependencies received successfully via SetDependencies.") - end + Spring.Log("BlueprintReports", "info", "Receiving dependencies via SetDependencies...") + substitutionLogic = subLogic + if not substitutionLogic then + Spring.Log("BlueprintReports", "error", "Failed to receive necessary logic tables via SetDependencies!") + else + Spring.Log("BlueprintReports", "info", "Dependencies received successfully via SetDependencies.") + end end -- =================================================================== @@ -50,141 +50,179 @@ end -- =================================================================== function REPORTS.generateMappingReport() - Spring.Echo("\n--- Blueprint Mapping Report Start (CSV Format) ---") - local SIDES = substitutionLogic.SIDES - local masterBuildingDataMinimal = substitutionLogic.MasterBuildingData - local reportLines = {} - - -- Add Header - table.insert(reportLines, table.concat({ - "Category", "DescName", - "Side", "Tier", "Building", "Name", - "MetalCost", "EnergyCost", "BuildTime", "Health", "Speed", "HasWeapons", "HasBuildOptions", "ExtractsMetal", "EnergyMake", "RadarDist", "SonarDist", "SightDist", "CanFly", "Tooltip", - "Equiv_ARM", "Equiv_COR", "Equiv_LEG" - }, ",")) - - sideTotals = { [SIDES.ARMADA]=0, [SIDES.CORTEX]=0, [SIDES.LEGION]=0 } - sideComplete = { [SIDES.ARMADA]=0, [SIDES.CORTEX]=0, [SIDES.LEGION]=0 } - uncategorizedUnits = { [SIDES.ARMADA]={}, [SIDES.CORTEX]={}, [SIDES.LEGION]={}, ["UNKNOWN"]={} } - - -- Iterate the minimal data, but fetch details from UnitDefs - for unitNameLower, buildingCoreData in pairs(masterBuildingDataMinimal) do - local unitDef = UnitDefs[buildingCoreData.unitDefID] - if unitDef then - -- Extract core data provided by logic.lua - local categoryName = buildingCoreData.categoryName - local translatedHumanName = buildingCoreData.translatedHumanName - local side = buildingCoreData.side - local name = buildingCoreData.name -- which is unitNameLower - local equivalents = buildingCoreData.equivalents - - -- Fetch details directly from UnitDef - local tooltip = unitDef.translatedTooltip or "" - tooltip = tooltip:gsub("\n", " "):gsub("\t", " ") - tooltip = tooltip:sub(1, 100) - local tier = (unitDef.customParams and unitDef.customParams.techlevel) or "1" - local isBuilding = "Yes" -- Assumed based on the loop in logic.lua - local metalCost = unitDef.metalCost or 0 - local energyCost = unitDef.energyCost or 0 - local buildTime = unitDef.buildTime or 0 - local health = unitDef.health or 0 - local speed = 0 -- Buildings don't move - local hasWeapons = (unitDef.weapons and #unitDef.weapons > 0) and "Yes" or "No" - local hasBuildOptions = (unitDef.buildOptions and #unitDef.buildOptions > 0) and "Yes" or "No" - local extractsMetal = unitDef.extractsMetal or 0 - local energyMake = unitDef.energyMake or 0 - local radarDist = unitDef.radarDistance or 0 - local sonarDist = unitDef.sonarDistance or 0 - local sightDist = unitDef.losRadius or 0 - local canFly = false -- Buildings don't fly - - local equivArm = equivalents[SIDES.ARMADA] or "" - local equivCor = equivalents[SIDES.CORTEX] or "" - local equivLeg = equivalents[SIDES.LEGION] or "" - - local reportLine = table.concat({ - escapeCsvField(categoryName), escapeCsvField(translatedHumanName), - escapeCsvField(side or "???"), escapeCsvField(tier), escapeCsvField(isBuilding), - escapeCsvField(name), - metalCost, energyCost, buildTime, - health, speed, escapeCsvField(hasWeapons), - escapeCsvField(hasBuildOptions), extractsMetal, energyMake, - radarDist, sonarDist, sightDist, escapeCsvField(canFly), - escapeCsvField(tooltip), - escapeCsvField(equivArm), escapeCsvField(equivCor), escapeCsvField(equivLeg) - }, ",") - - -- Add line to table instead of echoing - table.insert(reportLines, reportLine) - - -- Side totals logic remains the same, using 'side' derived earlier - if side == SIDES.ARMADA or side == SIDES.CORTEX or side == SIDES.LEGION then - sideTotals[side] = (sideTotals[side] or 0) + 1 - if categoryName ~= "Misc" then - sideComplete[side] = (sideComplete[side] or 0) + 1 - else - table.insert(uncategorizedUnits[side], reportLine) - end - else - table.insert(uncategorizedUnits["UNKNOWN"], reportLine) - end - else - Spring.Log("BlueprintReports", "warning", "[Mapping Report] Could not find UnitDef for ID: " .. tostring(buildingCoreData.unitDefID) .. " Name: " .. unitNameLower); - end - end - - table.insert(reportLines, "\n--- Mapping Report Summary (Buildings Only) ---") - for side, total in pairs(sideTotals) do - local complete = sideComplete[side] or 0 - local percentage = total > 0 and (complete / total * 100) or 0 - table.insert(reportLines, string.format("[Mapping Report Summary] %s: %d / %d buildings categorized (%.2f%%)", side, complete, total, percentage)) - end - local unknownCount = #uncategorizedUnits["UNKNOWN"] - if unknownCount > 0 then - table.insert(reportLines, string.format("[Mapping Report Summary] Buildings with UNKNOWN side: %d", unknownCount)) - end - table.insert(reportLines, "--- Blueprint Mapping Report End ---") - - echoChunked(reportLines) + Spring.Echo("\n--- Blueprint Mapping Report Start (CSV Format) ---") + local SIDES = substitutionLogic.SIDES + local masterBuildingDataMinimal = substitutionLogic.MasterBuildingData + local reportLines = {} + + -- Add Header + table.insert( + reportLines, + table.concat({ + "Category", + "DescName", + "Side", + "Tier", + "Building", + "Name", + "MetalCost", + "EnergyCost", + "BuildTime", + "Health", + "Speed", + "HasWeapons", + "HasBuildOptions", + "ExtractsMetal", + "EnergyMake", + "RadarDist", + "SonarDist", + "SightDist", + "CanFly", + "Tooltip", + "Equiv_ARM", + "Equiv_COR", + "Equiv_LEG", + }, ",") + ) + + sideTotals = { [SIDES.ARMADA] = 0, [SIDES.CORTEX] = 0, [SIDES.LEGION] = 0 } + sideComplete = { [SIDES.ARMADA] = 0, [SIDES.CORTEX] = 0, [SIDES.LEGION] = 0 } + uncategorizedUnits = { [SIDES.ARMADA] = {}, [SIDES.CORTEX] = {}, [SIDES.LEGION] = {}, ["UNKNOWN"] = {} } + + -- Iterate the minimal data, but fetch details from UnitDefs + for unitNameLower, buildingCoreData in pairs(masterBuildingDataMinimal) do + local unitDef = UnitDefs[buildingCoreData.unitDefID] + if unitDef then + -- Extract core data provided by logic.lua + local categoryName = buildingCoreData.categoryName + local translatedHumanName = buildingCoreData.translatedHumanName + local side = buildingCoreData.side + local name = buildingCoreData.name -- which is unitNameLower + local equivalents = buildingCoreData.equivalents + + -- Fetch details directly from UnitDef + local tooltip = unitDef.translatedTooltip or "" + tooltip = tooltip:gsub("\n", " "):gsub("\t", " ") + tooltip = tooltip:sub(1, 100) + local tier = (unitDef.customParams and unitDef.customParams.techlevel) or "1" + local isBuilding = "Yes" -- Assumed based on the loop in logic.lua + local metalCost = unitDef.metalCost or 0 + local energyCost = unitDef.energyCost or 0 + local buildTime = unitDef.buildTime or 0 + local health = unitDef.health or 0 + local speed = 0 -- Buildings don't move + local hasWeapons = (unitDef.weapons and #unitDef.weapons > 0) and "Yes" or "No" + local hasBuildOptions = (unitDef.buildOptions and #unitDef.buildOptions > 0) and "Yes" or "No" + local extractsMetal = unitDef.extractsMetal or 0 + local energyMake = unitDef.energyMake or 0 + local radarDist = unitDef.radarDistance or 0 + local sonarDist = unitDef.sonarDistance or 0 + local sightDist = unitDef.losRadius or 0 + local canFly = false -- Buildings don't fly + + local equivArm = equivalents[SIDES.ARMADA] or "" + local equivCor = equivalents[SIDES.CORTEX] or "" + local equivLeg = equivalents[SIDES.LEGION] or "" + + local reportLine = table.concat({ + escapeCsvField(categoryName), + escapeCsvField(translatedHumanName), + escapeCsvField(side or "???"), + escapeCsvField(tier), + escapeCsvField(isBuilding), + escapeCsvField(name), + metalCost, + energyCost, + buildTime, + health, + speed, + escapeCsvField(hasWeapons), + escapeCsvField(hasBuildOptions), + extractsMetal, + energyMake, + radarDist, + sonarDist, + sightDist, + escapeCsvField(canFly), + escapeCsvField(tooltip), + escapeCsvField(equivArm), + escapeCsvField(equivCor), + escapeCsvField(equivLeg), + }, ",") + + -- Add line to table instead of echoing + table.insert(reportLines, reportLine) + + -- Side totals logic remains the same, using 'side' derived earlier + if side == SIDES.ARMADA or side == SIDES.CORTEX or side == SIDES.LEGION then + sideTotals[side] = (sideTotals[side] or 0) + 1 + if categoryName ~= "Misc" then + sideComplete[side] = (sideComplete[side] or 0) + 1 + else + table.insert(uncategorizedUnits[side], reportLine) + end + else + table.insert(uncategorizedUnits["UNKNOWN"], reportLine) + end + else + Spring.Log("BlueprintReports", "warning", "[Mapping Report] Could not find UnitDef for ID: " .. tostring(buildingCoreData.unitDefID) .. " Name: " .. unitNameLower) + end + end + + table.insert(reportLines, "\n--- Mapping Report Summary (Buildings Only) ---") + for side, total in pairs(sideTotals) do + local complete = sideComplete[side] or 0 + local percentage = total > 0 and (complete / total * 100) or 0 + table.insert(reportLines, string.format("[Mapping Report Summary] %s: %d / %d buildings categorized (%.2f%%)", side, complete, total, percentage)) + end + local unknownCount = #uncategorizedUnits["UNKNOWN"] + if unknownCount > 0 then + table.insert(reportLines, string.format("[Mapping Report Summary] Buildings with UNKNOWN side: %d", unknownCount)) + end + table.insert(reportLines, "--- Blueprint Mapping Report End ---") + + echoChunked(reportLines) end function REPORTS.generateCategoryListReport() - Spring.Echo("\n--- Blueprint Category List Start ---") - - local UNIT_CATEGORIES = substitutionLogic.UNIT_CATEGORIES - local categoryUnits = substitutionLogic.categoryUnits - local SIDES = substitutionLogic.SIDES - - local sortedCategories = {} - for enumName, categoryName in pairs(UNIT_CATEGORIES) do - table.insert(sortedCategories, {enum = enumName, cat = categoryName}) - end - table.sort(sortedCategories, function(a,b) return a.cat < b.cat end) - - local reportLines = {} - local header = string.format("Found %d defined categories:", #sortedCategories) - table.insert(reportLines, header) - Spring.Log("BlueprintReports", "info", "[Category List] " .. header) - - for _, entry in ipairs(sortedCategories) do - local categoryName = entry.cat - local sideUnits = categoryUnits[categoryName] - table.insert(reportLines, string.format("\nCategory: %s (Enum: %s)", categoryName, entry.enum)) - if sideUnits then - local armUnit = sideUnits[SIDES.ARMADA] or "(none)" - local coreUnit = sideUnits[SIDES.CORTEX] or "(none)" - local legionUnit = sideUnits[SIDES.LEGION] or "(none)" - table.insert(reportLines, string.format(" ARMADA: %s", armUnit)) - table.insert(reportLines, string.format(" CORTEX: %s", coreUnit)) - table.insert(reportLines, string.format(" LEGION: %s", legionUnit)) - else - table.insert(reportLines, " (No side units defined for this category name)") - end - end - - table.insert(reportLines, "--- Blueprint Category List End ---") - - echoChunked(reportLines) + Spring.Echo("\n--- Blueprint Category List Start ---") + + local UNIT_CATEGORIES = substitutionLogic.UNIT_CATEGORIES + local categoryUnits = substitutionLogic.categoryUnits + local SIDES = substitutionLogic.SIDES + + local sortedCategories = {} + for enumName, categoryName in pairs(UNIT_CATEGORIES) do + table.insert(sortedCategories, { enum = enumName, cat = categoryName }) + end + table.sort(sortedCategories, function(a, b) + return a.cat < b.cat + end) + + local reportLines = {} + local header = string.format("Found %d defined categories:", #sortedCategories) + table.insert(reportLines, header) + Spring.Log("BlueprintReports", "info", "[Category List] " .. header) + + for _, entry in ipairs(sortedCategories) do + local categoryName = entry.cat + local sideUnits = categoryUnits[categoryName] + table.insert(reportLines, string.format("\nCategory: %s (Enum: %s)", categoryName, entry.enum)) + if sideUnits then + local armUnit = sideUnits[SIDES.ARMADA] or "(none)" + local coreUnit = sideUnits[SIDES.CORTEX] or "(none)" + local legionUnit = sideUnits[SIDES.LEGION] or "(none)" + table.insert(reportLines, string.format(" ARMADA: %s", armUnit)) + table.insert(reportLines, string.format(" CORTEX: %s", coreUnit)) + table.insert(reportLines, string.format(" LEGION: %s", legionUnit)) + else + table.insert(reportLines, " (No side units defined for this category name)") + end + end + + table.insert(reportLines, "--- Blueprint Category List End ---") + + echoChunked(reportLines) end -return REPORTS \ No newline at end of file +return REPORTS diff --git a/luaui/Include/grassPatches.lua b/luaui/Include/grassPatches.lua index a141aaa8741..e01868768bd 100644 --- a/luaui/Include/grassPatches.lua +++ b/luaui/Include/grassPatches.lua @@ -1,190 +1,3069 @@ local geometrydata = {} -geometrydata[1] = { - 19.9253,-0.3833,-5.5756,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -15.0340,-0.3833,14.6081,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -11.7273,16.8366,20.3354,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -11.7273,16.8366,20.3354,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 23.2319,16.8365,0.1517,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - 19.9253,-0.3833,-5.5756,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -14.8705,-0.3833,14.8913,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 20.0888,-0.3833,-5.2924,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 16.7821,16.8365,-11.0198,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 16.7821,16.8365,-11.0198,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -18.1772,16.8365,9.1640,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - -14.8705,-0.3833,14.8913,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 19.8347,-0.3833,4.6970,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -15.1245,-0.3833,-15.4867,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -18.4312,16.8366,-9.7594,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -18.4312,16.8366,-9.7594,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 16.5280,16.8365,10.4243,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - 19.8347,-0.3833,4.6970,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -15.2880,-0.3833,-15.2036,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 19.6712,-0.3833,4.9802,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 22.9779,16.8365,-0.7471,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 22.9779,16.8365,-0.7471,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -11.9814,16.8365,-20.9309,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - -15.2880,-0.3833,-15.2036,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -6.1704,-0.3833,20.5802,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -6.1704,-0.3833,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -12.7837,16.8366,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -12.7837,16.8366,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - -12.7837,16.8365,20.5802,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - -6.1704,-0.3833,20.5802,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -6.4974,-0.3833,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -6.4974,-0.3833,20.5802,0,1.0000,0,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 0.1159,16.8365,20.5802,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 0.1159,16.8365,20.5802,0,1.0000,0,0,0,0,0,0,0,0.0019,0.9876,0,0,0, - 0.1159,16.8365,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.9984,0.9876,0,0,0, - -6.4974,-0.3833,-19.7872,0,1.0000,0,0,0,0,0,0,0,0.9984,0.0028,0,0,0, +geometrydata[1] = { + 19.9253, + -0.3833, + -5.5756, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -15.0340, + -0.3833, + 14.6081, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -11.7273, + 16.8366, + 20.3354, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -11.7273, + 16.8366, + 20.3354, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 23.2319, + 16.8365, + 0.1517, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + 19.9253, + -0.3833, + -5.5756, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -14.8705, + -0.3833, + 14.8913, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 20.0888, + -0.3833, + -5.2924, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 16.7821, + 16.8365, + -11.0198, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 16.7821, + 16.8365, + -11.0198, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -18.1772, + 16.8365, + 9.1640, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + -14.8705, + -0.3833, + 14.8913, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 19.8347, + -0.3833, + 4.6970, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -15.1245, + -0.3833, + -15.4867, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -18.4312, + 16.8366, + -9.7594, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -18.4312, + 16.8366, + -9.7594, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 16.5280, + 16.8365, + 10.4243, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + 19.8347, + -0.3833, + 4.6970, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -15.2880, + -0.3833, + -15.2036, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 19.6712, + -0.3833, + 4.9802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 22.9779, + 16.8365, + -0.7471, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 22.9779, + 16.8365, + -0.7471, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -11.9814, + 16.8365, + -20.9309, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + -15.2880, + -0.3833, + -15.2036, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -6.1704, + -0.3833, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -6.1704, + -0.3833, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -12.7837, + 16.8366, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -12.7837, + 16.8366, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + -12.7837, + 16.8365, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + -6.1704, + -0.3833, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -6.4974, + -0.3833, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -6.4974, + -0.3833, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 0.1159, + 16.8365, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 0.1159, + 16.8365, + 20.5802, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9876, + 0, + 0, + 0, + 0.1159, + 16.8365, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9876, + 0, + 0, + 0, + -6.4974, + -0.3833, + -19.7872, + 0, + 1.0000, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, } - -geometrydata[4] = { - -14.8090,-0.0012,1.0914,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -5.5186,-0.0012,-17.9567,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -8.6393,9.0392,-19.4787,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -8.6393,9.0392,-19.4787,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -17.9296,9.0392,-0.4307,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -14.8090,-0.0012,1.0914,0.8390,0.3585,0.4092,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -5.6729,-0.0012,-18.0320,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -14.9633,-0.0012,1.0161,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -11.8427,9.0392,2.5381,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -11.8427,9.0392,2.5381,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -2.5523,9.0392,-16.5100,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -5.6729,-0.0012,-18.0320,-0.8390,0.3585,-0.4092,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -17.7854,-0.0012,-3.4063,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 3.3559,-0.0012,-4.8847,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 3.1137,9.0392,-8.3482,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 3.1137,9.0392,-8.3482,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -18.0276,9.0392,-6.8699,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -17.7854,-0.0012,-3.4063,0.0651,0.3585,0.9312,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 3.3439,-0.0012,-5.0559,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -17.7974,-0.0012,-3.5776,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -17.5552,9.0392,-0.1140,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -17.5552,9.0392,-0.1140,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 3.5861,9.0392,-1.5924,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 3.3439,-0.0012,-5.0559,-0.0651,0.3585,-0.9312,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -11.1297,-0.0012,-17.9539,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 0.7212,-0.0012,-0.3842,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 3.5996,9.0392,-2.3257,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 3.5996,9.0392,-2.3257,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -8.2513,9.0392,-19.8954,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -11.1297,-0.0012,-17.9539,-0.7739,0.3585,0.5220,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 0.8635,-0.0012,-0.4802,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -10.9874,-0.0012,-18.0499,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -13.8658,9.0392,-16.1084,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -13.8658,9.0392,-16.1084,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -2.0149,9.0392,1.4613,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 0.8635,-0.0012,-0.4802,0.7739,0.3585,-0.5220,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 3.6502,-0.0012,12.7368,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -17.2208,-0.0012,9.0567,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -17.8237,9.0392,12.4759,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -17.8237,9.0392,12.4759,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 3.0473,9.0392,16.1560,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 3.6502,-0.0012,12.7368,0.1621,0.3585,-0.9193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -17.2506,-0.0012,9.2257,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 3.6204,-0.0012,12.9058,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 4.2233,9.0392,9.4866,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 4.2233,9.0392,9.4866,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -16.6477,9.0392,5.8065,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -17.2506,-0.0012,9.2257,-0.1621,0.3585,0.9193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 0.1471,-0.0012,16.8376,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -7.1013,-0.0012,-3.0772,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -10.3639,9.0392,-1.8897,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -10.3639,9.0392,-1.8897,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -3.1155,9.0392,18.0251,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 0.1471,-0.0012,16.8376,0.8772,0.3585,-0.3193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -7.2626,-0.0012,-3.0185,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -0.0142,-0.0012,16.8963,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 3.2484,9.0392,15.7088,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 3.2484,9.0392,15.7088,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -4.0000,9.0392,-4.2060,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -7.2626,-0.0012,-3.0185,-0.8772,0.3585,0.3193,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -15.6714,-0.0012,14.4496,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -2.0489,-0.0012,-1.7851,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -4.7086,9.0392,-4.0168,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -4.7086,9.0392,-4.0168,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -18.3311,9.0392,12.2179,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -15.6714,-0.0012,14.4496,0.7151,0.3585,0.6001,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -2.1804,-0.0012,-1.8954,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -15.8029,-0.0012,14.3393,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -13.1432,9.0392,16.5711,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -13.1432,9.0392,16.5711,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 0.4793,9.0392,0.3363,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -2.1804,-0.0012,-1.8954,-0.7151,0.3585,-0.6001,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 14.9866,-0.0012,-17.5038,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 5.0372,-0.0012,1.2084,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 8.1028,9.0392,2.8384,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 8.1028,9.0392,2.8384,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 18.0522,9.0392,-15.8738,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 14.9866,-0.0012,-17.5038,-0.8243,0.3585,-0.4383,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 5.1887,-0.0012,1.2890,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 15.1382,-0.0012,-17.4233,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 12.0726,9.0392,-19.0533,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 12.0726,9.0392,-19.0533,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 2.1231,9.0392,-0.3410,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 5.1887,-0.0012,1.2890,0.8243,0.3585,0.4383,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 17.8042,-0.0012,-12.9050,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -3.3758,-0.0012,-12.1654,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -3.2546,9.0392,-8.6955,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -3.2546,9.0392,-8.6955,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 17.9254,9.0392,-9.4351,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 17.8042,-0.0012,-12.9050,-0.0326,0.3585,-0.9330,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -3.3698,-0.0012,-11.9938,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 17.8102,-0.0012,-12.7335,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 17.6891,9.0392,-16.2033,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 17.6891,9.0392,-16.2033,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -3.4909,9.0392,-15.4637,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -3.3698,-0.0012,-11.9938,0.0326,0.3585,0.9330,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 10.6450,-0.0012,1.4014,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -0.5856,-0.0012,-16.5712,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -3.5300,9.0392,-14.7313,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -3.5300,9.0392,-14.7313,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 7.7005,9.0392,3.2413,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 10.6450,-0.0012,1.4014,0.7917,0.3585,-0.4947,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -0.7312,-0.0012,-16.4802,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 10.4994,-0.0012,1.4924,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 13.4438,9.0392,-0.3475,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 13.4438,9.0392,-0.3475,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 2.2133,9.0392,-18.3201,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -0.7312,-0.0012,-16.4802,-0.7917,0.3585,0.4947,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 14.4134,-0.0012,16.0154,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -0.3084,-0.0012,0.7705,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -2.8060,9.0392,3.1823,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -2.8060,9.0392,3.1823,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 11.9158,9.0392,18.4272,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 14.4134,-0.0012,16.0154,0.6715,0.3585,-0.6485,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -0.4319,-0.0012,0.8897,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 14.2899,-0.0012,16.1346,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 16.7875,9.0392,13.7228,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 16.7875,9.0392,13.7228,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 2.0656,9.0392,-1.5221,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -0.4319,-0.0012,0.8897,-0.6715,0.3585,0.6485,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 9.1690,-0.0012,17.2740,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 15.0105,-0.0012,-3.0980,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 11.6730,9.0392,-4.0550,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 11.6730,9.0392,-4.0550,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 5.8315,9.0392,16.3170,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 9.1690,-0.0012,17.2740,0.8974,0.3585,0.2573,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 14.8455,-0.0012,-3.1453,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 9.0039,-0.0012,17.2267,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 12.3414,9.0392,18.1837,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 12.3414,9.0392,18.1837,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 18.1830,9.0392,-2.1883,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 14.8455,-0.0012,-3.1453,-0.8974,0.3585,-0.2573,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -2.2249,-0.0012,6.0441,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 18.3385,-0.0012,0.9171,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - 17.4985,9.0392,-2.4517,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 17.4985,9.0392,-2.4517,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -3.0649,9.0392,2.6753,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - -2.2249,-0.0012,6.0441,0.2258,0.3585,0.9058,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - 18.2970,-0.0012,0.7505,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.9984,0.0028,0,0,0, - -2.2665,-0.0012,5.8776,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.0019,0.0028,0,0,0, - -1.4265,9.0392,9.2464,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - -1.4265,9.0392,9.2464,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.0019,0.9976,0,0,0, - 19.1369,9.0392,4.1194,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.9984,0.9976,0,0,0, - 18.2970,-0.0012,0.7505,-0.2258,0.3585,-0.9058,0,0,0,0,0,0,0.9984,0.0028,0,0,0, +geometrydata[4] = { + -14.8090, + -0.0012, + 1.0914, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -5.5186, + -0.0012, + -17.9567, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -8.6393, + 9.0392, + -19.4787, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -8.6393, + 9.0392, + -19.4787, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -17.9296, + 9.0392, + -0.4307, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -14.8090, + -0.0012, + 1.0914, + 0.8390, + 0.3585, + 0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -5.6729, + -0.0012, + -18.0320, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -14.9633, + -0.0012, + 1.0161, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -11.8427, + 9.0392, + 2.5381, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -11.8427, + 9.0392, + 2.5381, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -2.5523, + 9.0392, + -16.5100, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -5.6729, + -0.0012, + -18.0320, + -0.8390, + 0.3585, + -0.4092, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -17.7854, + -0.0012, + -3.4063, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 3.3559, + -0.0012, + -4.8847, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 3.1137, + 9.0392, + -8.3482, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 3.1137, + 9.0392, + -8.3482, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -18.0276, + 9.0392, + -6.8699, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -17.7854, + -0.0012, + -3.4063, + 0.0651, + 0.3585, + 0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 3.3439, + -0.0012, + -5.0559, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -17.7974, + -0.0012, + -3.5776, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -17.5552, + 9.0392, + -0.1140, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -17.5552, + 9.0392, + -0.1140, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 3.5861, + 9.0392, + -1.5924, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 3.3439, + -0.0012, + -5.0559, + -0.0651, + 0.3585, + -0.9312, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -11.1297, + -0.0012, + -17.9539, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 0.7212, + -0.0012, + -0.3842, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 3.5996, + 9.0392, + -2.3257, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 3.5996, + 9.0392, + -2.3257, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -8.2513, + 9.0392, + -19.8954, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -11.1297, + -0.0012, + -17.9539, + -0.7739, + 0.3585, + 0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 0.8635, + -0.0012, + -0.4802, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -10.9874, + -0.0012, + -18.0499, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -13.8658, + 9.0392, + -16.1084, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -13.8658, + 9.0392, + -16.1084, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -2.0149, + 9.0392, + 1.4613, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 0.8635, + -0.0012, + -0.4802, + 0.7739, + 0.3585, + -0.5220, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 3.6502, + -0.0012, + 12.7368, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -17.2208, + -0.0012, + 9.0567, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -17.8237, + 9.0392, + 12.4759, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -17.8237, + 9.0392, + 12.4759, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 3.0473, + 9.0392, + 16.1560, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 3.6502, + -0.0012, + 12.7368, + 0.1621, + 0.3585, + -0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -17.2506, + -0.0012, + 9.2257, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 3.6204, + -0.0012, + 12.9058, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 4.2233, + 9.0392, + 9.4866, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 4.2233, + 9.0392, + 9.4866, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -16.6477, + 9.0392, + 5.8065, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -17.2506, + -0.0012, + 9.2257, + -0.1621, + 0.3585, + 0.9193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 0.1471, + -0.0012, + 16.8376, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -7.1013, + -0.0012, + -3.0772, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -10.3639, + 9.0392, + -1.8897, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -10.3639, + 9.0392, + -1.8897, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -3.1155, + 9.0392, + 18.0251, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 0.1471, + -0.0012, + 16.8376, + 0.8772, + 0.3585, + -0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -7.2626, + -0.0012, + -3.0185, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -0.0142, + -0.0012, + 16.8963, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 3.2484, + 9.0392, + 15.7088, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 3.2484, + 9.0392, + 15.7088, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -4.0000, + 9.0392, + -4.2060, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -7.2626, + -0.0012, + -3.0185, + -0.8772, + 0.3585, + 0.3193, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -15.6714, + -0.0012, + 14.4496, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -2.0489, + -0.0012, + -1.7851, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -4.7086, + 9.0392, + -4.0168, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -4.7086, + 9.0392, + -4.0168, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -18.3311, + 9.0392, + 12.2179, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -15.6714, + -0.0012, + 14.4496, + 0.7151, + 0.3585, + 0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -2.1804, + -0.0012, + -1.8954, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -15.8029, + -0.0012, + 14.3393, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -13.1432, + 9.0392, + 16.5711, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -13.1432, + 9.0392, + 16.5711, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 0.4793, + 9.0392, + 0.3363, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -2.1804, + -0.0012, + -1.8954, + -0.7151, + 0.3585, + -0.6001, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 14.9866, + -0.0012, + -17.5038, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 5.0372, + -0.0012, + 1.2084, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 8.1028, + 9.0392, + 2.8384, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 8.1028, + 9.0392, + 2.8384, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 18.0522, + 9.0392, + -15.8738, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 14.9866, + -0.0012, + -17.5038, + -0.8243, + 0.3585, + -0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 5.1887, + -0.0012, + 1.2890, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 15.1382, + -0.0012, + -17.4233, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 12.0726, + 9.0392, + -19.0533, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 12.0726, + 9.0392, + -19.0533, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 2.1231, + 9.0392, + -0.3410, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 5.1887, + -0.0012, + 1.2890, + 0.8243, + 0.3585, + 0.4383, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 17.8042, + -0.0012, + -12.9050, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -3.3758, + -0.0012, + -12.1654, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -3.2546, + 9.0392, + -8.6955, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -3.2546, + 9.0392, + -8.6955, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 17.9254, + 9.0392, + -9.4351, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 17.8042, + -0.0012, + -12.9050, + -0.0326, + 0.3585, + -0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -3.3698, + -0.0012, + -11.9938, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 17.8102, + -0.0012, + -12.7335, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 17.6891, + 9.0392, + -16.2033, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 17.6891, + 9.0392, + -16.2033, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -3.4909, + 9.0392, + -15.4637, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -3.3698, + -0.0012, + -11.9938, + 0.0326, + 0.3585, + 0.9330, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 10.6450, + -0.0012, + 1.4014, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -0.5856, + -0.0012, + -16.5712, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -3.5300, + 9.0392, + -14.7313, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -3.5300, + 9.0392, + -14.7313, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 7.7005, + 9.0392, + 3.2413, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 10.6450, + -0.0012, + 1.4014, + 0.7917, + 0.3585, + -0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -0.7312, + -0.0012, + -16.4802, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 10.4994, + -0.0012, + 1.4924, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 13.4438, + 9.0392, + -0.3475, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 13.4438, + 9.0392, + -0.3475, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 2.2133, + 9.0392, + -18.3201, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -0.7312, + -0.0012, + -16.4802, + -0.7917, + 0.3585, + 0.4947, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 14.4134, + -0.0012, + 16.0154, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -0.3084, + -0.0012, + 0.7705, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -2.8060, + 9.0392, + 3.1823, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -2.8060, + 9.0392, + 3.1823, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 11.9158, + 9.0392, + 18.4272, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 14.4134, + -0.0012, + 16.0154, + 0.6715, + 0.3585, + -0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -0.4319, + -0.0012, + 0.8897, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 14.2899, + -0.0012, + 16.1346, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 16.7875, + 9.0392, + 13.7228, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 16.7875, + 9.0392, + 13.7228, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 2.0656, + 9.0392, + -1.5221, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -0.4319, + -0.0012, + 0.8897, + -0.6715, + 0.3585, + 0.6485, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 9.1690, + -0.0012, + 17.2740, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 15.0105, + -0.0012, + -3.0980, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 11.6730, + 9.0392, + -4.0550, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 11.6730, + 9.0392, + -4.0550, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 5.8315, + 9.0392, + 16.3170, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 9.1690, + -0.0012, + 17.2740, + 0.8974, + 0.3585, + 0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 14.8455, + -0.0012, + -3.1453, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 9.0039, + -0.0012, + 17.2267, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 12.3414, + 9.0392, + 18.1837, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 12.3414, + 9.0392, + 18.1837, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 18.1830, + 9.0392, + -2.1883, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 14.8455, + -0.0012, + -3.1453, + -0.8974, + 0.3585, + -0.2573, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -2.2249, + -0.0012, + 6.0441, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 18.3385, + -0.0012, + 0.9171, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + 17.4985, + 9.0392, + -2.4517, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 17.4985, + 9.0392, + -2.4517, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -3.0649, + 9.0392, + 2.6753, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + -2.2249, + -0.0012, + 6.0441, + 0.2258, + 0.3585, + 0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + 18.2970, + -0.0012, + 0.7505, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, + -2.2665, + -0.0012, + 5.8776, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.0028, + 0, + 0, + 0, + -1.4265, + 9.0392, + 9.2464, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + -1.4265, + 9.0392, + 9.2464, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0019, + 0.9976, + 0, + 0, + 0, + 19.1369, + 9.0392, + 4.1194, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.9976, + 0, + 0, + 0, + 18.2970, + -0.0012, + 0.7505, + -0.2258, + 0.3585, + -0.9058, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9984, + 0.0028, + 0, + 0, + 0, } -return geometrydata \ No newline at end of file +return geometrydata diff --git a/luaui/Include/instancevbotable.lua b/luaui/Include/instancevbotable.lua index 2da5042ecce..ebeff53351d 100644 --- a/luaui/Include/instancevbotable.lua +++ b/luaui/Include/instancevbotable.lua @@ -2,34 +2,33 @@ local dest = widget or gadget if not LuaVBOTableNewLocationMessageShown then local info = dest.GetInfo() - local name = info and info.name or 'unknown' + local name = info and info.name or "unknown" local msg = "A user widget (" .. name .. ") is including LuaUI/Include/instancevbotable.lua directly, please change it to use gl.InstanceVBOTable instead." - Spring.Log('UserWidget', LOG.DEPRECATED, msg) + Spring.Log("UserWidget", LOG.DEPRECATED, msg) LuaVBOTableNewLocationMessageShown = true end local InstanceVBOTable = gl.InstanceVBOTable -dest.makeInstanceVBOTable = InstanceVBOTable.makeInstanceVBOTable -dest.clearInstanceTable = InstanceVBOTable.clearInstanceTable -dest.makeVAOandAttach = InstanceVBOTable.makeVAOandAttach -dest.locateInvalidUnits = InstanceVBOTable.locateInvalidUnits -dest.pushElementInstance = InstanceVBOTable.pushElementInstance -dest.popElementInstance = InstanceVBOTable.popElementInstance +dest.makeInstanceVBOTable = InstanceVBOTable.makeInstanceVBOTable +dest.clearInstanceTable = InstanceVBOTable.clearInstanceTable +dest.makeVAOandAttach = InstanceVBOTable.makeVAOandAttach +dest.locateInvalidUnits = InstanceVBOTable.locateInvalidUnits +dest.pushElementInstance = InstanceVBOTable.pushElementInstance +dest.popElementInstance = InstanceVBOTable.popElementInstance dest.getElementInstanceData = InstanceVBOTable.getElementInstanceData -dest.uploadAllElements = InstanceVBOTable.uploadAllElements -dest.uploadElementRange = InstanceVBOTable.uploadElementRange -dest.compactInstanceVBO = InstanceVBOTable.compactInstanceVBO -dest.drawInstanceVBO = InstanceVBOTable.drawInstanceVBO -dest.makeCircleVBO = InstanceVBOTable.makeCircleVBO -dest.makePlaneVBO = InstanceVBOTable.makePlaneVBO -dest.makePlaneIndexVBO = InstanceVBOTable.makePlaneIndexVBO -dest.makePointVBO = InstanceVBOTable.makePointVBO -dest.makeRectVBO = InstanceVBOTable.makeRectVBO -dest.makeRectIndexVBO = InstanceVBOTable.makeRectIndexVBO -dest.makeConeVBO = InstanceVBOTable.makeConeVBO -dest.makeCylinderVBO = InstanceVBOTable.makeCylinderVBO -dest.makeBoxVBO = InstanceVBOTable.makeBoxVBO -dest.makeSphereVBO = InstanceVBOTable.makeSphereVBO -dest.MakeTexRectVAO = InstanceVBOTable.MakeTexRectVAO - +dest.uploadAllElements = InstanceVBOTable.uploadAllElements +dest.uploadElementRange = InstanceVBOTable.uploadElementRange +dest.compactInstanceVBO = InstanceVBOTable.compactInstanceVBO +dest.drawInstanceVBO = InstanceVBOTable.drawInstanceVBO +dest.makeCircleVBO = InstanceVBOTable.makeCircleVBO +dest.makePlaneVBO = InstanceVBOTable.makePlaneVBO +dest.makePlaneIndexVBO = InstanceVBOTable.makePlaneIndexVBO +dest.makePointVBO = InstanceVBOTable.makePointVBO +dest.makeRectVBO = InstanceVBOTable.makeRectVBO +dest.makeRectIndexVBO = InstanceVBOTable.makeRectIndexVBO +dest.makeConeVBO = InstanceVBOTable.makeConeVBO +dest.makeCylinderVBO = InstanceVBOTable.makeCylinderVBO +dest.makeBoxVBO = InstanceVBOTable.makeBoxVBO +dest.makeSphereVBO = InstanceVBOTable.makeSphereVBO +dest.MakeTexRectVAO = InstanceVBOTable.MakeTexRectVAO diff --git a/luaui/Include/minimap_utils.lua b/luaui/Include/minimap_utils.lua index c79d1d0fd00..5a4ca1c9cf0 100644 --- a/luaui/Include/minimap_utils.lua +++ b/luaui/Include/minimap_utils.lua @@ -10,22 +10,26 @@ local PI_HALF = math.pi / 2 local PI_THREE_HALF = 3 * math.pi / 2 local function getMiniMapFlipped() - if not spGetMiniMapRotation then return false end + if not spGetMiniMapRotation then + return false + end local rot = spGetMiniMapRotation() - return rot > PI_HALF and rot <= PI_THREE_HALF; + return rot > PI_HALF and rot <= PI_THREE_HALF end local ROTATION = { - DEG_0 = 0, -- 0 degrees - DEG_90 = 1, -- 90 degrees clockwise - DEG_180 = 2, -- 180 degrees - DEG_270 = 3 -- 270 degrees clockwise (or 90 degrees counter-clockwise) + DEG_0 = 0, -- 0 degrees + DEG_90 = 1, -- 90 degrees clockwise + DEG_180 = 2, -- 180 degrees + DEG_270 = 3, -- 270 degrees clockwise (or 90 degrees counter-clockwise) } local function getCurrentMiniMapRotationOption() -- Spring.GetMiniMapRotation() returns rads, instead here we return iterations of 90 degrees (0, 1, 2, 3) - if not spGetMiniMapRotation then return ROTATION.NONE end + if not spGetMiniMapRotation then + return ROTATION.NONE + end return math_floor((spGetMiniMapRotation() / math.pi * 2 + 0.5) % 4) end @@ -36,12 +40,12 @@ local function minimapToWorld(x, y, vpy, dualScreen) x = x + sx + px end x = ((x - px) / sx) - local z = (1 - (y - py + vpy)/sy) + local z = (1 - (y - py + vpy) / sy) local currRot = getCurrentMiniMapRotationOption() if currRot == ROTATION.DEG_90 then -- rotate 90 degrees - x,z = z,x + x, z = z, x x = 1 - x elseif currRot == ROTATION.DEG_180 then -- rotate 180 degrees x = 1 - x diff --git a/luaui/Include/select_api.lua b/luaui/Include/select_api.lua index ec677c7f8e6..b3c2d794fae 100644 --- a/luaui/Include/select_api.lua +++ b/luaui/Include/select_api.lua @@ -4,8 +4,8 @@ --- @field getCommand fun(cmd: string): any local SelectApi = {} -local defaultdamagetag = Game.armorTypes['default'] -local vtoldamagetag = Game.armorTypes['vtol'] +local defaultdamagetag = Game.armorTypes["default"] +local vtoldamagetag = Game.armorTypes["vtol"] local spGetUnitIsCloaked = Spring.GetUnitIsCloaked local spGetUnitCommands = Spring.GetUnitCommands @@ -55,11 +55,7 @@ local function logError(message) end local function isBuilder(udef) - return (udef.canReclaim and udef.reclaimSpeed > 0) or - (udef.canResurrect and udef.resurrectSpeed > 0) or - (udef.canRepair and udef.repairSpeed > 0) or - (udef.buildOptions and udef.buildOptions[1]) or - (udef.canStockpile and udef.modCategories.ship and udef.modCategories.noweapon) -- carrier ships + return (udef.canReclaim and udef.reclaimSpeed > 0) or (udef.canResurrect and udef.resurrectSpeed > 0) or (udef.canRepair and udef.repairSpeed > 0) or (udef.buildOptions and udef.buildOptions[1]) or (udef.canStockpile and udef.modCategories.ship and udef.modCategories.noweapon) -- carrier ships end local function invertCurry(invert, filter, args) @@ -133,7 +129,7 @@ local function parseFilter(filterDef) local tokenLower = string.lower(token) if tokenLower == "not" then - invert = true; + invert = true token = getNextToken() tokenLower = string.lower(token) end @@ -252,7 +248,7 @@ local function parseFilter(filterDef) end for _name, weapondef in pairs(udef.wDefs) do - if (weapondef.damages[vtoldamagetag] > weapondef.damages[defaultdamagetag]) then + if weapondef.damages[vtoldamagetag] > weapondef.damages[defaultdamagetag] then return true end end @@ -295,7 +291,7 @@ local function parseFilter(filterDef) break end - local udefid = UnitDefNames[name]; + local udefid = UnitDefNames[name] if udefid then idMatchesSet[udefid] = true @@ -399,8 +395,12 @@ local function getMouseWorldPos() local mouseX, mouseY = spGetMouseState() local desc, args = spTraceScreenRay(mouseX, mouseY, true) - if nil == desc then return end -- off map - if nil == args then return end + if nil == desc then + return + end -- off map + if nil == args then + return + end local x = args[1] local y = args[2] @@ -448,7 +448,7 @@ local function getCountUnits(uids, countUntil, appendSelected) -- break after full cycle or countUntil reached if countUnitsIndex == countUnitsIndexStart or selectedCount >= countUntil then - break; + break end end @@ -475,7 +475,6 @@ local function parseNumber(input, fn) end end - local function parseConclusion(conclusionDef) local appendSelected = true local prefix = conclusionDef:sub(1, 15) diff --git a/luaui/Include/unitBlocking.lua b/luaui/Include/unitBlocking.lua index fd917afa4bb..626b4737b8b 100644 --- a/luaui/Include/unitBlocking.lua +++ b/luaui/Include/unitBlocking.lua @@ -12,7 +12,9 @@ local unitBlocking = {} --- local specificBlocked = unitBlocking.getBlockedUnitDefs({123, 456}) function unitBlocking.getBlockedUnitDefs(unitDefIDs) local myTeamID = Spring.GetMyTeamID() - if not myTeamID then return {} end + if not myTeamID then + return {} + end local teamRules = Spring.GetTeamRulesParams(myTeamID) or {} local blockedUnits = {} diff --git a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua index b2debde4f09..6e24af73563 100644 --- a/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua +++ b/luaui/RmlWidgets/gui_quick_start/gui_quick_start.lua @@ -24,16 +24,13 @@ end local startingMetal = modOptions.startmetal or 1000 -local shouldRunWidget = modOptions.quick_start == "enabled" or - modOptions.quick_start == "factory_discount" or - (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) +local shouldRunWidget = modOptions.quick_start == "enabled" or modOptions.quick_start == "factory_discount" or (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) if not shouldRunWidget then return false end -local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" or - (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) +local shouldApplyFactoryDiscount = modOptions.quick_start == "factory_discount" or (modOptions.quick_start == "default" and (modOptions.temp_enable_territorial_domination or modOptions.deathmode == "territorial_domination")) local spGetGameRulesParam = Spring.GetGameRulesParam local spGetMyTeamID = Spring.GetMyTeamID @@ -45,8 +42,8 @@ local MODEL_NAME = "quick_start_model" local RML_PATH = "luaui/RmlWidgets/gui_quick_start/gui_quick_start.rml" local QUICK_START_CONDITION_KEY = "quickStartUnallocatedBudget" -local ENERGY_VALUE_CONVERSION_MULTIPLIER = 1/60 --60 being the energy conversion rate of t2 energy converters, statically defined so future changes not to affect this. -local BUILD_TIME_VALUE_CONVERSION_MULTIPLIER = 1/300 --300 being a representative of commander workertime, statically defined so future com unitdef adjustments don't change this. +local ENERGY_VALUE_CONVERSION_MULTIPLIER = 1 / 60 --60 being the energy conversion rate of t2 energy converters, statically defined so future changes not to affect this. +local BUILD_TIME_VALUE_CONVERSION_MULTIPLIER = 1 / 300 --300 being a representative of commander workertime, statically defined so future com unitdef adjustments don't change this. local DEFAULT_INSTANT_BUILD_RANGE = 500 local TRAVERSABILITY_GRID_RESOLUTION = 32 local GRID_CHECK_RESOLUTION_MULTIPLIER = 1 @@ -75,11 +72,7 @@ local function linesHaveChanged(newLines, oldLines) for i, newLine in ipairs(newLines) do local oldLine = oldLines[i] - if not oldLine or - newLine.A ~= oldLine.A or - newLine.B ~= oldLine.B or - newLine.C ~= oldLine.C or - newLine.originVal ~= oldLine.originVal then + if not oldLine or newLine.A ~= oldLine.A or newLine.B ~= oldLine.B or newLine.C ~= oldLine.C or newLine.originVal ~= oldLine.originVal then return true end end @@ -91,9 +84,9 @@ local function updateSpawnPositions(spawnPositions) if not spawnPositions then return end - + local hasChanged = false - + for teamID, oldPos in pairs(externalSpawnPositions) do if not spawnPositions[teamID] then hasChanged = true @@ -105,7 +98,7 @@ local function updateSpawnPositions(spawnPositions) break end end - + if not hasChanged then for teamID, newPos in pairs(spawnPositions) do if not externalSpawnPositions[teamID] then @@ -114,20 +107,20 @@ local function updateSpawnPositions(spawnPositions) end end end - + if not hasChanged then return end - + externalSpawnPositions = {} for teamID, pos in pairs(spawnPositions) do if pos.x and pos.z then - externalSpawnPositions[teamID] = {x = pos.x, z = pos.z} + externalSpawnPositions[teamID] = { x = pos.x, z = pos.z } end end - + externalSpawnPositionsChanged = true - + if WG["pregame-build"] and WG["pregame-build"].forceRefresh then WG["pregame-build"].forceRefresh() end @@ -163,15 +156,15 @@ local function updateDisplayList(commanderX, commanderZ) gl.DeleteList(overlapLinesDisplayList) overlapLinesDisplayList = nil end - + local gameRules = getCachedGameRules() local buildRadius = gameRules.instantBuildRange or DEFAULT_INSTANT_BUILD_RANGE - + if #cachedOverlapLines == 0 then overlapLinesDisplayList = createBuildRangeCircleDisplayList(commanderX, commanderZ, buildRadius) return end - + local drawingSegments = overlapLines.getDrawingSegments(cachedOverlapLines, commanderX, commanderZ, buildRadius) if not drawingSegments or #drawingSegments == 0 then overlapLinesDisplayList = createBuildRangeCircleDisplayList(commanderX, commanderZ, buildRadius) @@ -199,7 +192,7 @@ local function updateDisplayList(commanderX, commanderZ) end end) end - + gl.Color(1, 1, 1, 1) gl.LineWidth(1) end) @@ -252,7 +245,9 @@ local initialModel = { local function calculateBudgetWithDiscount(unitDefID, factoryDiscountAmount, shouldApplyDiscount, isFirstFactory) local unitDef = UnitDefs[unitDefID] - if not unitDef then return 0 end + if not unitDef then + return 0 + end local metalCost = unitDef.metalCost or 0 local energyCost = unitDef.energyCost or 0 @@ -306,19 +301,19 @@ local function updateTraversabilityGrid() lastCommanderZ = nil return end - + if lastCommanderX ~= commanderX or lastCommanderZ ~= commanderZ or externalSpawnPositionsChanged then externalSpawnPositionsChanged = false local gameRules = getCachedGameRules() traversabilityGrid.generateTraversableGrid(commanderX, commanderZ, gameRules.traversabilityGridRange, TRAVERSABILITY_GRID_RESOLUTION, "myGrid") - + local neighbors = {} for otherTeamID, pos in pairs(externalSpawnPositions) do if otherTeamID ~= myTeamID and pos.x and pos.z then - table.insert(neighbors, {x = pos.x, z = pos.z}) + table.insert(neighbors, { x = pos.x, z = pos.z }) end end - + local gameRules = getCachedGameRules() local newOverlapLines = overlapLines.getOverlapLines(commanderX, commanderZ, neighbors, gameRules.instantBuildRange or DEFAULT_INSTANT_BUILD_RANGE) @@ -330,7 +325,7 @@ local function updateTraversabilityGrid() A = line.A, B = line.B, C = line.C, - originVal = line.originVal + originVal = line.originVal, } end end @@ -338,7 +333,7 @@ local function updateTraversabilityGrid() cachedOverlapLines = newOverlapLines hasOverlapLines = true updateDisplayList(commanderX, commanderZ) - + lastCommanderX = commanderX lastCommanderZ = commanderZ end @@ -351,32 +346,29 @@ local function updateUIElementText(document, elementId, text) end end - local function showDeductionAnimation(deductionAmount) local currentIndex = widgetState.currentDeductionIndex local deductionElement = widgetState.deductionElements[currentIndex] - + if not deductionElement then return end - + local nextIndex = currentIndex % 5 + 1 local nextElement = widgetState.deductionElements[nextIndex] - + if nextElement then nextElement:SetClass("animate", false) -- we have to remove the animate class on a different frame than we add it, otherwise it doesn't play. end - + local modelKey = "deductionAmount" .. currentIndex widgetState.dmHandle[modelKey] = "-" .. tostring(math.floor(deductionAmount)) - + deductionElement:SetClass("animate", true) - + widgetState.currentDeductionIndex = nextIndex end - - local function createBudgetBarElements() if not widgetState.document then return @@ -389,14 +381,14 @@ local function createBudgetBarElements() widgetState.budgetBarElements.fillElement = fillElement widgetState.budgetBarElements.projectedElement = projectedElement end - + for i = 1, 5 do local deductionElement = widgetState.document:GetElementById("qs-deduction-amount-" .. i) if deductionElement then widgetState.deductionElements[i] = deductionElement end end - + local warningTextElement = widgetState.document:GetElementById("qs-warning-text") local factoryTextElement = widgetState.document:GetElementById("qs-factory-text") local refundOverlayElement = widgetState.document:GetElementById("qs-budget-refund-overlay") @@ -463,10 +455,9 @@ local function computeProjectedUsage() if buildPositions and #buildPositions > 0 then positionsToCheck = buildPositions else - local _, pos = Spring.TraceScreenRay(mx, my, true, false, false, - uDef.modCategories and uDef.modCategories.underwater) + local _, pos = Spring.TraceScreenRay(mx, my, true, false, false, uDef.modCategories and uDef.modCategories.underwater) if pos then - positionsToCheck = {{x = pos[1], y = pos[2], z = pos[3]}} + positionsToCheck = { { x = pos[1], y = pos[2], z = pos[3] } } end end @@ -533,8 +524,8 @@ local function updateUnitCostOverride(unitDefID, unitDef, gameRules, factoryAlre bottom = { value = budgetCost, color = "\255\255\110\255", - colorDisabled = "\255\200\50\200" - } + colorDisabled = "\255\200\50\200", + }, } if wgBuildMenu and wgBuildMenu.setCostOverride then @@ -569,11 +560,10 @@ local function updateAllCostOverrides(force) end end - if not force and widgetState.lastFactoryAlreadyPlaced == factoryAlreadyPlaced then return end - + local stateChanged = (widgetState.lastFactoryAlreadyPlaced ~= nil) and (widgetState.lastFactoryAlreadyPlaced ~= factoryAlreadyPlaced) widgetState.lastFactoryAlreadyPlaced = factoryAlreadyPlaced @@ -590,14 +580,15 @@ local function updateAllCostOverrides(force) end local function updateDataModel(forceUpdate) - if not widgetState.dmHandle then return end + if not widgetState.dmHandle then + return + end local buildQueue = wgPregameBuild and wgPregameBuild.getBuildQueue and wgPregameBuild.getBuildQueue() or {} local currentQueueLength = #buildQueue local currentTime = os.clock() - if not forceUpdate and widgetState.lastQueueLength == currentQueueLength and - (currentTime - widgetState.lastUpdate) < widgetState.updateInterval then + if not forceUpdate and widgetState.lastQueueLength == currentQueueLength and (currentTime - widgetState.lastUpdate) < widgetState.updateInterval then return end @@ -609,7 +600,7 @@ local function updateDataModel(forceUpdate) if forceUpdate or currentQueueLength ~= widgetState.lastQueueLength then updateAllCostOverrides(forceUpdate) end - + if currentQueueLength > widgetState.lastQueueLength then if currentBudgetRemaining < widgetState.lastBudgetRemaining then if modelUpdate.budgetTotal >= modelUpdate.budgetUsed then @@ -621,16 +612,16 @@ local function updateDataModel(forceUpdate) Spring.PlaySoundFile("cmd-build", 1.0, nil, nil, nil, nil, nil, nil, "ui") end end - + if widgetState.lastBudgetRemaining > currentBudgetRemaining then local deductionAmount = widgetState.lastBudgetRemaining - currentBudgetRemaining showDeductionAnimation(deductionAmount) hideWarnings() end - + widgetState.lastQueueLength = currentQueueLength widgetState.lastBudgetRemaining = currentBudgetRemaining - + local gameRules = getCachedGameRules() local budgetThreshold = gameRules.budgetThresholdToAllowStart or 0 local budgetUsed = modelUpdate.budgetUsed or 0 @@ -669,7 +660,7 @@ local function updateDataModel(forceUpdate) if widgetState.document then local budgetPercent = widgetState.dmHandle.budgetPercent or 0 local budgetRemaining = math.floor(widgetState.dmHandle.budgetRemaining or 0) - + if widgetState.budgetBarElements.fillElement then widgetState.budgetBarElements.fillElement:SetAttribute("style", "width: " .. string.format("%.1f%%", budgetPercent)) end @@ -694,43 +685,43 @@ local function getBuildQueueSpawnStatus(buildQueue, selectedBuildData) local gameRules = getCachedGameRules() local spawnResults = { queueSpawned = {}, - selectedSpawned = false + selectedSpawned = false, } - + local remainingBudget = gameRules.budgetTotal local firstFactoryPlaced = false local commanderX, commanderZ = getCommanderPosition(myTeamID) - + if buildQueue and #buildQueue > 0 then for i = 1, #buildQueue do local queueItem = buildQueue[i] local unitDefID = queueItem[1] local isSpawned = false - + if unitDefID and unitDefID > 0 and UnitDefs[unitDefID] then local buildX, buildZ = queueItem[2], queueItem[4] - + if isWithinBuildRange(commanderX, commanderZ, buildX, buildZ, gameRules.instantBuildRange) then local budgetCost = calculateBudgetForItem(unitDefID, gameRules, shouldApplyFactoryDiscount, not firstFactoryPlaced) - + if remainingBudget >= budgetCost then isSpawned = true remainingBudget = remainingBudget - budgetCost - + if UnitDefs[unitDefID].isFactory and not firstFactoryPlaced then firstFactoryPlaced = true end end end end - + spawnResults.queueSpawned[i] = isSpawned end end if selectedBuildData and selectedBuildData[1] and selectedBuildData[1] > 0 then local unitDefID = selectedBuildData[1] local buildX, buildZ = selectedBuildData[2], selectedBuildData[4] - + if isWithinBuildRange(commanderX, commanderZ, buildX, buildZ, gameRules.instantBuildRange) then local budgetCost = calculateBudgetForItem(unitDefID, gameRules, shouldApplyFactoryDiscount, not firstFactoryPlaced) spawnResults.selectedSpawned = remainingBudget >= budgetCost @@ -738,12 +729,11 @@ local function getBuildQueueSpawnStatus(buildQueue, selectedBuildData) spawnResults.selectedSpawned = false end end - + return spawnResults end function widget:Initialize() - local isSpectating = Spring.GetSpectatingState() if isSpectating then widgetHandler:RemoveWidget(self) @@ -760,7 +750,6 @@ function widget:Initialize() end widgetState.dmHandle = dm - local document = widgetState.rmlContext:LoadDocument(RML_PATH) if not document then widget:Shutdown() @@ -769,23 +758,25 @@ function widget:Initialize() widgetState.document = document document:Show() - wgBuildMenu = WG['buildmenu'] - wgGridMenu = WG['gridmenu'] - wgTopbar = WG['topbar'] - wgPregameBuild = WG['pregame-build'] - wgPregameUI = WG['pregameui'] - wgPregameUIDraft = WG['pregameui_draft'] + wgBuildMenu = WG["buildmenu"] + wgGridMenu = WG["gridmenu"] + wgTopbar = WG["topbar"] + wgPregameBuild = WG["pregame-build"] + wgPregameUI = WG["pregameui"] + wgPregameUIDraft = WG["pregameui_draft"] wgGetBuildQueueFunc = wgPregameBuild and wgPregameBuild.getBuildQueue wgGetBuildPositionsFunc = wgPregameBuild and wgPregameBuild.getBuildPositions - wgGetPregameUnitSelectedFunc = function() return WG['pregame-unit-selected'] or -1 end + wgGetPregameUnitSelectedFunc = function() + return WG["pregame-unit-selected"] or -1 + end + + updateUIElementText(document, "qs-budget-header", spI18N("ui.quickStart.preGameResources")) + updateUIElementText(document, "qs-warning-text", spI18N("ui.quickStart.remainingResourcesWarning")) - updateUIElementText(document, "qs-budget-header", spI18N('ui.quickStart.preGameResources')) - updateUIElementText(document, "qs-warning-text", spI18N('ui.quickStart.remainingResourcesWarning')) - local factoryTextElement = document:GetElementById("qs-factory-text") if factoryTextElement then if shouldApplyFactoryDiscount then - updateUIElementText(document, "qs-factory-text", spI18N('ui.quickStart.placeDiscountedFactory')) + updateUIElementText(document, "qs-factory-text", spI18N("ui.quickStart.placeDiscountedFactory")) factoryTextElement:SetClass("visible", true) else factoryTextElement:SetAttribute("style", "display: none;") @@ -793,7 +784,7 @@ function widget:Initialize() end createBudgetBarElements() - + local warningTextElement = document:GetElementById("qs-warning-text") if warningTextElement then warningTextElement:SetClass("visible", true) @@ -866,7 +857,7 @@ function widget:Update() widgetHandler:RemoveWidget(self) return end - + updateDataModel(false) local currentTime = os.clock() if (currentTime - widgetState.lastWidgetUpdate) < widgetState.widgetUpdateInterval then @@ -885,11 +876,13 @@ end function widget:RecvLuaMsg(message, playerID) local document = widgetState.document - if not document then return end - - if message:sub(1, 19) == 'LobbyOverlayActive0' then + if not document then + return + end + + if message:sub(1, 19) == "LobbyOverlayActive0" then document:Show() - elseif message:sub(1, 19) == 'LobbyOverlayActive1' then + elseif message:sub(1, 19) == "LobbyOverlayActive1" then document:Hide() end end diff --git a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua index 9745a85b104..a0506c8a5a1 100644 --- a/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua +++ b/luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.lua @@ -5,11 +5,11 @@ end local widget = widget local spGetViewGeometry = Spring.GetViewGeometry -local spSetConfigInt = Spring.SetConfigInt -local spGetConfigInt = Spring.GetConfigInt +local spSetConfigInt = Spring.SetConfigInt +local spGetConfigInt = Spring.GetConfigInt -- Drag state (position saved/loaded via RmlUi — no Spring mouse callbacks needed) -local hasUserPosition = false -- true once user has dragged or a saved position was loaded +local hasUserPosition = false -- true once user has dragged or a saved position was loaded function widget:GetInfo() return { @@ -24,8 +24,12 @@ function widget:GetInfo() end local modOptions = Spring.GetModOptions() -if modOptions.deathmode ~= "territorial_domination" then return false end -if Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers() then return false end +if modOptions.deathmode ~= "territorial_domination" then + return false +end +if Spring.Utilities.Gametype.IsRaptors() or Spring.Utilities.Gametype.IsScavengers() then + return false +end local MODEL_NAME = "territorial_score_model" local RML_PATH = "luaui/RmlWidgets/gui_territorial_domination/gui_territorial_domination.rml" @@ -112,7 +116,7 @@ local initialModel = { pointsCap = 0, eliminationThreshold = 0, timeRemaining = TIME_ZERO_STRING, - roundDisplayText = spI18N('ui.territorialDomination.round.displayDefault', { maxRounds = DEFAULT_MAX_ROUNDS }), + roundDisplayText = spI18N("ui.territorialDomination.round.displayDefault", { maxRounds = DEFAULT_MAX_ROUNDS }), timeRemainingSeconds = 0, isCountdownWarning = false, territoryCount = 0, @@ -151,35 +155,35 @@ end local function getAIName(teamID) local _, _, _, name, _, options = spGetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) - + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) + if niceName then name = niceName - + if Spring.Utilities.ShowDevUI() and options.profile then name = name .. " [" .. options.profile .. "]" end end - - return Spring.I18N('ui.playersList.aiName', { name = name }) + + return Spring.I18N("ui.playersList.aiName", { name = name }) end local function fetchAllyTeamPlayerNames(allyTeamID) local teamList = spGetTeamList(allyTeamID) if not teamList or #teamList == 0 then - return spI18N('ui.territorialDomination.team.ally', { allyNumber = allyTeamID + 1 }) + return spI18N("ui.territorialDomination.team.ally", { allyNumber = allyTeamID + 1 }) end - + local playerNames = {} local seenPlayerIDs = {} local myTeamID = Spring.GetMyTeamID() local mySpecStatus = spGetSpectatingState() local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode - + for i = 1, #teamList do local teamID = teamList[i] local _, playerID, _, isAI = spGetTeamInfo(teamID, false) - + if isAI then local name = getAIName(teamID) local r, g, b = spGetTeamColor(teamID) @@ -189,15 +193,15 @@ local function fetchAllyTeamPlayerNames(allyTeamID) local anonymousColorB = Spring.GetConfigInt("anonymousColorB", 0) / COLOR_BYTE_MAX r, g, b = anonymousColorR, anonymousColorG, anonymousColorB end - + local rByte = math.floor(r * COLOR_BYTE_MAX) local gByte = math.floor(g * COLOR_BYTE_MAX) local bByte = math.floor(b * COLOR_BYTE_MAX) local colorHex = string.format("#%02X%02X%02X", rByte, gByte, bByte) - + table.insert(playerNames, { name = name, - color = colorHex + color = colorHex, }) elseif playerID and not seenPlayerIDs[playerID] then seenPlayerIDs[playerID] = true @@ -206,7 +210,7 @@ local function fetchAllyTeamPlayerNames(allyTeamID) if WG.playernames and WG.playernames.getPlayername then name = WG.playernames.getPlayername(playerID) or name end - + local r, g, b = spGetTeamColor(teamID) if (not mySpecStatus) and anonymousMode ~= "disabled" and teamID ~= myTeamID then local anonymousColorR = Spring.GetConfigInt("anonymousColorR", COLOR_BYTE_MAX) / COLOR_BYTE_MAX @@ -214,24 +218,24 @@ local function fetchAllyTeamPlayerNames(allyTeamID) local anonymousColorB = Spring.GetConfigInt("anonymousColorB", 0) / COLOR_BYTE_MAX r, g, b = anonymousColorR, anonymousColorG, anonymousColorB end - + local rByte = math.floor(r * COLOR_BYTE_MAX) local gByte = math.floor(g * COLOR_BYTE_MAX) local bByte = math.floor(b * COLOR_BYTE_MAX) local colorHex = string.format("#%02X%02X%02X", rByte, gByte, bByte) - + table.insert(playerNames, { name = name, - color = colorHex + color = colorHex, }) end end end - + if #playerNames == 0 then - return spI18N('ui.territorialDomination.team.ally', { allyNumber = allyTeamID + 1 }) + return spI18N("ui.territorialDomination.team.ally", { allyNumber = allyTeamID + 1 }) end - + return playerNames end @@ -239,8 +243,8 @@ local function getAllyTeamPlayerNames(allyTeamID) if widgetState.cachedPlayerNames[allyTeamID] then return widgetState.cachedPlayerNames[allyTeamID] end - - local fallbackName = spI18N('ui.territorialDomination.team.ally', { allyNumber = allyTeamID + 1 }) + + local fallbackName = spI18N("ui.territorialDomination.team.ally", { allyNumber = allyTeamID + 1 }) widgetState.cachedPlayerNames[allyTeamID] = fallbackName return fallbackName end @@ -249,7 +253,7 @@ local function getAllyTeamColor(allyTeamID) if widgetState.cachedTeamColors[allyTeamID] then return widgetState.cachedTeamColors[allyTeamID] end - + local teamList = spGetTeamList(allyTeamID) if teamList and #teamList > 0 then local teamID = teamList[1] @@ -258,9 +262,9 @@ local function getAllyTeamColor(allyTeamID) widgetState.cachedTeamColors[allyTeamID] = color return color end - + local defaultColor = { r = DEFAULT_COLOR_VALUE, g = DEFAULT_COLOR_VALUE, b = DEFAULT_COLOR_VALUE } - + local existingTeam = nil for i = 1, #widgetState.allyTeamData do if widgetState.allyTeamData[i].allyTeamID == allyTeamID then @@ -268,25 +272,31 @@ local function getAllyTeamColor(allyTeamID) break end end - + if existingTeam and existingTeam.color then widgetState.cachedTeamColors[allyTeamID] = existingTeam.color return existingTeam.color end - + widgetState.cachedTeamColors[allyTeamID] = defaultColor return defaultColor end local function isPlayerInFirstPlace() local myTeamID = Spring.GetMyTeamID() - if myTeamID == nil then return false end + if myTeamID == nil then + return false + end local myAllyTeamID = Spring.GetMyAllyTeamID() - if myAllyTeamID == nil then return false end + if myAllyTeamID == nil then + return false + end local allyTeams = widgetState.allyTeamData - if #allyTeams == 0 then return false end + if #allyTeams == 0 then + return false + end return allyTeams[1].allyTeamID == myAllyTeamID end @@ -297,21 +307,21 @@ local function buildLeaderboardRow(team, rank, isEliminated, isDead) if isDead then row:SetClass("eliminated", true) end - + local teamColor = team.color or { r = DEFAULT_TEAM_COLOR, g = DEFAULT_TEAM_COLOR, b = DEFAULT_TEAM_COLOR } local rByte = math.floor(teamColor.r * COLOR_BYTE_MAX) local gByte = math.floor(teamColor.g * COLOR_BYTE_MAX) local bByte = math.floor(teamColor.b * COLOR_BYTE_MAX) local bgColor = string.format("rgba(%d, %d, %d, %d)", rByte, gByte, bByte, COLOR_BACKGROUND_ALPHA) row:SetAttribute("style", "background-color: " .. bgColor .. ";") - + local rankDiv = widgetState.document:CreateElement("div") rankDiv.class_name = "scoreboard-rank" rankDiv.inner_rml = "#" .. tostring(rank) - + local nameDiv = widgetState.document:CreateElement("div") nameDiv.class_name = "scoreboard-name" - + if type(team.name) == "table" then for i = 1, #team.name do local playerName = team.name[i] @@ -327,7 +337,7 @@ local function buildLeaderboardRow(team, rank, isEliminated, isDead) else nameDiv.inner_rml = team.name or "" end - + local totalDiv = widgetState.document:CreateElement("div") totalDiv.class_name = "scoreboard-score" local previousScore = team.score or 0 @@ -346,24 +356,29 @@ local function buildLeaderboardRow(team, rank, isEliminated, isDead) row:AppendChild(nameDiv) row:AppendChild(totalDiv) row:AppendChild(territoriesDiv) - + return row end - local function updateLeaderboard() - if not widgetState.document then return end - + if not widgetState.document then + return + end + local leaderboardPanel = widgetState.document:GetElementById("leaderboard-panel") - if not leaderboardPanel then return end - + if not leaderboardPanel then + return + end + local teamsContainer = widgetState.document:GetElementById("leaderboard-teams") local eliminatedContainer = widgetState.document:GetElementById("leaderboard-eliminated") local separatorElement = widgetState.document:GetElementById("elimination-separator") local separatorTextElement = widgetState.document:GetElementById("elimination-separator-text") - - if not teamsContainer or not eliminatedContainer or not separatorElement or not separatorTextElement then return end - + + if not teamsContainer or not eliminatedContainer or not separatorElement or not separatorTextElement then + return + end + while teamsContainer:HasChildNodes() do local child = teamsContainer:GetChild(0) if child then @@ -372,7 +387,7 @@ local function updateLeaderboard() break end end - + while eliminatedContainer:HasChildNodes() do local child = eliminatedContainer:GetChild(0) if child then @@ -381,48 +396,50 @@ local function updateLeaderboard() break end end - + local allyTeams = widgetState.allyTeamData - if not allyTeams or #allyTeams == 0 then return end - + if not allyTeams or #allyTeams == 0 then + return + end + local dataModel = widgetState.dmHandle local eliminationThreshold = spGetGameRulesParam("territorialDominationEliminationThreshold") or 0 - + local livingTeams = {} local eliminatedTeams = {} - + for i = 1, #allyTeams do local team = allyTeams[i] local combinedScore = (team.score or 0) + (team.projectedPoints or 0) local isEliminated = false - + if eliminationThreshold > 0 then isEliminated = not team.isAlive or combinedScore < eliminationThreshold else isEliminated = not team.isAlive end - + if isEliminated then table.insert(eliminatedTeams, { team = team, rank = i }) else table.insert(livingTeams, { team = team, rank = i }) end end - + for i = 1, #livingTeams do local entry = livingTeams[i] local displayRank = entry.team.rank or i local row = buildLeaderboardRow(entry.team, displayRank, false, not entry.team.isAlive) teamsContainer:AppendChild(row) end - + if eliminationThreshold > 0 and dataModel and not dataModel.isFinalRound then - separatorTextElement.inner_rml = spI18N('ui.territorialDomination.elimination.threshold', { threshold = eliminationThreshold }) + separatorTextElement.inner_rml = spI18N("ui.territorialDomination.elimination.threshold", { threshold = eliminationThreshold }) separatorElement:SetClass("hidden", false) else separatorElement:SetClass("hidden", true) end - + if #eliminatedTeams > 0 then for i = 1, #eliminatedTeams do local entry = eliminatedTeams[i] @@ -434,22 +451,30 @@ local function updateLeaderboard() end local function showLeaderboard() - if not widgetState.document then return end - + if not widgetState.document then + return + end + local leaderboardPanel = widgetState.document:GetElementById("leaderboard-panel") - if not leaderboardPanel then return end - + if not leaderboardPanel then + return + end + widgetState.isLeaderboardVisible = true leaderboardPanel:SetClass("hidden", false) updateLeaderboard() end local function hideLeaderboard() - if not widgetState.document then return end - + if not widgetState.document then + return + end + local leaderboardPanel = widgetState.document:GetElementById("leaderboard-panel") - if not leaderboardPanel then return end - + if not leaderboardPanel then + return + end + widgetState.isLeaderboardVisible = false leaderboardPanel:SetClass("hidden", true) end @@ -460,7 +485,7 @@ local function checkDocumentVisibility() local _, _, isClientPaused, _ = Spring.GetGameState() local isGameStarted = currentTime > 0 local shouldShow = pointsCap and pointsCap > 0 and isGameStarted and not isClientPaused and not widgetState.hiddenByLobby and widgetState.hasValidAdvPlayerListPosition - + if widgetState.document then if shouldShow and not widgetState.isDocumentVisible then widgetState.document:Show() @@ -470,14 +495,16 @@ local function checkDocumentVisibility() widgetState.isDocumentVisible = false end end - + if pointsCap ~= widgetState.lastPointsCap then widgetState.lastPointsCap = pointsCap end end local function calculateUILayout() - if not widgetState.document then return end + if not widgetState.document then + return + end -- If the user has a saved position, respect it — don't auto-anchor if hasUserPosition then @@ -486,17 +513,17 @@ local function calculateUILayout() return end - local advPlayerListAPI = WG['advplayerlist_api'] + local advPlayerListAPI = WG["advplayerlist_api"] local topElement = nil - if WG['playertv'] and WG['playertv'].GetPosition and (WG['playertv'].isActive == nil or WG['playertv'].isActive()) then - topElement = WG['playertv'] - elseif WG['displayinfo'] and WG['displayinfo'].GetPosition then - topElement = WG['displayinfo'] - elseif WG['unittotals'] and WG['unittotals'].GetPosition then - topElement = WG['unittotals'] - elseif WG['music'] and WG['music'].GetPosition then - topElement = WG['music'] + if WG["playertv"] and WG["playertv"].GetPosition and (WG["playertv"].isActive == nil or WG["playertv"].isActive()) then + topElement = WG["playertv"] + elseif WG["displayinfo"] and WG["displayinfo"].GetPosition then + topElement = WG["displayinfo"] + elseif WG["unittotals"] and WG["unittotals"].GetPosition then + topElement = WG["unittotals"] + elseif WG["music"] and WG["music"].GetPosition then + topElement = WG["music"] elseif advPlayerListAPI and advPlayerListAPI.GetPosition then topElement = advPlayerListAPI end @@ -532,15 +559,15 @@ local function calculateUILayout() return end - local panelWidth = tdRootElement.offset_width or 240 + local panelWidth = tdRootElement.offset_width or 240 local panelHeight = tdRootElement.offset_height or 204 - local px = screenWidth - panelWidth - 10 + local px = screenWidth - panelWidth - 10 local py = anchorTopCss - panelHeight - 10 py = math.max(0, py) tdRootElement.style.left = px .. "px" - tdRootElement.style.top = py .. "px" + tdRootElement.style.top = py .. "px" checkDocumentVisibility() end @@ -561,7 +588,6 @@ local function createDataHash(data) return tostring(data) end - local function hasDataChanged(newData, cacheTable, cacheKey) local newHash = createDataHash(newData) if cacheTable[cacheKey] ~= newHash then @@ -573,7 +599,9 @@ end local function isTie() local allyTeams = widgetState.allyTeamData - if #allyTeams < 2 then return false end + if #allyTeams < 2 then + return false + end local topTeam = allyTeams[1] local topCombinedScore = topTeam.score + topTeam.projectedPoints @@ -589,13 +617,17 @@ local function isTie() end local function showRoundEndPopup(roundNumber, isFinalRound) - if not widgetState.document then return end + if not widgetState.document then + return + end local popupElement = widgetState.document:GetElementById("round-end-popup") local popupTextElement = widgetState.document:GetElementById("popup-text") local territoryInfoElement = widgetState.document:GetElementById("popup-territory-info") local eliminationInfoElement = widgetState.document:GetElementById("popup-elimination-info") - if not popupElement or not popupTextElement or not territoryInfoElement or not eliminationInfoElement then return end + if not popupElement or not popupTextElement or not territoryInfoElement or not eliminationInfoElement then + return + end local dataModel = widgetState.dmHandle local maxRounds = (dataModel and dataModel.maxRounds) or DEFAULT_MAX_ROUNDS @@ -604,19 +636,19 @@ local function showRoundEndPopup(roundNumber, isFinalRound) local popupText = "" if isFinalRound then if isTie() then - popupText = spI18N('ui.territorialDomination.round.overtime') + popupText = spI18N("ui.territorialDomination.round.overtime") elseif spGetSpectatingState() then - popupText = spI18N('ui.territorialDomination.roundOverPopup.gameOver') + popupText = spI18N("ui.territorialDomination.roundOverPopup.gameOver") elseif isPlayerInFirstPlace() then - popupText = spI18N('ui.territorialDomination.roundOverPopup.victory') + popupText = spI18N("ui.territorialDomination.roundOverPopup.victory") else - popupText = spI18N('ui.territorialDomination.roundOverPopup.defeat') + popupText = spI18N("ui.territorialDomination.roundOverPopup.defeat") end elseif roundNumber > 0 then if roundNumber == maxRounds then - popupText = spI18N('ui.territorialDomination.roundOverPopup.finalRound') + popupText = spI18N("ui.territorialDomination.roundOverPopup.finalRound") else - popupText = spI18N('ui.territorialDomination.roundOverPopup.round', { roundNumber = roundNumber }) + popupText = spI18N("ui.territorialDomination.roundOverPopup.round", { roundNumber = roundNumber }) end end @@ -629,10 +661,10 @@ local function showRoundEndPopup(roundNumber, isFinalRound) local pointsPerTerritory = (dataModel and dataModel.pointsPerTerritory) or 0 local eliminationThreshold = (dataModel and dataModel.eliminationThreshold) or 0 - territoryInfoElement.inner_rml = spI18N('ui.territorialDomination.roundOverPopup.territoryWorth', { points = pointsPerTerritory }) + territoryInfoElement.inner_rml = spI18N("ui.territorialDomination.roundOverPopup.territoryWorth", { points = pointsPerTerritory }) if eliminationThreshold > 0 and not isFinalRound then - eliminationInfoElement.inner_rml = spI18N('ui.territorialDomination.roundOverPopup.eliminationBelow', { threshold = eliminationThreshold }) + eliminationInfoElement.inner_rml = spI18N("ui.territorialDomination.roundOverPopup.eliminationBelow", { threshold = eliminationThreshold }) else eliminationInfoElement.inner_rml = "" end @@ -641,16 +673,19 @@ local function showRoundEndPopup(roundNumber, isFinalRound) popupElement.class_name = "popup-round-end visible" widgetState.popupState.isVisible = true widgetState.popupState.showTime = os.clock() - Spring.PlaySoundFile("sounds/global-events/scavlootdrop.wav", 0.8, 'ui') - Spring.PlaySoundFile("sounds/replies/servlrg3.wav", 1.0, 'ui') + Spring.PlaySoundFile("sounds/global-events/scavlootdrop.wav", 0.8, "ui") + Spring.PlaySoundFile("sounds/replies/servlrg3.wav", 1.0, "ui") end - local function hideRoundEndPopup() - if not widgetState.document then return end + if not widgetState.document then + return + end local popupElement = widgetState.document:GetElementById("round-end-popup") - if not popupElement then return end + if not popupElement then + return + end popupElement.class_name = "popup-round-end" widgetState.popupState.isVisible = false @@ -658,11 +693,15 @@ end local function getSelectedPlayerTeam() local myAllyTeamID = Spring.GetMyAllyTeamID() - if not myAllyTeamID then return nil end - + if not myAllyTeamID then + return nil + end + local teamList = spGetTeamList(myAllyTeamID) - if not teamList or #teamList < MIN_TEAM_LIST_SIZE then return nil end - + if not teamList or #teamList < MIN_TEAM_LIST_SIZE then + return nil + end + local firstTeamID = teamList[1] local score = spGetGameRulesParam("territorialDomination_ally_" .. myAllyTeamID .. "_score") or 0 local projectedPoints = spGetGameRulesParam("territorialDomination_ally_" .. myAllyTeamID .. "_projectedPoints") or 0 @@ -685,7 +724,7 @@ end local function updateAllyTeamData() local allyTeamList = spGetAllyTeamList() local validAllyTeams = {} - + for i = 1, #allyTeamList do local allyTeamID = allyTeamList[i] if allyTeamID ~= GAIA_ALLY_TEAM_ID then @@ -695,7 +734,7 @@ local function updateAllyTeamData() end end end - + for allyTeamID, _ in pairs(widgetState.knownAllyTeamIDs) do if allyTeamID ~= GAIA_ALLY_TEAM_ID then local teamList = spGetTeamList(allyTeamID) @@ -710,7 +749,7 @@ local function updateAllyTeamData() if hasTeamList then firstTeamID = teamList[1] - + for j = 1, #teamList do local _, _, isDead = spGetTeamInfo(teamList[j]) if not isDead then @@ -718,7 +757,7 @@ local function updateAllyTeamData() break end end - + teamCount = #teamList else local existingTeam = nil @@ -728,7 +767,7 @@ local function updateAllyTeamData() break end end - + if existingTeam then firstTeamID = existingTeam.firstTeamID teamCount = existingTeam.teamCount or 0 @@ -755,7 +794,6 @@ local function updateAllyTeamData() return (a.rank or FALLBACK_RANK) < (b.rank or FALLBACK_RANK) end) - widgetState.allyTeamData = validAllyTeams return validAllyTeams end @@ -781,9 +819,10 @@ local function updateRoundInfo() if roundEndTime > 0 then timeRemainingSeconds = math.max(0, roundEndTime - Spring.GetGameSeconds()) - timeString = string.format("%d:%02d", math.floor(timeRemainingSeconds / SECONDS_PER_MINUTE), - math.floor(timeRemainingSeconds % SECONDS_PER_MINUTE)) - if timeRemainingSeconds < 1 then timeString = TIME_ZERO_STRING end + timeString = string.format("%d:%02d", math.floor(timeRemainingSeconds / SECONDS_PER_MINUTE), math.floor(timeRemainingSeconds % SECONDS_PER_MINUTE)) + if timeRemainingSeconds < 1 then + timeString = TIME_ZERO_STRING + end end local isOvertime = currentRound > maxRounds @@ -794,11 +833,11 @@ local function updateRoundInfo() local roundDisplayText if isOvertime then - roundDisplayText = spI18N('ui.territorialDomination.round.displayMax', { maxRounds = maxRounds }) + roundDisplayText = spI18N("ui.territorialDomination.round.displayMax", { maxRounds = maxRounds }) elseif currentRound == 0 then - roundDisplayText = spI18N('ui.territorialDomination.round.displayDefault', { maxRounds = maxRounds }) + roundDisplayText = spI18N("ui.territorialDomination.round.displayDefault", { maxRounds = maxRounds }) else - roundDisplayText = spI18N('ui.territorialDomination.round.displayWithMax', { currentRound = currentRound, maxRounds = maxRounds }) + roundDisplayText = spI18N("ui.territorialDomination.round.displayWithMax", { currentRound = currentRound, maxRounds = maxRounds }) end return { @@ -817,12 +856,16 @@ local function updateRoundInfo() end local function updateHeaderVisibility() - if not widgetState.document then return end + if not widgetState.document then + return + end local headerElement = widgetState.document:GetElementById("header-info") local roundElement = widgetState.document:GetElementById("round-display") local timeElement = widgetState.document:GetElementById("time-display") - if not headerElement or not roundElement or not timeElement then return end + if not headerElement or not roundElement or not timeElement then + return + end local hasRoundInfo = roundElement.inner_rml and roundElement.inner_rml ~= "" local dataModel = widgetState.dmHandle @@ -840,10 +883,14 @@ local function updateHeaderVisibility() end local function updateCountdownColor() - if not widgetState.document then return end + if not widgetState.document then + return + end local timeDisplayElement = widgetState.document:GetElementById("time-display") - if not timeDisplayElement then return end + if not timeDisplayElement then + return + end local dataModel = widgetState.dmHandle if dataModel and dataModel.isCountdownWarning then @@ -860,14 +907,20 @@ local function updateCountdownColor() end local function updatePlayerDisplay() - if not widgetState.document then return end - + if not widgetState.document then + return + end + local dataModel = widgetState.dmHandle - if not dataModel then return end - + if not dataModel then + return + end + local selectedTeam = getSelectedPlayerTeam() - if not selectedTeam then return end - + if not selectedTeam then + return + end + local currentRound = dataModel.currentRound or 0 local pointsPerTerritory = currentRound > 0 and currentRound * AESTHETIC_POINTS_MULTIPLIER or AESTHETIC_POINTS_MULTIPLIER local projectedPoints = selectedTeam.projectedPoints or 0 @@ -875,11 +928,11 @@ local function updatePlayerDisplay() local currentScore = selectedTeam.score or 0 local teamName = selectedTeam.name or "" local eliminationThreshold = dataModel.eliminationThreshold or 0 - + local allyTeams = widgetState.allyTeamData local playerRank = 1 local rankDisplayText = "" - + if allyTeams and #allyTeams > 0 then for i = 1, #allyTeams do local team = allyTeams[i] @@ -888,52 +941,52 @@ local function updatePlayerDisplay() break end end - + if playerRank > 0 then - rankDisplayText = getEnglishOrdinal(playerRank) .. " " .. spI18N('ui.territorialDomination.rank.place') + rankDisplayText = getEnglishOrdinal(playerRank) .. " " .. spI18N("ui.territorialDomination.rank.place") end - - local playerCombinedScore = currentScore + projectedPoints - local eliminationText = "" - local isAboveElimination = false - local maxRounds = dataModel.maxRounds or DEFAULT_MAX_ROUNDS - local isFinalRound = (currentRound == maxRounds) or (dataModel.isFinalRound or false) - - if isFinalRound then - eliminationText = spI18N('ui.territorialDomination.elimination.finalRound') - isAboveElimination = false - elseif eliminationThreshold > 0 then - local difference = playerCombinedScore - eliminationThreshold - if difference > 0 then - eliminationText = spI18N('ui.territorialDomination.elimination.aboveElimination', { points = difference }) - isAboveElimination = true - elseif difference < 0 then - eliminationText = spI18N('ui.territorialDomination.elimination.belowElimination', { points = math.abs(difference) }) + + local playerCombinedScore = currentScore + projectedPoints + local eliminationText = "" + local isAboveElimination = false + local maxRounds = dataModel.maxRounds or DEFAULT_MAX_ROUNDS + local isFinalRound = (currentRound == maxRounds) or (dataModel.isFinalRound or false) + + if isFinalRound then + eliminationText = spI18N("ui.territorialDomination.elimination.finalRound") isAboveElimination = false + elseif eliminationThreshold > 0 then + local difference = playerCombinedScore - eliminationThreshold + if difference > 0 then + eliminationText = spI18N("ui.territorialDomination.elimination.aboveElimination", { points = difference }) + isAboveElimination = true + elseif difference < 0 then + eliminationText = spI18N("ui.territorialDomination.elimination.belowElimination", { points = math.abs(difference) }) + isAboveElimination = false + else + eliminationText = spI18N("ui.territorialDomination.elimination.zeroAboveElimination") + isAboveElimination = true + end else - eliminationText = spI18N('ui.territorialDomination.elimination.zeroAboveElimination') + eliminationText = spI18N("ui.territorialDomination.elimination.eliminationsNextRound") isAboveElimination = true end - else - eliminationText = spI18N('ui.territorialDomination.elimination.eliminationsNextRound') - isAboveElimination = true - end - + dataModel.eliminationText = eliminationText dataModel.isAboveElimination = isAboveElimination dataModel.isFinalRound = isFinalRound end - + dataModel.territoryCount = territoryCount .. " x " .. pointsPerTerritory .. "pts" dataModel.territoryPoints = projectedPoints dataModel.pointsPerTerritory = tostring(pointsPerTerritory) - dataModel.territoryWorthText = spI18N('ui.territorialDomination.territories.worth', { points = pointsPerTerritory }) + dataModel.territoryWorthText = spI18N("ui.territorialDomination.territories.worth", { points = pointsPerTerritory }) dataModel.currentScore = currentScore dataModel.combinedScore = currentScore + projectedPoints dataModel.teamName = teamName dataModel.eliminationThreshold = eliminationThreshold dataModel.rankDisplayText = rankDisplayText - + local rankDisplayElement = widgetState.document:GetElementById("rank-display") if rankDisplayElement then if rankDisplayText ~= "" then @@ -942,11 +995,10 @@ local function updatePlayerDisplay() rankDisplayElement:SetClass("hidden", true) end end - - + local eliminationWarningElement = widgetState.document:GetElementById("elimination-warning") local currentScoreElement = widgetState.document:GetElementById("current-score") - + if eliminationWarningElement then if dataModel.eliminationText ~= "" then eliminationWarningElement:SetClass("hidden", false) @@ -973,7 +1025,7 @@ local function updatePlayerDisplay() eliminationWarningElement:SetClass("hidden", true) end end - + if currentScoreElement then local isBelowElimination = false if dataModel.eliminationText ~= "" then @@ -985,7 +1037,7 @@ local function updatePlayerDisplay() isBelowElimination = true end end - + if isBelowElimination then currentScoreElement:SetClass("warning", true) currentScoreElement:SetClass("pulsing", true) @@ -999,12 +1051,12 @@ local function updatePlayerDisplay() if isNowInLead ~= widgetState.lastWasInLead then if isNowInLead then - if WG['notifications'] and WG['notifications'].addEvent then - WG['notifications'].addEvent('TerritorialDomination/GainedLead', false) + if WG["notifications"] and WG["notifications"].addEvent then + WG["notifications"].addEvent("TerritorialDomination/GainedLead", false) end else - if WG['notifications'] and WG['notifications'].addEvent then - WG['notifications'].addEvent('TerritorialDomination/LostLead', false) + if WG["notifications"] and WG["notifications"].addEvent then + WG["notifications"].addEvent("TerritorialDomination/LostLead", false) end end widgetState.lastWasInLead = isNowInLead @@ -1023,15 +1075,23 @@ end local function shouldSkipUpdate() local currentTime = Spring.GetGameSeconds() - - if currentTime <= 0 then return true end - if not widgetState.document or widgetState.hiddenByLobby or not widgetState.isDocumentVisible then return true end - + + if currentTime <= 0 then + return true + end + if not widgetState.document or widgetState.hiddenByLobby or not widgetState.isDocumentVisible then + return true + end + local pointsCap = spGetGameRulesParam("territorialDominationPointsCap") or DEFAULT_POINTS_CAP - if pointsCap <= 0 then return true end - - if currentTime == widgetState.lastGameTime then return true end - + if pointsCap <= 0 then + return true + end + + if currentTime == widgetState.lastGameTime then + return true + end + widgetState.lastGameTime = currentTime return false end @@ -1044,13 +1104,15 @@ end local function shouldUpdateTime() local currentTime = Spring.GetGameSeconds() local roundEndTime = spGetGameRulesParam("territorialDominationRoundEndTimestamp") or 0 - - if roundEndTime <= 0 then return false end - + + if roundEndTime <= 0 then + return false + end + local timeRemaining = math.max(0, roundEndTime - currentTime) local currentDisplayedSeconds = math.floor(timeRemaining) local lastDisplayedSeconds = math.floor(widgetState.lastTimeRemainingSeconds or 0) - + return currentDisplayedSeconds ~= lastDisplayedSeconds end @@ -1060,10 +1122,12 @@ local function shouldFullUpdate() end local function updateDataModel() - if not widgetState.dmHandle then return end + if not widgetState.dmHandle then + return + end checkDocumentVisibility() - + local allyTeams = updateAllyTeamData() local roundInfo = updateRoundInfo() local dataModel = widgetState.dmHandle @@ -1075,7 +1139,6 @@ local function updateDataModel() local roundChanged = hasDataChanged(roundInfo, widgetState.cachedData, "roundInfo") local timeChanged = hasDataChanged(math.floor(roundInfo.timeRemainingSeconds or 0), widgetState.cachedData, "lastTimeHash") - if roundChanged and (dataModel.currentRound or 0) ~= roundInfo.currentRound then resetCache() scoresChanged = true @@ -1099,7 +1162,7 @@ local function updateDataModel() if widgetState.document then updatePlayerDisplay() - + if scoresChanged or roundChanged then -- Data model updates already handled above if widgetState.isLeaderboardVisible then @@ -1124,62 +1187,80 @@ local function updateDataModel() end local function updateTimeOnly() - if not widgetState.document then return end - + if not widgetState.document then + return + end + local roundInfo = updateRoundInfo() local timeChanged = hasDataChanged(math.floor(roundInfo.timeRemainingSeconds or 0), widgetState.cachedData, "lastTimeHash") - + if timeChanged and widgetState.dmHandle then widgetState.dmHandle.timeRemainingSeconds = roundInfo.timeRemainingSeconds widgetState.dmHandle.isCountdownWarning = roundInfo.isCountdownWarning widgetState.dmHandle.timeRemaining = roundInfo.timeRemaining updateCountdownColor() updatePlayerDisplay() - + widgetState.lastTimeRemainingSeconds = roundInfo.timeRemainingSeconds end end local function SavePosition() - if not widgetState.document then return end - local el = widgetState.document:GetElementById("td-root") - if not el then return end - local x = el.offset_left - local y = el.offset_top - if not x or not y then return end - local vsx, vsy = spGetViewGeometry() - if not vsx or not vsy then return end - spSetConfigInt("td_posX", math.floor((x / vsx) * 10000)) - spSetConfigInt("td_posY", math.floor((y / vsy) * 10000)) - hasUserPosition = true + if not widgetState.document then + return + end + local el = widgetState.document:GetElementById("td-root") + if not el then + return + end + local x = el.offset_left + local y = el.offset_top + if not x or not y then + return + end + local vsx, vsy = spGetViewGeometry() + if not vsx or not vsy then + return + end + spSetConfigInt("td_posX", math.floor((x / vsx) * 10000)) + spSetConfigInt("td_posY", math.floor((y / vsy) * 10000)) + hasUserPosition = true end local function LoadPosition() - if not widgetState.document then return end - local el = widgetState.document:GetElementById("td-root") - if not el then return end - local vsx, vsy = spGetViewGeometry() - if not vsx or not vsy then return end - local relX = spGetConfigInt("td_posX", -1) - local relY = spGetConfigInt("td_posY", -1) - if relX == -1 or relY == -1 then - -- No saved position — default to top-right - el.style.left = math.floor(vsx * 0.85) .. "px" - el.style.top = math.floor(vsy * 0.05) .. "px" - return - end - local x = math.floor((relX / 10000) * vsx) - local y = math.floor((relY / 10000) * vsy) - x = math.max(0, math.min(math.floor(vsx * 0.90), x)) - y = math.max(0, math.min(math.floor(vsy * 0.90), y)) - el.style.left = x .. "px" - el.style.top = y .. "px" - hasUserPosition = true + if not widgetState.document then + return + end + local el = widgetState.document:GetElementById("td-root") + if not el then + return + end + local vsx, vsy = spGetViewGeometry() + if not vsx or not vsy then + return + end + local relX = spGetConfigInt("td_posX", -1) + local relY = spGetConfigInt("td_posY", -1) + if relX == -1 or relY == -1 then + -- No saved position — default to top-right + el.style.left = math.floor(vsx * 0.85) .. "px" + el.style.top = math.floor(vsy * 0.05) .. "px" + return + end + local x = math.floor((relX / 10000) * vsx) + local y = math.floor((relY / 10000) * vsy) + x = math.max(0, math.min(math.floor(vsx * 0.90), x)) + y = math.max(0, math.min(math.floor(vsy * 0.90), y)) + el.style.left = x .. "px" + el.style.top = y .. "px" + hasUserPosition = true end function widget:Initialize() widgetState.rmlContext = RmlUi.GetContext("shared") - if not widgetState.rmlContext then return false end + if not widgetState.rmlContext then + return false + end local dmHandle = widgetState.rmlContext:OpenDataModel(MODEL_NAME, initialModel, self) if not dmHandle then @@ -1189,7 +1270,7 @@ function widget:Initialize() widgetState.dmHandle = dmHandle - local language = Spring.GetConfigString('language', 'en') + local language = Spring.GetConfigString("language", "en") local document = widgetState.rmlContext:LoadDocument(RML_PATH, self) if not document then @@ -1200,38 +1281,46 @@ function widget:Initialize() widgetState.document = document -- Drag state (local to initialize closure, matching modtools alert-panel pattern) - local dragActive = false + local dragActive = false local dragOffsetX = 0 local dragOffsetY = 0 - local dragVsy = 0 + local dragVsy = 0 local headerEl = document:GetElementById("header-info") if headerEl then headerEl:AddEventListener("mousedown", function(event) local p = event.parameters - if p and p.button and p.button ~= 0 then return end + if p and p.button and p.button ~= 0 then + return + end local mx, my = Spring.GetMouseState() local vsx, vsy = Spring.GetViewGeometry() local panel = document:GetElementById("td-root") - if not panel then return end - dragActive = true + if not panel then + return + end + dragActive = true dragOffsetX = mx - panel.offset_left dragOffsetY = (vsy - my) - panel.offset_top - dragVsy = vsy + dragVsy = vsy hasUserPosition = true event:StopPropagation() end, false) end document:AddEventListener("mousemove", function() - if not dragActive then return end + if not dragActive then + return + end local mx, my = Spring.GetMouseState() local panel = document:GetElementById("td-root") - if not panel then return end + if not panel then + return + end local newX = mx - dragOffsetX local newY = (dragVsy - my) - dragOffsetY panel.style.left = newX .. "px" - panel.style.top = newY .. "px" + panel.style.top = newY .. "px" end, false) document:AddEventListener("mouseup", function() @@ -1256,7 +1345,7 @@ function widget:Initialize() event:StopPropagation() end, false) end - + local leaderboardOverlay = document:GetElementById("leaderboard-overlay") if leaderboardOverlay then leaderboardOverlay:AddEventListener("click", function(event) @@ -1264,7 +1353,7 @@ function widget:Initialize() event:StopPropagation() end, false) end - + local leaderboardContent = document:GetElementById("leaderboard-content") if leaderboardContent then leaderboardContent:AddEventListener("click", function(event) @@ -1288,7 +1377,7 @@ function widget:Initialize() end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1, 19) == 'LobbyOverlayActive0' then + if msg:sub(1, 19) == "LobbyOverlayActive0" then if widgetState.document then if not widgetState.isDocumentVisible then widgetState.document:Show() @@ -1296,7 +1385,7 @@ function widget:RecvLuaMsg(msg, playerID) end widgetState.hiddenByLobby = false end - elseif msg:sub(1, 19) == 'LobbyOverlayActive1' then + elseif msg:sub(1, 19) == "LobbyOverlayActive1" then if widgetState.document then hideRoundEndPopup() if widgetState.isDocumentVisible then @@ -1349,14 +1438,16 @@ function widget:Update() end end - if shouldSkipUpdate() then return end + if shouldSkipUpdate() then + return + end widgetState.updateCounter = widgetState.updateCounter + 1 - + if widgetState.updateCounter % 10 == 0 then calculateUILayout() end - + if shouldFullUpdate() or shouldUpdateScores() then updateDataModel() widgetState.lastScoreUpdateTime = currentTime diff --git a/luaui/RmlWidgets/rml_context_manager.lua b/luaui/RmlWidgets/rml_context_manager.lua index a71737ae9ab..0fe7b401750 100644 --- a/luaui/RmlWidgets/rml_context_manager.lua +++ b/luaui/RmlWidgets/rml_context_manager.lua @@ -1,52 +1,52 @@ if not RmlUi then - return + return end local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Rml context manager", - desc = "This widget is responsible for handling dynamic interactions with Rml contexts.", - author = "Mupersega", - date = "2025", - license = "GNU GPL, v2 or later", - layer = -1000000, - enabled = true - } + return { + name = "Rml context manager", + desc = "This widget is responsible for handling dynamic interactions with Rml contexts.", + author = "Mupersega", + date = "2025", + license = "GNU GPL, v2 or later", + layer = -1000000, + enabled = true, + } end local function calculateDpRatio() - local viewSizeX, viewSizeY = Spring.GetViewGeometry() - local userScale = Spring.GetConfigFloat("ui_scale", 1) - local baseWidth = 1920 - local baseHeight = 1080 - local resFactor = math.min(viewSizeX / baseWidth, viewSizeY / baseHeight) - local dpRatio = resFactor * userScale - return math.floor(dpRatio * 100) / 100 + local viewSizeX, viewSizeY = Spring.GetViewGeometry() + local userScale = Spring.GetConfigFloat("ui_scale", 1) + local baseWidth = 1920 + local baseHeight = 1080 + local resFactor = math.min(viewSizeX / baseWidth, viewSizeY / baseHeight) + local dpRatio = resFactor * userScale + return math.floor(dpRatio * 100) / 100 end local function updateContextsDpRatio() - local newDpRatio = calculateDpRatio() - local contexts = RmlUi.contexts() - for _, context in ipairs(contexts) do - context.dp_ratio = newDpRatio - end + local newDpRatio = calculateDpRatio() + local contexts = RmlUi.contexts() + for _, context in ipairs(contexts) do + context.dp_ratio = newDpRatio + end end function widget:Initialize() - if not RmlUi.GetContext("shared") then - RmlUi.CreateContext("shared") - end - updateContextsDpRatio() + if not RmlUi.GetContext("shared") then + RmlUi.CreateContext("shared") + end + updateContextsDpRatio() end function widget:ViewResize() - updateContextsDpRatio() + updateContextsDpRatio() end -- include also a listener for the ui_scale config variable changes function widget:Shutdown() - Spring.Echo("Rml Context Manager shutdown, dynamic context dp ratio updates to contexts disabled." ) + Spring.Echo("Rml Context Manager shutdown, dynamic context dp ratio updates to contexts disabled.") end diff --git a/luaui/Scenarios/stresstest/circle_attack.lua b/luaui/Scenarios/stresstest/circle_attack.lua index 4a266b9bb73..9a0a85475c4 100644 --- a/luaui/Scenarios/stresstest/circle_attack.lua +++ b/luaui/Scenarios/stresstest/circle_attack.lua @@ -2,7 +2,7 @@ VFS.Include("luaui/Scenarios/stresstest/multi_attack.lua") function radius_attack(targetsCenter, nattackers) local y = Spring.GetGroundHeight(targetsCenter[1], targetsCenter[2]) - local targetPosition = {targetsCenter[1], y+5, targetsCenter[2], targetsCenter[3]} + local targetPosition = { targetsCenter[1], y + 5, targetsCenter[2], targetsCenter[3] } local CMD_ATTACK = CMD.ATTACK @@ -16,7 +16,7 @@ function radius_attack(targetsCenter, nattackers) for _, unitID in ipairs(all_units) do local unitDefID = spGetUnitDefID(unitID) if unitDefID == attackerDefID then - attackers[#attackers+1] = unitID + attackers[#attackers + 1] = unitID end end @@ -29,20 +29,19 @@ end function test() local t0 = os.clock() - local nattackers = 100*Scenario.stressLevel - local ntargets = 100*Scenario.stressLevel + local nattackers = 100 * Scenario.stressLevel + local ntargets = 100 * Scenario.stressLevel local attackerDef = Scenario.attackerDef local targetDef = Scenario.targetDef local radarDef = Scenario.radarDef local doCircle = true local circle = SyncedRun(synced_setup) - Spring.Echo("init time preinit:", os.clock()-t0) + Spring.Echo("init time preinit:", os.clock() - t0) Test.waitFrames(1) radius_attack(circle, nattackers) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - diff --git a/luaui/Scenarios/stresstest/multi_attack.lua b/luaui/Scenarios/stresstest/multi_attack.lua index cde8365d094..29b2e62ebb8 100644 --- a/luaui/Scenarios/stresstest/multi_attack.lua +++ b/luaui/Scenarios/stresstest/multi_attack.lua @@ -1,17 +1,16 @@ - function skip() return Spring.GetGameFrame() <= 0 end function scenario_arguments() - return {{stressLevel = 1}, {attackerDef = "armpw"}, {targetDef = "armwin"}, {radarDef = "armarad"}} + return { { stressLevel = 1 }, { attackerDef = "armpw" }, { targetDef = "armwin" }, { radarDef = "armarad" } } end function setup() -- test on quicksilver remake 1.24 Test.clearMap() - Spring.SetCameraTarget(Game.mapSizeX/2, 50, Game.mapSizeZ / 2 - 500, 0.5) + Spring.SetCameraTarget(Game.mapSizeX / 2, 50, Game.mapSizeZ / 2 - 500, 0.5) end function synced_setup(locals) @@ -23,13 +22,13 @@ function synced_setup(locals) local doCircle = locals.doCircle local colattackers = 10 local coltargets = 20 - local rowattackers = math.floor(locals.nattackers/colattackers) - local rowtargets = math.floor(locals.ntargets/coltargets) + local rowattackers = math.floor(locals.nattackers / colattackers) + local rowtargets = math.floor(locals.ntargets / coltargets) local attackerDef = locals.attackerDef local targetDef = locals.targetDef local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 - x = x+450 + x = x + 450 local team1 = 0 local team2 = 1 @@ -39,25 +38,25 @@ function synced_setup(locals) local circle if doCircle then -- when circle requested just return the targets center and radius - local maxX = (coltargets*sep)/2.0 - local maxZ = (rowtargets*sep)/2.0 - local targetsCenter = {x-1500+maxX, z-maxZ} - local radius = math.sqrt(maxX*maxX + maxZ*maxZ) - circle = {targetsCenter[1], targetsCenter[2], radius} + local maxX = (coltargets * sep) / 2.0 + local maxZ = (rowtargets * sep) / 2.0 + local targetsCenter = { x - 1500 + maxX, z - maxZ } + local radius = math.sqrt(maxX * maxX + maxZ * maxZ) + circle = { targetsCenter[1], targetsCenter[2], radius } end - createUnitAt(locals.radarDef, x-1000, z+300, team1) + createUnitAt(locals.radarDef, x - 1000, z + 300, team1) - for i=0, colattackers-1 do - for j=0, rowattackers-1 do - currunit = createUnitAt(attackerDef, x+i*sep, z-j*sep, team1) - attackers[#attackers+1] = currunit + for i = 0, colattackers - 1 do + for j = 0, rowattackers - 1 do + currunit = createUnitAt(attackerDef, x + i * sep, z - j * sep, team1) + attackers[#attackers + 1] = currunit end end - for i=0, coltargets-1 do - for j=0, rowtargets-1 do - createUnitAt(targetDef, x-1500+i*sep, z-j*sep, team2) + for i = 0, coltargets - 1 do + for j = 0, rowtargets - 1 do + createUnitAt(targetDef, x - 1500 + i * sep, z - j * sep, team2) end end -- make sure the attackers don't have other orders @@ -68,7 +67,7 @@ function synced_setup(locals) end function run_commands(nattackers, ntargets, attackerDef, targetDef) - if type(nattackers) == 'table' then + if type(nattackers) == "table" then -- comes from SyncedRun locals = nattackers ntargets = locals.ntargets @@ -76,7 +75,7 @@ function run_commands(nattackers, ntargets, attackerDef, targetDef) targetDef = locals.targetDef nattackers = locals.nattackers end - local shiftOpts = {"shift"} + local shiftOpts = { "shift" } local currOpt local CMD_ATTACK = CMD.ATTACK local spGiveOrderToUnit = Spring.GiveOrderToUnit @@ -97,9 +96,9 @@ function run_commands(nattackers, ntargets, attackerDef, targetDef) local unitDefID = spGetUnitDefID(unitID) local unitTeamID = spGetUnitTeam(unitID) if unitDefID == attackerDefID and unitTeamID == attackerTeam then - attackers[#attackers+1] = unitID + attackers[#attackers + 1] = unitID elseif unitDefID == targetDefID and unitTeamID == defenderTeam then - targets[#targets+1] = unitID + targets[#targets + 1] = unitID end end @@ -117,19 +116,18 @@ end function test() local t0 = os.clock() - local nattackers = 100*Scenario.stressLevel - local ntargets = 100*Scenario.stressLevel + local nattackers = 100 * Scenario.stressLevel + local ntargets = 100 * Scenario.stressLevel local attackerDef = Scenario.attackerDef local targetDef = Scenario.targetDef local radarDef = Scenario.radarDef SyncedRun(synced_setup) - Spring.Echo("init time preinit:", os.clock()-t0) + Spring.Echo("init time preinit:", os.clock() - t0) Test.waitFrames(1) SyncedRun(run_commands) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - diff --git a/luaui/Scenarios/stresstest/multi_unsynced_attack.lua b/luaui/Scenarios/stresstest/multi_unsynced_attack.lua index 8e901df028d..d7b0e129def 100644 --- a/luaui/Scenarios/stresstest/multi_unsynced_attack.lua +++ b/luaui/Scenarios/stresstest/multi_unsynced_attack.lua @@ -3,19 +3,18 @@ VFS.Include("luaui/Scenarios/stresstest/multi_attack.lua") function test() local t0 = os.clock() - local nattackers = 100*Scenario.stressLevel - local ntargets = 100*Scenario.stressLevel + local nattackers = 100 * Scenario.stressLevel + local ntargets = 100 * Scenario.stressLevel local attackerDef = Scenario.attackerDef local targetDef = Scenario.targetDef local radarDef = Scenario.radarDef SyncedRun(synced_setup) - Spring.Echo("init time preinit:", os.clock()-t0) + Spring.Echo("init time preinit:", os.clock() - t0) Test.waitFrames(1) run_commands(nattackers, ntargets, attackerDef, targetDef) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - diff --git a/luaui/Scenarios/stresstest/nano_commands.lua b/luaui/Scenarios/stresstest/nano_commands.lua index c13384325bf..91c58dd0abf 100644 --- a/luaui/Scenarios/stresstest/nano_commands.lua +++ b/luaui/Scenarios/stresstest/nano_commands.lua @@ -1,17 +1,16 @@ - function skip() return Spring.GetGameFrame() <= 0 end function scenario_arguments() - return {{stressLevel = 1}, {builderDef = "armnanotc"}, {targetDef = "armwin"}} + return { { stressLevel = 1 }, { builderDef = "armnanotc" }, { targetDef = "armwin" } } end function setup() -- test on quicksilver remake 1.24 Test.clearMap() - Spring.SetCameraTarget(Game.mapSizeX/2 + 500, 50, Game.mapSizeZ / 2 - 500, 0.5) + Spring.SetCameraTarget(Game.mapSizeX / 2 + 500, 50, Game.mapSizeZ / 2 - 500, 0.5) end function synced_nano_setup(locals) @@ -22,28 +21,28 @@ function synced_nano_setup(locals) local colturrets = 5 local coltargets = 8 - local rowturrets = math.floor(locals.nturrets/colturrets) - local rowtargets = math.floor(locals.ntargets/coltargets) + local rowturrets = math.floor(locals.nturrets / colturrets) + local rowtargets = math.floor(locals.ntargets / coltargets) local turretDef = locals.turretDef local targetDef = locals.targetDef local x, z = Game.mapSizeX / 2, Game.mapSizeZ / 2 - x = x+450 + x = x + 450 local team1 = 0 local sep = 50 local currunit local turrets = {} - for i=0, colturrets-1 do - for j=0, rowturrets-1 do - currunit = createUnitAt(turretDef, x+i*sep-100, z-j*sep, team1) - turrets[#turrets+1] = currunit + for i = 0, colturrets - 1 do + for j = 0, rowturrets - 1 do + currunit = createUnitAt(turretDef, x + i * sep - 100, z - j * sep, team1) + turrets[#turrets + 1] = currunit end end - for i=0, coltargets-1 do - for j=0, rowtargets-1 do - createUnitAt(targetDef, x+350+i*sep, z-j*sep, team1) + for i = 0, coltargets - 1 do + for j = 0, rowtargets - 1 do + createUnitAt(targetDef, x + 350 + i * sep, z - j * sep, team1) end end -- make sure the turrets don't have other orders @@ -53,14 +52,14 @@ function synced_nano_setup(locals) end function run_nano_commands(nturrets, ntargets, turretDef, targetDef) - if type(nturrets) == 'table' then + if type(nturrets) == "table" then local locals = nturrets ntargets = locals.ntargets turretDef = locals.turretDef targetDef = locals.targetDef nturrets = locals.nturrets end - local shiftOpts = {"shift"} + local shiftOpts = { "shift" } local currOpt local CMD_RECLAIM = CMD.RECLAIM local spGiveOrderToUnit = Spring.GiveOrderToUnit @@ -77,9 +76,9 @@ function run_nano_commands(nturrets, ntargets, turretDef, targetDef) for _, unitID in ipairs(all_units) do local unitDefID = spGetUnitDefID(unitID) if unitDefID == turretDefID then - turrets[#turrets+1] = unitID + turrets[#turrets + 1] = unitID elseif unitDefID == targetDefID then - targets[#targets+1] = unitID + targets[#targets + 1] = unitID end end @@ -97,19 +96,17 @@ end function test() local t0 = os.clock() - local nturrets = 50*Scenario.stressLevel - local ntargets = 50*Scenario.stressLevel + local nturrets = 50 * Scenario.stressLevel + local ntargets = 50 * Scenario.stressLevel local turretDef = Scenario.builderDef local targetDef = Scenario.targetDef SyncedRun(synced_nano_setup) - Spring.Echo("init time preinit:", os.clock()-t0) + Spring.Echo("init time preinit:", os.clock() - t0) Test.waitFrames(1) SyncedRun(run_nano_commands) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - - diff --git a/luaui/Scenarios/stresstest/nano_unsynced_commands.lua b/luaui/Scenarios/stresstest/nano_unsynced_commands.lua index 86b6d5d1011..5207e8ee576 100644 --- a/luaui/Scenarios/stresstest/nano_unsynced_commands.lua +++ b/luaui/Scenarios/stresstest/nano_unsynced_commands.lua @@ -3,19 +3,17 @@ VFS.Include("luaui/Scenarios/stresstest/nano_commands.lua") function test() local t0 = os.clock() - local nturrets = 50*Scenario.stressLevel - local ntargets = 50*Scenario.stressLevel + local nturrets = 50 * Scenario.stressLevel + local ntargets = 50 * Scenario.stressLevel local turretDef = Scenario.builderDef local targetDef = Scenario.targetDef SyncedRun(synced_nano_setup) - Spring.Echo("init time preinit:", os.clock()-t0) + Spring.Echo("init time preinit:", os.clock() - t0) Test.waitFrames(1) run_nano_commands(nturrets, ntargets, turretDef, targetDef) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - - diff --git a/luaui/Scenarios/stresstest/unsynced_attack.lua b/luaui/Scenarios/stresstest/unsynced_attack.lua index b7859154f24..bebef345353 100644 --- a/luaui/Scenarios/stresstest/unsynced_attack.lua +++ b/luaui/Scenarios/stresstest/unsynced_attack.lua @@ -2,7 +2,7 @@ VFS.Include("luaui/Scenarios/stresstest/multi_attack.lua") function radius_attack(attackers, targetsCenter) local y = Spring.GetGroundHeight(targetsCenter[1], targetsCenter[2]) - local targetPosition = {targetsCenter[1], y+5, targetsCenter[2], targetsCenter[3]} + local targetPosition = { targetsCenter[1], y + 5, targetsCenter[2], targetsCenter[3] } local CMD_ATTACK = CMD.ATTACK local spGiveOrderToUnit = Spring.GiveOrderToUnit @@ -14,8 +14,8 @@ end function test() local t0 = os.clock() - local nattackers = 100*Scenario.stressLevel - local ntargets = 100*Scenario.stressLevel + local nattackers = 100 * Scenario.stressLevel + local ntargets = 100 * Scenario.stressLevel local attackerDef = Scenario.attackerDef local targetDef = Scenario.targetDef local radarDef = Scenario.radarDef @@ -26,6 +26,5 @@ function test() radius_attack(attackers, targetsCenter) - Spring.Echo("total time:", os.clock()-t0) + Spring.Echo("total time:", os.clock() - t0) end - diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua index 408c083753b..6d2a2ecf8a2 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_filter.lua @@ -46,30 +46,14 @@ function test() local facing = 1 local builderUnitID = SyncedRun(function(locals) - return Spring.CreateUnit( - locals.builderUnitDefName, - locals.x, - locals.y, - locals.z, - locals.facing, - locals.myTeamID - ) + return Spring.CreateUnit(locals.builderUnitDefName, locals.x, locals.y, locals.z, locals.facing, locals.myTeamID) end) Spring.SelectUnit(builderUnitID) Test.waitFrames(delay) - Spring.SetActiveCommand( - Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), - 1, - true, - false, - false, - false, - false, - false - ) + Spring.SetActiveCommand(Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), 1, true, false, false, false, false, false) Test.waitFrames(delay) diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua index bd1eab6e960..96da9d02704 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_line.lua @@ -49,14 +49,7 @@ function test() local bpCount = 5 local blueprintUnitID = SyncedRun(function(locals) - return Spring.CreateUnit( - locals.blueprintUnitDefName, - locals.x, - locals.y, - locals.z, - locals.facing, - locals.myTeamID - ) + return Spring.CreateUnit(locals.blueprintUnitDefName, locals.x, locals.y, locals.z, locals.facing, locals.myTeamID) end) Spring.SelectUnit(blueprintUnitID) @@ -65,35 +58,19 @@ function test() widget:CommandNotify(GameCMD.BLUEPRINT_CREATE, {}, {}) - assert(#(widget.blueprints) == 1) + assert(#widget.blueprints == 1) Test.clearMap() local builderUnitID = SyncedRun(function(locals) - return Spring.CreateUnit( - locals.builderUnitDefName, - locals.x + 100, - locals.y, - locals.z, - locals.facing, - locals.myTeamID - ) + return Spring.CreateUnit(locals.builderUnitDefName, locals.x + 100, locals.y, locals.z, locals.facing, locals.myTeamID) end) Spring.SelectUnit(builderUnitID) Test.waitFrames(delay) - Spring.SetActiveCommand( - Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), - 1, - true, - false, - false, - false, - false, - false - ) + Spring.SetActiveCommand(Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), 1, true, false, false, false, false, false) Test.waitFrames(delay) diff --git a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua index 1d3a8f803a2..f107d10afb6 100644 --- a/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua +++ b/luaui/Tests/cmd_blueprint/test_cmd_blueprint_single.lua @@ -41,14 +41,7 @@ function test() local facing = 1 local blueprintUnitID = SyncedRun(function(locals) - return Spring.CreateUnit( - locals.blueprintUnitDefName, - locals.x, - locals.y, - locals.z, - locals.facing, - locals.myTeamID - ) + return Spring.CreateUnit(locals.blueprintUnitDefName, locals.x, locals.y, locals.z, locals.facing, locals.myTeamID) end) Spring.SelectUnit(blueprintUnitID) @@ -57,35 +50,19 @@ function test() widget:CommandNotify(GameCMD.BLUEPRINT_CREATE, {}, {}) - assertEqual(#(widget.blueprints), 1) + assertEqual(#widget.blueprints, 1) Test.clearMap() local builderUnitID = SyncedRun(function(locals) - return Spring.CreateUnit( - locals.builderUnitDefName, - locals.x + 100, - locals.y, - locals.z, - locals.facing, - locals.myTeamID - ) + return Spring.CreateUnit(locals.builderUnitDefName, locals.x + 100, locals.y, locals.z, locals.facing, locals.myTeamID) end) Spring.SelectUnit(builderUnitID) Test.waitFrames(delay) - Spring.SetActiveCommand( - Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), - 1, - true, - false, - false, - false, - false, - false - ) + Spring.SetActiveCommand(Spring.GetCmdDescIndex(GameCMD.BLUEPRINT_PLACE), 1, true, false, false, false, false, false) Test.waitFrames(delay) diff --git a/luaui/Tests/critters/test_critters.lua b/luaui/Tests/critters/test_critters.lua index 785d38b6d8e..81f560036df 100644 --- a/luaui/Tests/critters/test_critters.lua +++ b/luaui/Tests/critters/test_critters.lua @@ -20,8 +20,8 @@ end function runCritterTest() local WAIT_FRAMES = 204 -- enough to trigger critter cleanup/restoring by gaia_critters - local unitName = 'armpw' - local critterName = 'critter_crab' + local unitName = "armpw" + local critterName = "critter_crab" -- build critter lookup local isCritter = {} @@ -49,28 +49,32 @@ function runCritterTest() ------------------------------------------------------- -- 1. Create critters ------------------------------------------------------- - SyncedRun(function(locals) - local GaiaTeamID = Spring.GetGaiaTeamID() - local critterName = locals.critterName - local midX, midZ = locals.midX, locals.midZ - - local function createUnit(def, x, z) - x = midX + x - z = midZ + z - local y = Spring.GetGroundHeight(x, z) + 40 - Spring.CreateUnit(def, x, y, z, "south", GaiaTeamID) - end + SyncedRun( + function(locals) + local GaiaTeamID = Spring.GetGaiaTeamID() + local critterName = locals.critterName + local midX, midZ = locals.midX, locals.midZ + + local function createUnit(def, x, z) + x = midX + x + z = midZ + z + local y = Spring.GetGroundHeight(x, z) + 40 + Spring.CreateUnit(def, x, y, z, "south", GaiaTeamID) + end - for i = 0, 5 do - for j = 0, 5 do - createUnit(critterName, 850 + i * 50, 100 + j * 50) + for i = 0, 5 do + for j = 0, 5 do + createUnit(critterName, 850 + i * 50, 100 + j * 50) + end end - end - end, 400, { - critterName = critterName, - midX = midX, - midZ = midZ, - }) + end, + 400, + { + critterName = critterName, + midX = midX, + midZ = midZ, + } + ) assertSuccessBefore(5, 5, function() return #Spring.GetAllUnits() == 36 @@ -91,35 +95,39 @@ function runCritterTest() for bx = 0, totalX / batchSize - 1 do for bz = 0, totalZ / batchSize - 1 do - SyncedRun(function(locals) - local midX, midZ = locals.midX, locals.midZ - local spCreateUnit = Spring.CreateUnit - local pressureUnits = locals.pressureUnits - local unitName = locals.unitName - local sx, sz = locals.sx, locals.sz - local batchSize, spacing = locals.batchSize, locals.spacing - - for i = 0, batchSize - 1 do - for j = 0, batchSize - 1 do - local x = midX + sx + i * spacing - local z = midZ + sz + j * spacing - local y = Spring.GetGroundHeight(x, z) + 40 - local unitID = spCreateUnit(unitName, x, y, z, "south", 0) - if unitID then - pressureUnits[#pressureUnits + 1] = unitID + SyncedRun( + function(locals) + local midX, midZ = locals.midX, locals.midZ + local spCreateUnit = Spring.CreateUnit + local pressureUnits = locals.pressureUnits + local unitName = locals.unitName + local sx, sz = locals.sx, locals.sz + local batchSize, spacing = locals.batchSize, locals.spacing + + for i = 0, batchSize - 1 do + for j = 0, batchSize - 1 do + local x = midX + sx + i * spacing + local z = midZ + sz + j * spacing + local y = Spring.GetGroundHeight(x, z) + 40 + local unitID = spCreateUnit(unitName, x, y, z, "south", 0) + if unitID then + pressureUnits[#pressureUnits + 1] = unitID + end end end - end - end, 50, { - midX = midX, - midZ = midZ, - pressureUnits = pressureUnits, - unitName = unitName, - sx = bx * batchSize * spacing, - sz = bz * batchSize * spacing, - batchSize = batchSize, - spacing = spacing, - }) + end, + 50, + { + midX = midX, + midZ = midZ, + pressureUnits = pressureUnits, + unitName = unitName, + sx = bx * batchSize * spacing, + sz = bz * batchSize * spacing, + batchSize = batchSize, + spacing = spacing, + } + ) end end end @@ -146,15 +154,19 @@ function runCritterTest() -- 3. Destroy pressure units so critters will be restored ------------------------------------------------------- local function destroyPressureUnits() - SyncedRun(function(locals) - for _, unitID in ipairs(locals.pressureUnits) do - if Spring.ValidUnitID(unitID) then - Spring.DestroyUnit(unitID, false, true, nil, true) + SyncedRun( + function(locals) + for _, unitID in ipairs(locals.pressureUnits) do + if Spring.ValidUnitID(unitID) then + Spring.DestroyUnit(unitID, false, true, nil, true) + end end - end - end, 500, { - pressureUnits = pressureUnits, - }) + end, + 500, + { + pressureUnits = pressureUnits, + } + ) end destroyPressureUnits() diff --git a/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armpw.lua b/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armpw.lua index e137c2ad76e..95cfb19d2ae 100644 --- a/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armpw.lua +++ b/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armpw.lua @@ -23,11 +23,7 @@ function test() local y = Spring.GetGroundHeight(x, z) unitID = SyncedRun(function(locals) - return Spring.CreateUnit( - "armpw", - locals.x, locals.y, locals.z, - 0, 0 - ) + return Spring.CreateUnit("armpw", locals.x, locals.y, locals.z, 0, 0) end) assert(table.count(widget.activeSelfD) == 0) @@ -55,7 +51,6 @@ function test() -- remove move order Spring.GiveOrderToUnit(unitID, CMD.REMOVE, { CMD.MOVE }, { "alt" }) Test.waitUntil(function() - return table.count(widget.activeSelfD) == 1 - and table.count(widget.queuedSelfD) == 0 + return table.count(widget.activeSelfD) == 1 and table.count(widget.queuedSelfD) == 0 end, 10) end diff --git a/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armvp.lua b/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armvp.lua index fb4c6f97f23..e255235f040 100644 --- a/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armvp.lua +++ b/luaui/Tests/gui_selfd_icons/test_gui_selfd_icons_armvp.lua @@ -23,11 +23,7 @@ function test() local y = Spring.GetGroundHeight(x, z) unitID = SyncedRun(function(locals) - return Spring.CreateUnit( - "armvp", - locals.x, locals.y, locals.z, - 0, 0 - ) + return Spring.CreateUnit("armvp", locals.x, locals.y, locals.z, 0, 0) end) assert(table.count(widget.activeSelfD) == 0) diff --git a/luaui/Tests/mex-building/pregame_mex_queue.lua b/luaui/Tests/mex-building/pregame_mex_queue.lua index c80373bedfd..20114da4f38 100644 --- a/luaui/Tests/mex-building/pregame_mex_queue.lua +++ b/luaui/Tests/mex-building/pregame_mex_queue.lua @@ -12,7 +12,7 @@ function setup() local widget_gui_pregame_build = widgetHandler:FindWidget("Pregame Queue") assert(widget_gui_pregame_build, "Pregame Queue widget not found via FindWidget") - WG['pregame-build'].setBuildQueue({}) + WG["pregame-build"].setBuildQueue({}) WG["pregame-build"].setPreGamestartDefID(nil) initialCameraState = Spring.GetCameraState() @@ -28,7 +28,7 @@ end function cleanup() Test.clearMap() - WG['pregame-build'].setBuildQueue({}) + WG["pregame-build"].setBuildQueue({}) WG["pregame-build"].setPreGamestartDefID(nil) Spring.SetCameraState(initialCameraState) @@ -37,7 +37,7 @@ end -- tests both pregame mex snap behavior, as well as basic queue and blueprint handling function test() local mexUnitDefId = UnitDefNames["armmex"].id - local metalSpots = WG['resource_spot_finder'].metalSpotsList + local metalSpots = WG["resource_spot_finder"].metalSpotsList local midX, midZ = Game.mapSizeX / 2, Game.mapSizeZ / 2 local targetMex = nil @@ -64,13 +64,8 @@ function test() assert(WG.ExtractorSnap.position ~= nil, "ExtractorSnap.position should not be nil after setting mex blueprint and waiting") -- did it snap to the closest mex? - local snapDistance = math.distance2d( - WG.ExtractorSnap.position.x, - WG.ExtractorSnap.position.z, - targetMex.x, - targetMex.z - ) - assert(snapDistance < 100, string.format("Extractor snap distance %.0f from target mex, expected < 100", snapDistance)) + local snapDistance = math.distance2d(WG.ExtractorSnap.position.x, WG.ExtractorSnap.position.z, targetMex.x, targetMex.z) + assert(snapDistance < 100, string.format("Extractor snap distance %.0f from target mex, expected < 100", snapDistance)) local snappedPosition = table.copy(WG.ExtractorSnap.position) @@ -106,6 +101,6 @@ function test() assert(activeBlueprint == nil, "Active blueprint should be nil") -- Did the mex get de-queued? - local buildQueue = WG['pregame-build'].getBuildQueue() + local buildQueue = WG["pregame-build"].getBuildQueue() assert(#buildQueue == 0, "Build queue should be empty") end diff --git a/luaui/Tests/mex-building/pregame_mex_snap.lua b/luaui/Tests/mex-building/pregame_mex_snap.lua index c80efb5c38b..8b89e4b4337 100644 --- a/luaui/Tests/mex-building/pregame_mex_snap.lua +++ b/luaui/Tests/mex-building/pregame_mex_snap.lua @@ -11,7 +11,7 @@ function setup() widget_gui_pregame_build = widgetHandler:FindWidget("Pregame Queue") assert(widget_gui_pregame_build) - WG['pregame-build'].setBuildQueue({}) + WG["pregame-build"].setBuildQueue({}) WG["pregame-build"].setPreGamestartDefID(nil) initialCameraState = Spring.GetCameraState() @@ -27,7 +27,7 @@ end function cleanup() Test.clearMap() - WG['pregame-build'].setBuildQueue({}) + WG["pregame-build"].setBuildQueue({}) WG["pregame-build"].setPreGamestartDefID(nil) Spring.SetCameraState(initialCameraState) @@ -35,7 +35,7 @@ end function test() mexUnitDefId = UnitDefNames["armmex"].id - metalSpots = WG['resource_spot_finder'].metalSpotsList + metalSpots = WG["resource_spot_finder"].metalSpotsList midX, midZ = Game.mapSizeX / 2, Game.mapSizeZ / 2 targetMex = nil @@ -60,12 +60,7 @@ function test() assert(WG.ExtractorSnap.position ~= nil) -- did it snap to the closest mex? - assert(math.distance2d( - WG.ExtractorSnap.position.x, - WG.ExtractorSnap.position.z, - targetMex.x, - targetMex.z - ) < 100) + assert(math.distance2d(WG.ExtractorSnap.position.x, WG.ExtractorSnap.position.z, targetMex.x, targetMex.z) < 100) snappedPosition = table.copy(WG.ExtractorSnap.position) @@ -76,13 +71,13 @@ function test() Test.waitTime(10) -- did the mex get placed in the right spot? - buildQueue = WG['pregame-build'].getBuildQueue() + buildQueue = WG["pregame-build"].getBuildQueue() assertEqual(#buildQueue, 1) assertTablesEqual(buildQueue[1], { mexUnitDefId, snappedPosition.x, snappedPosition.y, snappedPosition.z, - 0 + 0, }, 0.1) end diff --git a/luaui/Tests/select_api/compare_to_spring.lua b/luaui/Tests/select_api/compare_to_spring.lua index c6bbff51d66..3d04047b68c 100644 --- a/luaui/Tests/select_api/compare_to_spring.lua +++ b/luaui/Tests/select_api/compare_to_spring.lua @@ -4,7 +4,6 @@ local selectApi = VFS.Include("luaui/Include/select_api.lua") local nameLookup = {} local passed = true - function skip() return Spring.GetGameFrame() <= 0 or not Platform.gl end @@ -69,13 +68,11 @@ local function compareUnitSets(springUnitSet, apiUnitSet, filter) -- these have weird behaviour for the "Not_Builder" filter -- they behave as expected for the "Builder" filter - local isWeirdOutlier = (filter == "Not_Builder" and ( - name == "cormlv" or - name == "armmlv" - )) + local isWeirdOutlier = (filter == "Not_Builder" and (name == "cormlv" or name == "armmlv")) -- api command selects these, but spring select doesn't -- I think they spawn? don't seem to exist during build script - or name == "armdrone" or name == "corvacct" + or name == "armdrone" + or name == "corvacct" or name == "armtl" if not isWeirdOutlier then @@ -88,9 +85,7 @@ local function compareUnitSets(springUnitSet, apiUnitSet, filter) end local function createAndAddUnit(udefid, name, x, z, uids, group) - if name == 'dbg_sphere' or name == 'dbg_sphere_fullmetal' or name == 'pbr_cube' - or name == 'lootboxplatinum' - then -- weird buggy units + if name == "dbg_sphere" or name == "dbg_sphere_fullmetal" or name == "pbr_cube" or name == "lootboxplatinum" then -- weird buggy units return end @@ -103,7 +98,6 @@ local function createAndAddUnit(udefid, name, x, z, uids, group) local y = Spring.GetGroundHeight(x, z) local unitID = Spring.CreateUnit(udefid, x, y, z, "east", 0) - if group == 1 then Spring.SetUnitGroup(unitID, 1) end @@ -169,7 +163,7 @@ local comparableConclusions = { ["ClearSelection_SelectAll+"] = true, ["SelectAll+"] = true, ["ClearSelection_SelectClosestToCursor+"] = true, - ["SelectClosestToCursor+"] = true + ["SelectClosestToCursor+"] = true, } local function test_command(preSelectedUnitIDs, filter, command, conclusion) @@ -202,8 +196,7 @@ local function test_command(preSelectedUnitIDs, filter, command, conclusion) local prefix = "\n" .. type .. " " .. command .. " failed: " if hasMissingInApi and hasMissingInSpring then - local errorMessage = generateErrorMessage(missingInApi, "missingInApi") .. - " | " .. generateErrorMessage(missingInSpring, "missingInSpring") + local errorMessage = generateErrorMessage(missingInApi, "missingInApi") .. " | " .. generateErrorMessage(missingInSpring, "missingInSpring") print(prefix .. errorMessage) passed = false elseif hasMissingInApi then @@ -297,7 +290,7 @@ function test() } local notImplementedApi = { - "RulesParamEquals__" + "RulesParamEquals__", } local notImplementedSpring = { @@ -319,7 +312,7 @@ function test() "Visible", "PrevSelection", "FromMouse_500", - "FromMouseC_500" + "FromMouseC_500", } local conclusions = { diff --git a/luaui/Tests/selftests/test_assertions.lua b/luaui/Tests/selftests/test_assertions.lua index 26007470f34..b474bf2161f 100644 --- a/luaui/Tests/selftests/test_assertions.lua +++ b/luaui/Tests/selftests/test_assertions.lua @@ -1,10 +1,9 @@ - function sanityChecks() -- Just to make sure some standard methods used here work as expected. - Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, {0}, {}) + Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, { 0 }, {}) SyncedProxy.Spring.ValidUnitID(20) local res, err = pcall(function() - Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, {0}, {}) + Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, { 0 }, {}) end) assert(err ~= "attempt to yield across metamethod/C-call boundary") end @@ -37,11 +36,13 @@ function failingTests() end, "error") assertThrowsMessage(function() - SyncedProxy.Spring.GiveOrderToUnit(20, CMD.FIRE_STATE, {0}, {}) + SyncedProxy.Spring.GiveOrderToUnit(20, CMD.FIRE_STATE, { 0 }, {}) end, "[GiveOrderToUnit] invalid unitID") assertThrowsMessage(function() - assertSuccessBefore(1, 10, function() return false end, "error") + assertSuccessBefore(1, 10, function() + return false + end, "error") end, "error") assertThrowsMessage(function() @@ -73,7 +74,7 @@ function failingWhileSucceedingTests() end) assertThrows(function() -- this actually throws an exception, but due to something else. - SyncedProxy.Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, {0}, {}) + SyncedProxy.Spring.GiveOrderToUnit(2, CMD.FIRE_STATE, { 0 }, {}) end) end @@ -85,7 +86,9 @@ end function testAssertSuccessBefore() -- test the method succeeding - assertSuccessBefore(1, 10, function() return true end) + assertSuccessBefore(1, 10, function() + return true + end) assertSuccessBefore(1, 10, function() -- SyncedProxy works here SyncedProxy.Spring.ValidUnitID(20) @@ -93,7 +96,9 @@ function testAssertSuccessBefore() end) -- test the method never succeeding in the alloted time assertThrowsMessage(function() - assertSuccessBefore(1, 10, function() error("error") end) + assertSuccessBefore(1, 10, function() + error("error") + end) end, "error") end @@ -108,7 +113,9 @@ function testAssertThrows() end) -- test assert throws an error when the function doesn't assertThrows(function() - assertThrows(function() return true end) + assertThrows(function() + return true + end) end) assertThrows(function() Spring.ValidUnitID(20) @@ -131,7 +138,9 @@ function testAssertThrowsMessage() end, "[error]") -- test it works when error ends the same as the error assertThrows(function() - assertThrowsMessage(function() error("another error") end, "error") + assertThrowsMessage(function() + error("another error") + end, "error") end) -- test our splitting method works when the error has the same pattern assertThrowsMessage(function() diff --git a/luaui/Tests/selftests/test_callins.lua b/luaui/Tests/selftests/test_callins.lua index 7e479f68fa2..2bb532bac7b 100644 --- a/luaui/Tests/selftests/test_callins.lua +++ b/luaui/Tests/selftests/test_callins.lua @@ -34,10 +34,9 @@ function runBaseTests() -- not calling expect first assertThrowsMessage(function() Test.waitUntilCallin("UnitCommand") - end, "[registerCallin:UnitCommand] need to call Test.expectCallin(\"UnitCommand\") first") + end, '[registerCallin:UnitCommand] need to call Test.expectCallin("UnitCommand") first') Test.clearCallins() - end function runWaitUntil(countOnly, reallyCountOnly, wait, expect, clear) diff --git a/luaui/Tests/weapondefs/test_flighttime.lua b/luaui/Tests/weapondefs/test_flighttime.lua index efa0e6674f3..f7f98599503 100644 --- a/luaui/Tests/weapondefs/test_flighttime.lua +++ b/luaui/Tests/weapondefs/test_flighttime.lua @@ -42,7 +42,7 @@ function runDistanceTest(flightTime, shouldAlive) local z = midZ + z local y = Spring.GetGroundHeight(x, z) local unitID = Spring.CreateUnit(def, x, y, z, "south", teamID) - units[#units+1] = unitID + units[#units + 1] = unitID unitNames[def] = unitID return unitID end @@ -56,28 +56,28 @@ function runDistanceTest(flightTime, shouldAlive) createUnit("armtarg", 700, -500, 0) createUnit("corbuzz", 500, 0, 0) - Spring.GiveOrderToUnitArray(units, CMD.FIRE_STATE, {0}, 0) + Spring.GiveOrderToUnitArray(units, CMD.FIRE_STATE, { 0 }, 0) createUnit("armarad", 900, 50, 0) - for i=0, 5 do - createUnit("armrock", 850 + i*50, 100, 0) + for i = 0, 5 do + createUnit("armrock", 850 + i * 50, 100, 0) end createUnit("corstorm", 1150, 100, 0) - Spring.GiveOrderToUnitArray(units, CMD.MOVE_STATE, {0}, 0) + Spring.GiveOrderToUnitArray(units, CMD.MOVE_STATE, { 0 }, 0) - createUnit("armarad", 400, Game.mapSizeZ/2.0-1200, 0) + createUnit("armarad", 400, Game.mapSizeZ / 2.0 - 1200, 0) -- enemies createUnit("armpw", 1000, 550, 1) - createUnit("armsolar", 0, Game.mapSizeZ/2.0-1200, 1) + createUnit("armsolar", 0, Game.mapSizeZ / 2.0 - 1200, 1) return units, unitNames end) Test.waitFrames(1) - Spring.GiveOrderToUnit(unitNames["corbuzz"], CMD.ATTACK, {unitNames["armsolar"]}, 0) - Spring.GiveOrderToUnit(unitNames["corstorm"], CMD.ATTACK, {unitNames["armpw"]}, 0) - Spring.GiveOrderToUnit(unitNames["armrock"], CMD.ATTACK, {unitNames["armpw"]}, 0) + Spring.GiveOrderToUnit(unitNames["corbuzz"], CMD.ATTACK, { unitNames["armsolar"] }, 0) + Spring.GiveOrderToUnit(unitNames["corstorm"], CMD.ATTACK, { unitNames["armpw"] }, 0) + Spring.GiveOrderToUnit(unitNames["armrock"], CMD.ATTACK, { unitNames["armpw"] }, 0) Test.waitFrames(300) diff --git a/luaui/TestsExamples/balance/test_arm_vs_cor_fighters.lua b/luaui/TestsExamples/balance/test_arm_vs_cor_fighters.lua index 7aac181496d..6ecb36a4fed 100644 --- a/luaui/TestsExamples/balance/test_arm_vs_cor_fighters.lua +++ b/luaui/TestsExamples/balance/test_arm_vs_cor_fighters.lua @@ -15,7 +15,7 @@ end function test() local units = { [0] = "armfig", - [1] = "corveng" + [1] = "corveng", } local n = 200 @@ -42,7 +42,6 @@ function test() local y = Spring.GetGroundHeight(x, z) local unitID = Spring.CreateUnit(locals.units[1], x, y, z, "west", 1) end - end end) diff --git a/luaui/TestsExamples/balance/test_grunts_vs_pawns.lua b/luaui/TestsExamples/balance/test_grunts_vs_pawns.lua index 1dc317702f7..881ebc567f1 100644 --- a/luaui/TestsExamples/balance/test_grunts_vs_pawns.lua +++ b/luaui/TestsExamples/balance/test_grunts_vs_pawns.lua @@ -15,7 +15,7 @@ end function test() local units = { [0] = "armpw", - [1] = "corak" + [1] = "corak", } local n = 20 @@ -42,7 +42,6 @@ function test() local y = Spring.GetGroundHeight(x, z) Spring.CreateUnit(locals.units[1], x, y, z + locals.zStep * i, "west", 1) end - end end) diff --git a/luaui/TestsExamples/gui_battle_resource_tracker/test_gui_battle_resource_tracker.lua b/luaui/TestsExamples/gui_battle_resource_tracker/test_gui_battle_resource_tracker.lua index e261a87d386..a0171c3ea27 100644 --- a/luaui/TestsExamples/gui_battle_resource_tracker/test_gui_battle_resource_tracker.lua +++ b/luaui/TestsExamples/gui_battle_resource_tracker/test_gui_battle_resource_tracker.lua @@ -41,7 +41,7 @@ function test() Test.clearMap() - assert(#(combineEventsSpy.calls) == n - 1, #(combineEventsSpy.calls)) + assert(#combineEventsSpy.calls == n - 1, #combineEventsSpy.calls) events = widget.spatialHash:allEvents() assert(#events == 1) diff --git a/luaui/TestsExamples/test_utilities/test_mock.lua b/luaui/TestsExamples/test_utilities/test_mock.lua index 5bf0a34757c..32a895b5184 100644 --- a/luaui/TestsExamples/test_utilities/test_mock.lua +++ b/luaui/TestsExamples/test_utilities/test_mock.lua @@ -3,7 +3,7 @@ function test() return true, false, true, false end) - assertTablesEqual(pack(Spring.GetModKeyState()), {true, false, true, false}) + assertTablesEqual(pack(Spring.GetModKeyState()), { true, false, true, false }) - assert(#(mock_SpringGetModKeyState.calls) == 1) + assert(#mock_SpringGetModKeyState.calls == 1) end diff --git a/luaui/Widgets/__defs_write.lua b/luaui/Widgets/__defs_write.lua index cbd814153c8..4eba982d578 100644 --- a/luaui/Widgets/__defs_write.lua +++ b/luaui/Widgets/__defs_write.lua @@ -1,32 +1,30 @@ local customparamDefsDetected = false -for _,def in pairs(UnitDefs) do - if def.customParams and def.customParams.__def ~= nil then - customparamDefsDetected = true - break - end +for _, def in pairs(UnitDefs) do + if def.customParams and def.customParams.__def ~= nil then + customparamDefsDetected = true + break + end end if customparamDefsDetected then + local excludeScavengers = true + + local widget = widget ---@type Widget + + function widget:GetInfo() + return { + name = "Write customparam.__def to files", + desc = "", + author = "Bluestone", + date = "-1", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } + end - local excludeScavengers = true - - local widget = widget ---@type Widget - - function widget:GetInfo() - return { - name = "Write customparam.__def to files", - desc = "", - author = "Bluestone", - date = "-1", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } - end - - --- Localized Spring API for performance -local spEcho = Spring.Echo + -- Localized Spring API for performance + local spEcho = Spring.Echo local savedTables = {} @@ -45,83 +43,101 @@ local spEcho = Spring.Echo -------------------------------------------------------------------------------- ----- - local indentString = '\t' + local indentString = "\t" -- setup a lua keyword map local keyWords = { - "and", "break", "do", "else", "elseif", "end", "false", "for", "function", - "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", - "until", "while" + "and", + "break", + "do", + "else", + "elseif", + "end", + "false", + "for", + "function", + "if", + "in", + "local", + "nil", + "not", + "or", + "repeat", + "return", + "then", + "true", + "until", + "while", } local keyWordSet = {} - for _,w in ipairs(keyWords) do + for _, w in ipairs(keyWords) do keyWordSet[w] = true end - keyWords = nil -- don't need the array anymore + keyWords = nil -- don't need the array anymore local function encloseStr(s) - return string.format('%q', s) + return string.format("%q", s) end - local function encloseKey(s) - local wrap = not (string.find(s, '^%a[_%a%d]*$')) - if (not wrap) then - if (string.len(s) <= 0) then wrap = true end + local wrap = not (string.find(s, "^%a[_%a%d]*$")) + if not wrap then + if string.len(s) <= 0 then + wrap = true + end end - if (not wrap) then - if (keyWordSet[s]) then wrap = true end + if not wrap then + if keyWordSet[s] then + wrap = true + end end - if (wrap) then - return string.format('[%q]', s) + if wrap then + return string.format("[%q]", s) else return s end end - local keyTypes = { - ['string'] = true, - ['number'] = true, - ['boolean'] = true, + ["string"] = true, + ["number"] = true, + ["boolean"] = true, } local valueTypes = { - ['string'] = true, - ['number'] = true, - ['boolean'] = true, - ['table'] = true, + ["string"] = true, + ["number"] = true, + ["boolean"] = true, + ["table"] = true, } - local function CompareKeys(kv1, kv2) local k1, v1 = kv1[1], kv1[2] local k2, v2 = kv2[1], kv2[2] local ktype1 = type(k1) local ktype2 = type(k2) - if (ktype1 ~= ktype2) then + if ktype1 ~= ktype2 then return (ktype1 > ktype2) end local vtype1 = type(v1) local vtype2 = type(v2) - if ((vtype1 == 'table') and (vtype2 ~= 'table')) then + if (vtype1 == "table") and (vtype2 ~= "table") then return false end - if ((vtype1 ~= 'table') and (vtype2 == 'table')) then + if (vtype1 ~= "table") and (vtype2 == "table") then return true end return (k1 < k2) end - local function MakeSortedTable(t) local st = {} - for k,v in pairs(t) do - if (keyTypes[type(k)] and valueTypes[type(v)]) then + for k, v in pairs(t) do + if keyTypes[type(k)] and valueTypes[type(v)] then table.insert(st, { k, v }) end end @@ -134,170 +150,175 @@ local spEcho = Spring.Echo local st = MakeSortedTable(t) - for _,kv in ipairs(st) do + for _, kv in ipairs(st) do local k, v = kv[1], kv[2] local ktype = type(k) local vtype = type(v) -- output the key - if (ktype == 'string') then - file:write(indent..encloseKey(k)..' = ') + if ktype == "string" then + file:write(indent .. encloseKey(k) .. " = ") else - file:write(indent..'['..tostring(k)..'] = ') + file:write(indent .. "[" .. tostring(k) .. "] = ") end -- output the value - if vtype == 'string' then - file:write(encloseStr(v)..',\n') - elseif vtype == 'number' then + if vtype == "string" then + file:write(encloseStr(v) .. ",\n") + elseif vtype == "number" then if v == math.huge then - file:write('math.huge,\n') - elseif (v == -math.huge) then - file:write('-math.huge,\n') + file:write("math.huge,\n") + elseif v == -math.huge then + file:write("-math.huge,\n") else - if k=="buildcostmetal" or k=="buildcostenergy" or k=="metalpershot" or k=="energypershot" then + if k == "buildcostmetal" or k == "buildcostenergy" or k == "metalpershot" or k == "energypershot" then -- round to integer v = string.format("%.0f", v) else -- round to 5dp, convert to string, then remove trailing 0s after decimal point v = string.format("%.5f", v) - local a,b = string.find(v,".") - if a~= nil then + local a, b = string.find(v, ".") + if a ~= nil then v = string.reverse(v) - while (string.sub(v,1,1)=="0") do - v = string.sub(v,2) + while string.sub(v, 1, 1) == "0" do + v = string.sub(v, 2) end - if string.sub(v,1,1)=="." then v = string.sub(v,2) end --remove the decimal point, if needed + if string.sub(v, 1, 1) == "." then + v = string.sub(v, 2) + end --remove the decimal point, if needed v = string.reverse(v) end end - file:write(tostring(v)..',\n') + file:write(tostring(v) .. ",\n") end - elseif vtype == 'boolean' then - file:write(tostring(v)..',\n') - elseif vtype == 'table' then + elseif vtype == "boolean" then + file:write(tostring(v) .. ",\n") + elseif vtype == "table" then if savedTables[v] then error("table.save() does not support recursive tables") end if next(v) then savedTables[t] = true - file:write('{\n') + file:write("{\n") SaveTable(v, file, indent) - file:write(indent..'},\n') + file:write(indent .. "},\n") savedTables[t] = nil else - file:write('{},\n') -- empty table + file:write("{},\n") -- empty table end end end end - -- second half of a tool for baking unitdefs_post into unitdef files, see readme.txt - local had_failed = false + -- second half of a tool for baking unitdefs_post into unitdef files, see readme.txt + local had_failed = false function save2(t, filename, header) - local file = io.open(filename, 'w') + local file = io.open(filename, "w") if file == nil then return end if header then - file:write(header..'\n') + file:write(header .. "\n") end - file:write('return {\n') - if (type(t)=="table" and next(t)~=nil) or type(t)=="metatable" then - SaveTable(t, file, '') + file:write("return {\n") + if (type(t) == "table" and next(t) ~= nil) or type(t) == "metatable" then + SaveTable(t, file, "") end - file:write('}\n') + file:write("}\n") file:close() - for k,v in pairs(savedTables) do + for k, v in pairs(savedTables) do savedTables[k] = nil end end - function WriteDefToFile (folder, v) - if not v.customParams or not v.customParams.__def then - spEcho("Warning: Could not find customparams.__def for " .. v.name) - return false - end - if v.customParams.__def=="omitted" then - return true -- for omitting weapondefs that are inside the units file, so don't need to be witten into their own file - end - - local def_string = v.customParams.__def --from table.tostring in post_save_to_customparams - def_string = "return { " .. v.name .. " = " .. def_string .. "}" - local f = loadstring(def_string) - if not f then - spEcho("Failed to load __def string as table: " .. v.name, def_string) - return false - end - - local ud_table = f() - for k,_ in pairs(ud_table) do -- remove the customParams table if it is empty (note: lower case here!) - local isEmpty = true - for k2,_ in pairs(ud_table[k].customparams) do - isEmpty = false - break - end - if isEmpty then ud_table[k].customparams=nil end - end - - local subfolder = '' - if folder == "baked_defs/units" and v.customParams and v.customParams.subfolder then - subfolder = v.customParams.subfolder .. "/" - Spring.CreateDir(folder.."/"..subfolder) - end - - save2(ud_table, folder .. "/" .. subfolder .. v.name .. ".lua") - return true - end - - function HandleDefs(Defs, folder) - local failures = 0 - - spEcho("Processing Defs for " .. folder) - for _,v in pairs(Defs) do - if not excludeScavengers or not v.name or not string.find(v.name, '_scav') then - if failures >=3 then break end - local success = WriteDefToFile("baked_defs/" .. folder, v) - if (not success) then failures = failures + 1 end - end - end - - if failures>0 then - had_failed = true - spEcho("Skipping remaining " .. folder .. " defs - too many errors") - end - return (failures>0) - end - - function widget:Initialize() - - -- make folder if does not already exist - Spring.CreateDir("baked_defs/units") - Spring.CreateDir("baked_defs/weapons") - --Spring.CreateDir("baked_defs/features") - --Spring.CreateDir("baked_defs/armordefs") - --Spring.CreateDir("baked_defs/movedefs") - --Spring.CreateDir("baked_defs/effects") - - -- handle the def tables - HandleDefs(UnitDefs, "units") - HandleDefs(WeaponDefs, "weapons") - --HandleDefs(UnitDefs, units) - --HandleDefs(UnitDefs, units) - --HandleDefs(UnitDefs, units) - --HandleDefs(ExplosionDefs, "effects") - - -- warn on failure - if had_failed==true then - spEcho("Some unit/weapon __defs failed to be written to file, see errors above") - elseif had_failed==false then - spEcho("Wrote all unit/weapon __defs to files") - end - - -- handle standalone weapondefs - -- TODO - - widgetHandler:RemoveWidget() - end + function WriteDefToFile(folder, v) + if not v.customParams or not v.customParams.__def then + spEcho("Warning: Could not find customparams.__def for " .. v.name) + return false + end + if v.customParams.__def == "omitted" then + return true -- for omitting weapondefs that are inside the units file, so don't need to be witten into their own file + end + + local def_string = v.customParams.__def --from table.tostring in post_save_to_customparams + def_string = "return { " .. v.name .. " = " .. def_string .. "}" + local f = loadstring(def_string) + if not f then + spEcho("Failed to load __def string as table: " .. v.name, def_string) + return false + end + + local ud_table = f() + for k, _ in pairs(ud_table) do -- remove the customParams table if it is empty (note: lower case here!) + local isEmpty = true + for k2, _ in pairs(ud_table[k].customparams) do + isEmpty = false + break + end + if isEmpty then + ud_table[k].customparams = nil + end + end + + local subfolder = "" + if folder == "baked_defs/units" and v.customParams and v.customParams.subfolder then + subfolder = v.customParams.subfolder .. "/" + Spring.CreateDir(folder .. "/" .. subfolder) + end + + save2(ud_table, folder .. "/" .. subfolder .. v.name .. ".lua") + return true + end + + function HandleDefs(Defs, folder) + local failures = 0 + spEcho("Processing Defs for " .. folder) + for _, v in pairs(Defs) do + if not excludeScavengers or not v.name or not string.find(v.name, "_scav") then + if failures >= 3 then + break + end + local success = WriteDefToFile("baked_defs/" .. folder, v) + if not success then + failures = failures + 1 + end + end + end + + if failures > 0 then + had_failed = true + spEcho("Skipping remaining " .. folder .. " defs - too many errors") + end + return (failures > 0) + end + function widget:Initialize() + -- make folder if does not already exist + Spring.CreateDir("baked_defs/units") + Spring.CreateDir("baked_defs/weapons") + --Spring.CreateDir("baked_defs/features") + --Spring.CreateDir("baked_defs/armordefs") + --Spring.CreateDir("baked_defs/movedefs") + --Spring.CreateDir("baked_defs/effects") + + -- handle the def tables + HandleDefs(UnitDefs, "units") + HandleDefs(WeaponDefs, "weapons") + --HandleDefs(UnitDefs, units) + --HandleDefs(UnitDefs, units) + --HandleDefs(UnitDefs, units) + --HandleDefs(ExplosionDefs, "effects") + + -- warn on failure + if had_failed == true then + spEcho("Some unit/weapon __defs failed to be written to file, see errors above") + elseif had_failed == false then + spEcho("Wrote all unit/weapon __defs to files") + end + + -- handle standalone weapondefs + -- TODO + + widgetHandler:RemoveWidget() + end end diff --git a/luaui/Widgets/ai_ruins_blueprint_generator.lua b/luaui/Widgets/ai_ruins_blueprint_generator.lua index 12ab9eb0066..b817175249c 100644 --- a/luaui/Widgets/ai_ruins_blueprint_generator.lua +++ b/luaui/Widgets/ai_ruins_blueprint_generator.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Ruins Blueprint Generator", - desc = "Generates Lua blueprint code from selected units", - author = "Damgam", - date = "2020", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Ruins Blueprint Generator", + desc = "Generates Lua blueprint code from selected units", + author = "Damgam", + date = "2020", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized functions for performance local mathCeil = math.ceil local tableInsert = table.insert @@ -101,8 +100,8 @@ local function generateCode(type) for _, unitID in ipairs(selectedUnits) do local unitDirection = Spring.GetUnitBuildFacing(unitID) - local xOffset = mathCeil(centerposx[unitID]-blueprintCenterX) - local zOffset = mathCeil(centerposz[unitID]-blueprintCenterZ) + local xOffset = mathCeil(centerposx[unitID] - blueprintCenterX) + local zOffset = mathCeil(centerposz[unitID] - blueprintCenterZ) blueprintRadius = math.max(blueprintRadius, xOffset, zOffset) local unitDefID = Spring.GetUnitDefID(unitID) @@ -117,9 +116,8 @@ local function generateCode(type) end table.sort(buildings, function(b1, b2) - return b1.buildTime < b2.buildTime - end - ) + return b1.buildTime < b2.buildTime + end) file:write("\n") file:write("local function " .. blueprintName .. "()", "\n") diff --git a/luaui/Widgets/ana_report_widgets.lua b/luaui/Widgets/ana_report_widgets.lua index 654fc42c285..93e97f28116 100644 --- a/luaui/Widgets/ana_report_widgets.lua +++ b/luaui/Widgets/ana_report_widgets.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Analytics - Widgets", - desc = "Report widget usage to Analytics API", - author = "uBdead", - date = "Oct 2025", + name = "Analytics - Widgets", + desc = "Report widget usage to Analytics API", + author = "uBdead", + date = "Oct 2025", license = "GPL-v2", - layer = 0, + layer = 0, enabled = true, handler = true, } @@ -21,7 +21,7 @@ function widget:Initialize() end end --- Doing it a bit late also hopes to catch the state after people already toggled widgets on/off +-- Doing it a bit late also hopes to catch the state after people already toggled widgets on/off local REPORT_DELAY_FRAMES = 30 local MAX_WIDGETS_PER_REPORT = 50 local MAX_WIDGET_DESCRIPTION_LEN = 100 @@ -36,9 +36,7 @@ local currentWidgetIndex = 1 local function GetWidgetToggleValue(widgetname) if widgetHandler.orderList[widgetname] == nil or widgetHandler.orderList[widgetname] == 0 then return false - elseif widgetHandler.orderList[widgetname] >= 1 - and widgetHandler.knownWidgets ~= nil - and widgetHandler.knownWidgets[widgetname] ~= nil then + elseif widgetHandler.orderList[widgetname] >= 1 and widgetHandler.knownWidgets ~= nil and widgetHandler.knownWidgets[widgetname] ~= nil then if widgetHandler.knownWidgets[widgetname].active then return true else @@ -48,11 +46,11 @@ local function GetWidgetToggleValue(widgetname) end local function processWidget(widget) - -- I know this is redundant as we literally just defined these values ourselves, + -- I know this is redundant as we literally just defined these values ourselves, -- but i want to keep the GetWidgetToggleValue the same as the original local state = GetWidgetToggleValue(widget.name) - if state == false then - widget.state = 0 + if state == false then + widget.state = 0 elseif state == 0.5 then widget.state = -1 else diff --git a/luaui/Widgets/api_analytics.lua b/luaui/Widgets/api_analytics.lua index 63f22600d75..a6b1eb1e466 100644 --- a/luaui/Widgets/api_analytics.lua +++ b/luaui/Widgets/api_analytics.lua @@ -2,12 +2,12 @@ local widget = widget --- @type Widget function widget:GetInfo() return { - name = "Analytics API", - desc = "Provides an API for sending analytics events using SendLuaUIMsg ", - author = "uBdead", - date = "Oct 2025", + name = "Analytics API", + desc = "Provides an API for sending analytics events using SendLuaUIMsg ", + author = "uBdead", + date = "Oct 2025", license = "GPL-v2", - layer = -1, -- expose API at init arbitrarily early, hopefully before want to use the API + layer = -1, -- expose API at init arbitrarily early, hopefully before want to use the API enabled = true, } end @@ -32,7 +32,9 @@ local function analyticsCoroutine(eventType, eventData) -- Add eventData incrementally if type(eventData) == "table" then local keys = {} - for k in pairs(eventData) do keys[#keys+1] = k end + for k in pairs(eventData) do + keys[#keys + 1] = k + end local i = 1 while i <= #keys do local k = keys[i] @@ -47,7 +49,7 @@ local function analyticsCoroutine(eventType, eventData) local jsonstr = Json.encode(jsondict) coroutine.yield() - + local b64str = string.base64Encode(jsonstr) coroutine.yield() @@ -58,7 +60,9 @@ local function analyticsCoroutine(eventType, eventData) end local function sendAnalyticsEvent(eventType, eventData) - local co = coroutine.create(function() analyticsCoroutine(eventType, eventData) end) + local co = coroutine.create(function() + analyticsCoroutine(eventType, eventData) + end) table.insert(pendingAnalytics, co) end @@ -68,7 +72,7 @@ function widget:Update() for i, co in ipairs(pendingAnalytics) do local status, res = coroutine.resume(co) if coroutine.status(co) == "dead" then - finished[#finished+1] = i + finished[#finished + 1] = i end end -- Remove finished coroutines diff --git a/luaui/Widgets/api_builder_queue.lua b/luaui/Widgets/api_builder_queue.lua index 6e4fb23eecf..23f4715bbc1 100644 --- a/luaui/Widgets/api_builder_queue.lua +++ b/luaui/Widgets/api_builder_queue.lua @@ -9,7 +9,7 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", version = 1, layer = 0, - enabled = true + enabled = true, } end @@ -61,11 +61,11 @@ local commandLookup = {} -- Event system for notifying consumers local Event = { - onBuildCommandAdded = 'onBuildCommandAdded', - onBuildCommandRemoved = 'onBuildCommandRemoved', - onUnitCreated = 'onUnitCreated', - onUnitFinished = 'onUnitFinished', - onBuilderDestroyed = 'onBuilderDestroyed', + onBuildCommandAdded = "onBuildCommandAdded", + onBuildCommandRemoved = "onBuildCommandRemoved", + onUnitCreated = "onUnitCreated", + onUnitFinished = "onUnitFinished", + onBuilderDestroyed = "onBuilderDestroyed", } local eventCallbacks = { @@ -73,7 +73,7 @@ local eventCallbacks = { [Event.onBuildCommandRemoved] = {}, [Event.onUnitCreated] = {}, [Event.onUnitFinished] = {}, - [Event.onBuilderDestroyed] = {} + [Event.onBuilderDestroyed] = {}, } local elapsedSeconds = 0 @@ -172,7 +172,7 @@ local function registerCallback(eventName, callback) if callbacks then tableInsert(callbacks, callback) ---@class BuilderQueueEventCallback - return {eventName = eventName, callback = callback} + return { eventName = eventName, callback = callback } else spEcho("Warn: Unknown event name " .. eventName) return nil @@ -199,7 +199,7 @@ end -------------------------------------------------------------------------------- local function generateId(unitDefId, positionX, positionZ) - return unitDefId .. '_' .. positionX .. '_' .. positionZ + return unitDefId .. "_" .. positionX .. "_" .. positionZ end local function removeBuilderFromCommand(commandId, unitId) @@ -293,9 +293,7 @@ local function checkBuilder(unitId, forceUpdate, batchCache) local firstCmd = firstCmds and firstCmds[1] if firstCmd and firstCmd.id < 0 then local params = firstCmd.params - if -firstCmd.id == cached.firstDefId - and mathFloor(params[1]) == cached.firstPosX - and mathFloor(params[3]) == cached.firstPosZ then + if -firstCmd.id == cached.firstDefId and mathFloor(params[1]) == cached.firstPosX and mathFloor(params[3]) == cached.firstPosZ then applyCommandSet(unitId, cached.commandIds) return end @@ -304,7 +302,9 @@ local function checkBuilder(unitId, forceUpdate, batchCache) end local queue = spGetUnitCommands(unitId, mathMin(queueDepth, MAX_QUEUE_DEPTH)) - if not queue then return end + if not queue then + return + end local newCommands = getTable() local firstBuildDefId = nil @@ -400,7 +400,9 @@ end local function clearUnit(unitId) local commandId = createdUnitIdToCommandIdMap[unitId] - if not commandId then return end + if not commandId then + return + end local commandData = buildCommands[commandId] if commandData then @@ -414,7 +416,9 @@ local function processNewBuildCommands() local batchCache = nil for unitId, commandClockTime in pairs(unitsAwaitingCommandProcessing) do if elapsedSeconds > commandClockTime then - if not batchCache then batchCache = {} end + if not batchCache then + batchCache = {} + end checkBuilder(unitId, true, batchCache) unitsAwaitingCommandProcessing[unitId] = nil @@ -475,11 +479,21 @@ function BuilderQueueApi.ForEachActiveBuildCommand(callback) end end -BuilderQueueApi.OnBuildCommandAdded = function(callback) return registerCallback(Event.onBuildCommandAdded, callback) end -BuilderQueueApi.OnBuildCommandRemoved = function(callback) return registerCallback(Event.onBuildCommandRemoved, callback) end -BuilderQueueApi.OnUnitCreated = function(callback) return registerCallback(Event.onUnitCreated, callback) end -BuilderQueueApi.OnUnitFinished = function(callback) return registerCallback(Event.onUnitFinished, callback) end -BuilderQueueApi.OnBuilderDestroyed = function(callback) return registerCallback(Event.onBuilderDestroyed, callback) end +BuilderQueueApi.OnBuildCommandAdded = function(callback) + return registerCallback(Event.onBuildCommandAdded, callback) +end +BuilderQueueApi.OnBuildCommandRemoved = function(callback) + return registerCallback(Event.onBuildCommandRemoved, callback) +end +BuilderQueueApi.OnUnitCreated = function(callback) + return registerCallback(Event.onUnitCreated, callback) +end +BuilderQueueApi.OnUnitFinished = function(callback) + return registerCallback(Event.onUnitFinished, callback) +end +BuilderQueueApi.OnBuilderDestroyed = function(callback) + return registerCallback(Event.onBuilderDestroyed, callback) +end BuilderQueueApi.UnregisterCallback = unregisterCallback -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/api_ignore.lua b/luaui/Widgets/api_ignore.lua index baa7b6a7205..9961cba0748 100644 --- a/luaui/Widgets/api_ignore.lua +++ b/luaui/Widgets/api_ignore.lua @@ -12,15 +12,14 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spEcho = Spring.Echo -local playernames = {} -- current game: playername to playerID -local validAccounts = {} -- current game: accountID to playername -local ignoredAccounts = {} -- globally ignored: accountID to playername +local playernames = {} -- current game: playername to playerID +local validAccounts = {} -- current game: accountID to playername +local ignoredAccounts = {} -- globally ignored: accountID to playername local ignoredAccountsAndNames = {} -- indexes by accountID and playername -local ignoredPlayers = {} -- old playernames method, we'll keep storing and try to convert this to the new ignoredAccounts table based on accountID +local ignoredPlayers = {} -- old playernames method, we'll keep storing and try to convert this to the new ignoredAccounts table based on accountID -- late rejoined/added spectators dont get a their own accountid but the last assigned playerID one instead so we'll have to ignore those -- THIS IS FUCKED UP BUT IT IS WHAT IT IS SOMEHOW @@ -37,19 +36,19 @@ local function processPlayerlist() local playerList = Spring.GetPlayerList() for _, playerID in ipairs(playerList) do local name, _, _, _, _, _, _, _, _, _, playerInfo = Spring.GetPlayerInfo(playerID) - if name and name ~= '' then + if name and name ~= "" then playernames[name] = playerID end local accountID = (playerInfo and playerInfo.accountid) and tonumber(playerInfo.accountid) or nil if accountID and validAccounts[accountID] then -- when a playername was ignored by the old widget method or when their accountID wasnt known (being late rejoining spectator) - if name and name ~= '' and ignoredPlayers[name] then + if name and name ~= "" and ignoredPlayers[name] then ignoredPlayers[name] = nil ignoredAccounts[accountID] = name end if ignoredAccounts[accountID] then ignoredAccountsAndNames[accountID] = playerID - if name and name ~= '' then + if name and name ~= "" then ignoredAccountsAndNames[name] = playerID end end @@ -58,62 +57,62 @@ local function processPlayerlist() end local function ignoreAccount(accountID) - if type(tonumber(accountID)) == 'number' then + if type(tonumber(accountID)) == "number" then accountID = tonumber(accountID) if not ignoredAccounts[accountID] and validAccounts[accountID] then -- ignore accountID - local resolvedName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(_,accountID) or '' - if resolvedName == '' then - resolvedName = validAccounts[accountID] or '' + local resolvedName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(_, accountID) or "" + if resolvedName == "" then + resolvedName = validAccounts[accountID] or "" end ignoredAccounts[accountID] = resolvedName - if resolvedName ~= '' then + if resolvedName ~= "" then ignoredAccountsAndNames[accountID] = resolvedName end -- ignore playerinfo name local validName = validAccounts[accountID] local playerID = validName and playernames[validName] - if validName and validName ~= '' then + if validName and validName ~= "" then ignoredAccountsAndNames[validName] = playerID or true end -- ignore aliassed name - if resolvedName ~= '' then + if resolvedName ~= "" then ignoredAccountsAndNames[resolvedName] = playerID or true end - spEcho(Spring.I18N('ui.ignore.ignored', { name = resolvedName, accountID = accountID })) + spEcho(Spring.I18N("ui.ignore.ignored", { name = resolvedName, accountID = accountID })) end - elseif accountID ~= '' then -- if accountID wasnt known and player name was supplied instead + elseif accountID ~= "" then -- if accountID wasnt known and player name was supplied instead local name = accountID if playernames[name] then ignoredPlayers[name] = true ignoredAccountsAndNames[name] = playernames[name] - spEcho(Spring.I18N('ui.ignore.ignored', { name = name, accountID = Spring.I18N('ui.ignore.unknown') })) + spEcho(Spring.I18N("ui.ignore.ignored", { name = name, accountID = Spring.I18N("ui.ignore.unknown") })) end end end local function unignoreAccount(accountID) - if type(tonumber(accountID)) == 'number' then + if type(tonumber(accountID)) == "number" then accountID = tonumber(accountID) if ignoredAccounts[accountID] and validAccounts[accountID] then - spEcho(Spring.I18N('ui.ignore.unignored', { name = ignoredAccounts[accountID], accountID = accountID })) + spEcho(Spring.I18N("ui.ignore.unignored", { name = ignoredAccounts[accountID], accountID = accountID })) ignoredAccountsAndNames[accountID] = nil ignoredAccountsAndNames[ignoredAccounts[accountID]] = nil ignoredAccountsAndNames[validAccounts[accountID]] = nil ignoredAccounts[accountID] = nil end - elseif accountID ~= '' then -- if accountID wasnt known and player name was supplied instead + elseif accountID ~= "" then -- if accountID wasnt known and player name was supplied instead local name = accountID if playernames[name] then ignoredPlayers[name] = nil ignoredAccountsAndNames[name] = nil - spEcho(Spring.I18N('ui.ignore.unignored', { name = name, accountID = Spring.I18N('ui.ignore.unknown') })) + spEcho(Spring.I18N("ui.ignore.unignored", { name = name, accountID = Spring.I18N("ui.ignore.unknown") })) end end end local function toggleignoreCmd(_, _, params) - for i=1, #params do + for i = 1, #params do if params[i] then if ignoredAccounts[tonumber(params[i])] or ignoredPlayers[params[i]] then unignoreAccount(params[i]) @@ -129,13 +128,13 @@ function widget:Initialize() for accountID, name in pairs(ignoredAccounts) do local pname = WG.playernames and WG.playernames.getPlayername(_, accountID, true) local displayName = pname and pname or name - if displayName and displayName ~= '' and not ignoredAccountsAndNames[accountID] then -- if not already added/in the game + if displayName and displayName ~= "" and not ignoredAccountsAndNames[accountID] then -- if not already added/in the game ignoredAccountsAndNames[displayName] = true end end processPlayerlist() WG.ignoredAccounts = ignoredAccountsAndNames - widgetHandler:AddAction("toggleignore", toggleignoreCmd, nil, 't') + widgetHandler:AddAction("toggleignore", toggleignoreCmd, nil, "t") end function widget:Shutdown() @@ -164,12 +163,12 @@ end function widget:SetConfigData(data) ignoredAccounts = data[1] and data[1] or {} -- clean out any empty string keys from persisted data - ignoredAccounts[''] = nil + ignoredAccounts[""] = nil data[1] = nil ignoredPlayers = data - ignoredPlayers[''] = nil + ignoredPlayers[""] = nil for name, _ in pairs(ignoredPlayers) do - if name ~= '' and not ignoredAccountsAndNames[name] then + if name ~= "" and not ignoredAccountsAndNames[name] then ignoredAccountsAndNames[name] = true end end diff --git a/luaui/Widgets/api_los_combiner_gl4.lua b/luaui/Widgets/api_los_combiner_gl4.lua index e04780f7510..e18bf655019 100644 --- a/luaui/Widgets/api_los_combiner_gl4.lua +++ b/luaui/Widgets/api_los_combiner_gl4.lua @@ -1,4 +1,3 @@ - -------------------------------------------------------------------------------- function widget:GetInfo() return { @@ -9,11 +8,10 @@ function widget:GetInfo() date = "2022.12.12", license = "Lua code is GPL V2, GLSL is (c) Beherith", layer = -10000, -- lol this isnt even a number - enabled = false -- disabled by default, its crazy! + enabled = false, -- disabled by default, its crazy! } end - -- Localized functions for performance local mathMax = math.max @@ -23,62 +21,58 @@ local spEcho = Spring.Echo -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- About: - -- This api provides the coarse, but merged LOS textures. - -- It is recommended to use the CubicSampler(vec2 uvsin, vec2 texdims); sampler when sampling this texture! - - -- It exploits truncation of values during blending to provide prevradar and prevlos values too! - -- The RED channel contains LOS level, where - -- 0.2-1.0 is LOS level - -- < 0.2 is _never_been_in_los! - -- the GREEN channel contains AIRLOS level - -- 0.2-1.0 is LOS level - -- < 0.2 is _never_been_in_los! - - -- the BLUE channel contains RADAR coverage - -- < 0.2 = never been in radar - -- fragColor.b = 0.2 + 0.8 * clamp(0.75 * radarJammer.r - 0.5 * (radarJammer.g - 0.5),0,1); - -- >0.2 = radar coverage - -- <0.5 = jammer - -- It runs every gameFrame - - +-- This api provides the coarse, but merged LOS textures. +-- It is recommended to use the CubicSampler(vec2 uvsin, vec2 texdims); sampler when sampling this texture! + +-- It exploits truncation of values during blending to provide prevradar and prevlos values too! +-- The RED channel contains LOS level, where +-- 0.2-1.0 is LOS level +-- < 0.2 is _never_been_in_los! +-- the GREEN channel contains AIRLOS level +-- 0.2-1.0 is LOS level +-- < 0.2 is _never_been_in_los! + +-- the BLUE channel contains RADAR coverage +-- < 0.2 = never been in radar +-- fragColor.b = 0.2 + 0.8 * clamp(0.75 * radarJammer.r - 0.5 * (radarJammer.g - 0.5),0,1); +-- >0.2 = radar coverage +-- <0.5 = jammer +-- It runs every gameFrame -- TODO: 2022.12.12 - -- [x] make it work? - -- [x] make api share? - -- [x] a clever thing might be to have 1 texture per allyteam? - -- some bugginess with jammer range? - -- +-- [x] make it work? +-- [x] make api share? +-- [x] a clever thing might be to have 1 texture per allyteam? +-- some bugginess with jammer range? +-- -- TODO 2022.12.20 - -- Read miplevels from modrules? +-- Read miplevels from modrules? -- TODO 2024.11.19 - -- [ ] Make the shader update at updaterate for true smoothness. - -- [ ] When does the LOS texture actually get updated though? - -- [ ] Would need to double-buffer the texture, and perform a swap every (15) gameframes - -- [ ] API must then expose the new and the old texture, and the progress factor between them. - -- [ ] The default 30hz smootheness is far from enough - -- [ ] The delayed approach is fucking stupid. - -- [ ] The mip level should be the 'smallest' mip level possible, and save a fused texture - -- [ ] Note that we must retain the 'never been seen'/ 'never been in radar' functionality - -- [ ] Are we sure that is the best - -- [ ] handle drawing onto the minimap? - +-- [ ] Make the shader update at updaterate for true smoothness. +-- [ ] When does the LOS texture actually get updated though? +-- [ ] Would need to double-buffer the texture, and perform a swap every (15) gameframes +-- [ ] API must then expose the new and the old texture, and the progress factor between them. +-- [ ] The default 30hz smootheness is far from enough +-- [ ] The delayed approach is fucking stupid. +-- [ ] The mip level should be the 'smallest' mip level possible, and save a fused texture +-- [ ] Note that we must retain the 'never been seen'/ 'never been in radar' functionality +-- [ ] Are we sure that is the best +-- [ ] handle drawing onto the minimap? local autoreload = false - -local miplevels = {2^3, 2^4, 2^3, 1} -- los, airlos and radar mip levels +local miplevels = { 2 ^ 3, 2 ^ 4, 2 ^ 3, 1 } -- los, airlos and radar mip levels local shaderConfig = { - TEXX = (Game.mapSizeX/(8 * miplevels[1])), - TEXY = (Game.mapSizeZ/(8 * miplevels[1])), + TEXX = (Game.mapSizeX / (8 * miplevels[1])), + TEXY = (Game.mapSizeZ / (8 * miplevels[1])), } --------------------------------------------------------------------------- local outputAlpha = 0.07 -local numFastUpdates = 10 -- how many quick updates to do on large-scale changes +local numFastUpdates = 10 -- how many quick updates to do on large-scale changes local updateRate = 2 -- on each Nth frame local updateInfoLOSTexture = 0 -- how many updates to do on next draw local delay = 1 @@ -97,7 +91,6 @@ local fullScreenQuadVAO = nil local vsSrcPath = "LuaUI/Shaders/api_los_combiner.vert.glsl" local fsSrcPath = "LuaUI/Shaders/api_los_combiner.frag.glsl" - local shaderSourceCache = { vssrcpath = vsSrcPath, fssrcpath = fsSrcPath, @@ -116,10 +109,9 @@ local shaderSourceCache = { [2] = "$info:radar", }, shaderName = "LOS Combiner GL4", - shaderConfig = shaderConfig + shaderConfig = shaderConfig, } - local function GetInfoLOSTexture(allyTeam) return infoTextures[allyTeam or currentAllyTeam] end @@ -132,13 +124,13 @@ local function CreateLosTexture() wrap_t = GL.CLAMP_TO_EDGE, fbo = true, format = GL.RGBA8, -- more than enough - }) + }) end local function InitLosTexture(allyTeam) - gl.RenderToTexture(infoTextures[allyTeam], function() - gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) - end) + gl.RenderToTexture(infoTextures[allyTeam], function() + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) + end) end local function renderToTextureFunc() -- this draws the fogspheres onto the texture @@ -171,7 +163,6 @@ local function UpdateInfoLOSTexture(count) gl.DepthMask(false) --"BK OpenGL state resets", reset to default state end - function widget:PlayerChanged(playerID) local newAllyTeam = Spring.GetMyAllyTeamID() if currentAllyTeam ~= newAllyTeam then -- do a few quick renders @@ -179,7 +170,7 @@ function widget:PlayerChanged(playerID) updateInfoLOSTexture = numFastUpdates delay = 5 end - if updateInfoLOSTexture > 0 and autoreload then + if updateInfoLOSTexture > 0 and autoreload then spEcho("Fast Updating infolos texture for", currentAllyTeam, updateInfoLOSTexture, "times") end end @@ -190,10 +181,10 @@ function widget:Initialize() return end - for name, tex in pairs({LOS = "$info:los", AIRLOS = "$info:airlos", RADAR = "$info:radar" }) do + for name, tex in pairs({ LOS = "$info:los", AIRLOS = "$info:airlos", RADAR = "$info:radar" }) do local texInfo = gl.TextureInfo(tex) - shaderConfig[name .. 'XSIZE'] = texInfo.xsize - shaderConfig[name .. 'YSIZE'] = texInfo.ysize + shaderConfig[name .. "XSIZE"] = texInfo.xsize + shaderConfig[name .. "YSIZE"] = texInfo.ysize end currentAllyTeam = Spring.GetMyAllyTeamID() @@ -201,7 +192,7 @@ function widget:Initialize() infoTextures[a] = CreateLosTexture() end - infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) + infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) if not infoShader then spEcho("Failed to create InfoLOS GL4 shader") widgetHandler:RemoveWidget() @@ -215,24 +206,24 @@ function widget:Initialize() return end - fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO()-- -1, -1, 1, 0, 0,0,1, 0.5 + fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO() -- -1, -1, 1, 0, 0,0,1, 0.5 - WG['api_los_combiner'] = {} - WG['api_los_combiner'].GetInfoLOSTexture = GetInfoLOSTexture - widgetHandler:RegisterGlobal('GetInfoLOSTexture', WG['api_los_combiner'].GetInfoLOSTexture) + WG["api_los_combiner"] = {} + WG["api_los_combiner"].GetInfoLOSTexture = GetInfoLOSTexture + widgetHandler:RegisterGlobal("GetInfoLOSTexture", WG["api_los_combiner"].GetInfoLOSTexture) end function widget:Shutdown() for i, infoTexture in pairs(infoTextures) do - gl.DeleteTexture(infoTexture) - end - WG['api_los_combiner'] = nil - widgetHandler:DeregisterGlobal('GetInfoLOSTexture') + gl.DeleteTexture(infoTexture) + end + WG["api_los_combiner"] = nil + widgetHandler:DeregisterGlobal("GetInfoLOSTexture") end function widget:GameFrame(n) if (n % updateRate) == 0 then - updateInfoLOSTexture = mathMax(1,updateInfoLOSTexture) + updateInfoLOSTexture = mathMax(1, updateInfoLOSTexture) end end local lastUpdate = Spring.GetTimer() @@ -244,10 +235,9 @@ function widget:DrawGenesis() -- outputAlpha = math.min(1.0, mathMax(0.07,deltat)) -- spEcho(deltat,outputAlpha) - if updateInfoLOSTexture > 0 then if delay > 0 then - delay = delay -1 + delay = delay - 1 else UpdateInfoLOSTexture(updateInfoLOSTexture) updateInfoLOSTexture = 0 @@ -256,21 +246,23 @@ function widget:DrawGenesis() end end -if autoreload then - function widget:DrawScreen() -- the debug display output - infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or infoShader - gl.Color(1,1,1,1) -- use this to show individual channels of the texture! - gl.Texture(0, infoTextures[currentAllyTeam]) - gl.Blending(GL.ONE, GL.ZERO) - gl.Culling(false) - gl.TexRect(0, 0, shaderConfig.TEXX, shaderConfig.TEXY, 0, 0, 1, 1) -- REMEMBER THAT THIS UPSIDE DOWN! - - gl.Text(tostring(currentAllyTeam), shaderConfig.TEXX, shaderConfig.TEXY,16) - gl.Texture(0,"$info:los") - gl.TexRect(texX, 0, texX + shaderConfig['LOSXSIZE'], shaderConfig['LOSYSIZE'], 0, 1, 1, 0) - gl.Texture(0,false) - - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - if infoShader.DrawPrintf then infoShader.DrawPrintf() end - end +if autoreload then + function widget:DrawScreen() -- the debug display output + infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or infoShader + gl.Color(1, 1, 1, 1) -- use this to show individual channels of the texture! + gl.Texture(0, infoTextures[currentAllyTeam]) + gl.Blending(GL.ONE, GL.ZERO) + gl.Culling(false) + gl.TexRect(0, 0, shaderConfig.TEXX, shaderConfig.TEXY, 0, 0, 1, 1) -- REMEMBER THAT THIS UPSIDE DOWN! + + gl.Text(tostring(currentAllyTeam), shaderConfig.TEXX, shaderConfig.TEXY, 16) + gl.Texture(0, "$info:los") + gl.TexRect(texX, 0, texX + shaderConfig["LOSXSIZE"], shaderConfig["LOSYSIZE"], 0, 1, 1, 0) + gl.Texture(0, false) + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + if infoShader.DrawPrintf then + infoShader.DrawPrintf() + end + end end diff --git a/luaui/Widgets/api_object_spotlight.lua b/luaui/Widgets/api_object_spotlight.lua index 6cfd9e04bb5..904ef31a201 100644 --- a/luaui/Widgets/api_object_spotlight.lua +++ b/luaui/Widgets/api_object_spotlight.lua @@ -53,8 +53,7 @@ local spotlightTypes = { isValid = function(position) return true end, - postProcessVBO = function(vbo) - end, + postProcessVBO = function(vbo) end, }, } @@ -251,22 +250,14 @@ local function makeCylinderVBO(sections) local numVertices = #vboData / 3 - vbo:Define( - numVertices, - spotlightVBOLayout - ) + vbo:Define(numVertices, spotlightVBOLayout) vbo:Upload(vboData) return vbo, numVertices end local function makeInstanceVBO(layout, vertexVBO, numVertices, name) - local vbo = InstanceVBOTable.makeInstanceVBOTable( - layout, - nil, - name, - 6 - ) + local vbo = InstanceVBOTable.makeInstanceVBOTable(layout, nil, name, 6) vbo.vertexVBO = vertexVBO vbo.numVertices = numVertices vbo.VAO = InstanceVBOTable.makeVAOandAttach(vbo.vertexVBO, vbo.instanceVBO) @@ -278,12 +269,7 @@ local function initGL4() instanceVBOs = {} for spotlightType, spec in pairs(spotlightTypes) do - local vbo = makeInstanceVBO( - instanceVBOLayout, - cylinderVBO, - cylinderVertices, - "api_object_spotlight_" .. spotlightType - ) + local vbo = makeInstanceVBO(instanceVBOLayout, cylinderVBO, cylinderVertices, "api_object_spotlight_" .. spotlightType) if spec.postProcessVBO then spec.postProcessVBO(vbo) @@ -293,13 +279,10 @@ local function initGL4() end local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() - shader = LuaShader( - { - vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), - fragment = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), - }, - "api_object_spotlight" - ) + shader = LuaShader({ + vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), + fragment = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), + }, "api_object_spotlight") local shaderCompiled = shader:Initialize() return shaderCompiled end @@ -340,8 +323,7 @@ local function addSpotlight(objectType, owner, objectID, color, options) options = options or {} -- radius - local radius = (options.radiusCoefficient or 1) * - (options.radius or spotlightTypes[objectType].getDefaultRadius(objectID) or DEFAULT_RADIUS) + local radius = (options.radiusCoefficient or 1) * (options.radius or spotlightTypes[objectType].getDefaultRadius(objectID) or DEFAULT_RADIUS) -- height local height = (options.heightCoefficient or 1) * (options.height or DEFAULT_CYLINDER_HEIGHT) @@ -380,22 +362,23 @@ local function addSpotlight(objectType, owner, objectID, color, options) if not objectInstanceIDs[objectType][objectID] then objectInstanceIDs[objectType][objectID] = {} end - objectInstanceIDs[objectType][objectID][owner] = pushElementInstance( - instanceVBOs[objectType], - { - radius, -- { id = 1, name = "radius", size = 1 } - height, -- { id = 2, name = "height", size = 1 } - color[1], color[2], color[3], color[4], -- { id = 3, name = "color", size = 4 } - startTime or 0, -- { id = 4, name = "startTime", size = 1 }, - expireTime or 0, -- { id = 5, name = "expireTime", size = 1 }, - 0, 0, 0, 0, -- { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT } - instanceWorldPosOverride[1], instanceWorldPosOverride[2], instanceWorldPosOverride[3], -- { id = 7, name = "worldPosOverride", size = 3 }, - }, - objectInstanceIDs[objectType][objectID][owner], - true, - false, - instanceObjectID - ) + objectInstanceIDs[objectType][objectID][owner] = pushElementInstance(instanceVBOs[objectType], { + radius, -- { id = 1, name = "radius", size = 1 } + height, -- { id = 2, name = "height", size = 1 } + color[1], + color[2], + color[3], + color[4], -- { id = 3, name = "color", size = 4 } + startTime or 0, -- { id = 4, name = "startTime", size = 1 }, + expireTime or 0, -- { id = 5, name = "expireTime", size = 1 }, + 0, + 0, + 0, + 0, -- { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT } + instanceWorldPosOverride[1], + instanceWorldPosOverride[2], + instanceWorldPosOverride[3], -- { id = 7, name = "worldPosOverride", size = 3 }, + }, objectInstanceIDs[objectType][objectID][owner], true, false, instanceObjectID) end local function removeSpotlight(objectType, owner, objectID) @@ -432,26 +415,18 @@ local function removeSpotlight(objectType, owner, objectID) end local function getSpotlights(objectType, owner) - return table.reduce( - objectOwners[objectType], - function(acc, v, k) - if v[owner] then - acc[#acc + 1] = k - end - return acc - end, - {} - ) + return table.reduce(objectOwners[objectType], function(acc, v, k) + if v[owner] then + acc[#acc + 1] = k + end + return acc + end, {}) end local function removeAllSpotlights(owner) for objectType in pairs(spotlightTypes) do for _, id in ipairs(getSpotlights(objectType, owner)) do - removeSpotlight( - objectType, - owner, - id - ) + removeSpotlight(objectType, owner, id) end end end @@ -511,13 +486,7 @@ function widget:DrawWorld() for spotlightType, vbo in pairs(instanceVBOs) do if vbo.usedElements > 0 then - vbo.VAO:DrawArrays( - GL.TRIANGLE_STRIP, - vbo.numVertices, - 0, - vbo.usedElements, - 0 - ) + vbo.VAO:DrawArrays(GL.TRIANGLE_STRIP, vbo.numVertices, 0, vbo.usedElements, 0) end end diff --git a/luaui/Widgets/api_playernames.lua b/luaui/Widgets/api_playernames.lua index 94969fb3e84..d8007d19bed 100644 --- a/luaui/Widgets/api_playernames.lua +++ b/luaui/Widgets/api_playernames.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local tableInsert = table.insert local tableSort = table.sort @@ -24,16 +23,16 @@ local tableConcat = table.concat local spEcho = Spring.Echo local applyFirstEncounteredName = false -local maxHistorySize = 3000 -- max number of accounts in history -local maxNamesSize = 4500 -- max number of names in history +local maxHistorySize = 3000 -- max number of accounts in history +local maxNamesSize = 4500 -- max number of names in history local cleanupAmount = 300 local history = {} -local validAccounts = {} -- accountID to playerID -local currentNames = {} -- playerID to name -local currentAccounts = {} -- accountID to name +local validAccounts = {} -- accountID to playerID +local currentNames = {} -- playerID to name +local currentAccounts = {} -- accountID to name -local reconnected = false -- flag to track if this is a reconnection/reload +local reconnected = false -- flag to track if this is a reconnection/reload local spGetPlayerInfo = Spring.GetPlayerInfo @@ -112,21 +111,16 @@ local function packHistory(historyTable) names[#names + 1] = { idx = k, name = v } end end - tableSort(names, function(a, b) return a.idx < b.idx end) + tableSort(names, function(a, b) + return a.idx < b.idx + end) local nameParts = {} for i = 1, #names do nameParts[i] = escapeField(names[i].name) end - records[#records + 1] = stringFormat( - "%d|%d|%d|%s|%s", - accountID, - tonumber(data.i) or 1, - tonumber(data.d) or 0, - escapeField(data.alias or ""), - tableConcat(nameParts, ",") - ) + records[#records + 1] = stringFormat("%d|%d|%d|%s|%s", accountID, tonumber(data.i) or 1, tonumber(data.d) or 0, escapeField(data.alias or ""), tableConcat(nameParts, ",")) end end @@ -189,16 +183,16 @@ local function getPlayername(playerID, accountID, skipAlias) name, _, _, _, _, _, _, _, _, _, playerInfo = spGetPlayerInfo(playerID) accountID = (playerInfo and playerInfo.accountid) and tonumber(playerInfo.accountid) or false if validAccounts[accountID] ~= playerID then - accountID = nil -- skip late added spectators that use an already existing accountID + accountID = nil -- skip late added spectators that use an already existing accountID end end - if name ~= 'unknown' then + if name ~= "unknown" then if accountID then -- find if name exists inhistory local inHistory = false if history[accountID] then - for i, historyName in pairs(history[accountID]) do -- using pairs only in case people carelessly delete names from widgetconfig (BYAR.lua) + for i, historyName in pairs(history[accountID]) do -- using pairs only in case people carelessly delete names from widgetconfig (BYAR.lua) if historyName == name then inHistory = true break @@ -261,17 +255,17 @@ local function actualizeHistory() local numAccounts, numNames = 0, 0 for _, names in pairs(history) do numAccounts = numAccounts + 1 - numNames = numNames + #names -- wont count custom alias + numNames = numNames + #names -- wont count custom alias end if numAccounts > maxHistorySize or numNames > maxNamesSize then -- cleanup logic: remove oldest entries based on date local accountsByDate = {} for accountID, data in pairs(history) do if data.d then - tableInsert(accountsByDate, {accountID = accountID, date = tonumber(data.d)}) + tableInsert(accountsByDate, { accountID = accountID, date = tonumber(data.d) }) else -- if no date, treat as very old (assign a very old date) - tableInsert(accountsByDate, {accountID = accountID, date = 1}) + tableInsert(accountsByDate, { accountID = accountID, date = 1 }) end end @@ -289,7 +283,7 @@ local function actualizeHistory() local accountID = entry.accountID local accountData = history[accountID] - if accountData and not accountData.alias then -- don't remove accounts with aliases + if accountData and not accountData.alias then -- don't remove accounts with aliases removedAccounts = removedAccounts + 1 removedNames = removedNames + #accountData history[accountID] = nil @@ -301,7 +295,7 @@ end local function setaliasCmd(_, _, params) if params[1] then local playerID - if type(tonumber(params[1])) == 'number' then + if type(tonumber(params[1])) == "number" then playerID = tonumber(params[1]) else for pID, name in pairs(currentNames) do @@ -317,7 +311,7 @@ local function setaliasCmd(_, _, params) if accountID then local alias = params[2] if alias then - spEcho(Spring.I18N('ui.playernames.setalias', { name = name, accountID = accountID, alias = alias })) + spEcho(Spring.I18N("ui.playernames.setalias", { name = name, accountID = accountID, alias = alias })) -- ensure history entry exists if not history[accountID] then history[accountID] = { i = 1, d = tonumber(os.date("%y%m%d")), [1] = name } @@ -328,7 +322,7 @@ local function setaliasCmd(_, _, params) else -- ensure history entry exists before accessing alias if history[accountID] and history[accountID].alias then - spEcho(Spring.I18N('ui.playernames.removealias', { name = name, accountID = accountID, alias = history[accountID].alias })) + spEcho(Spring.I18N("ui.playernames.removealias", { name = name, accountID = accountID, alias = history[accountID].alias })) currentNames[playerID] = name currentAccounts[accountID] = name history[accountID].alias = nil @@ -339,8 +333,7 @@ local function setaliasCmd(_, _, params) Spring.SendCommands("luaui reload") end else - - spEcho(Spring.I18N('ui.playernames.notfound', { param = params[1] })) + spEcho(Spring.I18N("ui.playernames.notfound", { param = params[1] })) end end end @@ -371,7 +364,7 @@ function widget:Initialize() WG.playernames.getUseFirstEncounter = function() return applyFirstEncounteredName end - widgetHandler:AddAction("setalias", setaliasCmd, nil, 't') + widgetHandler:AddAction("setalias", setaliasCmd, nil, "t") end function widget:Shutdown() diff --git a/luaui/Widgets/api_resource_spot_builder.lua b/luaui/Widgets/api_resource_spot_builder.lua index 9755cd9d9e9..451456e9d5a 100644 --- a/luaui/Widgets/api_resource_spot_builder.lua +++ b/luaui/Widgets/api_resource_spot_builder.lua @@ -9,11 +9,10 @@ function widget:GetInfo() date = "Oct 23, 2010; last update: April 12, 2022", license = "GNU GPL, v2 or later", layer = -1, -- load before all widgets that need these mex/geo building tools - enabled = true + enabled = true, } end - -- Localized functions for performance local mathAbs = math.abs local mathMax = math.max @@ -43,7 +42,6 @@ local Game_extractorRadius = Game.extractorRadius local isPregame = Spring.GetGameFrame() == 0 and not Spring.GetSpectatingState() - ------------------------------------------------------------ -- unit tables ------------------------------------------------------------ @@ -96,7 +94,6 @@ for uDefID, uDef in pairs(UnitDefs) do end end - ------------------------------------------------------------ -- Building logic ------------------------------------------------------------ @@ -107,7 +104,9 @@ local function spotHasExtractor(spot) local units = Spring.GetUnitsInCylinder(spot.x, spot.z, Game_extractorRadius) local type = spot.isMex and mexBuildings or geoBuildings for j = 1, #units do - if type[spGetUnitDefID(units[j])] then return units[j] end + if type[spGetUnitDefID(units[j])] then + return units[j] + end end return false end @@ -125,7 +124,7 @@ local function spotHasExtractorQueued(spot, builders) local id = command.id and -command.id or command[1] local x = command.params and command.params[1] or command[2] local z = command.params and command.params[3] or command[4] - if (mexBuildings[id] or geoBuildings[id]) then + if mexBuildings[id] or geoBuildings[id] then local dist = math.distance2dSquared(spot.x, spot.z, x, z) -- Save a sqrt by multiplying by 4 -- Note that this is calculating by diameter, and could be too aggressive on maps with closely spaced mexes @@ -139,9 +138,8 @@ local function spotHasExtractorQueued(spot, builders) end if isPregame then - local queue = WG['pregame-build'].getBuildQueue() + local queue = WG["pregame-build"].getBuildQueue() return checkQueue(queue) - else for i = 1, #builders do -- GetUnitCommands returns nil if enemy unit is selected (with godmode on) @@ -169,7 +167,7 @@ local function getBestExtractorFromBuilders(units, constructorIds, extractors) if constructor then local buildingID = -constructor.building[1] local extractionAmount = extractors[buildingID] - if (extractionAmount > bestExtraction) then + if extractionAmount > bestExtraction then bestExtraction = extractionAmount bestExtractor = buildingID end @@ -198,10 +196,10 @@ local function extractorCanBeUpgraded(currentExtractorUuid, newExtractorId) local newExtractorIsSpecial = newExtractor.stealth or #newExtractor.weapons > 0 - if (newExtractorStrength > currentExtractorStrength) then + if newExtractorStrength > currentExtractorStrength then return true end - if (newExtractorStrength == currentExtractorStrength and newExtractorIsSpecial) then + if newExtractorStrength == currentExtractorStrength and newExtractorIsSpecial then return true end if currentExtractorStrength == newExtractorStrength then @@ -228,7 +226,7 @@ local function extractorCanBeBuiltOnSpot(spot, extractorId) local isExtractor = spot.isMex and mexBuildings[uDefId] or geoBuildings[uDefId] local canUpgrade = extractorCanBeUpgraded(uid, extractorId) local isBeingBuilt, _ = spGetUnitIsBeingBuilt(uid) - if (isExtractor and (not canUpgrade or isBeingBuilt)) then + if isExtractor and (not canUpgrade or isBeingBuilt) then return false end end @@ -328,7 +326,7 @@ local function sortBuilders(units, constructorIds, buildingId, shift) for i, uid in pairs(secondaryBuilders) do local mainBuilderId = mainBuilders[index] if not shift then - spGiveOrderToUnit(uid, CMD_GUARD, { mainBuilderId }, { }) + spGiveOrderToUnit(uid, CMD_GUARD, { mainBuilderId }, {}) index = index + 1 end -- if we give a guard order on a unit already guarded with shift, it will get cancelled @@ -338,10 +336,14 @@ local function sortBuilders(units, constructorIds, buildingId, shift) index = index + 1 end - if index > #mainBuilders then index = 1 end + if index > #mainBuilders then + index = 1 + end end - if #mainBuilders == 0 then return end + if #mainBuilders == 0 then + return + end return mainBuilders end @@ -385,9 +387,9 @@ local function PreviewExtractorCommand(params, extractor, spot, metalMap) if occupiedSpot then local occupiedPos = { spGetUnitPosition(occupiedSpot) } targetPos = { x = occupiedPos[1], y = occupiedPos[2], z = occupiedPos[3] } - targetOwner = spGetUnitTeam(occupiedSpot) -- because gadget "Mex Upgrade Reclaimer" will share a t2 mex build upon ally t1 mex + targetOwner = spGetUnitTeam(occupiedSpot) -- because gadget "Mex Upgrade Reclaimer" will share a t2 mex build upon ally t1 mex else - local buildingPositions = WG['resource_spot_finder'].GetBuildingPositions(spot, -buildingId, 0, true) + local buildingPositions = WG["resource_spot_finder"].GetBuildingPositions(spot, -buildingId, 0, true) targetPos = math.getClosestPosition(cmdX, cmdZ, buildingPositions) targetOwner = spGetMyTeamID() end @@ -439,13 +441,12 @@ local function ApplyPreviewCmds(cmds, constructorIds, shift) else fakeShift = true end - local opt = fakeShift and { "shift" } or { } + local opt = fakeShift and { "shift" } or {} Spring.GiveOrderToUnitArray(unitArray, -buildingId, orderParams, opt) end end end - ------------------------------------------------------------ -- Callins ------------------------------------------------------------ @@ -487,7 +488,7 @@ function widget:Initialize() end -- make interfaces available to other widgets: - WG['resource_spot_builder'] = { + WG["resource_spot_builder"] = { ExtractorCanBeBuiltOnSpot = extractorCanBeBuiltOnSpot, ExtractorCanBeUpgraded = extractorCanBeUpgraded, FindNearestValidSpotForExtractor = findNearestValidSpotForExtractor, @@ -501,19 +502,19 @@ function widget:Initialize() -- builders and buildings - MEX ---------------------------------------------- - WG['resource_spot_builder'].GetMexConstructors = function() + WG["resource_spot_builder"].GetMexConstructors = function() return mexConstructors end - WG['resource_spot_builder'].GetMexBuildings = function() + WG["resource_spot_builder"].GetMexBuildings = function() return mexBuildings end - WG['resource_spot_builder'].GetGeoConstructors = function() + WG["resource_spot_builder"].GetGeoConstructors = function() return geoConstructors end - WG['resource_spot_builder'].GetGeoBuildings = function() + WG["resource_spot_builder"].GetGeoBuildings = function() return geoBuildings end end diff --git a/luaui/Widgets/api_screencopy_manager.lua b/luaui/Widgets/api_screencopy_manager.lua index 066b568f672..901d474ebe1 100644 --- a/luaui/Widgets/api_screencopy_manager.lua +++ b/luaui/Widgets/api_screencopy_manager.lua @@ -1,19 +1,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "API Screencopy Manager", - desc = "Provides a per-frame shared screencopy to any widget/gadget requesting it", - author = "Beherith", - date = "2022.02.18", - license = "GNU GPL, v2 or later", - layer = -828888, -- This means it runs late in the render order - handler = true, - enabled = true - } + return { + name = "API Screencopy Manager", + desc = "Provides a per-frame shared screencopy to any widget/gadget requesting it", + author = "Beherith", + date = "2022.02.18", + license = "GNU GPL, v2 or later", + layer = -828888, -- This means it runs late in the render order + handler = true, + enabled = true, + } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetViewGeometry = Spring.GetViewGeometry @@ -24,7 +23,7 @@ local spGetViewGeometry = Spring.GetViewGeometry -- GUIshader - Done -- dont care if its not sharpened, in fact! -- CAS - Done -- TODO: - -- distortionFBO - hard because large areas might have a noticable lack of sharpening... +-- distortionFBO - hard because large areas might have a noticable lack of sharpening... -- Code snippet to use if you want to request a copy: -- also note that the first copy will return nil, as its all black! @@ -38,7 +37,8 @@ local spGetViewGeometry = Spring.GetViewGeometry return end if screencopy == nil then return end -]]-- +]] +-- -- Also provide a depth copy too! -- For correct render order, the depth copy should be requested before things like healthbars. @@ -47,7 +47,6 @@ local spGetViewGeometry = Spring.GetViewGeometry local ScreenCopy local lastScreenCopyFrame - local DepthCopy local lastDepthCopyFrame @@ -56,8 +55,10 @@ local firstCopy = true function widget:ViewResize() vsx, vsy, vpx, vpy = spGetViewGeometry() - if ScreenCopy then gl.DeleteTexture(ScreenCopy) end - ScreenCopy = gl.CreateTexture(vsx , vsy, { + if ScreenCopy then + gl.DeleteTexture(ScreenCopy) + end + ScreenCopy = gl.CreateTexture(vsx, vsy, { border = false, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, @@ -66,8 +67,10 @@ function widget:ViewResize() }) local GL_DEPTH_COMPONENT32 = 0x81A7 - if DepthCopy then gl.DeleteTexture(DepthCopy) end - DepthCopy = gl.CreateTexture(vsx , vsy, { + if DepthCopy then + gl.DeleteTexture(DepthCopy) + end + DepthCopy = gl.CreateTexture(vsx, vsy, { border = false, format = GL_DEPTH_COMPONENT32, min_filter = GL.NEAREST, @@ -75,8 +78,12 @@ function widget:ViewResize() wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, }) - if not ScreenCopy then spEcho("ScreenCopy Manager failed to create a ScreenCopy") end - if not DepthCopy then spEcho("ScreenCopy Manager failed to create a DepthCopy") end + if not ScreenCopy then + spEcho("ScreenCopy Manager failed to create a ScreenCopy") + end + if not DepthCopy then + spEcho("ScreenCopy Manager failed to create a DepthCopy") + end end local function GetScreenCopy() @@ -93,7 +100,6 @@ local function GetScreenCopy() return ScreenCopy end - local function GetDepthCopy() local df = Spring.GetDrawFrame() --spEcho("GetScreenCopy", df) @@ -108,7 +114,6 @@ local function GetDepthCopy() return DepthCopy end - function widget:Initialize() if gl.CopyToTexture == nil then spEcho("ScreenCopy Manager API: your hardware is missing the necessary CopyToTexture feature") @@ -116,17 +121,17 @@ function widget:Initialize() return false end self:ViewResize(vsx, vsy) - WG['screencopymanager'] = {} - WG['screencopymanager'].GetScreenCopy = GetScreenCopy - WG['screencopymanager'].GetDepthCopy = GetDepthCopy - widgetHandler:RegisterGlobal('GetScreenCopy', WG['screencopymanager'].GetScreenCopy) - widgetHandler:RegisterGlobal('GetDepthCopy', WG['screencopymanager'].GetDepthCopy) + WG["screencopymanager"] = {} + WG["screencopymanager"].GetScreenCopy = GetScreenCopy + WG["screencopymanager"].GetDepthCopy = GetDepthCopy + widgetHandler:RegisterGlobal("GetScreenCopy", WG["screencopymanager"].GetScreenCopy) + widgetHandler:RegisterGlobal("GetDepthCopy", WG["screencopymanager"].GetDepthCopy) end function widget:Shutdown() gl.DeleteTexture(ScreenCopy or 0) gl.DeleteTexture(DepthCopy or 0) - WG['screencopymanager'] = nil - widgetHandler:DeregisterGlobal('GetScreenCopy') - widgetHandler:DeregisterGlobal('GetDepthCopy') + WG["screencopymanager"] = nil + widgetHandler:DeregisterGlobal("GetScreenCopy") + widgetHandler:DeregisterGlobal("GetDepthCopy") end diff --git a/luaui/Widgets/api_shared_state.lua b/luaui/Widgets/api_shared_state.lua index dc4e22363c9..b8bac12bfed 100644 --- a/luaui/Widgets/api_shared_state.lua +++ b/luaui/Widgets/api_shared_state.lua @@ -2,48 +2,48 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Shared State API", - desc = "Provides commonly-queried game state via WG to avoid redundant Spring API calls across widgets", - author = "BAR Team", - date = "2026", - license = "GNU GPL, v2 or later", - layer = -math.huge, -- load first so state is available to all widgets - enabled = true, - handler = true, + name = "Shared State API", + desc = "Provides commonly-queried game state via WG to avoid redundant Spring API calls across widgets", + author = "BAR Team", + date = "2026", + license = "GNU GPL, v2 or later", + layer = -math.huge, -- load first so state is available to all widgets + enabled = true, + handler = true, } end -- Local references to Spring API calls -local spGetMyTeamID = Spring.GetMyTeamID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyPlayerID = Spring.GetMyPlayerID local spGetSpectatingState = Spring.GetSpectatingState -local spGetGameFrame = Spring.GetGameFrame -local spIsGUIHidden = Spring.IsGUIHidden -local spGetViewGeometry = Spring.GetViewGeometry +local spGetGameFrame = Spring.GetGameFrame +local spIsGUIHidden = Spring.IsGUIHidden +local spGetViewGeometry = Spring.GetViewGeometry local isReplay = Spring.IsReplay() -- The shared state table local state = { - myTeamID = spGetMyTeamID(), - myAllyTeamID = spGetMyAllyTeamID(), - myPlayerID = spGetMyPlayerID(), - isSpec = select(1, spGetSpectatingState()), - isFullView = select(2, spGetSpectatingState()), - isReplay = isReplay, - gameFrame = spGetGameFrame(), - vsx = 0, - vsy = 0, - isGUIHidden = false, + myTeamID = spGetMyTeamID(), + myAllyTeamID = spGetMyAllyTeamID(), + myPlayerID = spGetMyPlayerID(), + isSpec = select(1, spGetSpectatingState()), + isFullView = select(2, spGetSpectatingState()), + isReplay = isReplay, + gameFrame = spGetGameFrame(), + vsx = 0, + vsy = 0, + isGUIHidden = false, } local function refreshPlayerState() - state.myTeamID = spGetMyTeamID() + state.myTeamID = spGetMyTeamID() state.myAllyTeamID = spGetMyAllyTeamID() - state.myPlayerID = spGetMyPlayerID() + state.myPlayerID = spGetMyPlayerID() local spec, fullView = spGetSpectatingState() - state.isSpec = spec + state.isSpec = spec state.isFullView = fullView end @@ -52,11 +52,11 @@ function widget:Initialize() state.vsx = vsx state.vsy = vsy state.isGUIHidden = spIsGUIHidden() - WG['sharedstate'] = state + WG["sharedstate"] = state end function widget:Shutdown() - WG['sharedstate'] = nil + WG["sharedstate"] = nil end function widget:PlayerChanged(playerID) diff --git a/luaui/Widgets/api_unit_tracker_gl4.lua b/luaui/Widgets/api_unit_tracker_gl4.lua index bbae88014b0..0254cdd073f 100644 --- a/luaui/Widgets/api_unit_tracker_gl4.lua +++ b/luaui/Widgets/api_unit_tracker_gl4.lua @@ -1,20 +1,19 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "API Unit Tracker DEVMODE GL4", - desc = "Manages alliedunitslist, visibleunitslist", - author = "Beherith", - date = "2022.02.18", - license = "GNU GPL, v2 or later", - layer = -828888, - handler = true, - enabled = true, - depends = {'gl4'} - } + return { + name = "API Unit Tracker DEVMODE GL4", + desc = "Manages alliedunitslist, visibleunitslist", + author = "Beherith", + date = "2022.02.18", + license = "GNU GPL, v2 or later", + layer = -828888, + handler = true, + enabled = true, + depends = { "gl4" }, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -34,9 +33,9 @@ local L_DEPRECATED = LOG.DEPRECATED -- Widget draw classes: -- widgets that draw stuff for all visible units (trivial case) -- widgets that only draw for allies, turn into widgets that draw for all once you enter specfullview - -- which is pretty much just sensor ranges los - -- rank icons - -- flank icons +-- which is pretty much just sensor ranges los +-- rank icons +-- flank icons -- TODO: -- filter decoration unitDefIDs, but not gaia (neutrals) -- done @@ -56,7 +55,6 @@ local L_DEPRECATED = LOG.DEPRECATED -- SUPER IMPORTANT: NEVER EVER ADD UNITS TO A VBO TABLE THAT ARE IN unitDefIgnore! -- As the unit tracker api wont track them as actual units, and wont ever remove them either! - local alliedUnits = {} -- table of unitID : unitDefID local alliedUnitsTeam = {} -- table of unitID : unitTeam local numAlliedUnits = 0 @@ -80,7 +78,6 @@ for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.isFactory then factoryUnitDefIDs[unitDefID] = unitDef.name end - end --- GL4 STUFF --- @@ -89,7 +86,7 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local unitTrackerVBO = nil local unitTrackerShader = nil @@ -97,13 +94,13 @@ local luaShaderDir = "LuaUI/Include/" local texture = "luaui/images/solid.png" local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.TRANSPARENCY = 0.5 shaderConfig.ANIMATION = 0 shaderConfig.HEIGHTOFFSET = 3.99 - -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader + -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader --shaderConfig.POST_VERTEX = "v_parameters.w = max(-0.2, sin(timeInfo.x * 2.0/30.0 + (v_centerpos.x + v_centerpos.z) * 0.1)) + 0.2; // match CUS glow rate" unitTrackerVBO, unitTrackerShader = InitDrawPrimitiveAtUnit(shaderConfig, "unitTracker") end @@ -131,13 +128,13 @@ local scriptLuauiAlliedUnitsChanged local function Scream(reason, unitID) -- This will pause the game and play some sound to alert anyone in debug mode of issue --Spring.Debug.TraceFullEcho(nil,nil,nil, reason) - Spring.Debug.TraceEcho('API Unit Tracker error', reason) + Spring.Debug.TraceEcho("API Unit Tracker error", reason) if unitID ~= nil then -- gather as much info as possible about this unitID local unitDefID = spGetUnitDefID(unitID) local unitTeam = spGetUnitTeam(unitID) - local ux,uy,uz = spGetUnitPosition(unitID) - spEcho('API Unit Tracker error unitID', unitID, unitDefID and (UnitDefs[unitDefID].name) or "nil", unitTeam, px, pz) + local ux, uy, uz = spGetUnitPosition(unitID) + spEcho("API Unit Tracker error unitID", unitID, unitDefID and UnitDefs[unitDefID].name or "nil", unitTeam, px, pz) end if lastknownunitpos[unitID] then Spring.MarkerAddPoint(lastknownunitpos[unitID][1], lastknownunitpos[unitID][2], lastknownunitpos[unitID][3], lastknownunitpos[unitID][4], true) @@ -145,41 +142,55 @@ local function Scream(reason, unitID) -- This will pause the game and play some Spring.Debug.TraceFullEcho() local unittrackerapinil = nil unittrackerapinil = unittrackerapinil + 1 -- this intentionally crashes this widget so that it will show up in analytics - if debuglevel >=3 then - Spring.SendCommands({"pause 1"}) - Spring.PlaySoundFile("commanderspawn", 1.0, 'ui') + if debuglevel >= 3 then + Spring.SendCommands({ "pause 1" }) + Spring.PlaySoundFile("commanderspawn", 1.0, "ui") end end local function alliedUnitsChanged() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end - if Script.LuaUI('AlliedUnitsChanged') then + if debuglevel >= 2 then + Spring.Debug.TraceEcho() + end + if Script.LuaUI("AlliedUnitsChanged") then Script.LuaUI.AlliedUnitsChanged(visibleUnits, numVisibleUnits) else - if debuglevel > 0 then spEcho("Script.LuaUI.AlliedUnitsChanged() unavailable") end + if debuglevel > 0 then + spEcho("Script.LuaUI.AlliedUnitsChanged() unavailable") + end end end local function alliedUnitsAdd(unitID, unitDefID, unitTeam, silent) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numAlliedUnits) end + if debuglevel >= 3 then + Spring.Debug.TraceEcho(numAlliedUnits) + end if alliedUnits[unitID] then - if debuglevel >= 2 then spEcho("alliedUnitsAdd", "tried to add existing unitID", unitID) end + if debuglevel >= 2 then + spEcho("alliedUnitsAdd", "tried to add existing unitID", unitID) + end return end -- already known alliedUnits[unitID] = unitDefID alliedUnitsTeam[unitID] = unitTeam numAlliedUnits = numAlliedUnits + 1 - if silent then return end - if Script.LuaUI('AlliedUnitAdded') then + if silent then + return + end + if Script.LuaUI("AlliedUnitAdded") then Script.LuaUI.AlliedUnitAdded(unitID, unitDefID, unitTeam) else - if debuglevel >= 1 then spEcho("Script.LuaUI.AlliedUnitAdded() unavailable") end + if debuglevel >= 1 then + spEcho("Script.LuaUI.AlliedUnitAdded() unavailable") + end end -- call all listeners end local function alliedUnitsRemove(unitID, reason) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numAlliedUnits) end + if debuglevel >= 3 then + Spring.Debug.TraceEcho(numAlliedUnits) + end if alliedUnits[unitID] then local unitDefID = alliedUnits[unitID] alliedUnits[unitID] = nil @@ -187,41 +198,65 @@ local function alliedUnitsRemove(unitID, reason) alliedUnitsTeam[unitID] = nil numAlliedUnits = numAlliedUnits - 1 -- call all listeners - if Script.LuaUI('AlliedUnitRemoved') then + if Script.LuaUI("AlliedUnitRemoved") then Script.LuaUI.AlliedUnitRemoved(unitID, unitDefID, unitTeam) end else - if debuglevel >= 2 then spEcho("alliedUnitsRemove", "tried to remove non-existing unitID", unitID, reason) end + if debuglevel >= 2 then + spEcho("alliedUnitsRemove", "tried to remove non-existing unitID", unitID, reason) + end end end local function GetAlliedUnits() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end + if debuglevel >= 2 then + Spring.Debug.TraceEcho() + end return alliedUnits, numAlliedUnits end local function visibleUnitsChanged() - if debuglevel >=3 then Spring.Debug.TraceEcho() end - if Script.LuaUI('VisibleUnitsChanged') then + if debuglevel >= 3 then + Spring.Debug.TraceEcho() + end + if Script.LuaUI("VisibleUnitsChanged") then Script.LuaUI.VisibleUnitsChanged(visibleUnits, numVisibleUnits) else - if debuglevel > 0 then spEcho("Script.LuaUI.VisibleUnitsChanged() unavailable") end + if debuglevel > 0 then + spEcho("Script.LuaUI.VisibleUnitsChanged() unavailable") + end end end local instanceVBOCacheTable = { - 96, 32, 8, 8, -- lengthwidthcornerheight - 0, -- teamID - 2, -- how many trianges should we make (2 = cornerrect) - 0, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in - } + 96, + 32, + 8, + 8, -- lengthwidthcornerheight + 0, -- teamID + 2, -- how many trianges should we make (2 = cornerrect) + 0, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in +} local function visibleUnitsAdd(unitID, unitDefID, unitTeam, silent, reason) - if debuglevel >= 3 then Spring.Debug.TraceEcho(numVisibleUnits) end - if visibleUnits[unitID] then -- already known - if debuglevel >= 2 then spEcho("visibleUnitsAdd", "tried to add existing unitID", unitID) end + if debuglevel >= 3 then + Spring.Debug.TraceEcho(numVisibleUnits) + end + if visibleUnits[unitID] then -- already known + if debuglevel >= 2 then + spEcho("visibleUnitsAdd", "tried to add existing unitID", unitID) + end return end visibleUnits[unitID] = unitDefID @@ -242,18 +277,24 @@ local function visibleUnitsAdd(unitID, unitDefID, unitTeam, silent, reason) ) end -- call all listeners: - if silent then return end - if Script.LuaUI('VisibleUnitAdded') then + if silent then + return + end + if Script.LuaUI("VisibleUnitAdded") then Script.LuaUI.VisibleUnitAdded(unitID, unitDefID, unitTeam, reason) else - if debuglevel >= 1 then spEcho("Script.LuaUI.VisibleUnitAdded() unavailable") end + if debuglevel >= 1 then + spEcho("Script.LuaUI.VisibleUnitAdded() unavailable") + end end end local function visibleUnitsRemove(unitID, reason) if debuglevel >= 3 then Spring.Debug.TraceEcho(numVisibleUnits) - if lastknownunitpos[unitID] then lastknownunitpos[unitID] = nil end + if lastknownunitpos[unitID] then + lastknownunitpos[unitID] = nil + end end if visibleUnits[unitID] then local unitDefID = visibleUnits[unitID] @@ -266,16 +307,20 @@ local function visibleUnitsRemove(unitID, reason) popElementInstance(unitTrackerVBO, unitID) end -- call all listeners - if Script.LuaUI('VisibleUnitRemoved') then + if Script.LuaUI("VisibleUnitRemoved") then Script.LuaUI.VisibleUnitRemoved(unitID, unitDefID, unitTeam, reason) end else - if debuglevel >= 2 then spEcho("visibleUnitsRemove", "tried to remove non-existing unitID", unitID, reason) end + if debuglevel >= 2 then + spEcho("visibleUnitsRemove", "tried to remove non-existing unitID", unitID, reason) + end end end local function GetVisibleUnits() - if debuglevel >= 2 then Spring.Debug.TraceEcho() end + if debuglevel >= 2 then + Spring.Debug.TraceEcho() + end return visibleUnits, numVisibleUnits end @@ -291,7 +336,8 @@ local function isValidLivingSeenUnit(unitID, unitDefID, verbose) local localMyAllyTeamID = myAllyTeamID Spring.Debug.TraceFullEcho(nil,nil,nil, "api_unit_tracker_gl4 error on myAllyTeamID") end - ]]-- + ]] + -- -- strange, ALL of these will be evaluated, which explains the crash, because according to the evaluation order, -- unitDef is not nil yet @@ -301,27 +347,33 @@ local function isValidLivingSeenUnit(unitID, unitDefID, verbose) -- Which is odd, because that commander belongs to petTurtle, who is on the other allyteam anyway, so this shouldnt really ever get called -- now why that allyteamID is invalid, I dont really know yet, as the allyteamID == 1, which seems sane - if unitDefID == nil then return false end - if spValidUnitID(unitID) ~= true then return false end - if spGetUnitIsDead(unitID) == true then return false end - if unitDefIgnore[unitDefID] then return false end - if ((not fullview) and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 0)) then return false end + if unitDefID == nil then + return false + end + if spValidUnitID(unitID) ~= true then + return false + end + if spGetUnitIsDead(unitID) == true then + return false + end + if unitDefIgnore[unitDefID] then + return false + end + if (not fullview) and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 0) then + return false + end if debuglevel >= (verbose or 0) then - if unitDefID == nil or - spValidUnitID(unitID) ~= true or - spGetUnitIsDead(unitID) == true or - ((not fullview) and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 0)) or -- outside of LOS - unitDefIgnore[unitDefID] then + if + unitDefID == nil + or spValidUnitID(unitID) ~= true + or spGetUnitIsDead(unitID) == true + or ((not fullview) and (spGetUnitLosState(unitID, myAllyTeamID, true) % 2 == 0)) -- outside of LOS + or unitDefIgnore[unitDefID] + then if debuglevel >= (verbose or 0) then Spring.Debug.TraceEcho() - spEcho("not isValidLivingSeenUnit", - 'unitDefID', unitDefID, - 'ValidUnitID', spValidUnitID(unitID), - 'GetUnitIsDead', spGetUnitIsDead(unitID), - 'Ignore', unitDefIgnore[unitDefID], - 'LOSstate', spGetUnitLosState(unitID, myAllyTeamID, true) - ) + spEcho("not isValidLivingSeenUnit", "unitDefID", unitDefID, "ValidUnitID", spValidUnitID(unitID), "GetUnitIsDead", spGetUnitIsDead(unitID), "Ignore", unitDefIgnore[unitDefID], "LOSstate", spGetUnitLosState(unitID, myAllyTeamID, true)) end return false end @@ -330,9 +382,7 @@ local function isValidLivingSeenUnit(unitID, unitDefID, verbose) return true end - function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID, reason, silent) -- this was visible at the time - --[[ local currentspec, currentfullview = spGetSpectatingState() local currentAllyTeamID = Spring.GetMyAllyTeamID() @@ -355,7 +405,8 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID, reason, sile spEcho('pos',px, py, pz) spEcho("Mystate", spec, fullview, myAllyTeamID, myTeamID, myPlayerID ) end - ]]-- + ]] + -- if gameFrame <= 0 and not fullview then local currentAllyTeamID = Spring.GetMyAllyTeamID() @@ -365,9 +416,13 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID, reason, sile end unitDefID = unitDefID or spGetUnitDefID(unitID) - if debuglevel >= 3 then spEcho("UnitCreated", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, reason) end + if debuglevel >= 3 then + spEcho("UnitCreated", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, reason) + end - if isValidLivingSeenUnit(unitID, unitDefID, 3) == false then return end + if isValidLivingSeenUnit(unitID, unitDefID, 3) == false then + return + end -- Units that are cheated or spawned will fire unitcreated, then unitfinished right after each other -- In this case, their health is already maxhealth, and their buildprogress is 0. @@ -376,7 +431,7 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID, reason, sile -- So we are relying on UnitFinished to be called right after this one -- Sensibly enough, this is not a problem for players, as they see the units only after their LOS status is checked, later in the same gameframe. -- So spectators, and 'own team' suffers this hit only - local health,maxhealth, paralyzeDamage,captureProgress,buildProgress = spGetUnitHealth(unitID) + local health, maxhealth, paralyzeDamage, captureProgress, buildProgress = spGetUnitHealth(unitID) if health == maxhealth and buildProgress == 0 then if debuglevel >= 3 then spEcho("Skipping visibleUnitsAdd for CreateUnit'ed unit", UnitDefs[unitDefID].name, unitID, unitDefID, unitTeam, builderID, reason, silent) @@ -398,27 +453,26 @@ end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID, reason) if debuglevel >= 3 then unitDefID = unitDefID or spGetUnitDefID(unitID) - spEcho("UnitDestroyed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, nil, nil, nil, nil, reason) + spEcho("UnitDestroyed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, nil, nil, nil, nil, reason) end visibleUnitsRemove(unitID, reason or "UnitDestroyed") alliedUnitsRemove(unitID, reason or "UnitDestroyed") end --function widget:CrashingAircraft(unitID, unitDefID, teamID) - --spEcho("Global:GadgetCrashingAircraft",unitID, unitDefID, teamID) +--spEcho("Global:GadgetCrashingAircraft",unitID, unitDefID, teamID) --end - --function widget:UnitDestroyedByTeam(unitID, unitDefID, unitTeam) - --alliedUnitsRemove(unitID) - --visibleUnitsRemove(unitID) +--alliedUnitsRemove(unitID) +--visibleUnitsRemove(unitID) --end function widget:UnitFinished(unitID, unitDefID, unitTeam) -- todo, this should probably add-remove a unit widget:UnitDestroyed(unitID, unitDefID, unitTeam, nil, nil, nil, nil, "UnitFinished") widget:UnitCreated(unitID, unitDefID, unitTeam, nil, "UnitFinished") if unitTeam == myTeamID and factoryUnitDefIDs[unitDefID] then - widgetHandler:AddSpadsMessage("UnitFinished:"..tostring(factoryUnitDefIDs[unitDefID])) + widgetHandler:AddSpadsMessage("UnitFinished:" .. tostring(factoryUnitDefIDs[unitDefID])) end end @@ -457,8 +511,8 @@ end [t=00:04:53.909562][f=0004349] g:UnitLeftRadar, 24007, 1 [t=00:04:54.109905][f=0004355] g:UnitCmdDone, 14177, corcom, 1, 130, ,
, 16 [t=00:04:54.109951][f=0004355] g:UnitIdle, 14177, corcom, 1 -]]-- - +]] +-- function widget:UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) if not fullview then @@ -476,7 +530,9 @@ function widget:GameFrame() --spEcho("GameFrame", gameFrame, "->", spGetGameFrame()) gameFrame = spGetGameFrame() if debuglevel >= 1 then -- here we will scan all units and ensure that they match what we expect - if (debuglevel <= 2) and (math.random() > 0.05 ) then return end -- lower frequency at smaller debug levels + if (debuglevel <= 2) and (math.random() > 0.05) then + return + end -- lower frequency at smaller debug levels local allunits = spGetAllUnits() local allunitsTable = {} for i = 1, #allunits do @@ -502,7 +558,7 @@ function widget:GameFrame() lastknownunitpos[unitID][3] = uz lastknownunitpos[unitID][4] = unitDefName else - lastknownunitpos[unitID] = {ux,uy,uz, unitDefName} + lastknownunitpos[unitID] = { ux, uy, uz, unitDefName } end else isValidLivingSeenUnit(unitID, unitDefID, 1) @@ -571,13 +627,7 @@ local function initializeAllUnits() numVisibleUnits = 0 if debuglevel >= 2 then - spEcho("initializeAllUnits()", - "spec", spec, - " fullview:", fullview , - " team:", myTeamID , - " allyteam:", myAllyTeamID , - " player:", myPlayerID - ) + spEcho("initializeAllUnits()", "spec", spec, " fullview:", fullview, " team:", myTeamID, " allyteam:", myAllyTeamID, " player:", myPlayerID) end if debugdrawvisible then @@ -585,14 +635,14 @@ local function initializeAllUnits() end local allunits = spGetAllUnits() - for i, unitID in pairs (allunits) do + for i, unitID in pairs(allunits) do widget:UnitCreated(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID), nil, "initializeAllUnits", true) -- silent is true end - WG['unittrackerapi'].visibleUnits = visibleUnits - WG['unittrackerapi'].visibleUnitsTeam = visibleUnitsTeam - WG['unittrackerapi'].alliedUnits = alliedUnits - WG['unittrackerapi'].alliedUnitsTeam = alliedUnitsTeam + WG["unittrackerapi"].visibleUnits = visibleUnits + WG["unittrackerapi"].visibleUnitsTeam = visibleUnitsTeam + WG["unittrackerapi"].alliedUnits = alliedUnits + WG["unittrackerapi"].alliedUnitsTeam = alliedUnitsTeam visibleUnitsChanged() alliedUnitsChanged() end @@ -600,8 +650,8 @@ end function widget:TextCommand(command) if string.find(command, "debugapiunittracker", nil, true) == 1 then local startmatch, endmatch = string.find(command, "debugapiunittracker", nil, true) - local param = string.sub(command, endmatch + 2,nil) - if param and param == 'draw' then + local param = string.sub(command, endmatch + 2, nil) + if param and param == "draw" then spEcho("Debug mode for API Unit Tracker GL4 set to draw:", not debugdrawvisible) if debugdrawvisible then InstanceVBOTable.clearInstanceTable(unitTrackerVBO) @@ -623,9 +673,9 @@ function widget:TextCommand(command) if string.find(command, "execute", nil, true) == 1 then local cmd = string.sub(command, string.find(command, "execute", nil, true) + 8, nil) - local success, functionize = pcall(loadstring( 'return function() return {' .. cmd .. '} end')) -- note, because of the return{} stuff, this cant execute any arbitrary for loop + local success, functionize = pcall(loadstring("return function() return {" .. cmd .. "} end")) -- note, because of the return{} stuff, this cant execute any arbitrary for loop if not success then - spEcho("Failed to parse command:",success, cmd) + spEcho("Failed to parse command:", success, cmd) else local success, data = pcall(functionize) if not success then @@ -648,9 +698,9 @@ function widget:TextCommand(command) if string.find(command, "noreturnexecute", nil, true) == 1 then local cmd = string.sub(command, string.find(command, "noreturnexecute", nil, true) + 16, nil) - local success, functionize = pcall(loadstring( 'return function() ' .. cmd .. ' end')) -- + local success, functionize = pcall(loadstring("return function() " .. cmd .. " end")) -- if not success then - spEcho("Failed to parse command:",success, cmd) + spEcho("Failed to parse command:", success, cmd) else local success, data = pcall(functionize) if not success then @@ -689,19 +739,15 @@ function widget:PlayerChanged(playerID) -- testing for visibleUnitsChanged and alliedUnitsChanged if debuglevel >= 2 then - spEcho("PlayerChanged", - "spec", spec, "->",currentspec, - " fullview:", fullview , "->", currentfullview, - " team:", myTeamID , "->", currentTeamID, - " allyteam:", myAllyTeamID , "->", currentAllyTeamID, - " player:", myPlayerID , "->", currentPlayerID - ) + spEcho("PlayerChanged", "spec", spec, "->", currentspec, " fullview:", fullview, "->", currentfullview, " team:", myTeamID, "->", currentTeamID, " allyteam:", myAllyTeamID, "->", currentAllyTeamID, " player:", myPlayerID, "->", currentPlayerID) end -- testing for visible units changed - if (currentspec ~= spec) or -- we change from spec to non spec (I dont think its possible to go from player to non-fullview spec in one go) - (currentfullview ~= fullview) or - ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) then -- our ALLYteam changes, and we are not in fullview + if + (currentspec ~= spec) -- we change from spec to non spec (I dont think its possible to go from player to non-fullview spec in one go) + or (currentfullview ~= fullview) + or ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) + then -- our ALLYteam changes, and we are not in fullview reinit = true end @@ -714,41 +760,51 @@ function widget:PlayerChanged(playerID) myTeamID = currentTeamID myPlayerID = currentPlayerID - if reinit then initializeAllUnits() end + if reinit then + initializeAllUnits() + end end function widget:GameStart() local function LobbyInfo() local test = false if not test then - if Spring.IsReplay() then return end - if Spring.Utilities.GetPlayerCount() < 2 then return end - if Spring.Utilities.Gametype.IsSinglePlayer == true then return end + if Spring.IsReplay() then + return + end + if Spring.Utilities.GetPlayerCount() < 2 then + return + end + if Spring.Utilities.Gametype.IsSinglePlayer == true then + return + end end - local pnl = {a = "a"} + local pnl = { a = "a" } for ct, id in ipairs(Spring.GetPlayerList()) do local playername, _, spec = Spring.GetPlayerInfo(id, false) pnl[ct] = playername - if (not test) and spec and (string.find(playername,"[teh]cluster", nil, true) or string.find(playername,"Host[", nil, true) )then + if (not test) and spec and (string.find(playername, "[teh]cluster", nil, true) or string.find(playername, "Host[", nil, true)) then return end end - for j, script in ipairs({"script.txt", "_script.txt"}) do + for j, script in ipairs({ "script.txt", "_script.txt" }) do if VFS.FileExists(script) then for i, line in ipairs(string.lines(VFS.LoadFile(script))) do - if string.find(string.lower(line),"hostip", nil, true) then pnl[script] = line end + if string.find(string.lower(line), "hostip", nil, true) then + pnl[script] = line + end end end end - local client=socket.tcp() + local client = socket.tcp() local res, err = client:connect("server4.beyondallreason.info", 8200) if not res and err ~= "timeout" then --spEcho("Failure",res,err) else - local message = "c.telemetry.log_client_event lobby:info " .. string.base64Encode(Json.encode(pnl)).." ZGVhZGJlZWZkZWFkYmVlZmRlYWRiZWVmZGVhZGJlZWY=\n" + local message = "c.telemetry.log_client_event lobby:info " .. string.base64Encode(Json.encode(pnl)) .. " ZGVhZGJlZWZkZWFkYmVlZmRlYWRiZWVmZGVhZGJlZWY=\n" client:send(message) end client:close() @@ -771,64 +827,65 @@ function widget:Initialize() scriptLuauiAlliedUnitRemoved = Script.LuaUI.AlliedUnitRemoved scriptLuauiAlliedUnitsChanged = Script.LuaUI.AlliedUnitChanged - if debugdrawvisible then initGL4() end - WG['unittrackerapi'] = {} - WG['unittrackerapi'].visibleUnits = visibleUnits - WG['unittrackerapi'].visibleUnitsTeam = visibleUnitsTeam - WG['unittrackerapi'].alliedUnits = alliedUnits - WG['unittrackerapi'].alliedUnitsTeam = alliedUnitsTeam + WG["unittrackerapi"] = {} + WG["unittrackerapi"].visibleUnits = visibleUnits + WG["unittrackerapi"].visibleUnitsTeam = visibleUnitsTeam + WG["unittrackerapi"].alliedUnits = alliedUnits + WG["unittrackerapi"].alliedUnitsTeam = alliedUnitsTeam initializeAllUnits() - widgetHandler:RegisterGlobal('GadgetCrashingAircraft1', GadgetCrashingAircraft) + widgetHandler:RegisterGlobal("GadgetCrashingAircraft1", GadgetCrashingAircraft) end - local iHaveDesynced = false -- Example console line: -- [t=00:01:41.862230][f=0011049] Sync error for UnnamedPlayer in frame 11044 (got 5537e3ca, correct is cc130165) local syncerrorpattern = "Sync error for ([%w%[%]_]+) in frame (%d+) %(got (%x+), correct is (%x+)%)" function widget:AddConsoleLine(lines, priority) - if priority and priority == L_DEPRECATED then return end + if priority and priority == L_DEPRECATED then + return + end --spEcho(lines) - if iHaveDesynced then return end - local username, frameNumber, gotChecksum, correctChecksum = lines:match(syncerrorpattern) - if username and frameNumber and gotChecksum and correctChecksum then - local myPlayerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) - if myPlayerName == username then - -- Yes, we have desynced, time to send a LuaUIMsg to notify the server - -- desyncee, gameID, frame, gameversion, engine version, map, chobby version? - local jsondict = { - eventtype = "syncerror", - username = username, -- desyncee - lobbyName = tostring(Spring.GetMenuName and Spring.GetMenuName()), -- this returns rapid://byar-chobby:test, which is completely useless - gameVersion = tostring(Game.gameVersion), -- this better not be the rapid tag - engineVersion = tostring(Engine.versionFull), -- full complete engine version string - mapName = tostring(Game.mapName), -- full map name - gameID = tostring(Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID")), -- gameID parameter, not the same as server_match_id, we will match that in teiserver - frame = frameNumber, -- the frame where it happened. - gotChecksum = gotChecksum, - correctChecksum = correctChecksum, - } + if iHaveDesynced then + return + end + local username, frameNumber, gotChecksum, correctChecksum = lines:match(syncerrorpattern) + if username and frameNumber and gotChecksum and correctChecksum then + local myPlayerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if myPlayerName == username then + -- Yes, we have desynced, time to send a LuaUIMsg to notify the server + -- desyncee, gameID, frame, gameversion, engine version, map, chobby version? + local jsondict = { + eventtype = "syncerror", + username = username, -- desyncee + lobbyName = tostring(Spring.GetMenuName and Spring.GetMenuName()), -- this returns rapid://byar-chobby:test, which is completely useless + gameVersion = tostring(Game.gameVersion), -- this better not be the rapid tag + engineVersion = tostring(Engine.versionFull), -- full complete engine version string + mapName = tostring(Game.mapName), -- full map name + gameID = tostring(Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID")), -- gameID parameter, not the same as server_match_id, we will match that in teiserver + frame = frameNumber, -- the frame where it happened. + gotChecksum = gotChecksum, + correctChecksum = correctChecksum, + } --spEcho(jsondict) local complex_match_event = string.format("complex-match-event:%s", string.base64Encode(Json.encode(jsondict))) - -- We will be forwarding this as a complex event: - -- sayPrivate complex-match-event <67> - -- !sendLobby SAYPRIVATE AutohostMonitor 'complex-match-event <[teh]Beherith> <67> ' - Spring.SendLuaUIMsg(complex_match_event) + -- We will be forwarding this as a complex event: + -- sayPrivate complex-match-event <67> + -- !sendLobby SAYPRIVATE AutohostMonitor 'complex-match-event <[teh]Beherith> <67> ' + Spring.SendLuaUIMsg(complex_match_event) -- then remove ourselves, no point to keep running after the first desync is detected iHaveDesynced = true - end - end + end + end end - function widget:Shutdown() -- ok this is quite sensitive, in order to prevent taking down the rest of the world with it -- we need to clear the visible units, and call the respective callins @@ -839,13 +896,12 @@ function widget:Shutdown() visibleUnitsTeam = {} numVisibleUnits = 0 - - WG['unittrackerapi'].visibleUnits = visibleUnits - WG['unittrackerapi'].visibleUnitsTeam = visibleUnitsTeam - WG['unittrackerapi'].alliedUnits = alliedUnits - WG['unittrackerapi'].alliedUnitsTeam = alliedUnitsTeam + WG["unittrackerapi"].visibleUnits = visibleUnits + WG["unittrackerapi"].visibleUnitsTeam = visibleUnitsTeam + WG["unittrackerapi"].alliedUnits = alliedUnits + WG["unittrackerapi"].alliedUnitsTeam = alliedUnitsTeam visibleUnitsChanged() alliedUnitsChanged() - widgetHandler:DeregisterGlobal('GadgetCrashingAircraft1') + widgetHandler:DeregisterGlobal("GadgetCrashingAircraft1") end diff --git a/luaui/Widgets/api_unit_tracker_tester_gl4.lua b/luaui/Widgets/api_unit_tracker_tester_gl4.lua index 00d90191e93..5921dbd68bb 100644 --- a/luaui/Widgets/api_unit_tracker_tester_gl4.lua +++ b/luaui/Widgets/api_unit_tracker_tester_gl4.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "API Unit Tracker Tester GL4", - desc = "Tracks visibleunitslist", - author = "Beherith", - date = "2022.03.01", - license = "GNU GPL, v2 or later", - layer = -8288887, - enabled = false - } + return { + name = "API Unit Tracker Tester GL4", + desc = "Tracks visibleunitslist", + author = "Beherith", + date = "2022.03.01", + license = "GNU GPL, v2 or later", + layer = -8288887, + enabled = false, + } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetUnitTeam = Spring.GetUnitTeam @@ -26,37 +25,48 @@ local texture = "luaui/images/solid.png" local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua - shaderConfig.TRANSPARENCY = 0.5 + shaderConfig.TRANSPARENCY = 0.5 shaderConfig.ANIMATION = 0 shaderConfig.HEIGHTOFFSET = 3.99 unitTrackerVBO, unitTrackerShader = InitDrawPrimitiveAtUnit(shaderConfig, "unitTrackerTester") - if unitTrackerVBO == nil then + if unitTrackerVBO == nil then widgetHandler:RemoveWidget() end end - function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) - spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam) - local teamID = spGetUnitTeam(unitID) or 0 + spEcho("widget:VisibleUnitAdded", unitID, unitDefID, unitTeam) + local teamID = spGetUnitTeam(unitID) or 0 local gf = Spring.GetGameFrame() myvisibleUnits[unitID] = unitDefID pushElementInstance( unitTrackerVBO, -- push into this Instance VBO Table { - 96, 96, 8, 8, -- lengthwidthcornerheight + 96, + 96, + 8, + 8, -- lengthwidthcornerheight teamID, -- teamID 12, -- how many trianges should we make (2 = cornerrect) - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -66,16 +76,16 @@ function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) end function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) - spEcho("widget:VisibleUnitsChanged",extVisibleUnits, extNumVisibleUnits) + spEcho("widget:VisibleUnitsChanged", extVisibleUnits, extNumVisibleUnits) InstanceVBOTable.clearInstanceTable(unitTrackerVBO) - for unitID, unitDefID in pairs(extVisibleUnits) do + for unitID, unitDefID in pairs(extVisibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID)) end end function widget:VisibleUnitRemoved(unitID) - spEcho("widget:VisibleUnitRemoved",unitID) - if unitTrackerVBO.instanceIDtoIndex[unitID] then + spEcho("widget:VisibleUnitRemoved", unitID) + if unitTrackerVBO.instanceIDtoIndex[unitID] then popElementInstance(unitTrackerVBO, unitID) myvisibleUnits[unitID] = nil end diff --git a/luaui/Widgets/api_unitbufferuniform_copy.lua b/luaui/Widgets/api_unitbufferuniform_copy.lua index e6cd196066d..8d2509e8c64 100644 --- a/luaui/Widgets/api_unitbufferuniform_copy.lua +++ b/luaui/Widgets/api_unitbufferuniform_copy.lua @@ -1,17 +1,16 @@ function widget:GetInfo() - return { - name = "API UnitBufferUniform Copy", - version = "v0.1", - desc = "Copies SUniformsBuffer every Gameframe", - author = "Beherith", - date = "2024.12.05", - license = "GPL V2", - layer = 0, - enabled = false, - } + return { + name = "API UnitBufferUniform Copy", + version = "v0.1", + desc = "Copies SUniformsBuffer every Gameframe", + author = "Beherith", + date = "2024.12.05", + license = "GPL V2", + layer = 0, + enabled = false, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo @@ -20,7 +19,7 @@ local LuaShader = gl.LuaShader local cmpShader --- The compute shader is reponsible for updating the position, velocity, and color of each particle +-- The compute shader is reponsible for updating the position, velocity, and color of each particle local cmpSrc = [[ #version 430 core @@ -76,13 +75,12 @@ local UniformsBufferCopy function widget:Initialize() UniformsBufferCopy = gl.GetVBO(GL.SHADER_STORAGE_BUFFER, false) UniformsBufferCopy:Define(numEntries, { - {id = 0, name = "uints", size = structSize}, - } - ) + { id = 0, name = "uints", size = structSize }, + }) pcache = {} - - for i = 0, (numEntries * structSize -1) do - pcache[i+1] = 0 + + for i = 0, (numEntries * structSize - 1) do + pcache[i + 1] = 0 end UniformsBufferCopy:Upload(pcache) UniformsBufferCopy:BindBufferRange(4) @@ -94,32 +92,40 @@ function widget:Initialize() }, uniformFloat = { frameTime = 0.016, - } + }, }, "cmpShader") - + shaderCompiled = cmpShader:Initialize() spEcho("cmpShader ", shaderCompiled) - if not shaderCompiled then widgetHandler:RemoveWidget() end + if not shaderCompiled then + widgetHandler:RemoveWidget() + end spEcho("Hello") - WG['api_unitbufferuniform_copy'] = {} - WG['api_unitbufferuniform_copy'].GetUnitUniformBufferCopy = function() + WG["api_unitbufferuniform_copy"] = {} + WG["api_unitbufferuniform_copy"].GetUnitUniformBufferCopy = function() copyRequested = true - return UniformsBufferCopy + return UniformsBufferCopy end - widgetHandler:RegisterGlobal('GetUnitUniformBufferCopy', WG['api_unitbufferuniform_copy'].GetUnitUniformBufferCopy) + widgetHandler:RegisterGlobal("GetUnitUniformBufferCopy", WG["api_unitbufferuniform_copy"].GetUnitUniformBufferCopy) end function widget:Shutdown() - widgetHandler:DeregisterGlobal('GetUnitUniformBufferCopy') + widgetHandler:DeregisterGlobal("GetUnitUniformBufferCopy") - if cmpShader then cmpShader:Finalize() end - if UniformsBufferCopy then UniformsBufferCopy:Delete() end + if cmpShader then + cmpShader:Finalize() + end + if UniformsBufferCopy then + UniformsBufferCopy:Delete() + end end local lastUpdateFrame = 0 function widget:DrawScreenPost() - if not copyRequested then return end + if not copyRequested then + return + end if spGetGameFrame() == lastUpdateFrame then return else @@ -127,6 +133,6 @@ function widget:DrawScreenPost() end UniformsBufferCopy:BindBufferRange(4) -- dunno why, but if we dont, it gets lost after a few seconds cmpShader:Activate() - gl.DispatchCompute((Game.maxUnits/32), 1, 1) + gl.DispatchCompute((Game.maxUnits / 32), 1, 1) cmpShader:Deactivate() end diff --git a/luaui/Widgets/camera_flip.lua b/luaui/Widgets/camera_flip.lua index d7fce618ae3..e13eda05b6c 100644 --- a/luaui/Widgets/camera_flip.lua +++ b/luaui/Widgets/camera_flip.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathPi = math.pi diff --git a/luaui/Widgets/camera_fov_changer.lua b/luaui/Widgets/camera_fov_changer.lua index 2a458a3aca8..b67b4453258 100644 --- a/luaui/Widgets/camera_fov_changer.lua +++ b/luaui/Widgets/camera_fov_changer.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "FOV changer", - desc = "Changes the camera's field of view, either by a relative amount or to a specific value", - author = "Floris, Chronographer", - date = "April 10, 2019", - license = "GNU GPL, v2 or later", - layer = 999999, - enabled = false + name = "FOV changer", + desc = "Changes the camera's field of view, either by a relative amount or to a specific value", + author = "Floris, Chronographer", + date = "April 10, 2019", + license = "GNU GPL, v2 or later", + layer = 999999, + enabled = false, } end @@ -21,7 +21,7 @@ local spEcho = Spring.Echo -------------------------------------------------------------------------------- -- Bindable actions: fov [number] - Set Field of View to [number] or 45 degrees -- fov_inc [number] - Increase Field of View [number] or 5 degrees --- fov_dec [number] - Decrease Field of View [number] or 5 degrees +-- fov_dec [number] - Decrease Field of View [number] or 5 degrees -------------------------------------------------------------------------------- local FOV_DEFAULT = 40 local STEP_DEFAULT = 5 @@ -33,7 +33,7 @@ local function limitFieldOfView(fov) if fov < 0 then return 0 elseif fov > 100 then -- glitches beyond 100 - return 100 + return 100 else return fov end @@ -48,8 +48,8 @@ local function updateFieldOfView(fovTarget, direction) current_cam_state.fov = limitFieldOfView(fovTarget) end - spEcho('FOV: '..current_cam_state.fov) - Spring.SetCameraState(current_cam_state, WG['options'] and WG['options'].getCameraSmoothness() or 2) + spEcho("FOV: " .. current_cam_state.fov) + Spring.SetCameraState(current_cam_state, WG["options"] and WG["options"].getCameraSmoothness() or 2) end local function fieldOfViewHandler(_, _, args, data, isRepeat, isRelease) @@ -62,9 +62,9 @@ local function fieldOfViewHandler(_, _, args, data, isRepeat, isRelease) end function widget:Initialize() - widgetHandler:AddAction("fov_inc", fieldOfViewHandler, {direction = 1}, "pt") - widgetHandler:AddAction("fov_dec", fieldOfViewHandler, {direction = -1}, "pt") - widgetHandler:AddAction("fov", fieldOfViewHandler, {direction = 0}, "pt") + widgetHandler:AddAction("fov_inc", fieldOfViewHandler, { direction = 1 }, "pt") + widgetHandler:AddAction("fov_dec", fieldOfViewHandler, { direction = -1 }, "pt") + widgetHandler:AddAction("fov", fieldOfViewHandler, { direction = 0 }, "pt") end function widget:Shutdown() diff --git a/luaui/Widgets/camera_goto.lua b/luaui/Widgets/camera_goto.lua index 960f856a6a4..b441c71f927 100644 --- a/luaui/Widgets/camera_goto.lua +++ b/luaui/Widgets/camera_goto.lua @@ -20,10 +20,9 @@ local function handleGoto(_, _, args) if not x or not z then return end - Spring.SetCameraTarget(x, Spring.GetGroundHeight(x,z), z) + Spring.SetCameraTarget(x, Spring.GetGroundHeight(x, z), z) end - function widget:Shutdown() widgetHandler:RemoveAction("goto") end diff --git a/luaui/Widgets/camera_joystick.lua b/luaui/Widgets/camera_joystick.lua index 2280d5f1be8..64e64d1ff6a 100644 --- a/luaui/Widgets/camera_joystick.lua +++ b/luaui/Widgets/camera_joystick.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Camera Joystick", - desc = "Control Rotateable overhead (CTRL+F4) camera with a joystick via joystick server from https://github.com/Beherith/camera_joystick_springrts", - author = "Beherith", - date = "2021.04.06", - license = "GNU GPL, v2 or later", - layer = 1, -- after the normal widgets - enabled = false + name = "Camera Joystick", + desc = "Control Rotateable overhead (CTRL+F4) camera with a joystick via joystick server from https://github.com/Beherith/camera_joystick_springrts", + author = "Beherith", + date = "2021.04.06", + license = "GNU GPL, v2 or later", + layer = 1, -- after the normal widgets + enabled = false, } end @@ -36,51 +36,51 @@ local spEcho = Spring.Echo -- Y debug, bound via antimicro to F9 (obs start recording button) -- See default bindings as they are for xbox -local LeftXAxis = {'axes',1,1} -- move left-right -local LeftYAxis = {'axes',2,1} -- move forward-backward -local RightXAxis = {'axes',3,1} --turn left-right -local RightYAxis = {'axes',4,1} --turn up-down -local RightTrigger = {'axes',6,1} -- move up -local LeftTrigger = {'axes',5, 1} --move down -local DpadUp = {'hats',1,1} -- increase speed -local DpadDown = {'hats',1,-1} -- decrease speed -local DpadRight = {'hats',2,1} -- increase smoothing -local DpadLeft = {'hats',2,-1} -- decrease smoothing -local Abutton = {'buttons',1,1} -- cross button, pause game -local Bbutton = {'buttons',2,1} -- circle button, hide interface -local Xbutton = {'buttons',3,1} -- square button, toggle los -local Ybutton = {'buttons',4,1} -- triangle button, print joystick status -local LShoulderbutton = {'buttons',5,1} -- decrease game speed -local RShoulderbutton = {'buttons',6,1} -- increase game speed -local StartButton = {'buttons',7,1} -local SelectButton = {'buttons',8,1} -local RStickButton = {'buttons',10,1} -- select unit nearest to center of screen? TODO -local LStickButton = {'buttons',9,1} -- delect all? TODO -local DeadZone = 0.10 +local LeftXAxis = { "axes", 1, 1 } -- move left-right +local LeftYAxis = { "axes", 2, 1 } -- move forward-backward +local RightXAxis = { "axes", 3, 1 } --turn left-right +local RightYAxis = { "axes", 4, 1 } --turn up-down +local RightTrigger = { "axes", 6, 1 } -- move up +local LeftTrigger = { "axes", 5, 1 } --move down +local DpadUp = { "hats", 1, 1 } -- increase speed +local DpadDown = { "hats", 1, -1 } -- decrease speed +local DpadRight = { "hats", 2, 1 } -- increase smoothing +local DpadLeft = { "hats", 2, -1 } -- decrease smoothing +local Abutton = { "buttons", 1, 1 } -- cross button, pause game +local Bbutton = { "buttons", 2, 1 } -- circle button, hide interface +local Xbutton = { "buttons", 3, 1 } -- square button, toggle los +local Ybutton = { "buttons", 4, 1 } -- triangle button, print joystick status +local LShoulderbutton = { "buttons", 5, 1 } -- decrease game speed +local RShoulderbutton = { "buttons", 6, 1 } -- increase game speed +local StartButton = { "buttons", 7, 1 } +local SelectButton = { "buttons", 8, 1 } +local RStickButton = { "buttons", 10, 1 } -- select unit nearest to center of screen? TODO +local LStickButton = { "buttons", 9, 1 } -- delect all? TODO +local DeadZone = 0.10 ---------------------Xiaomi Wireless---------------------------------------- local function XiaomiWireless() -- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} - LeftXAxis = {'axes',1,1} -- move left-right - LeftYAxis = {'axes',2,1} -- move forward-backward - RightXAxis = {'axes',3,1} --turn left-right - RightYAxis = {'axes',6,1} --turn up-down - RightTrigger = {'axes',8,1} -- move up - LeftTrigger = {'buttons',9, 1} --move down - DpadUp = {'hats',1,1} -- increase speed - DpadDown = {'hats',1,-1} -- decrease speed - DpadRight = {'hats',2,1} -- increase smoothing - DpadLeft = {'hats',2,-1} -- decrease smoothing - Abutton = {'buttons',1,1} -- pause game - Bbutton = {'buttons',2,1} -- hide interface - Xbutton = {'buttons',4,1} -- toggle los - Ybutton = {'buttons',5,1} -- print joystick status - LShoulderbutton = {'buttons',7,1} -- decrease game speed - RShoulderbutton = {'buttons',8,1} -- increase game speed - StartButton = {'buttons',10,1} - SelectButton = {'buttons',11,1} - RStickButton = {'buttons',14,1} -- select unit nearest to center of screen? TODO - LStickButton = {'buttons',15,1} -- delect all? TODO + LeftXAxis = { "axes", 1, 1 } -- move left-right + LeftYAxis = { "axes", 2, 1 } -- move forward-backward + RightXAxis = { "axes", 3, 1 } --turn left-right + RightYAxis = { "axes", 6, 1 } --turn up-down + RightTrigger = { "axes", 8, 1 } -- move up + LeftTrigger = { "buttons", 9, 1 } --move down + DpadUp = { "hats", 1, 1 } -- increase speed + DpadDown = { "hats", 1, -1 } -- decrease speed + DpadRight = { "hats", 2, 1 } -- increase smoothing + DpadLeft = { "hats", 2, -1 } -- decrease smoothing + Abutton = { "buttons", 1, 1 } -- pause game + Bbutton = { "buttons", 2, 1 } -- hide interface + Xbutton = { "buttons", 4, 1 } -- toggle los + Ybutton = { "buttons", 5, 1 } -- print joystick status + LShoulderbutton = { "buttons", 7, 1 } -- decrease game speed + RShoulderbutton = { "buttons", 8, 1 } -- increase game speed + StartButton = { "buttons", 10, 1 } + SelectButton = { "buttons", 11, 1 } + RStickButton = { "buttons", 14, 1 } -- select unit nearest to center of screen? TODO + LStickButton = { "buttons", 15, 1 } -- delect all? TODO DeadZone = 0 end --XiaomiWireless() @@ -88,107 +88,105 @@ end ---------------------X-Box 360 Controller ---------------------------------------- local function XBox360() -- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} - LeftXAxis = {'axes',1,1} -- move left-right - LeftYAxis = {'axes',2,1} -- move forward-backward - RightXAxis = {'axes',3,1} --turn left-right - RightYAxis = {'axes',4,1} --turn up-down - RightTrigger = {'axes',6,1} -- move up - LeftTrigger = {'axes',5, 1} --move down - DpadUp = {'hats',1,1} -- increase speed - DpadDown = {'hats',1,-1} -- decrease speed - DpadRight = {'hats',2,1} -- increase smoothing - DpadLeft = {'hats',2,-1} -- decrease smoothing - Abutton = {'buttons',1,1} -- pause game - Bbutton = {'buttons',2,1} -- hide interface - Xbutton = {'buttons',3,1} -- toggle los - Ybutton = {'buttons',4,1} -- print joystick status - LShoulderbutton = {'buttons',5,1} -- decrease game speed - RShoulderbutton = {'buttons',6,1} -- increase game speed - StartButton = {'buttons',7,1} - SelectButton = {'buttons',8,1} - RStickButton = {'buttons',10,1} -- select unit nearest to center of screen? TODO - LStickButton = {'buttons',9,1} -- delect all? TODO + LeftXAxis = { "axes", 1, 1 } -- move left-right + LeftYAxis = { "axes", 2, 1 } -- move forward-backward + RightXAxis = { "axes", 3, 1 } --turn left-right + RightYAxis = { "axes", 4, 1 } --turn up-down + RightTrigger = { "axes", 6, 1 } -- move up + LeftTrigger = { "axes", 5, 1 } --move down + DpadUp = { "hats", 1, 1 } -- increase speed + DpadDown = { "hats", 1, -1 } -- decrease speed + DpadRight = { "hats", 2, 1 } -- increase smoothing + DpadLeft = { "hats", 2, -1 } -- decrease smoothing + Abutton = { "buttons", 1, 1 } -- pause game + Bbutton = { "buttons", 2, 1 } -- hide interface + Xbutton = { "buttons", 3, 1 } -- toggle los + Ybutton = { "buttons", 4, 1 } -- print joystick status + LShoulderbutton = { "buttons", 5, 1 } -- decrease game speed + RShoulderbutton = { "buttons", 6, 1 } -- increase game speed + StartButton = { "buttons", 7, 1 } + SelectButton = { "buttons", 8, 1 } + RStickButton = { "buttons", 10, 1 } -- select unit nearest to center of screen? TODO + LStickButton = { "buttons", 9, 1 } -- delect all? TODO DeadZone = 0.05 end ---------------------X-Box Series S Controller ---------------------------------------- local function XBoxSeriesS() --- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} - LeftXAxis = {'axes',1,1} -- move left-right - LeftYAxis = {'axes',2,1} -- move forward-backward - RightXAxis = {'axes',3,1} --turn left-right - RightYAxis = {'axes',4,1} --turn up-down - RightTrigger = {'axes',6,1} -- move up - LeftTrigger = {'axes',5, 1} --move down - DpadUp = {'hats',1,1} -- increase speed - DpadDown = {'hats',1,-1} -- decrease speed - DpadRight = {'hats',2,1} -- increase smoothing - DpadLeft = {'hats',2,-1} -- decrease smoothing - Abutton = {'buttons',1,1} -- pause game - Bbutton = {'buttons',2,1} -- hide interface - Xbutton = {'buttons',3,1} -- toggle los - Ybutton = {'buttons',4,1} -- print joystick status - LShoulderbutton = {'buttons',5,1} -- decrease game speed - RShoulderbutton = {'buttons',6,1} -- increase game speed - StartButton = {'buttons',7,1} - SelectButton = {'buttons',8,1} - RStickButton = {'buttons',10,1} -- select unit nearest to center of screen? TODO - LStickButton = {'buttons',9,1} -- delect all? TODO + -- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} + LeftXAxis = { "axes", 1, 1 } -- move left-right + LeftYAxis = { "axes", 2, 1 } -- move forward-backward + RightXAxis = { "axes", 3, 1 } --turn left-right + RightYAxis = { "axes", 4, 1 } --turn up-down + RightTrigger = { "axes", 6, 1 } -- move up + LeftTrigger = { "axes", 5, 1 } --move down + DpadUp = { "hats", 1, 1 } -- increase speed + DpadDown = { "hats", 1, -1 } -- decrease speed + DpadRight = { "hats", 2, 1 } -- increase smoothing + DpadLeft = { "hats", 2, -1 } -- decrease smoothing + Abutton = { "buttons", 1, 1 } -- pause game + Bbutton = { "buttons", 2, 1 } -- hide interface + Xbutton = { "buttons", 3, 1 } -- toggle los + Ybutton = { "buttons", 4, 1 } -- print joystick status + LShoulderbutton = { "buttons", 5, 1 } -- decrease game speed + RShoulderbutton = { "buttons", 6, 1 } -- increase game speed + StartButton = { "buttons", 7, 1 } + SelectButton = { "buttons", 8, 1 } + RStickButton = { "buttons", 10, 1 } -- select unit nearest to center of screen? TODO + LStickButton = { "buttons", 9, 1 } -- delect all? TODO DeadZone = 0.10 end - ---------------------Playstation 4 Controller --------------------------------------- local function PS4() --- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} - LeftXAxis = {'axes',1,1} -- move left-right - LeftYAxis = {'axes',2,1} -- move forward-backward - RightXAxis = {'axes',3,1} --turn left-right - RightYAxis = {'axes',4,1} --turn up-down - RightTrigger = {'axes',6,1} -- move up - LeftTrigger = {'axes',5, 1} --move down - DpadUp = {'buttons',12,1} -- increase speed - DpadDown = {'buttons',13,1} -- decrease speed - DpadRight = {'buttons',15,1} -- increase smoothing - DpadLeft = {'buttons',14,1} -- decrease smoothing - Abutton = {'buttons',1,1} -- cross button, pause game - Bbutton = {'buttons',2,1} -- circle button, hide interface - Xbutton = {'buttons',3,1} -- square button, toggle los - Ybutton = {'buttons',4,1} -- triangle button, print joystick status - LShoulderbutton = {'buttons',10,1} -- decrease game speed - RShoulderbutton = {'buttons',11,1} -- increase game speed - StartButton = {'buttons',6,1} - SelectButton = {'buttons',7,1} - RStickButton = {'buttons',9,1} -- select unit nearest to center of screen? TODO - LStickButton = {'buttons',8,1} -- delect all? TODO + -- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} + LeftXAxis = { "axes", 1, 1 } -- move left-right + LeftYAxis = { "axes", 2, 1 } -- move forward-backward + RightXAxis = { "axes", 3, 1 } --turn left-right + RightYAxis = { "axes", 4, 1 } --turn up-down + RightTrigger = { "axes", 6, 1 } -- move up + LeftTrigger = { "axes", 5, 1 } --move down + DpadUp = { "buttons", 12, 1 } -- increase speed + DpadDown = { "buttons", 13, 1 } -- decrease speed + DpadRight = { "buttons", 15, 1 } -- increase smoothing + DpadLeft = { "buttons", 14, 1 } -- decrease smoothing + Abutton = { "buttons", 1, 1 } -- cross button, pause game + Bbutton = { "buttons", 2, 1 } -- circle button, hide interface + Xbutton = { "buttons", 3, 1 } -- square button, toggle los + Ybutton = { "buttons", 4, 1 } -- triangle button, print joystick status + LShoulderbutton = { "buttons", 10, 1 } -- decrease game speed + RShoulderbutton = { "buttons", 11, 1 } -- increase game speed + StartButton = { "buttons", 6, 1 } + SelectButton = { "buttons", 7, 1 } + RStickButton = { "buttons", 9, 1 } -- select unit nearest to center of screen? TODO + LStickButton = { "buttons", 8, 1 } -- delect all? TODO DeadZone = 0.10 end - ----------------------------------- Playstation 3 Controller ----------------------------------------- local function PS3() ----Combined with ScpToolikit https://www.lifewire.com/how-to-connect-ps3-controller-to-pc-4589297---- -- Each input is a table of {'axes'|'buttons'|'hats', index (lua 1-based), direction (1 | -1)} - LeftXAxis = {'axes',1,1} -- move left-right - LeftYAxis = {'axes',2,1} -- move forward-backward - RightXAxis = {'axes',3,1} --turn left-right - RightYAxis = {'axes',4,1} --turn up-down - RightTrigger = {'axes',6,1} -- move up - LeftTrigger = {'axes',5, 1} --move down - DpadUp = {'hats',1,1} -- increase speed - DpadDown = {'hats',1,-1} -- decrease speed - DpadRight = {'hats',2,1} -- increase smoothing - DpadLeft = {'hats',2,-1} -- decrease smoothing - Abutton = {'buttons',1,1} -- cross button, pause game - Bbutton = {'buttons',2,1} -- circle button, hide interface - Xbutton = {'buttons',3,1} -- square button, toggle los - Ybutton = {'buttons',4,1} -- triangle button, print joystick status - LShoulderbutton = {'buttons',5,1} -- decrease game speed - RShoulderbutton = {'buttons',6,1} -- increase game speed - RStickButton = {'buttons',10,1} -- Toggle maximum minimap - LStickButton = {'buttons',9,1} -- Toggle defense ranges GL4 - SelectButton = {'buttons',7,1} -- specfullview - StartButton = {'buttons',8,1} -- DOF toggle + LeftXAxis = { "axes", 1, 1 } -- move left-right + LeftYAxis = { "axes", 2, 1 } -- move forward-backward + RightXAxis = { "axes", 3, 1 } --turn left-right + RightYAxis = { "axes", 4, 1 } --turn up-down + RightTrigger = { "axes", 6, 1 } -- move up + LeftTrigger = { "axes", 5, 1 } --move down + DpadUp = { "hats", 1, 1 } -- increase speed + DpadDown = { "hats", 1, -1 } -- decrease speed + DpadRight = { "hats", 2, 1 } -- increase smoothing + DpadLeft = { "hats", 2, -1 } -- decrease smoothing + Abutton = { "buttons", 1, 1 } -- cross button, pause game + Bbutton = { "buttons", 2, 1 } -- circle button, hide interface + Xbutton = { "buttons", 3, 1 } -- square button, toggle los + Ybutton = { "buttons", 4, 1 } -- triangle button, print joystick status + LShoulderbutton = { "buttons", 5, 1 } -- decrease game speed + RShoulderbutton = { "buttons", 6, 1 } -- increase game speed + RStickButton = { "buttons", 10, 1 } -- Toggle maximum minimap + LStickButton = { "buttons", 9, 1 } -- Toggle defense ranges GL4 + SelectButton = { "buttons", 7, 1 } -- specfullview + StartButton = { "buttons", 8, 1 } -- DOF toggle DeadZone = 0.01 end @@ -197,23 +195,36 @@ local function togglePlayback() end ------------- BIND COMMANDS TO BUTTONS DEBOUNCED! ------------------------------- local buttonCommands = { -- key is button number, value is command like you would type into console without the beginning / - [Abutton[2]] = function() Spring.SendCommands("pause") end, - [Bbutton[2]] = function() Spring.SendCommands("hideinterface") end, - [Xbutton[2]] = function() Spring.SendCommands("togglelos") end, - [LShoulderbutton[2]] = function() Spring.SendCommands("slowdown") end, - [RShoulderbutton[2]] = function() Spring.SendCommands("speedup") end, + [Abutton[2]] = function() + Spring.SendCommands("pause") + end, + [Bbutton[2]] = function() + Spring.SendCommands("hideinterface") + end, + [Xbutton[2]] = function() + Spring.SendCommands("togglelos") + end, + [LShoulderbutton[2]] = function() + Spring.SendCommands("slowdown") + end, + [RShoulderbutton[2]] = function() + Spring.SendCommands("speedup") + end, --[RStickButton[2]] = function() Spring.SendCommands("MiniMap Maximize") end, --[LStickButton[2]] = function() Spring.SendCommands("luaui togglewidget Defense Range GL4") end, --[SelectButton[2]] = function() Spring.SendCommands("SpecFullView") end, --[StartButton[2]] = function() Spring.SendCommands("option dof") end, - [SelectButton[2]] = function() toggleRecording() end, - [StartButton[2]] = function() togglePlayback() end, + [SelectButton[2]] = function() + toggleRecording() + end, + [StartButton[2]] = function() + togglePlayback() + end, } - -------------------------------------------------------------------------------- -local spGetCameraState = Spring.GetCameraState -local spSetCameraState = Spring.SetCameraState +local spGetCameraState = Spring.GetCameraState +local spSetCameraState = Spring.SetCameraState -------------------------------------------------------------------------------- local host = "127.0.0.1" @@ -222,11 +233,11 @@ local client local set local mincameraheight = 32 -- min camera Y in elmos local movemult = 3.0 -- move speed multiplier -local rotmult = 0.2 -- rotation speed multiplier +local rotmult = 0.2 -- rotation speed multiplier local movechangefactor = 1.01 local smoothchangefactor = 0.01 local joystate = {} -local smoothing = 0.97 --amount of smoothing +local smoothing = 0.97 --amount of smoothing local analogexponent = 1.4 -- amount of analog stick exponentiation local debugMode = false @@ -237,28 +248,28 @@ local storedCameraSequence = {} local joystickCamFile = "Joystick_Camera_Recordings.lua" local function strtable(t) - local res = '{' - for k,v in pairs(t) do + local res = "{" + for k, v in pairs(t) do --if k == 'oldHeight' or k == 'name' or k == 'mode' then - -- dont save these + -- dont save these --else - res = res .. tostring(k) .. '=' .. tostring(v) ..', ' + res = res .. tostring(k) .. "=" .. tostring(v) .. ", " --end end - return res .. '}' + return res .. "}" end local function SaveRecording() - local jcf = io.open(joystickCamFile,'a') - jcf:write(string.format("local recordingID_%s = {\n",tostring(os.date("%Y%m%d_%H%M%S")))) - for i=1, #storedCameraSequence do + local jcf = io.open(joystickCamFile, "a") + jcf:write(string.format("local recordingID_%s = {\n", tostring(os.date("%Y%m%d_%H%M%S")))) + for i = 1, #storedCameraSequence do jcf:write(string.format(" [%d] = %s ,\n", i, strtable(storedCameraSequence[i]))) end jcf:write(string.format("}\n")) jcf:close() end -toggleRecording = function () +toggleRecording = function() if isplayingback then spEcho("Cant start playback while recording") return @@ -288,7 +299,7 @@ end local function dumpConfig() -- dump all luasocket related config settings to console - for _, conf in ipairs({"TCPAllowConnect", "TCPAllowListen", "UDPAllowConnect", "UDPAllowListen" }) do + for _, conf in ipairs({ "TCPAllowConnect", "TCPAllowListen", "UDPAllowConnect", "UDPAllowListen" }) do spEcho(conf .. " = " .. Spring.GetConfigString(conf, "")) end end @@ -296,7 +307,7 @@ end local function newset() local reverse = {} local set = {} - return setmetatable(set, {__index = { + return setmetatable(set, { __index = { insert = function(set, value) if not reverse[value] then table.insert(set, value) @@ -313,17 +324,17 @@ local function newset() set[index] = top end end - end - }}) + end, + } }) end local function SocketConnect(host, port) - client=socket.tcp() + client = socket.tcp() client:settimeout(0) res, err = client:connect(host, port) if not res and err ~= "timeout" then client:close() - spEcho("Unable to connect to joystick server: ",res, err, "Restart widget after server is started") + spEcho("Unable to connect to joystick server: ", res, err, "Restart widget after server is started") return false end set = newset() @@ -339,7 +350,7 @@ function widget:TextCommand(command) if string.find(command, "ps3", nil, true) then spEcho("Enabling PS3 controller layout") PS3() - elseif string.find(command, "ps4",nil, true) then + elseif string.find(command, "ps4", nil, true) then spEcho("Enabling PS4 controller layout") PS4() elseif string.find(command, "xbox", nil, true) then @@ -360,12 +371,14 @@ function widget:TextCommand(command) end function widget:Initialize() - Spring.SendCommands({"set SmoothTimeOffset 2"}) + Spring.SendCommands({ "set SmoothTimeOffset 2" }) spEcho("Started Camera Joystick, make sure you are running the joystick server, and switch camera to Ctrl+F4") - if debugMode then dumpConfig() end + if debugMode then + dumpConfig() + end local connected = SocketConnect(host, port) if connected then - Spring.SetConfigInt("RotOverheadClampMap",0) + Spring.SetConfigInt("RotOverheadClampMap", 0) else widgetHandler:RemoveWidget() end @@ -373,22 +386,22 @@ end local function joystatetostr(js) local jstr = "buttons = [" - for i,n in ipairs(js.buttons) do + for i, n in ipairs(js.buttons) do jstr = jstr .. " " .. tostring(n) end - jstr = jstr .. '] hats = [' + jstr = jstr .. "] hats = [" for i, n in ipairs(js.hats) do - jstr = jstr .. " "..tostring(n) + jstr = jstr .. " " .. tostring(n) end - jstr = jstr .. '] axes = [' + jstr = jstr .. "] axes = [" for i, n in ipairs(js.axes) do - jstr = jstr .. string.format(" %.2f",n) + jstr = jstr .. string.format(" %.2f", n) end - return jstr .. ']' + return jstr .. "]" end -local Json = Json or VFS.Include('common/luaUtilities/json.lua') +local Json = Json or VFS.Include("common/luaUtilities/json.lua") -local buttonorder = { LeftXAxis, LeftYAxis, RightXAxis, RightYAxis, RightTrigger, LeftTrigger, DpadUp, DpadDown, DpadRight, DpadLeft, Abutton, Bbutton, Xbutton,Ybutton, LShoulderbutton ,RShoulderbutton, RStickButton , LStickButton } +local buttonorder = { LeftXAxis, LeftYAxis, RightXAxis, RightYAxis, RightTrigger, LeftTrigger, DpadUp, DpadDown, DpadRight, DpadLeft, Abutton, Bbutton, Xbutton, Ybutton, LShoulderbutton, RShoulderbutton, RStickButton, LStickButton } local function SocketDataReceived(sock, str) --spEcho(str) @@ -396,31 +409,30 @@ local function SocketDataReceived(sock, str) if joystate.axes == nil then joystate = newjoystate - -- validate all defined controls: - for i, but in ipairs(buttonorder) do - if but and joystate[but[1]][but[2]] == nil then - spEcho(joystatetostr(joystate)) - spEcho("Warning: control missing:",but[1],but[2]) + -- validate all defined controls: + for i, but in ipairs(buttonorder) do + if but and joystate[but[1]][but[2]] == nil then + spEcho(joystatetostr(joystate)) + spEcho("Warning: control missing:", but[1], but[2]) + end end - end - else - for i,a in ipairs(newjoystate.axes) do - if DeadZone and math.abs(newjoystate.axes[i] ) < DeadZone then + for i, a in ipairs(newjoystate.axes) do + if DeadZone and math.abs(newjoystate.axes[i]) < DeadZone then newjoystate.axes[i] = 0 a = 0 end - joystate.axes[i] = smoothing*joystate.axes[i] + (1-smoothing) * a + joystate.axes[i] = smoothing * joystate.axes[i] + (1 - smoothing) * a + end + if joystate.hats then + joystate.hats = newjoystate.hats + else + joystate.hats = {} end - if joystate.hats then - joystate.hats = newjoystate.hats - else - joystate.hats = {} - end for btnindex, cmd in pairs(buttonCommands) do if joystate.buttons[btnindex] then if joystate.buttons[btnindex] == 0 and newjoystate.buttons[btnindex] == 1 then - spEcho("Button",btnindex,"pressed, sending command") + spEcho("Button", btnindex, "pressed, sending command") cmd() end end @@ -434,41 +446,38 @@ local function SocketClosed(sock) end local matrix = {} -matrix[0],matrix[1],matrix[2] = {},{},{}; - -local function rotateVector(vector,axis,phi) - local rcos = math.cos(mathPi*phi/180); - local rsin = math.sin(mathPi*phi/180); - local u,v,w = axis[1],axis[2],axis[3]; - - - matrix[0][0] = rcos + u*u*(1-rcos); - matrix[1][0] = w * rsin + v*u*(1-rcos); - matrix[2][0] = -v * rsin + w*u*(1-rcos); - matrix[0][1] = -w * rsin + u*v*(1-rcos); - matrix[1][1] = rcos + v*v*(1-rcos); - matrix[2][1] = u * rsin + w*v*(1-rcos); - matrix[0][2] = v * rsin + u*w*(1-rcos); - matrix[1][2] = -u * rsin + v*w*(1-rcos); - matrix[2][2] = rcos + w*w*(1-rcos); - - local x,y,z = vector[1],vector[2],vector[3]; - - return x * matrix[0][0] + y * matrix[0][1] + z * matrix[0][2], - x * matrix[1][0] + y * matrix[1][1] + z * matrix[1][2], - x * matrix[2][0] + y * matrix[2][1] + z * matrix[2][2]; +matrix[0], matrix[1], matrix[2] = {}, {}, {} + +local function rotateVector(vector, axis, phi) + local rcos = math.cos(mathPi * phi / 180) + local rsin = math.sin(mathPi * phi / 180) + local u, v, w = axis[1], axis[2], axis[3] + + matrix[0][0] = rcos + u * u * (1 - rcos) + matrix[1][0] = w * rsin + v * u * (1 - rcos) + matrix[2][0] = -v * rsin + w * u * (1 - rcos) + matrix[0][1] = -w * rsin + u * v * (1 - rcos) + matrix[1][1] = rcos + v * v * (1 - rcos) + matrix[2][1] = u * rsin + w * v * (1 - rcos) + matrix[0][2] = v * rsin + u * w * (1 - rcos) + matrix[1][2] = -u * rsin + v * w * (1 - rcos) + matrix[2][2] = rcos + w * w * (1 - rcos) + + local x, y, z = vector[1], vector[2], vector[3] + + return x * matrix[0][0] + y * matrix[0][1] + z * matrix[0][2], x * matrix[1][0] + y * matrix[1][1] + z * matrix[1][2], x * matrix[2][0] + y * matrix[2][1] + z * matrix[2][2] end -local function norm2d(x,y) - local l = math.sqrt(x*x+y*y) - return x/l, y/l +local function norm2d(x, y) + local l = math.sqrt(x * x + y * y) + return x / l, y / l end local function axesexponent(axin) if axin >= 0 then return math.pow(axin, analogexponent) else - return -1* math.pow(-1*axin, analogexponent) + return -1 * math.pow(-1 * axin, analogexponent) end end @@ -485,21 +494,21 @@ function widget:Update(dt) -- dt in seconds end end - if set==nil or #set<=0 then + if set == nil or #set <= 0 then return end -- get sockets ready for read local readable, writeable, err = socket.select(set, set, 0) - if err~=nil then + if err ~= nil then -- some error happened in select - if err=="timeout" then + if err == "timeout" then -- nothing to do, return return end spEcho("Error in select: " .. error) end for _, input in ipairs(readable) do - local s, status, partial = input:receive('*a') --try to read all data + local s, status, partial = input:receive("*a") --try to read all data if status == "timeout" or status == nil then SocketDataReceived(input, s or partial) elseif status == "closed" then @@ -509,7 +518,9 @@ function widget:Update(dt) -- dt in seconds end end - if isplayingback then return end + if isplayingback then + return + end local cs = spGetCameraState() @@ -521,76 +532,78 @@ function widget:Update(dt) -- dt in seconds if joystate[DpadUp[1]][DpadUp[2]] and joystate[DpadUp[1]][DpadUp[2]] == DpadUp[3] then movemult = movemult * movechangefactor rotmult = rotmult * movechangefactor - spEcho("Speed increased to ",movemult) + spEcho("Speed increased to ", movemult) end if joystate[DpadDown[1]][DpadDown[2]] and joystate[DpadDown[1]][DpadDown[2]] == DpadDown[3] then movemult = movemult / movechangefactor rotmult = rotmult / movechangefactor - spEcho("Speed decreased to ",movemult) + spEcho("Speed decreased to ", movemult) end if joystate[DpadRight[1]][DpadRight[2]] and joystate[DpadRight[1]][DpadRight[2]] == DpadRight[3] then - smoothing = smoothchangefactor * 1.0 + (1.0 - smoothchangefactor ) * smoothing - spEcho("Smoothing increased to ",smoothing) + smoothing = smoothchangefactor * 1.0 + (1.0 - smoothchangefactor) * smoothing + spEcho("Smoothing increased to ", smoothing) end if joystate[DpadLeft[1]][DpadLeft[2]] and joystate[DpadLeft[1]][DpadLeft[2]] == DpadLeft[3] then - smoothing = (1.0 - smoothchangefactor ) * smoothing - spEcho("Smoothing decreased to ",smoothing) + smoothing = (1.0 - smoothchangefactor) * smoothing + spEcho("Smoothing decreased to ", smoothing) end - if (dt>0) and (dt < 1.0/75 or dt > 1.0/45) then -- correct for <45 fps and >75fps as there is some jitter in frames + if (dt > 0) and (dt < 1.0 / 75 or dt > 1.0 / 45) then -- correct for <45 fps and >75fps as there is some jitter in frames --frameSpeed = 60* dt --frameSpeed = 1 * 0.9 + 60 * dt * 0.1 -- some exponential smoothing frameSpeed = 1 -- no smoothing - if debugMode then spEcho("speed correction",dt,frameSpeed) end + if debugMode then + spEcho("speed correction", dt, frameSpeed) + end end local ndx, ndz = norm2d(cs.dx, cs.dz) - if debugMode and Spring.GetGameFrame() %60 ==0 then + if debugMode and Spring.GetGameFrame() % 60 == 0 then spEcho(ndx, ndz, cs.dx, cs.dy, cs.dz) end - -- Move left-right + -- Move left-right if joystate[LeftXAxis[1]][LeftXAxis[2]] then local lrmove = axesexponent(joystate[LeftXAxis[1]][LeftXAxis[2]]) - cs.px = cs.px + -1*(ndz * lrmove) * movemult * frameSpeed -- good + cs.px = cs.px + -1 * (ndz * lrmove) * movemult * frameSpeed -- good cs.pz = cs.pz + (ndx * lrmove) * movemult * frameSpeed end - -- Move forward-backward + -- Move forward-backward if joystate[LeftYAxis[1]][LeftYAxis[2]] then local fbmove = axesexponent(joystate[LeftYAxis[1]][LeftYAxis[2]]) - cs.px = cs.px + -1*(ndx * fbmove) * movemult * frameSpeed - cs.pz = cs.pz + -1*(ndz * fbmove) * movemult * frameSpeed + cs.px = cs.px + -1 * (ndx * fbmove) * movemult * frameSpeed + cs.pz = cs.pz + -1 * (ndz * fbmove) * movemult * frameSpeed end - -- Turn left-right + -- Turn left-right if joystate[RightXAxis[1]][RightXAxis[2]] then local lrturn = axesexponent(joystate[RightXAxis[1]][RightXAxis[2]]) - local rotYx, rotYy, rotYz = rotateVector({cs.dx, cs.dy, cs.dz}, {0,1,0} , -1.0* lrturn * rotmult * frameSpeed) + local rotYx, rotYy, rotYz = rotateVector({ cs.dx, cs.dy, cs.dz }, { 0, 1, 0 }, -1.0 * lrturn * rotmult * frameSpeed) cs.dx = rotYx cs.dy = rotYy cs.dz = rotYz end - -- Turn up-down + -- Turn up-down if joystate[RightYAxis[1]][RightYAxis[2]] then local turnupdown = axesexponent(joystate[RightYAxis[1]][RightYAxis[2]]) - if not((cs.dy < -0.98 and turnupdown >= 0) or (cs.dy > 0.98 and turnupdown <= 0) ) then -- gimbal lock prevention - local rotUpx, rotUpy, rotUpz = rotateVector({cs.dx, cs.dy, cs.dz}, {ndz,0,-ndx} , turnupdown * rotmult * frameSpeed) + if not ((cs.dy < -0.98 and turnupdown >= 0) or (cs.dy > 0.98 and turnupdown <= 0)) then -- gimbal lock prevention + local rotUpx, rotUpy, rotUpz = rotateVector({ cs.dx, cs.dy, cs.dz }, { ndz, 0, -ndx }, turnupdown * rotmult * frameSpeed) cs.dx = rotUpx cs.dy = rotUpy cs.dz = rotUpz end end - -- Move up-down + -- Move up-down if joystate[RightTrigger[1]][RightTrigger[2]] and joystate[LeftTrigger[1]][LeftTrigger[2]] then - cs.py = cs.py - (1.0 + joystate[RightTrigger[1]][RightTrigger[2]]) * movemult/2 * frameSpeed - if LeftTrigger[1] == 'axes' then - cs.py = cs.py + (1.0 + joystate[LeftTrigger[1]][LeftTrigger[2]]) * movemult/2 * frameSpeed + cs.py = cs.py - (1.0 + joystate[RightTrigger[1]][RightTrigger[2]]) * movemult / 2 * frameSpeed + if LeftTrigger[1] == "axes" then + cs.py = cs.py + (1.0 + joystate[LeftTrigger[1]][LeftTrigger[2]]) * movemult / 2 * frameSpeed else --probably a button cs.py = cs.py + joystate[LeftTrigger[1]][LeftTrigger[2]] * movemult * frameSpeed if joystate[LeftTrigger[1]][LeftTrigger[2]] == LeftTrigger[3] then @@ -600,18 +613,17 @@ function widget:Update(dt) -- dt in seconds end -- Prevent the camera from going too low - local gh = Spring.GetGroundHeight(cs.px,cs.pz) - cs.py = mathMax(mincameraheight, mathMax(cs.py , gh + 32)) + local gh = Spring.GetGroundHeight(cs.px, cs.pz) + cs.py = mathMax(mincameraheight, mathMax(cs.py, gh + 32)) --if cs.py < gh + 32 then cs.py =gh + 32 end - spSetCameraState(cs,0) - spSetCameraState(cs,0) - spSetCameraState(cs,0) + spSetCameraState(cs, 0) + spSetCameraState(cs, 0) + spSetCameraState(cs, 0) if isrecording then storedCameraSequence[#storedCameraSequence + 1] = cs end end - end -------------------------------------------------------------------------------- @@ -631,4 +643,5 @@ name : "rot" [t=00:13:23.057932][f=0022976] dz = -0.3997985 [t=00:13:23.057932][f=0022976] oldHeight = 1155.58826 [t=00:13:23.057932][f=0022976] }, - ]]-- + ]] +-- diff --git a/luaui/Widgets/camera_lockcamera.lua b/luaui/Widgets/camera_lockcamera.lua index c51c1011e7c..24c0c433ab7 100644 --- a/luaui/Widgets/camera_lockcamera.lua +++ b/luaui/Widgets/camera_lockcamera.lua @@ -14,10 +14,10 @@ function widget:GetInfo() end local lockcameraHideEnemies = true -- specfullview -local lockcameraLos = true -- togglelos +local lockcameraLos = true -- togglelos -local transitionTime = 1.3 -- how long it takes the camera to move when tracking a player -local listTime = 14 -- how long back to look for recent broadcasters +local transitionTime = 1.3 -- how long it takes the camera to move when tracking a player +local listTime = 14 -- how long back to look for recent broadcasters local totalTime = 0 local lastBroadcasts = {} @@ -56,11 +56,15 @@ local function matchRotation(targetState) if not myRotation then myRotation = 0 - if myState.flipped == 0 then myRotation = math_pi end + if myState.flipped == 0 then + myRotation = math_pi + end end if not targetRotation then targetRotation = 0 - if targetState.flipped == 0 then targetRotation = math_pi end + if targetState.flipped == 0 then + targetRotation = math_pi + end end myState.ry = matchRotationRange(myRotation, targetRotation) @@ -70,7 +74,6 @@ local function matchRotation(targetState) myLastCameraState = myLastCameraState or myState end - local function UpdateRecentBroadcasters() for k in pairs(recentBroadcasters) do recentBroadcasters[k] = nil @@ -102,19 +105,19 @@ local function LockCamera(playerID) spSendCommands("specfullview") end if not isSpec and lockcameraLos and mySpecStatus then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os_clock() end elseif lockcameraHideEnemies and isSpec then if not fullView then spSendCommands("specfullview") end - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() end lockPlayerID = playerID if not isSpec and lockcameraLos and mySpecStatus then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os_clock() end myLastCameraState = myLastCameraState or spGetCameraState() @@ -136,12 +139,12 @@ local function LockCamera(playerID) spSendCommands("specfullview") end if lockcameraLos and mySpecStatus then - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() end end lockPlayerID = nil - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() end UpdateRecentBroadcasters() @@ -149,7 +152,6 @@ local function LockCamera(playerID) return lockPlayerID end - local function CameraBroadcastEvent(playerID, cameraState) -- if cameraState is empty then transmission has stopped if not cameraState then @@ -240,7 +242,7 @@ function widget:Initialize() if not fullView then spSendCommands("specfullview") if lockcameraLos and mySpecStatus then - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() spSendCommands("togglelos") end @@ -249,7 +251,7 @@ function widget:Initialize() if fullView then spSendCommands("specfullview") if lockcameraLos and mySpecStatus then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os_clock() end end @@ -269,11 +271,11 @@ function widget:Initialize() lockcameraLos = value if lockcameraHideEnemies and mySpecStatus and lockPlayerID and not select(3, spGetPlayerInfo(lockPlayerID)) then if lockcameraLos and mySpecStatus then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os_clock() spSendCommands("togglelos") elseif not lockcameraLos and spGetMapDrawMode() == "los" then - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() spSendCommands("togglelos") end @@ -339,7 +341,7 @@ function widget:SetConfigData(data) if not fullView then spSendCommands("specfullview") if lockcameraLos and mySpecStatus and spGetMapDrawMode() == "los" then - desiredLosmode = 'normal' + desiredLosmode = "normal" desiredLosmodeChanged = os_clock() end end @@ -347,7 +349,7 @@ function widget:SetConfigData(data) if fullView then spSendCommands("specfullview") if lockcameraLos and mySpecStatus then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os_clock() end end diff --git a/luaui/Widgets/camera_middle_mouse_alternate.lua b/luaui/Widgets/camera_middle_mouse_alternate.lua index 1e679ee58d2..c811fd009df 100644 --- a/luaui/Widgets/camera_middle_mouse_alternate.lua +++ b/luaui/Widgets/camera_middle_mouse_alternate.lua @@ -1,41 +1,39 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Middle Mouse SmoothScroll", - desc = "Alternate view movement for the middle mouse button & overhead camera", - author = "[DE]LSR, original implementation by trepan", - date = "March 2023", - license = "GNU GPL, v2 or later", - layer = 1, -- after the normal widgets - enabled = false - } + return { + name = "Middle Mouse SmoothScroll", + desc = "Alternate view movement for the middle mouse button & overhead camera", + author = "[DE]LSR, original implementation by trepan", + date = "March 2023", + license = "GNU GPL, v2 or later", + layer = 1, -- after the normal widgets + enabled = false, + } end - -- Localized functions for performance local mathSqrt = math.sqrt -- Localized Spring API for performance local spGetMouseState = Spring.GetMouseState -local spGetCameraState = Spring.GetCameraState +local spGetCameraState = Spring.GetCameraState local spGetCameraVectors = Spring.GetCameraVectors -local spGetModKeyState = Spring.GetModKeyState -local spGetMouseState = spGetMouseState -local spIsAboveMiniMap = Spring.IsAboveMiniMap -local spSendCommands = Spring.SendCommands -local spSetCameraState = Spring.SetCameraState -local spSetMouseCursor = Spring.SetMouseCursor -local spWarpMouse = Spring.WarpMouse +local spGetModKeyState = Spring.GetModKeyState +local spGetMouseState = spGetMouseState +local spIsAboveMiniMap = Spring.IsAboveMiniMap +local spSendCommands = Spring.SendCommands +local spSetCameraState = Spring.SetCameraState +local spSetMouseCursor = Spring.SetMouseCursor +local spWarpMouse = Spring.WarpMouse local blockModeSwitching = true - local vsx, vsy = widgetHandler:GetViewSizes() function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY + vsx = viewSizeX + vsy = viewSizeY end local mx, my @@ -43,149 +41,149 @@ local active = false local drawing = false function widget:Update(dt) - if (active) then - - local speedFactor = Spring.GetConfigInt('OverheadScrollSpeed', 10) - local x, y, lmb, mmb, rmb = spGetMouseState() - local cs = spGetCameraState() - local speed = dt * speedFactor - - if (cs.name == 'free') then - local a,c,m,s = spGetModKeyState() - if (c) then - return - end - -- clear the velocities - cs.vx = 0; cs.vy = 0; cs.vz = 0 - cs.avx = 0; cs.avy = 0; cs.avz = 0 - end - if (cs.name == 'ta') then - local flip = -cs.flipped - -- simple, forward and right are locked - cs.px = cs.px + (speed * flip * (x - mx)) - if (false) then - cs.py = cs.py + (speed * flip * (my - y)) - else - cs.pz = cs.pz + (speed * flip * (my - y)) - end - else - -- forward, up, right, top, bottom, left, right - local camVecs = spGetCameraVectors() - local cf = camVecs.forward - local len = mathSqrt((cf[1] * cf[1]) + (cf[3] * cf[3])) - local dfx = cf[1] / len - local dfz = cf[3] / len - local cr = camVecs.right - local len = mathSqrt((cr[1] * cr[1]) + (cr[3] * cr[3])) - local drx = cr[1] / len - local drz = cr[3] / len - local mxm = (speed * (x - mx)) - local mym = (speed * (y - my)) - cs.px = cs.px + (mxm * drx) + (mym * dfx) - cs.pz = cs.pz + (mxm * drz) + (mym * dfz) - end - - spSetCameraState(cs, 0) - - if (mmb) then - spSetMouseCursor('none') - end - end + if active then + local speedFactor = Spring.GetConfigInt("OverheadScrollSpeed", 10) + local x, y, lmb, mmb, rmb = spGetMouseState() + local cs = spGetCameraState() + local speed = dt * speedFactor + + if cs.name == "free" then + local a, c, m, s = spGetModKeyState() + if c then + return + end + -- clear the velocities + cs.vx = 0 + cs.vy = 0 + cs.vz = 0 + cs.avx = 0 + cs.avy = 0 + cs.avz = 0 + end + if cs.name == "ta" then + local flip = -cs.flipped + -- simple, forward and right are locked + cs.px = cs.px + (speed * flip * (x - mx)) + if false then + cs.py = cs.py + (speed * flip * (my - y)) + else + cs.pz = cs.pz + (speed * flip * (my - y)) + end + else + -- forward, up, right, top, bottom, left, right + local camVecs = spGetCameraVectors() + local cf = camVecs.forward + local len = mathSqrt((cf[1] * cf[1]) + (cf[3] * cf[3])) + local dfx = cf[1] / len + local dfz = cf[3] / len + local cr = camVecs.right + local len = mathSqrt((cr[1] * cr[1]) + (cr[3] * cr[3])) + local drx = cr[1] / len + local drz = cr[3] / len + local mxm = (speed * (x - mx)) + local mym = (speed * (y - my)) + cs.px = cs.px + (mxm * drx) + (mym * dfx) + cs.pz = cs.pz + (mxm * drz) + (mym * dfz) + end + + spSetCameraState(cs, 0) + + if mmb then + spSetMouseCursor("none") + end + end end - function widget:MousePress(x, y, button) - if (button ~= 2) then - return false - end - if (spIsAboveMiniMap(x, y)) then - return false - end - local cs = spGetCameraState() - if (blockModeSwitching and (cs.name ~= 'ta') and (cs.name ~= 'free')) then - local a,c,m,s = spGetModKeyState() - return (c or s) -- block the mode toggling - end - if (cs.name == 'free') then - local a,c,m,s = spGetModKeyState() - if (m and (not (c or s))) then - return false - end - end - active = not active - if (active) then - mx = vsx * 0.5 - my = vsy * 0.5 - spWarpMouse(mx, my) - spSendCommands({'trackoff'}) - end - return true + if button ~= 2 then + return false + end + if spIsAboveMiniMap(x, y) then + return false + end + local cs = spGetCameraState() + if blockModeSwitching and (cs.name ~= "ta") and (cs.name ~= "free") then + local a, c, m, s = spGetModKeyState() + return (c or s) -- block the mode toggling + end + if cs.name == "free" then + local a, c, m, s = spGetModKeyState() + if m and not (c or s) then + return false + end + end + active = not active + if active then + mx = vsx * 0.5 + my = vsy * 0.5 + spWarpMouse(mx, my) + spSendCommands({ "trackoff" }) + end + return true end - function widget:MouseRelease(x, y, button) - active = false - return -1 + active = false + return -1 end -- Adjust the camera position when the user scrolls the mouse wheel function widget:MouseWheel(up, value) - -- Get the current camera state and mod key state - local cameraState = Spring.GetCameraState() - local altDown, ctrlDown, metaDown, shiftDown = Spring.GetModKeyState() + -- Get the current camera state and mod key state + local cameraState = Spring.GetCameraState() + local altDown, ctrlDown, metaDown, shiftDown = Spring.GetModKeyState() - -- If the Alt key is down, adjust the camera height - if altDown then - local absCameraY = math.abs(cameraState.py) - local cameraYDelta = (absCameraY / 10) * (up and -1 or 1) + -- If the Alt key is down, adjust the camera height + if altDown then + local absCameraY = math.abs(cameraState.py) + local cameraYDelta = (absCameraY / 10) * (up and -1 or 1) local newCameraState = { - py = absCameraY + cameraYDelta + py = absCameraY + cameraYDelta, } - Spring.SetCameraState(newCameraState, 0) - return true - end - - -- If the camera mode is not "free", do nothing - if cameraState.name ~= 'free' then - return false - end - - -- Get the mouse position and position on ground - local mouseX, mouseY = spGetMouseState() - local _, groundPos = Spring.TraceScreenRay(mouseX, mouseY, true) - - -- If there is no ground position, adjust the camera vertically - if not groundPos then - local cameraYDelta = value * 10 - Spring.SetCameraState({ - vy = cameraState.vy + cameraYDelta - }, 0) - else - -- Otherwise, adjust the camera position based on the ground position - local dx = groundPos[1] - cameraState.px - local dy = groundPos[2] - cameraState.py - local dz = groundPos[3] - cameraState.pz - -- local distance = mathSqrt((dx * dx) + (dy * dy) + (dz * dz)) - local speed = (up and 1 or -1) * (1 / 8) - - dx = dx * speed - dy = dy * speed - dz = dz * speed - - local newCameraState = { - px = cameraState.px + dx, - py = cameraState.py + dy, - pz = cameraState.pz + dz, - vx = 0, - vy = 0, - vz = 0 - } - - Spring.SetCameraState(newCameraState, 0) - end - - return true -end + Spring.SetCameraState(newCameraState, 0) + return true + end + + -- If the camera mode is not "free", do nothing + if cameraState.name ~= "free" then + return false + end + + -- Get the mouse position and position on ground + local mouseX, mouseY = spGetMouseState() + local _, groundPos = Spring.TraceScreenRay(mouseX, mouseY, true) + + -- If there is no ground position, adjust the camera vertically + if not groundPos then + local cameraYDelta = value * 10 + Spring.SetCameraState({ + vy = cameraState.vy + cameraYDelta, + }, 0) + else + -- Otherwise, adjust the camera position based on the ground position + local dx = groundPos[1] - cameraState.px + local dy = groundPos[2] - cameraState.py + local dz = groundPos[3] - cameraState.pz + -- local distance = mathSqrt((dx * dx) + (dy * dy) + (dz * dz)) + local speed = (up and 1 or -1) * (1 / 8) + + dx = dx * speed + dy = dy * speed + dz = dz * speed + local newCameraState = { + px = cameraState.px + dx, + py = cameraState.py + dy, + pz = cameraState.pz + dz, + vx = 0, + vy = 0, + vz = 0, + } + + Spring.SetCameraState(newCameraState, 0) + end + + return true +end diff --git a/luaui/Widgets/camera_player_tv.lua b/luaui/Widgets/camera_player_tv.lua index a2bceef5e46..396c0de379a 100644 --- a/luaui/Widgets/camera_player_tv.lua +++ b/luaui/Widgets/camera_player_tv.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathRandom = math.random @@ -28,7 +27,8 @@ local spGetSpectatingState = Spring.GetSpectatingState /playerview #playerID (playerID is optional) /playertv #playerID (playerID is optional) /playercamera -]]-- +]] +-- local displayPlayername = true local alwaysDisplayName = true @@ -38,7 +38,7 @@ local widgetHeight = 22 local parentPos = {} local drawlistsCountdown = {} local drawlistsPlayername = {} -local fontSize = 12 -- countdown font +local fontSize = 12 -- countdown font local top, left, bottom, right = 0, 0, 0, 0 local rejoining = false local initGameframe = spGetGameFrame() @@ -74,7 +74,7 @@ local aiTeams = {} local teamColorKeys = {} for i = 1, #teamList do local r, g, b, a = spGetTeamColor(teamList[i]) - teamColorKeys[teamList[i]] = r..'_'..g..'_'..b + teamColorKeys[teamList[i]] = r .. "_" .. g .. "_" .. b local _, _, _, isAiTeam = Spring.GetTeamInfo(teamList[i], false) if isAiTeam then aiTeams[teamList[i]] = true @@ -86,7 +86,7 @@ local RectRound, elementCorner, bgpadding local guishaderWasActive = false local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } local function tsOrderPlayers() tsOrderedPlayers = {} @@ -94,11 +94,11 @@ local function tsOrderPlayers() if playersTS[playerID] then local _, _, spec, teamID = spGetPlayerInfo(playerID, false) if not spec then - tsOrderedPlayers[#tsOrderedPlayers+1] = {playersTS[playerID], playerID} + tsOrderedPlayers[#tsOrderedPlayers + 1] = { playersTS[playerID], playerID } end end end - local function compare(a,b) + local function compare(a, b) return a[1] > b[1] end table.sort(tsOrderedPlayers, compare) @@ -118,14 +118,14 @@ local function SelectTrackingPlayer(playerID) _, active, spec = spGetPlayerInfo(playerID, false) end - if playerID and (not spec) and active then + if playerID and not spec and active then newTrackedPlayer = playerID else local highestTs = 0 for _, playerID in ipairs(playersList) do local _, active, spec = spGetPlayerInfo(playerID, false) if not spec and active then - if playersTS[playerID] ~= nil and playersTS[playerID] > highestTs+mathRandom(-10,10) then + if playersTS[playerID] ~= nil and playersTS[playerID] > highestTs + mathRandom(-10, 10) then highestTs = playersTS[playerID] newTrackedPlayer = playerID end @@ -140,7 +140,6 @@ local function SelectTrackingPlayer(playerID) WG.lockcamera.SetPlayerID(currentTrackedPlayer) end end - end local function createCountdownLists() @@ -155,10 +154,10 @@ local function createCountdownLists() font:Begin() font:SetOutlineColor(0.15, 0.15, 0.15, 1) font:SetTextColor(0, 0, 0, 0.6) - font:Print(i, right - rightPadding - (0.7 * widgetScale), bottom + (widgetHeight* 1.2 * widgetScale), fontSize * widgetScale, 'rn') - font:Print(i, right - rightPadding + (0.7 * widgetScale), bottom + (widgetHeight* 1.2 * widgetScale), fontSize * widgetScale, 'rn') + font:Print(i, right - rightPadding - (0.7 * widgetScale), bottom + (widgetHeight * 1.2 * widgetScale), fontSize * widgetScale, "rn") + font:Print(i, right - rightPadding + (0.7 * widgetScale), bottom + (widgetHeight * 1.2 * widgetScale), fontSize * widgetScale, "rn") font:SetTextColor(0.88, 0.88, 0.88, 1) - font:Print(i, right - rightPadding, bottom + (widgetHeight* 1.22 * widgetScale), fontSize * widgetScale, 'rn') + font:Print(i, right - rightPadding, bottom + (widgetHeight * 1.22 * widgetScale), fontSize * widgetScale, "rn") font:End() end) i = i + 1 @@ -175,7 +174,7 @@ local function refreshUiDrawing() drawlist = {} drawlist[1] = gl.CreateList(function() - local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) + local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1 + ((1 - (vsy / 1200)) * 0.33), 1, 1.15) local text, color1, color2 font:Begin() @@ -183,128 +182,128 @@ local function refreshUiDrawing() -- Player TV Button if not toggled and not lockPlayerID then - text = '\255\222\255\222 ' .. Spring.I18N('ui.playerTV.playerTV') .. ' ' - color1 = { 0, 0.8*mult, 0, buttonOpacity } - color2 = { 0, 0.55*mult, 0, buttonOpacity } + text = "\255\222\255\222 " .. Spring.I18N("ui.playerTV.playerTV") .. " " + color1 = { 0, 0.8 * mult, 0, buttonOpacity } + color2 = { 0, 0.55 * mult, 0, buttonOpacity } else - text = '\255\255\222\222 ' .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N('ui.playerTV.cancelPlayerTV') or Spring.I18N('ui.playerTV.cancelCamera')) .. ' ' - color1 = { 0.88*mult, 0.1*mult, 0.1*mult, buttonOpacity } - color2 = { 0.6*mult, 0.05*mult, 0.05*mult, buttonOpacity } + text = "\255\255\222\222 " .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N("ui.playerTV.cancelPlayerTV") or Spring.I18N("ui.playerTV.cancelCamera")) .. " " + color1 = { 0.88 * mult, 0.1 * mult, 0.1 * mult, buttonOpacity } + color2 = { 0.6 * mult, 0.05 * mult, 0.05 * mult, buttonOpacity } end local textWidth = font:GetTextWidth(text) * fontSize if isSpec or lockPlayerID then toggleButton = { right - textWidth, bottom, right, top } RectRound(toggleButton[1], toggleButton[2], toggleButton[3], toggleButton[4], elementCorner, 1, 0, 1, 0, color1, color2) - RectRound(toggleButton[1] + bgpadding, toggleButton[2], toggleButton[3], toggleButton[4] - bgpadding, elementCorner*0.66, 1, 0, 1, 0, { 0.3, 0.3, 0.3, 0.25*mult }, { 0.05, 0.05, 0.05, 0.25*mult }) - font:Print(text, toggleButton[3]-((toggleButton[3]-toggleButton[1])/2), toggleButton[2] + (7 * widgetScale), fontSize, 'oc') + RectRound(toggleButton[1] + bgpadding, toggleButton[2], toggleButton[3], toggleButton[4] - bgpadding, elementCorner * 0.66, 1, 0, 1, 0, { 0.3, 0.3, 0.3, 0.25 * mult }, { 0.05, 0.05, 0.05, 0.25 * mult }) + font:Print(text, toggleButton[3] - ((toggleButton[3] - toggleButton[1]) / 2), toggleButton[2] + (7 * widgetScale), fontSize, "oc") else toggleButton = { right, bottom, right, top } end -- Player Camera Button if isSpec and not toggled and not lockPlayerID and not aiTeams[myTeamID] then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerCamera') .. ' ' - color1 = { 0.6*mult, 0.6*mult, 0.6*mult, buttonOpacity } - color2 = { 0.4*mult, 0.4*mult, 0.4*mult, buttonOpacity } + text = "\255\255\255\255 " .. Spring.I18N("ui.playerTV.playerCamera") .. " " + color1 = { 0.6 * mult, 0.6 * mult, 0.6 * mult, buttonOpacity } + color2 = { 0.4 * mult, 0.4 * mult, 0.4 * mult, buttonOpacity } textWidth = mathFloor(font:GetTextWidth(text) * fontSize) - toggleButton3 = { toggleButton[1] - textWidth-bgpadding, bottom, toggleButton[1]-bgpadding, top } + toggleButton3 = { toggleButton[1] - textWidth - bgpadding, bottom, toggleButton[1] - bgpadding, top } RectRound(toggleButton3[1], toggleButton3[2], toggleButton3[3], toggleButton3[4], elementCorner, 1, 1, 0, toggleButton3[1] < left and 1 or 0, color1, color2) - RectRound(toggleButton3[1] + bgpadding, toggleButton3[2], toggleButton3[3]-bgpadding, toggleButton3[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton3[1] < left and 1 or 0, { 0.3, 0.3, 0.3, 0.25*mult }, { 0.05, 0.05, 0.05, 0.25*mult }) - font:Print(text, toggleButton3[3]-((toggleButton3[3]-toggleButton3[1])/2), toggleButton3[2] + (7 * widgetScale), fontSize, 'oc') + RectRound(toggleButton3[1] + bgpadding, toggleButton3[2], toggleButton3[3] - bgpadding, toggleButton3[4] - bgpadding, elementCorner * 0.66, 1, 1, 0, toggleButton3[1] < left and 1 or 0, { 0.3, 0.3, 0.3, 0.25 * mult }, { 0.05, 0.05, 0.05, 0.25 * mult }) + font:Print(text, toggleButton3[3] - ((toggleButton3[3] - toggleButton3[1]) / 2), toggleButton3[2] + (7 * widgetScale), fontSize, "oc") else toggleButton3 = toggleButton end -- Player Viewpoint Button if not toggled2 then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerView') .. ' ' - color1 = { 0.6*mult, 0.6*mult, 0.6*mult, buttonOpacity } - color2 = { 0.4*mult, 0.4*mult, 0.4*mult, buttonOpacity } + text = "\255\255\255\255 " .. Spring.I18N("ui.playerTV.playerView") .. " " + color1 = { 0.6 * mult, 0.6 * mult, 0.6 * mult, buttonOpacity } + color2 = { 0.4 * mult, 0.4 * mult, 0.4 * mult, buttonOpacity } else - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.globalView') .. ' ' - color1 = { 0.88*mult, 0.1*mult, 0.1*mult, buttonOpacity } - color2 = { 0.6*mult, 0.05*mult, 0.05*mult, buttonOpacity } + text = "\255\255\255\255 " .. Spring.I18N("ui.playerTV.globalView") .. " " + color1 = { 0.88 * mult, 0.1 * mult, 0.1 * mult, buttonOpacity } + color2 = { 0.6 * mult, 0.05 * mult, 0.05 * mult, buttonOpacity } end textWidth = mathFloor(font:GetTextWidth(text) * fontSize) if toggled or lockPlayerID or aiTeams[myTeamID] then - toggleButton2 = { toggleButton[1] - textWidth-bgpadding, bottom, toggleButton[1]-bgpadding, top } + toggleButton2 = { toggleButton[1] - textWidth - bgpadding, bottom, toggleButton[1] - bgpadding, top } else - toggleButton2 = { toggleButton3[1] - textWidth-bgpadding, bottom, toggleButton3[1]-bgpadding, top } + toggleButton2 = { toggleButton3[1] - textWidth - bgpadding, bottom, toggleButton3[1] - bgpadding, top } end if isSpec then RectRound(toggleButton2[1], toggleButton2[2], toggleButton2[3], toggleButton2[4], elementCorner, 1, 1, 0, toggleButton2[1] < left and 1 or 0, color1, color2) - RectRound(toggleButton2[1] + bgpadding, toggleButton2[2], toggleButton2[3]-bgpadding, toggleButton2[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton2[1] < left and 1 or 0, { 0.3, 0.3, 0.3, 0.25*mult }, { 0.05, 0.05, 0.05, 0.25*mult }) - font:Print(text, toggleButton2[3]-((toggleButton2[3]-toggleButton2[1])/2), toggleButton2[2] + (7 * widgetScale), fontSize, 'oc') + RectRound(toggleButton2[1] + bgpadding, toggleButton2[2], toggleButton2[3] - bgpadding, toggleButton2[4] - bgpadding, elementCorner * 0.66, 1, 1, 0, toggleButton2[1] < left and 1 or 0, { 0.3, 0.3, 0.3, 0.25 * mult }, { 0.05, 0.05, 0.05, 0.25 * mult }) + font:Print(text, toggleButton2[3] - ((toggleButton2[3] - toggleButton2[1]) / 2), toggleButton2[2] + (7 * widgetScale), fontSize, "oc") end font:End() end) drawlist[2] = gl.CreateList(function() -- Player TV Button highlight if toggled or lockPlayerID then - gl.Color(1*mult, 0.2*mult, 0.2*mult, buttonOpacity) + gl.Color(1 * mult, 0.2 * mult, 0.2 * mult, buttonOpacity) else - gl.Color(0.2*mult, 1*mult, 0.2*mult, buttonOpacity) + gl.Color(0.2 * mult, 1 * mult, 0.2 * mult, buttonOpacity) end RectRound(toggleButton[1], toggleButton[2], toggleButton[3], toggleButton[4], elementCorner, 1, 1, 1, 0) - gl.Color(0, 0, 0, 0.14*mult) - RectRound(toggleButton[1] + bgpadding, toggleButton[2], toggleButton[3], toggleButton[4] - bgpadding, elementCorner*0.66, 1, 1, 1, 0) + gl.Color(0, 0, 0, 0.14 * mult) + RectRound(toggleButton[1] + bgpadding, toggleButton[2], toggleButton[3], toggleButton[4] - bgpadding, elementCorner * 0.66, 1, 1, 1, 0) - local text = '\255\255\225\225 ' .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N('ui.playerTV.cancelPlayerTV') or Spring.I18N('ui.playerTV.cancelCamera')) .. ' ' + local text = "\255\255\225\225 " .. (nextTrackingPlayerChange - os.clock() > -1 and Spring.I18N("ui.playerTV.cancelPlayerTV") or Spring.I18N("ui.playerTV.cancelCamera")) .. " " if not toggled and not lockPlayerID then - text = '\255\225\255\225 ' .. Spring.I18N('ui.playerTV.playerTV') .. ' ' + text = "\255\225\255\225 " .. Spring.I18N("ui.playerTV.playerTV") .. " " end - local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) + local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1 + ((1 - (vsy / 1200)) * 0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) font:Begin() font:SetOutlineColor(0.15, 0.15, 0.15, 1) - font:Print(text, toggleButton[3] - (textWidth / 2), toggleButton[2] + (0.32 * widgetHeight * widgetScale), fontSize, 'oc') + font:Print(text, toggleButton[3] - (textWidth / 2), toggleButton[2] + (0.32 * widgetHeight * widgetScale), fontSize, "oc") font:End() end) drawlist[3] = gl.CreateList(function() -- Player Viewpoint Button highlight if toggled2 then - gl.Color(0.85*mult, 0.2*mult, 0.2*mult, 0.4*mult) + gl.Color(0.85 * mult, 0.2 * mult, 0.2 * mult, 0.4 * mult) else - gl.Color(0.85*mult, 0.85*mult, 0.85*mult, 0.4*mult) + gl.Color(0.85 * mult, 0.85 * mult, 0.85 * mult, 0.4 * mult) end RectRound(toggleButton2[1], toggleButton2[2], toggleButton2[3], toggleButton2[4], elementCorner, 1, 1, 0, toggleButton2[1] < left and 1 or 0) - gl.Color(0, 0, 0, 0.14*mult) - RectRound(toggleButton2[1] + bgpadding, toggleButton2[2], toggleButton2[3]-bgpadding, toggleButton2[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton2[1] < left and 1 or 0) + gl.Color(0, 0, 0, 0.14 * mult) + RectRound(toggleButton2[1] + bgpadding, toggleButton2[2], toggleButton2[3] - bgpadding, toggleButton2[4] - bgpadding, elementCorner * 0.66, 1, 1, 0, toggleButton2[1] < left and 1 or 0) - local text = '\255\255\255\244 ' .. Spring.I18N('ui.playerTV.globalView') .. ' ' + local text = "\255\255\255\244 " .. Spring.I18N("ui.playerTV.globalView") .. " " if not toggled2 then - text = '\255\255\255\255 ' .. Spring.I18N('ui.playerTV.playerView') .. ' ' + text = "\255\255\255\255 " .. Spring.I18N("ui.playerTV.playerView") .. " " end - local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) + local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1 + ((1 - (vsy / 1200)) * 0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) font:Begin() font:SetOutlineColor(0.15, 0.15, 0.15, 1) - font:Print(text, toggleButton2[3] - (textWidth / 2), toggleButton2[2] + (0.32 * widgetHeight * widgetScale), fontSize, 'oc') + font:Print(text, toggleButton2[3] - (textWidth / 2), toggleButton2[2] + (0.32 * widgetHeight * widgetScale), fontSize, "oc") font:End() end) if not toggled and not aiTeams[myTeamID] then drawlist[4] = gl.CreateList(function() -- Player Camera Button highlight if toggled2 then - gl.Color(0.85*mult, 0.2*mult, 0.2*mult, 0.4*mult) + gl.Color(0.85 * mult, 0.2 * mult, 0.2 * mult, 0.4 * mult) else - gl.Color(0.85*mult, 0.85*mult, 0.85*mult, 0.4*mult) + gl.Color(0.85 * mult, 0.85 * mult, 0.85 * mult, 0.4 * mult) end RectRound(toggleButton3[1], toggleButton3[2], toggleButton3[3], toggleButton3[4], elementCorner, 1, 1, 0, toggleButton3[1] < left and 1 or 0) - gl.Color(0, 0, 0, 0.14*mult) - RectRound(toggleButton3[1] + bgpadding, toggleButton3[2], toggleButton3[3]-bgpadding, toggleButton3[4] - bgpadding, elementCorner*0.66, 1, 1, 0, toggleButton3[1] < left and 1 or 0) + gl.Color(0, 0, 0, 0.14 * mult) + RectRound(toggleButton3[1] + bgpadding, toggleButton3[2], toggleButton3[3] - bgpadding, toggleButton3[4] - bgpadding, elementCorner * 0.66, 1, 1, 0, toggleButton3[1] < left and 1 or 0) - local text = '\255\255\255\244 ' .. Spring.I18N('ui.playerTV.playerCamera') .. ' ' - local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1+((1-(vsy/1200))*0.33), 1, 1.15) + local text = "\255\255\255\244 " .. Spring.I18N("ui.playerTV.playerCamera") .. " " + local fontSize = (widgetHeight * widgetScale) * 0.5 * math.clamp(1 + ((1 - (vsy / 1200)) * 0.33), 1, 1.15) local textWidth = mathFloor(font:GetTextWidth(text) * fontSize) font:Begin() font:SetOutlineColor(0.15, 0.15, 0.15, 1) - font:Print(text, toggleButton3[3] - (textWidth / 2), toggleButton3[2] + (0.32 * widgetHeight * widgetScale), fontSize, 'oc') + font:Print(text, toggleButton3[3] - (textWidth / 2), toggleButton3[2] + (0.32 * widgetHeight * widgetScale), fontSize, "oc") font:End() end) end - if WG['guishader'] and (isSpec or lockPlayerID) then + if WG["guishader"] and (isSpec or lockPlayerID) then if backgroundGuishader then backgroundGuishader = gl.DeleteList(backgroundGuishader) end @@ -319,24 +318,24 @@ local function refreshUiDrawing() RectRound(toggleButton3[1], toggleButton3[2], toggleButton3[3], toggleButton3[4], elementCorner, 1, 1, 0, toggleButton3[1] < left and 1 or 0) end end) - WG['guishader'].InsertDlist(backgroundGuishader, 'playertv', true) + WG["guishader"].InsertDlist(backgroundGuishader, "playertv", true) showBackgroundGuishader = true end end local function updatePosition() local prevPos = parentPos - if WG['displayinfo'] ~= nil then - parentPos = WG['displayinfo'].GetPosition() -- returns {top,left,bottom,right,widgetScale} - elseif WG['unittotals'] ~= nil then - parentPos = WG['unittotals'].GetPosition() -- returns {top,left,bottom,right,widgetScale} - elseif WG['music'] ~= nil then - parentPos = WG['music'].GetPosition() -- returns {top,left,bottom,right,widgetScale} - elseif WG['advplayerlist_api'] ~= nil then - parentPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + if WG["displayinfo"] ~= nil then + parentPos = WG["displayinfo"].GetPosition() -- returns {top,left,bottom,right,widgetScale} + elseif WG["unittotals"] ~= nil then + parentPos = WG["unittotals"].GetPosition() -- returns {top,left,bottom,right,widgetScale} + elseif WG["music"] ~= nil then + parentPos = WG["music"].GetPosition() -- returns {top,left,bottom,right,widgetScale} + elseif WG["advplayerlist_api"] ~= nil then + parentPos = WG["advplayerlist_api"].GetPosition() -- returns {top,left,bottom,right,widgetScale} else local scale = (vsy / 880) * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) - parentPos = {0,vsx-(220*scale),0,vsx,scale} + parentPos = { 0, vsx - (220 * scale), 0, vsx, scale } end if parentPos[5] ~= nil then left = parentPos[2] @@ -352,7 +351,7 @@ end function widget:GameStart() isSpec, fullview = spGetSpectatingState() - nextTrackingPlayerChange = os.clock()-0.3 + nextTrackingPlayerChange = os.clock() - 0.3 tsOrderPlayers() if isSpec and not rejoining and toggled then SelectTrackingPlayer() @@ -376,20 +375,19 @@ function widget:PlayerChanged(playerID) end local name = spGetPlayerInfo(playerID, false) name = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID)) or name - if select(4, Spring.GetTeamInfo(myTeamID,false)) then -- is AI? + if select(4, Spring.GetTeamInfo(myTeamID, false)) then -- is AI? local _, _, _, aiName = Spring.GetAIInfo(myTeamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. myTeamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. myTeamID) name = niceName or aiName end if name and drawlistsPlayername[name] then drawlistsPlayername[name] = gl.DeleteList(drawlistsPlayername[name]) end --if receateLists then - updateDrawing = true + updateDrawing = true --end end - local function switchPlayerCam() nextTrackingPlayerChange = os.clock() + playerChangeDelay local tsOrderedPlayerCount = #tsOrderedPlayers @@ -421,7 +419,6 @@ end local sec = 0.5 local posCheckTimer = 0 function widget:Update(dt) - sec = sec + dt if sec > 1 then sec = 0 @@ -430,8 +427,8 @@ function widget:Update(dt) local detectedChanges = false for i = 1, #teamList do local r, g, b, a = spGetTeamColor(teamList[i]) - if teamColorKeys[teamList[i]] ~= r..'_'..g..'_'..b then - teamColorKeys[teamList[i]] = r..'_'..g..'_'..b + if teamColorKeys[teamList[i]] ~= r .. "_" .. g .. "_" .. b then + teamColorKeys[teamList[i]] = r .. "_" .. g .. "_" .. b detectedChanges = true end end @@ -447,7 +444,7 @@ function widget:Update(dt) updatePosition() -- detect guishader toggle: force refresh when it comes back on - local guishaderActive = WG['guishader'] ~= nil + local guishaderActive = WG["guishader"] ~= nil if guishaderActive and not guishaderWasActive then showBackgroundGuishader = nil updateDrawing = true @@ -476,8 +473,8 @@ function widget:Update(dt) end local prevRejoining = rejoining - if WG['rejoin'] then - rejoining = WG['rejoin'].showingRejoining() + if WG["rejoin"] then + rejoining = WG["rejoin"].showingRejoining() end if isSpec and toggled and spGetGameFrame() % 30 == 5 then if rejoining and prevRejoining ~= rejoining then @@ -521,18 +518,18 @@ function widget:Update(dt) end if (isSpec or lockPlayerID) and not rejoining then - if WG['tooltip'] and not toggled and not lockPlayerID then + if WG["tooltip"] and not toggled and not lockPlayerID then if buttonHovered and buttonHovered == 1 then - Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.tooltip')) + Spring.SetMouseCursor("cursornormal") + WG["tooltip"].ShowTooltip("playertv", Spring.I18N("ui.playerTV.tooltip")) end if buttonHovered and buttonHovered == 2 then - Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.playerViewTooltip')) + Spring.SetMouseCursor("cursornormal") + WG["tooltip"].ShowTooltip("playertv", Spring.I18N("ui.playerTV.playerViewTooltip")) end if buttonHovered and buttonHovered == 3 then - Spring.SetMouseCursor('cursornormal') - WG['tooltip'].ShowTooltip('playertv', Spring.I18N('ui.playerTV.playerCameraTooltip')) + Spring.SetMouseCursor("cursornormal") + WG["tooltip"].ShowTooltip("playertv", Spring.I18N("ui.playerTV.playerCameraTooltip")) end end @@ -546,12 +543,12 @@ end local function drawContent() local gameFrame = spGetGameFrame() if (rejoining or gameFrame == 0) and not lockPlayerID then - if WG['guishader'] then - WG['guishader'].RemoveDlist('playertv') + if WG["guishader"] then + WG["guishader"].RemoveDlist("playertv") end elseif backgroundGuishader and not showBackgroundGuishader then - WG['guishader'].InsertDlist(backgroundGuishader, 'playertv', true) - showBackgroundGuishader = true + WG["guishader"].InsertDlist(backgroundGuishader, "playertv", true) + showBackgroundGuishader = true end -- hover highlight @@ -580,8 +577,8 @@ local function drawContent() end end if displayPlayername then - if WG['advplayerlist_api'] and WG.lockcamera then - if not lockPlayerID or lockPlayerID ~= WG.lockcamera.GetPlayerID() and nextTrackingPlayerChange-os.clock() < 0 then + if WG["advplayerlist_api"] and WG.lockcamera then + if not lockPlayerID or lockPlayerID ~= WG.lockcamera.GetPlayerID() and nextTrackingPlayerChange - os.clock() < 0 then --nextTrackingPlayerChange = os.clock() - 2 lockPlayerID = WG.lockcamera.GetPlayerID() if not toggled and prevLockPlayerID ~= lockPlayerID then @@ -596,13 +593,15 @@ local function drawContent() end local name, _, spec, teamID, _, _, _, _, _ = spGetPlayerInfo(myTeamPlayerID, false) name = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(myTeamPlayerID)) or name - if select(4, Spring.GetTeamInfo(myTeamID,false)) then -- is AI? + if select(4, Spring.GetTeamInfo(myTeamID, false)) then -- is AI? local _, _, _, aiName = Spring.GetAIInfo(myTeamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. myTeamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. myTeamID) name = niceName or aiName - name = Spring.I18N('ui.playersList.aiName', { name = name }) + name = Spring.I18N("ui.playersList.aiName", { name = name }) + end + if not name then + name = "---" end - if not name then name = '---' end -- create player name if not drawlistsPlayername[name] then drawlistsPlayername[name] = gl.CreateList(function() @@ -639,37 +638,34 @@ function widget:DrawScreen() if updateDrawing then updateDrawing = false refreshUiDrawing() - if right-left >= 1 and top-bottom >= 1 then - uiTexTopExtra = mathFloor(vsy*0.06) - uiTexLeftExtra = mathFloor(vsy*0.08) - if not uiTex then - uiTex = gl.CreateTexture((mathFloor(right-left)+uiTexLeftExtra), (mathFloor(top-bottom)+uiTexTopExtra), { - target = GL.TEXTURE_2D, - format = GL.RGBA, - fbo = true, - }) - end - gl.R2tHelper.RenderToTexture(uiTex, - function() + if right - left >= 1 and top - bottom >= 1 then + uiTexTopExtra = mathFloor(vsy * 0.06) + uiTexLeftExtra = mathFloor(vsy * 0.08) + if not uiTex then + uiTex = gl.CreateTexture((mathFloor(right - left) + uiTexLeftExtra), (mathFloor(top - bottom) + uiTexTopExtra), { + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, + }) + end + gl.R2tHelper.RenderToTexture(uiTex, function() gl.Translate(-1, -1, 0) - gl.Scale(2 / ((right-left)+uiTexLeftExtra), 2 / ((top-bottom)+uiTexTopExtra), 0) - gl.Translate(-left+uiTexLeftExtra, -bottom, 0) + gl.Scale(2 / ((right - left) + uiTexLeftExtra), 2 / ((top - bottom) + uiTexTopExtra), 0) + gl.Translate(-left + uiTexLeftExtra, -bottom, 0) drawContent() - end, - true - ) - end + end, true) + end end if uiTex then - gl.R2tHelper.BlendTexRect(uiTex, left-uiTexLeftExtra, bottom, right, top+uiTexTopExtra, true) + gl.R2tHelper.BlendTexRect(uiTex, left - uiTexLeftExtra, bottom, right, top + uiTexTopExtra, true) end end local function togglePlayerTV(state) prevOrderID = nil currentTrackedPlayer = nil - if (state~= nil and not state) or toggled or lockPlayerID then + if (state ~= nil and not state) or toggled or lockPlayerID then toggled = false toggled2 = false if WG.lockcamera then @@ -683,7 +679,7 @@ local function togglePlayerTV(state) toggled = true toggled2 = true if WG.lockcamera and WG.lockcamera.SetLosMode then - WG.lockcamera.SetLosMode('los') + WG.lockcamera.SetLosMode("los") end switchPlayerCam() updateDrawing = true @@ -712,7 +708,7 @@ local function togglePlayerView(state) Spring.SendCommands("specfullview") end if WG.lockcamera and WG.lockcamera.SetLosMode then - WG.lockcamera.SetLosMode('normal') + WG.lockcamera.SetLosMode("normal") elseif Spring.GetMapDrawMode() == "los" then Spring.SendCommands("togglelos") end @@ -723,9 +719,9 @@ local function togglePlayerView(state) Spring.SendCommands("specfullview") end if WG.lockcamera and WG.lockcamera.SetLosMode then - WG.lockcamera.SetLosMode('los') + WG.lockcamera.SetLosMode("los") elseif Spring.GetMapDrawMode() ~= "los" then - desiredLosmode = 'los' + desiredLosmode = "los" desiredLosmodeChanged = os.clock() end end @@ -769,7 +765,7 @@ function widget:Initialize() if isSpec and not fullview then toggled2 = true end - if WG['advplayerlist_api'] == nil then + if WG["advplayerlist_api"] == nil then widgetHandler:RemoveWidget() return end @@ -793,30 +789,30 @@ function widget:Initialize() tsOrderPlayers() updatePosition() - WG['playertv'] = {} - WG['playertv'].GetPosition = function() + WG["playertv"] = {} + WG["playertv"].GetPosition = function() return { top, left, bottom, right, widgetScale } end - WG['playertv'].isActive = function() + WG["playertv"].isActive = function() return (toggled and isSpec) end - WG['playertv'].GetPlayerChangeDelay = function() + WG["playertv"].GetPlayerChangeDelay = function() return playerChangeDelay end - WG['playertv'].SetPlayerChangeDelay = function(value) + WG["playertv"].SetPlayerChangeDelay = function(value) playerChangeDelay = value createCountdownLists() end - WG['playertv'].GetAlwaysDisplayName = function() + WG["playertv"].GetAlwaysDisplayName = function() return alwaysDisplayName end - WG['playertv'].SetAlwaysDisplayName = function(value) + WG["playertv"].SetAlwaysDisplayName = function(value) alwaysDisplayName = value end - widgetHandler:AddAction("playerview", playerviewCmd, nil, 't') - widgetHandler:AddAction("playercamera", playercameraCmd, nil, 't') - widgetHandler:AddAction("playertv", playertvCmd, nil, 't') + widgetHandler:AddAction("playerview", playerviewCmd, nil, "t") + widgetHandler:AddAction("playercamera", playercameraCmd, nil, "t") + widgetHandler:AddAction("playertv", playertvCmd, nil, "t") end function widget:MousePress(mx, my, mb) @@ -854,8 +850,8 @@ function widget:ViewResize() elementCorner = WG.FlowUI.elementCorner RectRound = WG.FlowUI.Draw.RectRound - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2, 2, 0.2, 3) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2, 2, 0.2, 3) for i = 1, #drawlistsCountdown do gl.DeleteList(drawlistsCountdown[i]) @@ -865,7 +861,7 @@ function widget:ViewResize() end drawlistsCountdown = {} drawlistsPlayername = {} - if WG['guishader'] and backgroundGuishader then + if WG["guishader"] and backgroundGuishader then if backgroundGuishader then backgroundGuishader = gl.DeleteList(backgroundGuishader) end @@ -885,7 +881,6 @@ function widget:ViewResize() createCountdownLists() end - function widget:Shutdown() for i = 1, #drawlistsCountdown do gl.DeleteList(drawlistsCountdown[i]) @@ -895,8 +890,8 @@ function widget:Shutdown() end drawlistsCountdown = {} drawlistsPlayername = {} - if WG['guishader'] then - WG['guishader'].DeleteDlist('playertv') + if WG["guishader"] then + WG["guishader"].DeleteDlist("playertv") end for i = 1, #drawlist do gl.DeleteList(drawlist[i]) @@ -919,7 +914,7 @@ function widget:GetConfigData(data) return { toggled = toggled, alwaysDisplayName = alwaysDisplayName, - playerChangeDelay = playerChangeDelay + playerChangeDelay = playerChangeDelay, } end diff --git a/luaui/Widgets/camera_remember_mode.lua b/luaui/Widgets/camera_remember_mode.lua index 368d399af0f..554782f8178 100644 --- a/luaui/Widgets/camera_remember_mode.lua +++ b/luaui/Widgets/camera_remember_mode.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Camera Remember", - desc = "Remembers the camera mode", - author = "Otto Von Lichtenstein", - date = "April 1st", + name = "Camera Remember", + desc = "Remembers the camera mode", + author = "Otto Von Lichtenstein", + date = "April 1st", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end diff --git a/luaui/Widgets/camera_shake.lua b/luaui/Widgets/camera_shake.lua index f924a5b7166..94783393f45 100644 --- a/luaui/Widgets/camera_shake.lua +++ b/luaui/Widgets/camera_shake.lua @@ -21,11 +21,10 @@ function widget:GetInfo() date = "Jun 15, 2007", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor @@ -40,7 +39,7 @@ local powerScale = 80 local decayFactor = 5 -local minArea = 32 -- weapon's area of effect +local minArea = 32 -- weapon's area of effect local minPower = 0.02 / powerScale local distAdj = 100 @@ -48,16 +47,15 @@ local distAdj = 100 -------------------------------------------------------------------------------- function widget:Initialize() - -- required for ShockFront() call-ins -- (threshold uses the 1/d*d power) spSetShockFrontFactors(minArea, minPower, distAdj) - WG['camerashake'] = {} - WG['camerashake'].getStrength = function() + WG["camerashake"] = {} + WG["camerashake"].getStrength = function() return powerScale end - WG['camerashake'].setStrength = function(value) + WG["camerashake"].setStrength = function(value) powerScale = mathFloor(value) if powerScale <= 0 then minPower = 0 @@ -94,11 +92,7 @@ function widget:Update(dt) local t = widgetHandler:GetHourTimer() local pShake = shake * 0.1 local tShake = shake * 0.025 - local px, py, pz, tx, ty, tz = birand(pShake), - birand(pShake), - birand(pShake), - birand(tShake), - birand(tShake) + local px, py, pz, tx, ty, tz = birand(pShake), birand(pShake), birand(pShake), birand(tShake), birand(tShake) local maxOffsetPx = powerScale / 40000 if px > maxOffsetPx then px = maxOffsetPx diff --git a/luaui/Widgets/camera_startup.lua b/luaui/Widgets/camera_startup.lua index b4b459e3e32..8c83277fcac 100644 --- a/luaui/Widgets/camera_startup.lua +++ b/luaui/Widgets/camera_startup.lua @@ -3,62 +3,62 @@ local STARTUP_CAMERA_INITIAL_ZOOM_DISTANCE = 5000 local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Camera Startup", - desc = "Organize the camera to point at the startbox at the start of the game", - author = "uBdead", - date = "June 2026", - license = "GNU LGPL, v2.1 or later", - layer = 1, -- hypothetical stuff in layer = 0 could be doing things to boxes - enabled = true - } + return { + name = "Camera Startup", + desc = "Organize the camera to point at the startbox at the start of the game", + author = "uBdead", + date = "June 2026", + license = "GNU LGPL, v2.1 or later", + layer = 1, -- hypothetical stuff in layer = 0 could be doing things to boxes + enabled = true, + } end function removeSelf() - widgetHandler:RemoveWidget() + widgetHandler:RemoveWidget() end function widget:Initialize() - if Spring.GetGameFrame() > 0 then - removeSelf() - return - end + if Spring.GetGameFrame() > 0 then + removeSelf() + return + end - local nameCameraState = Spring.GetCameraState(true) - if nameCameraState.name ~= "ta" and nameCameraState.name ~= "spring" then - removeSelf() - return - end + local nameCameraState = Spring.GetCameraState(true) + if nameCameraState.name ~= "ta" and nameCameraState.name ~= "spring" then + removeSelf() + return + end - -- Calculate the center of the startbox (or map for spectators) - local xMin, zMin, xMax, zMax + -- Calculate the center of the startbox (or map for spectators) + local xMin, zMin, xMax, zMax - local isSpectator = select(1, Spring.GetSpectatingState()) - if isSpectator then - xMin = 0 - zMin = 0 - xMax = Game.mapSizeX - zMax = Game.mapSizeZ - else - xMin, zMin, xMax, zMax= Spring.GetAllyTeamStartBox(Spring.GetMyAllyTeamID()) - end + local isSpectator = select(1, Spring.GetSpectatingState()) + if isSpectator then + xMin = 0 + zMin = 0 + xMax = Game.mapSizeX + zMax = Game.mapSizeZ + else + xMin, zMin, xMax, zMax = Spring.GetAllyTeamStartBox(Spring.GetMyAllyTeamID()) + end - if not xMin or not zMin or not xMax or not zMax then - return - end + if not xMin or not zMin or not xMax or not zMax then + return + end - local centerX = (xMin + xMax) / 2 - local centerZ = (zMin + zMax) / 2 + local centerX = (xMin + xMax) / 2 + local centerZ = (zMin + zMax) / 2 - Spring.SetCameraTarget(centerX, 0, centerZ, 0.0000001) + Spring.SetCameraTarget(centerX, 0, centerZ, 0.0000001) - -- Set a reasonable zoom level - -- We need to get the camera state again due to the earlier SetCameraTarget call changed it - local currentCameraState = Spring.GetCameraState(true) - currentCameraState.height = STARTUP_CAMERA_INITIAL_ZOOM_DISTANCE - currentCameraState.dist = STARTUP_CAMERA_INITIAL_ZOOM_DISTANCE + -- Set a reasonable zoom level + -- We need to get the camera state again due to the earlier SetCameraTarget call changed it + local currentCameraState = Spring.GetCameraState(true) + currentCameraState.height = STARTUP_CAMERA_INITIAL_ZOOM_DISTANCE + currentCameraState.dist = STARTUP_CAMERA_INITIAL_ZOOM_DISTANCE - Spring.SetCameraState(currentCameraState) + Spring.SetCameraState(currentCameraState) - removeSelf() + removeSelf() end diff --git a/luaui/Widgets/cmd_area_commands_filter.lua b/luaui/Widgets/cmd_area_commands_filter.lua index 76beac19d3c..1dd3a0029b4 100644 --- a/luaui/Widgets/cmd_area_commands_filter.lua +++ b/luaui/Widgets/cmd_area_commands_filter.lua @@ -14,11 +14,10 @@ function widget:GetInfo() date = "October 16, 2025", license = "GNU GPL, v2 or later", layer = -1, -- Has to be run before Smart Area Reclaim widget - enabled = true + enabled = true, } end - -- Localized functions for performance local tableInsert = table.insert local tableSort = table.sort @@ -129,7 +128,7 @@ local function distributeTargetsToTransports(transports, targets) allValidPassengers = {}, passengersByPriority = {}, maxPriority = -1, - transportHealth = transportDef.health + transportHealth = transportDef.health, } end local position = toPositionTable(spGetUnitPosition(transportUnitId)) @@ -234,14 +233,12 @@ local function distributeTargetsToTransports(transports, targets) local transportPos = transportInfo.position while transportInfo.capacity > 0 do - local bestPassengerId local passengerFound = false for priority = 1, transportTypeData.maxPriority do local passengers = passengersByPriority[priority] if passengers then - local closestPassengerId local closestDistSq @@ -276,7 +273,6 @@ local function distributeTargetsToTransports(transports, targets) if not passengerFound then break end - end end end diff --git a/luaui/Widgets/cmd_area_mex.lua b/luaui/Widgets/cmd_area_mex.lua index ccf12dd2796..17bd09b7258 100644 --- a/luaui/Widgets/cmd_area_mex.lua +++ b/luaui/Widgets/cmd_area_mex.lua @@ -9,7 +9,7 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", handler = true, layer = 1, - enabled = true + enabled = true, } end @@ -31,24 +31,22 @@ local metalSpots local metalMap = false - local function setAreaMexType(uDefID) selectedMex = -uDefID end function widget:Initialize() - metalSpots = WG['resource_spot_finder'].metalSpotsList - metalMap = WG['resource_spot_finder'].isMetalMap + metalSpots = WG["resource_spot_finder"].metalSpotsList + metalMap = WG["resource_spot_finder"].isMetalMap mexBuildings = WG["resource_spot_builder"].GetMexBuildings() mexConstructors = WG["resource_spot_builder"].GetMexConstructors() - WG['areamex'] = {} - WG['areamex'].setAreaMexType = function(uDefID) + WG["areamex"] = {} + WG["areamex"].setAreaMexType = function(uDefID) setAreaMexType(uDefID) end end - ---Gets the position of the last command in a unit's queue, or nil if the queue is empty ---@param unitID number ---@return number|nil x @@ -64,7 +62,6 @@ local function getLastQueuedPosition(unitID) return nil, nil end - ---Finds all builders among selected units that can make the specified building, and gets their average position. ---When useQueueEnd is true, uses the position of the last queued command instead of the unit's current position. ---@param units table selected units @@ -100,7 +97,9 @@ local function getAvgPositionOfValidBuilders(units, constructorIds, buildingId, end end - if builderCount == 0 then return end + if builderCount == 0 then + return + end return { x = tX / builderCount, z = tZ / builderCount } end @@ -122,7 +121,6 @@ local function getSpotsInArea(x, z, radius) return validSpots end - ---Make build commands for all passed in spots, but do not apply them ---@param spots table ---@return table An array of commands, in the same format as PreviewExtractorCommand @@ -133,7 +131,7 @@ local function getCmdsForValidSpots(spots, shift) local spotHasQueue = shift and WG["resource_spot_builder"].SpotHasExtractorQueued(spot) or false if not spotHasQueue then local pos = { spot.x, spot.y, spot.z } - local cmd = WG['resource_spot_builder'].PreviewExtractorCommand(pos, selectedMex, spot) + local cmd = WG["resource_spot_builder"].PreviewExtractorCommand(pos, selectedMex, spot) if cmd then cmds[#cmds + 1] = cmd end @@ -142,14 +140,15 @@ local function getCmdsForValidSpots(spots, shift) return cmds end - ---Nearest neighbor search. Spots are passed in to do minor weighting based on mex value ---@param cmds table ---@param spots table ---@param shift boolean Whether shift was held (appending to existing queue) local function calculateCmdOrder(cmds, spots, shift) local builderPos = getAvgPositionOfValidBuilders(selectedUnits, mexConstructors, selectedMex, shift) - if not builderPos then return {} end + if not builderPos then + return {} + end local orderedCommands = {} local pos = {} while #cmds > 0 do @@ -163,7 +162,6 @@ local function calculateCmdOrder(cmds, spots, shift) shortestIndex = i pos = { x = cmds[i][2], z = cmds[i][4] } end - end orderedCommands[#orderedCommands + 1] = cmds[shortestIndex] taremove(cmds, shortestIndex) @@ -199,7 +197,6 @@ local function mapCommandsToBuildingInfos(cmds) return buildings end - function widget:CommandNotify(id, params, options) if id ~= CMD_AREA_MEX then return @@ -207,12 +204,12 @@ function widget:CommandNotify(id, params, options) local cmdX, _, cmdZ, cmdRadius = params[1], params[2], params[3], params[4] local spots = getSpotsInArea(cmdX, cmdZ, cmdRadius) - if WG['skip_allied_upgrade'] then - spots = WG['skip_allied_upgrade'].filterOutAlliedSpots(spots, mexBuildings) + if WG["skip_allied_upgrade"] then + spots = WG["skip_allied_upgrade"].filterOutAlliedSpots(spots, mexBuildings) end if not selectedMex then - selectedMex = WG['resource_spot_builder'].GetBestExtractorFromBuilders(selectedUnits, mexConstructors, mexBuildings) + selectedMex = WG["resource_spot_builder"].GetBestExtractorFromBuilders(selectedUnits, mexConstructors, mexBuildings) end local alt, ctrl, meta, shift = Spring.GetModKeyState() @@ -224,32 +221,33 @@ function widget:CommandNotify(id, params, options) if options.shift and isBuildSplitActive and #sortedCmds > 0 then WG["build_split"].splitBuildings(getSelectedBuilderIDs(), mapCommandsToBuildingInfos(sortedCmds), { "shift" }) else - WG['resource_spot_builder'].ApplyPreviewCmds(sortedCmds, mexConstructors, shift) + WG["resource_spot_builder"].ApplyPreviewCmds(sortedCmds, mexConstructors, shift) end selectedMex = nil if not options.shift then - if WG["gridmenu"] then WG["gridmenu"].clearCategory() end + if WG["gridmenu"] then + WG["gridmenu"].clearCategory() + end end return true end - -- Adjust map view mode as needed function widget:Update(dt) local _, cmd, _ = spGetActiveCommand() if cmd == CMD_AREA_MEX then - if spGetMapDrawMode() ~= 'metal' then + if spGetMapDrawMode() ~= "metal" then if Spring.GetMapDrawMode() == "los" then retoggleLos = true end - spSendCommands('ShowMetalMap') + spSendCommands("ShowMetalMap") toggledMetal = true end else if toggledMetal then - spSendCommands('ShowStandard') + spSendCommands("ShowStandard") if retoggleLos then Spring.SendCommands("togglelos") retoggleLos = nil @@ -259,25 +257,23 @@ function widget:Update(dt) end end - function widget:SelectionChanged(sel) selectedUnits = sel end - function widget:CommandsChanged() if not metalMap then if selectedUnits and #selectedUnits > 0 then local customCommands = widgetHandler.customCommands for i = 1, #selectedUnits do - if WG['resource_spot_builder'] and WG['resource_spot_builder'].GetMexConstructors()[selectedUnits[i]] then + if WG["resource_spot_builder"] and WG["resource_spot_builder"].GetMexConstructors()[selectedUnits[i]] then customCommands[#customCommands + 1] = { id = CMD_AREA_MEX, type = CMDTYPE.ICON_AREA, - tooltip = 'Define an area (with metal spots in it) to make metal extractors in', - name = 'Mex', - cursor = 'areamex', - action = 'areamex', + tooltip = "Define an area (with metal spots in it) to make metal extractors in", + name = "Mex", + cursor = "areamex", + action = "areamex", } return end @@ -285,4 +281,3 @@ function widget:CommandsChanged() end end end - diff --git a/luaui/Widgets/cmd_area_unload.lua b/luaui/Widgets/cmd_area_unload.lua index 9c459961a4e..86406ba6183 100644 --- a/luaui/Widgets/cmd_area_unload.lua +++ b/luaui/Widgets/cmd_area_unload.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "April 2018", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathPi = math.pi @@ -23,9 +22,9 @@ local math_sqrt = math.sqrt local CMD_UNLOAD_UNITS = CMD.UNLOAD_UNITS local function CanUnitExecute(uID, cmdID) - if cmdID == CMD.UNLOAD_UNIT then -- should not happen since here we're working with area cmds but, better be safe then sorry i guess - cmdID = CMD_UNLOAD_UNITS - end + if cmdID == CMD.UNLOAD_UNIT then -- should not happen since here we're working with area cmds but, better be safe then sorry i guess + cmdID = CMD_UNLOAD_UNITS + end return (Spring.FindUnitCmdDesc(uID, cmdID) ~= nil) end diff --git a/luaui/Widgets/cmd_attack_no_ally.lua b/luaui/Widgets/cmd_attack_no_ally.lua index ba5b5da9865..a2dc37514ab 100644 --- a/luaui/Widgets/cmd_attack_no_ally.lua +++ b/luaui/Widgets/cmd_attack_no_ally.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Attack no Ally", - desc = "Redirects attack on allies to ground and fully exits attack mode on RMB press", - author = "Ceddral, Floris (modified by Zain M)", - date = "April 2018 (modified December 2025)", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Attack no Ally", + desc = "Redirects attack on allies to ground and fully exits attack mode on RMB press", + author = "Ceddral, Floris (modified by Zain M)", + date = "April 2018 (modified December 2025)", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -45,20 +45,19 @@ local function IssueGroundCommand(cmdID, cmdOptions) end function widget:Initialize() - WG['attacknoally'] = true + WG["attacknoally"] = true end function widget:Shutdown() - WG['attacknoally'] = nil + WG["attacknoally"] = nil end - -- Right mouse button +-- Right mouse button function widget:MousePress(x, y, button) - if button ~= 3 then return false end - if WG['attacknoally'] then + if WG["attacknoally"] then local _, activeCmdID = Spring.GetActiveCommand() if activeCmdID and hasRightClickAttack[activeCmdID] then rmbCancelPending = true @@ -76,7 +75,7 @@ function widget:MouseMove(x, y, dx, dy, button) return false end - local distSq = (x - rmbStartX)^2 + (y - rmbStartY)^2 + local distSq = (x - rmbStartX) ^ 2 + (y - rmbStartY) ^ 2 if distSq >= rmbDragThresholdSq then rmbDragged = true end diff --git a/luaui/Widgets/cmd_autoquit.lua b/luaui/Widgets/cmd_autoquit.lua index ebdd460219a..5348db40b51 100644 --- a/luaui/Widgets/cmd_autoquit.lua +++ b/luaui/Widgets/cmd_autoquit.lua @@ -1,4 +1,3 @@ - ---------------------------------------------------------------- -- global variables ---------------------------------------------------------------- @@ -6,7 +5,7 @@ local versionNumber = "v1.3" local delay = 12 local mousemovedDelay = 60 local endTime -local mx,my +local mx, my local mousemoved = false ---------------------------------------------------------------- @@ -25,53 +24,53 @@ local GetMouseState = Spring.GetMouseState local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Autoquit", - desc = versionNumber .. " Automatically quits "..delay.."s after the game ends. Move mouse to postpone. (every "..mousemovedDelay.." seconds) ", - author = "Evil4Zerggin & zwzsg", - date = "25 December 2008", - license = "GNU LGPL, v2.1 or later", - layer = 0, - enabled = true - } + return { + name = "Autoquit", + desc = versionNumber .. " Automatically quits " .. delay .. "s after the game ends. Move mouse to postpone. (every " .. mousemovedDelay .. " seconds) ", + author = "Evil4Zerggin & zwzsg", + date = "25 December 2008", + license = "GNU LGPL, v2.1 or later", + layer = 0, + enabled = true, + } end local chobbyLoaded = false -if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil then - chobbyLoaded = true +if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") ~= nil then + chobbyLoaded = true end function widget:Initialize() - endTime = false + endTime = false end function widget:GameOver() - endTime = GetTimer() - mx,my = GetMouseState() - Echo(" Automatically exiting in " .. delay .. " seconds. Move mouse to postpone the quit for "..mousemovedDelay.." seconds") + endTime = GetTimer() + mx, my = GetMouseState() + Echo(" Automatically exiting in " .. delay .. " seconds. Move mouse to postpone the quit for " .. mousemovedDelay .. " seconds") end function widget:Update(dt) - if endTime then - local nmx,nmy = GetMouseState() - if nmx~=mx or nmy~=my then - mousemoved = true - endTime = GetTimer() -- set new endtime, because I've had times that game was running for ages because i wasnt attending pc but somehow it detect a move - mx,my = GetMouseState() - elseif not mousemoved and DiffTimers(GetTimer(), endTime) > delay then - Echo(" Autoquit sending quit command.") - if chobbyLoaded then - Spring.Reload("") - else - SendCommands("quitforce") - end - elseif mousemoved and DiffTimers(GetTimer(), endTime) > mousemovedDelay then - Echo(" Autoquit sending quit command.") - if chobbyLoaded then - Spring.Reload("") - else - SendCommands("quitforce") - end - end - end + if endTime then + local nmx, nmy = GetMouseState() + if nmx ~= mx or nmy ~= my then + mousemoved = true + endTime = GetTimer() -- set new endtime, because I've had times that game was running for ages because i wasnt attending pc but somehow it detect a move + mx, my = GetMouseState() + elseif not mousemoved and DiffTimers(GetTimer(), endTime) > delay then + Echo(" Autoquit sending quit command.") + if chobbyLoaded then + Spring.Reload("") + else + SendCommands("quitforce") + end + elseif mousemoved and DiffTimers(GetTimer(), endTime) > mousemovedDelay then + Echo(" Autoquit sending quit command.") + if chobbyLoaded then + Spring.Reload("") + else + SendCommands("quitforce") + end + end + end end diff --git a/luaui/Widgets/cmd_bar_hotkeys.lua b/luaui/Widgets/cmd_bar_hotkeys.lua index 189d6eb9cc5..e26eac860bf 100644 --- a/luaui/Widgets/cmd_bar_hotkeys.lua +++ b/luaui/Widgets/cmd_bar_hotkeys.lua @@ -3,7 +3,7 @@ local widget = widget ---@type Widget function widget:GetInfo() return { name = "BAR Hotkeys", - desc = "Enables BAR Hotkeys" , + desc = "Enables BAR Hotkeys", author = "Beherith", date = "23 march 2012", license = "GNU GPL, v2 or later", @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -20,9 +19,8 @@ local currentLayout local currentKeybindingsFile local keyConfig = VFS.Include("luaui/configs/keyboard_layouts.lua") - local function reloadWidgetsBindings() - local reloadableWidgets = {'buildmenu', 'ordermenu', 'keybinds', 'cmd_blueprint'} + local reloadableWidgets = { "buildmenu", "ordermenu", "keybinds", "cmd_blueprint" } for _, w in pairs(reloadableWidgets) do if WG[w] and WG[w].reloadBindings then @@ -31,19 +29,17 @@ local function reloadWidgetsBindings() end end - -- if keybinds are missing, load default hotkeys local function fallbackToDefault(currentKeys) local default = keyConfig.keybindingLayoutFiles[1] - spEcho("BAR Hotkeys: Did not find keybindings file " .. currentKeys ..". Loading grid keys") + spEcho("BAR Hotkeys: Did not find keybindings file " .. currentKeys .. ". Loading grid keys") Spring.SendCommands("keyreload " .. default) return default end - local function reloadBindings() -- Second parameter here is just a fallback if this config is undefined - currentLayout = Spring.GetConfigString("KeyboardLayout", 'qwerty') + currentLayout = Spring.GetConfigString("KeyboardLayout", "qwerty") currentKeybindingsFile = Spring.GetConfigString("KeybindingFile", keyConfig.keybindingLayoutFiles[1]) @@ -61,12 +57,11 @@ local function reloadBindings() reloadWidgetsBindings() end - function widget:Initialize() reloadBindings() - WG['bar_hotkeys'] = {} - WG['bar_hotkeys'].reloadBindings = reloadBindings + WG["bar_hotkeys"] = {} + WG["bar_hotkeys"].reloadBindings = reloadBindings end function widget:Shutdown() diff --git a/luaui/Widgets/cmd_bomber_attack_building_ground.lua b/luaui/Widgets/cmd_bomber_attack_building_ground.lua index fd9a6bde5df..ae373e44856 100644 --- a/luaui/Widgets/cmd_bomber_attack_building_ground.lua +++ b/luaui/Widgets/cmd_bomber_attack_building_ground.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Bomber Attack Building Ground", - desc = "Bombers attack ground under buildings instead of snapping on the unit itself (which disappears when out of los)", - author = "Floris", - date = "May 2021", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Bomber Attack Building Ground", + desc = "Bombers attack ground under buildings instead of snapping on the unit itself (which disappears when out of los)", + author = "Floris", + date = "May 2021", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local losGraceRadius = 75 @@ -35,34 +35,34 @@ for udid, ud in pairs(UnitDefs) do if ud.isBuilding or string.find(ud.name, "nanotc") then isBuilding[udid] = true end - if (ud["weapons"] and ud["weapons"][1] and isBomb[ud["weapons"][1].weaponDef] == true) or (string.find(ud.name, 'armlance') or string.find(ud.name, 'cortitan') or string.find(ud.name, 'legatorpbomber')) then + if (ud["weapons"] and ud["weapons"][1] and isBomb[ud["weapons"][1].weaponDef] == true) or (string.find(ud.name, "armlance") or string.find(ud.name, "cortitan") or string.find(ud.name, "legatorpbomber")) then isBomber[udid] = true end end isBomb = nil - function widget:GameFrame(gf) if gf % 7 == 1 then for unitID, params in pairs(monitorTargets) do if not spValidUnitID(unitID) then - if spIsPosInLos(params[1]-losGraceRadius,params[2],params[3]+losGraceRadius) and -- check wider area because unit can be marked invalid while just becoming in los - spIsPosInLos(params[1]-losGraceRadius,params[2],params[3]-losGraceRadius) and - spIsPosInLos(params[1]+losGraceRadius,params[2],params[3]-losGraceRadius) and - spIsPosInLos(params[1]+losGraceRadius,params[2],params[3]+losGraceRadius) + if + spIsPosInLos(params[1] - losGraceRadius, params[2], params[3] + losGraceRadius) -- check wider area because unit can be marked invalid while just becoming in los + and spIsPosInLos(params[1] - losGraceRadius, params[2], params[3] - losGraceRadius) + and spIsPosInLos(params[1] + losGraceRadius, params[2], params[3] - losGraceRadius) + and spIsPosInLos(params[1] + losGraceRadius, params[2], params[3] + losGraceRadius) then for bomberID, _ in pairs(params[4]) do if spValidUnitID(bomberID) then - local cmds = spGetUnitCommands(bomberID,100) + local cmds = spGetUnitCommands(bomberID, 100) -- remove commands spGiveOrderToUnit(bomberID, CMD_STOP, {}, 0) -- reinsert commands - for i=1, #cmds do + for i = 1, #cmds do local cmd = cmds[i] if cmd.id ~= CMD_ATTACK or (cmd.params[1] ~= params[1] and cmd.params[1] ~= params[1] and cmd.params[1] ~= params[1]) then - spGiveOrderToUnit(bomberID, cmd.id, cmd.params, {"shift"} ) + spGiveOrderToUnit(bomberID, cmd.id, cmd.params, { "shift" }) end end end @@ -72,7 +72,7 @@ function widget:GameFrame(gf) end end if not next(monitorTargets) then - widgetHandler:RemoveCallIn('GameFrame') + widgetHandler:RemoveCallIn("GameFrame") end end end @@ -95,16 +95,16 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOptions) local units = Spring.GetSelectedUnits() local hasBomber = false - for i=1, #units do + for i = 1, #units do local unitID = units[i] if isBomber[spGetUnitDefID(unitID)] then - spGiveOrder(cmdID, { targetBuildingPosX, targetBuildingPosY, targetBuildingPosZ}, cmdOptions) + spGiveOrder(cmdID, { targetBuildingPosX, targetBuildingPosY, targetBuildingPosZ }, cmdOptions) if not monitorTargets[targetBuildingID] then monitorTargets[targetBuildingID] = { targetBuildingPosX, targetBuildingPosY, targetBuildingPosZ, {} } end monitorTargets[targetBuildingID][4][unitID] = true if not hasBomber then - widgetHandler:UpdateCallIn('GameFrame') + widgetHandler:UpdateCallIn("GameFrame") end hasBomber = true end diff --git a/luaui/Widgets/cmd_buildsplit.lua b/luaui/Widgets/cmd_buildsplit.lua index 096fc1080ba..624372d81cb 100644 --- a/luaui/Widgets/cmd_buildsplit.lua +++ b/luaui/Widgets/cmd_buildsplit.lua @@ -13,7 +13,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState @@ -88,8 +87,10 @@ function widget:Initialize() widgetHandler:AddAction("buildsplit", handleSetModifier, { true }, "p") widgetHandler:AddAction("buildsplit", handleSetModifier, { false }, "r") - WG['build_split'] = { - isActive = function() return activeModifier end, + WG["build_split"] = { + isActive = function() + return activeModifier + end, splitBuildings = splitBuildings, } end @@ -157,5 +158,5 @@ function widget:Update() end function widget:Shutdown() - WG['build_split'] = nil + WG["build_split"] = nil end diff --git a/luaui/Widgets/cmd_commandinsert.lua b/luaui/Widgets/cmd_commandinsert.lua index 1261f520a62..e9de3bc34f8 100644 --- a/luaui/Widgets/cmd_commandinsert.lua +++ b/luaui/Widgets/cmd_commandinsert.lua @@ -4,18 +4,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "CommandInsert", - desc = "When pressing spacebar and shift, you can insert commands to arbitrary places in queue. When pressing spacebar alone, commands are inserted on front of queue. Based on FrontInsert by jK", - author = "dizekat", - date = "Jan,2008", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true - } + return { + name = "CommandInsert", + desc = "When pressing spacebar and shift, you can insert commands to arbitrary places in queue. When pressing spacebar alone, commands are inserted on front of queue. Based on FrontInsert by jK", + author = "dizekat", + date = "Jan,2008", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true, + } end - -- Localized functions for performance local tableInsert = table.insert @@ -36,39 +35,47 @@ local modifiers = { local prependPos = 0 function widget:GameStart() - widget:PlayerChanged() + widget:PlayerChanged() end function widget:PlayerChanged() - if Spring.GetSpectatingState() and spGetGameFrame() > 0 then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and spGetGameFrame() > 0 then + widgetHandler:RemoveWidget() + end end local function pressHandler(_, _, args) - if not args then return end + if not args then + return + end - if modifiers[args[1]] == nil then return end + if modifiers[args[1]] == nil then + return + end modifiers[args[1]] = true - if args[1] == 'prepend_queue' then + if args[1] == "prepend_queue" then prependPos = 0 end end local function releaseHandler(_, _, args) - if not args then return end + if not args then + return + end - if modifiers[args[1]] == nil then return end + if modifiers[args[1]] == nil then + return + end modifiers[args[1]] = false end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - widget:PlayerChanged() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + widget:PlayerChanged() + end widgetHandler:AddAction("commandinsert", pressHandler, nil, "p") widgetHandler:AddAction("commandinsert", releaseHandler, nil, "r") @@ -121,90 +128,94 @@ local function GetUnitOrFeaturePosition(id) end end -local function GetCommandPos(command) --- get the command position - if command.id < 0 or command.id == CMD.MOVE or command.id == CMD.REPAIR or command.id == CMD.RECLAIM or - command.id == CMD.RESURRECT or command.id == CMD.DGUN or command.id == CMD.GUARD or - command.id == CMD.FIGHT or command.id == CMD.ATTACK then - if table.getn(command.params) >= 3 then - return command.params[1], command.params[2], command.params[3] - elseif table.getn(command.params) >= 1 then - return GetUnitOrFeaturePosition(command.params[1]) - end - end - return -10,-10,-10 +local function GetCommandPos(command) --- get the command position + if command.id < 0 or command.id == CMD.MOVE or command.id == CMD.REPAIR or command.id == CMD.RECLAIM or command.id == CMD.RESURRECT or command.id == CMD.DGUN or command.id == CMD.GUARD or command.id == CMD.FIGHT or command.id == CMD.ATTACK then + if table.getn(command.params) >= 3 then + return command.params[1], command.params[2], command.params[3] + elseif table.getn(command.params) >= 1 then + return GetUnitOrFeaturePosition(command.params[1]) + end + end + return -10, -10, -10 end function widget:CommandNotify(id, params, options) - if not (modifiers.prepend_between or modifiers.prepend_queue) then - return false - end + if not (modifiers.prepend_between or modifiers.prepend_queue) then + return false + end + + local opt = 0 + if options.alt then + opt = opt + CMD.OPT_ALT + end + if options.ctrl then + opt = opt + CMD.OPT_CTRL + end + if options.right then + opt = opt + CMD.OPT_RIGHT + end + -- options.meta not forwarded since we're doing insert with it + -- and don't want to alias with engine at the same time. + if options.shift then + opt = opt + CMD.OPT_SHIFT - local opt = 0 - if options.alt then opt = opt + CMD.OPT_ALT end - if options.ctrl then opt = opt + CMD.OPT_CTRL end - if options.right then opt = opt + CMD.OPT_RIGHT end - -- options.meta not forwarded since we're doing insert with it - -- and don't want to alias with engine at the same time. - if options.shift then - opt = opt + CMD.OPT_SHIFT + if modifiers.prepend_queue then + Spring.GiveOrder(CMD.INSERT, { prependPos, id, opt, unpack(params) }, { "alt" }) - if modifiers.prepend_queue then - Spring.GiveOrder(CMD.INSERT, { prependPos, id, opt, unpack(params) }, { "alt" }) + prependPos = prependPos + 1 - prependPos = prependPos + 1 + return true + end + else + Spring.GiveOrder(CMD.INSERT, { 0, id, opt, unpack(params) }, { "alt" }) return true end - else - Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"}) - return true - end - - -- Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"}) - local my_command = {["id"]=id, ["params"]=params, ["options"]=options} - local cx,cy,cz = GetCommandPos(my_command) - if cx < -1 then - return false - end + -- Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"}) + local my_command = { ["id"] = id, ["params"] = params, ["options"] = options } + local cx, cy, cz = GetCommandPos(my_command) + if cx < -1 then + return false + end - local units = Spring.GetSelectedUnits() - for i=1,#units do - local unit_id = units[i] - local commands = Spring.GetUnitCommands(unit_id,100) - local px,py,pz = spGetUnitPosition(unit_id) - local min_dlen = 1000000 - local insert_pos = 0 - for j=1,#commands do - local command = commands[j] - --spEcho("cmd:"..table.tostring(command)) - local px2,py2,pz2 = GetCommandPos(command) - if px2 and px2>-1 then - local dlen = math_sqrt(((px2-cx)*(px2-cx)) + ((py2-cy)*(py2-cy)) + ((pz2-cz)*(pz2-cz))) + math_sqrt(((px-cx)*(px-cx)) + ((py-cy)*(py-cy)) + ((pz-cz)*(pz-cz))) - math_sqrt((((px2-px)*(px2-px)) + ((py2-py)*(py2-py)) + ((pz2-pz)*(pz2-pz)))) - --spEcho("dlen "..dlen) - if dlen < min_dlen then - min_dlen = dlen - insert_pos = j - end - px,py,pz = px2,py2,pz2 - end - end - -- check for insert at end of queue if its shortest walk. - local dlen = math_sqrt(((px-cx)*(px-cx)) + ((py-cy)*(py-cy)) + ((pz-cz)*(py-cy))) - if dlen < min_dlen then - --options.meta=nil - --options.shift=true - --spGiveOrderToUnit(unit_id,id,params,options) - spGiveOrderToUnit(unit_id, id, params, {"shift"}) - else - spGiveOrderToUnit(unit_id, CMD.INSERT, {insert_pos-1, id, opt, unpack(params)}, {"alt"}) - end - end + local units = Spring.GetSelectedUnits() + for i = 1, #units do + local unit_id = units[i] + local commands = Spring.GetUnitCommands(unit_id, 100) + local px, py, pz = spGetUnitPosition(unit_id) + local min_dlen = 1000000 + local insert_pos = 0 + for j = 1, #commands do + local command = commands[j] + --spEcho("cmd:"..table.tostring(command)) + local px2, py2, pz2 = GetCommandPos(command) + if px2 and px2 > -1 then + local dlen = math_sqrt(((px2 - cx) * (px2 - cx)) + ((py2 - cy) * (py2 - cy)) + ((pz2 - cz) * (pz2 - cz))) + math_sqrt(((px - cx) * (px - cx)) + ((py - cy) * (py - cy)) + ((pz - cz) * (pz - cz))) - math_sqrt((((px2 - px) * (px2 - px)) + ((py2 - py) * (py2 - py)) + ((pz2 - pz) * (pz2 - pz)))) + --spEcho("dlen "..dlen) + if dlen < min_dlen then + min_dlen = dlen + insert_pos = j + end + px, py, pz = px2, py2, pz2 + end + end + -- check for insert at end of queue if its shortest walk. + local dlen = math_sqrt(((px - cx) * (px - cx)) + ((py - cy) * (py - cy)) + ((pz - cz) * (py - cy))) + if dlen < min_dlen then + --options.meta=nil + --options.shift=true + --spGiveOrderToUnit(unit_id,id,params,options) + spGiveOrderToUnit(unit_id, id, params, { "shift" }) + else + spGiveOrderToUnit(unit_id, CMD.INSERT, { insert_pos - 1, id, opt, unpack(params) }, { "alt" }) + end + end - -- When we are editing the build order we want to keep same active command after unset by engine - if id < 0 then - Spring.SetActiveCommand(Spring.GetCmdDescIndex(id), 1, true, false, options.alt, options.ctrl, false, false) - end + -- When we are editing the build order we want to keep same active command after unset by engine + if id < 0 then + Spring.SetActiveCommand(Spring.GetCmdDescIndex(id), 1, true, false, options.alt, options.ctrl, false, false) + end - return true + return true end diff --git a/luaui/Widgets/cmd_commandq_manager.lua b/luaui/Widgets/cmd_commandq_manager.lua index ebeaeaf2bc0..dad189c02e1 100644 --- a/luaui/Widgets/cmd_commandq_manager.lua +++ b/luaui/Widgets/cmd_commandq_manager.lua @@ -79,7 +79,7 @@ function RemoveCommand(unitID, cmdIndex, commandQueueSize) spGiveOrderToUnit(unitID, CMD.REMOVE, { cmdTag, cmdTag2 }, 0) commandDeleted = true end - elseif cmdID == CMD.FIGHT and cmdIndex == 1 then --removes patrol commands too + elseif cmdID == CMD.FIGHT and cmdIndex == 1 then --removes patrol commands too local commands = spGetUnitCommands(unitID, -1) if commands and commands[2] and commands[2].id == CMDPATROL then commandQueueSize = commandQueueSize - 2 @@ -90,7 +90,7 @@ function RemoveCommand(unitID, cmdIndex, commandQueueSize) spGiveOrderToUnit(unitID, CMD.MOVE, commands[i].params, {}) end if i ~= cmdIndex then - spGiveOrderToUnit(unitID, commands[i].id, commands[i].params, {"shift"}) + spGiveOrderToUnit(unitID, commands[i].id, commands[i].params, { "shift" }) end end commandDeleted = true diff --git a/luaui/Widgets/cmd_comselect.lua b/luaui/Widgets/cmd_comselect.lua index 8e39d3fd792..2c595ce0b72 100644 --- a/luaui/Widgets/cmd_comselect.lua +++ b/luaui/Widgets/cmd_comselect.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local tableInsert = table.insert diff --git a/luaui/Widgets/cmd_context_build.lua b/luaui/Widgets/cmd_context_build.lua index 0ecf10c25b4..a34358d608f 100644 --- a/luaui/Widgets/cmd_context_build.lua +++ b/luaui/Widgets/cmd_context_build.lua @@ -1,9 +1,8 @@ - local voidWater = false local waterLevel = Spring.GetModOptions().map_waterlevel local waterIsLava = Spring.Lava.isLavaMap local minHeight, _, _, _ = Spring.GetGroundExtremes() -local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs +local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs if success and mapinfo then voidWater = mapinfo.voidwater end @@ -13,16 +12,15 @@ local widget = widget ---@type Widget function widget:GetInfo() return { name = "Context Build", - desc = "Toggles buildings between water/ground equivalent buildings automagically" , + desc = "Toggles buildings between water/ground equivalent buildings automagically", author = "Rebuilt by Hobo Joe, original by dizekat and BrainDamage", date = "Dec 2023", license = "GNU LGPL, v2.1 or later", layer = 1, - enabled = true + enabled = true, } end - -- Localized functions for performance local tableInsert = table.insert @@ -33,77 +31,75 @@ local isPregame = spGetGameFrame() == 0 and not isSpec local uDefNames = UnitDefNames -local GetActiveCommand = Spring.GetActiveCommand -local SetActiveCommand = Spring.SetActiveCommand -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local currentTime = os.clock +local GetActiveCommand = Spring.GetActiveCommand +local SetActiveCommand = Spring.SetActiveCommand +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local currentTime = os.clock --- Human friendly list. Automatically converted to unitdef IDs on init -- this should only ever swap between pairs of (buildable) units local unitlist = { - {'armmakr','armfmkr'}, - {'cormakr','corfmkr'}, - {'armdrag','armfdrag'}, - {'cordrag','corfdrag'}, - {'armmstor', 'armuwms'}, - {'armestor', 'armuwes'}, - {'cormstor', 'coruwms'}, - {'corestor', 'coruwes'}, - {'armrl','armfrt'}, - {'corrl','corfrt'}, - {'armhp','armfhp'}, - {'corhp','corfhp'}, - {'armrad','armfrad'}, - {'corrad','corfrad'}, - {'armhlt','armfhlt'}, - {'corhlt','corfhlt'}, - {'armtarg','armfatf'}, - {'cortarg','corfatf'}, - {'armmmkr','armuwmmm'}, - {'cormmkr','coruwmmm'}, - {'armfus','armuwfus'}, - {'corfus','coruwfus'}, - {'armflak','armfflak'}, - {'corflak','corenaa'}, - {'armmoho','armuwmme'}, - {'cormoho','coruwmme'}, - {'armsolar','armtide'}, - {'corsolar','cortide'}, - {'armlab','armsy'}, - {'corlab','corsy'}, - {'armllt','armtl'}, - {'corllt','cortl'}, - {'armnanotc','armnanotcplat'}, - {'cornanotc','cornanotcplat'}, - {'armvp','armamsub'}, - {'corvp','coramsub'}, - {'armap','armplat'}, - {'corap','corplat'}, - {'armgeo','armuwgeo'}, - {'armageo','armuwageo'}, - {'corgeo','coruwgeo'}, - {'corageo','coruwageo'}, + { "armmakr", "armfmkr" }, + { "cormakr", "corfmkr" }, + { "armdrag", "armfdrag" }, + { "cordrag", "corfdrag" }, + { "armmstor", "armuwms" }, + { "armestor", "armuwes" }, + { "cormstor", "coruwms" }, + { "corestor", "coruwes" }, + { "armrl", "armfrt" }, + { "corrl", "corfrt" }, + { "armhp", "armfhp" }, + { "corhp", "corfhp" }, + { "armrad", "armfrad" }, + { "corrad", "corfrad" }, + { "armhlt", "armfhlt" }, + { "corhlt", "corfhlt" }, + { "armtarg", "armfatf" }, + { "cortarg", "corfatf" }, + { "armmmkr", "armuwmmm" }, + { "cormmkr", "coruwmmm" }, + { "armfus", "armuwfus" }, + { "corfus", "coruwfus" }, + { "armflak", "armfflak" }, + { "corflak", "corenaa" }, + { "armmoho", "armuwmme" }, + { "cormoho", "coruwmme" }, + { "armsolar", "armtide" }, + { "corsolar", "cortide" }, + { "armlab", "armsy" }, + { "corlab", "corsy" }, + { "armllt", "armtl" }, + { "corllt", "cortl" }, + { "armnanotc", "armnanotcplat" }, + { "cornanotc", "cornanotcplat" }, + { "armvp", "armamsub" }, + { "corvp", "coramsub" }, + { "armap", "armplat" }, + { "corap", "corplat" }, + { "armgeo", "armuwgeo" }, + { "armageo", "armuwageo" }, + { "corgeo", "coruwgeo" }, + { "corageo", "coruwageo" }, } - - local legionUnitlist = { - {'legeconv','legfeconv'}, - {'legdrag','legfdrag'}, - {'legmstor', 'leguwmstore'}, - {'legestor', 'leguwestore'}, - {'legrl','legfrl'}, - {'leghp','legfhp'}, - {'legrad','legfrad'}, + { "legeconv", "legfeconv" }, + { "legdrag", "legfdrag" }, + { "legmstor", "leguwmstore" }, + { "legestor", "leguwestore" }, + { "legrl", "legfrl" }, + { "leghp", "legfhp" }, + { "legrad", "legfrad" }, --{'legmg','legfmg'}, - {'legsolar','legtide'}, - {'leglab','legsy'}, - {'leglht','legtl'}, - {'leghive', 'legfhive'}, - {'legnanotc','legnanotcplat'}, - {'legvp','legamsub'}, - {'leggeo','leguwgeo'}, + { "legsolar", "legtide" }, + { "leglab", "legsy" }, + { "leglht", "legtl" }, + { "leghive", "legfhive" }, + { "legnanotc", "legnanotcplat" }, + { "legvp", "legamsub" }, + { "leggeo", "leguwgeo" }, --{'cortarg','corfatf'}, --asym pairs cannot overlap with core placeholders --{'cormmkr','coruwmmm'}, --{'corfus','coruwfus'}, @@ -126,7 +122,6 @@ local updateRate = 0.1 local lastUpdateTime = 0 local gameStarted - local function maybeRemoveSelf() if waterIsLava or voidWater or waterLevel < minHeight then widgetHandler:RemoveWidget() @@ -134,12 +129,12 @@ local function maybeRemoveSelf() end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end local function setPreGamestartDefID(uDefID) @@ -166,8 +161,8 @@ end -- returns the unitDefID of the selected building, or false if there is no selected building local function isBuilding() local _, cmdID - if isPregame and WG['pregame-build'] and WG['pregame-build'].getPreGameDefID then - cmdID = WG['pregame-build'].getPreGameDefID() + if isPregame and WG["pregame-build"] and WG["pregame-build"].getPreGameDefID then + cmdID = WG["pregame-build"].getPreGameDefID() cmdID = cmdID and -cmdID or 0 --invert to get the correct negative value else _, cmdID = GetActiveCommand() @@ -180,7 +175,6 @@ local function isBuilding() end end - local function getCursorWorldPosition() local mx, my = spGetMouseState() local _, pos = spTraceScreenRay(mx, my, true, false) @@ -193,7 +187,6 @@ function widget:MousePress(mx, my, button) end end - -- Return the first index with the given value (or nil if not found). local function indexOf(array, value) for i, v in ipairs(array) do @@ -206,7 +199,6 @@ end -- DrawWorld because update doesn't run pregame function widget:DrawWorld() - -- update only x times per second if lastUpdateTime > currentTime() + updateRate then return @@ -261,7 +253,7 @@ function widget:DrawWorld() setPreGamestartDefID(alt) end else - SetActiveCommand('buildunit_'..name) + SetActiveCommand("buildunit_" .. name) end end else @@ -272,7 +264,7 @@ function widget:DrawWorld() setPreGamestartDefID(alt) end else - SetActiveCommand('buildunit_'..unitName[alt]) + SetActiveCommand("buildunit_" .. unitName[alt]) end end end @@ -292,7 +284,7 @@ local function addUnitDefPair(firstUnitName, lastUnitName) return end - for i, unitDef in ipairs({firstUnitDef, lastUnitDef}) do + for i, unitDef in ipairs({ firstUnitDef, lastUnitDef }) do local unitDefID = unitDef.id local isWater = i % 2 == 0 @@ -311,13 +303,12 @@ function widget:Initialize() end if Spring.GetModOptions().experimentallegionfaction then - for _,v in ipairs(legionUnitlist) do + for _, v in ipairs(legionUnitlist) do tableInsert(unitlist, v) end end - - for _,unitNames in ipairs(unitlist) do + for _, unitNames in ipairs(unitlist) do addUnitDefPair(unitNames[1], unitNames[2]) end end diff --git a/luaui/Widgets/cmd_customformations2.lua b/luaui/Widgets/cmd_customformations2.lua index f5ec7e5e4c5..efe563bbd96 100644 --- a/luaui/Widgets/cmd_customformations2.lua +++ b/luaui/Widgets/cmd_customformations2.lua @@ -1,21 +1,19 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "CustomFormations2", - desc = "Allows you to draw your own formation line.", - author = "Errrrrrr, Niobium", -- based on 'Custom Formations' by jK and gunblob - version = "v4.4", - date = "June, 2023", - license = "GNU GPL, v2 or later", - layer = 10000, - enabled = true, - handler = true, - } + return { + name = "CustomFormations2", + desc = "Allows you to draw your own formation line.", + author = "Errrrrrr, Niobium", -- based on 'Custom Formations' by jK and gunblob + version = "v4.4", + date = "June, 2023", + license = "GNU GPL, v2 or later", + layer = 10000, + enabled = true, + handler = true, + } end - -- Localized Spring API for performance local spGetSelectedUnits = Spring.GetSelectedUnits local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount @@ -31,8 +29,7 @@ local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount local getCurrentMiniMapRotationOption = VFS.Include("luaui/Include/minimap_utils.lua").getCurrentMiniMapRotationOption local ROTATION = VFS.Include("luaui/Include/minimap_utils.lua").ROTATION -local dotImage = "LuaUI/Images/formationDot.dds" - +local dotImage = "LuaUI/Images/formationDot.dds" -------------------------------------------------------------------------------- -- User Configurable Constants @@ -51,9 +48,9 @@ local minFormationLength = 20 local maxHngTime = 0.01 -- Desired maximum time for hungarian algorithm local maxNoXTime = 0.01 -- Strict maximum time for backup algorithm -local defaultHungarianUnits = 20 -- Need a baseline to start from when no config data saved -local minHungarianUnits = 10 -- If we kept reducing maxUnits it can get to a point where it can never increase, so we enforce minimums on the algorithms. -local unitIncreaseThresh = 0.85 -- We only increase maxUnits if the units are great enough for time to be meaningful +local defaultHungarianUnits = 20 -- Need a baseline to start from when no config data saved +local minHungarianUnits = 10 -- If we kept reducing maxUnits it can get to a point where it can never increase, so we enforce minimums on the algorithms. +local unitIncreaseThresh = 0.85 -- We only increase maxUnits if the units are great enough for time to be meaningful -- Alpha loss per second after releasing mouse local lineFadeRate = 2.0 @@ -63,12 +60,12 @@ local CMD_SETTARGET = GameCMD.UNIT_SET_TARGET local CMD_MANUAL_LAUNCH = GameCMD.MANUAL_LAUNCH local formationCmds = { - [CMD.MOVE] = true, - [CMD.FIGHT] = true, - [CMD.ATTACK] = true, - [CMD.PATROL] = true, - [CMD.UNLOAD_UNIT] = true, - [CMD_SETTARGET] = true, + [CMD.MOVE] = true, + [CMD.FIGHT] = true, + [CMD.ATTACK] = true, + [CMD.PATROL] = true, + [CMD.UNLOAD_UNIT] = true, + [CMD_SETTARGET] = true, [CMD_MANUAL_LAUNCH] = true, } @@ -76,22 +73,34 @@ local formationCmds = { -- If the mouse remains on the same target for both Press/Release then the formation is ignored and original command is issued. -- Normal logic will follow after override, i.e. must be a formationCmd to get formation, alt must be held if requiresAlt, etc. local overrideCmds = { - [CMD.GUARD] = CMD.MOVE, - [CMD.ATTACK] = CMD.MOVE, - [CMD_SETTARGET] = CMD.MOVE + [CMD.GUARD] = CMD.MOVE, + [CMD.ATTACK] = CMD.MOVE, + [CMD_SETTARGET] = CMD.MOVE, } -- What commands can be issued at a position or unit/feature ID (Only used by GetUnitPosition) local positionCmds = { - [CMD.MOVE]=true, [CMD.ATTACK]=true, [CMD.RECLAIM]=true, [CMD.RESTORE]=true, [CMD.RESURRECT]=true, - [CMD.PATROL]=true, [CMD.CAPTURE]=true, [CMD.FIGHT]=true, [CMD.MANUALFIRE]=true, - [CMD.UNLOAD_UNIT]=true, [CMD.UNLOAD_UNITS]=true, [CMD.LOAD_UNITS]=true, [CMD.GUARD]=true, [CMD.AREA_ATTACK] = true, - [CMD_SETTARGET]=true, [CMD_MANUAL_LAUNCH]=true, + [CMD.MOVE] = true, + [CMD.ATTACK] = true, + [CMD.RECLAIM] = true, + [CMD.RESTORE] = true, + [CMD.RESURRECT] = true, + [CMD.PATROL] = true, + [CMD.CAPTURE] = true, + [CMD.FIGHT] = true, + [CMD.MANUALFIRE] = true, + [CMD.UNLOAD_UNIT] = true, + [CMD.UNLOAD_UNITS] = true, + [CMD.LOAD_UNITS] = true, + [CMD.GUARD] = true, + [CMD.AREA_ATTACK] = true, + [CMD_SETTARGET] = true, + [CMD_MANUAL_LAUNCH] = true, } -- What commands need more than one unit selected to be issued as a formation command local multiUnitOnlyCmds = { - [CMD_MANUAL_LAUNCH]=true + [CMD_MANUAL_LAUNCH] = true, } local chobbyInterface @@ -186,37 +195,33 @@ local selectedUnitsCount = spGetSelectedUnitsCount() -- Helper Functions -------------------------------------------------------------------------------- local function GetModKeys() - local alt, ctrl, meta, shift = spGetModKeyState() + local alt, ctrl, meta, shift = spGetModKeyState() - if spGetInvertQueueKey() then -- Shift inversion - shift = not shift - end + if spGetInvertQueueKey() then -- Shift inversion + shift = not shift + end - -- Check if PiP widget wants to force shift for right-click drags - if WG.pipForceShift then - shift = true - end + -- Check if PiP widget wants to force shift for right-click drags + if WG.pipForceShift then + shift = true + end - return alt, ctrl, meta, shift + return alt, ctrl, meta, shift end - local function GetUnitFinalPosition(uID) - local ux, uy, uz = spGetUnitPosition(uID) - local cmds = spGetUnitCommands(uID,5000) + local ux, uy, uz = spGetUnitPosition(uID) + local cmds = spGetUnitCommands(uID, 5000) if cmds then for i = #cmds, 1, -1 do - local cmd = cmds[i] if (cmd.id < 0) or positionCmds[cmd.id] then - local params = cmd.params if #params >= 3 then return params[1], params[2], params[3] else if #params == 1 then - local pID = params[1] local px, py, pz @@ -235,497 +240,501 @@ local function GetUnitFinalPosition(uID) end end - return ux, uy, uz + return ux, uy, uz end - local function SetColor(cmdID, alpha) - if cmdID == CMD_MOVE then glColor(0.5, 1.0, 0.5, alpha) -- Green - elseif cmdID == CMD_ATTACK - or cmdID == CMD_MANUAL_LAUNCH then glColor(1.0, 0.2, 0.2, alpha) -- Red - elseif cmdID == CMD_UNLOADUNIT then glColor(1.0, 1.0, 0.0, alpha) -- Yellow - elseif cmdID == CMD_SETTARGET then glColor(1.0, 0.7, 0.0, alpha) -- Orange - else glColor(0.5, 0.5, 1.0, alpha) -- Blue - end + if cmdID == CMD_MOVE then + glColor(0.5, 1.0, 0.5, alpha) -- Green + elseif cmdID == CMD_ATTACK or cmdID == CMD_MANUAL_LAUNCH then + glColor(1.0, 0.2, 0.2, alpha) -- Red + elseif cmdID == CMD_UNLOADUNIT then + glColor(1.0, 1.0, 0.0, alpha) -- Yellow + elseif cmdID == CMD_SETTARGET then + glColor(1.0, 0.7, 0.0, alpha) -- Orange + else + glColor(0.5, 0.5, 1.0, alpha) -- Blue + end end - local function CanUnitExecute(uID, cmdID) - if cmdID == CMD_UNLOADUNIT then - cmdID = CMD_UNLOADUNITS - end - return (spFindUnitCmdDesc(uID, cmdID) ~= nil) + if cmdID == CMD_UNLOADUNIT then + cmdID = CMD_UNLOADUNITS + end + return (spFindUnitCmdDesc(uID, cmdID) ~= nil) end - local function GetExecutingUnits(cmdID) - local units = {} - for i = 1, selectedUnitsCount do - local uID = selectedUnits[i] - if CanUnitExecute(uID, cmdID) then - units[#units + 1] = uID - end - end - return units + local units = {} + for i = 1, selectedUnitsCount do + local uID = selectedUnits[i] + if CanUnitExecute(uID, cmdID) then + units[#units + 1] = uID + end + end + return units end - local function AddFNode(pos) - local px, pz = pos[1], pos[3] - if px < 0 or pz < 0 or px > mapSizeX or pz > mapSizeZ then - return false - end - - local n = #fNodes - if n == 0 then - fNodes[1] = pos - fDists[1] = 0 - else - local prevNode = fNodes[n] - local dx, dz = px - prevNode[1], pz - prevNode[3] - local distSq = dx*dx + dz*dz - if distSq == 0.0 then -- Don't add if duplicate - return false - end - - fNodes[n + 1] = pos - fDists[n + 1] = fDists[n] + sqrt(distSq) - lineLength = lineLength+distSq^0.5 - end - - totaldxy = 0 - return true -end + local px, pz = pos[1], pos[3] + if px < 0 or pz < 0 or px > mapSizeX or pz > mapSizeZ then + return false + end + local n = #fNodes + if n == 0 then + fNodes[1] = pos + fDists[1] = 0 + else + local prevNode = fNodes[n] + local dx, dz = px - prevNode[1], pz - prevNode[3] + local distSq = dx * dx + dz * dz + if distSq == 0.0 then -- Don't add if duplicate + return false + end -local function GetInterpNodes(mUnits) - local number = #mUnits - local spacing = fDists[#fNodes] / (#mUnits - 1) - - local interpNodes = {} - - local sPos = fNodes[1] - local sX = sPos[1] - local sZ = sPos[3] - local sY=spGetGroundHeight(sX, sZ) - local sDist = 0 - - local eIdx = 2 - local ePos = fNodes[2] - local eX = ePos[1] - local eZ = ePos[3] - local eDist = fDists[2] - local eY + fNodes[n + 1] = pos + fDists[n + 1] = fDists[n] + sqrt(distSq) + lineLength = lineLength + distSq ^ 0.5 + end - interpNodes[1] = {sX, sY, sZ} + totaldxy = 0 + return true +end - for n = 1, number - 2 do +local function GetInterpNodes(mUnits) + local number = #mUnits + local spacing = fDists[#fNodes] / (#mUnits - 1) + + local interpNodes = {} + + local sPos = fNodes[1] + local sX = sPos[1] + local sZ = sPos[3] + local sY = spGetGroundHeight(sX, sZ) + local sDist = 0 + + local eIdx = 2 + local ePos = fNodes[2] + local eX = ePos[1] + local eZ = ePos[3] + local eDist = fDists[2] + local eY - local reqDist = n * spacing - while (reqDist > eDist) do + interpNodes[1] = { sX, sY, sZ } - sX = eX - sZ = eZ - sDist = eDist + for n = 1, number - 2 do + local reqDist = n * spacing + while reqDist > eDist do + sX = eX + sZ = eZ + sDist = eDist - eIdx = eIdx + 1 - ePos = fNodes[eIdx] - eX = ePos[1] - eZ = ePos[3] - eDist = fDists[eIdx] - end + eIdx = eIdx + 1 + ePos = fNodes[eIdx] + eX = ePos[1] + eZ = ePos[3] + eDist = fDists[eIdx] + end - local nFrac = (reqDist - sDist) / (eDist - sDist) - local nX = sX * (1 - nFrac) + eX * nFrac - local nZ = sZ * (1 - nFrac) + eZ * nFrac - local nY = spGetGroundHeight(nX, nZ) - interpNodes[n + 1] = {nX, nY, nZ} - end + local nFrac = (reqDist - sDist) / (eDist - sDist) + local nX = sX * (1 - nFrac) + eX * nFrac + local nZ = sZ * (1 - nFrac) + eZ * nFrac + local nY = spGetGroundHeight(nX, nZ) + interpNodes[n + 1] = { nX, nY, nZ } + end - ePos = fNodes[#fNodes] - eX = ePos[1] - eZ = ePos[3] - eY = spGetGroundHeight(eX, eZ) - interpNodes[number] = {eX, eY, eZ} + ePos = fNodes[#fNodes] + eX = ePos[1] + eZ = ePos[3] + eY = spGetGroundHeight(eX, eZ) + interpNodes[number] = { eX, eY, eZ } - return interpNodes + return interpNodes end - local function GetCmdOpts(alt, ctrl, meta, shift, right) - local opts = { alt=alt, ctrl=ctrl, meta=meta, shift=shift, right=right } - local coded = 0 + local opts = { alt = alt, ctrl = ctrl, meta = meta, shift = shift, right = right } + local coded = 0 - if alt then coded = coded + CMD_OPT_ALT end - if ctrl then coded = coded + CMD_OPT_CTRL end - if meta then coded = coded + CMD_OPT_META end - if shift then coded = coded + CMD_OPT_SHIFT end - if right then coded = coded + CMD_OPT_RIGHT end + if alt then + coded = coded + CMD_OPT_ALT + end + if ctrl then + coded = coded + CMD_OPT_CTRL + end + if meta then + coded = coded + CMD_OPT_META + end + if shift then + coded = coded + CMD_OPT_SHIFT + end + if right then + coded = coded + CMD_OPT_RIGHT + end - opts.coded = coded - return opts + opts.coded = coded + return opts end - local function GiveNotifyingOrder(cmdID, cmdParams, cmdOpts) - if widgetHandler:CommandNotify(cmdID, cmdParams, cmdOpts) then - return - end + if widgetHandler:CommandNotify(cmdID, cmdParams, cmdOpts) then + return + end - spGiveOrder(cmdID, cmdParams, cmdOpts.coded) + spGiveOrder(cmdID, cmdParams, cmdOpts.coded) end - local function GiveNotifyingOrderToUnit(uArr, oArr, uID, cmdID, cmdParams, cmdOpts) - for _, w in ipairs(widgetHandler.widgets) do - if w.UnitCommandNotify and w:UnitCommandNotify(uID, cmdID, cmdParams, cmdOpts) then - return - end - end - - uArr[#uArr + 1] = uID - oArr[#oArr + 1] = {cmdID, cmdParams, cmdOpts.coded} - return -end + for _, w in ipairs(widgetHandler.widgets) do + if w.UnitCommandNotify and w:UnitCommandNotify(uID, cmdID, cmdParams, cmdOpts) then + return + end + end + uArr[#uArr + 1] = uID + oArr[#oArr + 1] = { cmdID, cmdParams, cmdOpts.coded } + return +end function widget:SelectionChanged(sel) - selectedUnits = sel - selectedUnitsCount = spGetSelectedUnitsCount() + selectedUnits = sel + selectedUnitsCount = spGetSelectedUnitsCount() end - -------------------------------------------------------------------------------- -- Mouse/keyboard Callins -------------------------------------------------------------------------------- function widget:MousePress(mx, my, mButton) - lineLength = 0 --for linestipple - -- Where did we click - inMinimap = spIsAboveMiniMap(mx, my) - if inMinimap and not MiniMapFullProxy then return false end - - if mButton ~= 3 and usingRMB then - fNodes = {} - fDists = {} - usingRMB = false - end - - if mButton ~= 3 then return false end --all formation commands are done using right click & drag - - -- Get command that would've been issued - local _, activeCmdID = spGetActiveCommand() - if activeCmdID then - usingCmd = activeCmdID - usingRMB = true - else - local _, defaultCmdID = spGetDefaultCommand() --spGetActiveCommand() returns nil if the default command (typically move) is in use - if not defaultCmdID then return false end - - local overrideCmdID = overrideCmds[defaultCmdID] - if overrideCmdID then - - local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) - if targType == 'unit' then - overriddenCmd = defaultCmdID - overriddenTarget = targID - elseif targType == 'feature' then - overriddenCmd = defaultCmdID - overriddenTarget = targID + maxUnits - else - -- We can't reversibly override a command if we can't get the original target, so we give up overriding it. - return false - end - - usingCmd = overrideCmdID - else - overriddenCmd = nil - overriddenTarget = nil - - usingCmd = defaultCmdID - end - - usingRMB = true - end - - -- Without this, the unloads issued will use the area of the last area unload - if usingCmd == CMD_UNLOADUNITS then - usingCmd = CMD_UNLOADUNIT - end - - -- Is this command eligible for a custom formation ? - if not (formationCmds[usingCmd] and (not multiUnitOnlyCmds[usingCmd] or #GetExecutingUnits(usingCmd) > 1)) then - return false - end - - -- Get clicked position - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if not pos then return false end - - -- Setup formation node array - if not AddFNode(pos) then return false end + lineLength = 0 --for linestipple + -- Where did we click + inMinimap = spIsAboveMiniMap(mx, my) + if inMinimap and not MiniMapFullProxy then + return false + end + + if mButton ~= 3 and usingRMB then + fNodes = {} + fDists = {} + usingRMB = false + end + + if mButton ~= 3 then + return false + end --all formation commands are done using right click & drag + + -- Get command that would've been issued + local _, activeCmdID = spGetActiveCommand() + if activeCmdID then + usingCmd = activeCmdID + usingRMB = true + else + local _, defaultCmdID = spGetDefaultCommand() --spGetActiveCommand() returns nil if the default command (typically move) is in use + if not defaultCmdID then + return false + end + + local overrideCmdID = overrideCmds[defaultCmdID] + if overrideCmdID then + local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) + if targType == "unit" then + overriddenCmd = defaultCmdID + overriddenTarget = targID + elseif targType == "feature" then + overriddenCmd = defaultCmdID + overriddenTarget = targID + maxUnits + else + -- We can't reversibly override a command if we can't get the original target, so we give up overriding it. + return false + end + + usingCmd = overrideCmdID + else + overriddenCmd = nil + overriddenTarget = nil + + usingCmd = defaultCmdID + end + + usingRMB = true + end + + -- Without this, the unloads issued will use the area of the last area unload + if usingCmd == CMD_UNLOADUNITS then + usingCmd = CMD_UNLOADUNIT + end + + -- Is this command eligible for a custom formation ? + if not (formationCmds[usingCmd] and (not multiUnitOnlyCmds[usingCmd] or #GetExecutingUnits(usingCmd) > 1)) then + return false + end + + -- Get clicked position + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if not pos then + return false + end + + -- Setup formation node array + if not AddFNode(pos) then + return false + end local alt, ctrl, meta, shift = spGetModKeyState() - -- Is this line a path candidate (We don't do a path off an overriden command) - pathCandidate = (not overriddenCmd) and selectedUnitsCount==1 and (not shift or repeatForSingleUnit) + -- Is this line a path candidate (We don't do a path off an overriden command) + pathCandidate = (not overriddenCmd) and selectedUnitsCount == 1 and (not shift or repeatForSingleUnit) - -- Initialize path positions tracking - pathPositions = {} + -- Initialize path positions tracking + pathPositions = {} - return true + return true end - function widget:MouseMove(mx, my, dx, dy, mButton) - -- It is possible for MouseMove to fire after MouseRelease - if #fNodes == 0 then - return false - end - - -- Minimap-specific checks - if inMinimap then - totaldxy = totaldxy + dx*dx + dy*dy - if (totaldxy < 5) or not spIsAboveMiniMap(mx, my) then - return false - end - end - - -- Get clicked position - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if not pos then return false end - - -- Add the new formation node - if not AddFNode(pos) then return false end - - -- Have we started drawing a line? - if #fNodes == 2 then - - -- We have enough nodes to start drawing now - widgetHandler:UpdateWidgetCallIn("DrawInMiniMap", self) - widgetHandler:UpdateWidgetCallIn("DrawWorld", self) - - -- If the line is a path, start the units moving to this node - if pathCandidate then - - -- For the first path command, use raw shift state to decide whether to clear queue - -- This ensures queue is cleared unless user explicitly holds shift - local alt, ctrl, meta, _ = GetModKeys() - local _, _, _, rawShift = spGetModKeyState() - if spGetInvertQueueKey() then rawShift = not rawShift end - local cmdOpts = GetCmdOpts(false, ctrl, meta, rawShift, usingRMB) -- using alt uses springs box formation, so we set it off always - - GiveNotifyingOrder(usingCmd, pos, cmdOpts) - lastPathPos = pos - pathPositions[1] = {pos[1], pos[2], pos[3]} - - draggingPath = true - end - else - -- Are we dragging a path? - if draggingPath then - - local dx, dz = pos[1] - lastPathPos[1], pos[3] - lastPathPos[3] - if (dx*dx + dz*dz) > minPathSpacingSq then - - -- Check if this position is too close to any previously added path position - local tooClose = false - for i = 1, #pathPositions do - local prevPos = pathPositions[i] - local pdx, pdz = pos[1] - prevPos[1], pos[3] - prevPos[3] - if (pdx*pdx + pdz*pdz) <= minPathSpacingSq then - tooClose = true - break - end - end - - -- Only add command if it's not too close to any previous position - if not tooClose then - local alt, ctrl, meta, shift = GetModKeys() - local cmdOpts = GetCmdOpts(false, ctrl, meta, true, usingRMB) - - GiveNotifyingOrder(usingCmd, pos, cmdOpts) - lastPathPos = pos - pathPositions[#pathPositions + 1] = {pos[1], pos[2], pos[3]} - end - end - end - end - - return false -end + -- It is possible for MouseMove to fire after MouseRelease + if #fNodes == 0 then + return false + end + + -- Minimap-specific checks + if inMinimap then + totaldxy = totaldxy + dx * dx + dy * dy + if (totaldxy < 5) or not spIsAboveMiniMap(mx, my) then + return false + end + end + + -- Get clicked position + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if not pos then + return false + end + + -- Add the new formation node + if not AddFNode(pos) then + return false + end + -- Have we started drawing a line? + if #fNodes == 2 then + -- We have enough nodes to start drawing now + widgetHandler:UpdateWidgetCallIn("DrawInMiniMap", self) + widgetHandler:UpdateWidgetCallIn("DrawWorld", self) + + -- If the line is a path, start the units moving to this node + if pathCandidate then + -- For the first path command, use raw shift state to decide whether to clear queue + -- This ensures queue is cleared unless user explicitly holds shift + local alt, ctrl, meta, _ = GetModKeys() + local _, _, _, rawShift = spGetModKeyState() + if spGetInvertQueueKey() then + rawShift = not rawShift + end + local cmdOpts = GetCmdOpts(false, ctrl, meta, rawShift, usingRMB) -- using alt uses springs box formation, so we set it off always + + GiveNotifyingOrder(usingCmd, pos, cmdOpts) + lastPathPos = pos + pathPositions[1] = { pos[1], pos[2], pos[3] } + + draggingPath = true + end + else + -- Are we dragging a path? + if draggingPath then + local dx, dz = pos[1] - lastPathPos[1], pos[3] - lastPathPos[3] + if (dx * dx + dz * dz) > minPathSpacingSq then + -- Check if this position is too close to any previously added path position + local tooClose = false + for i = 1, #pathPositions do + local prevPos = pathPositions[i] + local pdx, pdz = pos[1] - prevPos[1], pos[3] - prevPos[3] + if (pdx * pdx + pdz * pdz) <= minPathSpacingSq then + tooClose = true + break + end + end + + -- Only add command if it's not too close to any previous position + if not tooClose then + local alt, ctrl, meta, shift = GetModKeys() + local cmdOpts = GetCmdOpts(false, ctrl, meta, true, usingRMB) + + GiveNotifyingOrder(usingCmd, pos, cmdOpts) + lastPathPos = pos + pathPositions[#pathPositions + 1] = { pos[1], pos[2], pos[3] } + end + end + end + end + + return false +end function widget:MouseRelease(mx, my, mButton) lineLength = 0 - -- It is possible for MouseRelease to fire after MouseRelease - if #fNodes == 0 then - return false - end - - -- Modkeys / command reset - local alt, ctrl, meta, shift = GetModKeys() - if not usingRMB then - if shift then - endShift = true -- Reset on release of shift - else - spSetActiveCommand(0) -- Deselect command - end - end + -- It is possible for MouseRelease to fire after MouseRelease + if #fNodes == 0 then + return false + end + + -- Modkeys / command reset + local alt, ctrl, meta, shift = GetModKeys() + if not usingRMB then + if shift then + endShift = true -- Reset on release of shift + else + spSetActiveCommand(0) -- Deselect command + end + end if selectedUnitsCount == 1 and not shift then spSetActiveCommand(0) -- Deselect command end - -- Are we going to use the drawn formation? - local usingFormation = true - - -- Override checking - if overriddenCmd then - - local targetID - local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) - if targType == 'unit' then - targetID = targID - elseif targType == 'feature' then - targetID = targID + maxUnits - end - - if targetID and targetID == overriddenTarget then - - -- Signal that we are no longer using the drawn formation - usingFormation = false - - -- Process the original command instead - local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) - GiveNotifyingOrder(overriddenCmd, {overriddenTarget}, cmdOpts) - end - end - - -- Using path? If so then we do nothing - if draggingPath then - - draggingPath = false - - -- Using formation? If so then it's time to calculate and issue orders. - elseif usingFormation then - - -- Add final position (Sometimes we don't get the last MouseMove before this MouseRelease) - if (not inMinimap) or spIsAboveMiniMap(mx, my) then - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if pos then - AddFNode(pos) - end - end - - -- Get command options - local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) - - -- we add the drag threshold code here - -- tracing to a point with a drag threshold pixel delta added to mouse coord, to get world distance - local selectionThreshold = Spring.GetConfigInt("MouseDragFrontCommandThreshold") - local _, dragDeltaPos = spTraceScreenRay(mx,my+selectionThreshold, true, false, false, true) - local _, pos = spTraceScreenRay(mx, my, true, false, false, true) - local dragDelta = 0 - if dragDeltaPos and pos then - dragDelta = pos[3] - dragDeltaPos[3] - end - local adjustedMinFormationLength = max(dragDelta, minFormationLength) - - if fDists[#fNodes] < adjustedMinFormationLength or (usingCmd == CMD.UNLOAD_UNIT and fDists[#fNodes] < 64*(selectedUnitsCount - 1)) then - -- We should check if any units are able to execute it, - -- but the order is small enough network-wise that the tiny bug potential isn't worth it. - - -- Check if this order was meant to target a unit - local targetID - if overrideCmds[usingCmd] then - local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) - if targType == 'unit' then - targetID = targID - elseif targType == 'feature' then - targetID = targID + maxUnits - end - end - - if targetID then - -- Give order (i.e. pass the command to the engine to use as normal) - GiveNotifyingOrder(usingCmd, {targetID}, cmdOpts) - elseif usingCmd == CMD_MOVE then - GiveNotifyingOrder(usingCmd, {fNodes[1][1],fNodes[1][2],fNodes[1][3]}, cmdOpts) - else - -- Deselect command, select default command instead - spSetActiveCommand(0) - end - - else - -- Order is a formation; line was drawn - -- Are any units able to execute it? - local mUnits = GetExecutingUnits(usingCmd) - - if #mUnits > 0 then - - local interpNodes = GetInterpNodes(mUnits) - - local orders - if (#mUnits <= maxHungarianUnits) then - orders = GetOrdersHungarian(interpNodes, mUnits, #mUnits, shift and not meta) - else - orders = GetOrdersNoX(interpNodes, mUnits, #mUnits, shift and not meta) - end - - local unitArr = {} - local orderArr = {} - if meta then - local altOpts = GetCmdOpts(true, false, false, false, false) - for i = 1, #orders do - local orderPair = orders[i] - local orderPos = orderPair[2] - GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], CMD_INSERT, {0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3]}, altOpts) - if (i == #orders and #unitArr > 0) or #unitArr >= 100 then - Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) - unitArr = {} - orderArr = {} - end - end - else - for i = 1, #orders do - local orderPair = orders[i] - GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], usingCmd, orderPair[2], cmdOpts) - if (i == #orders and #unitArr > 0) or #unitArr >= 100 then - Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) - unitArr = {} - orderArr = {} - end - end - end + -- Are we going to use the drawn formation? + local usingFormation = true + + -- Override checking + if overriddenCmd then + local targetID + local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) + if targType == "unit" then + targetID = targID + elseif targType == "feature" then + targetID = targID + maxUnits + end + + if targetID and targetID == overriddenTarget then + -- Signal that we are no longer using the drawn formation + usingFormation = false + + -- Process the original command instead + local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) + GiveNotifyingOrder(overriddenCmd, { overriddenTarget }, cmdOpts) + end + end + + -- Using path? If so then we do nothing + if draggingPath then + draggingPath = false + + -- Using formation? If so then it's time to calculate and issue orders. + elseif usingFormation then + -- Add final position (Sometimes we don't get the last MouseMove before this MouseRelease) + if (not inMinimap) or spIsAboveMiniMap(mx, my) then + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if pos then + AddFNode(pos) + end + end + + -- Get command options + local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) + + -- we add the drag threshold code here + -- tracing to a point with a drag threshold pixel delta added to mouse coord, to get world distance + local selectionThreshold = Spring.GetConfigInt("MouseDragFrontCommandThreshold") + local _, dragDeltaPos = spTraceScreenRay(mx, my + selectionThreshold, true, false, false, true) + local _, pos = spTraceScreenRay(mx, my, true, false, false, true) + local dragDelta = 0 + if dragDeltaPos and pos then + dragDelta = pos[3] - dragDeltaPos[3] + end + local adjustedMinFormationLength = max(dragDelta, minFormationLength) + + if fDists[#fNodes] < adjustedMinFormationLength or (usingCmd == CMD.UNLOAD_UNIT and fDists[#fNodes] < 64 * (selectedUnitsCount - 1)) then + -- We should check if any units are able to execute it, + -- but the order is small enough network-wise that the tiny bug potential isn't worth it. + + -- Check if this order was meant to target a unit + local targetID + if overrideCmds[usingCmd] then + local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) + if targType == "unit" then + targetID = targID + elseif targType == "feature" then + targetID = targID + maxUnits + end + end + + if targetID then + -- Give order (i.e. pass the command to the engine to use as normal) + GiveNotifyingOrder(usingCmd, { targetID }, cmdOpts) + elseif usingCmd == CMD_MOVE then + GiveNotifyingOrder(usingCmd, { fNodes[1][1], fNodes[1][2], fNodes[1][3] }, cmdOpts) + else + -- Deselect command, select default command instead + spSetActiveCommand(0) + end + else + -- Order is a formation; line was drawn + -- Are any units able to execute it? + local mUnits = GetExecutingUnits(usingCmd) + + if #mUnits > 0 then + local interpNodes = GetInterpNodes(mUnits) + + local orders + if #mUnits <= maxHungarianUnits then + orders = GetOrdersHungarian(interpNodes, mUnits, #mUnits, shift and not meta) + else + orders = GetOrdersNoX(interpNodes, mUnits, #mUnits, shift and not meta) + end + + local unitArr = {} + local orderArr = {} + if meta then + local altOpts = GetCmdOpts(true, false, false, false, false) + for i = 1, #orders do + local orderPair = orders[i] + local orderPos = orderPair[2] + GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], CMD_INSERT, { 0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3] }, altOpts) + if (i == #orders and #unitArr > 0) or #unitArr >= 100 then + Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) + unitArr = {} + orderArr = {} + end + end + else + for i = 1, #orders do + local orderPair = orders[i] + GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], usingCmd, orderPair[2], cmdOpts) + if (i == #orders and #unitArr > 0) or #unitArr >= 100 then + Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) + unitArr = {} + orderArr = {} + end + end + end if usingCmd == CMD_SETTARGET then Spring.SendLuaRulesMsg("settarget_line") end - spSetActiveCommand(0) -- Deselect command - end - end - end - - if #fNodes > 1 then - dimmCmd = usingCmd - dimmNodes = fNodes - dimmAlpha = 1.0 - widgetHandler:UpdateWidgetCallIn("Update", self) - end - - fNodes = {} - fDists = {} - - return true -end + spSetActiveCommand(0) -- Deselect command + end + end + end + + if #fNodes > 1 then + dimmCmd = usingCmd + dimmNodes = fNodes + dimmAlpha = 1.0 + widgetHandler:UpdateWidgetCallIn("Update", self) + end + fNodes = {} + fDists = {} + + return true +end function widget:KeyRelease(key) - if (key == keyShift) and endShift then - spSetActiveCommand(0) - endShift = false - end + if (key == keyShift) and endShift then + spSetActiveCommand(0) + endShift = false + end end -------------------------------------------------------------------------------- @@ -733,144 +742,136 @@ end -------------------------------------------------------------------------------- local function tVerts(verts) - for i = 1, #verts do - local v = verts[i] - glVertex(v[1], v[2], v[3]) - end + for i = 1, #verts do + local v = verts[i] + glVertex(v[1], v[2], v[3]) + end end - local function tVertsMinimap(verts) - for i = 1, #verts do - local v = verts[i] - glVertex(v[1], v[3], 1) - end + for i = 1, #verts do + local v = verts[i] + glVertex(v[1], v[3], 1) + end end - -local function DrawGroundquad(x,y,z,size) - gl.TexCoord(0,0) - gl.Vertex(x-size,y,z-size) - gl.TexCoord(0,1) - gl.Vertex(x-size,y,z+size) - gl.TexCoord(1,1) - gl.Vertex(x+size,y,z+size) - gl.TexCoord(1,0) - gl.Vertex(x+size,y,z-size) +local function DrawGroundquad(x, y, z, size) + gl.TexCoord(0, 0) + gl.Vertex(x - size, y, z - size) + gl.TexCoord(0, 1) + gl.Vertex(x - size, y, z + size) + gl.TexCoord(1, 1) + gl.Vertex(x + size, y, z + size) + gl.TexCoord(1, 0) + gl.Vertex(x + size, y, z - size) end - local function DrawFilledCircleOutFading(pos, size, cornerCount) - SetColor(usingCmd, 1) - local lengthPerUnit = lineLength / (selectedUnitsCount-1) + SetColor(usingCmd, 1) + local lengthPerUnit = lineLength / (selectedUnitsCount - 1) if (lengthPerUnit < 64) and (usingCmd == CMD.UNLOAD_UNIT) then - glColor(1.0,0.3,0.0,1.0) + glColor(1.0, 0.3, 0.0, 1.0) end - gl.Texture(dotImage) - gl.BeginEnd(GL.QUADS,DrawGroundquad, pos[1], pos[2], pos[3], size) - gl.Texture(false) + gl.Texture(dotImage) + gl.BeginEnd(GL.QUADS, DrawGroundquad, pos[1], pos[2], pos[3], size) + gl.Texture(false) end - local function DrawFormationDots(vertFunction, zoomY) gl.PushAttrib(GL.ALL_ATTRIB_BITS) - gl.DepthTest(false) - local currentLength = 0 - local lengthPerUnit = lineLength / (selectedUnitsCount - 1) - local lengthUnitNext = lengthPerUnit - local dotSize = sqrt(zoomY*0.24) - if (#fNodes > 1) and (selectedUnitsCount > 1) then - SetColor(usingCmd, 0.6) + gl.DepthTest(false) + local currentLength = 0 + local lengthPerUnit = lineLength / (selectedUnitsCount - 1) + local lengthUnitNext = lengthPerUnit + local dotSize = sqrt(zoomY * 0.24) + if (#fNodes > 1) and (selectedUnitsCount > 1) then + SetColor(usingCmd, 0.6) if (lengthPerUnit < 64) and (usingCmd == CMD.UNLOAD_UNIT) then - glColor(1.0,0.3,0.0,0.6) + glColor(1.0, 0.3, 0.0, 0.6) end - DrawFilledCircleOutFading(fNodes[1], dotSize) - if (#fNodes > 2) then - for i=1, #fNodes-1 do - local x = fNodes[i][1] - local y = fNodes[i][3] - local x2 = fNodes[i+1][1] - local y2 = fNodes[i+1][3] - local dx = x - x2 - local dy = y - y2 - local length = sqrt((dx*dx)+(dy*dy)) - while (currentLength + length >= lengthUnitNext) do - local factor = (lengthUnitNext - currentLength) / length - local factorPos = - {fNodes[i][1] + ((fNodes[i+1][1] - fNodes[i][1]) * factor), - fNodes[i][2] + ((fNodes[i+1][2] - fNodes[i][2]) * factor), - fNodes[i][3] + ((fNodes[i+1][3] - fNodes[i][3]) * factor)} - DrawFilledCircleOutFading(factorPos, dotSize) - lengthUnitNext = lengthUnitNext + lengthPerUnit - end - currentLength = currentLength + length - end - end - DrawFilledCircleOutFading(fNodes[#fNodes], dotSize) - end - gl.DepthTest(true) + DrawFilledCircleOutFading(fNodes[1], dotSize) + if #fNodes > 2 then + for i = 1, #fNodes - 1 do + local x = fNodes[i][1] + local y = fNodes[i][3] + local x2 = fNodes[i + 1][1] + local y2 = fNodes[i + 1][3] + local dx = x - x2 + local dy = y - y2 + local length = sqrt((dx * dx) + (dy * dy)) + while currentLength + length >= lengthUnitNext do + local factor = (lengthUnitNext - currentLength) / length + local factorPos = { fNodes[i][1] + ((fNodes[i + 1][1] - fNodes[i][1]) * factor), fNodes[i][2] + ((fNodes[i + 1][2] - fNodes[i][2]) * factor), fNodes[i][3] + ((fNodes[i + 1][3] - fNodes[i][3]) * factor) } + DrawFilledCircleOutFading(factorPos, dotSize) + lengthUnitNext = lengthUnitNext + lengthPerUnit + end + currentLength = currentLength + length + end + end + DrawFilledCircleOutFading(fNodes[#fNodes], dotSize) + end + gl.DepthTest(true) gl.PopAttrib(GL.ALL_ATTRIB_BITS) end - local function DrawFormationLines(vertFunction, lineStipple) - glLineStipple(lineStipple, 4369) - glLineWidth(2.0) - if #fNodes > 1 then - SetColor(usingCmd, 1.0) - glBeginEnd(GL_LINE_STRIP, vertFunction, fNodes) - end - if #dimmNodes > 1 then - SetColor(dimmCmd, dimmAlpha) - glBeginEnd(GL_LINE_STRIP, vertFunction, dimmNodes) - end - glLineWidth(1.0) - glLineStipple(false) + glLineStipple(lineStipple, 4369) + glLineWidth(2.0) + if #fNodes > 1 then + SetColor(usingCmd, 1.0) + glBeginEnd(GL_LINE_STRIP, vertFunction, fNodes) + end + if #dimmNodes > 1 then + SetColor(dimmCmd, dimmAlpha) + glBeginEnd(GL_LINE_STRIP, vertFunction, dimmNodes) + end + glLineWidth(1.0) + glLineStipple(false) end - local Xs, Ys = spGetViewGeometry() -Xs, Ys = Xs*0.5, Ys*0.5 +Xs, Ys = Xs * 0.5, Ys * 0.5 function widget:ViewResize(viewSizeX, viewSizeY) - Xs, Ys = spGetViewGeometry() - Xs, Ys = Xs*0.5, Ys*0.5 + Xs, Ys = spGetViewGeometry() + Xs, Ys = Xs * 0.5, Ys * 0.5 end - function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end - function widget:DrawWorld() - if chobbyInterface then return end - if #fNodes > 1 or #dimmNodes > 1 then - local camX, camY, camZ = spGetCameraPosition() - local at, p = spTraceScreenRay(Xs,Ys,true,false,false) + if chobbyInterface then + return + end + if #fNodes > 1 or #dimmNodes > 1 then + local camX, camY, camZ = spGetCameraPosition() + local at, p = spTraceScreenRay(Xs, Ys, true, false, false) local zoomY - if at == "ground" then - local dx, dy, dz = camX-p[1], camY-p[2], camZ-p[3] - --zoomY = ((dx*dx + dy*dy + dz*dz)*0.01)^0.25 --tests show that sqrt(sqrt(x)) is faster than x^0.25 - zoomY = sqrt(dx*dx + dy*dy + dz*dz) - else - --zoomY = sqrt((camY - max(spGetGroundHeight(camX, camZ), 0))*0.1) - zoomY = camY - max(spGetGroundHeight(camX, camZ), 0) - end - if zoomY < 6 then zoomY = 6 end - if lineLength > 0 then --don't try and draw if the command was cancelled by having two mouse buttons pressed at once - DrawFormationDots(tVerts, zoomY) - end - glColor(1,1,1,1) - end + if at == "ground" then + local dx, dy, dz = camX - p[1], camY - p[2], camZ - p[3] + --zoomY = ((dx*dx + dy*dy + dz*dz)*0.01)^0.25 --tests show that sqrt(sqrt(x)) is faster than x^0.25 + zoomY = sqrt(dx * dx + dy * dy + dz * dz) + else + --zoomY = sqrt((camY - max(spGetGroundHeight(camX, camZ), 0))*0.1) + zoomY = camY - max(spGetGroundHeight(camX, camZ), 0) + end + if zoomY < 6 then + zoomY = 6 + end + if lineLength > 0 then --don't try and draw if the command was cancelled by having two mouse buttons pressed at once + DrawFormationDots(tVerts, zoomY) + end + glColor(1, 1, 1, 1) + end end - --TODO maybe include minimap drawing again function widget:DrawInMiniMap() - glPushMatrix() - glLoadIdentity() + glPushMatrix() + glLoadIdentity() local currRot = getCurrentMiniMapRotationOption() if currRot == ROTATION.DEG_0 then @@ -889,509 +890,483 @@ function widget:DrawInMiniMap() gl.Rotate(-90, 0, 0, 1) end - DrawFormationLines(tVertsMinimap, 1) - glPopMatrix() + DrawFormationLines(tVertsMinimap, 1) + glPopMatrix() end - function widget:Update(deltaTime) - dimmAlpha = dimmAlpha - lineFadeRate * deltaTime - if dimmAlpha <= 0 then - dimmNodes = {} - widgetHandler:RemoveWidgetCallIn("Update", self) - if #fNodes == 0 then - widgetHandler:RemoveWidgetCallIn("DrawWorld", self) - widgetHandler:RemoveWidgetCallIn("DrawInMiniMap", self) - end - end + dimmAlpha = dimmAlpha - lineFadeRate * deltaTime + if dimmAlpha <= 0 then + dimmNodes = {} + widgetHandler:RemoveWidgetCallIn("Update", self) + if #fNodes == 0 then + widgetHandler:RemoveWidgetCallIn("DrawWorld", self) + widgetHandler:RemoveWidgetCallIn("DrawInMiniMap", self) + end + end end - --------------------------------------------------------------------------------------------------------- -- Config --------------------------------------------------------------------------------------------------------- function widget:GetConfigData() -- Saving - return { - ['maxHungarianUnits'] = maxHungarianUnits, - } + return { + ["maxHungarianUnits"] = maxHungarianUnits, + } end function widget:SetConfigData(data) -- Loading - maxHungarianUnits = data['maxHungarianUnits'] or defaultHungarianUnits + maxHungarianUnits = data["maxHungarianUnits"] or defaultHungarianUnits end - --------------------------------------------------------------------------------------------------------- -- Matching Algorithms --------------------------------------------------------------------------------------------------------- function GetOrdersNoX(nodes, units, unitCount, shifted) - -- Remember when we start - -- This is for capping total time - -- Note: We at least complete initial assignment - local startTime = osclock() - - -- Find initial assignments - local unitSet = {} - local fdist = -1 - local fm - - for u = 1, unitCount do - -- Get unit position - local ux, uz - if shifted then - ux, _, uz = GetUnitFinalPosition(units[u]) - else - ux, _, uz = spGetUnitPosition(units[u]) - end + -- Remember when we start + -- This is for capping total time + -- Note: We at least complete initial assignment + local startTime = osclock() + + -- Find initial assignments + local unitSet = {} + local fdist = -1 + local fm + + for u = 1, unitCount do + -- Get unit position + local ux, uz + if shifted then + ux, _, uz = GetUnitFinalPosition(units[u]) + else + ux, _, uz = spGetUnitPosition(units[u]) + end if ux then - unitSet[u] = {ux, units[u], uz, -1} -- Such that x/z are in same place as in nodes (So we can use same sort function) + unitSet[u] = { ux, units[u], uz, -1 } -- Such that x/z are in same place as in nodes (So we can use same sort function) -- Work on finding furthest points (As we have ux/uz already) for i = u - 1, 1, -1 do - local up = unitSet[i] local vx, vz = up[1], up[3] local dx, dz = vx - ux, vz - uz - local dist = dx*dx + dz*dz + local dist = dx * dx + dz * dz - if (dist > fdist) then + if dist > fdist then fdist = dist fm = (vz - uz) / (vx - ux) end end end - end - - -- Maybe nodes are further apart than the units - for i = 1, unitCount - 1 do - - local np = nodes[i] - local nx, nz = np[1], np[3] - - for j = i + 1, unitCount do - - local mp = nodes[j] - local mx, mz = mp[1], mp[3] - local dx, dz = mx - nx, mz - nz - local dist = dx*dx + dz*dz - - if (dist > fdist) then - fdist = dist - fm = (mz - nz) / (mx - nx) - end - end - end - - local fminv = 1.0/ fm - local function sortFunc(a, b) - -- y = mx + c - -- c = y - mx - -- c = y + x / m (For perp line) - return (a[3] + a[1] * fminv) < (b[3] + b[1] * fminv) - end - - tsort(unitSet, sortFunc) - tsort(nodes, sortFunc) - - for u = 1, unitCount do - unitSet[u][4] = nodes[u] - end - - --------------------------------------------------------------------------------------------------------- - -- Main part of algorithm - --------------------------------------------------------------------------------------------------------- - - -- M/C for each finished matching - local Ms = {} - local Cs = {} - - -- Stacks to hold finished and still-to-check units - local stFin = {} - local stFinCnt = 0 - local stChk = {} - local stChkCnt = 0 - - -- Add all units to check stack - for u = 1, unitCount do - stChk[u] = u - end - stChkCnt = unitCount - - -- Begin algorithm - while ((stChkCnt > 0) and (osclock() - startTime < maxNoXTime)) do - - -- Get unit, extract position and matching node position - local u = stChk[stChkCnt] - local ud = unitSet[u] - local ux, uz = ud[1], ud[3] - local mn = ud[4] - local nx, nz = mn[1], mn[3] - - -- Calculate M/C - local Mu = (nz - uz) / (nx - ux) - local Cu = uz - Mu * ux - - -- Check for clashes against finished matches - local clashes = false - - for i = 1, stFinCnt do - - -- Get opposing unit and matching node position - local f = stFin[i] - local fd = unitSet[f] - local tn = fd[4] - - -- Get collision point - local ix = (Cs[f] - Cu) / (Mu - Ms[f]) - local iz = Mu * ix + Cu - - -- Check bounds - if ((ux - ix) * (ix - nx) >= 0) and - ((uz - iz) * (iz - nz) >= 0) and - ((fd[1] - ix) * (ix - tn[1]) >= 0) and - ((fd[3] - iz) * (iz - tn[3]) >= 0) then - - -- Lines cross - - -- Swap matches, note this retains solution integrity - ud[4] = tn - fd[4] = mn - - -- Remove clashee from finished - stFin[i] = stFin[stFinCnt] - stFinCnt = stFinCnt - 1 - - -- Add clashee to top of check stack - stChkCnt = stChkCnt + 1 - stChk[stChkCnt] = f - - -- No need to check further - clashes = true - break - end - end - - if not clashes then - - -- Add checked unit to finished - stFinCnt = stFinCnt + 1 - stFin[stFinCnt] = u - - -- Remove from to-check stack (Easily done, we know it was one on top) - stChkCnt = stChkCnt - 1 - - -- We can set the M/C now - Ms[u] = Mu - Cs[u] = Cu - end - end - - --------------------------------------------------------------------------------------------------------- - -- Return orders - --------------------------------------------------------------------------------------------------------- - local orders = {} - for i = 1, unitCount do - local unit = unitSet[i] - orders[i] = {unit[2], unit[4]} - end - return orders -end + end + + -- Maybe nodes are further apart than the units + for i = 1, unitCount - 1 do + local np = nodes[i] + local nx, nz = np[1], np[3] + + for j = i + 1, unitCount do + local mp = nodes[j] + local mx, mz = mp[1], mp[3] + local dx, dz = mx - nx, mz - nz + local dist = dx * dx + dz * dz + if dist > fdist then + fdist = dist + fm = (mz - nz) / (mx - nx) + end + end + end + + local fminv = 1.0 / fm + local function sortFunc(a, b) + -- y = mx + c + -- c = y - mx + -- c = y + x / m (For perp line) + return (a[3] + a[1] * fminv) < (b[3] + b[1] * fminv) + end + + tsort(unitSet, sortFunc) + tsort(nodes, sortFunc) + + for u = 1, unitCount do + unitSet[u][4] = nodes[u] + end + + --------------------------------------------------------------------------------------------------------- + -- Main part of algorithm + --------------------------------------------------------------------------------------------------------- + + -- M/C for each finished matching + local Ms = {} + local Cs = {} + + -- Stacks to hold finished and still-to-check units + local stFin = {} + local stFinCnt = 0 + local stChk = {} + local stChkCnt = 0 + + -- Add all units to check stack + for u = 1, unitCount do + stChk[u] = u + end + stChkCnt = unitCount + + -- Begin algorithm + while (stChkCnt > 0) and (osclock() - startTime < maxNoXTime) do + -- Get unit, extract position and matching node position + local u = stChk[stChkCnt] + local ud = unitSet[u] + local ux, uz = ud[1], ud[3] + local mn = ud[4] + local nx, nz = mn[1], mn[3] + + -- Calculate M/C + local Mu = (nz - uz) / (nx - ux) + local Cu = uz - Mu * ux + + -- Check for clashes against finished matches + local clashes = false + + for i = 1, stFinCnt do + -- Get opposing unit and matching node position + local f = stFin[i] + local fd = unitSet[f] + local tn = fd[4] + + -- Get collision point + local ix = (Cs[f] - Cu) / (Mu - Ms[f]) + local iz = Mu * ix + Cu + + -- Check bounds + if ((ux - ix) * (ix - nx) >= 0) and ((uz - iz) * (iz - nz) >= 0) and ((fd[1] - ix) * (ix - tn[1]) >= 0) and ((fd[3] - iz) * (iz - tn[3]) >= 0) then + -- Lines cross + + -- Swap matches, note this retains solution integrity + ud[4] = tn + fd[4] = mn + + -- Remove clashee from finished + stFin[i] = stFin[stFinCnt] + stFinCnt = stFinCnt - 1 + + -- Add clashee to top of check stack + stChkCnt = stChkCnt + 1 + stChk[stChkCnt] = f + + -- No need to check further + clashes = true + break + end + end + + if not clashes then + -- Add checked unit to finished + stFinCnt = stFinCnt + 1 + stFin[stFinCnt] = u + + -- Remove from to-check stack (Easily done, we know it was one on top) + stChkCnt = stChkCnt - 1 + + -- We can set the M/C now + Ms[u] = Mu + Cs[u] = Cu + end + end + + --------------------------------------------------------------------------------------------------------- + -- Return orders + --------------------------------------------------------------------------------------------------------- + local orders = {} + for i = 1, unitCount do + local unit = unitSet[i] + orders[i] = { unit[2], unit[4] } + end + return orders +end function GetOrdersHungarian(nodes, units, unitCount, shifted) - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - -- (the following code is written by gunblob) - -- this code finds the optimal solution (slow, but effective!) - -- it uses the hungarian algorithm from http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html - -- if this violates gpl license please let gunblob and me know - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - local t = osclock() - - -------------------------------------------------------------------------------------------- - -------------------------------------------------------------------------------------------- - -- cache node<->unit distances - - local distances = {} - --for i = 1, unitCount do distances[i] = {} end - - for i = 1, unitCount do - - local uID = units[i] - local ux, uz - - if shifted then - ux, _, uz = GetUnitFinalPosition(uID) - else - ux, _, uz = spGetUnitPosition(uID) - end + ------------------------------------------------------------------------------------- + ------------------------------------------------------------------------------------- + -- (the following code is written by gunblob) + -- this code finds the optimal solution (slow, but effective!) + -- it uses the hungarian algorithm from http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html + -- if this violates gpl license please let gunblob and me know + ------------------------------------------------------------------------------------- + ------------------------------------------------------------------------------------- + local t = osclock() + + -------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------- + -- cache node<->unit distances + + local distances = {} + --for i = 1, unitCount do distances[i] = {} end + + for i = 1, unitCount do + local uID = units[i] + local ux, uz + + if shifted then + ux, _, uz = GetUnitFinalPosition(uID) + else + ux, _, uz = spGetUnitPosition(uID) + end if ux then distances[i] = {} local dists = distances[i] for j = 1, unitCount do - local nodePos = nodes[j] local dx, dz = nodePos[1] - ux, nodePos[3] - uz - dists[j] = floor(sqrt(dx*dx + dz*dz) + 0.5) + dists[j] = floor(sqrt(dx * dx + dz * dz) + 0.5) -- Integer distances = greatly improved algorithm speed end end - end - - -------------------------------------------------------------------------------------------- - -- find optimal solution and send orders - local result = findHungarian(distances, unitCount) - -------------------------------------------------------------------------------------------- - -- determine needed time and optimize the maxUnits limit - - local delay = osclock() - t - - if (delay > maxHngTime) and (maxHungarianUnits > minHungarianUnits) then - - -- Delay is greater than desired, we have to reduce units - maxHungarianUnits = maxHungarianUnits - 1 - else - -- Delay is less than desired, so thats OK - -- To make judgements we need number of units to be close to max - -- Because we are making predictions of time and we want them to be accurate - if (#units > maxHungarianUnits*unitIncreaseThresh) then - - -- This implementation of Hungarian algorithm is O(n3) - -- Because we have less than maxUnits, but are altering maxUnits... - -- We alter the time, to 'predict' time we would be getting at maxUnits - -- We then recheck that against maxHngTime - - local nMult = maxHungarianUnits / #units - - if ((delay*nMult*nMult*nMult) < maxHngTime) then - maxHungarianUnits = maxHungarianUnits + 1 - else - if (maxHungarianUnits > minHungarianUnits) then - maxHungarianUnits = maxHungarianUnits - 1 - end - end - end - end - - -- Return orders - local orders = {} - for i = 1, unitCount do - local rPair = result[i] - orders[i] = {units[rPair[1]], nodes[rPair[2]]} - end - - return orders -end + end + -------------------------------------------------------------------------------------------- + -- find optimal solution and send orders + local result = findHungarian(distances, unitCount) + -------------------------------------------------------------------------------------------- + -- determine needed time and optimize the maxUnits limit + + local delay = osclock() - t + + if (delay > maxHngTime) and (maxHungarianUnits > minHungarianUnits) then + -- Delay is greater than desired, we have to reduce units + maxHungarianUnits = maxHungarianUnits - 1 + else + -- Delay is less than desired, so thats OK + -- To make judgements we need number of units to be close to max + -- Because we are making predictions of time and we want them to be accurate + if #units > maxHungarianUnits * unitIncreaseThresh then + -- This implementation of Hungarian algorithm is O(n3) + -- Because we have less than maxUnits, but are altering maxUnits... + -- We alter the time, to 'predict' time we would be getting at maxUnits + -- We then recheck that against maxHngTime + + local nMult = maxHungarianUnits / #units + + if (delay * nMult * nMult * nMult) < maxHngTime then + maxHungarianUnits = maxHungarianUnits + 1 + else + if maxHungarianUnits > minHungarianUnits then + maxHungarianUnits = maxHungarianUnits - 1 + end + end + end + end -function findHungarian(array, n) - -- Vars - local colcover = {} - local rowcover = {} - local starscol = {} - local primescol = {} - - -- Initialization - for i = 1, n do - rowcover[i] = false - colcover[i] = false - starscol[i] = false - primescol[i] = false - end - - -- Subtract minimum from rows - for i = 1, n do - local aRow = array[i] - local minVal = aRow[1] - for j = 2, n do - if aRow[j] < minVal then - minVal = aRow[j] - end - end - - for j = 1, n do - aRow[j] = aRow[j] - minVal - end - end - - -- Subtract minimum from columns - for j = 1, n do - local minVal = array[1][j] - for i = 2, n do - if array[i][j] < minVal then - minVal = array[i][j] - end - end - - for i = 1, n do - array[i][j] = array[i][j] - minVal - end - end - - -- Star zeroes - for i = 1, n do - local aRow = array[i] - for j = 1, n do - if (aRow[j] == 0) and not colcover[j] then - colcover[j] = true - starscol[i] = j - break - end - end - end - - -- Start solving system - while true do - -- Are we done ? - local done = true - for i = 1, n do - if not colcover[i] then - done = false - break - end - end - - if done then - local pairings = {} - for i = 1, n do - pairings[i] = {i, starscol[i]} - end - return pairings - end - - -- Not done - local r, c = stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) - stepFiveStar(colcover, rowcover, r, c, n, starscol, primescol) - end + -- Return orders + local orders = {} + for i = 1, unitCount do + local rPair = result[i] + orders[i] = { units[rPair[1]], nodes[rPair[2]] } + end + + return orders end +function findHungarian(array, n) + -- Vars + local colcover = {} + local rowcover = {} + local starscol = {} + local primescol = {} + + -- Initialization + for i = 1, n do + rowcover[i] = false + colcover[i] = false + starscol[i] = false + primescol[i] = false + end -function doPrime(array, colcover, rowcover, n, starscol, r, c, rmax, primescol) - primescol[r] = c - local starCol = starscol[r] - - if starCol then - rowcover[r] = true - colcover[starCol] = false - - for i = 1, rmax do - if not rowcover[i] and (array[i][starCol] == 0) then - local rr, cc = doPrime(array, colcover, rowcover, n, starscol, i, starCol, rmax, primescol) - if rr then - return rr, cc - end - end - end - - return - else - return r, c - end + -- Subtract minimum from rows + for i = 1, n do + local aRow = array[i] + local minVal = aRow[1] + for j = 2, n do + if aRow[j] < minVal then + minVal = aRow[j] + end + end + + for j = 1, n do + aRow[j] = aRow[j] - minVal + end + end + + -- Subtract minimum from columns + for j = 1, n do + local minVal = array[1][j] + for i = 2, n do + if array[i][j] < minVal then + minVal = array[i][j] + end + end + + for i = 1, n do + array[i][j] = array[i][j] - minVal + end + end + + -- Star zeroes + for i = 1, n do + local aRow = array[i] + for j = 1, n do + if (aRow[j] == 0) and not colcover[j] then + colcover[j] = true + starscol[i] = j + break + end + end + end + + -- Start solving system + while true do + -- Are we done ? + local done = true + for i = 1, n do + if not colcover[i] then + done = false + break + end + end + + if done then + local pairings = {} + for i = 1, n do + pairings[i] = { i, starscol[i] } + end + return pairings + end + + -- Not done + local r, c = stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) + stepFiveStar(colcover, rowcover, r, c, n, starscol, primescol) + end end +function doPrime(array, colcover, rowcover, n, starscol, r, c, rmax, primescol) + primescol[r] = c + local starCol = starscol[r] + + if starCol then + rowcover[r] = true + colcover[starCol] = false + + for i = 1, rmax do + if not rowcover[i] and (array[i][starCol] == 0) then + local rr, cc = doPrime(array, colcover, rowcover, n, starscol, i, starCol, rmax, primescol) + if rr then + return rr, cc + end + end + end -function stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) - -- Infinite loop - while true do - - -- Find uncovered zeros and prime them - for i = 1, n do - if not rowcover[i] then - local aRow = array[i] - for j = 1, n do - if (aRow[j] == 0) and not colcover[j] then - local i, j = doPrime(array, colcover, rowcover, n, starscol, i, j, i-1, primescol) - if i then - return i, j - end - break -- this row is covered - end - end - end - end - - -- Find minimum uncovered - local minVal = huge - for i = 1, n do - if not rowcover[i] then - local aRow = array[i] - for j = 1, n do - if (aRow[j] < minVal) and not colcover[j] then - minVal = aRow[j] - end - end - end - end - - -- There is the potential for minVal to be 0, very very rarely though. (Checking for it costs more than the +/- 0's) - - -- Covered rows = + - -- Uncovered cols = - - for i = 1, n do - local aRow = array[i] - if rowcover[i] then - for j = 1, n do - if colcover[j] then - aRow[j] = aRow[j] + minVal - end - end - else - for j = 1, n do - if not colcover[j] then - aRow[j] = aRow[j] - minVal - end - end - end - end - end + return + else + return r, c + end end +function stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) + -- Infinite loop + while true do + -- Find uncovered zeros and prime them + for i = 1, n do + if not rowcover[i] then + local aRow = array[i] + for j = 1, n do + if (aRow[j] == 0) and not colcover[j] then + local i, j = doPrime(array, colcover, rowcover, n, starscol, i, j, i - 1, primescol) + if i then + return i, j + end + break -- this row is covered + end + end + end + end -function stepFiveStar(colcover, rowcover, row, col, n, starscol, primescol) - -- Star the initial prime - primescol[row] = false - starscol[row] = col - local ignoreRow = row -- Ignore the star on this row when looking for next - - repeat - local noFind = true - - for i = 1, n do - - if (starscol[i] == col) and (i ~= ignoreRow) then - - noFind = false - - -- Unstar the star - -- Turn the prime on the same row into a star (And ignore this row (aka star) when searching for next star) - - local pcol = primescol[i] - primescol[i] = false - starscol[i] = pcol - ignoreRow = i - col = pcol - - break - end - end - until noFind - - for i = 1, n do - rowcover[i] = false - colcover[i] = false - primescol[i] = false - end - - for i = 1, n do - local scol = starscol[i] - if scol then - colcover[scol] = true - end - end + -- Find minimum uncovered + local minVal = huge + for i = 1, n do + if not rowcover[i] then + local aRow = array[i] + for j = 1, n do + if (aRow[j] < minVal) and not colcover[j] then + minVal = aRow[j] + end + end + end + end + + -- There is the potential for minVal to be 0, very very rarely though. (Checking for it costs more than the +/- 0's) + + -- Covered rows = + + -- Uncovered cols = - + for i = 1, n do + local aRow = array[i] + if rowcover[i] then + for j = 1, n do + if colcover[j] then + aRow[j] = aRow[j] + minVal + end + end + else + for j = 1, n do + if not colcover[j] then + aRow[j] = aRow[j] - minVal + end + end + end + end + end end +function stepFiveStar(colcover, rowcover, row, col, n, starscol, primescol) + -- Star the initial prime + primescol[row] = false + starscol[row] = col + local ignoreRow = row -- Ignore the star on this row when looking for next + + repeat + local noFind = true + + for i = 1, n do + if (starscol[i] == col) and (i ~= ignoreRow) then + noFind = false + + -- Unstar the star + -- Turn the prime on the same row into a star (And ignore this row (aka star) when searching for next star) + + local pcol = primescol[i] + primescol[i] = false + starscol[i] = pcol + ignoreRow = i + col = pcol + + break + end + end + until noFind + + for i = 1, n do + rowcover[i] = false + colcover[i] = false + primescol[i] = false + end + + for i = 1, n do + local scol = starscol[i] + if scol then + colcover[scol] = true + end + end +end function widget:Initialize() WG.customformations = {} @@ -1434,7 +1409,9 @@ function widget:Initialize() end WG.customformations.AddFormationNode = function(worldPos) - if #fNodes == 0 then return false end + if #fNodes == 0 then + return false + end local added = AddFNode(worldPos) @@ -1456,7 +1433,7 @@ function widget:Initialize() for i = 1, #pathPositions do local prevPos = pathPositions[i] local pdx, pdz = worldPos[1] - prevPos[1], worldPos[3] - prevPos[3] - if (pdx*pdx + pdz*pdz) <= minPathSpacingSq then + if (pdx * pdx + pdz * pdz) <= minPathSpacingSq then tooClose = true break end @@ -1470,18 +1447,20 @@ function widget:Initialize() if isFirstPathCommand then -- First command: use raw shift to decide queue clearing _, _, _, shift = spGetModKeyState() - if spGetInvertQueueKey() then shift = not shift end + if spGetInvertQueueKey() then + shift = not shift + end isFirstPathCommand = false end local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) GiveNotifyingOrder(usingCmd, worldPos, cmdOpts) lastPathPos = worldPos - pathPositions[#pathPositions + 1] = {worldPos[1], worldPos[2], worldPos[3]} + pathPositions[#pathPositions + 1] = { worldPos[1], worldPos[2], worldPos[3] } end end else lastPathPos = worldPos - pathPositions[1] = {worldPos[1], worldPos[2], worldPos[3]} + pathPositions[1] = { worldPos[1], worldPos[2], worldPos[3] } end end @@ -1489,7 +1468,9 @@ function widget:Initialize() end WG.customformations.EndFormation = function(worldPos, cmdID) - if #fNodes == 0 then return false end + if #fNodes == 0 then + return false + end -- Add final position if worldPos then @@ -1506,7 +1487,9 @@ function widget:Initialize() if isFirstPathCommand then -- This is effectively a single click or very short drag - use raw shift _, _, _, shift = spGetModKeyState() - if spGetInvertQueueKey() then shift = not shift end + if spGetInvertQueueKey() then + shift = not shift + end end local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) @@ -1515,10 +1498,10 @@ function widget:Initialize() local dragDelta = selectionThreshold -- Approximate for external callers local adjustedMinFormationLength = max(dragDelta, minFormationLength) - if fDists[#fNodes] < adjustedMinFormationLength or (usingCmd == CMD.UNLOAD_UNIT and fDists[#fNodes] < 64*(selectedUnitsCount - 1)) then + if fDists[#fNodes] < adjustedMinFormationLength or (usingCmd == CMD.UNLOAD_UNIT and fDists[#fNodes] < 64 * (selectedUnitsCount - 1)) then -- Single-click style order if usingCmd == CMD_MOVE and #fNodes > 0 then - GiveNotifyingOrder(usingCmd, {fNodes[1][1], fNodes[1][2], fNodes[1][3]}, cmdOpts) + GiveNotifyingOrder(usingCmd, { fNodes[1][1], fNodes[1][2], fNodes[1][3] }, cmdOpts) result = true end else @@ -1540,7 +1523,7 @@ function widget:Initialize() for i = 1, #orders do local orderPair = orders[i] local orderPos = orderPair[2] - GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], CMD_INSERT, {0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3]}, altOpts) + GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], CMD_INSERT, { 0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3] }, altOpts) if (i == #orders and #unitArr > 0) or #unitArr >= 100 then Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) unitArr = {} @@ -1609,7 +1592,6 @@ function widget:Initialize() end end - function widget:Shutdown() WG.customformations = nil end diff --git a/luaui/Widgets/cmd_dance.lua b/luaui/Widgets/cmd_dance.lua index 7ce8dc82cbe..84bc5bde192 100644 --- a/luaui/Widgets/cmd_dance.lua +++ b/luaui/Widgets/cmd_dance.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Command Dance", - desc = "Adds /dance command for selected commander dance animation", - author = "PtaQ", - date = "2026", - license = "GNU GPL v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Command Dance", + desc = "Adds /dance command for selected commander dance animation", + author = "PtaQ", + date = "2026", + license = "GNU GPL v2 or later", + layer = 0, + enabled = true, + } end local REQUEST_HEADER = "$dance$" @@ -17,31 +17,31 @@ local REQUEST_HEADER = "$dance$" local commanderDefs = {} function widget:Initialize() - for udefID, udef in pairs(UnitDefs) do - if udef.customParams and udef.customParams.iscommander then - commanderDefs[udefID] = true - end - end - widgetHandler:AddAction("dance", function() - local selected = Spring.GetSelectedUnits() - local ids = {} - for i = 1, #selected do - local unitDefID = Spring.GetUnitDefID(selected[i]) - if unitDefID and commanderDefs[unitDefID] then - ids[#ids + 1] = selected[i] - end - end + for udefID, udef in pairs(UnitDefs) do + if udef.customParams and udef.customParams.iscommander then + commanderDefs[udefID] = true + end + end + widgetHandler:AddAction("dance", function() + local selected = Spring.GetSelectedUnits() + local ids = {} + for i = 1, #selected do + local unitDefID = Spring.GetUnitDefID(selected[i]) + if unitDefID and commanderDefs[unitDefID] then + ids[#ids + 1] = selected[i] + end + end - if #ids == 0 then - Spring.Echo("[Dance] Select a commander first!") - return true - end + if #ids == 0 then + Spring.Echo("[Dance] Select a commander first!") + return true + end - Spring.SendLuaRulesMsg(REQUEST_HEADER .. table.concat(ids, ",")) - return true - end, nil, "t") + Spring.SendLuaRulesMsg(REQUEST_HEADER .. table.concat(ids, ",")) + return true + end, nil, "t") end function widget:Shutdown() - widgetHandler:RemoveAction("dance") + widgetHandler:RemoveAction("dance") end diff --git a/luaui/Widgets/cmd_default_set_target.lua b/luaui/Widgets/cmd_default_set_target.lua index 745b8618fc0..efb686fd1e8 100644 --- a/luaui/Widgets/cmd_default_set_target.lua +++ b/luaui/Widgets/cmd_default_set_target.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Set target default", - desc = "replaces default click from attack to set target", - author = "BrainDamage", - date = "-", - license = "WTFPL", - layer = -999999, - enabled = false, + name = "Set target default", + desc = "replaces default click from attack to set target", + author = "BrainDamage", + date = "-", + license = "WTFPL", + layer = -999999, + enabled = false, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -30,7 +29,7 @@ local gameStarted local hasSetTarget = {} for udid, ud in pairs(UnitDefs) do - if ( ud.canMove and ud.speed > 0 and not ud.canFly and ud.canAttack and ud.maxWeaponRange and ud.maxWeaponRange > 0 ) or ud.isFactory then + if (ud.canMove and ud.speed > 0 and not ud.canFly and ud.canAttack and ud.maxWeaponRange and ud.maxWeaponRange > 0) or ud.isFactory then hasSetTarget[udid] = true end end @@ -53,20 +52,22 @@ end function widget:Initialize() if Spring.IsReplay() or spGetGameFrame() > 0 then - if maybeRemoveSelf() then return end + if maybeRemoveSelf() then + return + end end if rebindKeys then for _, keycombo in ipairs(GetActionHotKeys("attack")) do hotKeys[keycombo] = true - SendCommmands({"unbind " .. keycombo .. " attack","bind " .. keycombo .. " settarget"}) + SendCommmands({ "unbind " .. keycombo .. " attack", "bind " .. keycombo .. " settarget" }) end end end function widget:Shutdown() for keycombo in pairs(hotKeys) do - SendCommmands({"unbind " .. keycombo .. " settarget","bind " .. keycombo .. " attack"}) + SendCommmands({ "unbind " .. keycombo .. " settarget", "bind " .. keycombo .. " attack" }) end end diff --git a/luaui/Widgets/cmd_dgun_no_ally.lua b/luaui/Widgets/cmd_dgun_no_ally.lua index 14e204d6263..2b19758931b 100644 --- a/luaui/Widgets/cmd_dgun_no_ally.lua +++ b/luaui/Widgets/cmd_dgun_no_ally.lua @@ -1,24 +1,23 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "DGun no ally", - desc = "Prevents dgun aim to snap onto ally units", - author = "Ceddral", - date = "2018-04-27", - license = "GPL", - layer = 0, - enabled = true - } + return { + name = "DGun no ally", + desc = "Prevents dgun aim to snap onto ally units", + author = "Ceddral", + date = "2018-04-27", + license = "GPL", + layer = 0, + enabled = true, + } end - function widget:Initialize() - WG['dgunnoally'] = true + WG["dgunnoally"] = true end function widget:Shutdown() - WG['dgunnoally'] = nil + WG["dgunnoally"] = nil end function widget:CommandNotify(cmdID, cmdParams, cmdOptions) diff --git a/luaui/Widgets/cmd_dgun_no_ground enemies.lua b/luaui/Widgets/cmd_dgun_no_ground enemies.lua index 8344d901d44..8d0cc703971 100644 --- a/luaui/Widgets/cmd_dgun_no_ground enemies.lua +++ b/luaui/Widgets/cmd_dgun_no_ground enemies.lua @@ -1,23 +1,23 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "DGun no ground enemies", - desc = "Prevents dgun aim to snap onto enemy ground units, holding SHIFT will still target units", - author = "Floris", -- (derivate of a Ceddral widget) - date = "", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false - } + return { + name = "DGun no ground enemies", + desc = "Prevents dgun aim to snap onto enemy ground units, holding SHIFT will still target units", + author = "Floris", -- (derivate of a Ceddral widget) + date = "", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end function widget:Initialize() - WG['dgunnoenemy'] = true + WG["dgunnoenemy"] = true end function widget:Shutdown() - WG['dgunnoenemy'] = nil + WG["dgunnoenemy"] = nil end local isAirUnit = {} @@ -61,7 +61,7 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOptions) if cmdParams2[1] > 0 and not Spring.IsUnitAllied(cmdParams2[1]) then -- still snap aim at enemy units local unitDefID = Spring.GetUnitDefID(cmdParams[1]) -- exclude air and ships, also hovers when on water - if isAirUnit[unitDefID] or isShip[unitDefID] or isUnderwater[unitDefID] or (Spring.GetGroundHeight(cmdParams2[1],cmdParams2[3]) < 0 and isHover[unitDefID]) then + if isAirUnit[unitDefID] or isShip[unitDefID] or isUnderwater[unitDefID] or (Spring.GetGroundHeight(cmdParams2[1], cmdParams2[3]) < 0 and isHover[unitDefID]) then return false end end diff --git a/luaui/Widgets/cmd_exclude_walls_area_attacks.lua b/luaui/Widgets/cmd_exclude_walls_area_attacks.lua index 5ac5ea2aefb..bedda764596 100644 --- a/luaui/Widgets/cmd_exclude_walls_area_attacks.lua +++ b/luaui/Widgets/cmd_exclude_walls_area_attacks.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Exclude walls from area attacks", - desc = "Stops walls from being included in area attacks if units are present", - date = "April 2025", - author = "Slouse", - license = "GNU GPL, v2 or later", - layer = 1, - enabled = true + name = "Exclude walls from area attacks", + desc = "Stops walls from being included in area attacks if units are present", + date = "April 2025", + author = "Slouse", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end @@ -35,10 +35,7 @@ end local isBomberUnitDef = {} for unitDefID, unitDef in pairs(UnitDefs) do - if (unitDef.weapons and unitDef.weapons[1] and isBombWeapon[unitDef.weapons[1].weaponDef]) - or string.find(unitDef.name, "armlance") - or string.find(unitDef.name, "cortitan") - or string.find(unitDef.name, "legatorpbomber") then + if (unitDef.weapons and unitDef.weapons[1] and isBombWeapon[unitDef.weapons[1].weaponDef]) or string.find(unitDef.name, "armlance") or string.find(unitDef.name, "cortitan") or string.find(unitDef.name, "legatorpbomber") then isBomberUnitDef[unitDefID] = true end end @@ -54,9 +51,9 @@ local function addNewCommand(newCmds, unitID, cmdOpts, cmdID) -- Need to clear orders if not in shift, since just sending the first one -- as not-shift would sometimes fail if that unit is in the end not valid local stopCmd = (cmdID == CMD_ATTACK) and CMD_STOP or CMD_UNIT_CANCEL_TARGET - newCmds[1] = {stopCmd, {}, {}} + newCmds[1] = { stopCmd, {}, {} } end - newCmds[#newCmds + 1] = {cmdID, unitID, CMD.OPT_SHIFT} + newCmds[#newCmds + 1] = { cmdID, unitID, CMD.OPT_SHIFT } end function widget:CommandNotify(cmdID, cmdParams, cmdOpts) @@ -102,5 +99,3 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) return true end end - - diff --git a/luaui/Widgets/cmd_extractor_snap.lua b/luaui/Widgets/cmd_extractor_snap.lua index 1dc4684a237..852f4aaef6d 100644 --- a/luaui/Widgets/cmd_extractor_snap.lua +++ b/luaui/Widgets/cmd_extractor_snap.lua @@ -2,18 +2,17 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Extractor Snap (mex/geo)", - desc = "Snaps extractors to give nearest spot", - author = "Hobo Joe, based on work by Niobium and Floris", - version = "v1.0", - date = "Jan 2024", - license = "GNU GPL, v2 or later", - layer = 1, - enabled = true, + name = "Extractor Snap (mex/geo)", + desc = "Snaps extractors to give nearest spot", + author = "Hobo Joe, based on work by Niobium and Floris", + version = "v1.0", + date = "Jan 2024", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end - -- Localized functions for performance local mathAbs = math.abs @@ -47,7 +46,6 @@ local function MakeLine(x1, y1, z1, x2, y2, z2) gl.Vertex(x2, y2, z2) end - function widget:Initialize() if not WG.DrawUnitShapeGL4 then widgetHandler:RemoveWidget() @@ -68,12 +66,10 @@ function widget:Initialize() metalMap = WG["resource_spot_finder"].isMetalMap end - function widget:GameStart() isPregame = false end - local function clear() if activeUnitShape then WG.StopDrawUnitShapeGL4(activeUnitShape) @@ -88,7 +84,6 @@ local function clear() buildCmd = {} end - ---If position of the active blueprint is an extractor, the snap behavior of this widget will be ---disabled to allow cancelling queue actions the same way other buildings would. ---@param uid table unitDefID @@ -99,7 +94,7 @@ local function clashesWithBuildQueue(uid, pos) -- local building test functions taken from pregame_build local function GetBuildingDimensions(uDefID, facing) local bDef = UnitDefs[uDefID] - if (facing % 2 == 1) then + if facing % 2 == 1 then return 4 * bDef.zsize, 4 * bDef.xsize else return 4 * bDef.xsize, 4 * bDef.zsize @@ -113,14 +108,13 @@ local function clashesWithBuildQueue(uid, pos) local w1, h1 = GetBuildingDimensions(buildData1[1], buildData1[5]) local w2, h2 = GetBuildingDimensions(buildData2[1], buildData2[5]) - return mathAbs(buildData1[2] - buildData2[2]) < w1 + w2 and - mathAbs(buildData1[4] - buildData2[4]) < h1 + h2 + return mathAbs(buildData1[2] - buildData2[2]) < w1 + w2 and mathAbs(buildData1[4] - buildData2[4]) < h1 + h2 end local buildFacing = Spring.GetBuildFacing() local newBuildData = { uid, pos.x, pos.y, pos.z, buildFacing } if isPregame then - local queue = WG['pregame-build'].getBuildQueue() + local queue = WG["pregame-build"].getBuildQueue() for i = 1, #queue do if DoBuildingsClash(newBuildData, queue[i]) then return true @@ -130,7 +124,7 @@ local function clashesWithBuildQueue(uid, pos) for i = 1, #units do local queue = Spring.GetUnitCommands(units[i], 100) if queue then - for j=1, #queue do + for j = 1, #queue do local command = queue[j] local id = command.id and command.id or command[1] if id < 0 then @@ -150,15 +144,16 @@ local function clashesWithBuildQueue(uid, pos) return false end - function widget:Update() local activeCmdID selectedMex = nil selectedGeo = nil if isPregame then - activeCmdID = WG['pregame-build'] and WG['pregame-build'].getPreGameDefID() - if activeCmdID then activeCmdID = -activeCmdID end + activeCmdID = WG["pregame-build"] and WG["pregame-build"].getPreGameDefID() + if activeCmdID then + activeCmdID = -activeCmdID + end else _, activeCmdID = spGetActiveCommand() end @@ -168,15 +163,18 @@ function widget:Update() return end - if mexBuildings[-activeCmdID] then selectedMex = -activeCmdID end - if geoBuildings[-activeCmdID] then selectedGeo = -activeCmdID end + if mexBuildings[-activeCmdID] then + selectedMex = -activeCmdID + end + if geoBuildings[-activeCmdID] then + selectedGeo = -activeCmdID + end if not (selectedMex or selectedGeo) then clear() return end - if selectedMex and metalMap then -- no snapping on metal maps clear() return @@ -213,8 +211,8 @@ function widget:Update() local selectedExtractor = isMetalExtractor and selectedMex or selectedGeo local buildingsToCheck = isMetalExtractor and mexBuildings or geoBuildings - if WG['skip_allied_upgrade'] then - spotsToSearch = WG['skip_allied_upgrade'].filterOutAlliedSpots(spotsToSearch, buildingsToCheck) + if WG["skip_allied_upgrade"] then + spotsToSearch = WG["skip_allied_upgrade"].filterOutAlliedSpots(spotsToSearch, buildingsToCheck) end local shouldIgnoreAlreadyQueuedUpSpots = shift @@ -232,7 +230,7 @@ function widget:Update() WG.ExtractorSnap.position = targetPos -- used by prospector and pregame queue local dist = math.distance3dSquared(cursorPos.x, cursorPos.y, cursorPos.z, targetPos.x, targetPos.y, targetPos.z) - if (dist < 1) then + if dist < 1 then clear() WG.ExtractorSnap.position = targetPos --bit of a hack, this still needs to be set during pregame return @@ -264,7 +262,6 @@ function widget:Update() end end - -- Since mex snap bypasses normal building behavior, we have to hand hold gridmenu a little bit local endShift = false local function handleBuildMenu(shift) @@ -277,14 +274,13 @@ local function handleBuildMenu(shift) return end - if (not shift and not grid.getAlwaysReturn()) then + if not shift and not grid.getAlwaysReturn() then grid.clearCategory() elseif grid.getAlwaysReturn() then grid.setCurrentCategory(nil) end end - function widget:MousePress(x, y, button) if isPregame then return @@ -292,21 +288,20 @@ function widget:MousePress(x, y, button) if button == 1 and buildCmd and buildCmd[1] then local alt, ctrl, meta, shift = Spring.GetModKeyState() - shift = Spring.GetInvertQueueKey() and (not shift) or shift + shift = Spring.GetInvertQueueKey() and not shift or shift if selectedMex then - WG['resource_spot_builder'].ApplyPreviewCmds(buildCmd, mexConstructors, shift) + WG["resource_spot_builder"].ApplyPreviewCmds(buildCmd, mexConstructors, shift) handleBuildMenu(shift) return true end if selectedGeo then - WG['resource_spot_builder'].ApplyPreviewCmds(buildCmd, geoConstructors, shift) + WG["resource_spot_builder"].ApplyPreviewCmds(buildCmd, geoConstructors, shift) handleBuildMenu(shift) return true -- override other mouse presses and handle stuff manually end end end - -- I really hate that I have to do this, but something is hardcoding shift behavior with mouse clicks, and I need to override it function widget:KeyRelease(code) if endShift and (code == KEYSYMS.LSHIFT or code == KEYSYMS.RSHIFT) then @@ -315,7 +310,6 @@ function widget:KeyRelease(code) end end - function widget:DrawWorld() if not WG.DrawUnitShapeGL4 or not targetPos or not cursorPos then return @@ -330,7 +324,6 @@ function widget:DrawWorld() gl.DepthTest(true) end - function widget:Shutdown() if not WG.DrawUnitShapeGL4 then return diff --git a/luaui/Widgets/cmd_fac_holdposition.lua b/luaui/Widgets/cmd_fac_holdposition.lua index a07f298b4dd..62060328c0b 100644 --- a/luaui/Widgets/cmd_fac_holdposition.lua +++ b/luaui/Widgets/cmd_fac_holdposition.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Factory hold position", - desc = "Sets new factories, and all units they build, to hold position automatically (except aircraft)", - author = "Hobo Joe (original by Masta Ali)", - date = "April 2024", + name = "Factory hold position", + desc = "Sets new factories, and all units they build, to hold position automatically (except aircraft)", + author = "Hobo Joe (original by Masta Ali)", + date = "April 2024", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID @@ -28,17 +26,16 @@ end -- Units inherit the movestate of the lab that produced them, so we only need to set the factory movestate function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if unitTeam == myTeamID then - if landFactories[unitDefID] then - Spring.GiveOrderToUnit(unitID, CMD.MOVE_STATE, { 0 }, 0) - end - end + if unitTeam == myTeamID then + if landFactories[unitDefID] then + Spring.GiveOrderToUnit(unitID, CMD.MOVE_STATE, { 0 }, 0) + end + end end ---------------------------------------------- ---------------------------------------------- - local function maybeRemoveSelf() if Spring.IsReplay() or Spring.GetSpectatingState() then widgetHandler.RemoveWidget() @@ -57,5 +54,3 @@ end function widget:GameStart() widget:PlayerChanged() end - - diff --git a/luaui/Widgets/cmd_factory_guard_pref.lua b/luaui/Widgets/cmd_factory_guard_pref.lua index 0f08a456cb4..fc5627638f9 100644 --- a/luaui/Widgets/cmd_factory_guard_pref.lua +++ b/luaui/Widgets/cmd_factory_guard_pref.lua @@ -1,15 +1,14 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Factory Guard Default On", - desc = "Sets factory guard state to on by default", - author = "Hobo Joe", - date = "Feb 2024", - license = "GNU GPL, v2 or later", - layer = 1, - enabled = true + name = "Factory Guard Default On", + desc = "Sets factory guard state to on by default", + author = "Hobo Joe", + date = "Feb 2024", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, } end @@ -24,8 +23,8 @@ for unitDefID, unitDef in pairs(UnitDefs) do local buildOptDefID = buildOptions[i] local buildOpt = UnitDefs[buildOptDefID] - if (buildOpt and buildOpt.isBuilder and buildOpt.canAssist) then - isFactory[unitDefID] = true -- only factories that can build builders are included + if buildOpt and buildOpt.isBuilder and buildOpt.canAssist then + isFactory[unitDefID] = true -- only factories that can build builders are included break end end diff --git a/luaui/Widgets/cmd_factory_repeat.lua b/luaui/Widgets/cmd_factory_repeat.lua index c5357bbfc59..3121b89f3aa 100644 --- a/luaui/Widgets/cmd_factory_repeat.lua +++ b/luaui/Widgets/cmd_factory_repeat.lua @@ -14,18 +14,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Factory Auto-Repeat", - desc = "Sets new factories to Repeat on automatically", - author = "TheFatController", - date = "Mar 20, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false - } + return { + name = "Factory Auto-Repeat", + desc = "Sets new factories to Repeat on automatically", + author = "TheFatController", + date = "Mar 20, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -36,36 +35,36 @@ local gameStarted local isFactory = {} for udid, ud in pairs(UnitDefs) do - if ud.isFactory then - isFactory[udid] = true - end + if ud.isFactory then + isFactory[udid] = true + end end function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end end function widget:UnitCreated(unitID, unitDefID, unitTeam) - if isFactory[unitDefID] then - Spring.GiveOrderToUnit(unitID, CMD.REPEAT, { 1 }, 0) - end + if isFactory[unitDefID] then + Spring.GiveOrderToUnit(unitID, CMD.REPEAT, { 1 }, 0) + end end -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/cmd_factoryqmanager.lua b/luaui/Widgets/cmd_factoryqmanager.lua index ef296e7bcf9..86a96397881 100644 --- a/luaui/Widgets/cmd_factoryqmanager.lua +++ b/luaui/Widgets/cmd_factoryqmanager.lua @@ -11,11 +11,10 @@ function widget:GetInfo() date = "Jul 6, 2008", license = "GNU GPL, v2 or later", layer = -9000, - enabled = false + enabled = false, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -41,7 +40,6 @@ local spGetSelectedUnitsSorted = Spring.GetSelectedUnitsSorted --added: Queues can be loaded by left-clicking on the preset box --added: Queues get saved for each mod seperately - local vsx, vsy = spGetViewGeometry() local iboxOuterMargin = 3 @@ -72,7 +70,6 @@ local repeatIcon = "LuaUI/Images/repeat.png" local SAVED_TEXT = Spring.I18N("ui.factoryqmanager.saved") local LOADED_TEXT = Spring.I18N("ui.factoryqmanager.loaded") - -------------------------------------------------------------------------------- --INTERNAL USE -------------------------------------------------------------------------------- @@ -81,7 +78,7 @@ local alpha = 0.0 local modifiedSaved = nil local modifiedGroup = nil local modifiedGroupTime = nil -local defaultScreenResY = 960 --dont change it, its just to keep the same absolute size i had while developing +local defaultScreenResY = 960 --dont change it, its just to keep the same absolute size i had while developing local savedQueues = {} local drawX = nil local facRepeatIdx = "facq_repeat" @@ -193,7 +190,7 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) UiUnit = WG.FlowUI.Draw.Unit UiElement = WG.FlowUI.Draw.Element @@ -219,7 +216,7 @@ end -- Included FactoryClear Lua widget function RemoveBuildOrders(unitID, buildDefID, count) local opts = {} - while (count > 0) do + while count > 0 do if count >= 100 then opts = { "right", "ctrl", "shift" } count = count - 100 @@ -350,7 +347,7 @@ function saveQueue(unitId, unitDef, groupNo) else savedQueues[curModId][unitDef.id][groupNo] = unitQ savedQueues[curModId][unitDef.id][groupNo][facQuota] = unitQuota - savedQueues[curModId][unitDef.id][groupNo][facRepeatIdx] = select(4, Spring.GetUnitStates(unitId, false, true)) -- 4=repeat + savedQueues[curModId][unitDef.id][groupNo][facRepeatIdx] = select(4, Spring.GetUnitStates(unitId, false, true)) -- 4=repeat savedQueues[curModId][unitDef.id][groupNo][facQuotaIdx] = unitQuotaIdx end @@ -405,8 +402,7 @@ function loadQueue(unitId, unitDef, groupNo) spGiveOrderToUnit(unitId, cmd.id, cmd.params, opts) end end - end - + end end end @@ -418,14 +414,15 @@ local function factoryPresetKeyHandler(_, _, args) local selUnit, unitDef = getSingleFactory() local gr = tonumber(key) - if selUnit == nil then return end + if selUnit == nil then + return + end if mode == "save" then saveQueue(selUnit, unitDef, gr) elseif mode == "load" then loadQueue(selUnit, unitDef, gr) end - end local function factoryPresetRender(_, _, _, data) @@ -463,17 +460,10 @@ function CalcDrawCoords(unitId, heightAll) end function DrawBoxTitle(x, y, alpha, unitDef, selUnit) - UiElement(x, y - boxHeightTitle, x + boxWidth, y, 1,1,1,0, 1,1,0,1, WG.FlowUI.clampedOpacity) + UiElement(x, y - boxHeightTitle, x + boxWidth, y, 1, 1, 1, 0, 1, 1, 0, 1, WG.FlowUI.clampedOpacity) gl.Color(1, 1, 1, 1) - UiUnit( - x + boxIconBorder, y - boxHeightTitle + boxIconBorder, x + boxHeightTitle, y - boxIconBorder, - nil, - 1,1,1,1, - 0.08, - nil, nil, - '#'..unitDef.id - ) + UiUnit(x + boxIconBorder, y - boxHeightTitle + boxIconBorder, x + boxHeightTitle, y - boxIconBorder, nil, 1, 1, 1, 1, 0.08, nil, nil, "#" .. unitDef.id) local text = unitDef.translatedHumanName font:Begin() @@ -491,17 +481,16 @@ function SortQueueToUnits(queue) local idx = -1 * entity.id local queuedunit = units[idx] if not queuedunit then - queuedunit = { alt = 0, normal = 0 } - units[idx] = queuedunit + queuedunit = { alt = 0, normal = 0 } + units[idx] = queuedunit end local isAlt = entity.options and entity.options.alt if isAlt then - queuedunit.alt = queuedunit.alt + 1 - else - queuedunit.normal = queuedunit.normal + 1 - end - end - + queuedunit.alt = queuedunit.alt + 1 + else + queuedunit.normal = queuedunit.normal + 1 + end + end end end return units @@ -526,7 +515,7 @@ function DrawBoxGroup(x, y, yOffset, unitDef, selUnit, alpha, groupNo, queue) end --Draw Background Box - UiElement(x, y - boxHeight, x + boxWidth, y, 0,1,1,1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(x, y - boxHeight, x + boxWidth, y, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) --UiElement(x + boxIconBorder, y - boxHeight + 3, x + groupLabelMargin, y - 3, 1, 1, 1, 1) --gl.Color(0, 0, 0, mathMin(alpha, 0.6)) --gl.Rect(x, y, x + boxWidth, y - boxHeight) @@ -541,7 +530,7 @@ function DrawBoxGroup(x, y, yOffset, unitDef, selUnit, alpha, groupNo, queue) --Draw group Label if queue[facQuotaIdx] and queue[facQuotaIdx] == true then font:SetTextColor(1, 0.51, 0.745, alpha or 1) - elseif queue[facRepeatIdx] == nil or queue[facRepeatIdx] == true then + elseif queue[facRepeatIdx] == nil or queue[facRepeatIdx] == true then font:SetTextColor(0, 1, 0, alpha or 1) else font:SetTextColor(1, 1, 1, alpha or 1) @@ -554,82 +543,56 @@ function DrawBoxGroup(x, y, yOffset, unitDef, selUnit, alpha, groupNo, queue) local altCount = unitCounts.alt local normalCount = unitCounts.normal local unitCount = altCount + normalCount - if unitCount == 0 then break end + if unitCount == 0 then + break + end if x + boxHeight + boxIconBorder + xOff + boxHeight + unitIconSpacing > x + boxWidth then font:SetTextColor(1, 1, 1, alpha) font:Print("...", x + xOff + unitCountXOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "nd") break else - gl.Color(0.8,0.8,0.8 ,1) - UiUnit( - x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, - nil, - 1,1,1,1, - 0.08, - nil, nil, - '#'..k - ) + gl.Color(0.8, 0.8, 0.8, 1) + UiUnit(x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, nil, 1, 1, 1, 1, 0.08, nil, nil, "#" .. k) font:SetTextColor(1, 1, 1, alpha) - font:Print(unitCount, x + (boxHeight*0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") + font:Print(unitCount, x + (boxHeight * 0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") end xOff = xOff + boxHeight - boxIconBorder - boxIconBorder + unitIconSpacing end elseif queue[facRepeatIdx] == true then for k, unitCounts in pairs(units) do local altCount = unitCounts.alt - if altCount ~= 0 then + if altCount ~= 0 then if x + boxHeight + boxIconBorder + xOff + boxHeight + unitIconSpacing > x + boxWidth then font:SetTextColor(1, 1, 1, alpha) font:Print("...", x + xOff + unitCountXOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "nd") break else - gl.Color(0.8,0.8,0.8 ,1) - UiUnit( - x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, - nil, - 1,1,1,1, - 0.08, - nil, nil, - '#'..k - ) + gl.Color(0.8, 0.8, 0.8, 1) + UiUnit(x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, nil, 1, 1, 1, 1, 0.08, nil, nil, "#" .. k) font:SetTextColor(1, 1, 1, alpha) - font:Print(altCount, x + (boxHeight*0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") + font:Print(altCount, x + (boxHeight * 0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") end xOff = xOff + boxHeight - boxIconBorder - boxIconBorder + unitIconSpacing end end for k, unitCounts in pairs(units) do local normalCount = unitCounts.normal - if normalCount ~= 0 then + if normalCount ~= 0 then if x + boxHeight + boxIconBorder + xOff + boxHeight + unitIconSpacing > x + boxWidth then font:SetTextColor(1, 1, 1, alpha) font:Print("...", x + xOff + unitCountXOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "nd") break else - gl.Color(0.8,0.8,0.8 ,1) + gl.Color(0.8, 0.8, 0.8, 1) local x1 = x + boxIconBorder + xOff local y1 = y - boxHeight + boxIconBorder local x2 = x + boxHeight - boxIconBorder + xOff local y2 = y - boxIconBorder - UiUnit( - x1, y1, x2, y2, - nil, - 1,1,1,1, - 0.08, - nil, nil, - '#'..k - ) - gl.Color(1,1,1 ,0.8) - UiUnit( - x2 - repIcoSize, y2 - repIcoSize, x2, y2, - nil, - 1,1,1,1, - 0.08, - nil, nil, - repeatIcon - ) + UiUnit(x1, y1, x2, y2, nil, 1, 1, 1, 1, 0.08, nil, nil, "#" .. k) + gl.Color(1, 1, 1, 0.8) + UiUnit(x2 - repIcoSize, y2 - repIcoSize, x2, y2, nil, 1, 1, 1, 1, 0.08, nil, nil, repeatIcon) font:SetTextColor(1, 1, 1, alpha) - font:Print(normalCount, x + (boxHeight*0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") + font:Print(normalCount, x + (boxHeight * 0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") end xOff = xOff + boxHeight - boxIconBorder - boxIconBorder + unitIconSpacing end @@ -643,23 +606,15 @@ function DrawBoxGroup(x, y, yOffset, unitDef, selUnit, alpha, groupNo, queue) font:Print("...", x + xOff + unitCountXOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "nd") break else - gl.Color(0.8,0.8,0.8 ,1) - UiUnit( - x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, - nil, - 1,1,1,1, - 0.08, - nil, nil, - '#'..k - ) + gl.Color(0.8, 0.8, 0.8, 1) + UiUnit(x + boxIconBorder + xOff, y - boxHeight + boxIconBorder, x + boxHeight - boxIconBorder + xOff, y - boxIconBorder, nil, 1, 1, 1, 1, 0.08, nil, nil, "#" .. k) font:SetTextColor(1, 0.51, 0.745, alpha) - font:Print(unitQuotaCount, x + (boxHeight*0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") + font:Print(unitQuotaCount, x + (boxHeight * 0.5) - boxIconBorder + xOff, y - boxHeight + unitCountYOff, fontSizeUnitCount, "cndo") end xOff = xOff + boxHeight - boxIconBorder - boxIconBorder + unitIconSpacing end end - --draw "loaded" text if modifiedGroup == groupNo and modifiedGroupTime > Spring.GetGameSeconds() - loadedBorderDisplayTime then local lText = LOADED_TEXT @@ -706,7 +661,7 @@ function DrawBoxes() local yOffset = 0 local k = 1 local first = true - while (k < 10) do + while k < 10 do local q = savedQueues[curModId][unitDef.id][k] if q ~= nil then local height = boxHeight @@ -735,7 +690,6 @@ function DrawBoxes() k = k + 1 end end - end function widget:Initialize() @@ -747,8 +701,8 @@ function widget:Initialize() curModId = string.upper(Game.gameShortName or "") widgetHandler:AddAction("factory_preset", factoryPresetKeyHandler, nil, "p") - widgetHandler:AddAction("factory_preset_show", factoryPresetRender, {true}, "p") - widgetHandler:AddAction("factory_preset_show", factoryPresetRender, {false}, "r") + widgetHandler:AddAction("factory_preset_show", factoryPresetRender, { true }, "p") + widgetHandler:AddAction("factory_preset_show", factoryPresetRender, { false }, "r") end function widget:Update() diff --git a/luaui/Widgets/cmd_gamespeed.lua b/luaui/Widgets/cmd_gamespeed.lua index e4310b0cce4..95daf2c0699 100644 --- a/luaui/Widgets/cmd_gamespeed.lua +++ b/luaui/Widgets/cmd_gamespeed.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Game Speed", - desc = "Overrides increasing/decreasing game speed behaviour", - author = "Beherith", - date = "2020", - license = "GNU GPL, v2 or later", - layer = -999999, - enabled = true, - } + return { + name = "Game Speed", + desc = "Overrides increasing/decreasing game speed behaviour", + author = "Beherith", + date = "2020", + license = "GNU GPL, v2 or later", + layer = -999999, + enabled = true, + } end -- The number of speed gradations should be minimized, @@ -67,6 +67,6 @@ local function decreaseSpeed() end function widget:Initialize() - widgetHandler:AddAction("increasespeed", increaseSpeed, nil, 'pR') - widgetHandler:AddAction("decreasespeed", decreaseSpeed, nil, 'pR') + widgetHandler:AddAction("increasespeed", increaseSpeed, nil, "pR") + widgetHandler:AddAction("decreasespeed", decreaseSpeed, nil, "pR") end diff --git a/luaui/Widgets/cmd_guard_damaged_constructors.lua b/luaui/Widgets/cmd_guard_damaged_constructors.lua index 81809fbdd37..aa050009cd4 100644 --- a/luaui/Widgets/cmd_guard_damaged_constructors.lua +++ b/luaui/Widgets/cmd_guard_damaged_constructors.lua @@ -1,13 +1,13 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Guard damaged constructors", - desc = "Replace repair command with guard command when right click targeting damaged constructors and factories", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Guard damaged constructors", + desc = "Replace repair command with guard command when right click targeting damaged constructors and factories", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local guardConstructors = true @@ -15,28 +15,27 @@ local guardFactories = true local isConstructor, isFactory = {}, {} for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.isMobileBuilder then - isConstructor[unitDefID] = true - end - if unitDef.isFactory then - isFactory[unitDefID] = true - end + if unitDef.isMobileBuilder then + isConstructor[unitDefID] = true + end + if unitDef.isFactory then + isFactory[unitDefID] = true + end end function widget:DefaultCommand(targetType, targetID, engineCmd) - if targetType ~= "unit" then - return - end + if targetType ~= "unit" then + return + end - if engineCmd == CMD.REPAIR then - if Spring.GetUnitIsBeingBuilt(targetID) then - return - end + if engineCmd == CMD.REPAIR then + if Spring.GetUnitIsBeingBuilt(targetID) then + return + end - local unitDefID = Spring.GetUnitDefID(targetID) - if (isConstructor[unitDefID] and guardConstructors) or (isFactory[unitDefID] and guardFactories) - then - return CMD.GUARD - end - end + local unitDefID = Spring.GetUnitDefID(targetID) + if (isConstructor[unitDefID] and guardConstructors) or (isFactory[unitDefID] and guardFactories) then + return CMD.GUARD + end + end end diff --git a/luaui/Widgets/cmd_guard_remove.lua b/luaui/Widgets/cmd_guard_remove.lua index df829acf4a4..e4a4ca3faff 100644 --- a/luaui/Widgets/cmd_guard_remove.lua +++ b/luaui/Widgets/cmd_guard_remove.lua @@ -1,15 +1,14 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Guard Remove", - desc = "Removes non-terminating orders (guard/patrol) on builders when more commands are given with shift", - author = "Google Frog, Born2Crawl (adapted for BAR)", - date = "13 July 2017", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Guard Remove", + desc = "Removes non-terminating orders (guard/patrol) on builders when more commands are given with shift", + author = "Google Frog, Born2Crawl (adapted for BAR)", + date = "13 July 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end diff --git a/luaui/Widgets/cmd_guard_transport_factory.lua b/luaui/Widgets/cmd_guard_transport_factory.lua index 4364ab70251..f4573d92e16 100644 --- a/luaui/Widgets/cmd_guard_transport_factory.lua +++ b/luaui/Widgets/cmd_guard_transport_factory.lua @@ -2,14 +2,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Transport Factory Guard", - desc = "Enables transports to transport units to the first rally waypoint when told to guard a factory", - author = "Flameink", - date = "April 24, 2025", + name = "Transport Factory Guard", + desc = "Enables transports to transport units to the first rally waypoint when told to guard a factory", + author = "Flameink", + date = "April 24, 2025", version = "0.2.4", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? + layer = 0, + enabled = true, -- loaded by default? } end @@ -38,7 +38,7 @@ end -- Polls every 10 frames. Set to a different number to poll more/less often. local POLLING_RATE = 10 -local TRIVIAL_WALK_TIME = 10 -- If the unit is going somewhere close, don't bother. This also covers the case of builders assisting the factory that built them. +local TRIVIAL_WALK_TIME = 10 -- If the unit is going somewhere close, don't bother. This also covers the case of builders assisting the factory that built them. local PICKUP_TIME_THRESHOLD = 3 -- If the transport is far away from the unit to pick up, don't bother. local FACTORY_CLEARANCE_DISTANCE = 50 -- Distance considered "far from factory" for pickup readiness @@ -48,7 +48,7 @@ local transport_states = { approaching = 1, picking_up = 2, loaded = 3, - unloaded = 4 + unloaded = 4, } local factoryToGuardingTransports = {} local transportToFactory = {} @@ -57,7 +57,7 @@ local transportState = {} local unitToDestination = {} local cachedUnitDefs = {} -local pendingGuardTransports = {} -- transportID -> factoryID (queued but not yet active) +local pendingGuardTransports = {} -- transportID -> factoryID (queued but not yet active) local orderedUnitsBlacklist = {} local blacklistOrderedUnits = false @@ -65,16 +65,16 @@ local blacklistOrderedUnits = false for id, def in pairs(UnitDefs) do cachedUnitDefs[id] = { translatedHumanName = def.translatedHumanName, - isTransport = def.isTransport, - isFactory = def.isFactory, - mass = def.mass, - transportMass = def.transportMass, - speed = def.speed, - transportCapacity = def.transportCapacity, - cantBeTransported = def.cantBeTransported, - transportSize = def.transportSize, - xsize = def.xsize - } + isTransport = def.isTransport, + isFactory = def.isFactory, + mass = def.mass, + transportMass = def.transportMass, + speed = def.speed, + transportCapacity = def.transportCapacity, + cantBeTransported = def.cantBeTransported, + transportSize = def.transportSize, + xsize = def.xsize, + } end local spGetUnitCommandCount = Spring.GetUnitCommandCount @@ -84,21 +84,21 @@ local spGiveOrderToUnit = Spring.GiveOrderToUnit local CMD_REMOVE = CMD.REMOVE local function getCachedUnitDef(unitID) - local unitDefID = spGetUnitDefID(unitID) - if not unitDefID then - return nil - end - return cachedUnitDefs[unitDefID] + local unitDefID = spGetUnitDefID(unitID) + if not unitDefID then + return nil + end + return cachedUnitDefs[unitDefID] end local function isFactory(unitID) - local def = getCachedUnitDef(unitID) - return def and def.isFactory or false + local def = getCachedUnitDef(unitID) + return def and def.isFactory or false end local function isTransport(unitID) - local def = getCachedUnitDef(unitID) - return def and def.isTransport or false + local def = getCachedUnitDef(unitID) + return def and def.isTransport or false end local function distance(point1, point2) @@ -106,9 +106,7 @@ local function distance(point1, point2) return -1 end - return math.diag(point1[1] - point2[1], - point1[2] - point2[2], - point1[3] - point2[3]) + return math.diag(point1[1] - point2[1], point1[2] - point2[2], point1[3] - point2[3]) end local function timeToTarget(start, endpoint, speed) @@ -117,13 +115,13 @@ local function timeToTarget(start, endpoint, speed) end local function getValidRallyCommandDestination(unitID) - local cmdID, options, tag, targetX, targetY, targetZ = Spring.GetUnitCurrentCommand(unitID, 2) - local cmdValid = cmdID == CMD.MOVE or cmdID < 0 - if cmdID == nil or not cmdValid then - return nil - end + local cmdID, options, tag, targetX, targetY, targetZ = Spring.GetUnitCurrentCommand(unitID, 2) + local cmdValid = cmdID == CMD.MOVE or cmdID < 0 + if cmdID == nil or not cmdValid then + return nil + end - return { targetX, targetY, targetZ } + return { targetX, targetY, targetZ } end local function isWaiting(unitID) @@ -132,40 +130,42 @@ local function isWaiting(unitID) end local function tryDeactivateWait(unitID) - if isWaiting(unitID) then - Spring.GiveOrderToUnit(unitID, CMD.WAIT, {}, CMD.OPT_ALT) - end + if isWaiting(unitID) then + Spring.GiveOrderToUnit(unitID, CMD.WAIT, {}, CMD.OPT_ALT) + end end local function tryActivateWait(unitID) - if not isWaiting(unitID) then - Spring.GiveOrderToUnit(unitID, CMD.WAIT, {}, CMD.OPT_ALT) - end + if not isWaiting(unitID) then + Spring.GiveOrderToUnit(unitID, CMD.WAIT, {}, CMD.OPT_ALT) + end end local function IsUnitAlive(unitID) - return Spring.ValidUnitID(unitID) and not Spring.GetUnitIsDead(unitID) + return Spring.ValidUnitID(unitID) and not Spring.GetUnitIsDead(unitID) end local function registerTransport(transportID, factoryID) - if not factoryToGuardingTransports[factoryID] then factoryToGuardingTransports[factoryID] = {} end - factoryToGuardingTransports[factoryID][transportID] = true - transportToFactory[transportID] = factoryID + if not factoryToGuardingTransports[factoryID] then + factoryToGuardingTransports[factoryID] = {} + end + factoryToGuardingTransports[factoryID][transportID] = true + transportToFactory[transportID] = factoryID end local function activateTransportGuard(transportID, factoryID) - registerTransport(transportID, factoryID) - - -- If carrying a unit, unload it at current position before guarding - local carriedUnits = Spring.GetUnitIsTransporting(transportID) - if carriedUnits and #carriedUnits > 0 then - local x, _, z = Spring.GetUnitPosition(transportID) - transportState[transportID] = transport_states.picking_up - activeTransportToUnit[transportID] = carriedUnits[1] - unitToDestination[carriedUnits[1]] = {x, Spring.GetGroundHeight(x, z), z} - else - transportState[transportID] = transport_states.idle - end + registerTransport(transportID, factoryID) + + -- If carrying a unit, unload it at current position before guarding + local carriedUnits = Spring.GetUnitIsTransporting(transportID) + if carriedUnits and #carriedUnits > 0 then + local x, _, z = Spring.GetUnitPosition(transportID) + transportState[transportID] = transport_states.picking_up + activeTransportToUnit[transportID] = carriedUnits[1] + unitToDestination[carriedUnits[1]] = { x, Spring.GetGroundHeight(x, z), z } + else + transportState[transportID] = transport_states.idle + end end function widget:Initialize() @@ -173,15 +173,15 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - WG['transportFactoryGuard'] = {} - WG['transportFactoryGuard'].getBlacklistOrderedUnits = function() + WG["transportFactoryGuard"] = {} + WG["transportFactoryGuard"].getBlacklistOrderedUnits = function() return blacklistOrderedUnits end - WG['transportFactoryGuard'].setBlacklistOrderedUnits = function(value) + WG["transportFactoryGuard"].setBlacklistOrderedUnits = function(value) blacklistOrderedUnits = value end - for _, unitID in ipairs(Spring.GetTeamUnits(Spring.GetLocalTeamID())) do + for _, unitID in ipairs(Spring.GetTeamUnits(Spring.GetLocalTeamID())) do local cmdID, _, _, targetUnitID = Spring.GetUnitCurrentCommand(unitID, 1) local isGuarding = cmdID == CMD.GUARD @@ -193,123 +193,123 @@ function widget:Initialize() end local function isTransportingUnit(transportID, unitID) - local transported = Spring.GetUnitIsTransporting(transportID) or {} - for _, id in ipairs(transported) do - if unitID == id then - return true - end - end + local transported = Spring.GetUnitIsTransporting(transportID) or {} + for _, id in ipairs(transported) do + if unitID == id then + return true + end + end end local function handleTransport(transportID, target) - -- Check if transport has loaded unit - if not IsUnitAlive(target) then - -- unit has been blown up, reset to unloaded - transportState[transportID] = transport_states.unloaded - activeTransportToUnit[transportID] = nil - Spring.GiveOrderToUnit(transportID, CMD.GUARD, transportToFactory[transportID], CMD.OPT_SHIFT) -- go back to base - return - else - -- Order the built unit to stop if it's out of the factory - if transportState[transportID] == transport_states.picking_up then - local factoryLocation = {Spring.GetUnitPosition(transportToFactory[transportID])} - local unitLocation = {Spring.GetUnitPosition(target)} - local isFarFromFactory = distance(factoryLocation, unitLocation) > FACTORY_CLEARANCE_DISTANCE - - -- Check if we picked up the unit already - if isTransportingUnit(transportID, target) then - transportState[transportID] = transport_states.loaded - tryDeactivateWait(target) - Spring.GiveOrderToUnit(transportID, CMD.UNLOAD_UNIT, unitToDestination[target], CMD.OPT_RIGHT) - return - end - - if isFarFromFactory then - tryActivateWait(target) - end - - return - end - - -- Become available once unloaded - if transportState[transportID] == transport_states.unloaded then - transportState[transportID] = transport_states.idle - activeTransportToUnit[transportID] = nil - return - end - - -- Check if unit has left transport - -- TODO: In order to support transports with capacity > 1, we need to add logic for the - -- transport to keep waiting until it sees a unit that it can't pick up. - local carriedUnits = Spring.GetUnitIsTransporting(transportID) - if carriedUnits == nil or #carriedUnits == 0 and transportState[transportID] == transport_states.loaded then - transportState[transportID] = transport_states.unloaded - Spring.GiveOrderToUnit(transportID, CMD.GUARD, transportToFactory[transportID], CMD.OPT_SHIFT) -- go back to base - tryDeactivateWait(target) - return - end - - -- The transport wants to pick up the unit. If the unit is waiting, go ahead and pick it up. - if transportState[transportID] == transport_states.approaching then - if isWaiting(target) then - transportState[transportID] = transport_states.picking_up - Spring.GiveOrderToUnit(transportID, CMD.LOAD_UNITS, target, CMD.OPT_RIGHT) --Load Unit - end - - local factoryLocation = {Spring.GetUnitPosition(transportToFactory[transportID])} - local unitLocation = {Spring.GetUnitPosition(target)} - local isFarFromFactory = distance(factoryLocation, unitLocation) > FACTORY_CLEARANCE_DISTANCE - - if isFarFromFactory then - tryActivateWait(target) - end - - return - end - end + -- Check if transport has loaded unit + if not IsUnitAlive(target) then + -- unit has been blown up, reset to unloaded + transportState[transportID] = transport_states.unloaded + activeTransportToUnit[transportID] = nil + Spring.GiveOrderToUnit(transportID, CMD.GUARD, transportToFactory[transportID], CMD.OPT_SHIFT) -- go back to base + return + else + -- Order the built unit to stop if it's out of the factory + if transportState[transportID] == transport_states.picking_up then + local factoryLocation = { Spring.GetUnitPosition(transportToFactory[transportID]) } + local unitLocation = { Spring.GetUnitPosition(target) } + local isFarFromFactory = distance(factoryLocation, unitLocation) > FACTORY_CLEARANCE_DISTANCE + + -- Check if we picked up the unit already + if isTransportingUnit(transportID, target) then + transportState[transportID] = transport_states.loaded + tryDeactivateWait(target) + Spring.GiveOrderToUnit(transportID, CMD.UNLOAD_UNIT, unitToDestination[target], CMD.OPT_RIGHT) + return + end + + if isFarFromFactory then + tryActivateWait(target) + end + + return + end + + -- Become available once unloaded + if transportState[transportID] == transport_states.unloaded then + transportState[transportID] = transport_states.idle + activeTransportToUnit[transportID] = nil + return + end + + -- Check if unit has left transport + -- TODO: In order to support transports with capacity > 1, we need to add logic for the + -- transport to keep waiting until it sees a unit that it can't pick up. + local carriedUnits = Spring.GetUnitIsTransporting(transportID) + if carriedUnits == nil or #carriedUnits == 0 and transportState[transportID] == transport_states.loaded then + transportState[transportID] = transport_states.unloaded + Spring.GiveOrderToUnit(transportID, CMD.GUARD, transportToFactory[transportID], CMD.OPT_SHIFT) -- go back to base + tryDeactivateWait(target) + return + end + + -- The transport wants to pick up the unit. If the unit is waiting, go ahead and pick it up. + if transportState[transportID] == transport_states.approaching then + if isWaiting(target) then + transportState[transportID] = transport_states.picking_up + Spring.GiveOrderToUnit(transportID, CMD.LOAD_UNITS, target, CMD.OPT_RIGHT) --Load Unit + end + + local factoryLocation = { Spring.GetUnitPosition(transportToFactory[transportID]) } + local unitLocation = { Spring.GetUnitPosition(target) } + local isFarFromFactory = distance(factoryLocation, unitLocation) > FACTORY_CLEARANCE_DISTANCE + + if isFarFromFactory then + tryActivateWait(target) + end + + return + end + end end function widget:GameFrame(frame) - if frame % POLLING_RATE ~= 0 then - return - end - - for transportID, target in pairs(activeTransportToUnit) do - handleTransport(transportID, target) - end - - -- Check if any pending (shift-queued) factory guards have reached the front of the queue - for transportID, factoryID in pairs(pendingGuardTransports) do - if not IsUnitAlive(transportID) or not IsUnitAlive(factoryID) then - pendingGuardTransports[transportID] = nil - else - local cmdID, _, _, cmdTarget = spGetUnitCurrentCommand(transportID, 1) - if cmdID == CMD.GUARD and isFactory(cmdTarget) then - -- Guard reached front of queue - activate - pendingGuardTransports[transportID] = nil - activateTransportGuard(transportID, cmdTarget) - elseif cmdID == nil then - -- Queue is empty, guard was cancelled - pendingGuardTransports[transportID] = nil - end - end - end + if frame % POLLING_RATE ~= 0 then + return + end + + for transportID, target in pairs(activeTransportToUnit) do + handleTransport(transportID, target) + end + + -- Check if any pending (shift-queued) factory guards have reached the front of the queue + for transportID, factoryID in pairs(pendingGuardTransports) do + if not IsUnitAlive(transportID) or not IsUnitAlive(factoryID) then + pendingGuardTransports[transportID] = nil + else + local cmdID, _, _, cmdTarget = spGetUnitCurrentCommand(transportID, 1) + if cmdID == CMD.GUARD and isFactory(cmdTarget) then + -- Guard reached front of queue - activate + pendingGuardTransports[transportID] = nil + activateTransportGuard(transportID, cmdTarget) + elseif cmdID == nil then + -- Queue is empty, guard was cancelled + pendingGuardTransports[transportID] = nil + end + end + end end local function inactivateTransport(unitID) - local guardedFactory = transportToFactory[unitID] - if guardedFactory then - if factoryToGuardingTransports[guardedFactory] then - factoryToGuardingTransports[guardedFactory][unitID] = nil - end - end - - local unitWaitingForPickup = activeTransportToUnit[unitID] - if unitWaitingForPickup ~= nil then - tryDeactivateWait(unitWaitingForPickup) - transportToFactory[unitWaitingForPickup] = nil - activeTransportToUnit[unitID] = nil - end + local guardedFactory = transportToFactory[unitID] + if guardedFactory then + if factoryToGuardingTransports[guardedFactory] then + factoryToGuardingTransports[guardedFactory][unitID] = nil + end + end + + local unitWaitingForPickup = activeTransportToUnit[unitID] + if unitWaitingForPickup ~= nil then + tryDeactivateWait(unitWaitingForPickup) + transportToFactory[unitWaitingForPickup] = nil + activeTransportToUnit[unitID] = nil + end end local function canTransport(transportID, unitID) @@ -320,7 +320,7 @@ local function canTransport(transportID, unitID) return false end - local uDefObj = cachedUnitDefs[udef] + local uDefObj = cachedUnitDefs[udef] local tDefObj = cachedUnitDefs[tdef] if uDefObj.xsize > tDefObj.transportSize * Game.footprintScale then @@ -353,21 +353,23 @@ local function canTransport(transportID, unitID) end local function removePreDestinationMoveCommands(unitID, destination) - local tags = {} - if not destination then return end + local tags = {} + if not destination then + return + end - for i = 1, spGetUnitCommandCount(unitID), 1 do - local cmdID, _, tag, targetX, targetY, targetZ = spGetUnitCurrentCommand(unitID, i) + for i = 1, spGetUnitCommandCount(unitID), 1 do + local cmdID, _, tag, targetX, targetY, targetZ = spGetUnitCurrentCommand(unitID, i) if cmdID == CMD.MOVE then - local isSameMoveDestination = targetX == destination[1] and targetY == destination[2] and targetZ == destination[3] - if not isSameMoveDestination then - tags[#tags + 1] = tag - else - break - end + local isSameMoveDestination = targetX == destination[1] and targetY == destination[2] and targetZ == destination[3] + if not isSameMoveDestination then + tags[#tags + 1] = tag + else + break + end else - break - end + break + end end if tags[1] then @@ -376,134 +378,133 @@ local function removePreDestinationMoveCommands(unitID, destination) end function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - local createdUnitID = unitID - if Spring.AreTeamsAllied(unitTeam, Spring.GetLocalTeamID()) then - if isTransport(createdUnitID) then - -- Handle case where transport is rallied to another lab - local cmdID, _, _, targetUnitID = Spring.GetUnitCurrentCommand(createdUnitID, 1) - if cmdID == nil or cmdID ~= CMD.GUARD then - return - end - - if isFactory(targetUnitID) then - transportState[createdUnitID] = transport_states.idle - registerTransport(createdUnitID, targetUnitID) - end - - elseif factoryToGuardingTransports[factID] and next(factoryToGuardingTransports[factID]) then - local destination = getValidRallyCommandDestination(createdUnitID) - if destination == nil then - return - end - - if blacklistOrderedUnits and orderedUnitsBlacklist[createdUnitID] then - return - end - - local bestTransportID = -1 - local bestTransportTime = math.huge - local unitDefID_created = Spring.GetUnitDefID(createdUnitID) - local createdSpeed = unitDefID_created and cachedUnitDefs[unitDefID_created] and cachedUnitDefs[unitDefID_created].speed or 0 - - for transportID, _ in pairs(factoryToGuardingTransports[factID]) do - if transportState[transportID] == transport_states.idle and canTransport(transportID, createdUnitID) then - local unitLocation = {Spring.GetUnitPosition(unitID)} - local transportLocation = {Spring.GetUnitPosition(transportID)} - - local tDefID = Spring.GetUnitDefID(transportID) - local tSpeed = tDefID and cachedUnitDefs[tDefID] and cachedUnitDefs[tDefID].speed or 0 - local pickupTime = timeToTarget(transportLocation, unitLocation, tSpeed) - local transportTime = timeToTarget(unitLocation, destination, tSpeed) - local walkingTime = timeToTarget(unitLocation, destination, createdSpeed) - - -- This also covers the case of builders guarding their factory - if walkingTime > TRIVIAL_WALK_TIME and pickupTime < PICKUP_TIME_THRESHOLD and pickupTime + transportTime < walkingTime then - if pickupTime + transportTime < bestTransportTime then - bestTransportID = transportID - bestTransportTime = pickupTime + transportTime - end - end - end - end - - if bestTransportID > -1 then - transportState[bestTransportID] = transport_states.approaching - - local unitWaitDestination = {Spring.GetUnitPosition(createdUnitID)} - Spring.GiveOrderToUnit(bestTransportID, CMD.MOVE, unitWaitDestination, CMD.OPT_RIGHT) - Spring.GiveOrderToUnit(bestTransportID, CMD.GUARD, factID, CMD.OPT_SHIFT) - - activeTransportToUnit[bestTransportID] = createdUnitID - unitToDestination[createdUnitID] = getValidRallyCommandDestination(createdUnitID) - -- The engine issues an inital move command to every unit to make sure it clears the factory. - -- We want get rid of that command before picking up. Otherwise, it'll get picked up - -- and dropped off, and then proceed to walk back to the factory and then to the rally. - -- In the interest of being future proof, we remove any move commands in the queue before - -- the destination established above. - removePreDestinationMoveCommands(createdUnitID, destination) - end - end - end + local createdUnitID = unitID + if Spring.AreTeamsAllied(unitTeam, Spring.GetLocalTeamID()) then + if isTransport(createdUnitID) then + -- Handle case where transport is rallied to another lab + local cmdID, _, _, targetUnitID = Spring.GetUnitCurrentCommand(createdUnitID, 1) + if cmdID == nil or cmdID ~= CMD.GUARD then + return + end + + if isFactory(targetUnitID) then + transportState[createdUnitID] = transport_states.idle + registerTransport(createdUnitID, targetUnitID) + end + elseif factoryToGuardingTransports[factID] and next(factoryToGuardingTransports[factID]) then + local destination = getValidRallyCommandDestination(createdUnitID) + if destination == nil then + return + end + + if blacklistOrderedUnits and orderedUnitsBlacklist[createdUnitID] then + return + end + + local bestTransportID = -1 + local bestTransportTime = math.huge + local unitDefID_created = Spring.GetUnitDefID(createdUnitID) + local createdSpeed = unitDefID_created and cachedUnitDefs[unitDefID_created] and cachedUnitDefs[unitDefID_created].speed or 0 + + for transportID, _ in pairs(factoryToGuardingTransports[factID]) do + if transportState[transportID] == transport_states.idle and canTransport(transportID, createdUnitID) then + local unitLocation = { Spring.GetUnitPosition(unitID) } + local transportLocation = { Spring.GetUnitPosition(transportID) } + + local tDefID = Spring.GetUnitDefID(transportID) + local tSpeed = tDefID and cachedUnitDefs[tDefID] and cachedUnitDefs[tDefID].speed or 0 + local pickupTime = timeToTarget(transportLocation, unitLocation, tSpeed) + local transportTime = timeToTarget(unitLocation, destination, tSpeed) + local walkingTime = timeToTarget(unitLocation, destination, createdSpeed) + + -- This also covers the case of builders guarding their factory + if walkingTime > TRIVIAL_WALK_TIME and pickupTime < PICKUP_TIME_THRESHOLD and pickupTime + transportTime < walkingTime then + if pickupTime + transportTime < bestTransportTime then + bestTransportID = transportID + bestTransportTime = pickupTime + transportTime + end + end + end + end + + if bestTransportID > -1 then + transportState[bestTransportID] = transport_states.approaching + + local unitWaitDestination = { Spring.GetUnitPosition(createdUnitID) } + Spring.GiveOrderToUnit(bestTransportID, CMD.MOVE, unitWaitDestination, CMD.OPT_RIGHT) + Spring.GiveOrderToUnit(bestTransportID, CMD.GUARD, factID, CMD.OPT_SHIFT) + + activeTransportToUnit[bestTransportID] = createdUnitID + unitToDestination[createdUnitID] = getValidRallyCommandDestination(createdUnitID) + -- The engine issues an inital move command to every unit to make sure it clears the factory. + -- We want get rid of that command before picking up. Otherwise, it'll get picked up + -- and dropped off, and then proceed to walk back to the factory and then to the rally. + -- In the interest of being future proof, we remove any move commands in the queue before + -- the destination established above. + removePreDestinationMoveCommands(createdUnitID, destination) + end + end + end end function widget:UnitCommandNotify(unitID, cmdID, cmdParams, cmdOpts) - -- Callin from formations widget. If we're ordering in formation, it's definitely not a guard order. - if isTransport(unitID) and not cmdOpts.shift then - inactivateTransport(unitID) - pendingGuardTransports[unitID] = nil - end + -- Callin from formations widget. If we're ordering in formation, it's definitely not a guard order. + if isTransport(unitID) and not cmdOpts.shift then + inactivateTransport(unitID) + pendingGuardTransports[unitID] = nil + end end function widget:CommandNotify(cmdID, cmdParams, cmdOpts) - if not cmdOpts or not cmdParams then - return - end - - local selectedUnits = Spring.GetSelectedUnits() - - for _, orderedUnit in ipairs(selectedUnits) do - if isTransport(orderedUnit) then - if cmdID == CMD.GUARD and isFactory(cmdParams[1]) then - if cmdOpts.shift then - pendingGuardTransports[orderedUnit] = cmdParams[1] - else - inactivateTransport(orderedUnit) - pendingGuardTransports[orderedUnit] = nil - activateTransportGuard(orderedUnit, cmdParams[1]) - end - else - if not cmdOpts.shift then - inactivateTransport(orderedUnit) - pendingGuardTransports[orderedUnit] = nil - end - end - end - orderedUnitsBlacklist[orderedUnit] = true - end + if not cmdOpts or not cmdParams then + return + end + + local selectedUnits = Spring.GetSelectedUnits() + + for _, orderedUnit in ipairs(selectedUnits) do + if isTransport(orderedUnit) then + if cmdID == CMD.GUARD and isFactory(cmdParams[1]) then + if cmdOpts.shift then + pendingGuardTransports[orderedUnit] = cmdParams[1] + else + inactivateTransport(orderedUnit) + pendingGuardTransports[orderedUnit] = nil + activateTransportGuard(orderedUnit, cmdParams[1]) + end + else + if not cmdOpts.shift then + inactivateTransport(orderedUnit) + pendingGuardTransports[orderedUnit] = nil + end + end + end + orderedUnitsBlacklist[orderedUnit] = true + end end local function inactivateFactory(unitID) - for _, transportID in ipairs(factoryToGuardingTransports[unitID]) do - inactivateTransport(transportID) - end + for _, transportID in ipairs(factoryToGuardingTransports[unitID]) do + inactivateTransport(transportID) + end - factoryToGuardingTransports[unitID] = nil + factoryToGuardingTransports[unitID] = nil end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) - if transportToFactory[unitID] then - inactivateTransport(unitID) - end - - pendingGuardTransports[unitID] = nil - - if factoryToGuardingTransports[unitID] then - for transportID, factoryID in pairs(pendingGuardTransports) do - if factoryID == unitID then - pendingGuardTransports[transportID] = nil - end - end - inactivateFactory(unitID) - end - orderedUnitsBlacklist[unitID] = nil + if transportToFactory[unitID] then + inactivateTransport(unitID) + end + + pendingGuardTransports[unitID] = nil + + if factoryToGuardingTransports[unitID] then + for transportID, factoryID in pairs(pendingGuardTransports) do + if factoryID == unitID then + pendingGuardTransports[transportID] = nil + end + end + inactivateFactory(unitID) + end + orderedUnitsBlacklist[unitID] = nil end diff --git a/luaui/Widgets/cmd_holdfire_fix.lua b/luaui/Widgets/cmd_holdfire_fix.lua index 522725f30f2..b34c0ff35ad 100644 --- a/luaui/Widgets/cmd_holdfire_fix.lua +++ b/luaui/Widgets/cmd_holdfire_fix.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Holdfire Fix", - desc = "Holdfire holds fire immediately", - author = "Niobium", - date = "3 April 2010", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Holdfire Fix", + desc = "Holdfire holds fire immediately", + author = "Niobium", + date = "3 April 2010", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -28,31 +26,31 @@ local myTeam local function DropCurrentTarget(unitID) -- STOP clears attack orders, UNIT_CANCEL_TARGET clears an active weapon lock - spGiveOrderToUnit(unitID, CMD_INSERT, {0, CMD_STOP, 0}, {"alt"}) - spGiveOrderToUnit(unitID, CMD_INSERT, {0, CMD_UNIT_CANCEL_TARGET, 0}, {"alt"}) + spGiveOrderToUnit(unitID, CMD_INSERT, { 0, CMD_STOP, 0 }, { "alt" }) + spGiveOrderToUnit(unitID, CMD_INSERT, { 0, CMD_UNIT_CANCEL_TARGET, 0 }, { "alt" }) end function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) myTeam = spGetMyTeamID() - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() myTeam = spGetMyTeamID() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end end function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) diff --git a/luaui/Widgets/cmd_limit_build_spacing.lua b/luaui/Widgets/cmd_limit_build_spacing.lua index 9d5df003903..95efc1e05f7 100644 --- a/luaui/Widgets/cmd_limit_build_spacing.lua +++ b/luaui/Widgets/cmd_limit_build_spacing.lua @@ -1,23 +1,23 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Limit Build Spacing", - desc = "Limits buildspacing to a maximum distance", - author = "Floris", - date = "June 2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Limit Build Spacing", + desc = "Limits buildspacing to a maximum distance", + author = "Floris", + date = "June 2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local limit = 16 function widget:Update() - local _, cmdID = Spring.GetActiveCommand() - if cmdID and cmdID < 0 then + local _, cmdID = Spring.GetActiveCommand() + if cmdID and cmdID < 0 then if Spring.GetBuildSpacing() > limit then Spring.SetBuildSpacing(limit) end - end + end end diff --git a/luaui/Widgets/cmd_line-build_hotkey_ignore.lua b/luaui/Widgets/cmd_line-build_hotkey_ignore.lua index 9f00d0727c1..ff4c47fead5 100644 --- a/luaui/Widgets/cmd_line-build_hotkey_ignore.lua +++ b/luaui/Widgets/cmd_line-build_hotkey_ignore.lua @@ -3,30 +3,26 @@ include("keysym.h.lua") local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Line-Build Hotkey Ignore", - desc = "Ignores keypresses when building lines", - author = "[teh]Teddy", - date = "May 2021", - layer = 0, - enabled = true - } + return { + name = "Line-Build Hotkey Ignore", + desc = "Ignores keypresses when building lines", + author = "[teh]Teddy", + date = "May 2021", + layer = 0, + enabled = true, + } end function widget:KeyPress(key, mods, isRepeat) - - if not mods.alt and mods.shift then - - if key ~= KEYSYMS['UP'] and key ~= KEYSYMS['DOWN'] and key ~= KEYSYMS['LEFT'] and key ~= KEYSYMS['RIGHT'] then -- Don't ignore arrow keys - - local x, y, leftPressed, middlePressed, rightPressed, offscreen = Spring.GetMouseState() - if leftPressed then - - local idx, cmd_id, cmd_type, cmd_name = Spring.GetActiveCommand() - if cmd_id and cmd_id < 0 then - return true - end - end - end - end + if not mods.alt and mods.shift then + if key ~= KEYSYMS["UP"] and key ~= KEYSYMS["DOWN"] and key ~= KEYSYMS["LEFT"] and key ~= KEYSYMS["RIGHT"] then -- Don't ignore arrow keys + local x, y, leftPressed, middlePressed, rightPressed, offscreen = Spring.GetMouseState() + if leftPressed then + local idx, cmd_id, cmd_type, cmd_name = Spring.GetActiveCommand() + if cmd_id and cmd_id < 0 then + return true + end + end + end + end end diff --git a/luaui/Widgets/cmd_nanoturrets_assist_priority.lua b/luaui/Widgets/cmd_nanoturrets_assist_priority.lua index 45c4b86b2cc..9c396c294fb 100644 --- a/luaui/Widgets/cmd_nanoturrets_assist_priority.lua +++ b/luaui/Widgets/cmd_nanoturrets_assist_priority.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Priority Construction Turrets", - desc = "When a new turret is started, local turrets on patrol will target it", - author = "Phinks", - date = "2023-05-05", - layer = 0, - enabled = true + name = "Priority Construction Turrets", + desc = "When a new turret is started, local turrets on patrol will target it", + author = "Phinks", + date = "2023-05-05", + layer = 0, + enabled = true, } end @@ -30,22 +30,22 @@ for unitDefID, unitDef in pairs(UnitDefs) do end function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if unitTeam ~= myTeam then - return - end - if (nanoDefs[unitDefID] ~= nil) then - -- Echo(turretCreatedMessage .. ": " .. unitID) - local pos = {GetUnitPosition(unitID)} - local unitsNear = GetUnitsInSphere(pos[1], pos[2], pos[3], nanoDefs[unitDefID], -3) - -- Echo("found units nearby: " .. unitsNear) - for _, id in ipairs(unitsNear) do - if (nanoDefs[GetUnitDefID(id)] ~= nil) then - local commandQueue = GetUnitCommands(id, 10) - if (commandQueue[2] ~= nil and commandQueue[2]["id"] == CMD_FIGHT) or (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_FIGHT) or commandQueue[1] == nil then - -- Echo("giving repair command to " .. id) - GiveOrderToUnit(id, CMD_REPAIR, unitID, {}) - end - end - end - end + if unitTeam ~= myTeam then + return + end + if nanoDefs[unitDefID] ~= nil then + -- Echo(turretCreatedMessage .. ": " .. unitID) + local pos = { GetUnitPosition(unitID) } + local unitsNear = GetUnitsInSphere(pos[1], pos[2], pos[3], nanoDefs[unitDefID], -3) + -- Echo("found units nearby: " .. unitsNear) + for _, id in ipairs(unitsNear) do + if nanoDefs[GetUnitDefID(id)] ~= nil then + local commandQueue = GetUnitCommands(id, 10) + if (commandQueue[2] ~= nil and commandQueue[2]["id"] == CMD_FIGHT) or (commandQueue[1] ~= nil and commandQueue[1]["id"] == CMD_FIGHT) or commandQueue[1] == nil then + -- Echo("giving repair command to " .. id) + GiveOrderToUnit(id, CMD_REPAIR, unitID, {}) + end + end + end + end end diff --git a/luaui/Widgets/cmd_no_duplicate_orders.lua b/luaui/Widgets/cmd_no_duplicate_orders.lua index c7c339b0b62..d6e57d2136a 100644 --- a/luaui/Widgets/cmd_no_duplicate_orders.lua +++ b/luaui/Widgets/cmd_no_duplicate_orders.lua @@ -14,54 +14,57 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "NoDuplicateOrders", - desc = "Blocks duplicate Attack and Repair/Build orders 1.1b", - author = "TheFatController", - date = "16 April, 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "NoDuplicateOrders", + desc = "Blocks duplicate Attack and Repair/Build orders 1.1b", + author = "TheFatController", + date = "16 April, 2008", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -- Localized functions for performance local mathCeil = math.ceil -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local GetSelectedUnits = Spring.GetSelectedUnits -local GetUnitCommands = Spring.GetUnitCommands -local GetUnitCurrentCommand = Spring.GetUnitCurrentCommand -local GetUnitPosition = Spring.GetUnitPosition -local GiveOrderToUnit = Spring.GiveOrderToUnit -local GetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt +local GetSelectedUnits = Spring.GetSelectedUnits +local GetUnitCommands = Spring.GetUnitCommands +local GetUnitCurrentCommand = Spring.GetUnitCurrentCommand +local GetUnitPosition = Spring.GetUnitPosition +local GiveOrderToUnit = Spring.GiveOrderToUnit +local GetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local buildList = {} function widget:PlayerChanged(playerID) - if Spring.GetSpectatingState() then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() then + widgetHandler:RemoveWidget() + end end function widget:Initialize() - if Spring.IsReplay() or Spring.GetGameFrame() > 0 then - widget:PlayerChanged() - end - for _,unitID in ipairs(Spring.GetTeamUnits(Spring.GetMyTeamID())) do - if GetUnitIsBeingBuilt(unitID) then widget:UnitCreated(unitID) end - end + if Spring.IsReplay() or Spring.GetGameFrame() > 0 then + widget:PlayerChanged() + end + for _, unitID in ipairs(Spring.GetTeamUnits(Spring.GetMyTeamID())) do + if GetUnitIsBeingBuilt(unitID) then + widget:UnitCreated(unitID) + end + end end function widget:GameStart() - widget:PlayerChanged() + widget:PlayerChanged() end -local function toLocString(posX,posY,posZ) - if not posZ then return end +local function toLocString(posX, posY, posZ) + if not posZ then + return + end return (mathCeil(posX - 0.5) .. "_" .. mathCeil(posZ - 0.5)) end @@ -87,73 +90,72 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end function widget:CommandNotify(id, params, options) - if (options.coded == 16) then - if (id == CMD.REPAIR) then - local selUnits = GetSelectedUnits() - local blockUnits = {} - for i=1,#selUnits do - local unitID = selUnits[i] - local cmdID, _, _, cmdParam1, _, cmdParam3 = GetUnitCurrentCommand(unitID) - if cmdID then - if cmdID < 0 and (cmdParam3 and params[1] == buildList[toLocString(cmdParam1, 0, cmdParam3)]) then - blockUnits[unitID] = true - elseif (cmdID == CMD.REPAIR) and (params[1] == cmdParam1) then - blockUnits[unitID] = true - end - end - end - if next(blockUnits) then - for i=1,#selUnits do - local unitID = selUnits[i] - if not blockUnits[unitID] then - GiveOrderToUnit(unitID, id, params, options) - else - local cQueue = GetUnitCommands(unitID,50) or {} - for i=1,#cQueue do - local v = cQueue[i] - if (v.tag ~= cQueue[1].tag) then - GiveOrderToUnit(unitID,v.id,v.params,{"shift"}) - end - end - end - end - return true - else - return false - end - elseif (id == CMD.ATTACK) then - local selUnits = GetSelectedUnits() - local blockUnits = {} - for i=1,#selUnits do - local unitID = selUnits[i] - local cQueue = GetUnitCommands(unitID,50) or {} - if (#cQueue > 0) and (params[1] == cQueue[1].params[1]) then - blockUnits[unitID] = true - end - end - if next(blockUnits) then - for i=1,#selUnits do - local unitID = selUnits[i] - if not blockUnits[unitID] then - GiveOrderToUnit(unitID, id, params, options) - else - local cQueue = GetUnitCommands(unitID,50) or {} - for i=1,#cQueue do - local v = cQueue[i] - if (v.tag ~= cQueue[1].tag) then - GiveOrderToUnit(unitID,v.id,v.params,{"shift"}) - end - end - end - end - return true - else - return false - end - end - end + if options.coded == 16 then + if id == CMD.REPAIR then + local selUnits = GetSelectedUnits() + local blockUnits = {} + for i = 1, #selUnits do + local unitID = selUnits[i] + local cmdID, _, _, cmdParam1, _, cmdParam3 = GetUnitCurrentCommand(unitID) + if cmdID then + if cmdID < 0 and (cmdParam3 and params[1] == buildList[toLocString(cmdParam1, 0, cmdParam3)]) then + blockUnits[unitID] = true + elseif (cmdID == CMD.REPAIR) and (params[1] == cmdParam1) then + blockUnits[unitID] = true + end + end + end + if next(blockUnits) then + for i = 1, #selUnits do + local unitID = selUnits[i] + if not blockUnits[unitID] then + GiveOrderToUnit(unitID, id, params, options) + else + local cQueue = GetUnitCommands(unitID, 50) or {} + for i = 1, #cQueue do + local v = cQueue[i] + if v.tag ~= cQueue[1].tag then + GiveOrderToUnit(unitID, v.id, v.params, { "shift" }) + end + end + end + end + return true + else + return false + end + elseif id == CMD.ATTACK then + local selUnits = GetSelectedUnits() + local blockUnits = {} + for i = 1, #selUnits do + local unitID = selUnits[i] + local cQueue = GetUnitCommands(unitID, 50) or {} + if (#cQueue > 0) and (params[1] == cQueue[1].params[1]) then + blockUnits[unitID] = true + end + end + if next(blockUnits) then + for i = 1, #selUnits do + local unitID = selUnits[i] + if not blockUnits[unitID] then + GiveOrderToUnit(unitID, id, params, options) + else + local cQueue = GetUnitCommands(unitID, 50) or {} + for i = 1, #cQueue do + local v = cQueue[i] + if v.tag ~= cQueue[1].tag then + GiveOrderToUnit(unitID, v.id, v.params, { "shift" }) + end + end + end + end + return true + else + return false + end + end + end end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/cmd_no_self_selection.lua b/luaui/Widgets/cmd_no_self_selection.lua index bc0fd177509..9f8fba55c9f 100644 --- a/luaui/Widgets/cmd_no_self_selection.lua +++ b/luaui/Widgets/cmd_no_self_selection.lua @@ -2,13 +2,13 @@ local widget = widget ---@class Widget function widget:GetInfo() return { - name = "Ignore Self", - desc = "Avoid self-targeting with default commands (e.g. Guard on self)", - author = "efrec", - date = "2025-10-13", + name = "Ignore Self", + desc = "Avoid self-targeting with default commands (e.g. Guard on self)", + author = "efrec", + date = "2025-10-13", version = "v1.0", license = "GNU GPL, v2 or later", - layer = -1e9, -- before other w:DefaultCommand + layer = -1e9, -- before other w:DefaultCommand enabled = true, } end diff --git a/luaui/Widgets/cmd_onoff.lua b/luaui/Widgets/cmd_onoff.lua index 0f4c0a30f0e..cc87641c993 100644 --- a/luaui/Widgets/cmd_onoff.lua +++ b/luaui/Widgets/cmd_onoff.lua @@ -23,7 +23,9 @@ end local function onoff(_, _, args) local state = args[1] - if state ~= nil and (state ~= "0" and state ~= "1") then return end + if state ~= nil and (state ~= "0" and state ~= "1") then + return + end -- Should return { [number unitDefID] = { [1] = [number unitID], etc... }, ... } local selectedUnitsSorted = spGetSelectedUnitsSorted() @@ -35,7 +37,11 @@ local function onoff(_, _, args) if state == nil then local isActive = spGetUnitStates(units[1])["active"] - if isActive then state = 0 else state = 1 end + if isActive then + state = 0 + else + state = 1 + end end for _, unit in pairs(units) do @@ -43,7 +49,7 @@ local function onoff(_, _, args) end end end - return anyOnOffable -- we only halt the chain when at least one unit responds to this action + return anyOnOffable -- we only halt the chain when at least one unit responds to this action end function widget:Initialize() diff --git a/luaui/Widgets/cmd_persistent_build_spacing.lua b/luaui/Widgets/cmd_persistent_build_spacing.lua index b8b95166538..17b746b293c 100644 --- a/luaui/Widgets/cmd_persistent_build_spacing.lua +++ b/luaui/Widgets/cmd_persistent_build_spacing.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Persistent Build Spacing", - desc = "Recalls last build spacing set for each building and game [v2.0]", - author = "Niobium & DrHash", - date = "Sep 6, 2011", - license = "GNU GPL, v3 or later", - layer = 0, - enabled = true - } + return { + name = "Persistent Build Spacing", + desc = "Recalls last build spacing set for each building and game [v2.0]", + author = "Niobium & DrHash", + date = "Sep 6, 2011", + license = "GNU GPL, v3 or later", + layer = 0, + enabled = true, + } end local defaultSpacing = 0 @@ -24,29 +24,29 @@ local spSetBuildSpacing = Spring.SetBuildSpacing local unitNames = {} for udid, ud in pairs(UnitDefs) do - unitNames[udid] = ud.name + unitNames[udid] = ud.name end function widget:Update() - local _, cmdID = spGetActiveCommand() - if cmdID and cmdID < 0 then - if cmdID ~= lastCmdID then - spSetBuildSpacing(math.min(maxBuildSpacing, buildSpacing[unitNames[-cmdID]] or defaultSpacing)) - lastCmdID = cmdID - end + local _, cmdID = spGetActiveCommand() + if cmdID and cmdID < 0 then + if cmdID ~= lastCmdID then + spSetBuildSpacing(math.min(maxBuildSpacing, buildSpacing[unitNames[-cmdID]] or defaultSpacing)) + lastCmdID = cmdID + end buildSpacing[unitNames[-cmdID]] = spGetBuildSpacing() - end + end end function widget:GetConfigData() - return { buildSpacing = buildSpacing } + return { buildSpacing = buildSpacing } end function widget:SetConfigData(data) - buildSpacing = data.buildSpacing or {} - for k,v in pairs(buildSpacing) do - if tonumber(v) == 0 then - buildSpacing[k] = nil - end - end + buildSpacing = data.buildSpacing or {} + for k, v in pairs(buildSpacing) do + if tonumber(v) == 0 then + buildSpacing[k] = nil + end + end end diff --git a/luaui/Widgets/cmd_quick_build_extractor.lua b/luaui/Widgets/cmd_quick_build_extractor.lua index 777647c1e78..3476e1edaf3 100644 --- a/luaui/Widgets/cmd_quick_build_extractor.lua +++ b/luaui/Widgets/cmd_quick_build_extractor.lua @@ -9,11 +9,10 @@ function widget:GetInfo() date = "Jan 2024", license = "GNU GPL, v2 or later", layer = 1000, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spTraceScreenRay = Spring.TraceScreenRay local spGetMouseState = Spring.GetMouseState @@ -74,7 +73,6 @@ local function unitIsCloaked(uDefId) return isCloakableBuilder[spGetUnitDefID(uDefId)] and select(5, spGetUnitStates(uDefId, false, true)) end - local spotFinder local spotBuilder @@ -98,7 +96,6 @@ function widget:Initialize() end end - local function clearGhostBuild() if WG.DrawUnitShapeGL4 and activeShape then WG.StopDrawUnitShapeGL4(activeShape) @@ -112,7 +109,6 @@ local function clearGhostBuild() lastMx, lastMy = -1, -1 end - local selectedUnits = Spring.GetSelectedUnits() function widget:SelectionChanged(sel) selectedUnits = sel @@ -121,20 +117,18 @@ function widget:SelectionChanged(sel) selectionDirty = true end - function widget:Update(dt) - if(selectedSpot or selectedPos) and (selectedMex or selectedGeo) then + if (selectedSpot or selectedPos) and (selectedMex or selectedGeo) then -- we want to do this every frame to avoid cursor flicker. Rest of work can be on a timer - spSetMouseCursor(selectedMex and 'upgmex' or 'upgmex') + spSetMouseCursor(selectedMex and "upgmex" or "upgmex") end updateTime = updateTime + dt - if(updateTime < 0.05) then + if updateTime < 0.05 then return end updateTime = 0 - if not selectedUnits or #selectedUnits == 0 then clearGhostBuild() return @@ -152,7 +146,6 @@ function widget:Update(dt) return end - if not bestMex and not bestGeo then clearGhostBuild() return @@ -172,13 +165,13 @@ function widget:Update(dt) -- First check unit under cursor. If it's an extractor, see if there's valid upgrades -- If it's not an extractor, simply exit local type, rayParams = spTraceScreenRay(mx, my) - local unitUuid = type == 'unit' and rayParams - local unitDefID = type == 'unit' and spGetUnitDefID(rayParams) + local unitUuid = type == "unit" and rayParams + local unitDefID = type == "unit" and spGetUnitDefID(rayParams) - if(unitUuid and unitDefID) then + if unitUuid and unitDefID then local unitIsMex = mexBuildings[unitDefID] local unitIsGeo = geoBuildings[unitDefID] - if (unitIsMex or unitIsGeo) then + if unitIsMex or unitIsGeo then local x, y, z = spGetUnitPosition(unitUuid) extractor = unitIsMex and bestMex or bestGeo @@ -188,7 +181,9 @@ function widget:Update(dt) return end - reusePos.x = x; reusePos.y = y; reusePos.z = z + reusePos.x = x + reusePos.y = y + reusePos.z = z selectedPos = reusePos if unitIsMex then selectedMex = bestMex @@ -242,12 +237,13 @@ function widget:Update(dt) end end - -- Set up ghost if extractor and (selectedSpot or (selectedPos and metalMap)) then -- we only want to build on the center, so we pass the spot in for the position, instead of the groundPos local src = selectedPos or selectedSpot - reuseCmdPos[1] = src.x; reuseCmdPos[2] = src.y; reuseCmdPos[3] = src.z + reuseCmdPos[1] = src.x + reuseCmdPos[2] = src.y + reuseCmdPos[3] = src.z local cmd = spotBuilder.PreviewExtractorCommand(reuseCmdPos, extractor, selectedSpot, metalMap) if not cmd then clearGhostBuild() @@ -260,7 +256,12 @@ function widget:Update(dt) if unitShape and (unitShape[2] ~= newX or unitShape[3] ~= newY or unitShape[4] ~= newZ) then clearGhostBuild() end - reuseUnitShape[1] = newDef; reuseUnitShape[2] = newX; reuseUnitShape[3] = newY; reuseUnitShape[4] = newZ; reuseUnitShape[5] = cmd[5]; reuseUnitShape[6] = cmd[6] + reuseUnitShape[1] = newDef + reuseUnitShape[2] = newX + reuseUnitShape[3] = newY + reuseUnitShape[4] = newZ + reuseUnitShape[5] = cmd[5] + reuseUnitShape[6] = cmd[6] unitShape = reuseUnitShape else unitShape = false @@ -278,7 +279,6 @@ function widget:Update(dt) end end - function widget:MousePress(x, y, button) if not bestMex and not bestGeo then clearGhostBuild() @@ -295,7 +295,7 @@ function widget:MousePress(x, y, button) return end - if (button == 3) then + if button == 3 then local _, _, _, shift = spGetModKeyState() if selectedMex then spotBuilder.ApplyPreviewCmds(buildCmd, mexConstructors, shift) @@ -308,7 +308,6 @@ function widget:MousePress(x, y, button) end end - function widget:Shutdown() clearGhostBuild() end diff --git a/luaui/Widgets/cmd_resolution_switcher.lua b/luaui/Widgets/cmd_resolution_switcher.lua index 34e548afb95..b7171f6ff9e 100644 --- a/luaui/Widgets/cmd_resolution_switcher.lua +++ b/luaui/Widgets/cmd_resolution_switcher.lua @@ -9,7 +9,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathMax = math.max local mathMin = math.min @@ -19,9 +18,9 @@ local tableInsert = table.insert local screenModes, screenGeometries, displays, firstPassDrawFrame, screenModeIndex local windowType = { - fullscreen = 1, - borderless = 2, - windowed = 3, + fullscreen = 1, + borderless = 2, + windowed = 3, multimonitor = 4, } @@ -47,8 +46,12 @@ local function getMaximalWindowGeometry(minI, maxI) for displayNum = 2, Spring.GetNumDisplays() do local py = screenGeometries[displayNum][2] local sy = screenGeometries[displayNum][4] - if py < minY then minY = py end - if py+sy > maxY then maxY = py+sy end + if py < minY then + minY = py + end + if py + sy > maxY then + maxY = py + sy + end end return { minX, minY, maxX, maxY, di } @@ -72,14 +75,18 @@ end local function insertMultiMonitorModes(modes) local numDisplays = Spring.GetNumDisplays() - if numDisplays <= 1 then return end + if numDisplays <= 1 then + return + end refreshScreenGeometries(numDisplays) -- Insert mode spanning all monitors insertMaximalScreenMode(1, numDisplays, modes) - if numDisplays < 3 then return end + if numDisplays < 3 then + return + end -- Insert dual monitor modes for displayNum = 1, numDisplays - 1 do @@ -99,7 +106,7 @@ local function refreshScreenModes() -- Only capture the first occurence of the display index, it will contain maximum supported resolution if display ~= videoMode.display then display = videoMode.display - local w, h, x, y = Spring.GetScreenGeometry(display-1) + local w, h, x, y = Spring.GetScreenGeometry(display - 1) displays[display] = { name = videoMode.displayName, width = w, --videoMode.w, @@ -112,7 +119,7 @@ local function refreshScreenModes() local fullscreen = { display = display, displayName = videoMode.displayName, - name = Spring.I18N('ui.resolutionswitcher.fullscreen'), + name = Spring.I18N("ui.resolutionswitcher.fullscreen"), type = windowType.fullscreen, width = videoMode.w, height = videoMode.h, @@ -120,7 +127,7 @@ local function refreshScreenModes() local borderless = { display = display, - name = Spring.I18N('ui.resolutionswitcher.borderless'), + name = Spring.I18N("ui.resolutionswitcher.borderless"), displayName = videoMode.displayName, type = windowType.borderless, width = videoMode.w, @@ -135,18 +142,17 @@ local function refreshScreenModes() local windowed = { display = display, displayName = videoMode.displayName, - name = Spring.I18N('ui.resolutionswitcher.window').." " .. videoMode.w .. " × " .. videoMode.h.." (" .. videoMode.hz.."hz)", + name = Spring.I18N("ui.resolutionswitcher.window") .. " " .. videoMode.w .. " × " .. videoMode.h .. " (" .. videoMode.hz .. "hz)", type = windowType.windowed, width = videoMode.w, height = videoMode.h, - hz = videoMode.hz + hz = videoMode.hz, } tableInsert(screenModes, windowed) end end - local numDisplays = Spring.GetNumDisplays() if numDisplays > 1 then refreshScreenGeometries(numDisplays) @@ -158,17 +164,17 @@ local function refreshScreenModes() for display = 1, numDisplays do for display2 = 1, numDisplays do if display ~= display2 then - local w, h, x, y = Spring.GetScreenGeometry(display-1) - local w2, h2, x2, y2 = Spring.GetScreenGeometry(display2-1) + local w, h, x, y = Spring.GetScreenGeometry(display - 1) + local w2, h2, x2, y2 = Spring.GetScreenGeometry(display2 - 1) if w > 0 and w2 > 0 then - if x+w == x2 or x2+w2 == x or x2-w == x or x-w2 == x2 then -- make sure they are next to eachother + if x + w == x2 or x2 + w2 == x or x2 - w == x or x - w2 == x2 then -- make sure they are next to eachother if not addedDisplayCombo[display] or addedDisplayCombo[display] ~= display2 then addedDisplayCombo[display] = display2 addedDisplayCombo[display2] = display tableInsert(screenModes, { - display = #displays+1, -- not actual display number + display = #displays + 1, -- not actual display number actualDisplay = (x < x2 and display or display2), - name = Spring.I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMin(h, h2)..")", + name = Spring.I18N("ui.resolutionswitcher.displays") .. " " .. display .. " + " .. display2 .. " (" .. w + w2 .. " x " .. mathMin(h, h2) .. ")", displayName = "", type = windowType.multimonitor, x = mathMin(x, x2), @@ -179,9 +185,9 @@ local function refreshScreenModes() -- the screenmode above was restricted to minimum height in case one display has lower vertical resolution if h ~= h2 then tableInsert(screenModes, { - display = #displays+1, -- not actual display number + display = #displays + 1, -- not actual display number actualDisplay = (x < x2 and display or display2), - name = Spring.I18N('ui.resolutionswitcher.displays').." " .. display .. " + " .. display2.." ("..w + w2 .." x "..mathMax(h, h2)..")", + name = Spring.I18N("ui.resolutionswitcher.displays") .. " " .. display .. " + " .. display2 .. " (" .. w + w2 .. " x " .. mathMax(h, h2) .. ")", displayName = "", type = windowType.multimonitor, x = mathMin(x, x2), @@ -198,9 +204,9 @@ local function refreshScreenModes() end -- only add the "Multi Display" option when there are valid display combos to choose from - for k,v in pairs(addedDisplayCombo) do - displays[#displays+1] = { - name = Spring.I18N('ui.resolutionswitcher.multidisplay'), + for k, v in pairs(addedDisplayCombo) do + displays[#displays + 1] = { + name = Spring.I18N("ui.resolutionswitcher.multidisplay"), width = 0, height = 0, hz = 0, @@ -214,7 +220,9 @@ local function refreshScreenModes() end local function changeScreenMode(index) - if index > #screenModes or index < 1 then return end + if index > #screenModes or index < 1 then + return + end local screenMode = screenModes[index] @@ -228,7 +236,7 @@ local function changeScreenMode(index) -- Windowed mode has a raptor-and-egg problem, where window borders can't be known until after switching to windowed mode -- This cannot be done in two consecutive SetWindowGeometry() calls, as there must be a two draw frame delay -- (one to write, one to read), before the values of GetWindowGeometry() are updated - local _, _, _, _ , borderTop, borderLeft, borderBottom, borderRight = Spring.GetWindowGeometry() + local _, _, _, _, borderTop, borderLeft, borderBottom, borderRight = Spring.GetWindowGeometry() local width = screenMode.width - borderLeft - borderRight local height = screenMode.height - borderTop - borderBottom Spring.SetWindowGeometry(screenMode.display, borderLeft, borderTop, width, height, false, false) @@ -242,8 +250,12 @@ local function changeScreenMode(index) end function widget:Update() - if firstPassDrawFrame == nil then return end - if Spring.GetDrawFrame() - firstPassDrawFrame <= 2 then return end -- 2 draw frame delay for engine to update window borders + if firstPassDrawFrame == nil then + return + end + if Spring.GetDrawFrame() - firstPassDrawFrame <= 2 then + return + end -- 2 draw frame delay for engine to update window borders changeScreenMode(screenModeIndex) end @@ -253,20 +265,20 @@ function widget:Initialize() displays = {} firstPassDrawFrame = nil screenModeIndex = 0 - + refreshScreenModes() - WG['screenMode'] = { } + WG["screenMode"] = {} - WG['screenMode'].GetDisplays = function() + WG["screenMode"].GetDisplays = function() return displays end - WG['screenMode'].GetScreenModes = function() + WG["screenMode"].GetScreenModes = function() return screenModes end - WG['screenMode'].SetScreenMode = function(index) + WG["screenMode"].SetScreenMode = function(index) local prevScreenmode = screenModeIndex screenModeIndex = index if screenModeIndex ~= prevScreenmode then diff --git a/luaui/Widgets/cmd_share_unit.lua b/luaui/Widgets/cmd_share_unit.lua index 789d4a870fe..e540b10354d 100644 --- a/luaui/Widgets/cmd_share_unit.lua +++ b/luaui/Widgets/cmd_share_unit.lua @@ -179,12 +179,12 @@ local function drawAoE(tx, ty, tz, selectedTeam) end local function findPlayerName(teamId) - local name = '' - if GetGameRulesParam('ainame_' .. teamId) then - name = I18N('ui.playersList.aiName', { name = GetGameRulesParam('ainame_' .. teamId) }) + local name = "" + if GetGameRulesParam("ainame_" .. teamId) then + name = I18N("ui.playersList.aiName", { name = GetGameRulesParam("ainame_" .. teamId) }) else local players = GetPlayerList(teamId) - name = (#players > 0) and GetPlayerInfo(players[1], false) or '------' + name = (#players > 0) and GetPlayerInfo(players[1], false) or "------" for _, pID in ipairs(players) do local pname, active, isspec = GetPlayerInfo(pID, false) @@ -213,10 +213,16 @@ local function drawName(teamId) font:Begin() font:SetTextColor(defaultColor) font:SetOutlineColor({ 0, 0, 0, 1 }) - font:Print(I18N("ui.quickShareToTarget.shareTo", { - playerColor = colourNames(teamId), - player = findPlayerName(teamId) - }), mouseX, textY, 24, "con") + font:Print( + I18N("ui.quickShareToTarget.shareTo", { + playerColor = colourNames(teamId), + player = findPlayerName(teamId), + }), + mouseX, + textY, + 24, + "con" + ) font:End() else font:Begin() @@ -225,7 +231,6 @@ local function drawName(teamId) font:Print(I18N("ui.quickShareToTarget.noTarget"), mouseX, textY, 24, "con") font:End() end - end local function isAlly(unitTeamId) @@ -283,7 +288,7 @@ local function getSelectedTeam() local tx, ty, tz, targetUnitID = getMouseTargetPosition() - if (not tx and not targetUnitID) then + if not tx and not targetUnitID then return nil end @@ -304,17 +309,17 @@ end function widget:DrawWorld() local targetX, targetY, targetZ, selectedTeam = getSelectedTeam() - if (not targetX) then + if not targetX then return end - drawAoE(targetX, targetY+10, targetZ, selectedTeam) + drawAoE(targetX, targetY + 10, targetZ, selectedTeam) end function widget:DrawScreen() local targetX, _, _, selectedTeam = getSelectedTeam() - if (not targetX) then + if not targetX then return end @@ -342,7 +347,7 @@ function widget:CommandNotify(cmdID, cmdParams, _) end ShareResources(targetTeamID, "units") - PlaySoundFile("beep4", 1, 'ui') + PlaySoundFile("beep4", 1, "ui") return false end end @@ -363,15 +368,15 @@ function widget:CommandsChanged() customCommands[#customCommands + 1] = { id = cmdQuickShareToTargetId, type = CMDTYPE.ICON_UNIT_OR_MAP, - name = 'Share Unit To Target', - cursor = 'settarget', - action = 'quicksharetotarget', + name = "Share Unit To Target", + cursor = "settarget", + action = "quicksharetotarget", } end end function widget:ViewResize(vsx, vsy) - font = WG['fonts'].getFont(2, 1.5) + font = WG["fonts"].getFont(2, 1.5) end function widget:Initialize() diff --git a/luaui/Widgets/cmd_skip_allied_upgrade.lua b/luaui/Widgets/cmd_skip_allied_upgrade.lua index f6ff4fc3f77..94756414eba 100644 --- a/luaui/Widgets/cmd_skip_allied_upgrade.lua +++ b/luaui/Widgets/cmd_skip_allied_upgrade.lua @@ -56,10 +56,14 @@ end function widget:Initialize() toggleIsActive = false - WG['skip_allied_upgrade'] = SkipAlliedUpgradeWidget + WG["skip_allied_upgrade"] = SkipAlliedUpgradeWidget - widgetHandler:AddAction("toggle_allied_upgrade", function() toggleIsActive = true end, nil, "p") - widgetHandler:AddAction("toggle_allied_upgrade", function() toggleIsActive = false end, nil, "r") + widgetHandler:AddAction("toggle_allied_upgrade", function() + toggleIsActive = true + end, nil, "p") + widgetHandler:AddAction("toggle_allied_upgrade", function() + toggleIsActive = false + end, nil, "r") end function widget:Shutdown() diff --git a/luaui/Widgets/cmd_state_remove.lua b/luaui/Widgets/cmd_state_remove.lua index 06477e90b97..d7ae27009f6 100644 --- a/luaui/Widgets/cmd_state_remove.lua +++ b/luaui/Widgets/cmd_state_remove.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "State Remover", - desc = "Removes 'return fire' and 'roam' states", - author = "Google Frog", - date = "Oct 2, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false + name = "State Remover", + desc = "Removes 'return fire' and 'roam' states", + author = "Google Frog", + date = "Oct 2, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end @@ -20,17 +20,16 @@ local CMD_MOVE_STATE = CMD.MOVE_STATE local excludedUnitsMovestate = {} for uDefID, uDef in pairs(UnitDefs) do - if uDef.deathExplosion == "nanoboom" then -- still nice to have on nanos so they will assist ally + if uDef.deathExplosion == "nanoboom" then -- still nice to have on nanos so they will assist ally excludedUnitsMovestate[uDefID] = true end end function widget:CommandNotify(id, params, options) - if id == CMD_FIRE_STATE then if params[1] == 1 then local units = spGetSelectedUnits() - for i=1,#units do + for i = 1, #units do spGiveOrderToUnit(units[i], CMD_FIRE_STATE, { 2 }, 0) end return true @@ -40,7 +39,7 @@ function widget:CommandNotify(id, params, options) if id == CMD_MOVE_STATE then if params[1] == 2 then local units = spGetSelectedUnits() - for i=1, #units do + for i = 1, #units do if excludedUnitsMovestate[spGetUnitDefID(units[i])] == nil then spGiveOrderToUnit(units[i], CMD_MOVE_STATE, { 0 }, 0) else @@ -50,5 +49,4 @@ function widget:CommandNotify(id, params, options) return true end end - end diff --git a/luaui/Widgets/cmd_state_reverse_toggle.lua b/luaui/Widgets/cmd_state_reverse_toggle.lua index 8626f4fc951..3a5405941eb 100644 --- a/luaui/Widgets/cmd_state_reverse_toggle.lua +++ b/luaui/Widgets/cmd_state_reverse_toggle.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "State Reverse Toggle", - desc = "Makes all buttons with 3 or more states reverse toggleable", - author = "Google Frog, Deadnight Warrior", - date = "Oct 2, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "State Reverse Toggle", + desc = "Makes all buttons with 3 or more states reverse toggleable", + author = "Google Frog, Deadnight Warrior", + date = "Oct 2, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local spGetSelectedUnits = Spring.GetSelectedUnits @@ -18,18 +18,17 @@ local spGetActiveCmdDesc = Spring.GetActiveCmdDesc local spGetCmdDescIndex = Spring.GetCmdDescIndex function widget:CommandNotify(id, params, options) - local index = spGetCmdDescIndex(id) if index then local comButton = spGetActiveCmdDesc(index) - if comButton and comButton.params and #comButton.params>3 then + if comButton and comButton.params and #comButton.params > 3 then if options.right then local units = spGetSelectedUnits() - local state = params[1] -2 - if state < 0 then + local state = params[1] - 2 + if state < 0 then state = state + #comButton.params - 1 end - for _,sid in ipairs(units) do + for _, sid in ipairs(units) do spGiveOrderToUnit(sid, id, { state }, 0) end return true diff --git a/luaui/Widgets/cmd_stop_selfd.lua b/luaui/Widgets/cmd_stop_selfd.lua index a19152b9920..75f58691e80 100644 --- a/luaui/Widgets/cmd_stop_selfd.lua +++ b/luaui/Widgets/cmd_stop_selfd.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Stop means Stop", - desc = "Cancels Self D orders when unit is given a stop command", - author = "enotseulB", - date = "GPL v3 or later", - license = "Feb 2015", - layer = 0, - enabled = true - } + return { + name = "Stop means Stop", + desc = "Cancels Self D orders when unit is given a stop command", + author = "enotseulB", + date = "GPL v3 or later", + license = "Feb 2015", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID @@ -20,15 +19,21 @@ local CMD_STOP = CMD.STOP local myTeamID = spGetMyTeamID() function widget:PlayerChanged(playerID) - myTeamID = spGetMyTeamID() + myTeamID = spGetMyTeamID() end function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions, playerID, fromSynced, fromLua) - if cmdID ~= CMD_STOP then return end - if not unitID then return end - if teamID ~= myTeamID then return end + if cmdID ~= CMD_STOP then + return + end + if not unitID then + return + end + if teamID ~= myTeamID then + return + end - if (Spring.GetUnitSelfDTime(unitID) > 0) then - Spring.GiveOrderToUnit(unitID, CMD.SELFD, {}, 0) - end -end \ No newline at end of file + if Spring.GetUnitSelfDTime(unitID) > 0 then + Spring.GiveOrderToUnit(unitID, CMD.SELFD, {}, 0) + end +end diff --git a/luaui/Widgets/cmd_take_proxy.lua b/luaui/Widgets/cmd_take_proxy.lua index 95ad58a6c04..0fadaaa7d11 100644 --- a/luaui/Widgets/cmd_take_proxy.lua +++ b/luaui/Widgets/cmd_take_proxy.lua @@ -2,25 +2,24 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Take Proxy", - desc = "Renames /luarules take2 to /take", - author = "BrainDamage", - date = "2012", - license = "WTFPL", - layer = 0, - enabled = true + name = "Take Proxy", + desc = "Renames /luarules take2 to /take", + author = "BrainDamage", + date = "2012", + license = "WTFPL", + layer = 0, + enabled = true, } end - local function TakeTeam() - Spring.SendCommands({"luarules take2"}) + Spring.SendCommands({ "luarules take2" }) end function widget:Initialize() - widgetHandler:AddAction("take2", TakeTeam, "Take control of units and resources from inactive players", 't') + widgetHandler:AddAction("take2", TakeTeam, "Take control of units and resources from inactive players", "t") end function widget:Shutdown() - widgetHandler:RemoveAction('take2') + widgetHandler:RemoveAction("take2") end diff --git a/luaui/Widgets/cmd_toggle_key.lua b/luaui/Widgets/cmd_toggle_key.lua index 673664e9f17..b1f5ed47208 100644 --- a/luaui/Widgets/cmd_toggle_key.lua +++ b/luaui/Widgets/cmd_toggle_key.lua @@ -13,10 +13,10 @@ function widget:GetInfo() end -- cmd, optLine, optWords, data, isRepeat, release, actions -function ToggleCMD(_ , optLine) - Spring.SetActiveCommand(optLine) +function ToggleCMD(_, optLine) + Spring.SetActiveCommand(optLine) end function widget:Initialize() - widgetHandler:AddAction("toggle", ToggleCMD, nil, "pr") -end \ No newline at end of file + widgetHandler:AddAction("toggle", ToggleCMD, nil, "pr") +end diff --git a/luaui/Widgets/cmd_transport_preserve_commands.lua b/luaui/Widgets/cmd_transport_preserve_commands.lua index bf34020333d..81650236fb6 100644 --- a/luaui/Widgets/cmd_transport_preserve_commands.lua +++ b/luaui/Widgets/cmd_transport_preserve_commands.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Preserve Commands", - desc = "Preserves a unit's command queue after it has been transported", - author = "Jazcash", - date = "October 2023", + name = "Preserve Commands", + desc = "Preserves a unit's command queue after it has been transported", + author = "Jazcash", + date = "October 2023", license = "idklmao", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end @@ -21,13 +21,12 @@ function widget:UnitLoaded(unitID) orders[unitID] = Spring.GetUnitCommands(unitID, -1) end - function widget:UnitUnloaded(unitID) - if (orders[unitID] and #orders[unitID]) then + if orders[unitID] and #orders[unitID] then local newOrders = {} for i, command in ipairs(orders[unitID]) do - if (#command.params >= 3) then + if #command.params >= 3 then local dist = math.huge if i == 1 then -- ditch first command if it's not near the starting point local x, y, z = Spring.GetUnitPosition(unitID) @@ -36,19 +35,18 @@ function widget:UnitUnloaded(unitID) dist = 0 end - if (dist <= distToIgnore) then + if dist <= distToIgnore then table.insert(newOrders, { command.id, command.params, command.options }) end end end - Spring.GiveOrderArrayToUnit( unitID , newOrders) + Spring.GiveOrderArrayToUnit(unitID, newOrders) orders[unitID] = nil end end - --------------------------------------------------------------- --- Housekeeping to manage the widget state --------------------------------------------------------------- diff --git a/luaui/Widgets/cmd_uikeys_loader.lua b/luaui/Widgets/cmd_uikeys_loader.lua index 5715d2ccd39..6f85cfdf5ef 100644 --- a/luaui/Widgets/cmd_uikeys_loader.lua +++ b/luaui/Widgets/cmd_uikeys_loader.lua @@ -2,18 +2,18 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Lua UiKeys loader", - desc = "Loads uikeys.txt file in LuaUI/Widgets to apply binds", - author = "Doo", - date = "2018", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, + name = "Lua UiKeys loader", + desc = "Loads uikeys.txt file in LuaUI/Widgets to apply binds", + author = "Doo", + date = "2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end function widget:Initialize() - local k = '' + local k = "" if VFS.FileExists("LuaUI/Widgets/uikeys.txt") then k = tostring(VFS.LoadFile("LuaUI/Widgets/uikeys.txt")) end diff --git a/luaui/Widgets/cmd_unit_mover.lua b/luaui/Widgets/cmd_unit_mover.lua index 92cc9c74d22..c3cb0e4ebdd 100644 --- a/luaui/Widgets/cmd_unit_mover.lua +++ b/luaui/Widgets/cmd_unit_mover.lua @@ -15,17 +15,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Unit Mover", - desc = "Allows combat engineers to use repeat when building mobile units (use 2 or more build spots)", - author = "TheFatController", - date = "Mar 20, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false + name = "Unit Mover", + desc = "Allows combat engineers to use repeat when building mobile units (use 2 or more build spots)", + author = "TheFatController", + date = "Mar 20, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -46,27 +45,27 @@ local moveUnitsDefs = {} local gameStarted function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end - for unitDefID,unitDef in pairs(UnitDefs) do + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end + for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.canMove and unitDef.speed > 0 then --mobile builder - for _,buildeeDefID in pairs(unitDef.buildOptions) do + for _, buildeeDefID in pairs(unitDef.buildOptions) do local buildeeDef = UnitDefs[buildeeDefID] if buildeeDef.canMove and buildeeDef.speed > 0 then -- can build a mobile unit engineerDefs[unitDefID] = true -- mark the engineer @@ -76,16 +75,14 @@ function widget:Initialize() end end - local units = Spring.GetTeamUnits(myTeamID); - for i=1,#units do + local units = Spring.GetTeamUnits(myTeamID) + for i = 1, #units do local unitID = units[i] - widget:UnitCreated(unitID,GetUnitDefID(unitID),myTeamID) + widget:UnitCreated(unitID, GetUnitDefID(unitID), myTeamID) end end - - -function widget:UnitCreated(unitID, unitDefID, unitTeam,builderID) +function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) if unitTeam ~= myTeamID then return end @@ -94,9 +91,9 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam,builderID) end if builderID and moveUnitsDefs[unitDefID] and engineers[builderID] then local x, y, z = GetUnitPosition(unitID) - local dx,dy,dz = GetUnitDirection(unitID) + local dx, dy, dz = GetUnitDirection(unitID) local moveDist = 50 - GiveOrderToUnit(unitID, CMD_MOVE, {x+dx*moveDist, y, z+dz*moveDist}, 0) + GiveOrderToUnit(unitID, CMD_MOVE, { x + dx * moveDist, y, z + dz * moveDist }, 0) end end @@ -114,7 +111,4 @@ function widget:UnitTaken(unitID, unitDefID, oldTeamID, newTeam) widget:UnitCreated(unitID, unitDefID, newTeam) end - - - -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/cmd_unitgroup_clear_selection_on_empty.lua b/luaui/Widgets/cmd_unitgroup_clear_selection_on_empty.lua index fbf8b2524fb..df93bb5393a 100644 --- a/luaui/Widgets/cmd_unitgroup_clear_selection_on_empty.lua +++ b/luaui/Widgets/cmd_unitgroup_clear_selection_on_empty.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "2021-10-10", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -17,13 +17,17 @@ local spSelectUnitMap = Spring.SelectUnitMap local spGetModKeyState = Spring.GetModKeyState local function ClearSelectionIfGroupSelected(groupIndex) - if spGetGroupUnitsCount(groupIndex) > 0 then return end + if spGetGroupUnitsCount(groupIndex) > 0 then + return + end spSelectUnitMap({}, false) end local function OnGroupSelected(_, _, args) - if not args then return end + if not args then + return + end local unitGroupArgIdx = 1 -- variant: if "select" is first argument, then unit group is second @@ -34,7 +38,9 @@ local function OnGroupSelected(_, _, args) local groupIndex = tonumber(args[unitGroupArgIdx]) -- 2nd arg can also be e.g. "set" - but we only want to react to a selection - if not groupIndex then return end + if not groupIndex then + return + end ClearSelectionIfGroupSelected(groupIndex) end @@ -44,11 +50,15 @@ local function OnGroupNSelected(cmd) -- When ctrl engine handles for group assignment, when any other mod key let -- it be handled elsewhere - if ctrl or alt or meta or shift then return end + if ctrl or alt or meta or shift then + return + end local groupIndex = tonumber(string.sub(cmd, 6, 6)) - if not groupIndex then return end + if not groupIndex then + return + end ClearSelectionIfGroupSelected(groupIndex) end @@ -57,16 +67,16 @@ local function ManageAction(doAdd) -- Support old group actions in format groupN for i = 0, 9 do if doAdd then - widgetHandler:AddAction("group" .. i, OnGroupNSelected, nil, 'p') + widgetHandler:AddAction("group" .. i, OnGroupNSelected, nil, "p") else - widgetHandler:RemoveAction("group" .. i, OnGroupNSelected, 'p') + widgetHandler:RemoveAction("group" .. i, OnGroupNSelected, "p") end end if doAdd then - widgetHandler:AddAction("group", OnGroupSelected, nil, 'p') + widgetHandler:AddAction("group", OnGroupSelected, nil, "p") else - widgetHandler:RemoveAction("group", OnGroupSelected, 'p') + widgetHandler:RemoveAction("group", OnGroupSelected, "p") end end diff --git a/luaui/Widgets/dbg_ceg_auto_reloader.lua b/luaui/Widgets/dbg_ceg_auto_reloader.lua index 1e0c4215057..4ec825c018f 100644 --- a/luaui/Widgets/dbg_ceg_auto_reloader.lua +++ b/luaui/Widgets/dbg_ceg_auto_reloader.lua @@ -16,7 +16,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local tableInsert = table.insert @@ -30,22 +29,22 @@ local mouseOffscreen = select(6, spGetMouseState()) ---The entire CEG bit -- When a CEG file is changed: -- Try parse: - -- Try Validate: - -- If valid: - -- Print changes - -- Update CEG - -- spawn ceg at cursor - -- else: - -- Print validation error +-- Try Validate: +-- If valid: +-- Print changes +-- Update CEG +-- spawn ceg at cursor +-- else: +-- Print validation error -- except: - -- Print syntax error +-- Print syntax error -local cegLibrary={} --maps cegname to cegdef +local cegLibrary = {} --maps cegname to cegdef local cegFileNames = {} -- maps cegname to filename local projectileTexures = {} -- maps texture name to filename local spawnerDefs = { - CExpGenSpawner = { + CExpGenSpawner = { info = [[This is the closest thing CEG has to a function call. Instead of creating a graphical effect on its own, it creates another CEG. Suggested Use If you use a spawner a lot of times, you may want to make it a separate CEG to avoid having to copy-paste many times. @@ -53,9 +52,9 @@ local spawnerDefs = { The spawned CEG still checks conditions, so if you want to, say, spawn an effect only if it is in water and doesn't hit a unit, you can give the CExpGenSpawner nounit = 1; and the spawned CEG water = 1;. This allows you to give a set of spawners the same (and possibly random) direction. You can animate an explosion flip-book style using delays and several bitmaps.]], - properties = {'delay', 'damage', 'explosionGenerator'} + properties = { "delay", "damage", "explosionGenerator" }, }, - CBitmapMuzzleFlame = { + CBitmapMuzzleFlame = { info = [[This creates three rectangular textures at right angles to each other. The frontTexture has dir as its normal. Suggested Use @@ -63,9 +62,9 @@ local spawnerDefs = { You can use an upward-pointing CBitmapMuzzleFlame as a simple splash of water or dirt. Railgun trails. This is the only class that both obeys perspective and allows for a custom texture.]], - properties = {'sideTexture', 'frontTexture', 'colorMap', 'size', 'length', 'sizeGrowth', 'ttl', 'frontOffset'} + properties = { "sideTexture", "frontTexture", "colorMap", "size", "length", "sizeGrowth", "ttl", "frontOffset" }, }, - CExploSpikeProjectile= { + CExploSpikeProjectile = { info = [[This creates a glowy spike. Note that the spike is two sided, i.e., symmetric about the position of the spawner. Suggested Use Anything glowy. @@ -73,55 +72,55 @@ local spawnerDefs = { Long and thin spikes will look spiky; meanwhile, shorter and wider spikes look more blobby. The colors of spikes add together, so if you have several spikes and all three color channels are non-zero, it will be white in the center. The length growth of the spike depends on the norm of the dir vector. The spike does not grow in width.]], - properties = {'length', 'lenghGrowth', 'width', 'alpha', 'alphaDecay', 'color'} + properties = { "length", "lenghGrowth", "width", "alpha", "alphaDecay", "color" }, }, - CHeatCloudProjectile={ + CHeatCloudProjectile = { info = [[Creates an expanding sprite. Simple but effective. Suggested Use As the main background to an explosion.]], - properties = {'heat', 'maxheat', 'heatfalloff', 'size', 'sizeMod', 'sizeModMod', 'texture'}, + properties = { "heat", "maxheat", "heatfalloff", "size", "sizeMod", "sizeModMod", "texture" }, }, - CSimpleParticleSystem={ + CSimpleParticleSystem = { info = [[Creates a sprite that can undergo complex motion. Probably the most versatile class. Suggested Use Anything moving that is not doing so at constant velocity. If you want something that expands (or shrinks) to some size then stops, set sizeMod to something less than 1, and sizeGrowth to something positive. The particle will grow to a size equal to sizeGrowth / (1 - sizeMod) and stop. The smaller sizeMod is, the faster it will reach this size.]], - properties = {'emitVector', 'emitRot', 'emitRotSpread', 'emitMul', 'particleSpeed', 'particleSpeedSpread', 'gravity', 'airdrag', 'particleSize', 'particleSizeSpread', 'sizeGrowth', 'sizeMod', 'directional', 'texture', 'colorMap', 'numParticles', 'particleLife', 'particleLifeSpread'} + properties = { "emitVector", "emitRot", "emitRotSpread", "emitMul", "particleSpeed", "particleSpeedSpread", "gravity", "airdrag", "particleSize", "particleSizeSpread", "sizeGrowth", "sizeMod", "directional", "texture", "colorMap", "numParticles", "particleLife", "particleLifeSpread" }, }, - CSpherePartSpawner={ + CSpherePartSpawner = { info = [[Draws an expanding sphere. Suggested Use Looks like a shockwave.]], - properties = {'alpha', 'ttl', 'expansionSpeed', 'color'} + properties = { "alpha", "ttl", "expansionSpeed", "color" }, }, - CSimpleGroundFlash={ + CSimpleGroundFlash = { info = [[Draws an expanding ground texture. Suggested Use A short groundflash (~8 frames) is good for any explosion that gives off light. You can also use a longer groundflash to suggest the ground is glowing from heat]], - properties = {'size', 'sizeGrowth', 'ttl', 'texture', 'colorMap'} + properties = { "size", "sizeGrowth", "ttl", "texture", "colorMap" }, }, - CStandardGroundFlash={ + CStandardGroundFlash = { info = [[If you name a spawner "groundflash," it will always generate a standard groundflash. Suggested Use A short groundflash (~8 frames) is good for any explosion that gives off light. You can also use a longer groundflash to suggest the ground is glowing from heat. ]], - properties = {'flashSize', 'flashAlpha', 'circleGrowth', 'circleAlpha', 'ttl', 'color'} + properties = { "flashSize", "flashAlpha", "circleGrowth", "circleAlpha", "ttl", "color" }, }, - CSmokeProjectile2={ + CSmokeProjectile2 = { info = [[Particles that begin with a hard-coded yellow-red colorfade and then fade to monochrom. (shades of grey) Movement is influenced by the random wind. Finer details of visual and position update are best explained by looking at the formulas in CSmokeProjectile2::Update() & CSmokeProjectile2::Draw() ]], - properties = {'color', 'size', 'ageSpeed', 'glowFallof', 'wantedPos', 'speed', 'texture'} + properties = { "color", "size", "ageSpeed", "glowFallof", "wantedPos", "speed", "texture" }, }, - CSmokeProjectile={ + CSmokeProjectile = { info = [[Monochrome particles that fade out. A more "primitive" version of CSmokeProjectile2. No hardcoded red-yellow start but it misses wantedPos to tweak the look a bit more detailed. Suggested Use Smoke. For a nicer stream of smoke spawn it frequently over multiple frames, otherwise it looks rather bland. ]], - properties = {'color', 'size', 'ageSpeed', 'speed', 'texture'} + properties = { "color", "size", "ageSpeed", "speed", "texture" }, }, - CWakeProjectile={ + CWakeProjectile = { info = [[New Wake ]], - properties = {'startsize', 'sizeexpansion', 'alpha', 'alphafalloff','fadeuptime', 'texture'} + properties = { "startsize", "sizeexpansion", "alpha", "alphafalloff", "fadeuptime", "texture" }, }, } @@ -133,16 +132,14 @@ local isBoolean = function(value) return value == true or value == false or value == 0 or value == 1 end - local function isSpawner(value) if spawnerDefs[value] then return spawnerDefs[value] else - return false, "Not a spawner class:" ..tostring(value) + return false, "Not a spawner class:" .. tostring(value) end end - -- Define a function to parse and evaluate CEG expressions -- Returns result, errorcode local function parseCEGExpression(inputCegString, numFloats, countIndex, damage) @@ -156,10 +153,10 @@ local function parseCEGExpression(inputCegString, numFloats, countIndex, damage) -- Use gmatch to find all elements separated by commas local numExpressions = 0 - for expression in string.gmatch(inputCegString, '([^,]+)') do + for expression in string.gmatch(inputCegString, "([^,]+)") do numExpressions = numExpressions + 1 local result = 0 - local currentOp = '+' + local currentOp = "+" -- Initialize buffer with zeroes for i = 0, 15 do buffer[i] = 0 @@ -168,98 +165,96 @@ local function parseCEGExpression(inputCegString, numFloats, countIndex, damage) local i = 1 while i <= #expression do - local char = expression:sub(i,i) + local char = expression:sub(i, i) - if char == ' ' then + if char == " " then i = i + 1 - elseif char == 'i' or char == 'r' or char == 'd' or char == 'm' or - char == 'k' or char == 's' or char == 'y' or char == 'x' or - char == 'a' or char == 'p' or char == 'q' or char == '+' then + elseif char == "i" or char == "r" or char == "d" or char == "m" or char == "k" or char == "s" or char == "y" or char == "x" or char == "a" or char == "p" or char == "q" or char == "+" then currentOp = char i = i + 1 - elseif tonumber(char) or char == '-' or char == '.' then + elseif tonumber(char) or char == "-" or char == "." then local operandStr = "" local hasDecimal = false - while i <= #expression and (tonumber(expression:sub(i,i)) or expression:sub(i,i) == '.' or expression:sub(i,i) == '-') do - if expression:sub(i,i) == '.' then + while i <= #expression and (tonumber(expression:sub(i, i)) or expression:sub(i, i) == "." or expression:sub(i, i) == "-") do + if expression:sub(i, i) == "." then if hasDecimal then - return nil, "Invalid syntax: multiple decimals in a number:"..tostring(operandStr) + return nil, "Invalid syntax: multiple decimals in a number:" .. tostring(operandStr) end hasDecimal = true end - operandStr = operandStr .. expression:sub(i,i) + operandStr = operandStr .. expression:sub(i, i) i = i + 1 end local operand = tonumber(operandStr) if not operand then - return nil, "Invalid number format:"..tostring(operandStr) + return nil, "Invalid number format:" .. tostring(operandStr) end - if currentOp == 'i' then + if currentOp == "i" then result = result + (operand * countIndex) - elseif currentOp == 'r' then + elseif currentOp == "r" then result = result + (operand * math.random()) - elseif currentOp == 'd' then + elseif currentOp == "d" then result = result + (operand * damage) - elseif currentOp == 'm' then + elseif currentOp == "m" then result = result + (operand % 1) - elseif currentOp == 'k' then + elseif currentOp == "k" then result = result + math.floor(operand) - elseif currentOp == 's' then + elseif currentOp == "s" then result = result + math.sin(operand) - elseif currentOp == 'y' then + elseif currentOp == "y" then if operand < 0 or operand > 15 then - return nil, "Invalid buffer index:"..tostring(operand) + return nil, "Invalid buffer index:" .. tostring(operand) end buffer[operand] = result result = 0 - elseif currentOp == 'x' then + elseif currentOp == "x" then if operand < 0 or operand > 15 then - return nil, "Invalid buffer index:"..tostring(operand) + return nil, "Invalid buffer index:" .. tostring(operand) end result = result * buffer[operand] - elseif currentOp == 'a' then + elseif currentOp == "a" then if operand < 0 or operand > 15 then - return nil, "Invalid buffer index:"..tostring(operand) + return nil, "Invalid buffer index:" .. tostring(operand) end result = result + buffer[operand] - elseif currentOp == 'p' then + elseif currentOp == "p" then result = result ^ operand - elseif currentOp == 'q' then + elseif currentOp == "q" then if operand < 0 or operand > 15 then - return nil, "Invalid buffer index:"..tostring(operand) + return nil, "Invalid buffer index:" .. tostring(operand) end result = result ^ buffer[operand] else result = result + operand end - currentOp = '+' + currentOp = "+" else - return nil, "Invalid character found:"..char + return nil, "Invalid character found:" .. char end end tableInsert(results, result) end - if numFloats and (numFloats ~= numExpressions) then - return nil, "Invalid number of floats, expected:"..tostring(numFloats) .. " got:"..tostring(numExpressions) + if numFloats and (numFloats ~= numExpressions) then + return nil, "Invalid number of floats, expected:" .. tostring(numFloats) .. " got:" .. tostring(numExpressions) end - return results + return results end - - local function isFloat(value) - if type(value) == 'number' then + if type(value) == "number" then return true end - if type(value) == 'string' then + if type(value) == "string" then local numstring = tonumber(value) if numstring then return true else local res, err = parseCEGExpression(value, 1) - if err then return false else + if err then + return false + else return true end end @@ -269,21 +264,22 @@ end local function isInteger(value) -- seems like cegops are allowed here too! local res, err = isFloat(value) - if res then return true end - if type(value) == 'number' then + if res then + return true + end + if type(value) == "number" then if value % 1 == 0 then return true else - return false, "Number is not an integer:"..tostring(value) + return false, "Number is not an integer:" .. tostring(value) end else - return false, "Value "..tostring(value).. " is not a number." + return false, "Value " .. tostring(value) .. " is not a number." end end - local function isFloat3(value) - if value == 'dir' then + if value == "dir" then return true end return parseCEGExpression(value, 3) @@ -296,15 +292,17 @@ end -- TODO FIXME: local generatorNames = {} local function isExplosionGenerator(value) - if type(value) == 'string' then - if true then return true end -- FIXME !!!!! names are only valid after parsing all of them + if type(value) == "string" then + if true then + return true + end -- FIXME !!!!! names are only valid after parsing all of them if generatorNames[value] then return true else - if (string.sub(value,1,7) == 'custom:') and generatorNames[string.sub(value,8)] then + if (string.sub(value, 1, 7) == "custom:") and generatorNames[string.sub(value, 8)] then return true else - return false, "Explosion generator "..tostring(value) .. " does not exist." + return false, "Explosion generator " .. tostring(value) .. " does not exist." end end return true @@ -313,22 +311,19 @@ end -- fuck me 'nil' and 'none' and 'null' are valid texture names? local function isValidTexture(value) - if (type(value) == 'string' and (projectileTexures[value] or projectileTexures[string.lower(value)] )) - or value == 'none' or value == 'nil' or value == 'null' then + if (type(value) == "string" and (projectileTexures[value] or projectileTexures[string.lower(value)])) or value == "none" or value == "nil" or value == "null" then return true else - if (type(value) == 'string') and (projectileTexures[value..'-anim'] or projectileTexures[string.lower(value)..'-anim']) then + if (type(value) == "string") and (projectileTexures[value .. "-anim"] or projectileTexures[string.lower(value) .. "-anim"]) then return true end return false, "Texture does not exist in resources.lua" end - end - local function isColorMapValid(colormap) if type(colormap) ~= "string" then - return false, 'Colormap must be a string:'..tostring(colormap) + return false, "Colormap must be a string:" .. tostring(colormap) end local colorMap = {} local colorMapParts = {} @@ -336,408 +331,404 @@ local function isColorMapValid(colormap) tableInsert(colorMapParts, color) end if #colorMapParts % 4 ~= 0 then - return false, 'Colormap must have a multiple of 4 floats but has:'..tostring(colorMapParts) + return false, "Colormap must have a multiple of 4 floats but has:" .. tostring(colorMapParts) end for i = 1, #colorMapParts, 4 do local r = tonumber(colorMapParts[i]) - local g = tonumber(colorMapParts[i+1]) - local b = tonumber(colorMapParts[i+2]) - local a = tonumber(colorMapParts[i+3]) + local g = tonumber(colorMapParts[i + 1]) + local b = tonumber(colorMapParts[i + 2]) + local a = tonumber(colorMapParts[i + 3]) if not r or not g or not b or not a then - return false, 'Colormap must have 4 floats:'..tostring(colorMap) + return false, "Colormap must have 4 floats:" .. tostring(colorMap) end if r < 0 or r > 1 or g < 0 or g > 1 or b < 0 or b > 1 or a < 0 or a > 1 then - return false, 'Colormap values must be between 0 and 1:'..tostring(colormap) + return false, "Colormap values must be between 0 and 1:" .. tostring(colormap) end end return true end - local cegDefTemplate = { class = { - type = 'string', - default = 'CSimpleParticleSystem', - note = 'The class of the CEG. This determines the graphical effect that is created. The available classes are:', + type = "string", + default = "CSimpleParticleSystem", + note = "The class of the CEG. This determines the graphical effect that is created. The available classes are:", validator = isSpawner, }, - -- Explosion Level Tags useDefaultExplosions = { - type = 'bool', + type = "bool", default = false, - note = 'If this is set, the CEG will use the default explosion (based on damage and area of effect) in addition to any spawners you define. The default explosions are sometimes very performance heavy, especially for large damage values (leading to higher particle counts)', + note = "If this is set, the CEG will use the default explosion (based on damage and area of effect) in addition to any spawners you define. The default explosions are sometimes very performance heavy, especially for large damage values (leading to higher particle counts)", validator = isBoolean, }, -- Spawner Level Tags spawnerName = { - type = 'string', - default = 'spawner_name', - note = 'Each spawner has a class that determines what kind of graphical effect it creates. Spring has a number of standard classes that you can choose from. Currently available classes are:', + type = "string", + default = "spawner_name", + note = "Each spawner has a class that determines what kind of graphical effect it creates. Spring has a number of standard classes that you can choose from. Currently available classes are:", validator = isSpawner, }, count = { - type = 'int', + type = "int", default = 1, - note = 'The count determines the number of times the spawner will run.', + note = "The count determines the number of times the spawner will run.", validator = isInteger, }, -- Visibility Conditions air = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if at least 20 elmos above ground/sea level.', + note = "The CEG will run if at least 20 elmos above ground/sea level.", validator = isBoolean, }, water = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if in water to a depth of -5 elmos.', + note = "The CEG will run if in water to a depth of -5 elmos.", validator = isBoolean, }, underwater = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if under water deeper than 5 elmos.', + note = "The CEG will run if under water deeper than 5 elmos.", validator = isBoolean, }, ground = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if less than 20 elmos above ground.', + note = "The CEG will run if less than 20 elmos above ground.", validator = isBoolean, }, unit = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if the weapon hits a unit.', + note = "The CEG will run if the weapon hits a unit.", validator = isBoolean, }, nounit = { - type = 'bool', + type = "bool", default = false, - note = 'The CEG will run if the weapon does not hit a unit.', + note = "The CEG will run if the weapon does not hit a unit.", validator = isBoolean, }, -- Class Level Tags alwaysVisible = { - type = 'bool', + type = "bool", default = false, - note = 'If true, the spawner is always visible, ignoring LoS. Note that prior to 98.0 this did not work correctly.', + note = "If true, the spawner is always visible, ignoring LoS. Note that prior to 98.0 this did not work correctly.", validator = isBoolean, }, useAirLos = { - type = 'bool', + type = "bool", default = false, - note = 'Whether the spawner uses air LoS to determine if it is visible. This may allow the spawner to be seen from a further distance than normal.', + note = "Whether the spawner uses air LoS to determine if it is visible. This may allow the spawner to be seen from a further distance than normal.", validator = isBoolean, }, pos = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'The initial position vector of the spawner.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "The initial position vector of the spawner.", validator = isFloat3, }, speed = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'The initial speed vector of the spawner.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "The initial speed vector of the spawner.", validator = isFloat3, }, dir = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'The initial direction vector of the spawner.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "The initial direction vector of the spawner.", validator = isFloat3, }, -- CExpGenSpawner delay = { - type = 'int', + type = "int", default = 1, - note = 'How long to wait (in frames?) before spawning the CEG.', + note = "How long to wait (in frames?) before spawning the CEG.", validator = isInteger, }, damage = { - type = 'float', + type = "float", default = 0.0, - note = 'The CEG will be called with this damage. The CEG doesn\'t actually deal any damage, but you can use this as a parameter and read it using the \'d\' operator.', + note = "The CEG will be called with this damage. The CEG doesn't actually deal any damage, but you can use this as a parameter and read it using the 'd' operator.", validator = isFloat, }, explosionGenerator = { - type = 'string', - default = '', - note = 'The name of the CEG you want to spawn.', + type = "string", + default = "", + note = "The name of the CEG you want to spawn.", validator = isExplosionGenerator, }, -- CBitmapMuzzleFlame sideTexture = { - type = 'string', - default = '', - note = 'Texture as viewed from the side.', + type = "string", + default = "", + note = "Texture as viewed from the side.", validator = isValidTexture, }, frontTexture = { - type = 'string', - default = '', - note = 'Texture as viewed from the front.', + type = "string", + default = "", + note = "Texture as viewed from the front.", validator = isValidTexture, }, colorMap = { - type = 'string', - default = '', - note = 'See CColorMap.', + type = "string", + default = "", + note = "See CColorMap.", validator = isColorMapValid, }, size = { - type = 'float', + type = "float", default = 0.0, - note = 'The initial width of the muzzle flame.', + note = "The initial width of the muzzle flame.", validator = isFloat, }, length = { - type = 'float', + type = "float", default = 0.0, - note = 'The initial length of the muzzle flame.', + note = "The initial length of the muzzle flame.", validator = isFloat, }, sizeGrowth = { - type = 'float', + type = "float", default = 0.0, - note = 'By the end of its life, the muzzle flame grows to 1 + sizeGrowth times its initial size and length. The flame grows quickly at first and more slowly toward the end.', + note = "By the end of its life, the muzzle flame grows to 1 + sizeGrowth times its initial size and length. The flame grows quickly at first and more slowly toward the end.", validator = isFloat, }, ttl = { - type = 'int', + type = "int", default = 0, - note = 'How long the muzzle flame lasts.', + note = "How long the muzzle flame lasts.", validator = isInteger, }, frontOffset = { - type = 'float', + type = "float", default = 0.0, - note = 'Where the frontTexture is along the length of the muzzle flame. 0 means it is in the back, 1 is in the front.', + note = "Where the frontTexture is along the length of the muzzle flame. 0 means it is in the back, 1 is in the front.", validator = isFloat, }, -- CExploSpikeProjectile lenghGrowth = { - type = 'float', + type = "float", default = 0.0, - note = 'How much the length increases by per update.', + note = "How much the length increases by per update.", validator = isFloat, }, width = { - type = 'float', + type = "float", default = 0.0, - note = 'Half the initial width of of the spike. This is an absolute value.', + note = "Half the initial width of of the spike. This is an absolute value.", validator = isFloat, }, alpha = { - type = 'float', + type = "float", default = 0.0, - note = 'The starting alpha of the spike.', + note = "The starting alpha of the spike.", validator = isFloat, }, alphaDecay = { - type = 'float', + type = "float", default = 0.0, - note = 'How quickly the alpha of the spike decreases.', + note = "How quickly the alpha of the spike decreases.", validator = isFloat, }, color = { - type = 'float[3]', - default = {1.0, 0.8, 0.5}, - note = 'The color of the spike.', + type = "float[3]", + default = { 1.0, 0.8, 0.5 }, + note = "The color of the spike.", validator = isFloat3, }, -- CHeatCloudProjectile heat = { - type = 'float', + type = "float", default = 0.0, - note = 'The heat of the cloud.', + note = "The heat of the cloud.", validator = isFloat, }, maxheat = { - type = 'float', + type = "float", default = 0.0, - note = 'The maximum heat of the cloud.', + note = "The maximum heat of the cloud.", validator = isFloat, }, heatfalloff = { - type = 'float', + type = "float", default = 0.0, - note = 'How quickly the heat of the cloud decreases.', + note = "How quickly the heat of the cloud decreases.", validator = isFloat, }, sizeMod = { - type = 'float', + type = "float", default = 0.0, - note = 'The size of the heatcloud is multiplied by 1 - sizeMod.', + note = "The size of the heatcloud is multiplied by 1 - sizeMod.", validator = isFloat, }, sizeModMod = { - type = 'float', + type = "float", default = 0.0, - note = 'Each frame, sizeMod is multiplied by sizeModMod.', + note = "Each frame, sizeMod is multiplied by sizeModMod.", validator = isFloat, }, texture = { - type = 'string', - default = 'heatcloud', - note = 'The texture used for the heatcloud.', + type = "string", + default = "heatcloud", + note = "The texture used for the heatcloud.", validator = isValidTexture, }, emitVector = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'The initial direction vector in which the particle is emitted. When spawning CEGs via EmitSfx you can make the particles go into the direction of the emiting piece with emitvector = dir. This is useful for e.g. fire coming out of a gun barrel.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "The initial direction vector in which the particle is emitted. When spawning CEGs via EmitSfx you can make the particles go into the direction of the emiting piece with emitvector = dir. This is useful for e.g. fire coming out of a gun barrel.", validator = isFloat3, }, emitRot = { - type = 'float', + type = "float", default = 0.0, - note = 'At what angle to emit the particle relative to emitVector. 0 means that the particle will be emitted in emitVector\'s direction; 180 will emit the particle in the opposite direction. 90 will emit the particle in a random direction perpendicular to emitVector, which is good for creating rings.', + note = "At what angle to emit the particle relative to emitVector. 0 means that the particle will be emitted in emitVector's direction; 180 will emit the particle in the opposite direction. 90 will emit the particle in a random direction perpendicular to emitVector, which is good for creating rings.", validator = isFloat, }, emitRotSpread = { - type = 'float', + type = "float", default = 0.0, - note = 'For each particle, a random number between 0 and emitRotSpread is added to the emitRot.', + note = "For each particle, a random number between 0 and emitRotSpread is added to the emitRot.", validator = isFloat, }, emitMul = { - type = 'float[3]', - default = {1.0, 1.0, 1.0}, - note = 'Scales the initial particle velocity; for this property, +y is considered to be in the direction of emitVector. Good if you want to create an egg-shaped explosion.', + type = "float[3]", + default = { 1.0, 1.0, 1.0 }, + note = "Scales the initial particle velocity; for this property, +y is considered to be in the direction of emitVector. Good if you want to create an egg-shaped explosion.", validator = isFloat3, }, particleSpeed = { - type = 'float', + type = "float", default = 0.0, - note = 'The particle\'s initial speed.', + note = "The particle's initial speed.", validator = isFloat, }, particleSpeedSpread = { - type = 'float', + type = "float", default = 0.0, - note = 'For each particle, a random number between 0 and particleSpeedSpread is added to the particleSpeed.', + note = "For each particle, a random number between 0 and particleSpeedSpread is added to the particleSpeed.", validator = isFloat, }, gravity = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'This will be added to the particle\'s velocity every frame.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "This will be added to the particle's velocity every frame.", validator = isFloat3, }, airdrag = { - type = 'float', + type = "float", default = 0.0, - note = 'The particle\'s velocity is multiplied by this every frame.', + note = "The particle's velocity is multiplied by this every frame.", validator = isFloat, }, particleSize = { - type = 'float', + type = "float", default = 0.0, - note = 'The initial size of the particle.', + note = "The initial size of the particle.", validator = isFloat, }, particleSizeSpread = { - type = 'float', + type = "float", default = 0.0, - note = 'For each particle, a random number between 0 and particleSizeSpread is added to the particleSize.', + note = "For each particle, a random number between 0 and particleSizeSpread is added to the particleSize.", validator = isFloat, }, directional = { - type = 'bool', + type = "bool", default = false, - note = 'If true, the particle will point in the direction it is moving.', + note = "If true, the particle will point in the direction it is moving.", validator = isBoolean, }, numParticles = { - type = 'int', + type = "int", default = 0, - note = 'How many particles to create. This is not the same as count; if you spawn multiple particles using count, any CEG:Operators will be re-evaluated for each particle, whereas if you use numParticles they will not be. However, the spread properties are evaluated separately for each particle regardless of which one you use.', + note = "How many particles to create. This is not the same as count; if you spawn multiple particles using count, any CEG:Operators will be re-evaluated for each particle, whereas if you use numParticles they will not be. However, the spread properties are evaluated separately for each particle regardless of which one you use.", validator = isInteger, }, particleLife = { - type = 'float', + type = "float", default = 0.0, - note = 'How long each particle lasts.', + note = "How long each particle lasts.", validator = isFloat, }, particleLifeSpread = { - type = 'float', + type = "float", default = 0.0, - note = 'For each particle, a random number between 0 and particleLifeSpread is added to the particleLife.', + note = "For each particle, a random number between 0 and particleLifeSpread is added to the particleLife.", validator = isFloat, }, -- CSpherePartSpawner expansionSpeed = { - type = 'float', + type = "float", default = 0.0, - note = 'How quickly the sphere expands.', + note = "How quickly the sphere expands.", validator = isFloat, }, - -- CStandardGroundFlash flashSize = { - type = 'float', + type = "float", default = 0.0, - note = 'The radius of the groundflash.', + note = "The radius of the groundflash.", validator = isFloat, }, flashAlpha = { - type = 'float', + type = "float", default = 0.0, - note = 'How transparent the groundflash is. Generally the higher the brighter.', + note = "How transparent the groundflash is. Generally the higher the brighter.", validator = isFloat, }, circleGrowth = { - type = 'float', + type = "float", default = 0.0, - note = 'A groundflash can have an additional circle that expands outwards. This controls how fast the circle grows.', + note = "A groundflash can have an additional circle that expands outwards. This controls how fast the circle grows.", validator = isFloat, }, circleAlpha = { - type = 'float', + type = "float", default = 0.0, - note = 'How transparent the circle is.', + note = "How transparent the circle is.", validator = isFloat, }, - --CSmokeProjectile2 ageSpeed = { - type = 'float', + type = "float", default = 0.5, - note = 'How fast the particle ages. Every frame: age += ageSpeed The particle is deleted at if (age > 1)', + note = "How fast the particle ages. Every frame: age += ageSpeed The particle is deleted at if (age > 1)", validator = isFloat, }, glowFalloff = { - type = 'float', + type = "float", default = 0.0, - note = 'How fast the particle fades to monochrom.', + note = "How fast the particle fades to monochrom.", validator = isFloat, }, wantedPos = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'In which direction the smoke tends to drift. Less effective in y-coordinate and influenced by random wind.', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "In which direction the smoke tends to drift. Less effective in y-coordinate and influenced by random wind.", validator = isFloat3, }, --[[ @@ -747,62 +738,55 @@ local cegDefTemplate = { alphafalloff = 0.5, fadeuptime = 2, texture = fogdirty, - ]]--#region + ]] + --#region startsize = { - type = 'float', + type = "float", default = 0.0, - note = 'The initial size of the smoke particle.', + note = "The initial size of the smoke particle.", validator = isFloat, }, sizeexpansion = { - type = 'float', + type = "float", default = 0.0, - note = 'How quickly the smoke particle expands.', + note = "How quickly the smoke particle expands.", validator = isFloat, }, alphafalloff = { - type = 'float', + type = "float", default = 0.0, - note = 'How quickly the alpha of the smoke particle decreases.', + note = "How quickly the alpha of the smoke particle decreases.", validator = isFloat, }, fadeuptime = { - type = 'float', + type = "float", default = 0.0, - note = 'How long the smoke particle takes to fade in.', + note = "How long the smoke particle takes to fade in.", validator = isFloat, }, -- New: animParams = { - type = 'float[3]', - default = {0.0, 0.0, 0.0}, - note = 'X*Y, time', + type = "float[3]", + default = { 0.0, 0.0, 0.0 }, + note = "X*Y, time", validator = isFloat3, }, } local lowerKeys = {} -for k,v in pairs(cegDefTemplate) do +for k, v in pairs(cegDefTemplate) do lowerKeys[string.lower(k)] = k end -for k,v in pairs(lowerKeys) do +for k, v in pairs(lowerKeys) do cegDefTemplate[k] = cegDefTemplate[v] end local function validateCEG(cegTable, cegName) for spawnername, spawnerTable in pairs(cegTable) do - if type(spawnerTable) == 'table' and spawnerTable['class'] then - local class = spawnerTable['class'] + if type(spawnerTable) == "table" and spawnerTable["class"] then + local class = spawnerTable["class"] if not spawnerDefs[class] then - - local msg = string.format( - 'Error: CEG {%s = {%s = {%s = "%s" ,...}}} : %s', - tostring(cegName), - tostring(spawnername), - 'class', - class, - "class does not exist" - ) + local msg = string.format('Error: CEG {%s = {%s = {%s = "%s" ,...}}} : %s', tostring(cegName), tostring(spawnername), "class", class, "class does not exist") return false, msg else for k, v in pairs(spawnerTable) do @@ -813,22 +797,14 @@ local function validateCEG(cegTable, cegName) if not res then --spEcho("VAL", err) - local msg = string.format( - 'Error: CEG {%s = {%s = {%s = %s ,...}}} : %s', - tostring(cegName), - tostring(spawnername), - tostring(k), - ((type(v) == 'string') and '"' or '') .. tostring(v) .. ((type(v) == 'string') and '"' or '') , - tostring(err) - ) + local msg = string.format("Error: CEG {%s = {%s = {%s = %s ,...}}} : %s", tostring(cegName), tostring(spawnername), tostring(k), ((type(v) == "string") and '"' or "") .. tostring(v) .. ((type(v) == "string") and '"' or ""), tostring(err)) return false, msg - else --spEcho("Valid, type:",cegDefTemplate[k].type, k, v) end end - elseif k == 'properties' then + elseif k == "properties" then for k2, v2 in pairs(v) do if cegDefTemplate[k2] then if cegDefTemplate[k2].validator then @@ -836,15 +812,7 @@ local function validateCEG(cegTable, cegName) if not res then --spEcho("VAL", err) - - local msg = string.format( - 'Error: CEG {%s = {%s = {properties = {%s = "%s" ...}}}} is invalid: %s', - tostring(cegName), - tostring(spawnername), - tostring(k2), - ((type(v2) == 'string') and '"' or '') ..tostring(v2) .. ((type(2) == 'string') and '"' or '') , - tostring(err) - ) + local msg = string.format('Error: CEG {%s = {%s = {properties = {%s = "%s" ...}}}} is invalid: %s', tostring(cegName), tostring(spawnername), tostring(k2), ((type(v2) == "string") and '"' or "") .. tostring(v2) .. ((type(2) == "string") and '"' or ""), tostring(err)) return false, msg else @@ -854,7 +822,7 @@ local function validateCEG(cegTable, cegName) end end else - return false, "Invalid property:"..k..'='..tostring(v) + return false, "Invalid property:" .. k .. "=" .. tostring(v) end end end @@ -863,7 +831,6 @@ local function validateCEG(cegTable, cegName) return true end - local function AreIntegers(t) for k, v in pairs(t) do if type(k) ~= "number" or k % 1 ~= 0 then @@ -875,7 +842,7 @@ end local function AreBooleans(t) for k, v in pairs(t) do - if type(k) ~= "boolean" and k ~=1 and k ~= 0 then + if type(k) ~= "boolean" and k ~= 1 and k ~= 0 then return false end end @@ -915,11 +882,11 @@ local cegDefs = {} -- maps ceg name to its full def local spamCeg = nil -local function tableEquals(a,b) +local function tableEquals(a, b) if type(a) ~= type(b) then return false end - if type(a) == 'table' then + if type(a) == "table" then for k, v in pairs(a) do if not tableEquals(v, b[k]) then return false @@ -937,7 +904,7 @@ local function tableEquals(a,b) end local function LoadAllCegs() - for i, dir in pairs({'effects', 'effects/lootboxes', 'effects/raptors', 'effects/scavengers'}) do + for i, dir in pairs({ "effects", "effects/lootboxes", "effects/raptors", "effects/scavengers" }) do local cegfiles = VFS.DirList(dir, "*.lua") for _, cegfile in pairs(cegfiles) do --spEcho(cegfile) @@ -946,24 +913,21 @@ local function LoadAllCegs() local cegs = VFS.Include(cegfile) for cegDefname, cegTable in pairs(cegs) do - - --spEcho(name) local res, err = validateCEG(cegTable, cegDefname) if not res then spEcho(err) else end - cegDefs[cegDefname]= cegTable + cegDefs[cegDefname] = cegTable for genName, generator in pairs(cegTable) do - if type(generator) == 'table' then + if type(generator) == "table" then generatorNames[genName] = true end end end end end - end local function ScanChanges() @@ -976,7 +940,7 @@ local function ScanChanges() cegFileContents[filename] = newContents local chunk, err = loadstring(newContents, filename) if not chunk then - spEcho("Failed to load: " .. filename .. ' (' .. err .. ')') + spEcho("Failed to load: " .. filename .. " (" .. err .. ")") else local newDefs = VFS.Include(filename) @@ -984,7 +948,7 @@ local function ScanChanges() for cegDefname, cegTable in pairs(newDefs) do local res, err = validateCEG(cegTable, cegDefname) if not res then - spEcho(filename.. ':' .. err) + spEcho(filename .. ":" .. err) allok = false else if tableEquals(cegDefs[cegDefname], cegTable) then @@ -996,10 +960,8 @@ local function ScanChanges() cegDefs[cegDefname] = cegTable end end - end - -- COMPARE TABLES for cegDefname, cegTable in pairs(newDefs) do cegDefFiles[cegDefname] = filename @@ -1017,17 +979,16 @@ end local function LoadResources() local resources = VFS.Include("gamedata/resources.lua") - for k,v in pairs(resources.graphics.projectiletextures) do + for k, v in pairs(resources.graphics.projectiletextures) do --spEcho("projectileTexures", k,v) projectileTexures[k] = v end - for k,v in pairs(resources.graphics.groundfx) do + for k, v in pairs(resources.graphics.groundfx) do --spEcho("groundfx", k,v) projectileTexures[k] = v end end - function widget:Initialize() LoadResources() LoadAllCegs() @@ -1035,7 +996,7 @@ end local lastUpdate = Spring.GetTimer() function widget:Update() - if Spring.DiffTimers(Spring.GetTimer() , lastUpdate) < 1 then + if Spring.DiffTimers(Spring.GetTimer(), lastUpdate) < 1 then return end lastUpdate = Spring.GetTimer() @@ -1044,7 +1005,7 @@ function widget:Update() mouseOffscreen = select(6, spGetMouseState()) --if not mouseOffscreen and prevMouseOffscreen then - ScanChanges() + ScanChanges() --end if spamCeg then diff --git a/luaui/Widgets/dbg_deferred_buffer_visualizer.lua b/luaui/Widgets/dbg_deferred_buffer_visualizer.lua index ed71d8520ff..1c96f3484b1 100644 --- a/luaui/Widgets/dbg_deferred_buffer_visualizer.lua +++ b/luaui/Widgets/dbg_deferred_buffer_visualizer.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Deferred Buffer visualizer", - desc = "Swap buffers with /luaui prevbuffer|nextbuffer, show alpha in red with /luaui ", - author = "Beherith", - date = "2016-03-30", - license = "GNU GPL, v2 or later", - layer = 9999999, - enabled = false, + name = "Deferred Buffer visualizer", + desc = "Swap buffers with /luaui prevbuffer|nextbuffer, show alpha in red with /luaui ", + author = "Beherith", + date = "2016-03-30", + license = "GNU GPL, v2 or later", + layer = 9999999, + enabled = false, } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetViewGeometry = Spring.GetViewGeometry @@ -23,7 +22,7 @@ local myshaderTexture0Loc = nil local dbgDraw = 0 local depthCopyTex = nil -local deferredbuffers = ({ +local deferredbuffers = { "$map_gbuffer_normtex", "$map_gbuffer_difftex", "$map_gbuffer_spectex", @@ -32,28 +31,28 @@ local deferredbuffers = ({ "$map_gbuffer_zvaltex", "$model_gbuffer_normtex", - "$model_gbuffer_difftex" , - "$model_gbuffer_spectex" , - "$model_gbuffer_emittex" , - "$model_gbuffer_misctex" , + "$model_gbuffer_difftex", + "$model_gbuffer_spectex", + "$model_gbuffer_emittex", + "$model_gbuffer_misctex", "$model_gbuffer_zvaltex", "depthcopy", -}) -deferredbuffer_info= ({ - ["$map_gbuffer_normtex"] ="contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)", - ["$map_gbuffer_difftex"] = "contains the diffuse texture buffer of the map in view New in version 95", - ["$map_gbuffer_spectex"] = "contains the specular textures of the map in view New in version 95", - ["$map_gbuffer_emittex"] = "for emissive materials (bloom would be the canonical use) New in version 95", - ["$map_gbuffer_misctex"] = "for arbitrary shader data New in version 95", - ["$map_gbuffer_zvaltex"] = "contains the depth values (z-buffer) of the map in view. New in version 95", - ["$model_gbuffer_normtex"] = "contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) New in version 95", - ["$model_gbuffer_difftex"] = "contains the diffuse texture buffer of the models in view New in version 95", - ["$model_gbuffer_spectex"] = "contains the specular textures of the models in view New in version 95", - ["$model_gbuffer_emittex"] = "for emissive materials (bloom would be the canonical use) New in version 95", - ["$model_gbuffer_misctex"] = "for arbitrary shader data New in version 95", - ["$model_gbuffer_zvaltex"] = "contains the depth values (z-buffer) of the models in view. ", - ["depthcopy"] = "A copy of the current depth buffer. ", -}) +} +deferredbuffer_info = { + ["$map_gbuffer_normtex"] = "contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)", + ["$map_gbuffer_difftex"] = "contains the diffuse texture buffer of the map in view New in version 95", + ["$map_gbuffer_spectex"] = "contains the specular textures of the map in view New in version 95", + ["$map_gbuffer_emittex"] = "for emissive materials (bloom would be the canonical use) New in version 95", + ["$map_gbuffer_misctex"] = "for arbitrary shader data New in version 95", + ["$map_gbuffer_zvaltex"] = "contains the depth values (z-buffer) of the map in view. New in version 95", + ["$model_gbuffer_normtex"] = "contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) New in version 95", + ["$model_gbuffer_difftex"] = "contains the diffuse texture buffer of the models in view New in version 95", + ["$model_gbuffer_spectex"] = "contains the specular textures of the models in view New in version 95", + ["$model_gbuffer_emittex"] = "for emissive materials (bloom would be the canonical use) New in version 95", + ["$model_gbuffer_misctex"] = "for arbitrary shader data New in version 95", + ["$model_gbuffer_zvaltex"] = "contains the depth values (z-buffer) of the models in view. ", + ["depthcopy"] = "A copy of the current depth buffer. ", +} local currentbuffer = 13 -- starts with model_gbuffer_normtex @@ -63,15 +62,17 @@ local function RemoveMe(msg) end local function MakeShader() - if (gl.DeleteShader) then - if myshader ~= nil then gl.DeleteShader(myshader or 0) end + if gl.DeleteShader then + if myshader ~= nil then + gl.DeleteShader(myshader or 0) + end end local uniformInts = {} - for i, texname in ipairs(deferredbuffers) do - uniformInts[string.gsub(texname, "%$", "")] = i-1 + for i, texname in ipairs(deferredbuffers) do + uniformInts[string.gsub(texname, "%$", "")] = i - 1 end - + myshader = gl.CreateShader({ fragment = [[ uniform sampler2D texture0; @@ -180,68 +181,69 @@ local function MakeShader() uniformInt = uniformInts, }) - if (myshader == nil) then - RemoveMe("[deferred buffer visualizer] myshader compilation failed"); print(gl.GetShaderLog()); return + if myshader == nil then + RemoveMe("[deferred buffer visualizer] myshader compilation failed") + print(gl.GetShaderLog()) + return end myshaderDebgDrawLoc = gl.GetUniformLocation(myshader, "debugDraw") --myshaderTexture0Loc = gl.GetUniformLocation(myshader, "texture0") - end - function widget:Initialize() - if (gl.CreateShader == nil) then + if gl.CreateShader == nil then RemoveMe("[deferred buffer visualizer] removing widget, no shader support") return end - hasdeferredrendering = (Spring.GetConfigString("AllowDeferredModelRendering")=='1') and (Spring.GetConfigString("AllowDeferredMapRendering")=='1') + hasdeferredrendering = (Spring.GetConfigString("AllowDeferredModelRendering") == "1") and (Spring.GetConfigString("AllowDeferredMapRendering") == "1") if hasdeferredrendering == false then RemoveMe("[deferred buffer visualizer] removing widget, AllowDeferred Model and Map Rendering is required") end local vsx, vsy = spGetViewGeometry() local GL_DEPTH_COMPONENT24 = 0x81A6 - - local GL_DEPTH_COMPONENT = 0x1902 + + local GL_DEPTH_COMPONENT = 0x1902 local GL_DEPTH_COMPONENT32 = 0x81A7 - depthCopyTex = gl.CreateTexture(vsx,vsy, { + depthCopyTex = gl.CreateTexture(vsx, vsy, { target = GL_TEXTURE_2D, format = GL_DEPTH_COMPONENT, min_filter = GL.NEAREST, mag_filter = GL.NEAREST, }) - if depthCopyTex == nil then spEcho("Failed to allocate the depth texture", vsx,vsy) end + if depthCopyTex == nil then + spEcho("Failed to allocate the depth texture", vsx, vsy) + end MakeShader() end function widget:Shutdown() RemoveChatActions() - if (gl.DeleteShader) then - if myshader ~= nil then gl.DeleteShader(myshader or 0) end + if gl.DeleteShader then + if myshader ~= nil then + gl.DeleteShader(myshader or 0) + end end end function widget:DrawWorld() local vsx, vsy, vpx, vpy = spGetViewGeometry() - - gl.CopyToTexture(depthCopyTex, 0, 0, vpx, vpy, vsx, vsy) -- the original screen image + gl.CopyToTexture(depthCopyTex, 0, 0, vpx, vpy, vsx, vsy) -- the original screen image end function widget:DrawScreenPost() - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- https://www.andersriggelsen.dk/glblendfunc.php + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- https://www.andersriggelsen.dk/glblendfunc.php gl.UseShader(myshader) - for i=1, 12 do - gl.Texture(i-1, deferredbuffers[i]) + for i = 1, 12 do + gl.Texture(i - 1, deferredbuffers[i]) end gl.Texture(12, depthCopyTex) - - + gl.TexRect(0, -1, 1, 1, 0.5, 0, 1, 1) - for i=0, 12 do + for i = 0, 12 do gl.Texture(i, false) end gl.UseShader(0) gl.Blending("reset") end - diff --git a/luaui/Widgets/dbg_deferred_test.lua b/luaui/Widgets/dbg_deferred_test.lua index 4a40af1799b..eeab1786ea6 100644 --- a/luaui/Widgets/dbg_deferred_test.lua +++ b/luaui/Widgets/dbg_deferred_test.lua @@ -1,11 +1,11 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Deferred shading test", - layer = 0, - enabled = false, - } + return { + name = "Deferred shading test", + layer = 0, + enabled = false, + } end local vsx, vsy @@ -14,11 +14,9 @@ function widget:Initialize() vsx, vsy = widgetHandler:GetViewSizes() end -function widget:Shutdown() -end +function widget:Shutdown() end -function widget:DrawGenesis() -end +function widget:DrawGenesis() end --local texName = "$model_gbuffer_normtex" --local texName = "$model_gbuffer_difftex" diff --git a/luaui/Widgets/dbg_engine_shader_reload.lua b/luaui/Widgets/dbg_engine_shader_reload.lua index 1ffe15e2b09..9aab316a827 100644 --- a/luaui/Widgets/dbg_engine_shader_reload.lua +++ b/luaui/Widgets/dbg_engine_shader_reload.lua @@ -19,38 +19,42 @@ end local shaderContents = {} -- maps shader filename to raw contents local interval = 10 -- seconds function widget:Initialize() - local shaders = VFS.DirList("Shaders/GLSL/", "*.glsl") - for i, filename in ipairs(shaders) do - shaderContents[filename] = VFS.LoadFile(filename) - end + local shaders = VFS.DirList("Shaders/GLSL/", "*.glsl") + for i, filename in ipairs(shaders) do + shaderContents[filename] = VFS.LoadFile(filename) + end end local lastUpdate = Spring.GetTimer() local updateQueue = {} function widget:Update() - local changed = false + local changed = false - local filename, oldContents = next(updateQueue) - if filename then - local startTime = Spring.GetTimer() - while (Spring.DiffTimers(Spring.GetTimer() , startTime, true) < 1) and filename do - local newContents = VFS.LoadFile(filename) - if newContents ~= oldContents then - interval = 1 - changed = true - shaderContents[filename] = newContents - Spring.Echo("Reloading shader: " .. filename) - end - updateQueue[filename] = nil - filename, oldContents = next(updateQueue) - end - end - if changed then - Spring.SendCommands("reloadshaders") - end + local filename, oldContents = next(updateQueue) + if filename then + local startTime = Spring.GetTimer() + while (Spring.DiffTimers(Spring.GetTimer(), startTime, true) < 1) and filename do + local newContents = VFS.LoadFile(filename) + if newContents ~= oldContents then + interval = 1 + changed = true + shaderContents[filename] = newContents + Spring.Echo("Reloading shader: " .. filename) + end + updateQueue[filename] = nil + filename, oldContents = next(updateQueue) + end + end + if changed then + Spring.SendCommands("reloadshaders") + end - if Spring.DiffTimers(Spring.GetTimer() , lastUpdate) < interval then return end + if Spring.DiffTimers(Spring.GetTimer(), lastUpdate) < interval then + return + end lastUpdate = Spring.GetTimer() - updateQueue = {} - for filename, oldContents in pairs(shaderContents) do updateQueue[filename] = oldContents end + updateQueue = {} + for filename, oldContents in pairs(shaderContents) do + updateQueue[filename] = oldContents + end end diff --git a/luaui/Widgets/dbg_ffa_startpoints_picker.lua b/luaui/Widgets/dbg_ffa_startpoints_picker.lua index 6e9e5d79e33..8ad14442be1 100644 --- a/luaui/Widgets/dbg_ffa_startpoints_picker.lua +++ b/luaui/Widgets/dbg_ffa_startpoints_picker.lua @@ -13,20 +13,18 @@ but there are AIs. local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "FFA start points picker", - desc = - "Companion widget for generating FFA start points configs as expected by the **FFA start setup** gadget (`game_ffa_start_setup.lua`)", - author = "nbusseneau", - date = "2023-08-20", - license = "GPL-2.0-or-later", - layer = 1000, -- must run later than `cmd_bar_hotkeys` to avoid being overriden - handler = true, -- need superpowers to disable other widgets - enabled = false - } + return { + name = "FFA start points picker", + desc = "Companion widget for generating FFA start points configs as expected by the **FFA start setup** gadget (`game_ffa_start_setup.lua`)", + author = "nbusseneau", + date = "2023-08-20", + license = "GPL-2.0-or-later", + layer = 1000, -- must run later than `cmd_bar_hotkeys` to avoid being overriden + handler = true, -- need superpowers to disable other widgets + enabled = false, + } end - -- Localized functions for performance local tableInsert = table.insert local tableRemove = table.remove @@ -56,20 +54,20 @@ StartPoint.__index = StartPoint ---@param unitID integer ---@return StartPoint function StartPoint:new(unitID) - self = setmetatable({}, self) - self.unitID = unitID - self.isSelected = false + self = setmetatable({}, self) + self.unitID = unitID + self.isSelected = false - ---@return integer, integer, integer - function StartPoint:getPosition() - return spGetUnitPosition(self.unitID) - end + ---@return integer, integer, integer + function StartPoint:getPosition() + return spGetUnitPosition(self.unitID) + end - return self + return self end function StartPoint.__eq(a, b) - return a.unitID == b.unitID + return a.unitID == b.unitID end -------------------------------------------------------------------------------- @@ -81,47 +79,47 @@ StartPoints.__index = StartPoints ---@return StartPoints # singleton instance of StartPoints function StartPoints:getInstance() - if StartPoints.instance then - return StartPoints.instance - end - self = setmetatable({}, StartPoints) - StartPoints.instance = self - - ---@param unitID integer - ---@return integer?, StartPoint? # index and start point if found, nil and nil otherwise - function StartPoints:get(unitID) - for index, startPoint in ipairs(self) do - if startPoint.unitID == unitID then - return index, startPoint - end - end - return nil, nil - end - - ---@param unitID integer - ---@return boolean # true if start point was added, false otherwise - function StartPoints:add(unitID) - local startPoint = StartPoint:new(unitID) - if not table.contains(self, startPoint) then - tableInsert(self, startPoint) - return true - end - - return false - end - - ---@param unitID integer - ---@return boolean # true if start point was removed, false otherwise - function StartPoints:remove(unitID) - local startPoint = StartPoint:new(unitID) - local wasRemoved = tableRemoveFirst(self, startPoint) - if wasRemoved then - byAllyTeamCount:removeStartPoint(startPoint) - end - return wasRemoved - end - - return self + if StartPoints.instance then + return StartPoints.instance + end + self = setmetatable({}, StartPoints) + StartPoints.instance = self + + ---@param unitID integer + ---@return integer?, StartPoint? # index and start point if found, nil and nil otherwise + function StartPoints:get(unitID) + for index, startPoint in ipairs(self) do + if startPoint.unitID == unitID then + return index, startPoint + end + end + return nil, nil + end + + ---@param unitID integer + ---@return boolean # true if start point was added, false otherwise + function StartPoints:add(unitID) + local startPoint = StartPoint:new(unitID) + if not table.contains(self, startPoint) then + tableInsert(self, startPoint) + return true + end + + return false + end + + ---@param unitID integer + ---@return boolean # true if start point was removed, false otherwise + function StartPoints:remove(unitID) + local startPoint = StartPoint:new(unitID) + local wasRemoved = tableRemoveFirst(self, startPoint) + if wasRemoved then + byAllyTeamCount:removeStartPoint(startPoint) + end + return wasRemoved + end + + return self end startPoints = StartPoints:getInstance() @@ -137,40 +135,40 @@ Layout.__index = Layout ---@param unitIDs integer[] sequence of unitID ---@return Layout function Layout:new(unitIDs) - self = setmetatable({}, Layout) - for _, unitID in ipairs(unitIDs) do - local index, startPoint = startPoints:get(unitID) - if index and startPoint then - self[index] = startPoint - end - end - - function Layout:reIndex() - local temp = {} - for oldIndex, startPoint in pairs(self) do - local index, _ = startPoints:get(startPoint.unitID) - if index then - self[oldIndex] = nil - temp[index] = startPoint - end - end - for index, startPoint in pairs(temp) do - self[index] = startPoint - end - end - - return self + self = setmetatable({}, Layout) + for _, unitID in ipairs(unitIDs) do + local index, startPoint = startPoints:get(unitID) + if index and startPoint then + self[index] = startPoint + end + end + + function Layout:reIndex() + local temp = {} + for oldIndex, startPoint in pairs(self) do + local index, _ = startPoints:get(startPoint.unitID) + if index then + self[oldIndex] = nil + temp[index] = startPoint + end + end + for index, startPoint in pairs(temp) do + self[index] = startPoint + end + end + + return self end function Layout.__eq(a, b) - local isEqual = true - for _, startPoint in pairs(a) do - if not table.contains(b, startPoint) then - isEqual = false - break - end - end - return isEqual + local isEqual = true + for _, startPoint in pairs(a) do + if not table.contains(b, startPoint) then + isEqual = false + break + end + end + return isEqual end -------------------------------------------------------------------------------- @@ -183,70 +181,70 @@ ByAllyTeamCount.__index = ByAllyTeamCount ---@return ByAllyTeamCount # singleton instance of ByAllyTeamCount function ByAllyTeamCount:getInstance() - if ByAllyTeamCount.instance then - return ByAllyTeamCount.instance - end - self = setmetatable({}, ByAllyTeamCount) - ByAllyTeamCount.instance = self - - ---@param layout Layout - ---@return boolean # true if layout was added, false otherwise - function ByAllyTeamCount:addLayout(layout) - local allyTeamCount = table.count(layout) - if not self[allyTeamCount] then - self[allyTeamCount] = {} - end - - if not table.contains(self[allyTeamCount], layout) then - tableInsert(self[allyTeamCount], layout) - return true - end - - return false - end - - ---@param layout Layout - ---@return boolean # true if layout was removed, false otherwise - function ByAllyTeamCount:removeLayout(layout) - local wasRemoved - local allyTeamCount = table.count(layout) - if self[allyTeamCount] then - wasRemoved = tableRemoveFirst(self[allyTeamCount], layout) - end - if wasRemoved then - self:cleanEmptyIndexes() - end - return wasRemoved - end - - ---@param startPoint StartPoint - function ByAllyTeamCount:removeStartPoint(startPoint) - for _, layouts in pairs(self) do - for key, layout in pairs(layouts) do - if table.contains(layout, startPoint) then - layouts[key] = nil - end - end - end - - for _, layouts in pairs(self) do - for _, layout in pairs(layouts) do - layout:reIndex() - end - end - - self:cleanEmptyIndexes() - end - - function ByAllyTeamCount:cleanEmptyIndexes() - for allyTeamCount, _ in pairs(self) do - if #self[allyTeamCount] == 0 then - self[allyTeamCount] = nil - end - end - end - - return self + if ByAllyTeamCount.instance then + return ByAllyTeamCount.instance + end + self = setmetatable({}, ByAllyTeamCount) + ByAllyTeamCount.instance = self + + ---@param layout Layout + ---@return boolean # true if layout was added, false otherwise + function ByAllyTeamCount:addLayout(layout) + local allyTeamCount = table.count(layout) + if not self[allyTeamCount] then + self[allyTeamCount] = {} + end + + if not table.contains(self[allyTeamCount], layout) then + tableInsert(self[allyTeamCount], layout) + return true + end + + return false + end + + ---@param layout Layout + ---@return boolean # true if layout was removed, false otherwise + function ByAllyTeamCount:removeLayout(layout) + local wasRemoved + local allyTeamCount = table.count(layout) + if self[allyTeamCount] then + wasRemoved = tableRemoveFirst(self[allyTeamCount], layout) + end + if wasRemoved then + self:cleanEmptyIndexes() + end + return wasRemoved + end + + ---@param startPoint StartPoint + function ByAllyTeamCount:removeStartPoint(startPoint) + for _, layouts in pairs(self) do + for key, layout in pairs(layouts) do + if table.contains(layout, startPoint) then + layouts[key] = nil + end + end + end + + for _, layouts in pairs(self) do + for _, layout in pairs(layouts) do + layout:reIndex() + end + end + + self:cleanEmptyIndexes() + end + + function ByAllyTeamCount:cleanEmptyIndexes() + for allyTeamCount, _ in pairs(self) do + if #self[allyTeamCount] == 0 then + self[allyTeamCount] = nil + end + end + end + + return self end byAllyTeamCount = ByAllyTeamCount:getInstance() @@ -262,99 +260,99 @@ ConfigFile.__index = ConfigFile ---@param config? { startPoints: table, byAllyTeamCount: table } external config to load (if not provided, create a ConfigFile based on current widget data) ---@return ConfigFile function ConfigFile:new(config) - self = setmetatable({}, ConfigFile) - if config then - self.startPoints = config.startPoints - self.byAllyTeamCount = config.byAllyTeamCount - else - self.startPoints = {} - self.byAllyTeamCount = {} - for index, startPoint in ipairs(startPoints) do - local x, _, z = startPoint:getPosition() - self.startPoints[index] = { x = x, z = z, } - end - for allyTeamCount, layouts in pairsByKeys(byAllyTeamCount) do - self.byAllyTeamCount[allyTeamCount] = {} - for _, layout in pairs(layouts) do - local indexes = {} - for index, _ in pairsByKeys(layout) do - tableInsert(indexes, index) - end - tableInsert(self.byAllyTeamCount[allyTeamCount], indexes) - end - end - end - - local function serializeStartPoints() - local output = "local startPoints = {\n" - for index, startPoint in ipairs(self.startPoints) do - output = output .. string.format(" [%d] = { x = %d, z = %d, },\n", index, startPoint.x, startPoint.z) - end - return output .. "}\n\n" - end - - local function serializeByAllyTeamCount() - local output = "local byAllyTeamCount = {\n" - for allyTeamCount, layouts in pairsByKeys(self.byAllyTeamCount) do - output = output .. string.format(" -- %d-way => \n [%d] = {\n", allyTeamCount, allyTeamCount) - for _, indexes in pairs(layouts) do - output = output .. string.format(" { ") - for _, index in ipairs(indexes) do - output = output .. string.format("%s, ", index) - end - output = output .. string.format("},\n") - end - output = output .. " },\n\n" - end - output = output:sub(1, -2) -- remove extraneous newline when we reach end of byAllyTeamCount - return output .. "}\n\n" - end - - local function serializeReturnValues() - return [[ + self = setmetatable({}, ConfigFile) + if config then + self.startPoints = config.startPoints + self.byAllyTeamCount = config.byAllyTeamCount + else + self.startPoints = {} + self.byAllyTeamCount = {} + for index, startPoint in ipairs(startPoints) do + local x, _, z = startPoint:getPosition() + self.startPoints[index] = { x = x, z = z } + end + for allyTeamCount, layouts in pairsByKeys(byAllyTeamCount) do + self.byAllyTeamCount[allyTeamCount] = {} + for _, layout in pairs(layouts) do + local indexes = {} + for index, _ in pairsByKeys(layout) do + tableInsert(indexes, index) + end + tableInsert(self.byAllyTeamCount[allyTeamCount], indexes) + end + end + end + + local function serializeStartPoints() + local output = "local startPoints = {\n" + for index, startPoint in ipairs(self.startPoints) do + output = output .. string.format(" [%d] = { x = %d, z = %d, },\n", index, startPoint.x, startPoint.z) + end + return output .. "}\n\n" + end + + local function serializeByAllyTeamCount() + local output = "local byAllyTeamCount = {\n" + for allyTeamCount, layouts in pairsByKeys(self.byAllyTeamCount) do + output = output .. string.format(" -- %d-way => \n [%d] = {\n", allyTeamCount, allyTeamCount) + for _, indexes in pairs(layouts) do + output = output .. string.format(" { ") + for _, index in ipairs(indexes) do + output = output .. string.format("%s, ", index) + end + output = output .. string.format("},\n") + end + output = output .. " },\n\n" + end + output = output:sub(1, -2) -- remove extraneous newline when we reach end of byAllyTeamCount + return output .. "}\n\n" + end + + local function serializeReturnValues() + return [[ return { startPoints = startPoints, byAllyTeamCount = byAllyTeamCount } ]] - end - - ---Serialize into the format expected by the `game_ffa_start_setup` gadget. - ---@return string - function ConfigFile:serialize() - local output = serializeStartPoints() - output = output .. serializeByAllyTeamCount() - return output .. serializeReturnValues() - end - - ---Coroutine to load this ConfigFile into widget data. - ---@return thread - function ConfigFile:getLoadCoroutine() - -- must use a coroutine because we need to synchronize with /give commands - -- and wait for them to go through, so that new start points are registered - -- before we interact with byAllyTeamCount and layouts - return coroutine.create(function() - for _, startPoint in ipairs(self.startPoints) do - Spring.SendCommands(string.format("give %s @%s,%s,%s", startPointUnitName, startPoint.x, 0, startPoint.z)) - coroutine.yield() - end - for _, layouts in pairsByKeys(self.byAllyTeamCount) do - for _, indexes in pairs(layouts) do - local unitIDs = {} - for _, index in ipairs(indexes) do - local startPoint = startPoints[index] - if startPoint then - tableInsert(unitIDs, startPoint.unitID) - end - end - local layout = Layout:new(unitIDs) - byAllyTeamCount:addLayout(layout) - end - end - end) - end - - return self + end + + ---Serialize into the format expected by the `game_ffa_start_setup` gadget. + ---@return string + function ConfigFile:serialize() + local output = serializeStartPoints() + output = output .. serializeByAllyTeamCount() + return output .. serializeReturnValues() + end + + ---Coroutine to load this ConfigFile into widget data. + ---@return thread + function ConfigFile:getLoadCoroutine() + -- must use a coroutine because we need to synchronize with /give commands + -- and wait for them to go through, so that new start points are registered + -- before we interact with byAllyTeamCount and layouts + return coroutine.create(function() + for _, startPoint in ipairs(self.startPoints) do + Spring.SendCommands(string.format("give %s @%s,%s,%s", startPointUnitName, startPoint.x, 0, startPoint.z)) + coroutine.yield() + end + for _, layouts in pairsByKeys(self.byAllyTeamCount) do + for _, indexes in pairs(layouts) do + local unitIDs = {} + for _, index in ipairs(indexes) do + local startPoint = startPoints[index] + if startPoint then + tableInsert(unitIDs, startPoint.unitID) + end + end + local layout = Layout:new(unitIDs) + byAllyTeamCount:addLayout(layout) + end + end + end) + end + + return self end -------------------------------------------------------------------------------- @@ -364,50 +362,50 @@ local configLoadCoroutine local startPointUnitDefId = UnitDefNames[startPointUnitName].id local function addStartPoint(unitID, unitDefID) - unitDefID = unitDefID or spGetUnitDefID(unitID) - if unitDefID == startPointUnitDefId then - startPoints:add(unitID) - end + unitDefID = unitDefID or spGetUnitDefID(unitID) + if unitDefID == startPointUnitDefId then + startPoints:add(unitID) + end end local function initializeStartPoints(widget) - local units = spGetTeamUnits(spGetMyTeamID()) - for _, unitID in pairs(units) do - addStartPoint(unitID) - end + local units = spGetTeamUnits(spGetMyTeamID()) + for _, unitID in pairs(units) do + addStartPoint(unitID) + end end function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - addStartPoint(unitID, unitDefID) + addStartPoint(unitID, unitDefID) - -- handle synchronization with getLoadCoroutine() after a /give command - if configLoadCoroutine then - coroutine.resume(configLoadCoroutine) - if coroutine.status(configLoadCoroutine) == "dead" then - configLoadCoroutine = nil - end - end + -- handle synchronization with getLoadCoroutine() after a /give command + if configLoadCoroutine then + coroutine.resume(configLoadCoroutine) + if coroutine.status(configLoadCoroutine) == "dead" then + configLoadCoroutine = nil + end + end end local function removeStartPoint(unitID, unitDefID) - unitDefID = unitDefID or spGetUnitDefID(unitID) - if unitDefID == startPointUnitDefId then - startPoints:remove(unitID) - end + unitDefID = unitDefID or spGetUnitDefID(unitID) + if unitDefID == startPointUnitDefId then + startPoints:remove(unitID) + end end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - removeStartPoint(unitID, unitDefID) + removeStartPoint(unitID, unitDefID) end function widget:SelectionChanged(selectedUnits) - for _, startPoint in ipairs(startPoints) do - if table.contains(selectedUnits, startPoint.unitID) then - startPoint.isSelected = true - else - startPoint.isSelected = false - end - end + for _, startPoint in ipairs(startPoints) do + if table.contains(selectedUnits, startPoint.unitID) then + startPoint.isSelected = true + else + startPoint.isSelected = false + end + end end -------------------------------------------------------------------------------- @@ -418,182 +416,179 @@ local WIPConfigFilePrefix = "dbg_ffa_" local ephemeralConfig = "dbg_ffa_startpoints_picker" local function tryLoadWIPConfig(currentMapName) - local availableWIPConfigs = VFS.DirList(WIPConfigsDir, string.format("%s%s*.lua", WIPConfigFilePrefix, currentMapName)) - if #availableWIPConfigs > 0 then - local lastWIPConfig = availableWIPConfigs[#availableWIPConfigs] - Spring.Log(widget:GetInfo().name, LOG.INFO, - string.format("found WIP config file %s previously written by editor for current map %s", lastWIPConfig, - currentMapName)) - return VFS.Include(lastWIPConfig) - end - return nil + local availableWIPConfigs = VFS.DirList(WIPConfigsDir, string.format("%s%s*.lua", WIPConfigFilePrefix, currentMapName)) + if #availableWIPConfigs > 0 then + local lastWIPConfig = availableWIPConfigs[#availableWIPConfigs] + Spring.Log(widget:GetInfo().name, LOG.INFO, string.format("found WIP config file %s previously written by editor for current map %s", lastWIPConfig, currentMapName)) + return VFS.Include(lastWIPConfig) + end + return nil end local function tryLoadConfigFromBAR(currentMapName) - local sanitizedCurrentMapName = currentMapName:gsub("_", " "):lower() - local configsDirectory = "luarules/configs/ffa_startpoints/" - local availableConfigFiles = VFS.DirList(configsDirectory, "*.lua") + local sanitizedCurrentMapName = currentMapName:gsub("_", " "):lower() + local configsDirectory = "luarules/configs/ffa_startpoints/" + local availableConfigFiles = VFS.DirList(configsDirectory, "*.lua") - for _, configFile in pairs(availableConfigFiles) do - local basename = configFile:gsub(configsDirectory, ""):gsub(".lua", ""):gsub("_", " "):lower() - if string.find(sanitizedCurrentMapName, basename) then - Spring.Log(widget:GetInfo().name, LOG.INFO, - string.format("found config %s provided by BAR for current map %s", configFile, currentMapName)) - return VFS.Include(configFile) - end - end - return nil + for _, configFile in pairs(availableConfigFiles) do + local basename = configFile:gsub(configsDirectory, ""):gsub(".lua", ""):gsub("_", " "):lower() + if string.find(sanitizedCurrentMapName, basename) then + Spring.Log(widget:GetInfo().name, LOG.INFO, string.format("found config %s provided by BAR for current map %s", configFile, currentMapName)) + return VFS.Include(configFile) + end + end + return nil end local function doLoad(config) - -- remove all existing startpoints - local existingUnits = spGetTeamUnits(spGetMyTeamID()) - for _, unitID in pairs(existingUnits) do - startPoints:remove(unitID) - end + -- remove all existing startpoints + local existingUnits = spGetTeamUnits(spGetMyTeamID()) + for _, unitID in pairs(existingUnits) do + startPoints:remove(unitID) + end - local configFile = ConfigFile:new(config) - configLoadCoroutine = configFile:getLoadCoroutine() - coroutine.resume(configLoadCoroutine) + local configFile = ConfigFile:new(config) + configLoadCoroutine = configFile:getLoadCoroutine() + coroutine.resume(configLoadCoroutine) - -- clean up whatever was on the map before loading - Spring.SelectUnitArray(existingUnits) - Spring.SendCommands("remove") + -- clean up whatever was on the map before loading + Spring.SelectUnitArray(existingUnits) + Spring.SendCommands("remove") end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local availableFilters = { - { 3, 16 }, -- default: show all - { 3, 6 }, -- third, 1 / 3 - { 7, 10 }, -- third, 2 / 3 - { 11, 16 }, -- third, 3 / 3 + { 3, 16 }, -- default: show all + { 3, 6 }, -- third, 1 / 3 + { 7, 10 }, -- third, 2 / 3 + { 11, 16 }, -- third, 3 / 3 } local currentFilter = 1 local function giveStartPoint() - Spring.SendCommands("give " .. startPointUnitName) + Spring.SendCommands("give " .. startPointUnitName) end local function removeSelectedStartPoints() - Spring.SendCommands("remove") + Spring.SendCommands("remove") end local function addLayout() - local selectedUnits = spGetSelectedUnits() - -- don't consider anything less than 3-way layouts - if #selectedUnits >= 3 then - local layout = Layout:new(selectedUnits) - if not byAllyTeamCount:addLayout(layout) then - Spring.Log(widget:GetInfo().name, LOG.INFO, "layout was already registered") - end - else - Spring.Log(widget:GetInfo().name, LOG.ERROR, "must select at least 3 start points to add a layout") - end + local selectedUnits = spGetSelectedUnits() + -- don't consider anything less than 3-way layouts + if #selectedUnits >= 3 then + local layout = Layout:new(selectedUnits) + if not byAllyTeamCount:addLayout(layout) then + Spring.Log(widget:GetInfo().name, LOG.INFO, "layout was already registered") + end + else + Spring.Log(widget:GetInfo().name, LOG.ERROR, "must select at least 3 start points to add a layout") + end end local function removeLayout() - local selectedUnits = spGetSelectedUnits() - if #selectedUnits >= 3 then - local layout = Layout:new(selectedUnits) - if not byAllyTeamCount:removeLayout(layout) then - Spring.Log(widget:GetInfo().name, LOG.INFO, "this layout is not registered") - end - end + local selectedUnits = spGetSelectedUnits() + if #selectedUnits >= 3 then + local layout = Layout:new(selectedUnits) + if not byAllyTeamCount:removeLayout(layout) then + Spring.Log(widget:GetInfo().name, LOG.INFO, "this layout is not registered") + end + end end local function previousPage() - currentFilter = currentFilter - 1 - if currentFilter == 0 then - currentFilter = #availableFilters - end + currentFilter = currentFilter - 1 + if currentFilter == 0 then + currentFilter = #availableFilters + end end local function nextPage() - currentFilter = currentFilter + 1 - if currentFilter > #availableFilters then - currentFilter = 1 - end + currentFilter = currentFilter + 1 + if currentFilter > #availableFilters then + currentFilter = 1 + end end local function copyToClipboard() - local configFile = ConfigFile:new() - WG[ephemeralConfig] = { - startPoints = configFile.startPoints, - byAllyTeamCount = configFile.byAllyTeamCount, - } - local output = configFile:serialize() - Spring.SetClipboard(output) - Spring.Log(widget:GetInfo().name, LOG.INFO, "copied to clipboard and stored ephemeral config") + local configFile = ConfigFile:new() + WG[ephemeralConfig] = { + startPoints = configFile.startPoints, + byAllyTeamCount = configFile.byAllyTeamCount, + } + local output = configFile:serialize() + Spring.SetClipboard(output) + Spring.Log(widget:GetInfo().name, LOG.INFO, "copied to clipboard and stored ephemeral config") end local function resetLastCopy() - if WG[ephemeralConfig] then - doLoad(WG[ephemeralConfig]) - else - Spring.Log(widget:GetInfo().name, LOG.INFO, "no ephemeral config found to reset") - end + if WG[ephemeralConfig] then + doLoad(WG[ephemeralConfig]) + else + Spring.Log(widget:GetInfo().name, LOG.INFO, "no ephemeral config found to reset") + end end local function saveWIPConfig() - local configFile = ConfigFile:new() - local output = configFile:serialize() - local count = 1 - local filepathNoExtension = string.format("%s/%s%s", WIPConfigsDir, WIPConfigFilePrefix, Game.mapName) - local filepath = string.format("%s-%s.lua", filepathNoExtension, count) - while VFS.FileExists(filepath) do - count = count + 1 - filepath = string.format("%s-%s.lua", filepathNoExtension, count) - end - - local f, err = io.open(filepath, 'w') - if f then - f:write(output) - f:close() - Spring.Log(widget:GetInfo().name, LOG.INFO, string.format("saved to WIP config file %s", filepath)) - elseif err then - Spring.Log(widget:GetInfo().name, LOG.ERROR, err) - end + local configFile = ConfigFile:new() + local output = configFile:serialize() + local count = 1 + local filepathNoExtension = string.format("%s/%s%s", WIPConfigsDir, WIPConfigFilePrefix, Game.mapName) + local filepath = string.format("%s-%s.lua", filepathNoExtension, count) + while VFS.FileExists(filepath) do + count = count + 1 + filepath = string.format("%s-%s.lua", filepathNoExtension, count) + end + + local f, err = io.open(filepath, "w") + if f then + f:write(output) + f:close() + Spring.Log(widget:GetInfo().name, LOG.INFO, string.format("saved to WIP config file %s", filepath)) + elseif err then + Spring.Log(widget:GetInfo().name, LOG.ERROR, err) + end end local function loadWIPOrBARConfig() - local currentMapName = Game.mapName - local config = tryLoadWIPConfig(currentMapName) or tryLoadConfigFromBAR(currentMapName) - if config then - doLoad(config) - else - Spring.Log(widget:GetInfo().name, LOG.INFO, "no config found in WIP configs nor BAR configs for this map") - end + local currentMapName = Game.mapName + local config = tryLoadWIPConfig(currentMapName) or tryLoadConfigFromBAR(currentMapName) + if config then + doLoad(config) + else + Spring.Log(widget:GetInfo().name, LOG.INFO, "no config found in WIP configs nor BAR configs for this map") + end end -- for some reason actions do not get registered if not using lowercase names gg local actions = { - givestartpoint = { handler = giveStartPoint, keybind = "ctrl+sc_a" }, - removeselectedstartpoints = { handler = removeSelectedStartPoints, keybind = "ctrl+sc_d" }, - addlayout = { handler = addLayout, keybind = "sc_a" }, - removelayout = { handler = removeLayout, keybind = "sc_d" }, - previouspage = { handler = previousPage, keybind = "sc_q" }, - nextpage = { handler = nextPage, keybind = "sc_e" }, - copytoclipboard = { handler = copyToClipboard, keybind = "ctrl+sc_c" }, - resetlastcopy = { handler = resetLastCopy, keybind = "ctrl+sc_z" }, - savewipconfig = { handler = saveWIPConfig, keybind = "ctrl+sc_w" }, - loadwiporbarconfig = { handler = loadWIPOrBARConfig, keybind = "ctrl+sc_l" }, + givestartpoint = { handler = giveStartPoint, keybind = "ctrl+sc_a" }, + removeselectedstartpoints = { handler = removeSelectedStartPoints, keybind = "ctrl+sc_d" }, + addlayout = { handler = addLayout, keybind = "sc_a" }, + removelayout = { handler = removeLayout, keybind = "sc_d" }, + previouspage = { handler = previousPage, keybind = "sc_q" }, + nextpage = { handler = nextPage, keybind = "sc_e" }, + copytoclipboard = { handler = copyToClipboard, keybind = "ctrl+sc_c" }, + resetlastcopy = { handler = resetLastCopy, keybind = "ctrl+sc_z" }, + savewipconfig = { handler = saveWIPConfig, keybind = "ctrl+sc_w" }, + loadwiporbarconfig = { handler = loadWIPOrBARConfig, keybind = "ctrl+sc_l" }, } local function registerKeybinds(widget) - for name, action in pairs(actions) do - widgetHandler.actionHandler:AddAction(widget, name, action.handler, nil, 'p') - Spring.SendCommands(string.format("unbindkeyset %s", action.keybind)) - Spring.SendCommands(string.format("bind %s %s", action.keybind, name)) - end + for name, action in pairs(actions) do + widgetHandler.actionHandler:AddAction(widget, name, action.handler, nil, "p") + Spring.SendCommands(string.format("unbindkeyset %s", action.keybind)) + Spring.SendCommands(string.format("bind %s %s", action.keybind, name)) + end end local function unregisterKeybinds(widget) - for name, _ in pairs(actions) do - widgetHandler.actionHandler:RemoveAction(widget, name) - end - Spring.SendCommands("keyreload") + for name, _ in pairs(actions) do + widgetHandler.actionHandler:RemoveAction(widget, name) + end + Spring.SendCommands("keyreload") end -------------------------------------------------------------------------------- @@ -637,140 +632,142 @@ local glPopMatrix = gl.PopMatrix local isUIInitialized = false local function shutdownUI() - gl.DeleteFont(font) - isUIInitialized = false + gl.DeleteFont(font) + isUIInitialized = false end local function initializeUI() - vsx, vsy = GetViewGeometry() - DrawElement = WG.FlowUI.Draw.Element - local elementMargin = WG.FlowUI.elementMargin - - scaleFactor = vsx / 3840 -- this is my screen width, so all scaling is based off it - padding = paddingDefault * scaleFactor - textSizeIndexes = textSizeDefault * scaleFactor - textSizeText = 0.75 * textSizeIndexes - outlineSize = outlineSizeDefault * scaleFactor - - panelHotkeys.panelWidth = 15.7 * (padding + textSizeText) - panelHotkeys.panelHeight = 5.75 * (padding + textSizeText) - padding - panelHotkeys.px = vsx * 0.75 - panelHotkeys.panelWidth - if WG['advplayerlist_api'] then - local advPlayerListLeft = WG['advplayerlist_api'].GetPosition()[2] - panelHotkeys.px = advPlayerListLeft - panelHotkeys.panelWidth - WG.FlowUI.elementMargin - end - panelHotkeys.py = 0 - panelHotkeys.sx = panelHotkeys.px + panelHotkeys.panelWidth - panelHotkeys.sy = panelHotkeys.panelHeight - panelHotkeys.centerX = panelHotkeys.px + panelHotkeys.panelWidth / 2 - - panelLayouts.panelWidth = 16.6 * (padding + textSizeText) - panelLayouts.px = vsx - panelLayouts.panelWidth - panelLayouts.py = panelHotkeys.sy + elementMargin - panelLayouts.sx = vsx - panelLayouts.sy = (1 - 0.045) * vsy - - local fontfileScale = (0.5 + (vsx * vsy / 5700000)) -- MAGIC - font = gl.LoadFont(fontfile, textSizeIndexes * fontfileScale, outlineSize * fontfileScale, outlineStrength) - - isUIInitialized = true + vsx, vsy = GetViewGeometry() + DrawElement = WG.FlowUI.Draw.Element + local elementMargin = WG.FlowUI.elementMargin + + scaleFactor = vsx / 3840 -- this is my screen width, so all scaling is based off it + padding = paddingDefault * scaleFactor + textSizeIndexes = textSizeDefault * scaleFactor + textSizeText = 0.75 * textSizeIndexes + outlineSize = outlineSizeDefault * scaleFactor + + panelHotkeys.panelWidth = 15.7 * (padding + textSizeText) + panelHotkeys.panelHeight = 5.75 * (padding + textSizeText) - padding + panelHotkeys.px = vsx * 0.75 - panelHotkeys.panelWidth + if WG["advplayerlist_api"] then + local advPlayerListLeft = WG["advplayerlist_api"].GetPosition()[2] + panelHotkeys.px = advPlayerListLeft - panelHotkeys.panelWidth - WG.FlowUI.elementMargin + end + panelHotkeys.py = 0 + panelHotkeys.sx = panelHotkeys.px + panelHotkeys.panelWidth + panelHotkeys.sy = panelHotkeys.panelHeight + panelHotkeys.centerX = panelHotkeys.px + panelHotkeys.panelWidth / 2 + + panelLayouts.panelWidth = 16.6 * (padding + textSizeText) + panelLayouts.px = vsx - panelLayouts.panelWidth + panelLayouts.py = panelHotkeys.sy + elementMargin + panelLayouts.sx = vsx + panelLayouts.sy = (1 - 0.045) * vsy + + local fontfileScale = (0.5 + (vsx * vsy / 5700000)) -- MAGIC + font = gl.LoadFont(fontfile, textSizeIndexes * fontfileScale, outlineSize * fontfileScale, outlineStrength) + + isUIInitialized = true end function widget:ViewResize() - shutdownUI() - initializeUI() + shutdownUI() + initializeUI() end local function fontList(text, textColor, textSize, opts) - font:Begin() - font:SetTextColor(textColor) - font:SetOutlineColor(outlineColor) - font:Print(text, 0, 0, textSize, opts) - font:End() + font:Begin() + font:SetTextColor(textColor) + font:SetOutlineColor(outlineColor) + font:Print(text, 0, 0, textSize, opts) + font:End() end local function drawText(text, x, y, textColor, opts, textSize) - textColor = textColor or textColorDefault - opts = opts or "o" - textSize = textSize or textSizeText - local glList = glCreateList(fontList, text, textColor, textSize, opts) - glPushMatrix() - glTranslate(x, y, 0) - glCallList(glList) - glPopMatrix() - glDeleteList(glList) + textColor = textColor or textColorDefault + opts = opts or "o" + textSize = textSize or textSizeText + local glList = glCreateList(fontList, text, textColor, textSize, opts) + glPushMatrix() + glTranslate(x, y, 0) + glCallList(glList) + glPopMatrix() + glDeleteList(glList) end local function drawStartPoints() - for index, startPoint in ipairs(startPoints) do - local x, y, z = startPoint:getPosition() - x, z = WorldToScreenCoords(x, y + 30, z) - drawText(index, x, z, startPoint.isSelected and textColorSelected or nil, "cvo", textSizeIndexes) - end + for index, startPoint in ipairs(startPoints) do + local x, y, z = startPoint:getPosition() + x, z = WorldToScreenCoords(x, y + 30, z) + drawText(index, x, z, startPoint.isSelected and textColorSelected or nil, "cvo", textSizeIndexes) + end end local function nextLine(x, y) - return x + padding / 2 + textSizeText, y - padding - textSizeText + return x + padding / 2 + textSizeText, y - padding - textSizeText end local function nextIndex(x) - return x + padding + textSizeText + return x + padding + textSizeText end local function shouldDisplayAllyTeamCount(allyTeamCount) - local filter = availableFilters[currentFilter] - return allyTeamCount >= filter[1] and allyTeamCount <= filter[2] + local filter = availableFilters[currentFilter] + return allyTeamCount >= filter[1] and allyTeamCount <= filter[2] end local function drawByAllyTeamCount() - local px, py, sx, sy = panelLayouts.px, panelLayouts.py, panelLayouts.sx, panelLayouts.sy - - DrawElement(px, py, sx, sy) - local x, y = nextLine(px, sy) - for allyTeamCount, layouts in pairsByKeys(byAllyTeamCount) do - if shouldDisplayAllyTeamCount(allyTeamCount) then - local text = string.format("%s-way", allyTeamCount) - drawText(text, x - padding * 0.8, y, textColorHeader) - x, y = nextLine(px, y) - - for _, layout in pairs(layouts) do - for index, startPoint in pairsByKeys(layout) do - drawText(index, x, y, startPoint.isSelected and textColorSelected or nil, "co") - x = nextIndex(x) - end - x, y = nextLine(px, y) - end - end - end + local px, py, sx, sy = panelLayouts.px, panelLayouts.py, panelLayouts.sx, panelLayouts.sy + + DrawElement(px, py, sx, sy) + local x, y = nextLine(px, sy) + for allyTeamCount, layouts in pairsByKeys(byAllyTeamCount) do + if shouldDisplayAllyTeamCount(allyTeamCount) then + local text = string.format("%s-way", allyTeamCount) + drawText(text, x - padding * 0.8, y, textColorHeader) + x, y = nextLine(px, y) + + for _, layout in pairs(layouts) do + for index, startPoint in pairsByKeys(layout) do + drawText(index, x, y, startPoint.isSelected and textColorSelected or nil, "co") + x = nextIndex(x) + end + x, y = nextLine(px, y) + end + end + end end local function drawHotkeys() - local px, py, sx, sy = panelHotkeys.px, panelHotkeys.py, panelHotkeys.sx, panelHotkeys.sy - local centerX = panelHotkeys.centerX - - DrawElement(px, py, sx, sy) - local x, y = nextLine(px, sy) - drawText("Add point = Ctrl+A", x, y) - drawText("Remove point = Ctrl+D", centerX, y) - _, y = nextLine(x, y) - drawText("Add layout = A", x, y) - drawText("Remove layout = D", centerX, y) - _, y = nextLine(x, y) - drawText("Previous page = Q", x, y) - drawText("Next page = E", centerX, y) - _, y = nextLine(x, y) - drawText("Copy = Ctrl+C", x, y) - drawText("Reset last copy = Ctrl+Z", centerX, y) - _, y = nextLine(x, y) - drawText("Save WIP = Ctrl+W", x, y) - drawText("Load WIP/BAR = Ctrl+L", centerX, y) + local px, py, sx, sy = panelHotkeys.px, panelHotkeys.py, panelHotkeys.sx, panelHotkeys.sy + local centerX = panelHotkeys.centerX + + DrawElement(px, py, sx, sy) + local x, y = nextLine(px, sy) + drawText("Add point = Ctrl+A", x, y) + drawText("Remove point = Ctrl+D", centerX, y) + _, y = nextLine(x, y) + drawText("Add layout = A", x, y) + drawText("Remove layout = D", centerX, y) + _, y = nextLine(x, y) + drawText("Previous page = Q", x, y) + drawText("Next page = E", centerX, y) + _, y = nextLine(x, y) + drawText("Copy = Ctrl+C", x, y) + drawText("Reset last copy = Ctrl+Z", centerX, y) + _, y = nextLine(x, y) + drawText("Save WIP = Ctrl+W", x, y) + drawText("Load WIP/BAR = Ctrl+L", centerX, y) end function widget:DrawScreenEffects() - if IsGUIHidden() or not isUIInitialized then return end - drawStartPoints() - drawByAllyTeamCount() - drawHotkeys() + if IsGUIHidden() or not isUIInitialized then + return + end + drawStartPoints() + drawByAllyTeamCount() + drawHotkeys() end -------------------------------------------------------------------------------- @@ -780,53 +777,53 @@ local commanderNameTags = "Commander Name Tags" local wasCommanderNameTagsRemoved = false local function disableCommanderNameTags() - -- commander name tags interfere with our UI, so we use some tricks with - -- widgetHandler so that the widget gets disabled without getting toggled off - -- in the user configuration - local isCommanderNameTagsEnabled = widgetHandler:IsWidgetKnown(commanderNameTags) - if isCommanderNameTagsEnabled then - local commanderNameTagsWidget = widgetHandler:FindWidget(commanderNameTags) - widgetHandler:RemoveWidget(commanderNameTagsWidget) - wasCommanderNameTagsRemoved = true - end + -- commander name tags interfere with our UI, so we use some tricks with + -- widgetHandler so that the widget gets disabled without getting toggled off + -- in the user configuration + local isCommanderNameTagsEnabled = widgetHandler:IsWidgetKnown(commanderNameTags) + if isCommanderNameTagsEnabled then + local commanderNameTagsWidget = widgetHandler:FindWidget(commanderNameTags) + widgetHandler:RemoveWidget(commanderNameTagsWidget) + wasCommanderNameTagsRemoved = true + end end local function reEnableCommanderNameTags() - if wasCommanderNameTagsRemoved then - widgetHandler:EnableWidget(commanderNameTags) - wasCommanderNameTagsRemoved = false - end + if wasCommanderNameTagsRemoved then + widgetHandler:EnableWidget(commanderNameTags) + wasCommanderNameTagsRemoved = false + end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function isSoloDevMode() - -- compute if we are in a solo game (nothing but the player, not even AIs) - local gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID(), false)) - local allyTeamList = Spring.GetAllyTeamList() - local allyTeamCount = 0 - for _, allyTeam in ipairs(allyTeamList) do - if allyTeam ~= gaiaAllyTeamID then - allyTeamCount = allyTeamCount + 1 - end - end - local teamList = Spring.GetTeamList(Spring.GetMyAllyTeamID()) - local teamCount = table.count(teamList) - local isSolo = allyTeamCount == 1 and teamCount == 1 - - -- we only run in solo games with dev mode enabled, and not in replays - if not isSolo or not Spring.Utilities.IsDevMode() or Spring.IsReplay() then - return false - end - return true + -- compute if we are in a solo game (nothing but the player, not even AIs) + local gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID(), false)) + local allyTeamList = Spring.GetAllyTeamList() + local allyTeamCount = 0 + for _, allyTeam in ipairs(allyTeamList) do + if allyTeam ~= gaiaAllyTeamID then + allyTeamCount = allyTeamCount + 1 + end + end + local teamList = Spring.GetTeamList(Spring.GetMyAllyTeamID()) + local teamCount = table.count(teamList) + local isSolo = allyTeamCount == 1 and teamCount == 1 + + -- we only run in solo games with dev mode enabled, and not in replays + if not isSolo or not Spring.Utilities.IsDevMode() or Spring.IsReplay() then + return false + end + return true end local function lateInitialize(widget) - disableCommanderNameTags() - registerKeybinds(widget) - initializeStartPoints(widget) - initializeUI() + disableCommanderNameTags() + registerKeybinds(widget) + initializeStartPoints(widget) + initializeUI() end -------------------------------------------------------------------------------- @@ -835,35 +832,35 @@ end local initialFrame function widget:Initialize() - if not isSoloDevMode() then - widgetHandler:RemoveWidget(self) - return - end + if not isSoloDevMode() then + widgetHandler:RemoveWidget(self) + return + end - Spring.SetLogSectionFilterLevel(widget:GetInfo().name, LOG.INFO) - -- we register the `GameFrame` callin to defer the rest of initialization at a - -- later time. This is a kludge to make sure that we run very late, after the - -- `autocheat` widget has had a chance to enable cheating - initialFrame = Spring.GetGameFrame() - widgetHandler:UpdateWidgetCallIn('GameFrame', self); + Spring.SetLogSectionFilterLevel(widget:GetInfo().name, LOG.INFO) + -- we register the `GameFrame` callin to defer the rest of initialization at a + -- later time. This is a kludge to make sure that we run very late, after the + -- `autocheat` widget has had a chance to enable cheating + initialFrame = Spring.GetGameFrame() + widgetHandler:UpdateWidgetCallIn("GameFrame", self) end function widget:GameFrame(f) - if f > initialFrame + 10 then - widgetHandler:RemoveWidgetCallIn('GameFrame', self); + if f > initialFrame + 10 then + widgetHandler:RemoveWidgetCallIn("GameFrame", self) - if not Spring.IsCheatingEnabled() then - Spring.Log(widget:GetInfo().name, LOG.ERROR, "this widget needs cheating enabled") - widgetHandler:RemoveWidget(self) - return - end + if not Spring.IsCheatingEnabled() then + Spring.Log(widget:GetInfo().name, LOG.ERROR, "this widget needs cheating enabled") + widgetHandler:RemoveWidget(self) + return + end - lateInitialize(self) - end + lateInitialize(self) + end end function widget:Shutdown() - reEnableCommanderNameTags() - unregisterKeybinds(self) - shutdownUI() + reEnableCommanderNameTags() + unregisterKeybinds(self) + shutdownUI() end diff --git a/luaui/Widgets/dbg_frame_grapher.lua b/luaui/Widgets/dbg_frame_grapher.lua index 5f2a0e6b76b..8dc3ba853bb 100644 --- a/luaui/Widgets/dbg_frame_grapher.lua +++ b/luaui/Widgets/dbg_frame_grapher.lua @@ -3,8 +3,6 @@ -- reading on LuaVBO: https://github.com/beyond-all-reason/spring/blob/BAR/rts/Lua/LuaVBOImpl.cpp -- Quick video on what VAO/VBO are: https://www.youtube.com/watch?v=WMiggUPst-Q - - local widget = widget ---@type Widget function widget:GetInfo() @@ -15,12 +13,11 @@ function widget:GetInfo() date = "2021.mar.29", license = "GNU GPL, v2 or later", layer = -200001, - + enabled = false, } end - -- Localized functions for performance local mathAbs = math.abs local mathMin = math.min @@ -42,7 +39,7 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO +local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO local maxframes = 2500 @@ -137,32 +134,33 @@ void main() { ]] -------------------------------------------------------------------------------- - function widget:Initialize() - local rectvbo, numVertices = InstanceVBOTable.makeRectVBO(0,0,1,1,0,0,1,1) - rectInstanceTable = InstanceVBOTable.makeInstanceVBOTable( {{id = 1, name = "instances",size = 4}}, maxframes+100, "framegraphervbotable") - rectInstanceTable.VAO = InstanceVBOTable.makeVAOandAttach(rectvbo,rectInstanceTable.instanceVBO) - rectInstanceTable.numVertices = numVertices - - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() - rectShader = LuaShader({ - vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) , - fragment = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), - uniformInt = {}, -- usually textures go here - uniformFloat = { shaderparams = {alpha, 0.5, 0.5, 0.5},} -- other uniform params - }) - - local shaderCompiled = rectShader:Initialize() - if not shaderCompiled then - spEcho("Failed to compile shaders for: frame grapher v2") - widgetHandler:RemoveWidget(self) - end - timerstart = Spring.GetTimerMicros() - timerold = Spring.GetTimerMicros() + local rectvbo, numVertices = InstanceVBOTable.makeRectVBO(0, 0, 1, 1, 0, 0, 1, 1) + rectInstanceTable = InstanceVBOTable.makeInstanceVBOTable({ { id = 1, name = "instances", size = 4 } }, maxframes + 100, "framegraphervbotable") + rectInstanceTable.VAO = InstanceVBOTable.makeVAOandAttach(rectvbo, rectInstanceTable.instanceVBO) + rectInstanceTable.numVertices = numVertices + + local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() + rectShader = LuaShader({ + vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), + fragment = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), + uniformInt = {}, -- usually textures go here + uniformFloat = { shaderparams = { alpha, 0.5, 0.5, 0.5 } }, -- other uniform params + }) + + local shaderCompiled = rectShader:Initialize() + if not shaderCompiled then + spEcho("Failed to compile shaders for: frame grapher v2") + widgetHandler:RemoveWidget(self) + end + timerstart = Spring.GetTimerMicros() + timerold = Spring.GetTimerMicros() end function widget:Shutdown() - if rectShader then rectShader:Finalize() end + if rectShader then + rectShader:Finalize() + end end local wasgameframe = 0 @@ -170,104 +168,101 @@ local prevframems = 0 local gameFrameHappened = false local drawspergameframe = 0 - -local eventBuffer = {} --- This is a table of events that get pushed on every :DrawScreen +local eventBuffer = {} +-- This is a table of events that get pushed on every :DrawScreen -- Even types are : "sim","update", "draw", "swap", params are start, duration, type -local lastCallin = 'DrawGenesis' +local lastCallin = "DrawGenesis" local lastTime = Spring.GetTimerMicros() local frametypeidx = { - sim = 1, -- - update = 2, -- - draw = 3, -- - swap = 4, -- - error = 5, -- error + sim = 1, -- + update = 2, -- + draw = 3, -- + swap = 4, -- + error = 5, -- error } local nowToPrevToFrameType = { - GameFramePost = { - GameFramePost = "error", - GameFrame = "sim", - DrawGenesis = "error", - DrawScreenPost = "error", - Update = "error", - }, - GameFrame = { - GameFramePost = "none", - GameFrame = "error", - DrawGenesis = "error", - DrawScreenPost = "swap", - Update = "error", - }, - DrawGenesis = { - GameFramePost = "error", - GameFrame = "error", - DrawGenesis = "error", - DrawScreenPost = "error", - Update = "update", - }, - DrawScreenPost = { - GameFramePost = "error", - GameFrame = "error", - DrawGenesis = "draw", - DrawScreenPost = "error", - Update = "error", - }, - Update = { - GameFramePost = "none", - GameFrame = "error", - DrawGenesis = "error", - DrawScreenPost = "swap", - Update = "error", - }, - + GameFramePost = { + GameFramePost = "error", + GameFrame = "sim", + DrawGenesis = "error", + DrawScreenPost = "error", + Update = "error", + }, + GameFrame = { + GameFramePost = "none", + GameFrame = "error", + DrawGenesis = "error", + DrawScreenPost = "swap", + Update = "error", + }, + DrawGenesis = { + GameFramePost = "error", + GameFrame = "error", + DrawGenesis = "error", + DrawScreenPost = "error", + Update = "update", + }, + DrawScreenPost = { + GameFramePost = "error", + GameFrame = "error", + DrawGenesis = "draw", + DrawScreenPost = "error", + Update = "error", + }, + Update = { + GameFramePost = "none", + GameFrame = "error", + DrawGenesis = "error", + DrawScreenPost = "swap", + Update = "error", + }, } local function nowEvent(e) - local frameType = nowToPrevToFrameType[e][lastCallin] - local nowTime = Spring.GetTimerMicros() - if frameType ~= "error" then - local lastframetime = spDiffTimers(nowTime, timerstart, nil, true) * 1000 -- in MILLISECONDS - local lastframeduration = spDiffTimers(nowTime, lastTime, nil, true) * 1000 -- in MILLISECONDS - - eventBuffer[#eventBuffer+1] = {frameType, lastframetime, lastframeduration} - --spEcho("Event", frameType, "from", e, "duration", lastframeduration, "ms") - end - lastTime = nowTime - lastCallin = e + local frameType = nowToPrevToFrameType[e][lastCallin] + local nowTime = Spring.GetTimerMicros() + if frameType ~= "error" then + local lastframetime = spDiffTimers(nowTime, timerstart, nil, true) * 1000 -- in MILLISECONDS + local lastframeduration = spDiffTimers(nowTime, lastTime, nil, true) * 1000 -- in MILLISECONDS + + eventBuffer[#eventBuffer + 1] = { frameType, lastframetime, lastframeduration } + --spEcho("Event", frameType, "from", e, "duration", lastframeduration, "ms") + end + lastTime = nowTime + lastCallin = e end - -function widget:GameFramePost() - nowEvent("GameFramePost") - --spEcho("GameFramePost", spGetGameFrame()) +function widget:GameFramePost() + nowEvent("GameFramePost") + --spEcho("GameFramePost", spGetGameFrame()) end function widget:GameFrame(n) - nowEvent("GameFrame") - wasgameframe = wasgameframe + 1 - gameFrameHappened = true - if drawspergameframe ~= 2 then - --spEcho(drawspergameframe, "draws instead of 2", n) - end - drawspergameframe = 0 + nowEvent("GameFrame") + wasgameframe = wasgameframe + 1 + gameFrameHappened = true + if drawspergameframe ~= 2 then + --spEcho(drawspergameframe, "draws instead of 2", n) + end + drawspergameframe = 0 end function widget:DrawGenesis() - nowEvent("DrawGenesis") + nowEvent("DrawGenesis") end function widget:DrawScreenPost() - nowEvent("DrawScreenPost") + nowEvent("DrawScreenPost") end -function widget:Update() - nowEvent("Update") +function widget:Update() + nowEvent("Update") end function widget:DrawScreen() ---[[ + --[[ drawspergameframe = drawspergameframe + 1 local drawpersimframe = math.floor(Spring.GetFPS()/30.0 +0.5 ) @@ -305,29 +300,32 @@ function widget:DrawScreen() pushElementInstance(rectInstanceTable, {lastframetime, lastframeduration, 1, 3}, rectInstancePtr, true) end -]]--#region - - for i = 1, #eventBuffer do - local event = eventBuffer[i] - local frametype = event[1] - local lastframetime = event[2] - local lastframeduration = event[3] - - rectInstancePtr = rectInstancePtr+1 - if rectInstancePtr >= maxframes then rectInstancePtr = 0 end - local frameColor = frametypeidx[frametype] - --spEcho("Event", frametype, "frameColor", frameColor, lastframeduration, "ms", lastframetime) - pushElementInstance(rectInstanceTable, {lastframetime, lastframeduration, frameColor, 0 }, rectInstancePtr, true) - end - eventBuffer = {} -- clear the event buffer - - rectShader:Activate() - -- We should be setting individual uniforms AFTER activate - local shadertime = spDiffTimers(Spring.GetTimerMicros(), timerstart, nil, true) * 1000 -- in MILLISECONDS - rectShader:SetUniform("shaderparams", shadertime,0,0,0) - drawInstanceVBO(rectInstanceTable) - rectShader:Deactivate() - wasgameframe = 0 - prevframems = lastframeduration - gameFrameHappened = false +]] + --#region + + for i = 1, #eventBuffer do + local event = eventBuffer[i] + local frametype = event[1] + local lastframetime = event[2] + local lastframeduration = event[3] + + rectInstancePtr = rectInstancePtr + 1 + if rectInstancePtr >= maxframes then + rectInstancePtr = 0 + end + local frameColor = frametypeidx[frametype] + --spEcho("Event", frametype, "frameColor", frameColor, lastframeduration, "ms", lastframetime) + pushElementInstance(rectInstanceTable, { lastframetime, lastframeduration, frameColor, 0 }, rectInstancePtr, true) + end + eventBuffer = {} -- clear the event buffer + + rectShader:Activate() + -- We should be setting individual uniforms AFTER activate + local shadertime = spDiffTimers(Spring.GetTimerMicros(), timerstart, nil, true) * 1000 -- in MILLISECONDS + rectShader:SetUniform("shaderparams", shadertime, 0, 0, 0) + drawInstanceVBO(rectInstanceTable) + rectShader:Deactivate() + wasgameframe = 0 + prevframems = lastframeduration + gameFrameHappened = false end diff --git a/luaui/Widgets/dbg_jitter_timer.lua b/luaui/Widgets/dbg_jitter_timer.lua index 39f1301fa5a..7d3e6475289 100644 --- a/luaui/Widgets/dbg_jitter_timer.lua +++ b/luaui/Widgets/dbg_jitter_timer.lua @@ -1,5 +1,3 @@ - - local widget = widget ---@type Widget function widget:GetInfo() @@ -14,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathAbs = math.abs local mathMax = math.max @@ -27,14 +24,12 @@ local spEcho = Spring.Echo --------------------------- INFO ------------------------------- -- You can also add an exponential component to the load in ms with a second number param to the /****frameload commands - ---------------------------Speedups----------------------------- local spGetTimer = Spring.GetTimer local spDiffTimers = Spring.DiffTimers ---------------------------Internal vars--------------------------- - -local viewSizeX, viewSizeY = 0,0 +local viewSizeX, viewSizeY = 0, 0 local timerstart = nil local drawtimer = 0 @@ -62,13 +57,15 @@ local drawframespread = 0 local drawcounthist = {} local function Loadms(millisecs, spread) - if spread ~= nil then millisecs = millisecs + math.min(10*spread, -1.0 * spread * math.log(1.0 - math.random())) end + if spread ~= nil then + millisecs = millisecs + math.min(10 * spread, -1.0 * spread * math.log(1.0 - math.random())) + end --spEcho(millisecs) local starttimer = Spring.GetTimer() local nowtimer for i = 1, 10000000 do nowtimer = Spring.GetTimer() - if Spring.DiffTimers(nowtimer, starttimer )*1000 >= millisecs then + if Spring.DiffTimers(nowtimer, starttimer) * 1000 >= millisecs then break end end @@ -92,15 +89,13 @@ function widget:TextCommand(command) drawframespread = tonumber(words[3]) or 0 spEcho("Setting drawframeload to ", drawframeload, "spread", drawframespread) end - end function widget:ViewResize(vsx, vsy) - viewSizeX, viewSizeY = vsx , vsy + viewSizeX, viewSizeY = vsx, vsy end -function widget:Shutdown() -end +function widget:Shutdown() end local wasgameframe = 0 local prevframems = 0 @@ -109,15 +104,17 @@ local drawspergameframe = 0 local actualdrawspergameframe = 0 function widget:GameFrame(n) - simtime = simtime + 1 - wasgameframe = wasgameframe + 1 - gameFrameHappened = true - if drawspergameframe ~= 2 then - --spEcho(drawspergameframe, "draws instead of 2", n) - end - actualdrawspergameframe = drawspergameframe - drawspergameframe = 0 - if gameframeload > 0 then Loadms(gameframeload, gameframespread) end + simtime = simtime + 1 + wasgameframe = wasgameframe + 1 + gameFrameHappened = true + if drawspergameframe ~= 2 then + --spEcho(drawspergameframe, "draws instead of 2", n) + end + actualdrawspergameframe = drawspergameframe + drawspergameframe = 0 + if gameframeload > 0 then + Loadms(gameframeload, gameframespread) + end end local timerwidth = 512 @@ -136,8 +133,8 @@ spreadCTO = 0 function widget:DrawScreen() local newcamx, newcamy, newcamz = spGetCameraPosition() - local deltacam = math.sqrt(math.pow(newcamx- camX,2) + math.pow(newcamz - camZ, 2))-- + math.pow(newcamy - camY, 2)) - cammovemean = (camalpha) * deltacam + (1.0 - camalpha) * cammovemean + local deltacam = math.sqrt(math.pow(newcamx - camX, 2) + math.pow(newcamz - camZ, 2)) -- + math.pow(newcamy - camY, 2)) + cammovemean = camalpha * deltacam + (1.0 - camalpha) * cammovemean cammovespread = camalpha * mathAbs(cammovemean - deltacam) + (1.0 - camalpha) * cammovespread camX = newcamx camY = newcamy @@ -145,7 +142,7 @@ function widget:DrawScreen() local camerarelativejitter = cammovespread / mathMax(cammovemean, 0.001) drawspergameframe = drawspergameframe + 1 - local drawpersimframe = math.floor(Spring.GetFPS()/30.0 +0.5 ) + local drawpersimframe = math.floor(Spring.GetFPS() / 30.0 + 0.5) local fto = Spring.GetFrameTimeOffset() local timernew = spGetTimer() @@ -161,39 +158,31 @@ function widget:DrawScreen() local currCTOdelta = currdrawCTO - lastdrawCTO lastdrawCTO = currdrawCTO spreadCTO = (1.0 - alpha) * spreadCTO + alpha * mathAbs(averageCTO - currCTOdelta) - averageCTO = (1.0 - alpha ) * averageCTO + alpha * currCTOdelta + averageCTO = (1.0 - alpha) * averageCTO + alpha * currCTOdelta drawcounthist[actualdrawspergameframe] = (drawcounthist[actualdrawspergameframe] or 0) + 1 gl.PushMatrix() gl.Color(0.0, 0.0, 0.0, 1.0) --background rect - gl.Rect(viewSizeX - timerwidth,viewSizeY - timerYoffset-96,viewSizeX,viewSizeY - timerYoffset + timerheight); - - + gl.Rect(viewSizeX - timerwidth, viewSizeY - timerYoffset - 96, viewSizeX, viewSizeY - timerYoffset + timerheight) + gl.Color(1.0, 0.0, 1.0, 1.0) - gl.Rect(viewSizeX - (timerwidth*0.5),viewSizeY - timerYoffset + timerheight /2 ,viewSizeX + timerwidth * 0.5 - (timerwidth * (1.0 - deltajitter*30)),viewSizeY - timerYoffset + timerheight ); + gl.Rect(viewSizeX - (timerwidth * 0.5), viewSizeY - timerYoffset + timerheight / 2, viewSizeX + timerwidth * 0.5 - (timerwidth * (1.0 - deltajitter * 30)), viewSizeY - timerYoffset + timerheight) gl.Color(0.0, 0.5, 0.0, 1.0) - gl.Rect(viewSizeX - (timerwidth*0.5),viewSizeY - timerYoffset ,viewSizeX + timerwidth * 0.5 - (timerwidth * (1.0 - spreadCTO)),viewSizeY - timerYoffset + timerheight / 2); + gl.Rect(viewSizeX - (timerwidth * 0.5), viewSizeY - timerYoffset, viewSizeX + timerwidth * 0.5 - (timerwidth * (1.0 - spreadCTO)), viewSizeY - timerYoffset + timerheight / 2) - local text = '' + local text = "" gl.Color(1.0, 1.0, 1.0, 1.0) text = text .. string.format("DrawFrame FTODelta = %.3f FTO = %.3f\n", currCTOdelta, fto) - local drawhisttotal = mathMax(1,( - (drawcounthist[1] or 0 ) + (drawcounthist[2] or 0 ) + (drawcounthist[3] or 0) + (drawcounthist[4] or 0 ) ) ) - text = text .. string.format("dshist [1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d] \n", - (drawcounthist[1] or 0) , - (drawcounthist[2] or 0) , - (drawcounthist[3] or 0) , - (drawcounthist[4] or 0) , - (drawcounthist[5] or 0) , - (drawcounthist[6] or 0) ) + local drawhisttotal = mathMax(1, ((drawcounthist[1] or 0) + (drawcounthist[2] or 0) + (drawcounthist[3] or 0) + (drawcounthist[4] or 0))) + text = text .. string.format("dshist [1:%d, 2:%d, 3:%d, 4:%d, 5:%d, 6:%d] \n", (drawcounthist[1] or 0), (drawcounthist[2] or 0), (drawcounthist[3] or 0), (drawcounthist[4] or 0), (drawcounthist[5] or 0), (drawcounthist[6] or 0)) text = text .. string.format("deltajitter = %.3f d/s = %d\n", deltajitter * 30, actualdrawspergameframe) - text = text .. string.format("mean jitter = %.3f \n", avgjitter* 30) - text = text .. string.format("averageCTO = %.3f, spreadCTO = %.3f \n", averageCTO, spreadCTO ) - text = text .. string.format("CamJitter = %.3f \n",camerarelativejitter) - text = text .. string.format("DrawFrame = %d \n",Spring.GetDrawFrame()) + text = text .. string.format("mean jitter = %.3f \n", avgjitter * 30) + text = text .. string.format("averageCTO = %.3f, spreadCTO = %.3f \n", averageCTO, spreadCTO) + text = text .. string.format("CamJitter = %.3f \n", camerarelativejitter) + text = text .. string.format("DrawFrame = %d \n", Spring.GetDrawFrame()) gl.Text(text, viewSizeX - timerwidth, viewSizeY - timerYoffset + 48, 16, "d") --gl.Text(string.format("DrawFrame FTODelta = %.3f FTO = %.3f", currCTOdelta, fto), viewSizeX - timerwidth, viewSizeY - timerYoffset, 16, "d") @@ -202,20 +191,18 @@ function widget:DrawScreen() --gl.Text(string.format("averageCTO = %.3f, spreadCTO = %.3f ", averageCTO, spreadCTO ), viewSizeX - timerwidth, viewSizeY - timerYoffset + timerheight-48, 16, "d") - --gl.Text(string.format("CamSpread = %.3f, CamMean = %.3f deltacam = %.3f jitter = %.3f",cammovespread, cammovemean, deltacam,camerarelativejitter), viewSizeX - timerwidth, viewSizeY - timerYoffset + timerheight-84, 16, "d") --gl.Text(string.format("CamJitter = %.3f",camerarelativejitter), viewSizeX - timerwidth, viewSizeY - timerYoffset + timerheight-84, 16, "d") --gl.Text(string.format("DrawFrame = %d",Spring.GetDrawFrame()), viewSizeX - timerwidth, viewSizeY - timerYoffset + timerheight-116, 32, "d") gl.Color(1.0, 1.0, 1.0, 1.0) gl.PopMatrix() - - + -- Frame Drop Indicator!! local df = Spring.GetDrawFrame() - local offset = 32 * (df%8) - gl.Rect( viewSizeX - timerwidth + offset, viewSizeY - timerYoffset + timerheight-116, viewSizeX - timerwidth + 32 +offset, viewSizeY - timerYoffset + timerheight-116 -32) - if drawframeload > 0 then Loadms(drawframeload, drawframespread) end + local offset = 32 * (df % 8) + gl.Rect(viewSizeX - timerwidth + offset, viewSizeY - timerYoffset + timerheight - 116, viewSizeX - timerwidth + 32 + offset, viewSizeY - timerYoffset + timerheight - 116 - 32) + if drawframeload > 0 then + Loadms(drawframeload, drawframespread) + end end - - diff --git a/luaui/Widgets/dbg_mouse_to_mex_portable.lua b/luaui/Widgets/dbg_mouse_to_mex_portable.lua index 11a81f1ebd8..592c2595c1f 100644 --- a/luaui/Widgets/dbg_mouse_to_mex_portable.lua +++ b/luaui/Widgets/dbg_mouse_to_mex_portable.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "April 28, 2012", license = "GNU GPL, v2 or later", layer = 0, - enabled = false + enabled = false, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -51,13 +50,13 @@ function widget:MousePress(mx, my, button) local _, pos = Spring.TraceScreenRay(mx, my, true) if legalPos(pos) then --if true then - handle:write("[" .. mexIndex .. "] = {x = " .. floor(pos[1] + 0.5) .. ", z = " .. floor(pos[3] + 0.5) .. ", metal = " .. tostring(metal) .. "},\n") - handle:flush() - markers[#markers + 1] = { pos[1], 0, pos[3] } - Spring.MarkerAddPoint(pos[1], 0, pos[3], mexIndex) - mexIndex = mexIndex + 1 + handle:write("[" .. mexIndex .. "] = {x = " .. floor(pos[1] + 0.5) .. ", z = " .. floor(pos[3] + 0.5) .. ", metal = " .. tostring(metal) .. "},\n") + handle:flush() + markers[#markers + 1] = { pos[1], 0, pos[3] } + Spring.MarkerAddPoint(pos[1], 0, pos[3], mexIndex) + mexIndex = mexIndex + 1 --else - -- TODO: make right click remove markers + -- TODO: make right click remove markers -- Spring.MarkerErasePosition(pos[1], 0, pos[3]) --end end @@ -71,7 +70,7 @@ function widget:Initialize() return end handle = io.open("MexSpots_" .. Game.mapName, "w") - if (handle == nil) then + if handle == nil then widgetHandler:RemoveWidget() return end diff --git a/luaui/Widgets/dbg_profiler_histograms.lua b/luaui/Widgets/dbg_profiler_histograms.lua index 2f5a4cd138c..ad0add52c2c 100644 --- a/luaui/Widgets/dbg_profiler_histograms.lua +++ b/luaui/Widgets/dbg_profiler_histograms.lua @@ -17,7 +17,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathRandom = math.random @@ -33,7 +32,7 @@ local timerstart = nil local vsx, vsy = Spring.GetViewGeometry() ----------------------------GL4 vars---------------------------- -local boundingbox = {vsx/4, vsy/4, 3*vsx/4, 3*vsy/4} +local boundingbox = { vsx / 4, vsy / 4, 3 * vsx / 4, 3 * vsy / 4 } local histShader = nil @@ -91,18 +90,16 @@ void main() { } ]] - ------------------------ HISTOGRAM STUFF ------------------------------- local profilerecords = {} local bincount = 128 local binrez = 0.05 -- half MS resolutions local histograms = {} -- key name, value histogram object -local actives = {Sim = true} +local actives = { Sim = true } --actives['Draw'] = true -actives['Update'] = true -actives['Sim::Script'] = true - +actives["Update"] = true +actives["Sim::Script"] = true local function createhistogram(name) local newhist = { @@ -117,40 +114,39 @@ local function createhistogram(name) numtoobig = 0, mean = 0, linewidth = 2, - color = {mathRandom(),mathRandom(),mathRandom(),1}, + color = { mathRandom(), mathRandom(), mathRandom(), 1 }, } - for i=1,bincount do + for i = 1, bincount do newhist.data[i] = 0 end - - local histVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) + + local histVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) local VBOData = {} - for i = 1, bincount do - VBOData[#VBOData+1] = i/bincount-- X - VBOData[#VBOData+1] = i/bincount-- Y - end - - histVBO:Define( - bincount, - {{id = 0, name = "coords", size = 2}} - ) + for i = 1, bincount do + VBOData[#VBOData + 1] = i / bincount -- X + VBOData[#VBOData + 1] = i / bincount -- Y + end + + histVBO:Define(bincount, { { id = 0, name = "coords", size = 2 } }) histVBO:Upload(VBOData) histVAO = gl.GetVAO() histVAO:AttachVertexBuffer(histVBO) - + newhist.VBO = histVBO newhist.VAO = histVAO newhist.VBOData = VBOData return newhist end -local function updatehist(h,newvalue, counter) +local function updatehist(h, newvalue, counter) local total, current = spGetProfilerTimeRecord(h.name, false) - if not current then return end + if not current then + return + end counter = current - if counter then - if counter < h.last then + if counter then + if counter < h.last then newvalue = counter else newvalue = counter - h.last @@ -159,24 +155,23 @@ local function updatehist(h,newvalue, counter) else h.last = newvalue end - - if newvalue < h.binrez then + + if newvalue < h.binrez then h.numzeros = h.numzeros + 1 - return 0,0,0 - end - - - local binid = math.floor(math.min((newvalue/h.binrez), h.bincount -1)) + 1 - if binid == h.bincount then - h.numtoobig = h.numtoobig + 1 + return 0, 0, 0 end - + + local binid = math.floor(math.min((newvalue / h.binrez), h.bincount - 1)) + 1 + if binid == h.bincount then + h.numtoobig = h.numtoobig + 1 + end + local oldratio = h.mean * h.numsamples h.numsamples = h.numsamples + 1 h.mean = (oldratio + newvalue) / h.numsamples - + local newcount = h.data[binid] + 1 - if newcount > h.maxcount then + if newcount > h.maxcount then h.maxcount = newcount end h.data[binid] = newcount @@ -184,11 +179,13 @@ local function updatehist(h,newvalue, counter) end local function updateVBO(h) - if h == nil then return end + if h == nil then + return + end local vboData = h.VBOData - for i, count in ipairs(h.data) do - vboData[2*i - 1] = i / bincount - vboData[2*i ] = count / h.maxcount + for i, count in ipairs(h.data) do + vboData[2 * i - 1] = i / bincount + vboData[2 * i] = count / h.maxcount end h.VBO:Upload(vboData) end @@ -196,45 +193,41 @@ end ------------------- WIDGET STUFF -------------------------------------- function widget:Initialize() - lineVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) + lineVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) local VBOData = {} - for i = 1, bincount do - VBOData[#VBOData+1] = i-- X - VBOData[#VBOData+1] = i-- Y - end + for i = 1, bincount do + VBOData[#VBOData + 1] = i -- X + VBOData[#VBOData + 1] = i -- Y + end - lineVBO:Define( - bincount, - {{id = 0, name = "coords", size = 2}} - ) + lineVBO:Define(bincount, { { id = 0, name = "coords", size = 2 } }) lineVBO:Upload(VBOData) - --if true then return nil end + --if true then return nil end lineVAO = gl.GetVAO() lineVAO:AttachVertexBuffer(lineVBO) - + local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() histShader = LuaShader({ - vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) , + vertex = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), fragment = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs), uniformInt = {}, -- usually textures go here - uniformFloat = { - boundingbox = {0, 0, vsx, vsy}, - color = {1, 1, 1, 1}, - - } -- left, bottom,right,top - }) + uniformFloat = { + boundingbox = { 0, 0, vsx, vsy }, + color = { 1, 1, 1, 1 }, + }, -- left, bottom,right,top + }) local shaderCompiled = histShader:Initialize() if not shaderCompiled then - spEcho("Failed to compile shaders for: frame grapher v2") - widgetHandler:RemoveWidget(self) + spEcho("Failed to compile shaders for: frame grapher v2") + widgetHandler:RemoveWidget(self) end timerstart = Spring.GetTimer() timerold = Spring.GetTimer() - - for k,v in pairs(Spring.GetProfilerRecordNames()) do + + for k, v in pairs(Spring.GetProfilerRecordNames()) do --spEcho(k,v) profilerecords[k] = v histograms[v] = createhistogram(v) @@ -242,48 +235,53 @@ function widget:Initialize() end local function PrintRecord(name) - local total, current, maxdt, time, peak = Spring.GetProfilerTimeRecord(name,false) + local total, current, maxdt, time, peak = Spring.GetProfilerTimeRecord(name, false) -- where total is in milliseconds -- current gets reset ever 33 frames, and is a running tally -- maxdt is the peak value -- time is lag? -- peak is unknown? - - -- so last frame dt === - + + -- so last frame dt === + local gf = spGetGameFrame() - spEcho(gf, 'P:', name, total, current, maxdt, time, peak) + spEcho(gf, "P:", name, total, current, maxdt, time, peak) end local function GetRecordCurrent(name) - local total, current = Spring.GetProfilerTimeRecord(name,false) + local total, current = Spring.GetProfilerTimeRecord(name, false) return current end function widget:Shutdown() - if histShader then histShader:Finalize() end - for name,hist in pairs(histograms) do - if hist.VBO then hist.VBO:Delete() end - if hist.VAO then hist.VAO:Delete() end + if histShader then + histShader:Finalize() + end + for name, hist in pairs(histograms) do + if hist.VBO then + hist.VBO:Delete() + end + if hist.VAO then + hist.VAO:Delete() + end end end function widget:GameFrame(n) for name, hist in pairs(actives) do - if histograms[name] then + if histograms[name] then updatehist(histograms[name]) end end end function widget:DrawScreen() - histShader:Activate() - histShader:SetUniform("boundingbox", boundingbox[1],boundingbox[2],boundingbox[3],boundingbox[4]) - for name, _ in pairs(actives) do + histShader:SetUniform("boundingbox", boundingbox[1], boundingbox[2], boundingbox[3], boundingbox[4]) + for name, _ in pairs(actives) do local hist = histograms[name] - if hist then - if spGetGameFrame()%30 == 0 then + if hist then + if spGetGameFrame() % 30 == 0 then updateVBO(hist) end gl.LineWidth(hist.linewidth) @@ -300,17 +298,17 @@ end function widget:TextCommand(command) if string.find(command, "histogram", nil, true) then - local name = string.sub(command, string.len("histogram") +2) - if histograms[name] then - if actives[name] then - spEcho("Disabling histogram for",name) - actives[name] = nil + local name = string.sub(command, string.len("histogram") + 2) + if histograms[name] then + if actives[name] then + spEcho("Disabling histogram for", name) + actives[name] = nil else - spEcho("Enabling histogram for",name) - actives[name] = true + spEcho("Enabling histogram for", name) + actives[name] = true end else - spEcho("Unknown histogram name:",name) + spEcho("Unknown histogram name:", name) end end end @@ -388,4 +386,5 @@ end 68, Update::WorldDrawer 69, Update::WorldDrawer::{Sky,Water} - ]]-- + ]] +-- diff --git a/luaui/Widgets/dbg_quadtree_atlas_tester.lua b/luaui/Widgets/dbg_quadtree_atlas_tester.lua index be915957f59..fcebdb0adb6 100644 --- a/luaui/Widgets/dbg_quadtree_atlas_tester.lua +++ b/luaui/Widgets/dbg_quadtree_atlas_tester.lua @@ -12,26 +12,25 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor -- Localized Spring API for performance local spEcho = Spring.Echo -local MyAtlasOnDemand +local MyAtlasOnDemand local buildPicList = {} local font local t = "ABCDEFGHIJKLabcdefghij" local n = 0 function widget:Update() - n = n+ 1 + n = n + 1 if n % 100 == 0 then - for i = 1,10 do - local k,v = next(buildPicList) + for i = 1, 10 do + local k, v = next(buildPicList) --spEcho("Adding",k,v) - if k then + if k then --MyAtlasOnDemand:AddImage(v, 256,128) buildPicList[k] = nil --MyAtlasOnDemand:AddText({text = "TgTq"..tostring(n + i), font = font, options = 'bo'}) @@ -41,7 +40,7 @@ function widget:Update() end -- Draw everything to texture first here -function widget:DrawGenesis() -- YES WE CAN! +function widget:DrawGenesis() -- YES WE CAN! MyAtlasOnDemand:RenderTasks() end @@ -51,23 +50,22 @@ local textItems = {} function widget:DrawScreen() -- perform draw tasks, if any MyAtlasOnDemand:RenderTasks() - - + -- Draw a grey background: gl.Color(0.5, 0.5, 0.5, 1.0) local o = 10 - gl.Rect(o,o,MyAtlasOnDemand.xsize + o, MyAtlasOnDemand.ysize + o ) + gl.Rect(o, o, MyAtlasOnDemand.xsize + o, MyAtlasOnDemand.ysize + o) gl.Color(1.0, 1.0, 1.0, 1.0) - + -- Draw the Atlas: - MyAtlasOnDemand:DrawToScreen() + MyAtlasOnDemand:DrawToScreen() -- Add our random tester texts to the atlas - if first then - for j, num in ipairs({"59", "Tlgfi", "g1","60"}) do - for i,fontsize in ipairs({9, 13,16,27, 36}) do - local id = tostring(num).."_"..tostring(fontsize) - local textItem = {text = tostring(num), font = font, size = fontsize, id = id} + if first then + for j, num in ipairs({ "59", "Tlgfi", "g1", "60" }) do + for i, fontsize in ipairs({ 9, 13, 16, 27, 36 }) do + local id = tostring(num) .. "_" .. tostring(fontsize) + local textItem = { text = tostring(num), font = font, size = fontsize, id = id } local uvcoords = MyAtlasOnDemand:AddText(tostring(num), textItem) textItem.uvcoords = uvcoords textItems[id] = textItem @@ -76,47 +74,46 @@ function widget:DrawScreen() end first = false end - + -- Draw with the actual font renderer as second column font:Begin() local offsetX = 64 - for id,textItem in pairs(textItems) do + for id, textItem in pairs(textItems) do local xpos = mathFloor(o + offsetX + textItem.uvcoords.x * MyAtlasOnDemand.xsize) local ypos = mathFloor(o + textItem.uvcoords.y * MyAtlasOnDemand.ysize + textItem.uvcoords.d) - font:Print(textItem.text, xpos,ypos ,textItem.size,'') + font:Print(textItem.text, xpos, ypos, textItem.size, "") end font:End() - + -- Draw With silly TextRect overrider as third column gl.Texture(MyAtlasOnDemand.textureID) local offsetX = 128 --gl.Blending(GL.ONE, GL.ZERO) -- do full opaque gl.Blending(GL.ONE, GL.ONE_MINUS_SRC_ALPHA) -- do full opaque - for id,textItem in pairs(textItems) do - MyAtlasOnDemand:TextRect(id, o + offsetX + textItem.uvcoords.x * MyAtlasOnDemand.xsize, o + textItem.uvcoords.y *MyAtlasOnDemand.ysize + textItem.uvcoords.d) + for id, textItem in pairs(textItems) do + MyAtlasOnDemand:TextRect(id, o + offsetX + textItem.uvcoords.x * MyAtlasOnDemand.xsize, o + textItem.uvcoords.y * MyAtlasOnDemand.ysize + textItem.uvcoords.d) end gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- reset blending - end function widget:Initialize() --font = WG['fonts'].getFont() font = gl.LoadFont("fonts/" .. Spring.GetConfigString("bar_font", "Poppins-Regular.otf"), 64, 1, 1) - + local MakeAtlasOnDemand = VFS.Include("LuaUI/Include/AtlasOnDemand.lua") if not MakeAtlasOnDemand then spEcho("Failed to load AtlasOnDemand") - return + return end - MyAtlasOnDemand = MakeAtlasOnDemand({sizex = 1024, sizey = 512, xresolution = 224, yresolution = 24, name = "AtlasOnDemand Tester", font = {font = font}, debug = true}) - buildPicList = VFS.DirList("unitpics") - - MyAtlasOnDemand:AddImage('luaui/images/aliasing_test_grid_128.tga', 256, 256) - MyAtlasOnDemand:AddImage('unitpics/armcom.dds', 256, 256) + MyAtlasOnDemand = MakeAtlasOnDemand({ sizex = 1024, sizey = 512, xresolution = 224, yresolution = 24, name = "AtlasOnDemand Tester", font = { font = font }, debug = true }) + buildPicList = VFS.DirList("unitpics") + + MyAtlasOnDemand:AddImage("luaui/images/aliasing_test_grid_128.tga", 256, 256) + MyAtlasOnDemand:AddImage("unitpics/armcom.dds", 256, 256) end function widget:ShutDown() - if MyAtlasOnDemand then + if MyAtlasOnDemand then MyAtlasOnDemand:Destroy() end end diff --git a/luaui/Widgets/dbg_reloadcob.lua b/luaui/Widgets/dbg_reloadcob.lua index ab73e993f89..67fd212a70d 100644 --- a/luaui/Widgets/dbg_reloadcob.lua +++ b/luaui/Widgets/dbg_reloadcob.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2024.03.12", license = "GNU GPL v2", layer = 0, - enabled = false -- loaded by default? + enabled = false, -- loaded by default? } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -43,16 +42,15 @@ function widget:Update() if doReload then local reloadedCobDefs = {} local selection = Spring.GetSelectedUnits() - for i, unitID in ipairs(selection) do + for i, unitID in ipairs(selection) do local unitDefID = Spring.GetUnitDefID(unitID) - if not reloadedCobDefs[unitDefID] then + if not reloadedCobDefs[unitDefID] then local unitDefName = UnitDefs[unitDefID].name - Spring.SendCommands('reloadcob ' .. unitDefName) - spEcho("Reloaded COB: ".. unitDefName .. " from " .. UnitDefs[unitDefID].scriptName) + Spring.SendCommands("reloadcob " .. unitDefName) + spEcho("Reloaded COB: " .. unitDefName .. " from " .. UnitDefs[unitDefID].scriptName) reloadedCobDefs[unitDefID] = true end end doReload = false end end - diff --git a/luaui/Widgets/dbg_startbox_editor.lua b/luaui/Widgets/dbg_startbox_editor.lua index fc41c664d83..c6f698f4ed4 100644 --- a/luaui/Widgets/dbg_startbox_editor.lua +++ b/luaui/Widgets/dbg_startbox_editor.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Startbox Editor", - desc = "cruder than yo momma", - author = "git blame", - date = "git log", + name = "Startbox Editor", + desc = "cruder than yo momma", + author = "git blame", + date = "git log", license = "PD", - layer = 999999, + layer = 999999, enabled = false, } end - -- Localized functions for performance local mathAbs = math.abs local mathFloor = math.floor @@ -33,10 +31,10 @@ S to export and add team boxes to file startboxes_mapname.txt how to apply the export, see: http://zero-k.info/mediawiki/index.php?title=Startbox_API ]] -local polygon = { } -local final_polygons = { } +local polygon = {} +local final_polygons = {} local exportedTeam = 0 -local exported = '' +local exported = "" local exportPrefix = "return {\n" local exportSuffix = "}\n" @@ -49,17 +47,17 @@ function widget:MousePress(mx, my, button) end if #polygon == 0 then - polygon[#polygon+1] = pos + polygon[#polygon + 1] = pos else local dx = mathAbs(pos[1] - polygon[#polygon][1]) local dz = mathAbs(pos[3] - polygon[#polygon][3]) - if (dx > 10 or dz > 10) then - polygon[#polygon+1] = pos + if dx > 10 or dz > 10 then + polygon[#polygon + 1] = pos end end if button ~= 1 then - final_polygons[#final_polygons+1] = polygon + final_polygons[#final_polygons + 1] = polygon polygon = {} end return true @@ -82,7 +80,7 @@ function widget:MouseMove(mx, my) local dx = mathAbs(pos[1] - polygon[#polygon][1]) local dz = mathAbs(pos[3] - polygon[#polygon][3]) if dx > 10 or dz > 10 then - polygon[#polygon+1] = pos + polygon[#polygon + 1] = pos end end return true @@ -92,9 +90,9 @@ include("keysym.h.lua") function widget:KeyPress(key) if key == KEYSYMS.S then - local str = "\t["..exportedTeam.."] = {\n" - str = str .. "\t\tnameLong = \"\",\n" - str = str .. "\t\tnameShort = \"\",\n" + local str = "\t[" .. exportedTeam .. "] = {\n" + str = str .. '\t\tnameLong = "",\n' + str = str .. '\t\tnameShort = "",\n' str = str .. "\t\tstartpoints = {},\n" str = str .. "\t\tboxes = {\n" -- not as separate echoes because timestamp keeps getting in the way for j = 1, #final_polygons do @@ -110,11 +108,11 @@ function widget:KeyPress(key) str = str .. "\t},\n" exported = exported .. str - local filename = 'startboxes_'..Game.mapName..'.txt' - local file = assert(io.open(filename, 'w'), 'Unable to save '..filename) - file:write(exportPrefix..exported..exportSuffix) + local filename = "startboxes_" .. Game.mapName .. ".txt" + local file = assert(io.open(filename, "w"), "Unable to save " .. filename) + file:write(exportPrefix .. exported .. exportSuffix) file:close() - Spring.Echo((exportedTeam == 0 and 'saved' or 'added')..' team '..exportedTeam..' startboxes to '..filename) + Spring.Echo((exportedTeam == 0 and "saved" or "added") .. " team " .. exportedTeam .. " startboxes to " .. filename) final_polygons = {} exportedTeam = exportedTeam + 1 @@ -129,13 +127,13 @@ local function DrawLine() local x = polygon[i][1] local z = polygon[i][3] local y = spGetGroundHeight(x, z) - gl.Vertex(x,y,z) + gl.Vertex(x, y, z) end - local mx,my = Spring.GetMouseState() + local mx, my = Spring.GetMouseState() local pos = select(2, spTraceScreenRay(mx, my, true)) if pos then - gl.Vertex(pos[1],pos[2],pos[3]) + gl.Vertex(pos[1], pos[2], pos[3]) end end @@ -145,14 +143,16 @@ local function DrawFinalLine(fpi) local x = poly[i][1] local z = poly[i][3] local y = spGetGroundHeight(x, z) - gl.Vertex(x,y,z) + gl.Vertex(x, y, z) end gl.Vertex(poly[1][1], poly[1][2], poly[1][3]) end function widget:DrawWorld() - if #final_polygons == 0 and #polygon == 0 then return end + if #final_polygons == 0 and #polygon == 0 then + return + end gl.LineWidth(3.0) gl.Color(0, 1, 0, 0.5) for i = 1, #final_polygons do diff --git a/luaui/Widgets/dbg_test_headless_overrides.lua b/luaui/Widgets/dbg_test_headless_overrides.lua index 64590cdefcf..4afd49bf6c9 100644 --- a/luaui/Widgets/dbg_test_headless_overrides.lua +++ b/luaui/Widgets/dbg_test_headless_overrides.lua @@ -19,4 +19,3 @@ end -- is placed inside a display list, this can cause problems. gl.PushMatrix = function() end gl.PopMatrix = function() end - diff --git a/luaui/Widgets/dbg_test_runner.lua b/luaui/Widgets/dbg_test_runner.lua index 33d25feaedb..cac2e59c60e 100644 --- a/luaui/Widgets/dbg_test_runner.lua +++ b/luaui/Widgets/dbg_test_runner.lua @@ -11,7 +11,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -19,15 +18,15 @@ if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePla return end -local Proxy = VFS.Include('common/testing/synced_proxy.lua') -local MochaJSONReporter = VFS.Include('common/testing/mocha_json_reporter.lua') -local Assertions = VFS.Include('common/testing/assertions.lua') -local TestResults = VFS.Include('common/testing/results.lua') -local Util = VFS.Include('common/testing/util.lua') -local Mock = VFS.Include('common/testing/mock.lua') -local TestExtraUtils = VFS.Include('common/testing/test_extra_utils.lua') +local Proxy = VFS.Include("common/testing/synced_proxy.lua") +local MochaJSONReporter = VFS.Include("common/testing/mocha_json_reporter.lua") +local Assertions = VFS.Include("common/testing/assertions.lua") +local TestResults = VFS.Include("common/testing/results.lua") +local Util = VFS.Include("common/testing/util.lua") +local Mock = VFS.Include("common/testing/mock.lua") +local TestExtraUtils = VFS.Include("common/testing/test_extra_utils.lua") -local rpc = VFS.Include('common/testing/rpc.lua'):new() +local rpc = VFS.Include("common/testing/rpc.lua"):new() local LOG_LEVEL = LOG.INFO @@ -62,11 +61,7 @@ local function log(level, str, ...) if level < LOG_LEVEL then return end - Spring.Log( - widget:GetInfo().name, - LOG.NOTICE, - str - ) + Spring.Log(widget:GetInfo().name, LOG.NOTICE, str) end local function logStartTests() @@ -93,17 +88,9 @@ local function logTestResult(testResult) return end - testReporter:testResult( - testResult.label, - testResult.filename, - (testResult.result == TestResults.TEST_RESULT.PASS), - (testResult.result == TestResults.TEST_RESULT.SKIP), - testResult.milliseconds, - testResult.error - ) + testReporter:testResult(testResult.label, testResult.filename, (testResult.result == TestResults.TEST_RESULT.PASS), (testResult.result == TestResults.TEST_RESULT.SKIP), testResult.milliseconds, testResult.error) end - local function matchesPatterns(str, patterns) for _, p in ipairs(patterns) do if string.match(str, p) then @@ -122,16 +109,16 @@ local function processScenarioArguments(args) if args then for index, pair in ipairs(args) do for key, default in pairs(pair) do - local val = scenarioOpts[index+1] - if val and type(default) == 'number' then + local val = scenarioOpts[index + 1] + if val and type(default) == "number" then val = tonumber(val) end scenarioConfig[key] = val or default end end else - for idx=2, #scenarioOpts do - scenarioConfig[idx-1] = scenarioOpts[idx] + for idx = 2, #scenarioOpts do + scenarioConfig[idx - 1] = scenarioOpts[idx] end end end @@ -141,8 +128,8 @@ end local function findTestFiles(directory, patterns, rootDirectory, result) if rootDirectory == nil then - if directory:sub(-1) ~= '/' then - directory = directory .. '/' + if directory:sub(-1) ~= "/" then + directory = directory .. "/" end rootDirectory = directory end @@ -182,7 +169,7 @@ local function findAllTestFiles(patterns) end end if headless then - result[#result+1] = {label="infolog", filename="common/testing/infologtest.lua"} + result[#result + 1] = { label = "infolog", filename = "common/testing/infologtest.lua" } end return result end @@ -220,10 +207,9 @@ local testRunState local activeTestState local resumeState local returnState -local callinState = {callins = {}, recording = {}, unsafe = false} +local callinState = { callins = {}, recording = {}, unsafe = false } local spyControls - -- callin tracking -- ========= @@ -279,17 +265,16 @@ local function initRecorderFunction(name) local buffers = callinState.buffer local recorderFunc = function(_, ...) local buffer = buffers[name] - buffer[#buffer+1] = {...} + buffer[#buffer + 1] = { ... } end return recorderFunc end - local function trackCallin(target, name, callback, mode) if not target then target = widget end - if name == 'GameFrame' or name == 'Shutdown' then + if name == "GameFrame" or name == "Shutdown" then error("Can't track GameFrame or Shutdown callins") end target[name] = callback @@ -297,7 +282,6 @@ local function trackCallin(target, name, callback, mode) callinState.callins[name] = mode end - -- Hook callin -- Will register to count either predicate success or execution counts. -- predicate will be passed the callin arguments. @@ -310,7 +294,7 @@ function registerCallin(name, predicate, target, depth) -- checks and init if not callinState.unsafe and not callinState.recording[name] then - error("[registerCallin:" .. name .. "] need to call Test.expectCallin(\"" .. name .. "\") first", depth) + error("[registerCallin:" .. name .. '] need to call Test.expectCallin("' .. name .. '") first', depth) end local mode = getRecordMode(predicate) local prevMode = callinState.callins[name] @@ -341,7 +325,7 @@ end function startRecordingCallin(name, full, target, depth) local depth = depth + 1 if callinState.recording[name] then - error("[preRegisterCallin:" .. name .. "] already pre-registered", depth) + error("[preRegisterCallin:" .. name .. "] already pre-registered", depth) elseif callinState.callins[name] then error("[preRegisterCallin:" .. name .. "] already registered", depth) end @@ -399,7 +383,6 @@ local function removeAllCallins(target) callinState.counts = {} end - -- state reset -- ========= @@ -465,7 +448,6 @@ end resetState() - local MAX_START_TESTS_ATTEMPTS = 10 local MAX_START_WAIT_SECS = 10 local queuedStartTests = false @@ -489,35 +471,22 @@ local function startTests(patterns) end if not Spring.GetGameRulesParam("isSyncedProxyEnabled") then - log( - LOG.ERROR, - "The Synced Proxy gadget is required in order to run tests. It requires single player, dev mode, " .. - "and cheating to be enabled." - ) + log(LOG.ERROR, "The Synced Proxy gadget is required in order to run tests. It requires single player, dev mode, " .. "and cheating to be enabled.") return end local neededActions = {} if not Spring.IsCheatingEnabled() then - neededActions[#neededActions+1] = {'cheat', - 'Cheats are disabled; attempting to enable them...', - 'Could not enable cheats; tests cannot be run.'} + neededActions[#neededActions + 1] = { "cheat", "Cheats are disabled; attempting to enable them...", "Could not enable cheats; tests cannot be run." } end if not Spring.IsDevLuaEnabled() then - neededActions[#neededActions+1] = {'devlua', - 'DevLua mode disabled; attempting to enable it...', - 'Could not enable DevLua mode; tests cannot be run.'} + neededActions[#neededActions + 1] = { "devlua", "DevLua mode disabled; attempting to enable it...", "Could not enable DevLua mode; tests cannot be run." } end - if Spring.GetModOptions().deathmode ~= 'neverend' and not Spring.GetGameRulesParam('testEndConditionsOverride') then - neededActions[#neededActions+1] = {'luarules setTestEndConditions', - "Disabling end conditions...", - "Could not override game end condition. Please use deathmode='neverend' game end mode. " .. - "This is required in order to run tests, so that the game stays active between tests."} + if Spring.GetModOptions().deathmode ~= "neverend" and not Spring.GetGameRulesParam("testEndConditionsOverride") then + neededActions[#neededActions + 1] = { "luarules setTestEndConditions", "Disabling end conditions...", "Could not override game end condition. Please use deathmode='neverend' game end mode. " .. "This is required in order to run tests, so that the game stays active between tests." } end - if spGetGameFrame() < 1 and not Spring.GetGameRulesParam('testEnvironmentStarting') then - neededActions[#neededActions+1] = {'luarules setTestReadyPlayers', - "Preparing players to start game...", - 'Could not prepare players. Please start game manually.'} + if spGetGameFrame() < 1 and not Spring.GetGameRulesParam("testEnvironmentStarting") then + neededActions[#neededActions + 1] = { "luarules setTestReadyPlayers", "Preparing players to start game...", "Could not prepare players. Please start game manually." } end if #neededActions > 0 then if not queuedStartTests then @@ -550,7 +519,7 @@ local function startTests(patterns) elseif os.clock() - startGameTime > MAX_START_WAIT_SECS then startGameTime = 0 queuedStartTests = false - log(LOG.ERROR, "Game didn't start in time for tests", os.clock() - (startGameTime)) + log(LOG.ERROR, "Game didn't start in time for tests", os.clock() - startGameTime) end return end @@ -570,7 +539,7 @@ local function startTests(patterns) testRunState.files = findAllTestFiles(patterns) - if testRunState.files == nil or #(testRunState.files) == 0 then + if testRunState.files == nil or #testRunState.files == 0 then log(LOG.INFO, "no test files found") return end @@ -600,14 +569,14 @@ local function finishTest(result) logTestResult(result) - testRunState.results[#(testRunState.results) + 1] = result + testRunState.results[#testRunState.results + 1] = result resetActiveTestState() resetResumeState() resetReturnState() resetCallinState() - if testRunState.filesIndex < #(testRunState.files) then + if testRunState.filesIndex < #testRunState.files then testRunState.filesIndex = testRunState.filesIndex + 1 else -- done @@ -715,25 +684,17 @@ Test = { waitFrames = function(frames) log(LOG.DEBUG, "[waitFrames] " .. frames) local startFrame = spGetGameFrame() - Test.waitUntil( - function() - return spGetGameFrame() >= (startFrame + frames) - end, - frames + 5, - 1 - ) + Test.waitUntil(function() + return spGetGameFrame() >= (startFrame + frames) + end, frames + 5, 1) log(LOG.DEBUG, "[waitFrames.done]") end, waitTime = function(milliseconds, timeout) log(LOG.DEBUG, "[waitTime] " .. milliseconds) local startTimer = Spring.GetTimer() - Test.waitUntil( - function() - return Spring.DiffTimers(Spring.GetTimer(), startTimer, true) >= milliseconds - end, - timeout or (milliseconds * 30 / 1000 + 5), - 1 - ) + Test.waitUntil(function() + return Spring.DiffTimers(Spring.GetTimer(), startTimer, true) >= milliseconds + end, timeout or (milliseconds * 30 / 1000 + 5), 1) log(LOG.DEBUG, "[waitTime.done]") end, expectCallin = function(name, countOnly, depth) @@ -752,9 +713,9 @@ Test = { local count = count or 1 local counts = callinState.counts - Test.waitUntil(function() return counts[name] >= count end, - timeout, - 1) + Test.waitUntil(function() + return counts[name] >= count + end, timeout, 1) if callinState.recording[name] then resumeRecordingCallin(name, nil, depth) @@ -815,8 +776,7 @@ Test = { prepareWidget = function(widgetName) -- Enable widget with locals access and store state for later restoring -- through restoreWidget(s). - assert(widgetHandler.knownWidgets[widgetName] ~= nil, - string.format("prepareWidget: unknown widget %q — not in widgetHandler.knownWidgets", widgetName)) + assert(widgetHandler.knownWidgets[widgetName] ~= nil, string.format("prepareWidget: unknown widget %q — not in widgetHandler.knownWidgets", widgetName)) initialWidgetActive[widgetName] = widgetHandler.knownWidgets[widgetName].active or false if initialWidgetActive[widgetName] then @@ -825,8 +785,7 @@ Test = { widgetHandler:EnableWidgetRaw(widgetName, true) local widget = widgetHandler:FindWidget(widgetName) - assert(widget, - string.format("prepareWidget: widget %q returned nil from FindWidget after EnableWidgetRaw", widgetName)) + assert(widget, string.format("prepareWidget: widget %q returned nil from FindWidget after EnableWidgetRaw", widgetName)) return widget end, restoreWidget = function(widgetName) @@ -834,8 +793,7 @@ Test = { -- Otherwise testrunner will run it automatically through restoreWidgets. local wasActive = initialWidgetActive[widgetName] initialWidgetActive[widgetName] = nil - assert(wasActive ~= nil, - string.format("restoreWidget: widget %q was never prepared (no entry in initialWidgetActive)", widgetName)) + assert(wasActive ~= nil, string.format("restoreWidget: widget %q was never prepared (no entry in initialWidgetActive)", widgetName)) widgetHandler:DisableWidgetRaw(widgetName) if wasActive then @@ -851,7 +809,7 @@ Test = { local restoreOk, restoreResult = pcall(Test.restoreWidget, widgetName) if not restoreOk then allOk = false - failed[#failed+1] = widgetName + failed[#failed + 1] = widgetName log(LOG.DEBUG, "[restoreWidgets.error] " .. widgetName .. " " .. tostring(restoreResult)) end end @@ -871,7 +829,7 @@ function widget:RecvLuaMsg(msg) return end - if msg:sub(1, #(Proxy.PREFIX.RETURN)) == Proxy.PREFIX.RETURN then + if msg:sub(1, #Proxy.PREFIX.RETURN) == Proxy.PREFIX.RETURN then local serializedReturn = msg:sub(#Proxy.PREFIX.RETURN + 1) local returnOk, returnValueOrError, returnID = rpc:deserializeFunctionReturn(serializedReturn) @@ -911,7 +869,8 @@ local function runTestInternal() log(LOG.DEBUG, "[runTestInternal.skip]") skipOk, skipResult = Util.yieldable_pcall(skip) log(LOG.DEBUG, "[runTestInternal.skip.done] " .. table.toString({ - skipOk, skipResult + skipOk, + skipResult, })) if not skipOk then @@ -929,7 +888,8 @@ local function runTestInternal() log(LOG.DEBUG, "[runTestInternal.setup]") setupOk, setupResult = Util.yieldable_pcall(setup) log(LOG.DEBUG, "[runTestInternal.setup.done] " .. table.toString({ - setupOk, setupResult + setupOk, + setupResult, })) else log(LOG.DEBUG, "[runTestInternal.setup.skipped]") @@ -941,7 +901,8 @@ local function runTestInternal() log(LOG.DEBUG, "[runTestInternal.test]") testOk, testResult = Util.yieldable_pcall(test) log(LOG.DEBUG, "[runTestInternal.test.done] " .. table.toString({ - testOk, testResult + testOk, + testResult, })) end @@ -951,7 +912,8 @@ local function runTestInternal() log(LOG.DEBUG, "[runTestInternal.cleanup]") cleanupOk, cleanupResult = Util.yieldable_pcall(cleanup) log(LOG.DEBUG, "[runTestInternal.cleanup.done] " .. table.toString({ - cleanupOk, cleanupResult + cleanupOk, + cleanupResult, })) else log(LOG.DEBUG, "[runTestInternal.cleanup.skipped]") @@ -1107,17 +1069,15 @@ local function handleReturn() log(LOG.DEBUG, "[handleReturn] timeout -> error") return { status = "error", - error = "waiting for synced return timed out" + error = "waiting for synced return timed out", } end end if returnState.waitingForReturnID then - log(LOG.DEBUG, string.format( - "[handleReturn] waiting for return ID: %s", returnState.waitingForReturnID - )) + log(LOG.DEBUG, string.format("[handleReturn] waiting for return ID: %s", returnState.waitingForReturnID)) return { - status = "wait" + status = "wait", } end @@ -1130,7 +1090,7 @@ local function handleReturn() resetReturnState() return { status = "continue", - returnValue = tempReturnValue + returnValue = tempReturnValue, } else -- remote function errored @@ -1166,12 +1126,12 @@ local function handleWait() log(LOG.DEBUG, "[handleWait] predicate success + true -> continue") resetResumeState() return { - status = "continue" + status = "continue", } else -- failed, wait and try again next frame return { - status = "wait" + status = "wait", } end else @@ -1179,7 +1139,7 @@ local function handleWait() log(LOG.DEBUG, "[handleWait] predicate error -> error") return { status = "error", - error = returnOrError + error = returnOrError, } end end @@ -1233,7 +1193,7 @@ local function step() else finishTest({ result = TestResults.TEST_RESULT.ERROR, - error = envOrError + error = envOrError, }) return end @@ -1257,19 +1217,12 @@ local function step() coroutineArgs = nil end - log( - LOG.DEBUG, - "Resuming test: " .. activeTestState.label .. " with value: " .. table.toString({ - coroutineOk = coroutineOk, - coroutineArgs = coroutineArgs, - }) - ) + log(LOG.DEBUG, "Resuming test: " .. activeTestState.label .. " with value: " .. table.toString({ + coroutineOk = coroutineOk, + coroutineArgs = coroutineArgs, + })) - resumeOk, resumeResult = coroutine.resume( - activeTestState.coroutine, - coroutineOk, - coroutineArgs and unpack(coroutineArgs) or nil - ) + resumeOk, resumeResult = coroutine.resume(activeTestState.coroutine, coroutineOk, coroutineArgs and unpack(coroutineArgs) or nil) log(LOG.DEBUG, "Unresuming test: " .. table.toString({ result = resumeOk, error = resumeResult, @@ -1305,7 +1258,7 @@ function widget:Update(dt) if spGetGameFrame() <= 0 then step() else - widgetHandler:RemoveWidgetCallIn('Update', self) + widgetHandler:RemoveWidgetCallIn("Update", self) end end @@ -1316,45 +1269,27 @@ function widget:Initialize() widgetHandler:RemoveWidget(self) end - widgetHandler.actionHandler:AddAction( - self, - "runtests", - function(cmd, optLine, optWords, data, isRepeat, release, actions) - testModeScenario = false - config.returnTimeout = defaultTestTimeout - startTests(Util.splitPhrases(optLine)) - end, - nil, - "t" - ) - widgetHandler.actionHandler:AddAction( - self, - "runscenario", - function(cmd, optLine, optWords, data, isRepeat, release, actions) - testModeScenario = true - config.returnTimeout = defaultScenarioTimeout - scenarioConfig = {} - scenarioOpts = Util.splitPhrases(optLine) - startTests(scenarioOpts[1]) - end, - nil, - "t" - ) - widgetHandler.actionHandler:AddAction( - self, - "runtestsheadless", - function(cmd, optLine, optWords, data, isRepeat, release, actions) - headless = true - config.noColorOutput = true - config.quitWhenDone = true - config.gameStartTestPatterns = Util.splitPhrases(optLine) - config.testResultsFilePath = "testlog/results.json" - - widgetHandler:EnableWidget("Test Runner Watchdog") - end, - nil, - "t" - ) + widgetHandler.actionHandler:AddAction(self, "runtests", function(cmd, optLine, optWords, data, isRepeat, release, actions) + testModeScenario = false + config.returnTimeout = defaultTestTimeout + startTests(Util.splitPhrases(optLine)) + end, nil, "t") + widgetHandler.actionHandler:AddAction(self, "runscenario", function(cmd, optLine, optWords, data, isRepeat, release, actions) + testModeScenario = true + config.returnTimeout = defaultScenarioTimeout + scenarioConfig = {} + scenarioOpts = Util.splitPhrases(optLine) + startTests(scenarioOpts[1]) + end, nil, "t") + widgetHandler.actionHandler:AddAction(self, "runtestsheadless", function(cmd, optLine, optWords, data, isRepeat, release, actions) + headless = true + config.noColorOutput = true + config.quitWhenDone = true + config.gameStartTestPatterns = Util.splitPhrases(optLine) + config.testResultsFilePath = "testlog/results.json" + + widgetHandler:EnableWidget("Test Runner Watchdog") + end, nil, "t") TestExtraUtils.linkActions(self) gameTimer = Spring.GetTimer() diff --git a/luaui/Widgets/dbg_unit_callins.lua b/luaui/Widgets/dbg_unit_callins.lua index 34ac0f583d6..e8ef840598b 100644 --- a/luaui/Widgets/dbg_unit_callins.lua +++ b/luaui/Widgets/dbg_unit_callins.lua @@ -12,8 +12,6 @@ function widget:GetInfo() } end - - -- Localized functions for performance local tableInsert = table.insert @@ -48,47 +46,59 @@ local enabledcallins = { UnitSeismicPing = true, UnitLoaded = true, UnitUnloaded = true, - UnitCloaked = true, + UnitCloaked = true, UnitDecloaked = true, UnitMoveFailed = true, - StockpileChanged = true, - RenderUnitDestroyed = true, + StockpileChanged = true, + RenderUnitDestroyed = true, FeatureCreated = true, FeatureDestroyed = true, MetaUnitAdded = true, MetaUnitRemoved = true, - } +} local taglife = 5 * 30 local tagrise = 2 local eventlist = {} local numevents = 0 local startheight = 64 - -- is a dict of - -- life = gameframe to die on - -- - -local function addEvent(unitID,callin, param1, param2, param3, param4) - if unitID == nil then return end - local px, py, pz - if type(unitID) == 'table' then +-- is a dict of +-- life = gameframe to die on +-- + +local function addEvent(unitID, callin, param1, param2, param3, param4) + if unitID == nil then + return + end + local px, py, pz + if type(unitID) == "table" then px = unitID[1] py = unitID[2] pz = unitID[3] - elseif Spring.ValidUnitID(unitID) then + elseif Spring.ValidUnitID(unitID) then px, py, pz = Spring.GetUnitPosition(unitID) end - if px == nil then return end - local caption = 'w:'..callin - if param1 ~= nil then caption = caption .. " " .. tostring(param1) end - if param2 ~= nil then caption = caption .. " " .. tostring(param2) end - if param3 ~= nil then caption = caption .. " " .. tostring(param3) end - if param4 ~= nil then caption = caption .. " " .. tostring(param4) end + if px == nil then + return + end + local caption = "w:" .. callin + if param1 ~= nil then + caption = caption .. " " .. tostring(param1) + end + if param2 ~= nil then + caption = caption .. " " .. tostring(param2) + end + if param3 ~= nil then + caption = caption .. " " .. tostring(param3) + end + if param4 ~= nil then + caption = caption .. " " .. tostring(param4) + end local newevent = { life = spGetGameFrame() + taglife, caption = caption, - x = px , + x = px, y = py + startheight, - z = pz + (math.random()-0.5) * 32, + z = pz + (math.random() - 0.5) * 32, } tableInsert(eventlist, newevent) numevents = numevents + 1 @@ -97,14 +107,14 @@ end function widget:GameFrame() local gf = spGetGameFrame() local removelist = {} - for k, v in pairs(eventlist) do - if v.life < gf then - tableInsert(removelist, k) + for k, v in pairs(eventlist) do + if v.life < gf then + tableInsert(removelist, k) else v.y = v.y + tagrise end end - for k,v in pairs(removelist) do + for k, v in pairs(removelist) do eventlist[v] = nil numevents = numevents - 1 end @@ -112,239 +122,418 @@ end function widget:DrawWorld() --spEcho("w:drawing:", numevents) - if numevents > 0 then - gl.Color(1,1,1,1) - for key, event in pairs(eventlist) do - if Spring.IsSphereInView(event.x, event.y, event.z, 128) then + if numevents > 0 then + gl.Color(1, 1, 1, 1) + for key, event in pairs(eventlist) do + if Spring.IsSphereInView(event.x, event.y, event.z, 128) then gl.PushMatrix() gl.Translate(event.x, event.y, event.z) - gl.Text( event.caption,0,0,16,'n') + gl.Text(event.caption, 0, 0, 16, "n") gl.PopMatrix() end - end end end function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if printcallins then spEcho("w:UnitCreated",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, builderID) end - if enabledcallins.UnitCreated == nil then return end - if showcallins then addEvent(unitID, "UnitCreated") end + if printcallins then + spEcho("w:UnitCreated", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, builderID) + end + if enabledcallins.UnitCreated == nil then + return + end + if showcallins then + addEvent(unitID, "UnitCreated") + end end function widget:UnitFinished(unitID, unitDefID, unitTeam) - if enabledcallins.UnitFinished == nil then return end - if printcallins then spEcho("w:UnitFinished",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitFinished") end + if enabledcallins.UnitFinished == nil then + return + end + if printcallins then + spEcho("w:UnitFinished", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitFinished") + end end function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - if enabledcallins.UnitFromFactory == nil then return end - if printcallins then spEcho("w:UnitFromFactory",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, factID, factDefID, userOrders) end - if showcallins then addEvent(unitID, "UnitFromFactory") end - + if enabledcallins.UnitFromFactory == nil then + return + end + if printcallins then + spEcho("w:UnitFromFactory", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, factID, factDefID, userOrders) + end + if showcallins then + addEvent(unitID, "UnitFromFactory") + end end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - if enabledcallins.UnitDestroyed == nil then return end - if printcallins then spEcho("w:UnitDestroyed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitDestroyed") end + if enabledcallins.UnitDestroyed == nil then + return + end + if printcallins then + spEcho("w:UnitDestroyed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitDestroyed") + end end function widget:UnitDestroyedByTeam(unitID, unitDefID, unitTeam, attackerTeamID) - if enabledcallins.UnitDestroyedByTeam == nil then return end - if printcallins then spEcho("w:UnitDestroyedByTeam",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, attackerTeamID) end - if showcallins then addEvent(unitID, "UnitDestroyedByTeam") end + if enabledcallins.UnitDestroyedByTeam == nil then + return + end + if printcallins then + spEcho("w:UnitDestroyedByTeam", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, attackerTeamID) + end + if showcallins then + addEvent(unitID, "UnitDestroyedByTeam") + end end function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - if enabledcallins.UnitTaken == nil then return end - if printcallins then spEcho("w:UnitTaken",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, newTeam) end - if showcallins then addEvent(unitID, "UnitTaken") end + if enabledcallins.UnitTaken == nil then + return + end + if printcallins then + spEcho("w:UnitTaken", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, newTeam) + end + if showcallins then + addEvent(unitID, "UnitTaken") + end end function widget:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) - if enabledcallins.UnitExperience == nil then return end - if printcallins then spEcho("w:UnitExperience",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, experience, oldExperience) end - if showcallins then addEvent(unitID, "UnitExperience") end + if enabledcallins.UnitExperience == nil then + return + end + if printcallins then + spEcho("w:UnitExperience", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, experience, oldExperience) + end + if showcallins then + addEvent(unitID, "UnitExperience") + end end function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) - if enabledcallins.UnitCommand == nil then return end - if printcallins then spEcho("w:UnitCommand",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) end - if showcallins then addEvent(unitID, "UnitCommand") end + if enabledcallins.UnitCommand == nil then + return + end + if printcallins then + spEcho("w:UnitCommand", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) + end + if showcallins then + addEvent(unitID, "UnitCommand") + end end function widget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) - if enabledcallins.UnitCmdDone == nil then return end - if printcallins then spEcho("w:UnitCmdDone",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) end - if showcallins then addEvent(unitID, "UnitCmdDone") end + if enabledcallins.UnitCmdDone == nil then + return + end + if printcallins then + spEcho("w:UnitCmdDone", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) + end + if showcallins then + addEvent(unitID, "UnitCmdDone") + end end function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - if enabledcallins.UnitDamaged == nil then return end - if printcallins then spEcho("w:UnitDamaged",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, damage, paralyzer) end - if showcallins then addEvent(unitID, "UnitDamaged") end + if enabledcallins.UnitDamaged == nil then + return + end + if printcallins then + spEcho("w:UnitDamaged", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, damage, paralyzer) + end + if showcallins then + addEvent(unitID, "UnitDamaged") + end end function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - if enabledcallins.UnitGiven == nil then return end - if printcallins then spEcho("w:UnitGiven",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, oldTeam) end - if showcallins then addEvent(unitID, "UnitGiven") end + if enabledcallins.UnitGiven == nil then + return + end + if printcallins then + spEcho("w:UnitGiven", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, oldTeam) + end + if showcallins then + addEvent(unitID, "UnitGiven") + end end function widget:UnitIdle(unitID, unitDefID, unitTeam) - if enabledcallins.UnitIdle == nil then return end - if printcallins then spEcho("w:UnitIdle",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitIdle") end + if enabledcallins.UnitIdle == nil then + return + end + if printcallins then + spEcho("w:UnitIdle", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitIdle") + end end function widget:UnitEnteredRadar(unitID, unitTeam) - if enabledcallins.UnitEnteredRadar == nil then return end - if printcallins then spEcho("w:UnitEnteredRadar",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredRadar") end + if enabledcallins.UnitEnteredRadar == nil then + return + end + if printcallins then + spEcho("w:UnitEnteredRadar", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredRadar") + end end function widget:UnitEnteredLos(unitID, unitTeam) - if enabledcallins.UnitEnteredLos == nil then return end - if printcallins then spEcho("w:UnitEnteredLos",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredLos") end + if enabledcallins.UnitEnteredLos == nil then + return + end + if printcallins then + spEcho("w:UnitEnteredLos", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredLos") + end end function widget:UnitLeftRadar(unitID, unitTeam) - if enabledcallins.UnitLeftRadar == nil then return end - if printcallins then spEcho("w:UnitLeftRadar",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftRadar") end + if enabledcallins.UnitLeftRadar == nil then + return + end + if printcallins then + spEcho("w:UnitLeftRadar", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftRadar") + end end function widget:UnitLeftLos(unitID, unitTeam) - if enabledcallins.UnitLeftLos == nil then return end - if printcallins then spEcho("w:UnitLeftLos",unitID, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftLos") end + if enabledcallins.UnitLeftLos == nil then + return + end + if printcallins then + spEcho("w:UnitLeftLos", unitID, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftLos") + end end function widget:UnitEnteredWater(unitID, unitDefID, unitTeam) - if enabledcallins.UnitEnteredWater == nil then return end - if printcallins then spEcho("w:UnitEnteredWater",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredWater") end + if enabledcallins.UnitEnteredWater == nil then + return + end + if printcallins then + spEcho("w:UnitEnteredWater", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredWater") + end end function widget:UnitEnteredAir(unitID, unitDefID, unitTeam) - if enabledcallins.UnitEnteredAir == nil then return end - if printcallins then spEcho("w:UnitEnteredAir",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitEnteredAir") end + if enabledcallins.UnitEnteredAir == nil then + return + end + if printcallins then + spEcho("w:UnitEnteredAir", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitEnteredAir") + end end function widget:UnitLeftWater(unitID, unitDefID, unitTeam) - if enabledcallins.UnitLeftWater == nil then return end - if printcallins then spEcho("w:UnitLeftWater",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftWater") end + if enabledcallins.UnitLeftWater == nil then + return + end + if printcallins then + spEcho("w:UnitLeftWater", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftWater") + end end function widget:UnitLeftAir(unitID, unitDefID, unitTeam) - if enabledcallins.UnitLeftAir == nil then return end - if printcallins then spEcho("w:UnitLeftAir",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitLeftAir") end + if enabledcallins.UnitLeftAir == nil then + return + end + if printcallins then + spEcho("w:UnitLeftAir", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitLeftAir") + end end function widget:UnitSeismicPing(x, y, z, strength) - if enabledcallins.UnitSeismicPing == nil then return end - if printcallins then spEcho("w:UnitSeismicPing",x, y, z, strength) end - --if showcallins then addEvent(unitID, "UnitGiven") end + if enabledcallins.UnitSeismicPing == nil then + return + end + if printcallins then + spEcho("w:UnitSeismicPing", x, y, z, strength) + end + --if showcallins then addEvent(unitID, "UnitGiven") end end function widget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) - if enabledcallins.UnitLoaded == nil then return end - if printcallins then spEcho("w:UnitLoaded",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) end - if showcallins then addEvent(unitID, "UnitLoaded") end + if enabledcallins.UnitLoaded == nil then + return + end + if printcallins then + spEcho("w:UnitLoaded", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) + end + if showcallins then + addEvent(unitID, "UnitLoaded") + end end function widget:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) - if enabledcallins.UnitUnloaded == nil then return end - if printcallins then spEcho("w:UnitUnloaded",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) end - if showcallins then addEvent(unitID, "UnitUnloaded") end + if enabledcallins.UnitUnloaded == nil then + return + end + if printcallins then + spEcho("w:UnitUnloaded", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, transportID, transportTeam) + end + if showcallins then + addEvent(unitID, "UnitUnloaded") + end end function widget:UnitCloaked(unitID, unitDefID, unitTeam) - if enabledcallins.UnitCloaked == nil then return end - if printcallins then spEcho("w:UnitCloaked",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitCloaked") end + if enabledcallins.UnitCloaked == nil then + return + end + if printcallins then + spEcho("w:UnitCloaked", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitCloaked") + end end function widget:UnitDecloaked(unitID, unitDefID, unitTeam) - if enabledcallins.UnitDecloaked == nil then return end - if printcallins then spEcho("w:UnitDecloaked",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitDecloaked") end + if enabledcallins.UnitDecloaked == nil then + return + end + if printcallins then + spEcho("w:UnitDecloaked", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitDecloaked") + end end function widget:UnitMoveFailed(unitID, unitDefID, unitTeam) - if enabledcallins.UnitMoveFailed == nil then return end - if printcallins then spEcho("w:UnitMoveFailed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "UnitMoveFailed") end + if enabledcallins.UnitMoveFailed == nil then + return + end + if printcallins then + spEcho("w:UnitMoveFailed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "UnitMoveFailed") + end end function widget:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount) - if enabledcallins.StockpileChanged == nil then return end - if printcallins then spEcho("w:StockpileChanged",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, weaponNum, oldCount, newCount) end - if showcallins then addEvent(unitID, "StockpileChanged") end + if enabledcallins.StockpileChanged == nil then + return + end + if printcallins then + spEcho("w:StockpileChanged", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam, weaponNum, oldCount, newCount) + end + if showcallins then + addEvent(unitID, "StockpileChanged") + end end - function widget:RenderUnitDestroyed(unitID, unitDefID, unitTeam) - if enabledcallins.RenderUnitDestroyed == nil then return end - if printcallins then spEcho("w:RenderUnitDestroyed",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "RenderUnitDestroyed") end + if enabledcallins.RenderUnitDestroyed == nil then + return + end + if printcallins then + spEcho("w:RenderUnitDestroyed", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "RenderUnitDestroyed") + end end function widget:FeatureCreated(featureID) - if enabledcallins.FeatureCreated == nil then return end + if enabledcallins.FeatureCreated == nil then + return + end local featureDefID = Spring.GetFeatureDefID(featureID) - if printcallins then spEcho("w:FeatureCreated",featureID, FeatureDefs[featureDefID].name) end - if showcallins then + if printcallins then + spEcho("w:FeatureCreated", featureID, FeatureDefs[featureDefID].name) + end + if showcallins then local fx, fy, fz = Spring.GetFeaturePosition(featureID) - local pos = {fx,fy,fz} - addEvent(pos, "FeatureCreated") - end + local pos = { fx, fy, fz } + addEvent(pos, "FeatureCreated") + end end function widget:FeatureDestroyed(featureID) - if enabledcallins.FeatureDestroyed == nil then return end + if enabledcallins.FeatureDestroyed == nil then + return + end local featureDefID = Spring.GetFeatureDefID(featureID) - if printcallins then spEcho("w:FeatureDestroyed",featureID, FeatureDefs[featureDefID].name) end - if showcallins then + if printcallins then + spEcho("w:FeatureDestroyed", featureID, FeatureDefs[featureDefID].name) + end + if showcallins then local fx, fy, fz = Spring.GetFeaturePosition(featureID) - local pos = {fx,fy,fz} - addEvent(pos, "FeatureDestroyed") - end + local pos = { fx, fy, fz } + addEvent(pos, "FeatureDestroyed") + end end function widget:MetaUnitAdded(unitID, unitDefID, unitTeam) - if enabledcallins.MetaUnitAdded == nil then return end - if printcallins then spEcho("w:MetaUnitAdded",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "MetaUnitAdded") end + if enabledcallins.MetaUnitAdded == nil then + return + end + if printcallins then + spEcho("w:MetaUnitAdded", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "MetaUnitAdded") + end end function widget:MetaUnitRemoved(unitID, unitDefID, unitTeam) - if enabledcallins.MetaUnitRemoved == nil then return end - if printcallins then spEcho("w:MetaUnitRemoved",unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) end - if showcallins then addEvent(unitID, "MetaUnitRemoved") end + if enabledcallins.MetaUnitRemoved == nil then + return + end + if printcallins then + spEcho("w:MetaUnitRemoved", unitID, unitDefID and UnitDefs[unitDefID].name, unitTeam) + end + if showcallins then + addEvent(unitID, "MetaUnitRemoved") + end end -local function init() -end +local function init() end -function widget:PlayerChanged(playerID) -end +function widget:PlayerChanged(playerID) end function widget:Initialize() init() end -function widget:Shutdown() -end +function widget:Shutdown() end function widget:GetConfigData(data) return {} end -function widget:SetConfigData(data) -end +function widget:SetConfigData(data) end diff --git a/luaui/Widgets/dbg_unit_csv_export.lua b/luaui/Widgets/dbg_unit_csv_export.lua index 7058f338185..1961367bd41 100644 --- a/luaui/Widgets/dbg_unit_csv_export.lua +++ b/luaui/Widgets/dbg_unit_csv_export.lua @@ -1,351 +1,276 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Unit CSV Export", - desc = "export units (for the purpose of the website database)", - author = "Floris", - date = "May 2018", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false - } + return { + name = "Unit CSV Export", + desc = "export units (for the purpose of the website database)", + author = "Floris", + date = "May 2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, + } end - local filename = "unitlist.csv" local iconTypes = VFS.Include("gamedata/icontypes.lua") - local function round(num, numDecimalPlaces) - local mult = 10^(numDecimalPlaces or 0) - if num >= 0 then return math.floor(num * mult + 0.5) / mult - else return math.ceil(num * mult - 0.5) / mult end + local mult = 10 ^ (numDecimalPlaces or 0) + if num >= 0 then + return math.floor(num * mult + 0.5) / mult + else + return math.ceil(num * mult - 0.5) / mult + end end local weaponShowGroups = { [0] = true, [1] = true } local weaponHideRoles = { secondary = true } local function buildTree(conDefID, tree) - local buildOptions = UnitDefs[conDefID].buildOptions - for _, option in ipairs(buildOptions) do - if not tree[option] then - tree[option] = true - if UnitDefs[option].buildOptions then - tree = buildTree(option, tree) - end - end - end + local buildOptions = UnitDefs[conDefID].buildOptions + for _, option in ipairs(buildOptions) do + if not tree[option] then + tree[option] = true + if UnitDefs[option].buildOptions then + tree = buildTree(option, tree) + end + end + end - return tree + return tree end function widget:Initialize() - local file = assert(io.open(filename,'w'), "Unable to save file") + local file = assert(io.open(filename, "w"), "Unable to save file") - local columnSeparator = ';' - local columnSubSeparator = ', ' - -- see https://springrts.com/wiki/Lua_UnitDefs for what is availible - file:write( - 'id'..columnSeparator.. - 'faction'..columnSeparator.. - 'techlevel'..columnSeparator.. - 'name'..columnSeparator.. - 'tooltip'..columnSeparator.. - 'description'..columnSeparator.. - 'radaricon'..columnSeparator.. - 'height'..columnSeparator.. - 'metalcost'..columnSeparator.. - 'energycost'..columnSeparator.. - 'buildtime'..columnSeparator.. - 'metalmake'..columnSeparator.. - 'energymake'..columnSeparator.. - 'buildpower'..columnSeparator.. - 'speed'..columnSeparator.. - 'health'..columnSeparator.. - 'amphib'..columnSeparator.. - 'sub'..columnSeparator.. - 'air'..columnSeparator.. - 'hover'..columnSeparator.. - 'ship'..columnSeparator.. - 'tank'..columnSeparator.. - 'bot'..columnSeparator.. - 'building'..columnSeparator.. - 'dps'..columnSeparator.. - 'weaponrange'..columnSeparator.. - 'jammerrange'..columnSeparator.. - 'sonarrange'..columnSeparator.. - 'radarrange'..columnSeparator.. - 'sightrange'..columnSeparator.. - 'airsightrange'..columnSeparator.. - 'specials'..columnSeparator.. - 'weapons'..columnSeparator.. - 'buildoptions'..columnSeparator.. - 'buildable'..columnSeparator.. - 'file'..columnSeparator.. - '\n' - ) + local columnSeparator = ";" + local columnSubSeparator = ", " + -- see https://springrts.com/wiki/Lua_UnitDefs for what is availible + file:write("id" .. columnSeparator .. "faction" .. columnSeparator .. "techlevel" .. columnSeparator .. "name" .. columnSeparator .. "tooltip" .. columnSeparator .. "description" .. columnSeparator .. "radaricon" .. columnSeparator .. "height" .. columnSeparator .. "metalcost" .. columnSeparator .. "energycost" .. columnSeparator .. "buildtime" .. columnSeparator .. "metalmake" .. columnSeparator .. "energymake" .. columnSeparator .. "buildpower" .. columnSeparator .. "speed" .. columnSeparator .. "health" .. columnSeparator .. "amphib" .. columnSeparator .. "sub" .. columnSeparator .. "air" .. columnSeparator .. "hover" .. columnSeparator .. "ship" .. columnSeparator .. "tank" .. columnSeparator .. "bot" .. columnSeparator .. "building" .. columnSeparator .. "dps" .. columnSeparator .. "weaponrange" .. columnSeparator .. "jammerrange" .. columnSeparator .. "sonarrange" .. columnSeparator .. "radarrange" .. columnSeparator .. "sightrange" .. columnSeparator .. "airsightrange" .. columnSeparator .. "specials" .. columnSeparator .. "weapons" .. columnSeparator .. "buildoptions" .. columnSeparator .. "buildable" .. columnSeparator .. "file" .. columnSeparator .. "\n") - local allBuildableDefs = {} - for udid, unitDef in pairs(UnitDefs) do - local faction = '' - if string.sub(unitDef.name, 1, 3) == 'arm' then - faction = 'ARMADA' - end - if string.sub(unitDef.name, 1, 3) == 'cor' then - faction = 'CORTEX' - end - if unitDef.buildOptions then - --if faction == 'ARMADA' or faction == 'CORTEX' then - for id, optionDefID in pairs(unitDef.buildOptions) do - allBuildableDefs[optionDefID] = true - end - -- end - end - end + local allBuildableDefs = {} + for udid, unitDef in pairs(UnitDefs) do + local faction = "" + if string.sub(unitDef.name, 1, 3) == "arm" then + faction = "ARMADA" + end + if string.sub(unitDef.name, 1, 3) == "cor" then + faction = "CORTEX" + end + if unitDef.buildOptions then + --if faction == 'ARMADA' or faction == 'CORTEX' then + for id, optionDefID in pairs(unitDef.buildOptions) do + allBuildableDefs[optionDefID] = true + end + -- end + end + end - local inBuildoptions = buildTree(UnitDefNames["armcom"].id, {}) - inBuildoptions = buildTree(UnitDefNames["corcom"].id, inBuildoptions) + local inBuildoptions = buildTree(UnitDefNames["armcom"].id, {}) + inBuildoptions = buildTree(UnitDefNames["corcom"].id, inBuildoptions) - for udid, unitDef in pairs(UnitDefs) do - if inBuildoptions[udid] or unitDef.name == 'armcom' or unitDef.name == 'corcom' or unitDef.name == 'legcom' then - local faction = '' - if string.sub(unitDef.name, 1, 3) == 'arm' then - faction = 'ARMADA' - end - if string.sub(unitDef.name, 1, 3) == 'cor' then - faction = 'CORTEX' - end - --if string.sub(unitDef.name, 1, 3) == 'leg' then - -- faction = 'LEGION' - --end - if unitDef.modCategories["raptor"] then - faction = 'CHICKS' - end - if string.find(unitDef.name, "_scav") then - faction = 'SCAVS' - end - if string.sub(unitDef.name, 1, 7) == 'critter' then - --faction = 'CRITTER' - end - if faction ~= '' and faction ~= 'SCAVS' then - local description = '' - if unitDef.customParams.description_long then - description = unitDef.customParams.description_long - end + for udid, unitDef in pairs(UnitDefs) do + if inBuildoptions[udid] or unitDef.name == "armcom" or unitDef.name == "corcom" or unitDef.name == "legcom" then + local faction = "" + if string.sub(unitDef.name, 1, 3) == "arm" then + faction = "ARMADA" + end + if string.sub(unitDef.name, 1, 3) == "cor" then + faction = "CORTEX" + end + --if string.sub(unitDef.name, 1, 3) == 'leg' then + -- faction = 'LEGION' + --end + if unitDef.modCategories["raptor"] then + faction = "CHICKS" + end + if string.find(unitDef.name, "_scav") then + faction = "SCAVS" + end + if string.sub(unitDef.name, 1, 7) == "critter" then + --faction = 'CRITTER' + end + if faction ~= "" and faction ~= "SCAVS" then + local description = "" + if unitDef.customParams.description_long then + description = unitDef.customParams.description_long + end - local techlevel = '1' - if unitDef.customParams.techlevel then - techlevel = unitDef.customParams.techlevel - end + local techlevel = "1" + if unitDef.customParams.techlevel then + techlevel = unitDef.customParams.techlevel + end - local specials = '' - if unitDef.canCloak then - specials = specials .. 'cloak, ' - end - if unitDef.stealth then - specials = specials .. 'stealth, ' - end - if unitDef.sonarStealth then - specials = specials .. 'sonar-stealth, ' - end - if unitDef.radarDistance >= 1000 then - specials = specials .. 'radar, ' - end - if unitDef.radarDistanceJam > 0 then - specials = specials .. 'jammer, ' - end - if unitDef.hasShield then - specials = specials .. 'shield, ' - end - if unitDef.canResurrect then - specials = specials .. 'resurrector, ' - end - if unitDef.canCapture then - specials = specials .. 'capturer, ' - end - if unitDef.rSpeed > 0 then - specials = specials .. 'reversible, ' - end - if unitDef.transportSize > 0 then - specials = specials .. 'transport, ' - end - if unitDef.customParams.isairbase then - specials = specials .. 'airbase, ' - end - if unitDef.seismicDistance > 0 then - specials = specials .. 'stealth-detector, ' - end - if specials ~= '' then - specials = string.sub(specials, 1, #specials-2) - end + local specials = "" + if unitDef.canCloak then + specials = specials .. "cloak, " + end + if unitDef.stealth then + specials = specials .. "stealth, " + end + if unitDef.sonarStealth then + specials = specials .. "sonar-stealth, " + end + if unitDef.radarDistance >= 1000 then + specials = specials .. "radar, " + end + if unitDef.radarDistanceJam > 0 then + specials = specials .. "jammer, " + end + if unitDef.hasShield then + specials = specials .. "shield, " + end + if unitDef.canResurrect then + specials = specials .. "resurrector, " + end + if unitDef.canCapture then + specials = specials .. "capturer, " + end + if unitDef.rSpeed > 0 then + specials = specials .. "reversible, " + end + if unitDef.transportSize > 0 then + specials = specials .. "transport, " + end + if unitDef.customParams.isairbase then + specials = specials .. "airbase, " + end + if unitDef.seismicDistance > 0 then + specials = specials .. "stealth-detector, " + end + if specials ~= "" then + specials = string.sub(specials, 1, #specials - 2) + end - local jammerRange = '' - if unitDef.radarDistanceJam > 0 then - jammerRange = round(unitDef.radarDistanceJam, 0) - end - local radarRange = '' - if unitDef.radarDistance > 0 then - radarRange = round(unitDef.radarDistance, 0) - end - local sonarRange = '' - if unitDef.sonarDistance > 0 then - sonarRange = round(unitDef.sonarDistance, 0) - end - local sightRange = '' - if unitDef.sightDistance > 0 then - sightRange = round(unitDef.sightDistance, 0) - end - local airsightRange = '' - if unitDef.airSightDistance > 0 then - airsightRange = round(unitDef.airSightDistance, 0) - end + local jammerRange = "" + if unitDef.radarDistanceJam > 0 then + jammerRange = round(unitDef.radarDistanceJam, 0) + end + local radarRange = "" + if unitDef.radarDistance > 0 then + radarRange = round(unitDef.radarDistance, 0) + end + local sonarRange = "" + if unitDef.sonarDistance > 0 then + sonarRange = round(unitDef.sonarDistance, 0) + end + local sightRange = "" + if unitDef.sightDistance > 0 then + sightRange = round(unitDef.sightDistance, 0) + end + local airsightRange = "" + if unitDef.airSightDistance > 0 then + airsightRange = round(unitDef.airSightDistance, 0) + end - local dps = 0 - local weaponTable = {} - local weapons = '' - local weaponRange = '' - if unitDef.weapons then - for wid, weapon in pairs(unitDef.weapons) do + local dps = 0 + local weaponTable = {} + local weapons = "" + local weaponRange = "" + if unitDef.weapons then + for wid, weapon in pairs(unitDef.weapons) do local weaponDef = WeaponDefs[weapon.weaponDef] - if weaponDef.customParams.bogus ~= "1" and weaponShowGroups[weaponDef.customParams.weapons_group] then - local weapName = weaponDef.type - if weaponRange == '' or weaponRange < weaponDef.range then - weaponRange = weaponDef.range - end - if weaponDef.paralyzer then - if weapName == 'BeamLaser' then - weapName = 'EMP-BeamLaser' - elseif weapName == 'AircraftBomb' then - weapName = 'EMP-AircraftBomb' - elseif weapName == 'StarburstLauncher' then - weapName = 'EMP-StarburstLauncher' - end - else + if weaponDef.customParams.bogus ~= "1" and weaponShowGroups[weaponDef.customParams.weapons_group] then + local weapName = weaponDef.type + if weaponRange == "" or weaponRange < weaponDef.range then + weaponRange = weaponDef.range + end + if weaponDef.paralyzer then + if weapName == "BeamLaser" then + weapName = "EMP-BeamLaser" + elseif weapName == "AircraftBomb" then + weapName = "EMP-AircraftBomb" + elseif weapName == "StarburstLauncher" then + weapName = "EMP-StarburstLauncher" + end + else if weaponDef.damages[Game.armorTypes["vtol"]] > weaponDef.damages[Game.armorTypes["default"] or 0] then - dps = dps + (((weaponDef.damages[Game.armorTypes["vtol"]]*(1/weaponDef.reload)) * weaponDef.salvoSize) * weaponDef.projectiles) - else - dps = dps + (((weaponDef.damages[Game.armorTypes["default"] or 0]*(1/weaponDef.reload)) * weaponDef.salvoSize) * weaponDef.projectiles) - end - end - if weaponTable[weapName] then - weaponTable[weapName] = weaponTable[weapName] + 1 - else - weaponTable[weapName] = 1 - end - end - end - for wname, wnum in pairs(weaponTable) do - local separator = columnSubSeparator - if weapons == '' then - separator = '' - end - if wnum > 1 then - weapons = weapons .. separator .. wnum..'x '..wname - else - weapons = weapons .. separator .. wname - end - end - end + dps = dps + (((weaponDef.damages[Game.armorTypes["vtol"]] * (1 / weaponDef.reload)) * weaponDef.salvoSize) * weaponDef.projectiles) + else + dps = dps + (((weaponDef.damages[Game.armorTypes["default"] or 0] * (1 / weaponDef.reload)) * weaponDef.salvoSize) * weaponDef.projectiles) + end + end + if weaponTable[weapName] then + weaponTable[weapName] = weaponTable[weapName] + 1 + else + weaponTable[weapName] = 1 + end + end + end + for wname, wnum in pairs(weaponTable) do + local separator = columnSubSeparator + if weapons == "" then + separator = "" + end + if wnum > 1 then + weapons = weapons .. separator .. wnum .. "x " .. wname + else + weapons = weapons .. separator .. wname + end + end + end - if unitDef.seismicDistance > 0 then - weaponRange = unitDef.seismicDistance - end + if unitDef.seismicDistance > 0 then + weaponRange = unitDef.seismicDistance + end - if unitDef.customParams.unitgroup and unitDef.customParams.unitgroup == 'explo' and unitDef.deathExplosion and WeaponDefNames[unitDef.deathExplosion] then - local weapon = WeaponDefs[WeaponDefNames[unitDef.deathExplosion].id] - if weapon then - dps = weapon.damages[Game.armorTypes["default"]] - end - end + if unitDef.customParams.unitgroup and unitDef.customParams.unitgroup == "explo" and unitDef.deathExplosion and WeaponDefNames[unitDef.deathExplosion] then + local weapon = WeaponDefs[WeaponDefNames[unitDef.deathExplosion].id] + if weapon then + dps = weapon.damages[Game.armorTypes["default"]] + end + end - if dps > 0 then - dps = round(dps, 0) - else - dps = 0 - end + if dps > 0 then + dps = round(dps, 0) + else + dps = 0 + end - if weaponRange ~= '' then - weaponRange = round(weaponRange, 0) - else - weaponRange = 0 - end + if weaponRange ~= "" then + weaponRange = round(weaponRange, 0) + else + weaponRange = 0 + end - local metalMake = '' - if unitDef.metalMake > 0 then - metalMake = round(unitDef.metalMake, 0) - end - if unitDef.metalMake < 10 then - metalMake = tostring(unitDef.metalMake):sub(1,3) - if metalMake:sub(3) == '0' then - metalMake = metalMake:sub(1,1) - end - end - local energyMake = '' - if unitDef.energyMake > 0 then - energyMake = round(unitDef.energyMake, 0) - end - if unitDef.energyMake < 10 then - energyMake = tostring(unitDef.energyMake):sub(1,3) - if energyMake:sub(3) == '0' then - energyMake = energyMake:sub(1,1) - end - end + local metalMake = "" + if unitDef.metalMake > 0 then + metalMake = round(unitDef.metalMake, 0) + end + if unitDef.metalMake < 10 then + metalMake = tostring(unitDef.metalMake):sub(1, 3) + if metalMake:sub(3) == "0" then + metalMake = metalMake:sub(1, 1) + end + end + local energyMake = "" + if unitDef.energyMake > 0 then + energyMake = round(unitDef.energyMake, 0) + end + if unitDef.energyMake < 10 then + energyMake = tostring(unitDef.energyMake):sub(1, 3) + if energyMake:sub(3) == "0" then + energyMake = energyMake:sub(1, 1) + end + end - local buildoptions = '' - if unitDef.buildOptions then - for id, optionDefID in pairs(unitDef.buildOptions) do - local separator = columnSubSeparator - if buildoptions == '' then - separator = '' - end - buildoptions = buildoptions..separator..UnitDefs[optionDefID].name - end - end + local buildoptions = "" + if unitDef.buildOptions then + for id, optionDefID in pairs(unitDef.buildOptions) do + local separator = columnSubSeparator + if buildoptions == "" then + separator = "" + end + buildoptions = buildoptions .. separator .. UnitDefs[optionDefID].name + end + end - file:write( - unitDef.name..columnSeparator.. - faction..columnSeparator.. - techlevel..columnSeparator.. - unitDef.translatedHumanName..columnSeparator.. - unitDef.translatedTooltip..columnSeparator.. - description..columnSeparator.. - (iconTypes[unitDef.iconType] and iconTypes[unitDef.iconType].bitmap and string.gsub(string.gsub(iconTypes[unitDef.iconType].bitmap, 'icons/', ''), '.png', '') or '')..columnSeparator.. - round(unitDef.height, 0)..columnSeparator.. - unitDef.metalCost..columnSeparator.. - unitDef.energyCost..columnSeparator.. - unitDef.buildTime..columnSeparator.. - metalMake..columnSeparator.. - energyMake..columnSeparator.. - unitDef.buildSpeed..columnSeparator.. - round(unitDef.speed, 0)..columnSeparator.. - unitDef.health..columnSeparator.. - ((unitDef.modCategories["phib"] ~= nil or (unitDef.modCategories["canbeuw"] ~= nil and unitDef.modCategories["underwater"] == nil)) and '1' or '')..columnSeparator.. - ((unitDef.modCategories["underwater"] ~= nil) and '1' or '')..columnSeparator.. - (unitDef.canFly and '1' or '')..columnSeparator.. - (unitDef.modCategories["hover"] and '1' or '')..columnSeparator.. - (unitDef.modCategories["ship"] and '1' or '')..columnSeparator.. - (unitDef.modCategories["tank"] and '1' or '')..columnSeparator.. - (unitDef.modCategories["bot"] and '1' or '')..columnSeparator.. - ((unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0) and '1' or '')..columnSeparator.. - dps..columnSeparator.. - weaponRange..columnSeparator.. - jammerRange..columnSeparator.. - sonarRange..columnSeparator.. - radarRange..columnSeparator.. - sightRange..columnSeparator.. - airsightRange..columnSeparator.. - specials..columnSeparator.. - weapons..columnSeparator.. - buildoptions..columnSeparator.. - (allBuildableDefs[udid] and '1' or '0')..columnSeparator.. - (unitDef.customParams.subfolder and unitDef.customParams.subfolder..'/' or "") .. unitDef.name..'.lua'.. - '\n' - ) - end - end - end + file:write(unitDef.name .. columnSeparator .. faction .. columnSeparator .. techlevel .. columnSeparator .. unitDef.translatedHumanName .. columnSeparator .. unitDef.translatedTooltip .. columnSeparator .. description .. columnSeparator .. (iconTypes[unitDef.iconType] and iconTypes[unitDef.iconType].bitmap and string.gsub(string.gsub(iconTypes[unitDef.iconType].bitmap, "icons/", ""), ".png", "") or "") .. columnSeparator .. round(unitDef.height, 0) .. columnSeparator .. unitDef.metalCost .. columnSeparator .. unitDef.energyCost .. columnSeparator .. unitDef.buildTime .. columnSeparator .. metalMake .. columnSeparator .. energyMake .. columnSeparator .. unitDef.buildSpeed .. columnSeparator .. round(unitDef.speed, 0) .. columnSeparator .. unitDef.health .. columnSeparator .. ((unitDef.modCategories["phib"] ~= nil or (unitDef.modCategories["canbeuw"] ~= nil and unitDef.modCategories["underwater"] == nil)) and "1" or "") .. columnSeparator .. ((unitDef.modCategories["underwater"] ~= nil) and "1" or "") .. columnSeparator .. (unitDef.canFly and "1" or "") .. columnSeparator .. (unitDef.modCategories["hover"] and "1" or "") .. columnSeparator .. (unitDef.modCategories["ship"] and "1" or "") .. columnSeparator .. (unitDef.modCategories["tank"] and "1" or "") .. columnSeparator .. (unitDef.modCategories["bot"] and "1" or "") .. columnSeparator .. ((unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0) and "1" or "") .. columnSeparator .. dps .. columnSeparator .. weaponRange .. columnSeparator .. jammerRange .. columnSeparator .. sonarRange .. columnSeparator .. radarRange .. columnSeparator .. sightRange .. columnSeparator .. airsightRange .. columnSeparator .. specials .. columnSeparator .. weapons .. columnSeparator .. buildoptions .. columnSeparator .. (allBuildableDefs[udid] and "1" or "0") .. columnSeparator .. (unitDef.customParams.subfolder and unitDef.customParams.subfolder .. "/" or "") .. unitDef.name .. ".lua" .. "\n") + end + end + end - Spring.Echo("Exported units to file: "..filename) - file:close() + Spring.Echo("Exported units to file: " .. filename) + file:close() end diff --git a/luaui/Widgets/dbg_widget_auto_reloader.lua b/luaui/Widgets/dbg_widget_auto_reloader.lua index 0019aafe016..dfcdaca653f 100644 --- a/luaui/Widgets/dbg_widget_auto_reloader.lua +++ b/luaui/Widgets/dbg_widget_auto_reloader.lua @@ -17,7 +17,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetMouseState = Spring.GetMouseState local spEcho = Spring.Echo @@ -56,7 +55,7 @@ local function CheckForChanges(widgetName, fileName) widgetContents[widgetName] = newContents local chunk, err = loadstring(newContents, fileName) if not mouseOffscreen and chunk == nil then - spEcho('Failed to load: ' .. fileName .. ' (' .. err .. ')') + spEcho("Failed to load: " .. fileName .. " (" .. err .. ")") return nil end ReloadWidget(widgetName) @@ -89,7 +88,7 @@ function widget:Update() end end - if Spring.DiffTimers(Spring.GetTimer() , lastUpdate) < 1 then + if Spring.DiffTimers(Spring.GetTimer(), lastUpdate) < 1 then return end lastUpdate = Spring.GetTimer() diff --git a/luaui/Widgets/dbg_widget_profiler.lua b/luaui/Widgets/dbg_widget_profiler.lua index b8a7448366e..c155bfb9e2e 100644 --- a/luaui/Widgets/dbg_widget_profiler.lua +++ b/luaui/Widgets/dbg_widget_profiler.lua @@ -13,11 +13,10 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", layer = -99900, handler = true, - enabled = false + enabled = false, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -66,13 +65,13 @@ local title_colour = "\255\160\255\160" local totals_colour = "\255\200\200\255" local prefixColor = { - gui = '\255\100\222\100', - gfx = '\255\222\160\100', - game = '\255\166\166\255', - cmd = '\255\166\255\255', - unit = '\255\255\166\255', - map = '\255\255\255\080', - dbg = '\255\120\120\120', + gui = "\255\100\222\100", + gfx = "\255\222\160\100", + game = "\255\166\166\255", + cmd = "\255\166\255\255", + unit = "\255\255\166\255", + map = "\255\255\255\080", + dbg = "\255\120\120\120", } local s @@ -88,7 +87,7 @@ local oldUpdateWidgetCallIn local oldInsertWidget local listOfHooks = {} -setmetatable(listOfHooks, { __mode = 'k' }) +setmetatable(listOfHooks, { __mode = "k" }) local inHook = false local lm, _, gm, _, um, _, sm, _ = spGetLuaMemUsage() @@ -102,9 +101,9 @@ local sortedList = {} -- Per-callin drill-down state (only populated for the currently selected widget) local callinLoadAverages = {} -- [wname] = { [cname] = { tLoad, sLoad } } -local selectedWidget = nil -- wname (prefixed plainname) currently drilled into, or nil -local clickableRows = {} -- reused each frame: { {x1, y1, x2, y2, plainname}, ... } -local clickableRowCount = 0 -- how many entries of clickableRows are valid this frame +local selectedWidget = nil -- wname (prefixed plainname) currently drilled into, or nil +local clickableRows = {} -- reused each frame: { {x1, y1, x2, y2, plainname}, ... } +local clickableRowCount = 0 -- how many entries of clickableRows are valid this frame local detailColour = "\255\255\255\255" local deltaTime @@ -112,7 +111,7 @@ local redStrength = {} local ColorString = Spring.Utilities.Color.ToString -if Spring.GetTimerMicros and Spring.GetConfigInt("UseHighResTimer", 0) == 1 then +if Spring.GetTimerMicros and Spring.GetConfigInt("UseHighResTimer", 0) == 1 then spGetTimer = Spring.GetTimerMicros highres = true end @@ -120,8 +119,8 @@ end spEcho("Profiler using highres timers", highres, Spring.GetConfigInt("UseHighResTimer", 0)) local prefixedWnames = {} -local widgetNameColors = {} -- Store RGB values for background tinting -local function ConstructPrefixedName (ghInfo) +local widgetNameColors = {} -- Store RGB values for background tinting +local function ConstructPrefixedName(ghInfo) local gadgetName = ghInfo.name local baseName = ghInfo.basename local _pos = stringFind(baseName, "_", 1, true) @@ -146,7 +145,7 @@ local function ConstructPrefixedName (ghInfo) b = mathRandom(180, 255) end end - widgetNameColors[gadgetName] = {r / 255, g / 255, b / 255} -- Store normalized RGB + widgetNameColors[gadgetName] = { r / 255, g / 255, b / 255 } -- Store normalized RGB prefixedWnames[gadgetName] = prefix .. stringChar(255, r, g, b) .. gadgetName .. " " return prefixedWnames[gadgetName] end @@ -192,12 +191,11 @@ function widget:TextCommand(s) end spEcho("Setting widget profiler to tick=", tick) end - end function widget:Initialize() for name, wData in pairs(widgetHandler.knownWidgets) do - userWidgets[name] = (not wData.fromZip) + userWidgets[name] = not wData.fromZip end end @@ -243,7 +241,7 @@ local function Hook(w, name) local t local helper_func = function(...) - local dt = spDiffTimers(spGetTimer(), t, nil ,highres) + local dt = spDiffTimers(spGetTimer(), t, nil, highres) local _, _, new_s, _ = spGetLuaMemUsage() local ds = new_s - s c[1] = c[1] + dt @@ -298,11 +296,11 @@ local function StartHook() --// hook the UpdateCallin function oldUpdateWidgetCallIn = wh.UpdateWidgetCallInRaw wh.UpdateWidgetCallInRaw = function(self, name, w) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then local func = w[name] - if type(func) == 'function' then + if type(func) == "function" then if not IsHook(func) then w[name] = Hook(w, name) end @@ -312,7 +310,7 @@ local function StartHook() end self:UpdateCallIn(name) else - print('UpdateWidgetCallIn: bad name: ' .. name) + print("UpdateWidgetCallIn: bad name: " .. name) end end @@ -330,7 +328,7 @@ local function StartHook() for i = 1, #CallInsList do local callin = CallInsList[i] local func = widget[callin] - if type(func) == 'function' then + if type(func) == "function" then widget[callin] = Hook(widget, callin) end end @@ -431,7 +429,7 @@ function GetRedColourStrings(v) -- time local new_r = (tTime - minPerc) / percRange - local timeKey = name .. '_time' + local timeKey = name .. "_time" redStrength[timeKey] = redStrength[timeKey] or 0 redStrength[timeKey] = u * redStrength[timeKey] + oneMinusU * new_r local timeRedStrength = redStrength[timeKey] @@ -445,7 +443,7 @@ function GetRedColourStrings(v) elseif new_r < 0 then new_r = 0 end - local spaceKey = name .. '_space' + local spaceKey = name .. "_space" redStrength[spaceKey] = redStrength[spaceKey] or 0 redStrength[spaceKey] = u * redStrength[spaceKey] + oneMinusU * new_r local spaceColorFactor = 1 - redStrength[spaceKey] * colorScaleFactor @@ -454,13 +452,13 @@ end -- Helper function to render percentage with dimmed leading zeros local function DrawPercentWithDimmedZeros(colorString, value, x, y, fontSize, decimalPlaces) - local formatStr = '%.' .. (decimalPlaces or 3) .. 'f%%' + local formatStr = "%." .. (decimalPlaces or 3) .. "f%%" local formatted = stringFormat(formatStr, value) - local leadingPart, significantPart = stringMatch(formatted, '^(0%.0*)(.+)$') + local leadingPart, significantPart = stringMatch(formatted, "^(0%.0*)(.+)$") if leadingPart then -- Has leading zeros - render them dimmed - glText(colorString .. '\255\140\140\140' .. leadingPart, x, y, fontSize, "no") + glText(colorString .. "\255\140\140\140" .. leadingPart, x, y, fontSize, "no") local leadingWidth = glGetTextWidth(leadingPart) * fontSize glText(colorString .. significantPart, x + leadingWidth, y, fontSize, "no") else @@ -471,18 +469,18 @@ end -- Helper function to render memory allocation with dimmed leading zeros local function DrawMemoryWithDimmedZeros(colorString, value, x, y, fontSize, decimalPlaces, suffix) - local formatStr = '%.' .. (decimalPlaces or 1) .. 'f' + local formatStr = "%." .. (decimalPlaces or 1) .. "f" local formatted = stringFormat(formatStr, value) -- Check if value is 0.0 (all zeros) if tonumber(formatted) == 0 then -- Render entire "0.0" dimmed - glText(colorString .. '\255\150\150\150' .. formatted .. suffix, x, y, fontSize, "no") + glText(colorString .. "\255\150\150\150" .. formatted .. suffix, x, y, fontSize, "no") else - local leadingPart, significantPart = stringMatch(formatted, '^(0%.0*)(.+)$') + local leadingPart, significantPart = stringMatch(formatted, "^(0%.0*)(.+)$") if leadingPart then -- Has leading zeros - render them dimmed - glText(colorString .. '\255\150\150\150' .. leadingPart, x, y, fontSize, "no") + glText(colorString .. "\255\150\150\150" .. leadingPart, x, y, fontSize, "no") local leadingWidth = glGetTextWidth(leadingPart) * fontSize glText(colorString .. significantPart .. suffix, x + leadingWidth, y, fontSize, "no") else @@ -501,8 +499,8 @@ end function DrawWidgetList(list, name, x, y, j, fontSize, lineSpace, maxLines, colWidth, dataColWidth, firstColX, reserve) reserve = reserve or 0 if j >= maxLines - 5 then - x = nextColumn(x, colWidth, firstColX, reserve); - j = 0; + x = nextColumn(x, colWidth, firstColX, reserve) + j = 0 end j = j + 1 glText(title_colour .. name .. " WIDGETS", x + 152, y - lineSpace * j, fontSize, "no") @@ -511,8 +509,8 @@ function DrawWidgetList(list, name, x, y, j, fontSize, lineSpace, maxLines, colW local listLen = #list for i = 1, listLen do if j >= maxLines then - x = nextColumn(x, colWidth, firstColX, reserve); - j = 0; + x = nextColumn(x, colWidth, firstColX, reserve) + j = 0 end local v = list[i] local textY = y - lineSpace * j @@ -528,7 +526,7 @@ function DrawWidgetList(list, name, x, y, j, fontSize, lineSpace, maxLines, colW glColor(color[1], color[2], color[3], 0.25) glRect(x - 5, textY - 3, x + colWidth - 15, textY + fontSize - 3) - glColor(1, 1, 1, 1) -- Reset color + glColor(1, 1, 1, 1) -- Reset color end -- Highlight the row that is currently drilled into @@ -549,13 +547,13 @@ function DrawWidgetList(list, name, x, y, j, fontSize, lineSpace, maxLines, colW r[1], r[2], r[3], r[4], r[5] = x - 12, textY - 3, x + colWidth - 15, textY + fontSize - 3, v.plainname DrawPercentWithDimmedZeros(v.timeColourString, v.tLoad, x, textY, fontSize) - DrawMemoryWithDimmedZeros(v.spaceColourString, v.sLoad, x + dataColWidth, textY, fontSize, 1, 'kB/s') + DrawMemoryWithDimmedZeros(v.spaceColourString, v.sLoad, x + dataColWidth, textY, fontSize, 1, "kB/s") glText(v.fullname, x + dataColWidth * 2, textY, fontSize, "no") j = j + 1 end DrawPercentWithDimmedZeros(totals_colour, list.allOverTime, x, y - lineSpace * j, fontSize, 2) - DrawMemoryWithDimmedZeros(totals_colour, list.allOverSpace, x + dataColWidth, y - lineSpace * j, fontSize, 0, 'kB/s') + DrawMemoryWithDimmedZeros(totals_colour, list.allOverSpace, x + dataColWidth, y - lineSpace * j, fontSize, 0, "kB/s") glText(totals_colour .. "totals (" .. stringLower(name) .. ")", x + dataColWidth * 2, y - lineSpace * j, fontSize, "no") j = j + 1 @@ -572,7 +570,7 @@ local function DrawDetailPanel(x, y, fontSize, lineSpace, panelWidth) -- Hide a callin only when BOTH its cpu and alloc rate are negligible; hidden -- callins still count towards the total so it stays accurate. local minCallinPerc = 0.003 -- % of running time - local minCallinKB = 0.1 -- kB/s allocated + local minCallinKB = 0.1 -- kB/s allocated local list = {} local hidden = 0 @@ -586,7 +584,9 @@ local function DrawDetailPanel(x, y, fontSize, lineSpace, panelWidth) hidden = hidden + 1 end end - tableSort(list, function(a, b) return a.tLoad > b.tLoad end) + tableSort(list, function(a, b) + return a.tLoad > b.tLoad + end) local colW = fontSize * 8 -- one column width, wide enough for "9999.9 kB/s" local timeColX = x @@ -621,17 +621,17 @@ local function DrawDetailPanel(x, y, fontSize, lineSpace, panelWidth) local v = list[i] local ry = line() DrawPercentWithDimmedZeros(detailColour, v.tLoad, timeColX, ry, fontSize) - DrawMemoryWithDimmedZeros(detailColour, v.sLoad, allocsColX, ry, fontSize, 1, 'kB/s') + DrawMemoryWithDimmedZeros(detailColour, v.sLoad, allocsColX, ry, fontSize, 1, "kB/s") glText(detailColour .. v.name, callinColX, ry, fontSize, "no") end local ty = line() DrawPercentWithDimmedZeros(totals_colour, total_t, timeColX, ty, fontSize, 2) - DrawMemoryWithDimmedZeros(totals_colour, total_s, allocsColX, ty, fontSize, 0, 'kB/s') + DrawMemoryWithDimmedZeros(totals_colour, total_s, allocsColX, ty, fontSize, 0, "kB/s") glText(totals_colour .. "total", callinColX, ty, fontSize, "no") if hidden > 0 then - glText(totals_colour .. '\255\140\140\140' .. stringFormat("(%d negligible callins hidden)", hidden), x, line(), fontSize, "no") + glText(totals_colour .. "\255\140\140\140" .. stringFormat("(%d negligible callins hidden)", hidden), x, line(), fontSize, "no") end line() -- blank separator before the close hint @@ -648,7 +648,6 @@ function widget:DrawScreen() -- sort & count timing deltaTime = spDiffTimers(spGetTimer(), startTimer, nil, highres) if deltaTime >= tick then - startTimer = spGetTimer() sortedList = {} @@ -725,16 +724,20 @@ function widget:DrawScreen() avgTLoad[wname] = ((avgTLoad[wname] * framesMinusOne) + tLoad) / frames local sLoad = spaceLoadAverages[wname] if not sortByLoad or avgTLoad[wname] >= 0.05 or sLoad >= 5 then -- only show heavy ones - sortedList[n] = { name = wname2name[wname], plainname = wname, fullname = wname .. ' \255\166\166\166(' .. cmaxname_t .. ',' .. cmaxname_space .. ')', tLoad = tLoad, sLoad = sLoad, tTime = t / deltaTime, avgTLoad = avgTLoad[wname] } + sortedList[n] = { name = wname2name[wname], plainname = wname, fullname = wname .. " \255\166\166\166(" .. cmaxname_t .. "," .. cmaxname_space .. ")", tLoad = tLoad, sLoad = sLoad, tTime = t / deltaTime, avgTLoad = avgTLoad[wname] } n = n + 1 end allOverTime = allOverTime + tLoad allOverSpace = allOverSpace + sLoad end if sortByLoad then - tableSort(sortedList, function(a, b) return a.avgTLoad > b.avgTLoad end) + tableSort(sortedList, function(a, b) + return a.avgTLoad > b.avgTLoad + end) else - tableSort(sortedList, function(a, b) return a.name < b.name end) + tableSort(sortedList, function(a, b) + return a.name < b.name + end) end local sortedLen = #sortedList @@ -803,8 +806,8 @@ function widget:DrawScreen() x, j = DrawWidgetList(userList, "USER", x, y, j, fontSize, lineSpace, maxLines, colWidth, dataColWidth, firstColX, reserve) if j >= maxLines - 15 then - x = nextColumn(x, colWidth, firstColX, reserve); - j = -1; + x = nextColumn(x, colWidth, firstColX, reserve) + j = -1 end if selectedWidget then @@ -817,10 +820,10 @@ function widget:DrawScreen() j = j + 1 glText(totals_colour .. "total percentage of running time spent in luaui callins", x + dataColWidth * 2, y - lineSpace * j, fontSize, "no") - glText(totals_colour .. stringFormat('%.1f%%', allOverTime), x + dataColWidth, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. stringFormat("%.1f%%", allOverTime), x + dataColWidth, y - lineSpace * j, fontSize, "no") j = j + 1 glText(totals_colour .. "total rate of mem allocation by luaui callins", x + dataColWidth * 2, y - lineSpace * j, fontSize, "no") - glText(totals_colour .. stringFormat('%.0f', allOverSpace) .. 'kB/s', x + dataColWidth, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. stringFormat("%.0f", allOverSpace) .. "kB/s", x + dataColWidth, y - lineSpace * j, fontSize, "no") -- Cache memory calculations local gmMB = gm / 1000 @@ -829,13 +832,13 @@ function widget:DrawScreen() local smPercent = 100 * sm / gm j = j + 2 - glText(totals_colour .. 'total lua memory usage is ' .. stringFormat('%.0f', gmMB) .. 'MB, of which:', x, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. "total lua memory usage is " .. stringFormat("%.0f", gmMB) .. "MB, of which:", x, y - lineSpace * j, fontSize, "no") j = j + 1 - glText(totals_colour .. ' ' .. stringFormat('%.0f', lmPercent) .. '% is from luaui', x, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. " " .. stringFormat("%.0f", lmPercent) .. "% is from luaui", x, y - lineSpace * j, fontSize, "no") j = j + 1 - glText(totals_colour .. ' ' .. stringFormat('%.0f', umPercent) .. '% is from unsynced states (luarules+luagaia+luaui)', x, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. " " .. stringFormat("%.0f", umPercent) .. "% is from unsynced states (luarules+luagaia+luaui)", x, y - lineSpace * j, fontSize, "no") j = j + 1 - glText(totals_colour .. ' ' .. stringFormat('%.0f', smPercent) .. '% is from synced states (luarules+luagaia)', x, y - lineSpace * j, fontSize, "no") + glText(totals_colour .. " " .. stringFormat("%.0f", smPercent) .. "% is from synced states (luarules+luagaia)", x, y - lineSpace * j, fontSize, "no") j = j + 2 glText(title_colour .. "All data excludes load from garbage collection & executing GL calls", x, y - lineSpace * j, fontSize, "no") diff --git a/luaui/Widgets/death_messages.lua b/luaui/Widgets/death_messages.lua index c984f3602ad..e06bb226ac6 100644 --- a/luaui/Widgets/death_messages.lua +++ b/luaui/Widgets/death_messages.lua @@ -2,33 +2,32 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Death Messages", - desc = "Displays a message upon player/team death", - author = "Bluestone", - date = "Sept 2013", - license = "GNU GPL, v2 or later, BA/BAR only", - layer = 0, - enabled = true + name = "Death Messages", + desc = "Displays a message upon player/team death", + author = "Bluestone", + date = "Sept 2013", + license = "GNU GPL, v2 or later, BA/BAR only", + layer = 0, + enabled = true, } end - -- Localized functions for performance local tableInsert = table.insert local deathMessageKeys = { - 'bowOut', - 'gone', - 'conquer', - 'toast', - 'takenOut', - 'defeat', - 'bitterEnd', - 'rodeOff', - 'dismantle', - 'terminate', - 'annihilate', - 'crater', + "bowOut", + "gone", + "conquer", + "toast", + "takenOut", + "defeat", + "bitterEnd", + "rodeOff", + "dismantle", + "terminate", + "annihilate", + "crater", } local teamNames = {} @@ -38,7 +37,7 @@ local function getTeamNames(teamID) if isAI then local _, _, _, name = Spring.GetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) if niceName then name = niceName @@ -64,9 +63,9 @@ local function notifyTeamDeath(teamID) if playerNameList == nil or next(playerNameList) == nil then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Team " .. teamID .. ": no names in players list") else - local playerNames = table.concat(playerNameList, ', ') + local playerNames = table.concat(playerNameList, ", ") local n = math.random(#deathMessageKeys) - local message = Spring.I18N('tips.deathMessages.team.' .. deathMessageKeys[n], { playerList = playerNames }) + local message = Spring.I18N("tips.deathMessages.team." .. deathMessageKeys[n], { playerList = playerNames }) Spring.SendMessage(message) end diff --git a/luaui/Widgets/dev_autocheat.lua b/luaui/Widgets/dev_autocheat.lua index 6dfc6dd60c2..d5e6ed6342f 100644 --- a/luaui/Widgets/dev_autocheat.lua +++ b/luaui/Widgets/dev_autocheat.lua @@ -6,20 +6,20 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Dev Auto cheat", - desc = "Enables cheats for $VERSION game versions", - author = "ivand", - date = "2017", - license = "GNU LGPL, v2.1 or later", - layer = 0, - enabled = false + name = "Dev Auto cheat", + desc = "Enables cheats for $VERSION game versions", + author = "ivand", + date = "2017", + license = "GNU LGPL, v2.1 or later", + layer = 0, + enabled = false, } end function widget:Update(f) local modOpts = Spring.GetModOptions() if modOpts ~= nil and modOpts.scenariooptions ~= nil then - widgetHandler:RemoveCallIn('Update') + widgetHandler:RemoveCallIn("Update") return end if not Spring.IsCheatingEnabled() then @@ -33,5 +33,5 @@ function widget:Update(f) Spring.SendCommands("godmode") --Spring.SendCommands("nocost") end - widgetHandler:RemoveCallIn('Update'); + widgetHandler:RemoveCallIn("Update") end diff --git a/luaui/Widgets/export_defs.lua b/luaui/Widgets/export_defs.lua index 6689050b558..da58934b439 100644 --- a/luaui/Widgets/export_defs.lua +++ b/luaui/Widgets/export_defs.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "June 2023", license = "GNU GPL, v2 or later", layer = 0, - enabled = false + enabled = false, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -38,7 +37,9 @@ local function BuildSoundIndex() local basename = file:match("([^/\\]+)%.[^.]+$") if basename then local key = basename:lower() - if not index[key] then index[key] = file end + if not index[key] then + index[key] = file + end end end end @@ -60,25 +61,35 @@ end local function BuildIconTypeIndex() local ok, result = pcall(VFS.Include, "gamedata/icontypes.lua") - if ok and type(result) == "table" then return result end + if ok and type(result) == "table" then + return result + end return {} end local function ResolveSoundPath(soundIndex, name) - if type(name) ~= "string" or name == "" then return nil end + if type(name) ~= "string" or name == "" then + return nil + end return soundIndex[name:lower()] end local function ResolveBuildPicPath(buildPic) - if type(buildPic) ~= "string" or buildPic == "" then return nil end + if type(buildPic) ~= "string" or buildPic == "" then + return nil + end for _, candidate in ipairs({ "unitpics/" .. buildPic, "unitpics/" .. buildPic:lower() }) do - if VFS.FileExists(candidate) then return candidate end + if VFS.FileExists(candidate) then + return candidate + end end return nil end local function AnnotateSoundArray(soundArray, soundIndex) - if type(soundArray) ~= "table" then return end + if type(soundArray) ~= "table" then + return + end for _, entry in ipairs(soundArray) do if type(entry) == "table" then entry.path = ResolveSoundPath(soundIndex, entry.name) @@ -144,7 +155,9 @@ local function FlattenUnitDef(unitDef) for _, weapon in pairs(tbl.weapons) do if type(weapon) == "table" then local wd = type(weapon.weaponDef) == "number" and WeaponDefs[weapon.weaponDef] or nil - if wd then weapon.weaponDefName = wd.name end + if wd then + weapon.weaponDefName = wd.name + end end end end @@ -192,8 +205,3 @@ function widget:TextCommand(command) ExportDefs() end end - - - - - diff --git a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua index fc190ddf835..269a472e2a0 100644 --- a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua +++ b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua @@ -1,20 +1,19 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "DrawUnitShape GL4", - version = "v0.2", - desc = "Faster gl.UnitShape, Use WG.UnitShapeGL4", - author = "ivand, Beherith", - date = "2021.11.04", - license = "GNU GPL, v2 or later", - layer = -9999, - enabled = true, - depends = {'gl4'}, - } + return { + name = "DrawUnitShape GL4", + version = "v0.2", + desc = "Faster gl.UnitShape, Use WG.UnitShapeGL4", + author = "ivand, Beherith", + date = "2021.11.04", + license = "GNU GPL, v2 or later", + layer = -9999, + enabled = true, + depends = { "gl4" }, + } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spEcho = Spring.Echo @@ -22,45 +21,43 @@ local spEcho = Spring.Echo -- TODO: correctly track add/remove per vbotable -- Dont Allow mixed types, it will fuck with textures anyway -- need 4 vbos: - -- corunitVBO - -- armunitVBO - -- for unitVBOs, we need to make sure we dont draw outside of disticon stuff, or else suffer for it +-- corunitVBO +-- armunitVBO +-- for unitVBOs, we need to make sure we dont draw outside of disticon stuff, or else suffer for it - -- corunitShapeVBO - -- armunitShapeVBO - -- for unitshape, we also need a teamID so that we can lookup the teamcolor! +-- corunitShapeVBO +-- armunitShapeVBO +-- for unitshape, we also need a teamID so that we can lookup the teamcolor! -- Shader: - --Possible params for: - -- transparency - -- teamID (override for all 4 teamcolor stuff) - -- drawveryfar - -- Handle out-of-bounds with mapping to 0,0,0,1 vertex - -- For Units: - -- clip when Icon - -- for UnitIDs: - -- Dont clip when icon, doesnt make sense :D +--Possible params for: +-- transparency +-- teamID (override for all 4 teamcolor stuff) +-- drawveryfar +-- Handle out-of-bounds with mapping to 0,0,0,1 vertex +-- For Units: +-- clip when Icon +-- for UnitIDs: +-- Dont clip when icon, doesnt make sense :D -- unified shader -- needs matrix detection for unit offsets -- When to draw? - --UnitShape is in Preunit - -- enable depth testing and backface culling - -- Use the actual team color (or any teamID specified if not -1?) +--UnitShape is in Preunit +-- enable depth testing and backface culling +-- Use the actual team color (or any teamID specified if not -1?) - --drawUnit is in drawworld - -- enable depth testing and backface culling - -- this usually additively blends with a 'flat' (usually team) color +--drawUnit is in drawworld +-- enable depth testing and backface culling +-- this usually additively blends with a 'flat' (usually team) color - -- NO REFLECTIONS, REFRACTIONS ET AL +-- NO REFLECTIONS, REFRACTIONS ET AL -- NOTE: DYNAMIC MODELS ARE UNSUPPORTED WITH QUATERNIONS!!! -- void LuaVAOImpl::RemoveFromSubmission(int idx) - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOIdTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance - +local popElementInstance = InstanceVBOTable.popElementInstance local unitShader, unitShapeShader @@ -237,7 +234,7 @@ local corUnitDefIDs = {} local armUnitDefIDs = {} local unitDefIDtoTex1 = {} -- Keys unit def IDs to whichever tex1 is used -local tex1ToVBO = {['arm_color.dds'] = true, ['cor_color.dds'] = true, ['leg_color.dds'] = true, ['legmech_color.dds'] = true} -- Keys texture1 to which VBO is used, small intermediate table, not really used +local tex1ToVBO = { ["arm_color.dds"] = true, ["cor_color.dds"] = true, ["leg_color.dds"] = true, ["legmech_color.dds"] = true } -- Keys texture1 to which VBO is used, small intermediate table, not really used local unitDeftoUnitShapeVBOTable = {} -- The important one, which keys the unitDefID to the actual vbo table to be used local uniqueIDtoUnitShapeVBOTable = {} @@ -246,8 +243,9 @@ local owners = {} -- maps uniqueIDs to their optional owners local uniqueID = 0 local instanceCache = {} -for i= 1, 14 do instanceCache[i] = 0 end - +for i = 1, 14 do + instanceCache[i] = 0 +end ---DrawUnitGL4(unitID, unitDefID, px, py, pz, rotationY, alpha, teamID, teamcoloroverride, highlight, updateID, ownerID) ---Draw a copy of an actual unit, with all of its animations too. That unit must be in view. For things like highlighting under construction stuff. @@ -266,7 +264,6 @@ for i= 1, 14 do instanceCache[i] = 0 end ---@param ownerID any optional unique identifier so that widgets can batch remove all of their own stuff ---@return uniqueID number a unique handler ID number that you should store and call StopDrawUnitGL4(uniqueID) with to stop drawing it local function DrawUnitGL4(unitID, unitDefID, px, py, pz, rotationY, alpha, teamID, teamcoloroverride, highlight, updateID, ownerID) - unitDefID = unitDefID or spGetUnitDefID(unitID) px = px or 0 @@ -284,15 +281,19 @@ local function DrawUnitGL4(unitID, unitDefID, px, py, pz, rotationY, alpha, team updateID = uniqueID end - if ownerID then owners[updateID] = ownerID end + if ownerID then + owners[updateID] = ownerID + end local DrawUnitVBOTable --spEcho("DrawUnitGL4", objecttype, UnitDefs[unitDefID].name, unitID, "to uniqueID", uniqueID,"elemID", elementID) - if corUnitDefIDs[unitDefID] then DrawUnitVBOTable = corDrawUnitVBOTable - elseif armUnitDefIDs[unitDefID] then DrawUnitVBOTable = armDrawUnitVBOTable + if corUnitDefIDs[unitDefID] then + DrawUnitVBOTable = corDrawUnitVBOTable + elseif armUnitDefIDs[unitDefID] then + DrawUnitVBOTable = armDrawUnitVBOTable else spEcho("DrawUnitGL4 : The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is neither arm nor cor, only those two are supported at the moment") - Spring.Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") + Spring.Debug.TraceFullEcho(nil, nil, nil, "DrawUnitGL4") return nil end @@ -300,14 +301,7 @@ local function DrawUnitGL4(unitID, unitDefID, px, py, pz, rotationY, alpha, team instanceCache[5], instanceCache[6], instanceCache[7], instanceCache[8] = alpha, 0, teamcoloroverride, highlight instanceCache[9] = teamID - local elementID = pushElementInstance( - DrawUnitVBOTable, - instanceCache, - updateID, - true, - nil, - unitID, - "unitID") + local elementID = pushElementInstance(DrawUnitVBOTable, instanceCache, updateID, true, nil, unitID, "unitID") return updateID end @@ -337,13 +331,15 @@ local function DrawUnitShapeGL4(unitDefID, px, py, pz, rotationY, alpha, teamID, updateID = uniqueID end - if ownerID then owners[updateID] = ownerID end + if ownerID then + owners[updateID] = ownerID + end local DrawUnitShapeVBOTable = unitDeftoUnitShapeVBOTable[unitDefID] if not DrawUnitShapeVBOTable then - spEcho("DrawUnitShapeGL4: The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is missing a target DrawUnitShapeVBOTable") - Spring.Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") + spEcho("DrawUnitShapeGL4: The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is missing a target DrawUnitShapeVBOTable") + Spring.Debug.TraceFullEcho(nil, nil, nil, "DrawUnitGL4") return nil end uniqueIDtoUnitShapeVBOTable[uniqueID] = DrawUnitShapeVBOTable @@ -353,14 +349,7 @@ local function DrawUnitShapeGL4(unitDefID, px, py, pz, rotationY, alpha, teamID, instanceCache[5], instanceCache[6], instanceCache[7], instanceCache[8] = alpha, 1, teamcoloroverride, highlight instanceCache[9] = teamID - local elementID = pushElementInstance( - DrawUnitShapeVBOTable, - instanceCache, - updateID, - true, - nil, - unitDefID, - "unitDefID") + local elementID = pushElementInstance(DrawUnitShapeVBOTable, instanceCache, updateID, true, nil, unitDefID, "unitDefID") return updateID end @@ -385,18 +374,15 @@ end ---@param uniqueID number the unique id of whatever you want to stop drawing ---@return the ownerID the uniqueID was associated to local function StopDrawUnitShapeGL4(uniqueID) - if uniqueIDtoUnitShapeVBOTable[uniqueID] then local DrawUnitShapeVBOTable = uniqueIDtoUnitShapeVBOTable[uniqueID] if DrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then popElementInstance(DrawUnitShapeVBOTable, uniqueID) else - spEcho("DrawUnitShapeGL4: the given uniqueID", uniqueID," is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in" ) + spEcho("DrawUnitShapeGL4: the given uniqueID", uniqueID, " is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in") end - else - - spEcho("DrawUnitShapeGL4: the given uniqueID", uniqueID," is not present in the uniqueIDtoUnitShapeVBOTable, it might already have been removed?") + spEcho("DrawUnitShapeGL4: the given uniqueID", uniqueID, " is not present in the uniqueIDtoUnitShapeVBOTable, it might already have been removed?") end uniqueIDtoUnitShapeVBOTable[uniqueID] = nil @@ -414,7 +400,7 @@ local function StopDrawAll(ownerID) local ownedCount = 0 for uniqueID, owner in pairs(owners) do if owner == ownerID or ownerID == nil then - for _,VBOTable in ipairs(VBOTables) do -- attach everything together + for _, VBOTable in ipairs(VBOTables) do -- attach everything together if VBOTable.instanceIDtoIndex[uniqueID] then popElementInstance(VBOTable, uniqueID) break @@ -425,15 +411,13 @@ local function StopDrawAll(ownerID) if DrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then popElementInstance(DrawUnitShapeVBOTable, uniqueID) else - spEcho("DrawUnitShapeGL4 StopDrawAll: the given uniqueID", uniqueID," is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in" ) + spEcho("DrawUnitShapeGL4 StopDrawAll: the given uniqueID", uniqueID, " is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in") end end owners[uniqueID] = nil ownedCount = ownedCount + 1 - end - end return ownedCount end @@ -444,9 +428,9 @@ if TESTMODE then local unitIDtoUniqueID = {} local unitDefIDtoUniqueID = {} function widget:UnitCreated(unitID, unitDefID) - unitIDtoUniqueID[unitID] = DrawUnitGL4(unitID, unitDefID, 0, 0, 0, math.random()*2, 0.6) + unitIDtoUniqueID[unitID] = DrawUnitGL4(unitID, unitDefID, 0, 0, 0, math.random() * 2, 0.6) local px, py, pz = Spring.GetUnitPosition(unitID) - unitDefIDtoUniqueID[unitID] = DrawUnitShapeGL4(spGetUnitDefID(unitID), px+20, py + 50, pz+20, 0, 0.6) + unitDefIDtoUniqueID[unitID] = DrawUnitShapeGL4(spGetUnitDefID(unitID), px + 20, py + 50, pz + 20, 0, 0.6) end function widget:UnitDestroyed(unitID) @@ -471,28 +455,26 @@ function widget:Initialize() end end - - local vertexVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) -- GL.ARRAY_BUFFER, false local indexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) -- GL.ARRAY_BUFFER, false vertexVBO:ModelsVBO() indexVBO:ModelsVBO() local VBOLayout = { - {id = 6, name = "worldposrot", size = 4}, - {id = 7, name = "parameters" , size = 4}, - {id = 8, name = "overrideteam" , type = GL.UNSIGNED_INT, size = 2}, - {id = 9, name = "instData", type = GL.UNSIGNED_INT, size = 4}, - } + { id = 6, name = "worldposrot", size = 4 }, + { id = 7, name = "parameters", size = 4 }, + { id = 8, name = "overrideteam", type = GL.UNSIGNED_INT, size = 2 }, + { id = 9, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, + } local maxElements = 6 -- start small for testing local unitIDAttributeIndex = 9 - corDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "corDrawUnitVBOTable", unitIDAttributeIndex, "unitID") - armDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "armDrawUnitVBOTable", unitIDAttributeIndex, "unitID") + corDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "corDrawUnitVBOTable", unitIDAttributeIndex, "unitID") + armDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "armDrawUnitVBOTable", unitIDAttributeIndex, "unitID") - VBOTables = {corDrawUnitVBOTable, armDrawUnitVBOTable} + VBOTables = { corDrawUnitVBOTable, armDrawUnitVBOTable } - for i,VBOTable in ipairs(VBOTables) do -- attach everything together + for i, VBOTable in ipairs(VBOTables) do -- attach everything together VBOTable.VAO = InstanceVBOTable.makeVAOandAttach(vertexVBO, VBOTable.instanceVBO, indexVBO) VBOTable.indexVBO = indexVBO VBOTable.vertexVBO = vertexVBO @@ -506,7 +488,7 @@ function widget:Initialize() --end for tex1, _ in pairs(tex1ToVBO) do - local vboname = 'DrawUnitShapeVBOTable:' .. tex1 + local vboname = "DrawUnitShapeVBOTable:" .. tex1 local vboTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, vboname, unitIDAttributeIndex, "unitDefID") vboTable.VAO = InstanceVBOTable.makeVAOandAttach(vertexVBO, vboTable.instanceVBO, indexVBO) vboTable.indexVBO = indexVBO @@ -538,7 +520,7 @@ function widget:Initialize() }, uniformFloat = { iconDistance = 1, - }, + }, }, "UnitGL4 API") unitShapeShader = LuaShader({ @@ -550,12 +532,12 @@ function widget:Initialize() }, uniformFloat = { iconDistance = 1, - }, + }, }, "UnitShapeGL4 API") local unitshaderCompiled = unitShader:Initialize() local unitshapeshaderCompiled = unitShapeShader:Initialize() - if unitshaderCompiled ~= true or unitshapeshaderCompiled ~= true then + if unitshaderCompiled ~= true or unitshapeshaderCompiled ~= true then spEcho("DrawUnitShape shader compilation failed", unitshaderCompiled, unitshapeshaderCompiled) widgetHandler:RemoveWidget() end @@ -564,25 +546,24 @@ function widget:Initialize() widget:UnitCreated(unitID) end end - WG['DrawUnitGL4'] = DrawUnitGL4 - WG['DrawUnitShapeGL4'] = DrawUnitShapeGL4 - WG['StopDrawUnitGL4'] = StopDrawUnitGL4 - WG['StopDrawUnitShapeGL4'] = StopDrawUnitShapeGL4 - WG['StopDrawAll'] = StopDrawAll - WG['armDrawUnitShapeVBOTable'] = armDrawUnitShapeVBOTable - WG['corDrawUnitShapeVBOTable'] = corDrawUnitShapeVBOTable - widgetHandler:RegisterGlobal('DrawUnitGL4', DrawUnitGL4) - widgetHandler:RegisterGlobal('DrawUnitShapeGL4', DrawUnitShapeGL4) - widgetHandler:RegisterGlobal('StopDrawUnitGL4', StopDrawUnitGL4) - widgetHandler:RegisterGlobal('StopDrawUnitShapeGL4', StopDrawUnitShapeGL4) - widgetHandler:RegisterGlobal('armDrawUnitShapeVBOTable', armDrawUnitShapeVBOTable) - widgetHandler:RegisterGlobal('corDrawUnitShapeVBOTable', corDrawUnitShapeVBOTable) - widgetHandler:RegisterGlobal('StopDrawAll', StopDrawAll) + WG["DrawUnitGL4"] = DrawUnitGL4 + WG["DrawUnitShapeGL4"] = DrawUnitShapeGL4 + WG["StopDrawUnitGL4"] = StopDrawUnitGL4 + WG["StopDrawUnitShapeGL4"] = StopDrawUnitShapeGL4 + WG["StopDrawAll"] = StopDrawAll + WG["armDrawUnitShapeVBOTable"] = armDrawUnitShapeVBOTable + WG["corDrawUnitShapeVBOTable"] = corDrawUnitShapeVBOTable + widgetHandler:RegisterGlobal("DrawUnitGL4", DrawUnitGL4) + widgetHandler:RegisterGlobal("DrawUnitShapeGL4", DrawUnitShapeGL4) + widgetHandler:RegisterGlobal("StopDrawUnitGL4", StopDrawUnitGL4) + widgetHandler:RegisterGlobal("StopDrawUnitShapeGL4", StopDrawUnitShapeGL4) + widgetHandler:RegisterGlobal("armDrawUnitShapeVBOTable", armDrawUnitShapeVBOTable) + widgetHandler:RegisterGlobal("corDrawUnitShapeVBOTable", corDrawUnitShapeVBOTable) + widgetHandler:RegisterGlobal("StopDrawAll", StopDrawAll) end - function widget:Shutdown() - for i,VBOTable in ipairs(VBOTables) do + for i, VBOTable in ipairs(VBOTables) do if VBOTable.VAO then if Spring.Utilities.IsDevMode() then InstanceVBOTable.dumpAndCompareInstanceData(VBOTable) @@ -591,7 +572,7 @@ function widget:Shutdown() end end - for tex1,VBOTable in ipairs(tex1ToVBO) do + for tex1, VBOTable in ipairs(tex1ToVBO) do if VBOTable.VAO then if Spring.Utilities.IsDevMode() then InstanceVBOTable.dumpAndCompareInstanceData(VBOTable) @@ -600,25 +581,28 @@ function widget:Shutdown() end end - if unitShader then unitShader:Finalize() end - if unitShapeShader then unitShapeShader:Finalize() end - - WG['DrawUnitGL4'] = nil - WG['DrawUnitShapeGL4'] = nil - WG['StopDrawUnitGL4'] = nil - WG['StopDrawUnitShapeGL4'] = nil - WG['StopDrawAll'] = nil - WG['armDrawUnitShapeVBOTable'] = nil - WG['corDrawUnitShapeVBOTable'] = nil - widgetHandler:DeregisterGlobal('DrawUnitGL4') - widgetHandler:DeregisterGlobal('DrawUnitShapeGL4') - widgetHandler:DeregisterGlobal('StopDrawUnitGL4') - widgetHandler:DeregisterGlobal('StopDrawUnitShapeGL4') - widgetHandler:DeregisterGlobal('armDrawUnitShapeVBOTable') - widgetHandler:DeregisterGlobal('corDrawUnitShapeVBOTable') - widgetHandler:DeregisterGlobal('StopDrawAll') -end + if unitShader then + unitShader:Finalize() + end + if unitShapeShader then + unitShapeShader:Finalize() + end + WG["DrawUnitGL4"] = nil + WG["DrawUnitShapeGL4"] = nil + WG["StopDrawUnitGL4"] = nil + WG["StopDrawUnitShapeGL4"] = nil + WG["StopDrawAll"] = nil + WG["armDrawUnitShapeVBOTable"] = nil + WG["corDrawUnitShapeVBOTable"] = nil + widgetHandler:DeregisterGlobal("DrawUnitGL4") + widgetHandler:DeregisterGlobal("DrawUnitShapeGL4") + widgetHandler:DeregisterGlobal("StopDrawUnitGL4") + widgetHandler:DeregisterGlobal("StopDrawUnitShapeGL4") + widgetHandler:DeregisterGlobal("armDrawUnitShapeVBOTable") + widgetHandler:DeregisterGlobal("corDrawUnitShapeVBOTable") + widgetHandler:DeregisterGlobal("StopDrawAll") +end -- Stencil bit used to flag pixels where our ghost shapes were rendered. The -- nano particles gadget reads this bit to decide whether to depth-test or @@ -630,7 +614,6 @@ function widget:DrawWorldPreUnit() -- this is for UnitDef for tex1, unitShapeVBOTable in pairs(tex1ToVBO) do if unitShapeVBOTable.usedElements > 0 then - if not active then -- Full depth write so multi-piece ghost models self-occlude -- correctly. Without this, back faces of one piece bleed @@ -673,7 +656,7 @@ function widget:DrawWorldPreUnit() -- this is for UnitDef gl.StencilOp(GL.KEEP, GL.KEEP, GL.REPLACE) unitShapeShader:Activate() - unitShapeShader:SetUniform("iconDistance",27 * Spring.GetConfigInt("UnitIconDist", 200)) + unitShapeShader:SetUniform("iconDistance", 27 * Spring.GetConfigInt("UnitIconDist", 200)) active = true end @@ -718,13 +701,13 @@ function widget:DrawWorld() gl.StencilOp(GL.KEEP, GL.KEEP, GL.REPLACE) unitShader:Activate() - unitShader:SetUniform("iconDistance",27 * Spring.GetConfigInt("UnitIconDist", 200)) - if (corDrawUnitVBOTable.usedElements > 0 ) then + unitShader:SetUniform("iconDistance", 27 * Spring.GetConfigInt("UnitIconDist", 200)) + if corDrawUnitVBOTable.usedElements > 0 then gl.UnitShapeTextures(corcomUnitDefID, true) corDrawUnitVBOTable.VAO:Submit() end - if (armDrawUnitVBOTable.usedElements > 0 ) then + if armDrawUnitVBOTable.usedElements > 0 then gl.UnitShapeTextures(armcomUnitDefID, true) armDrawUnitVBOTable.VAO:Submit() end diff --git a/luaui/Widgets/gfx_HighlightUnit_GL4.lua b/luaui/Widgets/gfx_HighlightUnit_GL4.lua index cbae7037ea5..8b082850f19 100644 --- a/luaui/Widgets/gfx_HighlightUnit_GL4.lua +++ b/luaui/Widgets/gfx_HighlightUnit_GL4.lua @@ -1,19 +1,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "HighlightUnit API GL4", - version = "v0.2", - desc = "DEPRECATED! Highlight any unit, feature, unitDef or FeatureDef via WG.HighlightUnitGL4", - author = "Beherith,ivand", - date = "2022.01.04", - license = "GNU GPL, v2 or later", - layer = -999999, - enabled = true, - } + return { + name = "HighlightUnit API GL4", + version = "v0.2", + desc = "DEPRECATED! Highlight any unit, feature, unitDef or FeatureDef via WG.HighlightUnitGL4", + author = "Beherith,ivand", + date = "2022.01.04", + license = "GNU GPL, v2 or later", + layer = -999999, + enabled = true, + } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spEcho = Spring.Echo @@ -21,12 +20,11 @@ local spEcho = Spring.Echo -- Notes: this API can be considered mildly deprecated, as CUS GL4 now handles the major consumers of this API. -- This API is now fully deprecated, as the swith to quaternions breaks it entirely. - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOIdTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local highlightunitShader, unitShapeShader local highlightUnitVBOTable @@ -40,9 +38,7 @@ local highlightunitShaderConfig = { SKINSUPPORT = Script.IsEngineMinVersion(105, 0, 1653) and 1 or 0, } - -local vsSrc = -[[#version 420 +local vsSrc = [[#version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shader_storage_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -198,7 +194,6 @@ local unitDefIgnore = {} -- We explicitly disallow the highlighting of any unitD -- end --ignore debug units --end - local function HighlightUnitGL4(objectID, objecttype, r, g, b, alpha, edgealpha, edgeexponent, animamount, px, py, pz, rotationY, consumerID) -- Documentation for HighlightUnitGL4: -- objectID: the unitID, unitDefID, featureID or featureDefID you want @@ -216,11 +211,10 @@ local function HighlightUnitGL4(objectID, objecttype, r, g, b, alpha, edgealpha, -- returns: a unique handler ID number that you should store and call StopHighlightUnitGL4(uniqueID) with to stop drawing it -- note that widgets are responsible for stopping the drawing of every unit that they submit! - - if objecttype == 'unitID' then + if objecttype == "unitID" then local unitDefID = spGetUnitDefID(objectID) - if unitDefID== nil or unitDefIgnore[unitDefID] then - spEcho("Warning: Unit", objectID, "with unitDefID", unitDefID, "is explicitly disallowed in highlightUnitVBOTable from",consumerID) + if unitDefID == nil or unitDefIgnore[unitDefID] then + spEcho("Warning: Unit", objectID, "with unitDefID", unitDefID, "is explicitly disallowed in highlightUnitVBOTable from", consumerID) return nil end end @@ -233,12 +227,23 @@ local function HighlightUnitGL4(objectID, objecttype, r, g, b, alpha, edgealpha, local staticmodel = (objecttype == "unitDefID" or objecttype == "featureDefID") and 1 or 0 -- spEcho("HighlightUnitGL4", objecttype, objectID, staticmodel,"to uniqueID", uniqueID, r, g, b, alpha, edgealpha, edgeexponent, animamount, px, py, pz, rotationY, highlight) local elementID = pushElementInstance(highlightUnitVBOTable, { - px or 0, py or 0, pz or 0, rotationY or 0, - 0, edgealpha or 0.1, edgeexponent or 2.0, animamount or 0, - r or 1, g or 1, b or 1, alpha or 0.25, - 0,0,0,0 - }, - key, true, nil, objectID, objecttype) + px or 0, + py or 0, + pz or 0, + rotationY or 0, + 0, + edgealpha or 0.1, + edgeexponent or 2.0, + animamount or 0, + r or 1, + g or 1, + b or 1, + alpha or 0.25, + 0, + 0, + 0, + 0, + }, key, true, nil, objectID, objecttype) uniqueIDtoUnitID[key] = objectID if unitIDtoUniqueID[objectID] then unitIDtoUniqueID[objectID][key] = true @@ -248,7 +253,7 @@ local function HighlightUnitGL4(objectID, objecttype, r, g, b, alpha, edgealpha, end if debugmode > 0 then local unitdefname = "unknown unitdefname" - if objecttype == 'unitID' then + if objecttype == "unitID" then unitdefname = UnitDefs[spGetUnitDefID(objectID)].name end spEcho("HighlightUnitGL4", objectID, objecttype, consumerID, key, unitdefname) @@ -260,10 +265,9 @@ local function StopHighlightUnitGL4(uniqueID, noUpload) if debugmode > 0 then local unitdefname = "bad unitdefid" if uniqueIDtoUnitID[uniqueID] and spGetUnitDefID(uniqueIDtoUnitID[uniqueID]) then - unitdefname = UnitDefs[spGetUnitDefID(uniqueIDtoUnitID[uniqueID])].name + unitdefname = UnitDefs[spGetUnitDefID(uniqueIDtoUnitID[uniqueID])].name end - spEcho("StopHighlightUnitGL4", uniqueID, noUpload, 'from index',highlightUnitVBOTable.instanceIDtoIndex[uniqueID], unitdefname ) - + spEcho("StopHighlightUnitGL4", uniqueID, noUpload, "from index", highlightUnitVBOTable.instanceIDtoIndex[uniqueID], unitdefname) end if highlightUnitVBOTable.instanceIDtoIndex[uniqueID] then popElementInstance(highlightUnitVBOTable, uniqueID, noUpload) @@ -286,13 +290,11 @@ local function RefreshHighlightUnitGL4() InstanceVBOTable.uploadAllElements(highlightUnitVBOTable) end - local TESTMODE = false if TESTMODE then function widget:UnitCreated(unitID, unitDefID) - local uniqueID = HighlightUnitGL4(unitID, "unitID", 0.0,0.25,1, 0.2, 0.5, 3.0, 0.2) - + local uniqueID = HighlightUnitGL4(unitID, "unitID", 0.0, 0.25, 1, 0.2, 0.5, 3.0, 0.2) end function widget:UnitDestroyed(unitID) StopHighlightUnitGL4(unitIDtoUniqueID[unitID]) @@ -300,14 +302,13 @@ if TESTMODE then end function widget:GameFrame(n) - if (n%61) == 1 then + if (n % 61) == 1 then InstanceVBOTable.validateInstanceVBOIDTable(highlightUnitVBOTable, "api validation") end end -- TODO: the api is the correct place for removal on unit - function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) -- extVisibleUnits is a table of [unitID:unitDefID] -- use uniqueIDtoUnitID -- at this point we cant pop back any more! @@ -319,10 +320,10 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) -- extV end --for uniqueID, unitID in pairs(uniqueIDtoUnitID) do - -- i am no longer nice to consumers - --if extVisibleUnits[unitID] == nil then -- no longer visible, so we must remove the uniqueID - --StopHighlightUnitGL4(uniqueID) - --end + -- i am no longer nice to consumers + --if extVisibleUnits[unitID] == nil then -- no longer visible, so we must remove the uniqueID + --StopHighlightUnitGL4(uniqueID) + --end --end end @@ -345,11 +346,11 @@ function widget:Initialize() indxVBO:ModelsVBO() local VBOLayout = { - {id = 6, name = "worldposrot", size = 4}, - {id = 7, name = "parameters" , size = 4}, - {id = 8, name = "hcolor", size = 4}, - {id = 9, name = "instData", type = GL.UNSIGNED_INT, size = 4}, - } + { id = 6, name = "worldposrot", size = 4 }, + { id = 7, name = "parameters", size = 4 }, + { id = 8, name = "hcolor", size = 4 }, + { id = 9, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, + } local maxElements = 6 -- start small for testing local unitIDAttributeIndex = 9 @@ -360,7 +361,6 @@ function widget:Initialize() highlightUnitVBOTable.vertexVBO = vertVBO highlightUnitVBOTable.debugZombies = false - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) @@ -373,7 +373,7 @@ function widget:Initialize() }, uniformFloat = { iconDistance = 1, - }, + }, }, "highlightUnitShader API") if highlightunitShader:Initialize() ~= true then @@ -386,12 +386,12 @@ function widget:Initialize() widget:UnitCreated(unitID) end for i, featureID in ipairs(Spring.GetAllFeatures()) do - HighlightUnitGL4(featureID, "featureID", 0.0,0.25,1, 0.2, 0.5, 3.0, 0.0) + HighlightUnitGL4(featureID, "featureID", 0.0, 0.25, 1, 0.2, 0.5, 3.0, 0.0) end end - WG['HighlightUnitGL4'] = HighlightUnitGL4 - WG['StopHighlightUnitGL4'] = StopHighlightUnitGL4 - WG['RefreshHighlightUnitGL4'] = RefreshHighlightUnitGL4 + WG["HighlightUnitGL4"] = HighlightUnitGL4 + WG["StopHighlightUnitGL4"] = StopHighlightUnitGL4 + WG["RefreshHighlightUnitGL4"] = RefreshHighlightUnitGL4 end function widget:Shutdown() @@ -401,34 +401,35 @@ function widget:Shutdown() end highlightUnitVBOTable.VAO:Delete() end - if highlightunitShader then highlightunitShader:Finalize() end + if highlightunitShader then + highlightunitShader:Finalize() + end - WG['HighlightUnitGL4'] = nil - WG['StopHighlightUnitGL4'] = nil - WG['RefreshHighlightUnitGL4'] = nil + WG["HighlightUnitGL4"] = nil + WG["StopHighlightUnitGL4"] = nil + WG["RefreshHighlightUnitGL4"] = nil end function widget:TextCommand(command) if string.find(command, "debugapihighlightunit", nil, true) == 1 then local startmatch, endmatch = string.find(command, "debugapihighlightunit", nil, true) - local param = string.sub(command, endmatch + 2,nil) + local param = string.sub(command, endmatch + 2, nil) if param and tonumber(param) then local newdebuglevel = tonumber(param) if newdebuglevel ~= debugmode then spEcho("Debug level for API HighLightUnit GL4 set to:", newdebuglevel) debugmode = newdebuglevel end - highlightUnitVBOTable.debugZombies = (newdebuglevel>0) + highlightUnitVBOTable.debugZombies = (newdebuglevel > 0) end for uniqueID, unitID in pairs(uniqueIDtoUnitID) do local unitdefname = "bad unitid" if spGetUnitDefID(unitID) then - unitdefname = UnitDefs[spGetUnitDefID(unitID)].name + unitdefname = UnitDefs[spGetUnitDefID(unitID)].name end - spEcho("debugapihighlightunit", uniqueID, unitID, unitdefname, highlightUnitVBOTable.instanceIDtoIndex[uniqueID] ) + spEcho("debugapihighlightunit", uniqueID, unitID, unitdefname, highlightUnitVBOTable.instanceIDtoIndex[uniqueID]) end - end end @@ -444,9 +445,9 @@ function widget:DrawWorld() gl.DepthMask(true) gl.DepthTest(true) gl.Blending(GL.SRC_ALPHA, GL.ONE) - gl.PolygonOffset( -0.1 ,-0.1) -- too much here bleeds + gl.PolygonOffset(-0.1, -0.1) -- too much here bleeds highlightunitShader:Activate() - highlightunitShader:SetUniform("iconDistance",27 * Spring.GetConfigInt("UnitIconDist", 200)) + highlightunitShader:SetUniform("iconDistance", 27 * Spring.GetConfigInt("UnitIconDist", 200)) highlightUnitVBOTable.VAO:Submit() highlightunitShader:Deactivate() gl.PolygonOffset(false) diff --git a/luaui/Widgets/gfx_airjets_gl4.lua b/luaui/Widgets/gfx_airjets_gl4.lua index 7ea02e29717..07e0eb5de52 100644 --- a/luaui/Widgets/gfx_airjets_gl4.lua +++ b/luaui/Widgets/gfx_airjets_gl4.lua @@ -17,7 +17,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor @@ -44,7 +43,6 @@ local spGetSpectatingState = Spring.GetSpectatingState -------------------------------------------------------------------------------- --- - local spGetGameFrame = Spring.GetGameFrame local spGetUnitPieceMap = Spring.GetUnitPieceMap local spGetUnitIsActive = Spring.GetUnitIsActive @@ -73,15 +71,15 @@ local autoUpdate = false local enableLights = true local lightMult = 1.4 -local texture1 = "bitmaps/GPL/perlin_noise.jpg" -- noise texture -local texture2 = ":c:bitmaps/gpl/jet2.bmp" -- shape +local texture1 = "bitmaps/GPL/perlin_noise.jpg" -- noise texture +local texture2 = ":c:bitmaps/gpl/jet2.bmp" -- shape local effectDefs = VFS.Include("luaui/configs/airjet_effects.lua") local function deepcopy(orig) local orig_type = type(orig) local copy - if orig_type == 'table' then + if orig_type == "table" then copy = {} for orig_key, orig_value in next, orig, nil do copy[deepcopy(orig_key)] = deepcopy(orig_value) @@ -102,10 +100,10 @@ for name, effects in pairs(effectDefs) do end -- create scavenger variant - if UnitDefNames[name..'_scav'] then - effectDefs[name..'_scav'] = deepcopy(effects) + if UnitDefNames[name .. "_scav"] then + effectDefs[name .. "_scav"] = deepcopy(effects) for i, effect in pairs(effects) do - effectDefs[name..'_scav'][i].color = {0.6, 0.12, 0.7} + effectDefs[name .. "_scav"][i].color = { 0.6, 0.12, 0.7 } end end end @@ -171,13 +169,11 @@ local jetShader = nil local LuaShader = gl.LuaShader -local drawInstanceVBO = gl.InstanceVBOTable.drawInstanceVBO -local popElementInstance = gl.InstanceVBOTable.popElementInstance +local drawInstanceVBO = gl.InstanceVBOTable.drawInstanceVBO +local popElementInstance = gl.InstanceVBOTable.popElementInstance local pushElementInstance = gl.InstanceVBOTable.pushElementInstance - -local vsSrc = -[[#version 420 +local vsSrc = [[#version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shader_storage_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -345,8 +341,7 @@ void main() } ]] -local fsSrc = -[[ +local fsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -396,23 +391,22 @@ void main(void) ]] local function goodbye(reason) - spEcho("Airjet GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("Airjet GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end - local jetShaderSourceCache = { vsSrc = vsSrc, fsSrc = fsSrc, shaderName = "JetShader GL4", uniformInt = { - noiseMap = 0, - mask = 1, - }, + noiseMap = 0, + mask = 1, + }, uniformFloat = { - --jetuniforms = {1,1,1,1}, --unused + --jetuniforms = {1,1,1,1}, --unused --iconDistance = 1, - }, + }, shaderConfig = { USEQUATERNIONS = Engine.FeatureSupport.transformsInGL4 and "1" or "0", DEBUG = autoUpdate and "1" or "0", @@ -423,16 +417,18 @@ local jetShaderSourceCache = { local function initGL4() jetShader = LuaShader.CheckShaderUpdates(jetShaderSourceCache) --spEcho(jetShader.shaderParams.vertex) - if not jetShader then goodbye("Failed to compile jetShader GL4 ") end - local quadVBO,numVertices = gl.InstanceVBOTable.makeRectVBO(-1,0,1,-1,0,1,1,0) --(minX,minY, maxX, maxY, minU, minV, maxU, maxV) + if not jetShader then + goodbye("Failed to compile jetShader GL4 ") + end + local quadVBO, numVertices = gl.InstanceVBOTable.makeRectVBO(-1, 0, 1, -1, 0, 1, 1, 0) --(minX,minY, maxX, maxY, minU, minV, maxU, maxV) local jetInstanceVBOLayout = { - {id = 1, name = 'widthlengthtime', size = 3}, -- widthlength - {id = 2, name = 'emitdir', size = 3}, -- emit dir - {id = 3, name = 'color', size = 3}, --- color - {id = 4, name = 'pieceIndex', type = GL.UNSIGNED_INT, size= 1}, - {id = 5, name = 'instData', type = GL.UNSIGNED_INT, size= 4}, - } - jetInstanceVBO = gl.InstanceVBOTable.makeInstanceVBOTable(jetInstanceVBOLayout,256, "jetInstanceVBO", 5) + { id = 1, name = "widthlengthtime", size = 3 }, -- widthlength + { id = 2, name = "emitdir", size = 3 }, -- emit dir + { id = 3, name = "color", size = 3 }, --- color + { id = 4, name = "pieceIndex", type = GL.UNSIGNED_INT, size = 1 }, + { id = 5, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, + } + jetInstanceVBO = gl.InstanceVBOTable.makeInstanceVBOTable(jetInstanceVBOLayout, 256, "jetInstanceVBO", 5) jetInstanceVBO.numVertices = numVertices jetInstanceVBO.vertexVBO = quadVBO jetInstanceVBO.VAO = gl.InstanceVBOTable.makeVAOandAttach(jetInstanceVBO.vertexVBO, jetInstanceVBO.instanceVBO) @@ -449,7 +445,7 @@ local function ValidateUnitIDs(unitIDkeys) local numunitids = 0 local validunitids = 0 local invalidunitids = {} - local invalidstr = '' + local invalidstr = "" for indexpos, unitID in pairs(unitIDkeys) do numunitids = numunitids + 1 if Spring.ValidUnitID(unitID) then @@ -459,18 +455,20 @@ local function ValidateUnitIDs(unitIDkeys) invalidstr = tostring(unitID) .. " " .. invalidstr end end - if numunitids- validunitids > 0 then - spEcho("Airjets GL4", numunitids, "Valid", numunitids- validunitids, "invalid", invalidstr) + if numunitids - validunitids > 0 then + spEcho("Airjets GL4", numunitids, "Valid", numunitids - validunitids, "invalid", invalidstr) end end local drawframe = 0 local function DrawParticles(isReflection) - if not enabled then return false end + if not enabled then + return false + end -- validate unitID buffer drawframe = drawframe + 1 --if drawframe %99 == 1 then - --spEcho("Numairjets", jetInstanceVBO.usedElements) + --spEcho("Numairjets", jetInstanceVBO.usedElements) --end if jetInstanceVBO.usedElements > 0 then @@ -506,8 +504,8 @@ end local function RemoveLights(unitID) if lighteffectsEnabled and lights[unitID] then - for i,v in pairs(lights[unitID]) do - WG['lighteffects'].removeLight(lights[unitID][i], 3) + for i, v in pairs(lights[unitID]) do + WG["lighteffects"].removeLight(lights[unitID][i], 3) end lights[unitID] = nil end @@ -521,8 +519,8 @@ local function FinishInitialization(unitID, effectDef) --spEcho("FinishInitialization", fx.piece, pieceMap[fx.piece]) fx.piecenum = pieceMap[fx.piece] end - fx.width = fx.width*1.2 - fx.length = fx.length*1.4 + fx.width = fx.width * 1.2 + fx.length = fx.length * 1.4 end effectDef.finishedInit = true end @@ -540,7 +538,9 @@ local function Activate(unitID, unitDefID, who, when) activePlanes[unitID] = unitDefID - if when == nil then when = 0 end -- + if when == nil then + when = 0 + end -- if Spring.GetUnitIsDead(unitID) == true then --Spring.SendCommands({"pause 1"}) @@ -552,14 +552,22 @@ local function Activate(unitID, unitDefID, who, when) local color = effectDef.color local emitVector = effectDef.emitVector local effectdata = { - effectDef.width*0.4,effectDef.length, when, - emitVector[1],emitVector[2],emitVector[3], - color[1],color[2],color[3], + effectDef.width * 0.4, + effectDef.length, + when, + emitVector[1], + emitVector[2], + emitVector[3], + color[1], + color[2], + color[3], effectDef.piecenum - 1, - 0,0,0,0, -- this is needed to keep the lua copy of the vbo the correct size - + 0, + 0, + 0, + 0, -- this is needed to keep the lua copy of the vbo the correct size } - pushElementInstance(jetInstanceVBO,effectdata,tostring(unitID).."_"..tostring(effectDef.piecenum), true, nil, unitID) + pushElementInstance(jetInstanceVBO, effectdata, tostring(unitID) .. "_" .. tostring(effectDef.piecenum), true, nil, unitID) end end @@ -572,7 +580,7 @@ local function Deactivate(unitID, unitDefID, who) local unitEffects = effectDefs[unitDefID] for i = 1, #unitEffects do local effectDef = unitEffects[i] - local airjetkey = tostring(unitID).."_"..tostring(effectDef.piecenum) + local airjetkey = tostring(unitID) .. "_" .. tostring(effectDef.piecenum) if jetInstanceVBO.instanceIDtoIndex[airjetkey] then popElementInstance(jetInstanceVBO, airjetkey) end @@ -581,7 +589,7 @@ end local function RemoveUnit(unitID, unitDefID, unitTeamID) --spEcho("RemoveUnit(unitID, unitDefID, unitTeamID)",unitID, unitDefID, unitTeamID) - if effectDefs[unitDefID] and type(unitID) == 'number' then -- checking for type(unitID) because we got: Error in RenderUnitDestroyed(): [string "LuaUI/Widgets/gfx_airjets_gl4.lua"]:812: attempt to concatenate local 'unitID' (a table value) + if effectDefs[unitDefID] and type(unitID) == "number" then -- checking for type(unitID) because we got: Error in RenderUnitDestroyed(): [string "LuaUI/Widgets/gfx_airjets_gl4.lua"]:812: attempt to concatenate local 'unitID' (a table value) Deactivate(unitID, unitDefID, "died") inactivePlanes[unitID] = nil activePlanes[unitID] = nil @@ -601,10 +609,12 @@ end -------------------------------------------------------------------------------- function widget:Update(dt) - if true then return end + if true then + return + end updateSec = updateSec + dt local gf = Spring.GetGameFrame() - if gf ~= lastGameFrame and updateSec > 0.51 then -- to limit the number of unit status checks + if gf ~= lastGameFrame and updateSec > 0.51 then -- to limit the number of unit status checks --[[ if Spring.GetGameFrame() > 0 then ValidateUnitIDs(jetInstanceVBO.indextoUnitID) @@ -614,7 +624,8 @@ function widget:Update(dt) for i, v in pairs(activePlanes) do activecnt = activecnt + 1 end spEcho( Spring.GetGameFrame (), "airjetcount", jetInstanceVBO.usedElements, "active:", activecnt, "inactive", inactivecnt) end - ]]-- + ]] + -- ValidateUnitIDs(jetInstanceVBO.indextoUnitID) lastGameFrame = gf updateSec = 0 @@ -622,24 +633,24 @@ function widget:Update(dt) -- always activate enemy planes if spGetUnitIsActive(unitID) or not Spring.IsUnitAllied(unitID) then if xzVelocityUnits[unitDefID] then - local uvx,_,uvz = spGetUnitVelocity(unitID) + local uvx, _, uvz = spGetUnitVelocity(unitID) if uvx * uvx + uvz * uvz > xzVelocityUnits[unitDefID] * xzVelocityUnits[unitDefID] then - Activate(unitID, unitDefID,"updatewasinactive", gf) + Activate(unitID, unitDefID, "updatewasinactive", gf) end else - Activate(unitID, unitDefID,"updatewasinactive", gf) + Activate(unitID, unitDefID, "updatewasinactive", gf) end end end for unitID, unitDefID in pairs(activePlanes) do if Spring.ValidUnitID(unitID) then if not spGetUnitIsActive(unitID) then - Deactivate(unitID, unitDefID,"updatewasinactive") + Deactivate(unitID, unitDefID, "updatewasinactive") else if xzVelocityUnits[unitDefID] then - local uvx,_,uvz = spGetUnitVelocity(unitID) + local uvx, _, uvz = spGetUnitVelocity(unitID) if uvx * uvx + uvz * uvz <= xzVelocityUnits[unitDefID] * xzVelocityUnits[unitDefID] then - Deactivate(unitID, unitDefID,"tooslow") + Deactivate(unitID, unitDefID, "tooslow") end end end @@ -650,7 +661,7 @@ function widget:Update(dt) end local prevLighteffectsEnabled = lighteffectsEnabled - lighteffectsEnabled = (enableLights and WG['lighteffects'] ~= nil and WG['lighteffects'].enableThrusters) + lighteffectsEnabled = (enableLights and WG["lighteffects"] ~= nil and WG["lighteffects"].enableThrusters) if lighteffectsEnabled ~= prevLighteffectsEnabled then for _, teamID in ipairs(spGetTeamList()) do local teamUnits = spGetTeamUnitsByDefs(teamID, effectDefIDList) @@ -667,7 +678,9 @@ function widget:Update(dt) end function widget:UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) - if fullview then return end + if fullview then + return + end if spValidUnitID(unitID) then unitDefID = unitDefID or spGetUnitDefID(unitID) --spEcho("UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID)",unitID, unitTeam, allyTeam, unitDefID) @@ -723,7 +736,6 @@ function widget:DrawWorld() DrawParticles(false) end - function widget:DrawWorldReflection() DrawParticles(true) end @@ -750,10 +762,11 @@ function widget:PlayerChanged(playerID) local currentspec, currentfullview = spGetSpectatingState() local currentAllyTeamID = Spring.GetMyAllyTeamID() local reinit = false - if (currentspec ~= spec) or - (currentfullview ~= fullview) or - ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) -- our ALLYteam changes, and we are not in fullview - then + if + (currentspec ~= spec) + or (currentfullview ~= fullview) + or ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) -- our ALLYteam changes, and we are not in fullview + then -- do the actual reinit stuff: --spEcho("Airjets reinit") reinit = true @@ -762,7 +775,9 @@ function widget:PlayerChanged(playerID) spec = currentspec fullview = currentfullview myAllyTeamID = currentAllyTeamID - if reinit then reInitialize() end + if reinit then + reInitialize() + end end function widget:Initialize() @@ -773,37 +788,50 @@ function widget:Initialize() initGL4() reInitialize() - WG['airjets'] = {} + WG["airjets"] = {} - WG['airjets'].addAirJet = function (unitID, piecenum, width, length, color3, emitVector) -- for WG external calls - local airjetkey = tostring(unitID).."_"..tostring(piecenum) - if emitVector == nil then emitVector = {0,0,-1} end + WG["airjets"].addAirJet = function(unitID, piecenum, width, length, color3, emitVector) -- for WG external calls + local airjetkey = tostring(unitID) .. "_" .. tostring(piecenum) + if emitVector == nil then + emitVector = { 0, 0, -1 } + end pushElementInstance( jetInstanceVBO, { - width*5, length*5, spGetGameFrame(), - emitVector[1], emitVector[2], emitVector[3], - color[1], color[2], color[3], + width * 5, + length * 5, + spGetGameFrame(), + emitVector[1], + emitVector[2], + emitVector[3], + color[1], + color[2], + color[3], piecenum, - 0,0,0,0 -- this is needed to keep the lua copy of the vbo the correct size + 0, + 0, + 0, + 0, -- this is needed to keep the lua copy of the vbo the correct size }, airjetkey, true, -- update exisiting - nil, -- noupload + nil, -- noupload unitID -- unitID - ) + ) return airjetkey end - WG['airjets'].removeAirJet = function (airjetkey) ---- for WG external calls - return popElementInstance(jetInstanceVBO,airjetkey) + WG["airjets"].removeAirJet = function(airjetkey) ---- for WG external calls + return popElementInstance(jetInstanceVBO, airjetkey) end end if autoUpdate then function widget:DrawScreen() --spEcho("drawprintf", jetShader.DrawPrintf, jetShader.printf) - if jetShader.DrawPrintf then jetShader.DrawPrintf() end + if jetShader.DrawPrintf then + jetShader.DrawPrintf() + end end end diff --git a/luaui/Widgets/gfx_bloom_shader_deferred.lua b/luaui/Widgets/gfx_bloom_shader_deferred.lua index 9c80e11c100..6db7dc73529 100644 --- a/luaui/Widgets/gfx_bloom_shader_deferred.lua +++ b/luaui/Widgets/gfx_bloom_shader_deferred.lua @@ -1,6 +1,6 @@ local isPotatoGpu = false local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 1000) / 1000 -if Platform ~= nil and Platform.gpuVendor == 'Intel' then +if Platform ~= nil and Platform.gpuVendor == "Intel" then isPotatoGpu = true end if gpuMem and gpuMem > 0 and gpuMem < 1800 then @@ -11,17 +11,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Bloom Shader Deferred", --(v0.5) - desc = "Applies bloom to units only", - author = "Kloot, Beherith", - date = "2018-05-13", - license = "GNU GPL, v2 or later", - layer = 99999, - enabled = not isPotatoGpu, + name = "Bloom Shader Deferred", --(v0.5) + desc = "Applies bloom to units only", + author = "Kloot, Beherith", + date = "2018-05-13", + license = "GNU GPL, v2 or later", + layer = 99999, + enabled = not isPotatoGpu, } end - -- Localized functions for performance local mathCeil = math.ceil local mathMax = math.max @@ -31,15 +30,15 @@ local spEcho = Spring.Echo local version = 2.1 -local dbgDraw = 0 -- draw only the bloom-mask? [0 | 1] +local dbgDraw = 0 -- draw only the bloom-mask? [0 | 1] -local glowAmplifier = 1.0 -- intensity multiplier on glow source fragments (HDR pipeline -- much lower than the old 8-bit pipeline needed) -local maxBrightContribution = 0.91 -- per-pixel cap on the bright pass output to prevent fireflies / overwhelming bloom on intense emissive blink frames -local illumThreshold = 0.1 -- soft-knee threshold for the bright pass (computed from sun lighting) -local kneeWidth = 5 -- width of the soft knee around illumThreshold -local upsampleRadius = 1.0 -- 3x3 tent filter radius in texels (for mip chain upsample) -local temporalBlend = 0.55 -- 0 = no smoothing (current frame only), 1 = freeze. ~0.5 kills sub-pixel shimmer of small emissives -local useScreenBlend = true -- true: dst + bloom*(1-dst) ("screen"-like, soft cap). false: pure additive (old behaviour) +local glowAmplifier = 1.0 -- intensity multiplier on glow source fragments (HDR pipeline -- much lower than the old 8-bit pipeline needed) +local maxBrightContribution = 0.91 -- per-pixel cap on the bright pass output to prevent fireflies / overwhelming bloom on intense emissive blink frames +local illumThreshold = 0.1 -- soft-knee threshold for the bright pass (computed from sun lighting) +local kneeWidth = 5 -- width of the soft knee around illumThreshold +local upsampleRadius = 1.0 -- 3x3 tent filter radius in texels (for mip chain upsample) +local temporalBlend = 0.55 -- 0 = no smoothing (current frame only), 1 = freeze. ~0.5 kills sub-pixel shimmer of small emissives +local useScreenBlend = true -- true: dst + bloom*(1-dst) ("screen"-like, soft cap). false: pure additive (old behaviour) local glowAmplifierMult = 1.25 @@ -57,9 +56,9 @@ local presets = { local GL_RGBA16F_ARB = 0x881A -- non-editables -local vsx = 1 -- current viewport width -local vsy = 1 -- current viewport height -local qvsx,qvsy -- size of bloom mip 1 (top of chain) +local vsx = 1 -- current viewport width +local vsy = 1 -- current viewport height +local qvsx, qvsy -- size of bloom mip 1 (top of chain) local iqvsx, iqvsy local debugBrightShader = false @@ -72,7 +71,7 @@ local blendShader = nil local combineShader = nil local bloomMips = {} -- array of { tex, w, h, ix, iy } -local historyTex = nil -- last-frame final bloom (mip[1] resolution), used for temporal smoothing +local historyTex = nil -- last-frame final bloom (mip[1] resolution), used for temporal smoothing local historyValid = false local rectVAO = nil @@ -91,18 +90,17 @@ local glGetShaderLog = gl.GetShaderLog local glCreateShader = gl.CreateShader local glDeleteShader = gl.DeleteShader - local function SetIllumThreshold() local ra, ga, ba = glGetSun("ambient", "unit") - local rd, gd, bd = glGetSun("diffuse","unit") + local rd, gd, bd = glGetSun("diffuse", "unit") local rs, gs, bs = glGetSun("specular") -- Rec.709 luminance weights (proper) - local ambientIntensity = ra * 0.2126 + ga * 0.7152 + ba * 0.0722 - local diffuseIntensity = rd * 0.2126 + gd * 0.7152 + bd * 0.0722 + local ambientIntensity = ra * 0.2126 + ga * 0.7152 + ba * 0.0722 + local diffuseIntensity = rd * 0.2126 + gd * 0.7152 + bd * 0.0722 local specularIntensity = rs * 0.2126 + gs * 0.7152 + bs * 0.0722 - illumThreshold = illumThreshold*(0.7 * ambientIntensity) + (0.4 * diffuseIntensity) + (0.1 * specularIntensity) + illumThreshold = illumThreshold * (0.7 * ambientIntensity) + (0.4 * diffuseIntensity) + (0.1 * specularIntensity) illumThreshold = math.min(illumThreshold, 0.8) illumThreshold = (0.4 + illumThreshold) / 2.1 @@ -116,10 +114,15 @@ end local function FreeMips() for i = 1, #bloomMips do - if bloomMips[i].tex then glDeleteTexture(bloomMips[i].tex) end + if bloomMips[i].tex then + glDeleteTexture(bloomMips[i].tex) + end end bloomMips = {} - if historyTex then glDeleteTexture(historyTex); historyTex = nil end + if historyTex then + glDeleteTexture(historyTex) + historyTex = nil + end historyValid = false end @@ -128,15 +131,14 @@ local function MakeBloomShaders() local downscale = presets[preset].downscale local mipCount = presets[preset].mipCount --spEcho("New bloom init preset:", preset) - vsx = mathMax(4,viewSizeX) - vsy = mathMax(4,viewSizeY) - qvsx,qvsy = mathCeil(vsx/downscale), mathCeil(vsy/downscale) -- we ceil to ensure perfect upscaling + vsx = mathMax(4, viewSizeX) + vsy = mathMax(4, viewSizeY) + qvsx, qvsy = mathCeil(vsx / downscale), mathCeil(vsy / downscale) -- we ceil to ensure perfect upscaling iqvsx, iqvsy = 1.0 / qvsx, 1.0 / qvsy local padx, pady = downscale * qvsx - vsx, downscale * qvsy - vsy - - local shaderConfig = { + local shaderConfig = { VSX = vsx, VSY = vsy, HSX = qvsx, @@ -162,15 +164,17 @@ local function MakeBloomShaders() local tex = glCreateTexture(tw, th, { fbo = true, format = GL_RGBA16F_ARB, - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) if tex == nil then - spEcho('bloomMip['..i..'] == nil ('..tw..'x'..th..')') + spEcho("bloomMip[" .. i .. "] == nil (" .. tw .. "x" .. th .. ")") RemoveMe("[BloomShader::ViewResize] removing widget, bad texture target") return end - bloomMips[i] = { tex = tex, w = tw, h = th, ix = 1.0/tw, iy = 1.0/th } + bloomMips[i] = { tex = tex, w = tw, h = th, ix = 1.0 / tw, iy = 1.0 / th } mw = mathCeil(mw * 0.5) mh = mathCeil(mh * 0.5) end @@ -179,23 +183,33 @@ local function MakeBloomShaders() historyTex = glCreateTexture(mathMax(1, qvsx), mathMax(1, qvsy), { fbo = true, format = GL_RGBA16F_ARB, - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) historyValid = false - if glDeleteShader then - if brightShader then brightShader:Finalize() end - if downsampleShader then downsampleShader:Finalize() end - if upsampleShader then upsampleShader:Finalize() end - if blendShader then blendShader:Finalize() end - if combineShader then combineShader:Finalize() end + if brightShader then + brightShader:Finalize() + end + if downsampleShader then + downsampleShader:Finalize() + end + if upsampleShader then + upsampleShader:Finalize() + end + if blendShader then + blendShader:Finalize() + end + if combineShader then + combineShader:Finalize() + end end - combineShader = LuaShader({ - fragment = "#version 150 compatibility\n" .. definesString .. [[ + fragment = "#version 150 compatibility\n" .. definesString .. [[ uniform sampler2D texture0; uniform int debugDraw; uniform float bloomNorm; @@ -209,8 +223,7 @@ local function MakeBloomShaders() gl_FragColor = a; } ]], - vertex = - "#version 150 compatibility\n" .. definesString ..[[ + vertex = "#version 150 compatibility\n" .. definesString .. [[ void main(void) { gl_TexCoord[0] = vec4(gl_Vertex.zwzw); #if DOWNSCALE >= 2 @@ -219,21 +232,21 @@ local function MakeBloomShaders() #endif gl_Position = vec4(gl_Vertex.xy, 0, 1); } ]], - uniformInt = { - texture0 = 0, - debugDraw = 0, - }, - uniformFloat = { - bloomNorm = 1.0, - }, + uniformInt = { + texture0 = 0, + debugDraw = 0, + }, + uniformFloat = { + bloomNorm = 1.0, }, - "Bloom Combine Shader") + }, "Bloom Combine Shader") if not combineShader:Initialize() then - RemoveMe("[BloomShader::Initialize] combineShader compilation failed"); spEcho(glGetShaderLog()); return + RemoveMe("[BloomShader::Initialize] combineShader compilation failed") + spEcho(glGetShaderLog()) + return end - -- Downsample shader: 13-tap Jimenez "next gen post processing in CoD:AW" filter. -- On the very first downsample (firstPass==1) we apply a Karis luminance average to -- suppress fireflies (single super-bright HDR pixels causing flickering halos). @@ -302,15 +315,16 @@ local function MakeBloomShaders() firstPass = 0, }, uniformFloat = { - sourceTexelSize = {1.0, 1.0}, + sourceTexelSize = { 1.0, 1.0 }, }, }, "Bloom Downsample Shader") if not downsampleShader:Initialize() then - RemoveMe("[BloomShader::Initialize] downsampleShader compilation failed"); spEcho(glGetShaderLog()); return + RemoveMe("[BloomShader::Initialize] downsampleShader compilation failed") + spEcho(glGetShaderLog()) + return end - -- Upsample shader: 3x3 tent filter, blended additively into the next-larger mip. upsampleShader = LuaShader({ vertex = [[ @@ -350,16 +364,17 @@ local function MakeBloomShaders() source = 0, }, uniformFloat = { - sourceTexelSize = {1.0, 1.0}, + sourceTexelSize = { 1.0, 1.0 }, filterRadius = 1.0, }, }, "Bloom Upsample Shader") if not upsampleShader:Initialize() then - RemoveMe("[BloomShader::Initialize] upsampleShader compilation failed"); spEcho(glGetShaderLog()); return + RemoveMe("[BloomShader::Initialize] upsampleShader compilation failed") + spEcho(glGetShaderLog()) + return end - -- Temporal blend shader: mix history and current frame to suppress sub-pixel -- shimmer of small/thin emissives (no reprojection - fine for low-frequency bloom). blendShader = LuaShader({ @@ -391,10 +406,11 @@ local function MakeBloomShaders() }, "Bloom Temporal Blend Shader") if not blendShader:Initialize() then - RemoveMe("[BloomShader::Initialize] blendShader compilation failed"); spEcho(glGetShaderLog()); return + RemoveMe("[BloomShader::Initialize] blendShader compilation failed") + spEcho(glGetShaderLog()) + return end - brightShader = LuaShader({ vertex = [[ #version 150 compatibility @@ -402,8 +418,7 @@ local function MakeBloomShaders() gl_TexCoord[0] = vec4(gl_Vertex.zwzw); gl_Position = vec4(gl_Vertex.xy, 0, 1); } ]], - fragment = - "#version 150 compatibility \n" .. definesString .. [[ + fragment = "#version 150 compatibility \n" .. definesString .. [[ uniform sampler2D modelDiffuseTex; uniform sampler2D modelEmitTex; @@ -495,14 +510,14 @@ local function MakeBloomShaders() kneeWidth = 0.5, fragGlowAmplifier = 1.0, maxBrightContribution = 1.5, - } + }, }, "Bloom Bright Shader") if not brightShader:Initialize() then - spEcho(glGetShaderLog()); - RemoveMe("[BloomShader::Initialize] brightShader compilation failed"); return + spEcho(glGetShaderLog()) + RemoveMe("[BloomShader::Initialize] brightShader compilation failed") + return end - end function widget:ViewResize(viewSizeX, viewSizeY) @@ -510,51 +525,60 @@ function widget:ViewResize(viewSizeX, viewSizeY) end function widget:Initialize() - if glCreateShader == nil then RemoveMe("[BloomShader::Initialize] removing widget, no shader support") return end - local hasdeferredmodelrendering = (Spring.GetConfigString("AllowDeferredModelRendering")=='1') + local hasdeferredmodelrendering = (Spring.GetConfigString("AllowDeferredModelRendering") == "1") if hasdeferredmodelrendering == false then RemoveMe("[BloomShader::Initialize] removing widget, AllowDeferredModelRendering is required") end - local hasdeferredmaprendering = (Spring.GetConfigString("AllowDeferredMapRendering")=='1') + local hasdeferredmaprendering = (Spring.GetConfigString("AllowDeferredMapRendering") == "1") if hasdeferredmaprendering == false then RemoveMe("[BloomShader::Initialize] removing widget, AllowDeferredMapRendering is required") end - WG['bloomdeferred'] = {} - WG['bloomdeferred'].getBrightness = function() + WG["bloomdeferred"] = {} + WG["bloomdeferred"].getBrightness = function() return glowAmplifier end - WG['bloomdeferred'].setBrightness = function(value) + WG["bloomdeferred"].setBrightness = function(value) glowAmplifier = value MakeBloomShaders() end - WG['bloomdeferred'].getPreset = function() + WG["bloomdeferred"].getPreset = function() return preset end - WG['bloomdeferred'].setPreset = function(value) + WG["bloomdeferred"].setPreset = function(value) preset = value MakeBloomShaders() end MakeBloomShaders() - rectVAO = InstanceVBOTable.MakeTexRectVAO()-- -1, -1, 1, 0, 0,0,1, 0.5) + rectVAO = InstanceVBOTable.MakeTexRectVAO() -- -1, -1, 1, 0, 0,0,1, 0.5) end function widget:Shutdown() FreeMips() if glDeleteShader then - if brightShader then brightShader:Finalize() end - if downsampleShader then downsampleShader:Finalize() end - if upsampleShader then upsampleShader:Finalize() end - if blendShader then blendShader:Finalize() end - if combineShader then combineShader:Finalize() end + if brightShader then + brightShader:Finalize() + end + if downsampleShader then + downsampleShader:Finalize() + end + if upsampleShader then + upsampleShader:Finalize() + end + if blendShader then + blendShader:Finalize() + end + if combineShader then + combineShader:Finalize() + end end - WG['bloomdeferred'] = nil + WG["bloomdeferred"] = nil end local function FullScreenQuad() @@ -562,7 +586,9 @@ local function FullScreenQuad() end local function Bloom() - if #bloomMips == 0 then return end + if #bloomMips == 0 then + return + end gl.DepthMask(false) gl.Color(1, 1, 1, 1) @@ -571,22 +597,22 @@ local function Bloom() -- 1) Bright pass: write into mip[1] (top of chain). gl.Blending(false) brightShader:Activate() - brightShader:SetUniform("illuminationThreshold", illumThreshold) - brightShader:SetUniform("kneeWidth", kneeWidth) - brightShader:SetUniform("fragGlowAmplifier", glowAmplifier*glowAmplifierMult) - brightShader:SetUniform("maxBrightContribution", maxBrightContribution) - - glTexture(0, "$model_gbuffer_difftex") - glTexture(1, "$model_gbuffer_emittex") - glTexture(2, "$model_gbuffer_zvaltex") - glTexture(3, "$map_gbuffer_zvaltex") - - glRenderToTexture(bloomMips[1].tex, FullScreenQuad) - - glTexture(0, false) - glTexture(1, false) - glTexture(2, false) - glTexture(3, false) + brightShader:SetUniform("illuminationThreshold", illumThreshold) + brightShader:SetUniform("kneeWidth", kneeWidth) + brightShader:SetUniform("fragGlowAmplifier", glowAmplifier * glowAmplifierMult) + brightShader:SetUniform("maxBrightContribution", maxBrightContribution) + + glTexture(0, "$model_gbuffer_difftex") + glTexture(1, "$model_gbuffer_emittex") + glTexture(2, "$model_gbuffer_zvaltex") + glTexture(3, "$map_gbuffer_zvaltex") + + glRenderToTexture(bloomMips[1].tex, FullScreenQuad) + + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) brightShader:Deactivate() if not debugBrightShader then @@ -630,24 +656,24 @@ local function Bloom() if historyValid then gl.Blending(false) blendShader:Activate() - blendShader:SetUniform("historyMix", temporalBlend) - glTexture(0, bloomMips[1].tex) - glTexture(1, historyTex) - glRenderToTexture(historyTex, FullScreenQuad) - glTexture(0, false) - glTexture(1, false) + blendShader:SetUniform("historyMix", temporalBlend) + glTexture(0, bloomMips[1].tex) + glTexture(1, historyTex) + glRenderToTexture(historyTex, FullScreenQuad) + glTexture(0, false) + glTexture(1, false) blendShader:Deactivate() finalSrc = historyTex else -- First frame: prime history from current bloom. gl.Blending(false) blendShader:Activate() - blendShader:SetUniform("historyMix", 0.0) - glTexture(0, bloomMips[1].tex) - glTexture(1, bloomMips[1].tex) - glRenderToTexture(historyTex, FullScreenQuad) - glTexture(0, false) - glTexture(1, false) + blendShader:SetUniform("historyMix", 0.0) + glTexture(0, bloomMips[1].tex) + glTexture(1, bloomMips[1].tex) + glRenderToTexture(historyTex, FullScreenQuad) + glTexture(0, false) + glTexture(1, false) blendShader:Deactivate() historyValid = true finalSrc = historyTex @@ -667,20 +693,22 @@ local function Bloom() gl.Blending(GL.ONE, GL.ZERO) end combineShader:Activate() - combineShader:SetUniformInt("debugDraw", dbgDraw) - -- Each upsample additively contributed once, but smaller mips contribute less - -- perceived brightness than larger ones, so a linear 1/(N-1) normalization - -- over-attenuates higher presets. Use a sqrt-based divisor anchored at the - -- low preset (4 mips => 1/3) so medium/high presets stay closer in intensity - -- to low while still keeping their wider/softer halo. - local norm = 1.0 / math.sqrt(3 * math.max(1, #bloomMips - 1)) - -- Small extra boost for the highest preset, whose extra wide mips - -- spread the energy further and thus look dimmer than medium. - if #bloomMips >= 6 then norm = norm * 1.05 end - combineShader:SetUniform("bloomNorm", norm) - glTexture(0, finalSrc) - rectVAO:DrawArrays(GL.TRIANGLES) - glTexture(0, false) + combineShader:SetUniformInt("debugDraw", dbgDraw) + -- Each upsample additively contributed once, but smaller mips contribute less + -- perceived brightness than larger ones, so a linear 1/(N-1) normalization + -- over-attenuates higher presets. Use a sqrt-based divisor anchored at the + -- low preset (4 mips => 1/3) so medium/high presets stay closer in intensity + -- to low while still keeping their wider/softer halo. + local norm = 1.0 / math.sqrt(3 * math.max(1, #bloomMips - 1)) + -- Small extra boost for the highest preset, whose extra wide mips + -- spread the energy further and thus look dimmer than medium. + if #bloomMips >= 6 then + norm = norm * 1.05 + end + combineShader:SetUniform("bloomNorm", norm) + glTexture(0, finalSrc) + rectVAO:DrawArrays(GL.TRIANGLES) + glTexture(0, false) combineShader:Deactivate() gl.Blending("reset") diff --git a/luaui/Widgets/gfx_cas.lua b/luaui/Widgets/gfx_cas.lua index c9e7806baa3..20271280070 100644 --- a/luaui/Widgets/gfx_cas.lua +++ b/luaui/Widgets/gfx_cas.lua @@ -6,15 +6,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Contrast Adaptive Sharpen", - desc = "Spring port of AMD FidelityFX' Contrast Adaptive Sharpen (CAS)", - author = "martymcmodding, ivand", - layer = 2000, - enabled = true, + name = "Contrast Adaptive Sharpen", + desc = "Spring port of AMD FidelityFX' Contrast Adaptive Sharpen (CAS)", + author = "martymcmodding, ivand", + layer = 2000, + enabled = true, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -33,8 +32,8 @@ local version = 1.06 -- Lua Shortcuts ----------------------------------------------------------------- -local glTexture = gl.Texture -local glBlending = gl.Blending +local glTexture = gl.Texture +local glBlending = gl.Blending ----------------------------------------------------------------- -- File path Constants @@ -164,7 +163,6 @@ local fullTexQuad -- Local Functions ----------------------------------------------------------------- - ----------------------------------------------------------------- -- Widget Functions ----------------------------------------------------------------- @@ -178,7 +176,6 @@ local function UpdateShader() end function widget:Initialize() - if gl.CreateShader == nil then spEcho("CAS: createshader not supported, removing") widgetHandler:RemoveWidget() @@ -210,9 +207,9 @@ function widget:Initialize() local shaderCompiled = casShader:Initialize() if not shaderCompiled then - spEcho("Failed to compile Contrast Adaptive Sharpen shader, removing widget") - widgetHandler:RemoveWidget() - return + spEcho("Failed to compile Contrast Adaptive Sharpen shader, removing widget") + widgetHandler:RemoveWidget() + return end UpdateShader() @@ -231,7 +228,6 @@ function widget:Initialize() WG.cas.getSharpness = function() return SHARPNESS end - end function widget:Shutdown() @@ -251,15 +247,17 @@ end function widget:DrawScreenEffects() --glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - if WG['screencopymanager'] and WG['screencopymanager'].GetScreenCopy then - screenCopyTex = WG['screencopymanager'].GetScreenCopy() + if WG["screencopymanager"] and WG["screencopymanager"].GetScreenCopy then + screenCopyTex = WG["screencopymanager"].GetScreenCopy() else --glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - spEcho("Missing Screencopy Manager, exiting", WG['screencopymanager'] ) + spEcho("Missing Screencopy Manager, exiting", WG["screencopymanager"]) widgetHandler:RemoveWidget() return false end - if screenCopyTex == nil then return end + if screenCopyTex == nil then + return + end glTexture(0, screenCopyTex) glBlending(false) casShader:Activate() @@ -272,7 +270,7 @@ end function widget:GetConfigData() return { version = version, - SHARPNESS = SHARPNESS + SHARPNESS = SHARPNESS, } end diff --git a/luaui/Widgets/gfx_darken_map.lua b/luaui/Widgets/gfx_darken_map.lua index 54ddf0d8282..7d9085a38ac 100644 --- a/luaui/Widgets/gfx_darken_map.lua +++ b/luaui/Widgets/gfx_darken_map.lua @@ -1,23 +1,20 @@ - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Darken map", - desc = "darkens the map, not units", - author = "Floris", - date = "2015", - license = "GNU GPL, v2 or later", - layer = 10000, - enabled = true - } + return { + name = "Darken map", + desc = "darkens the map, not units", + author = "Floris", + date = "2015", + license = "GNU GPL, v2 or later", + layer = 10000, + enabled = true, + } end - - -- Localized Spring API for performance local spGetCameraPosition = Spring.GetCameraPosition @@ -30,14 +27,13 @@ local maxDarkness = 0.6 local features local camX, camY, camZ = spGetCameraPosition() -local camDirX,camDirY,camDirZ = Spring.GetCameraDirection() +local camDirX, camDirY, camDirZ = Spring.GetCameraDirection() function widget:Shutdown() - WG['darkenmap'] = nil + WG["darkenmap"] = nil end - -local function mapDarkness(_,_,params) +local function mapDarkness(_, _, params) if #params == 1 then if type(tonumber(params[1])) == "number" then darknessvalue = tonumber(params[1]) @@ -49,44 +45,43 @@ local function mapDarkness(_,_,params) end function widget:Initialize() - WG['darkenmap'] = {} - WG['darkenmap'].getMapDarkness = function() + WG["darkenmap"] = {} + WG["darkenmap"].getMapDarkness = function() return darknessvalue end - WG['darkenmap'].setMapDarkness = function(value) + WG["darkenmap"].setMapDarkness = function(value) darknessvalue = tonumber(value) end widgetHandler:AddAction("mapdarkness", mapDarkness, nil, "t") end - local prevCam = {} -prevCam[1],prevCam[2],prevCam[3] = spGetCameraPosition() +prevCam[1], prevCam[2], prevCam[3] = spGetCameraPosition() function widget:Update(dt) - if darknessvalue >= 0.01 then - camX, camY, camZ = spGetCameraPosition() - camDirX,camDirY,camDirZ = Spring.GetCameraDirection() - end + if darknessvalue >= 0.01 then + camX, camY, camZ = spGetCameraPosition() + camDirX, camDirY, camDirZ = Spring.GetCameraDirection() + end end function widget:DrawWorldPreUnit() if darknessvalue >= 0.01 then - local drawMode = Spring.GetMapDrawMode() - if (drawMode=="height") or (drawMode=="path") then return end + if (drawMode == "height") or (drawMode == "path") then + return + end - gl.PushMatrix() - gl.Color(0,0,0,darknessvalue) - gl.Translate(camX+(camDirX*360),camY+(camDirY*360),camZ+(camDirZ*360)) - gl.Billboard() - gl.Rect(-5000, -5000, 5000, 5000) - gl.PopMatrix() - end + gl.PushMatrix() + gl.Color(0, 0, 0, darknessvalue) + gl.Translate(camX + (camDirX * 360), camY + (camDirY * 360), camZ + (camDirZ * 360)) + gl.Billboard() + gl.Rect(-5000, -5000, 5000, 5000) + gl.PopMatrix() + end end - function widget:GetConfigData(data) - return { + return { darknessvalue = darknessvalue, } end diff --git a/luaui/Widgets/gfx_decals_gl4.lua b/luaui/Widgets/gfx_decals_gl4.lua index 85b74f64fb2..3363fd852ff 100644 --- a/luaui/Widgets/gfx_decals_gl4.lua +++ b/luaui/Widgets/gfx_decals_gl4.lua @@ -9,11 +9,10 @@ function widget:GetInfo() license = "GNU GPL v2", layer = 999, enabled = true, - depends = {'gl4'}, + depends = { "gl4" }, } end - -- Localized functions for performance local mathFloor = math.floor local mathMin = math.min @@ -31,37 +30,37 @@ local spEcho = Spring.Echo -- yes these are geometry shader decals -- we are gonna try to smaple heightmap -- atlasColor is diffuse + alpha - -- The color is expected to blend up to 0.5, +-- The color is expected to blend up to 0.5, -- atlasNormals is normals + emission -- advanced geoshader tricount for quads -- 4x4 - 40 -- KNOWN BUG: - -- the pop-back can change the render order of decals to be a tad annoying.... maybe a better method of managing this is needed? - -- possibly solvable via batched decal removal, a good amount of time after they become transparent? +-- the pop-back can change the render order of decals to be a tad annoying.... maybe a better method of managing this is needed? +-- possibly solvable via batched decal removal, a good amount of time after they become transparent? -- TODO: - -- use global sun params for lighting calcs - -- DONE disable parallax - -- DONE enable support for old-style decals - -- paint emission - -- soften and make large decal creation above saturation threshold more probabilistic - -- always allow the creation of small decals - -- DONE control parallax via config - -- SKIP fix parallax to work - -- DONE Validate normals - -- DONE decal fade-in? - -- DONE cache decal UV's - -- Add team/clan/etc sprays - -- determine clan from first [] of playername - -- which can be done on initialize? - -- cursor - -- DONE: SHADOWS SUPPORT! - -- FOG SUPPORT? - -- Better LOS SUPPORT - -- DONE: BWfactor - -- DONE: glowsustain - -- DONE: glowadd - -- Fix unused decals having 1.0 alpha in normal resulting in heavy glow on zoomed out small decals bleeding +-- use global sun params for lighting calcs +-- DONE disable parallax +-- DONE enable support for old-style decals +-- paint emission +-- soften and make large decal creation above saturation threshold more probabilistic +-- always allow the creation of small decals +-- DONE control parallax via config +-- SKIP fix parallax to work +-- DONE Validate normals +-- DONE decal fade-in? +-- DONE cache decal UV's +-- Add team/clan/etc sprays +-- determine clan from first [] of playername +-- which can be done on initialize? +-- cursor +-- DONE: SHADOWS SUPPORT! +-- FOG SUPPORT? +-- Better LOS SUPPORT +-- DONE: BWfactor +-- DONE: glowsustain +-- DONE: glowadd +-- Fix unused decals having 1.0 alpha in normal resulting in heavy glow on zoomed out small decals bleeding ------------------------ CONFIGURABLES ----------------------------------------------- local shaderConfig = { @@ -79,21 +78,19 @@ local shaderConfig = { SINGLEQUADDECALSIZETHRESHOLD = 24, -- if length and width of decal is less than this, then only spawn 1 quad instead of 16 } -local groundscarsPath = "luaui/images/decals_gl4/groundscars/" -- old: "luaui/images/decals_gl4/oldscars/" -local footprintsPath = "luaui/images/decals_gl4/footprints/" -- old: "luaui/images/decals_gl4/oldscars/" - +local groundscarsPath = "luaui/images/decals_gl4/groundscars/" -- old: "luaui/images/decals_gl4/oldscars/" +local footprintsPath = "luaui/images/decals_gl4/footprints/" -- old: "luaui/images/decals_gl4/oldscars/" -- large decal resolution, 16x16 grid is ok local resolution = 16 -- 32 is 2k tris, a tad pricey... -local largesizethreshold = 512 -- if min(width,height)> than this, then we use the large version! +local largesizethreshold = 512 -- if min(width,height)> than this, then we use the large version! local extralargesizeThreshold = 1024 -- if min(width,height)> than this, then we use the extra large version! -local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 2000) / 1000 -- used for the initial value of lifeTimeMult +local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 2000) / 1000 -- used for the initial value of lifeTimeMult local lifeTimeMult = 0.7 + math.min(gpuMem / 6000, 2.3) -- A global lifetime multiplier for configurability local lifeTimeMultMult = 1.5 -- an additional liftime multiplier that isnt saved to user config, so changing thsi will affect everyones lifetiem regardless of their save config value local autoupdate = false -- auto update shader, for debugging only! - -- for automatic oversaturation prevention, not sure if it even works, but hey! local areaResolution = 256 -- elmos per square, for a 64x map this is uh, big? for 32x32 its 4k local saturationThreshold = 16 * areaResolution @@ -104,14 +101,14 @@ local atlasHeights = nil local atlas = VFS.Include("luaui/images/decals_gl4/decalsgl4_atlas_diffuse.lua") local upperkeys = {} -for k,v in pairs(atlas) do +for k, v in pairs(atlas) do if type(v) == "table" then if string.lower(k) ~= k then upperkeys[k] = true end end end -for k,_ in pairs(upperkeys) do +for k, _ in pairs(upperkeys) do atlas[string.lower(k)] = atlas[k] atlas[k] = nil end @@ -120,11 +117,11 @@ upperkeys = nil --function(t,p) for k,v in pairs(t) do if type(v) == "table" then p = p or 0.5; local px,py = p/t.width, p/t.height; v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py end end end , -- FIXME: Actually fix the unused scars having full white alpha (all emissive) in normal texture! -for k,v in pairs(atlas) do - if type(v) =='table' then -- do 8/512 padding - local px = (8/512) * v[5]/ atlas.width - local py = (8/512) * v[6]/ atlas.height - v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py +for k, v in pairs(atlas) do + if type(v) == "table" then -- do 8/512 padding + local px = (8 / 512) * v[5] / atlas.width + local py = (8 / 512) * v[6] / atlas.height + v[1], v[2], v[3], v[4] = v[1] + px, v[2] - px, v[3] + py, v[4] - py end end @@ -138,7 +135,6 @@ local decalShader = nil local decalLargeShader = nil local decalUseGeometryShader = true - local hasBadCulling = false -- AMD+Linux combo --------------------------- Localization for faster access ------------------- @@ -151,17 +147,15 @@ local glCulling = gl.Culling local glDepthTest = gl.DepthTest local GL_LEQUAL = GL.LEQUAL - - ---- GL4 Backend Stuff---- local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements -local popElementInstance = InstanceVBOTable.popElementInstance +local uploadAllElements = InstanceVBOTable.uploadAllElements +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance -local compactInstanceVBO = InstanceVBOTable.compactInstanceVBO +local compactInstanceVBO = InstanceVBOTable.compactInstanceVBO local vsSrcPath = "LuaUI/Shaders/decals_gl4.vert.glsl" local fsSrcPath = "LuaUI/Shaders/decals_gl4.frag.glsl" @@ -169,7 +163,7 @@ local gsSrcPath = "LuaUI/Shaders/decals_gl4.geom.glsl" local vsSrcLargePath = "LuaUI/Shaders/decals_large_gl4.vert.glsl" -local uniformInts = { +local uniformInts = { heightmapTex = 0, miniMapTex = 1, @@ -178,9 +172,9 @@ local uniformInts = { mapNormalsTex = 4, atlasColorAlpha = 5, atlasNormals = 6, - atlasHeights = ((shaderConfig.PARALLAX == 1) and 7 ) or nil, - atlasORM = ((shaderConfig.AMBIENTOCCLUSION == 1) and 8 ) or nil, - atlasRG = ((shaderConfig.USEGLOW == 1) and 9 ) or nil, + atlasHeights = ((shaderConfig.PARALLAX == 1) and 7) or nil, + atlasORM = ((shaderConfig.AMBIENTOCCLUSION == 1) and 8) or nil, + atlasRG = ((shaderConfig.USEGLOW == 1) and 9) or nil, } local shaderSourceCache = { @@ -207,13 +201,15 @@ local shaderLargeSourceCache = { } local function goodbye(reason) - spEcho("DrawPrimitiveAtUnits GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("DrawPrimitiveAtUnits GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end -local function initGL4( DPATname) +local function initGL4(DPATname) hasBadCulling = ((Platform.gpuVendor == "AMD" and Platform.osFamily == "Linux") == true) - if hasBadCulling then spEcho("Decals GL4 detected AMD + Linux platform, attempting to fix culling") end + if hasBadCulling then + spEcho("Decals GL4 detected AMD + Linux platform, attempting to fix culling") + end decalUseGeometryShader = (gl.LuaShader and gl.LuaShader.isGeometryShaderSupported) or false if decalUseGeometryShader then decalShader = LuaShader.CheckShaderUpdates(shaderSourceCache) @@ -224,24 +220,26 @@ local function initGL4( DPATname) end decalLargeShader = LuaShader.CheckShaderUpdates(shaderLargeSourceCache) - if not decalLargeShader then goodbye("Failed to compile ".. DPATname .." GL4 ") end + if not decalLargeShader then + goodbye("Failed to compile " .. DPATname .. " GL4 ") + end local smallDecalLayout if decalUseGeometryShader then smallDecalLayout = { - {id = 0, name = 'lengthwidthrotation', size = 4}, - {id = 1, name = 'uv_atlaspos', size = 4}, - {id = 2, name = 'alphastart_alphadecay_heatstart_heatdecay', size = 4}, - {id = 3, name = 'worldPos', size = 4}, - {id = 4, name = 'parameters', size = 4}, + { id = 0, name = "lengthwidthrotation", size = 4 }, + { id = 1, name = "uv_atlaspos", size = 4 }, + { id = 2, name = "alphastart_alphadecay_heatstart_heatdecay", size = 4 }, + { id = 3, name = "worldPos", size = 4 }, + { id = 4, name = "parameters", size = 4 }, } else smallDecalLayout = { - {id = 1, name = 'lengthwidthrotation', size = 4}, - {id = 2, name = 'uv_atlaspos', size = 4}, - {id = 3, name = 'alphastart_alphadecay_heatstart_heatdecay', size = 4}, - {id = 4, name = 'worldPos', size = 4}, - {id = 5, name = 'parameters', size = 4}, + { id = 1, name = "lengthwidthrotation", size = 4 }, + { id = 2, name = "uv_atlaspos", size = 4 }, + { id = 3, name = "alphastart_alphadecay_heatstart_heatdecay", size = 4 }, + { id = 4, name = "worldPos", size = 4 }, + { id = 5, name = "parameters", size = 4 }, } end @@ -250,71 +248,65 @@ local function initGL4( DPATname) 64, -- maxelements DPATname .. "VBO" -- name ) - if decalVBO == nil then goodbye("Failed to create decalVBO") end + if decalVBO == nil then + goodbye("Failed to create decalVBO") + end if decalUseGeometryShader then local smallDecalVAO = gl.GetVAO() smallDecalVAO:AttachVertexBuffer(decalVBO.instanceVBO) decalVBO.VAO = smallDecalVAO else - local planeVBOsmall, numVerticesSmall = InstanceVBOTable.makePlaneVBO(1,1,4,4) - local planeIndexVBOsmall, numIndicesSmall = InstanceVBOTable.makePlaneIndexVBO(4,4) + local planeVBOsmall, numVerticesSmall = InstanceVBOTable.makePlaneVBO(1, 1, 4, 4) + local planeIndexVBOsmall, numIndicesSmall = InstanceVBOTable.makePlaneIndexVBO(4, 4) decalVBO.vertexVBO = planeVBOsmall decalVBO.indexVBO = planeIndexVBOsmall - decalVBO.VAO = InstanceVBOTable.makeVAOandAttach( - decalVBO.vertexVBO, - decalVBO.instanceVBO, - decalVBO.indexVBO - ) + decalVBO.VAO = InstanceVBOTable.makeVAOandAttach(decalVBO.vertexVBO, decalVBO.instanceVBO, decalVBO.indexVBO) end - local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1,1,resolution,resolution) - local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution,resolution) --, true) -- add true to cull into a circle + local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1, 1, resolution, resolution) + local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution, resolution) --, true) -- add true to cull into a circle decalLargeVBO = InstanceVBOTable.makeInstanceVBOTable( { - {id = 1, name = 'lengthwidthrotation', size = 4}, - {id = 2, name = 'uv_atlaspos', size = 4}, - {id = 3, name = 'alphastart_alphadecay_heatstart_heatdecay', size = 4}, - {id = 4, name = 'worldPos', size = 4}, - {id = 5, name = 'parameters', size = 4}, + { id = 1, name = "lengthwidthrotation", size = 4 }, + { id = 2, name = "uv_atlaspos", size = 4 }, + { id = 3, name = "alphastart_alphadecay_heatstart_heatdecay", size = 4 }, + { id = 4, name = "worldPos", size = 4 }, + { id = 5, name = "parameters", size = 4 }, }, 64, -- maxelements DPATname .. "Large VBO" -- name ) - if decalLargeVBO == nil then goodbye("Failed to create decalLargeVBO") end + if decalLargeVBO == nil then + goodbye("Failed to create decalLargeVBO") + end decalLargeVBO.vertexVBO = planeVBO decalLargeVBO.indexVBO = planeIndexVBO - decalLargeVBO.VAO = InstanceVBOTable.makeVAOandAttach( - decalLargeVBO.vertexVBO, - decalLargeVBO.instanceVBO, - decalLargeVBO.indexVBO - ) + decalLargeVBO.VAO = InstanceVBOTable.makeVAOandAttach(decalLargeVBO.vertexVBO, decalLargeVBO.instanceVBO, decalLargeVBO.indexVBO) - planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1,1,resolution*4,resolution*4) - planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution*4,resolution*4) --, true) -- add true to cull into a circle + planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1, 1, resolution * 4, resolution * 4) + planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(resolution * 4, resolution * 4) --, true) -- add true to cull into a circle decalExtraLargeVBO = InstanceVBOTable.makeInstanceVBOTable( { - {id = 1, name = 'lengthwidthrotation', size = 4}, - {id = 2, name = 'uv_atlaspos', size = 4}, - {id = 3, name = 'alphastart_alphadecay_heatstart_heatdecay', size = 4}, - {id = 4, name = 'worldPos', size = 4}, - {id = 5, name = 'parameters', size = 4}, + { id = 1, name = "lengthwidthrotation", size = 4 }, + { id = 2, name = "uv_atlaspos", size = 4 }, + { id = 3, name = "alphastart_alphadecay_heatstart_heatdecay", size = 4 }, + { id = 4, name = "worldPos", size = 4 }, + { id = 5, name = "parameters", size = 4 }, }, 64, -- maxelements DPATname .. "Extra Large VBO" -- name ) - if decalExtraLargeVBO == nil then goodbye("Failed to create decalExtraLargeVBO") end + if decalExtraLargeVBO == nil then + goodbye("Failed to create decalExtraLargeVBO") + end decalExtraLargeVBO.vertexVBO = planeVBO decalExtraLargeVBO.indexVBO = planeIndexVBO - decalExtraLargeVBO.VAO = InstanceVBOTable.makeVAOandAttach( - decalExtraLargeVBO.vertexVBO, - decalExtraLargeVBO.instanceVBO, - decalExtraLargeVBO.indexVBO - ) + decalExtraLargeVBO.VAO = InstanceVBOTable.makeVAOandAttach(decalExtraLargeVBO.vertexVBO, decalExtraLargeVBO.instanceVBO, decalExtraLargeVBO.indexVBO) return decalLargeVBO ~= nil and decalVBO ~= nil and decalExtraLargeVBO ~= nil end @@ -325,14 +317,14 @@ local decalRemoveList = {} -- maps instanceID's of decals that need to be batch -- Lightweight table of active decals for external widget consumption (e.g. minimap overlays) -- activeDecalData[decalIndex] = {posx, posz, size, alphastart, alphadecay, spawnframe, isFootprint, width, length, rotation, p, q, s, t} local activeDecalData = {} -local footprintDecalSet = {} -- tracks which decalIndex values are footprints (for rebuild) +local footprintDecalSet = {} -- tracks which decalIndex values are footprints (for rebuild) -- Rebuild activeDecalData from existing VBO instance data. -- Called when external consumers (e.g. PIP) need the current decal state after a reload or re-enable. local function RebuildActiveDecalData() activeDecalData = {} local mathMax = math.max - local vboTables = {decalVBO, decalLargeVBO, decalExtraLargeVBO} + local vboTables = { decalVBO, decalLargeVBO, decalExtraLargeVBO } for _, vbo in ipairs(vboTables) do if vbo and vbo.usedElements > 0 then local step = vbo.instanceStep @@ -352,7 +344,7 @@ local function RebuildActiveDecalData() local alphastart = data[offset + 9] local alphadecay = data[offset + 10] local spawnframe = data[offset + 16] - activeDecalData[instanceID] = {posx, posz, size, alphastart, alphadecay, spawnframe, footprintDecalSet[instanceID] or false, width, length, rotation, p, q, s, t} + activeDecalData[instanceID] = { posx, posz, size, alphastart, alphadecay, spawnframe, footprintDecalSet[instanceID] or false, width, length, rotation, p, q, s, t } end end end @@ -371,24 +363,26 @@ local function hashPos(mapx, mapz) -- packs XZ into 1000*x + z Spring.Debug.TraceFullEcho() end - return floor(mapx / areaResolution) * 1000 + floor(mapz/areaResolution) + return floor(mapx / areaResolution) * 1000 + floor(mapz / areaResolution) end local function initAreas() - for x= areaResolution /2, Game.mapSizeX, areaResolution do - for z= areaResolution /2, Game.mapSizeZ, areaResolution do - local gh = spGetGroundHeight(x,z) - areaDecals[hashPos(x,z)] = {instanceIDs = {}, totalarea = 0, x = x, y = gh, z = z, smoothness = 0} + for x = areaResolution / 2, Game.mapSizeX, areaResolution do + for z = areaResolution / 2, Game.mapSizeZ, areaResolution do + local gh = spGetGroundHeight(x, z) + areaDecals[hashPos(x, z)] = { instanceIDs = {}, totalarea = 0, x = x, y = gh, z = z, smoothness = 0 } end end end local function AddDecalToArea(instanceID, posx, posz, width, length) - local hash = hashPos(posx,posz) + local hash = hashPos(posx, posz) local maparea = areaDecals[hash] - if maparea == nil then return end + if maparea == nil then + return + end local area = width * length - maparea.instanceIDs[instanceID] = area + maparea.instanceIDs[instanceID] = area maparea.totalarea = maparea.totalarea + area decalToArea[instanceID] = hash end @@ -398,7 +392,7 @@ local function RemoveDecalFromArea(instanceID) if hashpos then local maparea = areaDecals[hashpos] if maparea and maparea.instanceIDs[instanceID] then - maparea.totalarea = math.max(0,maparea.totalarea - maparea.instanceIDs[instanceID]) + maparea.totalarea = math.max(0, maparea.totalarea - maparea.instanceIDs[instanceID]) maparea.instanceIDs[instanceID] = nil end decalToArea[instanceID] = nil @@ -406,12 +400,12 @@ local function RemoveDecalFromArea(instanceID) end local function CheckDecalAreaSaturation(posx, posz, width, length) - local hash = hashPos(posx,posz) + local hash = hashPos(posx, posz) --spEcho(hash,posx,posz, next(areaDecals)) if not hash then return false else - local areaD = areaDecals[hashPos(posx,posz)] + local areaD = areaDecals[hashPos(posx, posz)] if not areaD then return false else @@ -427,10 +421,12 @@ function widget:Update() -- this is pointlessly expensive! if decalUseGeometryShader then decalShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or decalShader end - decalLargeShader = LuaShader.CheckShaderUpdates(shaderLargeSourceCache) or decalLargeShader + decalLargeShader = LuaShader.CheckShaderUpdates(shaderLargeSourceCache) or decalLargeShader end - if true then return end + if true then + return + end -- run over the map, one area per frame, and calc its smoothness updatePositionX = updatePositionX + areaResolution if updatePositionX >= Game.mapSizeX then @@ -446,14 +442,14 @@ function widget:Update() -- this is pointlessly expensive! end local hash = hashPos(updatePositionX, updatePositionZ) --spEcho("Updateing smoothness at",updatePositionX, updatePositionZ) - local step = areaResolution/ 16 + local step = areaResolution / 16 local totalsmoothness = 0 local prevHeight = spGetGroundHeight(updatePositionX, updatePositionZ) local prevX = prevHeight for x = updatePositionX, updatePositionX + areaResolution, step do for z = updatePositionZ, updatePositionZ + areaResolution, step do - local h = spGetGroundHeight(x,z) - totalsmoothness = totalsmoothness + abs(h-prevHeight) + local h = spGetGroundHeight(x, z) + totalsmoothness = totalsmoothness + abs(h - prevHeight) prevHeight = h end prevX = prevHeight @@ -462,15 +458,15 @@ function widget:Update() -- this is pointlessly expensive! end local function DrawSmoothness() - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) for areaHash, areaInfo in pairs(areaDecals) do --spEcho(areaHash, areaInfo.x, areaInfo.y, areaInfo.z) if Spring.IsSphereInView(areaInfo.x, areaInfo.y, areaInfo.z, 128) then gl.PushMatrix() - local text = string.format("Smoothness = %d",areaInfo.smoothness) + local text = string.format("Smoothness = %d", areaInfo.smoothness) local w = gl.GetTextWidth(text) * 16.0 gl.Translate(areaInfo.x - w, areaInfo.y + 64, areaInfo.z) - gl.Text( text,0,0,16,'n') + gl.Text(text, 0, 0, 16, "n") gl.PopMatrix() end end @@ -480,12 +476,7 @@ end local dCT = {} -- decalCacheTable - -local function AddDecal(decaltexturename, posx, posz, rotation, - width, length, - heatstart, heatdecay, alphastart, alphadecay, - maxalpha, - bwfactor, glowsustain, glowadd, fadeintime, spawnframe) +local function AddDecal(decaltexturename, posx, posz, rotation, width, length, heatstart, heatdecay, alphastart, alphadecay, maxalpha, bwfactor, glowsustain, glowadd, fadeintime, spawnframe) -- Documentation -- decaltexturename, full path to the decal texture name, it must have been added to the atlasses, e.g. 'bitmaps/scars/scar1.bmp' -- posx, posz, world pos to place center of decal @@ -504,7 +495,7 @@ local function AddDecal(decaltexturename, posx, posz, rotation, heatstart = heatstart or 0 heatdecay = heatdecay or 1 alphastart = alphastart or 1 - alphadecay = (alphadecay or 0) / (lifeTimeMult*lifeTimeMultMult) + alphadecay = (alphadecay or 0) / (lifeTimeMult * lifeTimeMultMult) bwfactor = bwfactor or 1 -- default force to black and white glowsustain = glowsustain or 1 -- how many frames to keep max heat for @@ -517,19 +508,18 @@ local function AddDecal(decaltexturename, posx, posz, rotation, end return nil else - end spawnframe = spawnframe or spGetGameFrame() --spEcho(decaltexturename, atlassedImages[decaltexturename], atlasColorAlpha) - local p,q,s,t = 0,1,0,1 + local p, q, s, t = 0, 1, 0, 1 --spEcho(decaltexturename) --used for displaying which decal texture is spawned if atlas[decaltexturename] == nil then - spEcho("Tried to spawn a decal gl4 with a texture not present in the atlas:",decaltexturename) + spEcho("Tried to spawn a decal gl4 with a texture not present in the atlas:", decaltexturename) else local uvs = atlas[decaltexturename] - p,q,s,t = uvs[1], uvs[2], uvs[3], uvs[4] + p, q, s, t = uvs[1], uvs[2], uvs[3], uvs[4] end local posy = Spring.GetGroundHeight(posx, posz) @@ -537,33 +527,34 @@ local function AddDecal(decaltexturename, posx, posz, rotation, -- match the vertex shader on lifetime: -- float currentAlpha = min(1.0, (lifetonow / FADEINTIME)) * alphastart - lifetonow* alphadecay; -- currentAlpha = min(currentAlpha, lengthwidthrotation.w); - local lifetime = mathFloor(alphastart/alphadecay) + local lifetime = mathFloor(alphastart / alphadecay) decalIndex = decalIndex + 1 local targetVBO = decalVBO - if mathMin(width,length) > extralargesizeThreshold then + if mathMin(width, length) > extralargesizeThreshold then targetVBO = decalExtraLargeVBO - elseif mathMin(width,length) > largesizethreshold then + elseif mathMin(width, length) > largesizethreshold then targetVBO = decalLargeVBO end - dCT[1], dCT[2], dCT[3], dCT[4] = length, width, rotation, maxalpha -- lengthwidthrotation maxalpha - dCT[5], dCT[6], dCT[7], dCT[8] = p,q,s,t -- These are our default UV atlas tranformations, note how X axis is flipped for atlas - dCT[9], dCT[10], dCT[11], dCT[12] = alphastart, alphadecay, heatstart, heatdecay -- alphastart_alphadecay_heatstart_heatdecay + dCT[1], dCT[2], dCT[3], dCT[4] = length, width, rotation, maxalpha -- lengthwidthrotation maxalpha + dCT[5], dCT[6], dCT[7], dCT[8] = p, q, s, t -- These are our default UV atlas tranformations, note how X axis is flipped for atlas + dCT[9], dCT[10], dCT[11], dCT[12] = alphastart, alphadecay, heatstart, heatdecay -- alphastart_alphadecay_heatstart_heatdecay dCT[13], dCT[14], dCT[15], dCT[16] = posx, posy, posz, spawnframe dCT[17], dCT[18], dCT[19], dCT[20] = bwfactor, glowsustain, glowadd, fadeintime -- params pushElementInstance( targetVBO, -- push into this Instance VBO Table - dCT,-- decalCacheTable + dCT, -- decalCacheTable decalIndex, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element - false) -- noupload, dont use unless you know what you want to batch push/pop + false + ) -- noupload, dont use unless you know what you want to batch push/pop local deathtime = spawnframe + lifetime if decalRemoveQueue[deathtime] == nil then - decalRemoveQueue[deathtime] = {decalIndex} + decalRemoveQueue[deathtime] = { decalIndex } else - decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1 ] = decalIndex + decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1] = decalIndex end AddDecalToArea(decalIndex, posx, posz, width, length) @@ -571,7 +562,6 @@ local function AddDecal(decaltexturename, posx, posz, rotation, return decalIndex, lifetime end - local skipdraw = false local firstRun = true @@ -583,10 +573,11 @@ local function DrawDecals() glTexture(0, false) end - if skipdraw then return end + if skipdraw then + return + end --local alt, ctrl = Spring.GetModKeyState() if decalVBO.usedElements > 0 or decalLargeVBO.usedElements > 0 or decalExtraLargeVBO.usedElements > 0 then - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- the default mode local disticon = 27 * Spring.GetConfigInt("UnitIconDist", 200) -- iconLength = unitIconDist * unitIconDist * 750.0f; --spEcho(decalVBO.usedElements,decalLargeVBO.usedElements) @@ -597,23 +588,24 @@ local function DrawDecals() end glDepthTest(GL_LEQUAL) gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove - glTexture(0, '$heightmap') - glTexture(1, '$minimap') - glTexture(2, '$info') - glTexture(3, '$shadow') - glTexture(4, '$normals') + glTexture(0, "$heightmap") + glTexture(1, "$minimap") + glTexture(2, "$info") + glTexture(3, "$shadow") + glTexture(4, "$normals") glTexture(5, "luaui/images/decals_gl4/decalsgl4_atlas_diffuse.dds") glTexture(6, "luaui/images/decals_gl4/decalsgl4_atlas_normal.dds") - if shaderConfig.PARALLAX == 1 then glTexture(7, atlasHeights) end + if shaderConfig.PARALLAX == 1 then + glTexture(7, atlasHeights) + end --glTexture(9, '$map_gbuffer_zvaltex') --glTexture(10, '$map_gbuffer_difftex') --glTexture(11, '$map_gbuffer_normtex') - - if decalVBO.usedElements > 0 then + if decalVBO.usedElements > 0 then if decalUseGeometryShader then decalShader:Activate() - decalShader:SetUniform("fadeDistance",disticon * 1000) + decalShader:SetUniform("fadeDistance", disticon * 1000) decalVBO.VAO:DrawArrays(GL.POINTS, decalVBO.usedElements) decalShader:Deactivate() else @@ -637,7 +629,9 @@ local function DrawDecals() end -- Restore the GL state - for i = 0, 8 do glTexture(i, false) end + for i = 0, 8 do + glTexture(i, false) + end glCulling(false) -- This is the correct default mode! gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- the default mode end @@ -645,12 +639,8 @@ end function widget:TextCommand(command) if string.find(command, "decalsgl4stats", nil, true) then - local tricount = 4*4*2 * decalVBO.usedElements + resolution*resolution*2*decalLargeVBO.usedElements + 4*4*resolution*resolution*2*decalExtraLargeVBO.usedElements - spEcho(string.format("Small decal = %d, Medium decal = %d, Large decal = %d, tris = %d", - decalVBO.usedElements, - decalLargeVBO.usedElements, - decalExtraLargeVBO.usedElements, - tricount)) + local tricount = 4 * 4 * 2 * decalVBO.usedElements + resolution * resolution * 2 * decalLargeVBO.usedElements + 4 * 4 * resolution * resolution * 2 * decalExtraLargeVBO.usedElements + spEcho(string.format("Small decal = %d, Medium decal = %d, Large decal = %d, tris = %d", decalVBO.usedElements, decalLargeVBO.usedElements, decalExtraLargeVBO.usedElements, tricount)) return true end if string.find(command, "decalsgl4skipdraw", nil, true) then @@ -671,7 +661,6 @@ else end end - local function RemoveDecal(instanceID) RemoveDecalFromArea(instanceID) footprintDecalSet[instanceID] = nil @@ -688,7 +677,7 @@ local numDecalsToRemove = 0 function widget:GameFrame(n) if decalRemoveQueue[n] then - for i=1, #decalRemoveQueue[n] do + for i = 1, #decalRemoveQueue[n] do local decalID = decalRemoveQueue[n][i] decalRemoveList[decalID] = true footprintDecalSet[decalID] = nil @@ -699,10 +688,12 @@ function widget:GameFrame(n) end if n % 67 == 0 then -- About every 2 seconds - local totalDecalCount = decalVBO.usedElements + decalLargeVBO.usedElements + decalExtraLargeVBO.usedElements + local totalDecalCount = decalVBO.usedElements + decalLargeVBO.usedElements + decalExtraLargeVBO.usedElements -- Perform a compacting step if about half of our decals should be removed - if totalDecalCount == 0 or (numDecalsToRemove/totalDecalCount < 0.5) then return end + if totalDecalCount == 0 or (numDecalsToRemove / totalDecalCount < 0.5) then + return + end numDecalsToRemove = 0 local removed = 0 @@ -712,27 +703,34 @@ function widget:GameFrame(n) decalRemoveList = {} if autoupdate and removed > 0 then - spEcho("Removed",removed,"decals from decal instance tables: s=",decalVBO.usedElements,' l=', decalLargeVBO.usedElements,'xl=', decalExtraLargeVBO.usedElements, "Tot=", totalDecalCount, "Rem=",numDecalsToRemove) + spEcho("Removed", removed, "decals from decal instance tables: s=", decalVBO.usedElements, " l=", decalLargeVBO.usedElements, "xl=", decalExtraLargeVBO.usedElements, "Tot=", totalDecalCount, "Rem=", numDecalsToRemove) + end + if decalVBO.dirty then + uploadAllElements(decalVBO) + end + if decalLargeVBO.dirty then + uploadAllElements(decalLargeVBO) + end + if decalExtraLargeVBO.dirty then + uploadAllElements(decalExtraLargeVBO) end - if decalVBO.dirty then uploadAllElements( decalVBO) end - if decalLargeVBO.dirty then uploadAllElements( decalLargeVBO) end - if decalExtraLargeVBO.dirty then uploadAllElements( decalExtraLargeVBO) end - end end -local function randtablechoice (t) +local function randtablechoice(t) local i = 0 - for k,v in pairs(t) do + for k, v in pairs(t) do if type(v) == "table" then - i = i+1 + i = i + 1 end end - local randi = mathFloor(mathRandom()*i) + local randi = mathFloor(mathRandom() * i) local j = 0 - for k,v in pairs(t) do - if type(v) == "table" and j > randi then return k,v end - j = j+1 + for k, v in pairs(t) do + if type(v) == "table" and j > randi then + return k, v + end + j = j + 1 end return next(t) end @@ -754,7 +752,7 @@ local buildingExplosionPositionVariation = { local isWaterVoid = false do - local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") if success and mapinfo then isWaterVoid = mapinfo.voidwater end @@ -764,32 +762,47 @@ local globalDamageMult = Spring.GetModOptions().multiplier_weapondamage or 1 local damageCoefficient = (1 / globalDamageMult + 0.25 * globalDamageMult - 0.25) -- for sane values with high modifiers local weaponConfig = {} -for weaponDefID=1, #WeaponDefs do +for weaponDefID = 1, #WeaponDefs do local weaponDef = WeaponDefs[weaponDefID] local nodecal = (weaponDef.customParams and weaponDef.customParams.nodecal) - if (not nodecal) and (not string.find(weaponDef.cegTag, 'aa')) then - --[[ 1 ]] local textures = { "t_groundcrack_17_a.tga", "t_groundcrack_21_a.tga", "t_groundcrack_10_a.tga" } - --[[ 2 ]] local radius = weaponDef.damageAreaOfEffect * 1.4 - --[[ 3 ]] local radiusVariation = 0.3 -- 0.3 -> 30% larger or smaller radius - --[[ 4 ]] local heatstart = nil - --[[ 5 ]] local heatdecay = nil - --[[ 6 ]] local alpha = nil - --[[ 7 ]] local alphadecay = nil - --[[ 8 ]] local bwfactor = 0.5 -- the mix factor of the diffuse texture to black and whiteness, 0 is original color, 1 is black and white - --[[ 9 ]] local glowsustain = nil - --[[ 10 ]] local glowadd = nil - --[[ 11 ]] local radiusToHeatDecay = weaponDef.damageAreaOfEffect / 2250 -- scaling value as a fallback for heatdecay - --[[ 12 ]] local damage = weaponDef.damages[Game.armorTypes.default] * damageCoefficient - --[[ 13 ]] local fadeintime = nil - --[[ 14 ]] local positionVariation = 0 - --[[ 15 ]] local waterDepthRatio = isWaterVoid and 1 or 2.5 -- increased extinction in water height (vs air height) + if (not nodecal) and (not string.find(weaponDef.cegTag, "aa")) then + --[[ 1 ]] + local textures = { "t_groundcrack_17_a.tga", "t_groundcrack_21_a.tga", "t_groundcrack_10_a.tga" } + --[[ 2 ]] + local radius = weaponDef.damageAreaOfEffect * 1.4 + --[[ 3 ]] + local radiusVariation = 0.3 -- 0.3 -> 30% larger or smaller radius + --[[ 4 ]] + local heatstart = nil + --[[ 5 ]] + local heatdecay = nil + --[[ 6 ]] + local alpha = nil + --[[ 7 ]] + local alphadecay = nil + --[[ 8 ]] + local bwfactor = 0.5 -- the mix factor of the diffuse texture to black and whiteness, 0 is original color, 1 is black and white + --[[ 9 ]] + local glowsustain = nil + --[[ 10 ]] + local glowadd = nil + --[[ 11 ]] + local radiusToHeatDecay = weaponDef.damageAreaOfEffect / 2250 -- scaling value as a fallback for heatdecay + --[[ 12 ]] + local damage = weaponDef.damages[Game.armorTypes.default] * damageCoefficient + --[[ 13 ]] + local fadeintime = nil + --[[ 14 ]] + local positionVariation = 0 + --[[ 15 ]] + local waterDepthRatio = isWaterVoid and 1 or 2.5 -- increased extinction in water height (vs air height) if weaponDef.paralyzer then textures = { "t_groundcrack_17_a.tga", "t_groundcrack_10_a.tga", "t_groundcrack_10_a.tga" } heatstart = 0 glowadd = 0 - if weaponDef.type == 'AircraftBomb' then - textures = {"t_groundcrack_16_a.tga" } + if weaponDef.type == "AircraftBomb" then + textures = { "t_groundcrack_16_a.tga" } alpha = 0.44 alphadecay = 0.00015 radius = radius * 0.75 @@ -799,9 +812,8 @@ for weaponDefID=1, #WeaponDefs do --glowsustain = 35 glowadd = 4 end - - elseif weaponDef.type == 'Cannon' then - if string.find(weaponDef.name, 'old_armsnipe_weapon') then + elseif weaponDef.type == "Cannon" then + if string.find(weaponDef.name, "old_armsnipe_weapon") then textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga" } radius = 50 heatstart = 6000 @@ -812,16 +824,14 @@ for weaponDefID=1, #WeaponDefs do if weaponDef.highTrajectory == 1 then textures = { "t_groundcrack_21_a.tga", "t_groundcrack_22_a.tga", "t_groundcrack_10_a.tga" } alphadecay = 0.0024 - - elseif string.find(weaponDef.name, 'lrpc') then + elseif string.find(weaponDef.name, "lrpc") then textures = { "t_groundcrack_09_a.tga", "t_groundcrack_05_a.tga" } radius = radius * 1.3 radiusVariation = 0.7 heatstart = 6000 heatdecay = 0.78 glowadd = 2 - - elseif string.find(weaponDef.name, 'tremor') then + elseif string.find(weaponDef.name, "tremor") then textures = { "t_groundcrack_17_a.tga", "t_groundcrack_21_a.tga", "t_groundcrack_10_a.tga", "t_groundcrack_09_a.tga" } radius = radius * 0.96 radiusVariation = 0.85 @@ -829,8 +839,7 @@ for weaponDefID=1, #WeaponDefs do heatstart = 6000 heatdecay = 1.5 glowadd = 2 - - elseif string.find(weaponDef.name, 'crawl_blastsmlscavboss') then + elseif string.find(weaponDef.name, "crawl_blastsmlscavboss") then textures = { "t_groundcrack_21_a.tga" } radius = radius * 1.7 --radiusVariation = 0.7 @@ -838,8 +847,7 @@ for weaponDefID=1, #WeaponDefs do heatdecay = 0.78 glowadd = 2 end - - elseif weaponDef.type == 'Flame' then + elseif weaponDef.type == "Flame" then -- FLAME does not work - probably does not apply a decal on engine level -- textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga" } -- if string.find(weaponDef.name, 'flamethrower') then @@ -850,8 +858,7 @@ for weaponDefID=1, #WeaponDefs do -- alphadecay = 0.0024 -- glowadd = 2 -- end - - elseif weaponDef.type == 'LightningCannon' then + elseif weaponDef.type == "LightningCannon" then heatstart = 4000 heatdecay = 1.0 glowsustain = 10 @@ -860,15 +867,11 @@ for weaponDefID=1, #WeaponDefs do fadeintime = 15 bwfactor = 0.8 waterDepthRatio = 5 - - elseif weaponDef.type == 'BeamLaser' then - - elseif weaponDef.type == 'LaserCannon' then - - elseif weaponDef.type == 'StarburstLauncher' then - - elseif weaponDef.type == 'AircraftBomb' then - if string.find(weaponDef.name, '.advbomb') then + elseif weaponDef.type == "BeamLaser" then + elseif weaponDef.type == "LaserCannon" then + elseif weaponDef.type == "StarburstLauncher" then + elseif weaponDef.type == "AircraftBomb" then + if string.find(weaponDef.name, ".advbomb") then alpha = 1.1 radius = radius * 1.5 heatstart = 5500 @@ -887,16 +890,15 @@ for weaponDefID=1, #WeaponDefs do glowadd = 1.2 end bwfactor = 0.01 - - elseif weaponDef.type == 'DGun' then + elseif weaponDef.type == "DGun" then textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga" } - if string.find(weaponDef.name, 'juggernaut_fire') then + if string.find(weaponDef.name, "juggernaut_fire") then radius = radius * 2.4 heatdecay = 0.65 glowsustain = 40 glowadd = 1.3 bwfactor = 0.1 - elseif string.find(weaponDef.name, 'disintegratorxl') then + elseif string.find(weaponDef.name, "disintegratorxl") then textures = { "t_groundcrack_21_a.tga", "t_groundcrack_16_a.tga" } alphadecay = 0.004 radius = radius * 1.7 --* (mathRandom() * 20 + 0.2) @@ -923,7 +925,7 @@ for weaponDefID=1, #WeaponDefs do bwfactor = 0.1 end - if string.find(weaponDef.name, 'juno') then + if string.find(weaponDef.name, "juno") then textures = { "t_groundcrack_10_a.tga" } radius = 700 alpha = 0.4 @@ -932,7 +934,6 @@ for weaponDefID=1, #WeaponDefs do alphadecay = 0.00005 --glowadd = 2.5 bwfactor = 0.05 - elseif weaponDef.customParams.area_onhit_resistance == "_RAPTORACID_" then textures = { "t_groundcrack_26_a.tga" } alpha = 6 @@ -940,18 +941,17 @@ for weaponDefID=1, #WeaponDefs do fadeintime = 200 bwfactor = 0.17 waterDepthRatio = 5 - if string.find(weaponDef.name, 'death_acid') then - radius = (radius * 5)-- * (mathRandom() * 0.25 + 0.75) + if string.find(weaponDef.name, "death_acid") then + radius = (radius * 5) -- * (mathRandom() * 0.25 + 0.75) heatstart = 550 heatdecay = 0.1 glowadd = 2.5 else textures = { "t_groundcrack_26_a.tga" } - radius = (radius * 5)-- * (mathRandom() * 0.15 + 0.85) + radius = (radius * 5) -- * (mathRandom() * 0.15 + 0.85) heatstart = 500 heatdecay = 10 end - elseif weaponDef.customParams.area_onhit_resistance == "fire" then textures = { "t_groundcrack_16_a.tga" } radius = radius * 1.6 @@ -962,20 +962,15 @@ for weaponDefID=1, #WeaponDefs do glowsustain = 225 glowadd = 4.5 waterDepthRatio = 5 - elseif weaponDef.customParams.area_onhit_ceg then waterDepthRatio = 5 - - elseif string.find(weaponDef.name, 'vipersabot') then -- viper has very tiny AoE + elseif string.find(weaponDef.name, "vipersabot") then -- viper has very tiny AoE radius = (radius * 4) - - elseif string.find(weaponDef.name, 'armmav_weapon') then -- armmav has very tiny AoE + elseif string.find(weaponDef.name, "armmav_weapon") then -- armmav has very tiny AoE radius = (radius * 6) - - elseif string.find(weaponDef.name, 'corkorg_fire') then -- Juggernaut has lots of decals on shotgun + elseif string.find(weaponDef.name, "corkorg_fire") then -- Juggernaut has lots of decals on shotgun alphadecay = 0.004 - - elseif string.find(weaponDef.name, 'exp_heavyrocket') then -- Catapult has lower AoE but big explo + elseif string.find(weaponDef.name, "exp_heavyrocket") then -- Catapult has lower AoE but big explo textures = { "t_groundcrack_17_a.tga", "t_groundcrack_21_a.tga", "t_groundcrack_10_a.tga", "t_groundcrack_09_a.tga" } radius = radius * 2.1 radiusVariation = 0.8 @@ -985,7 +980,7 @@ for weaponDefID=1, #WeaponDefs do glowadd = 2 --armliche - elseif string.find(weaponDef.name, 'arm_pidr') then + elseif string.find(weaponDef.name, "arm_pidr") then textures = { "t_groundcrack_21_a.tga" } radius = radius * 1.8 heatstart = 5500 @@ -993,10 +988,9 @@ for weaponDefID=1, #WeaponDefs do glowsustain = 100 glowadd = 1.5 bwfactor = 0.1 - - elseif string.find(weaponDef.name, 'flamebug') then + elseif string.find(weaponDef.name, "flamebug") then textures = { "t_groundcrack_23_a.tga", "t_groundcrack_24_a.tga", "t_groundcrack_25_a.tga", "t_groundcrack_27_a.tga" } - radius = (radius * 5)-- * (mathRandom() * 0.7 + 0.52) + radius = (radius * 5) -- * (mathRandom() * 0.7 + 0.52) alpha = 15 heatstart = 500 heatdecay = 0.12 @@ -1005,13 +999,12 @@ for weaponDefID=1, #WeaponDefs do glowadd = 2.5 fadeintime = 150 bwfactor = 0.6 - - elseif string.find(weaponDef.name, 'bug') then + elseif string.find(weaponDef.name, "bug") then textures = { "t_groundcrack_23_a.tga", "t_groundcrack_24_a.tga", "t_groundcrack_25_a.tga", "t_groundcrack_27_a.tga" } - if string.find(weaponDef.name, 'flamebug') then + if string.find(weaponDef.name, "flamebug") then radius = (radius * 5) else - radius = (radius * 10)-- * (mathRandom() * 0.7 + 0.52) + radius = (radius * 10) -- * (mathRandom() * 0.7 + 0.52) alpha = 15 heatstart = 500 heatdecay = 0.12 @@ -1021,10 +1014,9 @@ for weaponDefID=1, #WeaponDefs do fadeintime = 75 bwfactor = 0.6 end - - elseif string.find(weaponDef.name, 'bloodyeggs') then + elseif string.find(weaponDef.name, "bloodyeggs") then textures = { "t_groundcrack_23_a.tga" } - radius = (radius * 1.5)-- * (mathRandom() * 1.2 + 0.25) + radius = (radius * 1.5) -- * (mathRandom() * 1.2 + 0.25) alpha = 10 heatstart = 490 heatdecay = 0.1 @@ -1032,28 +1024,25 @@ for weaponDefID=1, #WeaponDefs do glowadd = 2.5 fadeintime = 75 bwfactor = 0.6 - - elseif string.find(weaponDef.name, 'dodo') then + elseif string.find(weaponDef.name, "dodo") then textures = { "t_groundcrack_23_a.tga", "t_groundcrack_24_a.tga" } - radius = (radius * 1.2)-- * (mathRandom() * 0.15 + 0.85) + radius = (radius * 1.2) -- * (mathRandom() * 0.15 + 0.85) alpha = 10 heatstart = 490 heatdecay = 0.1 alphadecay = 0.002 glowadd = 2.5 bwfactor = 0.7 - - elseif string.find(weaponDef.name, 'armagmheat') then + elseif string.find(weaponDef.name, "armagmheat") then textures = { "t_groundcrack_10_a.tga" } - radius = (radius * 1.6)-- * (mathRandom() * 0.15 + 0.85) + radius = (radius * 1.6) -- * (mathRandom() * 0.15 + 0.85) alpha = 1 heatstart = 6500 heatdecay = 0.5 alphadecay = 0.002 glowadd = 2.5 --bwfactor = 0.15 - - elseif string.find(weaponDef.name, 'corkorg_laser') then + elseif string.find(weaponDef.name, "corkorg_laser") then textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga", "t_groundcrack_10_a.tga" } alphadecay = 0.004 radius = radius * 1.1 --* (mathRandom() * 20 + 0.2) @@ -1063,8 +1052,7 @@ for weaponDefID=1, #WeaponDefs do glowsustain = 45 glowadd = 1.8 bwfactor = 0.1 - - elseif string.find(weaponDef.name, 'pineappleofdoom') or string.find(weaponDef.name, 'heatraylarge') or string.find(weaponDef.name, 'skybeam') or string.find(weaponDef.name, 'heat_ray') then --legbastion leginc legphoenix legaheattank + elseif string.find(weaponDef.name, "pineappleofdoom") or string.find(weaponDef.name, "heatraylarge") or string.find(weaponDef.name, "skybeam") or string.find(weaponDef.name, "heat_ray") then --legbastion leginc legphoenix legaheattank textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga", "t_groundcrack_05_a.tga" } --textures = { "t_groundcrack_16_a.tga", "t_groundcrack_17_a.tga", "t_groundcrack_10_a.tga" } alphadecay = 0.004 @@ -1075,8 +1063,7 @@ for weaponDefID=1, #WeaponDefs do glowsustain = 20 glowadd = 2.8 bwfactor = 0.1 - - elseif string.find(weaponDef.name, 'starfire') then + elseif string.find(weaponDef.name, "starfire") then textures = { "t_groundcrack_16_a.tga", "t_groundcrack_09_a.tga", "t_groundcrack_10_a.tga" } alphadecay = 0.003 radius = radius * 1.2 --* (mathRandom() * 20 + 0.2) @@ -1086,8 +1073,7 @@ for weaponDefID=1, #WeaponDefs do glowsustain = 0 glowadd = 2.5 bwfactor = 0.3 - - elseif string.find(weaponDef.name, 'footstep') then + elseif string.find(weaponDef.name, "footstep") then --textures = { "f_corkorg_a.tga" } textures = { "t_groundcrack_10_a.tga" } --radius = 70 @@ -1099,28 +1085,42 @@ for weaponDefID=1, #WeaponDefs do alphadecay = 0.00055 --0.00055 --glowadd = 2.5 bwfactor = 0.4 - end if buildingExplosionPositionVariation[weaponDef.name] then positionVariation = buildingExplosionPositionVariation[weaponDef.name] end weaponConfig[weaponDefID] = { - --[[ 1 ]] textures, - --[[ 2 ]] radius, - --[[ 3 ]] radiusVariation, - --[[ 4 ]] heatstart, - --[[ 5 ]] heatdecay, - --[[ 6 ]] alpha, - --[[ 7 ]] alphadecay, - --[[ 8 ]] bwfactor, - --[[ 9 ]] glowsustain, - --[[ 10 ]] glowadd, - --[[ 11 ]] radiusToHeatDecay, - --[[ 12 ]] damage, - --[[ 13 ]] fadeintime, - --[[ 14 ]] positionVariation, - --[[ 15 ]] waterDepthRatio, + --[[ 1 ]] + textures, + --[[ 2 ]] + radius, + --[[ 3 ]] + radiusVariation, + --[[ 4 ]] + heatstart, + --[[ 5 ]] + heatdecay, + --[[ 6 ]] + alpha, + --[[ 7 ]] + alphadecay, + --[[ 8 ]] + bwfactor, + --[[ 9 ]] + glowsustain, + --[[ 10 ]] + glowadd, + --[[ 11 ]] + radiusToHeatDecay, + --[[ 12 ]] + damage, + --[[ 13 ]] + fadeintime, + --[[ 14 ]] + positionVariation, + --[[ 15 ]] + waterDepthRatio, } end end @@ -1133,14 +1133,14 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) local random = mathRandom - local radius = params[2] * (1 + (random()-0.5) * params[3]) + local radius = params[2] * (1 + (random() - 0.5) * params[3]) local elevation = spGetGroundHeight(px, pz) local exploHeight = py - (elevation >= 0 and elevation or elevation * params[15]) if exploHeight >= radius then return end - local texture = params[1][ random(1,#params[1]) ] + local texture = params[1][random(1, #params[1])] -- reduce severity when explosion is above ground local heightMult = 1 - (exploHeight / radius) @@ -1160,20 +1160,19 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) local fadeintime = params[13] if params[14] > 0 then --positionVariation - px = px + (random() - 0.5 ) * radius * 0.2 - pz = pz + (random() - 0.5 ) * radius * 0.2 + px = px + (random() - 0.5) * radius * 0.2 + pz = pz + (random() - 0.5) * radius * 0.2 end - AddDecal( - groundscarsPath..texture, + groundscarsPath .. texture, px, --posx pz, --posz random() * 6.28, -- rotation radius, -- width radius, -- height heatstart * heightMult, -- heatstart - heatdecay * (1+(1-heightMult)), -- heatdecay + heatdecay * (1 + (1 - heightMult)), -- heatdecay (random() * 0.38 + 0.72) * alpha, -- alphastart alphadecay, -- alphadecay random() * 0.2 + 0.8, -- maxalpha @@ -1185,9 +1184,9 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) end local UnitScriptDecalsNames = { - ['corkorg'] = { + ["corkorg"] = { [1] = { - texture = footprintsPath..'f_corkorg_a.png', + texture = footprintsPath .. "f_corkorg_a.png", offsetx = 2, --offset from what the UnitScriptDecal returns offsetz = -25, -- offsetrot = 0, -- in radians @@ -1202,12 +1201,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - } }, + }, - ['armfboy'] = { + ["armfboy"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armfboy_a.png', + texture = footprintsPath .. "f_armfboy_a.png", offsetx = -1, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0, -- in radians @@ -1222,9 +1221,9 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, + }, [2] = { -- RFOOT - texture = footprintsPath..'f_armfboy_a.png', + texture = footprintsPath .. "f_armfboy_a.png", offsetx = 1, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0, -- in radians @@ -1239,11 +1238,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - } }, - ['armwar'] = { + }, + ["armwar"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armwar_a.png', + texture = footprintsPath .. "f_armwar_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.2, -- in radians @@ -1258,9 +1257,9 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, + }, [2] = { -- RFOOT - texture = footprintsPath..'f_armwar_a.png', + texture = footprintsPath .. "f_armwar_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = -0.2, -- in radians @@ -1275,12 +1274,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armck'] = { + ["armck"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armck_a.png', + texture = footprintsPath .. "f_armck_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 7, -- offsetrot = 0.0, -- in radians @@ -1295,12 +1294,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armrock'] = { + ["armrock"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armrock_a.png', + texture = footprintsPath .. "f_armrock_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = -3, -- offsetrot = 0.0, -- in radians @@ -1315,11 +1314,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, - ['armham'] = { + }, + ["armham"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armham_a.png', + texture = footprintsPath .. "f_armham_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = -1, -- offsetrot = 0.0, -- in radians @@ -1334,12 +1333,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armack'] = { + ["armack"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armack_a.png', + texture = footprintsPath .. "f_armack_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 1, -- offsetrot = 0.0, -- in radians @@ -1354,12 +1353,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armzeus'] = { + ["armzeus"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armzeus_a.png', + texture = footprintsPath .. "f_armzeus_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1374,12 +1373,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armmav'] = { + ["armmav"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armmav_a.png', + texture = footprintsPath .. "f_armmav_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1394,12 +1393,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armmar'] = { + ["armmar"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armmar_a.png', + texture = footprintsPath .. "f_armmar_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1414,12 +1413,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armraz'] = { + ["armraz"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_armraz_a.png', + texture = footprintsPath .. "f_armraz_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1434,12 +1433,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armvang'] = { + ["armvang"] = { [1] = { -- FOOT - texture = footprintsPath..'f_armvang_a.png', + texture = footprintsPath .. "f_armvang_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.8, -- in radians @@ -1454,10 +1453,10 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, + }, [2] = { -- ankle - texture = footprintsPath..'f_armvang_a.png', + texture = footprintsPath .. "f_armvang_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 3.14, -- in radians @@ -1472,12 +1471,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['armbanth'] = { + ["armbanth"] = { [1] = { - texture = footprintsPath..'f_armbanth_a.png', + texture = footprintsPath .. "f_armbanth_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = -7, -- offsetrot = 0, -- in radians @@ -1492,12 +1491,12 @@ local UnitScriptDecalsNames = { glowsustain = 10, glowadd = 0.0, fadeintime = 5, - } }, + }, - ['corck'] = { + ["corck"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corck_a.png', + texture = footprintsPath .. "f_corck_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1512,12 +1511,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['corstorm'] = { + ["corstorm"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corstorm_a.png', + texture = footprintsPath .. "f_corstorm_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1532,12 +1531,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['corthud'] = { + ["corthud"] = { [1] = { - texture = footprintsPath..'f_corthud_a.png', + texture = footprintsPath .. "f_corthud_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = -2, -- offsetrot = 0, -- in radians @@ -1552,12 +1551,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - } }, + }, - ['corack'] = { + ["corack"] = { [1] = { - texture = footprintsPath..'f_corthud_a.png', + texture = footprintsPath .. "f_corthud_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = -2, -- offsetrot = 0, -- in radians @@ -1572,13 +1571,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - } }, + }, - - ['cormando'] = { + ["cormando"] = { [1] = { --lfoot - texture = footprintsPath..'f_cormando_a.png', + texture = footprintsPath .. "f_cormando_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.15, -- in radians @@ -1593,9 +1591,9 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, + }, [2] = { --rfoot - texture = footprintsPath..'f_cormando_a.png', + texture = footprintsPath .. "f_cormando_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = -0.15, -- in radians @@ -1610,13 +1608,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - } }, + }, - - ['corpyro'] = { + ["corpyro"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corpyro_a.png', + texture = footprintsPath .. "f_corpyro_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1631,11 +1628,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, - ['corhrk'] = { + }, + ["corhrk"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corhrk_a.png', + texture = footprintsPath .. "f_corhrk_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1650,11 +1647,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, - ['corcan'] = { + }, + ["corcan"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corcan_a.png', + texture = footprintsPath .. "f_corcan_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 3.14, -- in radians @@ -1669,9 +1666,9 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, + }, [2] = { -- RFOOT - texture = footprintsPath..'f_corcan_a.png', + texture = footprintsPath .. "f_corcan_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1686,12 +1683,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, + }, - ['corsumo'] = { + ["corsumo"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corsumo_a.png', + texture = footprintsPath .. "f_corsumo_a.png", offsetx = -1, --offset from what the UnitScriptDecal returns offsetz = -1, -- offsetrot = 0.0, -- in radians @@ -1706,11 +1703,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, - ['coramph'] = { + }, + ["coramph"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_coramph_a.png', + texture = footprintsPath .. "f_coramph_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 3, -- offsetrot = 0.0, -- in radians @@ -1725,11 +1722,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, - ['corcat'] = { + }, + ["corcat"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corcat_a.png', + texture = footprintsPath .. "f_corcat_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 3, -- offsetrot = 0.0, -- in radians @@ -1744,11 +1741,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, - ['corshiva'] = { + }, + ["corshiva"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corshiva_a.png', + texture = footprintsPath .. "f_corshiva_a.png", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1763,11 +1760,11 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 2, - }, }, - ['corjugg'] = { + }, + ["corjugg"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_corjugg_a.png', + texture = footprintsPath .. "f_corjugg_a.png", offsetx = -1, --offset from what the UnitScriptDecal returns offsetz = -3, -- offsetrot = 0.0, -- in radians @@ -1782,12 +1779,12 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, + }, - ['raptor_land_swarmer_basic_t1_v1'] = { + ["raptor_land_swarmer_basic_t1_v1"] = { [1] = { -- LFOOT - texture = footprintsPath..'f_raptor_a.tga', + texture = footprintsPath .. "f_raptor_a.tga", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1802,9 +1799,9 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, + }, [2] = { -- RFOOT - texture = footprintsPath..'f_raptor_a.tga', + texture = footprintsPath .. "f_raptor_a.tga", offsetx = 0, --offset from what the UnitScriptDecal returns offsetz = 0, -- offsetrot = 0.0, -- in radians @@ -1820,9 +1817,8 @@ local UnitScriptDecalsNames = { glowsustain = 0.0, glowadd = 0.0, fadeintime = 5, - }, }, - + }, } -- convert unitname -> unitDefID local UnitScriptDecals = {} @@ -1833,7 +1829,6 @@ for unitName, decals in pairs(UnitScriptDecalsNames) do end UnitScriptDecalsNames = nil - --[[ Shit needed in the cob script: @@ -1843,11 +1838,12 @@ lua_UnitScriptDecal(lightIndex, xpos,zpos, heading) } call-script lua_UnitScriptDecal(1, (get PIECE_XZ(lfoot) & 0xffff0000) / 0x00010000 , (get PIECE_XZ(lfoot) & 0x0000ffff), get HEADING(0)); -]]-- +]] +-- local function UnitScriptDecal(unitID, unitDefID, whichDecal, posx, posz, heading) --spEcho("Widgetside UnitScriptDecal", unitID, unitDefID, whichDecal, posx,posz, heading) if Spring.ValidUnitID(unitID) and Spring.GetUnitIsDead(unitID) == false and UnitScriptDecals[unitDefID] and UnitScriptDecals[unitDefID][whichDecal] then - local decalTable = UnitScriptDecals[unitDefID][whichDecal] + local decalTable = UnitScriptDecals[unitDefID][whichDecal] -- So order of transformations is, get heading, rotate that into world space , heading 0 is +Z direction -- Then place at worldpos @@ -1889,12 +1885,12 @@ local function UnitScriptDecal(unitID, unitDefID, whichDecal, posx, posz, headin decalCache[14] = Spring.GetGroundHeight(posx, posz) decalCache[15] = worldposz - decalCache[10] = decalTable.alphadecay / (lifeTimeMult*lifeTimeMultMult) + decalCache[10] = decalTable.alphadecay / (lifeTimeMult * lifeTimeMultMult) local spawnframe = spGetGameFrame() decalCache[16] = spawnframe - local lifetime = mathFloor(decalTable.alphastart/decalCache[10]) + local lifetime = mathFloor(decalTable.alphastart / decalCache[10]) decalIndex = decalIndex + 1 --spEcho(decalIndex) pushElementInstance( @@ -1902,12 +1898,13 @@ local function UnitScriptDecal(unitID, unitDefID, whichDecal, posx, posz, headin decalCache, -- params decalIndex, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element - false) -- noupload, dont use unless you know what you want to batch push/pop + false + ) -- noupload, dont use unless you know what you want to batch push/pop local deathtime = spawnframe + lifetime if decalRemoveQueue[deathtime] == nil then - decalRemoveQueue[deathtime] = {decalIndex} + decalRemoveQueue[deathtime] = { decalIndex } else - decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1 ] = decalIndex + decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1] = decalIndex end AddDecalToArea(decalIndex, worldposx, worldposz, decalTable.width, decalTable.height) @@ -1917,7 +1914,7 @@ local function UnitScriptDecal(unitID, unitDefID, whichDecal, posx, posz, headin end end -local pendingRestore = nil -- Holds saved decal data between SetConfigData and Initialize +local pendingRestore = nil -- Holds saved decal data between SetConfigData and Initialize local gameOver = false local savedDecalsFormatVersion = 2 @@ -1932,12 +1929,7 @@ local function PackSavedDecals(savedDecals) for i = 1, #savedDecals do local entry = savedDecals[i] if entry and #entry == savedDecalFieldCount then - packed[#packed + 1] = stringFormat( - "%d,%d,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.6g,%d,%d,%d", - entry[1], entry[2], entry[3], entry[4], - entry[5], entry[6], entry[7], entry[8], - entry[9], entry[10], entry[11], entry[12], entry[13] - ) + packed[#packed + 1] = stringFormat("%d,%d,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.6g,%d,%d,%d", entry[1], entry[2], entry[3], entry[4], entry[5], entry[6], entry[7], entry[8], entry[9], entry[10], entry[11], entry[12], entry[13]) end end @@ -1987,10 +1979,10 @@ function widget:Initialize() initAreas() if autoupdate then math.randomseed(1) - for i= 1, 100 do + for i = 1, 100 do local w = mathRandom() * 15 + 7 w = w * w - local texture = randtablechoice(atlas) + local texture = randtablechoice(atlas) --spEcho(texture) AddDecal( texture, @@ -2008,20 +2000,26 @@ function widget:Initialize() end end - WG['decalsgl4'] = {} - WG['decalsgl4'].AddDecalGL4 = AddDecal - WG['decalsgl4'].RemoveDecalGL4 = RemoveDecal - WG['decalsgl4'].SetLifeTimeMult = function(value) + WG["decalsgl4"] = {} + WG["decalsgl4"].AddDecalGL4 = AddDecal + WG["decalsgl4"].RemoveDecalGL4 = RemoveDecal + WG["decalsgl4"].SetLifeTimeMult = function(value) lifeTimeMult = value end - WG['decalsgl4'].GetActiveDecals = function() return activeDecalData end - WG['decalsgl4'].GetLifeTimeMult = function() return lifeTimeMult end - WG['decalsgl4'].RebuildActiveDecalData = RebuildActiveDecalData - local vboTableCache = {decalVBO, decalLargeVBO, decalExtraLargeVBO} - WG['decalsgl4'].GetVBOData = function() return vboTableCache, footprintDecalSet end + WG["decalsgl4"].GetActiveDecals = function() + return activeDecalData + end + WG["decalsgl4"].GetLifeTimeMult = function() + return lifeTimeMult + end + WG["decalsgl4"].RebuildActiveDecalData = RebuildActiveDecalData + local vboTableCache = { decalVBO, decalLargeVBO, decalExtraLargeVBO } + WG["decalsgl4"].GetVBOData = function() + return vboTableCache, footprintDecalSet + end - widgetHandler:RegisterGlobal('AddDecalGL4', WG['decalsgl4'].AddDecalGL4) - widgetHandler:RegisterGlobal('RemoveDecalGL4', WG['decalsgl4'].RemoveDecalGL4) + widgetHandler:RegisterGlobal("AddDecalGL4", WG["decalsgl4"].AddDecalGL4) + widgetHandler:RegisterGlobal("RemoveDecalGL4", WG["decalsgl4"].RemoveDecalGL4) --spEcho(string.format("Decals GL4 loaded %d textures in %.3fs",numFiles, Spring.DiffTimers(Spring.GetTimer(), t0))) --spEcho("Trying to access _G[NightModeParams]", _G["NightModeParams"]) @@ -2029,74 +2027,95 @@ function widget:Initialize() if pendingRestore and pendingRestore.decals then local curFrame = spGetGameFrame() if curFrame > 0 then - local restoredCount = 0 - local frameOffset = curFrame - (pendingRestore.saveFrame or 0) - for _, entry in ipairs(pendingRestore.decals) do - local step = #entry - -- Support compact 13-field format and legacy 20-field format - local vboEntry - if step == 13 then - -- Compact: reconstruct full 20-float VBO entry - local posx, posz = entry[11], entry[12] - local posy = Spring.GetGroundHeight(posx, posz) or 0 - vboEntry = { - entry[1], entry[2], entry[3], entry[4], -- length, width, rotation, maxalpha - entry[5], entry[6], entry[7], entry[8], -- UV p,q,s,t - entry[9], entry[10], 0, 0, -- alphastart, alphadecay, heatstart=0, heatdecay=0 - posx, posy, posz, entry[13], -- posx, posy, posz, spawnframe - 0.5, 0, 0, 0, -- bwfactor=0.5, glowsustain=0, glowadd=0, fadeintime=0 - } - elseif step == 20 then - vboEntry = entry - end - if vboEntry then - -- Adjust spawnframe by the elapsed time between save and restore - vboEntry[16] = vboEntry[16] + frameOffset - - local alphastart = vboEntry[9] - local alphadecay = vboEntry[10] - if alphadecay > 0 then - local age = curFrame - vboEntry[16] - local alpha = alphastart - alphadecay * age - if alpha > 0 then - local lifetime = mathFloor(alphastart / alphadecay) - decalIndex = decalIndex + 1 - - local length_v = vboEntry[1] - local width_v = vboEntry[2] - local targetVBO = decalVBO - if mathMin(width_v, length_v) > extralargesizeThreshold then - targetVBO = decalExtraLargeVBO - elseif mathMin(width_v, length_v) > largesizethreshold then - targetVBO = decalLargeVBO - end - - pushElementInstance(targetVBO, vboEntry, decalIndex, true, true) - - local deathtime = vboEntry[16] + lifetime - if decalRemoveQueue[deathtime] == nil then - decalRemoveQueue[deathtime] = {decalIndex} - else - decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1] = decalIndex + local restoredCount = 0 + local frameOffset = curFrame - (pendingRestore.saveFrame or 0) + for _, entry in ipairs(pendingRestore.decals) do + local step = #entry + -- Support compact 13-field format and legacy 20-field format + local vboEntry + if step == 13 then + -- Compact: reconstruct full 20-float VBO entry + local posx, posz = entry[11], entry[12] + local posy = Spring.GetGroundHeight(posx, posz) or 0 + vboEntry = { + entry[1], + entry[2], + entry[3], + entry[4], -- length, width, rotation, maxalpha + entry[5], + entry[6], + entry[7], + entry[8], -- UV p,q,s,t + entry[9], + entry[10], + 0, + 0, -- alphastart, alphadecay, heatstart=0, heatdecay=0 + posx, + posy, + posz, + entry[13], -- posx, posy, posz, spawnframe + 0.5, + 0, + 0, + 0, -- bwfactor=0.5, glowsustain=0, glowadd=0, fadeintime=0 + } + elseif step == 20 then + vboEntry = entry + end + if vboEntry then + -- Adjust spawnframe by the elapsed time between save and restore + vboEntry[16] = vboEntry[16] + frameOffset + + local alphastart = vboEntry[9] + local alphadecay = vboEntry[10] + if alphadecay > 0 then + local age = curFrame - vboEntry[16] + local alpha = alphastart - alphadecay * age + if alpha > 0 then + local lifetime = mathFloor(alphastart / alphadecay) + decalIndex = decalIndex + 1 + + local length_v = vboEntry[1] + local width_v = vboEntry[2] + local targetVBO = decalVBO + if mathMin(width_v, length_v) > extralargesizeThreshold then + targetVBO = decalExtraLargeVBO + elseif mathMin(width_v, length_v) > largesizethreshold then + targetVBO = decalLargeVBO + end + + pushElementInstance(targetVBO, vboEntry, decalIndex, true, true) + + local deathtime = vboEntry[16] + lifetime + if decalRemoveQueue[deathtime] == nil then + decalRemoveQueue[deathtime] = { decalIndex } + else + decalRemoveQueue[deathtime][#decalRemoveQueue[deathtime] + 1] = decalIndex + end + + local posx = vboEntry[13] + local posz = vboEntry[15] + local rotation = vboEntry[3] + local p, q2, s, t = vboEntry[5], vboEntry[6], vboEntry[7], vboEntry[8] + AddDecalToArea(decalIndex, posx, posz, width_v, length_v) + restoredCount = restoredCount + 1 end - - local posx = vboEntry[13] - local posz = vboEntry[15] - local rotation = vboEntry[3] - local p, q2, s, t = vboEntry[5], vboEntry[6], vboEntry[7], vboEntry[8] - AddDecalToArea(decalIndex, posx, posz, width_v, length_v) - restoredCount = restoredCount + 1 end end end - end - -- Batch upload all restored decals - if decalVBO.dirty then uploadAllElements(decalVBO) end - if decalLargeVBO.dirty then uploadAllElements(decalLargeVBO) end - if decalExtraLargeVBO.dirty then uploadAllElements(decalExtraLargeVBO) end - if restoredCount > 0 then - spEcho(string.format("[DecalsGL4] Restored %d decals from previous session", restoredCount)) - end + -- Batch upload all restored decals + if decalVBO.dirty then + uploadAllElements(decalVBO) + end + if decalLargeVBO.dirty then + uploadAllElements(decalLargeVBO) + end + if decalExtraLargeVBO.dirty then + uploadAllElements(decalExtraLargeVBO) + end + if restoredCount > 0 then + spEcho(string.format("[DecalsGL4] Restored %d decals from previous session", restoredCount)) + end end -- curFrame > 0 pendingRestore = nil end @@ -2104,13 +2123,13 @@ function widget:Initialize() --pre-optimize UnitScriptDecals: for unitDefID, UnitScriptDecalSet in pairs(UnitScriptDecals) do for i, decalTable in ipairs(UnitScriptDecalSet) do - local p,q,s,t = 0,1,0,1 + local p, q, s, t = 0, 1, 0, 1 if atlas[decalTable.texture] == nil then - spEcho("Tried to spawn a decal gl4 with a texture not present in the atlas:",decalTable.texture) + spEcho("Tried to spawn a decal gl4 with a texture not present in the atlas:", decalTable.texture) else local uvs = atlas[decalTable.texture] - p,q,s,t = uvs[1], uvs[2], uvs[3], uvs[4] + p, q, s, t = uvs[1], uvs[2], uvs[3], uvs[4] if decalTable.fliphorizontal then p, q = q, p end @@ -2120,22 +2139,29 @@ function widget:Initialize() end decalTable.cacheTable = { - decalTable.width, decalTable.height, 0, decalTable.maxalpha, - p,q,s,t, + decalTable.width, + decalTable.height, + 0, + decalTable.maxalpha, + p, + q, + s, + t, decalTable.alphastart or 1, - (decalTable.alphadecay) or 0 / (lifeTimeMult*lifeTimeMultMult), + decalTable.alphadecay or 0 / (lifeTimeMult * lifeTimeMultMult), decalTable.heatstart or 0, decalTable.heatdecay or 1, - 0,0,0,0, + 0, + 0, + 0, + 0, decalTable.bwfactor or 1, decalTable.glowsustain or 1, decalTable.glowadd or 1, - decalTable.fadeintime or shaderConfig.FADEINTIME or 1 + decalTable.fadeintime or shaderConfig.FADEINTIME or 1, } end end - - end function widget:UnitScriptDecal(unitID, unitDefID, decalIndex, posx, posz, heading) @@ -2148,10 +2174,9 @@ function widget:SunChanged() end function widget:ShutDown() - - WG['decalsgl4'] = nil - widgetHandler:DeregisterGlobal('AddDecalGL4') - widgetHandler:DeregisterGlobal('RemoveDecalGL4') + WG["decalsgl4"] = nil + widgetHandler:DeregisterGlobal("AddDecalGL4") + widgetHandler:DeregisterGlobal("RemoveDecalGL4") end function widget:GameOver() @@ -2171,7 +2196,7 @@ function widget:GetConfigData(_) -- Called by RemoveWidget local frame = spGetGameFrame() local scars = {} local footprints = {} - local vboTables = {decalVBO, decalLargeVBO, decalExtraLargeVBO} + local vboTables = { decalVBO, decalLargeVBO, decalExtraLargeVBO } local floor = mathFloor for _, vbo in ipairs(vboTables) do if vbo and vbo.usedElements > 0 then @@ -2191,24 +2216,24 @@ function widget:GetConfigData(_) -- Called by RemoveWidget -- Compact format: 13 fields instead of 20 -- Drops: posy (recalculated), heatstart, heatdecay, bwfactor, glowsustain, glowadd, fadeintime local entry = { - floor(length), -- [1] length - floor(width), -- [2] width - floor(data[offset + 3] * 100) / 100, -- [3] rotation - floor(data[offset + 4] * 100) / 100, -- [4] maxalpha - round(data[offset + 5], 2), -- [5] UV p - round(data[offset + 6], 2), -- [6] UV q - round(data[offset + 7], 2), -- [7] UV s - round(data[offset + 8], 2), -- [8] UV t - round(data[offset + 9], 2), -- [9] alphastart - data[offset + 10], -- [10] alphadecay - floor(data[offset + 13]), -- [11] posx (int) - floor(data[offset + 15]), -- [12] posz (int) - spawnframe, -- [13] spawnframe + floor(length), -- [1] length + floor(width), -- [2] width + floor(data[offset + 3] * 100) / 100, -- [3] rotation + floor(data[offset + 4] * 100) / 100, -- [4] maxalpha + round(data[offset + 5], 2), -- [5] UV p + round(data[offset + 6], 2), -- [6] UV q + round(data[offset + 7], 2), -- [7] UV s + round(data[offset + 8], 2), -- [8] UV t + round(data[offset + 9], 2), -- [9] alphastart + data[offset + 10], -- [10] alphadecay + floor(data[offset + 13]), -- [11] posx (int) + floor(data[offset + 15]), -- [12] posz (int) + spawnframe, -- [13] spawnframe } if footprintDecalSet[instanceID] then - footprints[#footprints + 1] = {size = size, data = entry} + footprints[#footprints + 1] = { size = size, data = entry } else - scars[#scars + 1] = {size = size, data = entry} + scars[#scars + 1] = { size = size, data = entry } end end end @@ -2216,20 +2241,28 @@ function widget:GetConfigData(_) -- Called by RemoveWidget end -- Sort both lists by size descending (biggest first) - table.sort(scars, function(a, b) return a.size > b.size end) - table.sort(footprints, function(a, b) return a.size > b.size end) + table.sort(scars, function(a, b) + return a.size > b.size + end) + table.sort(footprints, function(a, b) + return a.size > b.size + end) local savedDecals = {} local savedCount = 0 -- Add biggest scars first for i = 1, #scars do - if savedCount >= maxSave then break end + if savedCount >= maxSave then + break + end savedCount = savedCount + 1 savedDecals[savedCount] = scars[i].data end -- Fill remaining slots with biggest footprints for i = 1, #footprints do - if savedCount >= maxSave then break end + if savedCount >= maxSave then + break + end savedCount = savedCount + 1 savedDecals[savedCount] = footprints[i].data end diff --git a/luaui/Widgets/gfx_deferred_rendering_GL4.lua b/luaui/Widgets/gfx_deferred_rendering_GL4.lua index 4e0314e4e9c..cd8a499b918 100644 --- a/luaui/Widgets/gfx_deferred_rendering_GL4.lua +++ b/luaui/Widgets/gfx_deferred_rendering_GL4.lua @@ -12,11 +12,10 @@ function widget:GetInfo() license = "GNU GPL v2", layer = -99999990, enabled = true, - depends = {'gl4'}, + depends = { "gl4" }, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -68,63 +67,63 @@ local spGetTeamList = Spring.GetTeamList -------------------------------- Notes, TODO ---------------------------------- do --- GL4 notes: --- A spot light is a sphere? --- A cone light is a cone --- A beam light is a box --- all prims should be back-face only rendered! + -- GL4 notes: + -- A spot light is a sphere? + -- A cone light is a cone + -- A beam light is a box + -- all prims should be back-face only rendered! --- Full documentation: --- https://docs.google.com/document/d/16mvYJX8WJ8cNjGe_3zhrymTOzPoSkFprr78i_vpH7yA/edit# + -- Full documentation: + -- https://docs.google.com/document/d/16mvYJX8WJ8cNjGe_3zhrymTOzPoSkFprr78i_vpH7yA/edit# --- Separate VBO's for spheres, cones, beams --- no geometry shader for now, its kinda pointless, might change my mind later + -- Separate VBO's for spheres, cones, beams + -- no geometry shader for now, its kinda pointless, might change my mind later --- Sources of light --- Projectiles + -- Sources of light + -- Projectiles -- beamlasers - -- might get away with not updating their pos each frame? - -- probably not, due to continuous lasers like beamer turret (though that one may be spawned every frame...) - -- TODO: beamttl needs to be fixes, as we are way over spamming these, with up to 3 lights per beam + -- might get away with not updating their pos each frame? + -- probably not, due to continuous lasers like beamer turret (though that one may be spawned every frame...) + -- TODO: beamttl needs to be fixes, as we are way over spamming these, with up to 3 lights per beam -- lightning - -- TODO: see if the multi-spawn + -- TODO: see if the multi-spawn -- plasma balls - -- these are actually easy to sim, but might not be worth it, not simmed + -- these are actually easy to sim, but might not be worth it, not simmed -- missiles - -- unsimable, must be queried + -- unsimable, must be queried -- rockets - -- hard to sim + -- hard to sim -- gibs - -- hard to sim --- Explosions + -- hard to sim + -- Explosions -- actually spawn once, reasonably easy (separate vbotable for them?) -- always spherical, should be able to override a param with them -- --- mapdefined lights + -- mapdefined lights -- animating them might be a challenge --- headlights + -- headlights -- would rock, needs their own vbo for position maybe? -- or just extend --- piecelights + -- piecelights -- for thrusters, would be truly epic! -- fusion lights --- Notes on self-point lights: + -- Notes on self-point lights: -- these are probably best billboarded, then depth tested! --- would be nice to have: + -- would be nice to have: -- full map-level dense atmosphere -- explosions should kick up dust -- simulate wind and other movements -- at a rez of 32 elmos, dsd would need: -- 256*256*16 voxels (1 million?) yeesh --- Features are not light-attachable at the moment, and shouldnt be as they are immobile, use global lights + -- Features are not light-attachable at the moment, and shouldnt be as they are immobile, use global lights --- preliminary perf: + -- preliminary perf: -- yeah raymarch is expensive! ---TODO: + --TODO: -- XX Reload config -- XX Fix initialize -- XX convert config to dicts @@ -132,39 +131,51 @@ do -- XX noupload pass -- reload shaderconfig -- cursorlight - -- ally and own, click sensitive! + -- ally and own, click sensitive! -- XX light types should know their vbo? - -- this one is much harder than expected + -- this one is much harder than expected -- XX initialize config dicts -- DONE -- XX rework dicts -- DONE -- XX unitdefidpiecemapcache -- DONE -- Draw pre-water? -- optimizations: - -- XX only upload dirty VBOs - -- Smaller, single channel noise texture + -- XX only upload dirty VBOs + -- Smaller, single channel noise texture -- XX Beam lights double length for projectiles! -- Some falloff issues result in a bit of overdraw -- allow for customizable attenuation -- XX list type configs for events -- Handle playerchanged -- hasnt crashed yet :P - -- clear every goddamned unit light and buffer + -- clear every goddamned unit light and buffer -- FIX SSAO widget for day-night cycle changes - done! - end - local cursorLights local cursorLightHeight = 35 local cursorLightParams = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam pieceName = nil, -- optional lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 350, -- (radius is set elsewhere) - r = 1, g = 1, b = 1, a = 0.1, -- (alpha is set elsewhere) - color2r = 0, color2g = 0, color2b = 0, colortime = 0, -- point lights only, colortime in seconds for unit-attache - modelfactor = 0.3, specular = 0.7, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 - } + posx = 0, + posy = 0, + posz = 0, + radius = 350, -- (radius is set elsewhere) + r = 1, + g = 1, + b = 1, + a = 0.1, -- (alpha is set elsewhere) + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 0, -- point lights only, colortime in seconds for unit-attache + modelfactor = 0.3, + specular = 0.7, + scattering = 0, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, } local cursorLightAlpha = 0.5 @@ -177,18 +188,31 @@ local showPlayerCursorLight = false local playerCursorLightRadius = 1 local playerCursorLightBrightness = 1 local playerCursorLightParams = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam pieceName = nil, -- optional lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 250, - r = 1, g = 0.8, b = 0.6, a = 0.1, -- (alpha is set elsewhere) - color2r = 0, color2g = 0, color2b = 0, colortime = 0, -- point lights only, colortime in seconds for unit-attache - modelfactor = 0.3, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 8 - } + posx = 0, + posy = 0, + posz = 0, + radius = 250, + r = 1, + g = 0.8, + b = 0.6, + a = 0.1, -- (alpha is set elsewhere) + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 0, -- point lights only, colortime in seconds for unit-attache + modelfactor = 0.3, + specular = 0.4, + scattering = 0, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 8, + }, } - local teamColors = {} local function loadTeamColors() local playerList = spGetPlayerList() @@ -197,7 +221,7 @@ local function loadTeamColors() local playerID = playerList[i] local teamID = select(4, spGetPlayerInfo(playerID, false)) local r, g, b = spGetTeamColor(teamID) - teamColors[playerID] = {r, g, b} + teamColors[playerID] = { r, g, b } end end loadTeamColors() @@ -223,19 +247,17 @@ local GL_SRC_ALPHA = GL.SRC_ALPHA local GL_ONE = GL.ONE local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA - -- Strong: local spGetProjectilePosition = Spring.GetProjectilePosition local spGetProjectileVelocity = Spring.GetProjectileVelocity local spGetProjectileType = Spring.GetProjectileType local spGetProjectileDefID = Spring.GetProjectileDefID local spGetGroundHeight = Spring.GetGroundHeight -local spIsSphereInView = Spring.IsSphereInView -local spGetUnitPosition = Spring.GetUnitPosition +local spIsSphereInView = Spring.IsSphereInView +local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitIsDead = Spring.GetUnitIsDead local spValidUnitID = Spring.ValidUnitID - -- Weak: local spIsGUIHidden = Spring.IsGUIHidden @@ -252,15 +274,15 @@ end ------------------------------ Light and Shader configurations ------------------ -local enableProjectileLightFlares = false -- set to true to show lens flare textures on projectile lights +local enableProjectileLightFlares = false -- set to true to show lens flare textures on projectile lights local unitDefLights local featureDefLights local unitEventLights -- Table of lights per unitDefID -local muzzleFlashLights -- one light per weaponDefID -local projectileDefLights -- one light per weaponDefID -local explosionLights -- one light per weaponDefID -local gibLight -- one light for all pieceprojectiles +local muzzleFlashLights -- one light per weaponDefID +local projectileDefLights -- one light per weaponDefID +local explosionLights -- one light per weaponDefID +local gibLight -- one light for all pieceprojectiles local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() @@ -281,7 +303,7 @@ local screenSpaceShadows = 2 local isPotatoGpu = false local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 1000) / 1000 -if Platform ~= nil and Platform.gpuVendor == 'Intel' then +if Platform ~= nil and Platform.gpuVendor == "Intel" then isPotatoGpu = true end if gpuMem and gpuMem > 0 and gpuMem < 1800 then @@ -294,8 +316,8 @@ elseif gpuMem and gpuMem > 0 and gpuMem < 5000 then end -- the 3d noise texture used for this shader -local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" -local blueNoise2D = "LuaUI/images/noisetextures/blue_noise_64.tga" +local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" +local blueNoise2D = "LuaUI/images/noisetextures/blue_noise_64.tga" --[[ local examplePointLight = { @@ -310,7 +332,8 @@ local examplePointLight = { modelfactor = 1, specular = 1, scattering = 1, lensflare = 1, lifetime = 0, sustain = 1, selfshadowing = 0 } -]]-- +]] +-- ------------------------------ Debug switches ------------------------------ local autoupdate = false @@ -332,12 +355,12 @@ local unitBeamLightVBO = {} -- an instanceVBOTable local unitLightVBOMap -- a table of the above 3, keyed by light type, {point = unitPointLightVBO, ...} local unitAttachedLights = {} -- this is a table mapping unitID's to all their attached instanceIDs and vbos - --{unitID = { instanceID = targetVBO, ... }} +--{unitID = { instanceID = targetVBO, ... }} local visibleUnits = {} -- this is a proxy for the widget callins, used to ensure we dont add unitscriptlights to units that are not visible -- these will be separate, as they need per-frame updates! -local projectilePointLightVBO = {} -- for plasma balls -local projectileBeamLightVBO = {} -- for lasers +local projectilePointLightVBO = {} -- for plasma balls +local projectileBeamLightVBO = {} -- for lasers local projectileConeLightVBO = {} -- for rockets local projectileLightVBOMap -- a table of the above 3, keyed by light type @@ -350,7 +373,9 @@ local unitDefPeiceMapCache = {} -- maps unitDefID to piecemap local lightParamTableSize = 29 local lightCacheTable = {} -- this is a reusable table cache for saving memory later on -for i = 1, lightParamTableSize do lightCacheTable[i] = 0 end +for i = 1, lightParamTableSize do + lightCacheTable[i] = 0 +end local pieceIndexPos = 25 local spawnFramePos = 17 lightCacheTable[13] = 1 --modelfactor_specular_scattering_lensflare @@ -359,20 +384,38 @@ lightCacheTable[15] = 1 lightCacheTable[16] = 1 local lightParamKeyOrder = { -- This table is a 'quick-ish' way of building the lua array from human-readable light parameters - posx = 1, posy = 2, posz = 3, radius = 4, - r = 9, g = 10, b = 11, a = 12, - dirx = 5, diry = 6, dirz = 7, theta = 8, -- specify direction and half-angle in radians - pos2x = 5, pos2y = 6, pos2z = 7, -- beam lights only, specifies the endpoint of the beam - modelfactor = 13, specular = 14, scattering = 15, lensflare = 16, - lifetime = 18, sustain = 19, selfshadowing = 20, -- selfshadowing unused + posx = 1, + posy = 2, + posz = 3, + radius = 4, + r = 9, + g = 10, + b = 11, + a = 12, + dirx = 5, + diry = 6, + dirz = 7, + theta = 8, -- specify direction and half-angle in radians + pos2x = 5, + pos2y = 6, + pos2z = 7, -- beam lights only, specifies the endpoint of the beam + modelfactor = 13, + specular = 14, + scattering = 15, + lensflare = 16, + lifetime = 18, + sustain = 19, + selfshadowing = 20, -- selfshadowing unused -- NOTE THERE ARE 4 MORE UNUSED SLOTS HERE RESERVED FOR FUTURE USE! -- Nope, beherith ate these like a greedy boy - color2r = 21, color2g = 22, color2b = 23, colortime = 24, -- point lights only, colortime in seconds for unit-attached + color2r = 21, + color2g = 22, + color2b = 23, + colortime = 24, -- point lights only, colortime in seconds for unit-attached } local autoLightInstanceID = 128000 -- as MAX_PROJECTILES = 128000, so they get unique ones - local gameFrame = 0 local trackedProjectiles = {} -- used for finding out which projectiles can be culled {projectileID = updateFrame, ...} @@ -389,7 +432,7 @@ local pushElementInstance = InstanceVBOTable.pushElementInstance local deferredLightShader = nil local shaderSourceCache = { - shaderName = 'Deferred Lights GL4', + shaderName = "Deferred Lights GL4", vssrcpath = "LuaUI/Shaders/deferred_lights_gl4.vert.glsl", fssrcpath = "LuaUI/Shaders/deferred_lights_gl4.frag.glsl", shaderConfig = shaderConfig, @@ -407,7 +450,7 @@ local shaderSourceCache = { --heightmapTex = 9, --mapnormalsTex = 10, screenSpaceShadows = 16, - }, + }, uniformFloat = { pointbeamcone = 0, --fadeDistance = 3000, @@ -417,33 +460,55 @@ local shaderSourceCache = { windZ = 0.0, radiusMultiplier = 1.0, intensityMultiplier = 1.0, - }, + }, +} +local testprojlighttable = { + 0, + 16, + 0, + 200, --pos + radius + 0.25, + 0.25, + 0.125, + 5, -- color2, colortime + 1.0, + 1.0, + 0.5, + 0.5, -- RGBA + 0.1, + 1, + 0.25, + 1, -- modelfactor_specular_scattering_lensflare + 0, + 0, + 200, + 0, -- spawnframe, lifetime (frames), sustain (frames), selfshadowing + 0, + 0, + 0, + 0, -- color2 + 0, -- pieceIndex + 0, + 0, + 0, + 0, -- instData always 0! } -local testprojlighttable = {0,16,0,200, --pos + radius - 0.25, 0.25,0.125, 5, -- color2, colortime - 1.0,1.0,0.5,0.5, -- RGBA - 0.1,1,0.25,1, -- modelfactor_specular_scattering_lensflare - 0,0,200,0, -- spawnframe, lifetime (frames), sustain (frames), selfshadowing - 0,0,0,0, -- color2 - 0, -- pieceIndex - 0,0,0,0 -- instData always 0! - } local numAddLights = 0 -- how many times AddLight was called local spec = spGetSpectatingState() ---------------------- INITIALIZATION FUNCTIONS ---------------------------------- - - local function goodbye(reason) - spEcho('Deferred Lights GL4 exiting:', reason) + spEcho("Deferred Lights GL4 exiting:", reason) widgetHandler:RemoveWidget() end local function createLightInstanceVBO(vboLayout, vertexVBO, numVertices, indexVBO, VBOname, unitIDattribID) - local targetLightVBO = InstanceVBOTable.makeInstanceVBOTable( vboLayout, 16, VBOname, unitIDattribID) - if vertexVBO == nil or targetLightVBO == nil then goodbye("Failed to make "..VBOname) end + local targetLightVBO = InstanceVBOTable.makeInstanceVBOTable(vboLayout, 16, VBOname, unitIDattribID) + if vertexVBO == nil or targetLightVBO == nil then + goodbye("Failed to make " .. VBOname) + end targetLightVBO.vertexVBO = vertexVBO targetLightVBO.numVertices = numVertices targetLightVBO.indexVBO = indexVBO @@ -459,65 +524,68 @@ local function initGL4() end -- init the VBO local vboLayout = { - {id = 3, name = 'worldposrad', size = 4}, - -- for spot, this is center.xyz and radius - -- for cone, this is center.xyz and height - -- for beam this is center.xyz and radiusleft - {id = 4, name = 'worldposrad2', size = 4}, - -- for spot, this is direction.xyz for unitattached, or world anim params - -- for cone, this is direction.xyz and angle in radians - -- for beam this is end.xyz and radiusright - {id = 5, name = 'lightcolor', size = 4}, - -- this is light color rgba for all - {id = 6, name = 'modelfactor_specular_scattering_lensflare', size = 4}, - {id = 7, name = 'otherparams', size = 4}, - -- Otherparams must be spawnframe, dieframe - {id = 8, name = 'color2', size = 4}, - {id = 9, name = 'pieceIndex', size = 1, type = GL.UNSIGNED_INT}, - {id = 10, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 3, name = "worldposrad", size = 4 }, + -- for spot, this is center.xyz and radius + -- for cone, this is center.xyz and height + -- for beam this is center.xyz and radiusleft + { id = 4, name = "worldposrad2", size = 4 }, + -- for spot, this is direction.xyz for unitattached, or world anim params + -- for cone, this is direction.xyz and angle in radians + -- for beam this is end.xyz and radiusright + { id = 5, name = "lightcolor", size = 4 }, + -- this is light color rgba for all + { id = 6, name = "modelfactor_specular_scattering_lensflare", size = 4 }, + { id = 7, name = "otherparams", size = 4 }, + -- Otherparams must be spawnframe, dieframe + { id = 8, name = "color2", size = 4 }, + { id = 9, name = "pieceIndex", size = 1, type = GL.UNSIGNED_INT }, + { id = 10, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } local pointVBO, _, pointIndexVBO, _ = InstanceVBOTable.makeSphereVBO(8, 4, 1) - pointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Point Light VBO") - unitPointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Unit Point Light VBO", 10) - cursorPointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Cursor Point Light VBO") + pointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Point Light VBO") + unitPointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Unit Point Light VBO", 10) + cursorPointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Cursor Point Light VBO") predictivePointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Predictive Point Light VBO") projectilePointLightVBO = createLightInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Projectile Point Light VBO") local coneVBO, numConeVertices = InstanceVBOTable.makeConeVBO(12, 1, 1) - coneLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Cone Light VBO") - unitConeLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Unit Cone Light VBO", 10) - projectileConeLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Projectile Cone Light VBO") + coneLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Cone Light VBO") + unitConeLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Unit Cone Light VBO", 10) + projectileConeLightVBO = createLightInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Projectile Cone Light VBO") local beamVBO, numBeamVertices = InstanceVBOTable.makeBoxVBO(-1, -1, -1, 1, 1, 1) - beamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Beam Light VBO") - unitBeamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Unit Beam Light VBO", 10) - projectileBeamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Projectile Beam Light VBO") + beamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Beam Light VBO") + unitBeamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Unit Beam Light VBO", 10) + projectileBeamLightVBO = createLightInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Projectile Beam Light VBO") - projectileLightVBOMap = { point = projectilePointLightVBO, beam = projectileBeamLightVBO, cone = projectileConeLightVBO, } - unitLightVBOMap = { point = unitPointLightVBO, beam = unitBeamLightVBO, cone = unitConeLightVBO, } - lightVBOMap = { point = pointLightVBO, beam = beamLightVBO, cone = coneLightVBO, } + projectileLightVBOMap = { point = projectilePointLightVBO, beam = projectileBeamLightVBO, cone = projectileConeLightVBO } + unitLightVBOMap = { point = unitPointLightVBO, beam = unitBeamLightVBO, cone = unitConeLightVBO } + lightVBOMap = { point = pointLightVBO, beam = beamLightVBO, cone = coneLightVBO } return pointLightVBO and unitPointLightVBO and coneLightVBO and beamLightVBO end - ---InitializeLight(lightTable, unitID) ---Takes a light definition table, and tries to check wether its already been initialized, if not, it inits it in-place ---@param lightTable table ---@param unitID number local function InitializeLight(lightTable, unitID) - if not lightTable.initComplete then -- late init + if not lightTable.initComplete then -- late init -- do the table to flattable conversion, if it doesnt exist yet if not lightTable.lightParamTable then -- perform correct init local lightparams = {} - for i = 1, lightParamTableSize do lightparams[i] = 0 end - if lightTable.lightConfig == nil then Spring.Debug.TraceFullEcho() end + for i = 1, lightParamTableSize do + lightparams[i] = 0 + end + if lightTable.lightConfig == nil then + Spring.Debug.TraceFullEcho() + end for paramname, tablepos in pairs(lightParamKeyOrder) do lightparams[tablepos] = lightTable.lightConfig[paramname] or lightparams[tablepos] end lightparams[lightParamKeyOrder.radius] = lightparams[lightParamKeyOrder.radius] - lightparams[lightParamKeyOrder.a] = lightparams[lightParamKeyOrder.a] - lightparams[lightParamKeyOrder.lifetime] = mathFloor( lightparams[lightParamKeyOrder.lifetime] ) + lightparams[lightParamKeyOrder.a] = lightparams[lightParamKeyOrder.a] + lightparams[lightParamKeyOrder.lifetime] = mathFloor(lightparams[lightParamKeyOrder.lifetime]) lightTable.lightParamTable = lightparams lightTable.lightConfig = nil -- never used again after initialization end @@ -538,7 +606,7 @@ local function InitializeLight(lightTable, unitID) lightTable.pieceIndex = pieceMap[lightTable.pieceName] lightTable.lightParamTable[pieceIndexPos] = lightTable.pieceIndex end - --spEcho(lightname, lightParams.pieceName, pieceMap[lightParams.pieceName]) + --spEcho(lightname, lightParams.pieceName, pieceMap[lightParams.pieceName]) end lightTable.initComplete = true @@ -596,7 +664,7 @@ local function AddLight(instanceID, unitID, pieceIndex, targetVBO, lightparams, end if unitID then if unitAttachedLights[unitID] == nil then - unitAttachedLights[unitID] = {[instanceID] = targetVBO} + unitAttachedLights[unitID] = { [instanceID] = targetVBO } else unitAttachedLights[unitID][instanceID] = targetVBO end @@ -633,9 +701,7 @@ end ---@param sustain float how much sustain time the light will have at its original brightness (in game frames) ---@param selfshadowing int what further type of animation will be used (0 is default 1 is for screen space shadow) ---@return instanceID for future reuse -local function AddPointLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r,g,b,a, r2,g2,b2, colortime, - modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) - +local function AddPointLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r, g, b, a, r2, g2, b2, colortime, modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) if instanceID == nil then autoLightInstanceID = autoLightInstanceID + 1 instanceID = autoLightInstanceID @@ -678,45 +744,50 @@ local function AddPointLight(instanceID, unitID, pieceIndex, targetVBO, px_or_ta lightparams[spawnFramePos] = gameFrame -- this might be problematic, as we will be modifying a table passed by reference! noUpload = py end - if targetVBO == nil then targetVBO = pointLightVBO end - if unitID then targetVBO = unitPointLightVBO end + if targetVBO == nil then + targetVBO = pointLightVBO + end + if unitID then + targetVBO = unitPointLightVBO + end instanceID = pushElementInstance(targetVBO, lightparams, instanceID, true, noUpload, unitID) calcLightExpiry(targetVBO, lightparams, instanceID) -- This will add lights that have >0 lifetime to the removal queue return instanceID end local function AddRandomDecayingPointLight() - AddPointLight(nil,nil,nil, nil, - Game.mapSizeX * 0.5 + mathRandom()*2000, - spGetGroundHeight(Game.mapSizeX * 0.5,Game.mapSizeZ * 0.5) + 50, - Game.mapSizeZ * 0.5, - 250, - 1,0,0,1, - 0,1,0,60, - 1,1,1,1, - gameFrame, 100, 20, 1) + AddPointLight(nil, nil, nil, nil, Game.mapSizeX * 0.5 + mathRandom() * 2000, spGetGroundHeight(Game.mapSizeX * 0.5, Game.mapSizeZ * 0.5) + 50, Game.mapSizeZ * 0.5, 250, 1, 0, 0, 1, 0, 1, 0, 60, 1, 1, 1, 1, gameFrame, 100, 20, 1) --spEcho("AddRandomDecayingPointLight", instanceID) - AddPointLight(nil,nil,nil,nil, - Game.mapSizeX * 0.5 + mathRandom()*2000, - spGetGroundHeight(Game.mapSizeX * 0.5,Game.mapSizeZ * 0.5) + 50, - Game.mapSizeZ * 0.5 + 400, - 250, - 1,1,1,1, - 1,0.5,0.2,5, - 1,1,1,1, - gameFrame, 30, 0.2, 1) + AddPointLight(nil, nil, nil, nil, Game.mapSizeX * 0.5 + mathRandom() * 2000, spGetGroundHeight(Game.mapSizeX * 0.5, Game.mapSizeZ * 0.5) + 50, Game.mapSizeZ * 0.5 + 400, 250, 1, 1, 1, 1, 1, 0.5, 0.2, 5, 1, 1, 1, 1, gameFrame, 30, 0.2, 1) --spEcho("AddRandomExplosionPointLight", instanceID) - AddPointLight(nil,nil,nil,nil, - Game.mapSizeX * 0.5 + mathRandom()*2000, - spGetGroundHeight(Game.mapSizeX * 0.5,Game.mapSizeZ * 0.5) + 50, + AddPointLight( + nil, + nil, + nil, + nil, + Game.mapSizeX * 0.5 + mathRandom() * 2000, + spGetGroundHeight(Game.mapSizeX * 0.5, Game.mapSizeZ * 0.5) + 50, Game.mapSizeZ * 0.5 + 800, 250, - 0,0,0,1, -- start from black - 1,0.5,0.25,3, -- go to yellow in 3 frames - 1,1,1,1, - gameFrame, 100, 20, 1) -- Sustain peak brightness for 20 frames, and go down to 0 brightness by 100 frames. + 0, + 0, + 0, + 1, -- start from black + 1, + 0.5, + 0.25, + 3, -- go to yellow in 3 frames + 1, + 1, + 1, + 1, + gameFrame, + 100, + 20, + 1 + ) -- Sustain peak brightness for 20 frames, and go down to 0 brightness by 100 frames. --spEcho("AddRandomDecayingPointLight", instanceID) end @@ -748,9 +819,7 @@ end ---@param sustain float how much sustain time the light will have at its original brightness (in game frames) ---@param selfshadowing int what further type of animation will be used ---@return instanceID for future reuse -local function AddBeamLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r,g,b,a, sx, sy, sz, r2, colortime, - modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) - +local function AddBeamLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r, g, b, a, sx, sy, sz, r2, colortime, modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) if instanceID == nil then autoLightInstanceID = autoLightInstanceID + 1 instanceID = autoLightInstanceID @@ -794,8 +863,12 @@ local function AddBeamLight(instanceID, unitID, pieceIndex, targetVBO, px_or_tab noUpload = py end - if targetVBO == nil then targetVBO = beamLightVBO end - if unitID then targetVBO = unitBeamLightVBO end + if targetVBO == nil then + targetVBO = beamLightVBO + end + if unitID then + targetVBO = unitBeamLightVBO + end instanceID = pushElementInstance(targetVBO, lightparams, instanceID, true, noUpload, unitID) calcLightExpiry(targetVBO, lightparams, instanceID) -- This will add lights that have >0 lifetime to the removal queue return instanceID @@ -829,9 +902,7 @@ end ---@param sustain float how much sustain time the light will have at its original brightness (in game frames) ---@param selfshadowing int what further type of animation will be used ---@return instanceID for future reuse -local function AddConeLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r,g,b,a, dx,dy,dz,theta, colortime, - modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) - +local function AddConeLight(instanceID, unitID, pieceIndex, targetVBO, px_or_table, py, pz, radius, r, g, b, a, dx, dy, dz, theta, colortime, modelfactor, specular, scattering, lensflare, spawnframe, lifetime, sustain, selfshadowing) if instanceID == nil then autoLightInstanceID = autoLightInstanceID + 1 instanceID = autoLightInstanceID @@ -874,8 +945,12 @@ local function AddConeLight(instanceID, unitID, pieceIndex, targetVBO, px_or_tab noUpload = py end - if targetVBO == nil then targetVBO = coneLightVBO end - if unitID then targetVBO = unitConeLightVBO end + if targetVBO == nil then + targetVBO = coneLightVBO + end + if unitID then + targetVBO = unitConeLightVBO + end instanceID = pushElementInstance(targetVBO, lightparams, instanceID, true, noUpload, unitID) calcLightExpiry(targetVBO, lightparams, instanceID) -- This will add lights that have >0 lifetime to the removal queue return instanceID @@ -886,22 +961,28 @@ end ---Only use if you know the consequences of updating a VBO in-place! local function updateLightPosition(lightVBO, instanceID, posx, posy, posz, radius, p2x, p2y, p2z, theta) local instanceIndex = lightVBO.instanceIDtoIndex[instanceID] - if instanceIndex == nil then return nil end - instanceIndex = (instanceIndex - 1 ) * lightVBO.instanceStep + if instanceIndex == nil then + return nil + end + instanceIndex = (instanceIndex - 1) * lightVBO.instanceStep local instData = lightVBO.instanceData if posx then instData[instanceIndex + 1] = posx instData[instanceIndex + 2] = posy instData[instanceIndex + 3] = posz end - if radius then instData[instanceIndex + 4] = radius end + if radius then + instData[instanceIndex + 4] = radius + end if p2x then instData[instanceIndex + 5] = p2x instData[instanceIndex + 6] = p2y instData[instanceIndex + 7] = p2z end - if theta then instData[instanceIndex + 8] = theta end + if theta then + instData[instanceIndex + 8] = theta + end lightVBO.dirty = true return instanceIndex end @@ -910,20 +991,26 @@ end local function AddStaticLightsForUnit(unitID, unitDefID, noUpload, reason) if unitDefLights[unitDefID] then - if spGetUnitIsBeingBuilt(unitID) then return end + if spGetUnitIsBeingBuilt(unitID) then + return + end local unitDefLight = unitDefLights[unitDefID] - if unitDefLight.initComplete ~= true then -- late init + if unitDefLight.initComplete ~= true then -- late init for lightname, lightParams in pairs(unitDefLight) do - if not InitializeLight(lightParams, unitID) then return end + if not InitializeLight(lightParams, unitID) then + return + end end unitDefLight.initComplete = true end for lightname, lightParams in pairs(unitDefLight) do - if lightname ~= 'initComplete' then + if lightname ~= "initComplete" then local targetVBO = unitLightVBOMap[lightParams.lightType] - if (not spec) and lightParams.alliedOnly == true and spIsUnitAllied(unitID) == false then return end - AddLight(tostring(unitID) .. lightname, unitID, lightParams.pieceIndex, targetVBO, lightParams.lightParamTable, noUpload) + if (not spec) and lightParams.alliedOnly == true and spIsUnitAllied(unitID) == false then + return + end + AddLight(tostring(unitID) .. lightname, unitID, lightParams.pieceIndex, targetVBO, lightParams.lightParamTable, noUpload) end end end @@ -938,14 +1025,14 @@ local function RemoveUnitAttachedLights(unitID, instanceID) local numremoved = 0 if unitAttachedLights[unitID] then if instanceID and unitAttachedLights[unitID][instanceID] then - popElementInstance(unitAttachedLights[unitID][instanceID],instanceID) + popElementInstance(unitAttachedLights[unitID][instanceID], instanceID) numremoved = numremoved + 1 unitAttachedLights[unitID][instanceID] = nil else for instanceID, targetVBO in pairs(unitAttachedLights[unitID]) do if targetVBO.instanceIDtoIndex[instanceID] then numremoved = numremoved + 1 - popElementInstance(targetVBO,instanceID) + popElementInstance(targetVBO, instanceID) else --spEcho("Light attached to unit no longer is in targetVBO", unitID, instanceID, targetVBO.myName) end @@ -990,7 +1077,6 @@ local function RemoveLight(lightshape, instanceID, unitID, noUpload) return nil end - function AddRandomLight(which) local gf = gameFrame local radius = mathRandom() * 150 + 50 @@ -998,7 +1084,7 @@ function AddRandomLight(which) local posz = Game.mapSizeZ * mathRandom() * 1.0 local posy = spGetGroundHeight(posx, posz) + mathRandom() * 0.5 * radius -- randomize color - local r = mathRandom() + 0.1 --r + local r = mathRandom() + 0.1 --r local g = mathRandom() + 0.1 --g local b = mathRandom() + 0.1 --b local a = mathRandom() * 1.0 + 0.5 -- intensity or alpha @@ -1008,28 +1094,25 @@ function AddRandomLight(which) lightCacheTable[15] = 1 -- rayleigh-mie lightCacheTable[16] = 1 -- lensflare - if which < 0.33 then -- point - AddPointLight(nil, nil, nil, nil, posx, posy, posz, radius, r,g,b,a) + AddPointLight(nil, nil, nil, nil, posx, posy, posz, radius, r, g, b, a) elseif which < 0.66 then -- beam - local s = (mathRandom() - 0.5) * 500 - local t = (mathRandom() + 0.5) * 100 - local u = (mathRandom() - 0.5) * 500 - AddBeamLight(nil,nil,nil,nil, posx, posy , posz, radius, r,g,b,a, posx + s, posy + t, posz + u) + local s = (mathRandom() - 0.5) * 500 + local t = (mathRandom() + 0.5) * 100 + local u = (mathRandom() - 0.5) * 500 + AddBeamLight(nil, nil, nil, nil, posx, posy, posz, radius, r, g, b, a, posx + s, posy + t, posz + u) else -- cone - local s = (mathRandom() - 0.5) * 2 - local t = (mathRandom() + 0.0) * -1 - local u = (mathRandom() - 0.5) * 2 - local lenstu = 1.0 / mathSqrt(s*s + t*t + u*u) + local s = (mathRandom() - 0.5) * 2 + local t = (mathRandom() + 0.0) * -1 + local u = (mathRandom() - 0.5) * 2 + local lenstu = 1.0 / mathSqrt(s * s + t * t + u * u) local theta = mathRandom() * 0.9 - AddConeLight(nil,nil,nil,nil, posx, posy + radius, posz, 3* radius, r,g,b,a,s * lenstu, t * lenstu, u * lenstu, theta) + AddConeLight(nil, nil, nil, nil, posx, posy + radius, posz, 3 * radius, r, g, b, a, s * lenstu, t * lenstu, u * lenstu, theta) end - end - local function LoadLightConfig() - local success, result = pcall(VFS.Include, 'luaui/configs/DeferredLightsGL4config.lua') + local success, result = pcall(VFS.Include, "luaui/configs/DeferredLightsGL4config.lua") --spEcho("Loading GL4 light config", success, result) if success then --spEcho("Loaded GL4 light config") @@ -1037,12 +1120,11 @@ local function LoadLightConfig() unitEventLights = result.unitEventLights featureDefLights = result.featureDefLights --projectileDefLights = result.projectileDefLights - else spEcho("Failed to load GL4 Unit light config", success, result) end - local success2, result2 = pcall(VFS.Include, 'luaui/configs/DeferredLightsGL4WeaponsConfig.lua') + local success2, result2 = pcall(VFS.Include, "luaui/configs/DeferredLightsGL4WeaponsConfig.lua") --spEcho("Loading GL4 weapon light config", success2, result2) if success2 then gibLight = result2.gibLight @@ -1062,7 +1144,7 @@ local function LoadLightConfig() for weaponID, lightTable in pairs(projectileDefLights) do InitializeLight(lightTable) if not enableProjectileLightFlares and lightTable.lightParamTable then - lightTable.lightParamTable[16] = 0 -- lensflare + lightTable.lightParamTable[16] = 0 -- lensflare end end else @@ -1073,8 +1155,7 @@ end local nightFactor = 1 --0.33 local unitNightFactor = 1 -- applied above nightFactor default 1.2 -local adjustfornight = {'unitAmbientColor', 'unitDiffuseColor', 'unitSpecularColor','groundAmbientColor', 'groundDiffuseColor', 'groundSpecularColor' } - +local adjustfornight = { "unitAmbientColor", "unitDiffuseColor", "unitSpecularColor", "groundAmbientColor", "groundDiffuseColor", "groundSpecularColor" } local targetable = {} for wdid, wd in pairs(WeaponDefs) do @@ -1084,13 +1165,13 @@ for wdid, wd in pairs(WeaponDefs) do end function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) - if targetable[weaponID] and py-300 > Spring.GetGroundHeight(px, pz) then -- dont add light to (likely) intercepted explosions (mainly to curb nuke flashes) + if targetable[weaponID] and py - 300 > Spring.GetGroundHeight(px, pz) then -- dont add light to (likely) intercepted explosions (mainly to curb nuke flashes) return end if explosionLights[weaponID] then local lightParamTable = explosionLights[weaponID].lightParamTable - if explosionLights[weaponID].alwaysVisible or spIsSphereInView(px,py,pz, lightParamTable[4]) then - local groundHeight = spGetGroundHeight(px,pz) or 1 + if explosionLights[weaponID].alwaysVisible or spIsSphereInView(px, py, pz, lightParamTable[4]) then + local groundHeight = spGetGroundHeight(px, pz) or 1 py = math_max(groundHeight + (explosionLights[weaponID].yOffset or 0), py) lightParamTable[1] = px lightParamTable[2] = py @@ -1103,7 +1184,7 @@ end function widget:Barrelfire(px, py, pz, weaponID, ownerID) if muzzleFlashLights[weaponID] then local lightParamTable = muzzleFlashLights[weaponID].lightParamTable - if muzzleFlashLights[weaponID].alwaysVisible or spIsSphereInView(px,py,pz, lightParamTable[4]) then + if muzzleFlashLights[weaponID].alwaysVisible or spIsSphereInView(px, py, pz, lightParamTable[4]) then lightParamTable[1] = px lightParamTable[2] = py lightParamTable[3] = pz @@ -1116,18 +1197,26 @@ local function UnitScriptLight(unitID, unitDefID, lightIndex, param) if spValidUnitID(unitID) and spGetUnitIsDead(unitID) == false and visibleUnits[unitID] and unitEventLights.UnitScriptLights[unitDefID] and unitEventLights.UnitScriptLights[unitDefID][lightIndex] then local lightTable = unitEventLights.UnitScriptLights[unitDefID][lightIndex] if not lightTable.alwaysVisible then - local px,py,pz = spGetUnitPosition(unitID) - if px == nil or spIsSphereInView(px,py,pz, lightTable[4]) == false then return end + local px, py, pz = spGetUnitPosition(unitID) + if px == nil or spIsSphereInView(px, py, pz, lightTable[4]) == false then + return + end + end + if (not spec) and lightTable.alliedOnly == true and spIsUnitAllied(unitID) == false then + return + end + if lightTable.initComplete == nil then + InitializeLight(lightTable, unitID) end - if (not spec) and lightTable.alliedOnly == true and spIsUnitAllied(unitID) == false then return end - if lightTable.initComplete == nil then InitializeLight(lightTable, unitID) end local instanceID = tostring(unitID) .. "_" .. tostring(unitName[unitDefID]) .. "UnitScriptLight" .. tostring(lightIndex) .. "_" .. tostring(param) AddLight(instanceID, unitID, lightTable.pieceIndex, unitLightVBOMap[lightTable.lightType], lightTable.lightParamTable) end end local function GetLightVBO(vboName) - if vboName == 'cursorPointLightVBO' then return cursorPointLightVBO end + if vboName == "cursorPointLightVBO" then + return cursorPointLightVBO + end return nil end @@ -1147,7 +1236,6 @@ function widget:PlayerChanged(playerID) end end - function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) visibleUnits[unitID] = unitDefID AddStaticLightsForUnit(unitID, unitDefID, false, "VisibleUnitAdded") @@ -1175,24 +1263,30 @@ function widget:VisibleUnitRemoved(unitID) -- remove all the lights for this uni end function widget:Shutdown() - WG['lightsgl4'] = nil - widgetHandler:DeregisterGlobal('AddPointLight') - widgetHandler:DeregisterGlobal('AddBeamLight') - widgetHandler:DeregisterGlobal('AddConeLight') - widgetHandler:DeregisterGlobal('AddLight') - widgetHandler:DeregisterGlobal('RemoveLight') - widgetHandler:DeregisterGlobal('GetLightVBO') - - widgetHandler:DeregisterGlobal('EnvLightningPointLight') - widgetHandler:DeregisterGlobal('EnvNanoBallisticLightSpawn') - widgetHandler:DeregisterGlobal('EnvNanoBallisticLightCorrect') - widgetHandler:DeregisterGlobal('EnvNanoBallisticLightRemove') + WG["lightsgl4"] = nil + widgetHandler:DeregisterGlobal("AddPointLight") + widgetHandler:DeregisterGlobal("AddBeamLight") + widgetHandler:DeregisterGlobal("AddConeLight") + widgetHandler:DeregisterGlobal("AddLight") + widgetHandler:DeregisterGlobal("RemoveLight") + widgetHandler:DeregisterGlobal("GetLightVBO") + + widgetHandler:DeregisterGlobal("EnvLightningPointLight") + widgetHandler:DeregisterGlobal("EnvNanoBallisticLightSpawn") + widgetHandler:DeregisterGlobal("EnvNanoBallisticLightCorrect") + widgetHandler:DeregisterGlobal("EnvNanoBallisticLightRemove") deferredLightShader:Delete() local ram = 0 - for lighttype, vbo in pairs(unitLightVBOMap) do ram = ram + vbo:Delete() end - for lighttype, vbo in pairs(projectileLightVBOMap) do ram = ram + vbo:Delete() end - for lighttype, vbo in pairs(lightVBOMap) do ram = ram + vbo:Delete() end + for lighttype, vbo in pairs(unitLightVBOMap) do + ram = ram + vbo:Delete() + end + for lighttype, vbo in pairs(projectileLightVBOMap) do + ram = ram + vbo:Delete() + end + for lighttype, vbo in pairs(lightVBOMap) do + ram = ram + vbo:Delete() + end ram = ram + cursorPointLightVBO:Delete() ram = ram + predictivePointLightVBO:Delete() @@ -1210,12 +1304,11 @@ function widget:Shutdown() unitEventLights = nil muzzleFlashLights = nil projectileDefLights = nil - explosionLights = nil + explosionLights = nil gibLight = nil --collectgarbage("collect") --collectgarbage("collect") - end local windX = 0 @@ -1249,13 +1342,15 @@ local function eventLightSpawner(eventName, unitID, unitDefID, teamID) if spValidUnitID(unitID) and spGetUnitIsDead(unitID) == false and unitEventLights[eventName] then if unitEventLights[eventName] then -- get the default event if it is defined - local lightList = unitEventLights[eventName][unitDefID] or unitEventLights[eventName]['default'] + local lightList = unitEventLights[eventName][unitDefID] or unitEventLights[eventName]["default"] if lightList then for lightname, lightTable in pairs(lightList) do local visible = lightTable.alwaysVisible - local px,py,pz = spGetUnitPosition(unitID) + local px, py, pz = spGetUnitPosition(unitID) if not visible then - if px and spIsSphereInView(px,py,pz, lightTable[4]) then visible = true end + if px and spIsSphereInView(px, py, pz, lightTable[4]) then + visible = true + end end -- bail if only for allies @@ -1281,26 +1376,29 @@ local function eventLightSpawner(eventName, unitID, unitDefID, teamID) if lightTable.pieceName then if lightTable.aboveUnit then -- if its above the unit, then add the aboveunit offset to the units height too! -- this is done via a quick copy of the table - for i=1, lightParamTableSize do lightCacheTable[i] = lightParamTable[i] end + for i = 1, lightParamTableSize do + lightCacheTable[i] = lightParamTable[i] + end local unitHeight = spGetUnitHeight(unitID) if unitHeight == nil then local losstate = spGetUnitLosState(unitID) - spEcho("Unitheight is nil for unitID", unitID, "unitDefName", unitName[unitDefID], eventName, lightname, 'losstate', losstate and losstate.los) + spEcho("Unitheight is nil for unitID", unitID, "unitDefName", unitName[unitDefID], eventName, lightname, "losstate", losstate and losstate.los) end lightCacheTable[2] = lightCacheTable[2] + lightTable.aboveUnit + (unitHeight or 0) lightParamTable = lightCacheTable end - AddLight(eventName .. tostring(unitID) .. lightname, unitID, lightTable.pieceIndex, unitLightVBOMap[lightTable.lightType], lightParamTable) + AddLight(eventName .. tostring(unitID) .. lightname, unitID, lightTable.pieceIndex, unitLightVBOMap[lightTable.lightType], lightParamTable) else - for i=1, lightParamTableSize do lightCacheTable[i] = lightParamTable[i] end + for i = 1, lightParamTableSize do + lightCacheTable[i] = lightParamTable[i] + end lightCacheTable[1] = lightCacheTable[1] + px lightCacheTable[2] = lightParamTable[2] + py + ((lightTable.aboveUnit and spGetUnitHeight(unitID)) or 0) lightCacheTable[3] = lightCacheTable[3] + pz - AddLight(eventName .. tostring(unitID) .. lightname, nil, lightTable.pieceIndex, lightVBOMap[lightTable.lightType], lightCacheTable) + AddLight(eventName .. tostring(unitID) .. lightname, nil, lightTable.pieceIndex, lightVBOMap[lightTable.lightType], lightCacheTable) end end - end end end @@ -1318,7 +1416,7 @@ function widget:UnitCreated(unitID, unitDefID, teamID) eventLightSpawner("UnitCreated", unitID, unitDefID, teamID) end function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - eventLightSpawner("UnitFromFactory", unitID, unitDefID, teamID) -- i have no idea of the differences here + eventLightSpawner("UnitFromFactory", unitID, unitDefID, teamID) -- i have no idea of the differences here eventLightSpawner("UnitFromFactoryBuilder", factID, factDefID, teamID) end function widget:UnitDestroyed(unitID, unitDefID, teamID) -- dont do piece-attached lights here! @@ -1330,7 +1428,7 @@ end -- THIS ONE DOESNT WORK, some shit is being pulled and i cant get the unit height of the unit being taken here! --function widget:UnitTaken(unitID, unitDefID, teamID) - --eventLightSpawner("UnitTaken", unitID, unitDefID, teamID) +--eventLightSpawner("UnitTaken", unitID, unitDefID, teamID) --end function widget:UnitGiven(unitID, unitDefID, teamID) eventLightSpawner("UnitGiven", unitID, unitDefID, teamID) @@ -1352,33 +1450,40 @@ function widget:StockpileChanged(unitID, unitDefID, teamID, weaponNum, oldCount, end function widget:FeatureCreated(featureID, noUpload) - if type(noUpload) ~= 'boolean' then noUpload = nil end + if type(noUpload) ~= "boolean" then + noUpload = nil + end -- TODO: Allow team-colored feature lights by getting teamcolor and putting it into lightCacheTable local featureDefID = spGetFeatureDefID(featureID) if featureDefLights[featureDefID] then for lightname, lightTable in pairs(featureDefLights[featureDefID]) do - if not lightTable.initComplete then InitializeLight(lightTable) end + if not lightTable.initComplete then + InitializeLight(lightTable) + end local px, py, pz = spGetFeaturePosition(featureID) - if px and featureID%(lightTable.fraction or 1 ) == 0 then - + if px and featureID % (lightTable.fraction or 1) == 0 then local lightParamTable = lightTable.lightParamTable - for i=1, lightParamTableSize do lightCacheTable[i] = lightParamTable[i] end + for i = 1, lightParamTableSize do + lightCacheTable[i] = lightParamTable[i] + end lightCacheTable[1] = lightParamTable[1] + px lightCacheTable[2] = lightParamTable[2] + py lightCacheTable[3] = lightParamTable[3] + pz - AddLight(tostring(featureID) .. lightname, nil, nil, lightVBOMap[lightTable.lightType], lightCacheTable, noUpload) + AddLight(tostring(featureID) .. lightname, nil, nil, lightVBOMap[lightTable.lightType], lightCacheTable, noUpload) end end end end function widget:FeatureDestroyed(featureID, noUpload) - if type(noUpload) ~= 'boolean' then noUpload = nil end + if type(noUpload) ~= "boolean" then + noUpload = nil + end local featureDefID = spGetFeatureDefID(featureID) if featureDefLights[featureDefID] then for lightname, lightTable in pairs(featureDefLights[featureDefID]) do - if featureID % (lightTable.fraction or 1 ) == 0 then - RemoveLight(lightTable.lightType, tostring(featureID) .. lightname, nil, noUpload) + if featureID % (lightTable.fraction or 1) == 0 then + RemoveLight(lightTable.lightType, tostring(featureID) .. lightname, nil, noUpload) end end end @@ -1389,16 +1494,17 @@ end local function PrintProjectileInfo(projectileID) local px, py, pz = spGetProjectilePosition(projectileID) local weapon, piece = Spring.GetProjectileType(projectileID) - local weaponDefID = weapon and Spring.GetProjectileDefID ( projectileID ) + local weaponDefID = weapon and Spring.GetProjectileDefID(projectileID) Spring.Debug.TraceFullEcho() end - local function updateProjectileLights(newgameframe) local nowprojectiles = Spring.GetVisibleProjectiles() gameFrame = spGetGameFrame() local newgameframe = true - if gameFrame == lastGameFrame then newgameframe = false end + if gameFrame == lastGameFrame then + newgameframe = false + end --spEcho(gameFrame, lastGameFrame, newgameframe) lastGameFrame = gameFrame -- turn off uploading vbo @@ -1406,22 +1512,22 @@ local function updateProjectileLights(newgameframe) -- BUG: having a lifetime associated with each projectile kind of bugs out updates local numadded = 0 local noUpload = true - for i= 1, #nowprojectiles do + for i = 1, #nowprojectiles do local projectileID = nowprojectiles[i] local px, py, pz = spGetProjectilePosition(projectileID) if px then -- we are somehow getting projectiles with no position? - local lightType = 'point' -- default + local lightType = "point" -- default if trackedProjectiles[projectileID] then if newgameframe then --update proj pos lightType = trackedProjectileTypes[projectileID] - if lightType ~= 'beam' then - local dx,dy,dz = spGetProjectileVelocity(projectileID) - local instanceIndex = updateLightPosition(projectileLightVBOMap[lightType], - projectileID, px,py,pz, nil, dx,dy,dz) - if debugproj then spEcho("Updated", instanceIndex, projectileID, px, py, pz,dx,dy,dz) end + if lightType ~= "beam" then + local dx, dy, dz = spGetProjectileVelocity(projectileID) + local instanceIndex = updateLightPosition(projectileLightVBOMap[lightType], projectileID, px, py, pz, nil, dx, dy, dz) + if debugproj then + spEcho("Updated", instanceIndex, projectileID, px, py, pz, dx, dy, dz) + end end - end else -- add projectile @@ -1433,20 +1539,21 @@ local function updateProjectileLights(newgameframe) gib[3] = pz AddLight(projectileID, nil, nil, projectilePointLightVBO, gib, noUpload) else - local weaponDefID = spGetProjectileDefID ( projectileID ) - if projectileDefLights[weaponDefID] and ( projectileID % (projectileDefLights[weaponDefID].fraction or 1) == 0 ) then + local weaponDefID = spGetProjectileDefID(projectileID) + if projectileDefLights[weaponDefID] and (projectileID % (projectileDefLights[weaponDefID].fraction or 1) == 0) then local lightParamTable = projectileDefLights[weaponDefID].lightParamTable lightType = projectileDefLights[weaponDefID].lightType - lightParamTable[1] = px lightParamTable[2] = py lightParamTable[3] = pz - if debugproj then spEcho(lightType, projectileDefLights[weaponDefID].lightClassName) end + if debugproj then + spEcho(lightType, projectileDefLights[weaponDefID].lightClassName) + end - local dx,dy,dz = spGetProjectileVelocity(projectileID) + local dx, dy, dz = spGetProjectileVelocity(projectileID) - if lightType == 'beam' then + if lightType == "beam" then lightParamTable[5] = px + dx lightParamTable[6] = py + dy lightParamTable[7] = pz + dz @@ -1456,9 +1563,11 @@ local function updateProjectileLights(newgameframe) lightParamTable[6] = dy lightParamTable[7] = dz end - if debugproj then spEcho(lightType, px,py,pz, dx, dy,dz) end + if debugproj then + spEcho(lightType, px, py, pz, dx, dy, dz) + end - AddLight(projectileID, nil, nil, projectileLightVBOMap[lightType], lightParamTable,noUpload) + AddLight(projectileID, nil, nil, projectileLightVBOMap[lightType], lightParamTable, noUpload) --AddLight(projectileID, nil, nil, projectilePointLightVBO, lightParamTable) else --spEcho("No projectile light defined for", projectileID, weaponDefID, px, pz) @@ -1488,10 +1597,9 @@ local function updateProjectileLights(newgameframe) local px, py, pz = spGetProjectilePosition(projectileID) if px then -- this means that this projectile local lightType = trackedProjectileTypes[projectileID] - if newgameframe and lightType ~= 'beam' then - local dx,dy,dz = spGetProjectileVelocity(projectileID) - updateLightPosition(projectileLightVBOMap[lightType], - projectileID, px,py,pz, nil, dx,dy,dz ) + if newgameframe and lightType ~= "beam" then + local dx, dy, dz = spGetProjectileVelocity(projectileID) + updateLightPosition(projectileLightVBOMap[lightType], projectileID, px, py, pz, nil, dx, dy, dz) end else numremoved = numremoved + 1 @@ -1500,7 +1608,9 @@ local function updateProjectileLights(newgameframe) --RemoveLight('point', projectileID, nil) if projectileLightVBOMap[lightType].instanceIDtoIndex[projectileID] then -- god the indirections here ... local success = popElementInstance(projectileLightVBOMap[lightType], projectileID, noUpload) - if success == nil then PrintProjectileInfo(projectileID) end + if success == nil then + PrintProjectileInfo(projectileID) + end end trackedProjectileTypes[projectileID] = nil end @@ -1520,20 +1630,20 @@ end local AUTOUPDATE_CONFIG_POLL_INTERVAL = 1.5 local AUTOUPDATE_SHADER_POLL_INTERVAL = 0.5 -local configCache = {lastUpdate = spGetTimer()} -local shaderUpdateCache = {lastUpdate = spGetTimer()} +local configCache = { lastUpdate = spGetTimer() } +local shaderUpdateCache = { lastUpdate = spGetTimer() } local function checkConfigUpdates() local now = spGetTimer() if spDiffTimers(now, configCache.lastUpdate) <= AUTOUPDATE_CONFIG_POLL_INTERVAL then return end - local newconfa = VFS.LoadFile('luaui/configs/DeferredLightsGL4config.lua') - local newconfb = VFS.LoadFile('luaui/configs/DeferredLightsGL4WeaponsConfig.lua') + local newconfa = VFS.LoadFile("luaui/configs/DeferredLightsGL4config.lua") + local newconfb = VFS.LoadFile("luaui/configs/DeferredLightsGL4WeaponsConfig.lua") if newconfa ~= configCache.confa or newconfb ~= configCache.confb then LoadLightConfig() - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end local allFeatures = spGetAllFeatures() local allFeaturesLen = #allFeatures @@ -1543,7 +1653,9 @@ local function checkConfigUpdates() for i = 1, allFeaturesLen do widget:FeatureCreated(allFeatures[i], true) end - if pointLightVBO.dirty then uploadAllElements(pointLightVBO) end + if pointLightVBO.dirty then + uploadAllElements(pointLightVBO) + end configCache.confa = newconfa configCache.confb = newconfb end @@ -1553,20 +1665,22 @@ end local expavg = 0 local sec = 1 function widget:Update(dt) - if autoupdate then checkConfigUpdates() end + if autoupdate then + checkConfigUpdates() + end local tus = spGetTimerMicros() if predictivePointLightVBO.dirty then uploadAllElements(predictivePointLightVBO) end -- update/handle Cursor Lights! - if WG['allycursors'] and WG['allycursors'].getLights() then + if WG["allycursors"] and WG["allycursors"].getLights() then sec = sec + dt if sec >= 0.25 then - if cursorLightAlpha ~= WG['allycursors'].getLightStrength() or cursorLightRadius ~= WG['allycursors'].getLightRadius() or cursorLightSelfShadowing ~= WG['allycursors'].getLightSelfShadowing() then - cursorLightAlpha = WG['allycursors'].getLightStrength() - cursorLightRadius = WG['allycursors'].getLightRadius() - cursorLightSelfShadowing = WG['allycursors'].getLightSelfShadowing() + if cursorLightAlpha ~= WG["allycursors"].getLightStrength() or cursorLightRadius ~= WG["allycursors"].getLightRadius() or cursorLightSelfShadowing ~= WG["allycursors"].getLightSelfShadowing() then + cursorLightAlpha = WG["allycursors"].getLightStrength() + cursorLightRadius = WG["allycursors"].getLightRadius() + cursorLightSelfShadowing = WG["allycursors"].getLightSelfShadowing() InstanceVBOTable.clearInstanceTable(cursorPointLightVBO) cursorLights = nil end @@ -1574,26 +1688,26 @@ function widget:Update(dt) if not cursorLights then cursorLights = {} end - local cursors, notIdle = WG['allycursors'].getCursors() - local isCursorVisible = WG['allycursors'].isCursorVisible + local cursors, notIdle = WG["allycursors"].getCursors() + local isCursorVisible = WG["allycursors"].isCursorVisible for playerID, cursor in pairs(cursors) do local teamColor = teamColors[playerID] local visibleToViewer = (not isCursorVisible) or isCursorVisible(playerID) if teamColor and not cursor[8] and notIdle[playerID] and visibleToViewer then if not cursorLights[playerID] and not cursor[8] then - local params = cursorLightParams.lightParamTable -- see lightParamKeyOrder for which key contains what + local params = cursorLightParams.lightParamTable -- see lightParamKeyOrder for which key contains what params[1], params[2], params[3] = cursor[1], cursor[2] + cursorLightHeight, cursor[3] params[4] = cursorLightRadius * 250 params[9], params[10], params[11] = teamColor[1], teamColor[2], teamColor[3] params[12] = cursorLightAlpha * 0.2 params[20] = cursorLightSelfShadowing and 8 or 0 - cursorLights[playerID] = AddLight(nil, nil, nil, cursorPointLightVBO, params) --pointLightVBO + cursorLights[playerID] = AddLight(nil, nil, nil, cursorPointLightVBO, params) --pointLightVBO else if cursor[8] or cursor[7] < 0.01 then popElementInstance(cursorPointLightVBO, cursorLights[playerID]) cursorLights[playerID] = nil else - updateLightPosition(cursorPointLightVBO, cursorLights[playerID], cursor[1], cursor[2]+cursorLightHeight, cursor[3]) + updateLightPosition(cursorPointLightVBO, cursorLights[playerID], cursor[1], cursor[2] + cursorLightHeight, cursor[3]) end end elseif cursorLights[playerID] then @@ -1611,11 +1725,11 @@ function widget:Update(dt) -- This is the player cursor! if showPlayerCursorLight then - local mx,my,m1,m2,m3, _ , camPanning = spGetMouseState() + local mx, my, m1, m2, m3, _, camPanning = spGetMouseState() local traceType, tracedScreenRay = spTraceScreenRay(mx, my, true) if not camPanning and tracedScreenRay ~= nil then local params = playerCursorLightParams.lightParamTable - params[1], params[2], params[3] = tracedScreenRay[1],tracedScreenRay[2] + cursorLightHeight,tracedScreenRay[3] + params[1], params[2], params[3] = tracedScreenRay[1], tracedScreenRay[2] + cursorLightHeight, tracedScreenRay[3] params[4] = playerCursorLightRadius * 250 params[12] = playerCursorLightBrightness * 0.1 AddLight("PLAYERCURSOR", nil, nil, cursorPointLightVBO, params) @@ -1627,18 +1741,19 @@ function widget:Update(dt) end updateProjectileLights() - expavg = expavg * 0.98 + 0.02 * spDiffTimers(spGetTimerMicros(),tus) + expavg = expavg * 0.98 + 0.02 * spDiffTimers(spGetTimerMicros(), tus) --if spGetGameFrame() % 120 ==0 then spEcho("Update is on average", expavg,'ms') end end ------------------------------- Drawing all the lights --------------------------------- - -- local tf = Spring.GetTimerMicros() function widget:DrawWorld() -- We are drawing in world space, probably a bad idea but hey --local t0 = Spring.GetTimerMicros() --if true then return end - if skipdraw then return end + if skipdraw then + return + end if autoupdate then local now = spGetTimer() if spDiffTimers(now, shaderUpdateCache.lastUpdate) > AUTOUPDATE_SHADER_POLL_INTERVAL then @@ -1647,36 +1762,28 @@ function widget:DrawWorld() -- We are drawing in world space, probably a bad ide end end - if pointLightVBO.usedElements > 0 or - predictivePointLightVBO.usedElements > 0 or - unitPointLightVBO.usedElements > 0 or - beamLightVBO.usedElements > 0 or - unitConeLightVBO.usedElements > 0 or - coneLightVBO.usedElements > 0 or - cursorPointLightVBO.usedElements > 0 - then - + if pointLightVBO.usedElements > 0 or predictivePointLightVBO.usedElements > 0 or unitPointLightVBO.usedElements > 0 or beamLightVBO.usedElements > 0 or unitConeLightVBO.usedElements > 0 or coneLightVBO.usedElements > 0 or cursorPointLightVBO.usedElements > 0 then local alt, ctrl = spGetModKeyState() - local devui = (spGetConfigInt('DevUI', 0) == 1) + local devui = (spGetConfigInt("DevUI", 0) == 1) if autoupdate and alt and ctrl and (isSinglePlayer or spec) and devui then -- draw a full-screen black quad first! local camX, camY, camZ = spGetCameraPosition() - local camDirX,camDirY,camDirZ = spGetCameraDirection() + local camDirX, camDirY, camDirZ = spGetCameraDirection() glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glCulling(GL_BACK) glDepthTest(false) glDepthMask(false) --"BK OpenGL state resets", default is already false, could remove - glColor(0,0,0,1) + glColor(0, 0, 0, 1) glPushMatrix() - glColor(0,0,0,1.0) - glTranslate(camX+(camDirX*360),camY+(camDirY*360),camZ+(camDirZ*360)) + glColor(0, 0, 0, 1.0) + glTranslate(camX + (camDirX * 360), camY + (camDirY * 360), camZ + (camDirZ * 360)) glBillboard() glRect(-5000, -5000, 5000, 5000) glPopMatrix() end - if autoupdate and ctrl and (not alt) and (isSinglePlayer or spec) and devui then + if autoupdate and ctrl and not alt and (isSinglePlayer or spec) and devui then glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) else glBlending(GL_SRC_ALPHA, GL_ONE) @@ -1706,12 +1813,11 @@ function widget:DrawWorld() -- We are drawing in world space, probably a bad ide -- As the setting goes from 0 to 4, map to 0,8,16,32,64 local screenSpaceShadowSampleCount = 0 if screenSpaceShadows > 0 then - screenSpaceShadowSampleCount = mathMin(64, mathFloor( mathPow(2, screenSpaceShadows) * 4) ) + screenSpaceShadowSampleCount = mathMin(64, mathFloor(mathPow(2, screenSpaceShadows) * 4)) end - deferredLightShader:SetUniformInt("screenSpaceShadows", screenSpaceShadowSampleCount) + deferredLightShader:SetUniformInt("screenSpaceShadows", screenSpaceShadowSampleCount) --spEcho(windX, windZ) - -- Fixed worldpos lights, cursors, projectiles, world lights deferredLightShader:SetUniformFloat("attachedtounitID", 0) -- worldpos stuff deferredLightShader:SetUniformFloat("pointbeamcone", 0) @@ -1724,7 +1830,6 @@ function widget:DrawWorld() -- We are drawing in world space, probably a bad ide predictivePointLightVBO:draw() projectilePointLightVBO:draw() - deferredLightShader:SetUniformFloat("pointbeamcone", 1) beamLightVBO:draw() projectileBeamLightVBO:draw() @@ -1747,7 +1852,9 @@ function widget:DrawWorld() -- We are drawing in world space, probably a bad ide deferredLightShader:Deactivate() - for i = 0, 8 do glTexture(i, false) end + for i = 0, 8 do + glTexture(i, false) + end glCulling(GL_BACK) glDepthTest(true) --gl.DepthMask(true) --"BK OpenGL state resets", was true but now commented out (redundant set of false states) @@ -1764,12 +1871,7 @@ end -- Register /luaui dlgl4stats to dump light statistics function widget:TextCommand(command) if stringFind(command, "dlgl4stats", nil, true) then - spEcho(stringFormat("DLGLStats Total = %d , (PBC=%d,%d,%d), (unitPBC=%d,%d,%d), (projPBC=%d,%d,%d), Cursor = %d", - numAddLights, - pointLightVBO.usedElements, beamLightVBO.usedElements, coneLightVBO.usedElements, - unitPointLightVBO.usedElements, unitBeamLightVBO.usedElements, unitConeLightVBO.usedElements, - projectilePointLightVBO.usedElements, projectileBeamLightVBO.usedElements, projectileConeLightVBO.usedElements, - cursorPointLightVBO.usedElements)) + spEcho(stringFormat("DLGLStats Total = %d , (PBC=%d,%d,%d), (unitPBC=%d,%d,%d), (projPBC=%d,%d,%d), Cursor = %d", numAddLights, pointLightVBO.usedElements, beamLightVBO.usedElements, coneLightVBO.usedElements, unitPointLightVBO.usedElements, unitBeamLightVBO.usedElements, unitConeLightVBO.usedElements, projectilePointLightVBO.usedElements, projectileBeamLightVBO.usedElements, projectileConeLightVBO.usedElements, cursorPointLightVBO.usedElements)) return true end if stringFind(command, "dlgl4skipdraw", nil, true) then @@ -1781,10 +1883,9 @@ function widget:TextCommand(command) end function widget:Initialize() - Spring.Debug.TraceEcho("Initialize DLGL4") - if spGetConfigString("AllowDeferredMapRendering") == '0' or spGetConfigString("AllowDeferredModelRendering") == '0' then - spEcho('Deferred Rendering (gfx_deferred_rendering.lua) requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!') + if spGetConfigString("AllowDeferredMapRendering") == "0" or spGetConfigString("AllowDeferredModelRendering") == "0" then + spEcho("Deferred Rendering (gfx_deferred_rendering.lua) requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!") widgetHandler:RemoveWidget() return end @@ -1793,18 +1894,20 @@ function widget:Initialize() return end - if initGL4() == false then return end + if initGL4() == false then + return + end - local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs if nightFactor ~= 1 then local nightLightingParams = {} - for _,v in ipairs(adjustfornight) do + for _, v in ipairs(adjustfornight) do nightLightingParams[v] = mapinfo.lighting[stringLower(v)] if nightLightingParams[v] ~= nil then for k2, v2 in pairs(nightLightingParams[v]) do if tonumber(v2) then - if stringFind(v, 'unit', nil, true) then + if stringFind(v, "unit", nil, true) then nightLightingParams[v][k2] = v2 * nightFactor * unitNightFactor else nightLightingParams[v][k2] = v2 * nightFactor @@ -1812,7 +1915,7 @@ function widget:Initialize() end end else - spEcho("Deferred Lights GL4: Warning: This map does not specify ",v, "in mapinfo.lua!") + spEcho("Deferred Lights GL4: Warning: This map does not specify ", v, "in mapinfo.lua!") end end spSetSunLighting(nightLightingParams) @@ -1820,11 +1923,13 @@ function widget:Initialize() if addrandomlights then math.randomseed(1) - for i=1, 1 do AddRandomLight( mathRandom()) end + for i = 1, 1 do + AddRandomLight(mathRandom()) + end end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end local allFeatures = spGetAllFeatures() @@ -1833,44 +1938,44 @@ function widget:Initialize() widget:FeatureCreated(allFeatures[i]) end - WG['lightsgl4'] = {} - WG['lightsgl4'].AddPointLight = AddPointLight - WG['lightsgl4'].AddBeamLight = AddBeamLight - WG['lightsgl4'].AddConeLight = AddConeLight - WG['lightsgl4'].AddLight = AddLight - WG['lightsgl4'].RemoveLight = RemoveLight - WG['lightsgl4'].GetLightVBO = GetLightVBO + WG["lightsgl4"] = {} + WG["lightsgl4"].AddPointLight = AddPointLight + WG["lightsgl4"].AddBeamLight = AddBeamLight + WG["lightsgl4"].AddConeLight = AddConeLight + WG["lightsgl4"].AddLight = AddLight + WG["lightsgl4"].RemoveLight = RemoveLight + WG["lightsgl4"].GetLightVBO = GetLightVBO - WG['lightsgl4'].IntensityMultiplier = function(value) + WG["lightsgl4"].IntensityMultiplier = function(value) intensityMultiplier = value end - WG['lightsgl4'].RadiusMultiplier = function(value) + WG["lightsgl4"].RadiusMultiplier = function(value) radiusMultiplier = value end - WG['lightsgl4'].ScreenSpaceShadows = function(value) + WG["lightsgl4"].ScreenSpaceShadows = function(value) screenSpaceShadows = value end - WG['lightsgl4'].ShowPlayerCursorLight = function(value) + WG["lightsgl4"].ShowPlayerCursorLight = function(value) showPlayerCursorLight = value -- Remove the player's cursor light on disabling this feature if not showPlayerCursorLight and cursorPointLightVBO.instanceIDtoIndex["PLAYERCURSOR"] then popElementInstance(cursorPointLightVBO, "PLAYERCURSOR") end end - WG['lightsgl4'].PlayerCursorLightRadius = function(value) + WG["lightsgl4"].PlayerCursorLightRadius = function(value) playerCursorLightRadius = value end - WG['lightsgl4'].PlayerCursorLightBrightness = function(value) + WG["lightsgl4"].PlayerCursorLightBrightness = function(value) playerCursorLightBrightness = value end - widgetHandler:RegisterGlobal('AddPointLight', WG['lightsgl4'].AddPointLight) - widgetHandler:RegisterGlobal('AddBeamLight', WG['lightsgl4'].AddBeamLight) - widgetHandler:RegisterGlobal('AddConeLight', WG['lightsgl4'].AddConeLight) - widgetHandler:RegisterGlobal('AddLight', WG['lightsgl4'].AddLight) - widgetHandler:RegisterGlobal('RemoveLight', WG['lightsgl4'].RemoveLight) - widgetHandler:RegisterGlobal('GetLightVBO', WG['lightsgl4'].GetLightVBO) + widgetHandler:RegisterGlobal("AddPointLight", WG["lightsgl4"].AddPointLight) + widgetHandler:RegisterGlobal("AddBeamLight", WG["lightsgl4"].AddBeamLight) + widgetHandler:RegisterGlobal("AddConeLight", WG["lightsgl4"].AddConeLight) + widgetHandler:RegisterGlobal("AddLight", WG["lightsgl4"].AddLight) + widgetHandler:RegisterGlobal("RemoveLight", WG["lightsgl4"].RemoveLight) + widgetHandler:RegisterGlobal("GetLightVBO", WG["lightsgl4"].GetLightVBO) -- Gadget bridge: gfx_environmental_lightning_gl4 (a gadget, no WG access) flashes -- a short-lived point light at each lightning burst origin via Script.LuaUI. @@ -1879,49 +1984,83 @@ function widget:Initialize() -- does not animate toward black; sustain holds full brightness before the fade. -- Args: x,y,z, radius, r,g,b,a, lifetime, sustain, modelfactor, specular, -- scattering, lensflare, spawnframe. - WG['lightsgl4'].EnvLightningPointLight = function(x, y, z, radius, r, g, b, a, - lifetime, sustain, modelfactor, specular, scattering, lensflare, spawnframe) - AddPointLight(nil, nil, nil, pointLightVBO, - x, y, z, radius, - r, g, b, a, -- color + brightness - r, g, b, 0, -- r2,g2,b2 = same color, colortime 0 - modelfactor, specular, scattering, lensflare, -- light surface response - spawnframe, lifetime, sustain) -- spawnframe, lifetime, sustain (auto-expire) + WG["lightsgl4"].EnvLightningPointLight = function(x, y, z, radius, r, g, b, a, lifetime, sustain, modelfactor, specular, scattering, lensflare, spawnframe) + AddPointLight( + nil, + nil, + nil, + pointLightVBO, + x, + y, + z, + radius, + r, + g, + b, + a, -- color + brightness + r, + g, + b, + 0, -- r2,g2,b2 = same color, colortime 0 + modelfactor, + specular, + scattering, + lensflare, -- light surface response + spawnframe, + lifetime, + sustain + ) -- spawnframe, lifetime, sustain (auto-expire) end - widgetHandler:RegisterGlobal('EnvLightningPointLight', WG['lightsgl4'].EnvLightningPointLight) + widgetHandler:RegisterGlobal("EnvLightningPointLight", WG["lightsgl4"].EnvLightningPointLight) -- Gadget bridge: predictive nano point lights. Gadget sends one spawn event -- per selected particle, plus sparse correction events when trajectory -- changes (homing / terrain correction). Widget integrates in-between. - WG['lightsgl4'].EnvNanoBallisticLightSpawn = function(instanceID, - x, y, z, vx, vy, vz, - radius, r, g, b, a, - lifetime, sustain, - modelfactor, specular, scattering, lensflare, - spawnframe, - updateEvery, - correctionMinFrames) + WG["lightsgl4"].EnvNanoBallisticLightSpawn = function(instanceID, x, y, z, vx, vy, vz, radius, r, g, b, a, lifetime, sustain, modelfactor, specular, scattering, lensflare, spawnframe, updateEvery, correctionMinFrames) if not instanceID or not lifetime or lifetime < 1 then return false end local sf = spawnframe or gameFrame local lightparams = { - x, y, z, radius, - vx, vy, vz, 1.0, - r, g, b, a, - modelfactor or 0.35, specular or 0.15, scattering or 0.25, lensflare or 0, - sf, lifetime, sustain or lifetime, 0, - r, g, b, 0, + x, + y, + z, + radius, + vx, + vy, + vz, + 1.0, + r, + g, + b, + a, + modelfactor or 0.35, + specular or 0.15, + scattering or 0.25, + lensflare or 0, + sf, + lifetime, + sustain or lifetime, + 0, + r, + g, + b, + 0, + 0, + 0, + 0, + 0, 0, - 0, 0, 0, 0, } AddLight(instanceID, nil, nil, predictivePointLightVBO, lightparams) return true end - WG['lightsgl4'].EnvNanoBallisticLightCorrect = function(instanceID, x, y, z, vx, vy, vz, frame) + WG["lightsgl4"].EnvNanoBallisticLightCorrect = function(instanceID, x, y, z, vx, vy, vz, frame) local f = frame or gameFrame local instanceIndex = predictivePointLightVBO.instanceIDtoIndex[instanceID] - if not instanceIndex then return false end + if not instanceIndex then + return false + end if instanceIndex then instanceIndex = (instanceIndex - 1) * predictivePointLightVBO.instanceStep local instData = predictivePointLightVBO.instanceData @@ -1937,20 +2076,22 @@ function widget:Initialize() end return true end - WG['lightsgl4'].EnvNanoBallisticLightRemove = function(instanceID) + WG["lightsgl4"].EnvNanoBallisticLightRemove = function(instanceID) if predictivePointLightVBO.instanceIDtoIndex[instanceID] then popElementInstance(predictivePointLightVBO, instanceID) end return true end - widgetHandler:RegisterGlobal('EnvNanoBallisticLightSpawn', WG['lightsgl4'].EnvNanoBallisticLightSpawn) - widgetHandler:RegisterGlobal('EnvNanoBallisticLightCorrect', WG['lightsgl4'].EnvNanoBallisticLightCorrect) - widgetHandler:RegisterGlobal('EnvNanoBallisticLightRemove', WG['lightsgl4'].EnvNanoBallisticLightRemove) + widgetHandler:RegisterGlobal("EnvNanoBallisticLightSpawn", WG["lightsgl4"].EnvNanoBallisticLightSpawn) + widgetHandler:RegisterGlobal("EnvNanoBallisticLightCorrect", WG["lightsgl4"].EnvNanoBallisticLightCorrect) + widgetHandler:RegisterGlobal("EnvNanoBallisticLightRemove", WG["lightsgl4"].EnvNanoBallisticLightRemove) end if autoupdate then function widget:DrawScreen() - if deferredLightShader.DrawPrintf then deferredLightShader.DrawPrintf() end + if deferredLightShader.DrawPrintf then + deferredLightShader.DrawPrintf() + end end end diff --git a/luaui/Widgets/gfx_distortion_gl4.lua b/luaui/Widgets/gfx_distortion_gl4.lua index 89204ab158f..9465e99ab1e 100644 --- a/luaui/Widgets/gfx_distortion_gl4.lua +++ b/luaui/Widgets/gfx_distortion_gl4.lua @@ -10,11 +10,10 @@ function widget:GetInfo() license = "GNU GPL v2", layer = -999999999, -- should be the last call of DrawWorld enabled = true, - depends = {'gl4'}, + depends = { "gl4" }, } end - -- Localized functions for performance local mathMax = math.max local mathFloor = math.floor @@ -69,22 +68,21 @@ local glLoadFont = gl.LoadFont -------------------------------- Notes, TODO ---------------------------------- do --- --- Rendering passes: --- 1. Render all distortion effects to a screen-sized buffer, DistortionTexture --- 1.1 Call widget:DrawDistortion(textureset) --- --- 2. Perform the distortion pass, + -- + -- Rendering passes: + -- 1. Render all distortion effects to a screen-sized buffer, DistortionTexture + -- 1.1 Call widget:DrawDistortion(textureset) + -- + -- 2. Perform the distortion pass, -- inputs are DistortionTexture, Depth Buffers, ScreenCopy -- Output is the final screen --- Perform a compression pass on distortionParams, culling idents + -- Perform a compression pass on distortionParams, culling idents end ----------------------------- Localize for optmization ------------------------------------ local glBlending = gl.Blending local glTexture = gl.Texture - -- Strong: local spGetProjectilePosition = Spring.GetProjectilePosition local spGetProjectileVelocity = Spring.GetProjectileVelocity @@ -92,12 +90,11 @@ local spGetProjectileType = Spring.GetProjectileType local spGetPieceProjectileParams = Spring.GetPieceProjectileParams local spGetProjectileDefID = Spring.GetProjectileDefID local spGetGroundHeight = Spring.GetGroundHeight -local spIsSphereInView = Spring.IsSphereInView -local spGetUnitPosition = Spring.GetUnitPosition +local spIsSphereInView = Spring.IsSphereInView +local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitIsDead = Spring.GetUnitIsDead local spValidUnitID = Spring.ValidUnitID - -- Weak: local spIsGUIHidden = Spring.IsGUIHidden @@ -119,10 +116,10 @@ local skipdraw = false local unitDefDistortions local featureDefDistortions local unitEventDistortions -- Table of distortions per unitDefID -local muzzleFlashDistortions -- one distortion per weaponDefID -local projectileDefDistortions -- one distortion per weaponDefID -local explosionDistortions -- one distortion per weaponDefID -local gibDistortion -- one distortion for all pieceprojectiles +local muzzleFlashDistortions -- one distortion per weaponDefID +local projectileDefDistortions -- one distortion per weaponDefID +local explosionDistortions -- one distortion per weaponDefID +local gibDistortion -- one distortion for all pieceprojectiles local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() @@ -138,7 +135,7 @@ local radiusMultiplier = 1.0 local intensityMultiplier = 1.0 -- the 3d noise texture used for this shader -local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" +local noisetex3dcube = "LuaUI/images/noisetextures/noise64_cube_3.dds" ------------------------------ Data structures and management variables ------------ @@ -155,12 +152,12 @@ local unitBeamDistortionVBO = {} -- an instanceVBOTable local unitDistortionVBOMap -- a table of the above 3, keyed by distortion type, {point = unitPointDistortionVBO, ...} local unitAttachedDistortions = {} -- this is a table mapping unitID's to all their attached instanceIDs and vbos - --{unitID = { instanceID = targetVBO, ... }} +--{unitID = { instanceID = targetVBO, ... }} local visibleUnits = {} -- this is a proxy for the widget callins, used to ensure we dont add unitscriptdistortions to units that are not visible -- these will be separate, as they need per-frame updates! -local projectilePointDistortionVBO = {} -- for plasma balls -local projectileBeamDistortionVBO = {} -- for lasers +local projectilePointDistortionVBO = {} -- for plasma balls +local projectileBeamDistortionVBO = {} -- for lasers local projectileConeDistortionVBO = {} -- for rockets local projectileDistortionVBOMap -- a table of the above 3, keyed by distortion type @@ -170,7 +167,9 @@ local unitDefPeiceMapCache = {} -- maps unitDefID to piecemap local distortionParamTableSize = 29 local distortionCacheTable = {} -- this is a reusable table cache for saving memory later on -for i = 1, distortionParamTableSize do distortionCacheTable[i] = 0 end +for i = 1, distortionParamTableSize do + distortionCacheTable[i] = 0 +end local pieceIndexPos = 25 local spawnFramePos = 17 distortionCacheTable[13] = 1 --modelfactor_specular_scattering_lensflare @@ -192,17 +191,23 @@ local distortionEffectTypes = { motionBlur = 11, tachyonBeam = 12, distortionCircleGround = 13, - } local distortionParamKeyOrder = { -- This table is a 'quick-ish' way of building the lua array from human-readable distortion parameters -- worldposrad: - posx = 1, posy = 2, posz = 3, radius = 4, + posx = 1, + posy = 2, + posz = 3, + radius = 4, -- worldposrad2: - dirx = 5, diry = 6, dirz = 7, theta = 8, -- cones: specify direction and half-angle in radians - pos2x = 5, pos2y = 6, pos2z = 7, -- beam distortions only, specifies the endpoint of the beam - + dirx = 5, + diry = 6, + dirz = 7, + theta = 8, -- cones: specify direction and half-angle in radians + pos2x = 5, + pos2y = 6, + pos2z = 7, -- beam distortions only, specifies the endpoint of the beam -- baseparams yoffset = 9, -- the offset along the y axis for this effect @@ -211,46 +216,50 @@ local distortionParamKeyOrder = { -- This table is a 'quick-ish' way of building unused = 12, -- universalParams - noiseStrength = 13, noiseScaleSpace = 14, distanceFalloff = 15, onlyModelMap = 16, + noiseStrength = 13, + noiseScaleSpace = 14, + distanceFalloff = 15, + onlyModelMap = 16, -- lifeParams: --spawnFrame = 17, is reserved! - lifeTime = 18, rampUp = 19, decay = 20, + lifeTime = 18, + rampUp = 19, + decay = 20, -- effectParams effectParam1 = 21, riseRate = 21, -- note how riseRate is identical to effectParam1 for clarity - shockWidth = 21, -- note how width is identical to effectParam1 for clarity + shockWidth = 21, -- note how width is identical to effectParam1 for clarity magnificationRate = 21, - effectParam2 = 22, --note how refractiveIndex is identical to effectParam2 for clarity + effectParam2 = 22, --note how refractiveIndex is identical to effectParam2 for clarity refractiveIndex = 22, - windAffected = 23, effectType = 24, + windAffected = 23, + effectType = 24, --color2r = 21, color2g = 22, color2b = 23, colortime = 24, -- point distortions only, colortime in seconds for unit-attached } local autoDistortionInstanceID = 128000 -- as MAX_PROJECTILES = 128000, so they get unique ones - local gameFrame = 0 local trackedProjectiles = {} -- used or finding out which projectiles can be culled {projectileID = updateFrame, ...} local trackedProjectileTypes = {} -- we have to track the types [point, distortion, cone] of projectile distortions for efficient updates local lastGameFrame = -2 - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements -local popElementInstance = InstanceVBOTable.popElementInstance +local uploadAllElements = InstanceVBOTable.uploadAllElements +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local deferredDistortionShader = nil local distortionShaderSourceCache = { - shaderName = 'Deferred Distortions GL4', + shaderName = "Deferred Distortions GL4", vssrcpath = "LuaUI/Shaders/distortion_gl4.vert.glsl", fssrcpath = "LuaUI/Shaders/distortion_gl4.frag.glsl", shaderConfig = shaderConfig, @@ -262,19 +271,18 @@ local distortionShaderSourceCache = { mapDiffuse = 4, modelDiffuse = 5, noise3DCube = 6, - }, + }, uniformFloat = { pointbeamcone = 0, --fadeDistance = 3000, attachedtounitID = 0, nightFactor = 1.0, - windXZ = {0,0}, + windXZ = { 0, 0 }, radiusMultiplier = 1.0, intensityMultiplier = 1.0, - }, + }, } - local numAddDistortions = 0 -- how many times AddDistortion was called local spec = spGetSpectatingState() @@ -286,7 +294,7 @@ local ScreenCopy -- RGBA 8bit local screenDistortionShader = nil local screenDistortionShaderSourceCache = { - shaderName = 'ScreenDistortionShader GL4', + shaderName = "ScreenDistortionShader GL4", vssrcpath = "LuaUI/Shaders/screen_distortion_combine_gl4.vert.glsl", fssrcpath = "LuaUI/Shaders/screen_distortion_combine_gl4.frag.glsl", shaderConfig = shaderConfig, @@ -295,24 +303,25 @@ local screenDistortionShaderSourceCache = { modelDepths = 1, screenCopyTexture = 2, distortionTexture = 3, - }, + }, uniformFloat = { distortionStrength = 1.0, - }, + }, } local fullScreenQuadVAO = nil ---------------------- INITIALIZATION FUNCTIONS ---------------------------------- - local function goodbye(reason) - spEcho('Deferred Distortions GL4 exiting:', reason) + spEcho("Deferred Distortions GL4 exiting:", reason) widgetHandler:RemoveWidget() end local function createDistortionInstanceVBO(vboLayout, vertexVBO, numVertices, indexVBO, VBOname, unitIDattribID) - local targetDistortionVBO = InstanceVBOTable.makeInstanceVBOTable( vboLayout, 16, VBOname, unitIDattribID) - if vertexVBO == nil or targetDistortionVBO == nil then goodbye("Failed to make "..VBOname) end + local targetDistortionVBO = InstanceVBOTable.makeInstanceVBOTable(vboLayout, 16, VBOname, unitIDattribID) + if vertexVBO == nil or targetDistortionVBO == nil then + goodbye("Failed to make " .. VBOname) + end targetDistortionVBO.vertexVBO = vertexVBO targetDistortionVBO.numVertices = numVertices targetDistortionVBO.indexVBO = indexVBO @@ -322,8 +331,10 @@ end function widget:ViewResize() vsx, vsy, vpx, vpy = spGetViewGeometry() - if ScreenCopy then glDeleteTexture(ScreenCopy) end - ScreenCopy = glCreateTexture(vsx , vsy, { + if ScreenCopy then + glDeleteTexture(ScreenCopy) + end + ScreenCopy = glCreateTexture(vsx, vsy, { border = false, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, @@ -332,8 +343,10 @@ function widget:ViewResize() }) local GL_RGBA16F_ARB = 0x881A --local GL_DEPTH_COMPONENT32 = 0x81A7 - if DistortionTexture then glDeleteTexture(DistortionTexture) end - DistortionTexture = glCreateTexture(vsx , vsy, { + if DistortionTexture then + glDeleteTexture(DistortionTexture) + end + DistortionTexture = glCreateTexture(vsx, vsy, { border = false, format = GL_RGBA16F_ARB, min_filter = GL.NEAREST, @@ -342,8 +355,14 @@ function widget:ViewResize() wrap_t = GL.CLAMP, fbo = true, }) - if not ScreenCopy then spEcho("Distortions GL4 Manager failed to create a ScreenCopy") return false end - if not DistortionTexture then spEcho("ScreenCopy Manager failed to create a DistortionTexture") return false end + if not ScreenCopy then + spEcho("Distortions GL4 Manager failed to create a ScreenCopy") + return false + end + if not DistortionTexture then + spEcho("ScreenCopy Manager failed to create a DistortionTexture") + return false + end invVsx = 1 / vsx invVsy = 1 / vsy return true @@ -367,61 +386,64 @@ local function initGL4() return false end - fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO()-- -1, -1, 1, 0, 0,0,1, 0.5) + fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO() -- -1, -1, 1, 0, 0,0,1, 0.5) -- init the VBO local vboLayout = { - {id = 3, name = 'worldposrad', size = 4}, - -- for spot, this is center.xyz and radius - -- for cone, this is center.xyz and height - -- for beam this is center.xyz and radiusleft - {id = 4, name = 'worldposrad2', size = 4}, - -- for spot, this is direction.xyz for unitattached, or world anim params - -- for cone, this is direction.xyz and angle in radians - -- for beam this is end.xyz and radiusright - {id = 5, name = 'baseparams', size = 4}, -- yoffset, effectStrength, startRadius, unused - {id = 6, name = 'universalParams', size = 4}, -- noiseStrength, noiseScaleSpace, distanceFalloff, onlyModelMap - {id = 7, name = 'lifeParams', size = 4}, -- spawnFrame, lifeTime, rampUp, decay - {id = 8, name = 'effectParams', size = 4}, -- effectParam1, effectParam2, windAffectd, effectType - {id = 9, name = 'pieceIndex', size = 1, type = GL.UNSIGNED_INT}, - {id = 10, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 3, name = "worldposrad", size = 4 }, + -- for spot, this is center.xyz and radius + -- for cone, this is center.xyz and height + -- for beam this is center.xyz and radiusleft + { id = 4, name = "worldposrad2", size = 4 }, + -- for spot, this is direction.xyz for unitattached, or world anim params + -- for cone, this is direction.xyz and angle in radians + -- for beam this is end.xyz and radiusright + { id = 5, name = "baseparams", size = 4 }, -- yoffset, effectStrength, startRadius, unused + { id = 6, name = "universalParams", size = 4 }, -- noiseStrength, noiseScaleSpace, distanceFalloff, onlyModelMap + { id = 7, name = "lifeParams", size = 4 }, -- spawnFrame, lifeTime, rampUp, decay + { id = 8, name = "effectParams", size = 4 }, -- effectParam1, effectParam2, windAffectd, effectType + { id = 9, name = "pieceIndex", size = 1, type = GL.UNSIGNED_INT }, + { id = 10, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } local pointVBO, numVerts, pointIndexVBO, numIndices = InstanceVBOTable.makeSphereVBO(8, 4, 1) -- could use an icosahedron (v12/i60/f20) maybe? --spEcho('numVerts', numVerts, numIndices) -- (v45, i144, f45) for a sphere - pointDistortionVBO = createDistortionInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Point Distortion VBO") - unitPointDistortionVBO = createDistortionInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Unit Point Distortion VBO", 10) + pointDistortionVBO = createDistortionInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Point Distortion VBO") + unitPointDistortionVBO = createDistortionInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Unit Point Distortion VBO", 10) projectilePointDistortionVBO = createDistortionInstanceVBO(vboLayout, pointVBO, nil, pointIndexVBO, "Projectile Point Distortion VBO") local coneVBO, numConeVertices = InstanceVBOTable.makeConeVBO(12, 1, 1) - coneDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Cone Distortion VBO") - unitConeDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Unit Cone Distortion VBO", 10) - projectileConeDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Projectile Cone Distortion VBO") + coneDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Cone Distortion VBO") + unitConeDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Unit Cone Distortion VBO", 10) + projectileConeDistortionVBO = createDistortionInstanceVBO(vboLayout, coneVBO, numConeVertices, nil, "Projectile Cone Distortion VBO") local beamVBO, numBeamVertices = InstanceVBOTable.makeBoxVBO(-1, -1, -1, 1, 1, 1) - beamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Beam Distortion VBO") - unitBeamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Unit Beam Distortion VBO", 10) - projectileBeamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Projectile Beam Distortion VBO") + beamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Beam Distortion VBO") + unitBeamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Unit Beam Distortion VBO", 10) + projectileBeamDistortionVBO = createDistortionInstanceVBO(vboLayout, beamVBO, numBeamVertices, nil, "Projectile Beam Distortion VBO") - projectileDistortionVBOMap = { point = projectilePointDistortionVBO, beam = projectileBeamDistortionVBO, cone = projectileConeDistortionVBO, } - unitDistortionVBOMap = { point = unitPointDistortionVBO, beam = unitBeamDistortionVBO, cone = unitConeDistortionVBO, } - distortionVBOMap = { point = pointDistortionVBO, beam = beamDistortionVBO, cone = coneDistortionVBO, } + projectileDistortionVBOMap = { point = projectilePointDistortionVBO, beam = projectileBeamDistortionVBO, cone = projectileConeDistortionVBO } + unitDistortionVBOMap = { point = unitPointDistortionVBO, beam = unitBeamDistortionVBO, cone = unitConeDistortionVBO } + distortionVBOMap = { point = pointDistortionVBO, beam = beamDistortionVBO, cone = coneDistortionVBO } return pointDistortionVBO and unitPointDistortionVBO and coneDistortionVBO and beamDistortionVBO end - ---InitializeDistortion(distortionTable, unitID) ---Takes a distortion definition table, and tries to check wether its already been initialized, if not, it inits it in-place ---@param distortionTable table ---@param unitID number local function InitializeDistortion(distortionTable, unitID) - if not distortionTable.initComplete then -- late init + if not distortionTable.initComplete then -- late init -- do the table to flattable conversion, if it doesnt exist yet if not distortionTable.distortionParamTable then -- perform correct init local distortionparams = {} - for i = 1, distortionParamTableSize do distortionparams[i] = 0 end - if distortionTable.distortionConfig == nil then Spring.Debug.TraceFullEcho() end + for i = 1, distortionParamTableSize do + distortionparams[i] = 0 + end + if distortionTable.distortionConfig == nil then + Spring.Debug.TraceFullEcho() + end for paramname, tablepos in pairs(distortionParamKeyOrder) do - if paramname == "effectType" and type(distortionTable.distortionConfig[paramname]) == 'string' then + if paramname == "effectType" and type(distortionTable.distortionConfig[paramname]) == "string" then distortionparams[tablepos] = distortionEffectTypes[distortionTable.distortionConfig[paramname]] or distortionparams[tablepos] else distortionparams[tablepos] = distortionTable.distortionConfig[paramname] or distortionparams[tablepos] @@ -429,14 +451,14 @@ local function InitializeDistortion(distortionTable, unitID) end --distortionparams[distortionParamKeyOrder.radius] = distortionparams[distortionParamKeyOrder.radius] --distortionparams[distortionParamKeyOrder.a] = distortionparams[distortionParamKeyOrder.a] or 1 - distortionparams[distortionParamKeyOrder.lifeTime] = mathFloor( distortionparams[distortionParamKeyOrder.lifeTime] ) or 0 + distortionparams[distortionParamKeyOrder.lifeTime] = mathFloor(distortionparams[distortionParamKeyOrder.lifeTime]) or 0 distortionparams[distortionParamKeyOrder.noiseStrength] = distortionTable.distortionConfig.noiseStrength or 1 distortionparams[distortionParamKeyOrder.noiseScaleSpace] = distortionTable.distortionConfig.noiseScaleSpace or 1 distortionparams[distortionParamKeyOrder.distanceFalloff] = distortionTable.distortionConfig.distanceFalloff or 1 distortionparams[distortionParamKeyOrder.effectStrength] = distortionTable.distortionConfig.effectStrength or 1 local startRadius = distortionTable.distortionConfig.startRadius if startRadius then - if (startRadius > 0) and (startRadius < 1 ) then + if (startRadius > 0) and (startRadius < 1) then startRadius = startRadius * (distortionTable.distortionConfig.radius or 100) end distortionparams[distortionParamKeyOrder.startRadius] = startRadius @@ -449,18 +471,16 @@ local function InitializeDistortion(distortionTable, unitID) distortionTable.distortionParamTable = distortionparams --distortionTable.distortionConfig = nil -- never used again after initialization local cnt = 0 - for k,v in pairs(distortionTable.distortionParamTable) do - cnt = cnt +1 + for k, v in pairs(distortionTable.distortionParamTable) do + cnt = cnt + 1 end if cnt ~= distortionParamTableSize then - - for k,v in pairs(distortionTable.distortionParamTable) do - spEcho(k,v) + for k, v in pairs(distortionTable.distortionParamTable) do + spEcho(k, v) end spEcho("DistortionTable size mismatch", cnt, distortionParamTableSize) spEcho(distortionTable) end - end if unitID then local unitDefID = spGetUnitDefID(unitID) @@ -478,7 +498,7 @@ local function InitializeDistortion(distortionTable, unitID) distortionTable.pieceIndex = pieceMap[distortionTable.pieceName] distortionTable.distortionParamTable[pieceIndexPos] = distortionTable.pieceIndex end - --spEcho(distortionname, distortionParams.pieceName, pieceMap[distortionParams.pieceName]) + --spEcho(distortionname, distortionParams.pieceName, pieceMap[distortionParams.pieceName]) end distortionTable.initComplete = true @@ -528,7 +548,7 @@ local function AddDistortion(instanceID, unitID, pieceIndex, targetVBO, distorti end if unitID then if unitAttachedDistortions[unitID] == nil then - unitAttachedDistortions[unitID] = {[instanceID] = targetVBO} + unitAttachedDistortions[unitID] = { [instanceID] = targetVBO } else unitAttachedDistortions[unitID][instanceID] = targetVBO end @@ -542,22 +562,28 @@ end ---Only use if you know the consequences of updating a VBO in-place! local function updateDistortionPosition(distortionVBO, instanceID, posx, posy, posz, radius, p2x, p2y, p2z, theta) local instanceIndex = distortionVBO.instanceIDtoIndex[instanceID] - if instanceIndex == nil then return nil end - instanceIndex = (instanceIndex - 1 ) * distortionVBO.instanceStep + if instanceIndex == nil then + return nil + end + instanceIndex = (instanceIndex - 1) * distortionVBO.instanceStep local instData = distortionVBO.instanceData if posx then instData[instanceIndex + 1] = posx instData[instanceIndex + 2] = posy instData[instanceIndex + 3] = posz end - if radius then instData[instanceIndex + 4] = radius end + if radius then + instData[instanceIndex + 4] = radius + end if p2x then instData[instanceIndex + 5] = p2x instData[instanceIndex + 6] = p2y instData[instanceIndex + 7] = p2z end - if theta then instData[instanceIndex + 8] = theta end + if theta then + instData[instanceIndex + 8] = theta + end distortionVBO.dirty = true return instanceIndex end @@ -565,7 +591,9 @@ end -- Specialized fast path for projectile position updates: no nil-checks, always writes pos+dir local function updateProjectilePosition(distortionVBO, instanceID, posx, posy, posz, dx, dy, dz) local instanceIndex = distortionVBO.instanceIDtoIndex[instanceID] - if instanceIndex == nil then return nil end + if instanceIndex == nil then + return nil + end instanceIndex = (instanceIndex - 1) * distortionVBO.instanceStep local instData = distortionVBO.instanceData instData[instanceIndex + 1] = posx @@ -582,19 +610,25 @@ end local function AddStaticDistortionsForUnit(unitID, unitDefID, noUpload, reason) if unitDefDistortions[unitDefID] then - if spGetUnitIsBeingBuilt(unitID) then return end + if spGetUnitIsBeingBuilt(unitID) then + return + end local unitDefDistortion = unitDefDistortions[unitDefID] - if unitDefDistortion.initComplete ~= true then -- late init + if unitDefDistortion.initComplete ~= true then -- late init for distortionname, distortionParams in pairs(unitDefDistortion) do - if not InitializeDistortion(distortionParams, unitID) then return end + if not InitializeDistortion(distortionParams, unitID) then + return + end end unitDefDistortion.initComplete = true end for distortionname, distortionParams in pairs(unitDefDistortion) do - if distortionname ~= 'initComplete' then + if distortionname ~= "initComplete" then local targetVBO = unitDistortionVBOMap[distortionParams.distortionType] - if (not spec) and distortionParams.alliedOnly == true and spIsUnitAllied(unitID) == false then return end + if (not spec) and distortionParams.alliedOnly == true and spIsUnitAllied(unitID) == false then + return + end AddDistortion(stringFormat("%d%s", unitID, distortionname), unitID, distortionParams.pieceIndex, targetVBO, distortionParams.distortionParamTable, noUpload) end end @@ -610,14 +644,14 @@ local function RemoveUnitAttachedDistortions(unitID, instanceID) local numremoved = 0 if unitAttachedDistortions[unitID] then if instanceID and unitAttachedDistortions[unitID][instanceID] then - popElementInstance(unitAttachedDistortions[unitID][instanceID],instanceID) + popElementInstance(unitAttachedDistortions[unitID][instanceID], instanceID) numremoved = numremoved + 1 unitAttachedDistortions[unitID][instanceID] = nil else for instanceID, targetVBO in pairs(unitAttachedDistortions[unitID]) do if targetVBO.instanceIDtoIndex[instanceID] then numremoved = numremoved + 1 - popElementInstance(targetVBO,instanceID) + popElementInstance(targetVBO, instanceID) else --spEcho("Distortion attached to unit no longer is in targetVBO", unitID, instanceID, targetVBO.myName) end @@ -654,21 +688,22 @@ local function RemoveDistortion(distortionshape, instanceID, unitID, noUpload) return nil end - local function LoadDistortionConfig() local effectTypes = {} local function findeffecttypes(t, res) - if not autoupdate then return end + if not autoupdate then + return + end for k, v in pairs(t) do - if type(v) == 'table' then + if type(v) == "table" then findeffecttypes(v, res) - elseif k == 'effectType' then + elseif k == "effectType" then res[v] = (res[v] or 0) + 1 end end return res end - local success, result = pcall(VFS.Include, 'luaui/configs/DistortionGL4Config.lua') + local success, result = pcall(VFS.Include, "luaui/configs/DistortionGL4Config.lua") --spEcho("Loading GL4 distortion config", success, result) if success then --spEcho("Loaded GL4 distortion config") @@ -679,12 +714,11 @@ local function LoadDistortionConfig() findeffecttypes(unitDefDistortions, effectTypes) findeffecttypes(unitEventDistortions, effectTypes) findeffecttypes(featureDefDistortions, effectTypes) - else spEcho("Failed to load GL4 Unit distortion config", success, result) end - local success2, result2 = pcall(VFS.Include, 'luaui/configs/DistortionGL4WeaponsConfig.lua') + local success2, result2 = pcall(VFS.Include, "luaui/configs/DistortionGL4WeaponsConfig.lua") --spEcho("Loading GL4 weapon distortion config", success2, result2) if success2 then gibDistortion = result2.gibDistortion @@ -718,8 +752,8 @@ local function LoadDistortionConfig() end if autoupdate and false then spEcho("GL4 Distortion effect types found:") - for k,v in pairs(effectTypes) do - spEcho(k,v) + for k, v in pairs(effectTypes) do + spEcho(k, v) end end return success and success2 @@ -727,8 +761,7 @@ end local nightFactor = 1 --0.33 local unitNightFactor = 1 -- applied above nightFactor default 1.2 -local adjustfornight = {'unitAmbientColor', 'unitDiffuseColor', 'unitSpecularColor','groundAmbientColor', 'groundDiffuseColor', 'groundSpecularColor' } - +local adjustfornight = { "unitAmbientColor", "unitDiffuseColor", "unitSpecularColor", "groundAmbientColor", "groundDiffuseColor", "groundSpecularColor" } local targetable = {} for wdid, wd in pairs(WeaponDefs) do @@ -738,14 +771,14 @@ for wdid, wd in pairs(WeaponDefs) do end function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) - if targetable[weaponID] and py-7300 > Spring.GetGroundHeight(px, pz) then -- dont add distortion to (likely) intercepted explosions (mainly to curb nuke flashes) + if targetable[weaponID] and py - 7300 > Spring.GetGroundHeight(px, pz) then -- dont add distortion to (likely) intercepted explosions (mainly to curb nuke flashes) return end if explosionDistortions[weaponID] then for i, distortion in pairs(explosionDistortions[weaponID]) do local distortionParamTable = distortion.distortionParamTable - if distortion.alwaysVisible or spIsSphereInView(px,py,pz, distortionParamTable[4]) then - local groundHeight = spGetGroundHeight(px,pz) or 1 + if distortion.alwaysVisible or spIsSphereInView(px, py, pz, distortionParamTable[4]) then + local groundHeight = spGetGroundHeight(px, pz) or 1 py = math_max(groundHeight + (distortion.yOffset or 0), py) distortionParamTable[1] = px distortionParamTable[2] = py @@ -760,8 +793,8 @@ function widget:Barrelfire(px, py, pz, weaponID, ownerID) if muzzleFlashDistortions[weaponID] then for i, distortion in pairs(muzzleFlashDistortions[weaponID]) do local distortionParamTable = distortion.distortionParamTable - if distortion.alwaysVisible or spIsSphereInView(px,py,pz, distortionParamTable[4]) then - local groundHeight = spGetGroundHeight(px,pz) or 1 + if distortion.alwaysVisible or spIsSphereInView(px, py, pz, distortionParamTable[4]) then + local groundHeight = spGetGroundHeight(px, pz) or 1 distortionParamTable[1] = px distortionParamTable[2] = py distortionParamTable[3] = pz @@ -776,11 +809,17 @@ local function UnitScriptDistortion(unitID, unitDefID, distortionIndex, param) if spValidUnitID(unitID) and spGetUnitIsDead(unitID) == false and visibleUnits[unitID] and unitEventDistortions.UnitScriptDistortions[unitDefID] and unitEventDistortions.UnitScriptDistortions[unitDefID][distortionIndex] then local distortionTable = unitEventDistortions.UnitScriptDistortions[unitDefID][distortionIndex] if not distortionTable.alwaysVisible then - local px,py,pz = spGetUnitPosition(unitID) - if px == nil or spIsSphereInView(px,py,pz, distortionTable[4]) == false then return end + local px, py, pz = spGetUnitPosition(unitID) + if px == nil or spIsSphereInView(px, py, pz, distortionTable[4]) == false then + return + end + end + if (not spec) and distortionTable.alliedOnly == true and spIsUnitAllied(unitID) == false then + return + end + if distortionTable.initComplete == nil then + InitializeDistortion(distortionTable, unitID) end - if (not spec) and distortionTable.alliedOnly == true and spIsUnitAllied(unitID) == false then return end - if distortionTable.initComplete == nil then InitializeDistortion(distortionTable, unitID) end local instanceID = stringFormat("%d_%s_UnitScriptDistortion%d_%s", unitID, unitName[unitDefID], distortionIndex, param) AddDistortion(instanceID, unitID, distortionTable.pieceIndex, unitDistortionVBOMap[distortionTable.distortionType], distortionTable.distortionParamTable) end @@ -790,8 +829,6 @@ local function GetDistortionVBO(vboName) return nil end - - function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) visibleUnits[unitID] = unitDefID AddStaticDistortionsForUnit(unitID, unitDefID, false, "VisibleUnitAdded") @@ -820,15 +857,21 @@ end function widget:Shutdown() -- TODO: delete the VBOs and shaders like a good boy - WG['distortionsgl4'] = nil - widgetHandler:DeregisterGlobal('AddDistortion') - widgetHandler:DeregisterGlobal('RemoveDistortion') + WG["distortionsgl4"] = nil + widgetHandler:DeregisterGlobal("AddDistortion") + widgetHandler:DeregisterGlobal("RemoveDistortion") deferredDistortionShader:Delete() local ram = 0 - for distortiontype, vbo in pairs(unitDistortionVBOMap) do ram = ram + vbo:Delete() end - for distortiontype, vbo in pairs(projectileDistortionVBOMap) do ram = ram + vbo:Delete() end - for distortiontype, vbo in pairs(distortionVBOMap) do ram = ram + vbo:Delete() end + for distortiontype, vbo in pairs(unitDistortionVBOMap) do + ram = ram + vbo:Delete() + end + for distortiontype, vbo in pairs(projectileDistortionVBOMap) do + ram = ram + vbo:Delete() + end + for distortiontype, vbo in pairs(distortionVBOMap) do + ram = ram + vbo:Delete() + end --spEcho("distortionGL4 ram usage MB = ", ram / 1000000) --spEcho("featureDefDistortions", table.countMem(featureDefDistortions)) @@ -844,7 +887,7 @@ function widget:Shutdown() unitEventDistortions = nil muzzleFlashDistortions = nil projectileDefDistortions = nil - explosionDistortions = nil + explosionDistortions = nil gibDistortion = nil glDeleteTexture(ScreenCopy) @@ -853,7 +896,6 @@ function widget:Shutdown() --collectgarbage("collect") --collectgarbage("collect") - end local windX = 0 @@ -883,13 +925,15 @@ local function eventDistortionSpawner(eventName, unitID, unitDefID, teamID) if spValidUnitID(unitID) and spGetUnitIsDead(unitID) == false and unitEventDistortions[eventName] then if unitEventDistortions[eventName] then -- get the default event if it is defined - local distortionList = unitEventDistortions[eventName][unitDefID] or unitEventDistortions[eventName]['default'] + local distortionList = unitEventDistortions[eventName][unitDefID] or unitEventDistortions[eventName]["default"] if distortionList then for distortionname, distortionTable in pairs(distortionList) do local visible = distortionTable.alwaysVisible - local px,py,pz = spGetUnitPosition(unitID) + local px, py, pz = spGetUnitPosition(unitID) if not visible then - if px and spIsSphereInView(px,py,pz, distortionTable[4]) then visible = true end + if px and spIsSphereInView(px, py, pz, distortionTable[4]) then + visible = true + end end -- bail if only for allies @@ -915,11 +959,13 @@ local function eventDistortionSpawner(eventName, unitID, unitDefID, teamID) if distortionTable.pieceName then if distortionTable.aboveUnit then -- if its above the unit, then add the aboveunit offset to the units height too! -- this is done via a quick copy of the table - for i=1, distortionParamTableSize do distortionCacheTable[i] = distortionParamTable[i] end + for i = 1, distortionParamTableSize do + distortionCacheTable[i] = distortionParamTable[i] + end local unitHeight = spGetUnitHeight(unitID) if unitHeight == nil then local losstate = spGetUnitLosState(unitID) - spEcho("Unitheight is nil for unitID", unitID, "unitDefName", unitName[unitDefID], eventName, distortionname, 'losstate', losstate and losstate.los) + spEcho("Unitheight is nil for unitID", unitID, "unitDefName", unitName[unitDefID], eventName, distortionname, "losstate", losstate and losstate.los) end distortionCacheTable[2] = distortionCacheTable[2] + distortionTable.aboveUnit + (unitHeight or 0) @@ -927,14 +973,15 @@ local function eventDistortionSpawner(eventName, unitID, unitDefID, teamID) end AddDistortion(stringFormat("%s%d%s", eventName, unitID, distortionname), unitID, distortionTable.pieceIndex, unitDistortionVBOMap[distortionTable.distortionType], distortionParamTable) else - for i=1, distortionParamTableSize do distortionCacheTable[i] = distortionParamTable[i] end + for i = 1, distortionParamTableSize do + distortionCacheTable[i] = distortionParamTable[i] + end distortionCacheTable[1] = distortionCacheTable[1] + px distortionCacheTable[2] = distortionParamTable[2] + py + ((distortionTable.aboveUnit and spGetUnitHeight(unitID)) or 0) distortionCacheTable[3] = distortionCacheTable[3] + pz AddDistortion(stringFormat("%s%d%s", eventName, unitID, distortionname), nil, distortionTable.pieceIndex, distortionVBOMap[distortionTable.distortionType], distortionCacheTable) end end - end end end @@ -952,7 +999,7 @@ function widget:UnitCreated(unitID, unitDefID, teamID) eventDistortionSpawner("UnitCreated", unitID, unitDefID, teamID) end function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - eventDistortionSpawner("UnitFromFactory", unitID, unitDefID, teamID) -- i have no idea of the differences here + eventDistortionSpawner("UnitFromFactory", unitID, unitDefID, teamID) -- i have no idea of the differences here eventDistortionSpawner("UnitFromFactoryBuilder", factID, factDefID, teamID) end function widget:UnitDestroyed(unitID, unitDefID, teamID) -- dont do piece-attached distortions here! @@ -964,7 +1011,7 @@ end -- THIS ONE DOESNT WORK, some shit is being pulled and i cant get the unit height of the unit being taken here! --function widget:UnitTaken(unitID, unitDefID, teamID) - --eventDistortionSpawner("UnitTaken", unitID, unitDefID, teamID) +--eventDistortionSpawner("UnitTaken", unitID, unitDefID, teamID) --end function widget:UnitGiven(unitID, unitDefID, teamID) eventDistortionSpawner("UnitGiven", unitID, unitDefID, teamID) @@ -985,17 +1032,20 @@ function widget:StockpileChanged(unitID, unitDefID, teamID, weaponNum, oldCount, end end -function widget:FeatureCreated(featureID,allyteam) +function widget:FeatureCreated(featureID, allyteam) -- TODO: Allow team-colored feature distortions by getting teamcolor and putting it into distortionCacheTable local featureDefID = spGetFeatureDefID(featureID) if featureDefDistortions[featureDefID] then for distortionname, distortionTable in pairs(featureDefDistortions[featureDefID]) do - if not distortionTable.initComplete then InitializeDistortion(distortionTable) end + if not distortionTable.initComplete then + InitializeDistortion(distortionTable) + end local px, py, pz = spGetFeaturePosition(featureID) if px then - local distortionParamTable = distortionTable.distortionParamTable - for i=1, distortionParamTableSize do distortionCacheTable[i] = distortionParamTable[i] end + for i = 1, distortionParamTableSize do + distortionCacheTable[i] = distortionParamTable[i] + end distortionCacheTable[1] = distortionCacheTable[1] + px distortionCacheTable[2] = distortionCacheTable[2] + py distortionCacheTable[3] = distortionCacheTable[3] + pz @@ -1019,7 +1069,7 @@ end local function PrintProjectileInfo(projectileID) local px, py, pz = spGetProjectilePosition(projectileID) local weapon, piece = Spring.GetProjectileType(projectileID) - local weaponDefID = weapon and Spring.GetProjectileDefID ( projectileID ) + local weaponDefID = weapon and Spring.GetProjectileDefID(projectileID) Spring.Debug.TraceFullEcho() end @@ -1034,8 +1084,8 @@ local viewRectMinX, viewRectMinZ, viewRectMaxX, viewRectMaxZ = 0, 0, mapSizeX, m local lastViewRectMinX, lastViewRectMinZ = -1, -1 local lastViewRectMaxX, lastViewRectMaxZ = -1, -1 local VIEW_RECT_PAD = 1500 -- padding for projectile arcs / effect radius slop -local viewRectCornersX = {0, 0, 0, 0} -local viewRectCornersY = {0, 0, 0, 0} +local viewRectCornersX = { 0, 0, 0, 0 } +local viewRectCornersY = { 0, 0, 0, 0 } -- Cached camera state so we can skip the TraceScreenRay calls when the camera -- hasn't moved (e.g. paused with a static view). local lastCamPx, lastCamPy, lastCamPz = nil, nil, nil @@ -1043,38 +1093,47 @@ local lastCamDx, lastCamDy, lastCamDz = nil, nil, nil local function updateViewGroundRect() local drawFrame = Spring.GetDrawFrame and Spring.GetDrawFrame() or 0 - if drawFrame == viewRectFrame then return end + if drawFrame == viewRectFrame then + return + end viewRectFrame = drawFrame -- Cheap early-out: if the camera position and forward direction are -- byte-identical to the previous frame, the view rect can't have changed. local cpx, cpy, cpz = spGetCameraPosition() local cdx, cdy, cdz = spGetCameraDirection() - if cpx == lastCamPx and cpy == lastCamPy and cpz == lastCamPz - and cdx == lastCamDx and cdy == lastCamDy and cdz == lastCamDz then + if cpx == lastCamPx and cpy == lastCamPy and cpz == lastCamPz and cdx == lastCamDx and cdy == lastCamDy and cdz == lastCamDz then return end lastCamPx, lastCamPy, lastCamPz = cpx, cpy, cpz lastCamDx, lastCamDy, lastCamDz = cdx, cdy, cdz - viewRectCornersX[1], viewRectCornersY[1] = 0, 0 + viewRectCornersX[1], viewRectCornersY[1] = 0, 0 viewRectCornersX[2], viewRectCornersY[2] = vsx, 0 - viewRectCornersX[3], viewRectCornersY[3] = 0, vsy + viewRectCornersX[3], viewRectCornersY[3] = 0, vsy viewRectCornersX[4], viewRectCornersY[4] = vsx, vsy - local minX, maxX = 1e30, -1e30 - local minZ, maxZ = 1e30, -1e30 + local minX, maxX = 1e30, -1e30 + local minZ, maxZ = 1e30, -1e30 local hits = 0 for i = 1, 4 do -- onlyCoords=true, useMinimap=false, includeSky=true to get the -- ground/sky-plane intersection at each corner local _, pos = spTraceScreenRay(viewRectCornersX[i], viewRectCornersY[i], true, false, true) - if type(pos) == 'table' then + if type(pos) == "table" then hits = hits + 1 local x, z = pos[1], pos[3] - if x < minX then minX = x end - if x > maxX then maxX = x end - if z < minZ then minZ = z end - if z > maxZ then maxZ = z end + if x < minX then + minX = x + end + if x > maxX then + maxX = x + end + if z < minZ then + minZ = z + end + if z > maxZ then + maxZ = z + end end end if hits < 2 then @@ -1086,19 +1145,38 @@ local function updateViewGroundRect() -- Also include camera position so projectiles next to/behind the camera -- still get picked up if they're within the padded range. if cpx then - if cpx < minX then minX = cpx end - if cpx > maxX then maxX = cpx end - if cpz < minZ then minZ = cpz end - if cpz > maxZ then maxZ = cpz end - end - minX = minX - VIEW_RECT_PAD; if minX < 0 then minX = 0 end - minZ = minZ - VIEW_RECT_PAD; if minZ < 0 then minZ = 0 end - maxX = maxX + VIEW_RECT_PAD; if maxX > mapSizeX then maxX = mapSizeX end - maxZ = maxZ + VIEW_RECT_PAD; if maxZ > mapSizeZ then maxZ = mapSizeZ end + if cpx < minX then + minX = cpx + end + if cpx > maxX then + maxX = cpx + end + if cpz < minZ then + minZ = cpz + end + if cpz > maxZ then + maxZ = cpz + end + end + minX = minX - VIEW_RECT_PAD + if minX < 0 then + minX = 0 + end + minZ = minZ - VIEW_RECT_PAD + if minZ < 0 then + minZ = 0 + end + maxX = maxX + VIEW_RECT_PAD + if maxX > mapSizeX then + maxX = mapSizeX + end + maxZ = maxZ + VIEW_RECT_PAD + if maxZ > mapSizeZ then + maxZ = mapSizeZ + end viewRectMinX, viewRectMinZ, viewRectMaxX, viewRectMaxZ = minX, minZ, maxX, maxZ end - local function updateProjectileDistortions(newgameframe) -- Use GetProjectilesInRectangle to also capture BeamLaser projectiles -- (spGetVisibleProjectiles misses them). Restrict the rectangle to the @@ -1111,10 +1189,8 @@ local function updateProjectileDistortions(newgameframe) -- Skip entirely if neither the game frame advanced nor the view changed: -- projectiles haven't moved, no new ones can spawn, and the visible set -- can't have changed. This is the dominant cost while paused. - local viewRectChanged = - viewRectMinX ~= lastViewRectMinX or viewRectMaxX ~= lastViewRectMaxX or - viewRectMinZ ~= lastViewRectMinZ or viewRectMaxZ ~= lastViewRectMaxZ - if (not newgameframe) and (not viewRectChanged) then + local viewRectChanged = viewRectMinX ~= lastViewRectMinX or viewRectMaxX ~= lastViewRectMaxX or viewRectMinZ ~= lastViewRectMinZ or viewRectMaxZ ~= lastViewRectMaxZ + if (not newgameframe) and not viewRectChanged then return end lastViewRectMinX, lastViewRectMinZ = viewRectMinX, viewRectMinZ @@ -1130,7 +1206,7 @@ local function updateProjectileDistortions(newgameframe) local noUpload = true local nowprojectilesLen = #nowprojectiles local projectileDistortionVBOMapCache = projectileDistortionVBOMap - for i= 1, nowprojectilesLen do + for i = 1, nowprojectilesLen do local projectileID = nowprojectiles[i] local trackedProjectile = trackedProjectiles[projectileID] if trackedProjectile then @@ -1139,13 +1215,14 @@ local function updateProjectileDistortions(newgameframe) -- means the projectile had no distortion to add in the first place). if newgameframe then local distortionType = trackedProjectileTypes[projectileID] - if distortionType ~= 'beam' and distortionType ~= 'none' then + if distortionType ~= "beam" and distortionType ~= "none" then local px, py, pz = spGetProjectilePosition(projectileID) if px then - local dx,dy,dz = spGetProjectileVelocity(projectileID) - local instanceIndex = updateProjectilePosition(projectileDistortionVBOMapCache[distortionType], - projectileID, px,py,pz, dx,dy,dz) - if debugproj then spEcho("Updated", instanceIndex, projectileID, px, py, pz,dx,dy,dz) end + local dx, dy, dz = spGetProjectileVelocity(projectileID) + local instanceIndex = updateProjectilePosition(projectileDistortionVBOMapCache[distortionType], projectileID, px, py, pz, dx, dy, dz) + if debugproj then + spEcho("Updated", instanceIndex, projectileID, px, py, pz, dx, dy, dz) + end end end -- Refresh timestamp so the cleanup loop doesn't drop it. @@ -1157,7 +1234,7 @@ local function updateProjectileDistortions(newgameframe) -- Untracked: need position for the add branch. local px, py, pz = spGetProjectilePosition(projectileID) if px then - local distortionType = 'none' -- 'none' = saw the projectile but added nothing + local distortionType = "none" -- 'none' = saw the projectile but added nothing local weapon, piece = spGetProjectileType(projectileID) if piece then -- Frustum-cull gibs whose effect sphere is outside the @@ -1170,24 +1247,23 @@ local function updateProjectileDistortions(newgameframe) gib[2] = py gib[3] = pz AddDistortion(projectileID, nil, nil, projectilePointDistortionVBO, gib, noUpload) - distortionType = 'point' + distortionType = "point" end else - local weaponDefID = spGetProjectileDefID ( projectileID ) + local weaponDefID = spGetProjectileDefID(projectileID) local projectileDefDistortion = projectileDefDistortions[weaponDefID] - if projectileDefDistortion and ( projectileID % (projectileDefDistortion.fraction or 1) == 0 ) then + if projectileDefDistortion and (projectileID % (projectileDefDistortion.fraction or 1) == 0) then local distortionParamTable = projectileDefDistortion.distortionParamTable local thisType = projectileDefDistortion.distortionType - local dx,dy,dz = spGetProjectileVelocity(projectileID) + local dx, dy, dz = spGetProjectileVelocity(projectileID) -- Frustum cull: skip projectiles whose effect bounds -- are entirely outside the view. local cullRadius = distortionParamTable[4] or 0 local inView - if thisType == 'beam' then - inView = spIsSphereInView(px, py, pz, cullRadius) - or spIsSphereInView(px + (dx or 0), py + (dy or 0), pz + (dz or 0), cullRadius) + if thisType == "beam" then + inView = spIsSphereInView(px, py, pz, cullRadius) or spIsSphereInView(px + (dx or 0), py + (dy or 0), pz + (dz or 0), cullRadius) else inView = spIsSphereInView(px, py, pz, cullRadius) end @@ -1195,9 +1271,11 @@ local function updateProjectileDistortions(newgameframe) distortionParamTable[1] = px distortionParamTable[2] = py distortionParamTable[3] = pz - if debugproj then spEcho(thisType, projectileDefDistortion.distortionClassName) end + if debugproj then + spEcho(thisType, projectileDefDistortion.distortionClassName) + end - if thisType == 'beam' then + if thisType == "beam" then distortionParamTable[5] = px + dx distortionParamTable[6] = py + dy distortionParamTable[7] = pz + dz @@ -1207,16 +1285,20 @@ local function updateProjectileDistortions(newgameframe) distortionParamTable[6] = dy distortionParamTable[7] = dz end - if debugproj then spEcho(thisType, px,py,pz, dx, dy,dz) end + if debugproj then + spEcho(thisType, px, py, pz, dx, dy, dz) + end - AddDistortion(projectileID, nil, nil, projectileDistortionVBOMapCache[thisType], distortionParamTable,noUpload) + AddDistortion(projectileID, nil, nil, projectileDistortionVBOMapCache[thisType], distortionParamTable, noUpload) distortionType = thisType end --AddDistortion(projectileID, nil, nil, projectilePointDistortionVBO, distortionParamTable) end end numadded = numadded + 1 - if debugproj then spEcho("Adding projdistortion", projectileID, spGetProjectileName(projectileID)) end + if debugproj then + spEcho("Adding projdistortion", projectileID, spGetProjectileName(projectileID)) + end trackedProjectileTypes[projectileID] = distortionType trackedProjectiles[projectileID] = gameFrame end @@ -1225,44 +1307,52 @@ local function updateProjectileDistortions(newgameframe) -- remove the ones that werent updated local numremoved = 0 if newgameframe then - -- Any tracked projectile whose timestamp wasn't refreshed this frame is - -- either dead or has left the view rect. In both cases we drop tracking - -- and pop its VBO entry. If it's alive and re-enters the view rect later, - -- the add branch above will re-add it. This avoids per-game-frame - -- spGetProjectilePosition probes on every off-screen alive projectile, - -- which was the dominant remaining cost. - for projectileID, pgf in pairs(trackedProjectiles) do - if pgf < gf then - numremoved = numremoved + 1 - trackedProjectiles[projectileID] = nil - local distortionType = trackedProjectileTypes[projectileID] - local vbo = projectileDistortionVBOMapCache[distortionType] - if vbo and vbo.instanceIDtoIndex[projectileID] then -- god the indirections here ... - local success = popElementInstance(vbo, projectileID, noUpload) - if success == nil then PrintProjectileInfo(projectileID) end + -- Any tracked projectile whose timestamp wasn't refreshed this frame is + -- either dead or has left the view rect. In both cases we drop tracking + -- and pop its VBO entry. If it's alive and re-enters the view rect later, + -- the add branch above will re-add it. This avoids per-game-frame + -- spGetProjectilePosition probes on every off-screen alive projectile, + -- which was the dominant remaining cost. + for projectileID, pgf in pairs(trackedProjectiles) do + if pgf < gf then + numremoved = numremoved + 1 + trackedProjectiles[projectileID] = nil + local distortionType = trackedProjectileTypes[projectileID] + local vbo = projectileDistortionVBOMapCache[distortionType] + if vbo and vbo.instanceIDtoIndex[projectileID] then -- god the indirections here ... + local success = popElementInstance(vbo, projectileID, noUpload) + if success == nil then + PrintProjectileInfo(projectileID) + end + end + trackedProjectileTypes[projectileID] = nil end - trackedProjectileTypes[projectileID] = nil end - end end -- newgameframe guard -- upload all changed elements in one go - if projectilePointDistortionVBO.dirty then uploadAllElements(projectilePointDistortionVBO) end - if projectileBeamDistortionVBO.dirty then uploadAllElements(projectileBeamDistortionVBO) end - if projectileConeDistortionVBO.dirty then uploadAllElements(projectileConeDistortionVBO) end + if projectilePointDistortionVBO.dirty then + uploadAllElements(projectilePointDistortionVBO) + end + if projectileBeamDistortionVBO.dirty then + uploadAllElements(projectileBeamDistortionVBO) + end + if projectileConeDistortionVBO.dirty then + uploadAllElements(projectileConeDistortionVBO) + end --if debugproj then -- spEcho("#points", projectilePointDistortionVBO.usedElements, '#projs', #nowprojectiles ) --end end -local configCache = {lastUpdate = spGetTimer()} +local configCache = { lastUpdate = spGetTimer() } local function checkConfigUpdates() if spDiffTimers(spGetTimer(), configCache.lastUpdate) > 0.5 then - local newconfa = VFS.LoadFile('luaui/configs/DistortionGL4Config.lua') - local newconfb = VFS.LoadFile('luaui/configs/DistortionGL4WeaponsConfig.lua') + local newconfa = VFS.LoadFile("luaui/configs/DistortionGL4Config.lua") + local newconfb = VFS.LoadFile("luaui/configs/DistortionGL4WeaponsConfig.lua") if newconfa ~= configCache.confa or newconfb ~= configCache.confb then LoadDistortionConfig() - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end configCache.confa = newconfa configCache.confb = newconfb @@ -1273,118 +1363,112 @@ local function checkConfigUpdates() end function widget:Update(dt) - if autoupdate then checkConfigUpdates() end + if autoupdate then + checkConfigUpdates() + end updateProjectileDistortions() end ------------------------------- Drawing all the distortions --------------------------------- - local function DrawDistortionFunction2(gf) -- For render-to-texture - -- Set is as black with zero alpha - glClear(GL.COLOR_BUFFER_BIT, 0.0, 0.0, 0.0, 0.0) - - -- So we are gonna multiply each effect with its own alpha, and then add them together on the destination - -- This means we also will be ignoring the destination alpha channel. - -- The default blending function is GL_FUNC_ADD - glBlending(GL.SRC_ALPHA, GL.ONE) - --if autoupdate and alt and (isSinglePlayer or spec) and devui then return end - - glCulling(false) - glDepthTest(false) - glDepthMask(false) --"BK OpenGL state resets", default is already false, could remove - glTexture(0, "$map_gbuffer_zvaltex") - glTexture(1, "$model_gbuffer_zvaltex") - glTexture(2, "$map_gbuffer_normtex") - glTexture(3, "$model_gbuffer_normtex") - glTexture(4, "$map_gbuffer_difftex") - glTexture(5, "$model_gbuffer_difftex") - glTexture(6, noisetex3dcube) - if shaderConfig.UNIFORMSBUFFERCOPY then - local UniformsBufferCopy = WG['api_unitbufferuniform_copy'].GetUnitUniformBufferCopy() - if not UniformsBufferCopy then - spEcho("DistortionGL4: UniformsBufferCopy not found") - return - end + -- Set is as black with zero alpha + glClear(GL.COLOR_BUFFER_BIT, 0.0, 0.0, 0.0, 0.0) - UniformsBufferCopy:BindBufferRange(4) - end + -- So we are gonna multiply each effect with its own alpha, and then add them together on the destination + -- This means we also will be ignoring the destination alpha channel. + -- The default blending function is GL_FUNC_ADD + glBlending(GL.SRC_ALPHA, GL.ONE) + --if autoupdate and alt and (isSinglePlayer or spec) and devui then return end - deferredDistortionShader:Activate() - deferredDistortionShader:SetUniformFloat("nightFactor", nightFactor) + glCulling(false) + glDepthTest(false) + glDepthMask(false) --"BK OpenGL state resets", default is already false, could remove + glTexture(0, "$map_gbuffer_zvaltex") + glTexture(1, "$model_gbuffer_zvaltex") + glTexture(2, "$map_gbuffer_normtex") + glTexture(3, "$model_gbuffer_normtex") + glTexture(4, "$map_gbuffer_difftex") + glTexture(5, "$model_gbuffer_difftex") + glTexture(6, noisetex3dcube) + if shaderConfig.UNIFORMSBUFFERCOPY then + local UniformsBufferCopy = WG["api_unitbufferuniform_copy"].GetUnitUniformBufferCopy() + if not UniformsBufferCopy then + spEcho("DistortionGL4: UniformsBufferCopy not found") + return + end - deferredDistortionShader:SetUniformFloat("intensityMultiplier", intensityMultiplier) - deferredDistortionShader:SetUniformFloat("radiusMultiplier", radiusMultiplier) - deferredDistortionShader:SetUniformFloat("windXZ", windX, windZ) + UniformsBufferCopy:BindBufferRange(4) + end + deferredDistortionShader:Activate() + deferredDistortionShader:SetUniformFloat("nightFactor", nightFactor) - -- Fixed worldpos distortions, cursors, projectiles, world distortions - deferredDistortionShader:SetUniformFloat("attachedtounitID", 0) -- worldpos stuff - deferredDistortionShader:SetUniformFloat("pointbeamcone", 0) + deferredDistortionShader:SetUniformFloat("intensityMultiplier", intensityMultiplier) + deferredDistortionShader:SetUniformFloat("radiusMultiplier", radiusMultiplier) + deferredDistortionShader:SetUniformFloat("windXZ", windX, windZ) - pointDistortionVBO:draw() - projectilePointDistortionVBO:draw() + -- Fixed worldpos distortions, cursors, projectiles, world distortions + deferredDistortionShader:SetUniformFloat("attachedtounitID", 0) -- worldpos stuff + deferredDistortionShader:SetUniformFloat("pointbeamcone", 0) + pointDistortionVBO:draw() + projectilePointDistortionVBO:draw() - deferredDistortionShader:SetUniformFloat("pointbeamcone", 1) - beamDistortionVBO:draw() - projectileBeamDistortionVBO:draw() + deferredDistortionShader:SetUniformFloat("pointbeamcone", 1) + beamDistortionVBO:draw() + projectileBeamDistortionVBO:draw() - deferredDistortionShader:SetUniformFloat("pointbeamcone", 2) - coneDistortionVBO:draw() - projectileConeDistortionVBO:draw() + deferredDistortionShader:SetUniformFloat("pointbeamcone", 2) + coneDistortionVBO:draw() + projectileConeDistortionVBO:draw() - -- Unit Attached Distortions - deferredDistortionShader:SetUniformFloat("attachedtounitID", 1) + -- Unit Attached Distortions + deferredDistortionShader:SetUniformFloat("attachedtounitID", 1) - deferredDistortionShader:SetUniformFloat("pointbeamcone", 0) - unitPointDistortionVBO:draw() + deferredDistortionShader:SetUniformFloat("pointbeamcone", 0) + unitPointDistortionVBO:draw() - deferredDistortionShader:SetUniformFloat("pointbeamcone", 1) - unitBeamDistortionVBO:draw() + deferredDistortionShader:SetUniformFloat("pointbeamcone", 1) + unitBeamDistortionVBO:draw() - deferredDistortionShader:SetUniformFloat("pointbeamcone", 2) - unitConeDistortionVBO:draw() + deferredDistortionShader:SetUniformFloat("pointbeamcone", 2) + unitConeDistortionVBO:draw() - deferredDistortionShader:Deactivate() + deferredDistortionShader:Deactivate() - for i = 0, 6 do glTexture(i, false) end - glCulling(GL.BACK) - glDepthTest(true) - --gl.DepthMask(true) --"BK OpenGL state resets", was true but now commented out (redundant set of false states) - glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + for i = 0, 6 do + glTexture(i, false) + end + glCulling(GL.BACK) + glDepthTest(true) + --gl.DepthMask(true) --"BK OpenGL state resets", was true but now commented out (redundant set of false states) + glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end -- local tf = Spring.GetTimerMicros() function widget:DrawWorld() -- We are drawing in world space, probably a bad idea but hey --local t0 = Spring.GetTimerMicros() --if true then return end - if skipdraw then return end + if skipdraw then + return + end if autoupdate then deferredDistortionShader = LuaShader.CheckShaderUpdates(distortionShaderSourceCache, 0) or deferredDistortionShader end - local hasAtLeastOneDistortion = - pointDistortionVBO.usedElements > 0 or - beamDistortionVBO.usedElements > 0 or - coneDistortionVBO.usedElements > 0 or - unitPointDistortionVBO.usedElements > 0 or - unitBeamDistortionVBO.usedElements > 0 or - unitConeDistortionVBO.usedElements > 0 or - projectilePointDistortionVBO.usedElements > 0 or - projectileBeamDistortionVBO.usedElements > 0 or - projectileConeDistortionVBO.usedElements > 0 + local hasAtLeastOneDistortion = pointDistortionVBO.usedElements > 0 or beamDistortionVBO.usedElements > 0 or coneDistortionVBO.usedElements > 0 or unitPointDistortionVBO.usedElements > 0 or unitBeamDistortionVBO.usedElements > 0 or unitConeDistortionVBO.usedElements > 0 or projectilePointDistortionVBO.usedElements > 0 or projectileBeamDistortionVBO.usedElements > 0 or projectileConeDistortionVBO.usedElements > 0 - if (not hasAtLeastOneDistortion) then return end + if not hasAtLeastOneDistortion then + return + end tracy.ZoneBeginN("CopyToTexture") -- Blend the distortion: glCopyToTexture(ScreenCopy, 0, 0, vpx, vpy, vsx, vsy) tracy.ZoneEnd() - - glRenderToTexture(DistortionTexture, DrawDistortionFunction2, spGetGameFrame()) --tracy.ZoneEnd() tracy.ZoneBeginN("CombineDistortion") @@ -1409,10 +1493,11 @@ function widget:DrawWorld() -- We are drawing in world space, probably a bad ide fullScreenQuadVAO:DrawArrays(GL.TRIANGLES) screenDistortionShader:Deactivate() - for i = 0,3 do gl.Texture(i, false) end + for i = 0, 3 do + gl.Texture(i, false) + end tracy.ZoneEnd() - glDepthTest(true) --local t1 = Spring.GetTimerMicros() --if (Spring.GetDrawFrame() % 50 == 0 ) then @@ -1425,19 +1510,16 @@ end if autoupdate then function widget:DrawScreen() --spEcho("DrawScreen", deferredDistortionShader.DrawPrintf) - if deferredDistortionShader.DrawPrintf then deferredDistortionShader.DrawPrintf(0) end + if deferredDistortionShader.DrawPrintf then + deferredDistortionShader.DrawPrintf(0) + end end end -- Register /luaui distortionGL4stats to dump distortion statistics function widget:TextCommand(command) if stringFind(command, "distortionGL4stats", nil, true) then - spEcho(stringFormat("distortionGL4Stats Total = %d , (PBC=%d,%d,%d), (unitPBC=%d,%d,%d), (projPBC=%d,%d,%d)", - numAddDistortions, - pointDistortionVBO.usedElements, beamDistortionVBO.usedElements, coneDistortionVBO.usedElements, - unitPointDistortionVBO.usedElements, unitBeamDistortionVBO.usedElements, unitConeDistortionVBO.usedElements, - projectilePointDistortionVBO.usedElements, projectileBeamDistortionVBO.usedElements, projectileConeDistortionVBO.usedElements) - ) + spEcho(stringFormat("distortionGL4Stats Total = %d , (PBC=%d,%d,%d), (unitPBC=%d,%d,%d), (projPBC=%d,%d,%d)", numAddDistortions, pointDistortionVBO.usedElements, beamDistortionVBO.usedElements, coneDistortionVBO.usedElements, unitPointDistortionVBO.usedElements, unitBeamDistortionVBO.usedElements, unitConeDistortionVBO.usedElements, projectilePointDistortionVBO.usedElements, projectileBeamDistortionVBO.usedElements, projectileConeDistortionVBO.usedElements)) return true end if stringFind(command, "distortionGL4skipdraw", nil, true) then @@ -1449,10 +1531,9 @@ function widget:TextCommand(command) end function widget:Initialize() - Spring.Debug.TraceEcho("Initialize distortionGL4") - if spGetConfigString("AllowDeferredMapRendering") == '0' or spGetConfigString("AllowDeferredModelRendering") == '0' then - spEcho('Distortion GL4 requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!') + if spGetConfigString("AllowDeferredMapRendering") == "0" or spGetConfigString("AllowDeferredModelRendering") == "0" then + spEcho("Distortion GL4 requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!") widgetHandler:RemoveWidget() return end @@ -1461,33 +1542,35 @@ function widget:Initialize() return end - if initGL4() == false then return end + if initGL4() == false then + return + end - local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end for _, featureID in ipairs(spGetAllFeatures()) do widget:FeatureCreated(featureID) end - WG['distortionsgl4'] = {} - WG['distortionsgl4'].AddDistortion = AddDistortion - WG['distortionsgl4'].RemoveDistortion = RemoveDistortion - WG['distortionsgl4'].GetDistortionVBO = GetDistortionVBO + WG["distortionsgl4"] = {} + WG["distortionsgl4"].AddDistortion = AddDistortion + WG["distortionsgl4"].RemoveDistortion = RemoveDistortion + WG["distortionsgl4"].GetDistortionVBO = GetDistortionVBO - WG['distortionsgl4'].IntensityMultiplier = function(value) + WG["distortionsgl4"].IntensityMultiplier = function(value) intensityMultiplier = value end - WG['distortionsgl4'].RadiusMultiplier = function(value) + WG["distortionsgl4"].RadiusMultiplier = function(value) radiusMultiplier = value end - widgetHandler:RegisterGlobal('AddDistortion', WG['distortionsgl4'].AddDistortion) - widgetHandler:RegisterGlobal('RemoveDistortion', WG['distortionsgl4'].RemoveDistortion) - widgetHandler:RegisterGlobal('GetDistortionVBO', WG['distortionsgl4'].GetDistortionVBO) + widgetHandler:RegisterGlobal("AddDistortion", WG["distortionsgl4"].AddDistortion) + widgetHandler:RegisterGlobal("RemoveDistortion", WG["distortionsgl4"].RemoveDistortion) + widgetHandler:RegisterGlobal("GetDistortionVBO", WG["distortionsgl4"].GetDistortionVBO) end function widget:UnitScriptDistortion(unitID, unitDefID, distortionIndex, param) diff --git a/luaui/Widgets/gfx_dof.lua b/luaui/Widgets/gfx_dof.lua index dba0114af9e..6c6bbce7f2e 100644 --- a/luaui/Widgets/gfx_dof.lua +++ b/luaui/Widgets/gfx_dof.lua @@ -2,36 +2,35 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Depth of Field", - version = 2.0, - desc = "Blurs far away objects.", - author = "aeonios, Shadowfury333 (with some code from Kleber Garcia)", - date = "Feb. 2019", - license = "GPL, MIT", - layer = -100000, --To run after gfx_deferred_rendering.lua - enabled = false + name = "Depth of Field", + version = 2.0, + desc = "Blurs far away objects.", + author = "aeonios, Shadowfury333 (with some code from Kleber Garcia)", + date = "Feb. 2019", + license = "GPL, MIT", + layer = -100000, --To run after gfx_deferred_rendering.lua + enabled = false, } end - -- Localized Spring API for performance local spEcho = Spring.Echo -local highQuality = true -- doesnt seem to do anything +local highQuality = true -- doesnt seem to do anything local autofocus = true local mousefocus = not autofocus local focusDepth = 300 local fStop = 2 -local autofocusInFocusMultiplier = fStop/2 -- Autofocus Minimum In-Focus region size -local autofocusPower = 6 -- Autofocus Power (lower = blurrier at range) -local autofocusFocalLength = 0.03 -- Autofocus Focal Length +local autofocusInFocusMultiplier = fStop / 2 -- Autofocus Minimum In-Focus region size +local autofocusPower = 6 -- Autofocus Power (lower = blurrier at range) +local autofocusFocalLength = 0.03 -- Autofocus Focal Length ----------------------------------------------------------------- -- Engine Functions ----------------------------------------------------------------- -local spGetCameraPosition = Spring.GetCameraPosition +local spGetCameraPosition = Spring.GetCameraPosition local math_max = math.max local math_log = math.log @@ -42,15 +41,15 @@ local glCreateShader = gl.CreateShader local glCreateTexture = gl.CreateTexture local glDeleteShader = gl.DeleteShader local glDeleteTexture = gl.DeleteTexture -local glTexture = gl.Texture -local glTexRect = gl.TexRect +local glTexture = gl.Texture +local glTexRect = gl.TexRect local glRenderToTexture = gl.RenderToTexture local glUseShader = gl.UseShader local glUniform = gl.Uniform local glUniformInt = gl.UniformInt local glUniformMatrix = gl.UniformMatrix -local GL_DEPTH_COMPONENT = 0x1902 +local GL_DEPTH_COMPONENT = 0x1902 local GL_DEPTH_COMPONENT16 = 0x81A5 local GL_DEPTH_COMPONENT24 = 0x81A6 local GL_DEPTH_COMPONENT32 = 0x81A7 @@ -68,7 +67,6 @@ local chobbyInterface ----------------------------------------------------------------- - local function CleanupTextures() glDeleteTexture(baseBlurTex) glDeleteTexture(baseNearBlurTex) @@ -82,12 +80,7 @@ local function CleanupTextures() glDeleteTexture(depthTex) gl.DeleteFBO(intermediateBlurFBO) gl.DeleteFBO(baseBlurFBO) - baseBlurTex, baseNearBlurTex, intermediateBlurTex0, intermediateBlurTex1, - intermediateBlurTex2, intermediateBlurTex3, finalBlurTex, finalNearBlurTex, - screenTex, depthTex = - nil, nil, nil, nil, - nil, nil, nil, nil, - nil, nil + baseBlurTex, baseNearBlurTex, intermediateBlurTex0, intermediateBlurTex1, intermediateBlurTex2, intermediateBlurTex3, finalBlurTex, finalNearBlurTex, screenTex, depthTex = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil intermediateBlurFBO = nil baseBlurFBO = nil end @@ -97,10 +90,10 @@ end local maxBlurDistance = 10000 --Distance in Spring units above which autofocus blurring can't happen -local vsx = nil -- current viewport width -local vsy = nil -- current viewport height -local vpx = nil -- current viewport pos x -local vpy = nil -- current viewport pos y +local vsx = nil -- current viewport width +local vsy = nil -- current viewport height +local vpx = nil -- current viewport pos x +local vpy = nil -- current viewport pos y local dofShader = nil local screenTex = nil local depthTex = nil @@ -132,8 +125,7 @@ local qualityLoc = nil local passLoc = nil -- shader uniform enums -local shaderPasses = -{ +local shaderPasses = { filterSize = 0, initialBlur = 1, finalBlur = 2, @@ -142,19 +134,21 @@ local shaderPasses = composition = 5, } - function InitTextures() vsx, vsy, vpx, vpy = Spring.GetViewGeometry() - local blurTexSizeX, blurTexSizeY = vsx/2, vsy/2; + local blurTexSizeX, blurTexSizeY = vsx / 2, vsy / 2 CleanupTextures() screenTex = glCreateTexture(vsx, vsy, { - fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + fbo = true, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) - depthTex = gl.CreateTexture(vsx,vsy, { + depthTex = gl.CreateTexture(vsx, vsy, { border = false, format = GL_DEPTH_COMPONENT32, min_filter = GL.NEAREST, @@ -162,46 +156,70 @@ function InitTextures() }) baseBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) if highQuality then baseNearBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) end intermediateBlurTex0 = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) intermediateBlurTex1 = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) intermediateBlurTex2 = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) if highQuality then intermediateBlurTex3 = glCreateTexture(blurTexSizeX, blurTexSizeY, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) end finalBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { - fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + fbo = true, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) if highQuality then finalNearBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { - fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + fbo = true, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) end @@ -209,49 +227,47 @@ function InitTextures() baseBlurFBO = gl.CreateFBO({ color0 = baseBlurTex, color1 = baseNearBlurTex, - drawbuffers = { - GL_COLOR_ATTACHMENT0_EXT, - GL_COLOR_ATTACHMENT1_EXT - } - }) + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + }, + }) intermediateBlurFBO = gl.CreateFBO({ color0 = intermediateBlurTex0, color1 = intermediateBlurTex1, color2 = intermediateBlurTex2, color3 = intermediateBlurTex3, - drawbuffers = { - GL_COLOR_ATTACHMENT0_EXT, - GL_COLOR_ATTACHMENT1_EXT, - GL_COLOR_ATTACHMENT2_EXT, - GL_COLOR_ATTACHMENT3_EXT - } - }) + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + GL_COLOR_ATTACHMENT2_EXT, + GL_COLOR_ATTACHMENT3_EXT, + }, + }) else baseBlurFBO = gl.CreateFBO({ color0 = baseBlurTex, - drawbuffers = { - GL_COLOR_ATTACHMENT0_EXT - } - }) + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + }, + }) intermediateBlurFBO = gl.CreateFBO({ color0 = intermediateBlurTex0, color1 = intermediateBlurTex1, color2 = intermediateBlurTex2, - drawbuffers = { - GL_COLOR_ATTACHMENT0_EXT, - GL_COLOR_ATTACHMENT1_EXT, - GL_COLOR_ATTACHMENT2_EXT - } - }) + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + GL_COLOR_ATTACHMENT2_EXT, + }, + }) end - if not intermediateBlurTex0 or not intermediateBlurTex1 or not intermediateBlurTex2 - or not finalBlurTex or not baseBlurTex or not screenTex or not depthTex - or (highQuality and (not baseNearBlurTex or not intermediateBlurTex3 or not finalNearBlurTex)) then - spEcho("Depth of Field: Failed to create textures!") - widgetHandler:RemoveWidget() + if not intermediateBlurTex0 or not intermediateBlurTex1 or not intermediateBlurTex2 or not finalBlurTex or not baseBlurTex or not screenTex or not depthTex or (highQuality and (not baseNearBlurTex or not intermediateBlurTex3 or not finalNearBlurTex)) then + spEcho("Depth of Field: Failed to create textures!") + widgetHandler:RemoveWidget() return end end @@ -263,7 +279,7 @@ end function init() reset() - if (glCreateShader == nil) then + if glCreateShader == nil then spEcho("[Depth of Field::Initialize] removing widget, no shader support") widgetHandler:RemoveWidget() return @@ -284,11 +300,11 @@ function init() "#define BLUR_START_DIST " .. maxBlurDistance .. "\n", "#define LOW_QUALITY 0 \n", - "#define HIGH_QUALITY 1 \n" + "#define HIGH_QUALITY 1 \n", }, fragment = VFS.LoadFile("LuaUI/Shaders/dof.fs", VFS.RAW_FIRST), - uniformInt = {origTex = 0, blurTex0 = 1, blurTex1 = 2, blurTex2 = 3, blurTex3 = 4}, + uniformInt = { origTex = 0, blurTex0 = 1, blurTex1 = 2, blurTex2 = 3, blurTex3 = 4 }, }) if not dofShader then @@ -318,38 +334,38 @@ end function widget:Initialize() init() - WG['dof'] = {} - WG['dof'].getFocusDepth = function() + WG["dof"] = {} + WG["dof"].getFocusDepth = function() return focusDepth end - WG['dof'].setFocusDepth = function(value) + WG["dof"].setFocusDepth = function(value) focusDepth = value end - WG['dof'].getFstop = function() + WG["dof"].getFstop = function() return fStop end - WG['dof'].setFstop = function(value) + WG["dof"].setFstop = function(value) fStop = value - autofocusInFocusMultiplier = fStop/2 + autofocusInFocusMultiplier = fStop / 2 end - WG['dof'].getHighQuality = function() + WG["dof"].getHighQuality = function() return highQuality end - WG['dof'].setHighQuality = function(value) + WG["dof"].setHighQuality = function(value) highQuality = value InitTextures() end - WG['dof'].getAutofocus = function() + WG["dof"].getAutofocus = function() return autofocus end - WG['dof'].setAutofocus = function(value) + WG["dof"].setAutofocus = function(value) autofocus = value mousefocus = not autofocus end end function reset() - if (glDeleteShader and dofShader) then + if glDeleteShader and dofShader then glDeleteShader(dofShader) end @@ -361,7 +377,7 @@ end function widget:Shutdown() reset() - WG['dof'] = nil + WG["dof"] = nil end local function FilterCalculation() @@ -382,7 +398,7 @@ local function FilterCalculation() end local function InitialBlur() - glUniform(resolutionLoc, vsx/2, vsy/2) + glUniform(resolutionLoc, vsx / 2, vsy / 2) glUniformInt(passLoc, shaderPasses.initialBlur) glTexture(0, baseBlurTex) glTexRect(0, 0, vsx, vsy, false, true) @@ -390,13 +406,13 @@ local function InitialBlur() end local function FinalBlur() - glUniform(resolutionLoc, vsx/2, vsy/2) + glUniform(resolutionLoc, vsx / 2, vsy / 2) glUniformInt(passLoc, shaderPasses.finalBlur) glTexture(0, baseBlurTex) glTexture(1, intermediateBlurTex0) --R glTexture(2, intermediateBlurTex1) --G glTexture(3, intermediateBlurTex2) --B - glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glTexRect(-1 - 0.5 / vsx, 1 + 0.5 / vsy, 1 + 0.5 / vsx, -1 - 0.5 / vsy) glTexture(0, false) glTexture(1, false) glTexture(2, false) @@ -404,7 +420,7 @@ local function FinalBlur() end local function InitialNearBlur() - glUniform(resolutionLoc, vsx/2, vsy/2) + glUniform(resolutionLoc, vsx / 2, vsy / 2) glUniformInt(passLoc, shaderPasses.initialNearBlur) glTexture(0, baseNearBlurTex) glTexRect(0, 0, vsx, vsy, false, true) @@ -412,14 +428,14 @@ local function InitialNearBlur() end local function FinalNearBlur() - glUniform(resolutionLoc, vsx/2, vsy/2) + glUniform(resolutionLoc, vsx / 2, vsy / 2) glUniformInt(passLoc, shaderPasses.finalNearBlur) glTexture(0, baseNearBlurTex) glTexture(1, intermediateBlurTex0) --R glTexture(2, intermediateBlurTex1) --G glTexture(3, intermediateBlurTex2) --B glTexture(4, intermediateBlurTex3) --A - glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glTexRect(-1 - 0.5 / vsx, 1 + 0.5 / vsy, 1 + 0.5 / vsx, -1 - 0.5 / vsy) glTexture(0, false) glTexture(1, false) glTexture(2, false) @@ -431,7 +447,7 @@ local function Composition() glUniformInt(passLoc, shaderPasses.composition) glTexture(0, screenTex) glTexture(1, finalBlurTex) - if (highQuality) then + if highQuality then glTexture(2, finalNearBlurTex) end @@ -442,18 +458,24 @@ local function Composition() end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorld() - if chobbyInterface then return end - gl.ActiveShader(dofShader, function() glUniformMatrix(projectionMatLoc, "projection") end) + if chobbyInterface then + return + end + gl.ActiveShader(dofShader, function() + glUniformMatrix(projectionMatLoc, "projection") + end) end function widget:DrawScreenEffects() - if chobbyInterface then return end + if chobbyInterface then + return + end gl.Blending(false) glCopyToTexture(screenTex, 0, 0, vpx, vpy, vsx, vsy) -- the original screen image glCopyToTexture(depthTex, 0, 0, vpx, vpy, vsx, vsy) -- the original screen image @@ -461,26 +483,26 @@ function widget:DrawScreenEffects() local mx, my = Spring.GetMouseState() glUseShader(dofShader) - glUniform(distanceLimitsLoc, gl.GetViewRange()) - - glUniformInt(autofocusLoc, autofocus and 1 or 0) - glUniformInt(mousefocusLoc, mousefocus and 1 or 0) - glUniform(autofocusFudgeFactorLoc, autofocusInFocusMultiplier) - glUniform(autofocusPowerLoc, autofocusPower) - glUniform(autofocusFocalLengthLoc, autofocusFocalLength) - glUniform(mouseDepthCoordLoc, mx/vsx, my/vsy) - glUniform(focusDepthLoc, focusDepth / maxBlurDistance) - glUniform(fStopLoc, fStop) - glUniformInt(qualityLoc, highQuality and 1 or 0) - - gl.ActiveFBO(baseBlurFBO, FilterCalculation) - gl.ActiveFBO(intermediateBlurFBO, InitialBlur) - glRenderToTexture(finalBlurTex, FinalBlur) - if highQuality then - gl.ActiveFBO(intermediateBlurFBO, InitialNearBlur) - glRenderToTexture(finalNearBlurTex, FinalNearBlur) - end - Composition() + glUniform(distanceLimitsLoc, gl.GetViewRange()) + + glUniformInt(autofocusLoc, autofocus and 1 or 0) + glUniformInt(mousefocusLoc, mousefocus and 1 or 0) + glUniform(autofocusFudgeFactorLoc, autofocusInFocusMultiplier) + glUniform(autofocusPowerLoc, autofocusPower) + glUniform(autofocusFocalLengthLoc, autofocusFocalLength) + glUniform(mouseDepthCoordLoc, mx / vsx, my / vsy) + glUniform(focusDepthLoc, focusDepth / maxBlurDistance) + glUniform(fStopLoc, fStop) + glUniformInt(qualityLoc, highQuality and 1 or 0) + + gl.ActiveFBO(baseBlurFBO, FilterCalculation) + gl.ActiveFBO(intermediateBlurFBO, InitialBlur) + glRenderToTexture(finalBlurTex, FinalBlur) + if highQuality then + gl.ActiveFBO(intermediateBlurFBO, InitialNearBlur) + glRenderToTexture(finalNearBlurTex, FinalNearBlur) + end + Composition() glUseShader(0) end @@ -504,7 +526,7 @@ function widget:SetConfigData(data) mousefocus = not autofocus focusDepth = data.focusDepth fStop = data.fStop - autofocusInFocusMultiplier = fStop/2 + autofocusInFocusMultiplier = fStop / 2 --if data.autofocusInFocusMultiplier then -- autofocusInFocusMultiplier = data.autofocusInFocusMultiplier diff --git a/luaui/Widgets/gfx_fog_diaglines_gl4.lua b/luaui/Widgets/gfx_fog_diaglines_gl4.lua index fa0697b2a8a..004f3eb63ab 100644 --- a/luaui/Widgets/gfx_fog_diaglines_gl4.lua +++ b/luaui/Widgets/gfx_fog_diaglines_gl4.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Fog Diagonal Lines GL4", - desc = "Sharp screen-space diagonal lines over fog-of-war areas", - author = "ix", - date = "2026.04.29", + name = "Fog Diagonal Lines GL4", + desc = "Sharp screen-space diagonal lines over fog-of-war areas", + author = "ix", + date = "2026.04.29", license = "GPL V2", - layer = 0, + layer = 0, enabled = true, } end @@ -20,28 +20,28 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -- Tunables -local strength = 0.25 -- 0 = lines off, 1 = full opacity -local lineFreq = 35.94 -- elmos per line cycle (world-space; lines anchor to ground and grow with zoom). Now a true spacing since the shader uses a normalised line direction; was visually ~29.7 before two +10% spacing bumps. -local lineWidth = 0.38 -- 0..1 fraction of cycle that is line; lower = thinner lines + bigger gaps -local lineSharpness = 0.3725 -- smoothstep half-width at the edge (smaller = sharper, auto-widened when zoomed out). 0.3725 == blur slider 0.43 (see sharpnessMin/Max below) -local scrollSpeed = 0.0067 -- cycles per second +local strength = 0.25 -- 0 = lines off, 1 = full opacity +local lineFreq = 35.94 -- elmos per line cycle (world-space; lines anchor to ground and grow with zoom). Now a true spacing since the shader uses a normalised line direction; was visually ~29.7 before two +10% spacing bumps. +local lineWidth = 0.38 -- 0..1 fraction of cycle that is line; lower = thinner lines + bigger gaps +local lineSharpness = 0.3725 -- smoothstep half-width at the edge (smaller = sharper, auto-widened when zoomed out). 0.3725 == blur slider 0.43 (see sharpnessMin/Max below) +local scrollSpeed = 0.0067 -- cycles per second -- Subtle animated noise that locally fades the lines for a dynamic feel. -local noiseScale = 512.0 -- elmos per noise cell; larger = bigger, softer blotches -local noiseAmount = 0.46 -- 0 = off, 1 = noise can fully fade lines out -local noiseSpeed = 0.010 -- how fast the noise field drifts +local noiseScale = 512.0 -- elmos per noise cell; larger = bigger, softer blotches +local noiseAmount = 0.46 -- 0 = off, 1 = noise can fully fade lines out +local noiseSpeed = 0.010 -- how fast the noise field drifts -- Range that the 0..1 "blurriness" settings slider maps lineSharpness onto. -- The default 0.19 above sits a little below the middle of this range. -local sharpnessMin = 0.05 -- slider at 0 = crisp lines -local sharpnessMax = 0.80 -- slider at 1 = strongly blurred +local sharpnessMin = 0.05 -- slider at 0 = crisp lines +local sharpnessMax = 0.80 -- slider at 1 = strongly blurred -- Smoothing tunables (temporal blend toward live engine coverage) -local accumUpdateRate = 2 -- update accumulator every N gameframes -local accumBlendAlpha = 0.18 -- per-update fraction of new coverage; lower = smoother but laggier +local accumUpdateRate = 2 -- update accumulator every N gameframes +local accumBlendAlpha = 0.18 -- per-update fraction of new coverage; lower = smoother but laggier local accumFastBlendCount = 6 -- how many fast updates to do at startup / on ally team change -local lineColor = { 0.0, 0.0, 0.0 } -- black +local lineColor = { 0.0, 0.0, 0.0 } -- black local diagShader = nil local accumShader = nil @@ -57,18 +57,18 @@ local diagShaderSourceCache = { vssrcpath = "LuaUI/Shaders/fog_diaglines.vert.glsl", fssrcpath = "LuaUI/Shaders/fog_diaglines.frag.glsl", uniformInt = { - mapDepths = 0, + mapDepths = 0, coverageTex = 1, }, uniformFloat = { - lineColor = { 0, 0, 0, 0.7 }, - lineFreq = lineFreq, - lineWidth = lineWidth, + lineColor = { 0, 0, 0, 0.7 }, + lineFreq = lineFreq, + lineWidth = lineWidth, lineSharpness = lineSharpness, - scrollSpeed = scrollSpeed, - noiseScale = noiseScale, - noiseAmount = noiseAmount, - noiseSpeed = noiseSpeed, + scrollSpeed = scrollSpeed, + noiseScale = noiseScale, + noiseAmount = noiseAmount, + noiseSpeed = noiseSpeed, }, shaderName = "Fog Diagonal Lines GL4", shaderConfig = {}, @@ -78,7 +78,7 @@ local accumShaderSourceCache = { vssrcpath = "LuaUI/Shaders/fog_diaglines_accum.vert.glsl", fssrcpath = "LuaUI/Shaders/fog_diaglines_accum.frag.glsl", uniformInt = { - losTex = 0, + losTex = 0, radarTex = 1, }, uniformFloat = { @@ -89,7 +89,9 @@ local accumShaderSourceCache = { } local function updateAccumulator(count) - if not accumShader or not coverageTex then return end + if not accumShader or not coverageTex then + return + end gl.DepthMask(false) gl.Culling(false) gl.DepthTest(false) @@ -136,12 +138,12 @@ function widget:Initialize() accumTexY = losTexInfo and losTexInfo.ysize or math.floor(Game.mapSizeZ / mapMipScale) coverageTex = gl.CreateTexture(accumTexX, accumTexY, { - format = GL.RGBA8, - fbo = true, + format = GL.RGBA8, + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP_TO_EDGE, - wrap_t = GL.CLAMP_TO_EDGE, + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, }) if not coverageTex then spEcho("Fog Diagonal Lines GL4: failed to create coverage accumulator texture") @@ -157,13 +159,19 @@ function widget:Initialize() needsClear = true WG.fogdiaglines = { - getStrength = function() return strength end, - setStrength = function(value) strength = math.max(0, math.min(1, value or 0)) end, + getStrength = function() + return strength + end, + setStrength = function(value) + strength = math.max(0, math.min(1, value or 0)) + end, -- Blurriness slider: 0 = sharp edges, 1 = strongly blurred. Maps linearly -- onto lineSharpness (the smoothstep half-width at each line edge). getBlurriness = function() local range = sharpnessMax - sharpnessMin - if range <= 0 then return 0 end -- guard against a degenerate (min == max) range + if range <= 0 then + return 0 + end -- guard against a degenerate (min == max) range return (lineSharpness - sharpnessMin) / range end, setBlurriness = function(value) @@ -175,7 +183,9 @@ end function widget:Shutdown() WG.fogdiaglines = nil - if coverageTex then gl.DeleteTexture(coverageTex) end + if coverageTex then + gl.DeleteTexture(coverageTex) + end coverageTex = nil diagShader = nil accumShader = nil @@ -194,7 +204,9 @@ function widget:GameFrame(n) end function widget:DrawGenesis() - if not coverageTex or not accumShader or not fullScreenQuadVAO then return end + if not coverageTex or not accumShader or not fullScreenQuadVAO then + return + end if needsClear then gl.RenderToTexture(coverageTex, function() gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) @@ -208,8 +220,12 @@ function widget:DrawGenesis() end function widget:DrawWorldPreUnit() - if not diagShader or not fullScreenQuadVAO or not coverageTex then return end - if strength <= 0.001 or spGetMapDrawMode() ~= "los" then return end + if not diagShader or not fullScreenQuadVAO or not coverageTex then + return + end + if strength <= 0.001 or spGetMapDrawMode() ~= "los" then + return + end gl.Texture(0, "$map_gbuffer_zvaltex") gl.Texture(1, coverageTex) @@ -232,7 +248,9 @@ function widget:DrawWorldPreUnit() diagShader:Deactivate() gl.DepthTest(true) - for i = 0, 1 do gl.Texture(i, false) end + for i = 0, 1 do + gl.Texture(i, false) + end end function widget:GetConfigData() @@ -240,7 +258,9 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - if data.strength ~= nil then strength = data.strength end + if data.strength ~= nil then + strength = data.strength + end -- blurriness is the 0..1 slider value; map it back onto lineSharpness. if data.blurriness ~= nil then local t = math.max(0, math.min(1, data.blurriness)) diff --git a/luaui/Widgets/gfx_glass.lua b/luaui/Widgets/gfx_glass.lua index a2bbbde0df3..aafe45a83e0 100644 --- a/luaui/Widgets/gfx_glass.lua +++ b/luaui/Widgets/gfx_glass.lua @@ -6,15 +6,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Stained Glass", - desc = "Very psychedelic", - author = "Beherith", - layer = 1900, - enabled = true, + name = "Stained Glass", + desc = "Very psychedelic", + author = "Beherith", + layer = 1900, + enabled = true, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -28,9 +27,8 @@ local spEcho = Spring.Echo -- Lua Shortcuts ----------------------------------------------------------------- -local glTexture = gl.Texture -local glBlending = gl.Blending - +local glTexture = gl.Texture +local glBlending = gl.Blending ----------------------------------------------------------------- -- Shader Sources @@ -226,23 +224,24 @@ local fullTexQuad -- Local Functions ----------------------------------------------------------------- - ----------------------------------------------------------------- -- Widget Functions ----------------------------------------------------------------- local glasstriggerfeaturedefsids = {} for featureDefID, featureDef in pairs(FeatureDefs) do - if string.find(featureDef.name, "mushroom", nil, true) then + if string.find(featureDef.name, "mushroom", nil, true) then glasstriggerfeaturedefsids[featureDefID] = true end end -if next(glasstriggerfeaturedefsids) == nil then return end +if next(glasstriggerfeaturedefsids) == nil then + return +end function widget:Initialize() if Spring.Utilities.Gametype.IsSinglePlayer ~= true then widgetHandler:RemoveWidget() - return + return end if gl.CreateShader == nil then spEcho("glass: createshader not supported, removing") @@ -264,9 +263,9 @@ function widget:Initialize() local shaderCompiled = glassShader:Initialize() if not shaderCompiled then - spEcho("Failed to compile Contrast Adaptive Sharpen shader, removing widget") - widgetHandler:RemoveWidget() - return + spEcho("Failed to compile Contrast Adaptive Sharpen shader, removing widget") + widgetHandler:RemoveWidget() + return end fullTexQuad = gl.GetVAO() @@ -274,7 +273,6 @@ function widget:Initialize() widgetHandler:RemoveWidget() --no fallback for potatoes return end - end function widget:Shutdown() @@ -288,12 +286,11 @@ function widget:Shutdown() end function widget:PlayerChanged() - if Spring.GetSpectatingState() then - widgetHandler:RemoveWidget() + if Spring.GetSpectatingState() then + widgetHandler:RemoveWidget() end end - local gaiaTeamID = Spring.GetGaiaTeamID() local myteamid = Spring.GetMyTeamID() local effectOn = false @@ -303,16 +300,16 @@ function widget:FeatureDestroyed(featureID, allyTeam) if allyTeam == gaiaTeamID and glasstriggerfeaturedefsids[Spring.GetFeatureDefID(featureID)] then local fx, fy, fz = Spring.GetFeaturePosition(featureID) local featureHealth = Spring.GetFeatureHealth(featureID) - local mr, mm, er, em, rl = Spring.GetFeatureResources(featureID) - spEcho("Reclaiming that was probably not a good idea...", featureHealth, mr, mm, er, em, rl ) - if featureHealth > 0 and er == 0 then - local unitsnearby = Spring.GetUnitsInCylinder(fx,fz, 170, myteamid) - for i, unitID in ipairs(unitsnearby) do + local mr, mm, er, em, rl = Spring.GetFeatureResources(featureID) + spEcho("Reclaiming that was probably not a good idea...", featureHealth, mr, mm, er, em, rl) + if featureHealth > 0 and er == 0 then + local unitsnearby = Spring.GetUnitsInCylinder(fx, fz, 170, myteamid) + for i, unitID in ipairs(unitsnearby) do --spEcho("nearby", unitID) - local unitDefID = Spring.GetUnitDefID(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) --spEcho("nearby", unitID, UnitDefs[unitDefID].name) - if UnitDefs[unitDefID].name == 'armcom' or UnitDefs[unitDefID].name == 'corcom' then - if effectOn == false then + if UnitDefs[unitDefID].name == "armcom" or UnitDefs[unitDefID].name == "corcom" then + if effectOn == false then effectOn = true effectStart = os.clock() --spEcho("Effect started") @@ -324,28 +321,29 @@ function widget:FeatureDestroyed(featureID, allyTeam) end function widget:DrawScreenEffects() - if effectOn then + if effectOn then --glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - if WG['screencopymanager'] and WG['screencopymanager'].GetScreenCopy then - screenCopyTex = WG['screencopymanager'].GetScreenCopy() + if WG["screencopymanager"] and WG["screencopymanager"].GetScreenCopy then + screenCopyTex = WG["screencopymanager"].GetScreenCopy() else --glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - spEcho("Missing Screencopy Manager, exiting", WG['screencopymanager'] ) + spEcho("Missing Screencopy Manager, exiting", WG["screencopymanager"]) widgetHandler:RemoveWidget() return false end - if screenCopyTex == nil then return end + if screenCopyTex == nil then + return + end local dt = os.clock() - effectStart - if dt > 15 then - effectOn = false + if dt > 15 then + effectOn = false widgetHandler:RemoveWidget() return false end local h = 0.33 * dt - local strength = h * math.exp(1.0 - h) -- iq expimpulse, peaking at 3 + local strength = h * math.exp(1.0 - h) -- iq expimpulse, peaking at 3 - glTexture(0, screenCopyTex) glBlending(true) glassShader:Activate() @@ -357,4 +355,3 @@ function widget:DrawScreenEffects() glTexture(0, false) end end - diff --git a/luaui/Widgets/gfx_guishader.lua b/luaui/Widgets/gfx_guishader.lua index d3d6ec0d1d2..2c44ea56b55 100644 --- a/luaui/Widgets/gfx_guishader.lua +++ b/luaui/Widgets/gfx_guishader.lua @@ -1,6 +1,6 @@ -- Intel GPU compatibility: Use a simplified shader path -- The complex derivative-based quad message passing doesn't work reliably on Intel GPUs -local isIntelGPU = Platform ~= nil and Platform.gpuVendor == 'Intel' +local isIntelGPU = Platform ~= nil and Platform.gpuVendor == "Intel" local widget = widget ---@type Widget @@ -12,11 +12,10 @@ function widget:GetInfo() date = "17 february 2015", license = "GNU GPL, v2 or later", layer = -990000, -- other widgets can be run earlier (lower layer) and thus guishader blur are will lag behind a frame, (like tooltip screenblur) - enabled = true + enabled = true, } end - -- Localized functions for performance local mathMax = math.max local stringFind = string.find @@ -84,7 +83,9 @@ local cachedIvsy = 0.5 / vsy function widget:ViewResize(_, _) vsx, vsy, vpx, vpy = spGetViewGeometry() - if screencopyUI then glDeleteTexture(screencopyUI) end + if screencopyUI then + glDeleteTexture(screencopyUI) + end screencopyUI = gl.CreateTexture(vsx, vsy, { border = false, min_filter = GL.LINEAR, @@ -118,7 +119,6 @@ local function DrawStencilTexture(world, fullscreen) end if next(guishaderRects) or next(guishaderScreenRects) or next(guishaderDlists) then - if usedStencilTex == nil or vsx + vsy ~= oldvs then glDeleteTexture(usedStencilTex) @@ -157,7 +157,7 @@ local function DrawStencilTexture(world, fullscreen) glRect(rect[1], rect[2], rect[3], rect[4]) end for _, dlist in pairs(guishaderDlists) do - glColor(1,1,1,1) + glColor(1, 1, 1, 1) glCallList(dlist) end elseif fullscreen then @@ -167,7 +167,7 @@ local function DrawStencilTexture(world, fullscreen) glRect(rect[1], rect[2], rect[3], rect[4]) end for _, dlist in pairs(guishaderScreenDlists) do - glColor(1,1,1,1) + glColor(1, 1, 1, 1) glCallList(dlist) end end @@ -184,7 +184,7 @@ end local function CheckHardware() if not canShader then - spEcho("guishader api: your hardware does not support shaders, OR: change springsettings: \"enable lua shaders\" ") + spEcho('guishader api: your hardware does not support shaders, OR: change springsettings: "enable lua shaders" ') widgetHandler:RemoveWidget() return false end @@ -325,18 +325,15 @@ local function CreateShaders() ivsx = 0, ivsy = 0, blurScale = 1, - } + }, }, "guishader blurShader") - if not blurShader:Initialize() then Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader blurShader: shader error: " .. gl.GetShaderLog()) widgetHandler:RemoveWidget() return false end - - screencopyUI = gl.CreateTexture(vsx, vsy, { border = false, min_filter = GL.LINEAR, @@ -358,15 +355,17 @@ local function DeleteShaders() glDeleteTexture(usedStencilTex) glDeleteTexture(screencopyUI) stenciltex, stenciltexScreen, screencopyUI, usedStencilTex = nil, nil, nil, nil - if blurShader then blurShader:Finalize() end + if blurShader then + blurShader:Finalize() + end blurShader = nil end function widget:Shutdown() DeleteShaders() - WG['guishader'] = nil - widgetHandler:DeregisterGlobal('GuishaderInsertRect') - widgetHandler:DeregisterGlobal('GuishaderRemoveRect') + WG["guishader"] = nil + widgetHandler:DeregisterGlobal("GuishaderInsertRect") + widgetHandler:DeregisterGlobal("GuishaderRemoveRect") end function widget:DrawScreenEffects() -- This blurs the world underneath UI elements @@ -379,15 +378,17 @@ function widget:DrawScreenEffects() -- This blurs the world underneath UI elemen return end - if WG['screencopymanager'] and WG['screencopymanager'].GetScreenCopy then - screencopy = WG['screencopymanager'].GetScreenCopy() + if WG["screencopymanager"] and WG["screencopymanager"].GetScreenCopy then + screencopy = WG["screencopymanager"].GetScreenCopy() else - spEcho("Missing Screencopy Manager, exiting", WG['screencopymanager'] ) + spEcho("Missing Screencopy Manager, exiting", WG["screencopymanager"]) widgetHandler:RemoveWidget() return false end - if screencopy == nil then return end + if screencopy == nil then + return + end glTexture(false) glColor(1, 1, 1, 1) @@ -407,10 +408,10 @@ function widget:DrawScreenEffects() -- This blurs the world underneath UI elemen glTexture(screencopy) glTexture(2, stenciltex) blurShader:Activate() - blurShader:SetUniform("ivsx", cachedIvsx) - blurShader:SetUniform("ivsy", cachedIvsy) - blurShader:SetUniform("blurScale", blurScale) - glTexRect(0, vsy, vsx, 0) + blurShader:SetUniform("ivsx", cachedIvsx) + blurShader:SetUniform("ivsy", cachedIvsy) + blurShader:SetUniform("blurScale", blurScale) + glTexRect(0, vsy, vsx, 0) blurShader:Deactivate() for i = 1, extraBlurPasses do @@ -418,7 +419,7 @@ function widget:DrawScreenEffects() -- This blurs the world underneath UI elemen glTexture(screencopyUI) glTexture(2, stenciltex) blurShader:Activate() - glTexRect(0, vsy, vsx, 0) + glTexRect(0, vsy, vsx, 0) blurShader:Deactivate() end @@ -458,10 +459,10 @@ local function DrawScreen() -- This blurs the UI elements obscured by other UI e glTexture(2, stenciltexScreen) blurShader:Activate() - blurShader:SetUniform("ivsx", cachedIvsx) - blurShader:SetUniform("ivsy", cachedIvsy) - blurShader:SetUniform("blurScale", blurScale) - glTexRect(0, vsy, vsx, 0) + blurShader:SetUniform("ivsx", cachedIvsx) + blurShader:SetUniform("ivsy", cachedIvsy) + blurShader:SetUniform("blurScale", blurScale) + glTexRect(0, vsy, vsx, 0) blurShader:Deactivate() glTexture(2, false) glTexture(false) @@ -471,7 +472,7 @@ local function DrawScreen() -- This blurs the UI elements obscured by other UI e glTexture(screencopyUI) glTexture(2, stenciltexScreen) blurShader:Activate() - glTexRect(0, vsy, vsx, 0) + glTexRect(0, vsy, vsx, 0) blurShader:Deactivate() glTexture(2, false) glTexture(false) @@ -479,7 +480,7 @@ local function DrawScreen() -- This blurs the UI elements obscured by other UI e end for k, v in pairs(renderDlists) do - glColor(1,1,1,1) + glColor(1, 1, 1, 1) glCallList(k) end end @@ -506,14 +507,14 @@ function widget:Initialize() self:UpdateCallIns() - WG['guishader'] = {} - WG['guishader'].InsertDlist = function(dlist, name, force) + WG["guishader"] = {} + WG["guishader"].InsertDlist = function(dlist, name, force) if force or guishaderDlists[name] ~= dlist then guishaderDlists[name] = dlist updateStencilTexture = true end end - WG['guishader'].RemoveDlist = function(name) + WG["guishader"].RemoveDlist = function(name) local found = guishaderDlists[name] ~= nil if found then guishaderDlists[name] = nil @@ -521,7 +522,7 @@ function widget:Initialize() end return found end - WG['guishader'].DeleteDlist = function(name) + WG["guishader"].DeleteDlist = function(name) local found = guishaderDlists[name] ~= nil if found then deleteDlistQueue[#deleteDlistQueue + 1] = guishaderDlists[name] @@ -530,11 +531,11 @@ function widget:Initialize() end return found end - WG['guishader'].InsertRect = function(left, top, right, bottom, name) + WG["guishader"].InsertRect = function(left, top, right, bottom, name) guishaderRects[name] = { left, top, right, bottom } updateStencilTexture = true end - WG['guishader'].RemoveRect = function(name) + WG["guishader"].RemoveRect = function(name) local found = guishaderRects[name] ~= nil if found then guishaderRects[name] = nil @@ -542,11 +543,11 @@ function widget:Initialize() end return found end - WG['guishader'].InsertScreenDlist = function(dlist, name) + WG["guishader"].InsertScreenDlist = function(dlist, name) guishaderScreenDlists[name] = dlist updateStencilTextureScreen = true end - WG['guishader'].RemoveScreenDlist = function(name) + WG["guishader"].RemoveScreenDlist = function(name) local found = guishaderScreenDlists[name] ~= nil if found then guishaderScreenDlists[name] = nil @@ -554,7 +555,7 @@ function widget:Initialize() end return found end - WG['guishader'].DeleteScreenDlist = function(name) + WG["guishader"].DeleteScreenDlist = function(name) local found = guishaderScreenDlists[name] ~= nil if found then deleteDlistQueue[#deleteDlistQueue + 1] = guishaderScreenDlists[name] @@ -562,11 +563,11 @@ function widget:Initialize() end return found end - WG['guishader'].InsertScreenRect = function(left, top, right, bottom, name) + WG["guishader"].InsertScreenRect = function(left, top, right, bottom, name) guishaderScreenRects[name] = { left, top, right, bottom } updateStencilTextureScreen = true end - WG['guishader'].RemoveScreenRect = function(name) + WG["guishader"].RemoveScreenRect = function(name) local found = guishaderScreenRects[name] ~= nil if found then guishaderScreenRects[name] = nil @@ -575,33 +576,33 @@ function widget:Initialize() return found end - WG['guishader'].setScreenBlur = function(value) + WG["guishader"].setScreenBlur = function(value) updateStencilTextureScreen = true screenBlur = value end - WG['guishader'].getScreenBlur = function(value) + WG["guishader"].getScreenBlur = function(value) return screenBlur end -- will let it draw a given dlist to be rendered on top of screenblur - WG['guishader'].insertRenderDlist = function(value) + WG["guishader"].insertRenderDlist = function(value) renderDlists[value] = true end - WG['guishader'].removeRenderDlist = function(value) + WG["guishader"].removeRenderDlist = function(value) if renderDlists[value] then renderDlists[value] = nil end end - WG.guishader.DrawScreen = DrawScreen -- widgethandler wont call DrawScreen when chobby interface is shown, but it will call this one as exception + WG.guishader.DrawScreen = DrawScreen -- widgethandler wont call DrawScreen when chobby interface is shown, but it will call this one as exception - widgetHandler:RegisterGlobal('GuishaderInsertRect', WG['guishader'].InsertRect) - widgetHandler:RegisterGlobal('GuishaderRemoveRect', WG['guishader'].RemoveRect) + widgetHandler:RegisterGlobal("GuishaderInsertRect", WG["guishader"].InsertRect) + widgetHandler:RegisterGlobal("GuishaderRemoveRect", WG["guishader"].RemoveRect) end function widget:RecvLuaMsg(msg, playerID) - if stringFind(msg, 'LobbyOverlayActive', 1, true) == 1 then - screenBlur = (stringFind(msg, 'LobbyOverlayActive1', 1, true) == 1) + if stringFind(msg, "LobbyOverlayActive", 1, true) == 1 then + screenBlur = (stringFind(msg, "LobbyOverlayActive1", 1, true) == 1) updateStencilTextureScreen = true end end diff --git a/luaui/Widgets/gfx_highlight_commander_wrecks.lua b/luaui/Widgets/gfx_highlight_commander_wrecks.lua index 714bd59f081..41ddd395db6 100644 --- a/luaui/Widgets/gfx_highlight_commander_wrecks.lua +++ b/luaui/Widgets/gfx_highlight_commander_wrecks.lua @@ -1,16 +1,16 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Highlight Commander Wrecks", - desc = "Show a vertical beam on each dead commander that can be resurrected", - author = "citrine", - date = "2024", - license = "GNU GPL, v2 or later", - version = 5, - layer = 0, - enabled = true - } + return { + name = "Highlight Commander Wrecks", + desc = "Show a vertical beam on each dead commander that can be resurrected", + author = "citrine", + date = "2024", + license = "GNU GPL, v2 or later", + version = 5, + layer = 0, + enabled = true, + } end -- configuration @@ -36,11 +36,11 @@ local SpringGetMapDrawMode = Spring.GetMapDrawMode -- util local function map(list, func) - local result = {} - for i, v in ipairs(list) do - result[i] = func(v, i) - end - return result + local result = {} + for i, v in ipairs(list) do + result[i] = func(v, i) + end + return result end -- GL4 @@ -49,7 +49,7 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local vsSrc = [[ #version 420 @@ -115,226 +115,209 @@ local fsSrc = [[ local shader local highlightVBOLayout = { - { id = 0, name = "position", size = 3 }, + { id = 0, name = "position", size = 3 }, } local instanceVBO = nil local instanceVBOLayout = { - { id = 1, name = 'position', size = 3 }, - { id = 2, name = 'radius', size = 1 }, - { id = 3, name = 'height', size = 1 }, - { id = 4, name = 'color', size = 4 }, + { id = 1, name = "position", size = 3 }, + { id = 2, name = "radius", size = 1 }, + { id = 3, name = "height", size = 1 }, + { id = 4, name = "color", size = 4 }, } local function makeCylinderVBO(sections) - local vboData = {} - for i = 0, sections do - local theta = 2 * math.pi * i / sections - local x = math.cos(theta) - local z = math.sin(theta) - - vboData[#vboData + 1] = x - vboData[#vboData + 1] = 0 - vboData[#vboData + 1] = z - - vboData[#vboData + 1] = x - vboData[#vboData + 1] = 1 - vboData[#vboData + 1] = z - end - - local numVertices = #vboData / 3 - - local vbo = gl.GetVBO(GL.ARRAY_BUFFER, true) - vbo:Define( - numVertices, - highlightVBOLayout - ) - vbo:Upload(vboData) - - return vbo, numVertices + local vboData = {} + for i = 0, sections do + local theta = 2 * math.pi * i / sections + local x = math.cos(theta) + local z = math.sin(theta) + + vboData[#vboData + 1] = x + vboData[#vboData + 1] = 0 + vboData[#vboData + 1] = z + + vboData[#vboData + 1] = x + vboData[#vboData + 1] = 1 + vboData[#vboData + 1] = z + end + + local numVertices = #vboData / 3 + + local vbo = gl.GetVBO(GL.ARRAY_BUFFER, true) + vbo:Define(numVertices, highlightVBOLayout) + vbo:Upload(vboData) + + return vbo, numVertices end local function makeInstanceVBO(layout, vertexVBO, numVertices) - local vbo = InstanceVBOTable.makeInstanceVBOTable(layout, nil, "gfx_highlight_commander_wrecks") - vbo.vertexVBO = vertexVBO - vbo.numVertices = numVertices - vbo.VAO = InstanceVBOTable.makeVAOandAttach(vbo.vertexVBO, vbo.instanceVBO) - return vbo + local vbo = InstanceVBOTable.makeInstanceVBOTable(layout, nil, "gfx_highlight_commander_wrecks") + vbo.vertexVBO = vertexVBO + vbo.numVertices = numVertices + vbo.VAO = InstanceVBOTable.makeVAOandAttach(vbo.vertexVBO, vbo.instanceVBO) + return vbo end local function initGL4() - local cylinderVBO, cylinderVertices = makeCylinderVBO(CYLINDER_SECTIONS) - instanceVBO = makeInstanceVBO(instanceVBOLayout, cylinderVBO, cylinderVertices) - - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() - vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - shader = LuaShader( - { - vertex = vsSrc, - fragment = fsSrc, - }, - "gfx_highlight_commander_wrecks" - ) - local shaderCompiled = shader:Initialize() - return shaderCompiled + local cylinderVBO, cylinderVertices = makeCylinderVBO(CYLINDER_SECTIONS) + instanceVBO = makeInstanceVBO(instanceVBOLayout, cylinderVBO, cylinderVertices) + + local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() + vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) + fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) + shader = LuaShader({ + vertex = vsSrc, + fragment = fsSrc, + }, "gfx_highlight_commander_wrecks") + local shaderCompiled = shader:Initialize() + return shaderCompiled end -- widget code local function shouldHighlight(unitName) - return highlightUnitNames[unitName] or false + return highlightUnitNames[unitName] or false end local function addHighlight(featureID, noUpload) - local m, dm, e, de, rl, rt = Spring.GetFeatureResources(featureID) - if m > 0 then - local x, y, z = Spring.GetFeaturePosition(featureID) - y = Spring.GetGroundHeight(x,z) - 50 --account for deformable terrain - local color = DEFAULT_COLOR - if useTeamColor then - local featureTeamID = SpringGetFeatureTeam(featureID) - - if featureTeamID ~= nil then - local r, g, b = Spring.GetTeamColor(featureTeamID) - color = { r, g, b, DEFAULT_OPACITY } - end - end - pushElementInstance( - instanceVBO, - { - x, y, z, - CYLINDER_RADIUS, - CYLINDER_HEIGHT, - unpack(color), - }, - featureID, - true, - noUpload - ) - end + local m, dm, e, de, rl, rt = Spring.GetFeatureResources(featureID) + if m > 0 then + local x, y, z = Spring.GetFeaturePosition(featureID) + y = Spring.GetGroundHeight(x, z) - 50 --account for deformable terrain + local color = DEFAULT_COLOR + if useTeamColor then + local featureTeamID = SpringGetFeatureTeam(featureID) + + if featureTeamID ~= nil then + local r, g, b = Spring.GetTeamColor(featureTeamID) + color = { r, g, b, DEFAULT_OPACITY } + end + end + pushElementInstance(instanceVBO, { + x, + y, + z, + CYLINDER_RADIUS, + CYLINDER_HEIGHT, + unpack(color), + }, featureID, true, noUpload) + end end local function removeHighlight(featureID, noUpload) - popElementInstance(instanceVBO, featureID, noUpload) + popElementInstance(instanceVBO, featureID, noUpload) end local function checkAddHighlight(featureID, noUpload) - local resUnitName = SpringGetFeatureResurrect(featureID) - if resUnitName ~= nil and shouldHighlight(resUnitName) then - addHighlight(featureID, noUpload) - end + local resUnitName = SpringGetFeatureResurrect(featureID) + if resUnitName ~= nil and shouldHighlight(resUnitName) then + addHighlight(featureID, noUpload) + end end local function checkRemoveHighlight(featureID, noUpload) - if instanceVBO.instanceIDtoIndex[featureID] ~= nil then - removeHighlight(featureID, noUpload) - end + if instanceVBO.instanceIDtoIndex[featureID] ~= nil then + removeHighlight(featureID, noUpload) + end end local function checkAllFeatures() - if instanceVBO == nil then - return - end + if instanceVBO == nil then + return + end - InstanceVBOTable.clearInstanceTable(instanceVBO) + InstanceVBOTable.clearInstanceTable(instanceVBO) - for _, featureID in ipairs(SpringGetAllFeatures()) do - checkAddHighlight(featureID, true) - end + for _, featureID in ipairs(SpringGetAllFeatures()) do + checkAddHighlight(featureID, true) + end - InstanceVBOTable.uploadAllElements(instanceVBO) + InstanceVBOTable.uploadAllElements(instanceVBO) end function widget:DrawWorld() - if Spring.IsGUIHidden() then - return - end - if instanceVBO.usedElements == 0 then - return - end - - gl.DepthTest(GL.LEQUAL) - shader:Activate() - instanceVBO.VAO:DrawArrays( - GL.TRIANGLE_STRIP, - instanceVBO.numVertices, - 0, - instanceVBO.usedElements, - 0 - ) - shader:Deactivate() + if Spring.IsGUIHidden() then + return + end + if instanceVBO.usedElements == 0 then + return + end + + gl.DepthTest(GL.LEQUAL) + shader:Activate() + instanceVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, instanceVBO.numVertices, 0, instanceVBO.usedElements, 0) + shader:Deactivate() end function widget:Update(dt) - local _, spectatingFullView = SpringGetSpectatingState() - local mapDrawMode = SpringGetMapDrawMode() + local _, spectatingFullView = SpringGetSpectatingState() + local mapDrawMode = SpringGetMapDrawMode() - if mapDrawMode ~= prevMapDrawMode then - checkAllFeatures() - elseif spectatingFullView ~= prevSpectatingFullView then - checkAllFeatures() - end + if mapDrawMode ~= prevMapDrawMode then + checkAllFeatures() + elseif spectatingFullView ~= prevSpectatingFullView then + checkAllFeatures() + end - prevMapDrawMode = mapDrawMode - prevSpectatingFullView = spectatingFullView + prevMapDrawMode = mapDrawMode + prevSpectatingFullView = spectatingFullView end function widget:FeatureCreated(featureID, allyTeamID) - checkAddHighlight(featureID) + checkAddHighlight(featureID) end function widget:FeatureDestroyed(featureID, allyTeamID) - checkRemoveHighlight(featureID) + checkRemoveHighlight(featureID) end function widget:PlayerChanged(playerID) - checkAllFeatures() + checkAllFeatures() end - function widget:Initialize() - if not gl.CreateShader then - -- no shader support, so just remove the widget itself, especially for headless - widgetHandler:RemoveWidget() - return - end - if not initGL4() then - widgetHandler:RemoveWidget() - return - end - highlightUnitNames = {} - for _, unitDef in pairs(UnitDefs) do - if unitDef.customParams.iscommander or unitDef.customParams.isscavcommander then - highlightUnitNames[unitDef.name] = true - end - end - - WG.highlightcomwrecks = {} - WG.highlightcomwrecks.setUseTeamColor = function(value) - useTeamColor = value - checkAllFeatures() - end - checkAllFeatures() + if not gl.CreateShader then + -- no shader support, so just remove the widget itself, especially for headless + widgetHandler:RemoveWidget() + return + end + if not initGL4() then + widgetHandler:RemoveWidget() + return + end + highlightUnitNames = {} + for _, unitDef in pairs(UnitDefs) do + if unitDef.customParams.iscommander or unitDef.customParams.isscavcommander then + highlightUnitNames[unitDef.name] = true + end + end + + WG.highlightcomwrecks = {} + WG.highlightcomwrecks.setUseTeamColor = function(value) + useTeamColor = value + checkAllFeatures() + end + checkAllFeatures() end function widget:Shutdown() - if instanceVBO and instanceVBO.VAO then - instanceVBO.VAO:Delete() - end - if shader then - shader:Finalize() - end - WG.highlightcomwrecks = nil + if instanceVBO and instanceVBO.VAO then + instanceVBO.VAO:Delete() + end + if shader then + shader:Finalize() + end + WG.highlightcomwrecks = nil end function widget:GetConfigData() - return { - useTeamColor = useTeamColor - } + return { + useTeamColor = useTeamColor, + } end function widget:SetConfigData(data) - if data.useTeamColor ~= nil then - useTeamColor = data.useTeamColor - end + if data.useTeamColor ~= nil then + useTeamColor = data.useTeamColor + end end diff --git a/luaui/Widgets/gfx_limit_idle_fps.lua b/luaui/Widgets/gfx_limit_idle_fps.lua index 996d96c9c2f..f0a2a3b1ad1 100644 --- a/luaui/Widgets/gfx_limit_idle_fps.lua +++ b/luaui/Widgets/gfx_limit_idle_fps.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { name = "Limit idle FPS", - desc = "Reduces FPS when being offscreen or idle (by setting vsync to a high number)" , + desc = "Reduces FPS when being offscreen or idle (by setting vsync to a high number)", author = "Floris", date = "february 2020", license = "GNU GPL, v2 or later", layer = -999999, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetMouseState = Spring.GetMouseState local spGetCameraPosition = Spring.GetCameraPosition @@ -21,7 +19,7 @@ local spGetCameraPosition = Spring.GetCameraPosition local offscreenDelay = 3 local idleDelay = Spring.GetConfigInt("LimitIdleFpsDelay", 60) local vsyncValueActive = Spring.GetConfigInt("VSyncGame", -1) * Spring.GetConfigInt("VSyncFraction", 1) -local vsyncValueIdle = Spring.GetConfigInt("IdleFpsDivider", 4) -- sometimes vsync > 4 doesnt work at all +local vsyncValueIdle = Spring.GetConfigInt("IdleFpsDivider", 4) -- sometimes vsync > 4 doesnt work at all local limitFpsWhenIdle = Spring.GetConfigInt("LimitIdleFps", 0) == 1 @@ -32,15 +30,14 @@ local prevCamX, prevCamY, prevCamZ = spGetCameraPosition() local lastMouseOffScreen = false local chobbyInterface = false - function widget:Shutdown() Spring.SetConfigInt("VSync", vsyncValueActive) - WG['limitidlefps'] = nil + WG["limitidlefps"] = nil end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") lastUserInputTime = os.clock() if chobbyInterface then restrictFps = false @@ -50,11 +47,11 @@ function widget:RecvLuaMsg(msg, playerID) end function widget:Initialize() - WG['limitidlefps'] = {} - WG['limitidlefps'].restrictFps = function() + WG["limitidlefps"] = {} + WG["limitidlefps"].restrictFps = function() return restrictFps end - WG['limitidlefps'].update = function() + WG["limitidlefps"].update = function() lastUserInputTime = os.clock() end end @@ -69,29 +66,29 @@ function widget:Update(dt) idleDelay = Spring.GetConfigInt("LimitIdleFpsDelay", 40) end -- detect change by user - local curVsync = Spring.GetConfigInt("VSync",1) + local curVsync = Spring.GetConfigInt("VSync", 1) if curVsync ~= vsyncValueIdle and curVsync ~= vsyncValueActive then vsyncValueActive = curVsync end if not chobbyInterface then local prevRestrictFps = restrictFps - local mouseX, mouseY, lmb, mmb, rmb, mouseOffScreen, cameraPanMode = spGetMouseState() - if mouseX ~= lastMouseX or mouseY ~= lastMouseY or lmb or mmb or rmb then + local mouseX, mouseY, lmb, mmb, rmb, mouseOffScreen, cameraPanMode = spGetMouseState() + if mouseX ~= lastMouseX or mouseY ~= lastMouseY or lmb or mmb or rmb then lastMouseX, lastMouseY = mouseX, mouseY lastUserInputTime = os.clock() end local camX, camY, camZ = spGetCameraPosition() - if camX ~= prevCamX or camY ~= prevCamY or camZ ~= prevCamZ then + if camX ~= prevCamX or camY ~= prevCamY or camZ ~= prevCamZ then prevCamX, prevCamY, prevCamZ = camX, camY, camZ lastUserInputTime = os.clock() end - if cameraPanMode then -- when camera panning + if cameraPanMode then -- when camera panning lastUserInputTime = os.clock() end if lastMouseOffScreen ~= mouseOffScreen then - lastUserInputTime = os.clock() - idleDelay-0.01+offscreenDelay + lastUserInputTime = os.clock() - idleDelay - 0.01 + offscreenDelay end lastMouseOffScreen = mouseOffScreen if (limitFpsWhenIdle or mouseOffScreen) and lastUserInputTime < os.clock() - idleDelay then @@ -117,6 +114,6 @@ function widget:KeyPress() lastUserInputTime = os.clock() end -function widget:TextInput(char) -- seems not being triggered when actual chat input so chat widget will do WG['limitidlefps'].update() +function widget:TextInput(char) -- seems not being triggered when actual chat input so chat widget will do WG['limitidlefps'].update() lastUserInputTime = os.clock() end diff --git a/luaui/Widgets/gfx_los_colors.lua b/luaui/Widgets/gfx_los_colors.lua index 65a49ef3376..56777404d89 100644 --- a/luaui/Widgets/gfx_los_colors.lua +++ b/luaui/Widgets/gfx_los_colors.lua @@ -2,14 +2,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "LOS colors", - desc = "custom colors for LOS", - author = "[teh]decay (thx to Floris, BrainDamage, hokomoko, [teh]Teddy, Buttons840)", - date = "23 jul 2015", - license = "public domain", - layer = 0, - version = 3, - enabled = true + name = "LOS colors", + desc = "custom colors for LOS", + author = "[teh]decay (thx to Floris, BrainDamage, hokomoko, [teh]Teddy, Buttons840)", + date = "23 jul 2015", + license = "public domain", + layer = 0, + version = 3, + enabled = true, } end @@ -21,28 +21,26 @@ end local opacity = 0.66 local losColors = { - fog = {0.40, 0.40, 0.40}, - los = {0.60, 0.60, 0.60}, - radar = {0.00, 0.00, 0.00}, -- not used - jam = {0.03, -0.03, -0.03}, -- additive tint: R-G/B spread sets how red jammed areas look (was 0.08) - radar2 = {0.40, 0.40, 0.40}, + fog = { 0.40, 0.40, 0.40 }, + los = { 0.60, 0.60, 0.60 }, + radar = { 0.00, 0.00, 0.00 }, -- not used + jam = { 0.03, -0.03, -0.03 }, -- additive tint: R-G/B spread sets how red jammed areas look (was 0.08) + radar2 = { 0.40, 0.40, 0.40 }, } - local always, LOS, radar, jam, radar2 local spSetLosViewColors = Spring.SetLosViewColors - local function lerp(a, b, t) return a + (b - a) * t end local function applyOpacity(colors) local newColors = table.copy(colors) - for i,c in pairs(newColors.fog) do + for i, c in pairs(newColors.fog) do newColors.fog[i] = lerp(0, c, opacity) end - for i,c in pairs(newColors.radar2) do + for i, c in pairs(newColors.radar2) do -- move only half way towards opacity to give contract -- between radar and full fow newColors.radar2[i] = lerp(0, c, lerp(opacity, 1, 0.5)) @@ -56,11 +54,11 @@ local function updateLOS() end function widget:Initialize() - WG['los'] = {} - WG['los'].getOpacity = function() + WG["los"] = {} + WG["los"].getOpacity = function() return opacity end - WG['los'].setOpacity = function(value) + WG["los"].setOpacity = function(value) opacity = value updateLOS() end @@ -81,6 +79,6 @@ end function widget:GetConfigData() return { - opacity = opacity + opacity = opacity, } end diff --git a/luaui/Widgets/gfx_los_view.lua b/luaui/Widgets/gfx_los_view.lua index d76d6dc1311..eb69223e00d 100644 --- a/luaui/Widgets/gfx_los_view.lua +++ b/luaui/Widgets/gfx_los_view.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "LOS View", - desc = "Turns LOS view on when playing and off when becomming spectator.", - author = "Bluestone", - date = "", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "LOS View", + desc = "Turns LOS view on when playing and off when becomming spectator.", + author = "Bluestone", + date = "", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetSpectatingState = Spring.GetSpectatingState @@ -22,19 +20,19 @@ local myPlayerID = Spring.GetMyPlayerID() local lastMapDrawMode = Spring.GetMapDrawMode() local function TurnOnLOS() - if Spring.GetMapDrawMode()~="los" then - Spring.SendCommands("togglelos") - end + if Spring.GetMapDrawMode() ~= "los" then + Spring.SendCommands("togglelos") + end end local function TurnOffLOS() - if Spring.GetMapDrawMode()=="los" then - Spring.SendCommands("togglelos") - end + if Spring.GetMapDrawMode() == "los" then + Spring.SendCommands("togglelos") + end end function widget:Initialize() - if (spGetGameFrame() > 0 and lastMapDrawMode == "los") then + if spGetGameFrame() > 0 and lastMapDrawMode == "los" then TurnOnLOS() else TurnOffLOS() @@ -42,7 +40,7 @@ function widget:Initialize() end local gamestarted = false -function widget:GameFrame(frame) -- somehow widget:GameStart() didnt work +function widget:GameFrame(frame) -- somehow widget:GameStart() didnt work if frame == 1 and not gamestarted then gamestarted = true myPlayerID = Spring.GetMyPlayerID() @@ -55,8 +53,8 @@ function widget:GameFrame(frame) -- somehow widget:GameStart() didnt work end function widget:Shutdown() - lastMapDrawMode = Spring.GetMapDrawMode() - TurnOffLOS() + lastMapDrawMode = Spring.GetMapDrawMode() + TurnOffLOS() end function widget:PlayerChanged(playerID) @@ -72,7 +70,7 @@ function widget:PlayerChanged(playerID) end function widget:GetConfigData() --save config - return {lastMapDrawMode=lastMapDrawMode} + return { lastMapDrawMode = lastMapDrawMode } end function widget:SetConfigData(data) --load config @@ -80,4 +78,3 @@ function widget:SetConfigData(data) --load config lastMapDrawMode = data.lastMapDrawMode end end - diff --git a/luaui/Widgets/gfx_map_lights.lua b/luaui/Widgets/gfx_map_lights.lua index 9096cf63fd6..182eee41e82 100644 --- a/luaui/Widgets/gfx_map_lights.lua +++ b/luaui/Widgets/gfx_map_lights.lua @@ -12,8 +12,6 @@ function widget:GetInfo() } end - - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -34,7 +32,7 @@ local maplights = { -- {lightname = 'fireflies-right', lightID = nil, pos = {7370, 300, 4000}, rgba = {0.3, 0.32, 0.07, 2}, radius = 1000,falloffsquared = 1.5}, -- {lightname = 'fireflies-top', lightID = nil, pos = {3410, 250, 3595}, rgba = {0.3, 0.32, 0.07, 1.2}, radius = 600,falloffsquared = 1.0}, -- {lightname = 'statues-low', lightID = nil, pos = {765, 300, 4329}, rgba = {0.32, 0.22, 0.07, 2}, radius = 1150,falloffsquared = 1.5}, - { lightname = 'statues-high', lightID = nil, pos = { 955, 300, 3462 }, rgba = { 0.32, 0.22, 0.07, 10.0 }, radius = 1150, falloffsquared = 0.01 }, + { lightname = "statues-high", lightID = nil, pos = { 955, 300, 3462 }, rgba = { 0.32, 0.22, 0.07, 10.0 }, radius = 1150, falloffsquared = 0.01 }, -- {lightname = 'mountain', lightID = nil, pos = {5482, 500, 4733}, rgba = {0.49, 0.48, 0.45, 1.5}, radius = 1150,falloffsquared = 1.5}, -- {lightname = 'dark', lightID = nil, pos = {4000, 500, 4800}, rgba = {0.13,0.17,0.05, 2}, radius = 3000,falloffsquared = 1.7}, } @@ -42,30 +40,12 @@ local maplights = { function widget:Initialize() --spEcho("Loading Maplights") --spEcho(WG, WG['lighteffects'], WG['lighteffects'].createLight,Script.LuaUI("GadgetCreateLight")) - if (WG and WG['lighteffects'] and WG['lighteffects'].createLight) or Script.LuaUI("GadgetCreateLight") then - + if (WG and WG["lighteffects"] and WG["lighteffects"].createLight) or Script.LuaUI("GadgetCreateLight") then for _, lightparams in pairs(maplights) do - if WG then - lightparams.lightID = WG['lighteffects'].createLight( - lightparams.lightname, - lightparams.pos[1], - lightparams.pos[2], - lightparams.pos[3], - lightparams.radius, - lightparams.rgba, - lightparams.falloffsquared - ) + lightparams.lightID = WG["lighteffects"].createLight(lightparams.lightname, lightparams.pos[1], lightparams.pos[2], lightparams.pos[3], lightparams.radius, lightparams.rgba, lightparams.falloffsquared) else - lightparams.lightID = Script.LuaUI.GadgetCreateLight( - lightparams.lightname, - lightparams.pos[1], - lightparams.pos[2], - lightparams.pos[3], - lightparams.radius, - lightparams.rgba, - lightparams.falloffsquared - ) + lightparams.lightID = Script.LuaUI.GadgetCreateLight(lightparams.lightname, lightparams.pos[1], lightparams.pos[2], lightparams.pos[3], lightparams.radius, lightparams.rgba, lightparams.falloffsquared) end end end @@ -73,13 +53,12 @@ end function widget:Shutdown() for _, lightparams in pairs(maplights) do - if lightparams.lightID and ((WG and WG['lighteffects'] and WG['lighteffects'].removeLight) or Script.LuaUI("GadgetRemoveLight")) then + if lightparams.lightID and ((WG and WG["lighteffects"] and WG["lighteffects"].removeLight) or Script.LuaUI("GadgetRemoveLight")) then if WG then - WG['lighteffects'].removeLight(lightparams.lightID) + WG["lighteffects"].removeLight(lightparams.lightID) else Script.LuaUI.GadgetRemoveLight(lightparams.lightID) end end end end - diff --git a/luaui/Widgets/gfx_norush_timer_gl4.lua b/luaui/Widgets/gfx_norush_timer_gl4.lua index e1b79b7fe69..c4779e3e84a 100644 --- a/luaui/Widgets/gfx_norush_timer_gl4.lua +++ b/luaui/Widgets/gfx_norush_timer_gl4.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -23,9 +22,11 @@ local pveAllyTeamID = Spring.Utilities.GetScavAllyTeamID() or Spring.Utilities.G ---- Config stuff ------------------ local autoReload = false -- refresh shader code every second (disable in production!) -local StartBoxes = {} -- list of xXyY -local noRushTime = Spring.GetModOptions().norushtimer*60*30 -if noRushTime == 0 then return end +local StartBoxes = {} -- list of xXyY +local noRushTime = Spring.GetModOptions().norushtimer * 60 * 30 +if noRushTime == 0 then + return +end local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable @@ -33,58 +34,61 @@ local InstanceVBOTable = gl.InstanceVBOTable local minY, maxY = Spring.GetGroundExtremes() local shaderSourceCache = { - vssrcpath = "LuaUI/Shaders/norush_timer.vert.glsl", - fssrcpath = "LuaUI/Shaders/norush_timer.frag.glsl", - uniformInt = { - mapDepths = 0, - noRushTimer = Spring.GetModOptions().norushtimer*60*30, - }, - uniformFloat = { - }, - shaderName = "Norush Timer GL4", - shaderConfig = { - ALPHA = 0.5, - NUM_BOXES = NUM_BOXES, - MINY = minY, - MAXY = maxY, - } - } - + vssrcpath = "LuaUI/Shaders/norush_timer.vert.glsl", + fssrcpath = "LuaUI/Shaders/norush_timer.frag.glsl", + uniformInt = { + mapDepths = 0, + noRushTimer = Spring.GetModOptions().norushtimer * 60 * 30, + }, + uniformFloat = {}, + shaderName = "Norush Timer GL4", + shaderConfig = { + ALPHA = 0.5, + NUM_BOXES = NUM_BOXES, + MINY = minY, + MAXY = maxY, + }, +} + local fullScreenRectVAO local norushTimerShader -- Locals for speedups local glTexture = gl.Texture local glCulling = gl.Culling local glDepthTest = gl.DepthTest -local spIsGUIHidden = Spring.IsGUIHidden +local spIsGUIHidden = Spring.IsGUIHidden function widget:RecvLuaMsg(msg, playerID) --spEcho("widget:RecvLuaMsg",msg) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorldPreUnit() - if Spring.GetGameFrame() > noRushTime+150 then return end + if Spring.GetGameFrame() > noRushTime + 150 then + return + end if autoReload then norushTimerShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or norushTimerShader end - if chobbyInterface or spIsGUIHidden() then return end + if chobbyInterface or spIsGUIHidden() then + return + end local _, advMapShading = Spring.HaveAdvShading() - if advMapShading then + if advMapShading then gl.Texture(0, "$map_gbuffer_zvaltex") else - if WG['screencopymanager'] and WG['screencopymanager'].GetDepthCopy() then - gl.Texture(0, WG['screencopymanager'].GetDepthCopy()) + if WG["screencopymanager"] and WG["screencopymanager"].GetDepthCopy() then + gl.Texture(0, WG["screencopymanager"].GetDepthCopy()) else return end end - + glCulling(true) glDepthTest(false) gl.DepthMask(false) @@ -92,7 +96,7 @@ function widget:DrawWorldPreUnit() norushTimerShader:Activate() for i, startBox in ipairs(StartBoxes) do --spEcho("startBoxes["..i.."]", startBox[1],startBox[2],startBox[3],startBox[4]) - norushTimerShader:SetUniform("startBoxes["..( i-1) .."]", startBox[1],startBox[2],startBox[3],startBox[4]) + norushTimerShader:SetUniform("startBoxes[" .. (i - 1) .. "]", startBox[1], startBox[2], startBox[3], startBox[4]) end norushTimerShader:SetUniform("noRushTimer", noRushTime) fullScreenRectVAO:DrawArrays(GL.TRIANGLES) @@ -108,17 +112,17 @@ end function widget:Initialize() local gaiaAllyTeamID - if Spring.GetGaiaTeamID() then - gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID() , false)) + if Spring.GetGaiaTeamID() then + gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID(), false)) end for i, teamID in ipairs(Spring.GetAllyTeamList()) do if teamID ~= gaiaAllyTeamID and teamID ~= pveAllyTeamID then local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(teamID) - --spEcho("Allyteam",teamID,"startbox",xn, zn, xp, zp) - StartBoxes[#StartBoxes+1] = {xn, zn, xp, zp} + --spEcho("Allyteam",teamID,"startbox",xn, zn, xp, zp) + StartBoxes[#StartBoxes + 1] = { xn, zn, xp, zp } end end - + -- MANUAL OVERRIDE FOR DEBUGGING: -- StartBoxes = { {100, 200, 2000, 3000} , {2200, 3300, 5000, 4000}} diff --git a/luaui/Widgets/gfx_orb_effects_gl4.lua b/luaui/Widgets/gfx_orb_effects_gl4.lua index a0c9403f57c..95c11c657c4 100644 --- a/luaui/Widgets/gfx_orb_effects_gl4.lua +++ b/luaui/Widgets/gfx_orb_effects_gl4.lua @@ -13,16 +13,12 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo local spGetUnitTeam = Spring.GetUnitTeam - - - -------------------------------------------------------------------------------- -- Beherith's notes -------------------------------------------------------------------------------- @@ -32,7 +28,7 @@ local spGetUnitTeam = Spring.GetUnitTeam -- [ ] Optimize shader -- [ ] Combine Effects of techniques -- [x] LightningOrb() TOO EXPENSIVE! - -- do multiple wraps, like 4 instead of 18 goddamn passes! +-- do multiple wraps, like 4 instead of 18 goddamn passes! -- [ ] Ensure SphereVBO indices to triangles are ordered bottom to top! -- [x] Draw order is incorrect, we are drawing after gadget's shield jitter @@ -110,7 +106,6 @@ local legfusShieldSphere = table.merge(defaults, { --colormap2 = { {0.2, 0.6, 0.2, 0.4},{0.2, 0.6, 0.2, 0.45},{0.2, 0.6, 0.2, 0.45},{0.2, 0.6, 0.2, 0.4} }, }) - local corgateShieldSphere = table.merge(defaults, { pos = { 0, 42, 0 }, size = 11, @@ -181,133 +176,132 @@ local legdeflectorShieldSphere = table.merge(defaults, { local UnitEffects = { ["armjuno"] = { - { class = 'ShieldSphere', options = armjunoShieldSphere }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armjunoShieldSphere }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, }, ["legjuno"] = { - { class = 'ShieldSphere', options = legjunoShieldSphere }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = legjunoShieldSphere }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, }, ["corjuno"] = { - { class = 'ShieldSphere', options = corjunoShieldSphere }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = corjunoShieldSphere }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 72, 0 }, size = 14, precision = 22, repeatEffect = true } }, }, --// FUSIONS //-------------------------- ["corafus"] = { - { class = 'ShieldSphere', options = corafusShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 32.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = corafusShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 32.5, precision = 22, repeatEffect = true } }, }, ["corfus"] = { - { class = 'ShieldSphere', options = corfusShieldSphere }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 50, 0 }, size = 23.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = corfusShieldSphere }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 50, 0 }, size = 23.5, precision = 22, repeatEffect = true } }, }, ["legfus"] = { - { class = 'ShieldSphere', options = legfusShieldSphere }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 19, 0 }, size = 23.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = legfusShieldSphere }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 19, 0 }, size = 23.5, precision = 22, repeatEffect = true } }, }, ["armafus"] = { - { class = 'ShieldSphere', options = armafusShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 28.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armafusShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 28.5, precision = 22, repeatEffect = true } }, }, ["legafus"] = { - { class = 'ShieldSphere', options = legafusShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 38.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = legafusShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 38.5, precision = 22, repeatEffect = true } }, }, ["armafust3"] = { - { class = 'ShieldSphere', options = armafust3ShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 57, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armafust3ShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 57, precision = 22, repeatEffect = true } }, }, ["corafust3"] = { - { class = 'ShieldSphere', options = corafust3ShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 65, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = corafust3ShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 65, precision = 22, repeatEffect = true } }, }, ["legafust3"] = { - { class = 'ShieldSphere', options = legafust3ShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 77, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = legafust3ShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 120, 0 }, size = 77, precision = 22, repeatEffect = true } }, }, ["resourcecheat"] = { - { class = 'ShieldSphere', options = armafusShieldSphere }, - { class = 'ShieldJitter', options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 28.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armafusShieldSphere }, + { class = "ShieldJitter", options = { layer = -16, life = math.huge, pos = { 0, 60, 0 }, size = 28.5, precision = 22, repeatEffect = true } }, }, ["corgate"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 42, 0 }, size = 12, precision = 22, repeatEffect = true , isShiedl } }, - { class = 'ShieldSphere', options = corgateShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 42, 0 }, size = 12, precision = 22, repeatEffect = true, isShiedl } }, + { class = "ShieldSphere", options = corgateShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,42,0.0}, size=555, precision=0, strength= 0.001, repeatEffect=true}}, --{class='ShieldJitter',options={life=math.huge, pos={0,42,0}, size=20, precision=2, repeatEffect=true}}, }, ["corgatet3"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 75, 0 }, size = 18, precision = 22, repeatEffect = true , isShiedl } }, - { class = 'ShieldSphere', options = corgatet3ShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 75, 0 }, size = 18, precision = 22, repeatEffect = true, isShiedl } }, + { class = "ShieldSphere", options = corgatet3ShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,42,0.0}, size=555, precision=0, strength= 0.001, repeatEffect=true}}, --{class='ShieldJitter',options={life=math.huge, pos={0,42,0}, size=20, precision=2, repeatEffect=true}}, }, ["corfgate"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 42, 0 }, size = 12, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = corgateShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 42, 0 }, size = 12, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = corgateShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,42,0.0}, size=555, precision=0, strength= 0.001, repeatEffect=true}}, --{class='ShieldJitter',options={life=math.huge, pos={0,42,0}, size=20, precision=2, repeatEffect=true}}, }, ["armgate"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 20, -5 }, size = 15, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = armgateShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 20, -5 }, size = 15, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armgateShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,23.5,-5}, size=555, precision=0, strength=0.001, repeatEffect=true}}, }, ["armgatet3"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 37, -5 }, size = 21, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = armgatet3ShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 37, -5 }, size = 21, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = armgatet3ShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,23.5,-5}, size=555, precision=0, strength=0.001, repeatEffect=true}}, }, ["leggatet3"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 45, 0 }, size = 20, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = leggatet3ShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 45, 0 }, size = 20, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = leggatet3ShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,23.5,-5}, size=555, precision=0, strength=0.001, repeatEffect=true}}, }, ["armfgate"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 25, 0 }, size = 15, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = table.merge(armgateShieldSphere, { pos = { 0, 25, 0 } }) }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 25, 0 }, size = 15, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = table.merge(armgateShieldSphere, { pos = { 0, 25, 0 } }) }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,25,0}, size=555, precision=0, strength= 0.001, repeatEffect=true}}, }, ["legdeflector"] = { - { class = 'ShieldJitter', options = { delay = 0, life = math.huge, pos = { 0, 20, -5 }, size = 15, precision = 22, repeatEffect = true } }, - { class = 'ShieldSphere', options = legdeflectorShieldSphere }, + { class = "ShieldJitter", options = { delay = 0, life = math.huge, pos = { 0, 20, -5 }, size = 15, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = legdeflectorShieldSphere }, --{class='ShieldJitter', options={delay=0,life=math.huge, pos={0,23.5,-5}, size=555, precision=0, strength=0.001, repeatEffect=true}}, }, ["lootboxbronze"] = { - { class = 'ShieldSphere', options = table.merge(corfusShieldSphere, {pos = { 0, 34, 0 }, size = 10} ) }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 34, 0 }, size = 10.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = table.merge(corfusShieldSphere, { pos = { 0, 34, 0 }, size = 10 }) }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 34, 0 }, size = 10.5, precision = 22, repeatEffect = true } }, }, ["lootboxsilver"] = { - { class = 'ShieldSphere', options = table.merge(corfusShieldSphere, {pos = { 0, 52, 0 }, size = 15} ) }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 52, 0 }, size = 15.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = table.merge(corfusShieldSphere, { pos = { 0, 52, 0 }, size = 15 }) }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 52, 0 }, size = 15.5, precision = 22, repeatEffect = true } }, }, ["lootboxgold"] = { - { class = 'ShieldSphere', options = table.merge(corfusShieldSphere, {pos = { 0, 69, 0 }, size = 20} ) }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 69, 0 }, size = 20.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = table.merge(corfusShieldSphere, { pos = { 0, 69, 0 }, size = 20 }) }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 69, 0 }, size = 20.5, precision = 22, repeatEffect = true } }, }, ["lootboxplatinum"] = { - { class = 'ShieldSphere', options = table.merge(corfusShieldSphere, {pos = { 0, 87, 0 }, size = 25} ) }, - { class = 'ShieldJitter', options = { life = math.huge, pos = { 0, 87, 0 }, size = 25.5, precision = 22, repeatEffect = true } }, + { class = "ShieldSphere", options = table.merge(corfusShieldSphere, { pos = { 0, 87, 0 }, size = 25 }) }, + { class = "ShieldJitter", options = { life = math.huge, pos = { 0, 87, 0 }, size = 25.5, precision = 22, repeatEffect = true } }, }, - } local scavEffects = {} -if UnitDefNames['armcom_scav'] then +if UnitDefNames["armcom_scav"] then for k, effect in pairs(UnitEffects) do - scavEffects[k .. '_scav'] = effect - if scavEffects[k .. '_scav'].options then - if scavEffects[k .. '_scav'].options.color then - scavEffects[k .. '_scav'].options.color = { 0.92, 0.32, 1.0 } + scavEffects[k .. "_scav"] = effect + if scavEffects[k .. "_scav"].options then + if scavEffects[k .. "_scav"].options.color then + scavEffects[k .. "_scav"].options.color = { 0.92, 0.32, 1.0 } end - if scavEffects[k .. '_scav'].options.colormap then - scavEffects[k .. '_scav'].options.colormap = { { 0.92, 0.32, 1.0 } } + if scavEffects[k .. "_scav"].options.colormap then + scavEffects[k .. "_scav"].options.colormap = { { 0.92, 0.32, 1.0 } } end - if scavEffects[k .. '_scav'].options.colormap1 then - scavEffects[k .. '_scav'].options.colormap1 = { { 0.92, 0.32, 1.0 } } + if scavEffects[k .. "_scav"].options.colormap1 then + scavEffects[k .. "_scav"].options.colormap1 = { { 0.92, 0.32, 1.0 } } end - if scavEffects[k .. '_scav'].options.colormap2 then - scavEffects[k .. '_scav'].options.colormap2 = { { 0.92, 0.32, 1.0 } } + if scavEffects[k .. "_scav"].options.colormap2 then + scavEffects[k .. "_scav"].options.colormap2 = { { 0.92, 0.32, 1.0 } } end end end @@ -319,7 +313,6 @@ end local orbUnitDefs = {} - for unitname, effect in pairs(UnitEffects) do if UnitDefNames[unitname] then for _, effectdef in ipairs(effect) do @@ -332,14 +325,14 @@ for unitname, effect in pairs(UnitEffects) do attr[5] = 1 -- margin attr[6] = 0 -- precision - attr[7] = (opts.isShield and 1) or 0 -- isShield + attr[7] = (opts.isShield and 1) or 0 -- isShield attr[8] = 1 -- technique - attr[ 9], attr[10], attr[11], attr[12] = unpack((opts.colormap1 and opts.colormap1[1]) or {-1,-1,-1,-1}) - attr[13], attr[14], attr[15], attr[16] = unpack((opts.colormap2 and opts.colormap2[1]) or {-1,-1,-1,-1}) + attr[9], attr[10], attr[11], attr[12] = unpack((opts.colormap1 and opts.colormap1[1]) or { -1, -1, -1, -1 }) + attr[13], attr[14], attr[15], attr[16] = unpack((opts.colormap2 and opts.colormap2[1]) or { -1, -1, -1, -1 }) attr[17], attr[18], attr[19], attr[20] = 0, 0, 0, 0 -- padding for instData - orbUnitDefs[UnitDefNames[unitname].id] = attr + orbUnitDefs[UnitDefNames[unitname].id] = attr end end end @@ -357,12 +350,11 @@ local orbShader = nil local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance -local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO +local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO -local vsSrc = -[[ +local vsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shader_storage_buffer_object : require @@ -503,8 +495,7 @@ void main() } ]] -local fsSrc = -[[ +local fsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shading_language_420pack: require @@ -839,47 +830,45 @@ void main(void) ]] local function goodbye(reason) - spEcho("Orb GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("Orb GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end local function initGL4() - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - orbShader = LuaShader( - { - vertex = vsSrc, - fragment = fsSrc, - uniformInt = { - noiseMap = 0, - mask = 1, - }, - uniformFloat = { - reflectionPass = 0.0, - }, - }, - "orbShader GL4" - ) - shaderCompiled = orbShader:Initialize() - if not shaderCompiled then goodbye("Failed to compile orbShader GL4 ") end - local sphereVBO, numVerts, sphereIndexVBO, numIndices = InstanceVBOTable.makeSphereVBO(32,24,1) - --spEcho("SphereVBO has", numVerts, "vertices and ", numIndices,"indices") - local orbVBOLayout = { - {id = 3, name = 'posrad', size = 4}, -- widthlength - {id = 4, name = 'margin_teamID_shield_technique', size = 4}, -- emit dir - {id = 5, name = 'color1', size = 4}, --- color - {id = 6, name = 'color2', size = 4}, --- color - {id = 7, name = 'instData', type = GL.UNSIGNED_INT, size= 4}, - } - orbVBO = InstanceVBOTable.makeInstanceVBOTable(orbVBOLayout,256, "orbVBO", 7) - orbVBO.numVertices = numIndices - orbVBO.vertexVBO = sphereVBO - orbVBO.VAO = InstanceVBOTable.makeVAOandAttach(orbVBO.vertexVBO, orbVBO.instanceVBO) - orbVBO.primitiveType = GL.TRIANGLES - orbVBO.indexVBO = sphereIndexVBO - orbVBO.VAO:AttachIndexBuffer(orbVBO.indexVBO) + orbShader = LuaShader({ + vertex = vsSrc, + fragment = fsSrc, + uniformInt = { + noiseMap = 0, + mask = 1, + }, + uniformFloat = { + reflectionPass = 0.0, + }, + }, "orbShader GL4") + shaderCompiled = orbShader:Initialize() + if not shaderCompiled then + goodbye("Failed to compile orbShader GL4 ") + end + local sphereVBO, numVerts, sphereIndexVBO, numIndices = InstanceVBOTable.makeSphereVBO(32, 24, 1) + --spEcho("SphereVBO has", numVerts, "vertices and ", numIndices,"indices") + local orbVBOLayout = { + { id = 3, name = "posrad", size = 4 }, -- widthlength + { id = 4, name = "margin_teamID_shield_technique", size = 4 }, -- emit dir + { id = 5, name = "color1", size = 4 }, --- color + { id = 6, name = "color2", size = 4 }, --- color + { id = 7, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, + } + orbVBO = InstanceVBOTable.makeInstanceVBOTable(orbVBOLayout, 256, "orbVBO", 7) + orbVBO.numVertices = numIndices + orbVBO.vertexVBO = sphereVBO + orbVBO.VAO = InstanceVBOTable.makeVAOandAttach(orbVBO.vertexVBO, orbVBO.instanceVBO) + orbVBO.primitiveType = GL.TRIANGLES + orbVBO.indexVBO = sphereIndexVBO + orbVBO.VAO:AttachIndexBuffer(orbVBO.indexVBO) end -------------------------------------------------------------------------------- @@ -892,7 +881,7 @@ local function DrawOrbs(reflectionPass) --gl.Culling(GL.FRONT) gl.Culling(false) orbShader:Activate() - orbShader:SetUniform("reflectionPass", (reflectionPass and 1 ) or 0 ) + orbShader:SetUniform("reflectionPass", (reflectionPass and 1) or 0) drawInstanceVBO(orbVBO) orbShader:Deactivate() end @@ -904,7 +893,9 @@ end local shieldFinishFrames = {} -- unitID to gameframe function widget:DrawWorldPreParticles(drawAboveWater, drawBelowWater, drawReflection, drawRefraction) - if next(shieldFinishFrames) then shieldFinishFrames = {} end + if next(shieldFinishFrames) then + shieldFinishFrames = {} + end -- NOTE: This is called TWICE per draw frame, once before water and once after, even if no water is present. -- If water is present on the map, then it gets called again between the two for the refraction pass -- Solution is to draw it only on the first call, and draw reflections from widget:DrawWorldReflection @@ -924,8 +915,8 @@ function widget:Initialize() return end initGL4() - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) else spEcho("Unit Tracker API unavailable, exiting Orb GL4") widgetHandler:RemoveWidget() @@ -933,15 +924,15 @@ function widget:Initialize() end end - function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, noupload) --spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam, noupload,shieldFinishFrames[unitID]) if unitDefID and orbUnitDefs[unitDefID] then - unitTeam = unitTeam or spGetUnitTeam(unitID) local _, _, _, _, buildProgress = Spring.GetUnitHealth(unitID) - if buildProgress < 1 then return end + if buildProgress < 1 then + return + end local instanceCache = orbUnitDefs[unitDefID] instanceCache[5] = shieldFinishFrames[unitID] or 0 @@ -949,7 +940,8 @@ function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, noupload) --instanceCache[7] = spGetGameFrame() shieldFinishFrames[unitID] = nil - pushElementInstance(orbVBO, + pushElementInstance( + orbVBO, instanceCache, unitID, --key true, -- updateExisting diff --git a/luaui/Widgets/gfx_paralyze_effect.lua b/luaui/Widgets/gfx_paralyze_effect.lua index 465dc83280c..87f15003669 100644 --- a/luaui/Widgets/gfx_paralyze_effect.lua +++ b/luaui/Widgets/gfx_paralyze_effect.lua @@ -1,19 +1,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Paralyze Effect", - version = "v0.2", - desc = "Faster gl.UnitShape, Use WG.UnitShapeGL4", - author = "Beherith", - date = "2021.11.04", - license = "GNU GPL v2", - layer = 0, - enabled = true, - } + return { + name = "Paralyze Effect", + version = "v0.2", + desc = "Faster gl.UnitShape, Use WG.UnitShapeGL4", + author = "Beherith", + date = "2021.11.04", + license = "GNU GPL v2", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitHealth = Spring.GetUnitHealth @@ -25,14 +24,12 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOIdTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance - +local popElementInstance = InstanceVBOTable.popElementInstance -- for testing: /luarules benchmark corak armpw 100 10 3000 local paralyzedUnitShader, unitShapeShader - local vsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require @@ -324,7 +321,6 @@ void main() { } ]] - local paralyzeSourceShaderCache = { vsSrc = vsSrc, fsSrc = fsSrc, @@ -334,13 +330,13 @@ local paralyzeSourceShaderCache = { shaderConfig = { USEQUATERNIONS = Engine.FeatureSupport.transformsInGL4 and "1" or "0", }, - forceupdate = true -- otherwise file-less defines are not updated + forceupdate = true, -- otherwise file-less defines are not updated } --holy hacks batman if Spring.GetModOptions().emprework then - fsSrc = string.gsub(fsSrc,'//empreworktagdonotremove','paralysis_level = paralysis_level*3; if (paralysis_level> 1) { paralysis_level = 1; }') - fsSrc = string.gsub(fsSrc,'//empreworkherealsodonotremove','if (paralysis_level > 0.49) { wholeunitbasecolor = vec4(0.35, 0.43, 0.94, 0.18); }') + fsSrc = string.gsub(fsSrc, "//empreworktagdonotremove", "paralysis_level = paralysis_level*3; if (paralysis_level> 1) { paralysis_level = 1; }") + fsSrc = string.gsub(fsSrc, "//empreworkherealsodonotremove", "if (paralysis_level > 0.49) { wholeunitbasecolor = vec4(0.35, 0.43, 0.94, 0.18); }") end local paralyzedDrawUnitVBOTable @@ -352,14 +348,14 @@ local function initGL4() indxVBO:ModelsVBO() local VBOLayout = { - {id = 6, name = "startcolorpower", size = 4}, - {id = 7, name = "endcolor" , size = 4}, - {id = 8, name = "instData", type = GL.UNSIGNED_INT, size = 4}, - } + { id = 6, name = "startcolorpower", size = 4 }, + { id = 7, name = "endcolor", size = 4 }, + { id = 8, name = "instData", type = GL.UNSIGNED_INT, size = 4 }, + } local maxElements = 32 -- start small for testing local unitIDAttributeIndex = 8 - paralyzedDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "paralyzedDrawUnitVBOTable", unitIDAttributeIndex, "unitID") + paralyzedDrawUnitVBOTable = InstanceVBOTable.makeInstanceVBOTable(VBOLayout, maxElements, "paralyzedDrawUnitVBOTable", unitIDAttributeIndex, "unitID") paralyzedDrawUnitVBOTable.VAO = InstanceVBOTable.makeVAOandAttach(vertVBO, paralyzedDrawUnitVBOTable.instanceVBO, indxVBO) paralyzedDrawUnitVBOTable.indexVBO = indxVBO @@ -367,13 +363,13 @@ local function initGL4() paralyzedUnitShader = LuaShader.CheckShaderUpdates(paralyzeSourceShaderCache) - if not paralyzedUnitShader then + if not paralyzedUnitShader then spEcho("paralyzedUnitShaderCompiled shader compilation failed", paralyzedUnitShader) widgetHandler:RemoveWidget() end end -local function DrawParalyzedUnitGL4(unitID, unitDefID, red_start, green_start, blue_start,power_start, red_end, green_end, blue_end, time_end) +local function DrawParalyzedUnitGL4(unitID, unitDefID, red_start, green_start, blue_start, power_start, red_end, green_end, blue_end, time_end) -- Documentation for DrawParalyzedUnitGL4: -- unitID: the actual unitID that you want to draw -- unitDefID: which unitDef is it (leave nil for autocomplete) @@ -381,8 +377,12 @@ local function DrawParalyzedUnitGL4(unitID, unitDefID, red_start, green_start, -- note that widgets are responsible for stopping the drawing of every unit that they submit! --spEcho("DrawParalyzedUnitGL4",unitID, unitDefID, UnitDefs[unitDefID].name) - if paralyzedDrawUnitVBOTable.instanceIDtoIndex[unitID] then return end -- already got this unit - if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true then return end + if paralyzedDrawUnitVBOTable.instanceIDtoIndex[unitID] then + return + end -- already got this unit + if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true then + return + end red_start = red_start or 1.0 green_start = green_start or 1.0 blue_start = blue_start or 1.0 @@ -393,16 +393,20 @@ local function DrawParalyzedUnitGL4(unitID, unitDefID, red_start, green_start, time_end = 500000 --time_end or spGetGameFrame() unitDefID = unitDefID or spGetUnitDefID(unitID) - pushElementInstance(paralyzedDrawUnitVBOTable , { - red_start, green_start,blue_start, power_start, - red_end, green_end, blue_end, time_end, - 0,0,0,0 - }, - unitID, - true, - nil, - unitID, - "unitID") + pushElementInstance(paralyzedDrawUnitVBOTable, { + red_start, + green_start, + blue_start, + power_start, + red_end, + green_end, + blue_end, + time_end, + 0, + 0, + 0, + 0, + }, unitID, true, nil, unitID, "unitID") --spEcho("Pushed", unitID, elementID) return unitID end @@ -426,9 +430,9 @@ local spec, fullview local function init() InstanceVBOTable.clearInstanceTable(paralyzedDrawUnitVBOTable) local allUnits = spGetAllUnits() - for i=1, #allUnits do + for i = 1, #allUnits do local unitID = allUnits[i] - local health,maxHealth,paralyzeDamage,capture,build = spGetUnitHealth(unitID) + local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) if paralyzeDamage and paralyzeDamage > 0 then widget:UnitCreated(unitID, spGetUnitDefID(unitID)) end @@ -450,7 +454,7 @@ function widget:UnitCreated(unitID, unitDefID) DrawParalyzedUnitGL4(unitID, unitDefID) end - local health,maxHealth,paralyzeDamage,capture,build = spGetUnitHealth(unitID) + local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) if paralyzeDamage and paralyzeDamage > 0 then DrawParalyzedUnitGL4(unitID, unitDefID) end @@ -464,12 +468,16 @@ function widget:UnitLeftLos(unitID) -- Spectators with fullview see all units regardless of LOS; don't strip the -- effect on LOS-leave because UnitEnteredLos early-returns under fullview -- and would never restore it (causes effect to vanish from paralyzed units). - if fullview then return end + if fullview then + return + end StopDrawParalyzedUnitGL4(unitID) end function widget:UnitEnteredLos(unitID) - if fullview then return end + if fullview then + return + end widget:UnitCreated(unitID, spGetUnitDefID(unitID)) end @@ -479,7 +487,7 @@ local function UnitParalyzeDamageEffect(unitID, unitDefID, damage) -- called fro widget:UnitCreated(unitID, unitDefID) end -local uniformcache = {0} +local uniformcache = { 0 } local toremove = {} function widget:GameFrame(n) @@ -512,11 +520,11 @@ function widget:Initialize() if TESTMODE then for i, unitID in ipairs(spGetAllUnits()) do widget:UnitCreated(unitID) - gl.SetUnitBufferUniforms(unitID, {1.01}, 4) + gl.SetUnitBufferUniforms(unitID, { 1.01 }, 4) end end - WG['DrawParalyzedUnitGL4'] = DrawParalyzedUnitGL4 - WG['StopDrawParalyzedUnitGL4'] = StopDrawParalyzedUnitGL4 + WG["DrawParalyzedUnitGL4"] = DrawParalyzedUnitGL4 + WG["StopDrawParalyzedUnitGL4"] = StopDrawParalyzedUnitGL4 end function widget:UnitParalyzeDamageEffect(unitID, unitDefID, damage) @@ -524,8 +532,8 @@ function widget:UnitParalyzeDamageEffect(unitID, unitDefID, damage) end function widget:Shutdown() - WG['DrawParalyzedUnitGL4'] = nil - WG['StopDrawParalyzedUnitGL4'] = nil + WG["DrawParalyzedUnitGL4"] = nil + WG["StopDrawParalyzedUnitGL4"] = nil end function widget:DrawWorld() @@ -534,13 +542,13 @@ function widget:DrawWorld() gl.Culling(GL.BACK) gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove gl.DepthTest(true) - gl.PolygonOffset( -2 ,-2) + gl.PolygonOffset(-2, -2) paralyzedUnitShader:Activate() --gl.Texture(0, "luaui/images/noisetextures/rgba_noise_256.tga") paralyzedDrawUnitVBOTable.VAO:Submit() paralyzedUnitShader:Deactivate() --gl.Texture(0, false) - gl.PolygonOffset( false ) + gl.PolygonOffset(false) --gl.DepthMask(true) --"BK OpenGL state resets", was true but now commented out (redundant set of false states) gl.Culling(false) end diff --git a/luaui/Widgets/gfx_sepia_tone.lua b/luaui/Widgets/gfx_sepia_tone.lua index aebf7c285d0..6cdbff346d0 100644 --- a/luaui/Widgets/gfx_sepia_tone.lua +++ b/luaui/Widgets/gfx_sepia_tone.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Sepia Tone", - desc = "Gives that warm, urine like color we all love from 2000s era games.", - author = "Beherith", - date = "2023.01.05", - license = "GNU GPL, v2 or later", - layer = 200000, - enabled = false - } + return { + name = "Sepia Tone", + desc = "Gives that warm, urine like color we all love from 2000s era games.", + author = "Beherith", + date = "2023.01.05", + license = "GNU GPL, v2 or later", + layer = 200000, + enabled = false, + } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -20,10 +19,10 @@ local spEcho = Spring.Echo local GL_RGBA8 = 0x8058 -local params = {gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0, shadeUI = false} +local params = { gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0, shadeUI = false } -- skip draw if this matches: -local defaultParams = {gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0.0} +local defaultParams = { gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0.0 } local luaShaderDir = "LuaUI/Include/" @@ -113,7 +112,6 @@ void main() } ]] - ----------------------------------------------------------------- -- Global Variables ----------------------------------------------------------------- @@ -164,15 +162,15 @@ function widget:Initialize() uniformFloat = { viewPosX = vpx, viewPosY = vpy, - params = { params.gamma, params.saturation, params.contrast, params.sepia} --{gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0.0} - } + params = { params.gamma, params.saturation, params.contrast, params.sepia }, --{gamma = 0.5, saturation = 0.5, contrast = 0.5, sepia = 0.0} + }, }, ": Sepia") local shaderCompiled = sepiaShader:Initialize() if not shaderCompiled then - spEcho("Failed to compile Sepia shader, removing widget") - widgetHandler:RemoveWidget() - return + spEcho("Failed to compile Sepia shader, removing widget") + widgetHandler:RemoveWidget() + return end UpdateShader() @@ -219,7 +217,6 @@ function widget:Initialize() WG.sepia.getShadeUI = function() return params.shadeUI end - end function widget:Shutdown() @@ -240,15 +237,19 @@ end local function DoSepia() local alldefault = true - for k,v in pairs(defaultParams) do - if math.abs(params[k] - v) > 0.001 then + for k, v in pairs(defaultParams) do + if math.abs(params[k] - v) > 0.001 then alldefault = false end end - if alldefault then return end - + if alldefault then + return + end + gl.CopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - if screenCopyTex == nil then return end + if screenCopyTex == nil then + return + end gl.Texture(0, screenCopyTex) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) sepiaShader:Activate() @@ -259,26 +260,29 @@ local function DoSepia() gl.Texture(0, false) end - function widget:DrawScreenEffects() - if params.shadeUI == false then DoSepia() end + if params.shadeUI == false then + DoSepia() + end end function widget:DrawScreenPost() - if params.shadeUI == true then DoSepia() end + if params.shadeUI == true then + DoSepia() + end end function widget:TextCommand(command) - if string.find(command,"sepiatone", nil, true ) == 1 then - local s = string.split(command, ' ') + if string.find(command, "sepiatone", nil, true) == 1 then + local s = string.split(command, " ") spEcho("/luaui sepiatone gamma saturation contrast sepia shadeUI") - spEcho(command) + spEcho(command) params.gamma = tonumber(s[2]) or params.gamma params.saturation = tonumber(s[3]) or params.saturation params.contrast = tonumber(s[4]) or params.contrast params.sepia = tonumber(s[5]) or params.sepia - if s[6] ~= nil then - params.shadeUI = s[6] == 'true' + if s[6] ~= nil then + params.shadeUI = s[6] == "true" end end end @@ -288,7 +292,7 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - for k,v in pairs(data) do + for k, v in pairs(data) do params[k] = data[k] or v end end diff --git a/luaui/Widgets/gfx_showbuilderqueue.lua b/luaui/Widgets/gfx_showbuilderqueue.lua index 6a8afe9c245..4593d9ebd45 100644 --- a/luaui/Widgets/gfx_showbuilderqueue.lua +++ b/luaui/Widgets/gfx_showbuilderqueue.lua @@ -121,7 +121,7 @@ function widget:Initialize() if not WG.DrawUnitShapeGL4 then widgetHandler:RemoveWidget() else - widget:Shutdown() -- to clear first + widget:Shutdown() -- to clear first end if not WG.BuilderQueueApi then diff --git a/luaui/Widgets/gfx_snow.lua b/luaui/Widgets/gfx_snow.lua index ca2cf0d82f2..e75683d6d37 100644 --- a/luaui/Widgets/gfx_snow.lua +++ b/luaui/Widgets/gfx_snow.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Snow", - desc = "Lets it automaticly snow on snow maps! - also togglable with /snow (remembers per map)", - author = "Floris (original: trepan, Argh)", - date = "29 may 2015", - license = "GNU GPL, v2 or later", - layer = -24, - enabled = true - } + return { + name = "Snow", + desc = "Lets it automaticly snow on snow maps! - also togglable with /snow (remembers per map)", + author = "Floris (original: trepan, Argh)", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = -24, + enabled = true, + } end - -- Localized functions for performance local mathFloor = math.floor local mathRandom = math.random @@ -29,19 +28,19 @@ local spGetViewGeometry = Spring.GetViewGeometry -- local vsx,vsy = spGetViewGeometry() -local minFps = 22 -- stops snowing at -local maxFps = 55 -- max particles at -local particleSteps = 14 -- max steps in diminishing number of particles (dont use too much steps, creates extra dlist for each step) -local particleMultiplier = 0.005 -- amount of particles -local customParticleMultiplier = 1 -local windMultiplier = 4.5 -local maxWindSpeed = 25 -- to keep it real -local gameFrameCountdown = 120 -- on launch: wait this many frames before adjusting the average fps calc +local minFps = 22 -- stops snowing at +local maxFps = 55 -- max particles at +local particleSteps = 14 -- max steps in diminishing number of particles (dont use too much steps, creates extra dlist for each step) +local particleMultiplier = 0.005 -- amount of particles +local customParticleMultiplier = 1 +local windMultiplier = 4.5 +local maxWindSpeed = 25 -- to keep it real +local gameFrameCountdown = 120 -- on launch: wait this many frames before adjusting the average fps calc -- pregame info message local autoReduce = true -local fpsDifference = (maxFps-minFps)/particleSteps -- fps difference need before changing the dlist to one with fewer particles +local fpsDifference = (maxFps - minFps) / particleSteps -- fps difference need before changing the dlist to one with fewer particles local snowTexture = "LuaUI/Images/snow.dds" @@ -60,28 +59,28 @@ snowMaps['thecoldplace'] = false local particleTypes = {} tableInsert(particleTypes, { - gravity = 50, - scale = 5500 + gravity = 50, + scale = 5500, }) tableInsert(particleTypes, { - gravity = 44, - scale = 5500 + gravity = 44, + scale = 5500, }) tableInsert(particleTypes, { - gravity = 58, - scale = 5500 + gravity = 58, + scale = 5500, }) tableInsert(particleTypes, { - gravity = 62, - scale = 6600 + gravity = 62, + scale = 6600, }) tableInsert(particleTypes, { - gravity = 47, - scale = 6600 + gravity = 47, + scale = 6600, }) tableInsert(particleTypes, { - gravity = 54, - scale = 6600 + gravity = 54, + scale = 6600, }) local widgetDisabledSnow = false @@ -91,21 +90,23 @@ local shader local startTimer = Spring.GetTimer() local diffTime = 0 -local spGetFPS = Spring.GetFPS -local averageFps = 60 +local spGetFPS = Spring.GetFPS +local averageFps = 60 -local camX,camY,camZ -local vsx, vsy = gl.GetViewSizes() -local particleScale = 1 +local camX, camY, camZ +local vsx, vsy = gl.GetViewSizes() +local particleScale = 1 local offsetX = 0 local offsetZ = 0 local prevOsClock = os.clock() local enabled = false -local previousFps = (maxFps + minFps) / 1.75 -local particleStep = mathFloor(particleSteps / 1.33) -if particleStep < 1 then particleStep = 1 end +local previousFps = (maxFps + minFps) / 1.75 +local particleStep = mathFloor(particleSteps / 1.33) +if particleStep < 1 then + particleStep = 1 +end local currentMapname = Game.mapName:lower() local particleLists = {} local particleDensityMax = 0 @@ -115,18 +116,18 @@ local previousParticleAmount = particleDensity -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spGetWind = Spring.GetWind +local spGetWind = Spring.GetWind -local glBlending = gl.Blending -local glCallList = gl.CallList -local glDepthTest = gl.DepthTest -local glDeleteList = gl.DeleteList -local glTexture = gl.Texture -local glGetShaderLog = gl.GetShaderLog -local glCreateShader = gl.CreateShader -local LuaShader = gl.LuaShader -local glDeleteShader = gl.DeleteShader -local glResetState = gl.ResetState +local glBlending = gl.Blending +local glCallList = gl.CallList +local glDepthTest = gl.DepthTest +local glDeleteList = gl.DeleteList +local glTexture = gl.Texture +local glGetShaderLog = gl.GetShaderLog +local glCreateShader = gl.CreateShader +local LuaShader = gl.LuaShader +local glDeleteShader = gl.DeleteShader +local glResetState = gl.ResetState -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -136,8 +137,8 @@ local startOsClock = os.clock() local function removeParticleLists() if particleLists[1] ~= nil then - for layer=1, 3 do - for step=1, particleSteps do + for layer = 1, 3 do + for step = 1, particleSteps do glDeleteList(particleLists[layer][step]) end end @@ -155,30 +156,30 @@ end function widget:Shutdown() removeSnow() - WG['snow'] = nil + WG["snow"] = nil end -- creating multiple lists per particleType so we can switch to less particles without causing lag local function CreateParticleLists() removeParticleLists() - particleDensityMax = mathFloor(((vsx * vsy) * (particleMultiplier*customParticleMultiplier)) / #particleTypes) - particleDensity = particleDensityMax * ((averageFps-minFps) / maxFps) + particleDensityMax = mathFloor(((vsx * vsy) * (particleMultiplier * customParticleMultiplier)) / #particleTypes) + particleDensity = particleDensityMax * ((averageFps - minFps) / maxFps) for particleType, pt in pairs(particleTypes) do particleLists[particleType] = {} - for step=1, particleSteps do + for step = 1, particleSteps do --local density = (particleDensityMax/particleSteps) * step - local particles = mathFloor(((particleDensityMax/particleSteps) * step) / (((particleSteps+(particleSteps/2)) - step) / (particleSteps/2))) + local particles = mathFloor(((particleDensityMax / particleSteps) * step) / (((particleSteps + (particleSteps / 2)) - step) / (particleSteps / 2))) particleLists[particleType][step] = gl.CreateList(function() local tmpRand = mathRandom() math.randomseed(particleType) gl.BeginEnd(GL.POINTS, function() - for i = 1, particles do - local x = mathRandom() - local y = mathRandom() - local z = mathRandom() - local w = 1 - gl.Vertex(x, y, z, w) - end + for i = 1, particles do + local x = mathRandom() + local y = mathRandom() + local z = mathRandom() + local w = 1 + gl.Vertex(x, y, z, w) + end end) mathRandom(1e9 * tmpRand) end) @@ -189,10 +190,11 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local function init() -- abort if not enabled - if enabled == false then return end + if enabled == false then + return + end if glCreateShader == nil then spEcho("[Snow widget:Initialize] no shader support") @@ -252,10 +254,10 @@ local function init() } ]], uniformFloat = { - time = diffTime, - scale = 0, - speed = {0,0,0}, - camPos = {0,0,0}, + time = diffTime, + scale = 0, + speed = { 0, 0, 0 }, + camPos = { 0, 0, 0 }, }, }, "Snow Shader") @@ -285,10 +287,10 @@ local function getWindSpeed() end local function snowCmd(_, _, params) - if (params[1] and params[1] == '1') or (not params[1] and (snowMaps[currentMapname] == nil or snowMaps[currentMapname] == false)) then + if (params[1] and params[1] == "1") or (not params[1] and (snowMaps[currentMapname] == nil or snowMaps[currentMapname] == false)) then snowMaps[currentMapname] = true enabled = true - spEcho("Snow widget: snow enabled for this map. (Snow wont show when average fps is below "..minFps..".)") + spEcho("Snow widget: snow enabled for this map. (Snow wont show when average fps is below " .. minFps .. ".)") init() else snowMaps[currentMapname] = false @@ -298,25 +300,24 @@ local function snowCmd(_, _, params) end end - function widget:Initialize() widget:ViewResize() - WG['snow'] = {} - WG['snow'].getSnowMap = function() + WG["snow"] = {} + WG["snow"].getSnowMap = function() if enabled or widgetDisabledSnow then return true else return false end end - WG['snow'].setMultiplier = function(value) + WG["snow"].setMultiplier = function(value) customParticleMultiplier = value - if enabled or widgetDisabledSnow then + if enabled or widgetDisabledSnow then CreateParticleLists() end end - WG['snow'].setAutoReduce = function(value) + WG["snow"].setAutoReduce = function(value) autoReduce = value if autoReduce == false then enabled = true @@ -326,7 +327,7 @@ function widget:Initialize() averageFps = spGetFPS() end end - WG['snow'].setSnowMap = function(value) + WG["snow"].setSnowMap = function(value) snowMaps[currentMapname] = value enabled = value if value then @@ -339,7 +340,7 @@ function widget:Initialize() startOsClock = os.clock() -- check for keywords local keywordFound = false - for _,keyword in pairs(snowKeywords) do + for _, keyword in pairs(snowKeywords) do if string.find(currentMapname, keyword, nil, true) then enabled = true keywordFound = true @@ -362,40 +363,48 @@ function widget:Initialize() getWindSpeed() init() - widgetHandler:AddAction("snow", snowCmd, nil, 't') + widgetHandler:AddAction("snow", snowCmd, nil, "t") end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function widget:GameFrame(gameFrame) - if not enabled and not widgetDisabledSnow then return end + if not enabled and not widgetDisabledSnow then + return + end if gameFrameCountdown <= 0 then - if gameFrame%31==0 then + if gameFrame % 31 == 0 then getWindSpeed() end - if gameFrame%44==0 then + if gameFrame % 44 == 0 then averageFps = ((averageFps * 19) + spGetFPS()) / 20 - if averageFps < 1 then averageFps = 1 end + if averageFps < 1 then + averageFps = 1 + end end - if gameFrame%88==0 and autoReduce then - if averageFps >= previousFps+fpsDifference or averageFps <= previousFps-fpsDifference then - local particleAmount = (averageFps-minFps) / (maxFps-minFps) + if gameFrame % 88 == 0 and autoReduce then + if averageFps >= previousFps + fpsDifference or averageFps <= previousFps - fpsDifference then + local particleAmount = (averageFps - minFps) / (maxFps - minFps) if particleAmount > 1 then particleAmount = 1 end if previousParticleAmount ~= particleAmount then previousParticleAmount = particleAmount previousFps = averageFps - if particleAmount <= 1/particleSteps then + if particleAmount <= 1 / particleSteps then enabled = false widgetDisabledSnow = true else particleDensity = mathFloor(particleDensityMax * particleAmount) - if particleDensity > particleDensityMax then particleDensity = particleDensityMax end + if particleDensity > particleDensityMax then + particleDensity = particleDensityMax + end particleStep = mathFloor(particleDensity / (particleDensityMax / particleSteps)) - if particleStep < 1 then particleStep = 1 end + if particleStep < 1 then + particleStep = 1 + end enabled = true widgetDisabledSnow = false end @@ -410,24 +419,28 @@ end function widget:Shutdown() enabled = false widgetHandler:RemoveAction("snow") - if shader then shader:Finalize() end + if shader then + shader:Finalize() + end end local pausedTime = 0 local lastFrametime = Spring.GetTimer() function widget:DrawWorld() - if not enabled then return end + if not enabled then + return + end local _, _, isPaused = Spring.GetGameSpeed() if isPaused then pausedTime = pausedTime + Spring.DiffTimers(Spring.GetTimer(), lastFrametime) end lastFrametime = Spring.GetTimer() - if os.clock() - startOsClock > 0.5 then -- delay to prevent no textures being shown + if os.clock() - startOsClock > 0.5 then -- delay to prevent no textures being shown if shader ~= nil and particleLists[#particleTypes] ~= nil and particleLists[#particleTypes][particleStep] ~= nil then shader:Activate() - camX,camY,camZ = Spring.GetCameraPosition() + camX, camY, camZ = Spring.GetCameraPosition() diffTime = Spring.DiffTimers(lastFrametime, startTimer) - pausedTime shader:SetUniform("time", diffTime) shader:SetUniform("camPos", camX, camY, camZ) @@ -466,8 +479,7 @@ function widget:DrawWorld() end function widget:ViewResize() - vsx,vsy = spGetViewGeometry() - + vsx, vsy = spGetViewGeometry() if particleLists[#particleTypes] ~= nil then CreateParticleLists() @@ -479,28 +491,38 @@ end -------------------------------------------------------------------------------- function widget:GetConfigData(data) - return { + return { snowMaps = snowMaps, averageFps = mathFloor(averageFps), articleStep = particleStep, gameframe = spGetGameFrame(), customParticleMultiplier = customParticleMultiplier, - autoReduce = autoReduce + autoReduce = autoReduce, } end function widget:SetConfigData(data) - if data.snowMaps ~= nil then snowMaps = data.snowMaps end - if data.customParticleMultiplier ~= nil then customParticleMultiplier = data.customParticleMultiplier end - if data.autoReduce ~= nil then autoReduce = data.autoReduce end - if data.gameframe ~= nil and data.gameframe > 0 then - if data.averageFps ~= nil then + if data.snowMaps ~= nil then + snowMaps = data.snowMaps + end + if data.customParticleMultiplier ~= nil then + customParticleMultiplier = data.customParticleMultiplier + end + if data.autoReduce ~= nil then + autoReduce = data.autoReduce + end + if data.gameframe ~= nil and data.gameframe > 0 then + if data.averageFps ~= nil then averageFps = data.averageFps end if data.particleStep ~= nil and data.gameframe ~= nil and spGetGameFrame() > 0 then particleStep = data.particleStep - if particleStep < 1 then particleStep = 1 end - if particleStep > particleSteps then particleStep = particleSteps end + if particleStep < 1 then + particleStep = 1 + end + if particleStep > particleSteps then + particleStep = particleSteps + end end end end diff --git a/luaui/Widgets/gfx_ssao.lua b/luaui/Widgets/gfx_ssao.lua index a6af186c3a0..e59bbe971ee 100644 --- a/luaui/Widgets/gfx_ssao.lua +++ b/luaui/Widgets/gfx_ssao.lua @@ -1,31 +1,29 @@ local glRendererLower = Platform.glRenderer and string.lower(Platform.glRenderer) or "" local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 1000) / 1000 -if Platform ~= nil and Platform.gpuVendor == 'Intel' and not string.find(glRendererLower, "arc") then +if Platform ~= nil and Platform.gpuVendor == "Intel" and not string.find(glRendererLower, "arc") then return false end if gpuMem and gpuMem > 0 and gpuMem < 1800 then return false end - local widgetName = "SSAO" local widget = widget ---@type Widget function widget:GetInfo() - return { - name = widgetName, - version = 2.0, - desc = "Screen-Space Ambient Occlusion", - author = "ivand", - date = "2019", - license = "GPL", - layer = 999999, - enabled = true, - depends = {'gl4'}, - } + return { + name = widgetName, + version = 2.0, + desc = "Screen-Space Ambient Occlusion", + author = "ivand", + date = "2019", + license = "GPL", + layer = 999999, + enabled = true, + depends = { "gl4" }, + } end - -- Localized functions for performance local mathCeil = math.ceil local mathSqrt = math.sqrt @@ -72,47 +70,44 @@ local shaderConfig = { MERGE_MISC = 0, -- for future material indices based SSAO evaluation, completely dissabled now } - local definesSlidersParamsList = { - {name = 'SSAO_FIBONACCI', default = 1, min = 0, max = 1, digits = 0, tooltip = 'Use uniformly distributed rays intead of randomly distributed ones'}, - {name = 'SSAO_KERNEL_MINZ', default = 0.04, min = 0, max = 0.2, digits = 2, tooltip = 'How close vectors can be to tangent plane'}, - {name = 'SSAO_RANDOM_LENGTH', default = 0.6, min = 0.2, max = 3, digits = 2, tooltip = 'A power term for the lenghts of the random vectors, small numbers are longer vectors'}, - {name = 'SSAO_KERNEL_SIZE', default = 32, min = 1, max = 64, digits = 0, tooltip = 'how many samples are used for SSAO spatial sampling'}, + { name = "SSAO_FIBONACCI", default = 1, min = 0, max = 1, digits = 0, tooltip = "Use uniformly distributed rays intead of randomly distributed ones" }, + { name = "SSAO_KERNEL_MINZ", default = 0.04, min = 0, max = 0.2, digits = 2, tooltip = "How close vectors can be to tangent plane" }, + { name = "SSAO_RANDOM_LENGTH", default = 0.6, min = 0.2, max = 3, digits = 2, tooltip = "A power term for the lenghts of the random vectors, small numbers are longer vectors" }, + { name = "SSAO_KERNEL_SIZE", default = 32, min = 1, max = 64, digits = 0, tooltip = "how many samples are used for SSAO spatial sampling" }, --{name = 'MINISHADOWS', default = 0, min = 0, max = 1, digits = 0, tooltip = 'Wether to draw a downsampled shadow sampler'}, - {name = 'SSAO_RADIUS', default = 8, min = 4, max = 16, digits = 1, tooltip = 'world space maximum sampling radius'}, - {name = 'SSAO_RADIUS_FAR_SCALE', default = 3, min = 1, max = 8, digits = 1, tooltip = 'How much to grow SSAO radius at far distance to keep AO visible when zoomed out (1 = disabled)'}, - {name = 'SSAO_MIN', default = 0.7, min = 0, max = 4, digits = 2, tooltip = 'minimum depth difference between fragment and sample depths to trigger SSAO sample occlusion. Absolute value in world space coords.'}, - {name = 'SSAO_OCCLUSION_POWER', default = 4, min = 0, max = 16, digits = 1, tooltip = 'how much effect each SSAO sample has'}, - {name = 'SSAO_FADE_DIST_1', default = 1200, min = 200, max = 3000, digits = 1, tooltip = 'near distance for max SSAO'}, - {name = 'SSAO_FADE_DIST_0', default = 2400, min = 1000, max = 4000, digits = 1, tooltip = 'far distance for min SSAO'}, - {name = 'DEBUG_SSAO', default = 0, min = 0, max = 1, digits = 0, tooltip = 'DEBUG_SSAO show the raw samples'}, - - - {name = 'BRIGHTEN', default = 20, min = 0, max = 255, digits = 0, tooltip = 'Should SSAO Brighten Models, if yes by how much'}, - {name = 'BLUR_HALF_KERNEL_SIZE', default = 3, min = 1, max = 12, digits = 0, tooltip = 'BLUR_HALF_KERNEL_SIZE*2 - 1 samples for blur'}, - {name = 'BLUR_SIGMA', default = 3, min = 1, max = 10, digits = 1, tooltip = 'Sigma width of blur filter'}, - {name = 'MINCOSANGLE', default = -0.15, min = -3, max = 1, digits = 2, tooltip = 'the minimum angle for considering a sample colinear when blurring'}, - {name = 'ZTHRESHOLD', default = 0.005, min = 0.0, max = 4/255.0, digits = 3, tooltip = 'Should be more than 1.0. Do not touch'}, - {name = 'MINSELFWEIGHT', default = 0.2, min = 0.0, max = 1, digits = 2, tooltip = 'The minimum additional weight a sample needs to gather to be considered a non-outlier'}, - {name = 'OUTLIERCORRECTIONFACTOR', default = 0.5, min = 0.0, max = 1, digits = 2, tooltip = 'How strongly to use blurred result instead for outliers'}, - {name = 'BLUR_POWER', default = 2, min = 1, max = 8, digits = 1, tooltip = 'Post-blur correction factor'}, - {name = 'BLUR_CLAMP', default = 0.05, min = 0, max = 1, digits = 3, tooltip = 'Limit occlusion post-blur'}, - {name = 'DEBUG_BLUR', default = 0, min = 0, max = 1, digits = 0, tooltip = 'DEBUG_BLUR show the result of the blur only'}, - - - {name = 'USE_STENCIL', default = 1, min = 0, max = 1, digits = 0, tooltip = 'USE_STENCIL set to zero if you dont wanna'}, - {name = 'DOWNSAMPLE', default = 1, min = 1, max = 2, digits = 0, tooltip = 'Set to 2 for half-rez buffers'}, - {name = 'ENABLE', default = 1, min = 0, max = 1, digits = 0, tooltip = 'Disable the whole SSAO'}, - {name = 'SLOWFUSE', default = 0, min = 0, max = 1, digits = 0, tooltip = 'Only fuse every 30 frames. DO NOT TOUCH!'}, - {name = 'NOFUSE', default = 0, min = 0, max = 1, digits = 0, tooltip = 'Dont use the gbuf fuse texture'}, - - {name = 'SSAO_ALPHA_POW', default = 10, min = 1, max = 20, digits = 0, tooltip = 'Legacy setting'}, + { name = "SSAO_RADIUS", default = 8, min = 4, max = 16, digits = 1, tooltip = "world space maximum sampling radius" }, + { name = "SSAO_RADIUS_FAR_SCALE", default = 3, min = 1, max = 8, digits = 1, tooltip = "How much to grow SSAO radius at far distance to keep AO visible when zoomed out (1 = disabled)" }, + { name = "SSAO_MIN", default = 0.7, min = 0, max = 4, digits = 2, tooltip = "minimum depth difference between fragment and sample depths to trigger SSAO sample occlusion. Absolute value in world space coords." }, + { name = "SSAO_OCCLUSION_POWER", default = 4, min = 0, max = 16, digits = 1, tooltip = "how much effect each SSAO sample has" }, + { name = "SSAO_FADE_DIST_1", default = 1200, min = 200, max = 3000, digits = 1, tooltip = "near distance for max SSAO" }, + { name = "SSAO_FADE_DIST_0", default = 2400, min = 1000, max = 4000, digits = 1, tooltip = "far distance for min SSAO" }, + { name = "DEBUG_SSAO", default = 0, min = 0, max = 1, digits = 0, tooltip = "DEBUG_SSAO show the raw samples" }, + + { name = "BRIGHTEN", default = 20, min = 0, max = 255, digits = 0, tooltip = "Should SSAO Brighten Models, if yes by how much" }, + { name = "BLUR_HALF_KERNEL_SIZE", default = 3, min = 1, max = 12, digits = 0, tooltip = "BLUR_HALF_KERNEL_SIZE*2 - 1 samples for blur" }, + { name = "BLUR_SIGMA", default = 3, min = 1, max = 10, digits = 1, tooltip = "Sigma width of blur filter" }, + { name = "MINCOSANGLE", default = -0.15, min = -3, max = 1, digits = 2, tooltip = "the minimum angle for considering a sample colinear when blurring" }, + { name = "ZTHRESHOLD", default = 0.005, min = 0.0, max = 4 / 255.0, digits = 3, tooltip = "Should be more than 1.0. Do not touch" }, + { name = "MINSELFWEIGHT", default = 0.2, min = 0.0, max = 1, digits = 2, tooltip = "The minimum additional weight a sample needs to gather to be considered a non-outlier" }, + { name = "OUTLIERCORRECTIONFACTOR", default = 0.5, min = 0.0, max = 1, digits = 2, tooltip = "How strongly to use blurred result instead for outliers" }, + { name = "BLUR_POWER", default = 2, min = 1, max = 8, digits = 1, tooltip = "Post-blur correction factor" }, + { name = "BLUR_CLAMP", default = 0.05, min = 0, max = 1, digits = 3, tooltip = "Limit occlusion post-blur" }, + { name = "DEBUG_BLUR", default = 0, min = 0, max = 1, digits = 0, tooltip = "DEBUG_BLUR show the result of the blur only" }, + + { name = "USE_STENCIL", default = 1, min = 0, max = 1, digits = 0, tooltip = "USE_STENCIL set to zero if you dont wanna" }, + { name = "DOWNSAMPLE", default = 1, min = 1, max = 2, digits = 0, tooltip = "Set to 2 for half-rez buffers" }, + { name = "ENABLE", default = 1, min = 0, max = 1, digits = 0, tooltip = "Disable the whole SSAO" }, + { name = "SLOWFUSE", default = 0, min = 0, max = 1, digits = 0, tooltip = "Only fuse every 30 frames. DO NOT TOUCH!" }, + { name = "NOFUSE", default = 0, min = 0, max = 1, digits = 0, tooltip = "Dont use the gbuf fuse texture" }, + + { name = "SSAO_ALPHA_POW", default = 10, min = 1, max = 20, digits = 0, tooltip = "Legacy setting" }, } local function InitShaderDefines() for i, shaderDefine in ipairs(definesSlidersParamsList) do -- dont overwrite existing, externally defined values with the defaults: if shaderConfig[shaderDefine.name] == nil then - shaderConfig[shaderDefine.name] = shaderDefine.default; + shaderConfig[shaderDefine.name] = shaderDefine.default end end end @@ -136,9 +131,9 @@ local shaderDefinedSliders = { sliderheight = 20, valuetarget = shaderConfig, sliderParamsList = definesSlidersParamsList, - callbackfunc = shaderDefinesChangedCallback + callbackfunc = shaderDefinesChangedCallback, } -shaderDefinedSliders.top = shaderDefinedSliders.bottom + shaderDefinedSliders.sliderheight *( #definesSlidersParamsList +3) +shaderDefinedSliders.top = shaderDefinedSliders.bottom + shaderDefinedSliders.sliderheight * (#definesSlidersParamsList + 3) local shaderDefinedSlidersLayer, shaderDefinedSlidersWindow @@ -188,7 +183,7 @@ local presets = { SSAO_MIN = 0.62, SSAO_RADIUS = 8, SSAO_RADIUS_FAR_SCALE = 3.6, - USE_STENCIL = 1 + USE_STENCIL = 1, }, { -- HIGH QUALITY BLUR_CLAMP = 0.145, @@ -207,13 +202,13 @@ local presets = { SSAO_MIN = 0.61, SSAO_RADIUS = 7, SSAO_RADIUS_FAR_SCALE = 4.5, -- HIGH gets the most reach so contact shadows stay readable at full zoom - USE_STENCIL = 1 + USE_STENCIL = 1, }, } local function ActivatePreset(presetID) if presets[presetID] then - for k,v in pairs(presets[presetID]) do + for k, v in pairs(presets[presetID]) do shaderConfig[k] = v end end @@ -234,7 +229,7 @@ local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable local vsx, vsy, vpx, vpy -local texPaddingX, texPaddingY = 0,0 +local texPaddingX, texPaddingY = 0, 0 local gbuffFuseFBO local ssaoFBO @@ -252,7 +247,7 @@ local gbuffFuseShaderCache local gaussianBlurShaderCache local texrectShader = nil -local ssaoCompositeShader = nil -- final composite (depth-rejects grass/decals via gl_FragDepth + LEQUAL) +local ssaoCompositeShader = nil -- final composite (depth-rejects grass/decals via gl_FragDepth + LEQUAL) local ssaoCompositeShaderCache local texrectFullVAO = nil local texrectPaddedVAO = nil @@ -266,7 +261,7 @@ local unitStencil = nil ----------------------------------------------------------------- local function G(x, sigma) - return ( 1 / ( mathSqrt(2 * mathPi) * sigma ) ) * math.exp( -(x * x) / (2 * sigma * sigma) ) + return (1 / (mathSqrt(2 * mathPi) * sigma)) * math.exp(-(x * x) / (2 * sigma * sigma)) end local function GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, valMult) @@ -288,21 +283,20 @@ local function GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, valMult) return weights, offsets end - --see http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ local function GetGaussLinearWeightsOffsets(sigma, kernelHalfSize, valMult) - local dWeights, dOffsets = GetGaussDiscreteWeightsOffsets(sigma, (kernelHalfSize-1) * 2 + 1 , 1.0) + local dWeights, dOffsets = GetGaussDiscreteWeightsOffsets(sigma, (kernelHalfSize - 1) * 2 + 1, 1.0) -- at khs = 4 -- dWeights, {1=0.1112202, 2=0.10779832, 3=0.09815148, 4=0.08395342, 5=0.06745847, 6=0.05092032, 7=0.03610791, } -- dOffsets, {1=0, 2=1, 3=2, 4=3, 5=4, 6=5, 7=6, } - local weights = {dWeights[1]} - local offsets = {dOffsets[1]} + local weights = { dWeights[1] } + local offsets = { dOffsets[1] } local totalweights = dWeights[1] -- for 4 this should go to 3 - for i = 1, kernelHalfSize -1 do -- for khs 4 this goes from 1 to , well 1. - local newWeight = dWeights[2 * i ] + dWeights[2 * i + 1] + for i = 1, kernelHalfSize - 1 do -- for khs 4 this goes from 1 to , well 1. + local newWeight = dWeights[2 * i] + dWeights[2 * i + 1] weights[i + 1] = newWeight * valMult offsets[i + 1] = (dOffsets[2 * i] * dWeights[2 * i] + dOffsets[2 * i + 1] * dWeights[2 * i + 1]) / newWeight end @@ -325,11 +319,11 @@ local function GetGaussLinearWeightsOffsets(sigma, kernelHalfSize, valMult) spEcho('dOffsets',tabletostring(dOffsets)) spEcho('weights',tabletostring(weights)) spEcho('offsets',tabletostring(offsets)) - ]]-- + ]] + -- return weights, offsets end - -- quick port of GLSL. --[[ for (int i = 0; i < SSAO_KERNEL_SIZE; i++) { @@ -341,7 +335,8 @@ end tmp *= scale; samplingKernel[i] = tmp; } -]]-- +]] +-- -- I do so because of according GLSL spec gl_MaxVertexOutputComponents = 64; and gl_MaxFragmentUniformComponents = 1024; -- so bigger SSAO kernel size can be supported if they are conveyed via uniforms vs varyings local function GetSamplingVectorArray(kernelSize) @@ -349,26 +344,25 @@ local function GetSamplingVectorArray(kernelSize) math.randomseed(kernelSize) -- for repeatability if shaderConfig.SSAO_FIBONACCI == 1 then local points = {} - local phi = mathPi * (mathSqrt(5.) - 1.)-- # golden angle in radians - local samples = 2*kernelSize + math.floor((100 * shaderConfig.SSAO_KERNEL_MINZ)) + local phi = mathPi * (mathSqrt(5.) - 1.) -- # golden angle in radians + local samples = 2 * kernelSize + math.floor((100 * shaderConfig.SSAO_KERNEL_MINZ)) - for i =0, samples do - local y = 1 - (i / (samples - 1)) * 2 -- y goes from 1 to -1 - local radius = mathSqrt(1 - y * y) -- radius at y + for i = 0, samples do + local y = 1 - (i / (samples - 1)) * 2 -- y goes from 1 to -1 + local radius = mathSqrt(1 - y * y) -- radius at y - local theta = phi * i -- golden angle increment + local theta = phi * i -- golden angle increment local x = math.cos(theta) * radius local z = math.sin(theta) * radius - local randlength = math.max(0.2, math.pow(mathRandom(), shaderConfig.SSAO_RANDOM_LENGTH) ) - points[i+1] = {x = x * randlength, y = z* randlength,z = y* randlength} -- note the swizzle of zy + local randlength = math.max(0.2, math.pow(mathRandom(), shaderConfig.SSAO_RANDOM_LENGTH)) + points[i + 1] = { x = x * randlength, y = z * randlength, z = y * randlength } -- note the swizzle of zy end - for i = 0, kernelSize-1 do - result[i] = points[i +1] + for i = 0, kernelSize - 1 do + result[i] = points[i + 1] end return result - else for i = 0, kernelSize - 1 do local x, y, z = mathRandom(), mathRandom(), mathRandom() -- [0, 1]^3 @@ -385,7 +379,7 @@ local function GetSamplingVectorArray(kernelSize) scale = math.clamp(scale, 0.2, 1.0) --clamp x, y, z = x * scale, y * scale, z * scale -- scale - result[i] = {x = x, y = y, z = z} + result[i] = { x = x, y = y, z = z } end return result end @@ -395,7 +389,6 @@ end -- Widget Functions ----------------------------------------------------------------- - local function InitGL() local canContinue = LuaShader.isDeferredShadingEnabled and LuaShader.GetAdvShadingActive() @@ -405,9 +398,9 @@ local function InitGL() -- make unit lighting brighter to compensate for darkening (also restoring values on Shutdown()) if presets[preset].tonemapA then - Spring.SetConfigFloat("tonemapA", initialTonemapA + (presets[preset].tonemapA * ((shaderConfig.SSAO_ALPHA_POW * strengthMult)/11))) - Spring.SetConfigFloat("tonemapD", initialTonemapD + (presets[preset].tonemapD * ((shaderConfig.SSAO_ALPHA_POW * strengthMult)/11))) - Spring.SetConfigFloat("tonemapE", initialTonemapE + (presets[preset].tonemapE * ((shaderConfig.SSAO_ALPHA_POW * strengthMult)/11))) + Spring.SetConfigFloat("tonemapA", initialTonemapA + (presets[preset].tonemapA * ((shaderConfig.SSAO_ALPHA_POW * strengthMult) / 11))) + Spring.SetConfigFloat("tonemapD", initialTonemapD + (presets[preset].tonemapD * ((shaderConfig.SSAO_ALPHA_POW * strengthMult) / 11))) + Spring.SetConfigFloat("tonemapE", initialTonemapE + (presets[preset].tonemapE * ((shaderConfig.SSAO_ALPHA_POW * strengthMult) / 11))) Spring.SendCommands("luarules updatesun") end @@ -438,7 +431,7 @@ local function InitGL() gbuffFuseFBO = gl.CreateFBO({ color0 = gbuffFuseViewPosTex, - drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + drawbuffers = { GL_COLOR_ATTACHMENT0_EXT }, }) if not gl.IsValidFBO(gbuffFuseFBO) then spEcho(string.format("Error in [%s] widget: %s", widgetName, "Invalid gbuffFuseFBO")) @@ -449,12 +442,12 @@ local function InitGL() commonTexOpts.mag_filter = GL.LINEAR commonTexOpts.format = GL_RGBA8 - ssaoTex = gl.CreateTexture(shaderConfig.HSX, shaderConfig.HSY , commonTexOpts) + ssaoTex = gl.CreateTexture(shaderConfig.HSX, shaderConfig.HSY, commonTexOpts) ssaoBlurTex = gl.CreateTexture(shaderConfig.HSX, shaderConfig.HSY, commonTexOpts) ssaoFBO = gl.CreateFBO({ color0 = ssaoTex, - drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + drawbuffers = { GL_COLOR_ATTACHMENT0_EXT }, }) if not gl.IsValidFBO(ssaoFBO) then spEcho(string.format("Error in [%s] widget: %s", widgetName, "Invalid ssaoFBO")) @@ -462,7 +455,7 @@ local function InitGL() ssaoBlurFBO = gl.CreateFBO({ color0 = ssaoBlurTex, - drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + drawbuffers = { GL_COLOR_ATTACHMENT0_EXT }, }) if not gl.IsValidFBO(ssaoBlurFBO) then spEcho(string.format("Error in [%s] widget: %s", widgetName, string.format("Invalid ssaoBlurFBO"))) @@ -470,7 +463,7 @@ local function InitGL() -- ensure stencil is available if shaderConfig.USE_STENCIL == 1 then - local stencilApi = WG['unitstencilapi'] + local stencilApi = WG["unitstencilapi"] if stencilApi then getStencilTexture = stencilApi.GetUnitStencilTexture unitStencilTexture = getStencilTexture() @@ -479,8 +472,8 @@ local function InitGL() end gbuffFuseShaderCache = { - vssrcpath = shadersDir.."texrect_screen.vert.glsl", - fssrcpath = shadersDir.."gbuffFuse.frag.glsl", + vssrcpath = shadersDir .. "texrect_screen.vert.glsl", + fssrcpath = shadersDir .. "gbuffFuse.frag.glsl", uniformInt = { modelDepthTex = 1, mapDepthTex = 4, @@ -490,14 +483,14 @@ local function InitGL() uniformFloat = {}, silent = true, -- suppress compilation messages shaderConfig = shaderConfig, - shaderName = widgetName.." G-buffer Fuse", + shaderName = widgetName .. " G-buffer Fuse", } gbuffFuseShader = LuaShader.CheckShaderUpdates(gbuffFuseShaderCache) ssaoShaderCache = { - vssrcpath = shadersDir.."texrect_screen.vert.glsl", - fssrcpath = shadersDir.."ssao.frag.glsl", + vssrcpath = shadersDir .. "texrect_screen.vert.glsl", + fssrcpath = shadersDir .. "ssao.frag.glsl", uniformInt = { viewPosTex = 5, viewNormalTex = 6, @@ -510,16 +503,15 @@ local function InitGL() unitStencilTex = 7, }, - uniformFloat = { - }, + uniformFloat = {}, silent = true, -- suppress compilation messages shaderConfig = shaderConfig, - shaderName = widgetName.." SSAO", + shaderName = widgetName .. " SSAO", } ssaoShader = LuaShader.CheckShaderUpdates(ssaoShaderCache) - ssaoShader:ActivateWith( function() + ssaoShader:ActivateWith(function() local samplingKernel = GetSamplingVectorArray(shaderConfig.SSAO_KERNEL_SIZE) for i = 0, shaderConfig.SSAO_KERNEL_SIZE - 1 do local sv = samplingKernel[i] @@ -529,21 +521,20 @@ local function InitGL() ssaoShader:SetUniformFloatAlways("testuniform", 1.0) end) - gaussianBlurShaderCache = { - vssrcpath = shadersDir.."texrect_screen.vert.glsl", - fssrcpath = shadersDir.."gaussianBlur.frag.glsl", + vssrcpath = shadersDir .. "texrect_screen.vert.glsl", + fssrcpath = shadersDir .. "gaussianBlur.frag.glsl", uniformInt = { tex = 0, unitStencilTex = 7, }, uniformFloat = { - dir = {0,1}, + dir = { 0, 1 }, strengthMult = 1, }, silent = true, -- suppress compilation messages shaderConfig = shaderConfig, - shaderName = widgetName.." gaussianBlur", + shaderName = widgetName .. " gaussianBlur", } gaussianBlurShader = LuaShader.CheckShaderUpdates(gaussianBlurShaderCache) @@ -552,24 +543,24 @@ local function InitGL() strengthMultCached = shaderConfig.SSAO_ALPHA_POW / 7.0 - gaussianBlurShader:ActivateWith( function() + gaussianBlurShader:ActivateWith(function() gaussianBlurShader:SetUniformFloatArrayAlways("weights", gaussWeights) gaussianBlurShader:SetUniformFloatArrayAlways("offsets", gaussOffsets) gaussianBlurShader:SetUniformFloatAlways("strengthMult", strengthMultCached) end) texrectShader = LuaShader.CheckShaderUpdates({ - vssrcpath = shadersDir.."texrect_screen.vert.glsl", - fssrcpath = shadersDir.."texrect_screen.frag.glsl", + vssrcpath = shadersDir .. "texrect_screen.vert.glsl", + fssrcpath = shadersDir .. "texrect_screen.frag.glsl", uniformInt = { tex = 0, }, uniformFloat = { - uniformparams = {0,0,0,0}, + uniformparams = { 0, 0, 0, 0 }, }, silent = true, -- suppress compilation messages shaderConfig = {}, - shaderName = widgetName..": texrect", + shaderName = widgetName .. ": texrect", }) -- SSAO final composite shader. Always used. Combines: @@ -578,8 +569,8 @@ local function InitGL() -- LEQUAL depth test rejects pixels where grass/decals/etc were -- drawn over the original surface after the gbuffer was captured. ssaoCompositeShaderCache = { - vssrcpath = shadersDir.."texrect_screen.vert.glsl", - fssrcpath = shadersDir.."ssaoComposite.frag.glsl", + vssrcpath = shadersDir .. "texrect_screen.vert.glsl", + fssrcpath = shadersDir .. "ssaoComposite.frag.glsl", uniformInt = { tex = 0, modelDepthTex = 1, @@ -589,26 +580,27 @@ local function InitGL() uniformFloat = {}, silent = true, shaderConfig = shaderConfig, - shaderName = widgetName..": SSAO composite", + shaderName = widgetName .. ": SSAO composite", } ssaoCompositeShader = LuaShader.CheckShaderUpdates(ssaoCompositeShaderCache) - texrectFullVAO = InstanceVBOTable.MakeTexRectVAO(-1, -1, 1, 1, 0,0,1,1) + texrectFullVAO = InstanceVBOTable.MakeTexRectVAO(-1, -1, 1, 1, 0, 0, 1, 1) -- These are now offset by the half pixel that is needed here due to ceil(vsx/rez) - texrectPaddedVAO = InstanceVBOTable.MakeTexRectVAO(-1, -1, 1, 1, 0.0, 0.0, 1.0 - shaderConfig.TEXPADDINGX/shaderConfig.VSX, 1.0 - shaderConfig.TEXPADDINGY/shaderConfig.VSY) - + texrectPaddedVAO = InstanceVBOTable.MakeTexRectVAO(-1, -1, 1, 1, 0.0, 0.0, 1.0 - shaderConfig.TEXPADDINGX / shaderConfig.VSX, 1.0 - shaderConfig.TEXPADDINGY / shaderConfig.VSY) end local function CleanGL() - gl.DeleteTexture(ssaoTex) - if gbuffFuseViewPosTex then gl.DeleteTexture(gbuffFuseViewPosTex) end + if gbuffFuseViewPosTex then + gl.DeleteTexture(gbuffFuseViewPosTex) + end gl.DeleteTexture(ssaoBlurTex) - gl.DeleteFBO(ssaoFBO) - if gbuffFuseFBO then gl.DeleteFBO(gbuffFuseFBO) end + if gbuffFuseFBO then + gl.DeleteFBO(gbuffFuseFBO) + end gl.DeleteFBO(ssaoBlurFBO) ssaoShader:Finalize() @@ -621,36 +613,35 @@ local function CleanGL() end end - function widget:ViewResize() CleanGL() InitGL() end function widget:Initialize() - WG['ssao'] = {} - WG['ssao'].getPreset = function() + WG["ssao"] = {} + WG["ssao"].getPreset = function() return preset end - WG['ssao'].setPreset = function(value) + WG["ssao"].setPreset = function(value) preset = value InitShaderDefines() ActivatePreset(preset) CleanGL() InitGL() end - WG['ssao'].getStrength = function() + WG["ssao"].getStrength = function() return shaderConfig.SSAO_ALPHA_POW end - WG['ssao'].setStrength = function(value) + WG["ssao"].setStrength = function(value) shaderConfig.SSAO_ALPHA_POW = value CleanGL() InitGL() end - WG['ssao'].getRadius = function() + WG["ssao"].getRadius = function() return shaderConfig.SSAO_RADIUS end - WG['ssao'].setRadius = function(value) + WG["ssao"].setRadius = function(value) shaderConfig.SSAO_RADIUS = value CleanGL() InitGL() @@ -659,7 +650,6 @@ function widget:Initialize() InitGL() end - local sec = 0 function widget:Update(dt) sec = sec + dt @@ -678,7 +668,6 @@ function widget:Update(dt) end function widget:Shutdown() - -- restore unit lighting settings if presets[preset].tonemapA then Spring.SetConfigFloat("tonemapA", initialTonemapA) @@ -687,7 +676,9 @@ function widget:Shutdown() Spring.SendCommands("luarules updatesun") end - if shaderDefinedSlidersLayer and shaderDefinedSlidersLayer.Destroy then shaderDefinedSlidersLayer:Destroy() end + if shaderDefinedSlidersLayer and shaderDefinedSlidersLayer.Destroy then + shaderDefinedSlidersLayer:Destroy() + end --if shaderDefinedSlidersWindow and shaderDefinedSlidersWindow.Destroy then shaderDefinedSlidersWindow:Destroy() end CleanGL() @@ -709,14 +700,14 @@ local function DoDrawSSAO() -- Gbuffer fuse pass: combine model + map depths if ((shaderConfig.SLOWFUSE == 0) or spGetDrawFrame() % 30 == 0) and (noFuse ~= 1) then prevFBO = glRawBindFBO(gbuffFuseFBO) - gbuffFuseShader:Activate() - gbuffFuseShader:SetUniformMatrix("invProjMatrix", "projectioninverse") - glTexture(1, "$model_gbuffer_zvaltex") - glTexture(4, "$map_gbuffer_zvaltex") - texrectFullVAO:DrawArrays(GL_TRIANGLES) - glTexture(1, false) - glTexture(4, false) - gbuffFuseShader:Deactivate() + gbuffFuseShader:Activate() + gbuffFuseShader:SetUniformMatrix("invProjMatrix", "projectioninverse") + glTexture(1, "$model_gbuffer_zvaltex") + glTexture(4, "$map_gbuffer_zvaltex") + texrectFullVAO:DrawArrays(GL_TRIANGLES) + glTexture(1, false) + glTexture(4, false) + gbuffFuseShader:Deactivate() glRawBindFBO(ssaoFBO) -- chain directly to SSAO FBO (avoids restore+rebind) else prevFBO = glRawBindFBO(ssaoFBO) @@ -725,14 +716,14 @@ local function DoDrawSSAO() -- SSAO sampling pass (now in ssaoFBO) glClear(GL_COLOR_BUFFER_BIT, 0, 0, 0, 0) ssaoShader:Activate() - if noFuse > 0 then - glTexture(1, "$model_gbuffer_zvaltex") - glTexture(4, "$map_gbuffer_zvaltex") - else - glTexture(5, gbuffFuseViewPosTex) - end - glTexture(0, "$model_gbuffer_normtex") - texrectFullVAO:DrawArrays(GL_TRIANGLES) + if noFuse > 0 then + glTexture(1, "$model_gbuffer_zvaltex") + glTexture(4, "$map_gbuffer_zvaltex") + else + glTexture(5, gbuffFuseViewPosTex) + end + glTexture(0, "$model_gbuffer_normtex") + texrectFullVAO:DrawArrays(GL_TRIANGLES) ssaoShader:Deactivate() -- Only unbind texture slots that were actually bound @@ -747,16 +738,16 @@ local function DoDrawSSAO() -- Blur passes: chain FBOs (ssaoFBO -> ssaoBlurFBO -> ssaoFBO -> screen) glTexture(0, ssaoTex) -- swap slot 0 from normtex to SSAO result gaussianBlurShader:Activate() - gaussianBlurShader:SetUniform("dir", 1.0, 0.0) --horizontal blur - glRawBindFBO(ssaoBlurFBO) -- chain from ssaoFBO (reads ssaoTex, safe: ssaoFBO not bound) - texrectFullVAO:DrawArrays(GL_TRIANGLES) + gaussianBlurShader:SetUniform("dir", 1.0, 0.0) --horizontal blur + glRawBindFBO(ssaoBlurFBO) -- chain from ssaoFBO (reads ssaoTex, safe: ssaoFBO not bound) + texrectFullVAO:DrawArrays(GL_TRIANGLES) - glTexture(0, ssaoBlurTex) - gaussianBlurShader:SetUniform("dir", 0.0, 1.0) --vertical blur - glRawBindFBO(ssaoFBO) -- chain from ssaoBlurFBO (reads ssaoBlurTex, safe: ssaoBlurFBO not bound) - texrectFullVAO:DrawArrays(GL_TRIANGLES) + glTexture(0, ssaoBlurTex) + gaussianBlurShader:SetUniform("dir", 0.0, 1.0) --vertical blur + glRawBindFBO(ssaoFBO) -- chain from ssaoBlurFBO (reads ssaoBlurTex, safe: ssaoBlurFBO not bound) + texrectFullVAO:DrawArrays(GL_TRIANGLES) - glTexture(0, ssaoTex) + glTexture(0, ssaoTex) gaussianBlurShader:Deactivate() if shaderConfig.DEBUG_BLUR == 1 then @@ -831,7 +822,9 @@ local function DoDrawSSAO() end function widget:DrawWorldPreParticles(drawAboveWater, drawBelowWater, drawReflection, drawRefraction) - if shaderConfig.ENABLE == 0 then return end + if shaderConfig.ENABLE == 0 then + return + end if drawAboveWater and not drawReflection and not drawRefraction then DoDrawSSAO() end @@ -841,7 +834,7 @@ function widget:GetConfigData(data) return { strength = shaderConfig.SSAO_ALPHA_POW, radius = shaderConfig.SSAO_RADIUS, - preset = preset + preset = preset, } end @@ -853,10 +846,10 @@ function widget:DrawScreen() ssaoShaderCache.updateFlag = nil lastfps = newfps end - local totaldrawus = (1000/newfps) - local lastdelta = (1000/lastfps - 1000/newfps) + local totaldrawus = (1000 / newfps) + local lastdelta = (1000 / lastfps - 1000 / newfps) - gl.Text(string.format("SSAO total %.3f ms delta %.3f ms", totaldrawus, lastdelta), vsx - 600, 20, 16, "do") + gl.Text(string.format("SSAO total %.3f ms delta %.3f ms", totaldrawus, lastdelta), vsx - 600, 20, 16, "do") end end diff --git a/luaui/Widgets/gfx_unit_stencil_gl4.lua b/luaui/Widgets/gfx_unit_stencil_gl4.lua index a00c1d2f2e4..6834f7f22ee 100644 --- a/luaui/Widgets/gfx_unit_stencil_gl4.lua +++ b/luaui/Widgets/gfx_unit_stencil_gl4.lua @@ -2,18 +2,17 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Unit Stencil GL4", - desc = "A fun approach to minimizing the cost of some fun shaders", - author = "Beherith", - date = "2022.03.05", - license = "GNU GPL, v2 or later", - layer = 50, - enabled = true, - depends = {'gl4'}, + name = "Unit Stencil GL4", + desc = "A fun approach to minimizing the cost of some fun shaders", + author = "Beherith", + date = "2022.03.05", + license = "GNU GPL, v2 or later", + layer = 50, + enabled = true, + depends = { "gl4" }, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -47,7 +46,7 @@ local pushElementInstance = InstanceVBOTable.pushElementInstance -- instanced template mesh. Set to false to force-test the fallback. local useGeometryShader = LuaShader.isGeometryShaderSupported -local vsSrc = [[ +local vsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require #extension GL_ARB_shader_storage_buffer_object : require @@ -186,8 +185,7 @@ void main(){ } ]] -local fsSrc = -[[ +local fsSrc = [[ #version 150 compatibility uniform float stencilColor = 1.0; // 1 if we are stenciling @@ -297,17 +295,19 @@ void main() ]] local function goodbye(reason) - spEcho("Unit Stencil GL4 widget exiting with reason: "..reason) + spEcho("Unit Stencil GL4 widget exiting with reason: " .. reason) end local resolution = 4 -local vsx, vsy +local vsx, vsy function widget:ViewResize() - local GL_R8 = 0x8229 - vsx, vsy = Spring.GetViewGeometry() - if unitFeatureStencilTex then gl.DeleteTexture(unitFeatureStencilTex) end - unitFeatureStencilTex = gl.CreateTexture(vsx/resolution, vsy/resolution, { + local GL_R8 = 0x8229 + vsx, vsy = Spring.GetViewGeometry() + if unitFeatureStencilTex then + gl.DeleteTexture(unitFeatureStencilTex) + end + unitFeatureStencilTex = gl.CreateTexture(vsx / resolution, vsy / resolution, { --format = GL.RGBA8, - format = GL_R8, + format = GL_R8, fbo = true, min_filter = GL.NEAREST, mag_filter = GL.NEAREST, @@ -316,13 +316,14 @@ function widget:ViewResize() }) end - -- Builds the static 3-quad (12 vertex) template mesh used by the fallback path local function makeStencilTemplate() local templateVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - templateVBO:Define(12, {{id = 0, name = 'vinfo', size = 1}}) + templateVBO:Define(12, { { id = 0, name = "vinfo", size = 1 } }) local vertexData = {} - for v = 0, 11 do vertexData[#vertexData + 1] = v end + for v = 0, 11 do + vertexData[#vertexData + 1] = v + end templateVBO:Upload(vertexData) local indexData = {} @@ -368,21 +369,17 @@ local function makeStencilVBO(name) -- In the geometry shader path the instance attributes start at location 0; in -- the fallback path location 0 is the template vertex, so they shift up by one. if useGeometryShader then - return InstanceVBOTable.makeInstanceVBOTable( - { - {id = 0, name = 'unitModelMinXYZ', size = 4}, - {id = 1, name = 'unitModelMaxXYZ', size = 4}, - {id = 2, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, - }, - 64, name, 2) + return InstanceVBOTable.makeInstanceVBOTable({ + { id = 0, name = "unitModelMinXYZ", size = 4 }, + { id = 1, name = "unitModelMaxXYZ", size = 4 }, + { id = 2, name = "instData", size = 4, type = GL.UNSIGNED_INT }, + }, 64, name, 2) else - return InstanceVBOTable.makeInstanceVBOTable( - { - {id = 1, name = 'unitModelMinXYZ', size = 4}, - {id = 2, name = 'unitModelMaxXYZ', size = 4}, - {id = 3, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, - }, - 64, name, 3) + return InstanceVBOTable.makeInstanceVBOTable({ + { id = 1, name = "unitModelMinXYZ", size = 4 }, + { id = 2, name = "unitModelMaxXYZ", size = 4 }, + { id = 3, name = "instData", size = 4, type = GL.UNSIGNED_INT }, + }, 64, name, 3) end end @@ -392,48 +389,42 @@ local function InitDrawPrimitiveAtUnit(modifiedShaderConf, DPATname) vsSrcNoGS = vsSrcNoGS:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) gsSrc = gsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - local shaderName = DPATname .. "Shader GL4" - - local DrawPrimitiveAtUnitShader = LuaShader( - { - vertex = vsSrc, - fragment = fsSrc, - geometry = gsSrc, - uniformInt = { - --DrawPrimitiveAtUnitTexture = 0; - }, - uniformFloat = { - addRadius = 1, - stencilColor = 1, - }, - }, - shaderName - ) - - local shaderCompiled = DrawPrimitiveAtUnitShader:Initialize() - useGeometryShader = shaderCompiled - - if not shaderCompiled then - DrawPrimitiveAtUnitShader = LuaShader( - { - vertex = vsSrcNoGS, - fragment = fsSrc, - uniformInt = { - --DrawPrimitiveAtUnitTexture = 0; - }, - uniformFloat = { - addRadius = 1, - stencilColor = 1, - }, - }, - shaderName .. " (NoGS)" - ) - shaderCompiled = DrawPrimitiveAtUnitShader:Initialize() - if not shaderCompiled then - goodbye("Failed to compile ".. DPATname .." GL4 ") - return - end - end + local shaderName = DPATname .. "Shader GL4" + + local DrawPrimitiveAtUnitShader = LuaShader({ + vertex = vsSrc, + fragment = fsSrc, + geometry = gsSrc, + uniformInt = { + --DrawPrimitiveAtUnitTexture = 0; + }, + uniformFloat = { + addRadius = 1, + stencilColor = 1, + }, + }, shaderName) + + local shaderCompiled = DrawPrimitiveAtUnitShader:Initialize() + useGeometryShader = shaderCompiled + + if not shaderCompiled then + DrawPrimitiveAtUnitShader = LuaShader({ + vertex = vsSrcNoGS, + fragment = fsSrc, + uniformInt = { + --DrawPrimitiveAtUnitTexture = 0; + }, + uniformFloat = { + addRadius = 1, + stencilColor = 1, + }, + }, shaderName .. " (NoGS)") + shaderCompiled = DrawPrimitiveAtUnitShader:Initialize() + if not shaderCompiled then + goodbye("Failed to compile " .. DPATname .. " GL4 ") + return + end + end local templateVBO, indexVBO, indexCount if not useGeometryShader then @@ -443,31 +434,44 @@ local function InitDrawPrimitiveAtUnit(modifiedShaderConf, DPATname) unitStencilVBO = makeStencilVBO(DPATname .. "VBO") attachStencilVAO(unitStencilVBO, templateVBO, indexVBO, indexCount) - featureStencilVBO = makeStencilVBO("featurestencil VBO") + featureStencilVBO = makeStencilVBO("featurestencil VBO") attachStencilVAO(featureStencilVBO, templateVBO, indexVBO, indexCount) - featureStencilVBO.featureIDs = true + featureStencilVBO.featureIDs = true return DrawPrimitiveAtUnitShader end function widget:VisibleUnitAdded(unitID, unitDefID) - if unitDimensionsXYZ[unitDefID] == nil then - local unitDef = UnitDefs[unitDefID] - unitDimensionsXYZ[unitDefID] = { - unitDef.model.minx, math.min(0, unitDef.model.miny), unitDef.model.minz, - unitDef.model.maxx, unitDef.model.maxy, unitDef.model.maxz, - } - local dimsXYZ = unitDimensionsXYZ[unitDefID] - --spEcho(dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], dimsXYZ[4], dimsXYZ[5], dimsXYZ[6]) - end - local dimsXYZ = unitDimensionsXYZ[unitDefID] - + if unitDimensionsXYZ[unitDefID] == nil then + local unitDef = UnitDefs[unitDefID] + unitDimensionsXYZ[unitDefID] = { + unitDef.model.minx, + math.min(0, unitDef.model.miny), + unitDef.model.minz, + unitDef.model.maxx, + unitDef.model.maxy, + unitDef.model.maxz, + } + local dimsXYZ = unitDimensionsXYZ[unitDefID] + --spEcho(dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], dimsXYZ[4], dimsXYZ[5], dimsXYZ[6]) + end + local dimsXYZ = unitDimensionsXYZ[unitDefID] + pushElementInstance( unitStencilVBO, -- push into this Instance VBO Table { - dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], 0, - dimsXYZ[4], dimsXYZ[5], dimsXYZ[6], 0, - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + dimsXYZ[1], + dimsXYZ[2], + dimsXYZ[3], + 0, + dimsXYZ[4], + dimsXYZ[5], + dimsXYZ[6], + 0, + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -489,31 +493,48 @@ function widget:VisibleUnitRemoved(unitID) end function widget:FeatureCreated(featureID, allyTeam) - local featureDefID = Spring.GetFeatureDefID(featureID) - --spEcho(featureDefID, featureID) - - if featureDimensionsXYZ[featureDefID] == nil then - local featureDef = FeatureDefs[featureDefID] - if featureDef.model then - local dimsXYZ = { - featureDef.model.minx, featureDef.model.miny, featureDef.model.minz, - featureDef.model.maxx, featureDef.model.maxy, featureDef.model.maxz, - } - if (dimsXYZ[4] - dimsXYZ[1]) < 1 then return end -- goddamned geovents - featureDimensionsXYZ[featureDefID] =dimsXYZ - --spEcho(dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], dimsXYZ[4], dimsXYZ[5], dimsXYZ[6]) - else - return - end - end - local dimsXYZ = featureDimensionsXYZ[featureDefID] - if dimsXYZ == nil then return end + local featureDefID = Spring.GetFeatureDefID(featureID) + --spEcho(featureDefID, featureID) + + if featureDimensionsXYZ[featureDefID] == nil then + local featureDef = FeatureDefs[featureDefID] + if featureDef.model then + local dimsXYZ = { + featureDef.model.minx, + featureDef.model.miny, + featureDef.model.minz, + featureDef.model.maxx, + featureDef.model.maxy, + featureDef.model.maxz, + } + if (dimsXYZ[4] - dimsXYZ[1]) < 1 then + return + end -- goddamned geovents + featureDimensionsXYZ[featureDefID] = dimsXYZ + --spEcho(dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], dimsXYZ[4], dimsXYZ[5], dimsXYZ[6]) + else + return + end + end + local dimsXYZ = featureDimensionsXYZ[featureDefID] + if dimsXYZ == nil then + return + end pushElementInstance( featureStencilVBO, -- push into this Instance VBO Table { - dimsXYZ[1], dimsXYZ[2], dimsXYZ[3], 0, - dimsXYZ[4], dimsXYZ[5], dimsXYZ[6], 0, - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + dimsXYZ[1], + dimsXYZ[2], + dimsXYZ[3], + 0, + dimsXYZ[4], + dimsXYZ[5], + dimsXYZ[6], + 0, + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, featureID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -529,36 +550,36 @@ function widget:FeatureDestroyed(featureID) end local function DrawMe() -- about 0.025 ms - if unitStencilVBO.usedElements > 0 or featureStencilVBO.usedElements > 0 then - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + if unitStencilVBO.usedElements > 0 or featureStencilVBO.usedElements > 0 then + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.Blending(GL.ONE, GL.ZERO) - gl.Culling(false) + gl.Culling(false) unitStencilShader:Activate() unitStencilShader:SetUniform("addRadius", addRadius) - if featureStencilVBO.usedElements > 0 then - unitStencilShader:SetUniform("stencilColor", 0.5) - featureStencilVBO.VAO:DrawArrays(GL.POINTS, featureStencilVBO.usedElements) - end - if unitStencilVBO.usedElements > 0 then - unitStencilShader:SetUniform("stencilColor", 1.0) - unitStencilVBO.VAO:DrawArrays(GL.POINTS, unitStencilVBO.usedElements) - end + if featureStencilVBO.usedElements > 0 then + unitStencilShader:SetUniform("stencilColor", 0.5) + featureStencilVBO.VAO:DrawArrays(GL.POINTS, featureStencilVBO.usedElements) + end + if unitStencilVBO.usedElements > 0 then + unitStencilShader:SetUniform("stencilColor", 1.0) + unitStencilVBO.VAO:DrawArrays(GL.POINTS, unitStencilVBO.usedElements) + end unitStencilShader:Deactivate() gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end end function widget:DrawWorldPreUnit() - --DrawMe() + --DrawMe() end local stencilRequested = false function widget:DrawWorld() - if stencilRequested then - gl.RenderToTexture(unitFeatureStencilTex, DrawMe) - stencilRequested = false - end + if stencilRequested then + gl.RenderToTexture(unitFeatureStencilTex, DrawMe) + stencilRequested = false + end end -- This shows the debug stencil texture @@ -569,36 +590,37 @@ function widget:DrawScreen() gl.Texture(unitFeatureStencilTex) gl.TexRect(0, 0, vsx/resolution, vsy/resolution, 0, 0, 1, 1) end -]]-- +]] +-- local function GetUnitStencilTexture() - stencilRequested = true - return unitFeatureStencilTex + stencilRequested = true + return unitFeatureStencilTex end function widget:Initialize() unitStencilShader = InitDrawPrimitiveAtUnit(shaderConfig, "unitStencils") - widget:ViewResize() + widget:ViewResize() - WG['unitstencilapi'] = {} - WG['unitstencilapi'].GetUnitStencilTexture = GetUnitStencilTexture - WG['unitstencilapi'].members = {ok = "yes", vsSrc = vsSrc, gsSrc = gsSrc, fsSrc = fsSrc, unitStencilVBO = unitStencilVBO, featureStencilVBO = featureStencilVBO} - widgetHandler:RegisterGlobal('GetUnitStencilTexture', WG['unitstencilapi'].GetUnitStencilTexture) + WG["unitstencilapi"] = {} + WG["unitstencilapi"].GetUnitStencilTexture = GetUnitStencilTexture + WG["unitstencilapi"].members = { ok = "yes", vsSrc = vsSrc, gsSrc = gsSrc, fsSrc = fsSrc, unitStencilVBO = unitStencilVBO, featureStencilVBO = featureStencilVBO } + widgetHandler:RegisterGlobal("GetUnitStencilTexture", WG["unitstencilapi"].GetUnitStencilTexture) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID) end - for _, featureID in ipairs(Spring.GetAllFeatures()) do - widget:FeatureCreated(featureID) - end + for _, featureID in ipairs(Spring.GetAllFeatures()) do + widget:FeatureCreated(featureID) + end end end function widget:Shutdown() gl.DeleteTexture(unitFeatureStencilTex) unitFeatureStencilTex = nil - WG['unitstencilapi'] = nil - widgetHandler:DeregisterGlobal('GetUnitStencilTexture') + WG["unitstencilapi"] = nil + widgetHandler:DeregisterGlobal("GetUnitStencilTexture") end diff --git a/luaui/Widgets/gfx_volumetric_clouds.lua b/luaui/Widgets/gfx_volumetric_clouds.lua index 67b9223ae3f..42f7f2b3fba 100644 --- a/luaui/Widgets/gfx_volumetric_clouds.lua +++ b/luaui/Widgets/gfx_volumetric_clouds.lua @@ -1,17 +1,16 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Volumetric Clouds", - version = 6, - desc = "Fog/Dust clouds that scroll with wind along the map's surface. Requires GLSL, expensive even with.", - author = "Anarchid, consulted and optimized by jK", - date = "november 2014", - license = "GNU GPL, v2 or later", - layer = -1, - enabled = false - } + return { + name = "Volumetric Clouds", + version = 6, + desc = "Fog/Dust clouds that scroll with wind along the map's surface. Requires GLSL, expensive even with.", + author = "Anarchid, consulted and optimized by jK", + date = "november 2014", + license = "GNU GPL, v2 or later", + layer = -1, + enabled = false, + } end local enabled = true @@ -28,10 +27,10 @@ local noiseTex3D = "LuaUI/Images/noisetextures/worley_rgbnorm_01_asum_128_v1.dds local CloudDefs = { speed = 0.5, -- multiplier for speed of scrolling with wind --color = {0.46, 0.32, 0.2}, -- diffuse color of the fog - color = {0.6,0.7,0.8}, -- diffuse color of the fog + color = { 0.6, 0.7, 0.8 }, -- diffuse color of the fog -- all altitude values can be either absolute, in percent, or "auto" - height = 4800, -- opacity of fog above and at this altitude will be zero + height = 4800, -- opacity of fog above and at this altitude will be zero bottom = 1200, -- no fog below this altitude fade_alt = 2500, -- fog will linearly fade away between this and "height", should be between height and bottom scale = 700, -- how large will the clouds be @@ -42,7 +41,7 @@ local CloudDefs = { local mapcfg = VFS.Include("mapinfo.lua") if mapcfg and mapcfg.custom and mapcfg.custom.clouds then - for k,v in pairs(mapcfg.custom.clouds) do + for k, v in pairs(mapcfg.custom.clouds) do CloudDefs[k] = v end else @@ -63,22 +62,22 @@ local function convertAltitude(input, default) return result end -CloudDefs.height = convertAltitude(CloudDefs.height, gnd_max*0.9) +CloudDefs.height = convertAltitude(CloudDefs.height, gnd_max * 0.9) CloudDefs.bottom = convertAltitude(CloudDefs.bottom, 0) -CloudDefs.fade_alt = convertAltitude(CloudDefs.fade_alt, gnd_max*0.8) - -local cloudsHeight = CloudDefs.height -local cloudsBottom = CloudDefs.bottom or gnd_min -local cloudsColor = CloudDefs.color -local cloudsScale = CloudDefs.scale -local cloudsClamp = CloudDefs.clamp_to_map or false -local speed = CloudDefs.speed -local opacity = CloudDefs.opacity or 0.3 -local sunPenetration = CloudDefs.sun_penetration or (-40.0) -local fade_alt = CloudDefs.fade_alt -local fr,fg,fb = unpack(cloudsColor) -local sunDir = {0,0,0} -local sunCol = {1,0,0} +CloudDefs.fade_alt = convertAltitude(CloudDefs.fade_alt, gnd_max * 0.8) + +local cloudsHeight = CloudDefs.height +local cloudsBottom = CloudDefs.bottom or gnd_min +local cloudsColor = CloudDefs.color +local cloudsScale = CloudDefs.scale +local cloudsClamp = CloudDefs.clamp_to_map or false +local speed = CloudDefs.speed +local opacity = CloudDefs.opacity or 0.3 +local sunPenetration = CloudDefs.sun_penetration or -40.0 +local fade_alt = CloudDefs.fade_alt +local fr, fg, fb = unpack(cloudsColor) +local sunDir = { 0, 0, 0 } +local sunCol = { 1, 0, 0 } assert(type(sunPenetration) == "number") assert(type(cloudsClamp) == "boolean") @@ -92,24 +91,23 @@ assert(type(fade_alt) == "number") assert(type(cloudsScale) == "number") assert(type(speed) == "number") - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Automatically generated local definitions -local GL_NEAREST = GL.NEAREST +local GL_NEAREST = GL.NEAREST local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA -local glBlending = gl.Blending -local glCopyToTexture = gl.CopyToTexture -local glCreateShader = gl.CreateShader -local glCreateTexture = gl.CreateTexture -local glDeleteTexture = gl.DeleteTexture -local glTexture = gl.Texture -local LuaShader = gl.LuaShader -local spGetCameraPosition = Spring.GetCameraPosition -local spGetWind = Spring.GetWind -local spEcho = Spring.Echo +local GL_SRC_ALPHA = GL.SRC_ALPHA +local glBlending = gl.Blending +local glCopyToTexture = gl.CopyToTexture +local glCreateShader = gl.CreateShader +local glCreateTexture = gl.CreateTexture +local glDeleteTexture = gl.DeleteTexture +local glTexture = gl.Texture +local LuaShader = gl.LuaShader +local spGetCameraPosition = Spring.GetCameraPosition +local spGetWind = Spring.GetWind +local spEcho = Spring.Echo -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -122,8 +120,12 @@ local GL_DEPTH_COMPONENT24 = 0x81A6 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (gnd_min < 0) then gnd_min = 0 end -if (gnd_max < 0) then gnd_max = 0 end +if gnd_min < 0 then + gnd_min = 0 +end +if gnd_max < 0 then + gnd_max = 0 +end local vsx, vsy, vpx, vpy local depthShader @@ -169,7 +171,6 @@ function widget:ViewResize() fbo = true, }) - if depthTexture == nil or fogTexture == nil then spEcho(" Removing fog widget, bad depth texture") widgetHandler:RemoveWidget() @@ -178,7 +179,6 @@ end widget:ViewResize() - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -515,7 +515,7 @@ void main() -------------------------------------------------------------------------------- function widget:GetConfigData() - return {opacityMult = opacityMult} + return { opacityMult = opacityMult } end function widget:SetConfigData(data) @@ -524,19 +524,12 @@ function widget:SetConfigData(data) end end - local function init() - if depthShader then depthShader:Finalize() end - fragSrc = fragSrc:format( - cloudsScale, cloudsHeight, cloudsBottom, - cloudsColor[1], cloudsColor[2], cloudsColor[3], - Game.mapSizeX, Game.mapSizeZ, - fade_alt, opacity*opacityMult, sunPenetration - ) + fragSrc = fragSrc:format(cloudsScale, cloudsHeight, cloudsBottom, cloudsColor[1], cloudsColor[2], cloudsColor[3], Game.mapSizeX, Game.mapSizeZ, fade_alt, opacity * opacityMult, sunPenetration) fragSrc = fragSrc:gsub("###DEPTH_CLIP01###", tostring((Platform.glSupportClipSpaceControl and 1) or 0)) fragSrc = fragSrc:gsub("###CLAMP_TO_MAP###", tostring((cloudsClamp and 1) or 0)) @@ -551,12 +544,12 @@ local function init() tex2 = 2, }, uniformFloat = { - eyePos = {0,0,0}, - viewProjectionInv = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1}, -- will be set later; - offset = {0,0,0}, -- will be set later; - sundir = {0,0,0}, -- will be set later; - suncolor = {0,0,0}, -- will be set later; - time = 0 + eyePos = { 0, 0, 0 }, + viewProjectionInv = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, -- will be set later; + offset = { 0, 0, 0 }, -- will be set later; + sundir = { 0, 0, 0 }, -- will be set later; + suncolor = { 0, 0, 0 }, -- will be set later; + time = 0, }, }, "Volumetric Clouds Depth Shader") @@ -567,14 +560,12 @@ local function init() end end - function widget:Initialize() - - WG['clouds'] = {} - WG['clouds'].getOpacity = function() + WG["clouds"] = {} + WG["clouds"].getOpacity = function() return opacityMult end - WG['clouds'].setOpacity = function(value) + WG["clouds"].setOpacity = function(value) opacityMult = value init() end @@ -596,7 +587,6 @@ function widget:Initialize() end end - function widget:Shutdown() glDeleteTexture(depthTexture) glDeleteTexture(fogTexture) @@ -608,7 +598,6 @@ function widget:Shutdown() glDeleteTexture(noiseTex3D) end - local function renderToTextureFunc() -- render a full screen quad glTexture(0, depthTexture) @@ -628,39 +617,38 @@ local function DrawFogNew() -- setup the shader and its uniform values depthShader:Activate() - -- set uniforms - depthShader:SetUniform("eyePos", spGetCameraPosition()) - depthShader:SetUniform("offset", offsetX, offsetY, offsetZ) + -- set uniforms + depthShader:SetUniform("eyePos", spGetCameraPosition()) + depthShader:SetUniform("offset", offsetX, offsetY, offsetZ) - depthShader:SetUniform("sundir", sunDir[1], sunDir[2], sunDir[3]) - depthShader:SetUniform("suncolor", sunCol[1], sunCol[2], sunCol[3]) + depthShader:SetUniform("sundir", sunDir[1], sunDir[2], sunDir[3]) + depthShader:SetUniform("suncolor", sunCol[1], sunCol[2], sunCol[3]) - depthShader:SetUniform("time", Spring.GetGameSeconds() * speed) + depthShader:SetUniform("time", Spring.GetGameSeconds() * speed) - depthShader:SetUniformMatrix("viewProjectionInv", "viewprojectioninverse") + depthShader:SetUniformMatrix("viewProjectionInv", "viewprojectioninverse") - --glUniformMatrix(uniformViewPrjInv, "viewprojectioninverse") + --glUniformMatrix(uniformViewPrjInv, "viewprojectioninverse") - -- TODO: completely reset the texture before applying shader - -- TODO: figure out why it disappears in some places - -- maybe add a switch to make it high-res direct-render - gl.RenderToTexture(fogTexture, renderToTextureFunc) + -- TODO: completely reset the texture before applying shader + -- TODO: figure out why it disappears in some places + -- maybe add a switch to make it high-res direct-render + gl.RenderToTexture(fogTexture, renderToTextureFunc) depthShader:Deactivate() end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function widget:GameFrame() - local dx,dy,dz = spGetWind() - offsetX = offsetX-dx*speed - offsetY = offsetY-0.25-dy*0.25*speed - offsetZ = offsetZ-dz*speed + local dx, dy, dz = spGetWind() + offsetX = offsetX - dx * speed + offsetY = offsetY - 0.25 - dy * 0.25 * speed + offsetZ = offsetZ - dz * speed - sunDir = {gl.GetSun('pos')} - sunCol = {gl.GetSun('specular')} + sunDir = { gl.GetSun("pos") } + sunCol = { gl.GetSun("specular") } end local function DrawClouds() @@ -669,16 +657,16 @@ local function DrawClouds() gl.PushMatrix() gl.LoadIdentity() - gl.MatrixMode(GL.PROJECTION) - gl.PushMatrix() - gl.LoadIdentity() + gl.MatrixMode(GL.PROJECTION) + gl.PushMatrix() + gl.LoadIdentity() - glTexture(fogTexture) - gl.TexRect(-1, -1, 1, 1, 0, 0, 1, 1) - glTexture(false) + glTexture(fogTexture) + gl.TexRect(-1, -1, 1, 1, 0, 0, 1, 1) + glTexture(false) - gl.MatrixMode(GL.PROJECTION) - gl.PopMatrix() + gl.MatrixMode(GL.PROJECTION) + gl.PopMatrix() gl.MatrixMode(GL.MODELVIEW) gl.PopMatrix() @@ -691,7 +679,8 @@ function widget:DrawScreen() gl.TexRect(0,0,vsx,vsy,0,0,1,1) glTexture(false) end -]]-- +]] +-- function widget:DrawWorld() DrawClouds() diff --git a/luaui/Widgets/gui_advplayerslist.lua b/luaui/Widgets/gui_advplayerslist.lua index bccf8a39c16..fd0bc2d7bc5 100644 --- a/luaui/Widgets/gui_advplayerslist.lua +++ b/luaui/Widgets/gui_advplayerslist.lua @@ -1,19 +1,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "AdvPlayersList", - desc = "List of players and spectators", - author = "Marmoth. (spiced up by Floris)", - date = "2008", - version = 46, - license = "GNU GPL, v2 or later", - layer = -4, - enabled = true, - } + return { + name = "AdvPlayersList", + desc = "List of players and spectators", + author = "Marmoth. (spiced up by Floris)", + date = "2008", + version = 46, + license = "GNU GPL, v2 or later", + layer = -4, + enabled = true, + } end - -- Localized functions for performance local mathCeil = math.ceil local mathFloor = math.floor @@ -74,7 +73,8 @@ local spGetSpectatingState = Spring.GetSpectatingState v44 (Floris): added rendertotexture draw method v45 (Floris): support PvE team ranking leaderboard style v46 (Floris): support alternative (historic) playernames based on accountID's -]]-- +]] +-- -------------------------------------------------------------------------------- -- Config @@ -87,7 +87,7 @@ local pointDuration = 45 local pencilDuration = 5 local drawAlliesLabel = false local alwaysHideSpecs = true -local minWidth = 170 -- for the sake of giving the addons some room +local minWidth = 170 -- for the sake of giving the addons some room local hideDeadAllyTeams = true local absoluteResbarValues = false @@ -147,69 +147,75 @@ local specOffset = 256 -- IMAGES -------------------------------------------------------------------------------- local images = {} -images['imgDir'] = LUAUI_DIRNAME .. "Images/advplayerslist/" -images['imageDirectory'] = ":lc:" .. images['imgDir'] -images['flagsExt'] = '.png' -images['flagHeight'] = 10 +images["imgDir"] = LUAUI_DIRNAME .. "Images/advplayerslist/" +images["imageDirectory"] = ":lc:" .. images["imgDir"] +images["flagsExt"] = ".png" +images["flagHeight"] = 10 local pics = { - currentPic = images['imageDirectory'] .. "indicator.dds", - unitsPic = images['imageDirectory'] .. "units.dds", - energyPic = images['imageDirectory'] .. "energy.dds", - metalPic = images['imageDirectory'] .. "metal.dds", - notFirstPic = images['imageDirectory'] .. "notfirst.dds", - pingPic = images['imageDirectory'] .. "ping.dds", - cpuPic = images['imageDirectory'] .. "cpu.dds", - barPic = images['imageDirectory'] .. "bar.png", - pointPic = images['imageDirectory'] .. "point.dds", - pencilPic = images['imageDirectory'] .. "pencil.dds", - eraserPic = images['imageDirectory'] .. "eraser.dds", - lowPic = images['imageDirectory'] .. "low.dds", - arrowPic = images['imageDirectory'] .. "arrow.dds", - takePic = images['imageDirectory'] .. "take.dds", - indentPic = images['imageDirectory'] .. "indent.png", - cameraPic = images['imageDirectory'] .. "camera.dds", - countryPic = images['imageDirectory'] .. "country.dds", - readyTexture = images['imageDirectory'] .. "indicator.dds", - allyPic = images['imageDirectory'] .. "ally.dds", - unallyPic = images['imageDirectory'] .. "unally.dds", - resourcesPic = images['imageDirectory'] .. "res.png", - resbarPic = images['imageDirectory'] .. "resbar.png", - resbarBgPic = images['imageDirectory'] .. "resbarBg.png", - incomePic = images['imageDirectory'] .. "res.png", - barGlowCenterPic = images['imageDirectory'] .. "barglow-center.png", - barGlowEdgePic = images['imageDirectory'] .. "barglow-edge.png", - - chatPic = images['imageDirectory'] .. "chat.dds", - sidePic = images['imageDirectory'] .. "side.dds", - sharePic = images['imageDirectory'] .. "share.dds", - idPic = images['imageDirectory'] .. "id.dds", - tsPic = images['imageDirectory'] .. "ts.dds", - - rank0 = images['imageDirectory'] .. "ranks/1.png", - rank1 = images['imageDirectory'] .. "ranks/2.png", - rank2 = images['imageDirectory'] .. "ranks/3.png", - rank3 = images['imageDirectory'] .. "ranks/4.png", - rank4 = images['imageDirectory'] .. "ranks/5.png", - rank5 = images['imageDirectory'] .. "ranks/6.png", - rank6 = images['imageDirectory'] .. "ranks/7.png", - rank7 = images['imageDirectory'] .. "ranks/8.png", + currentPic = images["imageDirectory"] .. "indicator.dds", + unitsPic = images["imageDirectory"] .. "units.dds", + energyPic = images["imageDirectory"] .. "energy.dds", + metalPic = images["imageDirectory"] .. "metal.dds", + notFirstPic = images["imageDirectory"] .. "notfirst.dds", + pingPic = images["imageDirectory"] .. "ping.dds", + cpuPic = images["imageDirectory"] .. "cpu.dds", + barPic = images["imageDirectory"] .. "bar.png", + pointPic = images["imageDirectory"] .. "point.dds", + pencilPic = images["imageDirectory"] .. "pencil.dds", + eraserPic = images["imageDirectory"] .. "eraser.dds", + lowPic = images["imageDirectory"] .. "low.dds", + arrowPic = images["imageDirectory"] .. "arrow.dds", + takePic = images["imageDirectory"] .. "take.dds", + indentPic = images["imageDirectory"] .. "indent.png", + cameraPic = images["imageDirectory"] .. "camera.dds", + countryPic = images["imageDirectory"] .. "country.dds", + readyTexture = images["imageDirectory"] .. "indicator.dds", + allyPic = images["imageDirectory"] .. "ally.dds", + unallyPic = images["imageDirectory"] .. "unally.dds", + resourcesPic = images["imageDirectory"] .. "res.png", + resbarPic = images["imageDirectory"] .. "resbar.png", + resbarBgPic = images["imageDirectory"] .. "resbarBg.png", + incomePic = images["imageDirectory"] .. "res.png", + barGlowCenterPic = images["imageDirectory"] .. "barglow-center.png", + barGlowEdgePic = images["imageDirectory"] .. "barglow-edge.png", + + chatPic = images["imageDirectory"] .. "chat.dds", + sidePic = images["imageDirectory"] .. "side.dds", + sharePic = images["imageDirectory"] .. "share.dds", + idPic = images["imageDirectory"] .. "id.dds", + tsPic = images["imageDirectory"] .. "ts.dds", + + rank0 = images["imageDirectory"] .. "ranks/1.png", + rank1 = images["imageDirectory"] .. "ranks/2.png", + rank2 = images["imageDirectory"] .. "ranks/3.png", + rank3 = images["imageDirectory"] .. "ranks/4.png", + rank4 = images["imageDirectory"] .. "ranks/5.png", + rank5 = images["imageDirectory"] .. "ranks/6.png", + rank6 = images["imageDirectory"] .. "ranks/7.png", + rank7 = images["imageDirectory"] .. "ranks/8.png", } local rankPics = { - [0] = pics["rank0"], [1] = pics["rank1"], [2] = pics["rank2"], [3] = pics["rank3"], - [4] = pics["rank4"], [5] = pics["rank5"], [6] = pics["rank6"], [7] = pics["rank7"], + [0] = pics["rank0"], + [1] = pics["rank1"], + [2] = pics["rank2"], + [3] = pics["rank3"], + [4] = pics["rank4"], + [5] = pics["rank5"], + [6] = pics["rank6"], + [7] = pics["rank7"], } -local countryFlagCache = {} -- country code -> texture path or false +local countryFlagCache = {} -- country code -> texture path or false -local sidePics = {} -- loaded in SetSidePics function +local sidePics = {} -- loaded in SetSidePics function local originalColourNames = {} -- loaded in SetOriginalColourNames, format is originalColourNames['name'] = colourString local apiAbsPosition = { 0, 0, 0, 0, 1, 1, false } local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } local sharingTax = Spring.GetModOptions().tax_resource_sharing_amount or 0 if Spring.GetModOptions().easytax then @@ -221,11 +227,11 @@ end -------------------------------------------------------------------------------- local pingLevelData = { - [1] = { r = 0.25, g = 0.82, b = 0.25, cpuThreshold = 0.15, pingThreshold = 0.15 }, - [2] = { r = 0.45, g = 0.75, b = 0.33, cpuThreshold = 0.3, pingThreshold = 0.3 }, - [3] = { r = 0.75, g = 0.75, b = 0.33, cpuThreshold = 0.45, pingThreshold = 0.7 }, - [4] = { r = 0.85, g = 0.33, b = 0.33, cpuThreshold = 0.65, pingThreshold = 1.5 }, - [5] = { r = 1, g = 0.2, b = 0.35, cpuThreshold = math.huge, pingThreshold = math.huge } + [1] = { r = 0.25, g = 0.82, b = 0.25, cpuThreshold = 0.15, pingThreshold = 0.15 }, + [2] = { r = 0.45, g = 0.75, b = 0.33, cpuThreshold = 0.3, pingThreshold = 0.3 }, + [3] = { r = 0.75, g = 0.75, b = 0.33, cpuThreshold = 0.45, pingThreshold = 0.7 }, + [4] = { r = 0.85, g = 0.33, b = 0.33, cpuThreshold = 0.65, pingThreshold = 1.5 }, + [5] = { r = 1, g = 0.2, b = 0.35, cpuThreshold = math.huge, pingThreshold = math.huge }, } -------------------------------------------------------------------------------- @@ -243,12 +249,12 @@ local updateFastRate = 0.15 -- only updates resources local lastTakeMsg = -120 local hoverPlayerlist = false -local updateRateMult = 1 -- goes up when more players auto adjusts in UpdatePlayerResources() -local updateFastRateMult = 1 -- goes up when more players auto adjusts in UpdatePlayerResources() +local updateRateMult = 1 -- goes up when more players auto adjusts in UpdatePlayerResources() +local updateFastRateMult = 1 -- goes up when more players auto adjusts in UpdatePlayerResources() local aliveAllyTeams = {} local populatedAllyTeams = {} -local gameOverWinnerAllyTeams = {} -- allyteam IDs that won; their players keep their display after disconnect +local gameOverWinnerAllyTeams = {} -- allyteam IDs that won; their players keep their display after disconnect local allyTeamMaxStorage = {} local tipTextTime = 0 @@ -256,7 +262,7 @@ local Background, ShareSlider, BackgroundGuishader, tipText, tipTextTitle, drawT local guishaderWasActive = false --local specJoinedOnce, scheduledSpecFullView --local prevClickedPlayer, clickedPlayerTime, clickedPlayerID -local lockPlayerID --leftPosX, lastSliderSound, release +local lockPlayerID --leftPosX, lastSliderSound, release local MainList, MainList2, MainList3, drawListOffset local deadPlayerHeightReduction = 8 @@ -267,7 +273,7 @@ local tookTeamName local tookFrame = -120 local playSounds = true -local sliderdrag = LUAUI_DIRNAME .. 'Sounds/buildbar_rem.wav' +local sliderdrag = LUAUI_DIRNAME .. "Sounds/buildbar_rem.wav" local lastActivity = {} local lastFpsData = {} @@ -276,8 +282,8 @@ local lastSystemData = {} local lastGpuMemData = {} local lastLuaMemData = {} -local activeDrawPlayers = {} -- set of playerIDs with active point/pencil/eraser timers -local accountIDLookup = {} -- accountID -> playerID for fast duplicate detection +local activeDrawPlayers = {} -- set of playerIDs with active point/pencil/eraser timers +local accountIDLookup = {} -- accountID -> playerID for fast duplicate detection -------------------------------------------------------------------------------- -- Players counts and info @@ -312,7 +318,7 @@ local absentName = " --- " -- Persists the last known player name per teamID across GetAllPlayers rebuilds local lastKnownTeamNames = {} -local pendingInitRefresh = false -- triggers one doPlayerUpdate after all widgets have initialized +local pendingInitRefresh = false -- triggers one doPlayerUpdate after all widgets have initialized local gameStarted = false local gameStartRefreshed = spGetGameFrame() > 30 @@ -328,13 +334,13 @@ end -- Button check variable -------------------------------------------------------------------------------- -local energyPlayer -- player to share energy with (nil when no energy sharing) -local metalPlayer -- player to share metal with(nil when no metal sharing) -local shareAmount = 0 -- amount of metal/energy to share/ask -local maxShareAmount -- max amount of metal/energy to share/ask -local sliderPosition -- slider position in metal and energy sharing +local energyPlayer -- player to share energy with (nil when no energy sharing) +local metalPlayer -- player to share metal with(nil when no metal sharing) +local shareAmount = 0 -- amount of metal/energy to share/ask +local maxShareAmount -- max amount of metal/energy to share/ask +local sliderPosition -- slider position in metal and energy sharing local shareSliderHeight = 80 -local sliderOrigin -- position of the cursor before dragging the widget +local sliderOrigin -- position of the cursor before dragging the widget local firstclick = 0 local dblclickPeriod = 0.4 @@ -370,13 +376,13 @@ local teamN local prevClickTime = osClock() -- Cached font scale factors (only depend on vsy, updated in ViewResize) -local fontScaleHigh = 1 -- math.clamp(1+((1-(vsy/1200))*0.75), 1, 1.25) -local fontScaleMed = 1 -- math.clamp(1+((1-(vsy/1200))*0.5), 1, 1.2) -local fontScaleLow = 1 -- math.clamp(1+((1-(vsy/1200))*0.4), 1, 1.15) -local fontScaleSpec = 1 -- math.clamp(1+((1-(vsy/1200))*0.66), 1, 1.33) +local fontScaleHigh = 1 -- math.clamp(1+((1-(vsy/1200))*0.75), 1, 1.25) +local fontScaleMed = 1 -- math.clamp(1+((1-(vsy/1200))*0.5), 1, 1.2) +local fontScaleLow = 1 -- math.clamp(1+((1-(vsy/1200))*0.4), 1, 1.15) +local fontScaleSpec = 1 -- math.clamp(1+((1-(vsy/1200))*0.66), 1, 1.33) local specListShow = true local enemyListShow = true -local enemyListShowUserPref = true -- Stores user preference, separate from auto-disabled state +local enemyListShowUserPref = true -- Stores user preference, separate from auto-disabled state local forceMainListRefresh = true -------------------------------------------------- @@ -392,228 +398,228 @@ local m_point, m_take local position = 1 m_indent = { - name = "indent", - spec = true, --display for specs? - play = true, --display for players? - active = true, --display? (overrides above) - default = true, --display by default? - width = 9, - position = position, - posX = 0, - pic = pics["indentPic"], - noPic = true, + name = "indent", + spec = true, --display for specs? + play = true, --display for players? + active = true, --display? (overrides above) + default = true, --display by default? + width = 9, + position = position, + posX = 0, + pic = pics["indentPic"], + noPic = true, } position = position + 1 m_allyID = { - name = "allyid", - spec = true, - play = true, - active = false, - width = 17, - position = position, - posX = 0, - pic = pics["idPic"], + name = "allyid", + spec = true, + play = true, + active = false, + width = 17, + position = position, + posX = 0, + pic = pics["idPic"], } position = position + 1 m_ID = { - name = "id", - spec = true, - play = true, - active = false, - width = 17, - position = position, - posX = 0, - pic = pics["idPic"], + name = "id", + spec = true, + play = true, + active = false, + width = 17, + position = position, + posX = 0, + pic = pics["idPic"], } position = position + 1 m_playerID = { - name = "playerid", - spec = true, - play = true, - active = false, - width = 17, - position = position, - posX = 0, - pic = pics["idPic"], + name = "playerid", + spec = true, + play = true, + active = false, + width = 17, + position = position, + posX = 0, + pic = pics["idPic"], } position = position + 1 m_rank = { - name = "rank", - spec = true, --display for specs? - play = true, --display for players? - active = true, --display? (overrides above) - default = false, --display by default? - width = 18, - position = position, - posX = 0, - pic = pics["rank6"], + name = "rank", + spec = true, --display for specs? + play = true, --display for players? + active = true, --display? (overrides above) + default = false, --display by default? + width = 18, + position = position, + posX = 0, + pic = pics["rank6"], } position = position + 1 m_country = { - name = "country", - spec = true, - play = true, - active = true, - default = true, - width = 20, - position = position, - posX = 0, - pic = pics["countryPic"], + name = "country", + spec = true, + play = true, + active = true, + default = true, + width = 20, + position = position, + posX = 0, + pic = pics["countryPic"], } position = position + 1 m_side = { - name = "side", - spec = true, - play = true, - active = false, - width = 18, - position = position, - posX = 0, - pic = pics["sidePic"], + name = "side", + spec = true, + play = true, + active = false, + width = 18, + position = position, + posX = 0, + pic = pics["sidePic"], } position = position + 1 m_skill = { - name = "skill", - spec = true, - play = true, - active = false, - width = 18, - position = position, - posX = 0, - pic = pics["tsPic"], + name = "skill", + spec = true, + play = true, + active = false, + width = 18, + position = position, + posX = 0, + pic = pics["tsPic"], } position = position + 1 m_name = { - name = "name", - spec = true, - play = true, - active = true, - alwaysActive = true, - width = 10, - position = position, - posX = 0, - noPic = true, - picGap = 7, + name = "name", + spec = true, + play = true, + active = true, + alwaysActive = true, + width = 10, + position = position, + posX = 0, + noPic = true, + picGap = 7, } position = position + 1 m_cpuping = { - name = "cpuping", - spec = true, - play = true, - active = true, - width = 24, - position = position, - posX = 0, - pic = pics["cpuPic"], + name = "cpuping", + spec = true, + play = true, + active = true, + width = 24, + position = position, + posX = 0, + pic = pics["cpuPic"], } position = position + 1 m_resources = { - name = "resources", - spec = true, - play = true, - active = true, - width = 28, - position = position, - posX = 0, - pic = pics["resourcesPic"], - picGap = 7, + name = "resources", + spec = true, + play = true, + active = true, + width = 28, + position = position, + posX = 0, + pic = pics["resourcesPic"], + picGap = 7, } position = position + 1 m_income = { - name = "income", - spec = true, - play = true, - active = false, - width = 28, - position = position, - posX = 0, - pic = pics["incomePic"], - picGap = 7, + name = "income", + spec = true, + play = true, + active = false, + width = 28, + position = position, + posX = 0, + pic = pics["incomePic"], + picGap = 7, } position = position + 1 m_share = { - name = "share", - spec = false, - play = true, - active = true, - width = 50, - position = position, - posX = 0, - pic = pics["sharePic"], + name = "share", + spec = false, + play = true, + active = true, + width = 50, + position = position, + posX = 0, + pic = pics["sharePic"], } position = position + 1 m_chat = { - name = "chat", - spec = false, - play = true, - active = false, - width = 18, - position = position, - posX = 0, - pic = pics["chatPic"], + name = "chat", + spec = false, + play = true, + active = false, + width = 18, + position = position, + posX = 0, + pic = pics["chatPic"], } position = position + 1 local drawAllyButton = not Spring.GetModOptions().fixedallies m_alliance = { - name = "ally", - spec = false, - play = true, - active = true, - width = 16, - position = position, - posX = 0, - pic = pics["allyPic"], - noPic = false, + name = "ally", + spec = false, + play = true, + active = true, + width = 16, + position = position, + posX = 0, + pic = pics["allyPic"], + noPic = false, } if not drawAllyButton then - m_alliance.width = 0 + m_alliance.width = 0 end position = position + 1 modules = { - m_indent, - m_rank, - m_country, + m_indent, + m_rank, + m_country, m_allyID, - m_ID, - m_playerID, - --m_side, - m_name, - m_skill, - m_resources, - m_income, - m_cpuping, - m_alliance, - m_share, - m_chat, + m_ID, + m_playerID, + --m_side, + m_name, + m_skill, + m_resources, + m_income, + m_cpuping, + m_alliance, + m_share, + m_chat, } m_point = { - active = true, - default = true, + active = true, + default = true, } m_take = { - active = true, - default = true, - pic = pics["takePic"], + active = true, + default = true, + pic = pics["takePic"], } local specsLabelOffset = 0 @@ -623,7 +629,7 @@ local hideShareIcons = false local numTeamsInAllyTeam = #Spring.GetTeamList(myAllyTeamID) if mySpecStatus or numTeamsInAllyTeam <= 1 then - hideShareIcons = true + hideShareIcons = true end local teamRanking = {} @@ -635,131 +641,129 @@ local isPvE = Spring.Utilities.Gametype.IsPvE() --------------------------------------------------------------------------------------------------- function SetModulesPositionX() - m_name.width = SetMaxPlayerNameWidth() - tableSort(modules, function(v1, v2) - return v1.position < v2.position - end) - local pos = 1 - - local sizeMult = playerScale + ((1-playerScale)*0.2) - for _, module in ipairs(modules) do - module.posX = pos - if module.active and (module.name ~= 'share' or not hideShareIcons) then - if (module.name == 'cpuping' and isSinglePlayer) or (module.name == 'resources' and isSingle) or (module.name == 'income' and playerScale < 0.7) then - + m_name.width = SetMaxPlayerNameWidth() + tableSort(modules, function(v1, v2) + return v1.position < v2.position + end) + local pos = 1 + + local sizeMult = playerScale + ((1 - playerScale) * 0.2) + for _, module in ipairs(modules) do + module.posX = pos + if module.active and (module.name ~= "share" or not hideShareIcons) then + if (module.name == "cpuping" and isSinglePlayer) or (module.name == "resources" and isSingle) or (module.name == "income" and playerScale < 0.7) then else if mySpecStatus then if module.spec then - if module.name == 'resources' then - pos = pos + module.width*(1-((1-sizeMult)*0.5)) - else - pos = pos + (module.width*sizeMult) - end + if module.name == "resources" then + pos = pos + module.width * (1 - ((1 - sizeMult) * 0.5)) + else + pos = pos + (module.width * sizeMult) + end end else if module.play then - if module.name == 'resources' then - pos = pos + module.width*(1-((1-sizeMult)*0.5)) - else - pos = pos + (module.width*sizeMult) - end + if module.name == "resources" then + pos = pos + module.width * (1 - ((1 - sizeMult) * 0.5)) + else + pos = pos + (module.width * sizeMult) + end end end end - widgetWidth = pos + 1 - if widgetWidth < 20 then - widgetWidth = 20 - end - updateWidgetScale() - end - end - - if widgetWidth < minWidth then - widgetWidth = minWidth - updateWidgetScale() - end - - if widgetWidth ~= prevWidgetWidth then - prevWidgetWidth = widgetWidth - forceMainListRefresh = true - end + widgetWidth = pos + 1 + if widgetWidth < 20 then + widgetWidth = 20 + end + updateWidgetScale() + end + end + + if widgetWidth < minWidth then + widgetWidth = minWidth + updateWidgetScale() + end + + if widgetWidth ~= prevWidgetWidth then + prevWidgetWidth = widgetWidth + forceMainListRefresh = true + end end function SetMaxPlayerNameWidth() - -- determines the maximal player name width (in order to set the width of the widget) - local t = sp.GetPlayerList() - local maxWidth = 14 * (font2 and font2:GetTextWidth(absentName) or 100) + 8 -- 8 is minimal width - - for _, wplayer in ipairs(t) do - local name, _, spec, teamID = sp.GetPlayerInfo(wplayer, false) - name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(wplayer) or name - if not select(4, sp.GetTeamInfo(teamID, false)) then - -- is not AI? - local nextWidth = (spec and 11 or 14) * (font2 and font2:GetTextWidth(name) or 100) + 10 - if nextWidth > maxWidth then - maxWidth = nextWidth - end - end - end - - local teamList = sp.GetTeamList() - for i = 1, #teamList do - local teamID = teamList[i] - if teamID ~= gaiaTeamID then - local _, _, _, isAiTeam = sp.GetTeamInfo(teamID, false) - if isAiTeam then - local name = GetAIName(teamID) - - local nextWidth = 14 * (font2 and font2:GetTextWidth(name) or 100) + 10 - if nextWidth > maxWidth then - maxWidth = nextWidth - end - end - end - end - - return maxWidth -end + -- determines the maximal player name width (in order to set the width of the widget) + local t = sp.GetPlayerList() + local maxWidth = 14 * (font2 and font2:GetTextWidth(absentName) or 100) + 8 -- 8 is minimal width + + for _, wplayer in ipairs(t) do + local name, _, spec, teamID = sp.GetPlayerInfo(wplayer, false) + name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(wplayer) or name + if not select(4, sp.GetTeamInfo(teamID, false)) then + -- is not AI? + local nextWidth = (spec and 11 or 14) * (font2 and font2:GetTextWidth(name) or 100) + 10 + if nextWidth > maxWidth then + maxWidth = nextWidth + end + end + end + local teamList = sp.GetTeamList() + for i = 1, #teamList do + local teamID = teamList[i] + if teamID ~= gaiaTeamID then + local _, _, _, isAiTeam = sp.GetTeamInfo(teamID, false) + if isAiTeam then + local name = GetAIName(teamID) + + local nextWidth = 14 * (font2 and font2:GetTextWidth(name) or 100) + 10 + if nextWidth > maxWidth then + maxWidth = nextWidth + end + end + end + end + + return maxWidth +end function GeometryChange() - --check if disappeared off the edge of screen - widgetRight = widgetWidth + widgetPosX - if widgetRight > vsx - (backgroundMargin * widgetScale) then - widgetRight = vsx - (backgroundMargin * widgetScale) - widgetPosX = vsx - ((widgetWidth + backgroundMargin) * widgetScale) - widgetRelRight - end + --check if disappeared off the edge of screen + widgetRight = widgetWidth + widgetPosX + if widgetRight > vsx - (backgroundMargin * widgetScale) then + widgetRight = vsx - (backgroundMargin * widgetScale) + widgetPosX = vsx - ((widgetWidth + backgroundMargin) * widgetScale) - widgetRelRight + end end local function UpdateAlliances() - local playerList = sp.GetPlayerList() - -- Pre-filter to only active non-spec players with valid teams - local activePlayers = {} - for _, playerID in ipairs(playerList) do - local p = player[playerID] - if p and not p.spec and p.team ~= nil then - activePlayers[#activePlayers + 1] = playerID - end - end - -- Find cross-allyteam allies with cached lookups - for i = 1, #activePlayers do - local pid = activePlayers[i] - local p = player[pid] - local pAllyteam = p.allyteam - local pTeam = p.team - local alliances = {} - for j = 1, #activePlayers do - if i ~= j then - local p2id = activePlayers[j] - local p2 = player[p2id] - if pAllyteam ~= p2.allyteam and sp.AreTeamsAllied(p2.team, pTeam) then - alliances[#alliances + 1] = p2id - end - end - end - p.alliances = alliances - end + local playerList = sp.GetPlayerList() + -- Pre-filter to only active non-spec players with valid teams + local activePlayers = {} + for _, playerID in ipairs(playerList) do + local p = player[playerID] + if p and not p.spec and p.team ~= nil then + activePlayers[#activePlayers + 1] = playerID + end + end + -- Find cross-allyteam allies with cached lookups + for i = 1, #activePlayers do + local pid = activePlayers[i] + local p = player[pid] + local pAllyteam = p.allyteam + local pTeam = p.team + local alliances = {} + for j = 1, #activePlayers do + if i ~= j then + local p2id = activePlayers[j] + local p2 = player[p2id] + if pAllyteam ~= p2.allyteam and sp.AreTeamsAllied(p2.team, pTeam) then + alliances[#alliances + 1] = p2id + end + end + end + p.alliances = alliances + end end local function UpdateRecentBroadcasters() @@ -775,16 +779,16 @@ local function LockCamera(playerID) return end WG.lockcamera.SetPlayerID(playerID) - lockPlayerID = WG.lockcamera.GetPlayerID() - UpdateRecentBroadcasters() + lockPlayerID = WG.lockcamera.GetPlayerID() + UpdateRecentBroadcasters() end local function GpuMemEvent(playerID, percentage) - lastGpuMemData[playerID] = percentage + lastGpuMemData[playerID] = percentage end local function LuaMemEvent(playerID, um) - lastLuaMemData[playerID] = um + lastLuaMemData[playerID] = um end local function FpsEvent(playerID, fps) @@ -792,7 +796,7 @@ local function FpsEvent(playerID, fps) end local function RankingEvent(ranking) - allyTeamRanking = ranking + allyTeamRanking = ranking SortList() CreateLists() end @@ -802,155 +806,154 @@ local function ApmEvent(teamID, fps) end local function SystemEvent(playerID, system) - local lines, length = 0, 0 - local function helper(line) - lines = lines + 1; - if string.len(line) then - length = string.len(line) - end - return "" - end - helper( system:gsub("(.-)\r?\n", helper) ) - lastSystemData[playerID] = system + local lines, length = 0, 0 + local function helper(line) + lines = lines + 1 + if string.len(line) then + length = string.len(line) + end + return "" + end + helper(system:gsub("(.-)\r?\n", helper)) + lastSystemData[playerID] = system end local function ActivityEvent(playerID) - lastActivity[playerID] = osClock() + lastActivity[playerID] = osClock() end --------------------------------------------------------------------------------------------------- -- Init/GameStart (creating players) --------------------------------------------------------------------------------------------------- - local function doPlayerUpdate() - GetAllPlayers() - SortList() - SetModulesPositionX() - CreateLists() + GetAllPlayers() + SortList() + SetModulesPositionX() + CreateLists() end local function SetOriginalColourNames() - -- Saves the original team colours associated to team teamID - for playerID, _ in pairs(player) do - if player[playerID].name and not player[playerID].spec and playerID < specOffset and player[playerID].team then - local r, g, b = colourNames(player[playerID].team, true) - originalColourNames[playerID] = { r, g, b } - end - end + -- Saves the original team colours associated to team teamID + for playerID, _ in pairs(player) do + if player[playerID].name and not player[playerID].spec and playerID < specOffset and player[playerID].team then + local r, g, b = colourNames(player[playerID].team, true) + originalColourNames[playerID] = { r, g, b } + end + end end function widget:PlayerChanged(playerID) - -- Capture name before doPlayerUpdate rebuilds the player table - local p = player[playerID] - if p and p.team and p.name and p.name ~= absentName and not p.spec then - local _, newActive, newSpec = sp.GetPlayerInfo(playerID, false) - if newSpec or not newActive then - lastKnownTeamNames[p.team] = p.name - end - end - myPlayerID = Spring.GetMyPlayerID() - myAllyTeamID = Spring.GetLocalAllyTeamID() - myTeamID = Spring.GetLocalTeamID() - myTeamPlayerID = select(2, Spring.GetTeamInfo(myTeamID)) - -- UNTESTED: reset original color names for the player, cause they can be wrong depending on the anonymous mode - if anonymousMode and playerID == myPlayerID and not mySpecStatus and spGetSpectatingState() then - SetOriginalColourNames() - end - mySpecStatus, fullView, _ = spGetSpectatingState() - if mySpecStatus then - hideShareIcons = true - end - doPlayerUpdate() + -- Capture name before doPlayerUpdate rebuilds the player table + local p = player[playerID] + if p and p.team and p.name and p.name ~= absentName and not p.spec then + local _, newActive, newSpec = sp.GetPlayerInfo(playerID, false) + if newSpec or not newActive then + lastKnownTeamNames[p.team] = p.name + end + end + myPlayerID = Spring.GetMyPlayerID() + myAllyTeamID = Spring.GetLocalAllyTeamID() + myTeamID = Spring.GetLocalTeamID() + myTeamPlayerID = select(2, Spring.GetTeamInfo(myTeamID)) + -- UNTESTED: reset original color names for the player, cause they can be wrong depending on the anonymous mode + if anonymousMode and playerID == myPlayerID and not mySpecStatus and spGetSpectatingState() then + SetOriginalColourNames() + end + mySpecStatus, fullView, _ = spGetSpectatingState() + if mySpecStatus then + hideShareIcons = true + end + doPlayerUpdate() end function widget:PlayerAdded(playerID) - doPlayerUpdate() + doPlayerUpdate() end function widget:PlayerRemoved(playerID, reason) - doPlayerUpdate() + doPlayerUpdate() end function widget:TeamDied(teamID) - -- Capture name before doPlayerUpdate rebuilds the player table - if not lastKnownTeamNames[teamID] then - for pID = 0, specOffset-1 do - local p = player[pID] - if p and p.team == teamID and p.name and p.name ~= absentName and not p.spec then - lastKnownTeamNames[teamID] = p.name - break - end - end - end - player[teamID + specOffset] = CreatePlayerFromTeam(teamID) - doPlayerUpdate() - -- Explicitly mark real player entries on the dead team as dead. - -- Engine API (GetTeamInfo isDead) may not yet reflect the new state during this callin, - -- so we force the flag after doPlayerUpdate() has rebuilt all entries. - for pID = 0, specOffset-1 do - local p = player[pID] - if p and p.team == teamID and not p.spec then - p.dead = true - end - end - -- Also mark the ghost slot dead immediately so DrawName shows the strikethrough - -- without waiting for the next full update cycle. - if player[teamID + specOffset] then - player[teamID + specOffset].dead = true - end + -- Capture name before doPlayerUpdate rebuilds the player table + if not lastKnownTeamNames[teamID] then + for pID = 0, specOffset - 1 do + local p = player[pID] + if p and p.team == teamID and p.name and p.name ~= absentName and not p.spec then + lastKnownTeamNames[teamID] = p.name + break + end + end + end + player[teamID + specOffset] = CreatePlayerFromTeam(teamID) + doPlayerUpdate() + -- Explicitly mark real player entries on the dead team as dead. + -- Engine API (GetTeamInfo isDead) may not yet reflect the new state during this callin, + -- so we force the flag after doPlayerUpdate() has rebuilt all entries. + for pID = 0, specOffset - 1 do + local p = player[pID] + if p and p.team == teamID and not p.spec then + p.dead = true + end + end + -- Also mark the ghost slot dead immediately so DrawName shows the strikethrough + -- without waiting for the next full update cycle. + if player[teamID + specOffset] then + player[teamID + specOffset].dead = true + end end -- rank players inside each team based on production and damage dealt local function rankTeamPlayers() - local rankingChanged = false - local scores = {} - for _,allyTeamID in ipairs(sp.GetAllyTeamList()) do - local teams = sp.GetTeamList(allyTeamID) - if #teams > 1 then - for _,teamID in ipairs(teams) do - if teamID ~= gaiaTeamID then - if not scores[allyTeamID] then - scores[allyTeamID] = {} - end - local range = sp.GetTeamStatsHistory(teamID) - local history = sp.GetTeamStatsHistory(teamID,range) - if history then - history = history[#history] - scores[allyTeamID][#scores[allyTeamID]+1] = { teamID = teamID, score = mathFloor((history.metalUsed + history.energyUsed/60 + history.damageDealt) / 1000) } - end - end - end - - if scores[allyTeamID] and (mySpecStatus or not hoverPlayerlist or allyTeamID ~= myAllyTeamID) then - tableSort(scores[allyTeamID], function(m1, m2) - return m1.score > m2.score - end) - local ranking = {} - local text = '' - for i, params in ipairs(scores[allyTeamID]) do - ranking[i] = params.teamID - text = text .. params.teamID..', ' - if not teamRanking[allyTeamID] or not teamRanking[allyTeamID][i] or ranking[i] ~= teamRanking[allyTeamID][i] then - rankingChanged = true - end - end - if rankingChanged then - teamRanking[allyTeamID] = ranking - end - end - end - end - if rankingChanged then - WG.teamRanking = teamRanking - SortList() - CreateLists() - end + local rankingChanged = false + local scores = {} + for _, allyTeamID in ipairs(sp.GetAllyTeamList()) do + local teams = sp.GetTeamList(allyTeamID) + if #teams > 1 then + for _, teamID in ipairs(teams) do + if teamID ~= gaiaTeamID then + if not scores[allyTeamID] then + scores[allyTeamID] = {} + end + local range = sp.GetTeamStatsHistory(teamID) + local history = sp.GetTeamStatsHistory(teamID, range) + if history then + history = history[#history] + scores[allyTeamID][#scores[allyTeamID] + 1] = { teamID = teamID, score = mathFloor((history.metalUsed + history.energyUsed / 60 + history.damageDealt) / 1000) } + end + end + end + + if scores[allyTeamID] and (mySpecStatus or not hoverPlayerlist or allyTeamID ~= myAllyTeamID) then + tableSort(scores[allyTeamID], function(m1, m2) + return m1.score > m2.score + end) + local ranking = {} + local text = "" + for i, params in ipairs(scores[allyTeamID]) do + ranking[i] = params.teamID + text = text .. params.teamID .. ", " + if not teamRanking[allyTeamID] or not teamRanking[allyTeamID][i] or ranking[i] ~= teamRanking[allyTeamID][i] then + rankingChanged = true + end + end + if rankingChanged then + teamRanking[allyTeamID] = ranking + end + end + end + end + if rankingChanged then + WG.teamRanking = teamRanking + SortList() + CreateLists() + end end local function speclistCmd(_, _, params) if params[1] then - if params[1] == '1' then + if params[1] == "1" then specListShow = true alwaysHideSpecs = false else @@ -966,31 +969,31 @@ local function speclistCmd(_, _, params) end function widget:ActivityEvent(playerID) - ActivityEvent(playerID) + ActivityEvent(playerID) end function widget:FpsEvent(playerID, fps) - FpsEvent(playerID, fps) + FpsEvent(playerID, fps) end function widget:ApmEvent(teamID, apm) - ApmEvent(teamID, apm) + ApmEvent(teamID, apm) end function widget:GpuMemEvent(playerID, mem) - GpuMemEvent(playerID, mem) + GpuMemEvent(playerID, mem) end function widget:LuaMemEvent(playerID, mem) - LuaMemEvent(playerID, mem) + LuaMemEvent(playerID, mem) end function widget:SystemEvent(playerID, systemData) - SystemEvent(playerID, systemData) + SystemEvent(playerID, systemData) end function widget:RankingEvent(ranking) - RankingEvent(ranking) + RankingEvent(ranking) end function widget:Initialize() @@ -1018,51 +1021,51 @@ function widget:Initialize() InitializePlayers() GetAliveAllyTeams() SortList() - pendingInitRefresh = true -- refresh after other widgets (e.g. playernames) have initialized - SetModulesPositionX() + pendingInitRefresh = true -- refresh after other widgets (e.g. playernames) have initialized + SetModulesPositionX() - -- when PvE: rank players inside each team based on production and damage dealt - if isPvE and not isSinglePlayer then - rankTeamPlayers() - end + -- when PvE: rank players inside each team based on production and damage dealt + if isPvE and not isSinglePlayer then + rankTeamPlayers() + end - WG['advplayerlist_api'] = {} - WG['advplayerlist_api'].GetAlwaysHideSpecs = function() + WG["advplayerlist_api"] = {} + WG["advplayerlist_api"].GetAlwaysHideSpecs = function() return alwaysHideSpecs end - WG['advplayerlist_api'].SetAlwaysHideSpecs = function(value) + WG["advplayerlist_api"].SetAlwaysHideSpecs = function(value) alwaysHideSpecs = value if alwaysHideSpecs and specListShow then specListShow = false - SortList() + SortList() SetModulesPositionX() --why? CreateLists() end end - WG['advplayerlist_api'].GetScale = function() + WG["advplayerlist_api"].GetScale = function() return customScale end - WG['advplayerlist_api'].SetScale = function(value) + WG["advplayerlist_api"].SetScale = function(value) customScale = value updateWidgetScale() end - WG['advplayerlist_api'].GetPosition = function() + WG["advplayerlist_api"].GetPosition = function() return apiAbsPosition end - WG['advplayerlist_api'].GetAbsoluteResbars = function() + WG["advplayerlist_api"].GetAbsoluteResbars = function() return absoluteResbarValues end - WG['advplayerlist_api'].SetAbsoluteResbars = function(value) + WG["advplayerlist_api"].SetAbsoluteResbars = function(value) absoluteResbarValues = value end - WG['advplayerlist_api'].GetModuleActive = function(module) + WG["advplayerlist_api"].GetModuleActive = function(module) return modules[module].active end - WG['advplayerlist_api'].SetModuleActive = function(value) + WG["advplayerlist_api"].SetModuleActive = function(value) for n, module in pairs(modules) do if module.name == value[1] then modules[n].active = value[2] - SortList() + SortList() SetModulesPositionX() CreateLists() break @@ -1070,49 +1073,49 @@ function widget:Initialize() end end - widgetHandler:AddAction("speclist", speclistCmd, nil, 't') + widgetHandler:AddAction("speclist", speclistCmd, nil, "t") end function widget:GameOver(winningAllyTeams) - if isPvE and not isSinglePlayer then - rankTeamPlayers() - end - -- Track winning allyteams so disconnected winners keep their display - gameOverWinnerAllyTeams = {} - for _, allyTeamID in ipairs(winningAllyTeams) do - gameOverWinnerAllyTeams[allyTeamID] = true - end - doPlayerUpdate() -- refresh so winners who leave aren't shown as dead + if isPvE and not isSinglePlayer then + rankTeamPlayers() + end + -- Track winning allyteams so disconnected winners keep their display + gameOverWinnerAllyTeams = {} + for _, allyTeamID in ipairs(winningAllyTeams) do + gameOverWinnerAllyTeams[allyTeamID] = true + end + doPlayerUpdate() -- refresh so winners who leave aren't shown as dead end function widget:GameFrame(n) - if n > 0 then - if not gameStarted then - if mySpecStatus and not alwaysHideSpecs then - specListShow = true - else - specListShow = false - end - - gameStarted = true - SetSidePics() - InitializePlayers() - SortList() - SetOriginalColourNames() - forceMainListRefresh = true - else - -- when PvE: rank players inside each team based on production and damage dealt - if isPvE and not isSinglePlayer and n % 250 == 1 then - rankTeamPlayers() - end - end - end + if n > 0 then + if not gameStarted then + if mySpecStatus and not alwaysHideSpecs then + specListShow = true + else + specListShow = false + end + + gameStarted = true + SetSidePics() + InitializePlayers() + SortList() + SetOriginalColourNames() + forceMainListRefresh = true + else + -- when PvE: rank players inside each team based on production and damage dealt + if isPvE and not isSinglePlayer and n % 250 == 1 then + rankTeamPlayers() + end + end + end end function widget:Shutdown() - if WG['guishader'] then - WG['guishader'].RemoveDlist('advplayerlist') - end + if WG["guishader"] then + WG["guishader"].RemoveDlist("advplayerlist") + end if mainListBgTex then gl.DeleteTexture(mainListBgTex) mainListBgTex = nil @@ -1123,387 +1126,384 @@ function widget:Shutdown() mainListTex = nil mainList2Tex = nil end - WG['advplayerlist_api'] = nil - if ShareSlider then - gl_DeleteList(ShareSlider) - end - if MainList then - gl_DeleteList(MainList) + WG["advplayerlist_api"] = nil + if ShareSlider then + gl_DeleteList(ShareSlider) end - if MainList2 then - gl_DeleteList(MainList2) + if MainList then + gl_DeleteList(MainList) + end + if MainList2 then + gl_DeleteList(MainList2) + end + if MainList3 then + gl_DeleteList(MainList3) + end + if Background then + gl_DeleteList(Background) end - if MainList3 then - gl_DeleteList(MainList3) - end - if Background then - gl_DeleteList(Background) - end widgetHandler:RemoveAction("speclist") end function SetSidePics() - --record readyStates - local playerList = Spring.GetPlayerList() - for _, playerID in pairs(playerList) do - playerReadyState[playerID] = Spring.GetGameRulesParam("player_" .. tostring(playerID) .. "_readyState") - end - - --set factions, from TeamRulesParam when possible and from initial info if not - local teamList = sp.GetTeamList() - for _, team in ipairs(teamList) do - local teamSide - if sp.GetTeamRulesParam(team, 'startUnit') then - local startunit = sp.GetTeamRulesParam(team, 'startUnit') - if startunit == sideDefs.oneDefID then - teamSide = sideDefs.teamOne - end - if startunit == sideDefs.twoDefID then - teamSide = sideDefs.teamTwo - end - if startunit == sideDefs.threeDefID then - teamSide = sideDefs.teamThree - end - else - _, _, _, _, teamSide = sp.GetTeamInfo(team, false) - end - - if teamSide then - sidePics[team] = images['imageDirectory'] .. teamSide .. "_default.png" - else - sidePics[team] = images['imageDirectory'] .. "default.png" - end - end + --record readyStates + local playerList = Spring.GetPlayerList() + for _, playerID in pairs(playerList) do + playerReadyState[playerID] = Spring.GetGameRulesParam("player_" .. tostring(playerID) .. "_readyState") + end + + --set factions, from TeamRulesParam when possible and from initial info if not + local teamList = sp.GetTeamList() + for _, team in ipairs(teamList) do + local teamSide + if sp.GetTeamRulesParam(team, "startUnit") then + local startunit = sp.GetTeamRulesParam(team, "startUnit") + if startunit == sideDefs.oneDefID then + teamSide = sideDefs.teamOne + end + if startunit == sideDefs.twoDefID then + teamSide = sideDefs.teamTwo + end + if startunit == sideDefs.threeDefID then + teamSide = sideDefs.teamThree + end + else + _, _, _, _, teamSide = sp.GetTeamInfo(team, false) + end + + if teamSide then + sidePics[team] = images["imageDirectory"] .. teamSide .. "_default.png" + else + sidePics[team] = images["imageDirectory"] .. "default.png" + end + end end function GetAllPlayers() - local allteams = sp.GetTeamList() - teamN = table.maxn(allteams) - 1 --remove gaia - for i = 0, teamN - 1 do - local teamPlayers = sp.GetPlayerList(i, true) - -- If team is empty, try to find who was on it before rebuilding the ghost - if #teamPlayers == 0 and not lastKnownTeamNames[i] then - -- Try player entries still carrying this team (works right as player leaves) - for pID = 0, specOffset - 1 do - local ep = player[pID] - if ep and ep.team == i and ep.name and ep.name ~= absentName and not ep.spec then - lastKnownTeamNames[i] = ep.name - break - end - end - -- Try via team leader stored in GetTeamInfo (works when player is now a spec) - if not lastKnownTeamNames[i] then - local teamLeaderID = select(2, sp.GetTeamInfo(i, false)) - if teamLeaderID and teamLeaderID >= 0 then - local pName, _, pSpec, pTeam = sp.GetPlayerInfo(teamLeaderID, false) - if pName and not pSpec and pTeam == i then - lastKnownTeamNames[i] = (WG.playernames and WG.playernames.getPlayername) - and WG.playernames.getPlayername(teamLeaderID) or pName - end - end - end - -- Try GetPlayerList including inactive/spec players - if not lastKnownTeamNames[i] then - local allTeamPlayers = sp.GetPlayerList(i, false) - for _, pID in ipairs(allTeamPlayers) do - local pName, _, pSpec, pTeam = sp.GetPlayerInfo(pID, false) - if pName and not pSpec and pTeam == i then - lastKnownTeamNames[i] = (WG.playernames and WG.playernames.getPlayername) - and WG.playernames.getPlayername(pID) or pName - break - end - end - end - end - player[i + specOffset] = CreatePlayerFromTeam(i) - if lastKnownTeamNames[i] then - player[i + specOffset].lastKnownName = lastKnownTeamNames[i] - end - for _, playerID in ipairs(teamPlayers) do - player[playerID] = CreatePlayer(playerID) - end - end - local specPlayers = sp.GetPlayerList(-1, false) or {} - for _, playerID in ipairs(specPlayers) do - local name, active, spec = sp.GetPlayerInfo(playerID, false) - if spec then - if name then - player[playerID] = CreatePlayer(playerID) - end - end - end + local allteams = sp.GetTeamList() + teamN = table.maxn(allteams) - 1 --remove gaia + for i = 0, teamN - 1 do + local teamPlayers = sp.GetPlayerList(i, true) + -- If team is empty, try to find who was on it before rebuilding the ghost + if #teamPlayers == 0 and not lastKnownTeamNames[i] then + -- Try player entries still carrying this team (works right as player leaves) + for pID = 0, specOffset - 1 do + local ep = player[pID] + if ep and ep.team == i and ep.name and ep.name ~= absentName and not ep.spec then + lastKnownTeamNames[i] = ep.name + break + end + end + -- Try via team leader stored in GetTeamInfo (works when player is now a spec) + if not lastKnownTeamNames[i] then + local teamLeaderID = select(2, sp.GetTeamInfo(i, false)) + if teamLeaderID and teamLeaderID >= 0 then + local pName, _, pSpec, pTeam = sp.GetPlayerInfo(teamLeaderID, false) + if pName and not pSpec and pTeam == i then + lastKnownTeamNames[i] = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(teamLeaderID) or pName + end + end + end + -- Try GetPlayerList including inactive/spec players + if not lastKnownTeamNames[i] then + local allTeamPlayers = sp.GetPlayerList(i, false) + for _, pID in ipairs(allTeamPlayers) do + local pName, _, pSpec, pTeam = sp.GetPlayerInfo(pID, false) + if pName and not pSpec and pTeam == i then + lastKnownTeamNames[i] = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(pID) or pName + break + end + end + end + end + player[i + specOffset] = CreatePlayerFromTeam(i) + if lastKnownTeamNames[i] then + player[i + specOffset].lastKnownName = lastKnownTeamNames[i] + end + for _, playerID in ipairs(teamPlayers) do + player[playerID] = CreatePlayer(playerID) + end + end + local specPlayers = sp.GetPlayerList(-1, false) or {} + for _, playerID in ipairs(specPlayers) do + local name, active, spec = sp.GetPlayerInfo(playerID, false) + if spec then + if name then + player[playerID] = CreatePlayer(playerID) + end + end + end end function InitializePlayers() - myPlayerID = sp.GetLocalPlayerID() - myTeamID = sp.GetLocalTeamID() - myAllyTeamID = sp.GetLocalAllyTeamID() - for i = 0, specOffset*2 do - player[i] = {} - end - GetAllPlayers() + myPlayerID = sp.GetLocalPlayerID() + myTeamID = sp.GetLocalTeamID() + myAllyTeamID = sp.GetLocalAllyTeamID() + for i = 0, specOffset * 2 do + player[i] = {} + end + GetAllPlayers() end function GetAliveAllyTeams() - aliveAllyTeams = {} - populatedAllyTeams = {} - local allteams = sp.GetTeamList() - teamN = table.maxn(allteams) - 1 --remove gaia + aliveAllyTeams = {} + populatedAllyTeams = {} + local allteams = sp.GetTeamList() + teamN = table.maxn(allteams) - 1 --remove gaia local gf = spGetGameFrame() - for i = 0, teamN - 1 do - local _, _, isDead, isAI, _, allyTeam = sp.GetTeamInfo(i, false) - if not isDead or gf == 0 then - aliveAllyTeams[allyTeam] = true - if isAI then - populatedAllyTeams[allyTeam] = true - elseif not populatedAllyTeams[allyTeam] then - local teamPlayers = sp.GetPlayerList(i, true) - for _, pID in ipairs(teamPlayers) do - local _, _, pSpec = sp.GetPlayerInfo(pID, false) - if not pSpec then - populatedAllyTeams[allyTeam] = true - break - end - end - end - end - end + for i = 0, teamN - 1 do + local _, _, isDead, isAI, _, allyTeam = sp.GetTeamInfo(i, false) + if not isDead or gf == 0 then + aliveAllyTeams[allyTeam] = true + if isAI then + populatedAllyTeams[allyTeam] = true + elseif not populatedAllyTeams[allyTeam] then + local teamPlayers = sp.GetPlayerList(i, true) + for _, pID in ipairs(teamPlayers) do + local _, _, pSpec = sp.GetPlayerInfo(pID, false) + if not pSpec then + populatedAllyTeams[allyTeam] = true + break + end + end + end + end + end end function round(num, idp) - local mult = 10 ^ (idp or 0) - return mathFloor(num * mult + 0.5) / mult + local mult = 10 ^ (idp or 0) + return mathFloor(num * mult + 0.5) / mult end function GetSkill(playerID) - local customtable = select(11, Spring.GetPlayerInfo(playerID)) - local osMu = customtable.skill - local osSigma = customtable.skilluncertainty - local osSkill = "" - if osMu then - osSkill = osMu and tonumber(osMu:match("-?%d+%.?%d*")) or 0 - osSkill = round(osSkill, 0) - if string.find(osMu, ")", nil, true) then - osSkill = "\255" .. strChar(190) .. strChar(140) .. strChar(140) .. osSkill -- ')' means inferred from lobby rank - else - -- show privacy mode - local priv = "" - if string.find(osMu, "~", nil, true) then - -- '~' means privacy mode is on - priv = "\255" .. strChar(200) .. strChar(200) .. strChar(200) .. "*" - end - - -- show sigma - local tsRed, tsGreen, tsBlue = 222, 222, 222 - if osSigma then - local color = math.clamp(1-((tonumber(osSigma-2) * 0.4)-1), 0.5, 1) - color = mathMax(0.75, color * color) - local color2 = mathMax(0.75, color * color) - tsRed, tsGreen, tsBlue = mathFloor(255 * color), mathFloor(255 * color2), mathFloor(255 * color2) - end - if not osSigma or tonumber(osSigma) > 6.65 then - osSkill = priv .. "\255" .. strChar(tsRed) .. strChar(tsGreen) .. strChar(tsBlue) .. "??" - else - osSkill = priv .. "\255" .. strChar(tsRed) .. strChar(tsGreen) .. strChar(tsBlue) .. osSkill - end - - end - else - osSkill = "\255" .. strChar(160) .. strChar(160) .. strChar(160) .. "?" - end - return osSkill + local customtable = select(11, Spring.GetPlayerInfo(playerID)) + local osMu = customtable.skill + local osSigma = customtable.skilluncertainty + local osSkill = "" + if osMu then + osSkill = osMu and tonumber(osMu:match("-?%d+%.?%d*")) or 0 + osSkill = round(osSkill, 0) + if string.find(osMu, ")", nil, true) then + osSkill = "\255" .. strChar(190) .. strChar(140) .. strChar(140) .. osSkill -- ')' means inferred from lobby rank + else + -- show privacy mode + local priv = "" + if string.find(osMu, "~", nil, true) then + -- '~' means privacy mode is on + priv = "\255" .. strChar(200) .. strChar(200) .. strChar(200) .. "*" + end + + -- show sigma + local tsRed, tsGreen, tsBlue = 222, 222, 222 + if osSigma then + local color = math.clamp(1 - ((tonumber(osSigma - 2) * 0.4) - 1), 0.5, 1) + color = mathMax(0.75, color * color) + local color2 = mathMax(0.75, color * color) + tsRed, tsGreen, tsBlue = mathFloor(255 * color), mathFloor(255 * color2), mathFloor(255 * color2) + end + if not osSigma or tonumber(osSigma) > 6.65 then + osSkill = priv .. "\255" .. strChar(tsRed) .. strChar(tsGreen) .. strChar(tsBlue) .. "??" + else + osSkill = priv .. "\255" .. strChar(tsRed) .. strChar(tsGreen) .. strChar(tsBlue) .. osSkill + end + end + else + osSkill = "\255" .. strChar(160) .. strChar(160) .. strChar(160) .. "?" + end + return osSkill end function CreatePlayer(playerID) - local tname, _, tspec, tteam, tallyteam, tping, tcpu, tcountry, trank, _, accountInfo, desynced = sp.GetPlayerInfo(playerID) - local accountID = nil + local tname, _, tspec, tteam, tallyteam, tping, tcpu, tcountry, trank, _, accountInfo, desynced = sp.GetPlayerInfo(playerID) + local accountID = nil if accountInfo and accountInfo.accountid then accountID = tonumber(accountInfo.accountid) end -- late added spectators dont get a new/unique accountid, instead they get a duplicate of the last playerID one ...so we need to remove it! if accountID then - local existingID = accountIDLookup[accountID] - if existingID ~= nil and existingID ~= playerID then - accountID = nil - else - accountIDLookup[accountID] = playerID - end + local existingID = accountIDLookup[accountID] + if existingID ~= nil and existingID ~= playerID then + accountID = nil + else + accountIDLookup[accountID] = playerID + end end local history = (accountID and WG.playernames) and WG.playernames.getAccountHistory(accountID) or {} local pname = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID) or tname local isAliasName = tname ~= pname tname = pname - local _, _, teamIsDead, _, tside, tallyteam, tincomeMultiplier = sp.GetTeamInfo(tteam, false) - local tred, tgreen, tblue = sp.GetTeamColor(tteam) + local _, _, teamIsDead, _, tside, tallyteam, tincomeMultiplier = sp.GetTeamInfo(tteam, false) + local tred, tgreen, tblue = sp.GetTeamColor(tteam) if (not mySpecStatus) and anonymousMode ~= "disabled" and playerID ~= myPlayerID then tred, tgreen, tblue = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] end - -- skill - local osSkillFormatted = GetSkill(playerID) - - -- cpu/ping - local tpingLvl = GetPingLvl(tping) - local tcpuLvl = GetCpuLvl(tcpu) - tping = tping * 1000 - ((tping * 1000) % 1) - tcpu = tcpu * 100 - ((tcpu * 100) % 1) - - -- resources - local energy, energyStorage, energyIncome, energyShare, metal, metalStorage, metalIncome, metalShare = 0, 1, 0, 0, 1, 0, 0, 0 - if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then - energy, energyStorage, _, energyIncome, _, energyShare = sp.GetTeamResources(tteam, "energy") - metal, metalStorage, _, metalIncome, _, metalShare = sp.GetTeamResources(tteam, "metal") - if energy then - energy = mathFloor(energy) - metal = mathFloor(metal) - if energy < 0 then - energy = 0 - end - if metal < 0 then - metal = 0 - end - else - energy = 0 - metal = 0 - end - end - return { - rank = trank, - skill = osSkillFormatted, - name = pname, + -- skill + local osSkillFormatted = GetSkill(playerID) + + -- cpu/ping + local tpingLvl = GetPingLvl(tping) + local tcpuLvl = GetCpuLvl(tcpu) + tping = tping * 1000 - ((tping * 1000) % 1) + tcpu = tcpu * 100 - ((tcpu * 100) % 1) + + -- resources + local energy, energyStorage, energyIncome, energyShare, metal, metalStorage, metalIncome, metalShare = 0, 1, 0, 0, 1, 0, 0, 0 + if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then + energy, energyStorage, _, energyIncome, _, energyShare = sp.GetTeamResources(tteam, "energy") + metal, metalStorage, _, metalIncome, _, metalShare = sp.GetTeamResources(tteam, "metal") + if energy then + energy = mathFloor(energy) + metal = mathFloor(metal) + if energy < 0 then + energy = 0 + end + if metal < 0 then + metal = 0 + end + else + energy = 0 + metal = 0 + end + end + return { + rank = trank, + skill = osSkillFormatted, + name = pname, orgname = tname, nameIsAlias = isAliasName, - team = tteam, - allyteam = tallyteam, - red = tred, - green = tgreen, - blue = tblue, - dark = Color.IsDark(tred, tgreen, tblue), - side = tside, - pingLvl = tpingLvl, - cpuLvl = tcpuLvl, - ping = tping, - cpu = tcpu, - country = tcountry, - dead = teamIsDead or false, - spec = tspec, - ai = false, - energy = energy, - energyStorage = energyStorage, - energyShare = energyShare, - energyConversion = Spring.GetTeamRulesParam(tteam, 'mmLevel'), - metal = metal, - metalStorage = metalStorage, - metalShare = metalShare, - incomeMultiplier = tincomeMultiplier, + team = tteam, + allyteam = tallyteam, + red = tred, + green = tgreen, + blue = tblue, + dark = Color.IsDark(tred, tgreen, tblue), + side = tside, + pingLvl = tpingLvl, + cpuLvl = tcpuLvl, + ping = tping, + cpu = tcpu, + country = tcountry, + dead = teamIsDead or false, + spec = tspec, + ai = false, + energy = energy, + energyStorage = energyStorage, + energyShare = energyShare, + energyConversion = Spring.GetTeamRulesParam(tteam, "mmLevel"), + metal = metal, + metalStorage = metalStorage, + metalShare = metalShare, + incomeMultiplier = tincomeMultiplier, desynced = desynced, accountID = accountID, - history = history - } + history = history, + } end function GetAIName(teamID) - local _, _, _, name, _, options = sp.GetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) + local _, _, _, name, _, options = sp.GetAIInfo(teamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) - if niceName then - name = niceName + if niceName then + name = niceName - if Spring.Utilities.ShowDevUI() and options.profile then - name = name .. " [" .. options.profile .. "]" - end - end + if Spring.Utilities.ShowDevUI() and options.profile then + name = name .. " [" .. options.profile .. "]" + end + end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return Spring.I18N("ui.playersList.aiName", { name = name }) end function CreatePlayerFromTeam(teamID) - -- for when we don't have a human player occupying the slot, also when a player changes team (dies) - local _, _, isDead, isAI, tside, tallyteam, tincomeMultiplier = sp.GetTeamInfo(teamID, false) - local tred, tgreen, tblue = sp.GetTeamColor(teamID) - if (not mySpecStatus) and anonymousMode ~= "disabled" and teamID ~= myTeamID then - tred, tgreen, tblue = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] - end - local tname, ttotake, tai - local tdead = true - - if isAI then - tname = GetAIName(teamID) - - ttotake = false - tdead = false - tai = true - else - if Spring.GetGameSeconds() < 0.1 then - tname = absentName - ttotake = false - tdead = false - else - ttotake = IsTakeable(teamID) - tdead = isDead -- winning players who leave should not show as dead - end - - tai = false - end - - if tname == nil then - tname = absentName - end - - -- resources - local energy, energyStorage, energyIncome, energyShare, metal, metalStorage, metalIncome, metalShare = 0, 1, 0, 0, 1, 0, 0, 0 - if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then - energy, energyStorage, _, energyIncome, _, energyShare = sp.GetTeamResources(teamID, "energy") - metal, metalStorage, _, metalIncome, _, metalShare = sp.GetTeamResources(teamID, "metal") - energy = mathFloor(energy or 0) - metal = mathFloor(metal or 0) - if energy < 0 then - energy = 0 - end - if metal < 0 then - metal = 0 - end - end - - return { - rank = 8, -- "don't know which" value - skill = "", - name = tname, + -- for when we don't have a human player occupying the slot, also when a player changes team (dies) + local _, _, isDead, isAI, tside, tallyteam, tincomeMultiplier = sp.GetTeamInfo(teamID, false) + local tred, tgreen, tblue = sp.GetTeamColor(teamID) + if (not mySpecStatus) and anonymousMode ~= "disabled" and teamID ~= myTeamID then + tred, tgreen, tblue = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] + end + local tname, ttotake, tai + local tdead = true + + if isAI then + tname = GetAIName(teamID) + + ttotake = false + tdead = false + tai = true + else + if Spring.GetGameSeconds() < 0.1 then + tname = absentName + ttotake = false + tdead = false + else + ttotake = IsTakeable(teamID) + tdead = isDead -- winning players who leave should not show as dead + end + + tai = false + end + + if tname == nil then + tname = absentName + end + + -- resources + local energy, energyStorage, energyIncome, energyShare, metal, metalStorage, metalIncome, metalShare = 0, 1, 0, 0, 1, 0, 0, 0 + if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then + energy, energyStorage, _, energyIncome, _, energyShare = sp.GetTeamResources(teamID, "energy") + metal, metalStorage, _, metalIncome, _, metalShare = sp.GetTeamResources(teamID, "metal") + energy = mathFloor(energy or 0) + metal = mathFloor(metal or 0) + if energy < 0 then + energy = 0 + end + if metal < 0 then + metal = 0 + end + end + + return { + rank = 8, -- "don't know which" value + skill = "", + name = tname, orgname = tname, - team = teamID, - allyteam = tallyteam, - red = tred, - green = tgreen, - blue = tblue, - dark = Color.IsDark(tred, tgreen, tblue), - side = tside, - totake = ttotake, - dead = tdead, - spec = false, - ai = tai, - energy = energy, - energyStorage = energyStorage, - energyShare = energyShare, - energyConversion = Spring.GetTeamRulesParam(teamID, 'mmLevel'), - metal = metal, - metalStorage = metalStorage, - metalShare = metalShare, - incomeMultiplier = tincomeMultiplier, - } + team = teamID, + allyteam = tallyteam, + red = tred, + green = tgreen, + blue = tblue, + dark = Color.IsDark(tred, tgreen, tblue), + side = tside, + totake = ttotake, + dead = tdead, + spec = false, + ai = tai, + energy = energy, + energyStorage = energyStorage, + energyShare = energyShare, + energyConversion = Spring.GetTeamRulesParam(teamID, "mmLevel"), + metal = metal, + metalStorage = metalStorage, + metalShare = metalShare, + incomeMultiplier = tincomeMultiplier, + } end function UpdatePlayerResources() - allyTeamMaxStorage = {} - local energy, energyStorage, energyShare, metal, metalStorage, metalShare = 0, 1, 0, 0, 1, 0 - local energyIncome, metalIncome - local displayedPlayers = 0 - for playerID, _ in pairs(player) do - local p = player[playerID] - if (playerID < specOffset or p.ai) and p.name and not p.spec and p.team then -- maybe not filter out specs cause resigned players can still hold storage + allyTeamMaxStorage = {} + local energy, energyStorage, energyShare, metal, metalStorage, metalShare = 0, 1, 0, 0, 1, 0 + local energyIncome, metalIncome + local displayedPlayers = 0 + for playerID, _ in pairs(player) do + local p = player[playerID] + if (playerID < specOffset or p.ai) and p.name and not p.spec and p.team then -- maybe not filter out specs cause resigned players can still hold storage if aliveAllyTeams[p.allyteam] ~= nil and (mySpecStatus or myAllyTeamID == p.allyteam) then - if (mySpecStatus and enemyListShow) or p.allyteam == myAllyTeamID then -- only keep track when its being displayed - displayedPlayers = displayedPlayers + 1 + if (mySpecStatus and enemyListShow) or p.allyteam == myAllyTeamID then -- only keep track when its being displayed + displayedPlayers = displayedPlayers + 1 energy, energyStorage, _, energyIncome, _, energyShare = sp.GetTeamResources(p.team, "energy") metal, metalStorage, _, metalIncome, _, metalShare = sp.GetTeamResources(p.team, "metal") if energy == nil then @@ -1527,9 +1527,9 @@ function UpdatePlayerResources() p.metalIncome = metalIncome p.metalStorage = metalStorage p.metalShare = metalShare - if not p.spec then - p.energyConversion = Spring.GetTeamRulesParam(p.team, 'mmLevel') - end + if not p.spec then + p.energyConversion = Spring.GetTeamRulesParam(p.team, "mmLevel") + end local pAllyteam = p.allyteam if not allyTeamMaxStorage[pAllyteam] then allyTeamMaxStorage[pAllyteam] = {} @@ -1543,11 +1543,11 @@ function UpdatePlayerResources() end end end - end - end + end + end - updateRateMult = math.clamp(displayedPlayers*0.05, 1, 2) - updateFastRateMult = math.clamp(displayedPlayers*0.07, 1, 3.3) + updateRateMult = math.clamp(displayedPlayers * 0.05, 1, 2) + updateFastRateMult = math.clamp(displayedPlayers * 0.07, 1, 3.3) end --------------------------------------------------------------------------------------------------- @@ -1556,116 +1556,114 @@ end --------------------------------------------------------------------------------------------------- function SortList() - local myOldSpecStatus = mySpecStatus - - mySpecStatus = select(3, sp.GetPlayerInfo(myPlayerID, false)) - - -- checks if a team has died - local teamList - if enemyListShow then - teamList = sp.GetTeamList() - else - teamList = sp.GetTeamList(myAllyTeamID) - end - if mySpecStatus ~= myOldSpecStatus then - if mySpecStatus then - for _, team in ipairs(teamList) do - if not select(3, sp.GetTeamInfo(team, false)) then - -- not dead - Spec(team) - break - end - end - end - end - - myAllyTeamID = sp.GetLocalAllyTeamID() - myTeamID = sp.GetLocalTeamID() - - drawList = {} - drawListOffset = {} - local vOffset = 0 - - - local aliveTeams = 0 - local deadTeams = 0 - for _, teamID in ipairs(teamList) do - local _, _, alive, _, _, allyTeamID = sp.GetTeamInfo(teamID, false) - if aliveAllyTeams[allyTeamID] then - if not alive then - aliveTeams = aliveTeams + 1 - else - deadTeams = deadTeams + 1 - end - end - end - -- hide enemies when there are more than 40 teams on startup - if not initiated and spGetGameFrame() == 0 then - initiated = true - if aliveTeams > 40 then - enemyListShow = false - -- Don't update enemyListShowUserPref - this is auto-disabled, not user choice - end - end - local deadTeamSize = 0.66 - playerScale = mathMin(1, 35 / (aliveTeams+(deadTeams*deadTeamSize))) - if #sp.GetAllyTeamList() > 24 then - playerScale = playerScale - 0.05 - (playerScale * ((#sp.GetAllyTeamList()-2)/200)) -- reduce size some more when mega ffa - end - if playerScale < 0.9 then - playerScale = playerScale - (playerScale * (Spring.GetConfigFloat("ui_scale", 1)-1)) - end - - -- calls the (cascade) sorting for players - vOffset = SortAllyTeams(vOffset) - - -- calls the sortings for specs if see spec is on - vOffset = SortSpecs(vOffset) - - -- set the widget height according to space needed to show team - widgetHeight = vOffset + 3 - if widgetHeight ~= prevWidgetHeight then - prevWidgetHeight = widgetHeight - forceMainListRefresh = true - end - - updateWidgetScale() + local myOldSpecStatus = mySpecStatus + + mySpecStatus = select(3, sp.GetPlayerInfo(myPlayerID, false)) + + -- checks if a team has died + local teamList + if enemyListShow then + teamList = sp.GetTeamList() + else + teamList = sp.GetTeamList(myAllyTeamID) + end + if mySpecStatus ~= myOldSpecStatus then + if mySpecStatus then + for _, team in ipairs(teamList) do + if not select(3, sp.GetTeamInfo(team, false)) then + -- not dead + Spec(team) + break + end + end + end + end + + myAllyTeamID = sp.GetLocalAllyTeamID() + myTeamID = sp.GetLocalTeamID() + + drawList = {} + drawListOffset = {} + local vOffset = 0 + + local aliveTeams = 0 + local deadTeams = 0 + for _, teamID in ipairs(teamList) do + local _, _, alive, _, _, allyTeamID = sp.GetTeamInfo(teamID, false) + if aliveAllyTeams[allyTeamID] then + if not alive then + aliveTeams = aliveTeams + 1 + else + deadTeams = deadTeams + 1 + end + end + end + -- hide enemies when there are more than 40 teams on startup + if not initiated and spGetGameFrame() == 0 then + initiated = true + if aliveTeams > 40 then + enemyListShow = false + -- Don't update enemyListShowUserPref - this is auto-disabled, not user choice + end + end + local deadTeamSize = 0.66 + playerScale = mathMin(1, 35 / (aliveTeams + (deadTeams * deadTeamSize))) + if #sp.GetAllyTeamList() > 24 then + playerScale = playerScale - 0.05 - (playerScale * ((#sp.GetAllyTeamList() - 2) / 200)) -- reduce size some more when mega ffa + end + if playerScale < 0.9 then + playerScale = playerScale - (playerScale * (Spring.GetConfigFloat("ui_scale", 1) - 1)) + end + + -- calls the (cascade) sorting for players + vOffset = SortAllyTeams(vOffset) + + -- calls the sortings for specs if see spec is on + vOffset = SortSpecs(vOffset) + + -- set the widget height according to space needed to show team + widgetHeight = vOffset + 3 + if widgetHeight ~= prevWidgetHeight then + prevWidgetHeight = widgetHeight + forceMainListRefresh = true + end + + updateWidgetScale() end function SortAllyTeams(vOffset) - -- adds ally teams to the draw list (own ally team first) - -- (labels and separators are drawn) - local allyTeamList = sp.GetAllyTeamList() - if allyTeamRanking then - allyTeamList = allyTeamRanking + -- adds ally teams to the draw list (own ally team first) + -- (labels and separators are drawn) + local allyTeamList = sp.GetAllyTeamList() + if allyTeamRanking then + allyTeamList = allyTeamRanking end -- find own ally team vOffset = 12 / 2.66 local ownAllyTeamDrawn = false - if not allyTeamRanking or not enemyListShow then + if not allyTeamRanking or not enemyListShow then local showOwnAlly = not mySpecStatus or (not hideDeadAllyTeams or (aliveAllyTeams[myAllyTeamID] and populatedAllyTeams[myAllyTeamID])) if showOwnAlly then - ownAllyTeamDrawn = true - vOffset = vOffset + (labelOffset*playerScale) - 3 - if teamRanking[myAllyTeamID] then - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = -6 -- leader/scoreboard label - vOffset = SortTeams(myAllyTeamID, vOffset) + 2 -- Add the teams from the allyTeam - elseif drawAlliesLabel then - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = -2 -- "Allies" label - vOffset = SortTeams(myAllyTeamID, vOffset) + 2 -- Add the teams from the allyTeam - else - vOffset = SortTeams(myAllyTeamID, vOffset - (labelOffset*playerScale)) - end + ownAllyTeamDrawn = true + vOffset = vOffset + (labelOffset * playerScale) - 3 + if teamRanking[myAllyTeamID] then + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = -6 -- leader/scoreboard label + vOffset = SortTeams(myAllyTeamID, vOffset) + 2 -- Add the teams from the allyTeam + elseif drawAlliesLabel then + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = -2 -- "Allies" label + vOffset = SortTeams(myAllyTeamID, vOffset) + 2 -- Add the teams from the allyTeam + else + vOffset = SortTeams(myAllyTeamID, vOffset - (labelOffset * playerScale)) + end end end if numberOfEnemies > 0 then - -- "Enemies" label - if not allyTeamRanking or not enemyListShow then + if not allyTeamRanking or not enemyListShow then if ownAllyTeamDrawn then vOffset = vOffset + 13 end @@ -1679,12 +1677,12 @@ function SortAllyTeams(vOffset) -- add the others if enemyListShow or not ownAllyTeamDrawn then local firstenemy = true - for _, allyTeamID in ipairs(allyTeamList) do - if (allyTeamRanking or allyTeamID ~= myAllyTeamID) and (not hideDeadAllyTeams or aliveAllyTeams[allyTeamID]) then + for _, allyTeamID in ipairs(allyTeamList) do + if (allyTeamRanking or allyTeamID ~= myAllyTeamID) and (not hideDeadAllyTeams or aliveAllyTeams[allyTeamID]) then if firstenemy then firstenemy = false else - vOffset = vOffset + (separatorOffset*playerScale) + vOffset = vOffset + (separatorOffset * playerScale) drawListOffset[#drawListOffset + 1] = vOffset drawList[#drawList + 1] = -4 -- Enemy teams separator end @@ -1694,155 +1692,153 @@ function SortAllyTeams(vOffset) end end - return vOffset + return vOffset end function SortTeams(allyTeamID, vOffset) - -- Adds teams to the draw list (own team first) - -- (teams are not visible as such unless they are empty or AI) - local teamsList = sp.GetTeamList(allyTeamID) - if teamRanking[allyTeamID] then - teamsList = teamRanking[allyTeamID] - end - for _, teamID in ipairs(teamsList) do - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = -1 - vOffset = SortPlayers(teamID, allyTeamID, vOffset) -- adds players form the team - end - return vOffset + -- Adds teams to the draw list (own team first) + -- (teams are not visible as such unless they are empty or AI) + local teamsList = sp.GetTeamList(allyTeamID) + if teamRanking[allyTeamID] then + teamsList = teamRanking[allyTeamID] + end + for _, teamID in ipairs(teamsList) do + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = -1 + vOffset = SortPlayers(teamID, allyTeamID, vOffset) -- adds players form the team + end + return vOffset end - function SortPlayers(teamID, allyTeamID, vOffset) - -- Adds players to the draw list (self first) - local playersList = sp.GetPlayerList(teamID, true) - local noPlayer = true - -- When spectating a dead ally team, own section is hidden; don't also filter out - -- the alive teams being shown as fallback enemies -- show them regardless of enemyListShow - local canShow = enemyListShow or (mySpecStatus and not aliveAllyTeams[myAllyTeamID]) - - -- add own player (if not spec) - if myTeamID == teamID then - if player[myPlayerID].name ~= nil then - if mySpecStatus == false then - vOffset = vOffset + (playerOffset*playerScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = myPlayerID -- new player (with ID) - player[myPlayerID].posY = vOffset - noPlayer = false - end - end - end - - -- add other players (if not spec) - for _, playerID in ipairs(playersList) do - if playerID ~= myPlayerID then - if player[playerID].name ~= nil then - if player[playerID].spec ~= true then - if canShow or player[playerID].allyteam == myAllyTeamID then - vOffset = vOffset + (playerOffset*playerScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = playerID -- new player (with ID) - player[playerID].posY = vOffset - noPlayer = false - end - end - end - end - end - - -- add AI teams - if select(4, sp.GetTeamInfo(teamID, false)) then - if canShow or player[specOffset + teamID].allyteam == myAllyTeamID then - -- is AI - vOffset = vOffset + (playerOffset*playerScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = specOffset + teamID -- new AI team (instead of players) - player[specOffset + teamID].posY = vOffset - noPlayer = false - end - end - - -- after game over, keep showing winner players at full height even if they disconnected - if noPlayer and gameOverWinnerAllyTeams[allyTeamID] then - for pID = 0, specOffset - 1 do - local p = player[pID] - if p and p.team == teamID and p.spec ~= true and p.name and p.name ~= absentName then - if canShow or p.allyteam == myAllyTeamID then - vOffset = vOffset + (playerOffset*playerScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = pID - p.posY = vOffset - noPlayer = false - end - end - end - end - - -- add no player token if no player found in this team at this point - if noPlayer then - if canShow or player[specOffset + teamID].allyteam == myAllyTeamID then - vOffset = vOffset + ((playerOffset - deadPlayerHeightReduction)*playerScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = specOffset + teamID -- no players team - player[specOffset + teamID].posY = vOffset - if spGetGameFrame() > 0 then - player[specOffset + teamID].totake = IsTakeable(teamID) - end - end - end - - return vOffset + -- Adds players to the draw list (self first) + local playersList = sp.GetPlayerList(teamID, true) + local noPlayer = true + -- When spectating a dead ally team, own section is hidden; don't also filter out + -- the alive teams being shown as fallback enemies -- show them regardless of enemyListShow + local canShow = enemyListShow or (mySpecStatus and not aliveAllyTeams[myAllyTeamID]) + + -- add own player (if not spec) + if myTeamID == teamID then + if player[myPlayerID].name ~= nil then + if mySpecStatus == false then + vOffset = vOffset + (playerOffset * playerScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = myPlayerID -- new player (with ID) + player[myPlayerID].posY = vOffset + noPlayer = false + end + end + end + + -- add other players (if not spec) + for _, playerID in ipairs(playersList) do + if playerID ~= myPlayerID then + if player[playerID].name ~= nil then + if player[playerID].spec ~= true then + if canShow or player[playerID].allyteam == myAllyTeamID then + vOffset = vOffset + (playerOffset * playerScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = playerID -- new player (with ID) + player[playerID].posY = vOffset + noPlayer = false + end + end + end + end + end + + -- add AI teams + if select(4, sp.GetTeamInfo(teamID, false)) then + if canShow or player[specOffset + teamID].allyteam == myAllyTeamID then + -- is AI + vOffset = vOffset + (playerOffset * playerScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = specOffset + teamID -- new AI team (instead of players) + player[specOffset + teamID].posY = vOffset + noPlayer = false + end + end + + -- after game over, keep showing winner players at full height even if they disconnected + if noPlayer and gameOverWinnerAllyTeams[allyTeamID] then + for pID = 0, specOffset - 1 do + local p = player[pID] + if p and p.team == teamID and p.spec ~= true and p.name and p.name ~= absentName then + if canShow or p.allyteam == myAllyTeamID then + vOffset = vOffset + (playerOffset * playerScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = pID + p.posY = vOffset + noPlayer = false + end + end + end + end + + -- add no player token if no player found in this team at this point + if noPlayer then + if canShow or player[specOffset + teamID].allyteam == myAllyTeamID then + vOffset = vOffset + ((playerOffset - deadPlayerHeightReduction) * playerScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = specOffset + teamID -- no players team + player[specOffset + teamID].posY = vOffset + if spGetGameFrame() > 0 then + player[specOffset + teamID].totake = IsTakeable(teamID) + end + end + end + + return vOffset end function SortSpecs(vOffset) - local playersList = sp.GetPlayerList(-1, true) - -- Single pass: collect active specs and count them - local activeSpecs = {} - for _, playerID in ipairs(playersList) do - local _, active, spec = sp.GetPlayerInfo(playerID, false) - if spec and active then - activeSpecs[#activeSpecs + 1] = playerID - end - end - specScale = math.clamp(45 / #activeSpecs, 0.45, 1) - - -- Adds specs to the draw list - local noSpec = true - for _, playerID in ipairs(activeSpecs) do - if player[playerID] and player[playerID].name ~= nil then - - -- add "Specs" label if first spec - if noSpec then - vOffset = vOffset + ((specVertOffset+1)*specScale) - vOffset = vOffset + labelOffset - (2*specScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = -5 - noSpec = false - specJoinedOnce = true - vOffset = vOffset + 4 - end - - -- add spectator - if specListShow then - vOffset = vOffset + (specVertOffset*specScale) - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = playerID - player[playerID].posY = vOffset - end - end - end - - -- add "Specs" label - if specJoinedOnce and noSpec then - vOffset = vOffset + 13 - vOffset = vOffset + labelOffset - 2 - drawListOffset[#drawListOffset + 1] = vOffset - drawList[#drawList + 1] = -5 - vOffset = vOffset + 4 - end - - return vOffset + local playersList = sp.GetPlayerList(-1, true) + -- Single pass: collect active specs and count them + local activeSpecs = {} + for _, playerID in ipairs(playersList) do + local _, active, spec = sp.GetPlayerInfo(playerID, false) + if spec and active then + activeSpecs[#activeSpecs + 1] = playerID + end + end + specScale = math.clamp(45 / #activeSpecs, 0.45, 1) + + -- Adds specs to the draw list + local noSpec = true + for _, playerID in ipairs(activeSpecs) do + if player[playerID] and player[playerID].name ~= nil then + -- add "Specs" label if first spec + if noSpec then + vOffset = vOffset + ((specVertOffset + 1) * specScale) + vOffset = vOffset + labelOffset - (2 * specScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = -5 + noSpec = false + specJoinedOnce = true + vOffset = vOffset + 4 + end + + -- add spectator + if specListShow then + vOffset = vOffset + (specVertOffset * specScale) + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = playerID + player[playerID].posY = vOffset + end + end + end + + -- add "Specs" label + if specJoinedOnce and noSpec then + vOffset = vOffset + 13 + vOffset = vOffset + labelOffset - 2 + drawListOffset[#drawListOffset + 1] = vOffset + drawList[#drawList + 1] = -5 + vOffset = vOffset + 4 + end + + return vOffset end --------------------------------------------------------------------------------------------------- @@ -1850,15 +1846,15 @@ end --------------------------------------------------------------------------------------------------- function widget:DrawScreen() - if updateMainLists then - doCreateLists(updateMainLists[1], updateMainLists[2], updateMainLists[3]) - updateMainLists = nil - end + if updateMainLists then + doCreateLists(updateMainLists[1], updateMainLists[2], updateMainLists[3]) + updateMainLists = nil + end AdvPlayersListAtlas:RenderTasks() --AdvPlayersListAtlas:DrawToScreen() - -- draw the background element + -- draw the background element if mainListBgTex then gl.R2tHelper.BlendTexRect(mainListBgTex, apiAbsPosition[2], apiAbsPosition[3], apiAbsPosition[4], apiAbsPosition[1], true) end @@ -1873,68 +1869,68 @@ function widget:DrawScreen() -- Push matrix to preserve GL state for other widgets gl.PushMatrix() - -- Draw points/pencils/erasers outside render-to-texture so they extend beyond widget bounds - if m_point.active then - local scaleDiffX = -((widgetPosX * widgetScale) - widgetPosX) / widgetScale - local scaleDiffY = -((widgetPosY * widgetScale) - widgetPosY) / widgetScale - gl.Scale(widgetScale, widgetScale, 0) - gl.Translate(scaleDiffX, scaleDiffY, 0) - for i, drawObject in ipairs(drawList) do - if drawObject >= 0 then - local p = player[drawObject] - if p.pointTime ~= nil or p.pencilTime ~= nil or p.eraserTime ~= nil then - local posY = widgetPosY + widgetHeight - drawListOffset[i] - local isAllyOrSpec = p.allyteam == myAllyTeamID or mySpecStatus - if isAllyOrSpec then - if p.pointTime ~= nil then - DrawPoint(posY, p.pointTime - now) - end - if p.pencilTime ~= nil then - DrawPencil(posY, p.pencilTime - now) - end - if p.eraserTime ~= nil then - DrawEraser(posY, p.eraserTime - now) - end - end - end - end - end - gl_Texture(false) - gl.PopMatrix() - gl.PushMatrix() - end - - local scaleDiffX = -((widgetPosX * widgetScale) - widgetPosX) / widgetScale - local scaleDiffY = -((widgetPosY * widgetScale) - widgetPosY) / widgetScale - gl.Scale(widgetScale, widgetScale, 0) - gl.Translate(scaleDiffX, scaleDiffY, 0) - - if not MainList3 then - CreateMainList(true, true, true) - end - if (MainList or mainListTex) and (MainList2 or mainList2Tex) and MainList3 then - gl_CallList(MainList3) - end - - -- handle/draw hover highlight - local posY - local x, y, b = spGetMouseState() - for _, i in ipairs(drawList) do - if i > -1 then -- and i < specOffset - local p = player[i] - posY = widgetPosY + widgetHeight - (p.posY or 0) - if myTeamID ~= p.team and not p.spec and not p.dead and p.name ~= absentName and IsOnRect(x, y, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset*playerScale)) then - if mySpecStatus or (myAllyTeamID == p.allyteam and not sliderPosition) then - UiSelectHighlight(widgetPosX, posY, widgetPosX + widgetPosX + 2 + 4, posY + (playerOffset*playerScale), nil, b and 0.28 or 0.14) - end - end - end - end - - -- draw share energy/metal sliders - if sliderPosition and ShareSlider then - gl_CallList(ShareSlider) - end + -- Draw points/pencils/erasers outside render-to-texture so they extend beyond widget bounds + if m_point.active then + local scaleDiffX = -((widgetPosX * widgetScale) - widgetPosX) / widgetScale + local scaleDiffY = -((widgetPosY * widgetScale) - widgetPosY) / widgetScale + gl.Scale(widgetScale, widgetScale, 0) + gl.Translate(scaleDiffX, scaleDiffY, 0) + for i, drawObject in ipairs(drawList) do + if drawObject >= 0 then + local p = player[drawObject] + if p.pointTime ~= nil or p.pencilTime ~= nil or p.eraserTime ~= nil then + local posY = widgetPosY + widgetHeight - drawListOffset[i] + local isAllyOrSpec = p.allyteam == myAllyTeamID or mySpecStatus + if isAllyOrSpec then + if p.pointTime ~= nil then + DrawPoint(posY, p.pointTime - now) + end + if p.pencilTime ~= nil then + DrawPencil(posY, p.pencilTime - now) + end + if p.eraserTime ~= nil then + DrawEraser(posY, p.eraserTime - now) + end + end + end + end + end + gl_Texture(false) + gl.PopMatrix() + gl.PushMatrix() + end + + local scaleDiffX = -((widgetPosX * widgetScale) - widgetPosX) / widgetScale + local scaleDiffY = -((widgetPosY * widgetScale) - widgetPosY) / widgetScale + gl.Scale(widgetScale, widgetScale, 0) + gl.Translate(scaleDiffX, scaleDiffY, 0) + + if not MainList3 then + CreateMainList(true, true, true) + end + if (MainList or mainListTex) and (MainList2 or mainList2Tex) and MainList3 then + gl_CallList(MainList3) + end + + -- handle/draw hover highlight + local posY + local x, y, b = spGetMouseState() + for _, i in ipairs(drawList) do + if i > -1 then -- and i < specOffset + local p = player[i] + posY = widgetPosY + widgetHeight - (p.posY or 0) + if myTeamID ~= p.team and not p.spec and not p.dead and p.name ~= absentName and IsOnRect(x, y, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset * playerScale)) then + if mySpecStatus or (myAllyTeamID == p.allyteam and not sliderPosition) then + UiSelectHighlight(widgetPosX, posY, widgetPosX + widgetPosX + 2 + 4, posY + (playerOffset * playerScale), nil, b and 0.28 or 0.14) + end + end + end + end + + -- draw share energy/metal sliders + if sliderPosition and ShareSlider then + gl_CallList(ShareSlider) + end -- Pop matrix to restore GL state for other widgets gl.PopMatrix() @@ -1947,57 +1943,63 @@ end -- old funcion called from wherever but it must run in DrawScreen now so we scedule its execution function CreateLists(onlyMainList, onlyMainList2, onlyMainList3) - if onlyMainList == nil then onlyMainList = true end - if onlyMainList2 == nil then onlyMainList2 = true end - if onlyMainList3 == nil then onlyMainList3 = true end - if updateMainLists then - updateMainLists = {onlyMainList and onlyMainList or updateMainLists[1], onlyMainList2 and onlyMainList2 or updateMainLists[2], onlyMainList3 and onlyMainList3 or updateMainLists[3]} - else - updateMainLists = {onlyMainList, onlyMainList2, onlyMainList3} - end + if onlyMainList == nil then + onlyMainList = true + end + if onlyMainList2 == nil then + onlyMainList2 = true + end + if onlyMainList3 == nil then + onlyMainList3 = true + end + if updateMainLists then + updateMainLists = { onlyMainList and onlyMainList or updateMainLists[1], onlyMainList2 and onlyMainList2 or updateMainLists[2], onlyMainList3 and onlyMainList3 or updateMainLists[3] } + else + updateMainLists = { onlyMainList, onlyMainList2, onlyMainList3 } + end end -- must run in DrawScreen due to function doCreateLists(onlyMainList, onlyMainList2, onlyMainList3) - if not onlyMainList and not onlyMainList2 and not onlyMainList3 then - onlyMainList = true - onlyMainList2 = true - --if m_resources.active or m_income.active then - onlyMainList3 = true - --end - end - if onlyMainList2 then - timeCounter = 0 - end - if onlyMainList3 then - timeFastCounter = 0 - end + if not onlyMainList and not onlyMainList2 and not onlyMainList3 then + onlyMainList = true + onlyMainList2 = true + --if m_resources.active or m_income.active then + onlyMainList3 = true + --end + end + if onlyMainList2 then + timeCounter = 0 + end + if onlyMainList3 then + timeFastCounter = 0 + end CheckTime() --this also calls CheckPlayers - if onlyMainList2 then - if tipTextTime+(updateFastRate*updateFastRateMult) < osClock() then - tipText = nil - tipTextTitle = nil - drawTipText = nil - tipTextTime = 0 - end - UpdateRecentBroadcasters() - UpdateAlliances() - end - if onlyMainList or onlyMainList2 then - GetAliveAllyTeams() - end - if onlyMainList2 or onlyMainList3 then - if m_resources.active or m_income.active then - UpdateResources() - UpdatePlayerResources() - end - end - if onlyMainList then - CreateBackground() - end + if onlyMainList2 then + if tipTextTime + (updateFastRate * updateFastRateMult) < osClock() then + tipText = nil + tipTextTitle = nil + drawTipText = nil + tipTextTime = 0 + end + UpdateRecentBroadcasters() + UpdateAlliances() + end + if onlyMainList or onlyMainList2 then + GetAliveAllyTeams() + end + if onlyMainList2 or onlyMainList3 then + if m_resources.active or m_income.active then + UpdateResources() + UpdatePlayerResources() + end + end + if onlyMainList then + CreateBackground() + end if not mainList2Tex then onlyMainList2 = true end - CreateMainList(onlyMainList, onlyMainList2, onlyMainList3) + CreateMainList(onlyMainList, onlyMainList2, onlyMainList3) end --------------------------------------------------------------------------------------------------- @@ -2005,65 +2007,65 @@ end --------------------------------------------------------------------------------------------------- function CreateBackground() - local margin = backgroundMargin - - local BLcornerX = widgetPosX - margin - local BLcornerY = widgetPosY - margin - local TRcornerX = widgetPosX + widgetWidth + margin - local TRcornerY = widgetPosY + widgetHeight - 1 + margin - - local absLeft = mathFloor(BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale - 1))) - local absBottom = mathFloor(BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale - 1))) - local absRight = mathCeil(TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale - 1))) - local absTop = mathCeil(TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale - 1))) - - local prevApiAbsPosition = apiAbsPosition - if prevApiAbsPosition[1] ~= absTop or prevApiAbsPosition[2] ~= absLeft or prevApiAbsPosition[3] ~= absBottom then - forceMainListRefresh = true - end - if absRight > vsx+margin then -- lazy bugfix needed when playerScale < 1 is in effect - absRight = vsx+margin - end - apiAbsPosition = { absTop, absLeft, absBottom, absRight, widgetScale, right, false } - - local paddingBottom = bgpadding - local paddingRight = bgpadding - local paddingTop = bgpadding - local paddingLeft = bgpadding - if absBottom <= 0.2 then - paddingBottom = 0 - end - if absRight >= vsx - 0.2 then - paddingRight = 0 - end - if absTop <= 0.2 then - paddingTop = 0 - end - if absLeft <= 0.2 then - paddingLeft = 0 - end - - if forceMainListRefresh or not mainListBgTex or (WG['guishader'] and not BackgroundGuishader) then - if WG['guishader'] then - BackgroundGuishader = gl_DeleteList(BackgroundGuishader) - BackgroundGuishader = gl_CreateList(function() - RectRound(absLeft, absBottom, absRight, absTop, elementCorner, mathMin(paddingLeft, paddingTop), mathMin(paddingTop, paddingRight), mathMin(paddingRight, paddingBottom), mathMin(paddingBottom, paddingLeft)) - end) - WG['guishader'].InsertDlist(BackgroundGuishader, 'advplayerlist', true) - end - if mainListTex then - gl.DeleteTexture(mainListTex) - mainListTex = nil - end - if mainList2Tex then - gl.DeleteTexture(mainList2Tex) + local margin = backgroundMargin + + local BLcornerX = widgetPosX - margin + local BLcornerY = widgetPosY - margin + local TRcornerX = widgetPosX + widgetWidth + margin + local TRcornerY = widgetPosY + widgetHeight - 1 + margin + + local absLeft = mathFloor(BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale - 1))) + local absBottom = mathFloor(BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale - 1))) + local absRight = mathCeil(TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale - 1))) + local absTop = mathCeil(TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale - 1))) + + local prevApiAbsPosition = apiAbsPosition + if prevApiAbsPosition[1] ~= absTop or prevApiAbsPosition[2] ~= absLeft or prevApiAbsPosition[3] ~= absBottom then + forceMainListRefresh = true + end + if absRight > vsx + margin then -- lazy bugfix needed when playerScale < 1 is in effect + absRight = vsx + margin + end + apiAbsPosition = { absTop, absLeft, absBottom, absRight, widgetScale, right, false } + + local paddingBottom = bgpadding + local paddingRight = bgpadding + local paddingTop = bgpadding + local paddingLeft = bgpadding + if absBottom <= 0.2 then + paddingBottom = 0 + end + if absRight >= vsx - 0.2 then + paddingRight = 0 + end + if absTop <= 0.2 then + paddingTop = 0 + end + if absLeft <= 0.2 then + paddingLeft = 0 + end + + if forceMainListRefresh or not mainListBgTex or (WG["guishader"] and not BackgroundGuishader) then + if WG["guishader"] then + BackgroundGuishader = gl_DeleteList(BackgroundGuishader) + BackgroundGuishader = gl_CreateList(function() + RectRound(absLeft, absBottom, absRight, absTop, elementCorner, mathMin(paddingLeft, paddingTop), mathMin(paddingTop, paddingRight), mathMin(paddingRight, paddingBottom), mathMin(paddingBottom, paddingLeft)) + end) + WG["guishader"].InsertDlist(BackgroundGuishader, "advplayerlist", true) + end + if mainListTex then + gl.DeleteTexture(mainListTex) + mainListTex = nil + end + if mainList2Tex then + gl.DeleteTexture(mainList2Tex) mainList2Tex = nil end if mainListBgTex then gl.DeleteTexture(mainListBgTex) mainListBgTex = nil end - local width, height = mathFloor(apiAbsPosition[4]-apiAbsPosition[2]), mathFloor(apiAbsPosition[1]-apiAbsPosition[3]) + local width, height = mathFloor(apiAbsPosition[4] - apiAbsPosition[2]), mathFloor(apiAbsPosition[1] - apiAbsPosition[3]) if not mainListBgTex and width > 0 and height > 0 then mainListBgTex = gl.CreateTexture(width, height, { target = GL.TEXTURE_2D, @@ -2076,7 +2078,7 @@ function CreateBackground() UiElement(absLeft, absBottom, absRight, absTop, mathMin(paddingLeft, paddingTop), mathMin(paddingTop, paddingRight), mathMin(paddingRight, paddingBottom), mathMin(paddingBottom, paddingLeft)) end, true) end - end + end end --------------------------------------------------------------------------------------------------- @@ -2084,8 +2086,8 @@ end --------------------------------------------------------------------------------------------------- function UpdateResources() - if sliderPosition then - if energyPlayer ~= nil then + if sliderPosition then + if energyPlayer ~= nil then if energyPlayer.team == myTeamID then local current, storage = sp.GetTeamResources(myTeamID, "energy") maxShareAmount = storage - current @@ -2094,148 +2096,148 @@ function UpdateResources() else maxShareAmount = sp.GetTeamResources(myTeamID, "energy") local energy, energyStorage, _, _, _, shareSliderPos = sp.GetTeamResources(energyPlayer.team, "energy") - maxShareAmount = mathMin(maxShareAmount, ((energyStorage*shareSliderPos) - energy)) - shareAmount = maxShareAmount * sliderPosition / shareSliderHeight - shareAmount = shareAmount - (shareAmount % 1) - end - end - - if metalPlayer ~= nil then - if metalPlayer.team == myTeamID then - local current, storage = sp.GetTeamResources(myTeamID, "metal") - maxShareAmount = storage - current - shareAmount = maxShareAmount * sliderPosition / shareSliderHeight - shareAmount = shareAmount - (shareAmount % 1) - else - maxShareAmount = sp.GetTeamResources(myTeamID, "metal") + maxShareAmount = mathMin(maxShareAmount, ((energyStorage * shareSliderPos) - energy)) + shareAmount = maxShareAmount * sliderPosition / shareSliderHeight + shareAmount = shareAmount - (shareAmount % 1) + end + end + + if metalPlayer ~= nil then + if metalPlayer.team == myTeamID then + local current, storage = sp.GetTeamResources(myTeamID, "metal") + maxShareAmount = storage - current + shareAmount = maxShareAmount * sliderPosition / shareSliderHeight + shareAmount = shareAmount - (shareAmount % 1) + else + maxShareAmount = sp.GetTeamResources(myTeamID, "metal") local metal, metalStorage, _, _, _, shareSliderPos = sp.GetTeamResources(metalPlayer.team, "metal") - maxShareAmount = mathMin(maxShareAmount, ((metalStorage*shareSliderPos) - metal)) - shareAmount = maxShareAmount * sliderPosition / shareSliderHeight - shareAmount = shareAmount - (shareAmount % 1) - end - end - end + maxShareAmount = mathMin(maxShareAmount, ((metalStorage * shareSliderPos) - metal)) + shareAmount = maxShareAmount * sliderPosition / shareSliderHeight + shareAmount = shareAmount - (shareAmount % 1) + end + end + end end function CheckTime() - local period = 0.5 - now = osClock() - if now > (lastTime + period) then - lastTime = now - CheckPlayersChange() - blink = not blink - for playerID in pairs(activeDrawPlayers) do - local p = player[playerID] - if p then - local stillActive = false - if p.pointTime ~= nil then - if p.pointTime <= now then - p.pointX = nil - p.pointY = nil - p.pointZ = nil - p.pointTime = nil - else - stillActive = true - end - end - if p.pencilTime ~= nil then - if p.pencilTime <= now then - p.pencilTime = nil - else - stillActive = true - end - end - if p.eraserTime ~= nil then - if p.eraserTime <= now then - p.eraserTime = nil - else - stillActive = true - end - end - if not stillActive then - activeDrawPlayers[playerID] = nil - end - else - activeDrawPlayers[playerID] = nil - end - end - end + local period = 0.5 + now = osClock() + if now > (lastTime + period) then + lastTime = now + CheckPlayersChange() + blink = not blink + for playerID in pairs(activeDrawPlayers) do + local p = player[playerID] + if p then + local stillActive = false + if p.pointTime ~= nil then + if p.pointTime <= now then + p.pointX = nil + p.pointY = nil + p.pointZ = nil + p.pointTime = nil + else + stillActive = true + end + end + if p.pencilTime ~= nil then + if p.pencilTime <= now then + p.pencilTime = nil + else + stillActive = true + end + end + if p.eraserTime ~= nil then + if p.eraserTime <= now then + p.eraserTime = nil + else + stillActive = true + end + end + if not stillActive then + activeDrawPlayers[playerID] = nil + end + else + activeDrawPlayers[playerID] = nil + end + end + end end function drawMainList() - local leader - leaderboardOffset = nil - for i, drawObject in ipairs(drawList) do - if drawObject == -5 then - specsLabelOffset = drawListOffset[i] - local specAmount = numberOfSpecs - if numberOfSpecs == 0 or (specListShow and numberOfSpecs < 10) then - specAmount = "" - end - DrawLabel(" ".. Spring.I18N('ui.playersList.spectators', { amount = specAmount }), drawListOffset[i], specListShow) - if spGetGameFrame() <= 0 then - if specListShow then - DrawLabelTip( Spring.I18N('ui.playersList.hideSpecs'), drawListOffset[i], 95) - else - DrawLabelTip(Spring.I18N('ui.playersList.showSpecs'), drawListOffset[i], 95) - end - end - elseif drawObject == -4 then -- enemy teams separator - if enemyListShow then - DrawSeparator(drawListOffset[i]) - end - elseif drawObject == -3 then - if numberOfEnemies > 0 then - enemyLabelOffset = drawListOffset[i] - local enemyAmount = numberOfEnemies - if numberOfEnemies == 0 or enemyListShow then - enemyAmount = "" - end - if allyTeamRanking and enemyListShow then - DrawLabel(" "..Spring.I18N('ui.playersList.leaderboard'), drawListOffset[i], true) - leaderboardOffset = drawListOffset[i] - else - DrawLabel(" "..Spring.I18N('ui.playersList.enemies', { amount = enemyAmount }), drawListOffset[i], true) - end - if spGetGameFrame() <= 0 then - if enemyListShow then - DrawLabelTip( Spring.I18N('ui.playersList.hideEnemies'), drawListOffset[i], 95) - else - DrawLabelTip(Spring.I18N('ui.playersList.showEnemies'), drawListOffset[i], 95) - end - end - end - elseif drawObject == -6 then - DrawLabel(" "..Spring.I18N('ui.playersList.scoreboard'), drawListOffset[i], true) - leaderboardOffset = drawListOffset[i] - elseif drawObject == -2 then - DrawLabel(" " .. Spring.I18N('ui.playersList.allies'), drawListOffset[i], true) - if spGetGameFrame() <= 0 then - DrawLabelTip(Spring.I18N('ui.playersList.trackPlayer'), drawListOffset[i], 46) - end - elseif drawObject == -1 then - leader = true - else - if not mouseX then - mouseX, mouseY = sp.GetMouseState() - end - DrawPlayer(drawObject, leader, drawListOffset[i], mouseX, mouseY, true, false, false) - end - - -- draw player tooltip later so they will be on top of players drawn below - if tipText ~= nil then - drawTipText = tipText - end - end - - if drawTipText ~= nil then - tipText = drawTipText - tipTextTime = osClock() - end + local leader + leaderboardOffset = nil + for i, drawObject in ipairs(drawList) do + if drawObject == -5 then + specsLabelOffset = drawListOffset[i] + local specAmount = numberOfSpecs + if numberOfSpecs == 0 or (specListShow and numberOfSpecs < 10) then + specAmount = "" + end + DrawLabel(" " .. Spring.I18N("ui.playersList.spectators", { amount = specAmount }), drawListOffset[i], specListShow) + if spGetGameFrame() <= 0 then + if specListShow then + DrawLabelTip(Spring.I18N("ui.playersList.hideSpecs"), drawListOffset[i], 95) + else + DrawLabelTip(Spring.I18N("ui.playersList.showSpecs"), drawListOffset[i], 95) + end + end + elseif drawObject == -4 then -- enemy teams separator + if enemyListShow then + DrawSeparator(drawListOffset[i]) + end + elseif drawObject == -3 then + if numberOfEnemies > 0 then + enemyLabelOffset = drawListOffset[i] + local enemyAmount = numberOfEnemies + if numberOfEnemies == 0 or enemyListShow then + enemyAmount = "" + end + if allyTeamRanking and enemyListShow then + DrawLabel(" " .. Spring.I18N("ui.playersList.leaderboard"), drawListOffset[i], true) + leaderboardOffset = drawListOffset[i] + else + DrawLabel(" " .. Spring.I18N("ui.playersList.enemies", { amount = enemyAmount }), drawListOffset[i], true) + end + if spGetGameFrame() <= 0 then + if enemyListShow then + DrawLabelTip(Spring.I18N("ui.playersList.hideEnemies"), drawListOffset[i], 95) + else + DrawLabelTip(Spring.I18N("ui.playersList.showEnemies"), drawListOffset[i], 95) + end + end + end + elseif drawObject == -6 then + DrawLabel(" " .. Spring.I18N("ui.playersList.scoreboard"), drawListOffset[i], true) + leaderboardOffset = drawListOffset[i] + elseif drawObject == -2 then + DrawLabel(" " .. Spring.I18N("ui.playersList.allies"), drawListOffset[i], true) + if spGetGameFrame() <= 0 then + DrawLabelTip(Spring.I18N("ui.playersList.trackPlayer"), drawListOffset[i], 46) + end + elseif drawObject == -1 then + leader = true + else + if not mouseX then + mouseX, mouseY = sp.GetMouseState() + end + DrawPlayer(drawObject, leader, drawListOffset[i], mouseX, mouseY, true, false, false) + end + + -- draw player tooltip later so they will be on top of players drawn below + if tipText ~= nil then + drawTipText = tipText + end + end + + if drawTipText ~= nil then + tipText = drawTipText + tipTextTime = osClock() + end end function drawMainList2() - local mouseX, mouseY = sp.GetMouseState() + local mouseX, mouseY = sp.GetMouseState() local leader for i, drawObject in ipairs(drawList) do if drawObject == -1 then @@ -2247,211 +2249,207 @@ function drawMainList2() end function CreateMainList(onlyMainList, onlyMainList2, onlyMainList3) - forceMainListRefresh = false - - local mouseX, mouseY = sp.GetMouseState() - - local prevNumberOfSpecs = numberOfSpecs - local prevNumberOfEnemies = numberOfEnemies - numberOfSpecs = 0 - numberOfEnemies = 0 - local active, spec - local playerList = sp.GetPlayerList() - for _, playerID in ipairs(playerList) do - _, active, spec = sp.GetPlayerInfo(playerID, false) - if active and spec then - numberOfSpecs = numberOfSpecs + 1 - end - end - local playerID, isAiTeam, allyTeamID - local teamList = sp.GetTeamList() - for i = 1, #teamList do - local teamID = teamList[i] - if teamID ~= gaiaTeamID then - _, playerID, _, isAiTeam, _, allyTeamID = sp.GetTeamInfo(teamID, false) - if aliveAllyTeams[allyTeamID] then - _, active = sp.GetPlayerInfo(playerID, false) - if active or isAiTeam then - if allyTeamID ~= myAllyTeamID then - numberOfEnemies = numberOfEnemies + 1 - end - end - end - end - end - if prevNumberOfSpecs ~= numberOfSpecs or prevNumberOfEnemies ~= numberOfEnemies then - prevNumberOfSpecs = numberOfSpecs - prevNumberOfEnemies = numberOfEnemies - forceMainListRefresh = true - end - if onlyMainList then - if not mainListTex then - local width, height = mathFloor(apiAbsPosition[4]-apiAbsPosition[2]), mathFloor(apiAbsPosition[1]-apiAbsPosition[3]) + forceMainListRefresh = false + + local mouseX, mouseY = sp.GetMouseState() + + local prevNumberOfSpecs = numberOfSpecs + local prevNumberOfEnemies = numberOfEnemies + numberOfSpecs = 0 + numberOfEnemies = 0 + local active, spec + local playerList = sp.GetPlayerList() + for _, playerID in ipairs(playerList) do + _, active, spec = sp.GetPlayerInfo(playerID, false) + if active and spec then + numberOfSpecs = numberOfSpecs + 1 + end + end + local playerID, isAiTeam, allyTeamID + local teamList = sp.GetTeamList() + for i = 1, #teamList do + local teamID = teamList[i] + if teamID ~= gaiaTeamID then + _, playerID, _, isAiTeam, _, allyTeamID = sp.GetTeamInfo(teamID, false) + if aliveAllyTeams[allyTeamID] then + _, active = sp.GetPlayerInfo(playerID, false) + if active or isAiTeam then + if allyTeamID ~= myAllyTeamID then + numberOfEnemies = numberOfEnemies + 1 + end + end + end + end + end + if prevNumberOfSpecs ~= numberOfSpecs or prevNumberOfEnemies ~= numberOfEnemies then + prevNumberOfSpecs = numberOfSpecs + prevNumberOfEnemies = numberOfEnemies + forceMainListRefresh = true + end + if onlyMainList then + if not mainListTex then + local width, height = mathFloor(apiAbsPosition[4] - apiAbsPosition[2]), mathFloor(apiAbsPosition[1] - apiAbsPosition[3]) if width > 0 and height > 0 then - mainListTex = gl.CreateTexture(width, height, { --*(vsy<1400 and 2 or 1) + mainListTex = gl.CreateTexture(width, height, { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end - end - if mainListTex then - gl.R2tHelper.RenderToTexture(mainListTex, function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / (apiAbsPosition[4]-apiAbsPosition[2]), 2 / (apiAbsPosition[1]-apiAbsPosition[3]), 0) - gl.Scale(widgetScale, widgetScale, 0) - local scaleMult = 1 + ((widgetScale-1) * 3.5) -- dont ask me why but this seems to come closest approximately - gl.Translate(-apiAbsPosition[2]-(backgroundMargin*0.25*scaleMult), -apiAbsPosition[3]-(backgroundMargin*0.25*scaleMult), 0) - drawMainList() - end, true) - end - end - - if onlyMainList2 then - if not mainList2Tex then - local width, height = mathFloor(apiAbsPosition[4]-apiAbsPosition[2]), mathFloor(apiAbsPosition[1]-apiAbsPosition[3]) + end + if mainListTex then + gl.R2tHelper.RenderToTexture(mainListTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / (apiAbsPosition[4] - apiAbsPosition[2]), 2 / (apiAbsPosition[1] - apiAbsPosition[3]), 0) + gl.Scale(widgetScale, widgetScale, 0) + local scaleMult = 1 + ((widgetScale - 1) * 3.5) -- dont ask me why but this seems to come closest approximately + gl.Translate(-apiAbsPosition[2] - (backgroundMargin * 0.25 * scaleMult), -apiAbsPosition[3] - (backgroundMargin * 0.25 * scaleMult), 0) + drawMainList() + end, true) + end + end + + if onlyMainList2 then + if not mainList2Tex then + local width, height = mathFloor(apiAbsPosition[4] - apiAbsPosition[2]), mathFloor(apiAbsPosition[1] - apiAbsPosition[3]) if width > 0 and height > 0 then - mainList2Tex = gl.CreateTexture(width, height, { --*(vsy<1400 and 2 or 1) + mainList2Tex = gl.CreateTexture(width, height, { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end - end - if mainList2Tex then - gl.R2tHelper.RenderToTexture(mainList2Tex, function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / (apiAbsPosition[4]-apiAbsPosition[2]), 2 / (apiAbsPosition[1]-apiAbsPosition[3]), 0) - gl.Scale(widgetScale, widgetScale, 0) - local scaleMult = 1 + ((widgetScale-1) * 3.5) -- dont ask me why but this seems to come closest approximately - gl.Translate(-apiAbsPosition[2]-(backgroundMargin*0.25*scaleMult), -apiAbsPosition[3]-(backgroundMargin*0.25*scaleMult), 0) - drawMainList2() - end, true) - end - end - - if onlyMainList3 then - if MainList3 then - MainList3 = gl_DeleteList(MainList3) - end - MainList3 = gl_CreateList(function() - local leader - for i, drawObject in ipairs(drawList) do - if drawObject == -1 then - leader = true - elseif drawObject >= 0 then - if not player[drawObject].spec then -- specs have no resources - DrawPlayer(drawObject, leader, drawListOffset[i], mouseX, mouseY, false, false, true) - end - end - end - end) - end + end + if mainList2Tex then + gl.R2tHelper.RenderToTexture(mainList2Tex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / (apiAbsPosition[4] - apiAbsPosition[2]), 2 / (apiAbsPosition[1] - apiAbsPosition[3]), 0) + gl.Scale(widgetScale, widgetScale, 0) + local scaleMult = 1 + ((widgetScale - 1) * 3.5) -- dont ask me why but this seems to come closest approximately + gl.Translate(-apiAbsPosition[2] - (backgroundMargin * 0.25 * scaleMult), -apiAbsPosition[3] - (backgroundMargin * 0.25 * scaleMult), 0) + drawMainList2() + end, true) + end + end + + if onlyMainList3 then + if MainList3 then + MainList3 = gl_DeleteList(MainList3) + end + MainList3 = gl_CreateList(function() + local leader + for i, drawObject in ipairs(drawList) do + if drawObject == -1 then + leader = true + elseif drawObject >= 0 then + if not player[drawObject].spec then -- specs have no resources + DrawPlayer(drawObject, leader, drawListOffset[i], mouseX, mouseY, false, false, true) + end + end + end + end) + end end function DrawLabel(text, vOffset, drawSeparator) - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end + if widgetWidth < 67 then + text = string.sub(text, 0, 1) + end - font:Begin(true) - font:SetTextColor(0.88, 0.88, 0.88, 1) + font:Begin(true) + font:SetTextColor(0.88, 0.88, 0.88, 1) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - font:Print(text, widgetPosX, widgetPosY + widgetHeight - vOffset + 7.5, 12, "on") - font:End() + font:Print(text, widgetPosX, widgetPosY + widgetHeight - vOffset + 7.5, 12, "on") + font:End() end function DrawLabelTip(text, vOffset, xOffset) - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end + if widgetWidth < 67 then + text = string.sub(text, 0, 1) + end - font:Begin(true) - font:SetTextColor(0.8, 0.8, 0.8, 0.75) + font:Begin(true) + font:SetTextColor(0.8, 0.8, 0.8, 0.75) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - font:Print(text, widgetPosX + xOffset, widgetPosY + widgetHeight - vOffset + 7.5, 10, "on") - font:End() + font:Print(text, widgetPosX + xOffset, widgetPosY + widgetHeight - vOffset + 7.5, 10, "on") + font:End() end function DrawSeparator(vOffset) - -- I dont know the fuck why the following RectRound or a plain gl.Rect) hardly shows up when using rendertotexture so lets brighten it! - local alpha = 0.35 - vOffset = vOffset - (3*playerScale) - RectRound( - widgetPosX + 2, - widgetPosY + widgetHeight - vOffset - (1.5 / widgetScale), - widgetPosX + widgetWidth - 2, - widgetPosY + widgetHeight - vOffset + (1.5 / widgetScale), (0.5 / widgetScale), - 1, 1, 1, 1, { 0.66, 0.66, 0.66, alpha }, { 0, 0, 0, alpha } - ) + -- I dont know the fuck why the following RectRound or a plain gl.Rect) hardly shows up when using rendertotexture so lets brighten it! + local alpha = 0.35 + vOffset = vOffset - (3 * playerScale) + RectRound(widgetPosX + 2, widgetPosY + widgetHeight - vOffset - (1.5 / widgetScale), widgetPosX + widgetWidth - 2, widgetPosY + widgetHeight - vOffset + (1.5 / widgetScale), (0.5 / widgetScale), 1, 1, 1, 1, { 0.66, 0.66, 0.66, alpha }, { 0, 0, 0, alpha }) end -- onlyMainList2 to only draw dynamic stuff like ping/alliances/buttons -- onlyMainList3 to only draw resources function DrawPlayer(playerID, leader, vOffset, mouseX, mouseY, onlyMainList, onlyMainList2, onlyMainList3) - local p = player[playerID] - p.posY = vOffset + local p = player[playerID] + p.posY = vOffset - tipY = nil + tipY = nil - local dark, rank, skill, country - if onlyMainList then - dark = p.dark - rank = p.rank - skill = p.skill - country = p.country - end + local dark, rank, skill, country + if onlyMainList then + dark = p.dark + rank = p.rank + skill = p.skill + country = p.country + end - local name = p.name + local name = p.name local nameIsAlias = p.nameIsAlias - local team = p.team - if not team then return end -- this prevents error when co-op / joinas is active - - local allyteam = p.allyteam - local pingLvl = p.pingLvl - local cpuLvl = p.cpuLvl - local ping = p.ping - local cpu = p.cpu - local spec = p.spec - local totake = p.totake - local needm = p.needm - local neede = p.neede - local dead = p.dead - local ai = p.ai - local alliances = p.alliances - local posY = widgetPosY + widgetHeight - vOffset - -- Center elements vertically in the shorter absent (non-AI ghost) row - if playerID >= specOffset and not ai then - posY = posY - (deadPlayerHeightReduction / 2) * playerScale - end - local tipPosY = widgetPosY + ((widgetHeight - vOffset) * widgetScale) + local team = p.team + if not team then + return + end -- this prevents error when co-op / joinas is active + + local allyteam = p.allyteam + local pingLvl = p.pingLvl + local cpuLvl = p.cpuLvl + local ping = p.ping + local cpu = p.cpu + local spec = p.spec + local totake = p.totake + local needm = p.needm + local neede = p.neede + local dead = p.dead + local ai = p.ai + local alliances = p.alliances + local posY = widgetPosY + widgetHeight - vOffset + -- Center elements vertically in the shorter absent (non-AI ghost) row + if playerID >= specOffset and not ai then + posY = posY - (deadPlayerHeightReduction / 2) * playerScale + end + local tipPosY = widgetPosY + ((widgetHeight - vOffset) * widgetScale) local desynced = p.desynced local accountID = p.accountID - local alpha = 0.33 - local alphaActivity = 0 - - -- keyboard/mouse activity - if lastActivity[playerID] ~= nil and type(lastActivity[playerID]) == "number" then - alphaActivity = math.clamp((8 - mathFloor(now - lastActivity[playerID])) / 5.5, 0, 1) - alphaActivity = 0.33 + (alphaActivity * 0.21) - alpha = alphaActivity - end - -- camera activity - if recentBroadcasters[playerID] ~= nil and type(recentBroadcasters[playerID]) == "number" then - local alphaCam = math.clamp((13 - mathFloor(recentBroadcasters[playerID])) / 8.5, 0, 1) - alpha = 0.33 + (alphaCam * 0.42) - if alpha < alphaActivity then - alpha = alphaActivity - end - end - if mouseY >= tipPosY and mouseY <= tipPosY + (16 * widgetScale * playerScale) then - tipY = true - end - - if onlyMainList and lockPlayerID and lockPlayerID == playerID then - DrawCamera(posY, true) - end + local alpha = 0.33 + local alphaActivity = 0 + + -- keyboard/mouse activity + if lastActivity[playerID] ~= nil and type(lastActivity[playerID]) == "number" then + alphaActivity = math.clamp((8 - mathFloor(now - lastActivity[playerID])) / 5.5, 0, 1) + alphaActivity = 0.33 + (alphaActivity * 0.21) + alpha = alphaActivity + end + -- camera activity + if recentBroadcasters[playerID] ~= nil and type(recentBroadcasters[playerID]) == "number" then + local alphaCam = math.clamp((13 - mathFloor(recentBroadcasters[playerID])) / 8.5, 0, 1) + alpha = 0.33 + (alphaCam * 0.42) + if alpha < alphaActivity then + alpha = alphaActivity + end + end + if mouseY >= tipPosY and mouseY <= tipPosY + (16 * widgetScale * playerScale) then + tipY = true + end + + if onlyMainList and lockPlayerID and lockPlayerID == playerID then + DrawCamera(posY, true) + end if onlyMainList then if m_allyID.active and not spec then @@ -2461,493 +2459,467 @@ function DrawPlayer(playerID, leader, vOffset, mouseX, mouseY, onlyMainList, onl DrawPlayerID(playerID, posY, dark, spec) end end - if tipY and accountID then - NameTip(mouseX, playerID, accountID, nameIsAlias) - end - if not spec then - --player - if onlyMainList2 and drawAllyButton and not dead and alliances ~= nil and #alliances > 0 then - DrawAlliances(alliances, posY) - end - if leader then - -- take / share buttons - if mySpecStatus == false then - if onlyMainList2 then - if allyteam == myAllyTeamID then - if m_take.active then - if totake then - DrawTakeSignal(posY) - if tipY then - TakeTip(mouseX) - end - end - end - if m_share.active and not dead and not hideShareIcons then - DrawShareButtons(posY, needm, neede) - if tipY then - ShareTip(mouseX, playerID) - end - end - end - if drawAllyButton and not dead then - if tipY then - AllyTip(mouseX, playerID) - end - end - end - else - if onlyMainList and m_indent.active and sp.GetMyTeamID() == team then - DrawDot(posY) - end - end - if onlyMainList then - if m_ID.active and not dead then - DrawID(team, posY, dark, dead) - end - if m_skill.active then - DrawSkill(skill, posY, dark) - end - - end - end - - if onlyMainList then - if m_rank.active then - DrawRank(tonumber(rank), posY) - end - if m_country.active and country ~= "" then - DrawCountry(country, posY) - end - if name ~= absentName and m_side.active then - DrawSidePic(team, playerID, posY, leader, dark, ai) - end - if m_name.active then - DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desynced) - end - end - - if onlyMainList2 and m_alliance.active and drawAllyButton and not mySpecStatus and not dead and team ~= myTeamID then - DrawAlly(posY, p.team) - end - - if (onlyMainList2 or onlyMainList3) and not isSingle and (m_resources.active or m_income.active) and aliveAllyTeams[allyteam] ~= nil and p.energy ~= nil then - if (mySpecStatus and enemyListShow) or myAllyTeamID == allyteam then - local e = p.energy - local es = p.energyStorage - local ei = p.energyIncome - local esh = p.energyShare - local ec = p.energyConversion - local m = p.metal - local ms = p.metalStorage - local mi = p.metalIncome - local msh = p.metalShare - if es and es > 0 then - if onlyMainList3 and m_resources.active and e and (not dead or (e > 0 or m > 0)) then - DrawResources(e, es, esh, ec, m, ms, msh, posY, dead, (absoluteResbarValues and (allyTeamMaxStorage[allyteam] and allyTeamMaxStorage[allyteam][1])), (absoluteResbarValues and (allyTeamMaxStorage[allyteam] and allyTeamMaxStorage[allyteam][2]))) - if tipY then - ResourcesTip(mouseX, e, es, ei, m, ms, mi, name, team) - end - end - if onlyMainList2 and m_income.active and ei and playerScale >= 0.7 then - DrawIncome(ei, mi, posY, dead) - if tipY then - IncomeTip(mouseX, ei, mi, name, team) - end - end - end - end - end - else - -- spectator - if onlyMainList and specListShow and m_name.active then - DrawSmallName(name, nameIsAlias, team, posY, false, playerID, accountID, alpha) - end - end - - if onlyMainList2 and m_cpuping.active and not isSinglePlayer then - if cpuLvl ~= nil then - -- draws CPU usage and ping icons (except AI and ghost teams) - DrawPingCpu(pingLvl, cpuLvl, posY, spec, cpu, lastFpsData[playerID]) - if tipY then - PingCpuTip(mouseX, ping, cpu, lastFpsData[playerID], lastGpuMemData[playerID], lastLuaMemData[playerID], lastSystemData[playerID], name, team, spec, lastApmData[team]) - end - end - end - - if playerID < specOffset then - if onlyMainList then - if m_chat.active and mySpecStatus == false and spec == false then - if playerID ~= myPlayerID then - DrawChatButton(posY) - end - end - end - end - - gl_Texture(false) + if tipY and accountID then + NameTip(mouseX, playerID, accountID, nameIsAlias) + end + if not spec then + --player + if onlyMainList2 and drawAllyButton and not dead and alliances ~= nil and #alliances > 0 then + DrawAlliances(alliances, posY) + end + if leader then + -- take / share buttons + if mySpecStatus == false then + if onlyMainList2 then + if allyteam == myAllyTeamID then + if m_take.active then + if totake then + DrawTakeSignal(posY) + if tipY then + TakeTip(mouseX) + end + end + end + if m_share.active and not dead and not hideShareIcons then + DrawShareButtons(posY, needm, neede) + if tipY then + ShareTip(mouseX, playerID) + end + end + end + if drawAllyButton and not dead then + if tipY then + AllyTip(mouseX, playerID) + end + end + end + else + if onlyMainList and m_indent.active and sp.GetMyTeamID() == team then + DrawDot(posY) + end + end + if onlyMainList then + if m_ID.active and not dead then + DrawID(team, posY, dark, dead) + end + if m_skill.active then + DrawSkill(skill, posY, dark) + end + end + end + + if onlyMainList then + if m_rank.active then + DrawRank(tonumber(rank), posY) + end + if m_country.active and country ~= "" then + DrawCountry(country, posY) + end + if name ~= absentName and m_side.active then + DrawSidePic(team, playerID, posY, leader, dark, ai) + end + if m_name.active then + DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desynced) + end + end + + if onlyMainList2 and m_alliance.active and drawAllyButton and not mySpecStatus and not dead and team ~= myTeamID then + DrawAlly(posY, p.team) + end + + if (onlyMainList2 or onlyMainList3) and not isSingle and (m_resources.active or m_income.active) and aliveAllyTeams[allyteam] ~= nil and p.energy ~= nil then + if (mySpecStatus and enemyListShow) or myAllyTeamID == allyteam then + local e = p.energy + local es = p.energyStorage + local ei = p.energyIncome + local esh = p.energyShare + local ec = p.energyConversion + local m = p.metal + local ms = p.metalStorage + local mi = p.metalIncome + local msh = p.metalShare + if es and es > 0 then + if onlyMainList3 and m_resources.active and e and (not dead or (e > 0 or m > 0)) then + DrawResources(e, es, esh, ec, m, ms, msh, posY, dead, (absoluteResbarValues and (allyTeamMaxStorage[allyteam] and allyTeamMaxStorage[allyteam][1])), (absoluteResbarValues and (allyTeamMaxStorage[allyteam] and allyTeamMaxStorage[allyteam][2]))) + if tipY then + ResourcesTip(mouseX, e, es, ei, m, ms, mi, name, team) + end + end + if onlyMainList2 and m_income.active and ei and playerScale >= 0.7 then + DrawIncome(ei, mi, posY, dead) + if tipY then + IncomeTip(mouseX, ei, mi, name, team) + end + end + end + end + end + else + -- spectator + if onlyMainList and specListShow and m_name.active then + DrawSmallName(name, nameIsAlias, team, posY, false, playerID, accountID, alpha) + end + end + + if onlyMainList2 and m_cpuping.active and not isSinglePlayer then + if cpuLvl ~= nil then + -- draws CPU usage and ping icons (except AI and ghost teams) + DrawPingCpu(pingLvl, cpuLvl, posY, spec, cpu, lastFpsData[playerID]) + if tipY then + PingCpuTip(mouseX, ping, cpu, lastFpsData[playerID], lastGpuMemData[playerID], lastLuaMemData[playerID], lastSystemData[playerID], name, team, spec, lastApmData[team]) + end + end + end + + if playerID < specOffset then + if onlyMainList then + if m_chat.active and mySpecStatus == false and spec == false then + if playerID ~= myPlayerID then + DrawChatButton(posY) + end + end + end + end + + gl_Texture(false) end function DrawTakeSignal(posY) - if blink then - -- Draws a blinking rectangle if the player of the same team left (/take option) - gl_Color(0.7, 0.7, 0.7) - gl_Texture(pics["arrowPic"]) - DrawRect(widgetPosX - 14, posY, widgetPosX, posY + 16) - gl_Color(1, 1, 1) - gl_Texture(pics["takePic"]) - DrawRect(widgetPosX - 57, posY - 15, widgetPosX - 12, posY + 32) - end + if blink then + -- Draws a blinking rectangle if the player of the same team left (/take option) + gl_Color(0.7, 0.7, 0.7) + gl_Texture(pics["arrowPic"]) + DrawRect(widgetPosX - 14, posY, widgetPosX, posY + 16) + gl_Color(1, 1, 1) + gl_Texture(pics["takePic"]) + DrawRect(widgetPosX - 57, posY - 15, widgetPosX - 12, posY + 32) + end end function DrawShareButtons(posY, needm, neede) - gl_Color(1, 1, 1, 1) - gl_Texture(pics["unitsPic"]) - DrawRect(m_share.posX + widgetPosX + (1*playerScale), posY, m_share.posX + widgetPosX + (17*playerScale), posY + (16*playerScale)) - gl_Texture(pics["energyPic"]) - DrawRect(m_share.posX + widgetPosX + (17*playerScale), posY, m_share.posX + widgetPosX + (33*playerScale), posY + (16*playerScale)) - gl_Texture(pics["metalPic"]) - DrawRect(m_share.posX + widgetPosX + (33*playerScale), posY, m_share.posX + widgetPosX + (49*playerScale), posY + (16*playerScale)) - gl_Texture(pics["lowPic"]) - - if needm then - DrawRect(m_share.posX + widgetPosX + (33*playerScale), posY, m_share.posX + widgetPosX + (49*playerScale), posY + (16*playerScale)) - end - - if neede then - DrawRect(m_share.posX + widgetPosX + (17*playerScale), posY, m_share.posX + widgetPosX + (33*playerScale), posY + (16*playerScale)) - end - - gl_Texture(false) + gl_Color(1, 1, 1, 1) + gl_Texture(pics["unitsPic"]) + DrawRect(m_share.posX + widgetPosX + (1 * playerScale), posY, m_share.posX + widgetPosX + (17 * playerScale), posY + (16 * playerScale)) + gl_Texture(pics["energyPic"]) + DrawRect(m_share.posX + widgetPosX + (17 * playerScale), posY, m_share.posX + widgetPosX + (33 * playerScale), posY + (16 * playerScale)) + gl_Texture(pics["metalPic"]) + DrawRect(m_share.posX + widgetPosX + (33 * playerScale), posY, m_share.posX + widgetPosX + (49 * playerScale), posY + (16 * playerScale)) + gl_Texture(pics["lowPic"]) + + if needm then + DrawRect(m_share.posX + widgetPosX + (33 * playerScale), posY, m_share.posX + widgetPosX + (49 * playerScale), posY + (16 * playerScale)) + end + + if neede then + DrawRect(m_share.posX + widgetPosX + (17 * playerScale), posY, m_share.posX + widgetPosX + (33 * playerScale), posY + (16 * playerScale)) + end + + gl_Texture(false) end function DrawChatButton(posY) - gl_Texture(pics["chatPic"]) - DrawRect(m_chat.posX + widgetPosX + (1*playerScale), posY, m_chat.posX + widgetPosX + (17*playerScale), posY + (16*playerScale)) + gl_Texture(pics["chatPic"]) + DrawRect(m_chat.posX + widgetPosX + (1 * playerScale), posY, m_chat.posX + widgetPosX + (17 * playerScale), posY + (16 * playerScale)) end function DrawResources(energy, energyStorage, energyShare, energyConversion, metal, metalStorage, metalShare, posY, dead, maxAllyTeamEnergyStorage, maxAllyTeamMetalStorage) - -- limit to prevent going out of bounds when losing storage - energy = mathMin(energy, energyStorage) - metal = mathMin(metal, metalStorage) - local bordersize = 0.75 - local paddingLeft = 2 * playerScale - local paddingRight = 2 * playerScale - local barWidth = (m_resources.width - paddingLeft - paddingRight) * (1-((1-playerScale)*0.5)) - local y1Offset - local y2Offset - local sizeMult = playerScale - if not dead then - y1Offset = 11 * sizeMult - y2Offset = 9 * sizeMult - else - y1Offset = 10 * sizeMult - y2Offset = 8.6 * sizeMult - end - local maxStorage = (maxAllyTeamMetalStorage and maxAllyTeamMetalStorage or metalStorage) - if not maxStorage or maxStorage == 0 then return end -- protect from NaN - --gl_Color(0,0,0, 0.05) - --gl_Texture(false) - --DrawRect(m_resources.posX + widgetPosX + paddingLeft-bordersize, posY + y1Offset+bordersize, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (metalStorage/maxStorage))+bordersize, posY + y2Offset-bordersize) - gl_Color(1, 1, 1, 0.18) - gl_Texture(pics["resbarBgPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (metalStorage/maxStorage)), posY + y2Offset) - gl_Color(1, 1, 1, 1) - gl_Texture(pics["resbarPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset) - - if playerScale >= 0.9 and (barWidth / maxStorage) * metal > 0.8 then - local glowsize = 10 - gl_Color(1, 1, 1.2, 0.08) - gl_Texture(pics["barGlowCenterPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset - glowsize) - - gl_Texture(pics["barGlowEdgePic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft - (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset - glowsize) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal) + (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset - glowsize) - end - - if metalShare < 0.99 then -- default = 0.99 - gl_Color(0,0,0, 0.18) - gl_Texture(false) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage/maxStorage)) * metalShare) - 0.75 - bordersize, - posY + y1Offset + 0.55 + bordersize, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage/maxStorage)) * metalShare) + 0.75 + bordersize, - posY + y2Offset - 0.55 - bordersize) - gl_Color(1, 0.25, 0.25, 1) - gl_Texture(pics["resbarPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage/maxStorage)) * metalShare) - 0.75, - posY + y1Offset + 0.55, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage/maxStorage)) * metalShare) + 0.75, - posY + y2Offset - 0.55) - end - - if dead then - y1Offset = 7.4 * sizeMult - y2Offset = 6 * sizeMult - else - y1Offset = 7 * sizeMult - y2Offset = 5 * sizeMult - end - maxStorage = (maxAllyTeamEnergyStorage and maxAllyTeamEnergyStorage or energyStorage) - --gl_Color(0,0,0, 0.05) - --gl_Texture(false) - --DrawRect(m_resources.posX + widgetPosX + paddingLeft -bordersize, posY + y1Offset+bordersize, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (energyStorage/maxStorage))+bordersize, posY + y2Offset-bordersize) - gl_Color(1, 1, 0, 0.18) - gl_Texture(pics["resbarBgPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (energyStorage/maxStorage)), posY + y2Offset) - gl_Color(1, 1, 0, 1) - gl_Texture(pics["resbarPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset) - - if playerScale >= 0.9 and (barWidth / maxStorage) * energy > 0.8 then - local glowsize = 10 - gl_Color(1, 1, 0.2, 0.08) - gl_Texture(pics["barGlowCenterPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset - glowsize) - - gl_Texture(pics["barGlowEdgePic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft - (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset - glowsize) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy) + (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset - glowsize) - end - - if energyConversion and energyConversion ~= 0.75 and not dead then -- default = 0.75 - gl_Color(0,0,0, 0.125) - gl_Texture(false) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyConversion) - 0.75 - bordersize, - posY + y1Offset + 0.55 + bordersize, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyConversion) + 0.75 + bordersize, - posY + y2Offset - 0.55 - bordersize) - gl_Color(0.9, 0.9, 0.73, 1) - gl_Texture(pics["resbarPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyConversion) - 0.75, - posY + y1Offset + 0.55, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyConversion) + 0.75, - posY + y2Offset - 0.55) - end - - if energyShare < 0.94 or energyShare > 0.96 then -- default = 0.94999999 - gl_Color(0,0,0, 0.18) - gl_Texture(false) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyShare) - 0.75 - bordersize, - posY + y1Offset + 1.1, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyShare) + 0.75 + bordersize, - posY + y2Offset - 1.1) - gl_Color(1, 0.25, 0.25, 1) - gl_Texture(pics["resbarPic"]) - DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyShare) - 0.75, - posY + y1Offset + 0.55, - m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage/maxStorage)) * energyShare) + 0.75, - posY + y2Offset - 0.55) - end + -- limit to prevent going out of bounds when losing storage + energy = mathMin(energy, energyStorage) + metal = mathMin(metal, metalStorage) + local bordersize = 0.75 + local paddingLeft = 2 * playerScale + local paddingRight = 2 * playerScale + local barWidth = (m_resources.width - paddingLeft - paddingRight) * (1 - ((1 - playerScale) * 0.5)) + local y1Offset + local y2Offset + local sizeMult = playerScale + if not dead then + y1Offset = 11 * sizeMult + y2Offset = 9 * sizeMult + else + y1Offset = 10 * sizeMult + y2Offset = 8.6 * sizeMult + end + local maxStorage = (maxAllyTeamMetalStorage and maxAllyTeamMetalStorage or metalStorage) + if not maxStorage or maxStorage == 0 then + return + end -- protect from NaN + --gl_Color(0,0,0, 0.05) + --gl_Texture(false) + --DrawRect(m_resources.posX + widgetPosX + paddingLeft-bordersize, posY + y1Offset+bordersize, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (metalStorage/maxStorage))+bordersize, posY + y2Offset-bordersize) + gl_Color(1, 1, 1, 0.18) + gl_Texture(pics["resbarBgPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (metalStorage / maxStorage)), posY + y2Offset) + gl_Color(1, 1, 1, 1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset) + + if playerScale >= 0.9 and (barWidth / maxStorage) * metal > 0.8 then + local glowsize = 10 + gl_Color(1, 1, 1.2, 0.08) + gl_Texture(pics["barGlowCenterPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset - glowsize) + + gl_Texture(pics["barGlowEdgePic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft - (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset - glowsize) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal) + (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * metal), posY + y2Offset - glowsize) + end + + if metalShare < 0.99 then -- default = 0.99 + gl_Color(0, 0, 0, 0.18) + gl_Texture(false) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage / maxStorage)) * metalShare) - 0.75 - bordersize, posY + y1Offset + 0.55 + bordersize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage / maxStorage)) * metalShare) + 0.75 + bordersize, posY + y2Offset - 0.55 - bordersize) + gl_Color(1, 0.25, 0.25, 1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage / maxStorage)) * metalShare) - 0.75, posY + y1Offset + 0.55, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (metalStorage / maxStorage)) * metalShare) + 0.75, posY + y2Offset - 0.55) + end + + if dead then + y1Offset = 7.4 * sizeMult + y2Offset = 6 * sizeMult + else + y1Offset = 7 * sizeMult + y2Offset = 5 * sizeMult + end + maxStorage = (maxAllyTeamEnergyStorage and maxAllyTeamEnergyStorage or energyStorage) + --gl_Color(0,0,0, 0.05) + --gl_Texture(false) + --DrawRect(m_resources.posX + widgetPosX + paddingLeft -bordersize, posY + y1Offset+bordersize, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (energyStorage/maxStorage))+bordersize, posY + y2Offset-bordersize) + gl_Color(1, 1, 0, 0.18) + gl_Texture(pics["resbarBgPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + (barWidth * (energyStorage / maxStorage)), posY + y2Offset) + gl_Color(1, 1, 0, 1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset) + + if playerScale >= 0.9 and (barWidth / maxStorage) * energy > 0.8 then + local glowsize = 10 + gl_Color(1, 1, 0.2, 0.08) + gl_Texture(pics["barGlowCenterPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset - glowsize) + + gl_Texture(pics["barGlowEdgePic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft - (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset - glowsize) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy) + (glowsize * 1.8), posY + y1Offset + glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth / maxStorage) * energy), posY + y2Offset - glowsize) + end + + if energyConversion and energyConversion ~= 0.75 and not dead then -- default = 0.75 + gl_Color(0, 0, 0, 0.125) + gl_Texture(false) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyConversion) - 0.75 - bordersize, posY + y1Offset + 0.55 + bordersize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyConversion) + 0.75 + bordersize, posY + y2Offset - 0.55 - bordersize) + gl_Color(0.9, 0.9, 0.73, 1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyConversion) - 0.75, posY + y1Offset + 0.55, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyConversion) + 0.75, posY + y2Offset - 0.55) + end + + if energyShare < 0.94 or energyShare > 0.96 then -- default = 0.94999999 + gl_Color(0, 0, 0, 0.18) + gl_Texture(false) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyShare) - 0.75 - bordersize, posY + y1Offset + 1.1, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyShare) + 0.75 + bordersize, posY + y2Offset - 1.1) + gl_Color(1, 0.25, 0.25, 1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyShare) - 0.75, posY + y1Offset + 0.55, m_resources.posX + widgetPosX + paddingLeft + ((barWidth * (energyStorage / maxStorage)) * energyShare) + 0.75, posY + y2Offset - 0.55) + end end function DrawIncome(energy, metal, posY, dead) - local fontsize = (dead and 4.5 or 8.5) * fontScaleLow - local sizeMult = playerScale + ((1-playerScale)*0.22) - fontsize = fontsize * sizeMult - font:Begin(true) + local fontsize = (dead and 4.5 or 8.5) * fontScaleLow + local sizeMult = playerScale + ((1 - playerScale) * 0.22) + fontsize = fontsize * sizeMult + font:Begin(true) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - if energy > 0 then - font:Print( - '\255\255\255\050' .. string.formatSI(mathFloor(energy)), - m_income.posX + widgetPosX + m_income.width - 2, - posY + ((fontsize*0.2)*sizeMult) + (dead and 1 or 0), - fontsize, - "or" - ) - end - if metal > 0 then - font:Print( - '\255\235\235\235' .. string.formatSI(mathFloor(metal)), - m_income.posX + widgetPosX + m_income.width - 2, - posY + ((fontsize*1.15)*sizeMult) + (dead and 1 or 0), - fontsize, - "or" - ) - end - font:End() + if energy > 0 then + font:Print("\255\255\255\050" .. string.formatSI(mathFloor(energy)), m_income.posX + widgetPosX + m_income.width - 2, posY + ((fontsize * 0.2) * sizeMult) + (dead and 1 or 0), fontsize, "or") + end + if metal > 0 then + font:Print("\255\235\235\235" .. string.formatSI(mathFloor(metal)), m_income.posX + widgetPosX + m_income.width - 2, posY + ((fontsize * 1.15) * sizeMult) + (dead and 1 or 0), fontsize, "or") + end + font:End() end function DrawSidePic(team, playerID, posY, leader, dark, ai) - gl_Color(1, 1, 1, 1) - if gameStarted then - if leader then - gl_Texture(sidePics[team]) -- sets side image (for leaders) - else - gl_Texture(pics["notFirstPic"]) -- sets image for not leader of team players - end - DrawRect(m_side.posX + widgetPosX + (2*playerScale), posY + (1*playerScale), m_side.posX + widgetPosX + (16*playerScale), posY + (15*playerScale)) -- draws side image - gl_Texture(false) - else - DrawState(playerID, m_side.posX + widgetPosX, posY) - end + gl_Color(1, 1, 1, 1) + if gameStarted then + if leader then + gl_Texture(sidePics[team]) -- sets side image (for leaders) + else + gl_Texture(pics["notFirstPic"]) -- sets image for not leader of team players + end + DrawRect(m_side.posX + widgetPosX + (2 * playerScale), posY + (1 * playerScale), m_side.posX + widgetPosX + (16 * playerScale), posY + (15 * playerScale)) -- draws side image + gl_Texture(false) + else + DrawState(playerID, m_side.posX + widgetPosX, posY) + end end function DrawRank(rank, posY) - local rankPic = rankPics[rank] - if rankPic then - DrawRankImage(rankPic, posY) - end + local rankPic = rankPics[rank] + if rankPic then + DrawRankImage(rankPic, posY) + end end function DrawRankImage(rankImage, posY) - gl_Color(1, 1, 1, 1) - gl_Texture(rankImage) - DrawRect(m_rank.posX + widgetPosX + (3*playerScale), posY + (8*playerScale) - (7.5*playerScale), m_rank.posX + widgetPosX + (17*playerScale), posY + (8*playerScale) + (7.5*playerScale)) + gl_Color(1, 1, 1, 1) + gl_Texture(rankImage) + DrawRect(m_rank.posX + widgetPosX + (3 * playerScale), posY + (8 * playerScale) - (7.5 * playerScale), m_rank.posX + widgetPosX + (17 * playerScale), posY + (8 * playerScale) + (7.5 * playerScale)) end local function RectQuad(px, py, sx, sy) - local o = 0.008 -- texture offset, because else grey line might show at the edges - gl.TexCoord(o, 1 - o) - gl.Vertex(px, py, 0) - gl.TexCoord(1 - o, 1 - o) - gl.Vertex(sx, py, 0) - gl.TexCoord(1 - o, o) - gl.Vertex(sx, sy, 0) - gl.TexCoord(o, o) - gl.Vertex(px, sy, 0) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o, 1 - o) + gl.Vertex(px, py, 0) + gl.TexCoord(1 - o, 1 - o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1 - o, o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o, o) + gl.Vertex(px, sy, 0) end function DrawRect(px, py, sx, sy) - gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy) + gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy) end function DrawAlly(posY, team) - gl_Color(1, 1, 1, 0.66) - if sp.AreTeamsAllied(team, myTeamID) then - gl_Texture(pics["unallyPic"]) - else - gl_Texture(pics["allyPic"]) - end - DrawRect(m_alliance.posX + widgetPosX + (3*playerScale), posY + (1*playerScale), m_alliance.posX + widgetPosX + (playerOffset*playerScale), posY + (15*playerScale)) + gl_Color(1, 1, 1, 0.66) + if sp.AreTeamsAllied(team, myTeamID) then + gl_Texture(pics["unallyPic"]) + else + gl_Texture(pics["allyPic"]) + end + DrawRect(m_alliance.posX + widgetPosX + (3 * playerScale), posY + (1 * playerScale), m_alliance.posX + widgetPosX + (playerOffset * playerScale), posY + (15 * playerScale)) end function DrawCountry(country, posY) - if country == nil or country == "??" then return end - local cached = countryFlagCache[country] - if cached == nil then - local path = images['imgDir'] .. "flags/" .. strUpper(country) .. images['flagsExt'] - if VFS.FileExists(path) then - cached = path - else - cached = false - end - countryFlagCache[country] = cached - end - if cached then - gl_Texture(cached) - gl_Color(1, 1, 1, 1) - DrawRect(m_country.posX + widgetPosX + (3*playerScale), posY + (8*playerScale) - ((images['flagHeight']/2)*playerScale), m_country.posX + widgetPosX + (17*playerScale), posY + (8*playerScale) + ((images['flagHeight']/2)*playerScale)) - end + if country == nil or country == "??" then + return + end + local cached = countryFlagCache[country] + if cached == nil then + local path = images["imgDir"] .. "flags/" .. strUpper(country) .. images["flagsExt"] + if VFS.FileExists(path) then + cached = path + else + cached = false + end + countryFlagCache[country] = cached + end + if cached then + gl_Texture(cached) + gl_Color(1, 1, 1, 1) + DrawRect(m_country.posX + widgetPosX + (3 * playerScale), posY + (8 * playerScale) - ((images["flagHeight"] / 2) * playerScale), m_country.posX + widgetPosX + (17 * playerScale), posY + (8 * playerScale) + ((images["flagHeight"] / 2) * playerScale)) + end end function DrawDot(posY) - gl_Color(1, 1, 1, 0.70) - gl_Texture(pics["currentPic"]) - DrawRect(m_indent.posX + widgetPosX - 1, posY + (3*playerScale), m_indent.posX + widgetPosX + (7*playerScale), posY + (11*playerScale)) + gl_Color(1, 1, 1, 0.70) + gl_Texture(pics["currentPic"]) + DrawRect(m_indent.posX + widgetPosX - 1, posY + (3 * playerScale), m_indent.posX + widgetPosX + (7 * playerScale), posY + (11 * playerScale)) end function DrawCamera(posY, active) - if active ~= nil and active then - gl_Color(1, 1, 1, 0.7) - else - gl_Color(1, 1, 1, 0.13) - end - gl_Texture(pics["cameraPic"]) - DrawRect(m_indent.posX + widgetPosX - (1.5*playerScale), posY + (2*playerScale), m_indent.posX + widgetPosX + (9*playerScale), posY + (12.4*playerScale)) + if active ~= nil and active then + gl_Color(1, 1, 1, 0.7) + else + gl_Color(1, 1, 1, 0.13) + end + gl_Texture(pics["cameraPic"]) + DrawRect(m_indent.posX + widgetPosX - (1.5 * playerScale), posY + (2 * playerScale), m_indent.posX + widgetPosX + (9 * playerScale), posY + (12.4 * playerScale)) end function colourNames(teamID, returnRgb) - local nameColourR, nameColourG, nameColourB, nameColourA = sp.GetTeamColor(teamID) + local nameColourR, nameColourG, nameColourB, nameColourA = sp.GetTeamColor(teamID) if (not mySpecStatus) and anonymousMode ~= "disabled" and teamID ~= myTeamID then nameColourR, nameColourG, nameColourB = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] end - if returnRgb then - return Color.ToIntArray(nameColourR, nameColourG, nameColourB) - else - return Color.ToString(nameColourR, nameColourG, nameColourB) - end + if returnRgb then + return Color.ToIntArray(nameColourR, nameColourG, nameColourB) + else + return Color.ToString(nameColourR, nameColourG, nameColourB) + end end function DrawState(playerID, posX, posY) - -- note that adv pl list uses a phantom pID for absent players, so this will always show unready for players not ingame - local ready = (playerReadyState[playerID] == 1) or (playerReadyState[playerID] == 2) or (playerReadyState[playerID] == -1) - local hasStartPoint = (playerReadyState[playerID] == 4) - if ai then - gl_Color(0.1, 0.1, 0.97, 1) - else - if ready then - gl_Color(0.1, 0.95, 0.2, 1) - else - if hasStartPoint then - gl_Color(1, 0.65, 0.1, 1) - else - gl_Color(0.8, 0.1, 0.1, 1) - end - end - end - gl_Texture(pics["readyTexture"]) - DrawRect(posX, posY - (1*playerScale), posX + (16*playerScale), posY + (16*playerScale)) - gl_Color(1, 1, 1, 1) + -- note that adv pl list uses a phantom pID for absent players, so this will always show unready for players not ingame + local ready = (playerReadyState[playerID] == 1) or (playerReadyState[playerID] == 2) or (playerReadyState[playerID] == -1) + local hasStartPoint = (playerReadyState[playerID] == 4) + if ai then + gl_Color(0.1, 0.1, 0.97, 1) + else + if ready then + gl_Color(0.1, 0.95, 0.2, 1) + else + if hasStartPoint then + gl_Color(1, 0.65, 0.1, 1) + else + gl_Color(0.8, 0.1, 0.1, 1) + end + end + end + gl_Texture(pics["readyTexture"]) + DrawRect(posX, posY - (1 * playerScale), posX + (16 * playerScale), posY + (16 * playerScale)) + gl_Color(1, 1, 1, 1) end function DrawAlliances(alliances, posY) - -- still a problem is that teams with the same/similar color can be misleading - local posX = widgetPosX + m_name.posX - local width = m_name.width / #alliances - local padding = 2 - local drawn = false - for i, allyPlayerID in pairs(alliances) do - local ap = player[allyPlayerID] - if ap ~= nil and ap.red ~= nil then - gl_Color(0, 0, 0, 0.25) - RectRound(posX + (width * (i - 1)), posY - (3*playerScale), posX + (width * i), posY + (19*playerScale), (2*playerScale)) - gl_Color(ap.red, ap.green, ap.blue, 0.5) - RectRound(posX + (width * (i - 1)) + padding, posY - (3*playerScale) + padding, posX + (width * i) - padding, posY + (19*playerScale) - padding, (2*playerScale)) - drawn = true - end - end - if drawn then - gl_Color(1, 1, 1, 1) - end + -- still a problem is that teams with the same/similar color can be misleading + local posX = widgetPosX + m_name.posX + local width = m_name.width / #alliances + local padding = 2 + local drawn = false + for i, allyPlayerID in pairs(alliances) do + local ap = player[allyPlayerID] + if ap ~= nil and ap.red ~= nil then + gl_Color(0, 0, 0, 0.25) + RectRound(posX + (width * (i - 1)), posY - (3 * playerScale), posX + (width * i), posY + (19 * playerScale), (2 * playerScale)) + gl_Color(ap.red, ap.green, ap.blue, 0.5) + RectRound(posX + (width * (i - 1)) + padding, posY - (3 * playerScale) + padding, posX + (width * i) - padding, posY + (19 * playerScale) - padding, (2 * playerScale)) + drawn = true + end + end + if drawn then + gl_Color(1, 1, 1, 1) + end end function DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desynced) - local willSub = "" - local ignored = WG.ignoredAccounts and (WG.ignoredAccounts[accountID] or WG.ignoredAccounts[name] ~= nil) - local pDraw = player[playerID] - local isAbsent = false - if name == absentName then - isAbsent = true - local lastKnownName = pDraw and pDraw.lastKnownName - if not lastKnownName and team then - -- Live fallback: resolve via the team leader player ID stored in the engine - local teamLeaderID = select(2, Spring.GetTeamInfo(team, false)) - if teamLeaderID and teamLeaderID >= 0 then - local pName, _, pSpec, pTeam = Spring.GetPlayerInfo(teamLeaderID, false) - if pName and pName ~= "" and not pSpec and pTeam == team then - lastKnownName = (WG.playernames and WG.playernames.getPlayername) - and WG.playernames.getPlayername(teamLeaderID) or pName - -- Persist so GetAllPlayers picks it up and doesn't look it up again - lastKnownTeamNames[team] = lastKnownName - if pDraw then pDraw.lastKnownName = lastKnownName end - end - end - end - if lastKnownName then - name = lastKnownName - end - end - - if not gameStarted then - if playerID >= specOffset then - willSub = (Spring.GetGameRulesParam("Player" .. (playerID - specOffset) .. "willSub") == 1) and " (sub)" or "" --pID-specOffset because apl uses dummy playerIDs for absent players - else - willSub = (Spring.GetGameRulesParam("Player" .. (playerID) .. "willSub") == 1) and " (sub)" or "" - end - end - - local nameText = name + local willSub = "" + local ignored = WG.ignoredAccounts and (WG.ignoredAccounts[accountID] or WG.ignoredAccounts[name] ~= nil) + local pDraw = player[playerID] + local isAbsent = false + if name == absentName then + isAbsent = true + local lastKnownName = pDraw and pDraw.lastKnownName + if not lastKnownName and team then + -- Live fallback: resolve via the team leader player ID stored in the engine + local teamLeaderID = select(2, Spring.GetTeamInfo(team, false)) + if teamLeaderID and teamLeaderID >= 0 then + local pName, _, pSpec, pTeam = Spring.GetPlayerInfo(teamLeaderID, false) + if pName and pName ~= "" and not pSpec and pTeam == team then + lastKnownName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(teamLeaderID) or pName + -- Persist so GetAllPlayers picks it up and doesn't look it up again + lastKnownTeamNames[team] = lastKnownName + if pDraw then + pDraw.lastKnownName = lastKnownName + end + end + end + end + if lastKnownName then + name = lastKnownName + end + end + + if not gameStarted then + if playerID >= specOffset then + willSub = (Spring.GetGameRulesParam("Player" .. (playerID - specOffset) .. "willSub") == 1) and " (sub)" or "" --pID-specOffset because apl uses dummy playerIDs for absent players + else + willSub = (Spring.GetGameRulesParam("Player" .. playerID .. "willSub") == 1) and " (sub)" or "" + end + end + + local nameText = name if WG.playernames and not pDraw.history then pDraw.history = WG.playernames.getAccountHistory(accountID) or {} end @@ -2960,60 +2932,60 @@ function DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desy end nameText = nameText .. willSub - -- includes readystate icon if factions arent shown - local xPadding = 0 - if not gameStarted and not m_side.active then - xPadding = 16 - DrawState(playerID, m_name.posX + widgetPosX, posY) - end - - font2:Begin(true) - local fontsize = (isAbsent and 9 or 14) * fontScaleMed - fontsize = fontsize * (playerScale + ((1-playerScale)*0.25)) - if dark then - font2:SetOutlineColor(0.9, 0.9, 0.9, 1) - else - font2:SetOutlineColor(0, 0, 0, 1) - end - if (not mySpecStatus) and anonymousMode ~= "disabled" and playerID ~= myPlayerID then - font2:SetTextColor(anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3], 1) - else - font2:SetTextColor(sp.GetTeamColor(team)) - end - if isAbsent or (pDraw and pDraw.dead) then - font2:SetOutlineColor(0, 0, 0, 0.4) - font2:SetTextColor(0.45,0.45,0.45,1) - end - local nameYOffset = isAbsent and 5 or 4 - font2:Print(nameText, m_name.posX + widgetPosX + 3 + xPadding, posY + (nameYOffset*playerScale), fontsize, "o") - - --desynced = playerID == 1 - local pScale = (0.5+playerScale)*0.67 --dont scale too much for the already smaller bonus font + -- includes readystate icon if factions arent shown + local xPadding = 0 + if not gameStarted and not m_side.active then + xPadding = 16 + DrawState(playerID, m_name.posX + widgetPosX, posY) + end + + font2:Begin(true) + local fontsize = (isAbsent and 9 or 14) * fontScaleMed + fontsize = fontsize * (playerScale + ((1 - playerScale) * 0.25)) + if dark then + font2:SetOutlineColor(0.9, 0.9, 0.9, 1) + else + font2:SetOutlineColor(0, 0, 0, 1) + end + if (not mySpecStatus) and anonymousMode ~= "disabled" and playerID ~= myPlayerID then + font2:SetTextColor(anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3], 1) + else + font2:SetTextColor(sp.GetTeamColor(team)) + end + if isAbsent or (pDraw and pDraw.dead) then + font2:SetOutlineColor(0, 0, 0, 0.4) + font2:SetTextColor(0.45, 0.45, 0.45, 1) + end + local nameYOffset = isAbsent and 5 or 4 + font2:Print(nameText, m_name.posX + widgetPosX + 3 + xPadding, posY + (nameYOffset * playerScale), fontsize, "o") + + --desynced = playerID == 1 + local pScale = (0.5 + playerScale) * 0.67 --dont scale too much for the already smaller bonus font if desynced then - if dark then - font2:SetOutlineColor(0, 0, 0, 1) - end - font2:SetTextColor(1,0.45,0.45,1) - font2:Print(Spring.I18N('ui.playersList.desynced'), m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText)*14*pScale), posY + (5.7*playerScale), 8*pScale, "o") + if dark then + font2:SetOutlineColor(0, 0, 0, 1) + end + font2:SetTextColor(1, 0.45, 0.45, 1) + font2:Print(Spring.I18N("ui.playersList.desynced"), m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText) * 14 * pScale), posY + (5.7 * playerScale), 8 * pScale, "o") elseif pDraw and not pDraw.dead and pDraw.incomeMultiplier and pDraw.incomeMultiplier ~= 1 then - if dark then - font2:SetOutlineColor(0, 0, 0, 1) - end - if pDraw.incomeMultiplier > 1 then - font2:SetTextColor(0.5,1,0.5,1) - font2:Print('+'..mathFloor((pDraw.incomeMultiplier-1+0.005)*100)..'%', m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText)*14*pScale), posY + (5.7*playerScale), 8*pScale, "o") - else - font2:SetTextColor(1,0.5,0.5,1) - font2:Print(mathFloor((pDraw.incomeMultiplier-1+0.005)*100)..'%', m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText)*14*pScale), posY + (5.7*playerScale), 8*pScale, "o") - end - end - font2:End() - - if ignored or desynced or (pDraw and pDraw.dead) then - local x = m_name.posX + widgetPosX + 2 + xPadding - local y = isAbsent and (posY + (8*playerScale)) or (posY + (7*playerScale)) - local w = (font2:GetTextWidth(nameText) * fontsize) + 2 - local h = isAbsent and (1.5*playerScale) or (2*playerScale) + if dark then + font2:SetOutlineColor(0, 0, 0, 1) + end + if pDraw.incomeMultiplier > 1 then + font2:SetTextColor(0.5, 1, 0.5, 1) + font2:Print("+" .. mathFloor((pDraw.incomeMultiplier - 1 + 0.005) * 100) .. "%", m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText) * 14 * pScale), posY + (5.7 * playerScale), 8 * pScale, "o") + else + font2:SetTextColor(1, 0.5, 0.5, 1) + font2:Print(mathFloor((pDraw.incomeMultiplier - 1 + 0.005) * 100) .. "%", m_name.posX + widgetPosX + 5 + xPadding + (font2:GetTextWidth(nameText) * 14 * pScale), posY + (5.7 * playerScale), 8 * pScale, "o") + end + end + font2:End() + + if ignored or desynced or (pDraw and pDraw.dead) then + local x = m_name.posX + widgetPosX + 2 + xPadding + local y = isAbsent and (posY + (8 * playerScale)) or (posY + (7 * playerScale)) + local w = (font2:GetTextWidth(nameText) * fontsize) + 2 + local h = isAbsent and (1.5 * playerScale) or (2 * playerScale) if desynced then gl_Color(1, 0.2, 0.2, 0.9) elseif pDraw and pDraw.dead then @@ -3021,23 +2993,23 @@ function DrawName(name, nameIsAlias, team, posY, dark, playerID, accountID, desy else gl_Color(1, 1, 1, 0.9) end - gl_Texture(false) - DrawRect(x, y, x + w, y + h) - gl_Color(1, 1, 1, 1) - end + gl_Texture(false) + DrawRect(x, y, x + w, y + h) + gl_Color(1, 1, 1, 1) + end end function DrawSmallName(name, nameIsAlias, team, posY, dark, playerID, accountID, alpha) - if team == nil then - return - end - local ignored = WG.ignoredAccounts and (WG.ignoredAccounts[accountID] or WG.ignoredAccounts[name] ~= nil) - local textindent = 4 - if m_indent.active or m_rank.active or m_side.active or m_allyID.active or m_playerID.active or m_ID.active then - textindent = 0 - end - - local nameText = name + if team == nil then + return + end + local ignored = WG.ignoredAccounts and (WG.ignoredAccounts[accountID] or WG.ignoredAccounts[name] ~= nil) + local textindent = 4 + if m_indent.active or m_rank.active or m_side.active or m_allyID.active or m_playerID.active or m_ID.active then + textindent = 0 + end + + local nameText = name local pSmall = player[playerID] if WG.playernames and not pSmall.history then pSmall.history = WG.playernames.getAccountHistory(accountID) or {} @@ -3046,187 +3018,186 @@ function DrawSmallName(name, nameIsAlias, team, posY, dark, playerID, accountID, nameText = "." .. name elseif pSmall.history and #pSmall.history > 1 then nameText = "*" .. name - elseif not accountID then -- these are spectators that joined late and would have a duplicate accountID (we) - nameText = " " .. name + elseif not accountID then -- these are spectators that joined late and would have a duplicate accountID (we) + nameText = " " .. name else nameText = " " .. name end - if originalColourNames[playerID] then - local oc = originalColourNames[playerID] - nameText = "\255" .. strChar(oc[1]) .. strChar(oc[2]) .. strChar(oc[3]) .. nameText - end - - font2:Begin(true) - font2:SetOutlineColor(0.15+(alpha*0.33), 0.15+(alpha*0.33), 0.15+(alpha*0.33), 0.55) - font2:SetTextColor(alpha, alpha, alpha, 1) - font2:Print(nameText, m_name.posX + textindent + widgetPosX + 3, posY + (4*specScale), (10*specScale * fontScaleSpec), "n") - font2:End() - - if ignored then - local x = m_name.posX + textindent + widgetPosX + 2.2 - local y = posY + (6*specScale) - local w = font2:GetTextWidth(nameText) * 10 + 2 - local h = 2 - gl_Texture(false) - gl_Color(1, 1, 1, 0.7) - DrawRect(x, y, x + w, y + h) - gl_Color(1, 1, 1, 1) - end + if originalColourNames[playerID] then + local oc = originalColourNames[playerID] + nameText = "\255" .. strChar(oc[1]) .. strChar(oc[2]) .. strChar(oc[3]) .. nameText + end + + font2:Begin(true) + font2:SetOutlineColor(0.15 + (alpha * 0.33), 0.15 + (alpha * 0.33), 0.15 + (alpha * 0.33), 0.55) + font2:SetTextColor(alpha, alpha, alpha, 1) + font2:Print(nameText, m_name.posX + textindent + widgetPosX + 3, posY + (4 * specScale), (10 * specScale * fontScaleSpec), "n") + font2:End() + + if ignored then + local x = m_name.posX + textindent + widgetPosX + 2.2 + local y = posY + (6 * specScale) + local w = font2:GetTextWidth(nameText) * 10 + 2 + local h = 2 + gl_Texture(false) + gl_Color(1, 1, 1, 0.7) + DrawRect(x, y, x + w, y + h) + gl_Color(1, 1, 1, 1) + end end function DrawAllyID(allyID, posY, dark, dead) - local spacer = "" - if allyID < 10 then - spacer = " " - end - local fontsize = 9.5 * (playerScale + ((1-playerScale)*0.25)) * fontScaleHigh - font:Begin(true) + local spacer = "" + if allyID < 10 then + spacer = " " + end + local fontsize = 9.5 * (playerScale + ((1 - playerScale) * 0.25)) * fontScaleHigh + font:Begin(true) font:SetTextColor(0.9, 0.7, 0.9, 1) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - font:Print(spacer .. allyID, m_allyID.posX + widgetPosX + (4.5*playerScale), posY + (5.3*playerScale), fontsize, "on") - font:End() + font:Print(spacer .. allyID, m_allyID.posX + widgetPosX + (4.5 * playerScale), posY + (5.3 * playerScale), fontsize, "on") + font:End() end function DrawPlayerID(playerID, posY, dark, spec) - local spacer = "" - if playerID < 10 then - spacer = " " - end + local spacer = "" + if playerID < 10 then + spacer = " " + end local usedScale = spec and specScale or playerScale - local fontsize = 9.5 * (usedScale + ((1-usedScale)*0.25)) * fontScaleHigh + local fontsize = 9.5 * (usedScale + ((1 - usedScale) * 0.25)) * fontScaleHigh fontsize = fontsize * (spec and 0.82 or 1) - font:Begin(true) + font:Begin(true) font:SetTextColor(0.7, 0.9, 0.7, spec and 0.5 or 1) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - font:Print(spacer .. playerID, m_playerID.posX + widgetPosX + (4.5*usedScale), posY + (5.3*usedScale), fontsize, "on") - font:End() + font:Print(spacer .. playerID, m_playerID.posX + widgetPosX + (4.5 * usedScale), posY + (5.3 * usedScale), fontsize, "on") + font:End() end function DrawID(teamID, posY, dark, dead) - local spacer = "" - if teamID < 10 then - spacer = " " - end - local fontsize = 9.5 * (playerScale + ((1-playerScale)*0.25)) * fontScaleHigh - font:Begin(true) + local spacer = "" + if teamID < 10 then + spacer = " " + end + local fontsize = 9.5 * (playerScale + ((1 - playerScale) * 0.25)) * fontScaleHigh + font:Begin(true) font:SetTextColor(0.7, 0.7, 0.7, 1) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - font:Print(spacer .. teamID, m_ID.posX + widgetPosX + (4.5*playerScale), posY + (5.3*playerScale), fontsize, "on") - font:End() + font:Print(spacer .. teamID, m_ID.posX + widgetPosX + (4.5 * playerScale), posY + (5.3 * playerScale), fontsize, "on") + font:End() end function DrawSkill(skill, posY, dark) - local fontsize = 9.5 * (playerScale + ((1-playerScale)*0.25)) * fontScaleHigh - font:Begin(true) - font:Print(skill, m_skill.posX + widgetPosX + (4.5*playerScale), posY + (5.3*playerScale), fontsize, "o") - font:End() + local fontsize = 9.5 * (playerScale + ((1 - playerScale) * 0.25)) * fontScaleHigh + font:Begin(true) + font:Print(skill, m_skill.posX + widgetPosX + (4.5 * playerScale), posY + (5.3 * playerScale), fontsize, "o") + font:End() end function DrawPingCpu(pingLvl, cpuLvl, posY, spec, cpu, fps) local fontScale = fontScaleHigh - gl_Texture(pics["pingPic"]) - local grayvalue - if spec then - grayvalue = 0.5 + (pingLvl / 20) - gl_Color(grayvalue, grayvalue, grayvalue, (0.2 * pingLvl)) - DrawRect(m_cpuping.posX + widgetPosX + (12*specScale), posY + (1*specScale), m_cpuping.posX + widgetPosX + (21*specScale), posY + (14*specScale)) - else - gl_Color(pingLevelData[pingLvl].r, pingLevelData[pingLvl].g, pingLevelData[pingLvl].b) - DrawRect(m_cpuping.posX + widgetPosX + (12*playerScale), posY + (1*playerScale), m_cpuping.posX + widgetPosX + (24*playerScale), posY + (15*playerScale)) - end - + gl_Texture(pics["pingPic"]) + local grayvalue + if spec then + grayvalue = 0.5 + (pingLvl / 20) + gl_Color(grayvalue, grayvalue, grayvalue, (0.2 * pingLvl)) + DrawRect(m_cpuping.posX + widgetPosX + (12 * specScale), posY + (1 * specScale), m_cpuping.posX + widgetPosX + (21 * specScale), posY + (14 * specScale)) + else + gl_Color(pingLevelData[pingLvl].r, pingLevelData[pingLvl].g, pingLevelData[pingLvl].b) + DrawRect(m_cpuping.posX + widgetPosX + (12 * playerScale), posY + (1 * playerScale), m_cpuping.posX + widgetPosX + (24 * playerScale), posY + (15 * playerScale)) + end - -- display user fps - font:Begin(true) + -- display user fps + font:Begin(true) font:SetOutlineColor(0.18, 0.18, 0.18, 1) - if fps ~= nil then - if fps > 99 then - fps = 99 - end - grayvalue = 0.88 - (mathMin(fps, 99) / 350) - if fps < 0 then - fps = 0 - greyvalue = 1 - end - if spec then - font:SetTextColor(grayvalue*0.7, grayvalue*0.7, grayvalue*0.7, 1) - font:Print(fps, m_cpuping.posX + widgetPosX + (11*specScale), posY + (5.3*playerScale), 9*specScale*fontScale, "ro") - else - font:SetTextColor(grayvalue, grayvalue, grayvalue, 1) - font:Print(fps, m_cpuping.posX + widgetPosX + (11*playerScale), posY + (5.3*playerScale), 9.5*playerScale*fontScale, "ro") - end - else - grayvalue = 0.7 + (cpu / 135) - gl_Texture(pics["cpuPic"]) - if spec then - gl_Color(grayvalue, grayvalue, grayvalue, 0.1 + (0.14 * cpuLvl)) - DrawRect(m_cpuping.posX + widgetPosX + (2*specScale), posY + (1*specScale), m_cpuping.posX + widgetPosX + (13*specScale), posY + (14*specScale*fontScale)) - else - gl_Color(pingLevelData[cpuLvl].r, pingLevelData[cpuLvl].g, pingLevelData[cpuLvl].b) - DrawRect(m_cpuping.posX + widgetPosX + (1*playerScale), posY + (1*playerScale), m_cpuping.posX + widgetPosX + (14*playerScale), posY + (15*playerScale*fontScale)) - end - gl_Color(1, 1, 1, 1) - end - font:End() + if fps ~= nil then + if fps > 99 then + fps = 99 + end + grayvalue = 0.88 - (mathMin(fps, 99) / 350) + if fps < 0 then + fps = 0 + greyvalue = 1 + end + if spec then + font:SetTextColor(grayvalue * 0.7, grayvalue * 0.7, grayvalue * 0.7, 1) + font:Print(fps, m_cpuping.posX + widgetPosX + (11 * specScale), posY + (5.3 * playerScale), 9 * specScale * fontScale, "ro") + else + font:SetTextColor(grayvalue, grayvalue, grayvalue, 1) + font:Print(fps, m_cpuping.posX + widgetPosX + (11 * playerScale), posY + (5.3 * playerScale), 9.5 * playerScale * fontScale, "ro") + end + else + grayvalue = 0.7 + (cpu / 135) + gl_Texture(pics["cpuPic"]) + if spec then + gl_Color(grayvalue, grayvalue, grayvalue, 0.1 + (0.14 * cpuLvl)) + DrawRect(m_cpuping.posX + widgetPosX + (2 * specScale), posY + (1 * specScale), m_cpuping.posX + widgetPosX + (13 * specScale), posY + (14 * specScale * fontScale)) + else + gl_Color(pingLevelData[cpuLvl].r, pingLevelData[cpuLvl].g, pingLevelData[cpuLvl].b) + DrawRect(m_cpuping.posX + widgetPosX + (1 * playerScale), posY + (1 * playerScale), m_cpuping.posX + widgetPosX + (14 * playerScale), posY + (15 * playerScale * fontScale)) + end + gl_Color(1, 1, 1, 1) + end + font:End() end function DrawPoint(posY, pointtime) - gl_Color(1, 0, 0, pointtime / pointDuration) - gl_Texture(pics["arrowPic"]) - DrawRect(widgetPosX - (18*playerScale), posY, widgetPosX - (2*playerScale), posY + (14*playerScale)) - gl_Color(1, 1, 1, pointtime / pointDuration) - gl_Texture(pics["pointPic"]) - DrawRect(widgetPosX - (33*playerScale), posY - (1*playerScale), widgetPosX - (17*playerScale), posY + (15*playerScale)) - gl_Color(1, 1, 1, 1) + gl_Color(1, 0, 0, pointtime / pointDuration) + gl_Texture(pics["arrowPic"]) + DrawRect(widgetPosX - (18 * playerScale), posY, widgetPosX - (2 * playerScale), posY + (14 * playerScale)) + gl_Color(1, 1, 1, pointtime / pointDuration) + gl_Texture(pics["pointPic"]) + DrawRect(widgetPosX - (33 * playerScale), posY - (1 * playerScale), widgetPosX - (17 * playerScale), posY + (15 * playerScale)) + gl_Color(1, 1, 1, 1) end function DrawPencil(posY, time) - leftPosX = widgetPosX + widgetWidth - gl_Color(1, 1, 1, (time / pencilDuration ) * 0.12) - gl_Texture(pics["pencilPic"]) - DrawRect(m_indent.posX + widgetPosX - 3.5, posY + (3*playerScale), m_indent.posX + widgetPosX - 1.5 + (8*playerScale), posY + (14*playerScale)) - gl_Color(1, 1, 1, 1) + leftPosX = widgetPosX + widgetWidth + gl_Color(1, 1, 1, (time / pencilDuration) * 0.12) + gl_Texture(pics["pencilPic"]) + DrawRect(m_indent.posX + widgetPosX - 3.5, posY + (3 * playerScale), m_indent.posX + widgetPosX - 1.5 + (8 * playerScale), posY + (14 * playerScale)) + gl_Color(1, 1, 1, 1) end function DrawEraser(posY, time) - leftPosX = widgetPosX + widgetWidth - gl_Color(1, 1, 1, (time / pencilDuration ) * 0.12) - gl_Texture(pics["eraserPic"]) - DrawRect(m_indent.posX + widgetPosX -0.5, posY + (3*playerScale), m_indent.posX + widgetPosX + 1.5 + (8*playerScale), posY + (14*playerScale)) - gl_Color(1, 1, 1, 1) + leftPosX = widgetPosX + widgetWidth + gl_Color(1, 1, 1, (time / pencilDuration) * 0.12) + gl_Texture(pics["eraserPic"]) + DrawRect(m_indent.posX + widgetPosX - 0.5, posY + (3 * playerScale), m_indent.posX + widgetPosX + 1.5 + (8 * playerScale), posY + (14 * playerScale)) + gl_Color(1, 1, 1, 1) end function TakeTip(mouseX) - if mouseX >= widgetPosX - 57 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then - tipText = Spring.I18N('ui.playersList.takeUnits') - tipTextTime = osClock() - end + if mouseX >= widgetPosX - 57 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then + tipText = Spring.I18N("ui.playersList.takeUnits") + tipTextTime = osClock() + end end function NameTip(mouseX, playerID, accountID, nameIsAlias) local pTip = player[playerID] - if accountID and mouseX >= widgetPosX + (m_name.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_name.posX + m_name.width) * widgetScale and WG.playernames then + if accountID and mouseX >= widgetPosX + (m_name.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_name.posX + m_name.width) * widgetScale and WG.playernames then if WG.playernames and not pTip.history then pTip.history = WG.playernames.getAccountHistory(accountID) or {} end if pTip.history and (nameIsAlias or #pTip.history > 1) then - local text = '' - local c = 0 + local text = "" + local c = 0 - local pname = Spring.GetPlayerInfo(playerID, false) + local pname = Spring.GetPlayerInfo(playerID, false) for i, name in ipairs(pTip.history) do if pTip.name ~= name then if c > 0 then - text = text .. '\n' + text = text .. "\n" + end + if name == pname then + text = text .. "> " + else + text = text .. " " end - if name == pname then - text = text .. '> ' - else - text = text .. ' ' - end text = text .. name - c = c + 1 + c = c + 1 end end if c > 0 then @@ -3239,153 +3210,153 @@ function NameTip(mouseX, playerID, accountID, nameIsAlias) end function ShareTip(mouseX, playerID) - if playerID == myPlayerID then - if mouseX >= widgetPosX + (m_share.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestSupport') - tipTextTime = osClock() - elseif mouseX >= widgetPosX + (m_share.posX + (19*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestEnergy') - tipTextTime = osClock() - elseif mouseX >= widgetPosX + (m_share.posX + (37*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.requestMetal') - tipTextTime = osClock() - end - else - if mouseX >= widgetPosX + (m_share.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareUnits') - tipTextTime = osClock() - elseif mouseX >= widgetPosX + (m_share.posX + (19*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareEnergy') - tipTextTime = osClock() - elseif mouseX >= widgetPosX + (m_share.posX + (37*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53*playerScale)) * widgetScale then - tipText = Spring.I18N('ui.playersList.shareMetal') - tipTextTime = osClock() - end - end + if playerID == myPlayerID then + if mouseX >= widgetPosX + (m_share.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.requestSupport") + tipTextTime = osClock() + elseif mouseX >= widgetPosX + (m_share.posX + (19 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.requestEnergy") + tipTextTime = osClock() + elseif mouseX >= widgetPosX + (m_share.posX + (37 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.requestMetal") + tipTextTime = osClock() + end + else + if mouseX >= widgetPosX + (m_share.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (17 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.shareUnits") + tipTextTime = osClock() + elseif mouseX >= widgetPosX + (m_share.posX + (19 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (35 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.shareEnergy") + tipTextTime = osClock() + elseif mouseX >= widgetPosX + (m_share.posX + (37 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_share.posX + (53 * playerScale)) * widgetScale then + tipText = Spring.I18N("ui.playersList.shareMetal") + tipTextTime = osClock() + end + end end function AllyTip(mouseX, playerID) - if mouseX >= widgetPosX + (m_alliance.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_alliance.posX + (11*playerScale)) * widgetScale then - if sp.AreTeamsAllied(player[playerID].team, myTeamID) then - tipText = Spring.I18N('ui.playersList.becomeEnemy') - tipTextTime = osClock() - else - tipText = Spring.I18N('ui.playersList.becomeAlly') - tipTextTime = osClock() - end - end + if mouseX >= widgetPosX + (m_alliance.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_alliance.posX + (11 * playerScale)) * widgetScale then + if sp.AreTeamsAllied(player[playerID].team, myTeamID) then + tipText = Spring.I18N("ui.playersList.becomeEnemy") + tipTextTime = osClock() + else + tipText = Spring.I18N("ui.playersList.becomeAlly") + tipTextTime = osClock() + end + end end function ResourcesTip(mouseX, energy, energyStorage, energyIncome, metal, metalStorage, metalIncome, name, teamID) - if mouseX >= widgetPosX + (m_resources.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_resources.posX + (m_resources.width*playerScale)) * widgetScale then - if energy > 1000 then - energy = mathFloor(energy / 100) * 100 - else - energy = mathFloor(energy / 10) * 10 - end - if metal > 1000 then - metal = mathFloor(metal / 100) * 100 - else - metal = mathFloor(metal / 10) * 10 - end - if energyIncome == nil then - energyIncome = 0 - metalIncome = 0 - end - energyIncome = mathFloor(energyIncome) - metalIncome = mathFloor(metalIncome) - if energyIncome > 1000 then - energyIncome = mathFloor(energyIncome / 100) * 100 - elseif energyIncome > 100 then - energyIncome = mathFloor(energyIncome / 10) * 10 - end - if metalIncome > 200 then - metalIncome = mathFloor(metalIncome / 10) * 10 - end - if energy >= 10000 then - energy = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energy / 1000) }) - end - if metal >= 10000 then - metal = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metal / 1000) }) - end - if energyIncome >= 10000 then - energyIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) - end - if metalIncome >= 10000 then - metalIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) - end - tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name - tipText = "\255\255\255\255+" .. metalIncome.. "\n\255\255\255\255" .. metal .. "\n\255\255\255\000" .. energy .. "\n\255\255\255\000+" .. energyIncome - tipTextTime = osClock() - end + if mouseX >= widgetPosX + (m_resources.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_resources.posX + (m_resources.width * playerScale)) * widgetScale then + if energy > 1000 then + energy = mathFloor(energy / 100) * 100 + else + energy = mathFloor(energy / 10) * 10 + end + if metal > 1000 then + metal = mathFloor(metal / 100) * 100 + else + metal = mathFloor(metal / 10) * 10 + end + if energyIncome == nil then + energyIncome = 0 + metalIncome = 0 + end + energyIncome = mathFloor(energyIncome) + metalIncome = mathFloor(metalIncome) + if energyIncome > 1000 then + energyIncome = mathFloor(energyIncome / 100) * 100 + elseif energyIncome > 100 then + energyIncome = mathFloor(energyIncome / 10) * 10 + end + if metalIncome > 200 then + metalIncome = mathFloor(metalIncome / 10) * 10 + end + if energy >= 10000 then + energy = Spring.I18N("ui.playersList.thousands", { number = mathFloor(energy / 1000) }) + end + if metal >= 10000 then + metal = Spring.I18N("ui.playersList.thousands", { number = mathFloor(metal / 1000) }) + end + if energyIncome >= 10000 then + energyIncome = Spring.I18N("ui.playersList.thousands", { number = mathFloor(energyIncome / 1000) }) + end + if metalIncome >= 10000 then + metalIncome = Spring.I18N("ui.playersList.thousands", { number = mathFloor(metalIncome / 1000) }) + end + tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name + tipText = "\255\255\255\255+" .. metalIncome .. "\n\255\255\255\255" .. metal .. "\n\255\255\255\000" .. energy .. "\n\255\255\255\000+" .. energyIncome + tipTextTime = osClock() + end end function IncomeTip(mouseX, energyIncome, metalIncome, name, teamID) - if mouseX >= widgetPosX + (m_income.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_income.posX + m_resources.width) * widgetScale then - if energyIncome == nil then - energyIncome = 0 - metalIncome = 0 - end - energyIncome = mathFloor(energyIncome) - metalIncome = mathFloor(metalIncome) - if energyIncome > 1000 then - energyIncome = mathFloor(energyIncome / 100) * 100 - elseif energyIncome > 100 then - energyIncome = mathFloor(energyIncome / 10) * 10 - end - if metalIncome > 200 then - metalIncome = mathFloor(metalIncome / 10) * 10 - end - if energyIncome >= 10000 then - energyIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(energyIncome / 1000) }) - end - if metalIncome >= 10000 then - metalIncome = Spring.I18N('ui.playersList.thousands', { number = mathFloor(metalIncome / 1000) }) - end - tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name - tipText = Spring.I18N('ui.playersList.resincome') .. "\n\255\255\255\000+" .. energyIncome .. "\n\255\255\255\255+" .. metalIncome - tipTextTime = osClock() - end + if mouseX >= widgetPosX + (m_income.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_income.posX + m_resources.width) * widgetScale then + if energyIncome == nil then + energyIncome = 0 + metalIncome = 0 + end + energyIncome = mathFloor(energyIncome) + metalIncome = mathFloor(metalIncome) + if energyIncome > 1000 then + energyIncome = mathFloor(energyIncome / 100) * 100 + elseif energyIncome > 100 then + energyIncome = mathFloor(energyIncome / 10) * 10 + end + if metalIncome > 200 then + metalIncome = mathFloor(metalIncome / 10) * 10 + end + if energyIncome >= 10000 then + energyIncome = Spring.I18N("ui.playersList.thousands", { number = mathFloor(energyIncome / 1000) }) + end + if metalIncome >= 10000 then + metalIncome = Spring.I18N("ui.playersList.thousands", { number = mathFloor(metalIncome / 1000) }) + end + tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name + tipText = Spring.I18N("ui.playersList.resincome") .. "\n\255\255\255\000+" .. energyIncome .. "\n\255\255\255\255+" .. metalIncome + tipTextTime = osClock() + end end function PingCpuTip(mouseX, pingLvl, cpuLvl, fps, gpumem, luamem, system, name, teamID, spec, apm) - if mouseX >= widgetPosX + (m_cpuping.posX + (13*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (23*playerScale)) * widgetScale then - if pingLvl < 2000 then - pingLvl = Spring.I18N('ui.playersList.milliseconds', { number = pingLvl }) - elseif pingLvl >= 2000 then - pingLvl = Spring.I18N('ui.playersList.seconds', { number = round(pingLvl / 1000, 0) }) - end - tipText = Spring.I18N('ui.playersList.commandDelay', { labelColor = "\255\190\190\190", delayColor = "\255\255\255\255", delay = pingLvl }) - tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name - tipTextTime = osClock() - elseif mouseX >= widgetPosX + (m_cpuping.posX + (1*playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (11*playerScale)) * widgetScale then - tipText = '' + if mouseX >= widgetPosX + (m_cpuping.posX + (13 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (23 * playerScale)) * widgetScale then + if pingLvl < 2000 then + pingLvl = Spring.I18N("ui.playersList.milliseconds", { number = pingLvl }) + elseif pingLvl >= 2000 then + pingLvl = Spring.I18N("ui.playersList.seconds", { number = round(pingLvl / 1000, 0) }) + end + tipText = Spring.I18N("ui.playersList.commandDelay", { labelColor = "\255\190\190\190", delayColor = "\255\255\255\255", delay = pingLvl }) + tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name + tipTextTime = osClock() + elseif mouseX >= widgetPosX + (m_cpuping.posX + (1 * playerScale)) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + (11 * playerScale)) * widgetScale then + tipText = "" if not spec and apm ~= nil then - tipText = tipText .. Spring.I18N('ui.playersList.apm', { apm = apm }) .."\n" + tipText = tipText .. Spring.I18N("ui.playersList.apm", { apm = apm }) .. "\n" end if fps ~= nil then - tipText = tipText .. Spring.I18N('ui.playersList.framerate', { fps = fps }) - end - tipText = tipText .. " " .. Spring.I18N('ui.playersList.cpu', { cpuUsage = cpuLvl }) - if gpumem ~= nil then - tipText = tipText .. " " .. Spring.I18N('ui.playersList.gpuMemory', { gpuUsage = gpumem }) - end - if luamem ~= nil then - tipText = tipText .. " Lua: " .. luamem .. "MB\n" - end - tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name - if system ~= nil then - tipText = tipText .. system - end - tipTextTime = osClock() - end + tipText = tipText .. Spring.I18N("ui.playersList.framerate", { fps = fps }) + end + tipText = tipText .. " " .. Spring.I18N("ui.playersList.cpu", { cpuUsage = cpuLvl }) + if gpumem ~= nil then + tipText = tipText .. " " .. Spring.I18N("ui.playersList.gpuMemory", { gpuUsage = gpumem }) + end + if luamem ~= nil then + tipText = tipText .. " Lua: " .. luamem .. "MB\n" + end + tipTextTitle = (spec and "\255\240\240\240" or colourNames(teamID)) .. name + if system ~= nil then + tipText = tipText .. system + end + tipTextTime = osClock() + end end function PointTip(mouseX) - if mouseX >= widgetPosX - 28 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then - tipText = Spring.I18N('ui.playersList.pointClickTooltip') - tipTextTime = osClock() - end + if mouseX >= widgetPosX - 28 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then + tipText = Spring.I18N("ui.playersList.pointClickTooltip") + tipTextTime = osClock() + end end --------------------------------------------------------------------------------------------------- @@ -3393,55 +3364,67 @@ end --------------------------------------------------------------------------------------------------- function CreateShareSlider() - if ShareSlider then - gl_DeleteList(ShareSlider) - end - - ShareSlider = gl_CreateList(function() - gl_Color(1,1,1,1) - if sliderPosition then - font:Begin(true) - local posY - if energyPlayer ~= nil then - posY = widgetPosY + widgetHeight - energyPlayer.posY - gl_Texture(pics["barPic"]) - DrawRect(m_share.posX + widgetPosX + (16*playerScale), posY - (3*playerScale), m_share.posX + widgetPosX + (34*playerScale), posY + shareSliderHeight + (18*playerScale)) - gl_Texture(pics["energyPic"]) - DrawRect(m_share.posX + widgetPosX + (17*playerScale), posY + sliderPosition, m_share.posX + widgetPosX + (33*playerScale), posY + (16*playerScale) + sliderPosition) - gl_Texture(false) - gl_Color(0.45,0.45,0.45,1) - RectRound(mathFloor(m_share.posX + widgetPosX - (28*playerScale)), mathFloor(posY - 1 + sliderPosition), mathFloor(m_share.posX + widgetPosX + (19*playerScale)), mathFloor(posY + (17*playerScale) + sliderPosition), 2.5*playerScale) - font:Print("\255\255\255\255"..shareAmount, m_share.posX + widgetPosX - (5*playerScale), posY + (3*playerScale) + sliderPosition, 14, "ocn") - elseif metalPlayer ~= nil then - posY = widgetPosY + widgetHeight - metalPlayer.posY - gl_Texture(pics["barPic"]) - DrawRect(m_share.posX + widgetPosX + (32*playerScale), posY - 3, m_share.posX + widgetPosX + (50*playerScale), posY + shareSliderHeight + (18*playerScale)) - gl_Texture(pics["metalPic"]) - DrawRect(m_share.posX + widgetPosX + (33*playerScale), posY + sliderPosition, m_share.posX + widgetPosX + (49*playerScale), posY + (16*playerScale) + sliderPosition) - gl_Texture(false) - gl_Color(0.45,0.45,0.45,1) - RectRound(mathFloor(m_share.posX + widgetPosX - (12*playerScale)), mathFloor(posY - 1 + sliderPosition), mathFloor(m_share.posX + widgetPosX + (35*playerScale)), mathFloor(posY + (17*playerScale) + sliderPosition), 2.5*playerScale) - font:Print("\255\255\255\255"..shareAmount, m_share.posX + widgetPosX + (11*playerScale), posY + (3*playerScale) + sliderPosition, 14, "ocn") - end - font:End() - end - end) + if ShareSlider then + gl_DeleteList(ShareSlider) + end + + ShareSlider = gl_CreateList(function() + gl_Color(1, 1, 1, 1) + if sliderPosition then + font:Begin(true) + local posY + if energyPlayer ~= nil then + posY = widgetPosY + widgetHeight - energyPlayer.posY + gl_Texture(pics["barPic"]) + DrawRect(m_share.posX + widgetPosX + (16 * playerScale), posY - (3 * playerScale), m_share.posX + widgetPosX + (34 * playerScale), posY + shareSliderHeight + (18 * playerScale)) + gl_Texture(pics["energyPic"]) + DrawRect(m_share.posX + widgetPosX + (17 * playerScale), posY + sliderPosition, m_share.posX + widgetPosX + (33 * playerScale), posY + (16 * playerScale) + sliderPosition) + gl_Texture(false) + gl_Color(0.45, 0.45, 0.45, 1) + RectRound(mathFloor(m_share.posX + widgetPosX - (28 * playerScale)), mathFloor(posY - 1 + sliderPosition), mathFloor(m_share.posX + widgetPosX + (19 * playerScale)), mathFloor(posY + (17 * playerScale) + sliderPosition), 2.5 * playerScale) + font:Print("\255\255\255\255" .. shareAmount, m_share.posX + widgetPosX - (5 * playerScale), posY + (3 * playerScale) + sliderPosition, 14, "ocn") + elseif metalPlayer ~= nil then + posY = widgetPosY + widgetHeight - metalPlayer.posY + gl_Texture(pics["barPic"]) + DrawRect(m_share.posX + widgetPosX + (32 * playerScale), posY - 3, m_share.posX + widgetPosX + (50 * playerScale), posY + shareSliderHeight + (18 * playerScale)) + gl_Texture(pics["metalPic"]) + DrawRect(m_share.posX + widgetPosX + (33 * playerScale), posY + sliderPosition, m_share.posX + widgetPosX + (49 * playerScale), posY + (16 * playerScale) + sliderPosition) + gl_Texture(false) + gl_Color(0.45, 0.45, 0.45, 1) + RectRound(mathFloor(m_share.posX + widgetPosX - (12 * playerScale)), mathFloor(posY - 1 + sliderPosition), mathFloor(m_share.posX + widgetPosX + (35 * playerScale)), mathFloor(posY + (17 * playerScale) + sliderPosition), 2.5 * playerScale) + font:Print("\255\255\255\255" .. shareAmount, m_share.posX + widgetPosX + (11 * playerScale), posY + (3 * playerScale) + sliderPosition, 14, "ocn") + end + font:End() + end + end) end function GetCpuLvl(cpuUsage) - if cpuUsage < pingLevelData[1].cpuThreshold then return 1 - elseif cpuUsage < pingLevelData[2].cpuThreshold then return 2 - elseif cpuUsage < pingLevelData[3].cpuThreshold then return 3 - elseif cpuUsage < pingLevelData[4].cpuThreshold then return 4 - else return 5 end + if cpuUsage < pingLevelData[1].cpuThreshold then + return 1 + elseif cpuUsage < pingLevelData[2].cpuThreshold then + return 2 + elseif cpuUsage < pingLevelData[3].cpuThreshold then + return 3 + elseif cpuUsage < pingLevelData[4].cpuThreshold then + return 4 + else + return 5 + end end function GetPingLvl(ping) - if ping < pingLevelData[1].pingThreshold then return 1 - elseif ping < pingLevelData[2].pingThreshold then return 2 - elseif ping < pingLevelData[3].pingThreshold then return 3 - elseif ping < pingLevelData[4].pingThreshold then return 4 - else return 5 end + if ping < pingLevelData[1].pingThreshold then + return 1 + elseif ping < pingLevelData[2].pingThreshold then + return 2 + elseif ping < pingLevelData[3].pingThreshold then + return 3 + elseif ping < pingLevelData[4].pingThreshold then + return 4 + else + return 5 + end end --------------------------------------------------------------------------------------------------- @@ -3449,333 +3432,330 @@ end --------------------------------------------------------------------------------------------------- function widget:MousePress(x, y, button) - --super ugly code here - local t = false -- true if the object is a team leader - local clickedPlayer - local posY - local clickTime = osClock() - - if IsOnRect(x, y, apiAbsPosition[2], apiAbsPosition[3], apiAbsPosition[4], apiAbsPosition[1]) then - forceMainListRefresh = true - end - - if button == 1 then - local alt, ctrl, meta, shift = Spring.GetModKeyState() - sliderPosition = nil - shareAmount = 0 - - -- spectators label onclick - posY = widgetPosY + widgetHeight - specsLabelOffset - if numberOfSpecs > 0 and IsOnRect(x, y, widgetPosX + 2, posY + 2, widgetPosX + widgetWidth - 2, posY + 20) then - specListShow = not specListShow - SortList() - SetModulesPositionX() --why? - CreateLists() - return true - end - - -- enemies label onclick - posY = widgetPosY + widgetHeight - enemyLabelOffset - if numberOfEnemies > 0 and IsOnRect(x, y, widgetPosX + 2, posY + 2, widgetPosX + widgetWidth - 2, posY + 20) then - enemyListShow = not enemyListShow - enemyListShowUserPref = enemyListShow -- User explicitly toggled, update preference - SortList() - SetModulesPositionX() --why? - CreateLists() - return true - end - - for _, i in ipairs(drawList) do - -- i = object # - if i > -1 then - clickedPlayer = player[i] - clickedPlayer.id = i - posY = widgetPosY + widgetHeight - (clickedPlayer.posY or 0) - end - - if mySpecStatus then - if i == -1 then - t = true - else - t = false - if m_point.active then - if i > -1 and i < specOffset then - if clickedPlayer.pointTime ~= nil then - if IsOnRect(x, y, widgetPosX - 33, posY - 2, widgetPosX - 17, posY + (playerOffset*playerScale)) then - --point button - Spring.SetCameraTarget(clickedPlayer.pointX, clickedPlayer.pointY, clickedPlayer.pointZ, 1) - return true - end - end - end - end - end - if i > -1 then -- and i < specOffset - if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset*playerScale)) then - if ctrl and i < specOffset then - sp.SendCommands("toggleignore " .. (clickedPlayer.accountID and clickedPlayer.accountID or clickedPlayer.name)) - return true - elseif alt and not clickedPlayer.ai then - -- ALT+click: track player camera in PIP - -- Try other PIPs first before cycling back to the last used one - for offset = 1, 5 do - local pipNum = ((lastUsedPipNum + offset - 1) % 5) + 1 - if WG['pip'..pipNum] and WG['pip'..pipNum].TrackPlayer then - if WG['pip'..pipNum].TrackPlayer(i) then - lastUsedPipNum = pipNum - return true - end - end - end - return true - elseif not player[i].spec then - if i ~= myTeamPlayerID then - clickedPlayerTime = osClock() - clickedPlayerID = clickedPlayer.id - -- handled in Update() after dblclick delay - end - end - - if i < specOffset and (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedPlayer == prevClickedPlayer then - clickedPlayerTime = nil - clickedPlayerID = nil - LockCamera(i) - prevClickedPlayer = {} - SortList() - CreateLists() - return true - end - prevClickedPlayer = clickedPlayer - end - end - - else - if t then - if clickedPlayer.allyteam == myAllyTeamID then - if m_take.active then - if clickedPlayer.totake then - if IsOnRect(x, y, widgetPosX - 57, posY, widgetPosX - 12, posY + 17) then - --take button - Take(clickedPlayer.team, clickedPlayer.orgname or clickedPlayer.name, i) - return true - end - end - end - if m_share.active and clickedPlayer.dead ~= true and not hideShareIcons then - if IsOnRect(x, y, m_share.posX + widgetPosX + (1*playerScale), posY, m_share.posX + widgetPosX + (17*playerScale), posY + (playerOffset*playerScale)) then - -- share units button - if release ~= nil then - if release >= now then - if clickedPlayer.team == myTeamID then - --sp.SendCommands("say a: " .. Spring.I18N('ui.playersList.chat.needSupport')) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.needSupport') - else - sp.ShareResources(clickedPlayer.team, "units") - Spring.PlaySoundFile("beep4", 1, 'ui') - end - end - release = nil - else - firstclick = now + 1 - end - return true - end - if IsOnRect(x, y, m_share.posX + widgetPosX + (17*playerScale), posY, m_share.posX + widgetPosX + (33*playerScale), posY + (playerOffset*playerScale)) then - -- share energy button (initiates the slider) - energyPlayer = clickedPlayer - return true - end - if IsOnRect(x, y, m_share.posX + widgetPosX + (33*playerScale), posY, m_share.posX + widgetPosX + (49*playerScale), posY + (playerOffset*playerScale)) then - -- share metal button (initiates the slider) - metalPlayer = clickedPlayer - return true - end - end - end - end - if i == -1 then - t = true - else - t = false - if i > -1 and i < specOffset then - --chat button - if m_chat.active then - if IsOnRect(x, y, m_chat.posX + widgetPosX + 1, posY, m_chat.posX + widgetPosX + 17, posY + (playerOffset*playerScale)) then - sp.SendCommands("chatall", "pastetext /w " .. clickedPlayer.name .. ' \1') - return true - end - end - --ally button - if m_alliance.active and drawAllyButton and not mySpecStatus and player[i] ~= nil and player[i].dead ~= true and i ~= myPlayerID then - if IsOnRect(x, y, m_alliance.posX + widgetPosX + 1, posY, m_alliance.posX + widgetPosX + m_alliance.width, posY + (playerOffset*playerScale)) then - if sp.AreTeamsAllied(player[i].team, myTeamID) then - sp.SendCommands("ally " .. player[i].allyteam .. " 0") - else - sp.SendCommands("ally " .. player[i].allyteam .. " 1") - end - return true - end - end - --point - if m_point.active then - if clickedPlayer.pointTime ~= nil then - if clickedPlayer.allyteam == myAllyTeamID then - if IsOnRect(x, y, widgetPosX - 28, posY - 1, widgetPosX - 12, posY + 17) then - Spring.SetCameraTarget(clickedPlayer.pointX, clickedPlayer.pointY, clickedPlayer.pointZ, 1) - return true - end - end - end - end - --name - if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, m_name.posX + widgetPosX + 1, posY, m_name.posX + widgetPosX + m_name.width, posY + 12) then - if ctrl then - sp.SendCommands("toggleignore " .. (clickedPlayer.accountID and clickedPlayer.accountID or clickedPlayer.name)) - return true - end - if alt and not clickedPlayer.ai then - -- ALT+click: track player camera in PIP - -- Try other PIPs first before cycling back to the last used one - for offset = 1, 5 do - local pipNum = ((lastUsedPipNum + offset - 1) % 5) + 1 - if WG['pip'..pipNum] and WG['pip'..pipNum].TrackPlayer then - if WG['pip'..pipNum].TrackPlayer(i) then - lastUsedPipNum = pipNum - return true - end - end - end - return true - end - if (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedPlayer == prevClickedPlayer then - LockCamera(clickedPlayer.team) - prevClickedPlayer = {} - return true - end - prevClickedPlayer = clickedPlayer - end - end - end - end - end - end - prevClickTime = clickTime - if hoverPlayerlist then - return true - end + --super ugly code here + local t = false -- true if the object is a team leader + local clickedPlayer + local posY + local clickTime = osClock() + + if IsOnRect(x, y, apiAbsPosition[2], apiAbsPosition[3], apiAbsPosition[4], apiAbsPosition[1]) then + forceMainListRefresh = true + end + + if button == 1 then + local alt, ctrl, meta, shift = Spring.GetModKeyState() + sliderPosition = nil + shareAmount = 0 + + -- spectators label onclick + posY = widgetPosY + widgetHeight - specsLabelOffset + if numberOfSpecs > 0 and IsOnRect(x, y, widgetPosX + 2, posY + 2, widgetPosX + widgetWidth - 2, posY + 20) then + specListShow = not specListShow + SortList() + SetModulesPositionX() --why? + CreateLists() + return true + end + + -- enemies label onclick + posY = widgetPosY + widgetHeight - enemyLabelOffset + if numberOfEnemies > 0 and IsOnRect(x, y, widgetPosX + 2, posY + 2, widgetPosX + widgetWidth - 2, posY + 20) then + enemyListShow = not enemyListShow + enemyListShowUserPref = enemyListShow -- User explicitly toggled, update preference + SortList() + SetModulesPositionX() --why? + CreateLists() + return true + end + + for _, i in ipairs(drawList) do + -- i = object # + if i > -1 then + clickedPlayer = player[i] + clickedPlayer.id = i + posY = widgetPosY + widgetHeight - (clickedPlayer.posY or 0) + end + + if mySpecStatus then + if i == -1 then + t = true + else + t = false + if m_point.active then + if i > -1 and i < specOffset then + if clickedPlayer.pointTime ~= nil then + if IsOnRect(x, y, widgetPosX - 33, posY - 2, widgetPosX - 17, posY + (playerOffset * playerScale)) then + --point button + Spring.SetCameraTarget(clickedPlayer.pointX, clickedPlayer.pointY, clickedPlayer.pointZ, 1) + return true + end + end + end + end + end + if i > -1 then -- and i < specOffset + if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset * playerScale)) then + if ctrl and i < specOffset then + sp.SendCommands("toggleignore " .. (clickedPlayer.accountID and clickedPlayer.accountID or clickedPlayer.name)) + return true + elseif alt and not clickedPlayer.ai then + -- ALT+click: track player camera in PIP + -- Try other PIPs first before cycling back to the last used one + for offset = 1, 5 do + local pipNum = ((lastUsedPipNum + offset - 1) % 5) + 1 + if WG["pip" .. pipNum] and WG["pip" .. pipNum].TrackPlayer then + if WG["pip" .. pipNum].TrackPlayer(i) then + lastUsedPipNum = pipNum + return true + end + end + end + return true + elseif not player[i].spec then + if i ~= myTeamPlayerID then + clickedPlayerTime = osClock() + clickedPlayerID = clickedPlayer.id + -- handled in Update() after dblclick delay + end + end + + if i < specOffset and (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedPlayer == prevClickedPlayer then + clickedPlayerTime = nil + clickedPlayerID = nil + LockCamera(i) + prevClickedPlayer = {} + SortList() + CreateLists() + return true + end + prevClickedPlayer = clickedPlayer + end + end + else + if t then + if clickedPlayer.allyteam == myAllyTeamID then + if m_take.active then + if clickedPlayer.totake then + if IsOnRect(x, y, widgetPosX - 57, posY, widgetPosX - 12, posY + 17) then + --take button + Take(clickedPlayer.team, clickedPlayer.orgname or clickedPlayer.name, i) + return true + end + end + end + if m_share.active and clickedPlayer.dead ~= true and not hideShareIcons then + if IsOnRect(x, y, m_share.posX + widgetPosX + (1 * playerScale), posY, m_share.posX + widgetPosX + (17 * playerScale), posY + (playerOffset * playerScale)) then + -- share units button + if release ~= nil then + if release >= now then + if clickedPlayer.team == myTeamID then + --sp.SendCommands("say a: " .. Spring.I18N('ui.playersList.chat.needSupport')) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.needSupport") + else + sp.ShareResources(clickedPlayer.team, "units") + Spring.PlaySoundFile("beep4", 1, "ui") + end + end + release = nil + else + firstclick = now + 1 + end + return true + end + if IsOnRect(x, y, m_share.posX + widgetPosX + (17 * playerScale), posY, m_share.posX + widgetPosX + (33 * playerScale), posY + (playerOffset * playerScale)) then + -- share energy button (initiates the slider) + energyPlayer = clickedPlayer + return true + end + if IsOnRect(x, y, m_share.posX + widgetPosX + (33 * playerScale), posY, m_share.posX + widgetPosX + (49 * playerScale), posY + (playerOffset * playerScale)) then + -- share metal button (initiates the slider) + metalPlayer = clickedPlayer + return true + end + end + end + end + if i == -1 then + t = true + else + t = false + if i > -1 and i < specOffset then + --chat button + if m_chat.active then + if IsOnRect(x, y, m_chat.posX + widgetPosX + 1, posY, m_chat.posX + widgetPosX + 17, posY + (playerOffset * playerScale)) then + sp.SendCommands("chatall", "pastetext /w " .. clickedPlayer.name .. " \1") + return true + end + end + --ally button + if m_alliance.active and drawAllyButton and not mySpecStatus and player[i] ~= nil and player[i].dead ~= true and i ~= myPlayerID then + if IsOnRect(x, y, m_alliance.posX + widgetPosX + 1, posY, m_alliance.posX + widgetPosX + m_alliance.width, posY + (playerOffset * playerScale)) then + if sp.AreTeamsAllied(player[i].team, myTeamID) then + sp.SendCommands("ally " .. player[i].allyteam .. " 0") + else + sp.SendCommands("ally " .. player[i].allyteam .. " 1") + end + return true + end + end + --point + if m_point.active then + if clickedPlayer.pointTime ~= nil then + if clickedPlayer.allyteam == myAllyTeamID then + if IsOnRect(x, y, widgetPosX - 28, posY - 1, widgetPosX - 12, posY + 17) then + Spring.SetCameraTarget(clickedPlayer.pointX, clickedPlayer.pointY, clickedPlayer.pointZ, 1) + return true + end + end + end + end + --name + if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, m_name.posX + widgetPosX + 1, posY, m_name.posX + widgetPosX + m_name.width, posY + 12) then + if ctrl then + sp.SendCommands("toggleignore " .. (clickedPlayer.accountID and clickedPlayer.accountID or clickedPlayer.name)) + return true + end + if alt and not clickedPlayer.ai then + -- ALT+click: track player camera in PIP + -- Try other PIPs first before cycling back to the last used one + for offset = 1, 5 do + local pipNum = ((lastUsedPipNum + offset - 1) % 5) + 1 + if WG["pip" .. pipNum] and WG["pip" .. pipNum].TrackPlayer then + if WG["pip" .. pipNum].TrackPlayer(i) then + lastUsedPipNum = pipNum + return true + end + end + end + return true + end + if (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedPlayer == prevClickedPlayer then + LockCamera(clickedPlayer.team) + prevClickedPlayer = {} + return true + end + prevClickedPlayer = clickedPlayer + end + end + end + end + end + end + prevClickTime = clickTime + if hoverPlayerlist then + return true + end end function widget:MouseMove(x, y, dx, dy, button) - if energyPlayer ~= nil or metalPlayer ~= nil then - -- move energy/metal share slider - if sliderOrigin == nil then - sliderOrigin = y - end - sliderPosition = (y - sliderOrigin) * (1 / widgetScale) - if sliderPosition < 0 then - sliderPosition = 0 - end - if sliderPosition > shareSliderHeight then - sliderPosition = shareSliderHeight - end - local prevAmountEM = shareAmount - UpdateResources() - if playSounds and (lastSliderSound == nil or osClock() - lastSliderSound > 0.05) and shareAmount ~= prevAmountEM then - lastSliderSound = osClock() - Spring.PlaySoundFile(sliderdrag, 0.3, 'ui') - end - end + if energyPlayer ~= nil or metalPlayer ~= nil then + -- move energy/metal share slider + if sliderOrigin == nil then + sliderOrigin = y + end + sliderPosition = (y - sliderOrigin) * (1 / widgetScale) + if sliderPosition < 0 then + sliderPosition = 0 + end + if sliderPosition > shareSliderHeight then + sliderPosition = shareSliderHeight + end + local prevAmountEM = shareAmount + UpdateResources() + if playSounds and (lastSliderSound == nil or osClock() - lastSliderSound > 0.05) and shareAmount ~= prevAmountEM then + lastSliderSound = osClock() + Spring.PlaySoundFile(sliderdrag, 0.3, "ui") + end + end end function widget:MouseRelease(x, y, button) - if button == 1 then - if firstclick ~= nil then - -- double click system for share units - release = firstclick - firstclick = nil - else - release = nil - end - if energyPlayer ~= nil then - -- share energy/metal mouse release - if energyPlayer.team == myTeamID then - Spring.SendLuaUIMsg('alert:allyRequest:energy', 'allies') - if shareAmount == 0 then - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needEnergy')) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.needEnergy') - else - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needEnergyAmount', { amount = shareAmount })) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.needEnergyAmount:amount='..shareAmount) - end - elseif shareAmount > 0 then - sp.ShareResources(energyPlayer.team, "energy", shareAmount) - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.giveEnergy', { amount = shareAmount, name = energyPlayer.name })) - if sharingTax and sharingTax > 0 then - local amount2 = mathFloor(shareAmount * (1- sharingTax)) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.giveEnergy_taxed:amount='..shareAmount..':name='..(energyPlayer.orgname or energyPlayer.name)..':amount2='..amount2) - else - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.giveEnergy:amount='..shareAmount..':name='..(energyPlayer.orgname or energyPlayer.name)) - end - WG.sharedEnergyFrame = spGetGameFrame() - end - sliderOrigin = nil - maxShareAmount = nil - sliderPosition = nil - shareAmount = nil - energyPlayer = nil - end - - if metalPlayer ~= nil and shareAmount then - if metalPlayer.team == myTeamID then - Spring.SendLuaUIMsg('alert:allyRequest:metal', 'allies') - if shareAmount == 0 then - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needMetal')) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.needMetal') - else - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needMetalAmount', { amount = shareAmount })) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.needMetalAmount:amount='..shareAmount) - end - elseif shareAmount > 0 then - sp.ShareResources(metalPlayer.team, "metal", shareAmount) - --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.giveMetal', { amount = shareAmount, name = metalPlayer.name })) - if sharingTax and sharingTax > 0 then - local amount2 = mathFloor(shareAmount * (1- sharingTax)) - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.giveMetal_taxed:amount='..shareAmount..':name='..(metalPlayer.orgname or metalPlayer.name)..':amount2='..amount2) - else - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.giveMetal:amount='..shareAmount..':name='..(metalPlayer.orgname or metalPlayer.name)) - end - WG.sharedMetalFrame = spGetGameFrame() - end - sliderOrigin = nil - maxShareAmount = nil - sliderPosition = nil - shareAmount = nil - metalPlayer = nil - end - end + if button == 1 then + if firstclick ~= nil then + -- double click system for share units + release = firstclick + firstclick = nil + else + release = nil + end + if energyPlayer ~= nil then + -- share energy/metal mouse release + if energyPlayer.team == myTeamID then + Spring.SendLuaUIMsg("alert:allyRequest:energy", "allies") + if shareAmount == 0 then + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needEnergy')) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.needEnergy") + else + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needEnergyAmount', { amount = shareAmount })) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.needEnergyAmount:amount=" .. shareAmount) + end + elseif shareAmount > 0 then + sp.ShareResources(energyPlayer.team, "energy", shareAmount) + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.giveEnergy', { amount = shareAmount, name = energyPlayer.name })) + if sharingTax and sharingTax > 0 then + local amount2 = mathFloor(shareAmount * (1 - sharingTax)) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.giveEnergy_taxed:amount=" .. shareAmount .. ":name=" .. (energyPlayer.orgname or energyPlayer.name) .. ":amount2=" .. amount2) + else + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.giveEnergy:amount=" .. shareAmount .. ":name=" .. (energyPlayer.orgname or energyPlayer.name)) + end + WG.sharedEnergyFrame = spGetGameFrame() + end + sliderOrigin = nil + maxShareAmount = nil + sliderPosition = nil + shareAmount = nil + energyPlayer = nil + end + + if metalPlayer ~= nil and shareAmount then + if metalPlayer.team == myTeamID then + Spring.SendLuaUIMsg("alert:allyRequest:metal", "allies") + if shareAmount == 0 then + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needMetal')) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.needMetal") + else + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.needMetalAmount', { amount = shareAmount })) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.needMetalAmount:amount=" .. shareAmount) + end + elseif shareAmount > 0 then + sp.ShareResources(metalPlayer.team, "metal", shareAmount) + --sp.SendCommands("say a:" .. Spring.I18N('ui.playersList.chat.giveMetal', { amount = shareAmount, name = metalPlayer.name })) + if sharingTax and sharingTax > 0 then + local amount2 = mathFloor(shareAmount * (1 - sharingTax)) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.giveMetal_taxed:amount=" .. shareAmount .. ":name=" .. (metalPlayer.orgname or metalPlayer.name) .. ":amount2=" .. amount2) + else + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.giveMetal:amount=" .. shareAmount .. ":name=" .. (metalPlayer.orgname or metalPlayer.name)) + end + WG.sharedMetalFrame = spGetGameFrame() + end + sliderOrigin = nil + maxShareAmount = nil + sliderPosition = nil + shareAmount = nil + metalPlayer = nil + end + end end function Spec(teamID) - local oldMapDrawMode = Spring.GetMapDrawMode() - sp.SendCommands("specteam " .. teamID) - -- restore current los drawmode (doing specteam makes it non normal non los view) - local newMapDrawMode = Spring.GetMapDrawMode() - if oldMapDrawMode == 'los' and oldMapDrawMode ~= newMapDrawMode then - Spring.SendCommands("togglelos") - end - SortList() + local oldMapDrawMode = Spring.GetMapDrawMode() + sp.SendCommands("specteam " .. teamID) + -- restore current los drawmode (doing specteam makes it non normal non los view) + local newMapDrawMode = Spring.GetMapDrawMode() + if oldMapDrawMode == "los" and oldMapDrawMode ~= newMapDrawMode then + Spring.SendCommands("togglelos") + end + SortList() end function IsOnRect(x, y, BLcornerX, BLcornerY, TRcornerX, TRcornerY) - -- calc scale offset - BLcornerX = BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale - 1)) - BLcornerY = BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale - 1)) - TRcornerX = TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale - 1)) - TRcornerY = TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale - 1)) - - return x >= BLcornerX and x <= TRcornerX - and y >= BLcornerY - and y <= TRcornerY + -- calc scale offset + BLcornerX = BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale - 1)) + BLcornerY = BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale - 1)) + TRcornerX = TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale - 1)) + TRcornerY = TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale - 1)) + + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY end --------------------------------------------------------------------------------------------------- @@ -3784,140 +3764,139 @@ end local version = 1 function widget:GetConfigData() - -- save - if m_name ~= nil then - local m_active_Table = {} - for n, module in pairs(modules) do - m_active_Table[module.name] = module.active - end - - - local settings = { - --view - customScale = customScale, - vsx = vsx, - vsy = vsy, - widgetRelRight = widgetRelRight, - widgetPosX = widgetPosX, - widgetPosY = widgetPosY, - widgetRight = widgetRight, - widgetTop = widgetTop, - expandDown = expandDown, - expandLeft = expandLeft, - m_pointActive = m_point.active, - m_takeActive = m_take.active, - m_active_Table = m_active_Table, - specListShow = specListShow, - enemyListShow = enemyListShowUserPref, -- Save user preference, not auto-disabled state - gameFrame = spGetGameFrame(), - lastSystemData = lastSystemData, - alwaysHideSpecs = alwaysHideSpecs, - transitionTime = transitionTime, - hasresetskill = true, - absoluteResbarValues = absoluteResbarValues, - originalColourNames = originalColourNames, + -- save + if m_name ~= nil then + local m_active_Table = {} + for n, module in pairs(modules) do + m_active_Table[module.name] = module.active + end + + local settings = { + --view + customScale = customScale, + vsx = vsx, + vsy = vsy, + widgetRelRight = widgetRelRight, + widgetPosX = widgetPosX, + widgetPosY = widgetPosY, + widgetRight = widgetRight, + widgetTop = widgetTop, + expandDown = expandDown, + expandLeft = expandLeft, + m_pointActive = m_point.active, + m_takeActive = m_take.active, + m_active_Table = m_active_Table, + specListShow = specListShow, + enemyListShow = enemyListShowUserPref, -- Save user preference, not auto-disabled state + gameFrame = spGetGameFrame(), + lastSystemData = lastSystemData, + alwaysHideSpecs = alwaysHideSpecs, + transitionTime = transitionTime, + hasresetskill = true, + absoluteResbarValues = absoluteResbarValues, + originalColourNames = originalColourNames, version = version, - } + } - return settings - end + return settings + end end function widget:SetConfigData(data) - if data.customScale ~= nil then - customScale = data.customScale - end - - if data.specListShow ~= nil then - specListShow = data.specListShow - end - - if data.absoluteResbarValues ~= nil then - absoluteResbarValues = data.absoluteResbarValues - end - - if data.enemyListShow ~= nil then - enemyListShow = data.enemyListShow - enemyListShowUserPref = data.enemyListShow -- Restore user preference - end - - if data.version ~= nil and data.alwaysHideSpecs ~= nil then - alwaysHideSpecs = data.alwaysHideSpecs - end - - --view - if data.expandDown ~= nil and data.widgetRight ~= nil then - expandDown = data.expandDown - expandLeft = data.expandLeft - local oldvsx = data.vsx - local oldvsy = data.vsy - if oldvsx == nil then - oldvsx = vsx - oldvsy = vsy - end - local dy = vsy - oldvsy - if expandDown then - widgetTop = data.widgetTop + dy - if widgetTop > vsy then - widgetTop = vsy - end - else - widgetPosY = data.widgetPosY - end - if expandLeft then - widgetRelRight = data.widgetRelRight or 0 - widgetRight = vsx - (widgetWidth * (widgetScale - 1)) - widgetRelRight --align right of widget to right of screen - widgetPosX = widgetRight - (widgetWidth * widgetScale) - if widgetRight > vsx then - widgetRight = vsx - end - else - widgetPosX = data.widgetPosX --align left of widget to left of screen - end - end - - if spGetGameFrame() > 0 then - if data.originalColourNames then - originalColourNames = data.originalColourNames - end - end - - --not technically modules - m_point.active = true -- m_point.default doesnt work - if data.m_pointActive ~= nil then - m_point.active = data.m_pointActive - end - m_take.active = true -- m_take.default doesnt work - if data.m_takeActive ~= nil then - m_take.active = data.m_takeActive - end - - local m_active_Table = data.m_active_Table or {} - for name, active in pairs(m_active_Table) do - for _, module in pairs(modules) do - if module.name == name then - if name == "ally" then - -- needs to be always active (some aready stored it as false before, this makes sure its corrected) - module.active = true - else - module.active = module.default - if active ~= nil then - module.active = active - end - end - end - end - end - - if not data.hasresetskill then - m_skill.active = false - end - - SetModulesPositionX() - - if data.lastSystemData ~= nil and data.gameFrame ~= nil and data.gameFrame <= spGetGameFrame() and data.gameFrame > spGetGameFrame() - 300 then - lastSystemData = data.lastSystemData - end + if data.customScale ~= nil then + customScale = data.customScale + end + + if data.specListShow ~= nil then + specListShow = data.specListShow + end + + if data.absoluteResbarValues ~= nil then + absoluteResbarValues = data.absoluteResbarValues + end + + if data.enemyListShow ~= nil then + enemyListShow = data.enemyListShow + enemyListShowUserPref = data.enemyListShow -- Restore user preference + end + + if data.version ~= nil and data.alwaysHideSpecs ~= nil then + alwaysHideSpecs = data.alwaysHideSpecs + end + + --view + if data.expandDown ~= nil and data.widgetRight ~= nil then + expandDown = data.expandDown + expandLeft = data.expandLeft + local oldvsx = data.vsx + local oldvsy = data.vsy + if oldvsx == nil then + oldvsx = vsx + oldvsy = vsy + end + local dy = vsy - oldvsy + if expandDown then + widgetTop = data.widgetTop + dy + if widgetTop > vsy then + widgetTop = vsy + end + else + widgetPosY = data.widgetPosY + end + if expandLeft then + widgetRelRight = data.widgetRelRight or 0 + widgetRight = vsx - (widgetWidth * (widgetScale - 1)) - widgetRelRight --align right of widget to right of screen + widgetPosX = widgetRight - (widgetWidth * widgetScale) + if widgetRight > vsx then + widgetRight = vsx + end + else + widgetPosX = data.widgetPosX --align left of widget to left of screen + end + end + + if spGetGameFrame() > 0 then + if data.originalColourNames then + originalColourNames = data.originalColourNames + end + end + + --not technically modules + m_point.active = true -- m_point.default doesnt work + if data.m_pointActive ~= nil then + m_point.active = data.m_pointActive + end + m_take.active = true -- m_take.default doesnt work + if data.m_takeActive ~= nil then + m_take.active = data.m_takeActive + end + + local m_active_Table = data.m_active_Table or {} + for name, active in pairs(m_active_Table) do + for _, module in pairs(modules) do + if module.name == name then + if name == "ally" then + -- needs to be always active (some aready stored it as false before, this makes sure its corrected) + module.active = true + else + module.active = module.default + if active ~= nil then + module.active = active + end + end + end + end + end + + if not data.hasresetskill then + m_skill.active = false + end + + SetModulesPositionX() + + if data.lastSystemData ~= nil and data.gameFrame ~= nil and data.gameFrame <= spGetGameFrame() and data.gameFrame > spGetGameFrame() - 300 then + lastSystemData = data.lastSystemData + end end --------------------------------------------------------------------------------------------------- @@ -3925,132 +3904,132 @@ end --------------------------------------------------------------------------------------------------- function CheckPlayersChange() - local sorting = false - local curGameFrame = spGetGameFrame() - for i = 0, specOffset-1 do - local name, active, spec, teamID, allyTeamID, pingTime, cpuUsage, _, rank, _, _, desynced = sp.GetPlayerInfo(i, false) - name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(i) or name - local p = player[i] - if active == false then - if p.name ~= nil then - -- NON SPEC PLAYER LEAVING - if p.spec == false then - if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then - player[p.team + specOffset] = CreatePlayerFromTeam(p.team) - player[p.team + specOffset].lastKnownName = p.name - sorting = true - end - end - end - elseif active and name ~= nil then - if spec ~= p.spec then - -- PLAYER SWITCHING TO SPEC STATUS - if spec then - if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then - -- (update the no players team) - player[p.team + specOffset] = CreatePlayerFromTeam(p.team) - player[p.team + specOffset].lastKnownName = p.name - end - p.team = nil -- remove team - end - p.spec = spec -- consider player as spec - sorting = true - end - if teamID ~= p.team then - -- PLAYER CHANGING TEAM - if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then - -- check if there is no more player in the team + update - player[p.team + specOffset] = CreatePlayerFromTeam(p.team) - player[p.team + specOffset].lastKnownName = p.name - end - p.team = teamID + local sorting = false + local curGameFrame = spGetGameFrame() + for i = 0, specOffset - 1 do + local name, active, spec, teamID, allyTeamID, pingTime, cpuUsage, _, rank, _, _, desynced = sp.GetPlayerInfo(i, false) + name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(i) or name + local p = player[i] + if active == false then + if p.name ~= nil then + -- NON SPEC PLAYER LEAVING + if p.spec == false then + if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then + player[p.team + specOffset] = CreatePlayerFromTeam(p.team) + player[p.team + specOffset].lastKnownName = p.name + sorting = true + end + end + end + elseif active and name ~= nil then + if spec ~= p.spec then + -- PLAYER SWITCHING TO SPEC STATUS + if spec then + if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then + -- (update the no players team) + player[p.team + specOffset] = CreatePlayerFromTeam(p.team) + player[p.team + specOffset].lastKnownName = p.name + end + p.team = nil -- remove team + end + p.spec = spec -- consider player as spec + sorting = true + end + if teamID ~= p.team then + -- PLAYER CHANGING TEAM + if table.maxn(sp.GetPlayerList(p.team, true)) == 0 then + -- check if there is no more player in the team + update + player[p.team + specOffset] = CreatePlayerFromTeam(p.team) + player[p.team + specOffset].lastKnownName = p.name + end + p.team = teamID if (not mySpecStatus) and anonymousMode ~= "disabled" and teamID ~= myTeamID then p.red, p.green, p.blue = anonymousTeamColor[1], anonymousTeamColor[2], anonymousTeamColor[3] else p.red, p.green, p.blue = sp.GetTeamColor(teamID) end - p.dark = Color.IsDark(p.red, p.green, p.blue) - p.skill = GetSkill(i) - sorting = true - end - if p.name == nil then - player[i] = CreatePlayer(i) - p = player[i] -- refresh after reassignment - if p.name ~= nil then - forceMainListRefresh = true - end - end - if allyTeamID ~= p.allyteam then - p.allyteam = allyTeamID - updateTake(allyTeamID) - sorting = true - end - if desynced ~= p.desynced then - forceMainListRefresh = true - sorting = true - end - -- Update stall / cpu / ping info for each player - if p.spec == false then - p.needm = GetNeed("metal", p.team) - p.neede = GetNeed("energy", p.team) - p.rank = rank - else - p.needm = false - p.neede = false - end - - p.pingLvl = GetPingLvl(pingTime) - p.cpuLvl = GetCpuLvl(cpuUsage) - p.ping = pingTime * 1000 - ((pingTime * 1000) % 1) - p.cpu = cpuUsage * 100 - ((cpuUsage * 100) % 1) + p.dark = Color.IsDark(p.red, p.green, p.blue) + p.skill = GetSkill(i) + sorting = true + end + if p.name == nil then + player[i] = CreatePlayer(i) + p = player[i] -- refresh after reassignment + if p.name ~= nil then + forceMainListRefresh = true + end + end + if allyTeamID ~= p.allyteam then + p.allyteam = allyTeamID + updateTake(allyTeamID) + sorting = true + end + if desynced ~= p.desynced then + forceMainListRefresh = true + sorting = true + end + -- Update stall / cpu / ping info for each player + if p.spec == false then + p.needm = GetNeed("metal", p.team) + p.neede = GetNeed("energy", p.team) + p.rank = rank + else + p.needm = false + p.neede = false + end + + p.pingLvl = GetPingLvl(pingTime) + p.cpuLvl = GetCpuLvl(cpuUsage) + p.ping = pingTime * 1000 - ((pingTime * 1000) % 1) + p.cpu = cpuUsage * 100 - ((cpuUsage * 100) % 1) p.desynced = desynced - end - - if teamID and curGameFrame > 0 then - local totake = IsTakeable(teamID) - p.totake = totake - if totake then - sorting = true - else - p.name = name - end - end - end - - if sorting then - -- sorts the list again if change needs it - SortList() - SetModulesPositionX() -- change the X size if needed (change of widest name) - CreateLists() - end + end + + if teamID and curGameFrame > 0 then + local totake = IsTakeable(teamID) + p.totake = totake + if totake then + sorting = true + else + p.name = name + end + end + end + + if sorting then + -- sorts the list again if change needs it + SortList() + SetModulesPositionX() -- change the X size if needed (change of widest name) + CreateLists() + end end function GetNeed(resType, teamID) - local current, _, pull, income = sp.GetTeamResources(teamID, resType) - if current == nil then - return false - end - local loss = pull - income - if loss > 0 and loss * 5 > current then - return true - end - return false + local current, _, pull, income = sp.GetTeamResources(teamID, resType) + if current == nil then + return false + end + local loss = pull - income + if loss > 0 and loss * 5 > current then + return true + end + return false end function updateTake(allyTeamID) - for i = 0, teamN - 1 do - if player[i + specOffset].allyTeam == allyTeamID then - player[i + specOffset] = CreatePlayerFromTeam(i) - end - end + for i = 0, teamN - 1 do + if player[i + specOffset].allyTeam == allyTeamID then + player[i + specOffset] = CreatePlayerFromTeam(i) + end + end end function Take(teamID, name, i) - reportTake = true - tookTeamID = teamID - tookTeamName = name - tookFrame = spGetGameFrame() - sp.SendCommands("luarules take2 " .. teamID) + reportTake = true + tookTeamID = teamID + tookTeamName = name + tookFrame = spGetGameFrame() + sp.SendCommands("luarules take2 " .. teamID) end --------------------------------------------------------------------------------------------------- @@ -4058,142 +4037,142 @@ end --------------------------------------------------------------------------------------------------- function IsTakeable(teamID) - if sp.GetTeamRulesParam(teamID, "numActivePlayers") == 0 then - local units = sp.GetTeamUnitCount(teamID) - local energy = sp.GetTeamResources(teamID, "energy") - local metal = sp.GetTeamResources(teamID, "metal") - if units and energy and metal then - if units > 0 or energy > 1000 or metal > 100 then - return true - end - end - else - return false - end + if sp.GetTeamRulesParam(teamID, "numActivePlayers") == 0 then + local units = sp.GetTeamUnitCount(teamID) + local energy = sp.GetTeamResources(teamID, "energy") + local metal = sp.GetTeamResources(teamID, "metal") + if units and energy and metal then + if units > 0 or energy > 1000 or metal > 100 then + return true + end + end + else + return false + end end function widget:Update(delta) - if pendingInitRefresh then - pendingInitRefresh = false - doPlayerUpdate() - end - --handles takes & related messages - local mx, my = spGetMouseState() - hoverPlayerlist = false - if math_isInRect(mx, my, apiAbsPosition[2] - 1, apiAbsPosition[3] - 1, apiAbsPosition[4] + 1, apiAbsPosition[1] + 1 ) then - hoverPlayerlist = true + if pendingInitRefresh then + pendingInitRefresh = false + doPlayerUpdate() + end + --handles takes & related messages + local mx, my = spGetMouseState() + hoverPlayerlist = false + if math_isInRect(mx, my, apiAbsPosition[2] - 1, apiAbsPosition[3] - 1, apiAbsPosition[4] + 1, apiAbsPosition[1] + 1) then + hoverPlayerlist = true if leaderboardOffset then local posY = widgetPosY + widgetHeight - (leaderboardOffset or 0) - if IsOnRect(mx, my, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset*playerScale)) then - if teamRanking[myAllyTeamID] then - tipTextTitle = Spring.I18N('ui.playersList.scoreboard') - tipText = Spring.I18N('ui.playersList.scoreboardTooltip') - else - tipTextTitle = Spring.I18N('ui.playersList.leaderboard') - tipText = Spring.I18N('ui.playersList.leaderboardTooltip') - end + if IsOnRect(mx, my, widgetPosX, posY, widgetPosX + widgetWidth, posY + (playerOffset * playerScale)) then + if teamRanking[myAllyTeamID] then + tipTextTitle = Spring.I18N("ui.playersList.scoreboard") + tipText = Spring.I18N("ui.playersList.scoreboardTooltip") + else + tipTextTitle = Spring.I18N("ui.playersList.leaderboard") + tipText = Spring.I18N("ui.playersList.leaderboardTooltip") + end tipTextTime = osClock() end end - if tipText and WG['tooltip'] then - WG['tooltip'].ShowTooltip('advplayerlist', tipText, nil, nil, tipTextTitle) - end - Spring.SetMouseCursor('cursornormal') - end - - lockPlayerID = WG.lockcamera and WG.lockcamera.GetPlayerID() or false - - if clickedPlayerTime and osClock() - clickedPlayerTime > dblclickPeriod then - Spec(player[clickedPlayerID].team) - if lockPlayerID then - LockCamera(player[clickedPlayerID].ai and nil or clickedPlayerID) - end - --CreateMainList() - forceMainListRefresh = true - clickedPlayerTime = nil - clickedPlayerID = nil - end - - timeCounter = timeCounter + delta - timeFastCounter = timeFastCounter + delta - curFrame = spGetGameFrame() - mySpecStatus, fullView, _ = spGetSpectatingState() - - if scheduledSpecFullView ~= nil then - -- this is needed else the minimap/world doesnt update properly - Spring.SendCommands("specfullview") - scheduledSpecFullView = scheduledSpecFullView - 1 - if scheduledSpecFullView == 0 then - scheduledSpecFullView = nil - end - end - - if sliderPosition and sliderPosition ~= prevSliderPosition then - prevSliderPosition = sliderPosition - CreateShareSlider() - end - - if curFrame >= 30 + tookFrame then - if lastTakeMsg + 120 < tookFrame and reportTake then - local teamID = tookTeamID - local afterE = sp.GetTeamResources(teamID, "energy") - local afterM = sp.GetTeamResources(teamID, "metal") - local afterU = sp.GetTeamUnitCount(teamID) + if tipText and WG["tooltip"] then + WG["tooltip"].ShowTooltip("advplayerlist", tipText, nil, nil, tipTextTitle) + end + Spring.SetMouseCursor("cursornormal") + end + + lockPlayerID = WG.lockcamera and WG.lockcamera.GetPlayerID() or false + + if clickedPlayerTime and osClock() - clickedPlayerTime > dblclickPeriod then + Spec(player[clickedPlayerID].team) + if lockPlayerID then + LockCamera(player[clickedPlayerID].ai and nil or clickedPlayerID) + end + --CreateMainList() + forceMainListRefresh = true + clickedPlayerTime = nil + clickedPlayerID = nil + end + + timeCounter = timeCounter + delta + timeFastCounter = timeFastCounter + delta + curFrame = spGetGameFrame() + mySpecStatus, fullView, _ = spGetSpectatingState() + + if scheduledSpecFullView ~= nil then + -- this is needed else the minimap/world doesnt update properly + Spring.SendCommands("specfullview") + scheduledSpecFullView = scheduledSpecFullView - 1 + if scheduledSpecFullView == 0 then + scheduledSpecFullView = nil + end + end + + if sliderPosition and sliderPosition ~= prevSliderPosition then + prevSliderPosition = sliderPosition + CreateShareSlider() + end + + if curFrame >= 30 + tookFrame then + if lastTakeMsg + 120 < tookFrame and reportTake then + local teamID = tookTeamID + local afterE = sp.GetTeamResources(teamID, "energy") + local afterM = sp.GetTeamResources(teamID, "metal") + local afterU = sp.GetTeamUnitCount(teamID) local detailedToSay = false - if afterE and afterM and afterU then - if afterE > 1.0 or afterM > 1.0 or afterU > 0 then - detailedToSay = true + if afterE and afterM and afterU then + if afterE > 1.0 or afterM > 1.0 or afterU > 0 then + detailedToSay = true end - end + end if detailedToSay then - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.takeTeam:name='..tookTeamName..':units='..mathFloor(afterU)..':energy='..mathFloor(afterE)..':metal='..mathFloor(afterE)) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.takeTeam:name=" .. tookTeamName .. ":units=" .. mathFloor(afterU) .. ":energy=" .. mathFloor(afterE) .. ":metal=" .. mathFloor(afterE)) else - Spring.SendLuaRulesMsg('msg:ui.playersList.chat.takeTeam:name='..tookTeamName) + Spring.SendLuaRulesMsg("msg:ui.playersList.chat.takeTeam:name=" .. tookTeamName) + end + + for j = 0, (specOffset * 2) - 1 do + if player[j].allyteam == myAllyTeamID then + if player[j].totake then + player[j] = CreatePlayerFromTeam(player[j].team) + forceMainListRefresh = true + end + end end - for j = 0, (specOffset*2)-1 do - if player[j].allyteam == myAllyTeamID then - if player[j].totake then - player[j] = CreatePlayerFromTeam(player[j].team) - forceMainListRefresh = true - end - end - end - - lastTakeMsg = tookFrame - reportTake = false - else - reportTake = false - end - end - if curFrame <= 0 and timeCounter > updateRate*updateRateMult then - SetSidePics() -- if the game hasn't started, update factions - elseif curFrame > 15 and not gameStartRefreshed then - gameStartRefreshed = true - forceMainListRefresh = true - end - - -- detect guishader widget being toggled back on - local guishaderNow = WG['guishader'] ~= nil - if guishaderNow and not guishaderWasActive then - BackgroundGuishader = gl_DeleteList(BackgroundGuishader) - forceMainListRefresh = true - end - guishaderWasActive = guishaderNow - - if forceMainListRefresh then - SortList() - SetModulesPositionX() - CreateLists() - else - local updateMainList2 = timeCounter > updateRate*updateRateMult - local updateMainList3 = ((m_resources.active or m_income.active) and timeFastCounter > updateFastRate*updateFastRateMult) - if updateMainList2 or updateMainList3 then - CreateLists(curFrame==0, updateMainList2, updateMainList3) - end - end + lastTakeMsg = tookFrame + reportTake = false + else + reportTake = false + end + end + if curFrame <= 0 and timeCounter > updateRate * updateRateMult then + SetSidePics() -- if the game hasn't started, update factions + elseif curFrame > 15 and not gameStartRefreshed then + gameStartRefreshed = true + forceMainListRefresh = true + end + + -- detect guishader widget being toggled back on + local guishaderNow = WG["guishader"] ~= nil + if guishaderNow and not guishaderWasActive then + BackgroundGuishader = gl_DeleteList(BackgroundGuishader) + forceMainListRefresh = true + end + guishaderWasActive = guishaderNow + + if forceMainListRefresh then + SortList() + SetModulesPositionX() + CreateLists() + else + local updateMainList2 = timeCounter > updateRate * updateRateMult + local updateMainList3 = ((m_resources.active or m_income.active) and timeFastCounter > updateFastRate * updateFastRateMult) + if updateMainList2 or updateMainList3 then + CreateLists(curFrame == 0, updateMainList2, updateMainList3) + end + end end --------------------------------------------------------------------------------------------------- @@ -4201,43 +4180,43 @@ end --------------------------------------------------------------------------------------------------- function updateWidgetScale() - if customScale < 0.65 then - customScale = 0.65 - end - local prevWidgetScale = widgetScale - widgetScale = (vsy / 980) * (1 + ((vsx / vsy) * 0.065)) * customScale - widgetScale = widgetScale * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) - if prevWidgetScale ~= widgetScale then - prevWidgetScale = widgetScale - forceMainListRefresh = true - end - widgetPosX = vsx - (widgetWidth * widgetScale) - bgpadding - widgetRight = vsx - bgpadding - widgetPosY = bgpadding - widgetTop = widgetPosY + widgetHeight + bgpadding + if customScale < 0.65 then + customScale = 0.65 + end + local prevWidgetScale = widgetScale + widgetScale = (vsy / 980) * (1 + ((vsx / vsy) * 0.065)) * customScale + widgetScale = widgetScale * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) + if prevWidgetScale ~= widgetScale then + prevWidgetScale = widgetScale + forceMainListRefresh = true + end + widgetPosX = vsx - (widgetWidth * widgetScale) - bgpadding + widgetRight = vsx - bgpadding + widgetPosY = bgpadding + widgetTop = widgetPosY + widgetHeight + bgpadding end function widget:ViewResize() - vsx, vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() - -- Update cached font scale factors - local vsyRatio = 1 - (vsy / 1200) - fontScaleHigh = math.clamp(1 + (vsyRatio * 0.75), 1, 1.25) - fontScaleMed = math.clamp(1 + (vsyRatio * 0.5), 1, 1.2) - fontScaleLow = math.clamp(1 + (vsyRatio * 0.4), 1, 1.15) - fontScaleSpec = math.clamp(1 + (vsyRatio * 0.66), 1, 1.33) + -- Update cached font scale factors + local vsyRatio = 1 - (vsy / 1200) + fontScaleHigh = math.clamp(1 + (vsyRatio * 0.75), 1, 1.25) + fontScaleMed = math.clamp(1 + (vsyRatio * 0.5), 1, 1.2) + fontScaleLow = math.clamp(1 + (vsyRatio * 0.4), 1, 1.15) + fontScaleSpec = math.clamp(1 + (vsyRatio * 0.66), 1, 1.33) - bgpadding = WG.FlowUI.elementPadding - elementCorner = WG.FlowUI.elementCorner + bgpadding = WG.FlowUI.elementPadding + elementCorner = WG.FlowUI.elementCorner - RectRound = WG.FlowUI.Draw.RectRound - UiElement = WG.FlowUI.Draw.Element - UiSelectHighlight = WG.FlowUI.Draw.SelectHighlight + RectRound = WG.FlowUI.Draw.RectRound + UiElement = WG.FlowUI.Draw.Element + UiSelectHighlight = WG.FlowUI.Draw.SelectHighlight - updateWidgetScale() + updateWidgetScale() - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2, 1.5, 0.13, 20) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2, 1.5, 0.13, 20) local MakeAtlasOnDemand = VFS.Include("LuaUI/Include/AtlasOnDemand.lua") if AdvPlayersListAtlas then @@ -4245,31 +4224,31 @@ function widget:ViewResize() end local cellheight = mathMax(32, mathCeil(mathMax(font.size, font2.size) + 4)) - local cellwidth = mathCeil(cellheight*1.25) - local cellcount = mathCeil(math.sqrt(32+32 + 200)) - local atlasconfig = {sizex = cellheight * cellcount, sizey = cellwidth*cellcount, xresolution = cellheight, yresolution = cellwidth, name = "AdvPlayersListAtlas", defaultfont = {font = font, options = 'o'}} + local cellwidth = mathCeil(cellheight * 1.25) + local cellcount = mathCeil(math.sqrt(32 + 32 + 200)) + local atlasconfig = { sizex = cellheight * cellcount, sizey = cellwidth * cellcount, xresolution = cellheight, yresolution = cellwidth, name = "AdvPlayersListAtlas", defaultfont = { font = font, options = "o" } } AdvPlayersListAtlas = MakeAtlasOnDemand(atlasconfig) for i = 0, 99 do AdvPlayersListAtlas:AddText(string.format("%02d", i)) end - forceMainListRefresh = true + forceMainListRefresh = true end function widget:MapDrawCmd(playerID, cmdType, px, py, pz) - -- get the points drawn (to display point indicator) - if m_point.active then - if cmdType == "point" then - player[playerID].pointX = px - player[playerID].pointY = py - player[playerID].pointZ = pz - player[playerID].pointTime = now + pointDuration - activeDrawPlayers[playerID] = true - elseif cmdType == 'line' then - player[playerID].pencilTime = now + pencilDuration - activeDrawPlayers[playerID] = true - elseif cmdType == 'erase' then - player[playerID].eraserTime = now + pencilDuration - activeDrawPlayers[playerID] = true - end - end + -- get the points drawn (to display point indicator) + if m_point.active then + if cmdType == "point" then + player[playerID].pointX = px + player[playerID].pointY = py + player[playerID].pointZ = pz + player[playerID].pointTime = now + pointDuration + activeDrawPlayers[playerID] = true + elseif cmdType == "line" then + player[playerID].pencilTime = now + pencilDuration + activeDrawPlayers[playerID] = true + elseif cmdType == "erase" then + player[playerID].eraserTime = now + pencilDuration + activeDrawPlayers[playerID] = true + end + end end diff --git a/luaui/Widgets/gui_advplayerslist_gameinfo.lua b/luaui/Widgets/gui_advplayerslist_gameinfo.lua index e990b14dd67..3003fa91a72 100644 --- a/luaui/Widgets/gui_advplayerslist_gameinfo.lua +++ b/luaui/Widgets/gui_advplayerslist_gameinfo.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "AdvPlayersList Game Info", - desc = "Displays current gametime, fps and gamespeed", - author = "Floris", - date = "april 2017", - license = "GNU GPL, v2 or later", - layer = -3, - enabled = true, + name = "AdvPlayersList Game Info", + desc = "Displays current gametime, fps and gamespeed", + author = "Floris", + date = "april 2017", + license = "GNU GPL, v2 or later", + layer = -3, + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor @@ -25,16 +24,16 @@ local timeNotation = 24 local font local widgetScale = 1 -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList local drawlist = {} local advplayerlistPos = {} local widgetHeight = 22 -local top, left, bottom, right = 0,0,0,0 +local top, left, bottom, right = 0, 0, 0, 0 local passedTime = 0 local positionCheckTime = 0 @@ -49,70 +48,69 @@ local vsx, vsy = spGetViewGeometry() local RectRound, UiElement, elementCorner - local function drawBackground() - UiElement(left, bottom, right, top, 1,0,0,1, 1,1,0,1, nil, nil, nil, nil) + UiElement(left, bottom, right, top, 1, 0, 0, 1, 1, 1, 0, 1, nil, nil, nil, nil) end local function drawContent() - local textsize = 11*widgetScale * math.clamp(1+((1-(vsy/1200))*0.4), 1, 1.15) - local textXPadding = 10*widgetScale + local textsize = 11 * widgetScale * math.clamp(1 + ((1 - (vsy / 1200)) * 0.4), 1, 1.15) + local textXPadding = 10 * widgetScale local fps = Spring.GetFPS() - local titleColor = '\255\210\210\210' - local valueColor = '\255\245\245\245' + local titleColor = "\255\210\210\210" + local valueColor = "\255\245\245\245" local minutes = mathFloor((gameframe / 30 / 60)) - local seconds = mathFloor((gameframe - ((minutes*60)*30)) / 30) + local seconds = mathFloor((gameframe - ((minutes * 60) * 30)) / 30) if seconds == 0 then - seconds = '00' + seconds = "00" elseif seconds < 10 then - seconds = '0'..seconds + seconds = "0" .. seconds end - local time = minutes..':'..seconds + local time = minutes .. ":" .. seconds font:Begin(true) - font:SetOutlineColor(0.15,0.15,0.15,0.8) - font:Print(valueColor..time, left+textXPadding, bottom+(0.48*widgetHeight*widgetScale)-(textsize*0.35), textsize, 'no') + font:SetOutlineColor(0.15, 0.15, 0.15, 0.8) + font:Print(valueColor .. time, left + textXPadding, bottom + (0.48 * widgetHeight * widgetScale) - (textsize * 0.35), textsize, "no") local extraSpacing = 0 if minutes > 99 then extraSpacing = 1.34 elseif minutes > 9 then extraSpacing = 0.7 end - local gamespeedStr = string.format("%.1f", gamespeed)..'0' - local text = titleColor..' x'..valueColor..gamespeedStr..titleColor..' fps '..valueColor..fps - font:Print(text, left+textXPadding+(textsize*(2.8+extraSpacing)), bottom+(0.48*widgetHeight*widgetScale)-(textsize*0.35), textsize, 'no') + local gamespeedStr = string.format("%.1f", gamespeed) .. "0" + local text = titleColor .. " x" .. valueColor .. gamespeedStr .. titleColor .. " fps " .. valueColor .. fps + font:Print(text, left + textXPadding + (textsize * (2.8 + extraSpacing)), bottom + (0.48 * widgetHeight * widgetScale) - (textsize * 0.35), textsize, "no") local textWidth = font:GetTextWidth(text) * textsize local usedTextWidth = 0 - if textWidth > usedTextWidth or textWidthClock+30 < os.clock() then + if textWidth > usedTextWidth or textWidthClock + 30 < os.clock() then usedTextWidth = textWidth textWidthClock = os.clock() end - local clock = '' + local clock = "" if timeNotation == 24 then clock = os.date("%H:%M") else clock = os.date("%I:%M %p") end - font:Print(valueColor..clock, left+textXPadding+(textsize*(2.8+extraSpacing))+usedTextWidth+(textsize*1.3), bottom+(0.48*widgetHeight*widgetScale)-(textsize*0.35), textsize, 'no') + font:Print(valueColor .. clock, left + textXPadding + (textsize * (2.8 + extraSpacing)) + usedTextWidth + (textsize * 1.3), bottom + (0.48 * widgetHeight * widgetScale) - (textsize * 0.35), textsize, "no") font:End() end local function refreshUiDrawing() - if WG['guishader'] then + if WG["guishader"] then if guishaderList then guishaderList = glDeleteList(guishaderList) end - guishaderList = glCreateList( function() - RectRound(left, bottom, right, top, elementCorner, 1,0,0,1) + guishaderList = glCreateList(function() + RectRound(left, bottom, right, top, elementCorner, 1, 0, 0, 1) end) - WG['guishader'].InsertDlist(guishaderList, 'displayinfo', true) + WG["guishader"].InsertDlist(guishaderList, "displayinfo", true) end - if right-left >= 1 and top-bottom >= 1 then + if right - left >= 1 and top - bottom >= 1 then if not uiBgTex then - uiBgTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { + uiBgTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -120,7 +118,7 @@ local function refreshUiDrawing() gl.R2tHelper.RenderInRect(uiBgTex, left, bottom, right, top, drawBackground, true) end if not uiTex then - uiTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { --*(vsy<1400 and 2 or 1) + uiTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -130,24 +128,23 @@ local function refreshUiDrawing() end end - local function updatePosition(force) local prevPos = advplayerlistPos - if WG['unittotals'] ~= nil then - advplayerlistPos = WG['unittotals'].GetPosition() - elseif WG['music'] ~= nil then - advplayerlistPos = WG['music'].GetPosition() - elseif WG['advplayerlist_api'] then - advplayerlistPos = WG['advplayerlist_api'].GetPosition() + if WG["unittotals"] ~= nil then + advplayerlistPos = WG["unittotals"].GetPosition() + elseif WG["music"] ~= nil then + advplayerlistPos = WG["music"].GetPosition() + elseif WG["advplayerlist_api"] then + advplayerlistPos = WG["advplayerlist_api"].GetPosition() else local scale = (vsy / 880) * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) - advplayerlistPos = {0,vsx-(220*scale),0,vsx,scale} + advplayerlistPos = { 0, vsx - (220 * scale), 0, vsx, scale } end if advplayerlistPos[5] ~= nil then left = advplayerlistPos[2] bottom = advplayerlistPos[1] right = advplayerlistPos[4] - top = math.ceil(advplayerlistPos[1]+(widgetHeight*advplayerlistPos[5])) + top = math.ceil(advplayerlistPos[1] + (widgetHeight * advplayerlistPos[5])) widgetScale = advplayerlistPos[5] if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then widget:ViewResize() @@ -158,24 +155,25 @@ end function widget:Initialize() widget:ViewResize() updatePosition() - WG['displayinfo'] = {} - WG['displayinfo'].GetPosition = function() - return {top,left,bottom,right,widgetScale} + WG["displayinfo"] = {} + WG["displayinfo"].GetPosition = function() + return { top, left, bottom, right, widgetScale } end Spring.SendCommands("fps 0") Spring.SendCommands("clock 0") Spring.SendCommands("speed 0") end - function widget:Shutdown() - if WG['guishader'] then - WG['guishader'].RemoveDlist('displayinfo') + if WG["guishader"] then + WG["guishader"].RemoveDlist("displayinfo") end - for i=1,#drawlist do + for i = 1, #drawlist do glDeleteList(drawlist[i]) end - if guishaderList then glDeleteList(guishaderList) end + if guishaderList then + glDeleteList(guishaderList) + end if uiBgTex then gl.DeleteTexture(uiBgTex) uiBgTex = nil @@ -187,7 +185,7 @@ function widget:Shutdown() Spring.SendCommands("fps 1") Spring.SendCommands("clock 1") Spring.SendCommands("speed 1") - WG['displayinfo'] = nil + WG["displayinfo"] = nil end function widget:Update(dt) @@ -221,10 +219,10 @@ function widget:Update(dt) end end -function widget:ViewResize(newX,newY) +function widget:ViewResize(newX, newY) vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() elementCorner = WG.FlowUI.elementCorner RectRound = WG.FlowUI.Draw.RectRound @@ -242,7 +240,6 @@ function widget:ViewResize(newX,newY) end function widget:DrawScreen() - if updateDrawing then updateDrawing = false refreshUiDrawing() diff --git a/luaui/Widgets/gui_advplayerslist_mascot.lua b/luaui/Widgets/gui_advplayerslist_mascot.lua index 68838b869e8..fa5c390584f 100644 --- a/luaui/Widgets/gui_advplayerslist_mascot.lua +++ b/luaui/Widgets/gui_advplayerslist_mascot.lua @@ -2,19 +2,19 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "AdvPlayersList Mascot", - desc = "Shows a mascot sitting on top of the adv-playerlist (use /mascot to switch)", - author = "Floris, biong", - date = "2015-2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, + name = "AdvPlayersList Mascot", + desc = "Shows a mascot sitting on top of the adv-playerlist (use /mascot to switch)", + author = "Floris, biong", + date = "2015-2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end -- Localized functions for performance -local mathSin = math.sin -local mathPi = math.pi +local mathSin = math.sin +local mathPi = math.pi local mathRandom = math.random local tableInsert = table.insert @@ -22,26 +22,26 @@ local tableInsert = table.insert -- Config --------------------------------------------------------------------------------------------------- -local imageDirectory = ":l:"..LUAUI_DIRNAME.."Images/advplayerslist_mascot/" -local soundDirectory = LUAUI_DIRNAME.."Sounds/advplayerslist_mascot/" +local imageDirectory = ":l:" .. LUAUI_DIRNAME .. "Images/advplayerslist_mascot/" +local soundDirectory = LUAUI_DIRNAME .. "Sounds/advplayerslist_mascot/" -- Supported formats, checked in priority order. local IMAGE_EXTENSIONS = { "png", "jpg", "jpeg", "tga", "dds" } local SOUND_EXTENSIONS = { "wav", "mp3", "ogg", "flac" } local OPTIONS = {} -OPTIONS.defaults = { -- merged into every mascot by loadOption(); per-mascot overrides win - name = "Defaults", - imageSize = 53, - xOffset = -1.6, - yOffset = -58/5, - head_xOffset = 0, - head_yOffset = 0, +OPTIONS.defaults = { -- merged into every mascot by loadOption(); per-mascot overrides win + name = "Defaults", + imageSize = 53, + xOffset = -1.6, + yOffset = -58 / 5, + head_xOffset = 0, + head_yOffset = 0, blinkDuration = 0.12, - blinkTimeout = 6, - soundInterval = 20, -- seconds between ambient sound playbacks - emoteInterval = 15, -- seconds between automatic random-emote triggers - emoteDuration = 2.5, -- seconds each triggered emote is displayed + blinkTimeout = 6, + soundInterval = 20, -- seconds between ambient sound playbacks + emoteInterval = 15, -- seconds between automatic random-emote triggers + emoteDuration = 2.5, -- seconds each triggered emote is displayed } -- Base name (no extension) of the xmas overlay. Defined once so the exclusion set @@ -61,7 +61,7 @@ local SPECIAL_FILE_BASES = { -- data file) so tuning ships with the code and needs nothing extra to load. local MASCOT_OVERRIDES = { -- Teifion's MrBeans wanted a smaller draw size and a nudged head under the old setup. - mrbeans = { imageSize = 50, yOffset = -58/4, head_xOffset = -0.01, head_yOffset = 0.13 }, + mrbeans = { imageSize = 50, yOffset = -58 / 4, head_xOffset = -0.01, head_yOffset = 0.13 }, } -- Named emotes recognised by filename suffix. @@ -69,14 +69,37 @@ local MASCOT_OVERRIDES = { -- Add or remove names freely; ROLE_SUFFIXES is built from this table automatically. local EMOTE_NAMES = { -- Positive - "laugh", "happy", "smile", "love", "wink", - "excited", "star", "cheer", "blush", "smug", "cool", + "laugh", + "happy", + "smile", + "love", + "wink", + "excited", + "star", + "cheer", + "blush", + "smug", + "cool", -- Negative - "cry", "sad", "angry", "rage", "pain", - "scared", "nervous", "dead", "tears", + "cry", + "sad", + "angry", + "rage", + "pain", + "scared", + "nervous", + "dead", + "tears", -- Neutral / physical - "surprised", "shock", "think", "confused", "sleep", - "yawn", "sweat", "dizzy", "wave", + "surprised", + "shock", + "think", + "confused", + "sleep", + "yawn", + "sweat", + "dizzy", + "wave", } -- Recognised structural suffixes that indicate a file's role within a mascot set. @@ -85,10 +108,10 @@ local EMOTE_NAMES = { -- Named-emote suffixes are inserted here before _body/_head. local ROLE_SUFFIXES = { { suffix = "_headblink", role = "headblink" }, - { suffix = "_blink", role = "headblink" }, + { suffix = "_blink", role = "headblink" }, } for _, emoteName in ipairs(EMOTE_NAMES) do - tableInsert(ROLE_SUFFIXES, { suffix = "_"..emoteName, role = "emote_"..emoteName }) + tableInsert(ROLE_SUFFIXES, { suffix = "_" .. emoteName, role = "emote_" .. emoteName }) end tableInsert(ROLE_SUFFIXES, { suffix = "_body", role = "body" }) tableInsert(ROLE_SUFFIXES, { suffix = "_head", role = "head" }) @@ -108,7 +131,7 @@ local function classifyFile(nameNoExt) -- Generic numbered emote: base_N where N is one or more digits local base, num = nameNoExt:match("^(.+)_(%d+)$") if base then - return base, "emote_"..num + return base, "emote_" .. num end -- No recognised suffix → whole filename is a standalone head return nameNoExt, "head" @@ -117,7 +140,7 @@ end -- Return the first existing file at . across all known sound extensions. local function findSoundFile(basePath) for _, ext in ipairs(SOUND_EXTENSIONS) do - local path = basePath.."."..ext + local path = basePath .. "." .. ext if VFS.FileExists(path, VFS.RAW_FIRST) then return path end @@ -128,9 +151,9 @@ end -- Locate the santahat overlay in any supported image format, or return nil. local function findSantahat() for _, ext in ipairs(IMAGE_EXTENSIONS) do - local vfsPath = LUAUI_DIRNAME.."Images/advplayerslist_mascot/"..SANTAHAT_BASE.."."..ext + local vfsPath = LUAUI_DIRNAME .. "Images/advplayerslist_mascot/" .. SANTAHAT_BASE .. "." .. ext if VFS.FileExists(vfsPath, VFS.RAW_FIRST) then - return imageDirectory..SANTAHAT_BASE.."."..ext + return imageDirectory .. SANTAHAT_BASE .. "." .. ext end end return nil @@ -138,10 +161,10 @@ end -- Collect all image files in the mascot directory across every supported extension. local function listAllImages() - local all = {} + local all = {} local seen = {} for _, ext in ipairs(IMAGE_EXTENSIONS) do - local files = VFS.DirList(LUAUI_DIRNAME.."Images/advplayerslist_mascot/", "*."..ext, VFS.RAW_FIRST) + local files = VFS.DirList(LUAUI_DIRNAME .. "Images/advplayerslist_mascot/", "*." .. ext, VFS.RAW_FIRST) if files then for _, f in ipairs(files) do if not seen[f] then @@ -156,11 +179,13 @@ end local function loadMascotsFromDirectory() local files = listAllImages() - if not files then return end + if not files then + return + end -- First pass: group files by mascot base-name - local groups = {} -- base-name -> { name, body, head, headblink, emotes={} } - local ordering = {} -- stable cycle order + local groups = {} -- base-name -> { name, body, head, headblink, emotes={} } + local ordering = {} -- stable cycle order for _, filepath in ipairs(files) do local filename = filepath:match("([^/\\]+)$") @@ -179,16 +204,16 @@ local function loadMascotsFromDirectory() if role:find("^emote_") then -- Emote image + optional per-emote sound. -- Convention: mascot_laugh.wav plays when the laugh emote triggers. - local emoteSuffix = "_"..role:sub(7) -- "emote_laugh" -> "_laugh" - local sound = findSoundFile(soundDirectory..base..emoteSuffix) + local emoteSuffix = "_" .. role:sub(7) -- "emote_laugh" -> "_laugh" + local sound = findSoundFile(soundDirectory .. base .. emoteSuffix) tableInsert(groups[base].emotes, { - path = imageDirectory..filename, + path = imageDirectory .. filename, sound = sound or false, }) else -- Structural role (head / headblink / body): first file found wins if not groups[base][role] then - groups[base][role] = imageDirectory..filename + groups[base][role] = imageDirectory .. filename end end end @@ -207,15 +232,15 @@ local function loadMascotsFromDirectory() -- Fall back to normal head when no dedicated blink image exists local headblink = g.headblink or g.head -- Ambient mascot sound (e.g. mascot.wav); per-emote sounds live in each emote entry - local sound = findSoundFile(soundDirectory..base) + local sound = findSoundFile(soundDirectory .. base) local entry = { - name = g.name, - body = g.body or false, -- false = head-only mascot - head = g.head, + name = g.name, + body = g.body or false, -- false = head-only mascot + head = g.head, headblink = headblink, - santahat = santahat or false, -- false when no santahat overlay exists - sound = sound or false, -- false when no sound file found - emotes = g.emotes, -- list of { path, sound } + santahat = santahat or false, -- false when no santahat overlay exists + sound = sound or false, -- false when no sound file found + emotes = g.emotes, -- list of { path, sound } } -- Size and offsets come from OPTIONS.defaults via loadOption(); only mascots -- listed in MASCOT_OVERRIDES carry their own imageSize / offset values. @@ -253,13 +278,13 @@ OPTIONS_original.defaults = nil local myPlayerID = Spring.GetMyPlayerID() -local glRotate = gl.Rotate -local glTranslate = gl.Translate +local glRotate = gl.Rotate +local glTranslate = gl.Translate local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix +local glPopMatrix = gl.PopMatrix local glCreateList = gl.CreateList local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glCallList = gl.CallList local math_isInRect = math.isInRect @@ -273,20 +298,24 @@ if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then end -- Draw-state constants: map directly to the drawlist slot used for the head layer. -local DRAW_NORMAL = 2 -- drawlist[2] = normal head -local DRAW_BLINK = 3 -- drawlist[3] = blink head -local DRAW_EMOTE = 4 -- drawlist[4] = current emote (rebuilt on each trigger) +local DRAW_NORMAL = 2 -- drawlist[2] = normal head +local DRAW_BLINK = 3 -- drawlist[3] = blink head +local DRAW_EMOTE = 4 -- drawlist[4] = current emote (rebuilt on each trigger) --------------------------------------------------------------------------------------------------- -- Draw helpers --------------------------------------------------------------------------------------------------- local function RectQuad(px, py, sx, sy) - local o = 0.008 -- tiny texture offset to prevent grey edge artefacts - gl.TexCoord(o, 1-o) gl.Vertex(px, py, 0) - gl.TexCoord(1-o, 1-o) gl.Vertex(sx, py, 0) - gl.TexCoord(1-o, o) gl.Vertex(sx, sy, 0) - gl.TexCoord(o, o) gl.Vertex(px, sy, 0) + local o = 0.008 -- tiny texture offset to prevent grey edge artefacts + gl.TexCoord(o, 1 - o) + gl.Vertex(px, py, 0) + gl.TexCoord(1 - o, 1 - o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1 - o, o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o, o) + gl.Vertex(px, sy, 0) end function DrawRect(px, py, sx, sy) @@ -320,11 +349,11 @@ end local function headQuad(w, h, size, texturePath, opt) gl.Color(1, 1, 1, 1) gl.Texture(texturePath) - glTranslate(opt['head_xOffset']*size, opt['head_yOffset']*size, 0) - DrawRect(-(w/2), -(h/2)+(size/14), (w/2), (h/2)+(size/14)) - if drawSantahat and opt['santahat'] then - gl.Texture(opt['santahat']) - DrawRect(-(w/2), -(h/2)+(size/14), (w/2), (h/2)+(size/14)) + glTranslate(opt["head_xOffset"] * size, opt["head_yOffset"] * size, 0) + DrawRect(-(w / 2), -(h / 2) + (size / 14), (w / 2), (h / 2) + (size / 14)) + if drawSantahat and opt["santahat"] then + gl.Texture(opt["santahat"]) + DrawRect(-(w / 2), -(h / 2) + (size / 14), (w / 2), (h / 2) + (size / 14)) end gl.Texture(false) end @@ -335,42 +364,55 @@ local function createList(size) local opt = OPTIONS[currentOption] -- drawlist[1]: body layer (may be a GL no-op when body = false) - if drawlist[1] then glDeleteList(drawlist[1]) end - local bw, bh = fitQuad(opt['body'], size) + if drawlist[1] then + glDeleteList(drawlist[1]) + end + local bw, bh = fitQuad(opt["body"], size) drawlist[1] = glCreateList(function() - if opt['body'] then - gl.Texture(opt['body']) + if opt["body"] then + gl.Texture(opt["body"]) gl.Color(1, 1, 1, 1) - DrawRect(-(bw/2), -(bh/2), (bw/2), (bh/2)) + DrawRect(-(bw / 2), -(bh / 2), (bw / 2), (bh / 2)) gl.Texture(false) end end) -- drawlist[2]: normal head - if drawlist[2] then glDeleteList(drawlist[2]) end - local hw, hh = fitQuad(opt['head'], size) + if drawlist[2] then + glDeleteList(drawlist[2]) + end + local hw, hh = fitQuad(opt["head"], size) drawlist[2] = glCreateList(function() - headQuad(hw, hh, size, opt['head'], opt) + headQuad(hw, hh, size, opt["head"], opt) end) -- drawlist[3]: blink head - if drawlist[3] then glDeleteList(drawlist[3]) end - local bkw, bkh = fitQuad(opt['headblink'], size) + if drawlist[3] then + glDeleteList(drawlist[3]) + end + local bkw, bkh = fitQuad(opt["headblink"], size) drawlist[3] = glCreateList(function() - headQuad(bkw, bkh, size, opt['headblink'], opt) + headQuad(bkw, bkh, size, opt["headblink"], opt) end) -- drawlist[4] belongs to the active emote; clear it whenever the base lists are rebuilt -- so the emote state machine re-creates it against the new size / option. - if drawlist[4] then glDeleteList(drawlist[4]) ; drawlist[4] = nil end + if drawlist[4] then + glDeleteList(drawlist[4]) + drawlist[4] = nil + end end -- Build drawlist[4] for the given emote image path. -- Called by triggerRandomEmote; safe to call while an emote is already active. local function createEmoteList(size, emotePath) - if drawlist[4] then glDeleteList(drawlist[4]) end + if drawlist[4] then + glDeleteList(drawlist[4]) + end drawlist[4] = nil - if not emotePath then return end + if not emotePath then + return + end local opt = OPTIONS[currentOption] local ew, eh = fitQuad(emotePath, size) drawlist[4] = glCreateList(function() @@ -391,14 +433,14 @@ local positionPollTimer = 0 function updatePosition(force) local p1, p2, p3, p4, p5 local pos - if WG['displayinfo'] ~= nil then - p1, p2, p3, p4, p5 = WG['displayinfo'].GetPosition() - elseif WG['unittotals'] ~= nil then - p1, p2, p3, p4, p5 = WG['unittotals'].GetPosition() - elseif WG['music'] ~= nil then - p1, p2, p3, p4, p5 = WG['music'].GetPosition() - elseif WG['advplayerlist_api'] ~= nil then - p1, p2, p3, p4, p5 = WG['advplayerlist_api'].GetPosition() + if WG["displayinfo"] ~= nil then + p1, p2, p3, p4, p5 = WG["displayinfo"].GetPosition() + elseif WG["unittotals"] ~= nil then + p1, p2, p3, p4, p5 = WG["unittotals"].GetPosition() + elseif WG["music"] ~= nil then + p1, p2, p3, p4, p5 = WG["music"].GetPosition() + elseif WG["advplayerlist_api"] ~= nil then + p1, p2, p3, p4, p5 = WG["advplayerlist_api"].GetPosition() else local scale = (vsy / 880) * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) fallbackPos[1] = 0 @@ -409,15 +451,15 @@ function updatePosition(force) p1, p2, p3, p4, p5 = fallbackPos[1], fallbackPos[2], fallbackPos[3], fallbackPos[4], fallbackPos[5] end - if type(p1) == 'table' then + if type(p1) == "table" then pos = p1 p1, p2, p3, p4, p5 = pos[1], pos[2], pos[3], pos[4], pos[5] end - if type(p1) == 'number' and type(p2) == 'number' and type(p5) == 'number' then - usedImgSize = OPTIONS[currentOption]['imageSize'] * p5 - xPos = p2 + (usedImgSize/2) + (OPTIONS[currentOption]['xOffset'] * p5) - yPos = p1 + (usedImgSize/2) + (OPTIONS[currentOption]['yOffset'] * p5) + if type(p1) == "number" and type(p2) == "number" and type(p5) == "number" then + usedImgSize = OPTIONS[currentOption]["imageSize"] * p5 + xPos = p2 + (usedImgSize / 2) + (OPTIONS[currentOption]["xOffset"] * p5) + yPos = p1 + (usedImgSize / 2) + (OPTIONS[currentOption]["yOffset"] * p5) positionChange = os.clock() if (parentPos[1] ~= p1 or parentPos[2] ~= p2 or parentPos[5] ~= p5) or force then @@ -437,7 +479,7 @@ end local function tryPlaySound(soundPath) if soundPath then - Spring.PlaySoundFile(soundPath, 1.0, 'ui') + Spring.PlaySoundFile(soundPath, 1.0, "ui") end end @@ -457,32 +499,37 @@ end -- Emote state --------------------------------------------------------------------------------------------------- -local emoteActive = false -- true while an emote is being displayed -local emoteElapsed = 0 -- seconds the current emote has been visible -local emoteTimer = 0 -- counts up toward emoteInterval; triggers next emote -local currentEmote = nil -- { path, sound } of the emote being shown +local emoteActive = false -- true while an emote is being displayed +local emoteElapsed = 0 -- seconds the current emote has been visible +local emoteTimer = 0 -- counts up toward emoteInterval; triggers next emote +local currentEmote = nil -- { path, sound } of the emote being shown -- Clear all emote state and delete drawlist[4]. -- Called on mascot switch and widget initialisation. local function resetEmoteState() - emoteActive = false + emoteActive = false emoteElapsed = 0 - emoteTimer = 0 + emoteTimer = 0 currentEmote = nil - if drawlist[4] then glDeleteList(drawlist[4]) ; drawlist[4] = nil end + if drawlist[4] then + glDeleteList(drawlist[4]) + drawlist[4] = nil + end end -- Pick and display a random emote from the current mascot's emote list. local function triggerRandomEmote() local emoteList = OPTIONS[currentOption].emotes - if not emoteList or #emoteList == 0 then return end + if not emoteList or #emoteList == 0 then + return + end currentEmote = emoteList[mathRandom(#emoteList)] createEmoteList(usedImgSize, currentEmote.path) - emoteActive = true + emoteActive = true emoteElapsed = 0 -- Play the per-emote sound if one exists; otherwise fall back to the ambient mascot sound. - tryPlaySound(currentEmote.sound or OPTIONS[currentOption]['sound']) + tryPlaySound(currentEmote.sound or OPTIONS[currentOption]["sound"]) end local function toggleOptions(option) @@ -495,7 +542,7 @@ local function toggleOptions(option) end end loadOption() - resetEmoteState() -- clear emote before updatePosition so createList gets a clean state + resetEmoteState() -- clear emote before updatePosition so createList gets a clean state updatePosition(true) end @@ -505,15 +552,21 @@ end function widget:Initialize() -- Rebuild OPTIONS from disk so newly added images/sounds are picked up on reload - for i = #OPTIONS, 1, -1 do OPTIONS[i] = nil end + for i = #OPTIONS, 1, -1 do + OPTIONS[i] = nil + end loadMascotsFromDirectory() OPTIONS_original = shallow_copy(OPTIONS) OPTIONS_original.defaults = nil -- Clamp in case the mascot count changed since the config was last saved - if not OPTIONS[currentOption] then currentOption = 1 end - if OPTIONS[currentOption] then loadOption() end + if not OPTIONS[currentOption] then + currentOption = 1 + end + if OPTIONS[currentOption] then + loadOption() + end resetEmoteState() updatePosition() @@ -521,7 +574,9 @@ end function widget:Shutdown() for i = 1, 4 do - if drawlist[i] then glDeleteList(drawlist[i]) end + if drawlist[i] then + glDeleteList(drawlist[i]) + end end end @@ -531,15 +586,15 @@ function widget:PlayerChanged(playerID) end end -local sec = 0 -local totalTime = 0 -local rot = 0 -local bob = 0 -local soundTimer = 0 -local activeDrawSlot = DRAW_NORMAL -- which drawlist slot is rendered for the head layer +local sec = 0 +local totalTime = 0 +local rot = 0 +local bob = 0 +local soundTimer = 0 +local activeDrawSlot = DRAW_NORMAL -- which drawlist slot is rendered for the head layer function widget:Update(dt) - sec = sec + dt + sec = sec + dt totalTime = totalTime + dt rot = 14 + (6 * mathSin(mathPi * (totalTime / 4))) @@ -553,18 +608,21 @@ function widget:Update(dt) if emoteList and #emoteList > 0 then if emoteActive then emoteElapsed = emoteElapsed + dt - if emoteElapsed >= opt['emoteDuration'] then + if emoteElapsed >= opt["emoteDuration"] then -- Emote finished; tear down and return to normal - emoteActive = false - emoteElapsed = 0 - currentEmote = nil - activeDrawSlot = DRAW_NORMAL -- ← must happen before drawlist[4] is cleared - if drawlist[4] then glDeleteList(drawlist[4]) ; drawlist[4] = nil end - sec = 0 -- reset blink timer so a blink doesn't fire immediately + emoteActive = false + emoteElapsed = 0 + currentEmote = nil + activeDrawSlot = DRAW_NORMAL -- ← must happen before drawlist[4] is cleared + if drawlist[4] then + glDeleteList(drawlist[4]) + drawlist[4] = nil + end + sec = 0 -- reset blink timer so a blink doesn't fire immediately end else emoteTimer = emoteTimer + dt - if emoteTimer >= opt['emoteInterval'] then + if emoteTimer >= opt["emoteInterval"] then emoteTimer = 0 triggerRandomEmote() end @@ -573,10 +631,10 @@ function widget:Update(dt) -- ── Blink state machine (suspended while an emote is active) ───────────── if not emoteActive then - if sec > opt['blinkTimeout'] then + if sec > opt["blinkTimeout"] then activeDrawSlot = DRAW_BLINK end - if sec > (opt['blinkTimeout'] + opt['blinkDuration']) then + if sec > (opt["blinkTimeout"] + opt["blinkDuration"]) then sec = 0 activeDrawSlot = DRAW_NORMAL end @@ -588,11 +646,11 @@ function widget:Update(dt) end -- ── Ambient mascot sound ────────────────────────────────────────────────── - if opt['sound'] then + if opt["sound"] then soundTimer = soundTimer + dt - if soundTimer >= opt['soundInterval'] then + if soundTimer >= opt["soundInterval"] then soundTimer = 0 - tryPlaySound(opt['sound']) + tryPlaySound(opt["sound"]) end end @@ -604,21 +662,25 @@ function widget:Update(dt) end function widget:DrawScreen() - if not drawlist[1] then return end + if not drawlist[1] then + return + end + glPushMatrix() + glTranslate(xPos, yPos, 0) + glCallList(drawlist[1]) -- body (may be a GL no-op when body = false) glPushMatrix() - glTranslate(xPos, yPos, 0) - glCallList(drawlist[1]) -- body (may be a GL no-op when body = false) - glPushMatrix() - glTranslate(0, bob, 0) - glRotate(rot, 0, 0, 1) - local dl = drawlist[activeDrawSlot] - if dl then glCallList(dl) end - glPopMatrix() + glTranslate(0, bob, 0) + glRotate(rot, 0, 0, 1) + local dl = drawlist[activeDrawSlot] + if dl then + glCallList(dl) + end + glPopMatrix() glPopMatrix() end function widget:MousePress(mx, my, mb) - if mb == 1 and math_isInRect(mx, my, xPos-(usedImgSize/2), yPos-(usedImgSize/2), xPos+(usedImgSize/2), yPos+(usedImgSize/2)) then + if mb == 1 and math_isInRect(mx, my, xPos - (usedImgSize / 2), yPos - (usedImgSize / 2), xPos + (usedImgSize / 2), yPos + (usedImgSize / 2)) then soundTimer = 0 resetEmoteState() toggleOptions() @@ -626,11 +688,11 @@ function widget:MousePress(mx, my, mb) end function widget:TextCommand(command) - if string.sub(command, 1, 6) == 'mascot' then + if string.sub(command, 1, 6) == "mascot" then soundTimer = 0 resetEmoteState() toggleOptions(tonumber(string.sub(command, 8))) - Spring.Echo("Playerlist mascot: "..OPTIONS[currentOption].name) + Spring.Echo("Playerlist mascot: " .. OPTIONS[currentOption].name) end end diff --git a/luaui/Widgets/gui_advplayerslist_music_new.lua b/luaui/Widgets/gui_advplayerslist_music_new.lua index eea43786cad..e2b2184f96d 100644 --- a/luaui/Widgets/gui_advplayerslist_music_new.lua +++ b/luaui/Widgets/gui_advplayerslist_music_new.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "AdvPlayersList Music Player New", - desc = "Plays music and offers volume controls", - author = "Damgam", - date = "2021", + name = "AdvPlayersList Music Player New", + desc = "Plays music and offers volume controls", + author = "Damgam", + date = "2021", license = "GNU GPL, v2 or later", - layer = -3, - enabled = true + layer = -3, + enabled = true, } end - -- Localized functions for performance local mathCeil = math.ceil local mathFloor = math.floor @@ -56,8 +55,8 @@ local songsSinceEvent = 5 -- start with higher number so event track can be play ---------------------------------------------------------------------- local function applySpectatorThresholds() - warLowLevel = warLowLevel*1.5 - warHighLevel = warHighLevel*1.5 + warLowLevel = warLowLevel * 1.5 + warHighLevel = warHighLevel * 1.5 appliedSpectatorThresholds = true --spEcho("[Music Player] Spectator mode enabled") end @@ -102,13 +101,13 @@ local lastTrackAttemptTime = Spring.GetTimer() local function ReloadMusicPlaylists() -----------------------------------SETTINGS--------------------------------------- - interruptionEnabled = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1 - local newSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackNew', 1) == 1 - local customSoundtrackEnabled = Spring.GetConfigInt('UseSoundtrackCustom', 1) == 1 + interruptionEnabled = Spring.GetConfigInt("UseSoundtrackInterruption", 1) == 1 + local newSoundtrackEnabled = Spring.GetConfigInt("UseSoundtrackNew", 1) == 1 + local customSoundtrackEnabled = Spring.GetConfigInt("UseSoundtrackCustom", 1) == 1 - if Spring.GetConfigInt('UseSoundtrackNew', 1) == 0 and Spring.GetConfigInt('UseSoundtrackOld', 0) == 1 then - Spring.SetConfigInt('UseSoundtrackNew', 1) - Spring.SetConfigInt('UseSoundtrackOld', 0) + if Spring.GetConfigInt("UseSoundtrackNew", 1) == 0 and Spring.GetConfigInt("UseSoundtrackOld", 0) == 1 then + Spring.SetConfigInt("UseSoundtrackNew", 1) + Spring.SetConfigInt("UseSoundtrackOld", 0) end deviceLostSafetyCheck = 0 @@ -116,34 +115,34 @@ local function ReloadMusicPlaylists() local allowedExtensions = "{*.ogg,*.mp3}" -- New Soundtrack List - local musicDirNew = 'music/original' - local peaceTracksNew = VFS.DirList(musicDirNew..'/peace', allowedExtensions) - local warhighTracksNew = VFS.DirList(musicDirNew..'/warhigh', allowedExtensions) - local warlowTracksNew = VFS.DirList(musicDirNew..'/warlow', allowedExtensions) - local interludeTracksNew = VFS.DirList(musicDirNew..'/interludes', allowedExtensions) - local victoryTracksNew = VFS.DirList(musicDirNew..'/victory', allowedExtensions) - local defeatTracksNew = VFS.DirList(musicDirNew..'/defeat', allowedExtensions) - local gameoverTracksNew = VFS.DirList(musicDirNew..'/gameover', allowedExtensions) - local menuTracksNew = VFS.DirList(musicDirNew..'/menu', allowedExtensions) - local loadingTracksNew = VFS.DirList(musicDirNew..'/loading', allowedExtensions) - local bossFightTracksNew = {} - bonusTracks = {} - scavTracks = {} - raptorTracks = {} + local musicDirNew = "music/original" + local peaceTracksNew = VFS.DirList(musicDirNew .. "/peace", allowedExtensions) + local warhighTracksNew = VFS.DirList(musicDirNew .. "/warhigh", allowedExtensions) + local warlowTracksNew = VFS.DirList(musicDirNew .. "/warlow", allowedExtensions) + local interludeTracksNew = VFS.DirList(musicDirNew .. "/interludes", allowedExtensions) + local victoryTracksNew = VFS.DirList(musicDirNew .. "/victory", allowedExtensions) + local defeatTracksNew = VFS.DirList(musicDirNew .. "/defeat", allowedExtensions) + local gameoverTracksNew = VFS.DirList(musicDirNew .. "/gameover", allowedExtensions) + local menuTracksNew = VFS.DirList(musicDirNew .. "/menu", allowedExtensions) + local loadingTracksNew = VFS.DirList(musicDirNew .. "/loading", allowedExtensions) + local bossFightTracksNew = {} + bonusTracks = {} + scavTracks = {} + raptorTracks = {} -- Custom Soundtrack List - local musicDirCustom = 'music/custom' - local peaceTracksCustom = VFS.DirList(musicDirCustom..'/peace', allowedExtensions) - local warhighTracksCustom = VFS.DirList(musicDirCustom..'/warhigh', allowedExtensions) - local warlowTracksCustom = VFS.DirList(musicDirCustom..'/warlow', allowedExtensions) - local warTracksCustom = VFS.DirList(musicDirCustom..'/war', allowedExtensions) - local interludeTracksCustom = VFS.DirList(musicDirCustom..'/interludes', allowedExtensions) - local victoryTracksCustom = VFS.DirList(musicDirCustom..'/victory', allowedExtensions) - local defeatTracksCustom = VFS.DirList(musicDirCustom..'/defeat', allowedExtensions) - local gameoverTracksCustom = VFS.DirList(musicDirCustom..'/gameover', allowedExtensions) - local menuTracksCustom = VFS.DirList(musicDirCustom..'/menu', allowedExtensions) - local loadingTracksCustom = VFS.DirList(musicDirCustom..'/loading', allowedExtensions) - local bossFightTracksCustom = VFS.DirList(musicDirCustom..'/bossfight', allowedExtensions) + local musicDirCustom = "music/custom" + local peaceTracksCustom = VFS.DirList(musicDirCustom .. "/peace", allowedExtensions) + local warhighTracksCustom = VFS.DirList(musicDirCustom .. "/warhigh", allowedExtensions) + local warlowTracksCustom = VFS.DirList(musicDirCustom .. "/warlow", allowedExtensions) + local warTracksCustom = VFS.DirList(musicDirCustom .. "/war", allowedExtensions) + local interludeTracksCustom = VFS.DirList(musicDirCustom .. "/interludes", allowedExtensions) + local victoryTracksCustom = VFS.DirList(musicDirCustom .. "/victory", allowedExtensions) + local defeatTracksCustom = VFS.DirList(musicDirCustom .. "/defeat", allowedExtensions) + local gameoverTracksCustom = VFS.DirList(musicDirCustom .. "/gameover", allowedExtensions) + local menuTracksCustom = VFS.DirList(musicDirCustom .. "/menu", allowedExtensions) + local loadingTracksCustom = VFS.DirList(musicDirCustom .. "/loading", allowedExtensions) + local bossFightTracksCustom = VFS.DirList(musicDirCustom .. "/bossfight", allowedExtensions) -- Events eventPeaceTracks = {} @@ -162,132 +161,131 @@ local function ReloadMusicPlaylists() interludeTracks = {} if newSoundtrackEnabled then - -- Raptors -------------------------------------------------------------------------------------------------------------------- if Spring.Utilities.Gametype.IsRaptors() then - table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/raptors/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/raptors/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/raptors/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/raptors/interludes', allowedExtensions)) - table.append(bossFightTracks, VFS.DirList(musicDirNew..'/events/raptors/bossfight', allowedExtensions)) - elseif Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1 then - table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/raptors/peace', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/raptors/warlow', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/raptors/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/raptors/interludes', allowedExtensions)) - end - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/loading', allowedExtensions)) - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/peace', allowedExtensions)) - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/warlow', allowedExtensions)) - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/warhigh', allowedExtensions)) - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/interludes', allowedExtensions)) - table.append(raptorTracks, VFS.DirList(musicDirNew..'/events/raptors/bossfight', allowedExtensions)) + table.append(eventPeaceTracks, VFS.DirList(musicDirNew .. "/events/raptors/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/raptors/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/raptors/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/raptors/interludes", allowedExtensions)) + table.append(bossFightTracks, VFS.DirList(musicDirNew .. "/events/raptors/bossfight", allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackRaptors", 0) == 1 then + table.append(peaceTracksNew, VFS.DirList(musicDirNew .. "/events/raptors/peace", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/raptors/warlow", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/raptors/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/raptors/interludes", allowedExtensions)) + end + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/loading", allowedExtensions)) + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/peace", allowedExtensions)) + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/warlow", allowedExtensions)) + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/warhigh", allowedExtensions)) + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/interludes", allowedExtensions)) + table.append(raptorTracks, VFS.DirList(musicDirNew .. "/events/raptors/bossfight", allowedExtensions)) -- Scavengers -------------------------------------------------------------------------------------------------------------------- if Spring.Utilities.Gametype.IsScavengers() then - table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/scavengers/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/scavengers/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/scavengers/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/scavengers/interludes', allowedExtensions)) - table.append(bossFightTracks, VFS.DirList(musicDirNew..'/events/scavengers/bossfight', allowedExtensions)) - elseif Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1 then - table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/scavengers/peace', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/scavengers/warlow', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/scavengers/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/scavengers/interludes', allowedExtensions)) - end - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/loading', allowedExtensions)) - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/peace', allowedExtensions)) - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/warlow', allowedExtensions)) - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/warhigh', allowedExtensions)) - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/interludes', allowedExtensions)) - table.append(scavTracks, VFS.DirList(musicDirNew..'/events/scavengers/bossfight', allowedExtensions)) + table.append(eventPeaceTracks, VFS.DirList(musicDirNew .. "/events/scavengers/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/scavengers/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/scavengers/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/scavengers/interludes", allowedExtensions)) + table.append(bossFightTracks, VFS.DirList(musicDirNew .. "/events/scavengers/bossfight", allowedExtensions)) + elseif Spring.GetConfigInt("UseSoundtrackScavengers", 0) == 1 then + table.append(peaceTracksNew, VFS.DirList(musicDirNew .. "/events/scavengers/peace", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/scavengers/warlow", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/scavengers/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/scavengers/interludes", allowedExtensions)) + end + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/loading", allowedExtensions)) + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/peace", allowedExtensions)) + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/warlow", allowedExtensions)) + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/warhigh", allowedExtensions)) + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/interludes", allowedExtensions)) + table.append(scavTracks, VFS.DirList(musicDirNew .. "/events/scavengers/bossfight", allowedExtensions)) -- April Fools -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1) then - table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/aprilfools/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/aprilfools/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) and Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1) then - table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/peace', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/warlow', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/aprilfools/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/aprilfools/interludes', allowedExtensions)) - end - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/menu', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/loading', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/peace', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/war', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warlow', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/warhigh', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/aprilfools/interludes', allowedExtensions)) + if Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] and Spring.GetConfigInt("UseSoundtrackAprilFools", 1) == 1 then + table.append(eventPeaceTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/war", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/war", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/interludes", allowedExtensions)) + elseif (not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"]) and Spring.GetConfigInt("UseSoundtrackAprilFoolsPostEvent", 0) == 1 then + table.append(peaceTracksNew, VFS.DirList(musicDirNew .. "/events/aprilfools/peace", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/aprilfools/war", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/aprilfools/war", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/aprilfools/warlow", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/aprilfools/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/interludes", allowedExtensions)) + end + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/menu", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/loading", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/peace", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/war", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/warlow", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/warhigh", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/aprilfools/interludes", allowedExtensions)) -- Halloween -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1) then - table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/halloween/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/halloween/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/halloween/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/halloween/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"]) and Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1) then - table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/halloween/peace', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/halloween/warlow', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/halloween/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/halloween/interludes', allowedExtensions)) - end - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/menu', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/loading', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/peace', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/war', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/warlow', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/warhigh', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/halloween/interludes', allowedExtensions)) + if Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] and Spring.GetConfigInt("UseSoundtrackHalloween", 1) == 1 then + table.append(eventPeaceTracks, VFS.DirList(musicDirNew .. "/events/halloween/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/halloween/war", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/halloween/war", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/halloween/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/halloween/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/halloween/interludes", allowedExtensions)) + elseif (not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"]) and Spring.GetConfigInt("UseSoundtrackHalloweenPostEvent", 0) == 1 then + table.append(peaceTracksNew, VFS.DirList(musicDirNew .. "/events/halloween/peace", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/halloween/war", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/halloween/war", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/halloween/warlow", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/halloween/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/halloween/interludes", allowedExtensions)) + end + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/menu", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/loading", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/peace", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/war", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/warlow", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/warhigh", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/halloween/interludes", allowedExtensions)) -- Christmas -------------------------------------------------------------------------------------------------------------------- - if (Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1) then - table.append(eventPeaceTracks, VFS.DirList(musicDirNew..'/events/xmas/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList(musicDirNew..'/events/xmas/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList(musicDirNew..'/events/xmas/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/xmas/interludes', allowedExtensions)) - elseif ((not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"]) and Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1) then - table.append(peaceTracksNew, VFS.DirList(musicDirNew..'/events/xmas/peace', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) - table.append(warlowTracksNew, VFS.DirList(musicDirNew..'/events/xmas/warlow', allowedExtensions)) - table.append(warhighTracksNew, VFS.DirList(musicDirNew..'/events/xmas/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList(musicDirNew..'/events/xmas/interludes', allowedExtensions)) - end - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/menu', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/loading', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/peace', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/war', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/warlow', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/warhigh', allowedExtensions)) - table.append(bonusTracks, VFS.DirList(musicDirNew..'/events/xmas/interludes', allowedExtensions)) + if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] and Spring.GetConfigInt("UseSoundtrackXmas", 1) == 1 then + table.append(eventPeaceTracks, VFS.DirList(musicDirNew .. "/events/xmas/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/xmas/war", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/xmas/war", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList(musicDirNew .. "/events/xmas/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList(musicDirNew .. "/events/xmas/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/xmas/interludes", allowedExtensions)) + elseif (not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"]) and Spring.GetConfigInt("UseSoundtrackXmasPostEvent", 0) == 1 then + table.append(peaceTracksNew, VFS.DirList(musicDirNew .. "/events/xmas/peace", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/xmas/war", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/xmas/war", allowedExtensions)) + table.append(warlowTracksNew, VFS.DirList(musicDirNew .. "/events/xmas/warlow", allowedExtensions)) + table.append(warhighTracksNew, VFS.DirList(musicDirNew .. "/events/xmas/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList(musicDirNew .. "/events/xmas/interludes", allowedExtensions)) + end + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/menu", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/loading", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/peace", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/war", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/warlow", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/warhigh", allowedExtensions)) + table.append(bonusTracks, VFS.DirList(musicDirNew .. "/events/xmas/interludes", allowedExtensions)) --------------------------------------------------------------------------------------------------------------------------------- -- Map Music - table.append(eventPeaceTracks, VFS.DirList('music/map/peace', allowedExtensions)) - table.append(eventWarLowTracks, VFS.DirList('music/map/warlow', allowedExtensions)) - table.append(eventWarHighTracks, VFS.DirList('music/map/warhigh', allowedExtensions)) - table.append(interludeTracks, VFS.DirList('music/map/interludes', allowedExtensions)) + table.append(eventPeaceTracks, VFS.DirList("music/map/peace", allowedExtensions)) + table.append(eventWarLowTracks, VFS.DirList("music/map/warlow", allowedExtensions)) + table.append(eventWarHighTracks, VFS.DirList("music/map/warhigh", allowedExtensions)) + table.append(interludeTracks, VFS.DirList("music/map/interludes", allowedExtensions)) - table.append(bonusTracks, VFS.DirList('music/map/loading', allowedExtensions)) - table.append(bonusTracks, VFS.DirList('music/map/peace', allowedExtensions)) - table.append(bonusTracks, VFS.DirList('music/map/warlow', allowedExtensions)) - table.append(bonusTracks, VFS.DirList('music/map/warhigh', allowedExtensions)) - table.append(bonusTracks, VFS.DirList('music/map/interludes', allowedExtensions)) + table.append(bonusTracks, VFS.DirList("music/map/loading", allowedExtensions)) + table.append(bonusTracks, VFS.DirList("music/map/peace", allowedExtensions)) + table.append(bonusTracks, VFS.DirList("music/map/warlow", allowedExtensions)) + table.append(bonusTracks, VFS.DirList("music/map/warhigh", allowedExtensions)) + table.append(bonusTracks, VFS.DirList("music/map/interludes", allowedExtensions)) end -------------------------------CREATE PLAYLISTS----------------------------------- @@ -357,25 +355,25 @@ local function ReloadMusicPlaylists() local r = mathRandom(#originalPlaylist) table.insert(shuffledPlaylist, originalPlaylist[r]) table.remove(originalPlaylist, r) - until(#originalPlaylist == 0) + until #originalPlaylist == 0 else shuffledPlaylist = originalPlaylist end return shuffledPlaylist end - peaceTracks = shuffleMusic(peaceTracks) - warhighTracks = shuffleMusic(warhighTracks) - warlowTracks = shuffleMusic(warlowTracks) - interludeTracks = shuffleMusic(interludeTracks) - victoryTracks = shuffleMusic(victoryTracks) - defeatTracks = shuffleMusic(defeatTracks) - gameoverTracks = shuffleMusic(gameoverTracks) - bossFightTracks = shuffleMusic(bossFightTracks) - eventPeaceTracks = shuffleMusic(eventPeaceTracks) - eventWarLowTracks = shuffleMusic(eventWarLowTracks) + peaceTracks = shuffleMusic(peaceTracks) + warhighTracks = shuffleMusic(warhighTracks) + warlowTracks = shuffleMusic(warlowTracks) + interludeTracks = shuffleMusic(interludeTracks) + victoryTracks = shuffleMusic(victoryTracks) + defeatTracks = shuffleMusic(defeatTracks) + gameoverTracks = shuffleMusic(gameoverTracks) + bossFightTracks = shuffleMusic(bossFightTracks) + eventPeaceTracks = shuffleMusic(eventPeaceTracks) + eventWarLowTracks = shuffleMusic(eventWarLowTracks) eventWarHighTracks = shuffleMusic(eventWarHighTracks) - bonusTracks = shuffleMusic(bonusTracks) + bonusTracks = shuffleMusic(bonusTracks) -- spEcho("----- MUSIC PLAYER PLAYLIST -----") -- spEcho("----- peaceTracks -----") @@ -480,7 +478,7 @@ local faderMin = 45 -- range in dB for volume faders, from -faderMin to 0dB local playedTime, totalTime = Spring.GetSoundStreamTime() local prevPlayedTime = playedTime -local maxMusicVolume = Spring.GetConfigInt("snd_volmusic", 50) -- user value, cause actual volume will change during fadein/outc +local maxMusicVolume = Spring.GetConfigInt("snd_volmusic", 50) -- user value, cause actual volume will change during fadein/outc if maxMusicVolume > 99 then Spring.SetConfigInt("snd_volmusic", 99) maxMusicVolume = 99 @@ -498,7 +496,7 @@ local drawlist = {} local advplayerlistPos = {} local widgetScale = 1 local widgetHeight = 22 -local top, left, bottom, right = 0,0,0,0 +local top, left, bottom, right = 0, 0, 0, 0 local borderPadding = bgpadding local updateDrawing = false local guishaderWasActive = false @@ -506,21 +504,21 @@ local guishaderWasActive = false local vsx, vsy = spGetViewGeometry() local ui_opacity = Spring.GetConfigFloat("ui_opacity", 0.7) -local playing = (Spring.GetConfigInt('music', 1) == 1) +local playing = (Spring.GetConfigInt("music", 1) == 1) local shutdown -local playTex = ":l:"..LUAUI_DIRNAME.."Images/music/play.png" -local pauseTex = ":l:"..LUAUI_DIRNAME.."Images/music/pause.png" -local nextTex = ":l:"..LUAUI_DIRNAME.."Images/music/next.png" -local musicTex = ":l:"..LUAUI_DIRNAME.."Images/music/music.png" -local volumeTex = ":l:"..LUAUI_DIRNAME.."Images/music/volume.png" +local playTex = ":l:" .. LUAUI_DIRNAME .. "Images/music/play.png" +local pauseTex = ":l:" .. LUAUI_DIRNAME .. "Images/music/pause.png" +local nextTex = ":l:" .. LUAUI_DIRNAME .. "Images/music/next.png" +local musicTex = ":l:" .. LUAUI_DIRNAME .. "Images/music/music.png" +local volumeTex = ":l:" .. LUAUI_DIRNAME .. "Images/music/volume.png" -local glColor = gl.Color -local glTexRect = gl.TexRect -local glTexture = gl.Texture -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glColor = gl.Color +local glTexRect = gl.TexRect +local glTexture = gl.Texture +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList local glBlending = gl.Blending local GL_SRC_ALPHA = GL.SRC_ALPHA @@ -547,7 +545,7 @@ local function getVolumePos(coef) return 1 end local db = math.log10(coef) * 20 - return (db/faderMin) + 1 + return (db / faderMin) + 1 end local fadeDirection @@ -599,22 +597,22 @@ local function updateFade() end local function getSliderWidth() - return mathFloor((4.5 * widgetScale)+0.5) + return mathFloor((4.5 * widgetScale) + 0.5) end local function capitalize(text) - local str = '' + local str = "" local upperNext = true - local char = '' - for i=1, string.len(text) do - char = string.sub(text, i,i) + local char = "" + for i = 1, string.len(text) do + char = string.sub(text, i, i) if upperNext then - str = str..string.upper(char) + str = str .. string.upper(char) upperNext = false else - str = str..char + str = str .. char end - if char == ' ' then + if char == " " then upperNext = true end end @@ -628,10 +626,10 @@ local function processTrackname(trackname) end local function drawBackground() - UiElement(left, bottom, right, top, 1,0,0,1, 1,1,0,1, nil, nil, nil, nil) + UiElement(left, bottom, right, top, 1, 0, 0, 1, 1, 1, 0, 1, nil, nil, nil, nil) borderPadding = bgpadding borderPaddingRight = borderPadding - if right >= vsx-0.2 then + if right >= vsx - 0.2 then borderPaddingRight = 0 end borderPaddingLeft = borderPadding @@ -643,90 +641,90 @@ end local function drawContent() local trackname local padding2 = mathFloor(2.5 * widgetScale) -- inner icon padding - local textsize = 11 * widgetScale * math.clamp(1+((1-(vsy/1200))*0.4), 1, 1.15) + local textsize = 11 * widgetScale * math.clamp(1 + ((1 - (vsy / 1200)) * 0.4), 1, 1.15) local textXPadding = 10 * widgetScale --local maxTextWidth = right-buttons['playpause'][3]-textXPadding-textXPadding - local maxTextWidth = right-textXPadding-textXPadding + local maxTextWidth = right - textXPadding - textXPadding - local button = 'playpause' + local button = "playpause" if not mouseover and not draggingSlider and playing and volume > 0 and playedTime < totalTime then -- track name - trackname = currentTrack or '' - glColor(0.45,0.45,0.45,1) + trackname = currentTrack or "" + glColor(0.45, 0.45, 0.45, 1) trackname = processTrackname(trackname) - local text = '' + local text = "" for i = 1, #trackname do - local c = string.sub(trackname, i,i) - local width = font:GetTextWidth(text..c) * textsize + local c = string.sub(trackname, i, i) + local width = font:GetTextWidth(text .. c) * textsize if width > maxTextWidth then break else - text = text..c + text = text .. c end end trackname = text - glColor(0.8,0.8,0.8,0.9) + glColor(0.8, 0.8, 0.8, 0.9) glTexture(musicTex) - glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + glTexRect(buttons[button][1] + padding2, buttons[button][2] + padding2, buttons[button][3] - padding2, buttons[button][4] - padding2) glTexture(false) font:Begin(true) - font:SetOutlineColor(0.15,0.15,0.15,0.8) - font:Print("\255\225\225\225"..trackname, buttons[button][3]+mathCeil(padding2*1.1), bottom+(0.48*widgetHeight*widgetScale)-(textsize*0.35), textsize, 'no') + font:SetOutlineColor(0.15, 0.15, 0.15, 0.8) + font:Print("\255\225\225\225" .. trackname, buttons[button][3] + mathCeil(padding2 * 1.1), bottom + (0.48 * widgetHeight * widgetScale) - (textsize * 0.35), textsize, "no") font:End() else - glColor(0.88,0.88,0.88,0.9) + glColor(0.88, 0.88, 0.88, 0.9) if playing then glTexture(pauseTex) else glTexture(playTex) end - glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + glTexRect(buttons[button][1] + padding2, buttons[button][2] + padding2, buttons[button][3] - padding2, buttons[button][4] - padding2) - button = 'next' - glColor(0.88,0.88,0.88,0.9) + button = "next" + glColor(0.88, 0.88, 0.88, 0.9) glTexture(nextTex) - glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + glTexRect(buttons[button][1] + padding2, buttons[button][2] + padding2, buttons[button][3] - padding2, buttons[button][4] - padding2) - local sliderWidth = mathFloor((4.5 * widgetScale)+0.5) - local lineHeight = mathFloor((1.65 * widgetScale)+0.5) + local sliderWidth = mathFloor((4.5 * widgetScale) + 0.5) + local lineHeight = mathFloor((1.65 * widgetScale) + 0.5) - local button = 'musicvolumeicon' - local sliderY = mathFloor(buttons[button][2] + (buttons[button][4] - buttons[button][2])/2) - glColor(0.8,0.8,0.8,0.9) + local button = "musicvolumeicon" + local sliderY = mathFloor(buttons[button][2] + (buttons[button][4] - buttons[button][2]) / 2) + glColor(0.8, 0.8, 0.8, 0.9) glTexture(musicTex) - glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + glTexRect(buttons[button][1] + padding2, buttons[button][2] + padding2, buttons[button][3] - padding2, buttons[button][4] - padding2) glTexture(false) - button = 'musicvolume' - UiSlider(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight) - UiSliderKnob(buttons[button][5]-(sliderWidth/2), sliderY, sliderWidth) + button = "musicvolume" + UiSlider(buttons[button][1], sliderY - lineHeight, buttons[button][3], sliderY + lineHeight) + UiSliderKnob(buttons[button][5] - (sliderWidth / 2), sliderY, sliderWidth) - button = 'volumeicon' - glColor(0.8,0.8,0.8,0.9) + button = "volumeicon" + glColor(0.8, 0.8, 0.8, 0.9) glTexture(volumeTex) - glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + glTexRect(buttons[button][1] + padding2, buttons[button][2] + padding2, buttons[button][3] - padding2, buttons[button][4] - padding2) glTexture(false) - button = 'volume' - UiSlider(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight) - UiSliderKnob(buttons[button][5]-(sliderWidth/2), sliderY, sliderWidth) + button = "volume" + UiSlider(buttons[button][1], sliderY - lineHeight, buttons[button][3], sliderY + lineHeight) + UiSliderKnob(buttons[button][5] - (sliderWidth / 2), sliderY, sliderWidth) end end local function refreshUiDrawing() - if WG['guishader'] then + if WG["guishader"] then if guishaderList then guishaderList = glDeleteList(guishaderList) end - guishaderList = glCreateList( function() - RectRound(left, bottom, right, top, elementCorner, 1,0,0,1) + guishaderList = glCreateList(function() + RectRound(left, bottom, right, top, elementCorner, 1, 0, 0, 1) end) - WG['guishader'].InsertDlist(guishaderList, 'music', true) + WG["guishader"].InsertDlist(guishaderList, "music", true) end local trackname @@ -736,35 +734,35 @@ local function refreshUiDrawing() local textsize = 11 * widgetScale local textXPadding = 10 * widgetScale --local maxTextWidth = right-buttons['playpause'][3]-textXPadding-textXPadding - local maxTextWidth = right-textXPadding-textXPadding + local maxTextWidth = right - textXPadding - textXPadding - buttons['playpause'] = {left+padding+padding, bottom+padding+heightoffset, left+(widgetHeight*widgetScale), top-padding+heightoffset} - buttons['next'] = {buttons['playpause'][3]+padding, bottom+padding+heightoffset, buttons['playpause'][3]+((widgetHeight*widgetScale)-padding), top-padding+heightoffset} + buttons["playpause"] = { left + padding + padding, bottom + padding + heightoffset, left + (widgetHeight * widgetScale), top - padding + heightoffset } + buttons["next"] = { buttons["playpause"][3] + padding, bottom + padding + heightoffset, buttons["playpause"][3] + ((widgetHeight * widgetScale) - padding), top - padding + heightoffset } - buttons['musicvolumeicon'] = {buttons['next'][3]+padding+padding, bottom+padding+heightoffset, buttons['next'][3]+((widgetHeight * widgetScale)), top-padding+heightoffset} + buttons["musicvolumeicon"] = { buttons["next"][3] + padding + padding, bottom + padding + heightoffset, buttons["next"][3] + (widgetHeight * widgetScale), top - padding + heightoffset } --buttons['musicvolumeicon'] = {left+padding+padding, bottom+padding+heightoffset, left+(widgetHeight*widgetScale), top-padding+heightoffset} - local sliderKnobWidth = mathFloor((4.5 * widgetScale)+0.5) + local sliderKnobWidth = mathFloor((4.5 * widgetScale) + 0.5) local endPadding = mathFloor(1 * widgetScale) local maxRight = vsx - endPadding - (sliderKnobWidth / 2) local fixedWidth = padding * 4 + (widgetHeight * widgetScale) - local volumeWidth = mathMax(mathMin(mathFloor((maxRight - buttons['musicvolumeicon'][3] - fixedWidth) / 2), mathFloor(50 * widgetScale)), mathFloor(30 * widgetScale)) + local volumeWidth = mathMax(mathMin(mathFloor((maxRight - buttons["musicvolumeicon"][3] - fixedWidth) / 2), mathFloor(50 * widgetScale)), mathFloor(30 * widgetScale)) - buttons['musicvolume'] = {buttons['musicvolumeicon'][3]+padding, bottom+padding+heightoffset, buttons['musicvolumeicon'][3]+padding+volumeWidth, top-padding+heightoffset} - buttons['musicvolume'][5] = mathMax(buttons['musicvolume'][1] + (sliderKnobWidth / 2), mathMin(buttons['musicvolume'][3] - (sliderKnobWidth / 2), buttons['musicvolume'][1] + (buttons['musicvolume'][3] - buttons['musicvolume'][1]) * (getVolumePos(maxMusicVolume/99)))) + buttons["musicvolume"] = { buttons["musicvolumeicon"][3] + padding, bottom + padding + heightoffset, buttons["musicvolumeicon"][3] + padding + volumeWidth, top - padding + heightoffset } + buttons["musicvolume"][5] = mathMax(buttons["musicvolume"][1] + (sliderKnobWidth / 2), mathMin(buttons["musicvolume"][3] - (sliderKnobWidth / 2), buttons["musicvolume"][1] + (buttons["musicvolume"][3] - buttons["musicvolume"][1]) * (getVolumePos(maxMusicVolume / 99)))) - buttons['volumeicon'] = {buttons['musicvolume'][3]+padding*3, bottom+padding+heightoffset, buttons['musicvolume'][3]+(widgetHeight * widgetScale), top-padding+heightoffset} - buttons['volume'] = {buttons['volumeicon'][3]+padding, bottom+padding+heightoffset, buttons['volumeicon'][3]+padding+volumeWidth, top-padding+heightoffset} - buttons['volume'][5] = mathMax(buttons['volume'][1] + (sliderKnobWidth / 2), mathMin(buttons['volume'][3] - (sliderKnobWidth / 2), buttons['volume'][1] + (buttons['volume'][3] - buttons['volume'][1]) * (getVolumePos(volume/80)))) + buttons["volumeicon"] = { buttons["musicvolume"][3] + padding * 3, bottom + padding + heightoffset, buttons["musicvolume"][3] + (widgetHeight * widgetScale), top - padding + heightoffset } + buttons["volume"] = { buttons["volumeicon"][3] + padding, bottom + padding + heightoffset, buttons["volumeicon"][3] + padding + volumeWidth, top - padding + heightoffset } + buttons["volume"][5] = mathMax(buttons["volume"][1] + (sliderKnobWidth / 2), mathMin(buttons["volume"][3] - (sliderKnobWidth / 2), buttons["volume"][1] + (buttons["volume"][3] - buttons["volume"][1]) * (getVolumePos(volume / 80)))) if drawlist[1] ~= nil then - for i=1, #drawlist do + for i = 1, #drawlist do glDeleteList(drawlist[i]) end end - if right-left >= 1 and top-bottom >= 1 then + if right - left >= 1 and top - bottom >= 1 then if not uiBgTex then - uiBgTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { + uiBgTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -772,7 +770,7 @@ local function refreshUiDrawing() gl.R2tHelper.RenderInRect(uiBgTex, left, bottom, right, top, drawBackground, true) end if not uiTex then - uiTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { --*(vsy<1400 and 2 or 1) + uiTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -780,27 +778,27 @@ local function refreshUiDrawing() end gl.R2tHelper.RenderInRect(uiTex, left, bottom, right, top, drawContent, true) end - if WG['tooltip'] ~= nil and trackname then - if trackname and trackname ~= '' then - WG['tooltip'].AddTooltip('music', {left, bottom, right, top}, trackname, 0.8) + if WG["tooltip"] ~= nil and trackname then + if trackname and trackname ~= "" then + WG["tooltip"].AddTooltip("music", { left, bottom, right, top }, trackname, 0.8) else - WG['tooltip'].RemoveTooltip('music') + WG["tooltip"].RemoveTooltip("music") end end end local function updatePosition(force) local prevPos = advplayerlistPos - if WG['advplayerlist_api'] ~= nil then - advplayerlistPos = WG['advplayerlist_api'].GetPosition() + if WG["advplayerlist_api"] ~= nil then + advplayerlistPos = WG["advplayerlist_api"].GetPosition() else local scale = (vsy / 880) * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) - advplayerlistPos = {0,vsx-(220*scale),0,vsx,scale} + advplayerlistPos = { 0, vsx - (220 * scale), 0, vsx, scale } end left = advplayerlistPos[2] bottom = advplayerlistPos[1] right = advplayerlistPos[4] - top = mathCeil(advplayerlistPos[1]+(widgetHeight * advplayerlistPos[5])) + top = mathCeil(advplayerlistPos[1] + (widgetHeight * advplayerlistPos[5])) widgetScale = advplayerlistPos[5] if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then widget:ViewResize() @@ -809,39 +807,39 @@ end function widget:Initialize() isChangingTrack = false - if spGetGameFrame() == 0 and Spring.GetConfigInt('music_loadscreen', 1) == 1 then - currentTrack = Spring.GetConfigString('music_loadscreen_track', '') + if spGetGameFrame() == 0 and Spring.GetConfigInt("music_loadscreen", 1) == 1 then + currentTrack = Spring.GetConfigString("music_loadscreen_track", "") end ReloadMusicPlaylists() widget:ViewResize() --Spring.StopSoundStream() -- only for testing purposes - WG['music'] = {} - WG['music'].GetPosition = function() + WG["music"] = {} + WG["music"].GetPosition = function() if shutdown then return false end updatePosition() - return {showGUI and top or bottom,left,bottom,right,widgetScale} + return { showGUI and top or bottom, left, bottom, right, widgetScale } end - WG['music'].GetMusicVolume = function() + WG["music"].GetMusicVolume = function() return maxMusicVolume end - WG['music'].SetMusicVolume = function(value) + WG["music"].SetMusicVolume = function(value) maxMusicVolume = value - Spring.SetConfigInt("snd_volmusic", mathMin(99,mathCeil(maxMusicVolume))) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 + Spring.SetConfigInt("snd_volmusic", mathMin(99, mathCeil(maxMusicVolume))) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 if fadeDirection then setMusicVolume(fadeLevel) end updateDrawing = true end - WG['music'].GetShowGui = function() + WG["music"].GetShowGui = function() return showGUI end - WG['music'].SetShowGui = function(value) + WG["music"].SetShowGui = function(value) showGUI = value end - WG['music'].getTracksConfig = function(value) + WG["music"].getTracksConfig = function(value) local tracksConfig = {} local function sortPlaylist(playlist) @@ -854,95 +852,95 @@ function widget:Initialize() local menuTracksSorted = table.copy(menuTracks) sortPlaylist(menuTracksSorted) - for k,v in pairs(menuTracksSorted) do + for k, v in pairs(menuTracksSorted) do if menuTracksSorted[k] and not string.find(menuTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.menu'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.menu"), processTrackname(v), v } end end local loadingTracksSorted = table.copy(loadingTracks) sortPlaylist(loadingTracksSorted) - for k,v in pairs(loadingTracksSorted) do + for k, v in pairs(loadingTracksSorted) do if loadingTracksSorted[k] and not string.find(loadingTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.loading'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.loading"), processTrackname(v), v } end end local peaceTracksSorted = table.copy(peaceTracks) sortPlaylist(peaceTracksSorted) - for k,v in pairs(peaceTracksSorted) do + for k, v in pairs(peaceTracksSorted) do if peaceTracksSorted[k] and not string.find(peaceTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.peace'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.peace"), processTrackname(v), v } end end local warlowTracksSorted = table.copy(warlowTracks) sortPlaylist(warlowTracksSorted) - for k,v in pairs(warlowTracksSorted) do + for k, v in pairs(warlowTracksSorted) do if warlowTracksSorted[k] and not string.find(warlowTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.warlow'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.warlow"), processTrackname(v), v } end end local warhighTracksSorted = table.copy(warhighTracks) sortPlaylist(warhighTracksSorted) - for k,v in pairs(warhighTracksSorted) do + for k, v in pairs(warhighTracksSorted) do if warhighTracksSorted[k] and not string.find(warhighTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.warhigh'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.warhigh"), processTrackname(v), v } end end local interludeTracksSorted = table.copy(interludeTracks) sortPlaylist(interludeTracksSorted) - for k,v in pairs(interludeTracksSorted) do + for k, v in pairs(interludeTracksSorted) do if interludeTracksSorted[k] and not string.find(interludeTracksSorted[k], "/events/") then - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.interludes'), processTrackname(v), v} + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.interludes"), processTrackname(v), v } end end local raptorTracksSorted = table.copy(raptorTracks) sortPlaylist(raptorTracksSorted) - for k,v in pairs(raptorTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.raptors'), processTrackname(v), v} + for k, v in pairs(raptorTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.raptors"), processTrackname(v), v } end local scavTracksSorted = table.copy(scavTracks) sortPlaylist(scavTracksSorted) - for k,v in pairs(scavTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.scavengers'), processTrackname(v), v} + for k, v in pairs(scavTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.scavengers"), processTrackname(v), v } end local victoryTracksSorted = table.copy(victoryTracks) sortPlaylist(victoryTracksSorted) - for k,v in pairs(victoryTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.victory'), processTrackname(v), v} + for k, v in pairs(victoryTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.victory"), processTrackname(v), v } end local defeatTracksSorted = table.copy(defeatTracks) sortPlaylist(defeatTracksSorted) - for k,v in pairs(defeatTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.defeat'), processTrackname(v), v} + for k, v in pairs(defeatTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.defeat"), processTrackname(v), v } end local gameoverTracksSorted = table.copy(gameoverTracks) sortPlaylist(gameoverTracksSorted) - for k,v in pairs(gameoverTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.gameover'), processTrackname(v), v} + for k, v in pairs(gameoverTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.gameover"), processTrackname(v), v } end local bonusTracksSorted = table.copy(bonusTracks) sortPlaylist(bonusTracksSorted) - for k,v in pairs(bonusTracksSorted) do - tracksConfig[#tracksConfig+1] = {Spring.I18N('ui.music.bonus'), processTrackname(v), v} + for k, v in pairs(bonusTracksSorted) do + tracksConfig[#tracksConfig + 1] = { Spring.I18N("ui.music.bonus"), processTrackname(v), v } end return tracksConfig end - WG['music'].playTrack = function(track) + WG["music"].playTrack = function(track) currentTrack = track Spring.StopSoundStream() Spring.PlaySoundStream(currentTrack, 1) playing = true - Spring.SetConfigInt('music', (playing and 1 or 0)) + Spring.SetConfigInt("music", (playing and 1 or 0)) local playedTime, totalTime = Spring.GetSoundStreamTime() interruptionTime = totalTime + 2 if fadeDirection then @@ -952,10 +950,10 @@ function widget:Initialize() end updateDrawing = true end - WG['music'].RefreshSettings = function() - interruptionEnabled = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1 + WG["music"].RefreshSettings = function() + interruptionEnabled = Spring.GetConfigInt("UseSoundtrackInterruption", 1) == 1 end - WG['music'].RefreshTrackList = function() + WG["music"].RefreshTrackList = function() Spring.StopSoundStream() ReloadMusicPlaylists() playInterlude = false @@ -965,18 +963,20 @@ end function widget:Shutdown() shutdown = true - Spring.SetConfigInt('music', (playing and 1 or 0)) + Spring.SetConfigInt("music", (playing and 1 or 0)) - if WG['guishader'] then - WG['guishader'].RemoveDlist('music') + if WG["guishader"] then + WG["guishader"].RemoveDlist("music") end - if WG['tooltip'] ~= nil then - WG['tooltip'].RemoveTooltip('music') + if WG["tooltip"] ~= nil then + WG["tooltip"].RemoveTooltip("music") end - for i=1,#drawlist do + for i = 1, #drawlist do glDeleteList(drawlist[i]) end - if guishaderList then glDeleteList(guishaderList) end + if guishaderList then + glDeleteList(guishaderList) + end if uiBgTex then gl.DeleteTexture(uiBgTex) uiBgTex = nil @@ -985,15 +985,13 @@ function widget:Shutdown() gl.DeleteTexture(uiTex) uiTex = nil end - WG['music'] = nil + WG["music"] = nil end - - -function widget:ViewResize(newX,newY) +function widget:ViewResize(newX, newY) vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() bgpadding = WG.FlowUI.elementPadding elementCorner = WG.FlowUI.elementCorner @@ -1002,14 +1000,14 @@ function widget:ViewResize(newX,newY) UiButton = WG.FlowUI.Draw.Button UiSliderKnob = WG.FlowUI.Draw.SliderKnob UiSlider = function(px, py, sx, sy) - local cs = (sy-py)*0.25 - local edgeWidth = mathMax(1, mathFloor((sy-py) * 0.1)) + local cs = (sy - py) * 0.25 + local edgeWidth = mathMax(1, mathFloor((sy - py) * 0.1)) -- faint dark outline edge - RectRound(px-edgeWidth, py-edgeWidth, sx+edgeWidth, sy+edgeWidth, cs*1.5, 1,1,1,1, { 0,0,0,0.05 }) + RectRound(px - edgeWidth, py - edgeWidth, sx + edgeWidth, sy + edgeWidth, cs * 1.5, 1, 1, 1, 1, { 0, 0, 0, 0.05 }) -- bottom - RectRound(px, py, sx, sy, cs, 1,1,1,1, { 1, 1, 1, 0.1 }, { 1, 1, 1, 0 }) + RectRound(px, py, sx, sy, cs, 1, 1, 1, 1, { 1, 1, 1, 0.1 }, { 1, 1, 1, 0 }) -- top - RectRound(px, py, sx, sy, cs, 1,1,1,1, { 0.1, 0.1, 0.1, 0.22 }, { 0.9,0.9,0.9, 0.22 }) + RectRound(px, py, sx, sy, cs, 1, 1, 1, 1, { 0.1, 0.1, 0.1, 0.22 }, { 0.9, 0.9, 0.9, 0.22 }) end updateDrawing = true @@ -1023,23 +1021,27 @@ end local function getSliderValue(button, x) local sliderWidth = buttons[button][3] - buttons[button][1] - local value = (x - buttons[button][1]) / (sliderWidth) - if value < 0 then value = 0 end - if value > 1 then value = 1 end + local value = (x - buttons[button][1]) / sliderWidth + if value < 0 then + value = 0 + end + if value > 1 then + value = 1 + end return value end function widget:MouseMove(x, y) if showGUI and draggingSlider ~= nil then - if draggingSlider == 'musicvolume' then + if draggingSlider == "musicvolume" then maxMusicVolume = mathCeil(getVolumeCoef(getSliderValue(draggingSlider, x)) * 99) - Spring.SetConfigInt("snd_volmusic", mathMin(99,maxMusicVolume)) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 + Spring.SetConfigInt("snd_volmusic", mathMin(99, maxMusicVolume)) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 if fadeDirection then setMusicVolume(fadeLevel) end updateDrawing = true end - if draggingSlider == 'volume' then + if draggingSlider == "volume" then volume = mathCeil(getVolumeCoef(getSliderValue(draggingSlider, x)) * 80) Spring.SetConfigInt("snd_volmaster", volume) updateDrawing = true @@ -1048,19 +1050,23 @@ function widget:MouseMove(x, y) end local function mouseEvent(x, y, button, release) - if Spring.IsGUIHidden() then return false end - if not showGUI then return end + if Spring.IsGUIHidden() then + return false + end + if not showGUI then + return + end if button == 1 then if not release then local sliderWidth = (3.3 * widgetScale) -- should be same as in createlist() - local button = 'musicvolume' + local button = "musicvolume" if math_isInRect(x, y, buttons[button][1] - sliderWidth, buttons[button][2], buttons[button][3] + sliderWidth, buttons[button][4]) then draggingSlider = button maxMusicVolume = mathCeil(getVolumeCoef(getSliderValue(button, x)) * 99) - Spring.SetConfigInt("snd_volmusic", mathMin(99, maxMusicVolume)) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 + Spring.SetConfigInt("snd_volmusic", mathMin(99, maxMusicVolume)) -- It took us 2 and half year to realize that the engine is not saving value of a 100 because it's engine default, which is why we're maxing it at 99 updateDrawing = true end - button = 'volume' + button = "volume" if math_isInRect(x, y, buttons[button][1] - sliderWidth, buttons[button][2], buttons[button][3] + sliderWidth, buttons[button][4]) then draggingSlider = button volume = mathCeil(getVolumeCoef(getSliderValue(button, x)) * 80) @@ -1072,14 +1078,14 @@ local function mouseEvent(x, y, button, release) draggingSlider = nil end if button == 1 and not release and math_isInRect(x, y, left, bottom, right, top) then - if buttons['playpause'] ~= nil and math_isInRect(x, y, buttons['playpause'][1], buttons['playpause'][2], buttons['playpause'][3], buttons['playpause'][4]) then + if buttons["playpause"] ~= nil and math_isInRect(x, y, buttons["playpause"][1], buttons["playpause"][2], buttons["playpause"][3], buttons["playpause"][4]) then playing = not playing - Spring.SetConfigInt('music', (playing and 1 or 0)) + Spring.SetConfigInt("music", (playing and 1 or 0)) Spring.PauseSoundStream() updateDrawing = true - elseif buttons['next'] ~= nil and math_isInRect(x, y, buttons['next'][1], buttons['next'][2], buttons['next'][3], buttons['next'][4]) then + elseif buttons["next"] ~= nil and math_isInRect(x, y, buttons["next"][1], buttons["next"][2], buttons["next"][3], buttons["next"][4]) then playing = true - Spring.SetConfigInt('music', (playing and 1 or 0)) + Spring.SetConfigInt("music", (playing and 1 or 0)) playInterlude = false PlayNewTrack() end @@ -1103,7 +1109,7 @@ end local playingInit = false function widget:Update(dt) local frame = spGetGameFrame() - local _,_,paused = Spring.GetGameSpeed() + local _, _, paused = Spring.GetGameSpeed() playedTime, totalTime = Spring.GetSoundStreamTime() @@ -1148,13 +1154,15 @@ end local prevShowTrackname = false function widget:DrawScreen() - if not showGUI then return end + if not showGUI then + return + end updatePosition() local mx, my, mlb = spGetMouseState() prevMouseover = mouseover mouseover = false - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then mouseover = false else if math_isInRect(mx, my, left, bottom, right, top) then @@ -1170,7 +1178,7 @@ function widget:DrawScreen() showTrackname = not (not mouseover and not draggingSlider and playing and volume > 0 and playedTime < totalTime) -- detect guishader widget being toggled back on - local guishaderNow = WG['guishader'] ~= nil + local guishaderNow = WG["guishader"] ~= nil if guishaderNow and not guishaderWasActive then guishaderList = glDeleteList(guishaderList) updateDrawing = true @@ -1205,11 +1213,11 @@ function widget:DrawScreen() local color = { 1, 1, 1, 0.1 } local colorHighlight = { 1, 1, 1, 0.3 } glBlending(GL_SRC_ALPHA, GL_ONE) - local button = 'playpause' + local button = "playpause" if buttons[button] ~= nil and math_isInRect(mx, my, buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) then UiButton(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4], 1, 1, 1, 1, 1, 1, 1, 1, 1, mlb and colorHighlight or color) end - local button = 'next' + local button = "next" if buttons[button] ~= nil and math_isInRect(mx, my, buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) then UiButton(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4], 1, 1, 1, 1, 1, 1, 1, 1, 1, mlb and colorHighlight or color) end @@ -1218,16 +1226,18 @@ function widget:DrawScreen() end if mouseover then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") end end function PlayNewTrack(paused) - if isChangingTrack then return end + if isChangingTrack then + return + end isChangingTrack = true lastTrackAttemptTime = Spring.GetTimer() - if Spring.GetConfigInt('music', 1) ~= 1 then + if Spring.GetConfigInt("music", 1) ~= 1 then isChangingTrack = false return end @@ -1284,11 +1294,19 @@ function PlayNewTrack(paused) currentTrackList = eventWarLowTracks currentTrackListString = "eventWarLow" songsSinceEvent = 0 - if mathRandom() <= 0.25 and playInterlude == false then playInterlude = true else playInterlude = false end + if mathRandom() <= 0.25 and playInterlude == false then + playInterlude = true + else + playInterlude = false + end else currentTrackList = warlowTracks currentTrackListString = "warLow" - if mathRandom() <= 0.5 and playInterlude == false then playInterlude = true else playInterlude = false end + if mathRandom() <= 0.5 and playInterlude == false then + playInterlude = true + else + playInterlude = false + end end else if #interludeTracks > 0 and playInterlude then @@ -1299,11 +1317,19 @@ function PlayNewTrack(paused) currentTrackList = eventPeaceTracks currentTrackListString = "eventPeace" songsSinceEvent = 0 - if mathRandom() <= 0.375 and playInterlude == false then playInterlude = true else playInterlude = false end + if mathRandom() <= 0.375 and playInterlude == false then + playInterlude = true + else + playInterlude = false + end else currentTrackList = peaceTracks currentTrackListString = "peace" - if mathRandom() <= 0.75 and playInterlude == false then playInterlude = true else playInterlude = false end + if mathRandom() <= 0.75 and playInterlude == false then + playInterlude = true + else + playInterlude = false + end end end @@ -1430,7 +1456,7 @@ end function widget:GameFrame(n) gameFrame = n - if n%1800 == 0 then + if n % 1800 == 0 then deviceLostSafetyCheck = 0 end @@ -1443,10 +1469,10 @@ function widget:GameFrame(n) end if warMeter > 0 then - if n%30 == 15 then + if n % 30 == 15 then warMeter = mathFloor(warMeter - (warMeter * 0.04)) - if warMeter > warHighLevel*3 then - warMeter = warHighLevel*3 + if warMeter > warHighLevel * 3 then + warMeter = warHighLevel * 3 end warMeterResetTimer = warMeterResetTimer + 1 if warMeterResetTimer > warMeterResetTime then @@ -1456,20 +1482,20 @@ function widget:GameFrame(n) end if Spring.Utilities.Gametype.IsRaptors() then - if (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 60 and warMeter < warHighLevel+1 then - warMeter = warHighLevel+1 - elseif (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 20 and warMeter < warLowLevel+1 then - warMeter = warLowLevel+1 + if (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 60 and warMeter < warHighLevel + 1 then + warMeter = warHighLevel + 1 + elseif (Spring.GetGameRulesParam("raptorQueenAnger", 0)) > 20 and warMeter < warLowLevel + 1 then + warMeter = warLowLevel + 1 end elseif Spring.Utilities.Gametype.IsScavengers() then - if (Spring.GetGameRulesParam("scavBossAnger", 0)) > 60 and warMeter < warHighLevel+1 then - warMeter = warHighLevel+1 - elseif (Spring.GetGameRulesParam("scavBossAnger", 0)) > 20 and warMeter < warLowLevel+1 then - warMeter = warLowLevel+1 + if (Spring.GetGameRulesParam("scavBossAnger", 0)) > 60 and warMeter < warHighLevel + 1 then + warMeter = warHighLevel + 1 + elseif (Spring.GetGameRulesParam("scavBossAnger", 0)) > 20 and warMeter < warLowLevel + 1 then + warMeter = warLowLevel + 1 end end - if n%30 == 15 then + if n % 30 == 15 then if Spring.GetGameRulesParam("BossFightStarted") and Spring.GetGameRulesParam("BossFightStarted") == 1 then bossHasSpawned = true else @@ -1492,16 +1518,19 @@ function widget:GameFrame(n) if (bossHasSpawned and currentTrackListString ~= "bossFight") or ((not bossHasSpawned) and currentTrackListString == "bossFight") then fadeDirection = -2 fadeOutSkipTrack = true - elseif (interruptionEnabled and (playedTime >= interruptionTime) and gameFrame >= serverFrame-300) - and ((currentTrackListString == "intro" and n > 90) - or (currentTrackListString == "peace" and warMeter > (warHighLevel+warLowLevel)* 0.5 ) -- Peace in battle times, let's play some WarLow music at half of WarHigh threshold - or (currentTrackListString == "warLow" and warMeter > warHighLevel * 2 ) -- WarLow music is playing but battle intensity is very high, Let's switch to WarHigh at double of WarHigh threshold - or (currentTrackListString == "warHigh" and warMeter <= warLowLevel * 0.5 ) -- WarHigh music is playing, but it has been quite peaceful recently. Let's switch to peace music at 50% of WarLow threshold - or (currentTrackListString == "warLow" and warMeter <= warLowLevel * 0.25 ) -- WarLow music is playing, but it has been quite peaceful recently. Let's switch to peace music at 25% of WarLow threshold - or (currentTrackListString == "interlude" and warMeter > warHighLevel*1.05 )) then -- Interlude is playing but we're hitting WarHigh levels. Let's switch to WarHigh - fadeDirection = -2 - fadeOutSkipTrack = true - elseif (playedTime >= totalTime - 12 and Spring.GetConfigInt("UseSoundtrackFades", 1) == 1) then + elseif + (interruptionEnabled and (playedTime >= interruptionTime) and gameFrame >= serverFrame - 300) and ( + (currentTrackListString == "intro" and n > 90) + or (currentTrackListString == "peace" and warMeter > (warHighLevel + warLowLevel) * 0.5) -- Peace in battle times, let's play some WarLow music at half of WarHigh threshold + or (currentTrackListString == "warLow" and warMeter > warHighLevel * 2) -- WarLow music is playing but battle intensity is very high, Let's switch to WarHigh at double of WarHigh threshold + or (currentTrackListString == "warHigh" and warMeter <= warLowLevel * 0.5) -- WarHigh music is playing, but it has been quite peaceful recently. Let's switch to peace music at 50% of WarLow threshold + or (currentTrackListString == "warLow" and warMeter <= warLowLevel * 0.25) -- WarLow music is playing, but it has been quite peaceful recently. Let's switch to peace music at 25% of WarLow threshold + or (currentTrackListString == "interlude" and warMeter > warHighLevel * 1.05) + ) + then -- Interlude is playing but we're hitting WarHigh levels. Let's switch to WarHigh + fadeDirection = -2 + fadeOutSkipTrack = true + elseif playedTime >= totalTime - 12 and Spring.GetConfigInt("UseSoundtrackFades", 1) == 1 then fadeDirection = -1 end end @@ -1533,7 +1562,7 @@ end function widget:GetConfigData(data) return { curTrack = currentTrack, - showGUI = showGUI + showGUI = showGUI, } end diff --git a/luaui/Widgets/gui_advplayerslist_unittotals.lua b/luaui/Widgets/gui_advplayerslist_unittotals.lua index c3a175e7c75..910aa93e3c7 100644 --- a/luaui/Widgets/gui_advplayerslist_unittotals.lua +++ b/luaui/Widgets/gui_advplayerslist_unittotals.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "AdvPlayersList Unit Totals", - desc = "Displays number of units", - author = "Floris", - date = "december 2019", - license = "GNU GPL, v2 or later", - layer = -3, - enabled = false, + name = "AdvPlayersList Unit Totals", + desc = "Displays number of units", + author = "Floris", + date = "december 2019", + license = "GNU GPL, v2 or later", + layer = -3, + enabled = false, } end - -- Localized functions for performance local mathFloor = math.floor @@ -26,11 +24,11 @@ local displayFeatureCount = false local vsx, vsy = spGetViewGeometry() local widgetScale = 1 -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList local spGetTeamUnitCount = Spring.GetTeamUnitCount @@ -40,7 +38,7 @@ local font local drawlist = {} local advplayerlistPos = {} local widgetHeight = 22 -local top, left, bottom, right = 0,0,0,0 +local top, left, bottom, right = 0, 0, 0, 0 local myTeamID = spGetMyTeamID() local totalUnits = 0 @@ -62,43 +60,41 @@ do end end - - local function drawBackground() - UiElement(left, bottom, right, top, 1,0,0,1, 1,1,0,1, nil, nil, nil, nil) + UiElement(left, bottom, right, top, 1, 0, 0, 1, 1, 1, 0, 1, nil, nil, nil, nil) end local function drawContent() - local textsize = 11*widgetScale * math.clamp(1+((1-(vsy/1200))*0.4), 1, 1.15) - local textXPadding = 10*widgetScale + local textsize = 11 * widgetScale * math.clamp(1 + ((1 - (vsy / 1200)) * 0.4), 1, 1.15) + local textXPadding = 10 * widgetScale local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) - local text = Spring.I18N('ui.unitTotals.totals', { titleColor = '\255\210\210\210', textColor = '\255\245\245\245', units = currentUnits, maxUnits = maxUnits, totalUnits = totalUnits }) + local text = Spring.I18N("ui.unitTotals.totals", { titleColor = "\255\210\210\210", textColor = "\255\245\245\245", units = currentUnits, maxUnits = maxUnits, totalUnits = totalUnits }) if displayFeatureCount then local features = Spring.GetAllFeatures() - text = text..' \255\170\170\170'..#features + text = text .. " \255\170\170\170" .. #features end font:Begin(true) - font:SetOutlineColor(0.15,0.15,0.15,0.8) - font:Print(text, left+textXPadding, bottom+(0.48*widgetHeight*widgetScale)-(textsize*0.35), textsize, 'no') + font:SetOutlineColor(0.15, 0.15, 0.15, 0.8) + font:Print(text, left + textXPadding, bottom + (0.48 * widgetHeight * widgetScale) - (textsize * 0.35), textsize, "no") font:End() end local function refreshUiDrawing() - if WG['guishader'] then + if WG["guishader"] then if guishaderList then guishaderList = glDeleteList(guishaderList) end - guishaderList = glCreateList( function() - RectRound(left, bottom, right, top, elementCorner, 1,0,0,1) + guishaderList = glCreateList(function() + RectRound(left, bottom, right, top, elementCorner, 1, 0, 0, 1) end) - WG['guishader'].InsertDlist(guishaderList, 'unittotals', true) + WG["guishader"].InsertDlist(guishaderList, "unittotals", true) end - if right-left >= 1 and top-bottom >= 1 then + if right - left >= 1 and top - bottom >= 1 then if not uiBgTex then - uiBgTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { + uiBgTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -106,7 +102,7 @@ local function refreshUiDrawing() gl.R2tHelper.RenderInRect(uiBgTex, left, bottom, right, top, drawBackground, true) end if not uiTex then - uiTex = gl.CreateTexture(mathFloor(right-left), mathFloor(top-bottom), { --*(vsy<1400 and 2 or 1) + uiTex = gl.CreateTexture(mathFloor(right - left), mathFloor(top - bottom), { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -118,18 +114,18 @@ end local function updatePosition(force) local prevPos = advplayerlistPos - if WG['music'] and WG['music'].GetPosition and WG['music'].GetPosition() then - advplayerlistPos = WG['music'].GetPosition() - elseif WG['advplayerlist_api'] ~= nil then - advplayerlistPos = WG['advplayerlist_api'].GetPosition() + if WG["music"] and WG["music"].GetPosition and WG["music"].GetPosition() then + advplayerlistPos = WG["music"].GetPosition() + elseif WG["advplayerlist_api"] ~= nil then + advplayerlistPos = WG["advplayerlist_api"].GetPosition() else local scale = (vsy / 880) * (1 + (Spring.GetConfigFloat("ui_scale", 1) - 1) / 1.25) - advplayerlistPos = {0,vsx-(220*scale),0,vsx,scale} + advplayerlistPos = { 0, vsx - (220 * scale), 0, vsx, scale } end left = advplayerlistPos[2] bottom = advplayerlistPos[1] right = advplayerlistPos[4] - top = math.ceil(advplayerlistPos[1]+(widgetHeight*advplayerlistPos[5])) + top = math.ceil(advplayerlistPos[1] + (widgetHeight * advplayerlistPos[5])) widgetScale = advplayerlistPos[5] if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then widget:ViewResize() @@ -139,9 +135,9 @@ end function widget:Initialize() widget:ViewResize() updatePosition() - WG['unittotals'] = {} - WG['unittotals'].GetPosition = function() - return {top,left,bottom,right,widgetScale} + WG["unittotals"] = {} + WG["unittotals"].GetPosition = function() + return { top, left, bottom, right, widgetScale } end end @@ -150,20 +146,22 @@ function widget:PlayerChanged() end function widget:Shutdown() - if WG['guishader'] then - WG['guishader'].RemoveDlist('unittotals') + if WG["guishader"] then + WG["guishader"].RemoveDlist("unittotals") end - for i=1,#drawlist do + for i = 1, #drawlist do glDeleteList(drawlist[i]) end - if guishaderList then glDeleteList(guishaderList) end + if guishaderList then + glDeleteList(guishaderList) + end if uiTex then gl.DeleteTexture(uiBgTex) uiBgTex = nil gl.DeleteTexture(uiTex) uiTex = nil end - WG['unittotals'] = nil + WG["unittotals"] = nil end function widget:Update(dt) @@ -190,7 +188,7 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() elementCorner = WG.FlowUI.elementCorner RectRound = WG.FlowUI.Draw.RectRound diff --git a/luaui/Widgets/gui_allySelectedUnits.lua b/luaui/Widgets/gui_allySelectedUnits.lua index b72cdca59c4..fedc9eb6d03 100644 --- a/luaui/Widgets/gui_allySelectedUnits.lua +++ b/luaui/Widgets/gui_allySelectedUnits.lua @@ -4,17 +4,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Ally Selected Units", -- GL4 - desc = "Shows units selected by teammates", - author = "Beherith, Floris", - date = "April 2022", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Ally Selected Units", -- GL4 + desc = "Shows units selected by teammates", + author = "Beherith, Floris", + date = "April 2022", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetGameFrame = Spring.GetGameFrame @@ -23,7 +22,7 @@ local spGetUnitPosition = Spring.GetUnitPosition local spGetGroundHeight = Spring.GetGroundHeight local showAsSpectator = true -local selectPlayerUnits = true -- when lockcamera player +local selectPlayerUnits = true -- when lockcamera player local hideBelowGameframe = 100 -- unit platter @@ -43,7 +42,7 @@ local lavaWaterLevel = nil local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local selectionVBOGround = nil local selectionVBOWater = nil @@ -51,32 +50,32 @@ local selectShader = nil local waterShader = nil local luaShaderDir = "LuaUI/Include/" -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glDepthTest = gl.DepthTest -local glClear = gl.Clear -local GL_ALWAYS = GL.ALWAYS -local GL_NOTEQUAL = GL.NOTEQUAL -local GL_KEEP = 0x1E00 --GL.KEEP +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glDepthTest = gl.DepthTest +local glClear = gl.Clear +local GL_ALWAYS = GL.ALWAYS +local GL_NOTEQUAL = GL.NOTEQUAL +local GL_KEEP = 0x1E00 --GL.KEEP local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT -local GL_REPLACE = GL.REPLACE -local GL_POINTS = GL.POINTS - -local spGetUnitDefID = spGetUnitDefID -local spGetPlayerInfo = Spring.GetPlayerInfo -local spGetSpectatingState = Spring.GetSpectatingState -local spGetTeamInfo = Spring.GetTeamInfo -local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spSelectUnitArray = Spring.SelectUnitArray -local spValidUnitID = Spring.ValidUnitID -local spGetUnitIsDead = Spring.GetUnitIsDead -local spGetPlayerList = Spring.GetPlayerList +local GL_REPLACE = GL.REPLACE +local GL_POINTS = GL.POINTS + +local spGetUnitDefID = spGetUnitDefID +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetSpectatingState = Spring.GetSpectatingState +local spGetTeamInfo = Spring.GetTeamInfo +local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spSelectUnitArray = Spring.SelectUnitArray +local spValidUnitID = Spring.ValidUnitID +local spGetUnitIsDead = Spring.GetUnitIsDead +local spGetPlayerList = Spring.GetPlayerList local playerIsSpec = {} -for i,playerID in pairs(Spring.GetPlayerList()) do +for i, playerID in pairs(Spring.GetPlayerList()) do playerIsSpec[playerID] = select(3, spGetPlayerInfo(playerID, false)) end @@ -85,7 +84,7 @@ local myTeamID = spGetMyTeamID() local myAllyTeam = spGetMyAllyTeamID() local myPlayerID = spGetMyPlayerID() local selectedUnits = {} -local playerSelectedUnits = {} -- [playerID][unitID] = true +local playerSelectedUnits = {} -- [playerID][unitID] = true local playerSelectedUnitsCount = {} local playerSelectionVersion = {} local playerTeamID = {} @@ -105,29 +104,41 @@ end local unitScale = {} local unitCanFly = {} local unitBuilding = {} -local sizeAdd = -(lineSize*1.5) +local sizeAdd = -(lineSize * 1.5) for unitDefID, unitDef in pairs(UnitDefs) do - unitScale[unitDefID] = (7.5 * ( unitDef.xsize*unitDef.xsize + unitDef.zsize*unitDef.zsize ) ^ 0.5) + 8 + unitScale[unitDefID] = (7.5 * (unitDef.xsize * unitDef.xsize + unitDef.zsize * unitDef.zsize) ^ 0.5) + 8 unitScale[unitDefID] = unitScale[unitDefID] + sizeAdd if unitDef.canFly then unitCanFly[unitDefID] = true unitScale[unitDefID] = unitScale[unitDefID] * 0.7 - elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0 then + elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0 then unitBuilding[unitDefID] = { (unitDef.xsize * 8.2 + 12) + sizeAdd, - (unitDef.zsize * 8.2 + 12) + sizeAdd + (unitDef.zsize * 8.2 + 12) + sizeAdd, } end end local instanceCache = { - 0,0,0,0, -- lengthwidthcornerheight - 0, -- teamID - useHexagons and 6 or 64, -- how many trianges should we make - 0, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in - } + 0, + 0, + 0, + 0, -- lengthwidthcornerheight + 0, -- teamID + useHexagons and 6 or 64, -- how many trianges should we make + 0, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in +} local function getWaterLevel() if lavaWaterLevel then @@ -145,18 +156,26 @@ function widget:LavaRenderState(tideLevel) end local function shouldUseWaterPass(unitID, unitDefID) - if not mapHasWater or unitCanFly[unitDefID] then return false end + if not mapHasWater or unitCanFly[unitDefID] then + return false + end local x, y, z = spGetUnitPosition(unitID) - if not x or not y or not z then return false end + if not x or not y or not z then + return false + end local waterLevel = getWaterLevel() local groundY = spGetGroundHeight(x, z) return (groundY < waterLevel + 1) and (y <= waterLevel + 20) end local function shouldUseWaterPassAtLevel(unitID, unitDefID, waterLevel) - if not mapHasWater or unitCanFly[unitDefID] then return false end + if not mapHasWater or unitCanFly[unitDefID] then + return false + end local x, y, z = spGetUnitPosition(unitID) - if not x or not y or not z then return false end + if not x or not y or not z then + return false + end local groundY = spGetGroundHeight(x, z) return (groundY < waterLevel + 1) and (y <= waterLevel + 20) end @@ -173,7 +192,9 @@ end local function AddPrimitiveAtUnit(unitID) local unitDefID = spGetUnitDefID(unitID) - if unitDefID == nil then return end -- these cant be selected + if unitDefID == nil then + return + end -- these cant be selected local numVertices = useHexagons and 6 or 64 local cornersize = 0 @@ -243,7 +264,9 @@ local function removeUnit(unitID) end local function selectPlayerSelectedUnits(playerID) - if not playerID then return end + if not playerID then + return + end local selectedByPlayer = playerSelectedUnits[playerID] if not selectedByPlayer then spSelectUnitArray({}) @@ -288,7 +311,7 @@ local function selectedUnitsClear(playerID) end -- called by gadget -local function selectedUnitsAdd(playerID,unitID) +local function selectedUnitsAdd(playerID, unitID) if not spec and playerID == myPlayerID then return end @@ -324,7 +347,7 @@ local function selectedUnitsAdd(playerID,unitID) end -- called by gadget -local function selectedUnitsRemove(playerID,unitID) +local function selectedUnitsRemove(playerID, unitID) if not spec and playerID == myPlayerID then return end @@ -366,7 +389,7 @@ local function selectedUnitsBatchUpdate(playerID, addUnits, addCount, remUnits, local shouldDraw = not playerIsSpec[playerID] or (lockPlayerID ~= nil and playerID == lockPlayerID) if remCount and remCount > 0 and remUnits then - for i=1,remCount do + for i = 1, remCount do local unitID = remUnits[i] if unitID and selectedByPlayer[unitID] then selectedByPlayer[unitID] = nil @@ -382,7 +405,7 @@ local function selectedUnitsBatchUpdate(playerID, addUnits, addCount, remUnits, end if addCount and addCount > 0 and addUnits then - for i=1,addCount do + for i = 1, addCount do local unitID = addUnits[i] if unitID then if not selectedByPlayer[unitID] then @@ -449,7 +472,7 @@ function widget:PlayerRemoved(playerID, reason) end function widget:PlayerAdded(playerID) - local _,_,isSpec,teamID = spGetPlayerInfo(playerID, false) + local _, _, isSpec, teamID = spGetPlayerInfo(playerID, false) playerIsSpec[playerID] = isSpec playerTeamID[playerID] = teamID if not playerSelectedUnits[playerID] then @@ -483,8 +506,8 @@ function widget:PlayerChanged(playerID) end end - for i,playerID in pairs(spGetPlayerList()) do - local _,_,isSpec,teamID = spGetPlayerInfo(playerID, false) + for i, playerID in pairs(spGetPlayerList()) do + local _, _, isSpec, teamID = spGetPlayerInfo(playerID, false) if isSpec and not playerIsSpec[playerID] then selectedUnitsClear(playerID) end @@ -564,7 +587,7 @@ function widget:Update(dt) end local function init() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE! shaderConfig.BILLBOARD = 0 @@ -599,20 +622,22 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not init() then return end + if not init() then + return + end for _, playerID in pairs(spGetPlayerList()) do widget:PlayerAdded(playerID) end widget:PlayerChanged(myPlayerID) - WG['allyselectedunits'] = {} - WG['allyselectedunits'].getSelectPlayerUnits = function() + WG["allyselectedunits"] = {} + WG["allyselectedunits"].getSelectPlayerUnits = function() return selectPlayerUnits end - WG['allyselectedunits'].setSelectPlayerUnits = function(value) + WG["allyselectedunits"].setSelectPlayerUnits = function(value) selectPlayerUnits = value end - WG['allyselectedunits'].getPlayerSelectedUnits = function(playerID) + WG["allyselectedunits"].getPlayerSelectedUnits = function(playerID) return playerSelectedUnits[playerID] end end @@ -635,7 +660,7 @@ local function DrawSelections(selectionVBO, shader) glStencilTest(true) --https://learnopengl.com/Advanced-OpenGL/Stencil-testing glDepthTest(true) glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon this to the shader - glClear(GL_STENCIL_BUFFER_BIT ) -- set stencil buffer to 0 + glClear(GL_STENCIL_BUFFER_BIT) -- set stencil buffer to 0 glStencilFunc(GL_NOTEQUAL, 1, 1) -- use NOTEQUAL instead of ALWAYS to ensure that overlapping transparent fragments dont get written multiple times glStencilMask(1) @@ -659,9 +684,13 @@ local function DrawSelections(selectionVBO, shader) end function widget:DrawWorld() - if spGetGameFrame() < hideBelowGameframe then return end + if spGetGameFrame() < hideBelowGameframe then + return + end - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end if enablePlatter then if mapHasWater and selectionVBOWater and selectionVBOWater.usedElements > 0 then @@ -673,9 +702,13 @@ function widget:DrawWorld() end function widget:DrawWorldPreUnit() - if spGetGameFrame() < hideBelowGameframe then return end + if spGetGameFrame() < hideBelowGameframe then + return + end - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end if enablePlatter then drawFrame = drawFrame + 1 @@ -684,16 +717,16 @@ function widget:DrawWorldPreUnit() end function widget:GetConfigData() - return { - selectPlayerUnits = selectPlayerUnits, - version = 2.0 - } + return { + selectPlayerUnits = selectPlayerUnits, + version = 2.0, + } end function widget:SetConfigData(data) - if data.version ~= nil and data.version == 2.0 then + if data.version ~= nil and data.version == 2.0 then if data.selectPlayerUnits ~= nil then selectPlayerUnits = data.selectPlayerUnits end - end + end end diff --git a/luaui/Widgets/gui_ally_cursors.lua b/luaui/Widgets/gui_ally_cursors.lua index 633a7b95828..a2b9720198d 100644 --- a/luaui/Widgets/gui_ally_cursors.lua +++ b/luaui/Widgets/gui_ally_cursors.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathAtan2 = math.atan2 @@ -25,7 +24,7 @@ local drawNamesCursorSize = 8.5 local rotY = 0 -local dlistAmount = 5 -- number of dlists generated for each player (# available opacity levels) +local dlistAmount = 5 -- number of dlists generated for each player (# available opacity levels) local packetInterval = 0.12 -- fallback for first packet; runtime interval adapts to observed packet cadence local numMousePos = 1 --//num mouse pos in 1 packet @@ -43,13 +42,13 @@ local fontOpacitySpec = 0.5 local NameFadeStartDistance = 4000 local NameFadeEndDistance = 6500 -local idleCursorTime = 25 -- fade time cursor (specs only) +local idleCursorTime = 25 -- fade time cursor (specs only) local addLights = true local lightRadiusMult = 0.5 local lightStrengthMult = 0.85 local lightSelfShadowing = false -local showOwnCursor = false -- for debugging purposes +local showOwnCursor = false -- for debugging purposes -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -98,7 +97,7 @@ local INACTIVE_CURSOR_POS = -1 local alliedCursorsPos = {} local prevCursorPos = {} -local alliedCursorsTime = {} -- for API purpose +local alliedCursorsTime = {} -- for API purpose local usedCursorSize = cursorSize local allycursorDrawList = {} local playerTeamIDs = {} @@ -117,7 +116,7 @@ local teamColorKeys = {} local teams = Spring.GetTeamList() for i = 1, #teams do local r, g, b = spGetTeamColor(teams[i]) - teamColorKeys[teams[i]] = r..'_'..g..'_'..b + teamColorKeys[teams[i]] = r .. "_" .. g .. "_" .. b end teams = nil @@ -278,9 +277,8 @@ local function SetTeamColor(teamID, playerID, a) glColor(color) end - function widget:ViewResize() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) deleteDlists() end @@ -296,58 +294,58 @@ function widget:Initialize() end updateSpecList(true) - WG['allycursors'] = {} - WG['allycursors'].setLights = function(value) + WG["allycursors"] = {} + WG["allycursors"].setLights = function(value) addLights = value deleteDlists() end - WG['allycursors'].getLights = function() + WG["allycursors"].getLights = function() return addLights end - WG['allycursors'].setLightStrength = function(value) + WG["allycursors"].setLightStrength = function(value) lightStrengthMult = value end - WG['allycursors'].getLightStrength = function() + WG["allycursors"].getLightStrength = function() return lightStrengthMult end - WG['allycursors'].setLightRadius = function(value) + WG["allycursors"].setLightRadius = function(value) lightRadiusMult = value end - WG['allycursors'].setLightSelfShadowing = function(value) + WG["allycursors"].setLightSelfShadowing = function(value) lightSelfShadowing = value end - WG['allycursors'].getLightRadius = function() + WG["allycursors"].getLightRadius = function() return lightRadiusMult end - WG['allycursors'].getLightSelfShadowing = function() + WG["allycursors"].getLightSelfShadowing = function() return lightSelfShadowing end - WG['allycursors'].setCursorDot = function(value) + WG["allycursors"].setCursorDot = function(value) showCursorDot = value deleteDlists() end - WG['allycursors'].getCursorDot = function() + WG["allycursors"].getCursorDot = function() return showCursorDot end - WG['allycursors'].setPlayerNames = function(value) + WG["allycursors"].setPlayerNames = function(value) showPlayerName = value deleteDlists() end - WG['allycursors'].getPlayerNames = function() + WG["allycursors"].getPlayerNames = function() return showPlayerName end - WG['allycursors'].setSpectatorNames = function(value) + WG["allycursors"].setSpectatorNames = function(value) showSpectatorName = value deleteDlists() end - WG['allycursors'].getSpectatorNames = function() + WG["allycursors"].getSpectatorNames = function() return showSpectatorName end - WG['allycursors'].getCursors = function() + WG["allycursors"].getCursors = function() return cursors, notIdle end - WG['allycursors'].getCursor = function(playerID) + WG["allycursors"].getCursor = function(playerID) if not playerID then return nil end @@ -357,7 +355,7 @@ function widget:Initialize() end return cursors[playerID], notIdle[playerID] end - WG['allycursors'].isCursorVisible = function(playerID) + WG["allycursors"].isCursorVisible = function(playerID) if not playerID then return false end @@ -374,7 +372,7 @@ end function widget:Shutdown() deleteDlists() - WG['allycursors'] = nil + WG["allycursors"] = nil end function widget:PlayerChanged(playerID) @@ -403,7 +401,7 @@ function widget:PlayerChanged(playerID) end -- update speclist when player becomes spectator --if isSpec and not specList[playerID] then - updateSpecList() + updateSpecList() --end end @@ -441,14 +439,13 @@ local function createCursorDrawList(playerID, opacityMultiplier) SetTeamColor(teamID, playerID, 1) -- draw player cursor - if not spec and showCursorDot and (not addLights or not WG['lightsgl4']) then + if not spec and showCursorDot and (not addLights or not WG["lightsgl4"]) then glTexture(allyCursor) glBeginEnd(GL.QUADS, DrawGroundquad, wx, wy, wz, quadSize) glTexture(false) end if spec or showPlayerName then - -- draw nickname if not spec or showSpectatorName then glPushMatrix() @@ -528,10 +525,11 @@ local function DrawCursor(playerID, wx, wy, wz, camX, camY, camZ, opacity) end end - local sec = 0 function widget:Update(dt) - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end sec = sec + dt if sec > 1.5 then @@ -541,8 +539,8 @@ function widget:Update(dt) local teams = Spring.GetTeamList() for i = 1, #teams do local r, g, b = spGetTeamColor(teams[i]) - if teamColorKeys[teams[i]] ~= r..'_'..g..'_'..b then - teamColorKeys[teams[i]] = r..'_'..g..'_'..b + if teamColorKeys[teams[i]] ~= r .. "_" .. g .. "_" .. b then + teamColorKeys[teams[i]] = r .. "_" .. g .. "_" .. b local players = Spring.GetPlayerList(teams[i]) for _, playerID in ipairs(players) do widget:PlayerChanged(playerID) @@ -589,11 +587,11 @@ function widget:Update(dt) end end if specList[playerID] and not showSpectatorName then - opacity = 0 -- doing this cause somehow setting cursors[playerID][8]=true doesnt remove the light but setting cursors[playerID]=nil does + opacity = 0 -- doing this cause somehow setting cursors[playerID][8]=true doesnt remove the light but setting cursors[playerID]=nil does end if opacity > 0.1 then if not cursors[playerID] then - cursors[playerID] = { wx, spGetGroundHeight(wx, wz), wz, camX, camY, camZ, opacity, specList[playerID]} + cursors[playerID] = { wx, spGetGroundHeight(wx, wz), wz, camX, camY, camZ, opacity, specList[playerID] } else cursors[playerID][1] = wx cursors[playerID][2] = spGetGroundHeight(wx, wz) diff --git a/luaui/Widgets/gui_anti_ranges.lua b/luaui/Widgets/gui_anti_ranges.lua index b064f5d4ded..f2eb06d8f10 100644 --- a/luaui/Widgets/gui_anti_ranges.lua +++ b/luaui/Widgets/gui_anti_ranges.lua @@ -2,19 +2,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Anti Ranges", - desc = "Draws circle to show anti defence ranges (options: /antiranges_glow, antiranges_fade)", - author = "[teh]decay, Floris", - date = "25 january 2015", - license = "GNU GPL, v2 or later", - version = 4, - layer = 5, - enabled = false - } + return { + name = "Anti Ranges", + desc = "Draws circle to show anti defence ranges (options: /antiranges_glow, antiranges_fade)", + author = "[teh]decay, Floris", + date = "25 january 2015", + license = "GNU GPL, v2 or later", + version = 4, + layer = 5, + enabled = false, + } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -25,7 +24,6 @@ local spEcho = Spring.Echo -- v3 Floris: added normal anti, changed widget name, optional glow, optional fadeout on closeup, changed line thickness and opacity, empty anti uses different color -- v4 grotful: Removed hardcoded unit lists, added function to find anti-nuke units in unitDefs - -------------------------------------------------------------------------------- -- Console commands -------------------------------------------------------------------------------- @@ -37,41 +35,41 @@ local spEcho = Spring.Echo -- Options -------------------------------------------------------------------------------- -local opacityMultiplier = 0.75 -local multiStockpileColor = {1,1,0} -local filledStockpileColor = {1,0.75,0} -local unknownStockpileColor = {1,0.54,1} -local emptyStockpileColor = {1,0.33,0} -local unfinishedStockpileColor = {1,0,0.75} -local empdStockpileColor = {0.1,0,1} -local empdStockpileColor2 = {0.7,0,1} -local showLineGlow2 = false -local fadeOnCloseup = true -local fadeStartDistance = 3500 +local opacityMultiplier = 0.75 +local multiStockpileColor = { 1, 1, 0 } +local filledStockpileColor = { 1, 0.75, 0 } +local unknownStockpileColor = { 1, 0.54, 1 } +local emptyStockpileColor = { 1, 0.33, 0 } +local unfinishedStockpileColor = { 1, 0, 0.75 } +local empdStockpileColor = { 0.1, 0, 1 } +local empdStockpileColor2 = { 0.7, 0, 1 } +local showLineGlow2 = false +local fadeOnCloseup = true +local fadeStartDistance = 3500 -------------------------------------------------------------------------------- -- Speedups -------------------------------------------------------------------------------- -local glColor = gl.Color -local glDepthTest = gl.DepthTest -local glLineWidth = gl.LineWidth -local glDrawGroundCircle = gl.DrawGroundCircle - -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetPositionLosState = Spring.GetPositionLosState -local spGetCameraPosition = Spring.GetCameraPosition -local spGetUnitStockpile = Spring.GetUnitStockpile -local spGetAllUnits = Spring.GetAllUnits -local spGetTeamUnitsByDefs = Spring.GetTeamUnitsByDefs -local spGetTeamList = Spring.GetTeamList -local GetUnitIsStunned = Spring.GetUnitIsStunned - -local antiInLos = {} -local antiOutLos = {} -local antiNukeDefs = {} -local antiNukeDefIDList = {} -- array of DefIDs for GetTeamUnitsByDefs +local glColor = gl.Color +local glDepthTest = gl.DepthTest +local glLineWidth = gl.LineWidth +local glDrawGroundCircle = gl.DrawGroundCircle + +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetPositionLosState = Spring.GetPositionLosState +local spGetCameraPosition = Spring.GetCameraPosition +local spGetUnitStockpile = Spring.GetUnitStockpile +local spGetAllUnits = Spring.GetAllUnits +local spGetTeamUnitsByDefs = Spring.GetTeamUnitsByDefs +local spGetTeamList = Spring.GetTeamList +local GetUnitIsStunned = Spring.GetUnitIsStunned + +local antiInLos = {} +local antiOutLos = {} +local antiNukeDefs = {} +local antiNukeDefIDList = {} -- array of DefIDs for GetTeamUnitsByDefs local diag = math.diag @@ -82,78 +80,79 @@ local chobbyInterface -------------------------------------------------------------------------------- function widget:Initialize() - identifyAntiNukeUnits() -- Pre-process unit definitions - checkAllUnits() + identifyAntiNukeUnits() -- Pre-process unit definitions + checkAllUnits() end function identifyAntiNukeUnits() - for unitDefID, unitDef in pairs(UnitDefs) do - local weapons = unitDef.weapons - for i=1, #weapons do - local weaponDef = WeaponDefs[weapons[i].weaponDef] - if weaponDef and weaponDef.interceptor and weaponDef.interceptor == 1 then - antiNukeDefs[unitDefID] = weaponDef.coverageRange - antiNukeDefIDList[#antiNukeDefIDList + 1] = unitDefID - break - end - end - end + for unitDefID, unitDef in pairs(UnitDefs) do + local weapons = unitDef.weapons + for i = 1, #weapons do + local weaponDef = WeaponDefs[weapons[i].weaponDef] + if weaponDef and weaponDef.interceptor and weaponDef.interceptor == 1 then + antiNukeDefs[unitDefID] = weaponDef.coverageRange + antiNukeDefIDList[#antiNukeDefIDList + 1] = unitDefID + break + end + end + end end -------------------------------------------------------------------------------- -- Callins -------------------------------------------------------------------------------- - - function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorldPreUnit() - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end local camX, camY, camZ = spGetCameraPosition() - for uID, pos in pairs(antiInLos) do - local LosOrRadar, inLos, inRadar = spGetPositionLosState(pos[1], pos[2], pos[3]) - if not inLos then - antiOutLos[uID] = pos - antiInLos[uID] = nil - end - end + for uID, pos in pairs(antiInLos) do + local LosOrRadar, inLos, inRadar = spGetPositionLosState(pos[1], pos[2], pos[3]) + if not inLos then + antiOutLos[uID] = pos + antiInLos[uID] = nil + end + end - glDepthTest(true) + glDepthTest(true) - for uID, pos in pairs(antiInLos) do - local x, y, z = spGetUnitPosition(uID) - if x ~= nil and y ~= nil and z ~= nil and Spring.IsSphereInView(x, y, z, pos[4]) then + for uID, pos in pairs(antiInLos) do + local x, y, z = spGetUnitPosition(uID) + if x ~= nil and y ~= nil and z ~= nil and Spring.IsSphereInView(x, y, z, pos[4]) then drawCircle(uID, pos[4], x, y, z, camX, camY, camZ) - end - end - - for uID, pos in pairs(antiOutLos) do - local LosOrRadar, inLos, inRadar = spGetPositionLosState(pos[1], pos[2], pos[3]) - if inLos then - antiOutLos[uID] = nil - antiInLos[uID] = pos - end - end - - for uID, pos in pairs(antiOutLos) do - if pos.x ~= nil and pos.y ~= nil and pos.z ~= nil then + end + end + + for uID, pos in pairs(antiOutLos) do + local LosOrRadar, inLos, inRadar = spGetPositionLosState(pos[1], pos[2], pos[3]) + if inLos then + antiOutLos[uID] = nil + antiInLos[uID] = pos + end + end + + for uID, pos in pairs(antiOutLos) do + if pos.x ~= nil and pos.y ~= nil and pos.z ~= nil then drawCircle(uID, pos[4], pos[1], pos[2], pos[3], camX, camY, camZ) - end - end + end + end end - function drawCircle(uID, coverageRange, x, y, z, camX, camY, camZ) - local camDistance = diag(camX-x, camY-y, camZ-z) + local camDistance = diag(camX - x, camY - y, camZ - z) - local lineWidthMinus = (camDistance/fadeStartDistance) + local lineWidthMinus = (camDistance / fadeStartDistance) if lineWidthMinus > 2.2 then lineWidthMinus = 2.2 end @@ -170,9 +169,9 @@ function drawCircle(uID, coverageRange, x, y, z, camX, camY, camZ) local numStockpiled, numStockpileQued, stockpileBuild = spGetUnitStockpile(uID) local circleColor = emptyStockpileColor - local _,stunned,inbuild = GetUnitIsStunned(uID) + local _, stunned, inbuild = GetUnitIsStunned(uID) if stunned then - if os.clock()%0.66 > 0.33 then + if os.clock() % 0.66 > 0.33 then circleColor = empdStockpileColor else circleColor = empdStockpileColor2 @@ -194,60 +193,61 @@ function drawCircle(uID, coverageRange, x, y, z, camX, camY, camZ) glLineWidth(10) glColor(circleColor[1],circleColor[2],circleColor[3], .016*lineOpacityMultiplier) glDrawGroundCircle(x, y, z, coverageRange, 128) - end]]-- - glColor(circleColor[1],circleColor[2],circleColor[3], .55*lineOpacityMultiplier) - glLineWidth(3.5-lineWidthMinus) + end]] + -- + glColor(circleColor[1], circleColor[2], circleColor[3], 0.55 * lineOpacityMultiplier) + glLineWidth(3.5 - lineWidthMinus) glDrawGroundCircle(x, y, z, coverageRange, 128) end end function processVisibleUnit(unitID) - local unitDefID = spGetUnitDefID(unitID) - local coverageRange = antiNukeDefs[unitDefID] - if coverageRange then - local x, y, z = spGetUnitPosition(unitID) - local pos = { x, y, z, coverageRange } - - antiInLos[unitID] = pos - antiOutLos[unitID] = nil - end + local unitDefID = spGetUnitDefID(unitID) + local coverageRange = antiNukeDefs[unitDefID] + if coverageRange then + local x, y, z = spGetUnitPosition(unitID) + local pos = { x, y, z, coverageRange } + + antiInLos[unitID] = pos + antiOutLos[unitID] = nil + end end function widget:UnitLeftLos(unitID) - local unitDefID = spGetUnitDefID(unitID) - local coverageRange = antiNukeDefs[unitDefID] - if coverageRange then - local x, y, z = spGetUnitPosition(unitID) - local pos = { - (x or antiInLos[unitID][1]), - (y or antiInLos[unitID][2]), - (z or antiInLos[unitID][3]), - coverageRange - } - - antiOutLos[unitID] = pos - antiInLos[unitID] = nil - end + local unitDefID = spGetUnitDefID(unitID) + local coverageRange = antiNukeDefs[unitDefID] + if coverageRange then + local x, y, z = spGetUnitPosition(unitID) + local pos = { + (x or antiInLos[unitID][1]), + (y or antiInLos[unitID][2]), + (z or antiInLos[unitID][3]), + coverageRange, + } + + antiOutLos[unitID] = pos + antiInLos[unitID] = nil + end end function widget:UnitCreated(unitID, unitDefID, teamID, builderID) - processVisibleUnit(unitID) + processVisibleUnit(unitID) end function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - processVisibleUnit(unitID) + processVisibleUnit(unitID) end function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - processVisibleUnit(unitID) + processVisibleUnit(unitID) end function widget:GameFrame(n) - for uID, _ in pairs(antiInLos) do - if not spGetUnitDefID(uID) then - antiInLos[uID] = nil -- has died - end - end + for uID, _ in pairs(antiInLos) do + if not spGetUnitDefID(uID) then + antiInLos[uID] = nil -- has died + end + end end function widget:PlayerChanged(playerID) @@ -255,10 +255,12 @@ function widget:PlayerChanged(playerID) end function checkAllUnits() - antiInLos = {} - antiOutLos = {} + antiInLos = {} + antiOutLos = {} - if #antiNukeDefIDList == 0 then return end + if #antiNukeDefIDList == 0 then + return + end for _, allyTeamID in ipairs(spGetTeamList()) do local units = spGetTeamUnitsByDefs(allyTeamID, antiNukeDefIDList) if units then @@ -272,19 +274,23 @@ end -------------------------------------------------------------------------------- function widget:GetConfigData(data) - return { + return { showLineGlow2 = showLineGlow2, - fadeOnCloseup = fadeOnCloseup + fadeOnCloseup = fadeOnCloseup, } end function widget:SetConfigData(data) - if data.showLineGlow2 ~= nil then showLineGlow2 = data.showLineGlow2 end - if data.fadeOnCloseup ~= nil then fadeOnCloseup = data.fadeOnCloseup end + if data.showLineGlow2 ~= nil then + showLineGlow2 = data.showLineGlow2 + end + if data.fadeOnCloseup ~= nil then + fadeOnCloseup = data.fadeOnCloseup + end end function widget:TextCommand(command) - if (string.find(command, "antiranges_glow", nil, true) == 1 and string.len(command) == 15) then + if string.find(command, "antiranges_glow", nil, true) == 1 and string.len(command) == 15 then showLineGlow2 = not showLineGlow2 if showLineGlow2 then spEcho("Anti Ranges: Glow on") @@ -292,7 +298,7 @@ function widget:TextCommand(command) spEcho("Anti Ranges: Glow off") end end - if (string.find(command, "antiranges_fade", nil, true) == 1 and string.len(command) == 15) then + if string.find(command, "antiranges_fade", nil, true) == 1 and string.len(command) == 15 then fadeOnCloseup = not fadeOnCloseup if fadeOnCloseup then spEcho("Anti Ranges: Fade-out on closeup enabled") diff --git a/luaui/Widgets/gui_attack_aoe.lua b/luaui/Widgets/gui_attack_aoe.lua index a3de26798ad..745ed828607 100644 --- a/luaui/Widgets/gui_attack_aoe.lua +++ b/luaui/Widgets/gui_attack_aoe.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "26 September 2008", license = "GNU LGPL, v2.1 or later", layer = 1, - enabled = true + enabled = true, } end @@ -109,14 +109,14 @@ local Config = { maxFilledCircleAlpha = 0.35, minFilledCircleAlpha = 0.15, ringDamageLevels = { 0.8, 0.6, 0.4, 0.2 }, - outerRingAlpha = 0.33, -- Transparency for outer AOE circle - baseLineWidth = 1, -- Base line width (scaled by screen resolution) + outerRingAlpha = 0.33, -- Transparency for outer AOE circle + baseLineWidth = 1, -- Base line width (scaled by screen resolution) }, Animation = { salvoSpeed = 0.1, waveDuration = 0.35, fadeDuration = 0, - } + }, } -- Derived Constants @@ -133,7 +133,9 @@ local function UpdateScreenScale() local _, screenHeight = spGetViewGeometry() -- Linear scale: 1.0 at 1080p, 2.3 at 2160p screenLineWidthScale = 1.0 + (screenHeight - 1080) * (2 / 1080) - if screenLineWidthScale < 0.5 then screenLineWidthScale = 0.5 end -- Minimum for low res + if screenLineWidthScale < 0.5 then + screenLineWidthScale = 0.5 + end -- Minimum for low res end -------------------------------------------------------------------------------- @@ -141,7 +143,7 @@ end -------------------------------------------------------------------------------- local napalmShader local shaderSourceCache = { - shaderName = 'AoE Napalm Shader', + shaderName = "AoE Napalm Shader", vssrcpath = "LuaUI/Shaders/gui_attack_aoe_napalm.vert.glsl", fssrcpath = "LuaUI/Shaders/gui_attack_aoe_napalm.frag.glsl", uniformInt = {}, @@ -150,8 +152,7 @@ local shaderSourceCache = { center = { 0, 0 }, u_color = { 1, 0, 0, 0.5 }, }, - shaderConfig = { - } + shaderConfig = {}, } -------------------------------------------------------------------------------- @@ -186,7 +187,7 @@ local defaultAimData = { base = { 0, 0, 0, 0 }, fill = { 0, 0, 0, 0 }, scatter = { 0, 0, 0, 0 }, - } + }, } local State = { @@ -252,7 +253,9 @@ function StockpileStatus:Update(dt, unitID, hasStockpile) if unitID and hasStockpile then local count = spGetUnitStockpile(unitID) - if count == 0 then targetAlpha = 1 end + if count == 0 then + targetAlpha = 1 + end end if self.progressBarAlpha < targetAlpha then @@ -270,7 +273,6 @@ local function GetMouseTargetPosition(weaponType, aimingUnitID) local mx, my = spGetMouseState() local targetType, target = spTraceScreenRay(mx, my) - if not targetType or not target then return nil end @@ -312,9 +314,9 @@ local function GetMouseTargetPosition(weaponType, aimingUnitID) local shouldIgnoreUnit = false if isDgun then - shouldIgnoreUnit = (isAlly and WG['dgunnoally']) or (not isAlly and WG['dgunnoenemy']) + shouldIgnoreUnit = (isAlly and WG["dgunnoally"]) or (not isAlly and WG["dgunnoenemy"]) else - shouldIgnoreUnit = (isAlly and WG['attacknoally']) + shouldIgnoreUnit = (isAlly and WG["attacknoally"]) end if not shouldIgnoreUnit then @@ -488,13 +490,19 @@ end ---@param data IndicatorDrawData local function DrawScatterShape(data, ux, uz, ty, aimAngle, spreadAngle, rMin, rMax, alphaFactor) - if alphaFactor <= 0 then return end + if alphaFactor <= 0 then + return + end local arcLength = rMax * spreadAngle * 2 local segments = ceil(arcLength / 20) - if segments < 8 then segments = 8 end - if segments > 64 then segments = 64 end + if segments < 8 then + segments = 8 + end + if segments > 64 then + segments = 64 + end local step = (spreadAngle * 2) / segments @@ -534,10 +542,7 @@ local function FindBestWeapon(unitDef) if weapon.weaponDef then local weaponDef = WeaponDefs[weapon.weaponDef] if weaponDef then - local isValid = weaponDef.canAttackGround - and not (weaponDef.type == "Shield") - and not ToBool(weaponDef.interceptor) - and not string.find(weaponDef.name, "flak", nil, true) + local isValid = weaponDef.canAttackGround and not (weaponDef.type == "Shield") and not ToBool(weaponDef.interceptor) and not string.find(weaponDef.name, "flak", nil, true) if isValid then if weaponDef.manualFire and unitDef.canManualFire then @@ -551,9 +556,7 @@ local function FindBestWeapon(unitDef) -- Primary (highest spread) validSecondaryWeapons[weaponNum] = weaponDef local currentSpread = max(weaponDef.damageAreaOfEffect, weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle)) - if (weaponDef.damageAreaOfEffect > best.maxSpread - or weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle) > best.maxSpread - or weaponDef.type == "LightningCannon") then + if weaponDef.damageAreaOfEffect > best.maxSpread or weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle) > best.maxSpread or weaponDef.type == "LightningCannon" then best.maxSpread = currentSpread best.weaponDef = weaponDef best.weaponNum = weaponNum @@ -701,14 +704,13 @@ local function SetupUnitDef(unitDefID, unitDef) ---@class WeaponInfos Cache.weaponInfos[unitDefID] = { primary = infoPrimary, - secondary = infoSecondary + secondary = infoSecondary, } end if bestManual.weaponDef then local info = BuildWeaponInfo(unitDef, bestManual.weaponDef, bestManual.weaponNum) Cache.manualWeaponInfos[unitDefID] = { primary = info } end - end local function SetupDisplayLists() @@ -736,13 +738,13 @@ local function SetupDisplayLists() -- Nuclear trefoil (radiation symbol) display list -- Consists of 3 fan blades at 120° intervals and a center hole State.nuclearTrefoilList = glCreateList(function() - local innerRadius = 0.18 -- Center hole radius - local outerRadius = 0.85 -- Blade outer radius - local bladeAngle = rad(60) -- Each blade spans 60 degrees + local innerRadius = 0.18 -- Center hole radius + local outerRadius = 0.85 -- Blade outer radius + local bladeAngle = rad(60) -- Each blade spans 60 degrees local bladeSegments = 16 for blade = 0, 2 do - local baseAngle = blade * rad(120) - rad(90) -- Start at top, 120° apart + local baseAngle = blade * rad(120) - rad(90) -- Start at top, 120° apart local startAngle = baseAngle - bladeAngle / 2 local step = bladeAngle / bladeSegments @@ -831,9 +833,9 @@ local function GetActiveUnitInfo() local _, cmd, _ = spGetActiveCommand() - if ((cmd == CMD_MANUALFIRE or cmd == CMD_MANUAL_LAUNCH) and State.manualFireUnitDefID) then + if (cmd == CMD_MANUALFIRE or cmd == CMD_MANUAL_LAUNCH) and State.manualFireUnitDefID then return Cache.manualWeaponInfos[State.manualFireUnitDefID], State.manualFireUnitID - elseif ((cmd == CMD_ATTACK or cmd == CMD_UNIT_SET_TARGET or cmd == CMD_UNIT_SET_TARGET_NO_GROUND) and State.attackUnitDefID) then + elseif (cmd == CMD_ATTACK or cmd == CMD_UNIT_SET_TARGET or cmd == CMD_UNIT_SET_TARGET_NO_GROUND) and State.attackUnitDefID then return Cache.weaponInfos[State.attackUnitDefID], State.attackUnitID else return nil, nil @@ -1134,7 +1136,7 @@ local function DrawNoExplode(data, overrideSource) local color local alpha - if requiredEnergy and select(1, spGetTeamResources(spGetMyTeamID(), 'energy')) < requiredEnergy then + if requiredEnergy and select(1, spGetTeamResources(spGetMyTeamID(), "energy")) < requiredEnergy then color = Config.Colors.noEnergy alpha = lerp(0, 1, State.pulsePhase) else @@ -1169,12 +1171,12 @@ local function DrawDGun(data) local angle = atan2(ux - tx, uz - tz) + (pi / 2.1) local dx, dz, offset_x, offset_z = ux, uz, 0, 0 - if unitName == 'armcom' then + if unitName == "armcom" then offset_x = (sin(angle) * 10) offset_z = (cos(angle) * 10) dx = ux - offset_x dz = uz - offset_z - elseif unitName == 'corcom' or unitName == 'legcom' then + elseif unitName == "corcom" or unitName == "legcom" then offset_x = (sin(angle) * 14) offset_z = (cos(angle) * 14) dx = ux + offset_x @@ -1195,7 +1197,6 @@ end --- Calculates the launch vector to hit a target (dx, dy, dz) with speed v --- @param trajectoryMode number low (-1) or high (1) trajectory local function GetBallisticVector(initialSpeed, dx, dy, dz, trajectoryMode) - local horizontalDistSq = distance2dSquared(dx, dz, 0, 0) local horizontalDist = sqrt(horizontalDistSq) @@ -1261,8 +1262,12 @@ local function GetScatterImpact(ux, uz, calc_tx, calc_tz, v_f, gravity_f, height local d1 = distance2dSquared(x1, z1, calc_tx, calc_tz) local d2 = distance2dSquared(x2, z2, calc_tx, calc_tz) - if t1 < 0 then return x2, z2 end - if t2 < 0 then return x1, z1 end + if t1 < 0 then + return x2, z2 + end + if t2 < 0 then + return x1, z1 + end if d1 < d2 then return x1, z1 @@ -1354,8 +1359,12 @@ local function DrawBallisticScatter(data) local axisUpZ = hz_up - calc_tz local lenUp = diag(axisUpX, axisUpZ) - if lenRight > maxAxisLen then lenRight = maxAxisLen end - if lenUp > maxAxisLen then lenUp = maxAxisLen end + if lenRight > maxAxisLen then + lenRight = maxAxisLen + end + if lenUp > maxAxisLen then + lenUp = maxAxisLen + end ---------------------------------------------------------------------------- -- VISIBILITY @@ -1380,7 +1389,9 @@ local function DrawBallisticScatter(data) local rMin = dist - lenUp -- Prevent drawing behind the unit - if rMin < 50 then rMin = 50 end + if rMin < 50 then + rMin = 50 + end -- Calculate Draw Angle: -- We want the visual cone width to match the physical width (lenRight). @@ -1484,8 +1495,12 @@ local function DrawWobbleScatter(data) local timeFactor = pow(flightFrames, TIME_EXPONENT) local spreadAngle = netWobble * SPREAD_CALIBRATION * timeFactor - if spreadAngle > 1.2 then spreadAngle = 1.2 end - if spreadAngle < 0.02 then spreadAngle = 0.02 end + if spreadAngle > 1.2 then + spreadAngle = 1.2 + end + if spreadAngle < 0.02 then + spreadAngle = 0.02 + end local spreadRadius = clampedDist * tan(spreadAngle) @@ -1517,7 +1532,9 @@ local function DrawWobbleScatter(data) local rMax = dist + (spreadRadius * forwardBias) local rMin = dist - (spreadRadius * backwardBias) - if rMin < 50 then rMin = 50 end + if rMin < 50 then + rMin = 50 + end -- Using lower overrangeDistance because projectiles won't reach it most of the time -- but ensure it's actually larger than the range @@ -1529,8 +1546,12 @@ local function DrawWobbleScatter(data) overrange = overrange + (dist - clampedDist) end - if rMax > overrange then rMax = overrange end - if rMin >= rMax then rMin = rMax - 10 end + if rMax > overrange then + rMax = overrange + end + if rMin >= rMax then + rMin = rMax - 10 + end -- 7. Recalculate Draw Angle for overrange -- This keeps the indicator shaped exactly as it is at max range @@ -1623,7 +1644,7 @@ local function DrawDropped(data) local bx, _, bz = normalize(dx, 0, dz) - if (not bx) then + if not bx then return end @@ -1697,7 +1718,7 @@ local function DrawNuke(data) local minRingRadius = Config.General.minRingRadius for ringIndex, damageLevel in ipairs(damageLevels) do - if ringIndex > 1 then -- Skip innermost ring + if ringIndex > 1 then -- Skip innermost ring local ringRadius = GetRadiusForDamageLevel(aoe, damageLevel, edgeEffectiveness) if ringRadius >= minRingRadius then local alphaFactor = GetAlphaFactorForRing(damageLevel, damageLevel + 0.4, ringIndex, phase, 1, triggerTimes) @@ -1719,7 +1740,7 @@ local function DrawNuke(data) SetGlColor(trefoilOpacity, color) glPushMatrix() glTranslate(tx, ty, tz) - glRotate(osClock() * 30, 0, 1, 0) -- Slow rotation: 30 degrees per second + glRotate(osClock() * 30, 0, 1, 0) -- Slow rotation: 30 degrees per second glScale(aoe * 0.55, aoe * 0.55, aoe * 0.55) glCallList(State.nuclearTrefoilList) glPopMatrix() @@ -1801,7 +1822,7 @@ function widget:DrawWorldPreUnit() aimData.unitID = aimingUnitID aimData.distanceFromCamera = GetMouseDistance() or 1000 - if (not weaponInfo.mobile) then + if not weaponInfo.mobile then uy = uy + spGetUnitRadius(aimingUnitID) end aimData.source.x, aimData.source.y, aimData.source.z = ux, uy, uz diff --git a/luaui/Widgets/gui_attackrange_gl4.lua b/luaui/Widgets/gui_attackrange_gl4.lua index 8319a54f354..4605237b97b 100644 --- a/luaui/Widgets/gui_attackrange_gl4.lua +++ b/luaui/Widgets/gui_attackrange_gl4.lua @@ -6,15 +6,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Attack Range GL4", - desc = - "[v" .. string.format("%s", versionNumber ) .. "] Displays attack ranges of selected units. Alt+, and alt+. (alt comma and alt period) to cycle backward and forward through display config of current unit (saved through games!). Custom keybind to toggle cursor unit range on and off.", - author = "Errrrrrr, Beherith", - date = "July 20, 2023", + name = "Attack Range GL4", + desc = "[v" .. string.format("%s", versionNumber) .. "] Displays attack ranges of selected units. Alt+, and alt+. (alt comma and alt period) to cycle backward and forward through display config of current unit (saved through games!). Custom keybind to toggle cursor unit range on and off.", + author = "Errrrrrr, Beherith", + date = "July 20, 2023", license = "Lua: GPLv2, GLSL: (c) Beherith (mysterme@gmail.com)", - layer = -99, + layer = -99, enabled = true, - depends = {'gl4'}, + depends = { "gl4" }, } end @@ -55,8 +54,8 @@ InterceptorOn InterceptorOff -]]-- - +]] +-- ------------------------------------- local autoReload = false @@ -69,7 +68,7 @@ local autoReload = false --------------------------------------------------------------------------------------------------------------------------- local shift_only = false -- only show ranges when shift is held down local cursor_unit_range = true -- displays the range of the unit at the mouse cursor (if there is one) -local selectionDisableThreshold = 512 -- turns off when selection is above this number +local selectionDisableThreshold = 512 -- turns off when selection is above this number local selectionDisableThresholdMult = 0.7 --------------------------------------------------------------------------------------------------------------------------- @@ -79,11 +78,11 @@ local DYNAMIC_RANGE_UPDATE_RATE = 3.0 local buttonConfig = { ally = { ground = true, AA = true, nano = true }, - enemy = { ground = true, AA = true, nano = true } + enemy = { ground = true, AA = true, nano = true }, } local colorConfig = { - drawStencil = true, -- whether to draw the outer, merged rings (quite expensive!) + drawStencil = true, -- whether to draw the outer, merged rings (quite expensive!) cannon_separate_stencil = false, -- set to true to have cannon and ground be on different stencil mask drawInnerRings = true, -- whether to draw inner, per attack rings (very cheap) @@ -119,8 +118,8 @@ local colorConfig = { minimapinternallinethickness = 0.5, }, cannon = { - color = {1.0, 0.22, 0.05, 0.60}, - fadeparams = { 5000, 8500, 1.0, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + color = { 1.0, 0.22, 0.05, 0.60 }, + fadeparams = { 5000, 8500, 1.0, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha groupselectionfadescale = 0.75, externallinethickness = 3.0, internallinethickness = 1.8, @@ -128,7 +127,7 @@ local colorConfig = { minimapinternallinethickness = 0.5, }, lrpc = { - color = {1.0, 0.22, 0.05, 0.60}, + color = { 1.0, 0.22, 0.05, 0.60 }, fadeparams = { 5000, 1000, 1.0, 0.5 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha groupselectionfadescale = 0.75, externallinethickness = 2.0, @@ -151,45 +150,45 @@ local colorConfig = { -- DGUN colorConfig.ground_dgun = { - color = colorConfig.ground.color, -- reuse ground colour - fadeparams = colorConfig.ground.fadeparams, -- same fade curve - groupselectionfadescale = colorConfig.ground.groupselectionfadescale, - externallinethickness = colorConfig.ground.externallinethickness, - internallinethickness = colorConfig.ground.internallinethickness, + color = colorConfig.ground.color, -- reuse ground colour + fadeparams = colorConfig.ground.fadeparams, -- same fade curve + groupselectionfadescale = colorConfig.ground.groupselectionfadescale, + externallinethickness = colorConfig.ground.externallinethickness, + internallinethickness = colorConfig.ground.internallinethickness, minimapexternallinethickness = colorConfig.ground.minimapexternallinethickness, minimapinternallinethickness = colorConfig.ground.minimapinternallinethickness, } -- WATER WEAPONS colorConfig.ground_water = { - color = {0.32, 0.48, 1.0, 0.30}, - fadeparams = colorConfig.ground.fadeparams, - groupselectionfadescale = colorConfig.ground.groupselectionfadescale, - externallinethickness = colorConfig.ground.externallinethickness, - internallinethickness = colorConfig.ground.internallinethickness, - minimapexternallinethickness = colorConfig.ground.minimapexternallinethickness, - minimapinternallinethickness = colorConfig.ground.minimapinternallinethickness, + color = { 0.32, 0.48, 1.0, 0.30 }, + fadeparams = colorConfig.ground.fadeparams, + groupselectionfadescale = colorConfig.ground.groupselectionfadescale, + externallinethickness = colorConfig.ground.externallinethickness, + internallinethickness = colorConfig.ground.internallinethickness, + minimapexternallinethickness = colorConfig.ground.minimapexternallinethickness, + minimapinternallinethickness = colorConfig.ground.minimapinternallinethickness, } -- EMP (paralyzer) weapons colorConfig.ground_emp = { - color = { 0.72, 0.72, 1.0, 0.60 }, -- EMP light blue - fadeparams = colorConfig.ground.fadeparams, - groupselectionfadescale = colorConfig.ground.groupselectionfadescale, - externallinethickness = colorConfig.ground.externallinethickness, - internallinethickness = colorConfig.ground.internallinethickness, - minimapexternallinethickness= colorConfig.ground.minimapexternallinethickness, - minimapinternallinethickness= colorConfig.ground.minimapinternallinethickness, + color = { 0.72, 0.72, 1.0, 0.60 }, -- EMP light blue + fadeparams = colorConfig.ground.fadeparams, + groupselectionfadescale = colorConfig.ground.groupselectionfadescale, + externallinethickness = colorConfig.ground.externallinethickness, + internallinethickness = colorConfig.ground.internallinethickness, + minimapexternallinethickness = colorConfig.ground.minimapexternallinethickness, + minimapinternallinethickness = colorConfig.ground.minimapinternallinethickness, } ---------------------------------- local show_selected_weapon_ranges = true -local weaponTypeMap = { 'ground', 'nano', 'AA', 'cannon', 'lrpc' } +local weaponTypeMap = { "ground", "nano", "AA", "cannon", "lrpc" } local unitDefRings = {} --each entry should be a unitdefIDkey to a table: -local vtoldamagetag = Game.armorTypes['vtol'] -local defaultdamagetag = Game.armorTypes['default'] +local vtoldamagetag = Game.armorTypes["vtol"] +local defaultdamagetag = Game.armorTypes["default"] -- globals local minimapUtils = VFS.Include("luaui/Include/minimap_utils.lua") @@ -204,7 +203,6 @@ local builders = {} -- { unitID = unitDef, ...} local unitToggles = {} local unitTogglesChunked = {} - local unitName = {} local unitWeapons = {} local unitMaxWeaponRange = {} @@ -276,21 +274,21 @@ end local function initializeUnitDefRing(unitDefID) local weapons = unitWeapons[unitDefID] - unitDefRings[unitDefID]['rings'] = {} + unitDefRings[unitDefID]["rings"] = {} local weaponCount = #weapons or 0 for weaponNum = 1, #weapons do local weaponDefID = weapons[weaponNum].weaponDef local weaponDef = WeaponDefs[weaponDefID] -- ── your debug & color‐pick here ── - -- spEcho(string.format( - -- "[AttackRange] %s.waterweapon = %s", - -- weaponDef.name, tostring(weaponDef.waterweapon) - -- )) + -- spEcho(string.format( + -- "[AttackRange] %s.waterweapon = %s", + -- weaponDef.name, tostring(weaponDef.waterweapon) + -- )) local range = weaponDef.range local dps = 0 - local weaponType = unitDefRings[unitDefID]['weapons'][weaponNum] + local weaponType = unitDefRings[unitDefID]["weapons"][weaponNum] if weaponType ~= nil and weaponType > 0 then local damage = 0 @@ -304,35 +302,33 @@ local function initializeUnitDefRing(unitDefID) -- local fadeparams = colorConfig[weaponTypeMap[weaponType]].fadeparams -- after you have `weaponDef` and `weaponType`… - local baseKey = weaponTypeMap[ weaponType ] -- e.g. "ground", "AA", etc. - local cfgKey = baseKey + local baseKey = weaponTypeMap[weaponType] -- e.g. "ground", "AA", etc. + local cfgKey = baseKey - -- 1) paralyzer/EMP weapons - if weaponDef.paralyzer then - cfgKey = baseKey .. "_emp" + -- 1) paralyzer/EMP weapons + if weaponDef.paralyzer then + cfgKey = baseKey .. "_emp" --spEcho("[AttackRange] using EMP colour for:", weaponDef.name) - -- 2) DGun override - elseif weaponDef.type == "DGun" then - cfgKey = baseKey .. "_dgun" + -- 2) DGun override + elseif weaponDef.type == "DGun" then + cfgKey = baseKey .. "_dgun" --spEcho("[AttackRange] using DGun style for:", weaponDef.name) - -- 2) then water override - elseif weaponDef.waterWeapon - or (weaponDef.customParams and weaponDef.customParams.waterweapon == "true") - then - cfgKey = baseKey .. "_water" - --spEcho("[AttackRange] using water style for:", weaponDef.name) - end + -- 2) then water override + elseif weaponDef.waterWeapon or (weaponDef.customParams and weaponDef.customParams.waterweapon == "true") then + cfgKey = baseKey .. "_water" + --spEcho("[AttackRange] using water style for:", weaponDef.name) + end - -- safety fallback if you typo the key - if not colorConfig[cfgKey] then - cfgKey = baseKey - end + -- safety fallback if you typo the key + if not colorConfig[cfgKey] then + cfgKey = baseKey + end - local color = colorConfig[cfgKey].color - local fadeparams = colorConfig[cfgKey].fadeparams + local color = colorConfig[cfgKey].color + local fadeparams = colorConfig[cfgKey].fadeparams local isCylinder = 0 - if (weaponDef.cylinderTargeting) and (weaponDef.cylinderTargeting > 0.0) then + if weaponDef.cylinderTargeting and (weaponDef.cylinderTargeting > 0.0) then isCylinder = 1 end local isDgun = (weaponDef.type == "DGun") and 1 or 0 @@ -362,8 +358,7 @@ local function initializeUnitDefRing(unitDefID) local maxangledif = 0 -- customParams (note the case), is a table of strings always - if (weapons[weaponNum].maxAngleDif > -1) and - (not (weaponDef.customParams and weaponDef.customParams.noattackrangearc)) then + if (weapons[weaponNum].maxAngleDif > -1) and not (weaponDef.customParams and weaponDef.customParams.noattackrangearc) then --spEcho(weaponDef.customParams)--, weapons[weaponNum].customParams.noattackarc) local offsetdegrees = 0 local difffract = 0 @@ -375,70 +370,65 @@ local function initializeUnitDefRing(unitDefID) local angledif = math.acos(weapons[weaponNum].maxAngleDif) / mathPi -- Normalize maindir - local length = math.diag(mdx,mdy,mdz) - mdx = mdx/length - mdy = mdy/length - mdz = mdz/length + local length = math.diag(mdx, mdy, mdz) + mdx = mdx / length + mdy = mdy / length + mdz = mdz / length - offsetdegrees = math.atan2(mdx,mdz) * 180 / mathPi + offsetdegrees = math.atan2(mdx, mdz) * 180 / mathPi difffract = angledif --(1.0 - angledif ) * (0.5) -- So 0.001 is tiny aim angle, 0.9999 is full aim angle maxangledif = mathFloor(offsetdegrees) if mathAbs(mdy) > 0.01 and mathAbs(mdy) < 0.99 then -- its off the Y plane - local modifier = math.sqrt ( 1.0 - mdy*mdy) - difffract = difffract * modifier + local modifier = math.sqrt(1.0 - mdy * mdy) + difffract = difffract * modifier + maxangledif = maxangledif + difffract + elseif mathAbs(mdy) < 0.99 then maxangledif = maxangledif + difffract - elseif mathAbs(mdy) < 0.99 then - maxangledif = maxangledif + difffract else - end - - --spEcho(string.format("%s has params offsetdegrees = %.2f MAD = %.3f (%.1f deg), diffract = %.3f md(xyz) = (%.3f,%.3f,%.3f)", weaponDef.name, offsetdegrees, weapons[weaponNum].maxAngleDif, angledif*180, difffract, mdx,mdy,mdz)) - --spEcho("weapons[weaponNum].maxAngleDif",weapons[weaponNum].maxAngleDif, maxangledif) --for k,v in pairs(weapons[weaponNum]) do spEcho(k,v)end end --if weapons[weaponNum].maxAngleDif then spEcho(weapons[weaponNum].maxAngleDif,'for',weaponDef.name, 'saved as',maxangledif ) end - local ringParams = { range, color[1], color[2], color[3], color[4], --5 - fadeparams[1], fadeparams[2], fadeparams[3], fadeparams[4], --9 + local ringParams = { + range, + color[1], + color[2], + color[3], + color[4], --5 + fadeparams[1], + fadeparams[2], + fadeparams[3], + fadeparams[4], --9 weaponDef.projectilespeed or 1, --10 - isCylinder,-- and 1 or 0, (11) + isCylinder, -- and 1 or 0, (11) weaponDef.heightBoostFactor or 0, --12 weaponDef.heightMod or 0, --13 groupselectionfadescale, --14 weaponType, --15 isDgun, --16 - maxangledif --17 + maxangledif, --17 } - unitDefRings[unitDefID]['rings'][weaponNum] = ringParams + unitDefRings[unitDefID]["rings"][weaponNum] = ringParams end end -- for builders, we need to add a special nano ring def if unitBuilder[unitDefID] then local range = unitBuildDistance[unitDefID] - local color = colorConfig['nano'].color - local fadeparams = colorConfig['nano'].fadeparams - local groupselectionfadescale = colorConfig['nano'].groupselectionfadescale - - local ringParams = { range, color[1], color[2], color[3], color[4], - fadeparams[1], fadeparams[2], fadeparams[3], fadeparams[4], - 1, - false, - 0, - 0, - groupselectionfadescale, - 2, - 0 - } - unitDefRings[unitDefID]['rings'][weaponCount + 1] = ringParams -- weaponCount + 1 is nano + local color = colorConfig["nano"].color + local fadeparams = colorConfig["nano"].fadeparams + local groupselectionfadescale = colorConfig["nano"].groupselectionfadescale + + local ringParams = { range, color[1], color[2], color[3], color[4], fadeparams[1], fadeparams[2], fadeparams[3], fadeparams[4], 1, false, 0, 0, groupselectionfadescale, 2, 0 } + unitDefRings[unitDefID]["rings"][weaponCount + 1] = ringParams -- weaponCount + 1 is nano end end @@ -453,61 +443,61 @@ end --Button display configuration --position only relevant if no saved config data found -local myAllyTeam = Spring.GetMyAllyTeamID() -local myTeamID = spGetMyTeamID() +local myAllyTeam = Spring.GetMyAllyTeamID() +local myTeamID = spGetMyTeamID() -------------------------------------------------------------------------------- -local glDepthTest = gl.DepthTest -local glLineWidth = gl.LineWidth -local glTexture = gl.Texture -local glClear = gl.Clear -local glColorMask = gl.ColorMask -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp +local glDepthTest = gl.DepthTest +local glLineWidth = gl.LineWidth +local glTexture = gl.Texture +local glClear = gl.Clear +local glColorMask = gl.ColorMask +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT -local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN -local GL_LEQUAL = GL.LEQUAL -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_NOTEQUAL = GL.NOTEQUAL +local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN +local GL_LEQUAL = GL.LEQUAL +local GL_LINE_LOOP = GL.LINE_LOOP +local GL_NOTEQUAL = GL.NOTEQUAL -local GL_KEEP = 0x1E00 --GL.KEEP -local GL_REPLACE = GL.REPLACE --GL.KEEP +local GL_KEEP = 0x1E00 --GL.KEEP +local GL_REPLACE = GL.REPLACE --GL.KEEP -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitWeaponVectors=Spring.GetUnitWeaponVectors +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitWeaponVectors = Spring.GetUnitWeaponVectors local spGetUnitWeaponState = Spring.GetUnitWeaponState -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local GetModKeyState = Spring.GetModKeyState -local GetActiveCommand = Spring.GetActiveCommand -local GetSelectedUnits = Spring.GetSelectedUnits +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local GetModKeyState = Spring.GetModKeyState +local GetActiveCommand = Spring.GetActiveCommand +local GetSelectedUnits = Spring.GetSelectedUnits local chobbyInterface -local CMD_ATTACK = CMD.ATTACK -local CMD_FIGHT = CMD.FIGHT -local CMD_AREA_ATTACK = CMD.AREA_ATTACK -local CMD_MANUALFIRE = CMD.MANUALFIRE +local CMD_ATTACK = CMD.ATTACK +local CMD_FIGHT = CMD.FIGHT +local CMD_AREA_ATTACK = CMD.AREA_ATTACK +local CMD_MANUALFIRE = CMD.MANUALFIRE function widget:TextCommand(command) local mycommand = false --buttonConfig["enemy"][tag] if string.find(command, "defrange", nil, true) then mycommand = true - local ally = 'ally' - local rangetype = 'ground' + local ally = "ally" + local rangetype = "ground" local enabled = false if string.find(command, "enemy", nil, true) then - ally = 'enemy' + ally = "enemy" end if string.find(command, "nano", nil, true) then - rangetype = 'nano' + rangetype = "nano" elseif string.find(command, "AA", nil, true) then - rangetype = 'AA' + rangetype = "AA" end if string.find(command, "+", nil, true) then enabled = true @@ -529,19 +519,18 @@ local largeCircleSegments = 1024 local smallCircleVBO = nil local smallCircleSegments = 128 -local weaponTypeToString = { "ground", "nano", "AA", "cannon", 'lrpc' } +local weaponTypeToString = { "ground", "nano", "AA", "cannon", "lrpc" } local allyenemypairs = { "ally", "enemy" } -local attackRangeClasses = { 'enemyground', 'enemyAA', 'enemynano', 'allyground', 'allyAA', 'enemycannon', 'allycannon', - 'allynano', 'allylrpc', 'enemylrpc' } +local attackRangeClasses = { "enemyground", "enemyAA", "enemynano", "allyground", "allyAA", "enemycannon", "allycannon", "allynano", "allylrpc", "enemylrpc" } local attackRangeVAOs = {} local circleInstanceVBOLayout = { - { id = 1, name = 'posscale', size = 4 }, -- abs pos for static units, offset for dynamic units, scale is actual range, Y is turretheight - { id = 2, name = 'color1', size = 4 }, -- vec4 the color of this new - { id = 3, name = 'visibility', size = 4 }, --- vec4 FadeStart, FadeEnd, StartAlpha, EndAlpha - { id = 4, name = 'projectileParams', size = 4 }, --- projectileSpeed, iscylinder, heightBoostFactor , heightMod - { id = 5, name = 'additionalParams', size = 4 }, --- groupselectionfadescale, weaponType, ISDGUN, MAXANGLEDIF - { id = 6, name = 'instData', size = 4, type = GL.UNSIGNED_INT }, + { id = 1, name = "posscale", size = 4 }, -- abs pos for static units, offset for dynamic units, scale is actual range, Y is turretheight + { id = 2, name = "color1", size = 4 }, -- vec4 the color of this new + { id = 3, name = "visibility", size = 4 }, --- vec4 FadeStart, FadeEnd, StartAlpha, EndAlpha + { id = 4, name = "projectileParams", size = 4 }, --- projectileSpeed, iscylinder, heightBoostFactor , heightMod + { id = 5, name = "additionalParams", size = 4 }, --- groupselectionfadescale, weaponType, ISDGUN, MAXANGLEDIF + { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } local LuaShader = gl.LuaShader @@ -552,7 +541,7 @@ local pushElementInstance = InstanceVBOTable.pushElementInstance local attackRangeShader = nil local shaderSourceCache = { - shaderName = 'Attack Range GL4', + shaderName = "Attack Range GL4", vssrcpath = "LuaUI/Shaders/weapon_range_rings_unified_gl4.vert.glsl", fssrcpath = "LuaUI/Shaders/weapon_range_rings_unified_gl4.frag.glsl", shaderConfig = { @@ -574,7 +563,7 @@ local shaderSourceCache = { selBuilderCount = 1.0, selUnitCount = 1.0, inMiniMap = 0.0, - pipVisibleArea = {0, 1, 0, 1}, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap + pipVisibleArea = { 0, 1, 0, 1 }, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap }, } @@ -583,10 +572,10 @@ local function goodbye(reason) widgetHandler:RemoveWidget() end - local cacheTable = {} -for i = 1, 24 do cacheTable[i] = 0 end - +for i = 1, 24 do + cacheTable[i] = 0 +end -- code for selected units start here local selectedUnits = {} @@ -610,8 +599,12 @@ local function AddSelectedUnit(unitID, mouseover, newRange) end local unitDefID = spGetUnitDefID(unitID) - if not unitDefID then return end - if collections[unitID] ~= nil then return end + if not unitDefID then + return + end + if collections[unitID] ~= nil then + return + end --- if unittype is toggled off we don't proceed at all local currentUnitName = unitName[unitDefID] @@ -619,7 +612,9 @@ local function AddSelectedUnit(unitID, mouseover, newRange) local allystring = alliedUnit and "ally" or "enemy" local weapons = unitWeapons[unitDefID] - if (not weapons or #weapons == 0) and not unitBuilder[unitDefID] then return end -- no weapons and not builder, nothing to add + if (not weapons or #weapons == 0) and not unitBuilder[unitDefID] then + return + end -- no weapons and not builder, nothing to add -- we want to add to unitDefRings here if it doesn't exist if not unitDefRings[unitDefID] then -- read weapons and add them to weapons table, then add to entry @@ -666,18 +661,22 @@ local function AddSelectedUnit(unitID, mouseover, newRange) local scalingUnitDefs = unitDefRangeScale local scalingUnitParams = unitRangeScale.selections - if mouseover then scalingUnitParams = unitRangeScale.mouseovers end + if mouseover then + scalingUnitParams = unitRangeScale.mouseovers + end local oldRange = {} - if scalingUnitDefs[unitDefID] and alliedUnit then -- Can't read enemy unit ranges. - if not newRange then newRange = {} end + if scalingUnitDefs[unitDefID] and alliedUnit then -- Can't read enemy unit ranges. + if not newRange then + newRange = {} + end scalingUnitParams[unitID] = { oldRange = {} } numScalingUnits = numScalingUnits + 1 oldRange[unitID] = {} for weaponNum = 1, #weapons do - if not newRange[weaponNum] then -- Prevent unnecessary duplicate engine calls. + if not newRange[weaponNum] then -- Prevent unnecessary duplicate engine calls. newRange[weaponNum] = spGetUnitWeaponState(unitID, weaponNum, "range") end - oldRange[unitID][weaponNum] = {weaponNum, newRange[weaponNum]} + oldRange[unitID][weaponNum] = { weaponNum, newRange[weaponNum] } end end @@ -685,7 +684,7 @@ local function AddSelectedUnit(unitID, mouseover, newRange) --for weaponNum = 1, #weapons do local addedRings = 0 - local weaponTypes = unitDefRings[unitDefID]['weapons'] + local weaponTypes = unitDefRings[unitDefID]["weapons"] for j, weaponType in pairs(weaponTypes) do local drawIt = true -- we need to check if the unit has on/off weapon states, and only add the one active @@ -696,19 +695,18 @@ local function AddSelectedUnit(unitID, mouseover, newRange) drawIt = (weaponOnOff == 1) elseif unitOnOffable[unitDefID] and unitOnOffName[unitDefID] then -- this is a unit or building with 2 weapons weaponOnOff = unitsOnOff[unitID] or 0 - drawIt = ((weaponOnOff + 1) == j) or - #weaponTypes == 1 -- remember weaponOnOff is 0 or 1, weapon number starts from 1 + drawIt = ((weaponOnOff + 1) == j) or #weaponTypes == 1 -- remember weaponOnOff is 0 or 1, weapon number starts from 1 end -- we add checks here for the display toggle status from config if unitToggles[currentUnitName] then -- only if there's a config, else default is to draw it local wToggleStatuses = unitToggles[currentUnitName][allystring] - if type(wToggleStatuses) == 'table' then + if type(wToggleStatuses) == "table" then drawIt = wToggleStatuses[j] and drawIt else -- fixing the unitToggles table since something was corrupted local entry = {} - for i=1, #weaponTypes do + for i = 1, #weaponTypes do entry[i] = true end unitToggles[currentUnitName][allystring] = entry @@ -717,15 +715,14 @@ local function AddSelectedUnit(unitID, mouseover, newRange) local ringParams = {} if newRange then - for i = 2, 17 do -- See line 405. - ringParams[i] = unitDefRings[unitDefID]['rings'][j][i] -- Preserves default range from unitDefs for use with enemy units. + for i = 2, 17 do -- See line 405. + ringParams[i] = unitDefRings[unitDefID]["rings"][j][i] -- Preserves default range from unitDefs for use with enemy units. end ringParams[1] = newRange[j] else - ringParams = unitDefRings[unitDefID]['rings'][j] + ringParams = unitDefRings[unitDefID]["rings"][j] end if drawIt and ringParams[1] > 0 then - local weaponID = j -- TODO: -- Weapons aim from their WPY positions, but that can change for e.g. popups! @@ -737,10 +734,9 @@ local function AddSelectedUnit(unitID, mouseover, newRange) -- Now this is a truly terrible hack, we cache each unitDefID's max weapon turret height at position 18 in the table -- so it only goes up with popups - local turretHeight = mathMax(ringParams[18] or 0, (wpy or mpy ) - y) + local turretHeight = mathMax(ringParams[18] or 0, (wpy or mpy) - y) ringParams[18] = turretHeight - cacheTable[1] = mpx cacheTable[2] = turretHeight cacheTable[3] = mpz @@ -751,7 +747,7 @@ local function AddSelectedUnit(unitID, mouseover, newRange) end if false then - local s = ' ' + local s = " " for i = 1, 20 do s = s .. "; " .. tostring(cacheTable[i]) end @@ -760,9 +756,7 @@ local function AddSelectedUnit(unitID, mouseover, newRange) spEcho("added", vaokey, s) end end - local instanceID = 10000000 * (mouseover and 1 or 0) + 1000000 * weaponType + unitID + - 100000 * - j -- weapon index needs to be included here for uniqueness + local instanceID = 10000000 * (mouseover and 1 or 0) + 1000000 * weaponType + unitID + 100000 * j -- weapon index needs to be included here for uniqueness pushElementInstance(attackRangeVAOs[vaokey], cacheTable, instanceID, true, false, unitID) addedRings = addedRings + 1 if collections[unitID] == nil then @@ -773,7 +767,7 @@ local function AddSelectedUnit(unitID, mouseover, newRange) posz = mpz, vaokeys = {}, allied = alliedUnit, - unitDefID = unitDefID + unitDefID = unitDefID, } end collections[unitID].vaokeys[instanceID] = vaokey @@ -791,14 +785,20 @@ end local function RemoveSelectedUnit(unitID, mouseover) --if not show_selected_weapon_ranges then return end local collections = selections - if mouseover then collections = mouseovers end + if mouseover then + collections = mouseovers + end local scalingUnitParams = unitRangeScale.selections - if mouseover then scalingUnitParams = unitRangeScale.mouseovers end + if mouseover then + scalingUnitParams = unitRangeScale.mouseovers + end local removedRings = 0 if collections[unitID] then local collection = collections[unitID] - if not collection then return end + if not collection then + return + end for instanceKey, vaoKey in pairs(collection.vaokeys) do --spEcho(vaoKey,instanceKey) popElementInstance(attackRangeVAOs[vaoKey], instanceKey) @@ -842,24 +842,16 @@ local function initGL4() smallCircleVBO = InstanceVBOTable.makeCircleVBO(smallCircleSegments) largeCircleVBO = InstanceVBOTable.makeCircleVBO(largeCircleSegments) for i, atkRangeClass in ipairs(attackRangeClasses) do - attackRangeVAOs - [atkRangeClass] = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 20, atkRangeClass.. "_attackrange_gl4", 6) -- 6 is unitIDattribID (instData) + attackRangeVAOs[atkRangeClass] = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 20, atkRangeClass .. "_attackrange_gl4", 6) -- 6 is unitIDattribID (instData) if atkRangeClass:find("lrpc", nil, true) or atkRangeClass:find("AA", nil, true) then - attackRangeVAOs - [atkRangeClass].vertexVBO = largeCircleVBO - attackRangeVAOs - [atkRangeClass].numVertices = largeCircleSegments + attackRangeVAOs[atkRangeClass].vertexVBO = largeCircleVBO + attackRangeVAOs[atkRangeClass].numVertices = largeCircleSegments else - attackRangeVAOs - [atkRangeClass].vertexVBO = smallCircleVBO - attackRangeVAOs - [atkRangeClass].numVertices = smallCircleSegments + attackRangeVAOs[atkRangeClass].vertexVBO = smallCircleVBO + attackRangeVAOs[atkRangeClass].numVertices = smallCircleSegments end - local newVAO = InstanceVBOTable.makeVAOandAttach(attackRangeVAOs - [atkRangeClass].vertexVBO, attackRangeVAOs - [atkRangeClass].instanceVBO) - attackRangeVAOs - [atkRangeClass].VAO = newVAO + local newVAO = InstanceVBOTable.makeVAOandAttach(attackRangeVAOs[atkRangeClass].vertexVBO, attackRangeVAOs[atkRangeClass].instanceVBO) + attackRangeVAOs[atkRangeClass].VAO = newVAO end return makeShaders() end @@ -875,17 +867,17 @@ local function DoRangeUpdate(unitID, scalingUnit, mouseover) end end if update then - RemoveSelectedUnit(unitID, mouseover) -- need to refresh this unit's ring + RemoveSelectedUnit(unitID, mouseover) -- need to refresh this unit's ring AddSelectedUnit(unitID, mouseover, newRange) end end -local function UpdateScalingRange() -- This function, and anything related to unitRangeScale, scalingUnitParams, and newRange are parts of a hook for Gunslingers or future/modded units that gain range with EXP. +local function UpdateScalingRange() -- This function, and anything related to unitRangeScale, scalingUnitParams, and newRange are parts of a hook for Gunslingers or future/modded units that gain range with EXP. local scalingUnitParams = unitRangeScale - for unitID, scalingUnit in pairs(scalingUnitParams.selections) do + for unitID, scalingUnit in pairs(scalingUnitParams.selections) do DoRangeUpdate(unitID, scalingUnit) end - for unitID, scalingUnit in pairs(scalingUnitParams.mouseovers) do + for unitID, scalingUnit in pairs(scalingUnitParams.mouseovers) do local mouseover = true DoRangeUpdate(unitID, scalingUnit, mouseover) end @@ -907,7 +899,9 @@ local function RefreshEverything() end local function toggleShowSelectedRanges(on) - if show_selected_weapon_ranges == on then return end + if show_selected_weapon_ranges == on then + return + end show_selected_weapon_ranges = on end @@ -923,7 +917,9 @@ local function cycleUnitDisplay(direction) return end local unitID = selectedUnits[1] - if not unitID then return end + if not unitID then + return + end local alliedUnit = (spGetUnitAllyTeam(unitID) == myAllyTeam) local allystring = alliedUnit and "ally" or "enemy" @@ -950,16 +946,14 @@ local function cycleUnitDisplay(direction) local bitmap = convertToBitmap(newToggleStatuses) local maxConfigBitmap = 2 ^ #newToggleStatuses - 1 -- some crude info display for now - spEcho("Changed range display of " .. name .. - " to config " .. tostring(bitmap) .. - ": " .. table.toString(unitToggles[name][allystring])) + spEcho("Changed range display of " .. name .. " to config " .. tostring(bitmap) .. ": " .. table.toString(unitToggles[name][allystring])) -- write toggle changes to file table.save(unitToggles, "LuaUI/config/AttackRangeConfig2.lua", "--Attack Range Display Configuration (v2)") -- play a sound cue based on status bitmap state: max means all on, 0 means all off - local soundEffect = 'Sounds/commands/cmd-defaultweapon.wav' - local soundEffectOn = 'Sounds/commands/cmd-on.wav' - local soundEffectOff = 'Sounds/commands/cmd-off.wav' + local soundEffect = "Sounds/commands/cmd-defaultweapon.wav" + local soundEffectOn = "Sounds/commands/cmd-on.wav" + local soundEffectOff = "Sounds/commands/cmd-off.wav" local volume = 0.3 if bitmap == maxConfigBitmap then soundEffect = soundEffectOn @@ -968,7 +962,7 @@ local function cycleUnitDisplay(direction) soundEffect = soundEffectOff volume = 0.6 end - Spring.PlaySoundFile(soundEffect, volume, 'ui') + Spring.PlaySoundFile(soundEffect, volume, "ui") RefreshEverything() end @@ -980,8 +974,8 @@ local function cycleUnitDisplayHandler(_, _, _, data) end function widget:PlayerChanged(playerID) - myAllyTeamID = Spring.GetLocalAllyTeamID() - myTeamID = Spring.GetLocalTeamID() + myAllyTeamID = Spring.GetLocalAllyTeamID() + myTeamID = Spring.GetLocalTeamID() InitializeBuilders() end @@ -1000,8 +994,8 @@ function widget:Initialize() end widgetHandler:AddAction("cursor_range_toggle", toggleCursorRange, nil, "p") - widgetHandler:AddAction("attack_range_inc", cycleUnitDisplayHandler, {direction = 1}, "p") - widgetHandler:AddAction("attack_range_dec", cycleUnitDisplayHandler, {direction = -1}, "p") + widgetHandler:AddAction("attack_range_inc", cycleUnitDisplayHandler, { direction = 1 }, "p") + widgetHandler:AddAction("attack_range_dec", cycleUnitDisplayHandler, { direction = -1 }, "p") myAllyTeam = Spring.GetMyAllyTeamID() myTeamID = spGetMyTeamID() @@ -1114,13 +1108,15 @@ function widget:Update(dt) end if timeSinceLastRangeUpdate > DYNAMIC_RANGE_UPDATE_RATE then - UpdateScalingRange() -- This function is relatively expensive, so we only run it when we need to. + UpdateScalingRange() -- This function is relatively expensive, so we only run it when we need to. timeSinceLastRangeUpdate = 0 end if show_selected_weapon_ranges and cursor_unit_range and gameFrame % 3 == 1 then local mx, my, _, mmb, _, mouseOffScreen, cameraPanMode = spGetMouseState() - if mouseOffScreen or mmb or cameraPanMode then return end + if mouseOffScreen or mmb or cameraPanMode then + return + end local desc, args = spTraceScreenRay(mx, my, false) local mUnitID @@ -1146,8 +1142,12 @@ function widget:Update(dt) if shifted then toggleShowSelectedRanges(true) else - if cmdID == 20 then toggleShowSelectedRanges(true) end - if not cmdID or cmdID ~= 20 then toggleShowSelectedRanges(false) end + if cmdID == 20 then + toggleShowSelectedRanges(true) + end + if not cmdID or cmdID ~= 20 then + toggleShowSelectedRanges(false) + end end end local isBuildingNow = (cmdID ~= nil) and (cmdID < 0) -- we're building, need to draw builder ranges @@ -1161,14 +1161,14 @@ end function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) if unitTeam == myTeam and cmdID == 85 then -- my unit, "OnOff" command unitsOnOff[unitID] = cmdParams[1] - RemoveSelectedUnit(unitID) -- need to refresh this unit's ring + RemoveSelectedUnit(unitID) -- need to refresh this unit's ring AddSelectedUnit(unitID) end end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1, 18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end @@ -1183,7 +1183,9 @@ end local groundnukeair = { "ground", "nano", "AA" } local cannonlrpc = { "cannon", "lrpc" } local function DRAWRINGS(primitiveType, linethickness) - if not show_selected_weapon_ranges and not isBuilding then return end + if not show_selected_weapon_ranges and not isBuilding then + return + end local stencilMask attackRangeShader:SetUniform("cannonmode", 0) for i, allyState in ipairs(allyenemypairs) do @@ -1207,7 +1209,7 @@ local function DRAWRINGS(primitiveType, linethickness) attackRangeShader:SetUniform("cannonmode", 1) for i, allyState in ipairs(allyenemypairs) do for j, wt in ipairs(cannonlrpc) do - if linethickness or wt == 'cannon' then + if linethickness or wt == "cannon" then local atkRangeClass = allyState .. wt local iT = attackRangeVAOs[atkRangeClass] local stencilOffset = colorConfig.cannon_separate_stencil and 3 or 0 @@ -1227,17 +1229,18 @@ local function DRAWRINGS(primitiveType, linethickness) end function widget:DrawWorld(inMiniMap) - if autoReload then attackRangeShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or attackRangeShader end - if chobbyInterface or not (selUnitCount > 0 or mouseUnit) then return end - if not Spring.IsGUIHidden() and (not WG['topbar'] or not WG['topbar'].showingQuit()) then + if chobbyInterface or not (selUnitCount > 0 or mouseUnit) then + return + end + if not Spring.IsGUIHidden() and (not WG["topbar"] or not WG["topbar"].showingQuit()) then -- For PIP minimap, use thicker lines since PIP is larger than engine minimap - local inPip = inMiniMap and WG['minimap'] and WG['minimap'].isDrawingInPip + local inPip = inMiniMap and WG["minimap"] and WG["minimap"].isDrawingInPip if inPip then - cameraHeightFactor = 2.5 -- PIP is larger, needs thicker lines + cameraHeightFactor = 2.5 -- PIP is larger, needs thicker lines else cameraHeightFactor = GetCameraHeightFactor() * 0.5 + 0.5 end @@ -1247,12 +1250,12 @@ function widget:DrawWorld(inMiniMap) -- Stencil Setup -- https://learnopengl.com/Advanced-OpenGL/Stencil-testing if colorConfig.drawStencil then - glClear(GL_STENCIL_BUFFER_BIT) -- clear previous stencil - glDepthTest(false) -- always draw, ignore depth test + glClear(GL_STENCIL_BUFFER_BIT) -- clear previous stencil + glDepthTest(false) -- always draw, ignore depth test -- Draw the filled circles onto the stencil buffer - glStencilTest(true) -- enable stencil test - glStencilMask(255) -- set all 8 bits to writeable + glStencilTest(true) -- enable stencil test + glStencilMask(255) -- set all 8 bits to writeable -- 1. Stencil test fails: GL_KEEP existing stencil value -- 2. Z test fails: GL_KEEP existing stencil value @@ -1269,8 +1272,8 @@ function widget:DrawWorld(inMiniMap) attackRangeShader:SetUniform("fadeDistOffset", colorConfig.outer_fade_height_difference) -- Pass PIP visible area if drawing in PIP minimap - if inMiniMap and WG['minimap'] and WG['minimap'].isDrawingInPip and WG['minimap'].getNormalizedVisibleArea then - local left, right, bottom, top = WG['minimap'].getNormalizedVisibleArea() + if inMiniMap and WG["minimap"] and WG["minimap"].isDrawingInPip and WG["minimap"].getNormalizedVisibleArea then + local left, right, bottom, top = WG["minimap"].getNormalizedVisibleArea() attackRangeShader:SetUniform("pipVisibleArea", left, right, bottom, top) else attackRangeShader:SetUniform("pipVisibleArea", 0, 1, 0, 1) @@ -1288,11 +1291,11 @@ function widget:DrawWorld(inMiniMap) attackRangeShader:SetUniform("drawMode", 1.0) attackRangeShader:SetUniform("drawAlpha", 1.0) - DRAWRINGS(GL_LINE_LOOP, inMiniMap and 'minimapexternallinethickness' or 'externallinethickness') -- DRAW THE OUTER RINGS + DRAWRINGS(GL_LINE_LOOP, inMiniMap and "minimapexternallinethickness" or "externallinethickness") -- DRAW THE OUTER RINGS -- This is the correct way to exit out of the stencil mode, to not break drawing of area commands: glStencilTest(false) -- Disable the stencil test - glStencilMask(255) -- Set all bits of stencil buffer to writeable + glStencilMask(255) -- Set all bits of stencil buffer to writeable glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP) -- Reset default stencil operation (which is the do nothing operation) glClear(GL_STENCIL_BUFFER_BIT) -- Clear the stencil buffer for whichever widget wants it next (this is probably redundant) -- All the above are needed :O @@ -1303,7 +1306,7 @@ function widget:DrawWorld(inMiniMap) attackRangeShader:SetUniform("lineAlphaUniform", colorConfig.internalalpha) attackRangeShader:SetUniform("drawMode", 2.0) attackRangeShader:SetUniform("fadeDistOffset", 0) - DRAWRINGS(GL_LINE_LOOP, inMiniMap and 'minimapinternallinethickness' or 'internallinethickness') -- DRAW THE INNER RINGS + DRAWRINGS(GL_LINE_LOOP, inMiniMap and "minimapinternallinethickness" or "internallinethickness") -- DRAW THE INNER RINGS end attackRangeShader:Deactivate() @@ -1333,16 +1336,14 @@ function widget:VisibleUnitRemoved(unitID, unitDefID, unitTeam) builders[unitID] = nil end - - - if autoReload then - function widget:DrawScreen() - if attackRangeShader.DrawPrintf then attackRangeShader.DrawPrintf(0, 64) end - end + function widget:DrawScreen() + if attackRangeShader.DrawPrintf then + attackRangeShader.DrawPrintf(0, 64) + end + end end - --SAVE / LOAD CONFIG FILE ----------------------------------------------------------------------------------------- -- Useful config options to have for players in options menu are: diff --git a/luaui/Widgets/gui_awards.lua b/luaui/Widgets/gui_awards.lua index e8786640e06..696096e8374 100644 --- a/luaui/Widgets/gui_awards.lua +++ b/luaui/Widgets/gui_awards.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "July 2021", license = "GNU GPL, v2 or later", layer = -3, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local tableInsert = table.insert @@ -43,7 +42,7 @@ local threshold = 150000 local CowAward local OtherAwards -local chobbyLoaded = (Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil) +local chobbyLoaded = (Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") ~= nil) local white = "\255" .. string.char(251) .. string.char(251) .. string.char(251) @@ -74,10 +73,10 @@ local function findPlayerName(teamID) if plList[1] then name = plList[1] if #plList > 1 then - name = Spring.I18N('ui.awards.coop', { name = name }) + name = Spring.I18N("ui.awards.coop", { name = name }) end else - name = Spring.I18N('ui.awards.unknown') + name = Spring.I18N("ui.awards.unknown") end return name @@ -91,41 +90,41 @@ local function createAward(pic, award, note, noteColour, winnersTable, offset) local winnerName, secondName, thirdName --award is: 0 for a normal award, 1 for the cow award, 2 for the no-cow awards - local notAwardedText = Spring.I18N('ui.awards.notAwarded') + local notAwardedText = Spring.I18N("ui.awards.notAwarded") winnerName = winnerTeamID >= 0 and findPlayerName(winnerTeamID) or notAwardedText secondName = secondTeamID >= 0 and findPlayerName(secondTeamID) or notAwardedText - thirdName = thirdTeamID >= 0 and findPlayerName(thirdTeamID) or notAwardedText + thirdName = thirdTeamID >= 0 and findPlayerName(thirdTeamID) or notAwardedText thisAward = gl.CreateList(function() font:Begin() --names - if award ~= 2 then -- award + if award ~= 2 then -- award gl.Color(1, 1, 1, 1) - local pic = ':l:LuaRules/Images/' .. pic .. '.png' + local pic = ":l:LuaRules/Images/" .. pic .. ".png" gl.Texture(pic) - gl.TexRect(widgetX + mathFloor(12*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(70*widgetScale), widgetX + mathFloor(108*widgetScale), widgetY + widgetHeightScaled - offset + mathFloor(25*widgetScale)) + gl.TexRect(widgetX + mathFloor(12 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(70 * widgetScale), widgetX + mathFloor(108 * widgetScale), widgetY + widgetHeightScaled - offset + mathFloor(25 * widgetScale)) gl.Texture(false) font:End() font2:Begin() - font2:Print(colourNames(winnerTeamID) .. winnerName, widgetX + mathFloor(120*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(15*widgetScale), 25*widgetScale, "o") + font2:Print(colourNames(winnerTeamID) .. winnerName, widgetX + mathFloor(120 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(15 * widgetScale), 25 * widgetScale, "o") font2:End() font:Begin() - font:Print(noteColour .. note, widgetX + mathFloor(130*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(40*widgetScale), 15*widgetScale, "o") - else -- others + font:Print(noteColour .. note, widgetX + mathFloor(130 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(40 * widgetScale), 15 * widgetScale, "o") + else -- others local heightoffset = 0 if winnerTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.resourcesProduced', { playerColor = colourNames(winnerTeamID), player = winnerName, textColor = white, score = mathFloor(winnerScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(Spring.I18N("ui.awards.resourcesProduced", { playerColor = colourNames(winnerTeamID), player = winnerName, textColor = white, score = mathFloor(winnerScore) }), widgetX + mathFloor(70 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10 * widgetScale) - heightoffset, 14 * widgetScale, "o") heightoffset = heightoffset + (20 * widgetScale) end if secondTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.damageTaken', { playerColor = colourNames(secondTeamID), player = secondName, textColor = white, score = mathFloor(secondScore) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(Spring.I18N("ui.awards.damageTaken", { playerColor = colourNames(secondTeamID), player = secondName, textColor = white, score = mathFloor(secondScore) }), widgetX + mathFloor(70 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10 * widgetScale) - heightoffset, 14 * widgetScale, "o") heightoffset = heightoffset + (20 * widgetScale) end if thirdTeamID >= 0 then - font:Print(Spring.I18N('ui.awards.sleptLongest', { playerColor = colourNames(thirdTeamID), player = thirdName, textColor = white, score = mathFloor(thirdScore / 60) }), widgetX + mathFloor(70*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10*widgetScale) - heightoffset, 14*widgetScale, "o") + font:Print(Spring.I18N("ui.awards.sleptLongest", { playerColor = colourNames(thirdTeamID), player = thirdName, textColor = white, score = mathFloor(thirdScore / 60) }), widgetX + mathFloor(70 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(10 * widgetScale) - heightoffset, 14 * widgetScale, "o") end end @@ -133,47 +132,46 @@ local function createAward(pic, award, note, noteColour, winnersTable, offset) if award == 0 then -- normal awards if winnerTeamID >= 0 then - if pic == 'comwreath' then + if pic == "comwreath" then winnerScore = round(winnerScore, 2) else winnerScore = mathFloor(winnerScore) end - font:Print(colourNames(winnerTeamID) .. winnerScore, widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 14*widgetScale, "o") + font:Print(colourNames(winnerTeamID) .. winnerScore, widgetX + widgetWidthScaled / 2 + mathFloor(275 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5 * widgetScale), 14 * widgetScale, "o") else - font:Print('-', widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 17*widgetScale, "o") + font:Print("-", widgetX + widgetWidthScaled / 2 + mathFloor(275 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5 * widgetScale), 17 * widgetScale, "o") end - font:Print("\255\120\120\120"..Spring.I18N('ui.awards.runnersUp'), widgetX + mathFloor(512*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5*widgetScale), 14*widgetScale, "o") + font:Print("\255\120\120\120" .. Spring.I18N("ui.awards.runnersUp"), widgetX + mathFloor(512 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(5 * widgetScale), 14 * widgetScale, "o") if secondScore > 0 then - if pic == 'comwreath' then + if pic == "comwreath" then secondScore = round(secondScore, 2) else secondScore = mathFloor(secondScore) end font:End() font2:Begin() - font2:Print(colourNames(secondTeamID) .. secondName, widgetX + mathFloor(520*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(27*widgetScale), 16*widgetScale, "o") + font2:Print(colourNames(secondTeamID) .. secondName, widgetX + mathFloor(520 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(27 * widgetScale), 16 * widgetScale, "o") font2:End() font:Begin() - font:Print(colourNames(secondTeamID) .. secondScore, widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(27*widgetScale), 14*widgetScale, "o") + font:Print(colourNames(secondTeamID) .. secondScore, widgetX + widgetWidthScaled / 2 + mathFloor(275 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(27 * widgetScale), 14 * widgetScale, "o") end if thirdScore > 0 then - if pic == 'comwreath' then + if pic == "comwreath" then thirdScore = round(thirdScore, 2) else thirdScore = mathFloor(thirdScore) end font:End() font2:Begin() - font2:Print(colourNames(thirdTeamID) .. thirdName, widgetX + mathFloor(520*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(49*widgetScale), 16*widgetScale, "o") + font2:Print(colourNames(thirdTeamID) .. thirdName, widgetX + mathFloor(520 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(49 * widgetScale), 16 * widgetScale, "o") font2:End() font:Begin() - font:Print(colourNames(thirdTeamID) .. thirdScore, widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(49*widgetScale), 14*widgetScale, "o") + font:Print(colourNames(thirdTeamID) .. thirdScore, widgetX + widgetWidthScaled / 2 + mathFloor(275 * widgetScale), widgetY + widgetHeightScaled - offset - mathFloor(49 * widgetScale), 14 * widgetScale, "o") end end font:End() - end) return thisAward @@ -183,21 +181,21 @@ local function createBackground() if Background then Background = gl.DeleteList(Background) end - if WG['guishader'] then - WG['guishader'].InsertRect(widgetX, widgetY, widgetX + widgetWidthScaled, widgetY + widgetHeightScaled, 'awards') + if WG["guishader"] then + WG["guishader"].InsertRect(widgetX, widgetY, widgetX + widgetWidthScaled, widgetY + widgetHeightScaled, "awards") end Background = gl.CreateList(function() - UiElement(widgetX, widgetY, widgetX + widgetWidthScaled, widgetY + widgetHeightScaled, 1,1,1,1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(widgetX, widgetY, widgetX + widgetWidthScaled, widgetY + widgetHeightScaled, 1, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) gl.Color(1, 1, 1, 1) titleFont:Begin() - titleFont:Print("\255\254\184\64" .. Spring.I18N('ui.awards.awards'), widgetX + widgetWidthScaled / 2, widgetY + widgetHeightScaled - mathFloor(75*widgetScale), 72 * widgetScale, "c") + titleFont:Print("\255\254\184\64" .. Spring.I18N("ui.awards.awards"), widgetX + widgetWidthScaled / 2, widgetY + widgetHeightScaled - mathFloor(75 * widgetScale), 72 * widgetScale, "c") titleFont:End() font:Begin() - font:Print(Spring.I18N('ui.awards.score'), widgetX + widgetWidthScaled / 2 + mathFloor(275*widgetScale), widgetY + widgetHeightScaled - mathFloor(65*widgetScale), 15*widgetScale, "o") + font:Print(Spring.I18N("ui.awards.score"), widgetX + widgetWidthScaled / 2 + mathFloor(275 * widgetScale), widgetY + widgetHeightScaled - mathFloor(65 * widgetScale), 15 * widgetScale, "o") font:End() end) end @@ -207,9 +205,9 @@ function widget:ViewResize(viewSizeX, viewSizeY) viewScreenX, viewScreenY = spGetViewGeometry() - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) - titleFont = WG['fonts'].getFont(2, 4, 0.2, 1) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) + titleFont = WG["fonts"].getFont(2, 4, 0.2, 1) -- fix geometry widgetScale = (0.75 + (viewScreenX * viewScreenY / 7500000)) @@ -230,7 +228,9 @@ function widget:ViewResize(viewSizeX, viewSizeY) end local function ProcessAwards(awards) - if not awards then return end + if not awards then + return + end WG.awards = awards local traitorWinner = awards.traitor[1] local cowAwardWinner = awards.goldenCow[1].teamID @@ -252,37 +252,37 @@ local function ProcessAwards(awards) local offset = 120 if awards.ecoKill[1].teamID >= 0 then - FirstAward = createAward('fuscup', 0, Spring.I18N('ui.awards.resourcesDestroyed'), white, awards.ecoKill, offset) + FirstAward = createAward("fuscup", 0, Spring.I18N("ui.awards.resourcesDestroyed"), white, awards.ecoKill, offset) offset = offset + offsetAdd end if awards.fightKill[1].teamID >= 0 then - SecondAward = createAward('bullcup', 0, Spring.I18N('ui.awards.enemiesDestroyed'), white, awards.fightKill, offset) + SecondAward = createAward("bullcup", 0, Spring.I18N("ui.awards.enemiesDestroyed"), white, awards.fightKill, offset) offset = offset + offsetAdd end if awards.efficiency[1].teamID >= 0 then - ThirdAward = createAward('comwreath', 0, Spring.I18N('ui.awards.resourcesEfficiency'), white, awards.efficiency, offset) + ThirdAward = createAward("comwreath", 0, Spring.I18N("ui.awards.resourcesEfficiency"), white, awards.efficiency, offset) offset = offset + offsetAdd end if traitorWinner.score > threshold then - FourthAward = createAward('traitor', 0, Spring.I18N('ui.awards.traitor'), white, awards.traitor, offset) + FourthAward = createAward("traitor", 0, Spring.I18N("ui.awards.traitor"), white, awards.traitor, offset) offset = offset + offsetAdd end if cowAwardWinner ~= -1 then - CowAward = createAward('cow', 1, Spring.I18N('ui.awards.didEverything'), white, awards.goldenCow, offset) + CowAward = createAward("cow", 1, Spring.I18N("ui.awards.didEverything"), white, awards.goldenCow, offset) offset = offset + offsetAdd end -- make sure the other awards lines are at the bottom - local minOffset = 120 + (offsetAdd*3) + local minOffset = 120 + (offsetAdd * 3) if offset < minOffset then offset = minOffset end - OtherAwards = createAward('', 2, '', white, compoundAwards, offset) + OtherAwards = createAward("", 2, "", white, compoundAwards, offset) drawAwards = true -- don't show graph - Spring.SendCommands('endgraph 0') + Spring.SendCommands("endgraph 0") end function widget:MousePress(x, y, button) @@ -292,10 +292,7 @@ function widget:MousePress(x, y, button) end -- Leave button - if (x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5*widgetScale) - and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font:GetTextWidth(Spring.I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) - and (y > widgetY + mathFloor((50 - 5)*widgetScale)) - and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale))) then + if x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5 * widgetScale) and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20 * widgetScale) * font:GetTextWidth(Spring.I18N("ui.awards.leave")) + mathFloor(5 * widgetScale)) and (y > widgetY + mathFloor((50 - 5) * widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5) * widgetScale)) then if chobbyLoaded then Spring.Reload("") else @@ -304,25 +301,19 @@ function widget:MousePress(x, y, button) end -- Show Graphs button - if (x > widgetX + widgetWidthScaled - graphsRightX - mathFloor(5*widgetScale)) - and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font:GetTextWidth(Spring.I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) - and (y > widgetY + mathFloor((50 - 5)*widgetScale) - and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale))) then - Spring.SendCommands('endgraph 2') - - if WG['guishader'] then - WG['guishader'].RemoveRect('awards') + if (x > widgetX + widgetWidthScaled - graphsRightX - mathFloor(5 * widgetScale)) and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20 * widgetScale) * font:GetTextWidth(Spring.I18N("ui.awards.showGraphs")) + mathFloor(5 * widgetScale)) and (y > widgetY + mathFloor((50 - 5) * widgetScale) and (y < widgetY + mathFloor((50 + 17 + 5) * widgetScale))) then + Spring.SendCommands("endgraph 2") + + if WG["guishader"] then + WG["guishader"].RemoveRect("awards") end drawAwards = false end -- Close button - if (x > widgetX + widgetWidthScaled - closeRightX - mathFloor(5*widgetScale)) - and (x < widgetX + widgetWidthScaled - closeRightX + mathFloor(20*widgetScale) * font:GetTextWidth('X') + mathFloor(5*widgetScale)) - and (y > widgetY + widgetHeightScaled - mathFloor((10 + 17 + 5)*widgetScale) - and (y < widgetY + widgetHeightScaled - mathFloor((10 - 5)*widgetScale))) then - if WG['guishader'] then - WG['guishader'].RemoveRect('awards') + if (x > widgetX + widgetWidthScaled - closeRightX - mathFloor(5 * widgetScale)) and (x < widgetX + widgetWidthScaled - closeRightX + mathFloor(20 * widgetScale) * font:GetTextWidth("X") + mathFloor(5 * widgetScale)) and (y > widgetY + widgetHeightScaled - mathFloor((10 + 17 + 5) * widgetScale) and (y < widgetY + widgetHeightScaled - mathFloor((10 - 5) * widgetScale))) then + if WG["guishader"] then + WG["guishader"].RemoveRect("awards") end drawAwards = false end @@ -363,37 +354,28 @@ function widget:DrawScreen() font2:Begin() -- Leave button - if (x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5*widgetScale)) - and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(Spring.I18N('ui.awards.leave')) + mathFloor(5*widgetScale)) - and (y > widgetY + mathFloor((50 - 5)*widgetScale)) - and (y < widgetY + mathFloor((50 + 17 + 5)*widgetScale)) then + if (x > widgetX + widgetWidthScaled - quitRightX - mathFloor(5 * widgetScale)) and (x < widgetX + widgetWidthScaled - quitRightX + mathFloor(20 * widgetScale) * font2:GetTextWidth(Spring.I18N("ui.awards.leave")) + mathFloor(5 * widgetScale)) and (y > widgetY + mathFloor((50 - 5) * widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5) * widgetScale)) then quitColour = "\255" .. string.char(201) .. string.char(51) .. string.char(51) else quitColour = "\255" .. string.char(201) .. string.char(201) .. string.char(201) end - font2:Print(quitColour .. Spring.I18N('ui.awards.leave'), widgetX + widgetWidthScaled - quitRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") + font2:Print(quitColour .. Spring.I18N("ui.awards.leave"), widgetX + widgetWidthScaled - quitRightX, widgetY + mathFloor(50 * widgetScale), 20 * widgetScale, "o") -- Show Graphs button - if (x > widgetX + widgetWidthScaled - graphsRightX - (5*widgetScale)) - and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20*widgetScale) * font2:GetTextWidth(Spring.I18N('ui.awards.showGraphs')) + mathFloor(5*widgetScale)) - and (y > widgetY + mathFloor((50 - 5)*widgetScale)) - and (y < widgetY + mathFloor((50 + 17 + 5))*widgetScale) then + if (x > widgetX + widgetWidthScaled - graphsRightX - (5 * widgetScale)) and (x < widgetX + widgetWidthScaled - graphsRightX + mathFloor(20 * widgetScale) * font2:GetTextWidth(Spring.I18N("ui.awards.showGraphs")) + mathFloor(5 * widgetScale)) and (y > widgetY + mathFloor((50 - 5) * widgetScale)) and (y < widgetY + mathFloor((50 + 17 + 5)) * widgetScale) then graphColour = "\255" .. string.char(201) .. string.char(51) .. string.char(51) else graphColour = "\255" .. string.char(201) .. string.char(201) .. string.char(201) end - font2:Print(graphColour .. Spring.I18N('ui.awards.showGraphs'), widgetX + widgetWidthScaled - graphsRightX, widgetY + mathFloor(50*widgetScale), 20*widgetScale, "o") + font2:Print(graphColour .. Spring.I18N("ui.awards.showGraphs"), widgetX + widgetWidthScaled - graphsRightX, widgetY + mathFloor(50 * widgetScale), 20 * widgetScale, "o") -- Close button - if (x > widgetX + widgetWidthScaled - closeRightX - (5*widgetScale)) - and (x < widgetX + widgetWidthScaled - closeRightX + mathFloor(20*widgetScale) * font2:GetTextWidth('X') + mathFloor(5*widgetScale)) - and (y > widgetY + widgetHeightScaled - mathFloor((10 + 17 + 5)*widgetScale)) - and (y < widgetY + widgetHeightScaled - mathFloor((10 - 5))*widgetScale) then + if (x > widgetX + widgetWidthScaled - closeRightX - (5 * widgetScale)) and (x < widgetX + widgetWidthScaled - closeRightX + mathFloor(20 * widgetScale) * font2:GetTextWidth("X") + mathFloor(5 * widgetScale)) and (y > widgetY + widgetHeightScaled - mathFloor((10 + 17 + 5) * widgetScale)) and (y < widgetY + widgetHeightScaled - mathFloor((10 - 5)) * widgetScale) then graphColour = "\255" .. string.char(201) .. string.char(51) .. string.char(51) else graphColour = "\255" .. string.char(201) .. string.char(201) .. string.char(201) end - font2:Print(graphColour .. 'X', widgetX + widgetWidthScaled - closeRightX, widgetY + widgetHeightScaled - mathFloor((10 + 17)*widgetScale), 20*widgetScale, "o") + font2:Print(graphColour .. "X", widgetX + widgetWidthScaled - closeRightX, widgetY + widgetHeightScaled - mathFloor((10 + 17) * widgetScale), 20 * widgetScale, "o") font2:End() gl.PopMatrix() end @@ -403,7 +385,7 @@ function widget:LanguageChanged() end function widget:Initialize() - Spring.SendCommands('endgraph 2') + Spring.SendCommands("endgraph 2") widget:ViewResize(viewScreenX, viewScreenY) @@ -429,11 +411,11 @@ function widget:GadgetReceiveAwards(awards) end function widget:Shutdown() - Spring.SendCommands('endgraph 2') + Spring.SendCommands("endgraph 2") if Background then gl.DeleteList(Background) end - if WG['guishader'] then - WG['guishader'].RemoveRect('awards') + if WG["guishader"] then + WG["guishader"].RemoveRect("awards") end end diff --git a/luaui/Widgets/gui_blast_radius.lua b/luaui/Widgets/gui_blast_radius.lua index 88456c730bc..db55775f8ae 100644 --- a/luaui/Widgets/gui_blast_radius.lua +++ b/luaui/Widgets/gui_blast_radius.lua @@ -4,13 +4,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Blast Radius", - desc = "Displays blast radius while placing buildings (META)\nand of selected units (META+X)", - author = "very_bad_soldier", - date = "April 7, 2009", - license = "GNU GPL v2", - layer = 0, - enabled = true + name = "Blast Radius", + desc = "Displays blast radius while placing buildings (META)\nand of selected units (META+X)", + author = "very_bad_soldier", + date = "April 7, 2009", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end @@ -22,7 +22,7 @@ local blastAlphaValue = 0.5 -------------------------------------------------------------------------------- local blastColor = { 1.0, 0.0, 0.0 } local expBlastAlphaValue = 1.0 -local expBlastColor = { 1.0, 0.0, 0.0} +local expBlastColor = { 1.0, 0.0, 0.0 } local explodeTag = "deathExplosion" local selfdTag = "selfDExplosion" local aoeTag = "damageAreaOfEffect" @@ -34,35 +34,35 @@ local expCycleTime = 0.5 ------------------------------------------------------------------------------- -local udefTab = UnitDefs -local weapNamTab = WeaponDefNames -local weapTab = WeaponDefs - -local spGetKeyState = Spring.GetKeyState -local spGetModKeyState = Spring.GetModKeyState -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetGameSeconds = Spring.GetGameSeconds -local spGetActiveCommand = Spring.GetActiveCommand -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local spEcho = Spring.Echo - -local glColor = gl.Color -local glLineWidth = gl.LineWidth -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local glDrawGroundCircle = gl.DrawGroundCircle -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glTranslate = gl.Translate -local glBillboard = gl.Billboard - -local sqrt = math.sqrt -local lower = string.lower - -local spIsSphereInView = Spring.IsSphereInView -local spGetGroundHeight = Spring.GetGroundHeight +local udefTab = UnitDefs +local weapNamTab = WeaponDefNames +local weapTab = WeaponDefs + +local spGetKeyState = Spring.GetKeyState +local spGetModKeyState = Spring.GetModKeyState +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetGameSeconds = Spring.GetGameSeconds +local spGetActiveCommand = Spring.GetActiveCommand +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local spEcho = Spring.Echo + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glDepthTest = gl.DepthTest +local glTexture = gl.Texture +local glDrawGroundCircle = gl.DrawGroundCircle +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glBillboard = gl.Billboard + +local sqrt = math.sqrt +local lower = string.lower + +local spIsSphereInView = Spring.IsSphereInView +local spGetGroundHeight = Spring.GetGroundHeight local font, chobbyInterface @@ -100,7 +100,7 @@ function widget:Initialize() end function widget:ViewResize() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) end local selectedUnits = Spring.GetSelectedUnits() @@ -109,18 +109,20 @@ function widget:SelectionChanged(sel) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorld() - if chobbyInterface then return end + if chobbyInterface then + return + end DrawBuildMenuBlastRange() if #selectedUnits > 0 then local keyPressed = spGetKeyState(KEYSYMS.X) - local _,_,meta = spGetModKeyState() + local _, _, meta = spGetModKeyState() if meta and keyPressed then DrawBlastRadiusSelectedUnits() end @@ -152,18 +154,26 @@ function ChangeBlastColor() if not selfdCycleDir then blastColor[2] = blastColor[2] - addValueSelf - if blastColor[2] < 0 then blastColor[2] = 0 end + if blastColor[2] < 0 then + blastColor[2] = 0 + end else blastColor[2] = blastColor[2] + addValueSelf - if blastColor[2] > 1 then blastColor[2] = 1 end + if blastColor[2] > 1 then + blastColor[2] = 1 + end end if not expCycleDir then expBlastColor[2] = expBlastColor[2] - addValueExp - if expBlastColor[2] < 0 then expBlastColor[2] = 0 end + if expBlastColor[2] < 0 then + expBlastColor[2] = 0 + end else expBlastColor[2] = expBlastColor[2] + addValueExp - if expBlastColor[2] > 1 then expBlastColor[2] = 1 end + if expBlastColor[2] > 1 then + expBlastColor[2] = 1 + end end lastColorChangeTime = time @@ -171,18 +181,26 @@ end function DrawBuildMenuBlastRange() local _, cmd_id, cmd_type = spGetActiveCommand() - if not cmd_id or cmd_type ~= 20 then return end + if not cmd_id or cmd_type ~= 20 then + return + end - local _,_,meta = spGetModKeyState() - if not meta then return end + local _, _, meta = spGetModKeyState() + if not meta then + return + end local unitDefID = -cmd_id local data = blastDataCache[unitDefID] - if not data or not data.explodeRadius then return end + if not data or not data.explodeRadius then + return + end local mx, my = spGetMouseState() local _, coords = spTraceScreenRay(mx, my, true, true) - if not coords then return end + if not coords then + return + end local centerX, _, centerZ = Spring.Pos2BuildPos(unitDefID, coords[1], 0, coords[3]) @@ -197,10 +215,14 @@ end function DrawUnitBlastRadius(unitID, data) local x, y, z = spGetUnitPosition(unitID) - if not x then return end + if not x then + return + end local maxRadius = data.selfdRadius > data.explodeRadius and data.selfdRadius or data.explodeRadius - if not spIsSphereInView(x, y, z, maxRadius) then return end + if not spIsSphereInView(x, y, z, maxRadius) then + return + end local height = spGetGroundHeight(x, z) @@ -251,18 +273,21 @@ function ResetGl() glTexture(false) end -function printDebug( value ) - if ( debug ) then - if ( type( value ) == "boolean" ) then - if ( value == true ) then spEcho( "true" ) - else spEcho("false") end - elseif ( type(value ) == "table" ) then +function printDebug(value) + if debug then + if type(value) == "boolean" then + if value == true then + spEcho("true") + else + spEcho("false") + end + elseif type(value) == "table" then spEcho("Dumping table:") - for key,val in pairs(value) do - spEcho(key,val) + for key, val in pairs(value) do + spEcho(key, val) end else - spEcho( value ) + spEcho(value) end end end diff --git a/luaui/Widgets/gui_build_eta.lua b/luaui/Widgets/gui_build_eta.lua index cb664a17d03..7df2af0b914 100644 --- a/luaui/Widgets/gui_build_eta.lua +++ b/luaui/Widgets/gui_build_eta.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "2007", license = "GNU GPL, v2 or later", layer = -90, - enabled = true + enabled = true, } end @@ -45,17 +45,17 @@ local featureETATable = {} -- At ETA_DIST_FULL the text is fully visible at max font size. -- Between ETA_DIST_FULL and ETA_DIST_FADE the text fades out linearly. -- Beyond ETA_DIST_FADE the text is invisible. -local ETA_DIST_FULL = 500 -- fully opaque + largest font below this distance -local ETA_DIST_FADE = 1000 -- completely transparent / hidden beyond this distance -local ETA_FONT_CLOSE = 44 -- font size (px) when closer than ETA_DIST_FULL -local ETA_FONT_FAR = 11 -- font size (px) when at ETA_DIST_FADE +local ETA_DIST_FULL = 500 -- fully opaque + largest font below this distance +local ETA_DIST_FADE = 1000 -- completely transparent / hidden beyond this distance +local ETA_FONT_CLOSE = 44 -- font size (px) when closer than ETA_DIST_FULL +local ETA_FONT_FAR = 11 -- font size (px) when at ETA_DIST_FADE local ETA_SCREEN_OFFSET_Y = -35 -- pixels below the projected world position (negative = down on screen) local blinkTime = 20 local minETASecs = 5 -- Don't show ETA if it is less than 5 seconds -- Pre-cache I18N strings to avoid per-unit per-frame lookups -local i18n_buildTime = "\255\255\255\1" .. Spring.I18N('ui.buildEstimate.time') .. "\255\255\255\255 " -local i18n_cancelled = Spring.I18N('ui.buildEstimate.cancelled') .. " " +local i18n_buildTime = "\255\255\255\1" .. Spring.I18N("ui.buildEstimate.time") .. "\255\255\255\255 " +local i18n_cancelled = Spring.I18N("ui.buildEstimate.cancelled") .. " " local unitHeight = {} for udid, unitDef in pairs(UnitDefs) do @@ -66,10 +66,9 @@ for featureDefID, featureDef in pairs(FeatureDefs) do featureHeight[featureDefID] = featureDef.height end - function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont(nil, 1.2, 0.2, 20) + font = WG["fonts"].getFont(nil, 1.2, 0.2, 20) end local function makeUnitETA(unitID, unitDefID) @@ -77,7 +76,7 @@ local function makeUnitETA(unitID, unitDefID) return nil end local isBuilding, buildProgress = spGetUnitIsBeingBuilt(unitID) - if not isBuilding then + if not isBuilding then return nil end @@ -89,7 +88,7 @@ local function makeUnitETA(unitID, unitDefID) rate = nil, timeLeft = nil, display = alreadyStarted or nil, -- show immediately for existing units (will show ??? until rate is known) - yoffset = unitHeight[unitDefID] + 14 + yoffset = unitHeight[unitDefID] + 14, } end @@ -109,14 +108,14 @@ local function makeFeatureETA(featureID, featureDefID) lastProg = progress, rate = nil, timeLeft = nil, - yoffset = featureHeight[featureDefID] + 14 + yoffset = featureHeight[featureDefID] + 14, } end local function init() unitETATable = {} local units = Spring.GetAllUnits() - for i=1, #units do + for i = 1, #units do local unitID = units[i] if fullview or spGetUnitAllyTeam(unitID) == myAllyTeam then unitETATable[unitID] = makeUnitETA(unitID, Spring.GetUnitDefID(unitID)) @@ -143,8 +142,8 @@ function widget:Initialize() end function widget:LanguageChanged() - i18n_buildTime = "\255\255\255\1" .. Spring.I18N('ui.buildEstimate.time') .. "\255\255\255\255 " - i18n_cancelled = Spring.I18N('ui.buildEstimate.cancelled') .. " " + i18n_buildTime = "\255\255\255\1" .. Spring.I18N("ui.buildEstimate.time") .. "\255\255\255\255 " + i18n_cancelled = Spring.I18N("ui.buildEstimate.cancelled") .. " " end local function updateEta(eta, newProgress, gameSeconds, abs) @@ -160,7 +159,7 @@ local function updateEta(eta, newProgress, gameSeconds, abs) if rate ~= 0 then if eta.firstSet then - if (newProgress > 0.001) then + if newProgress > 0.001 then eta.firstSet = false end else @@ -186,7 +185,9 @@ local function updateEta(eta, newProgress, gameSeconds, abs) else newTime = newProgress / rate end - if abs then newTime = math.abs(newTime) end + if abs then + newTime = math.abs(newTime) + end eta.timeLeft = newTime end @@ -202,7 +203,6 @@ local function updateEta(eta, newProgress, gameSeconds, abs) end function widget:Update(dt) - local gs = spGetGameSeconds() if gs == lastGameUpdate then return @@ -226,7 +226,6 @@ function widget:Update(dt) end updateEta(eta, progress, gs, true) end - end function widget:PlayerChanged() @@ -265,8 +264,8 @@ local function drawEtaText(timeLeft, alpha, fontSize) if timeLeft == nil then etaText = etaPrefix .. "\255\1\1\255???" else - local canceled = timeLeft<0 - etaPrefix = (not canceled and etaPrefix) or (((spGetGameFrame()%blinkTime>=blinkTime/2) and "\255\255\255\255" or"\255\255\1\1")..i18n_cancelled) + local canceled = timeLeft < 0 + etaPrefix = (not canceled and etaPrefix) or (((spGetGameFrame() % blinkTime >= blinkTime / 2) and "\255\255\255\255" or "\255\255\1\1") .. i18n_cancelled) timeLeft = math.abs(timeLeft) local minutes = timeLeft / 60 local seconds = timeLeft % 60 @@ -280,10 +279,10 @@ local function drawEtaText(timeLeft, alpha, fontSize) glColor(1, 1, 1, 1) end - - function widget:DrawScreenEffects() - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end local cx, cy, cz = spGetCameraPosition() @@ -292,7 +291,7 @@ function widget:DrawScreenEffects() local ux, uy, uz = spGetUnitViewPosition(unitID) if ux ~= nil then local dx, dy, dz = ux - cx, uy - cy, uz - cz - local dist = math.sqrt(dx*dx + dy*dy + dz*dz) + local dist = math.sqrt(dx * dx + dy * dy + dz * dz) if dist < ETA_DIST_FADE then local alpha, fontSize if dist <= ETA_DIST_FULL then @@ -320,7 +319,7 @@ function widget:DrawScreenEffects() local fx, fy, fz = spGetFeaturePosition(featureID) if fx ~= nil then local dx, dy, dz = fx - cx, fy - cy, fz - cz - local dist = math.sqrt(dx*dx + dy*dy + dz*dz) + local dist = math.sqrt(dx * dx + dy * dy + dz * dz) if dist < ETA_DIST_FADE then local alpha, fontSize if dist <= ETA_DIST_FULL then diff --git a/luaui/Widgets/gui_build_placement_extension.lua b/luaui/Widgets/gui_build_placement_extension.lua index 82a9d07117f..a5c3976603d 100644 --- a/luaui/Widgets/gui_build_placement_extension.lua +++ b/luaui/Widgets/gui_build_placement_extension.lua @@ -1,68 +1,68 @@ function widget:GetInfo() return { - name = "Build Placement Extension", - desc = "Extends the build placement with preview of buildability in surrounding cells.", - author = "Floris", - date = "April 2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Build Placement Extension", + desc = "Extends the build placement with preview of buildability in surrounding cells.", + author = "Floris", + date = "April 2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end -------------------------------------------------------------------------------- -- Tunables -------------------------------------------------------------------------------- -local MARGIN_CELLS = 0 -- number of build-squares of preview around the unit footprint -local CELL = 16 -- engine build square size (elmos) - -local OUTLINE_ENABLED = false -- draw the thick footprint outline -local OUTLINE_WIDTH = 3.0 -- line width of footprint outline -local OUTLINE_Y_OFFSET = 0.4 -- small lift above ground to avoid z-fight with engine grid - -local INNER_CELL_ALPHA = 0.33 -- alpha of inner (footprint) cells -local CELL_ALPHA_BEGIN = 0.18 -- alpha of closest margin cells (near footprint) -local CELL_ALPHA_END = 0.07 -- alpha of farthest margin cells -local CELL_Y_OFFSET = 0.6 -- raise margin cell quads slightly above ground -local CELL_INSET = 0.19 -- fraction to shrink each cell inward (0 = full, 0.5 = point) -local CELL_CHAMFER = 0.12 -- fraction of cell size to cut off each corner -local INNER_CELL_INSET = 0.12 -- inset for inner (footprint) cells -local INNER_CELL_CHAMFER = 0.09 -- chamfer for inner (footprint) cells - -local CELL_OUTLINE = true -- draw an outline around each cell octagon -local CELL_OUTLINE_WIDTH = 2.0 -- line width of per-cell outline -local CELL_OUTLINE_ALPHA = 0.5 -- multiplier on cell alpha for the outline (clamped to 1) - -local ONLY_WHEN_BLOCKED = true -- when true, only show the extension when the building can't be placed -local SHOW_NEAR_BLOCKED = false -- when ONLY_WHEN_BLOCKED, still show if any adjacent margin cell is blocked -local DRAW_INNER_CELLS = true -- also draw cells inside the footprint (where the engine grid is) - -local COLOR_FREE = { 0.3, 1.0, 0.3 } -local COLOR_RECLAIM = { 0.3, 1.0, 0.3 } -local COLOR_MOBILE = { 0.5, 1.0, 0.3 } -local COLOR_BLOCKED = { 1.0, 0.25, 0.2 } +local MARGIN_CELLS = 0 -- number of build-squares of preview around the unit footprint +local CELL = 16 -- engine build square size (elmos) + +local OUTLINE_ENABLED = false -- draw the thick footprint outline +local OUTLINE_WIDTH = 3.0 -- line width of footprint outline +local OUTLINE_Y_OFFSET = 0.4 -- small lift above ground to avoid z-fight with engine grid + +local INNER_CELL_ALPHA = 0.33 -- alpha of inner (footprint) cells +local CELL_ALPHA_BEGIN = 0.18 -- alpha of closest margin cells (near footprint) +local CELL_ALPHA_END = 0.07 -- alpha of farthest margin cells +local CELL_Y_OFFSET = 0.6 -- raise margin cell quads slightly above ground +local CELL_INSET = 0.19 -- fraction to shrink each cell inward (0 = full, 0.5 = point) +local CELL_CHAMFER = 0.12 -- fraction of cell size to cut off each corner +local INNER_CELL_INSET = 0.12 -- inset for inner (footprint) cells +local INNER_CELL_CHAMFER = 0.09 -- chamfer for inner (footprint) cells + +local CELL_OUTLINE = true -- draw an outline around each cell octagon +local CELL_OUTLINE_WIDTH = 2.0 -- line width of per-cell outline +local CELL_OUTLINE_ALPHA = 0.5 -- multiplier on cell alpha for the outline (clamped to 1) + +local ONLY_WHEN_BLOCKED = true -- when true, only show the extension when the building can't be placed +local SHOW_NEAR_BLOCKED = false -- when ONLY_WHEN_BLOCKED, still show if any adjacent margin cell is blocked +local DRAW_INNER_CELLS = true -- also draw cells inside the footprint (where the engine grid is) + +local COLOR_FREE = { 0.3, 1.0, 0.3 } +local COLOR_RECLAIM = { 0.3, 1.0, 0.3 } +local COLOR_MOBILE = { 0.5, 1.0, 0.3 } +local COLOR_BLOCKED = { 1.0, 0.25, 0.2 } -------------------------------------------------------------------------------- -- Locals -------------------------------------------------------------------------------- local spGetActiveCommand = Spring.GetActiveCommand -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local spPos2BuildPos = Spring.Pos2BuildPos -local spTestBuildOrder = Spring.TestBuildOrder -local spGetBuildFacing = Spring.GetBuildFacing -local spGetGroundHeight = Spring.GetGroundHeight - -local glColor = gl.Color -local glVertex = gl.Vertex +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local spPos2BuildPos = Spring.Pos2BuildPos +local spTestBuildOrder = Spring.TestBuildOrder +local spGetBuildFacing = Spring.GetBuildFacing +local spGetGroundHeight = Spring.GetGroundHeight + +local glColor = gl.Color +local glVertex = gl.Vertex local glBeginEnd = gl.BeginEnd local glLineWidth = gl.LineWidth local glDepthTest = gl.DepthTest local glDepthMask = gl.DepthMask -local GL_QUADS = GL.QUADS -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN +local GL_QUADS = GL.QUADS +local GL_LINE_LOOP = GL.LINE_LOOP +local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN local activeUnitDefID local UnitDefs = UnitDefs @@ -72,9 +72,11 @@ local CACHE_INTERVAL = 0.25 local cache = { unitDefID = nil, facing = nil, - cx = nil, cz = nil, + cx = nil, + cz = nil, lastUpdate = nil, - hx = 0, hz = 0, + hx = 0, + hz = 0, cy = 0, } local cellDisplayList = nil @@ -82,8 +84,8 @@ local outlineDisplayList = nil local spGetTimer = Spring.GetTimer local spDiffTimers = Spring.DiffTimers local glCreateList = gl.CreateList -local glCallList = gl.CallList -local glDeleteList = gl.DeleteList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList -------------------------------------------------------------------------------- -- Helpers @@ -92,17 +94,27 @@ local glDeleteList = gl.DeleteList -- footprint half-extents in elmos (accounts for facing rotation) local function getHalfExtents(unitDefID, facing) local ud = UnitDefs[unitDefID] - if not ud then return 0, 0 end + if not ud then + return 0, 0 + end local xs, zs = ud.xsize, ud.zsize - if facing % 2 == 1 then xs, zs = zs, xs end + if facing % 2 == 1 then + xs, zs = zs, xs + end -- xsize/zsize are in 8-elmo half-cells, footprint = xs * 8 return xs * 4, zs * 4 end local function statusToColor(status) - if status == 3 then return COLOR_FREE end - if status == 2 then return COLOR_RECLAIM end - if status == 1 then return COLOR_MOBILE end + if status == 3 then + return COLOR_FREE + end + if status == 2 then + return COLOR_RECLAIM + end + if status == 1 then + return COLOR_MOBILE + end return COLOR_BLOCKED end @@ -114,8 +126,10 @@ local function drawCellOctagon(x1, z1, x2, z2, inset, chamfer) -- Inset: shrink the quad toward its center local inX = (x2 - x1) * inset local inZ = (z2 - z1) * inset - x1 = x1 + inX; z1 = z1 + inZ - x2 = x2 - inX; z2 = z2 - inZ + x1 = x1 + inX + z1 = z1 + inZ + x2 = x2 - inX + z2 = z2 - inZ -- Chamfer offset local cw = (x2 - x1) * chamfer local ch = (z2 - z1) * chamfer @@ -145,8 +159,10 @@ local function drawCellOutlineOctagon(x1, z1, x2, z2, inset, chamfer) -- Emit the same 8 octagon vertices for a GL_LINE_LOOP local inX = (x2 - x1) * inset local inZ = (z2 - z1) * inset - x1 = x1 + inX; z1 = z1 + inZ - x2 = x2 - inX; z2 = z2 - inZ + x1 = x1 + inX + z1 = z1 + inZ + x2 = x2 - inX + z2 = z2 - inZ local cw = (x2 - x1) * chamfer local ch = (z2 - z1) * chamfer local yo = CELL_Y_OFFSET @@ -207,24 +223,38 @@ function widget:DrawWorldPreUnit() local unitDefID = activeUnitDefID if not unitDefID then -- Clean up display lists when not building - if cellDisplayList then glDeleteList(cellDisplayList); cellDisplayList = nil end - if outlineDisplayList then glDeleteList(outlineDisplayList); outlineDisplayList = nil end + if cellDisplayList then + glDeleteList(cellDisplayList) + cellDisplayList = nil + end + if outlineDisplayList then + glDeleteList(outlineDisplayList) + outlineDisplayList = nil + end cache.lastUpdate = nil return end local ud = UnitDefs[unitDefID] - if not ud then return end + if not ud then + return + end local mx, my = spGetMouseState() local _, mp = spTraceScreenRay(mx, my, true, false, false, true) - if not mp then return end + if not mp then + return + end local facing = spGetBuildFacing() or 0 local cx, cy, cz = spPos2BuildPos(unitDefID, mp[1], mp[2], mp[3], facing) - if not cx then return end + if not cx then + return + end local hx, hz = getHalfExtents(unitDefID, facing) - if hx == 0 then return end + if hx == 0 then + return + end -- Early out: if option set, skip when placement is valid -- status: 0=blocked, 1=mobile unit in way, 2=reclaimable feature, 3=open @@ -247,22 +277,38 @@ function widget:DrawWorldPreUnit() local hypoX = baseX + ix * CELL + CELL * 0.5 local hypoZ = baseZ + iz * CELL + CELL * 0.5 local sxs, sys, szs = spPos2BuildPos(unitDefID, hypoX, cy, hypoZ, facing) - if sxs - hx < 0 then sxs = sxs + CELL * math.ceil((hx - sxs) / CELL) end - if sxs + hx > mapX then sxs = sxs - CELL * math.ceil((sxs + hx - mapX) / CELL) end - if szs - hz < 0 then szs = szs + CELL * math.ceil((hz - szs) / CELL) end - if szs + hz > mapZ then szs = szs - CELL * math.ceil((szs + hz - mapZ) / CELL) end + if sxs - hx < 0 then + sxs = sxs + CELL * math.ceil((hx - sxs) / CELL) + end + if sxs + hx > mapX then + sxs = sxs - CELL * math.ceil((sxs + hx - mapX) / CELL) + end + if szs - hz < 0 then + szs = szs + CELL * math.ceil((hz - szs) / CELL) + end + if szs + hz > mapZ then + szs = szs - CELL * math.ceil((szs + hz - mapZ) / CELL) + end if spTestBuildOrder(unitDefID, sxs, sys, szs, facing) == 0 then showAnyway = true break end end end - if showAnyway then break end + if showAnyway then + break + end end end if not showAnyway then - if cellDisplayList then glDeleteList(cellDisplayList); cellDisplayList = nil end - if outlineDisplayList then glDeleteList(outlineDisplayList); outlineDisplayList = nil end + if cellDisplayList then + glDeleteList(cellDisplayList) + cellDisplayList = nil + end + if outlineDisplayList then + glDeleteList(outlineDisplayList) + outlineDisplayList = nil + end cache.lastUpdate = nil return end @@ -271,17 +317,16 @@ function widget:DrawWorldPreUnit() -- Decide whether to rebuild the display lists local now = spGetTimer() - local needRebuild = cache.unitDefID ~= unitDefID - or cache.facing ~= facing - or cache.cx ~= cx or cache.cz ~= cz - or cache.lastUpdate == nil - or spDiffTimers(now, cache.lastUpdate) >= CACHE_INTERVAL + local needRebuild = cache.unitDefID ~= unitDefID or cache.facing ~= facing or cache.cx ~= cx or cache.cz ~= cz or cache.lastUpdate == nil or spDiffTimers(now, cache.lastUpdate) >= CACHE_INTERVAL if needRebuild then cache.unitDefID = unitDefID cache.facing = facing - cache.cx = cx; cache.cz = cz; cache.cy = cy - cache.hx = hx; cache.hz = hz + cache.cx = cx + cache.cz = cz + cache.cy = cy + cache.hx = hx + cache.hz = hz cache.lastUpdate = now -- Status of the actual placement (drives outline color) @@ -289,7 +334,9 @@ function widget:DrawWorldPreUnit() local outlineColor = statusToColor(placementStatus) -- Build cell display list - if cellDisplayList then glDeleteList(cellDisplayList) end + if cellDisplayList then + glDeleteList(cellDisplayList) + end cellDisplayList = glCreateList(function() local fpCellsX = math.floor((hx * 2) / CELL + 0.5) local fpCellsZ = math.floor((hz * 2) / CELL + 0.5) @@ -311,10 +358,18 @@ function widget:DrawWorldPreUnit() local hypoX = wx1 + CELL * 0.5 local hypoZ = wz1 + CELL * 0.5 local sxs, sys, szs = spPos2BuildPos(unitDefID, hypoX, cy, hypoZ, facing) - if sxs - hx < 0 then sxs = sxs + CELL * math.ceil((hx - sxs) / CELL) end - if sxs + hx > mapX then sxs = sxs - CELL * math.ceil((sxs + hx - mapX) / CELL) end - if szs - hz < 0 then szs = szs + CELL * math.ceil((hz - szs) / CELL) end - if szs + hz > mapZ then szs = szs - CELL * math.ceil((szs + hz - mapZ) / CELL) end + if sxs - hx < 0 then + sxs = sxs + CELL * math.ceil((hx - sxs) / CELL) + end + if sxs + hx > mapX then + sxs = sxs - CELL * math.ceil((sxs + hx - mapX) / CELL) + end + if szs - hz < 0 then + szs = szs + CELL * math.ceil((hz - szs) / CELL) + end + if szs + hz > mapZ then + szs = szs - CELL * math.ceil((szs + hz - mapZ) / CELL) + end local status = spTestBuildOrder(unitDefID, sxs, sys, szs, facing) local c = statusToColor(status) local alpha @@ -360,7 +415,10 @@ function widget:DrawWorldPreUnit() end) -- Build outline display list - if outlineDisplayList then glDeleteList(outlineDisplayList); outlineDisplayList = nil end + if outlineDisplayList then + glDeleteList(outlineDisplayList) + outlineDisplayList = nil + end if OUTLINE_ENABLED then outlineDisplayList = glCreateList(function() glLineWidth(OUTLINE_WIDTH) @@ -376,10 +434,14 @@ function widget:DrawWorldPreUnit() -- Draw cached display lists glDepthTest(false) glDepthMask(false) - if cellDisplayList then glCallList(cellDisplayList) end + if cellDisplayList then + glCallList(cellDisplayList) + end glDepthTest(true) - if outlineDisplayList then glCallList(outlineDisplayList) end + if outlineDisplayList then + glCallList(outlineDisplayList) + end glColor(1, 1, 1, 1) glDepthMask(false) @@ -387,6 +449,10 @@ function widget:DrawWorldPreUnit() end function widget:Shutdown() - if cellDisplayList then glDeleteList(cellDisplayList) end - if outlineDisplayList then glDeleteList(outlineDisplayList) end + if cellDisplayList then + glDeleteList(cellDisplayList) + end + if outlineDisplayList then + glDeleteList(outlineDisplayList) + end end diff --git a/luaui/Widgets/gui_buildbar.lua b/luaui/Widgets/gui_buildbar.lua index e6c25d74f74..74e42b4ea1c 100644 --- a/luaui/Widgets/gui_buildbar.lua +++ b/luaui/Widgets/gui_buildbar.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "Jul 11, 2007", license = "GNU GPL, v2 or later", layer = 1, - enabled = false + enabled = false, } end - -- Localized functions for performance local mathAbs = math.abs local mathFloor = math.floor @@ -31,10 +30,10 @@ local vsx, vsy = spGetViewGeometry() local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) -- saved values -local bar_side = 1 --left:0,top:2,right:1,bottom:3 +local bar_side = 1 --left:0,top:2,right:1,bottom:3 local bar_horizontal = false --(not saved) if sides==top v bottom -> horizontal:=true else-> horizontal:=false -local bar_offset = 0 --relative offset side middle (i.e., bar_pos := vsx*0.5+bar_offset) -local bar_align = 1 --aligns icons to bar_pos: center=0; left/top=+1; right/bottom=-1 +local bar_offset = 0 --relative offset side middle (i.e., bar_pos := vsx*0.5+bar_offset) +local bar_align = 1 --aligns icons to bar_pos: center=0; left/top=+1; right/bottom=-1 -- list and interface vars local facs = {} @@ -46,22 +45,22 @@ local pressedFac = -1 local pressedBOpt = -1 local dlists = {} -local buildOptionsDlist = nil -- Display list for build options menu -local lastBuildOptionsMenu = -1 -- Track which factory's menu we cached -local lastBuildQueue = {} -- Track build queue state to detect changes -local lastGuishaderMenu = -1 -- Track which menu guishader was created for +local buildOptionsDlist = nil -- Display list for build options menu +local lastBuildOptionsMenu = -1 -- Track which factory's menu we cached +local lastBuildQueue = {} -- Track build queue state to detect changes +local lastGuishaderMenu = -1 -- Track which menu guishader was created for -- render-to-texture state local factoryTex, buildOptionsTex -local factoryTexW, factoryTexH = 0, 0 -- track texture dimensions for resize detection +local factoryTexW, factoryTexH = 0, 0 -- track texture dimensions for resize detection local updateFactoryTex = true local updateBuildOptionsTex = true local lastHoveredFac = -1 local lastOpenedMenu = -1 -- Track what each factory is building to detect changes -local factoryBuildingUnit = {} -- factoryUnitID -> unitDefID being built -local factoryListChanged = true -- Flag to trigger display list rebuild +local factoryBuildingUnit = {} -- factoryUnitID -> unitDefID being built +local factoryListChanged = true -- Flag to trigger display list rebuild -- factory icon rectangle local facRect = { -1, -1, -1, -1 } @@ -84,22 +83,22 @@ for udid, unitDef in pairs(UnitDefs) do unitBuildOptions[udid] = unitDef.buildOptions end if unitDef.iconType and orgIconTypes[unitDef.iconType] and orgIconTypes[unitDef.iconType].bitmap then - unitIcon[udid] = ':l:'..orgIconTypes[unitDef.iconType].bitmap + unitIcon[udid] = ":l:" .. orgIconTypes[unitDef.iconType].bitmap end end orgIconTypes = nil local repeatPic = ":l:LuaUI/Images/repeat.png" -local iconSizeY = 65 -- reset in ViewResize +local iconSizeY = 65 -- reset in ViewResize local iconSizeX = iconSizeY -local repIcoSize = mathFloor(iconSizeY * 0.6) --repeat iconsize +local repIcoSize = mathFloor(iconSizeY * 0.6) --repeat iconsize local msx = Game.mapX * 512 local msz = Game.mapY * 512 -local groups, unitGroup = {}, {} -- retrieves from buildmenu in initialize -local unitOrder = {} -- retrieves from buildmenu in initialize +local groups, unitGroup = {}, {} -- retrieves from buildmenu in initialize +local unitOrder = {} -- retrieves from buildmenu in initialize local bgpadding, font, backgroundRect, backgroundOptionsRect, buildoptionsArea, dlistGuishader, dlistGuishader2, forceGuishader local factoriesArea, cornerSize, setInfoDisplayUnitID, setInfoDisplayUnitDefID, factoriesAreaHovered @@ -128,23 +127,23 @@ local glTexRect = gl.TexRect local RectRound, RectRoundProgress, UiElement, UiUnit, elementCorner local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } ------------------------------------------------------------------------------- -- SOUNDS ------------------------------------------------------------------------------- -local sound_click = 'LuaUI/Sounds/buildbar_click.wav' -local sound_hover = 'LuaUI/Sounds/buildbar_hover.wav' -local sound_queue_add = 'LuaUI/Sounds/buildbar_add.wav' -local sound_queue_rem = 'LuaUI/Sounds/buildbar_rem.wav' +local sound_click = "LuaUI/Sounds/buildbar_click.wav" +local sound_hover = "LuaUI/Sounds/buildbar_hover.wav" +local sound_queue_add = "LuaUI/Sounds/buildbar_add.wav" +local sound_queue_rem = "LuaUI/Sounds/buildbar_rem.wav" ------------------------------------------------------------------------------- -- SOME THINGS NEEDED IN DRAWINMINIMAP ------------------------------------------------------------------------------- local function checkGuishader(force) - if WG['guishader'] and backgroundRect then + if WG["guishader"] and backgroundRect then if force then if dlistGuishader then dlistGuishader = gl.DeleteList(dlistGuishader) @@ -154,13 +153,13 @@ local function checkGuishader(force) end end if not dlistGuishader and backgroundRect then - dlistGuishader = gl.CreateList( function() - RectRound(backgroundRect[1],backgroundRect[2],backgroundRect[3],backgroundRect[4], elementCorner * ui_scale, 1,0,0,1) + dlistGuishader = gl.CreateList(function() + RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner * ui_scale, 1, 0, 0, 1) end) end if not dlistGuishader2 and backgroundOptionsRect then - dlistGuishader2 = gl.CreateList( function() - RectRound(backgroundOptionsRect[1],backgroundOptionsRect[2],backgroundOptionsRect[3],backgroundOptionsRect[4], elementCorner * ui_scale) + dlistGuishader2 = gl.CreateList(function() + RectRound(backgroundOptionsRect[1], backgroundOptionsRect[2], backgroundOptionsRect[3], backgroundOptionsRect[4], elementCorner * ui_scale) end) end else @@ -188,7 +187,7 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element UiUnit = WG.FlowUI.Draw.Unit - font = WG['fonts'].getFont(2) + font = WG["fonts"].getFont(2) iconSizeY = mathFloor((vsy / 19) * (1 + (ui_scale - 1) / 1.5)) iconSizeX = iconSizeY @@ -390,12 +389,12 @@ end ------------------------------------------------------------------------------- function widget:Initialize() - if WG['buildmenu'] then - if WG['buildmenu'].getGroups then - groups, unitGroup = WG['buildmenu'].getGroups() + if WG["buildmenu"] then + if WG["buildmenu"].getGroups then + groups, unitGroup = WG["buildmenu"].getGroups() end - if WG['buildmenu'].getOrder then - unitOrder = WG['buildmenu'].getOrder() + if WG["buildmenu"].getOrder then + unitOrder = WG["buildmenu"].getOrder() -- order buildoptions for uDefID, def in pairs(unitBuildOptions) do @@ -455,9 +454,9 @@ function widget:Shutdown() buildOptionsTex = nil end - if WG['guishader'] then - WG['guishader'].RemoveDlist('buildbar') - WG['guishader'].RemoveDlist('buildbar2') + if WG["guishader"] then + WG["guishader"].RemoveDlist("buildbar") + WG["guishader"].RemoveDlist("buildbar2") if dlistGuishader then dlistGuishader = gl.DeleteList(dlistGuishader) end @@ -526,39 +525,28 @@ local function drawTexRect(rect, texture, color) end local function drawIcon(udid, rect, tex, color, zoom, isfactory, amount) - glColor(1,1,1,1) - UiUnit( - rect[1], rect[2], rect[3], rect[4], - cornerSize, - 1,1,1,1, - zoom, - nil, nil, - tex, - (not isfactory and unitIcon[udid] or nil), - groups[unitGroup[udid]], - nil, - amount - ) + glColor(1, 1, 1, 1) + UiUnit(rect[1], rect[2], rect[3], rect[4], cornerSize, 1, 1, 1, 1, zoom, nil, nil, tex, (not isfactory and unitIcon[udid] or nil), groups[unitGroup[udid]], nil, amount) end local function drawOptionsBackground() - local addDist = math_floor(bgpadding*0.5) - backgroundOptionsRect = {boptRect[1]-addDist, boptRect[4]-addDist, boptRect[3] - mathFloor(bgpadding/2), boptRect[2]+addDist} - UiElement(backgroundOptionsRect[1],backgroundOptionsRect[2],backgroundOptionsRect[3],backgroundOptionsRect[4], 1,1,1,1) + local addDist = math_floor(bgpadding * 0.5) + backgroundOptionsRect = { boptRect[1] - addDist, boptRect[4] - addDist, boptRect[3] - mathFloor(bgpadding / 2), boptRect[2] + addDist } + UiElement(backgroundOptionsRect[1], backgroundOptionsRect[2], backgroundOptionsRect[3], backgroundOptionsRect[4], 1, 1, 1, 1) end local function drawBackground() - local addDist = math_floor(bgpadding*0.5) - backgroundRect = {factoriesArea[1]-addDist, factoriesArea[4]-addDist, factoriesArea[3], factoriesArea[2]+addDist} - UiElement(backgroundRect[1],backgroundRect[2],backgroundRect[3],backgroundRect[4], 1,0,0,1) + local addDist = math_floor(bgpadding * 0.5) + backgroundRect = { factoriesArea[1] - addDist, factoriesArea[4] - addDist, factoriesArea[3], factoriesArea[2] + addDist } + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], 1, 0, 0, 1) end -local function drawButton(rect, unitDefID, options, isFac) -- options = {pressed,hovered,selected,repeat,hovered_repeat,progress,amount,alpha} +local function drawButton(rect, unitDefID, options, isFac) -- options = {pressed,hovered,selected,repeat,hovered_repeat,progress,amount,alpha} cornerSize = (rect[3] - rect[1]) * 0.03 -- hover or pressed? local zoom = 0.04 - local hoverPadding = bgpadding*0.5 + local hoverPadding = bgpadding * 0.5 local iconAlpha = (options.alpha or 1) if options.pressed then iconAlpha = 1 @@ -567,30 +555,30 @@ local function drawButton(rect, unitDefID, options, isFac) -- options = {pressed iconAlpha = 1 zoom = 0.12 if WG.tooltip then - WG.tooltip.ShowTooltip('buildbar', UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) + WG.tooltip.ShowTooltip("buildbar", UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) end end -- draw icon - local imgRect = { rect[1] + (hoverPadding*1), rect[2] - hoverPadding, rect[3] - (hoverPadding*1), rect[4] + hoverPadding } - drawIcon(unitDefID, {imgRect[1], imgRect[4], imgRect[3], imgRect[2]}, '#' ..unitDefID , {1, 1, 1, iconAlpha}, zoom, (unitBuildOptions[unitDefID]~=nil), options.amount) + local imgRect = { rect[1] + (hoverPadding * 1), rect[2] - hoverPadding, rect[3] - (hoverPadding * 1), rect[4] + hoverPadding } + drawIcon(unitDefID, { imgRect[1], imgRect[4], imgRect[3], imgRect[2] }, "#" .. unitDefID, { 1, 1, 1, iconAlpha }, zoom, (unitBuildOptions[unitDefID] ~= nil), options.amount) -- Progress - if (options.progress and options.progress < 1) then + if options.progress and options.progress < 1 then glBlending(GL_SRC_ALPHA, GL_ONE) RectRoundProgress(imgRect[1], imgRect[4], imgRect[3], imgRect[2], cornerSize, options.progress, { 1, 1, 1, 0.22 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end -- loop status? - if options['repeat'] then + if options["repeat"] then local color = { 1, 1, 1, 0.8 } if options.hovered_repeat then color = { 1, 1, 1, 0.65 } end glTexture(repeatPic) glColor(1, 1, 1, 0.65) - drawTexRect({imgRect[3]-repIcoSize-4,imgRect[2]-4,imgRect[3]-4,imgRect[2]-repIcoSize-4}, repeatPic, color) + drawTexRect({ imgRect[3] - repIcoSize - 4, imgRect[2] - 4, imgRect[3] - 4, imgRect[2] - repIcoSize - 4 }, repeatPic, color) elseif isFac then local color = { 1, 1, 1, 0.35 } if options.hovered_repeat then @@ -598,16 +586,14 @@ local function drawButton(rect, unitDefID, options, isFac) -- options = {pressed end glTexture(repeatPic) glColor(1, 1, 1, 0.5) - drawTexRect({imgRect[3]-repIcoSize-4,imgRect[2]-4,imgRect[3]-4,imgRect[2]-repIcoSize-4}, repeatPic, color) + drawTexRect({ imgRect[3] - repIcoSize - 4, imgRect[2] - 4, imgRect[3] - 4, imgRect[2] - repIcoSize - 4 }, repeatPic, color) end -- amount is now handled by UiUnit internally with proper background glTexture(false) - glColor(1,1,1,1) + glColor(1, 1, 1, 1) end - - local function mouseOverIcon(x, y) if x >= facRect[1] and x <= facRect[3] and y >= facRect[4] and y <= facRect[2] then local icon @@ -654,7 +640,6 @@ end local sec = 0 function widget:Update(dt) - if spGetGameFrame() > 0 and spGetSpectatingState() then widgetHandler:RemoveWidget() end @@ -662,40 +647,40 @@ function widget:Update(dt) myTeamID = spGetMyTeamID() updateFactoryList() end - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then openedMenu = -1 return false end local mx, my, lb, mb, rb, moffscreen = GetMouseState() - if ((lb or mb or rb) and openedMenu == -1) then + if (lb or mb or rb) and openedMenu == -1 then return false end hoveredFac = mouseOverIcon(mx, my) hoveredBOpt = mouseOverSubIcon(mx, my) -- set hover unitdef id for buildmenu so info widget can show it - if WG['info'] then + if WG["info"] then if hoveredFac >= 0 then - if(not setInfoDisplayUnitID or (hoveredBOpt < 0 and setInfoDisplayUnitID ~= facs[hoveredFac + 1].unitID))then - Spring.PlaySoundFile(sound_hover, 0.8, 'ui') + if not setInfoDisplayUnitID or (hoveredBOpt < 0 and setInfoDisplayUnitID ~= facs[hoveredFac + 1].unitID) then + Spring.PlaySoundFile(sound_hover, 0.8, "ui") setInfoDisplayUnitID = facs[hoveredFac + 1].unitID - WG['info'].displayUnitID(setInfoDisplayUnitID) + WG["info"].displayUnitID(setInfoDisplayUnitID) end elseif hoveredBOpt >= 0 then - if(setInfoDisplayUnitID and setInfoDisplayUnitDefID ~= facs[openedMenu + 1].buildList[hoveredBOpt + 1])then - Spring.PlaySoundFile(sound_hover, 0.8, 'ui') + if setInfoDisplayUnitID and setInfoDisplayUnitDefID ~= facs[openedMenu + 1].buildList[hoveredBOpt + 1] then + Spring.PlaySoundFile(sound_hover, 0.8, "ui") setInfoDisplayUnitDefID = facs[openedMenu + 1].buildList[hoveredBOpt + 1] - WG['info'].displayUnitDefID(setInfoDisplayUnitDefID) + WG["info"].displayUnitDefID(setInfoDisplayUnitDefID) end else if setInfoDisplayUnitID then setInfoDisplayUnitID = nil - WG['info'].clearDisplayUnitID() + WG["info"].clearDisplayUnitID() end if setInfoDisplayUnitDefID then setInfoDisplayUnitDefID = nil - WG['info'].clearDisplayUnitDefID() + WG["info"].clearDisplayUnitDefID() end end end @@ -794,7 +779,6 @@ function widget:Update(dt) -- draw factory list local fac_rec = rectWH(math_floor(facRect[1]), math_floor(facRect[2]), iconSizeX, iconSizeY) for i, facInfo in ipairs(facs) do - local unitDefID = facInfo.unitDefID local options = {} @@ -809,7 +793,7 @@ function widget:Update(dt) -- Show the unit being built instead of factory icon unitDefID = unitBuildDefID -- Progress will be drawn separately every frame - elseif (unfinished_facs[facInfo.unitID]) then + elseif unfinished_facs[facInfo.unitID] then local isBeingBuilt, progress = GetUnitIsBeingBuilt(facInfo.unitID) -- Keep showing factory icon when it's being built -- Progress for unfinished factory will be drawn separately @@ -819,14 +803,14 @@ function widget:Update(dt) end -- repeat mode? if select(4, GetUnitStates(facInfo.unitID, false, true)) then - options['repeat'] = true + options["repeat"] = true else - options['repeat'] = false + options["repeat"] = false end -- hover or pressed? if not moffscreen and i == hoveredFac + 1 then options.hovered_repeat = isInRect(mx, my, { fac_rec[3] - repIcoSize, fac_rec[2], fac_rec[3], fac_rec[2] - repIcoSize }) - options.pressed = (lb or mb or rb) or (options.hovered_repeat) + options.pressed = (lb or mb or rb) or options.hovered_repeat options.hovered = true end -- border @@ -846,24 +830,24 @@ function widget:Update(dt) if factoriesArea then dlists[1] = gl.CreateList(drawBackground) - if WG['guishader'] then + if WG["guishader"] then if hoveredFac >= 0 then - dlists[dlistsCount+1] = gl.CreateList(drawOptionsBackground) + dlists[dlistsCount + 1] = gl.CreateList(drawOptionsBackground) if dlistGuishader2 then dlistGuishader2 = gl.DeleteList(dlistGuishader2) end - dlistGuishader2 = gl.CreateList( function() - RectRound(backgroundOptionsRect[1],backgroundOptionsRect[2],backgroundOptionsRect[3],backgroundOptionsRect[4], elementCorner * ui_scale) + dlistGuishader2 = gl.CreateList(function() + RectRound(backgroundOptionsRect[1], backgroundOptionsRect[2], backgroundOptionsRect[3], backgroundOptionsRect[4], elementCorner * ui_scale) end) if dlistGuishader2 then - WG['guishader'].RemoveDlist('buildbar2') - WG['guishader'].InsertDlist(dlistGuishader2, 'buildbar2') + WG["guishader"].RemoveDlist("buildbar2") + WG["guishader"].InsertDlist(dlistGuishader2, "buildbar2") end else backgroundOptionsRect = nil - WG['guishader'].RemoveDlist('buildbar2') + WG["guishader"].RemoveDlist("buildbar2") end end end @@ -910,7 +894,7 @@ local function renderFactoryProgressOverlays() -- Draw progress overlays on top (needs to update every frame) if factoriesArea and #facs > 0 then local fac_rec = rectWH(math_floor(facRect[1]), math_floor(facRect[2]), iconSizeX, iconSizeY) - local hoverPadding = bgpadding*0.5 + local hoverPadding = bgpadding * 0.5 local cornerSize = (fac_rec[3] - fac_rec[1]) * 0.03 for i, facInfo in ipairs(facs) do @@ -933,7 +917,7 @@ local function renderFactoryProgressOverlays() -- Draw progress overlay if building (always draw if we have progress, even if it's 1.0 briefly) if progress then - local imgRect = { fac_rec[1] + (hoverPadding*1), fac_rec[2] - hoverPadding, fac_rec[3] - (hoverPadding*1), fac_rec[4] + hoverPadding } + local imgRect = { fac_rec[1] + (hoverPadding * 1), fac_rec[2] - hoverPadding, fac_rec[3] - (hoverPadding * 1), fac_rec[4] + hoverPadding } -- Use normal alpha blending to avoid brightening the icon RectRoundProgress(imgRect[1], imgRect[4], imgRect[3], imgRect[2], cornerSize, progress, { 1, 1, 1, 0.6 }) end @@ -1041,7 +1025,7 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) if buildoptionsArea == nil then buildoptionsArea = { bopt_rec[1], bopt_rec[2], bopt_rec[3], bopt_rec[4] } else - buildoptionsArea[1] = bopt_rec[1] -- Update left edge to extend menu area + buildoptionsArea[1] = bopt_rec[1] -- Update left edge to extend menu area end offsetRect(bopt_rec, bopt_inext[1], bopt_inext[2]) end @@ -1058,13 +1042,13 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) -- draw build list if i == openedMenu + 1 then -- draw buildoptions - local bopt_rec = rectWH(fac_rec[1] + bopt_inext[1],fac_rec[2] + bopt_inext[2], iconSizeX, iconSizeY) + local bopt_rec = rectWH(fac_rec[1] + bopt_inext[1], fac_rec[2] + bopt_inext[2], iconSizeX, iconSizeY) -- Draw background for build options first if boptRect then - local addDist = math_floor(bgpadding*0.5) - backgroundOptionsRect = {boptRect[1]-addDist, boptRect[4]-addDist, boptRect[3] - mathFloor(bgpadding/2), boptRect[2]+addDist} - UiElement(backgroundOptionsRect[1],backgroundOptionsRect[2],backgroundOptionsRect[3],backgroundOptionsRect[4], 1,1,1,1) + local addDist = math_floor(bgpadding * 0.5) + backgroundOptionsRect = { boptRect[1] - addDist, boptRect[4] - addDist, boptRect[3] - mathFloor(bgpadding / 2), boptRect[2] + addDist } + UiElement(backgroundOptionsRect[1], backgroundOptionsRect[2], backgroundOptionsRect[3], backgroundOptionsRect[4], 1, 1, 1, 1) end local buildList = facInfo.buildList @@ -1144,8 +1128,8 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) for j, unitDefID in ipairs(buildList) do local queueAmount = buildQueue[unitDefID] if queueAmount and queueAmount > 0 then - local hoverPadding = bgpadding*0.5 - local imgRect = { bopt_rec[1] + (hoverPadding*1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding*1), bopt_rec[4] + hoverPadding } + local hoverPadding = bgpadding * 0.5 + local imgRect = { bopt_rec[1] + (hoverPadding * 1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding * 1), bopt_rec[4] + hoverPadding } local cellInnerSize = imgRect[3] - imgRect[1] -- Draw queue number (matching buildmenu style, scaled 1.26x - which is 1.5 * 0.84) @@ -1153,7 +1137,7 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) -- So imgRect[2] is actually the top edge in screen coords local scaleMult = 1.26 local pad = math_floor(cellInnerSize * 0.03 * scaleMult) - local textWidth = math_floor(font:GetTextWidth(queueAmount .. ' ') * cellInnerSize * 0.285 * scaleMult) + local textWidth = math_floor(font:GetTextWidth(queueAmount .. " ") * cellInnerSize * 0.285 * scaleMult) local pad2 = 0 -- Pre-calculate pixel-aligned coordinates: floor left/bottom, ceil top/right for sharp edges @@ -1172,11 +1156,7 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) -- Text font:Begin() - font:Print("\255\190\255\190" .. queueAmount, - imgRect[1] + math_floor(cellInnerSize * 0.96) - pad2, - imgRect[2] - math_floor(cellInnerSize * 0.265 * scaleMult) - pad2, - cellInnerSize * 0.29 * scaleMult, "ro" - ) + font:Print("\255\190\255\190" .. queueAmount, imgRect[1] + math_floor(cellInnerSize * 0.96) - pad2, imgRect[2] - math_floor(cellInnerSize * 0.265 * scaleMult) - pad2, cellInnerSize * 0.29 * scaleMult, "ro") font:End() glColor(1, 1, 1, 1) end @@ -1192,8 +1172,8 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) if unitDefID == unitBuildDefID and unitBuildID then local _, progress = GetUnitIsBeingBuilt(unitBuildID) if progress then - local hoverPadding = bgpadding*0.5 - local imgRect = { bopt_rec[1] + (hoverPadding*1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding*1), bopt_rec[4] + hoverPadding } + local hoverPadding = bgpadding * 0.5 + local imgRect = { bopt_rec[1] + (hoverPadding * 1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding * 1), bopt_rec[4] + hoverPadding } local cornerSize = (bopt_rec[3] - bopt_rec[1]) * 0.03 -- Draw progress overlay @@ -1220,8 +1200,8 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) offsetRect(bopt_rec, bopt_inext[1] * hoveredBOptNow, bopt_inext[2] * hoveredBOptNow) -- Draw hover highlight (just a subtle overlay) - local hoverPadding = bgpadding*0.5 - local imgRect = { bopt_rec[1] + (hoverPadding*1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding*1), bopt_rec[4] + hoverPadding } + local hoverPadding = bgpadding * 0.5 + local imgRect = { bopt_rec[1] + (hoverPadding * 1), bopt_rec[2] - hoverPadding, bopt_rec[3] - (hoverPadding * 1), bopt_rec[4] + hoverPadding } local cornerSize = (bopt_rec[3] - bopt_rec[1]) * 0.03 -- Draw subtle highlight border @@ -1232,7 +1212,7 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) -- Set tooltip local unitDefID = facInfo.buildList[hoveredBOptNow + 1] if unitDefID and WG.tooltip then - WG.tooltip.ShowTooltip('buildbar', UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) + WG.tooltip.ShowTooltip("buildbar", UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) end end end @@ -1247,24 +1227,23 @@ local function renderBuildOptions(mx, my, lb, mb, rb, moffscreen) unitDefID = GetUnitDefID(unitBuildID) end if unitDefID and WG.tooltip then - WG.tooltip.ShowTooltip('buildbar', UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) + WG.tooltip.ShowTooltip("buildbar", UnitDefs[unitDefID].translatedTooltip, nil, nil, UnitDefs[unitDefID].translatedHumanName) end end end end function widget:DrawScreen() - local mx, my, lb, mb, rb, moffscreen = GetMouseState() - if WG['guishader'] then + if WG["guishader"] then if #dlists == 0 then if dlistGuishader then - WG['guishader'].RemoveDlist('buildbar') + WG["guishader"].RemoveDlist("buildbar") end else if dlistGuishader then - WG['guishader'].InsertDlist(dlistGuishader, 'buildbar') + WG["guishader"].InsertDlist(dlistGuishader, "buildbar") end end end @@ -1301,10 +1280,10 @@ function widget:DrawScreen() -- factoriesArea is {left, top, right, bottom} where [2] > [4] -- NDC transform needs min Y as origin so bottom maps to -1 and top to +1 local areaX = factoriesArea[1] - local areaY = factoriesArea[4] -- min Y (bottom) + local areaY = factoriesArea[4] -- min Y (bottom) local areaW = factoriesArea[3] - factoriesArea[1] local areaH = factoriesArea[2] - factoriesArea[4] - gl.R2tHelper.RenderInRect(factoryTex, areaX, areaY, areaX+areaW, areaY+areaH, renderFactoryList, true) + gl.R2tHelper.RenderInRect(factoryTex, areaX, areaY, areaX + areaW, areaY + areaH, renderFactoryList, true) updateFactoryTex = false end end @@ -1319,37 +1298,34 @@ function widget:DrawScreen() end -- Build options menu (shared by both R2T and fallback paths) - if (factoriesArea ~= nil and isInRect(mx, my, { factoriesArea[1], factoriesArea[2], factoriesArea[3], factoriesArea[4] })) or - (buildoptionsArea ~= nil and isInRect(mx, my, { buildoptionsArea[1], buildoptionsArea[2], buildoptionsArea[3], buildoptionsArea[4] })) or - (openedMenu >= 0) then + if (factoriesArea ~= nil and isInRect(mx, my, { factoriesArea[1], factoriesArea[2], factoriesArea[3], factoriesArea[4] })) or (buildoptionsArea ~= nil and isInRect(mx, my, { buildoptionsArea[1], buildoptionsArea[2], buildoptionsArea[3], buildoptionsArea[4] })) or (openedMenu >= 0) then renderBuildOptions(mx, my, lb, mb, rb, moffscreen) -- Update guishader for build options background only when menu changes - if WG['guishader'] and backgroundOptionsRect and openedMenu >= 0 and lastGuishaderMenu ~= openedMenu then + if WG["guishader"] and backgroundOptionsRect and openedMenu >= 0 and lastGuishaderMenu ~= openedMenu then if dlistGuishader2 then dlistGuishader2 = gl.DeleteList(dlistGuishader2) end - dlistGuishader2 = gl.CreateList( function() - RectRound(backgroundOptionsRect[1],backgroundOptionsRect[2],backgroundOptionsRect[3],backgroundOptionsRect[4], elementCorner * ui_scale) + dlistGuishader2 = gl.CreateList(function() + RectRound(backgroundOptionsRect[1], backgroundOptionsRect[2], backgroundOptionsRect[3], backgroundOptionsRect[4], elementCorner * ui_scale) end) if dlistGuishader2 then - WG['guishader'].RemoveDlist('buildbar2') - WG['guishader'].InsertDlist(dlistGuishader2, 'buildbar2') + WG["guishader"].RemoveDlist("buildbar2") + WG["guishader"].InsertDlist(dlistGuishader2, "buildbar2") end lastGuishaderMenu = openedMenu end else buildoptionsArea = nil backgroundOptionsRect = nil - if WG['guishader'] then - WG['guishader'].RemoveDlist('buildbar2') + if WG["guishader"] then + WG["guishader"].RemoveDlist("buildbar2") end lastGuishaderMenu = -1 end end function widget:DrawWorld() - -- Draw factories command lines if openedMenu >= 0 then local fac = facs[openedMenu + 1] @@ -1428,13 +1404,13 @@ local function menuHandler(x, y, button) onoff = { 0 } end spGiveOrderToUnit(factoryUnitID, CMD.REPEAT, onoff, 0) - Spring.PlaySoundFile(sound_click, 0.8, 'ui') + Spring.PlaySoundFile(sound_click, 0.8, "ui") else Spring.SelectUnitArray({ factoryUnitID }) end elseif button == 3 then Spring.SelectUnitArray({ factoryUnitID }) - Spring.SetCameraTarget( Spring.GetUnitPosition(factoryUnitID) ) + Spring.SetCameraTarget(Spring.GetUnitPosition(factoryUnitID)) end return @@ -1457,12 +1433,12 @@ local function buildHandler(button) end if button == 1 then - spGiveOrderToUnit(facs[openedMenu + 1].unitID, -(facs[openedMenu + 1].buildList[pressedBOpt + 1]), {}, opt) - Spring.PlaySoundFile(sound_queue_add, 0.75, 'ui') + spGiveOrderToUnit(facs[openedMenu + 1].unitID, -facs[openedMenu + 1].buildList[pressedBOpt + 1], {}, opt) + Spring.PlaySoundFile(sound_queue_add, 0.75, "ui") elseif button == 3 then opt[#opt + 1] = "right" - spGiveOrderToUnit(facs[openedMenu + 1].unitID, -(facs[openedMenu + 1].buildList[pressedBOpt + 1]), {}, opt) - Spring.PlaySoundFile(sound_queue_rem, 0.75, 'ui') + spGiveOrderToUnit(facs[openedMenu + 1].unitID, -facs[openedMenu + 1].buildList[pressedBOpt + 1], {}, opt) + Spring.PlaySoundFile(sound_queue_rem, 0.75, "ui") end end diff --git a/luaui/Widgets/gui_building_grid_gl4.lua b/luaui/Widgets/gui_building_grid_gl4.lua index 4991adcd111..57d637a64eb 100644 --- a/luaui/Widgets/gui_building_grid_gl4.lua +++ b/luaui/Widgets/gui_building_grid_gl4.lua @@ -1,17 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Building Grid GL4", - desc = "Draw a configurable grid to assist build spacing", - author = "Hobo Joe, Beherith, LSR", - date = "June 2023", - license = "GNU GPL, v2 or later", + return { + name = "Building Grid GL4", + desc = "Draw a configurable grid to assist build spacing", + author = "Hobo Joe, Beherith, LSR", + date = "June 2023", + license = "GNU GPL, v2 or later", version = 0.2, - layer = -1, - enabled = false, - depends = {'gl4'}, - } + layer = -1, + enabled = false, + depends = { "gl4" }, + } end local opacity = 0.5 @@ -44,10 +44,8 @@ local shaderConfig = { -- These will be replaced in the shader using #defines's MAXVIEWDIST = config.maxViewDistance, } - local LuaShader = gl.LuaShader - local vsSrc = [[ #version 420 #extension GL_ARB_uniform_buffer_object : require @@ -111,8 +109,8 @@ void main(void) { ]] local function goodbye(reason) - Spring.Echo("Building Grid GL4 widget exiting with reason: " .. reason) - widgetHandler:RemoveWidget() + Spring.Echo("Building Grid GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end local mousePosUniform @@ -131,8 +129,8 @@ function initShader() }, uniformFloat = { waterLevel = waterLevel, - mousePos = {0.0, 0.0, 0.0}, - } + mousePos = { 0.0, 0.0, 0.0 }, + }, }, "gridShader") local shaderCompiled = gridShader:Initialize() if not shaderCompiled then @@ -155,68 +153,70 @@ local function getForceShowUnitDefID() end function widget:Initialize() - WG['buildinggrid'] = {} - WG['buildinggrid'].getOpacity = function() - return opacity - end - WG['buildinggrid'].setOpacity = function(value) - opacity = value - -- widget needs reloading wholly - end - WG['buildinggrid'].setForceShow = function(reason, enabled, unitDefID) - if enabled then - forceShow[reason] = unitDefID - else - forceShow[reason] = nil - end - end - - initShader() - - if not gridShader then return end - if gridVBO then return end - - local VBOData = {} -- the lua array that will be uploaded to the GPU - for row = 0, Game.mapSizeX, spacing do - for col = 0, Game.mapSizeZ, spacing do - if row ~= Game.mapSizeX then -- skip last - - local strength = ((col/spacing) % config.strongLineSpacing == 0 and config.strongLineOpacity or config.weakLineOpacity) * opacity - -- vertical lines - VBOData[#VBOData + 1] = row - VBOData[#VBOData + 1] = col + WG["buildinggrid"] = {} + WG["buildinggrid"].getOpacity = function() + return opacity + end + WG["buildinggrid"].setOpacity = function(value) + opacity = value + -- widget needs reloading wholly + end + WG["buildinggrid"].setForceShow = function(reason, enabled, unitDefID) + if enabled then + forceShow[reason] = unitDefID + else + forceShow[reason] = nil + end + end + + initShader() + + if not gridShader then + return + end + if gridVBO then + return + end + + local VBOData = {} -- the lua array that will be uploaded to the GPU + for row = 0, Game.mapSizeX, spacing do + for col = 0, Game.mapSizeZ, spacing do + if row ~= Game.mapSizeX then -- skip last + local strength = ((col / spacing) % config.strongLineSpacing == 0 and config.strongLineOpacity or config.weakLineOpacity) * opacity + -- vertical lines + VBOData[#VBOData + 1] = row + VBOData[#VBOData + 1] = col VBOData[#VBOData + 1] = strength - VBOData[#VBOData + 1] = row + spacing - VBOData[#VBOData + 1] = col + VBOData[#VBOData + 1] = row + spacing + VBOData[#VBOData + 1] = col VBOData[#VBOData + 1] = strength - end + end - if col ~= Game.mapSizeZ then -- skip last - local strength = ((row/spacing) % config.strongLineSpacing == 0 and config.strongLineOpacity or config.weakLineOpacity) * opacity - -- horizonal lines - VBOData[#VBOData + 1] = row - VBOData[#VBOData + 1] = col + if col ~= Game.mapSizeZ then -- skip last + local strength = ((row / spacing) % config.strongLineSpacing == 0 and config.strongLineOpacity or config.weakLineOpacity) * opacity + -- horizonal lines + VBOData[#VBOData + 1] = row + VBOData[#VBOData + 1] = col VBOData[#VBOData + 1] = strength - VBOData[#VBOData + 1] = row - VBOData[#VBOData + 1] = col + spacing + VBOData[#VBOData + 1] = row + VBOData[#VBOData + 1] = col + spacing VBOData[#VBOData + 1] = strength - end - end - end + end + end + end - gridVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + gridVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) -- this is 2d position + opacity - gridVBO:Define(#VBOData / 3, {{ - id = 0, - name = "position", - size = 3 - }}) -- number of elements (vertices), size is 2 for the vec2 position - gridVBO:Upload(VBOData) - gridVAO = gl.GetVAO() - gridVAO:AttachVertexBuffer(gridVBO) + gridVBO:Define(#VBOData / 3, { { + id = 0, + name = "position", + size = 3, + } }) -- number of elements (vertices), size is 2 for the vec2 position + gridVBO:Upload(VBOData) + gridVAO = gl.GetVAO() + gridVAO:AttachVertexBuffer(gridVBO) end - function widget:Update() local _, cmdID = Spring.GetActiveCommand() @@ -239,17 +239,17 @@ function widget:DrawWorldPreUnit() end gl.LineWidth(1.75) - gl.Culling(GL.BACK) -- not needed really, only for triangles - gl.DepthTest(GL.ALWAYS) -- so that it wont be drawn behind terrain - gl.DepthMask(false) -- so that we dont write the depth of the drawn pixels - gl.Texture(0, "$heightmap") -- bind engine heightmap texture to sampler 0 - gridShader:Activate() + gl.Culling(GL.BACK) -- not needed really, only for triangles + gl.DepthTest(GL.ALWAYS) -- so that it wont be drawn behind terrain + gl.DepthMask(false) -- so that we dont write the depth of the drawn pixels + gl.Texture(0, "$heightmap") -- bind engine heightmap texture to sampler 0 + gridShader:Activate() gl.UniformInt(waterSurfaceModeUniform, waterSurfaceMode and 1 or 0) gl.Uniform(mousePosUniform, unpack(mousePos, 1, 3)) - gridVAO:DrawArrays(GL.LINES) -- draw the lines - gridShader:Deactivate() - gl.Texture(0, false) - gl.DepthTest(false) + gridVAO:DrawArrays(GL.LINES) -- draw the lines + gridShader:Deactivate() + gl.Texture(0, false) + gl.DepthTest(false) end function widget:GameStart() @@ -257,11 +257,11 @@ function widget:GameStart() end function widget:GetConfigData(data) - return { - opacity = opacity, - } + return { + opacity = opacity, + } end function widget:SetConfigData(data) - opacity = data.opacity or opacity + opacity = data.opacity or opacity end diff --git a/luaui/Widgets/gui_buildmenu.lua b/luaui/Widgets/gui_buildmenu.lua index 8b8c652a31e..3a47dcd0be3 100644 --- a/luaui/Widgets/gui_buildmenu.lua +++ b/luaui/Widgets/gui_buildmenu.lua @@ -13,7 +13,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -26,7 +25,7 @@ local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState include("keysym.h.lua") -local unitBlocking = VFS.Include('luaui/Include/unitBlocking.lua') +local unitBlocking = VFS.Include("luaui/Include/unitBlocking.lua") local pairs = pairs local ipairs = ipairs @@ -69,11 +68,11 @@ local smartOrderUnits = true local maxPosY = 0.74 -local disableInputWhenSpec = false -- disable specs selecting buildoptions +local disableInputWhenSpec = false -- disable specs selecting buildoptions -local showPrice = true -- false will still show hover -local showRadarIcon = true -- false will still show hover -local showGroupIcon = true -- false will still show hover +local showPrice = true -- false will still show hover +local showRadarIcon = true -- false will still show hover +local showGroupIcon = true -- false will still show hover local showBuildProgress = true local progressColor = { 0.08, 0.08, 0.08, 0.6 } local drawnBuildTargets = {} @@ -107,19 +106,19 @@ local delayRefresh local costOverrides = {} --[[ MODIFICATION START ]] -- New state variables for the robust update system -local selectionUpdateTime = 0 -- Time-based debouncer for selection changes +local selectionUpdateTime = 0 -- Time-based debouncer for selection changes local raceConditionUpdateCountdown = 0 -- Timer for race conditions local blockedUnitsUpdateCounter = 0 -- Counter for periodic blocked units update -local forceRefreshNextFrame = false -- The failsafe retry flag -local refreshRetryCounter = 0 -- Failsafe counter to prevent infinite retries +local forceRefreshNextFrame = false -- The failsafe retry flag +local refreshRetryCounter = 0 -- Failsafe counter to prevent infinite retries --[[ MODIFICATION END ]] ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- local playSounds = true -local sound_queue_add = 'LuaUI/Sounds/buildbar_add.wav' -local sound_queue_rem = 'LuaUI/Sounds/buildbar_rem.wav' +local sound_queue_add = "LuaUI/Sounds/buildbar_add.wav" +local sound_queue_rem = "LuaUI/Sounds/buildbar_rem.wav" local vsx, vsy = spGetViewGeometry() @@ -134,7 +133,7 @@ local units = VFS.Include("luaui/configs/unit_buildmenu_config.lua") local isSpec = spGetSpectatingState() local myTeamID = spGetMyTeamID() -local startDefID = Spring.GetTeamRulesParam(myTeamID, 'startUnit') +local startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") local disableInput = disableInputWhenSpec and isSpec local backgroundRect = { 0, 0, 0, 0 } @@ -166,14 +165,14 @@ local cellQuotas = {} local cmdUnitdefsTemp = {} local selBuilderDefsTemp1 = {} local selBuilderDefsTemp2 = {} -local currentSelBuilderDefs = selBuilderDefsTemp1 -- Track which temp table is current +local currentSelBuilderDefs = selBuilderDefsTemp1 -- Track which temp table is current local buildCycleTemp = {} local emptyParams = {} -- Cache for expensive Spring API calls local cachedActiveCmdDescs = nil local cachedActiveCmdDescsTime = 0 -local activeCmdDescsCacheDelay = 0.05 -- Cache for 50ms +local activeCmdDescsCacheDelay = 0.05 -- Cache for 50ms ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -249,34 +248,34 @@ end local RectRound, RectRoundProgress, UiUnit, UiElement, UiButton, elementCorner -local folder = 'LuaUI/Images/groupicons/' +local folder = "LuaUI/Images/groupicons/" local groups = { - energy = folder..'energy.png', - metal = folder..'metal.png', - builder = folder..'builder.png', - buildert2 = folder..'buildert2.png', - buildert3 = folder..'buildert3.png', - buildert4 = folder..'buildert4.png', - util = folder..'util.png', - weapon = folder..'weapon.png', - explo = folder..'weaponexplo.png', - weaponaa = folder..'weaponaa.png', - weaponsub = folder..'weaponsub.png', - aa = folder..'aa.png', - emp = folder..'emp.png', - sub = folder..'sub.png', - nuke = folder..'nuke.png', - antinuke = folder..'antinuke.png', + energy = folder .. "energy.png", + metal = folder .. "metal.png", + builder = folder .. "builder.png", + buildert2 = folder .. "buildert2.png", + buildert3 = folder .. "buildert3.png", + buildert4 = folder .. "buildert4.png", + util = folder .. "util.png", + weapon = folder .. "weapon.png", + explo = folder .. "weaponexplo.png", + weaponaa = folder .. "weaponaa.png", + weaponsub = folder .. "weaponsub.png", + aa = folder .. "aa.png", + emp = folder .. "emp.png", + sub = folder .. "sub.png", + nuke = folder .. "nuke.png", + antinuke = folder .. "antinuke.png", } local modKeyMultiplier = { ctrl = 20, shift = 5, - right = -1 + right = -1, } local function checkGuishader(force) - if WG['guishader'] then + if WG["guishader"] then if force and dlistGuishader then dlistGuishader = gl.DeleteList(dlistGuishader) end @@ -285,7 +284,7 @@ local function checkGuishader(force) RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner) end) if selectedBuilderCount > 0 then - WG['guishader'].InsertDlist(dlistGuishader, 'buildmenu') + WG["guishader"].InsertDlist(dlistGuishader, "buildmenu") end end elseif dlistGuishader then @@ -303,11 +302,11 @@ local function UpdateGridGeometry() backgroundRect[1] + (stickToBottom and bgpadding or 0) + activeAreaMargin, backgroundRect[2] + (stickToBottom and 0 or bgpadding) + activeAreaMargin, backgroundRect[3] - bgpadding - activeAreaMargin, - backgroundRect[4] - bgpadding - activeAreaMargin + backgroundRect[4] - bgpadding - activeAreaMargin, } local contentHeight = activeArea[4] - activeArea[2] local contentWidth = activeArea[3] - activeArea[1] - local maxCellSize = contentHeight/2 + local maxCellSize = contentHeight / 2 -- determine grid size if not dynamicIconsize then colls = defaultColls @@ -329,7 +328,7 @@ local function UpdateGridGeometry() end end if stickToBottom then - if rows > 1 and cmdsCount <= (colls-1) * rows then + if rows > 1 and cmdsCount <= (colls - 1) * rows then colls = colls - 1 cellSize = math_min(maxCellSize, math_floor((contentHeight / rows))) end @@ -380,7 +379,6 @@ local function RefreshCommands() if preGamestartPlayer then if startDefID then - -- Clear and reuse temp table instead of creating new one clearTable(cmdUnitdefsTemp) for i, udefid in ipairs(unitBuildOptions[startDefID]) do @@ -393,20 +391,19 @@ local function RefreshCommands() cmds[cmdsCount] = { id = -uDefID, name = unitName[uDefID], - params = emptyParams + params = emptyParams, } end end end else - local activeCmdDescs = getCachedActiveCmdDescs() if smartOrderUnits then -- Clear and reuse temp table instead of creating new one clearTable(cmdUnitdefsTemp) for index, cmd in ipairs(activeCmdDescs) do if type(cmd) == "table" then - if not cmd.disabled and string_sub(cmd.action, 1, 10) == 'buildunit_' then + if not cmd.disabled and string_sub(cmd.action, 1, 10) == "buildunit_" then cmdUnitdefsTemp[-cmd.id] = index end end @@ -421,7 +418,7 @@ local function RefreshCommands() for index, cmd in ipairs(activeCmdDescs) do if type(cmd) == "table" then local uDefID = -cmd.id - if not cmd.disabled and string_sub(cmd.action, 1, 10) == 'buildunit_' and not units.unitHidden[uDefID] then + if not cmd.disabled and string_sub(cmd.action, 1, 10) == "buildunit_" and not units.unitHidden[uDefID] then cmdsCount = cmdsCount + 1 cmds[cmdsCount] = cmd end @@ -491,11 +488,11 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - local outlineMult = math.clamp(1/(vsy/1400), 1, 1.5) - font2 = WG['fonts'].getFont(2) + local outlineMult = math.clamp(1 / (vsy / 1400), 1, 1.5) + font2 = WG["fonts"].getFont(2) - if WG['minimap'] then - minimapHeight = WG['minimap'].getHeight() + if WG["minimap"] then + minimapHeight = WG["minimap"].getHeight() end local widgetSpaceMargin = WG.FlowUI.elementMargin @@ -517,26 +514,26 @@ function widget:ViewResize() posX2 = advplayerlistLeft - widgetSpaceMargin width = (posX2 - posX) / vsx height = posY - minColls = math_max(8, math_floor((width/vsx)*25)) + minColls = math_max(8, math_floor((width / vsx) * 25)) maxColls = 30 else - posY = math.clamp(((vsy - minimapHeight) / vsy) - (widgetSpaceMargin/vsy), 0.4615, maxPosY) + posY = math.clamp(((vsy - minimapHeight) / vsy) - (widgetSpaceMargin / vsy), 0.4615, maxPosY) posY2 = math_floor(0.14 * ui_scale * vsy) / vsy - posY2 = posY2 + (widgetSpaceMargin/vsy) + posY2 = posY2 + (widgetSpaceMargin / vsy) posX = 0 minColls = 4 maxColls = 5 - if WG['minimap'] then - posY = 1 - (WG['minimap'].getHeight() / vsy) - (widgetSpaceMargin/vsy) + if WG["minimap"] then + posY = 1 - (WG["minimap"].getHeight() / vsy) - (widgetSpaceMargin / vsy) if posY > maxPosY then posY = maxPosY end - if WG['ordermenu'] then - local oposX, oposY, owidth, oheight = WG['ordermenu'].getPosition() + if WG["ordermenu"] then + local oposX, oposY, owidth, oheight = WG["ordermenu"].getPosition() if oposY > 0.5 then - posY = oposY - oheight - ((widgetSpaceMargin)/vsy) + posY = oposY - oheight - (widgetSpaceMargin / vsy) end end end @@ -547,7 +544,7 @@ function widget:ViewResize() height = (posY - posY2) width = 0.212 - width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens + width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens width = width * ui_scale posX2 = math_floor(width * vsx) @@ -668,11 +665,11 @@ function widget:Update(dt) buildmenuShows = true end - if WG['guishader'] and prevBuildmenuShows ~= buildmenuShows and dlistGuishader then + if WG["guishader"] and prevBuildmenuShows ~= buildmenuShows and dlistGuishader then if buildmenuShows then - WG['guishader'].InsertDlist(dlistGuishader, 'buildmenu') + WG["guishader"].InsertDlist(dlistGuishader, "buildmenu") else - WG['guishader'].RemoveDlist('buildmenu') + WG["guishader"].RemoveDlist("buildmenu") end end @@ -680,25 +677,24 @@ function widget:Update(dt) if sec > 0.33 then sec = 0 checkGuishader() - if WG['minimap'] and minimapHeight ~= WG['minimap'].getHeight() then + if WG["minimap"] and minimapHeight ~= WG["minimap"].getHeight() then widget:ViewResize() end - if stickToBottom then - if WG['advplayerlist_api'] ~= nil then - local advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + if WG["advplayerlist_api"] ~= nil then + local advplayerlistPos = WG["advplayerlist_api"].GetPosition() -- returns {top,left,bottom,right,widgetScale} advplayerlistLeft = advplayerlistPos[2] end end local prevOrdermenuLeft = ordermenuLeft local prevOrdermenuHeight = ordermenuHeight - if WG['ordermenu'] then - local oposX, oposY, owidth, oheight = WG['ordermenu'].getPosition() + if WG["ordermenu"] then + local oposX, oposY, owidth, oheight = WG["ordermenu"].getPosition() ordermenuLeft = math_floor((oposX + owidth) * vsx) ordermenuHeight = oheight end - if not prevAdvplayerlistLeft or advplayerlistLeft ~= prevAdvplayerlistLeft or not prevOrdermenuLeft or ordermenuLeft ~= prevOrdermenuLeft or not prevOrdermenuHeight or ordermenuHeight ~= prevOrdermenuHeight then + if not prevAdvplayerlistLeft or advplayerlistLeft ~= prevAdvplayerlistLeft or not prevOrdermenuLeft or ordermenuLeft ~= prevOrdermenuLeft or not prevOrdermenuHeight or ordermenuHeight ~= prevOrdermenuHeight then prevAdvplayerlistLeft = advplayerlistLeft widget:ViewResize() end @@ -708,61 +704,34 @@ function widget:Update(dt) end function drawBuildmenuBg() - UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], (posX > 0 and 1 or 0), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), 0, nil, nil, nil, nil, nil, nil, nil, nil) + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], (posX > 0 and 1 or 0), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), 0, nil, nil, nil, nil, nil, nil, nil, nil) end local function drawCell(cellRectID, usedZoom, cellColor, disabled, underConstruction) local uDefID = -cmds[cellRectID].id -- unit icon - local texprefix = '' + local texprefix = "" if disabled then glColor(0.4, 0.4, 0.4, 1) - texprefix = 't0.3,0.3,0.3' + texprefix = "t0.3,0.3,0.3" elseif underConstruction then glColor(0.77, 0.77, 0.77, 1) - texprefix = 't0.63,0.63,0.63' + texprefix = "t0.63,0.63,0.63" else glColor(1, 1, 1, 1) end - UiUnit( - cellRects[cellRectID][1] + cellPadding + iconPadding, - cellRects[cellRectID][2] + cellPadding + iconPadding, - cellRects[cellRectID][3] - cellPadding - iconPadding, - cellRects[cellRectID][4] - cellPadding - iconPadding, - cornerSize, 1,1,1,1, - usedZoom, - nil, disabled and 0 or nil, - '#' .. uDefID, - showRadarIcon and (((units.unitIconType[uDefID] and iconTypes[units.unitIconType[uDefID]]) and ':l' .. texprefix ..':' .. iconTypes[units.unitIconType[uDefID]] or nil)) or nil, - showGroupIcon and (groups[units.unitGroup[uDefID]] and ':l' .. texprefix ..':' ..groups[units.unitGroup[uDefID]] or nil) or nil, - {units.unitMetalCost[uDefID], units.unitEnergyCost[uDefID]}, - tonumber(cmds[cellRectID].params[1]) - ) + UiUnit(cellRects[cellRectID][1] + cellPadding + iconPadding, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][4] - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom, nil, disabled and 0 or nil, "#" .. uDefID, showRadarIcon and ((units.unitIconType[uDefID] and iconTypes[units.unitIconType[uDefID]]) and ":l" .. texprefix .. ":" .. iconTypes[units.unitIconType[uDefID]] or nil) or nil, showGroupIcon and (groups[units.unitGroup[uDefID]] and ":l" .. texprefix .. ":" .. groups[units.unitGroup[uDefID]] or nil) or nil, { units.unitMetalCost[uDefID], units.unitEnergyCost[uDefID] }, tonumber(cmds[cellRectID].params[1])) -- colorize/highlight unit icon if cellColor then glBlending(GL_DST_ALPHA, GL_ONE_MINUS_SRC_COLOR) glColor(cellColor[1], cellColor[2], cellColor[3], cellColor[4]) - glTexture('#' .. uDefID) - UiUnit( - cellRects[cellRectID][1] + cellPadding + iconPadding, - cellRects[cellRectID][2] + cellPadding + iconPadding, - cellRects[cellRectID][3] - cellPadding - iconPadding, - cellRects[cellRectID][4] - cellPadding - iconPadding, - cornerSize, 1,1,1,1, - usedZoom - ) + glTexture("#" .. uDefID) + UiUnit(cellRects[cellRectID][1] + cellPadding + iconPadding, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][4] - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom) if cellColor[4] > 0 then glBlending(GL_SRC_ALPHA, GL_ONE) - UiUnit( - cellRects[cellRectID][1] + cellPadding + iconPadding, - cellRects[cellRectID][2] + cellPadding + iconPadding, - cellRects[cellRectID][3] - cellPadding - iconPadding, - cellRects[cellRectID][4] - cellPadding - iconPadding, - cornerSize, 1,1,1,1, - usedZoom - ) + UiUnit(cellRects[cellRectID][1] + cellPadding + iconPadding, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][4] - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom) end glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end @@ -825,16 +794,12 @@ local function drawCell(cellRectID, usedZoom, cellColor, disabled, underConstruc -- factory queue number if cmds[cellRectID].params[1] then local pad = math_floor(cellInnerSize * 0.03) - local textWidth = math_floor(font2:GetTextWidth(cmds[cellRectID].params[1] .. ' ') * cellInnerSize * 0.285) + local textWidth = math_floor(font2:GetTextWidth(cmds[cellRectID].params[1] .. " ") * cellInnerSize * 0.285) local pad2 = 0 RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2, cellRects[cellRectID][4] - cellPadding - iconPadding - math_floor(cellInnerSize * 0.365) - pad2, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][4] - cellPadding - iconPadding, cornerSize * 3.3, 0, 0, 0, 1, { 0.15, 0.15, 0.15, 0.95 }, { 0.25, 0.25, 0.25, 0.95 }) RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2, cellRects[cellRectID][4] - cellPadding - iconPadding - math_floor(cellInnerSize * 0.15) - pad2, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][4] - cellPadding - iconPadding, 0, 0, 0, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.05 }) RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2 + pad, cellRects[cellRectID][4] - cellPadding - iconPadding - math_floor(cellInnerSize * 0.365) - pad2 + pad, cellRects[cellRectID][3] - cellPadding - iconPadding - pad2, cellRects[cellRectID][4] - cellPadding - iconPadding - pad2, cornerSize * 2.6, 0, 0, 0, 1, { 0.7, 0.7, 0.7, 0.1 }, { 1, 1, 1, 0.1 }) - font2:Print("\255\190\255\190" .. cmds[cellRectID].params[1], - cellRects[cellRectID][1] + cellPadding + math_floor(cellInnerSize * 0.96) - pad2, - cellRects[cellRectID][2] + cellPadding + math_floor(cellInnerSize * 0.735) - pad2, - cellInnerSize * 0.29, "ro" - ) + font2:Print("\255\190\255\190" .. cmds[cellRectID].params[1], cellRects[cellRectID][1] + cellPadding + math_floor(cellInnerSize * 0.96) - pad2, cellRects[cellRectID][2] + cellPadding + math_floor(cellInnerSize * 0.735) - pad2, cellInnerSize * 0.29, "ro") end local quotaInfo = cellQuotas[uDefID] @@ -852,18 +817,14 @@ local function drawCell(cellRectID, usedZoom, cellColor, disabled, underConstruc RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][2] + cellPadding + iconPadding + math_floor(cellInnerSize * 0.365) + pad2, cornerSize * 3.3, 1, 0, 0, 0, { 0.15, 0.15, 0.15, 0.95 }, { 0.25, 0.25, 0.25, 0.95 }) RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding, cellRects[cellRectID][2] + cellPadding + iconPadding + math_floor(cellInnerSize * 0.15) + pad2, 0, 0, 0, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.05 }) RectRound(cellRects[cellRectID][3] - cellPadding - iconPadding - textWidth - pad2 + pad, cellRects[cellRectID][2] + cellPadding + iconPadding, cellRects[cellRectID][3] - cellPadding - iconPadding - pad2, cellRects[cellRectID][2] + cellPadding + iconPadding + math_floor(cellInnerSize * 0.365) + pad2 - pad, cornerSize * 2.6, 1, 0, 0, 0, { 0.7, 0.7, 0.7, 0.1 }, { 1, 1, 1, 0.1 }) - font2:Print( - "\255\255\130\190" .. quotaText, - cellRects[cellRectID][1] + cellPadding + math_floor(cellInnerSize * 0.96) - pad2, - cellRects[cellRectID][2] + cellPadding + (math_floor(cellInnerSize * 0.365) - font2:GetTextHeight(quotaInfo.quota)*quotaFontSize)/2, - quotaFontSize, - "ro" - ) + font2:Print("\255\255\130\190" .. quotaText, cellRects[cellRectID][1] + cellPadding + math_floor(cellInnerSize * 0.96) - pad2, cellRects[cellRectID][2] + cellPadding + (math_floor(cellInnerSize * 0.365) - font2:GetTextHeight(quotaInfo.quota) * quotaFontSize) / 2, quotaFontSize, "ro") end end local function drawHighlights() - if highlightCount == 0 or not next(highlights) then return end + if highlightCount == 0 or not next(highlights) then + return + end local now = os_clock() for uDefID, hl in pairs(highlights) do local cellRectID = unitDefToCellMap[uDefID] @@ -884,7 +845,7 @@ local function drawHighlights() local brighten = 0.10 + 0.22 * pulse glBlending(GL_SRC_ALPHA, GL_ONE) glColor(r * brighten, g * brighten, b * brighten, 1) - glTexture('#' .. uDefID) + glTexture("#" .. uDefID) UiUnit(x1, y1, x2, y2, cornerSize, 1, 1, 1, 1, defaultCellZoom) glTexture(false) @@ -899,11 +860,7 @@ local function drawHighlights() -- Soft inner glow fading inward from the outline local glowAlpha = 0.10 + 0.20 * pulse local glowWidth = thickness * 3 - WG.FlowUI.Draw.RectRoundOutline( - x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, - math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, - { r, g, b, glowAlpha }, { r, g, b, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, { r, g, b, glowAlpha }, { r, g, b, 0 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end @@ -915,7 +872,7 @@ function drawBuildmenu() backgroundRect[1] + (stickToBottom and bgpadding or 0) + activeAreaMargin, backgroundRect[2] + (stickToBottom and 0 or bgpadding) + activeAreaMargin, backgroundRect[3] - bgpadding - activeAreaMargin, - backgroundRect[4] - bgpadding - activeAreaMargin + backgroundRect[4] - bgpadding - activeAreaMargin, } local contentHeight = activeArea[4] - activeArea[2] local contentWidth = activeArea[3] - activeArea[1] @@ -963,16 +920,16 @@ function drawBuildmenu() if stickToBottom then cellRects[cellRectID] = { activeArea[1] + ((coll - 1) * cellSize), - activeArea[4] - ((row) * cellSize), - activeArea[1] + (((coll)) * cellSize), - activeArea[4] - ((row - 1) * cellSize) + activeArea[4] - (row * cellSize), + activeArea[1] + (coll * cellSize), + activeArea[4] - ((row - 1) * cellSize), } else cellRects[cellRectID] = { activeArea[3] - ((colls - coll + 1) * cellSize), - activeArea[4] - ((row) * cellSize), - activeArea[3] - (((colls - coll)) * cellSize), - activeArea[4] - ((row - 1) * cellSize) + activeArea[4] - (row * cellSize), + activeArea[3] - ((colls - coll) * cellSize), + activeArea[4] - ((row - 1) * cellSize), } end local cellIsSelected = (activeCmd and cmds[cellRectID] and activeCmd == cmds[cellRectID].name) @@ -993,9 +950,9 @@ function drawBuildmenu() paginatorRects[1] = { activeArea[1], activeArea[2], activeArea[1] + paginatorCellWidth, activeArea[2] + paginatorCellHeight - cellPadding - activeAreaMargin } paginatorRects[2] = { activeArea[3] - paginatorCellWidth, activeArea[2], activeArea[3], activeArea[2] + paginatorCellHeight - cellPadding - activeAreaMargin } - UiButton(paginatorRects[1][1] + cellPadding, paginatorRects[1][2] + cellPadding, paginatorRects[1][3] - cellPadding, paginatorRects[1][4] - cellPadding, 1,1,1,1, 1,1,1,1, nil, { 0, 0, 0, 0.8 }, { 0.2, 0.2, 0.2, 0.8 }, bgpadding * 0.5) + UiButton(paginatorRects[1][1] + cellPadding, paginatorRects[1][2] + cellPadding, paginatorRects[1][3] - cellPadding, paginatorRects[1][4] - cellPadding, 1, 1, 1, 1, 1, 1, 1, 1, nil, { 0, 0, 0, 0.8 }, { 0.2, 0.2, 0.2, 0.8 }, bgpadding * 0.5) font2:Print("<", paginatorRects[1][1] + (paginatorCellWidth * 0.5), paginatorRects[1][2] + (paginatorCellHeight * 0.5) - (paginatorFontSize * 0.25), paginatorFontSize * 1.2, "co") - UiButton(paginatorRects[2][1] + cellPadding, paginatorRects[2][2] + cellPadding, paginatorRects[2][3] - cellPadding, paginatorRects[2][4] - cellPadding, 1,1,1,1, 1,1,1,1, nil, { 0, 0, 0, 0.8 }, { 0.2, 0.2, 0.2, 0.8 }, bgpadding * 0.5) + UiButton(paginatorRects[2][1] + cellPadding, paginatorRects[2][2] + cellPadding, paginatorRects[2][3] - cellPadding, paginatorRects[2][4] - cellPadding, 1, 1, 1, 1, 1, 1, 1, 1, nil, { 0, 0, 0, 0.8 }, { 0.2, 0.2, 0.2, 0.8 }, bgpadding * 0.5) font2:Print(">", paginatorRects[2][1] + (paginatorCellWidth * 0.5), paginatorRects[2][2] + (paginatorCellHeight * 0.5) - (paginatorFontSize * 0.25), paginatorFontSize * 1.2, "co") font2:Print("\255\245\245\245" .. currentPage .. " / " .. pages, contentWidth * 0.5, activeArea[2] + (paginatorCellHeight * 0.5) - (paginatorFontSize * 0.25), paginatorFontSize, "co") @@ -1004,12 +961,11 @@ function drawBuildmenu() font2:End() end - function widget:DrawScreen() glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - if WG['buildmenu'] then - WG['buildmenu'].hoverID = nil + if WG["buildmenu"] then + WG["buildmenu"].hoverID = nil end if not buildmenuShows then @@ -1019,7 +975,7 @@ function widget:DrawScreen() -- refresh buildmenu if active cmd changed local prevActiveCmd = activeCmd - if spGetGameFrame() == 0 and WG['pregame-build'] then + if spGetGameFrame() == 0 and WG["pregame-build"] then activeCmd = WG["pregame-build"] and WG["pregame-build"].getPreGameDefID() if activeCmd then activeCmd = unitName[activeCmd] @@ -1051,12 +1007,12 @@ function widget:DrawScreen() if refreshBuildmenu then refreshBuildmenu = false if not buildmenuTex and width > 0.05 and height > 0.05 then - buildmenuTex = gl.CreateTexture(math_floor(width*vsx)*2, math_floor(height*vsy)*2, { --*(vsy<1400 and 2 or 1) + buildmenuTex = gl.CreateTexture(math_floor(width * vsx) * 2, math_floor(height * vsy) * 2, { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) - buildmenuBgTex = gl.CreateTexture(math_floor(width*vsx), math_floor(height*vsy), { + buildmenuBgTex = gl.CreateTexture(math_floor(width * vsx), math_floor(height * vsy), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -1075,28 +1031,28 @@ function widget:DrawScreen() local hovering = false if math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") hovering = true end if preGamestartPlayer or selectedBuilderCount ~= 0 then -- pre process + 'highlight' under the icons local hoveredCellID - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if hovering then for cellRectID, cellRect in pairs(cellRects) do if math_isInRect(x, y, cellRect[1], cellRect[2], cellRect[3], cellRect[4]) then hoveredCellID = cellRectID local uDefID = -cmds[cellRectID].id - WG['buildmenu'].hoverID = uDefID + WG["buildmenu"].hoverID = uDefID gl.Color(1, 1, 1, 1) local alt, ctrl, meta, shift = Spring.GetModKeyState() - if WG['tooltip'] and not meta then + if WG["tooltip"] and not meta then -- when meta: unitstats does the tooltip local text local textColor = "\255\215\255\215" if units.unitRestricted[uDefID] then - text = Spring.I18N('ui.buildMenu.disabled', { unit = unitTranslatedHumanName[uDefID], textColor = textColor, warnColor = "\255\166\166\166" }) + text = Spring.I18N("ui.buildMenu.disabled", { unit = unitTranslatedHumanName[uDefID], textColor = textColor, warnColor = "\255\166\166\166" }) else text = UnitDefs[uDefID].translatedHumanName end @@ -1104,7 +1060,7 @@ function widget:DrawScreen() if unitMetal_extractor[uDefID] then tooltip = tooltip .. "\n" .. Spring.I18N("ui.buildMenu.areamex_tooltip") end - WG['tooltip'].ShowTooltip('buildmenu', "\255\240\240\240"..tooltip, nil, nil, text) + WG["tooltip"].ShowTooltip("buildmenu", "\255\240\240\240" .. tooltip, nil, nil, text) end -- highlight --if b and not disableInput then @@ -1120,7 +1076,7 @@ function widget:DrawScreen() -- draw buildmenu content if buildmenuTex then -- content - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) gl.Texture(buildmenuTex) gl.TexRect(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], false, true) gl.Texture(false) @@ -1131,9 +1087,8 @@ function widget:DrawScreen() -- draw highlight local usedZoom local cellColor - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - -- paginator buttons local paginatorHovered = false if paginatorRects[1] and math_isInRect(x, y, paginatorRects[1][1], paginatorRects[1][2], paginatorRects[1][3], paginatorRects[1][4]) then @@ -1143,9 +1098,9 @@ function widget:DrawScreen() paginatorHovered = 2 end if paginatorHovered then - if WG['tooltip'] then - local text = "\255\240\240\240" .. (paginatorHovered == 1 and Spring.I18N('ui.buildMenu.previousPage') or Spring.I18N('ui.buildMenu.nextPage')) - WG['tooltip'].ShowTooltip('buildmenu', text) + if WG["tooltip"] then + local text = "\255\240\240\240" .. (paginatorHovered == 1 and Spring.I18N("ui.buildMenu.previousPage") or Spring.I18N("ui.buildMenu.nextPage")) + WG["tooltip"].ShowTooltip("buildmenu", text) end RectRound(paginatorRects[paginatorHovered][1] + cellPadding, paginatorRects[paginatorHovered][2] + cellPadding, paginatorRects[paginatorHovered][3] - cellPadding, paginatorRects[paginatorHovered][4] - cellPadding, cellSize * 0.03, 2, 2, 2, 2, { 1, 1, 1, 0 }, { 1, 1, 1, (b and 0.35 or 0.15) }) -- gloss @@ -1168,7 +1123,6 @@ function widget:DrawScreen() hoverDlist = gl.DeleteList(hoverDlist) end hoverDlist = gl.CreateList(function() - -- determine zoom amount and cell color usedZoom = hoverCellZoom if not cellIsSelected then @@ -1192,15 +1146,14 @@ function widget:DrawScreen() end else -- selected cell - if (b or b2 or b3) then + if b or b2 or b3 then usedZoom = clickSelectedCellZoom else usedZoom = selectedCellZoom end cellColor = { 1, 0.85, 0.2, 0.25 } end - if not (units.unitRestricted[uDefID]) then - + if not units.unitRestricted[uDefID] then local unsetShowPrice if not showPrice then unsetShowPrice = true @@ -1254,17 +1207,18 @@ function widget:DrawScreen() end function widget:DrawWorld() - -- Avoid unnecessary overhead after buildqueue has been setup in early frames if spGetGameFrame() > 0 then - widgetHandler:RemoveWidgetCallIn('DrawWorld', self) + widgetHandler:RemoveWidgetCallIn("DrawWorld", self) return end - if not preGamestartPlayer then return end + if not preGamestartPlayer then + return + end - if startDefID ~= Spring.GetTeamRulesParam(myTeamID, 'startUnit') then - startDefID = Spring.GetTeamRulesParam(myTeamID, 'startUnit') + if startDefID ~= Spring.GetTeamRulesParam(myTeamID, "startUnit") then + startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") doUpdate = true end end @@ -1304,7 +1258,7 @@ end local function unbindBuildUnits() for _, buildOption in ipairs(boundUnits) do - widgetHandler.actionHandler:RemoveAction(self, "buildunit_" .. buildOption, 'p') + widgetHandler.actionHandler:RemoveAction(self, "buildunit_" .. buildOption, "p") end boundUnits = {} @@ -1317,7 +1271,9 @@ function widget:GameStart() end function widget:GameFrame(n) - if n % 15 ~= 0 or selectedFactoryCount == 0 then return end + if n % 15 ~= 0 or selectedFactoryCount == 0 then + return + end local finishedCount = 0 for _, unitID in ipairs(spGetSelectedUnits()) do local defID = spGetUnitDefID(unitID) @@ -1335,8 +1291,8 @@ end local function setPreGamestartDefID(uDefID) selBuildQueueDefID = uDefID - if WG['pregame-build'] then - WG['pregame-build'].setPreGamestartDefID(uDefID) + if WG["pregame-build"] then + WG["pregame-build"].setPreGamestartDefID(uDefID) end end @@ -1384,7 +1340,7 @@ function widget:MousePress(x, y, button) if Spring.IsGUIHidden() then return end - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then return end @@ -1406,13 +1362,13 @@ function widget:MousePress(x, y, button) end if not disableInput then for cellRectID, cellRect in pairs(cellRects) do - if cmds[cellRectID] and cmds[cellRectID].id and unitTranslatedHumanName[-cmds[cellRectID].id] and math_isInRect(x, y, cellRect[1], cellRect[2], cellRect[3], cellRect[4]) and not (units.unitRestricted[-cmds[cellRectID].id]) then - local uDefID = cmds[cellRectID].id --WARNING: THIS IS -unitDefID, not unitDefID + if cmds[cellRectID] and cmds[cellRectID].id and unitTranslatedHumanName[-cmds[cellRectID].id] and math_isInRect(x, y, cellRect[1], cellRect[2], cellRect[3], cellRect[4]) and not units.unitRestricted[-cmds[cellRectID].id] then + local uDefID = cmds[cellRectID].id --WARNING: THIS IS -unitDefID, not unitDefID local setQuotas = isOnQuotaBuildMode(-uDefID) local alt, ctrl, meta, shift = Spring.GetModKeyState() if button ~= 3 then if playSounds then - Spring.PlaySoundFile(sound_queue_add, 0.75, 'ui') + Spring.PlaySoundFile(sound_queue_add, 0.75, "ui") end if setQuotas and not alt then changeQuotas(-uDefID, 1) @@ -1423,7 +1379,7 @@ function widget:MousePress(x, y, button) local isRepeatMex = unitMetal_extractor[-uDefID] and unitName[-uDefID] == activeCmd local cmd = isRepeatMex and "areamex" or spGetCmdDescIndex(uDefID) if isRepeatMex then - WG['areamex'].setAreaMexType(uDefID) + WG["areamex"].setAreaMexType(uDefID) end Spring.SetActiveCommand(cmd, 1, true, false, alt, ctrl, meta, shift) end @@ -1433,13 +1389,13 @@ function widget:MousePress(x, y, button) local function decreaseQuota() if changeQuotas(-uDefID, modKeyMultiplier.right) and playSounds then - Spring.PlaySoundFile(sound_queue_rem, 0.75, 'ui') + Spring.PlaySoundFile(sound_queue_rem, 0.75, "ui") end end local function decreaseQueue() if queueCount > 0 and playSounds then - Spring.PlaySoundFile(sound_queue_rem, 0.75, 'ui') + Spring.PlaySoundFile(sound_queue_rem, 0.75, "ui") end if preGamestartPlayer then setPreGamestartDefID(-cmds[cellRectID].id) @@ -1481,10 +1437,16 @@ end -- Used for hotkeys at pregamestart local function buildUnitHandler(_, _, _, data) -- sanity check - if not preGamestartPlayer then return end - if units.unitRestricted[data.unitDefID] then return end + if not preGamestartPlayer then + return + end + if units.unitRestricted[data.unitDefID] then + return + end - if not unitName[startDefID] or not comBuildOptions[unitName[startDefID]] or not comBuildOptions[unitName[startDefID]][data.unitDefID] then return end + if not unitName[startDefID] or not comBuildOptions[unitName[startDefID]] or not comBuildOptions[unitName[startDefID]][data.unitDefID] then + return + end -- If no current active selection we can return early if not selBuildQueueDefID then @@ -1517,25 +1479,29 @@ local function buildUnitHandler(_, _, _, data) end -- didnt find a suitable binding to cycle from - if not (pressedKey or pressedScan) then return end + if not (pressedKey or pressedScan) then + return + end -- Clear and reuse temp table instead of creating new one clearTable(buildCycleTemp) local buildCycleCount = 0 for _, keybind in ipairs(Spring.GetKeyBindings(pressedKey, pressedScan)) do - if string_sub(keybind.command, 1, 10) == 'buildunit_' then + if string_sub(keybind.command, 1, 10) == "buildunit_" then local uDefName = string_sub(keybind.command, 11) local uDef = UnitDefNames[uDefName] - if uDef then -- prevents crashing when trying to access unloaded units (legion) - if comBuildOptions[unitName[startDefID]][uDef.id] and not units.unitRestricted[uDef.id] then - buildCycleCount = buildCycleCount + 1 - buildCycleTemp[buildCycleCount] = uDef.id - end - end + if uDef then -- prevents crashing when trying to access unloaded units (legion) + if comBuildOptions[unitName[startDefID]][uDef.id] and not units.unitRestricted[uDef.id] then + buildCycleCount = buildCycleCount + 1 + buildCycleTemp[buildCycleCount] = uDef.id + end + end end end - if buildCycleCount == 0 then return end + if buildCycleCount == 0 then + return + end local buildCycleIndex for i = 1, buildCycleCount do @@ -1551,7 +1517,9 @@ local function buildUnitHandler(_, _, _, data) end buildCycleIndex = buildCycleIndex + 1 - if buildCycleIndex > buildCycleCount then buildCycleIndex = 1 end + if buildCycleIndex > buildCycleCount then + buildCycleIndex = 1 + end setPreGamestartDefID(buildCycleTemp[buildCycleIndex]) @@ -1559,14 +1527,16 @@ local function buildUnitHandler(_, _, _, data) end local function bindBuildUnits(widget) - if not preGamestartPlayer then return end + if not preGamestartPlayer then + return + end unbindBuildUnits() comBuildOptions = table.filterTable({ armcom = {}, corcom = {}, - legcom = {} + legcom = {}, }, function(value, key) return UnitDefNames[key] ~= nil end) @@ -1577,7 +1547,7 @@ local function bindBuildUnits(widget) local unitDefName = unitName[buildOption] buildOptions[buildOption] = true table.insert(boundUnits, unitDefName) - widgetHandler.actionHandler:AddAction(widget, "buildunit_" .. unitDefName, buildUnitHandler, { unitDefID = buildOption }, 'p') + widgetHandler.actionHandler:AddAction(widget, "buildunit_" .. unitDefName, buildUnitHandler, { unitDefID = buildOption }, "p") end end end @@ -1598,12 +1568,11 @@ function widget:Initialize() widgetHandler:DisableWidgetRaw("Grid menu") end - -- Get our starting unit if preGamestartPlayer then bindBuildUnits(self) - if not startDefID or startDefID ~= spGetTeamRulesParam(myTeamID, 'startUnit') then - startDefID = spGetTeamRulesParam(myTeamID, 'startUnit') + if not startDefID or startDefID ~= spGetTeamRulesParam(myTeamID, "startUnit") then + startDefID = spGetTeamRulesParam(myTeamID, "startUnit") doUpdate = true end end @@ -1611,93 +1580,93 @@ function widget:Initialize() widget:ViewResize() widget:SelectionChanged(spGetSelectedUnits()) - WG['buildmenu'] = {} - WG['buildmenu'].getGroups = function() + WG["buildmenu"] = {} + WG["buildmenu"].getGroups = function() return groups, units.unitGroup end - WG['buildmenu'].getOrder = function() + WG["buildmenu"].getOrder = function() return units.unitOrder end - WG['buildmenu'].getShowPrice = function() + WG["buildmenu"].getShowPrice = function() return showPrice end - WG['buildmenu'].setShowPrice = function(value) + WG["buildmenu"].setShowPrice = function(value) showPrice = value clear() end - WG['buildmenu'].getAlwaysShow = function() + WG["buildmenu"].getAlwaysShow = function() return alwaysShow end - WG['buildmenu'].setAlwaysShow = function(value) + WG["buildmenu"].setAlwaysShow = function(value) alwaysShow = value clear() end - WG['buildmenu'].getShowRadarIcon = function() + WG["buildmenu"].getShowRadarIcon = function() return showRadarIcon end - WG['buildmenu'].setShowRadarIcon = function(value) + WG["buildmenu"].setShowRadarIcon = function(value) showRadarIcon = value clear() end - WG['buildmenu'].getShowGroupIcon = function() + WG["buildmenu"].getShowGroupIcon = function() return showGroupIcon end - WG['buildmenu'].setShowGroupIcon = function(value) + WG["buildmenu"].setShowGroupIcon = function(value) showGroupIcon = value clear() end - WG['buildmenu'].getDynamicIconsize = function() + WG["buildmenu"].getDynamicIconsize = function() return dynamicIconsize end - WG['buildmenu'].setDynamicIconsize = function(value) + WG["buildmenu"].setDynamicIconsize = function(value) dynamicIconsize = value clear() end - WG['buildmenu'].getMinColls = function() + WG["buildmenu"].getMinColls = function() return minColls end - WG['buildmenu'].setMinColls = function(value) + WG["buildmenu"].setMinColls = function(value) minColls = value clear() end - WG['buildmenu'].getMaxColls = function() + WG["buildmenu"].getMaxColls = function() return maxColls end - WG['buildmenu'].setMaxColls = function(value) + WG["buildmenu"].setMaxColls = function(value) maxColls = value clear() end - WG['buildmenu'].getDefaultColls = function() + WG["buildmenu"].getDefaultColls = function() return defaultColls end - WG['buildmenu'].setDefaultColls = function(value) + WG["buildmenu"].setDefaultColls = function(value) defaultColls = value clear() end - WG['buildmenu'].getBottomPosition = function() + WG["buildmenu"].getBottomPosition = function() return stickToBottom end - WG['buildmenu'].setBottomPosition = function(value) + WG["buildmenu"].setBottomPosition = function(value) stickToBottom = value widget:Update(1000) widget:ViewResize() clear() end - WG['buildmenu'].getSize = function() + WG["buildmenu"].getSize = function() return posY, posY2 end - WG['buildmenu'].getMaxPosY = function() + WG["buildmenu"].getMaxPosY = function() return maxPosY end - WG['buildmenu'].setMaxPosY = function(value) + WG["buildmenu"].setMaxPosY = function(value) maxPosY = value clear() end - WG['buildmenu'].reloadBindings = function() + WG["buildmenu"].reloadBindings = function() bindBuildUnits(self) end - WG['buildmenu'].getIsShowing = function() + WG["buildmenu"].getIsShowing = function() return buildmenuShows end ---@class CostLine @@ -1713,7 +1682,7 @@ function widget:Initialize() ---Override the cost display for a specific unit in the build menu ---@param unitDefID number The unit definition ID to override costs for ---@param costData CostData Cost override configuration table with optional properties - WG['buildmenu'].setCostOverride = function(unitDefID, costData) + WG["buildmenu"].setCostOverride = function(unitDefID, costData) if unitDefID and costData then costOverrides[unitDefID] = costData clear() @@ -1722,7 +1691,7 @@ function widget:Initialize() ---Clear cost overrides for a specific unit or all units ---@param unitDefID number? The unit definition ID to clear overrides for. If nil or not provided, clears all cost overrides. - WG['buildmenu'].clearCostOverrides = function(unitDefID) + WG["buildmenu"].clearCostOverrides = function(unitDefID) if unitDefID then costOverrides[unitDefID] = nil else @@ -1738,8 +1707,10 @@ function widget:Initialize() ---block hover/selection visuals. Subsequent calls update the existing highlight. ---@param unitDefID number The unit definition ID to highlight. ---@param color number[]? Optional {r,g,b} in 0..1. Defaults to a warm yellow. - WG['buildmenu'].setHighlight = function(unitDefID, color) - if not unitDefID then return end + WG["buildmenu"].setHighlight = function(unitDefID, color) + if not unitDefID then + return + end if not highlights[unitDefID] then highlightCount = highlightCount + 1 end @@ -1751,7 +1722,7 @@ function widget:Initialize() ---Remove a highlight previously set via setHighlight. ---@param unitDefID number - WG['buildmenu'].removeHighlight = function(unitDefID) + WG["buildmenu"].removeHighlight = function(unitDefID) if unitDefID and highlights[unitDefID] then highlights[unitDefID] = nil highlightCount = math_max(0, highlightCount - 1) @@ -1759,7 +1730,7 @@ function widget:Initialize() end ---Clear all active highlights. - WG['buildmenu'].clearHighlights = function() + WG["buildmenu"].clearHighlights = function() for k in pairs(highlights) do highlights[k] = nil end @@ -1769,13 +1740,11 @@ function widget:Initialize() ---Returns true if there is an active highlight for the given unitDefID. ---@param unitDefID number ---@return boolean - WG['buildmenu'].hasHighlight = function(unitDefID) + WG["buildmenu"].hasHighlight = function(unitDefID) return unitDefID ~= nil and highlights[unitDefID] ~= nil end end - - function widget:UnitBlocked(unitDefID, reasons) units.unitRestricted[unitDefID] = next(reasons) ~= nil units.unitHidden[unitDefID] = reasons["hidden"] ~= nil @@ -1786,11 +1755,11 @@ end function widget:Shutdown() clear() - if WG['guishader'] and dlistGuishader then - WG['guishader'].DeleteDlist('buildmenu') + if WG["guishader"] and dlistGuishader then + WG["guishader"].DeleteDlist("buildmenu") dlistGuishader = nil end - WG['buildmenu'] = nil + WG["buildmenu"] = nil end function widget:GetConfigData() diff --git a/luaui/Widgets/gui_buildspacing.lua b/luaui/Widgets/gui_buildspacing.lua index 44086a56cf0..6f451942364 100644 --- a/luaui/Widgets/gui_buildspacing.lua +++ b/luaui/Widgets/gui_buildspacing.lua @@ -1,16 +1,16 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Mouse Buildspacing", - desc = "Use mousebuttons 4 and 5 for buildspacing", - author = "Auswaschbar, Baldric", - version = "v1.0", - date = "Mar, 2010", - license = "GNU GPL, v3 or later", - layer = 200, - enabled = true, - } + return { + name = "Mouse Buildspacing", + desc = "Use mousebuttons 4 and 5 for buildspacing", + author = "Auswaschbar, Baldric", + version = "v1.0", + date = "Mar, 2010", + license = "GNU GPL, v3 or later", + layer = 200, + enabled = true, + } end function widget:MousePress(mx, my, button) diff --git a/luaui/Widgets/gui_cache_icons.lua b/luaui/Widgets/gui_cache_icons.lua index 61617f2c8b7..22bdcc7de83 100644 --- a/luaui/Widgets/gui_cache_icons.lua +++ b/luaui/Widgets/gui_cache_icons.lua @@ -1,20 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Cache Icons", - desc = "loads all icons to prevent briefly showing white unit icons in things like the buildmenu", - author = "Floris", - date = "June 2023", - license = "GNU GPL, v2 or later", - layer = -9999999, - enabled = true - } + return { + name = "Cache Icons", + desc = "loads all icons to prevent briefly showing white unit icons in things like the buildmenu", + author = "Floris", + date = "June 2023", + license = "GNU GPL, v2 or later", + layer = -9999999, + enabled = true, + } end - - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -24,7 +21,6 @@ local delayedCacheUnitIcons local delayedCacheUnitIconsTimer = 0 local cachedUnitIcons = false - local startUnits = { UnitDefNames.armcom.id, UnitDefNames.corcom.id } if Spring.GetModOptions().experimentallegionfaction then startUnits[#startUnits + 1] = UnitDefNames.legcom.id @@ -38,37 +34,34 @@ for i, uDefID in pairs(startUnits) do end startUnits = nil - local function loadToTexture(id) - gl.Texture('#' .. id) + gl.Texture("#" .. id) gl.TexRect(-1, -1, 0, 0) if iconTypes[id] and iconTypes[id].bitmap then - gl.Texture(':l:' .. iconTypes[id].bitmap) + gl.Texture(":l:" .. iconTypes[id].bitmap) gl.TexRect(-1, -1, 0, 0) end end - -- load all icons to prevent briefly showing white unit icons (will happen due to the custom texture filtering options) -- load time armada+cortex = 0.7 seconds (excluding legion,raptors,scavs) tested with Tracy (pc: RTX4070 + 7800X3D) -- only loading armada/cortex start units buildoptions = 45ms, loading the rest gets delayed local delayedCachePos = 0 local cacheIconsPerFrame = 3 -local nonStartUnitCacheDelay = 6 -- apply delay or it will load during loadscreen still +local nonStartUnitCacheDelay = 6 -- apply delay or it will load during loadscreen still local function cacheUnitIcons() gl.Translate(-vsx, 0, 0) gl.Color(1, 1, 1, 0.001) for id, unit in pairs(UnitDefs) do if startBuildOptions[id] then - loadToTexture(id) -- loading starting icons ASAP + loadToTexture(id) -- loading starting icons ASAP else if not delayedCacheUnitIcons then delayedCacheUnitIcons = {} - delayedCacheUnitIconsTimer = os.clock() + nonStartUnitCacheDelay -- apply delay or it will load during loadscreen still + delayedCacheUnitIconsTimer = os.clock() + nonStartUnitCacheDelay -- apply delay or it will load during loadscreen still end delayedCacheUnitIcons[#delayedCacheUnitIcons + 1] = id end - end gl.Color(1, 1, 1, 1) gl.Texture(false) diff --git a/luaui/Widgets/gui_camera_anchors.lua b/luaui/Widgets/gui_camera_anchors.lua index 877fc296acc..7392423a04f 100644 --- a/luaui/Widgets/gui_camera_anchors.lua +++ b/luaui/Widgets/gui_camera_anchors.lua @@ -8,24 +8,24 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Camera Anchors", - desc = "Adds keybindings for Camera Anchors", - author = "badosu, lonewolfdesign", - date = "Mar 12, 2023", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Camera Anchors", + desc = "Adds keybindings for Camera Anchors", + author = "badosu, lonewolfdesign", + date = "Mar 12, 2023", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end -local GetCameraState = Spring.GetCameraState -local SetCameraState = Spring.SetCameraState -local GetConfigInt = Spring.GetConfigInt -local SendCommands = Spring.SendCommands +local GetCameraState = Spring.GetCameraState +local SetCameraState = Spring.SetCameraState +local GetConfigInt = Spring.GetConfigInt +local SendCommands = Spring.SendCommands function widget:Initialize() - widgetHandler:AddAction("set_camera_anchor", SetCameraAnchor, nil, 'pt') - widgetHandler:AddAction("focus_camera_anchor", FocusCameraAnchor, nil, 'pt') + widgetHandler:AddAction("set_camera_anchor", SetCameraAnchor, nil, "pt") + widgetHandler:AddAction("focus_camera_anchor", FocusCameraAnchor, nil, "pt") end local cameraAnchors = {} @@ -45,7 +45,9 @@ function FocusCameraAnchor(_, _, args) local anchorId = args[1] local cameraState = cameraAnchors[anchorId] - if not cameraState then return end + if not cameraState then + return + end -- make sure if last camera state minimized minimap to unminimize it -- overview camera hides minimap diff --git a/luaui/Widgets/gui_center_n_select.lua b/luaui/Widgets/gui_center_n_select.lua index 7dad36b8faf..f5f8125e232 100644 --- a/luaui/Widgets/gui_center_n_select.lua +++ b/luaui/Widgets/gui_center_n_select.lua @@ -1,50 +1,45 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Select n Center!", - desc = "Selects and centers the Commander at the start of the game.", - author = "quantum and Evil4Zerggin", - date = "19 April 2008", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true - } + return { + name = "Select n Center!", + desc = "Selects and centers the Commander at the start of the game.", + author = "quantum and Evil4Zerggin", + date = "19 April 2008", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true, + } end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local go = true -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - function widget:Update() - local t = Spring.GetGameSeconds() - local isSpec = select(3, Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false)) - if (isSpec or t > 10) then - widgetHandler:RemoveWidget() - return - end - if (t > 0) then - local unitArray = Spring.GetTeamUnits(Spring.GetMyTeamID()) - if (go and unitArray[1]) then - local x, y, z = Spring.GetUnitPosition(unitArray[1]) - Spring.SetCameraTarget(x, y, z) - Spring.SelectUnitArray{unitArray[1]} - go = false - end - if (not go) then - widgetHandler:RemoveWidget() - end - end + local t = Spring.GetGameSeconds() + local isSpec = select(3, Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false)) + if isSpec or t > 10 then + widgetHandler:RemoveWidget() + return + end + if t > 0 then + local unitArray = Spring.GetTeamUnits(Spring.GetMyTeamID()) + if go and unitArray[1] then + local x, y, z = Spring.GetUnitPosition(unitArray[1]) + Spring.SetCameraTarget(x, y, z) + Spring.SelectUnitArray({ unitArray[1] }) + go = false + end + if not go then + widgetHandler:RemoveWidget() + end + end end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/gui_changelog_info.lua b/luaui/Widgets/gui_changelog_info.lua index 3f912049741..8935af8b83c 100644 --- a/luaui/Widgets/gui_changelog_info.lua +++ b/luaui/Widgets/gui_changelog_info.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -28,7 +27,7 @@ local changelogFile = VFS.LoadFile("changelog.txt") changelogFile = string.gsub(changelogFile, "\t", " ") local changelogFileHash = VFS.CalculateHash(changelogFile, 0) local changelogFileLength = string.len(changelogFile) -local lastviewedHash = '' +local lastviewedHash = "" local lastviewedChangelogLength = 0 local screenHeightOrg = 520 @@ -37,7 +36,7 @@ local screenHeight = screenHeightOrg local screenWidth = screenWidthOrg local playSounds = true -local buttonclick = 'LuaUI/Sounds/buildbar_waypoint.wav' +local buttonclick = "LuaUI/Sounds/buildbar_waypoint.wav" local startLine = 1 @@ -58,7 +57,7 @@ local versions = {} local changelogLines = {} local totalChangelogLines = 0 -local showOnceMore = false -- used because of GUI shader delay +local showOnceMore = false -- used because of GUI shader delay local RectRound, UiElement, UiScroller, elementCorner @@ -83,8 +82,8 @@ function widget:ViewResize() screenX = mathFloor((vsx * centerPosX) - (screenWidth / 2)) screenY = mathFloor((vsy * centerPosY) + (screenHeight / 2)) - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) bgpadding = WG.FlowUI.elementPadding elementCorner = WG.FlowUI.elementCorner @@ -114,7 +113,7 @@ function DrawSidebar(x, y, width, height) font:SetOutlineColor(0.2, 0.17, 0, 0.33) font:SetTextColor(0.8, 0.65, 0.15, 1) local lineKey = 1 - local yOffset = 24*widgetScale + local yOffset = 24 * widgetScale local j = 0 while j < 22 do if ((fontSize + fontOffsetY) * j) + 4 > height - yOffset then @@ -128,14 +127,14 @@ function DrawSidebar(x, y, width, height) -- version button title --line = " " .. string.match(line, '( %d*%d.?%d+)') line = " " .. string.sub(line, 3) - local textY = y - ((fontSize + fontOffsetY) * j) - (20*widgetScale) + local textY = y - ((fontSize + fontOffsetY) * j) - (20 * widgetScale) font:Print(line, x + fontOffsetX, textY, fontSize, "on") versionQuickLinks[j] = { mathFloor(x), mathFloor(textY - (versionFontSize * widgetScale * 0.66)), - mathFloor(x + (versionWidth*widgetScale)), - math.ceil(textY + (versionFontSize * widgetScale * 1.21)) + mathFloor(x + (versionWidth * widgetScale)), + math.ceil(textY + (versionFontSize * widgetScale * 1.21)), } j = j + 1 @@ -146,8 +145,8 @@ function DrawSidebar(x, y, width, height) end function DrawTextarea(x, y, width, height, scrollbar) - local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top - local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom + local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top + local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom local scrollbarMargin = 10 * widgetScale local scrollbarWidth = 8 * widgetScale local scrollbarPosWidth = 4 * widgetScale @@ -175,14 +174,7 @@ function DrawTextarea(x, y, width, height, scrollbar) local scrollbarTop = y - scrollbarOffsetTop - scrollbarMargin - (scrollbarWidth - scrollbarPosWidth) local scrollbarBottom = y - scrollbarOffsetBottom - height + scrollbarMargin + (scrollbarWidth - scrollbarPosWidth) - UiScroller( - mathFloor(x + width - scrollbarMargin - scrollbarWidth), - mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), - mathFloor(x + width - scrollbarMargin), - mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), - (#changelogLines) * (lineSeparator + fontSizeTitle), - (startLine-1) * (lineSeparator + fontSizeTitle) - ) + UiScroller(mathFloor(x + width - scrollbarMargin - scrollbarWidth), mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), mathFloor(x + width - scrollbarMargin), mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), #changelogLines * (lineSeparator + fontSizeTitle), (startLine - 1) * (lineSeparator + fontSizeTitle)) end end @@ -191,7 +183,7 @@ function DrawTextarea(x, y, width, height, scrollbar) font:Begin() local lineKey = startLine local j = 1 - while j < maxLines+1 do + while j < maxLines + 1 do -- maxlines is not exact, just a failsafe if (lineSeparator + fontSizeTitle) * j > height then break @@ -201,38 +193,36 @@ function DrawTextarea(x, y, width, height, scrollbar) end local line = changelogLines[lineKey] - if string.find(line, '^([0-9][0-9][/][0-9][0-9][/][0-9][0-9])') or string.find(line, '^([0-9][/][0-9][0-9][/][0-9][0-9])') then + if string.find(line, "^([0-9][0-9][/][0-9][0-9][/][0-9][0-9])") or string.find(line, "^([0-9][/][0-9][0-9][/][0-9][0-9])") then -- date line line = " " .. line font:SetTextColor(fontColorDate) font:Print(line, x, y - (lineSeparator + fontSizeTitle) * j, fontSizeDate, "n") - - elseif string.find(line, '^# ') then + elseif string.find(line, "^# ") then -- version line line = string.sub(line, 3) font:SetTextColor(fontColorTitle) - font:Print(line, x - (9*widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeTitle, "n") - + font:Print(line, x - (9 * widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeTitle, "n") else font:SetTextColor(fontColorLine) local numLines - if string.find(line, '^(-)') then + if string.find(line, "^(-)") then -- bulletpointed line local firstLetterPos = 2 - if string.find(line, '^(- )') then + if string.find(line, "^(- )") then firstLetterPos = 3 end line = string.upper(string.sub(line, firstLetterPos, firstLetterPos)) .. string.sub(line, firstLetterPos + 1) - line, numLines = font:WrapText(line, (width - (90*widgetScale) - textRightOffset) * (loadedFontSize / fontSizeLine)) + line, numLines = font:WrapText(line, (width - (90 * widgetScale) - textRightOffset) * (loadedFontSize / fontSizeLine)) if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end font:Print(" - ", x, y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") - font:Print(line, x + (26*widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") + font:Print(line, x + (26 * widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") else -- line line = " " .. line - line, numLines = font:WrapText(line, (width - (50*widgetScale)) * (loadedFontSize / fontSizeLine)) + line, numLines = font:WrapText(line, (width - (50 * widgetScale)) * (loadedFontSize / fontSizeLine)) if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end @@ -250,12 +240,12 @@ end function DrawWindow() -- background - UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) -- title background - local title = Spring.I18N('ui.changelog.title') + local title = Spring.I18N("ui.changelog.title") local titleFontSize = 18 * widgetScale - titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } + titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize * 1.5)), mathFloor(screenY + (titleFontSize * 1.7)) } gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) @@ -264,32 +254,28 @@ function DrawWindow() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - font2:Print(title, screenX + (titleFontSize * 0.75), screenY + (8*widgetScale), titleFontSize, "on") + font2:Print(title, screenX + (titleFontSize * 0.75), screenY + (8 * widgetScale), titleFontSize, "on") font2:End() -- version links - DrawSidebar(screenX+bgpadding, screenY-bgpadding, versionWidth*widgetScale, screenHeight-bgpadding-bgpadding) + DrawSidebar(screenX + bgpadding, screenY - bgpadding, versionWidth * widgetScale, screenHeight - bgpadding - bgpadding) -- textarea - DrawTextarea(screenX + ((versionWidth+30)*widgetScale), screenY - (10*widgetScale), screenWidth - ((versionWidth+30)*widgetScale), screenHeight - (24*widgetScale), 1) + DrawTextarea(screenX + ((versionWidth + 30) * widgetScale), screenY - (10 * widgetScale), screenWidth - ((versionWidth + 30) * widgetScale), screenHeight - (24 * widgetScale), 1) end - - - function widget:DrawScreen() - -- draw the help if not changelogList then changelogList = gl.CreateList(DrawWindow) end if show or showOnceMore then - gl.Texture(false) -- some other widget left it on + gl.Texture(false) -- some other widget left it on -- draw the changelog panel glCallList(changelogList) - if WG['guishader'] then + if WG["guishader"] then if backgroundGuishader ~= nil then glDeleteList(backgroundGuishader) end @@ -299,7 +285,7 @@ function widget:DrawScreen() -- title RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) end) - WG['guishader'].InsertDlist(backgroundGuishader, 'changelog') + WG["guishader"].InsertDlist(backgroundGuishader, "changelog") dlistcreated = true end showOnceMore = false @@ -310,7 +296,7 @@ function widget:DrawScreen() local x, y, pressed = spGetMouseState() if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) or math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") end if changelogFile then local lineKey = 1 @@ -318,20 +304,20 @@ function widget:DrawScreen() local yOffset = 24 * widgetScale local yOffsetUp = ((versionFontSize * 0.66) + yOffset) * widgetScale local yOffsetDown = ((versionFontSize * 1.21) - yOffset) * widgetScale - for k,v in pairs(versionQuickLinks) do + for k, v in pairs(versionQuickLinks) do if math_isInRect(x, y, v[1], v[2], v[3], v[4]) then if pressed then gl.Color(1, 0.93, 0.75, 0.23) else gl.Color(1, 0.93, 0.75, 0.15) end - RectRound(v[1], v[2], v[3], v[4], bgpadding, 0,0,0,0) - break; + RectRound(v[1], v[2], v[3], v[4], bgpadding, 0, 0, 0, 0) + break end end end - elseif dlistcreated and WG['guishader'] then - WG['guishader'].RemoveDlist('changelog') + elseif dlistcreated and WG["guishader"] then + WG["guishader"].RemoveDlist("changelog") dlistcreated = nil end end @@ -344,13 +330,12 @@ function widget:KeyPress(key) end function widget:MouseWheel(up, value) - if show then local addLines = value * -3 -- direction is retarded startLine = startLine + addLines if startLine >= totalChangelogLines - maxLines then - startLine = totalChangelogLines - maxLines+1 + startLine = totalChangelogLines - maxLines + 1 end if startLine < 1 then startLine = 1 @@ -383,7 +368,6 @@ function mouseEvent(x, y, button, release) if show then -- on window if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) then - -- version buttons if button == 1 and release then local yOffset = 24 @@ -392,17 +376,17 @@ function mouseEvent(x, y, button, release) local x, y = spGetMouseState() if changelogFile then - for k,v in pairs(versionQuickLinks) do + for k, v in pairs(versionQuickLinks) do if math_isInRect(x, y, v[1], v[2], v[3], v[4]) then - startLine = versions[k+1] + startLine = versions[k + 1] if changelogList then glDeleteList(changelogList) end changelogList = gl.CreateList(DrawWindow) if playSounds then - Spring.PlaySoundFile(buttonclick, 0.6, 'ui') + Spring.PlaySoundFile(buttonclick, 0.6, "ui") end - break; + break end end end @@ -412,10 +396,9 @@ function mouseEvent(x, y, button, release) if button == 1 or button == 3 then return true end - elseif titleRect == nil or not math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then if release then - showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it show = false end return true @@ -426,9 +409,8 @@ end function widget:Initialize() widget:ViewResize() if changelogFile then - - WG['changelog'] = {} - WG['changelog'].toggle = function(state) + WG["changelog"] = {} + WG["changelog"].toggle = function(state) if state ~= nil then show = state else @@ -441,10 +423,10 @@ function widget:Initialize() end end end - WG['changelog'].isvisible = function() + WG["changelog"].isvisible = function() return show end - WG['changelog'].haschanges = function() + WG["changelog"].haschanges = function() return lastviewedHash ~= changelogFileHash and lastviewedChangelogLength < changelogFileLength end @@ -457,10 +439,8 @@ function widget:Initialize() local versionKey = 0 local insertedLatest = false for i, line in ipairs(changelogLines) do - --if insertedLatest == false or string.find(line, '^(%d*%d.?%d+ [/-]> %d*%d.[0-9]0)$') or string.find(line, '^(%d*%d.?%d+ [/-]> %d*%d.[0-9])$') then - if insertedLatest == false or string.match(line, '^# ') then - + if insertedLatest == false or string.match(line, "^# ") then --if string.find(line, '^(%d*%d.?%d+ [/-]> )') then versionKey = versionKey + 1 versions[versionKey] = i @@ -480,8 +460,8 @@ function widget:Shutdown() glDeleteList(changelogList) changelogList = nil end - if WG['guishader'] then - WG['guishader'].RemoveDlist('changelog') + if WG["guishader"] then + WG["guishader"].RemoveDlist("changelog") end if backgroundGuishader ~= nil then glDeleteList(backgroundGuishader) @@ -495,7 +475,7 @@ end function widget:GetConfigData() return { lastviewedHash = lastviewedHash, - lastviewedChangelogLength = lastviewedChangelogLength + lastviewedChangelogLength = lastviewedChangelogLength, } end diff --git a/luaui/Widgets/gui_chat.lua b/luaui/Widgets/gui_chat.lua index d312aed7f77..d165679bf27 100644 --- a/luaui/Widgets/gui_chat.lua +++ b/luaui/Widgets/gui_chat.lua @@ -2,14 +2,14 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Chat", - desc = "chat/console (do /clearconsole to wipe history)", - author = "Floris", - date = "May 2021", - license = "GNU GPL, v2 or later", - layer = -95000, - enabled = true, - handler = true, + name = "Chat", + desc = "chat/console (do /clearconsole to wipe history)", + author = "Floris", + date = "May 2021", + license = "GNU GPL, v2 or later", + layer = -95000, + enabled = true, + handler = true, } end @@ -33,11 +33,11 @@ local LineTypes = { Spectator = 2, Mapmark = 3, Battleroom = 4, - System = 5 + System = 5, } -local utf8 = VFS.Include('common/luaUtilities/utf8.lua') -local badWords = VFS.Include('luaui/configs/badwords.lua') +local utf8 = VFS.Include("common/luaUtilities/utf8.lua") +local badWords = VFS.Include("luaui/configs/badwords.lua") local L_DEPRECATED = LOG.DEPRECATED local isDevSingle = (Spring.Utilities.IsDevMode() and Spring.Utilities.Gametype.IsSinglePlayer()) @@ -51,7 +51,7 @@ local config = { posY = 0.81, posX = 0.3, posX2 = 0.74, - charSize = 21 - (3.5 * ((vsx/vsy) - 1.78)), + charSize = 21 - (3.5 * ((vsx / vsy) - 1.78)), consoleFontSizeMult = 0.85, maxLines = 5, maxConsoleLines = 2, @@ -77,10 +77,10 @@ local config = { fontsizeMult = 1, scrollingPosY = 0.66, consolePosY = 0.9, - hideSpecChat = (Spring.GetConfigInt('HideSpecChat', 0) == 1), - hideSpecChatPlayer = (Spring.GetConfigInt('HideSpecChatPlayer', 1) == 1), + hideSpecChat = (Spring.GetConfigInt("HideSpecChat", 0) == 1), + hideSpecChatPlayer = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1), playSound = true, - sndChatFile = 'beep4', + sndChatFile = "beep4", sndChatFileVolume = 0.55, } @@ -96,15 +96,15 @@ local showHistoryWhenCtrlShift = config.showHistoryWhenCtrlShift local enableShortcutClick = config.enableShortcutClick -- Access config/state/colors/layout via tables to stay under 200 locals -local usedFontSize = config.charSize*config.widgetScale*config.fontsizeMult -local usedConsoleFontSize = usedFontSize*config.consoleFontSizeMult +local usedFontSize = config.charSize * config.widgetScale * config.fontsizeMult +local usedConsoleFontSize = usedFontSize * config.consoleFontSizeMult -- Essential config aliases (most frequently accessed) local posY, posX, maxLines = config.posY, config.posX, config.maxLines local lineHeightMult, hideSpecChat, hideSpecChatPlayer = config.lineHeightMult, config.hideSpecChat, config.hideSpecChatPlayer local consoleFontSizeMult, posX2 = config.consoleFontSizeMult, config.posX2 -local ui_scale, ui_opacity, lineHeight = config.ui_scale, config.ui_opacity, mathFloor(usedFontSize*config.lineHeightMult) -local consoleLineHeight = mathFloor(usedConsoleFontSize*config.lineHeightMult) +local ui_scale, ui_opacity, lineHeight = config.ui_scale, config.ui_opacity, mathFloor(usedFontSize * config.lineHeightMult) +local consoleLineHeight = mathFloor(usedConsoleFontSize * config.lineHeightMult) local orgLineCleanupTarget, maxTextInputChars = config.orgLineCleanupTarget, config.maxTextInputChars local allowMultiAutocomplete, allowMultiAutocompleteMax, maxLinesScrollFull = config.allowMultiAutocomplete, config.allowMultiAutocompleteMax, config.maxLinesScrollFull local lineTTL, consoleLineCleanupTarget, soundErrorsLimit = config.lineTTL, config.consoleLineCleanupTarget, config.soundErrorsLimit @@ -112,17 +112,17 @@ local maxLinesScrollChatInput = config.maxLinesScrollChatInput local maxLinesScroll = config.maxLinesScroll -- Color configuration (keep local for performance) -local colorOther, colorAlly, colorSpec, colorSpecName = {1,1,1}, {0,1,0}, {1,1,0}, {1,1,1} -local colorOtherAlly, colorGame, colorConsole = {1,0.7,0.45}, {0.4,1,1}, {0.85,0.85,0.85} -local msgColor, msgHighlightColor = '\255\180\180\180', '\255\215\215\215' -local metalColor, metalValueColor = '\255\233\233\233', '\255\255\255\255' -local energyColor, energyValueColor = '\255\255\255\180', '\255\255\255\140' -local chatSeparator, pointSeparator = '\255\210\210\210:', '\255\255\255\255*' -local colorSpecStr, colorAllyStr, colorOtherAllyStr, colorGameStr, colorConsoleStr = '', '', '', '', '' +local colorOther, colorAlly, colorSpec, colorSpecName = { 1, 1, 1 }, { 0, 1, 0 }, { 1, 1, 0 }, { 1, 1, 1 } +local colorOtherAlly, colorGame, colorConsole = { 1, 0.7, 0.45 }, { 0.4, 1, 1 }, { 0.85, 0.85, 0.85 } +local msgColor, msgHighlightColor = "\255\180\180\180", "\255\215\215\215" +local metalColor, metalValueColor = "\255\233\233\233", "\255\255\255\255" +local energyColor, energyValueColor = "\255\255\255\180", "\255\255\255\140" +local chatSeparator, pointSeparator = "\255\210\210\210:", "\255\255\255\255*" +local colorSpecStr, colorAllyStr, colorOtherAllyStr, colorGameStr, colorConsoleStr = "", "", "", "", "" -- Layout (keep local for performance) -local maxPlayernameWidth, lineSpaceWidth, backgroundPadding = 50, 24*config.widgetScale, usedFontSize -local longestPlayername = '(s) [xx]playername' +local maxPlayernameWidth, lineSpaceWidth, backgroundPadding = 50, 24 * config.widgetScale, usedFontSize +local longestPlayername = "(s) [xx]playername" -- State tables to reduce local variable count local state = { @@ -131,8 +131,8 @@ local state = { chatLines = {}, consoleLines = {}, ignoredAccounts = {}, - activationArea = {0,0,0,0}, - consoleActivationArea = {0,0,0,0}, + activationArea = { 0, 0, 0, 0 }, + consoleActivationArea = { 0, 0, 0, 0 }, currentChatLine = 0, currentConsoleLine = 0, historyMode = false, @@ -167,7 +167,7 @@ local state = { updateTextInputDlist = true, textCursorRect = nil, showTextInput = false, - inputText = '', + inputText = "", inputTextPosition = 0, inputSelectionStart = nil, cursorBlinkTimer = 0, @@ -185,7 +185,7 @@ local state = { -- Essential state aliases (heavily accessed - keep as locals) local I18N, orgLines, chatLines, consoleLines = state.I18N, state.orgLines, state.chatLines, state.consoleLines local activationArea, font = state.activationArea, state.font -local showTextInput, inputText, cursorBlinkTimer, cursorBlinkDuration = false, '', 0, 1 +local showTextInput, inputText, cursorBlinkTimer, cursorBlinkDuration = false, "", 0, 1 local inputSelectionStart = nil local inputMode, inputHistory, autocompleteWords, prevAutocompleteLetters = nil, {}, {}, nil local scrolling, playSound, sndChatFile, sndChatFileVolume = false, config.playSound, config.sndChatFile, config.sndChatFileVolume @@ -200,11 +200,10 @@ local prevGameID, prevOrgLines = state.prevGameID, state.prevOrgLines local ignoredAccounts = state.ignoredAccounts local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } -- Keep only essential locals for GL/Spring/strings (heavily used in loops) -local glPopMatrix, glPushMatrix, glDeleteList, glCreateList, glCallList, glTranslate, glColor = - gl.PopMatrix, gl.PushMatrix, gl.DeleteList, gl.CreateList, gl.CallList, gl.Translate, gl.Color +local glPopMatrix, glPushMatrix, glDeleteList, glCreateList, glCallList, glTranslate, glColor = gl.PopMatrix, gl.PushMatrix, gl.DeleteList, gl.CreateList, gl.CallList, gl.Translate, gl.Color local string_lines, schar, slen, ssub, sfind = string.lines, string.char, string.len, string.sub, string.find local math_isInRect, floor, clock = math.isInRect, mathFloor, os.clock local spGetTeamColor, spGetPlayerInfo, spPlaySoundFile = Spring.GetTeamColor, Spring.GetPlayerInfo, Spring.PlaySoundFile @@ -222,18 +221,18 @@ local function stripColorCodes(text) -- Remove color codes and control characters according to Spring's TextWrap.h: -- ColorCodeIndicator (0xFF / \255) - followed by 3 bytes RGB result = result:gsub("\255...", "") - result = result:gsub("\255", "") -- ÿ - result = result:gsub("ÿ", "") -- ÿ + result = result:gsub("\255", "") -- ÿ + result = result:gsub("ÿ", "") -- ÿ -- ColorCodeIndicatorEx (0xFE / \254) - followed by 8 bytes RGBA + outline RGBA result = result:gsub("\254........", "") - result = result:gsub("\254", "") -- þ - result = result:gsub("þ", "") -- þ + result = result:gsub("\254", "") -- þ + result = result:gsub("þ", "") -- þ -- ColorResetIndicator (0x08 / \008) - reset to default color result = result:gsub("\008", "") -- SetColorIndicator (0x01 / \001) - followed by 3 bytes RGB (legacy) result = result:gsub("\001...", "") -- Also strip any remaining standalone control characters that might affect rendering - result = result:gsub("\001", "") -- SOH + result = result:gsub("\001", "") -- SOH return result end @@ -241,7 +240,7 @@ end local function cleanupLineTable(prevTable, maxLines) local newTable = {} local start = #prevTable - maxLines - for i=1, maxLines do + for i = 1, maxLines do newTable[i] = prevTable[start + i] end return newTable @@ -249,253 +248,253 @@ end local autocompleteCommands = { -- engine - 'advmapshading', - 'aicontrol', - 'aikill', - 'ailist', - 'aireload', - 'airmesh', - 'allmapmarks', - 'ally', - 'atm', - 'buffertext', - 'chat', - 'chatall', - 'chatally', - 'chatspec', - 'cheat', - 'clearmapmarks', + "advmapshading", + "aicontrol", + "aikill", + "ailist", + "aireload", + "airmesh", + "allmapmarks", + "ally", + "atm", + "buffertext", + "chat", + "chatall", + "chatally", + "chatspec", + "cheat", + "clearmapmarks", --'clock', - 'cmdcolors', - 'commandhelp', - 'commandlist', - 'console', - 'controlunit', - 'crash', - 'createvideo', - 'cross', - 'ctrlpanel', - 'debug', - 'debugcolvol', - 'debugdrawai', - 'debuggl', - 'debugglerrors', - 'debuginfo', - 'debugpath', - 'debugtraceray', - 'decguiopacity', - 'decreaseviewradius', - 'deselect', - 'destroy', - 'devlua', - 'distdraw', - 'disticon', - 'divbyzero', - 'drawinmap', - 'drawlabel', - 'drawtrees', - 'dumpstate', - 'dynamicsky', - 'echo', - 'editdefs', - 'endgraph', - 'exception', - 'font', - 'fps', - 'fpshud', - 'fullscreen', - 'gameinfo', - 'gathermode', - 'give', - 'globallos', - 'godmode', - 'grabinput', - 'grounddecals', - 'grounddetail', - 'group', - 'group0', - 'group1', - 'group2', - 'group3', - 'group4', - 'group5', - 'group6', - 'group7', - 'group8', - 'group9', - 'hardwarecursor', - 'hideinterface', - 'incguiopacity', - 'increaseviewradius', - 'info', - 'inputtextgeo', - 'keyreload', - 'lastmsgpos', - 'lessclouds', - 'lesstrees', - 'lodscale', - 'luagaia', - 'luarules', - 'luasave', - 'luaui', - 'mapborder', - 'mapmarks', - 'mapmeshdrawer', - 'mapshadowpolyoffset', - 'maxnanoparticles', - 'maxparticles', - 'minimap', - 'moreclouds', - 'moretrees', - 'mouse1', - 'mouse2', - 'mouse3', - 'mouse4', - 'mouse5', - 'moveback', - 'movedown', - 'movefast', - 'moveforward', - 'moveleft', - 'moveright', - 'moveslow', - 'moveup', - 'mutesound', - 'nocost', - 'nohelp', - 'noluadraw', - 'nospecdraw', - 'nospectatorchat', - 'pastetext', - 'pause', - 'quitforce', - 'quitmenu', - 'quitmessage', - 'reloadcegs', - 'reloadcob', - 'reloadforce', - 'reloadgame', - 'reloadshaders', - 'reloadtextures', - 'resbar', - 'resync', - 'safegl', - 'save', - 'say', - 'screenshot', - 'select', - 'selectcycle', - 'selectunits', - 'send', - 'set', - 'shadows', - 'sharedialog', - 'showelevation', - 'showmetalmap', - 'showpathcost', - 'showpathflow', - 'showpathheat', - 'showpathtraversability', - 'showpathtype', - 'showstandard', - 'skip', - 'slowdown', - 'soundchannelenablec', - 'sounddevice', - 'specfullview', - 'spectator', - 'specteam', + "cmdcolors", + "commandhelp", + "commandlist", + "console", + "controlunit", + "crash", + "createvideo", + "cross", + "ctrlpanel", + "debug", + "debugcolvol", + "debugdrawai", + "debuggl", + "debugglerrors", + "debuginfo", + "debugpath", + "debugtraceray", + "decguiopacity", + "decreaseviewradius", + "deselect", + "destroy", + "devlua", + "distdraw", + "disticon", + "divbyzero", + "drawinmap", + "drawlabel", + "drawtrees", + "dumpstate", + "dynamicsky", + "echo", + "editdefs", + "endgraph", + "exception", + "font", + "fps", + "fpshud", + "fullscreen", + "gameinfo", + "gathermode", + "give", + "globallos", + "godmode", + "grabinput", + "grounddecals", + "grounddetail", + "group", + "group0", + "group1", + "group2", + "group3", + "group4", + "group5", + "group6", + "group7", + "group8", + "group9", + "hardwarecursor", + "hideinterface", + "incguiopacity", + "increaseviewradius", + "info", + "inputtextgeo", + "keyreload", + "lastmsgpos", + "lessclouds", + "lesstrees", + "lodscale", + "luagaia", + "luarules", + "luasave", + "luaui", + "mapborder", + "mapmarks", + "mapmeshdrawer", + "mapshadowpolyoffset", + "maxnanoparticles", + "maxparticles", + "minimap", + "moreclouds", + "moretrees", + "mouse1", + "mouse2", + "mouse3", + "mouse4", + "mouse5", + "moveback", + "movedown", + "movefast", + "moveforward", + "moveleft", + "moveright", + "moveslow", + "moveup", + "mutesound", + "nocost", + "nohelp", + "noluadraw", + "nospecdraw", + "nospectatorchat", + "pastetext", + "pause", + "quitforce", + "quitmenu", + "quitmessage", + "reloadcegs", + "reloadcob", + "reloadforce", + "reloadgame", + "reloadshaders", + "reloadtextures", + "resbar", + "resync", + "safegl", + "save", + "say", + "screenshot", + "select", + "selectcycle", + "selectunits", + "send", + "set", + "shadows", + "sharedialog", + "showelevation", + "showmetalmap", + "showpathcost", + "showpathflow", + "showpathheat", + "showpathtraversability", + "showpathtype", + "showstandard", + "skip", + "slowdown", + "soundchannelenablec", + "sounddevice", + "specfullview", + "spectator", + "specteam", --'speed', - 'speedcontrol', - 'speedup', - 'take', - 'team', - 'teamhighlight', - 'toggleinfo', - 'togglelos', - 'tooltip', - 'track', - 'trackmode', - 'trackoff', - 'tset', - 'viewselection', - 'vsync', - 'water', - 'wbynum', - 'wiremap', - 'wiremodel', - 'wiresky', - 'wiretree', - 'wirewater', - 'widgetselector', + "speedcontrol", + "speedup", + "take", + "team", + "teamhighlight", + "toggleinfo", + "togglelos", + "tooltip", + "track", + "trackmode", + "trackoff", + "tset", + "viewselection", + "vsync", + "water", + "wbynum", + "wiremap", + "wiremodel", + "wiresky", + "wiretree", + "wirewater", + "widgetselector", -- gadgets - 'luarules battleroyaledebug', - 'luarules buildicon', - 'luarules cmd', - 'luarules clearwrecks', - 'luarules reducewrecks', - 'luarules destroyunits', - 'luarules disablecusgl4', - 'luarules benchmark', - 'luarules give', - 'luarules givecat', - 'luarules halfhealth', - 'luarules kill_profiler', - 'luarules loadmissiles', - 'luarules profile', - 'luarules reclaimunits', - 'luarules reloadcus', - 'luarules reloadcusgl4', - 'luarules removeunits', - 'luarules removeunitdef', - 'luarules removenearbyunits', - 'luarules spawnceg', - 'luarules spawnunitexplosion', - 'luarules undo', - 'luarules unitcallinsgadget', - 'luarules updatesun', - 'luarules waterlevel', - 'luarules wreckunits', - 'luarules xp', - 'luarules transferunits', - 'luarules playertoteam', - 'luarules killteam', - 'luarules globallos', + "luarules battleroyaledebug", + "luarules buildicon", + "luarules cmd", + "luarules clearwrecks", + "luarules reducewrecks", + "luarules destroyunits", + "luarules disablecusgl4", + "luarules benchmark", + "luarules give", + "luarules givecat", + "luarules halfhealth", + "luarules kill_profiler", + "luarules loadmissiles", + "luarules profile", + "luarules reclaimunits", + "luarules reloadcus", + "luarules reloadcusgl4", + "luarules removeunits", + "luarules removeunitdef", + "luarules removenearbyunits", + "luarules spawnceg", + "luarules spawnunitexplosion", + "luarules undo", + "luarules unitcallinsgadget", + "luarules updatesun", + "luarules waterlevel", + "luarules wreckunits", + "luarules xp", + "luarules transferunits", + "luarules playertoteam", + "luarules killteam", + "luarules globallos", -- zombie commands - 'luarules zombiesetallgaia', - 'luarules zombiequeueallcorpses', - 'luarules zombieautospawn 0', - 'luarules zombieclearspawns', - 'luarules zombiepacify 0', - 'luarules zombiesuspendorders 0', - 'luarules zombieaggroteam 0', - 'luarules zombieaggroally 0', - 'luarules zombiekillall', - 'luarules zombieclearallorders', - 'luarules zombiedebug 0', - 'luarules zombiemode normal', + "luarules zombiesetallgaia", + "luarules zombiequeueallcorpses", + "luarules zombieautospawn 0", + "luarules zombieclearspawns", + "luarules zombiepacify 0", + "luarules zombiesuspendorders 0", + "luarules zombieaggroteam 0", + "luarules zombieaggroally 0", + "luarules zombiekillall", + "luarules zombieclearallorders", + "luarules zombiedebug 0", + "luarules zombiemode normal", -- build blocking commands - 'luarules buildblock all default_reason', - 'luarules buildunblock all default_reason', + "luarules buildblock all default_reason", + "luarules buildunblock all default_reason", -- widgets - 'luaui reload', - 'luaui disable', - 'luaui enable', - 'addmessage', - 'radarpulse', - 'ecostatstext', - 'defrange ally air', - 'defrange ally nuke', - 'defrange ally ground', - 'defrange enemy air', - 'defrange enemy nuke', - 'defrange enemy ground', - 'set_camera_anchor', - 'focus_camera_anchor', + "luaui reload", + "luaui disable", + "luaui enable", + "addmessage", + "radarpulse", + "ecostatstext", + "defrange ally air", + "defrange ally nuke", + "defrange ally ground", + "defrange enemy air", + "defrange enemy nuke", + "defrange enemy ground", + "set_camera_anchor", + "focus_camera_anchor", } local playernames = {} @@ -515,59 +514,59 @@ local function refreshUnitDefs() for unitDefID, unitDef in pairs(UnitDefs) do if not uniqueHumanNames[unitDef.translatedHumanName] then uniqueHumanNames[unitDef.translatedHumanName] = true - autocompleteUnitNames[#autocompleteUnitNames+1] = unitDef.translatedHumanName + autocompleteUnitNames[#autocompleteUnitNames + 1] = unitDef.translatedHumanName end if not string.find(unitDef.name, "_scav", nil, true) then - autocompleteUnitCodename[#autocompleteUnitCodename+1] = unitDef.name:lower() + autocompleteUnitCodename[#autocompleteUnitCodename + 1] = unitDef.name:lower() end unitTranslatedHumanName[unitDefID] = unitDef.translatedHumanName end uniqueHumanNames = nil for featureDefID, featureDef in pairs(FeatureDefs) do - autocompleteUnitCodename[#autocompleteUnitCodename+1] = featureDef.name:lower() + autocompleteUnitCodename[#autocompleteUnitCodename + 1] = featureDef.name:lower() end end function widget:LanguageChanged() I18N = { - energy = Spring.I18N('ui.topbar.resources.energy'):lower(), - metal = Spring.I18N('ui.topbar.resources.metal'):lower(), - everyone = Spring.I18N('ui.chat.everyone'), - allies = Spring.I18N('ui.chat.allies'), - spectators = Spring.I18N('ui.chat.spectators'), - cmd = Spring.I18N('ui.chat.cmd'), - shortcut = Spring.I18N('ui.chat.shortcut'), - nohistory = Spring.I18N('ui.chat.nohistory'), - scroll = Spring.I18N('ui.chat.scroll', { textColor = "\255\255\255\255", highlightColor = "\255\255\255\001" }), + energy = Spring.I18N("ui.topbar.resources.energy"):lower(), + metal = Spring.I18N("ui.topbar.resources.metal"):lower(), + everyone = Spring.I18N("ui.chat.everyone"), + allies = Spring.I18N("ui.chat.allies"), + spectators = Spring.I18N("ui.chat.spectators"), + cmd = Spring.I18N("ui.chat.cmd"), + shortcut = Spring.I18N("ui.chat.shortcut"), + nohistory = Spring.I18N("ui.chat.nohistory"), + scroll = Spring.I18N("ui.chat.scroll", { textColor = "\255\255\255\255", highlightColor = "\255\255\255\001" }), } refreshUnitDefs() -- Cache color strings after language change (optimization) if ColorString then - colorSpecStr = ColorString(colorSpec[1], colorSpec[2], colorSpec[3]) or '' - colorAllyStr = ColorString(colorAlly[1], colorAlly[2], colorAlly[3]) or '' - colorOtherAllyStr = ColorString(colorOtherAlly[1], colorOtherAlly[2], colorOtherAlly[3]) or '' - colorGameStr = ColorString(colorGame[1], colorGame[2], colorGame[3]) or '' - colorConsoleStr = ColorString(colorConsole[1], colorConsole[2], colorConsole[3]) or '' + colorSpecStr = ColorString(colorSpec[1], colorSpec[2], colorSpec[3]) or "" + colorAllyStr = ColorString(colorAlly[1], colorAlly[2], colorAlly[3]) or "" + colorOtherAllyStr = ColorString(colorOtherAlly[1], colorOtherAlly[2], colorOtherAlly[3]) or "" + colorGameStr = ColorString(colorGame[1], colorGame[2], colorGame[3]) or "" + colorConsoleStr = ColorString(colorConsole[1], colorConsole[2], colorConsole[3]) or "" else - colorSpecStr = '' - colorAllyStr = '' - colorOtherAllyStr = '' - colorGameStr = '' - colorConsoleStr = '' + colorSpecStr = "" + colorAllyStr = "" + colorOtherAllyStr = "" + colorGameStr = "" + colorConsoleStr = "" end end widget:LanguageChanged() local function getAIName(teamID) local _, _, _, name, _, options = Spring.GetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) if niceName then name = niceName if Spring.Utilities.ShowDevUI() and options.profile then name = name .. " [" .. options.profile .. "]" end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return Spring.I18N("ui.playersList.aiName", { name = name }) end local lastMessage @@ -589,20 +588,20 @@ local function wordWrap(text, maxWidth, fontSize) for _, line in ipairs(text) do local words = {} local wordsCount = 0 - local linebuffer = '' + local linebuffer = "" for w in line:gmatch("%S+") do wordsCount = wordsCount + 1 words[wordsCount] = w end for _, word in ipairs(words) do - if font and font:GetTextWidth(linebuffer..' '..word)*fontSize > maxWidth then + if font and font:GetTextWidth(linebuffer .. " " .. word) * fontSize > maxWidth then lineCount = lineCount + 1 lines[lineCount] = linebuffer - linebuffer = '' + linebuffer = "" end - linebuffer = (linebuffer ~= '' and linebuffer..' '..word or word) + linebuffer = (linebuffer ~= "" and linebuffer .. " " .. word or word) end - if linebuffer ~= '' then + if linebuffer ~= "" then lineCount = lineCount + 1 lines[lineCount] = linebuffer end @@ -611,9 +610,11 @@ local function wordWrap(text, maxWidth, fontSize) end local function addConsoleLine(gameFrame, lineType, text, orgLineID, consoleLineID) - if not text or text == '' then return end + if not text or text == "" then + return + end - consoleLineID = consoleLineID and consoleLineID or #consoleLines+1 + consoleLineID = consoleLineID and consoleLineID or #consoleLines + 1 -- convert /n into lines local textLines = string_lines(text) @@ -621,14 +622,14 @@ local function addConsoleLine(gameFrame, lineType, text, orgLineID, consoleLineI -- word wrap text into lines local wordwrappedText = wordWrap(textLines, consoleLineMaxWidth, usedConsoleFontSize) - local lineColor = #wordwrappedText > 1 and ssub(wordwrappedText[1], 1, 4) or '' + local lineColor = #wordwrappedText > 1 and ssub(wordwrappedText[1], 1, 4) or "" local startTime = clock() for i, line in ipairs(wordwrappedText) do consoleLines[consoleLineID] = { startTime = startTime, gameFrame = i == 1 and gameFrame, lineType = lineType, - text = (i > 1 and lineColor or '')..line, + text = (i > 1 and lineColor or "") .. line, orgLineID = orgLineID, --lineDisplayList = glCreateList(function() end), --timeDisplayList = glCreateList(function() end), @@ -636,14 +637,14 @@ local function addConsoleLine(gameFrame, lineType, text, orgLineID, consoleLineI consoleLineID = consoleLineID + 1 end - if historyMode ~= 'console' then + if historyMode ~= "console" then currentConsoleLine = consoleLineID end end local function getPlayerColorString(playername, gameFrame) if not ColorString then - return '' + return "" end local color if playernames[playername] then @@ -659,7 +660,7 @@ local function getPlayerColorString(playername, gameFrame) else color = ColorString(0.7, 0.7, 0.7) end - return color or '' + return color or "" end local function setCurrentChatLine(line) @@ -678,12 +679,16 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, if not noProcessors then for _, processor in pairs(chatProcessors) do - if text == nil then break end + if text == nil then + break + end text = processor(gameFrame, lineType, name, nameText, text, orgLineID, ignore, chatLineID) end end - if not text or text == '' then return end + if not text or text == "" then + return + end -- determine text typing start time local startTime = clock() @@ -691,43 +696,45 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, local text_orig = text -- metal/energy given - if lineType == LineTypes.Player and ssub(text, 5, 6) == '> ' then + if lineType == LineTypes.Player and ssub(text, 5, 6) == "> " then text = ssub(text, 7) lineType = LineTypes.System - local params = string.split(text, ':') + local params = string.split(text, ":") local t = {} if params[1] then - for k,v in pairs(params) do + for k, v in pairs(params) do if k > 1 then - local pair = string.split(v, '=') + local pair = string.split(v, "=") if pair[2] then if playernames[pair[2]] then - t[ pair[1] ] = getPlayerColorString(pair[2], gameFrame)..playernames[pair[2]][7]..msgColor - elseif params[1]:lower():find('energy', nil, true) then - t[ pair[1] ] = energyValueColor..pair[2]..msgColor - elseif params[1]:lower():find('metal', nil, true) then - t[ pair[1] ] = metalValueColor..pair[2]..msgColor + t[pair[1]] = getPlayerColorString(pair[2], gameFrame) .. playernames[pair[2]][7] .. msgColor + elseif params[1]:lower():find("energy", nil, true) then + t[pair[1]] = energyValueColor .. pair[2] .. msgColor + elseif params[1]:lower():find("metal", nil, true) then + t[pair[1]] = metalValueColor .. pair[2] .. msgColor else - t[ pair[1] ] = pair[2] + t[pair[1]] = pair[2] end end end end text = Spring.I18N(params[1], t) -- Fix a widget crash that could occur with message "> ." - if type(text) ~= "string" then text = text_orig end + if type(text) ~= "string" then + text = text_orig + end if text:lower():find(I18N.energy, nil, true) then local pos = text:lower():find(I18N.energy, nil, true) local len = slen(I18N.energy) - text = ssub(text, 1, pos-1)..energyColor..ssub(text, pos, pos+len-1).. msgColor..ssub(text, pos+len) + text = ssub(text, 1, pos - 1) .. energyColor .. ssub(text, pos, pos + len - 1) .. msgColor .. ssub(text, pos + len) end if text:lower():find(I18N.metal, nil, true) then local pos = text:lower():find(I18N.metal, nil, true) local len = slen(I18N.metal) - text = ssub(text, 1, pos-1)..metalColor..ssub(text, pos, pos+len-1).. msgColor..ssub(text, pos+len) + text = ssub(text, 1, pos - 1) .. metalColor .. ssub(text, pos, pos + len - 1) .. msgColor .. ssub(text, pos + len) end end - text = msgColor..text + text = msgColor .. text end -- convert /n into lines @@ -736,7 +743,7 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, -- word wrap text into lines local wordwrappedText = wordWrap(textLines, lineMaxWidth, usedFontSize) - local lineColor = #wordwrappedText > 1 and ssub(wordwrappedText[1], 1, 4) or '' + local lineColor = #wordwrappedText > 1 and ssub(wordwrappedText[1], 1, 4) or "" for i, line in ipairs(wordwrappedText) do chatLines[chatLineID] = { startTime = startTime, @@ -745,7 +752,7 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, playerName = name, playerNameText = nameText, textOutline = (lineType ~= LineTypes.Spectator and (playernames[name] and playernames[name][5]) and ColorIsDark(playernames[name][5][1], playernames[name][5][2], playernames[name][5][3])) or false, - text = (i > 1 and lineColor or '')..line, + text = (i > 1 and lineColor or "") .. line, orgLineID = orgLineID, ignore = ignore, --lineDisplayList = glCreateList(function() end), @@ -765,13 +772,13 @@ local function addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, chatLineID = chatLineID + 1 end - if historyMode ~= 'chat' and not ignore then + if historyMode ~= "chat" and not ignore then setCurrentChatLine(#chatLines) end -- play sound for new player/spectator chat if not ignore and #orgLines == orgLineID and (lineType == LineTypes.Player or lineType == LineTypes.Spectator) and playSound and not Spring.IsGUIHidden() then - spPlaySoundFile( sndChatFile, sndChatFileVolume, nil, "ui" ) + spPlaySoundFile(sndChatFile, sndChatFileVolume, nil, "ui") end end @@ -781,36 +788,36 @@ local function cancelChatInput() historyMode = false setCurrentChatLine(#chatLines) end - inputText = '' + inputText = "" inputTextPosition = 0 inputSelectionStart = nil inputTextInsertActive = false inputHistoryCurrent = #inputHistory autocompleteText = nil autocompleteWords = {} - if WG['guishader'] then - WG['guishader'].RemoveRect('chatinput') - WG['guishader'].RemoveRect('chatinputautocomplete') + if WG["guishader"] then + WG["guishader"].RemoveRect("chatinput") + WG["guishader"].RemoveRect("chatinputautocomplete") end Spring.SDLStopTextInput() - widgetHandler.textOwner = nil -- non handler = true: widgetHandler:DisownText() + widgetHandler.textOwner = nil -- non handler = true: widgetHandler:DisownText() updateDrawUi = true end local function ensureInputHistoryDraft() - if #inputHistory == 0 or inputHistory[#inputHistory] ~= '' then - inputHistory[#inputHistory + 1] = '' + if #inputHistory == 0 or inputHistory[#inputHistory] ~= "" then + inputHistory[#inputHistory + 1] = "" end inputHistoryCurrent = #inputHistory end local function commitInputHistory(text) - if not text or text == '' then + if not text or text == "" then ensureInputHistoryDraft() return end - if #inputHistory > 0 and inputHistory[#inputHistory] == '' then + if #inputHistory > 0 and inputHistory[#inputHistory] == "" then table.remove(inputHistory, #inputHistory) end @@ -822,7 +829,7 @@ local function commitInputHistory(text) end inputHistory[#inputHistory + 1] = text - inputHistory[#inputHistory + 1] = '' + inputHistory[#inputHistory + 1] = "" inputHistoryCurrent = #inputHistory end @@ -866,7 +873,7 @@ end -- Helper function to clean user text input local function cleanUserText(text) -- Filter occasional starting space - if ssub(text, 1, 1) == ' ' then + if ssub(text, 1, 1) == " " then text = ssub(text, 2) end -- Filter color codes from user input @@ -876,19 +883,19 @@ end -- Helper function to check if spectator messages should be hidden local function shouldHideSpecMessage() -- Check config values directly to ensure we have the latest settings - local currentHideSpecChat = (Spring.GetConfigInt('HideSpecChat', 0) == 1) - local currentHideSpecChatPlayer = (Spring.GetConfigInt('HideSpecChatPlayer', 1) == 1) + local currentHideSpecChat = (Spring.GetConfigInt("HideSpecChat", 0) == 1) + local currentHideSpecChatPlayer = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1) return currentHideSpecChat and (not currentHideSpecChatPlayer or not mySpec) end -- Helper function to extract channel prefix and apply color local function extractChannelPrefix(text) - if sfind(text, 'Allies: ', nil, true) == 1 then - return ssub(text, 9), 'allies' - elseif sfind(text, 'Spectators: ', nil, true) == 1 then - return ssub(text, 13), 'spectators' + if sfind(text, "Allies: ", nil, true) == 1 then + return ssub(text, 9), "allies" + elseif sfind(text, "Spectators: ", nil, true) == 1 then + return ssub(text, 13), "spectators" end - return text, 'all' + return text, "all" end -- Helper function to get colored player name @@ -918,9 +925,9 @@ local function getColoredPlayerName(name, gameFrame, isSpectator) teamColor = ColorString(formerTeamColor[1], formerTeamColor[2], formerTeamColor[3]) or colorSpecStr end end - return teamColor .. '■ ' .. colorSpecStr .. '(s) ' .. displayName + return teamColor .. "■ " .. colorSpecStr .. "(s) " .. displayName end - return colorSpecStr .. '(s) ' .. displayName + return colorSpecStr .. "(s) " .. displayName end return getPlayerColorString(name, gameFrame) .. displayName end @@ -936,27 +943,27 @@ end local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) local orgLine = line - local name = '' - local nameText = '' - local text = '' + local name = "" + local nameText = "" + local text = "" local lineType = 0 local bypassThisMessage = false local skipThisMessage = false local textcolor, c -- player message - if playernames[ssub(line,2,(sfind(line,"> ", nil, true) or 1)-1)] ~= nil then + if playernames[ssub(line, 2, (sfind(line, "> ", nil, true) or 1) - 1)] ~= nil then lineType = LineTypes.Player - name = ssub(line,2,sfind(line,"> ", nil, true)-1) - text = ssub(line,slen(name)+4) + name = ssub(line, 2, sfind(line, "> ", nil, true) - 1) + text = ssub(line, slen(name) + 4) local channel text, channel = extractChannelPrefix(text) text = cleanUserText(text) - if channel == 'allies' then + if channel == "allies" then c = playernames[name][1] == myAllyTeamID and colorAllyStr or colorOtherAllyStr - elseif channel == 'spectators' then + elseif channel == "spectators" then c = colorSpecStr else c = ColorString(colorOther[1], colorOther[2], colorOther[3]) @@ -966,14 +973,14 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) line = c .. text -- spectator message - elseif playernames[ssub(line,2,(sfind(line,"] ", nil, true) or 1)-1)] ~= nil or playernames[ssub(line,2,(sfind(line," (replay)] ", nil, true) or 1)-1)] ~= nil then + elseif playernames[ssub(line, 2, (sfind(line, "] ", nil, true) or 1) - 1)] ~= nil or playernames[ssub(line, 2, (sfind(line, " (replay)] ", nil, true) or 1) - 1)] ~= nil then lineType = LineTypes.Spectator - if playernames[ssub(line,2,(sfind(line,"] ", nil, true) or 1)-1)] ~= nil then - name = ssub(line,2,sfind(line,"] ", nil, true)-1) - text = ssub(line,slen(name)+4) + if playernames[ssub(line, 2, (sfind(line, "] ", nil, true) or 1) - 1)] ~= nil then + name = ssub(line, 2, sfind(line, "] ", nil, true) - 1) + text = ssub(line, slen(name) + 4) else - name = ssub(line,2,sfind(line," (replay)] ", nil, true)-1) - text = ssub(line,slen(name)+13) + name = ssub(line, 2, sfind(line, " (replay)] ", nil, true) - 1) + text = ssub(line, slen(name) + 13) end skipThisMessage = shouldHideSpecMessage() @@ -981,20 +988,20 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) local channel text, channel = extractChannelPrefix(text) text = cleanUserText(text) - c = (channel ~= 'all') and colorSpecStr or ColorString(colorOther[1], colorOther[2], colorOther[3]) + c = (channel ~= "all") and colorSpecStr or ColorString(colorOther[1], colorOther[2], colorOther[3]) nameText = getColoredPlayerName(name, gameFrame, true) line = c .. text -- point - elseif playernames[ssub(line,1,(sfind(line," added point: ", nil, true) or 1)-1)] ~= nil then + elseif playernames[ssub(line, 1, (sfind(line, " added point: ", nil, true) or 1) - 1)] ~= nil then lineType = LineTypes.Mapmark - name = ssub(line,1,sfind(line," added point: ", nil, true)-1) - text = ssub(line,slen(name.." added point: ")+1) + name = ssub(line, 1, sfind(line, " added point: ", nil, true) - 1) + text = ssub(line, slen(name .. " added point: ") + 1) text = cleanUserText(text) - if text == '' then - text = 'Look here!' + if text == "" then + text = "Look here!" end local spectator = playernames[name] and playernames[name][2] or false @@ -1009,14 +1016,14 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) line = textcolor .. text -- battleroom message - elseif ssub(line,1,1) == ">" then + elseif ssub(line, 1, 1) == ">" then lineType = LineTypes.Spectator - text = ssub(line,3) - if ssub(line,1,3) == "> <" then -- player speaking in battleroom - local i = sfind(ssub(line,4,slen(line)), ">", nil, true) + text = ssub(line, 3) + if ssub(line, 1, 3) == "> <" then -- player speaking in battleroom + local i = sfind(ssub(line, 4, slen(line)), ">", nil, true) if i then - name = ssub(line,4,i+2) - text = ssub(line,i+5) + name = ssub(line, 4, i + 2) + text = ssub(line, i + 5) else name = "unknown " end @@ -1028,11 +1035,11 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) skipThisMessage = hideSpecChat and (not playernames[name] or spectator) and (not hideSpecChatPlayer or not mySpec) text = cleanUserText(text) - nameText = colorGameStr .. '<' .. (playernames[name] and playernames[name][7] or name) .. '>' + nameText = colorGameStr .. "<" .. (playernames[name] and playernames[name][7] or name) .. ">" line = colorGameStr .. text -- units given - elseif playernames[ssub(line,1,(sfind(line," shared units to ", nil, true) or 1)-1)] ~= nil then + elseif playernames[ssub(line, 1, (sfind(line, " shared units to ", nil, true) or 1) - 1)] ~= nil then lineType = LineTypes.System -- Player1 shared units to Player2: 5 Wind Turbine @@ -1040,11 +1047,11 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) local oldTeamName, newTeamName, shareDesc = string.match(line, format) -- shared 5 Wind Turbine to Player2 - if newTeamName and newTeamName ~= '' and shareDesc and shareDesc ~= '' then + if newTeamName and newTeamName ~= "" and shareDesc and shareDesc ~= "" then local displayName = (playernames[newTeamName] and playernames[newTeamName][7]) or newTeamName - text = msgColor .. Spring.I18N('ui.unitShare.shared', { + text = msgColor .. Spring.I18N("ui.unitShare.shared", { units = msgHighlightColor .. shareDesc .. msgColor, - name = getPlayerColorString(newTeamName, gameFrame) .. displayName + name = getPlayerColorString(newTeamName, gameFrame) .. displayName, }) end @@ -1054,7 +1061,7 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) -- console chat else lineType = LineTypes.Console - local lineColor = '' + local lineColor = "" -- Define bypass patterns to avoid repetitive checks local bypassPatterns = { @@ -1073,7 +1080,7 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) "-> Version", "ClientReadNet", "Address", - 'self%-destruct in ', + "self%-destruct in ", } -- Check bypass patterns @@ -1085,78 +1092,78 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) end if not bypassThisMessage then - if sfind(line,"server=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") or sfind(line,"client=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") then + if sfind(line, "server=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") or sfind(line, "client=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") then bypassThisMessage = true - elseif sfind(line,"could not load sound", nil, true) then + elseif sfind(line, "could not load sound", nil, true) then if soundErrors[line] or #soundErrors > soundErrorsLimit then bypassThisMessage = true else soundErrors[line] = true end - elseif gameOver and sfind(line,'left the game', nil, true) then + elseif gameOver and sfind(line, "left the game", nil, true) then bypassThisMessage = true - elseif ssub(line,1,6) == "[i18n]" or ssub(line,1,6) == "[Font]" then + elseif ssub(line, 1, 6) == "[i18n]" or ssub(line, 1, 6) == "[Font]" then lineColor = msgColor - elseif sfind(line,"Wrong network version", nil, true) then - local n = sfind(line,"Message", nil, true) + elseif sfind(line, "Wrong network version", nil, true) then + local n = sfind(line, "Message", nil, true) if n then - line = ssub(line,1,n-3) + line = ssub(line, 1, n - 3) end - elseif sfind(line,' paused the game', nil, true) then - lineColor = '\255\225\225\255' - local playername = ssub(line, 1, sfind(line, ' paused the game', nil, true)-1) - line = formatSystemMessage('ui.chat.pausedthegame', playername, gameFrame, lineColor) - elseif sfind(line,' unpaused the game', nil, true) then - lineColor = '\255\225\255\225' - local playername = ssub(line, 1, sfind(line, ' unpaused the game', nil, true)-1) - line = formatSystemMessage('ui.chat.unpausedthegame', playername, gameFrame, lineColor) - elseif sfind(line,'Sync error for', nil, true) then - local playername = ssub(line, 16, sfind(line, ' in frame', nil, true)-1) - lineColor = (playernames[playername] and not playernames[playername][2]) and '\255\255\133\133' or '\255\255\200\200' - line = formatSystemMessage('ui.chat.syncerrorfor', playername, gameFrame, lineColor) - elseif sfind(line,' is lagging behind', nil, true) then - local playername = ssub(line, 1, sfind(line, ' is lagging behind', nil, true)-1) - lineColor = (playernames[playername] and not playernames[playername][2]) and '\255\255\133\133' or '\255\255\200\200' - line = formatSystemMessage('ui.chat.laggingbehind', playername, gameFrame, lineColor) - elseif sfind(line,'Connection attempt from ', nil, true) then + elseif sfind(line, " paused the game", nil, true) then + lineColor = "\255\225\225\255" + local playername = ssub(line, 1, sfind(line, " paused the game", nil, true) - 1) + line = formatSystemMessage("ui.chat.pausedthegame", playername, gameFrame, lineColor) + elseif sfind(line, " unpaused the game", nil, true) then + lineColor = "\255\225\255\225" + local playername = ssub(line, 1, sfind(line, " unpaused the game", nil, true) - 1) + line = formatSystemMessage("ui.chat.unpausedthegame", playername, gameFrame, lineColor) + elseif sfind(line, "Sync error for", nil, true) then + local playername = ssub(line, 16, sfind(line, " in frame", nil, true) - 1) + lineColor = (playernames[playername] and not playernames[playername][2]) and "\255\255\133\133" or "\255\255\200\200" + line = formatSystemMessage("ui.chat.syncerrorfor", playername, gameFrame, lineColor) + elseif sfind(line, " is lagging behind", nil, true) then + local playername = ssub(line, 1, sfind(line, " is lagging behind", nil, true) - 1) + lineColor = (playernames[playername] and not playernames[playername][2]) and "\255\255\133\133" or "\255\255\200\200" + line = formatSystemMessage("ui.chat.laggingbehind", playername, gameFrame, lineColor) + elseif sfind(line, "Connection attempt from ", nil, true) then lineColor = msgHighlightColor - local startPos, endPos = sfind(line, 'Connection attempt from ', nil, true) + local startPos, endPos = sfind(line, "Connection attempt from ", nil, true) local playername = ssub(line, endPos + 1) - local spectator = (playernames[playername] and playernames[playername][2]) and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' + local spectator = (playernames[playername] and playernames[playername][2]) and msgColor .. " (" .. Spring.I18N("ui.chat.spectator") .. ")" or "" -- Format message and append spectator suffix if needed local params = { textColor = lineColor, textColor2 = msgColor } params.name = getPlayerColorString(playername, gameFrame) .. playername .. spectator - line = Spring.I18N('ui.chat.connectionattemptfrom', params) - elseif sfind(line,'left the game: normal quit', nil, true) then - local isSpec = sfind(line,'Spectator', nil, true) - local playername = ssub(line, isSpec and 11 or 8, sfind(line, ' left the game', nil, true)-1) - lineColor = isSpec and msgHighlightColor or '\255\255\133\133' - local spectator = isSpec and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' - line = formatSystemMessage('ui.chat.leftthegamenormal', playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) - if spectator ~= '' then + line = Spring.I18N("ui.chat.connectionattemptfrom", params) + elseif sfind(line, "left the game: normal quit", nil, true) then + local isSpec = sfind(line, "Spectator", nil, true) + local playername = ssub(line, isSpec and 11 or 8, sfind(line, " left the game", nil, true) - 1) + lineColor = isSpec and msgHighlightColor or "\255\255\133\133" + local spectator = isSpec and msgColor .. " (" .. Spring.I18N("ui.chat.spectator") .. ")" or "" + line = formatSystemMessage("ui.chat.leftthegamenormal", playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) + if spectator ~= "" then -- Append spectator suffix - line = line .. spectator:gsub(getPlayerColorString(playername, gameFrame) .. playername, '') + line = line .. spectator:gsub(getPlayerColorString(playername, gameFrame) .. playername, "") end - elseif sfind(line,'left the game: timeout', nil, true) then - local isSpec = sfind(line,'Spectator', nil, true) - local playername = ssub(line, isSpec and 11 or 8, sfind(line, ' left the game', nil, true)-1) - lineColor = isSpec and msgHighlightColor or '\255\255\133\133' - local spectator = isSpec and msgColor..' ('..Spring.I18N('ui.chat.spectator')..')' or '' - line = formatSystemMessage('ui.chat.leftthegametimeout', playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) - if spectator ~= '' then + elseif sfind(line, "left the game: timeout", nil, true) then + local isSpec = sfind(line, "Spectator", nil, true) + local playername = ssub(line, isSpec and 11 or 8, sfind(line, " left the game", nil, true) - 1) + lineColor = isSpec and msgHighlightColor or "\255\255\133\133" + local spectator = isSpec and msgColor .. " (" .. Spring.I18N("ui.chat.spectator") .. ")" or "" + line = formatSystemMessage("ui.chat.leftthegametimeout", playername, gameFrame, lineColor, { textColor2 = isSpec and msgColor or lineColor }) + if spectator ~= "" then -- Append spectator suffix - line = line .. spectator:gsub(getPlayerColorString(playername, gameFrame) .. playername, '') + line = line .. spectator:gsub(getPlayerColorString(playername, gameFrame) .. playername, "") end - elseif sfind(line,'Error', nil, true) then - lineColor = '\255\255\133\133' - elseif sfind(line,'Warning', nil, true) then - lineColor = '\255\255\190\170' - elseif sfind(line,'Failed to load', nil, true) then - lineColor = '\255\200\200\255' - elseif sfind(line,'Loaded ', nil, true) or sfind(ssub(line, 1, 25),'Loading ', nil, true) or sfind(ssub(line, 1, 25),'Loading: ', nil, true) then - lineColor = '\255\200\255\200' - elseif sfind(line,'Removed: ', nil, true) or sfind(line,'Removed widget: ', nil, true) then - lineColor = '\255\255\230\200' + elseif sfind(line, "Error", nil, true) then + lineColor = "\255\255\133\133" + elseif sfind(line, "Warning", nil, true) then + lineColor = "\255\255\190\170" + elseif sfind(line, "Failed to load", nil, true) then + lineColor = "\255\200\200\255" + elseif sfind(line, "Loaded ", nil, true) or sfind(ssub(line, 1, 25), "Loading ", nil, true) or sfind(ssub(line, 1, 25), "Loading: ", nil, true) then + lineColor = "\255\200\255\200" + elseif sfind(line, "Removed: ", nil, true) or sfind(line, "Removed widget: ", nil, true) then + lineColor = "\255\255\230\200" end end @@ -1165,17 +1172,17 @@ local function processAddConsoleLine(gameFrame, line, orgLineID, reprocessID) if not bypassThisMessage then -- bot command or player ID message - if (ssub(text,1,1) == '!' and ssub(text, 1,2) ~= '!!') or sfind(line, 'My player ID is', nil, true) then + if (ssub(text, 1, 1) == "!" and ssub(text, 1, 2) ~= "!!") or sfind(line, "My player ID is", nil, true) then bypassThisMessage = true end - if not bypassThisMessage and line ~= '' then - if name ~= '' and ignoredAccounts[name] then + if not bypassThisMessage and line ~= "" then + if name ~= "" and ignoredAccounts[name] then skipThisMessage = true end if not orgLineID then - orgLineID = #orgLines+1 - orgLines[orgLineID] = {gameFrame, orgLine} + orgLineID = #orgLines + 1 + orgLines[orgLineID] = { gameFrame, orgLine } -- if your name has been mentioned, pass it on if lineType > 0 and WG.logo and sfind(text, myName, nil, true) then WG.logo.mention() @@ -1200,11 +1207,11 @@ local function addLastUnitShareMessage() if oldTeamName and newTeamName then local shareDescription = commonUnitName(unitShare.unitIDs) if #unitShare.unitIDs > 1 then - shareDescription = #unitShare.unitIDs .. ' ' .. shareDescription + shareDescription = #unitShare.unitIDs .. " " .. shareDescription end -- Player1 shared units to Player2: 5 Wind Turbine lastLineUnitShare = unitShare - local line = oldTeamName .. ' shared units to ' .. newTeamName .. ': ' .. shareDescription + local line = oldTeamName .. " shared units to " .. newTeamName .. ": " .. shareDescription spEcho(line) end end @@ -1229,13 +1236,13 @@ function widget:UnitTaken(unitID, _, oldTeamID, newTeamID) end -- I think it's possible for multiple teams to share in the same frame? - local key = oldTeamID .. 'to' .. newTeamID + local key = oldTeamID .. "to" .. newTeamID if not lastUnitShare[key] then lastUnitShare[key] = { oldTeamID = oldTeamID, newTeamID = newTeamID, - unitIDs = {} + unitIDs = {}, } end lastUnitShare[key].unitIDs[#lastUnitShare[key].unitIDs + 1] = unitID @@ -1243,26 +1250,26 @@ end drawGameTime = function(gameFrame) local minutes = floor((gameFrame / 30 / 60)) - local seconds = floor((gameFrame - ((minutes*60)*30)) / 30) + local seconds = floor((gameFrame - ((minutes * 60) * 30)) / 30) if seconds == 0 then - seconds = '00' + seconds = "00" elseif seconds < 10 then - seconds = '0'..seconds + seconds = "0" .. seconds end local offset = 0 if minutes >= 100 then - offset = (usedFontSize*0.2*widgetScale) + offset = (usedFontSize * 0.2 * widgetScale) end font3:Begin(true) - font3:SetOutlineColor(0,0,0,1) - font3:Print('\255\200\200\200'..minutes..':'..seconds, maxTimeWidth+offset, usedFontSize*0.3, usedFontSize*0.82, "ro") + font3:SetOutlineColor(0, 0, 0, 1) + font3:Print("\255\200\200\200" .. minutes .. ":" .. seconds, maxTimeWidth + offset, usedFontSize * 0.3, usedFontSize * 0.82, "ro") font3:End() end drawConsoleLine = function(i) font:Begin(true) - font:SetOutlineColor(0,0,0,1) - font:Print(consoleLines[i].text, 0, usedFontSize*0.3, usedConsoleFontSize, "o") + font:SetOutlineColor(0, 0, 0, 1) + font:Print(consoleLines[i].text, 0, usedFontSize * 0.3, usedConsoleFontSize, "o") font:End() end @@ -1283,50 +1290,50 @@ local function processConsoleLineGL(i) end drawChatLine = function(i) - local fontHeightOffset = usedFontSize*0.3 + local fontHeightOffset = usedFontSize * 0.3 font:Begin(true) if chatLines[i].gameFrame then if chatLines[i].lineType == LineTypes.Mapmark then font2:Begin(true) if chatLines[i].textOutline then - font2:SetOutlineColor(1,1,1,1) + font2:SetOutlineColor(1, 1, 1, 1) else - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) end - font2:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset*1.06, usedFontSize*1.03, "or") + font2:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset * 1.06, usedFontSize * 1.03, "or") font2:End() - font2:SetOutlineColor(0,0,0,1) - font2:Print(pointSeparator, maxPlayernameWidth+(lineSpaceWidth/2), fontHeightOffset*0.07, usedFontSize, "oc") + font2:SetOutlineColor(0, 0, 0, 1) + font2:Print(pointSeparator, maxPlayernameWidth + (lineSpaceWidth / 2), fontHeightOffset * 0.07, usedFontSize, "oc") elseif chatLines[i].lineType == LineTypes.System then -- sharing resources, taken player font3:Begin(true) if chatLines[i].textOutline then - font3:SetOutlineColor(1,1,1,1) + font3:SetOutlineColor(1, 1, 1, 1) else - font3:SetOutlineColor(0,0,0,1) + font3:SetOutlineColor(0, 0, 0, 1) end - font3:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset*1.2, usedFontSize*0.9, "or") + font3:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset * 1.2, usedFontSize * 0.9, "or") font3:End() else font2:Begin(true) if chatLines[i].textOutline then - font2:SetOutlineColor(1,1,1,1) + font2:SetOutlineColor(1, 1, 1, 1) else - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) end - font2:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset*1.06, usedFontSize*1.03, "or") + font2:Print(chatLines[i].playerNameText, maxPlayernameWidth, fontHeightOffset * 1.06, usedFontSize * 1.03, "or") font2:End() - font:SetOutlineColor(0,0,0,1) - font:Print(chatSeparator, maxPlayernameWidth+(lineSpaceWidth/3.75), fontHeightOffset, usedFontSize, "oc") + font:SetOutlineColor(0, 0, 0, 1) + font:Print(chatSeparator, maxPlayernameWidth + (lineSpaceWidth / 3.75), fontHeightOffset, usedFontSize, "oc") end end if chatLines[i].lineType == LineTypes.System then -- sharing resources, taken player font3:Begin(true) - font3:SetOutlineColor(0,0,0,1) - font3:Print(chatLines[i].text, maxPlayernameWidth+lineSpaceWidth-(usedFontSize*0.5), fontHeightOffset*1.2, usedFontSize*0.88, "o") + font3:SetOutlineColor(0, 0, 0, 1) + font3:Print(chatLines[i].text, maxPlayernameWidth + lineSpaceWidth - (usedFontSize * 0.5), fontHeightOffset * 1.2, usedFontSize * 0.88, "o") font3:End() else - font:SetOutlineColor(0,0,0,1) - font:Print(chatLines[i].text, maxPlayernameWidth+lineSpaceWidth, fontHeightOffset, usedFontSize, "o") + font:SetOutlineColor(0, 0, 0, 1) + font:Print(chatLines[i].text, maxPlayernameWidth + lineSpaceWidth, fontHeightOffset, usedFontSize, "o") end font:End() end @@ -1352,7 +1359,9 @@ function widget:Update(dt) addLastUnitShareMessage() cursorBlinkTimer = cursorBlinkTimer + dt - if cursorBlinkTimer > cursorBlinkDuration then cursorBlinkTimer = 0 end + if cursorBlinkTimer > cursorBlinkDuration then + cursorBlinkTimer = 0 + end uiSec = uiSec + dt if uiSec > 1 then @@ -1380,8 +1389,8 @@ function widget:Update(dt) local teams = Spring.GetTeamList() for i = 1, #teams do local r, g, b = spGetTeamColor(teams[i]) - if teamColorKeys[teams[i]] ~= r..'_'..g..'_'..b then - teamColorKeys[teams[i]] = r..'_'..g..'_'..b + if teamColorKeys[teams[i]] ~= r .. "_" .. g .. "_" .. b then + teamColorKeys[teams[i]] = r .. "_" .. g .. "_" .. b changeDetected = true for _, playerID in ipairs(Spring.GetPlayerList(teams[i])) do local name = spGetPlayerInfo(playerID, false) @@ -1394,7 +1403,7 @@ function widget:Update(dt) -- unhide chats from players that used to be ignored for accountID_or_name, _ in pairs(ignoredAccounts) do if not WG.ignoredAccounts[accountID_or_name] then - for i=1, #chatLines do + for i = 1, #chatLines do if chatLines[i].playerName == accountID_or_name then chatLines[i].ignore = nil updateDrawUi = true @@ -1405,7 +1414,7 @@ function widget:Update(dt) -- hide chats from players that are now ignored for accountID_or_name, _ in pairs(WG.ignoredAccounts) do if not ignoredAccounts[accountID_or_name] then - for i=1, #chatLines do + for i = 1, #chatLines do if chatLines[i].playerName == accountID_or_name then chatLines[i].ignore = true updateDrawUi = true @@ -1417,21 +1426,21 @@ function widget:Update(dt) end -- add settings option commands - if not addedOptionsList and WG['options'] and WG['options'].getOptionsList then - local optionsList = WG['options'].getOptionsList() + if not addedOptionsList and WG["options"] and WG["options"].getOptionsList then + local optionsList = WG["options"].getOptionsList() if optionsList and #optionsList > 0 then addedOptionsList = true for i, option in ipairs(optionsList) do - autocompleteCommands[#autocompleteCommands+1] = 'option '..option + autocompleteCommands[#autocompleteCommands + 1] = "option " .. option end end end -- detect spectator filter change - if hideSpecChat ~= (Spring.GetConfigInt('HideSpecChat', 0) == 1) or hideSpecChatPlayer ~= (Spring.GetConfigInt('HideSpecChatPlayer', 1) == 1) then - hideSpecChat = (Spring.GetConfigInt('HideSpecChat', 0) == 1) - hideSpecChatPlayer = (Spring.GetConfigInt('HideSpecChatPlayer', 1) == 1) - for i=1, #chatLines do + if hideSpecChat ~= (Spring.GetConfigInt("HideSpecChat", 0) == 1) or hideSpecChatPlayer ~= (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1) then + hideSpecChat = (Spring.GetConfigInt("HideSpecChat", 0) == 1) + hideSpecChatPlayer = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1) + for i = 1, #chatLines do if chatLines[i].lineType == LineTypes.Spectator then if shouldHideSpecMessage() then chatLines[i].ignore = true @@ -1453,14 +1462,14 @@ function widget:Update(dt) end end - local x,y,_ = spGetMouseState() + local x, y, _ = spGetMouseState() if topbarArea then - scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight*maxLinesScroll)) / vsy + scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight * maxLinesScroll)) / vsy end - local chatlogHeightDiff = historyMode and floor(vsy*(scrollingPosY-posY)) or 0 - if WG['topbar'] and WG['topbar'].showingQuit() then + local chatlogHeightDiff = historyMode and floor(vsy * (scrollingPosY - posY)) or 0 + if WG["topbar"] and WG["topbar"].showingQuit() then historyMode = false setCurrentChatLine(#chatLines) elseif math_isInRect(x, y, activationArea[1], activationArea[2], activationArea[3], activationArea[4]) then @@ -1468,13 +1477,13 @@ function widget:Update(dt) local _, actCmdID, _, _ = spGetActiveCommand() if showHistoryWhenCtrlShift and ctrl and shift and not actCmdID then if math_isInRect(x, y, consoleActivationArea[1], consoleActivationArea[2], consoleActivationArea[3], consoleActivationArea[4]) then - historyMode = 'console' + historyMode = "console" else - historyMode = 'chat' + historyMode = "chat" end maxLinesScroll = maxLinesScrollFull end - elseif historyMode and math_isInRect(x, y, activationArea[1], activationArea[2]+chatlogHeightDiff, activationArea[3], activationArea[2]) then + elseif historyMode and math_isInRect(x, y, activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[2]) then -- do nothing else if not showHistoryWhenChatInput or not showTextInput then @@ -1485,10 +1494,10 @@ function widget:Update(dt) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") if not chobbyInterface then - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end end end @@ -1496,36 +1505,36 @@ end drawChatInputCursor = function() if textCursorRect then local a = 1 - (cursorBlinkTimer * (1 / cursorBlinkDuration)) + 0.15 - glColor(0.7,0.7,0.7,a) + glColor(0.7, 0.7, 0.7, a) gl.Rect(textCursorRect[1], textCursorRect[2], textCursorRect[3], textCursorRect[4]) - glColor(1,1,1,1) + glColor(1, 1, 1, 1) end end drawChatInput = function() if showTextInput then if topbarArea then - scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight*maxLinesScroll)) / vsy + scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight * maxLinesScroll)) / vsy end updateTextInputDlist = false textInputDlist = glDeleteList(textInputDlist) textInputDlist = glCreateList(function() - local chatlogHeightDiff = historyMode and floor(vsy*(scrollingPosY-posY)) or 0 + local chatlogHeightDiff = historyMode and floor(vsy * (scrollingPosY - posY)) or 0 local inputFontSize = floor(usedFontSize * 1.03) local inputHeight = floor(inputFontSize * 2.3) - local leftOffset = floor(lineHeight*0.7) - local distance = (historyMode and inputHeight + elementMargin + elementMargin or elementMargin) - local isCmd = ssub(inputText, 1, 1) == '/' + local leftOffset = floor(lineHeight * 0.7) + local distance = (historyMode and inputHeight + elementMargin + elementMargin or elementMargin) + local isCmd = ssub(inputText, 1, 1) == "/" local usedFont = isCmd and font3 or font local modeText = I18N.everyone if isCmd then modeText = I18N.cmd - elseif inputMode == 'a:' then + elseif inputMode == "a:" then modeText = I18N.allies - elseif inputMode == 's:' then + elseif inputMode == "s:" then modeText = I18N.spectators end - local modeTextPosX = floor(activationArea[1]+elementPadding+elementPadding+leftOffset) + local modeTextPosX = floor(activationArea[1] + elementPadding + elementPadding + leftOffset) local textPosX = floor(modeTextPosX + (usedFont:GetTextWidth(modeText) * inputFontSize) + leftOffset + inputFontSize) local textCursorWidth = 1 + mathFloor(inputFontSize / 14) if inputTextInsertActive then @@ -1534,56 +1543,56 @@ drawChatInput = function() local textCursorPos = floor(usedFont:GetTextWidth(utf8.sub(inputText, 1, inputTextPosition)) * inputFontSize) -- background - local r,g,b,a - local inputAlpha = mathMin(0.36, ui_opacity*0.66) - local x2 = math.max(textPosX+lineHeight+floor(usedFont:GetTextWidth(inputText..(autocompleteText and autocompleteText or '')) * inputFontSize), floor(activationArea[1]+((activationArea[3]-activationArea[1])/3))) - UiElement(activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance, nil,nil,nil,nil, nil,nil,nil,nil, inputAlpha) - if WG['guishader'] then - WG['guishader'].InsertRect(activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance, 'chatinput') + local r, g, b, a + local inputAlpha = mathMin(0.36, ui_opacity * 0.66) + local x2 = math.max(textPosX + lineHeight + floor(usedFont:GetTextWidth(inputText .. (autocompleteText and autocompleteText or "")) * inputFontSize), floor(activationArea[1] + ((activationArea[3] - activationArea[1]) / 3))) + UiElement(activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance, nil, nil, nil, nil, nil, nil, nil, nil, inputAlpha) + if WG["guishader"] then + WG["guishader"].InsertRect(activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance, "chatinput") end -- button background - inputButtonRect = {activationArea[1]+elementPadding, activationArea[2]+chatlogHeightDiff-distance-inputHeight+elementPadding, textPosX-inputFontSize, activationArea[2]+chatlogHeightDiff-distance-elementPadding} + inputButtonRect = { activationArea[1] + elementPadding, activationArea[2] + chatlogHeightDiff - distance - inputHeight + elementPadding, textPosX - inputFontSize, activationArea[2] + chatlogHeightDiff - distance - elementPadding } if isCmd then r, g, b = 0, 0, 0 - elseif inputMode == 'a:' then + elseif inputMode == "a:" then r, g, b = 0, 0.1, 0 - elseif inputMode == 's:' then + elseif inputMode == "s:" then r, g, b = 0.1, 0.094, 0 else r, g, b = 0, 0, 0 end glColor(r, g, b, 0.3) - RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner*0.6, 1,0,0,1) - glColor(1,1,1,0.033) - gl.Rect(inputButtonRect[3]-1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) + RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner * 0.6, 1, 0, 0, 1) + glColor(1, 1, 1, 0.033) + gl.Rect(inputButtonRect[3] - 1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) -- button text usedFont:Begin(true) usedFont:SetOutlineColor(0.22, 0.22, 0.22, 1) if isCmd then r, g, b = 0.65, 0.65, 0.65 - elseif inputMode == 'a:' then + elseif inputMode == "a:" then r, g, b = 0.55, 0.72, 0.55 - elseif inputMode == 's:' then + elseif inputMode == "s:" then r, g, b = 0.73, 0.73, 0.54 else r, g, b = 0.7, 0.7, 0.7 end usedFont:SetTextColor(r, g, b, 1) - usedFont:Print(modeText, modeTextPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:Print(modeText, modeTextPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") -- colon if not isCmd then - if inputMode == 'a:' then + if inputMode == "a:" then r, g, b = 0.53, 0.66, 0.53 - elseif inputMode == 's:' then + elseif inputMode == "s:" then r, g, b = 0.66, 0.66, 0.5 else r, g, b = 0.55, 0.55, 0.55 end usedFont:SetTextColor(r, g, b, 1) - usedFont:Print(':', inputButtonRect[3]-0.5, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "co") + usedFont:Print(":", inputButtonRect[3] - 0.5, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "co") end -- text selection highlight @@ -1593,12 +1602,12 @@ drawChatInput = function() local selStartPos = floor(usedFont:GetTextWidth(utf8.sub(inputText, 1, selStart)) * inputFontSize) local selEndPos = floor(usedFont:GetTextWidth(utf8.sub(inputText, 1, selEnd)) * inputFontSize) glColor(0.55, 0.55, 0.55, 0.5) - gl.Rect(textPosX + selStartPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)-(inputFontSize*0.6), textPosX + selEndPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)+(inputFontSize*0.64)) - glColor(1,1,1,1) + gl.Rect(textPosX + selStartPos, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) - (inputFontSize * 0.6), textPosX + selEndPos, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) + (inputFontSize * 0.64)) + glColor(1, 1, 1, 1) end -- text cursor - textCursorRect = { textPosX + textCursorPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)-(inputFontSize*0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)+(inputFontSize*0.64) } + textCursorRect = { textPosX + textCursorPos, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) - (inputFontSize * 0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) + (inputFontSize * 0.64) } --a = 1 - (cursorBlinkTimer * (1 / cursorBlinkDuration)) + 0.15 --glColor(0.7,0.7,0.7,a) --gl.Rect(textPosX + textCursorPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)-(inputFontSize*0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)+(inputFontSize*0.64)) @@ -1607,18 +1616,18 @@ drawChatInput = function() -- text message if isCmd then r, g, b = 0.85, 0.85, 0.85 - elseif inputMode == 'a:' then + elseif inputMode == "a:" then r, g, b = 0.2, 1, 0.2 - elseif inputMode == 's:' then + elseif inputMode == "s:" then r, g, b = 1, 1, 0.2 else r, g, b = 0.95, 0.95, 0.95 end - usedFont:SetTextColor(r,g,b, 1) - usedFont:Print(inputText, textPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:SetTextColor(r, g, b, 1) + usedFont:Print(inputText, textPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") if autocompleteText then - usedFont:SetTextColor(r,g,b, 0.35) - usedFont:Print(autocompleteText, textPosX + floor(usedFont:GetTextWidth(inputText) * inputFontSize), activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "") + usedFont:SetTextColor(r, g, b, 0.35) + usedFont:Print(autocompleteText, textPosX + floor(usedFont:GetTextWidth(inputText) * inputFontSize), activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "") end -- autocomplete multi-suggestions @@ -1631,12 +1640,12 @@ drawChatInput = function() -- letters = word --end - local letters = '' + local letters = "" for word in (isCmd and ssub(inputText, 2) or inputText):gmatch("%S+") do letters = word end - if ssub(inputText, #inputText) == ' ' then - letters = letters..' ' + if ssub(inputText, #inputText) == " " then + letters = letters .. " " elseif prevAutocompleteLetters then letters = prevAutocompleteLetters .. letters end @@ -1645,35 +1654,35 @@ drawChatInput = function() local autocLineHeight = floor(inputFontSize * scale * 1.3) local lettersWidth = floor(usedFont:GetTextWidth(letters) * inputFontSize * scale) local xPos = floor(textPosX + textCursorPos - lettersWidth) - local yPos = activationArea[2]+chatlogHeightDiff-distance-inputHeight - local height = (autocLineHeight * mathMin(allowMultiAutocompleteMax, #autocompleteWords-1) + leftOffset) + (#autocompleteWords > allowMultiAutocompleteMax+1 and autocLineHeight or 0) - glColor(0,0,0,inputAlpha) - RectRound(xPos-leftOffset, yPos-height, x2-elementMargin, yPos, elementCorner*0.6, 0,0,1,1) - if WG['guishader'] then - WG['guishader'].InsertRect(xPos-leftOffset, yPos-height, x2-elementPadding, yPos, 'chatinputautocomplete') + local yPos = activationArea[2] + chatlogHeightDiff - distance - inputHeight + local height = (autocLineHeight * mathMin(allowMultiAutocompleteMax, #autocompleteWords - 1) + leftOffset) + (#autocompleteWords > allowMultiAutocompleteMax + 1 and autocLineHeight or 0) + glColor(0, 0, 0, inputAlpha) + RectRound(xPos - leftOffset, yPos - height, x2 - elementMargin, yPos, elementCorner * 0.6, 0, 0, 1, 1) + if WG["guishader"] then + WG["guishader"].InsertRect(xPos - leftOffset, yPos - height, x2 - elementPadding, yPos, "chatinputautocomplete") end - local addHeight = floor((inputFontSize*scale) * 1.35) - autocLineHeight + local addHeight = floor((inputFontSize * scale) * 1.35) - autocLineHeight for i, word in ipairs(autocompleteWords) do if i > 1 then addHeight = addHeight + autocLineHeight - usedFont:SetTextColor(r,g,b, 0.8) - usedFont:Print(letters, xPos, yPos-addHeight, inputFontSize*scale, "") - usedFont:SetTextColor(r,g,b, 0.35) - if i <= allowMultiAutocompleteMax+1 then - usedFont:Print(ssub(word, letterCount+1), xPos + lettersWidth, yPos-addHeight, inputFontSize*scale, "") + usedFont:SetTextColor(r, g, b, 0.8) + usedFont:Print(letters, xPos, yPos - addHeight, inputFontSize * scale, "") + usedFont:SetTextColor(r, g, b, 0.35) + if i <= allowMultiAutocompleteMax + 1 then + usedFont:Print(ssub(word, letterCount + 1), xPos + lettersWidth, yPos - addHeight, inputFontSize * scale, "") else - local text = '' - for i=1, #word do - text = text .. '.' + local text = "" + for i = 1, #word do + text = text .. "." end - usedFont:Print(text, xPos + lettersWidth, yPos-addHeight, inputFontSize*scale, "") + usedFont:Print(text, xPos + lettersWidth, yPos - addHeight, inputFontSize * scale, "") break end end end else - if WG['guishader'] then - WG['guishader'].RemoveRect('chatinputautocomplete') + if WG["guishader"] then + WG["guishader"].RemoveRect("chatinputautocomplete") end end @@ -1690,19 +1699,18 @@ end drawUi = function() if not historyMode then - -- draw background if backgroundOpacity > 0 and displayedChatLines > 0 then - glColor(1,1,1,0.1*backgroundOpacity) + glColor(1, 1, 1, 0.1 * backgroundOpacity) local borderSize = 1 - RectRound(activationArea[1]-borderSize, activationArea[2]-borderSize, activationArea[3]+borderSize, activationArea[2]+borderSize+((displayedChatLines+1)*lineHeight)+(displayedChatLines==maxLines and 0 or elementPadding), elementCorner*1.2) + RectRound(activationArea[1] - borderSize, activationArea[2] - borderSize, activationArea[3] + borderSize, activationArea[2] + borderSize + ((displayedChatLines + 1) * lineHeight) + (displayedChatLines == maxLines and 0 or elementPadding), elementCorner * 1.2) - glColor(0,0,0,backgroundOpacity) - RectRound(activationArea[1], activationArea[2], activationArea[3], activationArea[2]+((displayedChatLines+1)*lineHeight)+(displayedChatLines==maxLines and 0 or elementPadding), elementCorner) + glColor(0, 0, 0, backgroundOpacity) + RectRound(activationArea[1], activationArea[2], activationArea[3], activationArea[2] + ((displayedChatLines + 1) * lineHeight) + (displayedChatLines == maxLines and 0 or elementPadding), elementCorner) if hovering then --and Spring.GetGameFrame() < 30*60*7 then font:Begin(true) - font:SetTextColor(0.1,0.1,0.1,0.66) - font:Print(I18N.shortcut, activationArea[3]-elementPadding-elementPadding, activationArea[2]+elementPadding+elementPadding, usedConsoleFontSize, "r") + font:SetTextColor(0.1, 0.1, 0.1, 0.66) + font:Print(I18N.shortcut, activationArea[3] - elementPadding - elementPadding, activationArea[2] + elementPadding + elementPadding, usedConsoleFontSize, "r") font:End() end end @@ -1710,7 +1718,7 @@ drawUi = function() -- draw console lines if consoleLines[1] then glPushMatrix() - glTranslate((vsx * posX) + backgroundPadding, (consolePosY*vsy)+(usedConsoleFontSize*0.24), 0) + glTranslate((vsx * posX) + backgroundPadding, (consolePosY * vsy) + (usedConsoleFontSize * 0.24), 0) local checkedLines = 0 local i = #consoleLines while i > 0 do @@ -1726,12 +1734,12 @@ drawUi = function() glTranslate(0, consoleLineHeight, 0) i = i - 1 end - if i - 1 > consoleLineCleanupTarget*1.15 then + if i - 1 > consoleLineCleanupTarget * 1.15 then consoleLines = cleanupLineTable(consoleLines, consoleLineCleanupTarget) end glPopMatrix() - if #orgLines > orgLineCleanupTarget*1.15 then + if #orgLines > orgLineCleanupTarget * 1.15 then orgLines = cleanupLineTable(orgLines, orgLineCleanupTarget) end end @@ -1739,10 +1747,10 @@ drawUi = function() -- draw chat lines or chat/console history ui panel if historyMode or chatLines[currentChatLine] then - if #chatLines == 0 and historyMode == 'chat' then + if #chatLines == 0 and historyMode == "chat" then font:Begin(true) - font:SetTextColor(0.35,0.35,0.35,0.66) - font:Print(I18N.nohistory, activationArea[1]+(activationArea[3]-activationArea[1])/2, activationArea[2]+elementPadding+elementPadding, usedConsoleFontSize*1.1, "c") + font:SetTextColor(0.35, 0.35, 0.35, 0.66) + font:Print(I18N.nohistory, activationArea[1] + (activationArea[3] - activationArea[1]) / 2, activationArea[2] + elementPadding + elementPadding, usedConsoleFontSize * 1.1, "c") font:End() end local checkedLines = 0 @@ -1753,16 +1761,16 @@ drawUi = function() local translatedX = (vsx * posX) + backgroundPadding local translatedY = vsy * (historyMode and scrollingPosY or posY) + backgroundPadding glTranslate(translatedX, translatedY, 0) - local i = historyMode == 'console' and currentConsoleLine or currentChatLine + local i = historyMode == "console" and currentConsoleLine or currentChatLine local usedMaxLines = maxLines if historyMode then usedMaxLines = maxLinesScroll end - local width = floor(maxTimeWidth+(lineHeight*0.75)) + local width = floor(maxTimeWidth + (lineHeight * 0.75)) while i > 0 do - if (historyMode and historyMode == 'console') or (chatLines[i] and not chatLines[i].ignore) then + if (historyMode and historyMode == "console") or (chatLines[i] and not chatLines[i].ignore) then if historyMode or clock() - chatLines[i].startTime < lineTTL then - if historyMode == 'console' then + if historyMode == "console" then -- R2T mode: no processConsoleLineGL needed else if chatLines[i].reprocess then @@ -1770,8 +1778,8 @@ drawUi = function() local orgLineID = chatLines[i].orgLineID if orgLines[orgLineID] then local firstWordrappedChatLine = i - for c=1, 6 do - if not chatLines[firstWordrappedChatLine-c] or chatLines[firstWordrappedChatLine-c].orgLineID ~= orgLineID then + for c = 1, 6 do + if not chatLines[firstWordrappedChatLine - c] or chatLines[firstWordrappedChatLine - c].orgLineID ~= orgLineID then break else firstWordrappedChatLine = firstWordrappedChatLine - c @@ -1782,7 +1790,7 @@ drawUi = function() end end if historyMode then - if historyMode == 'console' then + if historyMode == "console" then if consoleLines[i] then if consoleLines[i].gameFrame then drawGameTime(consoleLines[i].gameFrame) @@ -1799,7 +1807,7 @@ drawUi = function() glTranslate(width, 0, 0) end end - if historyMode == 'console' then + if historyMode == "console" then if consoleLines[i] then drawConsoleLine(i) end @@ -1835,12 +1843,12 @@ drawUi = function() lastUnignoredChatLineID = i break end - i = i - 1 + i = i - 1 end if chatLines[lastUnignoredChatLineID] and not chatLines[lastUnignoredChatLineID].ignore then if historyMode and currentChatLine < lastUnignoredChatLineID and clock() - chatLines[lastUnignoredChatLineID].startTime < lineTTL then glPushMatrix() - glTranslate(vsx * posX, vsy * ((historyMode and scrollingPosY or posY)-0.02)-backgroundPadding, 0) + glTranslate(vsx * posX, vsy * ((historyMode and scrollingPosY or posY) - 0.02) - backgroundPadding, 0) drawChatLine(lastUnignoredChatLineID) glPopMatrix() end @@ -1857,29 +1865,33 @@ drawTextInput = function() glCallList(textInputDlist) drawChatInputCursor() -- button hover - local x,y,b = spGetMouseState() + local x, y, b = spGetMouseState() if inputButtonRect[1] and math_isInRect(x, y, inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) then - Spring.SetMouseCursor('cursornormal') - glColor(1,1,1,0.075) - RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner*0.6, 1,0,0,1) + Spring.SetMouseCursor("cursornormal") + glColor(1, 1, 1, 0.075) + RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner * 0.6, 1, 0, 0, 1) end - elseif WG['guishader'] then - WG['guishader'].RemoveRect('chatinput') - WG['guishader'].RemoveRect('chatinputautocomplete') + elseif WG["guishader"] then + WG["guishader"].RemoveRect("chatinput") + WG["guishader"].RemoveRect("chatinputautocomplete") textInputDlist = glDeleteList(textInputDlist) end end end function widget:DrawScreen() - if chobbyInterface then return end - if not chatLines[1] and not consoleLines[1] then return end + if chobbyInterface then + return + end + if not chatLines[1] and not consoleLines[1] then + return + end local _, ctrl, _, _ = Spring.GetModKeyState() - local x,y,b = spGetMouseState() - local chatlogHeightDiff = historyMode and floor(vsy*(scrollingPosY-posY)) or 0 - if hovering and WG['guishader'] then - WG['guishader'].RemoveRect('chat') + local x, y, b = spGetMouseState() + local chatlogHeightDiff = historyMode and floor(vsy * (scrollingPosY - posY)) or 0 + if hovering and WG["guishader"] then + WG["guishader"].RemoveRect("chat") end -- draw chat input @@ -1889,28 +1901,28 @@ function widget:DrawScreen() return end - if (showHistoryWhenChatInput and showTextInput) or math_isInRect(x, y, activationArea[1], activationArea[2]+chatlogHeightDiff, activationArea[3], activationArea[4]) or (scrolling and math_isInRect(x, y, activationArea[1], activationArea[2]+chatlogHeightDiff, activationArea[3], activationArea[2])) then + if (showHistoryWhenChatInput and showTextInput) or math_isInRect(x, y, activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[4]) or (scrolling and math_isInRect(x, y, activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[2])) then hovering = true if historyMode then - UiElement(activationArea[1], activationArea[2]+chatlogHeightDiff, activationArea[3], activationArea[4]) - if WG['guishader'] then - WG['guishader'].InsertRect(activationArea[1], activationArea[2]+chatlogHeightDiff, activationArea[3], activationArea[4], 'chat') + UiElement(activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[4]) + if WG["guishader"] then + WG["guishader"].InsertRect(activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[4], "chat") end -- player name background - if historyMode == 'chat' then - local gametimeEnd = floor(backgroundPadding+maxTimeWidth+(backgroundPadding*0.75)) - local playernameEnd = gametimeEnd + maxPlayernameWidth + (lineSpaceWidth/1.8) - glColor(1,1,1,0.045) - RectRound(activationArea[1]+gametimeEnd, activationArea[2]+elementPadding+chatlogHeightDiff, activationArea[1]+playernameEnd, activationArea[4]-elementPadding, elementCorner*0.66, 0,0,0,0) + if historyMode == "chat" then + local gametimeEnd = floor(backgroundPadding + maxTimeWidth + (backgroundPadding * 0.75)) + local playernameEnd = gametimeEnd + maxPlayernameWidth + (lineSpaceWidth / 1.8) + glColor(1, 1, 1, 0.045) + RectRound(activationArea[1] + gametimeEnd, activationArea[2] + elementPadding + chatlogHeightDiff, activationArea[1] + playernameEnd, activationArea[4] - elementPadding, elementCorner * 0.66, 0, 0, 0, 0) -- vertical line at start and end - glColor(1,1,1,0.045) - RectRound(activationArea[1]+playernameEnd-1, activationArea[2]+elementPadding+chatlogHeightDiff, activationArea[1]+playernameEnd, activationArea[4]-elementPadding, 0, 0,0,0,0) - RectRound(activationArea[1]+gametimeEnd, activationArea[2]+elementPadding+chatlogHeightDiff, activationArea[1]+gametimeEnd+1, activationArea[4]-elementPadding, 0, 0,0,0,0) + glColor(1, 1, 1, 0.045) + RectRound(activationArea[1] + playernameEnd - 1, activationArea[2] + elementPadding + chatlogHeightDiff, activationArea[1] + playernameEnd, activationArea[4] - elementPadding, 0, 0, 0, 0, 0) + RectRound(activationArea[1] + gametimeEnd, activationArea[2] + elementPadding + chatlogHeightDiff, activationArea[1] + gametimeEnd + 1, activationArea[4] - elementPadding, 0, 0, 0, 0, 0) end local totalUnignoredChatLines = 0 - for i=1, #chatLines do + for i = 1, #chatLines do if not chatLines[i].ignore then totalUnignoredChatLines = totalUnignoredChatLines + 1 end @@ -1918,14 +1930,7 @@ function widget:DrawScreen() local scrollbarMargin = floor(16 * widgetScale) local scrollbarWidth = floor(11 * widgetScale) - UiScroller( - floor(activationArea[3]-scrollbarMargin-scrollbarWidth), - floor(activationArea[2]+chatlogHeightDiff+scrollbarMargin), - floor(activationArea[3]-scrollbarMargin), - floor(activationArea[4]-scrollbarMargin), - historyMode == 'console' and #consoleLines*lineHeight or totalUnignoredChatLines*lineHeight, - historyMode == 'console' and (currentConsoleLine-maxLinesScroll)*lineHeight or (currentChatLine-maxLinesScroll)*lineHeight - ) + UiScroller(floor(activationArea[3] - scrollbarMargin - scrollbarWidth), floor(activationArea[2] + chatlogHeightDiff + scrollbarMargin), floor(activationArea[3] - scrollbarMargin), floor(activationArea[4] - scrollbarMargin), historyMode == "console" and #consoleLines * lineHeight or totalUnignoredChatLines * lineHeight, historyMode == "console" and (currentConsoleLine - maxLinesScroll) * lineHeight or (currentChatLine - maxLinesScroll) * lineHeight) end else if not showHistoryWhenChatInput or not showTextInput then @@ -1939,8 +1944,8 @@ function widget:DrawScreen() updateDrawUi = true end - local ctrlHover = enableShortcutClick and ctrl and math_isInRect(x, y, activationArea[1],activationArea[2]+chatlogHeightDiff,activationArea[3],activationArea[4]) - if ctrlHover or (historyMode and historyMode == 'chat') then + local ctrlHover = enableShortcutClick and ctrl and math_isInRect(x, y, activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[4]) + if ctrlHover or (historyMode and historyMode == "chat") then --updateDrawUi = true glPushMatrix() @@ -1952,7 +1957,7 @@ function widget:DrawScreen() if historyMode then usedMaxLines = maxLinesScroll end - local width = floor(maxTimeWidth+(lineHeight*0.75)) + local width = floor(maxTimeWidth + (lineHeight * 0.75)) local checkedLines = 0 while i > 0 do if chatLines[i] and not chatLines[i].ignore then @@ -1961,16 +1966,16 @@ function widget:DrawScreen() if isClickableLine then local lineArea = { translatedX + width, - translatedY + (lineHeight*checkedLines), - floor(translatedX + width + (activationArea[3]-activationArea[1])-backgroundPadding-backgroundPadding-maxTimeWidth - (38 * widgetScale)), - translatedY + (lineHeight*checkedLines) + lineHeight + translatedY + (lineHeight * checkedLines), + floor(translatedX + width + (activationArea[3] - activationArea[1]) - backgroundPadding - backgroundPadding - maxTimeWidth - (38 * widgetScale)), + translatedY + (lineHeight * checkedLines) + lineHeight, } if math_isInRect(x, y, lineArea[1], lineArea[2], lineArea[3], lineArea[4]) then - UiSelectHighlight(lineArea[1]-translatedX, lineArea[2]-translatedY-(lineHeight*checkedLines), lineArea[3]-translatedX, lineArea[4]-translatedY-(lineHeight*checkedLines), nil, historyMode and (b and 0.4 or 0.3) or (b and 0.52 or 0.42)) + UiSelectHighlight(lineArea[1] - translatedX, lineArea[2] - translatedY - (lineHeight * checkedLines), lineArea[3] - translatedX, lineArea[4] - translatedY - (lineHeight * checkedLines), nil, historyMode and (b and 0.4 or 0.3) or (b and 0.52 or 0.42)) if b then -- mapmark highlight if chatLines[i].coords then - Spring.SetCameraTarget( chatLines[i].coords[1], chatLines[i].coords[2], chatLines[i].coords[3] ) + Spring.SetCameraTarget(chatLines[i].coords[1], chatLines[i].coords[2], chatLines[i].coords[3]) end -- unit share if chatLines[i].selectUnits then @@ -2011,14 +2016,14 @@ function widget:DrawScreen() -- regardless of whether maxLinesScroll is currently reduced (e.g. chat input mode = 9 lines) local rttScrollPosY = scrollingPosY if topbarArea then - rttScrollPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight*maxLinesScrollFull)) / vsy + rttScrollPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight * maxLinesScrollFull)) / vsy end -- Extra space below for the "show new chat" notification in history mode -- (drawn at scrollingPosY - 0.02 - backgroundPadding, plus the line itself) local notifExtra = floor(0.02 * vsy) + backgroundPadding + lineHeight - rttArea = {consoleActivationArea[1], activationArea[2]+floor(vsy*(rttScrollPosY-posY)) - notifExtra, consoleActivationArea[3], consoleActivationArea[4]} - local texWidth = mathFloor(rttArea[3]-rttArea[1]) - local texHeight = mathFloor(rttArea[4]-rttArea[2]) + rttArea = { consoleActivationArea[1], activationArea[2] + floor(vsy * (rttScrollPosY - posY)) - notifExtra, consoleActivationArea[3], consoleActivationArea[4] } + local texWidth = mathFloor(rttArea[3] - rttArea[1]) + local texHeight = mathFloor(rttArea[4] - rttArea[2]) if texWidth > 0 and texHeight > 0 then uiTex = gl.CreateTexture(texWidth, texHeight, { target = GL.TEXTURE_2D, @@ -2028,7 +2033,7 @@ function widget:DrawScreen() end end if uiTex then - if lastDrawUiUpdate+2 < clock() then -- this is to make sure stuff times out/clears respecting lineTTL + if lastDrawUiUpdate + 2 < clock() then -- this is to make sure stuff times out/clears respecting lineTTL updateDrawUi = true end if updateDrawUi ~= nil then @@ -2039,7 +2044,7 @@ function widget:DrawScreen() if updateDrawUi == false then updateDrawUi = nil elseif updateDrawUi then - updateDrawUi = false -- update once more after this + updateDrawUi = false -- update once more after this end end @@ -2051,10 +2056,10 @@ local function runAutocompleteSet(wordsSet, searchStr, multi, lower) autocompleteWords = {} local charCount = slen(searchStr) for i, word in ipairs(wordsSet) do - if slen(word) > charCount and (searchStr == ssub(word, 1, charCount) or (lower and searchStr:lower() == ssub(word:lower(), 1, charCount))) then - autocompleteWords[#autocompleteWords+1] = word + if slen(word) > charCount and (searchStr == ssub(word, 1, charCount) or (lower and searchStr:lower() == ssub(word:lower(), 1, charCount))) then + autocompleteWords[#autocompleteWords + 1] = word if not autocompleteText then - autocompleteText = ssub(word, charCount+1) + autocompleteText = ssub(word, charCount + 1) if not multi then return true end @@ -2069,7 +2074,7 @@ local function autocomplete(text, fresh) if not loadedAutocompleteCommands then loadedAutocompleteCommands = true for textAction, v in pairs(widgetHandler.actionHandler.textActions) do - if type(textAction) == 'string' then + if type(textAction) == "string" then local found = false for k, cmd in ipairs(autocompleteCommands) do if cmd == textAction then @@ -2079,7 +2084,7 @@ local function autocomplete(text, fresh) end if not found then --spEcho('"'..textAction..'"') - autocompleteCommands[#autocompleteCommands+1] = textAction + autocompleteCommands[#autocompleteCommands + 1] = textAction end end end @@ -2089,19 +2094,19 @@ local function autocomplete(text, fresh) if fresh then autocompleteWords = {} end - if text == '' then + if text == "" then return end - local letters = '' - local isCmd = ssub(text, 1, 1) == '/' + local letters = "" + local isCmd = ssub(text, 1, 1) == "/" local words = {} for word in (ssub(text, isCmd and 2 or 1)):gmatch("%S+") do - words[#words+1] = word + words[#words + 1] = word letters = word end -- if there are still suggestions then try to continue before starting fresh with a new word - if ssub(inputText, #text) == ' ' then - letters = letters..' ' + if ssub(inputText, #text) == " " then + letters = letters .. " " if autocompleteWords[1] then prevAutocompleteLetters = letters end @@ -2109,7 +2114,7 @@ local function autocomplete(text, fresh) if prevAutocompleteLetters and autocompleteWords[1] then letters = prevAutocompleteLetters .. letters if isCmd then - words = {[1] = letters} + words = { [1] = letters } end else prevAutocompleteLetters = nil @@ -2139,14 +2144,13 @@ local function autocomplete(text, fresh) end -- if prev autocomplete words didnt result in suggestions, redo it freshly - if prevAutocompleteLetters and not autocompleteWords[1] and not ssub(inputText, #text) == ' ' then + if prevAutocompleteLetters and not autocompleteWords[1] and not ssub(inputText, #text) == " " then prevAutocompleteLetters = nil autocomplete(text, true) end end - -function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it +function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it if handleTextInput and not chobbyInterface and not Spring.IsGUIHidden() and showTextInput then -- If there's a selection, delete it first if inputSelectionStart and inputSelectionStart ~= inputTextPosition then @@ -2157,12 +2161,12 @@ function widget:TextInput(char) -- if it isnt working: chobby probably hijacked inputSelectionStart = nil end if inputTextInsertActive then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 2) if inputTextPosition <= utf8.len(inputText) then inputTextPosition = inputTextPosition + 1 end else - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition + 1 end if string.len(inputText) > maxTextInputChars then @@ -2175,8 +2179,8 @@ function widget:TextInput(char) -- if it isnt working: chobby probably hijacked cursorBlinkTimer = 0 autocomplete(inputText) updateTextInputDlist = true - if WG['limitidlefps'] and WG['limitidlefps'].update then - WG['limitidlefps'].update() + if WG["limitidlefps"] and WG["limitidlefps"].update then + WG["limitidlefps"].update() end return true end @@ -2199,25 +2203,24 @@ function widget:KeyPress(key) if ctrl or alt or shift then -- switch mode if ctrl then - inputMode = '' + inputMode = "" elseif alt and not mySpec then - inputMode = (inputMode == 'a:' and '' or 'a:') + inputMode = (inputMode == "a:" and "" or "a:") else - inputMode = (inputMode == 's:' and '' or 's:') + inputMode = (inputMode == "s:" and "" or "s:") end else -- send chat/cmd - if inputText ~= '' then + if inputText ~= "" then local executedInput = inputText - if ssub(inputText, 1, 1) == '/' then + if ssub(inputText, 1, 1) == "/" then Spring.SendCommands(ssub(inputText, 2)) else local badWord = findBadWords(inputText) if badWord ~= nil and inputText ~= lastMessage then - addChatLine(Spring.GetGameFrame(), LineTypes.System, "Moderation", "\255\255\000\000" .. Spring.I18N('ui.chat.moderation.prefix'), - Spring.I18N('ui.chat.moderation.blocked', { badWord = badWord })) + addChatLine(Spring.GetGameFrame(), LineTypes.System, "Moderation", "\255\255\000\000" .. Spring.I18N("ui.chat.moderation.prefix"), Spring.I18N("ui.chat.moderation.blocked", { badWord = badWord })) else - Spring.SendCommands("say "..inputMode..inputText) + Spring.SendCommands("say " .. inputMode .. inputText) end lastMessage = inputText end @@ -2231,23 +2234,23 @@ function widget:KeyPress(key) cancelChatInput() showTextInput = true if showHistoryWhenChatInput then - historyMode = 'chat' + historyMode = "chat" maxLinesScroll = maxLinesScrollChatInput end - widgetHandler.textOwner = self -- non handler = true: widgetHandler:OwnText() + widgetHandler.textOwner = self -- non handler = true: widgetHandler:OwnText() ensureInputHistoryDraft() if ctrl then - inputMode = '' + inputMode = "" elseif alt then - inputMode = mySpec and 's:' or 'a:' + inputMode = mySpec and "s:" or "a:" elseif shift then - inputMode = 's:' + inputMode = "s:" elseif inputMode == nil then -- First time opening chat - default to allies/spectators - inputMode = mySpec and 's:' or 'a:' + inputMode = mySpec and "s:" or "a:" end -- again just to be safe, had report locking could still happen - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end updateTextInputDlist = true @@ -2268,7 +2271,7 @@ function widget:KeyPress(key) inputSelectionStart = nil end local clipboardText = Spring.GetClipboard() - inputText = utf8.sub(inputText, 1, inputTextPosition) .. clipboardText .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. clipboardText .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition + utf8.len(clipboardText) if string.len(inputText) > maxTextInputChars then inputText = string.sub(inputText, 1, maxTextInputChars) @@ -2279,7 +2282,6 @@ function widget:KeyPress(key) inputHistory[#inputHistory] = inputText cursorBlinkTimer = 0 autocomplete(inputText, true) - elseif ctrl and key == 99 then -- CTRL + C if inputSelectionStart and inputSelectionStart ~= inputTextPosition then local selStart = math.min(inputSelectionStart, inputTextPosition) @@ -2287,7 +2289,6 @@ function widget:KeyPress(key) local selectedText = utf8.sub(inputText, selStart + 1, selEnd) Spring.SetClipboard(selectedText) end - elseif ctrl and key == 120 then -- CTRL + X if inputSelectionStart and inputSelectionStart ~= inputTextPosition then local selStart = math.min(inputSelectionStart, inputTextPosition) @@ -2301,12 +2302,10 @@ function widget:KeyPress(key) cursorBlinkTimer = 0 autocomplete(inputText, true) end - elseif ctrl and key == 97 then -- CTRL + A inputSelectionStart = 0 inputTextPosition = utf8.len(inputText) cursorBlinkTimer = 0 - elseif ctrl and key == 276 then -- CTRL + LEFT (word jump) if shift then if not inputSelectionStart then @@ -2327,7 +2326,6 @@ function widget:KeyPress(key) end inputTextPosition = pos cursorBlinkTimer = 0 - elseif ctrl and key == 275 then -- CTRL + RIGHT (word jump) if shift then if not inputSelectionStart then @@ -2349,7 +2347,6 @@ function widget:KeyPress(key) end inputTextPosition = pos cursorBlinkTimer = 0 - elseif not alt and not ctrl then if key == 27 then -- ESC cancelChatInput() @@ -2364,10 +2361,10 @@ function widget:KeyPress(key) inputHistory[#inputHistory] = inputText prevAutocompleteLetters = nil elseif inputTextPosition > 0 then - inputText = utf8.sub(inputText, 1, inputTextPosition-1) .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition - 1) .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition - 1 inputHistory[#inputHistory] = inputText - if not (prevAutocompleteLetters and inputTextPosition == #inputText and ssub(inputText, #inputText) ~= ' ') then + if not (prevAutocompleteLetters and inputTextPosition == #inputText and ssub(inputText, #inputText) ~= " ") then prevAutocompleteLetters = nil end end @@ -2383,7 +2380,7 @@ function widget:KeyPress(key) inputSelectionStart = nil inputHistory[#inputHistory] = inputText elseif inputTextPosition < utf8.len(inputText) then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition + 2) inputHistory[#inputHistory] = inputText end cursorBlinkTimer = 0 @@ -2465,7 +2462,7 @@ function widget:KeyPress(key) elseif key == 9 then -- TAB inputSelectionStart = nil if autocompleteText then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. autocompleteText .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. autocompleteText .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition + utf8.len(autocompleteText) inputHistory[#inputHistory] = inputText autocompleteText = nil @@ -2482,12 +2479,12 @@ end function widget:MousePress(x, y, button) if button == 1 and handleTextInput and showTextInput and inputButton and inputButtonRect and not Spring.IsGUIHidden() and math_isInRect(x, y, inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) then - if inputMode == 'a:' then - inputMode = '' - elseif inputMode == 's:' then - inputMode = mySpec and '' or 'a:' + if inputMode == "a:" then + inputMode = "" + elseif inputMode == "s:" then + inputMode = mySpec and "" or "a:" else - inputMode = 's:' + inputMode = "s:" end updateTextInputDlist = true return true @@ -2497,7 +2494,7 @@ end function widget:MouseWheel(up, value) if historyMode and not Spring.IsGUIHidden() then local alt, ctrl, meta, shift = Spring.GetModKeyState() - if historyMode == 'chat' then + if historyMode == "chat" then local scrollCount = 0 local scrollAmount = (shift and maxLinesScroll or (ctrl and 3 or 1)) local i = currentChatLine @@ -2551,30 +2548,32 @@ function widget:MouseWheel(up, value) end end -function widget:WorldTooltip(ttType,data1,data2,data3) - local x,y,_ = spGetMouseState() - local chatlogHeightDiff = historyMode and floor(vsy*(scrollingPosY-posY)) or 0 - if #chatLines > 0 and math_isInRect(x, y, activationArea[1],activationArea[2]+chatlogHeightDiff,activationArea[3],activationArea[4]) then +function widget:WorldTooltip(ttType, data1, data2, data3) + local x, y, _ = spGetMouseState() + local chatlogHeightDiff = historyMode and floor(vsy * (scrollingPosY - posY)) or 0 + if #chatLines > 0 and math_isInRect(x, y, activationArea[1], activationArea[2] + chatlogHeightDiff, activationArea[3], activationArea[4]) then return I18N.scroll end end function widget:MapDrawCmd(playerID, cmdType, x, y, z, a, b, c) - if cmdType == 'point' then - lastMapmarkCoords = {x,y,z} + if cmdType == "point" then + lastMapmarkCoords = { x, y, z } end end function widget:AddConsoleLine(lines, priority) - if priority and priority == L_DEPRECATED and not isDevSingle then return end - lines = lines:match('^%[f=[0-9]+%] (.*)$') or lines + if priority and priority == L_DEPRECATED and not isDevSingle then + return + end + lines = lines:match("^%[f=[0-9]+%] (.*)$") or lines for line in lines:gmatch("[^\n]+") do processAddConsoleLine(spGetGameFrame(), line) end end function widget:ViewResize() - vsx,vsy = Spring.GetViewGeometry() + vsx, vsy = Spring.GetViewGeometry() widgetScale = vsy * 0.00075 * ui_scale @@ -2585,19 +2584,19 @@ function widget:ViewResize() elementPadding = WG.FlowUI.elementPadding elementMargin = WG.FlowUI.elementMargin RectRound = WG.FlowUI.Draw.RectRound - charSize = 21 * math.clamp(1+((1-(vsy/1200))*0.5), 1, 1.2) -- increase for small resolutions - usedFontSize = charSize*widgetScale*fontsizeMult - usedConsoleFontSize = usedFontSize*consoleFontSizeMult + charSize = 21 * math.clamp(1 + ((1 - (vsy / 1200)) * 0.5), 1, 1.2) -- increase for small resolutions + usedFontSize = charSize * widgetScale * fontsizeMult + usedConsoleFontSize = usedFontSize * consoleFontSizeMult - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2, 1.2, 0.13, 20) - font3 = WG['fonts'].getFont(3) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2, 1.2, 0.13, 20) + font3 = WG["fonts"].getFont(3) -- get longest player name and calc its width if not font or not longestPlayername then return end - local namePrefix = '(s)' + local namePrefix = "(s)" local namePrefixWidth = font:GetTextWidth(namePrefix) maxPlayernameWidth = (namePrefixWidth + font:GetTextWidth(longestPlayername)) * usedFontSize for _, playerID in ipairs(playersList) do @@ -2611,21 +2610,21 @@ function widget:ViewResize() end end end - maxTimeWidth = font3:GetTextWidth('00:00') * usedFontSize - lineSpaceWidth = 24*widgetScale - lineHeight = floor(usedFontSize*lineHeightMult) - consoleLineHeight = mathFloor(usedConsoleFontSize*lineHeightMult) - backgroundPadding = elementPadding + floor(lineHeight*0.5) + maxTimeWidth = font3:GetTextWidth("00:00") * usedFontSize + lineSpaceWidth = 24 * widgetScale + lineHeight = floor(usedFontSize * lineHeightMult) + consoleLineHeight = mathFloor(usedConsoleFontSize * lineHeightMult) + backgroundPadding = elementPadding + floor(lineHeight * 0.5) local posY2 = 0.94 - if WG['topbar'] ~= nil then - topbarArea = WG['topbar'].GetPosition() - posY2 = floor(topbarArea[2] - elementMargin)/vsy - posX = topbarArea[1]/vsx - scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight*maxLinesScroll)) / vsy + if WG["topbar"] ~= nil then + topbarArea = WG["topbar"].GetPosition() + posY2 = floor(topbarArea[2] - elementMargin) / vsy + posX = topbarArea[1] / vsx + scrollingPosY = floor(topbarArea[2] - elementMargin - backgroundPadding - backgroundPadding - (lineHeight * maxLinesScroll)) / vsy end consolePosY = floor((vsy * posY2) - backgroundPadding - (maxConsoleLines * consoleLineHeight)) / vsy - posY = floor((consolePosY*vsy) - (backgroundPadding*1.5) - ((lineHeight*maxLines))) / vsy + posY = floor((consolePosY * vsy) - (backgroundPadding * 1.5) - (lineHeight * maxLines)) / vsy activationArea = { floor(vsx * posX), @@ -2651,8 +2650,8 @@ function widget:PlayerChanged(playerID) mySpec = spGetSpectatingState() myTeamID = spGetMyTeamID() myAllyTeamID = Spring.GetMyAllyTeamID() - if mySpec and inputMode == 'a:' then - inputMode = 's:' + if mySpec and inputMode == "a:" then + inputMode = "s:" end local name, _, isSpec, teamID, allyTeamID = spGetPlayerInfo(playerID, false) --local historyName = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID)) or name @@ -2667,7 +2666,7 @@ function widget:PlayerChanged(playerID) if isSpec ~= playernames[name][2] then playernames[name][2] = isSpec if isSpec then - playernames[name][8] = Spring.GetGameFrame() -- log frame of death + playernames[name][8] = Spring.GetGameFrame() -- log frame of death if (not playernames[name][5]) and teamID and teamID ~= Spring.GetGaiaTeamID() then playernames[name][5] = { spGetTeamColor(teamID) } end @@ -2687,9 +2686,9 @@ function widget:PlayerAdded(playerID) end end playernames[name] = { allyTeamID, isSpec, teamID, playerID, teamColor, teamColor and ColorIsDark(teamColor[1], teamColor[2], teamColor[3]) or false, historyName } - autocompletePlayernames[#autocompletePlayernames+1] = name + autocompletePlayernames[#autocompletePlayernames + 1] = name if historyName ~= name then - autocompletePlayernames[#autocompletePlayernames+1] = historyName + autocompletePlayernames[#autocompletePlayernames + 1] = historyName end end @@ -2706,11 +2705,11 @@ end local function hidespecchatCmd(_, _, params) if params[1] then - hideSpecChat = (params[1] == '1') + hideSpecChat = (params[1] == "1") else hideSpecChat = not hideSpecChat end - Spring.SetConfigInt('HideSpecChat', hideSpecChat and 1 or 0) + Spring.SetConfigInt("HideSpecChat", hideSpecChat and 1 or 0) if hideSpecChat then spEcho("Hiding all spectator chat") else @@ -2720,11 +2719,11 @@ end local function hidespecchatplayerCmd(_, _, params) if params[1] then - hideSpecChatPlayer = (params[1] == '1') + hideSpecChatPlayer = (params[1] == "1") else hideSpecChatPlayer = not hideSpecChatPlayer end - Spring.SetConfigInt('HideSpecChatPlayer', hideSpecChatPlayer and 1 or 0) + Spring.SetConfigInt("HideSpecChatPlayer", hideSpecChatPlayer and 1 or 0) if hideSpecChat then spEcho("Hiding all spectator chat when player") else @@ -2742,9 +2741,8 @@ local function preventhistorymodeCmd(_, _, params) end end - function widget:Initialize() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! -- Ensure ColorString and ColorIsDark are initialized if not ColorString and Spring.Utilities and Spring.Utilities.Color then @@ -2763,7 +2761,7 @@ function widget:Initialize() local teamID = teams[i] local r, g, b = spGetTeamColor(teamID) local _, playerID, _, isAiTeam, _, allyTeamID = spGetTeamInfo(teamID, false) - teamColorKeys[teamID] = r..'_'..g..'_'..b + teamColorKeys[teamID] = r .. "_" .. g .. "_" .. b local aiName if isAiTeam then aiName = getAIName(teamID) @@ -2789,80 +2787,80 @@ function widget:Initialize() Spring.SendCommands("console 0") - WG['chat'] = {} - WG['chat'].isInputActive = function() + WG["chat"] = {} + WG["chat"].isInputActive = function() return showTextInput end - WG['chat'].getInputButton = function() + WG["chat"].getInputButton = function() return inputButton end - WG['chat'].setHide = function(value) + WG["chat"].setHide = function(value) hide = value end - WG['chat'].getHide = function() + WG["chat"].getHide = function() return hide end - WG['chat'].setChatInputHistory = function(value) + WG["chat"].setChatInputHistory = function(value) showHistoryWhenChatInput = value end - WG['chat'].getChatInputHistory = function() + WG["chat"].getChatInputHistory = function() return showHistoryWhenChatInput end - WG['chat'].setInputButton = function(value) + WG["chat"].setInputButton = function(value) inputButton = value end - WG['chat'].getHandleInput = function() + WG["chat"].getHandleInput = function() return handleTextInput end - WG['chat'].setHandleInput = function(value) + WG["chat"].setHandleInput = function(value) handleTextInput = value if not handleTextInput then cancelChatInput() end - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end - WG['chat'].getChatVolume = function() + WG["chat"].getChatVolume = function() return sndChatFileVolume end - WG['chat'].setChatVolume = function(value) + WG["chat"].setChatVolume = function(value) sndChatFileVolume = value end - WG['chat'].getBackgroundOpacity = function() + WG["chat"].getBackgroundOpacity = function() return backgroundOpacity end - WG['chat'].setBackgroundOpacity = function(value) + WG["chat"].setBackgroundOpacity = function(value) backgroundOpacity = value end - WG['chat'].getMaxLines = function() + WG["chat"].getMaxLines = function() return maxLines end - WG['chat'].setMaxLines = function(value) + WG["chat"].setMaxLines = function(value) maxLines = value widget:ViewResize() end - WG['chat'].getMaxConsoleLines = function() + WG["chat"].getMaxConsoleLines = function() return maxLines end - WG['chat'].setMaxConsoleLines = function(value) + WG["chat"].setMaxConsoleLines = function(value) maxConsoleLines = value widget:ViewResize() end - WG['chat'].getFontsize = function() + WG["chat"].getFontsize = function() return fontsizeMult end - WG['chat'].setFontsize = function(value) + WG["chat"].setFontsize = function(value) fontsizeMult = value widget:ViewResize() end - WG['chat'].addChatLine = function(gameFrame, lineType, name, nameText, text, orgLineID, ignore, chatLineID) + WG["chat"].addChatLine = function(gameFrame, lineType, name, nameText, text, orgLineID, ignore, chatLineID) addChatLine(gameFrame, lineType, name, nameText, text, orgLineID, ignore, chatLineID, true) end - WG['chat'].addChatProcessor = function(id, func) - if type(func) == 'function' then + WG["chat"].addChatProcessor = function(id, func) + if type(func) == "function" then chatProcessors[id] = func end end - WG['chat'].removeChatProcessor = function(id) + WG["chat"].removeChatProcessor = function(id) chatProcessors[id] = nil end @@ -2870,10 +2868,10 @@ function widget:Initialize() processAddConsoleLine(params[1], params[2], orgLineID) end - widgetHandler.actionHandler:AddAction(self, "clearconsole", clearconsoleCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "hidespecchat", hidespecchatCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "hidespecchatplayer", hidespecchatplayerCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "preventhistorymode", preventhistorymodeCmd, nil, 't') + widgetHandler.actionHandler:AddAction(self, "clearconsole", clearconsoleCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "hidespecchat", hidespecchatCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "hidespecchatplayer", hidespecchatplayerCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "preventhistorymode", preventhistorymodeCmd, nil, "t") for _, playerID in ipairs(playersList) do local name, _, isSpec, teamID, allyTeamID = spGetPlayerInfo(playerID, false) @@ -2886,21 +2884,21 @@ function widget:Initialize() end end playernames[name] = { allyTeamID, isSpec, teamID, playerID, teamColor, teamColor and ColorIsDark(teamColor[1], teamColor[2], teamColor[3]) or false, historyName } - autocompletePlayernames[#autocompletePlayernames+1] = name + autocompletePlayernames[#autocompletePlayernames + 1] = name if historyName ~= name then - autocompletePlayernames[#autocompletePlayernames+1] = historyName + autocompletePlayernames[#autocompletePlayernames + 1] = historyName end end end function widget:Shutdown() - clearDisplayLists() -- console/chat displaylists + clearDisplayLists() -- console/chat displaylists glDeleteList(textInputDlist) - WG['chat'] = nil - if WG['guishader'] then - WG['guishader'].RemoveRect('chat') - WG['guishader'].RemoveRect('chatinput') - WG['guishader'].RemoveRect('chatinputautocomplete') + WG["chat"] = nil + if WG["guishader"] then + WG["guishader"].RemoveRect("chat") + WG["guishader"].RemoveRect("chatinput") + WG["guishader"].RemoveRect("chatinputautocomplete") end if uiTex then gl.DeleteTexture(uiTex) @@ -2969,17 +2967,17 @@ end function widget:GetConfigData(data) local inputHistoryLimited = {} - for k,v in ipairs(inputHistory) do + for k, v in ipairs(inputHistory) do if k >= (#inputHistory - 50) then - inputHistoryLimited[#inputHistoryLimited+1] = v + inputHistoryLimited[#inputHistoryLimited + 1] = v end end local maxOrgLines = orgLineCleanupTarget if #orgLines > maxOrgLines then local prunedOrgLines = {} - for i=1, maxOrgLines do - prunedOrgLines[i] = orgLines[(#orgLines-maxOrgLines)+i] + for i = 1, maxOrgLines do + prunedOrgLines[i] = orgLines[(#orgLines - maxOrgLines) + i] end orgLines = prunedOrgLines end diff --git a/luaui/Widgets/gui_clearmapmarks.lua b/luaui/Widgets/gui_clearmapmarks.lua index 3226ded3480..982b67de21c 100644 --- a/luaui/Widgets/gui_clearmapmarks.lua +++ b/luaui/Widgets/gui_clearmapmarks.lua @@ -2,29 +2,28 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Clearmapmarks button", - desc = "clears mapmarks, located next to advplayerlist", - author = "Floris", - date = "24 july 2016", - license = "GNU GPL, v2 or later", - layer = -5, -- set to -5 to draw mascotte on top of advplayerlist - enabled = true + name = "Clearmapmarks button", + desc = "clears mapmarks, located next to advplayerlist", + author = "Floris", + date = "24 july 2016", + license = "GNU GPL, v2 or later", + layer = -5, -- set to -5 to draw mascotte on top of advplayerlist + enabled = true, } end - -- Localized Spring API for performance local spEcho = Spring.Echo local iconTexture = ":n:LuaUI/Images/mapmarksfx/eraser.dds" local iconSize = 18 -local glTranslate = gl.Translate -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glTranslate = gl.Translate +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList local advplayerlistPos = {} local drawlist = {} @@ -35,43 +34,43 @@ local usedImgSize = iconSize local continuouslyClean = false local math_isInRect = math.isInRect -local function RectQuad(px,py,sx,sy) - local o = 0.008 -- texture offset, because else grey line might show at the edges - gl.TexCoord(o,1-o) +local function RectQuad(px, py, sx, sy) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o, 1 - o) gl.Vertex(px, py, 0) - gl.TexCoord(1-o,1-o) + gl.TexCoord(1 - o, 1 - o) gl.Vertex(sx, py, 0) - gl.TexCoord(1-o,o) + gl.TexCoord(1 - o, o) gl.Vertex(sx, sy, 0) - gl.TexCoord(o,o) + gl.TexCoord(o, o) gl.Vertex(px, sy, 0) end -local function DrawRect(px,py,sx,sy) - gl.BeginEnd(GL.QUADS, RectQuad, px,py,sx,sy) +local function DrawRect(px, py, sx, sy) + gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy) end local function createList(size) if drawlist[1] ~= nil then glDeleteList(drawlist[1]) end - drawlist[1] = glCreateList( function() + drawlist[1] = glCreateList(function() gl.Texture(iconTexture) DrawRect(-usedImgSize, 0, 0, usedImgSize) gl.Texture(false) end) - if WG['tooltip'] ~= nil then - WG['tooltip'].AddTooltip('clearmapmarks', {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}, Spring.I18N('ui.clearMapmarks.tooltipctrl'), nil, Spring.I18N('ui.clearMapmarks.tooltip')) + if WG["tooltip"] ~= nil then + WG["tooltip"].AddTooltip("clearmapmarks", { xPos - usedImgSize, yPos, xPos, yPos + usedImgSize }, Spring.I18N("ui.clearMapmarks.tooltipctrl"), nil, Spring.I18N("ui.clearMapmarks.tooltip")) end end local function updatePosition(force) - if WG['advplayerlist_api'] ~= nil then + if WG["advplayerlist_api"] ~= nil then local vsx, vsy = Spring.GetViewGeometry() local margin = WG.FlowUI.elementPadding xPos = vsx - margin local prevPos = advplayerlistPos - advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + advplayerlistPos = WG["advplayerlist_api"].GetPosition() -- returns {top,left,bottom,right,widgetScale} usedImgSize = math.floor(iconSize * advplayerlistPos[5]) --xPos = advplayerlistPos[2] + margin + usedImgSize yPos = advplayerlistPos[3] @@ -115,32 +114,31 @@ end function widget:DrawScreen() if drawlist[1] ~= nil then - local mx,my = Spring.GetMouseState() + local mx, my = Spring.GetMouseState() glPushMatrix() - glTranslate(xPos, yPos, 0) - if math_isInRect(mx, my, xPos-usedImgSize, yPos, xPos, yPos+usedImgSize) then - --Spring.SetMouseCursor('cursornormal') - gl.Color(1,1,1,1) - else - gl.Color(0.88,0.88,0.88,0.9) - end - glCallList(drawlist[1]) + glTranslate(xPos, yPos, 0) + if math_isInRect(mx, my, xPos - usedImgSize, yPos, xPos, yPos + usedImgSize) then + --Spring.SetMouseCursor('cursornormal') + gl.Color(1, 1, 1, 1) + else + gl.Color(0.88, 0.88, 0.88, 0.9) + end + glCallList(drawlist[1]) glPopMatrix() end end - function widget:MousePress(mx, my, mb) - if mb == 1 and math_isInRect(mx, my, xPos-usedImgSize, yPos, xPos, yPos+usedImgSize) then + if mb == 1 and math_isInRect(mx, my, xPos - usedImgSize, yPos, xPos, yPos + usedImgSize) then return true end end function widget:MouseRelease(mx, my, mb) - if mb == 1 and math_isInRect(mx, my, xPos-usedImgSize, yPos, xPos, yPos+usedImgSize) then - Spring.SendCommands({"clearmapmarks"}) + if mb == 1 and math_isInRect(mx, my, xPos - usedImgSize, yPos, xPos, yPos + usedImgSize) then + Spring.SendCommands({ "clearmapmarks" }) updatePosition(true) - if Script.LuaUI('ClearMapMarks') then + if Script.LuaUI("ClearMapMarks") then Script.LuaUI.ClearMapMarks() end local alt, ctrl, meta, shift = Spring.GetModKeyState() diff --git a/luaui/Widgets/gui_com_nametags.lua b/luaui/Widgets/gui_com_nametags.lua index 34366586d87..5bb6c51dc38 100644 --- a/luaui/Widgets/gui_com_nametags.lua +++ b/luaui/Widgets/gui_com_nametags.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -69,14 +68,14 @@ local glDeleteFont = gl.DeleteFont -- config -------------------------------------------------------------------------------- -local hideBelowGameframe = 130 -- delay to give spawn fx some time -local drawForIcon = true -- note that commander icon still gets drawn on top of the name +local hideBelowGameframe = 130 -- delay to give spawn fx some time +local drawForIcon = true -- note that commander icon still gets drawn on top of the name local nameScaling = true -local useThickLeterring = false -- Sorry, the performance cost of this is quite high :( doubles the cost of a draw call +local useThickLeterring = false -- Sorry, the performance cost of this is quite high :( doubles the cost of a draw call local heightOffset = 50 -local fontSize = 15 -- not real fontsize, it will be scaled +local fontSize = 15 -- not real fontsize, it will be scaled local scaleFontAmount = 120 -local fontShadow = true -- only shows if font has a white outline +local fontShadow = true -- only shows if font has a white outline local shadowOpacity = 0.35 local showPlayerRank = false @@ -118,7 +117,7 @@ end local isSinglePlayer = Spring.Utilities.Gametype.IsSinglePlayer() local anonymousMode = spGetModOptions().teamcolors_anonymous_mode -local anonymousName = '?????' +local anonymousName = "?????" local usedFontSize = fontSize @@ -144,12 +143,12 @@ local myTeamID = spGetMyTeamID() local GaiaTeam = spGetGaiaTeamID() -- Performance optimization caches -local lastCameraPos = {0, 0, 0} +local lastCameraPos = { 0, 0, 0 } local iconScaleCache = {} -- Cache icon scales to avoid recalculating -local iconResScale = math.sqrt(vsy / 1080) -- resolution compensation for icon nametags +local iconResScale = math.sqrt(vsy / 1080) -- resolution compensation for icon nametags local comHeight = {} -local comDefIDList = {} -- array of commander DefIDs for GetTeamUnitsByDefs +local comDefIDList = {} -- array of commander DefIDs for GetTeamUnitsByDefs for unitDefID, defs in pairs(UnitDefs) do if defs.customParams.iscommander or defs.customParams.isdecoycommander or defs.customParams.isscavcommander or defs.customParams.isscavdecoycommander then comHeight[unitDefID] = defs.height @@ -158,8 +157,8 @@ for unitDefID, defs in pairs(UnitDefs) do end local sameTeamColors = false -if WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors ~= nil then - sameTeamColors = WG['playercolorpalette'].getSameTeamColors() +if WG["playercolorpalette"] ~= nil and WG["playercolorpalette"].getSameTeamColors ~= nil then + sameTeamColors = WG["playercolorpalette"].getSameTeamColors() end -------------------------------------------------------------------------------- @@ -178,38 +177,37 @@ local function GetCommAttributes(unitID, unitDefID) end local playerRank - local name = '' + local name = "" local luaAI = spGetTeamLuaAI(team) - if luaAI and luaAI ~= "" and stringFind(luaAI, 'Scavengers') then + if luaAI and luaAI ~= "" and stringFind(luaAI, "Scavengers") then --name = "Scav Commander" -- todo: i18n this thing local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.scavDecoyCommanderNameTag') + name = Spring.I18N("units.scavDecoyCommanderNameTag") else - name = Spring.I18N('units.scavCommanderNameTag') + name = Spring.I18N("units.scavCommanderNameTag") end - elseif spGetGameRulesParam('ainame_' .. team) then + elseif spGetGameRulesParam("ainame_" .. team) then local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.decoyCommanderNameTag') + name = Spring.I18N("units.decoyCommanderNameTag") else - name = Spring.I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. team) }) + name = Spring.I18N("ui.playersList.aiName", { name = spGetGameRulesParam("ainame_" .. team) }) end - else local unitDefCustomParams = UnitDefs[unitDefID].customParams if unitDefCustomParams.decoyfor then - name = Spring.I18N('units.decoyCommanderNameTag') + name = Spring.I18N("units.decoyCommanderNameTag") else local players = spGetPlayerList(team) local playersLen = players and #players or 0 if playersLen > 0 then local firstPlayer = players[1] - name = spGetPlayerInfo(firstPlayer, false) or '------' + name = spGetPlayerInfo(firstPlayer, false) or "------" name = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(firstPlayer)) or name playerRank = select(9, spGetPlayerInfo(firstPlayer, false)) else - name = '------' + name = "------" end if playersLen > 0 then @@ -230,7 +228,7 @@ local function GetCommAttributes(unitID, unitDefID) local r, g, b, a = spGetTeamColor(team) local bgColor = { 0, 0, 0, 1 } if ColorIsDark(r, g, b) then - bgColor = { 1, 1, 1, 1 } -- try to keep these values the same as the playerlist + bgColor = { 1, 1, 1, 1 } -- try to keep these values the same as the playerlist end local skill @@ -252,7 +250,7 @@ local function GetCommAttributes(unitID, unitDefID) local xp = 0 local height = comHeight[unitDefID] + heightOffset - return { name, { r, g, b, a }, height, bgColor, nil, playerRank and playerRank+1, xp, skill} + return { name, { r, g, b, a }, height, bgColor, nil, playerRank and playerRank + 1, xp, skill } end local function RemoveLists() @@ -274,20 +272,19 @@ local function GetComnameListKey(attributes) return stringFormat("%s|%.4f|%.4f|%.4f|%.4f|%s|%s", name, c[1] or 1, c[2] or 1, c[3] or 1, c[4] or 1, rank, skill) end - local function createComnameList(attributes) local listKey = GetComnameListKey(attributes) if comnameList[listKey] ~= nil then glDeleteList(comnameList[listKey]) end comnameList[listKey] = glCreateList(function() - local x,y = 0,0 + local x, y = 0, 0 if (anonymousMode == "disabled" or spec) and showPlayerRank and attributes[6] and not isSinglePlayer then - x = (playerRankSize*0.5) + x = (playerRankSize * 0.5) end local outlineColor = { 0, 0, 0, 1 } if ColorIsDark(attributes[2][1], attributes[2][2], attributes[2][3]) then - outlineColor = { 1, 1, 1, 1 } -- try to keep these values the same as the playerlist + outlineColor = { 1, 1, 1, 1 } -- try to keep these values the same as the playerlist end local name = attributes[1] if anonymousMode ~= "disabled" and not spec then @@ -306,8 +303,8 @@ local function createComnameList(attributes) font:SetTextColor(outlineColor) font:SetOutlineColor(outlineColor) - font:Print(name, x-(fontSize / 38), y-(fontSize / 33), fontSize, "con") - font:Print(name, x+(fontSize / 38), y-(fontSize / 33), fontSize, "con") + font:Print(name, x - (fontSize / 38), y - (fontSize / 33), fontSize, "con") + font:Print(name, x + (fontSize / 38), y - (fontSize / 33), fontSize, "con") end font:Begin() font:SetTextColor(attributes[2]) @@ -317,26 +314,25 @@ local function createComnameList(attributes) -- player rank if showPlayerRank and attributes[6] and (anonymousMode == "disabled" or spec) and not isSinglePlayer then - local halfSize = playerRankSize*0.5 + local halfSize = playerRankSize * 0.5 local x_l = x - (((font:GetTextWidth(name) * fontSize) * 0.5) + halfSize + (fontSize * 0.1)) local y_l = y + (fontSize * 0.33) - glTexture(playerRankImages..attributes[6]..'.png') - glTexRect(x_l-halfSize, y_l-halfSize, x_l+halfSize, y_l+halfSize) + glTexture(playerRankImages .. attributes[6] .. ".png") + glTexRect(x_l - halfSize, y_l - halfSize, x_l + halfSize, y_l + halfSize) glTexture(false) -- skill value if showSkillValue and attributes[8] then font:Begin() - font:SetTextColor(0.66,0.66,0.66,1) - font:SetOutlineColor(0,0,0,0.6) - font:Print(attributes[8], x_l-(playerRankSize*0.86), y_l-(playerRankSize*0.29), playerRankSize*0.66, "con") + font:SetTextColor(0.66, 0.66, 0.66, 1) + font:SetOutlineColor(0, 0, 0, 0.6) + font:Print(attributes[8], x_l - (playerRankSize * 0.86), y_l - (playerRankSize * 0.29), playerRankSize * 0.66, "con") font:End() end end end) end - local function CheckCom(unitID, unitDefID, unitTeam) if not comHeight[unitDefID] or unitTeam == GaiaTeam then if comms[unitID] then @@ -368,15 +364,7 @@ local function CheckCom(unitID, unitDefID, unitTeam) return true end - local hasChanged = ( - oldAttributes[1] ~= newAttributes[1] - or oldAttributes[6] ~= newAttributes[6] - or oldAttributes[8] ~= newAttributes[8] - or oldAttributes[2][1] ~= newAttributes[2][1] - or oldAttributes[2][2] ~= newAttributes[2][2] - or oldAttributes[2][3] ~= newAttributes[2][3] - or oldAttributes[2][4] ~= newAttributes[2][4] - ) + local hasChanged = (oldAttributes[1] ~= newAttributes[1] or oldAttributes[6] ~= newAttributes[6] or oldAttributes[8] ~= newAttributes[8] or oldAttributes[2][1] ~= newAttributes[2][1] or oldAttributes[2][2] ~= newAttributes[2][2] or oldAttributes[2][3] ~= newAttributes[2][3] or oldAttributes[2][4] ~= newAttributes[2][4]) if hasChanged then if comnameIconList[unitID] then @@ -388,7 +376,6 @@ local function CheckCom(unitID, unitDefID, unitTeam) return hasChanged end - -- check if team colors have changed local function CheckTeamColors() local detectedChanges = false @@ -409,7 +396,6 @@ local function CheckTeamColors() return detectedChanges end - local function CheckAllComs() -- Only check team colors if needed local colorChanged = CheckTeamColors() @@ -462,7 +448,7 @@ function widget:Update(dt) -- Check color palette changes less frequently (every 0.5 seconds instead of every frame) if colorCheckSec > 0.5 then colorCheckSec = 0 - local playerColorPalette = WG['playercolorpalette'] + local playerColorPalette = WG["playercolorpalette"] if playerColorPalette ~= nil then local getSameTeamColors = playerColorPalette.getSameTeamColors if getSameTeamColors and sameTeamColors ~= getSameTeamColors() then @@ -567,7 +553,7 @@ local function createComnameIconList(unitID, attributes) outlineColor = { 1, 1, 1, 1 } end local name = attributes[1] - if anonymousMode ~= "disabled" and (not spec) then + if anonymousMode ~= "disabled" and not spec then name = anonymousName end fonticon:Begin() @@ -579,10 +565,14 @@ local function createComnameIconList(unitID, attributes) end) end -function widget:DrawScreenEffects() -- using DrawScreenEffects so nametags render after deferred lighting, +function widget:DrawScreenEffects() -- using DrawScreenEffects so nametags render after deferred lighting, -- distortion, bloom and tonemapping passes — keeps them readable and uncolored - if spIsGUIHidden() then return end - if spGetGameFrame() < hideBelowGameframe then return end + if spIsGUIHidden() then + return + end + if spGetGameFrame() < hideBelowGameframe then + return + end -- untested fix: when you resign, to also show enemy com playernames if not CheckedForSpec and spGetGameFrame() > 1 then @@ -631,8 +621,12 @@ function widget:DrawScreenEffects() -- using DrawScreenEffects so nametags rende -- a small near-camera bump. local worldScale = 0.5 + camDistance / (scaleFontAmount * fontSize) local screenScale = worldScale * (vsy * 1.22 / camDistance) - if screenScale < 0.9 then screenScale = 0.9 end - if screenScale > 5.0 then screenScale = 5.0 end + if screenScale < 0.9 then + screenScale = 0.9 + end + if screenScale > 5.0 then + screenScale = 5.0 + end glPushMatrix() glTranslate(sx, sy, 0) glScale(screenScale, screenScale, screenScale) @@ -695,9 +689,6 @@ function widget:DrawScreenEffects() -- using DrawScreenEffects so nametags rende glColor(1, 1, 1, 1) end - - - function widget:DrawWorld() -- intentionally empty; nametags are now drawn in DrawScreenEffects so they -- render after distortion, bloom and tonemap passes (which would otherwise @@ -722,12 +713,12 @@ function widget:Initialize() for _, teamID in ipairs(spGetTeamList()) do if teamID ~= GaiaTeam then local playerRank - local name = '' + local name = "" local luaAI = spGetTeamLuaAI(teamID) - if luaAI and luaAI ~= "" and stringFind(luaAI, 'Scavengers') then - name = Spring.I18N('units.scavCommanderNameTag') - elseif spGetGameRulesParam('ainame_' .. teamID) then - name = Spring.I18N('ui.playersList.aiName', { name = spGetGameRulesParam('ainame_' .. teamID) }) + if luaAI and luaAI ~= "" and stringFind(luaAI, "Scavengers") then + name = Spring.I18N("units.scavCommanderNameTag") + elseif spGetGameRulesParam("ainame_" .. teamID) then + name = Spring.I18N("ui.playersList.aiName", { name = spGetGameRulesParam("ainame_" .. teamID) }) else local players = spGetPlayerList(teamID) local playersLen = players and #players or 0 @@ -742,17 +733,17 @@ function widget:Initialize() break end end - if name == '' then - name = spGetPlayerInfo(players[1], false) or '------' + if name == "" then + name = spGetPlayerInfo(players[1], false) or "------" name = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(players[1])) or name playerRank = select(9, spGetPlayerInfo(players[1], false)) end else - name = '------' + name = "------" end end - if name ~= '' then + if name ~= "" then local r, g, b, a = spGetTeamColor(teamID) local skill if showSkillValue then @@ -848,7 +839,7 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - widgetHandler:AddAction("comnamescale", toggleNameScaling, nil, 'p') + widgetHandler:AddAction("comnamescale", toggleNameScaling, nil, "p") if data.nameScaling ~= nil then nameScaling = data.nameScaling end diff --git a/luaui/Widgets/gui_commanderhurt.lua b/luaui/Widgets/gui_commanderhurt.lua index 522e7a58436..34986e30e3f 100644 --- a/luaui/Widgets/gui_commanderhurt.lua +++ b/luaui/Widgets/gui_commanderhurt.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Commander Hurt Vignette", - desc = "Shows a red vignette when commander is out of view and gets damaged", - author = "Floris", - date = "February 2018", - license = "GNU GPL, v2 or whatever", - layer = 111, - enabled = true - } + return { + name = "Commander Hurt Vignette", + desc = "Shows a red vignette when commander is out of view and gets damaged", + author = "Floris", + date = "February 2018", + license = "GNU GPL, v2 or whatever", + layer = 111, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -22,7 +21,7 @@ local spGetSpectatingState = Spring.GetSpectatingState -- Declarations --------------------------------------------------------------------------------------------------- -local vignetteTexture = ":n:"..LUAUI_DIRNAME.."Images/vignette.dds" +local vignetteTexture = ":n:" .. LUAUI_DIRNAME .. "Images/vignette.dds" local duration = 1.55 local maxOpacity = 0.55 @@ -44,7 +43,7 @@ function createList() local vsx, vsy = gl.GetViewSizes() dList = gl.CreateList(function() gl.Texture(vignetteTexture) - gl.TexRect(-(vsx/25), -(vsy/25), vsx+(vsx/25), vsy+(vsy/25)) + gl.TexRect(-(vsx / 25), -(vsy / 25), vsx + (vsx / 25), vsy + (vsy / 25)) gl.Texture(false) end) end @@ -56,7 +55,6 @@ function widget:Initialize() end end - function widget:PlayerChanged(playerID) myTeamID = spGetMyTeamID() if spGetSpectatingState() and spGetGameFrame() > 0 then @@ -64,7 +62,6 @@ function widget:PlayerChanged(playerID) end end - function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) if damage > 3 and unitTeam == myTeamID and comUnitDefIDs[unitDefID] and not Spring.IsUnitVisible(unitID) then if spGetSpectatingState() then @@ -75,23 +72,22 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) end end -function widget:ViewResize(newX,newY) +function widget:ViewResize(newX, newY) if dList ~= nil then gl.DeleteList(dList) end createList() end - function widget:Update(dt) if opacity > 0 then - opacity = opacity - (maxOpacity * (dt/duration)) + opacity = opacity - (maxOpacity * (dt / duration)) end end function widget:DrawScreen() if opacity > 0.01 then - gl.Color(1,0,0,opacity) + gl.Color(1, 0, 0, opacity) gl.CallList(dList) end end diff --git a/luaui/Widgets/gui_commands_fx.lua b/luaui/Widgets/gui_commands_fx.lua index 519ffa0ebe1..ed2a6557f7c 100644 --- a/luaui/Widgets/gui_commands_fx.lua +++ b/luaui/Widgets/gui_commands_fx.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathMax = math.max @@ -26,25 +25,25 @@ local spGetSpectatingState = Spring.GetSpectatingState -- Command IDs consolidated into single table to reduce upvalue count local CMDS = { - RAW_MOVE = GameCMD.RAW_MOVE, - ATTACK = CMD.ATTACK, - CAPTURE = CMD.CAPTURE, - FIGHT = CMD.FIGHT, - GUARD = CMD.GUARD, - INSERT = CMD.INSERT, - LOAD_ONTO = CMD.LOAD_ONTO, - LOAD_UNITS = CMD.LOAD_UNITS, - MANUALFIRE = CMD.MANUALFIRE, - MOVE = CMD.MOVE, - PATROL = CMD.PATROL, - RECLAIM = CMD.RECLAIM, - REPAIR = CMD.REPAIR, - RESTORE = CMD.RESTORE, - RESURRECT = CMD.RESURRECT, + RAW_MOVE = GameCMD.RAW_MOVE, + ATTACK = CMD.ATTACK, + CAPTURE = CMD.CAPTURE, + FIGHT = CMD.FIGHT, + GUARD = CMD.GUARD, + INSERT = CMD.INSERT, + LOAD_ONTO = CMD.LOAD_ONTO, + LOAD_UNITS = CMD.LOAD_UNITS, + MANUALFIRE = CMD.MANUALFIRE, + MOVE = CMD.MOVE, + PATROL = CMD.PATROL, + RECLAIM = CMD.RECLAIM, + REPAIR = CMD.REPAIR, + RESTORE = CMD.RESTORE, + RESURRECT = CMD.RESURRECT, -- SET_TARGET = GameCMD.UNIT_SET_TARGET, -- custom command, doesn't go through UnitCommand - UNLOAD_UNIT = CMD.UNLOAD_UNIT, + UNLOAD_UNIT = CMD.UNLOAD_UNIT, UNLOAD_UNITS = CMD.UNLOAD_UNITS, - BUILD = -1, + BUILD = -1, } local os_clock = os.clock @@ -71,7 +70,7 @@ local newUnitCommands = {} local useTeamColors = false local useTeamColorsWhenSpec = true -local hideBelowGameframe = 100 -- delay to give spawn fx some time +local hideBelowGameframe = 100 -- delay to give spawn fx some time local filterOwn = false local filterAIteams = true @@ -84,15 +83,15 @@ local duration = 0.85 local lineWidth = 5.5 local lineOpacity = 0.75 -local lineWidthEnd = 0.8 -- multiplier +local lineWidthEnd = 0.8 -- multiplier local lineTextureLength = 3 local lineTextureSpeed = 4 -- limit amount of effects to keep performance sane -local maxCommandCount = 700 -- dont draw more commands than this amount, but keep processing them -local maxTotalCommandCount = 1200 -- dont add more commands above this amount -local cmdLimitPerUnitBase = 50 -- max commands fetched per unit at low load -local cmdLimitPerUnitMin = 8 -- min commands fetched per unit at high load +local maxCommandCount = 700 -- dont draw more commands than this amount, but keep processing them +local maxTotalCommandCount = 1200 -- dont add more commands above this amount +local cmdLimitPerUnitBase = 50 -- max commands fetched per unit at low load +local cmdLimitPerUnitMin = 8 -- min commands fetched per unit at high load local cmdLimitPerUnit = cmdLimitPerUnitBase local lineImg = ":n:LuaUI/Images/commandsfx/line.dds" @@ -116,23 +115,23 @@ local mapZ = Game.mapSizeZ -- CONFIG maps command ID directly to colour {r, g, b, alpha} — flat lookup, no .colour indirection local CONFIG = { - [CMDS.ATTACK] = { 1.0, 0.2, 0.2, 0.30 }, - [CMDS.CAPTURE] = { 1.0, 1.0, 0.3, 0.30 }, - [CMDS.FIGHT] = { 1.0, 0.2, 1.0, 0.25 }, - [CMDS.GUARD] = { 0.6, 1.0, 1.0, 0.25 }, - [CMDS.LOAD_ONTO] = { 0.4, 0.9, 0.9, 0.25 }, - [CMDS.LOAD_UNITS] = { 0.4, 0.9, 0.9, 0.30 }, - [CMDS.MANUALFIRE] = { 1.0, 0.0, 0.0, 0.30 }, - [CMDS.MOVE] = { 0.1, 1.0, 0.1, 0.25 }, - [CMDS.RAW_MOVE] = { 0.1, 1.0, 0.1, 0.25 }, - [CMDS.PATROL] = { 0.2, 0.5, 1.0, 0.25 }, - [CMDS.RECLAIM] = { 0.5, 1.0, 0.4, 0.40 }, - [CMDS.REPAIR] = { 1.0, 0.9, 0.2, 0.40 }, - [CMDS.RESTORE] = { 0.0, 0.5, 0.0, 0.25 }, - [CMDS.RESURRECT] = { 0.9, 0.5, 1.0, 0.25 }, - [CMDS.UNLOAD_UNIT] = { 1.0, 0.8, 0.0, 0.25 }, + [CMDS.ATTACK] = { 1.0, 0.2, 0.2, 0.30 }, + [CMDS.CAPTURE] = { 1.0, 1.0, 0.3, 0.30 }, + [CMDS.FIGHT] = { 1.0, 0.2, 1.0, 0.25 }, + [CMDS.GUARD] = { 0.6, 1.0, 1.0, 0.25 }, + [CMDS.LOAD_ONTO] = { 0.4, 0.9, 0.9, 0.25 }, + [CMDS.LOAD_UNITS] = { 0.4, 0.9, 0.9, 0.30 }, + [CMDS.MANUALFIRE] = { 1.0, 0.0, 0.0, 0.30 }, + [CMDS.MOVE] = { 0.1, 1.0, 0.1, 0.25 }, + [CMDS.RAW_MOVE] = { 0.1, 1.0, 0.1, 0.25 }, + [CMDS.PATROL] = { 0.2, 0.5, 1.0, 0.25 }, + [CMDS.RECLAIM] = { 0.5, 1.0, 0.4, 0.40 }, + [CMDS.REPAIR] = { 1.0, 0.9, 0.2, 0.40 }, + [CMDS.RESTORE] = { 0.0, 0.5, 0.0, 0.25 }, + [CMDS.RESURRECT] = { 0.9, 0.5, 1.0, 0.25 }, + [CMDS.UNLOAD_UNIT] = { 1.0, 0.8, 0.0, 0.25 }, [CMDS.UNLOAD_UNITS] = { 1.0, 0.8, 0.0, 0.25 }, - [CMDS.BUILD] = { 0.0, 1.0, 0.0, 0.25 }, + [CMDS.BUILD] = { 0.0, 1.0, 0.0, 0.25 }, } -------------------------------------------------------------------------------- @@ -177,28 +176,34 @@ local MAX_UNITS = Game.maxUnits -- GL4 instanced rendering -------------------------------------------------------------------------------- -local gl4 = nil -- nil = not initialized, false = init failed, table = active +local gl4 = nil -- nil = not initialized, false = init failed, table = active local GL4_MAX_SEGMENTS = 4096 -local GL4_FLOATS_PER_SEG = 12 -- 3 vec4 attributes per instance +local GL4_FLOATS_PER_SEG = 12 -- 3 vec4 attributes per instance -- Pre-allocated arrays for build queue ghost rendering (legacy pass) local buildGhosts = { - x = {}, y = {}, z = {}, - defID = {}, facing = {}, - r = {}, g = {}, b = {}, a = {}, + x = {}, + y = {}, + z = {}, + defID = {}, + facing = {}, + r = {}, + g = {}, + b = {}, + a = {}, count = 0, } -- Per-frame dedup for segments and build ghosts: avoids drawing identical -- waypoint->waypoint lines and glUnitShape calls when many units share the -- same build queue. Uses a generation counter to avoid clearing per frame. -local segDedupTbl = {} -- [key] = generation -local ghostDedupTbl = {} -- [key] = generation +local segDedupTbl = {} -- [key] = generation +local ghostDedupTbl = {} -- [key] = generation local dedupGeneration = 0 -local MAX_BUILD_GHOSTS = 300 -- cap glUnitShape calls (expensive) +local MAX_BUILD_GHOSTS = 300 -- cap glUnitShape calls (expensive) -- Queue sharing: units with identical command queues share one parsed table -local queueShareCache = {} -- fingerprint -> { queue, queueSize, refCount } +local queueShareCache = {} -- fingerprint -> { queue, queueSize, refCount } local queueShareGeneration = 0 local EMPTY_TABLE = {} @@ -287,11 +292,11 @@ local function InitGL4() end local locs = { - viewMat = gl.GetUniformLocation(shader, 'u_viewMat'), - projMat = gl.GetUniformLocation(shader, 'u_projMat'), - lineTexLen = gl.GetUniformLocation(shader, 'u_lineTexLen'), - lineWidth = gl.GetUniformLocation(shader, 'u_lineWidth'), - useTex = gl.GetUniformLocation(shader, 'u_useTex'), + viewMat = gl.GetUniformLocation(shader, "u_viewMat"), + projMat = gl.GetUniformLocation(shader, "u_projMat"), + lineTexLen = gl.GetUniformLocation(shader, "u_lineTexLen"), + lineWidth = gl.GetUniformLocation(shader, "u_lineWidth"), + useTex = gl.GetUniformLocation(shader, "u_useTex"), } -- Static quad VBO (TRIANGLE_STRIP order: BL, BR, TL, TR) @@ -300,8 +305,8 @@ local function InitGL4() gl.DeleteShader(shader) return false end - quadVBO:Define(4, { {id = 0, name = 'a_corner', size = 2} }) - quadVBO:Upload({0,0, 1,0, 0,1, 1,1}) + quadVBO:Define(4, { { id = 0, name = "a_corner", size = 2 } }) + quadVBO:Upload({ 0, 0, 1, 0, 0, 1, 1, 1 }) -- Instance VBO (streaming — rebuilt each frame) local instVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) @@ -310,9 +315,9 @@ local function InitGL4() return false end instVBO:Define(GL4_MAX_SEGMENTS, { - {id = 1, name = 'a_posStart', size = 4}, - {id = 2, name = 'a_posEndW', size = 4}, - {id = 3, name = 'a_colorTex', size = 4}, + { id = 1, name = "a_posStart", size = 4 }, + { id = 2, name = "a_posEndW", size = 4 }, + { id = 3, name = "a_colorTex", size = 4 }, }) local vao = gl.GetVAO() @@ -324,12 +329,12 @@ local function InitGL4() vao:AttachInstanceBuffer(instVBO) gl4 = { - shader = shader, - locs = locs, - vao = vao, + shader = shader, + locs = locs, + vao = vao, quadVBO = quadVBO, instVBO = instVBO, - segData = {}, -- flat float array, pre-allocated on use + segData = {}, -- flat float array, pre-allocated on use segCount = 0, } return true @@ -337,7 +342,9 @@ end local function ShutdownGL4() if gl4 then - if gl4.shader then gl.DeleteShader(gl4.shader) end + if gl4.shader then + gl.DeleteShader(gl4.shader) + end -- VAO/VBO are garbage-collected by Spring but nil them for safety gl4.vao = nil gl4.instVBO = nil @@ -410,10 +417,14 @@ end local function getQueueFingerprint(unitID) local cmdCount = spGetUnitCommandCount(unitID) - if not cmdCount or cmdCount <= 0 then return nil end + if not cmdCount or cmdCount <= 0 then + return nil + end -- GetUnitCurrentCommand returns values directly — zero table allocation local cmdID, _, _, p1, p2, p3 = spGetUnitCurrentCommand(unitID) - if not cmdID then return nil end + if not cmdID then + return nil + end -- Numeric fingerprint: cmdCount + cmdID + quantized position local qp1 = mathFloor((p1 or 0) * 0.0625) % 1024 local qp3 = mathFloor((p3 or 0) * 0.0625) % 1024 @@ -422,7 +433,9 @@ local function getQueueFingerprint(unitID) end local function releaseQueue(command) - if not command.queue then return end + if not command.queue then + return + end local shared = command.sharedQueue if shared then shared.refCount = shared.refCount - 1 @@ -487,30 +500,30 @@ end loadTeamColors() local function setCmdLineColors(alpha) - spLoadCmdColorsConfig('move 0.5 1.0 0.5 ' .. alpha) - spLoadCmdColorsConfig('attack 1.0 0.2 0.2 ' .. alpha) - spLoadCmdColorsConfig('fight 1.0 0.2 1.0 ' .. alpha) - spLoadCmdColorsConfig('wait 0.5 0.5 0.5 ' .. alpha) - spLoadCmdColorsConfig('build 0.0 1.0 0.0 ' .. alpha) - spLoadCmdColorsConfig('guard 0.6 1.0 1.0 ' .. alpha) - spLoadCmdColorsConfig('stop 0.0 0.0 0.0 ' .. alpha) - spLoadCmdColorsConfig('patrol 0.2 0.5 1.0 ' .. alpha) - spLoadCmdColorsConfig('capture 1.0 1.0 0.3 ' .. alpha) - spLoadCmdColorsConfig('repair 1.0 0.9 0.2 ' .. alpha) - spLoadCmdColorsConfig('reclaim 0.5 1.0 0.4 ' .. alpha) - spLoadCmdColorsConfig('restore 0.0 1.0 0.0 ' .. alpha) - spLoadCmdColorsConfig('resurrect 0.9 0.5 1.0 ' .. alpha) - spLoadCmdColorsConfig('load 0.4 0.9 0.9 ' .. alpha) - spLoadCmdColorsConfig('unload 1.0 0.8 0.0 ' .. alpha) - spLoadCmdColorsConfig('deathWatch 0.5 0.5 0.5 ' .. alpha) + spLoadCmdColorsConfig("move 0.5 1.0 0.5 " .. alpha) + spLoadCmdColorsConfig("attack 1.0 0.2 0.2 " .. alpha) + spLoadCmdColorsConfig("fight 1.0 0.2 1.0 " .. alpha) + spLoadCmdColorsConfig("wait 0.5 0.5 0.5 " .. alpha) + spLoadCmdColorsConfig("build 0.0 1.0 0.0 " .. alpha) + spLoadCmdColorsConfig("guard 0.6 1.0 1.0 " .. alpha) + spLoadCmdColorsConfig("stop 0.0 0.0 0.0 " .. alpha) + spLoadCmdColorsConfig("patrol 0.2 0.5 1.0 " .. alpha) + spLoadCmdColorsConfig("capture 1.0 1.0 0.3 " .. alpha) + spLoadCmdColorsConfig("repair 1.0 0.9 0.2 " .. alpha) + spLoadCmdColorsConfig("reclaim 0.5 1.0 0.4 " .. alpha) + spLoadCmdColorsConfig("restore 0.0 1.0 0.0 " .. alpha) + spLoadCmdColorsConfig("resurrect 0.9 0.5 1.0 " .. alpha) + spLoadCmdColorsConfig("load 0.4 0.9 0.9 " .. alpha) + spLoadCmdColorsConfig("unload 1.0 0.8 0.0 " .. alpha) + spLoadCmdColorsConfig("deathWatch 0.5 0.5 0.5 " .. alpha) end local function applyCmdQueueVisibility(hide) if hide then - spLoadCmdColorsConfig('queueIconAlpha 0 ') + spLoadCmdColorsConfig("queueIconAlpha 0 ") setCmdLineColors(0) else - spLoadCmdColorsConfig('queueIconAlpha 0.5 ') + spLoadCmdColorsConfig("queueIconAlpha 0.5 ") setCmdLineColors(0.5) end end @@ -527,41 +540,41 @@ end function widget:Initialize() --spLoadCmdColorsConfig('useQueueIcons 0 ') - spLoadCmdColorsConfig('queueIconScale 0.66 ') + spLoadCmdColorsConfig("queueIconScale 0.66 ") applyCmdQueueVisibility(spIsGUIHidden()) resetEnabledTeams() - WG['commandsfx'] = {} - WG['commandsfx'].getOpacity = function() + WG["commandsfx"] = {} + WG["commandsfx"].getOpacity = function() return opacity end - WG['commandsfx'].setOpacity = function(value) + WG["commandsfx"].setOpacity = function(value) opacity = value end - WG['commandsfx'].getDuration = function() + WG["commandsfx"].getDuration = function() return duration end - WG['commandsfx'].setDuration = function(value) + WG["commandsfx"].setDuration = function(value) duration = value end - WG['commandsfx'].getFilterAI = function() + WG["commandsfx"].getFilterAI = function() return filterAIteams end - WG['commandsfx'].setFilterAI = function(value) + WG["commandsfx"].setFilterAI = function(value) filterAIteams = value resetEnabledTeams() end - WG['commandsfx'].getUseTeamColors = function() + WG["commandsfx"].getUseTeamColors = function() return useTeamColors end - WG['commandsfx'].setUseTeamColors = function(value) + WG["commandsfx"].setUseTeamColors = function(value) useTeamColors = value end - WG['commandsfx'].setUseTeamColorsWhenSpec = function() + WG["commandsfx"].setUseTeamColorsWhenSpec = function() return useTeamColorsWhenSpec end - WG['commandsfx'].setUseTeamColorsWhenSpec = function(value) + WG["commandsfx"].setUseTeamColorsWhenSpec = function(value) useTeamColorsWhenSpec = value end @@ -575,8 +588,8 @@ end function widget:Shutdown() ShutdownGL4() --spLoadCmdColorsConfig('useQueueIcons 1 ') - spLoadCmdColorsConfig('queueIconScale 1 ') - spLoadCmdColorsConfig('queueIconAlpha 1 ') + spLoadCmdColorsConfig("queueIconScale 1 ") + spLoadCmdColorsConfig("queueIconAlpha 1 ") setCmdLineColors(0.7) end @@ -626,9 +639,9 @@ function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts end -- Queue entry target types for pre-extracted positions -local QTARGET_COORD = 1 -- static coordinate (MOVE, BUILD, PATROL, etc.) -local QTARGET_UNIT = 2 -- unit target (needs live position each frame) -local QTARGET_FEATURE = 3 -- feature target (position pre-extracted; features are static) +local QTARGET_COORD = 1 -- static coordinate (MOVE, BUILD, PATROL, etc.) +local QTARGET_UNIT = 2 -- unit target (needs live position each frame) +local QTARGET_FEATURE = 3 -- feature target (position pre-extracted; features are static) local function getCommandsQueue(unitID) local cmdCount = spGetUnitCommandCount(unitID) @@ -697,7 +710,6 @@ end local sec = 0 local lastUpdate = 0 function widget:Update(dt) - sec = sec + dt if sec > lastUpdate + 0.1 then local gf = spGetGameFrame() @@ -855,8 +867,12 @@ local function gl4DrawFunc() end function widget:DrawWorldPreUnit() - if hidden then return end - if spIsGUIHidden() then return end + if hidden then + return + end + if spIsGUIHidden() then + return + end osClock = os_clock() if drawLineTexture then @@ -894,17 +910,21 @@ function widget:DrawWorldPreUnit() -- Periodically prune stale dedup entries (~every 10 seconds at 60fps) if dGen % 600 == 0 then for k, g in pairs(segDD) do - if g < dGen - 2 then segDD[k] = nil end + if g < dGen - 2 then + segDD[k] = nil + end end for k, g in pairs(ghostDD) do - if g < dGen - 2 then ghostDD[k] = nil end + if g < dGen - 2 then + ghostDD[k] = nil + end end end local commandCount = 0 local i = next(commands) while i do - local nextI = next(commands, i) -- grab next key before we might nil commands[i] + local nextI = next(commands, i) -- grab next key before we might nil commands[i] local command = commands[i] if command and command.time then local progress = (osClock - command.time) * invDuration @@ -917,15 +937,11 @@ function widget:DrawWorldPreUnit() if unitCommand[unitID] == i then unitCommand[unitID] = nil end - - elseif command.draw and (spIsUnitInView(unitID) or - (command.x and spIsSphereInView(command.x, command.y, command.z, 1))) then - + elseif command.draw and (spIsUnitInView(unitID) or (command.x and spIsSphereInView(command.x, command.y, command.z, 1))) then -- draw command queue local prevX, prevY, prevZ = getCachedUnitPosition(unitID) local queueSize = command.queueSize if queueSize > 0 and prevX and commandCount < maxCommandCount then - local lineAlphaMultiplier = opacityMul * (1 - progress) local usedLineWidth = lineWidth - (progress * lineWidthDelta) local queue = command.queue @@ -933,7 +949,9 @@ function widget:DrawWorldPreUnit() for j = 1, queueSize do local qe = queue[j] - if not qe then break end -- safety: queue may have been partially cleared + if not qe then + break + end -- safety: queue may have been partially cleared -- Resolve position from pre-extracted data local X, Y, Z local ttype = qe.ttype @@ -966,18 +984,18 @@ function widget:DrawWorldPreUnit() if drawSeg and segCount < GL4_MAX_SEGMENTS then segCount = segCount + 1 local base = (segCount - 1) * GL4_FLOATS_PER_SEG - segData[base+1] = prevX - segData[base+2] = prevY - segData[base+3] = prevZ - segData[base+4] = X - segData[base+5] = Y - segData[base+6] = Z - segData[base+7] = usedLineWidth - segData[base+8] = lineAlpha - segData[base+9] = lineColour[1] - segData[base+10] = lineColour[2] - segData[base+11] = lineColour[3] - segData[base+12] = texOffset + segData[base + 1] = prevX + segData[base + 2] = prevY + segData[base + 3] = prevZ + segData[base + 4] = X + segData[base + 5] = Y + segData[base + 6] = Z + segData[base + 7] = usedLineWidth + segData[base + 8] = lineAlpha + segData[base + 9] = lineColour[1] + segData[base + 10] = lineColour[2] + segData[base + 11] = lineColour[3] + segData[base + 12] = texOffset end -- Ghost dedup: same position = same building = draw once if drawBuildQueue and qe.buildingID then @@ -1048,7 +1066,6 @@ function widget:DrawWorldPreUnit() glColor(1, 1, 1, 1) end - function widget:PlayerChanged() myTeamID = spGetMyTeamID() mySpec = spGetSpectatingState() diff --git a/luaui/Widgets/gui_controller_test.lua b/luaui/Widgets/gui_controller_test.lua index 58c764dc922..a08a0efc229 100644 --- a/luaui/Widgets/gui_controller_test.lua +++ b/luaui/Widgets/gui_controller_test.lua @@ -2,16 +2,15 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Controller Test", - desc = "Tests Controller Stuff", - author = "badosu", - date = "Oct 2022", - license = "GNU GPL, v2 or later", - layer = 0 + name = "Controller Test", + desc = "Tests Controller Stuff", + author = "badosu", + date = "Oct 2022", + license = "GNU GPL, v2 or later", + layer = 0, } end - -- Localized Spring API for performance local spEcho = Spring.Echo diff --git a/luaui/Widgets/gui_converter_usage.lua b/luaui/Widgets/gui_converter_usage.lua index 15b5268e249..da08bf0012f 100644 --- a/luaui/Widgets/gui_converter_usage.lua +++ b/luaui/Widgets/gui_converter_usage.lua @@ -1,17 +1,16 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Converter Usage", - desc = "Shows the % of converters that are in use, their energy consumption and metal production", - author = "Lexon, Floris", - date = "05.08.2022", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } - end - + return { + name = "Converter Usage", + desc = "Shows the % of converters that are in use, their energy consumption and metal production", + author = "Lexon, Floris", + date = "05.08.2022", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end -- Localized Spring API for performance local spGetMouseState = Spring.GetMouseState @@ -23,7 +22,7 @@ local font2 local RectRound, UiElement local dlistGuishader, dlistCU -local area = {0,0,0,0} +local area = { 0, 0, 0, 0 } local spGetMyTeamID = Spring.GetMyTeamID local spGetTeamRulesParam = Spring.GetTeamRulesParam @@ -56,13 +55,13 @@ local formatOptions = { showSign = true } local function updateUI() local localSkewTan = 0 local useSkew = false - if WG['topbar'] then - local freeArea = WG['topbar'].GetFreeArea() + if WG["topbar"] then + local freeArea = WG["topbar"].GetFreeArea() widgetScale = freeArea[5] local topbarH = freeArea[4] - freeArea[2] local smallVPad = 0 - if WG['topbar'].GetSkewConfig then - local skewCfg = WG['topbar'].GetSkewConfig() + if WG["topbar"].GetSkewConfig then + local skewCfg = WG["topbar"].GetSkewConfig() useSkew = skewCfg.useSkew localSkewTan = skewCfg.skewTan if useSkew then @@ -78,8 +77,8 @@ local function updateUI() area[4] = freeArea[4] end if dlistGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].RemoveDlist('converter_usage') + if WG["guishader"] then + WG["guishader"].RemoveDlist("converter_usage") end glDeleteList(dlistGuishader) end @@ -98,125 +97,127 @@ local function updateUI() end end) - local fontSize = (area[4] - area[2]) * 0.4 - local color = "\255\255\255\255" - local tooltipTitle = Spring.I18N('ui.topbar.converter_usage.defaultTooltipTitle') - local tooltipText = Spring.I18N('ui.topbar.converter_usage.defaultTooltip') + local fontSize = (area[4] - area[2]) * 0.4 + local color = "\255\255\255\255" + local tooltipTitle = Spring.I18N("ui.topbar.converter_usage.defaultTooltipTitle") + local tooltipText = Spring.I18N("ui.topbar.converter_usage.defaultTooltip") - if dlistCU ~= nil then - glDeleteList(dlistCU) - end + if dlistCU ~= nil then + glDeleteList(dlistCU) + end dlistCU = glCreateList(function() local H = area[4] - area[2] - local skew = useSkew and {blx = -(H * localSkewTan), brx = -(H * localSkewTan)} or nil + local skew = useSkew and { blx = -(H * localSkewTan), brx = -(H * localSkewTan) } or nil UiElement(area[1], area[2], area[3], area[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, skew) - if WG['guishader'] then - WG['guishader'].InsertDlist(dlistGuishader, 'converter_usage') + if WG["guishader"] then + WG["guishader"].InsertDlist(dlistGuishader, "converter_usage") + end + + --Some coloring and tooltip text + if converterUse < 20 then + color = "\255\255\000\000" --Red + tooltipText = tooltipText .. "\n\n\255\255\100\075" .. Spring.I18N("ui.topbar.converter_usage.tooManyConverters1Tooltip") .. "\n\255\255\100\075" .. Spring.I18N("ui.topbar.converter_usage.tooManyConverters2Tooltip") + elseif converterUse < 40 then + color = "\255\255\100\000" --Orange + tooltipText = tooltipText .. "\n\n\255\255\120\050" .. Spring.I18N("ui.topbar.converter_usage.tooManyConverters1Tooltip") .. "\n\255\255\120\050" .. Spring.I18N("ui.topbar.converter_usage.tooManyConverters2Tooltip") + elseif converterUse < 50 then + color = "\255\255\255\000" --Yellow + elseif converterUse < 70 then + color = "\255\215\230\100" --Yelleen? + else + color = "\255\000\255\000" --Green end - --Some coloring and tooltip text - if converterUse < 20 then - color = "\255\255\000\000" --Red - tooltipText = tooltipText .. "\n\n\255\255\100\075"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\100\075"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') - elseif converterUse < 40 then - color = "\255\255\100\000" --Orange - tooltipText = tooltipText .. "\n\n\255\255\120\050"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters1Tooltip').."\n\255\255\120\050"..Spring.I18N('ui.topbar.converter_usage.tooManyConverters2Tooltip') - elseif converterUse < 50 then - color = "\255\255\255\000" --Yellow - elseif converterUse < 70 then - color = "\255\215\230\100" --Yelleen? - else - color = "\255\000\255\000" --Green - end - - -- converter use - font2:Begin() - font2:Print(color .. converterUse .. "%", area[1] + (fontSize * 0.4), area[2] + ((area[4] - area[2]) / 2.05) - (fontSize / 5), fontSize, 'ol') - - fontSize = fontSize * 0.75 - - -- energy used (right-anchored to skew-adjusted edge at text y) - local energyY = area[2] + 3.2 * (H / 4) - (fontSize / 5) - local energyX = area[3] - (useSkew and (H - (energyY - area[2])) * localSkewTan or 0) - (fontSize * 0.35) - font2:Print("\255\255\255\000" .. string.formatSI(-eConverted, formatOptions), energyX, energyY, fontSize, 'or') - - -- metal produced (right-anchored to skew-adjusted edge at text y) - local metalY = area[2] + 0.8 * (H / 4) - (fontSize / 5) - local metalX = area[3] - (useSkew and (H - (metalY - area[2])) * localSkewTan or 0) - (fontSize * 0.35) - font2:Print("\255\240\255\240" .. string.formatSI(mConverted, formatOptions), metalX, metalY, fontSize, 'or') + -- converter use + font2:Begin() + font2:Print(color .. converterUse .. "%", area[1] + (fontSize * 0.4), area[2] + ((area[4] - area[2]) / 2.05) - (fontSize / 5), fontSize, "ol") + + fontSize = fontSize * 0.75 + + -- energy used (right-anchored to skew-adjusted edge at text y) + local energyY = area[2] + 3.2 * (H / 4) - (fontSize / 5) + local energyX = area[3] - (useSkew and (H - (energyY - area[2])) * localSkewTan or 0) - (fontSize * 0.35) + font2:Print("\255\255\255\000" .. string.formatSI(-eConverted, formatOptions), energyX, energyY, fontSize, "or") + + -- metal produced (right-anchored to skew-adjusted edge at text y) + local metalY = area[2] + 0.8 * (H / 4) - (fontSize / 5) + local metalX = area[3] - (useSkew and (H - (metalY - area[2])) * localSkewTan or 0) - (fontSize * 0.35) + font2:Print("\255\240\255\240" .. string.formatSI(mConverted, formatOptions), metalX, metalY, fontSize, "or") font2:End() - if WG['tooltip'] ~= nil then - WG['tooltip'].AddTooltip('converter_usage', area, tooltipText, nil, tooltipTitle) - end + if WG["tooltip"] ~= nil then + WG["tooltip"].AddTooltip("converter_usage", area, tooltipText, nil, tooltipTitle) + end end) end function widget:DrawScreen() gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - if dlistCU and dlistGuishader then - glCallList(dlistCU) - end - if area[1] then - local x, y = spGetMouseState() - if math.isInRect(x, y, area[1], area[2], area[3], area[4]) then - Spring.SetMouseCursor('cursornormal') - end - end + if dlistCU and dlistGuishader then + glCallList(dlistCU) + end + if area[1] then + local x, y = spGetMouseState() + if math.isInRect(x, y, area[1], area[2], area[3], area[4]) then + Spring.SetMouseCursor("cursornormal") + end + end end function widget:MousePress(x, y, button) - if area[1] then - local x, y = spGetMouseState() - if math.isInRect(x, y, area[1], area[2], area[3], area[4]) then - return true - end - end + if area[1] then + local x, y = spGetMouseState() + if math.isInRect(x, y, area[1], area[2], area[3], area[4]) then + return true + end + end end function widget:Shutdown() - if dlistGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].RemoveDlist('converter_usage') - end - glDeleteList(dlistGuishader) - end - if dlistCU ~= nil then - glDeleteList(dlistCU) - end - WG['converter_usage'] = nil + if dlistGuishader ~= nil then + if WG["guishader"] then + WG["guishader"].RemoveDlist("converter_usage") + end + glDeleteList(dlistGuishader) + end + if dlistCU ~= nil then + glDeleteList(dlistCU) + end + WG["converter_usage"] = nil end function widget:ViewResize() - vsx, vsy = glGetViewSizes() + vsx, vsy = glGetViewSizes() - RectRound = WG.FlowUI.Draw.RectRound - UiElement = WG.FlowUI.Draw.Element + RectRound = WG.FlowUI.Draw.RectRound + UiElement = WG.FlowUI.Draw.Element - font2 = WG['fonts'].getFont(2) + font2 = WG["fonts"].getFont(2) end function widget:Initialize() - widget:ViewResize() + widget:ViewResize() - WG['converter_usage'] = {} - WG['converter_usage'].GetPosition = function() + WG["converter_usage"] = {} + WG["converter_usage"].GetPosition = function() return area end end function widget:GameFrame() - gameStarted = true + gameStarted = true - local myTeamID = spGetMyTeamID() - eConverted = spGetTeamRulesParam(myTeamID, "mmUse") + local myTeamID = spGetMyTeamID() + eConverted = spGetTeamRulesParam(myTeamID, "mmUse") if eConverted then mConverted = eConverted * spGetTeamRulesParam(myTeamID, "mmAvgEffi") eConvertedMax = spGetTeamRulesParam(myTeamID, "mmCapacity") converterUse = 0 - if eConvertedMax <= 0 then return end + if eConvertedMax <= 0 then + return + end converterUse = floor(100 * eConverted / eConvertedMax) eConverted = floor(eConverted) @@ -226,32 +227,36 @@ function widget:GameFrame() mConverted = mConverted + 1 mConvertedRemainder = mConvertedRemainder - 1 end - end + end end local sec = 0 function widget:Update(dt) - if not gameStarted then return end + if not gameStarted then + return + end - sec = sec + dt - if sec <= 0.6 then return end + sec = sec + dt + if sec <= 0.6 then + return + end - sec = 0 + sec = 0 - if eConvertedMax and eConvertedMax > 0 then - updateUI() - return - end + if eConvertedMax and eConvertedMax > 0 then + updateUI() + return + end - -- Dont draw if there are no converters - if dlistGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].RemoveDlist('converter_usage') - end - dlistGuishader = glDeleteList(dlistGuishader) - end + -- Dont draw if there are no converters + if dlistGuishader ~= nil then + if WG["guishader"] then + WG["guishader"].RemoveDlist("converter_usage") + end + dlistGuishader = glDeleteList(dlistGuishader) + end - if dlistCU ~= nil then - dlistCU = glDeleteList(dlistCU) - end + if dlistCU ~= nil then + dlistCU = glDeleteList(dlistCU) + end end diff --git a/luaui/Widgets/gui_cursor.lua b/luaui/Widgets/gui_cursor.lua index 158dcb0e62d..7966cc34891 100644 --- a/luaui/Widgets/gui_cursor.lua +++ b/luaui/Widgets/gui_cursor.lua @@ -1,48 +1,46 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { name = "Cursor", - desc = "auto sets a scale for the cursor based on screen resolution" , + desc = "auto sets a scale for the cursor based on screen resolution", author = "Floris", date = "", license = "GNU GPL, v2 or later", layer = 19000, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathAbs = math.abs local Settings = {} -Settings['cursorSet'] = 'icexuick' -Settings['cursorSize'] = 100 -Settings['sizeMult'] = Spring.GetConfigFloat('cursorsize', 1) -Settings['version'] = 6 -- just so it wont restore configdata on load if it differs format +Settings["cursorSet"] = "icexuick" +Settings["cursorSize"] = 100 +Settings["sizeMult"] = Spring.GetConfigFloat("cursorsize", 1) +Settings["version"] = 6 -- just so it wont restore configdata on load if it differs format local force = true local autoCursorSize -- note: first entry should be icons inside base /anims folder local cursorSets = {} -for k, subdir in pairs(VFS.SubDirs('anims')) do - local set = string.gsub(string.sub(subdir, 1, #subdir-1), 'anims/', '') -- game anims folder - set = string.gsub(string.sub(set, 1, #subdir), 'anims\\', '') -- spring anims folder - local subdirSplit = string.split(set, '_') +for k, subdir in pairs(VFS.SubDirs("anims")) do + local set = string.gsub(string.sub(subdir, 1, #subdir - 1), "anims/", "") -- game anims folder + set = string.gsub(string.sub(set, 1, #subdir), "anims\\", "") -- spring anims folder + local subdirSplit = string.split(set, "_") if cursorSets[subdirSplit[1]] == nil then cursorSets[subdirSplit[1]] = {} end - cursorSets[subdirSplit[1]][#cursorSets[subdirSplit[1]]+1] = subdirSplit[2] + cursorSets[subdirSplit[1]][#cursorSets[subdirSplit[1]] + 1] = subdirSplit[2] end function NearestValue(table, number) local smallestSoFar, smallestIndex for i, y in ipairs(table) do - if not smallestSoFar or (mathAbs(number-y) < smallestSoFar) then - smallestSoFar = mathAbs(number-y) + if not smallestSoFar or (mathAbs(number - y) < smallestSoFar) then + smallestSoFar = mathAbs(number - y) smallestIndex = i end end @@ -50,41 +48,41 @@ function NearestValue(table, number) end function widget:ViewResize() - local ssx,ssy = Spring.GetScreenGeometry() -- doesnt change when you unplug external display - autoCursorSize = 100 * (0.6 + (ssx*ssy / 10000000)) * Spring.GetConfigFloat('cursorsize', 1) - SetCursor(Settings['cursorSet']) + local ssx, ssy = Spring.GetScreenGeometry() -- doesnt change when you unplug external display + autoCursorSize = 100 * (0.6 + (ssx * ssy / 10000000)) * Spring.GetConfigFloat("cursorsize", 1) + SetCursor(Settings["cursorSet"]) end function widget:Initialize() force = true widget:ViewResize() - WG['cursors'] = {} - WG['cursors'].getcursor = function() - return Settings['cursorSet'] + WG["cursors"] = {} + WG["cursors"].getcursor = function() + return Settings["cursorSet"] end - WG['cursors'].getcursorsets = function() + WG["cursors"].getcursorsets = function() local sets = {} for i, y in pairs(cursorSets) do - sets[#sets+1] = i + sets[#sets + 1] = i end return sets end - WG['cursors'].setcursor = function(value) + WG["cursors"].setcursor = function(value) force = true SetCursor(value) end - WG['cursors'].getsizemult = function() - return Spring.GetConfigFloat('cursorsize', 1) + WG["cursors"].getsizemult = function() + return Spring.GetConfigFloat("cursorsize", 1) end - WG['cursors'].setsizemult = function(value) - Spring.SetConfigFloat('cursorsize', value) + WG["cursors"].setsizemult = function(value) + Spring.SetConfigFloat("cursorsize", value) widget:ViewResize() end end function widget:Shutdown() - WG['cursors'] = nil + WG["cursors"] = nil local file = VFS.LoadFile("cmdcolors.txt") if file then Spring.LoadCmdColorsConfig(file) @@ -95,25 +93,48 @@ end -- load cursors function SetCursor(cursorSet) --Spring.Echo(autoCursorSize..' '..cursorSets[cursorSet][NearestValue(cursorSets[cursorSet], autoCursorSize)]) - local oldSetName = Settings['cursorSet']..'_'..Settings['cursorSize'] - Settings['cursorSet'] = cursorSet - Settings['cursorSize'] = cursorSets[cursorSet][NearestValue(cursorSets[cursorSet], autoCursorSize)] - local cursorDir = cursorSet..'_'..Settings['cursorSize'] + local oldSetName = Settings["cursorSet"] .. "_" .. Settings["cursorSize"] + Settings["cursorSet"] = cursorSet + Settings["cursorSize"] = cursorSets[cursorSet][NearestValue(cursorSets[cursorSet], autoCursorSize)] + local cursorDir = cursorSet .. "_" .. Settings["cursorSize"] if cursorDir ~= oldSetName or force then force = false local cursorNames = { - 'cursornormal','cursorareaattack','cursorattack', - 'cursorbuildbad','cursorbuildgood','cursorcapture','cursorcentroid', - 'cursorwait','cursortime','cursorunload', - 'cursordwatch','cursordgun','cursorfight', - 'cursorgather','cursordefend','cursorpickup', - 'cursorrepair','cursorrevive','cursorrestore', - 'cursormove','cursorpatrol','cursorreclamate','cursorselfd', - 'cursornumber','cursorsettarget','cursorupgmex','cursorareamex', - 'uiresizev', 'uiresizeh', 'uiresized1', 'uiresized2', 'uimove', + "cursornormal", + "cursorareaattack", + "cursorattack", + "cursorbuildbad", + "cursorbuildgood", + "cursorcapture", + "cursorcentroid", + "cursorwait", + "cursortime", + "cursorunload", + "cursordwatch", + "cursordgun", + "cursorfight", + "cursorgather", + "cursordefend", + "cursorpickup", + "cursorrepair", + "cursorrevive", + "cursorrestore", + "cursormove", + "cursorpatrol", + "cursorreclamate", + "cursorselfd", + "cursornumber", + "cursorsettarget", + "cursorupgmex", + "cursorareamex", + "uiresizev", + "uiresizeh", + "uiresized1", + "uiresized2", + "uimove", } - for i=1, #cursorNames do - Spring.ReplaceMouseCursor(cursorNames[i], cursorDir..'/'..cursorNames[i], (cursorNames[i] == 'cursornormal')) + for i = 1, #cursorNames do + Spring.ReplaceMouseCursor(cursorNames[i], cursorDir .. "/" .. cursorNames[i], (cursorNames[i] == "cursornormal")) end --local files = VFS.DirList("anims/"..cursorDir.."/") @@ -126,33 +147,33 @@ function SetCursor(cursorSet) -- end --end - local file = VFS.LoadFile("cmdcolors_"..cursorSet..".txt") + local file = VFS.LoadFile("cmdcolors_" .. cursorSet .. ".txt") if file then Spring.LoadCmdColorsConfig(file) end -- hide engine unit selection box if WG.selectedunits or WG.teamplatter or WG.highlightselunits then - Spring.LoadCmdColorsConfig('unitBox 0 1 0 0') + Spring.LoadCmdColorsConfig("unitBox 0 1 0 0") end -- Hide metal extractor circles on non-metal maps - if WG["resource_spot_finder"] and (not WG["resource_spot_finder"].isMetalMap) then - Spring.LoadCmdColorsConfig('rangeExtract 1.0 0.3 0.3 0.0') + if WG["resource_spot_finder"] and not WG["resource_spot_finder"].isMetalMap then + Spring.LoadCmdColorsConfig("rangeExtract 1.0 0.3 0.3 0.0") end end end function widget:GetConfigData() - return Settings + return Settings end function widget:SetConfigData(data) - if data and type(data) == 'table' and data.version then + if data and type(data) == "table" and data.version then if data.version < 6 and data.sizeMult then - Spring.SetConfigFloat('cursorsize', data.sizeMult) + Spring.SetConfigFloat("cursorsize", data.sizeMult) end Settings = data - Settings['sizeMult'] = Spring.GetConfigFloat('cursorsize', 1) + Settings["sizeMult"] = Spring.GetConfigFloat("cursorsize", 1) end end diff --git a/luaui/Widgets/gui_defenserange_gl4.lua b/luaui/Widgets/gui_defenserange_gl4.lua index b2b19849ffb..14f6b484e0b 100644 --- a/luaui/Widgets/gui_defenserange_gl4.lua +++ b/luaui/Widgets/gui_defenserange_gl4.lua @@ -4,18 +4,17 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Defense Range GL4", - desc = "Displays range of defenses (enemy and ally)", - author = "Beherith", -- yeah this is now a rewrite from scratch - date = "2021.04.26", - license = "Lua: GPLv2, GLSL: (c) Beherith (mysterme@gmail.com)", - layer = -100, - enabled = true, - depends = {'gl4'}, + name = "Defense Range GL4", + desc = "Displays range of defenses (enemy and ally)", + author = "Beherith", -- yeah this is now a rewrite from scratch + date = "2021.04.26", + license = "Lua: GPLv2, GLSL: (c) Beherith (mysterme@gmail.com)", + layer = -100, + enabled = true, + depends = { "gl4" }, } end - -- Localized functions for performance local mathMax = math.max local tableInsert = table.insert @@ -28,14 +27,13 @@ local spGetUnitTeam = Spring.GetUnitTeam -- AA should be purple :D -- heightboost is going to be a bitch - > use $heightmap and hope that heightboost is kinda linear -- Vertex Buffer should have: a circle with 256 subdivs - -- basically a set of vec2's - -- each elem of this vec2 should also have a normal vector, for ez heightboost +-- basically a set of vec2's +-- each elem of this vec2 should also have a normal vector, for ez heightboost -- whole thing needs an 'override' type thing, -- needs masking of the instance buffer - -- configurability: - -- have multiple VBOs' for each unit type? +-- have multiple VBOs' for each unit type? -- TODO2 --X separate cylsph and cannon types!!!! @@ -45,15 +43,15 @@ local spGetUnitTeam = Spring.GetUnitTeam --x correct colorization --X correct popElementInstance keys -- FADE/VIS CONTROL: - -- 0. Color gets darkened outside los - -- 1. out of map gets faded to 0 - -- 2. zoomed out anti fades in, all others fade out - -- 3. mouse will always return it to full vis, with teamcolorized stipples at 1/4th distribution - - --X allow for distance fade config for each class - --X minalpha, maxalpha, fadestart, fadend - --X also pass in mouse cursor ground pos as uniform, and fade ground def based on that :) - --X uniforms: mousemapx, mousemapz, selectiontype (air, ground, mixed, none), globalalpha +-- 0. Color gets darkened outside los +-- 1. out of map gets faded to 0 +-- 2. zoomed out anti fades in, all others fade out +-- 3. mouse will always return it to full vis, with teamcolorized stipples at 1/4th distribution + +--X allow for distance fade config for each class +--X minalpha, maxalpha, fadestart, fadend +--X also pass in mouse cursor ground pos as uniform, and fade ground def based on that :) +--X uniforms: mousemapx, mousemapz, selectiontype (air, ground, mixed, none), globalalpha --X sphcyl resample with heightmod boosting --X add height offsets to common turrets! -- raytracin' cannons? @@ -62,16 +60,15 @@ local spGetUnitTeam = Spring.GetUnitTeam --X merge mobile antis into this -- TODO3: 2022.10.10 - -- allow specs to enable? Doesnt make much sense with new stencil based drawing... - -- X LRPCs - -- X Fog - -- X dont check allied defenses for losness - -- X use luashader uvhm implementation - -- X fix mobile antis - -- isallied is totally wrong - -- dont check for losness in non fullview spec mode! - -- smartly reinit when selected allyteam changes and there are > 2 allyteams - +-- allow specs to enable? Doesnt make much sense with new stencil based drawing... +-- X LRPCs +-- X Fog +-- X dont check allied defenses for losness +-- X use luashader uvhm implementation +-- X fix mobile antis +-- isallied is totally wrong +-- dont check for losness in non fullview spec mode! +-- smartly reinit when selected allyteam changes and there are > 2 allyteams ------------------ CONFIGURABLES -------------- @@ -80,74 +77,74 @@ local autoReload = false local enabledAsSpec = true local buttonConfig = { - ally = { ground = false, air = false, nuke = true , cannon = false, lrpc = false}, - enemy = { ground = true, air = true, nuke = true , cannon = true, lrpc = false} + ally = { ground = false, air = false, nuke = true, cannon = false, lrpc = false }, + enemy = { ground = true, air = true, nuke = true, cannon = true, lrpc = false }, } local colorConfig = { --An array of R, G, B, Alpha - drawStencil = true, -- wether to draw the outer, merged rings (quite expensive!) - distanceScaleStart = 2000, -- Linewidth is 100% up to this camera height - distanceScaleEnd = 8000, -- Linewidth becomes 50% above this camera height + drawStencil = true, -- wether to draw the outer, merged rings (quite expensive!) + distanceScaleStart = 2000, -- Linewidth is 100% up to this camera height + distanceScaleEnd = 8000, -- Linewidth becomes 50% above this camera height drawAllyCategoryBuildQueue = true, - ground = { - color = {1.3, 0.18, 0.04, 0.70}, - fadeparams = { 2200, 5500, 1.0, 0.0}, -- FadeStart, FadeEnd, StartAlpha, EndAlpha - externallinethickness = 5.0, -- can be 2 or 3 if we can distiquish its looks from attackranges - internallinethickness = 3.0, -- can be 1.8 if we can distiquish its looks from attackranges + ground = { + color = { 1.3, 0.18, 0.04, 0.70 }, + fadeparams = { 2200, 5500, 1.0, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + externallinethickness = 5.0, -- can be 2 or 3 if we can distiquish its looks from attackranges + internallinethickness = 3.0, -- can be 1.8 if we can distiquish its looks from attackranges stenciled = true, cannonMode = false, stencilMask = 1, externalalpha = 0.75, -- alpha of outer rings internalalpha = 0.10, -- alpha of inner rings - }, - air = { - color = {0.8, 0.44, 1.6, 0.70}, - fadeparams = { 3200, 8000, 0.4, 0.0}, -- FadeStart, FadeEnd, StartAlpha, EndAlpha - externallinethickness = 5.0, - internallinethickness = 3.0, + }, + air = { + color = { 0.8, 0.44, 1.6, 0.70 }, + fadeparams = { 3200, 8000, 0.4, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + externallinethickness = 5.0, + internallinethickness = 3.0, stenciled = true, cannonMode = false, stencilMask = 2, externalalpha = 0.75, -- alpha of outer rings internalalpha = 0.10, -- alpha of inner rings - }, - nuke = { - color = {1.05, 1.0, 0.2, 0.72}, - fadeparams = {6000, 3000, 0.6, 0.0}, -- FadeStart, FadeEnd, StartAlpha, EndAlpha - externallinethickness = 5.0, - internallinethickness = 2.0, + }, + nuke = { + color = { 1.05, 1.0, 0.2, 0.72 }, + fadeparams = { 6000, 3000, 0.6, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + externallinethickness = 5.0, + internallinethickness = 2.0, stenciled = true, cannonMode = false, stencilMask = 4, externalalpha = 0.80, -- alpha of outer rings internalalpha = 0.15, -- alpha of inner rings - }, - cannon = { - color = {1.3, 0.18, 0.04, 0.70}, --orange 1.2, 0.55, 0.08, 0.74 - fadeparams = {2000, 8000, 0.8, 0.0}, -- FadeStart, FadeEnd, StartAlpha, EndAlpha - externallinethickness = 5.0, - internallinethickness = 2.5, + }, + cannon = { + color = { 1.3, 0.18, 0.04, 0.70 }, --orange 1.2, 0.55, 0.08, 0.74 + fadeparams = { 2000, 8000, 0.8, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + externallinethickness = 5.0, + internallinethickness = 2.5, stenciled = true, cannonMode = true, stencilMask = 8, externalalpha = 0.75, -- alpha of outer rings internalalpha = 0.10, -- alpha of inner rings - }, + }, lrpc = { - color = {1.3, 0.18, 0.04, 0.68}, - fadeparams = {9000, 6000, 0.8, 0.0}, -- FadeStart, FadeEnd, StartAlpha, EndAlpha - externallinethickness = 3.0, - internallinethickness = 1.5, + color = { 1.3, 0.18, 0.04, 0.68 }, + fadeparams = { 9000, 6000, 0.8, 0.0 }, -- FadeStart, FadeEnd, StartAlpha, EndAlpha + externallinethickness = 3.0, + internallinethickness = 1.5, stenciled = false, cannonMode = true, externalalpha = 0.25, -- alpha of outer rings - }, + }, } -- add a “water” variant so we can stay in the ground-stencil pass but colour blue colorConfig.ground_water = { - color = {0.48, 0.67, 1.0, 0.30}, -- nice RGBA blue - fadeparams = colorConfig.ground.fadeparams, -- reuse the same fade curve + color = { 0.48, 0.67, 1.0, 0.30 }, -- nice RGBA blue + fadeparams = colorConfig.ground.fadeparams, -- reuse the same fade curve } --- Camera Height based line shrinkage: @@ -155,31 +152,32 @@ colorConfig.ground_water = { ---------------------------------- local unitDefRings = {} --each entry should be a unitdefIDkey to very specific table: - -- a list of tables, ideally ranged from 0 where - -- consider that a unit can have any of multiple types +-- a list of tables, ideally ranged from 0 where +-- consider that a unit can have any of multiple types --[[ -- unitDefRings[unitDefID] = { } -]]-- +]] +-- local mobileAntiUnitNames = { - 'armscab', - 'armcarry', - 'cormabm', - 'legavantinuke', - 'corcarry', - 'armantiship', - 'corantiship', - 'leganavyantinukecarrier' + "armscab", + "armcarry", + "cormabm", + "legavantinuke", + "corcarry", + "armantiship", + "corantiship", + "leganavyantinukecarrier", } local mobileAntiUnitDefs = {} for _, unit in ipairs(mobileAntiUnitNames) do - if UnitDefNames[unit] then - mobileAntiUnitDefs[UnitDefNames[unit].id] = true - end + if UnitDefNames[unit] then + mobileAntiUnitDefs[UnitDefNames[unit].id] = true + end end local defensePosHash = {} -- key: {poshash=unitID} @@ -187,7 +185,6 @@ local defensePosHash = {} -- key: {poshash=unitID} local featureDefIDtoUnitDefID = {} -- this table maps featureDefIDs to unitDefIDs for faster lookups on feature creation - local unitName = {} local unitWeapons = {} for udid, ud in pairs(UnitDefs) do @@ -195,12 +192,10 @@ for udid, ud in pairs(UnitDefs) do unitWeapons[udid] = ud.weapons end - -local vtoldamagetag = Game.armorTypes['vtol'] -local defaultdamagetag = Game.armorTypes['default'] +local vtoldamagetag = Game.armorTypes["vtol"] +local defaultdamagetag = Game.armorTypes["default"] local function initializeUnitDefRing(unitDefID) - - unitDefRings[unitDefID]['rings'] = {} + unitDefRings[unitDefID]["rings"] = {} local weapons = unitWeapons[unitDefID] for weaponNum = 1, #weapons do local weaponDef = weapons[weaponNum] @@ -208,10 +203,10 @@ local function initializeUnitDefRing(unitDefID) local weaponDef = WeaponDefs[weaponDefID] local range = weaponDef.range - local weaponType = unitDefRings[unitDefID]['weapons'][weaponNum] + local weaponType = unitDefRings[unitDefID]["weapons"][weaponNum] --spEcho(weaponType) - if weaponType ~= nil then - if weaponType == 'nuke' then -- antinuke + if weaponType ~= nil then + if weaponType == "nuke" then -- antinuke range = weaponDef.coverageRange --spEcho("init antinuke", range) end @@ -219,27 +214,22 @@ local function initializeUnitDefRing(unitDefID) -- local fadeparams = colorConfig[weaponType].fadeparams -- pick blue for underwater weapons, otherwise fall back to normal - local baseKey = weaponType - local cfg = colorConfig[baseKey] - if (baseKey == "ground") and (weaponDef.waterWeapon) then - cfg = colorConfig.ground_water - --spEcho("[DefenseRange] using water colour for:", weaponDef.name) - end - local color = cfg.color - local fadeparams = cfg.fadeparams + local baseKey = weaponType + local cfg = colorConfig[baseKey] + if (baseKey == "ground") and weaponDef.waterWeapon then + cfg = colorConfig.ground_water + --spEcho("[DefenseRange] using water colour for:", weaponDef.name) + end + local color = cfg.color + local fadeparams = cfg.fadeparams local isCylinder = 0 - if (weaponDef.cylinderTargeting) and (weaponDef.cylinderTargeting > 0.0) then + if weaponDef.cylinderTargeting and (weaponDef.cylinderTargeting > 0.0) then isCylinder = 1 end - local ringParams = {range, color[1],color[2], color[3], color[4], - fadeparams[1], fadeparams[2], fadeparams[3], fadeparams[4], - weaponDef.projectilespeed or 1, - isCylinder, - weaponDef.heightBoostFactor or 0, - weaponDef.heightMod or 0 } - unitDefRings[unitDefID]['rings'][weaponNum] = ringParams + local ringParams = { range, color[1], color[2], color[3], color[4], fadeparams[1], fadeparams[2], fadeparams[3], fadeparams[4], weaponDef.projectilespeed or 1, isCylinder, weaponDef.heightBoostFactor or 0, weaponDef.heightMod or 0 } + unitDefRings[unitDefID]["rings"][weaponNum] = ringParams end end end @@ -247,119 +237,119 @@ end local function initUnitList() local unitDefRingsNames = { -- ARMADA - ['armclaw'] = { weapons = { 'ground' } }, - ['armllt'] = { weapons = { 'ground' } }, - ['armbeamer'] = { weapons = { 'ground' } }, - ['armhlt'] = { weapons = { 'ground' } }, - ['armguard'] = { weapons = { 'cannon'} }, - ['armrl'] = { weapons = { 'air' } }, --light aa - ['armferret'] = { weapons = { 'air' } }, - ['armcir'] = { weapons = { 'air' } }, --chainsaw - ['armdl'] = { weapons = { 'ground' } }, --depthcharge - ['armjuno'] = { weapons = { 'ground' } }, - ['armtl'] = { weapons = { 'ground' } }, --torp launcher - ['armfhlt'] = { weapons = { 'ground' } }, --floating hlt - ['armnavaldefturret'] = { weapons = { 'ground' } }, --cauterizer - ['armanavaldefturret'] = { weapons = { 'ground' } }, --liquifier - ['armfrt'] = { weapons = { 'air' } }, --floating rocket laucher - ['armfflak'] = { weapons = { 'air' } }, --floating flak AA - ['armatl'] = { weapons = { 'ground' } }, --adv torpedo launcher - ['armkraken'] = { weapons = { 'cannon' } }, --adv torpedo launcher - - ['armamb'] = { weapons = { 'cannon' } }, --ambusher 'cannon' - ['armpb'] = { weapons = { 'ground' } }, --pitbull 'cannon' - ['armanni'] = { weapons = { 'ground' } }, - ['armflak'] = { weapons = { 'air' } }, - ['armmercury'] = { weapons = { 'air' } }, - ['armemp'] = { weapons = { 'ground' } }, - ['armamd'] = { weapons = { 'nuke' } }, --antinuke - - ['armbrtha'] = { weapons = { 'lrpc' } }, - ['armvulc'] = { weapons = { 'lrpc' } }, + ["armclaw"] = { weapons = { "ground" } }, + ["armllt"] = { weapons = { "ground" } }, + ["armbeamer"] = { weapons = { "ground" } }, + ["armhlt"] = { weapons = { "ground" } }, + ["armguard"] = { weapons = { "cannon" } }, + ["armrl"] = { weapons = { "air" } }, --light aa + ["armferret"] = { weapons = { "air" } }, + ["armcir"] = { weapons = { "air" } }, --chainsaw + ["armdl"] = { weapons = { "ground" } }, --depthcharge + ["armjuno"] = { weapons = { "ground" } }, + ["armtl"] = { weapons = { "ground" } }, --torp launcher + ["armfhlt"] = { weapons = { "ground" } }, --floating hlt + ["armnavaldefturret"] = { weapons = { "ground" } }, --cauterizer + ["armanavaldefturret"] = { weapons = { "ground" } }, --liquifier + ["armfrt"] = { weapons = { "air" } }, --floating rocket laucher + ["armfflak"] = { weapons = { "air" } }, --floating flak AA + ["armatl"] = { weapons = { "ground" } }, --adv torpedo launcher + ["armkraken"] = { weapons = { "cannon" } }, --adv torpedo launcher + + ["armamb"] = { weapons = { "cannon" } }, --ambusher 'cannon' + ["armpb"] = { weapons = { "ground" } }, --pitbull 'cannon' + ["armanni"] = { weapons = { "ground" } }, + ["armflak"] = { weapons = { "air" } }, + ["armmercury"] = { weapons = { "air" } }, + ["armemp"] = { weapons = { "ground" } }, + ["armamd"] = { weapons = { "nuke" } }, --antinuke + + ["armbrtha"] = { weapons = { "lrpc" } }, + ["armvulc"] = { weapons = { "lrpc" } }, -- CORTEX - ['cormaw'] = { weapons = { 'ground' } }, - ['corexp'] = { weapons = { 'ground'} }, - ['cormexp'] = { weapons = { 'ground','ground' } }, - ['corllt'] = { weapons = { 'ground' } }, - ['corhllt'] = { weapons = { 'ground' } }, - ['corhlt'] = { weapons = { 'ground' } }, - ['corpun'] = { weapons = { 'cannon'} }, - ['corrl'] = { weapons = { 'air' } }, - ['cormadsam'] = { weapons = { 'air' } }, - ['corerad'] = { weapons = { 'air' } }, - ['cordl'] = { weapons = { 'ground' } }, - ['corjuno'] = { weapons = { 'ground' } }, - - ['corfhlt'] = { weapons = { 'ground' } }, --floating hlt - ['cornavaldefturret'] = { weapons = { 'ground' } }, --cyclops - ['coranavaldefturret'] = { weapons = { 'ground' } }, --orthrus - ['cortl'] = { weapons = { 'ground' } }, --torp launcher - ['coratl'] = { weapons = { 'ground' } }, --T2 torp launcher - ['corfrt'] = { weapons = { 'air' } }, --floating rocket laucher - ['corenaa'] = { weapons = { 'air' } }, --floating flak AA - ['corfdoom'] = { weapons = { [1] = 'cannon' } }, - - ['cortoast'] = { weapons = { 'cannon' } }, - ['corvipe'] = { weapons = { 'ground' } }, - ['cordoom'] = { weapons = { 'ground', 'ground', 'ground'} }, - ['corflak'] = { weapons = { 'air' } }, - ['corscreamer'] = { weapons = { 'air' } }, - ['cortron'] = { weapons = { 'cannon' } }, - ['corfmd'] = { weapons = { 'nuke' } }, - ['corint'] = { weapons = { 'lrpc' } }, - ['corbuzz'] = { weapons = { 'lrpc' } }, + ["cormaw"] = { weapons = { "ground" } }, + ["corexp"] = { weapons = { "ground" } }, + ["cormexp"] = { weapons = { "ground", "ground" } }, + ["corllt"] = { weapons = { "ground" } }, + ["corhllt"] = { weapons = { "ground" } }, + ["corhlt"] = { weapons = { "ground" } }, + ["corpun"] = { weapons = { "cannon" } }, + ["corrl"] = { weapons = { "air" } }, + ["cormadsam"] = { weapons = { "air" } }, + ["corerad"] = { weapons = { "air" } }, + ["cordl"] = { weapons = { "ground" } }, + ["corjuno"] = { weapons = { "ground" } }, + + ["corfhlt"] = { weapons = { "ground" } }, --floating hlt + ["cornavaldefturret"] = { weapons = { "ground" } }, --cyclops + ["coranavaldefturret"] = { weapons = { "ground" } }, --orthrus + ["cortl"] = { weapons = { "ground" } }, --torp launcher + ["coratl"] = { weapons = { "ground" } }, --T2 torp launcher + ["corfrt"] = { weapons = { "air" } }, --floating rocket laucher + ["corenaa"] = { weapons = { "air" } }, --floating flak AA + ["corfdoom"] = { weapons = { [1] = "cannon" } }, + + ["cortoast"] = { weapons = { "cannon" } }, + ["corvipe"] = { weapons = { "ground" } }, + ["cordoom"] = { weapons = { "ground", "ground", "ground" } }, + ["corflak"] = { weapons = { "air" } }, + ["corscreamer"] = { weapons = { "air" } }, + ["cortron"] = { weapons = { "cannon" } }, + ["corfmd"] = { weapons = { "nuke" } }, + ["corint"] = { weapons = { "lrpc" } }, + ["corbuzz"] = { weapons = { "lrpc" } }, -- LEGION - ['legabm'] = { weapons = { 'nuke' } }, --antinuke - ['legrampart'] = { weapons = { 'nuke', 'ground' } }, --rampart - ['leglht'] = { weapons = { 'ground' } }, --llt - ['legtl'] = { weapons = { 'ground' } }, --torpedo launcher - ['legcluster'] = { weapons = { 'cannon' } }, --short range arty T1 - ['legacluster'] = { weapons = { 'cannon' } }, --T2 arty - ['legdtr'] = { weapons = { 'ground' } }, --dragons jaw - ['leghive'] = { weapons = { 'ground' } }, --Drone-defense - ['legfhive'] = { weapons = { 'ground' } }, --Drone-defense - ['legmg'] = { weapons = { 'ground' } }, --ground-AA MG defense - ['legfmg'] = { weapons = { 'ground' } }, --cyclops - ['legnavaldefturret'] = { weapons = { 'ground' } }, --cyclops - ['leganavaldefturret'] = { weapons = { 'ground' } }, --Ionia - ['legbombard'] = { weapons = { 'ground' } }, --Grenadier defense - ['legbastion'] = { weapons = { 'ground' } }, --T2 Heatray Tower - ['legrl'] = { weapons = { 'air' } }, --T1 AA - ['leglupara'] = { weapons = { 'air' } }, --T1.5 AA - ['legrhapsis'] = { weapons = { 'air' } }, --T1.5 AA - ['legflak'] = { weapons = { 'air' } }, --T2 AA FLAK - ['leglraa'] = { weapons = { 'air' } }, --T2 LR-AA - ['legperdition'] = { weapons = { 'cannon' } }, --T2 LR-AA - ['legapopupdef'] = { weapons = { 'ground' } }, --popup riot/minigun turret - ['leganavaltorpturret'] = { weapons = { 'ground' } }, --torpedo launcher - - ['legstarfall'] = { weapons = { 'lrpc' } }, - ['leglrpc'] = { weapons = { 'lrpc' } }, + ["legabm"] = { weapons = { "nuke" } }, --antinuke + ["legrampart"] = { weapons = { "nuke", "ground" } }, --rampart + ["leglht"] = { weapons = { "ground" } }, --llt + ["legtl"] = { weapons = { "ground" } }, --torpedo launcher + ["legcluster"] = { weapons = { "cannon" } }, --short range arty T1 + ["legacluster"] = { weapons = { "cannon" } }, --T2 arty + ["legdtr"] = { weapons = { "ground" } }, --dragons jaw + ["leghive"] = { weapons = { "ground" } }, --Drone-defense + ["legfhive"] = { weapons = { "ground" } }, --Drone-defense + ["legmg"] = { weapons = { "ground" } }, --ground-AA MG defense + ["legfmg"] = { weapons = { "ground" } }, --cyclops + ["legnavaldefturret"] = { weapons = { "ground" } }, --cyclops + ["leganavaldefturret"] = { weapons = { "ground" } }, --Ionia + ["legbombard"] = { weapons = { "ground" } }, --Grenadier defense + ["legbastion"] = { weapons = { "ground" } }, --T2 Heatray Tower + ["legrl"] = { weapons = { "air" } }, --T1 AA + ["leglupara"] = { weapons = { "air" } }, --T1.5 AA + ["legrhapsis"] = { weapons = { "air" } }, --T1.5 AA + ["legflak"] = { weapons = { "air" } }, --T2 AA FLAK + ["leglraa"] = { weapons = { "air" } }, --T2 LR-AA + ["legperdition"] = { weapons = { "cannon" } }, --T2 LR-AA + ["legapopupdef"] = { weapons = { "ground" } }, --popup riot/minigun turret + ["leganavaltorpturret"] = { weapons = { "ground" } }, --torpedo launcher + + ["legstarfall"] = { weapons = { "lrpc" } }, + ["leglrpc"] = { weapons = { "lrpc" } }, -- MOBILE ANTINUKES - ['armscab'] = { weapons = { 'nuke' } }, - ['armcarry'] = { weapons = { 'nuke' } }, - ['cormabm'] = { weapons = { 'nuke' } }, - ['corcarry'] = { weapons = { 'nuke' } }, - ['legavantinuke'] = { weapons = { 'nuke' } }, - ['armantiship'] = { weapons = { 'nuke' } }, - ['corantiship'] = { weapons = { 'nuke' } }, - ['leganavyantinukecarrier'] = { weapons = { 'nuke' } }, -- NOTE: drone weapon shown in attack ranges + ["armscab"] = { weapons = { "nuke" } }, + ["armcarry"] = { weapons = { "nuke" } }, + ["cormabm"] = { weapons = { "nuke" } }, + ["corcarry"] = { weapons = { "nuke" } }, + ["legavantinuke"] = { weapons = { "nuke" } }, + ["armantiship"] = { weapons = { "nuke" } }, + ["corantiship"] = { weapons = { "nuke" } }, + ["leganavyantinukecarrier"] = { weapons = { "nuke" } }, -- NOTE: drone weapon shown in attack ranges -- SCAVENGERS - ['scavbeacon_t1_scav'] = { weapons = { 'ground' } }, - ['scavbeacon_t2_scav'] = { weapons = { 'ground' } }, - ['scavbeacon_t3_scav'] = { weapons = { 'ground' } }, - ['scavbeacon_t4_scav'] = { weapons = { 'ground' } }, + ["scavbeacon_t1_scav"] = { weapons = { "ground" } }, + ["scavbeacon_t2_scav"] = { weapons = { "ground" } }, + ["scavbeacon_t3_scav"] = { weapons = { "ground" } }, + ["scavbeacon_t4_scav"] = { weapons = { "ground" } }, - ['armannit3'] = { weapons = { 'ground' } }, - ['armminivulc'] = { weapons = { 'ground' } }, + ["armannit3"] = { weapons = { "ground" } }, + ["armminivulc"] = { weapons = { "ground" } }, - ['cordoomt3'] = { weapons = { 'ground' } }, - ['corhllllt'] = { weapons = { 'ground' } }, - ['corminibuzz'] = { weapons = { 'ground' } } + ["cordoomt3"] = { weapons = { "ground" } }, + ["corhllllt"] = { weapons = { "ground" } }, + ["corminibuzz"] = { weapons = { "ground" } }, } -- convert unitname -> unitDefID unitDefRings = {} @@ -375,39 +365,38 @@ local function initUnitList() end -- Initialize Colors too local scavlist = {} - for k,_ in pairs(unitDefRings) do + for k, _ in pairs(unitDefRings) do scavlist[k] = true end -- add scavs - for k,_ in pairs(scavlist) do + for k, _ in pairs(scavlist) do --spEcho(k, unitName[k]) - if UnitDefNames[unitName[k] .. '_scav'] then - unitDefRings[UnitDefNames[unitName[k] .. '_scav'].id] = unitDefRings[k] + if UnitDefNames[unitName[k] .. "_scav"] then + unitDefRings[UnitDefNames[unitName[k] .. "_scav"].id] = unitDefRings[k] end end local scavlist = {} - for k,_ in pairs(mobileAntiUnitDefs) do + for k, _ in pairs(mobileAntiUnitDefs) do scavlist[k] = true end - for k,v in pairs(scavlist) do - if UnitDefNames[unitName[k] .. '_scav'] then - mobileAntiUnitDefs[UnitDefNames[unitName[k] .. '_scav'].id] = mobileAntiUnitDefs[k] + for k, v in pairs(scavlist) do + if UnitDefNames[unitName[k] .. "_scav"] then + mobileAntiUnitDefs[UnitDefNames[unitName[k] .. "_scav"].id] = mobileAntiUnitDefs[k] end end -- Initialize featureDefIDtoUnitDefID - local wreckheaps = {"_dead","_heap"} - for unitDefID,_ in pairs(unitDefRings) do + local wreckheaps = { "_dead", "_heap" } + for unitDefID, _ in pairs(unitDefRings) do local unitDefName = unitName[unitDefID] for i, suffix in pairs(wreckheaps) do - if FeatureDefNames[unitDefName..suffix] then - featureDefIDtoUnitDefID[FeatureDefNames[unitDefName..suffix].id] = unitDefID + if FeatureDefNames[unitDefName .. suffix] then + featureDefIDtoUnitDefID[FeatureDefNames[unitDefName .. suffix].id] = unitDefID --spEcho(FeatureDefNames[unitDefName..suffix].id, unitDefID) end end end - end --Button display configuration @@ -419,61 +408,60 @@ local myAllyTeam = Spring.GetMyAllyTeamID() local numallyteams = 2 local defenses = {} -- table of unitID keys to info tables: - --unitID = {posx = 0, posy = 0, posz = 0, teamID = 0, - -- vaokeys = {key1 = targetvao1, ... } - --} +--unitID = {posx = 0, posy = 0, posz = 0, teamID = 0, +-- vaokeys = {key1 = targetvao1, ... } +--} local enemydefenses = {} -- a minor optimization to prevent iterating over our own on removal search local mobileAntiUnits = {} - -------------------------------------------------------------------------------- -local glDepthTest = gl.DepthTest -local glLineWidth = gl.LineWidth -local glTexture = gl.Texture -local glClear = gl.Clear -local glColorMask = gl.ColorMask -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp +local glDepthTest = gl.DepthTest +local glLineWidth = gl.LineWidth +local glTexture = gl.Texture +local glClear = gl.Clear +local glColorMask = gl.ColorMask +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp local GL_KEEP = 0x1E00 --GL.KEEP local GL_REPLACE = GL.REPLACE --GL.KEEP local spGetPositionLosState = Spring.GetPositionLosState -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition local chobbyInterface function widget:TextCommand(command) - local mycommand=false --buttonConfig["enemy"][tag] + local mycommand = false --buttonConfig["enemy"][tag] if string.find(command, "defrange", nil, true) then mycommand = true - local ally = 'ally' - local rangetype = 'ground' + local ally = "ally" + local rangetype = "ground" local enabled = false if string.find(command, "enemy", nil, true) then - ally = 'enemy' + ally = "enemy" end if string.find(command, "air", nil, true) then - rangetype = 'air' + rangetype = "air" elseif string.find(command, "nuke", nil, true) then - rangetype = 'nuke' + rangetype = "nuke" end if string.find(command, "+", nil, true) then enabled = true end - if rangetype == 'ground' then - buttonConfig[ally]['ground']=enabled - buttonConfig[ally]['cannon']=enabled + if rangetype == "ground" then + buttonConfig[ally]["ground"] = enabled + buttonConfig[ally]["cannon"] = enabled else - buttonConfig[ally][rangetype]=enabled + buttonConfig[ally][rangetype] = enabled end - spEcho("Range visibility of "..ally.." "..rangetype.." defenses set to",enabled) + spEcho("Range visibility of " .. ally .. " " .. rangetype .. " defenses set to", enabled) return true end @@ -491,37 +479,37 @@ local largeCircleSegments = 1024 local smallCircleVBO = nil local smallCircleSegments = 128 -local weaponTypeToString = {"ground","air","nuke","cannon"} -local allyenemypairs = {"ally","enemy"} +local weaponTypeToString = { "ground", "air", "nuke", "cannon" } +local allyenemypairs = { "ally", "enemy" } local defenseRangeClasses = {} for allyenemy, ringclasses in pairs(buttonConfig) do for ringclass, enabled in pairs(ringclasses) do - tableInsert(defenseRangeClasses, allyenemy .. ringclass) + tableInsert(defenseRangeClasses, allyenemy .. ringclass) end end --local defenseRangeClasses = {'enemyair','enemyground','enemynuke','allyair','allyground','allynuke', 'enemycannon', 'allycannon'} local defenseRangeVAOs = {} local circleInstanceVBOLayout = { - {id = 1, name = 'posscale', size = 4}, -- abs pos for static units, offset for dynamic units, scale is actual range, Y is turretheight - {id = 2, name = 'color1', size = 4}, -- vec4 the color of this new - {id = 3, name = 'visibility', size = 4}, --- vec4 FadeStart, FadeEnd, StartAlpha, EndAlpha - {id = 4, name = 'projectileParams', size = 4}, --- projectileSpeed, iscylinder, heightBoostFactor , heightMod - {id = 5, name = 'additionalParams', size = 4 }, --- groupselectionfadescale, weaponType, ISDGUN, MAXANGLEDIF - {id = 6, name = 'instData', size = 4, type = GL.UNSIGNED_INT }, -- Currently unused within defense ranges, as they are forced-static - } + { id = 1, name = "posscale", size = 4 }, -- abs pos for static units, offset for dynamic units, scale is actual range, Y is turretheight + { id = 2, name = "color1", size = 4 }, -- vec4 the color of this new + { id = 3, name = "visibility", size = 4 }, --- vec4 FadeStart, FadeEnd, StartAlpha, EndAlpha + { id = 4, name = "projectileParams", size = 4 }, --- projectileSpeed, iscylinder, heightBoostFactor , heightMod + { id = 5, name = "additionalParams", size = 4 }, --- groupselectionfadescale, weaponType, ISDGUN, MAXANGLEDIF + { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT }, -- Currently unused within defense ranges, as they are forced-static +} local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local pushElementInstance = InstanceVBOTable.pushElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local getElementInstanceData = InstanceVBOTable.getElementInstanceData local defenseRangeShader = nil local shaderSourceCache = { - shaderName = 'Defense Range GL4', + shaderName = "Defense Range GL4", vssrcpath = "LuaUI/Shaders/weapon_range_rings_unified_gl4.vert.glsl", fssrcpath = "LuaUI/Shaders/weapon_range_rings_unified_gl4.frag.glsl", shaderConfig = { @@ -546,10 +534,9 @@ local shaderSourceCache = { }, } - local function goodbye(reason) - spEcho("DefenseRange GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("DefenseRange GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end local function makeShaders() @@ -564,8 +551,8 @@ end local function initGL4() smallCircleVBO = InstanceVBOTable.makeCircleVBO(smallCircleSegments) largeCircleVBO = InstanceVBOTable.makeCircleVBO(largeCircleSegments) - for i,defRangeClass in ipairs(defenseRangeClasses) do - defenseRangeVAOs[defRangeClass] = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout,16,defRangeClass .. "_defenserange_gl4") + for i, defRangeClass in ipairs(defenseRangeClasses) do + defenseRangeVAOs[defRangeClass] = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 16, defRangeClass .. "_defenserange_gl4") if defRangeClass:find("nuke", nil, true) or defRangeClass:find("lrpc", nil, true) then --defRangeClass:find("cannon", nil, true) or defenseRangeVAOs[defRangeClass].vertexVBO = largeCircleVBO defenseRangeVAOs[defRangeClass].numVertices = largeCircleSegments @@ -573,7 +560,7 @@ local function initGL4() defenseRangeVAOs[defRangeClass].vertexVBO = smallCircleVBO defenseRangeVAOs[defRangeClass].numVertices = smallCircleSegments end - local newVAO = InstanceVBOTable.makeVAOandAttach(defenseRangeVAOs[defRangeClass].vertexVBO,defenseRangeVAOs[defRangeClass].instanceVBO) + local newVAO = InstanceVBOTable.makeVAOandAttach(defenseRangeVAOs[defRangeClass].vertexVBO, defenseRangeVAOs[defRangeClass].instanceVBO) defenseRangeVAOs[defRangeClass].VAO = newVAO end return makeShaders() @@ -586,48 +573,56 @@ function widget:Initialize() return end - WG['defrange'] = {} - for _,ae in ipairs({'ally','enemy'}) do + WG["defrange"] = {} + for _, ae in ipairs({ "ally", "enemy" }) do local Ae = string.upper(string.sub(ae, 1, 1)) .. string.sub(ae, 2) - for _,wt in ipairs({'ground','air','nuke'}) do + for _, wt in ipairs({ "ground", "air", "nuke" }) do local Wt = string.upper(string.sub(wt, 1, 1)) .. string.sub(wt, 2) - WG['defrange']['get'..Ae..Wt] = function() return buttonConfig[ae][wt] end - WG['defrange']['set'..Ae..Wt] = function(value) - if wt == 'ground' then - buttonConfig[ae]['ground'] = value - buttonConfig[ae]['lrpc'] = value + WG["defrange"]["get" .. Ae .. Wt] = function() + return buttonConfig[ae][wt] + end + WG["defrange"]["set" .. Ae .. Wt] = function(value) + if wt == "ground" then + buttonConfig[ae]["ground"] = value + buttonConfig[ae]["lrpc"] = value else buttonConfig[ae][wt] = value end - spEcho(string.format("Defense Range GL4 Setting %s%s to %s",Ae,Wt, value and 'on' or 'off')) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + spEcho(string.format("Defense Range GL4 Setting %s%s to %s", Ae, Wt, value and "on" or "off")) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end end end myAllyTeam = Spring.GetMyAllyTeamID() - local allyteamlist = Spring.GetAllyTeamList( ) + local allyteamlist = Spring.GetAllyTeamList() --spEcho("# of allyteams = ", #allyteamlist) numallyteams = #allyteamlist - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end local floor = math.floor -local function hashPos(x,z) - return floor(x/8)*4096 + floor(z/8) +local function hashPos(x, z) + return floor(x / 8) * 4096 + floor(z / 8) end local cacheTable = {} -for i=1,24 do cacheTable[i] = 0 end +for i = 1, 24 do + cacheTable[i] = 0 +end local function UnitDetected(unitID, unitDefID, unitTeam, noUpload) - if unitDefRings[unitDefID] == nil then return end -- no rings for this + if unitDefRings[unitDefID] == nil then + return + end -- no rings for this - if defenses[unitID] ~= nil then return end -- already has rings + if defenses[unitID] ~= nil then + return + end -- already has rings -- otherwise we must add it! @@ -637,40 +632,38 @@ local function UnitDetected(unitID, unitDefID, unitTeam, noUpload) --for weaponNum = 1, #weapons do local addedrings = 0 - for i, weaponType in pairs(unitDefRings[unitDefID]['weapons']) do + for i, weaponType in pairs(unitDefRings[unitDefID]["weapons"]) do local allystring = alliedUnit and "ally" or "enemy" -- We want to continue to maintain ally lists, because these ally lists will be if buttonConfig[allystring][weaponType] or (colorConfig.drawAllyCategoryBuildQueue and (allystring == "ally")) then - --local weaponType = unitDefRings[unitDefID]['weapons'][weaponNum] local weaponID = i - local ringParams = unitDefRings[unitDefID]['rings'][i] + local ringParams = unitDefRings[unitDefID]["rings"][i] local x, y, z, mpx, mpy, mpz, apx, apy, apz = spGetUnitPosition(unitID, true, true) local wpx, wpy, wpz, wdx, wdy, wdz = Spring.GetUnitWeaponVectors(unitID, weaponID) --spEcho("Defranges: unitID", unitID,x,y,z,"weaponID", weaponID, "y", y, "mpy", mpy,"wpy", wpy) -- Now this is a truly terrible hack, we cache each unitDefID's max weapon turret height at position 18 in the table -- so it only goes up with popups - local turretHeight = mathMax(ringParams[18] or 0, (wpy or mpy ) - y) + local turretHeight = mathMax(ringParams[18] or 0, (wpy or mpy) - y) ringParams[18] = turretHeight - cacheTable[1] = mpx cacheTable[2] = turretHeight cacheTable[3] = mpz local vaokey = allystring .. weaponType - for j = 1,13 do - cacheTable[j+3] = ringParams[j] + for j = 1, 13 do + cacheTable[j + 3] = ringParams[j] end local instanceID = 1000000 * i + unitID - pushElementInstance(defenseRangeVAOs[vaokey], cacheTable, instanceID, true, noUpload) + pushElementInstance(defenseRangeVAOs[vaokey], cacheTable, instanceID, true, noUpload) addedrings = addedrings + 1 if defenses[unitID] == nil then --lazy creation - defenses[unitID] = { posx = mpx, posy = mpy, posz = mpz, vaokeys = {}, allied = alliedUnit, unitDefID = unitDefID} + defenses[unitID] = { posx = mpx, posy = mpy, posz = mpz, vaokeys = {}, allied = alliedUnit, unitDefID = unitDefID } end defenses[unitID].vaokeys[instanceID] = vaokey end @@ -686,9 +679,8 @@ local function UnitDetected(unitID, unitDefID, unitTeam, noUpload) if alliedUnit then -- if allied rings are on, then add them! else enemydefenses[unitID] = true - defensePosHash[hashPos(x,z)] = unitID + defensePosHash[hashPos(x, z)] = unitID end - end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) @@ -732,21 +724,23 @@ local function checkEnemyUnitConfirmedDead(unitID, defense) return false end -local function removeUnit(unitID,defense) +local function removeUnit(unitID, defense) mobileAntiUnits[unitID] = nil enemydefenses[unitID] = nil - defensePosHash[hashPos(defense.posx,defense.posz)] = nil - for instanceKey,vaoKey in pairs(defense.vaokeys) do + defensePosHash[hashPos(defense.posx, defense.posz)] = nil + for instanceKey, vaoKey in pairs(defense.vaokeys) do --spEcho(vaoKey,instanceKey) if defenseRangeVAOs[vaoKey].instanceIDtoIndex[instanceKey] then - popElementInstance(defenseRangeVAOs[vaoKey],instanceKey) + popElementInstance(defenseRangeVAOs[vaoKey], instanceKey) end end defenses[unitID] = nil end function widget:VisibleUnitRemoved(unitID) -- remove the corresponding ground plate if it exists - if defenses[unitID] == nil then return end -- nothing to do + if defenses[unitID] == nil then + return + end -- nothing to do local defense = defenses[unitID] --local teamID = spGetUnitTeam(unitID) @@ -768,7 +762,6 @@ function widget:VisibleUnitRemoved(unitID) -- remove the corresponding ground pl end end - function widget:FeatureCreated(featureID, allyTeam) -- check if the feature we created could be related to a defense that we currently have active? -- ugh this will require a unitdefid based hash and some other nasty tricks @@ -776,13 +769,12 @@ function widget:FeatureCreated(featureID, allyTeam) local featureDefID = Spring.GetFeatureDefID(featureID) if featureDefID and featureDefIDtoUnitDefID[featureDefID] then local fx, fy, fz = Spring.GetFeaturePosition(featureID) - local poshash = floor(fx/8)*4096 + floor(fz/8) + local poshash = floor(fx / 8) * 4096 + floor(fz / 8) local unitID = defensePosHash[poshash] if unitID then - if defenses[unitID] and defenses[unitID].allied == false and - featureDefIDtoUnitDefID[featureDefID] == defenses[unitID].unitDefID then + if defenses[unitID] and defenses[unitID].allied == false and featureDefIDtoUnitDefID[featureDefID] == defenses[unitID].unitDefID then --spEcho("feature created at a likely dead defense pos!") - removeUnit(unitID,defenses[unitID]) + removeUnit(unitID, defenses[unitID]) end end end @@ -795,7 +787,8 @@ function widget:PlayerChanged(playerID) --spEcho("GetLocalPlayerID", GetLocalPlayerID) local GetMyTeamID = Spring.GetMyTeamID ( ) --spEcho("GetMyTeamID", GetMyTeamID) - ]]-- + ]] + -- local nowspec, nowfullview = spGetSpectatingState() local nowmyAllyTeam = Spring.GetMyAllyTeamID() -- When we start, check if there are >2 allyteams @@ -819,8 +812,8 @@ function widget:PlayerChanged(playerID) if reinit then myAllyTeam = nowmyAllyTeam -- only update if we reinit --spEcho("DefenseRange GL4 allyteam change detected, reinitializing") - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end else --spEcho("No change needed", numallyteams, myAllyTeam) @@ -839,7 +832,7 @@ function widget:GameFrame(gf) end local buildUnitDefID = nil -local buildDrawOverride = { ground = false, air = false, nuke = false , cannon = false, lrpc = false} +local buildDrawOverride = { ground = false, air = false, nuke = false, cannon = false, lrpc = false } function widget:Update(dt) --spec, fullview = spGetSpectatingState() @@ -847,26 +840,25 @@ function widget:Update(dt) -- return --end --- detect if our “myAllyTeam” has changed (e.g. a spec following a different player) - local currentAllyTeam = Spring.GetMyAllyTeamID() - if currentAllyTeam ~= myAllyTeam then - myAllyTeam = currentAllyTeam - -- clear out all the old rings - defenses, enemydefenses, defensePosHash, mobileAntiUnits = {}, {}, {}, {} - for _, ivt in pairs(defenseRangeVAOs) do - InstanceVBOTable.clearInstanceTable(ivt) - end - -- rebuild from whatever visibleUnits API you have - local extVisibleUnits = (WG.unittrackerapi and WG.unittrackerapi.visibleUnits) - or (function() - local t = {} - for _, uid in ipairs(Spring.GetAllUnits()) do - t[uid] = spGetUnitDefID(uid) - end - return t - end)() - widget:VisibleUnitsChanged(extVisibleUnits, nil) - end + -- detect if our “myAllyTeam” has changed (e.g. a spec following a different player) + local currentAllyTeam = Spring.GetMyAllyTeamID() + if currentAllyTeam ~= myAllyTeam then + myAllyTeam = currentAllyTeam + -- clear out all the old rings + defenses, enemydefenses, defensePosHash, mobileAntiUnits = {}, {}, {}, {} + for _, ivt in pairs(defenseRangeVAOs) do + InstanceVBOTable.clearInstanceTable(ivt) + end + -- rebuild from whatever visibleUnits API you have + local extVisibleUnits = (WG.unittrackerapi and WG.unittrackerapi.visibleUnits) or (function() + local t = {} + for _, uid in ipairs(Spring.GetAllUnits()) do + t[uid] = spGetUnitDefID(uid) + end + return t + end)() + widget:VisibleUnitsChanged(extVisibleUnits, nil) + end if gameFrame >= lastUpdatedGameFrame + antiupdaterate then lastUpdatedGameFrame = gameFrame @@ -879,17 +871,16 @@ function widget:Update(dt) defense.posx = px defense.posy = py defense.posz = pz - for instanceKey,vaoKey in pairs(defense.vaokeys) do + for instanceKey, vaoKey in pairs(defense.vaokeys) do local cacheTable = getElementInstanceData(defenseRangeVAOs[vaoKey], instanceKey, cacheTable) -- this is horrible perf wise --spEcho("Anti at",unitID, px, pz,mobileantiinfo[1],mobileantiinfo[2],vbodata[1],vbodata[2]) cacheTable[1] = px cacheTable[2] = py cacheTable[3] = pz - pushElementInstance(defenseRangeVAOs[vaoKey],cacheTable,instanceKey, true) -- last true is updateExisting + pushElementInstance(defenseRangeVAOs[vaoKey], cacheTable, instanceKey, true) -- last true is updateExisting end end end - end if gameFrame >= lastRemoval + removalRate then @@ -919,16 +910,16 @@ function widget:Update(dt) local cmdID = select(2, Spring.GetActiveCommand()) -- remove from queue every frame cause mouse will probably move anyway -- we kinda also need to remove if the allyenemy state changed - if (buildUnitDefID ~= nil) then + if buildUnitDefID ~= nil then local rings = unitDefRings[buildUnitDefID] if rings then -- find out which VBO to remove from: - local allystring = 'ally' - for i, weaponType in ipairs(rings['weapons']) do + local allystring = "ally" + for i, weaponType in ipairs(rings["weapons"]) do buildDrawOverride[weaponType] = false - for j,allyenemy in ipairs(allyenemypairs) do -- remove from all + for j, allyenemy in ipairs(allyenemypairs) do -- remove from all local vaokey = allyenemy .. weaponType - local instanceID = 2000000 + 100000* i + buildUnitDefID + local instanceID = 2000000 + 100000 * i + buildUnitDefID if defenseRangeVAOs[vaokey].instanceIDtoIndex[instanceID] then popElementInstance(defenseRangeVAOs[vaokey], instanceID) end @@ -938,8 +929,8 @@ function widget:Update(dt) buildUnitDefID = nil end - if (cmdID ~= nil and (cmdID < 0)) then - buildUnitDefID = -1* cmdID + if cmdID ~= nil and (cmdID < 0) then + buildUnitDefID = -1 * cmdID if unitDefRings[buildUnitDefID] then local rings = unitDefRings[buildUnitDefID] -- only add to ally, independent of buttonconfig (ugh) @@ -954,38 +945,34 @@ function widget:Update(dt) if coords and coords[1] and coords[2] and coords[3] then local bpx, bpy, bpz = Spring.Pos2BuildPos(buildUnitDefID, coords[1], coords[2], coords[3]) - local allystring = 'ally' - for i, weaponType in pairs(unitDefRings[buildUnitDefID]['weapons']) do - local allystring = "ally" - buildDrawOverride[weaponType] = true - -- allow rings if either normal ally-rings are on, OR build-queue preview is explicitly enabled - if buttonConfig[allystring][weaponType] - or colorConfig.drawAllyCategoryBuildQueue - then - local ringParams = unitDefRings[buildUnitDefID]['rings'][i] - if ringParams then - cacheTable[1] = bpx - cacheTable[2] = ringParams[18] - cacheTable[3] = bpz - for j = 1,13 do - cacheTable[j+3] = ringParams[j] - end - local vaokey = allystring .. weaponType - local instanceID = 2000000 + 100000 * i + buildUnitDefID - pushElementInstance(defenseRangeVAOs[vaokey], cacheTable, instanceID, true) - end - end - end + local allystring = "ally" + for i, weaponType in pairs(unitDefRings[buildUnitDefID]["weapons"]) do + local allystring = "ally" + buildDrawOverride[weaponType] = true + -- allow rings if either normal ally-rings are on, OR build-queue preview is explicitly enabled + if buttonConfig[allystring][weaponType] or colorConfig.drawAllyCategoryBuildQueue then + local ringParams = unitDefRings[buildUnitDefID]["rings"][i] + if ringParams then + cacheTable[1] = bpx + cacheTable[2] = ringParams[18] + cacheTable[3] = bpz + for j = 1, 13 do + cacheTable[j + 3] = ringParams[j] + end + local vaokey = allystring .. weaponType + local instanceID = 2000000 + 100000 * i + buildUnitDefID + pushElementInstance(defenseRangeVAOs[vaokey], cacheTable, instanceID, true) + end + end + end end end - end -- not build command - end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end local drawcounts = {} @@ -997,17 +984,17 @@ local function GetCameraHeightFactor() -- returns a smoothstepped value between local camheight = camY - mathMax(Spring.GetGroundHeight(camX, camZ), 0) -- Smoothstep to half line width as camera goes over 2k height to 4k height --genType t; /* Or genDType t; */ - --t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - --return t * t * (3.0 - 2.0 * t); + --t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + --return t * t * (3.0 - 2.0 * t); camheight = math.clamp((camheight - colorConfig.distanceScaleStart) / (colorConfig.distanceScaleEnd - colorConfig.distanceScaleStart), 0, 1) --return camheight * camheight * (3 - 2 *camheight) return 1 end -local groundnukeair = {"ground","air","nuke"} -local cannonlrpc = {"cannon","lrpc"} -local allrings = {"ground","air","nuke", "cannon","lrpc"} +local groundnukeair = { "ground", "air", "nuke" } +local cannonlrpc = { "cannon", "lrpc" } +local allrings = { "ground", "air", "nuke", "cannon", "lrpc" } local stenciledrings = {} local nonstenciledrings = {} for i, weaponType in ipairs(allrings) do @@ -1018,28 +1005,27 @@ for i, weaponType in ipairs(allrings) do end end - local function DRAWRINGS(primitiveType, linethickness, classes, alpha) local stencilMask - for i,allyState in ipairs(allyenemypairs) do + for i, allyState in ipairs(allyenemypairs) do for j, wt in ipairs(classes) do - local defRangeClass = allyState..wt + local defRangeClass = allyState .. wt local iT = defenseRangeVAOs[defRangeClass] - -- if we might have queued buildings here, and we already discarded addition of unwanted rings based on buttonConfig in visibleUnitCreated + -- if we might have queued buildings here, and we already discarded addition of unwanted rings based on buttonConfig in visibleUnitCreated if iT.usedElements > 0 and (buttonConfig[allyState][wt] or buildDrawOverride[wt]) then - defenseRangeShader:SetUniform("cannonmode",colorConfig[wt].cannonMode and 1 or 0) - defenseRangeShader:SetUniform("lineAlphaUniform",colorConfig[wt][alpha]) + defenseRangeShader:SetUniform("cannonmode", colorConfig[wt].cannonMode and 1 or 0) + defenseRangeShader:SetUniform("lineAlphaUniform", colorConfig[wt][alpha]) if linethickness then glLineWidth(colorConfig[wt][linethickness] * cameraHeightFactor) end if colorConfig[wt].stencilMask then - stencilMask = colorConfig[wt].stencilMask * ( (i==1) and 1 or 16) - glStencilMask(stencilMask) -- only allow these bits to get written + stencilMask = colorConfig[wt].stencilMask * ((i == 1) and 1 or 16) + glStencilMask(stencilMask) -- only allow these bits to get written glStencilFunc(GL.NOTEQUAL, stencilMask, stencilMask) -- what to do with the stencil end - iT.VAO:DrawArrays(primitiveType,iT.numVertices,0,iT.usedElements,0) -- +1!!! + iT.VAO:DrawArrays(primitiveType, iT.numVertices, 0, iT.usedElements, 0) -- +1!!! end end end @@ -1054,9 +1040,10 @@ function widget:DrawWorld() defenseRangeShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or defenseRangeShader end - - if chobbyInterface then return end - if not Spring.IsGUIHidden() and (not WG['topbar'] or not WG['topbar'].showingQuit()) then + if chobbyInterface then + return + end + if not Spring.IsGUIHidden() and (not WG["topbar"] or not WG["topbar"].showingQuit()) then cameraHeightFactor = GetCameraHeightFactor() * 0.5 + 0.5 glTexture(0, "$heightmap") glTexture(1, "$info") @@ -1075,23 +1062,20 @@ function widget:DrawWorld() DRAWRINGS(GL.TRIANGLE_FAN, nil, stenciledrings) -- FILL THE CIRCLES --glLineWidth(mathMax(0.1,4 + math.sin(gameFrame * 0.04) * 10)) - glColorMask(true, true, true, true) -- re-enable color drawing + glColorMask(true, true, true, true) -- re-enable color drawing glStencilMask(0) glDepthTest(GL.LEQUAL) -- test for depth on these outside cases - DRAWRINGS(GL.LINE_LOOP, 'externallinethickness', stenciledrings, "externalalpha") -- DRAW THE OUTER RINGS + DRAWRINGS(GL.LINE_LOOP, "externallinethickness", stenciledrings, "externalalpha") -- DRAW THE OUTER RINGS glStencilTest(false) - glStencilMask(255) -- Set all bits of stencil buffer to writeable + glStencilMask(255) -- Set all bits of stencil buffer to writeable glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP) -- Reset default stencil operation (which is the do nothing operation) glClear(GL.STENCIL_BUFFER_BIT) -- Clear the stencil buffer for whichever widget wants it next (this is probably redundant) -- All the above are needed :O - end - - DRAWRINGS(GL.LINE_LOOP, 'internallinethickness', stenciledrings, "internalalpha") -- DRAW THE INNER RINGS - DRAWRINGS(GL.LINE_LOOP, 'externallinethickness', nonstenciledrings, "externalalpha") -- DRAW THE INNER RINGS - + DRAWRINGS(GL.LINE_LOOP, "internallinethickness", stenciledrings, "internalalpha") -- DRAW THE INNER RINGS + DRAWRINGS(GL.LINE_LOOP, "externallinethickness", nonstenciledrings, "externalalpha") -- DRAW THE INNER RINGS defenseRangeShader:Deactivate() @@ -1099,19 +1083,22 @@ function widget:DrawWorld() glTexture(1, false) glDepthTest(false) if false and Spring.GetDrawFrame() % 60 == 0 then - local s = 'drawcounts: ' - for k,v in pairs(drawcounts) do s = s .. " " .. tostring(k) .. ":" .. tostring(v) end + local s = "drawcounts: " + for k, v in pairs(drawcounts) do + s = s .. " " .. tostring(k) .. ":" .. tostring(v) + end spEcho(s) end end end if autoReload then - function widget:DrawScreen() - if defenseRangeShader.DrawPrintf then defenseRangeShader.DrawPrintf() end - end + function widget:DrawScreen() + if defenseRangeShader.DrawPrintf then + defenseRangeShader.DrawPrintf() + end + end end - --- SHIT THAT NEEDS TO BE IN CONFIG: -- ALLY/ENEMY @@ -1122,7 +1109,6 @@ end -- internalrings -- nostencil mode - --SAVE / LOAD CONFIG FILE function widget:GetConfigData() local data = {} @@ -1148,5 +1134,3 @@ function widget:SetConfigData(data) end end end - - diff --git a/luaui/Widgets/gui_easyFacing.lua b/luaui/Widgets/gui_easyFacing.lua index c9d90339f15..97e1339f899 100644 --- a/luaui/Widgets/gui_easyFacing.lua +++ b/luaui/Widgets/gui_easyFacing.lua @@ -5,26 +5,25 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Easy Facing", - desc = "[v" .. string.format("%s", versionNumber ) .. "] Enables changing building facing by holding left mouse button. Hold the right mouse button to change facing while queueing.", - author = "very_bad_soldier", - date = "2009.08.10", - license = "GNU GPL v2", - layer = 0, - enabled = true + name = "Easy Facing", + desc = "[v" .. string.format("%s", versionNumber) .. "] Enables changing building facing by holding left mouse button. Hold the right mouse button to change facing while queueing.", + author = "very_bad_soldier", + date = "2009.08.10", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -- 1.1 Tweaks by Pako, big thx! -- CONFIGURATION -local updateInt = 1 -- seconds for the ::update loop -local sens = 40 -- rotate mouse sensitivity - length of mouse movement vector -local drawForAll = false -- draw facing direction also for other buildings than labs +local updateInt = 1 -- seconds for the ::update loop +local sens = 40 -- rotate mouse sensitivity - length of mouse movement vector +local drawForAll = false -- draw facing direction also for other buildings than labs -------------------------------------------------------------------------------- @@ -49,38 +48,37 @@ for udefID, def in ipairs(UnitDefs) do unitZsize[udefID] = def.zsize end -local spGetModKeyState = Spring.GetModKeyState -local spGetGameSeconds = Spring.GetGameSeconds -local spGetActiveCommand = Spring.GetActiveCommand -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local spGetCameraVectors = Spring.GetCameraVectors -local spWarpMouse = Spring.WarpMouse -local spGetBuildFacing = Spring.GetBuildFacing -local spSetBuildFacing = Spring.SetBuildFacing -local spPos2BuildPos = Spring.Pos2BuildPos - -local floor = math.floor -local atan2 = math.atan2 -local pi = math.pi -local sqrt = math.sqrt - -local glColor = gl.Color -local glLineWidth = gl.LineWidth -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glTranslate = gl.Translate -local glVertex = gl.Vertex -local glRotate = gl.Rotate -local glBeginEnd = gl.BeginEnd -local glScale = gl.Scale -local GL_TRIANGLES = GL.TRIANGLES - +local spGetModKeyState = Spring.GetModKeyState +local spGetGameSeconds = Spring.GetGameSeconds +local spGetActiveCommand = Spring.GetActiveCommand +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local spGetCameraVectors = Spring.GetCameraVectors +local spWarpMouse = Spring.WarpMouse +local spGetBuildFacing = Spring.GetBuildFacing +local spSetBuildFacing = Spring.SetBuildFacing +local spPos2BuildPos = Spring.Pos2BuildPos + +local floor = math.floor +local atan2 = math.atan2 +local pi = math.pi +local sqrt = math.sqrt + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glVertex = gl.Vertex +local glRotate = gl.Rotate +local glBeginEnd = gl.BeginEnd +local glScale = gl.Scale +local GL_TRIANGLES = GL.TRIANGLES local function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end ---map of reason to unitDefID @@ -93,13 +91,13 @@ local function getForceShowUnitDefID() return reason and forceShow[reason] or nil end -local function getVector2dLen( vector ) - return sqrt( ( vector[1] * vector[1] ) + ( vector[2] * vector[2] ) ) +local function getVector2dLen(vector) + return sqrt((vector[1] * vector[1]) + (vector[2] * vector[2])) end -local function normalizeVector2d( vector ) - local len = getVector2dLen( vector ) - local normVec = {0.0, 0.0} +local function normalizeVector2d(vector) + local len = getVector2dLen(vector) + local normVec = { 0.0, 0.0 } normVec[1] = vector[1] / len normVec[2] = vector[2] / len return normVec @@ -108,7 +106,7 @@ end -- I currently get all degrees in a range from 0 to 270 and 0 to -90 -- this is a hack to correct this -- also corrects values > 360 -local function normalizeDegreeRange( degree ) +local function normalizeDegreeRange(degree) if degree < 0 then degree = 360.0 + degree elseif degree > 360 then @@ -117,40 +115,40 @@ local function normalizeDegreeRange( degree ) return degree end -local function getRotationVectors2d( vectorA, vectorB ) - vectorA = normalizeVector2d( vectorA ) - vectorB = normalizeVector2d( vectorB ) - local radian = atan2( vectorA[2], vectorA[1] ) - atan2( vectorB[2], vectorB[1] ) - local val = ( 360 * radian) / ( 2 * pi ) +local function getRotationVectors2d(vectorA, vectorB) + vectorA = normalizeVector2d(vectorA) + vectorB = normalizeVector2d(vectorB) + local radian = atan2(vectorA[2], vectorA[1]) - atan2(vectorB[2], vectorB[1]) + local val = (360 * radian) / (2 * pi) return normalizeDegreeRange(val) end -- returns the rotation degrees between mouse move vector and defined forward vector -local function getMouseFacingDegree( mouseVec ) +local function getMouseFacingDegree(mouseVec) local forwVec = { 0.0, 1.0 } - return getRotationVectors2d( forwVec, mouseVec ) + return getRotationVectors2d(forwVec, mouseVec) end -local function getFacingByMouseDelta( mouseDeltaX,mouseDeltaY ) - local camVecs = spGetCameraVectors() -- would be cool to update this only on a callin like "onCameraMoved()" +local function getFacingByMouseDelta(mouseDeltaX, mouseDeltaY) + local camVecs = spGetCameraVectors() -- would be cool to update this only on a callin like "onCameraMoved()" local mouseMovVec = { mouseDeltaX, mouseDeltaY } - local mMovVecLen = getVector2dLen( mouseMovVec ) + local mMovVecLen = getVector2dLen(mouseMovVec) if mMovVecLen < sens then return nil end - local mouseDegree = getMouseFacingDegree( mouseMovVec ) + local mouseDegree = getMouseFacingDegree(mouseMovVec) -- calculate the camera angle local camRight2d = { camVecs.right[1], -camVecs.right[3] } - local camDegree = getMouseFacingDegree( camRight2d ) - 90 - camDegree = normalizeDegreeRange( camDegree ) + local camDegree = getMouseFacingDegree(camRight2d) - 90 + camDegree = normalizeDegreeRange(camDegree) -- take the camera angle into account here mouseDegree = mouseDegree + camDegree - mouseDegree = normalizeDegreeRange( mouseDegree ) + mouseDegree = normalizeDegreeRange(mouseDegree) local newFacing = nil if mouseDegree >= 280.0 or mouseDegree < 45.0 then @@ -173,14 +171,16 @@ local function manipulateFacing() -- check if valid command local _, cmd_id, cmd_type = spGetActiveCommand() - if not cmd_id then return end + if not cmd_id then + return + end -- check if build command if cmd_type ~= 20 then - return -- quit here if not a build command + return -- quit here if not a build command end - local mx,my,lmb,mmb,rmb = spGetMouseState() + local mx, my, lmb, mmb, rmb = spGetMouseState() if lmb and rmb then if not inDrag then mouseDeltaX = 0 @@ -201,7 +201,7 @@ local function manipulateFacing() local curDeltaY = my - mouseYStartRotate mouseDeltaY = mouseDeltaY + curDeltaY - local newFacing = getFacingByMouseDelta( mouseDeltaX, mouseDeltaY ) + local newFacing = getFacingByMouseDelta(mouseDeltaX, mouseDeltaY) if newFacing ~= nil then mouseDeltaX = 0 mouseDeltaY = 0 @@ -211,8 +211,8 @@ local function manipulateFacing() end end - if mouseXStartRotate~=mx or mouseYStartRotate~=my then - spWarpMouse( mouseXStartRotate, mouseYStartRotate ) -- set old mouse coords to prevent mouse movement + if mouseXStartRotate ~= mx or mouseYStartRotate ~= my then + spWarpMouse(mouseXStartRotate, mouseYStartRotate) -- set old mouse coords to prevent mouse movement end end ineffect = true @@ -220,11 +220,13 @@ end local function drawOrientation() local forceShowUnitDefID = getForceShowUnitDefID() - if not ineffect and not forceShowUnitDefID then return end + if not ineffect and not forceShowUnitDefID then + return + end local _, cmd_id, cmd_type = spGetActiveCommand() if cmd_type ~= 20 and not forceShowUnitDefID then - return -- quit here if not a build command + return -- quit here if not a build command end local unitDefID = forceShowUnitDefID or -cmd_id @@ -233,18 +235,20 @@ local function drawOrientation() end local mx, my = spGetMouseState() - local _,_,_,shift = spGetModKeyState() + local _, _, _, shift = spGetModKeyState() if shift and inDrag then mx = mouseXStartDrag my = mouseYStartDrag end local _, coords = spTraceScreenRay(mx, my, true, true) - if not coords then return end + if not coords then + return + end local facing = spGetBuildFacing() - local centerX, centerY, centerZ = spPos2BuildPos( unitDefID, coords[1], coords[2], coords[3], facing ) - local transSpace = unitZsize[unitDefID] * 4 --should be ysize but its not there?!? + local centerX, centerY, centerZ = spPos2BuildPos(unitDefID, coords[1], coords[2], coords[3], facing) + local transSpace = unitZsize[unitDefID] * 4 --should be ysize but its not there?!? local transX, transZ if facing == 0 then transX = 0 @@ -273,7 +277,7 @@ local function drawOrientation() gl.DepthTest(false) glTranslate(centerX + transX, centerY, centerZ + transZ) glRotate((3 + facing) * 90, 0, 1, 0) - glScale((transSpace or 70)/70, 1.0, (transSpace or 70)/70) + glScale((transSpace or 70) / 70, 1.0, (transSpace or 70) / 70) glBeginEnd(GL_TRIANGLES, drawFunc) glScale(1.0, 1.0, 1.0) gl.DepthTest(true) @@ -282,21 +286,21 @@ local function drawOrientation() end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end - WG['easyfacing'] = {} - WG['easyfacing'].setForceShow = function(reason, enabled, unitDefID) + WG["easyfacing"] = {} + WG["easyfacing"].setForceShow = function(reason, enabled, unitDefID) if enabled then forceShow[reason] = unitDefID else @@ -306,7 +310,7 @@ function widget:Initialize() end function widget:Shutdown() - WG['easyfacing'] = nil + WG["easyfacing"] = nil end function widget:Update() diff --git a/luaui/Widgets/gui_ecostats.lua b/luaui/Widgets/gui_ecostats.lua index 5c19189dd87..d2b1739c42e 100644 --- a/luaui/Widgets/gui_ecostats.lua +++ b/luaui/Widgets/gui_ecostats.lua @@ -1,4 +1,3 @@ - --if #Spring.GetAllyTeamList()-1 > 16 then -- return --end @@ -13,7 +12,7 @@ function widget:GetInfo() date = "nov, 2015", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end @@ -107,8 +106,8 @@ local inSpecMode = false -- Consolidated scratch/cache table to stay under 200-local limit local eco = { - ecoKey = {}, -- ecoKey[allyID] = 'ecostats_' .. allyID - ecoTeamKey = {}, -- ecoTeamKey[tID] = 'ecostats_team_' .. tID + ecoKey = {}, -- ecoKey[allyID] = 'ecostats_' .. allyID + ecoTeamKey = {}, -- ecoTeamKey[tID] = 'ecostats_team_' .. tID isTeamRealCache = {}, isTeamRealDirty = true, gameSeconds = 0, @@ -159,7 +158,7 @@ for i = 0, allyTeamListLen - 1 do end local playerScale = mathClamp(14 / maxTeamsize, 0.15, 1) -local widgetScale = 0.95 + (vsx * vsy / 7500000) -- only used for rounded corners atm +local widgetScale = 0.95 + (vsx * vsy / 7500000) -- only used for rounded corners atm local sizeMultiplier = 1 local borderPadding = 4.5 local avgFrames = 8 @@ -168,7 +167,7 @@ local widgetPosX, widgetPosY = xRelPos * vsx, yRelPos * vsy local teamListLen = #spGetTeamList() local allyTeamListLen2 = #spGetAllyTeamList() local singleTeams = (teamListLen - 1 == allyTeamListLen2 - 1) -local enableStartposbuttons = not Spring.Utilities.Gametype.IsFFA() -- spots wont match when ffa +local enableStartposbuttons = not Spring.Utilities.Gametype.IsFFA() -- spots wont match when ffa local myFullview = select(2, spGetSpectatingState()) local myTeamID = spGetMyTeamID() local myPlayerID = spGetMyPlayerID() @@ -236,7 +235,9 @@ local function isTeamRealUncached(allyID) end local function refreshIsTeamRealCache() - if not eco.isTeamRealDirty then return end + if not eco.isTeamRealDirty then + return + end eco.isTeamRealDirty = false for _, data in ipairs(allyData) do local aID = data.aID @@ -248,7 +249,9 @@ end local function isTeamReal(allyID) local cached = eco.isTeamRealCache[allyID] - if cached ~= nil then return cached end + if cached ~= nil then + return cached + end local result = isTeamRealUncached(allyID) eco.isTeamRealCache[allyID] = result return result @@ -259,7 +262,7 @@ local function isTeamAlive(allyID) local teamsLen = #teams for i = 1, teamsLen do local tID = teams[i] - if teamData[tID] and (not teamData[tID].isDead) then + if teamData[tID] and not teamData[tID].isDead then return true end end @@ -269,7 +272,7 @@ end local function getNbTeams() local nbTeams = 0 for _, data in ipairs(allyData) do - if #(data.teams) > 0 then + if #data.teams > 0 then nbTeams = nbTeams + 1 end end @@ -356,8 +359,8 @@ local function updateButtons() widgetPosY = vsy - widgetHeight end - if cfgSticktotopbar and WG['topbar'] ~= nil then - local topbarArea = WG['topbar'].GetPosition() + if cfgSticktotopbar and WG["topbar"] ~= nil then + local topbarArea = WG["topbar"].GetPosition() if not topbarShowButtons then topbarArea[2] = topbarArea[4] end @@ -375,7 +378,7 @@ local function updateButtons() end local function setDefaults() - widgetWidth = 125 -- just the bars area + widgetWidth = 125 -- just the bars area right = true tH = 32 widgetPosX, widgetPosY = xRelPos * vsx, yRelPos * vsy @@ -386,7 +389,7 @@ local function setDefaults() textsize = 14 end -local updateTctGeometry -- forward declaration +local updateTctGeometry -- forward declaration local function processScaling() setDefaults() @@ -539,10 +542,10 @@ local function setAllyData(allyID) if not allyData[index].isAlive and cfgRemoveDead then allyData[index] = nil - local key = eco.ecoKey[allyID] or ('ecostats_' .. allyID) + local key = eco.ecoKey[allyID] or ("ecostats_" .. allyID) guishaderRects[key] = nil - if WG['guishader'] and guishaderRectsDlists[key] then - WG['guishader'].DeleteDlist(key) + if WG["guishader"] and guishaderRectsDlists[key] then + WG["guishader"].DeleteDlist(key) guishaderRectsDlists[key] = nil end end @@ -612,10 +615,10 @@ local function Init() for _, data in ipairs(allyData) do local aID = data.aID if aID then - eco.ecoKey[aID] = 'ecostats_' .. aID + eco.ecoKey[aID] = "ecostats_" .. aID end for _, tID in pairs(data.teams) do - eco.ecoTeamKey[tID] = 'ecostats_team_' .. tID + eco.ecoTeamKey[tID] = "ecostats_team_" .. tID end end eco.isTeamRealDirty = true @@ -652,23 +655,23 @@ function widget:Initialize() gamestarted = true end - WG['ecostats'] = {} - WG['ecostats'].getShowText = function() + WG["ecostats"] = {} + WG["ecostats"].getShowText = function() return cfgResText end - WG['ecostats'].setShowText = function(value) + WG["ecostats"].setShowText = function(value) cfgResText = value end - WG['ecostats'].getReclaim = function() + WG["ecostats"].getReclaim = function() return cfgTrackReclaim end - WG['ecostats'].setReclaim = function(value) + WG["ecostats"].setReclaim = function(value) cfgTrackReclaim = value end - WG['ecostats'].isvisible = function() + WG["ecostats"].isvisible = function() return myFullview and inSpecMode end - WG['ecostats'].getWidgetPosY = function() + WG["ecostats"].getWidgetPosY = function() return widgetPosY end @@ -678,30 +681,30 @@ end local function removeGuiShaderRects() local currentMyAllyID = spGetMyAllyTeamID() - if WG['guishader'] then + if WG["guishader"] then for _, data in pairs(allyData) do local aID = data.aID if isTeamReal(aID) and (aID == currentMyAllyID or inSpecMode) and aID ~= gaiaAllyID then - local key = eco.ecoKey[aID] or ('ecostats_' .. aID) - WG['guishader'].DeleteDlist(key) + local key = eco.ecoKey[aID] or ("ecostats_" .. aID) + WG["guishader"].DeleteDlist(key) guishaderRectsDlists[key] = nil guishaderRects[key] = nil end end end - if WG['tooltip'] ~= nil then + if WG["tooltip"] ~= nil then for _, data in pairs(allyData) do local aID = data.aID if isTeamReal(aID) and (aID == currentMyAllyID or inSpecMode) and (aID ~= gaiaAllyID) then - local key = eco.ecoKey[aID] or ('ecostats_' .. aID) + local key = eco.ecoKey[aID] or ("ecostats_" .. aID) if tooltipAreas[key] ~= nil then - WG['tooltip'].RemoveTooltip(key) + WG["tooltip"].RemoveTooltip(key) tooltipAreas[key] = nil local teams = Spring.GetTeamList(aID) for _, tID in ipairs(teams) do - local teamKey = eco.ecoTeamKey[tID] or ('ecostats_team_' .. tID) - WG['tooltip'].RemoveTooltip(teamKey) + local teamKey = eco.ecoTeamKey[tID] or ("ecostats_team_" .. tID) + WG["tooltip"].RemoveTooltip(teamKey) teamTooltipAreas[teamKey] = nil end end @@ -720,7 +723,7 @@ function widget:Shutdown() glDeleteTexture(uiTex) uiTex = nil end - WG['ecostats'] = nil + WG["ecostats"] = nil end local areaRect = {} @@ -731,7 +734,7 @@ local function makeTeamCompositionList() return end if uiElementRectsCount == 0 then - DrawTeamComposition() -- need to run once so uiElementRects gets filled + DrawTeamComposition() -- need to run once so uiElementRects gets filled end areaRect[1], areaRect[2], areaRect[3], areaRect[4] = nil, nil, nil, nil for i = 1, uiElementRectsCount do @@ -759,8 +762,8 @@ local function makeTeamCompositionList() end prevAreaRect[1], prevAreaRect[2], prevAreaRect[3], prevAreaRect[4] = areaRect[1], areaRect[2], areaRect[3], areaRect[4] - local texWidth = areaRect[1] and areaRect[3] and mathFloor(areaRect[3]-areaRect[1]) or 0 - local texHeight = areaRect[2] and areaRect[4] and mathFloor(areaRect[4]-areaRect[2]) or 0 + local texWidth = areaRect[1] and areaRect[3] and mathFloor(areaRect[3] - areaRect[1]) or 0 + local texHeight = areaRect[2] and areaRect[4] and mathFloor(areaRect[4] - areaRect[2]) or 0 if (not uiBgTex or rectAreaChange) and texWidth > 0 and texHeight > 0 then if uiBgTex then gl.DeleteTexture(uiBgTex) @@ -783,11 +786,11 @@ local function makeTeamCompositionList() gl.R2tHelper.RenderInRect(uiBgTex, areaRect[1], areaRect[2], areaRect[3], areaRect[4], function() for i = 1, uiElementRectsCount do local rect = uiElementRects[i] - UiElement(rect[1], rect[2], rect[3], rect[4], (widgetPosY+widgetHeight > rect[4]+1 and 1 or 0), 0, 0, 1, 0, 1, 1, 1, nil, nil, nil, nil) + UiElement(rect[1], rect[2], rect[3], rect[4], (widgetPosY + widgetHeight > rect[4] + 1 and 1 or 0), 0, 0, 1, 0, 1, 1, 1, nil, nil, nil, nil) end end, true) end - if WG['guishader'] then + if WG["guishader"] then for id, rect in pairs(guishaderRects) do if guishaderRectsDlists[id] then gl.DeleteList(guishaderRectsDlists[id]) @@ -796,7 +799,7 @@ local function makeTeamCompositionList() guishaderRectsDlists[id] = gl.CreateList(function() RectRound(r1, r2, r3, r4, r5, 1, 0, 0, 1) end) - WG['guishader'].InsertDlist(guishaderRectsDlists[id], id) + WG["guishader"].InsertDlist(guishaderRectsDlists[id], id) end end end @@ -881,11 +884,11 @@ end function widget:TextCommand(command) if stringSub(command, 1, 13) == "ecostatstext" then cfgResText = not cfgResText - spEcho('ecostats: text: '..(cfgResText and 'enabled' or 'disabled')) + spEcho("ecostats: text: " .. (cfgResText and "enabled" or "disabled")) end if stringSub(command, 1, 16) == "ecostatsreclaim" then cfgTrackReclaim = not cfgTrackReclaim - spEcho('ecostats: reclaim: '..(cfgTrackReclaim and 'enabled' or 'disabled')) + spEcho("ecostats: reclaim: " .. (cfgTrackReclaim and "enabled" or "disabled")) end end @@ -893,7 +896,7 @@ local function DrawEText(numberE, vOffset) local label = stringFormatSI(numberE) font:Begin(true) font:SetTextColor(1, 1, 0, 1) - font:Print(label or "", widgetPosX + widgetWidth - (5 * sizeMultiplier), widgetPosY + widgetHeight - vOffset + (tH * 0.22), tH / 2.3, 'rs') + font:Print(label or "", widgetPosX + widgetWidth - (5 * sizeMultiplier), widgetPosY + widgetHeight - vOffset + (tH * 0.22), tH / 2.3, "rs") font:End() end @@ -901,7 +904,7 @@ local function DrawMText(numberM, vOffset) local label = stringFormatSI(numberM) font:Begin(true) font:SetTextColor(1, 1, 1, 1) - font:Print(label or "", widgetPosX + widgetWidth - (5 * sizeMultiplier), widgetPosY + widgetHeight - vOffset + (borderPadding * 0.5) + (tH * 0.58), tH / 2.3, 'rs') + font:Print(label or "", widgetPosX + widgetWidth - (5 * sizeMultiplier), widgetPosY + widgetHeight - vOffset + (borderPadding * 0.5) + (tH * 0.58), tH / 2.3, "rs") font:End() end @@ -1012,7 +1015,7 @@ local function DrawMBar(tM, tMp, vOffset) end local cachedTooltipText, cachedTooltipTitle -local bgArea = {0, 0, 0, 0} +local bgArea = { 0, 0, 0, 0 } local function DrawBackground(posY, allyID, teamWidth) local y1 = mathCeil((widgetPosY - posY) + widgetHeight) local y2 = mathCeil((widgetPosY - posY) + tH + widgetHeight) @@ -1022,7 +1025,7 @@ local function DrawBackground(posY, allyID, teamWidth) uiElementRectsCount = uiElementRectsCount + 1 local rect = uiElementRects[uiElementRectsCount] if rect == nil then - rect = {0, 0, 0, 0, 0} + rect = { 0, 0, 0, 0, 0 } uiElementRects[uiElementRectsCount] = rect end rect[1], rect[2], rect[3], rect[4], rect[5] = x1, y1, x2, y2, allyID @@ -1030,27 +1033,27 @@ local function DrawBackground(posY, allyID, teamWidth) local key = eco.ecoKey[allyID] local gsRect = guishaderRects[key] if gsRect == nil then - gsRect = {0, 0, 0, 0, 0} + gsRect = { 0, 0, 0, 0, 0 } guishaderRects[key] = gsRect end gsRect[1], gsRect[2], gsRect[3], gsRect[4], gsRect[5] = x1, y1, x2, y2, 4 * widgetScale local areaX1 = widgetPosX + (widgetWidth / 12) local areaKey = areaX1 * 1000000000 + y1 * 1000000 + x2 * 1000 + y2 - if WG['tooltip'] ~= nil and (tooltipAreas[key] == nil or tooltipAreas[key] ~= areaKey or refreshCaptions) then + if WG["tooltip"] ~= nil and (tooltipAreas[key] == nil or tooltipAreas[key] ~= areaKey or refreshCaptions) then refreshCaptions = false if not cachedTooltipText then - cachedTooltipText = Spring.I18N('ui.teamEconomy.tooltip') - cachedTooltipTitle = Spring.I18N('ui.teamEconomy.tooltipTitle') + cachedTooltipText = Spring.I18N("ui.teamEconomy.tooltip") + cachedTooltipTitle = Spring.I18N("ui.teamEconomy.tooltipTitle") end bgArea[1], bgArea[2], bgArea[3], bgArea[4] = areaX1, y1, x2, y2 - WG['tooltip'].AddTooltip(key, bgArea, cachedTooltipText, nil, cachedTooltipTitle) + WG["tooltip"].AddTooltip(key, bgArea, cachedTooltipText, nil, cachedTooltipTitle) tooltipAreas[key] = areaKey end end -local boxColorBot = {0, 0, 0, 1} -local boxColorTop = {0, 0, 0, 1} +local boxColorBot = { 0, 0, 0, 1 } +local boxColorTop = { 0, 0, 0, 1 } local function DrawBox(hOffset, vOffset, r, g, b) local w = tH * 0.36 * playerScale local h = tH * 0.36 @@ -1058,14 +1061,7 @@ local function DrawBox(hOffset, vOffset, r, g, b) local dy = tH - (tH * 0.5) boxColorBot[1], boxColorBot[2], boxColorBot[3] = r * 0.75, g * 0.75, b * 0.75 boxColorTop[1], boxColorTop[2], boxColorTop[3] = r, g, b - RectRound( - widgetPosX + hOffset + dx - w, - widgetPosY + widgetHeight - vOffset + dy, - widgetPosX + hOffset + dx, - widgetPosY + widgetHeight - vOffset + dy + h, - h * 0.055, - 1, 1, 1, 1, boxColorBot, boxColorTop - ) + RectRound(widgetPosX + hOffset + dx - w, widgetPosY + widgetHeight - vOffset + dy, widgetPosX + hOffset + dx, widgetPosY + widgetHeight - vOffset + dy + h, h * 0.055, 1, 1, 1, 1, boxColorBot, boxColorTop) glColor(1, 1, 1, 1) end @@ -1085,9 +1081,9 @@ updateTctGeometry = function() eco.tctBorderOffset = floor(borderPadding * 0.5) end -local tctArea = {0, 0, 0, 0} -local tctColorBot = {0, 0, 0, 1} -local tctColorTop = {0, 0, 0, 1} +local tctArea = { 0, 0, 0, 0 } +local tctColorBot = { 0, 0, 0, 1 } +local tctColorTop = { 0, 0, 0, 1 } local function DrawTeamCompositionTeam(hOffset, vOffset, r, g, b, a, small, mouseOn, t, isDead, tID) local geom = small and tctSmall or tctBig local w, h, dx, dy = geom.w, geom.h, geom.dx, geom.dy @@ -1120,23 +1116,19 @@ local function DrawTeamCompositionTeam(hOffset, vOffset, r, g, b, a, small, mous btn.y2 = y2 btn.pID = tID end - if WG['tooltip'] then - local tipKey = eco.ecoTeamKey[tID] or ('ecostats_team_' .. tID) + if WG["tooltip"] then + local tipKey = eco.ecoTeamKey[tID] or ("ecostats_team_" .. tID) local areaKey = x1 * 1000000000 + y1 * 1000000 + x2 * 1000 + y2 if teamTooltipAreas[tipKey] ~= areaKey or refreshCaptions then tctArea[1], tctArea[2], tctArea[3], tctArea[4] = x1, y1, x2, y2 - WG['tooltip'].AddTooltip(tipKey, tctArea, teamData[tID].leaderName) + WG["tooltip"].AddTooltip(tipKey, tctArea, teamData[tID].leaderName) teamTooltipAreas[tipKey] = areaKey end end tctColorBot[1], tctColorBot[2], tctColorBot[3] = r * 0.75, g * 0.75, b * 0.75 tctColorTop[1], tctColorTop[2], tctColorTop[3] = r, g, b - RectRound( - x1, y1 + eco.tctBorderOffset, x2, y2 + eco.tctBorderOffset, - (x2 - x1) * 0.055, - 1, 1, 1, 1, tctColorBot, tctColorTop - ) + RectRound(x1, y1 + eco.tctBorderOffset, x2, y2 + eco.tctBorderOffset, (x2 - x1) * 0.055, 1, 1, 1, 1, tctColorBot, tctColorTop) end function DrawTeamComposition() @@ -1251,11 +1243,11 @@ local function drawListStandard(now) if aID ~= nil then local drawpos = data.drawpos - if data.exists and type(data.tE) == "number" and drawpos and #(data.teams) > 0 and (aID == myAllyID or inSpecMode) and (aID ~= gaiaAllyID) then + if data.exists and type(data.tE) == "number" and drawpos and #data.teams > 0 and (aID == myAllyID or inSpecMode) and (aID ~= gaiaAllyID) then if not data.isAlive then data.isAlive = isTeamAlive(aID) end - local posy = tH * (drawpos) + local posy = tH * drawpos local t = gameSeconds local avg = avgData[aID] if data.isAlive and t > 0 and gamestarted and not gameover and avg then @@ -1314,7 +1306,7 @@ function widget:PlayerChanged(playerID) removeGuiShaderRects() end end - if myFullview and not singleTeams and WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors() then + if myFullview and not singleTeams and WG["playercolorpalette"] ~= nil and WG["playercolorpalette"].getSameTeamColors() then if myTeamID ~= spGetMyTeamID() then UpdateAllTeams() refreshTeamCompositionList = true @@ -1404,7 +1396,6 @@ function widget:MousePress(x, y, button) for teamID, button in pairs(Button) do button.click = false if button.x1 and math_isInRect(x, y, button.x1, button.y1, button.x2, button.y2) then - if ctrlDown and teamData[teamID].hasCom then local com for i = 1, #comDefList do @@ -1458,17 +1449,16 @@ end function widget:ViewResize() vsx, vsy = glGetViewSizes() widgetPosX, widgetPosY = xRelPos * vsx, yRelPos * vsy - widgetScale = (((vsy) / 2000) * 0.5) * (0.95 + (ui_scale - 1) / 1.5) -- only used for rounded corners atm + widgetScale = ((vsy / 2000) * 0.5) * (0.95 + (ui_scale - 1) / 1.5) -- only used for rounded corners atm RectRound = WG.FlowUI.Draw.RectRound UiElement = WG.FlowUI.Draw.Element - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() Reinit() end - local sec = 0 local sec1 = 0 local sec2 = 0 @@ -1483,7 +1473,7 @@ function widget:Update(dt) gamestarted = true end if gf - lastPlayerChange == 40 then - lastPlayerChange = lastPlayerChange - 1 -- prevent repeat execution cause this is in widget:Update + lastPlayerChange = lastPlayerChange - 1 -- prevent repeat execution cause this is in widget:Update -- check for dead teams for teamID in pairs(teamData) do teamData[teamID].isDead = select(3, spGetTeamInfo(teamID, false)) @@ -1528,16 +1518,16 @@ function widget:Update(dt) end local prevTopbarShowButtons = topbarShowButtons - topbarShowButtons = WG['topbar'] and WG['topbar'].getShowButtons() - if topbarShowButtons ~= prevTopbarShowButtons or not prevTopbar and (WG['topbar'] ~= nil) or prevTopbar ~= (WG['topbar'] ~= nil) then + topbarShowButtons = WG["topbar"] and WG["topbar"].getShowButtons() + if topbarShowButtons ~= prevTopbarShowButtons or not prevTopbar and (WG["topbar"] ~= nil) or prevTopbar ~= (WG["topbar"] ~= nil) then Reinit() lastBarsUpdate = 0 lastTextListUpdate = 0 end - prevTopbar = WG['topbar'] ~= nil and true or false + prevTopbar = WG["topbar"] ~= nil and true or false -- detect guishader widget being toggled back on - local guishaderNow = WG['guishader'] ~= nil + local guishaderNow = WG["guishader"] ~= nil if guishaderNow and not guishaderWasActive then guishaderRectsDlists = {} refreshTeamCompositionList = true @@ -1546,15 +1536,17 @@ function widget:Update(dt) end local r2tDrawFunc = function() - if not areaRect[1] then return end + if not areaRect[1] then + return + end gl.Translate(-1, -1, 0) - gl.Scale(2 / (areaRect[3]-areaRect[1]), 2 / (areaRect[4]-areaRect[2]), 0) + gl.Scale(2 / (areaRect[3] - areaRect[1]), 2 / (areaRect[4] - areaRect[2]), 0) gl.Translate(-areaRect[1], -areaRect[2], 0) DrawTeamComposition() drawListStandard(eco.drawNow) end -local r2tScissors = {0, 0, 0, 0} -- reusable +local r2tScissors = { 0, 0, 0, 0 } -- reusable local emptyScissors = {} function widget:DrawScreen() gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) @@ -1575,7 +1567,6 @@ function widget:DrawScreen() makeTeamCompositionList() end - if uiTex then local now = osClock() if now > lastBarsUpdate + 0.15 then @@ -1583,17 +1574,13 @@ function widget:DrawScreen() local scissors if cfgResText and now <= lastTextListUpdate + 0.5 then -- only clean non text area - r2tScissors[3] = areaRect[3]-areaRect[1] - (48 * sizeMultiplier) + r2tScissors[3] = areaRect[3] - areaRect[1] - (48 * sizeMultiplier) r2tScissors[4] = widgetHeight scissors = r2tScissors else scissors = emptyScissors end - gl.R2tHelper.RenderToTexture(uiTex, - r2tDrawFunc, - true, - scissors - ) + gl.R2tHelper.RenderToTexture(uiTex, r2tDrawFunc, true, scissors) end end @@ -1606,7 +1593,7 @@ function widget:DrawScreen() local mx, my = spGetMouseState() if math_isInRect(mx, my, widgetPosX, widgetPosY, widgetPosX + widgetWidth, widgetPosY + widgetHeight) then - spSetMouseCursor('cursornormal') + spSetMouseCursor("cursornormal") end end diff --git a/luaui/Widgets/gui_emp_decloak_range.lua b/luaui/Widgets/gui_emp_decloak_range.lua index cc6ec6c7df8..e0fa14683de 100644 --- a/luaui/Widgets/gui_emp_decloak_range.lua +++ b/luaui/Widgets/gui_emp_decloak_range.lua @@ -6,19 +6,18 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "EMP + decloak range", - desc = "When spy/gremlin is selected, displays EMP range always and decloak range only while cloaked; main-pass opacity pulses per prop", - author = "[teh]decay, updated by ChatGPT", - date = "16 May 2025", - license = "The BSD License", - layer = 0, - version = 8, - enabled = true, - } + return { + name = "EMP + decloak range", + desc = "When spy/gremlin is selected, displays EMP range always and decloak range only while cloaked; main-pass opacity pulses per prop", + author = "[teh]decay, updated by ChatGPT", + date = "16 May 2025", + license = "The BSD License", + layer = 0, + version = 8, + enabled = true, + } end - -- Localized functions for performance local mathMax = math.max local mathMin = math.min @@ -32,55 +31,55 @@ local spGetSpectatingState = Spring.GetSpectatingState -- OPTIONS -------------------------------------------------------------------------------- local onlyDrawRangeWhenSelected = true -local fadeOnCameraDistance = true -local showLineGlow = true -local opacityMultiplier = 1.0 -local fadeMultiplier = 1.2 -- lower value: fades out sooner -local circleDivs = 64 -- detail of range circle +local fadeOnCameraDistance = true +local showLineGlow = true +local opacityMultiplier = 1.0 +local fadeMultiplier = 1.2 -- lower value: fades out sooner +local circleDivs = 64 -- detail of range circle -- pulse speeds (radians per second) for main-pass opacity -local pulseSpeedDecloak = mathPi * 0.75 -- one cycle every 2s for decloak -local pulseSpeedEMP = mathPi * 1.5 -- one cycle every 4s for EMP +local pulseSpeedDecloak = mathPi * 0.75 -- one cycle every 2s for decloak +local pulseSpeedEMP = mathPi * 1.5 -- one cycle every 4s for EMP -- opacity bounds for main-pass local decloakAlphaMin = 0.25 local decloakAlphaMax = 0.85 -local empAlphaMin = 0.15 -local empAlphaMax = 0.6 +local empAlphaMin = 0.15 +local empAlphaMax = 0.6 -------------------------------------------------------------------------------- -- GLSL & Spring API LOCALS -------------------------------------------------------------------------------- -local glColor = gl.Color -local glLineWidth = gl.LineWidth -local glDepthTest = gl.DepthTest -local glDrawGroundCircle = gl.DrawGroundCircle +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glDepthTest = gl.DepthTest +local glDrawGroundCircle = gl.DrawGroundCircle -local spGetAllUnits = Spring.GetAllUnits +local spGetAllUnits = Spring.GetAllUnits local spGetTeamUnitsByDefs = Spring.GetTeamUnitsByDefs -local spGetTeamList = Spring.GetTeamList -local spGetCameraPosition = Spring.GetCameraPosition -local spGetUnitPosition = Spring.GetUnitPosition -local spIsSphereInView = Spring.IsSphereInView -local spIsUnitSelected = Spring.IsUnitSelected -local spValidUnitID = Spring.ValidUnitID -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitIsCloaked = Spring.GetUnitIsCloaked -local spGetGameSeconds = Spring.GetGameSeconds +local spGetTeamList = Spring.GetTeamList +local spGetCameraPosition = Spring.GetCameraPosition +local spGetUnitPosition = Spring.GetUnitPosition +local spIsSphereInView = Spring.IsSphereInView +local spIsUnitSelected = Spring.IsUnitSelected +local spValidUnitID = Spring.ValidUnitID +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitIsCloaked = Spring.GetUnitIsCloaked +local spGetGameSeconds = Spring.GetGameSeconds -------------------------------------------------------------------------------- -- COMMAND CONSTANTS -------------------------------------------------------------------------------- -local CMD_MOVE_STATE = CMD.MOVE_STATE -local CMD_FIRE_STATE = CMD.FIRE_STATE +local CMD_MOVE_STATE = CMD.MOVE_STATE +local CMD_FIRE_STATE = CMD.FIRE_STATE -------------------------------------------------------------------------------- -- GAME STATE -------------------------------------------------------------------------------- -local spec, fullview = spGetSpectatingState() +local spec, fullview = spGetSpectatingState() local chobbyInterface -local units = {} -- [unitID] = { decloakDist, empRadius } +local units = {} -- [unitID] = { decloakDist, empRadius } -------------------------------------------------------------------------------- -- DETECT SPY / GREMLIN UNITS AND THEIR RADII @@ -88,189 +87,189 @@ local units = {} -- [unitID] = { decloakDist, empRadius } local lower = string.lower local isSpy, isGremlin = {}, {} for udid, ud in pairs(UnitDefs) do - local name = ud.name:lower() - local decloakDist = ud.mincloakdistance or ud.decloakDistance or 0 - if name:find("spy") or name:find("armamex") then - -- spy's EMP radius from its self-destruct weapon - local wdefName = lower(ud.selfDExplosion) - local wdef = WeaponDefNames[wdefName] - if wdef then - isSpy[udid] = { decloakDist, WeaponDefs[wdef.id].damageAreaOfEffect } - else - isSpy[udid] = { decloakDist, 0 } - end - end - if name:find("armgremlin") or name:find("armamb") or name:find("armpb") or name:find("armferret") - or name:find("armckfus") or name:find("armsnipe") or name:find("armshockwave") - or name:find("eyes") or name:find("mine") - or name:find("armcom") or name:find("corcom") or name:find("legcom") then - isGremlin[udid] = decloakDist - end + local name = ud.name:lower() + local decloakDist = ud.mincloakdistance or ud.decloakDistance or 0 + if name:find("spy") or name:find("armamex") then + -- spy's EMP radius from its self-destruct weapon + local wdefName = lower(ud.selfDExplosion) + local wdef = WeaponDefNames[wdefName] + if wdef then + isSpy[udid] = { decloakDist, WeaponDefs[wdef.id].damageAreaOfEffect } + else + isSpy[udid] = { decloakDist, 0 } + end + end + if name:find("armgremlin") or name:find("armamb") or name:find("armpb") or name:find("armferret") or name:find("armckfus") or name:find("armsnipe") or name:find("armshockwave") or name:find("eyes") or name:find("mine") or name:find("armcom") or name:find("corcom") or name:find("legcom") then + isGremlin[udid] = decloakDist + end end -- Build a combined DefID list for GetTeamUnitsByDefs local spyGremlinDefIDList = {} local spyGremlinDefIDSet = {} for udid, _ in pairs(isSpy) do - if not spyGremlinDefIDSet[udid] then - spyGremlinDefIDList[#spyGremlinDefIDList + 1] = udid - spyGremlinDefIDSet[udid] = true - end + if not spyGremlinDefIDSet[udid] then + spyGremlinDefIDList[#spyGremlinDefIDList + 1] = udid + spyGremlinDefIDSet[udid] = true + end end for udid, _ in pairs(isGremlin) do - if not spyGremlinDefIDSet[udid] then - spyGremlinDefIDList[#spyGremlinDefIDList + 1] = udid - spyGremlinDefIDSet[udid] = true - end + if not spyGremlinDefIDSet[udid] then + spyGremlinDefIDList[#spyGremlinDefIDList + 1] = udid + spyGremlinDefIDSet[udid] = true + end end local function addSpy(unitID, unitDefID) - local props = isSpy[unitDefID] - units[unitID] = { props[1], props[2] } + local props = isSpy[unitDefID] + units[unitID] = { props[1], props[2] } end local function addGremlin(unitID, unitDefID) - units[unitID] = { isGremlin[unitDefID], 0 } + units[unitID] = { isGremlin[unitDefID], 0 } end -------------------------------------------------------------------------------- -- UNIT TRACKING CALLBACKS -------------------------------------------------------------------------------- function widget:Initialize() - units = {} - if #spyGremlinDefIDList == 0 then return end - for _, teamID in ipairs(spGetTeamList()) do - local teamUnits = spGetTeamUnitsByDefs(teamID, spyGremlinDefIDList) - if teamUnits then - for i = 1, #teamUnits do - local unitID = teamUnits[i] - local udid = spGetUnitDefID(unitID) - if isSpy[udid] then - addSpy(unitID, udid) - elseif isGremlin[udid] then - addGremlin(unitID, udid) - end - end - end - end + units = {} + if #spyGremlinDefIDList == 0 then + return + end + for _, teamID in ipairs(spGetTeamList()) do + local teamUnits = spGetTeamUnitsByDefs(teamID, spyGremlinDefIDList) + if teamUnits then + for i = 1, #teamUnits do + local unitID = teamUnits[i] + local udid = spGetUnitDefID(unitID) + if isSpy[udid] then + addSpy(unitID, udid) + elseif isGremlin[udid] then + addGremlin(unitID, udid) + end + end + end + end end function widget:UnitCreated(unitID, unitDefID, teamID, builderID) - if not spValidUnitID(unitID) then return end - if isSpy[unitDefID] then - addSpy(unitID, unitDefID) - elseif isGremlin[unitDefID] then - addGremlin(unitID, unitDefID) - end + if not spValidUnitID(unitID) then + return + end + if isSpy[unitDefID] then + addSpy(unitID, unitDefID) + elseif isGremlin[unitDefID] then + addGremlin(unitID, unitDefID) + end end function widget:UnitFinished(unitID, unitDefID, teamID) - if isSpy[unitDefID] then - addSpy(unitID, unitDefID) - elseif isGremlin[unitDefID] then - addGremlin(unitID, unitDefID) - end + if isSpy[unitDefID] then + addSpy(unitID, unitDefID) + elseif isGremlin[unitDefID] then + addGremlin(unitID, unitDefID) + end end function widget:UnitDestroyed(unitID) - units[unitID] = nil + units[unitID] = nil end function widget:UnitEnteredLos(unitID, unitTeam) - if not fullview then - local udid = spGetUnitDefID(unitID) - if isSpy[udid] then - addSpy(unitID, udid) - elseif isGremlin[udid] then - addGremlin(unitID, udid) - end - end + if not fullview then + local udid = spGetUnitDefID(unitID) + if isSpy[udid] then + addSpy(unitID, udid) + elseif isGremlin[udid] then + addGremlin(unitID, udid) + end + end end function widget:UnitLeftLos(unitID) - if not fullview then - units[unitID] = nil - end + if not fullview then + units[unitID] = nil + end end function widget:RecvLuaMsg(msg) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') - end + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") + end end function widget:PlayerChanged(playerID) - local prevTeam, prevFull = Spring.GetMyTeamID(), fullview - spec, fullview = spGetSpectatingState() - if fullview ~= prevFull then - widget:Initialize() - end + local prevTeam, prevFull = Spring.GetMyTeamID(), fullview + spec, fullview = spGetSpectatingState() + if fullview ~= prevFull then + widget:Initialize() + end end -------------------------------------------------------------------------------- -- DRAWING -------------------------------------------------------------------------------- function widget:DrawWorldPreUnit() - if chobbyInterface or Spring.IsGUIHidden() then return end - - local camX, camY, camZ = spGetCameraPosition() - glDepthTest(true) - - -- current time for pulses - local t = spGetGameSeconds() - local pulseD = (mathSin(t * pulseSpeedDecloak) + 1) * 0.5 - local pulseE = (mathSin(t * pulseSpeedEMP) + 1) * 0.5 - - for unitID, prop in pairs(units) do - local dx, dy, dz = spGetUnitPosition(unitID) - local maxRad = mathMax(prop[1], prop[2]) - if ((not onlyDrawRangeWhenSelected) or spIsUnitSelected(unitID)) - and spIsSphereInView(dx, dy, dz, maxRad) then - - local distToCam = ((camX-dx)^2 + (camY-dy)^2 + (camZ-dz)^2)^0.5 - local alphaScale = fadeOnCameraDistance and mathMin(1, (1100/distToCam)*fadeMultiplier) or 1 - if alphaScale > 0.15 then - - local cloaked = spGetUnitIsCloaked(unitID) == true - - -- -- glow pass unchanged - -- if showLineGlow then - -- glLineWidth(12) - -- if prop[1] > 0 and cloaked then - -- glColor(0.6, 0.6, 1.0, 0.06 * alphaScale * opacityMultiplier) - -- glDrawGroundCircle(dx, dy, dz, prop[1], circleDivs) - -- end - -- if prop[2] > 0 then - -- local r = 0.3 * pulseD + 0.7 * (1-pulseD) - -- local g = 0.3 * pulseD + 0.7 * (1-pulseD) - -- local b = 1.0 - -- glColor(r, g, b, 0.15 * alphaScale * opacityMultiplier) - -- glDrawGroundCircle(dx, dy, dz, prop[2], circleDivs) - -- end - -- end - - -- main pass with opacity pulses - local lw = mathMax(1.5, 2.5 - mathMin(2, distToCam/2000)) - glLineWidth(lw) - if prop[1] > 0 and cloaked then - local r = 0.09 * pulseE + 0.8 * (1-pulseE) - local g = 0.09 * pulseE + 0.8 * (1-pulseE) - local b = 0.09 * pulseE + 0.8 * (1-pulseE) - local alpha = decloakAlphaMin * (1-pulseD) + decloakAlphaMax * pulseD - glColor(r, g, b, alpha * alphaScale * opacityMultiplier) - glDrawGroundCircle(dx, dy, dz, prop[1], circleDivs) - end - if prop[2] > 0 then - local r = 0.7 * pulseE + 0.6 * (1-pulseE) - local g = 0.7 * pulseE + 0.6 * (1-pulseE) - local b = 1.0 - local alpha = empAlphaMin * (1-pulseE) + empAlphaMax * pulseE - glColor(r, g, b, alpha * alphaScale * opacityMultiplier) - glDrawGroundCircle(dx, dy, dz, prop[2], circleDivs) - end - end - end - end - - glDepthTest(false) + if chobbyInterface or Spring.IsGUIHidden() then + return + end + + local camX, camY, camZ = spGetCameraPosition() + glDepthTest(true) + + -- current time for pulses + local t = spGetGameSeconds() + local pulseD = (mathSin(t * pulseSpeedDecloak) + 1) * 0.5 + local pulseE = (mathSin(t * pulseSpeedEMP) + 1) * 0.5 + + for unitID, prop in pairs(units) do + local dx, dy, dz = spGetUnitPosition(unitID) + local maxRad = mathMax(prop[1], prop[2]) + if ((not onlyDrawRangeWhenSelected) or spIsUnitSelected(unitID)) and spIsSphereInView(dx, dy, dz, maxRad) then + local distToCam = ((camX - dx) ^ 2 + (camY - dy) ^ 2 + (camZ - dz) ^ 2) ^ 0.5 + local alphaScale = fadeOnCameraDistance and mathMin(1, (1100 / distToCam) * fadeMultiplier) or 1 + if alphaScale > 0.15 then + local cloaked = spGetUnitIsCloaked(unitID) == true + + -- -- glow pass unchanged + -- if showLineGlow then + -- glLineWidth(12) + -- if prop[1] > 0 and cloaked then + -- glColor(0.6, 0.6, 1.0, 0.06 * alphaScale * opacityMultiplier) + -- glDrawGroundCircle(dx, dy, dz, prop[1], circleDivs) + -- end + -- if prop[2] > 0 then + -- local r = 0.3 * pulseD + 0.7 * (1-pulseD) + -- local g = 0.3 * pulseD + 0.7 * (1-pulseD) + -- local b = 1.0 + -- glColor(r, g, b, 0.15 * alphaScale * opacityMultiplier) + -- glDrawGroundCircle(dx, dy, dz, prop[2], circleDivs) + -- end + -- end + + -- main pass with opacity pulses + local lw = mathMax(1.5, 2.5 - mathMin(2, distToCam / 2000)) + glLineWidth(lw) + if prop[1] > 0 and cloaked then + local r = 0.09 * pulseE + 0.8 * (1 - pulseE) + local g = 0.09 * pulseE + 0.8 * (1 - pulseE) + local b = 0.09 * pulseE + 0.8 * (1 - pulseE) + local alpha = decloakAlphaMin * (1 - pulseD) + decloakAlphaMax * pulseD + glColor(r, g, b, alpha * alphaScale * opacityMultiplier) + glDrawGroundCircle(dx, dy, dz, prop[1], circleDivs) + end + if prop[2] > 0 then + local r = 0.7 * pulseE + 0.6 * (1 - pulseE) + local g = 0.7 * pulseE + 0.6 * (1 - pulseE) + local b = 1.0 + local alpha = empAlphaMin * (1 - pulseE) + empAlphaMax * pulseE + glColor(r, g, b, alpha * alphaScale * opacityMultiplier) + glDrawGroundCircle(dx, dy, dz, prop[2], circleDivs) + end + end + end + end + + glDepthTest(false) end diff --git a/luaui/Widgets/gui_enemy_spotter.lua b/luaui/Widgets/gui_enemy_spotter.lua index 64cd1e79fac..863d34e7beb 100644 --- a/luaui/Widgets/gui_enemy_spotter.lua +++ b/luaui/Widgets/gui_enemy_spotter.lua @@ -22,7 +22,7 @@ local sizeMultiplier = 1.25 local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local enemyspotterVBO = nil @@ -30,9 +30,9 @@ local enemyspotterShader = nil local luaShaderDir = "LuaUI/Include/" -- Localize for speedups: -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local GL_POINTS = GL.POINTS +local glDepthTest = gl.DepthTest +local glTexture = gl.Texture +local GL_POINTS = GL.POINTS local spGetUnitAllyTeam = Spring.GetUnitAllyTeam @@ -42,10 +42,10 @@ local gaiaTeamID = Spring.GetGaiaTeamID() local unitScale = {} local unitDecoration = {} for unitDefID, unitDef in pairs(UnitDefs) do - unitScale[unitDefID] = ((7.5 * ( unitDef.xsize*unitDef.xsize + unitDef.zsize*unitDef.zsize ) ^ 0.5) + 8) * sizeMultiplier + unitScale[unitDefID] = ((7.5 * (unitDef.xsize * unitDef.xsize + unitDef.zsize * unitDef.zsize) ^ 0.5) + 8) * sizeMultiplier if unitDef.canFly then unitScale[unitDefID] = unitScale[unitDefID] * 0.9 - elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0 then + elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0 then unitScale[unitDefID] = unitScale[unitDefID] * 0.9 end if unitDef.customParams.decoration then @@ -58,9 +58,9 @@ local allyTeamLeader = {} local teams = Spring.GetTeamList() for i = 1, #teams do local teamID = teams[i] - local allyTeamID = select(6, Spring.GetTeamInfo(teamID, false)) + local allyTeamID = select(6, Spring.GetTeamInfo(teamID, false)) if not allyTeamLeader[allyTeamID] then - allyTeamLeader[allyTeamID] = teamID -- assign which team color to use for whole allyteam + allyTeamLeader[allyTeamID] = teamID -- assign which team color to use for whole allyteam end teamLeader[teamID] = allyTeamLeader[allyTeamID] end @@ -72,12 +72,24 @@ local function AddPrimitiveAtUnit(unitID, unitDefID, unitTeam, noUpload) pushElementInstance( enemyspotterVBO, -- push into this Instance VBO Table { - radius, radius, 0, 0, -- lengthwidthcornerheight + radius, + radius, + 0, + 0, -- lengthwidthcornerheight teamLeader[unitTeam], -- teamID 2, -- how many triangles should we make - 0, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + 0, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -115,7 +127,7 @@ end local function AddUnit(unitID, unitDefID, unitTeamID, noUpload) if (not skipOwnTeam or spGetUnitAllyTeam(unitID) ~= myAllyTeamID) and unitTeamID ~= gaiaTeamID and not unitDecoration[unitDefID] then - AddPrimitiveAtUnit(unitID,unitDefID, unitTeamID, noUpload) + AddPrimitiveAtUnit(unitID, unitDefID, unitTeamID, noUpload) end end @@ -140,7 +152,7 @@ function widget:CrashingAircraft(unitID, unitDefID, teamID) end local function init() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE! shaderConfig.TRANSPARENCY = opacity @@ -152,8 +164,8 @@ local function init() return false end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) else Spring.Echo("Enemy spotter needs unittrackerapi to work!") widgetHandler:RemoveWidget() @@ -165,7 +177,7 @@ end function widget:PlayerChanged(playerID) myAllyTeamID = Spring.GetMyAllyTeamID() - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end function widget:Initialize() @@ -173,26 +185,28 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not init() then return end - WG['enemyspotter'] = {} - WG['enemyspotter'].getOpacity = function() + if not init() then + return + end + WG["enemyspotter"] = {} + WG["enemyspotter"].getOpacity = function() return opacity end - WG['enemyspotter'].setOpacity = function(value) + WG["enemyspotter"].setOpacity = function(value) opacity = value init() end - WG['enemyspotter'].getSkipOwnTeam = function() + WG["enemyspotter"].getSkipOwnTeam = function() return skipOwnTeam end - WG['enemyspotter'].setSkipOwnTeam = function(value) + WG["enemyspotter"].setSkipOwnTeam = function(value) skipOwnTeam = value init() end end function widget:Shutdown() - WG['enemyspotter'] = nil + WG["enemyspotter"] = nil end function widget:GetConfigData(data) diff --git a/luaui/Widgets/gui_factionpicker.lua b/luaui/Widgets/gui_factionpicker.lua index 36524bdf866..7bff8809771 100644 --- a/luaui/Widgets/gui_factionpicker.lua +++ b/luaui/Widgets/gui_factionpicker.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "May 2020", license = "GNU GPL, v2 or later", layer = -1, - enabled = true + enabled = true, } end @@ -21,7 +21,6 @@ local spGetSpectatingState = Spring.GetSpectatingState local factions = {} - local doUpdate local playSounds = true local posY = 0.75 @@ -34,7 +33,7 @@ local bgBorder = bgBorderOrg local myTeamID = Spring.GetMyTeamID() local stickToBottom = true -local startDefID = Spring.GetTeamRulesParam(myTeamID, 'startUnit') +local startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") do local validStartUnits = string.split(Spring.GetTeamRulesParam(myTeamID, "validStartUnits") or Spring.GetGameRulesParam("validStartUnits"), "|") for i, unitID_string in ipairs(validStartUnits) do @@ -42,7 +41,8 @@ do local unitID = tonumber(unitID_string) factions[i] = { startUnit = unitID, - faction = string.sub(UnitDefs[unitID].name, 1, 3) } + faction = string.sub(UnitDefs[unitID].name, 1, 3), + } if factions[i].faction == "dum" then factions[i].faction = "random" end @@ -69,7 +69,7 @@ end local vsx, vsy = spGetViewGeometry() -local sound_button = 'LuaUI/Sounds/buildbar_waypoint.wav' +local sound_button = "LuaUI/Sounds/buildbar_waypoint.wav" local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) @@ -99,7 +99,7 @@ local function drawFactionpicker() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.66) - font2:Print(Spring.I18N('ui.factionPicker.pick'), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.7), fontSize, "o") + font2:Print(Spring.I18N("ui.factionPicker.pick"), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.7), fontSize, "o") local contentWidth = mathFloor(backgroundRect[3] - backgroundRect[1] - contentPadding) local contentHeight = mathFloor(backgroundRect[4] - backgroundRect[2] - (contentPadding * 1.33)) @@ -113,38 +113,32 @@ local function drawFactionpicker() mathFloor(backgroundRect[3] - padding - (cellSize * i)), mathFloor(backgroundRect[2]), mathFloor(backgroundRect[3] - padding - (cellSize * (i - 1))), - mathFloor(backgroundRect[2] + cellSize) + mathFloor(backgroundRect[2] + cellSize), } - local disabled = Spring.GetTeamRulesParam(myTeamID, 'startUnit') ~= factions[i].startUnit + local disabled = Spring.GetTeamRulesParam(myTeamID, "startUnit") ~= factions[i].startUnit if disabled then glColor(0.55, 0.55, 0.55, 1) else glColor(1, 1, 1, 1) end - UiUnit(factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4], - nil, - 1, 1, 1, 1, - 0, - nil, disabled and 0.033 or nil, - '#' .. factions[i].startUnit - ) + UiUnit(factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4], nil, 1, 1, 1, 1, 0, nil, disabled and 0.033 or nil, "#" .. factions[i].startUnit) -- faction name - font2:Print((disabled and "\255\170\170\170" or "\255\255\255\255") .. Spring.I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") + font2:Print((disabled and "\255\170\170\170" or "\255\255\255\255") .. Spring.I18N("units.factions." .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") - if WG['tooltip'] ~= nil then - local text = Spring.I18N('ui.factionPicker.factions.'..factions[i].faction) - local tooltip = '' - local maxWidth = WG['tooltip'].getFontsize() * 80 + if WG["tooltip"] ~= nil then + local text = Spring.I18N("ui.factionPicker.factions." .. factions[i].faction) + local tooltip = "" + local maxWidth = WG["tooltip"].getFontsize() * 80 local textLines, numLines = font2:WrapText(text, maxWidth) - tooltip = tooltip..string.gsub(textLines, '[\n]', '\n')..'\n' - WG['tooltip'].AddTooltip('factionpicker_'..i, { factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4] }, tooltip, nil, Spring.I18N('units.factions.' .. factions[i].faction)) + tooltip = tooltip .. string.gsub(textLines, "[\n]", "\n") .. "\n" + WG["tooltip"].AddTooltip("factionpicker_" .. i, { factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4] }, tooltip, nil, Spring.I18N("units.factions." .. factions[i].faction)) end end font2:End() end local function checkGuishader(force) - dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, 'factionpicker', function() + dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, "factionpicker", function() RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], (bgBorder * vsy) * 2) end, force) end @@ -159,7 +153,7 @@ function widget:ViewResize() width = 0.2125 height = 0.14 * ui_scale - width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens + width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens width = width * ui_scale -- make pixel aligned @@ -167,12 +161,12 @@ function widget:ViewResize() height = mathFloor(height * vsy) / vsy local buildmenuBottomPos - if WG['buildmenu'] then - buildmenuBottomPos = WG['buildmenu'].getBottomPosition() + if WG["buildmenu"] then + buildmenuBottomPos = WG["buildmenu"].getBottomPosition() end - local outlineMult = math.clamp(1/(vsy/1400), 1, 1.5) - font2 = WG['fonts'].getFont(2) + local outlineMult = math.clamp(1 / (vsy / 1400), 1, 1.5) + font2 = WG["fonts"].getFont(2) local widgetSpaceMargin = WG.FlowUI.elementMargin bgpadding = WG.FlowUI.elementPadding @@ -181,8 +175,8 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element UiUnit = WG.FlowUI.Draw.Unit - if WG['minimap'] then - minimapHeight = WG['minimap'].getHeight() + if WG["minimap"] then + minimapHeight = WG["minimap"].getHeight() end if stickToBottom then @@ -192,11 +186,11 @@ function widget:ViewResize() if buildmenuBottomPos then posX = 0 posY = height + height + (widgetSpaceMargin / vsy) - elseif WG['buildmenu'] then - local posY2, _ = WG['buildmenu'].getSize() + elseif WG["buildmenu"] then + local posY2, _ = WG["buildmenu"].getSize() posY2 = posY2 + (widgetSpaceMargin / vsy) posY = posY2 + height - if WG['minimap'] then + if WG["minimap"] then posY = 1 - (minimapHeight / vsy) - (widgetSpaceMargin / vsy) end posX = 0 @@ -236,15 +230,15 @@ function widget:Initialize() end end - if WG['ordermenu'] then - stickToBottom = WG['ordermenu'].getBottomPosition() + if WG["ordermenu"] then + stickToBottom = WG["ordermenu"].getBottomPosition() end widget:ViewResize() end function widget:Shutdown() - WG.FlowUI.guishaderDeleteDlist('factionpicker') + WG.FlowUI.guishaderDeleteDlist("factionpicker") dlistGuishader = nil dlistFactionpicker = gl.DeleteList(dlistFactionpicker) @@ -257,9 +251,9 @@ function widget:Shutdown() factionpickerTex = nil end - if WG['tooltip'] ~= nil then + if WG["tooltip"] ~= nil then for i, faction in pairs(factions) do - WG['tooltip'].RemoveTooltip('factionpicker_'..i) + WG["tooltip"].RemoveTooltip("factionpicker_" .. i) end end end @@ -275,13 +269,13 @@ function widget:Update(dt) sec = 0 checkGuishader() - if WG['minimap'] and minimapHeight ~= WG['minimap'].getHeight() then + if WG["minimap"] and minimapHeight ~= WG["minimap"].getHeight() then widget:ViewResize() doUpdate = true end - if WG['ordermenu'] and stickToBottom ~= WG['ordermenu'].getBottomPosition() then - stickToBottom = WG['ordermenu'].getBottomPosition() + if WG["ordermenu"] and stickToBottom ~= WG["ordermenu"].getBottomPosition() then + stickToBottom = WG["ordermenu"].getBottomPosition() widget:ViewResize() doUpdate = true end @@ -290,23 +284,23 @@ end function widget:DrawScreen() local x, y, b = Spring.GetMouseState() - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") end end - if startDefID ~= Spring.GetTeamRulesParam(myTeamID, 'startUnit') then - startDefID = Spring.GetTeamRulesParam(myTeamID, 'startUnit') + if startDefID ~= Spring.GetTeamRulesParam(myTeamID, "startUnit") then + startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") doUpdate = true end - if dlistGuishader and WG['guishader'] then - WG['guishader'].InsertDlist(dlistGuishader, 'factionpicker') + if dlistGuishader and WG["guishader"] then + WG["guishader"].InsertDlist(dlistGuishader, "factionpicker") end if not factionpickerBgTex then - factionpickerBgTex = gl.CreateTexture(mathFloor(width*vsx), mathFloor(height*vsy), { + factionpickerBgTex = gl.CreateTexture(mathFloor(width * vsx), mathFloor(height * vsy), { target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -317,7 +311,7 @@ function widget:DrawScreen() end if not factionpickerTex then - factionpickerTex = gl.CreateTexture(mathFloor(width*vsx)*(vsy<1400 and 2 or 1), mathFloor(height*vsy)*(vsy<1400 and 2 or 1), { + factionpickerTex = gl.CreateTexture(mathFloor(width * vsx) * (vsy < 1400 and 2 or 1), mathFloor(height * vsy) * (vsy < 1400 and 2 or 1), { target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -350,29 +344,26 @@ function widget:DrawScreen() RectRound(factionRect[i][1] + bgpadding, factionRect[i][2] + bgpadding, factionRect[i][3], factionRect[i][4], bgpadding, 1, 1, 1, 1, { 0.3, 0.3, 0.3, (b and 0.5 or 0.25) }, { 1, 1, 1, (b and 0.3 or 0.15) }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - font2:Print(Spring.I18N('units.factions.' .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") + font2:Print(Spring.I18N("units.factions." .. factions[i].faction), factionRect[i][1] + ((factionRect[i][3] - factionRect[i][1]) * 0.5), factionRect[i][2] + ((factionRect[i][4] - factionRect[i][2]) * 0.22) - (fontSize * 0.5), fontSize * 0.96, "co") break end end end font2:End() - end function widget:MousePress(x, y, button) if math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - for i, faction in pairs(factions) do if math_isInRect(x, y, factionRect[i][1], factionRect[i][2], factionRect[i][3], factionRect[i][4]) then if playSounds then - Spring.PlaySoundFile(sound_button, 0.6, 'ui') + Spring.PlaySoundFile(sound_button, 0.6, "ui") end -- tell initial spawn - Spring.SendLuaRulesMsg('changeStartUnit' .. tostring(factions[i].startUnit)) + Spring.SendLuaRulesMsg("changeStartUnit" .. tostring(factions[i].startUnit)) break end end return true end end - diff --git a/luaui/Widgets/gui_flanking_icons.lua b/luaui/Widgets/gui_flanking_icons.lua index 474ec5c9ce6..bf59594fec8 100644 --- a/luaui/Widgets/gui_flanking_icons.lua +++ b/luaui/Widgets/gui_flanking_icons.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState @@ -24,13 +23,13 @@ local fadespeed = 0.005 local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local flankingVBO = nil local flankingShader = nil local luaShaderDir = "LuaUI/Include/" -local glTexture = gl.Texture +local glTexture = gl.Texture local udefHasFlankingIcon = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -46,34 +45,52 @@ local spGetUnitFlanking = Spring.GetUnitFlanking local spGetGameFrame = Spring.GetGameFrame local spIsUnitAllied = Spring.IsUnitAllied -local instanceCache = {0,0,0,2,-- length,width,cornersize (0), extraheight - 0,4, -- teamID, vertices - 0,0,0,0, -- the gameFrame (for fading), the direction to rotate the circle, 0,0 - 0,1,0,1, -- These are our default UV atlas tranformations - 0,0,0,0} -- these are just padding zeros, that will get filled in +local instanceCache = { + 0, + 0, + 0, + 2, -- length,width,cornersize (0), extraheight + 0, + 4, -- teamID, vertices + 0, + 0, + 0, + 0, -- the gameFrame (for fading), the direction to rotate the circle, 0,0 + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, +} -- these are just padding zeros, that will get filled in local function AddPrimitiveAtUnit(unitID, gameframe, noupload) -- since the icon fades, gameframe specifies last update --if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true then return end gameframe = gameframe or spGetGameFrame() local radius = spGetUnitRadius(unitID) * 3 or 64 - local mode, modilityAdd, minDamage, maxDamage , dirX , dirY , dirZ, bonusnumber = spGetUnitFlanking(unitID) + local mode, modilityAdd, minDamage, maxDamage, dirX, dirY, dirZ, bonusnumber = spGetUnitFlanking(unitID) local flankingangle = 0 - if dirX then flankingangle = math.atan2(dirX, -1.0* dirZ) end + if dirX then + flankingangle = math.atan2(dirX, -1.0 * dirZ) + end --Spring.Echo(math.deg(flankingangle), "Flank angle = ", unitID, flankingangle, dirX, dirZ) instanceCache[1] = radius instanceCache[2] = radius - instanceCache[7] = gameframe + instanceCache[7] = gameframe instanceCache[8] = flankingangle pushElementInstance( flankingVBO, -- push into this Instance VBO Table - instanceCache, -- used the cached instance + instanceCache, -- used the cached instance unitID, -- this is the key inside the VBO TAble, should be unique per unit true, -- update existing element noupload, -- noupload, dont use unless you know what you are doing - unitID) -- last one should be UNITID! + unitID + ) -- last one should be UNITID! end function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) @@ -91,19 +108,21 @@ function widget:DrawWorldPreUnit() local disticon = 27 * Spring.GetConfigInt("UnitIconDist", 200) -- iconLength = unitIconDist * unitIconDist * 750.0f; glTexture(0, texture) flankingShader:Activate() - flankingShader:SetUniform("iconDistance",disticon) - flankingShader:SetUniform("addRadius",0) - flankingVBO.VAO:DrawArrays(GL.POINTS,flankingVBO.usedElements) + flankingShader:SetUniform("iconDistance", disticon) + flankingShader:SetUniform("addRadius", 0) + flankingVBO.VAO:DrawArrays(GL.POINTS, flankingVBO.usedElements) flankingShader:Deactivate() glTexture(0, false) end end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, noupload) - if not spec and fullview then - if not spIsUnitAllied(unitID) then return end + if not spec and fullview then + if not spIsUnitAllied(unitID) then + return + end end - if udefHasFlankingIcon[unitDefID] then + if udefHasFlankingIcon[unitDefID] then AddPrimitiveAtUnit(unitID, -300, noupload) end end @@ -116,8 +135,8 @@ end local function init() InstanceVBOTable.clearInstanceTable(flankingVBO) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID), true) end @@ -126,13 +145,13 @@ local function init() end function widget:Initialize() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 0 shaderConfig.HEIGHTOFFSET = 1 shaderConfig.TRANSPARENCY = 1.0 -- transparency of the stuff drawn - shaderConfig.POST_ANIM = "v_color = vec4(vec3(1.0), 1.0 - (timeInfo.x - parameters.x)*".. tostring(fadespeed).."); v_rotationY = parameters.y;" -- fading with time, and rotation passthrough + shaderConfig.POST_ANIM = "v_color = vec4(vec3(1.0), 1.0 - (timeInfo.x - parameters.x)*" .. tostring(fadespeed) .. "); v_rotationY = parameters.y;" -- fading with time, and rotation passthrough shaderConfig.POST_SHADING = "fragColor.a = fragColor.a * g_color.a;" -- alpha blend shaderConfig.ANIMATION = nil shaderConfig.USE_CIRCLES = nil diff --git a/luaui/Widgets/gui_flowui.lua b/luaui/Widgets/gui_flowui.lua index 0a803bbff90..733d3acf13a 100644 --- a/luaui/Widgets/gui_flowui.lua +++ b/luaui/Widgets/gui_flowui.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "FlowUI", - desc = "GUI Framework", - author = "Floris", - date = "January 2021", - license = "GNU GPL, v2 or later", - layer = 1000000, - enabled = true + name = "FlowUI", + desc = "GUI Framework", + author = "Floris", + date = "January 2021", + license = "GNU GPL, v2 or later", + layer = 1000000, + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -35,13 +34,13 @@ WG.FlowUI.tileSize = WG.FlowUI.tileScale -- Guishader display list lifecycle helpers WG.FlowUI.guishaderCheckDlist = function(currentDlist, name, drawFn, force) - if WG['guishader'] then + if WG["guishader"] then if force and currentDlist then currentDlist = gl.DeleteList(currentDlist) end if not currentDlist then currentDlist = gl.CreateList(drawFn) - WG['guishader'].InsertDlist(currentDlist, name) + WG["guishader"].InsertDlist(currentDlist, name) end return currentDlist elseif currentDlist then @@ -51,8 +50,8 @@ WG.FlowUI.guishaderCheckDlist = function(currentDlist, name, drawFn, force) end WG.FlowUI.guishaderRemoveDlist = function(currentDlist, name) - if WG['guishader'] then - WG['guishader'].RemoveDlist(name) + if WG["guishader"] then + WG["guishader"].RemoveDlist(name) end if currentDlist then gl.DeleteList(currentDlist) @@ -61,8 +60,8 @@ WG.FlowUI.guishaderRemoveDlist = function(currentDlist, name) end WG.FlowUI.guishaderDeleteDlist = function(name) - if WG['guishader'] then - WG['guishader'].DeleteDlist(name) + if WG["guishader"] then + WG["guishader"].DeleteDlist(name) end end @@ -139,7 +138,7 @@ WG.FlowUI.Draw = {} tl, tr, br, bl = enable/disable corners for TopLeft, TopRight, BottomRight, BottomLeft (default: 1) c1, c2 = top color, bottom color ]] -WG.FlowUI.Draw.RectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, c1, c2) +WG.FlowUI.Draw.RectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, c1, c2) -- RectRound(px,py,sx,sy,cs, tl,tr,br,bl, c1,c2): Draw a rectangular shape with cut off edges -- optional: tl,tr,br,bl 0 = no corner (1 = always) -- optional: c1,c2 for top-down color gradients @@ -156,14 +155,14 @@ WG.FlowUI.Draw.RectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, c1, c1[1] * (1 - csyMult) + (c2[1] * csyMult), c1[2] * (1 - csyMult) + (c2[2] * csyMult), c1[3] * (1 - csyMult) + (c2[3] * csyMult), - c1[4] * (1 - csyMult) + (c2[4] * csyMult) + c1[4] * (1 - csyMult) + (c2[4] * csyMult), } -- Top edge color (blend from c2 towards c1) midColor = { c2[1] * (1 - csyMult) + (c1[1] * csyMult), c2[2] * (1 - csyMult) + (c1[2] * csyMult), c2[3] * (1 - csyMult) + (c1[3] * csyMult), - c2[4] * (1 - csyMult) + (c1[4] * csyMult) + c2[4] * (1 - csyMult) + (c1[4] * csyMult), } end @@ -284,15 +283,19 @@ end positive x = shift right, positive y = shift up example: skew = {tlx = -20} makes top-left 20 px wider to the left ]] -WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c1, c2, skew) +WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c1, c2, skew) local function DrawRectRoundQuad(px, py, sx, sy, cs, tl, tr, br, bl, c1, c2, skew) cs = mathMax(cs, 1) -- Per-corner offsets from base rectangle corners (default 0) - local tlx = skew.tlx or 0; local tly = skew.tly or 0 - local trx = skew.trx or 0; local try = skew.try or 0 - local brx = skew.brx or 0; local bry = skew.bry or 0 - local blx = skew.blx or 0; local bly = skew.bly or 0 + local tlx = skew.tlx or 0 + local tly = skew.tly or 0 + local trx = skew.trx or 0 + local try = skew.try or 0 + local brx = skew.brx or 0 + local bry = skew.bry or 0 + local blx = skew.blx or 0 + local bly = skew.bly or 0 -- Actual 4 corner positions local BLx, BLy = px + blx, py + bly @@ -302,46 +305,53 @@ WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c -- Normalize 2D vector local function n2(x, y) - local len = math.sqrt(x*x + y*y) - if len < 0.001 then return 0, 1 end - return x/len, y/len + local len = math.sqrt(x * x + y * y) + if len < 0.001 then + return 0, 1 + end + return x / len, y / len end -- Edge unit directions, CCW: BL -> BR -> TR -> TL -> BL - local bdx, bdy = n2(BRx-BLx, BRy-BLy) -- bottom (BL->BR) - local rdx, rdy = n2(TRx-BRx, TRy-BRy) -- right (BR->TR) - local tdx, tdy = n2(TLx-TRx, TLy-TRy) -- top (TR->TL) - local ldx, ldy = n2(BLx-TLx, BLy-TLy) -- left (TL->BL) + local bdx, bdy = n2(BRx - BLx, BRy - BLy) -- bottom (BL->BR) + local rdx, rdy = n2(TRx - BRx, TRy - BRy) -- right (BR->TR) + local tdx, tdy = n2(TLx - TRx, TLy - TRy) -- top (TR->TL) + local ldx, ldy = n2(BLx - TLx, BLy - TLy) -- left (TL->BL) -- 8 chamfer cut points at distance cs from each corner along both adjacent edges -- BL: along bottom edge and towards TL (= -(TL->BL) direction) - local blb_x, blb_y = BLx + cs*bdx, BLy + cs*bdy - local bll_x, bll_y = BLx - cs*ldx, BLy - cs*ldy + local blb_x, blb_y = BLx + cs * bdx, BLy + cs * bdy + local bll_x, bll_y = BLx - cs * ldx, BLy - cs * ldy -- BR: back along bottom and along right edge - local brb_x, brb_y = BRx - cs*bdx, BRy - cs*bdy - local brr_x, brr_y = BRx + cs*rdx, BRy + cs*rdy + local brb_x, brb_y = BRx - cs * bdx, BRy - cs * bdy + local brr_x, brr_y = BRx + cs * rdx, BRy + cs * rdy -- TR: back along right and along top edge - local trr_x, trr_y = TRx - cs*rdx, TRy - cs*rdy - local trt_x, trt_y = TRx + cs*tdx, TRy + cs*tdy + local trr_x, trr_y = TRx - cs * rdx, TRy - cs * rdy + local trt_x, trt_y = TRx + cs * tdx, TRy + cs * tdy -- TL: back along top and towards BL along left edge - local tlt_x, tlt_y = TLx - cs*tdx, TLy - cs*tdy - local tll_x, tll_y = TLx + cs*ldx, TLy + cs*ldy + local tlt_x, tlt_y = TLx - cs * tdx, TLy - cs * tdy + local tll_x, tll_y = TLx + cs * ldx, TLy + cs * ldy -- 4 inner corners: cs inward from each actual corner along both adjacent edges - local iblx = BLx + cs*(bdx - ldx); local ibly = BLy + cs*(bdy - ldy) - local ibrx = BRx + cs*(-bdx + rdx); local ibry = BRy + cs*(-bdy + rdy) - local itrx = TRx + cs*(-rdx + tdx); local itry = TRy + cs*(-rdy + tdy) - local itlx = TLx + cs*(-tdx + ldx); local itly = TLy + cs*(-tdy + ldy) + local iblx = BLx + cs * (bdx - ldx) + local ibly = BLy + cs * (bdy - ldy) + local ibrx = BRx + cs * (-bdx + rdx) + local ibry = BRy + cs * (-bdy + rdy) + local itrx = TRx + cs * (-rdx + tdx) + local itry = TRy + cs * (-rdy + tdy) + local itlx = TLx + cs * (-tdx + ldx) + local itly = TLy + cs * (-tdy + ldy) -- Per-vertex color: linear gradient from c1 (bottom) to c2 (top) local hasGradient = c1 ~= nil and c2 ~= nil local spanY = mathMax(TLy - BLy, 1) local function setColorY(y) - if not c1 then return end + if not c1 then + return + end if hasGradient then local t = mathMax(0, mathMin(1, (y - BLy) / spanY)) - gl.Color(c1[1]+(c2[1]-c1[1])*t, c1[2]+(c2[2]-c1[2])*t, - c1[3]+(c2[3]-c1[3])*t, c1[4]+(c2[4]-c1[4])*t) + gl.Color(c1[1] + (c2[1] - c1[1]) * t, c1[2] + (c2[2] - c1[2]) * t, c1[3] + (c2[3] - c1[3]) * t, c1[4] + (c2[4] - c1[4]) * t) else gl.Color(c1[1], c1[2], c1[3], c1[4]) end @@ -349,34 +359,54 @@ WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c -- 9-quad tessellation covering the full shape without gaps or overlaps -- 1. Center (inner quadrilateral) - setColorY(ibly); gl.Vertex(iblx, ibly, 0) - setColorY(ibry); gl.Vertex(ibrx, ibry, 0) - setColorY(itry); gl.Vertex(itrx, itry, 0) - setColorY(itly); gl.Vertex(itlx, itly, 0) + setColorY(ibly) + gl.Vertex(iblx, ibly, 0) + setColorY(ibry) + gl.Vertex(ibrx, ibry, 0) + setColorY(itry) + gl.Vertex(itrx, itry, 0) + setColorY(itly) + gl.Vertex(itlx, itly, 0) -- 2. Bottom strip - setColorY(blb_y); gl.Vertex(blb_x, blb_y, 0) - setColorY(brb_y); gl.Vertex(brb_x, brb_y, 0) - setColorY(ibry); gl.Vertex(ibrx, ibry, 0) - setColorY(ibly); gl.Vertex(iblx, ibly, 0) + setColorY(blb_y) + gl.Vertex(blb_x, blb_y, 0) + setColorY(brb_y) + gl.Vertex(brb_x, brb_y, 0) + setColorY(ibry) + gl.Vertex(ibrx, ibry, 0) + setColorY(ibly) + gl.Vertex(iblx, ibly, 0) -- 3. Left strip - setColorY(bll_y); gl.Vertex(bll_x, bll_y, 0) - setColorY(ibly); gl.Vertex(iblx, ibly, 0) - setColorY(itly); gl.Vertex(itlx, itly, 0) - setColorY(tll_y); gl.Vertex(tll_x, tll_y, 0) + setColorY(bll_y) + gl.Vertex(bll_x, bll_y, 0) + setColorY(ibly) + gl.Vertex(iblx, ibly, 0) + setColorY(itly) + gl.Vertex(itlx, itly, 0) + setColorY(tll_y) + gl.Vertex(tll_x, tll_y, 0) -- 4. Right strip - setColorY(ibry); gl.Vertex(ibrx, ibry, 0) - setColorY(brr_y); gl.Vertex(brr_x, brr_y, 0) - setColorY(trr_y); gl.Vertex(trr_x, trr_y, 0) - setColorY(itry); gl.Vertex(itrx, itry, 0) + setColorY(ibry) + gl.Vertex(ibrx, ibry, 0) + setColorY(brr_y) + gl.Vertex(brr_x, brr_y, 0) + setColorY(trr_y) + gl.Vertex(trr_x, trr_y, 0) + setColorY(itry) + gl.Vertex(itrx, itry, 0) -- 5. Top strip - setColorY(itly); gl.Vertex(itlx, itly, 0) - setColorY(itry); gl.Vertex(itrx, itry, 0) - setColorY(trt_y); gl.Vertex(trt_x, trt_y, 0) - setColorY(tlt_y); gl.Vertex(tlt_x, tlt_y, 0) + setColorY(itly) + gl.Vertex(itlx, itly, 0) + setColorY(itry) + gl.Vertex(itrx, itry, 0) + setColorY(trt_y) + gl.Vertex(trt_x, trt_y, 0) + setColorY(tlt_y) + gl.Vertex(tlt_x, tlt_y, 0) -- 6. BL corner (square when bl=0, degenerate triangle when bl=1) setColorY(BLy) @@ -386,24 +416,32 @@ WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c gl.Vertex(blb_x, blb_y, 0) end gl.Vertex(blb_x, blb_y, 0) - setColorY(ibly); gl.Vertex(iblx, ibly, 0) - setColorY(bll_y); gl.Vertex(bll_x, bll_y, 0) + setColorY(ibly) + gl.Vertex(iblx, ibly, 0) + setColorY(bll_y) + gl.Vertex(bll_x, bll_y, 0) -- 7. BR corner - setColorY(brb_y); gl.Vertex(brb_x, brb_y, 0) + setColorY(brb_y) + gl.Vertex(brb_x, brb_y, 0) setColorY(BRy) if br ~= nil and br == 0 then gl.Vertex(BRx, BRy, 0) else gl.Vertex(brb_x, brb_y, 0) end - setColorY(brr_y); gl.Vertex(brr_x, brr_y, 0) - setColorY(ibry); gl.Vertex(ibrx, ibry, 0) + setColorY(brr_y) + gl.Vertex(brr_x, brr_y, 0) + setColorY(ibry) + gl.Vertex(ibrx, ibry, 0) -- 8. TL corner - setColorY(tll_y); gl.Vertex(tll_x, tll_y, 0) - setColorY(itly); gl.Vertex(itlx, itly, 0) - setColorY(tlt_y); gl.Vertex(tlt_x, tlt_y, 0) + setColorY(tll_y) + gl.Vertex(tll_x, tll_y, 0) + setColorY(itly) + gl.Vertex(itlx, itly, 0) + setColorY(tlt_y) + gl.Vertex(tlt_x, tlt_y, 0) setColorY(TLy) if tl ~= nil and tl == 0 then gl.Vertex(TLx, TLy, 0) @@ -412,15 +450,18 @@ WG.FlowUI.Draw.RectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, c end -- 9. TR corner - setColorY(itry); gl.Vertex(itrx, itry, 0) - setColorY(trr_y); gl.Vertex(trr_x, trr_y, 0) + setColorY(itry) + gl.Vertex(itrx, itry, 0) + setColorY(trr_y) + gl.Vertex(trr_x, trr_y, 0) setColorY(TRy) if tr ~= nil and tr == 0 then gl.Vertex(TRx, TRy, 0) else gl.Vertex(trt_x, trt_y, 0) end - setColorY(trt_y); gl.Vertex(trt_x, trt_y, 0) + setColorY(trt_y) + gl.Vertex(trt_x, trt_y, 0) end gl.BeginEnd(GL.QUADS, DrawRectRoundQuad, px, py, sx, sy, cs, tl, tr, br, bl, c1, c2, skew) end @@ -452,7 +493,7 @@ WG.FlowUI.Draw.RectRoundProgress = function(left, bottom, right, top, cs, progre local beta_rad = mathPi / 2 - alpha_rad -- Pre-calculate frequently used values - local topMinusYcen = height - ycen -- (top - ycen) + local topMinusYcen = height - ycen -- (top - ycen) local rightMinusXcen = width - xcen -- (right - xcen) local list = {} @@ -493,7 +534,7 @@ WG.FlowUI.Draw.RectRoundProgress = function(left, bottom, right, top, cs, progre gl.Color(color[1], color[2], color[3], color[4]) gl.Translate(xcen, ycen, 0) - gl.Scale(-1, 1, 1) -- flip direction horizontally + gl.Scale(-1, 1, 1) -- flip direction horizontally gl.Translate(-xcen, -ycen, 0) gl.Shape(GL.TRIANGLE_FAN, list) gl.Color(1, 1, 1, 1) @@ -511,17 +552,21 @@ end offset, offsetY = texture offset coordinates (offsetY=offset when offsetY isnt defined) texture = file location ]] -WG.FlowUI.Draw.TexturedRectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY, texture) +WG.FlowUI.Draw.TexturedRectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY, texture) local function DrawTexturedRectRound(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY) -- Pre-calculate invariant values (avoids redundant per-vertex calculations) local width = sx - px local height = sy - py - if width <= 0 or height <= 0 then return end + if width <= 0 or height <= 0 then + return + end local invWidth = 1 / width local invHeight = 1 / height local scale = size and (size / width) or 1 - if scale == 0 then scale = 0.001 end + if scale == 0 then + scale = 0.001 + end local invScale = 1 / scale local offset = offset or 0 @@ -612,7 +657,7 @@ end texture = file location skew = table with optional tlx, tly, trx, try, brx, bry, blx, bly corner offsets ]] -WG.FlowUI.Draw.TexturedRectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY, texture, skew) +WG.FlowUI.Draw.TexturedRectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY, texture, skew) local function DrawTexturedRectRoundQuad(px, py, sx, sy, cs, tl, tr, br, bl, size, offset, offsetY, skew) cs = mathMax(cs, 1) @@ -622,7 +667,9 @@ WG.FlowUI.Draw.TexturedRectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br local invWidth = 1 / width local invHeight = 1 / height local scale = size and (size / width) or 1 - if scale == 0 then scale = 0.001 end + if scale == 0 then + scale = 0.001 + end local invScale = 1 / scale local offset = offset or 0 local offsetY = offsetY or offset @@ -637,10 +684,14 @@ WG.FlowUI.Draw.TexturedRectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br end -- Per-corner skew offsets - local tlx = skew.tlx or 0; local tly = skew.tly or 0 - local trx = skew.trx or 0; local try = skew.try or 0 - local brx = skew.brx or 0; local bry = skew.bry or 0 - local blx = skew.blx or 0; local bly = skew.bly or 0 + local tlx = skew.tlx or 0 + local tly = skew.tly or 0 + local trx = skew.trx or 0 + local try = skew.try or 0 + local brx = skew.brx or 0 + local bry = skew.bry or 0 + local blx = skew.blx or 0 + local bly = skew.bly or 0 -- Actual 4 corner positions local BLx, BLy = px + blx, py + bly @@ -650,32 +701,38 @@ WG.FlowUI.Draw.TexturedRectRoundQuad = function(px, py, sx, sy, cs, tl, tr, br -- Normalize 2D vector local function n2(x, y) - local len = math.sqrt(x*x + y*y) - if len < 0.001 then return 0, 1 end - return x/len, y/len + local len = math.sqrt(x * x + y * y) + if len < 0.001 then + return 0, 1 + end + return x / len, y / len end -- Edge unit directions CCW: BL->BR->TR->TL->BL - local bdx, bdy = n2(BRx-BLx, BRy-BLy) -- bottom - local rdx, rdy = n2(TRx-BRx, TRy-BRy) -- right - local tdx, tdy = n2(TLx-TRx, TLy-TRy) -- top - local ldx, ldy = n2(BLx-TLx, BLy-TLy) -- left + local bdx, bdy = n2(BRx - BLx, BRy - BLy) -- bottom + local rdx, rdy = n2(TRx - BRx, TRy - BRy) -- right + local tdx, tdy = n2(TLx - TRx, TLy - TRy) -- top + local ldx, ldy = n2(BLx - TLx, BLy - TLy) -- left -- Chamfer cut points at cs from each corner along adjacent edges - local blb_x, blb_y = BLx + cs*bdx, BLy + cs*bdy - local bll_x, bll_y = BLx - cs*ldx, BLy - cs*ldy - local brb_x, brb_y = BRx - cs*bdx, BRy - cs*bdy - local brr_x, brr_y = BRx + cs*rdx, BRy + cs*rdy - local trr_x, trr_y = TRx - cs*rdx, TRy - cs*rdy - local trt_x, trt_y = TRx + cs*tdx, TRy + cs*tdy - local tlt_x, tlt_y = TLx - cs*tdx, TLy - cs*tdy - local tll_x, tll_y = TLx + cs*ldx, TLy + cs*ldy + local blb_x, blb_y = BLx + cs * bdx, BLy + cs * bdy + local bll_x, bll_y = BLx - cs * ldx, BLy - cs * ldy + local brb_x, brb_y = BRx - cs * bdx, BRy - cs * bdy + local brr_x, brr_y = BRx + cs * rdx, BRy + cs * rdy + local trr_x, trr_y = TRx - cs * rdx, TRy - cs * rdy + local trt_x, trt_y = TRx + cs * tdx, TRy + cs * tdy + local tlt_x, tlt_y = TLx - cs * tdx, TLy - cs * tdy + local tll_x, tll_y = TLx + cs * ldx, TLy + cs * ldy -- Inner corners: cs inward from each actual corner along both adjacent edges - local iblx = BLx + cs*(bdx - ldx); local ibly = BLy + cs*(bdy - ldy) - local ibrx = BRx + cs*(-bdx + rdx); local ibry = BRy + cs*(-bdy + rdy) - local itrx = TRx + cs*(-rdx + tdx); local itry = TRy + cs*(-rdy + tdy) - local itlx = TLx + cs*(-tdx + ldx); local itly = TLy + cs*(-tdy + ldy) + local iblx = BLx + cs * (bdx - ldx) + local ibly = BLy + cs * (bdy - ldy) + local ibrx = BRx + cs * (-bdx + rdx) + local ibry = BRy + cs * (-bdy + rdy) + local itrx = TRx + cs * (-rdx + tdx) + local itry = TRy + cs * (-rdy + tdy) + local itlx = TLx + cs * (-tdx + ldx) + local itly = TLy + cs * (-tdy + ldy) -- 9-quad tessellation -- 1. Center @@ -867,16 +924,16 @@ end example: skew = {tlx = -20, blx = -20} slants the entire left side outward by 20px skew = {tlx = -20} makes only the top-left corner 20px wider ]] -WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr, pbl, opacity, color1, color2, bgpadding, opaque, skew) +WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr, pbl, opacity, color1, color2, bgpadding, opaque, skew) local opacity = mathMin(1, opacity or WG.FlowUI.opacity) - local color1 = color1 or { 0.04, 0.04, 0.04, opacity} + local color1 = color1 or { 0.04, 0.04, 0.04, opacity } local color2 = color2 or { 1, 1, 1, opacity * 0.1 } if opaque then color2 = { 0.12, 0.12, 0.12, 1 } end local ui_scale = WG.FlowUI.scale local bgpadding = bgpadding or WG.FlowUI.elementPadding - local cs = WG.FlowUI.elementCorner * (bgpadding/WG.FlowUI.elementPadding) + local cs = WG.FlowUI.elementCorner * (bgpadding / WG.FlowUI.elementPadding) local glossMult = 2.3 local tileopacity = WG.FlowUI.tileOpacity local bgtexSize = WG.FlowUI.tileSize @@ -892,7 +949,7 @@ WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pb local syPad = bgpadding * (sy < WG.FlowUI.vsy and 1 or 0) * (ptl or 1) local glossHeight = mathFloor(0.02 * WG.FlowUI.vsy * ui_scale) - local doBottomFx = (sy-py-syPad-syPad) > (glossHeight*2.3) + local doBottomFx = (sy - py - syPad - syPad) > (glossHeight * 2.3) -- Use RectRoundQuad (supports trapezoidal skew) when skew is provided, else RectRound. -- Each sub-layer follows the outer trapezoid's edge slope by computing corner offsets @@ -909,13 +966,17 @@ WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pb -- inner rect top y = sy - syPad → tlx = syPad * slopeL -- inner rect bottom y = py + pyPad → blx = (H - pyPad) * slopeL paddingSkew = { - tlx = syPad * slopeL, blx = (H - pyPad) * slopeL, - trx = syPad * slopeR, brx = (H - pyPad) * slopeR, + tlx = syPad * slopeL, + blx = (H - pyPad) * slopeL, + trx = syPad * slopeR, + brx = (H - pyPad) * slopeR, } drawR = function(lpx, lpy, lsx, lsy, cSize, ctL, ctR, cbR, cbL, col1, col2) WG.FlowUI.Draw.RectRoundQuad(lpx, lpy, lsx, lsy, cSize, ctL, ctR, cbR, cbL, col1, col2, { - tlx = (sy - lsy) * slopeL, blx = (sy - lpy) * slopeL, - trx = (sy - lsy) * slopeR, brx = (sy - lpy) * slopeR, + tlx = (sy - lsy) * slopeL, + blx = (sy - lpy) * slopeL, + trx = (sy - lsy) * slopeR, + brx = (sy - lpy) * slopeR, }) end else @@ -925,81 +986,60 @@ WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pb gl.Texture(false) -- Layer 1: Outer border (background) - drawR(px, py, sx, sy, cs, tl, tr, br, bl, - { color1[1], color1[2], color1[3], opaque and 1 or color1[4] }, - { color1[1], color1[2], color1[3], opaque and 1 or color1[4] }) + drawR(px, py, sx, sy, cs, tl, tr, br, bl, { color1[1], color1[2], color1[3], opaque and 1 or color1[4] }, { color1[1], color1[2], color1[3], opaque and 1 or color1[4] }) -- Layer 2: Main element with gradient (replaces the old "element" layer) cs = cs * 0.6 local elemAlpha = opaque and opacity or color2[4] * 1.25 - drawR(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, - { color2[1]*0.33, color2[2]*0.33, color2[3]*0.33, elemAlpha }, - { color2[1], color2[2], color2[3], elemAlpha }) + drawR(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, { color2[1] * 0.33, color2[2] * 0.33, color2[3] * 0.33, elemAlpha }, { color2[1], color2[2], color2[3], elemAlpha }) -- Layer 3: Single combined inner layer (merges the two overlapping "inner darkening" layers) -- This creates the subtle inner border effect more efficiently - local innerPad = 1.5 -- averaged from the old pad2 values + local innerPad = 1.5 -- averaged from the old pad2 values local innerAlpha = opaque and 1 or color1[4] * 0.13 local innerBrightness = opaque and 0.10 or 0 - drawR(px + pxPad + innerPad, py + pyPad + innerPad, sx - sxPad - innerPad, sy - syPad - innerPad, - cs*0.5, tl, tr, br, bl, - { color1[1]+(innerBrightness*0.7), color1[2]+(innerBrightness*0.7), color1[3]+(innerBrightness*0.7), innerAlpha}, - { color1[1]+innerBrightness, color1[2]+innerBrightness, color1[3]+innerBrightness, innerAlpha }) + drawR(px + pxPad + innerPad, py + pyPad + innerPad, sx - sxPad - innerPad, sy - syPad - innerPad, cs * 0.5, tl, tr, br, bl, { color1[1] + (innerBrightness * 0.7), color1[2] + (innerBrightness * 0.7), color1[3] + (innerBrightness * 0.7), innerAlpha }, { color1[1] + innerBrightness, color1[2] + innerBrightness, color1[3] + innerBrightness, innerAlpha }) -- Layer 4: Bottom darkening gradient (only if element is tall enough) if doBottomFx then local c = opaque and 0.06 or 0 local c2 = opaque and 0.12 or 0 - drawR(px + pxPad + 2, py + 2, sx - sxPad - 2, py + ((sy-py)*0.75), cs*1.66, 0, 0, br, bl, - { c, c, c, opaque and 1 or 0.05 * glossMult }, - { c2, c2, c2, opaque and 1 or 0 }) + drawR(px + pxPad + 2, py + 2, sx - sxPad - 2, py + ((sy - py) * 0.75), cs * 1.66, 0, 0, br, bl, { c, c, c, opaque and 1 or 0.05 * glossMult }, { c2, c2, c2, opaque and 1 or 0 }) end -- Layer 5: Top gloss highlight local glossTopAlpha = opaque and 1 or 0.07 * glossMult local glossTopC = opaque and 0.12 * glossMult or 1 - drawR(px + pxPad + 1, sy - syPad - 1 - glossHeight, sx - sxPad - 1, sy - syPad - 1, - cs*0.5, tl, tr, 0, 0, - { 0.12, 0.12, 0.12, opaque and 1 or 0 }, - { glossTopC, glossTopC, glossTopC, glossTopAlpha }) + drawR(px + pxPad + 1, sy - syPad - 1 - glossHeight, sx - sxPad - 1, sy - syPad - 1, cs * 0.5, tl, tr, 0, 0, { 0.12, 0.12, 0.12, opaque and 1 or 0 }, { glossTopC, glossTopC, glossTopC, glossTopAlpha }) -- Layer 6: Bottom gloss highlight (only if element is tall enough) if doBottomFx then local glossBotAlpha = opaque and 1 or 0.03 * glossMult local glossBotC = opaque and 0.05 * glossMult or 1 - drawR(px + pxPad + 1, py + pyPad + 1, sx - sxPad - 1, py + pyPad + glossHeight, - cs, 0, 0, br, bl, - { glossBotC, glossBotC, glossBotC, glossBotAlpha }, - { 0.06, 0.06, 0.06, opaque and 1 or 0 }) + drawR(px + pxPad + 1, py + pyPad + 1, sx - sxPad - 1, py + pyPad + glossHeight, cs, 0, 0, br, bl, { glossBotC, glossBotC, glossBotC, glossBotAlpha }, { 0.06, 0.06, 0.06, opaque and 1 or 0 }) end -- Layer 7: Top edge highlight (only if there's padding) if syPad > 0 then local edgeTopAlpha = opaque and 1 or 0.04 * glossMult local edgeTopC = opaque and 0.33 or 1 - drawR(px + pxPad + 1, sy - syPad - (cs*2.5), sx - sxPad - 1, sy - syPad - 1, - cs, tl, tr, 0, 0, - { 0.24, 0.24, 0.24, opaque and 1 or 0 }, - { edgeTopC, edgeTopC, edgeTopC, edgeTopAlpha }) + drawR(px + pxPad + 1, sy - syPad - (cs * 2.5), sx - sxPad - 1, sy - syPad - 1, cs, tl, tr, 0, 0, { 0.24, 0.24, 0.24, opaque and 1 or 0 }, { edgeTopC, edgeTopC, edgeTopC, edgeTopAlpha }) end -- Layer 8: Bottom edge highlight (only if there's padding) if pyPad > 0 then local edgeBotAlpha = opaque and 1 or 0.02 * glossMult local edgeBotC = opaque and 0.15 or 1 - drawR(px + pxPad + 1, py + pyPad + 1, sx - sxPad - 1, py + pyPad + (cs*2), - cs, 0, 0, br, bl, - { edgeBotC, edgeBotC, edgeBotC, edgeBotAlpha }, - { 0.13, 0.13, 0.13, opaque and 1 or 0 }) + drawR(px + pxPad + 1, py + pyPad + 1, sx - sxPad - 1, py + pyPad + (cs * 2), cs, 0, 0, br, bl, { edgeBotC, edgeBotC, edgeBotC, edgeBotAlpha }, { 0.13, 0.13, 0.13, opaque and 1 or 0 }) end -- Layer 9: Background tile texture if tileopacity > 0 then gl.Color(1, 1, 1, tileopacity * (opaque and 1.33 or 1)) if skew then - WG.FlowUI.Draw.TexturedRectRoundQuad(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, bgtexSize, (px+pxPad)/WG.FlowUI.vsx/bgtexSize, (py+pyPad)/WG.FlowUI.vsy/bgtexSize, "luaui/images/backgroundtile.png", paddingSkew) + WG.FlowUI.Draw.TexturedRectRoundQuad(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, bgtexSize, (px + pxPad) / WG.FlowUI.vsx / bgtexSize, (py + pyPad) / WG.FlowUI.vsy / bgtexSize, "luaui/images/backgroundtile.png", paddingSkew) else - WG.FlowUI.Draw.TexturedRectRound(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, bgtexSize, (px+pxPad)/WG.FlowUI.vsx/bgtexSize, (py+pyPad)/WG.FlowUI.vsy/bgtexSize, "luaui/images/backgroundtile.png") + WG.FlowUI.Draw.TexturedRectRound(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, tl, tr, br, bl, bgtexSize, (px + pxPad) / WG.FlowUI.vsx / bgtexSize, (py + pyPad) / WG.FlowUI.vsy / bgtexSize, "luaui/images/backgroundtile.png") end end @@ -1008,42 +1048,19 @@ WG.FlowUI.Draw.Element = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pb local outlineWidth10 = 2 local outlineAlpha10 = opaque and 0.2 or 0.11 if skew then - WG.FlowUI.Draw.RectRoundOutlineQuad( - px + pxPad, py + pyPad, sx - sxPad, sy - syPad, - cs, outlineWidth10, - tl, tr, br, bl, - { 1, 1, 1, outlineAlpha10 }, { 1, 1, 1, 0 }, - paddingSkew - ) + WG.FlowUI.Draw.RectRoundOutlineQuad(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, outlineWidth10, tl, tr, br, bl, { 1, 1, 1, outlineAlpha10 }, { 1, 1, 1, 0 }, paddingSkew) else - WG.FlowUI.Draw.RectRoundOutline( - px + pxPad, py + pyPad, sx - sxPad, sy - syPad, - cs, outlineWidth10, - tl, tr, br, bl, - { 1, 1, 1, outlineAlpha10 }, { 1, 1, 1, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, outlineWidth10, tl, tr, br, bl, { 1, 1, 1, outlineAlpha10 }, { 1, 1, 1, 0 }) end -- Layer 11: White feathered inner outline glow local outlineWidth11 = 16 local outlineAlpha11 = opaque and 0.08 or 0.04 if skew then - WG.FlowUI.Draw.RectRoundOutlineQuad( - px + pxPad, py + pyPad, sx - sxPad, sy - syPad, - cs, outlineWidth11, - tl, tr, br, bl, - { 1, 1, 1, outlineAlpha11 }, { 1, 1, 1, 0 }, - paddingSkew - ) + WG.FlowUI.Draw.RectRoundOutlineQuad(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, outlineWidth11, tl, tr, br, bl, { 1, 1, 1, outlineAlpha11 }, { 1, 1, 1, 0 }, paddingSkew) else - WG.FlowUI.Draw.RectRoundOutline( - px + pxPad, py + pyPad, sx - sxPad, sy - syPad, - cs, outlineWidth11, - tl, tr, br, bl, - { 1, 1, 1, outlineAlpha11 }, { 1, 1, 1, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, outlineWidth11, tl, tr, br, bl, { 1, 1, 1, outlineAlpha11 }, { 1, 1, 1, 0 }) end - end --[[ @@ -1058,11 +1075,11 @@ end color1, color2 = (color1[4] alpha value overrides opacity define above) bgpadding = custom border size ]] -WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr, pbl, opacity, color1, color2, bgpadding, glossMult) +WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr, pbl, opacity, color1, color2, bgpadding, glossMult) local opacity = opacity or 1 - local color1 = color1 or { 0, 0, 0, opacity} - local color2 = color2 or { 1, 1, 1, opacity * 0.1} - local bgpadding = mathFloor(bgpadding or WG.FlowUI.buttonPadding*0.5) + local color1 = color1 or { 0, 0, 0, opacity } + local color2 = color2 or { 1, 1, 1, opacity * 0.1 } + local bgpadding = mathFloor(bgpadding or WG.FlowUI.buttonPadding * 0.5) glossMult = (1 + (2 - (opacity * 1.5))) * (glossMult and glossMult or 1) local tl = tl or 1 @@ -1075,7 +1092,7 @@ WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr local sxPad = bgpadding * (sx < WG.FlowUI.vsx and 1 or 0) * (ptr or 1) local syPad = bgpadding * (sy < WG.FlowUI.vsy and 1 or 0) * (ptl or 1) - local glossHeight = mathFloor((sy-py)*0.4) + local glossHeight = mathFloor((sy - py) * 0.4) local cs = bgpadding * 1.6 -- Layer 1: Background with gradient @@ -1084,9 +1101,7 @@ WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr -- Layer 2: Combined top gloss (merges the old top edge highlight + top half gloss + top extended gloss) -- Alpha values tuned to match original brightness from overlapping layers local topGlossAlpha = 0.18 * glossMult - WG.FlowUI.Draw.RectRound(px + pxPad, sy - syPad - glossHeight, sx - sxPad, sy - syPad, bgpadding, tl, tr, 0, 0, - { 1, 1, 1, 0 }, - { 1, 1, 1, topGlossAlpha }) + WG.FlowUI.Draw.RectRound(px + pxPad, sy - syPad - glossHeight, sx - sxPad, sy - syPad, bgpadding, tl, tr, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, topGlossAlpha }) -- -- Layer 3: Enhanced top edge highlight (thin bright edge at the very top) -- WG.FlowUI.Draw.RectRound(px + pxPad, sy - syPad - (bgpadding*2.5), sx - sxPad, sy - syPad, bgpadding, tl, tr, 0, 0, @@ -1096,9 +1111,7 @@ WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr -- Layer 4: Combined bottom gloss (merges the three overlapping bottom gloss layers) -- Alpha values tuned to match original brightness from overlapping layers local bottomGlossAlpha = 0.075 * glossMult - WG.FlowUI.Draw.RectRound(px + pxPad, py + pyPad, sx - sxPad, py + pyPad + glossHeight, bgpadding, 0, 0, br, bl, - { 1, 1, 1, bottomGlossAlpha }, - { 1, 1, 1, 0 }) + WG.FlowUI.Draw.RectRound(px + pxPad, py + pyPad, sx - sxPad, py + pyPad + glossHeight, bgpadding, 0, 0, br, bl, { 1, 1, 1, bottomGlossAlpha }, { 1, 1, 1, 0 }) -- -- Layer 5: Bottom edge highlight (thin edge at the very bottom) -- WG.FlowUI.Draw.RectRound(px + pxPad, py + pyPad, sx - sxPad, py + pyPad + (bgpadding*2), bgpadding, 0, 0, br, bl, @@ -1108,17 +1121,11 @@ WG.FlowUI.Draw.Button = function(px, py, sx, sy, tl, tr, br, bl, ptl, ptr, pbr -- Layer 6: White feathered inner outline glow local outlineWidth = 7 local outlineAlpha = opaque and 0.12 or 0.06 - WG.FlowUI.Draw.RectRoundOutline( - px + pxPad, py + pyPad, sx - sxPad, sy - syPad, - cs, outlineWidth, - tl, tr, br, bl, - { 1, 1, 1, outlineAlpha }, { 1, 1, 1, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(px + pxPad, py + pyPad, sx - sxPad, sy - syPad, cs, outlineWidth, tl, tr, br, bl, { 1, 1, 1, outlineAlpha }, { 1, 1, 1, 0 }) end -- This was broken out from an internal "Unit" function, to allow drawing similar style icons in other places -WG.FlowUI.Draw.TexRectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, offset) - +WG.FlowUI.Draw.TexRectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, offset) -- Pre-calculate invariant values (avoids redundant per-vertex calculations) local height = sy - py local width = sx - px @@ -1128,7 +1135,7 @@ WG.FlowUI.Draw.TexRectRound = function(px, py, sx, sy, cs, tl, tr, br, bl, of local offsetScale = 1 - offset local function drawTexCoordVertex(x, y) - local xNorm = (x - px) * invWidth -- Normalized x position [0,1] + local xNorm = (x - px) * invWidth -- Normalized x position [0,1] local yNorm = (y - py) * invHeight -- Normalized y position [0,1] local xc = offsetHalf + xNorm * offsetScale local yc = 1 - offsetHalf - yNorm * offsetScale @@ -1352,10 +1359,14 @@ WG.FlowUI.Draw.RectRoundOutlineQuad = function(px, py, sx, sy, cs, outlineWidth, local bl = bl or 1 -- Per-corner skew offsets - local tlx = skew.tlx or 0; local tly = skew.tly or 0 - local trx = skew.trx or 0; local try = skew.try or 0 - local brx = skew.brx or 0; local bry = skew.bry or 0 - local blx = skew.blx or 0; local bly = skew.bly or 0 + local tlx = skew.tlx or 0 + local tly = skew.tly or 0 + local trx = skew.trx or 0 + local try = skew.try or 0 + local brx = skew.brx or 0 + local bry = skew.bry or 0 + local blx = skew.blx or 0 + local bly = skew.bly or 0 -- Outer quadrilateral corners local oBLx, oBLy = px + blx, py + bly @@ -1365,23 +1376,25 @@ WG.FlowUI.Draw.RectRoundOutlineQuad = function(px, py, sx, sy, cs, outlineWidth, -- Normalize 2D vector local function n2(x, y) - local len = math.sqrt(x*x + y*y) - if len < 0.001 then return 0, 1 end - return x/len, y/len + local len = math.sqrt(x * x + y * y) + if len < 0.001 then + return 0, 1 + end + return x / len, y / len end -- Outer edge unit directions CCW: BL->BR->TR->TL->BL - local bdx, bdy = n2(oBRx-oBLx, oBRy-oBLy) -- bottom - local rdx, rdy = n2(oTRx-oBRx, oTRy-oBRy) -- right - local tdx, tdy = n2(oTLx-oTRx, oTLy-oTRy) -- top - local ldx, ldy = n2(oBLx-oTLx, oBLy-oTLy) -- left + local bdx, bdy = n2(oBRx - oBLx, oBRy - oBLy) -- bottom + local rdx, rdy = n2(oTRx - oBRx, oTRy - oBRy) -- right + local tdx, tdy = n2(oTLx - oTRx, oTLy - oTRy) -- top + local ldx, ldy = n2(oBLx - oTLx, oBLy - oTLy) -- left -- Inward normals for each edge (rotate edge dir 90° inward, into the shape) -- For CCW winding with y-up, inward normal = rotate edge dir 90° CCW (left perp) = (-dy, dx) - local binx, biny = -bdy, bdx -- bottom inward normal - local rinx, riny = -rdy, rdx -- right inward normal - local tinx, tiny = -tdy, tdx -- top inward normal - local linx, liny = -ldy, ldx -- left inward normal + local binx, biny = -bdy, bdx -- bottom inward normal + local rinx, riny = -rdy, rdx -- right inward normal + local tinx, tiny = -tdy, tdx -- top inward normal + local linx, liny = -ldy, ldx -- left inward normal -- Inner quadrilateral corners: each outer corner offset inward by outlineWidth -- along the sum of the two adjacent edge inward normals @@ -1395,32 +1408,32 @@ WG.FlowUI.Draw.RectRoundOutlineQuad = function(px, py, sx, sy, cs, outlineWidth, local iTLy = oTLy + outlineWidth * (tiny + liny) -- Inner edge directions (recompute for inner quad) - local ibdx, ibdy = n2(iBRx-iBLx, iBRy-iBLy) - local irdx, irdy = n2(iTRx-iBRx, iTRy-iBRy) - local itdx, itdy = n2(iTLx-iTRx, iTLy-iTRy) - local ildx, ildy = n2(iBLx-iTLx, iBLy-iTLy) + local ibdx, ibdy = n2(iBRx - iBLx, iBRy - iBLy) + local irdx, irdy = n2(iTRx - iBRx, iTRy - iBRy) + local itdx, itdy = n2(iTLx - iTRx, iTLy - iTRy) + local ildx, ildy = n2(iBLx - iTLx, iBLy - iTLy) local innerCs = mathMax(0, cs - outlineWidth) -- Outer chamfer cut points at distance cs from each outer corner along adjacent edges - local oblb_x, oblb_y = oBLx + cs*bdx, oBLy + cs*bdy - local obll_x, obll_y = oBLx - cs*ldx, oBLy - cs*ldy - local obrb_x, obrb_y = oBRx - cs*bdx, oBRy - cs*bdy - local obrr_x, obrr_y = oBRx + cs*rdx, oBRy + cs*rdy - local otrr_x, otrr_y = oTRx - cs*rdx, oTRy - cs*rdy - local otrt_x, otrt_y = oTRx + cs*tdx, oTRy + cs*tdy - local otlt_x, otlt_y = oTLx - cs*tdx, oTLy - cs*tdy - local otll_x, otll_y = oTLx + cs*ldx, oTLy + cs*ldy + local oblb_x, oblb_y = oBLx + cs * bdx, oBLy + cs * bdy + local obll_x, obll_y = oBLx - cs * ldx, oBLy - cs * ldy + local obrb_x, obrb_y = oBRx - cs * bdx, oBRy - cs * bdy + local obrr_x, obrr_y = oBRx + cs * rdx, oBRy + cs * rdy + local otrr_x, otrr_y = oTRx - cs * rdx, oTRy - cs * rdy + local otrt_x, otrt_y = oTRx + cs * tdx, oTRy + cs * tdy + local otlt_x, otlt_y = oTLx - cs * tdx, oTLy - cs * tdy + local otll_x, otll_y = oTLx + cs * ldx, oTLy + cs * ldy -- Inner chamfer cut points at distance innerCs from each inner corner along adjacent inner edges - local iblb_x, iblb_y = iBLx + innerCs*ibdx, iBLy + innerCs*ibdy - local ibll_x, ibll_y = iBLx - innerCs*ildx, iBLy - innerCs*ildy - local ibrb_x, ibrb_y = iBRx - innerCs*ibdx, iBRy - innerCs*ibdy - local ibrr_x, ibrr_y = iBRx + innerCs*irdx, iBRy + innerCs*irdy - local itrr_x, itrr_y = iTRx - innerCs*irdx, iTRy - innerCs*irdy - local itrt_x, itrt_y = iTRx + innerCs*itdx, iTRy + innerCs*itdy - local itlt_x, itlt_y = iTLx - innerCs*itdx, iTLy - innerCs*itdy - local itll_x, itll_y = iTLx + innerCs*ildx, iTLy + innerCs*ildy + local iblb_x, iblb_y = iBLx + innerCs * ibdx, iBLy + innerCs * ibdy + local ibll_x, ibll_y = iBLx - innerCs * ildx, iBLy - innerCs * ildy + local ibrb_x, ibrb_y = iBRx - innerCs * ibdx, iBRy - innerCs * ibdy + local ibrr_x, ibrr_y = iBRx + innerCs * irdx, iBRy + innerCs * irdy + local itrr_x, itrr_y = iTRx - innerCs * irdx, iTRy - innerCs * irdy + local itrt_x, itrt_y = iTRx + innerCs * itdx, iTRy + innerCs * itdy + local itlt_x, itlt_y = iTLx - innerCs * itdx, iTLy - innerCs * itdy + local itll_x, itll_y = iTLx + innerCs * ildx, iTLy + innerCs * ildy -- Draw 12 quads: 4 edge strips + 4 corners + 4 degenerate/square corner fills -- Top strip (otlt = TL top-edge chamfer, otrt = TR top-edge chamfer) @@ -1572,27 +1585,23 @@ end price = {metal, energy} queueCount ]] -WG.FlowUI.Draw.Unit = function(px, py, sx, sy, cs, tl, tr, br, bl, zoom, borderSize, borderOpacity, texture, radarTexture, groupTexture, price, queueCount) - local borderSize = borderSize~=nil and borderSize or mathMin(mathMax(1, mathFloor((sx-px) * 0.024)), mathFloor((WG.FlowUI.vsy*0.0015)+0.5)) -- set default with upper limit - local cs = cs~=nil and cs or mathMax(1, mathFloor((sx-px) * 0.024)) +WG.FlowUI.Draw.Unit = function(px, py, sx, sy, cs, tl, tr, br, bl, zoom, borderSize, borderOpacity, texture, radarTexture, groupTexture, price, queueCount) + local borderSize = borderSize ~= nil and borderSize or mathMin(mathMax(1, mathFloor((sx - px) * 0.024)), mathFloor((WG.FlowUI.vsy * 0.0015) + 0.5)) -- set default with upper limit + local cs = cs ~= nil and cs or mathMax(1, mathFloor((sx - px) * 0.024)) borderOpacity = borderOpacity or 0.1 -- Layer 1: Draw unit texture if texture then gl.Texture(texture) end - gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px, py, sx, sy, cs, tl, tr, br, bl, zoom+0.02) + gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px, py, sx, sy, cs, tl, tr, br, bl, zoom + 0.02) if texture then gl.Texture(false) end -- Layer 1.1: background base outline (feathered) - local baseOutlineWidth = mathMax(1, mathFloor(((sx-px) + (sy-py)) * 0.022)) - WG.FlowUI.Draw.RectRoundOutline( - px-baseOutlineWidth, py-baseOutlineWidth, sx+baseOutlineWidth, sy+baseOutlineWidth, cs*2, baseOutlineWidth, - tl, tr, br, bl, - { 0, 0, 0, 0 }, { 0, 0, 0, 0.22 } - ) + local baseOutlineWidth = mathMax(1, mathFloor(((sx - px) + (sy - py)) * 0.022)) + WG.FlowUI.Draw.RectRoundOutline(px - baseOutlineWidth, py - baseOutlineWidth, sx + baseOutlineWidth, sy + baseOutlineWidth, cs * 2, baseOutlineWidth, tl, tr, br, bl, { 0, 0, 0, 0 }, { 0, 0, 0, 0.22 }) -- Layer 2: Darken bottom gradient (creates depth) WG.FlowUI.Draw.RectRound(px, py, sx, sy, cs, 0, 0, 1, 1, { 0, 0, 0, 0.2 }, { 0, 0, 0, 0 }) @@ -1601,24 +1610,16 @@ WG.FlowUI.Draw.Unit = function(px, py, sx, sy, cs, tl, tr, br, bl, zoom, bor gl.Blending(GL.SRC_ALPHA, GL.ONE) -- Top shine gradient - WG.FlowUI.Draw.RectRound(px, sy-((sy-py)*0.4), sx, sy, cs, 1, 1, 0, 0, {1, 1, 1, 0}, {1, 1, 1, 0.06}) + WG.FlowUI.Draw.RectRound(px, sy - ((sy - py) * 0.4), sx, sy, cs, 1, 1, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.06 }) -- Feathered edge highlight using rectangular outline if borderSize > 0 then -- Combined feather edge and border into single call - WG.FlowUI.Draw.RectRoundOutline( - px, py, sx, sy, cs*0.7, borderSize, - tl, tr, br, bl, - { 1, 1, 1, borderOpacity + 0.04 }, { 1, 1, 1, borderOpacity } - ) + WG.FlowUI.Draw.RectRoundOutline(px, py, sx, sy, cs * 0.7, borderSize, tl, tr, br, bl, { 1, 1, 1, borderOpacity + 0.04 }, { 1, 1, 1, borderOpacity }) else -- Just the feather edge when no border - local featherWidth = mathMax(1, mathFloor(((sx-px) + (sy-py)) * 0.015)) - WG.FlowUI.Draw.RectRoundOutline( - px, py, sx, sy, cs*0.7, featherWidth, - tl, tr, br, bl, - { 1, 1, 1, 0.04 }, { 1, 1, 1, 0 } - ) + local featherWidth = mathMax(1, mathFloor(((sx - px) + (sy - py)) * 0.015)) + WG.FlowUI.Draw.RectRoundOutline(px, py, sx, sy, cs * 0.7, featherWidth, tl, tr, br, bl, { 1, 1, 1, 0.04 }, { 1, 1, 1, 0 }) end gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -1628,7 +1629,7 @@ WG.FlowUI.Draw.Unit = function(px, py, sx, sy, cs, tl, tr, br, bl, zoom, bor local iconSize = mathFloor((sx - px) * 0.3) gl.Color(1, 1, 1, 1) gl.Texture(groupTexture) - gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px, sy - iconSize, px + iconSize, sy, 0, 0,0,0,0, 0.05) + gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px, sy - iconSize, px + iconSize, sy, 0, 0, 0, 0, 0, 0.05) gl.Texture(false) end @@ -1638,7 +1639,7 @@ WG.FlowUI.Draw.Unit = function(px, py, sx, sy, cs, tl, tr, br, bl, zoom, bor local iconPadding = mathFloor((sx - px) * 0.03) gl.Color(0.88, 0.88, 0.88, 1) gl.Texture(radarTexture) - gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px + iconPadding, py + iconPadding, px + iconPadding + iconSize, py + iconPadding + iconSize, 0, 0,0,0,0, 0.05) + gl.BeginEnd(GL.QUADS, WG.FlowUI.Draw.TexRectRound, px + iconPadding, py + iconPadding, px + iconPadding + iconSize, py + iconPadding + iconSize, 0, 0, 0, 0, 0, 0.05) gl.Texture(false) end end @@ -1700,7 +1701,7 @@ WG.FlowUI.Draw.Toggle = function(px, py, sx, sy, state) -- top WG.FlowUI.Draw.RectRound(px, sy - (edgeWidth * 3), sx, sy, edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0 }, { 1, 1, 1, 0.035 }) -- bottom - WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.025 }, { 1, 1, 1, 0 }) + WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.025 }, { 1, 1, 1, 0 }) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- draw state @@ -1708,17 +1709,17 @@ WG.FlowUI.Draw.Toggle = function(px, py, sx, sy, state) local radius = mathFloor(height * 0.5) - padding local y = mathFloor(py + (height * 0.5)) local x, color, glowMult - if state == true or state == 1 then -- on + if state == true or state == 1 then -- on x = sx - padding - radius - color = {0.8, 1, 0.8, 1} + color = { 0.8, 1, 0.8, 1 } glowMult = 1 - elseif not state or state == 0 then -- off + elseif not state or state == 0 then -- off x = px + padding + radius - color = {0.95, 0.66, 0.66, 1} + color = { 0.95, 0.66, 0.66, 1 } glowMult = 0.3 - else -- in between + else -- in between x = mathFloor(px + (width * 0.42)) - color = {1, 0.9, 0.7, 1} + color = { 1, 0.9, 0.7, 1 } glowMult = 0.6 end WG.FlowUI.Draw.SliderKnob(x, y, radius, color) @@ -1746,24 +1747,23 @@ end color ]] WG.FlowUI.Draw.SliderKnob = function(x, y, radius, color) - local color = color or {0.95,0.95,0.95,1} - local color1 = {color[1]*0.55, color[2]*0.55, color[3]*0.55, color[4]} - local cs = mathMax(1.1, radius*0.15) + local color = color or { 0.95, 0.95, 0.95, 1 } + local color1 = { color[1] * 0.55, color[2] * 0.55, color[3] * 0.55, color[4] } + local cs = mathMax(1.1, radius * 0.15) -- faint dark outline edge local edgeWidth = mathMax(1, mathFloor(radius * 0.05)) - WG.FlowUI.Draw.RectRound(x-radius-edgeWidth, y-radius-edgeWidth, x+radius+edgeWidth, y+radius+edgeWidth, cs, 1,1,1,1, {0,0,0,0.12}) + WG.FlowUI.Draw.RectRound(x - radius - edgeWidth, y - radius - edgeWidth, x + radius + edgeWidth, y + radius + edgeWidth, cs, 1, 1, 1, 1, { 0, 0, 0, 0.12 }) local edgeWidth = mathMax(2, mathFloor(radius * 0.3)) - WG.FlowUI.Draw.RectRoundOutline(x-radius-edgeWidth, y-radius-edgeWidth, x+radius+edgeWidth, y+radius+edgeWidth, cs, edgeWidth, 1, 1, 1, 1, {0,0,0,0}, {0,0,0,0.17}) + WG.FlowUI.Draw.RectRoundOutline(x - radius - edgeWidth, y - radius - edgeWidth, x + radius + edgeWidth, y + radius + edgeWidth, cs, edgeWidth, 1, 1, 1, 1, { 0, 0, 0, 0 }, { 0, 0, 0, 0.17 }) -- knob - WG.FlowUI.Draw.RectRound(x-radius, y-radius, x+radius, y+radius, cs, 1,1,1,1, color1, color) + WG.FlowUI.Draw.RectRound(x - radius, y - radius, x + radius, y + radius, cs, 1, 1, 1, 1, color1, color) -- lighten knob inside edges gl.Blending(GL.SRC_ALPHA, GL.ONE) local innerOutlineWidth = radius * 0.17 - WG.FlowUI.Draw.RectRoundOutline(x-radius, y-radius, x+radius, y+radius, cs, innerOutlineWidth, 1, 1, 1, 1, {1,1,1,0.22}, {1,1,1,0}) + WG.FlowUI.Draw.RectRoundOutline(x - radius, y - radius, x + radius, y + radius, cs, innerOutlineWidth, 1, 1, 1, 1, { 1, 1, 1, 0.22 }, { 1, 1, 1, 0 }) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - end --[[ @@ -1791,7 +1791,7 @@ WG.FlowUI.Draw.Slider = function(px, py, sx, sy, steps, min, max) if steps then local numSteps = 0 local processedSteps = {} - if type(steps) == 'table' then + if type(steps) == "table" then min = steps[1] max = steps[#steps] numSteps = #steps @@ -1849,7 +1849,7 @@ WG.FlowUI.Draw.Selector = function(px, py, sx, sy) -- top WG.FlowUI.Draw.RectRound(px, sy - (edgeWidth * 3), sx, sy, edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0 }, { 1, 1, 1, 0.035 }) -- bottom - WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.025 }, { 1, 1, 1, 0 }) + WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.025 }, { 1, 1, 1, 0 }) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- button @@ -1867,12 +1867,12 @@ end opacity color = {1,1,1} ]] -WG.FlowUI.Draw.SelectHighlight = function(px, py, sx, sy, cs, opacity, color) +WG.FlowUI.Draw.SelectHighlight = function(px, py, sx, sy, cs, opacity, color) local height = sy - py cs = cs or (height * 0.08) local edgeWidth = mathMax(1, mathFloor((WG.FlowUI.vsy * 0.001))) local opacity = opacity or 0.35 - local color = color or {1, 1, 1} + local color = color or { 1, 1, 1 } -- faint dark outline edge WG.FlowUI.Draw.RectRound(px - edgeWidth, py - edgeWidth, sx + edgeWidth, sy + edgeWidth, cs * 1.5, 1, 1, 1, 1, { 0, 0, 0, 0.05 }) @@ -1884,7 +1884,7 @@ WG.FlowUI.Draw.SelectHighlight = function(px, py, sx, sy, cs, opacity, color) -- top WG.FlowUI.Draw.RectRound(px, sy - (edgeWidth * 3), sx, sy, edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0 }, { 1, 1, 1, 0.03 + (0.18 * opacity) }) -- bottom - WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.015 + (0.06 * opacity) }, { 1, 1, 1, 0 }) + WG.FlowUI.Draw.RectRound(px, py, sx, py + (edgeWidth * 3), edgeWidth, 1, 1, 1, 1, { 1, 1, 1, 0.015 + (0.06 * opacity) }, { 1, 1, 1, 0 }) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end diff --git a/luaui/Widgets/gui_fonthandler.lua b/luaui/Widgets/gui_fonthandler.lua index 41e6a9ad3c9..25ad5b96e9e 100644 --- a/luaui/Widgets/gui_fonthandler.lua +++ b/luaui/Widgets/gui_fonthandler.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Font handler", - desc = "handles font object creation", - author = "Floris", - date = "June 2020", - license = "GNU GPL, v2 or later", - layer = -1200001, - enabled = true + name = "Font handler", + desc = "handles font object creation", + author = "Floris", + date = "June 2020", + license = "GNU GPL, v2 or later", + layer = -1200001, + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor @@ -20,7 +19,7 @@ local mathFloor = math.floor local spEcho = Spring.Echo local spGetViewGeometry = Spring.GetViewGeometry -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local defaultFont = "fonts/" .. Spring.GetConfigString("bar_font", "Poppins-Regular.otf") local defaultFont2 = "fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf") @@ -39,15 +38,14 @@ local sceduledDeleteFonts = {} local sceduledDeleteFontsClock local function createFont(file, size, outlineSize, outlineStrength) - local id = file..'_'..size..'_'..outlineSize..'_'..outlineStrength + local id = file .. "_" .. size .. "_" .. outlineSize .. "_" .. outlineStrength if fonts[id] ~= nil then - sceduledDeleteFonts[#sceduledDeleteFonts+1] = fonts[id] + sceduledDeleteFonts[#sceduledDeleteFonts + 1] = fonts[id] sceduledDeleteFontsClock = os.clock() + 5 end - fonts[id] = gl.LoadFont(file, size*fontScale, outlineSize*fontScale, outlineStrength) + fonts[id] = gl.LoadFont(file, size * fontScale, outlineSize * fontScale, outlineStrength) end - local sec = 0 function widget:Update(dt) -- sec = sec + dt @@ -69,7 +67,7 @@ function widget:Update(dt) -- end if sceduledDeleteFontsClock and sceduledDeleteFontsClock < os.clock() then - for i,font in pairs(sceduledDeleteFonts) do + for i, font in pairs(sceduledDeleteFonts) do gl.DeleteFont(font) end sceduledDeleteFonts = {} @@ -79,15 +77,15 @@ end function widget:Initialize() if gl.AddFallbackFont then - gl.AddFallbackFont('fallbacks/NotoEmoji-VariableFont_wght.ttf') - gl.AddFallbackFont('fallbacks/SourceHanSans-Regular.ttc') + gl.AddFallbackFont("fallbacks/NotoEmoji-VariableFont_wght.ttf") + gl.AddFallbackFont("fallbacks/SourceHanSans-Regular.ttc") end - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() widget:ViewResize(vsx, vsy, true) - WG['fonts'] = {} - WG['fonts'].getFont = function(file, size, outlineSize, outlineStrength) + WG["fonts"] = {} + WG["fonts"].getFont = function(file, size, outlineSize, outlineStrength) if not file or file == 1 then file = defaultFont elseif file == 2 then @@ -99,20 +97,20 @@ function widget:Initialize() outlineSize = mathFloor((defaultSize * (outlineSize and outlineSize or defaultOutlineSize)) + 0.5) outlineStrength = (outlineStrength and outlineStrength or defaultOutlineStrength) - local id = file..'_'..size..'_'..outlineSize..'_'..outlineStrength + local id = file .. "_" .. size .. "_" .. outlineSize .. "_" .. outlineStrength if fonts[id] == nil then createFont(file, size, outlineSize, outlineStrength) end - return fonts[id], size*fontScale + return fonts[id], size * fontScale end end function widget:ViewResize(vsx, vsy, init) - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() local newFontScale = (vsy / 1080) * ui_scale - local outlineMult = math.clamp(1/(vsy/1400), 1, 1.5) - defaultOutlineSize = 0.22*(outlineMult*0.9) + local outlineMult = math.clamp(1 / (vsy / 1400), 1, 1.5) + defaultOutlineSize = 0.22 * (outlineMult * 0.9) if fontScale ~= newFontScale then fontScale = newFontScale @@ -127,14 +125,14 @@ end function widget:GetConfigData() return { fonts = fonts, - fontScale = fontScale + fontScale = fontScale, } end function widget:SetConfigData(data) if Spring.GetGameFrame() > 0 then if data.fonts ~= nil then - fonts = data.fonts -- not sure why BYAR.lua just shows empty table while it has the fonts when restoring o_0 + fonts = data.fonts -- not sure why BYAR.lua just shows empty table while it has the fonts when restoring o_0 fontScale = data.fontScale end end diff --git a/luaui/Widgets/gui_game_type_info.lua b/luaui/Widgets/gui_game_type_info.lua index 6b6db1e9ceb..c511bb91afd 100644 --- a/luaui/Widgets/gui_game_type_info.lua +++ b/luaui/Widgets/gui_game_type_info.lua @@ -22,11 +22,10 @@ function widget:GetInfo() date = "Jul 6, 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry @@ -49,7 +48,7 @@ function widget:ViewResize() vsx, vsy = spGetViewGeometry() widgetScale = (0.80 + (vsx * vsy / 6000000)) - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) if messages[1] then messages[1].x = widgetScale * 60 @@ -89,24 +88,22 @@ function widget:LanguageChanged() local deathmode = Spring.GetModOptions().deathmode if deathmode == "killall" then - key = 'killAllUnits' + key = "killAllUnits" elseif deathmode == "builders" then - key = 'killAllBuilders' + key = "killAllBuilders" elseif deathmode == "territorial_domination" and not Spring.Utilities.Gametype.IsRaptors() and not Spring.Utilities.Gametype.IsScavengers() then - key = 'territorialDomination' + key = "territorialDomination" else - key = 'killAllCommanders' + key = "killAllCommanders" end - messages[1].str = "\255\255\255\255" .. Spring.I18N('ui.gametypeInfo.victoryCondition') .. ": " .. Spring.I18N('ui.gametypeInfo.' .. key) + messages[1].str = "\255\255\255\255" .. Spring.I18N("ui.gametypeInfo.victoryCondition") .. ": " .. Spring.I18N("ui.gametypeInfo." .. key) if deathmode == "own_com" then - messages[3].str = "\255\255\150\150" .. Spring.I18N('ui.gametypeInfo.owncomends') + messages[3].str = "\255\255\150\150" .. Spring.I18N("ui.gametypeInfo.owncomends") end end - - function widget:DrawScreen() if spGetGameSeconds() > 0 then widgetHandler:RemoveWidget() @@ -114,7 +111,9 @@ function widget:DrawScreen() end local y = 0.19 - if (Game.startPosType == 2) and (draftMode ~= nil and draftMode ~= "disabled") then y = 0.68 end + if (Game.startPosType == 2) and (draftMode ~= nil and draftMode ~= "disabled") then + y = 0.68 + end glPushMatrix() glTranslate((vsx * 0.5), (vsy * y), 0) --has to be below where newbie info appears! glScale(1.5, 1.5, 1) diff --git a/luaui/Widgets/gui_gameinfo.lua b/luaui/Widgets/gui_gameinfo.lua index cfed5c047a5..5e5133b4f08 100644 --- a/luaui/Widgets/gui_gameinfo.lua +++ b/luaui/Widgets/gui_gameinfo.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -33,7 +32,7 @@ local math_isInRect = math.isInRect local raptorsEnabled = Spring.Utilities.Gametype.IsRaptors() -local content = '' +local content = "" local tidal = Game.tidal local map_tidal = Spring.GetModOptions().map_tidal @@ -57,7 +56,7 @@ end local defaultModoptions = VFS.Include("modoptions.lua") local modoptionsDefault = {} for key, value in pairs(defaultModoptions) do - modoptionsDefault[value.key] = {name = value.name, desc = value.desc, def = value.def} + modoptionsDefault[value.key] = { name = value.name, desc = value.desc, def = value.def } end local modoptions = Spring.GetModOptionsCopy() @@ -66,7 +65,7 @@ local unchangedModoptions = {} local changedRaptorModoptions = {} local unchangedRaptorModoptions = {} for key, value in pairs(modoptions) do - if string.sub(key, 1, 8) == 'raptor_' then + if string.sub(key, 1, 8) == "raptor_" then if raptorsEnabled then if value == modoptionsDefault[key].def then unchangedRaptorModoptions[key] = tostring(value) @@ -77,27 +76,29 @@ for key, value in pairs(modoptions) do end end - - local function stringifyDefTable(t, path, pathAddition) - if not path then path = {} end + if not path then + path = {} + end path = table.copy(path) if pathAddition then - path[#path+1] = pathAddition + path[#path + 1] = pathAddition end - if #path > 10 then return '...' end - local text = '' - local depthSpacing = '' - for i=1, #path, 1 do - depthSpacing = depthSpacing .. ' ' + if #path > 10 then + return "..." + end + local text = "" + local depthSpacing = "" + for i = 1, #path, 1 do + depthSpacing = depthSpacing .. " " end for k, v in pairs(t) do if type(v) == "table" then - text = text .. '\n' .. valuegreycolor .. depthSpacing .. tostring(k) .. ' = {' + text = text .. "\n" .. valuegreycolor .. depthSpacing .. tostring(k) .. " = {" text = text .. stringifyDefTable(v, path, k) - text = text .. '\n' .. valuegreycolor .. depthSpacing .. '}' + text = text .. "\n" .. valuegreycolor .. depthSpacing .. "}" else - text = text .. '\n' .. valuegreycolor .. depthSpacing .. tostring(k) .. ' = ' .. tostring(v) + text = text .. "\n" .. valuegreycolor .. depthSpacing .. tostring(k) .. " = " .. tostring(v) end end return text @@ -107,24 +108,24 @@ for key, value in pairs(modoptions) do if modoptionsDefault[key] and value == modoptionsDefault[key].def then unchangedModoptions[key] = tostring(value) else - if not string.find(key, 'tweakunits') and not string.find(key, 'tweakdefs') then + if not string.find(key, "tweakunits") and not string.find(key, "tweakdefs") then changedModoptions[key] = tostring(value) else - if string.find(key, 'tweakdefs') then + if string.find(key, "tweakdefs") then local decodeSuccess, postsFuncStr = pcall(string.base64Decode, value) - changedModoptions[key] = '\n' .. (decodeSuccess and postsFuncStr or '\255\255\100\100 - '..Spring.I18N('ui.gameInfo.decodefailed').. ' - ') + changedModoptions[key] = "\n" .. (decodeSuccess and postsFuncStr or "\255\255\100\100 - " .. Spring.I18N("ui.gameInfo.decodefailed") .. " - ") else - local dataRaw = string.gsub(value, '_', '=') + local dataRaw = string.gsub(value, "_", "=") local decodeSuccess, postsFuncStr = pcall(string.base64Decode, dataRaw) local success, tweaks = pcall(Spring.Utilities.SafeLuaTableParser, postsFuncStr) if success and type(tweaks) == "table" then - local text = '' + local text = "" for name, ud in pairs(tweaks) do if UnitDefNames[name] then - text = text .. '\n' .. valuecolor.. name..valuegreycolor..' = {' - text = text..stringifyDefTable(ud, {}, name) - text = text .. '\n' .. '}' + text = text .. "\n" .. valuecolor .. name .. valuegreycolor .. " = {" + text = text .. stringifyDefTable(ud, {}, name) + text = text .. "\n" .. "}" end end changedModoptions[key] = text @@ -143,8 +144,8 @@ local function SortFunc(myTable) tableInsert(a, n) end table.sort(a, f) - local i = 0 -- iterator variable - local iter = function () -- iterator function + local i = 0 -- iterator variable + local iter = function() -- iterator function i = i + 1 if a[i] == nil then return nil @@ -155,7 +156,7 @@ local function SortFunc(myTable) return iter end local t = {} - for key,value in pairsByKeys(myTable) do + for key, value in pairsByKeys(myTable) do tableInsert(t, { key = key, value = value }) end return t @@ -185,7 +186,7 @@ local widgetScale = (vsy / 1080) local fileLines = {} local totalFileLines = 0 -local showOnceMore = false -- used because of GUI shader delay +local showOnceMore = false -- used because of GUI shader delay local RectRound, UiElement, UiScroller, elementCorner @@ -199,8 +200,8 @@ function widget:ViewResize() screenX = mathFloor((vsx * 0.5) - (screenWidth / 2)) screenY = mathFloor((vsy * 0.5) + (screenHeight / 2)) - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner @@ -215,8 +216,8 @@ function widget:ViewResize() end function DrawTextarea(x, y, width, height, scrollbar) - local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top - local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom + local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top + local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom local scrollbarMargin = 14 * widgetScale local scrollbarWidth = 8 * widgetScale local scrollbarPosWidth = 4 * widgetScale @@ -238,14 +239,7 @@ function DrawTextarea(x, y, width, height, scrollbar) local scrollbarTop = y - scrollbarOffsetTop - scrollbarMargin local scrollbarBottom = y - scrollbarOffsetBottom - height + scrollbarMargin - UiScroller( - mathFloor(x + width - scrollbarMargin - scrollbarWidth), - mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), - mathFloor(x + width - scrollbarMargin), - mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), - (#fileLines-1) * (lineSeparator + fontSizeTitle), - (startLine-1) * (lineSeparator + fontSizeTitle) - ) + UiScroller(mathFloor(x + width - scrollbarMargin - scrollbarWidth), mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), mathFloor(x + width - scrollbarMargin), mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), (#fileLines - 1) * (lineSeparator + fontSizeTitle), (startLine - 1) * (lineSeparator + fontSizeTitle)) end end @@ -254,7 +248,7 @@ function DrawTextarea(x, y, width, height, scrollbar) font:Begin() local lineKey = startLine local j = 1 - while j < maxLines+1 do + while j < maxLines + 1 do -- maxlines is not exact, just a failsafe if (lineSeparator + fontSizeTitle) * j > height then break @@ -265,19 +259,19 @@ function DrawTextarea(x, y, width, height, scrollbar) local numLines local line = fileLines[lineKey] - if string.find(line, '::') then - local cmd = string.match(line, '^[ %+a-zA-Z0-9_-]*') -- escaping the escape: \\ doesnt work in lua !#$@&*()&5$# - local descr = string.sub(line, string.len(string.match(line, '^[ %+a-zA-Z0-9_-]*::') or '') + 1) + if string.find(line, "::") then + local cmd = string.match(line, "^[ %+a-zA-Z0-9_-]*") -- escaping the escape: \\ doesnt work in lua !#$@&*()&5$# + local descr = string.sub(line, string.len(string.match(line, "^[ %+a-zA-Z0-9_-]*::") or "") + 1) descr, numLines = font:WrapText(descr, (width - scrollbarMargin - scrollbarWidth - 250 - textRightOffset) * 0.65 * (loadedFontSize / fontSizeLine)) if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end font:SetTextColor(fontColorCommand) - font:Print(cmd, x + (18*widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") + font:Print(cmd, x + (18 * widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") font:SetTextColor(fontColorLine) - font:Print(descr, x + (screenWidth*0.58), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") + font:Print(descr, x + (screenWidth * 0.58), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") j = j + (numLines - 1) else -- line @@ -287,7 +281,7 @@ function DrawTextarea(x, y, width, height, scrollbar) if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end - font:Print(line, x + (18*widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") + font:Print(line, x + (18 * widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") j = j + (numLines - 1) end @@ -301,26 +295,23 @@ end function DrawWindow() -- title local titleFontSize = 18 * widgetScale - titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(Spring.I18N('ui.gameInfo.title')) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } + titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(Spring.I18N("ui.gameInfo.title")) * titleFontSize) + (titleFontSize * 1.5)), mathFloor(screenY + (titleFontSize * 1.7)) } - UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - font2:Print(Spring.I18N('ui.gameInfo.title'), screenX + (titleFontSize * 0.75), screenY + (8*widgetScale), titleFontSize, "on") + font2:Print(Spring.I18N("ui.gameInfo.title"), screenX + (titleFontSize * 0.75), screenY + (8 * widgetScale), titleFontSize, "on") font2:End() -- textarea DrawTextarea(screenX, screenY - (8 * widgetScale), screenWidth, screenHeight - (24 * widgetScale), 1) end - - function widget:DrawScreen() - -- draw the help if not mainDList then mainDList = gl.CreateList(DrawWindow) @@ -329,7 +320,7 @@ function widget:DrawScreen() if show or showOnceMore then -- draw the panel glCallList(mainDList) - if WG['guishader'] then + if WG["guishader"] then if backgroundGuishader then backgroundGuishader = glDeleteList(backgroundGuishader) end @@ -339,19 +330,18 @@ function widget:DrawScreen() -- title RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) end) - WG['guishader'].InsertDlist(backgroundGuishader, 'gameinfo') + WG["guishader"].InsertDlist(backgroundGuishader, "gameinfo") end showOnceMore = false local x, y, pressed = Spring.GetMouseState() if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) or math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") end - else if backgroundGuishader then - if WG['guishader'] then - WG['guishader'].RemoveDlist('gameinfo') + if WG["guishader"] then + WG["guishader"].RemoveDlist("gameinfo") end backgroundGuishader = glDeleteList(backgroundGuishader) end @@ -359,13 +349,12 @@ function widget:DrawScreen() end function widget:MouseWheel(up, value) - if show then local addLines = value * -3 -- direction is retarded startLine = startLine + addLines - if startLine > totalFileLines-maxLines then - startLine = totalFileLines-maxLines + if startLine > totalFileLines - maxLines then + startLine = totalFileLines - maxLines end if startLine < 1 then startLine = 1 @@ -407,8 +396,8 @@ end function toggle() local newShow = not show - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow @@ -416,25 +405,25 @@ function toggle() end local function refreshContent() - content = '' + content = "" content = content .. titlecolor .. Game.gameName .. valuegreycolor .. " (" .. Game.gameMutator .. ") " .. titlecolor .. Game.gameVersion .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.engine') .. separator .. valuegreycolor .. ((Game and Game.version) or (Engine and Engine.version) or Spring.I18N('ui.gameInfo.engineVersionError')) .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.engine") .. separator .. valuegreycolor .. ((Game and Game.version) or (Engine and Engine.version) or Spring.I18N("ui.gameInfo.engineVersionError")) .. "\n" content = content .. "\n" -- map info content = content .. titlecolor .. Game.mapName .. "\n" content = content .. valuegreycolor .. Game.mapDescription .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.size') .. separator .. valuegreycolor .. Game.mapX .. valuegreycolor .. " x " .. valuegreycolor .. Game.mapY .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.gravity') .. separator .. valuegreycolor .. Game.gravity .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.hardness') .. separator .. valuegreycolor .. Game.mapHardness .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.tidalStrength') .. separator .. valuegreycolor .. tidal .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.reclaimableMetal') .. separator .. valuegreycolor .. reclaimable_metal .. keycolor .. "\n" - content = content .. keycolor .. Spring.I18N('ui.gameInfo.reclaimableEnergy') .. separator .. valuegreycolor .. reclaimable_energy .. keycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.size") .. separator .. valuegreycolor .. Game.mapX .. valuegreycolor .. " x " .. valuegreycolor .. Game.mapY .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.gravity") .. separator .. valuegreycolor .. Game.gravity .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.hardness") .. separator .. valuegreycolor .. Game.mapHardness .. keycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.tidalStrength") .. separator .. valuegreycolor .. tidal .. keycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.reclaimableMetal") .. separator .. valuegreycolor .. reclaimable_metal .. keycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.reclaimableEnergy") .. separator .. valuegreycolor .. reclaimable_energy .. keycolor .. "\n" if Game.windMin == Game.windMax then - content = content .. keycolor .. Spring.I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.windStrength") .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. "\n" else - content = content .. keycolor .. Spring.I18N('ui.gameInfo.windStrength') .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. " - " .. valuegreycolor .. Game.windMax .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.windStrength") .. separator .. valuegreycolor .. Game.windMin .. valuegreycolor .. " - " .. valuegreycolor .. Game.windMax .. "\n" end local vcolor if Game.waterDamage == 0 then @@ -442,11 +431,11 @@ local function refreshContent() else vcolor = valuecolor end - content = content .. keycolor .. Spring.I18N('ui.gameInfo.waterDamage') .. separator .. vcolor .. Game.waterDamage .. keycolor .. "\n" + content = content .. keycolor .. Spring.I18N("ui.gameInfo.waterDamage") .. separator .. vcolor .. Game.waterDamage .. keycolor .. "\n" content = content .. "\n" if raptorsEnabled then -- filter raptor modoptions - content = content .. titlecolor .. Spring.I18N('ui.gameInfo.raptorOptions') .. "\n" + content = content .. titlecolor .. Spring.I18N("ui.gameInfo.raptorOptions") .. "\n" for key, params in pairs(changedRaptorModoptions) do content = content .. keycolor .. string.sub(params.key, 9) .. separator .. valuecolor .. params.value .. "\n" end @@ -455,9 +444,9 @@ local function refreshContent() end content = content .. "\n" end - content = content .. titlecolor .. Spring.I18N('ui.gameInfo.modOptions') .. "\n" + content = content .. titlecolor .. Spring.I18N("ui.gameInfo.modOptions") .. "\n" for key, params in pairs(changedModoptions) do - local name = params.key --modoptionsDefault[params.key].name + local name = params.key --modoptionsDefault[params.key].name content = content .. keycolor .. name .. separator .. valuecolor .. params.value .. "\n" end for key, params in pairs(unchangedModoptions) do @@ -470,11 +459,11 @@ local function refreshContent() end local function closeInfoHandler() - if show then - show = false + if show then + show = false - return true - end + return true + end end local spGetAllFeatures = Spring.GetAllFeatures @@ -498,21 +487,21 @@ end function widget:Initialize() refreshContent() - widgetHandler:AddAction("customgameinfo", toggle, nil, 'p') - widgetHandler:AddAction("customgameinfo_close", closeInfoHandler, nil, 'p') + widgetHandler:AddAction("customgameinfo", toggle, nil, "p") + widgetHandler:AddAction("customgameinfo_close", closeInfoHandler, nil, "p") - WG['gameinfo'] = {} - WG['gameinfo'].toggle = function(state) + WG["gameinfo"] = {} + WG["gameinfo"].toggle = function(state) local newShow = state if newShow == nil then newShow = not show end - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow end - WG['gameinfo'].isvisible = function() + WG["gameinfo"].isvisible = function() return show end @@ -527,8 +516,8 @@ function widget:Shutdown() glDeleteList(mainDList) mainDList = nil end - if WG['guishader'] then - WG['guishader'].RemoveDlist('gameinfo') + if WG["guishader"] then + WG["guishader"].RemoveDlist("gameinfo") end if backgroundGuishader then glDeleteList(backgroundGuishader) diff --git a/luaui/Widgets/gui_geothermalspots.lua b/luaui/Widgets/gui_geothermalspots.lua index 9d380684e3a..87aa1908982 100644 --- a/luaui/Widgets/gui_geothermalspots.lua +++ b/luaui/Widgets/gui_geothermalspots.lua @@ -2,18 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Geothermalspots", - desc = "Displays rotating circles around geothermal spots", - author = "Floris, Beherith GL4", - date = "August 2021", + name = "Geothermalspots", + desc = "Displays rotating circles around geothermal spots", + author = "Floris, Beherith GL4", + date = "August 2021", license = "GNU GPL v2", - layer = 2, + layer = 2, enabled = true, } end - - -- Localized functions for performance local mathSin = math.sin local mathCos = math.cos @@ -22,21 +20,21 @@ local mathCos = math.cos local spGetGameFrame = Spring.GetGameFrame local spGetSpectatingState = Spring.GetSpectatingState -local showValue = false -local metalViewOnly = false +local showValue = false +local metalViewOnly = false -local circleSpaceUsage = 0.82 -local circleInnerOffset = 0 -local opacity = 0.5 +local circleSpaceUsage = 0.82 +local circleInnerOffset = 0 +local opacity = 0.5 -local innersize = 3.0 -- outersize-innersize = circle width -local outersize = 3.32 -- outersize-innersize = circle width +local innersize = 3.0 -- outersize-innersize = circle width +local outersize = 3.32 -- outersize-innersize = circle width local spIsGUIHidden = Spring.IsGUIHidden local spGetUnitsInSphere = Spring.GetUnitsInSphere local spGetUnitDefID = Spring.GetUnitDefID local spGetGroundHeight = Spring.GetGroundHeight -local spGetMapDrawMode = Spring.GetMapDrawMode +local spGetMapDrawMode = Spring.GetMapDrawMode local spots = {} local numSpots = 0 @@ -83,7 +81,7 @@ local function checkGeothermalFeatures() showGeothermalUnits = true local x, y, z = spGetFeaturePosition(features[i]) spotCount = spotCount + 1 - spots[spotCount] = {x, y, z} + spots[spotCount] = { x, y, z } end end numSpots = spotCount @@ -95,8 +93,8 @@ end -- 1. Could a prerendered texture be better at conveying metal spot value? -- 2. VertexVBO contains: x, y pos, rotdir and radians in angle? -- 3. InstanceVBO contains: - --x,y,z offsets, radius, - -- visibility, and gameframe num of the last change teamid of occupier? +--x,y,z offsets, radius, +-- visibility, and gameframe num of the last change teamid of occupier? -- 4. the way the updates are handled are far from ideal, the construction and destruction of any mex will trigger a full update -- @@ -107,13 +105,11 @@ local spotShader = nil local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local pushElementInstance = InstanceVBOTable.pushElementInstance -local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO +local pushElementInstance = InstanceVBOTable.pushElementInstance +local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO local getElementInstanceData = InstanceVBOTable.getElementInstanceData - -local vsSrc = -[[ +local vsSrc = [[ #version 420 #line 10000 uniform float timer; @@ -157,8 +153,7 @@ void main() } ]] -local fsSrc = -[[ +local fsSrc = [[ #version 420 #line 20000 @@ -180,89 +175,131 @@ void main(void) ]] local function goodbye(reason) - Spring.Echo("Geothermalspots GL4 widget exiting with reason: "..reason) + Spring.Echo("Geothermalspots GL4 widget exiting with reason: " .. reason) widgetHandler:RemoveWidget() end local function makeSpotVBO() - spotVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if spotVBO == nil then goodbye("Failed to create spotVBO") end - local VBOLayout = { {id = 0, name = "localpos_dir_angle", size = 4},} + spotVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if spotVBO == nil then + goodbye("Failed to create spotVBO") + end + local VBOLayout = { { id = 0, name = "localpos_dir_angle", size = 4 } } local VBOData = {} - local n = 0 -- flat array write index + local n = 0 -- flat array write index local width = circleSpaceUsage local pieces = 3 - local detail = 13 -- per piece + local detail = 13 -- per piece local radstep = (2.0 * math.pi) / pieces local widthPerDetail = width / detail - for _,dir in ipairs({-1,1}) do + for _, dir in ipairs({ -1, 1 }) do local dirOffset = dir + 1 for i = 1, pieces do -- pieces for d = 1, detail do -- detail local detailPartWidth = (widthPerDetail * d) + dirOffset - local a1 = ((i+detailPartWidth - widthPerDetail) * radstep) - local a2 = ((i+detailPartWidth) * radstep) - (widthPerDetail*1.2) - local a3 = ((i+circleInnerOffset+detailPartWidth - widthPerDetail) * radstep) - (widthPerDetail*0.6) - local a4 = ((i+circleInnerOffset+detailPartWidth) * radstep) - (widthPerDetail*0.6) + local a1 = ((i + detailPartWidth - widthPerDetail) * radstep) + local a2 = ((i + detailPartWidth) * radstep) - (widthPerDetail * 1.2) + local a3 = ((i + circleInnerOffset + detailPartWidth - widthPerDetail) * radstep) - (widthPerDetail * 0.6) + local a4 = ((i + circleInnerOffset + detailPartWidth) * radstep) - (widthPerDetail * 0.6) -- Tri 1 vertex 1 - n=n+1; VBOData[n] = mathSin(a3)*innersize - n=n+1; VBOData[n] = mathCos(a3)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a3 + n = n + 1 + VBOData[n] = mathSin(a3) * innersize + n = n + 1 + VBOData[n] = mathCos(a3) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a3 -- Tri 1 vertices 2,3 (winding order depends on dir) if dir == 1 then - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a4 - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a1 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a4 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a1 else - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a1 - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a4 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a1 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a4 end -- Tri 2 vertices 1,2 (winding order depends on dir) if dir == -1 then - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a1 - n=n+1; VBOData[n] = mathSin(a2)*outersize - n=n+1; VBOData[n] = mathCos(a2)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a2 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a1 + n = n + 1 + VBOData[n] = mathSin(a2) * outersize + n = n + 1 + VBOData[n] = mathCos(a2) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a2 else - n=n+1; VBOData[n] = mathSin(a2)*outersize - n=n+1; VBOData[n] = mathCos(a2)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a2 - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a1 + n = n + 1 + VBOData[n] = mathSin(a2) * outersize + n = n + 1 + VBOData[n] = mathCos(a2) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a2 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a1 end -- Tri 2 vertex 3 - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = a4 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = a4 end end end - spotVBO:Define(n/4, VBOLayout) + spotVBO:Define(n / 4, VBOLayout) spotVBO:Upload(VBOData) - return spotVBO, n/4 + return spotVBO, n / 4 end local function cleanupGL4() @@ -271,8 +308,12 @@ local function cleanupGL4() spotShader = nil end if spotInstanceVBO then - if spotInstanceVBO.VAO then spotInstanceVBO.VAO:Delete() end - if spotInstanceVBO.instanceVBO then spotInstanceVBO.instanceVBO:Delete() end + if spotInstanceVBO.VAO then + spotInstanceVBO.VAO:Delete() + end + if spotInstanceVBO.instanceVBO then + spotInstanceVBO.instanceVBO:Delete() + end spotInstanceVBO = nil end if spotVBO then @@ -286,19 +327,18 @@ local function initGL4() local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - spotShader = LuaShader( - { - vertex = vsSrc, - fragment = fsSrc, - }, - "geoSpotShader GL4" - ) + spotShader = LuaShader({ + vertex = vsSrc, + fragment = fsSrc, + }, "geoSpotShader GL4") shaderCompiled = spotShader:Initialize() - if not shaderCompiled then goodbye("Failed to compile spotShader GL4 ") end - local spotVBO,numVertices = makeSpotVBO() + if not shaderCompiled then + goodbye("Failed to compile spotShader GL4 ") + end + local spotVBO, numVertices = makeSpotVBO() local spotInstanceVBOLayout = { - {id = 1, name = 'worldpos_radius', size = 4}, - {id = 2, name = 'visibility', size = 4}, + { id = 1, name = "worldpos_radius", size = 4 }, + { id = 2, name = "visibility", size = 4 }, } spotInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(spotInstanceVBOLayout, 8, "geoSpotInstanceVBO") spotInstanceVBO.numVertices = numVertices @@ -307,12 +347,11 @@ local function initGL4() spotInstanceVBO.primitiveType = GL.TRIANGLES end - local function checkGeothermalspots() local geoHeightChange = false - local now -- lazily initialized only if occupation changes + local now -- lazily initialized only if occupation changes local gf = spGetGameFrame() - for i=1, numSpots do + for i = 1, numSpots do local spot = spots[i] local sx, sy, sz = spot[1], spot[2], spot[3] local newHeight = spGetGroundHeight(sx, sz) @@ -324,7 +363,7 @@ local function checkGeothermalspots() local scale = spot[5] or 1 local units = spGetUnitsInSphere(sx, sy, sz, 110 * scale) local occupied = false - for j=1, #units do + for j = 1, #units do if extractors[spGetUnitDefID(units[j])] then occupied = true break @@ -332,7 +371,9 @@ local function checkGeothermalspots() end local prevOccupied = spot[6] or false if occupied ~= prevOccupied then - if not now then now = os.clock() end + if not now then + now = os.clock() + end spot[7] = now spot[6] = occupied local curSpotkey = spotKey(sx, sz) @@ -352,7 +393,7 @@ end function widget:ViewResize() local old_vsx, old_vsy = vsx, vsy - vsx,vsy = Spring.GetViewGeometry() + vsx, vsy = Spring.GetViewGeometry() if old_vsx ~= vsx or old_vsy ~= vsy then widget:Initialize() end @@ -393,34 +434,32 @@ function widget:Initialize() local currentClock = os.clock() local scale = 1 - for i=1, numSpots do + for i = 1, numSpots do local spot = spots[i] local sx, sz = spot[1], spot[3] - local units = spGetUnitsInSphere(sx, spot[2], sz, 115*scale) + local units = spGetUnitsInSphere(sx, spot[2], sz, 115 * scale) local occupied = false - for j=1, #units do + for j = 1, #units do if extractors[spGetUnitDefID(units[j])] then occupied = true break end end local y = spGetGroundHeight(sx, sz) - spots[i] = {sx, y, sz, 1, scale, occupied, currentClock} - pushElementInstance(spotInstanceVBO, {sx, y, sz, scale, occupied and 0 or 1, -1000,0,0}, spotKey(sx, sz)) + spots[i] = { sx, y, sz, 1, scale, occupied, currentClock } + pushElementInstance(spotInstanceVBO, { sx, y, sz, scale, occupied and 0 or 1, -1000, 0, 0 }, spotKey(sx, sz)) end end - function widget:Shutdown() cleanupGL4() WG.geothermalspots = nil end - function widget:RecvLuaMsg(msg, playerID) - if string.find(msg, 'LobbyOverlayActive', 1, true) == 1 then - chobbyInterface = (string.byte(msg, 19) == 49) -- '1' + if string.find(msg, "LobbyOverlayActive", 1, true) == 1 then + chobbyInterface = (string.byte(msg, 19) == 49) -- '1' end end @@ -442,7 +481,7 @@ end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if extractors[unitDefID] then - sceduledCheckedSpotsFrame = spGetGameFrame() + 3 -- delay needed, i don't know why + sceduledCheckedSpotsFrame = spGetGameFrame() + 3 -- delay needed, i don't know why end end @@ -452,13 +491,20 @@ function widget:GameFrame(gf) end end - function widget:DrawWorld() -- Draw after water so underwater spots are not distorted by the water shader. - if numSpots == 0 then return end - if chobbyInterface then return end - if spIsGUIHidden() then return end - if metalViewOnly and spGetMapDrawMode() ~= 'metal' then return end + if numSpots == 0 then + return + end + if chobbyInterface then + return + end + if spIsGUIHidden() then + return + end + if metalViewOnly and spGetMapDrawMode() ~= "metal" then + return + end gl.DepthTest(GL.LEQUAL) gl.DepthMask(false) @@ -476,7 +522,7 @@ function widget:GetConfigData(data) return { showValue = showValue, opacity = opacity, - metalViewOnly = metalViewOnly + metalViewOnly = metalViewOnly, } end diff --git a/luaui/Widgets/gui_given_units.lua b/luaui/Widgets/gui_given_units.lua index e862173027d..a593bd66c8f 100644 --- a/luaui/Widgets/gui_given_units.lua +++ b/luaui/Widgets/gui_given_units.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Given Units", - desc = "Tags given units with 'new' icon", - author = "Floris", - date = "24.04.2014", - license = "GNU GPL, v2 or later", - layer = -50, - enabled = true - } + return { + name = "Given Units", + desc = "Tags given units with 'new' icon", + author = "Floris", + date = "24.04.2014", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -21,51 +20,47 @@ local selectedFadeTime = 0.75 local timeoutFadeTime = 3 local timeoutTime = 6.5 - --TODO -- better icon because bloom makes the letters unreadable - -local glDrawListAtUnit = gl.DrawListAtUnit -local spIsGUIHidden = Spring.IsGUIHidden -local spGetUnitDefID = Spring.GetUnitDefID -local spIsUnitInView = Spring.IsUnitInView -local spGetCameraDirection = Spring.GetCameraDirection +local glDrawListAtUnit = gl.DrawListAtUnit +local spIsGUIHidden = Spring.IsGUIHidden +local spGetUnitDefID = Spring.GetUnitDefID +local spIsUnitInView = Spring.IsUnitInView +local spGetCameraDirection = Spring.GetCameraDirection local drawList local givenUnits = {} local unitScale = {} local unitHeight = {} local sec = 0 -local prevCam = {spGetCameraDirection()} +local prevCam = { spGetCameraDirection() } local myTeamID = Spring.GetLocalTeamID() local gameStarted, selectionChanged for udid, unitDef in pairs(UnitDefs) do local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 6*( xsize*xsize + zsize*zsize )^0.5 - unitScale[udid] = 7 + (scale/2.5) + local scale = 6 * (xsize * xsize + zsize * zsize) ^ 0.5 + unitScale[udid] = 7 + (scale / 2.5) unitHeight[udid] = unitDef.height end - function DrawIcon() local iconSize = 1 - gl.Translate(0,1,1.4) + gl.Translate(0, 1, 1.4) gl.Billboard() - gl.TexRect(-(iconSize/2), 0, (iconSize/2), iconSize) + gl.TexRect(-(iconSize / 2), 0, (iconSize / 2), iconSize) end - -- add unit-icon to unit function AddGivenUnit(unitID) local unitDefID = spGetUnitDefID(unitID) givenUnits[unitID] = {} - givenUnits[unitID].osClock = os.clock() - givenUnits[unitID].lastInViewClock = os.clock() - givenUnits[unitID].unitHeight = unitHeight[unitDefID] - givenUnits[unitID].unitScale = unitScale[unitDefID] + givenUnits[unitID].osClock = os.clock() + givenUnits[unitID].lastInViewClock = os.clock() + givenUnits[unitID].unitHeight = unitHeight[unitDefID] + givenUnits[unitID].unitScale = unitScale[unitDefID] end -------------------------------------------------------------------------------- @@ -98,7 +93,6 @@ function widget:Shutdown() gl.DeleteList(drawList) end - function widget:Update(dt) sec = sec + dt if sec > 0.25 then @@ -106,15 +100,15 @@ function widget:Update(dt) if selectionChanged then selectionChanged = nil local selectedUnitsCount = Spring.GetSelectedUnitsSorted() - for uDID,unit in pairs(selectedUnitsCount) do - for i=1,#unit do + for uDID, unit in pairs(selectedUnitsCount) do + for i = 1, #unit do local unitID = unit[i] if givenUnits[unitID] then local currentAlpha = 1 - ((os.clock() - (givenUnits[unitID].osClock + (timeoutTime - timeoutFadeTime))) / timeoutFadeTime) if currentAlpha > 1 then currentAlpha = 1 end - givenUnits[unitID].selected = os.clock() - (selectedFadeTime * (1 - currentAlpha)) + givenUnits[unitID].selected = os.clock() - (selectedFadeTime * (1 - currentAlpha)) --givenUnits[unitID].selectedGameSecs = Spring.GetGameSeconds() + UnitDefs[spGetUnitDefID(unitID)].selfDCountdown else -- uncomment line below for testing @@ -125,7 +119,7 @@ function widget:Update(dt) end local camX, camY, camZ = spGetCameraDirection() - if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then + if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then gl.DeleteList(drawList) drawList = gl.CreateList(DrawIcon) end @@ -134,13 +128,15 @@ function widget:Update(dt) end function widget:DrawWorld() - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end local osClock = os.clock() --local gameSecs = Spring.GetGameSeconds() gl.DepthMask(true) gl.DepthTest(true) - gl.Texture('LuaUI/Images/new.dds') + gl.Texture("LuaUI/Images/new.dds") local alpha for unitID, unit in pairs(givenUnits) do @@ -150,11 +146,10 @@ function widget:DrawWorld() alpha = 1 - ((osClock - (unit.osClock + (timeoutTime - timeoutFadeTime))) / timeoutFadeTime) end if spIsUnitInView(unitID) then - if alpha <= 0 then givenUnits[unitID] = nil else - gl.Color(1,1,1,alpha) + gl.Color(1, 1, 1, alpha) glDrawListAtUnit(unitID, drawList, false, unit.unitScale, unit.unitScale, unit.unitScale) end else @@ -166,7 +161,7 @@ function widget:DrawWorld() end end - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) gl.Texture(false) gl.DepthTest(false) gl.DepthMask(false) @@ -175,7 +170,7 @@ end local lastreceiveframe = 0 -- add given units function widget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) - if (newTeam == myTeamID) then + if newTeam == myTeamID then AddGivenUnit(unitID) if lastreceiveframe < spGetGameFrame() then local x, y, z = Spring.GetUnitPosition(unitID) @@ -187,8 +182,6 @@ function widget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) end end - function widget:SelectionChanged(sel) selectionChanged = true end - diff --git a/luaui/Widgets/gui_gridmenu.lua b/luaui/Widgets/gui_gridmenu.lua index f34e6b07286..334a0c163fc 100644 --- a/luaui/Widgets/gui_gridmenu.lua +++ b/luaui/Widgets/gui_gridmenu.lua @@ -108,12 +108,12 @@ local modKeyMultiplier = { click = { ctrl = 20, shift = 5, - right = -1 + right = -1, }, keyPress = { ctrl = -1, - shift = 5 - } + shift = 5, + }, } ------------------------------------------------------------------------------- @@ -154,7 +154,7 @@ local costOverrides = {} ------------------------------------------------------------------------------- include("keysym.h.lua") -local unitBlocking = VFS.Include('luaui/Include/unitBlocking.lua') +local unitBlocking = VFS.Include("luaui/Include/unitBlocking.lua") local keyConfig = VFS.Include("luaui/configs/keyboard_layouts.lua") local currentLayout = Spring.GetConfigString("KeyboardLayout", "qwerty") @@ -294,7 +294,6 @@ local isPregame local units = VFS.Include("luaui/configs/unit_buildmenu_config.lua") local grid = VFS.Include("luaui/configs/gridmenu_config.lua") - local unitBuildOptions = {} local unitMetal_extractor = {} local unitTranslatedHumanName = {} @@ -395,9 +394,7 @@ end local function updateHoverState() local x, y, left, _, right = Spring.GetMouseState() local isAboveBg = backgroundRect:contains(x, y) - local isAboveBuilders = not isAboveBg - and selectedBuildersCount > 1 - and (buildersRect:contains(x, y) or nextBuilderRect:contains(x, y)) + local isAboveBuilders = not isAboveBg and selectedBuildersCount > 1 and (buildersRect:contains(x, y) or nextBuilderRect:contains(x, y)) if isAboveBuilders then Spring.SetMouseCursor("cursornormal") @@ -416,11 +413,7 @@ local function updateHoverState() break end - setHoveredRectTooltip( - rect, - unitTranslatedTooltip[rect.opts.uDefID], - unitTranslatedHumanName[rect.opts.uDefID] - ) + setHoveredRectTooltip(rect, unitTranslatedTooltip[rect.opts.uDefID], unitTranslatedHumanName[rect.opts.uDefID]) return end @@ -482,10 +475,7 @@ local function updateHoverState() if not currentCategory and not builderIsFactory then for cat, catRect in pairs(catRects) do if catRect:contains(x, y) then - local text = categoryTooltips[cat] - .. "\255\240\240\240 - Hotkey: \255\215\255\215[" - .. catRect.opts.keyText - .. "]" + local text = categoryTooltips[cat] .. "\255\240\240\240 - Hotkey: \255\215\255\215[" .. catRect.opts.keyText .. "]" setHoveredRectTooltip(catRect, text, cat) @@ -660,9 +650,7 @@ local function updateGrid() -- well reindex the cellsidsperudef uDefCellIds = {} - local showHotkeys = (builderIsFactory and not useLabBuildMode) - or (builderIsFactory and useLabBuildMode and labBuildModeActive) - or (activeBuilder and currentCategory) + local showHotkeys = (builderIsFactory and not useLabBuildMode) or (builderIsFactory and useLabBuildMode and labBuildModeActive) or (activeBuilder and currentCategory) local offset = (currentPage - 1) * cellCount @@ -757,12 +745,7 @@ local function setupCells() arow = col < 3 and 2 or 1 acol = 6 - col % 2 end - cellRects[cellRectID]:set( - buildpicsRect.x + (acol - 1) * cellSize, - buildpicsRect.yEnd - (rows - arow + 1) * cellSize, - buildpicsRect.x + acol * cellSize, - buildpicsRect.yEnd - (rows - arow) * cellSize - ) + cellRects[cellRectID]:set(buildpicsRect.x + (acol - 1) * cellSize, buildpicsRect.yEnd - (rows - arow + 1) * cellSize, buildpicsRect.x + acol * cellSize, buildpicsRect.yEnd - (rows - arow) * cellSize) end end end @@ -776,13 +759,7 @@ local function setupCategoryRects() for i, cat in ipairs(CONFIG.buildCategories) do local y1 = categoriesRect.yEnd - i * contentHeight + 2 - catRects[cat]:set( - x1, - y1, - x1 + contentWidth - activeAreaMargin, - y1 + contentHeight - 2, - defaultCategoryOpts[i] - ) + catRects[cat]:set(x1, y1, x1 + contentWidth - activeAreaMargin, y1 + contentHeight - 2, defaultCategoryOpts[i]) end local y1 = ((categoriesRect.yEnd - categoriesRect.y) / 2) - (contentHeight / 2) @@ -795,21 +772,10 @@ local function setupCategoryRects() for i, cat in ipairs(CONFIG.buildCategories) do local x1 = categoriesRect.x + (i - 1) * buttonWidth - catRects[cat]:set( - x1, - y2 - categoryButtonHeight + padding, - x1 + buttonWidth, - y2 - activeAreaMargin - padding, - defaultCategoryOpts[i] - ) + catRects[cat]:set(x1, y2 - categoryButtonHeight + padding, x1 + buttonWidth, y2 - activeAreaMargin - padding, defaultCategoryOpts[i]) end local x1 = (math.round(categoriesRect.xEnd - categoriesRect.x) / 2) - (buttonWidth / 2) - currentCategoryRect:set( - x1, - y2 - categoryButtonHeight + padding, - x1 + buttonWidth, - y2 - activeAreaMargin - padding - ) + currentCategoryRect:set(x1, y2 - categoryButtonHeight + padding, x1 + buttonWidth, y2 - activeAreaMargin - padding) end end @@ -949,9 +915,7 @@ end -- Helper function for iterating over the actions with builder and factory tags, -- with GetActionHotKeys those tags will be missed and the hotkey wont work local function getGridKey(action) - local key = getActionHotkey(action) - or getActionHotkey(action .. " builder") - or getActionHotkey(action .. " factory") + local key = getActionHotkey(action) or getActionHotkey(action .. " builder") or getActionHotkey(action .. " factory") return key end @@ -997,8 +961,7 @@ local function setLabBuildMode(value) end local function setActiveCommand(cmd, button, leftClick, rightClick) - local didChangeCmd = button and Spring.SetActiveCommand(cmd, button, leftClick, rightClick, Spring.GetModKeyState()) - or Spring.SetActiveCommand(cmd) + local didChangeCmd = button and Spring.SetActiveCommand(cmd, button, leftClick, rightClick, Spring.GetModKeyState()) or Spring.SetActiveCommand(cmd) if not didChangeCmd then Spring.Echo(" Unable to change active command", cmd) @@ -1087,7 +1050,7 @@ local function queueUnit(uDefID, opts, quantity) for unitDefID, unitIds in pairs(sel) do if units.isFactory[unitDefID] then for _, uid in ipairs(unitIds) do - for _ = 1,quantity do + for _ = 1, quantity do spGiveOrderToUnit(uid, -uDefID, 0, opts) end end @@ -1137,7 +1100,7 @@ local function multiQueue(uDefID, quantity, cap, opts) if quantity >= cap then multiqueue_quantity = math.floor(quantity / cap) queueUnit(uDefID, opts, multiqueue_quantity) - quantity = math.fmod(quantity,cap) + quantity = math.fmod(quantity, cap) end return quantity end @@ -1176,7 +1139,7 @@ local function gridmenuKeyHandler(_, _, args, _, isRepeat) end if WG.Quotas and WG.Quotas.isOnQuotaMode(activeBuilderID) and not alt then - updateQuotaNumber(uDefID,quantity) + updateQuotaNumber(uDefID, quantity) return true else if args[3] and args[3] == "builder" then @@ -1193,11 +1156,11 @@ local function gridmenuKeyHandler(_, _, args, _, isRepeat) Spring.PlaySoundFile(CONFIG.sound_queue_add, 0.75, "ui") end --if quantity is more than 100, more than 20 or more than 5 then use engine logic for better performance (fewer for loops inside queueUnit()) - quantity = multiQueue(uDefID,quantity,100,{ "ctrl","shift", alt and "alt", removing and "right" }) - quantity = multiQueue(uDefID,quantity,20,{ "ctrl", alt and "alt", removing and "right" }) - quantity = multiQueue(uDefID,quantity,5,{ "shift", alt and "alt", removing and "right" }) + quantity = multiQueue(uDefID, quantity, 100, { "ctrl", "shift", alt and "alt", removing and "right" }) + quantity = multiQueue(uDefID, quantity, 20, { "ctrl", alt and "alt", removing and "right" }) + quantity = multiQueue(uDefID, quantity, 5, { "shift", alt and "alt", removing and "right" }) --queue the remaining units - multiQueue(uDefID,quantity,1,{ alt and "alt", removing and "right" }) + multiQueue(uDefID, quantity, 1, { alt and "alt", removing and "right" }) return true end @@ -1311,7 +1274,6 @@ function widget:Initialize() doUpdateClock = os.clock() - widgetHandler.actionHandler:AddAction(self, "gridmenu_key", gridmenuKeyHandler, nil, "pR") widgetHandler.actionHandler:AddAction(self, "gridmenu_category", gridmenuCategoryHandler, nil, "p") widgetHandler.actionHandler:AddAction(self, "gridmenu_next_page", nextPageHandler, nil, "p") @@ -1480,7 +1442,9 @@ function widget:Initialize() ---@param unitDefID number The unit definition ID to highlight. ---@param color number[]? Optional {r,g,b} in 0..1. Defaults to a warm yellow. local function setHighlight(unitDefID, color) - if not unitDefID then return end + if not unitDefID then + return + end local items = highlight.items if not items[unitDefID] then highlight.count = highlight.count + 1 @@ -1573,7 +1537,7 @@ function widget:ViewResize() activeAreaMargin = math_ceil(bgpadding * CONFIG.activeAreaMargin) - font2 = WG['fonts'].getFont(2) + font2 = WG["fonts"].getFont(2) for i, rectOpts in ipairs(defaultCategoryOpts) do defaultCategoryOpts[i].nameHeight = font2:GetTextHeight(rectOpts.name) @@ -1603,36 +1567,16 @@ function widget:ViewResize() -- assemble rects left to right categoriesRect:set(posX + bgpadding, posYEnd, posX + categoryWidth, posY - bgpadding) - buildpicsRect:set( - categoriesRect.xEnd + bgpadding, - posYEnd, - categoriesRect.xEnd + (cellSize * columns) + bgpadding, - posY - bgpadding - ) + buildpicsRect:set(categoriesRect.xEnd + bgpadding, posYEnd, categoriesRect.xEnd + (cellSize * columns) + bgpadding, posY - bgpadding) backgroundRect:set(posX, posYEnd, buildpicsRect.xEnd + bgpadding, posY) local buttonHeight = categoriesRect:getHeight() / 4 - backRect:set( - categoriesRect.x, - categoriesRect.yEnd - buttonHeight + bgpadding, - categoriesRect.xEnd, - categoriesRect.yEnd - ) + backRect:set(categoriesRect.x, categoriesRect.yEnd - buttonHeight + bgpadding, categoriesRect.xEnd, categoriesRect.yEnd) - nextPageRect:set( - categoriesRect.x, - categoriesRect.y + bgpadding, - categoriesRect.xEnd, - categoriesRect.y + buttonHeight - bgpadding - ) + nextPageRect:set(categoriesRect.x, categoriesRect.y + bgpadding, categoriesRect.xEnd, categoriesRect.y + buttonHeight - bgpadding) - labBuildModeRect:set( - categoriesRect.x, - categoriesRect.y + buttonHeight + bgpadding, - categoriesRect.xEnd, - categoriesRect.yEnd - bgpadding - ) + labBuildModeRect:set(categoriesRect.x, categoriesRect.y + buttonHeight + bgpadding, categoriesRect.xEnd, categoriesRect.yEnd - bgpadding) -- start with no width and grow dynamically buildersRect:set(posX, backgroundRect.yEnd, posX, backgroundRect.yEnd + builderButtonSize) @@ -1661,48 +1605,23 @@ function widget:ViewResize() categoryButtonHeight = categoryButtonHeight * 1.4 -- assemble rects, bottom to top - categoriesRect:set( - posX + bgpadding, - posYEnd + bgpadding, - posXEnd - bgpadding, - posYEnd + categoryButtonHeight + bgpadding - ) + categoriesRect:set(posX + bgpadding, posYEnd + bgpadding, posXEnd - bgpadding, posYEnd + categoryButtonHeight + bgpadding) rows = 3 columns = 4 cellSize = math_floor((width - (bgpadding * 2)) / columns) - buildpicsRect:set( - posX + bgpadding, - categoriesRect.yEnd, - posXEnd - bgpadding, - categoriesRect.yEnd + (cellSize * rows) - ) + buildpicsRect:set(posX + bgpadding, categoriesRect.yEnd, posXEnd - bgpadding, categoriesRect.yEnd + (cellSize * rows)) backgroundRect:set(posX, posYEnd, posXEnd, math_floor(buildpicsRect.yEnd + (bgpadding * 1.5))) local buttonWidth = (categoriesRect.xEnd - categoriesRect.x) / 3 local padding = math_max(1, math_floor(bgpadding * 0.52)) - backRect:set( - categoriesRect.x, - categoriesRect.y + padding, - categoriesRect.x + buttonWidth - (bgpadding * 2), - categoriesRect.yEnd - padding - ) + backRect:set(categoriesRect.x, categoriesRect.y + padding, categoriesRect.x + buttonWidth - (bgpadding * 2), categoriesRect.yEnd - padding) - nextPageRect:set( - categoriesRect.xEnd - buttonWidth + (2 * bgpadding), - categoriesRect.y + padding, - categoriesRect.xEnd, - categoriesRect.yEnd - padding - ) + nextPageRect:set(categoriesRect.xEnd - buttonWidth + (2 * bgpadding), categoriesRect.y + padding, categoriesRect.xEnd, categoriesRect.yEnd - padding) - labBuildModeRect:set( - categoriesRect.x, - categoriesRect.y + padding, - nextPageRect.x - (2 * bgpadding), - categoriesRect.yEnd - padding - ) + labBuildModeRect:set(categoriesRect.x, categoriesRect.y + padding, nextPageRect.x - (2 * bgpadding), categoriesRect.yEnd - padding) -- start with no width and grow dynamically buildersRect:set(posX, backgroundRect.yEnd, posX, backgroundRect.yEnd + builderButtonSize) @@ -1786,14 +1705,7 @@ function widget:Update(dt) ordermenuLeft = math_floor((oposX + owidth) * vsx) ordermenuHeight = oheight end - if - not prevAdvplayerlistLeft - or advplayerlistLeft ~= prevAdvplayerlistLeft - or not prevOrdermenuLeft - or ordermenuLeft ~= prevOrdermenuLeft - or not prevOrdermenuHeight - or ordermenuHeight ~= prevOrdermenuHeight - then + if not prevAdvplayerlistLeft or advplayerlistLeft ~= prevAdvplayerlistLeft or not prevOrdermenuLeft or ordermenuLeft ~= prevOrdermenuLeft or not prevOrdermenuHeight or ordermenuHeight ~= prevOrdermenuHeight then widget:ViewResize() if not isPregame then updateBuilders() -- builder rects are defined dynamically @@ -1814,11 +1726,11 @@ function widget:Update(dt) buildmenuShows = true end - if WG['guishader'] and prevBuildmenuShows ~= buildmenuShows and dlistGuishader then + if WG["guishader"] and prevBuildmenuShows ~= buildmenuShows and dlistGuishader then if buildmenuShows then - WG['guishader'].InsertDlist(dlistGuishader, 'buildmenu') + WG["guishader"].InsertDlist(dlistGuishader, "buildmenu") else - WG['guishader'].RemoveDlist('buildmenu') + WG["guishader"].RemoveDlist("buildmenu") end end @@ -1862,32 +1774,11 @@ end local function drawBuildMenuBg() local height = backgroundRect.yEnd - backgroundRect.y local posY = backgroundRect.y - UiElement( - backgroundRect.x, - backgroundRect.y, - backgroundRect.xEnd, - backgroundRect.yEnd, - (backgroundRect.x > 0 and (#builderRects > 1 and 0 or 1) or 0), - 1, - ((posY - height > 0 or backgroundRect.x <= 0) and 1 or 0), - 0 - ) + UiElement(backgroundRect.x, backgroundRect.y, backgroundRect.xEnd, backgroundRect.yEnd, (backgroundRect.x > 0 and (#builderRects > 1 and 0 or 1) or 0), 1, ((posY - height > 0 or backgroundRect.x <= 0) and 1 or 0), 0) if selectedBuildersCount > 1 and activeBuilder then height = backgroundRect:getHeight() - UiElement( - buildersRect.x, - buildersRect.y, - buildersRect.xEnd + bgpadding * 2, - buildersRect.yEnd + bgpadding + (iconMargin * 2), - (backgroundRect.x > 0 and 1 or 0), - 1, - ((posY - height > 0 or backgroundRect.x <= 0) and 1 or 0), - 0, - 1, - 1, - 0 - ) + UiElement(buildersRect.x, buildersRect.y, buildersRect.xEnd + bgpadding * 2, buildersRect.yEnd + bgpadding + (iconMargin * 2), (backgroundRect.x > 0 and 1 or 0), 1, ((posY - height > 0 or backgroundRect.x <= 0) and 1 or 0), 0, 1, 1, 0) end end @@ -1917,20 +1808,7 @@ local function drawButton(rect) local icon = ":l:" .. rect.opts.icon gl.Color(dim, dim, dim, 0.9) gl.Texture(icon) - gl.BeginEnd( - GL.QUADS, - TexRectRound, - rect.x + (bgpadding / 2), - rect.yEnd - iconSize, - rect.x + iconSize, - rect.yEnd - (bgpadding / 2), - 0, - 0, - 0, - 0, - 0, - 0.05 - ) -- this method with a lil zoom prevents faint edges aroudn the image + gl.BeginEnd(GL.QUADS, TexRectRound, rect.x + (bgpadding / 2), rect.yEnd - iconSize, rect.x + iconSize, rect.yEnd - (bgpadding / 2), 0, 0, 0, 0, 0, 0.05) -- this method with a lil zoom prevents faint edges aroudn the image -- gl.TexRect(px, sy - iconSize, px + iconSize, sy) gl.Texture(false) end @@ -1942,38 +1820,16 @@ local function drawButton(rect) if hovered then -- gloss highlight gl.Blending(GL_SRC_ALPHA, GL_ONE) - RectRound( - rect.x, - rect.yEnd - ((rect.yEnd - rect.y) * 0.42), - rect.xEnd, - rect.yEnd, - padding * 1.5, - 2, - 2, - 0, - 0, - { 1, 1, 1, 0.035 }, - { 1, 1, 1, (disableInput and 0.11 or 0.24) } - ) - RectRound( - rect.x, - rect.y, - rect.xEnd, - rect.y + ((rect.yEnd - rect.y) * 0.5), - padding * 1.5, - 0, - 0, - 2, - 2, - { 1, 1, 1, (disableInput and 0.035 or 0.075) }, - { 1, 1, 1, 0 } - ) + RectRound(rect.x, rect.yEnd - ((rect.yEnd - rect.y) * 0.42), rect.xEnd, rect.yEnd, padding * 1.5, 2, 2, 0, 0, { 1, 1, 1, 0.035 }, { 1, 1, 1, (disableInput and 0.11 or 0.24) }) + RectRound(rect.x, rect.y, rect.xEnd, rect.y + ((rect.yEnd - rect.y) * 0.5), padding * 1.5, 0, 0, 2, 2, { 1, 1, 1, (disableInput and 0.035 or 0.075) }, { 1, 1, 1, 0 }) gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end end local function drawHighlights() - if highlight.count == 0 or not next(highlight.items) then return end + if highlight.count == 0 or not next(highlight.items) then + return + end local now = os.clock() for uDefID, hl in pairs(highlight.items) do local cellId = uDefCellIds[uDefID] @@ -1993,7 +1849,7 @@ local function drawHighlights() local brighten = 0.10 + 0.22 * pulse gl.Blending(GL_SRC_ALPHA, GL_ONE) gl.Color(r * brighten, g * brighten, b * brighten, 1) - gl.Texture('#' .. uDefID) + gl.Texture("#" .. uDefID) UiUnit(x1, y1, x2, y2, cornerSize, 1, 1, 1, 1, defaultCellZoom) gl.Texture(false) @@ -2008,11 +1864,7 @@ local function drawHighlights() -- Soft inner glow fading inward local glowAlpha = 0.10 + 0.20 * pulse local glowWidth = thickness * 3 - WG.FlowUI.Draw.RectRoundOutline( - x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, - math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, - { r, g, b, glowAlpha }, { r, g, b, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, { r, g, b, glowAlpha }, { r, g, b, 0 }) gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end @@ -2062,13 +1914,13 @@ local function drawCell(rect) end -- unit icon - local texprefix = '' + local texprefix = "" if disabled then gl.Color(0.4, 0.4, 0.4, 1) - texprefix = 't0.3,0.3,0.3' + texprefix = "t0.3,0.3,0.3" elseif underConstructionDim then gl.Color(0.77, 0.77, 0.77, 1) - texprefix = 't0.63,0.63,0.63' + texprefix = "t0.63,0.63,0.63" else gl.Color(1, 1, 1, 1) end @@ -2076,57 +1928,17 @@ local function drawCell(rect) local groupIcon = rect.opts.groupIcon local unitGroup = rect.opts.unitGroup - UiUnit( - rect.x + cellPadding + iconPadding, - rect.y + cellPadding + iconPadding, - rect.xEnd - cellPadding - iconPadding, - rect.yEnd - cellPadding - iconPadding, - cornerSize, - 1, - 1, - 1, - 1, - usedZoom, - nil, - disabled and 0 or nil, - "#" .. uid, - groupIcon and (groupIcon and ":l" .. texprefix .. ":" .. groupIcon or nil) or nil, - unitGroup and (unitGroup and ":l" .. texprefix .. ":" .. unitGroup or nil) or nil, - { rect.opts.metalCost, rect.opts.energyCost }, - tonumber(queuenr) - ) + UiUnit(rect.x + cellPadding + iconPadding, rect.y + cellPadding + iconPadding, rect.xEnd - cellPadding - iconPadding, rect.yEnd - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom, nil, disabled and 0 or nil, "#" .. uid, groupIcon and (groupIcon and ":l" .. texprefix .. ":" .. groupIcon or nil) or nil, unitGroup and (unitGroup and ":l" .. texprefix .. ":" .. unitGroup or nil) or nil, { rect.opts.metalCost, rect.opts.energyCost }, tonumber(queuenr)) -- colorize/highlight unit icon if cellColor then gl.Blending(GL.DST_ALPHA, GL.ONE_MINUS_SRC_COLOR) gl.Color(cellColor[1], cellColor[2], cellColor[3], cellColor[4]) gl.Texture("#" .. uid) - UiUnit( - rect.x + cellPadding + iconPadding, - rect.y + cellPadding + iconPadding, - rect.xEnd - cellPadding - iconPadding, - rect.yEnd - cellPadding - iconPadding, - cornerSize, - 1, - 1, - 1, - 1, - usedZoom - ) + UiUnit(rect.x + cellPadding + iconPadding, rect.y + cellPadding + iconPadding, rect.xEnd - cellPadding - iconPadding, rect.yEnd - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom) if cellColor[4] > 0 then gl.Blending(GL_SRC_ALPHA, GL_ONE) - UiUnit( - rect.x + cellPadding + iconPadding, - rect.y + cellPadding + iconPadding, - rect.xEnd - cellPadding - iconPadding, - rect.yEnd - cellPadding - iconPadding, - cornerSize, - 1, - 1, - 1, - 1, - usedZoom - ) + UiUnit(rect.x + cellPadding + iconPadding, rect.y + cellPadding + iconPadding, rect.xEnd - cellPadding - iconPadding, rect.yEnd - cellPadding - iconPadding, cornerSize, 1, 1, 1, 1, usedZoom) end gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end @@ -2147,23 +1959,11 @@ local function drawCell(rect) end local costPrice = formatPrice(math.floor(topValue)) local costPriceText = costColor .. costPrice - font2:Print( - costPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 1.35), - priceFontSize, - "ro" - ) + font2:Print(costPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 1.35), priceFontSize, "ro") elseif not costOverride.top then local metalColor = disabled and "\255\125\125\125" or "\255\245\245\245" local metalPriceText = metalColor .. metalPrice - font2:Print( - metalPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 1.35), - priceFontSize, - "ro" - ) + font2:Print(metalPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 1.35), priceFontSize, "ro") end if costOverride.bottom and not costOverride.bottom.disabled then @@ -2173,43 +1973,19 @@ local function drawCell(rect) end local costPrice = formatPrice(math.floor(bottomValue)) local costPriceText = costColor .. costPrice - font2:Print( - costPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 0.35), - priceFontSize, - "ro" - ) + font2:Print(costPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 0.35), priceFontSize, "ro") elseif not costOverride.bottom then local energyColor = disabled and "\255\135\135\135" or "\255\255\255\000" local energyPriceText = energyColor .. energyPrice - font2:Print( - energyPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 0.35), - priceFontSize, - "ro" - ) + font2:Print(energyPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 0.35), priceFontSize, "ro") end else local metalColor = disabled and "\255\125\125\125" or "\255\245\245\245" local energyColor = disabled and "\255\135\135\135" or "\255\255\255\000" local metalPriceText = metalColor .. metalPrice local energyPriceText = energyColor .. energyPrice - font2:Print( - metalPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 1.35), - priceFontSize, - "ro" - ) - font2:Print( - energyPriceText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.y + cellPadding + (priceFontSize * 0.35), - priceFontSize, - "ro" - ) + font2:Print(metalPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 1.35), priceFontSize, "ro") + font2:Print(energyPriceText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.y + cellPadding + (priceFontSize * 0.35), priceFontSize, "ro") end end @@ -2219,13 +1995,7 @@ local function drawCell(rect) if hotkeyText then local keyFontSize = priceFontSize * 1.1 local hotkeyColor = disabled and "\255\100\100\100" or "\255\215\255\215" - font2:Print( - hotkeyColor .. hotkeyText, - rect.xEnd - cellPadding - (cellInnerSize * 0.048), - rect.yEnd - cellPadding - keyFontSize, - keyFontSize, - "ro" - ) + font2:Print(hotkeyColor .. hotkeyText, rect.xEnd - cellPadding - (cellInnerSize * 0.048), rect.yEnd - cellPadding - keyFontSize, keyFontSize, "ro") end -- factory queue number @@ -2246,13 +2016,7 @@ local function drawCell(rect) { 0.15, 0.15, 0.15, 0.95 }, { 0.25, 0.25, 0.25, 0.95 } ) - font2:Print( - "\255\190\255\190" .. queuenr, - rect.x + cellPadding + textPad, - rect.y + cellPadding + math_floor(cellInnerSize * 0.735), - queueFontSize, - "o" - ) + font2:Print("\255\190\255\190" .. queuenr, rect.x + cellPadding + textPad, rect.y + cellPadding + math_floor(cellInnerSize * 0.735), queueFontSize, "o") end if quotaNumber and quotaNumber ~= 0 then @@ -2262,7 +2026,7 @@ local function drawCell(rect) local textWidth = font2:GetTextWidth(quotaText) * queueFontSize if textWidth > 0.75 * cellInnerSize then local newFontSize = queueFontSize * 0.75 * cellInnerSize / textWidth - textPad = textPad * newFontSize/queueFontSize + textPad = textPad * newFontSize / queueFontSize textWidth = font2:GetTextWidth(quotaText) * newFontSize queueFontSize = newFontSize end @@ -2279,13 +2043,7 @@ local function drawCell(rect) { 0.15, 0.15, 0.15, 0.95 }, { 0.25, 0.25, 0.25, 0.95 } ) - font2:Print( - "\255\255\130\190" .. quotaText, - rect.x + cellPadding + textPad, - rect.y + cellPadding + (math_floor(cellInnerSize * 0.365) - font2:GetTextHeight(quotaNumber)*queueFontSize)/2, - queueFontSize, - "o" - ) + font2:Print("\255\255\130\190" .. quotaText, rect.x + cellPadding + textPad, rect.y + cellPadding + (math_floor(cellInnerSize * 0.365) - font2:GetTextHeight(quotaNumber) * queueFontSize) / 2, queueFontSize, "o") end end @@ -2300,13 +2058,7 @@ local function drawButtonHotkey(rect) local textPadding = bgpadding * 2 local text = "\255\215\255\215" .. rect.opts.keyText - font2:Print( - text, - rect.xEnd - textPadding, - (rect.y - (rect.y - rect.yEnd) / 2) - keyFontHeightOffset, - hotkeyFontSize, - "ro" - ) + font2:Print(text, rect.xEnd - textPadding, (rect.y - (rect.y - rect.yEnd) / 2) - keyFontHeightOffset, hotkeyFontSize, "ro") end local function drawCategories() @@ -2316,13 +2068,7 @@ local function drawCategories() local fontHeight = rect.opts.nameHeight * categoryFontSize local fontHeightOffset = fontHeight * 0.34 - font2:Print( - rect.opts.name, - rect.x + (bgpadding * 7), - (rect.y + rect:getHeight() / 2) - fontHeightOffset, - categoryFontSize, - "o" - ) + font2:Print(rect.opts.name, rect.x + (bgpadding * 7), (rect.y + rect:getHeight() / 2) - fontHeightOffset, categoryFontSize, "o") drawButton(rect) @@ -2334,13 +2080,7 @@ local function drawCategories() local fontHeight = rect.opts.nameHeight * categoryFontSize local fontHeightOffset = fontHeight * 0.34 - font2:Print( - rect.opts.name, - rect.x + (bgpadding * 7), - (rect.y + rect:getHeight() / 2) - fontHeightOffset, - categoryFontSize, - "o" - ) + font2:Print(rect.opts.name, rect.x + (bgpadding * 7), (rect.y + rect:getHeight() / 2) - fontHeightOffset, categoryFontSize, "o") if not rect.current then drawButtonHotkey(rect) @@ -2378,13 +2118,7 @@ local function drawPageButtons() local fontHeight = font2:GetTextHeight(nextPageText) * pageFontSize local fontHeightOffset = fontHeight * 0.34 - font2:Print( - nextPageText, - nextPageRect.x + (bgpadding * 3), - (nextPageRect.y + (buttonHeight / 2)) - fontHeightOffset, - pageFontSize, - "o" - ) + font2:Print(nextPageText, nextPageRect.x + (bgpadding * 3), (nextPageRect.y + (buttonHeight / 2)) - fontHeightOffset, pageFontSize, "o") drawButtonHotkey(nextPageRect) drawButton(nextPageRect) @@ -2413,18 +2147,11 @@ local function drawBuildModeButtons() if stickToBottom then local rect = labBuildModeRect local fullText = "\255\245\245\245" .. "Enable Build Mode" - local buildModeText, _ = - font2:WrapText(fullText, categoriesRect:getWidth() - (bgpadding * 2), nil, pageFontSize * 1.1) + local buildModeText, _ = font2:WrapText(fullText, categoriesRect:getWidth() - (bgpadding * 2), nil, pageFontSize * 1.1) local buttonHeight = rect:getHeight() local fontHeight = font2:GetTextHeight(buildModeText) * pageFontSize local fontHeightOffset = fontHeight * 0.24 - font2:Print( - buildModeText, - rect.x + (bgpadding * 3), - (rect.y + (buttonHeight / 2)) - fontHeightOffset, - pageFontSize, - "n" - ) + font2:Print(buildModeText, rect.x + (bgpadding * 3), (rect.y + (buttonHeight / 2)) - fontHeightOffset, pageFontSize, "n") -- draw hotkeys differently for this button local keyFontHeight = font2:GetTextHeight(hotkeys) * hotkeyFontSize @@ -2440,13 +2167,7 @@ local function drawBuildModeButtons() local buttonHeight = labBuildModeRect:getHeight() local fontHeight = font2:GetTextHeight(buildModeText) * pageFontSize local fontHeightOffset = fontHeight * 0.24 - font2:Print( - buildModeText, - labBuildModeRect.x + (bgpadding * 3), - (labBuildModeRect.y + (buttonHeight / 2)) - fontHeightOffset, - pageFontSize, - "o" - ) + font2:Print(buildModeText, labBuildModeRect.x + (bgpadding * 3), (labBuildModeRect.y + (buttonHeight / 2)) - fontHeightOffset, pageFontSize, "o") labBuildModeRect.opts.keyText = hotkeys labBuildModeRect.opts.keyTextHeight = font2:GetTextHeight(hotkeys) @@ -2471,69 +2192,30 @@ local function drawBuilder(rect) local rectSize = rect.xEnd - rect.x gl.Color(lightness, lightness, lightness, 1) - UiUnit( - rect.x, - rect.y, - rect.xEnd, - rect.yEnd, - math.ceil(bgpadding * 0.5), - 1, - 1, - 1, - 1, - zoom, - nil, - math_max(0.1, highlightOpacity or 0.1), - "#" .. unitDefID, - nil, - nil, - nil, - nil - ) + UiUnit(rect.x, rect.y, rect.xEnd, rect.yEnd, math.ceil(bgpadding * 0.5), 1, 1, 1, 1, zoom, nil, math_max(0.1, highlightOpacity or 0.1), "#" .. unitDefID, nil, nil, nil, nil) -- builder count number if count > 1 then local countFontSize = rectSize * 0.3 local pad = math_floor(rectSize * 0.03) - font2:Print( - "\255\240\240\240" .. count, - rect.x + (pad * 2), - rect.y + pad + math_floor(countFontSize * 2.2), - countFontSize, - "o" - ) + font2:Print("\255\240\240\240" .. count, rect.x + (pad * 2), rect.y + pad + math_floor(countFontSize * 2.2), countFontSize, "o") end if highlightOpacity then gl.Blending(GL_SRC_ALPHA, GL_ONE) gl.Color(1, 1, 1, highlightOpacity) - RectRound( - rect.x, - rect.y, - rect.xEnd, - rect.yEnd, - math_min(math_max(1, math_floor((rect.xEnd - rect.x) * 0.024)), math_floor((vsy * 0.0015) + 0.5)) - ) + RectRound(rect.x, rect.y, rect.xEnd, rect.yEnd, math_min(math_max(1, math_floor((rect.xEnd - rect.x) * 0.024)), math_floor((vsy * 0.0015) + 0.5))) gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end -- construction progress overlay on the active builder icon if rect.opts.current and backgroundRect.opts.builderUnderConstruction then gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - RectRoundProgress( - rect.x, - rect.y, - rect.xEnd, - rect.yEnd, - math_min(math_max(1, math_floor((rect.xEnd - rect.x) * 0.024)), math_floor((vsy * 0.0015) + 0.5)), - 1 - (backgroundRect.opts.builderProgress or 0), - { 0.05, 0.05, 0.05, 0.72 } - ) + RectRoundProgress(rect.x, rect.y, rect.xEnd, rect.yEnd, math_min(math_max(1, math_floor((rect.xEnd - rect.x) * 0.024)), math_floor((vsy * 0.0015) + 0.5)), 1 - (backgroundRect.opts.builderProgress or 0), { 0.05, 0.05, 0.05, 0.72 }) end end local function drawBuilders() - -- draw builders for i = 1, selectedBuildersCount do drawBuilder(builderRects[i]) @@ -2544,13 +2226,7 @@ local function drawBuilders() local fontSize = rectHeight * 1.2 local textHeight = nextBuilderRect.opts.nameHeight * fontSize - font2:Print( - "\255\255\255\255" .. nextBuilderRect.opts.name, - nextBuilderRect.x + math_floor(rectHeight * 0.2), - nextBuilderRect.y + (rectHeight / 2) - math_floor(textHeight / 2), - fontSize, - "o" - ) + font2:Print("\255\255\255\255" .. nextBuilderRect.opts.name, nextBuilderRect.x + math_floor(rectHeight * 0.2), nextBuilderRect.y + (rectHeight / 2) - math_floor(textHeight / 2), fontSize, "o") drawButton(nextBuilderRect) drawButtonHotkey(nextBuilderRect) @@ -2564,11 +2240,10 @@ end local function drawBuildMenu() font2:Begin(true) - font2:SetTextColor(1,1,1,1) - font2:SetOutlineColor(0,0,0,1) + font2:SetTextColor(1, 1, 1, 1) + font2:SetOutlineColor(0, 0, 0, 1) - local drawBackScreen = (currentCategory and not builderIsFactory) - or (builderIsFactory and useLabBuildMode and labBuildModeActive) + local drawBackScreen = (currentCategory and not builderIsFactory) or (builderIsFactory and useLabBuildMode and labBuildModeActive) if activeBuilder and not builderIsFactory then drawCategories() @@ -2656,10 +2331,7 @@ function widget:MousePress(x, y, button) return end - if - (buildmenuShows and backgroundRect:contains(x, y)) - or (selectedBuildersCount > 1 and (buildersRect:contains(x, y) or nextBuilderRect:contains(x, y))) - then + if (buildmenuShows and backgroundRect:contains(x, y)) or (selectedBuildersCount > 1 and (buildersRect:contains(x, y) or nextBuilderRect:contains(x, y))) then if activeBuilder then if pages > 1 then if nextPageRect and nextPageRect:contains(x, y) then @@ -2715,12 +2387,7 @@ function widget:MousePress(x, y, button) for _, cellRect in pairs(cellRects) do local unitDefID = cellRect.opts.uDefID - if - unitDefID - and unitTranslatedHumanName[unitDefID] - and cellRect:contains(x, y) - and not cellRect.opts.disabled - then + if unitDefID and unitTranslatedHumanName[unitDefID] and cellRect:contains(x, y) and not cellRect.opts.disabled then local alt, ctrl, meta, shift = Spring.GetModKeyState() if button ~= 3 then if builderIsFactory and WG.Quotas and WG.Quotas.isOnQuotaMode(activeBuilderID) and not alt then @@ -2744,8 +2411,12 @@ function widget:MousePress(x, y, button) elseif builderIsFactory and spGetCmdDescIndex(-unitDefID) then local function decreaseQuota() local amount = modKeyMultiplier.click.right - if ctrl then amount = amount * modKeyMultiplier.click.ctrl end - if shift then amount = amount * modKeyMultiplier.click.shift end + if ctrl then + amount = amount * modKeyMultiplier.click.ctrl + end + if shift then + amount = amount * modKeyMultiplier.click.shift + end updateQuotaNumber(unitDefID, amount) end @@ -2801,23 +2472,11 @@ local function checkGuishaderBuilders() dlistGuishaderBuildersNext = gl.DeleteList(dlistGuishaderBuildersNext) end dlistGuishaderBuilders = gl.CreateList(function() - RectRound( - buildersRect.x, - buildersRect.y, - buildersRect.xEnd + (bgpadding * 2), - buildersRect.yEnd + bgpadding + (iconMargin * 2), - elementCorner - ) + RectRound(buildersRect.x, buildersRect.y, buildersRect.xEnd + (bgpadding * 2), buildersRect.yEnd + bgpadding + (iconMargin * 2), elementCorner) end) WG["guishader"].InsertDlist(dlistGuishaderBuilders, "buildmenubuilders") dlistGuishaderBuildersNext = gl.CreateList(function() - RectRound( - nextBuilderRect.x, - nextBuilderRect.y, - nextBuilderRect.xEnd, - nextBuilderRect.yEnd, - elementCorner * 0.5 - ) + RectRound(nextBuilderRect.x, nextBuilderRect.y, nextBuilderRect.xEnd, nextBuilderRect.yEnd, elementCorner * 0.5) end) WG["guishader"].InsertDlist(dlistGuishaderBuildersNext, "buildmenubuildersnext") end @@ -2847,7 +2506,6 @@ function widget:DrawScreen() end end else - if WG["guishader"] then if dlistGuishader then WG["guishader"].InsertDlist(dlistGuishader, "buildmenu") @@ -2859,40 +2517,34 @@ function widget:DrawScreen() if redraw then redraw = nil if not buildmenuBgTex then - buildmenuBgTex = gl.CreateTexture(math_floor(backgroundRect.xEnd-backgroundRect.x), math_floor(buildersRectYend-backgroundRect.y), { + buildmenuBgTex = gl.CreateTexture(math_floor(backgroundRect.xEnd - backgroundRect.x), math_floor(buildersRectYend - backgroundRect.y), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end if buildmenuBgTex then - gl.R2tHelper.RenderToTexture(buildmenuBgTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / math_floor(backgroundRect.xEnd-backgroundRect.x), 2 / math_floor(buildersRectYend-backgroundRect.y), 0) - gl.Translate(-backgroundRect.x, -backgroundRect.y, 0) - drawBuildMenuBg() - end, - true - ) + gl.R2tHelper.RenderToTexture(buildmenuBgTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / math_floor(backgroundRect.xEnd - backgroundRect.x), 2 / math_floor(buildersRectYend - backgroundRect.y), 0) + gl.Translate(-backgroundRect.x, -backgroundRect.y, 0) + drawBuildMenuBg() + end, true) end if not buildmenuTex then - buildmenuTex = gl.CreateTexture(math_floor(backgroundRect.xEnd-backgroundRect.x)*2, math_floor(buildersRectYend-backgroundRect.y)*2, { --*(vsy<1400 and 2 or 2) + buildmenuTex = gl.CreateTexture(math_floor(backgroundRect.xEnd - backgroundRect.x) * 2, math_floor(buildersRectYend - backgroundRect.y) * 2, { --*(vsy<1400 and 2 or 2) target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end if buildmenuTex then - gl.R2tHelper.RenderToTexture(buildmenuTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / math_floor(backgroundRect.xEnd-backgroundRect.x), 2 / math_floor(buildersRectYend-backgroundRect.y), 0) - gl.Translate(-backgroundRect.x, -backgroundRect.y, 0) - drawBuildMenu() - end, - true - ) + gl.R2tHelper.RenderToTexture(buildmenuTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / math_floor(backgroundRect.xEnd - backgroundRect.x), 2 / math_floor(buildersRectYend - backgroundRect.y), 0) + gl.Translate(-backgroundRect.x, -backgroundRect.y, 0) + drawBuildMenu() + end, true) end end if buildmenuBgTex then diff --git a/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua b/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua index d39581bfcd9..8e95f5001c3 100644 --- a/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua +++ b/luaui/Widgets/gui_ground_ao_plates_features_gl4.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState @@ -22,7 +21,6 @@ local decalAlpha = 0.66 --------------- Atlas textures ---------------- - local atlas = VFS.Include("unittextures/decals_features/featureaoplates_atlas.lua") local getUVCoords = atlas.getUVCoords atlas.flip(atlas) @@ -31,26 +29,25 @@ local atlassedImages = {} local featureDefIDtoDecalInfo = {} -- key unitdef, table of {texfile = "", sizex = 4 , sizez = 4} -- remember, we can use xXyY = gl.GetAtlasTexture(atlasID, texture) to query the atlas -local function basepath(s,pattern) - while string.find(s, pattern, 1, true ) do - s = string.sub(s, string.find(s, pattern, 1, true) + 1 ) +local function basepath(s, pattern) + while string.find(s, pattern, 1, true) do + s = string.sub(s, string.find(s, pattern, 1, true) + 1) end return s end local function addDirToAtlas(atlas, path) - --spEcho("Adding",#files, "images to atlas from", path) - for i=1, #files do - if imgExts[string.sub(files[i],-3,-1)] then - local s3oname = basepath(files[i],'/') - if string.find(s3oname, "_dead", 1 , true) then + for i = 1, #files do + if imgExts[string.sub(files[i], -3, -1)] then + local s3oname = basepath(files[i], "/") + if string.find(s3oname, "_dead", 1, true) then --spEcho('s3oname',s3oname) - s3oname = string.sub(s3oname, 1, string.find(s3oname, "_dead", 1 , true) + 4) + s3oname = string.sub(s3oname, 1, string.find(s3oname, "_dead", 1, true) + 4) atlassedImages[s3oname] = files[i] - elseif string.find(s3oname, "arm.x.._._", 1) or string.find(s3oname, "cor.x.._._", 1) then - s3oname = string.sub(s3oname, 1,7) - + elseif string.find(s3oname, "arm.x.._._", 1) or string.find(s3oname, "cor.x.._._", 1) then + s3oname = string.sub(s3oname, 1, 7) + --spEcho('s3oname',s3oname) atlassedImages[s3oname] = files[i] else @@ -63,16 +60,15 @@ end local function makeAtlas() for filename, uvs in pairs(atlas) do - if type(uvs) == "table" then - - local s3oname = basepath(filename,'/') - if string.find(s3oname, "_dead", 1 , true) then + if type(uvs) == "table" then + local s3oname = basepath(filename, "/") + if string.find(s3oname, "_dead", 1, true) then --spEcho('s3oname',s3oname) - s3oname = string.sub(s3oname, 1, string.find(s3oname, "_dead", 1 , true) + 4) + s3oname = string.sub(s3oname, 1, string.find(s3oname, "_dead", 1, true) + 4) atlassedImages[s3oname] = filename - elseif string.find(s3oname, "arm.x.._._", 1) or string.find(s3oname, "cor.x.._._", 1) then - s3oname = string.sub(s3oname, 1,7) - + elseif string.find(s3oname, "arm.x.._._", 1) or string.find(s3oname, "cor.x.._._", 1) then + s3oname = string.sub(s3oname, 1, 7) + --spEcho('s3oname',s3oname) atlassedImages[s3oname] = filename else @@ -91,7 +87,7 @@ local luaShaderDir = "LuaUI/Include/" local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local glTexture = gl.Texture local glCulling = gl.Culling @@ -103,29 +99,46 @@ local function AddPrimitiveAtUnit(featureID, featureDefID, noUpload) local gf = Spring.GetGameFrame() featureDefID = featureDefID or Spring.GetFeatureDefID(featureID) - if featureDefID == nil or featureDefIDtoDecalInfo[featureDefID] == nil then return end -- these cant have plates + if featureDefID == nil or featureDefIDtoDecalInfo[featureDefID] == nil then + return + end -- these cant have plates local decalInfo = featureDefIDtoDecalInfo[featureDefID] - + --local texname = "unittextures/decals/".. UnitDefs[featureDefID].name .. "_aoplane.dds" --unittextures/decals/armllt_aoplane.dds local numVertices = 4 -- default to circle local additionalheight = 0 - - local p,q,s,t = getUVCoords(atlas, decalInfo.texfile) + + local p, q, s, t = getUVCoords(atlas, decalInfo.texfile) --spEcho (featureDefID,featureID,decalInfo.texfile, decalInfo.sizez, decalInfo.sizex , decalInfo.alpha, p, q, s,t) - + pushElementInstance( groundPlateVBO, -- push into this Instance VBO Table - {decalInfo.sizez, decalInfo.sizex, 0, additionalheight, -- lengthwidthcornerheight + { + decalInfo.sizez, + decalInfo.sizex, + 0, + additionalheight, -- lengthwidthcornerheight 0, --Spring.GetUnitTeam(featureID), -- teamID numVertices, -- how many trianges should we make - gf, 0, decalInfo.alpha * decalAlpha, 0, -- the gameFrame (for animations), and any other parameters one might want to add - q,p,t,s, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in + gf, + 0, + decalInfo.alpha * decalAlpha, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + q, + p, + t, + s, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in featureID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element noUpload, -- noupload, dont use unless you know what you want to batch push/pop - featureID) -- last one should be featureID! + featureID + ) -- last one should be featureID! end local function ProcessAllFeatures() @@ -139,13 +152,13 @@ local function ProcessAllFeatures() end local firstRun = true function widget:DrawWorldPreUnit() - if firstRun then + if firstRun then glTexture(0, atlas.atlasimage) glTexture(0, false) firstRun = false end - - if groundPlateVBO.usedElements > 0 then + + if groundPlateVBO.usedElements > 0 then local disticon = Spring.GetConfigInt("FeatureFadeDistance", 200) -- iconLength = unitIconDist * unitIconDist * 750.0f; glCulling(GL_BACK) glDepthTest(GL_LEQUAL) @@ -153,9 +166,9 @@ function widget:DrawWorldPreUnit() --glDepthTest(false) glTexture(0, atlas.atlasimage) groundPlateShader:Activate() - groundPlateShader:SetUniform("iconDistance",disticon) - groundPlateShader:SetUniform("addRadius",0) - groundPlateVBO.VAO:DrawArrays(GL.POINTS,groundPlateVBO.usedElements) + groundPlateShader:SetUniform("iconDistance", disticon) + groundPlateShader:SetUniform("addRadius", 0) + groundPlateVBO.VAO:DrawArrays(GL.POINTS, groundPlateVBO.usedElements) groundPlateShader:Deactivate() glTexture(0, false) glCulling(false) @@ -181,7 +194,6 @@ function widget:FeatureDestroyed(featureID) RemovePrimitive(featureID) end - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() @@ -189,41 +201,38 @@ function widget:Initialize() end makeAtlas() --if true then return end - local knownheaps3os = {['arm3x3'] = 1} - for id , featureDefID in pairs(FeatureDefs) do + local knownheaps3os = { ["arm3x3"] = 1 } + for id, featureDefID in pairs(FeatureDefs) do local FD = FeatureDefs[id] - if FD.modelname and (string.find(FD.modelname:lower(), "_dead", nil, true) or string.find(FD.name, "_heap", nil, true) ) then -- todo TREES! + if FD.modelname and (string.find(FD.modelname:lower(), "_dead", nil, true) or string.find(FD.name, "_heap", nil, true)) then -- todo TREES! -- lets see if we can find an image for this one! - local modelnamenos3o = string.gsub(string.lower(FD.modelname), ".s3o","") - modelnamenos3o = basepath(modelnamenos3o,'/') + local modelnamenos3o = string.gsub(string.lower(FD.modelname), ".s3o", "") + modelnamenos3o = basepath(modelnamenos3o, "/") --spEcho(FD.name, modelnamenos3o, atlassedImages[modelnamenos3o] ) if atlassedImages[modelnamenos3o] then --spEcho(modelnamenos3o,atlassedImages[modelnamenos3o]) - local atlasname = basepath(atlassedImages[modelnamenos3o],'/') + local atlasname = basepath(atlassedImages[modelnamenos3o], "/") local sizestr = "" if string.find(atlasname, "_dead", nil, true) then -- regular wrecks - sizestr = string.sub(atlasname, - (string.find(atlasname, "_dead", nil, true) or 0) + 6, - string.find(atlasname, "_aoplane.dds", nil, true)-1) + sizestr = string.sub(atlasname, (string.find(atlasname, "_dead", nil, true) or 0) + 6, string.find(atlasname, "_aoplane.dds", nil, true) - 1) else -- heaps override - sizestr = string.sub(atlasname,9,11) + sizestr = string.sub(atlasname, 9, 11) end - - --spEcho(atlasname, modelnamenos3o, sizestr) - local sizex = string.sub(sizestr, 1, string.find(sizestr, "_", nil, true)-1) - local sizez = string.sub(sizestr, string.find(sizestr, "_", nil, true)+1 ) + + --spEcho(atlasname, modelnamenos3o, sizestr) + local sizex = string.sub(sizestr, 1, string.find(sizestr, "_", nil, true) - 1) + local sizez = string.sub(sizestr, string.find(sizestr, "_", nil, true) + 1) --spEcho(sizex, sizez) featureDefIDtoDecalInfo[id] = { texfile = atlassedImages[modelnamenos3o], - sizex = (sizex or 8) *16, - sizez = (sizez or 8) *16, + sizex = (sizex or 8) * 16, + sizez = (sizez or 8) * 16, alpha = 1.0, } end - - elseif FD.customParams then - if FD.customParams.decalinfo_texfile then + elseif FD.customParams then + if FD.customParams.decalinfo_texfile then featureDefIDtoDecalInfo[id] = { texfile = atlassedImages[FD.customParams.decalinfo_texfile], sizex = (tonumber(FD.customParams.decalinfo_sizex) or 5) * 16, @@ -233,14 +242,14 @@ function widget:Initialize() end end end - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 0 shaderConfig.HEIGHTOFFSET = 0 shaderConfig.TRANSPARENCY = 1.0 shaderConfig.ANIMATION = 0 - shaderConfig.FULL_ROTATION = 1 + shaderConfig.FULL_ROTATION = 1 shaderConfig.CLIPTOLERANCE = 1.2 -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader --shaderConfig.POST_VERTEX = "v_parameters.w = max(-0.2, sin(timeInfo.x * 2.0/30.0 + (v_centerpos.x + v_centerpos.z) * 0.1)) + 0.2; // match CUS glow rate" @@ -250,12 +259,12 @@ function widget:Initialize() shaderConfig.USE_CIRCLES = nil shaderConfig.USE_CORNERRECT = nil groundPlateVBO, groundPlateShader = InitDrawPrimitiveAtUnit(shaderConfig, "Ground AO Plates Features") - if groundPlateVBO == nil then + if groundPlateVBO == nil then widgetHandler:RemoveWidget() return end groundPlateVBO.featureIDs = true - ProcessAllFeatures() + ProcessAllFeatures() end local spec, fullview = spGetSpectatingState() @@ -270,32 +279,28 @@ end local commandqueue = {} function widget:TextCommand(command) - if string.find(command,"givefeatures", nil, true ) then - local s = string.split(command, ' ') + if string.find(command, "givefeatures", nil, true) then + local s = string.split(command, " ") spEcho("/luaui givefeatures featurename") local key = s[2] local matches = {} - for featureDefID, featureDef in ipairs(FeatureDefs) do - if string.find(featureDef.name,key, nil, true) then - matches[#matches+1] = featureDef.name + for featureDefID, featureDef in ipairs(FeatureDefs) do + if string.find(featureDef.name, key, nil, true) then + matches[#matches + 1] = featureDef.name end end if #matches > 0 then local mx, my, mb = Spring.GetMouseState() - local _, coords = Spring.TraceScreenRay(mx, my, true) + local _, coords = Spring.TraceScreenRay(mx, my, true) local maxx = math.ceil(math.sqrt(#matches)) local size = 80 local i = 1 - if coords then - for z= coords[3], coords[3] + size * maxx, size do - for x= coords[1], coords[1] + size * maxx, size do - if i <= #matches then - commandqueue[#commandqueue+1] = string.format('give %s @%d,%d,%d', - matches[i], - x, - Spring.GetGroundHeight(x,z), - z) - i=i+1 + if coords then + for z = coords[3], coords[3] + size * maxx, size do + for x = coords[1], coords[1] + size * maxx, size do + if i <= #matches then + commandqueue[#commandqueue + 1] = string.format("give %s @%d,%d,%d", matches[i], x, Spring.GetGroundHeight(x, z), z) + i = i + 1 end end end @@ -305,10 +310,8 @@ function widget:TextCommand(command) end function widget:GameFrame() - if #commandqueue > 0 then - Spring.SendCommands({commandqueue[#commandqueue]}) + if #commandqueue > 0 then + Spring.SendCommands({ commandqueue[#commandqueue] }) commandqueue[#commandqueue] = nil end end - - diff --git a/luaui/Widgets/gui_ground_ao_plates_gl4.lua b/luaui/Widgets/gui_ground_ao_plates_gl4.lua index 454c65bd8d9..b89850f69d4 100644 --- a/luaui/Widgets/gui_ground_ao_plates_gl4.lua +++ b/luaui/Widgets/gui_ground_ao_plates_gl4.lua @@ -9,11 +9,10 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", layer = -1, enabled = true, - depends = {'gl4'}, + depends = { "gl4" }, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -32,7 +31,7 @@ local luaShaderDir = "LuaUI/Include/" local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local debugmode = false @@ -47,29 +46,46 @@ local GL_POINTS = GL.POINTS local spGetUnitDefID = Spring.GetUnitDefID local spGetGameFrame = Spring.GetGameFrame -local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload,reason) +local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason) local gf = spGetGameFrame() unitDefID = unitDefID or spGetUnitDefID(unitID) - if unitDefID == nil or unitDefIDtoDecalInfo[unitDefID] == nil then return end -- these cant/dont have plates + if unitDefID == nil or unitDefIDtoDecalInfo[unitDefID] == nil then + return + end -- these cant/dont have plates local decalInfo = unitDefIDtoDecalInfo[unitDefID] - local p,q,s,t = getUVCoords(atlas, decalInfo.texfile) + local p, q, s, t = getUVCoords(atlas, decalInfo.texfile) --spEcho(decalInfo.texfile, p,q,s,t) return pushElementInstance( groundPlateVBO, -- push into this Instance VBO Table - {decalInfo.sizey, decalInfo.sizex, 0, 0, -- length, width, cornersize, height + { + decalInfo.sizey, + decalInfo.sizex, + 0, + 0, -- length, width, cornersize, height 0, -- Spring.GetUnitTeam(unitID), -- teamID, but its not used here so just pass zero 4, -- how many vertices should we make (4 is a quad) - gf, 0, decalInfo.alpha, 0, -- the gameFrame (for animations), and any other parameters one might want to add - q,p,t,s, -- These are our default UV atlas tranformations, note how Y axis is flipped for atlas - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in + gf, + 0, + decalInfo.alpha, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + q, + p, + t, + s, -- These are our default UV atlas tranformations, note how Y axis is flipped for atlas + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in unitID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element noUpload, -- noupload, this is used when reinitializing everything on VisibleUnitsChanged - unitID) -- last one should be UNITID! + unitID + ) -- last one should be UNITID! end local firstRun = true @@ -86,7 +102,7 @@ function widget:DrawWorldPreUnit() glDepthMask(false) --"BK OpenGL state resets", default is already false, could remove glTexture(0, atlas.atlasimage) groundPlateShader:Activate() - groundPlateVBO.VAO:DrawArrays(GL_POINTS,groundPlateVBO.usedElements) + groundPlateVBO.VAO:DrawArrays(GL_POINTS, groundPlateVBO.usedElements) groundPlateShader:Deactivate() glTexture(0, false) glCulling(false) @@ -101,25 +117,25 @@ function widget:Initialize() --makeAtlas() -- Init the unitDefIDtoDecalInfo - for id , UD in pairs(UnitDefs) do + for id, UD in pairs(UnitDefs) do if UD.customParams and UD.customParams.usebuildinggrounddecal and UD.customParams.buildinggrounddecaltype then --local UD.name local texname = "unittextures/" .. UD.customParams.buildinggrounddecaltype --spEcho(texname) if atlas[texname] then unitDefIDtoDecalInfo[id] = { - texfile = texname, - -- note that this is hacky, as customparams are always strings, but multiplying number with stringnumber is number - sizex = (UD.customParams.buildinggrounddecalsizex or 0.0 ) * 16, - sizey = (UD.customParams.buildinggrounddecalsizey or 0.0 ) * 16, - alpha = (UD.customParams.buildinggrounddecalalpha or 1.0 ) * groundaoplatealpha, - } + texfile = texname, + -- note that this is hacky, as customparams are always strings, but multiplying number with stringnumber is number + sizex = (UD.customParams.buildinggrounddecalsizex or 0.0) * 16, + sizey = (UD.customParams.buildinggrounddecalsizey or 0.0) * 16, + alpha = (UD.customParams.buildinggrounddecalalpha or 1.0) * groundaoplatealpha, + } end end end -- Init GL4 things - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 0 @@ -144,8 +160,8 @@ function widget:Initialize() end -- Add all units - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end @@ -163,9 +179,10 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) end function widget:VisibleUnitRemoved(unitID) -- remove the corresponding ground plate if it exists - if debugmode then Spring.Debug.TraceEcho("remove",unitID,reason) end + if debugmode then + Spring.Debug.TraceEcho("remove", unitID, reason) + end if groundPlateVBO.instanceIDtoIndex[unitID] then popElementInstance(groundPlateVBO, unitID) end end - diff --git a/luaui/Widgets/gui_healthbars_gl4.lua b/luaui/Widgets/gui_healthbars_gl4.lua index 4fbd33fc5b2..2e1c0900bd8 100644 --- a/luaui/Widgets/gui_healthbars_gl4.lua +++ b/luaui/Widgets/gui_healthbars_gl4.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Health Bars GL4", - desc = "Yes this healthbars, just gl4", - author = "Beherith", - date = "October 2019", - license = "GNU GPL v2", - layer = -10, - enabled = true - } + return { + name = "Health Bars GL4", + desc = "Yes this healthbars, just gl4", + author = "Beherith", + date = "October 2019", + license = "GNU GPL v2", + layer = -10, + enabled = true, + } end - -- Localized functions for performance local mathMin = math.min @@ -29,9 +28,9 @@ local spIsPosInLos = Spring.IsPosInLos -- wellity wellity the time has come, and yes, this is design documentation -- what can we do with 64 verts per healthbars? - -- 9 verts bg - -- 9 verts fg - -- 20 verts for numbers like an asshole +-- 9 verts bg +-- 9 verts fg +-- 20 verts for numbers like an asshole -- fade bars in and out based on last modified times of values? -- what info do we need outputted from GS? -- for fg/bg @@ -43,24 +42,23 @@ local spIsPosInLos = Spring.IsPosInLos -- use billboards, -- THE TYPES OF UNIT BARS: - -- timer based, all these need a start and (predicted) end time. - -- EMP time left - -- 3 floats, start, end, empdamage - -- needs update on every fucking unitdamaged callin - -- handle cases where uni is empd outside of view? - - - -- reload - -- 2 floats, lastshot, nextshot - -- time left in construction - -- this is a special hybrid bar added on unitcreated, and removed on unitfinished... - -- 2 floats, buildpct, eta? (eta could get liveupdated cause unitfinished?) - -- static percentage based: - -- health -- - -- emp damage - -- capture - -- stockpile build progress - -- shield +-- timer based, all these need a start and (predicted) end time. +-- EMP time left +-- 3 floats, start, end, empdamage +-- needs update on every fucking unitdamaged callin +-- handle cases where uni is empd outside of view? + +-- reload +-- 2 floats, lastshot, nextshot +-- time left in construction +-- this is a special hybrid bar added on unitcreated, and removed on unitfinished... +-- 2 floats, buildpct, eta? (eta could get liveupdated cause unitfinished?) +-- static percentage based: +-- health -- +-- emp damage +-- capture +-- stockpile build progress +-- shield -- stuff that needs to occupy a contiguouis stretch in the user uniforms: @@ -73,11 +71,11 @@ local spIsPosInLos = Spring.IsPosInLos -- local _, reloaded, reloadFrame = GetUnitWeaponState(unitID, ci.primaryWeapon) -- Features can only have: Health, reclaim and resurrectprogress - in fact they should be completely separate bar ids, and all of them are static percentage based - -- feature resurrect -- this list must be handled in-widget, maintained and updated accordingly for in-los features. - -- advanced concepts include priority watch lists of features actively being resurrected (or hooking into allowcommand, but that is garbage!) +-- feature resurrect -- this list must be handled in-widget, maintained and updated accordingly for in-los features. +-- advanced concepts include priority watch lists of features actively being resurrected (or hooking into allowcommand, but that is garbage!) - -- feature health - -- feature reclaim +-- feature health +-- feature reclaim -- AllowFeatureBuildStep() called when wreck is resurrected -- Spring.GetFeatureHealth ( number featureID ) @@ -85,86 +83,84 @@ local spIsPosInLos = Spring.IsPosInLos --Spring.GetFeatureResources ( number featureID ) --return: nil | number RemainingMetal, number maxMetal, number RemainingEnergy, number maxEnergy, number reclaimLeft, number reclaimTime - - -- the vertex shader: - -- Job of the VS: - -- read the data and position - -- identify if the bar needs to be drawn based on : - -- visibility of unit - -- distance of bar - -- value of the bar - -- the colormap of the bar needs to be interpolated here from a fixed define string? - --[[ -- https://community.khronos.org/t/constant-vec3-array-no-go/60184/8 +-- Job of the VS: +-- read the data and position +-- identify if the bar needs to be drawn based on : +-- visibility of unit +-- distance of bar +-- value of the bar +-- the colormap of the bar needs to be interpolated here from a fixed define string? +--[[ -- https://community.khronos.org/t/constant-vec3-array-no-go/60184/8 vec3 MyArray[4]=vec3[4]( vec3(1.5,34.4,3.2), vec3(1.6,34.1,1.2), vec3(18.981777,6.258294,-27.141813), vec3(1.0,3.0,1.0) ); - ]]-- - -- - -- VS input: - -- uint barindex - -- this is the index of how manyeth bar it is in the list, where 0 is always health. and if an additional bar is needed, then increment accordingly - -- uint bartype - -- this is for where to get the colortable and 'icon' from - -- float unitheight - -- for correct offsetting - -- uint uniformSSBOloc - -- this is what uniform offset to read, 0 will be health? - -- float2 timers - -- this is for setting the time from which to calculate the timer based bars, set to 0 for no timer, start and end time maybe to calc diff? - -- uint unitID - -- or a featureID for features, those will be a separate list, but use hopefully the same shader. - -- - -- VS output - -- unit position - -- bar position - -- bar 'scale' - -- bar basecolor - -- bar colormap vec3[3] - -- bar value - -- bar type - -- bar alpha - -- corner size - + ]] +-- +-- +-- VS input: +-- uint barindex +-- this is the index of how manyeth bar it is in the list, where 0 is always health. and if an additional bar is needed, then increment accordingly +-- uint bartype +-- this is for where to get the colortable and 'icon' from +-- float unitheight +-- for correct offsetting +-- uint uniformSSBOloc +-- this is what uniform offset to read, 0 will be health? +-- float2 timers +-- this is for setting the time from which to calculate the timer based bars, set to 0 for no timer, start and end time maybe to calc diff? +-- uint unitID +-- or a featureID for features, those will be a separate list, but use hopefully the same shader. +-- +-- VS output +-- unit position +-- bar position +-- bar 'scale' +-- bar basecolor +-- bar colormap vec3[3] +-- bar value +-- bar type +-- bar alpha +-- corner size -- Geometry shader: - -- should only output anything if the bar actually needs to be drawn +-- should only output anything if the bar actually needs to be drawn -- Job of the geometry shader: - -- take the VS output params, and create the following bar components: - -- At furthest detail: - -- background which is same size as bar - -- the bar itself - -- 2*4 vertices - -- midrange: - -- a nicer 6 triangle cornered bar background - -- a cornered bar foreground - -- 2*8 vertices - -- closeup: - -- add the percentage value to the left of the bar - -- this is 4*4 vertices - -- full closeness - -- also write the 'name' of the bar type - -- GS output per vertex: - -- position on screen - -- Z depth (somehow with emission ordering from back to front? - -- UV coordinates -- this could get nasty quickly - -- vertex color - -- solid or textured +-- take the VS output params, and create the following bar components: +-- At furthest detail: +-- background which is same size as bar +-- the bar itself +-- 2*4 vertices +-- midrange: +-- a nicer 6 triangle cornered bar background +-- a cornered bar foreground +-- 2*8 vertices +-- closeup: +-- add the percentage value to the left of the bar +-- this is 4*4 vertices +-- full closeness +-- also write the 'name' of the bar type +-- GS output per vertex: +-- position on screen +-- Z depth (somehow with emission ordering from back to front? +-- UV coordinates -- this could get nasty quickly +-- vertex color +-- solid or textured -- Fragment shader: - -- if solid, interpolate vertex color, and straight up draw it - -- if uv mapped, sample the texture and draw it +-- if solid, interpolate vertex color, and straight up draw it +-- if uv mapped, sample the texture and draw it -- atlas plans: - -- 512 x 512 atlas - -- 16 rows in it - -- each number from 0 to 9, '.' % and space (the 15th.) 's', ':' - -- the text? - -- overlay textures for bars - -- symbol glyphs +-- 512 x 512 atlas +-- 16 rows in it +-- each number from 0 to 9, '.' % and space (the 15th.) 's', ':' +-- the text? +-- overlay textures for bars +-- symbol glyphs -- TODO -- 1. enemy paralyzed is not visible? @@ -181,9 +177,9 @@ local spIsPosInLos = Spring.IsPosInLos -- TODO: allies dont get reload bars? Do Specs see them? -- done (it was f'ed up previously) -- TODO: correct draw order (after highlightunit) -- done -- TODO: when reiniting feature bars, also check for resurrect/reclaim status -- done, just dont reinit them on playerchanged, no point! - -- now this is problematic, as the gadget only sends us an event on first reclaim event - -- we must assume that all features - -- feature bars dont actually need a reinit, now do they? +-- now this is problematic, as the gadget only sends us an event on first reclaim event +-- we must assume that all features +-- feature bars dont actually need a reinit, now do they? -- TODO: make numbers, glyphs optional? -- done, but untested --/luarules benchmark corak armpw 100 10 2000 @@ -231,8 +227,8 @@ local bitColorCorrect = 128 local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? health = { - mincolor = {1.0, 0.0, 0.0, 1.0}, - maxcolor = {0.0, 1.0, 0.0, 1.0}, + mincolor = { 1.0, 0.0, 0.0, 1.0 }, + maxcolor = { 0.0, 1.0, 0.0, 1.0 }, --bartype = 0, bartype = bitPercentage + bitColorCorrect, hidethreshold = 0.99, @@ -240,8 +236,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.0625, -- the X offset of the icon for this bar }, shield = { - mincolor = {0.15, 0.4, 0.4, 1.0}, - maxcolor = {0.3, 0.8, 0.8, 1.0}, + mincolor = { 0.15, 0.4, 0.4, 1.0 }, + maxcolor = { 0.3, 0.8, 0.8, 1.0 }, --bartype = 3, bartype = bitShowGlyph + bitUseOverlay + bitPercentage, hidethreshold = 0.99, @@ -249,8 +245,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.3125, -- the X offset of the icon for this bar }, capture = { - mincolor = {0.5, 0.25, 0.0, 1.0}, - maxcolor = {1.0, 0.5, 0.0, 1.0}, + mincolor = { 0.5, 0.25, 0.0, 1.0 }, + maxcolor = { 1.0, 0.5, 0.0, 1.0 }, --bartype = 3, bartype = bitShowGlyph + bitUseOverlay + bitPercentage, hidethreshold = 0.99, @@ -258,8 +254,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.1875, -- the X offset of the icon for this bar }, stockpile = { - mincolor = {0.1, 0.1, 0.1, 1.0}, - maxcolor = {0.1, 0.1, 0.1, 1.0}, + mincolor = { 0.1, 0.1, 0.1, 1.0 }, + maxcolor = { 0.1, 0.1, 0.1, 1.0 }, --bartype = 5, bartype = bitShowGlyph + bitUseOverlay + bitIntegerNumber, hidethreshold = 1.99, @@ -267,8 +263,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.4375, -- the X offset of the icon for this bar }, emp_damage = { - mincolor = {0.4, 0.4, 0.8, 1.0}, - maxcolor = {0.6, 0.6, 1.0, 1.0}, + mincolor = { 0.4, 0.4, 0.8, 1.0 }, + maxcolor = { 0.6, 0.6, 1.0, 1.0 }, --bartype = 3, bartype = bitShowGlyph + bitUseOverlay + bitPercentage, hidethreshold = 0.99, @@ -276,8 +272,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.5625, -- the X offset of the icon for this bar }, reload = { - mincolor = {0.03, 0.4, 0.4, 1.0}, - maxcolor = {0.05, 0.6, 0.6, 1.0}, + mincolor = { 0.03, 0.4, 0.4, 1.0 }, + maxcolor = { 0.05, 0.6, 0.6, 1.0 }, --bartype = 2, bartype = bitShowGlyph + bitUseOverlay + bitGetProgress, hidethreshold = 0.99, @@ -285,8 +281,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.6875, -- the X offset of the icon for this bar }, building = { - mincolor = {1.0, 1.0, 1.0, 1.0}, - maxcolor = {1.0, 1.0, 1.0, 1.0}, + mincolor = { 1.0, 1.0, 1.0, 1.0 }, + maxcolor = { 1.0, 1.0, 1.0, 1.0 }, --bartype = 3, bartype = bitShowGlyph + bitUseOverlay + bitPercentage, hidethreshold = 0.999, @@ -294,8 +290,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.9375, -- the X offset of the icon for this bar }, paralyzed = { - mincolor = {0.6, 0.6, 1.0, 1.0}, - maxcolor = {0.6, 0.6, 1.0, 1.0}, + mincolor = { 0.6, 0.6, 1.0, 1.0 }, + maxcolor = { 0.6, 0.6, 1.0, 1.0 }, --bartype = 1, bartype = bitShowGlyph + bitUseOverlay + bitFlashBar + bitTimeLeft, hidethreshold = 0.99, @@ -303,8 +299,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.8125, -- the X offset of the icon for this bar }, featurehealth = { - mincolor = {0.25, 0.25, 0.25, 1.0}, - maxcolor = {0.65, 0.65, 0.65, 1.0}, + mincolor = { 0.25, 0.25, 0.25, 1.0 }, + maxcolor = { 0.65, 0.65, 0.65, 1.0 }, --bartype = 0, bartype = bitShowGlyph + bitPercentage, hidethreshold = 0.99, @@ -312,8 +308,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.125, -- the X offset of the icon for this bar }, featurereclaim = { - mincolor = {0.00, 1.00, 0.00, 1.0}, - maxcolor = {0.85, 1.00, 0.85, 1.0}, + mincolor = { 0.00, 1.00, 0.00, 1.0 }, + maxcolor = { 0.85, 1.00, 0.85, 1.0 }, --bartype = 0, bartype = bitShowGlyph + bitPercentage, hidethreshold = 0.99, @@ -321,8 +317,8 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? uvoffset = 0.5, -- the X offset of the icon for this bar }, featureresurrect = { - mincolor = {0.75, 0.15, 0.75, 1.0}, - maxcolor = {1.0, 0.2, 1.0, 1.0}, + mincolor = { 0.75, 0.15, 0.75, 1.0 }, + maxcolor = { 1.0, 0.2, 1.0, 1.0 }, --bartype = 0, bartype = bitShowGlyph + bitPercentage, hidethreshold = 0.99, @@ -333,7 +329,9 @@ local barTypeMap = { -- WHERE SHOULD WE STORE THE FUCKING COLORS? for barname, bt in pairs(barTypeMap) do local cache = {} - for i=1,20 do cache[i] = 0 end + for i = 1, 20 do + cache[i] = 0 + end --cache[1] = unitDefHeights[unitDefID] + additionalheightaboveunit * effectiveScale -- height --cache[2] = effectiveScale @@ -344,7 +342,7 @@ for barname, bt in pairs(barTypeMap) do --cache[6] = unitBars[unitID] - 1 -- bar index (how manyeth per unit) cache[7] = bt.uniformindex -- ssbo location offset (> 20 for health) - cache[9] = bt.mincolor[1] + cache[9] = bt.mincolor[1] cache[10] = bt.mincolor[2] cache[11] = bt.mincolor[3] cache[12] = bt.mincolor[4] @@ -354,10 +352,9 @@ for barname, bt in pairs(barTypeMap) do cache[15] = bt.maxcolor[3] cache[16] = bt.maxcolor[4] - bt['cache'] = cache + bt["cache"] = cache end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -412,7 +409,7 @@ local InstanceVBOTable = gl.InstanceVBOTable --local uploadAllElements = InstanceVBOTable.uploadAllElements local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance -------------------- configurables ----------------------- local additionalheightaboveunit = 24 --16? @@ -422,9 +419,8 @@ local featureResurrectDistMult = 1 -- how many times closer features have to be local glphydistmult = 3.5 -- how much closer than BARFADEEND the bar has to be to start drawing numbers/icons. Numbers closer to 1 will make the glyphs be drawn earlier, high numbers will only shows glyphs when zoomed in hard. local glyphdistmultfeatures = 1.8 -- how much closer than BARFADEEND the bar has to be to start drawing numbers/icons - local unitDefSizeMultipliers = {} -- table of unitdefID to a size mult (default 1.0) to override sizing of bars per unitdef -local skipGlyphsNumbers = 0.0 -- 0.0 is draw glyph and number, 1.0 means only numbers, 2.0 means only bars, +local skipGlyphsNumbers = 0.0 -- 0.0 is draw glyph and number, 1.0 means only numbers, 2.0 means only bars, local debugmode = false @@ -466,41 +462,40 @@ local useGeometryShader = LuaShader.isGeometryShaderSupported local unitQuadVBO local shaderSourceCache = { - vssrcpath = vsSrcPath, - fssrcpath = fsSrcPath, - gssrcpath = gsSrcPath, - shaderName = "Health Bars Shader GL4", - uniformInt = { - healthbartexture = 0; - }, - uniformFloat = { - --addRadius = 1, - iconDistance = 27, - cameraDistanceMult = 1.0, - cameraDistanceMultGlyph = 4.0, - skipGlyphsNumbers = 0.0, - globalSizeMult = 1.0, - }, - shaderConfig = shaderConfig, - } + vssrcpath = vsSrcPath, + fssrcpath = fsSrcPath, + gssrcpath = gsSrcPath, + shaderName = "Health Bars Shader GL4", + uniformInt = { + healthbartexture = 0, + }, + uniformFloat = { + --addRadius = 1, + iconDistance = 27, + cameraDistanceMult = 1.0, + cameraDistanceMultGlyph = 4.0, + skipGlyphsNumbers = 0.0, + globalSizeMult = 1.0, + }, + shaderConfig = shaderConfig, +} local fallbackShaderSourceCache = { - vssrcpath = fallbackVsSrcPath, - fssrcpath = fallbackFsSrcPath, - shaderName = "Health Bars Shader GL4 (NoGS)", - uniformInt = { - healthbartexture = 0; - }, - uniformFloat = { - iconDistance = 27, - cameraDistanceMult = 1.0, - cameraDistanceMultGlyph = 4.0, - skipGlyphsNumbers = 0.0, - globalSizeMult = 1.0, - }, - shaderConfig = shaderConfig, - } - + vssrcpath = fallbackVsSrcPath, + fssrcpath = fallbackFsSrcPath, + shaderName = "Health Bars Shader GL4 (NoGS)", + uniformInt = { + healthbartexture = 0, + }, + uniformFloat = { + iconDistance = 27, + cameraDistanceMult = 1.0, + cameraDistanceMultGlyph = 4.0, + skipGlyphsNumbers = 0.0, + globalSizeMult = 1.0, + }, + shaderConfig = shaderConfig, +} -- Walk through unitdefs for the stuff we need: for udefID, unitDef in pairs(UnitDefs) do @@ -509,8 +504,9 @@ for udefID, unitDef in pairs(UnitDefs) do end --ignore debug units local shieldDefID = unitDef.shieldWeaponDef - local shieldPower = ((shieldDefID) and (WeaponDefs[shieldDefID].shieldPower)) or (-1) - if shieldPower > 1 then unitDefhasShield[udefID] = shieldPower + local shieldPower = (shieldDefID and WeaponDefs[shieldDefID].shieldPower) or -1 + if shieldPower > 1 then + unitDefhasShield[udefID] = shieldPower --spEcho("HAS SHIELD") end @@ -526,9 +522,13 @@ for udefID, unitDef in pairs(UnitDefs) do end unitDefHeights[udefID] = unitDef.height unitDefSizeMultipliers[udefID] = mathMin(1.45, math.max(0.85, (Spring.GetUnitDefDimensions(udefID).radius / 150) + mathMin(0.6, unitDef.power / 4000))) + mathMin(0.6, unitDef.health / 22000) - if unitDef.canStockpile then unitDefCanStockpile[udefID] = unitDef.canStockpile end + if unitDef.canStockpile then + unitDefCanStockpile[udefID] = unitDef.canStockpile + end if reloadTime and reloadTime > minReloadTime then - if debugmode then spEcho("Unit with watched reload time:", unitDef.name, reloadTime, minReloadTime) end + if debugmode then + spEcho("Unit with watched reload time:", unitDef.name, reloadTime, minReloadTime) + end unitDefPrimaryWeapon[udefID] = primaryWeapon end if unitDef.hideDamage == true then @@ -547,34 +547,31 @@ for fdefID, featureDef in pairs(FeatureDefs) do featureDefHeights[fdefID] = featureDef.height or 32 end - local function goodbye(reason) - spEcho("Healthbars GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("Healthbars GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end - - local function initializeInstanceVBOTable(myName, usesFeatures) local newVBOTable local layout local unitIDAttribID if useGeometryShader then layout = { - {id = 0, name = 'height_timers', size = 4}, - {id = 1, name = 'type_index_ssboloc', size = 4, type = GL.UNSIGNED_INT}, - {id = 2, name = 'startcolor', size = 4}, - {id = 3, name = 'endcolor', size = 4}, - {id = 4, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 0, name = "height_timers", size = 4 }, + { id = 1, name = "type_index_ssboloc", size = 4, type = GL.UNSIGNED_INT }, + { id = 2, name = "startcolor", size = 4 }, + { id = 3, name = "endcolor", size = 4 }, + { id = 4, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDAttribID = 4 else layout = { - {id = 2, name = 'height_timers', size = 4}, - {id = 3, name = 'type_index_ssboloc', size = 4, type = GL.UNSIGNED_INT}, - {id = 4, name = 'startcolor', size = 4}, - {id = 5, name = 'endcolor', size = 4}, - {id = 6, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 2, name = "height_timers", size = 4 }, + { id = 3, name = "type_index_ssboloc", size = 4, type = GL.UNSIGNED_INT }, + { id = 4, name = "startcolor", size = 4 }, + { id = 5, name = "endcolor", size = 4 }, + { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDAttribID = 6 end @@ -584,7 +581,9 @@ local function initializeInstanceVBOTable(myName, usesFeatures) myName, -- name unitIDAttribID -- unitIDattribID (instData) ) - if newVBOTable == nil then goodbye("Failed to create " .. myName) end + if newVBOTable == nil then + goodbye("Failed to create " .. myName) + end if useGeometryShader then local newVAO = gl.GetVAO() @@ -593,11 +592,12 @@ local function initializeInstanceVBOTable(myName, usesFeatures) else newVBOTable.VAO = InstanceVBOTable.makeVAOandAttach(unitQuadVBO, newVBOTable.instanceVBO) end - if usesFeatures then newVBOTable.featureIDs = true end + if usesFeatures then + newVBOTable.featureIDs = true + end return newVBOTable end - local function initGL4() -- Prefer geometry shader path when it actually compiles. This avoids false -- negatives from capability detection on some Linux/AMD driver stacks. @@ -608,19 +608,25 @@ local function initGL4() -- A simple quad used by the non-GS path. unitQuadVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) unitQuadVBO:Define(4, { - {id = 0, name = 'quadPos', size = 2}, + { id = 0, name = "quadPos", size = 2 }, }) unitQuadVBO:Upload({ - 0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 1.0, + 1.0, + 1.0, }) healthBarShader = LuaShader.CheckShaderUpdates(fallbackShaderSourceCache) end - if not healthBarShader then goodbye("Failed to compile health bars GL4 ") end + if not healthBarShader then + goodbye("Failed to compile health bars GL4 ") + end healthBarVBO = initializeInstanceVBOTable("healthBarVBO", false) @@ -638,22 +644,28 @@ end local function addBarForUnit(unitID, unitDefID, barname, reason) --Spring.Debug.TraceFullEcho() - if debugmode then Spring.Debug.TraceEcho(unitBars[unitID]) end + if debugmode then + Spring.Debug.TraceEcho(unitBars[unitID]) + end --spEcho("Caller1:", tostring()".name), "caller2:", tostring(debug.getinfo(3).name)) unitDefID = unitDefID or spGetUnitDefID(unitID) -- Why? Because adding additional bars can be triggered from outside of unit tracker api -- like EMP, where we assume that unit is already visible, however -- debug units are not present in unittracker api! - if (unitDefID == nil) or unitDefIgnore[unitDefID] then return nil end + if (unitDefID == nil) or unitDefIgnore[unitDefID] then + return nil + end local bt = barTypeMap[barname] --if cnt == 1 then bt = barTypeMap.building end --if cnt == 2 then bt = barTypeMap.reload end - local instanceID = unitID .. '_' .. barname + local instanceID = unitID .. "_" .. barname --spEcho(instanceID, barname, unitBars[unitID]) if healthBarVBO.instanceIDtoIndex[instanceID] then - if debugmode then spEcho("Trying to add duplicate bar", unitID, instanceID, barname, reason, unitBars[unitID]) end + if debugmode then + spEcho("Trying to add duplicate bar", unitID, instanceID, barname, reason, unitBars[unitID]) + end return end -- we already have this bar ! @@ -668,9 +680,9 @@ local function addBarForUnit(unitID, unitDefID, barname, reason) if debugmode then spEcho("A unit has no bars yet", UnitDefs[unitDefID].name, spGetUnitPosition(unitID)) Spring.Debug.TraceFullEcho() - Spring.SendCommands({"pause 1"}) + Spring.SendCommands({ "pause 1" }) spEcho("No bars unit, last seen at", unitID) - Spring.MarkerAddPoint(spGetUnitPosition(unitID) ) + Spring.MarkerAddPoint(spGetUnitPosition(unitID)) end unitBars[unitID] = 1 end @@ -681,9 +693,9 @@ local function addBarForUnit(unitID, unitDefID, barname, reason) local healthBarTableCache = bt.cache - healthBarTableCache[1] = unitDefHeights[unitDefID] + additionalheightaboveunit * effectiveScale -- height + healthBarTableCache[1] = unitDefHeights[unitDefID] + additionalheightaboveunit * effectiveScale -- height healthBarTableCache[2] = effectiveScale - healthBarTableCache[6] = unitBars[unitID] - 1 -- bar index (how manyeth per unit) + healthBarTableCache[6] = unitBars[unitID] - 1 -- bar index (how manyeth per unit) return pushElementInstance( healthBarVBO, -- push into this Instance VBO Table @@ -691,27 +703,27 @@ local function addBarForUnit(unitID, unitDefID, barname, reason) instanceID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element nil, -- noupload, dont use unless you know what you want to batch push/pop - unitID) -- last one should be featureID! - -- we are returning here, to sign successful adds + unitID + ) -- last one should be featureID! + -- we are returning here, to sign successful adds end - -local uniformcache = {0.0} +local uniformcache = { 0.0 } local function updateReloadBar(unitID, unitDefID, reason) if not unitDefPrimaryWeapon[unitDefID] then return end - local reloadFrame = GetUnitWeaponState(unitID, unitDefPrimaryWeapon[unitDefID], 'reloadFrame') - local reloadTime = GetUnitWeaponState(unitID, unitDefPrimaryWeapon[unitDefID], 'reloadTime') + local reloadFrame = GetUnitWeaponState(unitID, unitDefPrimaryWeapon[unitDefID], "reloadFrame") + local reloadTime = GetUnitWeaponState(unitID, unitDefPrimaryWeapon[unitDefID], "reloadTime") local gf = spGetGameFrame() if (reloadFrame == nil or reloadFrame > gf) and unitReloadWatch[unitID] == nil then addBarForUnit(unitID, unitDefID, "reload", reason) end - if (reloadFrame and reloadTime and gl.SetUnitBufferUniforms) then + if reloadFrame and reloadTime and gl.SetUnitBufferUniforms then uniformcache[1] = reloadFrame - 30 * reloadTime gl.SetUnitBufferUniforms(unitID, uniformcache, 2) uniformcache[1] = reloadFrame @@ -722,17 +734,19 @@ end local function removeBarFromUnit(unitID, barname, reason) -- this will bite me in the ass later, im sure, yes it did, we need to just update them :P local instanceKey = unitID .. "_" .. barname if healthBarVBO.instanceIDtoIndex[instanceKey] then - if debugmode then Spring.Debug.TraceEcho(reason) end + if debugmode then + Spring.Debug.TraceEcho(reason) + end unitBars[unitID] = unitBars[unitID] - 1 popElementInstance(healthBarVBO, instanceKey) end end - local function addBarsForUnit(unitID, unitDefID, unitTeam, unitAllyTeam, reason) -- TODO, actually, we need to check for all of these for stuff entering LOS - if unitDefID == nil or Spring.ValidUnitID(unitID) == false or Spring.GetUnitIsDead(unitID) == true then - if debugmode then spEcho("Tried to add a bar to a dead or invalid unit", unitID, "at", spGetUnitPosition(unitID), reason) end + if debugmode then + spEcho("Tried to add a bar to a dead or invalid unit", unitID, "at", spGetUnitPosition(unitID), reason) + end return end @@ -742,7 +756,7 @@ local function addBarsForUnit(unitID, unitDefID, unitTeam, unitAllyTeam, reason) -- If a unit is captured and thus immediately become outside of LOS, then the getunitallyteam is still the old ally team according to getUnitAllyTEam, and not the new allyteam. unitAllyTeam = unitAllyTeam or Spring.GetUnitAllyTeam(unitID) local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) - if (fullview or (unitAllyTeam == myAllyTeamID) or (unitDefHideDamage[unitDefID] == nil)) and (unitDefIgnore[unitDefID] == nil ) then + if (fullview or (unitAllyTeam == myAllyTeamID) or (unitDefHideDamage[unitDefID] == nil)) and (unitDefIgnore[unitDefID] == nil) then if debugmode and health == nil then spEcho("Trying to add a healthbar to nil health unit", unitID, unitDefID) local ux, uy, uz = spGetUnitPosition(unitID) @@ -775,14 +789,13 @@ local function addBarsForUnit(unitID, unitDefID, unitTeam, unitAllyTeam, reason) if unitDefCanStockpile[unitDefID] then spEcho("unitDefCanStockpile", unitAllyTeam, myAllyTeamID, fullview) end - end if unitDefCanStockpile[unitDefID] and ((unitAllyTeam == myAllyTeamID) or fullview) then unitStockPileWatch[unitID] = 0.0 addBarForUnit(unitID, unitDefID, "stockpile", reason) end - if capture > 0 then + if capture > 0 then addBarForUnit(unitID, unitDefID, "capture", reason) uniformcache[1] = capture gl.SetUnitBufferUniforms(unitID, uniformcache, 5) @@ -793,12 +806,12 @@ local function addBarsForUnit(unitID, unitDefID, unitTeam, unitAllyTeam, reason) --TODO if Spring.GetUnitIsStunned(unitID) then - if unitParalyzedWatch[unitID] == nil then -- already paralyzed + if unitParalyzedWatch[unitID] == nil then -- already paralyzed unitParalyzedWatch[unitID] = 0.0 -- if unit was already empd, remove that bar if unitEmpDamagedWatch[unitID] then unitEmpDamagedWatch[unitID] = nil - removeBarFromUnit(unitID, 'emp_damage', 'unitEmpDamagedWatch') + removeBarFromUnit(unitID, "emp_damage", "unitEmpDamagedWatch") end addBarForUnit(unitID, unitDefID, "paralyzed", reason) end @@ -813,7 +826,7 @@ local function addBarsForUnit(unitID, unitDefID, unitTeam, unitAllyTeam, reason) end local function removeBarsFromUnit(unitID, reason) - for barname,v in pairs(barTypeMap) do + for barname, v in pairs(barTypeMap) do removeBarFromUnit(unitID, barname, reason) end unitShieldWatch[unitID] = nil @@ -826,18 +839,25 @@ local function removeBarsFromUnit(unitID, reason) unitBars[unitID] = nil end - -local function addBarToFeature(featureID, barname) - if debugmode then Spring.Debug.TraceEcho() end +local function addBarToFeature(featureID, barname) + if debugmode then + Spring.Debug.TraceEcho() + end local featureDefID = Spring.GetFeatureDefID(featureID) local bt = barTypeMap[barname] local targetVBO = featureHealthVBO - if barname == 'featurereclaim' then targetVBO = featureReclaimVBO end - if barname == 'featureresurrect' then targetVBO = featureResurrectVBO end + if barname == "featurereclaim" then + targetVBO = featureReclaimVBO + end + if barname == "featureresurrect" then + targetVBO = featureResurrectVBO + end - if targetVBO.instanceIDtoIndex[featureID] then return end -- already exists, bail + if targetVBO.instanceIDtoIndex[featureID] then + return + end -- already exists, bail if featureBars[featureID] == nil then featureBars[featureID] = 0 end @@ -845,7 +865,8 @@ local function addBarToFeature(featureID, barname) pushElementInstance( targetVBO, -- push into this Instance VBO Table - {featureDefHeights[featureDefID] + additionalheightaboveunit, -- height + { + featureDefHeights[featureDefID] + additionalheightaboveunit, -- height 1.0 * barScale, -- size mult 0, -- timer end bt.uvoffset, -- unused float @@ -855,16 +876,26 @@ local function addBarToFeature(featureID, barname) bt.uniformindex, -- ssbo location offset (> 20 for health) 0, -- unused int - bt.mincolor[1], bt.mincolor[2], bt.mincolor[3], bt.mincolor[4], - bt.maxcolor[1], bt.maxcolor[2], bt.maxcolor[3], bt.maxcolor[4], - 0, 0, 0, 0}, -- these are just padding zeros for instData, that will get filled in + bt.mincolor[1], + bt.mincolor[2], + bt.mincolor[3], + bt.mincolor[4], + bt.maxcolor[1], + bt.maxcolor[2], + bt.maxcolor[3], + bt.maxcolor[4], + 0, + 0, + 0, + 0, + }, -- these are just padding zeros for instData, that will get filled in featureID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element nil, -- noupload, dont use unless you know what you want to batch push/pop - featureID) -- last one should be featureID! + featureID + ) -- last one should be featureID! end - local function removeBarFromFeature(featureID, targetVBO) --spEcho("removeBarFromFeature", featureID, targetVBO.myName) if not targetVBO.instanceIDtoIndex[featureID] then @@ -892,7 +923,6 @@ local function removeBarsFromFeature(featureID) removeBarFromFeature(featureID, featureResurrectVBO) end - local function init() InstanceVBOTable.clearInstanceTable(healthBarVBO) unitCaptureWatch = {} @@ -907,18 +937,17 @@ local function init() -- probably shouldnt be adding non-visible units if fullview then - addBarsForUnit(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID), nil, 'initfullview') + addBarsForUnit(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID), nil, "initfullview") else local losstate = Spring.GetUnitLosState(unitID, myAllyTeamID) if losstate.los then - addBarsForUnit(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID), nil, 'initlos') + addBarsForUnit(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID), nil, "initlos") --spEcho(unitID, "IS in los") else --spEcho(unitID, "is not in los for ", myAllyTeamID) end end end - end local function initfeaturebars() @@ -930,15 +959,14 @@ local function initfeaturebars() --local resurrectname = Spring.GetFeatureResurrect(featureID) --if resurrectname then -- resurrectableFeatures[featureID] = true - -- if it has resurrect progress, then just straight up just store a bar here for it? - -- or shall we only instantiate bars when needed? probably number 2 is smarter... + -- if it has resurrect progress, then just straight up just store a bar here for it? + -- or shall we only instantiate bars when needed? probably number 2 is smarter... --end -- maybe store resurrect progress here? if featureDefID then -- dont add features that we cant get the ID of -- add a health bar for it (dont add one for pre-existing stuff) widget:FeatureCreated(featureID) else - end end end @@ -966,42 +994,45 @@ end --[12:40 PM] Beherith: Transitions between any of the above 3 should trigger a full reinit --[12:41 PM] Beherith: But some internal transitions, for stuff that is draw differently for allies might require additional checks, for spectators who have fullview off? - -local function FeatureReclaimStartedHealthbars (featureID, step) -- step is negative for reclaim, positive for resurrect +local function FeatureReclaimStartedHealthbars(featureID, step) -- step is negative for reclaim, positive for resurrect --spEcho("FeatureReclaimStartedHealthbars", featureID) - --gl.SetFeatureBufferUniforms(featureID, 0.5, 2) -- update GL - if step > 0 then addBarToFeature(featureID, 'featureresurrect') - else addBarToFeature(featureID, 'featurereclaim') end + --gl.SetFeatureBufferUniforms(featureID, 0.5, 2) -- update GL + if step > 0 then + addBarToFeature(featureID, "featureresurrect") + else + addBarToFeature(featureID, "featurereclaim") + end end local function UnitCaptureStartedHealthbars(unitID, step) -- step is negative for reclaim, positive for resurrect - if debugmode then spEcho("UnitCaptureStartedHealthbars", unitID) end - --gl.SetFeatureBufferUniforms(featureID, 0.5, 2) -- update GL + if debugmode then + spEcho("UnitCaptureStartedHealthbars", unitID) + end + --gl.SetFeatureBufferUniforms(featureID, 0.5, 2) -- update GL local capture = select(4, spGetUnitHealth(unitID)) uniformcache[1] = capture gl.SetUnitBufferUniforms(unitID, uniformcache, 5) unitCaptureWatch[unitID] = capture - addBarForUnit(unitID, spGetUnitDefID(unitID), 'capture', 'UnitCaptureStartedHealthbars') - + addBarForUnit(unitID, spGetUnitDefID(unitID), "capture", "UnitCaptureStartedHealthbars") end --function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) local function UnitParalyzeDamageHealthbars(unitID, unitDefID, damage) if Spring.GetUnitIsStunned(unitID) then -- DO NOTE THAT: return: nil | bool stunned_or_inbuild, bool stunned, bool inbuild - if unitParalyzedWatch[unitID] == nil then -- already paralyzed + if unitParalyzedWatch[unitID] == nil then -- already paralyzed unitParalyzedWatch[unitID] = 0.0 -- if unit was already empd, remove that bar if unitEmpDamagedWatch[unitID] then unitEmpDamagedWatch[unitID] = nil - removeBarFromUnit(unitID, 'emp_damage', 'unitEmpDamagedWatch') + removeBarFromUnit(unitID, "emp_damage", "unitEmpDamagedWatch") end - addBarForUnit(unitID, unitDefID, "paralyzed", 'unitParalyzedWatch') + addBarForUnit(unitID, unitDefID, "paralyzed", "unitParalyzedWatch") end else if unitEmpDamagedWatch[unitID] == nil then unitEmpDamagedWatch[unitID] = 0.0 - addBarForUnit(unitID, unitDefID, "emp_damage", 'unitEmpDamagedWatch') + addBarForUnit(unitID, unitDefID, "emp_damage", "unitEmpDamagedWatch") end end end @@ -1009,7 +1040,7 @@ end local function ProjectileCreatedReloadHB(projectileID, unitID, weaponID, unitDefID) local unitDefID = spGetUnitDefID(unitID) - updateReloadBar(unitID, unitDefID, 'ProjectileCreatedReloadHB') + updateReloadBar(unitID, unitDefID, "ProjectileCreatedReloadHB") end function widget:Initialize() @@ -1017,19 +1048,19 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - WG['healthbars'] = {} - WG['healthbars'].getScale = function() + WG["healthbars"] = {} + WG["healthbars"].getScale = function() return barScale end - WG['healthbars'].setScale = function(value) + WG["healthbars"].setScale = function(value) barScale = value init() initfeaturebars() end - WG['healthbars'].getHeight = function() + WG["healthbars"].getHeight = function() return barHeight end - WG['healthbars'].setHeight = function(value) + WG["healthbars"].setHeight = function(value) barHeight = value shaderSourceCache.shaderConfig.BARHEIGHT = barHeight shaderSourceCache.shaderConfig.BARCORNER = 0.06 + (shaderConfig.BARHEIGHT / 9) @@ -1037,18 +1068,18 @@ function widget:Initialize() init() initfeaturebars() end - WG['healthbars'].getVariableSizes = function() + WG["healthbars"].getVariableSizes = function() return variableBarSizes end - WG['healthbars'].setVariableSizes = function(value) + WG["healthbars"].setVariableSizes = function(value) variableBarSizes = value init() initfeaturebars() end - WG['healthbars'].getDrawWhenGuiHidden = function() + WG["healthbars"].getDrawWhenGuiHidden = function() return drawWhenGuiHidden end - WG['healthbars'].setDrawWhenGuiHidden = function(value) + WG["healthbars"].setDrawWhenGuiHidden = function(value) drawWhenGuiHidden = value end @@ -1081,21 +1112,21 @@ function widget:ProjectileCreatedReloadHB(projectileID, ownerID, weaponID) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) - addBarsForUnit(unitID, unitDefID, unitTeam, nil, 'VisibleUnitAdded') + addBarsForUnit(unitID, unitDefID, unitTeam, nil, "VisibleUnitAdded") end function widget:VisibleUnitRemoved(unitID) - removeBarsFromUnit(unitID, 'VisibleUnitRemoved') + removeBarsFromUnit(unitID, "VisibleUnitRemoved") end function widget:CrashingAircraft(unitID, unitDefID, teamID) - removeBarsFromUnit(unitID,'CrashingAircraft') + removeBarsFromUnit(unitID, "CrashingAircraft") end function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) @@ -1110,7 +1141,6 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) spec, fullview = spGetSpectatingState() myAllyTeamID = Spring.GetMyAllyTeamID() - InstanceVBOTable.clearInstanceTable(healthBarVBO) -- clear all instances for unitID, unitDefID in pairs(extVisibleUnits) do addBarsForUnit(unitID, unitDefID, spGetUnitTeam(unitID), nil, "VisibleUnitsChanged") -- TODO: add them with noUpload = true @@ -1119,25 +1149,27 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) end function widget:PlayerChanged(playerID) - local currentspec, currentfullview = spGetSpectatingState() local currentTeamID = Spring.GetMyTeamID() local currentAllyTeamID = Spring.GetMyAllyTeamID() local currentPlayerID = Spring.GetMyPlayerID() local reinit = false - if debugmode then spEcho("HBGL4 widget:PlayerChanged",'spec', currentspec, 'fullview', currentfullview, 'teamID', currentTeamID, 'allyTeamID', currentAllyTeamID, "playerID", currentPlayerID) end + if debugmode then + spEcho("HBGL4 widget:PlayerChanged", "spec", currentspec, "fullview", currentfullview, "teamID", currentTeamID, "allyTeamID", currentAllyTeamID, "playerID", currentPlayerID) + end -- cases where we need to trigger: - if (currentspec ~= spec) or -- we transition from spec to player, yes this is needed - (currentfullview ~= fullview) or -- we turn on or off fullview - ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) -- our ALLYteam changes, and we are not in fullview - - then + if + (currentspec ~= spec) -- we transition from spec to player, yes this is needed + or (currentfullview ~= fullview) -- we turn on or off fullview + or ((currentAllyTeamID ~= myAllyTeamID) and not currentfullview) -- our ALLYteam changes, and we are not in fullview + then -- do the actual reinit stuff, but first change my own reinit = true - if debugmode then spEcho("HBGL4 triggered a playerchanged reinit") end - + if debugmode then + spEcho("HBGL4 triggered a playerchanged reinit") + end end -- save the state: spec = currentspec @@ -1146,9 +1178,7 @@ function widget:PlayerChanged(playerID) --if reinit then init() end end - function widget:GameFrame(n) - if debugmode then InstanceVBOTable.locateInvalidUnits(healthBarVBO) InstanceVBOTable.locateInvalidUnits(featureHealthVBO) @@ -1158,12 +1188,14 @@ function widget:GameFrame(n) if n % 3 == 0 then for unitID, oldshieldPower in pairs(unitShieldWatch) do local shieldOn, shieldPower = Spring.GetUnitShieldState(unitID) - if shieldOn == false then shieldPower = 0.0 end + if shieldOn == false then + shieldPower = 0.0 + end if oldshieldPower ~= shieldPower then if shieldPower == nil then removeBarFromUnit(unitID, "shield", "unitShieldWatch") else - uniformcache[1] = shieldPower / (unitDefhasShield[spGetUnitDefID(unitID)]) + uniformcache[1] = shieldPower / unitDefhasShield[spGetUnitDefID(unitID)] gl.SetUnitBufferUniforms(unitID, uniformcache, 2) end unitShieldWatch[unitID] = shieldPower @@ -1196,9 +1228,9 @@ function widget:GameFrame(n) if newparalyzeDamage and oldempvalue ~= newparalyzeDamage then if newparalyzeDamage == 0 then unitEmpDamagedWatch[unitID] = nil - removeBarFromUnit(unitID, "emp_damage",'unitEmpDamagedWatch') + removeBarFromUnit(unitID, "emp_damage", "unitEmpDamagedWatch") else - uniformcache[1] = newparalyzeDamage/ maxHealth + uniformcache[1] = newparalyzeDamage / maxHealth unitEmpDamagedWatch[unitID] = newparalyzeDamage gl.SetUnitBufferUniforms(unitID, uniformcache, 4) end @@ -1207,13 +1239,12 @@ function widget:GameFrame(n) end -- check Paralyzed units - if (n+2) % 3 == 0 then + if (n + 2) % 3 == 0 then for unitID, paralyzetime in pairs(unitParalyzedWatch) do if Spring.GetUnitIsStunned(unitID) then local health, maxHealth, paralyzeDamage, capture, build = spGetUnitHealth(unitID) --uniformcache[1] = math.floor((paralyzeDamage - maxHealth)) / (maxHealth * empDecline)) if paralyzeDamage then - -- this returns something like 1.20 which somehow turns into seconds somewhere unsearchable, currently wrong display -- this needs conditional fixing within an if Spring.GetModOptions().emprework uniformcache[1] = paralyzeDamage / maxHealth @@ -1224,8 +1255,8 @@ function widget:GameFrame(n) end else unitParalyzedWatch[unitID] = nil - removeBarFromUnit(unitID, "paralyzed", 'unitEmpDamagedWatch') - addBarForUnit(unitID, unitDefID, "emp_damage",'unitEmpDamagedWatch') + removeBarFromUnit(unitID, "paralyzed", "unitEmpDamagedWatch") + addBarForUnit(unitID, unitDefID, "emp_damage", "unitEmpDamagedWatch") unitEmpDamagedWatch[unitID] = 1.0 end end @@ -1241,7 +1272,7 @@ function widget:GameFrame(n) unitCaptureWatch[unitID] = capture end if capture == 0 or capture == nil then - removeBarFromUnit(unitID, 'capture', 'unitCaptureWatch') + removeBarFromUnit(unitID, "capture", "unitCaptureWatch") unitCaptureWatch[unitID] = nil end end @@ -1254,9 +1285,11 @@ function widget:GameFrame(n) if stockpileBuild and stockpileBuild ~= stockpilebuild then -- we somehow need to forward 3 vars, all 3 of the above. packed into a float, this is nasty --spEcho("Stockpiling", numStockpiled, numStockpileQued, stockpileBuild) - if numStockpiled == nil then Spring.Debug.TraceFullEcho(nil,nil,nil, 'nostockpile', unitID, spGetUnitPosition(unitID)) end + if numStockpiled == nil then + Spring.Debug.TraceFullEcho(nil, nil, nil, "nostockpile", unitID, spGetUnitPosition(unitID)) + end - uniformcache[1] = numStockpiled + stockpileBuild -- less hacky + uniformcache[1] = numStockpiled + stockpileBuild -- less hacky --uniformcache[1] = 128*numStockpileQued + numStockpiled + stockpileBuild -- the worlds nastiest hack unitStockPileWatch[unitID] = stockpileBuild gl.SetUnitBufferUniforms(unitID, uniformcache, 2) @@ -1265,21 +1298,23 @@ function widget:GameFrame(n) end end -local rezreclaim = {0.0, 1.0} +local rezreclaim = { 0.0, 1.0 } function widget:FeatureCreated(featureID) local featureDefID = Spring.GetFeatureDefID(featureID) local gameFrame = spGetGameFrame() -- some map-supplied features dont have a model, in these cases modelpath == "" - if FeatureDefs[featureDefID].name ~= 'geovent' and FeatureDefs[featureDefID].modelpath ~= '' then + if FeatureDefs[featureDefID].name ~= "geovent" and FeatureDefs[featureDefID].modelpath ~= "" then --spEcho(FeatureDefs[featureDefID].name) --featureBars[featureID] = 0 -- this is already done in AddBarToFeature - local health,maxhealth,rezProgress = Spring.GetFeatureHealth(featureID) + local health, maxhealth, rezProgress = Spring.GetFeatureHealth(featureID) if gameFrame > 0 then - addBarToFeature(featureID, 'featurehealth') + addBarToFeature(featureID, "featurehealth") else - if health ~= maxhealth then addBarToFeature(featureID, 'featurehealth') end + if health ~= maxhealth then + addBarToFeature(featureID, "featurehealth") + end end if not fullview then @@ -1290,27 +1325,28 @@ function widget:FeatureCreated(featureID) end if rezProgress > 0 then - addBarToFeature(featureID, 'featureresurrect') + addBarToFeature(featureID, "featureresurrect") end local _, _, _, _, reclaimLeft = Spring.GetFeatureResources(featureID) if reclaimLeft < 1.0 then - addBarToFeature(featureID, 'featurereclaim') + addBarToFeature(featureID, "featurereclaim") end - if rezProgress > 0 or reclaimLeft < 1 then + if rezProgress > 0 or reclaimLeft < 1 then -- We have to update the feature uniform buffers in this case, as features can be created with less than max health on the map with FP_featureplacer rezreclaim[1] = rezProgress -- resurrect progress rezreclaim[2] = reclaimLeft -- reclaim percent gl.SetFeatureBufferUniforms(featureID, rezreclaim, 1) -- update GL, at offset of 1 end - end end function widget:FeatureDestroyed(featureID) - if debugmode then spEcho("FeatureDestroyed",featureID, featureBars[featureID]) end + if debugmode then + spEcho("FeatureDestroyed", featureID, featureBars[featureID]) + end removeBarsFromFeature(featureID) featureBars[featureID] = nil end @@ -1321,8 +1357,12 @@ function widget:DrawScreenEffects() -- and unaffected by water/heat distortion. The shader still does world->clip -- via engine cameraViewProj UBO, and depth-test still occludes against terrain. --spEcho(Engine.versionFull ) - if chobbyInterface then return end - if not drawWhenGuiHidden and Spring.IsGUIHidden() then return end + if chobbyInterface then + return + end + if not drawWhenGuiHidden and Spring.IsGUIHidden() then + return + end if spGetGameFrame() % 90 == 0 then --spEcho("healthBarVBO",healthBarVBO.usedElements, "featureHealthVBO",featureHealthVBO.usedElements) @@ -1331,50 +1371,58 @@ function widget:DrawScreenEffects() local disticon = Spring.GetConfigInt("UnitIconDistance", 200) * 27.5 -- iconLength = unitIconDist * unitIconDist * 750.0f; gl.DepthTest(true) gl.DepthMask(true) - gl.Texture(0,healthbartexture) + gl.Texture(0, healthbartexture) healthBarShader:Activate() - healthBarShader:SetUniform("iconDistance",disticon) - if not debugmode then healthBarShader:SetUniform("cameraDistanceMult",1.0) end + healthBarShader:SetUniform("iconDistance", disticon) + if not debugmode then + healthBarShader:SetUniform("cameraDistanceMult", 1.0) + end healthBarShader:SetUniform("cameraDistanceMultGlyph", glphydistmult) - healthBarShader:SetUniform("skipGlyphsNumbers",skipGlyphsNumbers) --0.0 is everything, 1.0 means only numbers, 2.0 means only bars, + healthBarShader:SetUniform("skipGlyphsNumbers", skipGlyphsNumbers) --0.0 is everything, 1.0 means only numbers, 2.0 means only bars, if healthBarVBO.usedElements > 0 then if useGeometryShader then - healthBarVBO.VAO:DrawArrays(GL.POINTS,healthBarVBO.usedElements) + healthBarVBO.VAO:DrawArrays(GL.POINTS, healthBarVBO.usedElements) else healthBarVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, healthBarVBO.usedElements) end end -- below its the feature bars being drawn: - healthBarShader:SetUniform("cameraDistanceMultGlyph", glyphdistmultfeatures) - if featureHealthVBO.usedElements > 0 then - if not debugmode then healthBarShader:SetUniform("cameraDistanceMult",featureHealthDistMult) end - if useGeometryShader then - featureHealthVBO.VAO:DrawArrays(GL.POINTS,featureHealthVBO.usedElements) - else - featureHealthVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureHealthVBO.usedElements) - end + healthBarShader:SetUniform("cameraDistanceMultGlyph", glyphdistmultfeatures) + if featureHealthVBO.usedElements > 0 then + if not debugmode then + healthBarShader:SetUniform("cameraDistanceMult", featureHealthDistMult) end - if featureResurrectVBO.usedElements > 0 then - if not debugmode then healthBarShader:SetUniform("cameraDistanceMult",featureResurrectDistMult) end - if useGeometryShader then - featureResurrectVBO.VAO:DrawArrays(GL.POINTS,featureResurrectVBO.usedElements) - else - featureResurrectVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureResurrectVBO.usedElements) - end + if useGeometryShader then + featureHealthVBO.VAO:DrawArrays(GL.POINTS, featureHealthVBO.usedElements) + else + featureHealthVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureHealthVBO.usedElements) end - if featureReclaimVBO.usedElements > 0 then - if not debugmode then healthBarShader:SetUniform("cameraDistanceMult",featureReclaimDistMult) end - if useGeometryShader then - featureReclaimVBO.VAO:DrawArrays(GL.POINTS,featureReclaimVBO.usedElements) - else - featureReclaimVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureReclaimVBO.usedElements) - end + end + if featureResurrectVBO.usedElements > 0 then + if not debugmode then + healthBarShader:SetUniform("cameraDistanceMult", featureResurrectDistMult) + end + if useGeometryShader then + featureResurrectVBO.VAO:DrawArrays(GL.POINTS, featureResurrectVBO.usedElements) + else + featureResurrectVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureResurrectVBO.usedElements) end + end + if featureReclaimVBO.usedElements > 0 then + if not debugmode then + healthBarShader:SetUniform("cameraDistanceMult", featureReclaimDistMult) + end + if useGeometryShader then + featureReclaimVBO.VAO:DrawArrays(GL.POINTS, featureReclaimVBO.usedElements) + else + featureReclaimVBO.VAO:DrawArrays(GL.TRIANGLE_STRIP, 4, 0, featureReclaimVBO.usedElements) + end + end healthBarShader:Deactivate() gl.Texture(false) gl.DepthTest(false) - gl.DepthMask(false) --"BK OpenGL state resets", reset to default state + gl.DepthMask(false) --"BK OpenGL state resets", reset to default state end end @@ -1391,7 +1439,7 @@ function widget:GetConfigData(data) barScale = barScale, barHeight = barHeight, variableBarSizes = variableBarSizes, - drawWhenGuiHidden = drawWhenGuiHidden + drawWhenGuiHidden = drawWhenGuiHidden, } end diff --git a/luaui/Widgets/gui_idle_builders.lua b/luaui/Widgets/gui_idle_builders.lua index 4b70b03c4aa..434c362a016 100644 --- a/luaui/Widgets/gui_idle_builders.lua +++ b/luaui/Widgets/gui_idle_builders.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "March 2021", license = "GNU GPL, v2 or later", layer = 2, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -23,8 +22,8 @@ local spGetMyTeamID = Spring.GetMyTeamID local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState -local alwaysShow = true -- always show AT LEAST the label -local alwaysShowLabel = true -- always show the label regardless +local alwaysShow = true -- always show AT LEAST the label +local alwaysShowLabel = true -- always show the label regardless local showWhenSpec = false local showStack = false local usedIconSizeMult = 0.98 @@ -35,8 +34,8 @@ local maxIcons = 9 local showRez = true local doUpdateForce = true -local leftclick = 'LuaUI/Sounds/buildbar_add.wav' -local rightclick = 'LuaUI/Sounds/buildbar_click.wav' +local leftclick = "LuaUI/Sounds/buildbar_add.wav" +local rightclick = "LuaUI/Sounds/buildbar_click.wav" local vsx, vsy = spGetViewGeometry() @@ -103,7 +102,7 @@ local function refreshUnitDefs() if unitDef.translatedHumanName then unitHumanName[unitDefID] = unitDef.translatedHumanName end - if unitDef.buildSpeed > 0 and not string.find(unitDef.name, 'spy') and not string.find(unitDef.name, 'infestor') and (unitDef.canAssist or unitDef.buildOptions[1] or (showRez and unitDef.canResurrect)) and not unitDef.customParams.isairbase then + if unitDef.buildSpeed > 0 and not string.find(unitDef.name, "spy") and not string.find(unitDef.name, "infestor") and (unitDef.canAssist or unitDef.buildOptions[1] or (showRez and unitDef.canResurrect)) and not unitDef.customParams.isairbase then unitConf[unitDefID] = unitDef.isFactory end end @@ -128,34 +127,26 @@ end local function checkGuishader(force) if backgroundRect then - dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, 'idlebuilders', function() - RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner, ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0)) + dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, "idlebuilders", function() + RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner, ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0)) end, force) end end - local function drawIcon(unitDefID, rect, lightness, zoom, texSize, highlightOpacity) --Spring.Debug.TraceFullEcho() - gl.Color(lightness,lightness,lightness,1) - UiUnit( - rect[1], rect[2], rect[3], rect[4], - ceil(backgroundPadding*0.5), 1,1,1,1, - zoom, - nil, mathMax(0.1, highlightOpacity or 0.1), - '#'..unitDefID, - nil, nil, nil, nil - ) + gl.Color(lightness, lightness, lightness, 1) + UiUnit(rect[1], rect[2], rect[3], rect[4], ceil(backgroundPadding * 0.5), 1, 1, 1, 1, zoom, nil, mathMax(0.1, highlightOpacity or 0.1), "#" .. unitDefID, nil, nil, nil, nil) if highlightOpacity then gl.Blending(GL_SRC_ALPHA, GL_ONE) - gl.Color(1,1,1,highlightOpacity) - RectRound(rect[1], rect[2], rect[3], rect[4], min(max(1, floor((rect[3]-rect[1]) * 0.024)), floor((vsy*0.0015)+0.5))) + gl.Color(1, 1, 1, highlightOpacity) + RectRound(rect[1], rect[2], rect[3], rect[4], min(max(1, floor((rect[3] - rect[1]) * 0.024)), floor((vsy * 0.0015) + 0.5))) gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end end local function drawBackground() - UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) end local function drawContent() @@ -179,66 +170,65 @@ local function drawContent() floor(posX * vsx), floor(posY * vsy), floor(posX * vsx) + usedWidth - (iconWidth * numIcons), - floor(posY * vsy) + usedHeight + floor(posY * vsy) + usedHeight, } - local fontSize = height*vsy*0.33 - local offset = ((iconRect[3]-iconRect[1])/5) - local offsetY = -(fontSize*(posY > 0 and 0.22 or 0.31)) - local style = 'co' + local fontSize = height * vsy * 0.33 + local offset = ((iconRect[3] - iconRect[1]) / 5) + local offsetY = -(fontSize * (posY > 0 and 0.22 or 0.31)) + local style = "co" font2:Begin(true) font2:SetOutlineColor(0, 0, 0, 0.2) font2:SetTextColor(0.45, 0.45, 0.45, 1) - offset = (fontSize*0.6) - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)-offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)+offset+offsetY, fontSize, style) + offset = (fontSize * 0.6) + font2:Print(Spring.I18N("ui.idleBuilders.sleeping"), iconRect[1] + ((iconRect[3] - iconRect[1]) / 2) - offset, iconRect[2] + ((iconRect[4] - iconRect[2]) / 2) + offset + offsetY, fontSize, style) fontSize = fontSize * 1.2 - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2), iconRect[2]+((iconRect[4]-iconRect[2])/2)+offsetY, fontSize, style) + font2:Print(Spring.I18N("ui.idleBuilders.sleeping"), iconRect[1] + ((iconRect[3] - iconRect[1]) / 2), iconRect[2] + ((iconRect[4] - iconRect[2]) / 2) + offsetY, fontSize, style) fontSize = fontSize * 1.2 - offset = (fontSize*0.48) - font2:Print(Spring.I18N('ui.idleBuilders.sleeping'), iconRect[1]+((iconRect[3]-iconRect[1])/2)+offset, iconRect[2]+((iconRect[4]-iconRect[2])/2)-offset+offsetY, fontSize, style) + offset = (fontSize * 0.48) + font2:Print(Spring.I18N("ui.idleBuilders.sleeping"), iconRect[1] + ((iconRect[3] - iconRect[1]) / 2) + offset, iconRect[2] + ((iconRect[4] - iconRect[2]) / 2) - offset + offsetY, fontSize, style) font2:End() end - if numIcons > 0 then local iconCounter = 0 iconButtons = {} - for i=1, maxIcons do + for i = 1, maxIcons do if existingIcons[i] then local iconRect = { - backgroundRect[1]+backgroundPadding+((iconSize-backgroundPadding)*iconCounter)+startOffsetX, - backgroundRect[2]+(posY-height > 0 and backgroundPadding or 0), - backgroundRect[1]+backgroundPadding+(iconSize-backgroundPadding)+((iconSize-backgroundPadding)*iconCounter)+startOffsetX, - backgroundRect[4]-backgroundPadding + backgroundRect[1] + backgroundPadding + ((iconSize - backgroundPadding) * iconCounter) + startOffsetX, + backgroundRect[2] + (posY - height > 0 and backgroundPadding or 0), + backgroundRect[1] + backgroundPadding + (iconSize - backgroundPadding) + ((iconSize - backgroundPadding) * iconCounter) + startOffsetX, + backgroundRect[4] - backgroundPadding, } local unitCount = #idleList[existingIcons[i]] local unitDefID = existingIcons[i] - gl.Color(1,1,1,1) - iconButtons[#iconButtons+1] = {iconRect[1],iconRect[2],iconRect[3],iconRect[4],i} - local iconSize = iconRect[3]-iconRect[1]-iconMargin-iconMargin + gl.Color(1, 1, 1, 1) + iconButtons[#iconButtons + 1] = { iconRect[1], iconRect[2], iconRect[3], iconRect[4], i } + local iconSize = iconRect[3] - iconRect[1] - iconMargin - iconMargin local usedIconSize = iconSize * usedIconSizeMult local offset = 0 if showStack then if unitCount > 4 then - usedIconSize = floor(usedIconSize*0.78) + usedIconSize = floor(usedIconSize * 0.78) offset = floor((iconSize - usedIconSize) / 4) elseif unitCount > 3 then - usedIconSize = floor(usedIconSize*0.83) + usedIconSize = floor(usedIconSize * 0.83) offset = floor((iconSize - usedIconSize) / 3) - elseif unitCount> 2 then - usedIconSize = floor(usedIconSize*0.86) + elseif unitCount > 2 then + usedIconSize = floor(usedIconSize * 0.86) offset = floor((iconSize - usedIconSize) / 2) elseif unitCount > 1 then - usedIconSize = floor(usedIconSize*0.88) - offset = iconSize - (usedIconSize*1.06) + usedIconSize = floor(usedIconSize * 0.88) + offset = iconSize - (usedIconSize * 1.06) else - usedIconSize = floor(usedIconSize*0.94) + usedIconSize = floor(usedIconSize * 0.94) offset = iconSize - usedIconSize end end - local texSize = floor(iconSize*1.33) + local texSize = floor(iconSize * 1.33) local zoom = i == hoveredIcon and (b and 0.15 or 0.105) or 0.05 local highlightOpacity = 0 if i == hoveredIcon then @@ -246,44 +236,24 @@ local function drawContent() end if showStack then if unitCount > 4 then - drawIcon( - unitDefID, - {iconRect[1]+iconMargin+(offset*4), iconRect[4]-iconMargin-(offset*4)-usedIconSize, iconRect[1]+iconMargin+(offset*4)+usedIconSize, iconRect[4]-iconMargin-(offset*4)}, - 0.33, zoom, texSize, highlightOpacity - ) + drawIcon(unitDefID, { iconRect[1] + iconMargin + (offset * 4), iconRect[4] - iconMargin - (offset * 4) - usedIconSize, iconRect[1] + iconMargin + (offset * 4) + usedIconSize, iconRect[4] - iconMargin - (offset * 4) }, 0.33, zoom, texSize, highlightOpacity) end if unitCount > 3 then - drawIcon( - unitDefID, - {iconRect[1]+iconMargin+(offset*3), iconRect[4]-iconMargin-(offset*3)-usedIconSize, iconRect[1]+iconMargin+(offset*3)+usedIconSize, iconRect[4]-iconMargin-(offset*3)}, - 0.45, zoom, texSize, highlightOpacity - ) + drawIcon(unitDefID, { iconRect[1] + iconMargin + (offset * 3), iconRect[4] - iconMargin - (offset * 3) - usedIconSize, iconRect[1] + iconMargin + (offset * 3) + usedIconSize, iconRect[4] - iconMargin - (offset * 3) }, 0.45, zoom, texSize, highlightOpacity) end if unitCount > 2 then - drawIcon( - unitDefID, - {iconRect[1]+iconMargin+(offset*2), iconRect[4]-iconMargin-(offset*2)-usedIconSize, iconRect[1]+iconMargin+(offset*2)+usedIconSize, iconRect[4]-iconMargin-(offset*2)}, - 0.55, zoom, texSize, highlightOpacity - ) + drawIcon(unitDefID, { iconRect[1] + iconMargin + (offset * 2), iconRect[4] - iconMargin - (offset * 2) - usedIconSize, iconRect[1] + iconMargin + (offset * 2) + usedIconSize, iconRect[4] - iconMargin - (offset * 2) }, 0.55, zoom, texSize, highlightOpacity) end if unitCount > 1 then - drawIcon( - unitDefID, - {iconRect[1]+iconMargin+offset, iconRect[4]-iconMargin-offset-usedIconSize, iconRect[1]+iconMargin+offset+usedIconSize, iconRect[4]-iconMargin-offset}, - 0.7, zoom, texSize, highlightOpacity - ) + drawIcon(unitDefID, { iconRect[1] + iconMargin + offset, iconRect[4] - iconMargin - offset - usedIconSize, iconRect[1] + iconMargin + offset + usedIconSize, iconRect[4] - iconMargin - offset }, 0.7, zoom, texSize, highlightOpacity) end end - drawIcon( - unitDefID, - {iconRect[1]+iconMargin, iconRect[4]-iconMargin-usedIconSize, iconRect[1]+iconMargin+usedIconSize, iconRect[4]-iconMargin}, - 1, zoom, texSize, highlightOpacity - ) + drawIcon(unitDefID, { iconRect[1] + iconMargin, iconRect[4] - iconMargin - usedIconSize, iconRect[1] + iconMargin + usedIconSize, iconRect[4] - iconMargin }, 1, zoom, texSize, highlightOpacity) if unitCount > 1 then - local fontSize = height*vsy*0.39 + local fontSize = height * vsy * 0.39 font:Begin(true) - font:Print('\255\240\240\240'..unitCount, iconRect[1]+iconMargin+(fontSize*0.18), iconRect[4]-iconMargin-(fontSize*0.92), fontSize, "o") + font:Print("\255\240\240\240" .. unitCount, iconRect[1] + iconMargin + (fontSize * 0.18), iconRect[4] - iconMargin - (fontSize * 0.92), fontSize, "o") font:End() end @@ -294,8 +264,7 @@ local function drawContent() end local function isWorkerUnitIdle(unitID, unitDefID) - return inIdleWorkerTask[unitID] - or (unitConf[unitDefID] and spGetFactoryCommandCount(unitID) or spGetUnitCommandCount(unitID)) == 0 + return inIdleWorkerTask[unitID] or (unitConf[unitDefID] and spGetFactoryCommandCount(unitID) or spGetUnitCommandCount(unitID)) == 0 end local function updateList(force) @@ -320,13 +289,15 @@ local function updateList(force) existingIcons[numIcons] = unitDefID end - table.sort(existingIcons, function (a,b) return a < b end) + table.sort(existingIcons, function(a, b) + return a < b + end) local prevhoveredIcon = hoveredIcon hoveredIcon = -1 local x, y = spGetMouseState() if iconButtons then - for i,v in pairs(iconButtons) do + for i, v in pairs(iconButtons) do if math_isInRect(x, y, iconButtons[i][1], iconButtons[i][2], iconButtons[i][3], iconButtons[i][4]) then hoveredIcon = iconButtons[i][5] break @@ -401,7 +372,7 @@ local function updateList(force) floor(posX * vsx), floor(posY * vsy), floor(posX * vsx) + usedWidth, - floor(posY * vsy) + usedHeight + floor(posY * vsy) + usedHeight, } if backgroundRect and backgroundRect[3] ~= prevBackgroundX2 then if uiBgTex then @@ -412,7 +383,7 @@ local function updateList(force) end if not uiBgTex then - uiBgTex = gl.CreateTexture(mathFloor(uiTexWidth), mathFloor(backgroundRect[4]-backgroundRect[2]), { + uiBgTex = gl.CreateTexture(mathFloor(uiTexWidth), mathFloor(backgroundRect[4] - backgroundRect[2]), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -420,20 +391,19 @@ local function updateList(force) gl.R2tHelper.RenderInRect(uiBgTex, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], drawBackground, true) end if not uiTex then - uiTex = gl.CreateTexture(mathFloor(uiTexWidth)*2, mathFloor(backgroundRect[4]-backgroundRect[2])*2, { + uiTex = gl.CreateTexture(mathFloor(uiTexWidth) * 2, mathFloor(backgroundRect[4] - backgroundRect[2]) * 2, { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end - gl.R2tHelper.RenderInRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1]+uiTexWidth, backgroundRect[4], drawContent, true) + gl.R2tHelper.RenderInRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1] + uiTexWidth, backgroundRect[4], drawContent, true) end end local function checkUnitGroupsPos(isViewresize) - - if WG['unitgroups'] then - local px, py, sx, sy = WG['unitgroups'].getPosition() + if WG["unitgroups"] then + local px, py, sx, sy = WG["unitgroups"].getPosition() local oldPosX, oldPosY = posX, posY posY = py / vsy posX = (sx + widgetSpaceMargin) / vsx @@ -444,8 +414,8 @@ local function checkUnitGroupsPos(isViewresize) doUpdateForce = true end else - if buildmenuBottomPosition and not buildmenuAlwaysShow and WG['buildmenu'] and WG['info'] then - if (not selectedUnits[1] or not WG['buildmenu'].getIsShowing()) and (posX > 0 or not WG['info'].getIsShowing()) then + if buildmenuBottomPosition and not buildmenuAlwaysShow and WG["buildmenu"] and WG["info"] then + if (not selectedUnits[1] or not WG["buildmenu"].getIsShowing()) and (posX > 0 or not WG["info"].getIsShowing()) then if posY ~= 0 then posY = 0 if not isViewresize then @@ -472,9 +442,9 @@ function widget:ViewResize() vsx, vsy = spGetViewGeometry() height = setHeight * uiScale - local outlineMult = math.clamp(1/(vsy/1400), 1, 1.5) - font2 = WG['fonts'].getFont() - font = WG['fonts'].getFont(2) + local outlineMult = math.clamp(1 / (vsy / 1400), 1, 1.5) + font2 = WG["fonts"].getFont() + font = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner backgroundPadding = WG.FlowUI.elementPadding @@ -484,51 +454,50 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element UiUnit = WG.FlowUI.Draw.Unit - if WG['buildmenu'] then - buildmenuBottomPosition = WG['buildmenu'].getBottomPosition() - buildmenuIsShowing = WG['buildmenu'].getIsShowing() + if WG["buildmenu"] then + buildmenuBottomPosition = WG["buildmenu"].getBottomPosition() + buildmenuIsShowing = WG["buildmenu"].getIsShowing() end local omPosX, omPosY, omWidth, omHeight = 0, 0, 0, 0 - if WG['ordermenu'] then - omPosX, omPosY, omWidth, omHeight = WG['ordermenu'].getPosition() + if WG["ordermenu"] then + omPosX, omPosY, omWidth, omHeight = WG["ordermenu"].getPosition() end ordermenuPosY = omPosY if buildmenuBottomPosition then - posY = omHeight + (widgetSpaceMargin/vsy) + posY = omHeight + (widgetSpaceMargin / vsy) if omPosX <= 0.01 then - posX = omPosX + omWidth + (widgetSpaceMargin/vsx) + posX = omPosX + omWidth + (widgetSpaceMargin / vsx) else posX = 0 end else posY = 0 - posX = omPosX + omWidth + (widgetSpaceMargin/vsx) + posX = omPosX + omWidth + (widgetSpaceMargin / vsx) end if buildmenuBottomPosition and not buildmenuAlwaysShow then buildmenuShowingPosY = posY - if (not selectedUnits[1] or not WG['buildmenu'].getIsShowing()) then + if not selectedUnits[1] or not WG["buildmenu"].getIsShowing() then posY = 0 end end - if doCheckUnitGroupsPos then -- this is the worlds stupides workaround for not creating display lists in intialize or update with unitpics too early, especially seen in save games and scenarios. + if doCheckUnitGroupsPos then -- this is the worlds stupides workaround for not creating display lists in intialize or update with unitpics too early, especially seen in save games and scenarios. checkUnitGroupsPos(true) end iconMargin = floor((backgroundPadding * 0.5) + 0.5) - iconSize = floor((height * vsy) - (posY-height > 0 and backgroundPadding or 0)) - usedHeight = iconSize + (posY-height > 0 and backgroundPadding or 0) + iconSize = floor((height * vsy) - (posY - height > 0 and backgroundPadding or 0)) + usedHeight = iconSize + (posY - height > 0 and backgroundPadding or 0) - if WG['unitgroups'] then - local px, py, sx, sy = WG['unitgroups'].getPosition() + if WG["unitgroups"] then + local px, py, sx, sy = WG["unitgroups"].getPosition() local oldPosX, oldPosY = posX, posY posY = py / vsy posX = (sx + widgetSpaceMargin) / vsx end end - function widget:LanguageChanged() refreshUnitDefs() end @@ -553,13 +522,13 @@ function widget:Initialize() initializeGameFrame = spGetGameFrame() widget:ViewResize() widget:PlayerChanged() - WG['idlebuilders'] = {} - WG['idlebuilders'].getPosition = function() + WG["idlebuilders"] = {} + WG["idlebuilders"].getPosition = function() return posX, posY, backgroundRect and backgroundRect[3] or posX, backgroundRect and backgroundRect[4] or posY + usedHeight end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end @@ -575,15 +544,13 @@ function widget:Shutdown() gl.DeleteTexture(uiTex) uiTex = nil end - if WG['guishader'] then - WG.FlowUI.guishaderDeleteDlist('idlebuilders') + if WG["guishader"] then + WG.FlowUI.guishaderDeleteDlist("idlebuilders") dlistGuishader = nil end - WG['idlebuilders'] = nil + WG["idlebuilders"] = nil end - - local sec = 0 local sec2 = 0 local timerStart = Spring.GetTimer() @@ -596,7 +563,7 @@ local function Update() return end - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then return end local now = Spring.GetTimer() @@ -613,29 +580,29 @@ local function Update() if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then hovered = true - local tooltipTitle = Spring.I18N('ui.idleBuilders.name') - local tooltipAddition = '' + local tooltipTitle = Spring.I18N("ui.idleBuilders.name") + local tooltipAddition = "" if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - for i,v in pairs(iconButtons) do + for i, v in pairs(iconButtons) do if math_isInRect(x, y, iconButtons[i][1], iconButtons[i][2], iconButtons[i][3], iconButtons[i][4]) then local unitDefID = existingIcons[i] if unitDefID then - tooltipTitle = Spring.I18N('ui.idleBuilders.idle', { unit = unitHumanName[unitDefID], highlightColor = "\255\190\255\190" }) + tooltipTitle = Spring.I18N("ui.idleBuilders.idle", { unit = unitHumanName[unitDefID], highlightColor = "\255\190\255\190" }) if #idleList[unitDefID] > 1 then - tooltipAddition = Spring.I18N('ui.idleBuilders.controls').. '\n'..Spring.I18N('ui.idleBuilders.controls1') + tooltipAddition = Spring.I18N("ui.idleBuilders.controls") .. "\n" .. Spring.I18N("ui.idleBuilders.controls1") else - tooltipAddition = tooltipAddition ..Spring.I18N('ui.idleBuilders.controls1') + tooltipAddition = tooltipAddition .. Spring.I18N("ui.idleBuilders.controls1") end end break end end end - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('idlebuilders', tooltipAddition, nil, nil, tooltipTitle) + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("idlebuilders", tooltipAddition, nil, nil, tooltipTitle) end - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") if b then sec = sec + 0.4 end @@ -647,25 +614,25 @@ local function Update() if sec > 0.33 then sec = 0 - if WG['buildmenu'] then - if buildmenuBottomPosition ~= WG['buildmenu'].getBottomPosition() or buildmenuIsShowing ~= WG['buildmenu'].getIsShowing() then + if WG["buildmenu"] then + if buildmenuBottomPosition ~= WG["buildmenu"].getBottomPosition() or buildmenuIsShowing ~= WG["buildmenu"].getIsShowing() then widget:ViewResize() doUpdate = true end end - if WG['ordermenu'] then + if WG["ordermenu"] then local prevOrdermenuPosY = ordermenuPosY - ordermenuPosY = select(2, WG['ordermenu'].getPosition()) + ordermenuPosY = select(2, WG["ordermenu"].getPosition()) if ordermenuPosY ~= prevOrdermenuPosY then widget:ViewResize() doUpdate = true end end - doUpdate = true -- TODO: find a way to detect changes and only doUpdate then + doUpdate = true -- TODO: find a way to detect changes and only doUpdate then -- detect guishader toggle: force refresh when it comes back on - local guishaderActive = WG['guishader'] ~= nil + local guishaderActive = WG["guishader"] ~= nil if guishaderActive and not guishaderWasActive then checkGuishader(true) end @@ -692,7 +659,7 @@ function widget:DrawScreen() end if uiTex then --content - gl.R2tHelper.BlendTexRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1]+uiTexWidth, backgroundRect[4], true) + gl.R2tHelper.BlendTexRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1] + uiTexWidth, backgroundRect[4], true) end end end @@ -706,7 +673,7 @@ function widget:MousePress(x, y, button) if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then local _, _, _, shift = Spring.GetModKeyState() if button == 1 or button == 3 then - for i,v in pairs(iconButtons) do + for i, v in pairs(iconButtons) do if math_isInRect(x, y, iconButtons[i][1], iconButtons[i][2], iconButtons[i][3], iconButtons[i][4]) then local unitDefID = existingIcons[i] if unitDefID then @@ -721,7 +688,7 @@ function widget:MousePress(x, y, button) else clicks[unitDefID] = 1 end - num = (clicks[unitDefID]) % (#idleList[unitDefID]) + 1 + num = clicks[unitDefID] % #idleList[unitDefID] + 1 end units = { idleList[unitDefID][num] } end @@ -731,7 +698,7 @@ function widget:MousePress(x, y, button) Spring.SendCommands("viewselection") end if playSounds then - Spring.PlaySoundFile((button == 3 and rightclick or leftclick), soundVolume, 'ui') + Spring.PlaySoundFile((button == 3 and rightclick or leftclick), soundVolume, "ui") end return true end @@ -745,10 +712,9 @@ function widget:SelectionChanged(sel) selectedUnits = sel or {} end - function widget:GetConfigData() return { - alwaysShow = alwaysShow + alwaysShow = alwaysShow, } end diff --git a/luaui/Widgets/gui_info.lua b/luaui/Widgets/gui_info.lua index 4355f2512f3..b13dfd98d22 100644 --- a/luaui/Widgets/gui_info.lua +++ b/luaui/Widgets/gui_info.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "April 2020", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end @@ -27,42 +27,42 @@ local displayMapPosition = false local activeCmdID local emptyInfo = false -local showEngineTooltip = false -- straight up display old engine delivered text +local showEngineTooltip = false -- straight up display old engine delivered text local iconTypes = VFS.Include("gamedata/icontypes.lua") local vsx, vsy = Spring.GetViewGeometry() -local hoverType, hoverData = '', '' -local customHoverType, customHoverData = nil, nil -- For external widgets (like PIP) to supply hover info -local sound_button = 'LuaUI/Sounds/buildbar_add.wav' -local sound_button2 = 'LuaUI/Sounds/buildbar_rem.wav' +local hoverType, hoverData = "", "" +local customHoverType, customHoverData = nil, nil -- For external widgets (like PIP) to supply hover info +local sound_button = "LuaUI/Sounds/buildbar_add.wav" +local sound_button2 = "LuaUI/Sounds/buildbar_rem.wav" local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) local backgroundRect = { 0, 0, 0, 0 } -local currentTooltip = '' +local currentTooltip = "" local lastUpdateClock = 0 local infoShows = false local isPregame -local tooltipTitleColor = '\255\205\255\205' -local tooltipTextColor = '\255\255\255\255' -local tooltipLabelTextColor = '\255\200\200\200' -local tooltipDarkTextColor = '\255\133\133\133' -local tooltipValueColor = '\255\255\255\255' -local tooltipValueWhiteColor = '\255\255\255\255' -local tooltipValueYellowColor = '\255\253\192\76' +local tooltipTitleColor = "\255\205\255\205" +local tooltipTextColor = "\255\255\255\255" +local tooltipLabelTextColor = "\255\200\200\200" +local tooltipDarkTextColor = "\255\133\133\133" +local tooltipValueColor = "\255\255\255\255" +local tooltipValueWhiteColor = "\255\255\255\255" +local tooltipValueYellowColor = "\255\253\192\76" -- Cache frequently used color strings local cachedColorStrings = { - white = '\255\233\233\233', - grey = '\255\215\215\215', + white = "\255\233\233\233", + grey = "\255\215\215\215", } local selectionHowto = tooltipTextColor .. "Left click" .. tooltipLabelTextColor .. ": Select\n " .. tooltipTextColor .. " + CTRL" .. tooltipLabelTextColor .. ": Select units of this type on map\n " .. tooltipTextColor .. " + ALT" .. tooltipLabelTextColor .. ": Select 1 single unit of this unit type\n " .. tooltipTextColor .. "Right click" .. tooltipLabelTextColor .. ": Remove\n " .. tooltipTextColor .. " + CTRL" .. tooltipLabelTextColor .. ": Remove only 1 unit from that unit type\n " .. tooltipTextColor .. "Middle click" .. tooltipLabelTextColor .. ": Move to center location\n " .. tooltipTextColor .. " + CTRL" .. tooltipLabelTextColor .. ": Move to center off whole selection" -local anonymousName = '?????' +local anonymousName = "?????" local dlistGuishader, bgpadding, ViewResizeUpdate, texOffset, displayMode local loadedFontSize, font, font2, font2, cfgDisplayUnitID, cfgDisplayUnitDefID, rankTextures @@ -95,7 +95,6 @@ local spGetUnitWeaponState = Spring.GetUnitWeaponState local spGetUnitRulesParam = Spring.GetUnitRulesParam local spColorString = Spring.Utilities.Color.ToString - local math_floor = math.floor local math_ceil = math.ceil local math_min = math.min @@ -159,19 +158,31 @@ end local rightMouseButtonMap = {} local emptyTable = {} local shiftTable = { "shift" } -local unloadParams = { 0, 0, 0, 0 } -- x, y, z, unitID +local unloadParams = { 0, 0, 0, 0 } -- x, y, z, unitID local viewSelectionCmd = { "viewselection" } local showWeaponGroups = { ["0"] = true, ["1"] = true } -- <0:=fake weapons, 0:=always active, 1:=primary set, >1:=alternate sets local function refreshUnitInfo() local builderTraits = { - canBuild = function(def) return def.isFactory or next(def.buildOptions) ~= nil end, - canAssist = function(def) return not def.isFactory and def.canAssist end, - canCapture = function(def) return not def.isFactory and def.canCapture and def.buildDistance > 0 end, - canReclaim = function(def) return not def.isFactory and def.canReclaim and def.buildDistance > 0 end, - canRepair = function(def) return not def.isFactory and def.canRepair and def.buildDistance > 0 end, - canRestore = function(def) return not def.isFactory and def.canRestore and def.buildDistance > 0 end, + canBuild = function(def) + return def.isFactory or next(def.buildOptions) ~= nil + end, + canAssist = function(def) + return not def.isFactory and def.canAssist + end, + canCapture = function(def) + return not def.isFactory and def.canCapture and def.buildDistance > 0 + end, + canReclaim = function(def) + return not def.isFactory and def.canReclaim and def.buildDistance > 0 + end, + canRepair = function(def) + return not def.isFactory and def.canRepair and def.buildDistance > 0 + end, + canRestore = function(def) + return not def.isFactory and def.canRestore and def.buildDistance > 0 + end, } local function hasBuilderTrait(def) for trait, check in pairs(builderTraits) do @@ -189,9 +200,8 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].icontype = iconTypes[unitDef.iconType].bitmap end - if unitDef.name == 'armdl' or unitDef.name == 'cordl' or unitDef.name == 'armlance' or unitDef.name == 'cortitan' - or (unitDef.minWaterDepth > 0 or unitDef.modCategories['ship']) then - if not (unitDef.modCategories['hover'] or (unitDef.modCategories['mobile'] and unitDef.modCategories['canbeuw'])) then + if unitDef.name == "armdl" or unitDef.name == "cordl" or unitDef.name == "armlance" or unitDef.name == "cortitan" or (unitDef.minWaterDepth > 0 or unitDef.modCategories["ship"]) then + if not (unitDef.modCategories["hover"] or (unitDef.modCategories["mobile"] and unitDef.modCategories["canbeuw"])) then isWaterUnit[unitDefID] = true end end @@ -240,7 +250,7 @@ local function refreshUnitInfo() if unitDef.customParams.paralyzemultiplier then unitDefInfo[unitDefID].paralyzeMult = tonumber(unitDef.customParams.paralyzemultiplier) end - unitDefInfo[unitDefID].armorType = Game.armorTypes[unitDef.armorType or 0] or '???' + unitDefInfo[unitDefID].armorType = Game.armorTypes[unitDef.armorType or 0] or "???" if unitDef.sightDistance > 0 then unitDefInfo[unitDefID].sightDistance = unitDef.sightDistance @@ -291,7 +301,6 @@ local function refreshUnitInfo() end local weapons = unitDef.weapons - ----------------------------------------------------- -- Utility functions for calculating weapon values -- ----------------------------------------------------- @@ -305,26 +314,25 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].maxdps = (unitDefInfo[unitDefID].maxdps or 0) + maxDPS end - local function calculateLaserDPS(def, damage) local minIntensity = math.max(def.minIntensity, 0.5) - local mindps = minIntensity*(damage * def.salvoSize / def.reload) + local mindps = minIntensity * (damage * def.salvoSize / def.reload) local maxdps = damage * def.salvoSize / def.reload return mindps, maxdps end local function calculateWeaponDPS(def, damage) local reloadDPS = damage * (def.salvoSize * def.projectiles) / def.reload - local stockpileDPS = damage * (def.salvoSize * def.projectiles) / (def.stockpile and def.stockpileTime/30 or def.reload) + local stockpileDPS = damage * (def.salvoSize * def.projectiles) / (def.stockpile and def.stockpileTime / 30 or def.reload) return math_min(reloadDPS, stockpileDPS), math_max(reloadDPS, stockpileDPS) end local function calculateClusterDPS(def, damage) - local munition = unitDef.name .. '_' .. def.customParams.cluster_def + local munition = unitDef.name .. "_" .. def.customParams.cluster_def local cmNumber = def.customParams.cluster_number local cmDamage = WeaponDefNames[munition].damages[0] - local mainDps = (def.salvoSize * def.projectiles) / def.reload * (damage) + local mainDps = (def.salvoSize * def.projectiles) / def.reload * damage local cmunDps = (def.salvoSize * def.projectiles) / def.reload * (cmNumber * cmDamage) return mainDps, mainDps + cmunDps end @@ -337,7 +345,6 @@ local function refreshUnitInfo() return impactDps, damageMax end - local function setEnergyAndMetalCosts(def) if def.energyCost > 0 and (not unitDefInfo[unitDefID].energyPerShot or def.energyCost > unitDefInfo[unitDefID].energyPerShot) then unitDefInfo[unitDefID].energyPerShot = def.energyCost @@ -354,7 +361,7 @@ local function refreshUnitInfo() local function refreshUnitWeaponInfo(i, weaponDef, isPrimaryWeapon) unitDefInfo[unitDefID].weapons[i] = weaponDef - if isPrimaryWeapon and weapons[i].onlyTargets['vtol'] then + if isPrimaryWeapon and weapons[i].onlyTargets["vtol"] then unitDefInfo[unitDefID].isAaUnit = true -- displays airLOS range end @@ -362,7 +369,6 @@ local function refreshUnitInfo() if weaponDef.interceptor ~= 0 and weaponDef.coverageRange then unitDefInfo[unitDefID].maxCoverage = math.max(unitDefInfo[unitDefID].maxCoverage or 1, weaponDef.coverageRange) - elseif weaponDef.shieldRadius and weaponDef.shieldRadius > 0 then if #weapons == 1 then unitDefInfo[unitDefID].weapons = {} @@ -372,61 +378,57 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].shieldCapacity = weaponDef.shieldPower unitDefInfo[unitDefID].shieldRechargeRate = weaponDef.shieldPowerRegen unitDefInfo[unitDefID].shieldRechargeCost = weaponDef.shieldPowerRegenEnergy - else - if unitDef.name == 'armamb' or unitDef.name == 'cortoast' then -- weapons with low/high traj, this list is incomplete + if unitDef.name == "armamb" or unitDef.name == "cortoast" then -- weapons with low/high traj, this list is incomplete unitExempt = true - if i==1 then --Calculating using first weapon only + if i == 1 then --Calculating using first weapon only addDPS(calculateWeaponDPS(weaponDef, weaponDef.damages[0])) --Damage to default armor category end - elseif - unitDef.customParams.evocomlvl or -- use primary weapon for evolving commanders - unitDef.name == 'armcom' or -- ignore underwater secondary - unitDef.name == 'corcom' or - unitDef.name == 'legcom' or - unitDef.name == 'corkarg' or -- ignore secondary weapons, kick - unitDef.name == 'armguard' or -- ignore high-trajectory modes - unitDef.name == 'corpun' or - unitDef.name == 'legcluster' or - unitDef.name == 'leglob' or - unitDef.name == 'legnavyfrigate' or - unitDef.name == 'armamb' or - unitDef.name == 'cortoast' or - unitDef.name == 'armvang' + unitDef.customParams.evocomlvl -- use primary weapon for evolving commanders + or unitDef.name == "armcom" -- ignore underwater secondary + or unitDef.name == "corcom" + or unitDef.name == "legcom" + or unitDef.name == "corkarg" -- ignore secondary weapons, kick + or unitDef.name == "armguard" -- ignore high-trajectory modes + or unitDef.name == "corpun" + or unitDef.name == "legcluster" + or unitDef.name == "leglob" + or unitDef.name == "legnavyfrigate" + or unitDef.name == "armamb" + or unitDef.name == "cortoast" + or unitDef.name == "armvang" then unitExempt = true - if i == 1 then --Calculating using first weapon only + if i == 1 then --Calculating using first weapon only setEnergyAndMetalCosts(weaponDef) if weaponDef.type == "BeamLaser" then addDPS(calculateLaserDPS(weaponDef, weaponDef.damages[0])) elseif weaponDef.customParams.cluster then -- Bullets that shoot other, smaller bullets addDPS(calculateClusterDPS(weaponDef, weaponDef.damages[0])) - elseif weapons[i].onlyTargets['vtol'] ~= nil then + elseif weapons[i].onlyTargets["vtol"] ~= nil then addDPS(calculateWeaponDPS(weaponDef, weaponDef.damages[armorIndex.vtol])) --Damage to air category else addDPS(calculateWeaponDPS(weaponDef, weaponDef.damages[0])) --Damage to default armor category end end - - elseif unitDef.name == 'corkorg' then --excluding korstomp from dps calcuation for juggernaut + elseif unitDef.name == "corkorg" then --excluding korstomp from dps calcuation for juggernaut unitExempt = true - if i==1 then + if i == 1 then local defDmg - defDmg = weaponDef.damages[0] --Damage to default armor category + defDmg = weaponDef.damages[0] --Damage to default armor category addDPS(calculateWeaponDPS(weaponDef, defDmg)) end - if i==2 then + if i == 2 then setEnergyAndMetalCosts(weaponDef) addDPS(calculateLaserDPS(weaponDef, weaponDef.damages[0])) end - if i==3 then + if i == 3 then addDPS(calculateWeaponDPS(weaponDef, weaponDef.damages[0])) --Damage to default armor category end - elseif weaponDef.customParams.area_onhit_damage and weaponDef.customParams.area_onhit_time then unitExempt = true addDPS(calculateAreaDPS(weaponDef, weaponDef.damages[0])) @@ -455,15 +457,12 @@ local function refreshUnitInfo() if unitDefInfo[unitDefID].mainWeapon == 0 then unitDefInfo[unitDefID].mainWeapon = i unitDefInfo[unitDefID].range = weaponDef.range - unitDefInfo[unitDefID].reloadTime = weaponDef.customParams.dronesuesestockpile - and weaponDef.stockpileTime - or weaponDef.reload + unitDefInfo[unitDefID].reloadTime = weaponDef.customParams.dronesuesestockpile and weaponDef.stockpileTime or weaponDef.reload end - if weaponDef.type == "BeamLaser" and not unitExempt then -- BeamLaser dps calc - + if weaponDef.type == "BeamLaser" and not unitExempt then -- BeamLaser dps calc local defDmg - if weapons[1].onlyTargets['vtol'] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category + if weapons[1].onlyTargets["vtol"] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category defDmg = weaponDef.damages[armorIndex.vtol] else defDmg = weaponDef.damages[0] @@ -472,10 +471,7 @@ local function refreshUnitInfo() setEnergyAndMetalCosts(weaponDef) if weaponDef.paralyzer ~= true then - - if weaponDef.customParams then - if weaponDef.customParams.sweepfire then unitDefInfo[unitDefID].maxdps = (weaponDef.damages[0] * weaponDef.customParams.sweepfire) / math.max(weaponDef.minIntensity, 0.5) unitDefInfo[unitDefID].mindps = weaponDef.damages[0] * weaponDef.customParams.sweepfire @@ -490,14 +486,14 @@ local function refreshUnitInfo() local minIntensity = math.max(weaponDef.minIntensity, 0.5) local prevMinDps = unitDefInfo[unitDefID].minemp or 0 local prevMaxDps = unitDefInfo[unitDefID].maxemp or 0 - local mindps = minIntensity*(weaponDef.damages[0] * weaponDef.salvoSize / weaponDef.reload) + local mindps = minIntensity * (weaponDef.damages[0] * weaponDef.salvoSize / weaponDef.reload) local maxdps = weaponDef.damages[0] * weaponDef.salvoSize / weaponDef.reload unitDefInfo[unitDefID].minemp = mindps + prevMinDps unitDefInfo[unitDefID].maxemp = maxdps + prevMaxDps end - elseif weaponDef.paralyzer == true and unitDef.name ~= 'armthor' then -- exclude thor emp missile - local defDmg = weaponDef.damages[0] --Damage to default armor category + elseif weaponDef.paralyzer == true and unitDef.name ~= "armthor" then -- exclude thor emp missile + local defDmg = weaponDef.damages[0] --Damage to default armor category local emp = math_floor(defDmg * weaponDef.salvoSize / weaponDef.reload) unitDefInfo[unitDefID].minemp = emp unitDefInfo[unitDefID].maxemp = emp @@ -505,16 +501,15 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].reloadTime = weaponDef.reload end if weaponDef.type ~= "BeamLaser" and weaponDef.paralyzer ~= true and not unitExempt then - local defDmg - if weapons[1].onlyTargets['vtol'] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category + if weapons[1].onlyTargets["vtol"] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category defDmg = weaponDef.damages[armorIndex.vtol] else defDmg = weaponDef.damages[0] end - if(defDmg > 0) then + if defDmg > 0 then addDPS(calculateWeaponDPS(weaponDef, defDmg)) setEnergyAndMetalCosts(weaponDef) end @@ -541,7 +536,7 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].mainWeapon = 1 -- All the unit's weapons were fakes. end - if unitDef.customParams.unitgroup and unitDef.customParams.unitgroup == 'explo' and unitDef.deathExplosion and WeaponDefNames[unitDef.deathExplosion] then + if unitDef.customParams.unitgroup and unitDef.customParams.unitgroup == "explo" and unitDef.deathExplosion and WeaponDefNames[unitDef.deathExplosion] then local weapon = WeaponDefs[WeaponDefNames[unitDef.deathExplosion].id] if weapon then local dmg = weapon.damages[Game.armorTypes["default"]] @@ -553,8 +548,8 @@ local function refreshUnitInfo() end -- Account for sub-unit damages, namely carriers and drones. - local mins = { "mindps", "minemp", } - local maxs = { "maxdps", "maxemp", } + local mins = { "mindps", "minemp" } + local maxs = { "maxdps", "maxemp" } for unitDefID, unitDef in pairs(UnitDefs) do local unitInfo = unitDefInfo[unitDefID] for index, weapon in ipairs(unitDef.weapons) do @@ -580,7 +575,7 @@ local function refreshUnitInfo() end -- Convert aggregated values to display formats last to avoid rounding errors. - local summedKeys = { "mindps", "maxdps", "minemp", "maxemp", } + local summedKeys = { "mindps", "maxdps", "minemp", "maxemp" } for unitDefID, unitInfo in pairs(unitDefInfo) do for _, key in pairs(summedKeys) do if type(unitInfo[key]) == "number" then @@ -590,8 +585,8 @@ local function refreshUnitInfo() end end -local groups, unitGroup = {}, {} -- retrieves from buildmenu in initialize -local unitOrder = {} -- retrieves from buildmenu in initialize +local groups, unitGroup = {}, {} -- retrieves from buildmenu in initialize +local unitOrder = {} -- retrieves from buildmenu in initialize local unitDisabled = {} local minWaterUnitDepth = -11 @@ -602,7 +597,7 @@ if mapMinWater <= minWaterUnitDepth then end -- make them a disabled unit (instead of removing it entirely) if not showWaterUnits then - for unitDefID,_ in pairs(isWaterUnit) do + for unitDefID, _ in pairs(isWaterUnit) do unitDisabled[unitDefID] = true end end @@ -624,7 +619,7 @@ local function checkGeothermalFeatures() end end -- make them a disabled unit (instead of removing it entirely) - for unitDefID,_ in pairs(isGeothermalUnit) do + for unitDefID, _ in pairs(isGeothermalUnit) do if not showGeothermalUnits then unitDisabled[unitDefID] = true else @@ -636,7 +631,7 @@ local function checkGeothermalFeatures() end local function checkGuishader(force) - dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, 'info', function() + dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, "info", function() RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner, 0, 1, 0, 0) end, force) end @@ -653,7 +648,7 @@ function widget:ViewResize() width = 0.2125 height = 0.14 * ui_scale - width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens + width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens width = width * ui_scale -- make pixel aligned height = math_floor(height * vsy) / vsy @@ -680,8 +675,8 @@ function widget:ViewResize() checkGuishader(true) - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) end function GetColor(colormap, slider) @@ -702,8 +697,7 @@ function GetColor(colormap, slider) local col1, col2 = colormap[iposn], colormap[iposn + 1] - return col1[1] * ia + col2[1] * aa, col1[2] * ia + col2[2] * aa, - col1[3] * ia + col2[3] * aa, col1[4] * ia + col2[4] * aa + return col1[1] * ia + col2[1] * aa, col1[2] * ia + col2[2] * aa, col1[3] * ia + col2[3] * aa, col1[4] * ia + col2[4] * aa end function widget:GameFrame() @@ -724,58 +718,58 @@ function widget:Initialize() widget:ViewResize() - WG['info'] = {} - WG['info'].getShowBuilderBuildlist = function() + WG["info"] = {} + WG["info"].getShowBuilderBuildlist = function() return showBuilderBuildlist end - WG['info'].setShowBuilderBuildlist = function(value) + WG["info"].setShowBuilderBuildlist = function(value) showBuilderBuildlist = value end - WG['info'].getDisplayMapPosition = function() + WG["info"].getDisplayMapPosition = function() return displayMapPosition end - WG['info'].setDisplayMapPosition = function(value) + WG["info"].setDisplayMapPosition = function(value) displayMapPosition = value end - WG['info'].getAlwaysShow = function() + WG["info"].getAlwaysShow = function() return alwaysShow end - WG['info'].setAlwaysShow = function(value) + WG["info"].setAlwaysShow = function(value) alwaysShow = value end - WG['info'].displayUnitID = function(unitID) + WG["info"].displayUnitID = function(unitID) cfgDisplayUnitID = unitID end - WG['info'].clearDisplayUnitID = function() + WG["info"].clearDisplayUnitID = function() cfgDisplayUnitID = nil end - WG['info'].displayUnitDefID = function(unitDefID) + WG["info"].displayUnitDefID = function(unitDefID) cfgDisplayUnitDefID = unitDefID end - WG['info'].clearDisplayUnitDefID = function() + WG["info"].clearDisplayUnitDefID = function() cfgDisplayUnitDefID = nil end - WG['info'].getPosition = function() + WG["info"].getPosition = function() return width, height end - WG['info'].getIsShowing = function() + WG["info"].getIsShowing = function() return infoShows end - WG['info'].setCustomHover = function(hType, hData) + WG["info"].setCustomHover = function(hType, hData) -- Allow external widgets to supply custom hover info (e.g., PIP window) customHoverType = hType customHoverData = hData end - WG['info'].clearCustomHover = function() + WG["info"].clearCustomHover = function() customHoverType = nil customHoverData = nil end - if WG['buildmenu'] then - if WG['buildmenu'].getGroups then - groups, unitGroup = WG['buildmenu'].getGroups() + if WG["buildmenu"] then + if WG["buildmenu"].getGroups then + groups, unitGroup = WG["buildmenu"].getGroups() end - if WG['buildmenu'].getOrder then - unitOrder = WG['buildmenu'].getOrder() + if WG["buildmenu"].getOrder then + unitOrder = WG["buildmenu"].getOrder() -- order buildoptions for uDefID, def in pairs(unitDefInfo) do @@ -798,11 +792,11 @@ function widget:Initialize() end end - Spring.SetDrawSelectionInfo(false) -- disables springs default display of selected units count + Spring.SetDrawSelectionInfo(false) -- disables springs default display of selected units count Spring.SendCommands("tooltip 0") - if WG['rankicons'] then - rankTextures = WG['rankicons'].getRankTextures() + if WG["rankicons"] then + rankTextures = WG["rankicons"].getRankTextures() end bfcolormap = {} @@ -821,8 +815,8 @@ function widget:Shutdown() if infoTex then gl.DeleteTexture(infoTex) end - if WG['guishader'] and dlistGuishader then - WG.FlowUI.guishaderDeleteDlist('info') + if WG["guishader"] and dlistGuishader then + WG.FlowUI.guishaderDeleteDlist("info") dlistGuishader = nil end end @@ -839,7 +833,7 @@ function widget:Update(dt) if not alwaysShow and ((cameraPanMode and not doUpdate) or mouseOffScreen) and not isPregame then if SelectedUnitsCount == 0 then if dlistGuishader then - WG['guishader'].DeleteDlist('info') + WG["guishader"].DeleteDlist("info") dlistGuishader = nil end end @@ -858,8 +852,8 @@ function widget:Update(dt) if sec2 > 0.5 then sec2 = 0 - if not rankTextures and WG['rankicons'] then - rankTextures = WG['rankicons'].getRankTextures() + if not rankTextures and WG["rankicons"] then + rankTextures = WG["rankicons"].getRankTextures() end local _, _, mapMinWater, _ = Spring.GetGroundExtremes() @@ -867,8 +861,8 @@ function widget:Update(dt) if not showWaterUnits then showWaterUnits = true - for unitDefID,_ in pairs(isWaterUnit) do - if not isGeothermalUnit[unitDefID] or showGeothermalUnits then -- make sure geothermal units keep being disabled if that should be the case + for unitDefID, _ in pairs(isWaterUnit) do + if not isGeothermalUnit[unitDefID] or showGeothermalUnits then -- make sure geothermal units keep being disabled if that should be the case unitDisabled[unitDefID] = nil end end @@ -885,7 +879,6 @@ function widget:Update(dt) end end - if ViewResizeUpdate then ViewResizeUpdate = nil end @@ -899,12 +892,12 @@ function widget:Update(dt) end if displayUnitID and not Spring.ValidUnitID(displayUnitID) then - displayMode = 'text' + displayMode = "text" displayUnitID = nil displayUnitDefID = nil end - if (not alwaysShow and (cameraPanMode or mouseOffScreen) and SelectedUnitsCount == 0 and not isPregame) then + if not alwaysShow and (cameraPanMode or mouseOffScreen) and SelectedUnitsCount == 0 and not isPregame then return end @@ -962,24 +955,15 @@ local function drawSelectionCell(cellID, uDefID, usedZoom, highlightColor) usedZoom = defaultCellZoom end - glColor(1,1,1,1) - UiUnit( - cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], - cornerSize, - 1,1,1,1, - usedZoom, - nil, nil, - "#" .. uDefID, - nil, - groups[unitGroup[uDefID]] - ) + glColor(1, 1, 1, 1) + UiUnit(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cornerSize, 1, 1, 1, 1, usedZoom, nil, nil, "#" .. uDefID, nil, groups[unitGroup[uDefID]]) local selCount = selUnitsCounts[uDefID] -- unit count - calculate fontSize once local fontSize = math_min(gridHeight * 0.17, cellsize * 0.6) * (1 - ((1 + string.len(selCount)) * 0.066)) if selCount > 1 then --font2:Begin(true) - font2:Print(cachedColorStrings.white..selCount, cellRect[cellID][3] - cellPadding - (fontSize * 0.09), cellRect[cellID][2] + (fontSize * 0.3), fontSize, "ro") + font2:Print(cachedColorStrings.white .. selCount, cellRect[cellID][3] - cellPadding - (fontSize * 0.09), cellRect[cellID][2] + (fontSize * 0.3), fontSize, "ro") --font2:End() end @@ -1012,13 +996,13 @@ local function drawSelectionCell(cellID, uDefID, usedZoom, highlightColor) end if kills > 0 then - local size = math_floor((cellRect[cellID][3] - (cellRect[cellID][1] + (cellPadding*0.5)))*0.33) - glColor(0.88,0.88,0.88,0.66) + local size = math_floor((cellRect[cellID][3] - (cellRect[cellID][1] + (cellPadding * 0.5))) * 0.33) + glColor(0.88, 0.88, 0.88, 0.66) glTexture(":l:LuaUI/Images/skull.dds") - glTexRect(cellRect[cellID][3] - size+(cellPadding*0.5), cellRect[cellID][4]-size-(cellPadding*0.5), cellRect[cellID][3]+(cellPadding*0.5), cellRect[cellID][4]-(cellPadding*0.5)) + glTexRect(cellRect[cellID][3] - size + (cellPadding * 0.5), cellRect[cellID][4] - size - (cellPadding * 0.5), cellRect[cellID][3] + (cellPadding * 0.5), cellRect[cellID][4] - (cellPadding * 0.5)) glTexture(false) --font2:Begin(true) - font2:Print(cachedColorStrings.white..kills, cellRect[cellID][3] - (size * 0.5)+(cellPadding*0.5), cellRect[cellID][4] -(cellPadding*0.5)- (size * 0.5) - (fontSize * 0.19), fontSize * 0.66, "oc") + font2:Print(cachedColorStrings.white .. kills, cellRect[cellID][3] - (size * 0.5) + (cellPadding * 0.5), cellRect[cellID][4] - (cellPadding * 0.5) - (size * 0.5) - (fontSize * 0.19), fontSize * 0.66, "oc") --font2:End() end end @@ -1040,7 +1024,7 @@ local function drawSelection() for k, uDefID in pairs(unitOrder) do if selUnitsSorted[uDefID] then - if type(selUnitsSorted[uDefID]) == 'table' then + if type(selUnitsSorted[uDefID]) == "table" then selUnitTypes = selUnitTypes + 1 selectionCells[selUnitTypes] = uDefID end @@ -1054,11 +1038,11 @@ local function drawSelection() local heightVar = 0 local heightStep = (fontSize * 1.36) font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - font2:Print(tooltipTextColor .. #selectedUnits .. tooltipLabelTextColor .. " "..getCachedTranslation('ui.info.unitsselected'), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1.2) - heightVar, (fontSize * 1.23), "o") + font2:SetOutlineColor(0, 0, 0, 1) + font2:Print(tooltipTextColor .. #selectedUnits .. tooltipLabelTextColor .. " " .. getCachedTranslation("ui.info.unitsselected"), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1.2) - heightVar, (fontSize * 1.23), "o") font2:End() font:Begin(true) - font:SetOutlineColor(0,0,0,1) + font:SetOutlineColor(0, 0, 0, 1) heightVar = heightVar + (fontSize * 0.85) -- loop all unitdefs/cells (but not individual unitID's) @@ -1122,40 +1106,40 @@ local function drawSelection() totalKills = math.floor(totalKills * scale) end - local valuePlusColor = '\255\180\255\180' - local valueMinColor = '\255\255\180\180' + local valuePlusColor = "\255\180\255\180" + local valueMinColor = "\255\255\180\180" if totalMetalUse > 0 or totalMetalMake > 0 then heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.m').." " .. (totalMetalMake > 0 and valuePlusColor .. '+' .. (totalMetalMake < 10 and round(totalMetalMake, 1) or round(totalMetalMake, 0)) .. ' ' or '') .. (totalMetalUse > 0 and valueMinColor .. '-' .. (totalMetalUse < 10 and round(totalMetalUse, 1) or round(totalMetalUse, 0)) or ''), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.m") .. " " .. (totalMetalMake > 0 and valuePlusColor .. "+" .. (totalMetalMake < 10 and round(totalMetalMake, 1) or round(totalMetalMake, 0)) .. " " or "") .. (totalMetalUse > 0 and valueMinColor .. "-" .. (totalMetalUse < 10 and round(totalMetalUse, 1) or round(totalMetalUse, 0)) or ""), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") end if totalEnergyUse > 0 or totalEnergyMake > 0 then heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.e').." " .. (totalEnergyMake > 0 and valuePlusColor .. '+' .. (totalEnergyMake < 10 and round(totalEnergyMake, 1) or round(totalEnergyMake, 0)) .. ' ' or '') .. (totalEnergyUse > 0 and valueMinColor .. '-' .. (totalEnergyUse < 10 and round(totalEnergyUse, 1) or round(totalEnergyUse, 0)) or ''), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.e") .. " " .. (totalEnergyMake > 0 and valuePlusColor .. "+" .. (totalEnergyMake < 10 and round(totalEnergyMake, 1) or round(totalEnergyMake, 0)) .. " " or "") .. (totalEnergyUse > 0 and valueMinColor .. "-" .. (totalEnergyUse < 10 and round(totalEnergyUse, 1) or round(totalEnergyUse, 0)) or ""), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") end -- metal cost heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.costm').." " .. tooltipValueWhiteColor .. string.formatSI(totalMetalValue), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.costm") .. " " .. tooltipValueWhiteColor .. string.formatSI(totalMetalValue), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") -- energy cost heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.coste').."\255\255\255\128 " .. string.formatSI(totalEnergyValue), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.coste") .. "\255\255\255\128 " .. string.formatSI(totalEnergyValue), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") -- Buildpower if totalBuildPower > 0 then heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.buildpower') .. " " .. tooltipValueYellowColor .. string.formatSI(totalBuildPower), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.buildpower") .. " " .. tooltipValueYellowColor .. string.formatSI(totalBuildPower), backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") end -- kills if totalKills > 0 then heightVar = heightVar + heightStep - font:Print( tooltipLabelTextColor .. getCachedTranslation('ui.info.kills').." " .. tooltipValueColor .. totalKills, backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding*2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") + font:Print(tooltipLabelTextColor .. getCachedTranslation("ui.info.kills") .. " " .. tooltipValueColor .. totalKills, backgroundRect[1] + contentPadding, backgroundRect[4] - (bgpadding * 2.4) - (fontSize * 0.8) - heightVar, fontSize, "o") end font:End() -- selected units grid area - local gridWidth = math_floor((backgroundRect[3] - backgroundRect[1] - bgpadding) * 0.6) -- leaving some room for the totals + local gridWidth = math_floor((backgroundRect[3] - backgroundRect[1] - bgpadding) * 0.6) -- leaving some room for the totals gridHeight = math_floor((backgroundRect[4] - backgroundRect[2]) - bgpadding) -- Reuse customInfoArea table @@ -1169,7 +1153,7 @@ local function drawSelection() -- draw selected unit icons local rows = 2 - local maxRows = 15 -- just to be sure + local maxRows = 15 -- just to be sure local colls = math_ceil(selUnitTypes / rows) cellsize = math_floor(math_min(gridWidth / colls, gridHeight / rows)) while cellsize < gridHeight / (rows + 1) do @@ -1182,7 +1166,7 @@ local function drawSelection() end -- adjust grid size to add some padding at the top and right side - cellsize = math_floor((cellsize * (1 - (0.04 / rows))) + 0.5) -- leave some space at the top + cellsize = math_floor((cellsize * (1 - (0.04 / rows))) + 0.5) -- leave some space at the top cellPadding = math_max(1, math_floor(cellsize * 0.03)) customInfoArea[3] = customInfoArea[3] - cellPadding -- leave space at the right side @@ -1214,7 +1198,7 @@ local function drawSelection() cellRectEntry[1] = math_ceil(customInfoArea[3] - cellPadding - (coll * cellsize)) cellRectEntry[2] = math_ceil(customInfoArea[2] + cellPadding + ((row - 1) * cellsize)) cellRectEntry[3] = math_ceil(customInfoArea[3] - cellPadding - ((coll - 1) * cellsize)) - cellRectEntry[4] = math_ceil(customInfoArea[2] + cellPadding + ((row) * cellsize)) + cellRectEntry[4] = math_ceil(customInfoArea[2] + cellPadding + (row * cellsize)) drawSelectionCell(cellID, selectionCells[cellID], texOffset) end cellID = cellID - 1 @@ -1232,14 +1216,14 @@ end local function GetAIName(teamID) local _, _, _, name, _, options = Spring.GetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) if niceName then name = niceName --if Spring.Utilities.ShowDevUI() and options.profile then -- name = name .. " [" .. options.profile .. "]" --end end - return Spring.I18N('ui.playersList.aiName', { name = name }) + return Spring.I18N("ui.playersList.aiName", { name = name }) end local function drawUnitInfo() @@ -1250,20 +1234,10 @@ local function drawUnitInfo() if unitDefInfo[displayUnitDefID].buildPic then local iconX = backgroundRect[1] + iconPadding - local iconY = backgroundRect[4] - iconPadding - bgpadding + local iconY = backgroundRect[4] - iconPadding - bgpadding -- unit icon - glColor(1,1,1,1) - UiUnit( - iconX, iconY - iconSize, iconX + iconSize, iconY, - nil, - 1, 1, 1, 1, - 0.03, - nil, nil, - "#" .. displayUnitDefID, - (unitDefInfo[displayUnitDefID].icontype and ':l:' .. unitDefInfo[displayUnitDefID].icontype or nil), - groups[unitGroup[displayUnitDefID]], - {unitDefInfo[displayUnitDefID].metalCost, unitDefInfo[displayUnitDefID].energyCost} - ) + glColor(1, 1, 1, 1) + UiUnit(iconX, iconY - iconSize, iconX + iconSize, iconY, nil, 1, 1, 1, 1, 0.03, nil, nil, "#" .. displayUnitDefID, (unitDefInfo[displayUnitDefID].icontype and ":l:" .. unitDefInfo[displayUnitDefID].icontype or nil), groups[unitGroup[displayUnitDefID]], { unitDefInfo[displayUnitDefID].metalCost, unitDefInfo[displayUnitDefID].energyCost }) -- price local function AddSpaces(price) if price >= 1000 then @@ -1279,7 +1253,7 @@ local function drawUnitInfo() local energyPriceTextHeight = font2:GetTextHeight(energyPriceText) * size font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) font2:Print(metalPriceText, iconX + iconSize - padding, iconY - halfSize - halfSize + padding + (size * 1.07) + energyPriceTextHeight, size, "ro") font2:Print(energyPriceText, iconX + iconSize - padding, iconY - halfSize - halfSize + padding + (size * 1.07), size, "ro") font2:End() @@ -1291,15 +1265,15 @@ local function drawUnitInfo() if displayUnitID then exp = spGetUnitExperience(displayUnitID) - if exp and exp > 0.009 and WG['rankicons'] and rankTextures then + if exp and exp > 0.009 and WG["rankicons"] and rankTextures then if displayUnitID then - local rank = WG['rankicons'].getRank(displayUnitDefID, exp) + local rank = WG["rankicons"].getRank(displayUnitDefID, exp) if rankTextures[rank] then local rankIconSize = math_floor((height * vsy * 0.24) + 0.5) local rankIconMarginX = math_floor((height * vsy * 0.015) + 0.5) local rankIconMarginY = math_floor((height * vsy * 0.18) + 0.5) glColor(1, 1, 1, 0.88) - glTexture(':lr' .. (rankIconSize * 2) .. ',' .. (rankIconSize * 2) .. ':' .. rankTextures[rank]) + glTexture(":lr" .. (rankIconSize * 2) .. "," .. (rankIconSize * 2) .. ":" .. rankTextures[rank]) glTexRect(backgroundRect[3] - rankIconMarginX - rankIconSize, backgroundRect[4] - rankIconMarginY - rankIconSize, backgroundRect[3] - rankIconMarginX, backgroundRect[4] - rankIconMarginY) glTexture(false) glColor(1, 1, 1, 1) @@ -1311,32 +1285,32 @@ local function drawUnitInfo() local rankIconSize = math_floor((height * vsy * 0.16)) local rankIconMarginY = math_floor((height * vsy * 0.07) + 0.5) local rankIconMarginX = math_floor((height * vsy * 0.053) + 0.5) - glColor(0.7,0.7,0.7,0.55) + glColor(0.7, 0.7, 0.7, 0.55) glTexture(":l:LuaUI/Images/skull.dds") glTexRect(backgroundRect[3] - rankIconMarginX - rankIconSize, backgroundRect[4] - rankIconMarginY - rankIconSize, backgroundRect[3] - rankIconMarginX, backgroundRect[4] - rankIconMarginY) glTexture(false) font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - font2:Print('\255\215\215\215'..kills, backgroundRect[3] - rankIconMarginX - (rankIconSize * 0.5), backgroundRect[4] - (rankIconMarginY * 2.05) - (fontSize * 0.31), fontSize * 0.87, "oc") + font2:SetOutlineColor(0, 0, 0, 1) + font2:Print("\255\215\215\215" .. kills, backgroundRect[3] - rankIconMarginX - (rankIconSize * 0.5), backgroundRect[4] - (rankIconMarginY * 2.05) - (fontSize * 0.31), fontSize * 0.87, "oc") font2:End() end end local unitNameColor = tooltipTitleColor if SelectedUnitsCount > 0 then - if displayMode ~= 'unitdef' or (WG['buildmenu'] and (activeCmdID and activeCmdID < 0 and (not WG['buildmenu'].hoverID or (-activeCmdID == WG['buildmenu'].hoverID)))) then - unitNameColor = '\255\125\255\125' + if displayMode ~= "unitdef" or (WG["buildmenu"] and (activeCmdID and activeCmdID < 0 and (not WG["buildmenu"].hoverID or (-activeCmdID == WG["buildmenu"].hoverID)))) then + unitNameColor = "\255\125\255\125" end end - local descriptionColor = '\255\240\240\240' - local metalColor = '\255\245\245\245' - local energyColor = '\255\255\255\000' - local healthColor = '\255\100\255\100' + local descriptionColor = "\255\240\240\240" + local metalColor = "\255\245\245\245" + local energyColor = "\255\255\255\000" + local healthColor = "\255\100\255\100" - local labelColor = '\255\205\205\205' - local valueColor = '\255\255\255\255' - local valuePlusColor = '\255\180\255\180' - local valueMinColor = '\255\255\180\180' + local labelColor = "\255\205\205\205" + local valueColor = "\255\255\255\255" + local valuePlusColor = "\255\180\255\180" + local valueMinColor = "\255\255\180\180" -- custom unit info background local width = contentWidth * 0.82 @@ -1344,30 +1318,30 @@ local function drawUnitInfo() -- unit tooltip font:Begin(true) - font:SetOutlineColor(0,0,0,1) + font:SetOutlineColor(0, 0, 0, 1) font:Print(descriptionColor .. text, backgroundRect[3] - width + bgpadding, backgroundRect[4] - contentPadding - (fontSize * 2.17), fontSize * 0.94, "o") font:End() -- unit name local nameFontSize = fontSize * 1.12 local humanName = unitDefInfo[displayUnitDefID].translatedHumanName - humanName = string.gsub(humanName, 'Scavenger', 'Scav') - if font:GetTextWidth(humanName) * nameFontSize > width*1.05 then + humanName = string.gsub(humanName, "Scavenger", "Scav") + if font:GetTextWidth(humanName) * nameFontSize > width * 1.05 then while font:GetTextWidth(humanName) * nameFontSize > width do - humanName = string.sub(humanName, 1, string.len(humanName)-1) + humanName = string.sub(humanName, 1, string.len(humanName) - 1) end - humanName = humanName..'...' + humanName = humanName .. "..." end font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) font2:Print(unitNameColor .. humanName, backgroundRect[3] - width + bgpadding, backgroundRect[4] - contentPadding - (nameFontSize * 0.76), nameFontSize, "o") --font2:End() -- custom unit info area customInfoArea = { math_floor(backgroundRect[3] - width - bgpadding), math_floor(backgroundRect[2]), math_floor(backgroundRect[3] - bgpadding), math_floor(backgroundRect[2] + height) } - if displayMode ~= 'unitdef' or not showBuilderBuildlist or not unitDefInfo[displayUnitDefID].buildOptions or (not (WG['buildmenu'] and WG['buildmenu'].hoverID)) then - RectRound(customInfoArea[1], customInfoArea[2], customInfoArea[3], customInfoArea[4], elementCorner*0.66, 1, 0, 0, 0, { 0.8, 0.8, 0.8, 0.07 }, { 0.8, 0.8, 0.8, 0.1 }) + if displayMode ~= "unitdef" or not showBuilderBuildlist or not unitDefInfo[displayUnitDefID].buildOptions or not (WG["buildmenu"] and WG["buildmenu"].hoverID) then + RectRound(customInfoArea[1], customInfoArea[2], customInfoArea[3], customInfoArea[4], elementCorner * 0.66, 1, 0, 0, 0, { 0.8, 0.8, 0.8, 0.07 }, { 0.8, 0.8, 0.8, 0.1 }) end local contentPaddingLeft = contentPadding * 0.6 @@ -1378,7 +1352,7 @@ local function drawUnitInfo() local posY2 = math_floor(backgroundRect[2] + leftSideHeight) - contentPadding - ((math_floor(backgroundRect[2] + leftSideHeight) - math_floor(backgroundRect[2])) * 0.38) local posY3 = math_floor(backgroundRect[2] + leftSideHeight) - contentPadding - ((math_floor(backgroundRect[2] + leftSideHeight) - math_floor(backgroundRect[2])) * 0.67) - local valueY1, valueY2, valueY3 = '', '', '' + local valueY1, valueY2, valueY3 = "", "", "" local health, maxHealth, _, _, buildProgress if displayUnitID then local metalMake, metalUse, energyMake, energyUse = spGetUnitResources(displayUnitID) @@ -1390,9 +1364,9 @@ local function drawUnitInfo() metalMake, metalUse, energyMake, energyUse = metalMake + mm, metalUse + mu, energyMake + em, energyUse + eu end end - valueY1 = (metalMake > 0 and valuePlusColor .. '+' .. (metalMake < 10 and round(metalMake, 1) or round(metalMake, 0)) .. ' ' or '') .. (metalUse > 0 and valueMinColor .. '-' .. (metalUse < 10 and round(metalUse, 1) or round(metalUse, 0)) or '') - valueY2 = (energyMake > 0 and valuePlusColor .. '+' .. (energyMake < 10 and round(energyMake, 1) or round(energyMake, 0)) .. ' ' or '') .. (energyUse > 0 and valueMinColor .. '-' .. (energyUse < 10 and round(energyUse, 1) or round(energyUse, 0)) or '') - valueY3 = '' + valueY1 = (metalMake > 0 and valuePlusColor .. "+" .. (metalMake < 10 and round(metalMake, 1) or round(metalMake, 0)) .. " " or "") .. (metalUse > 0 and valueMinColor .. "-" .. (metalUse < 10 and round(metalUse, 1) or round(metalUse, 0)) or "") + valueY2 = (energyMake > 0 and valuePlusColor .. "+" .. (energyMake < 10 and round(energyMake, 1) or round(energyMake, 0)) .. " " or "") .. (energyUse > 0 and valueMinColor .. "-" .. (energyUse < 10 and round(energyUse, 1) or round(energyUse, 0)) or "") + valueY3 = "" end -- display health value/bar @@ -1411,7 +1385,7 @@ local function drawUnitInfo() if isAiTeam then name = GetAIName(teamID) end - if not mySpec and Spring.GetModOptions().teamcolors_anonymous_mode ~= 'disabled' then + if not mySpec and Spring.GetModOptions().teamcolors_anonymous_mode ~= "disabled" then name = anonymousName end if name then @@ -1432,15 +1406,15 @@ local function drawUnitInfo() glColor(1, 1, 1, 1) local texDetailSize = math_floor(texSize * 4) - if valueY1 ~= '' then + if valueY1 ~= "" then glTexture(":lr" .. texDetailSize .. "," .. texDetailSize .. ":LuaUI/Images/metal.png") glTexRect(backgroundRect[1] + contentPaddingLeft - (texSize * 0.6), posY1 - texSize, backgroundRect[1] + contentPaddingLeft + (texSize * 1.4), posY1 + texSize) end - if valueY2 ~= '' then + if valueY2 ~= "" then glTexture(":lr" .. texDetailSize .. "," .. texDetailSize .. ":LuaUI/Images/energy.png") glTexRect(backgroundRect[1] + contentPaddingLeft - (texSize * 0.6), posY2 - texSize, backgroundRect[1] + contentPaddingLeft + (texSize * 1.4), posY2 + texSize) end - if valueY3 ~= '' then + if valueY3 ~= "" then glTexture(":lr" .. texDetailSize .. "," .. texDetailSize .. ":LuaUI/Images/info_health.png") glTexRect(backgroundRect[1] + contentPaddingLeft - (texSize * 0.6), posY3 - texSize, backgroundRect[1] + contentPaddingLeft + (texSize * 1.4), posY3 + texSize) end @@ -1459,7 +1433,7 @@ local function drawUnitInfo() cellRect = nil -- draw unit buildoption icons - if displayMode == 'unitdef' and showBuilderBuildlist and unitDefInfo[displayUnitDefID].buildOptions and not hideBuildlist then + if displayMode == "unitdef" and showBuilderBuildlist and unitDefInfo[displayUnitDefID].buildOptions and not hideBuildlist then gridHeight = math_ceil(height * 0.975) local rows = 2 local colls = math_ceil(#unitDefInfo[displayUnitDefID].buildOptions / rows) @@ -1485,24 +1459,14 @@ local function drawUnitInfo() for coll = 1, colls do if unitDefInfo[displayUnitDefID].buildOptions[cellID] then local uDefID = unitDefInfo[displayUnitDefID].buildOptions[cellID] - cellRect[cellID] = { math_floor(customInfoArea[3] - cellPadding - (coll * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row - 1) * cellsize)), math_floor(customInfoArea[3] - cellPadding - ((coll - 1) * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row) * cellsize)) } + cellRect[cellID] = { math_floor(customInfoArea[3] - cellPadding - (coll * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row - 1) * cellsize)), math_floor(customInfoArea[3] - cellPadding - ((coll - 1) * cellsize)), math_floor(customInfoArea[2] + cellPadding + (row * cellsize)) } local disabled = (unitRestricted[uDefID] or unitDisabled[uDefID]) if disabled then glColor(0.4, 0.4, 0.4, 1) else - glColor(1,1,1,1) + glColor(1, 1, 1, 1) end - UiUnit( - cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], - cellPadding * 1.3, - 1, 1, 1, 1, - 0.1, - nil, disabled and 0 or nil, - "#"..uDefID, - (unitDefInfo[uDefID].icontype and ':l:' .. unitDefInfo[uDefID].icontype or nil), - groups[unitGroup[uDefID]], - {unitDefInfo[uDefID].metalCost, unitDefInfo[uDefID].energyCost} - ) + UiUnit(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 1.3, 1, 1, 1, 1, 0.1, nil, disabled and 0 or nil, "#" .. uDefID, (unitDefInfo[uDefID].icontype and ":l:" .. unitDefInfo[uDefID].icontype or nil), groups[unitGroup[uDefID]], { unitDefInfo[uDefID].metalCost, unitDefInfo[uDefID].energyCost }) end cellID = cellID - 1 if cellID <= 0 then @@ -1516,9 +1480,8 @@ local function drawUnitInfo() glTexture(false) glColor(1, 1, 1, 1) - -- draw transported unit list - elseif displayMode == 'unit' and unitDefInfo[displayUnitDefID].transport and (Spring.GetUnitIsTransporting(displayUnitID) and #Spring.GetUnitIsTransporting(displayUnitID) or 0) > 0 then + elseif displayMode == "unit" and unitDefInfo[displayUnitDefID].transport and (Spring.GetUnitIsTransporting(displayUnitID) and #Spring.GetUnitIsTransporting(displayUnitID) or 0) > 0 then local units = Spring.GetUnitIsTransporting(displayUnitID) if #units > 0 then gridHeight = math_ceil(height * 0.975) @@ -1547,18 +1510,8 @@ local function drawUnitInfo() for coll = 1, colls do if units[cellID] then local uDefID = spGetUnitDefID(units[cellID]) - cellRect[cellID] = { math_floor(customInfoArea[3] - cellPadding - (coll * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row - 1) * cellsize)), math_floor(customInfoArea[3] - cellPadding - ((coll - 1) * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row) * cellsize)) } - UiUnit( - cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], - cellPadding * 1.3, - 1, 1, 1, 1, - 0.1, - nil, nil, - "#"..uDefID, - (unitDefInfo[uDefID].icontype and ':l:' .. unitDefInfo[uDefID].icontype or nil), - groups[unitGroup[uDefID]], - {unitDefInfo[uDefID].metalCost, unitDefInfo[uDefID].energyCost} - ) + cellRect[cellID] = { math_floor(customInfoArea[3] - cellPadding - (coll * cellsize)), math_floor(customInfoArea[2] + cellPadding + ((row - 1) * cellsize)), math_floor(customInfoArea[3] - cellPadding - ((coll - 1) * cellsize)), math_floor(customInfoArea[2] + cellPadding + (row * cellsize)) } + UiUnit(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 1.3, 1, 1, 1, 1, 0.1, nil, nil, "#" .. uDefID, (unitDefInfo[uDefID].icontype and ":l:" .. unitDefInfo[uDefID].icontype or nil), groups[unitGroup[uDefID]], { unitDefInfo[uDefID].metalCost, unitDefInfo[uDefID].energyCost }) end cellID = cellID - 1 if cellID <= 0 then @@ -1575,14 +1528,13 @@ local function drawUnitInfo() else -- unit/unitdef info (without buildoptions) - contentPadding = contentPadding * 0.95 local contentPaddingLeft = customInfoArea[1] + contentPadding -- Use string buffer for concatenation to reduce allocations clearStringBuffer() local bufferIndex = 0 - local separator = '' + local separator = "" local infoFontsize = fontSize * 0.89 -- to determine what to show in what order local function addTextInfo(label, value) @@ -1596,13 +1548,13 @@ local function drawUnitInfo() stringBuffer[bufferIndex] = label:sub(2) bufferIndex = bufferIndex + 1 stringBuffer[bufferIndex] = valueColor - if value and label ~= '' then + if value and label ~= "" then bufferIndex = bufferIndex + 1 - stringBuffer[bufferIndex] = ' ' + stringBuffer[bufferIndex] = " " bufferIndex = bufferIndex + 1 stringBuffer[bufferIndex] = value end - separator = ', ' + separator = ", " end -- unit specific info @@ -1623,7 +1575,7 @@ local function drawUnitInfo() end -- get unit specific data - if displayMode == 'unit' then + if displayMode == "unit" then -- get lots of unit info from functions: https://springrts.com/wiki/Lua_SyncedRead if unitDefInfo[displayUnitDefID].mainWeapon ~= nil then maxRange = Spring.GetUnitWeaponState(displayUnitID, unitDefInfo[displayUnitDefID].mainWeapon, "range") @@ -1633,7 +1585,6 @@ local function drawUnitInfo() if not exp then exp = spGetUnitExperience(displayUnitID) end - else -- get unitdef specific data if unitDefInfo[displayUnitDefID].maxWeaponRange then @@ -1645,93 +1596,91 @@ local function drawUnitInfo() local reloadTimeSpeedup = 1.0 local currentReloadTime = unitDefInfo[displayUnitDefID].reloadTime if exp and exp > 0.009 then - addTextInfo(Spring.I18N('ui.info.xp'), round(exp, 2)) - addTextInfo(Spring.I18N('ui.info.maxhealth'), '+' .. round((maxHealth / unitDefInfo[displayUnitDefID].health - 1) * 100, 0) .. '%') - currentReloadTime = spGetUnitWeaponState(displayUnitID, unitDefInfo[displayUnitDefID].mainWeapon, 'reloadTimeXP') + addTextInfo(Spring.I18N("ui.info.xp"), round(exp, 2)) + addTextInfo(Spring.I18N("ui.info.maxhealth"), "+" .. round((maxHealth / unitDefInfo[displayUnitDefID].health - 1) * 100, 0) .. "%") + currentReloadTime = spGetUnitWeaponState(displayUnitID, unitDefInfo[displayUnitDefID].mainWeapon, "reloadTimeXP") if unitDefInfo[displayUnitDefID].reloadTime then reloadTimeSpeedup = currentReloadTime / unitDefInfo[displayUnitDefID].reloadTime local reloadTimeSpeedupPercentage = tonumber(round((1 - reloadTimeSpeedup) * 100, 0)) if reloadTimeSpeedupPercentage > 0 then - addTextInfo(Spring.I18N('ui.info.reload'), '-' .. reloadTimeSpeedupPercentage .. '%') + addTextInfo(Spring.I18N("ui.info.reload"), "-" .. reloadTimeSpeedupPercentage .. "%") end end end -- basic dps display if mindps and mindps > 0 and mindps == maxdps then - - local dps = round(mindps/ reloadTimeSpeedup, 0) - addTextInfo(Spring.I18N('ui.info.dps'), dps) + local dps = round(mindps / reloadTimeSpeedup, 0) + addTextInfo(Spring.I18N("ui.info.dps"), dps) -- dps range elseif mindps ~= maxdps then - local min = round(mindps/ reloadTimeSpeedup, 0) - local max = round(maxdps/ reloadTimeSpeedup, 0) - addTextInfo("DPS", min.."-"..max) + local min = round(mindps / reloadTimeSpeedup, 0) + local max = round(maxdps / reloadTimeSpeedup, 0) + addTextInfo("DPS", min .. "-" .. max) end -- emp dps display if minemp and minemp > 0 and minemp == maxemp then - - local emp = round(minemp/ reloadTimeSpeedup, 0) + local emp = round(minemp / reloadTimeSpeedup, 0) addTextInfo("DPS(EMP)", emp) -- more emp dps elseif minemp ~= maxemp then - local min = round(minemp/ reloadTimeSpeedup, 0) - local max = round(maxemp/ reloadTimeSpeedup, 0) - addTextInfo("DPS(EMP)", min.."-"..max) + local min = round(minemp / reloadTimeSpeedup, 0) + local max = round(maxemp / reloadTimeSpeedup, 0) + addTextInfo("DPS(EMP)", min .. "-" .. max) end if unitDefInfo[displayUnitDefID].maxCoverage then - addTextInfo(Spring.I18N('ui.info.coverrange'), unitDefInfo[displayUnitDefID].maxCoverage) + addTextInfo(Spring.I18N("ui.info.coverrange"), unitDefInfo[displayUnitDefID].maxCoverage) elseif maxRange and not unitDefInfo[displayUnitDefID].shieldOnly then - addTextInfo(Spring.I18N('ui.info.weaponrange'), math_floor(maxRange)) + addTextInfo(Spring.I18N("ui.info.weaponrange"), math_floor(maxRange)) end if currentReloadTime and currentReloadTime > 0 then - addTextInfo(Spring.I18N('ui.info.reloadtime'), round(currentReloadTime, 2)) + addTextInfo(Spring.I18N("ui.info.reloadtime"), round(currentReloadTime, 2)) end if unitDefInfo[displayUnitDefID].energyPerShot then - addTextInfo(Spring.I18N('ui.info.energyshot'), unitDefInfo[displayUnitDefID].energyPerShot) + addTextInfo(Spring.I18N("ui.info.energyshot"), unitDefInfo[displayUnitDefID].energyPerShot) end if unitDefInfo[displayUnitDefID].metalPerShot then - addTextInfo(Spring.I18N('ui.info.metalshot'), unitDefInfo[displayUnitDefID].metalPerShot) + addTextInfo(Spring.I18N("ui.info.metalshot"), unitDefInfo[displayUnitDefID].metalPerShot) end end -- shield display if unitDefInfo[displayUnitDefID].shieldCapacity then - addTextInfo(Spring.I18N('ui.info.shieldcapacity'), unitDefInfo[displayUnitDefID].shieldCapacity) - addTextInfo(Spring.I18N('ui.info.shieldrange'), unitDefInfo[displayUnitDefID].shieldRange) - addTextInfo(Spring.I18N('ui.info.shieldrechargerate'), unitDefInfo[displayUnitDefID].shieldRechargeRate) - addTextInfo(Spring.I18N('ui.info.shieldrechargecost'), unitDefInfo[displayUnitDefID].shieldRechargeCost) + addTextInfo(Spring.I18N("ui.info.shieldcapacity"), unitDefInfo[displayUnitDefID].shieldCapacity) + addTextInfo(Spring.I18N("ui.info.shieldrange"), unitDefInfo[displayUnitDefID].shieldRange) + addTextInfo(Spring.I18N("ui.info.shieldrechargerate"), unitDefInfo[displayUnitDefID].shieldRechargeRate) + addTextInfo(Spring.I18N("ui.info.shieldrechargecost"), unitDefInfo[displayUnitDefID].shieldRechargeCost) end if unitDefInfo[displayUnitDefID].stealth then - addTextInfo(Spring.I18N('ui.info.stealthy'), nil) + addTextInfo(Spring.I18N("ui.info.stealthy"), nil) end if unitDefInfo[displayUnitDefID].cloakCost then if unitDefInfo[displayUnitDefID].cloakCostMoving then - addTextInfo(Spring.I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost .. "/" .. unitDefInfo[displayUnitDefID].cloakCostMoving) + addTextInfo(Spring.I18N("ui.info.cloakcost"), unitDefInfo[displayUnitDefID].cloakCost .. "/" .. unitDefInfo[displayUnitDefID].cloakCostMoving) else - addTextInfo(Spring.I18N('ui.info.cloakcost'), unitDefInfo[displayUnitDefID].cloakCost) + addTextInfo(Spring.I18N("ui.info.cloakcost"), unitDefInfo[displayUnitDefID].cloakCost) end end if unitDefInfo[displayUnitDefID].speed then - addTextInfo(Spring.I18N('ui.info.speed'), unitDefInfo[displayUnitDefID].speed) + addTextInfo(Spring.I18N("ui.info.speed"), unitDefInfo[displayUnitDefID].speed) elseif unitDefInfo[displayUnitDefID].speedMin then local min = unitDefInfo[displayUnitDefID].speedMin local max = unitDefInfo[displayUnitDefID].speedMax - addTextInfo(Spring.I18N('ui.info.speed'), min.."-"..max) + addTextInfo(Spring.I18N("ui.info.speed"), min .. "-" .. max) end if unitDefInfo[displayUnitDefID].reverseSpeed then - addTextInfo(Spring.I18N('ui.info.reversespeed'), unitDefInfo[displayUnitDefID].reverseSpeed) + addTextInfo(Spring.I18N("ui.info.reversespeed"), unitDefInfo[displayUnitDefID].reverseSpeed) end if unitDefInfo[displayUnitDefID].buildSpeed then - addTextInfo(Spring.I18N('ui.info.buildpower'), unitDefInfo[displayUnitDefID].buildSpeed) + addTextInfo(Spring.I18N("ui.info.buildpower"), unitDefInfo[displayUnitDefID].buildSpeed) end --if unitDefInfo[displayUnitDefID].armorType and unitDefInfo[displayUnitDefID].armorType ~= 'standard' then @@ -1739,51 +1688,49 @@ local function drawUnitInfo() --end if unitDefInfo[displayUnitDefID].sightDistance then - addTextInfo(Spring.I18N('ui.info.los'), round(unitDefInfo[displayUnitDefID].sightDistance, 0)) + addTextInfo(Spring.I18N("ui.info.los"), round(unitDefInfo[displayUnitDefID].sightDistance, 0)) end if unitDefInfo[displayUnitDefID].airSightDistance and (unitDefInfo[displayUnitDefID].airUnit or unitDefInfo[displayUnitDefID].isAaUnit) then - - addTextInfo(Spring.I18N('ui.info.airlos'), round(unitDefInfo[displayUnitDefID].airSightDistance, 0)) + addTextInfo(Spring.I18N("ui.info.airlos"), round(unitDefInfo[displayUnitDefID].airSightDistance, 0)) end if unitDefInfo[displayUnitDefID].radarDistance then - addTextInfo(Spring.I18N('ui.info.radar'), round(unitDefInfo[displayUnitDefID].radarDistance, 0)) + addTextInfo(Spring.I18N("ui.info.radar"), round(unitDefInfo[displayUnitDefID].radarDistance, 0)) end if unitDefInfo[displayUnitDefID].sonarDistance then - addTextInfo(Spring.I18N('ui.info.sonar'), round(unitDefInfo[displayUnitDefID].sonarDistance, 0)) + addTextInfo(Spring.I18N("ui.info.sonar"), round(unitDefInfo[displayUnitDefID].sonarDistance, 0)) end if unitDefInfo[displayUnitDefID].radarDistanceJam then - addTextInfo(Spring.I18N('ui.info.jamrange'), round(unitDefInfo[displayUnitDefID].radarDistanceJam, 0)) + addTextInfo(Spring.I18N("ui.info.jamrange"), round(unitDefInfo[displayUnitDefID].radarDistanceJam, 0)) end if unitDefInfo[displayUnitDefID].sonarDistanceJam then - addTextInfo(Spring.I18N('ui.info.sonarjamrange'), round(unitDefInfo[displayUnitDefID].sonarDistanceJam, 0)) + addTextInfo(Spring.I18N("ui.info.sonarjamrange"), round(unitDefInfo[displayUnitDefID].sonarDistanceJam, 0)) end if unitDefInfo[displayUnitDefID].seismicDistance then - addTextInfo(Spring.I18N('ui.info.seismic'), unitDefInfo[displayUnitDefID].seismicDistance) + addTextInfo(Spring.I18N("ui.info.seismic"), unitDefInfo[displayUnitDefID].seismicDistance) end --addTextInfo('mass', round(Spring.GetUnitMass(displayUnitID),0)) --addTextInfo('radius', round(Spring.GetUnitRadius(displayUnitID),0)) --addTextInfo('height', round(Spring.GetUnitHeight(displayUnitID),0)) if unitDefInfo[displayUnitDefID].metalmaker then - addTextInfo(Spring.I18N('ui.info.eneededforconversion'), unitDefInfo[displayUnitDefID].metalmaker[1]) - addTextInfo(Spring.I18N('ui.info.convertedm'), round(unitDefInfo[displayUnitDefID].metalmaker[1] / (1 / unitDefInfo[displayUnitDefID].metalmaker[2]), 1)) + addTextInfo(Spring.I18N("ui.info.eneededforconversion"), unitDefInfo[displayUnitDefID].metalmaker[1]) + addTextInfo(Spring.I18N("ui.info.convertedm"), round(unitDefInfo[displayUnitDefID].metalmaker[1] / (1 / unitDefInfo[displayUnitDefID].metalmaker[2]), 1)) end if unitDefInfo[displayUnitDefID].energyStorage > 0 then - addTextInfo(Spring.I18N('ui.info.estorage'), unitDefInfo[displayUnitDefID].energyStorage) + addTextInfo(Spring.I18N("ui.info.estorage"), unitDefInfo[displayUnitDefID].energyStorage) end if unitDefInfo[displayUnitDefID].metalStorage > 0 then - addTextInfo(Spring.I18N('ui.info.mstorage'), unitDefInfo[displayUnitDefID].metalStorage) + addTextInfo(Spring.I18N("ui.info.mstorage"), unitDefInfo[displayUnitDefID].metalStorage) end if unitDefInfo[displayUnitDefID].transport then - if unitDefInfo[displayUnitDefID].transport[1] < 5001 then - addTextInfo(Spring.I18N('ui.info.transport_light', { highlightColor = valueColor }), nil) + addTextInfo(Spring.I18N("ui.info.transport_light", { highlightColor = valueColor }), nil) end if unitDefInfo[displayUnitDefID].transport[1] > 5000 then - addTextInfo(Spring.I18N('ui.info.transport_heavy', { highlightColor = valueColor }), nil) + addTextInfo(Spring.I18N("ui.info.transport_heavy", { highlightColor = valueColor }), nil) end - addTextInfo(Spring.I18N('ui.info.transportcapacity'), unitDefInfo[displayUnitDefID].transport[3]) + addTextInfo(Spring.I18N("ui.info.transportcapacity"), unitDefInfo[displayUnitDefID].transport[3]) end -- Build final text from buffer @@ -1803,7 +1750,7 @@ local function drawUnitInfo() end if i < 5 then bufferIndex = bufferIndex + 1 - stringBuffer[bufferIndex] = '\n' + stringBuffer[bufferIndex] = "\n" end end text = table.concat(stringBuffer) @@ -1813,9 +1760,8 @@ local function drawUnitInfo() font:Begin(true) font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0.1, 0.1, 0.1, 1) - font:Print(text, customInfoArea[3] - width + (width*0.025), customInfoArea[4] - contentPadding - (infoFontsize * 0.55), infoFontsize, "o") + font:Print(text, customInfoArea[3] - width + (width * 0.025), customInfoArea[4] - contentPadding - (infoFontsize * 0.55), infoFontsize, "o") font:End() - end end @@ -1837,43 +1783,43 @@ local function drawEngineTooltip() if not customHoverType then hoverType, hoverData = spTraceScreenRay(mouseX, mouseY) end - if hoverType == 'ground' then + if hoverType == "ground" then local desc, coords = spTraceScreenRay(mouseX, mouseY, true) local groundType1, groundType2, metal, hardness, tankSpeed, botSpeed, hoverSpeed, shipSpeed, receiveTracks = Spring.GetGroundInfo(coords[1], coords[3]) - local text = '' + local text = "" local height = 0 font:Begin(true) font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0.1, 0.1, 0.1, 1) if displayMapPosition then - font:Print(tooltipValueColor..math.floor(hoverData[1])..',', backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") + font:Print(tooltipValueColor .. math.floor(hoverData[1]) .. ",", backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") font:Print(math.floor(hoverData[3]), backgroundRect[1] + contentPadding + (fontSize * 3.2), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") - font:Print(tooltipLabelTextColor..Spring.I18N('ui.info.elevation')..' '..tooltipValueColor..math.floor(Spring.GetGroundHeight(coords[1], coords[3])), backgroundRect[1] + contentPadding + (fontSize * 6.6), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") + font:Print(tooltipLabelTextColor .. Spring.I18N("ui.info.elevation") .. " " .. tooltipValueColor .. math.floor(Spring.GetGroundHeight(coords[1], coords[3])), backgroundRect[1] + contentPadding + (fontSize * 6.6), backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") height = height + heightStep end if tankSpeed ~= 1 or botSpeed ~= 1 or hoverSpeed ~= 1 or (shipSpeed ~= 1 and coords[2] <= 0) then - text = '' + text = "" if tankSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.tank')..' '..tooltipValueColor..math.floor(tankSpeed*100).."%" + text = text .. (text ~= "" and " " or "") .. tooltipLabelTextColor .. Spring.I18N("ui.info.tank") .. " " .. tooltipValueColor .. math.floor(tankSpeed * 100) .. "%" end if botSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.bot')..' '..tooltipValueColor..math.floor(botSpeed*100).."%" + text = text .. (text ~= "" and " " or "") .. tooltipLabelTextColor .. Spring.I18N("ui.info.bot") .. " " .. tooltipValueColor .. math.floor(botSpeed * 100) .. "%" end if hoverSpeed ~= 1 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.hover')..' '..tooltipValueColor..math.floor(hoverSpeed*100).."%" + text = text .. (text ~= "" and " " or "") .. tooltipLabelTextColor .. Spring.I18N("ui.info.hover") .. " " .. tooltipValueColor .. math.floor(hoverSpeed * 100) .. "%" end if shipSpeed ~= 1 and coords[2] <= 0 then - text = text..(text~='' and ' ' or '')..tooltipLabelTextColor..Spring.I18N('ui.info.ship')..' '..tooltipValueColor..math.floor(shipSpeed*100).."%" + text = text .. (text ~= "" and " " or "") .. tooltipLabelTextColor .. Spring.I18N("ui.info.ship") .. " " .. tooltipValueColor .. math.floor(shipSpeed * 100) .. "%" end - if groundType2 and groundType2 ~= '' then + if groundType2 and groundType2 ~= "" then font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - font2:Print(tooltipLabelTextColor..groundType2, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1) - height, (fontSize * 1.2), "o") + font2:SetOutlineColor(0, 0, 0, 1) + font2:Print(tooltipLabelTextColor .. groundType2, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1) - height, (fontSize * 1.2), "o") font2:End() height = height + (fontSize * 0.25) height = height + heightStep end - font:Print(tooltipDarkTextColor..Spring.I18N('ui.info.speedmultipliers')..' '..text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") + font:Print(tooltipDarkTextColor .. Spring.I18N("ui.info.speedmultipliers") .. " " .. text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") elseif not displayMapPosition then emptyInfo = true end @@ -1886,33 +1832,33 @@ local function drawEngineTooltip() -- font:Print(tooltipLabelTextColor..Spring.I18N('ui.info.hardness')..' '..tooltipValueColor..math.floor(hardness), backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") --end font:End() - elseif hoverType == 'feature' then + elseif hoverType == "feature" then local featureDefID = Spring.GetFeatureDefID(hoverData) local text = FeatureDefs[featureDefID].tooltip local height = 0 - if text == '' then + if text == "" then text = FeatureDefs[featureDefID].translatedDescription end - if text and text ~= '' then + if text and text ~= "" then font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - font2:Print(tooltipTitleColor..text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1.2) - height, (fontSize * 1.4), "o") + font2:SetOutlineColor(0, 0, 0, 1) + font2:Print(tooltipTitleColor .. text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 1.2) - height, (fontSize * 1.4), "o") font2:End() height = height + (fontSize * 0.5) end font:Begin(true) font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0.1, 0.1, 0.1, 1) - text = '' + text = "" local metal, _, energy, _ = Spring.GetFeatureResources(hoverData) if energy > 0 then height = height + heightStep - text = tooltipLabelTextColor..Spring.I18N('ui.info.energy').." \255\255\255\000"..string.formatSI(energy) + text = tooltipLabelTextColor .. Spring.I18N("ui.info.energy") .. " \255\255\255\000" .. string.formatSI(energy) font:Print(text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") end if metal > 0 then height = height + heightStep - text = tooltipLabelTextColor..Spring.I18N('ui.info.metal').." "..tooltipValueColor..string.formatSI(metal) + text = tooltipLabelTextColor .. Spring.I18N("ui.info.metal") .. " " .. tooltipValueColor .. string.formatSI(metal) font:Print(text, backgroundRect[1] + contentPadding, backgroundRect[4] - contentPadding - (fontSize * 0.8) - height, fontSize, "o") end font:End() @@ -1939,9 +1885,9 @@ local function drawInfo() contentPadding = (height * vsy * 0.075) * (0.95 - ((1 - ui_scale) * 0.5)) contentWidth = backgroundRect[3] - backgroundRect[1] - contentPadding - contentPadding - if displayMode == 'selection' then + if displayMode == "selection" then drawSelection() - elseif displayMode ~= 'text' and displayUnitDefID then + elseif displayMode ~= "text" and displayUnitDefID then drawUnitInfo() else drawEngineTooltip() @@ -1955,7 +1901,7 @@ local function LeftMouseButton(unitDefID, unitTable) -- select units of icon type if alt or meta then acted = true - spSelectUnitArray({ unitTable[1] }) -- only 1 + spSelectUnitArray({ unitTable[1] }) -- only 1 else acted = true spSelectUnitArray(unitTable) @@ -1972,7 +1918,7 @@ local function LeftMouseButton(unitDefID, unitTable) selectedUnits = spGetSelectedUnits() SelectedUnitsCount = spGetSelectedUnitsCount() if acted then - Spring.PlaySoundFile(sound_button, 0.5, 'ui') + Spring.PlaySoundFile(sound_button, 0.5, "ui") end end @@ -1989,7 +1935,7 @@ local function MiddleMouseButton(unitDefID, unitTable) end selectedUnits = spGetSelectedUnits() SelectedUnitsCount = spGetSelectedUnitsCount() - Spring.PlaySoundFile(sound_button, 0.5, 'ui') + Spring.PlaySoundFile(sound_button, 0.5, "ui") end local function RightMouseButton(unitDefID, unitTable) @@ -2012,7 +1958,7 @@ local function RightMouseButton(unitDefID, unitTable) spSelectUnitMap(rightMouseButtonMap) selectedUnits = spGetSelectedUnits() SelectedUnitsCount = spGetSelectedUnitsCount() - Spring.PlaySoundFile(sound_button2, 0.5, 'ui') + Spring.PlaySoundFile(sound_button2, 0.5, "ui") end function widget:MousePress(x, y, button) @@ -2033,9 +1979,9 @@ local function unloadTransport(transportID, unitID, x, z, shift, depth) local radius = 20 * depth local orgX, orgZ = x, z local y = Spring.GetGroundHeight(x, z) - local unitSphereRadius = 60 -- too low value will result in unload conflicts + local unitSphereRadius = 60 -- too low value will result in unload conflicts local areaUnits = Spring.GetUnitsInSphere(x, y, z, unitSphereRadius) - if #areaUnits == 0 then -- unblocked spot! + if #areaUnits == 0 then -- unblocked spot! unloadParams[1], unloadParams[2], unloadParams[3], unloadParams[4] = x, y, z, unitID Spring.GiveOrderToUnit(transportID, CMD.UNLOAD_UNIT, unloadParams, shift and shiftTable or emptyTable) else @@ -2049,7 +1995,7 @@ local function unloadTransport(transportID, unitID, x, z, shift, depth) if x > 0 and z > 0 and x < mapSizeX and z < mapSizeZ then y = Spring.GetGroundHeight(x, z) areaUnits = Spring.GetUnitsInSphere(x, y, z, unitSphereRadius) - if #areaUnits == 0 then -- unblocked spot! + if #areaUnits == 0 then -- unblocked spot! local areaFeatures = Spring.GetFeaturesInSphere(x, y, z, unitSphereRadius) if #areaFeatures == 0 then unloadParams[1], unloadParams[2], unloadParams[3], unloadParams[4] = x, y, z, unitID @@ -2061,22 +2007,20 @@ local function unloadTransport(transportID, unitID, x, z, shift, depth) end end -- try again with increased radius - if not foundUnloadSpot and depth < 15 then -- limit depth for safety - unloadTransport(transportID, unitID, orgX, orgZ, shift, depth+1) + if not foundUnloadSpot and depth < 15 then -- limit depth for safety + unloadTransport(transportID, unitID, orgX, orgZ, shift, depth + 1) end end end - function widget:MouseRelease(x, y, button) if Spring.IsGUIHidden() then return end if displayMode and customInfoArea and math_isInRect(x, y, customInfoArea[1], customInfoArea[2], customInfoArea[3], customInfoArea[4]) then - -- selection - if displayMode == 'selection' and selectionCells and selectionCells[1] and cellRect then + if displayMode == "selection" and selectionCells and selectionCells[1] and cellRect then for cellID, unitDefID in pairs(selectionCells) do if cellRect[cellID] and math_isInRect(x, y, cellRect[cellID][1], cellRect[cellID][2], cellRect[cellID][3], cellRect[cellID][4]) then local unitTable = nil @@ -2105,12 +2049,12 @@ function widget:MouseRelease(x, y, button) end -- transported unit list - if displayMode == 'unit' and button == 1 then + if displayMode == "unit" and button == 1 then local units = Spring.GetUnitIsTransporting(displayUnitID) if units and #units > 0 then for cellID, unitID in pairs(units) do if cellRect[cellID] and math_isInRect(x, y, cellRect[cellID][1], cellRect[cellID][2], cellRect[cellID][3], cellRect[cellID][4]) then - local x,y,z = Spring.GetUnitPosition(displayUnitID) + local x, y, z = Spring.GetUnitPosition(displayUnitID) local alt, ctrl, meta, shift = spGetModKeyState() if shift then local cmdQueue = Spring.GetUnitCommands(displayUnitID, 35) or {} @@ -2137,36 +2081,32 @@ function widget:MouseRelease(x, y, button) return -1 end - function widget:DrawScreen() glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) local x, y, b, b2, b3, mouseOffScreen, cameraPanMode = spGetMouseState() - if (not alwaysShow and (cameraPanMode or mouseOffScreen) and SelectedUnitsCount == 0 and not isPregame) then + if not alwaysShow and (cameraPanMode or mouseOffScreen) and SelectedUnitsCount == 0 and not isPregame then if dlistGuishader then - WG['guishader'].DeleteDlist('info') + WG["guishader"].DeleteDlist("info") dlistGuishader = nil end return end if not infoBgTex then - infoBgTex = gl.CreateTexture(math_floor(width*vsx), math_floor(height*vsy), { + infoBgTex = gl.CreateTexture(math_floor(width * vsx), math_floor(height * vsy), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) - gl.R2tHelper.RenderToTexture(infoBgTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / (width*vsx), 2 / (height*vsy), 0) - drawInfoBackground() - end, - true - ) + gl.R2tHelper.RenderToTexture(infoBgTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / (width * vsx), 2 / (height * vsy), 0) + drawInfoBackground() + end, true) end if not infoTex then - infoTex = gl.CreateTexture(math_floor(width*vsx)*2, math_floor(height*vsy)*2, { + infoTex = gl.CreateTexture(math_floor(width * vsx) * 2, math_floor(height * vsy) * 2, { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -2174,14 +2114,11 @@ function widget:DrawScreen() end if infoTex and updateTex then updateTex = nil - gl.R2tHelper.RenderToTexture(infoTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / (width*vsx), 2 / (height*vsy), 0) - drawInfo() - end, - true - ) + gl.R2tHelper.RenderToTexture(infoTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / (width * vsx), 2 / (height * vsy), 0) + drawInfo() + end, true) end if alwaysShow or not emptyInfo or (isPregame and (not mySpec or displayMapPosition)) then @@ -2194,21 +2131,18 @@ function widget:DrawScreen() gl.R2tHelper.BlendTexRect(infoTex, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], true) end elseif dlistGuishader then - WG['guishader'].DeleteDlist('info') + WG["guishader"].DeleteDlist("info") dlistGuishader = nil end -- widget hovered if infoShows and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") -- selection grid - if displayMode == 'selection' and selectionCells and selectionCells[1] and cellRect then - + if displayMode == "selection" and selectionCells and selectionCells[1] and cellRect then for cellID, unitDefID in pairs(selectionCells) do if cellRect[cellID] and math_isInRect(x, y, cellRect[cellID][1], cellRect[cellID][2], cellRect[cellID][3], cellRect[cellID][4]) then - local cellZoom = hoverCellZoom local color = { 1, 1, 1 } if b then @@ -2228,17 +2162,12 @@ function widget:DrawScreen() if b or b2 or b3 then RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { color[1], color[2], color[3], (b or b2 or b3) and 0.4 or 0.2 }, { color[1], color[2], color[3], (b or b2 or b3) and 0.07 or 0.04 }) else - RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { 1,1,1, 0.08}, { 1,1,1, 0.08}) + RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { 1, 1, 1, 0.08 }, { 1, 1, 1, 0.08 }) end -- light border - local halfSize = (((cellRect[cellID][3] - cellPadding)) - (cellRect[cellID][1])) * 0.5 + local halfSize = ((cellRect[cellID][3] - cellPadding) - cellRect[cellID][1]) * 0.5 glBlending(GL_SRC_ALPHA, GL_ONE) - RectRoundCircle( - cellRect[cellID][1] + cellPadding + halfSize, - 0, - cellRect[cellID][2] + cellPadding + halfSize, - halfSize, cornerSize, halfSize - math_max(1, cellPadding), { 1,1,1, 0.07}, { 1,1,1, 0.07} - ) + RectRoundCircle(cellRect[cellID][1] + cellPadding + halfSize, 0, cellRect[cellID][2] + cellPadding + halfSize, halfSize, cornerSize, halfSize - math_max(1, cellPadding), { 1, 1, 1, 0.07 }, { 1, 1, 1, 0.07 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) --cellHovered = cellID @@ -2246,37 +2175,35 @@ function widget:DrawScreen() end end - if WG['tooltip'] then - local statsIndent = ' ' - local stats = '' + if WG["tooltip"] then + local statsIndent = " " + local stats = "" --local cells = cellHovered and { [cellHovered] = selectionCells[cellHovered] } or selectionCells -- description if cellHovered then local text, numLines = font:WrapText(unitDefInfo[selectionCells[cellHovered]].description, (backgroundRect[3] - backgroundRect[1]) * (loadedFontSize / 16)) - stats = stats .. statsIndent .. tooltipTextColor .. text .. '\n\n' + stats = stats .. statsIndent .. tooltipTextColor .. text .. "\n\n" end local text local textTitle - stats = ''--getSelectionTotals(cells) + stats = "" --getSelectionTotals(cells) if cellHovered then - textTitle = unitDefInfo[selectionCells[cellHovered]].translatedHumanName .. tooltipLabelTextColor .. (selUnitsCounts[selectionCells[cellHovered]] > 1 and ' x ' .. tooltipTextColor .. selUnitsCounts[selectionCells[cellHovered]] or '') + textTitle = unitDefInfo[selectionCells[cellHovered]].translatedHumanName .. tooltipLabelTextColor .. (selUnitsCounts[selectionCells[cellHovered]] > 1 and " x " .. tooltipTextColor .. selUnitsCounts[selectionCells[cellHovered]] or "") else --textTitle = Spring.I18N('ui.info.selectedunits')..": " .. tooltipTextColor .. #selectedUnits text = selectionHowto end - WG['tooltip'].ShowTooltip('info', text, nil, nil, textTitle) + WG["tooltip"].ShowTooltip("info", text, nil, nil, textTitle) end end -- transport load list - if displayMode == 'unit' and unitDefInfo[displayUnitDefID].transport and cellRect then + if displayMode == "unit" and unitDefInfo[displayUnitDefID].transport and cellRect then local units = Spring.GetUnitIsTransporting(displayUnitID) if #units > 0 then for cellID, unitID in pairs(units) do - if cellRect[cellID] and math_isInRect(x, y, cellRect[cellID][1], cellRect[cellID][2], cellRect[cellID][3], cellRect[cellID][4]) then - local cellZoom = hoverCellZoom local color = { 1, 1, 1 } if b then @@ -2290,17 +2217,12 @@ function widget:DrawScreen() if b then RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { color[1], color[2], color[3], 0.3 }, { color[1], color[2], color[3], 0.3 }) else - RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { 1,1,1, 0.08}, { 1,1,1, 0.08}) + RectRound(cellRect[cellID][1] + cellPadding, cellRect[cellID][2] + cellPadding, cellRect[cellID][3], cellRect[cellID][4], cellPadding * 0.9, 1, 1, 1, 1, { 1, 1, 1, 0.08 }, { 1, 1, 1, 0.08 }) end -- light border - local halfSize = (((cellRect[cellID][3] - cellPadding)) - (cellRect[cellID][1])) * 0.5 + local halfSize = ((cellRect[cellID][3] - cellPadding) - cellRect[cellID][1]) * 0.5 glBlending(GL_SRC_ALPHA, GL_ONE) - RectRoundCircle( - cellRect[cellID][1] + cellPadding + halfSize, - 0, - cellRect[cellID][2] + cellPadding + halfSize, - halfSize, cornerSize, halfSize - math_max(1, cellPadding), { 1,1,1, 0.07}, { 1,1,1, 0.07} - ) + RectRoundCircle(cellRect[cellID][1] + cellPadding + halfSize, 0, cellRect[cellID][2] + cellPadding + halfSize, halfSize, cornerSize, halfSize - math_max(1, cellPadding), { 1, 1, 1, 0.07 }, { 1, 1, 1, 0.07 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) --cellHovered = cellID @@ -2308,16 +2230,16 @@ function widget:DrawScreen() end end end - elseif displayMode == 'unit' then - if WG['unitstats'] and WG['unitstats'].showUnit then - WG['unitstats'].showUnit(displayUnitID) + elseif displayMode == "unit" then + if WG["unitstats"] and WG["unitstats"].showUnit then + WG["unitstats"].showUnit(displayUnitID) end end end end function checkChanges() - hideBuildlist = nil -- only set for pregame startunit + hideBuildlist = nil -- only set for pregame startunit local x, y, b, _, _, _, cameraPanMode = spGetMouseState() -- Use custom hover if provided by external widget (e.g., PIP window) @@ -2325,7 +2247,7 @@ function checkChanges() if customHoverType and customHoverData then hoverType = customHoverType hoverData = customHoverData - elseif WG['guiPip'] and WG['guiPip'].IsAbove and WG['guiPip'].IsAbove(x, y) then + elseif WG["guiPip"] and WG["guiPip"].IsAbove and WG["guiPip"].IsAbove(x, y) then -- PIP window is above the cursor, don't detect anything below it hoverType = nil hoverData = nil @@ -2338,29 +2260,29 @@ function checkChanges() local prevDisplayUnitID = displayUnitID -- determine what mode to display - displayMode = 'text' + displayMode = "text" displayUnitID = nil displayUnitDefID = nil if isPregame and not mySpec then - activeCmdID = WG["pregame-build"] and WG["pregame-build"].getPreGameDefID() + activeCmdID = WG["pregame-build"] and WG["pregame-build"].getPreGameDefID() activeCmdID = activeCmdID and -activeCmdID else activeCmdID = select(2, Spring.GetActiveCommand()) end -- buildmenu unitdef - if WG['buildmenu'] and WG['buildmenu'].hoverID then - displayMode = 'unitdef' - displayUnitDefID = WG['buildmenu'].hoverID + if WG["buildmenu"] and WG["buildmenu"].hoverID then + displayMode = "unitdef" + displayUnitDefID = WG["buildmenu"].hoverID elseif cfgDisplayUnitDefID then - displayMode = 'unitdef' + displayMode = "unitdef" displayUnitDefID = cfgDisplayUnitDefID elseif activeCmdID and activeCmdID < 0 then - displayMode = 'unitdef' + displayMode = "unitdef" displayUnitDefID = -activeCmdID elseif cfgDisplayUnitID and Spring.ValidUnitID(cfgDisplayUnitID) then - displayMode = 'unit' + displayMode = "unit" displayUnitID = cfgDisplayUnitID displayUnitDefID = spGetUnitDefID(displayUnitID) if lastUpdateClock + 0.4 < os_clock() then @@ -2369,8 +2291,8 @@ function checkChanges() end -- hovered unit - elseif not cameraPanMode and not b and (customHoverType or not math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4])) and hoverType and hoverType == 'unit' then - displayMode = 'unit' + elseif not cameraPanMode and not b and (customHoverType or not math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4])) and hoverType and hoverType == "unit" then + displayMode = "unit" displayUnitID = hoverData displayUnitDefID = spGetUnitDefID(displayUnitID) if not displayUnitDefID and SelectedUnitsCount >= 1 then @@ -2378,7 +2300,7 @@ function checkChanges() displayUnitID = selectedUnits[1] displayUnitDefID = spGetUnitDefID(selectedUnits[1]) else - displayMode = 'selection' + displayMode = "selection" end end if lastUpdateClock + 0.4 < os_clock() then @@ -2387,19 +2309,19 @@ function checkChanges() end -- hovered feature - elseif not cameraPanMode and (customHoverType or not math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4])) and hoverType and hoverType == 'feature' then - displayMode = 'feature' + elseif not cameraPanMode and (customHoverType or not math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4])) and hoverType and hoverType == "feature" then + displayMode = "feature" local featureID = hoverData local featureDefID = spGetFeatureDefID(featureID) local featureDef = FeatureDefs[featureDefID] if featureDef == nil then return end - local newTooltip = featureDef.translatedDescription or '' + local newTooltip = featureDef.translatedDescription or "" if featureDef.reclaimable then local metal, _, energy, _ = Spring.GetFeatureResources(featureID) - local reclaimText = Spring.I18N('ui.reclaimInfo.metal', { metal = string.formatSI(metal) }) .. "\255\255\255\128" .. " " .. Spring.I18N('ui.reclaimInfo.energy', { energy = string.formatSI(energy) }) + local reclaimText = Spring.I18N("ui.reclaimInfo.metal", { metal = string.formatSI(metal) }) .. "\255\255\255\128" .. " " .. Spring.I18N("ui.reclaimInfo.energy", { energy = string.formatSI(energy) }) newTooltip = newTooltip .. "\n\n" .. reclaimText end @@ -2410,7 +2332,7 @@ function checkChanges() -- selected unit elseif SelectedUnitsCount == 1 then - displayMode = 'unit' + displayMode = "unit" displayUnitID = selectedUnits[1] if displayUnitID then displayUnitDefID = spGetUnitDefID(displayUnitID) @@ -2421,7 +2343,7 @@ function checkChanges() end -- selection elseif SelectedUnitsCount > 1 then - displayMode = 'selection' + displayMode = "selection" -- tooltip text else @@ -2437,10 +2359,10 @@ function checkChanges() doUpdate = true end - if displayMode == 'text' and isPregame then + if displayMode == "text" and isPregame then if not mySpec then - displayMode = 'unitdef' - displayUnitDefID = Spring.GetTeamRulesParam(myTeamID, 'startUnit') + displayMode = "unitdef" + displayUnitDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") hideBuildlist = true else emptyInfo = true @@ -2476,7 +2398,7 @@ function widget:SelectionChanged(sel) doUpdateClock = currentTime + throttleDelay end end - if not alwaysShow and select(7, spGetMouseState()) then -- cameraPanMode + if not alwaysShow and select(7, spGetMouseState()) then -- cameraPanMode checkChanges() end end @@ -2486,7 +2408,6 @@ function widget:LanguageChanged() widget:ViewResize() end - function widget:GetConfigData(data) return { showBuilderBuildlist = showBuilderBuildlist, diff --git a/luaui/Widgets/gui_infolos.lua b/luaui/Widgets/gui_infolos.lua index 9c02858285b..0a847ff0257 100644 --- a/luaui/Widgets/gui_infolos.lua +++ b/luaui/Widgets/gui_infolos.lua @@ -1,4 +1,3 @@ - -------------------------------------------------------------------------------- local widget = widget ---@type Widget @@ -11,11 +10,10 @@ function widget:GetInfo() date = "2022.12.12", license = "Lua code is GPL V2, GLSL is (c) Beherith", layer = -10000, -- lol this isnt even a number - enabled = true + enabled = true, } end - -- Localized functions for performance local mathMax = math.max @@ -26,52 +24,48 @@ local GL_RGBA32F_ARB = 0x8814 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- About: - -- This API presents an easy -to-use smoothed LOS texture for other widgets to do their shading based on - -- It exploits truncation of values during blending to provide prevradar and prevlos values too! - -- The RED channel contains LOS level, where - -- 0.2-1.0 is LOS level - -- < 0.2 is _never_been_in_los! - -- the GREEN channel contains AIRLOS level - -- 0.2-1.0 is LOS level - -- < 0.2 is _never_been_in_los! - - -- the BLUE channel contains RADAR coverage - -- < 0.2 = never been in radar - -- fragColor.b = 0.2 + 0.8 * clamp(0.75 * radarJammer.r - 0.5 * (radarJammer.g - 0.5),0,1); - -- >0.2 = radar coverage - -- <0.5 = jammer - -- It runs every gameFrame - - +-- This API presents an easy -to-use smoothed LOS texture for other widgets to do their shading based on +-- It exploits truncation of values during blending to provide prevradar and prevlos values too! +-- The RED channel contains LOS level, where +-- 0.2-1.0 is LOS level +-- < 0.2 is _never_been_in_los! +-- the GREEN channel contains AIRLOS level +-- 0.2-1.0 is LOS level +-- < 0.2 is _never_been_in_los! + +-- the BLUE channel contains RADAR coverage +-- < 0.2 = never been in radar +-- fragColor.b = 0.2 + 0.8 * clamp(0.75 * radarJammer.r - 0.5 * (radarJammer.g - 0.5),0,1); +-- >0.2 = radar coverage +-- <0.5 = jammer +-- It runs every gameFrame -- TODO: 2022.12.12 - -- [x] make it work? - -- [x] make api share? - -- [x] a clever thing might be to have 1 texture per allyteam? - -- some bugginess with jammer range? +-- [x] make it work? +-- [x] make api share? +-- [x] a clever thing might be to have 1 texture per allyteam? +-- some bugginess with jammer range? -- TODO 2022.12.20 - -- Read miplevels from modrules? +-- Read miplevels from modrules? -- TODO 2024.11.19 - -- [x] Make the shader have exact visibility per 8 elmo square (hmap - 1) - -- [ ] Make the shader update at updaterate for true smoothness. - -- [ ] When does the LOS texture actually get updated though? - -- [ ] Would need to double-buffer the texture, and perform a swap every (15) gameframes - -- [ ] API must then expose the new and the old texture, and the progress factor between them. - -- [ ] The default 30hz smootheness is far from enough - -- [ ] The delayed approach is fucking stupid. - -- [ ] The mip level should be the 'smallest' mip level possible, and save a fused texture - -- [ ] Note that we must retain the 'never been seen'/ 'never been in radar' functionality - +-- [x] Make the shader have exact visibility per 8 elmo square (hmap - 1) +-- [ ] Make the shader update at updaterate for true smoothness. +-- [ ] When does the LOS texture actually get updated though? +-- [ ] Would need to double-buffer the texture, and perform a swap every (15) gameframes +-- [ ] API must then expose the new and the old texture, and the progress factor between them. +-- [ ] The default 30hz smootheness is far from enough +-- [ ] The delayed approach is fucking stupid. +-- [ ] The mip level should be the 'smallest' mip level possible, and save a fused texture +-- [ ] Note that we must retain the 'never been seen'/ 'never been in radar' functionality local autoreload = false - local shaderConfig = { SAMPLES = 4, -- quality setting - TEXX = (Game.mapSizeX/8), - TEXY = (Game.mapSizeZ/8), + TEXX = (Game.mapSizeX / 8), + TEXY = (Game.mapSizeZ / 8), RESOLUTION = 2, EXACT = 1, -- 1 = exact visibility per 8 elmo square (hmap - 1) } @@ -79,7 +73,7 @@ local shaderConfig = { local alwaysColor, losColor, radarColor, jamColor, radarColor2 = Spring.GetLosViewColors() --unused local outputAlpha = 0.07 -local numFastUpdates = 10 -- how many quick updates to do on large-scale changes +local numFastUpdates = 10 -- how many quick updates to do on large-scale changes local updateRate = 2 -- on each Nth frame local updateInfoLOSTexture = 0 -- how many updates to do on next draw local delay = 1 @@ -97,7 +91,7 @@ local fullScreenQuadVAO = nil local vsSrcPath = "LuaUI/Shaders/infolos.vert.glsl" local fsSrcPath = "LuaUI/Shaders/infolos.frag.glsl" -local miplevels = {2^3, 2^4, 2^3, 1} -- los, airlos and radar mip levels +local miplevels = { 2 ^ 3, 2 ^ 4, 2 ^ 3, 1 } -- los, airlos and radar mip levels local shaderSourceCache = { vssrcpath = vsSrcPath, @@ -118,10 +112,9 @@ local shaderSourceCache = { [2] = "$info:radar", }, shaderName = "InfoLOS GL4", - shaderConfig = shaderConfig + shaderConfig = shaderConfig, } - local function GetInfoLOSTexture(allyTeam) return infoTextures[allyTeam or currentAllyTeam] end @@ -134,7 +127,7 @@ local function CreateLosTexture() wrap_t = GL.CLAMP_TO_EDGE, fbo = true, format = GL.RGBA8, -- more than enough - }) + }) end local function renderToTextureFunc() -- this draws the fogspheres onto the texture @@ -143,7 +136,7 @@ local function renderToTextureFunc() -- this draws the fogspheres onto the textu gl.Texture(1, "$info:airlos") gl.Texture(2, "$info:radar") --$info:los gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - + fullScreenQuadVAO:DrawArrays(GL.TRIANGLES) --gl.TexRect(-1, -1, 1, 1, 0, 0, 1, 1) gl.Texture(0, false) @@ -169,7 +162,6 @@ local function UpdateInfoLOSTexture(count) gl.DepthMask(false) --"BK OpenGL state resets", reset to default state end - function widget:PlayerChanged(playerID) local newAllyTeam = Spring.GetMyAllyTeamID() if currentAllyTeam ~= newAllyTeam then -- do a few quick renders @@ -177,7 +169,7 @@ function widget:PlayerChanged(playerID) updateInfoLOSTexture = numFastUpdates delay = 5 end - if updateInfoLOSTexture > 0 and autoreload then + if updateInfoLOSTexture > 0 and autoreload then spEcho("Fast Updating infolos texture for", currentAllyTeam, updateInfoLOSTexture, "times") end end @@ -188,13 +180,13 @@ function widget:Initialize() return end --local alwaysColor, losColor, radarColor, jamColor, radarColor2 = Spring.GetLosViewColors() - texX = (Game.mapSizeX/8)/shaderConfig.RESOLUTION - texY = (Game.mapSizeZ/8)/shaderConfig.RESOLUTION + texX = (Game.mapSizeX / 8) / shaderConfig.RESOLUTION + texY = (Game.mapSizeZ / 8) / shaderConfig.RESOLUTION - for name, tex in pairs({LOS = "$info:los", AIRLOS = "$info:airlos", RADAR = "$info:radar" }) do + for name, tex in pairs({ LOS = "$info:los", AIRLOS = "$info:airlos", RADAR = "$info:radar" }) do local texInfo = gl.TextureInfo(tex) - shaderConfig[name .. 'XSIZE'] = texInfo.xsize - shaderConfig[name .. 'YSIZE'] = texInfo.ysize + shaderConfig[name .. "XSIZE"] = texInfo.xsize + shaderConfig[name .. "YSIZE"] = texInfo.ysize end currentAllyTeam = Spring.GetMyAllyTeamID() @@ -202,18 +194,17 @@ function widget:Initialize() infoTextures[a] = CreateLosTexture() end - - infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) + infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) shaderCompiled = infoShader:Initialize() - if not shaderCompiled then spEcho("Failed to compile InfoLOS GL4") end - - - fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO()-- -1, -1, 1, 0, 0,0,1, 0.5 + if not shaderCompiled then + spEcho("Failed to compile InfoLOS GL4") + end - WG['infolosapi'] = {} - WG['infolosapi'].GetInfoLOSTexture = GetInfoLOSTexture - widgetHandler:RegisterGlobal('GetInfoLOSTexture', WG['infolosapi'].GetInfoLOSTexture) + fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO() -- -1, -1, 1, 0, 0,0,1, 0.5 + WG["infolosapi"] = {} + WG["infolosapi"].GetInfoLOSTexture = GetInfoLOSTexture + widgetHandler:RegisterGlobal("GetInfoLOSTexture", WG["infolosapi"].GetInfoLOSTexture) end function widget:Shutdown() @@ -221,18 +212,17 @@ function widget:Shutdown() gl.DeleteTexture(tex) end infoTextures = {} - WG['infolosapi'] = nil - widgetHandler:DeregisterGlobal('GetInfoLOSTexture') + WG["infolosapi"] = nil + widgetHandler:DeregisterGlobal("GetInfoLOSTexture") end function widget:GameFrame(n) if (n % updateRate) == 0 then - updateInfoLOSTexture = mathMax(1,updateInfoLOSTexture) + updateInfoLOSTexture = mathMax(1, updateInfoLOSTexture) end end -function widget:Update() -end +function widget:Update() end --local lastUpdate = Spring.GetTimer() @@ -243,10 +233,9 @@ function widget:DrawGenesis() -- outputAlpha = math.min(1.0, mathMax(0.07,deltat)) -- spEcho(deltat,outputAlpha) - if updateInfoLOSTexture > 0 then if delay > 0 then - delay = delay -1 + delay = delay - 1 else UpdateInfoLOSTexture(updateInfoLOSTexture) updateInfoLOSTexture = 0 @@ -255,22 +244,23 @@ function widget:DrawGenesis() end end - function widget:DrawScreen() -- the debug display output - if autoreload then + if autoreload then infoShader = LuaShader.CheckShaderUpdates(shaderSourceCache) or infoShader - gl.Color(1,1,1,1) -- use this to show individual channels of the texture! + gl.Color(1, 1, 1, 1) -- use this to show individual channels of the texture! gl.Texture(0, infoTextures[currentAllyTeam]) gl.Blending(GL.ONE, GL.ZERO) gl.Culling(false) gl.TexRect(0, 0, shaderConfig.TEXX, shaderConfig.TEXY, 0, 0, 1, 1) -- REMEMBER THAT THIS UPSIDE DOWN! - gl.Text(tostring(currentAllyTeam), shaderConfig.TEXX, shaderConfig.TEXY,16) - gl.Texture(0,"$info:los") + gl.Text(tostring(currentAllyTeam), shaderConfig.TEXX, shaderConfig.TEXY, 16) + gl.Texture(0, "$info:los") --gl.TexRect(texX, 0, texX + shaderConfig['LOSXSIZE'], shaderConfig['LOSYSIZE'], 0, 1, 1, 0) - gl.Texture(0,false) - + gl.Texture(0, false) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - if infoShader.DrawPrintf then infoShader.DrawPrintf() end + if infoShader.DrawPrintf then + infoShader.DrawPrintf() + end end end diff --git a/luaui/Widgets/gui_keybind_info.lua b/luaui/Widgets/gui_keybind_info.lua index d21d289a07e..d23b44daabd 100644 --- a/luaui/Widgets/gui_keybind_info.lua +++ b/luaui/Widgets/gui_keybind_info.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathCeil = math.ceil local mathFloor = math.floor @@ -31,15 +30,15 @@ local lineType = { key = 3, } -local tabs = {"Keybindings", "Grid Keys", "Grid CTRL Keys", "Grid ALT Keys", "Legacy Keys", "Legacy CTRL Keys", "Legacy ALT Keys",} +local tabs = { "Keybindings", "Grid Keys", "Grid CTRL Keys", "Grid ALT Keys", "Legacy Keys", "Legacy CTRL Keys", "Legacy ALT Keys" } local keybindsimages = { - ["Grid Keys"] = "luaui/images/keybinds/grid_keys.png", - ['Grid CTRL Keys'] = "luaui/images/keybinds/grid_keys_CTRL.png", - ['Grid ALT Keys'] = "luaui/images/keybinds/grid_keys_ALT.png", - ['Legacy Keys'] = "luaui/images/keybinds/legacy_keys.png", - ['Legacy CTRL Keys'] = "luaui/images/keybinds/legacy_keys_CTRL.png", - ['Legacy ALT Keys'] = "luaui/images/keybinds/legacy_keys_ALT.png", + ["Grid Keys"] = "luaui/images/keybinds/grid_keys.png", + ["Grid CTRL Keys"] = "luaui/images/keybinds/grid_keys_CTRL.png", + ["Grid ALT Keys"] = "luaui/images/keybinds/grid_keys_ALT.png", + ["Legacy Keys"] = "luaui/images/keybinds/legacy_keys.png", + ["Legacy CTRL Keys"] = "luaui/images/keybinds/legacy_keys_CTRL.png", + ["Legacy ALT Keys"] = "luaui/images/keybinds/legacy_keys_ALT.png", } local tabrects = {} @@ -51,9 +50,11 @@ local actionHotkeys local function getActionHotkey(action) local key = actionHotkeys[action] - if not key then return "(none)" end + if not key then + return "(none)" + end - return keyConfig.sanitizeKey(key, currentLayout):gsub("%+"," + ") + return keyConfig.sanitizeKey(key, currentLayout):gsub("%+", " + ") end local vsx, vsy = spGetViewGeometry() @@ -122,24 +123,26 @@ end local function drawWindow(activetab) local activetab = activetab or lasttab - if activetab == nil then activetab = 'Keybindings' end + if activetab == nil then + activetab = "Keybindings" + end -- background - UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) local titleFontSize = 18 * widgetScale local tabx = 0 - for i,tab in ipairs(tabs) do + for i, tab in ipairs(tabs) do local tabwidth = font2:GetTextWidth(tab) tabrects[tab] = { mathFloor(screenX + tabx), screenY, - mathFloor(screenX + tabx + tabwidth * titleFontSize + (titleFontSize*1.5)), - mathFloor(screenY + (titleFontSize*1.7)), - tabx + mathFloor(screenX + tabx + tabwidth * titleFontSize + (titleFontSize * 1.5)), + mathFloor(screenY + (titleFontSize * 1.7)), + tabx, } - tabx = tabx + (tabwidth * titleFontSize + (titleFontSize*1.5)) + tabx = tabx + (tabwidth * titleFontSize + (titleFontSize * 1.5)) gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) RectRound(tabrects[tab][1], tabrects[tab][2], tabrects[tab][3], tabrects[tab][4], elementCorner, 1, 1, 0, 0) end @@ -148,24 +151,22 @@ local function drawWindow(activetab) font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - for i,tab in ipairs(tabs) do + for i, tab in ipairs(tabs) do local tabcolor = keybindColor if tab ~= activetab then tabcolor = titleColor end - font2:Print(tabcolor .. tab, screenX + (titleFontSize * 0.75) + tabrects[tab][5], screenY + (8*widgetScale), titleFontSize, "on") + font2:Print(tabcolor .. tab, screenX + (titleFontSize * 0.75) + tabrects[tab][5], screenY + (8 * widgetScale), titleFontSize, "on") end font2:End() - if activetab ~= "Keybindings" and keybindsimages[activetab] then - gl.Color(1,1,1,1) - gl.Texture(0, ":l:"..keybindsimages[activetab]) + gl.Color(1, 1, 1, 1) + gl.Texture(0, ":l:" .. keybindsimages[activetab]) local zoom = 0.05 - gl.TexRect(screenX,screenY - screenHeight, screenX + screenWidth, screenY, 0 + 0.02, 1 - zoom, 1 - 0.02 , 0 + zoom) + gl.TexRect(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0 + 0.02, 1 - zoom, 1 - 0.02, 0 + zoom) gl.Texture(0, false) else - local entriesPerColumn = mathCeil(#keybindsText / 3) local entries1 = {} local entries2 = {} @@ -183,15 +184,15 @@ local function drawWindow(activetab) local textTopPadding = 28 * widgetScale local x = screenX + textPadding drawTextTable(entries1, x, screenY - textTopPadding) - x = x + (350*widgetScale) + x = x + (350 * widgetScale) drawTextTable(entries2, x, screenY - textTopPadding) - x = x + (350*widgetScale) + x = x + (350 * widgetScale) drawTextTable(entries3, x, screenY - textTopPadding) gl.Color(1, 1, 1, 1) font:Begin() - font:Print(Spring.I18N('ui.keybinds.disclaimer'), screenX + (12*widgetScale), screenY - screenHeight + (34*widgetScale), 12.5*widgetScale) - font:Print(Spring.I18N('ui.keybinds.howtochangekeybinds'), screenX + (12*widgetScale), screenY - screenHeight + (20*widgetScale), 12.5*widgetScale) + font:Print(Spring.I18N("ui.keybinds.disclaimer"), screenX + (12 * widgetScale), screenY - screenHeight + (34 * widgetScale), 12.5 * widgetScale) + font:Print(Spring.I18N("ui.keybinds.howtochangekeybinds"), screenX + (12 * widgetScale), screenY - screenHeight + (20 * widgetScale), 12.5 * widgetScale) font:End() end end @@ -201,107 +202,107 @@ local function refreshText() currentLayout = Spring.GetConfigString("KeyboardLayout", "qwerty") keybindsText = { - { type = lineType.title, text = Spring.I18N('ui.keybinds.chat.title') }, - { type = lineType.key, key = getActionHotkey('chat'), text = Spring.I18N('ui.keybinds.chat.send') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.alliesKey'), text = Spring.I18N('ui.keybinds.chat.allies') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.spectatorsKey'), text = Spring.I18N('ui.keybinds.chat.spectators') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.chat.ignoreKey'), text = Spring.I18N('ui.keybinds.chat.ignore') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.chat.title") }, + { type = lineType.key, key = getActionHotkey("chat"), text = Spring.I18N("ui.keybinds.chat.send") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.chat.alliesKey"), text = Spring.I18N("ui.keybinds.chat.allies") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.chat.spectatorsKey"), text = Spring.I18N("ui.keybinds.chat.spectators") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.chat.ignoreKey"), text = Spring.I18N("ui.keybinds.chat.ignore") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.menus.title') }, - { type = lineType.key, key = getActionHotkey('options'), text = Spring.I18N('ui.keybinds.menus.settings') }, - { type = lineType.key, key = getActionHotkey('sharedialog'), text = Spring.I18N('ui.keybinds.menus.share') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.menus.title") }, + { type = lineType.key, key = getActionHotkey("options"), text = Spring.I18N("ui.keybinds.menus.settings") }, + { type = lineType.key, key = getActionHotkey("sharedialog"), text = Spring.I18N("ui.keybinds.menus.share") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.camera.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.zoomKey'), text = Spring.I18N('ui.keybinds.camera.zoom') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.panKey'), text = Spring.I18N('ui.keybinds.camera.pan') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.tiltKey'), text = Spring.I18N('ui.keybinds.camera.tilt') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.camera.dragKey'), text = Spring.I18N('ui.keybinds.camera.drag') }, - { type = lineType.key, key = getActionHotkey('cameraflip'), text = Spring.I18N('ui.keybinds.camera.flip') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.camera.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.camera.zoomKey"), text = Spring.I18N("ui.keybinds.camera.zoom") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.camera.panKey"), text = Spring.I18N("ui.keybinds.camera.pan") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.camera.tiltKey"), text = Spring.I18N("ui.keybinds.camera.tilt") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.camera.dragKey"), text = Spring.I18N("ui.keybinds.camera.drag") }, + { type = lineType.key, key = getActionHotkey("cameraflip"), text = Spring.I18N("ui.keybinds.camera.flip") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.cameraModes.title') }, - { type = lineType.key, key = getActionHotkey('viewta') .. ', ' .. getActionHotkey('viewspring'), text = Spring.I18N('ui.keybinds.cameraModes.change') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.cameraModes.fullscreenKey'), text = Spring.I18N('ui.keybinds.cameraModes.fullscreen') }, - { type = lineType.key, key = getActionHotkey('toggleoverview'), text = Spring.I18N('ui.keybinds.cameraModes.overview') }, - { type = lineType.key, key = getActionHotkey('togglelos'), text = Spring.I18N('ui.keybinds.cameraModes.los') }, - { type = lineType.key, key = getActionHotkey('showelevation'), text = Spring.I18N('ui.keybinds.cameraModes.heightmap') }, - { type = lineType.key, key = getActionHotkey('showpathtraversability'), text = Spring.I18N('ui.keybinds.cameraModes.traversability')}, - { type = lineType.key, key = getActionHotkey('lastmsgpos'), text = Spring.I18N('ui.keybinds.cameraModes.mapmarks') }, - { type = lineType.key, key = getActionHotkey('showmetalmap'), text = Spring.I18N('ui.keybinds.cameraModes.resourceSpots') }, - { type = lineType.key, key = getActionHotkey('hideinterface'), text = Spring.I18N('ui.keybinds.cameraModes.interface') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.cameraModes.title") }, + { type = lineType.key, key = getActionHotkey("viewta") .. ", " .. getActionHotkey("viewspring"), text = Spring.I18N("ui.keybinds.cameraModes.change") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.cameraModes.fullscreenKey"), text = Spring.I18N("ui.keybinds.cameraModes.fullscreen") }, + { type = lineType.key, key = getActionHotkey("toggleoverview"), text = Spring.I18N("ui.keybinds.cameraModes.overview") }, + { type = lineType.key, key = getActionHotkey("togglelos"), text = Spring.I18N("ui.keybinds.cameraModes.los") }, + { type = lineType.key, key = getActionHotkey("showelevation"), text = Spring.I18N("ui.keybinds.cameraModes.heightmap") }, + { type = lineType.key, key = getActionHotkey("showpathtraversability"), text = Spring.I18N("ui.keybinds.cameraModes.traversability") }, + { type = lineType.key, key = getActionHotkey("lastmsgpos"), text = Spring.I18N("ui.keybinds.cameraModes.mapmarks") }, + { type = lineType.key, key = getActionHotkey("showmetalmap"), text = Spring.I18N("ui.keybinds.cameraModes.resourceSpots") }, + { type = lineType.key, key = getActionHotkey("hideinterface"), text = Spring.I18N("ui.keybinds.cameraModes.interface") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.sound.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.sound.volumeKey'), text = Spring.I18N('ui.keybinds.sound.volume') }, - { type = lineType.key, key = getActionHotkey('mutesound'), text = Spring.I18N('ui.keybinds.sound.mute') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.sound.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.sound.volumeKey"), text = Spring.I18N("ui.keybinds.sound.volume") }, + { type = lineType.key, key = getActionHotkey("mutesound"), text = Spring.I18N("ui.keybinds.sound.mute") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.selection.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.selection.unitsKey'), text = Spring.I18N('ui.keybinds.selection.units') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.selection.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.selection.unitsKey"), text = Spring.I18N("ui.keybinds.selection.units") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueContextOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueContextOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueContextOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueContextOrders.formationOrderKey'), text = Spring.I18N('ui.keybinds.issueContextOrders.formationOrder') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.issueContextOrders.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueContextOrders.orderKey"), text = Spring.I18N("ui.keybinds.issueContextOrders.order") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueContextOrders.formationOrderKey"), text = Spring.I18N("ui.keybinds.issueContextOrders.formationOrder") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.orders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.orders.defaultKey'), text = Spring.I18N('ui.keybinds.orders.default') }, - { type = lineType.key, key = getActionHotkey('move'), text = Spring.I18N('ui.keybinds.orders.move') }, - { type = lineType.key, key = getActionHotkey('attack'), text = Spring.I18N('ui.keybinds.orders.attack') }, - { type = lineType.key, key = getActionHotkey('settarget'), text = Spring.I18N('ui.keybinds.orders.setTarget') }, - { type = lineType.key, key = getActionHotkey('repair'), text = Spring.I18N('ui.keybinds.orders.repair') }, - { type = lineType.key, key = getActionHotkey('reclaim'), text = Spring.I18N('ui.keybinds.orders.reclaim') }, - { type = lineType.key, key = getActionHotkey('resurrect'), text = Spring.I18N('ui.keybinds.orders.resurrect') }, - { type = lineType.key, key = getActionHotkey('fight'), text = Spring.I18N('ui.keybinds.orders.fight') }, - { type = lineType.key, key = getActionHotkey('patrol'), text = Spring.I18N('ui.keybinds.orders.patrol') }, - { type = lineType.key, key = getActionHotkey('wantcloak'), text = Spring.I18N('ui.keybinds.orders.cloak') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.orders.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.orders.defaultKey"), text = Spring.I18N("ui.keybinds.orders.default") }, + { type = lineType.key, key = getActionHotkey("move"), text = Spring.I18N("ui.keybinds.orders.move") }, + { type = lineType.key, key = getActionHotkey("attack"), text = Spring.I18N("ui.keybinds.orders.attack") }, + { type = lineType.key, key = getActionHotkey("settarget"), text = Spring.I18N("ui.keybinds.orders.setTarget") }, + { type = lineType.key, key = getActionHotkey("repair"), text = Spring.I18N("ui.keybinds.orders.repair") }, + { type = lineType.key, key = getActionHotkey("reclaim"), text = Spring.I18N("ui.keybinds.orders.reclaim") }, + { type = lineType.key, key = getActionHotkey("resurrect"), text = Spring.I18N("ui.keybinds.orders.resurrect") }, + { type = lineType.key, key = getActionHotkey("fight"), text = Spring.I18N("ui.keybinds.orders.fight") }, + { type = lineType.key, key = getActionHotkey("patrol"), text = Spring.I18N("ui.keybinds.orders.patrol") }, + { type = lineType.key, key = getActionHotkey("wantcloak"), text = Spring.I18N("ui.keybinds.orders.cloak") }, { type = lineType.blank }, - { type = lineType.key, key = getActionHotkey('stop'), text = Spring.I18N('ui.keybinds.orders.stop') }, - { type = lineType.key, key = getActionHotkey('wait'), text = Spring.I18N('ui.keybinds.orders.wait') }, - { type = lineType.key, key = getActionHotkey('canceltarget'), text = Spring.I18N('ui.keybinds.orders.cancelTarget') }, + { type = lineType.key, key = getActionHotkey("stop"), text = Spring.I18N("ui.keybinds.orders.stop") }, + { type = lineType.key, key = getActionHotkey("wait"), text = Spring.I18N("ui.keybinds.orders.wait") }, + { type = lineType.key, key = getActionHotkey("canceltarget"), text = Spring.I18N("ui.keybinds.orders.cancelTarget") }, { type = lineType.blank }, - { type = lineType.key, key = getActionHotkey('manualfire'), text = Spring.I18N('ui.keybinds.orders.dGun') }, - { type = lineType.key, key = getActionHotkey('selfd'), text = Spring.I18N('ui.keybinds.orders.selfDestruct') }, + { type = lineType.key, key = getActionHotkey("manualfire"), text = Spring.I18N("ui.keybinds.orders.dGun") }, + { type = lineType.key, key = getActionHotkey("selfd"), text = Spring.I18N("ui.keybinds.orders.selfDestruct") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.revertKey'), text = Spring.I18N('ui.keybinds.issueOrders.revert') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueOrders.formationKey'), text = Spring.I18N('ui.keybinds.issueOrders.formation') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.issueOrders.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueOrders.orderKey"), text = Spring.I18N("ui.keybinds.issueOrders.order") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueOrders.revertKey"), text = Spring.I18N("ui.keybinds.issueOrders.revert") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueOrders.formationKey"), text = Spring.I18N("ui.keybinds.issueOrders.formation") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.queues.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.queues.appendKey'), text = Spring.I18N('ui.keybinds.queues.append') }, - { type = lineType.key, key = getActionHotkey('commandinsert'), text = Spring.I18N('ui.keybinds.queues.prepend')}, + { type = lineType.title, text = Spring.I18N("ui.keybinds.queues.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.queues.appendKey"), text = Spring.I18N("ui.keybinds.queues.append") }, + { type = lineType.key, key = getActionHotkey("commandinsert"), text = Spring.I18N("ui.keybinds.queues.prepend") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.buildOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.selectTileKey'), text = Spring.I18N('ui.keybinds.buildOrders.selectTile')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.metalKey'), text = Spring.I18N('ui.keybinds.buildOrders.metal') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.energyKey'), text = Spring.I18N('ui.keybinds.buildOrders.energy') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.intelKey'), text = Spring.I18N('ui.keybinds.buildOrders.intel') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.buildOrders.factoriesKey'), text = Spring.I18N('ui.keybinds.buildOrders.factories') }, - { type = lineType.key, key = getActionHotkey('buildfacing_inc') .." / ".. getActionHotkey('buildfacing_dec'), text = Spring.I18N('ui.keybinds.buildOrders.rotate') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.buildOrders.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.buildOrders.selectTileKey"), text = Spring.I18N("ui.keybinds.buildOrders.selectTile") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.buildOrders.metalKey"), text = Spring.I18N("ui.keybinds.buildOrders.metal") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.buildOrders.energyKey"), text = Spring.I18N("ui.keybinds.buildOrders.energy") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.buildOrders.intelKey"), text = Spring.I18N("ui.keybinds.buildOrders.intel") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.buildOrders.factoriesKey"), text = Spring.I18N("ui.keybinds.buildOrders.factories") }, + { type = lineType.key, key = getActionHotkey("buildfacing_inc") .. " / " .. getActionHotkey("buildfacing_dec"), text = Spring.I18N("ui.keybinds.buildOrders.rotate") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.issueBuildOrders.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.orderKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.order') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.deselect'), text = Spring.I18N('ui.keybinds.issueBuildOrders.deselect') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.lineKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.line') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.issueBuildOrders.gridKey'), text = Spring.I18N('ui.keybinds.issueBuildOrders.grid') }, - { type = lineType.key, key = getActionHotkey('buildspacing_inc'), text = Spring.I18N('ui.keybinds.issueBuildOrders.spacingUp') }, - { type = lineType.key, key = getActionHotkey('buildspacing_dec'), text = Spring.I18N('ui.keybinds.issueBuildOrders.spacingDown') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.issueBuildOrders.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueBuildOrders.orderKey"), text = Spring.I18N("ui.keybinds.issueBuildOrders.order") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueBuildOrders.deselect"), text = Spring.I18N("ui.keybinds.issueBuildOrders.deselect") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueBuildOrders.lineKey"), text = Spring.I18N("ui.keybinds.issueBuildOrders.line") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.issueBuildOrders.gridKey"), text = Spring.I18N("ui.keybinds.issueBuildOrders.grid") }, + { type = lineType.key, key = getActionHotkey("buildspacing_inc"), text = Spring.I18N("ui.keybinds.issueBuildOrders.spacingUp") }, + { type = lineType.key, key = getActionHotkey("buildspacing_dec"), text = Spring.I18N("ui.keybinds.issueBuildOrders.spacingDown") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.massSelect.title') }, - { type = lineType.key, key = getActionHotkey('select_AllMap++_ClearSelection_SelectAll+'), text = Spring.I18N('ui.keybinds.massSelect.all') }, - { type = lineType.key, key = getActionHotkey('select_AllMap+_Builder_Idle+_ClearSelection_SelectOne+'), text = Spring.I18N('ui.keybinds.massSelect.builders') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.createGroupKey'), text = Spring.I18N('ui.keybinds.massSelect.createGroup')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.createAutoGroupKey'), text = Spring.I18N('ui.keybinds.massSelect.createAutoGroup')}, - { type = lineType.key, key = getActionHotkey('remove_from_autogroup'), text = Spring.I18N('ui.keybinds.massSelect.removeAutoGroup')}, - { type = lineType.key, key = Spring.I18N('ui.keybinds.massSelect.groupKey'), text = Spring.I18N('ui.keybinds.massSelect.group') }, - { type = lineType.key, key = getActionHotkey('select_AllMap+_InPrevSel+_ClearSelection_SelectAll+'), text = Spring.I18N('ui.keybinds.massSelect.sameType') }, - { type = lineType.key, key = getActionHotkey('select_PrevSelection+_Not_Building_Not_RelativeHealth_60+_ClearSelection_SelectAll+'), text = Spring.I18N('ui.keybinds.massSelect.damaged') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.massSelect.title") }, + { type = lineType.key, key = getActionHotkey("select_AllMap++_ClearSelection_SelectAll+"), text = Spring.I18N("ui.keybinds.massSelect.all") }, + { type = lineType.key, key = getActionHotkey("select_AllMap+_Builder_Idle+_ClearSelection_SelectOne+"), text = Spring.I18N("ui.keybinds.massSelect.builders") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.massSelect.createGroupKey"), text = Spring.I18N("ui.keybinds.massSelect.createGroup") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.massSelect.createAutoGroupKey"), text = Spring.I18N("ui.keybinds.massSelect.createAutoGroup") }, + { type = lineType.key, key = getActionHotkey("remove_from_autogroup"), text = Spring.I18N("ui.keybinds.massSelect.removeAutoGroup") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.massSelect.groupKey"), text = Spring.I18N("ui.keybinds.massSelect.group") }, + { type = lineType.key, key = getActionHotkey("select_AllMap+_InPrevSel+_ClearSelection_SelectAll+"), text = Spring.I18N("ui.keybinds.massSelect.sameType") }, + { type = lineType.key, key = getActionHotkey("select_PrevSelection+_Not_Building_Not_RelativeHealth_60+_ClearSelection_SelectAll+"), text = Spring.I18N("ui.keybinds.massSelect.damaged") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.drawing.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.mapmarkKey'), text = Spring.I18N('ui.keybinds.drawing.mapmark') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.drawKey'), text = Spring.I18N('ui.keybinds.drawing.draw') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.drawing.eraseKey'), text = Spring.I18N('ui.keybinds.drawing.erase') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.drawing.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.drawing.mapmarkKey"), text = Spring.I18N("ui.keybinds.drawing.mapmark") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.drawing.drawKey"), text = Spring.I18N("ui.keybinds.drawing.draw") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.drawing.eraseKey"), text = Spring.I18N("ui.keybinds.drawing.erase") }, { type = lineType.blank }, - { type = lineType.title, text = Spring.I18N('ui.keybinds.console.title') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.console.eraseKey'), text = Spring.I18N('ui.keybinds.console.erase') }, - { type = lineType.key, key = Spring.I18N('ui.keybinds.console.pauseKey'), text = Spring.I18N('ui.keybinds.console.pause') }, + { type = lineType.title, text = Spring.I18N("ui.keybinds.console.title") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.console.eraseKey"), text = Spring.I18N("ui.keybinds.console.erase") }, + { type = lineType.key, key = Spring.I18N("ui.keybinds.console.pauseKey"), text = Spring.I18N("ui.keybinds.console.pause") }, } end @@ -314,8 +315,8 @@ function widget:ViewResize() screenX = mathFloor((vsx * centerPosX) - (screenWidth / 2)) screenY = mathFloor((vsy * centerPosY) + (screenHeight / 2)) - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner @@ -328,8 +329,8 @@ function widget:ViewResize() keybinds = gl.CreateList(drawWindow) if backgroundGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].DeleteDlist('keybindinfo') + if WG["guishader"] then + WG["guishader"].DeleteDlist("keybindinfo") else glDeleteList(backgroundGuishader) end @@ -337,10 +338,7 @@ function widget:ViewResize() end end - - function widget:DrawScreen() - -- draw the help if doUpdate then if keybinds then @@ -358,9 +356,9 @@ function widget:DrawScreen() doUpdate = false if show or showOnceMore then - gl.Texture(false) -- some other widget left it on + gl.Texture(false) -- some other widget left it on glCallList(keybinds) - if WG['guishader'] and backgroundGuishader == nil then + if WG["guishader"] and backgroundGuishader == nil then backgroundGuishader = glCreateList(function() -- background RectRound(screenX, screenY - screenHeight, screenX + screenWidth, screenY, elementCorner, 0, 1, 1, 1) @@ -369,18 +367,18 @@ function widget:DrawScreen() RectRound(tabrect[1], tabrect[2], tabrect[3], tabrect[4], elementCorner, 1, 1, 0, 0) end end) - WG['guishader'].InsertDlist(backgroundGuishader, 'keybindinfo') + WG["guishader"].InsertDlist(backgroundGuishader, "keybindinfo") end showOnceMore = false local x, y, pressed = Spring.GetMouseState() - if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) then - Spring.SetMouseCursor('cursornormal') + if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) then + Spring.SetMouseCursor("cursornormal") end else if backgroundGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].DeleteDlist('keybindinfo') + if WG["guishader"] then + WG["guishader"].DeleteDlist("keybindinfo") else glDeleteList(backgroundGuishader) end @@ -414,8 +412,8 @@ local function mouseEvent(x, y, button, release) lasstab = tab keybinds = gl.CreateList(drawWindow, tab) if backgroundGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].DeleteDlist('keybindinfo') + if WG["guishader"] then + WG["guishader"].DeleteDlist("keybindinfo") else glDeleteList(backgroundGuishader) end @@ -425,7 +423,7 @@ local function mouseEvent(x, y, button, release) end end if release or not release then - showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it + showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it show = false end end @@ -443,18 +441,18 @@ end function widget:Initialize() refreshText() - WG['keybinds'] = {} - WG['keybinds'].toggle = function(state) + WG["keybinds"] = {} + WG["keybinds"].toggle = function(state) if state ~= nil then show = state else show = not show end end - WG['keybinds'].isvisible = function() + WG["keybinds"].isvisible = function() return show end - WG['keybinds'].reloadBindings = function() + WG["keybinds"].reloadBindings = function() refreshText() doUpdate = true end @@ -467,8 +465,8 @@ function widget:Shutdown() keybinds = nil end if backgroundGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].DeleteDlist('keybindinfo') + if WG["guishader"] then + WG["guishader"].DeleteDlist("keybindinfo") else glDeleteList(backgroundGuishader) end diff --git a/luaui/Widgets/gui_language.lua b/luaui/Widgets/gui_language.lua index 6490c77f06d..ad626115165 100644 --- a/luaui/Widgets/gui_language.lua +++ b/luaui/Widgets/gui_language.lua @@ -2,23 +2,25 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Language", - desc = "Handle functions related to translations", - date = "November 2023", - layer = -999999, - enabled = true, + name = "Language", + desc = "Handle functions related to translations", + date = "November 2023", + layer = -999999, + enabled = true, } end -local i18nHelper = VFS.Include('luaui/i18nhelpers.lua') +local i18nHelper = VFS.Include("luaui/i18nhelpers.lua") local customMessageProxies = { - ['ui.chickens.queenResistant'] = function (data) return { unit = UnitDefs[data.unitDefId].translatedHumanName } end, + ["ui.chickens.queenResistant"] = function(data) + return { unit = UnitDefs[data.unitDefId].translatedHumanName } + end, } local function getMessageProxy(messageKey, parameters) if customMessageProxies[messageKey] then - return Spring.I18N( messageKey, customMessageProxies[messageKey](parameters) ) + return Spring.I18N(messageKey, customMessageProxies[messageKey](parameters)) else return Spring.I18N(messageKey, parameters) end @@ -31,28 +33,28 @@ end function widget:Initialize() i18nHelper.RefreshDefs() - widgetHandler:RegisterGlobal('GadgetMessageProxy', getMessageProxy) + widgetHandler:RegisterGlobal("GadgetMessageProxy", getMessageProxy) - WG['language'] = {} + WG["language"] = {} - WG['language'].setLanguage = function(language) - Spring.SetConfigString('language', language) + WG["language"].setLanguage = function(language) + Spring.SetConfigString("language", language) Spring.I18N.setLanguage(language) - if Script.LuaUI('LanguageChanged') then + if Script.LuaUI("LanguageChanged") then Script.LuaUI.LanguageChanged() end end - WG['language'].setEnglishUnitNames = function(value) + WG["language"].setEnglishUnitNames = function(value) Spring.SetConfigInt("language_english_unit_names", value and 1 or 0) - if Script.LuaUI('LanguageChanged') then + if Script.LuaUI("LanguageChanged") then Script.LuaUI.LanguageChanged() end end end function widget:Shutdown() - WG['lang'] = nil + WG["lang"] = nil end diff --git a/luaui/Widgets/gui_los_view_gl4.lua b/luaui/Widgets/gui_los_view_gl4.lua index bc3a82ad9e7..3e5ee62e40f 100644 --- a/luaui/Widgets/gui_los_view_gl4.lua +++ b/luaui/Widgets/gui_los_view_gl4.lua @@ -1,4 +1,3 @@ - -------------------------------------------------------------------------------- function widget:GetInfo() return { @@ -9,11 +8,10 @@ function widget:GetInfo() date = "2024.11.19", license = "GPL V2", layer = -10000, -- lol this isnt even a number - enabled = false + enabled = false, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -22,10 +20,10 @@ local spEcho = Spring.Echo --- - [ ] Customize grid --- - [ ] Ensure draw order is correct after decals_gl4 --- - [ ] Mark los edge with white line ---- - [ ] Mark radar edge with stippled green line +--- - [ ] Mark radar edge with stippled green line --- - [ ] Find a nice noise approach --- - [ ] Implement desat-darken approach ---- - [ ] scanlines dont work underwater if drawn preunit :'( +--- - [ ] scanlines dont work underwater if drawn preunit :'( --- - [ ] If drawn postunit, then ghosts are shaded incorrectly --- --- @@ -34,7 +32,7 @@ local spEcho = Spring.Echo local autoreload = false local shaderConfig = { - DEBUG = autoreload and 1 or 0, + DEBUG = autoreload and 1 or 0, PREUNIT = 1, -- 1 for preunit, 0 for postunit } @@ -47,21 +45,20 @@ local vsx, vsy, vpx, vpy local losViewShader = nil local fullScreenQuadVAO = nil local losViewShaderSourceCache = { - vssrcpath = "LuaUI/Shaders/infolos_view.vert.glsl", - fssrcpath = "LuaUI/Shaders/infolos_view.frag.glsl", - uniformFloat = { - blendfactors = {1,1,1,1}, - }, - uniformInt = { - mapDepths = 0, - modelDepths = 1, - screenCopyTex = 2, - losTex = 3, - }, - shaderName = "LosViewShader GL4", - shaderConfig = shaderConfig - } - + vssrcpath = "LuaUI/Shaders/infolos_view.vert.glsl", + fssrcpath = "LuaUI/Shaders/infolos_view.frag.glsl", + uniformFloat = { + blendfactors = { 1, 1, 1, 1 }, + }, + uniformInt = { + mapDepths = 0, + modelDepths = 1, + screenCopyTex = 2, + losTex = 3, + }, + shaderName = "LosViewShader GL4", + shaderConfig = shaderConfig, +} function widget:PlayerChanged(playerID) currentAllyTeam = Spring.GetMyAllyTeamID() @@ -69,8 +66,10 @@ end function widget:ViewResize() vsx, vsy, vpx, vpy = Spring.GetViewGeometry() - if ScreenCopyTexture then gl.DeleteTexture(ScreenCopyTexture) end - ScreenCopyTexture = gl.CreateTexture(vsx , vsy, { + if ScreenCopyTexture then + gl.DeleteTexture(ScreenCopyTexture) + end + ScreenCopyTexture = gl.CreateTexture(vsx, vsy, { border = false, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, @@ -85,17 +84,19 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not WG['infolosapi'] then - spEcho("Los View GL4: Missing InfoLOS API") - widgetHandler:RemoveWidget() - return - end + if not WG["infolosapi"] then + spEcho("Los View GL4: Missing InfoLOS API") + widgetHandler:RemoveWidget() + return + end - widget:ViewResize() - losViewShader = LuaShader.CheckShaderUpdates(losViewShaderSourceCache) - fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO()-- -1, -1, 1, 0, 0,0,1, 0.5) - losViewShader:Initialize() - if not losViewShader then spEcho("Failed to compile losViewShader GL4") end + widget:ViewResize() + losViewShader = LuaShader.CheckShaderUpdates(losViewShaderSourceCache) + fullScreenQuadVAO = InstanceVBOTable.MakeTexRectVAO() -- -1, -1, 1, 0, 0,0,1, 0.5) + losViewShader:Initialize() + if not losViewShader then + spEcho("Failed to compile losViewShader GL4") + end end function widget:Shutdown() @@ -104,30 +105,34 @@ function widget:Shutdown() end function widget:DrawPreDecals() - if autoreload then - losViewShader = LuaShader.CheckShaderUpdates(losViewShaderSourceCache) or losViewShader - end - - gl.CopyToTexture(ScreenCopyTexture, 0, 0, vpx, vpy, vsx, vsy) - gl.Texture(0, "$map_gbuffer_zvaltex") - gl.Texture(1, "$model_gbuffer_zvaltex") - gl.Texture(2, ScreenCopyTexture) - gl.Texture(3, WG['infolosapi'].GetInfoLOSTexture(currentAllyTeam)) - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.Culling(false) -- ffs - gl.DepthTest(false) - gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove + if autoreload then + losViewShader = LuaShader.CheckShaderUpdates(losViewShaderSourceCache) or losViewShader + end - losViewShader:Activate() - losViewShader:SetUniformFloat("blendfactors", {1,1,1,1}) - fullScreenQuadVAO:DrawArrays(GL.TRIANGLES) - losViewShader:Deactivate() - gl.DepthTest(true) - for i = 0,3 do gl.Texture(i, false) end + gl.CopyToTexture(ScreenCopyTexture, 0, 0, vpx, vpy, vsx, vsy) + gl.Texture(0, "$map_gbuffer_zvaltex") + gl.Texture(1, "$model_gbuffer_zvaltex") + gl.Texture(2, ScreenCopyTexture) + gl.Texture(3, WG["infolosapi"].GetInfoLOSTexture(currentAllyTeam)) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.Culling(false) -- ffs + gl.DepthTest(false) + gl.DepthMask(false) --"BK OpenGL state resets", default is already false, could remove + + losViewShader:Activate() + losViewShader:SetUniformFloat("blendfactors", { 1, 1, 1, 1 }) + fullScreenQuadVAO:DrawArrays(GL.TRIANGLES) + losViewShader:Deactivate() + gl.DepthTest(true) + for i = 0, 3 do + gl.Texture(i, false) + end end -if autoreload then - function widget:DrawScreen() - if losViewShader.DrawPrintf then losViewShader.DrawPrintf() end - end +if autoreload then + function widget:DrawScreen() + if losViewShader.DrawPrintf then + losViewShader.DrawPrintf() + end + end end diff --git a/luaui/Widgets/gui_mapinfo.lua b/luaui/Widgets/gui_mapinfo.lua index 32119b9897c..e52a9c6b553 100644 --- a/luaui/Widgets/gui_mapinfo.lua +++ b/luaui/Widgets/gui_mapinfo.lua @@ -1,65 +1,64 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Map Info", - desc = "Draws map info on the bottom left of the map. Toggle vertical position with /mapinfo_floor", - author = "Floris", - date = "20 May 2015", - license = "GNU GPL, v2 or later", - layer = -10, - enabled = true, - } + return { + name = "Map Info", + desc = "Draws map info on the bottom left of the map. Toggle vertical position with /mapinfo_floor", + author = "Floris", + date = "20 May 2015", + license = "GNU GPL, v2 or later", + layer = -10, + enabled = true, + } end - -- Localized functions for performance local mathFloor = math.floor -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local scale = 1 -local offset = 5 -local thickness = 6 -local fadeStartHeight = 800 -local fadeEndHeight = 4800 -local dlistAmount = 20 -- amount of dlists created, one for each opacity value +local scale = 1 +local offset = 5 +local thickness = 6 +local fadeStartHeight = 800 +local fadeEndHeight = 4800 +local dlistAmount = 20 -- amount of dlists created, one for each opacity value -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spGetCameraPosition = Spring.GetCameraPosition -local spGetGroundHeight = Spring.GetGroundHeight -local spIsAABBInView = Spring.IsAABBInView +local spGetCameraPosition = Spring.GetCameraPosition +local spGetGroundHeight = Spring.GetGroundHeight +local spIsAABBInView = Spring.IsAABBInView -local glColor = gl.Color -local glScale = gl.Scale -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glTranslate = gl.Translate -local glBeginEnd = gl.BeginEnd -local glVertex = gl.Vertex -local glBlending = gl.Blending -local glCallList = gl.CallList -local glDeleteList = gl.DeleteList +local glColor = gl.Color +local glScale = gl.Scale +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glBeginEnd = gl.BeginEnd +local glVertex = gl.Vertex +local glBlending = gl.Blending +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList -local glDepthTest = gl.DepthTest -local glRotate = gl.Rotate +local glDepthTest = gl.DepthTest +local glRotate = gl.Rotate -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() -local mapInfoWidth = 400 -- minimum width +local mapInfoWidth = 400 -- minimum width local mapinfoList = {} local font, mapInfoBoxHeight -local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs +local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs function widget:ViewResize() - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() for opacity, list in pairs(mapinfoList) do glDeleteList(list) @@ -68,114 +67,111 @@ function widget:ViewResize() end local function createMapinfoList(opacityMultiplier) - mapinfoList[opacityMultiplier] = gl.CreateList( function() + mapinfoList[opacityMultiplier] = gl.CreateList(function() local textOpacity = 0.85 local textSize = 12 local textOffsetX = 11 local textOffsetY = 16 - local usedTextOffsetY = textOffsetY + (offset/2) - local length = math.max(mapInfoWidth, (font:GetTextWidth(Game.mapDescription)*textSize) + 45) + local usedTextOffsetY = textOffsetY + (offset / 2) + local length = math.max(mapInfoWidth, (font:GetTextWidth(Game.mapDescription) * textSize) + 45) glDepthTest(true) glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - glTranslate(offset, mapInfoBoxHeight-offset, Game.mapSizeZ+0.01) + glTranslate(offset, mapInfoBoxHeight - offset, Game.mapSizeZ + 0.01) glPushMatrix() - glScale(scale,scale,scale) - glRotate(90,0,-1,0) - glRotate(180,1,0,0) + glScale(scale, scale, scale) + glRotate(90, 0, -1, 0) + glRotate(180, 1, 0, 0) local height = 90 - local thickness = -(thickness*scale) - glBeginEnd(GL.QUADS,function() - glColor(0.12,0.12,0.12,0.4*opacityMultiplier*opacityMultiplier) - glVertex( height, 0 , 0); -- Top Right Of The Quad (Top) - glVertex( 0 , 0 , 0); -- Top Left Of The Quad (Top) - glVertex( 0 , 0 , length); -- Bottom Left Of The Quad (Top) - glVertex( height, 0 , length); -- Bottom Right Of The Quad (Top) - - glVertex( height, 0 , length); -- Top Right Of The Quad (Front) - glVertex( 0 , 0 , length); -- Top Left Of The Quad (Front) - glVertex( 0 ,-thickness, length); -- Bottom Left Of The Quad (Front) - glVertex( height,-thickness, length); -- Bottom Right Of The Quad (Front) - - glVertex( height,-thickness, 0); -- Top Right Of The Quad (Back) - glVertex( 0 ,-thickness, 0); -- Top Left Of The Quad (Back) - glVertex( 0 , 0 , 0); -- Bottom Left Of The Quad (Back) - glVertex( height, 0 , 0); -- Bottom Right Of The Quad (Back) - - glVertex( 0 , 0 , length); -- Top Right Of The Quad (Left) - glVertex( 0 , 0 , 0); -- Top Left Of The Quad (Left) - glVertex( 0 ,-thickness, 0); -- Bottom Left Of The Quad (Left) - glVertex( 0 ,-thickness, length); -- Bottom Right Of The Quad (Left) - - glVertex( height, 0 , 0); -- Top Right Of The Quad (Right) - glVertex( height, 0 , length); -- Top Left Of The Quad (Right) - glVertex( height,-thickness, length); -- Bottom Left Of The Quad (Right) - glVertex( height,-thickness, 0); -- Bottom Right Of The Quad (Right) - - - glColor(0.05,0.05,0.05,0.4*opacityMultiplier*opacityMultiplier) - glVertex( height,-thickness, length); -- Top Right Of The Quad (Bottom) - glVertex( 0 ,-thickness, length); -- Top Left Of The Quad (Bottom) - glVertex( 0 ,-thickness, 0); -- Bottom Left Of The Quad (Bottom) - glVertex( height,-thickness, 0); -- Bottom Right Of The Quad (Bottom) + local thickness = -(thickness * scale) + glBeginEnd(GL.QUADS, function() + glColor(0.12, 0.12, 0.12, 0.4 * opacityMultiplier * opacityMultiplier) + glVertex(height, 0, 0) -- Top Right Of The Quad (Top) + glVertex(0, 0, 0) -- Top Left Of The Quad (Top) + glVertex(0, 0, length) -- Bottom Left Of The Quad (Top) + glVertex(height, 0, length) -- Bottom Right Of The Quad (Top) + + glVertex(height, 0, length) -- Top Right Of The Quad (Front) + glVertex(0, 0, length) -- Top Left Of The Quad (Front) + glVertex(0, -thickness, length) -- Bottom Left Of The Quad (Front) + glVertex(height, -thickness, length) -- Bottom Right Of The Quad (Front) + + glVertex(height, -thickness, 0) -- Top Right Of The Quad (Back) + glVertex(0, -thickness, 0) -- Top Left Of The Quad (Back) + glVertex(0, 0, 0) -- Bottom Left Of The Quad (Back) + glVertex(height, 0, 0) -- Bottom Right Of The Quad (Back) + + glVertex(0, 0, length) -- Top Right Of The Quad (Left) + glVertex(0, 0, 0) -- Top Left Of The Quad (Left) + glVertex(0, -thickness, 0) -- Bottom Left Of The Quad (Left) + glVertex(0, -thickness, length) -- Bottom Right Of The Quad (Left) + + glVertex(height, 0, 0) -- Top Right Of The Quad (Right) + glVertex(height, 0, length) -- Top Left Of The Quad (Right) + glVertex(height, -thickness, length) -- Bottom Left Of The Quad (Right) + glVertex(height, -thickness, 0) -- Bottom Right Of The Quad (Right) + + glColor(0.05, 0.05, 0.05, 0.4 * opacityMultiplier * opacityMultiplier) + glVertex(height, -thickness, length) -- Top Right Of The Quad (Bottom) + glVertex(0, -thickness, length) -- Top Left Of The Quad (Bottom) + glVertex(0, -thickness, 0) -- Bottom Left Of The Quad (Bottom) + glVertex(height, -thickness, 0) -- Bottom Right Of The Quad (Bottom) end) - glRotate(180,1,0,0) - glRotate(90,0,1,0) + glRotate(180, 1, 0, 0) + glRotate(90, 0, 1, 0) - glRotate(90,1,0,0) - glTranslate(0,3,0) + glRotate(90, 1, 0, 0) + glTranslate(0, 3, 0) - glRotate(180,1,0,0) + glRotate(180, 1, 0, 0) -- map name font:Begin() local text = Game.mapName - font:SetTextColor(1,1,1,(textOpacity*1.12)*opacityMultiplier) - font:Print(text, textOffsetX,-usedTextOffsetY,14,"n") - font:SetTextColor(0,0,0,textOpacity*0.12*opacityMultiplier) - font:Print(text, textOffsetX+0.5,-usedTextOffsetY-0.9,14,"n") + font:SetTextColor(1, 1, 1, (textOpacity * 1.12) * opacityMultiplier) + font:Print(text, textOffsetX, -usedTextOffsetY, 14, "n") + font:SetTextColor(0, 0, 0, textOpacity * 0.12 * opacityMultiplier) + font:Print(text, textOffsetX + 0.5, -usedTextOffsetY - 0.9, 14, "n") --map description - usedTextOffsetY = usedTextOffsetY+textOffsetY + usedTextOffsetY = usedTextOffsetY + textOffsetY text = Game.mapDescription - font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) - font:Print(text, textOffsetX,-usedTextOffsetY,textSize,"n") - + font:SetTextColor(1, 1, 1, textOpacity * 0.6 * opacityMultiplier) + font:Print(text, textOffsetX, -usedTextOffsetY, textSize, "n") - if mapinfo and mapinfo.author and mapinfo.author ~= '' then - usedTextOffsetY = usedTextOffsetY+textOffsetY + if mapinfo and mapinfo.author and mapinfo.author ~= "" then + usedTextOffsetY = usedTextOffsetY + textOffsetY text = Game.mapDescription - font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) - font:Print(Spring.I18N('ui.mapinfo.author')..': '..mapinfo.author, textOffsetX,-usedTextOffsetY+0.8,textSize,"n") + font:SetTextColor(1, 1, 1, textOpacity * 0.6 * opacityMultiplier) + font:Print(Spring.I18N("ui.mapinfo.author") .. ": " .. mapinfo.author, textOffsetX, -usedTextOffsetY + 0.8, textSize, "n") end --map size - usedTextOffsetY = usedTextOffsetY+textOffsetY + usedTextOffsetY = usedTextOffsetY + textOffsetY text = Game.mapDescription - font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) - font:Print(Game.mapX.. " x "..Game.mapY, textOffsetX,-usedTextOffsetY+0.8,textSize,"n") + font:SetTextColor(1, 1, 1, textOpacity * 0.6 * opacityMultiplier) + font:Print(Game.mapX .. " x " .. Game.mapY, textOffsetX, -usedTextOffsetY + 0.8, textSize, "n") font:End() glPopMatrix() - glTranslate(-offset, -mapInfoBoxHeight-offset, -Game.mapSizeZ) - glColor(1,1,1,1) - glScale(1,1,1) + glTranslate(-offset, -mapInfoBoxHeight - offset, -Game.mapSizeZ) + glColor(1, 1, 1, 1) + glScale(1, 1, 1) glDepthTest(false) end) end local function Init() - if (font:GetTextWidth(Game.mapDescription) * 12) > mapInfoWidth then --mapInfoWidth = (font:GetTextWidth(Game.mapDescription) * 12) + 33 end mapInfoBoxHeight = spGetGroundHeight(0, Game.mapSizeZ) -- find the lowest map height - for i=mathFloor(offset*scale), mathFloor((mapInfoWidth+offset)*scale) do + for i = mathFloor(offset * scale), mathFloor((mapInfoWidth + offset) * scale) do if spGetGroundHeight(i, Game.mapSizeZ) < mapInfoBoxHeight then mapInfoBoxHeight = spGetGroundHeight(i, Game.mapSizeZ) end @@ -192,7 +188,7 @@ function widget:GameFrame(gf) mapinfoList[opacity] = nil end end - widgetHandler:RemoveCallIn('GameFrame') + widgetHandler:RemoveCallIn("GameFrame") end end @@ -209,17 +205,19 @@ function widget:Shutdown() end function widget:DrawWorld() - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end - if spIsAABBInView(offset, mapInfoBoxHeight, Game.mapSizeZ, mapInfoWidth*scale, mapInfoBoxHeight+(thickness*scale), Game.mapSizeZ) then + if spIsAABBInView(offset, mapInfoBoxHeight, Game.mapSizeZ, mapInfoWidth * scale, mapInfoBoxHeight + (thickness * scale), Game.mapSizeZ) then local camX, camY, camZ = spGetCameraPosition() - local camDistance = math.diag(camX - (mapInfoWidth/2)*scale, camY - mapInfoBoxHeight, camZ - Game.mapSizeZ) - local opacityMultiplier = (1 - (camDistance-fadeStartHeight) / (fadeEndHeight-fadeStartHeight)) + local camDistance = math.diag(camX - (mapInfoWidth / 2) * scale, camY - mapInfoBoxHeight, camZ - Game.mapSizeZ) + local opacityMultiplier = (1 - (camDistance - fadeStartHeight) / (fadeEndHeight - fadeStartHeight)) if opacityMultiplier > 1 then opacityMultiplier = 1 end if opacityMultiplier > 0.05 then - opacityMultiplier = mathFloor(opacityMultiplier * dlistAmount)/dlistAmount + opacityMultiplier = mathFloor(opacityMultiplier * dlistAmount) / dlistAmount if mapinfoList[opacityMultiplier] == nil then createMapinfoList(opacityMultiplier) diff --git a/luaui/Widgets/gui_mapmarks_fx.lua b/luaui/Widgets/gui_mapmarks_fx.lua index 94fb59a00f6..ed4725b639b 100644 --- a/luaui/Widgets/gui_mapmarks_fx.lua +++ b/luaui/Widgets/gui_mapmarks_fx.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Mapmarks FX", - desc = "Adds glow/rings at map marks", - author = "Floris", - date = "7 june 2015", - license = "GNU GPL, v2 or later", - layer = 2, - enabled = true, - } + return { + name = "Mapmarks FX", + desc = "Adds glow/rings at map marks", + author = "Floris", + date = "7 june 2015", + license = "GNU GPL, v2 or later", + layer = 2, + enabled = true, + } end - -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry local spGetPlayerInfo = Spring.GetPlayerInfo @@ -41,7 +40,7 @@ local mapDrawNicknameTime = {} local mapEraseNicknameTime = {} local ownPlayerID = Spring.GetMyPlayerID() -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local commandCount = 0 local font, chobbyInterface @@ -57,51 +56,51 @@ local nickNames = {} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local nicknameOpacityMultiplier = 6 -- multiplier applied to the given color opacity of the type: 'map_draw' +local nicknameOpacityMultiplier = 6 -- multiplier applied to the given color opacity of the type: 'map_draw' -local generalSize = 28 -- overall size -local generalOpacity = 0.8 -- overall opacity -local generalDuration = 1.2 -- overall duration +local generalSize = 28 -- overall size +local generalOpacity = 0.8 -- overall opacity +local generalDuration = 1.2 -- overall duration -local ringStartSize = 9 -local ringScale = 0.75 +local ringStartSize = 9 +local ringScale = 0.75 -local imageDir = ":n:LuaUI/Images/mapmarksfx/" +local imageDir = ":n:LuaUI/Images/mapmarksfx/" local types = { map_mark = { - size = 3.2, - endSize = 2.25, - duration = 14, - glowColor = {1.00 ,1.00 ,1.00 ,0.20}, - ringColor = {1.00 ,1.00 ,1.00 ,0.75}, + size = 3.2, + endSize = 2.25, + duration = 14, + glowColor = { 1.00, 1.00, 1.00, 0.20 }, + ringColor = { 1.00, 1.00, 1.00, 0.75 }, -- Precalculated values sizeScaled = 0, endSizeScaled = 0, sizeDelta = 0, }, map_draw = { - size = 0.75, - endSize = 0.2, - duration = 2, - glowColor = {1.00 ,1.00 ,1.00 ,0.15}, - ringColor = {1.00 ,1.00 ,1.00 ,0.00}, + size = 0.75, + endSize = 0.2, + duration = 2, + glowColor = { 1.00, 1.00, 1.00, 0.15 }, + ringColor = { 1.00, 1.00, 1.00, 0.00 }, -- Precalculated values sizeScaled = 0, endSizeScaled = 0, sizeDelta = 0, }, map_erase = { - size = 3.5, - endSize = 0.7, - duration = 4, - glowColor = {1.00 ,1.00 ,1.00 ,0.10}, - ringColor = {1.00 ,1.00 ,1.00 ,0.00}, + size = 3.5, + endSize = 0.7, + duration = 4, + glowColor = { 1.00, 1.00, 1.00, 0.10 }, + ringColor = { 1.00, 1.00, 1.00, 0.00 }, -- Precalculated values sizeScaled = 0, endSizeScaled = 0, sizeDelta = 0, - } + }, } -- Precalculate scaled sizes and durations @@ -113,10 +112,10 @@ for _, typeData in pairs(types) do end -- Pre-cache texture paths (avoid string concat each frame) -local glowTexture = imageDir .. 'glow.dds' -local ringTexture = imageDir .. 'ring.dds' -local pencilTexture = imageDir .. 'pencil.dds' -local eraserTexture = imageDir .. 'eraser.dds' +local glowTexture = imageDir .. "glow.dds" +local ringTexture = imageDir .. "ring.dds" +local pencilTexture = imageDir .. "pencil.dds" +local eraserTexture = imageDir .. "eraser.dds" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -132,12 +131,12 @@ local function IsIgnoredPlayer(playerID) if accountID and ignoredAccounts[accountID] then return true end - if name and name ~= '' and ignoredAccounts[name] then + if name and name ~= "" and ignoredAccounts[name] then return true end local aliasName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID) - if aliasName and aliasName ~= '' and ignoredAccounts[aliasName] then + if aliasName and aliasName ~= "" and ignoredAccounts[aliasName] then return true end @@ -146,16 +145,19 @@ end local function DrawBatchedQuads(data, count) for j = 1, count, 8 do - local x, y, z, s = data[j], data[j+1], data[j+2], data[j+3] - glColor(data[j+4], data[j+5], data[j+6], data[j+7]) - glTexCoord(0, 0); glVertex(x - s, y, z - s) - glTexCoord(0, 1); glVertex(x - s, y, z + s) - glTexCoord(1, 1); glVertex(x + s, y, z + s) - glTexCoord(1, 0); glVertex(x + s, y, z - s) + local x, y, z, s = data[j], data[j + 1], data[j + 2], data[j + 3] + glColor(data[j + 4], data[j + 5], data[j + 6], data[j + 7]) + glTexCoord(0, 0) + glVertex(x - s, y, z - s) + glTexCoord(0, 1) + glVertex(x - s, y, z + s) + glTexCoord(1, 1) + glVertex(x + s, y, z + s) + glTexCoord(1, 0) + glVertex(x + s, y, z - s) end end - local function AddEffect(cmdType, x, y, z, timestamp, unitID, playerID) if not playerID then playerID = false @@ -167,34 +169,30 @@ local function AddEffect(cmdType, x, y, z, timestamp, unitID, playerID) commandCount = commandCount + 1 commands[commandCount] = { - cmdType = cmdType, - x = x, - y = y, - z = z, - osClock = timestamp, - playerID = playerID, - r = r, - g = g, - b = b, - spec = spec, - nickname = nickname + cmdType = cmdType, + x = x, + y = y, + z = z, + osClock = timestamp, + playerID = playerID, + r = r, + g = g, + b = b, + spec = spec, + nickname = nickname, } end - function widget:ViewResize() - vsx,vsy = spGetViewGeometry() - font = WG['fonts'].getFont(1, 1.5) + vsx, vsy = spGetViewGeometry() + font = WG["fonts"].getFont(1, 1.5) end - function widget:Initialize() widget:ViewResize() end - -function widget:Shutdown() -end +function widget:Shutdown() end function widget:MapDrawCmd(playerID, cmdType, x, y, z, a, b, c) if IsIgnoredPlayer(playerID) then @@ -202,21 +200,20 @@ function widget:MapDrawCmd(playerID, cmdType, x, y, z, a, b, c) end local currentTime = osClock() - if cmdType == 'point' then - AddEffect('map_mark', x, y, z, currentTime, false, playerID) - elseif cmdType == 'line' then + if cmdType == "point" then + AddEffect("map_mark", x, y, z, currentTime, false, playerID) + elseif cmdType == "line" then mapDrawNicknameTime[playerID] = currentTime - AddEffect('map_draw', x, y, z, currentTime, false, playerID) - elseif cmdType == 'erase' then + AddEffect("map_draw", x, y, z, currentTime, false, playerID) + elseif cmdType == "erase" then mapEraseNicknameTime[playerID] = currentTime - AddEffect('map_erase', x, y, z, currentTime, false, playerID) + AddEffect("map_erase", x, y, z, currentTime, false, playerID) end end - function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end @@ -226,10 +223,18 @@ function widget:ClearMapMarks() end function widget:DrawWorldPreUnit() - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end - if WG.clearmapmarks and WG.clearmapmarks.continuous then return end - if commandCount == 0 then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end + if WG.clearmapmarks and WG.clearmapmarks.continuous then + return + end + if commandCount == 0 then + return + end local currentTime = osClock() @@ -243,9 +248,7 @@ function widget:DrawWorldPreUnit() commandCount = commandCount - 1 else local totalDuration = types[cmd.cmdType].totalDuration - if currentTime - cmd.osClock > totalDuration - or (cmd.cmdType == 'map_draw' and mapDrawNicknameTime[cmd.playerID] ~= nil - and cmd.osClock < mapDrawNicknameTime[cmd.playerID]) then + if currentTime - cmd.osClock > totalDuration or (cmd.cmdType == "map_draw" and mapDrawNicknameTime[cmd.playerID] ~= nil and cmd.osClock < mapDrawNicknameTime[cmd.playerID]) then commands[i] = commands[commandCount] commands[commandCount] = nil commandCount = commandCount - 1 @@ -255,7 +258,9 @@ function widget:DrawWorldPreUnit() end end - if commandCount == 0 then return end + if commandCount == 0 then + return + end -- Phase 2: Build batch data local glowN = 0 @@ -284,10 +289,14 @@ function widget:DrawWorldPreUnit() if glowAlpha > 0 then local n = glowN local gs = size * 0.8 - glowBatch[n+1] = cmd.x; glowBatch[n+2] = cmd.y; glowBatch[n+3] = cmd.z - glowBatch[n+4] = gs - glowBatch[n+5] = cr; glowBatch[n+6] = cg; glowBatch[n+7] = cb - glowBatch[n+8] = a * glowAlpha + glowBatch[n + 1] = cmd.x + glowBatch[n + 2] = cmd.y + glowBatch[n + 3] = cmd.z + glowBatch[n + 4] = gs + glowBatch[n + 5] = cr + glowBatch[n + 6] = cg + glowBatch[n + 7] = cb + glowBatch[n + 8] = a * glowAlpha glowN = n + 8 end @@ -296,39 +305,52 @@ function widget:DrawWorldPreUnit() if ringAlpha > 0 then local n = ringN local rs = ringStartSize + (size * ringScale) * durationProcess - ringBatch[n+1] = cmd.x; ringBatch[n+2] = cmd.y; ringBatch[n+3] = cmd.z - ringBatch[n+4] = rs - ringBatch[n+5] = cr; ringBatch[n+6] = cg; ringBatch[n+7] = cb - ringBatch[n+8] = a * ringAlpha + ringBatch[n + 1] = cmd.x + ringBatch[n + 2] = cmd.y + ringBatch[n + 3] = cmd.z + ringBatch[n + 4] = rs + ringBatch[n + 5] = cr + ringBatch[n + 6] = cg + ringBatch[n + 7] = cb + ringBatch[n + 8] = a * ringAlpha ringN = n + 8 end -- Icons & Nicknames (spectator drawers only) if cmd.spec and cmd.playerID and cmd.playerID ~= ownPlayerID then local cmdType = cmd.cmdType - if cmdType == 'map_draw' or - (cmdType == 'map_erase' and cmd.osClock >= (mapEraseNicknameTime[cmd.playerID] or 0)) then + if cmdType == "map_draw" or (cmdType == "map_erase" and cmd.osClock >= (mapEraseNicknameTime[cmd.playerID] or 0)) then local iconAlpha = a * glowAlpha * nicknameOpacityMultiplier local is = 11 - if cmdType == 'map_draw' then + if cmdType == "map_draw" then local n = pencilN - pencilBatch[n+1] = cmd.x; pencilBatch[n+2] = cmd.y; pencilBatch[n+3] = cmd.z - pencilBatch[n+4] = is - pencilBatch[n+5] = cr; pencilBatch[n+6] = cg; pencilBatch[n+7] = cb - pencilBatch[n+8] = iconAlpha + pencilBatch[n + 1] = cmd.x + pencilBatch[n + 2] = cmd.y + pencilBatch[n + 3] = cmd.z + pencilBatch[n + 4] = is + pencilBatch[n + 5] = cr + pencilBatch[n + 6] = cg + pencilBatch[n + 7] = cb + pencilBatch[n + 8] = iconAlpha pencilN = n + 8 else local n = eraserN - eraserBatch[n+1] = cmd.x; eraserBatch[n+2] = cmd.y; eraserBatch[n+3] = cmd.z - eraserBatch[n+4] = is - eraserBatch[n+5] = cr; eraserBatch[n+6] = cg; eraserBatch[n+7] = cb - eraserBatch[n+8] = iconAlpha + eraserBatch[n + 1] = cmd.x + eraserBatch[n + 2] = cmd.y + eraserBatch[n + 3] = cmd.z + eraserBatch[n + 4] = is + eraserBatch[n + 5] = cr + eraserBatch[n + 6] = cg + eraserBatch[n + 7] = cb + eraserBatch[n + 8] = iconAlpha eraserN = n + 8 end nickN = nickN + 1 local nn = (nickN - 1) * 4 - nickBatch[nn+1] = cmd.x; nickBatch[nn+2] = cmd.y; nickBatch[nn+3] = cmd.z - nickBatch[nn+4] = iconAlpha + nickBatch[nn + 1] = cmd.x + nickBatch[nn + 2] = cmd.y + nickBatch[nn + 3] = cmd.z + nickBatch[nn + 4] = iconAlpha nickNames[nickN] = cmd.nickname end end @@ -367,8 +389,8 @@ function widget:DrawWorldPreUnit() for j = 1, nickN do local nn = (j - 1) * 4 glPushMatrix() - glTranslate(nickBatch[nn+1], nickBatch[nn+2], nickBatch[nn+3]) - glColor(1, 1, 1, nickBatch[nn+4]) + glTranslate(nickBatch[nn + 1], nickBatch[nn + 2], nickBatch[nn + 3]) + glColor(1, 1, 1, nickBatch[nn + 4]) glBillboard() font:Print(nickNames[j], 0, -28, 20, "cn") glPopMatrix() @@ -378,4 +400,3 @@ function widget:DrawWorldPreUnit() glColor(1, 1, 1, 1) end - diff --git a/luaui/Widgets/gui_messages.lua b/luaui/Widgets/gui_messages.lua index cd5e8b97e76..d8f828265b6 100644 --- a/luaui/Widgets/gui_messages.lua +++ b/luaui/Widgets/gui_messages.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Messages", - desc = "Typewrites messages at the center-bottom of the screen", - author = "Floris", - date = "September 2019", - license = "GNU GPL, v2 or later", - layer = 30000, - enabled = true + name = "Messages", + desc = "Typewrites messages at the center-bottom of the screen", + author = "Floris", + date = "September 2019", + license = "GNU GPL, v2 or later", + layer = 30000, + enabled = true, } end - -- Localized functions for performance local mathMax = math.max @@ -27,20 +26,20 @@ local mathMax = math.max local vsx, vsy = gl.GetViewSizes() local posY = 0.16 -local charSize = 19.5 - (3.5 * ((vsx/vsy) - 1.78)) +local charSize = 19.5 - (3.5 * ((vsx / vsy) - 1.78)) local charDelay = 0.022 local maxLines = 4 local lineTTL = 15 -local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale",1) or 1) -local widgetScale = (((vsx+vsy) / 2000) * 0.55) * (0.95+(ui_scale-1)/1.5) +local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) +local widgetScale = (((vsx + vsy) / 2000) * 0.55) * (0.95 + (ui_scale - 1) / 1.5) -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glDeleteList = gl.DeleteList -local glCreateList = gl.CreateList -local glCallList = gl.CallList -local glTranslate = gl.Translate +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glDeleteList = gl.DeleteList +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glTranslate = gl.Translate local messageLines = {} local currentLine = 0 @@ -53,22 +52,22 @@ local hideSpecChat = tonumber(Spring.GetConfigInt("HideSpecChat", 0) or 0) == 1 local string_lines = string.lines function widget:ViewResize() - vsx,vsy = Spring.GetViewGeometry() + vsx, vsy = Spring.GetViewGeometry() lineMaxWidth = lineMaxWidth / widgetScale - widgetScale = (((vsx+vsy) / 2000) * 0.55) * (0.95+(ui_scale-1)/1.5) + widgetScale = (((vsx + vsy) / 2000) * 0.55) * (0.95 + (ui_scale - 1) / 1.5) lineMaxWidth = lineMaxWidth * widgetScale - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() - if WG['buildmenu'] then - buildmenuBottomPosition = WG['buildmenu'].getBottomPosition() + if WG["buildmenu"] then + buildmenuBottomPosition = WG["buildmenu"].getBottomPosition() end posY = 0.16 if buildmenuBottomPosition then posY = 0.21 - if WG['ordermenu'] then - local oposX, oposY, owidth, oheight = WG['ordermenu'].getPosition() + if WG["ordermenu"] then + local oposX, oposY, owidth, oheight = WG["ordermenu"].getPosition() if oposY > 0.5 then posY = 0.16 end @@ -83,8 +82,10 @@ function widget:ViewResize() end local area = { - (vsx * 0.31)-(charSize*widgetScale), (vsy * posY)+(charSize*0.15*widgetScale), - (vsx * 0.6), (vsy * (posY+0.065)) + (vsx * 0.31) - (charSize * widgetScale), + (vsy * posY) + (charSize * 0.15 * widgetScale), + (vsx * 0.6), + (vsy * (posY + 0.065)), } lineMaxWidth = mathMax(lineMaxWidth, area[3] - area[1]) end @@ -94,8 +95,8 @@ local function addMessage(text) -- determine text typing start time local startTime = os.clock() if messageLines[#messageLines] then - if startTime < messageLines[#messageLines].starttime + messageLines[#messageLines].textlen*charDelay then - startTime = messageLines[#messageLines].starttime + messageLines[#messageLines].textlen*charDelay + if startTime < messageLines[#messageLines].starttime + messageLines[#messageLines].textlen * charDelay then + startTime = messageLines[#messageLines].starttime + messageLines[#messageLines].textlen * charDelay else currentTypewriterLine = currentTypewriterLine + 1 end @@ -112,24 +113,24 @@ local function addMessage(text) for _, line in ipairs(textLines) do local words = {} local wordsCount = 0 - local linebuffer = '' + local linebuffer = "" for w in line:gmatch("%S+") do wordsCount = wordsCount + 1 words[wordsCount] = w end for _, word in ipairs(words) do - if font:GetTextWidth(linebuffer..' '..word)*charSize*widgetScale > lineMaxWidth then + if font:GetTextWidth(linebuffer .. " " .. word) * charSize * widgetScale > lineMaxWidth then wordwrappedTextCount = wordwrappedTextCount + 1 wordwrappedText[wordwrappedTextCount] = linebuffer - linebuffer = '' + linebuffer = "" end - if linebuffer == '' then + if linebuffer == "" then linebuffer = word else - linebuffer = linebuffer..' '..word + linebuffer = linebuffer .. " " .. word end end - if linebuffer ~= '' then + if linebuffer ~= "" then wordwrappedTextCount = wordwrappedTextCount + 1 wordwrappedText[wordwrappedTextCount] = linebuffer end @@ -137,19 +138,19 @@ local function addMessage(text) local messageLinesCount = #messageLines for _, line in ipairs(wordwrappedText) do - lineMaxWidth = mathMax(lineMaxWidth, font:GetTextWidth(line)*charSize*widgetScale) + lineMaxWidth = mathMax(lineMaxWidth, font:GetTextWidth(line) * charSize * widgetScale) messageLinesCount = messageLinesCount + 1 messageLines[messageLinesCount] = { starttime = startTime, text = line, textlen = string.len(line), - charstyped = 0, -- num typed chars - timepassed = 0, -- time passed during typing chars (used to calc 'num typed chars') + charstyped = 0, -- num typed chars + timepassed = 0, -- time passed during typing chars (used to calc 'num typed chars') displaylist = glCreateList(function() end), - charsindisplaylist = 0, -- num chars the displaylist contains + charsindisplaylist = 0, -- num chars the displaylist contains pos = 1, } - startTime = startTime + (string.len(line)*charDelay) + startTime = startTime + (string.len(line) * charDelay) end if currentTypewriterLine > messageLinesCount then @@ -161,8 +162,8 @@ end function widget:Initialize() widget:ViewResize() - WG['messages'] = {} - WG['messages'].addMessage = function(text) + WG["messages"] = {} + WG["messages"].addMessage = function(text) addMessage(text) end end @@ -180,9 +181,9 @@ function widget:Update(dt) if hideSpecChat ~= tonumber(Spring.GetConfigInt("HideSpecChat", 0) or 0) == 1 then hideSpecChat = tonumber(Spring.GetConfigInt("HideSpecChat", 0) or 0) == 1 end - if WG['buildmenu'] and WG['buildmenu'].getBottomPosition then + if WG["buildmenu"] and WG["buildmenu"].getBottomPosition then local prevbuildmenuBottomPos = buildmenuBottomPos - buildmenuBottomPos = WG['buildmenu'].getBottomPosition() + buildmenuBottomPos = WG["buildmenu"].getBottomPosition() if buildmenuBottomPos ~= prevbuildmenuBottomPos then widget:ViewResize() end @@ -195,7 +196,7 @@ function widget:Update(dt) -- continue typewriting line if messageLines[currentTypewriterLine].charstyped <= messageLines[currentTypewriterLine].textlen then messageLines[currentTypewriterLine].timepassed = messageLines[currentTypewriterLine].timepassed + dt - messageLines[currentTypewriterLine].charstyped = math.ceil(messageLines[currentTypewriterLine].timepassed/charDelay) + messageLines[currentTypewriterLine].charstyped = math.ceil(messageLines[currentTypewriterLine].timepassed / charDelay) -- typewrite next line when complete if messageLines[currentTypewriterLine].charstyped >= messageLines[currentTypewriterLine].textlen then @@ -209,24 +210,26 @@ function widget:Update(dt) end local function processLine(i) - if messageLines[i].displaylist == nil or messageLines[i].charstyped ~= messageLines[i].charsindisplaylist or messageLines[i].pos ~= (currentLine+1)-i then - messageLines[i].pos = (currentLine+1)-i + if messageLines[i].displaylist == nil or messageLines[i].charstyped ~= messageLines[i].charsindisplaylist or messageLines[i].pos ~= (currentLine + 1) - i then + messageLines[i].pos = (currentLine + 1) - i messageLines[i].charsindisplaylist = messageLines[i].charstyped local text = string.sub(messageLines[i].text, 1, messageLines[i].charstyped) - lineMaxWidth = mathMax(lineMaxWidth, font:GetTextWidth(text)*charSize*widgetScale) + lineMaxWidth = mathMax(lineMaxWidth, font:GetTextWidth(text) * charSize * widgetScale) glDeleteList(messageLines[i].displaylist) messageLines[i].displaylist = glCreateList(function() font:Begin() - font:SetTextColor(0.94,0.94,0.94,1) - font:SetOutlineColor(0,0,0,1) - font:Print(text, 0, 0, charSize*widgetScale, "o") + font:SetTextColor(0.94, 0.94, 0.94, 1) + font:SetOutlineColor(0, 0, 0, 1) + font:Print(text, 0, 0, charSize * widgetScale, "o") font:End() end) end end function widget:DrawScreen() - if not messageLines[1] then return end + if not messageLines[1] then + return + end if messageLines[currentLine] then glPushMatrix() @@ -234,7 +237,7 @@ function widget:DrawScreen() local displayedLines = 0 local i = currentLine while i > 0 do - glTranslate(0, (charSize*1.15*widgetScale), 0) + glTranslate(0, (charSize * 1.15 * widgetScale), 0) if os.clock() - messageLines[i].starttime < lineTTL then processLine(i) glCallList(messageLines[i].displaylist) @@ -250,7 +253,7 @@ function widget:DrawScreen() end function widget:Shutdown() - WG['messages'] = nil + WG["messages"] = nil for i, _ in ipairs(messageLines) do if messageLines[i].displaylist then glDeleteList(messageLines[i].displaylist) @@ -260,7 +263,7 @@ function widget:Shutdown() end function widget:TextCommand(command) - if string.sub(command,1, 11) == "addmessage " then + if string.sub(command, 1, 11) == "addmessage " then addMessage(string.sub(command, 11)) end end @@ -269,7 +272,7 @@ function widget:GetConfigData(data) for i, _ in ipairs(messageLines) do messageLines[i].displaylist = nil end - return {messageLines = messageLines} + return { messageLines = messageLines } end function widget:SetConfigData(data) diff --git a/luaui/Widgets/gui_metalspots.lua b/luaui/Widgets/gui_metalspots.lua index c41d7ef95c5..a4fe79cb224 100644 --- a/luaui/Widgets/gui_metalspots.lua +++ b/luaui/Widgets/gui_metalspots.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Metalspots", - desc = "Displays rotating circles around metal spots", - author = "Floris, Beherith GL4", - date = "October 2019", - license = "GNU GPL v2", - layer = 2, + name = "Metalspots", + desc = "Displays rotating circles around metal spots", + author = "Floris, Beherith GL4", + date = "October 2019", + license = "GNU GPL v2", + layer = 2, enabled = true, } end @@ -40,8 +40,8 @@ local spGetSpectatingState = Spring.GetSpectatingState -- 1. Could a prerendered texture be better at conveying metal spot value? -- 2. VertexVBO contains: x, y pos, rotdir and radians in angle? -- 3. InstanceVBO contains: - --x,y,z offsets, radius, - -- visibility, and gameframe num of the last change teamid of occupier? +--x,y,z offsets, radius, +-- visibility, and gameframe num of the last change teamid of occupier? -- 4. the way the updates are handled are far from ideal, the construction and destruction of any mex will trigger a full update -- 2023.05.12 -- Add atlas text to all this @@ -55,29 +55,29 @@ if Spring.GetModOptions().unit_restrictions_noextractorDefs then return end -local needsInit = true -local showValue = false -local metalViewOnly = false -local lavaWaterLevel = nil +local needsInit = true +local showValue = false +local metalViewOnly = false +local lavaWaterLevel = nil -local circleSpaceUsage = 0.62 -local circleInnerOffset = 0.28 -local opacity = 0.5 +local circleSpaceUsage = 0.62 +local circleInnerOffset = 0.28 +local opacity = 0.5 -local innersize = 1.8 -- outersize-innersize = circle width -local outersize = 1.98 -- outersize-innersize = circle width -local billboardsize = 0.38 -- actual fontsize +local innersize = 1.8 -- outersize-innersize = circle width +local outersize = 1.98 -- outersize-innersize = circle width +local billboardsize = 0.38 -- actual fontsize -local maxValue = 15 -- ignore spots above this metal value (probably metalmap) -local maxScale = 4 -- ignore spots above this scale (probably metalmap) +local maxValue = 15 -- ignore spots above this metal value (probably metalmap) +local maxScale = 4 -- ignore spots above this scale (probably metalmap) local extractorRadius = Game.extractorRadius * 1.2 local spGetUnitsInSphere = Spring.GetUnitsInSphere local spGetUnitDefID = Spring.GetUnitDefID local spGetGroundHeight = Spring.GetGroundHeight -local spGetMapDrawMode = Spring.GetMapDrawMode -local spIsUnitAllied = Spring.IsUnitAllied +local spGetMapDrawMode = Spring.GetMapDrawMode +local spIsUnitAllied = Spring.IsUnitAllied local spIsGUIHidden = Spring.IsGUIHidden local mySpots = {} -- {spotKey = {x = spot.x, y= spGetGroundHeight(spot.x, spot.z), z = spot.z, value = value, scale = scale, occupied = occupied, t = currentClock, ally = false, enemy = false, instanceID = "1024_1023"}} @@ -90,13 +90,13 @@ local myAllyTeamID = Spring.GetMyAllyTeamID() local incomeMultiplier = select(7, Spring.GetTeamInfo(spGetMyTeamID(), false)) local fontfile = "fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf") -local vsx,vsy = Spring.GetViewGeometry() -local fontfileScale = 1 -- fixed scale: billboard size is resolution-independent (world-space) +local vsx, vsy = Spring.GetViewGeometry() +local fontfileScale = 1 -- fixed scale: billboard size is resolution-independent (world-space) local fontfileSize = 110 local fontfileOutlineSize = 12 local fontfileOutlineStrength = 20 --spEcho("Loading Font",fontfile,fontfileSize*fontfileScale,fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) -local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local font = gl.LoadFont(fontfile, fontfileSize * fontfileScale, fontfileOutlineSize * fontfileScale, fontfileOutlineStrength) local chobbyInterface @@ -116,8 +116,8 @@ local spotShader = nil local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local pushElementInstance = InstanceVBOTable.pushElementInstance -local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO +local pushElementInstance = InstanceVBOTable.pushElementInstance +local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO local getElementInstanceData = InstanceVBOTable.getElementInstanceData local shaderConfig = {} @@ -125,20 +125,20 @@ local vsSrcPath = "LuaUI/Shaders/metalspots_gl4.vert.glsl" local fsSrcPath = "LuaUI/Shaders/metalspots_gl4.frag.glsl" local shaderSourceCache = { - vssrcpath = vsSrcPath, - fssrcpath = fsSrcPath, - shaderName = "Metalspots GL4", - uniformInt = { - heightMap = 0, - textAtlas = 1, - }, - uniformFloat = { - visibilitycontrols = {0,0,0,0}, - drawPass = 0, - waterLevel = 0, - }, - shaderConfig = shaderConfig, - } + vssrcpath = vsSrcPath, + fssrcpath = fsSrcPath, + shaderName = "Metalspots GL4", + uniformInt = { + heightMap = 0, + textAtlas = 1, + }, + uniformFloat = { + visibilitycontrols = { 0, 0, 0, 0 }, + drawPass = 0, + waterLevel = 0, + }, + shaderConfig = shaderConfig, +} local MetalSpotTextAtlas local AtlasTextureID @@ -146,104 +146,191 @@ local MakeAtlasOnDemand = VFS.Include("LuaUI/Include/AtlasOnDemand.lua") local valueToUVs = {} -- key value string to uvCoords object from atlas in xXyYwh array local function goodbye(reason) - spEcho("Metalspots GL4 widget exiting with reason: "..reason) + spEcho("Metalspots GL4 widget exiting with reason: " .. reason) widgetHandler:RemoveWidget() end local function makeSpotVBO() - spotVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if spotVBO == nil then goodbye("Failed to create spotVBO") end - local VBOLayout = { {id = 0, name = "localpos_dir_angle", size = 4},} + spotVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if spotVBO == nil then + goodbye("Failed to create spotVBO") + end + local VBOLayout = { { id = 0, name = "localpos_dir_angle", size = 4 } } local VBOData = {} local n = 0 - local detailPartWidth, a1,a2,a3,a4 + local detailPartWidth, a1, a2, a3, a4 local width = circleSpaceUsage local pieces = 8 local detail = 6 local radstep = (2.0 * math.pi) / pieces - for _,dir in ipairs({-1,1}) do + for _, dir in ipairs({ -1, 1 }) do for i = 1, pieces do -- pieces for d = 1, detail do -- detail - detailPartWidth = ((width / detail) * d) + (dir+1) - a1 = ((i+detailPartWidth - (width / detail)) * radstep) - a2 = ((i+detailPartWidth) * radstep) - a3 = ((i+circleInnerOffset+detailPartWidth - (width / detail)) * radstep) - a4 = ((i+circleInnerOffset+detailPartWidth) * radstep) - - n=n+1; VBOData[n] = mathSin(a3)*innersize - n=n+1; VBOData[n] = mathCos(a3)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + detailPartWidth = ((width / detail) * d) + (dir + 1) + a1 = ((i + detailPartWidth - (width / detail)) * radstep) + a2 = ((i + detailPartWidth) * radstep) + a3 = ((i + circleInnerOffset + detailPartWidth - (width / detail)) * radstep) + a4 = ((i + circleInnerOffset + detailPartWidth) * radstep) + + n = n + 1 + VBOData[n] = mathSin(a3) * innersize + n = n + 1 + VBOData[n] = mathCos(a3) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 if dir == -1 then - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 else - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 end if dir == 1 then - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 - n=n+1; VBOData[n] = mathSin(a2)*outersize - n=n+1; VBOData[n] = mathCos(a2)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a2) * outersize + n = n + 1 + VBOData[n] = mathCos(a2) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 else - n=n+1; VBOData[n] = mathSin(a2)*outersize - n=n+1; VBOData[n] = mathCos(a2)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 - n=n+1; VBOData[n] = mathSin(a1)*outersize - n=n+1; VBOData[n] = mathCos(a1)*outersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a2) * outersize + n = n + 1 + VBOData[n] = mathCos(a2) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a1) * outersize + n = n + 1 + VBOData[n] = mathCos(a1) * outersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 end - n=n+1; VBOData[n] = mathSin(a4)*innersize - n=n+1; VBOData[n] = mathCos(a4)*innersize - n=n+1; VBOData[n] = dir - n=n+1; VBOData[n] = 0 + n = n + 1 + VBOData[n] = mathSin(a4) * innersize + n = n + 1 + VBOData[n] = mathCos(a4) * innersize + n = n + 1 + VBOData[n] = dir + n = n + 1 + VBOData[n] = 0 end end end -- Add the 2 tris for the billboard: - n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = 0; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - n=n+1; VBOData[n] = -billboardsize; n=n+1; VBOData[n] = 0; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - n=n+1; VBOData[n] = -billboardsize; n=n+1; VBOData[n] = billboardsize; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - n=n+1; VBOData[n] = -billboardsize; n=n+1; VBOData[n] = 0; n=n+1; VBOData[n] = 1; n=n+1; VBOData[n] = 2 - - spotVBO:Define(n/4, VBOLayout) + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + n = n + 1 + VBOData[n] = -billboardsize + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + n = n + 1 + VBOData[n] = -billboardsize + n = n + 1 + VBOData[n] = billboardsize + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + n = n + 1 + VBOData[n] = -billboardsize + n = n + 1 + VBOData[n] = 0 + n = n + 1 + VBOData[n] = 1 + n = n + 1 + VBOData[n] = 2 + + spotVBO:Define(n / 4, VBOLayout) spotVBO:Upload(VBOData) - return spotVBO, n/4 + return spotVBO, n / 4 end local function initGL4() spotShader = LuaShader.CheckShaderUpdates(shaderSourceCache) - if not spotShader then goodbye("Failed to compile spotShader GL4 ") return false end - local spotVBO,numVertices = makeSpotVBO() + if not spotShader then + goodbye("Failed to compile spotShader GL4 ") + return false + end + local spotVBO, numVertices = makeSpotVBO() local spotInstanceVBOLayout = { - {id = 1, name = 'worldpos_radius', size = 4}, - {id = 2, name = 'visibility', size = 4}, - {id = 3, name = 'uvcoords', size = 4}, + { id = 1, name = "worldpos_radius", size = 4 }, + { id = 2, name = "visibility", size = 4 }, + { id = 3, name = "uvcoords", size = 4 }, } spotInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(spotInstanceVBOLayout, 8, "spotInstanceVBO") spotInstanceVBO.numVertices = numVertices @@ -253,7 +340,7 @@ local function initGL4() return true end -local function spotKey(posx,posz) +local function spotKey(posx, posz) return posx * 65536 + posz end @@ -265,7 +352,7 @@ local function IsSpotOccupied(spot) local prevOccupied = spot.occupied local ally = false local enemy = false - for j=1, #units do + for j = 1, #units do if extractorDefs[spGetUnitDefID(units[j])] then -- Actually check if we the ones are extracting from this spot? occupied = true @@ -287,7 +374,7 @@ end local function checkMetalspots() local gf = spGetGameFrame() - for i=1, #mySpots do + for i = 1, #mySpots do local spot = mySpots[i] local ally, enemy, changed = IsSpotOccupied(spot) local occupied = ally or enemy @@ -308,13 +395,12 @@ local function valueToText(value) end local function CalcSpotScale(spot) - return 0.77 + ((mathMax(spot.maxX,spot.minX)-(mathMin(spot.maxX,spot.minX))) * (mathMax(spot.maxZ,spot.minZ)-(mathMin(spot.maxZ,spot.minZ)))) / 10000 + return 0.77 + ((mathMax(spot.maxX, spot.minX) - (mathMin(spot.maxX, spot.minX))) * (mathMax(spot.maxZ, spot.minZ) - (mathMin(spot.maxZ, spot.minZ)))) / 10000 end - local function InitializeAtlas(mSpots) - local multipliers = {[1] = true} -- all unique multipliers - for i,teamID in ipairs(Spring.GetTeamList()) do + local multipliers = { [1] = true } -- all unique multipliers + for i, teamID in ipairs(Spring.GetTeamList()) do local incomeMultiplier = select(7, Spring.GetTeamInfo(teamID, false)) if multipliers[incomeMultiplier] == nil then multipliers[incomeMultiplier] = teamID @@ -344,24 +430,23 @@ local function InitializeAtlas(mSpots) -- Whats the size of one of these? I would say width 128, height 64 local textheight = 96 - textheight = mathCeil(fontfileSize*fontfileScale + fontfileOutlineSize*fontfileScale * 0.5) + textheight = mathCeil(fontfileSize * fontfileScale + fontfileOutlineSize * fontfileScale * 0.5) --spEcho(textheight) - local textwidth = 2 * textheight + local textwidth = 2 * textheight -- attempt to make a square-ish, power of two-ish atlas: local cellcount = mathMax(1, mathCeil(math.sqrt(numvalues))) - MetalSpotTextAtlas = MakeAtlasOnDemand({sizex = textwidth * cellcount, sizey = textheight*cellcount, xresolution = textwidth, yresolution = textheight, name = "MetalSpotAtlas", defaultfont = {font = font, options = 'o'}}) + MetalSpotTextAtlas = MakeAtlasOnDemand({ sizex = textwidth * cellcount, sizey = textheight * cellcount, xresolution = textwidth, yresolution = textheight, name = "MetalSpotAtlas", defaultfont = { font = font, options = "o" } }) AtlasTextureID = MetalSpotTextAtlas.textureID for uniqueValue, value in pairs(uniquevalues) do local uvcoords = MetalSpotTextAtlas:AddText(value) valueToUVs[uniqueValue] = uvcoords end - end local function InitializeSpots(mSpots) local spotsCount = 0 - for i=1, #mSpots do + for i = 1, #mSpots do local spot = mSpots[i] local value = valueToText(spot.worth * incomeMultiplier) @@ -371,7 +456,7 @@ local function InitializeSpots(mSpots) -- Create a New myspot! local instanceID = spotKey(spot.x, spot.z) - local mySpot = {x = spot.x, y= spGetGroundHeight(spot.x, spot.z), z = spot.z, value = value, scale = scale, occupied = false, ally = false, enemy = false, instanceID = instanceID, worth = spot.worth} + local mySpot = { x = spot.x, y = spGetGroundHeight(spot.x, spot.z), z = spot.z, value = value, scale = scale, occupied = false, ally = false, enemy = false, instanceID = instanceID, worth = spot.worth } spotsCount = spotsCount + 1 mySpots[spotsCount] = mySpot @@ -382,14 +467,13 @@ local function InitializeSpots(mSpots) local uvcoords = valueToUVs[value] if uvcoords then local gh = Spring.GetGroundHeight(spot.x, spot.z) - pushElementInstance(spotInstanceVBO, -- vbo - {spot.x, gh, spot.z, scale, - (occupied and 0) or 1, -1000,uvcoords.w,uvcoords.h, - uvcoords.x,uvcoords.X,uvcoords.y,uvcoords.Y}, -- instanceData + pushElementInstance( + spotInstanceVBO, -- vbo + { spot.x, gh, spot.z, scale, (occupied and 0) or 1, -1000, uvcoords.w, uvcoords.h, uvcoords.x, uvcoords.X, uvcoords.y, uvcoords.Y }, -- instanceData instanceID, -- instanceID true, -- updateExisting true -- noUpload - ) + ) end end end @@ -410,10 +494,9 @@ local function UpdateSpotValues() -- This will only get called on playerchanged local occupied = ally or enemy local uvcoords = valueToUVs[spot.value] if uvcoords then - pushElementInstance(spotInstanceVBO, -- vbo - {spot.x, spot.y, spot.z, spot.scale, - (occupied and 0) or 1, -1000,uvcoords.w,uvcoords.h, - uvcoords.x,uvcoords.X,uvcoords.y,uvcoords.Y}, -- instanceData + pushElementInstance( + spotInstanceVBO, -- vbo + { spot.x, spot.y, spot.z, spot.scale, (occupied and 0) or 1, -1000, uvcoords.w, uvcoords.h, uvcoords.x, uvcoords.X, uvcoords.y, uvcoords.Y }, -- instanceData spot.instanceID, -- instanceID true, -- updateExisting true -- noUpload @@ -424,17 +507,16 @@ local function UpdateSpotValues() -- This will only get called on playerchanged InstanceVBOTable.uploadAllElements(spotInstanceVBO) end - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() return end - if not WG['resource_spot_finder'].metalSpotsList then + if not WG["resource_spot_finder"].metalSpotsList then spEcho(" This widget requires the 'Metalspot Finder' widget to run.") widgetHandler:RemoveWidget() end - if WG['resource_spot_finder'].isMetalMap then + if WG["resource_spot_finder"].isMetalMap then -- no need for this widget on metal maps widgetHandler:RemoveWidget() end @@ -459,10 +541,14 @@ function widget:Initialize() return metalViewOnly end - if not initGL4() then return end + if not initGL4() then + return + end - local mSpots = WG['resource_spot_finder'].metalSpotsList - if not mSpots then return end + local mSpots = WG["resource_spot_finder"].metalSpotsList + if not mSpots then + return + end InitializeAtlas(mSpots) InitializeSpots(mSpots) @@ -474,24 +560,30 @@ end function widget:DrawGenesis() MetalSpotTextAtlas:RenderTasks() -- cause the atlas is done once per initialize only - widget.widgetHandler.RemoveCallIn(widget.widget,"DrawGenesis") + widget.widgetHandler.RemoveCallIn(widget.widget, "DrawGenesis") end --[[ function widget:DrawScreen() MetalSpotTextAtlas:DrawToScreen() end -]]-- - +]] +-- function widget:Shutdown() - if MetalSpotTextAtlas then MetalSpotTextAtlas:Delete() end + if MetalSpotTextAtlas then + MetalSpotTextAtlas:Delete() + end if spotShader then spotShader:Finalize() spotShader = nil end if spotInstanceVBO then - if spotInstanceVBO.VAO then spotInstanceVBO.VAO:Delete() end - if spotInstanceVBO.instanceVBO then spotInstanceVBO.instanceVBO:Delete() end + if spotInstanceVBO.VAO then + spotInstanceVBO.VAO:Delete() + end + if spotInstanceVBO.instanceVBO then + spotInstanceVBO.instanceVBO:Delete() + end spotInstanceVBO = nil end if spotVBO then @@ -504,8 +596,8 @@ function widget:Shutdown() end function widget:RecvLuaMsg(msg, playerID) - if stringFind(msg, 'LobbyOverlayActive', 1, true) == 1 then - chobbyInterface = (stringFind(msg, 'LobbyOverlayActive1', 1, true) == 1) + if stringFind(msg, "LobbyOverlayActive", 1, true) == 1 then + chobbyInterface = (stringFind(msg, "LobbyOverlayActive1", 1, true) == 1) end end @@ -532,7 +624,7 @@ end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) -- THIS IS RETARDED TOO if extractorDefs[unitDefID] then - sceduledCheckedSpotsFrame = spGetGameFrame() + 3 -- delay needed, i don't know why + sceduledCheckedSpotsFrame = spGetGameFrame() + 3 -- delay needed, i don't know why end end @@ -560,9 +652,15 @@ end -- Draw above-water metalspots before units (old method, no ghost occlusion) function widget:DrawWorldPreUnit() local mapDrawMode = spGetMapDrawMode() - if metalViewOnly and mapDrawMode ~= 'metal' then return end - if chobbyInterface then return end - if spIsGUIHidden() then return end + if metalViewOnly and mapDrawMode ~= "metal" then + return + end + if chobbyInterface then + return + end + if spIsGUIHidden() then + return + end gl.Culling(true) gl.Texture(0, "$heightmap") @@ -585,9 +683,15 @@ end -- Draw underwater metalspots after water (not distorted by water shader) function widget:DrawWorld() local mapDrawMode = spGetMapDrawMode() - if metalViewOnly and mapDrawMode ~= 'metal' then return end - if chobbyInterface then return end - if spIsGUIHidden() then return end + if metalViewOnly and mapDrawMode ~= "metal" then + return + end + if chobbyInterface then + return + end + if spIsGUIHidden() then + return + end gl.Culling(true) gl.Texture(0, "$heightmap") @@ -619,7 +723,7 @@ function widget:GetConfigData(data) return { showValue = showValue, opacity = opacity, - metalViewOnly = metalViewOnly + metalViewOnly = metalViewOnly, } end @@ -635,7 +739,6 @@ function widget:SetConfigData(data) end end - ----------------------------------------------------------------------------------------------- -- The following is a test script.txt for multiple different resource bonuses: --[[ @@ -749,4 +852,5 @@ end myplayername = Player; nohelperais = 0; } -]]-- +]] +-- diff --git a/luaui/Widgets/gui_minimap.lua b/luaui/Widgets/gui_minimap.lua index e7435778736..45d1e6d466f 100644 --- a/luaui/Widgets/gui_minimap.lua +++ b/luaui/Widgets/gui_minimap.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathMin = math.min @@ -24,7 +23,6 @@ local minimapToWorld = VFS.Include("luaui/Include/minimap_utils.lua").minimapToW local getCurrentMiniMapRotationOption = VFS.Include("luaui/Include/minimap_utils.lua").getCurrentMiniMapRotationOption local ROTATION = VFS.Include("luaui/Include/minimap_utils.lua").ROTATION - local maxAllowedWidth = 0.25 local maxAllowedHeight = Spring.GetConfigFloat("MinimapMaxHeight", 0.32) local leftClickMove = Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1 @@ -65,7 +63,7 @@ local baseMinimapIconScale = Spring.GetConfigFloat("MinimapIconScale", 3.5) local lastAppliedIconScale = nil local function checkGuishader(force) - dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, 'minimap', function() + dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, "minimap", function() RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner) end, force) end @@ -76,7 +74,7 @@ local function clear() gl.DeleteTexture(uiBgTex) uiBgTex = nil end - WG.FlowUI.guishaderDeleteDlist('minimap') + WG.FlowUI.guishaderDeleteDlist("minimap") dlistGuishader = nil end @@ -100,9 +98,9 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element elementMargin = WG.FlowUI.elementMargin - if WG['topbar'] ~= nil then - local topbarArea = WG['topbar'].GetPosition() - maxAllowedWidth = (topbarArea[1] - (elementMargin*6)) / vsx + if WG["topbar"] ~= nil then + local topbarArea = WG["topbar"].GetPosition() + maxAllowedWidth = (topbarArea[1] - (elementMargin * 6)) / vsx end maxWidth = mathMin(maxAllowedHeight * ratio, maxAllowedWidth * (vsx / vsy)) @@ -115,7 +113,7 @@ function widget:ViewResize() usedWidth = mathFloor(maxWidth * vsy) usedHeight = mathFloor(maxHeight * vsy) - backgroundRect = { 0, vsy - (usedHeight) - elementPadding, usedWidth + elementPadding, vsy } + backgroundRect = { 0, vsy - usedHeight - elementPadding, usedWidth + elementPadding, vsy } if not dualscreenMode then Spring.SendCommands(string.format("minimap geometry %i %i %i %i", 0, 0, usedWidth, usedHeight)) @@ -139,26 +137,26 @@ function widget:Initialize() end _, _, _, _, minimized, maximized = Spring.GetMiniMapGeometry() - WG['minimap'] = {} - WG['minimap'].getHeight = function() + WG["minimap"] = {} + WG["minimap"].getHeight = function() return usedHeight + elementPadding end - WG['minimap'].getMaxHeight = function() + WG["minimap"].getMaxHeight = function() return mathFloor(maxAllowedHeight * vsy), maxAllowedHeight end - WG['minimap'].setMaxHeight = function(value) + WG["minimap"].setMaxHeight = function(value) Spring.SetConfigFloat("MinimapMaxHeight", value) maxAllowedHeight = value widget:ViewResize() end - WG['minimap'].getLeftClickMove = function() + WG["minimap"].getLeftClickMove = function() return leftClickMove end - WG['minimap'].setLeftClickMove = function(value) + WG["minimap"].setLeftClickMove = function(value) leftClickMove = value Spring.SetConfigInt("MinimapLeftClickMove", value and 1 or 0) end - WG['minimap'].setBaseIconScale = function(value) + WG["minimap"].setBaseIconScale = function(value) baseMinimapIconScale = value end end @@ -201,7 +199,9 @@ function widget:Update(dt) end sec2 = sec2 + dt - if sec2 <= 0.25 then return end + if sec2 <= 0.25 then + return + end sec2 = 0 -- Poll ConfigFloat for external changes (e.g. from gui_options) @@ -211,7 +211,9 @@ function widget:Update(dt) widget:ViewResize() end - if dualscreenMode then return end + if dualscreenMode then + return + end _, _, _, _, minimized, maximized = Spring.GetMiniMapGeometry() if minimized or maximized then @@ -235,8 +237,6 @@ function widget:Update(dt) end end - - local function drawBackground() UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], 0, 0, 1, 0, nil, nil, nil, nil, nil, nil, nil, nil) end @@ -244,7 +244,6 @@ end local st = spGetCameraState() local stframe = 0 function widget:DrawScreen() - if dualscreenMode and not minimized then gl.DrawMiniMap() return @@ -256,7 +255,7 @@ function widget:DrawScreen() local x, y = Spring.GetMouseState() if math_isInRect(x, y, backgroundRect[1], backgroundRect[2] - elementPadding, backgroundRect[3] + elementPadding, backgroundRect[4]) then if not math_isInRect(x, y, backgroundRect[1], backgroundRect[2] + 1, backgroundRect[3] - 1, backgroundRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") end end end @@ -267,12 +266,11 @@ function widget:DrawScreen() end if st.name == "ov" then -- overview camera - if dlistGuishader and WG['guishader'] then - WG['guishader'].RemoveDlist('minimap') + if dlistGuishader and WG["guishader"] then + WG["guishader"].RemoveDlist("minimap") dlistGuishader = gl.DeleteList(dlistGuishader) end wasOverview = true - elseif not (minimized or maximized) or (wasOverview and Spring.GetConfigInt("MinimapMinimize", 0) == 0) then if wasOverview and Spring.GetConfigInt("MinimapMinimize", 0) == 0 then gl.SlaveMiniMap(true) @@ -280,12 +278,11 @@ function widget:DrawScreen() Spring.SendCommands("minimap minimize 0") end - - if dlistGuishader and WG['guishader'] then - WG['guishader'].InsertDlist(dlistGuishader, 'minimap') + if dlistGuishader and WG["guishader"] then + WG["guishader"].InsertDlist(dlistGuishader, "minimap") end - if not uiBgTex and backgroundRect[3]-backgroundRect[1] >= 1 and backgroundRect[4]-backgroundRect[2] >= 1 then - uiBgTex = gl.CreateTexture(mathFloor(backgroundRect[3]-backgroundRect[1]), mathFloor(backgroundRect[4]-backgroundRect[2]), { + if not uiBgTex and backgroundRect[3] - backgroundRect[1] >= 1 and backgroundRect[4] - backgroundRect[2] >= 1 then + uiBgTex = gl.CreateTexture(mathFloor(backgroundRect[3] - backgroundRect[1]), mathFloor(backgroundRect[4] - backgroundRect[2]), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -331,14 +328,19 @@ function widget:MouseMove(x, y) end function widget:MousePress(x, y, button) - if Spring.IsGUIHidden() then return end - if dualscreenMode then return end - if minimized then return end + if Spring.IsGUIHidden() then + return + end + if dualscreenMode then + return + end + if minimized then + return + end leftclicked = false if math_isInRect(x, y, backgroundRect[1], backgroundRect[2] - elementPadding, backgroundRect[3] + elementPadding, backgroundRect[4]) then - local activeCmd = spGetActiveCommand() if activeCmd and activeCmd ~= 0 then return false @@ -358,7 +360,9 @@ function widget:MousePress(x, y, button) end function widget:MouseRelease(x, y, button) - if dualscreenMode then return end + if dualscreenMode then + return + end leftclicked = false end diff --git a/luaui/Widgets/gui_mission_info.lua b/luaui/Widgets/gui_mission_info.lua index 6f3297bb517..f30b13e54f6 100644 --- a/luaui/Widgets/gui_mission_info.lua +++ b/luaui/Widgets/gui_mission_info.lua @@ -9,12 +9,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Mission Info", - desc = "Shows the scenario mission briefing, objectives, and details.", - author = "Floirs", - date = "May 2026", + name = "Mission Info", + desc = "Shows the scenario mission briefing, objectives, and details.", + author = "Floirs", + date = "May 2026", license = "GNU GPL, v2 or later", - layer = -99990, + layer = -99990, enabled = true, } end @@ -25,38 +25,38 @@ local mathMax = math.max -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local spGetGameSpeed = Spring.GetGameSpeed +local spGetGameSpeed = Spring.GetGameSpeed local vsx, vsy = spGetViewGeometry() -local show = true -- shown by default on first open -local showOnceMore = false -- used for guishader delay -local wePaused = false -- tracks if we issued the pause -local justClosedFromPress = false -- prevents toggleWindow re-opening after mouseEvent close +local show = true -- shown by default on first open +local showOnceMore = false -- used for guishader delay +local wePaused = false -- tracks if we issued the pause +local justClosedFromPress = false -- prevents toggleWindow re-opening after mouseEvent close local screenHeightOrg = 520 -local screenWidthOrg = 1050 +local screenWidthOrg = 1050 local screenHeight = screenHeightOrg -local screenWidth = screenWidthOrg -local startLine = 1 +local screenWidth = screenWidthOrg +local startLine = 1 -local customScale = 1 -local centerPosX = 0.5 -local centerPosY = 0.5 +local customScale = 1 +local centerPosX = 0.5 +local centerPosY = 0.5 local screenX = (vsx * centerPosX) - (screenWidth / 2) local screenY = (vsy * centerPosY) + (screenHeight / 2) local math_isInRect = math.isInRect local glCreateList = gl.CreateList -local glCallList = gl.CallList +local glCallList = gl.CallList local glDeleteList = gl.DeleteList local widgetScale = 1 -local textLines = {} +local textLines = {} local totalTextLines = 0 -local maxLines = 20 +local maxLines = 20 local font, font2, loadedFontSize, titleRect, backgroundGuishader, textList, dlistcreated @@ -68,22 +68,32 @@ local scenarioData = nil local function getScenarioid() local raw = _modOpts.scenariooptions - if not raw then return nil end + if not raw then + return nil + end local ok, decoded = pcall(string.base64Decode, raw) - if not ok or not decoded then return nil end + if not ok or not decoded then + return nil + end local ok2, opts = pcall(Json.decode, decoded) - if not ok2 or type(opts) ~= 'table' then return nil end + if not ok2 or type(opts) ~= "table" then + return nil + end return opts.scenarioid end local function findScenarioData(targetid) - if not targetid then return nil end + if not targetid then + return nil + end local files = VFS.DirList("singleplayer/scenarios/", "*.lua") - if not files then return nil end + if not files then + return nil + end for _, fpath in ipairs(files) do if not string.find(fpath, "scenarioscripts") then local ok, data = pcall(VFS.Include, fpath) - if ok and type(data) == 'table' and data.scenarioid == targetid then + if ok and type(data) == "table" and data.scenarioid == targetid then return data end end @@ -107,12 +117,12 @@ local function buildTextLines(data) end -- Scenario title as the main heading - addTitle(data.title or Spring.I18N('ui.missioninfo.title')) + addTitle(data.title or Spring.I18N("ui.missioninfo.title")) addLine("") -- Difficulty if data.defaultdifficulty then - local diffStr = Spring.I18N('ui.missioninfo.difficulty') .. ": " .. data.defaultdifficulty + local diffStr = Spring.I18N("ui.missioninfo.difficulty") .. ": " .. data.defaultdifficulty if data.difficulty then diffStr = diffStr .. " (" .. data.difficulty .. "/10)" end @@ -123,20 +133,20 @@ local function buildTextLines(data) -- Objectives if data.victorycondition or data.losscondition then - addHeader(Spring.I18N('ui.missioninfo.objectives')) + addHeader(Spring.I18N("ui.missioninfo.objectives")) addLine("") if data.victorycondition then - addLine(Spring.I18N('ui.missioninfo.victory') .. ": " .. data.victorycondition) + addLine(Spring.I18N("ui.missioninfo.victory") .. ": " .. data.victorycondition) end if data.losscondition then - addLine(Spring.I18N('ui.missioninfo.defeat') .. ": " .. data.losscondition) + addLine(Spring.I18N("ui.missioninfo.defeat") .. ": " .. data.losscondition) end addLine("") end -- Summary if data.summary and data.summary ~= "" then - addHeader(Spring.I18N('ui.missioninfo.summary')) + addHeader(Spring.I18N("ui.missioninfo.summary")) addLine("") for _, l in ipairs(string.lines(data.summary)) do addLine(l) @@ -146,7 +156,7 @@ local function buildTextLines(data) -- Briefing if data.briefing and data.briefing ~= "" then - addHeader(Spring.I18N('ui.missioninfo.briefing')) + addHeader(Spring.I18N("ui.missioninfo.briefing")) addLine("") for _, l in ipairs(string.lines(data.briefing)) do addLine(l) @@ -164,24 +174,26 @@ function widget:ViewResize() widgetScale = widgetScale * (1 - (0.11 * ((vsx / vsy) - 1.78))) screenHeight = mathFloor(screenHeightOrg * widgetScale) - screenWidth = mathFloor(screenWidthOrg * widgetScale) - screenX = mathFloor((vsx * centerPosX) - (screenWidth / 2)) + screenWidth = mathFloor(screenWidthOrg * widgetScale) + screenX = mathFloor((vsx * centerPosX) - (screenWidth / 2)) screenY = mathFloor((vsy * centerPosY) + (screenHeight / 2)) - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner - RectRound = WG.FlowUI.Draw.RectRound - UiElement = WG.FlowUI.Draw.Element + RectRound = WG.FlowUI.Draw.RectRound + UiElement = WG.FlowUI.Draw.Element UiScroller = WG.FlowUI.Draw.Scroller - if textList then gl.DeleteList(textList) end + if textList then + gl.DeleteList(textList) + end textList = gl.CreateList(DrawWindow) -- Layout changed: invalidate the guishader DList so it gets rebuilt next draw - if backgroundGuishader ~= nil and WG['guishader'] then - WG['guishader'].DeleteDlist('missiontext') + if backgroundGuishader ~= nil and WG["guishader"] then + WG["guishader"].DeleteDlist("missiontext") backgroundGuishader = nil end end @@ -189,36 +201,29 @@ end -- ─── Drawing ───────────────────────────────────────────────────────────────── function DrawTextarea(x, y, width, height, scrollbar) - local scrollbarOffsetTop = 0 + local scrollbarOffsetTop = 0 local scrollbarOffsetBottom = 0 - local scrollbarMargin = 10 * widgetScale - local scrollbarWidth = 8 * widgetScale - local scrollbarPosWidth = 4 * widgetScale + local scrollbarMargin = 10 * widgetScale + local scrollbarWidth = 8 * widgetScale + local scrollbarPosWidth = 4 * widgetScale local fontSizeTitle = 18 * widgetScale - local fontSizeLine = 16 * widgetScale - local lineSeparator = 2 * widgetScale + local fontSizeLine = 16 * widgetScale + local lineSeparator = 2 * widgetScale - local fontColorTitle = { 1, 1, 1, 1 } - local fontColorHeader = { 0.9, 0.78, 0.45, 1 } - local fontColorLine = { 0.8, 0.77, 0.74, 1 } + local fontColorTitle = { 1, 1, 1, 1 } + local fontColorHeader = { 0.9, 0.78, 0.45, 1 } + local fontColorLine = { 0.8, 0.77, 0.74, 1 } maxLines = mathFloor(height / (lineSeparator + fontSizeTitle)) -- scrollbar if scrollbar then if totalTextLines > maxLines or startLine > 1 then - local scrollbarTop = y - scrollbarOffsetTop - scrollbarMargin - (scrollbarWidth - scrollbarPosWidth) + local scrollbarTop = y - scrollbarOffsetTop - scrollbarMargin - (scrollbarWidth - scrollbarPosWidth) local scrollbarBottom = y - scrollbarOffsetBottom - height + scrollbarMargin + (scrollbarWidth - scrollbarPosWidth) - UiScroller( - mathFloor(x + width - scrollbarMargin - scrollbarWidth), - mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), - mathFloor(x + width - scrollbarMargin), - mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), - (#textLines) * (lineSeparator + fontSizeTitle), - (startLine - 1) * (lineSeparator + fontSizeTitle) - ) + UiScroller(mathFloor(x + width - scrollbarMargin - scrollbarWidth), mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), mathFloor(x + width - scrollbarMargin), mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), #textLines * (lineSeparator + fontSizeTitle), (startLine - 1) * (lineSeparator + fontSizeTitle)) end end @@ -228,8 +233,12 @@ function DrawTextarea(x, y, width, height, scrollbar) local lineKey = startLine local j = 1 while j < maxLines + 1 do - if (lineSeparator + fontSizeTitle) * j > height then break end - if textLines[lineKey] == nil then break end + if (lineSeparator + fontSizeTitle) * j > height then + break + end + if textLines[lineKey] == nil then + break + end local entry = textLines[lineKey] local kind = entry.kind @@ -245,7 +254,9 @@ function DrawTextarea(x, y, width, height, scrollbar) -- body: word-wrapped font:SetTextColor(fontColorLine) local wrappedText, numLines = font:WrapText(text, (width - (50 * widgetScale)) * (loadedFontSize / fontSizeLine)) - if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end + if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then + break + end font:Print(wrappedText, x, y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") j = j + (numLines - 1) end @@ -262,7 +273,7 @@ function DrawWindow() UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) -- title tab - local title = Spring.I18N('ui.topbar.button.mission') + local title = Spring.I18N("ui.topbar.button.mission") local titleFontSize = 18 * widgetScale titleRect = { screenX, @@ -282,13 +293,7 @@ function DrawWindow() font2:End() -- content area - DrawTextarea( - screenX + mathFloor(28 * widgetScale), - screenY - mathFloor(14 * widgetScale), - screenWidth - mathFloor(28 * widgetScale), - screenHeight - mathFloor(28 * widgetScale), - 1 - ) + DrawTextarea(screenX + mathFloor(28 * widgetScale), screenY - mathFloor(14 * widgetScale), screenWidth - mathFloor(28 * widgetScale), screenHeight - mathFloor(28 * widgetScale), 1) end function widget:DrawScreen() @@ -301,24 +306,22 @@ function widget:DrawScreen() glCallList(textList) - if WG['guishader'] and backgroundGuishader == nil then + if WG["guishader"] and backgroundGuishader == nil then backgroundGuishader = glCreateList(function() RectRound(screenX, screenY - screenHeight, screenX + screenWidth, screenY, elementCorner, 0, 1, 1, 1) RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) end) dlistcreated = true - WG['guishader'].InsertDlist(backgroundGuishader, 'missiontext') + WG["guishader"].InsertDlist(backgroundGuishader, "missiontext") end showOnceMore = false local x, y = Spring.GetMouseState() - if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) - or (titleRect and math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4])) then - Spring.SetMouseCursor('cursornormal') + if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) or (titleRect and math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4])) then + Spring.SetMouseCursor("cursornormal") end - - elseif dlistcreated and WG['guishader'] then - WG['guishader'].DeleteDlist('missiontext') + elseif dlistcreated and WG["guishader"] then + WG["guishader"].DeleteDlist("missiontext") backgroundGuishader = nil dlistcreated = nil end @@ -344,7 +347,7 @@ local function unpauseGame() end function widget:KeyPress(key) - if key == 27 then -- ESC + if key == 27 then -- ESC if show then showOnceMore = show show = false @@ -360,9 +363,13 @@ function widget:MouseWheel(up, value) if startLine >= totalTextLines - maxLines then startLine = totalTextLines - maxLines + 1 end - if startLine < 1 then startLine = 1 end + if startLine < 1 then + startLine = 1 + end - if textList then glDeleteList(textList) end + if textList then + glDeleteList(textList) + end textList = gl.CreateList(DrawWindow) return true end @@ -378,7 +385,9 @@ function widget:MouseRelease(x, y, button) end function mouseEvent(x, y, button, release) - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end if show then -- Inside main panel: consume the click if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) then @@ -409,22 +418,22 @@ function widget:Initialize() else -- Fallback: show what we can from the scenarioid alone textLines = { - { kind = "title", text = Spring.I18N('ui.missioninfo.title') }, - { kind = "body", text = "" }, - { kind = "body", text = "Mission ID: " .. (scenarioid or "unknown") }, - { kind = "body", text = "" }, - { kind = "body", text = "No additional briefing data found." }, + { kind = "title", text = Spring.I18N("ui.missioninfo.title") }, + { kind = "body", text = "" }, + { kind = "body", text = "Mission ID: " .. (scenarioid or "unknown") }, + { kind = "body", text = "" }, + { kind = "body", text = "No additional briefing data found." }, } end totalTextLines = #textLines - WG['missioninfo'] = {} - WG['missioninfo'].toggle = function(state) + WG["missioninfo"] = {} + WG["missioninfo"].toggle = function(state) local wasVisible = show if state ~= nil then show = state - justClosedFromPress = false -- explicit state set clears the flag + justClosedFromPress = false -- explicit state set clears the flag else show = not show end @@ -434,11 +443,13 @@ function widget:Initialize() unpauseGame() end if show then - if textList then glDeleteList(textList) end + if textList then + glDeleteList(textList) + end textList = gl.CreateList(DrawWindow) end end - WG['missioninfo'].isvisible = function() + WG["missioninfo"].isvisible = function() -- Report true while justClosedFromPress so toggleWindow treats us as -- "was open" and doesn't immediately re-open after our mouseEvent close. return show or justClosedFromPress @@ -464,10 +475,10 @@ function widget:Shutdown() glDeleteList(textList) textList = nil end - if WG['guishader'] then - WG['guishader'].DeleteDlist('missiontext') + if WG["guishader"] then + WG["guishader"].DeleteDlist("missiontext") end - WG['missioninfo'] = nil + WG["missioninfo"] = nil end function widget:LanguageChanged() diff --git a/luaui/Widgets/gui_mouse_fx.lua b/luaui/Widgets/gui_mouse_fx.lua index 54311221f94..b42e4cf1d40 100644 --- a/luaui/Widgets/gui_mouse_fx.lua +++ b/luaui/Widgets/gui_mouse_fx.lua @@ -1,70 +1,70 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Mouse FX", - desc = "Adds glow effect at mouse clicks", - author = "Floris", - date = "13 may 2015", - license = "GNU GPL, v2 or later", - layer = 2, - enabled = true, - } + return { + name = "Mouse FX", + desc = "Adds glow effect at mouse clicks", + author = "Floris", + date = "13 may 2015", + license = "GNU GPL, v2 or later", + layer = 2, + enabled = true, + } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local scaleWithCamera = true -local showMouseclicks = true +local scaleWithCamera = true +local showMouseclicks = true -local generalSize = 45 -- overall size -local generalOpacity = 0.7 -- overall opacity -local generalDuration = 0.66 -- overall duration +local generalSize = 45 -- overall size +local generalOpacity = 0.7 -- overall opacity +local generalDuration = 0.66 -- overall duration -local imageDir = ":n:LuaUI/Images/" +local imageDir = ":n:LuaUI/Images/" local chobbyInterface local types = { leftclick = { - size = 0.82, - endSize = 0.25, - duration = 0.85, - baseColor = {0.66 ,1 ,0.15 ,0.5} + size = 0.82, + endSize = 0.25, + duration = 0.85, + baseColor = { 0.66, 1, 0.15, 0.5 }, }, rightclick = { - size = 0.82, - endSize = 0.25, - duration = 0.85, - baseColor = {1.00 ,0.85 ,0.15 ,0.55} + size = 0.82, + endSize = 0.25, + duration = 0.85, + baseColor = { 1.00, 0.85, 0.15, 0.55 }, }, leftclick2 = { - size = 1.33, - endSize = 0.82, - duration = 1.65, - baseColor = {0.7 ,1 ,0.15 ,0.18} + size = 1.33, + endSize = 0.82, + duration = 1.65, + baseColor = { 0.7, 1, 0.15, 0.18 }, }, rightclick2 = { - size = 1.33, - endSize = 0.82, - duration = 1.65, - baseColor = {1.00 ,0.85 ,0.15 ,0.20} - } + size = 1.33, + endSize = 0.82, + duration = 1.65, + baseColor = { 1.00, 0.85, 0.15, 0.20 }, + }, } -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spGetCameraPosition = Spring.GetCameraPosition -local spTraceScreenRay = Spring.TraceScreenRay -local spGetMouseState = Spring.GetMouseState +local spGetCameraPosition = Spring.GetCameraPosition +local spTraceScreenRay = Spring.TraceScreenRay +local spGetMouseState = Spring.GetMouseState -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glCallList = gl.CallList +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList -local diag = math.diag +local diag = math.diag local commands = {} local commandCount = 0 @@ -74,31 +74,28 @@ local baseDlist -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -local function DrawGroundquad(x,y,z,size) - gl.TexCoord(0,0) - gl.Vertex(x-size,y,z-size) - gl.TexCoord(0,1) - gl.Vertex(x-size,y,z+size) - gl.TexCoord(1,1) - gl.Vertex(x+size,y,z+size) - gl.TexCoord(1,0) - gl.Vertex(x+size,y,z-size) +local function DrawGroundquad(x, y, z, size) + gl.TexCoord(0, 0) + gl.Vertex(x - size, y, z - size) + gl.TexCoord(0, 1) + gl.Vertex(x - size, y, z + size) + gl.TexCoord(1, 1) + gl.Vertex(x + size, y, z + size) + gl.TexCoord(1, 0) + gl.Vertex(x + size, y, z - size) end - local function AddCommandSpotter(cmdType, x, y, z, osClock) commandCount = commandCount + 1 commands[commandCount] = { - cmdType = cmdType, - x = x, - y = y, - z = z, - osClock = osClock + cmdType = cmdType, + x = x, + y = y, + z = z, + osClock = osClock, } end - ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ @@ -107,62 +104,62 @@ end ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------ - function widget:Initialize() baseDlist = glCreateList(function() - gl.Texture(imageDir..'glow.dds') - gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(imageDir .. "glow.dds") + gl.BeginEnd(GL.QUADS, DrawGroundquad, 0, 0, 0, 1) gl.Texture(false) end) end - function widget:Shutdown() glDeleteList(baseDlist) end - function widget:MousePress(x, y, button) if button == 1 then mouseButton = button end local _, tracedScreenRay = spTraceScreenRay(x, y, true) - if button == 3 and tracedScreenRay and tracedScreenRay[3] then - AddCommandSpotter('rightclick', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) - AddCommandSpotter('rightclick2', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + if button == 3 and tracedScreenRay and tracedScreenRay[3] then + AddCommandSpotter("rightclick", tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + AddCommandSpotter("rightclick2", tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) end end - function mouseRelease(x, y, button) if showMouseclicks then local _, tracedScreenRay = spTraceScreenRay(x, y, true) - if button == 1 and tracedScreenRay and tracedScreenRay[3] then - AddCommandSpotter('leftclick', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) - AddCommandSpotter('leftclick2', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + if button == 1 and tracedScreenRay and tracedScreenRay[3] then + AddCommandSpotter("leftclick", tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + AddCommandSpotter("leftclick2", tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) end end end function widget:Update() if mouseButton then - local x,y,m1,m2,m3 = spGetMouseState() + local x, y, m1, m2, m3 = spGetMouseState() if not m1 and not m3 then - mouseRelease(x,y, mouseButton) + mouseRelease(x, y, mouseButton) mouseButton = false end end end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorldPreUnit() - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end local osClock = os.clock() local camX, camY, camZ = spGetCameraPosition() @@ -171,24 +168,23 @@ function widget:DrawWorldPreUnit() gl.PushMatrix() for cmdKey, cmdValue in pairs(commands) do - - local duration = types[cmdValue.cmdType].duration * generalDuration + local duration = types[cmdValue.cmdType].duration * generalDuration local durationProcess = (osClock - cmdValue.osClock) / duration -- remove when duration has passed - if osClock - cmdValue.osClock > duration then + if osClock - cmdValue.osClock > duration then commands[cmdKey] = nil -- draw all - elseif types[cmdValue.cmdType].baseColor[4] > 0 then - local size = generalSize * types[cmdValue.cmdType].size + ((generalSize * types[cmdValue.cmdType].endSize - generalSize * types[cmdValue.cmdType].size) * durationProcess) + elseif types[cmdValue.cmdType].baseColor[4] > 0 then + local size = generalSize * types[cmdValue.cmdType].size + ((generalSize * types[cmdValue.cmdType].endSize - generalSize * types[cmdValue.cmdType].size) * durationProcess) local a = (1 - durationProcess) * generalOpacity local baseColor = types[cmdValue.cmdType].baseColor a = a * baseColor[4] gl.Translate(cmdValue.x, cmdValue.y, cmdValue.z) - local camDistance = diag(camX-cmdValue.x, camY-cmdValue.y, camZ-cmdValue.z) + local camDistance = diag(camX - cmdValue.x, camY - cmdValue.y, camZ - cmdValue.z) if camDistance ~= camDistance or camDistance >= math.huge then camDistance = 10000 end @@ -197,18 +193,18 @@ function widget:DrawWorldPreUnit() local scale = 1 if scaleWithCamera and camZ then scale = 0.82 + camDistance / 20000 - gl.Scale(scale,scale,scale) + gl.Scale(scale, scale, scale) end -- base glow if baseColor[4] > 0 then - gl.Color(baseColor[1],baseColor[2],baseColor[3],a) - gl.Scale(size,1,size) + gl.Color(baseColor[1], baseColor[2], baseColor[3], a) + gl.Scale(size, 1, size) glCallList(baseDlist) - gl.Scale(1/size,1,1/size) + gl.Scale(1 / size, 1, 1 / size) end if scaleWithCamera and camZ then - gl.Scale(1/scale,1/scale,1/scale) + gl.Scale(1 / scale, 1 / scale, 1 / scale) end gl.Translate(-cmdValue.x, -cmdValue.y, -cmdValue.z) end @@ -216,4 +212,3 @@ function widget:DrawWorldPreUnit() gl.PopMatrix() end - diff --git a/luaui/Widgets/gui_options.lua b/luaui/Widgets/gui_options.lua index f27a8a4ff81..67ffe9f5a21 100644 --- a/luaui/Widgets/gui_options.lua +++ b/luaui/Widgets/gui_options.lua @@ -18,17 +18,17 @@ Spring.SendCommands("resbar 0") -- Add new options at: function init local types = { - basic = 1, + basic = 1, advanced = 2, - dev = 3, + dev = 3, } -local version = 1.5 -- used to toggle previously default enabled/disabled widgets to the newer default in widget:initialize() -local newerVersion = false -- configdata will set this true if it's a newer version +local version = 1.5 -- used to toggle previously default enabled/disabled widgets to the newer default in widget:initialize() +local newerVersion = false -- configdata will set this true if it's a newer version local keyLayouts = VFS.Include("luaui/configs/keyboard_layouts.lua") -local languageCodes = { 'en', 'fr', 'ru', 'es' } +local languageCodes = { "en", "fr", "ru", "es" } languageCodes = table.merge(languageCodes, table.invert(languageCodes)) local languageNames = {} @@ -36,7 +36,7 @@ for key, code in ipairs(languageCodes) do languageNames[key] = Spring.I18N.languages[code] end -local devLanguageCodes = { 'en', 'fr', 'de', 'ru', 'zh', 'es', 'test_unicode', } +local devLanguageCodes = { "en", "fr", "de", "ru", "zh", "es", "test_unicode" } devLanguageCodes = table.merge(devLanguageCodes, table.invert(devLanguageCodes)) local devLanguageNames = {} @@ -71,7 +71,7 @@ elseif Platform.glHaveAMD then -- gpuMemorySize is 0 for AMD so we can't use VRAM size if not (string.find(glRendererLower, "rx") or string.find(glRendererLower, "r9 ")) then isPotatoGpu = true - gpuMem = 0 -- AMD integrated can report incorrect gpuMemorySize, so set to 0 to avoid false positives for low VRAM + gpuMem = 0 -- AMD integrated can report incorrect gpuMemorySize, so set to 0 to avoid false positives for low VRAM end else -- Unknown/Mesa vendor without specific detection — assume low-end @@ -88,25 +88,25 @@ local pauseGameWhenSingleplayer = true local cameraTransitionTime = 0.18 local cameraPanTransitionTime = 0.03 -local optionColor = '\255\255\255\255' -local widgetOptionColor = '\255\160\160\160' -local advOptionColor = '\255\180\160\140' -local advMainOptionColor = '\255\255\235\200' -local devOptionColor = '\255\200\110\100' -local devMainOptionColor = '\255\245\166\140' +local optionColor = "\255\255\255\255" +local widgetOptionColor = "\255\160\160\160" +local advOptionColor = "\255\180\160\140" +local advMainOptionColor = "\255\255\235\200" +local devOptionColor = "\255\200\110\100" +local devMainOptionColor = "\255\245\166\140" local firstlaunchsetupDone = false local playSounds = true local sounds = { - buttonClick = 'LuaUI/Sounds/tock.wav', - paginatorClick = 'LuaUI/Sounds/buildbar_waypoint.wav', - sliderDrag = 'LuaUI/Sounds/buildbar_rem.wav', - selectClick = 'LuaUI/Sounds/buildbar_click.wav', - selectUnfoldClick = 'LuaUI/Sounds/buildbar_hover.wav', - selectHoverClick = 'LuaUI/Sounds/hover.wav', - toggleOnClick = 'LuaUI/Sounds/switchon.wav', - toggleOffClick = 'LuaUI/Sounds/switchoff.wav', + buttonClick = "LuaUI/Sounds/tock.wav", + paginatorClick = "LuaUI/Sounds/buildbar_waypoint.wav", + sliderDrag = "LuaUI/Sounds/buildbar_rem.wav", + selectClick = "LuaUI/Sounds/buildbar_click.wav", + selectUnfoldClick = "LuaUI/Sounds/buildbar_hover.wav", + selectHoverClick = "LuaUI/Sounds/hover.wav", + toggleOnClick = "LuaUI/Sounds/switchon.wav", + toggleOffClick = "LuaUI/Sounds/switchoff.wav", } local continuouslyClean = Spring.GetConfigInt("ContinuouslyClearMapmarks", 0) == 1 @@ -218,7 +218,7 @@ local optionButtons = {} local optionHover = {} local optionSelect = {} local windowRect = { 0, 0, 0, 0 } -local showOnceMore = false -- used because of GUI shader delay +local showOnceMore = false -- used because of GUI shader delay local resettedTonemapDefault = false local heightmapChangeClock local requireRestartDefaults = {} @@ -226,33 +226,33 @@ local gameOver = false local presets = {} local reclaimFieldHighlightOptions = { - Spring.I18N('ui.settings.option.reclaimfieldhighlight_always'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_resource'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_reclaimer'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_resbot'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_order'), - Spring.I18N('ui.settings.option.reclaimfieldhighlight_disabled') + Spring.I18N("ui.settings.option.reclaimfieldhighlight_always"), + Spring.I18N("ui.settings.option.reclaimfieldhighlight_resource"), + Spring.I18N("ui.settings.option.reclaimfieldhighlight_reclaimer"), + Spring.I18N("ui.settings.option.reclaimfieldhighlight_resbot"), + Spring.I18N("ui.settings.option.reclaimfieldhighlight_order"), + Spring.I18N("ui.settings.option.reclaimfieldhighlight_disabled"), } local spectatorHUDConfigOptions = { - Spring.I18N('ui.settings.option.spectator_hud_config_basic'), - Spring.I18N('ui.settings.option.spectator_hud_config_advanced'), - Spring.I18N('ui.settings.option.spectator_hud_config_expert'), - Spring.I18N('ui.settings.option.spectator_hud_config_custom'), + Spring.I18N("ui.settings.option.spectator_hud_config_basic"), + Spring.I18N("ui.settings.option.spectator_hud_config_advanced"), + Spring.I18N("ui.settings.option.spectator_hud_config_expert"), + Spring.I18N("ui.settings.option.spectator_hud_config_custom"), } local startScript = VFS.LoadFile("_script.txt") -local rwsBuffer = nil -- reassembly buffer for restart-with-state chunks (save path) -local rwsRestoreData = nil -- serialised state to send to gadget after restart (restore path) -local RWS_MSG_CHUNK = 4000 +local rwsBuffer = nil -- reassembly buffer for restart-with-state chunks (save path) +local rwsRestoreData = nil -- serialised state to send to gadget after restart (restore path) +local RWS_MSG_CHUNK = 4000 if not startScript then - local modoptions = '' + local modoptions = "" for key, value in pairs(Spring.GetModOptionsCopy()) do local v = value - if type(v) == 'boolean' then - v = (v and '1' or '0') + if type(v) == "boolean" then + v = (v and "1" or "0") end - modoptions = modoptions .. key .. '=' .. v .. ';'; + modoptions = modoptions .. key .. "=" .. v .. ";" end startScript = [[[game] @@ -294,7 +294,7 @@ if not startScript then mapname=]] .. Game.mapName .. [[; myplayername=]] .. select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) .. [[; ishost=1; - gametype=]] .. Game.gameName .. ' ' .. Game.gameVersion .. [[; + gametype=]] .. Game.gameName .. " " .. Game.gameVersion .. [[; nohelperais=0; } ]] @@ -320,10 +320,7 @@ end setEngineFont() local function showOption(option) - if not option.category - or option.category == types.basic - or (advSettings and option.category == types.advanced) - or (devMode or devUI) then + if not option.category or option.category == types.basic or (advSettings and option.category == types.advanced) or (devMode or devUI) then return true end return false @@ -331,10 +328,10 @@ end local function adjustShadowQuality() local quality = Spring.GetConfigInt("ShadowQuality", 3) - local shadowMapSize = 600 + math.min(10240, (vsy+vsx)*0.37)*(quality*0.5) - Spring.SetConfigInt("Shadows", (quality==0 and 0 or 1)) + local shadowMapSize = 600 + math.min(10240, (vsy + vsx) * 0.37) * (quality * 0.5) + Spring.SetConfigInt("Shadows", (quality == 0 and 0 or 1)) Spring.SetConfigInt("ShadowMapSize", shadowMapSize) - Spring.SendCommands("shadows "..(quality==0 and 0 or 1).." " .. shadowMapSize) + Spring.SendCommands("shadows " .. (quality == 0 and 0 or 1) .. " " .. shadowMapSize) end function widget:ViewResize() @@ -361,9 +358,9 @@ function widget:ViewResize() UiSelector = WG.FlowUI.Draw.Selector UiSelectHighlight = WG.FlowUI.Draw.SelectHighlight - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) - font3 = WG['fonts'].getFont(2, 1.6) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) + font3 = WG["fonts"].getFont(2, 1.6) local newFontfileScale = (0.5 + (vsx * vsy / 5700000)) if fontfileScale ~= newFontfileScale then @@ -394,29 +391,28 @@ local function detectWater() end end - -local utf8 = VFS.Include('common/luaUtilities/utf8.lua') +local utf8 = VFS.Include("common/luaUtilities/utf8.lua") --local textInputDlist, consoleCmdDlist, textCursorRect local updateTextInputDlist = true local showTextInput = true -local inputText = '' +local inputText = "" local inputTextPosition = 0 local cursorBlinkTimer = 0 local cursorBlinkDuration = 1 -local maxTextInputChars = 127 -- tested 127 as being the true max +local maxTextInputChars = 127 -- tested 127 as being the true max local inputTextInsertActive = false local floor = math.floor -local inputMode = '' +local inputMode = "" -function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it +function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it if not chobbyInterface and not Spring.IsGUIHidden() and showTextInput and show then if inputTextInsertActive then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 2) if inputTextPosition <= utf8.len(inputText) then inputTextPosition = inputTextPosition + 1 end else - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition + 1 end if string.len(inputText) > maxTextInputChars then @@ -427,8 +423,8 @@ function widget:TextInput(char) -- if it isnt working: chobby probably hijacked end cursorBlinkTimer = 0 updateTextInputDlist = true - if WG['limitidlefps'] and WG['limitidlefps'].update then - WG['limitidlefps'].update() + if WG["limitidlefps"] and WG["limitidlefps"].update then + WG["limitidlefps"].update() end applyFilter() @@ -437,7 +433,7 @@ function widget:TextInput(char) -- if it isnt working: chobby probably hijacked end local function clearChatInput() - inputText = '' + inputText = "" inputTextPosition = 0 inputTextInsertActive = false -- Invalidate guishader so it rebuilds with tab blur regions included @@ -447,22 +443,22 @@ end -- only called when show = false local function cancelChatInput() - local doReinit = inputText ~= '' + local doReinit = inputText ~= "" backgroundGuishader = glDeleteList(backgroundGuishader) - if WG['guishader'] then - WG['guishader'].RemoveDlist('options') - WG['guishader'].RemoveRect('optionsinput') + if WG["guishader"] then + WG["guishader"].RemoveDlist("options") + WG["guishader"].RemoveRect("optionsinput") if selectOptionsList then - WG['guishader'].RemoveScreenRect('options_select') - WG['guishader'].RemoveScreenRect('options_select_options') - WG['guishader'].removeRenderDlist(selectOptionsList) + WG["guishader"].RemoveScreenRect("options_select") + WG["guishader"].RemoveScreenRect("options_select_options") + WG["guishader"].removeRenderDlist(selectOptionsList) end end if selectOptionsList then selectOptionsList = glDeleteList(selectOptionsList) end Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() if doReinit then applyFilter() end @@ -471,9 +467,9 @@ end function drawChatInputCursor() if textCursorRect then local a = 1 - (cursorBlinkTimer * (1 / cursorBlinkDuration)) + 0.15 - glColor(0.7,0.7,0.7,a) + glColor(0.7, 0.7, 0.7, a) gl.Rect(textCursorRect[1], textCursorRect[2], textCursorRect[3], textCursorRect[4]) - glColor(1,1,1,1) + glColor(1, 1, 1, 1) end end @@ -481,21 +477,21 @@ function updateInputDlist() updateTextInputDlist = false glDeleteList(textInputDlist) textInputDlist = glCreateList(function() - local activationArea = {screenX, screenY - screenHeight, screenX + screenWidth, screenY} + local activationArea = { screenX, screenY - screenHeight, screenX + screenWidth, screenY } local usedFontSize = 15 * widgetScale local lineHeight = floor(usedFontSize * 1.15) - local x,y,_ = Spring.GetMouseState() + local x, y, _ = Spring.GetMouseState() local chatlogHeightDiff = 0 local inputFontSize = floor(usedFontSize * 1.03) local inputHeight = floor(inputFontSize * 2.15) - local leftOffset = floor(lineHeight*0.7) + local leftOffset = floor(lineHeight * 0.7) local distance = 0 --elementMargin local usedFont = font - local modeText = Spring.I18N('ui.settings.filter') - if inputMode ~= '' then + local modeText = Spring.I18N("ui.settings.filter") + if inputMode ~= "" then modeText = inputMode end - local modeTextPosX = floor(activationArea[1]+elementPadding+elementPadding+leftOffset) + local modeTextPosX = floor(activationArea[1] + elementPadding + elementPadding + leftOffset) local textPosX = floor(modeTextPosX + (usedFont:GetTextWidth(modeText) * inputFontSize) + leftOffset + inputFontSize) local textCursorWidth = 1 + math.floor(inputFontSize / 14) if inputTextInsertActive then @@ -504,40 +500,39 @@ function updateInputDlist() local textCursorPos = floor(usedFont:GetTextWidth(utf8.sub(inputText, 1, inputTextPosition)) * inputFontSize) -- background - local x2 = math.max(textPosX+lineHeight+floor(usedFont:GetTextWidth(inputText) * inputFontSize), floor(activationArea[1]+((activationArea[3]-activationArea[1])/5))) - chatInputArea = { activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance } - UiElement(chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4], 0,0,nil,nil, 0,nil,nil,nil, WG.FlowUI.clampedOpacity) - if WG['guishader'] then - WG['guishader'].InsertRect(activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance, 'optionsinput') + local x2 = math.max(textPosX + lineHeight + floor(usedFont:GetTextWidth(inputText) * inputFontSize), floor(activationArea[1] + ((activationArea[3] - activationArea[1]) / 5))) + chatInputArea = { activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance } + UiElement(chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4], 0, 0, nil, nil, 0, nil, nil, nil, WG.FlowUI.clampedOpacity) + if WG["guishader"] then + WG["guishader"].InsertRect(activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance, "optionsinput") end -- button background - local inputButtonRect = {activationArea[1]+elementPadding, activationArea[2]+chatlogHeightDiff-distance-inputHeight+elementPadding, textPosX-inputFontSize, activationArea[2]+chatlogHeightDiff-distance} - if inputMode ~= '' then + local inputButtonRect = { activationArea[1] + elementPadding, activationArea[2] + chatlogHeightDiff - distance - inputHeight + elementPadding, textPosX - inputFontSize, activationArea[2] + chatlogHeightDiff - distance } + if inputMode ~= "" then glColor(0.03, 0.12, 0.03, 0.3) else glColor(0, 0, 0, 0.3) end - RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner*0.6, 0,0,0,1) - glColor(1,1,1,0.033) - gl.Rect(inputButtonRect[3]-1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) + RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner * 0.6, 0, 0, 0, 1) + glColor(1, 1, 1, 0.033) + gl.Rect(inputButtonRect[3] - 1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) -- button text usedFont:Begin() - usedFont:SetOutlineColor(0,0,0,0.4) + usedFont:SetOutlineColor(0, 0, 0, 0.4) usedFont:SetTextColor(0.62, 0.62, 0.62, 1) - usedFont:Print(modeText, modeTextPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:Print(modeText, modeTextPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") -- text cursor - textCursorRect = { textPosX + textCursorPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)-(inputFontSize*0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)+(inputFontSize*0.64) } + textCursorRect = { textPosX + textCursorPos, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) - (inputFontSize * 0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) + (inputFontSize * 0.64) } usedFont:SetTextColor(0.95, 0.95, 0.95, 1) - usedFont:Print(inputText, textPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:Print(inputText, textPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") usedFont:End() end) end - local optionIdIndex = {} local function rebuildOptionIdIndex() optionIdIndex = {} @@ -567,7 +562,7 @@ function orderOptions() -- When a filter is active, options are already ordered by relevance with -- context labels inserted by applyFilter(). Skip regrouping to preserve -- that ordering and avoid severing shared references. - if inputText and inputText ~= '' and inputMode == '' then + if inputText and inputText ~= "" and inputMode == "" then return end @@ -576,7 +571,7 @@ function orderOptions() groupOptions[group.id] = {} end for i, option in pairs(options) do - if option.type ~= 'label' then + if option.type ~= "label" then groupOptions[option.group][#groupOptions[option.group] + 1] = option end end @@ -587,11 +582,11 @@ function orderOptions() local grOptions = groupOptions[group.id] if #grOptions > 0 then local name = group.name - if group.id == 'gfx' then - name = group.name .. ' \255\130\130\130' .. vsx .. ' x ' .. vsy + if group.id == "gfx" then + name = group.name .. " \255\130\130\130" .. vsx .. " x " .. vsy end newOptionsCount = newOptionsCount + 1 - newOptions[newOptionsCount] = { id = "group_" .. group.id, name = '\255\255\200\110'..name, type = "label"} + newOptions[newOptionsCount] = { id = "group_" .. group.id, name = "\255\255\200\110" .. name, type = "label" } end for i, option in pairs(grOptions) do newOptionsCount = newOptionsCount + 1 @@ -626,10 +621,10 @@ function mouseoverGroupTab(id) font2:End() end -local startColumn = 1 -- used for navigation +local startColumn = 1 -- used for navigation local maxShownColumns = 3 -local maxColumnRows = 0 -- gets calculated -local totalColumns = 0 -- gets calculated +local maxColumnRows = 0 -- gets calculated +local totalColumns = 0 -- gets calculated function DrawWindow() orderOptions() @@ -640,25 +635,25 @@ function DrawWindow() windowRect = { screenX, screenY - screenHeight, screenX + screenWidth, screenY } -- background - UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, (showTextInput and inputText ~= '' and inputMode == '') and 1 or 0, 0, 1, (showTextInput and 0 or 1), 1, 1, 1, 1, WG.FlowUI.clampedOpacity) + UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, (showTextInput and inputText ~= "" and inputMode == "") and 1 or 0, 0, 1, (showTextInput and 0 or 1), 1, 1, 1, 1, WG.FlowUI.clampedOpacity) -- title local groupMargin = math.floor(bgpadding * 0.8) - local color2 = '\255\125\125\125' - local color = '\255\255\255\255' + local color2 = "\255\125\125\125" + local color = "\255\255\255\255" local title = "" if devMode or devUI then - title = devOptionColor .. Spring.I18N('ui.settings.option.devmode') + title = devOptionColor .. Spring.I18N("ui.settings.option.devmode") elseif advSettings then - title = color2 .. Spring.I18N('ui.settings.basic') .. " / " .. color .. Spring.I18N('ui.settings.advanced') + title = color2 .. Spring.I18N("ui.settings.basic") .. " / " .. color .. Spring.I18N("ui.settings.advanced") else - title = color .. Spring.I18N('ui.settings.basic') .. color2 .. " / " .. Spring.I18N('ui.settings.advanced') + title = color .. Spring.I18N("ui.settings.basic") .. color2 .. " / " .. Spring.I18N("ui.settings.advanced") end local titleFontSize = 18 * widgetScale titleRect = { math.floor((screenX + screenWidth) - ((font2:GetTextWidth(title) * titleFontSize) + (titleFontSize * 1.5))), screenY, screenX + screenWidth, math.floor(screenY + (titleFontSize * 1.7)) } -- title drawing - RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0, WG['guishader'] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG['guishader'] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0, WG["guishader"] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG["guishader"] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) RectRound(titleRect[1] + groupMargin, titleRect[4] - groupMargin - ((titleRect[4] - titleRect[2]) * 0.5), titleRect[3] - groupMargin, titleRect[4] - groupMargin, elementCorner * 0.66, 1, 1, 0, 0, { 1, 0.95, 0.85, 0.03 }, { 1, 0.95, 0.85, 0.15 }) font2:Begin() @@ -668,7 +663,7 @@ function DrawWindow() font2:End() -- group tabs - if not (showTextInput and inputText ~= '' and inputMode == '') then + if not (showTextInput and inputText ~= "" and inputMode == "") then local tabFontSize = 16 * widgetScale local xpos = screenX local groupPadding = 1 @@ -676,13 +671,13 @@ function DrawWindow() for id, group in pairs(optionGroups) do if group.numOptions > 0 then groupRect[id] = { xpos, titleRect[2], math.floor(xpos + (font2:GetTextWidth(group.name) * tabFontSize) + (33 * widgetScale)), titleRect[4] } - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then xpos = groupRect[id][3] if currentGroupTab == nil or currentGroupTab ~= group.id then - RectRound(groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4], elementCorner, 1, 1, 0, 0, WG['guishader'] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG['guishader'] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) + RectRound(groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4], elementCorner, 1, 1, 0, 0, WG["guishader"] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG["guishader"] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) RectRound(groupRect[id][1] + groupMargin, groupRect[id][2], groupRect[id][3] - groupMargin, groupRect[id][4] - groupMargin, elementCorner * 0.66, 1, 1, 0, 0, { 0.6, 0.47, 0.24, 0.2 }, { 0.88, 0.68, 0.33, 0.2 }) - RectRound(groupRect[id][1] + groupMargin+groupPadding, groupRect[id][2], groupRect[id][3] - groupMargin-groupPadding, groupRect[id][4] - groupMargin-groupPadding, elementCorner * 0.5, 1, 1, 0, 0, { 0,0,0, 0.13 }, { 0,0,0, 0.13 }) + RectRound(groupRect[id][1] + groupMargin + groupPadding, groupRect[id][2], groupRect[id][3] - groupMargin - groupPadding, groupRect[id][4] - groupMargin - groupPadding, elementCorner * 0.5, 1, 1, 0, 0, { 0, 0, 0, 0.13 }, { 0, 0, 0, 0.13 }) glBlending(GL_SRC_ALPHA, GL_ONE) -- gloss @@ -695,7 +690,7 @@ function DrawWindow() font2:Print(group.name, groupRect[id][1] + ((groupRect[id][3] - groupRect[id][1]) / 2), screenY + (9 * widgetScale), tabFontSize, "con") font2:End() else - RectRound(groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4], elementCorner, 1, 1, 0, 0, WG['guishader'] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG['guishader'] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) + RectRound(groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4], elementCorner, 1, 1, 0, 0, WG["guishader"] and { 0, 0, 0, 0.8 } or { 0, 0, 0, 0.85 }, WG["guishader"] and { 0.05, 0.05, 0.05, 0.8 } or { 0.05, 0.05, 0.05, 0.85 }) RectRound(groupRect[id][1] + groupMargin, groupRect[id][2] - bgpadding, groupRect[id][3] - groupMargin, groupRect[id][4] - groupMargin, elementCorner * 0.8, 1, 1, 0, 0, { 0.7, 0.7, 0.7, 0.15 }, { 0.8, 0.8, 0.8, 0.15 }) font2:Begin() @@ -710,7 +705,7 @@ function DrawWindow() end font:Begin() - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) -- draw options local oHeight = math.floor(15 * widgetScale) @@ -733,7 +728,7 @@ function DrawWindow() local numOptions = #options local dontFilterGroup = false - if inputText and inputText ~= '' and inputMode == '' then + if inputText and inputText ~= "" and inputMode == "" then dontFilterGroup = true end if currentGroupTab ~= nil and not dontFilterGroup then @@ -752,12 +747,12 @@ function DrawWindow() -- require restart notification if changesRequireRestart then - glColor(1,0,0,0.06) - RectRound(screenX+bgpadding, screenY - screenHeight+bgpadding, screenX + screenWidth-bgpadding, screenY-screenHeight + (31 * widgetScale), elementCorner, 0, 0, 1, 0) - RectRound(screenX+bgpadding, screenY - screenHeight+bgpadding + (30 * widgetScale)-1, screenX + screenWidth-bgpadding, screenY-screenHeight + (30 * widgetScale), 0, 0, 0, 0, 0) + glColor(1, 0, 0, 0.06) + RectRound(screenX + bgpadding, screenY - screenHeight + bgpadding, screenX + screenWidth - bgpadding, screenY - screenHeight + (31 * widgetScale), elementCorner, 0, 0, 1, 0) + RectRound(screenX + bgpadding, screenY - screenHeight + bgpadding + (30 * widgetScale) - 1, screenX + screenWidth - bgpadding, screenY - screenHeight + (30 * widgetScale), 0, 0, 0, 0, 0) font:SetTextColor(0.9, 0.3, 0.3, 1) font:SetOutlineColor(0, 0, 0, 0.4) - font:Print(Spring.I18N('ui.settings.madechanges'), screenX + math.floor(screenWidth*0.5), screenY - screenHeight + (12 * widgetScale), 15 * widgetScale, "cn") + font:Print(Spring.I18N("ui.settings.madechanges"), screenX + math.floor(screenWidth * 0.5), screenY - screenHeight + (12 * widgetScale), 15 * widgetScale, "cn") end -- draw navigation... backward/forward @@ -782,7 +777,7 @@ function DrawWindow() end font:SetTextColor(1, 1, 1, 0.4) - font:Print(math.ceil(startColumn / maxShownColumns) .. ' / ' .. math.ceil(totalColumns / maxShownColumns), startX - (buttonSize * 2.6) - buttonMarginX, startY + buttonSize / 2.6, buttonSize / 2.4, "rn") + font:Print(math.ceil(startColumn / maxShownColumns) .. " / " .. math.ceil(totalColumns / maxShownColumns), startX - (buttonSize * 2.6) - buttonMarginX, startY + buttonSize / 2.6, buttonSize / 2.4, "rn") if startColumn > 1 then optionButtonBackward = { startX - (buttonSize * 2) - buttonMarginX - (buttonMarginX / 1.5), startY, startX - (buttonSize * 1) - buttonMarginX - (buttonMarginX / 1.5), startY + buttonSize } glColor(1, 1, 1, 1) @@ -797,7 +792,7 @@ function DrawWindow() -- draw options local yPos - local prevGroup = '' + local prevGroup = "" for oid, option in pairs(options) do if showOption(option) then if currentGroupTab == nil or option.group == currentGroupTab or dontFilterGroup then @@ -812,7 +807,7 @@ function DrawWindow() break end if rows > 0 then - xPos = math.floor(x + (((screenWidth / 3)) * (drawColumnPos - 1))) + xPos = math.floor(x + ((screenWidth / 3) * (drawColumnPos - 1))) xPosMax = math.floor(xPos + oWidth) end yPos = y - (((oHeight + oPadding + oPadding) * i) - oPadding) @@ -821,7 +816,7 @@ function DrawWindow() if column >= startColumn then rows = rows + 1 if option.name then - color = '\255\225\225\225' + color = "\255\225\225\225" font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 0.4) @@ -829,22 +824,22 @@ function DrawWindow() if option.type == nil then font:End() font3:Begin() - font3:SetOutlineColor(0,0,0,0.4) - font3:Print('\255\255\200\130' .. option.name, xPos + (oPadding * 0.5), yPos - (oHeight * 1.8) - oPadding, oHeight * 1.5, "no") + font3:SetOutlineColor(0, 0, 0, 0.4) + font3:Print("\255\255\200\130" .. option.name, xPos + (oPadding * 0.5), yPos - (oHeight * 1.8) - oPadding, oHeight * 1.5, "no") font3:End() font:Begin() - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 0.4) else local text = option.name local width = font:GetTextWidth(text) * math.floor(15 * widgetScale) local maxWidthMult = 1 - if option.type == 'bool' then + if option.type == "bool" then maxWidthMult = 0.85 - elseif option.type == 'select' then + elseif option.type == "select" then maxWidthMult = 0.5 - elseif option.type == 'slider' then + elseif option.type == "slider" then maxWidthMult = 0.55 end local maxWidth = (xPosMax - xPos - 45) * maxWidthMult @@ -853,15 +848,15 @@ function DrawWindow() while font:GetTextWidth(text) * math.floor(15 * widgetScale) > maxWidth do text = string.sub(text, 1, string.len(text) - 1) end - text = text .. '...' - if not option.description or option.description == '' then + text = text .. "..." + if not option.description or option.description == "" then option.description = option.name elseif option.description ~= option.name and string.sub(option.description, 1, string.len(option.name)) ~= option.name then - option.description = option.name..'\n\255\255\255\255'..option.description + option.description = option.name .. "\n\255\255\255\255" .. option.description end end if option.restart then - font:Print('\255\255\090\090*', xPos + (oPadding * 0.3), yPos - (oHeight / 5) - oPadding, oHeight, "no") + font:Print("\255\255\090\090*", xPos + (oPadding * 0.3), yPos - (oHeight / 5) - oPadding, oHeight, "no") end options[oid].nametext = text font:Print(color .. text, xPos + (oPadding * 2), yPos - (oHeight / 2.4) - oPadding, oHeight, "no") @@ -872,17 +867,15 @@ function DrawWindow() -- option controller local rightPadding = 4 - if option.type == 'click' then + if option.type == "click" then optionButtons[oid] = {} optionButtons[oid] = { math.floor(xPos + rightPadding), math.floor(yPos - oHeight), math.floor(xPosMax - rightPadding), math.floor(yPos) } - - elseif option.type == 'bool' then + elseif option.type == "bool" then optionButtons[oid] = {} optionButtons[oid] = { math.floor(xPosMax - boolWidth - rightPadding), math.floor(yPos - oHeight), math.floor(xPosMax - rightPadding), math.floor(yPos) } UiToggle(optionButtons[oid][1], optionButtons[oid][2], optionButtons[oid][3], optionButtons[oid][4], option.value) - - elseif option.type == 'slider' then - if type(option.value) == 'number' then -- just to be safe + elseif option.type == "slider" then + if type(option.value) == "number" then -- just to be safe local sliderSize = oHeight * 0.75 local sliderPos = 0 if option.steps then @@ -899,14 +892,14 @@ function DrawWindow() else sliderPos = (option.value - option.min) / (option.max - option.min) end - if type(sliderPos) == 'number' then + if type(sliderPos) == "number" then UiSlider(math.floor(xPosMax - (sliderSize / 2) - sliderWidth - rightPadding), math.floor(yPos - ((oHeight / 7) * 4.5)), math.floor(xPosMax - (sliderSize / 2) - rightPadding), math.floor(yPos - ((oHeight / 7) * 2.8)), option.steps and option.steps or option.step, option.min, option.max) - UiSliderKnob(math.floor(xPosMax - (sliderSize / 2) - sliderWidth + (sliderWidth * sliderPos) - rightPadding), math.floor(yPos - oHeight + ((oHeight) / 2)), math.floor(sliderSize / 2)) + UiSliderKnob(math.floor(xPosMax - (sliderSize / 2) - sliderWidth + (sliderWidth * sliderPos) - rightPadding), math.floor(yPos - oHeight + (oHeight / 2)), math.floor(sliderSize / 2)) optionButtons[oid] = { xPosMax - (sliderSize / 2) - sliderWidth + (sliderWidth * sliderPos) - (sliderSize / 2) - rightPadding, yPos - oHeight + ((oHeight - sliderSize) / 2), xPosMax - (sliderSize / 2) - sliderWidth + (sliderWidth * sliderPos) + (sliderSize / 2) - rightPadding, yPos - ((oHeight - sliderSize) / 2) } optionButtons[oid].sliderXpos = { xPosMax - (sliderSize / 2) - sliderWidth - rightPadding, xPosMax - (sliderSize / 2) - rightPadding } end end - elseif option.type == 'select' then + elseif option.type == "select" then optionButtons[oid] = { math.floor(xPosMax - selectWidth - rightPadding), math.floor(yPos - oHeight), math.floor(xPosMax - rightPadding), math.floor(yPos) } UiSelector(optionButtons[oid][1], optionButtons[oid][2], optionButtons[oid][3], optionButtons[oid][4], option.value) @@ -918,23 +911,23 @@ function DrawWindow() while font:GetTextWidth(text) * math.floor(15 * widgetScale) > (optionButtons[oid][3] - optionButtons[oid][1]) * 0.9 do text = string.sub(text, 1, string.len(text) - 1) end - text = text .. '...' - if not option.description or option.description == '' then + text = text .. "..." + if not option.description or option.description == "" then option.description = option.name elseif option.description ~= option.name and string.sub(option.description, 1, string.len(option.name)) ~= option.name then - option.description = option.name..'\n\255\255\255\255'..option.description + option.description = option.name .. "\n\255\255\255\255" .. option.description end end options[oid].nametext = text - if option.id == 'font2' then + if option.id == "font2" then font:End() font2:Begin() - font2:SetOutlineColor(0,0,0,0.4) + font2:SetOutlineColor(0, 0, 0, 0.4) font2:SetTextColor(1, 1, 1, 1) font2:Print(text, xPosMax - selectWidth + 5 - rightPadding, yPos - (fontSize / 2) - oPadding, fontSize, "no") font2:End() font:Begin() - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) else font:SetTextColor(1, 1, 1, 1) font:Print(text, xPosMax - selectWidth + 5 - rightPadding, yPos - (fontSize / 2) - oPadding, fontSize, "no") @@ -952,7 +945,7 @@ end local function updateGrabinput() -- grabinput makes alt-tabbing harder, so loosen grip a bit when in lobby would be wise - if Spring.GetConfigInt('grabinput', 1) == 1 and not gameOver then + if Spring.GetConfigInt("grabinput", 1) == 1 and not gameOver then if chobbyInterface then if enabledGrabinput then enabledGrabinput = false @@ -965,8 +958,8 @@ local function updateGrabinput() end end else - enabledGrabinput = false - Spring.SendCommands("grabinput 0") + enabledGrabinput = false + Spring.SendCommands("grabinput 0") end end @@ -992,7 +985,9 @@ end function widget:Update(dt) if show then cursorBlinkTimer = cursorBlinkTimer + dt - if cursorBlinkTimer > cursorBlinkDuration then cursorBlinkTimer = 0 end + if cursorBlinkTimer > cursorBlinkDuration then + cursorBlinkTimer = 0 + end end local now = os_clock() @@ -1021,11 +1016,11 @@ function widget:Update(dt) end end if isOffscreenTime then - if isOffscreenTime+muteFadeTime > now then + if isOffscreenTime + muteFadeTime > now then if isOffscreen then - Spring.SetConfigInt("snd_volmaster", prevOffscreenVolume*(1-((now-isOffscreenTime)/muteFadeTime))) + Spring.SetConfigInt("snd_volmaster", prevOffscreenVolume * (1 - ((now - isOffscreenTime) / muteFadeTime))) else - Spring.SetConfigInt("snd_volmaster", prevOffscreenVolume*((now-isOffscreenTime)/muteFadeTime)) + Spring.SetConfigInt("snd_volmaster", prevOffscreenVolume * ((now - isOffscreenTime) / muteFadeTime)) end else isOffscreenTime = nil @@ -1049,13 +1044,13 @@ function widget:Update(dt) return end - -- disable ambient player widget, also doing this on initialize but hell... players somehow still have this enabled - if not ambientplayerCheck then - ambientplayerCheck = true - if widgetHandler:IsWidgetKnown("Ambient Player") then - widgetHandler:DisableWidget("Ambient Player") - end + -- disable ambient player widget, also doing this on initialize but hell... players somehow still have this enabled + if not ambientplayerCheck then + ambientplayerCheck = true + if widgetHandler:IsWidgetKnown("Ambient Player") then + widgetHandler:DisableWidget("Ambient Player") end + end if sceduleOptionApply then if sceduleOptionApply[1] <= now then @@ -1067,9 +1062,9 @@ function widget:Update(dt) --if tonumber(Spring.GetConfigInt("CameraSmoothing", 0)) == 1 then -- Spring.SetCameraState(nil, 1) --else - if WG.lockcamera and not WG.lockcamera.GetPlayerID() and WG.setcamera_bugfix == true then - Spring.SetCameraState(nil, cameraTransitionTime) - end + if WG.lockcamera and not WG.lockcamera.GetPlayerID() and WG.setcamera_bugfix == true then + Spring.SetCameraState(nil, cameraTransitionTime) + end --end -- check if there is water shown (we do this because basic water 0 saves perf when no water is rendered) @@ -1111,7 +1106,7 @@ function widget:Update(dt) cachedMuteOffscreen = Spring.GetConfigInt("muteOffscreen", 0) == 1 -- detect guishader toggle: force refresh when it comes back on - local guishaderActive = WG['guishader'] ~= nil + local guishaderActive = WG["guishader"] ~= nil if guishaderActive and not guishaderWasActive then if backgroundGuishader then backgroundGuishader = glDeleteList(backgroundGuishader) @@ -1138,7 +1133,7 @@ function widget:Update(dt) -- Sync widget toggle values in unfilteredOptions (the authoritative list) -- so changes persist across filter apply/clear cycles. for i, option in ipairs(unfilteredOptions) do - if option.widget ~= nil and option.type == 'bool' and option.value ~= GetWidgetToggleValue(option.widget) then + if option.widget ~= nil and option.type == "bool" and option.value ~= GetWidgetToggleValue(option.widget) then option.value = GetWidgetToggleValue(option.widget) changes = true end @@ -1146,14 +1141,14 @@ function widget:Update(dt) if changes then applyFilter() end - if getOptionByID('sndvolmaster') then - options[getOptionByID('sndvolmaster')].value = tonumber(Spring.GetConfigInt("snd_volmaster", 40) or 40) -- update value because other widgets can adjust this too + if getOptionByID("sndvolmaster") then + options[getOptionByID("sndvolmaster")].value = tonumber(Spring.GetConfigInt("snd_volmaster", 40) or 40) -- update value because other widgets can adjust this too end - if getOptionByID('sndvolmusic') then - if WG['music'] and WG['music'].GetMusicVolume then - options[getOptionByID('sndvolmusic')].value = WG['music'].GetMusicVolume() + if getOptionByID("sndvolmusic") then + if WG["music"] and WG["music"].GetMusicVolume then + options[getOptionByID("sndvolmusic")].value = WG["music"].GetMusicVolume() else - options[getOptionByID('sndvolmusic')].value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50) + options[getOptionByID("sndvolmusic")].value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50) end end end @@ -1169,7 +1164,7 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOptions) return true elseif groupRect ~= nil then for id, group in pairs(optionGroups) do - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then if math_isInRect(mx, my, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then return true end @@ -1187,11 +1182,15 @@ function widget:RecvLuaMsg(msg, playerID) end local rwsChunk = msg:match("^rws:chunk:(.*)") if rwsChunk then - if rwsBuffer then rwsBuffer[#rwsBuffer + 1] = rwsChunk end + if rwsBuffer then + rwsBuffer[#rwsBuffer + 1] = rwsChunk + end return true end if msg == "rws:commit" then - if not rwsBuffer then return true end + if not rwsBuffer then + return true + end local data = table.concat(rwsBuffer) rwsBuffer = nil Spring.CreateDir("LuaUI/Config") @@ -1208,11 +1207,13 @@ function widget:RecvLuaMsg(msg, playerID) end if msg == "rws:clear" then local f = io.open("LuaUI/Config/restart_state.lua", "w") - if f then f:close() end + if f then + f:close() + end return true end - if msg:sub(1, 18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") updateGrabinput() if (isSinglePlayer or isReplay) and pauseGameWhenSingleplayer and not skipUnpauseOnHide then local _, _, isClientPaused, _ = Spring.GetGameState() @@ -1220,11 +1221,11 @@ function widget:RecvLuaMsg(msg, playerID) skipUnpauseOnLobbyHide = true end if not skipUnpauseOnLobbyHide then - Spring.SendCommands("pause " .. (chobbyInterface and '1' or '0')) + Spring.SendCommands("pause " .. (chobbyInterface and "1" or "0")) pauseGameWhenSingleplayerExecuted = chobbyInterface end if not chobbyInterface then - Spring.SetConfigInt('VSync', Spring.GetConfigInt("VSyncGame", -1) * Spring.GetConfigInt("VSyncFraction", 1)) + Spring.SetConfigInt("VSync", Spring.GetConfigInt("VSyncGame", -1) * Spring.GetConfigInt("VSyncFraction", 1)) end end end @@ -1243,7 +1244,7 @@ local function checkPause() skipUnpauseOnHide = true end if not skipUnpauseOnHide then - Spring.SendCommands("pause " .. (show and '1' or '0')) -- cause several widgets are still using old colors + Spring.SendCommands("pause " .. (show and "1" or "0")) -- cause several widgets are still using old colors showToggledOff = not show pauseGameWhenSingleplayerExecuted = show end @@ -1256,14 +1257,16 @@ local pauseCheckTimer = 0 local lastPauseCheckClock = os_clock() local canPauseGame = (isSinglePlayer or isReplay) and pauseGameWhenSingleplayer local function checkQuitscreen() - if not canPauseGame then return end - quitscreen = (WG['topbar'] and WG['topbar'].showingQuit() or false) + if not canPauseGame then + return + end + quitscreen = (WG["topbar"] and WG["topbar"].showingQuit() or false) if prevQuitscreen ~= quitscreen then if quitscreen and isClientPaused and not showToggledOff then skipUnpauseOnHide = true end if not skipUnpauseOnHide then - Spring.SendCommands("pause " .. (quitscreen and '1' or '0')) -- cause several widgets are still using old colors + Spring.SendCommands("pause " .. (quitscreen and "1" or "0")) -- cause several widgets are still using old colors pauseGameWhenSingleplayerExecuted = quitscreen end end @@ -1291,7 +1294,6 @@ function widget:DrawScreen() init() initialized = true else - -- update new slider value if sliderValueChanged then gl.DeleteList(windowList) @@ -1300,30 +1302,26 @@ function widget:DrawScreen() end if not showSelectOptions and selectOptionsList then - if WG['guishader'] then - WG['guishader'].RemoveScreenRect('options_select') - WG['guishader'].RemoveScreenRect('options_select_options') - WG['guishader'].removeRenderDlist(selectOptionsList) + if WG["guishader"] then + WG["guishader"].RemoveScreenRect("options_select") + WG["guishader"].RemoveScreenRect("options_select_options") + WG["guishader"].removeRenderDlist(selectOptionsList) end selectOptionsList = glDeleteList(selectOptionsList) end if (show or showOnceMore) and windowList then - --on window local mx, my, ml = Spring.GetMouseState() - if (math_isInRect(mx, my, windowRect[1], windowRect[2], windowRect[3], windowRect[4])) or - (titleRect and math_isInRect(mx, my, titleRect[1], titleRect[2], titleRect[3], titleRect[4])) or - (chatInputArea and math_isInRect(mx, my, chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4])) - then - Spring.SetMouseCursor('cursornormal') + if (math_isInRect(mx, my, windowRect[1], windowRect[2], windowRect[3], windowRect[4])) or (titleRect and math_isInRect(mx, my, titleRect[1], titleRect[2], titleRect[3], titleRect[4])) or (chatInputArea and math_isInRect(mx, my, chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4])) then + Spring.SetMouseCursor("cursornormal") end if groupRect ~= nil then for id, group in pairs(optionGroups) do if group.numOptions > 0 then - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then if math_isInRect(mx, my, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") break end end @@ -1333,7 +1331,7 @@ function widget:DrawScreen() -- draw the options panel glCallList(windowList) - if WG['guishader'] then + if WG["guishader"] then if not backgroundGuishader then backgroundGuishader = glCreateList(function() -- background @@ -1341,11 +1339,11 @@ function widget:DrawScreen() -- title RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) -- tabs - if not (showTextInput and inputText ~= '' and inputMode == '') then + if not (showTextInput and inputText ~= "" and inputMode == "") then guishaderedTabs = true for id, group in pairs(optionGroups) do if group.numOptions > 0 then - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then if groupRect[id] then RectRound(groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4], elementCorner, 1, 1, 0, 0) end @@ -1356,13 +1354,13 @@ function widget:DrawScreen() guishaderedTabs = false end end) - WG['guishader'].InsertDlist(backgroundGuishader, 'options') + WG["guishader"].InsertDlist(backgroundGuishader, "options") end end showOnceMore = false -- mouseover (highlight and tooltip) - local description = '' + local description = "" if not (devMode or devUI) and titleRect ~= nil and math_isInRect(mx, my, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then local groupMargin = math.floor(bgpadding * 0.8) -- gloss @@ -1371,11 +1369,11 @@ function widget:DrawScreen() RectRound(titleRect[1] + groupMargin, titleRect[4] - groupMargin - ((titleRect[4] - titleRect[2]) * 0.5), titleRect[3] - groupMargin, titleRect[4] - groupMargin, groupMargin * 1.8, 1, 1, 0, 0, { 1, 0.88, 0.66, 0 }, { 1, 0.88, 0.66, 0.09 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end - if not (showTextInput and inputText ~= '' and inputMode == '') then + if not (showTextInput and inputText ~= "" and inputMode == "") then if groupRect ~= nil then for id, group in pairs(optionGroups) do if group.numOptions > 0 then - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then if math_isInRect(mx, my, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then mouseoverGroupTab(id) end @@ -1398,24 +1396,24 @@ function widget:DrawScreen() if options[i].onclick == nil then RectRound(o[1], o[2], o[3], o[4], 1, 2, 2, 2, 2, { 0.5, 0.5, 0.5, 0.22 }, { 1, 1, 1, 0.22 }) end - if WG['tooltip'] ~= nil and options[i].type == 'slider' then + if WG["tooltip"] ~= nil and options[i].type == "slider" then local value = options[i].value if options[i].steps then value = NearestValue(options[i].steps, value) else local decimalValue, floatValue = math.modf(options[i].step) if floatValue ~= 0 then - value = string.format("%." .. string.len(string.sub('' .. options[i].step, 3)) .. "f", value) -- do rounding via a string because floats show rounding errors at times + value = string.format("%." .. string.len(string.sub("" .. options[i].step, 3)) .. "f", value) -- do rounding via a string because floats show rounding errors at times end end - WG['tooltip'].ShowTooltip('options_showvalue', value) + WG["tooltip"].ShowTooltip("options_showvalue", value) tooltipShowing = true end end end if not tooltipShowing then for i, o in pairs(optionHover) do - if options[i] and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) and options[i].type and options[i].type ~= 'label' and options[i].type ~= 'text' then + if options[i] and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) and options[i].type and options[i].type ~= "label" and options[i].type ~= "text" then -- display console command at the bottom if (advSettings or devMode or devUI) and (options[i].onchange ~= nil or options[i].widget) then if not consoleCmdDlist or not lastConsoleCmdOption or lastConsoleCmdOption ~= options[i].id then @@ -1424,9 +1422,9 @@ function widget:DrawScreen() end consoleCmdDlist = glCreateList(function() font:Begin() - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) font:SetTextColor(0.5, 0.5, 0.5, 0.27) - font:Print('/option ' .. options[i].id, screenX + (8 * widgetScale), screenY - screenHeight + (11 * widgetScale), 14 * widgetScale, "n") + font:Print("/option " .. options[i].id, screenX + (8 * widgetScale), screenY - screenHeight + (11 * widgetScale), 14 * widgetScale, "n") font:End() end) end @@ -1435,20 +1433,20 @@ function widget:DrawScreen() end -- highlight option UiSelectHighlight(o[1] - 4, o[2], o[3] + 4, o[4], nil, options[i].onclick and (ml and 0.35 or 0.22) or 0.14, options[i].onclick and { 0.5, 1, 0.25 }) - if WG.tooltip and options[i].description and options[i].description ~= '' and options[i].description ~= ' ' then + if WG.tooltip and options[i].description and options[i].description ~= "" and options[i].description ~= " " then local desc = options[i].description if options[i].restart then - desc = desc..'\n\n\255\255\120\120'..Spring.I18N('ui.settings.changesrequirerestart') + desc = desc .. "\n\n\255\255\120\120" .. Spring.I18N("ui.settings.changesrequirerestart") end local showTooltip = true if options[i].nametext and string.find(options[i].nametext, desc, nil, true) then - if string.len(desc) == (string.len(options[i].nametext)+1)-string.find(options[i].nametext, desc, nil, true) then + if string.len(desc) == (string.len(options[i].nametext) + 1) - string.find(options[i].nametext, desc, nil, true) then showTooltip = false end end if showTooltip then - desc = font:WrapText(desc, WG['tooltip'].getFontsize() * 90) - WG.tooltip.ShowTooltip('options_description', desc)--, nil, nil, optionColor..options[i].name) + desc = font:WrapText(desc, WG["tooltip"].getFontsize() * 90) + WG.tooltip.ShowTooltip("options_description", desc) --, nil, nil, optionColor..options[i].name) end end break @@ -1459,9 +1457,8 @@ function widget:DrawScreen() -- draw select options if showSelectOptions ~= nil then - -- highlight all that are affected by presets - if options[showSelectOptions].id == 'preset' then + if options[showSelectOptions].id == "preset" then for optionID, _ in pairs(presets.lowest) do local optionKey = getOptionByID(optionID) if optionHover[optionKey] ~= nil then @@ -1485,18 +1482,18 @@ function widget:DrawScreen() local fontSize = oHeight * 0.85 local maxWidth = optionButtons[showSelectOptions][3] - optionButtons[showSelectOptions][1] for i, option in pairs(options[showSelectOptions].options) do - maxWidth = math.max(maxWidth, font:GetTextWidth(option .. ' ') * fontSize) + maxWidth = math.max(maxWidth, font:GetTextWidth(option .. " ") * fontSize) end if selectOptionsList then - if WG['guishader'] then - WG['guishader'].removeRenderDlist(selectOptionsList) + if WG["guishader"] then + WG["guishader"].removeRenderDlist(selectOptionsList) end glDeleteList(selectOptionsList) end selectOptionsList = glCreateList(function() local borderSize = math.max(1, math.floor(vsy / 900)) RectRound(optionButtons[showSelectOptions][1] - borderSize, yPos - oHeight - oPadding - borderSize, optionButtons[showSelectOptions][1] + maxWidth + borderSize, optionButtons[showSelectOptions][2] + borderSize, (optionButtons[showSelectOptions][4] - optionButtons[showSelectOptions][2]) * 0.1, 1, 1, 1, 1, { 0, 0, 0, 0.25 }, { 0, 0, 0, 0.25 }) - RectRound(optionButtons[showSelectOptions][1], yPos - oHeight - oPadding, optionButtons[showSelectOptions][1] + maxWidth, optionButtons[showSelectOptions][2], (optionButtons[showSelectOptions][4] - optionButtons[showSelectOptions][2]) * 0.1, 1, 1, 1, 1, { 0.3, 0.3, 0.3, WG['guishader'] and 0.84 or 0.94 }, { 0.35, 0.35, 0.35, WG['guishader'] and 0.84 or 0.94 }) + RectRound(optionButtons[showSelectOptions][1], yPos - oHeight - oPadding, optionButtons[showSelectOptions][1] + maxWidth, optionButtons[showSelectOptions][2], (optionButtons[showSelectOptions][4] - optionButtons[showSelectOptions][2]) * 0.1, 1, 1, 1, 1, { 0.3, 0.3, 0.3, WG["guishader"] and 0.84 or 0.94 }, { 0.35, 0.35, 0.35, WG["guishader"] and 0.84 or 0.94 }) UiSelector(optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4]) local i = 0 @@ -1508,27 +1505,27 @@ function widget:DrawScreen() if math_isInRect(mx, my, optionSelect[#optionSelect][1], optionSelect[#optionSelect][2], optionSelect[#optionSelect][3], optionSelect[#optionSelect][4]) then UiSelectHighlight(optionButtons[showSelectOptions][1], math.floor(yPos - oHeight - oPadding), optionButtons[showSelectOptions][1] + maxWidth, math.floor(yPos + oPadding)) if playSounds and (prevSelectHover == nil or prevSelectHover ~= i) then - Spring.PlaySoundFile(sounds.selectHoverClick, 0.04, 'ui') + Spring.PlaySoundFile(sounds.selectHoverClick, 0.04, "ui") end prevSelectHover = k end if options[showSelectOptions].optionsFont and fontOption and fontOption[i] then fontOption[i]:Begin() - fontOption[i]:SetOutlineColor(0,0,0,0.4) + fontOption[i]:SetOutlineColor(0, 0, 0, 0.4) fontOption[i]:Print(optionColor .. option, optionButtons[showSelectOptions][1] + 7, yPos - (oHeight / 2) - oPadding, fontSize, "no") fontOption[i]:End() else font:Begin() - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) font:Print(optionColor .. option, optionButtons[showSelectOptions][1] + 7, yPos - (oHeight / 2) - oPadding, fontSize, "no") font:End() end end end) - if WG['guishader'] then - WG['guishader'].InsertScreenRect(optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4], 'options_select') - WG['guishader'].InsertScreenRect(optionButtons[showSelectOptions][1], yPos - oHeight - oPadding, optionButtons[showSelectOptions][1] + maxWidth, optionButtons[showSelectOptions][2], 'options_select_options') - WG['guishader'].insertRenderDlist(selectOptionsList) + if WG["guishader"] then + WG["guishader"].InsertScreenRect(optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4], "options_select") + WG["guishader"].InsertScreenRect(optionButtons[showSelectOptions][1], yPos - oHeight - oPadding, optionButtons[showSelectOptions][1] + maxWidth, optionButtons[showSelectOptions][2], "options_select_options") + WG["guishader"].insertRenderDlist(selectOptionsList) else glCallList(selectOptionsList) end @@ -1543,19 +1540,19 @@ function widget:DrawScreen() if textInputDlist then glCallList(textInputDlist) drawChatInputCursor() - elseif WG['guishader'] then - WG['guishader'].RemoveRect('optionsinput') + elseif WG["guishader"] then + WG["guishader"].RemoveRect("optionsinput") textInputDlist = glDeleteList(textInputDlist) end end else - if WG['guishader'] then + if WG["guishader"] then if backgroundGuishader then - WG['guishader'].RemoveDlist('options') + WG["guishader"].RemoveDlist("options") backgroundGuishader = glDeleteList(backgroundGuishader) end if textInputDlist then - WG['guishader'].RemoveRect('optionsinput') + WG["guishader"].RemoveRect("optionsinput") textInputDlist = glDeleteList(textInputDlist) end end @@ -1607,8 +1604,8 @@ function widget:KeyPress(key) if not show then return false end - if key == 27 then -- ESC - if showTextInput and inputText ~= '' then + if key == 27 then -- ESC + if showTextInput and inputText ~= "" then clearChatInput() return true else @@ -1624,11 +1621,11 @@ function widget:KeyPress(key) end end - if key >= 282 and key <= 293 then -- Function keys + if key >= 282 and key <= 293 then -- Function keys return false end - if inputText == '' and guishaderedTabs then + if inputText == "" and guishaderedTabs then backgroundGuishader = glDeleteList(backgroundGuishader) end @@ -1637,18 +1634,18 @@ function widget:KeyPress(key) clearChatInput() elseif key == 8 then -- BACKSPACE if inputTextPosition > 0 then - inputText = utf8.sub(inputText, 1, inputTextPosition-1) .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition - 1) .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition - 1 end cursorBlinkTimer = 0 - if inputText == '' then + if inputText == "" then clearChatInput() else applyFilter() end elseif key == 127 then -- DELETE if inputTextPosition < utf8.len(inputText) then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition + 2) end cursorBlinkTimer = 0 applyFilter() @@ -1673,11 +1670,8 @@ function widget:KeyPress(key) inputTextPosition = utf8.len(inputText) cursorBlinkTimer = 0 elseif key == 273 then -- UP - elseif key == 274 then -- DOWN - elseif key == 9 then -- TAB - else -- regular chars/keys handled in widget:TextInput end @@ -1727,7 +1721,7 @@ function getSliderValue(draggingSlider, mx) elseif options[draggingSlider].step ~= nil then value = math.floor((value + (options[draggingSlider].step / 2)) / options[draggingSlider].step) * options[draggingSlider].step end - return value -- is a string now :( + return value -- is a string now :( end function widget:MouseWheel(up, value) @@ -1742,10 +1736,10 @@ function widget:MouseMove(mx, my) local newValue = getSliderValue(draggingSlider, mx) if options[draggingSlider].value ~= newValue then sliderValueChanged = true - applyOptionValue(draggingSlider, newValue) -- disabled so only on release it gets applied + applyOptionValue(draggingSlider, newValue) -- disabled so only on release it gets applied if playSounds and (lastSliderSound == nil or os_clock() - lastSliderSound > 0.04) then lastSliderSound = os_clock() - Spring.PlaySoundFile(sounds.sliderDrag, 0.4, 'ui') + Spring.PlaySoundFile(sounds.sliderDrag, 0.4, "ui") end end end @@ -1769,10 +1763,10 @@ function mouseEvent(mx, my, button, release) local titleClick = (titleRect and math_isInRect(mx, my, titleRect[1], titleRect[2], titleRect[3], titleRect[4])) local chatinputClick = (chatInputArea and math_isInRect(mx, my, chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4])) local tabClick - if not (inputText and inputText ~= '' and inputMode == '') and groupRect ~= nil then + if not (inputText and inputText ~= "" and inputMode == "") and groupRect ~= nil then for id, group in pairs(optionGroups) do if group.numOptions > 0 then - if devMode or devUI or group.id ~= 'dev' then + if devMode or devUI or group.id ~= "dev" then if math_isInRect(mx, my, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then if not release then currentGroupTab = group.id @@ -1780,7 +1774,7 @@ function mouseEvent(mx, my, button, release) showSelectOptions = nil selectClickAllowHide = nil if playSounds then - Spring.PlaySoundFile(sounds.paginatorClick, 0.9, 'ui') + Spring.PlaySoundFile(sounds.paginatorClick, 0.9, "ui") end end tabClick = true @@ -1803,7 +1797,7 @@ function mouseEvent(mx, my, button, release) startColumn = (totalColumns - maxShownColumns) + 1 end if playSounds then - Spring.PlaySoundFile(sounds.paginatorClick, 0.6, 'ui') + Spring.PlaySoundFile(sounds.paginatorClick, 0.6, "ui") end showSelectOptions = nil selectClickAllowHide = nil @@ -1814,7 +1808,7 @@ function mouseEvent(mx, my, button, release) startColumn = 1 end if playSounds then - Spring.PlaySoundFile(sounds.paginatorClick, 0.6, 'ui') + Spring.PlaySoundFile(sounds.paginatorClick, 0.6, "ui") end showSelectOptions = nil selectClickAllowHide = nil @@ -1834,7 +1828,7 @@ function mouseEvent(mx, my, button, release) if math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then applyOptionValue(showSelectOptions, o[5]) if playSounds then - Spring.PlaySoundFile(sounds.selectClick, 0.5, 'ui') + Spring.PlaySoundFile(sounds.selectClick, 0.5, "ui") end end end @@ -1856,46 +1850,42 @@ function mouseEvent(mx, my, button, release) if optionButtons then for i, o in pairs(optionButtons) do if options[i] then - if options[i].type == 'bool' and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then + if options[i].type == "bool" and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then applyOptionValue(i, not options[i].value) if playSounds then if options[i] and options[i].value then - Spring.PlaySoundFile(sounds.toggleOnClick, 0.75, 'ui') + Spring.PlaySoundFile(sounds.toggleOnClick, 0.75, "ui") else - Spring.PlaySoundFile(sounds.toggleOffClick, 0.75, 'ui') + Spring.PlaySoundFile(sounds.toggleOffClick, 0.75, "ui") end end - elseif options[i].type == 'slider' and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then - - elseif options[i].type == 'select' and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then - + elseif options[i].type == "slider" and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then + elseif options[i].type == "select" and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then elseif optionHover[i] and options[i].onclick ~= nil and math_isInRect(mx, my, optionHover[i][1], optionHover[i][2], optionHover[i][3], optionHover[i][4]) then options[i].onclick(i) end end end end - end - else -- press + else -- press if not showSelectOptions then for i, o in pairs(optionButtons) do if not options[i] then -- skip: options table was rebuilt and this index is stale - elseif options[i].type == 'slider' and (math_isInRect(mx, my, o.sliderXpos[1], o[2], o.sliderXpos[2], o[4]) or math_isInRect(mx, my, o[1], o[2], o[3], o[4])) then + elseif options[i].type == "slider" and (math_isInRect(mx, my, o.sliderXpos[1], o[2], o.sliderXpos[2], o[4]) or math_isInRect(mx, my, o[1], o[2], o[3], o[4])) then draggingSlider = i draggingSliderPreDragValue = options[draggingSlider].value local newValue = getSliderValue(draggingSlider, mx) if options[draggingSlider].value ~= newValue then - applyOptionValue(draggingSlider, getSliderValue(draggingSlider, mx)) -- disabled so only on release it gets applied + applyOptionValue(draggingSlider, getSliderValue(draggingSlider, mx)) -- disabled so only on release it gets applied if playSounds then - Spring.PlaySoundFile(sounds.sliderDrag, 0.3, 'ui') + Spring.PlaySoundFile(sounds.sliderDrag, 0.3, "ui") end end - elseif options[i].type == 'select' and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then - + elseif options[i].type == "select" and math_isInRect(mx, my, o[1], o[2], o[3], o[4]) then if playSounds then - Spring.PlaySoundFile(sounds.selectUnfoldClick, 0.6, 'ui') + Spring.PlaySoundFile(sounds.selectUnfoldClick, 0.6, "ui") end if showSelectOptions == nil then showSelectOptions = i @@ -1909,7 +1899,6 @@ function mouseEvent(mx, my, button, release) end end - local needsRedraw = windowClick or titleClick or tabClick if needsRedraw then if windowList then @@ -1922,7 +1911,7 @@ function mouseEvent(mx, my, button, release) return true elseif not tabClick then if release and draggingSlider == nil then - showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it show = false cancelChatInput() end @@ -1934,9 +1923,7 @@ end function GetWidgetToggleValue(widgetname) if widgetHandler.orderList[widgetname] == nil or widgetHandler.orderList[widgetname] == 0 then return false - elseif widgetHandler.orderList[widgetname] >= 1 - and widgetHandler.knownWidgets ~= nil - and widgetHandler.knownWidgets[widgetname] ~= nil then + elseif widgetHandler.orderList[widgetname] >= 1 and widgetHandler.knownWidgets ~= nil and widgetHandler.knownWidgets[widgetname] ~= nil then if widgetHandler.knownWidgets[widgetname].active then return true else @@ -1989,10 +1976,10 @@ function applyOptionValue(i, newValue, skipRedrawWindow, force) checkRequireRestart() end - if options[i].id ~= 'preset' and presets.lowest[options[i].id] ~= nil and manualChange then - if options[getOptionByID('preset')] then - options[getOptionByID('preset')].value = Spring.I18N('ui.settings.option.select_custom') - Spring.SetConfigString('graphicsPreset', 'custom') + if options[i].id ~= "preset" and presets.lowest[options[i].id] ~= nil and manualChange then + if options[getOptionByID("preset")] then + options[getOptionByID("preset")].value = Spring.I18N("ui.settings.option.select_custom") + Spring.SetConfigString("graphicsPreset", "custom") end end @@ -2010,7 +1997,7 @@ function applyOptionValue(i, newValue, skipRedrawWindow, force) end forceUpdate = true if id == "teamcolors" then - Spring.SendCommands("luarules reloadluaui") -- cause several widgets are still using old colors + Spring.SendCommands("luarules reloadluaui") -- cause several widgets are still using old colors end end @@ -2044,8 +2031,12 @@ local function fuzzyScore(query, target) local qi = 1 local qlen = #query local tlen = #target - if qlen == 0 then return 0 end - if qlen > tlen then return 0 end + if qlen == 0 then + return 0 + end + if qlen > tlen then + return 0 + end local score = 0 local consecutive = 0 @@ -2054,11 +2045,15 @@ local function fuzzyScore(query, target) local lastMatchPos = 0 for ti = 1, tlen do - if qi > qlen then break end + if qi > qlen then + break + end local tc = string.byte(target, ti) local qc = string.byte(query, qi) if tc == qc then - if not firstMatchPos then firstMatchPos = ti end + if not firstMatchPos then + firstMatchPos = ti + end qi = qi + 1 -- Gap penalty: penalize distance from previous match if lastMatchPos > 0 then @@ -2113,7 +2108,7 @@ end -- When a sub-option (name starts with widgetOptionColor) is matched, its parent option -- and the group label above it are also included for context. function applyFilter() - if inputText and inputText ~= '' and inputMode == '' then + if inputText and inputText ~= "" and inputMode == "" then local lowerInput = string.lower(inputText) -- Split input into words @@ -2145,7 +2140,9 @@ function applyFilter() local colorCodes = { widgetOptionColor, devOptionColor, advOptionColor, devMainOptionColor, advMainOptionColor } local function isSubOption(name) - if not name then return false end + if not name then + return false + end for _, prefix in ipairs(subPrefixes) do if string.sub(name, 1, #prefix) == prefix then return true @@ -2156,12 +2153,12 @@ function applyFilter() -- Pre-scan unfilteredOptions to build parent/label context for each option. -- Walking the ordered list: labels and non-sub options are "context". - local lastLabel = nil -- most recent label option (type == 'label') - local lastParent = nil -- most recent non-sub option - local optionLabel = {} -- optionLabel[i] = label option for unfilteredOptions[i] - local optionParent = {} -- optionParent[i] = parent option for unfilteredOptions[i] + local lastLabel = nil -- most recent label option (type == 'label') + local lastParent = nil -- most recent non-sub option + local optionLabel = {} -- optionLabel[i] = label option for unfilteredOptions[i] + local optionParent = {} -- optionParent[i] = parent option for unfilteredOptions[i] for i, option in ipairs(unfilteredOptions) do - if option.type == 'label' then + if option.type == "label" then lastLabel = option lastParent = nil elseif not isSubOption(option.name) then @@ -2174,7 +2171,7 @@ function applyFilter() local matched = {} for i, option in ipairs(unfilteredOptions) do - if option.name and option.name ~= '' and option.type and option.type ~= 'label' then + if option.name and option.name ~= "" and option.type and option.type ~= "label" then local name = option.name for _, code in ipairs(colorCodes) do name = string.gsub(name, code, "") @@ -2183,7 +2180,7 @@ function applyFilter() name = name:match("^%s*(.-)%s*$") or name local lowerName = string.lower(name) local lowerId = string.lower(option.id) - local lowerDesc = option.description and option.description ~= '' and string.lower(option.description) or '' + local lowerDesc = option.description and option.description ~= "" and string.lower(option.description) or "" local score = 0 @@ -2242,7 +2239,9 @@ function applyFilter() end -- Sort matched entries by score descending - table.sort(matched, function(a, b) return a.score > b.score end) + table.sort(matched, function(a, b) + return a.score > b.score + end) -- Rebuild with context: for each matched sub-option, prepend its label+parent if not yet shown local shown = {} @@ -2336,23 +2335,23 @@ function init() advmapshading = true, }, medium = { - bloomdeferred = true, + bloomdeferred = true, bloomdeferred_quality = 1, - ssao = true, + ssao = true, ssao_quality = 2, - mapedgeextension = true, - lighteffects = true, - lighteffects_additionalflashes = true, + mapedgeextension = true, + lighteffects = true, + lighteffects_additionalflashes = true, lighteffects_screenspaceshadows = 2, lighteffects_nanoparticlelights = true, distortioneffects = true, - snow = true, - particles = 20000, + snow = true, + particles = 20000, nanoparticletype = 2, decalsgl4 = 1, - decals = 2, + decals = 2, shadowslider = 4, - grass = true, + grass = true, losrange = true, attackrange_numrangesmult = 0.7, cusgl4 = true, @@ -2410,8 +2409,8 @@ function init() custom = {}, } - local screenModes = WG['screenMode'] and WG['screenMode'].GetScreenModes() or {} - local displays = WG['screenMode'] and WG['screenMode'].GetDisplays() or {} + local screenModes = WG["screenMode"] and WG["screenMode"].GetScreenModes() or {} + local displays = WG["screenMode"] and WG["screenMode"].GetDisplays() or {} local currentDisplay = 1 local v_sx, v_sy, v_px, v_py = Spring.GetViewGeometry() @@ -2419,7 +2418,7 @@ function init() local hasMultiDisplayOption = false for index, display in ipairs(displays) do if display.width > 0 then - displayNames[index] = index..": "..display.name .. " " .. display.width .. " × " .. display.height .. " (" .. display.hz.."hz)" + displayNames[index] = index .. ": " .. display.name .. " " .. display.width .. " × " .. display.height .. " (" .. display.hz .. "hz)" if v_px >= display.x and v_px < display.x + display.width and v_py >= display.y and v_py < display.y + display.height then currentDisplay = index end @@ -2434,7 +2433,7 @@ function init() local screenmodeOffset = 0 for _, screenMode in ipairs(screenModes) do if screenMode.display == currentDisplay then - resolutionNames[#resolutionNames+1] = screenMode.name + resolutionNames[#resolutionNames + 1] = screenMode.name elseif #resolutionNames == 0 then screenmodeOffset = screenmodeOffset + 1 end @@ -2447,37 +2446,37 @@ function init() end end - local soundDevices = { 'default' } - local soundDevicesByName = { [''] = 1 } + local soundDevices = { "default" } + local soundDevicesByName = { [""] = 1 } local infolog = VFS.LoadFile("infolog.txt") if infolog then local fileLines = string.lines(infolog) for i, line in ipairs(fileLines) do - if string.find(line, ' [', nil, true) then - local device = string.sub(string.match(line, ' %[([0-9a-zA-Z _%/%%-%(%)]*)'), 1) + if string.find(line, " [", nil, true) then + local device = string.sub(string.match(line, " %[([0-9a-zA-Z _%/%%-%(%)]*)"), 1) soundDevices[#soundDevices + 1] = device soundDevicesByName[device] = #soundDevices end -- scan for shader version error - if string.find(line, 'error: GLSL 1.50 is not supported', nil, true) then + if string.find(line, "error: GLSL 1.50 is not supported", nil, true) then Spring.SetConfigInt("LuaShaders", 0) end -- look for system hardware - if string.find(line, 'Physical CPU Cores', nil, true) then - if tonumber(string.match(line, '([0-9].*)')) and tonumber(string.match(line, '([0-9].*)')) <= 2 then + if string.find(line, "Physical CPU Cores", nil, true) then + if tonumber(string.match(line, "([0-9].*)")) and tonumber(string.match(line, "([0-9].*)")) <= 2 then isPotatoCpu = true end end - if string.find(line, 'Logical CPU Cores', nil, true) then - if tonumber(string.match(line, '([0-9].*)')) and tonumber(string.match(line, '([0-9].*)')) <= 2 then + if string.find(line, "Logical CPU Cores", nil, true) then + if tonumber(string.match(line, "([0-9].*)")) and tonumber(string.match(line, "([0-9].*)")) <= 2 then isPotatoCpu = true end end - if string.find(line:lower(), 'hardware config: ', nil, true) then - local s_ram = string.match(line, '([0-9]*MB RAM)') + if string.find(line:lower(), "hardware config: ", nil, true) then + local s_ram = string.match(line, "([0-9]*MB RAM)") if s_ram ~= nil then s_ram = string.gsub(s_ram, " RAM", "") if tonumber(s_ram) and tonumber(s_ram) > 0 and tonumber(s_ram) < 6500 then @@ -2495,51 +2494,51 @@ function init() -- restrict options for potato systems if isPotatoCpu or isPotatoGpu then if isPotatoCpu then - Spring.Echo('potato CPU detected') + Spring.Echo("potato CPU detected") end if isPotatoGpu then - Spring.Echo('potato Graphics Card detected') + Spring.Echo("potato Graphics Card detected") end end -- restric gfx preset options for potato gpu, lowest preset is added and high preset is removed if devMode or devUI then -- dev mode: show all presets so every quality level can be tested presetNames = { - Spring.I18N('ui.settings.option.select_lowest'), - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_high'), - Spring.I18N('ui.settings.option.select_ultra'), - Spring.I18N('ui.settings.option.select_custom') + Spring.I18N("ui.settings.option.select_lowest"), + Spring.I18N("ui.settings.option.select_low"), + Spring.I18N("ui.settings.option.select_medium"), + Spring.I18N("ui.settings.option.select_high"), + Spring.I18N("ui.settings.option.select_ultra"), + Spring.I18N("ui.settings.option.select_custom"), } elseif isPotatoGpu then presetNames = { - Spring.I18N('ui.settings.option.select_lowest'), - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_custom') + Spring.I18N("ui.settings.option.select_lowest"), + Spring.I18N("ui.settings.option.select_low"), + Spring.I18N("ui.settings.option.select_medium"), + Spring.I18N("ui.settings.option.select_custom"), } else presetNames = { - Spring.I18N('ui.settings.option.select_low'), - Spring.I18N('ui.settings.option.select_medium'), - Spring.I18N('ui.settings.option.select_high'), - Spring.I18N('ui.settings.option.select_ultra'), - Spring.I18N('ui.settings.option.select_custom') + Spring.I18N("ui.settings.option.select_low"), + Spring.I18N("ui.settings.option.select_medium"), + Spring.I18N("ui.settings.option.select_high"), + Spring.I18N("ui.settings.option.select_ultra"), + Spring.I18N("ui.settings.option.select_custom"), } end -- if you want to add an option it should be added here, and in applyOptionValue(), if option needs shaders than see the code below the options definition optionGroups = { - { id = 'gfx', name = Spring.I18N('ui.settings.group.graphics'), numOptions = 0 }, - { id = 'ui', name = Spring.I18N('ui.settings.group.interface'), numOptions = 0 }, - { id = 'game', name = Spring.I18N('ui.settings.group.game'), numOptions = 0 }, - { id = 'control', name = Spring.I18N('ui.settings.group.control'), numOptions = 0 }, - { id = 'sound', name = Spring.I18N('ui.settings.group.audio'), numOptions = 0 }, - { id = 'notif', name = Spring.I18N('ui.settings.group.notifications'), numOptions = 0 }, - { id = 'accessibility', name = Spring.I18N('ui.settings.group.accessibility'), numOptions = 0 }, - { id = 'custom', name = Spring.I18N('ui.settings.group.custom'), numOptions = 0 }, - { id = 'dev', name = Spring.I18N('ui.settings.group.dev'), numOptions = 0 }, + { id = "gfx", name = Spring.I18N("ui.settings.group.graphics"), numOptions = 0 }, + { id = "ui", name = Spring.I18N("ui.settings.group.interface"), numOptions = 0 }, + { id = "game", name = Spring.I18N("ui.settings.group.game"), numOptions = 0 }, + { id = "control", name = Spring.I18N("ui.settings.group.control"), numOptions = 0 }, + { id = "sound", name = Spring.I18N("ui.settings.group.audio"), numOptions = 0 }, + { id = "notif", name = Spring.I18N("ui.settings.group.notifications"), numOptions = 0 }, + { id = "accessibility", name = Spring.I18N("ui.settings.group.accessibility"), numOptions = 0 }, + { id = "custom", name = Spring.I18N("ui.settings.group.custom"), numOptions = 0 }, + { id = "dev", name = Spring.I18N("ui.settings.group.dev"), numOptions = 0 }, } if not currentGroupTab then @@ -2565,10 +2564,16 @@ function init() options = { --GFX - { id = "preset", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.preset'), type = "select", options = presetNames, + { + id = "preset", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.preset"), + type = "select", + options = presetNames, onload = function(i) - local preset = Spring.GetConfigString('graphicsPreset', 'custom') - local configSettingValues = { 'lowest', 'low', 'medium', 'high', 'ultra', 'custom' } + local preset = Spring.GetConfigString("graphicsPreset", "custom") + local configSettingValues = { "lowest", "low", "medium", "high", "ultra", "custom" } for k, value in pairs(configSettingValues) do if value == preset then options[i].value = k @@ -2577,13 +2582,15 @@ function init() end end, onchange = function(i, value) - local configSetting = 'custom' - local configSettingValues = { 'lowest', 'low', 'medium', 'high', 'ultra', 'custom' } + local configSetting = "custom" + local configSettingValues = { "lowest", "low", "medium", "high", "ultra", "custom" } configSetting = configSettingValues[value] - Spring.SetConfigString('graphicsPreset', configSetting) - if configSetting == 'custom' then return end + Spring.SetConfigString("graphicsPreset", configSetting) + if configSetting == "custom" then + return + end - Spring.Echo('Loading preset: ' .. options[i].options[value]) + Spring.Echo("Loading preset: " .. options[i].options[value]) manualChange = false for optionID, value in pairs(presets[configSetting]) do local i = getOptionByID(optionID) @@ -2599,43 +2606,58 @@ function init() manualChange = true end, }, - { id = "label_gfx_screen", group = "gfx", name = Spring.I18N('ui.settings.option.label_screen'), category = types.basic }, + { id = "label_gfx_screen", group = "gfx", name = Spring.I18N("ui.settings.option.label_screen"), category = types.basic }, { id = "label_gfx_screen_spacer", group = "gfx", category = types.basic }, - { id = "display", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.display'), type = "select", options = displayNames, value = currentDisplay, + { + id = "display", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.display"), + type = "select", + options = displayNames, + value = currentDisplay, onchange = function(i, value) --currentDisplay = value selectedDisplay = value - Spring.SetConfigInt('SelectedDisplay', value) + Spring.SetConfigInt("SelectedDisplay", value) resolutionNames = {} screenmodeOffset = 0 for _, screenMode in ipairs(screenModes) do if screenMode.display == selectedDisplay then - resolutionNames[#resolutionNames+1] = screenMode.name + resolutionNames[#resolutionNames + 1] = screenMode.name elseif #resolutionNames == 0 then screenmodeOffset = screenmodeOffset + 1 end end - options[getOptionByID('resolution')].options = resolutionNames + options[getOptionByID("resolution")].options = resolutionNames if selectedDisplay == currentDisplay then - options[getOptionByID('resolution')].value = Spring.GetConfigInt('SelectedScreenMode', 1) + options[getOptionByID("resolution")].value = Spring.GetConfigInt("SelectedScreenMode", 1) else - options[getOptionByID('resolution')].value = 0 + options[getOptionByID("resolution")].value = 0 end forceUpdate = true end, }, - { id = "resolution", group = "gfx", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.resolution'), type = "select", options = resolutionNames, value = Spring.GetConfigInt('SelectedScreenMode', 1), description = Spring.I18N('ui.settings.option.resolution_descr'), - onload = function(i, value) + { + id = "resolution", + group = "gfx", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.resolution"), + type = "select", + options = resolutionNames, + value = Spring.GetConfigInt("SelectedScreenMode", 1), + description = Spring.I18N("ui.settings.option.resolution_descr"), + onload = function(i, value) -- FIXME: disabled for now due to "Now whenever i do fullscreen or borderless the game will go to monitor 2 regardless of the chosen option. (I want the game on monitor 1)." --if Spring.GetConfigInt('SelectedScreenMode', -1) >= 1 then -- chobby sets SelectedScreenMode to -1 when it changes game window mode -- WG['screenMode'].SetScreenMode(Spring.GetConfigInt('SelectedScreenMode', 1)) --end end, onchange = function(i, value) - Spring.SetConfigInt('SelectedScreenMode', value) + Spring.SetConfigInt("SelectedScreenMode", value) - if WG['screenMode'] then - WG['screenMode'].SetScreenMode(value+screenmodeOffset) + if WG["screenMode"] then + WG["screenMode"].SetScreenMode(value + screenmodeOffset) currentDisplay = 1 local v_sx, v_sy, v_px, v_py = Spring.GetViewGeometry() for index, display in ipairs(displays) do @@ -2646,3879 +2668,6831 @@ function init() end end, }, - { id = "dualmode_enabled", group = "gfx", category = types.dev, name = Spring.I18N('ui.settings.option.dualmode'), type = "bool", value = Spring.GetConfigInt("DualScreenMode"), description = Spring.I18N('ui.settings.option.dualmode_enabled_descr'), - onchange = function(_, value) - Spring.SetConfigInt("DualScreenMode", value and 1 or 0) - end, - }, - { id = "dualmode_left", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dualmode_left'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapOnLeft"), description = Spring.I18N('ui.settings.option.dualmode_left_descr'), - onchange = function(_, value) - Spring.SetConfigInt("DualScreenMiniMapOnLeft", value and 1 or 0) - end, - }, - { id = "dualmode_minimap_aspectratio", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dualmode_minimap_aspectratio'), type = "bool", value = Spring.GetConfigInt("DualScreenMiniMapAspectRatio"), description = Spring.I18N('ui.settings.option.dualmode_minimap_aspectratio_descr'), - onchange = function(_, value) - Spring.SetConfigInt("DualScreenMiniMapAspectRatio", value and 1 or 0) - end, - }, - { id = "vsync", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.vsync'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), Spring.I18N('ui.settings.option.select_enabled'), Spring.I18N('ui.settings.option.select_adaptive')}, value = 2, description = Spring.I18N('ui.settings.option.vsync_descr'), - onload = function(i) - local vsync = Spring.GetConfigInt("VSyncGame", -1) - if vsync > 0 then - options[i].value = 2 - elseif vsync < 0 then - options[i].value = 3 - else - options[i].value = 1 - end - end, - onchange = function(i, value) - local vsync = 0 - if value == 2 then - vsync = Spring.GetConfigInt("VSyncFraction", 1) - elseif value == 3 then - vsync = -Spring.GetConfigInt("VSyncFraction", 1) - end - Spring.SetConfigInt("VSync", vsync) - Spring.SetConfigInt("VSyncGame", vsync) -- stored here as assurance cause lobby/game also changes vsync when idle and lobby could think game has set vsync 4 after a hard crash - end, - }, - { id = "vsync_fraction", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.vsync_fraction'), min = 1, max = 4, step = 1, type = "slider", value = Spring.GetConfigInt("VSyncFraction", 1), description = Spring.I18N('ui.settings.option.vsync_fraction_descr'), - onchange = function(i, value) - Spring.SetConfigInt("VSyncFraction", value) - local vsync = Spring.GetConfigInt("VSyncGame", -1) - if vsync ~= 0 then - Spring.SetConfigInt("VSync", vsync*value) - end - end, - }, - - { id = "limitoffscreenfps", group = "gfx", category = types.advanced, widget = "Limit idle FPS", name = Spring.I18N('ui.settings.option.limitoffscreenfps'), type = "bool", value = GetWidgetToggleValue("Limit idle FPS"), description = Spring.I18N('ui.settings.option.limitoffscreenfps_descr') }, - { id = "limitidlefps", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.limitidlefps'), type = "bool", value = (Spring.GetConfigInt("LimitIdleFps", 0) == 1), description = Spring.I18N('ui.settings.option.limitidlefps_descr'), - onchange = function(i, value) - Spring.SetConfigInt("LimitIdleFps", (value and 1 or 0)) - end, - }, - - { id = "msaa", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.msaa'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), 'x2', 'x4', 'x8'}, restart = true, value = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0), description = Spring.I18N('ui.settings.option.msaa_descr'), - onload = function(i) - local msaa = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0) - if msaa <= 0 then - options[getOptionByID('msaa')].value = 1 - else - for k,v in ipairs( options[getOptionByID('msaa')].options) do - if v == 'x'..msaa then - options[getOptionByID('msaa')].value = k - break - end - end - end - end, - onchange = function(i, value) - if value == 1 then - Spring.SetConfigInt("MSAA", 0) - Spring.SetConfigInt("MSAALevel", -1) -- setting 0 will reset it to default x4 :( - else - Spring.SetConfigInt("MSAA", 1) - Spring.SetConfigInt("MSAALevel", tonumber(string.sub(options[getOptionByID('msaa')].options[value], 2))) - end - end, - }, - - { id = "supersampling", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.supersampling'), type = "bool", restart = false, value = (Spring.GetConfigFloat("MinSampleShadingRate", 0.0) == 1.0), description = Spring.I18N('ui.settings.option.supersampling_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("MinSampleShadingRate", (value and 1.0 or 0.0)) - end, - }, - - { id = "cas_sharpness", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.cas_sharpness'), min = 0.5, max = 1.1, step = 0.01, type = "slider", value = 1.0, description = Spring.I18N('ui.settings.option.cas_sharpness_descr'), - onload = function(i) - loadWidgetData("Contrast Adaptive Sharpen", "cas_sharpness", { 'SHARPNESS' }) - end, - onchange = function(i, value) - if not GetWidgetToggleValue("Contrast Adaptive Sharpen") then - widgetHandler:EnableWidget("Contrast Adaptive Sharpen") - end - saveOptionValue('Contrast Adaptive Sharpen', 'cas', 'setSharpness', { 'SHARPNESS' }, options[getOptionByID('cas_sharpness')].value) - end, - }, - - { id = "sepiatone", group = "gfx", category = types.advanced, widget = "Sepia Tone", name = Spring.I18N('ui.settings.option.sepiatone'), type = "bool", value = GetWidgetToggleValue("Sepia Tone") }, - { id = "sepiatone_gamma", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_gamma'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, - onload = function(i) - loadWidgetData("Sepia Tone", "sepiatone_gamma", { 'gamma' }) - end, - onchange = function(i, value) - saveOptionValue('Sepia Tone', 'sepia', 'setGamma', { 'gamma' }, value) - end, - }, - { id = "sepiatone_saturation", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_saturation'), min = 0, max = 1, step = 0.02, type = "slider", value = 0.5, - onload = function(i) - loadWidgetData("Sepia Tone", "sepiatone_saturation", { 'saturation' }) - end, - onchange = function(i, value) - saveOptionValue('Sepia Tone', 'sepia', 'setSaturation', { 'saturation' }, value) - end, - }, - { id = "sepiatone_contrast", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_contrast'), min = 0.1, max = 0.9, step = 0.02, type = "slider", value = 0.5, - onload = function(i) - loadWidgetData("Sepia Tone", "sepiatone_contrast", { 'contrast' }) - end, - onchange = function(i, value) - saveOptionValue('Sepia Tone', 'sepia', 'setContrast', { 'contrast' }, value) - end, - }, - { id = "sepiatone_sepia", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_sepia'), min = 0, max = 0.5, step = 0.02, type = "slider", value = 0.5, description = Spring.I18N('ui.settings.option.sepiatone_sepia_descr'), - onload = function(i) - loadWidgetData("Sepia Tone", "sepiatone_sepia", { 'sepia' }) - end, - onchange = function(i, value) - saveOptionValue('Sepia Tone', 'sepia', 'setSepia', { 'sepia' }, value) - end, - }, - { id = "sepiatone_shadeui", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sepiatone_shadeui'), type = "bool", value = 0, - onload = function(i) - loadWidgetData("Sepia Tone", "sepiatone_shadeui", { 'shadeUI' }) - end, - onchange = function(i, value) - saveOptionValue('Sepia Tone', 'sepia', 'setShadeUI', { 'shadeUI' }, value) - end, - }, - - - { id = "label_gfx_lighting", group = "gfx", name = Spring.I18N('ui.settings.option.label_lighting'), category = types.basic }, - { id = "label_gfx_lighting_spacer", group = "gfx", category = types.basic }, - - - { id = "advmapshading", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.advmapshading'), type = "bool", value = (Spring.GetConfigInt("AdvMapShading", 1) == 1), description = Spring.I18N('ui.settings.option.advmapshading_descr'), - onchange = function(i, value) - Spring.SetConfigInt("AdvMapShading", (value and 1 or 0)) - Spring.SendCommands("advmapshading "..(value and '1' or '0')) - end, - }, - - { id = "cusgl4", group = "gfx", name = Spring.I18N('ui.settings.option.cus'), category = types.basic, type = "bool", value = (Spring.GetConfigInt("cus2", 1) == 1), description = Spring.I18N('ui.settings.option.cus_descr'), - onchange = function(i, value) - if value == 0.5 then - Spring.SendCommands("luarules disablecusgl4") - else - Spring.SetConfigInt("cus2", (value and 1 or 0)) - Spring.SendCommands("luarules "..(value and 'reloadcusgl4' or 'disablecusgl4')) - end - end, - }, - - { id = "shadowslider", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.shadowslider'), type = "select", options = { Spring.I18N('ui.settings.option.select_off'), Spring.I18N('ui.settings.option.select_lowest'), Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high'), Spring.I18N('ui.settings.option.select_ultra')}, value = Spring.GetConfigInt("ShadowQuality", 3)+1, description = Spring.I18N('ui.settings.option.shadowslider_descr'), - onchange = function(i, value) - Spring.SetConfigInt("ShadowQuality", value - 1) - adjustShadowQuality() - end, - }, - - { id = "shadows_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.shadows_opacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = gl.GetSun("shadowDensity"), description = '', - onchange = function(i, value) - Spring.SetSunLighting({ groundShadowDensity = value, modelShadowDensity = value }) - end, - }, - - { id = "ssao", group = "gfx", category = types.basic, widget = "SSAO", name = Spring.I18N('ui.settings.option.ssao'), type = "bool", value = GetWidgetToggleValue("SSAO"), description = Spring.I18N('ui.settings.option.ssao_descr') }, - { id = "ssao_strength", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ssao_strength'), type = "slider", min = 5, max = 15, step = 1, value = 10, description = '', - onload = function(i) - loadWidgetData("SSAO", "ssao_strength", { 'strength' }) - end, - onchange = function(i, value) - saveOptionValue('SSAO', 'ssao', 'setStrength', { 'strength' }, value) - end, - }, - { id = "ssao_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ssao_quality'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high')}, value = (WG['ssao'] ~= nil and WG['ssao'].getPreset() or 2), description = Spring.I18N('ui.settings.option.ssao_quality_descr'), - onload = function(i) - if widgetHandler.configData["SSAO"] ~= nil and widgetHandler.configData["SSAO"].preset ~= nil then - options[getOptionByID('ssao_quality')].value = widgetHandler.configData["SSAO"].preset - end - end, - onchange = function(i, value) - saveOptionValue('SSAO', 'ssao', 'setPreset', { 'preset' }, value) - end, - }, - - { id = "bloomdeferred", group = "gfx", category = types.basic, widget = "Bloom Shader Deferred", name = Spring.I18N('ui.settings.option.bloomdeferred'), type = "bool", value = GetWidgetToggleValue("Bloom Shader Deferred"), description = Spring.I18N('ui.settings.option.bloomdeferred_descr') }, - { id = "bloomdeferredbrightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.bloomdeferredbrightness'), type = "slider", min = 0.5, max = 2.0, step = 0.05, value = 1.0, description = '', - onload = function(i) - loadWidgetData("Bloom Shader Deferred", "bloomdeferredbrightness", { 'glowAmplifier' }) - end, - onchange = function(i, value) - saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setBrightness', { 'glowAmplifier' }, value) - end, - }, - { id = "bloomdeferred_quality", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.bloomdeferred_quality'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_medium'), Spring.I18N('ui.settings.option.select_high')}, value = (WG['bloomdeferred'] ~= nil and WG['bloomdeferred'].getPreset() or 2), description = Spring.I18N('ui.settings.option.bloomdeferred_quality_descr'), - onload = function(i) - if widgetHandler.configData["Bloom Shader Deferred"] ~= nil and widgetHandler.configData["Bloom Shader Deferred"].preset ~= nil then - options[getOptionByID('bloomdeferred_quality')].value = widgetHandler.configData["Bloom Shader Deferred"].preset - end - end, - onchange = function(i, value) - saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setPreset', { 'preset' }, value) - end, - }, - - { id = "lighteffects", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.lighteffects'), type = "bool", value = GetWidgetToggleValue("Deferred rendering GL4"), description = Spring.I18N('ui.settings.option.lighteffects_descr'), - onload = function(i) - end, - onchange = function(i, value) - if value then - widgetHandler:EnableWidget("Deferred rendering GL4") - else - widgetHandler:DisableWidget("Deferred rendering GL4") - end - end, - }, - { id = "lighteffects_headlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_headlights'), type = "bool", value = Spring.GetConfigInt("headlights", 1) == 1, description = Spring.I18N('ui.settings.option.lighteffects_headlights_descr'), - onchange = function(i, value) - Spring.SetConfigInt("headlights", value and 1 or 0) - if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then - widgetHandler:DisableWidget("Deferred rendering GL4") - widgetHandler:EnableWidget("Deferred rendering GL4") - end - end, - }, - { id = "lighteffects_buildlights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_buildlights'), type = "bool", value = Spring.GetConfigInt("buildlights", 1) == 1, description = Spring.I18N('ui.settings.option.lighteffects_buildlights_descr'), - onchange = function(i, value) - Spring.SetConfigInt("buildlights", value and 1 or 0) - if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then - widgetHandler:DisableWidget("Deferred rendering GL4") - widgetHandler:EnableWidget("Deferred rendering GL4") - end - end, - }, - { id = "lighteffects_brightness", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_brightness'), min = 0.4, max = 1.5, step = 0.05, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.lighteffects_brightness_descr'), - onload = function(i) - loadWidgetData("Deferred rendering GL4", "lighteffects_brightness", { 'intensityMultiplier' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'IntensityMultiplier', { 'intensityMultiplier' }, value) - end, - }, - { id = "lighteffects_radius", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_radius'), min = 0.4, max = 1.2, step = 0.05, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.lighteffects_radius_descr'), - onload = function(i) - loadWidgetData("Deferred rendering GL4", "lighteffects_radius", { 'radiusMultiplier' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'RadiusMultiplier', { 'radiusMultiplier' }, value) - end, - }, - - { id = "lighteffects_screenspaceshadows", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lighteffects_screenspaceshadows'), min = 0, max = 4, step = 1, type = "slider", value = 2, description = Spring.I18N('ui.settings.option.lighteffects_screenspaceshadows_descr'), - onload = function(i) - loadWidgetData("Deferred rendering GL4", "lighteffects_screenspaceshadows", { 'screenSpaceShadows' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'ScreenSpaceShadows', { 'screenSpaceShadows' }, value) - end, - }, - - { id = "lighteffects_nanoparticlelights", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.nanoparticlelights'), type = "bool", value = Spring.GetConfigInt("NanoParticleLights", 1) == 1, description = Spring.I18N('ui.settings.option.nanoparticlelights_descr'), - onchange = function(i, value) - Spring.SetConfigInt("NanoParticleLights", value and 1 or 0) - end, - }, - - { id = "distortioneffects", group = "gfx", category = types.basic, widget = "Distortion GL4", name = Spring.I18N('ui.settings.option.distortioneffects'), type = "bool", value = GetWidgetToggleValue("Distortion GL4"), description = Spring.I18N('ui.settings.option.distortioneffects_descr') }, - - { id = "darkenmap", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.darkenmap'), min = 0, max = 0.33, step = 0.01, type = "slider", value = 0, description = Spring.I18N('ui.settings.option.darkenmap_descr'), - onload = function(i) - loadWidgetData("Darken map", "darkenmap", { 'darknessvalue' }) - end, - onchange = function(i, value) - saveOptionValue('Darken map', 'darkenmap', 'setMapDarkness', { 'darknessvalue' }, value) - end, - }, - - { id = "label_gfx_environment", group = "gfx", name = Spring.I18N('ui.settings.option.label_environment'), category = types.basic }, - { id = "label_gfx_environment_spacer", group = "gfx", category = types.basic }, - - { id = "featuredrawdist", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.featuredrawdist'), type = "slider", min = 2500, max = 40000, step = 500, value = tonumber(Spring.GetConfigInt("FeatureDrawDistance", 10000)), description = Spring.I18N('ui.settings.option.featuredrawdist_descr'), - onchange = function(i, value) - Spring.SetConfigInt("FeatureFadeDistance", math.floor(value * 0.8)) - Spring.SetConfigInt("FeatureDrawDistance", value) - end, - }, - - { id = "losopacity", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.lineofsight')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losopacity'), type = "slider", min = 0.01, max = 1, step = 0.01, value = (WG['los'] ~= nil and WG['los'].getOpacity ~= nil and WG['los'].getOpacity()) or 0.66, description = '', - onload = function(i) - loadWidgetData("LOS colors", "losopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('LOS colors', 'los', 'setOpacity', { 'opacity' }, value) - end, - }, - - { id = "fogdiaglines", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.lineofsight')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fogdiaglines'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG.fogdiaglines ~= nil and WG.fogdiaglines.getStrength ~= nil and WG.fogdiaglines.getStrength()) or 0.30, description = '', - onload = function(i) - loadWidgetData("Fog Diagonal Lines GL4", "fogdiaglines", { 'strength' }) - end, - onchange = function(i, value) - saveOptionValue('Fog Diagonal Lines GL4', 'fogdiaglines', 'setStrength', { 'strength' }, value) - end, - }, - - { id = "fogdiaglines_blur", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.lineofsight')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fogdiaglines_blur'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG.fogdiaglines ~= nil and WG.fogdiaglines.getBlurriness ~= nil and WG.fogdiaglines.getBlurriness()) or 0.187, description = '', - onload = function(i) - loadWidgetData("Fog Diagonal Lines GL4", "fogdiaglines_blur", { 'blurriness' }) - end, - onchange = function(i, value) - saveOptionValue('Fog Diagonal Lines GL4', 'fogdiaglines', 'setBlurriness', { 'blurriness' }, value) - end, - }, - - { id = "territorial_domination_height_opacity", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.territorial_domination_height_opacity'), type = "slider", min = 0.5, max = 2.0, step = 0.05, value = Spring.GetConfigFloat("territorial_domination_height_opacity", 1.0), description = Spring.I18N('ui.settings.option.territorial_domination_height_opacity_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("territorial_domination_height_opacity", value) - end, - }, - - { id = "water", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.water'), type = "select", options = { Spring.I18N('ui.settings.option.select_low'), Spring.I18N('ui.settings.option.select_high') }, value = desiredWaterValue == 4 and 2 or 1, - onload = function(i) - end, - onchange = function(i, value) - desiredWaterValue = value > 1 and 4 or 0 - if waterDetected then - if desiredWaterValue > 0 then desiredWaterValue = 4 end - Spring.SendCommands("water " .. desiredWaterValue) - Spring.SetConfigInt("water", 4) - end - end, - }, - - { id = "mapedgeextension", group = "gfx", category = types.advanced, widget = "Map Edge Extension", name = Spring.I18N('ui.settings.option.mapedgeextension'), type = "bool", value = GetWidgetToggleValue("Map Edge Extension"), description = Spring.I18N('ui.settings.option.mapedgeextension_descr') }, - - { id = "mapedgeextension_brightness", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mapedgeextension_brightness'), min = 0.2, max = 1, step = 0.01, type = "slider", value = 0.3, description = '', - onload = function(i) - loadWidgetData("Map Edge Extension", "mapedgeextension_brightness", { 'brightness' }) - end, - onchange = function(i, value) - saveOptionValue('Map Edge Extension', 'mapedgeextension', 'setBrightness', { 'brightness' }, value) - end, - }, - { id = "mapedgeextension_curvature", category = types.dev, group = "gfx", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mapedgeextension_curvature'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.mapedgeextension_curvature_descr'), - onload = function(i) - loadWidgetData("Map Edge Extension", "mapedgeextension_curvature", { 'curvature' }) - end, - onchange = function(i, value) - saveOptionValue('Map Edge Extension', 'mapedgeextension', 'setCurvature', { 'curvature' }, value) - end, - }, - - { id = "decalsgl4", group = "gfx", category = types.basic, widget = "Decals GL4", name = Spring.I18N('ui.settings.option.decalsgl4'), type = "bool", value = GetWidgetToggleValue("Decals GL4") }, - { id = "decalsgl4_lifetime", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.decalsgl4_lifetime'), min = 0.5, max = 8, step = 0.1, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.decalsgl4_lifetime_descr'), - onload = function(i) - loadWidgetData("Decals GL4", "decalsgl4_lifetime", { 'lifeTimeMult' }) - end, - onchange = function(i, value) - saveOptionValue('Decals GL4', 'decalsgl4', 'SetLifeTimeMult', { 'lifeTimeMult' }, value) - end, - }, - { id = "decals", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.decals'), restart = true, min = 0, max = 3, step = 1, type = "slider", value = Spring.GetConfigInt("GroundDecals", 0), description = Spring.I18N('ui.settings.option.decals_descr'), - onchange = function(i, value) - Spring.SetConfigInt("GroundDecals", value) - Spring.SendCommands("GroundDecals " .. value) - end, - }, - - { id = "grass", group = "gfx", category = types.basic, widget = "Map Grass GL4", name = Spring.I18N('ui.settings.option.grass'), type = "bool", value = GetWidgetToggleValue("Map Grass GL4"), description = Spring.I18N('ui.settings.option.grass_desc') }, - { id = "grassdistance", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.grassdistance'), type = "slider", min = 0.3, max = 1, step = 0.01, value = 1, description = Spring.I18N('ui.settings.option.grassdistance_desc'), - onload = function(i) - loadWidgetData("Map Grass GL4", "grassdistance", { 'distanceMult' }) - end, - onchange = function(i, value) - saveOptionValue('Map Grass GL4', 'grassgl4', 'setDistanceMult', { 'distanceMult' }, value) - end, - }, - - { id = "treewind", group = "gfx", category = types.dev, name = Spring.I18N('ui.settings.option.treewind'), type = "bool", value = tonumber(Spring.GetConfigInt("TreeWind", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.treewind_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SendCommands("luarules treewind " .. (value and 1 or 0)) - Spring.SetConfigInt("TreeWind", (value and 1 or 0)) - end, - }, - - { id = "snow", group = "gfx", category = types.basic, widget = "Snow", name = Spring.I18N('ui.settings.option.snow'), type = "bool", value = GetWidgetToggleValue("Snow"), description = Spring.I18N('ui.settings.option.snow_descr') }, - { id = "snowmap", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowmap'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.snowmap_descr'), - onload = function(i) - loadWidgetData("Snow", "snowmap", { 'snowMaps', Game.mapName:lower() }) - end, - onchange = function(i, value) - saveOptionValue('Snow', 'snow', 'setSnowMap', { 'snowMaps', Game.mapName:lower() }, value) - end, - }, - { id = "snowautoreduce", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowautoreduce'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.snowautoreduce_descr'), - onload = function(i) - loadWidgetData("Snow", "snowautoreduce", { 'autoReduce' }) - end, - onchange = function(i, value) - saveOptionValue('Snow', 'snow', 'setAutoReduce', { 'autoReduce' }, value) - end, - }, - { id = "snowamount", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.snowamount'), type = "slider", min = 0.2, max = 3, step = 0.2, value = 1, description = Spring.I18N('ui.settings.option.snowamount_descr'), - onload = function(i) - loadWidgetData("Snow", "snowamount", { 'customParticleMultiplier' }) - end, - onchange = function(i, value) - saveOptionValue('Snow', 'snow', 'setMultiplier', { 'customParticleMultiplier' }, value) - end, - }, - - { id = "clouds", group = "gfx", category = types.advanced, widget = "Volumetric Clouds", name = Spring.I18N('ui.settings.option.clouds'), type = "bool", value = GetWidgetToggleValue("Volumetric Clouds"), description = '' }, - { id = "clouds_opacity", group = "gfx", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.clouds_opacity'), type = "slider", min = 0.2, max = 1.4, step = 0.05, value = 1, description = '', - onload = function(i) - loadWidgetData("Volumetric Clouds", "clouds_opacity", { 'opacityMult' }) - end, - onchange = function(i, value) - saveOptionValue('Volumetric Clouds', 'clouds', 'setOpacity', { 'opacityMult' }, value) - end, - }, - { id = "fogmult", group = "gfx", category = types.advanced, name = Spring.I18N('ui.settings.option.fog'), type = "slider", min = 0, max = 1, step = 0.01, value = Spring.GetConfigFloat("FogMult", 1), description = Spring.I18N('ui.settings.option.fogmult_descr'), - onload = function(i) - options[i].onchange(i, options[i].value) - end, - onchange = function(i, value) - Spring.SetConfigFloat("FogMult", value) - value = 1 / value -- inverse - local newFogStart = math.min(9, (defaultMapFog.fogStart * ((value+4)*0.2))) - local newFogEnd = math.min(9, defaultMapFog.fogEnd * ((value+1)*0.5)) - if newFogStart >= newFogEnd then newFogStart = newFogEnd - 0.01 end - Spring.SetAtmosphere({ fogStart = newFogStart, fogEnd = newFogEnd }) - end, - }, - - { id = "label_gfx_effects", group = "gfx", name = Spring.I18N('ui.settings.option.label_effects'), category = types.basic }, - { id = "label_gfx_effects_spacer", group = "gfx", category = types.basic }, - - { id = "particles", group = "gfx", category = types.basic, name = Spring.I18N('ui.settings.option.particles'), type = "slider", min = 10000, max = 40000, step = 1000, value = tonumber(Spring.GetConfigInt("MaxParticles", 1) or 15000), description = Spring.I18N('ui.settings.option.particles_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("MaxParticles", value) - -- Keep the engine nano-spray budget in sync when the gadget is - -- handing particles back to the engine (NanoParticleMode 0). - if Spring.GetConfigInt("NanoParticleMode", 1) == 0 then - Spring.SetConfigInt("MaxNanoParticles", math.floor(value * 0.34)) - if Spring.GetConfigInt("NanoParticleMode", 1) == 0 then - Spring.SetConfigInt("MaxNanoParticles", math.floor(Spring.GetConfigInt("MaxParticles", 15000) * 0.34)) - else - Spring.SetConfigInt("MaxNanoParticles", 0) - end - end - end, - }, - - { id = "nanoparticletype", group = "gfx", category = types.basic, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.nanoparticletype'), - type = "select", - options = { - Spring.I18N('ui.settings.option.nanoparticletype_simple'), - Spring.I18N('ui.settings.option.nanoparticletype_shapes'), - }, - value = (tonumber(Spring.GetConfigInt("NanoParticleMode", 1)) or 1) + 1, - description = Spring.I18N('ui.settings.option.nanoparticletype_descr'), - onload = function(i) - end, - onchange = function(i, value) - local mode = value - 1 - Spring.SetConfigInt("NanoParticleMode", mode) - if mode == 0 then - Spring.SetConfigInt("MaxNanoParticles", math.floor(Spring.GetConfigInt("MaxParticles", 15000) * 0.34)) - else - Spring.SetConfigInt("MaxNanoParticles", 0) - end - end, - }, - - { id = "dof", group = "gfx", category = types.advanced, widget = "Depth of Field", name = Spring.I18N('ui.settings.option.dof'), type = "bool", value = GetWidgetToggleValue("Depth of Field"), description = Spring.I18N('ui.settings.option.dof_descr') }, - { id = "dof_autofocus", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dof_autofocus'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.dof_autofocus_descr'), - onload = function(i) - loadWidgetData("Depth of Field", "dof_autofocus", { 'autofocus' }) - end, - onchange = function(i, value) - saveOptionValue('Depth of Field', 'dof', 'setAutofocus', { 'autofocus' }, value) - end, - }, - { id = "dof_fstop", group = "gfx", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.dof_fstop'), type = "slider", min = 1, max = 6, step = 0.1, value = 2, description = Spring.I18N('ui.settings.option.dof_fstop_descr'), - onload = function(i) - loadWidgetData("Depth of Field", "dof_fstop", { 'fStop' }) - end, - onchange = function(i, value) - saveOptionValue('Depth of Field', 'dof', 'setFstop', { 'fStop' }, value) - end, + { + id = "dualmode_enabled", + group = "gfx", + category = types.dev, + name = Spring.I18N("ui.settings.option.dualmode"), + type = "bool", + value = Spring.GetConfigInt("DualScreenMode"), + description = Spring.I18N("ui.settings.option.dualmode_enabled_descr"), + onchange = function(_, value) + Spring.SetConfigInt("DualScreenMode", value and 1 or 0) + end, }, - - - -- SOUND - { id = "snddevice", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.snddevice'), type = "select", restart = true, options = soundDevices, value = soundDevicesByName[Spring.GetConfigString("snd_device")], description = Spring.I18N('ui.settings.option.snddevice_descr'), - onchange = function(i, value) - if options[i].options[options[i].value] == 'default' then - Spring.SetConfigString("snd_device", '') - else - Spring.SetConfigString("snd_device", options[i].options[options[i].value]) - end - end, - }, - - { id = "sndvolmaster", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.volume') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolmaster'), type = "slider", min = 0, max = 80, step = 2, value = tonumber(Spring.GetConfigInt("snd_volmaster", 1) or 80), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("snd_volmaster", value) - end, - }, - { id = "sndvolgeneral", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolgeneral'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volgeneral", 1) or 100), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("snd_volgeneral", value) - end, - }, - { id = "sndvolbattle", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolbattle'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volbattle_options", 100) or 100), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("snd_volbattle_options", value) - end, - }, - { id = "sndvolui", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolui'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volui", 1) or 100), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("snd_volui", value) - end, + { + id = "dualmode_left", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.dualmode_left"), + type = "bool", + value = Spring.GetConfigInt("DualScreenMiniMapOnLeft"), + description = Spring.I18N("ui.settings.option.dualmode_left_descr"), + onchange = function(_, value) + Spring.SetConfigInt("DualScreenMiniMapOnLeft", value and 1 or 0) + end, }, - --{ id = "sndambient", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolambient'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volambient", 1) or 100), - -- onload = function(i) - -- end, - -- onchange = function(i, value) - -- Spring.SetConfigInt("snd_volambient", value) - -- end, - --}, - --{ id = "sndvolunitreply", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolunitreply'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volunitreply", 1) or 100), - -- onload = function(i) - -- end, - -- onchange = function(i, value) - -- Spring.SetConfigInt("snd_volunitreply", value) - -- end, - --}, - { id = "console_chatvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_chatvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getChatVolume() or 0), description = Spring.I18N('ui.settings.option.console_chatvolume_descr'), - onload = function(i) - loadWidgetData("Chat", "console_chatvolume", { 'sndChatFileVolume' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setChatVolume', { 'sndChatFileVolume' }, value) - end, - }, - { id = "mapmarkvolume", group = "sound", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_mapmarkvolume'), type = "slider", min = 0, max = 1, step = 0.01, value = (WG['mapmarkping'] ~= nil and WG['mapmarkping'].getMapmarkVolume() or 0.6), description = Spring.I18N('ui.settings.option.console_mapmarkvolume_descr'), - onload = function(i) - loadWidgetData("Chat", "mapmarkvolume", { 'volume' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'mapmarkping', 'setMapmarkVolume', { 'volume' }, value) - end, - }, - { id = "sndvolmusic", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolmusic'), type = "slider", min = 0, max = 99, step = 1, value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50), - onload = function(i) - end, - onchange = function(i, value) - if WG['music'] and WG['music'].SetMusicVolume then - WG['music'].SetMusicVolume(value) - else - Spring.SetConfigInt("snd_volmusic", value) - end - end, - }, - - { id = "sndunitsound", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndunitsound'), type = "bool", value = (Spring.GetConfigInt("snd_unitsound", 1) == 1), description = Spring.I18N('ui.settings.option.sndunitsound_desc'), - onchange = function(i, value) - Spring.SetConfigInt("snd_unitsound", (value and 1 or 0)) - end, - }, - - { id = "sndairabsorption", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndairabsorption'), type = "slider", min = 0, max = 0.4, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_airAbsorption", .35) or .35), description = Spring.I18N('ui.settings.option.sndairabsorption_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigFloat("snd_airAbsorption", value) - end, - }, - - { id = "sndzoomvolume", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.sndzoomvolume'), type = "slider", min = 0, max = 3, step = 0.01, value = tonumber(Spring.GetConfigFloat("snd_zoomVolume", 1.00) or 1.00), description = Spring.I18N('ui.settings.option.sndzoomvolume_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigFloat("snd_zoomVolume", value) - end, - }, - - { id = "muteoffscreen", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.muteoffscreen'), type = "bool", value = (Spring.GetConfigInt("muteOffscreen", 0) == 1), description = Spring.I18N('ui.settings.option.muteoffscreen_descr'), - onchange = function(i, value) - Spring.SetConfigInt("muteOffscreen", (value and 1 or 0)) - end, - }, - - - { id = "soundtrack", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.label_soundtrack') }, - { id = "soundtrack_spacer", group = "sound", category = types.basic }, - - { id = "soundtrackNew", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtracknew'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackNew', 1) == 1, description = Spring.I18N('ui.settings.option.soundtracknew_descr'), + { + id = "dualmode_minimap_aspectratio", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.dualmode_minimap_aspectratio"), + type = "bool", + value = Spring.GetConfigInt("DualScreenMiniMapAspectRatio"), + description = Spring.I18N("ui.settings.option.dualmode_minimap_aspectratio_descr"), + onchange = function(_, value) + Spring.SetConfigInt("DualScreenMiniMapAspectRatio", value and 1 or 0) + end, + }, + { + id = "vsync", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.vsync"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_off"), Spring.I18N("ui.settings.option.select_enabled"), Spring.I18N("ui.settings.option.select_adaptive") }, + value = 2, + description = Spring.I18N("ui.settings.option.vsync_descr"), + onload = function(i) + local vsync = Spring.GetConfigInt("VSyncGame", -1) + if vsync > 0 then + options[i].value = 2 + elseif vsync < 0 then + options[i].value = 3 + else + options[i].value = 1 + end + end, onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackNew', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() + local vsync = 0 + if value == 2 then + vsync = Spring.GetConfigInt("VSyncFraction", 1) + elseif value == 3 then + vsync = -Spring.GetConfigInt("VSyncFraction", 1) end - end - }, - { id = "soundtrackRaptors", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackraptors'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackRaptors', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackraptors_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackRaptors', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end - }, - { id = "soundtrackScavengers", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackscavengers'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackScavengers', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackscavengers_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackScavengers', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end + Spring.SetConfigInt("VSync", vsync) + Spring.SetConfigInt("VSyncGame", vsync) -- stored here as assurance cause lobby/game also changes vsync when idle and lobby could think game has set vsync 4 after a hard crash + end, }, - { id = "soundtrackAprilFools", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackaprilfools'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFools', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackaprilfools_descr'), + { + id = "vsync_fraction", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.vsync_fraction"), + min = 1, + max = 4, + step = 1, + type = "slider", + value = Spring.GetConfigInt("VSyncFraction", 1), + description = Spring.I18N("ui.settings.option.vsync_fraction_descr"), onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackAprilFools', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() + Spring.SetConfigInt("VSyncFraction", value) + local vsync = Spring.GetConfigInt("VSyncGame", -1) + if vsync ~= 0 then + Spring.SetConfigInt("VSync", vsync * value) end - end + end, }, - { id = "soundtrackAprilFoolsPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackaprilfoolspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackAprilFoolsPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackaprilfoolspostevent_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackAprilFoolsPostEvent', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end + + { id = "limitoffscreenfps", group = "gfx", category = types.advanced, widget = "Limit idle FPS", name = Spring.I18N("ui.settings.option.limitoffscreenfps"), type = "bool", value = GetWidgetToggleValue("Limit idle FPS"), description = Spring.I18N("ui.settings.option.limitoffscreenfps_descr") }, + { + id = "limitidlefps", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.limitidlefps"), + type = "bool", + value = (Spring.GetConfigInt("LimitIdleFps", 0) == 1), + description = Spring.I18N("ui.settings.option.limitidlefps_descr"), + onchange = function(i, value) + Spring.SetConfigInt("LimitIdleFps", (value and 1 or 0)) + end, }, - { id = "soundtrackHalloween", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackhalloween'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloween', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackhalloween_descr'), + + { + id = "msaa", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.msaa"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_off"), "x2", "x4", "x8" }, + restart = true, + value = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0), + description = Spring.I18N("ui.settings.option.msaa_descr"), + onload = function(i) + local msaa = tonumber(Spring.GetConfigInt("MSAALevel", 0) or 0) + if msaa <= 0 then + options[getOptionByID("msaa")].value = 1 + else + for k, v in ipairs(options[getOptionByID("msaa")].options) do + if v == "x" .. msaa then + options[getOptionByID("msaa")].value = k + break + end + end + end + end, onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackHalloween', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() + if value == 1 then + Spring.SetConfigInt("MSAA", 0) + Spring.SetConfigInt("MSAALevel", -1) -- setting 0 will reset it to default x4 :( + else + Spring.SetConfigInt("MSAA", 1) + Spring.SetConfigInt("MSAALevel", tonumber(string.sub(options[getOptionByID("msaa")].options[value], 2))) end - end + end, }, - { id = "soundtrackHalloweenPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackhalloweenpostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackHalloweenPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackhalloweenpostevent_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackHalloweenPostEvent', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end + + { + id = "supersampling", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.supersampling"), + type = "bool", + restart = false, + value = (Spring.GetConfigFloat("MinSampleShadingRate", 0.0) == 1.0), + description = Spring.I18N("ui.settings.option.supersampling_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("MinSampleShadingRate", (value and 1.0 or 0.0)) + end, }, - { id = "soundtrackXmas", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackxmas'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmas', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackxmas_descr'), + + { + id = "cas_sharpness", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.cas_sharpness"), + min = 0.5, + max = 1.1, + step = 0.01, + type = "slider", + value = 1.0, + description = Spring.I18N("ui.settings.option.cas_sharpness_descr"), + onload = function(i) + loadWidgetData("Contrast Adaptive Sharpen", "cas_sharpness", { "SHARPNESS" }) + end, onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackXmas', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() + if not GetWidgetToggleValue("Contrast Adaptive Sharpen") then + widgetHandler:EnableWidget("Contrast Adaptive Sharpen") end - end + saveOptionValue("Contrast Adaptive Sharpen", "cas", "setSharpness", { "SHARPNESS" }, options[getOptionByID("cas_sharpness")].value) + end, }, - { id = "soundtrackXmasPostEvent", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.soundtrackxmaspostevent'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackXmasPostEvent', 0) == 1, description = Spring.I18N('ui.settings.option.soundtrackxmaspostevent_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackXmasPostEvent', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end + + { id = "sepiatone", group = "gfx", category = types.advanced, widget = "Sepia Tone", name = Spring.I18N("ui.settings.option.sepiatone"), type = "bool", value = GetWidgetToggleValue("Sepia Tone") }, + { + id = "sepiatone_gamma", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sepiatone_gamma"), + min = 0.1, + max = 0.9, + step = 0.02, + type = "slider", + value = 0.5, + onload = function(i) + loadWidgetData("Sepia Tone", "sepiatone_gamma", { "gamma" }) + end, + onchange = function(i, value) + saveOptionValue("Sepia Tone", "sepia", "setGamma", { "gamma" }, value) + end, }, - { id = "soundtrackCustom", group = "sound", category = types.advanced, name = Spring.I18N('ui.settings.option.soundtrackcustom'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackCustom', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackcustom_descr'), + { + id = "sepiatone_saturation", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sepiatone_saturation"), + min = 0, + max = 1, + step = 0.02, + type = "slider", + value = 0.5, + onload = function(i) + loadWidgetData("Sepia Tone", "sepiatone_saturation", { "saturation" }) + end, onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackCustom', value and 1 or 0) - if WG['music'] and WG['music'].RefreshTrackList then - WG['music'].RefreshTrackList() - init() - end - end + saveOptionValue("Sepia Tone", "sepia", "setSaturation", { "saturation" }, value) + end, }, - { id = "soundtrackInterruption", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtrackinterruption'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackinterruption_descr'), + { + id = "sepiatone_contrast", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sepiatone_contrast"), + min = 0.1, + max = 0.9, + step = 0.02, + type = "slider", + value = 0.5, + onload = function(i) + loadWidgetData("Sepia Tone", "sepiatone_contrast", { "contrast" }) + end, onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackInterruption', value and 1 or 0) - if WG['music'] and WG['music'].RefreshSettings then - WG['music'].RefreshSettings() - end - end + saveOptionValue("Sepia Tone", "sepia", "setContrast", { "contrast" }, value) + end, }, - { id = "soundtrackFades", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.soundtrackfades'), type = "bool", value = Spring.GetConfigInt('UseSoundtrackFades', 1) == 1, description = Spring.I18N('ui.settings.option.soundtrackfades_descr'), - onchange = function(i, value) - Spring.SetConfigInt('UseSoundtrackFades', value and 1 or 0) - if WG['music'] and WG['music'].RefreshSettings then - WG['music'].RefreshSettings() - end - end + { + id = "sepiatone_sepia", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sepiatone_sepia"), + min = 0, + max = 0.5, + step = 0.02, + type = "slider", + value = 0.5, + description = Spring.I18N("ui.settings.option.sepiatone_sepia_descr"), + onload = function(i) + loadWidgetData("Sepia Tone", "sepiatone_sepia", { "sepia" }) + end, + onchange = function(i, value) + saveOptionValue("Sepia Tone", "sepia", "setSepia", { "sepia" }, value) + end, + }, + { + id = "sepiatone_shadeui", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sepiatone_shadeui"), + type = "bool", + value = 0, + onload = function(i) + loadWidgetData("Sepia Tone", "sepiatone_shadeui", { "shadeUI" }) + end, + onchange = function(i, value) + saveOptionValue("Sepia Tone", "sepia", "setShadeUI", { "shadeUI" }, value) + end, }, - --{ id = "loadscreen_music", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.loadscreen_music'), type = "bool", value = (Spring.GetConfigInt("music_loadscreen", 1) == 1), description = Spring.I18N('ui.settings.option.loadscreen_music_descr'), - -- onchange = function(i, value) - -- Spring.SetConfigInt("music_loadscreen", (value and 1 or 0)) - -- end, - --}, + { id = "label_gfx_lighting", group = "gfx", name = Spring.I18N("ui.settings.option.label_lighting"), category = types.basic }, + { id = "label_gfx_lighting_spacer", group = "gfx", category = types.basic }, - { id = "notifications_set", group = "notif", category = types.basic, name = Spring.I18N('ui.settings.option.notifications_set'), type = "select", options = {}, value = 1, - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigString("voiceset", options[i].options[options[i].value]) - if widgetHandler.orderList["Notifications"] ~= nil then - widgetHandler:DisableWidget("Notifications") - widgetHandler:EnableWidget("Notifications") - init() - end - end, + { + id = "advmapshading", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.advmapshading"), + type = "bool", + value = (Spring.GetConfigInt("AdvMapShading", 1) == 1), + description = Spring.I18N("ui.settings.option.advmapshading_descr"), + onchange = function(i, value) + Spring.SetConfigInt("AdvMapShading", (value and 1 or 0)) + Spring.SendCommands("advmapshading " .. (value and "1" or "0")) + end, }, - --{ id = "notifications_tutorial", group = "notif", name = Spring.I18N('ui.settings.option.notifications_tutorial'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getTutorial()), description = Spring.I18N('ui.settings.option.notifications_tutorial_descr'), - -- onload = function(i) - -- loadWidgetData("Notifications", "notifications_tutorial", { 'tutorialMode' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('Notifications', 'notifications', 'setTutorial', { 'tutorialMode' }, value) - -- end, - --}, - { id = "notifications_messages", group = "notif", name = Spring.I18N('ui.settings.option.notifications_messages'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getMessages()), description = Spring.I18N('ui.settings.option.notifications_messages_descr'), - onload = function(i) - loadWidgetData("Notifications", "notifications_messages", { 'displayMessages' }) - end, - onchange = function(i, value) - saveOptionValue('Notifications', 'notifications', 'setMessages', { 'displayMessages' }, value) - end, - }, - { id = "notifications_spoken", group = "notif", name = Spring.I18N('ui.settings.option.notifications_spoken'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getSpoken()), description = Spring.I18N('ui.settings.option.notifications_spoken_descr'), - onload = function(i) - loadWidgetData("Notifications", "notifications_spoken", { 'spoken' }) - end, - onchange = function(i, value) - saveOptionValue('Notifications', 'notifications', 'setSpoken', { 'spoken' }, value) - end, - }, - { id = "notifications_volume", group = "notif", category = types.basic, name = Spring.I18N('ui.settings.option.notifications_volume'), type = "slider", min = 0.05, max = 1, step = 0.05, value = 0.7, description = Spring.I18N('ui.settings.option.notifications_volume_descr'), - onload = function(i) - loadWidgetData("Notifications", "notifications_volume", { 'globalVolume' }) - end, - onchange = function(i, value) - saveOptionValue('Notifications', 'notifications', 'setVolume', { 'globalVolume' }, value) - end, - }, - { id = "notifications_substitute", group = "notif", category = types.advanced, name = Spring.I18N('ui.settings.option.notifications_substitute'), type = "bool", value = Spring.GetConfigInt('NotificationsSubstitute', 0) == 1, description = Spring.I18N('ui.settings.option.notifications_substitute_descr'), - onchange = function(i, value) - Spring.SetConfigInt('NotificationsSubstitute', value and 1 or 0) - widgetHandler:DisableWidget("Notifications") - widgetHandler:EnableWidget("Notifications") - init() - end - }, - { id = "notifications_refresh", group = "notif", category = types.advanced, name = Spring.I18N('ui.settings.option.notifications_refresh'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.notifications_refresh_descr'), - onchange = function(i, value) - widgetHandler:DisableWidget("Notifications") - widgetHandler:EnableWidget("Notifications") - init() - end + { + id = "cusgl4", + group = "gfx", + name = Spring.I18N("ui.settings.option.cus"), + category = types.basic, + type = "bool", + value = (Spring.GetConfigInt("cus2", 1) == 1), + description = Spring.I18N("ui.settings.option.cus_descr"), + onchange = function(i, value) + if value == 0.5 then + Spring.SendCommands("luarules disablecusgl4") + else + Spring.SetConfigInt("cus2", (value and 1 or 0)) + Spring.SendCommands("luarules " .. (value and "reloadcusgl4" or "disablecusgl4")) + end + end, }, + { + id = "shadowslider", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.shadowslider"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_off"), Spring.I18N("ui.settings.option.select_lowest"), Spring.I18N("ui.settings.option.select_low"), Spring.I18N("ui.settings.option.select_medium"), Spring.I18N("ui.settings.option.select_high"), Spring.I18N("ui.settings.option.select_ultra") }, + value = Spring.GetConfigInt("ShadowQuality", 3) + 1, + description = Spring.I18N("ui.settings.option.shadowslider_descr"), + onchange = function(i, value) + Spring.SetConfigInt("ShadowQuality", value - 1) + adjustShadowQuality() + end, + }, - { id = "label_notif_messages", group = "notif", name = Spring.I18N('ui.settings.option.label_messages'), category = types.basic }, - { id = "label_notif_messages_spacer", group = "notif", category = types.basic }, - - -- CONTROL - { id = "label_ui_hotkeys", group = "control", name = Spring.I18N('ui.settings.option.label_hotkeys'), category = types.basic }, - { id = "label_ui_hotkeys_spacer", group = "control", category = types.basic }, - - { id = "keylayout", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.keylayout'), type = "select", options = keyLayouts.layouts, value = 1, description = Spring.I18N('ui.settings.option.keylayout_descr'), - onload = function() - local keyLayout = Spring.GetConfigString("KeyboardLayout") - - if not keyLayout or keyLayout == '' then - keyLayout = keyLayouts.layouts[1] - Spring.SetConfigString("KeyboardLayout", keyLayouts.layouts[1]) - end - - local value = 1 - for i, v in ipairs(keyLayouts.layouts) do - if v == keyLayout then - value = i - break - end - end - - options[getOptionByID('keylayout')].value = value - end, - onchange = function(_, value) - Spring.SetConfigString("KeyboardLayout", keyLayouts.layouts[value]) - if WG['bar_hotkeys'] and WG['bar_hotkeys'].reloadBindings then - WG['bar_hotkeys'].reloadBindings() - end - end, - }, - - { id = "keybindings", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.keybindings'), type = "select", options = keyLayouts.keybindingLayouts, value = 1, description = Spring.I18N('ui.settings.option.keybindings_descr'), - onload = function() - local keyFile = Spring.GetConfigString("KeybindingFile") - local value = 1 - - if (not keyFile) or (keyFile == '') or (not VFS.FileExists(keyFile)) then - keyFile = keyLayouts.keybindingLayoutFiles[1] - end - - for i, v in ipairs(keyLayouts.keybindingLayoutFiles) do - if v == keyFile then - value = i - break - end - end - - options[getOptionByID('keybindings')].value = value - end, - onchange = function(_, value) - local keyFile = keyLayouts.keybindingLayoutFiles[value] - - if not keyFile or keyFile == '' then - return - end - - local isCustom = keyLayouts.keybindingPresets["Custom"] == keyFile - - if isCustom and not VFS.FileExists(keyFile) then - Spring.SendCommands("keysave " .. keyFile) - Spring.Echo("Preset Custom selected, file saved at: " .. keyFile) - end - - Spring.SetConfigString("KeybindingFile", keyFile) - if isCustom then - Spring.Echo("To test your custom bindings after changes type in chat: /keyreload") - end - -- enable grid menu for grid keybinds - local preset = options[getOptionByID('keybindings')].options[value] - Spring.Echo(preset) - if string.find(string.lower(preset), "grid", nil, true) then - widgetHandler:DisableWidget('Build menu') - widgetHandler:EnableWidget('Grid menu') - elseif preset == 'Custom' then - -- do stuff with custom preset - else - widgetHandler:DisableWidget('Grid menu') - widgetHandler:EnableWidget('Build menu') - end - - if WG['bar_hotkeys'] and WG['bar_hotkeys'].reloadBindings then - WG['bar_hotkeys'].reloadBindings() - end - init() - end, - }, - - { id = "gridmenu", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.gridmenu'), type = "bool", value = GetWidgetToggleValue("Grid menu"), description = Spring.I18N('ui.settings.option.gridmenu_descr'), - onchange = function(i, value) - if value then - widgetHandler:DisableWidget('Build menu') - widgetHandler:EnableWidget('Grid menu') - else - widgetHandler:DisableWidget('Grid menu') - widgetHandler:EnableWidget('Build menu') - end - init() - end, - }, - { id = "gridmenu_alwaysreturn", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_alwaysreturn'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAlwaysReturn ~= nil and WG['gridmenu'].getAlwaysReturn()), description = Spring.I18N('ui.settings.option.gridmenu_alwaysreturn_descr'), - onload = function() - end, - onchange = function(_, value) - saveOptionValue('Grid menu', 'gridmenu', 'setAlwaysReturn', { 'alwaysReturn' }, value) - end, - }, - { id = "gridmenu_autoselectfirst", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_autoselectfirst'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getAutoSelectFirst ~= nil and WG['gridmenu'].getAutoSelectFirst()), description = Spring.I18N('ui.settings.option.gridmenu_autoselectfirst_descr'), - onload = function() - end, - onchange = function(_, value) - saveOptionValue('Grid menu', 'gridmenu', 'setAutoSelectFirst', { 'autoSelectFirst' }, value) - end, - }, - { id = "gridmenu_labbuildmode", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_labbuildmode'), type = "bool", value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getUseLabBuildMode ~= nil and WG['gridmenu'].getUseLabBuildMode()), description = Spring.I18N('ui.settings.option.gridmenu_labbuildmode_descr'), - onload = function() - end, - onchange = function(_, value) - saveOptionValue('Grid menu', 'gridmenu', 'setUseLabBuildMode', { 'useLabBuildMode' }, value) - end, - }, - - { id = "gridmenu_ctrlkeymodifier", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_ctrlkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getCtrlKeyModifier ~= nil and WG['gridmenu'].getCtrlKeyModifier()), description = Spring.I18N('ui.settings.option.gridmenu_ctrlkeymodifier_descr'), - onload = function() - end, - onchange = function(_, value) - saveOptionValue('Grid menu', 'gridmenu', 'setCtrlKeyModifier', { 'ctrlKeyModifier' }, value) - end, - }, - { id = "gridmenu_shiftkeymodifier", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.gridmenu_shiftkeymodifier'), type = "slider", min = -20, max = 100, step = 1, value = (WG['gridmenu'] ~= nil and WG['gridmenu'].getShiftKeyModifier ~= nil and WG['gridmenu'].getShiftKeyModifier()), description = Spring.I18N('ui.settings.option.gridmenu_shiftkeymodifier_descr'), - onload = function() - end, - onchange = function(_, value) - saveOptionValue('Grid menu', 'gridmenu', 'setShiftKeyModifier', { 'ShiftKeyModifier' }, value) - end, - }, - - { id = "label_ui_cursor", group = "control", name = Spring.I18N('ui.settings.option.label_cursor'), category = types.basic }, - { id = "label_ui_cursor_spacer", group = "control", category = types.basic }, - - { id = "hwcursor", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.hwcursor'), type = "bool", value = tonumber(Spring.GetConfigInt("HardwareCursor", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.hwcursor_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SendCommands("HardwareCursor " .. (value and 1 or 0)) - Spring.SetConfigInt("HardwareCursor", (value and 1 or 0)) - end, - }, - { id = "setcamera_bugfix", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.setcamera_bugfix'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.setcamera_bugfix_descr'), - onload = function(i) - WG['setcamera_bugfix'] = true - end, - onchange = function(i, value) - WG['setcamera_bugfix'] = value - end, - }, - { id = "cursorsize", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.cursorsize'), type = "slider", min = 0.3, max = 1.7, step = 0.1, value = 1, description = Spring.I18N('ui.settings.option.cursorsize_descr'), - onload = function(i) - end, - onchange = function(i, value) - if WG['cursors'] then - WG['cursors'].setsizemult(value) - end - end, - }, - - { id = "containmouse", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.containmouse'), type = "bool", value = Spring.GetConfigInt('grabinput', 1) == 1, description = Spring.I18N('ui.settings.option.containmouse_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("grabinput", (value and 1 or 0)) - updateGrabinput() - end, - }, - - { id = "doubleclicktime", group = "control", category = types.advanced, restart = true, name = Spring.I18N('ui.settings.option.doubleclicktime'), type = "slider", min = 150, max = 400, step = 10, value = Spring.GetConfigInt("DoubleClickTime", 200), description = Spring.I18N('ui.settings.option.doubleclicktime_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("DoubleClickTime", value) - end, - }, - - { id = "dragthreshold", group = "control", category = types.advanced, restart = false, name = Spring.I18N('ui.settings.option.dragthreshold'), type = "slider", min = 4, max = 50, step = 1, value = Spring.GetConfigInt("MouseDragSelectionThreshold", 4), description = Spring.I18N('ui.settings.option.dragthreshold_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("MouseDragSelectionThreshold", value) - Spring.SetConfigInt("MouseDragCircleCommandThreshold", value) - Spring.SetConfigInt("MouseDragBoxCommandThreshold", value + 12) - Spring.SetConfigInt("MouseDragFrontCommandThreshold", value + 26) - end, - }, - - - - { id = "label_ui_camera", group = "control", name = Spring.I18N('ui.settings.option.label_camera'), category = types.basic }, - { id = "label_ui_camera_spacer", group = "control", category = types.basic }, - - { id = "middleclicktoggle", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.middleclicktoggle'), type = "bool", value = (Spring.GetConfigFloat("MouseDragScrollThreshold", 0.3) ~= 0), description = Spring.I18N('ui.settings.option.middleclicktoggle_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigFloat("MouseDragScrollThreshold", (value and 0.3 or 0)) - end, + { + id = "shadows_opacity", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.shadows_opacity"), + type = "slider", + min = 0.3, + max = 1, + step = 0.01, + value = gl.GetSun("shadowDensity"), + description = "", + onchange = function(i, value) + Spring.SetSunLighting({ groundShadowDensity = value, modelShadowDensity = value }) + end, }, - { id = "screenedgemove", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.screenedgemove'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("FullscreenEdgeMove", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.screenedgemove_descr'), - onchange = function(i, value) - Spring.SetConfigInt("FullscreenEdgeMove", (value and 1 or 0)) - Spring.SetConfigInt("WindowedEdgeMove", (value and 1 or 0)) - if value then - Spring.SetConfigFloat("EdgeMoveWidth", edgeMoveWidth) - else - Spring.SetConfigFloat("EdgeMoveWidth", 0) - end - end, - }, - { id = "screenedgemovewidth", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.screenedgemovewidth'), type = "slider", min = 0, max = 0.1, step = 0.01, value = edgeMoveWidth, description = Spring.I18N('ui.settings.option.screenedgemovewidth_descr'), - onchange = function(i, value) - edgeMoveWidth = value - Spring.SetConfigFloat("EdgeMoveWidth", value) - end, - }, - { id = "screenedgemovedynamic", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.screenedgemovedynamic'), type = "bool", restart = true, value = tonumber(Spring.GetConfigInt("EdgeMoveDynamic", 1) or 1) == 1, description = Spring.I18N('ui.settings.option.screenedgemovedynamic_descr'), - onchange = function(i, value) - Spring.SetConfigInt("EdgeMoveDynamic", (value and 1 or 0)) - end, - }, - - { id = "camera", group = "control", category = types.basic, name = Spring.I18N('ui.settings.option.camera'), type = "select", options = { Spring.I18N('ui.settings.option.select_firstperson'), Spring.I18N('ui.settings.option.select_overhead'), Spring.I18N('ui.settings.option.select_springcam'), Spring.I18N('ui.settings.option.select_rotoverhead'), Spring.I18N('ui.settings.option.select_free') }, value = (tonumber((Spring.GetConfigInt("CamMode", 1) + 1) or 2)), - onchange = function(i, value) - Spring.SetConfigInt("CamMode", (value - 1)) - if value == 1 then - Spring.SendCommands('viewfps') - elseif value == 2 then - Spring.SendCommands('viewta') - elseif value == 3 then - Spring.SendCommands('viewspring') - elseif value == 4 then - Spring.SendCommands('viewrot') - elseif value == 5 then - Spring.SendCommands('viewfree') - end - init() - end, - }, - { id = "springcamheightmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.springcamheightmode'), type = "select", options = { Spring.I18N('ui.settings.option.select_constant'), Spring.I18N('ui.settings.option.select_terrain'), Spring.I18N('ui.settings.option.select_smooth')}, value = Spring.GetConfigInt("CamSpringTrackMapHeightMode", 0) + 1, description = Spring.I18N('ui.settings.option.springcamheightmode_descr'), - onchange = function(i, value) - Spring.SetConfigInt("CamSpringTrackMapHeightMode", value - 1) - end, - }, - { id = "mincamheight", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mincamheight'), type = "slider", min = 0, max = 1500, step = 1, value = Spring.GetConfigInt("CamSpringMinZoomDistance", 0), description = Spring.I18N('ui.settings.option.mincamheight_descr'), - onchange = function(i, value) - Spring.SetConfigInt("CamSpringMinZoomDistance", value) - Spring.SetConfigInt("OverheadMinZoomDistance", value) - end, - }, - { id = "camerashake", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerashake'), type = "slider", min = 0, max = 200, step = 10, value = 80, description = Spring.I18N('ui.settings.option.camerashake_descr'), - onload = function(i) - loadWidgetData("CameraShake", "camerashake", { 'powerScale' }) - if options[i].value > 0 then - widgetHandler:EnableWidget("CameraShake") - end - end, - onchange = function(i, value) - saveOptionValue('CameraShake', 'camerashake', 'setStrength', { 'powerScale' }, value) - if value > 0 then - widgetHandler:EnableWidget("CameraShake") - end - end, + { id = "ssao", group = "gfx", category = types.basic, widget = "SSAO", name = Spring.I18N("ui.settings.option.ssao"), type = "bool", value = GetWidgetToggleValue("SSAO"), description = Spring.I18N("ui.settings.option.ssao_descr") }, + { + id = "ssao_strength", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ssao_strength"), + type = "slider", + min = 5, + max = 15, + step = 1, + value = 10, + description = "", + onload = function(i) + loadWidgetData("SSAO", "ssao_strength", { "strength" }) + end, + onchange = function(i, value) + saveOptionValue("SSAO", "ssao", "setStrength", { "strength" }, value) + end, }, - --{ id = "camerasmoothing", group = "control", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerasmoothing'), type = "bool", value = (tonumber(Spring.GetConfigInt("CameraSmoothing", 0)) == 1), description = "", - -- onload = function(i) - -- end, - -- onchange = function(i, value) - -- Spring.SetConfigInt("CameraSmoothing", (value and 1 or 0)) - -- if value then - -- Spring.SendCommands("set CamFrameTimeCorrection 1") - -- Spring.SendCommands("set SmoothTimeOffset 2") - -- else - -- Spring.SendCommands("set CamFrameTimeCorrection 0") - -- Spring.SendCommands("set SmoothTimeOffset 0") - -- end - -- end, - --}, - { id = "smoothingmode", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smoothingmode'), type = "select", options = { Spring.I18N('ui.settings.option.smoothing_exponential'), Spring.I18N('ui.settings.option.smoothing_spring')}, value = (Spring.GetConfigInt("CamTransitionMode", 1) + 1), - onchange = function(i, value) - Spring.SetConfigInt("CamTransitionMode", (value - 1)) - end, - }, - { id = "camerasmoothness", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerasmoothness'), type = "slider", min = 0.04, max = 2, step = 0.01, value = cameraTransitionTime, description = Spring.I18N('ui.settings.option.camerasmoothness_descr'), - onload = function(i) - end, - onchange = function(i, value) - cameraTransitionTime = value - local halfLife = value - if halfLife <= 1 then - halfLife = halfLife * 200 - else - halfLife = halfLife * 600 - 400 - end - Spring.SetConfigFloat("CamSpringHalflife", halfLife) - end, - }, - { id = "camerapanspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerapanspeed'), type = "slider", min = -0.01, max = -0.00195, step = 0.0001, value = Spring.GetConfigFloat("MiddleClickScrollSpeed", 0.0035), description = Spring.I18N('ui.settings.option.camerapanspeed_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigFloat("MiddleClickScrollSpeed", value) - end, - }, - { id = "cameramovespeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cameramovespeed'), type = "slider", min = 0, max = 100, step = 1, value = Spring.GetConfigInt("CamSpringScrollSpeed", 10), description = Spring.I18N('ui.settings.option.cameramovespeed_descr'), - onload = function(i) - end, - onchange = function(i, value) - --cameraPanTransitionTime = value - Spring.SetConfigInt("FPSScrollSpeed", value) -- spring default: 10 - Spring.SetConfigInt("OverheadScrollSpeed", value) -- spring default: 10 - Spring.SetConfigInt("RotOverheadScrollSpeed", value) -- spring default: 10 - Spring.SetConfigFloat("CamFreeScrollSpeed", value * 50) -- spring default: 500 - Spring.SetConfigInt("CamSpringScrollSpeed", value) -- spring default: 10 - end, - }, - { id = "scrollspeed", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrollspeed'), type = "slider", min = 1, max = 50, step = 1, value = math.abs(tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25)), description = '', - onload = function(i) - end, - onchange = function(i, value) - if getOptionByID('scrollinverse') and options[getOptionByID('scrollinverse')].value then - Spring.SetConfigInt("ScrollWheelSpeed", -value) - else - Spring.SetConfigInt("ScrollWheelSpeed", value) - end - end, - }, - { id = "scrollinverse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrollinverse'), type = "bool", value = (tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25) < 0), description = "", - onload = function(i) - end, - onchange = function(i, value) - if getOptionByID('scrollspeed') then - if value then - Spring.SetConfigInt("ScrollWheelSpeed", -options[getOptionByID('scrollspeed')].value) - else - Spring.SetConfigInt("ScrollWheelSpeed", options[getOptionByID('scrollspeed')].value) - end - end - end, - }, - { id = "invertmouse", group = "control", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.invertmouse'), type = "bool", value = tonumber(Spring.GetConfigInt("InvertMouse", 0)) == 1, description = "", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("InvertMouse", value and 1 or 0) - end, - }, - { id = "scrolltoggleoverview", group = "control", category = types.advanced, widget = "Scrolldown Toggleoverview", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.scrolltoggleoverview'), type = "bool", value = GetWidgetToggleValue("Scrolldown Toggleoverview"), description = Spring.I18N('ui.settings.option.scrolltoggleoverview_descr') }, - - { id = "camoverviewrestore", group = "control", category = types.advanced, widget = "Overview Camera Keep Position", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camoverviewrestore'), type = "bool", value = GetWidgetToggleValue("Overview Camera Keep Position"), description = Spring.I18N('ui.settings.option.camoverviewrestore_descr') }, - - { id = "lockcamera_transitiontime", group = "control", category = types.advanced, name = Spring.I18N('ui.settings.option.lockcamera')..widgetOptionColor .. " " ..Spring.I18N('ui.settings.option.lockcamera_transitiontime'), type = "slider", min = 0.5, max = 1.7, step = 0.01, value = (WG.lockcamera and WG.lockcamera.GetTransitionTime ~= nil and WG.lockcamera.GetTransitionTime()), description = Spring.I18N('ui.settings.option.lockcamera_transitiontime_descr'), - onload = function(i) - loadWidgetData("Lockcamera", "lockcamera_transitiontime", { 'transitionTime' }) - end, - onchange = function(i, value) - saveOptionValue('Lockcamera', 'lockcamera', 'SetTransitionTime', { 'transitionTime' }, value) - end, - }, - - { id = "allyselunits_select", group = "control", category = types.advanced, name = widgetOptionColor .. " " ..Spring.I18N('ui.settings.option.allyselunits_select'), type = "bool", value = (WG['allyselectedunits'] ~= nil and WG['allyselectedunits'].getSelectPlayerUnits()), description = Spring.I18N('ui.settings.option.allyselunits_select_descr'), - onload = function(i) - loadWidgetData("Ally Selected Units", "allyselunits_select", { 'selectPlayerUnits' }) - end, - onchange = function(i, value) - saveOptionValue('Ally Selected Units', 'allyselectedunits', 'setSelectPlayerUnits', { 'selectPlayerUnits' }, value) - end, - }, - { id = "lockcamera_hideenemies", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lockcamera_hideenemies'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetHideEnemies()), description = Spring.I18N('ui.settings.option.lockcamera_hideenemies_descr'), - onload = function(i) - loadWidgetData("Lockcamera", "lockcamera_hideenemies", { 'lockcameraHideEnemies' }) - end, - onchange = function(i, value) - saveOptionValue('Lockcamera', 'lockcamera', 'SetHideEnemies', { 'lockcameraHideEnemies' }, value) - end, - }, - { id = "lockcamera_los", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.lockcamera_los'), type = "bool", value = (WG.lockcamera and WG.lockcamera.GetLos()), description = Spring.I18N('ui.settings.option.lockcamera_los_descr'), - onload = function(i) - loadWidgetData("Lockcamera", "lockcamera_los", { 'lockcameraLos' }) - end, - onchange = function(i, value) - saveOptionValue('Lockcamera', 'lockcamera', 'SetLos', { 'lockcameraLos' }, value) - end, - }, - - { id = "label_ui_command", group = "control", name = Spring.I18N('ui.settings.option.label_commands'), category = types.advanced }, - { id = "label_ui_command_spacer", group = "control", category = types.basic }, - { id = "drag_multicommand_shift", group = "control", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.drag_multicommand_shift'), type = "bool", value = (WG.customformations ~= nil and WG.customformations.getRepeatForSingleUnit()), description = Spring.I18N('ui.settings.option.drag_multicommand_shift_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('CustomFormations2', 'customformations', 'setRepeatForSingleUnit', { 'repeatForSingleUnit' }, value) - end, - }, - - -- INTERFACE - { id = "label_ui_interface", group = "ui", name = Spring.I18N('ui.settings.option.label_interface'), category = types.basic }, - { id = "label_ui_interface_spacer", group = "ui", category = types.basic }, - { id = "language", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.language'), type = "select", options = languageNames, value = languageCodes[Spring.I18N.getLocale()], - onchange = function(i, value) - local language = languageCodes[value] - WG['language'].setLanguage(language) - if widgetHandler.orderList["Notifications"] ~= nil then - widgetHandler:DisableWidget("Notifications") - widgetHandler:EnableWidget("Notifications") - init() + { + id = "ssao_quality", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ssao_quality"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_low"), Spring.I18N("ui.settings.option.select_medium"), Spring.I18N("ui.settings.option.select_high") }, + value = (WG["ssao"] ~= nil and WG["ssao"].getPreset() or 2), + description = Spring.I18N("ui.settings.option.ssao_quality_descr"), + onload = function(i) + if widgetHandler.configData["SSAO"] ~= nil and widgetHandler.configData["SSAO"].preset ~= nil then + options[getOptionByID("ssao_quality")].value = widgetHandler.configData["SSAO"].preset end - end - }, - { id = "language_english_unit_names", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.language_english_unit_names'), type = "bool", value = Spring.GetConfigInt("language_english_unit_names", 0) == 1, - onchange = function(i, value) - WG['language'].setEnglishUnitNames(value) - end, - }, - { id = "uiscale", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.interface') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uiscale'), type = "slider", min = 0.8, max = 1.3, step = 0.01, value = Spring.GetConfigFloat("ui_scale", 1), description = '', - onload = function(i) - end, - onchange = function(i, value, force) - if force then - Spring.SetConfigFloat("ui_scale", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('uiscale') } - end - end, - }, - { id = "guiopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guiopacity'), type = "slider", min = 0.3, max = 1, step = 0.01, value = Spring.GetConfigFloat("ui_opacity", 0.7), description = '', - onload = function(i) - end, - onchange = function(i, value, force) - Spring.SetConfigFloat("ui_opacity", value) - ui_opacity = Spring.GetConfigFloat("ui_opacity", 0.7) - forceUpdate = true - - if force then - Spring.SetConfigFloat("ui_opacity", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('guiopacity') } - end - end, - }, - { id = "guitilescale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guitilescale'), type = "slider", min = 4, max = 40, step = 1, value = Spring.GetConfigFloat("ui_tilescale", 7), description = '', - onload = function(i) - end, - onchange = function(i, value, force) - if force then - Spring.SetConfigFloat("ui_tilescale", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('guitilescale') } - end - end, - }, - { id = "guitileopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guitileopacity'), type = "slider", min = 0, max = 0.03, step = 0.001, value = Spring.GetConfigFloat("ui_tileopacity", 0.014), description = '', - onload = function(i) - end, - onchange = function(i, value, force) - if force then - Spring.SetConfigFloat("ui_tileopacity", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('guitileopacity') } - end - end, - }, - - { id = "guishader", group = "ui", category = types.basic, widget = "GUI Shader", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.guishader'), type = "bool", value = GetWidgetToggleValue("GUI Shader") }, - - - { id = "minimap_maxheight", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.minimap') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimap_maxheight'), type = "slider", min = 0.2, max = 0.4, step = 0.01, value = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), description = Spring.I18N('ui.settings.option.minimap_maxheight_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("MinimapMaxHeight", value) - if WG['minimap'] and WG['minimap'].setMaxHeight then - WG['minimap'].setMaxHeight(value) - end - end, - }, - { id = "minimapleftclick", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapleftclick'), type = "bool", value = Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1, description = Spring.I18N('ui.settings.option.minimapleftclick_descr'), - onchange = function(i, value) - Spring.SetConfigInt("MinimapLeftClickMove", value and 1 or 0) - if WG['minimap'] and WG['minimap'].setLeftClickMove then - WG['minimap'].setLeftClickMove(value) - end - end, - }, - { id = "minimapiconsize", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapiconsize'), type = "slider", min = 2, max = 5, step = 0.25, value = tonumber(Spring.GetConfigFloat("MinimapIconScale", 3.5) or 1), description = '', - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigFloat("MinimapIconScale", value) - Spring.SendCommands("minimap unitsize " .. value) -- spring wont remember what you set with '/minimap iconssize #' - if WG['minimap'] and WG['minimap'].setBaseIconScale then - WG['minimap'].setBaseIconScale(value) - end - end, - }, - { id = "minimap_minimized", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimapminimized'), type = "bool", value = Spring.GetConfigInt("MinimapMinimize", 0) == 1, description = Spring.I18N('ui.settings.option.minimapminimized_descr'), - onchange = function(i, value) - Spring.SendCommands("minimap minimize "..(value and '1' or '0')) - Spring.SetConfigInt("MinimapMinimize", (value and '1' or '0')) - end, - }, - { id = "minimaprotation", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimaprotation'), type = "select", options = { Spring.I18N('ui.settings.option.minimaprotation_none'), Spring.I18N('ui.settings.option.minimaprotation_autoflip'), Spring.I18N('ui.settings.option.minimaprotation_autorotate'), Spring.I18N('ui.settings.option.minimaprotation_autolandscape')}, description = Spring.I18N('ui.settings.option.minimaprotation_descr'), - onload = function(i) - loadWidgetData("Minimap Rotation Manager", "minimaprotation", { 'mode' }) - if options[i].value == nil then -- first load to migrate from old behavior smoothly, might wanna remove it later - options[i].value = Spring.GetConfigInt("MiniMapCanFlip", 0) + 1 - end - end, - onchange = function(i, value) - if WG['minimaprotationmanager'] ~= nil and WG['minimaprotationmanager'].setMode ~= nil then - saveOptionValue("Minimap Rotation Manager", "minimaprotationmanager", "setMode", { 'mode' }, value) - else - widgetHandler:EnableWidget("Minimap Rotation Manager") -- Widget has auto sync - end - end, - }, - { id = "minimappip", group = "ui", category = types.advanced, widget = "Picture-in-Picture Minimap", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.minimappip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture Minimap"), description = Spring.I18N('ui.settings.option.minimappip_descr') }, - { id = "pip_altkeyzoom", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_altkeyzoom'), type = "bool", value = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, description = Spring.I18N('ui.settings.option.pip_altkeyzoom_descr'), - onchange = function(i, value) - Spring.SetConfigInt("PipAltKeyRequiredForZoom", value and 1 or 0) - for _, n in ipairs({0, 1, 2, 3, 4}) do - if WG['pip' .. n] and WG['pip' .. n].setAltKeyRequiredForZoom then - WG['pip' .. n].setAltKeyRequiredForZoom(value) - end - end - end, - }, - - { id = "pip_commandfx", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_commandfx'), type = "bool", value = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, description = Spring.I18N('ui.settings.option.pip_commandfx_descr'), - onchange = function(i, value) - Spring.SetConfigInt("PipDrawCommandFX", value and 1 or 0) - for _, n in ipairs({0, 1, 2, 3, 4}) do - if WG['pip' .. n] and WG['pip' .. n].setDrawCommandFX then - WG['pip' .. n].setDrawCommandFX(value) - end - end - end, - }, - -- { id = "minimap_engine_fallback", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_minimap_engine_fallback'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.pip_minimap_engine_fallback_descr'), - -- onload = function(i) - -- if WG['minimap'] and WG['minimap'].getEngineMinimapFallback then - -- options[getOptionByID('minimap_engine_fallback')].value = WG['minimap'].getEngineMinimapFallback() - -- end - -- end, - -- onchange = function(i, value) - -- if WG['minimap'] and WG['minimap'].setEngineMinimapFallback then - -- WG['minimap'].setEngineMinimapFallback(value) - -- end - -- end, - -- }, - { id = "pip_engine_fallback_threshold", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_engine_fallback_threshold'), type = "slider", min = 1500, max = 5000, step = 100, value = 4000, description = Spring.I18N('ui.settings.option.pip_engine_fallback_threshold_descr'), - onload = function(i) - if WG['minimap'] and WG['minimap'].getEngineMinimapFallbackThreshold then - options[getOptionByID('pip_engine_fallback_threshold')].value = WG['minimap'].getEngineMinimapFallbackThreshold() - end - end, - onchange = function(i, value) - if WG['minimap'] and WG['minimap'].setEngineMinimapFallbackThreshold then - WG['minimap'].setEngineMinimapFallbackThreshold(value) - end - end, - }, - - - { id = "pip", group = "ui", category = types.advanced, widget = "Picture-in-Picture", name = Spring.I18N('ui.settings.option.pip'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture"), description = Spring.I18N('ui.settings.option.pip_descr') }, - { id = "pip2", group = "ui", category = types.advanced, widget = "Picture-in-Picture 2", name = Spring.I18N('ui.settings.option.pip2'), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture 2"), description = Spring.I18N('ui.settings.option.pip2_descr') }, - - { id = "buildmenu_bottom", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.buildmenu') ..widgetOptionColor.. " " .. Spring.I18N('ui.settings.option.buildmenu_bottom'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getBottomPosition ~= nil and WG['buildmenu'].getBottomPosition()), description = Spring.I18N('ui.settings.option.buildmenu_bottom_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setBottomPosition', { 'stickToBottom' }, value) - saveOptionValue('Grid menu', 'buildmenu', 'setBottomPosition', { 'stickToBottom' }, value) - end, - }, - { id = "buildmenu_maxposy", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_maxposy'), type = "slider", min = 0.66, max = 0.88, step = 0.01, value = 0.74, description = Spring.I18N('ui.settings.option.buildmenu_maxposy_descr'), - onload = function(i) - loadWidgetData("Build menu", "buildmenu_maxposy", { 'maxPosY' }) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setMaxPosY', { 'maxPosY' }, value) - end, - }, - { id = "buildmenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_alwaysshow'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getAlwaysShow ~= nil and WG['buildmenu'].getAlwaysShow()), description = Spring.I18N('ui.settings.option.buildmenu_alwaysshow_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setAlwaysShow', { 'alwaysShow' }, value) - saveOptionValue('Grid menu', 'buildmenu', 'setAlwaysShow', { 'alwaysShow' }, value) - end, - }, - { id = "buildmenu_prices", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_prices'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowPrice ~= nil and WG['buildmenu'].getShowPrice()), description = Spring.I18N('ui.settings.option.buildmenu_prices_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setShowPrice', { 'showPrice' }, value) - saveOptionValue('Grid menu', 'buildmenu', 'setShowPrice', { 'showPrice' }, value) - end, - }, - { id = "buildmenu_groupicon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_groupicon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowGroupIcon ~= nil and WG['buildmenu'].getShowGroupIcon()), description = Spring.I18N('ui.settings.option.buildmenu_groupicon_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setShowGroupIcon', { 'showGroupIcon' }, value) - saveOptionValue('Grid menu', 'buildmenu', 'setShowGroupIcon', { 'showGroupIcon' }, value) - end, - }, - { id = "buildmenu_radaricon", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildmenu_radaricon'), type = "bool", value = (WG['buildmenu'] ~= nil and WG['buildmenu'].getShowRadarIcon ~= nil and WG['buildmenu'].getShowRadarIcon()), description = Spring.I18N('ui.settings.option.buildmenu_radaricon_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Build menu', 'buildmenu', 'setShowRadarIcon', { 'showRadarIcon' }, value) - saveOptionValue('Grid menu', 'buildmenu', 'setShowRadarIcon', { 'showRadarIcon' }, value) - end, - }, - - { id = "ordermenu_bottompos", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.ordermenu')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_bottompos'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getBottomPosition ~= nil and WG['ordermenu'].getBottomPosition()), description = Spring.I18N('ui.settings.option.ordermenu_bottompos_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Order menu', 'ordermenu', 'setBottomPosition', { 'stickToBottom' }, value) - end, - }, - { id = "ordermenu_colorize", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_colorize'), type = "slider", min = 0, max = 1, step = 0.1, value = 0.5, description = '', - onload = function(i) - loadWidgetData("Order menu", "ordermenu_colorize", { 'colorize' }) - end, - onchange = function(i, value) - saveOptionValue('Order menu', 'ordermenu', 'setColorize', { 'colorize' }, value) - end, - }, - { id = "ordermenu_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_alwaysshow'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getAlwaysShow ~= nil and WG['ordermenu'].getAlwaysShow()), description = Spring.I18N('ui.settings.option.ordermenu_alwaysshow_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Order menu', 'ordermenu', 'setAlwaysShow', { 'alwaysShow' }, value) - end, - }, - { id = "ordermenu_hideset", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ordermenu_hideset'), type = "bool", value = (WG['ordermenu'] ~= nil and WG['ordermenu'].getDisabledCmd ~= nil and WG['ordermenu'].getDisabledCmd('Move')), description = Spring.I18N('ui.settings.option.ordermenu_hideset_descr'), - onload = function(i) - end, - onchange = function(i, value) - local cmds = { 'Move', 'Stop', 'Attack', 'Patrol', 'Fight', 'Wait', 'Guard', 'Reclaim', 'Repair', 'ManualFire' } - for k, cmd in pairs(cmds) do - saveOptionValue('Order menu', 'ordermenu', 'setDisabledCmd', { 'disabledCmd', cmd }, value, { cmd, value }) - end - end, - }, - - { id = "info_buildlist", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.info') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_buildlist'), type = "bool", value = (WG['info'] and WG['info'].getShowBuilderBuildlist ~= nil and WG['info'].getShowBuilderBuildlist()), description = Spring.I18N('ui.settings.option.info_buildlist_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Info', 'info', 'setShowBuilderBuildlist', { 'showBuilderBuildlist' }, value) - end, - }, - { id = "info_mappos", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_mappos'), type = "bool", value = (WG['info'] and WG['info'].getDisplayMapPosition ~= nil and WG['info'].getDisplayMapPosition()), description = Spring.I18N('ui.settings.option.info_mappos_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Info', 'info', 'setDisplayMapPosition', { 'displayMapPosition' }, value) - end, - }, - { id = "info_alwaysshow", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.info_alwaysshow'), type = "bool", value = (WG['info'] ~= nil and WG['info'].getAlwaysShow ~= nil and WG['info'].getAlwaysShow()), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Info', 'info', 'setAlwaysShow', { 'alwaysShow' }, value) - end, - }, - - { id = "advplayerlist_country", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.advplayerlist') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_country'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_country_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_country", { 'm_active_Table', 'country' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'country' }, value, { 'country', value }) - end, - }, - { id = "advplayerlist_scale", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_scale'), min = 0.85, max = 1.2, step = 0.01, type = "slider", value = 1, description = Spring.I18N('ui.settings.option.advplayerlist_scale_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_scale", { 'customScale' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetScale', { 'customScale' }, value) - end, - }, - { id = "advplayerlist_showallyid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showallyid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showallyid_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_showallyid", { 'm_active_Table', 'allyid' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'allyid' }, value, { 'allyid', value }) - end, - }, - { id = "advplayerlist_showid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showid_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_showid", { 'm_active_Table', 'id' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'id' }, value, { 'id', value }) - end, - }, - { id = "advplayerlist_showplayerid", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_showplayerid'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_showplayerid_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_showplayerid", { 'm_active_Table', 'playerid' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'playerid' }, value, { 'playerid', value }) - end, - }, - { id = "advplayerlist_rank", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_rank'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_rank_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_rank", { 'm_active_Table', 'rank' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'rank' }, value, { 'rank', value }) - end, - }, - --{ id = "advplayerlist_side", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_side'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_side_descr'), - -- onload = function(i) - -- loadWidgetData("AdvPlayersList", "advplayerlist_side", { 'm_active_Table', 'side' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'side' }, value, { 'side', value }) - -- end, - --}, - { id = "advplayerlist_skill", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_skill'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_skill_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_skill", { 'm_active_Table', 'skill' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'skill' }, value, { 'skill', value }) - end, - }, - { id = "advplayerlist_cpuping", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_cpuping'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_cpuping_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_cpuping", { 'm_active_Table', 'cpuping' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'cpuping' }, value, { 'cpuping', value }) - end, - }, - { id = "advplayerlist_resources", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_resources'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_resources_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_resources", { 'm_active_Table', 'resources' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'resources' }, value, { 'resources', value }) - end, - }, - { id = "advplayerlist_income", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_income'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_income_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_income", { 'm_active_Table', 'income' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'income' }, value, { 'income', value }) - end, - }, - { id = "advplayerlist_absresbars", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_absresbars'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.advplayerlist_absresbars_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_absresbars", { 'absoluteResbarValues' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetAbsoluteResbars', { 'absoluteResbarValues' }, value) - end, - }, - { id = "advplayerlist_share", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_share'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_share_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_share", { 'm_active_Table', 'share' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'share' }, value, { 'share', value }) - end, - }, - { id = "advplayerlist_hidespecs", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_hidespecs'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_hidespecs_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList", "advplayerlist_hidespecs", { 'alwaysHideSpecs' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetAlwaysHideSpecs', { 'alwaysHideSpecs' }, value) - end, - }, - { id = "unittotals", group = "ui", category = types.advanced, widget = "AdvPlayersList Unit Totals", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unittotals'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Unit Totals"), description = Spring.I18N('ui.settings.option.unittotals_descr') }, - { id = "musicplayer", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.musicplayer'), type = "bool", value = (WG['music'] ~= nil and WG['music'].GetShowGui() or false), description = Spring.I18N('ui.settings.option.musicplayer_descr'), - onload = function(i) - loadWidgetData("AdvPlayersList Music Player New", "musicplayer", { 'showGUI' }) - end, - onchange = function(i, value) - saveOptionValue('AdvPlayersList Music Player New', 'music', 'SetShowGui', { 'showGUI' }, value) - end, - }, - { id = "mascot", group = "ui", category = types.advanced, widget = "AdvPlayersList Mascot", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.mascot'), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Mascot"), description = Spring.I18N('ui.settings.option.mascot_descr') }, - - { id = "displayselectedname", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.displayselectedname'), type = "bool", value = (WG['playertv'] ~= nil and WG['playertv'].GetAlwaysDisplayName() or false), description = Spring.I18N('ui.settings.option.displayselectedname_descr'), - onload = function(i) - loadWidgetData("Player-TV", "displayselectedname", { 'alwaysDisplayName' }) - end, - onchange = function(i, value) - saveOptionValue('Player-TV', 'playertv', 'SetAlwaysDisplayName', { 'alwaysDisplayName' }, value) - end, - }, - - { id = "console_fontsize", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.console') .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.console_fontsize'), type = "slider", min = 0.92, max = 1.12, step = 0.02, value = (WG['chat'] ~= nil and WG['chat'].getFontsize() or 1), description = '', - onload = function(i) - loadWidgetData("Chat", "console_fontsize", { 'fontsizeMult' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setFontsize', { 'fontsizeMult' }, value) - end, - }, - { id = "console_backgroundopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_backgroundopacity'), type = "slider", min = 0, max = 0.45, step = 0.01, value = (WG['chat'] ~= nil and WG['chat'].getBackgroundOpacity() or 0), description = Spring.I18N('ui.settings.option.console_backgroundopacity_descr'), - onload = function(i) - loadWidgetData("Chat", "console_backgroundopacity", { 'chatBackgroundOpacity' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setBackgroundOpacity', { 'chatBackgroundOpacity' }, value) - end, - }, - { id = "console_hidespecchat", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_hidespecchat'), type = "bool", value = (Spring.GetConfigInt("HideSpecChat", 0) == 1), description = Spring.I18N('ui.settings.option.console_hidespecchat_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("HideSpecChat", value and 1 or 0) - end, - }, - { id = "console_hidespecchatplayer", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N('ui.settings.option.console_hidespecchatplayer'), type = "bool", value = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1), description = Spring.I18N('ui.settings.option.console_hidespecchatplayer_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("HideSpecChatPlayer", value and 1 or 0) - end, - }, - { id = "console_hide", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_hide'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getHide() or false), description = Spring.I18N('ui.settings.option.console_hide_descr'), - onload = function(i) - loadWidgetData("Chat", "console_hide", { 'hide' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setHide', { 'hide' }, value) - end, - }, - { id = "console_maxlines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_maxlines'), type = "slider", min = 3, max = 7, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxLines() or 5), description = '', - onload = function(i) - loadWidgetData("Chat", "console_maxlines", { 'maxLines' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setMaxLines', { 'maxLines' }, value) - end, - }, - { id = "console_maxconsolelines", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_maxconsolelines'), type = "slider", min = 2, max = 12, step = 1, value = (WG['chat'] ~= nil and WG['chat'].getMaxConsoleLines() or 2), description = '', - onload = function(i) - loadWidgetData("Chat", "console_maxconsolelines", { 'maxConsoleLines' }) - end, - onchange = function(i, value) - saveOptionValue('Chat', 'chat', 'setMaxConsoleLines', { 'maxConsoleLines' }, value) - end, - }, - --{ id = "console_handleinput", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_handleinput'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getHandleInput() or 0), description = Spring.I18N('ui.settings.option.console_handleinput_descr'), - -- onload = function(i) - -- loadWidgetData("Chat", "console_handleinput", { 'handleTextInput' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('Chat', 'chat', 'setHandleInput', { 'handleTextInput' }, value) - -- end, - --}, - --{ id = "console_inputbutton", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_inputbutton'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getInputButton() or 0), description = Spring.I18N('ui.settings.option.console_inputbutton_descr'), - -- onload = function(i) - -- loadWidgetData("Chat", "console_inputbutton", { 'inputButton' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('Chat', 'chat', 'setInputButton', { 'inputButton' }, value) - -- end, - --}, - { id = "autoeraser", group = "ui", category = types.basic, widget = "Auto mapmark eraser", name = Spring.I18N('ui.settings.option.autoeraser'), type = "bool", value = GetWidgetToggleValue("Auto mapmark eraser"), description = Spring.I18N('ui.settings.option.autoeraser_descr') }, - { id = "autoeraser_erasetime", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.autoeraser_erasetime'), type = "slider", min = 5, max = 600, step = 5, value = 60, description = Spring.I18N('ui.settings.option.autoeraser_erasetime_descr'), - onload = function(i) - loadWidgetData("Auto mapmark eraser", "autoeraser_erasetime", { 'eraseTime' }) - end, - onchange = function(i, value) - saveOptionValue('Auto mapmark eraser', 'autoeraser', 'setEraseTime', { 'eraseTime' }, value) - end, - }, - - { id = "topbar_hidebuttons", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.topbar')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.topbar_hidebuttons'), type = "bool", value = (WG['topbar'] ~= nil and WG['topbar'].getAutoHideButtons() or 0), - onload = function(i) - loadWidgetData("Top Bar", "topbar_hidebuttons", { 'autoHideButtons' }) - end, - onchange = function(i, value) - saveOptionValue('Top Bar', 'topbar', 'setAutoHideButtons', { 'autoHideButtons' }, value) - end, + end, + onchange = function(i, value) + saveOptionValue("SSAO", "ssao", "setPreset", { "preset" }, value) + end, }, - { id = "continuouslyclearmapmarks", group = "ui", category = types.dev, name = Spring.I18N('ui.settings.option.continuouslyclearmapmarks'), type = "bool", value = Spring.GetConfigInt("ContinuouslyClearMapmarks", 0) == 1, description = Spring.I18N('ui.settings.option.continuouslyclearmapmarks_descr'), - onchange = function(i, value) - Spring.SetConfigInt("ContinuouslyClearMapmarks", (value and 1 or 0)) - if value then - Spring.SendCommands({"clearmapmarks"}) - end - end, + { id = "bloomdeferred", group = "gfx", category = types.basic, widget = "Bloom Shader Deferred", name = Spring.I18N("ui.settings.option.bloomdeferred"), type = "bool", value = GetWidgetToggleValue("Bloom Shader Deferred"), description = Spring.I18N("ui.settings.option.bloomdeferred_descr") }, + { + id = "bloomdeferredbrightness", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.bloomdeferredbrightness"), + type = "slider", + min = 0.5, + max = 2.0, + step = 0.05, + value = 1.0, + description = "", + onload = function(i) + loadWidgetData("Bloom Shader Deferred", "bloomdeferredbrightness", { "glowAmplifier" }) + end, + onchange = function(i, value) + saveOptionValue("Bloom Shader Deferred", "bloomdeferred", "setBrightness", { "glowAmplifier" }, value) + end, }, - - { id = "unitgroups", group = "ui", category = types.basic, widget = "Unit Groups", name = Spring.I18N('ui.settings.option.unitgroups'), type = "bool", value = GetWidgetToggleValue("Unit Groups"), description = Spring.I18N('ui.settings.option.unitgroups_descr') }, - { id = "idlebuilders", group = "ui", category = types.basic, widget = "Idle Builders", name = Spring.I18N('ui.settings.option.idlebuilders'), type = "bool", value = GetWidgetToggleValue("Idle Builders"), description = Spring.I18N('ui.settings.option.idlebuilders_descr') }, - { id = "buildbar", group = "ui", category = types.basic, widget = "BuildBar", name = Spring.I18N('ui.settings.option.buildbar'), type = "bool", value = GetWidgetToggleValue("BuildBar"), description = Spring.I18N('ui.settings.option.buildbar_descr') }, - - { id = "converterusage", group = "ui", category = types.advanced, widget = "Converter Usage", name = Spring.I18N('ui.settings.option.converterusage'), type = "bool", value = GetWidgetToggleValue("Converter Usage"), description = Spring.I18N('ui.settings.option.converterusage_descr') }, - - { id = "widgetselector", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.widgetselector'), type = "bool", value = Spring.GetConfigInt("widgetselector", 0) == 1, description = Spring.I18N('ui.settings.option.widgetselector_descr'), - onchange = function(i, value) - Spring.SetConfigInt("widgetselector", (value and 1 or 0)) - end, + { + id = "bloomdeferred_quality", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.bloomdeferred_quality"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_low"), Spring.I18N("ui.settings.option.select_medium"), Spring.I18N("ui.settings.option.select_high") }, + value = (WG["bloomdeferred"] ~= nil and WG["bloomdeferred"].getPreset() or 2), + description = Spring.I18N("ui.settings.option.bloomdeferred_quality_descr"), + onload = function(i) + if widgetHandler.configData["Bloom Shader Deferred"] ~= nil and widgetHandler.configData["Bloom Shader Deferred"].preset ~= nil then + options[getOptionByID("bloomdeferred_quality")].value = widgetHandler.configData["Bloom Shader Deferred"].preset + end + end, + onchange = function(i, value) + saveOptionValue("Bloom Shader Deferred", "bloomdeferred", "setPreset", { "preset" }, value) + end, }, - - { id = "label_ui_visuals", group = "ui", name = Spring.I18N('ui.settings.option.label_visuals'), category = types.basic }, - { id = "label_ui_visuals_spacer", group = "ui", category = types.basic }, - - { id = "uniticon_scaleui", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.uniticonscaleui'), type = "slider", min = 0.85, max = 3, step = 0.05, value = tonumber(Spring.GetConfigFloat("UnitIconScaleUI", 1) or 1), description = Spring.I18N('ui.settings.option.uniticonscaleui_descr'), - onchange = function(i, value) - Spring.SendCommands("iconscaleui " .. value) - Spring.SetConfigFloat("UnitIconScaleUI", value) - end, - }, - { id = "uniticon_distance", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uniticondistance'), type = "slider", min = 1, max = 12000, step = 50, value = tonumber(Spring.GetConfigInt("UnitIconFadeVanish", 2700) or 1), description = Spring.I18N('ui.settings.option.uniticondistance_descr'), - onchange = function(i, value) - Spring.SendCommands("iconfadestart " .. value) - Spring.SetConfigInt("UnitIconFadeStart", value) - -- update UnitIconFadeVanish too - Spring.SendCommands("iconfadevanish " .. value) - Spring.SetConfigInt("UnitIconFadeVanish", value) - end, - }, - { id = "uniticon_hidewithui", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uniticonhidewithui'), type = "bool", value = (Spring.GetConfigInt("UnitIconsHideWithUI", 0) == 1), description = Spring.I18N('ui.settings.option.uniticonhidewithui_descr'), - onchange = function(i, value) - Spring.SendCommands("iconshidewithui " .. (value and 1 or 0)) - Spring.SetConfigInt("UnitIconsHideWithUI", (value and 1 or 0)) - end, + { + id = "lighteffects", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.lighteffects"), + type = "bool", + value = GetWidgetToggleValue("Deferred rendering GL4"), + description = Spring.I18N("ui.settings.option.lighteffects_descr"), + onload = function(i) end, + onchange = function(i, value) + if value then + widgetHandler:EnableWidget("Deferred rendering GL4") + else + widgetHandler:DisableWidget("Deferred rendering GL4") + end + end, }, - - -- { id = "teamcolors", group = "ui", category = types.basic, widget = "Player Color Palette", name = Spring.I18N('ui.settings.option.teamcolors'), type = "bool", value = GetWidgetToggleValue("Player Color Palette"), description = Spring.I18N('ui.settings.option.teamcolors_descr') }, - -- { id = "sameteamcolors", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sameteamcolors'), type = "bool", value = (WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors ~= nil and WG['playercolorpalette'].getSameTeamColors()), description = Spring.I18N('ui.settings.option.sameteamcolors_descr'), - -- onchange = function(i, value) - -- saveOptionValue('Player Color Palette', 'playercolorpalette', 'setSameTeamColors', { 'useSameTeamColors' }, value) - -- end, - -- }, - - - { id = "teamplatter", group = "ui", category = types.basic, widget = "TeamPlatter", name = Spring.I18N('ui.settings.option.teamplatter'), type = "bool", value = GetWidgetToggleValue("TeamPlatter"), description = Spring.I18N('ui.settings.option.teamplatter_descr') }, - { id = "teamplatter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.teamplatter_opacity'), min = 0.05, max = 0.4, step = 0.01, type = "slider", value = 0.25, description = Spring.I18N('ui.settings.option.teamplatter_opacity_descr'), - onload = function(i) - loadWidgetData("TeamPlatter", "teamplatter_opacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('TeamPlatter', 'teamplatter', 'setOpacity', { 'opacity' }, value) - end, + { + id = "lighteffects_headlights", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lighteffects_headlights"), + type = "bool", + value = Spring.GetConfigInt("headlights", 1) == 1, + description = Spring.I18N("ui.settings.option.lighteffects_headlights_descr"), + onchange = function(i, value) + Spring.SetConfigInt("headlights", value and 1 or 0) + if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then + widgetHandler:DisableWidget("Deferred rendering GL4") + widgetHandler:EnableWidget("Deferred rendering GL4") + end + end, }, - { id = "teamplatter_skipownteam", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.teamplatter_skipownteam'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.teamplatter_skipownteam_descr'), - onload = function(i) - loadWidgetData("TeamPlatter", "teamplatter_skipownteam", { 'skipOwnTeam' }) - end, - onchange = function(i, value) - saveOptionValue('TeamPlatter', 'teamplatter', 'setSkipOwnTeam', { 'skipOwnTeam' }, value) - end, + { + id = "lighteffects_buildlights", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lighteffects_buildlights"), + type = "bool", + value = Spring.GetConfigInt("buildlights", 1) == 1, + description = Spring.I18N("ui.settings.option.lighteffects_buildlights_descr"), + onchange = function(i, value) + Spring.SetConfigInt("buildlights", value and 1 or 0) + if widgetHandler.orderList["Deferred rendering GL4"] ~= nil then + widgetHandler:DisableWidget("Deferred rendering GL4") + widgetHandler:EnableWidget("Deferred rendering GL4") + end + end, }, - - { id = "enemyspotter", group = "ui", category = types.basic, widget = "EnemySpotter", name = Spring.I18N('ui.settings.option.enemyspotter'), type = "bool", value = GetWidgetToggleValue("EnemySpotter"), description = Spring.I18N('ui.settings.option.enemyspotter_descr') }, - { id = "enemyspotter_opacity", category = types.advanced, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.enemyspotter_opacity'), min = 0.12, max = 0.4, step = 0.01, type = "slider", value = 0.15, description = Spring.I18N('ui.settings.option.enemyspotter_opacity_descr'), - onload = function(i) - loadWidgetData("EnemySpotter", "enemyspotter_opacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('EnemySpotter', 'enemyspotter', 'setOpacity', { 'opacity' }, value) - end, + { + id = "lighteffects_brightness", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lighteffects_brightness"), + min = 0.4, + max = 1.5, + step = 0.05, + type = "slider", + value = 1, + description = Spring.I18N("ui.settings.option.lighteffects_brightness_descr"), + onload = function(i) + loadWidgetData("Deferred rendering GL4", "lighteffects_brightness", { "intensityMultiplier" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "IntensityMultiplier", { "intensityMultiplier" }, value) + end, }, - - --{ id = "selectedunits", group = "ui", category = types.basic, widget = "Selected Units GL4", name = "Selection", type = "bool", value = GetWidgetToggleValue("Selected Units GL4"), description = Spring.I18N('ui.settings.option.selectedunits_descr') }, - { id = "selectedunits_opacity", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.selectedunits')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.selectedunits_opacity'), min = 0, max = 0.5, step = 0.01, type = "slider", value = 0.19, description = Spring.I18N('ui.settings.option.selectedunits_opacity_descr'), - onload = function(i) - loadWidgetData("Selected Units GL4", "selectedunits_opacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Selected Units GL4', 'selectedunits', 'setOpacity', { 'opacity' }, value) - end, - }, - { id = "selectedunits_teamcoloropacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity'), min = 0, max = 1, step = 0.01, type = "slider", value = 0.6, description = Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), - onload = function(i) - loadWidgetData("Selected Units GL4", "selectedunits_teamcoloropacity", { 'teamcolorOpacity' }) - end, - onchange = function(i, value) - saveOptionValue('Selected Units GL4', 'selectedunits', 'setTeamcolorOpacity', { 'teamcolorOpacity' }, value) - end, + { + id = "lighteffects_radius", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lighteffects_radius"), + min = 0.4, + max = 1.2, + step = 0.05, + type = "slider", + value = 1, + description = Spring.I18N("ui.settings.option.lighteffects_radius_descr"), + onload = function(i) + loadWidgetData("Deferred rendering GL4", "lighteffects_radius", { "radiusMultiplier" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "RadiusMultiplier", { "radiusMultiplier" }, value) + end, }, - --{ id = "highlightselunits", group = "ui", category = types.basic, widget = "Highlight Selected Units GL4", name = Spring.I18N('ui.settings.option.highlightselunits'), type = "bool", value = GetWidgetToggleValue("Highlight Selected Units GL4"), description = Spring.I18N('ui.settings.option.highlightselunits_descr') }, - - { id = "highlightselunits", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.selectedunits_teamcoloropacity_descr'), - onload = function(i) - loadWidgetData("Selected Units GL4", "highlightselunits", { 'selectionHighlight' }) - end, - onchange = function(i, value) - saveOptionValue('Selected Units GL4', 'selectedunits', 'setSelectionHighlight', { 'selectionHighlight' }, value) - end, + { + id = "lighteffects_screenspaceshadows", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lighteffects_screenspaceshadows"), + min = 0, + max = 4, + step = 1, + type = "slider", + value = 2, + description = Spring.I18N("ui.settings.option.lighteffects_screenspaceshadows_descr"), + onload = function(i) + loadWidgetData("Deferred rendering GL4", "lighteffects_screenspaceshadows", { "screenSpaceShadows" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "ScreenSpaceShadows", { "screenSpaceShadows" }, value) + end, }, - --{ id = "highlightselunits_opacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits_opacity'), min = 0.02, max = 0.12, step = 0.01, type = "slider", value = 0.05, description = Spring.I18N('ui.settings.option.highlightselunits_opacity_descr'), - -- onload = function(i) - -- loadWidgetData("Highlight Selected Units GL4", "highlightselunits_opacity", { 'highlightAlpha' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('Highlight Selected Units GL4', 'highlightselunits', 'setOpacity', { 'highlightAlpha' }, value) - -- end, - --}, - --{ id = "highlightselunits_teamcolor", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits_teamcolor'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.highlightselunits_teamcolor_descr'), - -- onload = function(i) - -- loadWidgetData("Highlight Selected Units GL4", "highlightselunits_teamcolor", { 'useTeamcolor' }) - -- end, - -- onchange = function(i, value) - -- saveOptionValue('Highlight Selected Units GL4', 'highlightselunits', 'setTeamcolor', { 'useTeamcolor' }, value) - -- end, - --}, - -- { id = "highlightunit", group = "ui", category = types.advanced, widget = "Highlight Unit GL4", name = Spring.I18N('ui.settings.option.highlightunit'), type = "bool", value = GetWidgetToggleValue("Highlight Unit GL4"), description = Spring.I18N('ui.settings.option.highlightunit_descr') }, - - { id = "highlightunit", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.highlightunit'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.highlightunit_descr'), - onload = function(i) - loadWidgetData("Selected Units GL4", "highlightunit", { 'mouseoverHighlight' }) - end, - onchange = function(i, value) - saveOptionValue('Selected Units GL4', 'selectedunits', 'setMouseoverHighlight', { 'mouseoverHighlight' }, value) - end, + { + id = "lighteffects_nanoparticlelights", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.nanoparticlelights"), + type = "bool", + value = Spring.GetConfigInt("NanoParticleLights", 1) == 1, + description = Spring.I18N("ui.settings.option.nanoparticlelights_descr"), + onchange = function(i, value) + Spring.SetConfigInt("NanoParticleLights", value and 1 or 0) + end, }, - { id = "ghosticons_brightness", group = "ui", category = types.dev, name = Spring.I18N('ui.settings.option.ghosticons') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.ghosticons_brightness'), min = 0, max = 1.0, step = 0.15, type = "slider", value = Spring.GetConfigFloat("UnitGhostIconsDimming", 0.8), description = Spring.I18N('ui.settings.option.ghosticons_brightness_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("UnitGhostIconsDimming", value) - end, - }, + { id = "distortioneffects", group = "gfx", category = types.basic, widget = "Distortion GL4", name = Spring.I18N("ui.settings.option.distortioneffects"), type = "bool", value = GetWidgetToggleValue("Distortion GL4"), description = Spring.I18N("ui.settings.option.distortioneffects_descr") }, - { id = "cursorlight", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.cursorlight'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.cursorlight_descr'), - onload = function(i) - loadWidgetData("Deferred rendering GL4", "cursorlight", { 'showPlayerCursorLight' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'ShowPlayerCursorLight', { 'showPlayerCursorLight' }, value) - end, - }, - { id = "cursorlight_lightradius", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cursorlight_lightradius'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', - onload = function(i) - loadWidgetData("Deferred rendering GL4", "cursorlight_lightradius", { 'playerCursorLightRadius' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'PlayerCursorLightRadius', { 'playerCursorLightRadius' }, value) - end, - }, - { id = "cursorlight_lightstrength", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.cursorlight_lightstrength'), type = "slider", min = 0.3, max = 2, step = 0.05, value = 1, description = '', - onload = function(i) - loadWidgetData("Cursor Light", "cursorlight_lightstrength", { 'playerCursorLightBrightness' }) - end, - onchange = function(i, value) - saveOptionValue('Deferred rendering GL4', 'lightsgl4', 'PlayerCursorLightBrightness', { 'playerCursorLightBrightness' }, value) - end, + { + id = "darkenmap", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.darkenmap"), + min = 0, + max = 0.33, + step = 0.01, + type = "slider", + value = 0, + description = Spring.I18N("ui.settings.option.darkenmap_descr"), + onload = function(i) + loadWidgetData("Darken map", "darkenmap", { "darknessvalue" }) + end, + onchange = function(i, value) + saveOptionValue("Darken map", "darkenmap", "setMapDarkness", { "darknessvalue" }, value) + end, }, + { id = "label_gfx_environment", group = "gfx", name = Spring.I18N("ui.settings.option.label_environment"), category = types.basic }, + { id = "label_gfx_environment_spacer", group = "gfx", category = types.basic }, - { id = "label_ui_info", group = "ui", name = Spring.I18N('ui.settings.option.label_info'), category = types.basic }, - { id = "label_ui_info_spacer", group = "ui", category = types.basic }, - - { id = "metalspots_values", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.metalspots')..widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.metalspots_values'), type = "bool", value = (WG['metalspots'] ~= nil and WG['metalspots'].getShowValue()), description = Spring.I18N('ui.settings.option.metalspots_values_descr'), - onload = function(i) - loadWidgetData("Metalspots", "metalspots_values", { 'showValues' }) - end, - onchange = function(i, value) - if WG.metalspots then - WG.metalspots.setShowValue(value) - end - saveOptionValue('Metalspots', 'metalspots', 'setShowValue', { 'showValue' }, options[getOptionByID('metalspots_values')].value) - end, - }, - { id = "metalspots_metalviewonly", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.metalspots_metalviewonly'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.metalspots_metalviewonly_descr'), - onload = function(i) - loadWidgetData("Metalspots", "metalspots_metalviewonly", { 'metalViewOnly' }) - end, - onchange = function(i, value) - saveOptionValue('Metalspots', 'metalspots', 'setMetalViewOnly', { 'showValue' }, options[getOptionByID('metalspots_metalviewonly')].value) - end, - }, - - { id = "geospots", group = "ui", category = types.dev, widget = "Geothermalspots", name = Spring.I18N('ui.settings.option.geospots'), type = "bool", value = GetWidgetToggleValue("Metalspots"), description = Spring.I18N('ui.settings.option.geospots_descr') }, - - { id = "healthbarsscale", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.healthbars') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsscale'), type = "slider", min = 0.6, max = 2.0, step = 0.1, value = 1, description = '', - onload = function(i) - loadWidgetData("Health Bars GL4", "healthbarsscale", { 'barScale' }) - end, - onchange = function(i, value) - saveOptionValue('Health Bars GL4', 'healthbars', 'setScale', { 'barScale' }, value) - end, - }, - { id = "healthbarsheight", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsheight'), type = "slider", min = 0.7, max = 2, step = 0.1, value = (WG['healthbar'] ~= nil and WG['healthbar'].getHeight() or 0.9), description = '', - onload = function(i) - loadWidgetData("Health Bars GL4", "healthbarsheight", { 'barHeight' }) - end, - onchange = function(i, value) - saveOptionValue('Health Bars GL4', "healthbars", "setHeight", { 'barHeight' }, value) - widgetHandler:DisableWidget("Health Bars GL4") - widgetHandler:EnableWidget("Health Bars GL4") - end, - }, - { id = "healthbarsvariable", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarsvariable'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getVariableSizes()), description = Spring.I18N('ui.settings.option.healthbarsvariable_descr'), - onload = function(i) - loadWidgetData("Health Bars GL4", "healthbarsvariable", { "variableBarSizes" }) - end, - onchange = function(i, value) - saveOptionValue("Health Bars GL4", "healthbars", "setVariableSizes", { "variableBarSizes" }, value) - end, - }, - { id = "healthbarswhenguihidden", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.healthbarswhenguihidden'), type = "bool", value = (WG['healthbar'] ~= nil and WG['healthbar'].getDrawWhenGuiHidden()), description = Spring.I18N('ui.settings.option.healthbarswhenguihidden_descr'), - onload = function(i) - loadWidgetData("Health Bars GL4", "healthbarswhenguihidden", { "drawWhenGuiHidden" }) - end, - onchange = function(i, value) - saveOptionValue("Health Bars GL4", "healthbars", "setDrawWhenGuiHidden", { "drawWhenGuiHidden" }, value) - end, - }, - { id = "rankicons", group = "ui", category = types.advanced, widget = "Rank Icons GL4", name = Spring.I18N('ui.settings.option.rankicons'), type = "bool", value = GetWidgetToggleValue("Rank Icons GL4"), description = Spring.I18N('ui.settings.option.rankicons_descr') }, - { id = "rankicons_distance", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.rankicons_distance'), type = "slider", min = 0.1, max = 1.5, step = 0.05, value = (WG['rankicons'] ~= nil and WG['rankicons'].getDrawDistance ~= nil and WG['rankicons'].getDrawDistance()), description = '', - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Rank Icons', 'rankicons', 'setDrawDistance', { 'distanceMult' }, value) - end, - }, - { id = "rankicons_scale", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.rankicons_scale'), type = "slider", min = 0.5, max = 2, step = 0.1, value = (WG['rankicons'] ~= nil and WG['rankicons'].getScale ~= nil and WG['rankicons'].getScale()), description = '', - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('Rank Icons', 'rankicons', 'setScale', { 'iconsizeMult' }, value) - end, - }, - - { id = "allycursors", group = "ui", category = types.basic, widget = "AllyCursors", name = Spring.I18N('ui.settings.option.allycursors'), type = "bool", value = GetWidgetToggleValue("AllyCursors"), description = Spring.I18N('ui.settings.option.allycursors_descr') }, - { id = "allycursors_playername", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_playername'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_playername_descr'), - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_playername", { 'showPlayerName' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setPlayerNames', { 'showPlayerName' }, value) - end, - }, - { id = "allycursors_showdot", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_showdot'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_showdot_descr'), - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_showdot", { 'showCursorDot' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setCursorDot', { 'showCursorDot' }, value) - end, - }, - { id = "allycursors_spectatorname", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_spectatorname'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_spectatorname_descr'), - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_spectatorname", { 'showSpectatorName' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setSpectatorNames', { 'showSpectatorName' }, value) - end, - }, - { id = "allycursors_lights", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lights'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.allycursors_lights_descr'), - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_lights", { 'addLights' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setLights', { 'addLights' }, options[getOptionByID('allycursors_lights')].value) - end, - }, - { id = "allycursors_lightradius", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lightradius'), type = "slider", min = 0.15, max = 1, step = 0.05, value = 0.5, description = '', - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_lightradius", { 'lightRadiusMult' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setLightRadius', { 'lightRadiusMult' }, value) - end, - }, - { id = "allycursors_lightstrength", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_lightstrength'), type = "slider", min = 0.1, max = 1.2, step = 0.05, value = 0.85, description = '', - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_lightstrength", { 'lightStrengthMult' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setLightStrength', { 'lightStrengthMult' }, value) - end, - }, - { id = "allycursors_selfshadowing", group = "ui", category = types.dev , name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.allycursors_selfshadowing'), type = "bool", value = false, description = '', - onload = function(i) - loadWidgetData("AllyCursors", "allycursors_selfshadowing", { 'lightSelfShadowing' }) - end, - onchange = function(i, value) - saveOptionValue('AllyCursors', 'allycursors', 'setLightSelfShadowing', { 'lightSelfShadowing' }, value) - end, - }, - - { id = "showbuilderqueue", group = "ui", category = types.advanced, widget = "Show Builder Queue", name = Spring.I18N('ui.settings.option.showbuilderqueue'), type = "bool", value = GetWidgetToggleValue("Show Builder Queue"), description = Spring.I18N('ui.settings.option.showbuilderqueue_descr') }, - - { id = "unitenergyicons", group = "ui", category = types.advanced, widget = "Unit Energy Icons", name = Spring.I18N('ui.settings.option.unitenergyicons'), type = "bool", value = GetWidgetToggleValue("Unit Energy Icons"), description = Spring.I18N('ui.settings.option.unitenergyicons_descr') }, - - { id = "unitidlebuildericons", group = "ui", category = types.advanced, widget = "Unit Idle Builder Icons", name = Spring.I18N('ui.settings.option.unitidlebuildericons'), type = "bool", value = GetWidgetToggleValue("Unit Idle Builder Icons"), description = Spring.I18N('ui.settings.option.unitidlebuildericons_descr') }, - - { id = "unitfirestateicons", group = "ui", category = types.advanced, widget = "Unit Fire State Icons", name = Spring.I18N('ui.settings.option.unitfirestateicons'), type = "bool", value = GetWidgetToggleValue("Unit Fire State Icons"), description = Spring.I18N('ui.settings.option.unitfirestateicons_descr') }, - - { id = "resurrectionhalos", group = "ui", category = types.advanced, widget = "Resurrection Halos GL4", name = Spring.I18N('ui.settings.option.resurrectionhalos'), type = "bool", value = GetWidgetToggleValue("Resurrection Halos GL4"), description = Spring.I18N('ui.settings.option.resurrectionhalos_descr') }, - - { id = "nametags_rank", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.nametags_rank'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.nametags_rank_descr'), - onload = function(i) - loadWidgetData("Commander Name Tags", "nametags_rank", { 'showPlayerRank' }) - end, - onchange = function(i, value) - saveOptionValue('Commander Name Tags', 'nametags', 'SetShowPlayerRank', { 'showPlayerRank' }, value) - end, - }, - - { id = "commandsfx", group = "ui", category = types.basic, widget = "Commands FX", name = Spring.I18N('ui.settings.option.commandsfx'), type = "bool", value = GetWidgetToggleValue("Commands FX"), description = Spring.I18N('ui.settings.option.commandsfx_descr') }, - - { id = "commandsfxopacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxopacity'), type = "slider", min = 0.25, max = 1, step = 0.1, value = 1, description = '', - onload = function(i) - loadWidgetData("Commands FX", "commandsfxopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Commands FX', 'commandsfx', 'setOpacity', { 'opacity' }, value) - end, - }, - { id = "commandsfxduration", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxduration'), type = "slider", min = 0.5, max = 2, step = 0.01, value = 1, description = '', - onload = function(i) - loadWidgetData("Commands FX", "commandsfxduration", { 'duration' }) - end, - onchange = function(i, value) - saveOptionValue('Commands FX', 'commandsfx', 'setDuration', { 'duration' }, value) - end, - }, - { id = "commandsfxfilterai", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxfilterai'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.commandsfxfilterai_descr'), - onload = function(i) - loadWidgetData("Commands FX", "commandsfxfilterai", { 'filterAIteams' }) - end, - onchange = function(i, value) - saveOptionValue('Commands FX', 'commandsfx', 'setFilterAI', { 'filterAIteams' }, value) - end, - }, - { id = "commandsfxuseteamcolors", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxuseteamcolors'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.commandsfxuseteamcolors_descr'), - onload = function(i) - loadWidgetData("Commands FX", "commandsfxuseteamcolors", { 'useTeamColors' }) - end, - onchange = function(i, value) - saveOptionValue('Commands FX', 'commandsfx', 'setUseTeamColors', { 'useTeamColors' }, value) - end, - }, - { id = "commandsfxuseteamcolorswhenspec", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.commandsfxuseteamcolorswhenspec'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.commandsfxuseteamcolorswhenspec_descr'), - onload = function(i) - loadWidgetData("Commands FX", "commandsfxuseteamcolorswhenspec", { 'useTeamColorsWhenSpec' }) - end, - onchange = function(i, value) - saveOptionValue('Commands FX', 'commandsfx', 'setUseTeamColorsWhenSpec', { 'useTeamColorsWhenSpec' }, value) - end, + { + id = "featuredrawdist", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.featuredrawdist"), + type = "slider", + min = 2500, + max = 40000, + step = 500, + value = tonumber(Spring.GetConfigInt("FeatureDrawDistance", 10000)), + description = Spring.I18N("ui.settings.option.featuredrawdist_descr"), + onchange = function(i, value) + Spring.SetConfigInt("FeatureFadeDistance", math.floor(value * 0.8)) + Spring.SetConfigInt("FeatureDrawDistance", value) + end, }, - - { id = "flankingicons", group = "ui", category = types.advanced, widget = "Flanking Icons GL4", name = Spring.I18N('ui.settings.option.flankingicons'), type = "bool", value = GetWidgetToggleValue("Flanking Icons GL4"), description = Spring.I18N('ui.settings.option.flankingicons_descr') }, - - { id = "displaydps", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.displaydps'), type = "bool", value = tonumber(Spring.GetConfigInt("DisplayDPS", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.displaydps_descr'), - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("DisplayDPS", (value and 1 or 0)) - end, + { + id = "losopacity", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.lineofsight") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.losopacity"), + type = "slider", + min = 0.01, + max = 1, + step = 0.01, + value = (WG["los"] ~= nil and WG["los"].getOpacity ~= nil and WG["los"].getOpacity()) or 0.66, + description = "", + onload = function(i) + loadWidgetData("LOS colors", "losopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("LOS colors", "los", "setOpacity", { "opacity" }, value) + end, }, - { id = "givenunits", group = "ui", category = types.advanced, widget = "Given Units", name = Spring.I18N('ui.settings.option.givenunits'), type = "bool", value = GetWidgetToggleValue("Given Units"), description = Spring.I18N('ui.settings.option.givenunits_descr') }, - - { id = "reclaimfieldhighlight", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = Spring.I18N('ui.settings.option.reclaimfieldhighlight'), type = "bool", description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_descr') }, - - { id = "reclaimfieldhighlight_metal", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.reclaimfieldhighlight_metal'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_metal_descr'), + { + id = "fogdiaglines", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.lineofsight") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fogdiaglines"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = (WG.fogdiaglines ~= nil and WG.fogdiaglines.getStrength ~= nil and WG.fogdiaglines.getStrength()) or 0.30, + description = "", onload = function(i) - loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_metal", { 'showOption' }) + loadWidgetData("Fog Diagonal Lines GL4", "fogdiaglines", { "strength" }) end, onchange = function(i, value) - saveOptionValue('Reclaim Field Highlight', 'reclaimfieldhighlight', 'setShowOption', { 'showOption' }, value) + saveOptionValue("Fog Diagonal Lines GL4", "fogdiaglines", "setStrength", { "strength" }, value) end, }, - { id = "reclaimfieldhighlight_energy", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.reclaimfieldhighlight_energy'), type = "select", options = reclaimFieldHighlightOptions, value = 3, description = Spring.I18N('ui.settings.option.reclaimfieldhighlight_energy_descr'), + { + id = "fogdiaglines_blur", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.lineofsight") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fogdiaglines_blur"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = (WG.fogdiaglines ~= nil and WG.fogdiaglines.getBlurriness ~= nil and WG.fogdiaglines.getBlurriness()) or 0.187, + description = "", onload = function(i) - loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_energy", { 'showEnergyOption' }) + loadWidgetData("Fog Diagonal Lines GL4", "fogdiaglines_blur", { "blurriness" }) end, onchange = function(i, value) - saveOptionValue('Reclaim Field Highlight', 'reclaimfieldhighlight', 'setShowEnergyOption', { 'showEnergyOption' }, value) + saveOptionValue("Fog Diagonal Lines GL4", "fogdiaglines", "setBlurriness", { "blurriness" }, value) end, }, - { id = "highlightcomwrecks", group = "ui", category = types.advanced, widget = "Highlight Commander Wrecks", name = Spring.I18N('ui.settings.option.highlightcomwrecks'), type = "bool", value = GetWidgetToggleValue("Highlight Commander Wrecks"), description = Spring.I18N('ui.settings.option.highlightcomwrecks_descr') }, - { id = "highlightcomwrecks_teamcolor", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightcomwrecks_teamcolor'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.highlightcomwrecks_teamcolor_descr'), - onload = function(i) - loadWidgetData("Highlight Commander Wrecks", "highlightcomwrecks_teamcolor", { 'useTeamColor' }) - end, - onchange = function(i, value) - saveOptionValue('Highlight Commander Wrecks', 'highlightcomwrecks', 'setUseTeamColor', { 'useTeamColor' }, value) - end, + { + id = "territorial_domination_height_opacity", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.territorial_domination_height_opacity"), + type = "slider", + min = 0.5, + max = 2.0, + step = 0.05, + value = Spring.GetConfigFloat("territorial_domination_height_opacity", 1.0), + description = Spring.I18N("ui.settings.option.territorial_domination_height_opacity_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("territorial_domination_height_opacity", value) + end, }, - { id = "buildinggrid", group = "ui", category = types.basic, widget = "Building Grid GL4", name = Spring.I18N('ui.settings.option.buildinggrid'), type = "bool", value = GetWidgetToggleValue("Building Grid GL4"), description = Spring.I18N('ui.settings.option.buildinggrid_descr') }, - { id = "buildinggridopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.buildinggridopacity'), type = "slider", min = 0.3, max = 1, step = 0.05, value = (WG['buildinggrid'] ~= nil and WG['buildinggrid'].getOpacity ~= nil and WG['buildinggrid'].getOpacity()) or 1, description = '', - onload = function(i) - loadWidgetData("Building Grid GL4", "buildinggridopacity", { 'opacity' }) - end, - onchange = function(i, value) - if widgetHandler.orderList["Building Grid GL4"] and widgetHandler.orderList["Building Grid GL4"] >= 0.5 then - widgetHandler:DisableWidget("Building Grid GL4") - saveOptionValue('Building Grid GL4', 'buildinggrid', 'setOpacity', { 'opacity' }, value) - widgetHandler:EnableWidget("Building Grid GL4") - else - saveOptionValue('Building Grid GL4', 'buildinggrid', 'setOpacity', { 'opacity' }, value) - end - end, + { + id = "water", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.water"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_low"), Spring.I18N("ui.settings.option.select_high") }, + value = desiredWaterValue == 4 and 2 or 1, + onload = function(i) end, + onchange = function(i, value) + desiredWaterValue = value > 1 and 4 or 0 + if waterDetected then + if desiredWaterValue > 0 then + desiredWaterValue = 4 + end + Spring.SendCommands("water " .. desiredWaterValue) + Spring.SetConfigInt("water", 4) + end + end, }, - { id = "startpositionsuggestions", group = "ui", category = types.basic, widget = "Start Position Suggestions", name = Spring.I18N('ui.settings.option.startpositionsuggestions'), type = "bool", value = GetWidgetToggleValue("Start Position Suggestions"), description = Spring.I18N('ui.settings.option.startpositionsuggestions_descr') }, - - { id = "label_ui_ranges", group = "ui", name = Spring.I18N('ui.settings.option.label_ranges'), category = types.basic }, - { id = "label_ui_ranges_spacer", group = "ui", category = types.basic }, + { id = "mapedgeextension", group = "gfx", category = types.advanced, widget = "Map Edge Extension", name = Spring.I18N("ui.settings.option.mapedgeextension"), type = "bool", value = GetWidgetToggleValue("Map Edge Extension"), description = Spring.I18N("ui.settings.option.mapedgeextension_descr") }, - -- Radar range rings: - { id = "radarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Radar", name = Spring.I18N('ui.settings.option.radarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Radar"), description = Spring.I18N('ui.settings.option.radarrange_descr') }, - - { id = "radarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.radarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['radarrange'] ~= nil and WG['radarrange'].getOpacity ~= nil and WG['radarrange'].getOpacity()) or 0.08, description = '', - onload = function(i) - loadWidgetData("Sensor Ranges Radar", "radarrangeopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Sensor Ranges Radar', 'radarrange', 'setOpacity', { 'opacity' }, value) - end, + { + id = "mapedgeextension_brightness", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.mapedgeextension_brightness"), + min = 0.2, + max = 1, + step = 0.01, + type = "slider", + value = 0.3, + description = "", + onload = function(i) + loadWidgetData("Map Edge Extension", "mapedgeextension_brightness", { "brightness" }) + end, + onchange = function(i, value) + saveOptionValue("Map Edge Extension", "mapedgeextension", "setBrightness", { "brightness" }, value) + end, }, - -- Sonar range - { id = "sonarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Sonar", name = Spring.I18N('ui.settings.option.sonarrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Sonar"), description = Spring.I18N('ui.settings.option.sonarrange_descr') }, - - { id = "sonarrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sonarrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['sonarrange'] ~= nil and WG['sonarrange'].getOpacity ~= nil and WG['sonarrange'].getOpacity()) or 0.08, description = '', - onload = function(i) - loadWidgetData("Sensor Ranges Sonar", "sonarrangeopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Sensor Ranges Sonar', 'sonarrange', 'setOpacity', { 'opacity' }, value) - end, + { + id = "mapedgeextension_curvature", + category = types.dev, + group = "gfx", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.mapedgeextension_curvature"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.mapedgeextension_curvature_descr"), + onload = function(i) + loadWidgetData("Map Edge Extension", "mapedgeextension_curvature", { "curvature" }) + end, + onchange = function(i, value) + saveOptionValue("Map Edge Extension", "mapedgeextension", "setCurvature", { "curvature" }, value) + end, }, - -- Jammer range - { id = "jammerrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Jammer", name = Spring.I18N('ui.settings.option.jammerrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Jammer"), description = Spring.I18N('ui.settings.option.jammerrange_descr') }, - { id = "jammerrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.jammerrangeopacity'), type = "slider", min = 0.01, max = 0.66, step = 0.01, value = (WG['jammerrange'] ~= nil and WG['jammerrange'].getOpacity ~= nil and WG['jammerrange'].getOpacity()) or 0.08, description = '', - onload = function(i) - loadWidgetData("Sensor Ranges Jammer", "jammerrangeopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Sensor Ranges Jammer', 'jammerrange', 'setOpacity', { 'opacity' }, value) - end, + { id = "decalsgl4", group = "gfx", category = types.basic, widget = "Decals GL4", name = Spring.I18N("ui.settings.option.decalsgl4"), type = "bool", value = GetWidgetToggleValue("Decals GL4") }, + { + id = "decalsgl4_lifetime", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.decalsgl4_lifetime"), + min = 0.5, + max = 8, + step = 0.1, + type = "slider", + value = 1, + description = Spring.I18N("ui.settings.option.decalsgl4_lifetime_descr"), + onload = function(i) + loadWidgetData("Decals GL4", "decalsgl4_lifetime", { "lifeTimeMult" }) + end, + onchange = function(i, value) + saveOptionValue("Decals GL4", "decalsgl4", "SetLifeTimeMult", { "lifeTimeMult" }, value) + end, }, - -- LOS Range: - { id = "losrange", group = "ui", category = types.advanced, widget = "Sensor Ranges LOS", name = Spring.I18N('ui.settings.option.losrange'), type = "bool", value = GetWidgetToggleValue("Sensor Ranges LOS"), description = Spring.I18N('ui.settings.option.losrange_descr') }, - - { id = "losrangeopacity", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losrangeopacity'), type = "slider", min = 0.01, max = 0.33, step = 0.01, value = (WG['losrange'] ~= nil and WG['losrange'].getOpacity ~= nil and WG['losrange'].getOpacity()) or 0.08, description = '', - onload = function(i) - loadWidgetData("Sensor Ranges LOS", "losrangeopacity", { 'opacity' }) - end, - onchange = function(i, value) - saveOptionValue('Sensor Ranges LOS', 'losrange', 'setOpacity', { 'opacity' }, value) - end, - }, - { id = "losrangeteamcolors", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.losrangeteamcolors'), type = "bool", value = (WG['losrange'] ~= nil and WG['losrange'].getUseTeamColors ~= nil and WG['losrange'].getUseTeamColors()), description = '', - onload = function(i) - loadWidgetData("Sensor Ranges LOS", "losrangeteamcolors", { 'useteamcolors' }) - end, - onchange = function(i, value) - saveOptionValue('Sensor Ranges LOS', 'losrange', 'setUseTeamColors', { 'useteamcolors' }, value) - end, - }, - - { id = "attackrange", group = "ui", category = types.basic, widget = "Attack Range GL4", name = Spring.I18N('ui.settings.option.attackrange'), type = "bool", value = GetWidgetToggleValue("Attack Range GL4"), description = Spring.I18N('ui.settings.option.attackrange_descr') }, - { id = "attackrange_shiftonly", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_shiftonly'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getShiftOnly ~= nil and WG['attackrange'].getShiftOnly()), description = Spring.I18N('ui.settings.option.attackrange_shiftonly_descr'), - onload = function(i) - loadWidgetData("Attack Range GL4", "attackrange_shiftonly", { 'shift_only' }) - end, - onchange = function(i, value) - saveOptionValue('Attack Range GL4', 'attackrange', 'setShiftOnly', { 'shift_only' }, value) - end, - }, - { id = "attackrange_cursorunitrange", category = types.dev, group = "ui", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_cursorunitrange'), type = "bool", value = (WG['attackrange'] ~= nil and WG['attackrange'].getCursorUnitRange ~= nil and WG['attackrange'].getCursorUnitRange()), description = Spring.I18N('ui.settings.option.attackrange_cursorunitrange_descr'), - onload = function(i) - loadWidgetData("Attack Range GL4", "attackrange_cursorunitrange", { 'cursor_unit_range' }) - end, - onchange = function(i, value) - saveOptionValue('Attack Range GL4', 'attackrange', 'setCursorUnitRange', { 'cursor_unit_range' }, value) - end, - }, - { id = "attackrange_numrangesmult", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.attackrange_numrangesmult'), type = "slider", min = 0.3, max = 1, step = 0.1, value = (WG['attackrange'] ~= nil and WG['attackrange'].getOpacity ~= nil and WG['attackrange'].getNumRangesMult()) or 1, description = Spring.I18N('ui.settings.option.attackrange_numrangesmult_descr'), - onload = function(i) - loadWidgetData("Attack Range GL4", "attackrange_numrangesmult", { 'selectionDisableThresholdMult' }) - end, - onchange = function(i, value) - saveOptionValue('Attack Range GL4', 'attackrange', 'setNumRangesMult', { 'selectionDisableThresholdMult' }, value) - end, - }, - - { id = "defrange", group = "ui", category = types.basic, widget = "Defense Range GL4", name = Spring.I18N('ui.settings.option.defrange'), type = "bool", value = GetWidgetToggleValue("Defense Range GL4"), description = Spring.I18N('ui.settings.option.defrange_descr') }, - - { id = "defrange_allyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyAir ~= nil and WG['defrange'].getAllyAir()), description = Spring.I18N('ui.settings.option.defrange_allyair_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_allyair", { 'enabled', 'ally', 'air' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setAllyAir', { 'enabled', 'ally', 'air' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setAllyAir', { 'enabled', 'ally', 'air' }, value) - end, - }, - { id = "defrange_allyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyGround ~= nil and WG['defrange'].getAllyGround()), description = Spring.I18N('ui.settings.option.defrange_allyground_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_allyground", { 'enabled', 'ally', 'ground' }) - loadWidgetData("Defense Range GL4", "defrange_allycannon", { 'enabled', 'ally', 'cannon' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setAllyGround', { 'enabled', 'ally', 'ground' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setAllyGround', { 'enabled', 'ally', 'ground' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setAllyGround', { 'enabled', 'ally', 'cannon' }, value) - end, - }, - { id = "defrange_allynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyNuke ~= nil and WG['defrange'].getAllyNuke()), description = Spring.I18N('ui.settings.option.defrange_allynuke_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_allynuke", { 'enabled', 'ally', 'nuke' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setAllyNuke', { 'enabled', 'ally', 'nuke' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setAllyNuke', { 'enabled', 'ally', 'nuke' }, value) - end, - }, - { id = "defrange_allylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_allylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getAllyLRPC ~= nil and WG['defrange'].getAllyLRPC()), description = Spring.I18N('ui.settings.option.defrange_allylrpc_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_allylrpc", { 'enabled', 'ally', 'lrpc' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setAllyLRPC', { 'enabled', 'ally', 'lrpc' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setAllyLRPC', { 'enabled', 'ally', 'lrpc' }, value) - end, - }, - { id = "defrange_enemyair", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemyair'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyAir ~= nil and WG['defrange'].getEnemyAir()), description = Spring.I18N('ui.settings.option.defrange_enemyair_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_enemyair", { 'enabled', 'enemy', 'air' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setEnemyAir', { 'enabled', 'enemy', 'air' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyAir', { 'enabled', 'enemy', 'air' }, value) - end, - }, - { id = "defrange_enemyground", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemyground'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyGround ~= nil and WG['defrange'].getEnemyGround()), description = Spring.I18N('ui.settings.option.defrange_enemyground_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_enemyground", { 'enabled', 'enemy', 'ground' }) - loadWidgetData("Defense Range GL4", "defrange_enemyground", { 'enabled', 'enemy', 'cannon' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setEnemyGround', { 'enabled', 'enemy', 'ground' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyGround', { 'enabled', 'enemy', 'ground' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyGround', { 'enabled', 'enemy', 'cannon' }, value) - end, - }, - { id = "defrange_enemynuke", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemynuke'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyNuke ~= nil and WG['defrange'].getEnemyNuke()), description = Spring.I18N('ui.settings.option.defrange_enemynuke_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_enemynuke", { 'enabled', 'enemy', 'nuke' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setEnemyNuke', { 'enabled', 'enemy', 'nuke' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyNuke', { 'enabled', 'enemy', 'nuke' }, value) - end, - }, - { id = "defrange_enemylrpc", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.defrange_enemylrpc'), type = "bool", value = (WG['defrange'] ~= nil and WG['defrange'].getEnemyLRPC ~= nil and WG['defrange'].getEnemyLRPC()), description = Spring.I18N('ui.settings.option.defrange_enemylrpc_descr'), - onload = function(i) - loadWidgetData("Defense Range GL4", "defrange_enemylrpc", { 'enabled', 'enemy', 'lrpc' }) - end, - onchange = function(i, value) - --saveOptionValue('Defense Range', 'defrange', 'setEnemyLRPC', { 'enabled', 'enemy', 'lrpc' }, value) - saveOptionValue('Defense Range GL4', 'defrange', 'setEnemyLRPC', { 'enabled', 'enemy', 'lrpc' }, value) - end, - }, - - { id = "antiranges", group = "ui", category = types.advanced, widget = "Anti Ranges", name = Spring.I18N('ui.settings.option.antiranges'), type = "bool", value = GetWidgetToggleValue("Anti Ranges"), description = Spring.I18N('ui.settings.option.antiranges_descr') }, - - { id = "label_ui_spectator", group = "ui", name = Spring.I18N('ui.settings.option.label_spectator'), category = types.basic }, - { id = "label_ui_spectator_spacer", group = "ui", category = types.basic }, - - { id = "spectator_hud", group = "ui", category = types.basic, widget = "Spectator HUD", name = Spring.I18N('ui.settings.option.spectator_hud'), type = "bool", value = GetWidgetToggleValue("Spectator HUD"), description = Spring.I18N('ui.settings.option.spectator_hud_descr') }, - { id = "spectator_hud_size", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.spectator_hud_size'), type = "slider", min = 0.1, max = 2, step = 0.1, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getWidgetSize ~= nil and WG['spectator_hud'].getWidgetSize()) or 0.8, description = '', - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_size", { 'widgetScale' }) - end, - onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setWidgetSize', { 'widgetScale' }, value) - end, + { + id = "decals", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.decals"), + restart = true, + min = 0, + max = 3, + step = 1, + type = "slider", + value = Spring.GetConfigInt("GroundDecals", 0), + description = Spring.I18N("ui.settings.option.decals_descr"), + onchange = function(i, value) + Spring.SetConfigInt("GroundDecals", value) + Spring.SendCommands("GroundDecals " .. value) + end, }, - { id = "spectator_hud_config", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.spectator_hud_config'), type = "select", options = spectatorHUDConfigOptions, value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getConfig ~= nil and WG['spectator_hud'].getConfig()) or 1, description = Spring.I18N('ui.settings.option.spectator_hud_config_descr'), + { id = "grass", group = "gfx", category = types.basic, widget = "Map Grass GL4", name = Spring.I18N("ui.settings.option.grass"), type = "bool", value = GetWidgetToggleValue("Map Grass GL4"), description = Spring.I18N("ui.settings.option.grass_desc") }, + { + id = "grassdistance", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.grassdistance"), + type = "slider", + min = 0.3, + max = 1, + step = 0.01, + value = 1, + description = Spring.I18N("ui.settings.option.grassdistance_desc"), onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_config", { 'config' }) + loadWidgetData("Map Grass GL4", "grassdistance", { "distanceMult" }) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setConfig', { 'config' }, value) - init() + saveOptionValue("Map Grass GL4", "grassgl4", "setDistanceMult", { "distanceMult" }, value) + end, + }, + + { + id = "treewind", + group = "gfx", + category = types.dev, + name = Spring.I18N("ui.settings.option.treewind"), + type = "bool", + value = tonumber(Spring.GetConfigInt("TreeWind", 1) or 1) == 1, + description = Spring.I18N("ui.settings.option.treewind_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SendCommands("luarules treewind " .. (value and 1 or 0)) + Spring.SetConfigInt("TreeWind", (value and 1 or 0)) end, }, - { id = "spectator_hud_metric_metalIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalIncome')) or 1, description = Spring.I18N('ui.spectator_hud.metalIncome_tooltip'), + { id = "snow", group = "gfx", category = types.basic, widget = "Snow", name = Spring.I18N("ui.settings.option.snow"), type = "bool", value = GetWidgetToggleValue("Snow"), description = Spring.I18N("ui.settings.option.snow_descr") }, + { + id = "snowmap", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.snowmap"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.snowmap_descr"), onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_metalIncome", { 'metricsEnabled', 'metalIncome' }) + loadWidgetData("Snow", "snowmap", { "snowMaps", Game.mapName:lower() }) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalIncome' }, value, { 'metalIncome', value }) + saveOptionValue("Snow", "snow", "setSnowMap", { "snowMaps", Game.mapName:lower() }, value) end, }, - { id = "spectator_hud_metric_energyIncome", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyIncome_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyIncome')) or 1, description = Spring.I18N('ui.spectator_hud.energyIncome_tooltip'), + { + id = "snowautoreduce", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.snowautoreduce"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.snowautoreduce_descr"), onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_energyIncome", { 'metricsEnabled', 'energyIncome' }) + loadWidgetData("Snow", "snowautoreduce", { "autoReduce" }) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyIncome' }, value, { 'energyIncome', value }) + saveOptionValue("Snow", "snow", "setAutoReduce", { "autoReduce" }, value) end, }, - { id = "spectator_hud_metric_buildPower", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.buildPower_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('buildPower')) or 1, description = Spring.I18N('ui.spectator_hud.buildPower_tooltip'), + { + id = "snowamount", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.snowamount"), + type = "slider", + min = 0.2, + max = 3, + step = 0.2, + value = 1, + description = Spring.I18N("ui.settings.option.snowamount_descr"), onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_buildPower", { 'metricsEnabled', 'buildPower' }) + loadWidgetData("Snow", "snowamount", { "customParticleMultiplier" }) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'buildPower' }, value, { 'buildPower', value }) + saveOptionValue("Snow", "snow", "setMultiplier", { "customParticleMultiplier" }, value) end, }, - { id = "spectator_hud_metric_metalProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalProduced')) or 1, description = Spring.I18N('ui.spectator_hud.metalProduced_tooltip'), + + { id = "clouds", group = "gfx", category = types.advanced, widget = "Volumetric Clouds", name = Spring.I18N("ui.settings.option.clouds"), type = "bool", value = GetWidgetToggleValue("Volumetric Clouds"), description = "" }, + { + id = "clouds_opacity", + group = "gfx", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.clouds_opacity"), + type = "slider", + min = 0.2, + max = 1.4, + step = 0.05, + value = 1, + description = "", onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_metalProduced", { 'metricsEnabled', 'metalProduced' }) + loadWidgetData("Volumetric Clouds", "clouds_opacity", { "opacityMult" }) + end, + onchange = function(i, value) + saveOptionValue("Volumetric Clouds", "clouds", "setOpacity", { "opacityMult" }, value) + end, + }, + { + id = "fogmult", + group = "gfx", + category = types.advanced, + name = Spring.I18N("ui.settings.option.fog"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = Spring.GetConfigFloat("FogMult", 1), + description = Spring.I18N("ui.settings.option.fogmult_descr"), + onload = function(i) + options[i].onchange(i, options[i].value) + end, + onchange = function(i, value) + Spring.SetConfigFloat("FogMult", value) + value = 1 / value -- inverse + local newFogStart = math.min(9, (defaultMapFog.fogStart * ((value + 4) * 0.2))) + local newFogEnd = math.min(9, defaultMapFog.fogEnd * ((value + 1) * 0.5)) + if newFogStart >= newFogEnd then + newFogStart = newFogEnd - 0.01 + end + Spring.SetAtmosphere({ fogStart = newFogStart, fogEnd = newFogEnd }) + end, + }, + + { id = "label_gfx_effects", group = "gfx", name = Spring.I18N("ui.settings.option.label_effects"), category = types.basic }, + { id = "label_gfx_effects_spacer", group = "gfx", category = types.basic }, + + { + id = "particles", + group = "gfx", + category = types.basic, + name = Spring.I18N("ui.settings.option.particles"), + type = "slider", + min = 10000, + max = 40000, + step = 1000, + value = tonumber(Spring.GetConfigInt("MaxParticles", 1) or 15000), + description = Spring.I18N("ui.settings.option.particles_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("MaxParticles", value) + -- Keep the engine nano-spray budget in sync when the gadget is + -- handing particles back to the engine (NanoParticleMode 0). + if Spring.GetConfigInt("NanoParticleMode", 1) == 0 then + Spring.SetConfigInt("MaxNanoParticles", math.floor(value * 0.34)) + if Spring.GetConfigInt("NanoParticleMode", 1) == 0 then + Spring.SetConfigInt("MaxNanoParticles", math.floor(Spring.GetConfigInt("MaxParticles", 15000) * 0.34)) + else + Spring.SetConfigInt("MaxNanoParticles", 0) + end + end + end, + }, + + { + id = "nanoparticletype", + group = "gfx", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.nanoparticletype"), + type = "select", + options = { + Spring.I18N("ui.settings.option.nanoparticletype_simple"), + Spring.I18N("ui.settings.option.nanoparticletype_shapes"), + }, + value = (tonumber(Spring.GetConfigInt("NanoParticleMode", 1)) or 1) + 1, + description = Spring.I18N("ui.settings.option.nanoparticletype_descr"), + onload = function(i) end, + onchange = function(i, value) + local mode = value - 1 + Spring.SetConfigInt("NanoParticleMode", mode) + if mode == 0 then + Spring.SetConfigInt("MaxNanoParticles", math.floor(Spring.GetConfigInt("MaxParticles", 15000) * 0.34)) + else + Spring.SetConfigInt("MaxNanoParticles", 0) + end + end, + }, + + { id = "dof", group = "gfx", category = types.advanced, widget = "Depth of Field", name = Spring.I18N("ui.settings.option.dof"), type = "bool", value = GetWidgetToggleValue("Depth of Field"), description = Spring.I18N("ui.settings.option.dof_descr") }, + { + id = "dof_autofocus", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.dof_autofocus"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.dof_autofocus_descr"), + onload = function(i) + loadWidgetData("Depth of Field", "dof_autofocus", { "autofocus" }) + end, + onchange = function(i, value) + saveOptionValue("Depth of Field", "dof", "setAutofocus", { "autofocus" }, value) + end, + }, + { + id = "dof_fstop", + group = "gfx", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.dof_fstop"), + type = "slider", + min = 1, + max = 6, + step = 0.1, + value = 2, + description = Spring.I18N("ui.settings.option.dof_fstop_descr"), + onload = function(i) + loadWidgetData("Depth of Field", "dof_fstop", { "fStop" }) + end, + onchange = function(i, value) + saveOptionValue("Depth of Field", "dof", "setFstop", { "fStop" }, value) + end, + }, + + -- SOUND + { + id = "snddevice", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.snddevice"), + type = "select", + restart = true, + options = soundDevices, + value = soundDevicesByName[Spring.GetConfigString("snd_device")], + description = Spring.I18N("ui.settings.option.snddevice_descr"), + onchange = function(i, value) + if options[i].options[options[i].value] == "default" then + Spring.SetConfigString("snd_device", "") + else + Spring.SetConfigString("snd_device", options[i].options[options[i].value]) + end + end, + }, + + { + id = "sndvolmaster", + group = "sound", + category = types.basic, + name = Spring.I18N("ui.settings.option.volume") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sndvolmaster"), + type = "slider", + min = 0, + max = 80, + step = 2, + value = tonumber(Spring.GetConfigInt("snd_volmaster", 1) or 80), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("snd_volmaster", value) + end, + }, + { + id = "sndvolgeneral", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sndvolgeneral"), + type = "slider", + min = 0, + max = 100, + step = 2, + value = tonumber(Spring.GetConfigInt("snd_volgeneral", 1) or 100), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("snd_volgeneral", value) + end, + }, + { + id = "sndvolbattle", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sndvolbattle"), + type = "slider", + min = 0, + max = 100, + step = 2, + value = tonumber(Spring.GetConfigInt("snd_volbattle_options", 100) or 100), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("snd_volbattle_options", value) + end, + }, + { + id = "sndvolui", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sndvolui"), + type = "slider", + min = 0, + max = 100, + step = 2, + value = tonumber(Spring.GetConfigInt("snd_volui", 1) or 100), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("snd_volui", value) + end, + }, + --{ id = "sndambient", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolambient'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volambient", 1) or 100), + -- onload = function(i) + -- end, + -- onchange = function(i, value) + -- Spring.SetConfigInt("snd_volambient", value) + -- end, + --}, + --{ id = "sndvolunitreply", group = "sound", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sndvolunitreply'), type = "slider", min = 0, max = 100, step = 2, value = tonumber(Spring.GetConfigInt("snd_volunitreply", 1) or 100), + -- onload = function(i) + -- end, + -- onchange = function(i, value) + -- Spring.SetConfigInt("snd_volunitreply", value) + -- end, + --}, + { + id = "console_chatvolume", + group = "sound", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_chatvolume"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = (WG["chat"] ~= nil and WG["chat"].getChatVolume() or 0), + description = Spring.I18N("ui.settings.option.console_chatvolume_descr"), + onload = function(i) + loadWidgetData("Chat", "console_chatvolume", { "sndChatFileVolume" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setChatVolume", { "sndChatFileVolume" }, value) + end, + }, + { + id = "mapmarkvolume", + group = "sound", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_mapmarkvolume"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = (WG["mapmarkping"] ~= nil and WG["mapmarkping"].getMapmarkVolume() or 0.6), + description = Spring.I18N("ui.settings.option.console_mapmarkvolume_descr"), + onload = function(i) + loadWidgetData("Chat", "mapmarkvolume", { "volume" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "mapmarkping", "setMapmarkVolume", { "volume" }, value) + end, + }, + { + id = "sndvolmusic", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sndvolmusic"), + type = "slider", + min = 0, + max = 99, + step = 1, + value = tonumber(Spring.GetConfigInt("snd_volmusic", 50) or 50), + onload = function(i) end, + onchange = function(i, value) + if WG["music"] and WG["music"].SetMusicVolume then + WG["music"].SetMusicVolume(value) + else + Spring.SetConfigInt("snd_volmusic", value) + end + end, + }, + + { + id = "sndunitsound", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.sndunitsound"), + type = "bool", + value = (Spring.GetConfigInt("snd_unitsound", 1) == 1), + description = Spring.I18N("ui.settings.option.sndunitsound_desc"), + onchange = function(i, value) + Spring.SetConfigInt("snd_unitsound", (value and 1 or 0)) + end, + }, + + { + id = "sndairabsorption", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.sndairabsorption"), + type = "slider", + min = 0, + max = 0.4, + step = 0.01, + value = tonumber(Spring.GetConfigFloat("snd_airAbsorption", 0.35) or 0.35), + description = Spring.I18N("ui.settings.option.sndairabsorption_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigFloat("snd_airAbsorption", value) + end, + }, + + { + id = "sndzoomvolume", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.sndzoomvolume"), + type = "slider", + min = 0, + max = 3, + step = 0.01, + value = tonumber(Spring.GetConfigFloat("snd_zoomVolume", 1.00) or 1.00), + description = Spring.I18N("ui.settings.option.sndzoomvolume_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigFloat("snd_zoomVolume", value) + end, + }, + + { + id = "muteoffscreen", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.muteoffscreen"), + type = "bool", + value = (Spring.GetConfigInt("muteOffscreen", 0) == 1), + description = Spring.I18N("ui.settings.option.muteoffscreen_descr"), + onchange = function(i, value) + Spring.SetConfigInt("muteOffscreen", (value and 1 or 0)) + end, + }, + + { id = "soundtrack", group = "sound", category = types.basic, name = Spring.I18N("ui.settings.option.label_soundtrack") }, + { id = "soundtrack_spacer", group = "sound", category = types.basic }, + + { + id = "soundtrackNew", + group = "sound", + category = types.basic, + name = Spring.I18N("ui.settings.option.soundtracknew"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackNew", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtracknew_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackNew", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackRaptors", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackraptors"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackRaptors", 0) == 1, + description = Spring.I18N("ui.settings.option.soundtrackraptors_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackRaptors", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackScavengers", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackscavengers"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackScavengers", 0) == 1, + description = Spring.I18N("ui.settings.option.soundtrackscavengers_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackScavengers", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackAprilFools", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackaprilfools"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackAprilFools", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackaprilfools_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackAprilFools", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackAprilFoolsPostEvent", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackaprilfoolspostevent"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackAprilFoolsPostEvent", 0) == 1, + description = Spring.I18N("ui.settings.option.soundtrackaprilfoolspostevent_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackAprilFoolsPostEvent", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackHalloween", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackhalloween"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackHalloween", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackhalloween_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackHalloween", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackHalloweenPostEvent", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackhalloweenpostevent"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackHalloweenPostEvent", 0) == 1, + description = Spring.I18N("ui.settings.option.soundtrackhalloweenpostevent_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackHalloweenPostEvent", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackXmas", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackxmas"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackXmas", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackxmas_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackXmas", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackXmasPostEvent", + group = "sound", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.soundtrackxmaspostevent"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackXmasPostEvent", 0) == 1, + description = Spring.I18N("ui.settings.option.soundtrackxmaspostevent_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackXmasPostEvent", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackCustom", + group = "sound", + category = types.advanced, + name = Spring.I18N("ui.settings.option.soundtrackcustom"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackCustom", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackcustom_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackCustom", value and 1 or 0) + if WG["music"] and WG["music"].RefreshTrackList then + WG["music"].RefreshTrackList() + init() + end + end, + }, + { + id = "soundtrackInterruption", + group = "sound", + category = types.basic, + name = Spring.I18N("ui.settings.option.soundtrackinterruption"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackInterruption", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackinterruption_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackInterruption", value and 1 or 0) + if WG["music"] and WG["music"].RefreshSettings then + WG["music"].RefreshSettings() + end + end, + }, + { + id = "soundtrackFades", + group = "sound", + category = types.basic, + name = Spring.I18N("ui.settings.option.soundtrackfades"), + type = "bool", + value = Spring.GetConfigInt("UseSoundtrackFades", 1) == 1, + description = Spring.I18N("ui.settings.option.soundtrackfades_descr"), + onchange = function(i, value) + Spring.SetConfigInt("UseSoundtrackFades", value and 1 or 0) + if WG["music"] and WG["music"].RefreshSettings then + WG["music"].RefreshSettings() + end + end, + }, + + --{ id = "loadscreen_music", group = "sound", category = types.basic, name = Spring.I18N('ui.settings.option.loadscreen_music'), type = "bool", value = (Spring.GetConfigInt("music_loadscreen", 1) == 1), description = Spring.I18N('ui.settings.option.loadscreen_music_descr'), + -- onchange = function(i, value) + -- Spring.SetConfigInt("music_loadscreen", (value and 1 or 0)) + -- end, + --}, + + { + id = "notifications_set", + group = "notif", + category = types.basic, + name = Spring.I18N("ui.settings.option.notifications_set"), + type = "select", + options = {}, + value = 1, + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigString("voiceset", options[i].options[options[i].value]) + if widgetHandler.orderList["Notifications"] ~= nil then + widgetHandler:DisableWidget("Notifications") + widgetHandler:EnableWidget("Notifications") + init() + end + end, + }, + + --{ id = "notifications_tutorial", group = "notif", name = Spring.I18N('ui.settings.option.notifications_tutorial'), category = types.basic, type = "bool", value = (WG['notifications'] ~= nil and WG['notifications'].getTutorial()), description = Spring.I18N('ui.settings.option.notifications_tutorial_descr'), + -- onload = function(i) + -- loadWidgetData("Notifications", "notifications_tutorial", { 'tutorialMode' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('Notifications', 'notifications', 'setTutorial', { 'tutorialMode' }, value) + -- end, + --}, + { + id = "notifications_messages", + group = "notif", + name = Spring.I18N("ui.settings.option.notifications_messages"), + category = types.basic, + type = "bool", + value = (WG["notifications"] ~= nil and WG["notifications"].getMessages()), + description = Spring.I18N("ui.settings.option.notifications_messages_descr"), + onload = function(i) + loadWidgetData("Notifications", "notifications_messages", { "displayMessages" }) + end, + onchange = function(i, value) + saveOptionValue("Notifications", "notifications", "setMessages", { "displayMessages" }, value) + end, + }, + { + id = "notifications_spoken", + group = "notif", + name = Spring.I18N("ui.settings.option.notifications_spoken"), + category = types.basic, + type = "bool", + value = (WG["notifications"] ~= nil and WG["notifications"].getSpoken()), + description = Spring.I18N("ui.settings.option.notifications_spoken_descr"), + onload = function(i) + loadWidgetData("Notifications", "notifications_spoken", { "spoken" }) + end, + onchange = function(i, value) + saveOptionValue("Notifications", "notifications", "setSpoken", { "spoken" }, value) + end, + }, + { + id = "notifications_volume", + group = "notif", + category = types.basic, + name = Spring.I18N("ui.settings.option.notifications_volume"), + type = "slider", + min = 0.05, + max = 1, + step = 0.05, + value = 0.7, + description = Spring.I18N("ui.settings.option.notifications_volume_descr"), + onload = function(i) + loadWidgetData("Notifications", "notifications_volume", { "globalVolume" }) + end, + onchange = function(i, value) + saveOptionValue("Notifications", "notifications", "setVolume", { "globalVolume" }, value) + end, + }, + { + id = "notifications_substitute", + group = "notif", + category = types.advanced, + name = Spring.I18N("ui.settings.option.notifications_substitute"), + type = "bool", + value = Spring.GetConfigInt("NotificationsSubstitute", 0) == 1, + description = Spring.I18N("ui.settings.option.notifications_substitute_descr"), + onchange = function(i, value) + Spring.SetConfigInt("NotificationsSubstitute", value and 1 or 0) + widgetHandler:DisableWidget("Notifications") + widgetHandler:EnableWidget("Notifications") + init() + end, + }, + { + id = "notifications_refresh", + group = "notif", + category = types.advanced, + name = Spring.I18N("ui.settings.option.notifications_refresh"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.notifications_refresh_descr"), + onchange = function(i, value) + widgetHandler:DisableWidget("Notifications") + widgetHandler:EnableWidget("Notifications") + init() + end, + }, + + { id = "label_notif_messages", group = "notif", name = Spring.I18N("ui.settings.option.label_messages"), category = types.basic }, + { id = "label_notif_messages_spacer", group = "notif", category = types.basic }, + + -- CONTROL + { id = "label_ui_hotkeys", group = "control", name = Spring.I18N("ui.settings.option.label_hotkeys"), category = types.basic }, + { id = "label_ui_hotkeys_spacer", group = "control", category = types.basic }, + + { + id = "keylayout", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.keylayout"), + type = "select", + options = keyLayouts.layouts, + value = 1, + description = Spring.I18N("ui.settings.option.keylayout_descr"), + onload = function() + local keyLayout = Spring.GetConfigString("KeyboardLayout") + + if not keyLayout or keyLayout == "" then + keyLayout = keyLayouts.layouts[1] + Spring.SetConfigString("KeyboardLayout", keyLayouts.layouts[1]) + end + + local value = 1 + for i, v in ipairs(keyLayouts.layouts) do + if v == keyLayout then + value = i + break + end + end + + options[getOptionByID("keylayout")].value = value + end, + onchange = function(_, value) + Spring.SetConfigString("KeyboardLayout", keyLayouts.layouts[value]) + if WG["bar_hotkeys"] and WG["bar_hotkeys"].reloadBindings then + WG["bar_hotkeys"].reloadBindings() + end + end, + }, + + { + id = "keybindings", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.keybindings"), + type = "select", + options = keyLayouts.keybindingLayouts, + value = 1, + description = Spring.I18N("ui.settings.option.keybindings_descr"), + onload = function() + local keyFile = Spring.GetConfigString("KeybindingFile") + local value = 1 + + if (not keyFile) or (keyFile == "") or (not VFS.FileExists(keyFile)) then + keyFile = keyLayouts.keybindingLayoutFiles[1] + end + + for i, v in ipairs(keyLayouts.keybindingLayoutFiles) do + if v == keyFile then + value = i + break + end + end + + options[getOptionByID("keybindings")].value = value + end, + onchange = function(_, value) + local keyFile = keyLayouts.keybindingLayoutFiles[value] + + if not keyFile or keyFile == "" then + return + end + + local isCustom = keyLayouts.keybindingPresets["Custom"] == keyFile + + if isCustom and not VFS.FileExists(keyFile) then + Spring.SendCommands("keysave " .. keyFile) + Spring.Echo("Preset Custom selected, file saved at: " .. keyFile) + end + + Spring.SetConfigString("KeybindingFile", keyFile) + if isCustom then + Spring.Echo("To test your custom bindings after changes type in chat: /keyreload") + end + -- enable grid menu for grid keybinds + local preset = options[getOptionByID("keybindings")].options[value] + Spring.Echo(preset) + if string.find(string.lower(preset), "grid", nil, true) then + widgetHandler:DisableWidget("Build menu") + widgetHandler:EnableWidget("Grid menu") + elseif preset == "Custom" then + -- do stuff with custom preset + else + widgetHandler:DisableWidget("Grid menu") + widgetHandler:EnableWidget("Build menu") + end + + if WG["bar_hotkeys"] and WG["bar_hotkeys"].reloadBindings then + WG["bar_hotkeys"].reloadBindings() + end + init() + end, + }, + + { + id = "gridmenu", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.gridmenu"), + type = "bool", + value = GetWidgetToggleValue("Grid menu"), + description = Spring.I18N("ui.settings.option.gridmenu_descr"), + onchange = function(i, value) + if value then + widgetHandler:DisableWidget("Build menu") + widgetHandler:EnableWidget("Grid menu") + else + widgetHandler:DisableWidget("Grid menu") + widgetHandler:EnableWidget("Build menu") + end + init() + end, + }, + { + id = "gridmenu_alwaysreturn", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.gridmenu_alwaysreturn"), + type = "bool", + value = (WG["gridmenu"] ~= nil and WG["gridmenu"].getAlwaysReturn ~= nil and WG["gridmenu"].getAlwaysReturn()), + description = Spring.I18N("ui.settings.option.gridmenu_alwaysreturn_descr"), + onload = function() end, + onchange = function(_, value) + saveOptionValue("Grid menu", "gridmenu", "setAlwaysReturn", { "alwaysReturn" }, value) + end, + }, + { + id = "gridmenu_autoselectfirst", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.gridmenu_autoselectfirst"), + type = "bool", + value = (WG["gridmenu"] ~= nil and WG["gridmenu"].getAutoSelectFirst ~= nil and WG["gridmenu"].getAutoSelectFirst()), + description = Spring.I18N("ui.settings.option.gridmenu_autoselectfirst_descr"), + onload = function() end, + onchange = function(_, value) + saveOptionValue("Grid menu", "gridmenu", "setAutoSelectFirst", { "autoSelectFirst" }, value) + end, + }, + { + id = "gridmenu_labbuildmode", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.gridmenu_labbuildmode"), + type = "bool", + value = (WG["gridmenu"] ~= nil and WG["gridmenu"].getUseLabBuildMode ~= nil and WG["gridmenu"].getUseLabBuildMode()), + description = Spring.I18N("ui.settings.option.gridmenu_labbuildmode_descr"), + onload = function() end, + onchange = function(_, value) + saveOptionValue("Grid menu", "gridmenu", "setUseLabBuildMode", { "useLabBuildMode" }, value) + end, + }, + + { + id = "gridmenu_ctrlkeymodifier", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.gridmenu_ctrlkeymodifier"), + type = "slider", + min = -20, + max = 100, + step = 1, + value = (WG["gridmenu"] ~= nil and WG["gridmenu"].getCtrlKeyModifier ~= nil and WG["gridmenu"].getCtrlKeyModifier()), + description = Spring.I18N("ui.settings.option.gridmenu_ctrlkeymodifier_descr"), + onload = function() end, + onchange = function(_, value) + saveOptionValue("Grid menu", "gridmenu", "setCtrlKeyModifier", { "ctrlKeyModifier" }, value) + end, + }, + { + id = "gridmenu_shiftkeymodifier", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.gridmenu_shiftkeymodifier"), + type = "slider", + min = -20, + max = 100, + step = 1, + value = (WG["gridmenu"] ~= nil and WG["gridmenu"].getShiftKeyModifier ~= nil and WG["gridmenu"].getShiftKeyModifier()), + description = Spring.I18N("ui.settings.option.gridmenu_shiftkeymodifier_descr"), + onload = function() end, + onchange = function(_, value) + saveOptionValue("Grid menu", "gridmenu", "setShiftKeyModifier", { "ShiftKeyModifier" }, value) + end, + }, + + { id = "label_ui_cursor", group = "control", name = Spring.I18N("ui.settings.option.label_cursor"), category = types.basic }, + { id = "label_ui_cursor_spacer", group = "control", category = types.basic }, + + { + id = "hwcursor", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.hwcursor"), + type = "bool", + value = tonumber(Spring.GetConfigInt("HardwareCursor", 0) or 0) == 1, + description = Spring.I18N("ui.settings.option.hwcursor_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SendCommands("HardwareCursor " .. (value and 1 or 0)) + Spring.SetConfigInt("HardwareCursor", (value and 1 or 0)) + end, + }, + { + id = "setcamera_bugfix", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.setcamera_bugfix"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.setcamera_bugfix_descr"), + onload = function(i) + WG["setcamera_bugfix"] = true + end, + onchange = function(i, value) + WG["setcamera_bugfix"] = value + end, + }, + { + id = "cursorsize", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.cursorsize"), + type = "slider", + min = 0.3, + max = 1.7, + step = 0.1, + value = 1, + description = Spring.I18N("ui.settings.option.cursorsize_descr"), + onload = function(i) end, + onchange = function(i, value) + if WG["cursors"] then + WG["cursors"].setsizemult(value) + end + end, + }, + + { + id = "containmouse", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.containmouse"), + type = "bool", + value = Spring.GetConfigInt("grabinput", 1) == 1, + description = Spring.I18N("ui.settings.option.containmouse_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("grabinput", (value and 1 or 0)) + updateGrabinput() + end, + }, + + { + id = "doubleclicktime", + group = "control", + category = types.advanced, + restart = true, + name = Spring.I18N("ui.settings.option.doubleclicktime"), + type = "slider", + min = 150, + max = 400, + step = 10, + value = Spring.GetConfigInt("DoubleClickTime", 200), + description = Spring.I18N("ui.settings.option.doubleclicktime_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("DoubleClickTime", value) + end, + }, + + { + id = "dragthreshold", + group = "control", + category = types.advanced, + restart = false, + name = Spring.I18N("ui.settings.option.dragthreshold"), + type = "slider", + min = 4, + max = 50, + step = 1, + value = Spring.GetConfigInt("MouseDragSelectionThreshold", 4), + description = Spring.I18N("ui.settings.option.dragthreshold_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("MouseDragSelectionThreshold", value) + Spring.SetConfigInt("MouseDragCircleCommandThreshold", value) + Spring.SetConfigInt("MouseDragBoxCommandThreshold", value + 12) + Spring.SetConfigInt("MouseDragFrontCommandThreshold", value + 26) + end, + }, + + { id = "label_ui_camera", group = "control", name = Spring.I18N("ui.settings.option.label_camera"), category = types.basic }, + { id = "label_ui_camera_spacer", group = "control", category = types.basic }, + + { + id = "middleclicktoggle", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.middleclicktoggle"), + type = "bool", + value = (Spring.GetConfigFloat("MouseDragScrollThreshold", 0.3) ~= 0), + description = Spring.I18N("ui.settings.option.middleclicktoggle_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigFloat("MouseDragScrollThreshold", (value and 0.3 or 0)) + end, + }, + + { + id = "screenedgemove", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.screenedgemove"), + type = "bool", + restart = true, + value = tonumber(Spring.GetConfigInt("FullscreenEdgeMove", 1) or 1) == 1, + description = Spring.I18N("ui.settings.option.screenedgemove_descr"), + onchange = function(i, value) + Spring.SetConfigInt("FullscreenEdgeMove", (value and 1 or 0)) + Spring.SetConfigInt("WindowedEdgeMove", (value and 1 or 0)) + if value then + Spring.SetConfigFloat("EdgeMoveWidth", edgeMoveWidth) + else + Spring.SetConfigFloat("EdgeMoveWidth", 0) + end + end, + }, + { + id = "screenedgemovewidth", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.screenedgemovewidth"), + type = "slider", + min = 0, + max = 0.1, + step = 0.01, + value = edgeMoveWidth, + description = Spring.I18N("ui.settings.option.screenedgemovewidth_descr"), + onchange = function(i, value) + edgeMoveWidth = value + Spring.SetConfigFloat("EdgeMoveWidth", value) + end, + }, + { + id = "screenedgemovedynamic", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.screenedgemovedynamic"), + type = "bool", + restart = true, + value = tonumber(Spring.GetConfigInt("EdgeMoveDynamic", 1) or 1) == 1, + description = Spring.I18N("ui.settings.option.screenedgemovedynamic_descr"), + onchange = function(i, value) + Spring.SetConfigInt("EdgeMoveDynamic", (value and 1 or 0)) + end, + }, + + { + id = "camera", + group = "control", + category = types.basic, + name = Spring.I18N("ui.settings.option.camera"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_firstperson"), Spring.I18N("ui.settings.option.select_overhead"), Spring.I18N("ui.settings.option.select_springcam"), Spring.I18N("ui.settings.option.select_rotoverhead"), Spring.I18N("ui.settings.option.select_free") }, + value = (tonumber((Spring.GetConfigInt("CamMode", 1) + 1) or 2)), + onchange = function(i, value) + Spring.SetConfigInt("CamMode", (value - 1)) + if value == 1 then + Spring.SendCommands("viewfps") + elseif value == 2 then + Spring.SendCommands("viewta") + elseif value == 3 then + Spring.SendCommands("viewspring") + elseif value == 4 then + Spring.SendCommands("viewrot") + elseif value == 5 then + Spring.SendCommands("viewfree") + end + init() + end, + }, + { + id = "springcamheightmode", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.springcamheightmode"), + type = "select", + options = { Spring.I18N("ui.settings.option.select_constant"), Spring.I18N("ui.settings.option.select_terrain"), Spring.I18N("ui.settings.option.select_smooth") }, + value = Spring.GetConfigInt("CamSpringTrackMapHeightMode", 0) + 1, + description = Spring.I18N("ui.settings.option.springcamheightmode_descr"), + onchange = function(i, value) + Spring.SetConfigInt("CamSpringTrackMapHeightMode", value - 1) + end, + }, + { + id = "mincamheight", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.mincamheight"), + type = "slider", + min = 0, + max = 1500, + step = 1, + value = Spring.GetConfigInt("CamSpringMinZoomDistance", 0), + description = Spring.I18N("ui.settings.option.mincamheight_descr"), + onchange = function(i, value) + Spring.SetConfigInt("CamSpringMinZoomDistance", value) + Spring.SetConfigInt("OverheadMinZoomDistance", value) + end, + }, + { + id = "camerashake", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.camerashake"), + type = "slider", + min = 0, + max = 200, + step = 10, + value = 80, + description = Spring.I18N("ui.settings.option.camerashake_descr"), + onload = function(i) + loadWidgetData("CameraShake", "camerashake", { "powerScale" }) + if options[i].value > 0 then + widgetHandler:EnableWidget("CameraShake") + end + end, + onchange = function(i, value) + saveOptionValue("CameraShake", "camerashake", "setStrength", { "powerScale" }, value) + if value > 0 then + widgetHandler:EnableWidget("CameraShake") + end + end, + }, + --{ id = "camerasmoothing", group = "control", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.camerasmoothing'), type = "bool", value = (tonumber(Spring.GetConfigInt("CameraSmoothing", 0)) == 1), description = "", + -- onload = function(i) + -- end, + -- onchange = function(i, value) + -- Spring.SetConfigInt("CameraSmoothing", (value and 1 or 0)) + -- if value then + -- Spring.SendCommands("set CamFrameTimeCorrection 1") + -- Spring.SendCommands("set SmoothTimeOffset 2") + -- else + -- Spring.SendCommands("set CamFrameTimeCorrection 0") + -- Spring.SendCommands("set SmoothTimeOffset 0") + -- end + -- end, + --}, + { + id = "smoothingmode", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smoothingmode"), + type = "select", + options = { Spring.I18N("ui.settings.option.smoothing_exponential"), Spring.I18N("ui.settings.option.smoothing_spring") }, + value = (Spring.GetConfigInt("CamTransitionMode", 1) + 1), + onchange = function(i, value) + Spring.SetConfigInt("CamTransitionMode", (value - 1)) + end, + }, + { + id = "camerasmoothness", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.camerasmoothness"), + type = "slider", + min = 0.04, + max = 2, + step = 0.01, + value = cameraTransitionTime, + description = Spring.I18N("ui.settings.option.camerasmoothness_descr"), + onload = function(i) end, + onchange = function(i, value) + cameraTransitionTime = value + local halfLife = value + if halfLife <= 1 then + halfLife = halfLife * 200 + else + halfLife = halfLife * 600 - 400 + end + Spring.SetConfigFloat("CamSpringHalflife", halfLife) + end, + }, + { + id = "camerapanspeed", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.camerapanspeed"), + type = "slider", + min = -0.01, + max = -0.00195, + step = 0.0001, + value = Spring.GetConfigFloat("MiddleClickScrollSpeed", 0.0035), + description = Spring.I18N("ui.settings.option.camerapanspeed_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigFloat("MiddleClickScrollSpeed", value) + end, + }, + { + id = "cameramovespeed", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.cameramovespeed"), + type = "slider", + min = 0, + max = 100, + step = 1, + value = Spring.GetConfigInt("CamSpringScrollSpeed", 10), + description = Spring.I18N("ui.settings.option.cameramovespeed_descr"), + onload = function(i) end, + onchange = function(i, value) + --cameraPanTransitionTime = value + Spring.SetConfigInt("FPSScrollSpeed", value) -- spring default: 10 + Spring.SetConfigInt("OverheadScrollSpeed", value) -- spring default: 10 + Spring.SetConfigInt("RotOverheadScrollSpeed", value) -- spring default: 10 + Spring.SetConfigFloat("CamFreeScrollSpeed", value * 50) -- spring default: 500 + Spring.SetConfigInt("CamSpringScrollSpeed", value) -- spring default: 10 + end, + }, + { + id = "scrollspeed", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.scrollspeed"), + type = "slider", + min = 1, + max = 50, + step = 1, + value = math.abs(tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25)), + description = "", + onload = function(i) end, + onchange = function(i, value) + if getOptionByID("scrollinverse") and options[getOptionByID("scrollinverse")].value then + Spring.SetConfigInt("ScrollWheelSpeed", -value) + else + Spring.SetConfigInt("ScrollWheelSpeed", value) + end + end, + }, + { + id = "scrollinverse", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.scrollinverse"), + type = "bool", + value = (tonumber(Spring.GetConfigInt("ScrollWheelSpeed", 1) or 25) < 0), + description = "", + onload = function(i) end, + onchange = function(i, value) + if getOptionByID("scrollspeed") then + if value then + Spring.SetConfigInt("ScrollWheelSpeed", -options[getOptionByID("scrollspeed")].value) + else + Spring.SetConfigInt("ScrollWheelSpeed", options[getOptionByID("scrollspeed")].value) + end + end + end, + }, + { + id = "invertmouse", + group = "control", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.invertmouse"), + type = "bool", + value = tonumber(Spring.GetConfigInt("InvertMouse", 0)) == 1, + description = "", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("InvertMouse", value and 1 or 0) + end, + }, + { id = "scrolltoggleoverview", group = "control", category = types.advanced, widget = "Scrolldown Toggleoverview", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.scrolltoggleoverview"), type = "bool", value = GetWidgetToggleValue("Scrolldown Toggleoverview"), description = Spring.I18N("ui.settings.option.scrolltoggleoverview_descr") }, + + { id = "camoverviewrestore", group = "control", category = types.advanced, widget = "Overview Camera Keep Position", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.camoverviewrestore"), type = "bool", value = GetWidgetToggleValue("Overview Camera Keep Position"), description = Spring.I18N("ui.settings.option.camoverviewrestore_descr") }, + + { + id = "lockcamera_transitiontime", + group = "control", + category = types.advanced, + name = Spring.I18N("ui.settings.option.lockcamera") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lockcamera_transitiontime"), + type = "slider", + min = 0.5, + max = 1.7, + step = 0.01, + value = (WG.lockcamera and WG.lockcamera.GetTransitionTime ~= nil and WG.lockcamera.GetTransitionTime()), + description = Spring.I18N("ui.settings.option.lockcamera_transitiontime_descr"), + onload = function(i) + loadWidgetData("Lockcamera", "lockcamera_transitiontime", { "transitionTime" }) + end, + onchange = function(i, value) + saveOptionValue("Lockcamera", "lockcamera", "SetTransitionTime", { "transitionTime" }, value) + end, + }, + + { + id = "allyselunits_select", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allyselunits_select"), + type = "bool", + value = (WG["allyselectedunits"] ~= nil and WG["allyselectedunits"].getSelectPlayerUnits()), + description = Spring.I18N("ui.settings.option.allyselunits_select_descr"), + onload = function(i) + loadWidgetData("Ally Selected Units", "allyselunits_select", { "selectPlayerUnits" }) + end, + onchange = function(i, value) + saveOptionValue("Ally Selected Units", "allyselectedunits", "setSelectPlayerUnits", { "selectPlayerUnits" }, value) + end, + }, + { + id = "lockcamera_hideenemies", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lockcamera_hideenemies"), + type = "bool", + value = (WG.lockcamera and WG.lockcamera.GetHideEnemies()), + description = Spring.I18N("ui.settings.option.lockcamera_hideenemies_descr"), + onload = function(i) + loadWidgetData("Lockcamera", "lockcamera_hideenemies", { "lockcameraHideEnemies" }) + end, + onchange = function(i, value) + saveOptionValue("Lockcamera", "lockcamera", "SetHideEnemies", { "lockcameraHideEnemies" }, value) + end, + }, + { + id = "lockcamera_los", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.lockcamera_los"), + type = "bool", + value = (WG.lockcamera and WG.lockcamera.GetLos()), + description = Spring.I18N("ui.settings.option.lockcamera_los_descr"), + onload = function(i) + loadWidgetData("Lockcamera", "lockcamera_los", { "lockcameraLos" }) + end, + onchange = function(i, value) + saveOptionValue("Lockcamera", "lockcamera", "SetLos", { "lockcameraLos" }, value) + end, + }, + + { id = "label_ui_command", group = "control", name = Spring.I18N("ui.settings.option.label_commands"), category = types.advanced }, + { id = "label_ui_command_spacer", group = "control", category = types.basic }, + { + id = "drag_multicommand_shift", + group = "control", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.drag_multicommand_shift"), + type = "bool", + value = (WG.customformations ~= nil and WG.customformations.getRepeatForSingleUnit()), + description = Spring.I18N("ui.settings.option.drag_multicommand_shift_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("CustomFormations2", "customformations", "setRepeatForSingleUnit", { "repeatForSingleUnit" }, value) + end, + }, + + -- INTERFACE + { id = "label_ui_interface", group = "ui", name = Spring.I18N("ui.settings.option.label_interface"), category = types.basic }, + { id = "label_ui_interface_spacer", group = "ui", category = types.basic }, + { + id = "language", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.language"), + type = "select", + options = languageNames, + value = languageCodes[Spring.I18N.getLocale()], + onchange = function(i, value) + local language = languageCodes[value] + WG["language"].setLanguage(language) + if widgetHandler.orderList["Notifications"] ~= nil then + widgetHandler:DisableWidget("Notifications") + widgetHandler:EnableWidget("Notifications") + init() + end + end, + }, + { + id = "language_english_unit_names", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.language_english_unit_names"), + type = "bool", + value = Spring.GetConfigInt("language_english_unit_names", 0) == 1, + onchange = function(i, value) + WG["language"].setEnglishUnitNames(value) + end, + }, + { + id = "uiscale", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.interface") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.uiscale"), + type = "slider", + min = 0.8, + max = 1.3, + step = 0.01, + value = Spring.GetConfigFloat("ui_scale", 1), + description = "", + onload = function(i) end, + onchange = function(i, value, force) + if force then + Spring.SetConfigFloat("ui_scale", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("uiscale") } + end + end, + }, + { + id = "guiopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.guiopacity"), + type = "slider", + min = 0.3, + max = 1, + step = 0.01, + value = Spring.GetConfigFloat("ui_opacity", 0.7), + description = "", + onload = function(i) end, + onchange = function(i, value, force) + Spring.SetConfigFloat("ui_opacity", value) + ui_opacity = Spring.GetConfigFloat("ui_opacity", 0.7) + forceUpdate = true + + if force then + Spring.SetConfigFloat("ui_opacity", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("guiopacity") } + end + end, + }, + { + id = "guitilescale", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.guitilescale"), + type = "slider", + min = 4, + max = 40, + step = 1, + value = Spring.GetConfigFloat("ui_tilescale", 7), + description = "", + onload = function(i) end, + onchange = function(i, value, force) + if force then + Spring.SetConfigFloat("ui_tilescale", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("guitilescale") } + end + end, + }, + { + id = "guitileopacity", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.guitileopacity"), + type = "slider", + min = 0, + max = 0.03, + step = 0.001, + value = Spring.GetConfigFloat("ui_tileopacity", 0.014), + description = "", + onload = function(i) end, + onchange = function(i, value, force) + if force then + Spring.SetConfigFloat("ui_tileopacity", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("guitileopacity") } + end + end, + }, + + { id = "guishader", group = "ui", category = types.basic, widget = "GUI Shader", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.guishader"), type = "bool", value = GetWidgetToggleValue("GUI Shader") }, + + { + id = "minimap_maxheight", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.minimap") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimap_maxheight"), + type = "slider", + min = 0.2, + max = 0.4, + step = 0.01, + value = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), + description = Spring.I18N("ui.settings.option.minimap_maxheight_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("MinimapMaxHeight", value) + if WG["minimap"] and WG["minimap"].setMaxHeight then + WG["minimap"].setMaxHeight(value) + end + end, + }, + { + id = "minimapleftclick", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimapleftclick"), + type = "bool", + value = Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1, + description = Spring.I18N("ui.settings.option.minimapleftclick_descr"), + onchange = function(i, value) + Spring.SetConfigInt("MinimapLeftClickMove", value and 1 or 0) + if WG["minimap"] and WG["minimap"].setLeftClickMove then + WG["minimap"].setLeftClickMove(value) + end + end, + }, + { + id = "minimapiconsize", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimapiconsize"), + type = "slider", + min = 2, + max = 5, + step = 0.25, + value = tonumber(Spring.GetConfigFloat("MinimapIconScale", 3.5) or 1), + description = "", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigFloat("MinimapIconScale", value) + Spring.SendCommands("minimap unitsize " .. value) -- spring wont remember what you set with '/minimap iconssize #' + if WG["minimap"] and WG["minimap"].setBaseIconScale then + WG["minimap"].setBaseIconScale(value) + end + end, + }, + { + id = "minimap_minimized", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimapminimized"), + type = "bool", + value = Spring.GetConfigInt("MinimapMinimize", 0) == 1, + description = Spring.I18N("ui.settings.option.minimapminimized_descr"), + onchange = function(i, value) + Spring.SendCommands("minimap minimize " .. (value and "1" or "0")) + Spring.SetConfigInt("MinimapMinimize", (value and "1" or "0")) + end, + }, + { + id = "minimaprotation", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimaprotation"), + type = "select", + options = { Spring.I18N("ui.settings.option.minimaprotation_none"), Spring.I18N("ui.settings.option.minimaprotation_autoflip"), Spring.I18N("ui.settings.option.minimaprotation_autorotate"), Spring.I18N("ui.settings.option.minimaprotation_autolandscape") }, + description = Spring.I18N("ui.settings.option.minimaprotation_descr"), + onload = function(i) + loadWidgetData("Minimap Rotation Manager", "minimaprotation", { "mode" }) + if options[i].value == nil then -- first load to migrate from old behavior smoothly, might wanna remove it later + options[i].value = Spring.GetConfigInt("MiniMapCanFlip", 0) + 1 + end + end, + onchange = function(i, value) + if WG["minimaprotationmanager"] ~= nil and WG["minimaprotationmanager"].setMode ~= nil then + saveOptionValue("Minimap Rotation Manager", "minimaprotationmanager", "setMode", { "mode" }, value) + else + widgetHandler:EnableWidget("Minimap Rotation Manager") -- Widget has auto sync + end + end, + }, + { id = "minimappip", group = "ui", category = types.advanced, widget = "Picture-in-Picture Minimap", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.minimappip"), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture Minimap"), description = Spring.I18N("ui.settings.option.minimappip_descr") }, + { + id = "pip_altkeyzoom", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.pip_altkeyzoom"), + type = "bool", + value = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, + description = Spring.I18N("ui.settings.option.pip_altkeyzoom_descr"), + onchange = function(i, value) + Spring.SetConfigInt("PipAltKeyRequiredForZoom", value and 1 or 0) + for _, n in ipairs({ 0, 1, 2, 3, 4 }) do + if WG["pip" .. n] and WG["pip" .. n].setAltKeyRequiredForZoom then + WG["pip" .. n].setAltKeyRequiredForZoom(value) + end + end + end, + }, + + { + id = "pip_commandfx", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.pip_commandfx"), + type = "bool", + value = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, + description = Spring.I18N("ui.settings.option.pip_commandfx_descr"), + onchange = function(i, value) + Spring.SetConfigInt("PipDrawCommandFX", value and 1 or 0) + for _, n in ipairs({ 0, 1, 2, 3, 4 }) do + if WG["pip" .. n] and WG["pip" .. n].setDrawCommandFX then + WG["pip" .. n].setDrawCommandFX(value) + end + end + end, + }, + -- { id = "minimap_engine_fallback", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.pip_minimap_engine_fallback'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.pip_minimap_engine_fallback_descr'), + -- onload = function(i) + -- if WG['minimap'] and WG['minimap'].getEngineMinimapFallback then + -- options[getOptionByID('minimap_engine_fallback')].value = WG['minimap'].getEngineMinimapFallback() + -- end + -- end, + -- onchange = function(i, value) + -- if WG['minimap'] and WG['minimap'].setEngineMinimapFallback then + -- WG['minimap'].setEngineMinimapFallback(value) + -- end + -- end, + -- }, + { + id = "pip_engine_fallback_threshold", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.pip_engine_fallback_threshold"), + type = "slider", + min = 1500, + max = 5000, + step = 100, + value = 4000, + description = Spring.I18N("ui.settings.option.pip_engine_fallback_threshold_descr"), + onload = function(i) + if WG["minimap"] and WG["minimap"].getEngineMinimapFallbackThreshold then + options[getOptionByID("pip_engine_fallback_threshold")].value = WG["minimap"].getEngineMinimapFallbackThreshold() + end + end, + onchange = function(i, value) + if WG["minimap"] and WG["minimap"].setEngineMinimapFallbackThreshold then + WG["minimap"].setEngineMinimapFallbackThreshold(value) + end + end, + }, + + { id = "pip", group = "ui", category = types.advanced, widget = "Picture-in-Picture", name = Spring.I18N("ui.settings.option.pip"), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture"), description = Spring.I18N("ui.settings.option.pip_descr") }, + { id = "pip2", group = "ui", category = types.advanced, widget = "Picture-in-Picture 2", name = Spring.I18N("ui.settings.option.pip2"), type = "bool", value = GetWidgetToggleValue("Picture-in-Picture 2"), description = Spring.I18N("ui.settings.option.pip2_descr") }, + + { + id = "buildmenu_bottom", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.buildmenu") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_bottom"), + type = "bool", + value = (WG["buildmenu"] ~= nil and WG["buildmenu"].getBottomPosition ~= nil and WG["buildmenu"].getBottomPosition()), + description = Spring.I18N("ui.settings.option.buildmenu_bottom_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setBottomPosition", { "stickToBottom" }, value) + saveOptionValue("Grid menu", "buildmenu", "setBottomPosition", { "stickToBottom" }, value) + end, + }, + { + id = "buildmenu_maxposy", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_maxposy"), + type = "slider", + min = 0.66, + max = 0.88, + step = 0.01, + value = 0.74, + description = Spring.I18N("ui.settings.option.buildmenu_maxposy_descr"), + onload = function(i) + loadWidgetData("Build menu", "buildmenu_maxposy", { "maxPosY" }) + end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setMaxPosY", { "maxPosY" }, value) + end, + }, + { + id = "buildmenu_alwaysshow", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_alwaysshow"), + type = "bool", + value = (WG["buildmenu"] ~= nil and WG["buildmenu"].getAlwaysShow ~= nil and WG["buildmenu"].getAlwaysShow()), + description = Spring.I18N("ui.settings.option.buildmenu_alwaysshow_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setAlwaysShow", { "alwaysShow" }, value) + saveOptionValue("Grid menu", "buildmenu", "setAlwaysShow", { "alwaysShow" }, value) + end, + }, + { + id = "buildmenu_prices", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_prices"), + type = "bool", + value = (WG["buildmenu"] ~= nil and WG["buildmenu"].getShowPrice ~= nil and WG["buildmenu"].getShowPrice()), + description = Spring.I18N("ui.settings.option.buildmenu_prices_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setShowPrice", { "showPrice" }, value) + saveOptionValue("Grid menu", "buildmenu", "setShowPrice", { "showPrice" }, value) + end, + }, + { + id = "buildmenu_groupicon", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_groupicon"), + type = "bool", + value = (WG["buildmenu"] ~= nil and WG["buildmenu"].getShowGroupIcon ~= nil and WG["buildmenu"].getShowGroupIcon()), + description = Spring.I18N("ui.settings.option.buildmenu_groupicon_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setShowGroupIcon", { "showGroupIcon" }, value) + saveOptionValue("Grid menu", "buildmenu", "setShowGroupIcon", { "showGroupIcon" }, value) + end, + }, + { + id = "buildmenu_radaricon", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildmenu_radaricon"), + type = "bool", + value = (WG["buildmenu"] ~= nil and WG["buildmenu"].getShowRadarIcon ~= nil and WG["buildmenu"].getShowRadarIcon()), + description = Spring.I18N("ui.settings.option.buildmenu_radaricon_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Build menu", "buildmenu", "setShowRadarIcon", { "showRadarIcon" }, value) + saveOptionValue("Grid menu", "buildmenu", "setShowRadarIcon", { "showRadarIcon" }, value) + end, + }, + + { + id = "ordermenu_bottompos", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.ordermenu") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ordermenu_bottompos"), + type = "bool", + value = (WG["ordermenu"] ~= nil and WG["ordermenu"].getBottomPosition ~= nil and WG["ordermenu"].getBottomPosition()), + description = Spring.I18N("ui.settings.option.ordermenu_bottompos_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Order menu", "ordermenu", "setBottomPosition", { "stickToBottom" }, value) + end, + }, + { + id = "ordermenu_colorize", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ordermenu_colorize"), + type = "slider", + min = 0, + max = 1, + step = 0.1, + value = 0.5, + description = "", + onload = function(i) + loadWidgetData("Order menu", "ordermenu_colorize", { "colorize" }) + end, + onchange = function(i, value) + saveOptionValue("Order menu", "ordermenu", "setColorize", { "colorize" }, value) + end, + }, + { + id = "ordermenu_alwaysshow", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ordermenu_alwaysshow"), + type = "bool", + value = (WG["ordermenu"] ~= nil and WG["ordermenu"].getAlwaysShow ~= nil and WG["ordermenu"].getAlwaysShow()), + description = Spring.I18N("ui.settings.option.ordermenu_alwaysshow_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Order menu", "ordermenu", "setAlwaysShow", { "alwaysShow" }, value) + end, + }, + { + id = "ordermenu_hideset", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ordermenu_hideset"), + type = "bool", + value = (WG["ordermenu"] ~= nil and WG["ordermenu"].getDisabledCmd ~= nil and WG["ordermenu"].getDisabledCmd("Move")), + description = Spring.I18N("ui.settings.option.ordermenu_hideset_descr"), + onload = function(i) end, + onchange = function(i, value) + local cmds = { "Move", "Stop", "Attack", "Patrol", "Fight", "Wait", "Guard", "Reclaim", "Repair", "ManualFire" } + for k, cmd in pairs(cmds) do + saveOptionValue("Order menu", "ordermenu", "setDisabledCmd", { "disabledCmd", cmd }, value, { cmd, value }) + end + end, + }, + + { + id = "info_buildlist", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.info") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.info_buildlist"), + type = "bool", + value = (WG["info"] and WG["info"].getShowBuilderBuildlist ~= nil and WG["info"].getShowBuilderBuildlist()), + description = Spring.I18N("ui.settings.option.info_buildlist_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Info", "info", "setShowBuilderBuildlist", { "showBuilderBuildlist" }, value) + end, + }, + { + id = "info_mappos", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.info_mappos"), + type = "bool", + value = (WG["info"] and WG["info"].getDisplayMapPosition ~= nil and WG["info"].getDisplayMapPosition()), + description = Spring.I18N("ui.settings.option.info_mappos_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Info", "info", "setDisplayMapPosition", { "displayMapPosition" }, value) + end, + }, + { + id = "info_alwaysshow", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.info_alwaysshow"), + type = "bool", + value = (WG["info"] ~= nil and WG["info"].getAlwaysShow ~= nil and WG["info"].getAlwaysShow()), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Info", "info", "setAlwaysShow", { "alwaysShow" }, value) + end, + }, + + { + id = "advplayerlist_country", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.advplayerlist") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_country"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_country_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_country", { "m_active_Table", "country" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "country" }, value, { "country", value }) + end, + }, + { + id = "advplayerlist_scale", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_scale"), + min = 0.85, + max = 1.2, + step = 0.01, + type = "slider", + value = 1, + description = Spring.I18N("ui.settings.option.advplayerlist_scale_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_scale", { "customScale" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetScale", { "customScale" }, value) + end, + }, + { + id = "advplayerlist_showallyid", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_showallyid"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.advplayerlist_showallyid_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_showallyid", { "m_active_Table", "allyid" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "allyid" }, value, { "allyid", value }) + end, + }, + { + id = "advplayerlist_showid", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_showid"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.advplayerlist_showid_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_showid", { "m_active_Table", "id" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "id" }, value, { "id", value }) + end, + }, + { + id = "advplayerlist_showplayerid", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_showplayerid"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.advplayerlist_showplayerid_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_showplayerid", { "m_active_Table", "playerid" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "playerid" }, value, { "playerid", value }) + end, + }, + { + id = "advplayerlist_rank", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_rank"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_rank_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_rank", { "m_active_Table", "rank" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "rank" }, value, { "rank", value }) + end, + }, + --{ id = "advplayerlist_side", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.advplayerlist_side'), type = "bool", value = true, description = Spring.I18N('ui.settings.option.advplayerlist_side_descr'), + -- onload = function(i) + -- loadWidgetData("AdvPlayersList", "advplayerlist_side", { 'm_active_Table', 'side' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetModuleActive', { 'm_active_Table', 'side' }, value, { 'side', value }) + -- end, + --}, + { + id = "advplayerlist_skill", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_skill"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_skill_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_skill", { "m_active_Table", "skill" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "skill" }, value, { "skill", value }) + end, + }, + { + id = "advplayerlist_cpuping", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_cpuping"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_cpuping_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_cpuping", { "m_active_Table", "cpuping" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "cpuping" }, value, { "cpuping", value }) + end, + }, + { + id = "advplayerlist_resources", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_resources"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_resources_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_resources", { "m_active_Table", "resources" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "resources" }, value, { "resources", value }) + end, + }, + { + id = "advplayerlist_income", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_income"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_income_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_income", { "m_active_Table", "income" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "income" }, value, { "income", value }) + end, + }, + { + id = "advplayerlist_absresbars", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_absresbars"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.advplayerlist_absresbars_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_absresbars", { "absoluteResbarValues" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetAbsoluteResbars", { "absoluteResbarValues" }, value) + end, + }, + { + id = "advplayerlist_share", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_share"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_share_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_share", { "m_active_Table", "share" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetModuleActive", { "m_active_Table", "share" }, value, { "share", value }) + end, + }, + { + id = "advplayerlist_hidespecs", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.advplayerlist_hidespecs"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.advplayerlist_hidespecs_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList", "advplayerlist_hidespecs", { "alwaysHideSpecs" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList", "advplayerlist_api", "SetAlwaysHideSpecs", { "alwaysHideSpecs" }, value) + end, + }, + { id = "unittotals", group = "ui", category = types.advanced, widget = "AdvPlayersList Unit Totals", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.unittotals"), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Unit Totals"), description = Spring.I18N("ui.settings.option.unittotals_descr") }, + { + id = "musicplayer", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N("ui.settings.option.musicplayer"), + type = "bool", + value = (WG["music"] ~= nil and WG["music"].GetShowGui() or false), + description = Spring.I18N("ui.settings.option.musicplayer_descr"), + onload = function(i) + loadWidgetData("AdvPlayersList Music Player New", "musicplayer", { "showGUI" }) + end, + onchange = function(i, value) + saveOptionValue("AdvPlayersList Music Player New", "music", "SetShowGui", { "showGUI" }, value) + end, + }, + { id = "mascot", group = "ui", category = types.advanced, widget = "AdvPlayersList Mascot", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.mascot"), type = "bool", value = GetWidgetToggleValue("AdvPlayersList Mascot"), description = Spring.I18N("ui.settings.option.mascot_descr") }, + + { + id = "displayselectedname", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.displayselectedname"), + type = "bool", + value = (WG["playertv"] ~= nil and WG["playertv"].GetAlwaysDisplayName() or false), + description = Spring.I18N("ui.settings.option.displayselectedname_descr"), + onload = function(i) + loadWidgetData("Player-TV", "displayselectedname", { "alwaysDisplayName" }) + end, + onchange = function(i, value) + saveOptionValue("Player-TV", "playertv", "SetAlwaysDisplayName", { "alwaysDisplayName" }, value) + end, + }, + + { + id = "console_fontsize", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.console") .. " " .. widgetOptionColor .. Spring.I18N("ui.settings.option.console_fontsize"), + type = "slider", + min = 0.92, + max = 1.12, + step = 0.02, + value = (WG["chat"] ~= nil and WG["chat"].getFontsize() or 1), + description = "", + onload = function(i) + loadWidgetData("Chat", "console_fontsize", { "fontsizeMult" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setFontsize", { "fontsizeMult" }, value) + end, + }, + { + id = "console_backgroundopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_backgroundopacity"), + type = "slider", + min = 0, + max = 0.45, + step = 0.01, + value = (WG["chat"] ~= nil and WG["chat"].getBackgroundOpacity() or 0), + description = Spring.I18N("ui.settings.option.console_backgroundopacity_descr"), + onload = function(i) + loadWidgetData("Chat", "console_backgroundopacity", { "chatBackgroundOpacity" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setBackgroundOpacity", { "chatBackgroundOpacity" }, value) + end, + }, + { + id = "console_hidespecchat", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_hidespecchat"), + type = "bool", + value = (Spring.GetConfigInt("HideSpecChat", 0) == 1), + description = Spring.I18N("ui.settings.option.console_hidespecchat_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("HideSpecChat", value and 1 or 0) + end, + }, + { + id = "console_hidespecchatplayer", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. widgetOptionColor .. Spring.I18N("ui.settings.option.console_hidespecchatplayer"), + type = "bool", + value = (Spring.GetConfigInt("HideSpecChatPlayer", 1) == 1), + description = Spring.I18N("ui.settings.option.console_hidespecchatplayer_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("HideSpecChatPlayer", value and 1 or 0) + end, + }, + { + id = "console_hide", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_hide"), + type = "bool", + value = (WG["chat"] ~= nil and WG["chat"].getHide() or false), + description = Spring.I18N("ui.settings.option.console_hide_descr"), + onload = function(i) + loadWidgetData("Chat", "console_hide", { "hide" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setHide", { "hide" }, value) + end, + }, + { + id = "console_maxlines", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_maxlines"), + type = "slider", + min = 3, + max = 7, + step = 1, + value = (WG["chat"] ~= nil and WG["chat"].getMaxLines() or 5), + description = "", + onload = function(i) + loadWidgetData("Chat", "console_maxlines", { "maxLines" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setMaxLines", { "maxLines" }, value) + end, + }, + { + id = "console_maxconsolelines", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.console_maxconsolelines"), + type = "slider", + min = 2, + max = 12, + step = 1, + value = (WG["chat"] ~= nil and WG["chat"].getMaxConsoleLines() or 2), + description = "", + onload = function(i) + loadWidgetData("Chat", "console_maxconsolelines", { "maxConsoleLines" }) + end, + onchange = function(i, value) + saveOptionValue("Chat", "chat", "setMaxConsoleLines", { "maxConsoleLines" }, value) + end, + }, + --{ id = "console_handleinput", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_handleinput'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getHandleInput() or 0), description = Spring.I18N('ui.settings.option.console_handleinput_descr'), + -- onload = function(i) + -- loadWidgetData("Chat", "console_handleinput", { 'handleTextInput' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('Chat', 'chat', 'setHandleInput', { 'handleTextInput' }, value) + -- end, + --}, + --{ id = "console_inputbutton", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.console_inputbutton'), type = "bool", value = (WG['chat'] ~= nil and WG['chat'].getInputButton() or 0), description = Spring.I18N('ui.settings.option.console_inputbutton_descr'), + -- onload = function(i) + -- loadWidgetData("Chat", "console_inputbutton", { 'inputButton' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('Chat', 'chat', 'setInputButton', { 'inputButton' }, value) + -- end, + --}, + { id = "autoeraser", group = "ui", category = types.basic, widget = "Auto mapmark eraser", name = Spring.I18N("ui.settings.option.autoeraser"), type = "bool", value = GetWidgetToggleValue("Auto mapmark eraser"), description = Spring.I18N("ui.settings.option.autoeraser_descr") }, + { + id = "autoeraser_erasetime", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.autoeraser_erasetime"), + type = "slider", + min = 5, + max = 600, + step = 5, + value = 60, + description = Spring.I18N("ui.settings.option.autoeraser_erasetime_descr"), + onload = function(i) + loadWidgetData("Auto mapmark eraser", "autoeraser_erasetime", { "eraseTime" }) + end, + onchange = function(i, value) + saveOptionValue("Auto mapmark eraser", "autoeraser", "setEraseTime", { "eraseTime" }, value) + end, + }, + + { + id = "topbar_hidebuttons", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.topbar") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.topbar_hidebuttons"), + type = "bool", + value = (WG["topbar"] ~= nil and WG["topbar"].getAutoHideButtons() or 0), + onload = function(i) + loadWidgetData("Top Bar", "topbar_hidebuttons", { "autoHideButtons" }) + end, + onchange = function(i, value) + saveOptionValue("Top Bar", "topbar", "setAutoHideButtons", { "autoHideButtons" }, value) + end, + }, + + { + id = "continuouslyclearmapmarks", + group = "ui", + category = types.dev, + name = Spring.I18N("ui.settings.option.continuouslyclearmapmarks"), + type = "bool", + value = Spring.GetConfigInt("ContinuouslyClearMapmarks", 0) == 1, + description = Spring.I18N("ui.settings.option.continuouslyclearmapmarks_descr"), + onchange = function(i, value) + Spring.SetConfigInt("ContinuouslyClearMapmarks", (value and 1 or 0)) + if value then + Spring.SendCommands({ "clearmapmarks" }) + end + end, + }, + + { id = "unitgroups", group = "ui", category = types.basic, widget = "Unit Groups", name = Spring.I18N("ui.settings.option.unitgroups"), type = "bool", value = GetWidgetToggleValue("Unit Groups"), description = Spring.I18N("ui.settings.option.unitgroups_descr") }, + { id = "idlebuilders", group = "ui", category = types.basic, widget = "Idle Builders", name = Spring.I18N("ui.settings.option.idlebuilders"), type = "bool", value = GetWidgetToggleValue("Idle Builders"), description = Spring.I18N("ui.settings.option.idlebuilders_descr") }, + { id = "buildbar", group = "ui", category = types.basic, widget = "BuildBar", name = Spring.I18N("ui.settings.option.buildbar"), type = "bool", value = GetWidgetToggleValue("BuildBar"), description = Spring.I18N("ui.settings.option.buildbar_descr") }, + + { id = "converterusage", group = "ui", category = types.advanced, widget = "Converter Usage", name = Spring.I18N("ui.settings.option.converterusage"), type = "bool", value = GetWidgetToggleValue("Converter Usage"), description = Spring.I18N("ui.settings.option.converterusage_descr") }, + + { + id = "widgetselector", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.widgetselector"), + type = "bool", + value = Spring.GetConfigInt("widgetselector", 0) == 1, + description = Spring.I18N("ui.settings.option.widgetselector_descr"), + onchange = function(i, value) + Spring.SetConfigInt("widgetselector", (value and 1 or 0)) + end, + }, + + { id = "label_ui_visuals", group = "ui", name = Spring.I18N("ui.settings.option.label_visuals"), category = types.basic }, + { id = "label_ui_visuals_spacer", group = "ui", category = types.basic }, + + { + id = "uniticon_scaleui", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.uniticonscaleui"), + type = "slider", + min = 0.85, + max = 3, + step = 0.05, + value = tonumber(Spring.GetConfigFloat("UnitIconScaleUI", 1) or 1), + description = Spring.I18N("ui.settings.option.uniticonscaleui_descr"), + onchange = function(i, value) + Spring.SendCommands("iconscaleui " .. value) + Spring.SetConfigFloat("UnitIconScaleUI", value) + end, + }, + { + id = "uniticon_distance", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.uniticondistance"), + type = "slider", + min = 1, + max = 12000, + step = 50, + value = tonumber(Spring.GetConfigInt("UnitIconFadeVanish", 2700) or 1), + description = Spring.I18N("ui.settings.option.uniticondistance_descr"), + onchange = function(i, value) + Spring.SendCommands("iconfadestart " .. value) + Spring.SetConfigInt("UnitIconFadeStart", value) + -- update UnitIconFadeVanish too + Spring.SendCommands("iconfadevanish " .. value) + Spring.SetConfigInt("UnitIconFadeVanish", value) + end, + }, + { + id = "uniticon_hidewithui", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.uniticonhidewithui"), + type = "bool", + value = (Spring.GetConfigInt("UnitIconsHideWithUI", 0) == 1), + description = Spring.I18N("ui.settings.option.uniticonhidewithui_descr"), + onchange = function(i, value) + Spring.SendCommands("iconshidewithui " .. (value and 1 or 0)) + Spring.SetConfigInt("UnitIconsHideWithUI", (value and 1 or 0)) + end, + }, + + -- { id = "teamcolors", group = "ui", category = types.basic, widget = "Player Color Palette", name = Spring.I18N('ui.settings.option.teamcolors'), type = "bool", value = GetWidgetToggleValue("Player Color Palette"), description = Spring.I18N('ui.settings.option.teamcolors_descr') }, + -- { id = "sameteamcolors", group = "ui", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sameteamcolors'), type = "bool", value = (WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors ~= nil and WG['playercolorpalette'].getSameTeamColors()), description = Spring.I18N('ui.settings.option.sameteamcolors_descr'), + -- onchange = function(i, value) + -- saveOptionValue('Player Color Palette', 'playercolorpalette', 'setSameTeamColors', { 'useSameTeamColors' }, value) + -- end, + -- }, + + { id = "teamplatter", group = "ui", category = types.basic, widget = "TeamPlatter", name = Spring.I18N("ui.settings.option.teamplatter"), type = "bool", value = GetWidgetToggleValue("TeamPlatter"), description = Spring.I18N("ui.settings.option.teamplatter_descr") }, + { + id = "teamplatter_opacity", + category = types.advanced, + group = "ui", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.teamplatter_opacity"), + min = 0.05, + max = 0.4, + step = 0.01, + type = "slider", + value = 0.25, + description = Spring.I18N("ui.settings.option.teamplatter_opacity_descr"), + onload = function(i) + loadWidgetData("TeamPlatter", "teamplatter_opacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("TeamPlatter", "teamplatter", "setOpacity", { "opacity" }, value) + end, + }, + { + id = "teamplatter_skipownteam", + category = types.advanced, + group = "ui", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.teamplatter_skipownteam"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.teamplatter_skipownteam_descr"), + onload = function(i) + loadWidgetData("TeamPlatter", "teamplatter_skipownteam", { "skipOwnTeam" }) + end, + onchange = function(i, value) + saveOptionValue("TeamPlatter", "teamplatter", "setSkipOwnTeam", { "skipOwnTeam" }, value) + end, + }, + + { id = "enemyspotter", group = "ui", category = types.basic, widget = "EnemySpotter", name = Spring.I18N("ui.settings.option.enemyspotter"), type = "bool", value = GetWidgetToggleValue("EnemySpotter"), description = Spring.I18N("ui.settings.option.enemyspotter_descr") }, + { + id = "enemyspotter_opacity", + category = types.advanced, + group = "ui", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.enemyspotter_opacity"), + min = 0.12, + max = 0.4, + step = 0.01, + type = "slider", + value = 0.15, + description = Spring.I18N("ui.settings.option.enemyspotter_opacity_descr"), + onload = function(i) + loadWidgetData("EnemySpotter", "enemyspotter_opacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("EnemySpotter", "enemyspotter", "setOpacity", { "opacity" }, value) + end, + }, + + --{ id = "selectedunits", group = "ui", category = types.basic, widget = "Selected Units GL4", name = "Selection", type = "bool", value = GetWidgetToggleValue("Selected Units GL4"), description = Spring.I18N('ui.settings.option.selectedunits_descr') }, + { + id = "selectedunits_opacity", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.selectedunits") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.selectedunits_opacity"), + min = 0, + max = 0.5, + step = 0.01, + type = "slider", + value = 0.19, + description = Spring.I18N("ui.settings.option.selectedunits_opacity_descr"), + onload = function(i) + loadWidgetData("Selected Units GL4", "selectedunits_opacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Selected Units GL4", "selectedunits", "setOpacity", { "opacity" }, value) + end, + }, + { + id = "selectedunits_teamcoloropacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.selectedunits_teamcoloropacity"), + min = 0, + max = 1, + step = 0.01, + type = "slider", + value = 0.6, + description = Spring.I18N("ui.settings.option.selectedunits_teamcoloropacity_descr"), + onload = function(i) + loadWidgetData("Selected Units GL4", "selectedunits_teamcoloropacity", { "teamcolorOpacity" }) + end, + onchange = function(i, value) + saveOptionValue("Selected Units GL4", "selectedunits", "setTeamcolorOpacity", { "teamcolorOpacity" }, value) + end, + }, + + --{ id = "highlightselunits", group = "ui", category = types.basic, widget = "Highlight Selected Units GL4", name = Spring.I18N('ui.settings.option.highlightselunits'), type = "bool", value = GetWidgetToggleValue("Highlight Selected Units GL4"), description = Spring.I18N('ui.settings.option.highlightselunits_descr') }, + + { + id = "highlightselunits", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.highlightselunits"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.selectedunits_teamcoloropacity_descr"), + onload = function(i) + loadWidgetData("Selected Units GL4", "highlightselunits", { "selectionHighlight" }) + end, + onchange = function(i, value) + saveOptionValue("Selected Units GL4", "selectedunits", "setSelectionHighlight", { "selectionHighlight" }, value) + end, + }, + --{ id = "highlightselunits_opacity", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits_opacity'), min = 0.02, max = 0.12, step = 0.01, type = "slider", value = 0.05, description = Spring.I18N('ui.settings.option.highlightselunits_opacity_descr'), + -- onload = function(i) + -- loadWidgetData("Highlight Selected Units GL4", "highlightselunits_opacity", { 'highlightAlpha' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('Highlight Selected Units GL4', 'highlightselunits', 'setOpacity', { 'highlightAlpha' }, value) + -- end, + --}, + --{ id = "highlightselunits_teamcolor", group = "ui", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.highlightselunits_teamcolor'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.highlightselunits_teamcolor_descr'), + -- onload = function(i) + -- loadWidgetData("Highlight Selected Units GL4", "highlightselunits_teamcolor", { 'useTeamcolor' }) + -- end, + -- onchange = function(i, value) + -- saveOptionValue('Highlight Selected Units GL4', 'highlightselunits', 'setTeamcolor', { 'useTeamcolor' }, value) + -- end, + --}, + + -- { id = "highlightunit", group = "ui", category = types.advanced, widget = "Highlight Unit GL4", name = Spring.I18N('ui.settings.option.highlightunit'), type = "bool", value = GetWidgetToggleValue("Highlight Unit GL4"), description = Spring.I18N('ui.settings.option.highlightunit_descr') }, + + { + id = "highlightunit", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.highlightunit"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.highlightunit_descr"), + onload = function(i) + loadWidgetData("Selected Units GL4", "highlightunit", { "mouseoverHighlight" }) + end, + onchange = function(i, value) + saveOptionValue("Selected Units GL4", "selectedunits", "setMouseoverHighlight", { "mouseoverHighlight" }, value) + end, + }, + + { + id = "ghosticons_brightness", + group = "ui", + category = types.dev, + name = Spring.I18N("ui.settings.option.ghosticons") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.ghosticons_brightness"), + min = 0, + max = 1.0, + step = 0.15, + type = "slider", + value = Spring.GetConfigFloat("UnitGhostIconsDimming", 0.8), + description = Spring.I18N("ui.settings.option.ghosticons_brightness_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("UnitGhostIconsDimming", value) + end, + }, + + { + id = "cursorlight", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.cursorlight"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.cursorlight_descr"), + onload = function(i) + loadWidgetData("Deferred rendering GL4", "cursorlight", { "showPlayerCursorLight" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "ShowPlayerCursorLight", { "showPlayerCursorLight" }, value) + end, + }, + { + id = "cursorlight_lightradius", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.cursorlight_lightradius"), + type = "slider", + min = 0.3, + max = 2, + step = 0.05, + value = 1, + description = "", + onload = function(i) + loadWidgetData("Deferred rendering GL4", "cursorlight_lightradius", { "playerCursorLightRadius" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "PlayerCursorLightRadius", { "playerCursorLightRadius" }, value) + end, + }, + { + id = "cursorlight_lightstrength", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.cursorlight_lightstrength"), + type = "slider", + min = 0.3, + max = 2, + step = 0.05, + value = 1, + description = "", + onload = function(i) + loadWidgetData("Cursor Light", "cursorlight_lightstrength", { "playerCursorLightBrightness" }) + end, + onchange = function(i, value) + saveOptionValue("Deferred rendering GL4", "lightsgl4", "PlayerCursorLightBrightness", { "playerCursorLightBrightness" }, value) + end, + }, + + { id = "label_ui_info", group = "ui", name = Spring.I18N("ui.settings.option.label_info"), category = types.basic }, + { id = "label_ui_info_spacer", group = "ui", category = types.basic }, + + { + id = "metalspots_values", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.metalspots") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.metalspots_values"), + type = "bool", + value = (WG["metalspots"] ~= nil and WG["metalspots"].getShowValue()), + description = Spring.I18N("ui.settings.option.metalspots_values_descr"), + onload = function(i) + loadWidgetData("Metalspots", "metalspots_values", { "showValues" }) + end, + onchange = function(i, value) + if WG.metalspots then + WG.metalspots.setShowValue(value) + end + saveOptionValue("Metalspots", "metalspots", "setShowValue", { "showValue" }, options[getOptionByID("metalspots_values")].value) + end, + }, + { + id = "metalspots_metalviewonly", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.metalspots_metalviewonly"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.metalspots_metalviewonly_descr"), + onload = function(i) + loadWidgetData("Metalspots", "metalspots_metalviewonly", { "metalViewOnly" }) + end, + onchange = function(i, value) + saveOptionValue("Metalspots", "metalspots", "setMetalViewOnly", { "showValue" }, options[getOptionByID("metalspots_metalviewonly")].value) + end, + }, + + { id = "geospots", group = "ui", category = types.dev, widget = "Geothermalspots", name = Spring.I18N("ui.settings.option.geospots"), type = "bool", value = GetWidgetToggleValue("Metalspots"), description = Spring.I18N("ui.settings.option.geospots_descr") }, + + { + id = "healthbarsscale", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.healthbars") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.healthbarsscale"), + type = "slider", + min = 0.6, + max = 2.0, + step = 0.1, + value = 1, + description = "", + onload = function(i) + loadWidgetData("Health Bars GL4", "healthbarsscale", { "barScale" }) + end, + onchange = function(i, value) + saveOptionValue("Health Bars GL4", "healthbars", "setScale", { "barScale" }, value) + end, + }, + { + id = "healthbarsheight", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.healthbarsheight"), + type = "slider", + min = 0.7, + max = 2, + step = 0.1, + value = (WG["healthbar"] ~= nil and WG["healthbar"].getHeight() or 0.9), + description = "", + onload = function(i) + loadWidgetData("Health Bars GL4", "healthbarsheight", { "barHeight" }) + end, + onchange = function(i, value) + saveOptionValue("Health Bars GL4", "healthbars", "setHeight", { "barHeight" }, value) + widgetHandler:DisableWidget("Health Bars GL4") + widgetHandler:EnableWidget("Health Bars GL4") + end, + }, + { + id = "healthbarsvariable", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.healthbarsvariable"), + type = "bool", + value = (WG["healthbar"] ~= nil and WG["healthbar"].getVariableSizes()), + description = Spring.I18N("ui.settings.option.healthbarsvariable_descr"), + onload = function(i) + loadWidgetData("Health Bars GL4", "healthbarsvariable", { "variableBarSizes" }) + end, + onchange = function(i, value) + saveOptionValue("Health Bars GL4", "healthbars", "setVariableSizes", { "variableBarSizes" }, value) + end, + }, + { + id = "healthbarswhenguihidden", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.healthbarswhenguihidden"), + type = "bool", + value = (WG["healthbar"] ~= nil and WG["healthbar"].getDrawWhenGuiHidden()), + description = Spring.I18N("ui.settings.option.healthbarswhenguihidden_descr"), + onload = function(i) + loadWidgetData("Health Bars GL4", "healthbarswhenguihidden", { "drawWhenGuiHidden" }) + end, + onchange = function(i, value) + saveOptionValue("Health Bars GL4", "healthbars", "setDrawWhenGuiHidden", { "drawWhenGuiHidden" }, value) + end, + }, + { id = "rankicons", group = "ui", category = types.advanced, widget = "Rank Icons GL4", name = Spring.I18N("ui.settings.option.rankicons"), type = "bool", value = GetWidgetToggleValue("Rank Icons GL4"), description = Spring.I18N("ui.settings.option.rankicons_descr") }, + { + id = "rankicons_distance", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.rankicons_distance"), + type = "slider", + min = 0.1, + max = 1.5, + step = 0.05, + value = (WG["rankicons"] ~= nil and WG["rankicons"].getDrawDistance ~= nil and WG["rankicons"].getDrawDistance()), + description = "", + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Rank Icons", "rankicons", "setDrawDistance", { "distanceMult" }, value) + end, + }, + { + id = "rankicons_scale", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.rankicons_scale"), + type = "slider", + min = 0.5, + max = 2, + step = 0.1, + value = (WG["rankicons"] ~= nil and WG["rankicons"].getScale ~= nil and WG["rankicons"].getScale()), + description = "", + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("Rank Icons", "rankicons", "setScale", { "iconsizeMult" }, value) + end, + }, + + { id = "allycursors", group = "ui", category = types.basic, widget = "AllyCursors", name = Spring.I18N("ui.settings.option.allycursors"), type = "bool", value = GetWidgetToggleValue("AllyCursors"), description = Spring.I18N("ui.settings.option.allycursors_descr") }, + { + id = "allycursors_playername", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_playername"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.allycursors_playername_descr"), + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_playername", { "showPlayerName" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setPlayerNames", { "showPlayerName" }, value) + end, + }, + { + id = "allycursors_showdot", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_showdot"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.allycursors_showdot_descr"), + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_showdot", { "showCursorDot" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setCursorDot", { "showCursorDot" }, value) + end, + }, + { + id = "allycursors_spectatorname", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_spectatorname"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.allycursors_spectatorname_descr"), + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_spectatorname", { "showSpectatorName" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setSpectatorNames", { "showSpectatorName" }, value) + end, + }, + { + id = "allycursors_lights", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_lights"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.allycursors_lights_descr"), + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_lights", { "addLights" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setLights", { "addLights" }, options[getOptionByID("allycursors_lights")].value) + end, + }, + { + id = "allycursors_lightradius", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_lightradius"), + type = "slider", + min = 0.15, + max = 1, + step = 0.05, + value = 0.5, + description = "", + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_lightradius", { "lightRadiusMult" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setLightRadius", { "lightRadiusMult" }, value) + end, + }, + { + id = "allycursors_lightstrength", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_lightstrength"), + type = "slider", + min = 0.1, + max = 1.2, + step = 0.05, + value = 0.85, + description = "", + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_lightstrength", { "lightStrengthMult" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setLightStrength", { "lightStrengthMult" }, value) + end, + }, + { + id = "allycursors_selfshadowing", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.allycursors_selfshadowing"), + type = "bool", + value = false, + description = "", + onload = function(i) + loadWidgetData("AllyCursors", "allycursors_selfshadowing", { "lightSelfShadowing" }) + end, + onchange = function(i, value) + saveOptionValue("AllyCursors", "allycursors", "setLightSelfShadowing", { "lightSelfShadowing" }, value) + end, + }, + + { id = "showbuilderqueue", group = "ui", category = types.advanced, widget = "Show Builder Queue", name = Spring.I18N("ui.settings.option.showbuilderqueue"), type = "bool", value = GetWidgetToggleValue("Show Builder Queue"), description = Spring.I18N("ui.settings.option.showbuilderqueue_descr") }, + + { id = "unitenergyicons", group = "ui", category = types.advanced, widget = "Unit Energy Icons", name = Spring.I18N("ui.settings.option.unitenergyicons"), type = "bool", value = GetWidgetToggleValue("Unit Energy Icons"), description = Spring.I18N("ui.settings.option.unitenergyicons_descr") }, + + { id = "unitidlebuildericons", group = "ui", category = types.advanced, widget = "Unit Idle Builder Icons", name = Spring.I18N("ui.settings.option.unitidlebuildericons"), type = "bool", value = GetWidgetToggleValue("Unit Idle Builder Icons"), description = Spring.I18N("ui.settings.option.unitidlebuildericons_descr") }, + + { id = "unitfirestateicons", group = "ui", category = types.advanced, widget = "Unit Fire State Icons", name = Spring.I18N("ui.settings.option.unitfirestateicons"), type = "bool", value = GetWidgetToggleValue("Unit Fire State Icons"), description = Spring.I18N("ui.settings.option.unitfirestateicons_descr") }, + + { id = "resurrectionhalos", group = "ui", category = types.advanced, widget = "Resurrection Halos GL4", name = Spring.I18N("ui.settings.option.resurrectionhalos"), type = "bool", value = GetWidgetToggleValue("Resurrection Halos GL4"), description = Spring.I18N("ui.settings.option.resurrectionhalos_descr") }, + + { + id = "nametags_rank", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.nametags_rank"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.nametags_rank_descr"), + onload = function(i) + loadWidgetData("Commander Name Tags", "nametags_rank", { "showPlayerRank" }) + end, + onchange = function(i, value) + saveOptionValue("Commander Name Tags", "nametags", "SetShowPlayerRank", { "showPlayerRank" }, value) + end, + }, + + { id = "commandsfx", group = "ui", category = types.basic, widget = "Commands FX", name = Spring.I18N("ui.settings.option.commandsfx"), type = "bool", value = GetWidgetToggleValue("Commands FX"), description = Spring.I18N("ui.settings.option.commandsfx_descr") }, + + { + id = "commandsfxopacity", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.commandsfxopacity"), + type = "slider", + min = 0.25, + max = 1, + step = 0.1, + value = 1, + description = "", + onload = function(i) + loadWidgetData("Commands FX", "commandsfxopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Commands FX", "commandsfx", "setOpacity", { "opacity" }, value) + end, + }, + { + id = "commandsfxduration", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.commandsfxduration"), + type = "slider", + min = 0.5, + max = 2, + step = 0.01, + value = 1, + description = "", + onload = function(i) + loadWidgetData("Commands FX", "commandsfxduration", { "duration" }) + end, + onchange = function(i, value) + saveOptionValue("Commands FX", "commandsfx", "setDuration", { "duration" }, value) + end, + }, + { + id = "commandsfxfilterai", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.commandsfxfilterai"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.commandsfxfilterai_descr"), + onload = function(i) + loadWidgetData("Commands FX", "commandsfxfilterai", { "filterAIteams" }) + end, + onchange = function(i, value) + saveOptionValue("Commands FX", "commandsfx", "setFilterAI", { "filterAIteams" }, value) + end, + }, + { + id = "commandsfxuseteamcolors", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.commandsfxuseteamcolors"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.commandsfxuseteamcolors_descr"), + onload = function(i) + loadWidgetData("Commands FX", "commandsfxuseteamcolors", { "useTeamColors" }) + end, + onchange = function(i, value) + saveOptionValue("Commands FX", "commandsfx", "setUseTeamColors", { "useTeamColors" }, value) + end, + }, + { + id = "commandsfxuseteamcolorswhenspec", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.commandsfxuseteamcolorswhenspec"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.commandsfxuseteamcolorswhenspec_descr"), + onload = function(i) + loadWidgetData("Commands FX", "commandsfxuseteamcolorswhenspec", { "useTeamColorsWhenSpec" }) + end, + onchange = function(i, value) + saveOptionValue("Commands FX", "commandsfx", "setUseTeamColorsWhenSpec", { "useTeamColorsWhenSpec" }, value) + end, + }, + + { id = "flankingicons", group = "ui", category = types.advanced, widget = "Flanking Icons GL4", name = Spring.I18N("ui.settings.option.flankingicons"), type = "bool", value = GetWidgetToggleValue("Flanking Icons GL4"), description = Spring.I18N("ui.settings.option.flankingicons_descr") }, + + { + id = "displaydps", + group = "ui", + category = types.basic, + name = Spring.I18N("ui.settings.option.displaydps"), + type = "bool", + value = tonumber(Spring.GetConfigInt("DisplayDPS", 0) or 0) == 1, + description = Spring.I18N("ui.settings.option.displaydps_descr"), + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("DisplayDPS", (value and 1 or 0)) + end, + }, + + { id = "givenunits", group = "ui", category = types.advanced, widget = "Given Units", name = Spring.I18N("ui.settings.option.givenunits"), type = "bool", value = GetWidgetToggleValue("Given Units"), description = Spring.I18N("ui.settings.option.givenunits_descr") }, + + { id = "reclaimfieldhighlight", group = "ui", category = types.advanced, widget = "Reclaim Field Highlight", name = Spring.I18N("ui.settings.option.reclaimfieldhighlight"), type = "bool", description = Spring.I18N("ui.settings.option.reclaimfieldhighlight_descr") }, + + { + id = "reclaimfieldhighlight_metal", + group = "ui", + category = types.advanced, + widget = "Reclaim Field Highlight", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.reclaimfieldhighlight_metal"), + type = "select", + options = reclaimFieldHighlightOptions, + value = 3, + description = Spring.I18N("ui.settings.option.reclaimfieldhighlight_metal_descr"), + onload = function(i) + loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_metal", { "showOption" }) + end, + onchange = function(i, value) + saveOptionValue("Reclaim Field Highlight", "reclaimfieldhighlight", "setShowOption", { "showOption" }, value) + end, + }, + + { + id = "reclaimfieldhighlight_energy", + group = "ui", + category = types.advanced, + widget = "Reclaim Field Highlight", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.reclaimfieldhighlight_energy"), + type = "select", + options = reclaimFieldHighlightOptions, + value = 3, + description = Spring.I18N("ui.settings.option.reclaimfieldhighlight_energy_descr"), + onload = function(i) + loadWidgetData("Reclaim Field Highlight", "reclaimfieldhighlight_energy", { "showEnergyOption" }) + end, + onchange = function(i, value) + saveOptionValue("Reclaim Field Highlight", "reclaimfieldhighlight", "setShowEnergyOption", { "showEnergyOption" }, value) + end, + }, + + { id = "highlightcomwrecks", group = "ui", category = types.advanced, widget = "Highlight Commander Wrecks", name = Spring.I18N("ui.settings.option.highlightcomwrecks"), type = "bool", value = GetWidgetToggleValue("Highlight Commander Wrecks"), description = Spring.I18N("ui.settings.option.highlightcomwrecks_descr") }, + { + id = "highlightcomwrecks_teamcolor", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.highlightcomwrecks_teamcolor"), + type = "bool", + value = true, + description = Spring.I18N("ui.settings.option.highlightcomwrecks_teamcolor_descr"), + onload = function(i) + loadWidgetData("Highlight Commander Wrecks", "highlightcomwrecks_teamcolor", { "useTeamColor" }) + end, + onchange = function(i, value) + saveOptionValue("Highlight Commander Wrecks", "highlightcomwrecks", "setUseTeamColor", { "useTeamColor" }, value) + end, + }, + + { id = "buildinggrid", group = "ui", category = types.basic, widget = "Building Grid GL4", name = Spring.I18N("ui.settings.option.buildinggrid"), type = "bool", value = GetWidgetToggleValue("Building Grid GL4"), description = Spring.I18N("ui.settings.option.buildinggrid_descr") }, + { + id = "buildinggridopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.buildinggridopacity"), + type = "slider", + min = 0.3, + max = 1, + step = 0.05, + value = (WG["buildinggrid"] ~= nil and WG["buildinggrid"].getOpacity ~= nil and WG["buildinggrid"].getOpacity()) or 1, + description = "", + onload = function(i) + loadWidgetData("Building Grid GL4", "buildinggridopacity", { "opacity" }) + end, + onchange = function(i, value) + if widgetHandler.orderList["Building Grid GL4"] and widgetHandler.orderList["Building Grid GL4"] >= 0.5 then + widgetHandler:DisableWidget("Building Grid GL4") + saveOptionValue("Building Grid GL4", "buildinggrid", "setOpacity", { "opacity" }, value) + widgetHandler:EnableWidget("Building Grid GL4") + else + saveOptionValue("Building Grid GL4", "buildinggrid", "setOpacity", { "opacity" }, value) + end + end, + }, + { id = "startpositionsuggestions", group = "ui", category = types.basic, widget = "Start Position Suggestions", name = Spring.I18N("ui.settings.option.startpositionsuggestions"), type = "bool", value = GetWidgetToggleValue("Start Position Suggestions"), description = Spring.I18N("ui.settings.option.startpositionsuggestions_descr") }, + + { id = "label_ui_ranges", group = "ui", name = Spring.I18N("ui.settings.option.label_ranges"), category = types.basic }, + { id = "label_ui_ranges_spacer", group = "ui", category = types.basic }, + + -- Radar range rings: + { id = "radarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Radar", name = Spring.I18N("ui.settings.option.radarrange"), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Radar"), description = Spring.I18N("ui.settings.option.radarrange_descr") }, + + { + id = "radarrangeopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.radarrangeopacity"), + type = "slider", + min = 0.01, + max = 0.33, + step = 0.01, + value = (WG["radarrange"] ~= nil and WG["radarrange"].getOpacity ~= nil and WG["radarrange"].getOpacity()) or 0.08, + description = "", + onload = function(i) + loadWidgetData("Sensor Ranges Radar", "radarrangeopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Sensor Ranges Radar", "radarrange", "setOpacity", { "opacity" }, value) + end, + }, + -- Sonar range + { id = "sonarrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Sonar", name = Spring.I18N("ui.settings.option.sonarrange"), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Sonar"), description = Spring.I18N("ui.settings.option.sonarrange_descr") }, + + { + id = "sonarrangeopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sonarrangeopacity"), + type = "slider", + min = 0.01, + max = 0.33, + step = 0.01, + value = (WG["sonarrange"] ~= nil and WG["sonarrange"].getOpacity ~= nil and WG["sonarrange"].getOpacity()) or 0.08, + description = "", + onload = function(i) + loadWidgetData("Sensor Ranges Sonar", "sonarrangeopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Sensor Ranges Sonar", "sonarrange", "setOpacity", { "opacity" }, value) + end, + }, + -- Jammer range + { id = "jammerrange", group = "ui", category = types.advanced, widget = "Sensor Ranges Jammer", name = Spring.I18N("ui.settings.option.jammerrange"), type = "bool", value = GetWidgetToggleValue("Sensor Ranges Jammer"), description = Spring.I18N("ui.settings.option.jammerrange_descr") }, + + { + id = "jammerrangeopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.jammerrangeopacity"), + type = "slider", + min = 0.01, + max = 0.66, + step = 0.01, + value = (WG["jammerrange"] ~= nil and WG["jammerrange"].getOpacity ~= nil and WG["jammerrange"].getOpacity()) or 0.08, + description = "", + onload = function(i) + loadWidgetData("Sensor Ranges Jammer", "jammerrangeopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Sensor Ranges Jammer", "jammerrange", "setOpacity", { "opacity" }, value) + end, + }, + -- LOS Range: + { id = "losrange", group = "ui", category = types.advanced, widget = "Sensor Ranges LOS", name = Spring.I18N("ui.settings.option.losrange"), type = "bool", value = GetWidgetToggleValue("Sensor Ranges LOS"), description = Spring.I18N("ui.settings.option.losrange_descr") }, + + { + id = "losrangeopacity", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.losrangeopacity"), + type = "slider", + min = 0.01, + max = 0.33, + step = 0.01, + value = (WG["losrange"] ~= nil and WG["losrange"].getOpacity ~= nil and WG["losrange"].getOpacity()) or 0.08, + description = "", + onload = function(i) + loadWidgetData("Sensor Ranges LOS", "losrangeopacity", { "opacity" }) + end, + onchange = function(i, value) + saveOptionValue("Sensor Ranges LOS", "losrange", "setOpacity", { "opacity" }, value) + end, + }, + { + id = "losrangeteamcolors", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.losrangeteamcolors"), + type = "bool", + value = (WG["losrange"] ~= nil and WG["losrange"].getUseTeamColors ~= nil and WG["losrange"].getUseTeamColors()), + description = "", + onload = function(i) + loadWidgetData("Sensor Ranges LOS", "losrangeteamcolors", { "useteamcolors" }) + end, + onchange = function(i, value) + saveOptionValue("Sensor Ranges LOS", "losrange", "setUseTeamColors", { "useteamcolors" }, value) + end, + }, + + { id = "attackrange", group = "ui", category = types.basic, widget = "Attack Range GL4", name = Spring.I18N("ui.settings.option.attackrange"), type = "bool", value = GetWidgetToggleValue("Attack Range GL4"), description = Spring.I18N("ui.settings.option.attackrange_descr") }, + { + id = "attackrange_shiftonly", + category = types.dev, + group = "ui", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.attackrange_shiftonly"), + type = "bool", + value = (WG["attackrange"] ~= nil and WG["attackrange"].getShiftOnly ~= nil and WG["attackrange"].getShiftOnly()), + description = Spring.I18N("ui.settings.option.attackrange_shiftonly_descr"), + onload = function(i) + loadWidgetData("Attack Range GL4", "attackrange_shiftonly", { "shift_only" }) + end, + onchange = function(i, value) + saveOptionValue("Attack Range GL4", "attackrange", "setShiftOnly", { "shift_only" }, value) + end, + }, + { + id = "attackrange_cursorunitrange", + category = types.dev, + group = "ui", + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.attackrange_cursorunitrange"), + type = "bool", + value = (WG["attackrange"] ~= nil and WG["attackrange"].getCursorUnitRange ~= nil and WG["attackrange"].getCursorUnitRange()), + description = Spring.I18N("ui.settings.option.attackrange_cursorunitrange_descr"), + onload = function(i) + loadWidgetData("Attack Range GL4", "attackrange_cursorunitrange", { "cursor_unit_range" }) + end, + onchange = function(i, value) + saveOptionValue("Attack Range GL4", "attackrange", "setCursorUnitRange", { "cursor_unit_range" }, value) + end, + }, + { + id = "attackrange_numrangesmult", + group = "ui", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.attackrange_numrangesmult"), + type = "slider", + min = 0.3, + max = 1, + step = 0.1, + value = (WG["attackrange"] ~= nil and WG["attackrange"].getOpacity ~= nil and WG["attackrange"].getNumRangesMult()) or 1, + description = Spring.I18N("ui.settings.option.attackrange_numrangesmult_descr"), + onload = function(i) + loadWidgetData("Attack Range GL4", "attackrange_numrangesmult", { "selectionDisableThresholdMult" }) + end, + onchange = function(i, value) + saveOptionValue("Attack Range GL4", "attackrange", "setNumRangesMult", { "selectionDisableThresholdMult" }, value) + end, + }, + + { id = "defrange", group = "ui", category = types.basic, widget = "Defense Range GL4", name = Spring.I18N("ui.settings.option.defrange"), type = "bool", value = GetWidgetToggleValue("Defense Range GL4"), description = Spring.I18N("ui.settings.option.defrange_descr") }, + + { + id = "defrange_allyair", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_allyair"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getAllyAir ~= nil and WG["defrange"].getAllyAir()), + description = Spring.I18N("ui.settings.option.defrange_allyair_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_allyair", { "enabled", "ally", "air" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setAllyAir', { 'enabled', 'ally', 'air' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setAllyAir", { "enabled", "ally", "air" }, value) + end, + }, + { + id = "defrange_allyground", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_allyground"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getAllyGround ~= nil and WG["defrange"].getAllyGround()), + description = Spring.I18N("ui.settings.option.defrange_allyground_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_allyground", { "enabled", "ally", "ground" }) + loadWidgetData("Defense Range GL4", "defrange_allycannon", { "enabled", "ally", "cannon" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setAllyGround', { 'enabled', 'ally', 'ground' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setAllyGround", { "enabled", "ally", "ground" }, value) + saveOptionValue("Defense Range GL4", "defrange", "setAllyGround", { "enabled", "ally", "cannon" }, value) + end, + }, + { + id = "defrange_allynuke", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_allynuke"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getAllyNuke ~= nil and WG["defrange"].getAllyNuke()), + description = Spring.I18N("ui.settings.option.defrange_allynuke_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_allynuke", { "enabled", "ally", "nuke" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setAllyNuke', { 'enabled', 'ally', 'nuke' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setAllyNuke", { "enabled", "ally", "nuke" }, value) + end, + }, + { + id = "defrange_allylrpc", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_allylrpc"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getAllyLRPC ~= nil and WG["defrange"].getAllyLRPC()), + description = Spring.I18N("ui.settings.option.defrange_allylrpc_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_allylrpc", { "enabled", "ally", "lrpc" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setAllyLRPC', { 'enabled', 'ally', 'lrpc' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setAllyLRPC", { "enabled", "ally", "lrpc" }, value) + end, + }, + { + id = "defrange_enemyair", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_enemyair"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getEnemyAir ~= nil and WG["defrange"].getEnemyAir()), + description = Spring.I18N("ui.settings.option.defrange_enemyair_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_enemyair", { "enabled", "enemy", "air" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setEnemyAir', { 'enabled', 'enemy', 'air' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setEnemyAir", { "enabled", "enemy", "air" }, value) + end, + }, + { + id = "defrange_enemyground", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_enemyground"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getEnemyGround ~= nil and WG["defrange"].getEnemyGround()), + description = Spring.I18N("ui.settings.option.defrange_enemyground_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_enemyground", { "enabled", "enemy", "ground" }) + loadWidgetData("Defense Range GL4", "defrange_enemyground", { "enabled", "enemy", "cannon" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setEnemyGround', { 'enabled', 'enemy', 'ground' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setEnemyGround", { "enabled", "enemy", "ground" }, value) + saveOptionValue("Defense Range GL4", "defrange", "setEnemyGround", { "enabled", "enemy", "cannon" }, value) + end, + }, + { + id = "defrange_enemynuke", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_enemynuke"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getEnemyNuke ~= nil and WG["defrange"].getEnemyNuke()), + description = Spring.I18N("ui.settings.option.defrange_enemynuke_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_enemynuke", { "enabled", "enemy", "nuke" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setEnemyNuke', { 'enabled', 'enemy', 'nuke' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setEnemyNuke", { "enabled", "enemy", "nuke" }, value) + end, + }, + { + id = "defrange_enemylrpc", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.defrange_enemylrpc"), + type = "bool", + value = (WG["defrange"] ~= nil and WG["defrange"].getEnemyLRPC ~= nil and WG["defrange"].getEnemyLRPC()), + description = Spring.I18N("ui.settings.option.defrange_enemylrpc_descr"), + onload = function(i) + loadWidgetData("Defense Range GL4", "defrange_enemylrpc", { "enabled", "enemy", "lrpc" }) + end, + onchange = function(i, value) + --saveOptionValue('Defense Range', 'defrange', 'setEnemyLRPC', { 'enabled', 'enemy', 'lrpc' }, value) + saveOptionValue("Defense Range GL4", "defrange", "setEnemyLRPC", { "enabled", "enemy", "lrpc" }, value) + end, + }, + + { id = "antiranges", group = "ui", category = types.advanced, widget = "Anti Ranges", name = Spring.I18N("ui.settings.option.antiranges"), type = "bool", value = GetWidgetToggleValue("Anti Ranges"), description = Spring.I18N("ui.settings.option.antiranges_descr") }, + + { id = "label_ui_spectator", group = "ui", name = Spring.I18N("ui.settings.option.label_spectator"), category = types.basic }, + { id = "label_ui_spectator_spacer", group = "ui", category = types.basic }, + + { id = "spectator_hud", group = "ui", category = types.basic, widget = "Spectator HUD", name = Spring.I18N("ui.settings.option.spectator_hud"), type = "bool", value = GetWidgetToggleValue("Spectator HUD"), description = Spring.I18N("ui.settings.option.spectator_hud_descr") }, + { + id = "spectator_hud_size", + group = "ui", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.spectator_hud_size"), + type = "slider", + min = 0.1, + max = 2, + step = 0.1, + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getWidgetSize ~= nil and WG["spectator_hud"].getWidgetSize()) or 0.8, + description = "", + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_size", { "widgetScale" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setWidgetSize", { "widgetScale" }, value) + end, + }, + + { + id = "spectator_hud_config", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.spectator_hud_config"), + type = "select", + options = spectatorHUDConfigOptions, + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getConfig ~= nil and WG["spectator_hud"].getConfig()) or 1, + description = Spring.I18N("ui.settings.option.spectator_hud_config_descr"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_config", { "config" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setConfig", { "config" }, value) + init() + end, + }, + + { + id = "spectator_hud_metric_metalIncome", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.metalIncome_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("metalIncome")) or 1, + description = Spring.I18N("ui.spectator_hud.metalIncome_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_metalIncome", { "metricsEnabled", "metalIncome" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "metalIncome" }, value, { "metalIncome", value }) + end, + }, + { + id = "spectator_hud_metric_energyIncome", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.energyIncome_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("energyIncome")) or 1, + description = Spring.I18N("ui.spectator_hud.energyIncome_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_energyIncome", { "metricsEnabled", "energyIncome" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "energyIncome" }, value, { "energyIncome", value }) + end, + }, + { + id = "spectator_hud_metric_buildPower", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.buildPower_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("buildPower")) or 1, + description = Spring.I18N("ui.spectator_hud.buildPower_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_buildPower", { "metricsEnabled", "buildPower" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "buildPower" }, value, { "buildPower", value }) + end, + }, + { + id = "spectator_hud_metric_metalProduced", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.metalProduced_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("metalProduced")) or 1, + description = Spring.I18N("ui.spectator_hud.metalProduced_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_metalProduced", { "metricsEnabled", "metalProduced" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "metalProduced" }, value, { "metalProduced", value }) + end, + }, + { + id = "spectator_hud_metric_energyProduced", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.energyProduced_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("energyProduced")) or 1, + description = Spring.I18N("ui.spectator_hud.energyProduced_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_energyProduced", { "metricsEnabled", "energyProduced" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "energyProduced" }, value, { "energyProduced", value }) + end, + }, + { + id = "spectator_hud_metric_metalExcess", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.metalExcess_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("metalExcess")) or 1, + description = Spring.I18N("ui.spectator_hud.metalExcess_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_metalExcess", { "metricsEnabled", "metalExcess" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "metalExcess" }, value, { "metalExcess", value }) + end, + }, + { + id = "spectator_hud_metric_energyExcess", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.energyExcess_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("energyExcess")) or 1, + description = Spring.I18N("ui.spectator_hud.energyExcess_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_energyExcess", { "metricsEnabled", "energyExcess" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "energyExcess" }, value, { "energyExcess", value }) + end, + }, + { + id = "spectator_hud_metric_armyValue", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.armyValue_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("armyValue")) or 1, + description = Spring.I18N("ui.spectator_hud.armyValue_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_armyValue", { "metricsEnabled", "armyValue" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "armyValue" }, value, { "armyValue", value }) + end, + }, + { + id = "spectator_hud_metric_defenseValue", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.defenseValue_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("defenseValue")) or 1, + description = Spring.I18N("ui.spectator_hud.defenseValue_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_defenseValue", { "metricsEnabled", "defenseValue" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "defenseValue" }, value, { "defenseValue", value }) + end, + }, + { + id = "spectator_hud_metric_utilityValue", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.utilityValue_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("utilityValue")) or 1, + description = Spring.I18N("ui.spectator_hud.utilityValue_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_utilityValue", { "metricsEnabled", "utilityValue" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "utilityValue" }, value, { "utilityValue", value }) + end, + }, + { + id = "spectator_hud_metric_economyValue", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.economyValue_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("economyValue")) or 1, + description = Spring.I18N("ui.spectator_hud.economyValue_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_economyValue", { "metricsEnabled", "economyValue" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "economyValue" }, value, { "economyValue", value }) + end, + }, + { + id = "spectator_hud_metric_damageDealt", + group = "ui", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.spectator_hud.damageDealt_title"), + type = "bool", + value = (WG["spectator_hud"] ~= nil and WG["spectator_hud"].getMetricEnabled ~= nil and WG["spectator_hud"].getMetricEnabled("damageDealt")) or 1, + description = Spring.I18N("ui.spectator_hud.damageDealt_tooltip"), + onload = function(i) + loadWidgetData("Spectator HUD", "spectator_hud_metric_damageDealt", { "metricsEnabled", "damageDealt" }) + end, + onchange = function(i, value) + saveOptionValue("Spectator HUD", "spectator_hud", "setMetricEnabled", { "metricsEnabled", "damageDealt" }, value, { "damageDealt", value }) + end, + }, + + { id = "label_ui_developer", group = "ui", name = Spring.I18N("ui.settings.option.label_developer"), category = types.advanced }, + { id = "label_ui_developer_spacer", group = "ui", category = types.advanced }, + + { + id = "devmode", + group = "ui", + category = types.advanced, + name = Spring.I18N("ui.settings.option.devmode"), + type = "bool", + value = devUI, + description = Spring.I18N("ui.settings.option.devmode_descr"), + onchange = function(i, value) + devUI = value + Spring.SetConfigInt("DevUI", value and 1 or 0) + Spring.SendCommands("luaui reload") + end, + }, + + -- GAME + { + id = "networksmoothing", + restart = true, + category = types.basic, + group = "game", + name = Spring.I18N("ui.settings.option.networksmoothing"), + type = "bool", + value = useNetworkSmoothing, + description = Spring.I18N("ui.settings.option.networksmoothing_descr"), + onload = function(i) + options[i].onchange(i, options[i].value) + end, + onchange = function(i, value) + useNetworkSmoothing = value + if useNetworkSmoothing then + Spring.SetConfigInt("UseNetMessageSmoothingBuffer", 1) + Spring.SetConfigInt("NetworkLossFactor", 0) + Spring.SetConfigInt("LinkOutgoingBandwidth", 196608) + Spring.SetConfigInt("LinkIncomingSustainedBandwidth", 196608) + Spring.SetConfigInt("LinkIncomingPeakBandwidth", 196608) + Spring.SetConfigInt("LinkIncomingMaxPacketRate", 1024) + else + Spring.SetConfigInt("UseNetMessageSmoothingBuffer", 0) + Spring.SetConfigInt("NetworkLossFactor", 2) + Spring.SetConfigInt("LinkOutgoingBandwidth", 196608) + Spring.SetConfigInt("LinkIncomingSustainedBandwidth", 1048576) + Spring.SetConfigInt("LinkIncomingPeakBandwidth", 1048576) + Spring.SetConfigInt("LinkIncomingMaxPacketRate", 2048) + end + end, + }, + { id = "autoquit", group = "game", category = types.basic, widget = "Autoquit", name = Spring.I18N("ui.settings.option.autoquit"), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N("ui.settings.option.autoquit_descr") }, + + { + id = "singleplayerpause", + group = "game", + category = types.advanced, + name = Spring.I18N("ui.settings.option.singleplayerpause"), + type = "bool", + value = pauseGameWhenSingleplayer, + description = Spring.I18N("ui.settings.option.singleplayerpause_descr"), + onchange = function(i, value) + pauseGameWhenSingleplayer = value + if (isSinglePlayer or isReplay) and show then + if pauseGameWhenSingleplayer then + Spring.SendCommands("pause " .. (pauseGameWhenSingleplayer and "1" or "0")) + pauseGameWhenSingleplayerExecuted = pauseGameWhenSingleplayer + elseif pauseGameWhenSingleplayerExecuted then + Spring.SendCommands("pause 0") + pauseGameWhenSingleplayerExecuted = false + end + end + end, + }, + + { + id = "catchupsmoothness", + group = "game", + category = types.dev, + name = Spring.I18N("ui.settings.option.catchupsmoothness"), + restart = true, + type = "slider", + min = 0.05, + max = 0.3, + step = 0.01, + value = Spring.GetConfigFloat("MinSimDrawBalance", 0.15), + description = Spring.I18N("ui.settings.option.catchupsmoothness_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("MinSimDrawBalance", value) + end, + }, + { + id = "catchupminfps", + group = "game", + category = types.dev, + name = Spring.I18N("ui.settings.option.catchupminfps"), + restart = true, + type = "slider", + min = 2, + max = 15, + step = 1, + value = Spring.GetConfigInt("MinDrawFPS", 2), + description = Spring.I18N("ui.settings.option.catchupminfps_descr"), + onchange = function(i, value) + Spring.SetConfigInt("MinDrawFPS", value) + end, + }, + + { id = "label_ui_behavior", group = "game", name = Spring.I18N("ui.settings.option.label_behavior"), category = types.basic }, + { id = "label_ui_behavior_spacer", group = "game", category = types.basic }, + + { + id = "smartselect_includebuildings", + group = "game", + category = types.basic, + name = Spring.I18N("ui.settings.option.smartselect_includebuildings"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includebuildings_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeBuildings", { "selectBuildingsWithMobile" }, value) + end, + }, + { + id = "smartselect_includebuilders", + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smartselect_includebuilders"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includebuilders_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeBuilders", { "includeBuilders" }, value) + end, + }, + { + id = "smartselect_includeresurrectors", + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smartselect_includeresurrectors"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includeresurrectors_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeResurrectors", { "includeResurrectors" }, value) + end, + }, + { + id = "smartselect_includeantinuke", + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smartselect_includeantinuke"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includeantinuke_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeAntinuke", { "includeAntinuke" }, value) + end, + }, + { + id = "smartselect_includeradar", + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smartselect_includeradar"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includeradar_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeRadar", { "includeRadar" }, value) + end, + }, + { + id = "smartselect_includejammer", + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.smartselect_includejammer"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.smartselect_includejammer_descr"), + onload = function(i) end, + onchange = function(i, value) + saveOptionValue("SmartSelect", "smartselect", "setIncludeJammer", { "includeJammer" }, value) + end, + }, + + { id = "prioconturrets", group = "game", category = types.basic, widget = "Priority Construction Turrets", name = Spring.I18N("ui.settings.option.prioconturrets"), type = "bool", value = GetWidgetToggleValue("Priority Construction Turrets"), description = Spring.I18N("ui.settings.option.prioconturrets_descr") }, + + { + id = "builderpriority", + group = "game", + category = types.basic, + widget = "Builder Priority", + name = Spring.I18N("ui.settings.option.builderpriority"), + type = "bool", + value = GetWidgetToggleValue("Builder Priority"), + description = Spring.I18N("ui.settings.option.builderpriority_descr"), + }, + + { + id = "builderpriority_nanos", + group = "game", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.builderpriority_nanos"), + type = "bool", + value = (WG["builderpriority"] ~= nil and WG["builderpriority"].getLowPriorityNanos ~= nil and WG["builderpriority"].getLowPriorityNanos()), + description = Spring.I18N("ui.settings.option.builderpriority_nanos_descr"), + onload = function(i) + loadWidgetData("Builder Priority", "builderpriority_nanos", { "lowpriorityNanos" }) + end, + onchange = function(i, value) + saveOptionValue("Builder Priority", "builderpriority", "setLowPriorityNanos", { "lowpriorityNanos" }, value) + end, + }, + + { + id = "builderpriority_cons", + group = "game", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.builderpriority_cons"), + type = "bool", + value = (WG["builderpriority"] ~= nil and WG["builderpriority"].getLowPriorityCons ~= nil and WG["builderpriority"].getLowPriorityCons()), + description = Spring.I18N("ui.settings.option.builderpriority_cons_descr"), + onload = function(i) + loadWidgetData("Builder Priority", "builderpriority_cons", { "lowpriorityCons" }) + end, + onchange = function(i, value) + saveOptionValue("Builder Priority", "builderpriority", "setLowPriorityCons", { "lowpriorityCons" }, value) + end, + }, + + { + id = "builderpriority_labs", + group = "game", + category = types.advanced, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.builderpriority_labs"), + type = "bool", + value = (WG["builderpriority"] ~= nil and WG["builderpriority"].getLowPriorityLabs ~= nil and WG["builderpriority"].getLowPriorityLabs()), + description = Spring.I18N("ui.settings.option.builderpriority_labs_descr"), + onload = function(i) + loadWidgetData("Builder Priority", "builderpriority_labs", { "lowpriorityLabs" }) + end, + onchange = function(i, value) + saveOptionValue("Builder Priority", "builderpriority", "setLowPriorityLabs", { "lowpriorityLabs" }, value) + end, + }, + + { id = "factoryguard", group = "game", category = types.basic, widget = "Factory Guard Default On", name = Spring.I18N("ui.settings.option.factory") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.factoryguard"), type = "bool", value = GetWidgetToggleValue("Factory Guard Default On"), description = Spring.I18N("ui.settings.option.factoryguard_descr") }, + { id = "factoryholdpos", group = "game", category = types.basic, widget = "Factory hold position", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.factoryholdpos"), type = "bool", value = GetWidgetToggleValue("Factory hold position"), description = Spring.I18N("ui.settings.option.factoryholdpos_descr") }, + { id = "factoryrepeat", group = "game", category = types.basic, widget = "Factory Auto-Repeat", name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.factoryrepeat"), type = "bool", value = GetWidgetToggleValue("Factory Auto-Repeat"), description = Spring.I18N("ui.settings.option.factoryrepeat_descr") }, + + { + id = "transportOrderedUnits", + group = "game", + category = types.basic, + name = "Ferry ignores units with manual orders", + type = "bool", + value = (WG["transportFactoryGuard"] ~= nil and WG["transportFactoryGuard"].getBlacklistOrderedUnits ~= nil and WG["transportFactoryGuard"].getBlacklistOrderedUnits()), + description = "If enabled, transports guarding factories will not transport units that were given explicit orders during construction to their move waypoint.", + onload = function(i) + loadWidgetData("Transport Factory Guard", "blacklistOrderedUnits", { "blacklistOrderedUnits" }) + end, + onchange = function(_, value) + if widgetHandler.configData["transportFactoryGuard"] == nil then + widgetHandler.configData["transportFactoryGuard"] = {} + end + widgetHandler.configData["Auto Group"].immediate = value + saveOptionValue("Transport Factory Guard", "transportFactoryGuard", "setBlacklistOrderedUnits", { "blacklistOrderedUnits" }, value) + if WG["transportFactoryGuard"] and WG["transportFactoryGuard"].setBlacklistOrderedUnits then + WG["transportFactoryGuard"].setBlacklistOrderedUnits(value) + end + end, + }, + + { id = "onlyfighterspatrol", group = "game", category = types.basic, widget = "OnlyFightersPatrol", name = Spring.I18N("ui.settings.option.onlyfighterspatrol"), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N("ui.settings.option.onlyfighterspatrol_descr") }, + { id = "bombers_default_hold_fire", group = "game", category = types.basic, widget = "BombersDefaultHoldFire", name = Spring.I18N("ui.settings.option.bombers_default_hold_fire"), type = "bool", value = GetWidgetToggleValue("BombersDefaultHoldFire"), description = Spring.I18N("ui.settings.option.bombers_default_hold_fire_descr") }, + { id = "fightersfly", group = "game", category = types.basic, widget = "Set fighters on Fly mode", name = Spring.I18N("ui.settings.option.fightersfly"), type = "bool", value = GetWidgetToggleValue("Set fighters on Fly mode"), description = Spring.I18N("ui.settings.option.fightersfly_descr") }, + + { id = "settargetdefault", group = "game", category = types.basic, widget = "Set target default", name = Spring.I18N("ui.settings.option.settargetdefault"), type = "bool", value = GetWidgetToggleValue("Set target default"), description = Spring.I18N("ui.settings.option.settargetdefault_descr") }, + { id = "dgunnogroundenemies", group = "game", category = types.advanced, widget = "DGun no ground enemies", name = Spring.I18N("ui.settings.option.dgunnogroundenemies"), type = "bool", value = GetWidgetToggleValue("DGun no ground enemies"), description = Spring.I18N("ui.settings.option.dgunnogroundenemies_descr") }, + { id = "dgunstallassist", group = "game", category = types.advanced, widget = "DGun Stall Assist", name = Spring.I18N("ui.settings.option.dgunstallassist"), type = "bool", value = GetWidgetToggleValue("DGun Stall Assist"), description = Spring.I18N("ui.settings.option.dgunstallassist_descr") }, + + { id = "unitreclaimer", group = "game", category = types.basic, widget = "Specific Unit Reclaimer", name = Spring.I18N("ui.settings.option.unitreclaimer"), type = "bool", value = GetWidgetToggleValue("Specific Unit Reclaimer"), description = Spring.I18N("ui.settings.option.unitreclaimer_descr") }, + + { + id = "autogroup_immediate", + group = "game", + category = types.basic, + name = Spring.I18N("ui.settings.option.autogroup_immediate"), + type = "bool", + value = (WG["autogroup"] ~= nil and WG["autogroup"].getImmediate ~= nil and WG["autogroup"].getImmediate()), + description = Spring.I18N("ui.settings.option.autogroup_immediate_descr"), + onload = function(i) + loadWidgetData("Auto Group", "autogroup_immediate", { "immediate" }) + end, + onchange = function(i, value) + if widgetHandler.configData["Auto Group"] == nil then + widgetHandler.configData["Auto Group"] = {} + end + widgetHandler.configData["Auto Group"].immediate = value + saveOptionValue("Auto Group", "autogroup", "setImmediate", { "immediate" }, value) + end, + }, + + { + id = "autogroup_persist", + group = "game", + category = types.basic, + name = Spring.I18N("ui.settings.option.autogroup_persist"), + type = "bool", + value = (WG["autogroup"] ~= nil and WG["autogroup"].getPersist ~= nil and WG["autogroup"].getPersist()), + description = Spring.I18N("ui.settings.option.autogroup_persist_descr"), + onload = function(i) + loadWidgetData("Auto Group", "autogroup_persist", { "persist" }) + end, + onchange = function(i, value) + if widgetHandler.configData["Auto Group"] == nil then + widgetHandler.configData["Auto Group"] = {} + end + widgetHandler.configData["Auto Group"].persist = value + saveOptionValue("Auto Group", "autogroup", "setPersist", { "persist" }, value) + end, + }, + + { id = "label_ui_cloak", group = "game", name = Spring.I18N("ui.settings.option.label_cloak"), category = types.basic }, + { id = "label_ui_cloak_spacer", group = "game", category = types.basic }, + + { id = "autocloak", group = "game", category = types.basic, widget = "Auto Cloak Units", name = Spring.I18N("ui.settings.option.autocloak"), type = "bool", value = GetWidgetToggleValue("Auto Cloak Units") }, + + -- ACCESSIBILITY + + { id = "label_teamcolors", group = "accessibility", name = Spring.I18N("ui.settings.option.label_teamcolors"), category = types.basic }, + { id = "label_teamcolors_spacer", group = "accessibility", category = types.basic }, + + { + id = "anonymous_r", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.anonymous_r"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("anonymousColorR", 255)), + description = Spring.I18N("ui.settings.option.anonymous_descr"), + onchange = function(i, value, force) + if force then + Spring.SetConfigInt("anonymousColorR", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("anonymous_r") } + end + end, + }, + + { + id = "anonymous_g", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.anonymous_g"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("anonymousColorG", 0)), + description = Spring.I18N("ui.settings.option.anonymous_descr"), + onchange = function(i, value, force) + if force then + Spring.SetConfigInt("anonymousColorG", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("anonymous_g") } + end + end, + }, + + { + id = "anonymous_b", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.anonymous_b"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("anonymousColorB", 0)), + description = Spring.I18N("ui.settings.option.anonymous_descr"), + onchange = function(i, value, force) + if force then + Spring.SetConfigInt("anonymousColorB", value) + Spring.SendCommands("luarules reloadluaui") + else + sceduleOptionApply = { os.clock() + 1.5, getOptionByID("anonymous_b") } + end + end, + }, + + { + id = "simpleteamcolors", + group = "accessibility", + category = types.basic, + name = Spring.I18N("ui.settings.option.playercolors"), + type = "bool", + value = tonumber(Spring.GetConfigInt("SimpleTeamColors", 0) or 0) == 1, + description = Spring.I18N("ui.settings.option.simpleteamcolors_descr"), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColors", (value and 1 or 0)) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + + { + id = "simpleteamcolors_reset", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_reset"), + type = "bool", + value = tonumber(Spring.GetConfigInt("SimpleTeamColors_Reset", 0) or 0) == 1, + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsUseGradient", 0) + Spring.SetConfigInt("SimpleTeamColorsPlayerR", 0) + Spring.SetConfigInt("SimpleTeamColorsPlayerG", 77) + Spring.SetConfigInt("SimpleTeamColorsPlayerB", 255) + Spring.SetConfigInt("SimpleTeamColorsAllyR", 0) + Spring.SetConfigInt("SimpleTeamColorsAllyG", 255) + Spring.SetConfigInt("SimpleTeamColorsAllyB", 0) + Spring.SetConfigInt("SimpleTeamColorsEnemyR", 255) + Spring.SetConfigInt("SimpleTeamColorsEnemyG", 16) + Spring.SetConfigInt("SimpleTeamColorsEnemyB", 5) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_use_gradient", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_use_gradient"), + type = "bool", + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsUseGradient", 0) or 0) == 1, + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsUseGradient", (value and 1 or 0)) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolorsfactionspecific", + group = "accessibility", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolorsfactionspecific"), + type = "bool", + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsFactionSpecific", 0) or 0) == 1, + description = Spring.I18N("ui.settings.option.simpleteamcolorsfactionspecific_descr"), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsFactionSpecific", (value and 1 or 0)) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_player_r", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_player_r"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsPlayerR", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_player_g", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_player_g"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsPlayerG", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_player_b", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_player_b"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsPlayerB", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + + { + id = "simpleteamcolors_ally_r", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_ally_r"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyR", 0)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsAllyR", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_ally_g", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_ally_g"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyG", 255)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsAllyG", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_ally_b", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_ally_b"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyB", 0)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsAllyB", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + + { + id = "simpleteamcolors_enemy_r", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_enemy_r"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsEnemyR", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_enemy_g", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_enemy_g"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsEnemyG", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + { + id = "simpleteamcolors_enemy_b", + group = "accessibility", + category = types.basic, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.simpleteamcolors_enemy_b"), + type = "slider", + min = 0, + max = 255, + step = 1, + value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5)), + onchange = function(i, value) + Spring.SetConfigInt("SimpleTeamColorsEnemyB", value) + Spring.SetConfigInt("UpdateTeamColors", 1) + end, + }, + + -- DEV + { + id = "customwidgets", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.customwidgets"), + type = "bool", + value = widgetHandler.allowUserWidgets, + description = Spring.I18N("ui.settings.option.customwidgets_descr"), + onchange = function(i, value) + widgetHandler.__allowUserWidgets = value + Spring.SendCommands("luarules reloadluaui") + end, + }, + + { id = "autocheat", group = "dev", category = types.dev, widget = "Dev Auto cheat", name = Spring.I18N("ui.settings.option.autocheat"), type = "bool", value = GetWidgetToggleValue("Dev Auto cheat"), description = Spring.I18N("ui.settings.option.autocheat_descr") }, + { + id = "restart", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.restart"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.restart_descr"), + onchange = function(i, value) + options[getOptionByID("restart")].value = false + Spring.Restart("", startScript) + end, + }, + { + id = "restart_with_state", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.restart_with_state"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.restart_with_state_descr"), + onchange = function(i, value) + options[getOptionByID("restart_with_state")].value = false + Spring.SendLuaRulesMsg("restart_with_state") + end, + }, + + { id = "label_dev_debug", group = "dev", name = Spring.I18N("ui.settings.option.label_debug"), category = types.dev }, + { id = "label_dev_debug_spacer", group = "dev", category = types.dev }, + + { id = "profiler_widget", group = "dev", category = types.dev, widget = "Widget Profiler", name = Spring.I18N("ui.settings.option.profiler") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.profiler_widget"), type = "bool", value = GetWidgetToggleValue("Widget Profiler") }, + { + id = "profiler_gadget", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.profiler_gadget"), + type = "bool", + value = false, + onchange = function(i, value) + Spring.SendCommands("luarules profile") + end, + }, + { + id = "profiler_sort_by_load", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.profiler_sort_by_load"), + type = "bool", + value = Spring.GetConfigInt("profiler_sort_by_load", 1), + description = Spring.I18N("ui.settings.option.profiler_sort_by_load_descr"), + onchange = function(i, value) + Spring.SetConfigInt("profiler_sort_by_load", (value and "1" or "0")) + end, + }, + { + id = "profiler_averagetime", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.profiler_averagetime"), + type = "slider", + min = 0.1, + max = 10, + step = 0.1, + value = Spring.GetConfigFloat("profiler_averagetime", 2), + description = Spring.I18N("ui.settings.option.profiler_averagetime_descr"), + onchange = function(i, value) + Spring.SetConfigFloat("profiler_averagetime", value) + end, + }, + { id = "framegrapher", group = "dev", category = types.dev, widget = "Frame Grapher", name = Spring.I18N("ui.settings.option.framegrapher"), type = "bool", value = GetWidgetToggleValue("Frame Grapher"), description = "" }, + + { + id = "debugcolvol", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.debugcolvol"), + type = "bool", + value = false, + description = "", + onchange = function(i, value) + Spring.SendCommands("DebugColVol " .. (value and "1" or "0")) + end, + }, + { + id = "echocamerastate", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.echocamerastate"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.echocamerastate_descr"), + onchange = function(i, value) + options[getOptionByID("echocamerastate")].value = false + Spring.Echo(Spring.GetCameraState()) + end, + }, + + { id = "label_dev_other", group = "dev", name = Spring.I18N("ui.settings.option.label_other"), category = types.dev }, + { id = "label_dev_other_spacer", group = "dev", category = types.dev }, + + { + id = "storedefaultsettings", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.storedefaultsettings"), + type = "bool", + value = tonumber(Spring.GetConfigInt("StoreDefaultSettings", 0) or 0) == 1, + description = Spring.I18N("ui.settings.option.storedefaultsettings_descr"), + onchange = function(i, value) + Spring.SetConfigInt("StoreDefaultSettings", (value and 1 or 0)) + end, + }, + + { id = "startboxeditor", group = "dev", category = types.dev, widget = "Startbox Editor", name = Spring.I18N("ui.settings.option.startboxeditor"), type = "bool", value = GetWidgetToggleValue("Startbox Editor"), description = Spring.I18N("ui.settings.option.startboxeditor_descr") }, + + { + id = "language_dev", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.language"), + type = "select", + options = devLanguageNames, + value = devLanguageCodes[Spring.I18N.getLocale()], + onchange = function(i, value) + local devLanguage = devLanguageCodes[value] + WG["language"].setLanguage(devLanguage) + end, + }, + { + id = "font", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.font"), + type = "select", + options = {}, + value = 1, + description = Spring.I18N("ui.settings.option.font_descr"), + onload = function(i) end, + onchange = function(i, value) + if VFS.FileExists("fonts/" .. options[i].optionsFont[value]) then + Spring.SetConfigString("bar_font", options[i].optionsFont[value]) + Spring.SendCommands("luarules reloadluaui") + end + end, + }, + { + id = "font2", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.font2"), + type = "select", + options = {}, + value = 1, + description = Spring.I18N("ui.settings.option.font2_descr"), + onload = function(i) end, + onchange = function(i, value) + if VFS.FileExists("fonts/" .. options[i].optionsFont[value]) then + Spring.SetConfigString("bar_font2", options[i].optionsFont[value]) + Spring.SendCommands("luarules reloadluaui") + end + end, + }, + + --{ id = "label_dev_unit", group = "dev", name = Spring.I18N('ui.settings.option.label_unit'), category = types.dev }, + --{ id = "label_dev_unit_spacer", group = "dev", category = types.dev }, + -- + --{ id = "tonemapA", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.tonemap') .. widgetOptionColor .. " 1", type = "slider", min = 0, max = 7, step = 0.01, value = Spring.GetConfigFloat("tonemapA", 4.8), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapA", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "tonemapB", group = "dev", category = types.dev, name = widgetOptionColor .. " 2", type = "slider", min = 0, max = 2, step = 0.01, value = Spring.GetConfigFloat("tonemapB", 0.75), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapB", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "tonemapC", group = "dev", category = types.dev, name = widgetOptionColor .. " 3", type = "slider", min = 0, max = 5, step = 0.01, value = Spring.GetConfigFloat("tonemapC", 3.5), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapC", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "tonemapD", group = "dev", category = types.dev, name = widgetOptionColor .. " 4", type = "slider", min = 0, max = 3, step = 0.01, value = Spring.GetConfigFloat("tonemapD", 0.85), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapD", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "tonemapE", group = "dev", category = types.dev, name = widgetOptionColor .. " 5", type = "slider", min = 0.75, max = 1.5, step = 0.01, value = Spring.GetConfigFloat("tonemapE", 1.0), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapE", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "envAmbient", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.envAmbient'), type = "slider", min = 0, max = 1, step = 0.01, value = Spring.GetConfigFloat("envAmbient", 0.25), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("envAmbient", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "unitSunMult", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unitSunMult'), type = "slider", min = 0.7, max = 1.6, step = 0.01, value = Spring.GetConfigFloat("unitSunMult", 1.0), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("unitSunMult", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "unitExposureMult", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unitExposureMult'), type = "slider", min = 0.6, max = 1.25, step = 0.01, value = Spring.GetConfigFloat("unitExposureMult", 1.0), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("unitExposureMult", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "modelGamma", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.modelGamma'), type = "slider", min = 0.7, max = 1.7, step = 0.01, value = Spring.GetConfigFloat("modelGamma", 1.0), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("modelGamma", value) + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- end, + --}, + --{ id = "tonemapDefaults", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.tonemapDefaults'), type = "bool", value = GetWidgetToggleValue("Unit Reclaimer"), description = "", + -- onchange = function(i, value) + -- Spring.SetConfigFloat("tonemapA", 4.75) + -- Spring.SetConfigFloat("tonemapB", 0.75) + -- Spring.SetConfigFloat("tonemapC", 3.5) + -- Spring.SetConfigFloat("tonemapD", 0.85) + -- Spring.SetConfigFloat("tonemapE", 1.0) + -- Spring.SetConfigFloat("envAmbient", 0.25) + -- Spring.SetConfigFloat("unitSunMult", 1.0) + -- Spring.SetConfigFloat("unitExposureMult", 1.0) + -- Spring.SetConfigFloat("modelGamma", 1.0) + -- options[getOptionByID('tonemapA')].value = Spring.GetConfigFloat("tonemapA") + -- options[getOptionByID('tonemapB')].value = Spring.GetConfigFloat("tonemapB") + -- options[getOptionByID('tonemapC')].value = Spring.GetConfigFloat("tonemapC") + -- options[getOptionByID('tonemapD')].value = Spring.GetConfigFloat("tonemapD") + -- options[getOptionByID('tonemapE')].value = Spring.GetConfigFloat("tonemapE") + -- options[getOptionByID('envAmbient')].value = Spring.GetConfigFloat("envAmbient") + -- options[getOptionByID('unitSunMult')].value = Spring.GetConfigFloat("unitSunMult") + -- options[getOptionByID('unitExposureMult')].value = Spring.GetConfigFloat("unitExposureMult") + -- options[getOptionByID('modelGamma')].value = Spring.GetConfigFloat("modelGamma") + -- Spring.SendCommands("luarules updatesun") + -- Spring.SendCommands("luarules GlassUpdateSun") + -- options[getOptionByID('tonemapDefaults')].value = false + -- end, + --}, + + { id = "label_dev_map", group = "dev", name = Spring.I18N("ui.settings.option.label_map"), category = types.dev }, + { id = "label_dev_map_spacer", group = "dev", category = types.dev }, + + { + id = "sun_y", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.sun") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sun_y"), + type = "slider", + min = 0.05, + max = 0.9999, + step = 0.0001, + value = select(2, gl.GetSun("pos")), + onchange = function(i, value) + local sunX, sunY, sunZ = gl.GetSun("pos") + sunY = value + if sunY < options[getOptionByID("sun_y")].min then + sunY = options[getOptionByID("sun_y")].min + end + if sunY > options[getOptionByID("sun_y")].max then + sunY = options[getOptionByID("sun_y")].max + end + options[getOptionByID("sun_y")].value = sunY + Spring.SetSunDirection(sunX, sunY, sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) + Spring.Echo(gl.GetSun()) + end, + }, + { + id = "sun_x", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sun_x"), + type = "slider", + min = -0.9999, + max = 0.9999, + step = 0.0001, + value = select(1, gl.GetSun("pos")), + onchange = function(i, value) + local sunX, sunY, sunZ = gl.GetSun("pos") + sunX = value + if sunX < options[getOptionByID("sun_x")].min then + sunX = options[getOptionByID("sun_x")].min + end + if sunX > options[getOptionByID("sun_x")].max then + sunX = options[getOptionByID("sun_x")].max + end + options[getOptionByID("sun_x")].value = sunX + Spring.SetSunDirection(sunX, sunY, sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) + Spring.Echo(gl.GetSun()) + end, + }, + { + id = "sun_z", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sun_z"), + type = "slider", + min = -0.9999, + max = 0.9999, + step = 0.0001, + value = select(3, gl.GetSun("pos")), + onload = function(i) end, + onchange = function(i, value) + local sunX, sunY, sunZ = gl.GetSun("pos") + sunZ = value + if sunZ < options[getOptionByID("sun_z")].min then + sunZ = options[getOptionByID("sun_z")].min + end + if sunZ > options[getOptionByID("sun_z")].max then + sunZ = options[getOptionByID("sun_z")].max + end + options[getOptionByID("sun_z")].value = sunZ + Spring.SetSunDirection(sunX, sunY, sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) + Spring.Echo(gl.GetSun()) + end, + }, + { + id = "sun_reset", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.sun_reset"), + type = "bool", + value = false, + onload = function(i) end, + onchange = function(i, value) + options[getOptionByID("sun_x")].value = defaultMapSunPos[1] + options[getOptionByID("sun_y")].value = defaultMapSunPos[2] + options[getOptionByID("sun_z")].value = defaultMapSunPos[3] + options[getOptionByID("sun_reset")].value = false + Spring.SetSunDirection(defaultMapSunPos[1], defaultMapSunPos[2], defaultMapSunPos[3]) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) + Spring.Echo(gl.GetSun()) + end, + }, + + { + id = "fog_start", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.fog") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fog_start"), + type = "slider", + min = 0, + max = 1.99, + step = 0.01, + value = gl.GetAtmosphere("fogStart"), + onload = function(i) end, + onchange = function(i, value) + if getOptionByID("fog_end") and value >= options[getOptionByID("fog_end")].value then + applyOptionValue(getOptionByID("fog_end"), value + 0.01) + end + Spring.SetAtmosphere({ fogStart = value }) + end, + }, + { + id = "fog_end", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fog_end"), + type = "slider", + min = 0.5, + max = 2, + step = 0.01, + value = gl.GetAtmosphere("fogEnd"), + onload = function(i) end, + onchange = function(i, value) + if getOptionByID("fog_start") and value <= options[getOptionByID("fog_start")].value then + applyOptionValue(getOptionByID("fog_start"), value - 0.01) + end + Spring.SetAtmosphere({ fogEnd = value }) + end, + }, + { + id = "fog_reset", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fog_reset"), + type = "bool", + value = false, + description = "", + onload = function(i) end, + onchange = function(i, value) + if getOptionByID("fog_start") then + options[getOptionByID("fog_start")].value = defaultMapFog.fogStart + options[getOptionByID("fog_end")].value = defaultMapFog.fogEnd + options[getOptionByID("fog_reset")].value = false + end + Spring.SetAtmosphere({ fogStart = defaultMapFog.fogStart, fogEnd = defaultMapFog.fogEnd }) + end, + }, + + { + id = "fog_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.fog") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = select(1, gl.GetAtmosphere("fogColor")), + description = "", + onload = function(i) end, + onchange = function(i, value) + local fogColor = { gl.GetAtmosphere("fogColor") } + Spring.SetAtmosphere({ fogColor = { value, fogColor[2], fogColor[3], fogColor[4] } }) + end, + }, + { + id = "fog_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = select(2, gl.GetAtmosphere("fogColor")), + description = "", + onload = function(i) end, + onchange = function(i, value) + local fogColor = { gl.GetAtmosphere("fogColor") } + Spring.SetAtmosphere({ fogColor = { fogColor[1], value, fogColor[3], fogColor[4] } }) + end, + }, + { + id = "fog_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 1, + step = 0.01, + value = select(3, gl.GetAtmosphere("fogColor")), + description = "", + onload = function(i) end, + onchange = function(i, value) + local fogColor = { gl.GetAtmosphere("fogColor") } + Spring.SetAtmosphere({ fogColor = { fogColor[1], fogColor[2], value, fogColor[4] } }) + end, + }, + { + id = "fog_color_reset", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.fog_color_reset"), + type = "bool", + value = false, + description = "", + onload = function(i) end, + onchange = function(i, value) + options[getOptionByID("fog_r")].value = defaultMapFog.fogColor[1] + options[getOptionByID("fog_g")].value = defaultMapFog.fogColor[2] + options[getOptionByID("fog_b")].value = defaultMapFog.fogColor[3] + options[getOptionByID("fog_color_reset")].value = false + Spring.SetAtmosphere({ fogColor = defaultMapFog.fogColor }) + Spring.Echo("resetted map fog color defaults") + end, + }, + + { + id = "map_voidwater", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.map_voidwater"), + type = "bool", + value = false, + description = "", + onload = function(i) + options[i].value = gl.GetMapRendering("voidWater") + end, + onchange = function(i, value) + Spring.SetMapRenderingParams({ voidWater = value }) + end, + }, + { + id = "map_voidground", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.map_voidground"), + type = "bool", + value = false, + description = "", + onload = function(i) + options[i].value = gl.GetMapRendering("voidGround") + end, + onchange = function(i, value) + Spring.SetMapRenderingParams({ voidGround = value }) + end, + }, + + { + id = "map_splatdetailnormaldiffusealpha", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.map_splatdetailnormaldiffusealpha"), + type = "bool", + value = false, + description = "", + onload = function(i) + options[i].value = gl.GetMapRendering("splatDetailNormalDiffuseAlpha") + end, + onchange = function(i, value) + Spring.SetMapRenderingParams({ splatDetailNormalDiffuseAlpha = value }) + end, + }, + + { + id = "map_splattexmults_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.map_splattexmults") .. widgetOptionColor .. " 0", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + Spring.SetMapRenderingParams({ splatTexMults = { value, g, b, a } }) + end, + }, + { + id = "map_splattexmults_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 1", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + Spring.SetMapRenderingParams({ splatTexMults = { r, value, b, a } }) + end, + }, + { + id = "map_splattexmults_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 2", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + Spring.SetMapRenderingParams({ splatTexMults = { r, g, value, a } }) + end, + }, + { + id = "map_splattexmults_a", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 3", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + options[i].value = a + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexMults") + Spring.SetMapRenderingParams({ splatTexMults = { r, g, b, value } }) + end, + }, + + { + id = "map_splattexacales_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.map_splattexacales") .. widgetOptionColor .. " 0", + type = "slider", + min = 0, + max = 0.02, + step = 0.0001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + Spring.SetMapRenderingParams({ splatTexScales = { value, g, b, a } }) + end, + }, + { + id = "map_splattexacales_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 1", + type = "slider", + min = 0, + max = 0.02, + step = 0.0001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + Spring.SetMapRenderingParams({ splatTexScales = { r, value, b, a } }) + end, + }, + { + id = "map_splattexacales_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 2", + type = "slider", + min = 0, + max = 0.02, + step = 0.0001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + Spring.SetMapRenderingParams({ splatTexScales = { r, g, value, a } }) + end, + }, + { + id = "map_splattexacales_a", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " 3", + type = "slider", + min = 0, + max = 0.02, + step = 0.0001, + value = 0, + description = "", + onload = function(i) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + options[i].value = a + end, + onchange = function(i, value) + local r, g, b, a = gl.GetMapRendering("splatTexScales") + Spring.SetMapRenderingParams({ splatTexScales = { r, g, b, value } }) + end, + }, + + { + id = "GroundShadowDensity", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.GroundShadowDensity") .. widgetOptionColor .. " ", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local groundshadowDensity = gl.GetSun("shadowDensity", "ground") + options[i].value = groundshadowDensity + end, + onchange = function(i, value) + Spring.SetSunLighting({ groundShadowDensity = value }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "UnitShadowDensity", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.UnitShadowDensity") .. widgetOptionColor .. " ", + type = "slider", + min = 0, + max = 1.5, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local groundshadowDensity = gl.GetSun("shadowDensity", "unit") + options[i].value = groundshadowDensity + end, + onchange = function(i, value) + Spring.SetSunLighting({ modelShadowDensity = value }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_groundambient_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_groundambient") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient") + Spring.SetSunLighting({ groundAmbientColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_groundambient_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient") + Spring.SetSunLighting({ groundAmbientColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_groundambient_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient") + Spring.SetSunLighting({ groundAmbientColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_grounddiffuse_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_grounddiffuse") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse") + Spring.SetSunLighting({ groundDiffuseColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_grounddiffuse_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse") + Spring.SetSunLighting({ groundDiffuseColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_grounddiffuse_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse") + Spring.SetSunLighting({ groundDiffuseColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_groundspecular_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_groundspecular") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular") + Spring.SetSunLighting({ groundSpecularColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_groundspecular_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular") + Spring.SetSunLighting({ groundSpecularColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_groundspecular_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular") + Spring.SetSunLighting({ groundSpecularColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_unitambient_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_unitambient") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient", "unit") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient", "unit") + Spring.SetSunLighting({ unitAmbientColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitambient_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient", "unit") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient", "unit") + Spring.SetSunLighting({ unitAmbientColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitambient_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("ambient", "unit") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("ambient", "unit") + Spring.SetSunLighting({ unitAmbientColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_unitdiffuse_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_unitdiffuse") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse", "unit") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse", "unit") + Spring.SetSunLighting({ unitDiffuseColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitdiffuse_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse", "unit") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse", "unit") + Spring.SetSunLighting({ unitDiffuseColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitdiffuse_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("diffuse", "unit") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("diffuse", "unit") + Spring.SetSunLighting({ unitDiffuseColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "color_unitspecular_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.color_unitspecular") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular", "unit") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular", "unit") + Spring.SetSunLighting({ unitSpecularColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitspecular_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular", "unit") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular", "unit") + Spring.SetSunLighting({ unitSpecularColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "color_unitspecular_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetSun("specular", "unit") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetSun("specular", "unit") + Spring.SetSunLighting({ unitSpecularColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "suncolor_r", + group = "dev", + category = types.dev, + name = "Sun" .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("sunColor") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("sunColor") + Spring.SetAtmosphere({ sunColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "suncolor_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("sunColor") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("sunColor") + Spring.SetAtmosphere({ sunColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "suncolor_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("sunColor") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("sunColor") + Spring.SetAtmosphere({ sunColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "skycolor_r", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.skycolor") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.red"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("skyColor") + options[i].value = r + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("skyColor") + Spring.SetAtmosphere({ skyColor = { value, g, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "skycolor_g", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.green"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("skyColor") + options[i].value = g + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("skyColor") + Spring.SetAtmosphere({ skyColor = { r, value, b } }) + Spring.SendCommands("luarules updatesun") + end, + }, + { + id = "skycolor_b", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.blue"), + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = 0, + description = "", + onload = function(i) + local r, g, b = gl.GetAtmosphere("skyColor") + options[i].value = b + end, + onchange = function(i, value) + local r, g, b = gl.GetAtmosphere("skyColor") + Spring.SetAtmosphere({ skyColor = { r, g, value } }) + Spring.SendCommands("luarules updatesun") + end, + }, + + { + id = "sunlighting_reset", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.sunlighting_reset"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.sunlighting_reset_descr"), + onload = function(i) end, + onchange = function(i, value) + options[getOptionByID("sunlighting_reset")].value = false + -- just so that map/model lighting gets updated + Spring.SetSunLighting(defaultSunLighting) + Spring.Echo("resetted ground/unit coloring") + init() + end, + }, + + { + id = "skyaxisangle_angle", + group = "dev", + category = types.dev, + name = Spring.I18N("ui.settings.option.skybox") .. widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.angle"), + type = "slider", + min = -3.14, + max = 3.14, + step = 0.01, + value = 0, + description = "", + onload = function(i) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + options[i].value = angle + end, + onchange = function(i, value) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + angle = value + Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) + end, + }, + { + id = "skyaxisangle_x", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " x", + type = "slider", + min = -1, + max = 1, + step = 0.01, + value = 0, + description = "", + onload = function(i) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + options[i].value = x + end, + onchange = function(i, value) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + x = value + Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) + end, + }, + { + id = "skyaxisangle_y", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " y", + type = "slider", + min = -1, + max = 1, + step = 0.01, + value = 0, + description = "", + onload = function(i) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + options[i].value = y + end, + onchange = function(i, value) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + y = value + Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) + end, + }, + { + id = "skyaxisangle_z", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " z", + type = "slider", + min = -1, + max = 1, + step = 0.01, + value = 0, + description = "", + onload = function(i) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + options[i].value = z + end, + onchange = function(i, value) + local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") + z = value + Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) + end, + }, + + { + id = "skyaxisangle_reset", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " " .. Spring.I18N("ui.settings.option.reset"), + type = "bool", + value = false, + description = Spring.I18N("ui.settings.option.sunlighting_reset_descr"), + onload = function(i) end, + onchange = function(i, value) + options[getOptionByID("skyaxisangle_reset")].value = false + Spring.SetAtmosphere({ skyAxisAngle = defaultSkyAxisAngle }) + Spring.Echo("resetted skyAxisAngle atmosphere") + init() + end, + }, + { id = "label_dev_water", group = "dev", name = Spring.I18N("ui.settings.option.label_water"), category = types.dev }, + { id = "label_dev_water_spacer", group = "dev", category = types.dev }, + + -- springsettings water params + { + id = "waterconfig_shorewaves", + group = "dev", + category = types.dev, + name = "Bumpwater settings " .. widgetOptionColor .. " shorewaves", + type = "bool", + value = Spring.GetConfigInt("BumpWaterShoreWaves", 1) == 1, + description = "", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ shoreWaves = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_dynamicwaves", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " dynamic waves", + type = "bool", + value = Spring.GetConfigInt("BumpWaterDynamicWaves", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterDynamicWaves", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_endless", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " endless", + type = "bool", + value = Spring.GetConfigInt("BumpWaterEndlessOcean", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterEndlessOcean", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_occlusionquery", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " occlusion query", + type = "bool", + value = Spring.GetConfigInt("BumpWaterOcclusionQuery", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterOcclusionQuery", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_blurreflection", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " blur reflection", + type = "bool", + value = Spring.GetConfigInt("BumpWaterBlurReflection", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterBlurReflection", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_anisotropy", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " anisotropy", + type = "bool", + value = Spring.GetConfigInt("BumpWaterAnisotropy", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterAnisotropy", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "wateconfigr_usedepthtexture", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " use depth texture", + type = "bool", + value = Spring.GetConfigInt("BumpWaterUseDepthTexture", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterUseDepthTexture", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + { + id = "waterconfig_useuniforms", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " use uniforms", + type = "bool", + value = Spring.GetConfigInt("BumpWaterUseUniforms", 1) == 1, + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetConfigInt("BumpWaterUseUniforms", (value and 1 or 0)) + Spring.SendCommands("water 4") + end, + }, + + -- GL water params + { + id = "water_shorewaves", + group = "dev", + category = types.dev, + name = "Bumpwater GL params" .. widgetOptionColor .. " shorewaves", + type = "bool", + value = gl.GetWaterRendering("shoreWaves"), + description = "Springsettings.cfg config, Probably requires a restart", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ shoreWaves = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_haswaterplane", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " has waterplane", + type = "bool", + value = gl.GetWaterRendering("hasWaterPlane"), + description = "The WaterPlane is a single Quad beneath the map.\nIt should have the same color as the ocean floor to hide the map -> background boundary. Specifying waterPlaneColor in mapinfo.lua will turn this on.", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ hasWaterPlane = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_forcerendering", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " force rendering", + type = "bool", + value = gl.GetWaterRendering("forceRendering"), + description = "Should the water be rendered even when minMapHeight>0.\nUse it to avoid the jumpin of the outside-map water rendering (BumpWater: endlessOcean option) when combat explosions reach groundwater.", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ forceRendering = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_repeatx", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " repeat X", + type = "slider", + min = 0, + max = 20, + step = 1, + value = gl.GetWaterRendering("repeatX"), + description = "water 0 texture repeat horizontal", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ repeatX = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_repeaty", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " repeat Y", + type = "slider", + min = 0, + max = 20, + step = 1, + value = gl.GetWaterRendering("repeatY"), + description = "water 0 texture repeat vertical", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ repeatY = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_surfacealpha", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " surface alpha", + type = "slider", + min = 0, + max = 1, + step = 0.001, + value = gl.GetWaterRendering("surfaceAlpha"), + description = "", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ surfaceAlpha = value }) + Spring.SendCommands("water 4") + end, + }, + -- gl.GetWaterRendering("windSpeed") seems to not exist + --{ id = "water_windspeed", group = "dev", category = types.dev, name = widgetOptionColor .. " windspeed", type = "slider", min = 0.0, max = 2.0, step = 0.01, value = gl.GetWaterRendering("windSpeed"), description = "The speed of bumpwater tiles moving", + -- onload = function(i) + -- end, + -- onchange = function(i, value) + -- Spring.SetWaterParams({ windSpeed = value }) + -- Spring.SendCommands("water 4") + -- end, + --}, + { + id = "water_ambientfactor", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " ambient factor", + type = "slider", + min = 0, + max = 2, + step = 0.001, + value = gl.GetWaterRendering("ambientFactor"), + description = "How much ambient lighting the water surface gets (ideally very little)", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ ambientFactor = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_diffusefactor", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " diffuse factor", + type = "slider", + min = 0, + max = 5, + step = 0.001, + value = gl.GetWaterRendering("diffuseFactor"), + description = "How strong the diffuse lighting should be on the water", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ diffuseFactor = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_specularfactor", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " specular factor", + type = "slider", + min = 0, + max = 5, + step = 0.01, + value = gl.GetWaterRendering("specularFactor"), + description = "How much light should be reflected straight from the sun", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ specularFactor = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_specularpower", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " specular power", + type = "slider", + min = 0, + max = 100, + step = 0.1, + value = gl.GetWaterRendering("specularPower"), + description = "How polished the surface of the water is", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ specularPower = value }) + Spring.SendCommands("water 4") + end, + }, + { + id = "water_perlinstartfreq", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " perlin start freq", + type = "slider", + min = 10, + max = 50, + step = 1, + value = gl.GetWaterRendering("perlinStartFreq"), + description = "The initial frequency of the bump map repetetion rate. Larger numbers mean more tiles", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ perlinStartFreq = value }) + Spring.SendCommands("water 4") end, + }, + { + id = "water_perlinlacunarity", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " perlin lacunarity", + type = "slider", + min = 0.1, + max = 4, + step = 0.01, + value = gl.GetWaterRendering("perlinLacunarity"), + description = "How much smaller each additional repetion of the normal map should be. Larger numbers mean smaller", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalProduced' }, value, { 'metalProduced', value }) + Spring.SetWaterParams({ perlinLacunarity = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_energyProduced", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyProduced_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyProduced')) or 1, description = Spring.I18N('ui.spectator_hud.energyProduced_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_energyProduced", { 'metricsEnabled', 'energyProduced' }) - end, + { + id = "water_perlinlamplitude", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " perlin amplitude", + type = "slider", + min = 0.1, + max = 4, + step = 0.01, + value = gl.GetWaterRendering("perlinAmplitude"), + description = "How strong each additional repetetion of the normal map should be", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyProduced' }, value, { 'energyProduced', value }) + Spring.SetWaterParams({ perlinAmplitude = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_metalExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.metalExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('metalExcess')) or 1, description = Spring.I18N('ui.spectator_hud.metalExcess_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_metalExcess", { 'metricsEnabled', 'metalExcess' }) - end, + { + id = "water_fresnelmin", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " fresnel min", + type = "slider", + min = 0, + max = 2, + step = 0.01, + value = gl.GetWaterRendering("fresnelMin"), + description = "Minimum reflection strength, e.g. the reflectivity of the water when looking straight down on it", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'metalExcess' }, value, { 'metalExcess', value }) + Spring.SetWaterParams({ fresnelMin = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_energyExcess", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.energyExcess_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('energyExcess')) or 1, description = Spring.I18N('ui.spectator_hud.energyExcess_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_energyExcess", { 'metricsEnabled', 'energyExcess' }) - end, + { + id = "water_fresnelmax", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " fresnel max", + type = "slider", + min = 0, + max = 2, + step = 0.01, + value = gl.GetWaterRendering("fresnelMax"), + description = "Maximum reflection strength, the reflectivity of the water when looking parallel to the water plane", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'energyExcess' }, value, { 'energyExcess', value }) + Spring.SetWaterParams({ fresnelMax = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_armyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.armyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('armyValue')) or 1, description = Spring.I18N('ui.spectator_hud.armyValue_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_armyValue", { 'metricsEnabled', 'armyValue' }) - end, + { + id = "water_fresnelpower", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " fresnel power", + type = "slider", + min = 0, + max = 16, + step = 0.1, + value = gl.GetWaterRendering("fresnelPower"), + description = "Determines how fast the reflection increases when going from straight down view to parallel.", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'armyValue' }, value, { 'armyValue', value }) + Spring.SetWaterParams({ fresnelPower = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_defenseValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.defenseValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('defenseValue')) or 1, description = Spring.I18N('ui.spectator_hud.defenseValue_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_defenseValue", { 'metricsEnabled', 'defenseValue' }) - end, + { + id = "water_numtiles", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " num tiles", + type = "slider", + min = 1.0, + max = 8, + step = 1.0, + value = gl.GetWaterRendering("numTiles"), + description = "How many (squared) Tiles does the `normalTexture` have?\nSuch Tiles are used when DynamicWaves are enabled in BumpWater, the more the better.\nCheck the example php script to generate such tiled bumpmaps.", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'defenseValue' }, value, { 'defenseValue', value }) + Spring.SetWaterParams({ numTiles = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_utilityValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.utilityValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('utilityValue')) or 1, description = Spring.I18N('ui.spectator_hud.utilityValue_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_utilityValue", { 'metricsEnabled', 'utilityValue' }) - end, + { + id = "water_blurbase", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " blur base", + type = "slider", + min = 0, + max = 3, + step = 0.01, + value = gl.GetWaterRendering("blurBase"), + description = "How much should the reflection be blurred", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'utilityValue' }, value, { 'utilityValue', value }) + Spring.SetWaterParams({ blurBase = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_economyValue", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.economyValue_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('economyValue')) or 1, description = Spring.I18N('ui.spectator_hud.economyValue_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_economyValue", { 'metricsEnabled', 'economyValue' }) - end, + { + id = "water_blurexponent", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " blur exponent", + type = "slider", + min = 0, + max = 3, + step = 0.01, + value = gl.GetWaterRendering("blurExponent"), + description = "How much should the reflection be blurred", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'economyValue' }, value, { 'economyValue', value }) + Spring.SetWaterParams({ blurExponent = value }) + Spring.SendCommands("water 4") end, }, - { id = "spectator_hud_metric_damageDealt", group = "ui", category = types.advanced, name = widgetOptionColor .. " " .. Spring.I18N('ui.spectator_hud.damageDealt_title'), type = "bool", value = (WG['spectator_hud'] ~= nil and WG['spectator_hud'].getMetricEnabled~= nil and WG['spectator_hud'].getMetricEnabled('damageDealt')) or 1, description = Spring.I18N('ui.spectator_hud.damageDealt_tooltip'), - onload = function(i) - loadWidgetData("Spectator HUD", "spectator_hud_metric_damageDealt", { 'metricsEnabled', 'damageDealt' }) - end, + { + id = "water_reflectiondistortion", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " reflection distortion", + type = "slider", + min = 0, + max = 5, + step = 0.01, + value = gl.GetWaterRendering("reflectionDistortion"), + description = "", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Spectator HUD', 'spectator_hud', 'setMetricEnabled', { 'metricsEnabled', 'damageDealt' }, value, { 'damageDealt', value }) + Spring.SetWaterParams({ reflectionDistortion = value }) + Spring.SendCommands("water 4") end, }, - - { id = "label_ui_developer", group = "ui", name = Spring.I18N('ui.settings.option.label_developer'), category = types.advanced }, - { id = "label_ui_developer_spacer", group = "ui", category = types.advanced }, - - { id = "devmode", group = "ui", category = types.advanced, name = Spring.I18N('ui.settings.option.devmode'), type = "bool", value = devUI, description = Spring.I18N('ui.settings.option.devmode_descr'), - onchange = function(i, value) - devUI = value - Spring.SetConfigInt("DevUI", value and 1 or 0) - Spring.SendCommands("luaui reload") - end, - }, - - -- GAME - { id = "networksmoothing", restart = true, category = types.basic, group = "game", name = Spring.I18N('ui.settings.option.networksmoothing'), type = "bool", value = useNetworkSmoothing, description = Spring.I18N('ui.settings.option.networksmoothing_descr'), - onload = function(i) - options[i].onchange(i, options[i].value) - end, - onchange = function(i, value) - useNetworkSmoothing = value - if useNetworkSmoothing then - Spring.SetConfigInt("UseNetMessageSmoothingBuffer", 1) - Spring.SetConfigInt("NetworkLossFactor", 0) - Spring.SetConfigInt("LinkOutgoingBandwidth", 196608) - Spring.SetConfigInt("LinkIncomingSustainedBandwidth", 196608) - Spring.SetConfigInt("LinkIncomingPeakBandwidth", 196608) - Spring.SetConfigInt("LinkIncomingMaxPacketRate", 1024) - else - Spring.SetConfigInt("UseNetMessageSmoothingBuffer", 0) - Spring.SetConfigInt("NetworkLossFactor", 2) - Spring.SetConfigInt("LinkOutgoingBandwidth", 196608) - Spring.SetConfigInt("LinkIncomingSustainedBandwidth", 1048576) - Spring.SetConfigInt("LinkIncomingPeakBandwidth", 1048576) - Spring.SetConfigInt("LinkIncomingMaxPacketRate", 2048) - end - end, - }, - { id = "autoquit", group = "game", category = types.basic, widget = "Autoquit", name = Spring.I18N('ui.settings.option.autoquit'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N('ui.settings.option.autoquit_descr') }, - - { id = "singleplayerpause", group = "game", category = types.advanced, name = Spring.I18N('ui.settings.option.singleplayerpause'), type = "bool", value = pauseGameWhenSingleplayer, description = Spring.I18N('ui.settings.option.singleplayerpause_descr'), - onchange = function(i, value) - pauseGameWhenSingleplayer = value - if (isSinglePlayer or isReplay) and show then - if pauseGameWhenSingleplayer then - Spring.SendCommands("pause " .. (pauseGameWhenSingleplayer and '1' or '0')) - pauseGameWhenSingleplayerExecuted = pauseGameWhenSingleplayer - elseif pauseGameWhenSingleplayerExecuted then - Spring.SendCommands("pause 0") - pauseGameWhenSingleplayerExecuted = false - end - end - end, - }, - - { id = "catchupsmoothness", group = "game", category = types.dev, name = Spring.I18N('ui.settings.option.catchupsmoothness'), restart = true, type = "slider", min = 0.05, max = 0.3, step = 0.01, value = Spring.GetConfigFloat("MinSimDrawBalance", 0.15), description = Spring.I18N('ui.settings.option.catchupsmoothness_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("MinSimDrawBalance", value) - end, - }, - { id = "catchupminfps", group = "game", category = types.dev, name = Spring.I18N('ui.settings.option.catchupminfps'), restart = true, type = "slider", min = 2, max = 15, step = 1, value = Spring.GetConfigInt("MinDrawFPS", 2), description = Spring.I18N('ui.settings.option.catchupminfps_descr'), - onchange = function(i, value) - Spring.SetConfigInt("MinDrawFPS", value) - end, - }, - - { id = "label_ui_behavior", group = "game", name = Spring.I18N('ui.settings.option.label_behavior'), category = types.basic }, - { id = "label_ui_behavior_spacer", group = "game", category = types.basic }, - - - { id = "smartselect_includebuildings", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.smartselect_includebuildings'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includebuildings_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuildings', { 'selectBuildingsWithMobile' }, value) - end, - }, - { id = "smartselect_includebuilders", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includebuilders'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includebuilders_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuilders', { 'includeBuilders' }, value) - end, - }, - { id = "smartselect_includeresurrectors", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includeresurrectors'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includeresurrectors_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeResurrectors', { 'includeResurrectors' }, value) - end, - }, - { id = "smartselect_includeantinuke", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includeantinuke'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includeantinuke_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeAntinuke', { 'includeAntinuke' }, value) - end, - }, - { id = "smartselect_includeradar", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includeradar'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includeradar_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeRadar', { 'includeRadar' }, value) - end, - }, - { id = "smartselect_includejammer", group = "game", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.smartselect_includejammer'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.smartselect_includejammer_descr'), - onload = function(i) - end, - onchange = function(i, value) - saveOptionValue('SmartSelect', 'smartselect', 'setIncludeJammer', { 'includeJammer' }, value) - end, - }, - - { id = "prioconturrets", group = "game", category = types.basic, widget = "Priority Construction Turrets", name = Spring.I18N('ui.settings.option.prioconturrets'), type = "bool", value = GetWidgetToggleValue("Priority Construction Turrets"), description = Spring.I18N('ui.settings.option.prioconturrets_descr') }, - + -- new water 4 params since engine 105BAR 582 { - id = "builderpriority", - group = "game", - category = types.basic, - widget = "Builder Priority", - name = Spring.I18N('ui.settings.option.builderpriority'), - type = "bool", - value = GetWidgetToggleValue("Builder Priority"), - description = Spring.I18N('ui.settings.option.builderpriority_descr'), + id = "water_waveoffsetfactor", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " waveoffsetfactor", + type = "slider", + min = 0.0, + max = 2.0, + step = 0.01, + value = gl.GetWaterRendering("waveOffsetFactor"), + description = "Set this to 0.1 to make waves break shores not all at the same time", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ waveOffsetFactor = value }) + Spring.SendCommands("water 4") + end, }, - { - id = "builderpriority_nanos", - group = "game", - category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_nanos'), - type = "bool", - value = ( - WG['builderpriority'] ~= nil - and WG['builderpriority'].getLowPriorityNanos ~= nil - and WG['builderpriority'].getLowPriorityNanos() - ), - description = Spring.I18N('ui.settings.option.builderpriority_nanos_descr'), - onload = function(i) - loadWidgetData("Builder Priority", "builderpriority_nanos", { 'lowpriorityNanos' }) - end, + id = "water_wavelength", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " waveLength", + type = "slider", + min = 0.0, + max = 1.0, + step = 0.01, + value = gl.GetWaterRendering("waveLength"), + description = "How long the waves are", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Builder Priority', 'builderpriority', 'setLowPriorityNanos', { 'lowpriorityNanos' }, value) + Spring.SetWaterParams({ waveLength = value }) + Spring.SendCommands("water 4") end, }, - { - id = "builderpriority_cons", - group = "game", - category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_cons'), - type = "bool", - value = ( - WG['builderpriority'] ~= nil - and WG['builderpriority'].getLowPriorityCons ~= nil - and WG['builderpriority'].getLowPriorityCons() - ), - description = Spring.I18N('ui.settings.option.builderpriority_cons_descr'), - onload = function(i) - loadWidgetData("Builder Priority", "builderpriority_cons", { 'lowpriorityCons' }) - end, + id = "water_wavefoamdistortion", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " waveFoamDistortion", + type = "slider", + min = 0.0, + max = 0.5, + step = 0.01, + value = gl.GetWaterRendering("waveFoamDistortion"), + description = "How much the waters movement distorts the foam texture", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Builder Priority', 'builderpriority', 'setLowPriorityCons', { 'lowpriorityCons' }, value) + Spring.SetWaterParams({ waveFoamDistortion = value }) + Spring.SendCommands("water 4") end, }, - { - id = "builderpriority_labs", - group = "game", - category = types.advanced, - name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.builderpriority_labs'), - type = "bool", - value = ( - WG['builderpriority'] ~= nil - and WG['builderpriority'].getLowPriorityLabs ~= nil - and WG['builderpriority'].getLowPriorityLabs() - ), - description = Spring.I18N('ui.settings.option.builderpriority_labs_descr'), - onload = function(i) - loadWidgetData("Builder Priority", "builderpriority_labs", { 'lowpriorityLabs' }) - end, + id = "water_wavefoamintensity", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " waveFoamIntensity", + type = "slider", + min = 0.0, + max = 2.0, + step = 0.01, + value = gl.GetWaterRendering("waveFoamIntensity"), + description = "How strong the foam texture is", + onload = function(i) end, onchange = function(i, value) - saveOptionValue('Builder Priority', 'builderpriority', 'setLowPriorityLabs', { 'lowpriorityLabs' }, value) + Spring.SetWaterParams({ waveFoamIntensity = value }) + Spring.SendCommands("water 4") end, }, - - { id = "factoryguard", group = "game", category = types.basic, widget = "Factory Guard Default On", name = Spring.I18N('ui.settings.option.factory') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryguard'), type = "bool", value = GetWidgetToggleValue("Factory Guard Default On"), description = Spring.I18N('ui.settings.option.factoryguard_descr') }, - { id = "factoryholdpos", group = "game", category = types.basic, widget = "Factory hold position", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryholdpos'), type = "bool", value = GetWidgetToggleValue("Factory hold position"), description = Spring.I18N('ui.settings.option.factoryholdpos_descr') }, - { id = "factoryrepeat", group = "game", category = types.basic, widget = "Factory Auto-Repeat", name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.factoryrepeat'), type = "bool", value = GetWidgetToggleValue("Factory Auto-Repeat"), description = Spring.I18N('ui.settings.option.factoryrepeat_descr') }, - - { id = "transportOrderedUnits", - group = "game", - category = types.basic, - name = "Ferry ignores units with manual orders", - type = "bool", - value = (WG['transportFactoryGuard'] ~= nil and WG['transportFactoryGuard'].getBlacklistOrderedUnits ~= nil and WG['transportFactoryGuard'].getBlacklistOrderedUnits()), - description = "If enabled, transports guarding factories will not transport units that were given explicit orders during construction to their move waypoint.", - onload = function(i) - loadWidgetData("Transport Factory Guard", "blacklistOrderedUnits", { 'blacklistOrderedUnits' }) - end, - onchange = function(_, value) - if widgetHandler.configData["transportFactoryGuard"] == nil then - widgetHandler.configData["transportFactoryGuard"] = {} - end - widgetHandler.configData["Auto Group"].immediate = value - saveOptionValue('Transport Factory Guard', 'transportFactoryGuard', 'setBlacklistOrderedUnits', { 'blacklistOrderedUnits' }, value) - if WG['transportFactoryGuard'] and WG['transportFactoryGuard'].setBlacklistOrderedUnits then - WG['transportFactoryGuard'].setBlacklistOrderedUnits(value) - end + { + id = "water_causticsresolution", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " causticsResolution", + type = "slider", + min = 10.0, + max = 300.0, + step = 1.0, + value = gl.GetWaterRendering("causticsResolution"), + description = "The tiling rate of the caustics texture", + onload = function(i) end, + onchange = function(i, value) + Spring.SetWaterParams({ causticsResolution = value }) + Spring.SendCommands("water 4") end, }, - - { id = "onlyfighterspatrol", group = "game", category = types.basic, widget = "OnlyFightersPatrol", name = Spring.I18N('ui.settings.option.onlyfighterspatrol'), type = "bool", value = GetWidgetToggleValue("Autoquit"), description = Spring.I18N('ui.settings.option.onlyfighterspatrol_descr') }, - { id = "bombers_default_hold_fire", group = "game", category = types.basic, widget = "BombersDefaultHoldFire", name = Spring.I18N('ui.settings.option.bombers_default_hold_fire'), type = "bool", value = GetWidgetToggleValue("BombersDefaultHoldFire"), description = Spring.I18N('ui.settings.option.bombers_default_hold_fire_descr') }, - { id = "fightersfly", group = "game", category = types.basic, widget = "Set fighters on Fly mode", name = Spring.I18N('ui.settings.option.fightersfly'), type = "bool", value = GetWidgetToggleValue("Set fighters on Fly mode"), description = Spring.I18N('ui.settings.option.fightersfly_descr') }, - - { id = "settargetdefault", group = "game", category = types.basic, widget = "Set target default", name = Spring.I18N('ui.settings.option.settargetdefault'), type = "bool", value = GetWidgetToggleValue("Set target default"), description = Spring.I18N('ui.settings.option.settargetdefault_descr') }, - { id = "dgunnogroundenemies", group = "game", category = types.advanced, widget = "DGun no ground enemies", name = Spring.I18N('ui.settings.option.dgunnogroundenemies'), type = "bool", value = GetWidgetToggleValue("DGun no ground enemies"), description = Spring.I18N('ui.settings.option.dgunnogroundenemies_descr') }, - { id = "dgunstallassist", group = "game", category = types.advanced, widget = "DGun Stall Assist", name = Spring.I18N('ui.settings.option.dgunstallassist'), type = "bool", value = GetWidgetToggleValue("DGun Stall Assist"), description = Spring.I18N('ui.settings.option.dgunstallassist_descr') }, - - { id = "unitreclaimer", group = "game", category = types.basic, widget = "Specific Unit Reclaimer", name = Spring.I18N('ui.settings.option.unitreclaimer'), type = "bool", value = GetWidgetToggleValue("Specific Unit Reclaimer"), description = Spring.I18N('ui.settings.option.unitreclaimer_descr') }, - - { id = "autogroup_immediate", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.autogroup_immediate'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getImmediate ~= nil and WG['autogroup'].getImmediate()), description = Spring.I18N('ui.settings.option.autogroup_immediate_descr'), - onload = function(i) - loadWidgetData("Auto Group", "autogroup_immediate", { 'immediate' }) - end, - onchange = function(i, value) - if widgetHandler.configData["Auto Group"] == nil then - widgetHandler.configData["Auto Group"] = {} - end - widgetHandler.configData["Auto Group"].immediate = value - saveOptionValue('Auto Group', 'autogroup', 'setImmediate', { 'immediate' }, value) - end, - }, - - { id = "autogroup_persist", group = "game", category = types.basic, name = Spring.I18N('ui.settings.option.autogroup_persist'), type = "bool", value = (WG['autogroup'] ~= nil and WG['autogroup'].getPersist ~= nil and WG['autogroup'].getPersist()), description = Spring.I18N('ui.settings.option.autogroup_persist_descr'), - onload = function(i) - loadWidgetData("Auto Group", "autogroup_persist", { 'persist' }) - end, - onchange = function(i, value) - if widgetHandler.configData["Auto Group"] == nil then - widgetHandler.configData["Auto Group"] = {} - end - widgetHandler.configData["Auto Group"].persist = value - saveOptionValue('Auto Group', 'autogroup', 'setPersist', { 'persist' }, value) - end, - }, - - { id = "label_ui_cloak", group = "game", name = Spring.I18N('ui.settings.option.label_cloak'), category = types.basic }, - { id = "label_ui_cloak_spacer", group = "game", category = types.basic }, - - { id = "autocloak", group = "game", category = types.basic, widget = "Auto Cloak Units", name = Spring.I18N('ui.settings.option.autocloak'), type = "bool", value = GetWidgetToggleValue("Auto Cloak Units") }, - - -- ACCESSIBILITY - - { id = "label_teamcolors", group = "accessibility", name = Spring.I18N('ui.settings.option.label_teamcolors'), category = types.basic }, - { id = "label_teamcolors_spacer", group = "accessibility", category = types.basic }, - - { id = "anonymous_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorR", 255)), description = Spring.I18N('ui.settings.option.anonymous_descr'), - onchange = function(i, value, force) - if force then - Spring.SetConfigInt("anonymousColorR", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('anonymous_r') } - end - end, - }, - - { id = "anonymous_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorG", 0)), description = Spring.I18N('ui.settings.option.anonymous_descr'), - onchange = function(i, value, force) - if force then - Spring.SetConfigInt("anonymousColorG", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('anonymous_g') } - end - end, - }, - - { id = "anonymous_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.anonymous_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("anonymousColorB", 0)), description = Spring.I18N('ui.settings.option.anonymous_descr'), - onchange = function(i, value, force) - if force then - Spring.SetConfigInt("anonymousColorB", value) - Spring.SendCommands("luarules reloadluaui") - else - sceduleOptionApply = { os.clock() + 1.5, getOptionByID('anonymous_b') } - end - end, - }, - - { id = "simpleteamcolors", group = "accessibility", category = types.basic, name = Spring.I18N('ui.settings.option.playercolors'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.simpleteamcolors_descr'), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColors", (value and 1 or 0)) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - - { id = "simpleteamcolors_reset", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_reset'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColors_Reset", 0) or 0) == 1, - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsUseGradient", 0) - Spring.SetConfigInt("SimpleTeamColorsPlayerR", 0) - Spring.SetConfigInt("SimpleTeamColorsPlayerG", 77) - Spring.SetConfigInt("SimpleTeamColorsPlayerB", 255) - Spring.SetConfigInt("SimpleTeamColorsAllyR", 0) - Spring.SetConfigInt("SimpleTeamColorsAllyG", 255) - Spring.SetConfigInt("SimpleTeamColorsAllyB", 0) - Spring.SetConfigInt("SimpleTeamColorsEnemyR", 255) - Spring.SetConfigInt("SimpleTeamColorsEnemyG", 16) - Spring.SetConfigInt("SimpleTeamColorsEnemyB", 5) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_use_gradient", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_use_gradient'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsUseGradient", 0) or 0) == 1, - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsUseGradient", (value and 1 or 0)) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolorsfactionspecific", group = "accessibility", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolorsfactionspecific'), type = "bool", value = tonumber(Spring.GetConfigInt("SimpleTeamColorsFactionSpecific", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.simpleteamcolorsfactionspecific_descr'), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsFactionSpecific", (value and 1 or 0)) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_player_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerR", 0)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsPlayerR", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_player_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerG", 77)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsPlayerG", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_player_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_player_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsPlayerB", 255)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsPlayerB", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - - { id = "simpleteamcolors_ally_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyR", 0)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsAllyR", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_ally_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyG", 255)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsAllyG", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_ally_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_ally_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsAllyB", 0)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsAllyB", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - - { id = "simpleteamcolors_enemy_r", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_r'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyR", 255)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsEnemyR", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_enemy_g", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_g'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyG", 16)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsEnemyG", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - { id = "simpleteamcolors_enemy_b", group = "accessibility", category = types.basic, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.simpleteamcolors_enemy_b'), type = "slider", min = 0, max = 255, step = 1, value = tonumber(Spring.GetConfigInt("SimpleTeamColorsEnemyB", 5)), - onchange = function(i, value) - Spring.SetConfigInt("SimpleTeamColorsEnemyB", value) - Spring.SetConfigInt("UpdateTeamColors", 1) - end, - }, - - -- DEV - { id = "customwidgets", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.customwidgets'), type = "bool", value = widgetHandler.allowUserWidgets, description = Spring.I18N('ui.settings.option.customwidgets_descr'), - onchange = function(i, value) - widgetHandler.__allowUserWidgets = value - Spring.SendCommands("luarules reloadluaui") - end, - }, - - { id = "autocheat", group = "dev", category = types.dev, widget = "Dev Auto cheat", name = Spring.I18N('ui.settings.option.autocheat'), type = "bool", value = GetWidgetToggleValue("Dev Auto cheat"), description = Spring.I18N('ui.settings.option.autocheat_descr') }, - { id = "restart", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.restart'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.restart_descr'), - onchange = function(i, value) - options[getOptionByID('restart')].value = false - Spring.Restart("", startScript) - end, - }, - { id = "restart_with_state", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.restart_with_state'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.restart_with_state_descr'), - onchange = function(i, value) - options[getOptionByID('restart_with_state')].value = false - Spring.SendLuaRulesMsg("restart_with_state") - end, - }, - - { id = "label_dev_debug", group = "dev", name = Spring.I18N('ui.settings.option.label_debug'), category = types.dev }, - { id = "label_dev_debug_spacer", group = "dev", category = types.dev }, - - { id = "profiler_widget", group = "dev", category = types.dev, widget = "Widget Profiler", name = Spring.I18N('ui.settings.option.profiler') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_widget'), type = "bool", value = GetWidgetToggleValue("Widget Profiler") }, - { id = "profiler_gadget", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_gadget'), type = "bool", value = false, - onchange = function(i, value) - Spring.SendCommands("luarules profile") - end, - }, - { id = "profiler_sort_by_load", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_sort_by_load'), type = "bool", value = Spring.GetConfigInt("profiler_sort_by_load", 1), description = Spring.I18N('ui.settings.option.profiler_sort_by_load_descr'), - onchange = function(i, value) - Spring.SetConfigInt("profiler_sort_by_load", (value and '1' or '0')) - end, - }, - { id = "profiler_averagetime", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.profiler_averagetime'), type = "slider", min = 0.1, max = 10, step = 0.1, value = Spring.GetConfigFloat("profiler_averagetime", 2), description = Spring.I18N('ui.settings.option.profiler_averagetime_descr'), - onchange = function(i, value) - Spring.SetConfigFloat("profiler_averagetime", value) - end, - }, - { id = "framegrapher", group = "dev", category = types.dev, widget = "Frame Grapher", name = Spring.I18N('ui.settings.option.framegrapher'), type = "bool", value = GetWidgetToggleValue("Frame Grapher"), description = "" }, - - { id = "debugcolvol", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.debugcolvol'), type = "bool", value = false, description = "", - onchange = function(i, value) - Spring.SendCommands("DebugColVol " .. (value and '1' or '0')) - end, - }, - { id = "echocamerastate", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.echocamerastate'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.echocamerastate_descr'), - onchange = function(i, value) - options[getOptionByID('echocamerastate')].value = false - Spring.Echo(Spring.GetCameraState()) - end, - }, - - - { id = "label_dev_other", group = "dev", name = Spring.I18N('ui.settings.option.label_other'), category = types.dev }, - { id = "label_dev_other_spacer", group = "dev", category = types.dev }, - - { id = "storedefaultsettings", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.storedefaultsettings'), type = "bool", value = tonumber(Spring.GetConfigInt("StoreDefaultSettings", 0) or 0) == 1, description = Spring.I18N('ui.settings.option.storedefaultsettings_descr'), - onchange = function(i, value) - Spring.SetConfigInt("StoreDefaultSettings", (value and 1 or 0)) - end, - }, - - { id = "startboxeditor", group = "dev", category = types.dev, widget = "Startbox Editor", name = Spring.I18N('ui.settings.option.startboxeditor'), type = "bool", value = GetWidgetToggleValue("Startbox Editor"), description = Spring.I18N('ui.settings.option.startboxeditor_descr') }, - - { id = "language_dev", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.language'), type = "select", options = devLanguageNames, value = devLanguageCodes[Spring.I18N.getLocale()], + { + id = "water_causticsstrength", + group = "dev", + category = types.dev, + name = widgetOptionColor .. " causticsStrength", + type = "slider", + min = 0.0, + max = 0.5, + step = 0.01, + value = gl.GetWaterRendering("causticsStrength"), + description = "How intense the caustics effects are", + onload = function(i) end, onchange = function(i, value) - local devLanguage = devLanguageCodes[value] - WG['language'].setLanguage(devLanguage) - end - }, - { id = "font", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.font'), type = "select", options = {}, value = 1, description = Spring.I18N('ui.settings.option.font_descr'), - onload = function(i) - end, - onchange = function(i, value) - if VFS.FileExists('fonts/' .. options[i].optionsFont[value]) then - Spring.SetConfigString("bar_font", options[i].optionsFont[value]) - Spring.SendCommands("luarules reloadluaui") - end - end, - }, - { id = "font2", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.font2'), type = "select", options = {}, value = 1, description = Spring.I18N('ui.settings.option.font2_descr'), - onload = function(i) - end, - onchange = function(i, value) - if VFS.FileExists('fonts/' .. options[i].optionsFont[value]) then - Spring.SetConfigString("bar_font2", options[i].optionsFont[value]) - Spring.SendCommands("luarules reloadluaui") - end - end, - }, - - --{ id = "label_dev_unit", group = "dev", name = Spring.I18N('ui.settings.option.label_unit'), category = types.dev }, - --{ id = "label_dev_unit_spacer", group = "dev", category = types.dev }, - -- - --{ id = "tonemapA", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.tonemap') .. widgetOptionColor .. " 1", type = "slider", min = 0, max = 7, step = 0.01, value = Spring.GetConfigFloat("tonemapA", 4.8), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapA", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "tonemapB", group = "dev", category = types.dev, name = widgetOptionColor .. " 2", type = "slider", min = 0, max = 2, step = 0.01, value = Spring.GetConfigFloat("tonemapB", 0.75), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapB", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "tonemapC", group = "dev", category = types.dev, name = widgetOptionColor .. " 3", type = "slider", min = 0, max = 5, step = 0.01, value = Spring.GetConfigFloat("tonemapC", 3.5), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapC", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "tonemapD", group = "dev", category = types.dev, name = widgetOptionColor .. " 4", type = "slider", min = 0, max = 3, step = 0.01, value = Spring.GetConfigFloat("tonemapD", 0.85), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapD", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "tonemapE", group = "dev", category = types.dev, name = widgetOptionColor .. " 5", type = "slider", min = 0.75, max = 1.5, step = 0.01, value = Spring.GetConfigFloat("tonemapE", 1.0), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapE", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "envAmbient", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.envAmbient'), type = "slider", min = 0, max = 1, step = 0.01, value = Spring.GetConfigFloat("envAmbient", 0.25), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("envAmbient", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "unitSunMult", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unitSunMult'), type = "slider", min = 0.7, max = 1.6, step = 0.01, value = Spring.GetConfigFloat("unitSunMult", 1.0), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("unitSunMult", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "unitExposureMult", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.unitExposureMult'), type = "slider", min = 0.6, max = 1.25, step = 0.01, value = Spring.GetConfigFloat("unitExposureMult", 1.0), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("unitExposureMult", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "modelGamma", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.modelGamma'), type = "slider", min = 0.7, max = 1.7, step = 0.01, value = Spring.GetConfigFloat("modelGamma", 1.0), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("modelGamma", value) - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- end, - --}, - --{ id = "tonemapDefaults", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.tonemapDefaults'), type = "bool", value = GetWidgetToggleValue("Unit Reclaimer"), description = "", - -- onchange = function(i, value) - -- Spring.SetConfigFloat("tonemapA", 4.75) - -- Spring.SetConfigFloat("tonemapB", 0.75) - -- Spring.SetConfigFloat("tonemapC", 3.5) - -- Spring.SetConfigFloat("tonemapD", 0.85) - -- Spring.SetConfigFloat("tonemapE", 1.0) - -- Spring.SetConfigFloat("envAmbient", 0.25) - -- Spring.SetConfigFloat("unitSunMult", 1.0) - -- Spring.SetConfigFloat("unitExposureMult", 1.0) - -- Spring.SetConfigFloat("modelGamma", 1.0) - -- options[getOptionByID('tonemapA')].value = Spring.GetConfigFloat("tonemapA") - -- options[getOptionByID('tonemapB')].value = Spring.GetConfigFloat("tonemapB") - -- options[getOptionByID('tonemapC')].value = Spring.GetConfigFloat("tonemapC") - -- options[getOptionByID('tonemapD')].value = Spring.GetConfigFloat("tonemapD") - -- options[getOptionByID('tonemapE')].value = Spring.GetConfigFloat("tonemapE") - -- options[getOptionByID('envAmbient')].value = Spring.GetConfigFloat("envAmbient") - -- options[getOptionByID('unitSunMult')].value = Spring.GetConfigFloat("unitSunMult") - -- options[getOptionByID('unitExposureMult')].value = Spring.GetConfigFloat("unitExposureMult") - -- options[getOptionByID('modelGamma')].value = Spring.GetConfigFloat("modelGamma") - -- Spring.SendCommands("luarules updatesun") - -- Spring.SendCommands("luarules GlassUpdateSun") - -- options[getOptionByID('tonemapDefaults')].value = false - -- end, - --}, - - { id = "label_dev_map", group = "dev", name = Spring.I18N('ui.settings.option.label_map'), category = types.dev }, - { id = "label_dev_map_spacer", group = "dev", category = types.dev }, - - { id = "sun_y", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.sun') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_y'), type = "slider", min = 0.05, max = 0.9999, step = 0.0001, value = select(2, gl.GetSun("pos")), - onchange = function(i, value) - local sunX, sunY, sunZ = gl.GetSun("pos") - sunY = value - if sunY < options[getOptionByID('sun_y')].min then - sunY = options[getOptionByID('sun_y')].min - end - if sunY > options[getOptionByID('sun_y')].max then - sunY = options[getOptionByID('sun_y')].max - end - options[getOptionByID('sun_y')].value = sunY - Spring.SetSunDirection(sunX, sunY, sunZ) - -- just so that map/model lighting gets updated - Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) - Spring.Echo(gl.GetSun()) - end, - }, - { id = "sun_x", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_x'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(1, gl.GetSun("pos")), - onchange = function(i, value) - local sunX, sunY, sunZ = gl.GetSun("pos") - sunX = value - if sunX < options[getOptionByID('sun_x')].min then - sunX = options[getOptionByID('sun_x')].min - end - if sunX > options[getOptionByID('sun_x')].max then - sunX = options[getOptionByID('sun_x')].max - end - options[getOptionByID('sun_x')].value = sunX - Spring.SetSunDirection(sunX, sunY, sunZ) - -- just so that map/model lighting gets updated - Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) - Spring.Echo(gl.GetSun()) - end, - }, - { id = "sun_z", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_z'), type = "slider", min = -0.9999, max = 0.9999, step = 0.0001, value = select(3, gl.GetSun("pos")), - onload = function(i) - end, - onchange = function(i, value) - local sunX, sunY, sunZ = gl.GetSun("pos") - sunZ = value - if sunZ < options[getOptionByID('sun_z')].min then - sunZ = options[getOptionByID('sun_z')].min - end - if sunZ > options[getOptionByID('sun_z')].max then - sunZ = options[getOptionByID('sun_z')].max - end - options[getOptionByID('sun_z')].value = sunZ - Spring.SetSunDirection(sunX, sunY, sunZ) - -- just so that map/model lighting gets updated - Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) - Spring.Echo(gl.GetSun()) - end, - }, - { id = "sun_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.sun_reset'), type = "bool", value = false, - onload = function(i) - end, - onchange = function(i, value) - options[getOptionByID('sun_x')].value = defaultMapSunPos[1] - options[getOptionByID('sun_y')].value = defaultMapSunPos[2] - options[getOptionByID('sun_z')].value = defaultMapSunPos[3] - options[getOptionByID('sun_reset')].value = false - Spring.SetSunDirection(defaultMapSunPos[1], defaultMapSunPos[2], defaultMapSunPos[3]) - -- just so that map/model lighting gets updated - Spring.SetSunLighting({ groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity") }) - Spring.Echo(gl.GetSun()) - end, - }, - - { id = "fog_start", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_start'), type = "slider", min = 0, max = 1.99, step = 0.01, value = gl.GetAtmosphere("fogStart"), - onload = function(i) - end, - onchange = function(i, value) - if getOptionByID('fog_end') and value >= options[getOptionByID('fog_end')].value then - applyOptionValue(getOptionByID('fog_end'), value + 0.01) - end - Spring.SetAtmosphere({ fogStart = value }) - end, - }, - { id = "fog_end", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_end'), type = "slider", min = 0.5, max = 2, step = 0.01, value = gl.GetAtmosphere("fogEnd"), - onload = function(i) - end, - onchange = function(i, value) - if getOptionByID('fog_start') and value <= options[getOptionByID('fog_start')].value then - applyOptionValue(getOptionByID('fog_start'), value - 0.01) - end - Spring.SetAtmosphere({ fogEnd = value }) - end, - }, - { id = "fog_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_reset'), type = "bool", value = false, description = '', - onload = function(i) - end, - onchange = function(i, value) - if getOptionByID('fog_start') then - options[getOptionByID('fog_start')].value = defaultMapFog.fogStart - options[getOptionByID('fog_end')].value = defaultMapFog.fogEnd - options[getOptionByID('fog_reset')].value = false - end - Spring.SetAtmosphere({ fogStart = defaultMapFog.fogStart, fogEnd = defaultMapFog.fogEnd }) - end, - }, - - { id = "fog_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.fog') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.01, value = select(1, gl.GetAtmosphere("fogColor")), description = '', - onload = function(i) - end, - onchange = function(i, value) - local fogColor = { gl.GetAtmosphere("fogColor") } - Spring.SetAtmosphere({ fogColor = { value, fogColor[2], fogColor[3], fogColor[4] } }) - end, - }, - { id = "fog_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.01, value = select(2, gl.GetAtmosphere("fogColor")), description = '', - onload = function(i) - end, - onchange = function(i, value) - local fogColor = { gl.GetAtmosphere("fogColor") } - Spring.SetAtmosphere({ fogColor = { fogColor[1], value, fogColor[3], fogColor[4] } }) - end, - }, - { id = "fog_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.01, value = select(3, gl.GetAtmosphere("fogColor")), description = '', - onload = function(i) - end, - onchange = function(i, value) - local fogColor = { gl.GetAtmosphere("fogColor") } - Spring.SetAtmosphere({ fogColor = { fogColor[1], fogColor[2], value, fogColor[4] } }) - end, - }, - { id = "fog_color_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.fog_color_reset'), type = "bool", value = false, description = '', - onload = function(i) - end, - onchange = function(i, value) - options[getOptionByID('fog_r')].value = defaultMapFog.fogColor[1] - options[getOptionByID('fog_g')].value = defaultMapFog.fogColor[2] - options[getOptionByID('fog_b')].value = defaultMapFog.fogColor[3] - options[getOptionByID('fog_color_reset')].value = false - Spring.SetAtmosphere({ fogColor = defaultMapFog.fogColor }) - Spring.Echo('resetted map fog color defaults') - end, - }, - - { id = "map_voidwater", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_voidwater'), type = "bool", value = false, description = "", - onload = function(i) - options[i].value = gl.GetMapRendering("voidWater") - end, - onchange = function(i, value) - Spring.SetMapRenderingParams({ voidWater = value }) - end, - }, - { id = "map_voidground", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_voidground'), type = "bool", value = false, description = "", - onload = function(i) - options[i].value = gl.GetMapRendering("voidGround") - end, - onchange = function(i, value) - Spring.SetMapRenderingParams({ voidGround = value }) - end, - }, - - { id = "map_splatdetailnormaldiffusealpha", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splatdetailnormaldiffusealpha'), type = "bool", value = false, description = "", - onload = function(i) - options[i].value = gl.GetMapRendering("splatDetailNormalDiffuseAlpha") - end, - onchange = function(i, value) - Spring.SetMapRenderingParams({ splatDetailNormalDiffuseAlpha = value }) - end, - }, - - { id = "map_splattexmults_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splattexmults') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - Spring.SetMapRenderingParams({ splatTexMults = { value, g, b, a } }) - end, - }, - { id = "map_splattexmults_g", group = "dev", category = types.dev, name = widgetOptionColor .. " 1", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - Spring.SetMapRenderingParams({ splatTexMults = { r, value, b, a } }) - end, - }, - { id = "map_splattexmults_b", group = "dev", category = types.dev, name = widgetOptionColor .. " 2", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - Spring.SetMapRenderingParams({ splatTexMults = { r, g, value, a } }) - end, - }, - { id = "map_splattexmults_a", group = "dev", category = types.dev, name = widgetOptionColor .. " 3", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - options[i].value = a - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexMults") - Spring.SetMapRenderingParams({ splatTexMults = { r, g, b, value } }) - end, - }, - - { id = "map_splattexacales_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.map_splattexacales') .. widgetOptionColor .. " 0", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - Spring.SetMapRenderingParams({ splatTexScales = { value, g, b, a } }) - end, - }, - { id = "map_splattexacales_g", group = "dev", category = types.dev, name = widgetOptionColor .. " 1", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - Spring.SetMapRenderingParams({ splatTexScales = { r, value, b, a } }) - end, - }, - { id = "map_splattexacales_b", group = "dev", category = types.dev, name = widgetOptionColor .. " 2", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - Spring.SetMapRenderingParams({ splatTexScales = { r, g, value, a } }) - end, - }, - { id = "map_splattexacales_a", group = "dev", category = types.dev, name = widgetOptionColor .. " 3", type = "slider", min = 0, max = 0.02, step = 0.0001, value = 0, description = "", - onload = function(i) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - options[i].value = a - end, - onchange = function(i, value) - local r, g, b, a = gl.GetMapRendering("splatTexScales") - Spring.SetMapRenderingParams({ splatTexScales = { r, g, b, value } }) - end, - }, - - { id = "GroundShadowDensity", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.GroundShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local groundshadowDensity = gl.GetSun("shadowDensity", "ground") - options[i].value = groundshadowDensity - end, - onchange = function(i, value) - Spring.SetSunLighting({ groundShadowDensity = value }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "UnitShadowDensity", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.UnitShadowDensity') .. widgetOptionColor .. " ", type = "slider", min = 0, max = 1.5, step = 0.001, value = 0, description = "", - onload = function(i) - local groundshadowDensity = gl.GetSun("shadowDensity", "unit") - options[i].value = groundshadowDensity - end, - onchange = function(i, value) - Spring.SetSunLighting({ modelShadowDensity = value }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "color_groundambient_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_groundambient') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient") - Spring.SetSunLighting({ groundAmbientColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_groundambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient") - Spring.SetSunLighting({ groundAmbientColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_groundambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient") - Spring.SetSunLighting({ groundAmbientColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "color_grounddiffuse_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_grounddiffuse') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse") - Spring.SetSunLighting({ groundDiffuseColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_grounddiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse") - Spring.SetSunLighting({ groundDiffuseColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_grounddiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse") - Spring.SetSunLighting({ groundDiffuseColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "color_groundspecular_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_groundspecular') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular") - Spring.SetSunLighting({ groundSpecularColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_groundspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular") - Spring.SetSunLighting({ groundSpecularColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_groundspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular") - Spring.SetSunLighting({ groundSpecularColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - - { id = "color_unitambient_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitambient') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient", "unit") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient", "unit") - Spring.SetSunLighting({ unitAmbientColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitambient_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient", "unit") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient", "unit") - Spring.SetSunLighting({ unitAmbientColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitambient_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("ambient", "unit") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("ambient", "unit") - Spring.SetSunLighting({ unitAmbientColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "color_unitdiffuse_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitdiffuse') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse", "unit") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse", "unit") - Spring.SetSunLighting({ unitDiffuseColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitdiffuse_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse", "unit") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse", "unit") - Spring.SetSunLighting({ unitDiffuseColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitdiffuse_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("diffuse", "unit") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("diffuse", "unit") - Spring.SetSunLighting({ unitDiffuseColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "color_unitspecular_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.color_unitspecular') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular", "unit") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular", "unit") - Spring.SetSunLighting({ unitSpecularColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitspecular_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular", "unit") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular", "unit") - Spring.SetSunLighting({ unitSpecularColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "color_unitspecular_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 2, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetSun("specular", "unit") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetSun("specular", "unit") - Spring.SetSunLighting({ unitSpecularColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "suncolor_r", group = "dev", category = types.dev, name = "Sun" .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("sunColor") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("sunColor") - Spring.SetAtmosphere({ sunColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "suncolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("sunColor") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("sunColor") - Spring.SetAtmosphere({ sunColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "suncolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("sunColor") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("sunColor") - Spring.SetAtmosphere({ sunColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "skycolor_r", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.skycolor') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.red'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("skyColor") - options[i].value = r - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("skyColor") - Spring.SetAtmosphere({ skyColor = { value, g, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "skycolor_g", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.green'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("skyColor") - options[i].value = g - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("skyColor") - Spring.SetAtmosphere({ skyColor = { r, value, b } }) - Spring.SendCommands("luarules updatesun") - end, - }, - { id = "skycolor_b", group = "dev", category = types.dev, name = widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.blue'), type = "slider", min = 0, max = 1, step = 0.001, value = 0, description = "", - onload = function(i) - local r, g, b = gl.GetAtmosphere("skyColor") - options[i].value = b - end, - onchange = function(i, value) - local r, g, b = gl.GetAtmosphere("skyColor") - Spring.SetAtmosphere({ skyColor = { r, g, value } }) - Spring.SendCommands("luarules updatesun") - end, - }, - - { id = "sunlighting_reset", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.sunlighting_reset'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.sunlighting_reset_descr'), - onload = function(i) - end, - onchange = function(i, value) - options[getOptionByID('sunlighting_reset')].value = false - -- just so that map/model lighting gets updated - Spring.SetSunLighting(defaultSunLighting) - Spring.Echo('resetted ground/unit coloring') - init() - end, - }, - - { id = "skyaxisangle_angle", group = "dev", category = types.dev, name = Spring.I18N('ui.settings.option.skybox') .. widgetOptionColor .. " "..Spring.I18N('ui.settings.option.angle'), type = "slider", min = -3.14, max = 3.14, step = 0.01, value = 0, description = "", - onload = function(i) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - options[i].value = angle - end, - onchange = function(i, value) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - angle = value - Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) - end, - }, - { id = "skyaxisangle_x", group = "dev", category = types.dev, name = widgetOptionColor .. " x", type = "slider", min = -1, max = 1, step = 0.01, value = 0, description = "", - onload = function(i) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - options[i].value = x - end, - onchange = function(i, value) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - x = value - Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) - end, - }, - { id = "skyaxisangle_y", group = "dev", category = types.dev, name = widgetOptionColor .. " y", type = "slider", min = -1, max = 1, step = 0.01, value = 0, description = "", - onload = function(i) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - options[i].value = y - end, - onchange = function(i, value) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - y = value - Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) - end, - }, - { id = "skyaxisangle_z", group = "dev", category = types.dev, name = widgetOptionColor .. " z", type = "slider", min = -1, max = 1, step = 0.01, value = 0, description = "", - onload = function(i) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - options[i].value = z - end, - onchange = function(i, value) - local x, y, z, angle = gl.GetAtmosphere("skyAxisAngle") - z = value - Spring.SetAtmosphere({ skyAxisAngle = { x, y, z, angle } }) - end, - }, - - { id = "skyaxisangle_reset", group = "dev", category = types.dev, name = widgetOptionColor .. " "..Spring.I18N('ui.settings.option.reset'), type = "bool", value = false, description = Spring.I18N('ui.settings.option.sunlighting_reset_descr'), - onload = function(i) - end, - onchange = function(i, value) - options[getOptionByID('skyaxisangle_reset')].value = false - Spring.SetAtmosphere({ skyAxisAngle = defaultSkyAxisAngle }) - Spring.Echo('resetted skyAxisAngle atmosphere') - init() - end, - }, - { id = "label_dev_water", group = "dev", name = Spring.I18N('ui.settings.option.label_water'), category = types.dev }, - { id = "label_dev_water_spacer", group = "dev", category = types.dev }, - - -- springsettings water params - { id = "waterconfig_shorewaves", group = "dev", category = types.dev, name = "Bumpwater settings " .. widgetOptionColor .. " shorewaves", type = "bool", value = Spring.GetConfigInt("BumpWaterShoreWaves", 1) == 1, description = "", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ shoreWaves = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_dynamicwaves", group = "dev", category = types.dev, name = widgetOptionColor .. " dynamic waves", type = "bool", value = Spring.GetConfigInt("BumpWaterDynamicWaves", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterDynamicWaves", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_endless", group = "dev", category = types.dev, name = widgetOptionColor .. " endless", type = "bool", value = Spring.GetConfigInt("BumpWaterEndlessOcean", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterEndlessOcean", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_occlusionquery", group = "dev", category = types.dev, name = widgetOptionColor .. " occlusion query", type = "bool", value = Spring.GetConfigInt("BumpWaterOcclusionQuery", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterOcclusionQuery", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_blurreflection", group = "dev", category = types.dev, name = widgetOptionColor .. " blur reflection", type = "bool", value = Spring.GetConfigInt("BumpWaterBlurReflection", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterBlurReflection", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_anisotropy", group = "dev", category = types.dev, name = widgetOptionColor .. " anisotropy", type = "bool", value = Spring.GetConfigInt("BumpWaterAnisotropy", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterAnisotropy", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "wateconfigr_usedepthtexture", group = "dev", category = types.dev, name = widgetOptionColor .. " use depth texture", type = "bool", value = Spring.GetConfigInt("BumpWaterUseDepthTexture", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterUseDepthTexture", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - { id = "waterconfig_useuniforms", group = "dev", category = types.dev, name = widgetOptionColor .. " use uniforms", type = "bool", value = Spring.GetConfigInt("BumpWaterUseUniforms", 1) == 1, description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetConfigInt("BumpWaterUseUniforms", (value and 1 or 0)) - Spring.SendCommands("water 4") - end, - }, - - -- GL water params - { id = "water_shorewaves", group = "dev", category = types.dev, name = "Bumpwater GL params" .. widgetOptionColor .. " shorewaves", type = "bool", value = gl.GetWaterRendering("shoreWaves"), description = "Springsettings.cfg config, Probably requires a restart", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ shoreWaves = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_haswaterplane", group = "dev", category = types.dev, name = widgetOptionColor .. " has waterplane", type = "bool", value = gl.GetWaterRendering("hasWaterPlane"), description = "The WaterPlane is a single Quad beneath the map.\nIt should have the same color as the ocean floor to hide the map -> background boundary. Specifying waterPlaneColor in mapinfo.lua will turn this on.", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ hasWaterPlane = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_forcerendering", group = "dev", category = types.dev, name = widgetOptionColor .. " force rendering", type = "bool", value = gl.GetWaterRendering("forceRendering"), description = "Should the water be rendered even when minMapHeight>0.\nUse it to avoid the jumpin of the outside-map water rendering (BumpWater: endlessOcean option) when combat explosions reach groundwater.", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ forceRendering = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_repeatx", group = "dev", category = types.dev, name = widgetOptionColor .. " repeat X", type = "slider", min = 0, max = 20, step = 1, value = gl.GetWaterRendering("repeatX"), description = "water 0 texture repeat horizontal", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ repeatX = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_repeaty", group = "dev", category = types.dev, name = widgetOptionColor .. " repeat Y", type = "slider", min = 0, max = 20, step = 1, value = gl.GetWaterRendering("repeatY"), description = "water 0 texture repeat vertical", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ repeatY = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_surfacealpha", group = "dev", category = types.dev, name = widgetOptionColor .. " surface alpha", type = "slider", min = 0, max = 1, step = 0.001, value = gl.GetWaterRendering("surfaceAlpha"), description = "", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ surfaceAlpha = value }) - Spring.SendCommands("water 4") - end, - }, - -- gl.GetWaterRendering("windSpeed") seems to not exist - --{ id = "water_windspeed", group = "dev", category = types.dev, name = widgetOptionColor .. " windspeed", type = "slider", min = 0.0, max = 2.0, step = 0.01, value = gl.GetWaterRendering("windSpeed"), description = "The speed of bumpwater tiles moving", - -- onload = function(i) - -- end, - -- onchange = function(i, value) - -- Spring.SetWaterParams({ windSpeed = value }) - -- Spring.SendCommands("water 4") - -- end, - --}, - { id = "water_ambientfactor", group = "dev", category = types.dev, name = widgetOptionColor .. " ambient factor", type = "slider", min = 0, max = 2, step = 0.001, value = gl.GetWaterRendering("ambientFactor"), description = "How much ambient lighting the water surface gets (ideally very little)", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ ambientFactor = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_diffusefactor", group = "dev", category = types.dev, name = widgetOptionColor .. " diffuse factor", type = "slider", min = 0, max = 5, step = 0.001, value = gl.GetWaterRendering("diffuseFactor"), description = "How strong the diffuse lighting should be on the water", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ diffuseFactor = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_specularfactor", group = "dev", category = types.dev, name = widgetOptionColor .. " specular factor", type = "slider", min = 0, max = 5, step = 0.01, value = gl.GetWaterRendering("specularFactor"), description = "How much light should be reflected straight from the sun", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ specularFactor = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_specularpower", group = "dev", category = types.dev, name = widgetOptionColor .. " specular power", type = "slider", min = 0, max = 100, step = 0.1, value = gl.GetWaterRendering("specularPower"), description = "How polished the surface of the water is", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ specularPower = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_perlinstartfreq", group = "dev", category = types.dev, name = widgetOptionColor .. " perlin start freq", type = "slider", min = 10, max = 50, step = 1, value = gl.GetWaterRendering("perlinStartFreq"), description = "The initial frequency of the bump map repetetion rate. Larger numbers mean more tiles", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ perlinStartFreq = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_perlinlacunarity", group = "dev", category = types.dev, name = widgetOptionColor .. " perlin lacunarity", type = "slider", min = 0.1, max = 4, step = 0.01, value = gl.GetWaterRendering("perlinLacunarity"), description = "How much smaller each additional repetion of the normal map should be. Larger numbers mean smaller", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ perlinLacunarity = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_perlinlamplitude", group = "dev", category = types.dev, name = widgetOptionColor .. " perlin amplitude", type = "slider", min = 0.1, max = 4, step = 0.01, value = gl.GetWaterRendering("perlinAmplitude"), description = "How strong each additional repetetion of the normal map should be", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ perlinAmplitude = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_fresnelmin", group = "dev", category = types.dev, name = widgetOptionColor .. " fresnel min", type = "slider", min = 0, max = 2, step = 0.01, value = gl.GetWaterRendering("fresnelMin"), description = "Minimum reflection strength, e.g. the reflectivity of the water when looking straight down on it", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ fresnelMin = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_fresnelmax", group = "dev", category = types.dev, name = widgetOptionColor .. " fresnel max", type = "slider", min = 0, max = 2, step = 0.01, value = gl.GetWaterRendering("fresnelMax"), description = "Maximum reflection strength, the reflectivity of the water when looking parallel to the water plane", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ fresnelMax = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_fresnelpower", group = "dev", category = types.dev, name = widgetOptionColor .. " fresnel power", type = "slider", min = 0, max = 16, step = 0.1, value = gl.GetWaterRendering("fresnelPower"), description = "Determines how fast the reflection increases when going from straight down view to parallel.", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ fresnelPower = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_numtiles", group = "dev", category = types.dev, name = widgetOptionColor .. " num tiles", type = "slider", min = 1.0, max = 8, step = 1.0, value = gl.GetWaterRendering("numTiles"), description = "How many (squared) Tiles does the `normalTexture` have?\nSuch Tiles are used when DynamicWaves are enabled in BumpWater, the more the better.\nCheck the example php script to generate such tiled bumpmaps.", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ numTiles = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_blurbase", group = "dev", category = types.dev, name = widgetOptionColor .. " blur base", type = "slider", min = 0, max = 3, step = 0.01, value = gl.GetWaterRendering("blurBase"), description = "How much should the reflection be blurred", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ blurBase = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_blurexponent", group = "dev", category = types.dev, name = widgetOptionColor .. " blur exponent", type = "slider", min = 0, max = 3, step = 0.01, value = gl.GetWaterRendering("blurExponent"), description = "How much should the reflection be blurred", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ blurExponent = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_reflectiondistortion", group = "dev", category = types.dev, name = widgetOptionColor .. " reflection distortion", type = "slider", min = 0, max = 5, step = 0.01, value = gl.GetWaterRendering("reflectionDistortion"), description = "", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ reflectionDistortion = value }) - Spring.SendCommands("water 4") - end, - }, - -- new water 4 params since engine 105BAR 582 - { id = "water_waveoffsetfactor", group = "dev", category = types.dev, name = widgetOptionColor .. " waveoffsetfactor", type = "slider", min = 0.0, max = 2.0, step = 0.01, value = gl.GetWaterRendering("waveOffsetFactor"), description = "Set this to 0.1 to make waves break shores not all at the same time", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ waveOffsetFactor = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_wavelength", group = "dev", category = types.dev, name = widgetOptionColor .. " waveLength", type = "slider", min = 0.0, max = 1.0, step = 0.01, value = gl.GetWaterRendering("waveLength"), description = "How long the waves are", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ waveLength = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_wavefoamdistortion", group = "dev", category = types.dev, name = widgetOptionColor .. " waveFoamDistortion", type = "slider", min = 0.0, max = 0.5, step = 0.01, value = gl.GetWaterRendering("waveFoamDistortion"), description = "How much the waters movement distorts the foam texture", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ waveFoamDistortion = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_wavefoamintensity", group = "dev", category = types.dev, name = widgetOptionColor .. " waveFoamIntensity", type = "slider", min = 0.0, max = 2.0, step = 0.01, value = gl.GetWaterRendering("waveFoamIntensity"), description = "How strong the foam texture is", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ waveFoamIntensity = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_causticsresolution", group = "dev", category = types.dev, name = widgetOptionColor .. " causticsResolution", type = "slider", min = 10.0, max = 300.0, step = 1.0, value = gl.GetWaterRendering("causticsResolution"), description = "The tiling rate of the caustics texture", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ causticsResolution = value }) - Spring.SendCommands("water 4") - end, - }, - { id = "water_causticsstrength", group = "dev", category = types.dev, name = widgetOptionColor .. " causticsStrength", type = "slider", min = 0.0, max = 0.5, step = 0.01, value = gl.GetWaterRendering("causticsStrength"), description = "How intense the caustics effects are", - onload = function(i) - end, - onchange = function(i, value) - Spring.SetWaterParams({ causticsStrength = value }) - Spring.SendCommands("water 4") - end, + Spring.SetWaterParams({ causticsStrength = value }) + Spring.SendCommands("water 4") + end, }, -- TODO add SetWaterParams: --absorb = {number r, number g, number b}, @@ -6531,14 +9505,14 @@ function init() } if not isPotatoGpu and not devMode and not devUI then - options[getOptionByID('advmapshading')] = nil + options[getOptionByID("advmapshading")] = nil Spring.SetConfigInt("AdvMapShading", 1) Spring.SendCommands("advmapshading 1") end -- reset tonemap defaults (only once) if not resettedTonemapDefault then - local optionID = getOptionByID('tonemapDefaults') + local optionID = getOptionByID("tonemapDefaults") if optionID then applyOptionValue(optionID, true) resettedTonemapDefault = true @@ -6553,77 +9527,77 @@ function init() end if devMode then - options[getOptionByID('devmode')] = nil - options[getOptionByID('label_ui_developer')] = nil - options[getOptionByID('label_ui_developer_spacer')] = nil + options[getOptionByID("devmode")] = nil + options[getOptionByID("label_ui_developer")] = nil + options[getOptionByID("label_ui_developer_spacer")] = nil end if devMode or devUI or localWidgetCount == 0 then - options[getOptionByID('widgetselector')] = nil - end - - if not GetWidgetToggleValue('Grid menu') then - options[getOptionByID('gridmenu_alwaysreturn')] = nil - options[getOptionByID('gridmenu_autoselectfirst')] = nil - options[getOptionByID('gridmenu_labbuildmode')] = nil - options[getOptionByID('gridmenu_ctrlclickmodifier')] = nil - options[getOptionByID('gridmenu_shiftclickmodifier')] = nil - options[getOptionByID('gridmenu_ctrlkeymodifier')] = nil - options[getOptionByID('gridmenu_shiftkeymodifier')] = nil - end - - if spectatorHUDConfigOptions[options[getOptionByID('spectator_hud_config')].value] ~= Spring.I18N('ui.settings.option.spectator_hud_config_custom') then - options[getOptionByID('spectator_hud_metric_metalIncome')] = nil - options[getOptionByID('spectator_hud_metric_energyIncome')] = nil - options[getOptionByID('spectator_hud_metric_buildPower')] = nil - options[getOptionByID('spectator_hud_metric_metalProduced')] = nil - options[getOptionByID('spectator_hud_metric_energyProduced')] = nil - options[getOptionByID('spectator_hud_metric_metalExcess')] = nil - options[getOptionByID('spectator_hud_metric_energyExcess')] = nil - options[getOptionByID('spectator_hud_metric_armyValue')] = nil - options[getOptionByID('spectator_hud_metric_defenseValue')] = nil - options[getOptionByID('spectator_hud_metric_utilityValue')] = nil - options[getOptionByID('spectator_hud_metric_economyValue')] = nil - options[getOptionByID('spectator_hud_metric_damageDealt')] = nil + options[getOptionByID("widgetselector")] = nil + end + + if not GetWidgetToggleValue("Grid menu") then + options[getOptionByID("gridmenu_alwaysreturn")] = nil + options[getOptionByID("gridmenu_autoselectfirst")] = nil + options[getOptionByID("gridmenu_labbuildmode")] = nil + options[getOptionByID("gridmenu_ctrlclickmodifier")] = nil + options[getOptionByID("gridmenu_shiftclickmodifier")] = nil + options[getOptionByID("gridmenu_ctrlkeymodifier")] = nil + options[getOptionByID("gridmenu_shiftkeymodifier")] = nil + end + + if spectatorHUDConfigOptions[options[getOptionByID("spectator_hud_config")].value] ~= Spring.I18N("ui.settings.option.spectator_hud_config_custom") then + options[getOptionByID("spectator_hud_metric_metalIncome")] = nil + options[getOptionByID("spectator_hud_metric_energyIncome")] = nil + options[getOptionByID("spectator_hud_metric_buildPower")] = nil + options[getOptionByID("spectator_hud_metric_metalProduced")] = nil + options[getOptionByID("spectator_hud_metric_energyProduced")] = nil + options[getOptionByID("spectator_hud_metric_metalExcess")] = nil + options[getOptionByID("spectator_hud_metric_energyExcess")] = nil + options[getOptionByID("spectator_hud_metric_armyValue")] = nil + options[getOptionByID("spectator_hud_metric_defenseValue")] = nil + options[getOptionByID("spectator_hud_metric_utilityValue")] = nil + options[getOptionByID("spectator_hud_metric_economyValue")] = nil + options[getOptionByID("spectator_hud_metric_damageDealt")] = nil end if not Spring.Utilities.Gametype.GetCurrentHolidays()["aprilfools"] then - options[getOptionByID('soundtrackAprilFools')] = nil + options[getOptionByID("soundtrackAprilFools")] = nil Spring.SetConfigInt("UseSoundtrackAprilFools", 1) else - options[getOptionByID('soundtrackAprilFoolsPostEvent')] = nil + options[getOptionByID("soundtrackAprilFoolsPostEvent")] = nil end if not Spring.Utilities.Gametype.GetCurrentHolidays()["halloween"] then - options[getOptionByID('soundtrackHalloween')] = nil + options[getOptionByID("soundtrackHalloween")] = nil Spring.SetConfigInt("UseSoundtrackHalloween", 1) else - options[getOptionByID('soundtrackHalloweenPostEvent')] = nil + options[getOptionByID("soundtrackHalloweenPostEvent")] = nil end if not Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then - options[getOptionByID('soundtrackXmas')] = nil + options[getOptionByID("soundtrackXmas")] = nil Spring.SetConfigInt("UseSoundtrackXmas", 1) else - options[getOptionByID('soundtrackXmasPostEvent')] = nil + options[getOptionByID("soundtrackXmasPostEvent")] = nil end -- hide English unit names toggle if using English - if Spring.I18N.getLocale() == 'en' then - options[getOptionByID('language_english_unit_names')] = nil + if Spring.I18N.getLocale() == "en" then + options[getOptionByID("language_english_unit_names")] = nil end -- add fonts - if getOptionByID('font') then + if getOptionByID("font") then local fonts = {} local fontsFull = {} local fontsn = {} - local files = VFS.DirList('fonts', '*') + local files = VFS.DirList("fonts", "*") fontOption = {} for k, file in ipairs(files) do local name = string.sub(file, 7) local ext = string.sub(name, string.len(name) - 2) - if ext == 'otf' or ext == 'ttf' or ext == 'ttc' then + if ext == "otf" or ext == "ttf" or ext == "ttc" then name = string.sub(name, 1, string.len(name) - 4) if not fontsn[name:lower()] then fonts[#fonts + 1] = name @@ -6635,37 +9609,37 @@ function init() end end - options[getOptionByID('font')].options = fonts - options[getOptionByID('font')].optionsFont = fontsFull + options[getOptionByID("font")].options = fonts + options[getOptionByID("font")].optionsFont = fontsFull local fname = Spring.GetConfigString("bar_font", "Poppins-Regular.otf"):lower() - options[getOptionByID('font')].value = getSelectKey(getOptionByID('font'), string.sub(fname, 1, string.len(fname) - 4)) + options[getOptionByID("font")].value = getSelectKey(getOptionByID("font"), string.sub(fname, 1, string.len(fname) - 4)) - options[getOptionByID('font2')].options = fonts - options[getOptionByID('font2')].optionsFont = fontsFull + options[getOptionByID("font2")].options = fonts + options[getOptionByID("font2")].optionsFont = fontsFull local fname = Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf"):lower() - options[getOptionByID('font2')].value = getSelectKey(getOptionByID('font2'), string.sub(fname, 1, string.len(fname) - 4)) + options[getOptionByID("font2")].value = getSelectKey(getOptionByID("font2"), string.sub(fname, 1, string.len(fname) - 4)) end -- check if cus is disabled by auto disable cus widget (in case options widget has been reloaded) - if getOptionByID('sun_y') then + if getOptionByID("sun_y") then local sunX, sunY, sunZ = gl.GetSun("pos") - if sunY < options[getOptionByID('sun_y')].min then - Spring.SetSunDirection(sunX, options[getOptionByID('sun_y')].min, sunZ) + if sunY < options[getOptionByID("sun_y")].min then + Spring.SetSunDirection(sunX, options[getOptionByID("sun_y")].min, sunZ) end end -- set minimal shadow opacity - if getOptionByID('shadows_opacity') then - if gl.GetSun("shadowDensity") < options[getOptionByID('shadows_opacity')].min then - Spring.SetSunLighting({ groundShadowDensity = options[getOptionByID('shadows_opacity')].min, modelShadowDensity = options[getOptionByID('shadows_opacity')].min }) + if getOptionByID("shadows_opacity") then + if gl.GetSun("shadowDensity") < options[getOptionByID("shadows_opacity")].min then + Spring.SetSunLighting({ groundShadowDensity = options[getOptionByID("shadows_opacity")].min, modelShadowDensity = options[getOptionByID("shadows_opacity")].min }) end end -- remove anonymous color sliders if anonymousMode == "disabled" then - options[getOptionByID('anonymous_r')] = nil - options[getOptionByID('anonymous_g')] = nil - options[getOptionByID('anonymous_b')] = nil + options[getOptionByID("anonymous_r")] = nil + options[getOptionByID("anonymous_g")] = nil + options[getOptionByID("anonymous_b")] = nil end if Spring.GetGameFrame() == 0 then @@ -6679,15 +9653,15 @@ function init() end if #displayNames <= 1 then - options[getOptionByID('display')] = nil - options[getOptionByID('resolution')].name = Spring.I18N('ui.settings.option.resolution') + options[getOptionByID("display")] = nil + options[getOptionByID("resolution")].name = Spring.I18N("ui.settings.option.resolution") end -- only allow dualscreen-mode on single displays when super ultrawide screen or Multi Display option shows if (#displayNames <= 1 and vsx / vsy < 2.5) or (#displayNames > 1 and #displayNames == Spring.GetNumDisplays()) then - options[getOptionByID('dualmode_enabled')] = nil - options[getOptionByID('dualmode_left')] = nil - options[getOptionByID('dualmode_minimap_aspectratio')] = nil + options[getOptionByID("dualmode_enabled")] = nil + options[getOptionByID("dualmode_left")] = nil + options[getOptionByID("dualmode_minimap_aspectratio")] = nil end -- reduce options for potatoes (skip in dev mode to keep all options available) @@ -6700,38 +9674,37 @@ function init() --end -- disable engine decals (footprints) - options[getOptionByID('decals')] = nil + options[getOptionByID("decals")] = nil if Spring.GetConfigInt("GroundDecals", 3) > 0 then Spring.SendCommands("GroundDecals 0") Spring.SetConfigInt("GroundDecals", 0) end if isPotatoGpu then - -- limit available msaa levels to 'off' and 'x2' - if options[getOptionByID('msaa')] then - for k, v in pairs(options[getOptionByID('msaa')].options) do + if options[getOptionByID("msaa")] then + for k, v in pairs(options[getOptionByID("msaa")].options) do if k >= 3 then - options[getOptionByID('msaa')].options[k] = nil + options[getOptionByID("msaa")].options[k] = nil end end end - id = getOptionByID('ssao') + id = getOptionByID("ssao") if id and GetWidgetToggleValue(options[id].widget) then widgetHandler:DisableWidget(options[id].widget) end options[id] = nil - options[getOptionByID('ssao_strength')] = nil - options[getOptionByID('ssao_quality')] = nil + options[getOptionByID("ssao_strength")] = nil + options[getOptionByID("ssao_quality")] = nil - id = getOptionByID('bloom') + id = getOptionByID("bloom") if id and GetWidgetToggleValue(options[id].widget) then widgetHandler:DisableWidget(options[id].widget) end options[id] = nil - options[getOptionByID('bloom_brightness')] = nil - options[getOptionByID('bloom_quality')] = nil + options[getOptionByID("bloom_brightness")] = nil + options[getOptionByID("bloom_quality")] = nil -- id = getOptionByID('dof') -- if id and GetWidgetToggleValue(options[id].widget) then @@ -6741,22 +9714,21 @@ function init() -- options[getOptionByID('dof_autofocus')] = nil -- options[getOptionByID('dof_fstop')] = nil - id = getOptionByID('clouds') + id = getOptionByID("clouds") if id and GetWidgetToggleValue(options[id].widget) then widgetHandler:DisableWidget(options[id].widget) end options[id] = nil - options[getOptionByID('clouds_opacity')] = nil + options[getOptionByID("clouds_opacity")] = nil -- set lowest quality shadows for Intel GPU (they eat fps but dont show) --if Platform ~= nil and Platform.gpuVendor == 'Intel' and gpuMem < 2500 then -- Spring.SendCommands("advmapshading 0") --end end - elseif gpuMem >= 3000 then if Spring.GetConfigInt("cus2", 1) ~= 1 then - local id = getOptionByID('cusgl4') + local id = getOptionByID("cusgl4") options[id].onchange(id, 1) end @@ -6768,8 +9740,8 @@ function init() --end if not devMode and not devUI then - options[getOptionByID('cusgl4')] = nil - options[getOptionByID('water')] = nil + options[getOptionByID("cusgl4")] = nil + options[getOptionByID("water")] = nil else if Spring.GetConfigInt("Water", 0) ~= 4 then Spring.SendCommands("water 4") @@ -6779,7 +9751,7 @@ function init() end if not isPotatoGpu and not devMode and not devUI then - options[getOptionByID('cusgl4')] = nil + options[getOptionByID("cusgl4")] = nil end -- loads values via stored game config in luaui/configs @@ -6811,30 +9783,29 @@ function init() end end if not aiDetected then - options[getOptionByID('commandsfxfilterai')] = nil + options[getOptionByID("commandsfxfilterai")] = nil end -- remove sound device selector if there is only 1 device if not soundDevices[2] then - options[getOptionByID('snddevice')] = nil + options[getOptionByID("snddevice")] = nil end -- add music tracks options local trackList - if WG['music'] ~= nil then - trackList = WG['music'].getTracksConfig() + if WG["music"] ~= nil then + trackList = WG["music"].getTracksConfig() end - if type(trackList) == 'table' then - + if type(trackList) == "table" then local newOptions = {} local count = 0 - local prevCategory = '' + local prevCategory = "" for i, option in pairs(options) do count = count + 1 newOptions[count] = option - if option.id == 'soundtrackFades' then + if option.id == "soundtrackFades" then count = count + 1 - newOptions[count] = { id = "label_sound_music", group = "sound", name = Spring.I18N('ui.settings.option.label_playlist'), category = types.basic } + newOptions[count] = { id = "label_sound_music", group = "sound", name = Spring.I18N("ui.settings.option.label_playlist"), category = types.basic } count = count + 1 newOptions[count] = { id = "label_sound_music_spacer", group = "sound", category = types.basic } @@ -6842,15 +9813,20 @@ function init() if prevCategory ~= v[1] then prevCategory = v[1] count = count + 1 - newOptions[count] = { id="music_track_"..v[2], group="sound", basic=true, name=v[1], type="text"} + newOptions[count] = { id = "music_track_" .. v[2], group = "sound", basic = true, name = v[1], type = "text" } end count = count + 1 - newOptions[count] = { id="music_track_"..count, group="sound", basic=true, name=widgetOptionColor.." "..v[2], type="click",--..'\n'..v[4], - onclick = function() - if WG['music'] ~= nil and WG['music'].playTrack then - WG['music'].playTrack(v[3]) - end - end, + newOptions[count] = { + id = "music_track_" .. count, + group = "sound", + basic = true, + name = widgetOptionColor .. " " .. v[2], + type = "click", --..'\n'..v[4], + onclick = function() + if WG["music"] ~= nil and WG["music"].playTrack then + WG["music"].playTrack(v[3]) + end + end, } end end @@ -6859,23 +9835,26 @@ function init() end -- add sound notification sets - if getOptionByID('notifications_set') then - local voiceset = Spring.GetConfigString("voiceset", 'en/cephis') + if getOptionByID("notifications_set") then + local voiceset = Spring.GetConfigString("voiceset", "en/cephis") local currentVoiceSetOption local sets = {} - local languageDirs = VFS.SubDirs('sounds/voice', '*') + local languageDirs = VFS.SubDirs("sounds/voice", "*") local setCount = 0 for k, f in ipairs(languageDirs) do - local langDir = string.gsub(string.sub(f, 14, string.len(f)-1), "\\", "/") - local files = VFS.SubDirs('sounds/voice/'..langDir, '*') + local langDir = string.gsub(string.sub(f, 14, string.len(f) - 1), "\\", "/") + local files = VFS.SubDirs("sounds/voice/" .. langDir, "*") for k, file in ipairs(files) do - local dirname = string.gsub(string.sub(file, 14, string.len(file)-1), "\\", "/") + local dirname = string.gsub(string.sub(file, 14, string.len(file) - 1), "\\", "/") local setAlreadyIn = false - for i = 1,#sets do - if dirname == sets[i] then setAlreadyIn = true break end + for i = 1, #sets do + if dirname == sets[i] then + setAlreadyIn = true + break + end end if not setAlreadyIn then - sets[#sets+1] = dirname + sets[#sets + 1] = dirname setCount = setCount + 1 if dirname == voiceset then currentVoiceSetOption = #sets @@ -6884,45 +9863,53 @@ function init() end end if setCount == 0 then - options[getOptionByID('notifications_set')] = nil - options[getOptionByID('notifications_spoken')] = nil - options[getOptionByID('notifications_volume')] = nil + options[getOptionByID("notifications_set")] = nil + options[getOptionByID("notifications_spoken")] = nil + options[getOptionByID("notifications_volume")] = nil else - options[getOptionByID('notifications_set')].options = sets + options[getOptionByID("notifications_set")].options = sets if currentVoiceSetOption then - options[getOptionByID('notifications_set')].value = currentVoiceSetOption + options[getOptionByID("notifications_set")].value = currentVoiceSetOption end end end -- add sound notification widget sound toggle options local notificationList - if WG['notifications'] ~= nil then - notificationList = WG['notifications'].getNotificationList() + if WG["notifications"] ~= nil then + notificationList = WG["notifications"].getNotificationList() elseif widgetHandler.configData["Notifications"] ~= nil and widgetHandler.configData["Notifications"].notificationList ~= nil then notificationList = widgetHandler.configData["Notifications"].notificationList end - if type(notificationList) == 'table' then + if type(notificationList) == "table" then local newOptions = {} local count = 0 for i, option in pairs(options) do count = count + 1 newOptions[count] = option - if option.id == 'label_notif_messages_spacer' then + if option.id == "label_notif_messages_spacer" then for k, v in pairs(notificationList) do - if type(v) == 'table' then + if type(v) == "table" then count = count + 1 local color = widgetOptionColor - if v[4] and v[4] == 0 then color ='\255\100\100\100' end - newOptions[count] = { id = "notifications_notif_" .. v[1], group = "notif", category = types.basic, name = color .. " " .. Spring.I18N(v[3]), type = "bool", value = v[2], --description = v[3] and Spring.I18N(v[3]) or "", - onchange = function(i, value) - saveOptionValue('Notifications', 'notifications', 'setNotification' .. v[1], { 'notificationList' }, value) - end, - onclick = function() - if WG['notifications'] ~= nil and WG['notifications'].playNotification then - WG['notifications'].playNotification(v[1]) - end - end, + if v[4] and v[4] == 0 then + color = "\255\100\100\100" + end + newOptions[count] = { + id = "notifications_notif_" .. v[1], + group = "notif", + category = types.basic, + name = color .. " " .. Spring.I18N(v[3]), + type = "bool", + value = v[2], --description = v[3] and Spring.I18N(v[3]) or "", + onchange = function(i, value) + saveOptionValue("Notifications", "notifications", "setNotification" .. v[1], { "notificationList" }, value) + end, + onclick = function() + if WG["notifications"] ~= nil and WG["notifications"].playNotification then + WG["notifications"].playNotification(v[1]) + end + end, } end end @@ -6932,7 +9919,7 @@ function init() end -- add auto cloak toggles - local defaultUnitdefConfig = { -- copy pasted defaults from the widget + local defaultUnitdefConfig = { -- copy pasted defaults from the widget [UnitDefNames["armdecom"] and UnitDefNames["armdecom"].id or -1] = false, [UnitDefNames["cordecom"] and UnitDefNames["cordecom"].id or -1] = false, [UnitDefNames["armferret"] and UnitDefNames["armferret"].id or -1] = false, @@ -6950,8 +9937,8 @@ function init() [UnitDefNames["legaspy"] and UnitDefNames["legaspy"].id or -1] = true, } local unitdefConfig = {} - if WG['autocloak'] ~= nil then - unitdefConfig = WG['autocloak'].getUnitdefConfig() + if WG["autocloak"] ~= nil then + unitdefConfig = WG["autocloak"].getUnitdefConfig() elseif widgetHandler.configData["Auto Cloak Units"] ~= nil and widgetHandler.configData["Auto Cloak Units"].unitdefConfig ~= nil then for unitName, value in pairs(widgetHandler.configData["Auto Cloak Units"].unitdefConfig) do if UnitDefNames[unitName] then @@ -6961,22 +9948,29 @@ function init() end end unitdefConfig = table.merge(defaultUnitdefConfig, unitdefConfig) - if type(unitdefConfig) == 'table' then + if type(unitdefConfig) == "table" then local newOptions = {} local count = 0 for i, option in pairs(options) do count = count + 1 newOptions[count] = option - if option.id == 'autocloak' then + if option.id == "autocloak" then for k, v in pairs(unitdefConfig) do if UnitDefs[k] then - local faction = Spring.I18N('units.factions.' .. string.sub(UnitDefs[k].name,1,3)) + local faction = Spring.I18N("units.factions." .. string.sub(UnitDefs[k].name, 1, 3)) if faction then count = count + 1 - newOptions[count] = { id = "autocloak_" .. k, group = "game", category = types.basic, name = widgetOptionColor .. " " .. UnitDefs[k].translatedHumanName..' ('..faction..')', type = "bool", value = v, description = UnitDefs[k].translatedTooltip, - onchange = function(i, value) - saveOptionValue('Auto Cloak Units', 'autocloak', 'setUnitdefConfig', { 'unitdefConfig', k }, value, { k, value } ) - end, + newOptions[count] = { + id = "autocloak_" .. k, + group = "game", + category = types.basic, + name = widgetOptionColor .. " " .. UnitDefs[k].translatedHumanName .. " (" .. faction .. ")", + type = "bool", + value = v, + description = UnitDefs[k].translatedTooltip, + onchange = function(i, value) + saveOptionValue("Auto Cloak Units", "autocloak", "setUnitdefConfig", { "unitdefConfig", k }, value, { k, value }) + end, } end end @@ -6987,98 +9981,96 @@ function init() end -- cursors - if WG['cursors'] == nil then - options[getOptionByID('cursor')] = nil - options[getOptionByID('cursorsize')] = nil + if WG["cursors"] == nil then + options[getOptionByID("cursor")] = nil + options[getOptionByID("cursorsize")] = nil else local cursorsets = {} local cursor = 1 local cursoroption - cursorsets = WG['cursors'].getcursorsets() - local cursorname = WG['cursors'].getcursor() + cursorsets = WG["cursors"].getcursorsets() + local cursorname = WG["cursors"].getcursor() for i, c in pairs(cursorsets) do if c == cursorname then cursor = i break end end - if getOptionByID('cursor') then - options[getOptionByID('cursor')].options = cursorsets - options[getOptionByID('cursor')].value = cursor + if getOptionByID("cursor") then + options[getOptionByID("cursor")].options = cursorsets + options[getOptionByID("cursor")].value = cursor end - if WG['cursors'].getsizemult then - options[getOptionByID('cursorsize')].value = WG['cursors'].getsizemult() + if WG["cursors"].getsizemult then + options[getOptionByID("cursorsize")].value = WG["cursors"].getsizemult() else - options[getOptionByID('cursorsize')] = nil + options[getOptionByID("cursorsize")] = nil end end - if WG['smartselect'] == nil then - options[getOptionByID('smartselect_includebuildings')] = nil - options[getOptionByID('smartselect_includebuilders')] = nil - options[getOptionByID('smartselect_includeantinuke')] = nil - options[getOptionByID('smartselect_includeradar')] = nil - options[getOptionByID('smartselect_includejammer')] = nil + if WG["smartselect"] == nil then + options[getOptionByID("smartselect_includebuildings")] = nil + options[getOptionByID("smartselect_includebuilders")] = nil + options[getOptionByID("smartselect_includeantinuke")] = nil + options[getOptionByID("smartselect_includeradar")] = nil + options[getOptionByID("smartselect_includejammer")] = nil else - options[getOptionByID('smartselect_includebuildings')].value = WG['smartselect'].getIncludeBuildings() - options[getOptionByID('smartselect_includebuilders')].value = WG['smartselect'].getIncludeBuilders() - options[getOptionByID('smartselect_includeantinuke')].value = WG['smartselect'].getIncludeAntinuke() - options[getOptionByID('smartselect_includeradar')].value = WG['smartselect'].getIncludeRadar() - options[getOptionByID('smartselect_includejammer')].value = WG['smartselect'].getIncludeJammer() + options[getOptionByID("smartselect_includebuildings")].value = WG["smartselect"].getIncludeBuildings() + options[getOptionByID("smartselect_includebuilders")].value = WG["smartselect"].getIncludeBuilders() + options[getOptionByID("smartselect_includeantinuke")].value = WG["smartselect"].getIncludeAntinuke() + options[getOptionByID("smartselect_includeradar")].value = WG["smartselect"].getIncludeRadar() + options[getOptionByID("smartselect_includejammer")].value = WG["smartselect"].getIncludeJammer() end - if WG['snow'] ~= nil and WG['snow'].getSnowMap ~= nil then - options[getOptionByID('snowmap')].value = WG['snow'].getSnowMap() + if WG["snow"] ~= nil and WG["snow"].getSnowMap ~= nil then + options[getOptionByID("snowmap")].value = WG["snow"].getSnowMap() end -- not sure if needed: remove vsync option when its done by monitor (freesync/gsync) -> config value is set as 'x' - if Spring.GetConfigInt("VSync", 1) == 'x' then - options[getOptionByID('vsync')] = nil - options[getOptionByID('vsync_spec')] = nil - options[getOptionByID('vsync_level')] = nil + if Spring.GetConfigInt("VSync", 1) == "x" then + options[getOptionByID("vsync")] = nil + options[getOptionByID("vsync_spec")] = nil + options[getOptionByID("vsync_level")] = nil else -- doing this in order to detect if vsync is actually on due to the only when spectator setting - local id = getOptionByID('vsync') + local id = getOptionByID("vsync") options[id].onchange(id, options[id].value) end - if WG['playercolorpalette'] == nil or WG['playercolorpalette'].getSameTeamColors == nil then - options[getOptionByID('sameteamcolors')] = nil + if WG["playercolorpalette"] == nil or WG["playercolorpalette"].getSameTeamColors == nil then + options[getOptionByID("sameteamcolors")] = nil end if WG.lockcamera == nil then - options[getOptionByID('lockcamera_transitiontime')] = nil - options[getOptionByID('lockcamera_hideenemies')] = nil + options[getOptionByID("lockcamera_transitiontime")] = nil + options[getOptionByID("lockcamera_hideenemies")] = nil end - if Spring.GetConfigInt("CamMode", 2) ~= 2 then - options[getOptionByID('springcamheightmode')] = nil + options[getOptionByID("springcamheightmode")] = nil end if Spring.GetConfigString("KeybindingFile") ~= "uikeys.txt" then - options[getOptionByID('gridmenu')] = nil + options[getOptionByID("gridmenu")] = nil end if not isSinglePlayer then - options[getOptionByID('restart_with_state')] = nil + options[getOptionByID("restart_with_state")] = nil end -- add user widgets - -- look for custom widget options local userwidgetOptions = {} local usedCustomOptions = {} local customOptionsCount = #customOptions if customOptions[1] then for k, option in pairs(customOptions) do - if not getOptionByID(option.name) and option.widgetname then -- prevent adding duplicate + if not getOptionByID(option.name) and option.widgetname then -- prevent adding duplicate if not userwidgetOptions[option.widgetname] then userwidgetOptions[option.widgetname] = {} end - userwidgetOptions[option.widgetname][#userwidgetOptions[option.widgetname]+1] = k - customOptionsCount = customOptionsCount -1 + userwidgetOptions[option.widgetname][#userwidgetOptions[option.widgetname] + 1] = k + customOptionsCount = customOptionsCount - 1 end end end @@ -7087,26 +10079,26 @@ function init() if not data.fromZip then if not userwidgetsDetected then userwidgetsDetected = true - options[#options+1] = { id = "label_custom_widgets", group = "custom", name = Spring.I18N('ui.settings.option.label_widgets'), category = types.basic } - options[#options+1] = { id = "label_custom_widgets_spacer", group = "custom", category = types.basic } + options[#options + 1] = { id = "label_custom_widgets", group = "custom", name = Spring.I18N("ui.settings.option.label_widgets"), category = types.basic } + options[#options + 1] = { id = "label_custom_widgets_spacer", group = "custom", category = types.basic } end - local desc = data.desc or '' - if desc ~= '' and WG['tooltip'] then - local maxWidth = WG['tooltip'].getFontsize() * 90 + local desc = data.desc or "" + if desc ~= "" and WG["tooltip"] then + local maxWidth = WG["tooltip"].getFontsize() * 90 local textLines, numLines = font:WrapText(desc, maxWidth) - desc = string.gsub(textLines, '[\n]', '\n') + desc = string.gsub(textLines, "[\n]", "\n") end - if data.author and data.author ~= '' then - desc = desc .. (desc ~= '' and '\n' or '')..widgetOptionColor..Spring.I18N('ui.settings.option.author')..': '.. data.author + if data.author and data.author ~= "" then + desc = desc .. (desc ~= "" and "\n" or "") .. widgetOptionColor .. Spring.I18N("ui.settings.option.author") .. ": " .. data.author end - options[#options+1] = { id = "widget_"..string.gsub(data.basename, ".lua", ""), group = "custom", category = types.basic, widget = name, name = name, type = "bool", value = GetWidgetToggleValue(name), description = desc } + options[#options + 1] = { id = "widget_" .. string.gsub(data.basename, ".lua", ""), group = "custom", category = types.basic, widget = name, name = name, type = "bool", value = GetWidgetToggleValue(name), description = desc } if userwidgetOptions[name] then for k, customOption in pairs(userwidgetOptions[name]) do - options[#options+1] = table.copy(customOptions[customOption]) + options[#options + 1] = table.copy(customOptions[customOption]) if oldValues[options[#options].id] ~= nil then options[#options].value = oldValues[options[#options].id] end - options[#options].name = widgetOptionColor..' '..options[#options].name + options[#options].name = widgetOptionColor .. " " .. options[#options].name usedCustomOptions[customOption] = true end end @@ -7115,11 +10107,11 @@ function init() -- add custom added options (done via WG.options.addOption) if customOptionsCount > 0 then - options[#options+1] = { id = "label_custom_options", group = "custom", name = Spring.I18N('ui.settings.option.label_options'), category = types.basic } - options[#options+1] = { id = "label_custom_options_spacer", group = "custom", category = types.basic } + options[#options + 1] = { id = "label_custom_options", group = "custom", name = Spring.I18N("ui.settings.option.label_options"), category = types.basic } + options[#options + 1] = { id = "label_custom_options_spacer", group = "custom", category = types.basic } for k, option in pairs(customOptions) do - if not getOptionByID(option.name) and not usedCustomOptions[k] then -- prevent adding duplicate - options[#options+1] = option + if not getOptionByID(option.name) and not usedCustomOptions[k] then -- prevent adding duplicate + options[#options + 1] = option end end end @@ -7128,8 +10120,8 @@ function init() local processedOptions = {} local processedOptionsCount = 0 for i, option in pairs(options) do - if option.type == 'slider' and not option.steps then - if type(option.value) ~= 'number' then + if option.type == "slider" and not option.steps then + if type(option.value) ~= "number" then option.value = option.min end if option.value < option.min then @@ -7141,9 +10133,9 @@ function init() end if option.name then if option.category == types.dev then - option.name = devMainOptionColor..string.gsub(option.name, widgetOptionColor, devOptionColor) + option.name = devMainOptionColor .. string.gsub(option.name, widgetOptionColor, devOptionColor) elseif (devMode or devUI) and option.category == types.advanced then - option.name = advMainOptionColor..string.gsub(option.name, widgetOptionColor, advOptionColor) + option.name = advMainOptionColor .. string.gsub(option.name, widgetOptionColor, advOptionColor) end end processedOptionsCount = processedOptionsCount + 1 @@ -7155,7 +10147,7 @@ function init() unfilteredOptions = options -- Apply current filter if any - if inputText and inputText ~= '' and inputMode == '' then + if inputText and inputText ~= "" and inputMode == "" then applyFilter() end @@ -7191,7 +10183,6 @@ function init() gl.DeleteList(windowList) end windowList = gl.CreateList(DrawWindow) - end function widget:MapDrawCmd(playerID, cmdType, startx, starty, startz, a, b, c) @@ -7214,17 +10205,16 @@ function widget:GameOver() updateGrabinput() end - local function optionsCmd(_, _, params) local newShow = not show - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow if showTextInput then if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! else cancelChatInput() end @@ -7232,32 +10222,36 @@ local function optionsCmd(_, _, params) end local function optionCmd(_, _, params) - if not params[1] then return end + if not params[1] then + return + end local optionID = getOptionByID(params[1]) - if not optionID then return end + if not optionID then + return + end if not params[2] then - if options[optionID].type == 'bool' then + if options[optionID].type == "bool" then applyOptionValue(optionID, not options[optionID].value) else show = true if showTextInput then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end end else - if options[optionID].type == 'select' then + if options[optionID].type == "select" then local selectKey = getSelectKey(optionID, params[2]) if selectKey then applyOptionValue(optionID, selectKey) end - elseif options[optionID].type == 'bool' then + elseif options[optionID].type == "bool" then local value - if params[2] == '0' then + if params[2] == "0" then value = false - elseif params[2] == '0.5' then + elseif params[2] == "0.5" then value = 0.5 else value = true @@ -7285,7 +10279,6 @@ local function grapherCmd(_, _, params) end end - function widget:Initialize() -- Restart-with-state restore: if a saved state file exists from a previous -- restart-with-state trigger, read it now (io is available in LuaUI) and @@ -7300,7 +10293,9 @@ function widget:Initialize() end -- Clear the file immediately so we don't restore again on the next restart local fc = io.open(RWS_FILE, "w") - if fc then fc:close() end + if fc then + fc:close() + end end -- disable ambient player widget @@ -7346,7 +10341,6 @@ function widget:Initialize() widgetHandler:EnableWidget("HighlightUnit API GL4") end - if newerVersion then if widgetHandler.orderList["Defense Range GL4"] < 0.5 then widgetHandler:EnableWidget("Defense Range GL4") @@ -7375,7 +10369,7 @@ function widget:Initialize() if firstlaunchsetupDone == false then firstlaunchsetupDone = true - Spring.Echo('First time setup: done') + Spring.Echo("First time setup: done") Spring.SetConfigFloat("snd_airAbsorption", 0.35) -- Set lower defaults for lower end/potato systems @@ -7396,7 +10390,7 @@ function widget:Initialize() Spring.SetConfigInt("ShadowMapSize", 1024) Spring.SetConfigInt("Shadows", 0) Spring.SetConfigInt("MSAALevel", 0) - Spring.SetConfigFloat("ui_opacity", 0.7) -- set to be more opaque cause guishader isnt availible + Spring.SetConfigFloat("ui_opacity", 0.7) -- set to be more opaque cause guishader isnt availible else Spring.SendCommands("water 4") Spring.SetConfigInt("Water", 4) @@ -7405,15 +10399,15 @@ function widget:Initialize() local minMaxparticles = 12000 if tonumber(Spring.GetConfigInt("MaxParticles", 1) or 0) < minMaxparticles then Spring.SetConfigInt("MaxParticles", minMaxparticles) - Spring.Echo('First time setup: setting MaxParticles config value to ' .. minMaxparticles) + Spring.Echo("First time setup: setting MaxParticles config value to " .. minMaxparticles) end Spring.SetConfigInt("CamMode", 3) - Spring.SendCommands('viewspring') + Spring.SendCommands("viewspring") end Spring.SetConfigFloat("CamTimeFactor", 1) - Spring.SetConfigString("InputTextGeo", "0.35 0.72 0.03 0.04") -- input chat position posX, posY, ?, ? + Spring.SetConfigString("InputTextGeo", "0.35 0.72 0.03 0.04") -- input chat position posX, posY, ?, ? if Spring.GetGameFrame() == 0 then -- set minimum particle amount @@ -7443,46 +10437,46 @@ function widget:Initialize() Spring.SetAtmosphere({ fogEnd = gl.GetAtmosphere("fogStart") + 0.01 }) end - Spring.SendCommands("minimap unitsize " .. (Spring.GetConfigFloat("MinimapIconScale", 3.5))) -- spring wont remember what you set with '/minimap iconssize #' + Spring.SendCommands("minimap unitsize " .. (Spring.GetConfigFloat("MinimapIconScale", 3.5))) -- spring wont remember what you set with '/minimap iconssize #' - WG['options'] = {} - WG['options'].toggle = function(state) + WG["options"] = {} + WG["options"].toggle = function(state) local newShow = state if newShow == nil then newShow = not show end - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow if showTextInput then if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! else cancelChatInput() end end end - WG['options'].getOptionsList = function() + WG["options"].getOptionsList = function() local optionList = {} for i, option in pairs(options) do - optionList[#optionList+1] = option.id + optionList[#optionList + 1] = option.id end return optionList end - WG['options'].isvisible = function() + WG["options"].isvisible = function() return show end - WG['options'].getOptionValue = function(option) + WG["options"].getOptionValue = function(option) if getOptionByID(option) then return options[getOptionByID(option)].value end end - WG['options'].getCameraSmoothness = function() + WG["options"].getCameraSmoothness = function() return cameraTransitionTime end - WG['options'].disallowEsc = function() + WG["options"].disallowEsc = function() if showSelectOptions then --or draggingSlider then return true @@ -7490,15 +10484,15 @@ function widget:Initialize() return false end end - WG['options'].addOptions = function(newOptions) + WG["options"].addOptions = function(newOptions) for _, option in ipairs(newOptions) do option.group = "custom" - customOptions[#customOptions+1] = option + customOptions[#customOptions + 1] = option end init() end - WG['options'].removeOptions = function(names) + WG["options"].removeOptions = function(names) for _, name in ipairs(names) do for i, option in pairs(customOptions) do if option.id == name then @@ -7510,26 +10504,26 @@ function widget:Initialize() init() end - WG['options'].addOption = function(option) - return WG['options'].addOptions({ option }) + WG["options"].addOption = function(option) + return WG["options"].addOptions({ option }) end - WG['options'].removeOption = function(name) - return WG['options'].removeOptions({ name }) + WG["options"].removeOption = function(name) + return WG["options"].removeOptions({ name }) end - WG['options'].applyOptionValue = function(option, value) + WG["options"].applyOptionValue = function(option, value) local optionID = getOptionByID(option) if not optionID then Spring.Echo("Options widget: applyOptionValue: option '" .. option .. "' not found") return end - applyOptionValue(optionID, tonumber(value)) + applyOptionValue(optionID, tonumber(value)) end - widgetHandler.actionHandler:AddAction(self, "options", optionsCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "option", optionCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "devmode", devmodeCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "profile", profileCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "grapher", grapherCmd, nil, 't') + widgetHandler.actionHandler:AddAction(self, "options", optionsCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "option", optionCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "devmode", devmodeCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "profile", profileCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "grapher", grapherCmd, nil, "t") end function widget:GameFrame(n) @@ -7557,13 +10551,13 @@ function widget:Shutdown() gl.DeleteFont(fontOption[i]) end end - if WG['guishader'] then - WG['guishader'].RemoveDlist('options') - WG['guishader'].RemoveRect('optionsinput') - WG['guishader'].RemoveScreenRect('options_select') - WG['guishader'].RemoveScreenRect('options_select_options') + if WG["guishader"] then + WG["guishader"].RemoveDlist("options") + WG["guishader"].RemoveRect("optionsinput") + WG["guishader"].RemoveScreenRect("options_select") + WG["guishader"].RemoveScreenRect("options_select_options") if selectOptionsList then - WG['guishader'].removeRenderDlist(selectOptionsList) + WG["guishader"].removeRenderDlist(selectOptionsList) end end if selectOptionsList then @@ -7571,7 +10565,7 @@ function widget:Shutdown() end glDeleteList(consoleCmdDlist) glDeleteList(textInputDlist) - WG['options'] = nil + WG["options"] = nil resetUserVolume() Spring.SendCommands("grabinput 0") @@ -7598,7 +10592,7 @@ function widget:GetConfigData() cameraTransitionTime = cameraTransitionTime, cameraPanTransitionTime = cameraPanTransitionTime, useNetworkSmoothing = useNetworkSmoothing, - desiredWaterValue = desiredWaterValue, -- configint water cant be used since we will set water 0 when no water is present + desiredWaterValue = desiredWaterValue, -- configint water cant be used since we will set water 0 when no water is present pauseGameWhenSingleplayerExecuted = pauseGameWhenSingleplayerExecuted, pauseGameWhenSingleplayer = pauseGameWhenSingleplayer, @@ -7663,8 +10657,8 @@ function widget:SetConfigData(data) if data.show ~= nil then show = data.show if show and showTextInput then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end end end diff --git a/luaui/Widgets/gui_ordermenu.lua b/luaui/Widgets/gui_ordermenu.lua index 61fbbc3fce4..52462c48be8 100644 --- a/luaui/Widgets/gui_ordermenu.lua +++ b/luaui/Widgets/gui_ordermenu.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "April 2020", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathCeil = math.ceil local mathFloor = math.floor @@ -46,29 +45,29 @@ local height = 0 local cellMarginOriginal = 0.055 local cellMargin = cellMarginOriginal local commandInfo = { - move = { red = 0.64, green = 1, blue = 0.64 }, - stop = { red = 1, green = 0.3, blue = 0.3 }, - attack = { red = 1, green = 0.5, blue = 0.35 }, - areaattack = { red = 1, green = 0.35, blue = 0.15 }, - manualfire = { red = 1, green = 0.7, blue = 0.7 }, - patrol = { red = 0.73, green = 0.73, blue = 1 }, - fight = { red = 0.9, green = 0.5, blue = 1 }, - resurrect = { red = 1, green = 0.75, blue = 1, }, - guard = { red = 0.33, green = 0.92, blue = 1 }, - wait = { red = 0.7, green = 0.66, blue = 0.6 }, - repair = { red = 1, green = 0.95, blue = 0.7 }, - reclaim = { red = 0.86, green = 1, blue = 0.86 }, - restore = { red = 0.77, green = 1, blue = 0.77 }, - capture = { red = 1, green = 0.85, blue = 0.22 }, - settarget = { red = 1, green = 0.66, blue = 0.35 }, - canceltarget = { red = 0.8, green = 0.55, blue = 0.2 }, - areamex = { red = 0.93, green = 0.93, blue = 0.93 }, - upgrademex = { red = 0.93, green = 0.93, blue = 0.93 }, - loadunits = { red = 0.1, green = 0.7, blue = 1 }, - unloadunits = { red = 0, green = 0.5, blue = 1 }, - wantcloak = { red = nil, green = nil, blue = nil }, - onoff = { red = nil, green = nil, blue = nil }, - sellunit = { red = nil, green = nil, blue = nil }, + move = { red = 0.64, green = 1, blue = 0.64 }, + stop = { red = 1, green = 0.3, blue = 0.3 }, + attack = { red = 1, green = 0.5, blue = 0.35 }, + areaattack = { red = 1, green = 0.35, blue = 0.15 }, + manualfire = { red = 1, green = 0.7, blue = 0.7 }, + patrol = { red = 0.73, green = 0.73, blue = 1 }, + fight = { red = 0.9, green = 0.5, blue = 1 }, + resurrect = { red = 1, green = 0.75, blue = 1 }, + guard = { red = 0.33, green = 0.92, blue = 1 }, + wait = { red = 0.7, green = 0.66, blue = 0.6 }, + repair = { red = 1, green = 0.95, blue = 0.7 }, + reclaim = { red = 0.86, green = 1, blue = 0.86 }, + restore = { red = 0.77, green = 1, blue = 0.77 }, + capture = { red = 1, green = 0.85, blue = 0.22 }, + settarget = { red = 1, green = 0.66, blue = 0.35 }, + canceltarget = { red = 0.8, green = 0.55, blue = 0.2 }, + areamex = { red = 0.93, green = 0.93, blue = 0.93 }, + upgrademex = { red = 0.93, green = 0.93, blue = 0.93 }, + loadunits = { red = 0.1, green = 0.7, blue = 1 }, + unloadunits = { red = 0, green = 0.5, blue = 1 }, + wantcloak = { red = nil, green = nil, blue = nil }, + onoff = { red = nil, green = nil, blue = nil }, + sellunit = { red = nil, green = nil, blue = nil }, } local isStateCommand = {} @@ -79,7 +78,7 @@ local vsx, vsy = spGetViewGeometry() local barGlowCenterTexture = ":l:LuaUI/Images/barglow-center.png" local barGlowEdgeTexture = ":l:LuaUI/Images/barglow-edge.png" -local soundButton = 'LuaUI/Sounds/buildbar_waypoint.wav' +local soundButton = "LuaUI/Sounds/buildbar_waypoint.wav" local uiOpacity = Spring.GetConfigFloat("ui_opacity", 0.7) local uiScale = Spring.GetConfigFloat("ui_scale", 1) @@ -120,7 +119,7 @@ end -- Throttling for command refresh local lastCommandRefreshTime = 0 -local commandRefreshDelay = 0.05 -- 50ms delay +local commandRefreshDelay = 0.05 -- 50ms delay -- Cache for hotkey strings local hotkeyCache = {} @@ -135,7 +134,7 @@ local commandTextCache = {} -- Cached WAIT command state (computed once per refresh, not per drawCell call) local cachedWaitState = nil local hasWaitCommand = false -local cachedFirstUnit = nil -- first selected unit, avoids spGetSelectedUnits() table alloc +local cachedFirstUnit = nil -- first selected unit, avoids spGetSelectedUnits() table alloc -- Cancel target button visibility tracking local cancelTargetPollSec = 0 @@ -149,8 +148,8 @@ local prevActiveCmd = nil local commandsVisuallyChanged = true -- Font metrics cache (cleared on ViewResize when font changes) -local fontWidthCache = {} -- text -> GetTextWidth result (with padding) -local fontHeightCache = {} -- text -> GetTextHeight result +local fontWidthCache = {} -- text -> GetTextWidth result (with padding) +local fontHeightCache = {} -- text -> GetTextHeight result -- Colorized text color cache (cleared when colorize changes) local colorStrCache = {} @@ -214,13 +213,13 @@ for unitDefID, unitDef in pairs(UnitDefs) do end local function checkGuiShader(force) - if WG['guishader'] then + if WG["guishader"] then if force and displayListGuiShader then displayListGuiShader = gl.DeleteList(displayListGuiShader) end if not displayListGuiShader then displayListGuiShader = gl.CreateList(function() - RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner * uiScale, ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0)) + RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner * uiScale, ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0)) end) end elseif displayListGuiShader then @@ -273,8 +272,8 @@ local function setupCellGrid(force) local i = 0 cellWidth = math_floor((activeRect[3] - activeRect[1]) / cols) cellHeight = math_floor((activeRect[4] - activeRect[2]) / rows) - local leftOverWidth = ((activeRect[3] - activeRect[1]) - (cellWidth * cols))-1 - local leftOverHeight = ((activeRect[4] - activeRect[2]) - (cellHeight * rows)) -(posY-height <= 0 and 1 or 0) + local leftOverWidth = ((activeRect[3] - activeRect[1]) - (cellWidth * cols)) - 1 + local leftOverHeight = ((activeRect[4] - activeRect[2]) - (cellHeight * rows)) - (posY - height <= 0 and 1 or 0) cellMarginPx = math_max(1, math_ceil(cellHeight * 0.5 * cellMargin)) cellMarginPx2 = math_max(0, math_ceil(cellHeight * 0.18 * cellMargin)) @@ -361,9 +360,8 @@ local function refreshCommands() if command.type == CMDTYPE_ICON_MODE then isStateCommand[command.id] = true end - if not hiddenCommands[command.id] and not hiddenCommandTypes[command.type] and command.action ~= nil and not command.disabled - and not (command.id == CANCEL_TARGET_CMD_ID and not cancelTargetRelevant) then - if command.type == CMDTYPE_ICON_BUILDING or (string.find(command.action, 'buildunit_', 1, true) == 1) then + if not hiddenCommands[command.id] and not hiddenCommandTypes[command.type] and command.action ~= nil and not command.disabled and not (command.id == CANCEL_TARGET_CMD_ID and not cancelTargetRelevant) then + if command.type == CMDTYPE_ICON_BUILDING or (string.find(command.action, "buildunit_", 1, true) == 1) then -- intentionally empty, no action to take elseif isStateCommand[command.id] then stateCommandsCount = stateCommandsCount + 1 @@ -407,20 +405,20 @@ local function refreshCommands() local commandState = (cmd.id == CMD.FIRE_STATE) and OrderMenuFirestate.stateLabel(cmd) or Firestates.stateLabel(cmd) if commandState then if not commandTextCache[commandState] then - commandTextCache[commandState] = getCachedTranslation('ui.orderMenu.' .. commandState) + commandTextCache[commandState] = getCachedTranslation("ui.orderMenu." .. commandState) end cmd.cachedText = commandTextCache[commandState] else - cmd.cachedText = '?' + cmd.cachedText = "?" end else - if cmd.action == 'stockpile' then + if cmd.action == "stockpile" then -- Stockpile command name gets mutated to reflect the current status, so can't cache persistently - cmd.cachedText = getCachedTranslation('ui.orderMenu.' .. cmd.action, { stockpileStatus = cmd.name }) + cmd.cachedText = getCachedTranslation("ui.orderMenu." .. cmd.action, { stockpileStatus = cmd.name }) else local actionKey = cmd.action if not commandTextCache[actionKey] then - commandTextCache[actionKey] = getCachedTranslation('ui.orderMenu.' .. actionKey) + commandTextCache[actionKey] = getCachedTranslation("ui.orderMenu." .. actionKey) end cmd.cachedText = commandTextCache[actionKey] end @@ -490,18 +488,18 @@ function widget:ViewResize() width = 0.2125 height = 0.14 * uiScale - width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens + width = width / (vsx / vsy) * 1.78 -- make smaller for ultrawide screens width = width * uiScale -- make pixel aligned width = mathFloor(width * vsx) / vsx height = mathFloor(height * vsy) / vsy - if WG['buildmenu'] then - buildmenuBottomPosition = WG['buildmenu'].getBottomPosition() + if WG["buildmenu"] then + buildmenuBottomPosition = WG["buildmenu"].getBottomPosition() end - font = WG['fonts'].getFont(2) + font = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner backgroundPadding = WG.FlowUI.elementPadding @@ -513,22 +511,22 @@ function widget:ViewResize() widgetSpaceMargin = WG.FlowUI.elementMargin - if WG['minimap'] then - minimapHeight = WG['minimap'].getHeight() + if WG["minimap"] then + minimapHeight = WG["minimap"].getHeight() end if stickToBottom then posY = height - posX = width + (widgetSpaceMargin/vsx) + posX = width + (widgetSpaceMargin / vsx) else if buildmenuBottomPosition then posX = 0 - posY = height + height + (widgetSpaceMargin/vsy) - elseif WG['buildmenu'] then - local posY2, _ = WG['buildmenu'].getSize() - posY2 = posY2 + (widgetSpaceMargin/vsy) + posY = height + height + (widgetSpaceMargin / vsy) + elseif WG["buildmenu"] then + local posY2, _ = WG["buildmenu"].getSize() + posY2 = posY2 + (widgetSpaceMargin / vsy) posY = posY2 + height - if WG['minimap'] then - posY = 1 - (minimapHeight / vsy) - (widgetSpaceMargin/vsy) + if WG["minimap"] then + posY = 1 - (minimapHeight / vsy) - (widgetSpaceMargin / vsy) end posX = 0 end @@ -538,9 +536,9 @@ function widget:ViewResize() local activeBgpadding = math_floor((backgroundPadding * 1.4) + 0.5) activeRect = { (posX * vsx) + (posX > 0 and activeBgpadding or mathCeil(backgroundPadding * 0.6)), - ((posY - height) * vsy) + (posY-height > 0 and math_floor(activeBgpadding) or math_floor(activeBgpadding / 3)), + ((posY - height) * vsy) + (posY - height > 0 and math_floor(activeBgpadding) or math_floor(activeBgpadding / 3)), ((posX + width) * vsx) - activeBgpadding, - (posY * vsy) - activeBgpadding + (posY * vsy) - activeBgpadding, } if displayListOrders then displayListOrders = gl.DeleteList(displayListOrders) @@ -551,9 +549,15 @@ function widget:ViewResize() doUpdate = true -- Clear font metric caches since font changed - for k in pairs(fontWidthCache) do fontWidthCache[k] = nil end - for k in pairs(fontHeightCache) do fontHeightCache[k] = nil end - for k in pairs(printTextCache) do printTextCache[k] = nil end + for k in pairs(fontWidthCache) do + fontWidthCache[k] = nil + end + for k in pairs(fontHeightCache) do + fontHeightCache[k] = nil + end + for k in pairs(printTextCache) do + printTextCache[k] = nil + end if ordermenuTex then gl.DeleteTexture(ordermenuBgTex) @@ -580,30 +584,30 @@ function widget:Initialize() widget:ViewResize() widget:SelectionChanged(spGetSelectedUnits()) - WG['ordermenu'] = {} - WG['ordermenu'].getPosition = function() + WG["ordermenu"] = {} + WG["ordermenu"].getPosition = function() return posX, posY, width, height end - WG['ordermenu'].reloadBindings = reloadBindings - WG['ordermenu'].setBottomPosition = function(value) + WG["ordermenu"].reloadBindings = reloadBindings + WG["ordermenu"].setBottomPosition = function(value) stickToBottom = value doUpdate = true widget:ViewResize() end - WG['ordermenu'].getAlwaysShow = function() + WG["ordermenu"].getAlwaysShow = function() return alwaysShow end - WG['ordermenu'].setAlwaysShow = function(value) + WG["ordermenu"].setAlwaysShow = function(value) alwaysShow = value doUpdate = true end - WG['ordermenu'].getBottomPosition = function() + WG["ordermenu"].getBottomPosition = function() return stickToBottom end - WG['ordermenu'].getDisabledCmd = function(cmd) + WG["ordermenu"].getDisabledCmd = function(cmd) return disabledCommand[cmd] end - WG['ordermenu'].setDisabledCmd = function(params) + WG["ordermenu"].setDisabledCmd = function(params) if params[2] then disabledCommand[params[1]] = true else @@ -611,17 +615,17 @@ function widget:Initialize() end doUpdate = true end - WG['ordermenu'].getColorize = function() + WG["ordermenu"].getColorize = function() return colorize end - WG['ordermenu'].setColorize = function(value) + WG["ordermenu"].setColorize = function(value) doUpdate = true colorize = value if colorize > 1 then colorize = 1 end end - WG['ordermenu'].getIsShowing = function() + WG["ordermenu"].getIsShowing = function() return ordermenuShows end @@ -630,8 +634,10 @@ function widget:Initialize() ---restarting the pulse phase). ---@param cmdID number The command ID (e.g. CMD.MOVE, CMD.ATTACK) to highlight. ---@param color number[]? Optional {r,g,b} in 0..1. Defaults to a warm yellow. - WG['ordermenu'].setHighlight = function(cmdID, color) - if not cmdID then return end + WG["ordermenu"].setHighlight = function(cmdID, color) + if not cmdID then + return + end local items = highlight.items if not items[cmdID] then highlight.count = highlight.count + 1 @@ -642,7 +648,7 @@ function widget:Initialize() } end - WG['ordermenu'].removeHighlight = function(cmdID) + WG["ordermenu"].removeHighlight = function(cmdID) local items = highlight.items if cmdID and items[cmdID] then items[cmdID] = nil @@ -650,7 +656,7 @@ function widget:Initialize() end end - WG['ordermenu'].clearHighlights = function() + WG["ordermenu"].clearHighlights = function() local items = highlight.items for k in pairs(items) do items[k] = nil @@ -658,7 +664,7 @@ function widget:Initialize() highlight.count = 0 end - WG['ordermenu'].hasHighlight = function(cmdID) + WG["ordermenu"].hasHighlight = function(cmdID) return cmdID ~= nil and highlight.items[cmdID] ~= nil end @@ -666,8 +672,8 @@ function widget:Initialize() end function widget:Shutdown() - if WG['guishader'] and displayListGuiShader then - WG['guishader'].DeleteDlist('ordermenu') + if WG["guishader"] and displayListGuiShader then + WG["guishader"].DeleteDlist("ordermenu") displayListGuiShader = nil end if displayListOrders then @@ -681,7 +687,7 @@ function widget:Shutdown() gl.DeleteTexture(ordermenuTex) ordermenuTex = nil end - WG['ordermenu'] = nil + WG["ordermenu"] = nil end local buildmenuBottomPos = false @@ -694,15 +700,15 @@ function widget:Update(dt) sec = 0 checkGuiShader() - if WG['buildmenu'] and WG['buildmenu'].getBottomPosition then + if WG["buildmenu"] and WG["buildmenu"].getBottomPosition then local prevbuildmenuBottomPos = buildmenuBottomPos - buildmenuBottomPos = WG['buildmenu'].getBottomPosition() + buildmenuBottomPos = WG["buildmenu"].getBottomPosition() if buildmenuBottomPos ~= prevbuildmenuBottomPos then widget:ViewResize() end end - if WG['minimap'] and minimapHeight ~= WG['minimap'].getHeight() then + if WG["minimap"] and minimapHeight ~= WG["minimap"].getHeight() then widget:ViewResize() setupCellGrid(true) doUpdate = true @@ -751,7 +757,7 @@ function widget:Update(dt) end end - if (WG['guishader'] and not displayListGuiShader) or (#commands == 0 and (not alwaysShow or spGetGameFrame() == 0)) then + if (WG["guishader"] and not displayListGuiShader) or (#commands == 0 and (not alwaysShow or spGetGameFrame() == 0)) then ordermenuShows = false else ordermenuShows = true @@ -772,10 +778,13 @@ local function DrawRect(px, py, sx, sy, zoom) gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy, zoom) end - local function drawHighlights() - if highlight.count == 0 or not next(highlight.items) then return end - if #commands == 0 then return end + if highlight.count == 0 or not next(highlight.items) then + return + end + if #commands == 0 then + return + end local now = os_clock() local pulse = 0.5 + 0.5 * math.sin(now * 4.5) local outlineAlpha = 0.45 + 0.5 * pulse @@ -796,8 +805,12 @@ local function drawHighlights() local rightMargin = cellMarginPx2 local topMargin = cellMarginPx local bottomMargin = cellMarginPx2 - if cell % cols == 1 then leftMargin = cellMarginPx2 end - if cell % cols == 0 then rightMargin = cellMarginPx2 end + if cell % cols == 1 then + leftMargin = cellMarginPx2 + end + if cell % cols == 0 then + rightMargin = cellMarginPx2 + end if cols / cell >= 1 then topMargin = math_floor(((cellMarginPx + cellMarginPx2) / 2) + 0.5) end @@ -813,18 +826,11 @@ local function drawHighlights() glBlending(GL_SRC_ALPHA, GL_ONE) -- Feathered inner outline ring - WG.FlowUI.Draw.RectRoundOutline( - x1, y1, x2, y2, cs, thickness, 1, 1, 1, 1, - { r, g, b, locOutlineAlpha }, { r, g, b, locOutlineAlpha * 0.85 } - ) + WG.FlowUI.Draw.RectRoundOutline(x1, y1, x2, y2, cs, thickness, 1, 1, 1, 1, { r, g, b, locOutlineAlpha }, { r, g, b, locOutlineAlpha * 0.85 }) -- Soft inner glow fading inward local glowWidth = thickness * 3 - WG.FlowUI.Draw.RectRoundOutline( - x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, - math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, - { r, g, b, locGlowAlpha }, { r, g, b, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, math_max(0, cs - thickness), glowWidth, 1, 1, 1, 1, { r, g, b, locGlowAlpha }, { r, g, b, 0 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end @@ -849,7 +855,7 @@ local function drawCell(cell, zoom) if cell % cols == 0 then rightMargin = cellMarginPx2 end - if cols/cell >= 1 then + if cols / cell >= 1 then topMargin = math_floor(((cellMarginPx + cellMarginPx2) / 2) + 0.5) end @@ -863,47 +869,47 @@ local function drawCell(cell, zoom) local color1, color2 if isActiveCmd then zoom = cellClickedZoom - color1 = { 0.66, 0.66, 0.66, math_clamp(uiOpacity, 0.75, 0.95) } -- bottom - color2 = { 1, 1, 1, math_clamp(uiOpacity, 0.75, 0.95) } -- top + color1 = { 0.66, 0.66, 0.66, math_clamp(uiOpacity, 0.75, 0.95) } -- bottom + color2 = { 1, 1, 1, math_clamp(uiOpacity, 0.75, 0.95) } -- top else - if WG['guishader'] then - color1 = (isStateCommand[cmd.id]) and { 0.5, 0.5, 0.5, math_clamp(uiOpacity/1.5, 0.35, 0.55) } or { 0.6, 0.6, 0.6, math_clamp(uiOpacity/1.5, 0.35, 0.55) } - color1[4] = math_clamp(uiOpacity-0.3, 0, 0.35) - color2 = { 1,1,1, math_clamp(uiOpacity-0.3, 0, 0.35) } + if WG["guishader"] then + color1 = isStateCommand[cmd.id] and { 0.5, 0.5, 0.5, math_clamp(uiOpacity / 1.5, 0.35, 0.55) } or { 0.6, 0.6, 0.6, math_clamp(uiOpacity / 1.5, 0.35, 0.55) } + color1[4] = math_clamp(uiOpacity - 0.3, 0, 0.35) + color2 = { 1, 1, 1, math_clamp(uiOpacity - 0.3, 0, 0.35) } else - color1 = (isStateCommand[cmd.id]) and { 0.33, 0.33, 0.33, 1 } or { 0.33, 0.33, 0.33, 1 } - color1[4] = math_clamp(uiOpacity-0.4, 0, 0.35) - color2 = { 1,1,1, math_clamp(uiOpacity-0.4, 0, 0.35) } + color1 = isStateCommand[cmd.id] and { 0.33, 0.33, 0.33, 1 } or { 0.33, 0.33, 0.33, 1 } + color1[4] = math_clamp(uiOpacity - 0.4, 0, 0.35) + color2 = { 1, 1, 1, math_clamp(uiOpacity - 0.4, 0, 0.35) } end if color1[4] > 0.06 then -- white bg (outline) RectRound(cellRects[cell][1] + leftMargin, cellRects[cell][2] + bottomMargin, cellRects[cell][3] - rightMargin, cellRects[cell][4] - topMargin, cellWidth * 0.021, 2, 2, 2, 2, color1, color2) -- darken inside - color1 = {0,0,0, color1[4]*2} - color2 = {0,0,0, color2[4]*2} + color1 = { 0, 0, 0, color1[4] * 2 } + color2 = { 0, 0, 0, color2[4] * 2 } RectRound(cellRects[cell][1] + leftMargin + padding, cellRects[cell][2] + bottomMargin + padding, cellRects[cell][3] - rightMargin - padding, cellRects[cell][4] - topMargin - padding, cellWidth * 0.019, 2, 2, 2, 2, color1, color2) end - color1 = { 0, 0, 0, math_clamp(uiOpacity, 0.55, 0.95) } -- bottom - color2 = { 0, 0, 0, math_clamp(uiOpacity, 0.55, 0.95) } -- top + color1 = { 0, 0, 0, math_clamp(uiOpacity, 0.55, 0.95) } -- bottom + color2 = { 0, 0, 0, math_clamp(uiOpacity, 0.55, 0.95) } -- top end - UiButton(cellRects[cell][1] + leftMargin + padding, cellRects[cell][2] + bottomMargin + padding, cellRects[cell][3] - rightMargin - padding, cellRects[cell][4] - topMargin - padding, 1,1,1,1, 1,1,1,1, nil, color1, color2, padding, 1) + UiButton(cellRects[cell][1] + leftMargin + padding, cellRects[cell][2] + bottomMargin + padding, cellRects[cell][3] - rightMargin - padding, cellRects[cell][4] - topMargin - padding, 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, padding, 1) -- icon if showIcons then if cursorTextures[cmd.cursor] == nil then - local cursorTexture = 'anims/icexuick_200/cursor' .. string.lower(cmd.cursor) .. '_0.png' + local cursorTexture = "anims/icexuick_200/cursor" .. string.lower(cmd.cursor) .. "_0.png" cursorTextures[cmd.cursor] = VFS.FileExists(cursorTexture) and cursorTexture or false end if cursorTextures[cmd.cursor] then - local cursorTexture = 'anims/icexuick_200/cursor' .. string.lower(cmd.cursor) .. '_0.png' + local cursorTexture = "anims/icexuick_200/cursor" .. string.lower(cmd.cursor) .. "_0.png" if VFS.FileExists(cursorTexture) then local s = 0.45 local halfsize = s * ((cellRects[cell][4] - topMargin - padding) - (cellRects[cell][2] + bottomMargin + padding)) local midPosX = (cellRects[cell][3] - rightMargin - padding) - (((cellRects[cell][3] - rightMargin - padding) - (cellRects[cell][1] + leftMargin + padding)) / 2) local midPosY = (cellRects[cell][4] - topMargin - padding) - (((cellRects[cell][4] - topMargin - padding) - (cellRects[cell][2] + bottomMargin + padding)) / 2) glColor(1, 1, 1, 0.66) - glTexture('' .. cursorTexture) + glTexture("" .. cursorTexture) glTexRect(midPosX - halfsize, midPosY - halfsize, midPosX + halfsize, midPosY + halfsize) glTexture(false) end @@ -913,12 +919,12 @@ local function drawCell(cell, zoom) -- text if not showIcons or not cursorTextures[cmd.cursor] then -- OPTIMIZATION: Use the cached text instead of recalculating it - local text = cmd.cachedText or '?' + local text = cmd.cachedText or "?" -- Cache font metrics per text string to avoid string concat + measurement each draw local textWidth = fontWidthCache[text] if not textWidth then - textWidth = font:GetTextWidth(' ' .. text .. ' ') + textWidth = font:GetTextWidth(" " .. text .. " ") fontWidthCache[text] = textWidth end local textHeight = fontHeightCache[text] @@ -940,8 +946,12 @@ local function drawCell(cell, zoom) textColor = "\255\020\020\020" elseif colorize > 0 and commandInfo[cmd.action] and commandInfo[cmd.action].red then if lastColorize ~= colorize then - for k in pairs(colorStrCache) do colorStrCache[k] = nil end - for k in pairs(printTextCache) do printTextCache[k] = nil end + for k in pairs(colorStrCache) do + colorStrCache[k] = nil + end + for k in pairs(printTextCache) do + printTextCache[k] = nil + end lastColorize = colorize end if not colorStrCache[cmd.action] then @@ -956,7 +966,7 @@ local function drawCell(cell, zoom) end -- Cache the full printable string (textColor .. text) to avoid concat per draw - local printKey = isActiveCmd and ('A_' .. text) or (cmd.action .. '_' .. text) + local printKey = isActiveCmd and ("A_" .. text) or (cmd.action .. "_" .. text) local printStr = printTextCache[printKey] if not printStr then printStr = textColor .. text @@ -1021,7 +1031,7 @@ local function drawCell(cell, zoom) r, g, b, a = 0.1, 1, 0.1, (i == desiredState and 0.26 or 0.8) end else - r, g, b, a = 0, 0, 0, 0.36 -- default off state + r, g, b, a = 0, 0, 0, 0.36 -- default off state end glColor(r, g, b, a) local x1 = math_floor(cellRects[cell][1] + leftMargin + padding + padding2 + (stateWidth * (i - 1)) + (i == 1 and 0 or stateMargin)) @@ -1030,8 +1040,7 @@ local function drawCell(cell, zoom) local y2 = math_ceil(cellRects[cell][2] + bottomMargin + stateHeight + padding2) -- fancy fitting rectrounds if rows < 6 then - RectRound(x1, y1, x2, y2, stateHeight * 0.33, - (i == 1 and 0 or 2), (i == statecount and 0 or 2), (i == statecount and 2 or 0), (i == 1 and 2 or 0)) + RectRound(x1, y1, x2, y2, stateHeight * 0.33, (i == 1 and 0 or 2), (i == statecount and 0 or 2), (i == statecount and 2 or 0), (i == 1 and 2 or 0)) else glRect(x1, y1, x2, y2) end @@ -1053,7 +1062,7 @@ local function drawCell(cell, zoom) end local function drawOrdersBackground() - UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) end local function drawOrders() @@ -1071,16 +1080,16 @@ function widget:DrawScreen() glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) local x, y = Spring.GetMouseState() local cellHovered - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") for cell = 1, #cellRects do if commands[cell] then if math_isInRect(x, y, cellRects[cell][1], cellRects[cell][2], cellRects[cell][3], cellRects[cell][4]) then local cmd = commands[cell] - if WG['tooltip'] then - local tooltipKey = cmd.action .. '_tooltip' - local tooltip = getCachedTranslation('ui.orderMenu.' .. tooltipKey) + if WG["tooltip"] then + local tooltipKey = cmd.action .. "_tooltip" + local tooltip = getCachedTranslation("ui.orderMenu." .. tooltipKey) if not hotkeyCache[cmd.action] then hotkeyCache[cmd.action] = keyConfig.sanitizeKey(actionHotkeys[cmd.action], currentLayout) @@ -1092,36 +1101,36 @@ function widget:DrawScreen() local commandState = OrderMenuFirestate.stateLabel(cmd) local modeDescrKey = commandState and OrderMenuFirestate.descrByState[commandState] if modeDescrKey then - local modeDescr = getCachedTranslation('ui.orderMenu.' .. modeDescrKey) + local modeDescr = getCachedTranslation("ui.orderMenu." .. modeDescrKey) local generalDescr = tooltip - if generalDescr ~= '' and hotkey ~= '' then - generalDescr = getCachedTranslation('ui.orderMenu.hotkeyTooltip', { hotkey = hotkey:upper(), tooltip = generalDescr, highlightColor = "\255\255\215\100", textColor = "\255\240\240\240" }) + if generalDescr ~= "" and hotkey ~= "" then + generalDescr = getCachedTranslation("ui.orderMenu.hotkeyTooltip", { hotkey = hotkey:upper(), tooltip = generalDescr, highlightColor = "\255\255\215\100", textColor = "\255\240\240\240" }) hotkeyApplied = true end - if modeDescr ~= '' and generalDescr ~= '' then + if modeDescr ~= "" and generalDescr ~= "" then tooltip = modeDescr .. "\n" .. generalDescr - elseif modeDescr ~= '' then + elseif modeDescr ~= "" then tooltip = modeDescr - elseif generalDescr ~= '' then + elseif generalDescr ~= "" then tooltip = generalDescr end end end - if tooltip ~= '' and hotkey ~= '' and not hotkeyApplied then - tooltip = getCachedTranslation('ui.orderMenu.hotkeyTooltip', { hotkey = hotkey:upper(), tooltip = tooltip, highlightColor = "\255\255\215\100", textColor = "\255\240\240\240" }) + if tooltip ~= "" and hotkey ~= "" and not hotkeyApplied then + tooltip = getCachedTranslation("ui.orderMenu.hotkeyTooltip", { hotkey = hotkey:upper(), tooltip = tooltip, highlightColor = "\255\255\215\100", textColor = "\255\240\240\240" }) end - if tooltip ~= '' then + if tooltip ~= "" then local title if isStateCommand[cmd.id] then local commandState = (cmd.id == CMD.FIRE_STATE) and OrderMenuFirestate.stateLabel(cmd) or Firestates.stateLabel(cmd) if commandState then - title = getCachedTranslation('ui.orderMenu.' .. commandState) + title = getCachedTranslation("ui.orderMenu." .. commandState) end else - title = getCachedTranslation('ui.orderMenu.' .. cmd.action) + title = getCachedTranslation("ui.orderMenu." .. cmd.action) end - WG['tooltip'].ShowTooltip('ordermenu', tooltip, nil, nil, title) + WG["tooltip"].ShowTooltip("ordermenu", tooltip, nil, nil, title) end end cellHovered = cell @@ -1135,7 +1144,7 @@ function widget:DrawScreen() -- make all cmd's fit in the grid local now = os_clock() - if clickedCellDesiredState and not doUpdateClock then -- make sure state changes get updated + if clickedCellDesiredState and not doUpdateClock then -- make sure state changes get updated doUpdateClock = now + 0.1 end @@ -1161,21 +1170,21 @@ function widget:DrawScreen() end end - if #commands == 0 and (not alwaysShow or spGetGameFrame() == 0) then -- dont show pregame because factions interface is shown - if displayListGuiShader and WG['guishader'] then - WG['guishader'].RemoveDlist('ordermenu') + if #commands == 0 and (not alwaysShow or spGetGameFrame() == 0) then -- dont show pregame because factions interface is shown + if displayListGuiShader and WG["guishader"] then + WG["guishader"].RemoveDlist("ordermenu") end doUpdate = nil else - if displayListGuiShader and WG['guishader'] then - WG['guishader'].InsertDlist(displayListGuiShader, 'ordermenu') + if displayListGuiShader and WG["guishader"] then + WG["guishader"].InsertDlist(displayListGuiShader, "ordermenu") end if doUpdate and displayListOrders then displayListOrders = gl.DeleteList(displayListOrders) end if not ordermenuBgTex then - ordermenuBgTex = gl.CreateTexture(math_floor(width*vsx), math_floor(height*vsy), { + ordermenuBgTex = gl.CreateTexture(math_floor(width * vsx), math_floor(height * vsy), { target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -1185,7 +1194,7 @@ function widget:DrawScreen() end end if not ordermenuTex then - ordermenuTex = gl.CreateTexture(math_floor(width*vsx)*(vsy<1400 and 2 or 1), math_floor(height*vsy)*(vsy<1400 and 2 or 1), { --*(vsy<1400 and 2 or 1) + ordermenuTex = gl.CreateTexture(math_floor(width * vsx) * (vsy < 1400 and 2 or 1), math_floor(height * vsy) * (vsy < 1400 and 2 or 1), { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -1205,12 +1214,12 @@ function widget:DrawScreen() gl.R2tHelper.BlendTexRect(ordermenuTex, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], true) end - if #commands >0 then + if #commands > 0 then -- draw attention highlights (animated, on top of cached content) drawHighlights() -- draw highlight on top of button - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if commands and cellHovered then local cell = cellHovered if cellRects[cell] and cellRects[cell][4] then @@ -1232,7 +1241,7 @@ function widget:DrawScreen() if cell % cols == 0 then rightMargin = cellMarginPx2 end - if cols/cell >= 1 then + if cols / cell >= 1 then topMargin = math_floor(((cellMarginPx + cellMarginPx2) / 2) + 0.5) end @@ -1278,7 +1287,7 @@ function widget:DrawScreen() if cell % cols == 0 then rightMargin = cellMarginPx2 end - if cols/cell >= 1 then + if cols / cell >= 1 then topMargin = math_floor(((cellMarginPx + cellMarginPx2) / 2) + 0.5) end -- gloss highlight @@ -1330,7 +1339,7 @@ function widget:MousePress(x, y, button) end if playSounds then - Spring.PlaySoundFile(soundButton, 0.6, 'ui') + Spring.PlaySoundFile(soundButton, 0.6, "ui") end if cmd.id == CMD.FIRE_STATE and clickedCellDesiredState ~= nil then OrderMenuFirestate.giveVirtualIndex(clickedCellDesiredState, 0) @@ -1422,7 +1431,7 @@ function widget:LanguageChanged() end function widget:GetConfigData() - return { version = 1, colorize = colorize, stickToBottom = stickToBottom, alwaysShow = alwaysShow, disabledCmd = disabledCommand} + return { version = 1, colorize = colorize, stickToBottom = stickToBottom, alwaysShow = alwaysShow, disabledCmd = disabledCommand } end function widget:SetConfigData(data) diff --git a/luaui/Widgets/gui_overview_cam_tab_hold.lua b/luaui/Widgets/gui_overview_cam_tab_hold.lua index dcfc5124ba8..82b77de6110 100644 --- a/luaui/Widgets/gui_overview_cam_tab_hold.lua +++ b/luaui/Widgets/gui_overview_cam_tab_hold.lua @@ -1,4 +1,3 @@ - -- Hold 'tab' button for Overview camera -- Release 'tab' to go back to original view instead zooming into cursor -- Short 'tab' are ignored @@ -13,17 +12,15 @@ function widget:GetInfo() date = "May 8, 2023", license = "GNU GPL, v2 or later", layer = -9999999, - enabled = true + enabled = true, } end - local keyConfig = VFS.Include("luaui/configs/keyboard_layouts.lua") local camKeys = {} -- list of buttons that switch to Overview local isLongPress = false -- enabled when user presses tab for longer local prevCamState = nil - local function setActionHotkeys(action) camKeys = {} local keyTable = Spring.GetActionHotKeys(action) diff --git a/luaui/Widgets/gui_overview_keep_camera_position.lua b/luaui/Widgets/gui_overview_keep_camera_position.lua index 28a1584e106..afbb93754a3 100644 --- a/luaui/Widgets/gui_overview_keep_camera_position.lua +++ b/luaui/Widgets/gui_overview_keep_camera_position.lua @@ -1,4 +1,3 @@ - -- When tabbing out of the overview, the camera DOES NOT "zoom-to-cursor" -- When scrolling out of the overiew, the camera DOES "zoom-to-cursor" @@ -12,7 +11,7 @@ function widget:GetInfo() date = "May 13, 2023", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end @@ -48,18 +47,19 @@ local function isOverview() return Spring.GetCameraState().name == "ov" end - function widget:MouseWheel(up, value) if isOverview() and up then Spring.SendCommands({ "toggleoverview" }) - return true; + return true end return false end function widget:KeyPress(key, modifier) - if not isCamKey(key) then return end + if not isCamKey(key) then + return + end if isOverview() then if prevCamState ~= nil then Spring.SetCameraState(prevCamState, 1) @@ -68,4 +68,3 @@ function widget:KeyPress(key, modifier) prevCamState = Spring.GetCameraState() end end - diff --git a/luaui/Widgets/gui_pausescreen.lua b/luaui/Widgets/gui_pausescreen.lua index 0c13b2bba98..5ffaf362af9 100644 --- a/luaui/Widgets/gui_pausescreen.lua +++ b/luaui/Widgets/gui_pausescreen.lua @@ -11,11 +11,10 @@ function widget:GetInfo() date = "sept 2016", license = "GNU GPL, v2 or later", layer = 999999, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry @@ -38,7 +37,6 @@ local glGetUniformLocation = gl.GetUniformLocation local osClock = os.clock - ---------------------------------------------------------------------------------- -- CONFIGURATION @@ -54,7 +52,7 @@ local font = gl.LoadFont(fontfile, fontfileSize * fontfileScale, fontfileOutline local sizeMultiplier = 1 local maxAlpha = 0.65 local maxShaderAlpha = 0.25 -local maxNonShaderAlpha = 0.12 --background alpha when shaders arent availible +local maxNonShaderAlpha = 0.12 --background alpha when shaders arent availible local boxWidth = 200 local boxHeight = 35 local slideTime = 0.12 @@ -88,8 +86,6 @@ local spIsGUIHidden = Spring.IsGUIHidden local textColor = { 1.0, 1.0, 1.0, 0 } local outlineColor = { 0.0, 0.0, 0.0, 0 } - - --intensity formula based on http://alienryderflex.com/hsp.html local fragmentShaderSource = [[ #version 150 compatibility @@ -225,14 +221,14 @@ local function drawPause(now) glTranslate(((vsx - wndX1) / usedSizeMultiplier) * (1.0 - (diffPauseTime / slideTime)), 0, 0) else --sliding out - glTranslate(((vsx - wndX1) / usedSizeMultiplier) * ((diffPauseTime / slideTime)), 0, 0) + glTranslate(((vsx - wndX1) / usedSizeMultiplier) * (diffPauseTime / slideTime), 0, 0) end end --draw text if not gameover then if not cachedPauseText then - cachedPauseText = Spring.I18N('ui.pauseScreen.paused') + cachedPauseText = Spring.I18N("ui.pauseScreen.paused") end font:Begin() font:SetOutlineColor(outlineColor) @@ -255,14 +251,12 @@ function widget:Initialize() end if gl.CreateShader then - shaderProgram = gl.CreateShader( - { - fragment = fragmentShaderSource, - uniformInt = { - screencopy = 0, - }, - } - ) + shaderProgram = gl.CreateShader({ + fragment = fragmentShaderSource, + uniformInt = { + screencopy = 0, + }, + }) if shaderProgram then alphaLoc = glGetUniformLocation(shaderProgram, "alpha") end @@ -319,7 +313,7 @@ function widget:DrawScreenEffects() if spIsGUIHidden() then return end - if shaderProgram and showPauseScreen and WG['screencopymanager'] and WG['screencopymanager'].GetScreenCopy then + if shaderProgram and showPauseScreen and WG["screencopymanager"] and WG["screencopymanager"].GetScreenCopy then glCopyToTexture(screencopy, 0, 0, vpx, vpy, vsx, vsy) --screencopy = WG['screencopymanager'].GetScreenCopy() -- cant get this method to work glTexture(0, screencopy) diff --git a/luaui/Widgets/gui_pip.lua b/luaui/Widgets/gui_pip.lua index 3d862ce3d82..2b5db43c374 100644 --- a/luaui/Widgets/gui_pip.lua +++ b/luaui/Widgets/gui_pip.lua @@ -5,9 +5,9 @@ local isSpectator = Spring.GetSpectatingState() pipNumber = pipNumber or 1 -- Special mode flags -local isMinimapMode = (pipNumber == 0) -- When pipNumber == 0, act as minimap replacement -local minimapModeMinZoom = nil -- Calculated zoom to fit entire map (only used in minimap mode) -local pipModeMinZoom = nil -- Dynamic min zoom calculated from PIP/map dimensions (normal PIP mode) +local isMinimapMode = (pipNumber == 0) -- When pipNumber == 0, act as minimap replacement +local minimapModeMinZoom = nil -- Calculated zoom to fit entire map (only used in minimap mode) +local pipModeMinZoom = nil -- Dynamic min zoom calculated from PIP/map dimensions (normal PIP mode) -- Minimap mode API state (updated each frame, avoids per-frame closure allocations) local minimapApi = { left = 0, right = 1, bottom = 1, top = 0, zoom = 1 } @@ -23,8 +23,6 @@ local config -- Helper function to get effective zoom minimum (accounts for minimap mode)]]]]]]]]]]]] - - local function GetEffectiveZoomMin() if isMinimapMode and minimapModeMinZoom then return minimapModeMinZoom @@ -41,7 +39,7 @@ end -- Helper function to check if at minimum zoom (fully zoomed out) in minimap mode local function IsAtMinimumZoom(zoom) if isMinimapMode and minimapModeMinZoom then - return zoom <= minimapModeMinZoom * 1.02 -- 2% tolerance for floating point and smooth zooming + return zoom <= minimapModeMinZoom * 1.02 -- 2% tolerance for floating point and smooth zooming end return false end @@ -57,16 +55,16 @@ end function widget:GetInfo() return { - name = "Picture-in-Picture", - desc = "", - author = "Floris", -- (original by Niobium created in 2010) - version = "2.0", - date = "October 2025", - license = "GNU GPL, v2 or later", - layer = -(99020-pipNumber), - enabled = false, - handler = true, - dependents = { -- for widget auto reloader to reload these as well + name = "Picture-in-Picture", + desc = "", + author = "Floris", -- (original by Niobium created in 2010) + version = "2.0", + date = "October 2025", + license = "GNU GPL, v2 or later", + layer = -(99020 - pipNumber), + enabled = false, + handler = true, + dependents = { -- for widget auto reloader to reload these as well "Picture-in-Picture Minimap", "Picture-in-Picture 2", }, @@ -111,10 +109,10 @@ end ---------------------------------------------------------------------------------------------------- config = { -- UI colors and sizing - panelBorderColorLight = {0.75, 0.75, 0.75, 1}, - panelBorderColorDark = {0.2, 0.2, 0.2, 1}, + panelBorderColorLight = { 0.75, 0.75, 0.75, 1 }, + panelBorderColorDark = { 0.2, 0.2, 0.2, 1 }, minPanelSize = 330, - maxPanelSizeVsy = 0.4, -- Maximum size as fraction of vertical screen resolution + maxPanelSizeVsy = 0.4, -- Maximum size as fraction of vertical screen resolution buttonSize = 50, -- Zoom settings @@ -128,61 +126,61 @@ config = { zoomMin = 0.04, zoomMax = 2, zoomFeatures = 0.2, - zoomFeaturesFadeRange = 0.06, -- Zoom range over which features fade in/out + zoomFeaturesFadeRange = 0.06, -- Zoom range over which features fade in/out zoomProjectileDetail = 0.12, - zoomExplosionDetail = 0.12, -- Legacy, now using graduated visibility - drawExplosions = true, -- Separate from projectiles - drawPlasmaTrails = true, -- Show fading trails behind plasma/artillery projectiles - trailSkipThreshold = 100, -- Skip missile/plasma trails when drawn projectile count exceeds this (0 = never skip) - iconPosRefreshThreshold = 4000, -- Cache mobile unit positions above this count (refresh 1/3 per frame) - iconGhostSkipThreshold = 6000, -- Skip ghost building pass above this count - iconMobileBlockThreshold = 5000, -- Cache mobile VBO data above this count (rebuild every 2nd frame) - explosionOverlay = true, -- Re-render explosions on top of unit icons (additive glow) - explosionOverlayAlpha = 0.66, -- Strength of the above-icons explosion overlay (0-1) - healthDarkenMax = 0.2, -- Maximum darkening for damaged units on GL4 icons (0-1, 0.18 = 18%) - activityFocusIgnoreSpectators = true, -- Don't trigger camera focus for spectator map markers - activityFocusHideForSpectators = true, -- Hide the activity focus button when spectating (default: disabled for spectators) - activityFocusDuration = 0.25, -- Seconds to hold focus on a marker before restoring camera - activityFocusZoomInTime = 1.75, -- Seconds for the zoom-in transition (smoothstep ease-in-out) - activityFocusZoomOutTime = 1.3, -- Seconds for the zoom-out transition (smoothstep ease-in-out) - activityFocusZoom = 0.15, -- Zoom level when focusing on a marker (higher = more zoomed in) - activityFocusShowMinimap = true, -- Temporarily show pip-minimap overlay while focused on a map marker - activityFocusBlockIgnoredPlayers = true, -- Completely block activity focus for players on your ignore list (WG.ignoredAccounts) - activityFocusCooldown = 3, -- Minimum seconds between focus triggers from the same player - activityFocusThrottleWindow = 10, -- Time window (seconds) to count markers from a player - activityFocusThrottleCount = 3, -- After this many markers in the window, ignore that player temporarily - activityFocusThrottleDuration = 15, -- Seconds to ignore a throttled player - activityFocusMuteCount = 6, -- After this many markers in the window, mute that player entirely - activityFocusMuteDuration = 60, -- Seconds to mute a heavily spamming player + zoomExplosionDetail = 0.12, -- Legacy, now using graduated visibility + drawExplosions = true, -- Separate from projectiles + drawPlasmaTrails = true, -- Show fading trails behind plasma/artillery projectiles + trailSkipThreshold = 100, -- Skip missile/plasma trails when drawn projectile count exceeds this (0 = never skip) + iconPosRefreshThreshold = 4000, -- Cache mobile unit positions above this count (refresh 1/3 per frame) + iconGhostSkipThreshold = 6000, -- Skip ghost building pass above this count + iconMobileBlockThreshold = 5000, -- Cache mobile VBO data above this count (rebuild every 2nd frame) + explosionOverlay = true, -- Re-render explosions on top of unit icons (additive glow) + explosionOverlayAlpha = 0.66, -- Strength of the above-icons explosion overlay (0-1) + healthDarkenMax = 0.2, -- Maximum darkening for damaged units on GL4 icons (0-1, 0.18 = 18%) + activityFocusIgnoreSpectators = true, -- Don't trigger camera focus for spectator map markers + activityFocusHideForSpectators = true, -- Hide the activity focus button when spectating (default: disabled for spectators) + activityFocusDuration = 0.25, -- Seconds to hold focus on a marker before restoring camera + activityFocusZoomInTime = 1.75, -- Seconds for the zoom-in transition (smoothstep ease-in-out) + activityFocusZoomOutTime = 1.3, -- Seconds for the zoom-out transition (smoothstep ease-in-out) + activityFocusZoom = 0.15, -- Zoom level when focusing on a marker (higher = more zoomed in) + activityFocusShowMinimap = true, -- Temporarily show pip-minimap overlay while focused on a map marker + activityFocusBlockIgnoredPlayers = true, -- Completely block activity focus for players on your ignore list (WG.ignoredAccounts) + activityFocusCooldown = 3, -- Minimum seconds between focus triggers from the same player + activityFocusThrottleWindow = 10, -- Time window (seconds) to count markers from a player + activityFocusThrottleCount = 3, -- After this many markers in the window, ignore that player temporarily + activityFocusThrottleDuration = 15, -- Seconds to ignore a throttled player + activityFocusMuteCount = 6, -- After this many markers in the window, mute that player entirely + activityFocusMuteDuration = 60, -- Seconds to mute a heavily spamming player -- TV mode settings (spectator auto-camera) - tvModeSpectatorsOnly = true, -- Only allow TV mode for spectators - tvMaxZoom = 0.63, -- Maximum zoom level for TV mode (never close enough for unitpics) - tvMinZoom = 0.08, -- Minimum zoom level for TV overview shots - tvOverviewZoom = 0.07, -- Zoom level for periodic overview shots (wider view of the map) - tvCloseupZoom = 0.45, -- Zoom level for close-up action shots - tvFocusDuration = 6.0, -- Base seconds to hold focus on a hotspot before considering switch - tvOverviewDuration = 2.5, -- Seconds to hold an overview shot - tvOverviewInterval = 18, -- Seconds between periodic overview shots - tvSwitchCooldown = 3.5, -- Minimum seconds between camera switches - tvEventDecayTime = 12, -- Seconds for events to fully decay - tvHotspotRadius = 800, -- World units: events within this distance merge into one hotspot - tvMaxEvents = 200, -- Max tracked events (ring buffer) - tvVarietyBonus = 0.3, -- Weight bonus for unvisited areas (0-1) - tvPanSpeed = 3.0, -- Camera pan smoothness (higher = faster convergence) - tvZoomSpeed = 2.5, -- Camera zoom smoothness - tvUnitFinishedCostThreshold = 800, -- Minimum unit cost to trigger a "big unit finished" event - - iconDensityScaling = true, -- Reduce icon sizes when unit count is high (prevents overlap at zoomed-out levels) - iconDensityMaxUnits = 18000, -- Unit count at which maximum reduction is reached - iconDensityMinScale = 0.5, -- Minimum icon scale at max unit count (0.5 = 50% size) - iconDensityZoomFadeStart = 0.3, -- Zoom level above which density scaling starts fading out (1.0 = fully zoomed in) - iconDensityZoomFadeEnd = 0.8, -- Zoom level above which density scaling is completely off - - drawDecals = true, -- Show ground decals (explosion scars, footprints) from the decals GL4 widget - drawCommandFX = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, -- Show brief fading command lines when orders are given (like Commands FX widget) - commandFXIgnoreNewUnits = true, -- Ignore commands given to newly finished units (rally point orders) - commandFXOpacity = 0.2, -- Initial opacity of command FX lines - commandFXDuration = 0.66, -- Seconds for command FX lines to fully fade out + tvModeSpectatorsOnly = true, -- Only allow TV mode for spectators + tvMaxZoom = 0.63, -- Maximum zoom level for TV mode (never close enough for unitpics) + tvMinZoom = 0.08, -- Minimum zoom level for TV overview shots + tvOverviewZoom = 0.07, -- Zoom level for periodic overview shots (wider view of the map) + tvCloseupZoom = 0.45, -- Zoom level for close-up action shots + tvFocusDuration = 6.0, -- Base seconds to hold focus on a hotspot before considering switch + tvOverviewDuration = 2.5, -- Seconds to hold an overview shot + tvOverviewInterval = 18, -- Seconds between periodic overview shots + tvSwitchCooldown = 3.5, -- Minimum seconds between camera switches + tvEventDecayTime = 12, -- Seconds for events to fully decay + tvHotspotRadius = 800, -- World units: events within this distance merge into one hotspot + tvMaxEvents = 200, -- Max tracked events (ring buffer) + tvVarietyBonus = 0.3, -- Weight bonus for unvisited areas (0-1) + tvPanSpeed = 3.0, -- Camera pan smoothness (higher = faster convergence) + tvZoomSpeed = 2.5, -- Camera zoom smoothness + tvUnitFinishedCostThreshold = 800, -- Minimum unit cost to trigger a "big unit finished" event + + iconDensityScaling = true, -- Reduce icon sizes when unit count is high (prevents overlap at zoomed-out levels) + iconDensityMaxUnits = 18000, -- Unit count at which maximum reduction is reached + iconDensityMinScale = 0.5, -- Minimum icon scale at max unit count (0.5 = 50% size) + iconDensityZoomFadeStart = 0.3, -- Zoom level above which density scaling starts fading out (1.0 = fully zoomed in) + iconDensityZoomFadeEnd = 0.8, -- Zoom level above which density scaling is completely off + + drawDecals = true, -- Show ground decals (explosion scars, footprints) from the decals GL4 widget + drawCommandFX = Spring.GetConfigInt("PipDrawCommandFX", 1) == 1, -- Show brief fading command lines when orders are given (like Commands FX widget) + commandFXIgnoreNewUnits = true, -- Ignore commands given to newly finished units (rally point orders) + commandFXOpacity = 0.2, -- Initial opacity of command FX lines + commandFXDuration = 0.66, -- Seconds for command FX lines to fully fade out -- Feature and overlay settings hideEnergyOnlyFeatures = false, @@ -190,74 +188,74 @@ config = { showLosOverlay = true, showLosRadar = true, losOverlayOpacity = 0.6, - allowCommandsWhenSpectating = false, -- Allow giving commands as spectator when god mode is enabled + allowCommandsWhenSpectating = false, -- Allow giving commands as spectator when god mode is enabled -- Rendering settings iconRadius = 40, - showUnitpics = true, -- Show unitpics instead of icons when zoomed in + showUnitpics = true, -- Show unitpics instead of icons when zoomed in unitpicZoomThreshold = 0.75, -- Zoom level at which to switch to unitpics (higher = more zoomed in) - drawComNametags = true, -- Draw player names above commander icons + drawComNametags = true, -- Draw player names above commander icons comNametagZoomThreshold = 0.18, -- Minimum zoom to show nametags (below this they'd overlap) - drawComHealthBars = true, -- Draw health bars below commander icons when health < 99% + drawComHealthBars = true, -- Draw health bars below commander icons when health < 99% leftButtonPansCamera = isMinimapMode and (Spring.GetConfigInt("MinimapLeftClickMove", 1) == 1) or false, maximizeSizemult = 1.25, screenMargin = 0.00, drawProjectiles = true, zoomToCursor = true, - altKeyRequiredForZoom = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, -- When true, scrolling over the PIP only zooms if ALT is held (otherwise passes through to the game) + altKeyRequiredForZoom = Spring.GetConfigInt("PipAltKeyRequiredForZoom", 1) == 1, -- When true, scrolling over the PIP only zooms if ALT is held (otherwise passes through to the game) mapEdgeMargin = 0, showButtonsOnHoverOnly = true, switchInheritsTracking = false, switchTransitionTime = 0.15, showMapRuler = false, - cancelPlayerTrackingOnPan = true, -- Cancel player camera tracking when trying to pan or ALT+drag - pipMinimapCorner = 3, -- Corner for pip minimap: 1=bottom-left, 2=bottom-right, 3=top-left, 4=top-right - minimapHeightPercent = 0.12, -- Minimap height as percent of PIP height (maintains aspect ratio) - minimapHoverHeightPercent = 0.15, -- Minimap height when hovering over PIP + cancelPlayerTrackingOnPan = true, -- Cancel player camera tracking when trying to pan or ALT+drag + pipMinimapCorner = 3, -- Corner for pip minimap: 1=bottom-left, 2=bottom-right, 3=top-left, 4=top-right + minimapHeightPercent = 0.12, -- Minimap height as percent of PIP height (maintains aspect ratio) + minimapHoverHeightPercent = 0.15, -- Minimap height when hovering over PIP -- Performance settings showPipFps = false, - showPipTimers = false, -- Echo per-section timing breakdown to Spring.Echo (debug) - contentResolutionScale = 2, -- Render texture at this multiple of PIP size (1 = 1:1, 2 = 2x resolution for (marginally) sharper content) - smoothCameraMargin = 0.05, -- Oversized texture margin for expensive layers (units, features, projectiles) - smoothCameraMarginCheap = 0.15, -- Oversized texture margin for cheap layers (ground, water, LOS) — larger since rendering is cheap - pipFloorUpdateRate = 10, -- Minimum update rate for PIP content when performance is poor (will be smoothly applied based on measured frame times) - pipMinUpdateRate = 30, -- Minimum update rate for PIP content when zoomed out - pipMaxUpdateRate = 60, -- Maximum update rate for PIP content when zoomed in + showPipTimers = false, -- Echo per-section timing breakdown to Spring.Echo (debug) + contentResolutionScale = 2, -- Render texture at this multiple of PIP size (1 = 1:1, 2 = 2x resolution for (marginally) sharper content) + smoothCameraMargin = 0.05, -- Oversized texture margin for expensive layers (units, features, projectiles) + smoothCameraMarginCheap = 0.15, -- Oversized texture margin for cheap layers (ground, water, LOS) — larger since rendering is cheap + pipFloorUpdateRate = 10, -- Minimum update rate for PIP content when performance is poor (will be smoothly applied based on measured frame times) + pipMinUpdateRate = 30, -- Minimum update rate for PIP content when zoomed out + pipMaxUpdateRate = 60, -- Maximum update rate for PIP content when zoomed in pipZoomThresholdMin = 0.15, pipZoomThresholdMax = 0.4, pipTargetDrawTime = 0.0025, - pipPerformanceAdjustSpeed = 0.1, -- Exponential smoothing factor (0-1) for the performance rate-limiter. Each frame, contentPerformanceFactor lerps toward its target by this fraction: higher = faster reaction to GPU load spikes, lower = smoother but slower adaptation. - pipFrameTimeThreshold = 0.007, -- threshold before starting to lower FPS - pipFrameTimeHistorySize = 10, -- Number of frames to average + pipPerformanceAdjustSpeed = 0.1, -- Exponential smoothing factor (0-1) for the performance rate-limiter. Each frame, contentPerformanceFactor lerps toward its target by this fraction: higher = faster reaction to GPU load spikes, lower = smoother but slower adaptation. + pipFrameTimeThreshold = 0.007, -- threshold before starting to lower FPS + pipFrameTimeHistorySize = 10, -- Number of frames to average CMD_AREA_MEX = GameCMD and GameCMD.AREA_MEX or 10000, -- Middle-click teleport settings (click without drag moves world camera to clicked position) - middleClickTeleport = true, -- Enable middle-click to teleport world camera - middleClickZoomMin = 0.2, -- Maximum zoom in for teleport (lower = more zoomed in) - middleClickZoomMax = 0.95, -- Maximum zoom out for teleport (higher = more zoomed out) - middleClickZoomOffset = -0.18, -- Teleport slightly more zoomed out than PIP (0 = same as PIP) - minimapMiddleClickZoomMin = 0.2, -- auto zoom in to this zoom level - minimapMiddleClickZoomMax = 0.95, -- auto zoom out to this zoom level + middleClickTeleport = true, -- Enable middle-click to teleport world camera + middleClickZoomMin = 0.2, -- Maximum zoom in for teleport (lower = more zoomed in) + middleClickZoomMax = 0.95, -- Maximum zoom out for teleport (higher = more zoomed out) + middleClickZoomOffset = -0.18, -- Teleport slightly more zoomed out than PIP (0 = same as PIP) + minimapMiddleClickZoomMin = 0.2, -- auto zoom in to this zoom level + minimapMiddleClickZoomMax = 0.95, -- auto zoom out to this zoom level -- Minimap mode settings (when pipNumber == 0) - minimapModeMaxHeight = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), -- Shared with gui_minimap.lua via ConfigFloat - minimapModeMaxWidth = 0.25, -- Max width as fraction of screen width - minimapModeScreenMargin = 0, -- No margin in minimap mode (edge-to-edge) - minimapModeShowButtons = false, -- Hide buttons in minimap mode - minimapModeShowMinimizeButton = false, -- Show the minimize/maximize button on the pip-as-minimap (default off) - minimapModeStartMinimized = false, -- Don't start minimized in minimap mode - minimapModeHideMoveResize = true, -- Hide move and resize buttons in minimap mode - autoMaximizeOnGameStart = false, -- Automatically maximize PIP when the game starts (players only, not spectators) - hideAICommands = true, -- Hide command queues from AI players (default: enabled) - showSpectatorPings = true, -- Show map pings from spectators on the PIP minimap - showViewRectangleOnMinimap = false, -- Show the PIP view rectangle on the engine minimap - showViewRectangleInWorld = false, -- Show the PIP view rectangle as an outline in the 3D world - engineMinimapFallback = true, -- Use engine minimap when fully zoomed out (performance fallback) - engineMinimapFallbackThreshold = 4000, -- Unit count threshold before engine minimap fallback activates - engineMinimapExplosionOverlay = true, -- Draw explosion overlay on top of engine minimap - engineMinimapDecalStrength = 0.8, -- Decal overlay strength on engine minimap (0-1, lower = subtler scorch marks) decals do overlap with the engine minimap (unit icons), so this can be used to reduce their prominence if desired + minimapModeMaxHeight = Spring.GetConfigFloat("MinimapMaxHeight", 0.32), -- Shared with gui_minimap.lua via ConfigFloat + minimapModeMaxWidth = 0.25, -- Max width as fraction of screen width + minimapModeScreenMargin = 0, -- No margin in minimap mode (edge-to-edge) + minimapModeShowButtons = false, -- Hide buttons in minimap mode + minimapModeShowMinimizeButton = false, -- Show the minimize/maximize button on the pip-as-minimap (default off) + minimapModeStartMinimized = false, -- Don't start minimized in minimap mode + minimapModeHideMoveResize = true, -- Hide move and resize buttons in minimap mode + autoMaximizeOnGameStart = false, -- Automatically maximize PIP when the game starts (players only, not spectators) + hideAICommands = true, -- Hide command queues from AI players (default: enabled) + showSpectatorPings = true, -- Show map pings from spectators on the PIP minimap + showViewRectangleOnMinimap = false, -- Show the PIP view rectangle on the engine minimap + showViewRectangleInWorld = false, -- Show the PIP view rectangle as an outline in the 3D world + engineMinimapFallback = true, -- Use engine minimap when fully zoomed out (performance fallback) + engineMinimapFallbackThreshold = 4000, -- Unit count threshold before engine minimap fallback activates + engineMinimapExplosionOverlay = true, -- Draw explosion overlay on top of engine minimap + engineMinimapDecalStrength = 0.8, -- Decal overlay strength on engine minimap (0-1, lower = subtler scorch marks) decals do overlap with the engine minimap (unit icons), so this can be used to reduce their prominence if desired } -- State variables @@ -282,30 +280,30 @@ local render = { RectRound = nil, UiElement = nil, RectRoundOutline = nil, - dim = {}, -- Panel dimensions: left, right, bottom, top - world = {l=0, r=0, b=0, t=0}, -- World coordinate boundaries - ground = { view = {l=0, r=0, b=0, t=0}, coord = {l=0, r=1, b=1, t=0} }, -- Ground texture view and texture coordinates - minModeDlist = nil, -- Display list for minimized mode button - mapRulerDlist = nil, -- Display list for map ruler marks - mapRulerCacheKey = nil, -- Cache key to detect when ruler needs regeneration - mapRulerMarkDlists = {}, -- Reusable mark pattern display lists - mapRulerLastMarkSize = nil, -- Track mark size changes - minimapRotation = 0, -- Current minimap rotation in radians - guishaderDlist = nil, -- Display list for guishader blur with rounded corners + dim = {}, -- Panel dimensions: left, right, bottom, top + world = { l = 0, r = 0, b = 0, t = 0 }, -- World coordinate boundaries + ground = { view = { l = 0, r = 0, b = 0, t = 0 }, coord = { l = 0, r = 1, b = 1, t = 0 } }, -- Ground texture view and texture coordinates + minModeDlist = nil, -- Display list for minimized mode button + mapRulerDlist = nil, -- Display list for map ruler marks + mapRulerCacheKey = nil, -- Cache key to detect when ruler needs regeneration + mapRulerMarkDlists = {}, -- Reusable mark pattern display lists + mapRulerLastMarkSize = nil, -- Track mark size changes + minimapRotation = 0, -- Current minimap rotation in radians + guishaderDlist = nil, -- Display list for guishader blur with rounded corners } -- Initialize render dimensions render.vsx, render.vsy = Spring.GetViewGeometry() render.widgetScale = (render.vsy / 2000) * render.uiScale render.usedButtonSize = math.floor(config.buttonSize * render.widgetScale * render.uiScale) -render.dim.l = math.floor(render.vsx*0.7) -render.dim.r = math.floor((render.vsx*0.7)+(config.minPanelSize*render.widgetScale*1.4)) -render.dim.b = math.floor(render.vsy*0.7) -render.dim.t = math.floor((render.vsy*0.7)+(config.minPanelSize*render.widgetScale*1.2)) +render.dim.l = math.floor(render.vsx * 0.7) +render.dim.r = math.floor((render.vsx * 0.7) + (config.minPanelSize * render.widgetScale * 1.4)) +render.dim.b = math.floor(render.vsy * 0.7) +render.dim.t = math.floor((render.vsy * 0.7) + (config.minPanelSize * render.widgetScale * 1.2)) -- Consolidated camera state local cameraState = { - zoom = 0.55, -- Current zoom level + zoom = 0.55, -- Current zoom level targetZoom = 0.55, wcx = 1000, wcz = 1000, @@ -338,23 +336,23 @@ local uiState = { -- Render-to-texture state (consolidated to reduce local variable count) local pipR2T = { contentTex = nil, - contentInvalidInfoStreak = 0, -- Consecutive invalid TextureInfo reads for contentTex + contentInvalidInfoStreak = 0, -- Consecutive invalid TextureInfo reads for contentTex contentNeedsUpdate = true, contentLastUpdateTime = 0, contentCurrentUpdateRate = config.pipMinUpdateRate, contentLastWidth = 0, contentLastHeight = 0, - contentTexWidth = 0, -- Actual oversized texture width in pixels - contentTexHeight = 0, -- Actual oversized texture height in pixels - contentWcx = 0, -- Camera X when contentTex was rendered - contentWcz = 0, -- Camera Z when contentTex was rendered - contentZoom = 0, -- Zoom when contentTex was rendered - contentRotation = 0, -- Rotation when contentTex was rendered - contentLastDrawTime = 0, -- Last measured draw time for performance monitoring - contentDrawTimeHistory = {}, -- Ring buffer of last 6 frame times - contentDrawTimeHistoryIndex = 0, -- Current index in ring buffer - contentDrawTimeAverage = 0, -- Average of last 6 frame times - contentPerformanceFactor = 1.0, -- Multiplier applied to update rate based on performance (1.0 = no adjustment) + contentTexWidth = 0, -- Actual oversized texture width in pixels + contentTexHeight = 0, -- Actual oversized texture height in pixels + contentWcx = 0, -- Camera X when contentTex was rendered + contentWcz = 0, -- Camera Z when contentTex was rendered + contentZoom = 0, -- Zoom when contentTex was rendered + contentRotation = 0, -- Rotation when contentTex was rendered + contentLastDrawTime = 0, -- Last measured draw time for performance monitoring + contentDrawTimeHistory = {}, -- Ring buffer of last 6 frame times + contentDrawTimeHistoryIndex = 0, -- Current index in ring buffer + contentDrawTimeAverage = 0, -- Average of last 6 frame times + contentPerformanceFactor = 1.0, -- Multiplier applied to update rate based on performance (1.0 = no adjustment) frameBackgroundTex = nil, frameButtonsTex = nil, frameNeedsUpdate = true, @@ -370,47 +368,47 @@ local pipR2T = { losTex = nil, losNeedsUpdate = true, losLastUpdateTime = 0, - losUpdateRate = 0.4, -- Update every 0.4 seconds - losTexScale = 96, -- 96:1 ratio of map size to LOS texture size - losLastMode = nil, -- Track whether last update used engine or manual LOS - losEngineDelayFrames = 0, -- Delay frames before switching to engine LOS to let it update + losUpdateRate = 0.4, -- Update every 0.4 seconds + losTexScale = 96, -- 96:1 ratio of map size to LOS texture size + losLastMode = nil, -- Track whether last update used engine or manual LOS + losEngineDelayFrames = 0, -- Delay frames before switching to engine LOS to let it update -- Map ruler texture state rulerTex = nil, rulerNeedsUpdate = true, - rulerCacheKey = nil, -- Cache key to detect significant changes + rulerCacheKey = nil, -- Cache key to detect significant changes -- Tracked player overlay cache resbarTextDlist = nil, resbarTextLastUpdate = 0, - resbarTextUpdateRate = 0.5, -- Update resource text at 2 FPS + resbarTextUpdateRate = 0.5, -- Update resource text at 2 FPS resbarTextLastPlayerID = nil, playerNameDlist = nil, playerNameLastPlayerID = nil, playerNameLastName = nil, -- Smooth camera: oversized units texture for camera-transition interpolation - unitsTex = nil, -- Oversized FBO for expensive content (units, features, projectiles, etc.) - unitsInvalidInfoStreak = 0, -- Consecutive invalid TextureInfo reads for unitsTex - unitsTexWidth = 0, -- Actual texture width in pixels - unitsTexHeight = 0, -- Actual texture height in pixels - unitsLastWidth = 0, -- Last PIP width used to create unitsTex - unitsLastHeight = 0, -- Last PIP height used to create unitsTex - unitsWorld = { l = 0, r = 0, b = 0, t = 0 }, -- World coordinates when unitsTex was rendered - unitsZoom = 0, -- Camera zoom when unitsTex was rendered - unitsRotation = 0, -- Minimap rotation when unitsTex was rendered - unitsWcx = 0, -- Camera X position when unitsTex was rendered - unitsWcz = 0, -- Camera Z position when unitsTex was rendered - unitsNeedsUpdate = true, -- Flag to force unitsTex re-render - unitsLastUpdateTime = 0, -- Last time unitsTex was rendered + unitsTex = nil, -- Oversized FBO for expensive content (units, features, projectiles, etc.) + unitsInvalidInfoStreak = 0, -- Consecutive invalid TextureInfo reads for unitsTex + unitsTexWidth = 0, -- Actual texture width in pixels + unitsTexHeight = 0, -- Actual texture height in pixels + unitsLastWidth = 0, -- Last PIP width used to create unitsTex + unitsLastHeight = 0, -- Last PIP height used to create unitsTex + unitsWorld = { l = 0, r = 0, b = 0, t = 0 }, -- World coordinates when unitsTex was rendered + unitsZoom = 0, -- Camera zoom when unitsTex was rendered + unitsRotation = 0, -- Minimap rotation when unitsTex was rendered + unitsWcx = 0, -- Camera X position when unitsTex was rendered + unitsWcz = 0, -- Camera Z position when unitsTex was rendered + unitsNeedsUpdate = true, -- Flag to force unitsTex re-render + unitsLastUpdateTime = 0, -- Last time unitsTex was rendered -- Decal overlay texture state (render-to-texture) decalTex = nil, - decalLastCheckFrame = 0, -- last frame we ran the dirty check - decalCheckInterval = 30, -- game frames between dirty checks (~1 second) - decalTexScale = 5, -- X:1 ratio of map size to decal texture size + decalLastCheckFrame = 0, -- last frame we ran the dirty check + decalCheckInterval = 30, -- game frames between dirty checks (~1 second) + decalTexScale = 5, -- X:1 ratio of map size to decal texture size -- Grace period: after ViewResize or GL state disruption, force re-render for several -- frames so cached textures aren't stale (engine textures like $minimap may need a -- frame or two to become valid again after graphics preset changes). forceRefreshFrames = 0, } -render.minModeDlist = nil -- Display list for minimized mode button +render.minModeDlist = nil -- Display list for minimized mode button -- Consolidated interaction state local interactionState = { @@ -426,11 +424,11 @@ local interactionState = { leftMousePressed = false, rightMousePressed = false, areCentering = false, - areDecreasingZoom = false, -- Pulling back (decreasing zoom value) - areIncreasingZoom = false, -- Getting closer (increasing zoom value) + areDecreasingZoom = false, -- Pulling back (decreasing zoom value) + areIncreasingZoom = false, -- Getting closer (increasing zoom value) areTracking = nil, trackingPlayerID = nil, - lastTrackedTeammate = nil, -- Track last cycled teammate for proper cycling order + lastTrackedTeammate = nil, -- Track last cycled teammate for proper cycling order areBoxSelecting = false, areBoxDeselecting = false, boxSelectStartX = 0, @@ -438,7 +436,7 @@ local interactionState = { boxSelectEndX = 0, boxSelectEndY = 0, lastBoxSelectUpdate = 0, - lastModifierState = {false, false, false, false}, + lastModifierState = { false, false, false, false }, selectionBeforeBox = nil, -- Store selection before box selection starts areFormationDragging = false, formationDragStartX = 0, @@ -458,15 +456,15 @@ local interactionState = { lastHoverCheckTime = 0, lastHoverCheckX = 0, lastHoverCheckY = 0, - minimizeButtonDragging = false, -- Whether we're dragging via minimize button to move PIP window - minimizeButtonClickStartX = 0, -- Screen X when we started clicking minimize button - minimizeButtonClickStartY = 0, -- Screen Y when we started clicking minimize button - pipMinimapBounds = nil, -- {l, r, b, t} bounds of pip-minimap when visible, nil otherwise - pipMinimapDragging = false, -- Whether we're dragging the pip-minimap to move camera - worldCameraDragging = false, -- Whether we're left-click dragging to move the world camera (leftButtonPansCamera mode) - lastHoverCursorCheckTime = 0, -- Throttle timer for GetUnitAtPoint hover checks - lastHoveredUnitID = nil, -- Last unit found under cursor (for cursor icon updates) - lastHoveredFeatureID = nil, -- Last feature found under cursor (for info widget) + minimizeButtonDragging = false, -- Whether we're dragging via minimize button to move PIP window + minimizeButtonClickStartX = 0, -- Screen X when we started clicking minimize button + minimizeButtonClickStartY = 0, -- Screen Y when we started clicking minimize button + pipMinimapBounds = nil, -- {l, r, b, t} bounds of pip-minimap when visible, nil otherwise + pipMinimapDragging = false, -- Whether we're dragging the pip-minimap to move camera + worldCameraDragging = false, -- Whether we're left-click dragging to move the world camera (leftButtonPansCamera mode) + lastHoverCursorCheckTime = 0, -- Throttle timer for GetUnitAtPoint hover checks + lastHoveredUnitID = nil, -- Last unit found under cursor (for cursor icon updates) + lastHoveredFeatureID = nil, -- Last feature found under cursor (for info widget) commandIssuedWithShift = false, -- Tracks if a command was issued with shift held (cleared on shift release) } @@ -486,45 +484,45 @@ local miscState = { backupTracking = nil, isSwitchingViews = false, hadSavedConfig = false, - savedGameID = nil, -- GameID from saved config for new game detection - hasOpenedPIPThisGame = false, -- Whether PIP has been opened/maximized at least once this game + savedGameID = nil, -- GameID from saved config for new game detection + hasOpenedPIPThisGame = false, -- Whether PIP has been opened/maximized at least once this game pipUnits = {}, pipFeatures = {}, - allUnitsCache = {}, -- Cached all-units list for tracking/spec mode (avoids per-update GetAllUnits alloc) - allUnitsIndex = {}, -- [unitID] = index in allUnitsCache for O(1) swap-remove updates + allUnitsCache = {}, -- Cached all-units list for tracking/spec mode (avoids per-update GetAllUnits alloc) + allUnitsIndex = {}, -- [unitID] = index in allUnitsCache for O(1) swap-remove updates allUnitsDirty = true, - mapMarkers = {}, -- Table to store active map markers - minimapWidgetDisabled = false, -- Whether we've disabled the old minimap widget (for minimap mode) - minimapCameraRestored = false, -- Whether minimap camera state was restored from config (for luaui reload) - minimapRestoreAtMinZoom = false, -- Whether the restored minimap camera was at minimum zoom (snap to recalculated min) - minimapInitialRotationSyncPending = false, -- One-shot rotation/layout resync after startup or reload - minimapMinimized = false, -- Whether the minimap is hidden via MinimapMinimize config (minimap mode only) - minimapMinimizeAnimating = false, -- Whether a minimap minimize animation is in progress - engineMinimapActive = false, -- Whether engine minimap fallback is currently rendering (tracks transitions) - baseMinimapIconScale = nil, -- Saved MinimapIconScale before engine fallback density scaling modifies it - crashingUnits = {}, -- Units that are crashing (no icon should be drawn) - gameOverZoomingOut = false, -- True while GameOver zoom-out animation is in progress - isGameOver = false, -- True after GameOver callin fires (disables takeable blink etc.) + mapMarkers = {}, -- Table to store active map markers + minimapWidgetDisabled = false, -- Whether we've disabled the old minimap widget (for minimap mode) + minimapCameraRestored = false, -- Whether minimap camera state was restored from config (for luaui reload) + minimapRestoreAtMinZoom = false, -- Whether the restored minimap camera was at minimum zoom (snap to recalculated min) + minimapInitialRotationSyncPending = false, -- One-shot rotation/layout resync after startup or reload + minimapMinimized = false, -- Whether the minimap is hidden via MinimapMinimize config (minimap mode only) + minimapMinimizeAnimating = false, -- Whether a minimap minimize animation is in progress + engineMinimapActive = false, -- Whether engine minimap fallback is currently rendering (tracks transitions) + baseMinimapIconScale = nil, -- Saved MinimapIconScale before engine fallback density scaling modifies it + crashingUnits = {}, -- Units that are crashing (no icon should be drawn) + gameOverZoomingOut = false, -- True while GameOver zoom-out animation is in progress + isGameOver = false, -- True after GameOver callin fires (disables takeable blink etc.) -- Activity focus: briefly pan camera to map markers then restore - activityFocusEnabled = false, -- Toggle state for the button (default off) - activityFocusSavedWcx = nil, -- Saved camera X before focus - activityFocusSavedWcz = nil, -- Saved camera Z before focus - activityFocusSavedZoom = nil, -- Saved zoom before focus - activityFocusTime = 0, -- os.clock() when we started focusing on a marker - activityFocusActive = false, -- True while camera is focused on a marker (waiting to restore) - activityFocusTargetX = nil, -- World X of the marker being focused on - activityFocusTargetZ = nil, -- World Z of the marker being focused on - activityFocusPlayerHistory = {}, -- Per-player spam tracking: [playerID] = { timestamps={}, mutedUntil=0, throttledUntil=0 } - lastFullview = nil, -- Previous fullview state, used to detect fullview ON→OFF transitions - specGhostScanDone = false, -- Whether we've done a full ghost scan while fullview is ON - specGhostScanTime = 0, -- Last time we ran the ghost scan (to throttle periodic rescans) - tvEnabled = false, -- TV mode toggle state - transportedUnits = {}, -- Units currently inside a transport (pseudo-buildings become mobile while transported) - featureRectLastL = nil, -- Last queried feature-rect left (world) - featureRectLastT = nil, -- Last queried feature-rect top (world) - featureRectLastR = nil, -- Last queried feature-rect right (world) - featureRectLastB = nil, -- Last queried feature-rect bottom (world) - featureRectLastUpdate = 0, -- os.clock() of last feature-rect query + activityFocusEnabled = false, -- Toggle state for the button (default off) + activityFocusSavedWcx = nil, -- Saved camera X before focus + activityFocusSavedWcz = nil, -- Saved camera Z before focus + activityFocusSavedZoom = nil, -- Saved zoom before focus + activityFocusTime = 0, -- os.clock() when we started focusing on a marker + activityFocusActive = false, -- True while camera is focused on a marker (waiting to restore) + activityFocusTargetX = nil, -- World X of the marker being focused on + activityFocusTargetZ = nil, -- World Z of the marker being focused on + activityFocusPlayerHistory = {}, -- Per-player spam tracking: [playerID] = { timestamps={}, mutedUntil=0, throttledUntil=0 } + lastFullview = nil, -- Previous fullview state, used to detect fullview ON→OFF transitions + specGhostScanDone = false, -- Whether we've done a full ghost scan while fullview is ON + specGhostScanTime = 0, -- Last time we ran the ghost scan (to throttle periodic rescans) + tvEnabled = false, -- TV mode toggle state + transportedUnits = {}, -- Units currently inside a transport (pseudo-buildings become mobile while transported) + featureRectLastL = nil, -- Last queried feature-rect left (world) + featureRectLastT = nil, -- Last queried feature-rect top (world) + featureRectLastR = nil, -- Last queried feature-rect right (world) + featureRectLastB = nil, -- Last queried feature-rect bottom (world) + featureRectLastUpdate = 0, -- os.clock() of last feature-rect query featureRectNeedsUpdate = true, } @@ -535,51 +533,55 @@ local miscState = { local pipTV = { -- Event ring buffer: { x, z, weight, time, type } events = {}, - eventHead = 0, -- Next write index (wraps at config.tvMaxEvents) - eventCount = 0, -- Total events currently stored + eventHead = 0, -- Next write index (wraps at config.tvMaxEvents) + eventCount = 0, -- Total events currently stored -- Hotspot clustering: rebuilt each director tick from recent events - hotspots = {}, -- { x, z, weight, eventCount, lastEventTime } + hotspots = {}, -- { x, z, weight, eventCount, lastEventTime } hotspotCount = 0, -- Director state: decides WHAT to look at director = { - currentHotspotX = nil, -- World X of current focus - currentHotspotZ = nil, -- World Z of current focus - currentWeight = 0, -- Weight of current focus - focusStartTime = 0, -- When we started focusing on current target - lastSwitchTime = 0, -- When we last switched targets - lastOverviewTime = 0, -- When we last did an overview shot - isOverviewShot = false, -- Currently doing a wide overview - visitedAreas = {}, -- Recently visited positions for variety [{x,z,time}] + currentHotspotX = nil, -- World X of current focus + currentHotspotZ = nil, -- World Z of current focus + currentWeight = 0, -- Weight of current focus + focusStartTime = 0, -- When we started focusing on current target + lastSwitchTime = 0, -- When we last switched targets + lastOverviewTime = 0, -- When we last did an overview shot + isOverviewShot = false, -- Currently doing a wide overview + visitedAreas = {}, -- Recently visited positions for variety [{x,z,time}] visitedCount = 0, - idle = true, -- No interesting events yet - peakActivity = 0, -- Highest hotspot weight seen so far (tracks game intensity) + idle = true, -- No interesting events yet + peakActivity = 0, -- Highest hotspot weight seen so far (tracks game intensity) lastAnticipationScan = 0, -- os.clock() of last anticipation scan - lastAliveCheck = 0, -- os.clock() of last alive-allyteam check + lastAliveCheck = 0, -- os.clock() of last alive-allyteam check effectiveGameOver = false, -- True when only one non-gaia allyteam is alive (game is decided) }, -- Camera controller: manages HOW to move the camera (smooth interpolation) camera = { - targetX = nil, -- World X target (set by director) - targetZ = nil, -- World Z target - targetZoom = 0.2, -- Zoom target - active = false, -- Whether TV camera is currently controlling the PIP camera - savedWcx = nil, -- Saved camera before TV mode + targetX = nil, -- World X target (set by director) + targetZ = nil, -- World Z target + targetZoom = 0.2, -- Zoom target + active = false, -- Whether TV camera is currently controlling the PIP camera + savedWcx = nil, -- Saved camera before TV mode savedWcz = nil, savedZoom = nil, - directorTimer = 0, -- Throttle director ticks (runs at ~7 Hz, not every frame) - lastPublishX = 0, -- Last published camera X for WG.pipTVFocus (reduce writes) - lastPublishZ = 0, -- Last published camera Z + directorTimer = 0, -- Throttle director ticks (runs at ~7 Hz, not every frame) + lastPublishX = 0, -- Last published camera X for WG.pipTVFocus (reduce writes) + lastPublishZ = 0, -- Last published camera Z }, } -- TV Mode: Add an event to the ring buffer -- type: 'combat', 'explosion', 'death', 'finished', 'marker' function pipTV.AddEvent(x, z, weight, eventType) - if not miscState.tvEnabled then return end - if not x or not z then return end + if not miscState.tvEnabled then + return + end + if not x or not z then + return + end local maxEv = config.tvMaxEvents pipTV.eventHead = (pipTV.eventHead % maxEv) + 1 local idx = pipTV.eventHead @@ -592,7 +594,7 @@ function pipTV.AddEvent(x, z, weight, eventType) ev.z = z ev.weight = weight or 1 ev.time = os.clock() - ev.type = eventType or 'combat' + ev.type = eventType or "combat" if pipTV.eventCount < maxEv then pipTV.eventCount = pipTV.eventCount + 1 end @@ -611,7 +613,9 @@ function pipTV.BuildHotspots(now) local losFilter = state.losViewEnabled and state.losViewAllyTeam -- Clear old hotspots - for i = 1, #hs do hs[i] = nil end + for i = 1, #hs do + hs[i] = nil + end -- Process each event, merge into nearby hotspot or create new one local events = pipTV.events @@ -676,7 +680,7 @@ function pipTV.GetVarietyBonus(x, z, now) local v = visited[i] if v then local age = now - v.time - if age < 30 then -- 30s memory for visited areas + if age < 30 then -- 30s memory for visited areas local dx = v.x - x local dz = v.z - z local distSq = dx * dx + dz * dz @@ -686,7 +690,9 @@ function pipTV.GetVarietyBonus(x, z, now) local distFactor = 1 - (dist / varietyRadius) local timeFactor = 1 - (age / 30) local penalty = distFactor * timeFactor - if penalty > maxPenalty then maxPenalty = penalty end + if penalty > maxPenalty then + maxPenalty = penalty + end end end end @@ -697,7 +703,7 @@ end -- TV Mode: Record that we visited an area function pipTV.RecordVisit(x, z) local dir = pipTV.director - local idx = (dir.visitedCount % 20) + 1 -- Keep last 20 visits + local idx = (dir.visitedCount % 20) + 1 -- Keep last 20 visits local v = dir.visitedAreas[idx] if not v then v = {} @@ -717,27 +723,31 @@ end -- and uses squared-distance checks to avoid expensive engine API calls per pair. function pipTV.ScanAnticipation(now) local cache = pipTV.cache - if not cache then return end -- cache not yet initialized + if not cache then + return + end -- cache not yet initialized -- Proximity threshold: air attackers within this radius of enemies are "on approach" - local raidRadiusSq = 1200 * 1200 -- 1200 world units + local raidRadiusSq = 1200 * 1200 -- 1200 world units -- Danger radius for low-HP units near enemies local dangerRadiusSq = 900 * 900 -- Gather all visible units with their positions. Use Spring.GetAllUnits (spectator-safe). -- We batch-collect positions to avoid N*M GetUnitPosition calls. local allUnits = Spring.GetAllUnits() - if not allUnits or #allUnits == 0 then return end + if not allUnits or #allUnits == 0 then + return + end -- Collect interesting units and positions in one pass - local airAttackers = {} -- { {x, z, ally} } + local airAttackers = {} -- { {x, z, ally} } local airAttackerCount = 0 - local lowHPCommanders = {} -- { {x, z, ally, hpFrac} } + local lowHPCommanders = {} -- { {x, z, ally, hpFrac} } local lowHPCommanderCount = 0 - local lowHPEcoBuildings = {} -- { {x, z, ally, hpFrac, cost} } + local lowHPEcoBuildings = {} -- { {x, z, ally, hpFrac, cost} } local lowHPEcoCount = 0 - local groundUnitPositions = {} -- { {x, z, ally} } — all non-air mobile units for danger checks + local groundUnitPositions = {} -- { {x, z, ally} } — all non-air mobile units for danger checks local groundCount = 0 - local highValueBuildings = {} -- { {x, z, ally, cost} } — buildings/eco/factories for air raid target checks + local highValueBuildings = {} -- { {x, z, ally, cost} } — buildings/eco/factories for air raid target checks local hvbCount = 0 for i = 1, #allUnits do @@ -756,7 +766,9 @@ function pipTV.ScanAnticipation(now) gp = {} groundUnitPositions[groundCount] = gp end - gp.x = x; gp.z = z; gp.ally = allyTeam + gp.x = x + gp.z = z + gp.ally = allyTeam end -- Collect high-value buildings: eco buildings, factories, commanders @@ -769,7 +781,10 @@ function pipTV.ScanAnticipation(now) hv = {} highValueBuildings[hvbCount] = hv end - hv.x = x; hv.z = z; hv.ally = allyTeam; hv.cost = unitCost + hv.x = x + hv.z = z + hv.ally = allyTeam + hv.cost = unitCost elseif cache.isCommander[defID] then hvbCount = hvbCount + 1 local hv = highValueBuildings[hvbCount] @@ -777,7 +792,10 @@ function pipTV.ScanAnticipation(now) hv = {} highValueBuildings[hvbCount] = hv end - hv.x = x; hv.z = z; hv.ally = allyTeam; hv.cost = unitCost + hv.x = x + hv.z = z + hv.ally = allyTeam + hv.cost = unitCost end -- Air attackers @@ -788,7 +806,9 @@ function pipTV.ScanAnticipation(now) aa = {} airAttackers[airAttackerCount] = aa end - aa.x = x; aa.z = z; aa.ally = allyTeam + aa.x = x + aa.z = z + aa.ally = allyTeam end -- Low-HP commanders (health < 50%) @@ -803,7 +823,10 @@ function pipTV.ScanAnticipation(now) lc = {} lowHPCommanders[lowHPCommanderCount] = lc end - lc.x = x; lc.z = z; lc.ally = allyTeam; lc.hpFrac = hpFrac + lc.x = x + lc.z = z + lc.ally = allyTeam + lc.hpFrac = hpFrac end end end @@ -820,7 +843,10 @@ function pipTV.ScanAnticipation(now) le = {} lowHPEcoBuildings[lowHPEcoCount] = le end - le.x = x; le.z = z; le.ally = allyTeam; le.hpFrac = hpFrac + le.x = x + le.z = z + le.ally = allyTeam + le.hpFrac = hpFrac le.cost = cache.unitCost[defID] or 1000 end end @@ -837,22 +863,23 @@ function pipTV.ScanAnticipation(now) local bestX, bestZ for j = 1, hvbCount do local hv = highValueBuildings[j] - if hv.ally ~= aa.ally then -- Different alliance = enemy + if hv.ally ~= aa.ally then -- Different alliance = enemy local dx = aa.x - hv.x local dz = aa.z - hv.z if dx * dx + dz * dz < raidRadiusSq then -- Air attacker near enemy building — weight by target value - local w = 1.5 + math.min(2.0, hv.cost / 1000) -- 1.5→3.5 by cost + local w = 1.5 + math.min(2.0, hv.cost / 1000) -- 1.5→3.5 by cost if w > bestWeight then bestWeight = w - bestX = hv.x; bestZ = hv.z + bestX = hv.x + bestZ = hv.z end end end end if bestWeight > 0 then -- Event at the target building (where the drama will happen), not at the attacker - pipTV.AddEvent(bestX, bestZ, bestWeight, 'combat') + pipTV.AddEvent(bestX, bestZ, bestWeight, "combat") end end @@ -866,8 +893,8 @@ function pipTV.ScanAnticipation(now) local dz = lc.z - gp.z if dx * dx + dz * dz < dangerRadiusSq then -- Low-HP commander near enemies — high drama, scale by how injured - local weight = 3 + (1 - lc.hpFrac) * 4 -- 3→7 as HP goes 50%→0% - pipTV.AddEvent(lc.x, lc.z, weight, 'combat') + local weight = 3 + (1 - lc.hpFrac) * 4 -- 3→7 as HP goes 50%→0% + pipTV.AddEvent(lc.x, lc.z, weight, "combat") break end end @@ -885,8 +912,8 @@ function pipTV.ScanAnticipation(now) if dx * dx + dz * dz < dangerRadiusSq then -- Low-HP eco building near enemies — scale by cost and injury local costFactor = math.min(2.5, le.cost / 1500) - local weight = 2 + (1 - le.hpFrac) * costFactor -- 2→4.5 for expensive - pipTV.AddEvent(le.x, le.z, weight, 'combat') + local weight = 2 + (1 - le.hpFrac) * costFactor -- 2→4.5 for expensive + pipTV.AddEvent(le.x, le.z, weight, "combat") break end end @@ -905,7 +932,7 @@ function pipTV.DirectorTick(dt) if not dir.effectiveGameOver and now - dir.lastAliveCheck >= 2.0 then dir.lastAliveCheck = now local gf = Spring.GetGameFrame() - if gf > 30 * 30 then -- Only check after first 30 seconds (avoid false positive at spawn) + if gf > 30 * 30 then -- Only check after first 30 seconds (avoid false positive at spawn) local gaiaAT = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID())) local aliveCount = 0 local allyTeams = Spring.GetAllyTeamList() @@ -918,13 +945,13 @@ function pipTV.DirectorTick(dt) local _, _, isDead = Spring.GetTeamInfo(teams[t], false) if not isDead then aliveCount = aliveCount + 1 - break -- This allyteam is alive, move to next + break -- This allyteam is alive, move to next end end end end if aliveCount <= 1 then - dir.effectiveGameOver = true -- Signal to Update() to trigger zoom-out + dir.effectiveGameOver = true -- Signal to Update() to trigger zoom-out end end end @@ -956,12 +983,14 @@ function pipTV.DirectorTick(dt) -- Activity factor: 0→1 as peak hotspot weight reaches combat levels (~10+) -- Use whichever is higher — so early fights on small maps instantly ramp up local gameFrame = Spring.GetGameFrame() - local timeFactor = math.min(1, gameFrame / (30 * 60 * 2)) -- 0→1 over 2 minutes + local timeFactor = math.min(1, gameFrame / (30 * 60 * 2)) -- 0→1 over 2 minutes -- Track peak activity across all current hotspots for i = 1, pipTV.hotspotCount do local hw = pipTV.hotspots[i].weight - if hw > dir.peakActivity then dir.peakActivity = hw end + if hw > dir.peakActivity then + dir.peakActivity = hw + end end -- Activity ramp: light skirmishes (weight ~5) → 0.5, real combat (weight ~10+) → 1.0 local activityFactor = math.min(1, dir.peakActivity / 10) @@ -971,8 +1000,8 @@ function pipTV.DirectorTick(dt) -- Returns a multiplier 0..1 (0 = fully overlapping, 1 = no overlap) -- Checks both current focus AND planned next target of other PIPs -- Higher-numbered PIPs use a larger exclusion radius to stay further away - local pipRole = pipNumber or 0 -- pip0 (minimap) = main camera, pip1+ = B-roll cameras - local coordRadiusMult = 4 + pipRole * 2 -- pip0: 4x, pip1: 6x, pip2: 8x, pip3: 10x + local pipRole = pipNumber or 0 -- pip0 (minimap) = main camera, pip1+ = B-roll cameras + local coordRadiusMult = 4 + pipRole * 2 -- pip0: 4x, pip1: 6x, pip2: 8x, pip3: 10x -- Pre-compute squared radii to avoid sqrt in distance comparisons local hotspotRadiusSq = config.tvHotspotRadius * config.tvHotspotRadius local coordRadius = config.tvHotspotRadius * coordRadiusMult @@ -980,7 +1009,9 @@ function pipTV.DirectorTick(dt) local nearbyDriftRadiusSq = (config.tvHotspotRadius * 1.5) * (config.tvHotspotRadius * 1.5) local function getCoordinationFactor(x, z) local tvFoci = WG.pipTVFocus - if not tvFoci then return 1 end + if not tvFoci then + return 1 + end local worstFactor = 1 for otherPip, focus in pairs(tvFoci) do if otherPip ~= pipNumber then @@ -999,7 +1030,9 @@ function pipTV.DirectorTick(dt) local overlap = 1 - (math.sqrt(cdistSq) / vr) local penalty = overlap * overlap * yieldBonus local penalized = 1 - penalty * 0.98 - if penalized < worstFactor then worstFactor = penalized end + if penalized < worstFactor then + worstFactor = penalized + end end end @@ -1011,7 +1044,9 @@ function pipTV.DirectorTick(dt) local overlap = 1 - (math.sqrt(fdistSq) / coordRadius) local factor = overlap * overlap * yieldBonus local penalized = 1 - factor * 0.97 - if penalized < worstFactor then worstFactor = penalized end + if penalized < worstFactor then + worstFactor = penalized + end end -- Also check planned target (squared distance, sqrt only on hit) if focus.plannedX then @@ -1022,7 +1057,9 @@ function pipTV.DirectorTick(dt) local overlap = 1 - (math.sqrt(pdistSq) / coordRadius) local factor = overlap * overlap * yieldBonus local penalized = 1 - factor * 0.85 - if penalized < worstFactor then worstFactor = penalized end + if penalized < worstFactor then + worstFactor = penalized + end end end end @@ -1032,7 +1069,9 @@ function pipTV.DirectorTick(dt) -- No hotspots at all — idle mode, do a slow overview if pipTV.hotspotCount == 0 then - if dir.idle then return nil end + if dir.idle then + return nil + end dir.idle = true -- Stagger overview position per PIP to avoid identical views local offsetX = (pipNumber or 0) * Game.mapSizeX * 0.15 @@ -1063,7 +1102,7 @@ function pipTV.DirectorTick(dt) dir.isOverviewShot = false -- Fall through to pick a hotspot else - return nil -- Keep current overview + return nil -- Keep current overview end end @@ -1079,7 +1118,7 @@ function pipTV.DirectorTick(dt) local coordFactor = getCoordinationFactor(dir.currentHotspotX, dir.currentHotspotZ) if coordFactor < 0.3 then -- Another PIP is very close — break cooldown and fall through to scoring - dir.lastSwitchTime = 0 -- Allow immediate switch + dir.lastSwitchTime = 0 -- Allow immediate switch else -- Find the closest hotspot to our current focus to track drift local bestDist = math.huge @@ -1102,13 +1141,14 @@ function pipTV.DirectorTick(dt) -- Calculate zoom based on weight: heavier events = closer -- Early game: stay more zoomed out local cooldownWeightForZoom = dir.currentWeight / (15 + (1 - gameMinutes) * 25) - local zoom = config.tvOverviewZoom + (config.tvCloseupZoom - config.tvOverviewZoom) * - math.min(1, cooldownWeightForZoom) + local zoom = config.tvOverviewZoom + (config.tvCloseupZoom - config.tvOverviewZoom) * math.min(1, cooldownWeightForZoom) zoom = math.min(zoom, config.tvMaxZoom) return dir.currentHotspotX, dir.currentHotspotZ, zoom end end - if dir.currentHotspotX then return nil end -- Still in cooldown, no coord conflict + if dir.currentHotspotX then + return nil + end -- Still in cooldown, no coord conflict return nil end @@ -1134,7 +1174,7 @@ function pipTV.DirectorTick(dt) -- Recency boost: hotspots with very recent events get a big boost local recency = now - h.lastEventTime if recency < 2 then - score = score * (2 - recency) -- Up to 2x for events < 2s ago + score = score * (2 - recency) -- Up to 2x for events < 2s ago end -- Variety bonus: areas we haven't visited recently score higher @@ -1150,7 +1190,7 @@ function pipTV.DirectorTick(dt) local dx = h.x - dir.currentHotspotX local dz = h.z - dir.currentHotspotZ if dx * dx + dz * dz < hotspotRadiusSq then - score = score * 0.5 -- Penalize staying on same spot too long + score = score * 0.5 -- Penalize staying on same spot too long end end @@ -1165,7 +1205,9 @@ function pipTV.DirectorTick(dt) end end - if not bestH then return nil end + if not bestH then + return nil + end -- Publish our planned next target so other PIPs can avoid it if WG.pipTVFocus and WG.pipTVFocus[pipNumber] then @@ -1180,7 +1222,7 @@ function pipTV.DirectorTick(dt) -- Decide whether to switch from current target -- Higher-numbered PIPs stay longer on their (secondary) targets - local effectiveFocusDuration = config.tvFocusDuration * (1 + pipRole * 0.5) -- pip2: 1.5x, pip3: 2x + local effectiveFocusDuration = config.tvFocusDuration * (1 + pipRole * 0.5) -- pip2: 1.5x, pip3: 2x local shouldSwitch = false if not dir.currentHotspotX then shouldSwitch = true @@ -1243,9 +1285,8 @@ function pipTV.DirectorTick(dt) -- Calculate zoom based on weight: heavier hotspot = zoom in closer -- Early game: stay more zoomed out (need more weight to zoom in) - local weightForZoom = dir.currentWeight / (15 + (1 - gameMinutes) * 25) -- early: need ~40 weight for max zoom - local zoom = config.tvOverviewZoom + (config.tvCloseupZoom - config.tvOverviewZoom) * - math.min(1, weightForZoom) + local weightForZoom = dir.currentWeight / (15 + (1 - gameMinutes) * 25) -- early: need ~40 weight for max zoom + local zoom = config.tvOverviewZoom + (config.tvCloseupZoom - config.tvOverviewZoom) * math.min(1, weightForZoom) zoom = math.min(zoom, config.tvMaxZoom) return dir.currentHotspotX, dir.currentHotspotZ, zoom @@ -1254,7 +1295,9 @@ end -- TV Mode: Camera controller tick — smoothly moves PIP camera toward director target -- This is separate from the director; it only handles interpolation function pipTV.CameraUpdate(dt) - if not pipTV.camera.active then return end + if not pipTV.camera.active then + return + end -- Throttle director: run heavy decision-making (hotspot clustering + scoring) at ~7 Hz -- Camera interpolation still runs every frame for smooth movement @@ -1361,7 +1404,7 @@ function pipTV.CameraUpdate(dt) if WG.pipTVFocus and WG.pipTVFocus[pipNumber] then local pubDx = cameraState.targetWcx - cam.lastPublishX local pubDz = cameraState.targetWcz - cam.lastPublishZ - if pubDx * pubDx + pubDz * pubDz > 2500 then -- 50^2 + if pubDx * pubDx + pubDz * pubDz > 2500 then -- 50^2 cam.lastPublishX = cameraState.targetWcx cam.lastPublishZ = cameraState.targetWcz WG.pipTVFocus[pipNumber].camX = cameraState.targetWcx @@ -1379,8 +1422,8 @@ end local ghostBuildings = {} -- Building position caches: buildings never move, avoiding per-frame GetUnitBasePosition -local ownBuildingPosX = {} -- [unitID] = worldX -local ownBuildingPosZ = {} -- [unitID] = worldZ +local ownBuildingPosX = {} -- [unitID] = worldX +local ownBuildingPosZ = {} -- [unitID] = worldZ local drawData = { hoveredUnitID = nil, @@ -1399,46 +1442,46 @@ local pools = { commandLine = {}, -- Reused for batched command line vertices commandMarker = {}, -- Reused for batched command marker vertices stillAlive = {}, -- Reused for UpdateTracking alive units - cmdOpts = {alt=false, ctrl=false, meta=false, shift=false, right=false}, -- Reused for GetCmdOpts + cmdOpts = { alt = false, ctrl = false, meta = false, shift = false, right = false }, -- Reused for GetCmdOpts buildPositions = {}, -- Reused for CalculateBuildDragPositions buildsByTexture = {}, -- Reused for DrawQueuedBuilds texture grouping buildCountByTexture = {}, -- Reused for DrawQueuedBuilds counts - savedDim = {l=0, r=0, b=0, t=0}, -- Reused for R2T dimension backup - projectileColor = {1, 0.5, 0, 1}, -- Reused for DrawProjectile default color - yellowColor = {1, 1, 0, 1}, -- Reused for non-blaster weapon projectile color - greyColor = {0.7, 0.7, 0.7, 1}, -- Reused for debris projectile color + savedDim = { l = 0, r = 0, b = 0, t = 0 }, -- Reused for R2T dimension backup + projectileColor = { 1, 0.5, 0, 1 }, -- Reused for DrawProjectile default color + yellowColor = { 1, 1, 0, 1 }, -- Reused for non-blaster weapon projectile color + greyColor = { 0.7, 0.7, 0.7, 1 }, -- Reused for debris projectile color trackingMerge = {}, -- Reused for tracking unit merge operations trackingTempSet = {}, -- Reused for tracking unit deduplication activeTrails = {}, -- Reused for tracking active missile trails visibleButtons = {}, -- Reused for button visibility computation aliveTeammates = {}, -- Reused for GetAliveTeammates in per-frame UI paths - trackingOutlineColor = {1, 1, 1, 0.22}, -- Reused for DrawTrackingIndicators default outline color - trackingTeamColor = {1, 1, 1, 0.5}, -- Reused for DrawTrackingIndicators team outline color + trackingOutlineColor = { 1, 1, 1, 0.22 }, -- Reused for DrawTrackingIndicators default outline color + trackingTeamColor = { 1, 1, 1, 0.5 }, -- Reused for DrawTrackingIndicators team outline color unitsInRect = {}, -- Reused for tracked-spec filtering in DrawUnitsAndFeatures emptySelectionSet = {}, -- Reused empty selected-set sentinel for tracking mode comHealthBars = {}, -- Reused commander health bar entries cursorArcRanges = { - {math.pi/2 - math.pi/8, math.pi/2 + math.pi/8}, - {0 - math.pi/8, 0 + math.pi/8}, - {3*math.pi/2 - math.pi/8, 3*math.pi/2 + math.pi/8}, - {math.pi - math.pi/8, math.pi + math.pi/8}, + { math.pi / 2 - math.pi / 8, math.pi / 2 + math.pi / 8 }, + { 0 - math.pi / 8, 0 + math.pi / 8 }, + { 3 * math.pi / 2 - math.pi / 8, 3 * math.pi / 2 + math.pi / 8 }, + { math.pi - math.pi / 8, math.pi + math.pi / 8 }, }, -- Reused ally cursor arc definitions liveSet = {}, -- Reused unit-membership set for ghost visibility checks - scratchQuad = {x1=0, y1=0, x2=0, y2=0}, -- Reused vertices for DrawScratchQuad - scratchArc = {cx=0, cy=0, radius=0, start=0, finish=0, segments=0}, -- Reused params for DrawScratchArc - scratchTexQuad = {l=0, b=0, r=0, t=0}, -- Reused bounds for textured quad callback - lineClamp = {x1=0, y1=0, x2=0, y2=0}, -- Reused line endpoints for BeginEnd line callback - minimapViewRect = {halfWidth=0, halfHeight=0, cx=0, cy=0}, -- Reused DrawInMiniMap chamfer params + scratchQuad = { x1 = 0, y1 = 0, x2 = 0, y2 = 0 }, -- Reused vertices for DrawScratchQuad + scratchArc = { cx = 0, cy = 0, radius = 0, start = 0, finish = 0, segments = 0 }, -- Reused params for DrawScratchArc + scratchTexQuad = { l = 0, b = 0, r = 0, t = 0 }, -- Reused bounds for textured quad callback + lineClamp = { x1 = 0, y1 = 0, x2 = 0, y2 = 0 }, -- Reused line endpoints for BeginEnd line callback + minimapViewRect = { halfWidth = 0, halfHeight = 0, cx = 0, cy = 0 }, -- Reused DrawInMiniMap chamfer params cameraViewVerts = {}, -- Reused flat vertex buffer for DrawCameraViewBounds edge quads cameraViewVertexCount = 0, - cameraViewCache = {valid=false, points={}}, -- Cached chamfer points and inputs for DrawCameraViewBounds - unitsR2T = {uW=0, uH=0, resScale=1, currentRotation=0, pregameIdleInterval=0.12}, -- Reused UpdateR2TUnits render context + cameraViewCache = { valid = false, points = {} }, -- Cached chamfer points and inputs for DrawCameraViewBounds + unitsR2T = { uW = 0, uH = 0, resScale = 1, currentRotation = 0, pregameIdleInterval = 0.12 }, -- Reused UpdateR2TUnits render context } -- Per-frame selected-units cache: avoids 5+ redundant Spring.GetSelectedUnits() calls per frame, -- each of which allocates a new Lua table with N entries (N = selected unit count). -local frameSel = nil -- Cached array from Spring.GetSelectedUnits() (lazy, set on first use) -local frameSelCount = 0 -- Cached count from Spring.GetSelectedUnitsCount() (set at start of DrawScreen) +local frameSel = nil -- Cached array from Spring.GetSelectedUnits() (lazy, set on first use) +local frameSelCount = 0 -- Cached count from Spring.GetSelectedUnitsCount() (set at start of DrawScreen) -- Tracked-player selected-unit cache for PIP. -- Filled incrementally by selectedUnits call-ins; seeded once from WG allyselectedunits @@ -1452,7 +1495,7 @@ local function SeedTrackedPlayerSelectionsFromWG(playerID) end trackedPlayerSelectionSeeded[playerID] = true - local wgApi = WG['allyselectedunits'] + local wgApi = WG["allyselectedunits"] local getPlayerSelectedUnits = wgApi and wgApi.getPlayerSelectedUnits if not getPlayerSelectedUnits then return @@ -1491,15 +1534,15 @@ end -- GetUnitCommands allocates ~60 tables per unit per call (outer + cmd + params tables), -- which causes massive GC pressure. Caching and only refreshing every N frames eliminates this. local cmdQueueCache = { - waypoints = {}, -- [unitID] = { n = wpCount, [1]={x,z,cmdID}, [2]={x,z,cmdID}, ... } - counter = 0, -- draw-call counter for throttling - lastUnitHash = 0, -- quick hash for unit list change detection + waypoints = {}, -- [unitID] = { n = wpCount, [1]={x,z,cmdID}, [2]={x,z,cmdID}, ... } + counter = 0, -- draw-call counter for throttling + lastUnitHash = 0, -- quick hash for unit list change detection } -- Segment deduplication for command-queue rendering: avoids drawing the same -- waypoint→waypoint segment multiple times when many units share overlapping -- build queues. Uses a generation counter so the table never needs clearing. -local cmdSegDedup = {} -- [combinedKey] = generation +local cmdSegDedup = {} -- [combinedKey] = generation local cmdSegDedupGen = 0 -- Reused scratch vars/callbacks for hot BeginEnd paths (avoids per-iteration closure allocs) @@ -1566,10 +1609,14 @@ pools.CameraViewAppendEdgeQuad = function(data, idx, x1, y1, x2, y2, halfW) end local nx, ny = (-dy / len) * halfW, (dx / len) * halfW - data[idx] = x1 - nx; data[idx + 1] = y1 - ny - data[idx + 2] = x1 + nx; data[idx + 3] = y1 + ny - data[idx + 4] = x2 + nx; data[idx + 5] = y2 + ny - data[idx + 6] = x2 - nx; data[idx + 7] = y2 - ny + data[idx] = x1 - nx + data[idx + 1] = y1 - ny + data[idx + 2] = x1 + nx + data[idx + 3] = y1 + ny + data[idx + 4] = x2 + nx + data[idx + 5] = y2 + ny + data[idx + 6] = x2 - nx + data[idx + 7] = y2 - ny return idx + 8 end @@ -1596,62 +1643,64 @@ local CMD_MAX_CHAIN_UNITS = 6 local pipUseGeometryShader = (gl.LuaShader and gl.LuaShader.isGeometryShaderSupported) or false local gl4Icons = { - INSTANCE_STEP = 12, -- floats per icon instance (3 x vec4) - MAX_INSTANCES = 16384, -- pre-allocated capacity (covers 16k units without resize) - LAYER_STRUCTURE = 0, -- structures drawn first (bottom) - LAYER_GROUND = 1, -- ground mobile units - LAYER_AIR = 2, -- air units above ground - LAYER_COMMANDER = 3, -- commanders drawn last (top, above air) - enabled = false, -- Set true after successful init - atlas = nil, -- Engine '$icons' texture string - atlasUVs = {}, -- [unitDefID] = {u0, v0, u1, v1} (UV rect in atlas, Y-flipped) - defaultUV = nil, -- UV for PipBlip fallback icon - vbo = nil, -- Raw GL VBO (no InstanceVBOTable overhead) - vao = nil, -- VAO with VBO attached - shader = nil, -- Compiled GLSL shader program - shaderUsesGS = true, -- true when shader expects point->GS expansion - uniformLocs = {}, -- Cached uniform locations - unitDefCache = {}, -- [unitID] = unitDefID (lazy-populated, cleared on unit death/give) - unitTeamCache = {}, -- [unitID] = teamID (lazy-populated, cleared on unit give) - unitDefLayer = {}, -- [unitDefID] = layer (0=structure,1=ground,2=air,3=commander) — built once at init - instanceData = nil, -- Pre-allocated flat float array (MAX_INSTANCES * INSTANCE_STEP) - sortKeys = {}, -- [unitID] = sortKey (layer*1e6 + x+z) for stable position-based draw order - cachedPosX = {}, -- [unitID] = worldX (cached from sort pass, reused in processUnit) - cachedPosZ = {}, -- [unitID] = worldZ (cached from sort pass, reused in processUnit) - _buildingBuf = {}, -- Reused buffer: immobile building IDs for current frame - _mobileBuf = {}, -- Reused buffer: fast mobile unit IDs (aircraft, commanders) - _slowMobileBuf = {}, -- Reused buffer: slow mobile unit IDs (ground units) - isFastMobile = {}, -- [unitID] = true (fast) / false (slow) — cached speed tier for mobile units - _bldgSortedCache = {}, -- Cached sorted building IDs (re-sorted only when set changes) - _lastBldgHash = 0, -- Additive hash of building ID set for change detection - _lastBldgCount = 0, -- Count of buildings for change detection - _prevBuildingLen = 0, -- Previous frame building buffer length (for stale-clear) - _prevMobileLen = 0, -- Previous frame fast mobile buffer length (for stale-clear) - _prevSlowMobileLen = 0, -- Previous frame slow mobile buffer length (for stale-clear) + INSTANCE_STEP = 12, -- floats per icon instance (3 x vec4) + MAX_INSTANCES = 16384, -- pre-allocated capacity (covers 16k units without resize) + LAYER_STRUCTURE = 0, -- structures drawn first (bottom) + LAYER_GROUND = 1, -- ground mobile units + LAYER_AIR = 2, -- air units above ground + LAYER_COMMANDER = 3, -- commanders drawn last (top, above air) + enabled = false, -- Set true after successful init + atlas = nil, -- Engine '$icons' texture string + atlasUVs = {}, -- [unitDefID] = {u0, v0, u1, v1} (UV rect in atlas, Y-flipped) + defaultUV = nil, -- UV for PipBlip fallback icon + vbo = nil, -- Raw GL VBO (no InstanceVBOTable overhead) + vao = nil, -- VAO with VBO attached + shader = nil, -- Compiled GLSL shader program + shaderUsesGS = true, -- true when shader expects point->GS expansion + uniformLocs = {}, -- Cached uniform locations + unitDefCache = {}, -- [unitID] = unitDefID (lazy-populated, cleared on unit death/give) + unitTeamCache = {}, -- [unitID] = teamID (lazy-populated, cleared on unit give) + unitDefLayer = {}, -- [unitDefID] = layer (0=structure,1=ground,2=air,3=commander) — built once at init + instanceData = nil, -- Pre-allocated flat float array (MAX_INSTANCES * INSTANCE_STEP) + sortKeys = {}, -- [unitID] = sortKey (layer*1e6 + x+z) for stable position-based draw order + cachedPosX = {}, -- [unitID] = worldX (cached from sort pass, reused in processUnit) + cachedPosZ = {}, -- [unitID] = worldZ (cached from sort pass, reused in processUnit) + _buildingBuf = {}, -- Reused buffer: immobile building IDs for current frame + _mobileBuf = {}, -- Reused buffer: fast mobile unit IDs (aircraft, commanders) + _slowMobileBuf = {}, -- Reused buffer: slow mobile unit IDs (ground units) + isFastMobile = {}, -- [unitID] = true (fast) / false (slow) — cached speed tier for mobile units + _bldgSortedCache = {}, -- Cached sorted building IDs (re-sorted only when set changes) + _lastBldgHash = 0, -- Additive hash of building ID set for change detection + _lastBldgCount = 0, -- Count of buildings for change detection + _prevBuildingLen = 0, -- Previous frame building buffer length (for stale-clear) + _prevMobileLen = 0, -- Previous frame fast mobile buffer length (for stale-clear) + _prevSlowMobileLen = 0, -- Previous frame slow mobile buffer length (for stale-clear) -- Dual VBO: separate building VBO for independent update frequency - bldgVbo = nil, -- Building+ghost VBO (uploaded only when building state changes) - bldgVao = nil, -- VAO for building VBO - bldgInstanceData = nil, -- Pre-allocated flat array for building+ghost icon data - _bldgVboValid = false, -- Building VBO has current data (skip upload) + bldgVbo = nil, -- Building+ghost VBO (uploaded only when building state changes) + bldgVao = nil, -- VAO for building VBO + bldgInstanceData = nil, -- Pre-allocated flat array for building+ghost icon data + _bldgVboValid = false, -- Building VBO has current data (skip upload) _bldgVboUsedElements = 0, -- Elements in building VBO _bldgVboHadOverlay = false, -- Previous upload had selection/flash/tracking/selfD overlays - _bldgVboGhostHash = 0, -- Ghost ID hash for change detection - _bldgVboGhostCount = 0, -- Ghost element count for change detection + _bldgVboGhostHash = 0, -- Ghost ID hash for change detection + _bldgVboGhostCount = 0, -- Ghost element count for change detection -- Slow mobile VBO: separate buffer for ground mobile icons (uploaded less frequently) - slowVbo = nil, -- Slow mobile VBO (ground units; rebuilt less often than fast mobile) - slowVao = nil, -- VAO for slow mobile VBO - slowInstanceData = nil, -- Pre-allocated flat array for slow mobile icon data - _slowVboValid = false, -- Slow mobile VBO has current data (skip upload) + slowVbo = nil, -- Slow mobile VBO (ground units; rebuilt less often than fast mobile) + slowVao = nil, -- VAO for slow mobile VBO + slowInstanceData = nil, -- Pre-allocated flat array for slow mobile icon data + _slowVboValid = false, -- Slow mobile VBO has current data (skip upload) _slowVboUsedElements = 0, -- Elements in slow mobile VBO _slowVboHadOverlay = false, -- Previous upload had overlays - quadVBO = nil, -- Shared per-vertex quad template for NoGS instanced path + quadVBO = nil, -- Shared per-vertex quad template for NoGS instanced path } -- Persistent sort comparator for icon draw order (avoids per-frame closure allocation) -- Two-level: primary key (layer + Z depth), tiebreaker is unitID (always unique → deterministic) local function gl4IconSortCmp(a, b) local ka, kb = gl4Icons.sortKeys[a], gl4Icons.sortKeys[b] - if ka ~= kb then return ka < kb end + if ka ~= kb then + return ka < kb + end return a < b end @@ -1661,31 +1710,37 @@ local wtp = { scaleX = 1, scaleZ = 1, offsetX = 0, offsetZ = 0 } -- GL4 Primitive Rendering (explosions, projectiles, beams, command lines) local gl4Prim = { - LINE_STEP = 6, -- floats per vertex: worldX, worldZ, r, g, b, a - LINE_MAX = 16384, -- max vertices (8192 line segments) - CIRCLE_STEP = 12, -- floats per instance: 3 x vec4 - CIRCLE_MAX = 2048, -- max circle instances - QUAD_STEP = 12, -- floats per instance: 3 x vec4 - QUAD_MAX = 4096, -- max quad instances + LINE_STEP = 6, -- floats per vertex: worldX, worldZ, r, g, b, a + LINE_MAX = 16384, -- max vertices (8192 line segments) + CIRCLE_STEP = 12, -- floats per instance: 3 x vec4 + CIRCLE_MAX = 2048, -- max circle instances + QUAD_STEP = 12, -- floats per instance: 3 x vec4 + QUAD_MAX = 4096, -- max quad instances enabled = false, useGeometryShader = true, quadVBO = nil, -- Circles (explosions, plasma, flame, lightning impacts) circles = { - vbo = nil, vao = nil, shader = nil, - data = nil, count = 0, + vbo = nil, + vao = nil, + shader = nil, + data = nil, + count = 0, uniformLocs = {}, }, -- Quads (missiles, blasters) quads = { - vbo = nil, vao = nil, shader = nil, - data = nil, count = 0, + vbo = nil, + vao = nil, + shader = nil, + data = nil, + count = 0, uniformLocs = {}, }, -- Lines by width category (each has own VBO/VAO, shared shader) - glowLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- thick (beam/lightning glow) - coreLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- medium (beam/lightning core) - normLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- thin (trails, commands) + glowLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- thick (beam/lightning glow) + coreLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- medium (beam/lightning core) + normLines = { vbo = nil, vao = nil, data = nil, count = 0 }, -- thin (trails, commands) lineShader = nil, lineUniformLocs = {}, } @@ -1697,7 +1752,7 @@ local cache = { xsizes = {}, zsizes = {}, unitIcon = {}, - unitPic = {}, -- Unit picture paths for detailed view + unitPic = {}, -- Unit picture paths for detailed view isFactory = {}, radiusSqs = {}, featureRadiusSqs = {}, @@ -1719,16 +1774,16 @@ local cache = { canMove = {}, canFly = {}, isBuilding = {}, - isPseudoBuilding = {}, -- speed==0 units that aren't isBuilding (nano turrets, transportable turrets) - isCritter = {}, -- gaia wildlife units (name starts with "critter") + isPseudoBuilding = {}, -- speed==0 units that aren't isBuilding (nano turrets, transportable turrets) + isCritter = {}, -- gaia wildlife units (name starts with "critter") isCommander = {}, - isDecoyCommander = {}, -- Commanders with customParams.decoyfor (show 'Decoy' instead of player name) - isScavCommander = {}, -- Scavenger commanders (show scav-specific name for decoys) + isDecoyCommander = {}, -- Commanders with customParams.decoyfor (show 'Decoy' instead of player name) + isScavCommander = {}, -- Scavenger commanders (show scav-specific name for decoys) unitCost = {}, -- Combat properties canAttack = {}, - isAirAttacker = {}, -- Air units with ground/sea attack weapons (bombers, gunships) - isExpensiveEco = {}, -- Non-commander buildings with cost >= 1000 (T2 mexes, fusions, etc.) + isAirAttacker = {}, -- Air units with ground/sea attack weapons (bombers, gunships) + isExpensiveEco = {}, -- Non-commander buildings with cost >= 1000 (T2 mexes, fusions, etc.) maxIconShatters = 20, weaponIsLaser = {}, weaponIsBlaster = {}, @@ -1737,33 +1792,35 @@ local cache = { weaponIsStarburst = {}, weaponIsLightning = {}, weaponIsFlame = {}, - flameLifetime = {}, -- [wDefID] = seconds, estimated particle lifetime for flame weapons - flameBirthTime = {}, -- [pID] = gameTime, when we first saw this flame particle - flameSeeds = {}, -- [pID] = {offX, offZ, baseSize, v1, v2, v3} — stable per-particle variation + flameLifetime = {}, -- [wDefID] = seconds, estimated particle lifetime for flame weapons + flameBirthTime = {}, -- [pID] = gameTime, when we first saw this flame particle + flameSeeds = {}, -- [pID] = {offX, offZ, baseSize, v1, v2, v3} — stable per-particle variation weaponIsBomb = {}, weaponIsParalyze = {}, weaponIsAA = {}, weaponIsJuno = {}, weaponIsTorpedo = {}, - missileTrails = {}, -- Stores trail positions for missiles {[pID] = {positions = {{x,z,time},...}, lastUpdate = time}} - missileColors = {}, -- [wDefID] = {bodyR,bodyG,bodyB, noseR,noseG,noseB, finR,finG,finB, exhR,exhG,exhB} - plasmaTrails = {}, -- Stores trail positions for plasma/artillery projectiles (simpler, shorter trails) - weaponPlasmaTrailColor = {}, -- {r, g, b} per wDefID, based on cegTag + missileTrails = {}, -- Stores trail positions for missiles {[pID] = {positions = {{x,z,time},...}, lastUpdate = time}} + missileColors = {}, -- [wDefID] = {bodyR,bodyG,bodyB, noseR,noseG,noseB, finR,finG,finB, exhR,exhG,exhB} + plasmaTrails = {}, -- Stores trail positions for plasma/artillery projectiles (simpler, shorter trails) + weaponPlasmaTrailColor = {}, -- {r, g, b} per wDefID, based on cegTag weaponSize = {}, weaponRange = {}, weaponThickness = {}, weaponColor = {}, weaponExplosionRadius = {}, weaponSkipExplosion = {}, - weaponExplosionDim = {}, -- [wDefID] = 0..1 dimming multiplier for rapid-fire/flame weapon explosions + weaponExplosionDim = {}, -- [wDefID] = 0..1 dimming multiplier for rapid-fire/flame weapon explosions } -pipTV.cache = cache -- Expose cache to early-defined pipTV functions (ScanAnticipation) +pipTV.cache = cache -- Expose cache to early-defined pipTV functions (ScanAnticipation) local gameTime = 0 -- Accumulated game time (pauses when game is paused) local wallClockTime = 0 -- Wall-clock time (always advances, even when paused) -- Pre-defined descending sort comparator (avoids per-call closure allocation) -local function sortDescending(a, b) return a > b end +local function sortDescending(a, b) + return a > b +end -- Cached takeable teams: miscState.cachedTakeableTeams (nil = needs rebuild, invalidated by PlayerChanged) @@ -1779,27 +1836,27 @@ local perfTimers = { shatters = 0, total = 0, lastEchoTime = 0, - itemCount = 0, -- total items rendered this frame (units+projectiles+explosions+decals) + itemCount = 0, -- total items rendered this frame (units+projectiles+explosions+decals) -- Icon sub-timers (breakdown of the icons phase) - icGhost = 0, -- ghost building pass - icKeysort = 0, -- sort key computation + building/mobile split - icSort = 0, -- table.sort calls - icProcess = 0, -- processUnit loop - icProcBldg = 0, -- processUnit: buildings sub-loop + icGhost = 0, -- ghost building pass + icKeysort = 0, -- sort key computation + building/mobile split + icSort = 0, -- table.sort calls + icProcess = 0, -- processUnit loop + icProcBldg = 0, -- processUnit: buildings sub-loop icProcMobile = 0, -- processUnit: fast mobile units sub-loop icProcSlowMobile = 0, -- processUnit: slow mobile units sub-loop - icProcBldgN = 0, -- count of buildings processed - icProcMobileN = 0,-- count of fast mobile units processed + icProcBldgN = 0, -- count of buildings processed + icProcMobileN = 0, -- count of fast mobile units processed icProcSlowMobileN = 0, -- count of slow mobile units processed - icUpload = 0, -- VBO upload to GPU - icDraw = 0, -- shader setup + draw calls + icUpload = 0, -- VBO upload to GPU + icDraw = 0, -- shader setup + draw calls icUploadDraw = 0, -- VBO upload + shader setup + draw calls (combined) - icUnitpics = 0, -- unitpic overlay rendering - icVboReuse = 0, -- VBO reuse rate (0 = never, 1 = always) - trailEmaUp = 0.35, -- Fast rise: respond quickly when projectile count spikes + icUnitpics = 0, -- unitpic overlay rendering + icVboReuse = 0, -- VBO reuse rate (0 = never, 1 = always) + trailEmaUp = 0.35, -- Fast rise: respond quickly when projectile count spikes trailEmaDown = 0.12, -- Slow fall: don't flicker trails back on immediately } -local PERF_SMOOTH = 0.1 -- EMA smoothing factor +local PERF_SMOOTH = 0.1 -- EMA smoothing factor -- Per-frame trail skip flag: set before the projectile draw loop, checked inside DrawProjectile. -- When true, missile smoke trails and plasma trails are skipped to save GL calls. @@ -1812,9 +1869,15 @@ local visibleProjEMA = 0 -- Returns adjusted cap based on last frame's item count local function GetDetailCap(baseCap) local items = perfTimers.itemCount - if items < 400 then return baseCap end - if items < 800 then return math.floor(baseCap * 0.7) end - if items < 1200 then return math.floor(baseCap * 0.5) end + if items < 400 then + return baseCap + end + if items < 800 then + return math.floor(baseCap * 0.7) + end + if items < 1200 then + return math.floor(baseCap * 0.5) + end return math.floor(baseCap * 0.3) end @@ -1822,7 +1885,7 @@ end -- damageFlash[unitID] = {time = gameTime, intensity = clamp(damage/maxHP)} -- Fade duration in seconds, intensity proportional to damage relative to max health local damageFlash = {} -local DAMAGE_FLASH_DURATION = 0.4 -- seconds to fade from full red to normal +local DAMAGE_FLASH_DURATION = 0.4 -- seconds to fade from full red to normal -- Self-destruct tracking: event-driven set of units with active self-destruct countdown -- Maintained via UnitCommand callin + periodic refresh (every ~30 frames) @@ -1832,11 +1895,11 @@ local selfDUnits = {} -- Command FX: brief fading command lines when orders are given (like Commands FX widget) -- Each entry: {unitID, targetX, targetZ, cmdID, time, unitX, unitZ} local commandFX = { - list = {}, -- array of active command FX entries + list = {}, -- array of active command FX entries count = 0, lastTarget = {}, -- [unitID] = {x, z, time} — last command FX target per unit for chaining - newUnits = {}, -- [unitID] = gameTime — tracks recently finished units to suppress rally commands - MAX = 300, -- max simultaneous FX entries + newUnits = {}, -- [unitID] = gameTime — tracks recently finished units to suppress rally commands + MAX = 300, -- max simultaneous FX entries } local seismicPingDlists = { @@ -1869,8 +1932,8 @@ do local _, _, _, isAI = Spring.GetTeamInfo(teamID, false) if isAI then aiTeams[teamID] = true - local luaAI = Spring.GetTeamLuaAI(teamID) or '' - if string.find(luaAI, 'Scavenger') or string.find(luaAI, 'Raptor') then + local luaAI = Spring.GetTeamLuaAI(teamID) or "" + if string.find(luaAI, "Scavenger") or string.find(luaAI, "Raptor") then scavRaptorTeams[teamID] = true end end @@ -1879,54 +1942,62 @@ end -- Command colors local cmdColors = { - unknown = {1.0, 1.0, 1.0, 0.7}, - [CMD.STOP] = {0.0, 0.0, 0.0, 0.7}, - [CMD.WAIT] = {0.5, 0.5, 0.5, 0.7}, + unknown = { 1.0, 1.0, 1.0, 0.7 }, + [CMD.STOP] = { 0.0, 0.0, 0.0, 0.7 }, + [CMD.WAIT] = { 0.5, 0.5, 0.5, 0.7 }, -- [CMD.BUILD] = {0.0, 1.0, 0.0, 0.3}, -- BUILD handled by specific build commands - [CMD.MOVE] = {0.5, 1.0, 0.5, 0.3}, - [CMD.ATTACK] = {1.0, 0.2, 0.2, 0.3}, - [CMD.FIGHT] = {1.0, 0.2, 1.0, 0.3}, - [CMD.GUARD] = {0.6, 1.0, 1.0, 0.3}, - [CMD.PATROL] = {0.2, 0.5, 1.0, 0.3}, - [CMD.CAPTURE] = {1.0, 1.0, 0.3, 0.6}, - [CMD.REPAIR] = {1.0, 0.9, 0.2, 0.6}, - [CMD.RECLAIM] = {0.5, 1.0, 0.4, 0.3}, - [CMD.RESTORE] = {0.0, 1.0, 0.0, 0.3}, - [CMD.RESURRECT] = {0.9, 0.5, 1.0, 0.5}, - [CMD.LOAD_UNITS]= {0.4, 0.9, 0.9, 0.7}, - [CMD.UNLOAD_UNIT] = {1.0, 0.8, 0.0, 0.7}, - [CMD.UNLOAD_UNITS]= {1.0, 0.8, 0.0, 0.7}, - [GameCMD.UNIT_SET_TARGET_NO_GROUND] = {1.0, 0.75, 0.0, 0.3}, + [CMD.MOVE] = { 0.5, 1.0, 0.5, 0.3 }, + [CMD.ATTACK] = { 1.0, 0.2, 0.2, 0.3 }, + [CMD.FIGHT] = { 1.0, 0.2, 1.0, 0.3 }, + [CMD.GUARD] = { 0.6, 1.0, 1.0, 0.3 }, + [CMD.PATROL] = { 0.2, 0.5, 1.0, 0.3 }, + [CMD.CAPTURE] = { 1.0, 1.0, 0.3, 0.6 }, + [CMD.REPAIR] = { 1.0, 0.9, 0.2, 0.6 }, + [CMD.RECLAIM] = { 0.5, 1.0, 0.4, 0.3 }, + [CMD.RESTORE] = { 0.0, 1.0, 0.0, 0.3 }, + [CMD.RESURRECT] = { 0.9, 0.5, 1.0, 0.5 }, + [CMD.LOAD_UNITS] = { 0.4, 0.9, 0.9, 0.7 }, + [CMD.UNLOAD_UNIT] = { 1.0, 0.8, 0.0, 0.7 }, + [CMD.UNLOAD_UNITS] = { 1.0, 0.8, 0.0, 0.7 }, + [GameCMD.UNIT_SET_TARGET_NO_GROUND] = { 1.0, 0.75, 0.0, 0.3 }, } -- Command ID to cursor name mapping local cmdCursors = { - [CMD.ATTACK] = 'Attack', - [CMD.GUARD] = 'Guard', - [CMD.REPAIR] = 'Repair', - [CMD.RECLAIM] = 'Reclaim', - [CMD.CAPTURE] = 'Capture', - [CMD.RESURRECT] = 'Resurrect', - [CMD.RESTORE] = 'Restore', - [CMD.PATROL] = 'Patrol', - [CMD.FIGHT] = 'Fight', - [CMD.LOAD_UNITS] = 'Load units', - [CMD.UNLOAD_UNIT] = 'Unload units', - [CMD.UNLOAD_UNITS] = 'Unload units', - [CMD.DGUN] = 'Attack', -- DGun cursor doesnt work, use Attack instead - [GameCMD.UNIT_SET_TARGET_NO_GROUND] = 'settarget', + [CMD.ATTACK] = "Attack", + [CMD.GUARD] = "Guard", + [CMD.REPAIR] = "Repair", + [CMD.RECLAIM] = "Reclaim", + [CMD.CAPTURE] = "Capture", + [CMD.RESURRECT] = "Resurrect", + [CMD.RESTORE] = "Restore", + [CMD.PATROL] = "Patrol", + [CMD.FIGHT] = "Fight", + [CMD.LOAD_UNITS] = "Load units", + [CMD.UNLOAD_UNIT] = "Unload units", + [CMD.UNLOAD_UNITS] = "Unload units", + [CMD.DGUN] = "Attack", -- DGun cursor doesnt work, use Attack instead + [GameCMD.UNIT_SET_TARGET_NO_GROUND] = "settarget", } - - -- What commands are issued at a position or unit/feature ID (Only used by GetUnitPosition) local positionCmds = { - [CMD.MOVE]=true, [CMD.ATTACK]=true, [CMD.RECLAIM]=true, [CMD.RESTORE]=true, [CMD.RESURRECT]=true, - [CMD.PATROL]=true, [CMD.CAPTURE]=true, [CMD.FIGHT]=true, [CMD.DGUN]=true, [38521]=true, -- jump - [CMD.UNLOAD_UNIT]=true, [CMD.UNLOAD_UNITS]=true,[CMD.LOAD_UNITS]=true, [CMD.GUARD]=true, + [CMD.MOVE] = true, + [CMD.ATTACK] = true, + [CMD.RECLAIM] = true, + [CMD.RESTORE] = true, + [CMD.RESURRECT] = true, + [CMD.PATROL] = true, + [CMD.CAPTURE] = true, + [CMD.FIGHT] = true, + [CMD.DGUN] = true, + [38521] = true, -- jump + [CMD.UNLOAD_UNIT] = true, + [CMD.UNLOAD_UNITS] = true, + [CMD.LOAD_UNITS] = true, + [CMD.GUARD] = true, } - ---------------------------------------------------------------------------------------------------- -- Speedups ---------------------------------------------------------------------------------------------------- @@ -1995,7 +2066,7 @@ local spFunc = { -- Map/game constants local mapInfo do - local success, mapinfo = pcall(VFS.Include,"mapinfo.lua") + local success, mapinfo = pcall(VFS.Include, "mapinfo.lua") local voidWater = false if success and mapinfo then voidWater = mapinfo.voidwater @@ -2009,49 +2080,49 @@ do maxGroundHeight = nil, hasWater = false, isLava = false, - voidWater = voidWater + voidWater = voidWater, } mapInfo.minGroundHeight, mapInfo.maxGroundHeight = Spring.GetGroundExtremes() local waterIsLava = Spring.GetModOptions().map_waterislava mapInfo.isLava = Spring.Lava.isLavaMap or (waterIsLava and waterIsLava ~= 0 and waterIsLava ~= "0") end mapInfo.hasWater = mapInfo.minGroundHeight < 0 or mapInfo.isLava -mapInfo.dynamicWaterLevel = nil -- current water/lava level (nil = static sea level = 0) -mapInfo.lastCheckedWaterLevel = nil -- for change detection +mapInfo.dynamicWaterLevel = nil -- current water/lava level (nil = static sea level = 0) +mapInfo.lastCheckedWaterLevel = nil -- for change detection -- Parse lava config from Spring.Lava for minimap overlay shader -mapInfo.lavaCoastWidth = 25.0 -- default -mapInfo.lavaCoastColor = {2.0, 0.5, 0.0} -- default: bright orange (HDR) +mapInfo.lavaCoastWidth = 25.0 -- default +mapInfo.lavaCoastColor = { 2.0, 0.5, 0.0 } -- default: bright orange (HDR) mapInfo.lavaDiffuseEmitTex = nil mapInfo.lavaUvScale = 2.0 mapInfo.lavaSwirlFreq = 0.025 mapInfo.lavaSwirlAmp = 0.003 -mapInfo.mapRatio = Game.mapSizeZ / Game.mapSizeX -- Y/X aspect ratio for square-texel tiling -mapInfo.lavaColorCorrection = {1.0, 1.0, 1.0} -- default: no color correction +mapInfo.mapRatio = Game.mapSizeZ / Game.mapSizeX -- Y/X aspect ratio for square-texel tiling +mapInfo.lavaColorCorrection = { 1.0, 1.0, 1.0 } -- default: no color correction if mapInfo.isLava then mapInfo.lavaCoastWidth = Spring.Lava.coastWidth or 25.0 mapInfo.lavaUvScale = Spring.Lava.uvScale or 2.0 mapInfo.lavaSwirlFreq = Spring.Lava.swirlFreq or 0.025 mapInfo.lavaSwirlAmp = Spring.Lava.swirlAmp or 0.003 - mapInfo.lavaDiffuseEmitTex = Spring.Lava.diffuseEmitTex -- e.g. "LuaUI/images/lava/lava2_diffuseemit.dds" - mapInfo.lavaDistortionTex = "LuaUI/images/lavadistortion.png" -- big flowing distortion texture + mapInfo.lavaDiffuseEmitTex = Spring.Lava.diffuseEmitTex -- e.g. "LuaUI/images/lava/lava2_diffuseemit.dds" + mapInfo.lavaDistortionTex = "LuaUI/images/lavadistortion.png" -- big flowing distortion texture mapInfo.lavaTideAmplitude = Spring.Lava.tideAmplitude or 2 mapInfo.lavaTidePeriod = Spring.Lava.tidePeriod or 200 local cc = Spring.Lava.coastColor if cc and type(cc) == "string" then local cr, cg, cb = cc:match("vec3%s*%((.-),%s*(.-),%s*(.-)%)") if cr then - mapInfo.lavaCoastColor = {tonumber(cr) or 2.0, tonumber(cg) or 0.5, tonumber(cb) or 0.0} + mapInfo.lavaCoastColor = { tonumber(cr) or 2.0, tonumber(cg) or 0.5, tonumber(cb) or 0.0 } end end -- Parse colorCorrection: a final color multiplier applied to ALL lava output. -- Acid/green lava maps use e.g. vec3(0.15, 1.0, 0.45) while red lava uses (1,1,1). - mapInfo.lavaColorCorrection = {1.0, 1.0, 1.0} + mapInfo.lavaColorCorrection = { 1.0, 1.0, 1.0 } local ccStr = Spring.Lava.colorCorrection if ccStr and type(ccStr) == "string" then local cr2, cg2, cb2 = ccStr:match("vec3%s*%((.-),%s*(.-),%s*(.-)%)") if cr2 then - mapInfo.lavaColorCorrection = {tonumber(cr2) or 1.0, tonumber(cg2) or 1.0, tonumber(cb2) or 1.0} + mapInfo.lavaColorCorrection = { tonumber(cr2) or 1.0, tonumber(cg2) or 1.0, tonumber(cb2) or 1.0 } end end end @@ -2059,14 +2130,14 @@ end -- Read BumpWater rendering properties for animated water overlay (non-lava water maps) if mapInfo.hasWater and not mapInfo.isLava then local sr, sg, sb = gl.GetWaterRendering("surfaceColor") - mapInfo.waterSurfaceColor = {sr or 0.75, sg or 0.8, sb or 0.85} + mapInfo.waterSurfaceColor = { sr or 0.75, sg or 0.8, sb or 0.85 } mapInfo.waterSurfaceAlpha = gl.GetWaterRendering("surfaceAlpha") or 0.55 local ar, ag, ab = gl.GetWaterRendering("absorb") - mapInfo.waterAbsorbColor = {ar or 0, ag or 0, ab or 0} + mapInfo.waterAbsorbColor = { ar or 0, ag or 0, ab or 0 } local br, bg, bb = gl.GetWaterRendering("baseColor") - mapInfo.waterBaseColorRGB = {br or 0.6, bg or 0.6, bb or 0.75} + mapInfo.waterBaseColorRGB = { br or 0.6, bg or 0.6, bb or 0.75 } local mr, mg, mb = gl.GetWaterRendering("minColor") - mapInfo.waterMinColor = {mr or 0, mg or 0, mb or 0} + mapInfo.waterMinColor = { mr or 0, mg or 0, mb or 0 } mapInfo.waterCausticsStrength = gl.GetWaterRendering("causticsStrength") or 0.08 mapInfo.waterPerlinStartFreq = gl.GetWaterRendering("perlinStartFreq") or 8 mapInfo.waterPerlinLacunarity = gl.GetWaterRendering("perlinLacunarity") or 3 @@ -2082,7 +2153,7 @@ if mapInfo.isLava then heatDistortX = 0, heatDistortZ = 0, smoothFPS = 15, - gadgetPushed = false, -- true once gadget pushes data + gadgetPushed = false, -- true once gadget pushes data } end @@ -2104,84 +2175,81 @@ if mapInfo.isLava or mapInfo.hasWater then end end - - - ---------------------------------------------------------------------------------------------------- -- Buttons (Must be declared after variables) local buttons = { { - texture = 'LuaUI/Images/pip/PipCopy.png', - tooltipKey = 'ui.pip.copy', - command = 'pip_copy', + texture = "LuaUI/Images/pip/PipCopy.png", + tooltipKey = "ui.pip.copy", + command = "pip_copy", OnPress = function() - local sizex, sizez = Spring.GetWindowGeometry() - local _, pos = Spring.TraceScreenRay(sizex/2, sizez/2, true) - if pos and pos[2] > -10000 then - -- Set PIP camera to main camera position with rounding to match switch behavior - local copiedX = math.floor(pos[1] + 0.5) - local copiedZ = math.floor(pos[3] + 0.5) - -- Set target for smooth transition (don't set cameraState.wcx/cameraState.wcz directly) - cameraState.targetWcx, cameraState.targetWcz = copiedX, copiedZ - miscState.isSwitchingViews = true -- Enable fast transition for pip_copy - RecalculateWorldCoordinates() - RecalculateGroundTextureCoordinates() - -- Disable tracking when copying camera - interactionState.areTracking = nil - interactionState.trackingPlayerID = nil - -- Store the copied position in backup so switching maintains same position - miscState.backupTracking = { - tracking = nil, - trackingPlayerID = nil, - camX = copiedX, - camZ = copiedZ - } - end + local sizex, sizez = Spring.GetWindowGeometry() + local _, pos = Spring.TraceScreenRay(sizex / 2, sizez / 2, true) + if pos and pos[2] > -10000 then + -- Set PIP camera to main camera position with rounding to match switch behavior + local copiedX = math.floor(pos[1] + 0.5) + local copiedZ = math.floor(pos[3] + 0.5) + -- Set target for smooth transition (don't set cameraState.wcx/cameraState.wcz directly) + cameraState.targetWcx, cameraState.targetWcz = copiedX, copiedZ + miscState.isSwitchingViews = true -- Enable fast transition for pip_copy + RecalculateWorldCoordinates() + RecalculateGroundTextureCoordinates() + -- Disable tracking when copying camera + interactionState.areTracking = nil + interactionState.trackingPlayerID = nil + -- Store the copied position in backup so switching maintains same position + miscState.backupTracking = { + tracking = nil, + trackingPlayerID = nil, + camX = copiedX, + camZ = copiedZ, + } end + end, }, { - texture = 'LuaUI/Images/pip/PipSwitch.png', - tooltipKey = 'ui.pip.switch', - command = 'pip_switch', + texture = "LuaUI/Images/pip/PipSwitch.png", + tooltipKey = "ui.pip.switch", + command = "pip_switch", OnPress = function() - local sizex, sizez = Spring.GetWindowGeometry() - local _, pos = Spring.TraceScreenRay(sizex/2, sizez/2, true) - if pos and pos[2] > -10000 then - -- Always read the current main camera position - local mainCamX = math.floor(pos[1] + 0.5) - local mainCamZ = math.floor(pos[3] + 0.5) - - -- Calculate the actual center of tracked units (if tracking) for main view camera - local pipCameraTargetX, pipCameraTargetZ = math.floor(cameraState.wcx + 0.5), math.floor(cameraState.wcz + 0.5) - if config.switchInheritsTracking and interactionState.areTracking and #interactionState.areTracking > 0 then - -- Calculate average position of tracked units (not margin-corrected camera) - local uCount = 0 - local ax, az = 0, 0 - for i = 1, #interactionState.areTracking do - local uID = interactionState.areTracking[i] - local ux, uy, uz = spFunc.GetUnitBasePosition(uID) - if ux then - ax = ax + ux - az = az + uz - uCount = uCount + 1 - end - end - if uCount > 0 then - pipCameraTargetX = math.floor((ax / uCount) + 0.5) - pipCameraTargetZ = math.floor((az / uCount) + 0.5) + local sizex, sizez = Spring.GetWindowGeometry() + local _, pos = Spring.TraceScreenRay(sizex / 2, sizez / 2, true) + if pos and pos[2] > -10000 then + -- Always read the current main camera position + local mainCamX = math.floor(pos[1] + 0.5) + local mainCamZ = math.floor(pos[3] + 0.5) + + -- Calculate the actual center of tracked units (if tracking) for main view camera + local pipCameraTargetX, pipCameraTargetZ = math.floor(cameraState.wcx + 0.5), math.floor(cameraState.wcz + 0.5) + if config.switchInheritsTracking and interactionState.areTracking and #interactionState.areTracking > 0 then + -- Calculate average position of tracked units (not margin-corrected camera) + local uCount = 0 + local ax, az = 0, 0 + for i = 1, #interactionState.areTracking do + local uID = interactionState.areTracking[i] + local ux, uy, uz = spFunc.GetUnitBasePosition(uID) + if ux then + ax = ax + ux + az = az + uz + uCount = uCount + 1 end + end + if uCount > 0 then + pipCameraTargetX = math.floor((ax / uCount) + 0.5) + pipCameraTargetZ = math.floor((az / uCount) + 0.5) + end - -- First untrack anything in main view - Spring.SendCommands("track") - -- Then track the PIP units in main view - for i = 1, #interactionState.areTracking do - Spring.SendCommands("track " .. interactionState.areTracking[i]) - end - else - -- If not tracking in PIP or feature disabled, untrack in main view - Spring.SendCommands("track") + -- First untrack anything in main view + Spring.SendCommands("track") + -- Then track the PIP units in main view + for i = 1, #interactionState.areTracking do + Spring.SendCommands("track " .. interactionState.areTracking[i]) end + else + -- If not tracking in PIP or feature disabled, untrack in main view + Spring.SendCommands("track") + end -- Swap tracking state: current PIP tracking <-> backup -- This ensures toggling switch restores previous tracking states @@ -2204,8 +2272,8 @@ local buttons = { tracking = currentPipTracking, trackingPlayerID = currentPipTrackingPlayerID, camX = currentPipCamX, - camZ = currentPipCamZ - } -- Switch camera positions - use rounded coordinates + camZ = currentPipCamZ, + } -- Switch camera positions - use rounded coordinates Spring.SetCameraTarget(pipCameraTargetX, 0, pipCameraTargetZ, config.switchTransitionTime) -- Set PIP camera target for smooth transition (don't set cameraState.wcx/cameraState.wcz directly) cameraState.targetWcx, cameraState.targetWcz = mainCamX, mainCamZ @@ -2213,18 +2281,18 @@ local buttons = { RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() - -- If feature is disabled, ensure main camera is not tracking - if not config.switchInheritsTracking then - Spring.SendCommands("track") - end + -- If feature is disabled, ensure main camera is not tracking + if not config.switchInheritsTracking then + Spring.SendCommands("track") end end + end, }, { - texture = 'LuaUI/Images/pip/PipT.png', - tooltipKey = 'ui.pip.track', - tooltipActiveKey = 'ui.pip.untrack', - command = 'pip_track', + texture = "LuaUI/Images/pip/PipT.png", + tooltipKey = "ui.pip.track", + tooltipActiveKey = "ui.pip.untrack", + command = "pip_track", OnPress = function() local selectedUnits = Spring.GetSelectedUnits() if #selectedUnits > 0 then @@ -2266,13 +2334,13 @@ local buttons = { -- No selection: clear tracking interactionState.areTracking = nil end - end + end, }, { - texture = 'LuaUI/Images/pip/PipView.png', - tooltipKey = 'ui.pip.view', - tooltipActiveKey = 'ui.pip.unview', - command = 'pip_view', + texture = "LuaUI/Images/pip/PipView.png", + tooltipKey = "ui.pip.view", + tooltipActiveKey = "ui.pip.unview", + command = "pip_view", OnPress = function() state.losViewEnabled = not state.losViewEnabled if state.losViewEnabled then @@ -2281,7 +2349,9 @@ local buttons = { -- Immediately scan enemy buildings the viewed allyteam knows about -- Only include buildings the allyteam has seen (LOS_INLOS or LOS_PREVLOS) if cameraState.mySpecState then - for k in pairs(ghostBuildings) do ghostBuildings[k] = nil end + for k in pairs(ghostBuildings) do + ghostBuildings[k] = nil + end local scanAllyTeam = state.losViewAllyTeam local allUnits = Spring.GetAllUnits() for _, uID in ipairs(allUnits) do @@ -2307,20 +2377,22 @@ local buttons = { -- Clear ghost buildings when disabling LOS view as spectator -- (spectators with full view see everything, ghosts are meaningless) if cameraState.mySpecState then - for k in pairs(ghostBuildings) do ghostBuildings[k] = nil end + for k in pairs(ghostBuildings) do + ghostBuildings[k] = nil + end end end pipR2T.losNeedsUpdate = true pipR2T.frameNeedsUpdate = true pipR2T.unitsNeedsUpdate = true pipR2T.contentNeedsUpdate = true - end + end, }, { - texture = 'LuaUI/Images/pip/PipCam.png', - tooltipKey = 'ui.pip.camera', - tooltipActiveKey = 'ui.pip.uncamera', - command = 'pip_trackplayer', + texture = "LuaUI/Images/pip/PipCam.png", + tooltipKey = "ui.pip.camera", + tooltipActiveKey = "ui.pip.uncamera", + command = "pip_trackplayer", OnPress = function() if interactionState.trackingPlayerID then -- Stop tracking player @@ -2384,13 +2456,13 @@ local buttons = { end end end - end + end, }, { - texture = 'LuaUI/Images/pip/PipTV.png', - tooltipKey = 'ui.pip.tv', - tooltipActiveKey = 'ui.pip.untv', - command = 'pip_tv', + texture = "LuaUI/Images/pip/PipTV.png", + tooltipKey = "ui.pip.tv", + tooltipActiveKey = "ui.pip.untv", + command = "pip_tv", OnPress = function() miscState.tvEnabled = not miscState.tvEnabled if miscState.tvEnabled then @@ -2402,7 +2474,9 @@ local buttons = { pipTV.director.idle = true pipTV.director.lastOverviewTime = os.clock() -- Register in shared focus table for cross-PIP coordination - if not WG.pipTVFocus then WG.pipTVFocus = {} end + if not WG.pipTVFocus then + WG.pipTVFocus = {} + end WG.pipTVFocus[pipNumber] = { x = cameraState.targetWcx, z = cameraState.targetWcz } -- Disable activity focus and player tracking when TV mode is on if miscState.activityFocusActive then @@ -2421,17 +2495,19 @@ local buttons = { -- Unregister from shared focus table if WG.pipTVFocus then WG.pipTVFocus[pipNumber] = nil - if not next(WG.pipTVFocus) then WG.pipTVFocus = nil end + if not next(WG.pipTVFocus) then + WG.pipTVFocus = nil + end end end pipR2T.frameNeedsUpdate = true - end + end, }, { - texture = 'LuaUI/Images/pip/PipActivity.png', - tooltipKey = 'ui.pip.activity', - tooltipActiveKey = 'ui.pip.unactivity', - command = 'pip_activity', + texture = "LuaUI/Images/pip/PipActivity.png", + tooltipKey = "ui.pip.activity", + tooltipActiveKey = "ui.pip.unactivity", + command = "pip_activity", OnPress = function() miscState.activityFocusEnabled = not miscState.activityFocusEnabled if not miscState.activityFocusEnabled and miscState.activityFocusActive then @@ -2444,23 +2520,23 @@ local buttons = { miscState.activityFocusActive = false end pipR2T.frameNeedsUpdate = true - end + end, }, { - texture = 'LuaUI/Images/pip/PipHelp.png', - tooltipKey = 'ui.pip.help', - command = 'pip_help', + texture = "LuaUI/Images/pip/PipHelp.png", + tooltipKey = "ui.pip.help", + command = "pip_help", OnPress = function() -- No action: the help button only shows its tooltip on hover - end + end, }, { - texture = 'LuaUI/Images/pip/PipMove.png', - tooltipKey = 'ui.pip.move', -- No command, no shortcut + texture = "LuaUI/Images/pip/PipMove.png", + tooltipKey = "ui.pip.move", -- No command, no shortcut command = nil, OnPress = function() interactionState.areDragging = true - end + end, }, } @@ -2469,7 +2545,7 @@ for i = 1, #buttons do local btn = buttons[i] if btn.command then -- Unique action name per pip instance (e.g. pip_copy → pip1_copy) - btn.actionName = 'pip' .. pipNumber .. '_' .. btn.command:sub(5) + btn.actionName = "pip" .. pipNumber .. "_" .. btn.command:sub(5) end end @@ -2512,7 +2588,7 @@ local shaders = { } ]], uniformFloat = { - losScale = config.losOverlayOpacity, -- Controls darkening intensity + losScale = config.losOverlayOpacity, -- Controls darkening intensity showRadar = config.showLosRadar and 1.0 or 0.0, }, uniformInt = { @@ -3008,15 +3084,15 @@ void main() { lavaDistortTex = 2, }, uniformFloat = { - waterColor = {0, 0.04, 0.25, 0.5}, + waterColor = { 0, 0.04, 0.25, 0.5 }, waterLevel = 0, isLava = 0, hasLavaTex = 0, hasDistortTex = 0, gameFrames = 0, - lavaCoastColor = {2.0, 0.5, 0.0}, - lavaHighlightColor = {0.3, 0.08, 0.0}, - colorCorrection = {1.0, 1.0, 1.0}, + lavaCoastColor = { 2.0, 0.5, 0.0 }, + lavaHighlightColor = { 0.3, 0.08, 0.0 }, + colorCorrection = { 1.0, 1.0, 1.0 }, lavaCoastWidth = 25.0, lavaUvScale = 2.0, lavaSwirlFreq = 0.025, @@ -3026,11 +3102,11 @@ void main() { heatDistortX = 0, heatDistortZ = 0, -- BumpWater defaults (overridden at draw time from map config) - wSurfColor = {0.3, 0.32, 0.34}, + wSurfColor = { 0.3, 0.32, 0.34 }, wSurfAlpha = 0.55, - wAbsorbColor = {0, 0, 0}, - wBaseColor = {0.6, 0.6, 0.75}, - wMinColor = {0, 0, 0}, + wAbsorbColor = { 0, 0, 0 }, + wBaseColor = { 0.6, 0.6, 0.75 }, + wMinColor = { 0, 0, 0 }, wCausticsStr = 0.08, wPerlinStart = 8.0, wPerlinLacun = 3.0, @@ -3042,11 +3118,11 @@ void main() { } local teamColors = {} -local teamAllyTeamCache = {} -- teamID -> allyTeamID mapping (avoids per-unit GetTeamInfo calls) +local teamAllyTeamCache = {} -- teamID -> allyTeamID mapping (avoids per-unit GetTeamInfo calls) local teamList = Spring.GetTeamList() for i = 1, #teamList do local tID = teamList[i] - teamColors[tID] = {Spring.GetTeamColor(tID)} + teamColors[tID] = { Spring.GetTeamColor(tID) } teamAllyTeamCache[tID] = select(6, Spring.GetTeamInfo(tID, false)) end @@ -3633,7 +3709,9 @@ gl4Prim.lineShaderCode = { -- atlasUVs is keyed by unitDefID for uniform lookup. local function InitGL4Icons() -- Already initialized — skip to avoid leaking GPU resources - if gl4Icons.enabled then return end + if gl4Icons.enabled then + return + end if not gl.GetVAO or not gl.GetVBO then Spring.Echo("[PIP] GL4 icons: VAO/VBO not available, falling back to legacy") @@ -3651,27 +3729,27 @@ local function InitGL4Icons() return end - local iconsTexInfo = gl.TextureInfo('$icons') + local iconsTexInfo = gl.TextureInfo("$icons") if not iconsTexInfo or iconsTexInfo.xsize <= 0 then Spring.Echo("[PIP] GL4 icons: $icons texture not available, falling back to legacy") return end local dtc = defaultIconData.atlasTexCoords - gl4Icons.defaultUV = {dtc.x0, dtc.y1, dtc.x1, dtc.y0} + gl4Icons.defaultUV = { dtc.x0, dtc.y1, dtc.x1, dtc.y0 } for uDefID, uDef in pairs(UnitDefs) do local iconName = uDef.iconType or "default" local iconInfo = Spring.GetIconData(iconName) if iconInfo and iconInfo.atlasTexCoords then local atc = iconInfo.atlasTexCoords - gl4Icons.atlasUVs[uDefID] = {atc.x0, atc.y1, atc.x1, atc.y0} + gl4Icons.atlasUVs[uDefID] = { atc.x0, atc.y1, atc.x1, atc.y0 } else gl4Icons.atlasUVs[uDefID] = gl4Icons.defaultUV end end - gl4Icons.atlas = '$icons' + gl4Icons.atlas = "$icons" --Spring.Echo("[PIP] GL4 icons: Using engine icon atlas ($icons, " .. iconsTexInfo.xsize .. "x" .. iconsTexInfo.ysize .. ")") -- Create raw VBO directly (no InstanceVBOTable — avoids per-frame table allocations) @@ -3696,15 +3774,15 @@ local function InitGL4Icons() local vboLayout if useGS then vboLayout = { - {id = 0, name = 'worldPos_size', size = 4}, -- worldX, worldZ, sizeScale, isRadar - {id = 1, name = 'atlasUV', size = 4}, -- u0, v0, u1, v1 - {id = 2, name = 'colorFlags', size = 4}, -- r, g, b, wobblePhase + { id = 0, name = "worldPos_size", size = 4 }, -- worldX, worldZ, sizeScale, isRadar + { id = 1, name = "atlasUV", size = 4 }, -- u0, v0, u1, v1 + { id = 2, name = "colorFlags", size = 4 }, -- r, g, b, wobblePhase } else vboLayout = { - {id = 1, name = 'worldPos_size', size = 4}, - {id = 2, name = 'atlasUV', size = 4}, - {id = 3, name = 'colorFlags', size = 4}, + { id = 1, name = "worldPos_size", size = 4 }, + { id = 2, name = "atlasUV", size = 4 }, + { id = 3, name = "colorFlags", size = 4 }, } end local vbo = gl.GetVBO(GL.ARRAY_BUFFER, true) @@ -3735,12 +3813,16 @@ local function InitGL4Icons() gl4Icons.vbo = nil return end - quadVBO:Define(4, {{id = 0, name = 'quadPos', size = 2}}) + quadVBO:Define(4, { { id = 0, name = "quadPos", size = 2 } }) quadVBO:Upload({ - -1.0, -1.0, - 1.0, -1.0, - -1.0, 1.0, - 1.0, 1.0, + -1.0, + -1.0, + 1.0, + -1.0, + -1.0, + 1.0, + 1.0, + 1.0, }) gl4Icons.quadVBO = quadVBO end @@ -3750,7 +3832,10 @@ local function InitGL4Icons() Spring.Echo("[PIP] GL4 icons: Failed to create VAO") gl.DeleteShader(shader) vbo:Delete() - if gl4Icons.quadVBO then gl4Icons.quadVBO:Delete(); gl4Icons.quadVBO = nil end + if gl4Icons.quadVBO then + gl4Icons.quadVBO:Delete() + gl4Icons.quadVBO = nil + end gl4Icons.atlas = nil gl4Icons.vbo = nil return @@ -3784,7 +3869,10 @@ local function InitGL4Icons() bldgVbo:Delete() vao:Delete() vbo:Delete() - if gl4Icons.quadVBO then gl4Icons.quadVBO:Delete(); gl4Icons.quadVBO = nil end + if gl4Icons.quadVBO then + gl4Icons.quadVBO:Delete() + gl4Icons.quadVBO = nil + end gl4Icons.atlas = nil gl4Icons.vbo = nil gl4Icons.vao = nil @@ -3833,7 +3921,10 @@ local function InitGL4Icons() bldgVbo:Delete() vao:Delete() vbo:Delete() - if gl4Icons.quadVBO then gl4Icons.quadVBO:Delete(); gl4Icons.quadVBO = nil end + if gl4Icons.quadVBO then + gl4Icons.quadVBO:Delete() + gl4Icons.quadVBO = nil + end gl4Icons.atlas = nil gl4Icons.vbo = nil gl4Icons.vao = nil @@ -3863,15 +3954,15 @@ local function InitGL4Icons() -- Cache uniform locations for per-frame updates gl4Icons.uniformLocs = { - wtp_scale = gl.GetUniformLocation(shader, "wtp_scale"), - wtp_offset = gl.GetUniformLocation(shader, "wtp_offset"), - ndcScale = gl.GetUniformLocation(shader, "ndcScale"), - rotSC = gl.GetUniformLocation(shader, "rotSC"), - rotCenter = gl.GetUniformLocation(shader, "rotCenter"), + wtp_scale = gl.GetUniformLocation(shader, "wtp_scale"), + wtp_offset = gl.GetUniformLocation(shader, "wtp_offset"), + ndcScale = gl.GetUniformLocation(shader, "ndcScale"), + rotSC = gl.GetUniformLocation(shader, "rotSC"), + rotCenter = gl.GetUniformLocation(shader, "rotCenter"), iconBaseSize = gl.GetUniformLocation(shader, "iconBaseSize"), - gameTime = gl.GetUniformLocation(shader, "gameTime"), + gameTime = gl.GetUniformLocation(shader, "gameTime"), wallClockTime = gl.GetUniformLocation(shader, "wallClockTime"), - outlinePass = gl.GetUniformLocation(shader, "outlinePass"), + outlinePass = gl.GetUniformLocation(shader, "outlinePass"), healthDarkenMax = gl.GetUniformLocation(shader, "healthDarkenMax"), } @@ -3931,30 +4022,43 @@ end local function CreateLineVBOSet(maxVertices) local vboLayout = { - {id = 0, name = 'worldPos', size = 2}, -- worldX, worldZ - {id = 1, name = 'vertColor', size = 4}, -- r, g, b, a + { id = 0, name = "worldPos", size = 2 }, -- worldX, worldZ + { id = 1, name = "vertColor", size = 4 }, -- r, g, b, a } local vbo = gl.GetVBO(GL.ARRAY_BUFFER, true) - if not vbo then return nil, nil, nil end + if not vbo then + return nil, nil, nil + end vbo:Define(maxVertices, vboLayout) local vao = gl.GetVAO() - if not vao then vbo:Delete(); return nil, nil, nil end + if not vao then + vbo:Delete() + return nil, nil, nil + end vao:AttachVertexBuffer(vbo) local data = {} - for i = 1, maxVertices * gl4Prim.LINE_STEP do data[i] = 0 end + for i = 1, maxVertices * gl4Prim.LINE_STEP do + data[i] = 0 + end return vbo, vao, data end local function InitGL4Primitives() - if not gl.GetVAO or not gl.GetVBO then return end + if not gl.GetVAO or not gl.GetVBO then + return + end local useGS = pipUseGeometryShader local cShader, qShader if useGS then cShader = gl.CreateShader(gl4Prim.circleShaderCode) qShader = gl.CreateShader(gl4Prim.quadShaderCode) if not cShader or not qShader then - if cShader then gl.DeleteShader(cShader) end - if qShader then gl.DeleteShader(qShader) end + if cShader then + gl.DeleteShader(cShader) + end + if qShader then + gl.DeleteShader(qShader) + end cShader, qShader = nil, nil useGS = false end @@ -3963,8 +4067,12 @@ local function InitGL4Primitives() cShader = gl.CreateShader(gl4Prim.circleShaderCodeNoGS) qShader = gl.CreateShader(gl4Prim.quadShaderCodeNoGS) if not cShader or not qShader then - if cShader then gl.DeleteShader(cShader) end - if qShader then gl.DeleteShader(qShader) end + if cShader then + gl.DeleteShader(cShader) + end + if qShader then + gl.DeleteShader(qShader) + end Spring.Echo("[PIP] GL4 primitive shader fallback failed: " .. tostring(gl.GetShaderLog())) return end @@ -3973,13 +4081,21 @@ local function InitGL4Primitives() if not useGS then local quadVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - if not quadVBO then gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end - quadVBO:Define(4, {{id = 0, name = 'quadPos', size = 2}}) + if not quadVBO then + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end + quadVBO:Define(4, { { id = 0, name = "quadPos", size = 2 } }) quadVBO:Upload({ - -1.0, -1.0, - 1.0, -1.0, - -1.0, 1.0, - 1.0, 1.0, + -1.0, + -1.0, + 1.0, + -1.0, + -1.0, + 1.0, + 1.0, + 1.0, }) gl4Prim.quadVBO = quadVBO end @@ -3988,22 +4104,31 @@ local function InitGL4Primitives() local circleLayout if useGS then circleLayout = { - {id = 0, name = 'posRadius', size = 4}, - {id = 1, name = 'coreColor', size = 4}, - {id = 2, name = 'edgeColor', size = 4}, + { id = 0, name = "posRadius", size = 4 }, + { id = 1, name = "coreColor", size = 4 }, + { id = 2, name = "edgeColor", size = 4 }, } else circleLayout = { - {id = 1, name = 'posRadius', size = 4}, - {id = 2, name = 'coreColor', size = 4}, - {id = 3, name = 'edgeColor', size = 4}, + { id = 1, name = "posRadius", size = 4 }, + { id = 2, name = "coreColor", size = 4 }, + { id = 3, name = "edgeColor", size = 4 }, } end local cVbo = gl.GetVBO(GL.ARRAY_BUFFER, true) - if not cVbo then gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end + if not cVbo then + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end cVbo:Define(gl4Prim.CIRCLE_MAX, circleLayout) local cVao = gl.GetVAO() - if not cVao then cVbo:Delete(); gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end + if not cVao then + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end if useGS then cVao:AttachVertexBuffer(cVbo) else @@ -4011,7 +4136,9 @@ local function InitGL4Primitives() cVao:AttachInstanceBuffer(cVbo) end local cData = {} - for i = 1, gl4Prim.CIRCLE_MAX * gl4Prim.CIRCLE_STEP do cData[i] = 0 end + for i = 1, gl4Prim.CIRCLE_MAX * gl4Prim.CIRCLE_STEP do + cData[i] = 0 + end gl4Prim.circles.vbo = cVbo gl4Prim.circles.vao = cVao gl4Prim.circles.data = cData @@ -4020,22 +4147,35 @@ local function InitGL4Primitives() local quadLayout if useGS then quadLayout = { - {id = 0, name = 'posSizeIn', size = 4}, - {id = 1, name = 'colorIn', size = 4}, - {id = 2, name = 'angleFlags', size = 4}, + { id = 0, name = "posSizeIn", size = 4 }, + { id = 1, name = "colorIn", size = 4 }, + { id = 2, name = "angleFlags", size = 4 }, } else quadLayout = { - {id = 1, name = 'posSizeIn', size = 4}, - {id = 2, name = 'colorIn', size = 4}, - {id = 3, name = 'angleFlags', size = 4}, + { id = 1, name = "posSizeIn", size = 4 }, + { id = 2, name = "colorIn", size = 4 }, + { id = 3, name = "angleFlags", size = 4 }, } end local qVbo = gl.GetVBO(GL.ARRAY_BUFFER, true) - if not qVbo then cVao:Delete(); cVbo:Delete(); gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end + if not qVbo then + cVao:Delete() + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end qVbo:Define(gl4Prim.QUAD_MAX, quadLayout) local qVao = gl.GetVAO() - if not qVao then qVbo:Delete(); cVao:Delete(); cVbo:Delete(); gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end + if not qVao then + qVbo:Delete() + cVao:Delete() + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end if useGS then qVao:AttachVertexBuffer(qVbo) else @@ -4043,29 +4183,52 @@ local function InitGL4Primitives() qVao:AttachInstanceBuffer(qVbo) end local qData = {} - for i = 1, gl4Prim.QUAD_MAX * gl4Prim.QUAD_STEP do qData[i] = 0 end + for i = 1, gl4Prim.QUAD_MAX * gl4Prim.QUAD_STEP do + qData[i] = 0 + end gl4Prim.quads.vbo = qVbo gl4Prim.quads.vao = qVao gl4Prim.quads.data = qData -- Line VBOs (3 categories share same shader) local glVbo, glVao, glData = CreateLineVBOSet(gl4Prim.LINE_MAX) - if not glVbo then qVao:Delete(); qVbo:Delete(); cVao:Delete(); cVbo:Delete(); gl.DeleteShader(qShader); gl.DeleteShader(cShader); return end + if not glVbo then + qVao:Delete() + qVbo:Delete() + cVao:Delete() + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + return + end gl4Prim.glowLines.vbo, gl4Prim.glowLines.vao, gl4Prim.glowLines.data = glVbo, glVao, glData local clVbo, clVao, clData = CreateLineVBOSet(gl4Prim.LINE_MAX) if not clVbo then - glVao:Delete(); glVbo:Delete(); qVao:Delete(); qVbo:Delete(); cVao:Delete(); cVbo:Delete() - gl.DeleteShader(qShader); gl.DeleteShader(cShader) + glVao:Delete() + glVbo:Delete() + qVao:Delete() + qVbo:Delete() + cVao:Delete() + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) return end gl4Prim.coreLines.vbo, gl4Prim.coreLines.vao, gl4Prim.coreLines.data = clVbo, clVao, clData local nlVbo, nlVao, nlData = CreateLineVBOSet(gl4Prim.LINE_MAX) if not nlVbo then - clVao:Delete(); clVbo:Delete(); glVao:Delete(); glVbo:Delete() - qVao:Delete(); qVbo:Delete(); cVao:Delete(); cVbo:Delete() - gl.DeleteShader(qShader); gl.DeleteShader(cShader) + clVao:Delete() + clVbo:Delete() + glVao:Delete() + glVbo:Delete() + qVao:Delete() + qVbo:Delete() + cVao:Delete() + cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) return end gl4Prim.normLines.vbo, gl4Prim.normLines.vao, gl4Prim.normLines.data = nlVbo, nlVao, nlData @@ -4078,10 +4241,18 @@ local function InitGL4Primitives() local lShader = gl.CreateShader(gl4Prim.lineShaderCode) if not lShader then Spring.Echo("[PIP] GL4 line shader failed: " .. tostring(gl.GetShaderLog())) - gl.DeleteShader(qShader); gl.DeleteShader(cShader) - nlVao:Delete(); nlVbo:Delete(); clVao:Delete(); clVbo:Delete() - glVao:Delete(); glVbo:Delete(); qVao:Delete(); qVbo:Delete() - cVao:Delete(); cVbo:Delete() + gl.DeleteShader(qShader) + gl.DeleteShader(cShader) + nlVao:Delete() + nlVbo:Delete() + clVao:Delete() + clVbo:Delete() + glVao:Delete() + glVbo:Delete() + qVao:Delete() + qVbo:Delete() + cVao:Delete() + cVbo:Delete() return end gl4Prim.lineShader = lShader @@ -4089,11 +4260,11 @@ local function InitGL4Primitives() -- Cache uniform locations local function cacheUniforms(shader) return { - wtp_scale = gl.GetUniformLocation(shader, "wtp_scale"), + wtp_scale = gl.GetUniformLocation(shader, "wtp_scale"), wtp_offset = gl.GetUniformLocation(shader, "wtp_offset"), - ndcScale = gl.GetUniformLocation(shader, "ndcScale"), - rotSC = gl.GetUniformLocation(shader, "rotSC"), - rotCenter = gl.GetUniformLocation(shader, "rotCenter"), + ndcScale = gl.GetUniformLocation(shader, "ndcScale"), + rotSC = gl.GetUniformLocation(shader, "rotSC"), + rotCenter = gl.GetUniformLocation(shader, "rotCenter"), } end gl4Prim.circles.uniformLocs = cacheUniforms(cShader) @@ -4106,14 +4277,32 @@ local function InitGL4Primitives() end local function DestroyGL4Primitives() - if gl4Prim.circles.shader then gl.DeleteShader(gl4Prim.circles.shader); gl4Prim.circles.shader = nil end - if gl4Prim.quads.shader then gl.DeleteShader(gl4Prim.quads.shader); gl4Prim.quads.shader = nil end - if gl4Prim.lineShader then gl.DeleteShader(gl4Prim.lineShader); gl4Prim.lineShader = nil end - if gl4Prim.quadVBO then gl4Prim.quadVBO:Delete(); gl4Prim.quadVBO = nil end + if gl4Prim.circles.shader then + gl.DeleteShader(gl4Prim.circles.shader) + gl4Prim.circles.shader = nil + end + if gl4Prim.quads.shader then + gl.DeleteShader(gl4Prim.quads.shader) + gl4Prim.quads.shader = nil + end + if gl4Prim.lineShader then + gl.DeleteShader(gl4Prim.lineShader) + gl4Prim.lineShader = nil + end + if gl4Prim.quadVBO then + gl4Prim.quadVBO:Delete() + gl4Prim.quadVBO = nil + end - for _, sub in ipairs({gl4Prim.circles, gl4Prim.quads, gl4Prim.glowLines, gl4Prim.coreLines, gl4Prim.normLines}) do - if sub.vao then sub.vao:Delete(); sub.vao = nil end - if sub.vbo then sub.vbo:Delete(); sub.vbo = nil end + for _, sub in ipairs({ gl4Prim.circles, gl4Prim.quads, gl4Prim.glowLines, gl4Prim.coreLines, gl4Prim.normLines }) do + if sub.vao then + sub.vao:Delete() + sub.vao = nil + end + if sub.vbo then + sub.vbo:Delete() + sub.vbo = nil + end end gl4Prim.enabled = false end @@ -4130,38 +4319,70 @@ end -- Helper: add a gradient circle (explosion, plasma, etc.) local function GL4AddCircle(worldX, worldZ, radius, alpha, coreR, coreG, coreB, edgeR, edgeG, edgeB, edgeAlpha, blendMode) local c = gl4Prim.circles - if c.count >= gl4Prim.CIRCLE_MAX then return end + if c.count >= gl4Prim.CIRCLE_MAX then + return + end local off = c.count * gl4Prim.CIRCLE_STEP local d = c.data - d[off+1] = worldX; d[off+2] = worldZ; d[off+3] = radius; d[off+4] = alpha or 1 - d[off+5] = coreR; d[off+6] = coreG; d[off+7] = coreB; d[off+8] = edgeAlpha or 0 - d[off+9] = edgeR; d[off+10] = edgeG; d[off+11] = edgeB; d[off+12] = blendMode or 0 + d[off + 1] = worldX + d[off + 2] = worldZ + d[off + 3] = radius + d[off + 4] = alpha or 1 + d[off + 5] = coreR + d[off + 6] = coreG + d[off + 7] = coreB + d[off + 8] = edgeAlpha or 0 + d[off + 9] = edgeR + d[off + 10] = edgeG + d[off + 11] = edgeB + d[off + 12] = blendMode or 0 c.count = c.count + 1 end -- Helper: add an oriented quad (missile, blaster) local function GL4AddQuad(worldX, worldZ, halfW, halfH, angleDeg, r, g, b, a) local q = gl4Prim.quads - if q.count >= gl4Prim.QUAD_MAX then return end + if q.count >= gl4Prim.QUAD_MAX then + return + end local off = q.count * gl4Prim.QUAD_STEP local d = q.data - d[off+1] = worldX; d[off+2] = worldZ; d[off+3] = halfW; d[off+4] = halfH - d[off+5] = r; d[off+6] = g; d[off+7] = b; d[off+8] = a or 1 - d[off+9] = angleDeg or 0; d[off+10] = 0; d[off+11] = 0; d[off+12] = 0 + d[off + 1] = worldX + d[off + 2] = worldZ + d[off + 3] = halfW + d[off + 4] = halfH + d[off + 5] = r + d[off + 6] = g + d[off + 7] = b + d[off + 8] = a or 1 + d[off + 9] = angleDeg or 0 + d[off + 10] = 0 + d[off + 11] = 0 + d[off + 12] = 0 q.count = q.count + 1 end -- Helper: add a line vertex pair to a specific line category local function GL4AddLineToCategory(cat, x1, z1, x2, z2, r, g, b, a, r2, g2, b2, a2) - if cat.count + 2 > gl4Prim.LINE_MAX then return end + if cat.count + 2 > gl4Prim.LINE_MAX then + return + end local off = cat.count * gl4Prim.LINE_STEP local d = cat.data -- First vertex - d[off+1] = x1; d[off+2] = z1 - d[off+3] = r; d[off+4] = g; d[off+5] = b; d[off+6] = a or 1 + d[off + 1] = x1 + d[off + 2] = z1 + d[off + 3] = r + d[off + 4] = g + d[off + 5] = b + d[off + 6] = a or 1 -- Second vertex - d[off+7] = x2; d[off+8] = z2 - d[off+9] = r2 or r; d[off+10] = g2 or g; d[off+11] = b2 or b; d[off+12] = a2 or a or 1 + d[off + 7] = x2 + d[off + 8] = z2 + d[off + 9] = r2 or r + d[off + 10] = g2 or g + d[off + 11] = b2 or b + d[off + 12] = a2 or a or 1 cat.count = cat.count + 2 end @@ -4190,7 +4411,9 @@ end -- Draw all collected circles, quads, and effect lines (called after PopMatrix in DrawUnitsAndFeatures) local function GL4FlushEffects() - if not gl4Prim.enabled then return end + if not gl4Prim.enabled then + return + end gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -4257,8 +4480,12 @@ end -- Flush only circles with a caller-controlled blend mode (used for explosion overlay) local function GL4FlushCirclesOnly() - if not gl4Prim.enabled then return end - if gl4Prim.circles.count == 0 then return end + if not gl4Prim.enabled then + return + end + if gl4Prim.circles.count == 0 then + return + end local c = gl4Prim.circles c.vbo:Upload(c.data, nil, 0, 1, c.count * gl4Prim.CIRCLE_STEP) GL4SetPrimUniforms(c.shader, c.uniformLocs) @@ -4272,8 +4499,12 @@ end -- Flush only command lines (called at end of DrawCommandQueuesOverlay) local function GL4FlushCommandLines() - if not gl4Prim.enabled then return end - if gl4Prim.normLines.count == 0 then return end + if not gl4Prim.enabled then + return + end + if gl4Prim.normLines.count == 0 then + return + end local resScale = render.contentScale or 1 gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -4303,7 +4534,7 @@ local function GetEffectivePipDimensions() if render.minimapRotation then local rotDeg = math.abs(render.minimapRotation * 180 / math.pi) % 180 if rotDeg > 45 and rotDeg < 135 then - return pipHeight, pipWidth -- Swapped + return pipHeight, pipWidth -- Swapped end end return pipWidth, pipHeight @@ -4323,7 +4554,9 @@ end function RecalculateWorldCoordinates() -- Guard against uninitialized render dimensions - if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then return end + if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then + return + end -- Use contentScale to calculate world bounds correctly when rendering to higher-res texture -- (render.dim is scaled for scissoring, but world bounds should use logical dimensions) @@ -4404,7 +4637,7 @@ function RecalculateGroundTextureCoordinates() render.ground.coord.r = 1 else render.ground.view.r = dimR - render.ground.coord.r = math.ceil(render.world.r) / mapInfo.mapSizeX -- Use ceil for right edge + render.ground.coord.r = math.ceil(render.world.r) / mapInfo.mapSizeX -- Use ceil for right edge end if render.world.t < 0 then render.ground.view.t = dimT - (dimT - dimB) * (-render.world.t / (render.world.b - render.world.t)) @@ -4418,13 +4651,15 @@ function RecalculateGroundTextureCoordinates() render.ground.coord.b = 1 else render.ground.view.b = dimB - render.ground.coord.b = math.ceil(render.world.b) / mapInfo.mapSizeZ -- Use ceil for bottom edge (which is top in Z) + render.ground.coord.b = math.ceil(render.world.b) / mapInfo.mapSizeZ -- Use ceil for bottom edge (which is top in Z) end end local function CorrectScreenPosition() -- Guard against uninitialized render dimensions - if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then return end + if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then + return + end -- In minimap mode, use different margin and allow edge-to-edge positioning local screenMarginPx @@ -4479,7 +4714,9 @@ end -- Clamp an arbitrary {l, r, b, t} dimensions table to screen bounds with margins. -- Unlike CorrectScreenPosition (which operates on render.dim), this works on any dims table. local function ClampDimensionsToScreen(dims) - if not dims or not dims.l or not dims.r or not dims.b or not dims.t then return end + if not dims or not dims.l or not dims.r or not dims.b or not dims.t then + return + end local screenMarginPx if isMinimapMode then @@ -4568,10 +4805,10 @@ local function EnsureSavedExpandedDimensions() return uiState.savedDimensions end -local UpdateTracking -- forward declaration (called in StartMaximizeAnimation, defined later) -local InitGL4Decals -- forward declaration (called in Initialize, defined after decalGL4 table) +local UpdateTracking -- forward declaration (called in StartMaximizeAnimation, defined later) +local InitGL4Decals -- forward declaration (called in Initialize, defined after decalGL4 table) local DestroyGL4Decals -- forward declaration (called in Shutdown, defined after decalGL4 table) -local decalGL4 -- forward declaration (referenced in DrawDecalsOverlay, defined later) +local decalGL4 -- forward declaration (referenced in DrawDecalsOverlay, defined later) local DrawTexturedQuad -- forward declaration (used before helper definition) local function StartMaximizeAnimation() @@ -4608,13 +4845,13 @@ local function StartMaximizeAnimation() l = uiState.minModeL, r = uiState.minModeL + buttonSize, b = uiState.minModeB, - t = uiState.minModeB + buttonSize + t = uiState.minModeB + buttonSize, } uiState.animEndDim = { l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } uiState.animationProgress = 0 uiState.isAnimating = true @@ -4662,7 +4899,7 @@ local function RecoverInvalidAnimationState() end local function UpdateGuishaderBlur() - if WG['guishader'] then + if WG["guishader"] then -- Determine the correct bounds based on mode local blurL, blurB, blurR, blurT if isMinimapMode and miscState.minimapMinimized then @@ -4688,7 +4925,7 @@ local function UpdateGuishaderBlur() end -- Use InsertDlist for rounded corner blur support - if WG['guishader'].InsertDlist then + if WG["guishader"].InsertDlist then -- Clean up old dlist ourselves before creating new one if render.guishaderDlist then gl.DeleteList(render.guishaderDlist) @@ -4699,10 +4936,10 @@ local function UpdateGuishaderBlur() render.RectRound(blurL, blurB, blurR, blurT, render.elementCorner) end) -- Use force=true to ensure immediate stencil texture update - WG['guishader'].InsertDlist(render.guishaderDlist, 'pip'..pipNumber, true) - elseif WG['guishader'].InsertRect then + WG["guishader"].InsertDlist(render.guishaderDlist, "pip" .. pipNumber, true) + elseif WG["guishader"].InsertRect then -- Fallback to InsertRect if InsertDlist not available - WG['guishader'].InsertRect(blurL, blurB, blurR, blurT, 'pip'..pipNumber) + WG["guishader"].InsertRect(blurL, blurB, blurR, blurT, "pip" .. pipNumber) end end end @@ -4720,7 +4957,7 @@ local function UpdateCentering(mx, my) local _, pos = Spring.TraceScreenRay(mx, my, true) if pos and pos[2] > -10000 then cameraState.wcx, cameraState.wcz = pos[1], pos[3] - cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Set targets instantly for centering + cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Set targets instantly for centering RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() end @@ -4769,7 +5006,7 @@ end -- Helper function to get player skill/rating local function GetPlayerSkill(playerID) local customtable = select(11, spFunc.GetPlayerInfo(playerID)) - if type(customtable) == 'table' and customtable.skill then + if type(customtable) == "table" and customtable.skill then local tsMu = customtable.skill local skill = tsMu and tonumber(tsMu:match("-?%d+%.?%d*")) return skill or 0 @@ -4833,7 +5070,7 @@ local function FindNextBestTeamPlayer(excludePlayerID) if playerAllyTeamID == excludeAllyTeamID then -- This player is on the same allyteam local skill = GetPlayerSkill(playerID) - table.insert(candidatePlayers, {playerID = playerID, skill = skill}) + table.insert(candidatePlayers, { playerID = playerID, skill = skill }) end end end @@ -4914,9 +5151,9 @@ local function UpdatePlayerTracking() if camX and camZ then -- For tilted cameras, we need to project the view direction onto the ground -- Get camera direction/rotation if available - local rx = playerCamState.rx or 0 -- Camera rotation around X axis (tilt) - in radians - local ry = playerCamState.ry or 0 -- Camera rotation around Y axis (heading) - in radians - local dist = playerCamState.dist -- Camera distance (may be nil) + local rx = playerCamState.rx or 0 -- Camera rotation around X axis (tilt) - in radians + local ry = playerCamState.ry or 0 -- Camera rotation around Y axis (heading) - in radians + local dist = playerCamState.dist -- Camera distance (may be nil) -- Only fall back to camY when no explicit height; never default to a hardcoded -- value (a small default like 500 produces a spurious zoomed-in zoomValue when -- the player is actually zoomed out). @@ -4932,7 +5169,7 @@ local function UpdatePlayerTracking() -- Apply forward offset for tilted cameras regardless of mode -- Calculate forward offset based on tilt angle -- rx is in radians, typically negative for looking down (e.g., -1.2 rad = ~69 degrees down) - local tiltFromVertical = math.abs(rx) -- How much tilted from straight down (0 = straight down, pi/2 = horizontal) + local tiltFromVertical = math.abs(rx) -- How much tilted from straight down (0 = straight down, pi/2 = horizontal) local effectiveHeight = dist or height or 500 if tiltFromVertical > 0.1 and effectiveHeight > 100 then -- Calculate forward offset: more tilt = more offset @@ -4997,7 +5234,7 @@ local function UpdatePlayerTracking() -- Apply zoom if we calculated one, but only if change is significant -- This prevents jitter from small floating-point variations if zoomValue then - local zoomChangeThreshold = 0.05 -- Only update if zoom changes by more than 5% + local zoomChangeThreshold = 0.05 -- Only update if zoom changes by more than 5% local zoomDiff = math.abs(zoomValue - cameraState.targetZoom) if zoomDiff > (cameraState.targetZoom * zoomChangeThreshold) then cameraState.targetZoom = zoomValue @@ -5042,14 +5279,12 @@ local function PipToWorldCoords(mx, my) end -- Convert normalized coordinates to world coordinates - return render.world.l + (render.world.r - render.world.l) * normX, - render.world.b + (render.world.t - render.world.b) * normY + return render.world.l + (render.world.r - render.world.l) * normX, render.world.b + (render.world.t - render.world.b) * normY end local function WorldToPipCoords(wx, wz) -- Use precalculated factors for performance (avoids repeated division) -- Rotation is now handled by matrix transformation in RenderPipContents - return wtp.offsetX + wx * wtp.scaleX, - wtp.offsetZ + wz * wtp.scaleZ + return wtp.offsetX + wx * wtp.scaleX, wtp.offsetZ + wz * wtp.scaleZ end -- Drawing @@ -5059,14 +5294,16 @@ local function ResizeHandleVertices() glFunc.Vertex(render.dim.r, render.dim.b + render.usedButtonSize) end local function GroundTextureVertices() - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b); glFunc.Vertex(render.ground.view.l, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b); glFunc.Vertex(render.ground.view.r, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t); glFunc.Vertex(render.ground.view.r, render.ground.view.t) - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t); glFunc.Vertex(render.ground.view.l, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b) + glFunc.Vertex(render.ground.view.l, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b) + glFunc.Vertex(render.ground.view.r, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t) + glFunc.Vertex(render.ground.view.r, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t) + glFunc.Vertex(render.ground.view.l, render.ground.view.t) end - - -- Helper function to compute chamfered corner params based on screen bounds -- Returns tl, tr, br, bl (TopLeft, TopRight, BottomRight, BottomLeft) -- Corners are disabled (0) when the element touches or exceeds screen bounds @@ -5128,13 +5365,16 @@ local function DrawGroundBox(l, r, b, t, cornerSize) DrawGroundLine(l, maxZ - c, l + c, maxZ) end - local function DrawFeature(fID, noTextures) local fDefID = spFunc.GetFeatureDefID(fID) - if not fDefID or cache.noModelFeatures[fDefID] then return end + if not fDefID or cache.noModelFeatures[fDefID] then + return + end -- Skip unreclaimable features (decorative objects with no resources) - if config.hideUnreclaimableFeatures and cache.unreclaimableFeatures[fDefID] then return end + if config.hideUnreclaimableFeatures and cache.unreclaimableFeatures[fDefID] then + return + end -- Skip energy-only features if option is enabled if hideEnergyOnlyFeatures then @@ -5145,19 +5385,21 @@ local function DrawFeature(fID, noTextures) end local fx, fy, fz = spFunc.GetFeaturePosition(fID) - if not fx then return end -- Early exit if position is invalid + if not fx then + return + end -- Early exit if position is invalid local dirx, _, dirz = spFunc.GetFeatureDirection(fID) local uHeading = dirx and mapInfo.atan2(dirx, dirz) * mapInfo.rad2deg or 0 glFunc.PushMatrix() - glFunc.Translate(fx - cameraState.wcx, cameraState.wcz - fz, 0) - glFunc.Rotate(90, 1, 0, 0) - glFunc.Rotate(uHeading, 0, 1, 0) - if not noTextures then - glFunc.Texture(0, '%-' .. fDefID .. ':0') - end - gl.FeatureShape(fDefID, spFunc.GetFeatureTeam(fID)) + glFunc.Translate(fx - cameraState.wcx, cameraState.wcz - fz, 0) + glFunc.Rotate(90, 1, 0, 0) + glFunc.Rotate(uHeading, 0, 1, 0) + if not noTextures then + glFunc.Texture(0, "%-" .. fDefID .. ":0") + end + gl.FeatureShape(fDefID, spFunc.GetFeatureTeam(fID)) glFunc.PopMatrix() end @@ -5179,7 +5421,9 @@ end local function DrawProjectile(pID) local mSin, mCos, mAtan2, mMin, mMax, mLog = math.sin, math.cos, math.atan2, math.min, math.max, math.log local px, py, pz = spFunc.GetProjectilePosition(pID) - if not px then return end + if not px then + return + end local resScale = render.contentScale or 1 @@ -5212,25 +5456,25 @@ local function DrawProjectile(pID) -- Try to get actual target position if targetType and targetID then - if targetType == string.byte('u') then -- unit target + if targetType == string.byte("u") then -- unit target local targetX, targetY, targetZ = spFunc.GetUnitPosition(targetID) if targetX then tx, ty, tz = targetX, targetY, targetZ hasValidTarget = true end - elseif targetType == string.byte('f') then -- feature target + elseif targetType == string.byte("f") then -- feature target local targetX, targetY, targetZ = spFunc.GetFeaturePosition(targetID) if targetX then tx, ty, tz = targetX, targetY, targetZ hasValidTarget = true end - elseif targetType == string.byte('p') then -- projectile target + elseif targetType == string.byte("p") then -- projectile target local targetX, targetY, targetZ = spFunc.GetProjectilePosition(targetID) if targetX then tx, ty, tz = targetX, targetY, targetZ hasValidTarget = true end - elseif targetType == string.byte('g') then -- ground target + elseif targetType == string.byte("g") then -- ground target -- For ground targets, targetID is actually a table {x, y, z} if type(targetID) == "table" and #targetID >= 3 then tx, ty, tz = targetID[1], targetID[2], targetID[3] @@ -5243,7 +5487,7 @@ local function DrawProjectile(pID) if not hasValidTarget then -- Calculate direction from unit origin to projectile local dx, dy, dz = px - ox, py - oy, pz - oz - local dist = math.sqrt(dx*dx + dy*dy + dz*dz) + local dist = math.sqrt(dx * dx + dy * dy + dz * dz) if dist > 0.1 then -- Normalize direction and extend to weapon range (using cached data) local range = cache.weaponRange[pDefID] @@ -5274,7 +5518,7 @@ local function DrawProjectile(pID) g = colorData[2], b = colorData[3], thickness = thickness, - startTime = gameTime + startTime = gameTime, }) return -- Don't draw as a projectile @@ -5298,19 +5542,19 @@ local function DrawProjectile(pID) -- Try to get actual target position if targetType and targetID then - if targetType == string.byte('u') then -- unit target + if targetType == string.byte("u") then -- unit target local targetX, targetY, targetZ = spFunc.GetUnitPosition(targetID) if targetX then tx, ty, tz = targetX, targetY, targetZ hasValidTarget = true end - elseif targetType == string.byte('f') then -- feature target + elseif targetType == string.byte("f") then -- feature target local targetX, targetY, targetZ = spFunc.GetFeaturePosition(targetID) if targetX then tx, ty, tz = targetX, targetY, targetZ hasValidTarget = true end - elseif targetType == string.byte('g') then -- ground target + elseif targetType == string.byte("g") then -- ground target -- For ground targets, targetID is actually a table {x, y, z} if type(targetID) == "table" and #targetID >= 3 then tx, ty, tz = targetID[1], targetID[2], targetID[3] @@ -5334,7 +5578,7 @@ local function DrawProjectile(pID) local numSegments = 10 local dx = (tx - ox) / numSegments local dz = (tz - oz) / numSegments - local dist2D = math.sqrt(dx*dx + dz*dz) + local dist2D = math.sqrt(dx * dx + dz * dz) local boltJitter = dist2D * 0.25 -- Precompute zoom-dependent scaling @@ -5371,10 +5615,8 @@ local function DrawProjectile(pID) local coreR = 0.9 + colorData[1] * 0.1 local coreG = 0.9 + colorData[2] * 0.1 local coreB = 0.95 + colorData[3] * 0.05 - GL4AddGlowLine(prevX, prevZ, segX, segZ, - colorData[1], colorData[2], colorData[3], 0.4 * avgBrightness) - GL4AddCoreLine(prevX, prevZ, segX, segZ, - coreR, coreG, coreB, 0.98 * avgBrightness) + GL4AddGlowLine(prevX, prevZ, segX, segZ, colorData[1], colorData[2], colorData[3], 0.4 * avgBrightness) + GL4AddCoreLine(prevX, prevZ, segX, segZ, coreR, coreG, coreB, 0.98 * avgBrightness) end -- Move to next segment @@ -5392,11 +5634,9 @@ local function DrawProjectile(pID) if gl4Prim.enabled then local glowRadius = baseRadius * 5.8 - GL4AddCircle(tx, tz, glowRadius, alpha * 0.5, - r*0.7, g*0.7, b*0.8, r*0.4, g*0.4, b*0.5, 0, 0) + GL4AddCircle(tx, tz, glowRadius, alpha * 0.5, r * 0.7, g * 0.7, b * 0.8, r * 0.4, g * 0.4, b * 0.5, 0, 0) local coreRadius = baseRadius * 0.4 - GL4AddCircle(tx, tz, coreRadius, alpha * 0.95, - 1, 1, 1, r*0.8, g*0.8, b, alpha * 0.5, 0) + GL4AddCircle(tx, tz, coreRadius, alpha * 0.95, 1, 1, 1, r * 0.8, g * 0.8, b, alpha * 0.5, 0) end return -- Don't draw as a projectile @@ -5411,12 +5651,12 @@ local function DrawProjectile(pID) if not seeds then local ps = pID * 789.012 seeds = { - (mSin(ps * 12.9898) * 2 - 1) * 4, -- offX - (mSin(ps * 78.233) * 2 - 1) * 4, -- offZ - 10 + (mSin(ps * 43.758) % 1) * 4, -- baseSize (abs via modulo) - (mSin(ps * 91.321) % 1), -- v1 (0-1) - (mSin(ps * 37.819) % 1), -- v2 (0-1) - mSin(ps * 63.241), -- v3 (-1 to 1) + (mSin(ps * 12.9898) * 2 - 1) * 4, -- offX + (mSin(ps * 78.233) * 2 - 1) * 4, -- offZ + 10 + (mSin(ps * 43.758) % 1) * 4, -- baseSize (abs via modulo) + (mSin(ps * 91.321) % 1), -- v1 (0-1) + (mSin(ps * 37.819) % 1), -- v2 (0-1) + mSin(ps * 63.241), -- v3 (-1 to 1) } cache.flameSeeds[pID] = seeds cache.flameBirthTime[pID] = gameTime @@ -5459,7 +5699,7 @@ local function DrawProjectile(pID) b = 0.02 * (1 - t) -- Random flame bursts: some particles stay red-yellow if v3 > 0.45 then - r = mMin(1, r + 0.35) + r = mMin(1, r + 0.35) g = g + 0.15 * (1 - t) end -- Random near-black: some particles go very dark @@ -5474,9 +5714,7 @@ local function DrawProjectile(pID) particleSize = particleSize * (1 + age * 0.6) if gl4Prim.enabled then - GL4AddCircle(px + offsetX, pz - offsetZ, particleSize, alpha, - mMin(1, r*1.2), mMin(1, g*1.2), mMin(1, b*1.2), - r, g, b, 0.55 * alpha, 0) + GL4AddCircle(px + offsetX, pz - offsetZ, particleSize, alpha, mMin(1, r * 1.2), mMin(1, g * 1.2), mMin(1, b * 1.2), r, g, b, 0.55 * alpha, 0) end return -- Don't draw as regular projectile end @@ -5485,7 +5723,7 @@ local function DrawProjectile(pID) if cache.weaponIsBlaster[pDefID] then -- Get weapon color from cached data local colorData = cache.weaponColor[pDefID] - color = {colorData[1], colorData[2], colorData[3], 1} + color = { colorData[1], colorData[2], colorData[3], 1 } -- Bolt dimensions based on weapon size + damage (explosion radius as proxy) local wSize = cache.weaponSize[pDefID] or 1 @@ -5527,12 +5765,12 @@ local function DrawProjectile(pID) else cache.projectileSizes[pDefID] = 4 end - size = cache.projectileSizes[pDefID] - else - size = cache.projectileSizes[pDefID] - end + size = cache.projectileSizes[pDefID] + else + size = cache.projectileSizes[pDefID] + end - -- Only set color for non-blaster weapons + -- Only set color for non-blaster weapons if not cache.weaponIsBlaster[pDefID] then color = pools.yellowColor end @@ -5602,136 +5840,144 @@ local function DrawProjectile(pID) local inViewport = px >= render.world.l and px <= render.world.r and pz >= render.world.t and pz <= render.world.b local showTrail = inViewport and not skipProjectileTrails and (missileSize >= 3 or cameraState.zoom >= 0.15 or isNuke) if showTrail then - do - -- Get or create trail data for this projectile - local trail = cache.missileTrails[pID] - local isStarburst = cache.weaponIsStarburst[pDefID] - local isAA = cache.weaponIsAA[pDefID] - local isTorpedo = cache.weaponIsTorpedo[pDefID] - local isParalyze = cache.weaponIsParalyze[pDefID] - local isJuno = cache.weaponIsJuno[pDefID] - if not trail then - -- Pre-allocate position slots to avoid repeated table creation - -- Use ring buffer pattern: positions stored at indices, head points to newest - local missileSize = cache.weaponSize[pDefID] or 1 - - -- Trail lifetime determines visual length; ring buffer must hold enough - -- positions to fill it. Derive both from speed. - local trailLen - local projSpeed = 10 -- default fallback (elmos/frame) - local wDef = WeaponDefs and WeaponDefs[pDefID] - if wDef and wDef.projectilespeed then - projSpeed = wDef.projectilespeed * 30 - end + do + -- Get or create trail data for this projectile + local trail = cache.missileTrails[pID] + local isStarburst = cache.weaponIsStarburst[pDefID] + local isAA = cache.weaponIsAA[pDefID] + local isTorpedo = cache.weaponIsTorpedo[pDefID] + local isParalyze = cache.weaponIsParalyze[pDefID] + local isJuno = cache.weaponIsJuno[pDefID] + if not trail then + -- Pre-allocate position slots to avoid repeated table creation + -- Use ring buffer pattern: positions stored at indices, head points to newest + local missileSize = cache.weaponSize[pDefID] or 1 + + -- Trail lifetime determines visual length; ring buffer must hold enough + -- positions to fill it. Derive both from speed. + local trailLen + local projSpeed = 10 -- default fallback (elmos/frame) + local wDef = WeaponDefs and WeaponDefs[pDefID] + if wDef and wDef.projectilespeed then + projSpeed = wDef.projectilespeed * 30 + end - -- Slower missiles get longer-lingering trails - -- speed 3 → 3.5s, speed 10 → 2.3s, speed 20+ → 1.0s - local trailLife - local trailInterval - if isStarburst then - trailLife = 3.0 - trailInterval = 0.12 - else - trailLife = math.max(1.0, 3.5 - projSpeed * 0.125) - trailInterval = 0.04 + -- Slower missiles get longer-lingering trails + -- speed 3 → 3.5s, speed 10 → 2.3s, speed 20+ → 1.0s + local trailLife + local trailInterval + if isStarburst then + trailLife = 3.0 + trailInterval = 0.12 + else + trailLife = math.max(1.0, 3.5 - projSpeed * 0.125) + trailInterval = 0.04 + end + -- Enough ring buffer slots to cover the full lifetime + small margin + trailLen = math.ceil(trailLife / trailInterval) + 2 + + trail = { positions = {}, head = 0, count = 0, maxLen = trailLen, lastUpdate = 0, isStarburst = isStarburst, isAA = isAA, isTorpedo = isTorpedo, isParalyze = isParalyze, isJuno = isJuno, size = missileSize, speed = projSpeed, trailLife = trailLife } + cache.missileTrails[pID] = trail end - -- Enough ring buffer slots to cover the full lifetime + small margin - trailLen = math.ceil(trailLife / trailInterval) + 2 - trail = {positions = {}, head = 0, count = 0, maxLen = trailLen, - lastUpdate = 0, isStarburst = isStarburst, isAA = isAA, isTorpedo = isTorpedo, isParalyze = isParalyze, isJuno = isJuno, size = missileSize, - speed = projSpeed, trailLife = trailLife} - cache.missileTrails[pID] = trail - end + local maxTrailLength = trail.maxLen + local now = os.clock() - local maxTrailLength = trail.maxLen - local now = os.clock() + -- Add current position to trail using ring buffer (O(1) instead of O(n)) + -- Starburst missiles use 3x longer update interval for longer trails without more positions + local trailUpdateInterval = isStarburst and 0.12 or 0.04 + if now - trail.lastUpdate >= trailUpdateInterval then + trail.head = trail.head + 1 + if trail.head > maxTrailLength then + trail.head = 1 + end - -- Add current position to trail using ring buffer (O(1) instead of O(n)) - -- Starburst missiles use 3x longer update interval for longer trails without more positions - local trailUpdateInterval = isStarburst and 0.12 or 0.04 - if now - trail.lastUpdate >= trailUpdateInterval then - trail.head = trail.head + 1 - if trail.head > maxTrailLength then trail.head = 1 end + -- Reuse existing position table or create new one + local pos = trail.positions[trail.head] + if pos then + pos.x, pos.z, pos.time = px, pz, now + else + trail.positions[trail.head] = { x = px, z = pz, time = now } + end - -- Reuse existing position table or create new one - local pos = trail.positions[trail.head] - if pos then - pos.x, pos.z, pos.time = px, pz, now - else - trail.positions[trail.head] = {x = px, z = pz, time = now} + trail.lastUpdate = now + if trail.count < maxTrailLength then + trail.count = trail.count + 1 + end end - trail.lastUpdate = now - if trail.count < maxTrailLength then - trail.count = trail.count + 1 - end - end + -- Draw smoke trail (dark semi-transparent lines fading away) + local trailCount = trail.count + if trailCount >= 2 then + -- Trail lifetime stored per-trail at creation (derived from missile speed) + local trailLifetime, invTrailLifetime, trailColorR, trailColorG, trailColorB + trailLifetime = trail.trailLife + invTrailLifetime = 1 / trailLifetime + if trail.isStarburst then + trailColorR, trailColorG, trailColorB = 0.12, 0.12, 0.12 -- Darker smoke + elseif trail.isJuno then + trailColorR, trailColorG, trailColorB = 0.2, 0.45, 0.2 -- Green Juno trail + elseif trail.isAA then + trailColorR, trailColorG, trailColorB = 0.85, 0.45, 0.55 -- Rose pink + elseif trail.isParalyze then + trailColorR, trailColorG, trailColorB = 0.4, 0.35, 0.75 -- Blue-violet paralyzer trail + elseif trail.isTorpedo then + trailColorR, trailColorG, trailColorB = 0.25, 0.3, 0.42 -- Grey-blue bubble trail + else + trailColorR, trailColorG, trailColorB = 0.22, 0.22, 0.22 + end + local wcx, wcz = cameraState.wcx, cameraState.wcz + local positions = trail.positions + local head = trail.head + local trailNow = os.clock() + + -- Set line width proportional to missile body size + -- Missile bodies bypass zoomScale (fixed world-unit size), so trails should too + -- Gentle zoom factor: thin when zoomed out (matching tiny missile dots), + -- slightly wider when zoomed in + local resScale = render.contentScale or 1 + local trailZoom = 0.8 + cameraState.zoom * 2 -- 0.85 at zoom 0.024, 1.0 at 0.1, 1.8 at 0.5 + local trailWidth = math.max(1.0 * resScale, trail.size * 0.5 * trailZoom * resScale) + glFunc.LineWidth(trailWidth) + + -- Batch all trail lines in a single BeginEnd call + glFunc.BeginEnd(glConst.LINES, function() + for i = 0, trailCount - 2 do + -- Ring buffer indexing: head is newest, go backwards + local idx1 = head - i + if idx1 < 1 then + idx1 = idx1 + maxTrailLength + end + local idx2 = head - i - 1 + if idx2 < 1 then + idx2 = idx2 + maxTrailLength + end - -- Draw smoke trail (dark semi-transparent lines fading away) - local trailCount = trail.count - if trailCount >= 2 then - -- Trail lifetime stored per-trail at creation (derived from missile speed) - local trailLifetime, invTrailLifetime, trailColorR, trailColorG, trailColorB - trailLifetime = trail.trailLife - invTrailLifetime = 1 / trailLifetime - if trail.isStarburst then - trailColorR, trailColorG, trailColorB = 0.12, 0.12, 0.12 -- Darker smoke - elseif trail.isJuno then - trailColorR, trailColorG, trailColorB = 0.2, 0.45, 0.2 -- Green Juno trail - elseif trail.isAA then - trailColorR, trailColorG, trailColorB = 0.85, 0.45, 0.55 -- Rose pink - elseif trail.isParalyze then - trailColorR, trailColorG, trailColorB = 0.4, 0.35, 0.75 -- Blue-violet paralyzer trail - elseif trail.isTorpedo then - trailColorR, trailColorG, trailColorB = 0.25, 0.3, 0.42 -- Grey-blue bubble trail - else - trailColorR, trailColorG, trailColorB = 0.22, 0.22, 0.22 - end - local wcx, wcz = cameraState.wcx, cameraState.wcz - local positions = trail.positions - local head = trail.head - local trailNow = os.clock() + local p1 = positions[idx1] + local p2 = positions[idx2] + if p1 and p2 then + -- Calculate fade based on wall-clock time + local fade1 = 1 - (trailNow - p1.time) * invTrailLifetime + local fade2 = 1 - (trailNow - p2.time) * invTrailLifetime + if fade1 < 0 then + fade1 = 0 + end + if fade2 < 0 then + fade2 = 0 + end - -- Set line width proportional to missile body size - -- Missile bodies bypass zoomScale (fixed world-unit size), so trails should too - -- Gentle zoom factor: thin when zoomed out (matching tiny missile dots), - -- slightly wider when zoomed in - local resScale = render.contentScale or 1 - local trailZoom = 0.8 + cameraState.zoom * 2 -- 0.85 at zoom 0.024, 1.0 at 0.1, 1.8 at 0.5 - local trailWidth = math.max(1.0 * resScale, trail.size * 0.5 * trailZoom * resScale) - glFunc.LineWidth(trailWidth) - - -- Batch all trail lines in a single BeginEnd call - glFunc.BeginEnd(glConst.LINES, function() - for i = 0, trailCount - 2 do - -- Ring buffer indexing: head is newest, go backwards - local idx1 = head - i - if idx1 < 1 then idx1 = idx1 + maxTrailLength end - local idx2 = head - i - 1 - if idx2 < 1 then idx2 = idx2 + maxTrailLength end - - local p1 = positions[idx1] - local p2 = positions[idx2] - if p1 and p2 then - -- Calculate fade based on wall-clock time - local fade1 = 1 - (trailNow - p1.time) * invTrailLifetime - local fade2 = 1 - (trailNow - p2.time) * invTrailLifetime - if fade1 < 0 then fade1 = 0 end - if fade2 < 0 then fade2 = 0 end - - if fade1 > 0 or fade2 > 0 then - glFunc.Color(trailColorR, trailColorG, trailColorB, 0.7 * fade1) - glFunc.Vertex(p1.x - wcx, wcz - p1.z, 0) - glFunc.Color(trailColorR, trailColorG, trailColorB, 0.7 * fade2) - glFunc.Vertex(p2.x - wcx, wcz - p2.z, 0) + if fade1 > 0 or fade2 > 0 then + glFunc.Color(trailColorR, trailColorG, trailColorB, 0.7 * fade1) + glFunc.Vertex(p1.x - wcx, wcz - p1.z, 0) + glFunc.Color(trailColorR, trailColorG, trailColorB, 0.7 * fade2) + glFunc.Vertex(p2.x - wcx, wcz - p2.z, 0) + end end end - end - end) - glFunc.LineWidth(1 * resScale) + end) + glFunc.LineWidth(1 * resScale) + end end - end end -- showTrail end @@ -5747,37 +5993,35 @@ local function DrawProjectile(pID) GL4AddQuad(px, pz, width * 0.7, height * 0.85, angle, coreR, coreG, coreB, color[4] * 0.95) elseif pDefID and cache.weaponIsMissile[pDefID] then -- Missile shape: body + nose + tail fins offset along flight direction - local rad = angle * 0.01745329 -- pi/180 + local rad = angle * 0.01745329 -- pi/180 local sinA = mSin(rad) local cosA = mCos(rad) -- Color variants from cache (computed once at init) local mc = cache.missileColors[pDefID] - if not mc then mc = cache.missileColors[0] end -- fallback default + if not mc then + mc = cache.missileColors[0] + end -- fallback default local bodyR, bodyG, bodyB = mc[1], mc[2], mc[3] local noseR, noseG, noseB = mc[4], mc[5], mc[6] local finR, finG, finB = mc[7], mc[8], mc[9] -- Main body: shifted 0.2*height forward (matching legacy -0.7h to +0.3h center) local bodyFwd = height * 0.2 - GL4AddQuad(px + sinA * bodyFwd, pz + cosA * bodyFwd, - width, height * 0.5, angle, bodyR, bodyG, bodyB, color[4]) + GL4AddQuad(px + sinA * bodyFwd, pz + cosA * bodyFwd, width, height * 0.5, angle, bodyR, bodyG, bodyB, color[4]) -- Nose cone: narrow tapered quad at the front tip local noseFwd = height * 0.82 - GL4AddQuad(px + sinA * noseFwd, pz + cosA * noseFwd, - width * 0.3, height * 0.2, angle, noseR, noseG, noseB, color[4]) + GL4AddQuad(px + sinA * noseFwd, pz + cosA * noseFwd, width * 0.3, height * 0.2, angle, noseR, noseG, noseB, color[4]) -- Tail fins: wider short quad at the back, swept shape local finFwd = -height * 0.18 - GL4AddQuad(px + sinA * finFwd, pz + cosA * finFwd, - width * 2.0, height * 0.18, angle, finR, finG, finB, color[4] * 0.85) + GL4AddQuad(px + sinA * finFwd, pz + cosA * finFwd, width * 2.0, height * 0.18, angle, finR, finG, finB, color[4] * 0.85) -- Exhaust glow at the very back local exhFwd = -height * 0.38 local exhR, exhG, exhB = mc[10], mc[11], mc[12] - GL4AddQuad(px + sinA * exhFwd, pz + cosA * exhFwd, - width * 0.5, height * 0.1, angle, exhR, exhG, exhB, color[4] * 0.6) + GL4AddQuad(px + sinA * exhFwd, pz + cosA * exhFwd, width * 0.5, height * 0.1, angle, exhR, exhG, exhB, color[4] * 0.6) elseif pDefID and cache.weaponIsBomb[pDefID] then -- Aircraft bomb: grey-white rectangle with pointy nose local vx, vy, vz = spFunc.GetProjectileVelocity(pID) @@ -5802,8 +6046,7 @@ local function DrawProjectile(pID) -- Pointy nose cone: narrow tapered quad at the front local noseFwd = bombH * 0.6 - GL4AddQuad(px + sinA * noseFwd, pz + cosA * noseFwd, - bombW * 0.33, bombH * 0.18, bombAngle, 0.73, 0.73, 0.71, 1.0) + GL4AddQuad(px + sinA * noseFwd, pz + cosA * noseFwd, bombW * 0.33, bombH * 0.18, bombAngle, 0.73, 0.73, 0.71, 1.0) -- Tail fins: wider short quad at the back -- local finFwd = -bombH * 0.35 @@ -5820,8 +6063,12 @@ local function DrawProjectile(pID) local coreR, coreG, coreB, outerR, outerG, outerB if cache.weaponIsAA[pDefID] then -- AA plasma: rose pink tint (matching AA missile trails) - coreR = 1.0; coreG = 0.85; coreB = 0.9 - outerR = 0.9; outerG = 0.4; outerB = 0.55 + coreR = 1.0 + coreG = 0.85 + coreB = 0.9 + outerR = 0.9 + outerG = 0.4 + outerB = 0.55 else coreR = color[1] * (1 - coreWhiteness) + coreWhiteness coreG = color[2] * (1 - coreWhiteness) + coreWhiteness @@ -5854,26 +6101,27 @@ local function DrawProjectile(pID) -- Slower projectiles get slightly longer trails (in game frames, 30fps) -- speed 3 → 18 frames (0.6s), speed 10 → ~15 frames (0.5s), speed 20+ → ~8 frames (0.25s) local trailLifeFrames = mMax(8, mMin(18, math.floor((0.8 - projSpeed * 0.03) * 30))) - local trailUpdateInterval = 2 -- Record position every 2 game frames - trail = {positions = {}, head = 0, count = 0, maxLen = 6, - lastUpdate = 0, trailLifeFrames = trailLifeFrames, - updateInterval = trailUpdateInterval, - size = cache.weaponSize[pDefID] or 1} + local trailUpdateInterval = 2 -- Record position every 2 game frames + trail = { positions = {}, head = 0, count = 0, maxLen = 6, lastUpdate = 0, trailLifeFrames = trailLifeFrames, updateInterval = trailUpdateInterval, size = cache.weaponSize[pDefID] or 1 } cache.plasmaTrails[pID] = trail end -- Update position ring buffer (game frame based) if gameFrame - trail.lastUpdate >= trail.updateInterval then trail.head = trail.head + 1 - if trail.head > trail.maxLen then trail.head = 1 end + if trail.head > trail.maxLen then + trail.head = 1 + end local pos = trail.positions[trail.head] if pos then pos.x, pos.z, pos.frame = px, pz, gameFrame else - trail.positions[trail.head] = {x = px, z = pz, frame = gameFrame} + trail.positions[trail.head] = { x = px, z = pz, frame = gameFrame } end trail.lastUpdate = gameFrame - if trail.count < trail.maxLen then trail.count = trail.count + 1 end + if trail.count < trail.maxLen then + trail.count = trail.count + 1 + end end -- Draw trail lines — each segment gets its own width (diminishing 15% per step) @@ -5889,26 +6137,38 @@ local function DrawProjectile(pID) -- Trail width = plasma ball's on-screen pixel diameter (via world-to-pixel scale) -- wtp.scaleX converts world units to screen pixels; naturally shrinks when zoomed out local baseWidth = mMin(radius * wtp.scaleX * 2.8, 18 * resScale) - if baseWidth < 2.0 * resScale then baseWidth = 2.0 * resScale end + if baseWidth < 2.0 * resScale then + baseWidth = 2.0 * resScale + end local minSegW = 1.35 * resScale local segDecay = 1.0 _line.r, _line.g, _line.b = tR, tG, tB for j = 0, trailCount - 2 do local idx1 = head - j - if idx1 < 1 then idx1 = idx1 + maxLen end + if idx1 < 1 then + idx1 = idx1 + maxLen + end local idx2 = head - j - 1 - if idx2 < 1 then idx2 = idx2 + maxLen end + if idx2 < 1 then + idx2 = idx2 + maxLen + end local p1 = positions[idx1] local p2 = positions[idx2] if p1 and p2 then local fade1 = 1 - (gameFrame - p1.frame) * invLife local fade2 = 1 - (gameFrame - p2.frame) * invLife - if fade1 < 0 then fade1 = 0 end - if fade2 < 0 then fade2 = 0 end + if fade1 < 0 then + fade1 = 0 + end + if fade2 < 0 then + fade2 = 0 + end if fade1 > 0 or fade2 > 0 then local segWidth = baseWidth * segDecay - if segWidth < minSegW then segWidth = minSegW end + if segWidth < minSegW then + segWidth = minSegW + end _line.x1 = p1.x - wcx _line.y1 = wcz - p1.z _line.x2 = p2.x - wcx @@ -5928,7 +6188,9 @@ local function DrawProjectile(pID) end local function DrawLaserBeams() - if #cache.laserBeams == 0 then return end + if #cache.laserBeams == 0 then + return + end local mMax, mMin = math.max, math.min local n = #cache.laserBeams @@ -5939,7 +6201,7 @@ local function DrawLaserBeams() -- Zoom-dependent beam width: scale down when zoomed out so beams don't dominate the view -- At zoom 0.024 (full map): ~0.55, at zoom 0.1: ~0.85, at zoom 0.3+: ~1.0 local zoomScale = mMin(1.0, 0.4 + cameraState.zoom * 4) - local wcx_cached = cameraState.wcx -- Cache these for loop + local wcx_cached = cameraState.wcx -- Cache these for loop local wcz_cached = cameraState.wcz -- Cache world boundaries for culling @@ -5973,10 +6235,18 @@ local function DrawLaserBeams() beamMinZ, beamMaxZ = math.huge, -math.huge for j = 1, #beam.segments do local seg = beam.segments[j] - if seg.x < beamMinX then beamMinX = seg.x end - if seg.x > beamMaxX then beamMaxX = seg.x end - if seg.z < beamMinZ then beamMinZ = seg.z end - if seg.z > beamMaxZ then beamMaxZ = seg.z end + if seg.x < beamMinX then + beamMinX = seg.x + end + if seg.x > beamMaxX then + beamMaxX = seg.x + end + if seg.z < beamMinZ then + beamMinZ = seg.z + end + if seg.z > beamMaxZ then + beamMaxZ = seg.z + end end else -- For regular beams, check origin and target @@ -5986,68 +6256,67 @@ local function DrawLaserBeams() beamMaxZ = beam.oz > beam.tz and beam.oz or beam.tz end - -- Skip if beam is completely outside visible area - -- Check that at least one endpoint (origin OR target) overlaps the visible area - local beamMargin = 200 - if beamMaxX < worldLeft - beamMargin or beamMinX > worldRight + beamMargin or - beamMaxZ < worldTop - beamMargin or beamMinZ > worldBottom + beamMargin then - i = i + 1 - else - -- Check if this is a lightning bolt (segmented) or regular laser beam - if beam.isLightning then - -- Draw lightning bolt with jagged segments - local alpha = 1 - (age / 0.15) -- Fade out over lifetime - local glowLW = mMax(1, beam.thickness * 4.5 * zoomScale * resScale) - local coreLW = mMax(1, beam.thickness * 1.4 * zoomScale * resScale) - local coreR = 0.9 + beam.r * 0.1 - local coreG = 0.9 + beam.g * 0.1 - local coreB = 0.95 + beam.b * 0.05 - - for j = 1, #beam.segments - 1 do - local seg1 = beam.segments[j] - local seg2 = beam.segments[j + 1] - local avgBrightness = (seg1.brightness + seg2.brightness) * 0.5 - _line.x1 = seg1.x - cameraState.wcx - _line.y1 = cameraState.wcz - seg1.z - _line.x2 = seg2.x - cameraState.wcx - _line.y2 = cameraState.wcz - seg2.z - - glFunc.LineWidth(glowLW) - glFunc.Color(beam.r, beam.g, beam.b, alpha * 0.4 * avgBrightness) + -- Skip if beam is completely outside visible area + -- Check that at least one endpoint (origin OR target) overlaps the visible area + local beamMargin = 200 + if beamMaxX < worldLeft - beamMargin or beamMinX > worldRight + beamMargin or beamMaxZ < worldTop - beamMargin or beamMinZ > worldBottom + beamMargin then + i = i + 1 + else + -- Check if this is a lightning bolt (segmented) or regular laser beam + if beam.isLightning then + -- Draw lightning bolt with jagged segments + local alpha = 1 - (age / 0.15) -- Fade out over lifetime + local glowLW = mMax(1, beam.thickness * 4.5 * zoomScale * resScale) + local coreLW = mMax(1, beam.thickness * 1.4 * zoomScale * resScale) + local coreR = 0.9 + beam.r * 0.1 + local coreG = 0.9 + beam.g * 0.1 + local coreB = 0.95 + beam.b * 0.05 + + for j = 1, #beam.segments - 1 do + local seg1 = beam.segments[j] + local seg2 = beam.segments[j + 1] + local avgBrightness = (seg1.brightness + seg2.brightness) * 0.5 + _line.x1 = seg1.x - cameraState.wcx + _line.y1 = cameraState.wcz - seg1.z + _line.x2 = seg2.x - cameraState.wcx + _line.y2 = cameraState.wcz - seg2.z + + glFunc.LineWidth(glowLW) + glFunc.Color(beam.r, beam.g, beam.b, alpha * 0.4 * avgBrightness) + glFunc.BeginEnd(GL.LINES, drawLine) + glFunc.LineWidth(coreLW) + glFunc.Color(coreR, coreG, coreB, alpha * 0.98 * avgBrightness) + glFunc.BeginEnd(GL.LINES, drawLine) + end + else + -- Draw regular laser beam as a line with glow effect + local alpha = 1 - (age / 0.15) -- Fade out over lifetime + local thickness = beam.thickness or 2 + -- Scale thickness: thin beams stay thin, thick beams get moderate presence + local scaledThickness = (0.4 + thickness * 0.3) * zoomScale + + -- Transform world coords to PushMatrix local coords + _line.x1 = beam.ox - cameraState.wcx + _line.y1 = cameraState.wcz - beam.oz + _line.x2 = beam.tx - cameraState.wcx + _line.y2 = cameraState.wcz - beam.tz + + -- Glow layer (outer, colored, additive-like via alpha) + local glowWidth = mMax(1, mMin(8 * resScale, scaledThickness * 2.8 * resScale)) + glFunc.LineWidth(glowWidth) + glFunc.Color(beam.r, beam.g, beam.b, alpha * 0.35) glFunc.BeginEnd(GL.LINES, drawLine) - glFunc.LineWidth(coreLW) - glFunc.Color(coreR, coreG, coreB, alpha * 0.98 * avgBrightness) + + -- Core layer (inner, whitened, bright) — use higher proportion for big lasers + local whiteness = 0.4 + (thickness / 10) * 0.4 + local coreR = beam.r * (1 - whiteness) + whiteness + local coreG = beam.g * (1 - whiteness) + whiteness + local coreB = beam.b * (1 - whiteness) + whiteness + local coreWidth = mMax(1, mMin(3 * resScale, scaledThickness * 1.2 * resScale)) + glFunc.LineWidth(coreWidth) + glFunc.Color(coreR, coreG, coreB, alpha * 0.98) glFunc.BeginEnd(GL.LINES, drawLine) end - else - -- Draw regular laser beam as a line with glow effect - local alpha = 1 - (age / 0.15) -- Fade out over lifetime - local thickness = beam.thickness or 2 - -- Scale thickness: thin beams stay thin, thick beams get moderate presence - local scaledThickness = (0.4 + thickness * 0.3) * zoomScale - - -- Transform world coords to PushMatrix local coords - _line.x1 = beam.ox - cameraState.wcx - _line.y1 = cameraState.wcz - beam.oz - _line.x2 = beam.tx - cameraState.wcx - _line.y2 = cameraState.wcz - beam.tz - - -- Glow layer (outer, colored, additive-like via alpha) - local glowWidth = mMax(1, mMin(8 * resScale, scaledThickness * 2.8 * resScale)) - glFunc.LineWidth(glowWidth) - glFunc.Color(beam.r, beam.g, beam.b, alpha * 0.35) - glFunc.BeginEnd(GL.LINES, drawLine) - - -- Core layer (inner, whitened, bright) — use higher proportion for big lasers - local whiteness = 0.4 + (thickness / 10) * 0.4 - local coreR = beam.r * (1 - whiteness) + whiteness - local coreG = beam.g * (1 - whiteness) + whiteness - local coreB = beam.b * (1 - whiteness) + whiteness - local coreWidth = mMax(1, mMin(3 * resScale, scaledThickness * 1.2 * resScale)) - glFunc.LineWidth(coreWidth) - glFunc.Color(coreR, coreG, coreB, alpha * 0.98) - glFunc.BeginEnd(GL.LINES, drawLine) - end i = i + 1 end @@ -6130,7 +6399,9 @@ local function drawTexturedOctagonVertices(cx, cy, s, c, texIn) end local function DrawIconShatters() - if #cache.iconShatters == 0 then return end + if #cache.iconShatters == 0 then + return + end local _, _, isPaused = Spring.GetGameSpeed() @@ -6178,7 +6449,7 @@ local function DrawIconShatters() elseif shatterLosAlly and shatter.originX and not spFunc.IsPosInLos(shatter.originX, 0, shatter.originZ, shatterLosAlly) then i = i + 1 else - local fade = 1 - progress -- Calculate scale: stays at 1.0 for first 50% of duration, then shrinks to 0 (earlier than before) + local fade = 1 - progress -- Calculate scale: stays at 1.0 for first 50% of duration, then shrinks to 0 (earlier than before) local scale if progress < 0.5 then scale = 1.0 @@ -6186,7 +6457,7 @@ local function DrawIconShatters() -- Shrink from 1.0 to 0 over the last 50% of duration local shrinkProgress = (progress - 0.5) / 0.5 scale = 1.0 - shrinkProgress - end -- Precalculate common values + end -- Precalculate common values local decel = 0.85 + 0.15 * fade local velocityDamping = 0.94 + 0.04 * fade local zoomInv = 1 / shatter.zoom @@ -6208,8 +6479,8 @@ local function DrawIconShatters() -- Cubic decay + slight linear tail, so it's bright initially then lingers local flashFactor = 0 if shatter.flashIntensity > 0 then - local ft = progress -- 0 at birth, 1 at expiry - flashFactor = shatter.flashIntensity * math.min(1, (1-ft)*(1-ft)*(1-ft) * 1.3 + (1-ft) * 0.08) + local ft = progress -- 0 at birth, 1 at expiry + flashFactor = shatter.flashIntensity * math.min(1, (1 - ft) * (1 - ft) * (1 - ft) * 1.3 + (1 - ft) * 0.08) end local fragments = shatter.fragments @@ -6255,7 +6526,7 @@ local function DrawIconShatters() uvy2 = frag.uvy2, r = fr, g = fg, - b = fb + b = fb, } end @@ -6270,15 +6541,15 @@ local function DrawIconShatters() for i = 1, fragCount do local frag = frags[i] glFunc.PushMatrix() - glFunc.Translate(frag.x, frag.z, 0) - glFunc.Rotate(frag.rot, 0, 0, 1) - glFunc.Color(frag.r, frag.g, frag.b, 1.0) - _frag.hs = frag.halfSize - _frag.uvx1 = frag.uvx1 - _frag.uvy1 = frag.uvy1 - _frag.uvx2 = frag.uvx2 - _frag.uvy2 = frag.uvy2 - glFunc.BeginEnd(glConst.QUADS, drawFragQuad) + glFunc.Translate(frag.x, frag.z, 0) + glFunc.Rotate(frag.rot, 0, 0, 1) + glFunc.Color(frag.r, frag.g, frag.b, 1.0) + _frag.hs = frag.halfSize + _frag.uvx1 = frag.uvx1 + _frag.uvy1 = frag.uvy1 + _frag.uvx2 = frag.uvx2 + _frag.uvy2 = frag.uvy2 + glFunc.BeginEnd(glConst.QUADS, drawFragQuad) glFunc.PopMatrix() end end @@ -6289,7 +6560,9 @@ end -- Draw seismic pings as animated rotating arcs (matching the gadget draw style) local function DrawSeismicPings() - if #cache.seismicPings == 0 then return end + if #cache.seismicPings == 0 then + return + end local i = 1 local wcx_cached = cameraState.wcx @@ -6330,8 +6603,7 @@ local function DrawSeismicPings() elseif state.losViewEnabled and state.losViewAllyTeam and ping.allyTeam and ping.allyTeam ~= state.losViewAllyTeam then i = i + 1 -- Check if ping is within visible world bounds - elseif ping.x + ping.maxRadius < worldLeft or ping.x - ping.maxRadius > worldRight or - ping.z + ping.maxRadius < worldTop or ping.z - ping.maxRadius > worldBottom then + elseif ping.x + ping.maxRadius < worldLeft or ping.x - ping.maxRadius > worldRight or ping.z + ping.maxRadius < worldTop or ping.z - ping.maxRadius > worldBottom then i = i + 1 else local progress = age / pingLifetime @@ -6361,7 +6633,7 @@ local function DrawSeismicPings() local innerAlpha = math.max(0, (1 - innerProgress)) local innerRadius = radius - (radius * progress * 0.45) - gl.Scale(2.3,2.3,0) -- scale up so it is visible in pip + gl.Scale(2.3, 2.3, 0) -- scale up so it is visible in pip -- PASS 1: Draw all dark outlines with normal blending if cameraState.zoom > 0.5 then @@ -6464,7 +6736,9 @@ end -- (where DrawExplosions is never called, causing unbounded table growth). local function ExpireExplosions() local n = #cache.explosions - if n == 0 then return end + if n == 0 then + return + end local currentFrame = Spring.GetGameFrame() local i = 1 while i <= n do @@ -6500,7 +6774,9 @@ local function ExpireExplosions() end local function DrawExplosions() - if #cache.explosions == 0 then return end + if #cache.explosions == 0 then + return + end local resScale = render.contentScale or 1 local i = 1 @@ -6538,7 +6814,9 @@ local function DrawExplosions() end table.sort(radii, sortDescending) explosionMinRadius = radii[MAX_EXPLOSIONS] or 0 - for j = rCount + 1, #radii do radii[j] = nil end + for j = rCount + 1, #radii do + radii[j] = nil + end end local currentFrame = Spring.GetGameFrame() @@ -6551,227 +6829,213 @@ local function DrawExplosions() cache.explosions[n] = nil n = n - 1 else - -- Age in seconds derived from game frames (freezes when paused) - local age = (currentFrame - explosion.startFrame) / 30 + -- Age in seconds derived from game frames (freezes when paused) + local age = (currentFrame - explosion.startFrame) / 30 - -- Remove explosions older than 0.8 seconds (longer for large explosions) - local lifetime = 0.4 + explosion.radius / 200 -- Base lifetime calculation + -- Remove explosions older than 0.8 seconds (longer for large explosions) + local lifetime = 0.4 + explosion.radius / 200 -- Base lifetime calculation - -- Lightning explosions have shorter lifetime - if explosion.isLightning then - lifetime = 0.25 -- Short, snappy lightning flash + -- Lightning explosions have shorter lifetime + if explosion.isLightning then + lifetime = 0.25 -- Short, snappy lightning flash -- Nuke explosions linger much longer - elseif explosion.radius > 150 then - lifetime = math.min(1.5, lifetime * 2) -- Nukes last up to 1.5 seconds - elseif explosion.radius > 80 then - lifetime = math.min(1.0, lifetime * 1.5) -- Large explosions up to 1 second - else - lifetime = math.min(0.8, lifetime) -- Normal explosions up to 0.8 seconds - end + elseif explosion.radius > 150 then + lifetime = math.min(1.5, lifetime * 2) -- Nukes last up to 1.5 seconds + elseif explosion.radius > 80 then + lifetime = math.min(1.0, lifetime * 1.5) -- Large explosions up to 1 second + else + lifetime = math.min(0.8, lifetime) -- Normal explosions up to 0.8 seconds + end - -- Unit death explosions last 40% longer - if explosion.isUnitExplosion then - lifetime = lifetime * 1.4 - end + -- Unit death explosions last 40% longer + if explosion.isUnitExplosion then + lifetime = lifetime * 1.4 + end - if age > lifetime then - cache.explosions[i] = cache.explosions[n] - cache.explosions[n] = nil - n = n - 1 - -- Skip small explosions when over budget (but still expire them above) - elseif explosionMinRadius > 0 and explosion.radius < explosionMinRadius then - i = i + 1 - -- LOS view filter: skip explosions outside the viewed allyteam's LOS - elseif expLosAlly and not spFunc.IsPosInLos(explosion.x, 0, explosion.z, expLosAlly) then - i = i + 1 - else - -- Check if explosion is within visible world bounds - local explosionRadius = explosion.radius * 2 -- Account for expansion - if explosion.x + explosionRadius < worldLeft or explosion.x - explosionRadius > worldRight or - explosion.z + explosionRadius < worldTop or explosion.z - explosionRadius > worldBottom then - -- Skip invisible explosion + if age > lifetime then + cache.explosions[i] = cache.explosions[n] + cache.explosions[n] = nil + n = n - 1 + -- Skip small explosions when over budget (but still expire them above) + elseif explosionMinRadius > 0 and explosion.radius < explosionMinRadius then + i = i + 1 + -- LOS view filter: skip explosions outside the viewed allyteam's LOS + elseif expLosAlly and not spFunc.IsPosInLos(explosion.x, 0, explosion.z, expLosAlly) then i = i + 1 else - -- Draw explosion as expanding, fading circle - local actualProgress = (age / lifetime) - local progress = 0.3 + (age / lifetime) * 0.7 -- Start at 33%, end at 100% - - -- Calculate segments based on explosion size and progress - -- Smaller early explosions use fewer segments, larger/progressed use more - local baseRadius = explosion.radius * (0.3 + progress * 1.7) - local segments = math.max(8, math.min(32, math.floor(8 + baseRadius * 0.15))) - local angleStep = (2 * math.pi) / segments - - -- Check if this is a lightning explosion - if explosion.isLightning then - -- Lightning explosion: small white-blue flash with sparks - local baseRadius = 16.2 * (0.5 + progress * 2.0) -- 35% larger (12 * 1.35 = 16.2) - local alpha = (1 - progress) * (1 - progress) -- Faster fade - local r, g, b = 0.9, 0.95, 1 + -- Check if explosion is within visible world bounds + local explosionRadius = explosion.radius * 2 -- Account for expansion + if explosion.x + explosionRadius < worldLeft or explosion.x - explosionRadius > worldRight or explosion.z + explosionRadius < worldTop or explosion.z - explosionRadius > worldBottom then + -- Skip invisible explosion + i = i + 1 + else + -- Draw explosion as expanding, fading circle + local actualProgress = (age / lifetime) + local progress = 0.3 + (age / lifetime) * 0.7 -- Start at 33%, end at 100% + + -- Calculate segments based on explosion size and progress + -- Smaller early explosions use fewer segments, larger/progressed use more + local baseRadius = explosion.radius * (0.3 + progress * 1.7) + local segments = math.max(8, math.min(32, math.floor(8 + baseRadius * 0.15))) + local angleStep = (2 * math.pi) / segments + + -- Check if this is a lightning explosion + if explosion.isLightning then + -- Lightning explosion: small white-blue flash with sparks + local baseRadius = 16.2 * (0.5 + progress * 2.0) -- 35% larger (12 * 1.35 = 16.2) + local alpha = (1 - progress) * (1 - progress) -- Faster fade + local r, g, b = 0.9, 0.95, 1 - if gl4Prim.enabled then - -- GL4 path: two gradient circles (glow + core) - local glowAlpha = alpha * 0.5 - local glowRadius = baseRadius * 1.8 - GL4AddCircle(explosion.x, explosion.z, glowRadius, glowAlpha, - r*0.7, g*0.7, b*0.8, r*0.4, g*0.4, b*0.5, 0, 0) - local coreAlpha = alpha * 0.95 - local edgeAlpha = alpha * 0.5 - local coreRadius = baseRadius * 0.4 - GL4AddCircle(explosion.x, explosion.z, coreRadius, coreAlpha, - 1, 1, 1, r*0.8, g*0.8, b, edgeAlpha, 0) - -- GL4 sparks as norm lines - for k = 1, #explosion.particles do - local particle = explosion.particles[k] - local particleLife = particle.life or particle.lifetime - if particle.vx and particle.vz and particleLife and particleLife > 0 then - local particleAge = age - local particleProgress = particleAge / particleLife - if particleProgress < 1 then - particle.x = particle.x + particle.vx * (1/30) - particle.z = particle.z + particle.vz * (1/30) - local sparkAlpha = (1 - particleProgress) * 0.9 - local sparkDirX = particle.vx * 0.3 - local sparkDirZ = particle.vz * 0.3 - -- Sparks use PIP-local Y coords (= -worldZ), so flip Z for GL4 world coords - GL4AddNormLine( - explosion.x + particle.x - sparkDirX, explosion.z - particle.z + sparkDirZ, - explosion.x + particle.x + sparkDirX, explosion.z - particle.z - sparkDirZ, - r, g, b, sparkAlpha) + if gl4Prim.enabled then + -- GL4 path: two gradient circles (glow + core) + local glowAlpha = alpha * 0.5 + local glowRadius = baseRadius * 1.8 + GL4AddCircle(explosion.x, explosion.z, glowRadius, glowAlpha, r * 0.7, g * 0.7, b * 0.8, r * 0.4, g * 0.4, b * 0.5, 0, 0) + local coreAlpha = alpha * 0.95 + local edgeAlpha = alpha * 0.5 + local coreRadius = baseRadius * 0.4 + GL4AddCircle(explosion.x, explosion.z, coreRadius, coreAlpha, 1, 1, 1, r * 0.8, g * 0.8, b, edgeAlpha, 0) + -- GL4 sparks as norm lines + for k = 1, #explosion.particles do + local particle = explosion.particles[k] + local particleLife = particle.life or particle.lifetime + if particle.vx and particle.vz and particleLife and particleLife > 0 then + local particleAge = age + local particleProgress = particleAge / particleLife + if particleProgress < 1 then + particle.x = particle.x + particle.vx * (1 / 30) + particle.z = particle.z + particle.vz * (1 / 30) + local sparkAlpha = (1 - particleProgress) * 0.9 + local sparkDirX = particle.vx * 0.3 + local sparkDirZ = particle.vz * 0.3 + -- Sparks use PIP-local Y coords (= -worldZ), so flip Z for GL4 world coords + GL4AddNormLine(explosion.x + particle.x - sparkDirX, explosion.z - particle.z + sparkDirZ, explosion.x + particle.x + sparkDirX, explosion.z - particle.z - sparkDirZ, r, g, b, sparkAlpha) + end end end end - end - else - -- Normal explosion rendering - -- Scale down big explosions by 25% (multiply radius by 0.75) - local effectiveRadius = explosion.radius - if explosion.radius > 80 then - effectiveRadius = explosion.radius * 0.75 - end + else + -- Normal explosion rendering + -- Scale down big explosions by 25% (multiply radius by 0.75) + local effectiveRadius = explosion.radius + if explosion.radius > 80 then + effectiveRadius = explosion.radius * 0.75 + end - -- Unit death explosions are 33% larger - if explosion.isUnitExplosion then - effectiveRadius = effectiveRadius * 1.33 - end + -- Unit death explosions are 33% larger + if explosion.isUnitExplosion then + effectiveRadius = effectiveRadius * 1.33 + end - -- Fireball radius (20% smaller than before) - local baseRadius = effectiveRadius * (0.27 + progress * 1.8) - local alpha = (1 - progress) * (explosion.dimFactor or 1) -- Fades out, dimmed for rapid-fire - - -- Color: outer fireball (darker, smoky edge) and inner core (bright, hot) - -- Per-explosion random tint variation using stored seed - local seed = explosion.randomSeed - local rVar = math.sin(seed * 12.9898) * 0.06 -- ±0.06 - local gVar = math.sin(seed * 78.233) * 0.08 -- ±0.08 (more warmth variety) - local bVar = math.sin(seed * 43.758) * 0.03 -- ±0.03 - - local r, g, b -- Outer fireball color - local cr, cg, cb -- Inner core color (hotter) - if explosion.isJuno then - r, g, b = 0.3, 0.75, 0.35 - cr, cg, cb = 0.6, 1, 0.65 - elseif explosion.isParalyze then - r, g, b = 0.5, 0.6, 0.85 - cr, cg, cb = 0.8, 0.9, 1 - elseif explosion.radius > 150 then - -- Nuke: bright orange-yellow - r = 0.9 + rVar - g = 0.55 + gVar - b = 0.15 + bVar - cr, cg, cb = 1, 0.95, 0.7 - elseif explosion.radius > 80 then - -- Large: warm orange (less red than before) - r = 0.92 + rVar - g = 0.5 + gVar - b = 0.1 + bVar - cr = 1 - cg = 0.88 + gVar * 0.5 - cb = 0.4 + bVar - else - -- Small-to-medium: orange with gentle red shift (much less than before) - local sizeRatio = explosion.radius / 200 - r = 0.92 + rVar - g = 0.55 - sizeRatio * 0.15 + gVar -- Gentle shift (was 0.5 - sizeRatio) - b = 0.05 + bVar - cr = 1 - cg = 0.92 - sizeRatio * 0.25 + gVar * 0.5 - cb = 0.2 + bVar - end + -- Fireball radius (20% smaller than before) + local baseRadius = effectiveRadius * (0.27 + progress * 1.8) + local alpha = (1 - progress) * (explosion.dimFactor or 1) -- Fades out, dimmed for rapid-fire + + -- Color: outer fireball (darker, smoky edge) and inner core (bright, hot) + -- Per-explosion random tint variation using stored seed + local seed = explosion.randomSeed + local rVar = math.sin(seed * 12.9898) * 0.06 -- ±0.06 + local gVar = math.sin(seed * 78.233) * 0.08 -- ±0.08 (more warmth variety) + local bVar = math.sin(seed * 43.758) * 0.03 -- ±0.03 + + local r, g, b -- Outer fireball color + local cr, cg, cb -- Inner core color (hotter) + if explosion.isJuno then + r, g, b = 0.3, 0.75, 0.35 + cr, cg, cb = 0.6, 1, 0.65 + elseif explosion.isParalyze then + r, g, b = 0.5, 0.6, 0.85 + cr, cg, cb = 0.8, 0.9, 1 + elseif explosion.radius > 150 then + -- Nuke: bright orange-yellow + r = 0.9 + rVar + g = 0.55 + gVar + b = 0.15 + bVar + cr, cg, cb = 1, 0.95, 0.7 + elseif explosion.radius > 80 then + -- Large: warm orange (less red than before) + r = 0.92 + rVar + g = 0.5 + gVar + b = 0.1 + bVar + cr = 1 + cg = 0.88 + gVar * 0.5 + cb = 0.4 + bVar + else + -- Small-to-medium: orange with gentle red shift (much less than before) + local sizeRatio = explosion.radius / 200 + r = 0.92 + rVar + g = 0.55 - sizeRatio * 0.15 + gVar -- Gentle shift (was 0.5 - sizeRatio) + b = 0.05 + bVar + cr = 1 + cg = 0.92 - sizeRatio * 0.25 + gVar * 0.5 + cb = 0.2 + bVar + end - -- Bigger explosions are more opaque - local coreAlpha = alpha - local edgeAlpha = alpha * 0.7 - if explosion.radius > 150 then - coreAlpha = math.min(1, alpha * 1.2) - edgeAlpha = math.min(1, alpha * 0.95) - elseif explosion.radius > 80 then - coreAlpha = math.min(1, alpha * 1.1) - edgeAlpha = math.min(1, alpha * 0.85) - end + -- Bigger explosions are more opaque + local coreAlpha = alpha + local edgeAlpha = alpha * 0.7 + if explosion.radius > 150 then + coreAlpha = math.min(1, alpha * 1.2) + edgeAlpha = math.min(1, alpha * 0.95) + elseif explosion.radius > 80 then + coreAlpha = math.min(1, alpha * 1.1) + edgeAlpha = math.min(1, alpha * 0.85) + end - if gl4Prim.enabled then - -- Layer 1: Outer fireball body (dark edge → mid color) - GL4AddCircle(explosion.x, explosion.z, baseRadius, coreAlpha, - r, g, b, r * 0.4, g * 0.25, b * 0.15, edgeAlpha * 0.5, 0) - - -- Layer 2: Inner hot core (bright center → fireball color) - local coreRadius = baseRadius * 0.5 - local innerAlpha = math.min(1, coreAlpha * 1.15) - GL4AddCircle(explosion.x, explosion.z, coreRadius, innerAlpha, - cr, cg, cb, r, g, b, coreAlpha * 0.8, 0) - - -- Layer 3: Initial flash (fast white-hot burst, first 20% of lifetime) - if actualProgress < 0.2 then - local flashT = actualProgress / 0.2 - local flashAlpha = (1 - flashT * flashT) * 0.95 -- Quadratic falloff, brighter peak - local flashRadius = baseRadius * (0.8 + flashT * 0.9) - if explosion.isJuno then - GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, - 0.7, 1, 0.75, 0.4, 0.85, 0.5, flashAlpha * 0.4, 0) - elseif explosion.isParalyze then - GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, - 0.85, 0.9, 1, 0.65, 0.75, 1, flashAlpha * 0.4, 0) - else - GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, - 1, 1, 1, 1, 0.95, 0.7, flashAlpha * 0.35, 0) + if gl4Prim.enabled then + -- Layer 1: Outer fireball body (dark edge → mid color) + GL4AddCircle(explosion.x, explosion.z, baseRadius, coreAlpha, r, g, b, r * 0.4, g * 0.25, b * 0.15, edgeAlpha * 0.5, 0) + + -- Layer 2: Inner hot core (bright center → fireball color) + local coreRadius = baseRadius * 0.5 + local innerAlpha = math.min(1, coreAlpha * 1.15) + GL4AddCircle(explosion.x, explosion.z, coreRadius, innerAlpha, cr, cg, cb, r, g, b, coreAlpha * 0.8, 0) + + -- Layer 3: Initial flash (fast white-hot burst, first 20% of lifetime) + if actualProgress < 0.2 then + local flashT = actualProgress / 0.2 + local flashAlpha = (1 - flashT * flashT) * 0.95 -- Quadratic falloff, brighter peak + local flashRadius = baseRadius * (0.8 + flashT * 0.9) + if explosion.isJuno then + GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, 0.7, 1, 0.75, 0.4, 0.85, 0.5, flashAlpha * 0.4, 0) + elseif explosion.isParalyze then + GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, 0.85, 0.9, 1, 0.65, 0.75, 1, flashAlpha * 0.4, 0) + else + GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, 1, 1, 1, 1, 0.95, 0.7, flashAlpha * 0.35, 0) + end end - end - -- Layer 4: Nuke secondary flash (lingers longer) - if explosion.radius > 150 and actualProgress < 0.5 then - local flashProgress = actualProgress / 0.5 - local flashAlpha = (1 - flashProgress) * alpha * 0.6 - local flashRadius = baseRadius * 0.85 - GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, - 1, 1, 1, 1, 0.95, 0.8, flashAlpha * 0.4, 0) - end + -- Layer 4: Nuke secondary flash (lingers longer) + if explosion.radius > 150 and actualProgress < 0.5 then + local flashProgress = actualProgress / 0.5 + local flashAlpha = (1 - flashProgress) * alpha * 0.6 + local flashRadius = baseRadius * 0.85 + GL4AddCircle(explosion.x, explosion.z, flashRadius, flashAlpha, 1, 1, 1, 1, 0.95, 0.8, flashAlpha * 0.4, 0) + end - -- Layer 5: Big white flash (nukes, commanders, fusions) - -- Fades fast initially (cubic) then lingers slightly (linear tail) - -- Flash runs at 1.7x speed so it fades out before the fireball ends - if explosion.isBigFlash and actualProgress < 0.75 then - local ft = actualProgress / 0.75 -- compress into 75% of explosion lifetime - -- Cubic decay + small linear tail for gentle linger - local fa = math.min(1, (1-ft)*(1-ft)*(1-ft) * 1.2 + (1-ft) * 0.12) - -- Outer white pulse: starts large, expands slowly - local flashR = effectiveRadius * (1.8 + ft * 1.5) - GL4AddCircle(explosion.x, explosion.z, flashR, fa * 0.85, - 1, 1, 1, 1, 0.97, 0.92, fa * 0.25, 0) - -- Inner bright core: tight, fades faster - if ft < 0.45 then - local cft = ft / 0.45 - local cfa = (1 - cft * cft) * 0.95 - local coreR = effectiveRadius * (0.4 + cft * 0.6) - GL4AddCircle(explosion.x, explosion.z, coreR, cfa, - 1, 1, 1, 1, 1, 0.97, cfa * 0.5, 0) + -- Layer 5: Big white flash (nukes, commanders, fusions) + -- Fades fast initially (cubic) then lingers slightly (linear tail) + -- Flash runs at 1.7x speed so it fades out before the fireball ends + if explosion.isBigFlash and actualProgress < 0.75 then + local ft = actualProgress / 0.75 -- compress into 75% of explosion lifetime + -- Cubic decay + small linear tail for gentle linger + local fa = math.min(1, (1 - ft) * (1 - ft) * (1 - ft) * 1.2 + (1 - ft) * 0.12) + -- Outer white pulse: starts large, expands slowly + local flashR = effectiveRadius * (1.8 + ft * 1.5) + GL4AddCircle(explosion.x, explosion.z, flashR, fa * 0.85, 1, 1, 1, 1, 0.97, 0.92, fa * 0.25, 0) + -- Inner bright core: tight, fades faster + if ft < 0.45 then + local cft = ft / 0.45 + local cfa = (1 - cft * cft) * 0.95 + local coreR = effectiveRadius * (0.4 + cft * 0.6) + GL4AddCircle(explosion.x, explosion.z, coreR, cfa, 1, 1, 1, 1, 1, 0.97, cfa * 0.5, 0) + end end end end + i = i + 1 end - i = i + 1 end - end end -- end of "if not explosion" else block end glFunc.LineWidth(1 * resScale) @@ -6781,8 +7045,12 @@ end -- Does NOT remove expired entries (DrawExplosions already handled that this frame). -- Adds a single soft glow circle per explosion at reduced opacity. local function DrawExplosionOverlay() - if #cache.explosions == 0 then return end - if not gl4Prim.enabled then return end + if #cache.explosions == 0 then + return + end + if not gl4Prim.enabled then + return + end local currentFrame = Spring.GetGameFrame() @@ -6796,60 +7064,62 @@ local function DrawExplosionOverlay() if expLosAlly and not spFunc.IsPosInLos(explosion.x, 0, explosion.z, expLosAlly) then -- skip else - local age = (currentFrame - explosion.startFrame) / 30 - - -- Replicate lifetime logic from DrawExplosions - local lifetime = 0.4 + explosion.radius / 200 - if explosion.radius > 150 then - lifetime = math.min(1.5, lifetime * 2) - elseif explosion.radius > 80 then - lifetime = math.min(1.0, lifetime * 1.5) - else - lifetime = math.min(0.8, lifetime) - end + local age = (currentFrame - explosion.startFrame) / 30 - -- Unit death explosions last 40% longer - if explosion.isUnitExplosion then - lifetime = lifetime * 1.4 - end + -- Replicate lifetime logic from DrawExplosions + local lifetime = 0.4 + explosion.radius / 200 + if explosion.radius > 150 then + lifetime = math.min(1.5, lifetime * 2) + elseif explosion.radius > 80 then + lifetime = math.min(1.0, lifetime * 1.5) + else + lifetime = math.min(0.8, lifetime) + end - if age <= lifetime then - local progress = 0.3 + (age / lifetime) * 0.7 - local effectiveRadius = explosion.radius - if effectiveRadius > 80 then effectiveRadius = effectiveRadius * 0.75 end - if explosion.isUnitExplosion then effectiveRadius = effectiveRadius * 1.33 end - local baseRadius = effectiveRadius * (0.24 + progress * 1.36) - local fade = 1 - (age / lifetime) + -- Unit death explosions last 40% longer + if explosion.isUnitExplosion then + lifetime = lifetime * 1.4 + end - -- Saturated colored glow (additive blend adds these to the scene) - -- Use low green/blue to avoid washing out to white - local overlayAlpha = fade * config.explosionOverlayAlpha - local r, g, b - if explosion.isJuno then - r, g, b = 0.15, 0.8, 0.25 -- Green tint - elseif explosion.isParalyze then - r, g, b = 0.25, 0.35, 0.9 -- Blue-purple tint - else - -- Warm orange-red: high R, moderate G, minimal B - local seed = explosion.randomSeed - local hueShift = math.sin(seed * 12.9898) * 0.08 - r = 0.95 - g = 0.4 + hueShift -- 0.32-0.48: orange range - b = 0.05 -- Very little blue keeps it saturated - end - GL4AddCircle(explosion.x, explosion.z, baseRadius * 0.85, overlayAlpha, - r, g, b, r * 0.3, g * 0.2, b * 0.1, 0, 0) - - -- Big flash overlay: white glow above icons for nukes/commanders/fusions - -- Flash runs at 1.7x speed matching Layer 5 timing - if explosion.isBigFlash and age / lifetime < 0.75 then - local ft = (age / lifetime) / 0.75 -- compress into 75% of explosion lifetime - local fa = math.min(1, (1-ft)*(1-ft)*(1-ft) * 1.2 + (1-ft) * 0.12) - local flashR = effectiveRadius * (1.4 + ft * 1.2) - GL4AddCircle(explosion.x, explosion.z, flashR * 0.7, fa * config.explosionOverlayAlpha * 0.6, - 1, 1, 1, 0.95, 0.93, 0.88, 0, 0) + if age <= lifetime then + local progress = 0.3 + (age / lifetime) * 0.7 + local effectiveRadius = explosion.radius + if effectiveRadius > 80 then + effectiveRadius = effectiveRadius * 0.75 + end + if explosion.isUnitExplosion then + effectiveRadius = effectiveRadius * 1.33 + end + local baseRadius = effectiveRadius * (0.24 + progress * 1.36) + local fade = 1 - (age / lifetime) + + -- Saturated colored glow (additive blend adds these to the scene) + -- Use low green/blue to avoid washing out to white + local overlayAlpha = fade * config.explosionOverlayAlpha + local r, g, b + if explosion.isJuno then + r, g, b = 0.15, 0.8, 0.25 -- Green tint + elseif explosion.isParalyze then + r, g, b = 0.25, 0.35, 0.9 -- Blue-purple tint + else + -- Warm orange-red: high R, moderate G, minimal B + local seed = explosion.randomSeed + local hueShift = math.sin(seed * 12.9898) * 0.08 + r = 0.95 + g = 0.4 + hueShift -- 0.32-0.48: orange range + b = 0.05 -- Very little blue keeps it saturated + end + GL4AddCircle(explosion.x, explosion.z, baseRadius * 0.85, overlayAlpha, r, g, b, r * 0.3, g * 0.2, b * 0.1, 0, 0) + + -- Big flash overlay: white glow above icons for nukes/commanders/fusions + -- Flash runs at 1.7x speed matching Layer 5 timing + if explosion.isBigFlash and age / lifetime < 0.75 then + local ft = (age / lifetime) / 0.75 -- compress into 75% of explosion lifetime + local fa = math.min(1, (1 - ft) * (1 - ft) * (1 - ft) * 1.2 + (1 - ft) * 0.12) + local flashR = effectiveRadius * (1.4 + ft * 1.2) + GL4AddCircle(explosion.x, explosion.z, flashR * 0.7, fa * config.explosionOverlayAlpha * 0.6, 1, 1, 1, 0.95, 0.93, 0.88, 0, 0) + end end - end end -- LOS view filter else end end @@ -6864,7 +7134,7 @@ local function GetUnitAtPoint(wx, wz) clickRadius = config.iconRadius * 0.4 else -- Low zoom: use distMult for easier clicking on small icons - local distMult = math.min(math.max(1, 2.2-(cameraState.zoom*3.3)), 3) + local distMult = math.min(math.max(1, 2.2 - (cameraState.zoom * 3.3)), 3) clickRadius = config.iconRadius * cameraState.zoom * distMult * 0.8 end @@ -6879,7 +7149,7 @@ local function GetUnitAtPoint(wx, wz) end local factoryID - local radarUnitID -- Store highest priority radar-only unit + local radarUnitID -- Store highest priority radar-only unit -- Iterate backwards to respect draw order (units drawn last are on top) for i = #miscState.pipUnits, 1, -1 do @@ -6897,10 +7167,10 @@ local function GetUnitAtPoint(wx, wz) end -- Also consider the actual unit radius, use whichever is larger for easier clicking - local unitRadiusSq = cache.radiusSqs[uDefID] or (config.iconRadius*config.iconRadius) + local unitRadiusSq = cache.radiusSqs[uDefID] or (config.iconRadius * config.iconRadius) local clickRadiusSq = math.max(unitClickRadius * unitClickRadius, unitRadiusSq) - if dx*dx + dz*dz < clickRadiusSq then + if dx * dx + dz * dz < clickRadiusSq then -- Check if this unit is only visible via radar (not in LOS) local losState = spFunc.GetUnitLosState(uID, checkAllyTeamID) local isRadarOnly = losState and losState.radar and not losState.los @@ -6935,7 +7205,7 @@ local function GetFeatureAtPoint(wx, wz) local fx, fy, fz = spFunc.GetFeaturePosition(fID) if fx then local dx, dz = fx - wx, fz - wz - if dx*dx + dz*dz < cache.featureRadiusSqs[spFunc.GetFeatureDefID(fID)] then + if dx * dx + dz * dz < cache.featureRadiusSqs[spFunc.GetFeatureDefID(fID)] then return fID end end @@ -6944,9 +7214,13 @@ end local function GetIDAtPoint(wx, wz) local uID = GetUnitAtPoint(wx, wz) - if uID then return uID end + if uID then + return uID + end local fID = GetFeatureAtPoint(wx, wz) - if fID then return fID + Game.maxUnits end + if fID then + return fID + Game.maxUnits + end end local function GetUnitsInBox(x1, y1, x2, y2) @@ -6993,7 +7267,9 @@ local function UnitQueueVertices(uID) local cached = cmdQueueCache.waypoints[uID] if cached and cached.n > 0 then local ux, _, uz = spFunc.GetUnitPosition(uID) - if not ux then return end + if not ux then + return + end local px, pz = WorldToPipCoords(ux, uz) for i = 1, cached.n do local wp = cached[i] @@ -7008,7 +7284,9 @@ local function UnitQueueVertices(uID) -- Fallback: fetch commands directly (first frame or uncached unit) local uCmds = spFunc.GetUnitCommands(uID, 100) - if not uCmds or #uCmds == 0 then return end + if not uCmds or #uCmds == 0 then + return + end local ux, uy, uz = spFunc.GetUnitPosition(uID) local px, pz = WorldToPipCoords(ux, uz) for i = 1, #uCmds do @@ -7016,7 +7294,7 @@ local function UnitQueueVertices(uID) if (cmd.id < 0) or positionCmds[cmd.id] then local cx, cy, cz local paramCount = #cmd.params - if paramCount == 3 or cmd.id == 10 then -- with a little drag its 6 + if paramCount == 3 or cmd.id == 10 then -- with a little drag its 6 -- Regular positional command cx, cy, cz = cmd.params[1], cmd.params[2], cmd.params[3] elseif paramCount == 4 then @@ -7063,18 +7341,27 @@ local function GetCmdOpts(alt, ctrl, meta, shift, right) pools.cmdOpts.right = right local coded = 0 - if alt then coded = coded + CMD.OPT_ALT end - if ctrl then coded = coded + CMD.OPT_CTRL end - if meta then coded = coded + CMD.OPT_META end - if shift then coded = coded + CMD.OPT_SHIFT end - if right then coded = coded + CMD.OPT_RIGHT end + if alt then + coded = coded + CMD.OPT_ALT + end + if ctrl then + coded = coded + CMD.OPT_CTRL + end + if meta then + coded = coded + CMD.OPT_META + end + if shift then + coded = coded + CMD.OPT_SHIFT + end + if right then + coded = coded + CMD.OPT_RIGHT + end pools.cmdOpts.coded = coded return pools.cmdOpts end local function GiveNotifyingOrder(cmdID, cmdParams, cmdOpts) - if widgetHandler:CommandNotify(cmdID, cmdParams, cmdOpts) then return end @@ -7084,8 +7371,10 @@ end local function GetBuildingDimensions(uDefID, facing) local bDef = UnitDefs[uDefID] - if not bDef then return 32, 32 end - if (facing % 2 == 1) then + if not bDef then + return 32, 32 + end + if facing % 2 == 1 then return 4 * bDef.zsize, 4 * bDef.xsize else return 4 * bDef.xsize, 4 * bDef.zsize @@ -7100,10 +7389,14 @@ end local function FindMyCommander() -- Find the player's starting commander unit local myTeamID = Spring.GetMyTeamID() - if not myTeamID then return nil end + if not myTeamID then + return nil + end local teamUnits = Spring.GetTeamUnits(myTeamID) - if not teamUnits then return nil end + if not teamUnits then + return nil + end -- Look for commander units (they have customParams.iscommander or are named *com) for i = 1, #teamUnits do @@ -7145,7 +7438,7 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build if distance < 1 then -- Too short, just return start position - positions[1] = {wx = sx, wz = sz} + positions[1] = { wx = sx, wz = sz } return positions end @@ -7167,7 +7460,7 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build local dirZ = distance > 0 and dz / distance or 0 -- Always add the first position (already snapped) - positions[#positions + 1] = {wx = sx, wz = sz} + positions[#positions + 1] = { wx = sx, wz = sz } -- Calculate spacing based on building size local baseSpacing = math.max(buildWidth, buildHeight) * 2 @@ -7183,12 +7476,12 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build -- diagonalRatio: 0.0 = straight line, 1.0 = perfect 45° diagonal -- For straight lines (ratio ~0): tight spacing (0.95x), no extra overlap check (1.0x) -- For diagonal lines (ratio ~1): looser spacing (1.2x), stricter overlap check (1.8x) - local minSpacingMultiplier = 0.95 + (diagonalRatio * 0.25) -- 0.95 to 1.2 - local overlapCheckMultiplier = 1.0 + (diagonalRatio * 0.8) -- 1.0 to 1.8 + local minSpacingMultiplier = 0.95 + (diagonalRatio * 0.25) -- 0.95 to 1.2 + local overlapCheckMultiplier = 1.0 + (diagonalRatio * 0.8) -- 1.0 to 1.8 -- For diagonal lines, we need to find snap points that stay near the line -- Search along the line with small steps and snap each point - local searchStep = buildWidth * 0.5 -- Small search increment + local searchStep = buildWidth * 0.5 -- Small search increment local lastPlacedDist = 0 for searchDist = searchStep, distance, searchStep do @@ -7200,14 +7493,14 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build -- Check distance from last placed building local lastPos = positions[#positions] - local distFromLast = math.sqrt((snappedX - lastPos.wx)^2 + (snappedZ - lastPos.wz)^2) + local distFromLast = math.sqrt((snappedX - lastPos.wx) ^ 2 + (snappedZ - lastPos.wz) ^ 2) -- Only place if we're far enough from the last building if distFromLast >= baseSpacing * minSpacingMultiplier then -- Check if too close to any other position local tooClose = false for j = 1, #positions do - local dist = math.sqrt((snappedX - positions[j].wx)^2 + (snappedZ - positions[j].wz)^2) + local dist = math.sqrt((snappedX - positions[j].wx) ^ 2 + (snappedZ - positions[j].wz) ^ 2) if dist < buildWidth * overlapCheckMultiplier then tooClose = true break @@ -7215,7 +7508,7 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build end if not tooClose then - positions[#positions + 1] = {wx = snappedX, wz = snappedZ} + positions[#positions + 1] = { wx = snappedX, wz = snappedZ } lastPlacedDist = searchDist end end @@ -7249,15 +7542,15 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build -- Check if this snapped position is too close to a previous one (engine would reject it) local tooClose = false for i = 1, #positions do - local dist = math.sqrt((snappedX - positions[i].wx)^2 + (snappedZ - positions[i].wz)^2) - if dist < buildWidth then -- Stricter: full width apart + local dist = math.sqrt((snappedX - positions[i].wx) ^ 2 + (snappedZ - positions[i].wz) ^ 2) + if dist < buildWidth then -- Stricter: full width apart tooClose = true break end end if not tooClose then - positions[#positions + 1] = {wx = snappedX, wz = snappedZ} + positions[#positions + 1] = { wx = snappedX, wz = snappedZ } end end end @@ -7288,28 +7581,27 @@ local function CalculateBuildDragPositions(startWX, startWZ, endWX, endWZ, build -- Check if too close to previous local tooClose = false for i = 1, #positions do - local dist = math.sqrt((snappedX - positions[i].wx)^2 + (snappedZ - positions[i].wz)^2) - if dist < buildWidth then -- Stricter check + local dist = math.sqrt((snappedX - positions[i].wx) ^ 2 + (snappedZ - positions[i].wz) ^ 2) + if dist < buildWidth then -- Stricter check tooClose = true break end end if not tooClose then - positions[#positions + 1] = {wx = snappedX, wz = snappedZ} + positions[#positions + 1] = { wx = snappedX, wz = snappedZ } end end end end else -- No valid modifier combination, return end position (cursor location) - positions[#positions + 1] = {wx = ex, wz = ez} + positions[#positions + 1] = { wx = ex, wz = ez } end return positions end - -- Helper function to check if a transport can load a target unit local function CanTransportLoadUnit(transportUnitID, targetUnitID) if not transportUnitID or not targetUnitID then @@ -7363,7 +7655,6 @@ local function CanTransportLoadUnit(transportUnitID, targetUnitID) end local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) - local alt, ctrl, meta, shift = Spring.GetModKeyState() -- Respect InvertQueueKey setting (same as customformations widget) if Spring.GetInvertQueueKey() then @@ -7385,21 +7676,21 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) -- For ATTACK command, only target if it's an enemy unit if id and cmdID == CMD.ATTACK then if Spring.IsUnitAllied(id) then - id = nil -- Don't target allied units with ATTACK, use ground position instead + id = nil -- Don't target allied units with ATTACK, use ground position instead end end -- For area RECLAIM command (radius > 0), don't target enemy units if id and cmdID == CMD.RECLAIM and radius and radius > 0 then if not Spring.IsUnitAllied(id) then - id = nil -- Don't target enemy units with area RECLAIM + id = nil -- Don't target enemy units with area RECLAIM end end -- For area REPAIR command (radius > 0), don't target enemy units if id and cmdID == CMD.REPAIR and radius and radius > 0 then if not Spring.IsUnitAllied(id) then - id = nil -- Don't target enemy units with area REPAIR + id = nil -- Don't target enemy units with area REPAIR end end end @@ -7416,7 +7707,8 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) if unitDefID and cache.isTransport[unitDefID] and (cache.transportCapacity[unitDefID] or 0) > 0 then transports[#transports + 1] = selectedUnits[i] end - end if #transports > 0 then + end + if #transports > 0 then -- If multiple transports, convert to area command so they load different units if #transports > 1 then local ux, uy, uz = spFunc.GetUnitPosition(id) @@ -7424,16 +7716,16 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) -- Use a small radius area command so transports will find different nearby units local smallRadius = 150 for i = 1, #transports do - Spring.GiveOrderToUnit(transports[i], cmdID, {ux, uy, uz, smallRadius}, cmdOpts.coded) + Spring.GiveOrderToUnit(transports[i], cmdID, { ux, uy, uz, smallRadius }, cmdOpts.coded) end end else -- Single transport, give direct unit target - Spring.GiveOrderToUnit(transports[1], cmdID, {id}, cmdOpts.coded) + Spring.GiveOrderToUnit(transports[1], cmdID, { id }, cmdOpts.coded) end end else - GiveNotifyingOrder(cmdID, {id}, cmdOpts) + GiveNotifyingOrder(cmdID, { id }, cmdOpts) end else if cmdID > 0 then @@ -7455,14 +7747,14 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) for i = 1, #selectedUnits do local unitDefID = spFunc.GetUnitDefID(selectedUnits[i]) if unitDefID and cache.isTransport[unitDefID] and (cache.transportCapacity[unitDefID] or 0) > 0 then - Spring.GiveOrderToUnit(selectedUnits[i], cmdID, {wx, spFunc.GetGroundHeight(wx, wz), wz, radius}, cmdOpts.coded) + Spring.GiveOrderToUnit(selectedUnits[i], cmdID, { wx, spFunc.GetGroundHeight(wx, wz), wz, radius }, cmdOpts.coded) end end else - GiveNotifyingOrder(cmdID, {wx, spFunc.GetGroundHeight(wx, wz), wz, radius}, cmdOpts) + GiveNotifyingOrder(cmdID, { wx, spFunc.GetGroundHeight(wx, wz), wz, radius }, cmdOpts) end else - GiveNotifyingOrder(cmdID, {wx, spFunc.GetGroundHeight(wx, wz), wz}, cmdOpts) + GiveNotifyingOrder(cmdID, { wx, spFunc.GetGroundHeight(wx, wz), wz }, cmdOpts) end else -- Build command - check if it's an extractor/geo that needs spot snapping @@ -7492,13 +7784,13 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) if spot then -- Use PreviewExtractorCommand to get proper build position - local pos = {wx, spFunc.GetGroundHeight(wx, wz), wz} + local pos = { wx, spFunc.GetGroundHeight(wx, wz), wz } local cmd = resourceSpotBuilder.PreviewExtractorCommand(pos, buildDefID, spot) if cmd and #cmd > 0 then -- Apply the command using ApplyPreviewCmds local constructors = isMex and resourceSpotBuilder.GetMexConstructors() or resourceSpotBuilder.GetGeoConstructors() - resourceSpotBuilder.ApplyPreviewCmds({cmd}, constructors, shift) + resourceSpotBuilder.ApplyPreviewCmds({ cmd }, constructors, shift) return end end @@ -7509,7 +7801,7 @@ local function IssueCommandAtPoint(cmdID, wx, wz, usingRMB, forceQueue, radius) -- Regular building - just pass the position as-is (no additional snapping) -- The position should already be snapped from CalculateBuildDragPositions - GiveNotifyingOrder(cmdID, {wx, spFunc.GetGroundHeight(wx, wz), wz, Spring.GetBuildFacing()}, cmdOpts) + GiveNotifyingOrder(cmdID, { wx, spFunc.GetGroundHeight(wx, wz), wz, Spring.GetBuildFacing() }, cmdOpts) end end end @@ -7609,18 +7901,32 @@ end -- Delete seismic ping display lists local function DeleteSeismicPingDlists() for i = 0, 3 do - if seismicPingDlists.outerArcs[i] then gl.DeleteList(seismicPingDlists.outerArcs[i]) end - if seismicPingDlists.outerOutlines[i] then gl.DeleteList(seismicPingDlists.outerOutlines[i]) end + if seismicPingDlists.outerArcs[i] then + gl.DeleteList(seismicPingDlists.outerArcs[i]) + end + if seismicPingDlists.outerOutlines[i] then + gl.DeleteList(seismicPingDlists.outerOutlines[i]) + end end for i = 0, 2 do - if seismicPingDlists.middleArcs[i] then gl.DeleteList(seismicPingDlists.middleArcs[i]) end - if seismicPingDlists.middleOutlines[i] then gl.DeleteList(seismicPingDlists.middleOutlines[i]) end + if seismicPingDlists.middleArcs[i] then + gl.DeleteList(seismicPingDlists.middleArcs[i]) + end + if seismicPingDlists.middleOutlines[i] then + gl.DeleteList(seismicPingDlists.middleOutlines[i]) + end end for i = 0, 1 do - if seismicPingDlists.innerArcs[i] then gl.DeleteList(seismicPingDlists.innerArcs[i]) end - if seismicPingDlists.innerOutlines[i] then gl.DeleteList(seismicPingDlists.innerOutlines[i]) end + if seismicPingDlists.innerArcs[i] then + gl.DeleteList(seismicPingDlists.innerArcs[i]) + end + if seismicPingDlists.innerOutlines[i] then + gl.DeleteList(seismicPingDlists.innerOutlines[i]) + end + end + if seismicPingDlists.centerCircle then + gl.DeleteList(seismicPingDlists.centerCircle) end - if seismicPingDlists.centerCircle then gl.DeleteList(seismicPingDlists.centerCircle) end end -- Register (or re-register) WG['minimap'] API for full compatibility with widgets @@ -7628,61 +7934,65 @@ end -- when the standard Minimap widget is found active and needs to be disabled (its Initialize -- may have overwritten our WG['minimap'] registration due to widget layer ordering). local function RegisterMinimapWGAPI() - if not isMinimapMode then return end - WG['minimap'] = {} - WG['minimap'].getHeight = function() - if miscState.minimapMinimized then return 0 end + if not isMinimapMode then + return + end + WG["minimap"] = {} + WG["minimap"].getHeight = function() + if miscState.minimapMinimized then + return 0 + end local padding = WG.FlowUI and WG.FlowUI.elementPadding or 5 return (render.dim.t - render.dim.b) + padding end - WG['minimap'].getMaxHeight = function() + WG["minimap"].getMaxHeight = function() return math.floor(config.minimapModeMaxHeight * render.vsy), config.minimapModeMaxHeight end - WG['minimap'].setMaxHeight = function(value) + WG["minimap"].setMaxHeight = function(value) Spring.SetConfigFloat("MinimapMaxHeight", value) config.minimapModeMaxHeight = value widget:ViewResize() end - WG['minimap'].getLeftClickMove = function() + WG["minimap"].getLeftClickMove = function() return config.leftButtonPansCamera end - WG['minimap'].setLeftClickMove = function(value) + WG["minimap"].setLeftClickMove = function(value) config.leftButtonPansCamera = value Spring.SetConfigInt("MinimapLeftClickMove", value and 1 or 0) end - WG['minimap'].isPipMinimapActive = function() + WG["minimap"].isPipMinimapActive = function() return true end - WG['minimap'].isDrawingInPip = false - WG['minimap'].getScreenBounds = function() + WG["minimap"].isDrawingInPip = false + WG["minimap"].getScreenBounds = function() return render.dim.l, render.dim.b, render.dim.r, render.dim.t end - WG['minimap'].getVisibleWorldArea = function() + WG["minimap"].getVisibleWorldArea = function() return render.world.l, render.world.r, render.world.b, render.world.t end - WG['minimap'].getRotation = function() + WG["minimap"].getRotation = function() return render.minimapRotation or 0 end - WG['minimap'].getNormalizedVisibleArea = function() + WG["minimap"].getNormalizedVisibleArea = function() local normVisLeft = render.world.l / mapInfo.mapSizeX local normVisRight = render.world.r / mapInfo.mapSizeX local normVisBottom = render.world.b / mapInfo.mapSizeZ local normVisTop = render.world.t / mapInfo.mapSizeZ return normVisLeft, normVisRight, normVisBottom, normVisTop end - WG['minimap'].getZoomLevel = function() + WG["minimap"].getZoomLevel = function() return mapInfo.mapSizeX / (render.world.r - render.world.l) end - WG['minimap'].getShowSpectatorPings = function() + WG["minimap"].getShowSpectatorPings = function() return config.showSpectatorPings end - WG['minimap'].setShowSpectatorPings = function(value) + WG["minimap"].setShowSpectatorPings = function(value) config.showSpectatorPings = value end - WG['minimap'].getEngineMinimapFallback = function() + WG["minimap"].getEngineMinimapFallback = function() return config.engineMinimapFallback end - WG['minimap'].setEngineMinimapFallback = function(value) + WG["minimap"].setEngineMinimapFallback = function(value) config.engineMinimapFallback = value if not value and miscState.engineMinimapActive then -- Turning off fallback while engine minimap is showing: restore icon scale and re-minimize @@ -7697,19 +8007,19 @@ local function RegisterMinimapWGAPI() pipR2T.unitsNeedsUpdate = true end end - WG['minimap'].getEngineMinimapFallbackThreshold = function() + WG["minimap"].getEngineMinimapFallbackThreshold = function() return config.engineMinimapFallbackThreshold end - WG['minimap'].setEngineMinimapFallbackThreshold = function(value) + WG["minimap"].setEngineMinimapFallbackThreshold = function(value) config.engineMinimapFallbackThreshold = value end - WG['minimap'].getEngineMinimapExplosionOverlay = function() + WG["minimap"].getEngineMinimapExplosionOverlay = function() return config.engineMinimapExplosionOverlay end - WG['minimap'].setEngineMinimapExplosionOverlay = function(value) + WG["minimap"].setEngineMinimapExplosionOverlay = function(value) config.engineMinimapExplosionOverlay = value end - WG['minimap'].setBaseIconScale = function(value) + WG["minimap"].setBaseIconScale = function(value) if miscState.engineMinimapActive then miscState.baseMinimapIconScale = value end @@ -7724,19 +8034,19 @@ function widget:Initialize() drawData.unitOutlineList = gl.CreateList(function() glFunc.BeginEnd(GL.LINE_LOOP, function() - glFunc.Vertex( 1, 0, 1) - glFunc.Vertex( 1, 0,-1) - glFunc.Vertex(-1, 0,-1) + glFunc.Vertex(1, 0, 1) + glFunc.Vertex(1, 0, -1) + glFunc.Vertex(-1, 0, -1) glFunc.Vertex(-1, 0, 1) end) end) drawData.radarDotList = gl.CreateList(function() - glFunc.Texture('LuaUI/Images/pip/PipBlip.png') + glFunc.Texture("LuaUI/Images/pip/PipBlip.png") glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex( config.iconRadius, config.iconRadius) - glFunc.Vertex( config.iconRadius,-config.iconRadius) - glFunc.Vertex(-config.iconRadius,-config.iconRadius) + glFunc.Vertex(config.iconRadius, config.iconRadius) + glFunc.Vertex(config.iconRadius, -config.iconRadius) + glFunc.Vertex(-config.iconRadius, -config.iconRadius) glFunc.Vertex(-config.iconRadius, config.iconRadius) end) glFunc.Texture(false) @@ -7754,7 +8064,7 @@ function widget:Initialize() cache.unitIcon[uDefID] = iconTypes[uDef.iconType] end -- Cache unitpic path using engine's #unitDefID syntax (handles all buildpic variations automatically) - cache.unitPic[uDefID] = '#' .. uDefID + cache.unitPic[uDefID] = "#" .. uDefID -- Cache transport properties if uDef.isTransport then @@ -7837,14 +8147,14 @@ function widget:Initialize() end for fDefID, fDef in pairs(FeatureDefs) do - if fDef.modelname == '' then + if fDef.modelname == "" then cache.noModelFeatures[fDefID] = true end if fDef.reclaimable ~= nil and not fDef.reclaimable then cache.unreclaimableFeatures[fDefID] = true end local fx, fz = 8 * fDef.xsize, 8 * fDef.zsize - cache.featureRadiusSqs[fDefID] = fx*fx + fz*fz + cache.featureRadiusSqs[fDefID] = fx * fx + fz * fz end -- Initialize LOS texture (a fraction of map size) @@ -7852,9 +8162,9 @@ function widget:Initialize() local losTexHeight = math.max(1, math.floor(mapInfo.mapSizeZ / pipR2T.losTexScale)) pipR2T.losTex = gl.CreateTexture(losTexWidth, losTexHeight, { target = GL.TEXTURE_2D, - format = GL.RGBA8, -- RGBA for proper greyscale rendering + format = GL.RGBA8, -- RGBA for proper greyscale rendering fbo = true, - min_filter = GL.LINEAR, -- Use linear filtering for smooth/blurred appearance + min_filter = GL.LINEAR, -- Use linear filtering for smooth/blurred appearance mag_filter = GL.LINEAR, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, @@ -7908,7 +8218,7 @@ function widget:Initialize() shaders.decalBlit = gl.CreateShader(shaders.decalBlitCode) if shaders.decalBlit then shaders.decalBlitLocs = { - strength = gl.GetUniformLocation(shaders.decalBlit, 'strength'), + strength = gl.GetUniformLocation(shaders.decalBlit, "strength"), } else Spring.Echo("PIP: Failed to compile decal blit shader") @@ -7933,7 +8243,7 @@ function widget:Initialize() -- Localize weapon data for performance -- Default missile colors fallback (wDefID 0) - cache.missileColors[0] = {0.88,0.88,0.84, 0.92,0.92,0.88, 0.82,0.82,0.78, 1.0,0.7,0.3} + cache.missileColors[0] = { 0.88, 0.88, 0.84, 0.92, 0.92, 0.88, 0.82, 0.82, 0.78, 1.0, 0.7, 0.3 } for wDefID, wDef in pairs(WeaponDefs) do -- Check weapon type if wDef.type == "BeamLaser" then @@ -7978,17 +8288,17 @@ function widget:Initialize() cache.weaponColor[wDefID] = { wDef.visuals.colorR, wDef.visuals.colorG or 0, - wDef.visuals.colorB or 0 + wDef.visuals.colorB or 0, } elseif wDef.rgbColor then -- Parse rgbColor table {r, g, b} cache.weaponColor[wDefID] = { wDef.rgbColor[1] or 1, wDef.rgbColor[2] or 1, - wDef.rgbColor[3] or 1 + wDef.rgbColor[3] or 1, } else - cache.weaponColor[wDefID] = {1, 0.2, 0.2} -- Default red + cache.weaponColor[wDefID] = { 1, 0.2, 0.2 } -- Default red end -- Get explosion radius (allow much larger explosions for nukes, etc.) @@ -8007,244 +8317,244 @@ function widget:Initialize() local reload = wDef.reload or 1 local salvoSize = wDef.salvoSize or 1 local burst = wDef.projectiles or 1 - local effectiveRate = salvoSize * burst / reload -- shots per second + local effectiveRate = salvoSize * burst / reload -- shots per second if effectiveRate > 5 then -- Scale dim from 0.7 at 5/s down to 0.3 at 20+/s cache.weaponExplosionDim[wDefID] = math.max(0.3, 0.7 - (effectiveRate - 5) * 0.027) end end - -- Check if weapon is paralyze damage - if wDef.damages and wDef.damages.paralyzeDamageTime and wDef.damages.paralyzeDamageTime > 0 then - cache.weaponIsParalyze[wDefID] = true - end + -- Check if weapon is paralyze damage + if wDef.damages and wDef.damages.paralyzeDamageTime and wDef.damages.paralyzeDamageTime > 0 then + cache.weaponIsParalyze[wDefID] = true + end - -- Check if weapon is anti-air via cegTag - if wDef.cegTag and string.find(wDef.cegTag, 'aa') then - cache.weaponIsAA[wDefID] = true - end + -- Check if weapon is anti-air via cegTag + if wDef.cegTag and string.find(wDef.cegTag, "aa") then + cache.weaponIsAA[wDefID] = true + end - -- Check if weapon is Juno via cegTag - if wDef.cegTag and string.find(wDef.cegTag, 'juno') then - cache.weaponIsJuno[wDefID] = true - end + -- Check if weapon is Juno via cegTag + if wDef.cegTag and string.find(wDef.cegTag, "juno") then + cache.weaponIsJuno[wDefID] = true + end - -- Cache missile body/nose/fin/exhaust colors per-wDefID (avoids per-frame branching) - if cache.weaponIsMissile[wDefID] then - if cache.weaponIsJuno[wDefID] then - cache.missileColors[wDefID] = {0.3,0.8,0.3, 0.4,0.9,0.4, 0.25,0.7,0.25, 0.3,1.0,0.3} - elseif cache.weaponIsParalyze[wDefID] then - cache.missileColors[wDefID] = {0.45,0.5,0.95, 0.6,0.65,1.0, 0.35,0.4,0.85, 0.6,0.5,1.0} - elseif cache.weaponIsTorpedo[wDefID] then - cache.missileColors[wDefID] = {0.7,0.78,0.9, 0.75,0.82,0.95, 0.6,0.7,0.85, 0.5,0.7,1.0} - else - cache.missileColors[wDefID] = {0.8,0.8,0.76, 0.84,0.84,0.8, 0.74,0.74,0.7, 1.0,0.7,0.3} + -- Cache missile body/nose/fin/exhaust colors per-wDefID (avoids per-frame branching) + if cache.weaponIsMissile[wDefID] then + if cache.weaponIsJuno[wDefID] then + cache.missileColors[wDefID] = { 0.3, 0.8, 0.3, 0.4, 0.9, 0.4, 0.25, 0.7, 0.25, 0.3, 1.0, 0.3 } + elseif cache.weaponIsParalyze[wDefID] then + cache.missileColors[wDefID] = { 0.45, 0.5, 0.95, 0.6, 0.65, 1.0, 0.35, 0.4, 0.85, 0.6, 0.5, 1.0 } + elseif cache.weaponIsTorpedo[wDefID] then + cache.missileColors[wDefID] = { 0.7, 0.78, 0.9, 0.75, 0.82, 0.95, 0.6, 0.7, 0.85, 0.5, 0.7, 1.0 } + else + cache.missileColors[wDefID] = { 0.8, 0.8, 0.76, 0.84, 0.84, 0.8, 0.74, 0.74, 0.7, 1.0, 0.7, 0.3 } + end end - end - -- Classify plasma trail color by cegTag (for plasma/cannon weapons with visible trails) - if wDef.type == "Cannon" and wDef.cegTag and wDef.cegTag ~= '' then - local tag = wDef.cegTag - if string.find(tag, 'flak') or string.find(tag, 'aa') then + -- Classify plasma trail color by cegTag (for plasma/cannon weapons with visible trails) + if wDef.type == "Cannon" and wDef.cegTag and wDef.cegTag ~= "" then + local tag = wDef.cegTag + if string.find(tag, "flak") or string.find(tag, "aa") then -- AA flak: no trail (too small/fast) - elseif string.find(tag, 'botrail') then - cache.weaponPlasmaTrailColor[wDefID] = {0.44, 0.48, 0.9} -- Blue bot trail - elseif string.find(tag, 'railgun') then - cache.weaponPlasmaTrailColor[wDefID] = {0.55, 0.42, 0.88} -- Purple railgun - elseif string.find(tag, 'starfire') or string.find(tag, 'ministarfire') then - cache.weaponPlasmaTrailColor[wDefID] = {0.5, 0.55, 0.85} -- Blue-white starfire - elseif string.find(tag, 'impulse') then - cache.weaponPlasmaTrailColor[wDefID] = {0.8, 0.6, 0.25} -- Warm yellow impulse - elseif string.find(tag, 'Heavy') then - cache.weaponPlasmaTrailColor[wDefID] = {0.85, 0.5, 0.18} -- Orange heavy plasma - elseif string.find(tag, 'arty') or string.find(tag, 'cannon') then - cache.weaponPlasmaTrailColor[wDefID] = {0.82, 0.52, 0.2} -- Warm orange artillery - else - -- Generic cannon with a cegTag: subtle warm trail - cache.weaponPlasmaTrailColor[wDefID] = {0.7, 0.5, 0.25} + elseif string.find(tag, "botrail") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.44, 0.48, 0.9 } -- Blue bot trail + elseif string.find(tag, "railgun") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.55, 0.42, 0.88 } -- Purple railgun + elseif string.find(tag, "starfire") or string.find(tag, "ministarfire") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.5, 0.55, 0.85 } -- Blue-white starfire + elseif string.find(tag, "impulse") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.8, 0.6, 0.25 } -- Warm yellow impulse + elseif string.find(tag, "Heavy") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.85, 0.5, 0.18 } -- Orange heavy plasma + elseif string.find(tag, "arty") or string.find(tag, "cannon") then + cache.weaponPlasmaTrailColor[wDefID] = { 0.82, 0.52, 0.2 } -- Warm orange artillery + else + -- Generic cannon with a cegTag: subtle warm trail + cache.weaponPlasmaTrailColor[wDefID] = { 0.7, 0.5, 0.25 } + end end end -end -gameHasStarted = (Spring.GetGameFrame() > 0) -miscState.startX, _, miscState.startZ = Spring.GetTeamStartPosition(Spring.GetMyTeamID()) - --- Initialize GL4 instanced icon rendering (after cache is built so unitIcon data is available) -InitGL4Icons() -InitGL4Primitives() - --- Ghost building sharing: merge data from any already-running sibling PIP --- This ensures all PIP instances share the same ghost history even on partial reload --- Validate each imported ghost against the engine to avoid carrying over stale --- entries whose unitID has been reused (see periodic cleanup for details). -for n = 0, 4 do - if n ~= pipNumber and WG['pip' .. n] and WG['pip' .. n].GetGhostBuildings then - local siblingGhosts = WG['pip' .. n].GetGhostBuildings() - if siblingGhosts then - for gID, ghost in pairs(siblingGhosts) do - if not ghostBuildings[gID] then - local curDefID = Spring.GetUnitDefID(gID) - local accept = true - if curDefID then - if curDefID ~= ghost.defID then - accept = false - else - local curTeam = Spring.GetUnitTeam(gID) - if curTeam and ghost.teamID and curTeam ~= ghost.teamID then + gameHasStarted = (Spring.GetGameFrame() > 0) + miscState.startX, _, miscState.startZ = Spring.GetTeamStartPosition(Spring.GetMyTeamID()) + + -- Initialize GL4 instanced icon rendering (after cache is built so unitIcon data is available) + InitGL4Icons() + InitGL4Primitives() + + -- Ghost building sharing: merge data from any already-running sibling PIP + -- This ensures all PIP instances share the same ghost history even on partial reload + -- Validate each imported ghost against the engine to avoid carrying over stale + -- entries whose unitID has been reused (see periodic cleanup for details). + for n = 0, 4 do + if n ~= pipNumber and WG["pip" .. n] and WG["pip" .. n].GetGhostBuildings then + local siblingGhosts = WG["pip" .. n].GetGhostBuildings() + if siblingGhosts then + for gID, ghost in pairs(siblingGhosts) do + if not ghostBuildings[gID] then + local curDefID = Spring.GetUnitDefID(gID) + local accept = true + if curDefID then + if curDefID ~= ghost.defID then accept = false + else + local curTeam = Spring.GetUnitTeam(gID) + if curTeam and ghost.teamID and curTeam ~= ghost.teamID then + accept = false + end end end - end - if accept then - ghostBuildings[gID] = { defID = ghost.defID, x = ghost.x, z = ghost.z, teamID = ghost.teamID } + if accept then + ghostBuildings[gID] = { defID = ghost.defID, x = ghost.x, z = ghost.z, teamID = ghost.teamID } + end end end + break -- All PIPs share the same LOS perspective, one source is sufficient end - break -- All PIPs share the same LOS perspective, one source is sufficient end end -end --- Scan currently-visible enemy buildings for ghost tracking (handles luaui reload mid-game) --- UnitEnteredLos won't fire for units already in LOS at widget init, so we pre-populate here --- For spectators with LOS view, also pre-scan to populate ghosts on reload -do -local initScanAllyTeam = nil -local initScanIsSpec, initScanFullview = Spring.GetSpectatingState() -if not initScanIsSpec then - initScanAllyTeam = Spring.GetMyAllyTeamID() -elseif state.losViewEnabled and state.losViewAllyTeam then - initScanAllyTeam = state.losViewAllyTeam -elseif initScanIsSpec and not initScanFullview then - -- Spectator without fullview: scan ghosts from their allyteam's perspective - initScanAllyTeam = Spring.GetMyAllyTeamID() -end -if initScanAllyTeam then - local allUnits = Spring.GetAllUnits() - for _, uID in ipairs(allUnits) do - local defID = Spring.GetUnitDefID(uID) - if defID and cache.isBuilding[defID] then - local uTeam = Spring.GetUnitTeam(uID) - local uAllyTeam = Spring.GetTeamAllyTeamID(uTeam) - if uAllyTeam ~= initScanAllyTeam then - if initScanIsSpec then - -- As spectator, only ghost buildings the viewed allyteam has ever seen - local losBits = Spring.GetUnitLosState(uID, initScanAllyTeam, true) - if losBits and (losBits % 2 >= 1 or losBits % 8 >= 4) then - local x, _, z = Spring.GetUnitBasePosition(uID) - if x then - ghostBuildings[uID] = { defID = defID, x = x, z = z, teamID = uTeam } + -- Scan currently-visible enemy buildings for ghost tracking (handles luaui reload mid-game) + -- UnitEnteredLos won't fire for units already in LOS at widget init, so we pre-populate here + -- For spectators with LOS view, also pre-scan to populate ghosts on reload + do + local initScanAllyTeam = nil + local initScanIsSpec, initScanFullview = Spring.GetSpectatingState() + if not initScanIsSpec then + initScanAllyTeam = Spring.GetMyAllyTeamID() + elseif state.losViewEnabled and state.losViewAllyTeam then + initScanAllyTeam = state.losViewAllyTeam + elseif initScanIsSpec and not initScanFullview then + -- Spectator without fullview: scan ghosts from their allyteam's perspective + initScanAllyTeam = Spring.GetMyAllyTeamID() + end + if initScanAllyTeam then + local allUnits = Spring.GetAllUnits() + for _, uID in ipairs(allUnits) do + local defID = Spring.GetUnitDefID(uID) + if defID and cache.isBuilding[defID] then + local uTeam = Spring.GetUnitTeam(uID) + local uAllyTeam = Spring.GetTeamAllyTeamID(uTeam) + if uAllyTeam ~= initScanAllyTeam then + if initScanIsSpec then + -- As spectator, only ghost buildings the viewed allyteam has ever seen + local losBits = Spring.GetUnitLosState(uID, initScanAllyTeam, true) + if losBits and (losBits % 2 >= 1 or losBits % 8 >= 4) then + local x, _, z = Spring.GetUnitBasePosition(uID) + if x then + ghostBuildings[uID] = { defID = defID, x = x, z = z, teamID = uTeam } + end + end + else + -- As player, we can see all units returned (only own-LOS units are returned) + local x, _, z = Spring.GetUnitBasePosition(uID) + if x then + ghostBuildings[uID] = { defID = defID, x = x, z = z, teamID = uTeam } + end end end - else - -- As player, we can see all units returned (only own-LOS units are returned) - local x, _, z = Spring.GetUnitBasePosition(uID) - if x then - ghostBuildings[uID] = { defID = defID, x = x, z = z, teamID = uTeam } - end end end end - end -end -end -- do block for initScan locals + end -- do block for initScan locals --- For spectators, center on map and zoom out more (always on new game, even if has saved config) -do - local currentGameID = Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID") - local isNewGame = not miscState.savedGameID or miscState.savedGameID ~= currentGameID - if isSpectator and isNewGame then - -- Center on map - cameraState.wcx = mapInfo.mapSizeX / 2 - cameraState.wcz = mapInfo.mapSizeZ / 2 - cameraState.targetWcx = cameraState.wcx - cameraState.targetWcz = cameraState.wcz - -- Zoom out to cover most of the map - cameraState.zoom = 0.1 - cameraState.targetZoom = 0.1 - elseif (not cameraState.wcx or not cameraState.wcz) and miscState.startX and miscState.startX >= 0 then - -- Only set camera position if not already loaded from config (for players) - -- Set zoom to 0.5 for players - cameraState.zoom = 0.5 - cameraState.targetZoom = 0.5 - -- Apply map margin limits to start position - local pipWidth, pipHeight = GetEffectivePipDimensions() - local visibleWorldWidth = pipWidth / cameraState.zoom - local visibleWorldHeight = pipHeight / cameraState.zoom - cameraState.wcx = ClampCameraAxis(miscState.startX, visibleWorldWidth, mapInfo.mapSizeX, config.mapEdgeMargin) - cameraState.wcz = ClampCameraAxis(miscState.startZ, visibleWorldHeight, mapInfo.mapSizeZ, config.mapEdgeMargin) - cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Initialize targets + -- For spectators, center on map and zoom out more (always on new game, even if has saved config) + do + local currentGameID = Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID") + local isNewGame = not miscState.savedGameID or miscState.savedGameID ~= currentGameID + if isSpectator and isNewGame then + -- Center on map + cameraState.wcx = mapInfo.mapSizeX / 2 + cameraState.wcz = mapInfo.mapSizeZ / 2 + cameraState.targetWcx = cameraState.wcx + cameraState.targetWcz = cameraState.wcz + -- Zoom out to cover most of the map + cameraState.zoom = 0.1 + cameraState.targetZoom = 0.1 + elseif (not cameraState.wcx or not cameraState.wcz) and miscState.startX and miscState.startX >= 0 then + -- Only set camera position if not already loaded from config (for players) + -- Set zoom to 0.5 for players + cameraState.zoom = 0.5 + cameraState.targetZoom = 0.5 + -- Apply map margin limits to start position + local pipWidth, pipHeight = GetEffectivePipDimensions() + local visibleWorldWidth = pipWidth / cameraState.zoom + local visibleWorldHeight = pipHeight / cameraState.zoom + cameraState.wcx = ClampCameraAxis(miscState.startX, visibleWorldWidth, mapInfo.mapSizeX, config.mapEdgeMargin) + cameraState.wcz = ClampCameraAxis(miscState.startZ, visibleWorldHeight, mapInfo.mapSizeZ, config.mapEdgeMargin) + cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Initialize targets + end end -end --- Minimap mode: hide the engine minimap since we're replacing it -if isMinimapMode then - -- Store original minimap geometry and minimize state for restoration on shutdown - miscState.oldMinimapGeometry = Spring.GetMiniMapGeometry() - miscState.oldMinimapMinimized = Spring.GetConfigInt("MinimapMinimize", 0) - miscState.oldMinimapDrawPings = Spring.GetConfigInt("MiniMapDrawPings", 1) - -- Fully hide the engine minimap: slave it so it only renders when we call gl.DrawMiniMap() (which we don't) - Spring.SendCommands("minimap minimize 1") - gl.SlaveMiniMap(true) - -- Disable engine minimap pings (the PIP draws its own) - Spring.SetConfigInt("MiniMapDrawPings", 0) - -- Disable the gui_minimap widget if it's running (we're replacing it) - -- Use FindWidget which works reliably during luaui reload - if widgetHandler:FindWidget("Minimap") then - widgetHandler:DisableWidget("Minimap") - end - - -- In minimap mode, don't start minimized and center on map - uiState.inMinMode = false - -- Honour MinimapMinimize: start hidden if user had the minimap minimized - miscState.minimapMinimized = (miscState.oldMinimapMinimized == 1) - miscState.minimapInitialRotationSyncPending = true - -- Only reset camera if not restored from config (luaui reload) - if not miscState.minimapCameraRestored then - cameraState.wcx = mapInfo.mapSizeX / 2 - cameraState.wcz = mapInfo.mapSizeZ / 2 - cameraState.targetWcx = cameraState.wcx - cameraState.targetWcz = cameraState.wcz - -- Start zoomed out to see full map (will be adjusted based on aspect ratio in ViewResize) - cameraState.zoom = 0.1 - cameraState.targetZoom = 0.1 - end -else - -- Always minimize PIP when first starting (only on fresh start, not on reload) - if not uiState.inMinMode and not miscState.hadSavedConfig then - uiState.savedDimensions = { - l = render.dim.l, - r = render.dim.r, - b = render.dim.b, - t = render.dim.t - } + -- Minimap mode: hide the engine minimap since we're replacing it + if isMinimapMode then + -- Store original minimap geometry and minimize state for restoration on shutdown + miscState.oldMinimapGeometry = Spring.GetMiniMapGeometry() + miscState.oldMinimapMinimized = Spring.GetConfigInt("MinimapMinimize", 0) + miscState.oldMinimapDrawPings = Spring.GetConfigInt("MiniMapDrawPings", 1) + -- Fully hide the engine minimap: slave it so it only renders when we call gl.DrawMiniMap() (which we don't) + Spring.SendCommands("minimap minimize 1") + gl.SlaveMiniMap(true) + -- Disable engine minimap pings (the PIP draws its own) + Spring.SetConfigInt("MiniMapDrawPings", 0) + -- Disable the gui_minimap widget if it's running (we're replacing it) + -- Use FindWidget which works reliably during luaui reload + if widgetHandler:FindWidget("Minimap") then + widgetHandler:DisableWidget("Minimap") + end + + -- In minimap mode, don't start minimized and center on map + uiState.inMinMode = false + -- Honour MinimapMinimize: start hidden if user had the minimap minimized + miscState.minimapMinimized = (miscState.oldMinimapMinimized == 1) + miscState.minimapInitialRotationSyncPending = true + -- Only reset camera if not restored from config (luaui reload) + if not miscState.minimapCameraRestored then + cameraState.wcx = mapInfo.mapSizeX / 2 + cameraState.wcz = mapInfo.mapSizeZ / 2 + cameraState.targetWcx = cameraState.wcx + cameraState.targetWcz = cameraState.wcz + -- Start zoomed out to see full map (will be adjusted based on aspect ratio in ViewResize) + cameraState.zoom = 0.1 + cameraState.targetZoom = 0.1 + end + else + -- Always minimize PIP when first starting (only on fresh start, not on reload) + if not uiState.inMinMode and not miscState.hadSavedConfig then + uiState.savedDimensions = { + l = render.dim.l, + r = render.dim.r, + b = render.dim.b, + t = render.dim.t, + } + end end -end widget:ViewResize() -- Create API for other widgets - WG['pip'..pipNumber] = {} - WG['pip'..pipNumber].IsAbove = function(mx, my) + WG["pip" .. pipNumber] = {} + WG["pip" .. pipNumber].IsAbove = function(mx, my) return widget:IsAbove(mx, my) end - WG['pip'..pipNumber].ForceUpdate = function() + WG["pip" .. pipNumber].ForceUpdate = function() pipR2T.contentNeedsUpdate = true end - WG['pip'..pipNumber].SetUpdateRate = function(fps) + WG["pip" .. pipNumber].SetUpdateRate = function(fps) pipUpdateRate = fps pipUpdateInterval = pipUpdateRate > 0 and (1 / pipUpdateRate) or 0 end - WG['pip'..pipNumber].GetUpdateRate = function() + WG["pip" .. pipNumber].GetUpdateRate = function() return pipUpdateRate end - WG['pip'..pipNumber].SetMapRuler = function(enabled) + WG["pip" .. pipNumber].SetMapRuler = function(enabled) config.showMapRuler = enabled end - WG['pip'..pipNumber].GetMapRuler = function() + WG["pip" .. pipNumber].GetMapRuler = function() return config.showMapRuler end - WG['pip'..pipNumber].TrackPlayer = function(playerID) + WG["pip" .. pipNumber].TrackPlayer = function(playerID) if playerID and type(playerID) == "number" then -- Prevent tracking yourself local myPlayerID = Spring.GetMyPlayerID() @@ -8255,72 +8565,74 @@ end local name, _, isSpec = spFunc.GetPlayerInfo(playerID, false) if name and not isSpec then interactionState.trackingPlayerID = playerID - interactionState.areTracking = nil -- Clear unit tracking + interactionState.areTracking = nil -- Clear unit tracking pipR2T.frameNeedsUpdate = true pipR2T.contentNeedsUpdate = true - pipR2T.losNeedsUpdate = true -- Update LOS for new tracked player + pipR2T.losNeedsUpdate = true -- Update LOS for new tracked player return true end end return false end - WG['pip'..pipNumber].UntrackPlayer = function() + WG["pip" .. pipNumber].UntrackPlayer = function() if interactionState.trackingPlayerID then interactionState.trackingPlayerID = nil pipR2T.frameNeedsUpdate = true - pipR2T.losNeedsUpdate = true -- Update LOS when untracking + pipR2T.losNeedsUpdate = true -- Update LOS when untracking return true end return false end - WG['pip'..pipNumber].GetTrackedPlayer = function() + WG["pip" .. pipNumber].GetTrackedPlayer = function() return interactionState.trackingPlayerID end -- API for minimap mode: get visible world area - WG['pip'..pipNumber].IsMinimapMode = function() + WG["pip" .. pipNumber].IsMinimapMode = function() return isMinimapMode end - WG['pip'..pipNumber].GetVisibleWorldArea = function() + WG["pip" .. pipNumber].GetVisibleWorldArea = function() -- Returns the visible world coordinates: left, right, bottom, top return render.world.l, render.world.r, render.world.b, render.world.t end - WG['pip'..pipNumber].GetScreenBounds = function() + WG["pip" .. pipNumber].GetScreenBounds = function() -- Returns the screen coordinates of the PIP return render.dim.l, render.dim.r, render.dim.b, render.dim.t end - WG['pip'..pipNumber].IsMinimized = function() + WG["pip" .. pipNumber].IsMinimized = function() return uiState.inMinMode or (isMinimapMode and miscState.minimapMinimized) end - WG['pip'..pipNumber].GetZoom = function() + WG["pip" .. pipNumber].GetZoom = function() return cameraState.zoom end - WG['pip'..pipNumber].GetCameraCenter = function() + WG["pip" .. pipNumber].GetCameraCenter = function() return cameraState.wcx, cameraState.wcz end -- Expose ghost building cache so sibling PIPs can share data on reload - WG['pip'..pipNumber].GetGhostBuildings = function() + WG["pip" .. pipNumber].GetGhostBuildings = function() return ghostBuildings end - WG['pip'..pipNumber].getDrawCommandFX = function() + WG["pip" .. pipNumber].getDrawCommandFX = function() return config.drawCommandFX end - WG['pip'..pipNumber].setDrawCommandFX = function(value) + WG["pip" .. pipNumber].setDrawCommandFX = function(value) config.drawCommandFX = value pipR2T.unitsNeedsUpdate = true end - WG['pip'..pipNumber].getAltKeyRequiredForZoom = function() + WG["pip" .. pipNumber].getAltKeyRequiredForZoom = function() return config.altKeyRequiredForZoom end - WG['pip'..pipNumber].setAltKeyRequiredForZoom = function(value) + WG["pip" .. pipNumber].setAltKeyRequiredForZoom = function(value) config.altKeyRequiredForZoom = value end -- In minimap mode, also register as WG.pip_minimap for compatibility if isMinimapMode then - WG.pip_minimap = WG['pip'..pipNumber] + WG.pip_minimap = WG["pip" .. pipNumber] -- Also expose getHeight like the original minimap widget for topbar compatibility WG.pip_minimap.getHeight = function() - if miscState.minimapMinimized then return 0 end + if miscState.minimapMinimized then + return 0 + end local padding = WG.FlowUI and WG.FlowUI.elementPadding or 5 return (render.dim.t - render.dim.b) + padding end @@ -8333,7 +8645,7 @@ end local button = buttons[i] if button.command then -- Register with pip-specific action name so each pip instance has unique commands - widgetHandler.actionHandler:AddAction(self, button.actionName, button.OnPress, nil, 'p') + widgetHandler.actionHandler:AddAction(self, button.actionName, button.OnPress, nil, "p") end end @@ -8342,8 +8654,7 @@ end end function widget:ViewResize() - - font = WG['fonts'].getFont(2) + font = WG["fonts"].getFont(2) local oldVsx, oldVsy = render.vsx, render.vsy render.vsx, render.vsy = Spring.GetViewGeometry() @@ -8369,7 +8680,7 @@ function widget:ViewResize() -- Calculate map aspect ratio, swapping if rotated 90° or 270° local mapRatio if is90or270 then - mapRatio = Game.mapY / Game.mapX -- Inverted for rotated view + mapRatio = Game.mapY / Game.mapX -- Inverted for rotated view else mapRatio = Game.mapX / Game.mapY end @@ -8377,10 +8688,10 @@ function widget:ViewResize() local maxHeight = config.minimapModeMaxHeight -- Dynamically determine max width from topbar position (like gui_minimap does) local effectiveMaxWidth = config.minimapModeMaxWidth - if WG['topbar'] and WG['topbar'].GetPosition then - local topbarArea = WG['topbar'].GetPosition() + if WG["topbar"] and WG["topbar"].GetPosition then + local topbarArea = WG["topbar"].GetPosition() if topbarArea and topbarArea[1] then - local margin = WG.FlowUI and (WG.FlowUI.elementMargin*6) or 10 + local margin = WG.FlowUI and (WG.FlowUI.elementMargin * 6) or 10 effectiveMaxWidth = (topbarArea[1] - margin) / render.vsx end end @@ -8423,7 +8734,7 @@ function widget:ViewResize() fitZoomX = contentWidth / mapInfo.mapSizeX fitZoomZ = contentHeight / mapInfo.mapSizeZ end - local fitZoom = math.min(fitZoomX, fitZoomZ) -- Use min to ensure full map is visible at max zoom-out + local fitZoom = math.min(fitZoomX, fitZoomZ) -- Use min to ensure full map is visible at max zoom-out -- Set min zoom for current orientation (recalculated on rotation change via ViewResize) minimapModeMinZoom = fitZoom @@ -8464,9 +8775,7 @@ function widget:ViewResize() RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() - Spring.SendCommands(string.format("minimap geometry %d %d %d %d", - math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), - math.floor(render.dim.r - render.dim.l), math.floor(render.dim.t - render.dim.b))) + Spring.SendCommands(string.format("minimap geometry %d %d %d %d", math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), math.floor(render.dim.r - render.dim.l), math.floor(render.dim.t - render.dim.b))) else -- Normal PIP mode: scale dimensions with screen size -- When in minMode, render.dim is the tiny button — use savedDimensions as the real dimensions @@ -8481,9 +8790,7 @@ function widget:ViewResize() end -- Rescale savedDimensions to match new resolution (they're in old pixel coords) - if uiState.savedDimensions.l and uiState.savedDimensions.r and - uiState.savedDimensions.b and uiState.savedDimensions.t and - oldVsx > 0 and oldVsy > 0 then + if uiState.savedDimensions.l and uiState.savedDimensions.r and uiState.savedDimensions.b and uiState.savedDimensions.t and oldVsx > 0 and oldVsy > 0 then uiState.savedDimensions.l = math.floor(uiState.savedDimensions.l / oldVsx * render.vsx) uiState.savedDimensions.r = math.floor(uiState.savedDimensions.r / oldVsx * render.vsx) uiState.savedDimensions.b = math.floor(uiState.savedDimensions.b / oldVsy * render.vsy) @@ -8501,15 +8808,19 @@ function widget:ViewResize() -- render.dim will be overwritten to the button position below else -- Validate that dimensions are reasonable (not at origin/bottom-left which indicates corruption) - local dimsValid = render.dim.l and render.dim.r and render.dim.b and render.dim.t and - oldVsx > 0 and oldVsy > 0 and - (render.dim.r - render.dim.l) >= minSize and - (render.dim.t - render.dim.b) >= minSize and - render.dim.r > minSize and -- Not stuck at bottom-left - render.dim.t > minSize + local dimsValid = render.dim.l + and render.dim.r + and render.dim.b + and render.dim.t + and oldVsx > 0 + and oldVsy > 0 + and (render.dim.r - render.dim.l) >= minSize + and (render.dim.t - render.dim.b) >= minSize + and render.dim.r > minSize -- Not stuck at bottom-left + and render.dim.t > minSize if dimsValid then - render.dim.l, render.dim.r, render.dim.b, render.dim.t = render.dim.l/oldVsx, render.dim.r/oldVsx, render.dim.b/oldVsy, render.dim.t/oldVsy + render.dim.l, render.dim.r, render.dim.b, render.dim.t = render.dim.l / oldVsx, render.dim.r / oldVsx, render.dim.b / oldVsy, render.dim.t / oldVsy else -- Initialize with default values positioned in upper-right area of screen Spring.Echo("PIP: Detected invalid dimensions, resetting to default position") @@ -8520,7 +8831,7 @@ function widget:ViewResize() -- Also clear saved dimensions since they may be corrupted too uiState.savedDimensions = {} end - render.dim.l, render.dim.r, render.dim.b, render.dim.t = math.floor(render.dim.l*render.vsx), math.floor(render.dim.r*render.vsx), math.floor(render.dim.b*render.vsy), math.floor(render.dim.t*render.vsy) + render.dim.l, render.dim.r, render.dim.b, render.dim.t = math.floor(render.dim.l * render.vsx), math.floor(render.dim.r * render.vsx), math.floor(render.dim.b * render.vsy), math.floor(render.dim.t * render.vsy) -- Clamp oversized dimensions to max constraints (auto-correct errors from previous sessions) local maxSize = math.floor(render.vsy * config.maxPanelSizeVsy) @@ -8585,12 +8896,7 @@ function widget:ViewResize() -- This ensures consistency between auto-minimize on load and manual minimize -- Validate that saved dimensions are reasonable (not corrupted to bottom-left) local minSize = math.floor(config.minPanelSize * render.widgetScale) - local savedDimsValid = uiState.savedDimensions.l and uiState.savedDimensions.r and - uiState.savedDimensions.b and uiState.savedDimensions.t and - (uiState.savedDimensions.r - uiState.savedDimensions.l) >= minSize and - (uiState.savedDimensions.t - uiState.savedDimensions.b) >= minSize and - uiState.savedDimensions.r > minSize and - uiState.savedDimensions.t > minSize + local savedDimsValid = uiState.savedDimensions.l and uiState.savedDimensions.r and uiState.savedDimensions.b and uiState.savedDimensions.t and (uiState.savedDimensions.r - uiState.savedDimensions.l) >= minSize and (uiState.savedDimensions.t - uiState.savedDimensions.b) >= minSize and uiState.savedDimensions.r > minSize and uiState.savedDimensions.t > minSize if savedDimsValid then -- Position based on where the window was (same logic as manual minimize) @@ -8699,9 +9005,7 @@ function widget:ViewResize() if miscState.engineMinimapActive then local w = render.dim.r - render.dim.l local h = render.dim.t - render.dim.b - Spring.SendCommands(string.format("minimap geometry %d %d %d %d", - math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), - math.floor(w), math.floor(h))) + Spring.SendCommands(string.format("minimap geometry %d %d %d %d", math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), math.floor(w), math.floor(h))) end -- Force several frames of re-rendering so engine textures ($minimap, $shading) @@ -8792,7 +9096,9 @@ function widget:GameOver() if state.losViewEnabled then state.losViewEnabled = false state.losViewAllyTeam = nil - for k in pairs(ghostBuildings) do ghostBuildings[k] = nil end + for k in pairs(ghostBuildings) do + ghostBuildings[k] = nil + end pipR2T.losNeedsUpdate = true end @@ -8831,7 +9137,7 @@ function widget:Shutdown() -- for unit icons in the surviving PIP. Defer GPU resource cleanup if another PIP is alive. local anotherPipActive = false for n = 0, 4 do - if n ~= pipNumber and WG['pip' .. n] then + if n ~= pipNumber and WG["pip" .. n] then anotherPipActive = true break end @@ -8933,11 +9239,11 @@ function widget:Shutdown() end -- Remove guishader blur - if WG['guishader'] then - if WG['guishader'].RemoveDlist then - WG['guishader'].RemoveDlist('pip'..pipNumber) - elseif WG['guishader'].RemoveRect then - WG['guishader'].RemoveRect('pip'..pipNumber) + if WG["guishader"] then + if WG["guishader"].RemoveDlist then + WG["guishader"].RemoveDlist("pip" .. pipNumber) + elseif WG["guishader"].RemoveRect then + WG["guishader"].RemoveRect("pip" .. pipNumber) end end -- Clean up guishader dlist @@ -8981,21 +9287,22 @@ function widget:Shutdown() -- Clean up TV focus coordination if WG.pipTVFocus then WG.pipTVFocus[pipNumber] = nil - if not next(WG.pipTVFocus) then WG.pipTVFocus = nil end + if not next(WG.pipTVFocus) then + WG.pipTVFocus = nil + end end -- Clean up API (must happen AFTER the anotherPipActive check above) - WG['pip'..pipNumber] = nil + WG["pip" .. pipNumber] = nil if isMinimapMode then WG.pip_minimap = nil - WG['minimap'] = nil + WG["minimap"] = nil end for i = 1, #buttons do local button = buttons[i] if button.command then widgetHandler.actionHandler:RemoveAction(self, button.actionName) - end end end @@ -9004,7 +9311,9 @@ function widget:GetConfigData() CorrectScreenPosition() -- Guard against uninitialized render dimensions - if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then return {} end + if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then + return {} + end -- When in min mode, save the expanded dimensions from uiState.savedDimensions local saveL, saveR, saveB, saveT @@ -9021,27 +9330,30 @@ function widget:GetConfigData() end return { - pl=saveL, pr=saveR, pb=saveB, pt=saveT, - zoom=cameraState.zoom, - wcx=cameraState.wcx, - wcz=cameraState.wcz, - inMinMode=uiState.inMinMode, - minModeL=uiState.minModeL, - minModeB=uiState.minModeB, - areTracking=interactionState.areTracking, - trackingPlayerID=interactionState.trackingPlayerID, - losViewEnabled=state.losViewEnabled, - losViewAllyTeam=state.losViewAllyTeam, - showUnitpics=config.showUnitpics, - unitpicZoomThreshold=config.unitpicZoomThreshold, - explosionOverlay=config.explosionOverlay, - explosionOverlayAlpha=config.explosionOverlayAlpha, - healthDarkenMax=config.healthDarkenMax, - drawComHealthBars=config.drawComHealthBars, - activityFocusEnabled=miscState.activityFocusEnabled, - activityFocusIgnoreSpectators=config.activityFocusIgnoreSpectators, - tvEnabled=miscState.tvEnabled, - hideAICommands=config.hideAICommands, + pl = saveL, + pr = saveR, + pb = saveB, + pt = saveT, + zoom = cameraState.zoom, + wcx = cameraState.wcx, + wcz = cameraState.wcz, + inMinMode = uiState.inMinMode, + minModeL = uiState.minModeL, + minModeB = uiState.minModeB, + areTracking = interactionState.areTracking, + trackingPlayerID = interactionState.trackingPlayerID, + losViewEnabled = state.losViewEnabled, + losViewAllyTeam = state.losViewAllyTeam, + showUnitpics = config.showUnitpics, + unitpicZoomThreshold = config.unitpicZoomThreshold, + explosionOverlay = config.explosionOverlay, + explosionOverlayAlpha = config.explosionOverlayAlpha, + healthDarkenMax = config.healthDarkenMax, + drawComHealthBars = config.drawComHealthBars, + activityFocusEnabled = miscState.activityFocusEnabled, + activityFocusIgnoreSpectators = config.activityFocusIgnoreSpectators, + tvEnabled = miscState.tvEnabled, + hideAICommands = config.hideAICommands, gameID = Game.gameID or Spring.GetGameRulesParam("GameID"), -- minimapModeMaxHeight now stored as ConfigFloat "MinimapMaxHeight" -- leftButtonPansCamera now stored as Spring ConfigInt "MinimapLeftClickMove" @@ -9059,7 +9371,9 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - if not data or not data.gameID then return end -- prevent loading empty/corrupted data + if not data or not data.gameID then + return + end -- prevent loading empty/corrupted data miscState.hadSavedConfig = (data and next(data) ~= nil) -- Mark that we have saved config data miscState.savedGameID = data and data.gameID -- Store saved gameID for new game detection in Initialize @@ -9075,14 +9389,11 @@ function widget:SetConfigData(data) -- First restore the expanded dimensions if available and valid if data.pl and data.pr and data.pb and data.pt then -- Validate that the position values are reasonable (between 0 and 1 as normalized coords) - if isValidNumber(data.pl, 0, 1) and isValidNumber(data.pr, 0, 1) and - isValidNumber(data.pb, 0, 1) and isValidNumber(data.pt, 0, 1) and - data.pl < data.pr and data.pb < data.pt then -- Ensure left < right and bottom < top - - local tempL = math.floor(data.pl*render.vsx) - local tempR = math.floor(data.pr*render.vsx) - local tempB = math.floor(data.pb*render.vsy) - local tempT = math.floor(data.pt*render.vsy) + if isValidNumber(data.pl, 0, 1) and isValidNumber(data.pr, 0, 1) and isValidNumber(data.pb, 0, 1) and isValidNumber(data.pt, 0, 1) and data.pl < data.pr and data.pb < data.pt then -- Ensure left < right and bottom < top + local tempL = math.floor(data.pl * render.vsx) + local tempR = math.floor(data.pr * render.vsx) + local tempB = math.floor(data.pb * render.vsy) + local tempT = math.floor(data.pt * render.vsy) -- Additional sanity check: ensure dimensions are within screen bounds local minSize = math.floor(config.minPanelSize * render.widgetScale) @@ -9100,15 +9411,12 @@ function widget:SetConfigData(data) windowHeight = maxSize end - if windowWidth >= minSize and windowHeight >= minSize and - tempL >= 0 and tempR <= render.vsx and - tempB >= 0 and tempT <= render.vsy then - + if windowWidth >= minSize and windowHeight >= minSize and tempL >= 0 and tempR <= render.vsx and tempB >= 0 and tempT <= render.vsy then uiState.savedDimensions = { l = tempL, r = tempR, b = tempB, - t = tempT + t = tempT, } -- Set dim to expanded size initially render.dim.l = uiState.savedDimensions.l @@ -9172,7 +9480,7 @@ function widget:SetConfigData(data) if data.minimapModeZoom and isValidNumber(data.minimapModeZoom, 0, GetEffectiveZoomMax()) then cameraState.zoom = data.minimapModeZoom cameraState.targetZoom = cameraState.zoom - miscState.minimapCameraRestored = true -- Flag that we restored camera state + miscState.minimapCameraRestored = true -- Flag that we restored camera state miscState.minimapRestoreAtMinZoom = data.minimapModeAtMinZoom or false end end @@ -9185,7 +9493,7 @@ function widget:SetConfigData(data) if data.wcz and isValidNumber(data.wcz, 0, maxZ) then cameraState.wcz = data.wcz end - cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Initialize targets from config + cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Initialize targets from config -- Validate zoom level (must be between 0 and zoomMax) if data.zoom and isValidNumber(data.zoom, 0, GetEffectiveZoomMax()) then @@ -9193,16 +9501,36 @@ function widget:SetConfigData(data) end end - if data.showUnitpics ~= nil then config.showUnitpics = data.showUnitpics end - if data.explosionOverlay ~= nil then config.explosionOverlay = data.explosionOverlay end - if data.explosionOverlayAlpha then config.explosionOverlayAlpha = data.explosionOverlayAlpha end - if data.hideAICommands ~= nil then config.hideAICommands = data.hideAICommands end - if data.healthDarkenMax ~= nil then config.healthDarkenMax = data.healthDarkenMax end - if data.drawComHealthBars ~= nil then config.drawComHealthBars = data.drawComHealthBars end - if data.activityFocusEnabled ~= nil then miscState.activityFocusEnabled = data.activityFocusEnabled end - if data.activityFocusIgnoreSpectators ~= nil then config.activityFocusIgnoreSpectators = data.activityFocusIgnoreSpectators end - if data.engineMinimapFallback ~= nil then config.engineMinimapFallback = data.engineMinimapFallback end - if data.engineMinimapExplosionOverlay ~= nil then config.engineMinimapExplosionOverlay = data.engineMinimapExplosionOverlay end + if data.showUnitpics ~= nil then + config.showUnitpics = data.showUnitpics + end + if data.explosionOverlay ~= nil then + config.explosionOverlay = data.explosionOverlay + end + if data.explosionOverlayAlpha then + config.explosionOverlayAlpha = data.explosionOverlayAlpha + end + if data.hideAICommands ~= nil then + config.hideAICommands = data.hideAICommands + end + if data.healthDarkenMax ~= nil then + config.healthDarkenMax = data.healthDarkenMax + end + if data.drawComHealthBars ~= nil then + config.drawComHealthBars = data.drawComHealthBars + end + if data.activityFocusEnabled ~= nil then + miscState.activityFocusEnabled = data.activityFocusEnabled + end + if data.activityFocusIgnoreSpectators ~= nil then + config.activityFocusIgnoreSpectators = data.activityFocusIgnoreSpectators + end + if data.engineMinimapFallback ~= nil then + config.engineMinimapFallback = data.engineMinimapFallback + end + if data.engineMinimapExplosionOverlay ~= nil then + config.engineMinimapExplosionOverlay = data.engineMinimapExplosionOverlay + end --if data.engineMinimapFallbackThreshold ~= nil then config.engineMinimapFallbackThreshold = data.engineMinimapFallbackThreshold end if data.tvEnabled ~= nil then -- Only restore TV mode if we're a spectator (or tvModeSpectatorsOnly is off) @@ -9364,10 +9692,14 @@ end -- Pre-created blit function for decal overlay (avoids per-frame closure allocation). -- References render.ground tables via upvalue; values update in-place so function stays valid. local function decalBlitQuad() - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b); glFunc.Vertex(render.ground.view.l, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b); glFunc.Vertex(render.ground.view.r, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t); glFunc.Vertex(render.ground.view.r, render.ground.view.t) - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t); glFunc.Vertex(render.ground.view.l, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b) + glFunc.Vertex(render.ground.view.l, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b) + glFunc.Vertex(render.ground.view.r, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t) + glFunc.Vertex(render.ground.view.r, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t) + glFunc.Vertex(render.ground.view.l, render.ground.view.t) end -- Draw ground decals (explosion scars) from the cached decal R2T texture. @@ -9376,9 +9708,15 @@ end -- Optional strength parameter (0-1): mixes decal texture towards white before multiply, -- reducing darkening intensity. Used for subtler decals on engine minimap. local function DrawDecalsOverlay(strength) - if not config.drawDecals then return end - if not pipR2T.decalTex then return end - if decalGL4.instanceCount == 0 then return end -- no decals to draw + if not config.drawDecals then + return + end + if not pipR2T.decalTex then + return + end + if decalGL4.instanceCount == 0 then + return + end -- no decals to draw -- Blit decal texture with multiply blending: result = ground_color * decal_tex_color -- Alpha: preserve destination alpha (prevents 3D world showing through PIP) @@ -9411,12 +9749,16 @@ end -- Helper function to draw command queues overlay -- Draw command FX: fading lines from unit to command target local function DrawCommandFXOverlay() - if not config.drawCommandFX then return end - if commandFX.count == 0 then return end + if not config.drawCommandFX then + return + end + if commandFX.count == 0 then + return + end local useGL4 = gl4Prim.enabled local resScale = render.contentScale or 1 - local now = wallClockTime -- Use wall-clock time so FX fades even when paused + local now = wallClockTime -- Use wall-clock time so FX fades even when paused local baseDuration = config.commandFXDuration local fxDuration = baseDuration @@ -9432,7 +9774,7 @@ local function DrawCommandFXOverlay() if interactionState.trackingPlayerID then useCommandColors = true elseif not cameraState.mySpecState then - useCommandColors = true -- player viewing own ally commands + useCommandColors = true -- player viewing own ally commands end local myTeamID = not useCommandColors and Spring.GetMyTeamID() or nil @@ -9462,8 +9804,7 @@ local function DrawCommandFXOverlay() end end - GL4AddNormLine(fx.unitX, fx.unitZ, fx.targetX, fx.targetZ, - r, g, b, alpha, r, g, b, alpha) + GL4AddNormLine(fx.unitX, fx.unitZ, fx.targetX, fx.targetZ, r, g, b, alpha, r, g, b, alpha) end end @@ -9546,7 +9887,7 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) local resScale = render.contentScale or 1 local useGL4Commands = gl4Prim.enabled - local maxUnits = Game.maxUnits or 32000 -- Features encoded as featureID + maxUnits + local maxUnits = Game.maxUnits or 32000 -- Features encoded as featureID + maxUnits -- ======================================================================== -- Waypoint cache: only call GetUnitCommands every CMD_CACHE_INTERVAL frames @@ -9568,9 +9909,15 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) -- Quick hash to detect unit list changes: unitCount + first/last unitIDs local unitHash = unitCount - if unitCount > 0 then unitHash = unitHash + unitsToShow[1] end - if unitCount > 1 then unitHash = unitHash + unitsToShow[unitCount] end - if unitCount > 2 then unitHash = unitHash + unitsToShow[math.floor(unitCount / 2)] end + if unitCount > 0 then + unitHash = unitHash + unitsToShow[1] + end + if unitCount > 1 then + unitHash = unitHash + unitsToShow[unitCount] + end + if unitCount > 2 then + unitHash = unitHash + unitsToShow[math.floor(unitCount / 2)] + end -- Rolling refresh: refresh a small rotating batch each frame to avoid -- GC spikes from GetUnitCommands. With 50 units and batch=3, the full @@ -9615,7 +9962,9 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) elseif paramCount == 5 then if params[1] > 0 and params[1] < 1000000 then local tx, _, tz = spFunc.GetUnitPosition(params[1]) - if tx then cmdX, cmdZ = tx, tz end + if tx then + cmdX, cmdZ = tx, tz + end else cmdX, cmdZ = params[2], params[4] end @@ -9627,14 +9976,16 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) else tx, _, tz = spFunc.GetUnitPosition(targetID) end - if tx then cmdX, cmdZ = tx, tz end + if tx then + cmdX, cmdZ = tx, tz + end end end if cmdX and cmdZ then wpCount = wpCount + 1 local wp = cached[wpCount] if not wp then - wp = { 0, 0, 0 } -- {worldX, worldZ, cmdID} + wp = { 0, 0, 0 } -- {worldX, worldZ, cmdID} cached[wpCount] = wp end wp[1], wp[2], wp[3] = cmdX, cmdZ, cmd.id @@ -9645,7 +9996,9 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) else -- Gaia unit — clear any stale cache local cached = wpCache[uID] - if cached then cached.n = 0 end + if cached then + cached.n = 0 + end end end end @@ -9660,18 +10013,20 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) -- Increment generation to invalidate previous frame's dedup entries (no clearing needed) cmdSegDedupGen = cmdSegDedupGen + 1 local segDedup = cmdSegDedup - local segGen = cmdSegDedupGen - local mFloor = math.floor + local segGen = cmdSegDedupGen + local mFloor = math.floor -- Periodically prune stale dedup entries (~every 5 seconds) if segGen % 50 == 0 then for k, gen in pairs(segDedup) do - if gen < segGen - 2 then segDedup[k] = nil end + if gen < segGen - 2 then + segDedup[k] = nil + end end end local wpCache = cmdQueueCache.waypoints - local chainBudget = CMD_MAX_CHAIN_UNITS -- only N units get full chain drawing + local chainBudget = CMD_MAX_CHAIN_UNITS -- only N units get full chain drawing for i = 1, unitCount do local uID = unitsToShow[i] @@ -9683,9 +10038,7 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) -- Always draw unit → first waypoint (unique per unit position) local firstColor = cmdColors[firstWP[3]] or cmdColors.unknown - GL4AddNormLine(ux, uz, firstWP[1], firstWP[2], - firstColor[1], firstColor[2], firstColor[3], 0.8, - firstColor[1], firstColor[2], firstColor[3], 0.8) + GL4AddNormLine(ux, uz, firstWP[1], firstWP[2], firstColor[1], firstColor[2], firstColor[3], 0.8, firstColor[1], firstColor[2], firstColor[3], 0.8) -- Full chain: only for first N units (rest is visual overlap). -- Per-segment dedup ensures shared segments draw only once. @@ -9709,8 +10062,7 @@ local function DrawCommandQueuesOverlay(cachedSelectedUnits) local cmdID = wp[3] local color = cmdColors[cmdID] or cmdColors.unknown local r, g, b = color[1], color[2], color[3] - GL4AddNormLine(prevWX, prevWZ, cmdX, cmdZ, - r, g, b, 0.8, r, g, b, 0.8) + GL4AddNormLine(prevWX, prevWZ, cmdX, cmdZ, r, g, b, 0.8, r, g, b, 0.8) end prevWX, prevWZ = cmdX, cmdZ end @@ -9798,7 +10150,9 @@ local function DrawBuildPreview(mx, my, iconRadiusZoomDistMult) -- Draw preview icons for all spots in area local mexBuildings = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetMexBuildings() if mexBuildings then - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local selectedUnits = frameSel local mexConstructors = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetMexConstructors() local selectedMex = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetBestExtractorFromBuilders(selectedUnits, mexConstructors, mexBuildings) @@ -9811,7 +10165,7 @@ local function DrawBuildPreview(mx, my, iconRadiusZoomDistMult) for i = 1, #metalSpots do local spot = metalSpots[i] - local dist = math.sqrt((spot.x - wx)^2 + (spot.z - wz)^2) + local dist = math.sqrt((spot.x - wx) ^ 2 + (spot.z - wz) ^ 2) if dist < radius then local cx, cy = WorldToPipCoords(spot.x, spot.z) glFunc.Color(1, 1, 1, 0.3) @@ -9876,11 +10230,11 @@ local function DrawBuildPreview(mx, my, iconRadiusZoomDistMult) local buildFacing = Spring.GetBuildFacing() local canBuild = Spring.TestBuildOrder(buildDefID, wx, wy, wz, buildFacing) - if canBuild == 2 then - glFunc.Color(1, 1, 1, 0.5) - elseif canBuild == 1 then - local blockedByMobile = false - local nearbyUnits = Spring.GetUnitsInCylinder(wx, wz, 64) + if canBuild == 2 then + glFunc.Color(1, 1, 1, 0.5) + elseif canBuild == 1 then + local blockedByMobile = false + local nearbyUnits = Spring.GetUnitsInCylinder(wx, wz, 64) if nearbyUnits then for _, unitID in ipairs(nearbyUnits) do local unitDefID = spFunc.GetUnitDefID(unitID) @@ -9994,15 +10348,15 @@ end -- Position dedup: when 50 constructors share the same 100-building queue, only 100 entries are -- drawn (not 5000). GetUnitCommands called for only a rolling batch each frame. local queuedBuildCache = { - builds = {}, -- array of {bitmapIdx, cx, cy, iconSize} — deduplicated + builds = {}, -- array of {bitmapIdx, cx, cy, iconSize} — deduplicated buildCount = 0, - positionSeen = {}, -- [quantizedKey] = generation — for within-refresh dedup + positionSeen = {}, -- [quantizedKey] = generation — for within-refresh dedup generation = 0, - lastHash = 0, -- combined hash of unit list + counter for staleness - bitmaps = {}, -- [idx] = bitmap string — compact bitmap lookup - bitmapIdx = {}, -- [bitmap] = idx — reverse lookup + lastHash = 0, -- combined hash of unit list + counter for staleness + bitmaps = {}, -- [idx] = bitmap string — compact bitmap lookup + bitmapIdx = {}, -- [bitmap] = idx — reverse lookup bitmapCount = 0, - refreshCounter = 0, -- rolling counter for batch refresh + refreshCounter = 0, -- rolling counter for batch refresh } local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) @@ -10040,9 +10394,15 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) -- Hash to detect selection changes local selHash = selectedCount - if selectedCount > 0 then selHash = selHash + selectedUnits[1] end - if selectedCount > 1 then selHash = selHash + selectedUnits[selectedCount] end - if selectedCount > 2 then selHash = selHash + selectedUnits[math.floor(selectedCount / 2)] end + if selectedCount > 0 then + selHash = selHash + selectedUnits[1] + end + if selectedCount > 1 then + selHash = selHash + selectedUnits[selectedCount] + end + if selectedCount > 2 then + selHash = selHash + selectedUnits[math.floor(selectedCount / 2)] + end local selChanged = (selHash ~= qbc.lastHash) qbc.lastHash = selHash @@ -10062,7 +10422,9 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) qbc.generation = qbc.generation + 1 qbc.buildCount = 0 qbc.bitmapCount = 0 - for k in pairs(qbc.bitmapIdx) do qbc.bitmapIdx[k] = nil end + for k in pairs(qbc.bitmapIdx) do + qbc.bitmapIdx[k] = nil + end end local gen = qbc.generation @@ -10076,7 +10438,7 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) for i = bStart, bEnd do local unitID = selectedUnits[i] - local queue = spFunc.GetUnitCommands(unitID, 50) -- cap at 50 (enough for build grid visibility) + local queue = spFunc.GetUnitCommands(unitID, 50) -- cap at 50 (enough for build grid visibility) if queue then for j = 1, #queue do local cmd = queue[j] @@ -10106,10 +10468,10 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) entry = {} builds[bCount] = entry end - entry[1] = bIdx -- bitmap index - entry[2] = bwx -- world X (convert to screen at draw time) - entry[3] = bwz -- world Z - entry[4] = buildIcon.size -- icon base size + entry[1] = bIdx -- bitmap index + entry[2] = bwx -- world X (convert to screen at draw time) + entry[3] = bwz -- world Z + entry[4] = buildIcon.size -- icon base size end end end @@ -10121,7 +10483,9 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) qbc.buildCount = bCount qbc.bitmapCount = bitmapCount - if bCount == 0 then return end + if bCount == 0 then + return + end -- Counter-rotate by minimap rotation so build queue icons stay upright, -- matching the GL4 shader icons which handle rotation in the vertex shader @@ -10129,8 +10493,12 @@ local function DrawQueuedBuilds(iconRadiusZoomDistMult, cachedSelectedUnits) -- Group by bitmap and draw -- Clear texture grouping - for k in pairs(pools.buildsByTexture) do pools.buildsByTexture[k] = nil end - for k in pairs(pools.buildCountByTexture) do pools.buildCountByTexture[k] = nil end + for k in pairs(pools.buildsByTexture) do + pools.buildsByTexture[k] = nil + end + for k in pairs(pools.buildCountByTexture) do + pools.buildCountByTexture[k] = nil + end for i = 1, bCount do local entry = builds[i] @@ -10220,7 +10588,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Write ghost+building data into building-specific array, mobile into main array. -- Building VBO is uploaded independently (only when building state changes). local bldgData = gl4Icons.bldgInstanceData - local data = bldgData -- Start writing to building array (ghosts + buildings first) + local data = bldgData -- Start writing to building array (ghosts + buildings first) local unitCount = #miscState.pipUnits local unitDefCacheTbl = gl4Icons.unitDefCache local unitTeamCacheTbl = gl4Icons.unitTeamCache @@ -10235,7 +10603,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) atlasUVs = gl4Icons.atlasUVs bldgData = gl4Icons.bldgInstanceData data = bldgData - if not defaultUV then return 1 end -- Still not available, skip icon drawing + if not defaultUV then + return 1 + end -- Still not available, skip icon drawing end local cacheUnitIcon = cache.unitIcon local cacheIsBuilding = cache.isBuilding @@ -10261,13 +10631,13 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) for uDefID, uvs in pairs(atlasUVs) do local icon = cacheUnitIcon[uDefID] local sz = icon and icon.size or 0.5 - uvSizeLookup[uDefID] = {uvs[1], uvs[2], uvs[3], uvs[4], sz} + uvSizeLookup[uDefID] = { uvs[1], uvs[2], uvs[3], uvs[4], sz } end gl4Icons._uvSizeLookup = uvSizeLookup end local defaultUVSize = gl4Icons._defaultUVSize if not defaultUVSize then - defaultUVSize = {defaultUV[1], defaultUV[2], defaultUV[3], defaultUV[4], 0.5} + defaultUVSize = { defaultUV[1], defaultUV[2], defaultUV[3], defaultUV[4], 0.5 } gl4Icons._defaultUVSize = defaultUVSize end @@ -10276,13 +10646,17 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local teamColorG = gl4Icons._teamColorG local teamColorB = gl4Icons._teamColorB if not teamColorR then - teamColorR = {}; teamColorG = {}; teamColorB = {} + teamColorR = {} + teamColorG = {} + teamColorB = {} gl4Icons._teamColorR = teamColorR gl4Icons._teamColorG = teamColorG gl4Icons._teamColorB = teamColorB end for tID, c in pairs(localTeamColors) do - teamColorR[tID] = c[1]; teamColorG[tID] = c[2]; teamColorB[tID] = c[3] + teamColorR[tID] = c[1] + teamColorG[tID] = c[2] + teamColorB[tID] = c[3] end -- At high unit counts, skip cosmetic-only features (stun tint, damage flash) @@ -10314,17 +10688,13 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local slowMobileBlockRebuild = true if useMobileBlockCache then gl4Icons._mobileBlockAge = (gl4Icons._mobileBlockAge or 0) + 1 - if gl4Icons._mobileBlock - and gl4Icons._mobileBlockAge < 2 - and checkAllyTeamID == gl4Icons._mobileBlockCheckAlly then + if gl4Icons._mobileBlock and gl4Icons._mobileBlockAge < 2 and checkAllyTeamID == gl4Icons._mobileBlockCheckAlly then mobileBlockRebuild = false else gl4Icons._mobileBlockAge = 0 end gl4Icons._slowMobileBlockAge = (gl4Icons._slowMobileBlockAge or 0) + 1 - if gl4Icons._slowMobileBlock - and gl4Icons._slowMobileBlockAge < 4 - and checkAllyTeamID == gl4Icons._slowMobileBlockCheckAlly then + if gl4Icons._slowMobileBlock and gl4Icons._slowMobileBlockAge < 4 and checkAllyTeamID == gl4Icons._slowMobileBlockCheckAlly then slowMobileBlockRebuild = false else gl4Icons._slowMobileBlockAge = 0 @@ -10360,7 +10730,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Returns updated usedElements. Defined once to avoid closure per-layer. -- (inlined via local function for LuaJIT trace compilation) local function processUnit(uID, usedEl) - if usedEl >= maxInst then return usedEl end + if usedEl >= maxInst then + return usedEl + end -- unitDefID and unitTeam are guaranteed cached by the keysort pass local uDefID = unitDefCacheTbl[uID] @@ -10372,7 +10744,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) if not ux then -- Fallback: unit wasn't in sort pass (shouldn't happen, but be safe) local x, _, z = spFunc.GetUnitBasePosition(uID) - if not x then return usedEl end + if not x then + return usedEl + end ux, uz = x, z end @@ -10394,7 +10768,10 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) if cacheIsBuilding[uDefID] or cache.isPseudoBuilding[uDefID] then local g = ghostBuildings[uID] if g then - g.defID = uDefID; g.x = ux; g.z = uz; g.teamID = uTeam + g.defID = uDefID + g.x = ux + g.z = uz + g.teamID = uTeam else ghostBuildings[uID] = { defID = uDefID, x = ux, z = uz, teamID = uTeam } end @@ -10414,7 +10791,10 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) if (cacheIsBuilding[uDefID] or cache.isPseudoBuilding[uDefID]) and losBits % (LOS_PREVLOS * 2) >= LOS_PREVLOS then local g = ghostBuildings[uID] if g then - g.defID = uDefID; g.x = ux; g.z = uz; g.teamID = uTeam + g.defID = uDefID + g.x = ux + g.z = uz + g.teamID = uTeam else ghostBuildings[uID] = { defID = uDefID, x = ux, z = uz, teamID = uTeam } end @@ -10424,7 +10804,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) end end - if not visibleDefID and not isRadar then return usedEl end + if not visibleDefID and not isRadar then + return usedEl + end -- Look up atlas UV and size scale (combined single-table lookup) local uvs = uvSizeLookup[visibleDefID] or defaultUVSize @@ -10452,17 +10834,19 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) g = g + (1 - g) * f b = b + (1 - b) * f else - damageFlash[uID] = nil -- expired, clean up + damageFlash[uID] = nil -- expired, clean up end end -- Stun detection (EMP/paralyze, not build-in-progress) -- Skipped at high unit counts (cosmetic gray tint, saves API call per unit) local isStunned = false - local healthPct = 100 -- default full health + local healthPct = 100 -- default full health if not skipCosmetics and not isRadar then local stun, _, buildStun = spFunc.GetUnitIsStunned(uID) - if stun and not buildStun then isStunned = true end + if stun and not buildStun then + isStunned = true + end end -- Self-destruct: use event-driven cache (no per-unit API call) @@ -10481,15 +10865,15 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) up = {} unitpicEntries[unitpicCount] = up end - up[1] = wtp.offsetX + ux * wtp.scaleX -- pipX - up[2] = wtp.offsetZ + uz * wtp.scaleZ -- pipY + up[1] = wtp.offsetX + ux * wtp.scaleX -- pipX + up[2] = wtp.offsetZ + uz * wtp.scaleZ -- pipY up[3] = visibleDefID up[4] = uTeam up[5] = (selectedSet and selectedSet[uID]) and true or false - up[6] = bp or 1 -- buildProgress + up[6] = bp or 1 -- buildProgress up[7] = uID - up[8] = healthPct / 100 -- health fraction for health bar - return usedEl -- Skip GL4 icon — unitpic will be drawn on top instead + up[8] = healthPct / 100 -- health fraction for health bar + return usedEl -- Skip GL4 icon — unitpic will be drawn on top instead elseif not skipCosmetics and not isRadar then -- Non-unitpic zoom: still fetch health for icon damage tint local hp, maxHP = spFunc.GetUnitHealth(uID) @@ -10502,9 +10886,18 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local off = usedEl * instStep -- Takeable blink only for teams on the viewer's own allyteam (can't take enemy units) local isTakeable = takeableTeams[uTeam] and checkAllyTeamID and localTeamAllyTeamCache[uTeam] == checkAllyTeamID - data[off+1] = ux; data[off+2] = uz; data[off+3] = uvs[5]; data[off+4] = healthPct * 32 + (isRadar and 1 or 0) + (isTakeable and 2 or 0) + (isStunned and 4 or 0) + (trackedSet and trackedSet[uID] and 8 or 0) + (isSelfD and 16 or 0) - data[off+5] = uvs[1]; data[off+6] = uvs[2]; data[off+7] = uvs[3]; data[off+8] = uvs[4] - data[off+9] = r; data[off+10] = g; data[off+11] = b; data[off+12] = (uID * 0.37) % 6.2832 + mathFloor(flashFactor * 100) * 7.0 + data[off + 1] = ux + data[off + 2] = uz + data[off + 3] = uvs[5] + data[off + 4] = healthPct * 32 + (isRadar and 1 or 0) + (isTakeable and 2 or 0) + (isStunned and 4 or 0) + (trackedSet and trackedSet[uID] and 8 or 0) + (isSelfD and 16 or 0) + data[off + 5] = uvs[1] + data[off + 6] = uvs[2] + data[off + 7] = uvs[3] + data[off + 8] = uvs[4] + data[off + 9] = r + data[off + 10] = g + data[off + 11] = b + data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(flashFactor * 100) * 7.0 return usedEl + 1 end @@ -10519,7 +10912,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- 2) Fullview OFF: use pipUnits membership (from GetUnitsInRectangle). Engine LOS APIs -- are unreliable for spectators who toggled fullview OFF, but GetUnitsInRectangle -- correctly filters to visible units only. - local ghostHash = 0 -- Track ghost changes for building VBO dirty detection + local ghostHash = 0 -- Track ghost changes for building VBO dirty detection if checkAllyTeamID and not skipGhosts then -- Determine which visibility check to use local isLosViewMode = state.losViewEnabled and state.losViewAllyTeam @@ -10543,13 +10936,15 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local viewB = render.world.b + 220 for gID, ghost in pairs(ghostBuildings) do - if usedElements >= maxInst then break end + if usedElements >= maxInst then + break + end -- Determine if this ghost is currently visible to the viewer local isVisible if isLosViewMode then -- LOS view: check if the building is in LOS or radar for the viewed allyteam local lb = spFunc.GetUnitLosState(gID, checkAllyTeamID, true) - isVisible = lb and (lb % 2 >= 1 or lb % 4 >= 2) -- INLOS or INRADAR + isVisible = lb and (lb % 2 >= 1 or lb % 4 >= 2) -- INLOS or INRADAR else -- Fullview OFF: check if the building is in pipUnits (engine-enforced visibility) isVisible = liveSet[gID] @@ -10572,9 +10967,18 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local off = usedElements * gl4Icons.INSTANCE_STEP -- Ghost buildings are always from a different allyteam (enemy) — never takeable -- Health=100 (full) so shader doesn't apply damage darkening on top of ghost dim - data[off+1] = ghost.x; data[off+2] = ghost.z; data[off+3] = sizeScale; data[off+4] = 100 * 32 - data[off+5] = uvs[1]; data[off+6] = uvs[2]; data[off+7] = uvs[3]; data[off+8] = uvs[4] - data[off+9] = r; data[off+10] = g; data[off+11] = b; data[off+12] = (gID * 0.37) % 6.2832 + data[off + 1] = ghost.x + data[off + 2] = ghost.z + data[off + 3] = sizeScale + data[off + 4] = 100 * 32 + data[off + 5] = uvs[1] + data[off + 6] = uvs[2] + data[off + 7] = uvs[3] + data[off + 8] = uvs[4] + data[off + 9] = r + data[off + 10] = g + data[off + 11] = b + data[off + 12] = (gID * 0.37) % 6.2832 usedElements = usedElements + 1 ghostHash = ghostHash + gID end @@ -10586,7 +10990,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- (dead units are absent from GetAllUnits, so stale ghosts are cleared on next rescan). end end - local ghostElementCount = usedElements -- Ghost elements in building VBO + local ghostElementCount = usedElements -- Ghost elements in building VBO local icT1 = os.clock() @@ -10615,9 +11019,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- they almost certainly won't this frame either. Worst case: one extra rebuild. -- At low zoom, extend forced rebuild interval (LOS changes less visible at full-map view) local bldgBlockGameFrameLimit = cameraState.zoom < 0.15 and 90 or 30 - local bldgBlockWillRebuild = useUnitpics - or not gl4Icons._bldgBlock - or (Spring.GetGameFrame() - (gl4Icons._bldgBlockFrame or 0)) >= bldgBlockGameFrameLimit + local bldgBlockWillRebuild = useUnitpics or not gl4Icons._bldgBlock or (Spring.GetGameFrame() - (gl4Icons._bldgBlockFrame or 0)) >= bldgBlockGameFrameLimit local currentGameFrameKeysort = Spring.GetGameFrame() for i = 1, unitCount do local uID = pipUnits[i] @@ -10635,97 +11037,102 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) crashingUnits[uID] = nil end else - -- Fast path for known immobile buildings: skip all classification lookups - local cachedBldgX = localBuildPosX[uID] - if cachedBldgX then - -- On block-cache frames, skip position cache writes (processUnit won't run for buildings) - if not bldgBlockWillRebuild then + -- Fast path for known immobile buildings: skip all classification lookups + local cachedBldgX = localBuildPosX[uID] + if cachedBldgX then + -- On block-cache frames, skip position cache writes (processUnit won't run for buildings) + if not bldgBlockWillRebuild then -- no-op: position not needed this frame + else + localCachePosX[uID] = cachedBldgX + localCachePosZ[uID] = localBuildPosZ[uID] + end + -- Sort key is stable (position never changes), already in gl4IconSortKeys + bCount = bCount + 1 + buildingIDs[bCount] = uID + bldgHash = bldgHash + uID else - localCachePosX[uID] = cachedBldgX - localCachePosZ[uID] = localBuildPosZ[uID] - end - -- Sort key is stable (position never changes), already in gl4IconSortKeys - bCount = bCount + 1 - buildingIDs[bCount] = uID - bldgHash = bldgHash + uID - else - -- At high counts, known mobile units reuse cached position on non-refresh frames. - -- Fast mobile (aircraft, commanders) refreshes every 3rd frame (round-robin by unitID). - -- Slow mobile (ground units) refreshes every 6th frame (they barely move). - -- New units (no cached position) always get a fresh position. - -- defID/team are already persistent in cache from the unit's first full pass. - local fastPathHandled = false - if skipMobilePosRefresh and localCachePosX[uID] then - local isFast = isFastMobileTbl[uID] - if isFast == true and uID % 3 ~= posRefreshSlot then - mCount = mCount + 1 - mobileIDs[mCount] = uID - fastPathHandled = true - elseif isFast == false and uID % 6 ~= slowPosRefreshSlot then - smCount = smCount + 1 - slowMobileIDs[smCount] = uID - fastPathHandled = true - end - end - if not fastPathHandled then - local uDefID = unitDefCacheTbl[uID] - if not uDefID then - uDefID = spFunc.GetUnitDefID(uID) - unitDefCacheTbl[uID] = uDefID - end - -- Pre-cache team so processUnit never calls GetUnitTeam - local uTeam = unitTeamCacheTbl[uID] - if not uTeam then - uTeam = spFunc.GetUnitTeam(uID) - unitTeamCacheTbl[uID] = uTeam - end - if not (uTeam == localGaiaTeamID and cache.isCritter[uDefID]) then - local layer = unitDefLayerTbl[uDefID] or defaultLayer - local x, _, z = spFunc.GetUnitBasePosition(uID) - local xPos = x or 0 - local zPos = z or 0 - localCachePosX[uID] = xPos - localCachePosZ[uID] = zPos - local sortKey = layer * 100000 + mathFloor(zPos) - gl4Icons.sortKeys[uID] = sortKey - -- Separate immobile buildings from mobile units for split sorting - -- Pseudo-buildings (speed==0, like nano turrets) go to building VBO unless currently transported - local isImmobile = (cacheIsBuilding[uDefID] and localCantBeTransported[uDefID]) - or (cache.isPseudoBuilding[uDefID] and not miscState.transportedUnits[uID]) - if isImmobile then - -- Cache building positions (they never move) - localBuildPosX[uID] = xPos - localBuildPosZ[uID] = zPos - bCount = bCount + 1 - buildingIDs[bCount] = uID - bldgHash = bldgHash + uID -- order-independent hash for set change detection - else - -- Classify mobile speed tier: aircraft and commanders are fast, ground is slow - local isFast = cache.canFly[uDefID] or cache.isCommander[uDefID] or false - isFastMobileTbl[uID] = isFast - if isFast then - mCount = mCount + 1 - mobileIDs[mCount] = uID - else - smCount = smCount + 1 - slowMobileIDs[smCount] = uID - end - end -- isImmobile - end -- not critter - end -- not fastPathHandled - end -- not cachedBldgX + -- At high counts, known mobile units reuse cached position on non-refresh frames. + -- Fast mobile (aircraft, commanders) refreshes every 3rd frame (round-robin by unitID). + -- Slow mobile (ground units) refreshes every 6th frame (they barely move). + -- New units (no cached position) always get a fresh position. + -- defID/team are already persistent in cache from the unit's first full pass. + local fastPathHandled = false + if skipMobilePosRefresh and localCachePosX[uID] then + local isFast = isFastMobileTbl[uID] + if isFast == true and uID % 3 ~= posRefreshSlot then + mCount = mCount + 1 + mobileIDs[mCount] = uID + fastPathHandled = true + elseif isFast == false and uID % 6 ~= slowPosRefreshSlot then + smCount = smCount + 1 + slowMobileIDs[smCount] = uID + fastPathHandled = true + end + end + if not fastPathHandled then + local uDefID = unitDefCacheTbl[uID] + if not uDefID then + uDefID = spFunc.GetUnitDefID(uID) + unitDefCacheTbl[uID] = uDefID + end + -- Pre-cache team so processUnit never calls GetUnitTeam + local uTeam = unitTeamCacheTbl[uID] + if not uTeam then + uTeam = spFunc.GetUnitTeam(uID) + unitTeamCacheTbl[uID] = uTeam + end + if not (uTeam == localGaiaTeamID and cache.isCritter[uDefID]) then + local layer = unitDefLayerTbl[uDefID] or defaultLayer + local x, _, z = spFunc.GetUnitBasePosition(uID) + local xPos = x or 0 + local zPos = z or 0 + localCachePosX[uID] = xPos + localCachePosZ[uID] = zPos + local sortKey = layer * 100000 + mathFloor(zPos) + gl4Icons.sortKeys[uID] = sortKey + -- Separate immobile buildings from mobile units for split sorting + -- Pseudo-buildings (speed==0, like nano turrets) go to building VBO unless currently transported + local isImmobile = (cacheIsBuilding[uDefID] and localCantBeTransported[uDefID]) or (cache.isPseudoBuilding[uDefID] and not miscState.transportedUnits[uID]) + if isImmobile then + -- Cache building positions (they never move) + localBuildPosX[uID] = xPos + localBuildPosZ[uID] = zPos + bCount = bCount + 1 + buildingIDs[bCount] = uID + bldgHash = bldgHash + uID -- order-independent hash for set change detection + else + -- Classify mobile speed tier: aircraft and commanders are fast, ground is slow + local isFast = cache.canFly[uDefID] or cache.isCommander[uDefID] or false + isFastMobileTbl[uID] = isFast + if isFast then + mCount = mCount + 1 + mobileIDs[mCount] = uID + else + smCount = smCount + 1 + slowMobileIDs[smCount] = uID + end + end -- isImmobile + end -- not critter + end -- not fastPathHandled + end -- not cachedBldgX end -- not crashing end -- Clear stale entries from previous frame local prevBLen = gl4Icons._prevBuildingLen - for i = bCount + 1, prevBLen do buildingIDs[i] = nil end + for i = bCount + 1, prevBLen do + buildingIDs[i] = nil + end gl4Icons._prevBuildingLen = bCount local prevMLen = gl4Icons._prevMobileLen - for i = mCount + 1, prevMLen do mobileIDs[i] = nil end + for i = mCount + 1, prevMLen do + mobileIDs[i] = nil + end gl4Icons._prevMobileLen = mCount local prevSMLen = gl4Icons._prevSlowMobileLen - for i = smCount + 1, prevSMLen do slowMobileIDs[i] = nil end + for i = smCount + 1, prevSMLen do + slowMobileIDs[i] = nil + end gl4Icons._prevSlowMobileLen = smCount local icT2 = os.clock() @@ -10746,13 +11153,13 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local icT3 = os.clock() -- Intermediate timer variables (set in both paths) - local icT3b = icT3 -- default: no building processing - local icT3c = icT3 -- default: no slow mobile processing + local icT3b = icT3 -- default: no building processing + local icT3c = icT3 -- default: no slow mobile processing local bldgProcessed = 0 local mobileProcessed = 0 local slowMobileProcessed = 0 local currentGameFrame = Spring.GetGameFrame() - local bldgUsedElements = 0 -- Total building+ghost elements for building VBO + local bldgUsedElements = 0 -- Total building+ghost elements for building VBO -- ======================================================================== -- Building VBO processing (ghosts + buildings → bldgData) @@ -10762,21 +11169,10 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Building block validation (same logic as before) local bldgBlock = gl4Icons._bldgBlock - local bldgBlockValid = bldgBlock - and bCount == gl4Icons._bldgBlockBCount - and bldgHash == gl4Icons._bldgBlockHash - and checkAllyTeamID == gl4Icons._bldgBlockCheckAlly - and (currentGameFrame - (gl4Icons._bldgBlockFrame or 0)) < bldgBlockGameFrameLimit - and not useUnitpics - and not gl4Icons._bldgBlockBuiltDuringUnitpics + local bldgBlockValid = bldgBlock and bCount == gl4Icons._bldgBlockBCount and bldgHash == gl4Icons._bldgBlockHash and checkAllyTeamID == gl4Icons._bldgBlockCheckAlly and (currentGameFrame - (gl4Icons._bldgBlockFrame or 0)) < bldgBlockGameFrameLimit and not useUnitpics and not gl4Icons._bldgBlockBuiltDuringUnitpics gl4Icons._bldgRenderFrame = (gl4Icons._bldgRenderFrame or 0) + 1 - if not bldgBlockValid and bldgBlock and bCount > 3000 - and checkAllyTeamID == gl4Icons._bldgBlockCheckAlly - and (currentGameFrame - (gl4Icons._bldgBlockFrame or 0)) < bldgBlockGameFrameLimit - and not useUnitpics - and not gl4Icons._bldgBlockBuiltDuringUnitpics - and (gl4Icons._bldgRenderFrame - (gl4Icons._bldgBlockRebuildRenderFrame or 0)) < 5 then + if not bldgBlockValid and bldgBlock and bCount > 3000 and checkAllyTeamID == gl4Icons._bldgBlockCheckAlly and (currentGameFrame - (gl4Icons._bldgBlockFrame or 0)) < bldgBlockGameFrameLimit and not useUnitpics and not gl4Icons._bldgBlockBuiltDuringUnitpics and (gl4Icons._bldgRenderFrame - (gl4Icons._bldgBlockRebuildRenderFrame or 0)) < 5 then bldgBlockValid = true end @@ -10784,7 +11180,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Requires: ghost data unchanged + building block still valid + no active/recent overlays. local ghostUnchanged = (ghostElementCount == gl4Icons._bldgVboGhostCount) and (ghostHash == gl4Icons._bldgVboGhostHash) local bldgVboReuse = false - local bldgOverlayKnown = nil -- overlay result from reuse check (avoids recomputing after processing) + local bldgOverlayKnown = nil -- overlay result from reuse check (avoids recomputing after processing) if gl4Icons._bldgVboValid and bldgBlockValid and ghostUnchanged then -- Quick check: any building has an active overlay? If so, VBO might be stale. local bldgHasOverlay = false @@ -10792,192 +11188,217 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) if bldgIdx then if selectedSet and not bldgHasOverlay then for uID in pairs(bldgIdx) do - if selectedSet[uID] then bldgHasOverlay = true; break end + if selectedSet[uID] then + bldgHasOverlay = true + break + end end end if trackedSet and not bldgHasOverlay then for uID in pairs(trackedSet) do - if bldgIdx[uID] then bldgHasOverlay = true; break end + if bldgIdx[uID] then + bldgHasOverlay = true + break + end end end if not bldgHasOverlay then for uID in pairs(selfDUnits) do - if bldgIdx[uID] then bldgHasOverlay = true; break end + if bldgIdx[uID] then + bldgHasOverlay = true + break + end end end if not bldgHasOverlay then for uID, flash in pairs(damageFlash) do if bldgIdx[uID] and gameTime - flash.time < DAMAGE_FLASH_DURATION then - bldgHasOverlay = true; break + bldgHasOverlay = true + break end end end end - bldgOverlayKnown = bldgHasOverlay -- save for reuse after processing + bldgOverlayKnown = bldgHasOverlay -- save for reuse after processing if not bldgHasOverlay and not gl4Icons._bldgVboHadOverlay then bldgVboReuse = true bldgUsedElements = gl4Icons._bldgVboUsedElements end end - local preProcessEl = usedElements -- = ghostElementCount (building data starts after ghosts) + local preProcessEl = usedElements -- = ghostElementCount (building data starts after ghosts) if not bldgVboReuse then + if bldgBlockValid then + local blockFloats = gl4Icons._bldgBlockN -- total float count + usedElements = usedElements + gl4Icons._bldgBlockCount - if bldgBlockValid then - local blockFloats = gl4Icons._bldgBlockN -- total float count - usedElements = usedElements + gl4Icons._bldgBlockCount - - -- Dynamic overlays on top of cached data - local bldgIdx = gl4Icons._bldgBlockIdx - local needOverlay = bldgOverlayKnown -- already computed during reuse check - - if needOverlay then - -- Overlays active: copy block into bldgData so we can modify colors/flags in-place - local blockOffset = preProcessEl * instStep - local j = 1 - while j + 11 <= blockFloats do - data[blockOffset+j]=bldgBlock[j]; data[blockOffset+j+1]=bldgBlock[j+1] - data[blockOffset+j+2]=bldgBlock[j+2]; data[blockOffset+j+3]=bldgBlock[j+3] - data[blockOffset+j+4]=bldgBlock[j+4]; data[blockOffset+j+5]=bldgBlock[j+5] - data[blockOffset+j+6]=bldgBlock[j+6]; data[blockOffset+j+7]=bldgBlock[j+7] - data[blockOffset+j+8]=bldgBlock[j+8]; data[blockOffset+j+9]=bldgBlock[j+9] - data[blockOffset+j+10]=bldgBlock[j+10]; data[blockOffset+j+11]=bldgBlock[j+11] - j = j + 12 - end - while j <= blockFloats do - data[blockOffset + j] = bldgBlock[j] - j = j + 1 - end + -- Dynamic overlays on top of cached data + local bldgIdx = gl4Icons._bldgBlockIdx + local needOverlay = bldgOverlayKnown -- already computed during reuse check + + if needOverlay then + -- Overlays active: copy block into bldgData so we can modify colors/flags in-place + local blockOffset = preProcessEl * instStep + local j = 1 + while j + 11 <= blockFloats do + data[blockOffset + j] = bldgBlock[j] + data[blockOffset + j + 1] = bldgBlock[j + 1] + data[blockOffset + j + 2] = bldgBlock[j + 2] + data[blockOffset + j + 3] = bldgBlock[j + 3] + data[blockOffset + j + 4] = bldgBlock[j + 4] + data[blockOffset + j + 5] = bldgBlock[j + 5] + data[blockOffset + j + 6] = bldgBlock[j + 6] + data[blockOffset + j + 7] = bldgBlock[j + 7] + data[blockOffset + j + 8] = bldgBlock[j + 8] + data[blockOffset + j + 9] = bldgBlock[j + 9] + data[blockOffset + j + 10] = bldgBlock[j + 10] + data[blockOffset + j + 11] = bldgBlock[j + 11] + j = j + 12 + end + while j <= blockFloats do + data[blockOffset + j] = bldgBlock[j] + j = j + 1 + end + + -- Selection overlay: selected buildings rendered white + if selectedSet then + for uID, idx in pairs(bldgIdx) do + if selectedSet[uID] then + local off = (preProcessEl + idx - 1) * instStep + data[off + 9] = 1 + data[off + 10] = 1 + data[off + 11] = 1 + data[off + 12] = (uID * 0.37) % 6.2832 + end + end + end - -- Selection overlay: selected buildings rendered white - if selectedSet then - for uID, idx in pairs(bldgIdx) do - if selectedSet[uID] then - local off = (preProcessEl + idx - 1) * instStep - data[off + 9] = 1; data[off + 10] = 1; data[off + 11] = 1 - data[off + 12] = (uID * 0.37) % 6.2832 + -- Damage flash overlay + for uID, flash in pairs(damageFlash) do + local idx = bldgIdx[uID] + if idx then + local elapsed = gameTime - flash.time + if elapsed < DAMAGE_FLASH_DURATION then + local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) + local off = (preProcessEl + idx - 1) * instStep + data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f + data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f + data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f + data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 + else + damageFlash[uID] = nil + end end end - end - -- Damage flash overlay - for uID, flash in pairs(damageFlash) do - local idx = bldgIdx[uID] - if idx then - local elapsed = gameTime - flash.time - if elapsed < DAMAGE_FLASH_DURATION then - local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) - local off = (preProcessEl + idx - 1) * instStep - data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f - data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f - data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f - data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 - else - damageFlash[uID] = nil + -- Tracking overlay + if trackedSet then + for uID, _ in pairs(trackedSet) do + local idx = bldgIdx[uID] + if idx then + local off = (preProcessEl + idx - 1) * instStep + data[off + 4] = data[off + 4] + 8 + end end end - end - -- Tracking overlay - if trackedSet then - for uID, _ in pairs(trackedSet) do + -- SelfD overlay + for uID in pairs(selfDUnits) do local idx = bldgIdx[uID] if idx then local off = (preProcessEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 8 + data[off + 4] = data[off + 4] + 16 end end - end + end -- needOverlay + else + -- Slow path: process each building individually, build block cache - -- SelfD overlay - for uID in pairs(selfDUnits) do - local idx = bldgIdx[uID] - if idx then - local off = (preProcessEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 16 + -- Deferred building sort: only sort when actually rebuilding the block. + -- Buildings rarely change so this sort runs infrequently. + local bldgSetChanged = bCount ~= gl4Icons._lastBldgCount or bldgHash ~= gl4Icons._lastBldgHash + if bldgSetChanged then + table.sort(buildingIDs, gl4IconSortCmp) + for i = 1, bCount do + bldgSortedCache[i] = buildingIDs[i] end + bldgSortedCache[bCount + 1] = nil + gl4Icons._lastBldgCount = bCount + gl4Icons._lastBldgHash = bldgHash end - end -- needOverlay - else - -- Slow path: process each building individually, build block cache - -- Deferred building sort: only sort when actually rebuilding the block. - -- Buildings rarely change so this sort runs infrequently. - local bldgSetChanged = bCount ~= gl4Icons._lastBldgCount or bldgHash ~= gl4Icons._lastBldgHash - if bldgSetChanged then - table.sort(buildingIDs, gl4IconSortCmp) - for i = 1, bCount do bldgSortedCache[i] = buildingIDs[i] end - bldgSortedCache[bCount + 1] = nil - gl4Icons._lastBldgCount = bCount - gl4Icons._lastBldgHash = bldgHash - end + local bldgIdx = gl4Icons._bldgBlockIdx + if not bldgIdx then + bldgIdx = {} + gl4Icons._bldgBlockIdx = bldgIdx + end + for k in pairs(bldgIdx) do + bldgIdx[k] = nil + end - local bldgIdx = gl4Icons._bldgBlockIdx - if not bldgIdx then - bldgIdx = {} - gl4Icons._bldgBlockIdx = bldgIdx - end - for k in pairs(bldgIdx) do bldgIdx[k] = nil end - - local writeCount = 0 - for i = 1, bCount do - local uID = bldgSortedCache[i] - if usedElements >= maxInst then break end - local prevEl = usedElements - usedElements = processUnit(uID, usedElements) - if usedElements > prevEl then - writeCount = writeCount + 1 - bldgIdx[uID] = writeCount -- 1-based index within block - end - end - - -- Cache the building block for future frames - if not bldgBlock then - bldgBlock = {} - gl4Icons._bldgBlock = bldgBlock - end - local blockStart = preProcessEl * instStep - local blockFloats = (usedElements - preProcessEl) * instStep - for j = 1, blockFloats do - bldgBlock[j] = data[blockStart + j] - end - -- Strip tracked + selfD bits from cached flags, preserving health and bits 0-2 - -- Flags format: healthPct*32 + bitFlags. Clear bits 3-4 (tracked=8, selfD=16) - for i = 0, writeCount - 1 do - local j = i * instStep + 4 -- flags position within block (1-based: inst 0 → idx 4) - local f = bldgBlock[j] - bldgBlock[j] = f - f % 32 + f % 8 -- keep health*32 + bits 0-2, clear bits 3-4 - end - -- Strip selection colors from cache: restore team colors for any selected buildings - -- so the cached block is selection-neutral (selection overlay is applied dynamically) - if selectedSet then - for uID, idx in pairs(bldgIdx) do - if selectedSet[uID] then - local j = (idx - 1) * instStep - local uTeam = spFunc.GetUnitTeam(uID) - if uTeam then - bldgBlock[j + 9] = teamColorR[uTeam] or 1 - bldgBlock[j + 10] = teamColorG[uTeam] or 1 - bldgBlock[j + 11] = teamColorB[uTeam] or 1 + local writeCount = 0 + for i = 1, bCount do + local uID = bldgSortedCache[i] + if usedElements >= maxInst then + break + end + local prevEl = usedElements + usedElements = processUnit(uID, usedElements) + if usedElements > prevEl then + writeCount = writeCount + 1 + bldgIdx[uID] = writeCount -- 1-based index within block + end + end + + -- Cache the building block for future frames + if not bldgBlock then + bldgBlock = {} + gl4Icons._bldgBlock = bldgBlock + end + local blockStart = preProcessEl * instStep + local blockFloats = (usedElements - preProcessEl) * instStep + for j = 1, blockFloats do + bldgBlock[j] = data[blockStart + j] + end + -- Strip tracked + selfD bits from cached flags, preserving health and bits 0-2 + -- Flags format: healthPct*32 + bitFlags. Clear bits 3-4 (tracked=8, selfD=16) + for i = 0, writeCount - 1 do + local j = i * instStep + 4 -- flags position within block (1-based: inst 0 → idx 4) + local f = bldgBlock[j] + bldgBlock[j] = f - f % 32 + f % 8 -- keep health*32 + bits 0-2, clear bits 3-4 + end + -- Strip selection colors from cache: restore team colors for any selected buildings + -- so the cached block is selection-neutral (selection overlay is applied dynamically) + if selectedSet then + for uID, idx in pairs(bldgIdx) do + if selectedSet[uID] then + local j = (idx - 1) * instStep + local uTeam = spFunc.GetUnitTeam(uID) + if uTeam then + bldgBlock[j + 9] = teamColorR[uTeam] or 1 + bldgBlock[j + 10] = teamColorG[uTeam] or 1 + bldgBlock[j + 11] = teamColorB[uTeam] or 1 + end end end end - end - -- Clear stale entries beyond current block - local prevBlockN = gl4Icons._bldgBlockN or 0 - for j = blockFloats + 1, prevBlockN do bldgBlock[j] = nil end + -- Clear stale entries beyond current block + local prevBlockN = gl4Icons._bldgBlockN or 0 + for j = blockFloats + 1, prevBlockN do + bldgBlock[j] = nil + end - gl4Icons._bldgBlockN = blockFloats - gl4Icons._bldgBlockCount = usedElements - preProcessEl - gl4Icons._bldgBlockBCount = bCount - gl4Icons._bldgBlockHash = bldgHash - gl4Icons._bldgBlockCheckAlly = checkAllyTeamID - gl4Icons._bldgBlockFrame = currentGameFrame - gl4Icons._bldgBlockRebuildRenderFrame = gl4Icons._bldgRenderFrame - gl4Icons._bldgBlockBuiltDuringUnitpics = useUnitpics -- block has 0 icons when unitpics active - end -- bldgBlockValid fast/slow path - icT3b = os.clock() + gl4Icons._bldgBlockN = blockFloats + gl4Icons._bldgBlockCount = usedElements - preProcessEl + gl4Icons._bldgBlockBCount = bCount + gl4Icons._bldgBlockHash = bldgHash + gl4Icons._bldgBlockCheckAlly = checkAllyTeamID + gl4Icons._bldgBlockFrame = currentGameFrame + gl4Icons._bldgBlockRebuildRenderFrame = gl4Icons._bldgRenderFrame + gl4Icons._bldgBlockBuiltDuringUnitpics = useUnitpics -- block has 0 icons when unitpics active + end -- bldgBlockValid fast/slow path + icT3b = os.clock() bldgProcessed = usedElements - preProcessEl bldgUsedElements = usedElements @@ -10992,23 +11413,33 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) if bldgIdx then if selectedSet then for uID in pairs(bldgIdx) do - if selectedSet[uID] then bldgHasOverlay = true; break end + if selectedSet[uID] then + bldgHasOverlay = true + break + end end end if trackedSet and not bldgHasOverlay then for uID in pairs(trackedSet) do - if bldgIdx[uID] then bldgHasOverlay = true; break end + if bldgIdx[uID] then + bldgHasOverlay = true + break + end end end if not bldgHasOverlay then for uID in pairs(selfDUnits) do - if bldgIdx[uID] then bldgHasOverlay = true; break end + if bldgIdx[uID] then + bldgHasOverlay = true + break + end end end if not bldgHasOverlay then for uID, flash in pairs(damageFlash) do if bldgIdx[uID] and gameTime - flash.time < DAMAGE_FLASH_DURATION then - bldgHasOverlay = true; break + bldgHasOverlay = true + break end end end @@ -11037,7 +11468,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) gl4Icons._bldgVboUsedElements = bldgUsedElements gl4Icons._bldgVboGhostHash = ghostHash gl4Icons._bldgVboGhostCount = ghostElementCount - end -- if not bldgVboReuse + end -- if not bldgVboReuse -- ======================================================================== -- Slow mobile VBO processing (ground units → slowInstanceData) @@ -11050,151 +11481,162 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Slow mobile VBO reuse: when block cache hit and VBO still valid, skip processing local slowMobileVboReuse = false - if useMobileBlockCache and not slowMobileBlockRebuild and gl4Icons._slowVboValid - and (gl4Icons._slowMobileBlockCount or 0) == gl4Icons._slowVboUsedElements then + if useMobileBlockCache and not slowMobileBlockRebuild and gl4Icons._slowVboValid and (gl4Icons._slowMobileBlockCount or 0) == gl4Icons._slowVboUsedElements then slowMobileVboReuse = true usedElements = gl4Icons._slowVboUsedElements end if not slowMobileVboReuse then + if useMobileBlockCache and not slowMobileBlockRebuild then + -- Fast path: copy entire cached slow mobile block + local slowBlock = gl4Icons._slowMobileBlock + local blockFloats = gl4Icons._slowMobileBlockN or 0 + local blockOffset = usedElements * instStep + local j = 1 + while j + 11 <= blockFloats do + data[blockOffset + j] = slowBlock[j] + data[blockOffset + j + 1] = slowBlock[j + 1] + data[blockOffset + j + 2] = slowBlock[j + 2] + data[blockOffset + j + 3] = slowBlock[j + 3] + data[blockOffset + j + 4] = slowBlock[j + 4] + data[blockOffset + j + 5] = slowBlock[j + 5] + data[blockOffset + j + 6] = slowBlock[j + 6] + data[blockOffset + j + 7] = slowBlock[j + 7] + data[blockOffset + j + 8] = slowBlock[j + 8] + data[blockOffset + j + 9] = slowBlock[j + 9] + data[blockOffset + j + 10] = slowBlock[j + 10] + data[blockOffset + j + 11] = slowBlock[j + 11] + j = j + 12 + end + while j <= blockFloats do + data[blockOffset + j] = slowBlock[j] + j = j + 1 + end + usedElements = usedElements + (gl4Icons._slowMobileBlockCount or 0) - if useMobileBlockCache and not slowMobileBlockRebuild then - -- Fast path: copy entire cached slow mobile block - local slowBlock = gl4Icons._slowMobileBlock - local blockFloats = gl4Icons._slowMobileBlockN or 0 - local blockOffset = usedElements * instStep - local j = 1 - while j + 11 <= blockFloats do - data[blockOffset+j]=slowBlock[j]; data[blockOffset+j+1]=slowBlock[j+1] - data[blockOffset+j+2]=slowBlock[j+2]; data[blockOffset+j+3]=slowBlock[j+3] - data[blockOffset+j+4]=slowBlock[j+4]; data[blockOffset+j+5]=slowBlock[j+5] - data[blockOffset+j+6]=slowBlock[j+6]; data[blockOffset+j+7]=slowBlock[j+7] - data[blockOffset+j+8]=slowBlock[j+8]; data[blockOffset+j+9]=slowBlock[j+9] - data[blockOffset+j+10]=slowBlock[j+10]; data[blockOffset+j+11]=slowBlock[j+11] - j = j + 12 - end - while j <= blockFloats do - data[blockOffset + j] = slowBlock[j] - j = j + 1 - end - usedElements = usedElements + (gl4Icons._slowMobileBlockCount or 0) - - -- Dynamic overlays on top of cached slow mobile data - local slowIdx = gl4Icons._slowMobileBlockIdx - if slowIdx then - if selectedSet then - for uID, idx in pairs(slowIdx) do - if selectedSet[uID] then - local off = (preSlowMobileEl + idx - 1) * instStep - data[off + 9] = 1; data[off + 10] = 1; data[off + 11] = 1 - data[off + 12] = (uID * 0.37) % 6.2832 + -- Dynamic overlays on top of cached slow mobile data + local slowIdx = gl4Icons._slowMobileBlockIdx + if slowIdx then + if selectedSet then + for uID, idx in pairs(slowIdx) do + if selectedSet[uID] then + local off = (preSlowMobileEl + idx - 1) * instStep + data[off + 9] = 1 + data[off + 10] = 1 + data[off + 11] = 1 + data[off + 12] = (uID * 0.37) % 6.2832 + end end end - end - for uID, flash in pairs(damageFlash) do - local idx = slowIdx[uID] - if idx then - local elapsed = gameTime - flash.time - if elapsed < DAMAGE_FLASH_DURATION then - local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) - local off = (preSlowMobileEl + idx - 1) * instStep - data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f - data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f - data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f - data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 - else - damageFlash[uID] = nil + for uID, flash in pairs(damageFlash) do + local idx = slowIdx[uID] + if idx then + local elapsed = gameTime - flash.time + if elapsed < DAMAGE_FLASH_DURATION then + local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) + local off = (preSlowMobileEl + idx - 1) * instStep + data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f + data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f + data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f + data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 + else + damageFlash[uID] = nil + end end end - end - if trackedSet then - for uID, _ in pairs(trackedSet) do + if trackedSet then + for uID, _ in pairs(trackedSet) do + local idx = slowIdx[uID] + if idx then + local off = (preSlowMobileEl + idx - 1) * instStep + data[off + 4] = data[off + 4] + 8 + end + end + end + for uID in pairs(selfDUnits) do local idx = slowIdx[uID] if idx then local off = (preSlowMobileEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 8 + data[off + 4] = data[off + 4] + 16 end end end - for uID in pairs(selfDUnits) do - local idx = slowIdx[uID] - if idx then - local off = (preSlowMobileEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 16 + else + -- Full path: process each slow mobile unit individually + local slowIdx + if useMobileBlockCache then + slowIdx = gl4Icons._slowMobileBlockIdx + if not slowIdx then + slowIdx = {} + gl4Icons._slowMobileBlockIdx = slowIdx + end + for k in pairs(slowIdx) do + slowIdx[k] = nil end end - end - else - -- Full path: process each slow mobile unit individually - local slowIdx - if useMobileBlockCache then - slowIdx = gl4Icons._slowMobileBlockIdx - if not slowIdx then - slowIdx = {} - gl4Icons._slowMobileBlockIdx = slowIdx - end - for k in pairs(slowIdx) do slowIdx[k] = nil end - end - local writeCount = 0 - for i = 1, smCount do - local uID = slowMobileIDs[i] - if usedElements >= maxInst then break end - local prevEl = usedElements - usedElements = processUnit(uID, usedElements) - if useMobileBlockCache and usedElements > prevEl then - writeCount = writeCount + 1 - slowIdx[uID] = writeCount + local writeCount = 0 + for i = 1, smCount do + local uID = slowMobileIDs[i] + if usedElements >= maxInst then + break + end + local prevEl = usedElements + usedElements = processUnit(uID, usedElements) + if useMobileBlockCache and usedElements > prevEl then + writeCount = writeCount + 1 + slowIdx[uID] = writeCount + end end - end - -- Cache the slow mobile block for future frames - if useMobileBlockCache then - local slowBlock = gl4Icons._slowMobileBlock - if not slowBlock then - slowBlock = {} - gl4Icons._slowMobileBlock = slowBlock - end - local blockStart = preSlowMobileEl * instStep - local blockFloats = (usedElements - preSlowMobileEl) * instStep - for j = 1, blockFloats do - slowBlock[j] = data[blockStart + j] - end - for i = 0, writeCount - 1 do - local j = i * instStep + 4 - local f = slowBlock[j] - slowBlock[j] = f - f % 32 + f % 8 - end - if selectedSet then - for uID, idx in pairs(slowIdx) do - if selectedSet[uID] then - local j = (idx - 1) * instStep - local uTeam = spFunc.GetUnitTeam(uID) - if uTeam then - slowBlock[j + 9] = teamColorR[uTeam] or 1 - slowBlock[j + 10] = teamColorG[uTeam] or 1 - slowBlock[j + 11] = teamColorB[uTeam] or 1 + -- Cache the slow mobile block for future frames + if useMobileBlockCache then + local slowBlock = gl4Icons._slowMobileBlock + if not slowBlock then + slowBlock = {} + gl4Icons._slowMobileBlock = slowBlock + end + local blockStart = preSlowMobileEl * instStep + local blockFloats = (usedElements - preSlowMobileEl) * instStep + for j = 1, blockFloats do + slowBlock[j] = data[blockStart + j] + end + for i = 0, writeCount - 1 do + local j = i * instStep + 4 + local f = slowBlock[j] + slowBlock[j] = f - f % 32 + f % 8 + end + if selectedSet then + for uID, idx in pairs(slowIdx) do + if selectedSet[uID] then + local j = (idx - 1) * instStep + local uTeam = spFunc.GetUnitTeam(uID) + if uTeam then + slowBlock[j + 9] = teamColorR[uTeam] or 1 + slowBlock[j + 10] = teamColorG[uTeam] or 1 + slowBlock[j + 11] = teamColorB[uTeam] or 1 + end end end end + local prevBlockN = gl4Icons._slowMobileBlockN or 0 + for j = blockFloats + 1, prevBlockN do + slowBlock[j] = nil + end + gl4Icons._slowMobileBlockN = blockFloats + gl4Icons._slowMobileBlockCount = usedElements - preSlowMobileEl + gl4Icons._slowMobileBlockCheckAlly = checkAllyTeamID end - local prevBlockN = gl4Icons._slowMobileBlockN or 0 - for j = blockFloats + 1, prevBlockN do slowBlock[j] = nil end - gl4Icons._slowMobileBlockN = blockFloats - gl4Icons._slowMobileBlockCount = usedElements - preSlowMobileEl - gl4Icons._slowMobileBlockCheckAlly = checkAllyTeamID end - end - slowMobileProcessed = usedElements - preSlowMobileEl - - -- Upload slow mobile VBO - if not slowMobileVboReuse and usedElements > 0 then - gl4Icons.slowVbo:Upload(data, nil, 0, 1, usedElements * instStep) - gl4Icons._slowVboValid = true - gl4Icons._slowVboUsedElements = usedElements - end + slowMobileProcessed = usedElements - preSlowMobileEl + -- Upload slow mobile VBO + if not slowMobileVboReuse and usedElements > 0 then + gl4Icons.slowVbo:Upload(data, nil, 0, 1, usedElements * instStep) + gl4Icons._slowVboValid = true + gl4Icons._slowVboUsedElements = usedElements + end end -- if not slowMobileVboReuse local slowMobileUsedElements = usedElements @@ -11210,160 +11652,171 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) -- Mobile VBO reuse: when mobile block cache hit and VBO still valid, skip processing local mobileVboReuse = false - if useMobileBlockCache and not mobileBlockRebuild and gl4Icons._vboValid - and (gl4Icons._mobileBlockCount or 0) == gl4Icons._vboUsedElements then + if useMobileBlockCache and not mobileBlockRebuild and gl4Icons._vboValid and (gl4Icons._mobileBlockCount or 0) == gl4Icons._vboUsedElements then mobileVboReuse = true usedElements = gl4Icons._vboUsedElements end if not mobileVboReuse then + if useMobileBlockCache and not mobileBlockRebuild then + -- Fast path: copy entire cached mobile block (saves all processUnit calls) + local mobileBlock = gl4Icons._mobileBlock + local blockFloats = gl4Icons._mobileBlockN or 0 + local blockOffset = usedElements * instStep + -- Unrolled copy: 12 floats per mobile instance + local j = 1 + while j + 11 <= blockFloats do + data[blockOffset + j] = mobileBlock[j] + data[blockOffset + j + 1] = mobileBlock[j + 1] + data[blockOffset + j + 2] = mobileBlock[j + 2] + data[blockOffset + j + 3] = mobileBlock[j + 3] + data[blockOffset + j + 4] = mobileBlock[j + 4] + data[blockOffset + j + 5] = mobileBlock[j + 5] + data[blockOffset + j + 6] = mobileBlock[j + 6] + data[blockOffset + j + 7] = mobileBlock[j + 7] + data[blockOffset + j + 8] = mobileBlock[j + 8] + data[blockOffset + j + 9] = mobileBlock[j + 9] + data[blockOffset + j + 10] = mobileBlock[j + 10] + data[blockOffset + j + 11] = mobileBlock[j + 11] + j = j + 12 + end + while j <= blockFloats do + data[blockOffset + j] = mobileBlock[j] + j = j + 1 + end + usedElements = usedElements + (gl4Icons._mobileBlockCount or 0) - if useMobileBlockCache and not mobileBlockRebuild then - -- Fast path: copy entire cached mobile block (saves all processUnit calls) - local mobileBlock = gl4Icons._mobileBlock - local blockFloats = gl4Icons._mobileBlockN or 0 - local blockOffset = usedElements * instStep - -- Unrolled copy: 12 floats per mobile instance - local j = 1 - while j + 11 <= blockFloats do - data[blockOffset+j]=mobileBlock[j]; data[blockOffset+j+1]=mobileBlock[j+1] - data[blockOffset+j+2]=mobileBlock[j+2]; data[blockOffset+j+3]=mobileBlock[j+3] - data[blockOffset+j+4]=mobileBlock[j+4]; data[blockOffset+j+5]=mobileBlock[j+5] - data[blockOffset+j+6]=mobileBlock[j+6]; data[blockOffset+j+7]=mobileBlock[j+7] - data[blockOffset+j+8]=mobileBlock[j+8]; data[blockOffset+j+9]=mobileBlock[j+9] - data[blockOffset+j+10]=mobileBlock[j+10]; data[blockOffset+j+11]=mobileBlock[j+11] - j = j + 12 - end - while j <= blockFloats do - data[blockOffset + j] = mobileBlock[j] - j = j + 1 - end - usedElements = usedElements + (gl4Icons._mobileBlockCount or 0) - - -- Dynamic overlays on top of cached mobile data - local mobileIdx = gl4Icons._mobileBlockIdx - if mobileIdx then - -- Selection overlay: selected mobile units rendered white - -- Iterate mobileIdx (visible units) instead of selectedSet (all selected units) - if selectedSet then - for uID, idx in pairs(mobileIdx) do - if selectedSet[uID] then - local off = (preMobileEl + idx - 1) * instStep - data[off + 9] = 1; data[off + 10] = 1; data[off + 11] = 1 - data[off + 12] = (uID * 0.37) % 6.2832 + -- Dynamic overlays on top of cached mobile data + local mobileIdx = gl4Icons._mobileBlockIdx + if mobileIdx then + -- Selection overlay: selected mobile units rendered white + -- Iterate mobileIdx (visible units) instead of selectedSet (all selected units) + if selectedSet then + for uID, idx in pairs(mobileIdx) do + if selectedSet[uID] then + local off = (preMobileEl + idx - 1) * instStep + data[off + 9] = 1 + data[off + 10] = 1 + data[off + 11] = 1 + data[off + 12] = (uID * 0.37) % 6.2832 + end end end - end - -- Damage flash overlay - for uID, flash in pairs(damageFlash) do - local idx = mobileIdx[uID] - if idx then - local elapsed = gameTime - flash.time - if elapsed < DAMAGE_FLASH_DURATION then - local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) - local off = (preMobileEl + idx - 1) * instStep - data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f - data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f - data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f - data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 - else - damageFlash[uID] = nil + -- Damage flash overlay + for uID, flash in pairs(damageFlash) do + local idx = mobileIdx[uID] + if idx then + local elapsed = gameTime - flash.time + if elapsed < DAMAGE_FLASH_DURATION then + local f = flash.intensity * (1 - elapsed / DAMAGE_FLASH_DURATION) + local off = (preMobileEl + idx - 1) * instStep + data[off + 9] = data[off + 9] + (1 - data[off + 9]) * f + data[off + 10] = data[off + 10] + (1 - data[off + 10]) * f + data[off + 11] = data[off + 11] + (1 - data[off + 11]) * f + data[off + 12] = (uID * 0.37) % 6.2832 + mathFloor(f * 100) * 7.0 + else + damageFlash[uID] = nil + end end end - end - -- Tracking overlay - if trackedSet then - for uID, _ in pairs(trackedSet) do + -- Tracking overlay + if trackedSet then + for uID, _ in pairs(trackedSet) do + local idx = mobileIdx[uID] + if idx then + local off = (preMobileEl + idx - 1) * instStep + data[off + 4] = data[off + 4] + 8 + end + end + end + -- SelfD overlay + for uID in pairs(selfDUnits) do local idx = mobileIdx[uID] if idx then local off = (preMobileEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 8 + data[off + 4] = data[off + 4] + 16 end end end - -- SelfD overlay - for uID in pairs(selfDUnits) do - local idx = mobileIdx[uID] - if idx then - local off = (preMobileEl + idx - 1) * instStep - data[off + 4] = data[off + 4] + 16 + else + -- Full path: process each mobile unit individually + local mobileIdx + if useMobileBlockCache then + mobileIdx = gl4Icons._mobileBlockIdx + if not mobileIdx then + mobileIdx = {} + gl4Icons._mobileBlockIdx = mobileIdx + end + for k in pairs(mobileIdx) do + mobileIdx[k] = nil end end - end - else - -- Full path: process each mobile unit individually - local mobileIdx - if useMobileBlockCache then - mobileIdx = gl4Icons._mobileBlockIdx - if not mobileIdx then - mobileIdx = {} - gl4Icons._mobileBlockIdx = mobileIdx - end - for k in pairs(mobileIdx) do mobileIdx[k] = nil end - end - local writeCount = 0 - for i = 1, mCount do - local uID = mobileIDs[i] - if usedElements >= maxInst then break end - local prevEl = usedElements - usedElements = processUnit(uID, usedElements) - if useMobileBlockCache and usedElements > prevEl then - writeCount = writeCount + 1 - mobileIdx[uID] = writeCount + local writeCount = 0 + for i = 1, mCount do + local uID = mobileIDs[i] + if usedElements >= maxInst then + break + end + local prevEl = usedElements + usedElements = processUnit(uID, usedElements) + if useMobileBlockCache and usedElements > prevEl then + writeCount = writeCount + 1 + mobileIdx[uID] = writeCount + end end - end - -- Cache the mobile block for future frames - if useMobileBlockCache then - local mobileBlock = gl4Icons._mobileBlock - if not mobileBlock then - mobileBlock = {} - gl4Icons._mobileBlock = mobileBlock - end - local blockStart = preMobileEl * instStep - local blockFloats = (usedElements - preMobileEl) * instStep - for j = 1, blockFloats do - mobileBlock[j] = data[blockStart + j] - end - -- Strip tracked + selfD bits from cached flags (same as building block) - for i = 0, writeCount - 1 do - local j = i * instStep + 4 - local f = mobileBlock[j] - mobileBlock[j] = f - f % 32 + f % 8 - end - -- Strip selection colors from cache (same as building block) - if selectedSet then - for uID, idx in pairs(mobileIdx) do - if selectedSet[uID] then - local j = (idx - 1) * instStep - local uTeam = spFunc.GetUnitTeam(uID) - if uTeam then - mobileBlock[j + 9] = teamColorR[uTeam] or 1 - mobileBlock[j + 10] = teamColorG[uTeam] or 1 - mobileBlock[j + 11] = teamColorB[uTeam] or 1 + -- Cache the mobile block for future frames + if useMobileBlockCache then + local mobileBlock = gl4Icons._mobileBlock + if not mobileBlock then + mobileBlock = {} + gl4Icons._mobileBlock = mobileBlock + end + local blockStart = preMobileEl * instStep + local blockFloats = (usedElements - preMobileEl) * instStep + for j = 1, blockFloats do + mobileBlock[j] = data[blockStart + j] + end + -- Strip tracked + selfD bits from cached flags (same as building block) + for i = 0, writeCount - 1 do + local j = i * instStep + 4 + local f = mobileBlock[j] + mobileBlock[j] = f - f % 32 + f % 8 + end + -- Strip selection colors from cache (same as building block) + if selectedSet then + for uID, idx in pairs(mobileIdx) do + if selectedSet[uID] then + local j = (idx - 1) * instStep + local uTeam = spFunc.GetUnitTeam(uID) + if uTeam then + mobileBlock[j + 9] = teamColorR[uTeam] or 1 + mobileBlock[j + 10] = teamColorG[uTeam] or 1 + mobileBlock[j + 11] = teamColorB[uTeam] or 1 + end end end end + -- Clear stale entries + local prevBlockN = gl4Icons._mobileBlockN or 0 + for j = blockFloats + 1, prevBlockN do + mobileBlock[j] = nil + end + gl4Icons._mobileBlockN = blockFloats + gl4Icons._mobileBlockCount = usedElements - preMobileEl + gl4Icons._mobileBlockCheckAlly = checkAllyTeamID end - -- Clear stale entries - local prevBlockN = gl4Icons._mobileBlockN or 0 - for j = blockFloats + 1, prevBlockN do mobileBlock[j] = nil end - gl4Icons._mobileBlockN = blockFloats - gl4Icons._mobileBlockCount = usedElements - preMobileEl - gl4Icons._mobileBlockCheckAlly = checkAllyTeamID end - end - mobileProcessed = usedElements - preMobileEl - - -- Upload mobile VBO - if not mobileVboReuse and usedElements > 0 then - gl4Icons.vbo:Upload(data, nil, 0, 1, usedElements * instStep) - gl4Icons._vboValid = true - gl4Icons._vboUsedElements = usedElements - end + mobileProcessed = usedElements - preMobileEl + -- Upload mobile VBO + if not mobileVboReuse and usedElements > 0 then + gl4Icons.vbo:Upload(data, nil, 0, 1, usedElements * instStep) + gl4Icons._vboValid = true + gl4Icons._vboUsedElements = usedElements + end end -- if not mobileVboReuse local mobileUsedElements = usedElements @@ -11494,7 +11947,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local zoomFrac = math.max(0, (cameraState.zoom - config.unitpicZoomThreshold) / (1 - config.unitpicZoomThreshold)) local unitpicSizeMult = 0.88 + 0.05 * zoomFrac local picTexInset = math.max(0.125, 0.2 * (1 - (cameraState.zoom - config.unitpicZoomThreshold) / (1 - config.unitpicZoomThreshold))) - local distMult = math.min(math.max(1, 2.2-(cameraState.zoom*3.3)), 3) + local distMult = math.min(math.max(1, 2.2 - (cameraState.zoom * 3.3)), 3) local teamBorderSize = 3 * cameraState.zoom * distMult * resScale local blackBorderSize = 4 * cameraState.zoom * distMult * resScale local cornerCutRatio = 0.18 @@ -11557,7 +12010,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) glFunc.Color(1, 1, 1, isHovered and math.min(1.0, opacity * 1.3) or opacity) else local brightness = 0.7 + ((color and (color[1] + color[2] + color[3]) or 3) / 9) - if isHovered then brightness = brightness * 1.2 end + if isHovered then + brightness = brightness * 1.2 + end glFunc.Color(brightness, brightness, brightness, opacity) end glFunc.BeginEnd(glConst.TRIANGLE_FAN, drawTexturedOctagonVertices, 0, 0, iconSize, crnrCutInner, picTexInset) @@ -11624,7 +12079,9 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) glFunc.Color(1, 1, 1, isHovered and math.min(1.0, opacity * 1.3) or opacity) else local brightness = 0.7 + ((color and (color[1] + color[2] + color[3]) or 3) / 9) - if isHovered then brightness = brightness * 1.2 end + if isHovered then + brightness = brightness * 1.2 + end glFunc.Color(brightness, brightness, brightness, opacity) end glFunc.BeginEnd(glConst.TRIANGLE_FAN, drawTexturedOctagonVertices, px, py, iconSize, crnrCutInner, picTexInset) @@ -11680,7 +12137,7 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) local iconData = cacheUnitIcon[startDefID] local iconSize = iconRadiusZoomDistMult * iconData.size local cx, cy = WorldToPipCoords(miscState.startX, miscState.startZ) - local teamColor = localTeamColors[myTeamID] or {1, 1, 1} + local teamColor = localTeamColors[myTeamID] or { 1, 1, 1 } local texInset = 0.07 gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -11719,7 +12176,6 @@ local function GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) end -- Helper function to draw units and features in PIP local function DrawUnitsAndFeatures(cachedSelectedUnits) - -- Use larger margin for units and features to account for their radius -- Features especially can be quite large (up to ~200 units radius for big wrecks) local margin = 220 @@ -11792,7 +12248,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) trackingSet = {} pools.trackingSet = trackingSet end - for k in pairs(trackingSet) do trackingSet[k] = nil end + for k in pairs(trackingSet) do + trackingSet[k] = nil + end for _, trackedID in ipairs(interactionState.areTracking) do trackingSet[trackedID] = true end @@ -11841,16 +12299,17 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) glFunc.Translate(centerX, centerY, 0) glFunc.Scale(drawScale, drawScale, drawScale) - -- Draw features (3D models) local featureFade = 0 if cameraState.zoom >= config.zoomFeatures then featureFade = math.min(1, (cameraState.zoom - config.zoomFeatures) / config.zoomFeaturesFadeRange) end -- Skip features entirely under extreme workload - if perfTimers.itemCount > 1200 then featureFade = 0 end + if perfTimers.itemCount > 1200 then + featureFade = 0 + end local t0 = os.clock() - if featureFade > 0 then -- Only draw features if zoom is above threshold + if featureFade > 0 then -- Only draw features if zoom is above threshold local featureL = render.world.l - margin local featureT = render.world.t - margin local featureR = render.world.r + margin @@ -11860,11 +12319,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- this avoids per-update engine table allocations when camera rect is stable. local featureQueryNeedsUpdate = miscState.featureRectNeedsUpdate if not featureQueryNeedsUpdate then - local movedEnough = not miscState.featureRectLastL or - math.abs(featureL - miscState.featureRectLastL) > 64 or - math.abs(featureT - miscState.featureRectLastT) > 64 or - math.abs(featureR - miscState.featureRectLastR) > 64 or - math.abs(featureB - miscState.featureRectLastB) > 64 + local movedEnough = not miscState.featureRectLastL or math.abs(featureL - miscState.featureRectLastL) > 64 or math.abs(featureT - miscState.featureRectLastT) > 64 or math.abs(featureR - miscState.featureRectLastR) > 64 or math.abs(featureB - miscState.featureRectLastB) > 64 local stale = (t0 - miscState.featureRectLastUpdate) >= 0.20 featureQueryNeedsUpdate = movedEnough or stale end @@ -11888,7 +12343,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- when the FBO is composited with premultiplied alpha. gl.ColorMask(true, true, true, false) glFunc.Color(featureFade, featureFade, featureFade, 1) - glFunc.Texture(0, '$units') + glFunc.Texture(0, "$units") for i = 1, featureCount do DrawFeature(miscState.pipFeatures[i]) end @@ -11903,7 +12358,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) glFunc.Texture(0, false) glFunc.Color(1, 1, 1, featureFade) for i = 1, featureCount do - DrawFeature(miscState.pipFeatures[i], true) -- noTextures: skip texture bind + DrawFeature(miscState.pipFeatures[i], true) -- noTextures: skip texture bind end -- Restore gl.ColorMask(true, true, true, true) @@ -11923,7 +12378,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- Draw projectiles if enabled if config.drawProjectiles and gameHasStarted then - glFunc.Texture(false) -- Disable textures for colored projectiles + glFunc.Texture(false) -- Disable textures for colored projectiles gl.Blending(true) gl.DepthTest(false) @@ -11937,7 +12392,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- Reuse pool table for active trails tracking (avoid per-frame allocations) local activeTrails = pools.activeTrails -- Clear previous frame's data - for k in pairs(activeTrails) do activeTrails[k] = nil end + for k in pairs(activeTrails) do + activeTrails[k] = nil + end if projectiles then local projectileCount = #projectiles @@ -11952,8 +12409,12 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) if visibleProjEMA < trailThreshold * 0.75 then skipProjectileTrails = false -- Clear stale trail data so we don't get long trails from old positions - for k in pairs(cache.missileTrails) do cache.missileTrails[k] = nil end - for k in pairs(cache.plasmaTrails) do cache.plasmaTrails[k] = nil end + for k in pairs(cache.missileTrails) do + cache.missileTrails[k] = nil + end + for k in pairs(cache.plasmaTrails) do + cache.plasmaTrails[k] = nil + end end else -- Currently drawing: skip when smoothed count exceeds threshold @@ -11991,7 +12452,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) table.sort(radii, sortDescending) minRadius = radii[MAX_PROJECTILES] or 0 -- Clear excess entries - for i = rCount + 1, #radii do radii[i] = nil end + for i = rCount + 1, #radii do + radii[i] = nil + end end -- When LOS view is active, only show projectiles at positions in LOS @@ -12121,9 +12584,16 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) else local selUnits2 = cachedSelectedUnits or Spring.GetSelectedUnits() local set = pools.selectedSet - if not set then set = {}; pools.selectedSet = set end - for k in pairs(set) do set[k] = nil end - for si = 1, #selUnits2 do set[selUnits2[si]] = true end + if not set then + set = {} + pools.selectedSet = set + end + for k in pairs(set) do + set[k] = nil + end + for si = 1, #selUnits2 do + set[selUnits2[si]] = true + end selectedSet = set end iconRadiusZoomDistMult = GL4DrawIcons(checkAllyTeamID, selectedSet, trackingSet) @@ -12144,18 +12614,18 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) local tID = tList[ti] if tID ~= gaiaTeamID and not scavRaptorTeams[tID] then local name - local luaAI = Spring.GetTeamLuaAI(tID) or '' - if luaAI ~= '' then + local luaAI = Spring.GetTeamLuaAI(tID) or "" + if luaAI ~= "" then -- Lua AI team (e.g. Scavengers): use AI display name from game rules - local aiDisplayName = Spring.GetGameRulesParam('ainame_' .. tID) + local aiDisplayName = Spring.GetGameRulesParam("ainame_" .. tID) if aiDisplayName then - name = aiDisplayName .. ' (AI)' + name = aiDisplayName .. " (AI)" else - name = luaAI .. ' (AI)' + name = luaAI .. " (AI)" end - elseif Spring.GetGameRulesParam('ainame_' .. tID) then + elseif Spring.GetGameRulesParam("ainame_" .. tID) then -- Native/C++ AI team (e.g. BARb): no LuaAI, but has ainame_ game rule - name = Spring.GetGameRulesParam('ainame_' .. tID) .. ' (AI)' + name = Spring.GetGameRulesParam("ainame_" .. tID) .. " (AI)" else -- Human player: find the best player on this team -- Prefer active non-spec, fall back to any non-spec (disconnected), then any player @@ -12175,7 +12645,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) end end end - if not name then name = fallbackName end + if not name then + name = fallbackName + end end end if name then @@ -12184,7 +12656,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- Match the nametags widget's ColorIsDark formula for outline color local isDark = (r + g * 1.2 + b * 0.4) < 0.65 local oR, oG, oB = 0, 0, 0 - if isDark then oR, oG, oB = 1, 1, 1 end + if isDark then + oR, oG, oB = 1, 1, 1 + end comNametagCache[tID] = { name = name, r = r, g = g, b = b, oR = oR, oG = oG, oB = oB } else comNametagCache[tID] = nil @@ -12215,8 +12689,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) local localCacheUnitIcon = cache.unitIcon local resScale = render.contentScale or 1 -- Cap icon size for nametag/health bar positioning to match the capped shader icons - local cappedIconRadius = math.min(iconRadiusZoomDistMult, - Spring.GetConfigFloat("MinimapIconScale", 3.5) * (mapInfo.mapSizeX * mapInfo.mapSizeZ / 40000) ^ 0.25 * math.sqrt(0.95) * resScale) + local cappedIconRadius = math.min(iconRadiusZoomDistMult, Spring.GetConfigFloat("MinimapIconScale", 3.5) * (mapInfo.mapSizeX * mapInfo.mapSizeZ / 40000) ^ 0.25 * math.sqrt(0.95) * resScale) -- When unitpics are shown, icons are rendered larger (unitpicSizeMult + borders). -- Precompute the per-icon multiplier and total border size to position nametags correctly. local unitpicsActive = config.showUnitpics and cameraState.targetZoom >= config.unitpicZoomThreshold @@ -12228,7 +12701,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) unitpicBorderTotal = (3 + 4) * cameraState.zoom * distMult * resScale end -- Font size scales with zoom: grows when zoomed in, floors at readable minimum - local zoomFactor = math.sqrt(cameraState.zoom / 0.12) -- 1.0 at threshold, grows with zoom + local zoomFactor = math.sqrt(cameraState.zoom / 0.12) -- 1.0 at threshold, grows with zoom local nametagFontSize = math.max(8, math.floor(11 * resScale * zoomFactor)) -- Fade in over a narrow zoom range so nametags don't pop in local fadeStart = config.comNametagZoomThreshold @@ -12255,91 +12728,91 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) local unitAllyTeam = teamAllyTeamCache[tID] or spFunc.GetTeamAllyTeamID(tID) if unitAllyTeam ~= checkAllyTeamID then local losBits = spFunc.GetUnitLosState(uID, checkAllyTeamID, true) - if not losBits or losBits % 4 < 1 then -- neither LOS (bit 0) nor radar (bit 1) + if not losBits or losBits % 4 < 1 then -- neither LOS (bit 0) nor radar (bit 1) inLos = false -- skip entirely: no icon drawn, so no nametag/health bar else - inLos = losBits % 2 >= 1 -- bit 0 = LOS_INLOS - inRadar = not inLos -- in radar but not LOS + inLos = losBits % 2 >= 1 -- bit 0 = LOS_INLOS + inRadar = not inLos -- in radar but not LOS end end end if inLos or inRadar then - local wx = posX[uID] - if wx then - local cx, cy = WorldToPipCoords(wx, posZ[uID]) - local iconInfo = localCacheUnitIcon[dID] - -- When unitpics are active, use the actual rendered outer edge (icon*sizeMult + borders) - -- instead of the base icon radius, so nametags clear the unitpic frame - local iconHalf - if unitpicsActive then - iconHalf = iconRadiusZoomDistMult * (iconInfo and iconInfo.size or 0.5) * unitpicBaseMult + unitpicBorderTotal - else - iconHalf = cappedIconRadius * (iconInfo and iconInfo.size or 0.5) - end - -- Rotate the icon center to match where the shader placed it - -- Radar wobble must be applied BEFORE rotation to match shader order - if inRadar then - local phase = (uID * 0.37) % 6.2832 - local wobbleAmp = cappedIconRadius * 0.3 - cx = cx + math.sin(gameTime * 3.0 + phase) * wobbleAmp - cy = cy + math.cos(gameTime * 2.7 + phase * 1.3) * wobbleAmp - end - if isRotated then - local dx, dy = cx - rotCX, cy - rotCY - cx = rotCX + dx * rotCos - dy * rotSin - cy = rotCY + dx * rotSin + dy * rotCos - end - -- Draw nametag above icon (always, including radar blips) - local entry = tID and comNametagCache[tID] - -- For scav/raptor commanders: no cache entry, but still show a name - local displayName - if cache.isDecoyCommander[dID] then - if cache.isScavCommander[dID] then - displayName = Spring.I18N('units.scavDecoyCommanderNameTag') + local wx = posX[uID] + if wx then + local cx, cy = WorldToPipCoords(wx, posZ[uID]) + local iconInfo = localCacheUnitIcon[dID] + -- When unitpics are active, use the actual rendered outer edge (icon*sizeMult + borders) + -- instead of the base icon radius, so nametags clear the unitpic frame + local iconHalf + if unitpicsActive then + iconHalf = iconRadiusZoomDistMult * (iconInfo and iconInfo.size or 0.5) * unitpicBaseMult + unitpicBorderTotal else - displayName = Spring.I18N('units.decoyCommanderNameTag') + iconHalf = cappedIconRadius * (iconInfo and iconInfo.size or 0.5) end - elseif cache.isScavCommander[dID] then - displayName = Spring.I18N('units.scavCommanderNameTag') - elseif entry then - displayName = entry.name - end - if displayName then - local nameY = cy + iconHalf + nametagFontSize * 0.35 - if entry then - font:SetTextColor(entry.r, entry.g, entry.b, nametagAlpha) - font:SetOutlineColor(entry.oR, entry.oG, entry.oB, nametagAlpha) - else - -- Fallback color for scav/raptor teams without cache entry - local tc = teamColors[tID] - local r, g, b = tc and tc[1] or 1, tc and tc[2] or 1, tc and tc[3] or 1 - local isDark = (r + g * 1.2 + b * 0.4) < 0.65 - font:SetTextColor(r, g, b, nametagAlpha) - font:SetOutlineColor(isDark and 1 or 0, isDark and 1 or 0, isDark and 1 or 0, nametagAlpha) + -- Rotate the icon center to match where the shader placed it + -- Radar wobble must be applied BEFORE rotation to match shader order + if inRadar then + local phase = (uID * 0.37) % 6.2832 + local wobbleAmp = cappedIconRadius * 0.3 + cx = cx + math.sin(gameTime * 3.0 + phase) * wobbleAmp + cy = cy + math.cos(gameTime * 2.7 + phase * 1.3) * wobbleAmp end - font:Print(displayName, cx, nameY, nametagFontSize, "con") - end - -- Collect health bar data (only when in actual LOS, not radar) - if comHealthBars and inLos then - local hp, maxHP = spFunc.GetUnitHealth(uID) - if hp and maxHP and maxHP > 0 then - local hpFrac = hp / maxHP - if hpFrac < 0.99 then - comHealthCount = comHealthCount + 1 - local hb = comHealthBars[comHealthCount] - if not hb then - hb = {} - comHealthBars[comHealthCount] = hb + if isRotated then + local dx, dy = cx - rotCX, cy - rotCY + cx = rotCX + dx * rotCos - dy * rotSin + cy = rotCY + dx * rotSin + dy * rotCos + end + -- Draw nametag above icon (always, including radar blips) + local entry = tID and comNametagCache[tID] + -- For scav/raptor commanders: no cache entry, but still show a name + local displayName + if cache.isDecoyCommander[dID] then + if cache.isScavCommander[dID] then + displayName = Spring.I18N("units.scavDecoyCommanderNameTag") + else + displayName = Spring.I18N("units.decoyCommanderNameTag") + end + elseif cache.isScavCommander[dID] then + displayName = Spring.I18N("units.scavCommanderNameTag") + elseif entry then + displayName = entry.name + end + if displayName then + local nameY = cy + iconHalf + nametagFontSize * 0.35 + if entry then + font:SetTextColor(entry.r, entry.g, entry.b, nametagAlpha) + font:SetOutlineColor(entry.oR, entry.oG, entry.oB, nametagAlpha) + else + -- Fallback color for scav/raptor teams without cache entry + local tc = teamColors[tID] + local r, g, b = tc and tc[1] or 1, tc and tc[2] or 1, tc and tc[3] or 1 + local isDark = (r + g * 1.2 + b * 0.4) < 0.65 + font:SetTextColor(r, g, b, nametagAlpha) + font:SetOutlineColor(isDark and 1 or 0, isDark and 1 or 0, isDark and 1 or 0, nametagAlpha) + end + font:Print(displayName, cx, nameY, nametagFontSize, "con") + end + -- Collect health bar data (only when in actual LOS, not radar) + if comHealthBars and inLos then + local hp, maxHP = spFunc.GetUnitHealth(uID) + if hp and maxHP and maxHP > 0 then + local hpFrac = hp / maxHP + if hpFrac < 0.99 then + comHealthCount = comHealthCount + 1 + local hb = comHealthBars[comHealthCount] + if not hb then + hb = {} + comHealthBars[comHealthCount] = hb + end + hb.cx = cx + hb.cy = cy + hb.half = iconHalf + hb.frac = hpFrac end - hb.cx = cx - hb.cy = cy - hb.half = iconHalf - hb.frac = hpFrac end end end - end end -- inLos or inRadar end end @@ -12366,7 +12839,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) if hb.frac <= 0.30 then -- Intensity scales from 0.15 at 30% to 0.30 at 0%, blinks via sin wave local urgency = 0.3 + (1 - hb.frac / 0.30) * 0.3 - local blink = (math.sin(gameTime * 11.0) * 0.5 + 0.5) -- 0..1 pulsing + local blink = (math.sin(gameTime * 11.0) * 0.5 + 0.5) -- 0..1 pulsing bgR = 0.11 + urgency * blink end glFunc.Color(bgR, bgG, bgB, 0.8 * nametagAlpha) @@ -12413,16 +12886,16 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) GL4ResetPrimCounts() DrawExplosionOverlay() if gl4Prim.circles.count > 0 then - gl.Blending(GL.SRC_ALPHA, GL.ONE) -- Additive blend + gl.Blending(GL.SRC_ALPHA, GL.ONE) -- Additive blend gl.DepthTest(false) GL4FlushCirclesOnly() - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- Restore + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- Restore end end -- Draw ally cursors - if WG['allycursors'] and WG['allycursors'].getCursor and interactionState.trackingPlayerID then - local cursor, isNotIdle = WG['allycursors'].getCursor(interactionState.trackingPlayerID) + if WG["allycursors"] and WG["allycursors"].getCursor and interactionState.trackingPlayerID then + local cursor, isNotIdle = WG["allycursors"].getCursor(interactionState.trackingPlayerID) if cursor and isNotIdle then local wx, wz = cursor[1], cursor[3] local cx, cy = WorldToPipCoords(wx, wz) @@ -12473,7 +12946,7 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) end -- Draw colored arcs on top - glFunc.Color((r*1.3)+0.66, (g*1.3)+0.66, (b*1.3)+0.66, 1) + glFunc.Color((r * 1.3) + 0.66, (g * 1.3) + 0.66, (b * 1.3) + 0.66, 1) glFunc.LineWidth((render.vsy / 500) * resScale) for _, arc in ipairs(arcs) do pools.scratchArc.start = arc[1] @@ -12509,36 +12982,9 @@ local function DrawUnitsAndFeatures(cachedSelectedUnits) -- Debug echo every 2 seconds if config.showPipTimers and tEnd - perfTimers.lastEchoTime > 2.0 then perfTimers.lastEchoTime = tEnd - Spring.Echo(string.format( - "[PIP%d] total=%.1fms feat=%.2fms proj=%.2fms expl=%.2fms icons=%.2fms items=%d", - pipNumber, - perfTimers.total * 1000, - perfTimers.features * 1000, - perfTimers.projectiles * 1000, - perfTimers.explosions * 1000, - perfTimers.icons * 1000, - perfTimers.itemCount - )) - Spring.Echo(string.format( - " icons: ghost=%.2fms keysort=%.2fms sort=%.2fms process=%.2fms upload=%.2fms draw=%.2fms unitpics=%.2fms vboReuse=%.0f%%", - perfTimers.icGhost * 1000, - perfTimers.icKeysort * 1000, - perfTimers.icSort * 1000, - perfTimers.icProcess * 1000, - perfTimers.icUpload * 1000, - perfTimers.icDraw * 1000, - perfTimers.icUnitpics * 1000, - perfTimers.icVboReuse * 100 - )) - Spring.Echo(string.format( - " process: bldg=%.2fms(%d) slowMob=%.2fms(%d) fastMob=%.2fms(%d)", - perfTimers.icProcBldg * 1000, - perfTimers.icProcBldgN, - perfTimers.icProcSlowMobile * 1000, - perfTimers.icProcSlowMobileN, - perfTimers.icProcMobile * 1000, - perfTimers.icProcMobileN - )) + Spring.Echo(string.format("[PIP%d] total=%.1fms feat=%.2fms proj=%.2fms expl=%.2fms icons=%.2fms items=%d", pipNumber, perfTimers.total * 1000, perfTimers.features * 1000, perfTimers.projectiles * 1000, perfTimers.explosions * 1000, perfTimers.icons * 1000, perfTimers.itemCount)) + Spring.Echo(string.format(" icons: ghost=%.2fms keysort=%.2fms sort=%.2fms process=%.2fms upload=%.2fms draw=%.2fms unitpics=%.2fms vboReuse=%.0f%%", perfTimers.icGhost * 1000, perfTimers.icKeysort * 1000, perfTimers.icSort * 1000, perfTimers.icProcess * 1000, perfTimers.icUpload * 1000, perfTimers.icDraw * 1000, perfTimers.icUnitpics * 1000, perfTimers.icVboReuse * 100)) + Spring.Echo(string.format(" process: bldg=%.2fms(%d) slowMob=%.2fms(%d) fastMob=%.2fms(%d)", perfTimers.icProcBldg * 1000, perfTimers.icProcBldgN, perfTimers.icProcSlowMobile * 1000, perfTimers.icProcSlowMobileN, perfTimers.icProcMobile * 1000, perfTimers.icProcMobileN)) end end @@ -12547,11 +12993,11 @@ local function RenderFrameBackground() -- Render panel at origin without accounting for padding (padding drawn separately) local pipWidth = render.dim.r - render.dim.l local pipHeight = render.dim.t - render.dim.b - glFunc.Color(0.6,0.6,0.6,0.6) + glFunc.Color(0.6, 0.6, 0.6, 0.6) -- Determine which corners to round based on screen edge proximity -- Corners at screen edges should be sharp (0), others rounded (1) - local edgeTolerance = 2 -- Pixels from edge to consider "at edge" + local edgeTolerance = 2 -- Pixels from edge to consider "at edge" local atLeft = render.dim.l <= edgeTolerance local atRight = render.dim.r >= render.vsx - edgeTolerance local atBottom = render.dim.b <= edgeTolerance @@ -12563,7 +13009,7 @@ local function RenderFrameBackground() local br = (atRight or atBottom) and 0 or 1 local bl = (atLeft or atBottom) and 0 or 1 - render.RectRound(0, 0, pipWidth, pipHeight, render.elementCorner*0.4, tl, tr, br, bl) + render.RectRound(0, 0, pipWidth, pipHeight, render.elementCorner * 0.4, tl, tr, br, bl) end -- Helper function to calculate maximize icon rotation angle based on expansion direction @@ -12597,13 +13043,13 @@ local function GetMaximizeIconRotation() -- Default icon points to bottom-left, rotate to point toward expansion: if onLeftSide and onBottomSide then - return 180 -- Bottom-left: expands toward top-right + return 180 -- Bottom-left: expands toward top-right elseif not onLeftSide and onBottomSide then - return 270 -- Bottom-right: expands toward top-left + return 270 -- Bottom-right: expands toward top-left elseif not onLeftSide and not onBottomSide then - return 0 -- Top-right: expands toward bottom-left - else -- onLeftSide and not onBottomSide - return 90 -- Top-left: expands toward bottom-right + return 0 -- Top-right: expands toward bottom-left + else -- onLeftSide and not onBottomSide + return 90 -- Top-left: expands toward bottom-right end end @@ -12639,9 +13085,9 @@ local function RenderFrameButtons() if not isMinimapMode then glFunc.Color(config.panelBorderColorDark) glFunc.Texture(false) - render.RectRound(pipWidth - usedButtonSizeLocal - render.elementPadding, pipHeight - usedButtonSizeLocal - render.elementPadding, pipWidth, pipHeight, render.elementCorner*0.65, 0, 0, 0, 1) + render.RectRound(pipWidth - usedButtonSizeLocal - render.elementPadding, pipHeight - usedButtonSizeLocal - render.elementPadding, pipWidth, pipHeight, render.elementCorner * 0.65, 0, 0, 0, 1) glFunc.Color(config.panelBorderColorLight) - glFunc.Texture('LuaUI/Images/pip/PipShrink.png') + glFunc.Texture("LuaUI/Images/pip/PipShrink.png") -- Rotate icon to point toward shrink position (opposite of expand direction) local rotation = GetMaximizeIconRotation() @@ -12666,14 +13112,16 @@ local function RenderFrameButtons() local aliveTeammates = GetAliveTeammates() local showPlayerTrackButton = isTrackingPlayer or spec or (#aliveTeammates > 0) local visibleButtons = pools.visibleButtons - for k in pairs(visibleButtons) do visibleButtons[k] = nil end + for k in pairs(visibleButtons) do + visibleButtons[k] = nil + end for i = 1, #buttons do local btn = buttons[i] -- In minimap mode, hide move button if configured local skipButton = false if isMinimapMode and config.minimapModeHideMoveResize then -- Skip move button (no command, has PipMove texture) - if btn.tooltipKey == 'ui.pip.move' then + if btn.tooltipKey == "ui.pip.move" then skipButton = true end end @@ -12682,9 +13130,9 @@ local function RenderFrameButtons() -- In minimap mode, skip switch and copy buttons (keep pip_track and pip_trackplayer) -- Allow pip_view for spectators with fullview if isMinimapMode then - if btn.command == 'pip_switch' or btn.command == 'pip_copy' then + if btn.command == "pip_switch" or btn.command == "pip_copy" then skipButton = true - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then local _, fullview = Spring.GetSpectatingState() if not fullview then skipButton = true @@ -12695,31 +13143,31 @@ local function RenderFrameButtons() if not skipButton then -- Show pip_track button if has selection or is tracking units (not in minimap mode) - if btn.command == 'pip_track' then + if btn.command == "pip_track" then if not isMinimapMode and (hasSelection or isTracking) then visibleButtons[#visibleButtons + 1] = btn end -- Show pip_trackplayer button if lockcamera is available or already tracking (hidden during TV) - elseif btn.command == 'pip_trackplayer' then + elseif btn.command == "pip_trackplayer" then if showPlayerTrackButton and not miscState.tvEnabled then visibleButtons[#visibleButtons + 1] = btn end -- Show pip_view button only for spectators - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then if spec then visibleButtons[#visibleButtons + 1] = btn end -- Hide pip_activity in singleplayer, when tracking, or optionally for spectators - elseif btn.command == 'pip_activity' then + elseif btn.command == "pip_activity" then if not isSinglePlayer and not interactionState.trackingPlayerID and not miscState.tvEnabled and not (config.activityFocusHideForSpectators and cameraState.mySpecState) then visibleButtons[#visibleButtons + 1] = btn end -- Show pip_tv button for spectators only (or always if not spectator-only) - elseif btn.command == 'pip_tv' then + elseif btn.command == "pip_tv" then if not config.tvModeSpectatorsOnly or cameraState.mySpecState then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_help' then + elseif btn.command == "pip_help" then visibleButtons[#visibleButtons + 1] = btn else visibleButtons[#visibleButtons + 1] = btn @@ -12730,20 +13178,16 @@ local function RenderFrameButtons() local buttonCount = #visibleButtons glFunc.Color(config.panelBorderColorDark) glFunc.Texture(false) - render.RectRound(0, 0, (buttonCount * usedButtonSizeLocal) + math.floor(render.elementPadding*0.75), usedButtonSizeLocal + math.floor(render.elementPadding*0.75), render.elementCorner*0.65, 0, 1, 0, 0) + render.RectRound(0, 0, (buttonCount * usedButtonSizeLocal) + math.floor(render.elementPadding * 0.75), usedButtonSizeLocal + math.floor(render.elementPadding * 0.75), render.elementCorner * 0.65, 0, 1, 0, 0) local bx = 0 for i = 1, buttonCount do - local isActive = (visibleButtons[i].command == 'pip_track' and interactionState.areTracking) or - (visibleButtons[i].command == 'pip_trackplayer' and interactionState.trackingPlayerID) or - (visibleButtons[i].command == 'pip_view' and state.losViewEnabled) or - (visibleButtons[i].command == 'pip_activity' and miscState.activityFocusEnabled) or - (visibleButtons[i].command == 'pip_tv' and miscState.tvEnabled) + local isActive = (visibleButtons[i].command == "pip_track" and interactionState.areTracking) or (visibleButtons[i].command == "pip_trackplayer" and interactionState.trackingPlayerID) or (visibleButtons[i].command == "pip_view" and state.losViewEnabled) or (visibleButtons[i].command == "pip_activity" and miscState.activityFocusEnabled) or (visibleButtons[i].command == "pip_tv" and miscState.tvEnabled) if isActive then glFunc.Color(config.panelBorderColorLight) glFunc.Texture(false) - render.RectRound(bx, 0, bx + usedButtonSizeLocal, usedButtonSizeLocal, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(bx, 0, bx + usedButtonSizeLocal, usedButtonSizeLocal, render.elementCorner * 0.4, 1, 1, 1, 1) glFunc.Color(config.panelBorderColorDark) else glFunc.Color(config.panelBorderColorLight) @@ -12837,7 +13281,9 @@ end -- If the gadget IS modified and pushing data, those values take priority (gadgetPushed flag). local function UpdateLavaRenderState() local lrs = mapInfo.lavaRenderState - if not lrs or lrs.gadgetPushed then return end -- gadget is handling it + if not lrs or lrs.gadgetPushed then + return + end -- gadget is handling it -- Compute tide-adjusted level (same formula as gadget's GameFrame) local baseLavaLevel = Spring.GetGameRulesParam("lavaLevel") @@ -12861,7 +13307,6 @@ end -- Helper function to draw water and LOS overlays local function DrawWaterAndLOSOverlays() - -- Update lava animation state (tide level + heat distortion) locally each draw frame if mapInfo.isLava then UpdateLavaRenderState() @@ -12915,7 +13360,7 @@ local function DrawWaterAndLOSOverlays() -- Bind heightmap texture gl.UniformInt(gl.GetUniformLocation(shaders.water, "heightTex"), 0) - glFunc.Texture(0, '$heightmap') + glFunc.Texture(0, "$heightmap") -- Bind lava diffuse+emit texture if available if mapInfo.lavaDiffuseEmitTex then gl.UniformInt(gl.GetUniformLocation(shaders.water, "lavaDiffuseTex"), 1) @@ -12932,8 +13377,12 @@ local function DrawWaterAndLOSOverlays() glFunc.BeginEnd(glConst.QUADS, GroundTextureVertices) glFunc.Texture(0, false) - if mapInfo.lavaDiffuseEmitTex then glFunc.Texture(1, false) end - if mapInfo.lavaDistortionTex then glFunc.Texture(2, false) end + if mapInfo.lavaDiffuseEmitTex then + glFunc.Texture(1, false) + end + if mapInfo.lavaDistortionTex then + glFunc.Texture(2, false) + end gl.UseShader(0) end @@ -12968,10 +13417,14 @@ local function DrawWaterAndLOSOverlays() -- Draw full-screen quad with map texture coordinates glFunc.BeginEnd(GL.QUADS, function() - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b); glFunc.Vertex(render.ground.view.l, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b); glFunc.Vertex(render.ground.view.r, render.ground.view.b) - glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t); glFunc.Vertex(render.ground.view.r, render.ground.view.t) - glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t); glFunc.Vertex(render.ground.view.l, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.b) + glFunc.Vertex(render.ground.view.l, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.b) + glFunc.Vertex(render.ground.view.r, render.ground.view.b) + glFunc.TexCoord(render.ground.coord.r, render.ground.coord.t) + glFunc.Vertex(render.ground.view.r, render.ground.view.t) + glFunc.TexCoord(render.ground.coord.l, render.ground.coord.t) + glFunc.Vertex(render.ground.view.l, render.ground.view.t) end) glFunc.Texture(false) @@ -12981,7 +13434,7 @@ local function DrawWaterAndLOSOverlays() gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE_MINUS_SRC_ALPHA) if render.minimapRotation == 0 then - gl.Scissor(false) -- Disable scissor test + gl.Scissor(false) -- Disable scissor test end end end @@ -13000,7 +13453,7 @@ local function DrawMapMarkers() local resScale = render.contentScale or 1 local lineSize = math.floor(4 * render.widgetScale * resScale) -- Scale baseSize based on zoom level (more zoomed out = slightly smaller markers) - local zoomScale = 0.45 + (cameraState.zoom * 0.66) -- Scale between 0.7 and 1.0 + local zoomScale = 0.45 + (cameraState.zoom * 0.66) -- Scale between 0.7 and 1.0 local baseSize = 45 * render.widgetScale * zoomScale * resScale glFunc.Texture(false) @@ -13029,75 +13482,77 @@ local function DrawMapMarkers() local sx, sy = WorldToPipCoords(marker.x, marker.z) -- Expand bounds check to include margin outside the PIP for edge markers - local edgeMargin = (baseSize*1.25) * render.widgetScale + local edgeMargin = (baseSize * 1.25) * render.widgetScale if sx >= render.dim.l - edgeMargin and sx <= render.dim.r + edgeMargin and sy >= render.dim.b - edgeMargin and sy <= render.dim.t + edgeMargin then - -- Calculate rotation based on time (rotate at 180 degrees per second) - local rotation = (age * 180) % 360 - - -- Size animation: elastic burst → bouncy settle → shrink to zero - -- Uses damped oscillation with V-shaped valleys for instant bounce-back - local sizeScale - if age < 2.8 then - -- Damped spring with |cos| waveform: smooth peaks, V-shaped valleys - -- Valleys are angular (derivative discontinuity) so marker snaps back immediately - local A = 12 - local decay = 2.5 - local freq = 1.5 - local wave = 1.5 * math.abs(math.cos(freq * age)) - 1 - sizeScale = 1 + A * math.exp(-decay * age) * wave - if sizeScale < 0.15 then sizeScale = 0.15 end - else - -- Shrink to zero: 1.0x → 0 over remaining 1.2s - local t = (age - 2.8) / 1.2 - sizeScale = math.max(0, 1.0 * (1 - t * t)) -- quadratic ease-in - end - local size = baseSize * sizeScale - - -- Fade out: start fading earlier, slightly faster - local alpha - if marker.fadeStart then - local fadeDur = 0.4 - local fadeAge = currentTime - marker.fadeStart - alpha = math.max(0, 1 - fadeAge / fadeDur) - else - alpha = age < 2.2 and 1 or math.max(0, 1 - (age - 2.2) / 1.8) - end - - -- Use team color, white for spectators, or default yellow - local r, g, b = 1, 1, 0 -- Default yellow - if marker.isSpectator then - r, g, b = 1, 1, 1 -- White for spectators - elseif marker.teamID then - r, g, b = Spring.GetTeamColor(marker.teamID) - end + -- Calculate rotation based on time (rotate at 180 degrees per second) + local rotation = (age * 180) % 360 + + -- Size animation: elastic burst → bouncy settle → shrink to zero + -- Uses damped oscillation with V-shaped valleys for instant bounce-back + local sizeScale + if age < 2.8 then + -- Damped spring with |cos| waveform: smooth peaks, V-shaped valleys + -- Valleys are angular (derivative discontinuity) so marker snaps back immediately + local A = 12 + local decay = 2.5 + local freq = 1.5 + local wave = 1.5 * math.abs(math.cos(freq * age)) - 1 + sizeScale = 1 + A * math.exp(-decay * age) * wave + if sizeScale < 0.15 then + sizeScale = 0.15 + end + else + -- Shrink to zero: 1.0x → 0 over remaining 1.2s + local t = (age - 2.8) / 1.2 + sizeScale = math.max(0, 1.0 * (1 - t * t)) -- quadratic ease-in + end + local size = baseSize * sizeScale + + -- Fade out: start fading earlier, slightly faster + local alpha + if marker.fadeStart then + local fadeDur = 0.4 + local fadeAge = currentTime - marker.fadeStart + alpha = math.max(0, 1 - fadeAge / fadeDur) + else + alpha = age < 2.2 and 1 or math.max(0, 1 - (age - 2.2) / 1.8) + end - -- Draw rotating rectangle - glFunc.PushMatrix() - glFunc.Translate(sx, sy, 0) - glFunc.Rotate(rotation, 0, 0, 1) + -- Use team color, white for spectators, or default yellow + local r, g, b = 1, 1, 0 -- Default yellow + if marker.isSpectator then + r, g, b = 1, 1, 1 -- White for spectators + elseif marker.teamID then + r, g, b = Spring.GetTeamColor(marker.teamID) + end - -- background - glFunc.Color(0, 0, 0, alpha * 0.5) - glFunc.LineWidth(lineSize+2.5) - gl.BeginEnd(GL.LINE_LOOP, function() - glFunc.Vertex(-size, -size) - glFunc.Vertex(size, -size) - glFunc.Vertex(size, size) - glFunc.Vertex(-size, size) - end) - -- colored - glFunc.Color(r*1.15, g*1.15, b*1.15, alpha) - glFunc.LineWidth(lineSize) - gl.BeginEnd(GL.LINE_LOOP, function() - glFunc.Vertex(-size, -size) - glFunc.Vertex(size, -size) - glFunc.Vertex(size, size) - glFunc.Vertex(-size, size) - end) + -- Draw rotating rectangle + glFunc.PushMatrix() + glFunc.Translate(sx, sy, 0) + glFunc.Rotate(rotation, 0, 0, 1) + + -- background + glFunc.Color(0, 0, 0, alpha * 0.5) + glFunc.LineWidth(lineSize + 2.5) + gl.BeginEnd(GL.LINE_LOOP, function() + glFunc.Vertex(-size, -size) + glFunc.Vertex(size, -size) + glFunc.Vertex(size, size) + glFunc.Vertex(-size, size) + end) + -- colored + glFunc.Color(r * 1.15, g * 1.15, b * 1.15, alpha) + glFunc.LineWidth(lineSize) + gl.BeginEnd(GL.LINE_LOOP, function() + glFunc.Vertex(-size, -size) + glFunc.Vertex(size, -size) + glFunc.Vertex(size, size) + glFunc.Vertex(-size, size) + end) - glFunc.PopMatrix() - end - end -- end if shouldDraw + glFunc.PopMatrix() + end + end -- end if shouldDraw i = i + 1 end @@ -13128,12 +13583,11 @@ local function DrawBuildCursorWithRotation() worldTraceX, worldTraceZ = pos[1], pos[3] -- Check if the traced world position is visible in the PIP -- render.world: l=west, r=east, t=north (low Z), b=south (high Z) - if worldTraceX < render.world.l or worldTraceX > render.world.r - or worldTraceZ > render.world.b or worldTraceZ < render.world.t then - return -- World position is outside PIP viewport + if worldTraceX < render.world.l or worldTraceX > render.world.r or worldTraceZ > render.world.b or worldTraceZ < render.world.t then + return -- World position is outside PIP viewport end else - return -- Trace didn't hit ground + return -- Trace didn't hit ground end end @@ -13179,7 +13633,9 @@ local function DrawBuildCursorWithRotation() -- Draw preview icons for all spots in area local mexBuildings = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetMexBuildings() if mexBuildings then - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local selectedUnits = frameSel local mexConstructors = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetMexConstructors() local selectedMex = WG["resource_spot_builder"] and WG["resource_spot_builder"].GetBestExtractorFromBuilders(selectedUnits, mexConstructors, mexBuildings) @@ -13195,7 +13651,7 @@ local function DrawBuildCursorWithRotation() for i = 1, #metalSpots do local spot = metalSpots[i] - local dist = math.sqrt((spot.x - wx)^2 + (spot.z - wz)^2) + local dist = math.sqrt((spot.x - wx) ^ 2 + (spot.z - wz) ^ 2) if dist < radius then local cx, cy = WorldToPipCoords(spot.x, spot.z) glFunc.Color(1, 1, 1, 0.3) @@ -13433,23 +13889,7 @@ local function DrawCameraViewBounds() local camX, camY, camZ = Spring.GetCameraPosition() local dirX, dirY, dirZ = Spring.GetCameraDirection() - local needRebuild = not cache.valid or - math.abs(wcx - (cache.wcx or wcx)) > 1 or - math.abs(wcz - (cache.wcz or wcz)) > 1 or - math.abs(zoom - (cache.zoom or zoom)) > 0.0005 or - math.abs(camX - (cache.camX or camX)) > 0.5 or - math.abs(camY - (cache.camY or camY)) > 0.5 or - math.abs(camZ - (cache.camZ or camZ)) > 0.5 or - math.abs(rotation - (cache.rotation or rotation)) > 0.0005 or - math.abs(dirX - (cache.dirX or dirX)) > 0.0005 or - math.abs(dirY - (cache.dirY or dirY)) > 0.0005 or - math.abs(dirZ - (cache.dirZ or dirZ)) > 0.0005 or - math.abs(render.world.l - (cache.worldL or render.world.l)) > 0.5 or - math.abs(render.world.r - (cache.worldR or render.world.r)) > 0.5 or - math.abs(render.world.b - (cache.worldB or render.world.b)) > 0.5 or - math.abs(render.world.t - (cache.worldT or render.world.t)) > 0.5 or - cache.vsx ~= vsx or cache.vsy ~= vsy or - cache.l ~= render.dim.l or cache.r ~= render.dim.r or cache.b ~= render.dim.b or cache.t ~= render.dim.t + local needRebuild = not cache.valid or math.abs(wcx - (cache.wcx or wcx)) > 1 or math.abs(wcz - (cache.wcz or wcz)) > 1 or math.abs(zoom - (cache.zoom or zoom)) > 0.0005 or math.abs(camX - (cache.camX or camX)) > 0.5 or math.abs(camY - (cache.camY or camY)) > 0.5 or math.abs(camZ - (cache.camZ or camZ)) > 0.5 or math.abs(rotation - (cache.rotation or rotation)) > 0.0005 or math.abs(dirX - (cache.dirX or dirX)) > 0.0005 or math.abs(dirY - (cache.dirY or dirY)) > 0.0005 or math.abs(dirZ - (cache.dirZ or dirZ)) > 0.0005 or math.abs(render.world.l - (cache.worldL or render.world.l)) > 0.5 or math.abs(render.world.r - (cache.worldR or render.world.r)) > 0.5 or math.abs(render.world.b - (cache.worldB or render.world.b)) > 0.5 or math.abs(render.world.t - (cache.worldT or render.world.t)) > 0.5 or cache.vsx ~= vsx or cache.vsy ~= vsy or cache.l ~= render.dim.l or cache.r ~= render.dim.r or cache.b ~= render.dim.b or cache.t ~= render.dim.t local bl_c1x, bl_c1y, bl_c2x, bl_c2y local br_c1x, br_c1y, br_c2x, br_c2y @@ -13470,26 +13910,26 @@ local function DrawCameraViewBounds() -- Intersect screen corner rays with horizontal plane at groundY -- Matches engine's MiniMap::DrawCameraFrustumAndMouseSelection() algorithm: -- t = (groundY - camY) / dirY; if t < 0: t = 1 - t (behind-camera reflection) - local farDist = 50000 -- reference distance for behind-camera projection scaling + local farDist = 50000 -- reference distance for behind-camera projection scaling local negCount = 0 local function screenToGround(sx, sy) local pxDirX, pxDirY, pxDirZ = Spring.GetPixelDir(sx, sy) - -- Compute intersection parameter with groundY plane - -- Use farDist-scaled direction so t=1 means the far reference point (like engine's frustum vert) + -- Compute intersection parameter with groundY plane + -- Use farDist-scaled direction so t=1 means the far reference point (like engine's frustum vert) local scaledDirY = pxDirY * farDist - local t - if math.abs(scaledDirY) < 0.001 then - -- Near-horizontal ray: project to far distance - negCount = negCount + 1 - return camX + pxDirX * farDist, camZ + pxDirZ * farDist - end + local t + if math.abs(scaledDirY) < 0.001 then + -- Near-horizontal ray: project to far distance + negCount = negCount + 1 + return camX + pxDirX * farDist, camZ + pxDirZ * farDist + end - t = (groundY - camY) / scaledDirY - if t < 0 then - negCount = negCount + 1 - t = 1 - t -- engine's behind-camera reflection: project past far reference point - end + t = (groundY - camY) / scaledDirY + if t < 0 then + negCount = negCount + 1 + t = 1 - t -- engine's behind-camera reflection: project past far reference point + end return camX + pxDirX * farDist * t, camZ + pxDirZ * farDist * t end @@ -13505,7 +13945,7 @@ local function DrawCameraViewBounds() -- All 4 corners behind camera: draw small box around camera XZ (matches engine fallback) if negCount >= 4 then - local bias = 16 -- 16 elmos, matches engine's small box + local bias = 16 -- 16 elmos, matches engine's small box bottomLeftX, bottomLeftZ = camX - bias, camZ - bias bottomRightX, bottomRightZ = camX + bias, camZ - bias topRightX, topRightZ = camX + bias, camZ + bias @@ -13524,37 +13964,41 @@ local function DrawCameraViewBounds() -- Apply minimap rotation manually (this function is drawn outside the GL rotation matrix) if rotation ~= 0 then - local centerX = (render.dim.l + render.dim.r) / 2 - local centerY = (render.dim.b + render.dim.t) / 2 - local cosA = math.cos(rotation) - local sinA = math.sin(rotation) - local dx, dy - dx, dy = bl_x - centerX, bl_y - centerY - bl_x, bl_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA - dx, dy = br_x - centerX, br_y - centerY - br_x, br_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA - dx, dy = tr_x - centerX, tr_y - centerY - tr_x, tr_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA - dx, dy = tl_x - centerX, tl_y - centerY - tl_x, tl_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA + local centerX = (render.dim.l + render.dim.r) / 2 + local centerY = (render.dim.b + render.dim.t) / 2 + local cosA = math.cos(rotation) + local sinA = math.sin(rotation) + local dx, dy + dx, dy = bl_x - centerX, bl_y - centerY + bl_x, bl_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA + dx, dy = br_x - centerX, br_y - centerY + br_x, br_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA + dx, dy = tr_x - centerX, tr_y - centerY + tr_x, tr_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA + dx, dy = tl_x - centerX, tl_y - centerY + tl_x, tl_y = centerX + dx * cosA - dy * sinA, centerY + dx * sinA + dy * cosA end -- Round to pixel centers after rotation for crisp screen-space alignment -- OpenGL lines render crisply at half-pixel positions (0.5, 1.5, 2.5, ...) - bl_x = math.floor(bl_x) + 0.5; bl_y = math.floor(bl_y) + 0.5 - br_x = math.floor(br_x) + 0.5; br_y = math.floor(br_y) + 0.5 - tr_x = math.floor(tr_x) + 0.5; tr_y = math.floor(tr_y) + 0.5 - tl_x = math.floor(tl_x) + 0.5; tl_y = math.floor(tl_y) + 0.5 + bl_x = math.floor(bl_x) + 0.5 + bl_y = math.floor(bl_y) + 0.5 + br_x = math.floor(br_x) + 0.5 + br_y = math.floor(br_y) + 0.5 + tr_x = math.floor(tr_x) + 0.5 + tr_y = math.floor(tr_y) + 0.5 + tl_x = math.floor(tl_x) + 0.5 + tl_y = math.floor(tl_y) + 0.5 -- Calculate chamfer size (4 pixels at 1080p, scaled by resolution) local resScale = render.contentScale or 1 local chamfer = 2 * (render.vsy / 1080) * resScale -- Clamp chamfer so it never exceeds 5% of any edge length - local edgeBL_BR = math.sqrt((br_x-bl_x)^2 + (br_y-bl_y)^2) - local edgeBR_TR = math.sqrt((tr_x-br_x)^2 + (tr_y-br_y)^2) - local edgeTR_TL = math.sqrt((tl_x-tr_x)^2 + (tl_y-tr_y)^2) - local edgeTL_BL = math.sqrt((bl_x-tl_x)^2 + (bl_y-tl_y)^2) + local edgeBL_BR = math.sqrt((br_x - bl_x) ^ 2 + (br_y - bl_y) ^ 2) + local edgeBR_TR = math.sqrt((tr_x - br_x) ^ 2 + (tr_y - br_y) ^ 2) + local edgeTR_TL = math.sqrt((tl_x - tr_x) ^ 2 + (tl_y - tr_y) ^ 2) + local edgeTL_BL = math.sqrt((bl_x - tl_x) ^ 2 + (bl_y - tl_y) ^ 2) local minEdge = math.min(edgeBL_BR, edgeBR_TR, edgeTR_TL, edgeTL_BL) chamfer = math.min(chamfer, minEdge * 0.05) @@ -13593,7 +14037,7 @@ local function DrawCameraViewBounds() glFunc.Texture(false) -- Draw dark shadow outline first (thicker, behind the white line) - local shadowHalfW = math.max(0.5, 1.5 * ((vsx+1000) / 3000) * resScale) + local shadowHalfW = math.max(0.5, 1.5 * ((vsx + 1000) / 3000) * resScale) idx = 1 idx = pools.CameraViewAppendEdgeQuad(cvVerts, idx, bl_c1x, bl_c1y, bl_c2x, bl_c2y, shadowHalfW) idx = pools.CameraViewAppendEdgeQuad(cvVerts, idx, bl_c2x, bl_c2y, br_c1x, br_c1y, shadowHalfW) @@ -13608,7 +14052,7 @@ local function DrawCameraViewBounds() glFunc.BeginEnd(GL.QUADS, pools.DrawCameraViewEdgeQuads) -- Draw white line on top - local whiteHalfW = math.max(0.5, 0.65 * ((vsx+1000) / 3000) * resScale) + local whiteHalfW = math.max(0.5, 0.65 * ((vsx + 1000) / 3000) * resScale) idx = 1 idx = pools.CameraViewAppendEdgeQuad(cvVerts, idx, bl_c1x, bl_c1y, bl_c2x, bl_c2y, whiteHalfW) idx = pools.CameraViewAppendEdgeQuad(cvVerts, idx, bl_c2x, bl_c2y, br_c1x, br_c1y, whiteHalfW) @@ -13623,7 +14067,6 @@ local function DrawCameraViewBounds() glFunc.BeginEnd(GL.QUADS, pools.DrawCameraViewEdgeQuads) end - -- Update map ruler texture (must be called OUTSIDE of R2T context) local function UpdateMapRulerTexture() if not gl.R2tHelper then @@ -13635,16 +14078,7 @@ local function UpdateMapRulerTexture() -- Generate cache key with rounding to avoid tiny changes triggering regeneration -- Round world coordinates to nearest 10 units and screen dimensions to nearest 5 pixels - local cacheKey = string.format("%d_%d_%d_%d_%d_%d_%d_%d_%d", - math.floor(render.world.l / 3) * 3, - math.floor(render.world.r / 3) * 3, - math.floor(render.world.t / 3) * 3, - math.floor(render.world.b / 3) * 3, - math.floor(render.dim.l / 3) * 3, - math.floor(render.dim.r / 3) * 3, - math.floor(render.dim.b / 3) * 3, - math.floor(render.dim.t / 3) * 3, - markSize) + local cacheKey = string.format("%d_%d_%d_%d_%d_%d_%d_%d_%d", math.floor(render.world.l / 3) * 3, math.floor(render.world.r / 3) * 3, math.floor(render.world.t / 3) * 3, math.floor(render.world.b / 3) * 3, math.floor(render.dim.l / 3) * 3, math.floor(render.dim.r / 3) * 3, math.floor(render.dim.b / 3) * 3, math.floor(render.dim.t / 3) * 3, markSize) -- Check if texture needs regeneration if pipR2T.rulerCacheKey ~= cacheKey then @@ -13660,216 +14094,218 @@ local function UpdateMapRulerTexture() local pipWidth = render.dim.r - render.dim.l local pipHeight = render.dim.t - render.dim.b - if not pipR2T.rulerTex or math.floor(pipWidth) ~= pipR2T.rulerLastWidth or math.floor(pipHeight) ~= pipR2T.rulerLastHeight then - if pipR2T.rulerTex then - gl.DeleteTexture(pipR2T.rulerTex) - end - pipR2T.rulerTex = gl.CreateTexture(math.floor(pipWidth), math.floor(pipHeight), { - target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, - }) - pipR2T.rulerLastWidth = math.floor(pipWidth) - pipR2T.rulerLastHeight = math.floor(pipHeight) - end - + if not pipR2T.rulerTex or math.floor(pipWidth) ~= pipR2T.rulerLastWidth or math.floor(pipHeight) ~= pipR2T.rulerLastHeight then if pipR2T.rulerTex then - gl.R2tHelper.RenderToTexture(pipR2T.rulerTex, function() - glFunc.Translate(-1, -1, 0) - glFunc.Scale(2 / pipWidth, 2 / pipHeight, 0) + gl.DeleteTexture(pipR2T.rulerTex) + end + pipR2T.rulerTex = gl.CreateTexture(math.floor(pipWidth), math.floor(pipHeight), { + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, + }) + pipR2T.rulerLastWidth = math.floor(pipWidth) + pipR2T.rulerLastHeight = math.floor(pipHeight) + end - -- Create reusable mark pattern display lists if not exist or size changed - if not render.mapRulerMarkDlists.horizontal or render.mapRulerLastMarkSize ~= markSize then - -- Clean up old display lists - if render.mapRulerMarkDlists.horizontal then - for _, dlist in pairs(render.mapRulerMarkDlists.horizontal) do - gl.DeleteList(dlist) - end - for _, dlist in pairs(render.mapRulerMarkDlists.vertical) do - gl.DeleteList(dlist) - end + if pipR2T.rulerTex then + gl.R2tHelper.RenderToTexture(pipR2T.rulerTex, function() + glFunc.Translate(-1, -1, 0) + glFunc.Scale(2 / pipWidth, 2 / pipHeight, 0) + + -- Create reusable mark pattern display lists if not exist or size changed + if not render.mapRulerMarkDlists.horizontal or render.mapRulerLastMarkSize ~= markSize then + -- Clean up old display lists + if render.mapRulerMarkDlists.horizontal then + for _, dlist in pairs(render.mapRulerMarkDlists.horizontal) do + gl.DeleteList(dlist) end + for _, dlist in pairs(render.mapRulerMarkDlists.vertical) do + gl.DeleteList(dlist) + end + end + + render.mapRulerMarkDlists.horizontal = {} + render.mapRulerMarkDlists.vertical = {} - render.mapRulerMarkDlists.horizontal = {} - render.mapRulerMarkDlists.vertical = {} - - -- Create horizontal marks (top/bottom edges) - centered at origin - for i, mult in ipairs({1, 2, 3}) do - local length = markSize * mult - -- Top mark (extends downward from 0) - render.mapRulerMarkDlists.horizontal["top" .. i] = gl.CreateList(function() - glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex(-markSize/2, -length) - glFunc.Vertex(markSize/2, -length) - glFunc.Vertex(markSize/2, 0) - glFunc.Vertex(-markSize/2, 0) - end) + -- Create horizontal marks (top/bottom edges) - centered at origin + for i, mult in ipairs({ 1, 2, 3 }) do + local length = markSize * mult + -- Top mark (extends downward from 0) + render.mapRulerMarkDlists.horizontal["top" .. i] = gl.CreateList(function() + glFunc.BeginEnd(glConst.QUADS, function() + glFunc.Vertex(-markSize / 2, -length) + glFunc.Vertex(markSize / 2, -length) + glFunc.Vertex(markSize / 2, 0) + glFunc.Vertex(-markSize / 2, 0) end) - -- Bottom mark (extends upward from 0) - render.mapRulerMarkDlists.horizontal["bottom" .. i] = gl.CreateList(function() - glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex(-markSize/2, 0) - glFunc.Vertex(markSize/2, 0) - glFunc.Vertex(markSize/2, length) - glFunc.Vertex(-markSize/2, length) - end) + end) + -- Bottom mark (extends upward from 0) + render.mapRulerMarkDlists.horizontal["bottom" .. i] = gl.CreateList(function() + glFunc.BeginEnd(glConst.QUADS, function() + glFunc.Vertex(-markSize / 2, 0) + glFunc.Vertex(markSize / 2, 0) + glFunc.Vertex(markSize / 2, length) + glFunc.Vertex(-markSize / 2, length) end) - end + end) + end - -- Create vertical marks (left/right edges) - centered at origin - for i, mult in ipairs({1, 2, 3}) do - local length = markSize * mult - -- Left mark (extends rightward from 0) - render.mapRulerMarkDlists.vertical["left" .. i] = gl.CreateList(function() - glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex(0, -markSize/2) - glFunc.Vertex(length, -markSize/2) - glFunc.Vertex(length, markSize/2) - glFunc.Vertex(0, markSize/2) - end) + -- Create vertical marks (left/right edges) - centered at origin + for i, mult in ipairs({ 1, 2, 3 }) do + local length = markSize * mult + -- Left mark (extends rightward from 0) + render.mapRulerMarkDlists.vertical["left" .. i] = gl.CreateList(function() + glFunc.BeginEnd(glConst.QUADS, function() + glFunc.Vertex(0, -markSize / 2) + glFunc.Vertex(length, -markSize / 2) + glFunc.Vertex(length, markSize / 2) + glFunc.Vertex(0, markSize / 2) end) - -- Right mark (extends leftward from 0) - render.mapRulerMarkDlists.vertical["right" .. i] = gl.CreateList(function() - glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex(-length, -markSize/2) - glFunc.Vertex(0, -markSize/2) - glFunc.Vertex(0, markSize/2) - glFunc.Vertex(-length, markSize/2) - end) + end) + -- Right mark (extends leftward from 0) + render.mapRulerMarkDlists.vertical["right" .. i] = gl.CreateList(function() + glFunc.BeginEnd(glConst.QUADS, function() + glFunc.Vertex(-length, -markSize / 2) + glFunc.Vertex(0, -markSize / 2) + glFunc.Vertex(0, markSize / 2) + glFunc.Vertex(-length, markSize / 2) end) - end - - render.mapRulerLastMarkSize = markSize + end) end - -- Use fixed ruler spacing - local smallestSpacing = 64 - local mediumSpacing = smallestSpacing * 4 -- 256 - local largestSpacing = smallestSpacing * 16 -- 1024 + render.mapRulerLastMarkSize = markSize + end - -- Get rotation in degrees (0-360) - local rotDeg = 0 - if render.minimapRotation then - rotDeg = (render.minimapRotation * 180 / math.pi) % 360 - end - - -- Determine which world axis maps to screen horizontal/vertical and in which direction - -- Screen Y increases upward, world Z increases downward (south) - -- Screen X increases rightward, world X increases rightward (east) - local horizWorldL, horizWorldR -- World coords at screen left and right - local vertWorldB, vertWorldT -- World coords at screen bottom and top - - if rotDeg >= 315 or rotDeg < 45 then - -- ~0 degrees: X horizontal (normal), Z vertical (flipped) - horizWorldL, horizWorldR = render.world.l, render.world.r - vertWorldB, vertWorldT = render.world.b, render.world.t - elseif rotDeg >= 45 and rotDeg < 135 then - -- ~90 degrees: Z horizontal, X vertical (normal) - horizWorldL, horizWorldR = render.world.t, render.world.b - vertWorldB, vertWorldT = render.world.l, render.world.r - elseif rotDeg >= 135 and rotDeg < 225 then - -- ~180 degrees: X horizontal (flipped), Z vertical (normal) - horizWorldL, horizWorldR = render.world.r, render.world.l - vertWorldB, vertWorldT = render.world.t, render.world.b - else - -- ~270 degrees: Z horizontal, X vertical (flipped) - horizWorldL, horizWorldR = render.world.b, render.world.t - vertWorldB, vertWorldT = render.world.r, render.world.l - end - - local horizWorldRange = horizWorldR - horizWorldL - local vertWorldRange = vertWorldT - vertWorldB - - -- Calculate how many pixels each spacing level would take on screen (per axis) - local hSmallestScreenSpacing = pipWidth * (smallestSpacing / math.abs(horizWorldRange)) - local hMediumScreenSpacing = pipWidth * (mediumSpacing / math.abs(horizWorldRange)) - local hLargestScreenSpacing = pipWidth * (largestSpacing / math.abs(horizWorldRange)) - local vSmallestScreenSpacing = pipHeight * (smallestSpacing / math.abs(vertWorldRange)) - local vMediumScreenSpacing = pipHeight * (mediumSpacing / math.abs(vertWorldRange)) - local vLargestScreenSpacing = pipHeight * (largestSpacing / math.abs(vertWorldRange)) - - -- Show different levels based on screen spacing (per axis) - local hShowSmallest = hSmallestScreenSpacing >= 8 - local hShowMedium = hMediumScreenSpacing >= 8 - local hShowLargest = hLargestScreenSpacing >= 8 - local vShowSmallest = vSmallestScreenSpacing >= 8 - local vShowMedium = vMediumScreenSpacing >= 8 - local vShowLargest = vLargestScreenSpacing >= 8 + -- Use fixed ruler spacing + local smallestSpacing = 64 + local mediumSpacing = smallestSpacing * 4 -- 256 + local largestSpacing = smallestSpacing * 16 -- 1024 - glFunc.Texture(false) - glFunc.Color(1, 1, 1, 0.12) + -- Get rotation in degrees (0-360) + local rotDeg = 0 + if render.minimapRotation then + rotDeg = (render.minimapRotation * 180 / math.pi) % 360 + end + + -- Determine which world axis maps to screen horizontal/vertical and in which direction + -- Screen Y increases upward, world Z increases downward (south) + -- Screen X increases rightward, world X increases rightward (east) + local horizWorldL, horizWorldR -- World coords at screen left and right + local vertWorldB, vertWorldT -- World coords at screen bottom and top + + if rotDeg >= 315 or rotDeg < 45 then + -- ~0 degrees: X horizontal (normal), Z vertical (flipped) + horizWorldL, horizWorldR = render.world.l, render.world.r + vertWorldB, vertWorldT = render.world.b, render.world.t + elseif rotDeg >= 45 and rotDeg < 135 then + -- ~90 degrees: Z horizontal, X vertical (normal) + horizWorldL, horizWorldR = render.world.t, render.world.b + vertWorldB, vertWorldT = render.world.l, render.world.r + elseif rotDeg >= 135 and rotDeg < 225 then + -- ~180 degrees: X horizontal (flipped), Z vertical (normal) + horizWorldL, horizWorldR = render.world.r, render.world.l + vertWorldB, vertWorldT = render.world.t, render.world.b + else + -- ~270 degrees: Z horizontal, X vertical (flipped) + horizWorldL, horizWorldR = render.world.b, render.world.t + vertWorldB, vertWorldT = render.world.r, render.world.l + end + + local horizWorldRange = horizWorldR - horizWorldL + local vertWorldRange = vertWorldT - vertWorldB + + -- Calculate how many pixels each spacing level would take on screen (per axis) + local hSmallestScreenSpacing = pipWidth * (smallestSpacing / math.abs(horizWorldRange)) + local hMediumScreenSpacing = pipWidth * (mediumSpacing / math.abs(horizWorldRange)) + local hLargestScreenSpacing = pipWidth * (largestSpacing / math.abs(horizWorldRange)) + local vSmallestScreenSpacing = pipHeight * (smallestSpacing / math.abs(vertWorldRange)) + local vMediumScreenSpacing = pipHeight * (mediumSpacing / math.abs(vertWorldRange)) + local vLargestScreenSpacing = pipHeight * (largestSpacing / math.abs(vertWorldRange)) + + -- Show different levels based on screen spacing (per axis) + local hShowSmallest = hSmallestScreenSpacing >= 8 + local hShowMedium = hMediumScreenSpacing >= 8 + local hShowLargest = hLargestScreenSpacing >= 8 + local vShowSmallest = vSmallestScreenSpacing >= 8 + local vShowMedium = vMediumScreenSpacing >= 8 + local vShowLargest = vLargestScreenSpacing >= 8 - -- Draw horizontal edge marks (top/bottom of screen) - local startH = math.ceil(math.min(horizWorldL, horizWorldR) / smallestSpacing) * smallestSpacing - local endH = math.max(horizWorldL, horizWorldR) - local h = startH - while h <= endH do - local lsx = (h - horizWorldL) / horizWorldRange * pipWidth - if lsx >= 0 and lsx <= pipWidth then - local is16x = (h % largestSpacing == 0) - local is4x = (h % mediumSpacing == 0) - - local markType - if is16x and hShowLargest then - markType = 3 - elseif is4x and hShowMedium then - markType = 2 - elseif hShowSmallest then - markType = 1 - end + glFunc.Texture(false) + glFunc.Color(1, 1, 1, 0.12) + + -- Draw horizontal edge marks (top/bottom of screen) + local startH = math.ceil(math.min(horizWorldL, horizWorldR) / smallestSpacing) * smallestSpacing + local endH = math.max(horizWorldL, horizWorldR) + local h = startH + while h <= endH do + local lsx = (h - horizWorldL) / horizWorldRange * pipWidth + if lsx >= 0 and lsx <= pipWidth then + local is16x = (h % largestSpacing == 0) + local is4x = (h % mediumSpacing == 0) + + local markType + if is16x and hShowLargest then + markType = 3 + elseif is4x and hShowMedium then + markType = 2 + elseif hShowSmallest then + markType = 1 + end - if markType then - glFunc.PushMatrix() - glFunc.Translate(lsx, pipHeight, 0) - glFunc.CallList(render.mapRulerMarkDlists.horizontal["top" .. markType]) - glFunc.PopMatrix() + if markType then + glFunc.PushMatrix() + glFunc.Translate(lsx, pipHeight, 0) + glFunc.CallList(render.mapRulerMarkDlists.horizontal["top" .. markType]) + glFunc.PopMatrix() - glFunc.PushMatrix() - glFunc.Translate(lsx, 0, 0) - glFunc.CallList(render.mapRulerMarkDlists.horizontal["bottom" .. markType]) - glFunc.PopMatrix() - end + glFunc.PushMatrix() + glFunc.Translate(lsx, 0, 0) + glFunc.CallList(render.mapRulerMarkDlists.horizontal["bottom" .. markType]) + glFunc.PopMatrix() + end + end + h = h + smallestSpacing + end + + -- Draw vertical edge marks (left/right of screen) + local startV = math.ceil(math.min(vertWorldB, vertWorldT) / smallestSpacing) * smallestSpacing + local endV = math.max(vertWorldB, vertWorldT) + local v = startV + while v <= endV do + local lsy = (v - vertWorldB) / vertWorldRange * pipHeight + if lsy >= 0 and lsy <= pipHeight then + local is16x = (v % largestSpacing == 0) + local is4x = (v % mediumSpacing == 0) + + local markType + if is16x and vShowLargest then + markType = 3 + elseif is4x and vShowMedium then + markType = 2 + elseif vShowSmallest then + markType = 1 end - h = h + smallestSpacing - end - - -- Draw vertical edge marks (left/right of screen) - local startV = math.ceil(math.min(vertWorldB, vertWorldT) / smallestSpacing) * smallestSpacing - local endV = math.max(vertWorldB, vertWorldT) - local v = startV - while v <= endV do - local lsy = (v - vertWorldB) / vertWorldRange * pipHeight - if lsy >= 0 and lsy <= pipHeight then - local is16x = (v % largestSpacing == 0) - local is4x = (v % mediumSpacing == 0) - - local markType - if is16x and vShowLargest then - markType = 3 - elseif is4x and vShowMedium then - markType = 2 - elseif vShowSmallest then - markType = 1 - end - if markType then - glFunc.PushMatrix() - glFunc.Translate(0, lsy, 0) - glFunc.CallList(render.mapRulerMarkDlists.vertical["left" .. markType]) - glFunc.PopMatrix() + if markType then + glFunc.PushMatrix() + glFunc.Translate(0, lsy, 0) + glFunc.CallList(render.mapRulerMarkDlists.vertical["left" .. markType]) + glFunc.PopMatrix() - glFunc.PushMatrix() - glFunc.Translate(pipWidth, lsy, 0) - glFunc.CallList(render.mapRulerMarkDlists.vertical["right" .. markType]) - glFunc.PopMatrix() - end + glFunc.PushMatrix() + glFunc.Translate(pipWidth, lsy, 0) + glFunc.CallList(render.mapRulerMarkDlists.vertical["right" .. markType]) + glFunc.PopMatrix() end - v = v + smallestSpacing end + v = v + smallestSpacing + end - glFunc.Color(1, 1, 1, 1) - end, true) + glFunc.Color(1, 1, 1, 1) + end, true) - pipR2T.rulerNeedsUpdate = false - end + pipR2T.rulerNeedsUpdate = false + end end -- Blit the cached map ruler texture (called inside RenderPipContents) @@ -13911,7 +14347,9 @@ end -- The blit positions the oversized quad so the current camera view aligns correctly through the stencil mask. -- Stencil must already be set up to clip to PIP bounds. local function BlitShiftedTexture(tex, texWidth, texHeight, storedWcx, storedWcz, storedZoom, storedRotation) - if not tex then return end + if not tex then + return + end local resScale = config.contentResolutionScale @@ -13969,7 +14407,7 @@ local function RenderCheapLayers() if uiState.drawingGround then -- Validate engine textures are available (may be regenerating after preset change) - local minimapTexInfo = gl.TextureInfo('$minimap') + local minimapTexInfo = gl.TextureInfo("$minimap") if not minimapTexInfo or minimapTexInfo.xsize <= 0 then pipR2T.contentNeedsUpdate = true if render.minimapRotation ~= 0 then @@ -13982,14 +14420,14 @@ local function RenderCheapLayers() glFunc.Color(1, 1, 1, 1) if shaders.minimapShading then gl.UseShader(shaders.minimapShading) - glFunc.Texture(0, '$minimap') - glFunc.Texture(1, '$shading') + glFunc.Texture(0, "$minimap") + glFunc.Texture(1, "$shading") glFunc.BeginEnd(glConst.QUADS, GroundTextureVertices) glFunc.Texture(0, false) glFunc.Texture(1, false) gl.UseShader(0) else - glFunc.Texture('$minimap') + glFunc.Texture("$minimap") glFunc.BeginEnd(glConst.QUADS, GroundTextureVertices) glFunc.Texture(false) end @@ -14010,7 +14448,9 @@ end -- Render the expensive layers (units, features, projectiles, commands, markers, camera bounds) -- Called inside R2T context for the oversized unitsTex local function RenderExpensiveLayers() - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local cachedSelectedUnits = frameSel -- Apply rotation to all content if minimap is rotated @@ -14103,7 +14543,9 @@ end -- Full render for fallback when unitsTex is not available local function RenderPipContents() -- Use frame-cached selected units to avoid redundant API call - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local cachedSelectedUnits = frameSel -- Apply rotation to all content if minimap is rotated @@ -14118,7 +14560,7 @@ local function RenderPipContents() if uiState.drawingGround then -- Validate engine textures are available (may be regenerating after preset change) - local minimapTexInfo = gl.TextureInfo('$minimap') + local minimapTexInfo = gl.TextureInfo("$minimap") if not minimapTexInfo or minimapTexInfo.xsize <= 0 then pipR2T.contentNeedsUpdate = true if render.minimapRotation ~= 0 then @@ -14131,14 +14573,14 @@ local function RenderPipContents() glFunc.Color(1, 1, 1, 1) if shaders.minimapShading then gl.UseShader(shaders.minimapShading) - glFunc.Texture(0, '$minimap') - glFunc.Texture(1, '$shading') + glFunc.Texture(0, "$minimap") + glFunc.Texture(1, "$shading") glFunc.BeginEnd(glConst.QUADS, GroundTextureVertices) glFunc.Texture(0, false) glFunc.Texture(1, false) gl.UseShader(0) else - glFunc.Texture('$minimap') + glFunc.Texture("$minimap") glFunc.BeginEnd(glConst.QUADS, GroundTextureVertices) glFunc.Texture(false) end @@ -14228,7 +14670,7 @@ local function DrawBoxSelection() glFunc.LineWidth(2.0 + 2.5) glFunc.Color(0, 0, 0, 0.12) glFunc.BeginEnd(glConst.QUADS, function() - glFunc.Vertex(minX, minY) + glFunc.Vertex(minX, minY) glFunc.Vertex(maxX, minY) glFunc.Vertex(maxX, maxY) glFunc.Vertex(minX, maxY) @@ -14379,7 +14821,7 @@ local function DrawBuildCursor() end -- Draw placement grid - local xsize = uDef.xsize * 4 -- Convert to elmos (each cell is 8 elmos) + local xsize = uDef.xsize * 4 -- Convert to elmos (each cell is 8 elmos) local zsize = uDef.zsize * 4 -- Adjust for build facing (swap dimensions if rotated 90/270 degrees) @@ -14396,7 +14838,7 @@ local function DrawBuildCursor() local gridBottom = wz + halfZ -- Draw grid cells - local cellSize = 16 -- Each grid cell is 16 elmos (snap grid size) + local cellSize = 16 -- Each grid cell is 16 elmos (snap grid size) glFunc.Texture(false) @@ -14484,9 +14926,7 @@ local function DrawTrackedPlayerName() end -- Check if we need to regenerate the display list (player changed or name changed) - local needsUpdate = pipR2T.playerNameDlist == nil or - pipR2T.playerNameLastPlayerID ~= interactionState.trackingPlayerID or - pipR2T.playerNameLastName ~= playerName + local needsUpdate = pipR2T.playerNameDlist == nil or pipR2T.playerNameLastPlayerID ~= interactionState.trackingPlayerID or pipR2T.playerNameLastName ~= playerName if needsUpdate then -- Clean up old display list @@ -14550,16 +14990,18 @@ local function DrawTrackedPlayerResourceBars() -- Get team resources - this works for spectators viewing any team -- Returns: current, storage, pull, income, expense, share - local metalCur, metalMax, metalPull, metalIncome, metalExpense, metalShare = Spring.GetTeamResources(teamID, 'metal') - local energyCur, energyMax, energyPull, energyIncome, energyExpense, energyShare = Spring.GetTeamResources(teamID, 'energy') + local metalCur, metalMax, metalPull, metalIncome, metalExpense, metalShare = Spring.GetTeamResources(teamID, "metal") + local energyCur, energyMax, energyPull, energyIncome, energyExpense, energyShare = Spring.GetTeamResources(teamID, "energy") if not (metalCur and energyCur) then return end -- Get energy conversion level (mmLevel) - local mmLevel = Spring.GetTeamRulesParam(teamID, 'mmLevel') - if mmLevel == nil then mmLevel = 1 end + local mmLevel = Spring.GetTeamRulesParam(teamID, "mmLevel") + if mmLevel == nil then + mmLevel = 1 + end -- Check if player has teammates (for share slider) local _, _, _, _, _, allyTeamID = Spring.GetTeamInfo(teamID, false) @@ -14571,7 +15013,7 @@ local function DrawTrackedPlayerResourceBars() local pipHeight = render.dim.t - render.dim.b local padding = math.floor(20 * render.widgetScale) * math.max(1, (render.vsx / 2700)) local barHeight = math.floor(math.max(5, 7 * render.widgetScale)) * math.max(1, (render.vsx / 2400)) - local totalBarWidth = math.min(math.floor(pipWidth * 0.32), config.minPanelSize*0.5) -- Each bar is 32% of PIP width + local totalBarWidth = math.min(math.floor(pipWidth * 0.32), config.minPanelSize * 0.5) -- Each bar is 32% of PIP width local gapBetweenBars = math.floor(totalBarWidth * 0.28) -- Position: top of PIP, with padding from edge and corner @@ -14644,7 +15086,7 @@ local function DrawTrackedPlayerResourceBars() -- Share sliders (red, only if player has teammates) if hasTeammates then -- Metal share slider - if metalShare and metalShare < 0.98 then -- default metalShare = 0.99 + if metalShare and metalShare < 0.98 then -- default metalShare = 0.99 local shareX = metalBarLeft + (totalBarWidth * metalShare) glFunc.Color(0.9, 0.2, 0.2, 0.9) local steps = 10 @@ -14690,9 +15132,7 @@ local function DrawTrackedPlayerResourceBars() -- Text rendering - use cached display list, update at ~2 FPS local currentTime = os.clock() - local needsTextUpdate = pipR2T.resbarTextDlist == nil or - pipR2T.resbarTextLastPlayerID ~= interactionState.trackingPlayerID or - (currentTime - pipR2T.resbarTextLastUpdate) >= pipR2T.resbarTextUpdateRate + local needsTextUpdate = pipR2T.resbarTextDlist == nil or pipR2T.resbarTextLastPlayerID ~= interactionState.trackingPlayerID or (currentTime - pipR2T.resbarTextLastUpdate) >= pipR2T.resbarTextUpdateRate if needsTextUpdate then -- Clean up old display list @@ -14759,11 +15199,11 @@ local function DrawTrackedPlayerMinimap() end -- Show for players OR when tracking a player camera OR when hovering OR during activity focus - local showForPlayer = not cameraState.mySpecState -- Show for players - local showForTracking = interactionState.trackingPlayerID ~= nil -- Show when tracking - local showForHover = interactionState.isMouseOverPip -- Show when hovering - local showForActivityFocus = config.activityFocusShowMinimap and miscState.activityFocusActive -- Show during map marker focus - local showForTV = miscState.tvEnabled -- Show during TV mode + local showForPlayer = not cameraState.mySpecState -- Show for players + local showForTracking = interactionState.trackingPlayerID ~= nil -- Show when tracking + local showForHover = interactionState.isMouseOverPip -- Show when hovering + local showForActivityFocus = config.activityFocusShowMinimap and miscState.activityFocusActive -- Show during map marker focus + local showForTV = miscState.tvEnabled -- Show during TV mode -- Hide pip-minimap when the game is over and TV is zooming out to overview (already showing the whole map) if showForTV and (miscState.isGameOver or pipTV.director.effectiveGameOver) then @@ -14804,7 +15244,7 @@ local function DrawTrackedPlayerMinimap() isRotated90 = true end end - local naturalAspect = mapInfo.mapSizeX / mapInfo.mapSizeZ -- true (unrotated) map aspect + local naturalAspect = mapInfo.mapSizeX / mapInfo.mapSizeZ -- true (unrotated) map aspect local mapAspect = isRotated90 and (mapInfo.mapSizeZ / mapInfo.mapSizeX) or naturalAspect local minimapWidth if isRotated90 and naturalAspect > 1 then @@ -14830,26 +15270,26 @@ local function DrawTrackedPlayerMinimap() -- When tracking units, add cornerSize offset; otherwise stick to PIP edge local isTrackingUnits = interactionState.areTracking and #interactionState.areTracking > 0 local cornerSize = isTrackingUnits and math.floor(render.elementCorner * 0.6) or 0 - local borderOffset = isTrackingUnits and 1 or 0 -- Touch the team color border, or snap to edge + local borderOffset = isTrackingUnits and 1 or 0 -- Touch the team color border, or snap to edge local mmLeft, mmBottom, mmRight, mmTop local corner = config.pipMinimapCorner or 1 - if corner == 1 then -- bottom-left + if corner == 1 then -- bottom-left mmLeft = render.dim.l + cornerSize + borderOffset mmBottom = render.dim.b + cornerSize + borderOffset mmRight = mmLeft + minimapWidth mmTop = mmBottom + minimapHeight - elseif corner == 2 then -- bottom-right + elseif corner == 2 then -- bottom-right mmRight = render.dim.r - cornerSize - borderOffset mmBottom = render.dim.b + cornerSize + borderOffset mmLeft = mmRight - minimapWidth mmTop = mmBottom + minimapHeight - elseif corner == 3 then -- top-left + elseif corner == 3 then -- top-left mmLeft = render.dim.l + cornerSize + borderOffset mmTop = render.dim.t - cornerSize - borderOffset mmRight = mmLeft + minimapWidth mmBottom = mmTop - minimapHeight - else -- top-right (4) + else -- top-right (4) mmRight = render.dim.r - cornerSize - borderOffset mmTop = render.dim.t - cornerSize - borderOffset mmLeft = mmRight - minimapWidth @@ -14877,7 +15317,7 @@ local function DrawTrackedPlayerMinimap() local chamferSize = math.floor(minimapHeight * 0.06) glFunc.Color(0, 0, 0, 0.85) - if corner == 1 then -- bottom-left: chamfer top-right + if corner == 1 then -- bottom-left: chamfer top-right glFunc.BeginEnd(GL.POLYGON, function() glFunc.Vertex(mmLeft, mmBottom) glFunc.Vertex(mmRight + 3, mmBottom) @@ -14885,7 +15325,7 @@ local function DrawTrackedPlayerMinimap() glFunc.Vertex(mmRight + 3 - chamferSize, mmTop + 3) glFunc.Vertex(mmLeft, mmTop + 3) end) - elseif corner == 2 then -- bottom-right: chamfer top-left + elseif corner == 2 then -- bottom-right: chamfer top-left glFunc.BeginEnd(GL.POLYGON, function() glFunc.Vertex(mmRight, mmBottom) glFunc.Vertex(mmRight, mmTop + 3) @@ -14893,7 +15333,7 @@ local function DrawTrackedPlayerMinimap() glFunc.Vertex(mmLeft - 3, mmTop + 3 - chamferSize) glFunc.Vertex(mmLeft - 3, mmBottom) end) - elseif corner == 3 then -- top-left: chamfer bottom-right + elseif corner == 3 then -- top-left: chamfer bottom-right glFunc.BeginEnd(GL.POLYGON, function() glFunc.Vertex(mmLeft, mmTop) glFunc.Vertex(mmLeft, mmBottom - 3) @@ -14901,7 +15341,7 @@ local function DrawTrackedPlayerMinimap() glFunc.Vertex(mmRight + 3, mmBottom - 3 + chamferSize) glFunc.Vertex(mmRight + 3, mmTop) end) - else -- top-right: chamfer bottom-left + else -- top-right: chamfer bottom-left glFunc.BeginEnd(GL.POLYGON, function() glFunc.Vertex(mmRight, mmTop) glFunc.Vertex(mmLeft - 3, mmTop) @@ -14914,28 +15354,28 @@ local function DrawTrackedPlayerMinimap() -- Draw border on sides facing PIP center glFunc.Color(0.5, 0.5, 0.5, 0.6) glFunc.LineWidth(1) - if corner == 1 then -- bottom-left: border top+right + if corner == 1 then -- bottom-left: border top+right glFunc.BeginEnd(GL.LINE_STRIP, function() glFunc.Vertex(mmLeft, mmTop + 3) glFunc.Vertex(mmRight + 3 - chamferSize, mmTop + 3) glFunc.Vertex(mmRight + 3, mmTop + 3 - chamferSize) glFunc.Vertex(mmRight + 3, mmBottom) end) - elseif corner == 2 then -- bottom-right: border top+left + elseif corner == 2 then -- bottom-right: border top+left glFunc.BeginEnd(GL.LINE_STRIP, function() glFunc.Vertex(mmRight, mmTop + 3) glFunc.Vertex(mmLeft - 3 + chamferSize, mmTop + 3) glFunc.Vertex(mmLeft - 3, mmTop + 3 - chamferSize) glFunc.Vertex(mmLeft - 3, mmBottom) end) - elseif corner == 3 then -- top-left: border bottom+right + elseif corner == 3 then -- top-left: border bottom+right glFunc.BeginEnd(GL.LINE_STRIP, function() glFunc.Vertex(mmLeft, mmBottom - 3) glFunc.Vertex(mmRight + 3 - chamferSize, mmBottom - 3) glFunc.Vertex(mmRight + 3, mmBottom - 3 + chamferSize) glFunc.Vertex(mmRight + 3, mmTop) end) - else -- top-right: border bottom+left + else -- top-right: border bottom+left glFunc.BeginEnd(GL.LINE_STRIP, function() glFunc.Vertex(mmRight, mmBottom - 3) glFunc.Vertex(mmLeft - 3 + chamferSize, mmBottom - 3) @@ -14952,8 +15392,8 @@ local function DrawTrackedPlayerMinimap() -- so that after rotation it visually fills the container (which has the rotated aspect ratio) local cLeft, cRight, cBottom, cTop, cWidth, cHeight if isRotated90 then - cWidth = minimapHeight -- container height becomes content width (will rotate to visual height) - cHeight = minimapWidth -- container width becomes content height (will rotate to visual width) + cWidth = minimapHeight -- container height becomes content width (will rotate to visual height) + cHeight = minimapWidth -- container width becomes content height (will rotate to visual width) cLeft = mmCenterX - cWidth / 2 cRight = mmCenterX + cWidth / 2 cBottom = mmCenterY - cHeight / 2 @@ -14975,8 +15415,8 @@ local function DrawTrackedPlayerMinimap() glFunc.Color(1, 1, 1, 1) if shaders.minimapShading then gl.UseShader(shaders.minimapShading) - glFunc.Texture(0, '$minimap') - glFunc.Texture(1, '$shading') + glFunc.Texture(0, "$minimap") + glFunc.Texture(1, "$shading") pools.scratchTexQuad.l = cLeft pools.scratchTexQuad.b = cBottom pools.scratchTexQuad.r = cRight @@ -14986,7 +15426,7 @@ local function DrawTrackedPlayerMinimap() glFunc.Texture(1, false) gl.UseShader(0) else - glFunc.Texture('$minimap') + glFunc.Texture("$minimap") pools.scratchTexQuad.l = cLeft pools.scratchTexQuad.b = cBottom pools.scratchTexQuad.r = cRight @@ -15041,7 +15481,7 @@ local function DrawTrackedPlayerMinimap() gl.UniformFloat(gl.GetUniformLocation(shaders.water, "wDiffuseFactor"), mapInfo.waterDiffuseFactor) end gl.UniformInt(gl.GetUniformLocation(shaders.water, "heightTex"), 0) - glFunc.Texture(0, '$heightmap') + glFunc.Texture(0, "$heightmap") if mapInfo.lavaDiffuseEmitTex then gl.UniformInt(gl.GetUniformLocation(shaders.water, "lavaDiffuseTex"), 1) glFunc.Texture(1, mapInfo.lavaDiffuseEmitTex) @@ -15057,8 +15497,12 @@ local function DrawTrackedPlayerMinimap() pools.scratchTexQuad.t = cTop glFunc.BeginEnd(GL.QUADS, DrawTexturedQuad) glFunc.Texture(0, false) - if mapInfo.lavaDiffuseEmitTex then glFunc.Texture(1, false) end - if mapInfo.lavaDistortionTex then glFunc.Texture(2, false) end + if mapInfo.lavaDiffuseEmitTex then + glFunc.Texture(1, false) + end + if mapInfo.lavaDistortionTex then + glFunc.Texture(2, false) + end gl.UseShader(0) end @@ -15162,7 +15606,9 @@ local function UpdateR2TFrame(pipWidth, pipHeight) if not pipR2T.frameBackgroundTex then pipR2T.frameBackgroundTex = gl.CreateTexture(bgTexWidth, bgTexHeight, { - target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, }) end if pipR2T.frameBackgroundTex then @@ -15183,7 +15629,9 @@ local function UpdateR2TFrame(pipWidth, pipHeight) if not pipR2T.frameButtonsTex then pipR2T.frameButtonsTex = gl.CreateTexture(math.floor(pipWidth), math.floor(pipHeight), { - target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, }) end if pipR2T.frameButtonsTex then @@ -15199,7 +15647,7 @@ local function UpdateR2TFrame(pipWidth, pipHeight) if pipR2T.frameBackgroundTex then -- Blit the cached UiElement background (includes padding) - gl.R2tHelper.BlendTexRect(pipR2T.frameBackgroundTex, render.dim.l-render.elementPadding, render.dim.b-render.elementPadding, render.dim.r+render.elementPadding, render.dim.t+render.elementPadding, true) + gl.R2tHelper.BlendTexRect(pipR2T.frameBackgroundTex, render.dim.l - render.elementPadding, render.dim.b - render.elementPadding, render.dim.r + render.elementPadding, render.dim.t + render.elementPadding, true) else -- Fallback to direct rendering if texture not available local padL = render.dim.l - render.elementPadding @@ -15322,10 +15770,7 @@ local function UpdateR2TUnits(currentTime, pipUpdateInterval, pipWidth, pipHeigh end local timeSinceLastUpdate = currentTime - pipR2T.unitsLastUpdateTime - local shouldUpdate = pipR2T.unitsNeedsUpdate or rotChanged or driftForced or - (sizeChanged and not uiState.areResizing) or - effectiveUpdateInterval == 0 or - (effectiveUpdateInterval > 0 and timeSinceLastUpdate >= effectiveUpdateInterval) + local shouldUpdate = pipR2T.unitsNeedsUpdate or rotChanged or driftForced or (sizeChanged and not uiState.areResizing) or effectiveUpdateInterval == 0 or (effectiveUpdateInterval > 0 and timeSinceLastUpdate >= effectiveUpdateInterval) -- Force update during refresh grace period (graphics preset change, ViewResize) if pipR2T.forceRefreshFrames > 0 then @@ -15360,7 +15805,9 @@ local function UpdateR2TUnits(currentTime, pipUpdateInterval, pipWidth, pipHeigh -- Create texture if needed if not pipR2T.unitsTex and uW >= 1 and uH >= 1 then pipR2T.unitsTex = gl.CreateTexture(uW, uH, { - target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, }) pipR2T.unitsTexWidth = uW pipR2T.unitsTexHeight = uH @@ -15431,7 +15878,7 @@ local function UpdateR2TCheapLayers(currentTime, pipUpdateInterval, pipWidth, pi if not driftForced then local zoomRatio = cameraState.zoom / pipR2T.contentZoom local safeRatio = 1 / (1 + 2 * margin) - if zoomRatio < safeRatio * 1.1 then -- 10% safety margin + if zoomRatio < safeRatio * 1.1 then -- 10% safety margin driftForced = true end end @@ -15440,10 +15887,7 @@ local function UpdateR2TCheapLayers(currentTime, pipUpdateInterval, pipWidth, pi -- Check if should update based on time -- During resize, sizeChanged defers to throttle instead of forcing immediate update local timeSinceLastUpdate = currentTime - pipR2T.contentLastUpdateTime - local shouldUpdate = pipR2T.contentNeedsUpdate or rotChanged or driftForced or - (sizeChanged and not uiState.areResizing) or - pipUpdateInterval == 0 or - (pipUpdateInterval > 0 and timeSinceLastUpdate >= pipUpdateInterval) + local shouldUpdate = pipR2T.contentNeedsUpdate or rotChanged or driftForced or (sizeChanged and not uiState.areResizing) or pipUpdateInterval == 0 or (pipUpdateInterval > 0 and timeSinceLastUpdate >= pipUpdateInterval) -- Force update during refresh grace period (graphics preset change, ViewResize) if pipR2T.forceRefreshFrames > 0 then @@ -15477,7 +15921,9 @@ local function UpdateR2TCheapLayers(currentTime, pipUpdateInterval, pipWidth, pi -- Create oversized texture if needed if not pipR2T.contentTex and cW >= 1 and cH >= 1 then pipR2T.contentTex = gl.CreateTexture(cW, cH, { - target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, + target = GL.TEXTURE_2D, + format = GL.RGBA, + fbo = true, }) pipR2T.contentTexWidth = cW pipR2T.contentTexHeight = cH @@ -15563,24 +16009,28 @@ end -- Instance data only uploaded when decals are added/removed (not every frame) decalGL4 = { atlasPath = "luaui/images/decals_gl4/decalsgl4_atlas_diffuse.dds", - INSTANCE_STEP = 16, -- floats per instance (4 x vec4) + INSTANCE_STEP = 16, -- floats per instance (4 x vec4) MAX_INSTANCES = 16384, vbo = nil, vao = nil, - instanceData = nil, -- pre-allocated flat float array - instanceCount = 0, -- current number of valid instances - version = -1, -- last usedElements sum (dirty check) + instanceData = nil, -- pre-allocated flat float array + instanceCount = 0, -- current number of valid instances + version = -1, -- last usedElements sum (dirty check) logCount = 0, - uniformLocs = nil, -- cached uniform locations - renderFrame = 0, -- game frame for GPU alpha computation (set before R2T draw) + uniformLocs = nil, -- cached uniform locations + renderFrame = 0, -- game frame for GPU alpha computation (set before R2T draw) useGeometryShader = true, quadVBO = nil, } -- Initialize GL4 decal resources (called during R2T setup) InitGL4Decals = function() - if not gl.GetVAO or not gl.GetVBO then return end - if not shaders.decal then return end + if not gl.GetVAO or not gl.GetVBO then + return + end + if not shaders.decal then + return + end local useGS = decalGL4.useGeometryShader local vbo = gl.GetVBO(GL.ARRAY_BUFFER, true) @@ -15590,17 +16040,17 @@ InitGL4Decals = function() end if useGS then vbo:Define(decalGL4.MAX_INSTANCES, { - {id = 0, name = 'posRot', size = 4}, - {id = 1, name = 'sizeAlpha', size = 4}, - {id = 2, name = 'uvCoords', size = 4}, - {id = 3, name = 'spawnParams', size = 4}, + { id = 0, name = "posRot", size = 4 }, + { id = 1, name = "sizeAlpha", size = 4 }, + { id = 2, name = "uvCoords", size = 4 }, + { id = 3, name = "spawnParams", size = 4 }, }) else vbo:Define(decalGL4.MAX_INSTANCES, { - {id = 1, name = 'posRot', size = 4}, - {id = 2, name = 'sizeAlpha', size = 4}, - {id = 3, name = 'uvCoords', size = 4}, - {id = 4, name = 'spawnParams', size = 4}, + { id = 1, name = "posRot", size = 4 }, + { id = 2, name = "sizeAlpha", size = 4 }, + { id = 3, name = "uvCoords", size = 4 }, + { id = 4, name = "spawnParams", size = 4 }, }) local quadVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) if not quadVBO then @@ -15608,12 +16058,16 @@ InitGL4Decals = function() vbo:Delete() return end - quadVBO:Define(4, {{id = 0, name = 'quadPos', size = 2}}) + quadVBO:Define(4, { { id = 0, name = "quadPos", size = 2 } }) quadVBO:Upload({ - -1.0, -1.0, - 1.0, -1.0, - -1.0, 1.0, - 1.0, 1.0, + -1.0, + -1.0, + 1.0, + -1.0, + -1.0, + 1.0, + 1.0, + 1.0, }) decalGL4.quadVBO = quadVBO end @@ -15622,7 +16076,10 @@ InitGL4Decals = function() if not vao then Spring.Echo("[PIP] GL4 decals: Failed to create VAO") vbo:Delete() - if decalGL4.quadVBO then decalGL4.quadVBO:Delete(); decalGL4.quadVBO = nil end + if decalGL4.quadVBO then + decalGL4.quadVBO:Delete() + decalGL4.quadVBO = nil + end return end if useGS then @@ -15644,7 +16101,7 @@ InitGL4Decals = function() -- Cache uniform locations decalGL4.uniformLocs = { - gameFrame = gl.GetUniformLocation(shaders.decal, "gameFrame"), + gameFrame = gl.GetUniformLocation(shaders.decal, "gameFrame"), invMapSize = gl.GetUniformLocation(shaders.decal, "invMapSize"), } @@ -15653,9 +16110,18 @@ end -- Destroy GL4 decal resources DestroyGL4Decals = function() - if decalGL4.vao then decalGL4.vao:Delete(); decalGL4.vao = nil end - if decalGL4.vbo then decalGL4.vbo:Delete(); decalGL4.vbo = nil end - if decalGL4.quadVBO then decalGL4.quadVBO:Delete(); decalGL4.quadVBO = nil end + if decalGL4.vao then + decalGL4.vao:Delete() + decalGL4.vao = nil + end + if decalGL4.vbo then + decalGL4.vbo:Delete() + decalGL4.vbo = nil + end + if decalGL4.quadVBO then + decalGL4.quadVBO:Delete() + decalGL4.quadVBO = nil + end decalGL4.instanceData = nil decalGL4.instanceCount = 0 decalGL4.version = -1 @@ -15679,7 +16145,9 @@ local function RebuildDecalVBO(vboTables) local used = vbo.usedElements -- Sequential iteration: ~3x faster than pairs() over sparse hash table for idx = 1, used do - if count >= maxInst then break end + if count >= maxInst then + break + end local ofs = (idx - 1) * srcStep local p = srcData[ofs + 5] local s = srcData[ofs + 7] @@ -15687,25 +16155,25 @@ local function RebuildDecalVBO(vboTables) if p and s then local o = count * step -- posRot: worldX, worldZ, rotation, maxalpha - data[o+1] = srcData[ofs + 13] -- posx - data[o+2] = srcData[ofs + 15] -- posz - data[o+3] = srcData[ofs + 3] -- rotation - data[o+4] = srcData[ofs + 4] -- maxalpha + data[o + 1] = srcData[ofs + 13] -- posx + data[o + 2] = srcData[ofs + 15] -- posz + data[o + 3] = srcData[ofs + 3] -- rotation + data[o + 4] = srcData[ofs + 4] -- maxalpha -- sizeAlpha: halfLengthX, halfWidthZ, alphastart, alphadecay - data[o+5] = srcData[ofs + 1] * 0.5 -- half length - data[o+6] = srcData[ofs + 2] * 0.5 -- half width - data[o+7] = srcData[ofs + 9] -- alphastart - data[o+8] = srcData[ofs + 10] -- alphadecay + data[o + 5] = srcData[ofs + 1] * 0.5 -- half length + data[o + 6] = srcData[ofs + 2] * 0.5 -- half width + data[o + 7] = srcData[ofs + 9] -- alphastart + data[o + 8] = srcData[ofs + 10] -- alphadecay -- uvCoords: p, q, s, t - data[o+9] = p - data[o+10] = srcData[ofs + 6] -- q - data[o+11] = s - data[o+12] = srcData[ofs + 8] -- t + data[o + 9] = p + data[o + 10] = srcData[ofs + 6] -- q + data[o + 11] = s + data[o + 12] = srcData[ofs + 8] -- t -- spawnParams: spawnframe, 0, 0, 0 - data[o+13] = srcData[ofs + 16] -- spawnframe - data[o+14] = 0 - data[o+15] = 0 - data[o+16] = 0 + data[o + 13] = srcData[ofs + 16] -- spawnframe + data[o + 14] = 0 + data[o + 15] = 0 + data[o + 16] = 0 count = count + 1 end end @@ -15722,8 +16190,10 @@ end -- Pre-created closure for R2T clear quad (no per-call allocation) local function decalClearQuad() - glFunc.Vertex(-1, -1); glFunc.Vertex(1, -1) - glFunc.Vertex(1, 1); glFunc.Vertex(-1, 1) + glFunc.Vertex(-1, -1) + glFunc.Vertex(1, -1) + glFunc.Vertex(1, 1) + glFunc.Vertex(-1, 1) end -- Pre-created R2T draw function for GL4 decals (no per-call closure allocation) @@ -15737,7 +16207,7 @@ local function decalR2TDraw() if decalGL4.instanceCount > 0 then -- GL_MIN blending: darkest wins, no overlap fringing, alpha stays 1.0 gl.Blending(GL.ONE, GL.ONE) - gl.BlendEquation(0x8007) -- GL_MIN + gl.BlendEquation(0x8007) -- GL_MIN local atlasOK = glFunc.Texture(decalGL4.atlasPath) if atlasOK then @@ -15761,27 +16231,43 @@ local function decalR2TDraw() end local function UpdateDecalTexture() - if not config.drawDecals then return end - if not pipR2T.decalTex then return end - if not decalGL4.vao then return end + if not config.drawDecals then + return + end + if not pipR2T.decalTex then + return + end + if not decalGL4.vao then + return + end -- Rate-limit: only run every N game frames (~1 sec) local frame = Spring.GetGameFrame() - if (frame - pipR2T.decalLastCheckFrame) < pipR2T.decalCheckInterval then return end + if (frame - pipR2T.decalLastCheckFrame) < pipR2T.decalCheckInterval then + return + end pipR2T.decalLastCheckFrame = frame - local decalsAPI = WG['decalsgl4'] - if not decalsAPI then return end + local decalsAPI = WG["decalsgl4"] + if not decalsAPI then + return + end local getVBO = decalsAPI.GetVBOData - if not getVBO then return end + if not getVBO then + return + end local vboTables = getVBO() - if not vboTables then return end + if not vboTables then + return + end -- Always rebuild: usedElements sum can't detect add+remove in same interval -- RebuildDecalVBO is cheap (~0.1ms for 1000 decals: sequential array copy, no alloc) RebuildDecalVBO(vboTables) - if decalGL4.instanceCount == 0 then return end + if decalGL4.instanceCount == 0 then + return + end -- Render into R2T texture: single instanced draw call, GPU computes alpha fade decalGL4.renderFrame = frame @@ -15873,73 +16359,52 @@ local function UpdateLOSTexture(currentTime) if not shaders.los then return end - glFunc.Texture(0, '$info:los') - glFunc.Texture(1, '$info:radar') + glFunc.Texture(0, "$info:los") + glFunc.Texture(1, "$info:radar") - -- Activate shader to convert red channel to greyscale - gl.UseShader(shaders.los) + -- Activate shader to convert red channel to greyscale + gl.UseShader(shaders.los) - -- Update shader uniforms (in case config changed) - gl.UniformFloat(gl.GetUniformLocation(shaders.los, "showRadar"), config.showLosRadar and 1.0 or 0.0) + -- Update shader uniforms (in case config changed) + gl.UniformFloat(gl.GetUniformLocation(shaders.los, "showRadar"), config.showLosRadar and 1.0 or 0.0) - -- Draw full-screen quad in normalized coordinates (-1 to 1) - glFunc.BeginEnd(glConst.QUADS, function() - glFunc.TexCoord(0, 0); glFunc.Vertex(-1, -1) - glFunc.TexCoord(1, 0); glFunc.Vertex(1, -1) - glFunc.TexCoord(1, 1); glFunc.Vertex(1, 1) - glFunc.TexCoord(0, 1); glFunc.Vertex(-1, 1) - end) + -- Draw full-screen quad in normalized coordinates (-1 to 1) + glFunc.BeginEnd(glConst.QUADS, function() + glFunc.TexCoord(0, 0) + glFunc.Vertex(-1, -1) + glFunc.TexCoord(1, 0) + glFunc.Vertex(1, -1) + glFunc.TexCoord(1, 1) + glFunc.Vertex(1, 1) + glFunc.TexCoord(0, 1) + glFunc.Vertex(-1, 1) + end) - gl.UseShader(0) - glFunc.Texture(1, false) - glFunc.Texture(0, false) + gl.UseShader(0) + glFunc.Texture(1, false) + glFunc.Texture(0, false) + else + -- Manually generate LOS texture using Spring.IsPosInLos (expensive) + -- Output darkening amounts (matching engine-like additive-bias method) + -- 0 = no darkening (in LOS), positive = darken by that amount + local fogDarken = config.losOverlayOpacity * 0.28 -- Fog darkening amount + local noRadarDarken = fogDarken + config.losOverlayOpacity * 0.1 -- Extra for no-radar areas + local showRadar = config.showLosRadar + + if showRadar then + -- Start with maximum darkening (no LOS, no radar) + gl.Clear(GL.COLOR_BUFFER_BIT, noRadarDarken, noRadarDarken, noRadarDarken, 1) else - -- Manually generate LOS texture using Spring.IsPosInLos (expensive) - -- Output darkening amounts (matching engine-like additive-bias method) - -- 0 = no darkening (in LOS), positive = darken by that amount - local fogDarken = config.losOverlayOpacity * 0.28 -- Fog darkening amount - local noRadarDarken = fogDarken + config.losOverlayOpacity * 0.1 -- Extra for no-radar areas - local showRadar = config.showLosRadar - - if showRadar then - -- Start with maximum darkening (no LOS, no radar) - gl.Clear(GL.COLOR_BUFFER_BIT, noRadarDarken, noRadarDarken, noRadarDarken, 1) - else - -- No radar display, start with fog darkening - gl.Clear(GL.COLOR_BUFFER_BIT, fogDarken, fogDarken, fogDarken, 1) - end - - local cellSizeX = mapInfo.mapSizeX / losTexWidth - local cellSizeZ = mapInfo.mapSizeZ / losTexHeight + -- No radar display, start with fog darkening + gl.Clear(GL.COLOR_BUFFER_BIT, fogDarken, fogDarken, fogDarken, 1) + end - -- First pass: draw radar areas (moderate darkening) if showRadar enabled - if showRadar then - glFunc.Color(fogDarken, fogDarken, fogDarken, 1) - glFunc.BeginEnd(glConst.QUADS, function() - for y = 0, losTexHeight - 1 do - for x = 0, losTexWidth - 1 do - local worldX = (x + 0.5) * cellSizeX - local worldZ = (y + 0.5) * cellSizeZ - local worldY = spFunc.GetGroundHeight(worldX, worldZ) - - if spFunc.IsPosInRadar(worldX, worldY, worldZ, losAllyTeam) then - local nx1 = (x / losTexWidth) * 2 - 1 - local nx2 = ((x + 1) / losTexWidth) * 2 - 1 - local ny1 = (y / losTexHeight) * 2 - 1 - local ny2 = ((y + 1) / losTexHeight) * 2 - 1 - - glFunc.Vertex(nx1, ny1) - glFunc.Vertex(nx2, ny1) - glFunc.Vertex(nx2, ny2) - glFunc.Vertex(nx1, ny2) - end - end - end - end) - end + local cellSizeX = mapInfo.mapSizeX / losTexWidth + local cellSizeZ = mapInfo.mapSizeZ / losTexHeight - -- Second pass: draw LOS areas (no darkening) - glFunc.Color(0, 0, 0, 1) + -- First pass: draw radar areas (moderate darkening) if showRadar enabled + if showRadar then + glFunc.Color(fogDarken, fogDarken, fogDarken, 1) glFunc.BeginEnd(glConst.QUADS, function() for y = 0, losTexHeight - 1 do for x = 0, losTexWidth - 1 do @@ -15947,7 +16412,7 @@ local function UpdateLOSTexture(currentTime) local worldZ = (y + 0.5) * cellSizeZ local worldY = spFunc.GetGroundHeight(worldX, worldZ) - if spFunc.IsPosInLos(worldX, worldY, worldZ, losAllyTeam) then + if spFunc.IsPosInRadar(worldX, worldY, worldZ, losAllyTeam) then local nx1 = (x / losTexWidth) * 2 - 1 local nx2 = ((x + 1) / losTexWidth) * 2 - 1 local ny1 = (y / losTexHeight) * 2 - 1 @@ -15961,10 +16426,35 @@ local function UpdateLOSTexture(currentTime) end end end) - - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end - end, true) + + -- Second pass: draw LOS areas (no darkening) + glFunc.Color(0, 0, 0, 1) + glFunc.BeginEnd(glConst.QUADS, function() + for y = 0, losTexHeight - 1 do + for x = 0, losTexWidth - 1 do + local worldX = (x + 0.5) * cellSizeX + local worldZ = (y + 0.5) * cellSizeZ + local worldY = spFunc.GetGroundHeight(worldX, worldZ) + + if spFunc.IsPosInLos(worldX, worldY, worldZ, losAllyTeam) then + local nx1 = (x / losTexWidth) * 2 - 1 + local nx2 = ((x + 1) / losTexWidth) * 2 - 1 + local ny1 = (y / losTexHeight) * 2 - 1 + local ny2 = ((y + 1) / losTexHeight) * 2 - 1 + + glFunc.Vertex(nx1, ny1) + glFunc.Vertex(nx2, ny1) + glFunc.Vertex(nx2, ny2) + glFunc.Vertex(nx1, ny2) + end + end + end + end) + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + end + end, true) pipR2T.losLastUpdateTime = currentTime pipR2T.losNeedsUpdate = false @@ -15976,7 +16466,7 @@ local function DrawTrackingIndicators() local lineWidth = math.ceil(2 * (render.vsx / 1920)) local outlineColor = pools.trackingOutlineColor glFunc.Color(1, 1, 1, 0.22) - render.RectRoundOutline(render.dim.l, render.dim.b, render.dim.r, render.dim.t, render.elementCorner*0.5, lineWidth, 1, 1, 1, 1, outlineColor, outlineColor) + render.RectRoundOutline(render.dim.l, render.dim.b, render.dim.r, render.dim.t, render.elementCorner * 0.5, lineWidth, 1, 1, 1, 1, outlineColor, outlineColor) end if interactionState.trackingPlayerID then @@ -15987,7 +16477,7 @@ local function DrawTrackingIndicators() local teamColor = pools.trackingTeamColor teamColor[1], teamColor[2], teamColor[3], teamColor[4] = r, g, b, 0.5 glFunc.Color(r, g, b, 0.5) - render.RectRoundOutline(render.dim.l, render.dim.b, render.dim.r, render.dim.t, render.elementCorner*0.5, lineWidth, 1, 1, 1, 1, teamColor, teamColor) + render.RectRoundOutline(render.dim.l, render.dim.b, render.dim.r, render.dim.t, render.elementCorner * 0.5, lineWidth, 1, 1, 1, 1, teamColor, teamColor) end end end @@ -15999,8 +16489,8 @@ local function HandleHoverAndCursor(mx, my) end if not (interactionState.areBoxSelecting or (mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t)) then - if WG['info'] and WG['info'].clearCustomHover then - WG['info'].clearCustomHover() + if WG["info"] and WG["info"].clearCustomHover then + WG["info"].clearCustomHover() end interactionState.lastHoveredUnitID = nil interactionState.lastHoveredFeatureID = nil @@ -16016,11 +16506,11 @@ local function HandleHoverAndCursor(mx, my) interactionState.lastHoverCursorCheckTime = currentTime -- Update info widget with custom hover - if WG['info'] and WG['info'].setCustomHover then + if WG["info"] and WG["info"].setCustomHover then local wx, wz = PipToWorldCoords(mx, my) local uID = GetUnitAtPoint(wx, wz) if uID then - WG['info'].setCustomHover('unit', uID) + WG["info"].setCustomHover("unit", uID) interactionState.lastHoveredUnitID = uID interactionState.lastHoveredFeatureID = nil else @@ -16028,16 +16518,16 @@ local function HandleHoverAndCursor(mx, my) if cameraState.zoom >= config.zoomFeatures then local fID = GetFeatureAtPoint(wx, wz) if fID then - WG['info'].setCustomHover('feature', fID) + WG["info"].setCustomHover("feature", fID) interactionState.lastHoveredFeatureID = fID interactionState.lastHoveredUnitID = nil else - WG['info'].clearCustomHover() + WG["info"].clearCustomHover() interactionState.lastHoveredUnitID = nil interactionState.lastHoveredFeatureID = nil end else - WG['info'].clearCustomHover() + WG["info"].clearCustomHover() interactionState.lastHoveredUnitID = nil interactionState.lastHoveredFeatureID = nil end @@ -16057,7 +16547,9 @@ local function HandleHoverAndCursor(mx, my) if not defaultCmd or defaultCmd == 0 then if frameSelCount > 0 then - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local selectedUnits = frameSel -- Check if hovering over an enemy unit with units that can attack -- But don't show attack cursor for neutral units @@ -16079,7 +16571,7 @@ local function HandleHoverAndCursor(mx, my) for i = 1, #selectedUnits do local uDefID = spFunc.GetUnitDefID(selectedUnits[i]) if uDefID and cache.canAttack[uDefID] then - Spring.SetMouseCursor('Attack') + Spring.SetMouseCursor("Attack") return end end @@ -16092,7 +16584,7 @@ local function HandleHoverAndCursor(mx, my) -- Check if any transport in selection can load this unit for i = 1, #selectedUnits do if CanTransportLoadUnit(selectedUnits[i], lastHoveredUnitID) then - Spring.SetMouseCursor('Load') + Spring.SetMouseCursor("Load") return end end @@ -16102,14 +16594,14 @@ local function HandleHoverAndCursor(mx, my) for i = 1, #selectedUnits do local uDefID = spFunc.GetUnitDefID(selectedUnits[i]) if uDefID and (cache.canMove[uDefID] or cache.canFly[uDefID]) then - Spring.SetMouseCursor('Move') + Spring.SetMouseCursor("Move") return end end end elseif defaultCmd == CMD.ATTACK and lastHoveredUnitID and not Spring.IsUnitAllied(lastHoveredUnitID) then -- Hovering over enemy unit with units that can attack - Spring.SetMouseCursor('Attack') + Spring.SetMouseCursor("Attack") return end else @@ -16126,35 +16618,37 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) -- Draw pipNumber text only when hovering (and only for pip 2+) if pipNumber > 1 and interactionState.isMouseOverPip then glFunc.Color(config.panelBorderColorDark) - render.RectRound(render.dim.l, render.dim.t - render.usedButtonSize, render.dim.l + render.usedButtonSize, render.dim.t, render.elementCorner*0.4, 0, 0, 1, 0) + render.RectRound(render.dim.l, render.dim.t - render.usedButtonSize, render.dim.l + render.usedButtonSize, render.dim.t, render.elementCorner * 0.4, 0, 0, 1, 0) local fontSize = 14 local padding = 12 font:Begin() font:SetTextColor(0.85, 0.85, 0.85, 1) font:SetOutlineColor(0, 0, 0, 0.5) - font:Print(pipNumber, render.dim.l + padding, render.dim.t - (fontSize*1.15) - padding, fontSize*2, "no") + font:Print(pipNumber, render.dim.l + padding, render.dim.t - (fontSize * 1.15) - padding, fontSize * 2, "no") font:End() end -- Bottom-left buttons hover local hasSelection = frameSelCount > 0 local visibleButtons = pools.visibleButtons - for k in pairs(visibleButtons) do visibleButtons[k] = nil end + for k in pairs(visibleButtons) do + visibleButtons[k] = nil + end for i = 1, #buttons do local btn = buttons[i] -- In minimap mode, hide move button if configured local skipButton = false if isMinimapMode and config.minimapModeHideMoveResize then - if btn.tooltipKey == 'ui.pip.move' then + if btn.tooltipKey == "ui.pip.move" then skipButton = true end end -- In minimap mode, skip switch and copy buttons (keep pip_track and pip_trackplayer) -- Allow pip_view for spectators with fullview if isMinimapMode then - if btn.command == 'pip_switch' or btn.command == 'pip_copy' then + if btn.command == "pip_switch" or btn.command == "pip_copy" then skipButton = true - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then local _, fullview = Spring.GetSpectatingState() if not fullview then skipButton = true @@ -16163,30 +16657,30 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) end if not skipButton then - if btn.command == 'pip_track' then + if btn.command == "pip_track" then if not isMinimapMode and (hasSelection or interactionState.areTracking) then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_trackplayer' then + elseif btn.command == "pip_trackplayer" then local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) local aliveTeammates = GetAliveTeammates(pools.aliveTeammates) if (interactionState.trackingPlayerID or spec or (#aliveTeammates > 0)) and not miscState.tvEnabled then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) if spec then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_activity' then + elseif btn.command == "pip_activity" then if not isSinglePlayer and not interactionState.trackingPlayerID and not miscState.tvEnabled and not (config.activityFocusHideForSpectators and cameraState.mySpecState) then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_tv' then + elseif btn.command == "pip_tv" then if not config.tvModeSpectatorsOnly or cameraState.mySpecState then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_help' then + elseif btn.command == "pip_help" then visibleButtons[#visibleButtons + 1] = btn else visibleButtons[#visibleButtons + 1] = btn @@ -16199,17 +16693,13 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) if config.showButtonsOnHoverOnly and interactionState.isMouseOverPip then glFunc.Color(config.panelBorderColorDark) glFunc.Texture(false) - render.RectRound(render.dim.l, render.dim.b, render.dim.l + (#visibleButtons * render.usedButtonSize) + math.floor(render.elementPadding*0.75), render.dim.b + render.usedButtonSize + math.floor(render.elementPadding*0.75), render.elementCorner, 0, 1, 0, 0) + render.RectRound(render.dim.l, render.dim.b, render.dim.l + (#visibleButtons * render.usedButtonSize) + math.floor(render.elementPadding * 0.75), render.dim.b + render.usedButtonSize + math.floor(render.elementPadding * 0.75), render.elementCorner, 0, 1, 0, 0) local bx = render.dim.l for i = 1, #visibleButtons do - if (visibleButtons[i].command == 'pip_track' and interactionState.areTracking) or - (visibleButtons[i].command == 'pip_trackplayer' and interactionState.trackingPlayerID) or - (visibleButtons[i].command == 'pip_view' and state.losViewEnabled) or - (visibleButtons[i].command == 'pip_activity' and miscState.activityFocusEnabled) or - (visibleButtons[i].command == 'pip_tv' and miscState.tvEnabled) then + if (visibleButtons[i].command == "pip_track" and interactionState.areTracking) or (visibleButtons[i].command == "pip_trackplayer" and interactionState.trackingPlayerID) or (visibleButtons[i].command == "pip_view" and state.losViewEnabled) or (visibleButtons[i].command == "pip_activity" and miscState.activityFocusEnabled) or (visibleButtons[i].command == "pip_tv" and miscState.tvEnabled) then glFunc.Color(config.panelBorderColorLight) glFunc.Texture(false) - render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner * 0.4, 1, 1, 1, 1) glFunc.Color(config.panelBorderColorDark) else glFunc.Color(config.panelBorderColorLight) @@ -16225,43 +16715,35 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) local bx = render.dim.l for i = 1, #visibleButtons do if mx >= bx and mx <= bx + render.usedButtonSize and my >= render.dim.b and my <= render.dim.b + render.usedButtonSize then - if visibleButtons[i].tooltipKey and WG['tooltip'] then + if visibleButtons[i].tooltipKey and WG["tooltip"] then local tooltipKey = visibleButtons[i].tooltipKey if visibleButtons[i].tooltipActiveKey then - if (visibleButtons[i].command == 'pip_track' and interactionState.areTracking) or - (visibleButtons[i].command == 'pip_trackplayer' and interactionState.trackingPlayerID) or - (visibleButtons[i].command == 'pip_view' and state.losViewEnabled) or - (visibleButtons[i].command == 'pip_activity' and miscState.activityFocusEnabled) or - (visibleButtons[i].command == 'pip_tv' and miscState.tvEnabled) then + if (visibleButtons[i].command == "pip_track" and interactionState.areTracking) or (visibleButtons[i].command == "pip_trackplayer" and interactionState.trackingPlayerID) or (visibleButtons[i].command == "pip_view" and state.losViewEnabled) or (visibleButtons[i].command == "pip_activity" and miscState.activityFocusEnabled) or (visibleButtons[i].command == "pip_tv" and miscState.tvEnabled) then tooltipKey = visibleButtons[i].tooltipActiveKey end end -- Generate tooltip with shortcut key on new line if available local tooltipText = Spring.I18N(tooltipKey) -- For help button: append left-click hint only when leftButtonPansCamera is enabled - if visibleButtons[i].command == 'pip_help' and config.leftButtonPansCamera then - tooltipText = tooltipText .. Spring.I18N('ui.pip.help_leftclick') + if visibleButtons[i].command == "pip_help" and config.leftButtonPansCamera then + tooltipText = tooltipText .. Spring.I18N("ui.pip.help_leftclick") end -- Use button's shortcut from getActionHotkey -- In minimap mode, don't show shorcut for track units button local shortcut = nil - local suppressShortcut = isMinimapMode and visibleButtons[i].command == 'pip_track' + local suppressShortcut = isMinimapMode and visibleButtons[i].command == "pip_track" if not suppressShortcut and visibleButtons[i].actionName then shortcut = getActionHotkey(visibleButtons[i].actionName) end if shortcut and shortcut ~= "" then tooltipText = tooltipText .. "\n" .. shortcut end - WG['tooltip'].ShowTooltip('pip'..pipNumber, tooltipText, nil, nil, nil) + WG["tooltip"].ShowTooltip("pip" .. pipNumber, tooltipText, nil, nil, nil) end - glFunc.Color(1,1,1,0.12) + glFunc.Color(1, 1, 1, 0.12) glFunc.Texture(false) - render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner*0.4, 1, 1, 1, 1) - if (visibleButtons[i].command == 'pip_track' and interactionState.areTracking) or - (visibleButtons[i].command == 'pip_trackplayer' and interactionState.trackingPlayerID) or - (visibleButtons[i].command == 'pip_view' and state.losViewEnabled) or - (visibleButtons[i].command == 'pip_activity' and miscState.activityFocusEnabled) or - (visibleButtons[i].command == 'pip_tv' and miscState.tvEnabled) then + render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner * 0.4, 1, 1, 1, 1) + if (visibleButtons[i].command == "pip_track" and interactionState.areTracking) or (visibleButtons[i].command == "pip_trackplayer" and interactionState.trackingPlayerID) or (visibleButtons[i].command == "pip_view" and state.losViewEnabled) or (visibleButtons[i].command == "pip_activity" and miscState.activityFocusEnabled) or (visibleButtons[i].command == "pip_tv" and miscState.tvEnabled) then glFunc.Color(config.panelBorderColorDark) else glFunc.Color(1, 1, 1, 1) @@ -16271,7 +16753,7 @@ local function DrawInteractiveOverlays(mx, my, usedButtonSize) -- Draw hover highlight on top for better visibility glFunc.Color(1, 1, 1, 0.2) glFunc.Texture(false) - render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(bx, render.dim.b, bx + render.usedButtonSize, render.dim.b + render.usedButtonSize, render.elementCorner * 0.4, 1, 1, 1, 1) glFunc.Texture(false) break end @@ -16285,7 +16767,7 @@ function widget:DrawScreen() -- During animation, disable mouse interaction if uiState.isAnimating then - mx, my = -1, -1 -- Force mouse out of bounds during animation + mx, my = -1, -1 -- Force mouse out of bounds during animation end -- In minimap mode, skip all rendering until ViewResize has completed initialization @@ -16331,7 +16813,7 @@ function widget:DrawScreen() local centerX = (btnL + btnR) * 0.5 local centerY = (btnB + btnT) * 0.5 glFunc.Color(config.panelBorderColorLight) - glFunc.Texture('LuaUI/Images/pip/PipExpand.png') + glFunc.Texture("LuaUI/Images/pip/PipExpand.png") glFunc.PushMatrix() glFunc.Translate(centerX, centerY, 0) glFunc.Rotate(rotation, 0, 0, 1) @@ -16342,12 +16824,12 @@ function widget:DrawScreen() -- Hover highlight if mx >= btnL and mx <= btnR and my >= btnB and my <= btnT then - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.minimap_maximize'), nil, nil, nil) + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("pip" .. pipNumber, Spring.I18N("ui.pip.minimap_maximize"), nil, nil, nil) end - glFunc.Color(1,1,1,0.12) + glFunc.Color(1, 1, 1, 0.12) glFunc.Texture(false) - render.RectRound(btnL, btnB, btnR, btnT, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(btnL, btnB, btnR, btnT, render.elementCorner * 0.4, 1, 1, 1, 1) end return @@ -16356,13 +16838,13 @@ function widget:DrawScreen() -- In minimap mode, never show minimized state (skip this whole section) if uiState.inMinMode and not uiState.isAnimating and not isMinimapMode then -- Use display list for minimized mode (static graphics with relative coordinates) - local buttonSize = math.floor(render.usedButtonSize*config.maximizeSizemult) + local buttonSize = math.floor(render.usedButtonSize * config.maximizeSizemult) -- Draw render.UiElement background FIRST (with proper screen coordinates) --render.UiElement(uiState.minModeL-render.elementPadding, uiState.minModeB-render.elementPadding, uiState.minModeL+buttonSize+render.elementPadding, uiState.minModeB+buttonSize+render.elementPadding, 1, 1, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil) -- Then draw icon on top using display list - local offset = render.elementPadding + 2 -- to prevent touching screen edges and FlowUI Element will remove borders + local offset = render.elementPadding + 2 -- to prevent touching screen edges and FlowUI Element will remove borders -- Check if we need to recreate display list due to position change (affects rotation) local sw, sh = Spring.GetWindowGeometry() @@ -16389,11 +16871,11 @@ function widget:DrawScreen() local actualR = uiState.minModeL + buttonSize + render.elementPadding local actualT = uiState.minModeB + buttonSize + render.elementPadding local tl, tr, br, bl = GetChamferedCorners(actualL, actualB, actualR, actualT) - render.UiElement(offset-render.elementPadding, offset-render.elementPadding, offset+buttonSize+render.elementPadding, offset+buttonSize+render.elementPadding, tl, tr, br, bl, nil, nil, nil, nil, nil, nil, nil, nil) + render.UiElement(offset - render.elementPadding, offset - render.elementPadding, offset + buttonSize + render.elementPadding, offset + buttonSize + render.elementPadding, tl, tr, br, bl, nil, nil, nil, nil, nil, nil, nil, nil) -- Draw icon at origin (0,0) - will be transformed to actual position glFunc.Color(config.panelBorderColorLight) - glFunc.Texture('LuaUI/Images/pip/PipExpand.png') + glFunc.Texture("LuaUI/Images/pip/PipExpand.png") -- Rotate icon based on expansion direction local rotation = GetMaximizeIconRotation() @@ -16404,7 +16886,7 @@ function widget:DrawScreen() glFunc.Rotate(rotation, 0, 0, 1) glFunc.Translate(-centerX, -centerY, 0) - glFunc.TexRect(offset, offset, offset+buttonSize, offset+buttonSize) + glFunc.TexRect(offset, offset, offset + buttonSize, offset + buttonSize) glFunc.PopMatrix() glFunc.Texture(false) end) @@ -16412,28 +16894,27 @@ function widget:DrawScreen() -- Apply transform and draw the cached icon at actual position glFunc.PushMatrix() - glFunc.Translate(uiState.minModeL-offset, uiState.minModeB-offset, 0) + glFunc.Translate(uiState.minModeL - offset, uiState.minModeB - offset, 0) glFunc.CallList(render.minModeDlist) glFunc.PopMatrix() -- Draw hover overlay if needed (dynamic) glFunc.Color(config.panelBorderColorDark) glFunc.Texture(false) - if mx >= uiState.minModeL - render.elementPadding and mx <= uiState.minModeL + buttonSize + render.elementPadding and - my >= uiState.minModeB - render.elementPadding and my <= uiState.minModeB + buttonSize + render.elementPadding then - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.tooltip'), nil, nil, nil) + if mx >= uiState.minModeL - render.elementPadding and mx <= uiState.minModeL + buttonSize + render.elementPadding and my >= uiState.minModeB - render.elementPadding and my <= uiState.minModeB + buttonSize + render.elementPadding then + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("pip" .. pipNumber, Spring.I18N("ui.pip.tooltip"), nil, nil, nil) end - glFunc.Color(1,1,1,0.12) + glFunc.Color(1, 1, 1, 0.12) glFunc.Texture(false) - render.RectRound(uiState.minModeL, uiState.minModeB, uiState.minModeL + buttonSize, uiState.minModeB + buttonSize, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(uiState.minModeL, uiState.minModeB, uiState.minModeL + buttonSize, uiState.minModeB + buttonSize, render.elementCorner * 0.4, 1, 1, 1, 1) end return end -- Cache selected units count once per frame (avoids 5+ redundant GetSelectedUnits calls) frameSelCount = spFunc.GetSelectedUnitsCount() - frameSel = nil -- Lazy: full array fetched only when needed + frameSel = nil -- Lazy: full array fetched only when needed HandleHoverAndCursor(mx, my) @@ -16460,13 +16941,8 @@ function widget:DrawScreen() -- Engine minimap fallback: when enabled and fully zoomed out with many units, draw engine minimap instead of PIP ---------------------------------------------------------------------------------------------------- -- Hysteresis: activate at threshold, deactivate at 95% of threshold to avoid flickering - local fallbackUnitThreshold = miscState.engineMinimapActive - and (config.engineMinimapFallbackThreshold * 0.95) - or config.engineMinimapFallbackThreshold - local rawUseEngineMinimapFallback = isMinimapMode and config.engineMinimapFallback - and #miscState.pipUnits > fallbackUnitThreshold - and IsAtMinimumZoom(cameraState.zoom) and IsAtMinimumZoom(cameraState.targetZoom) - and not interactionState.trackingPlayerID and not miscState.tvEnabled + local fallbackUnitThreshold = miscState.engineMinimapActive and (config.engineMinimapFallbackThreshold * 0.95) or config.engineMinimapFallbackThreshold + local rawUseEngineMinimapFallback = isMinimapMode and config.engineMinimapFallback and #miscState.pipUnits > fallbackUnitThreshold and IsAtMinimumZoom(cameraState.zoom) and IsAtMinimumZoom(cameraState.targetZoom) and not interactionState.trackingPlayerID and not miscState.tvEnabled local useEngineMinimapFallback @@ -16498,9 +16974,7 @@ function widget:DrawScreen() miscState.engineMinimapActive = true end -- Always update geometry (handles animation, resize, position changes) - Spring.SendCommands(string.format("minimap geometry %d %d %d %d", - math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), - math.floor(pipWidth), math.floor(pipHeight))) + Spring.SendCommands(string.format("minimap geometry %d %d %d %d", math.floor(render.dim.l), math.floor(render.vsy - render.dim.t), math.floor(pipWidth), math.floor(pipHeight))) -- Apply density-scaled icon size for engine minimap if config.iconDensityScaling and miscState.baseMinimapIconScale then local totalUnits = #miscState.pipUnits @@ -16523,7 +16997,7 @@ function widget:DrawScreen() DrawDecalsOverlay(config.engineMinimapDecalStrength) -- Explosion overlay on engine minimap (stronger than normal PIP overlay) - ExpireExplosions() -- must run here: DrawExplosions (the normal cleanup path) is skipped + ExpireExplosions() -- must run here: DrawExplosions (the normal cleanup path) is skipped if config.engineMinimapExplosionOverlay and config.drawExplosions and #cache.explosions > 0 and gl4Prim.enabled then GL4ResetPrimCounts() local savedAlpha = config.explosionOverlayAlpha @@ -16660,10 +17134,7 @@ function widget:DrawScreen() end -- Update content mask display list if dimensions or position changed - local maskNeedsUpdate = (math.floor(pipWidth) ~= pipR2T.contentMaskLastWidth or - math.floor(pipHeight) ~= pipR2T.contentMaskLastHeight or - math.floor(render.dim.l) ~= pipR2T.contentMaskLastL or - math.floor(render.dim.b) ~= pipR2T.contentMaskLastB) + local maskNeedsUpdate = (math.floor(pipWidth) ~= pipR2T.contentMaskLastWidth or math.floor(pipHeight) ~= pipR2T.contentMaskLastHeight or math.floor(render.dim.l) ~= pipR2T.contentMaskLastL or math.floor(render.dim.b) ~= pipR2T.contentMaskLastB) if maskNeedsUpdate then if pipR2T.contentMaskDlist then gl.DeleteList(pipR2T.contentMaskDlist) @@ -16732,9 +17203,9 @@ function widget:DrawScreen() -- Set up stencil buffer to clip to rounded corners gl.Clear(GL.STENCIL_BUFFER_BIT) gl.StencilTest(true) - gl.StencilFunc(GL.ALWAYS, 1, 0xFF) -- Always pass, write 1 to stencil buffer - gl.StencilOp(GL.KEEP, GL.KEEP, GL.REPLACE) -- Replace stencil value where we draw - gl.ColorMask(false, false, false, false) -- Don't draw to color buffer + gl.StencilFunc(GL.ALWAYS, 1, 0xFF) -- Always pass, write 1 to stencil buffer + gl.StencilOp(GL.KEEP, GL.KEEP, GL.REPLACE) -- Replace stencil value where we draw + gl.ColorMask(false, false, false, false) -- Don't draw to color buffer -- Draw the rounded mask shape into stencil buffer if pipR2T.contentMaskDlist then @@ -16742,26 +17213,24 @@ function widget:DrawScreen() end -- Now draw content only where stencil == 1 - gl.ColorMask(true, true, true, true) -- Enable color writes - gl.StencilFunc(GL.EQUAL, 1, 0xFF) -- Only draw where stencil == 1 - gl.StencilOp(GL.KEEP, GL.KEEP, GL.KEEP) -- Don't modify stencil buffer + gl.ColorMask(true, true, true, true) -- Enable color writes + gl.StencilFunc(GL.EQUAL, 1, 0xFF) -- Only draw where stencil == 1 + gl.StencilOp(GL.KEEP, GL.KEEP, GL.KEEP) -- Don't modify stencil buffer -- Reset GL state — mask drawing dirties color/blending state glFunc.Color(1, 1, 1, 1) - gl.Blending(GL.ONE, GL.ONE_MINUS_SRC_ALPHA) -- Premultiplied alpha: opaque map shows fully, transparent off-map areas pass through + gl.Blending(GL.ONE, GL.ONE_MINUS_SRC_ALPHA) -- Premultiplied alpha: opaque map shows fully, transparent off-map areas pass through -- Blit oversized content texture (cheap layers: ground, water, LOS) with camera shift - BlitShiftedTexture(pipR2T.contentTex, pipR2T.contentTexWidth, pipR2T.contentTexHeight, - pipR2T.contentWcx, pipR2T.contentWcz, pipR2T.contentZoom, pipR2T.contentRotation) + BlitShiftedTexture(pipR2T.contentTex, pipR2T.contentTexWidth, pipR2T.contentTexHeight, pipR2T.contentWcx, pipR2T.contentWcz, pipR2T.contentZoom, pipR2T.contentRotation) -- Blit oversized units texture (expensive layers: units, features, projectiles) -- Uses premultiplied alpha: FBO was rendered with BlendFuncSeparate for correct alpha if pipR2T.unitsTex then gl.Blending(GL.ONE, GL.ONE_MINUS_SRC_ALPHA) - BlitShiftedTexture(pipR2T.unitsTex, pipR2T.unitsTexWidth, pipR2T.unitsTexHeight, - pipR2T.unitsWcx, pipR2T.unitsWcz, pipR2T.unitsZoom, pipR2T.unitsRotation) + BlitShiftedTexture(pipR2T.unitsTex, pipR2T.unitsTexWidth, pipR2T.unitsTexHeight, pipR2T.unitsWcx, pipR2T.unitsWcz, pipR2T.unitsZoom, pipR2T.unitsRotation) end - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- Explicitly restore blend func + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- Explicitly restore blend func -- Blit map ruler directly to screen (not in oversized texture — rulers are edge-fixed) if uiState.drawingGround and config.showMapRuler then @@ -16781,7 +17250,7 @@ function widget:DrawScreen() -- Draw minimap overlays from other widgets (only in minimap mode) -- This is done here in DrawScreen (not in R2T) because matrix manipulation works correctly here - if isMinimapMode and WG['minimap'] and widgetHandler and widgetHandler.DrawInMiniMapList then + if isMinimapMode and WG["minimap"] and widgetHandler and widgetHandler.DrawInMiniMapList then local minimapWidth = render.dim.r - render.dim.l local minimapHeight = render.dim.t - render.dim.b @@ -16792,19 +17261,19 @@ function widget:DrawScreen() gl.Scissor(render.dim.l, render.dim.b, minimapWidth, minimapHeight) -- Set a flag that widgets can check during their DrawInMiniMap - WG['minimap'].isDrawingInPip = true + WG["minimap"].isDrawingInPip = true -- Update module-level upvalues for the minimap API functions (avoids per-frame closures) -- For shaders: pass in world-normalized coords (NOT Y-flipped), shaders do their own flip minimapApi.left = worldL / mapInfo.mapSizeX minimapApi.right = worldR / mapInfo.mapSizeX - minimapApi.bottom = worldB / mapInfo.mapSizeZ -- world Z coords, shader will flip + minimapApi.bottom = worldB / mapInfo.mapSizeZ -- world Z coords, shader will flip minimapApi.top = worldT / mapInfo.mapSizeZ minimapApi.zoom = mapInfo.mapSizeX / (worldR - worldL) -- Expose pre-created functions (no per-frame allocation) - WG['minimap'].getNormalizedVisibleArea = minimapApi.getNormalizedVisibleArea - WG['minimap'].getZoomLevel = minimapApi.getZoomLevel + WG["minimap"].getNormalizedVisibleArea = minimapApi.getNormalizedVisibleArea + WG["minimap"].getZoomLevel = minimapApi.getZoomLevel -- Compute rotation-aware ortho bounds for fixed-function GL widgets. -- Widgets handle rotation themselves via getCurrentMiniMapRotationOption(), @@ -16827,29 +17296,29 @@ function widget:DrawScreen() local visPixelLeft, visPixelRight, visPixelTop, visPixelBottom if rotCategory == 1 then -- 90° - visPixelLeft = worldT / mapInfo.mapSizeZ * minimapWidth - visPixelRight = worldB / mapInfo.mapSizeZ * minimapWidth + visPixelLeft = worldT / mapInfo.mapSizeZ * minimapWidth + visPixelRight = worldB / mapInfo.mapSizeZ * minimapWidth visPixelBottom = worldL / mapInfo.mapSizeX * minimapHeight - visPixelTop = worldR / mapInfo.mapSizeX * minimapHeight + visPixelTop = worldR / mapInfo.mapSizeX * minimapHeight elseif rotCategory == 2 then -- 180° - visPixelLeft = (1 - worldR / mapInfo.mapSizeX) * minimapWidth - visPixelRight = (1 - worldL / mapInfo.mapSizeX) * minimapWidth - visPixelTop = worldB / mapInfo.mapSizeZ * minimapHeight + visPixelLeft = (1 - worldR / mapInfo.mapSizeX) * minimapWidth + visPixelRight = (1 - worldL / mapInfo.mapSizeX) * minimapWidth + visPixelTop = worldB / mapInfo.mapSizeZ * minimapHeight visPixelBottom = worldT / mapInfo.mapSizeZ * minimapHeight elseif rotCategory == 3 then -- 270° - visPixelLeft = (1 - worldB / mapInfo.mapSizeZ) * minimapWidth - visPixelRight = (1 - worldT / mapInfo.mapSizeZ) * minimapWidth + visPixelLeft = (1 - worldB / mapInfo.mapSizeZ) * minimapWidth + visPixelRight = (1 - worldT / mapInfo.mapSizeZ) * minimapWidth visPixelBottom = (1 - worldR / mapInfo.mapSizeX) * minimapHeight - visPixelTop = (1 - worldL / mapInfo.mapSizeX) * minimapHeight + visPixelTop = (1 - worldL / mapInfo.mapSizeX) * minimapHeight else -- 0° (default) - visPixelLeft = worldL / mapInfo.mapSizeX * minimapWidth - visPixelRight = worldR / mapInfo.mapSizeX * minimapWidth - visPixelTop = (1 - worldT / mapInfo.mapSizeZ) * minimapHeight + visPixelLeft = worldL / mapInfo.mapSizeX * minimapWidth + visPixelRight = worldR / mapInfo.mapSizeX * minimapWidth + visPixelTop = (1 - worldT / mapInfo.mapSizeZ) * minimapHeight visPixelBottom = (1 - worldB / mapInfo.mapSizeZ) * minimapHeight end for _, w in ipairs(widgetHandler.DrawInMiniMapList) do - if w ~= widget then -- Don't recursively call ourselves + if w ~= widget then -- Don't recursively call ourselves -- Save current matrices gl.MatrixMode(GL.PROJECTION) glFunc.PushMatrix() @@ -16886,7 +17355,7 @@ function widget:DrawScreen() end -- Clear the flag and disable scissor - WG['minimap'].isDrawingInPip = false + WG["minimap"].isDrawingInPip = false gl.Scissor(false) -- Reset GL state that widgets may have left dirty @@ -16963,16 +17432,16 @@ function widget:DrawScreen() if not (isMinimapMode and config.minimapModeHideMoveResize) then hover = uiState.areResizing or false if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then - if (render.dim.r-mx + my-render.dim.b <= render.usedButtonSize) then + if render.dim.r - mx + my - render.dim.b <= render.usedButtonSize then hover = true - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N('ui.pip.resize'), nil, nil, nil) + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("pip" .. pipNumber, Spring.I18N("ui.pip.resize"), nil, nil, nil) end end end if hover then local mult = mbl and 4.5 or 1.5 - glFunc.Color(config.panelBorderColorDark[1]*mult, config.panelBorderColorDark[2]*mult, config.panelBorderColorDark[3]*mult, 1) + glFunc.Color(config.panelBorderColorDark[1] * mult, config.panelBorderColorDark[2] * mult, config.panelBorderColorDark[3] * mult, 1) glFunc.LineWidth(1.0) glFunc.BeginEnd(glConst.TRIANGLES, ResizeHandleVertices) end @@ -16980,14 +17449,14 @@ function widget:DrawScreen() -- Minimize button hover (show in minimap mode on hover for MinimapMinimize) hover = false - if not isMinimapMode or config.minimapModeShowMinimizeButton then -- In minimap mode, only show if configured + if not isMinimapMode or config.minimapModeShowMinimizeButton then -- In minimap mode, only show if configured if config.showButtonsOnHoverOnly and interactionState.isMouseOverPip then -- Draw minimize button base when showing on hover glFunc.Color(config.panelBorderColorDark) glFunc.Texture(false) render.RectRound(render.dim.r - render.usedButtonSize - render.elementPadding, render.dim.t - render.usedButtonSize - render.elementPadding, render.dim.r, render.dim.t, render.elementCorner, 0, 0, 0, 1) glFunc.Color(config.panelBorderColorLight) - glFunc.Texture('LuaUI/Images/pip/PipShrink.png') + glFunc.Texture("LuaUI/Images/pip/PipShrink.png") -- Rotate icon opposite to maximize direction (points toward shrink position) local rotation = GetMaximizeIconRotation() @@ -17002,17 +17471,16 @@ function widget:DrawScreen() glFunc.PopMatrix() glFunc.Texture(false) end - if mx >= render.dim.r - render.usedButtonSize - render.elementPadding and mx <= render.dim.r - render.elementPadding and - my >= render.dim.t - render.usedButtonSize - render.elementPadding and my <= render.dim.t - render.elementPadding then + if mx >= render.dim.r - render.usedButtonSize - render.elementPadding and mx <= render.dim.r - render.elementPadding and my >= render.dim.t - render.usedButtonSize - render.elementPadding and my <= render.dim.t - render.elementPadding then hover = true - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('pip'..pipNumber, Spring.I18N(isMinimapMode and 'ui.pip.minimap_minimize' or 'ui.pip.minimize'), nil, nil, nil) + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("pip" .. pipNumber, Spring.I18N(isMinimapMode and "ui.pip.minimap_minimize" or "ui.pip.minimize"), nil, nil, nil) end - glFunc.Color(1,1,1,0.12) + glFunc.Color(1, 1, 1, 0.12) glFunc.Texture(false) - render.RectRound(render.dim.r - render.usedButtonSize, render.dim.t - render.usedButtonSize, render.dim.r, render.dim.t, render.elementCorner*0.4, 1, 1, 1, 1) + render.RectRound(render.dim.r - render.usedButtonSize, render.dim.t - render.usedButtonSize, render.dim.r, render.dim.t, render.elementCorner * 0.4, 1, 1, 1, 1) glFunc.Color(1, 1, 1, 1) - glFunc.Texture('LuaUI/Images/pip/PipShrink.png') + glFunc.Texture("LuaUI/Images/pip/PipShrink.png") -- Rotate icon opposite to maximize direction (points toward shrink position) local rotation = GetMaximizeIconRotation() @@ -17062,16 +17530,11 @@ function widget:DrawScreen() font:Begin() font:SetTextColor(0.85, 0.85, 0.85, 1) font:SetOutlineColor(0, 0, 0, 0.5) - local fpsText = string.format("%.0f FPS", pipR2T.contentCurrentUpdateRate)..'\n'..pipR2T.contentDrawTimeAverage + local fpsText = string.format("%.0f FPS", pipR2T.contentCurrentUpdateRate) .. "\n" .. pipR2T.contentDrawTimeAverage if config.showPipTimers then - fpsText = fpsText .. string.format( - "\ntotal %.1fms items %d\nfeat %.2f proj %.2f\nexpl %.2f icons %.2f", - perfTimers.total * 1000, perfTimers.itemCount, - perfTimers.features * 1000, perfTimers.projectiles * 1000, - perfTimers.explosions * 1000, perfTimers.icons * 1000 - ) - end - font:Print(fpsText, render.dim.l + padding, render.dim.t - (fontSize*1.6) - padding, fontSize*2, "no") + fpsText = fpsText .. string.format("\ntotal %.1fms items %d\nfeat %.2f proj %.2f\nexpl %.2f icons %.2f", perfTimers.total * 1000, perfTimers.itemCount, perfTimers.features * 1000, perfTimers.projectiles * 1000, perfTimers.explosions * 1000, perfTimers.icons * 1000) + end + font:Print(fpsText, render.dim.l + padding, render.dim.t - (fontSize * 1.6) - padding, fontSize * 2, "no") font:End() end end @@ -17086,10 +17549,14 @@ end function widget:DrawWorld() -- Skip if fully minimized (no world view to show) - if uiState.inMinMode and not uiState.isAnimating then return end + if uiState.inMinMode and not uiState.isAnimating then + return + end -- In minimap mode, don't draw pip view rectangle in world - if isMinimapMode then return end + if isMinimapMode then + return + end -- Draw rectangle outline in world view marking PIP boundaries if config.showViewRectangleInWorld and not interactionState.trackingPlayerID then @@ -17099,16 +17566,16 @@ function widget:DrawWorld() local cornerSize = 11 local lineWidthMult = 0.66 + (render.vsy / 4000) gl.DepthTest(false) - glFunc.LineWidth(7*lineWidthMult) + glFunc.LineWidth(7 * lineWidthMult) glFunc.Color(0, 0, 0, 0.05) glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l, render.world.r, render.world.b, render.world.t, cornerSize) glFunc.Color(0, 0, 0, 0.015) - glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l+innerLineDist, render.world.r-innerLineDist, render.world.b+innerLineDist, render.world.t-innerLineDist, cornerSize*0.65) - glFunc.LineWidth(2.5*lineWidthMult) + glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l + innerLineDist, render.world.r - innerLineDist, render.world.b + innerLineDist, render.world.t - innerLineDist, cornerSize * 0.65) + glFunc.LineWidth(2.5 * lineWidthMult) glFunc.Color(r, g, b, 0.25) glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l, render.world.r, render.world.b, render.world.t, cornerSize) glFunc.Color(r, g, b, 0.045) - glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l+innerLineDist, render.world.r-innerLineDist, render.world.b-innerLineDist, render.world.t+innerLineDist, cornerSize*0.65) + glFunc.BeginEnd(glConst.LINE_STRIP, DrawGroundBox, render.world.l + innerLineDist, render.world.r - innerLineDist, render.world.b - innerLineDist, render.world.t + innerLineDist, cornerSize * 0.65) end -- Note: Formation lines are not drawn in world view (customformations widget handles this) @@ -17164,11 +17631,16 @@ function widget:DrawWorld() end function widget:DrawInMiniMap(minimapWidth, minimapHeight) - -- In minimap mode, don't draw PIP viewport rectangle on the minimap (we ARE the minimap) - if isMinimapMode then return end - if uiState.inMinMode then return end - if not config.showViewRectangleOnMinimap then return end + if isMinimapMode then + return + end + if uiState.inMinMode then + return + end + if not config.showViewRectangleOnMinimap then + return + end -- Calculate the viewport in world space local wcx, wcz = cameraState.wcx, cameraState.wcz @@ -17264,7 +17736,7 @@ end -- Timer for periodic ghost building cleanup (checks ghosts outside PIP viewport) -- ghostCleanupTimer stored in cache table to avoid a top-level local cache.ghostCleanupTimer = 0 -cache.guishaderWasActive = WG['guishader'] ~= nil +cache.guishaderWasActive = WG["guishader"] ~= nil cache.guishaderCheckTimer = 0 function widget:Update(dt) @@ -17273,7 +17745,7 @@ function widget:Update(dt) cache.guishaderCheckTimer = cache.guishaderCheckTimer + dt if cache.guishaderCheckTimer >= 0.5 then cache.guishaderCheckTimer = 0 - local guishaderActive = WG['guishader'] ~= nil + local guishaderActive = WG["guishader"] ~= nil if guishaderActive and not cache.guishaderWasActive then UpdateGuishaderBlur() end @@ -17339,7 +17811,9 @@ function widget:Update(dt) state.losViewEnabled = false state.losViewAllyTeam = nil if cameraState.mySpecState then - for k in pairs(ghostBuildings) do ghostBuildings[k] = nil end + for k in pairs(ghostBuildings) do + ghostBuildings[k] = nil + end end pipR2T.losNeedsUpdate = true pipR2T.frameNeedsUpdate = true @@ -17366,7 +17840,7 @@ function widget:Update(dt) end if cleanupAllyTeam then cache.ghostCleanupTimer = cache.ghostCleanupTimer + dt - if cache.ghostCleanupTimer >= 1.0 then -- check every 1 second + if cache.ghostCleanupTimer >= 1.0 then -- check every 1 second cache.ghostCleanupTimer = 0 for gID, ghost in pairs(ghostBuildings) do local curDefID = spFunc.GetUnitDefID(gID) @@ -17390,7 +17864,7 @@ function widget:Update(dt) local dz = uz - ghost.z -- 80 elmos ≈ a few build squares; buildings don't drift, so -- any significant offset means the ID belongs to a new unit. - if dx*dx + dz*dz > 80*80 then + if dx * dx + dz * dz > 80 * 80 then stale = true end end @@ -17420,11 +17894,15 @@ function widget:Update(dt) do local maxGhosts = 4000 local n = 0 - for _ in pairs(ghostBuildings) do n = n + 1 end + for _ in pairs(ghostBuildings) do + n = n + 1 + end if n > maxGhosts then local toDrop = n - maxGhosts for gID in pairs(ghostBuildings) do - if toDrop <= 0 then break end + if toDrop <= 0 then + break + end ghostBuildings[gID] = nil toDrop = toDrop - 1 end @@ -17464,9 +17942,9 @@ function widget:Update(dt) local function getRotationCategory(rot) local rotDeg = math.abs(rot * 180 / math.pi) % 360 if (rotDeg > 80 and rotDeg < 100) or (rotDeg > 260 and rotDeg < 280) then - return 1 -- 90° or 270° + return 1 -- 90° or 270° else - return 0 -- 0° or 180° + return 0 -- 0° or 180° end end @@ -17481,7 +17959,7 @@ function widget:Update(dt) local zoomRatio = cameraState.zoom / oldMin local targetZoomRatio = cameraState.targetZoom / oldMin miscState.minimapCameraRestored = true - widget:ViewResize() -- Recalculates dimensions and minimapModeMinZoom + widget:ViewResize() -- Recalculates dimensions and minimapModeMinZoom -- Apply same ratio to new fitZoom so relative zoom is preserved local newMin = minimapModeMinZoom or oldMin cameraState.zoom = math.max(newMin * zoomRatio, newMin) @@ -17595,11 +18073,11 @@ function widget:Update(dt) gl.SlaveMiniMap(true) -- Update guishader blur: remove when hidden, re-add when shown if wantMinimized then - if WG['guishader'] then - if WG['guishader'].RemoveDlist then - WG['guishader'].RemoveDlist('pip'..pipNumber) - elseif WG['guishader'].RemoveRect then - WG['guishader'].RemoveRect('pip'..pipNumber) + if WG["guishader"] then + if WG["guishader"].RemoveDlist then + WG["guishader"].RemoveDlist("pip" .. pipNumber) + elseif WG["guishader"].RemoveRect then + WG["guishader"].RemoveRect("pip" .. pipNumber) end end else @@ -17649,7 +18127,9 @@ function widget:Update(dt) pipTV.camera.active = false if WG.pipTVFocus then WG.pipTVFocus[pipNumber] = nil - if not next(WG.pipTVFocus) then WG.pipTVFocus = nil end + if not next(WG.pipTVFocus) then + WG.pipTVFocus = nil + end end pipR2T.frameNeedsUpdate = true end @@ -17684,7 +18164,9 @@ function widget:Update(dt) local scanAllyTeam = (state.losViewEnabled and state.losViewAllyTeam) or Spring.GetMyAllyTeamID() -- Mark all existing ghosts for sweep local stale = {} - for gID in pairs(ghostBuildings) do stale[gID] = true end + for gID in pairs(ghostBuildings) do + stale[gID] = true + end local allUnits = Spring.GetAllUnits() for i = 1, #allUnits do local uID = allUnits[i] @@ -17700,12 +18182,15 @@ function widget:Update(dt) -- buildings the allyteam has NEVER seen get swept (not preserved). local losBits = Spring.GetUnitLosState(uID, scanAllyTeam, true) if losBits and (losBits % 2 >= 1 or losBits % 8 >= 4) then - stale[uID] = nil -- seen and still alive, don't sweep + stale[uID] = nil -- seen and still alive, don't sweep local x, _, z = Spring.GetUnitBasePosition(uID) if x then local g = ghostBuildings[uID] if g then - g.defID = defID; g.x = x; g.z = z; g.teamID = uTeam + g.defID = defID + g.x = x + g.z = z + g.teamID = uTeam else ghostBuildings[uID] = { defID = defID, x = x, z = z, teamID = uTeam } end @@ -17736,10 +18221,9 @@ function widget:Update(dt) -- Only check every 0.1 seconds or when mouse moves significantly -- Skip entirely during active zoom for better performance local currentTime = os.clock() - local mouseMoveThreshold = 10 -- pixels - local hoverCheckInterval = 0.1 -- seconds - local mouseMovedSignificantly = math.abs(mx - interactionState.lastHoverCheckX) > mouseMoveThreshold or - math.abs(my - interactionState.lastHoverCheckY) > mouseMoveThreshold + local mouseMoveThreshold = 10 -- pixels + local hoverCheckInterval = 0.1 -- seconds + local mouseMovedSignificantly = math.abs(mx - interactionState.lastHoverCheckX) > mouseMoveThreshold or math.abs(my - interactionState.lastHoverCheckY) > mouseMoveThreshold local shouldCheckHover = (currentTime - interactionState.lastHoverCheckTime) > hoverCheckInterval or mouseMovedSignificantly local isZooming = interactionState.areIncreasingZoom or interactionState.areDecreasingZoom @@ -17753,7 +18237,7 @@ function widget:Update(dt) local unitID = GetUnitAtPoint(wx, wz) -- Only highlight units when there's an active command that can target units - if cmdID and cmdID > 0 then -- Positive cmdID means it's a command (not a build command) + if cmdID and cmdID > 0 then -- Positive cmdID means it's a command (not a build command) -- Don't highlight units for PATROL and FIGHT (they target ground) if cmdID == CMD.PATROL or cmdID == CMD.FIGHT then drawData.hoveredUnitID = nil @@ -17769,7 +18253,7 @@ function widget:Update(dt) -- Commands that can only target allied units elseif cmdID == CMD.GUARD or cmdID == CMD.REPAIR or cmdID == CMD.LOAD_UNITS then isValidTarget = isAlly - -- Commands that work on both allies and enemies are fine (RECLAIM, RESURRECT, RESTORE, etc.) + -- Commands that work on both allies and enemies are fine (RECLAIM, RESURRECT, RESTORE, etc.) end drawData.hoveredUnitID = isValidTarget and unitID or nil @@ -17778,7 +18262,9 @@ function widget:Update(dt) end -- No active command - check if we should highlight for transport loading or attack elseif unitID then - if not frameSel then frameSel = Spring.GetSelectedUnits() end + if not frameSel then + frameSel = Spring.GetSelectedUnits() + end local selectedUnits = frameSel local shouldHighlight = false local isAlly = Spring.IsUnitAllied(unitID) @@ -17839,9 +18325,15 @@ function widget:Update(dt) local currentSelectionCount = frameSelCount local currentTrackingState = interactionState.areTracking ~= nil local currentPlayerTrackingState = interactionState.trackingPlayerID ~= nil - if not lastSelectionCount then lastSelectionCount = 0 end - if not lastTrackingState then lastTrackingState = false end - if not lastPlayerTrackingState then lastPlayerTrackingState = false end + if not lastSelectionCount then + lastSelectionCount = 0 + end + if not lastTrackingState then + lastTrackingState = false + end + if not lastPlayerTrackingState then + lastPlayerTrackingState = false + end if currentSelectionCount ~= lastSelectionCount or currentTrackingState ~= lastTrackingState or currentPlayerTrackingState ~= lastPlayerTrackingState then pipR2T.frameNeedsUpdate = true @@ -17856,10 +18348,10 @@ function widget:Update(dt) drawData.lastSelectionboxEnabled = selectionboxEnabled if selectionboxEnabled then -- Selectionbox widget is now enabled, disable engine's default selection box - Spring.LoadCmdColorsConfig('mouseBoxLineWidth 0') + Spring.LoadCmdColorsConfig("mouseBoxLineWidth 0") else -- Selectionbox widget is now disabled, restore engine's default selection box - Spring.LoadCmdColorsConfig('mouseBoxLineWidth 1.5') + Spring.LoadCmdColorsConfig("mouseBoxLineWidth 1.5") end end @@ -17900,8 +18392,8 @@ function widget:Update(dt) RecoverInvalidAnimationState() else uiState.animationProgress = uiState.animationProgress + (dt / uiState.animationDuration) - pipR2T.contentNeedsUpdate = true -- Update during animation - pipR2T.frameNeedsUpdate = true -- Frame also needs update during animation + pipR2T.contentNeedsUpdate = true -- Update during animation + pipR2T.frameNeedsUpdate = true -- Frame also needs update during animation -- Safety: if animationProgress becomes NaN (e.g. dt or animationDuration is 0/NaN), -- recover immediately so we don't get stuck forever. @@ -17957,7 +18449,7 @@ function widget:Update(dt) -- Recalculate world coordinates for final dimensions RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() - pipR2T.frameNeedsUpdate = true -- Final update after animation + pipR2T.frameNeedsUpdate = true -- Final update after animation -- Update guishader blur after animation completes UpdateGuishaderBlur() end @@ -18005,10 +18497,7 @@ function widget:Update(dt) pipTV.camera.active = false end if miscState.tvEnabled and pipTV.camera.active and not miscState.isGameOver and gameHasStarted then - local userInteracting = interactionState.arePanning - or interactionState.areIncreasingZoom - or interactionState.areDecreasingZoom - or interactionState.isMouseOverPip + local userInteracting = interactionState.arePanning or interactionState.areIncreasingZoom or interactionState.areDecreasingZoom or interactionState.isMouseOverPip if userInteracting then -- Record when user last interacted, don't update TV camera pipTV.camera.lastUserInteraction = os.clock() @@ -18074,7 +18563,7 @@ function widget:Update(dt) cameraState.targetWcz = ClampCameraAxis(cameraState.targetWcz, visibleWorldHeight, mapInfo.mapSizeZ, config.mapEdgeMargin) end - centerNeedsUpdate = true -- Force center update + centerNeedsUpdate = true -- Force center update end if zoomNeedsUpdate or centerNeedsUpdate then @@ -18091,8 +18580,12 @@ function widget:Update(dt) end -- Enforce zoom floor (can go stale after PIP resize / rotation change) local zoomMin = GetEffectiveZoomMin() - if cameraState.zoom < zoomMin then cameraState.zoom = zoomMin end - if cameraState.targetZoom < zoomMin then cameraState.targetZoom = zoomMin end + if cameraState.zoom < zoomMin then + cameraState.zoom = zoomMin + end + if cameraState.targetZoom < zoomMin then + cameraState.targetZoom = zoomMin + end end -- Calculate bounds for CURRENT zoom level @@ -18164,7 +18657,7 @@ function widget:Update(dt) -- Use different smoothness values depending on context local smoothnessToUse = config.centerSmoothness -- Default for zoom-to-cursor and panning if gameOverSlow then - smoothnessToUse = gameOverSlow -- Slow dramatic pan to center during game-over + smoothnessToUse = gameOverSlow -- Slow dramatic pan to center during game-over elseif miscState.isSwitchingViews then smoothnessToUse = config.switchSmoothness -- Fast transition for view switching elseif interactionState.trackingPlayerID then @@ -18317,7 +18810,9 @@ function widget:Update(dt) if newZoom then -- Enforce zoom floor local zoomMin = GetEffectiveZoomMin() - if newZoom < zoomMin then newZoom = zoomMin end + if newZoom < zoomMin then + newZoom = zoomMin + end -- Gentle position clamp at the interpolated zoom level to prevent showing void. -- Use the interpolated zoom (not current) so both axes hit bounds simultaneously. @@ -18333,14 +18828,22 @@ function widget:Update(dt) if minX >= maxX then newWcx = mapInfo.mapSizeX / 2 else - if newWcx < minX then newWcx = minX end - if newWcx > maxX then newWcx = maxX end + if newWcx < minX then + newWcx = minX + end + if newWcx > maxX then + newWcx = maxX + end end if minZ >= maxZ then newWcz = mapInfo.mapSizeZ / 2 else - if newWcz < minZ then newWcz = minZ end - if newWcz > maxZ then newWcz = maxZ end + if newWcz < minZ then + newWcz = minZ + end + if newWcz > maxZ then + newWcz = maxZ + end end -- Directly drive actual camera values (bypass normal smoothing) @@ -18436,7 +18939,7 @@ function widget:Update(dt) local visibleWorldHeight = pipHeight / cameraState.zoom cameraState.wcx = ClampCameraAxis(newX, visibleWorldWidth, mapInfo.mapSizeX, config.mapEdgeMargin) cameraState.wcz = ClampCameraAxis(newZ, visibleWorldHeight, mapInfo.mapSizeZ, config.mapEdgeMargin) - cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Set targets instantly for start position + cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Set targets instantly for start position RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() end @@ -18451,8 +18954,7 @@ function widget:Update(dt) -- Check for modifier key changes during box selection if interactionState.areBoxSelecting then local alt, ctrl, meta, shift = Spring.GetModKeyState() - local modifiersChanged = alt ~= interactionState.lastModifierState[1] or ctrl ~= interactionState.lastModifierState[2] or - meta ~= interactionState.lastModifierState[3] or shift ~= interactionState.lastModifierState[4] + local modifiersChanged = alt ~= interactionState.lastModifierState[1] or ctrl ~= interactionState.lastModifierState[2] or meta ~= interactionState.lastModifierState[3] or shift ~= interactionState.lastModifierState[4] -- Also check for units moving in/out of selection box (throttled to ~15fps for continuous updates) local currentTime = os.clock() @@ -18460,7 +18962,7 @@ function widget:Update(dt) if shouldUpdate then if modifiersChanged then - interactionState.lastModifierState = {alt, ctrl, meta, shift} + interactionState.lastModifierState = { alt, ctrl, meta, shift } -- Update deselection mode based on Ctrl state interactionState.areBoxDeselecting = ctrl end @@ -18493,7 +18995,7 @@ function widget:GameStart() if not spec and not isMinimapMode then local commanderID = FindMyCommander() if commanderID then - interactionState.areTracking = {commanderID} -- Store as table/array + interactionState.areTracking = { commanderID } -- Store as table/array end end @@ -18511,7 +19013,9 @@ function widget:GameStart() end function widget:UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unitDefID) - if uiState.inMinMode then return end + if uiState.inMinMode then + return + end local myAllyTeam = Spring.GetMyAllyTeamID() local spec, fullview = Spring.GetSpectatingState() @@ -18593,30 +19097,44 @@ RemoveUnitFromAllUnitsCache = function(unitID) end local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ) - if uiState.inMinMode then return end + if uiState.inMinMode then + return + end -- Performance: limit max simultaneous shatters - if #cache.iconShatters >= cache.maxIconShatters then return end + if #cache.iconShatters >= cache.maxIconShatters then + return + end -- Throttle shatters based on number of visible unit icons local iconCount = #miscState.pipUnits - if iconCount >= 4000 then return end -- no shatters at all above 4000 icons + if iconCount >= 4000 then + return + end -- no shatters at all above 4000 icons if iconCount >= 3000 then -- Only shatter big-footprint units (xsize*4 >= 16 means footprint >= 4) local xs = cache.xsizes[unitDefID] local zs = cache.zsizes[unitDefID] - if not xs or (xs < 16 and (not zs or zs < 16)) then return end + if not xs or (xs < 16 and (not zs or zs < 16)) then + return + end end -- Only shatter if unit has an icon - if not cache.unitIcon[unitDefID] then return end + if not cache.unitIcon[unitDefID] then + return + end -- Skip unfinished/under-construction units local _, _, _, _, buildProg = spFunc.GetUnitHealth(unitID) - if buildProg and buildProg < 1 then return end + if buildProg and buildProg < 1 then + return + end -- Get unit position local ux, uy, uz = spFunc.GetUnitPosition(unitID) - if not ux then return end + if not ux then + return + end -- LOS view filter: skip shatters for units outside the viewed allyteam's LOS if state.losViewEnabled and state.losViewAllyTeam then @@ -18627,14 +19145,18 @@ local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ -- Get icon data local iconData = cache.unitIcon[unitDefID] - if not iconData or not iconData.size then return end -- Ensure icon has size data + if not iconData or not iconData.size then + return + end -- Ensure icon has size data -- Engine-matching icon size (same as GL4DrawIcons/DrawIcons) local resScale = render.contentScale or 1 local unitBaseSize = Spring.GetConfigFloat("MinimapIconScale", 3.5) local iconSize = unitBaseSize * (mapInfo.mapSizeX * mapInfo.mapSizeZ / 40000) ^ 0.25 * math.sqrt(cameraState.zoom) * resScale * iconData.size -- Skip shattering for tiny icons (too small to see fragments when zoomed out) - if iconSize < 6 then return end + if iconSize < 6 then + return + end -- Use fixed 2x2 or 3x3 grid for fewer, bigger fragments -- Adjust threshold based on actual rendered size @@ -18644,7 +19166,9 @@ local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ -- Get team color local teamColor = teamColors[unitTeam] - if not teamColor then return end + if not teamColor then + return + end local teamR, teamG, teamB = teamColor[1], teamColor[2], teamColor[3] -- Convert unit velocity from world units to screen units (if provided) @@ -18674,7 +19198,7 @@ local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ -- Divide by zoom to compensate for gl.Scale transformation -- Use square root of iconSize to reduce the impact of larger icons on distance - local speedVariation = 0.4 + math.random() * 1.2 -- 0.4 to 1.6 + local speedVariation = 0.4 + math.random() * 1.2 -- 0.4 to 1.6 local speed = ((25 + math.random() * 15) * (math.sqrt(iconSize) / 6.3) * 3.4 * speedVariation) / cameraState.zoom table.insert(fragments, { @@ -18702,7 +19226,7 @@ local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ -- Add shatter effect with variable lifetime -- Smaller icons have shorter lifetimes, with additional random variation local baseLifetime = 0.4 + iconSize / 216 - local lifetimeVariation = 0.6 + math.random() * 0.8 -- 0.6 to 1.4 (±40% variation) + local lifetimeVariation = 0.6 + math.random() * 0.8 -- 0.6 to 1.4 (±40% variation) -- Capture damage flash intensity at death time (for white flash on fragments) local flashIntensity = 0 @@ -18722,9 +19246,9 @@ local function CreateIconShatter(unitID, unitDefID, unitTeam, unitVelX, unitVelZ teamG = teamG, teamB = teamB, duration = baseLifetime * lifetimeVariation, - zoom = cameraState.zoom, -- Store zoom factor to compensate for gl.Scale during rendering - flashIntensity = flashIntensity, -- Inherited damage flash (0-1) - originX = ux, -- World origin for LOS filtering during rendering + zoom = cameraState.zoom, -- Store zoom factor to compensate for gl.Scale during rendering + flashIntensity = flashIntensity, -- Inherited damage flash (0-1) + originX = ux, -- World origin for LOS filtering during rendering originZ = uz, }) end @@ -18755,7 +19279,9 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam) local weight = math.min(5, cost / 200) if weight > 0.2 then local x, _, z = spFunc.GetUnitBasePosition(unitID) - if x then pipTV.AddEvent(x, z, weight, 'death') end + if x then + pipTV.AddEvent(x, z, weight, "death") + end end end @@ -18789,7 +19315,7 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam) if state.losViewEnabled and state.losViewAllyTeam then local gy = Spring.GetGroundHeight(ghost.x, ghost.z) if Spring.IsPosInLos(ghost.x, gy, ghost.z, state.losViewAllyTeam) then - ghostBuildings[unitID] = nil -- destroyed in LOS, remove ghost + ghostBuildings[unitID] = nil -- destroyed in LOS, remove ghost end -- else: destroyed in FoW, ghost persists until LOS reaches the position else @@ -18879,23 +19405,27 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp -- SELFD toggles: if already counting down, this cancels it; otherwise starts it local selfDTime = spFunc.GetUnitSelfDTime(unitID) if selfDTime and selfDTime > 0 then - selfDUnits[unitID] = nil -- was counting down, this command cancels it + selfDUnits[unitID] = nil -- was counting down, this command cancels it else - selfDUnits[unitID] = true -- start countdown + selfDUnits[unitID] = true -- start countdown end elseif cmdID == CMD.STOP then -- Stop cancels self-destruct selfDUnits[unitID] = nil end - if not config.drawCommandFX then return end - if uiState.inMinMode then return end + if not config.drawCommandFX then + return + end + if uiState.inMinMode then + return + end -- Only show commands for the ally team we're "viewing as" local _, _, _, _, _, unitAllyTeam = spFunc.GetTeamInfo(unitTeam, false) if cameraState.mySpecState then -- Spectator: determine which ally team is relevant - local viewAllyTeam = nil -- nil = show all (fullview spectator, no tracking) + local viewAllyTeam = nil -- nil = show all (fullview spectator, no tracking) if interactionState.trackingPlayerID then local _, _, _, playerTeamID = spFunc.GetPlayerInfo(interactionState.trackingPlayerID, false) if playerTeamID then @@ -18909,14 +19439,20 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp viewAllyTeam = Spring.GetMyAllyTeamID() end end - if viewAllyTeam and unitAllyTeam ~= viewAllyTeam then return end + if viewAllyTeam and unitAllyTeam ~= viewAllyTeam then + return + end else local myAllyTeam = Spring.GetMyAllyTeamID() - if unitAllyTeam ~= myAllyTeam then return end + if unitAllyTeam ~= myAllyTeam then + return + end end -- Skip gaia / critter units - if unitTeam == gaiaTeamID then return end + if unitTeam == gaiaTeamID then + return + end -- Skip commands to newly finished units (rally point / initial orders) if config.commandFXIgnoreNewUnits then @@ -18933,9 +19469,11 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp -- Get command color (skip unknown commands) local color = cmdColors[cmdID] if not color and cmdID < 0 then - color = cmdColors.unknown -- build commands + color = cmdColors.unknown -- build commands + end + if not color then + return end - if not color then return end -- Resolve target position from command params local targetX, targetZ @@ -18948,13 +19486,19 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp local targetID = cmdParams[1] if targetID >= (Game.maxUnits or 32000) then local fx, _, fz = spFunc.GetFeaturePosition(targetID - (Game.maxUnits or 32000)) - if fx then targetX, targetZ = fx, fz end + if fx then + targetX, targetZ = fx, fz + end else local ux, _, uz = spFunc.GetUnitPosition(targetID) - if ux then targetX, targetZ = ux, uz end + if ux then + targetX, targetZ = ux, uz + end end end - if not targetX then return end + if not targetX then + return + end -- Get start position: chain from previous command target if recent, else use unit position local startX, startZ @@ -18965,7 +19509,9 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp else -- First command or stale — start from unit position local ux, _, uz = spFunc.GetUnitPosition(unitID) - if not ux then return end + if not ux then + return + end startX, startZ = ux, uz end @@ -18983,8 +19529,10 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp if commandFX.count < commandFX.MAX then commandFX.count = commandFX.count + 1 commandFX.list[commandFX.count] = { - unitX = startX, unitZ = startZ, - targetX = targetX, targetZ = targetZ, + unitX = startX, + unitZ = startZ, + targetX = targetX, + targetZ = targetZ, cmdID = cmdID, time = wallClockTime, color = color, @@ -19022,7 +19570,9 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) if cost >= config.tvUnitFinishedCostThreshold then local weight = math.min(4, cost / 500) local x, _, z = spFunc.GetUnitBasePosition(unitID) - if x then pipTV.AddEvent(x, z, weight, 'finished') end + if x then + pipTV.AddEvent(x, z, weight, "finished") + end end end end @@ -19030,11 +19580,17 @@ end -- UnitEnteredLos is only called for non-allied units entering the local player's LOS -- We record the building's position so we can draw its icon when it leaves LOS function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - if uiState.inMinMode then return end -- Skip damage flash + TV events when not visible - if damage <= 0 then return end - if paralyzer then damage = damage * 0.1 end -- paralyzer visually counts for 1/10th + if uiState.inMinMode then + return + end -- Skip damage flash + TV events when not visible + if damage <= 0 then + return + end + if paralyzer then + damage = damage * 0.1 + end -- paralyzer visually counts for 1/10th local maxHP = UnitDefs[unitDefID] and UnitDefs[unitDefID].health or 1 - local intensity = math.min(1.0, damage / maxHP * 3) -- scale up so small hits are visible too + local intensity = math.min(1.0, damage / maxHP * 3) -- scale up so small hits are visible too local existing = damageFlash[unitID] if existing and (gameTime - existing.time) < DAMAGE_FLASH_DURATION then -- Accumulate: boost intensity if already flashing @@ -19068,7 +19624,9 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) if weight > 0.1 then local x, _, z = spFunc.GetUnitBasePosition(unitID) - if x then pipTV.AddEvent(x, z, weight, 'combat') end + if x then + pipTV.AddEvent(x, z, weight, "combat") + end end end end @@ -19077,20 +19635,32 @@ function widget:UnitEnteredLos(unitID, unitTeam) -- Skip for fullview spectators (they see everything, ghosts are recorded in processUnit) if cameraState.mySpecState then local _, fullview = Spring.GetSpectatingState() - if fullview then return end + if fullview then + return + end end local unitDefID = spFunc.GetUnitDefID(unitID) - if not unitDefID then return end - if not cache.isBuilding[unitDefID] then return end + if not unitDefID then + return + end + if not cache.isBuilding[unitDefID] then + return + end local x, _, z = spFunc.GetUnitBasePosition(unitID) - if not x then return end + if not x then + return + end ghostBuildings[unitID] = { defID = unitDefID, x = x, z = z, teamID = unitTeam } end -- Handle explosions from weapons (called when a visible explosion occurs) function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) - if uiState.inMinMode then return end - if not config.drawExplosions then return end + if uiState.inMinMode then + return + end + if not config.drawExplosions then + return + end -- When LOS view is active, skip explosions outside the viewed allyteam's LOS if state.losViewEnabled and state.losViewAllyTeam then @@ -19127,7 +19697,9 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) -- Check if this is an anti-air weapon (skip AA explosions for now) local isAA = weaponID and cache.weaponIsAA[weaponID] - if isAA then return end + if isAA then + return + end -- Detect unit death explosions (ownerID is the dying unit, already in crashingUnits) local isUnitExplosion = ownerID and miscState.crashingUnits[ownerID] or false @@ -19141,17 +19713,17 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) y = py, z = pz, radius = radius, - startFrame = Spring.GetGameFrame(), -- game-frame based: freezes when paused - randomSeed = math.random() * 1000, -- For consistent per-explosion randomness - rotationSpeed = (math.random() - 0.5) * 4, -- Random rotation speed - particles = {}, -- Will store particle debris + startFrame = Spring.GetGameFrame(), -- game-frame based: freezes when paused + randomSeed = math.random() * 1000, -- For consistent per-explosion randomness + rotationSpeed = (math.random() - 0.5) * 4, -- Random rotation speed + particles = {}, -- Will store particle debris isLightning = isLightning, isParalyze = isParalyze, isJuno = isJuno, isAA = isAA, isUnitExplosion = isUnitExplosion, - isBigFlash = false, -- set below - dimFactor = dimFactor, -- alpha multiplier for rapid-fire/flame weapons + isBigFlash = false, -- set below + dimFactor = dimFactor, -- alpha multiplier for rapid-fire/flame weapons } -- Detect big flash explosions: nukes, commanders, large unit death explosions @@ -19182,7 +19754,7 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) vx = vx, vz = vz, life = 0.3 + math.random() * 0.2, -- 0.3-0.5 seconds - size = 2 + math.random() * 2 + size = 2 + math.random() * 2, }) end end @@ -19192,7 +19764,7 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) -- TV mode: explosion event — weight based on radius if miscState.tvEnabled and radius >= 20 then local weight = math.min(4, radius / 60) - pipTV.AddEvent(px, pz, weight, 'explosion') + pipTV.AddEvent(px, pz, weight, "explosion") end -- Add particle debris for larger explosions (skip during engine minimap: only circle overlay is drawn) @@ -19204,9 +19776,9 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) -- Massive explosions get way more particles and additional effects if radius > 150 then - particleCount = math.min(24, math.floor(radius / 8)) -- More particles for nukes + particleCount = math.min(24, math.floor(radius / 8)) -- More particles for nukes elseif radius > 80 then - particleCount = math.min(18, math.floor(radius / 9)) -- More for large explosions + particleCount = math.min(18, math.floor(radius / 9)) -- More for large explosions end for i = 1, particleCount do @@ -19215,9 +19787,9 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) -- Bigger explosions = faster flying particles local speedMultiplier = 1 if radius > 150 then - speedMultiplier = 4 -- Nukes fly MUCH further (was 2.5) + speedMultiplier = 4 -- Nukes fly MUCH further (was 2.5) elseif radius > 80 then - speedMultiplier = 2.5 -- Large explosions fly further (was 1.8) + speedMultiplier = 2.5 -- Large explosions fly further (was 1.8) end -- Bigger particles for bigger explosions local sizeMultiplier = 1 @@ -19229,16 +19801,17 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) table.insert(explosion.particles, { angle = angle, speed = speed * speedMultiplier, - size = (2 + math.random() * 3) * 2 * sizeMultiplier, -- Scaled by explosion size - lifetime = speedMultiplier * 1.5 -- Particles from bigger explosions live even longer (was 1x) + size = (2 + math.random() * 3) * 2 * sizeMultiplier, -- Scaled by explosion size + lifetime = speedMultiplier * 1.5, -- Particles from bigger explosions live even longer (was 1x) }) end end - end function widget:DefaultCommand() - if uiState.inMinMode then return end + if uiState.inMinMode then + return + end local mx, my = spFunc.GetMouseState() if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then local wx, wz = PipToWorldCoords(mx, my) @@ -19259,14 +19832,16 @@ function widget:DefaultCommand() end function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) - if uiState.inMinMode then return end + if uiState.inMinMode then + return + end -- Prevent infinite recursion when we call Spring.Marker* functions if miscState.isProcessingMapDraw then return false end -- Store point markers for rendering (from any player, but not spectators) - if cmdType == 'point' then + if cmdType == "point" then -- Get player's team and spec status local _, _, isSpec, teamID = Spring.GetPlayerInfo(playerID, false) @@ -19275,13 +19850,13 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) if showMarker then -- Shorten lifetime of older nearby markers from the same player local now = os.clock() - local proximityDist = 500 -- World units — "same general area" + local proximityDist = 500 -- World units — "same general area" for j = #miscState.mapMarkers, 1, -1 do local old = miscState.mapMarkers[j] if old.playerID == playerID then local dx = old.x - mx local dz = old.z - mz - if dx*dx + dz*dz < proximityDist * proximityDist then + if dx * dx + dz * dz < proximityDist * proximityDist then -- Mark for early fade-out (0.5s from now) if not old.fadeStart then old.fadeStart = now @@ -19297,7 +19872,7 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) time = now, teamID = teamID, playerID = playerID, - isSpectator = isSpec + isSpectator = isSpec, }) -- Force PIP content update to show marker immediately @@ -19305,7 +19880,7 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) -- TV mode: map marker event (moderate weight) if miscState.tvEnabled then - pipTV.AddEvent(mx, mz, 2.5, 'marker') + pipTV.AddEvent(mx, mz, 2.5, "marker") end -- Activity focus: briefly move camera to this marker @@ -19414,7 +19989,7 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) -- For point markers, use the stored initiation position (from double-click) -- For line/erase, use current mouse position (for continuous drawing) local screenX, screenY - if cmdType == 'point' and miscState.mapmarkInitScreenX and miscState.mapmarkInitScreenY then + if cmdType == "point" and miscState.mapmarkInitScreenX and miscState.mapmarkInitScreenY then -- Use the position where mapmark was initiated (double-click position) -- Check if it was recent (within last 10 seconds - allows time for typing message) if (os.clock() - miscState.mapmarkInitTime) < 10 then @@ -19451,11 +20026,10 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) -- Now place the marker at the PiP world coordinates instead of camera world coordinates miscState.isProcessingMapDraw = true - if cmdType == 'point' then + if cmdType == "point" then -- Place marker at PiP location Spring.MarkerAddPoint(wx, markerHeight, wz, c or "") - - elseif cmdType == 'line' then + elseif cmdType == "line" then -- For line drawing in PiP - track for continuous drawing -- If we have a previous position, draw line from there to here @@ -19467,18 +20041,16 @@ function widget:MapDrawCmd(playerID, cmdType, mx, my, mz, a, b, c) -- Update last position for next segment interactionState.lastMapDrawX = wx interactionState.lastMapDrawZ = wz - - elseif cmdType == 'erase' then + elseif cmdType == "erase" then -- Erase at the PiP location - use ground height for better detection Spring.MarkerErasePosition(wx, wy, wz) end miscState.isProcessingMapDraw = false return true -- Consume the original event to prevent double placement - else -- Not over PiP, reset map drawing state and allow default handling - if cmdType == 'line' or cmdType == 'erase' then + if cmdType == "line" or cmdType == "erase" then interactionState.lastMapDrawX = nil interactionState.lastMapDrawZ = nil end @@ -19489,9 +20061,13 @@ end function widget:IsAbove(mx, my) -- Don't claim mouse when GUI is hidden - if Spring.IsGUIHidden() then return false end + if Spring.IsGUIHidden() then + return false + end -- Guard against uninitialized render dimensions - if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then return false end + if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then + return false + end -- When minimap is hidden via MinimapMinimize, only capture mouse over the maximize button if isMinimapMode and miscState.minimapMinimized then @@ -19508,12 +20084,10 @@ function widget:IsAbove(mx, my) -- During animation, check both start and end positions to ensure we capture the animated area if uiState.inMinMode then -- Animating to minimized - check the shrinking area - return mx >= math.min(render.dim.l, uiState.minModeL) and mx <= math.max(render.dim.r, uiState.minModeL + math.floor(render.usedButtonSize*config.maximizeSizemult)) and - my >= math.min(render.dim.b, uiState.minModeB) and my <= math.max(render.dim.t, uiState.minModeB + math.floor(render.usedButtonSize*config.maximizeSizemult)) + return mx >= math.min(render.dim.l, uiState.minModeL) and mx <= math.max(render.dim.r, uiState.minModeL + math.floor(render.usedButtonSize * config.maximizeSizemult)) and my >= math.min(render.dim.b, uiState.minModeB) and my <= math.max(render.dim.t, uiState.minModeB + math.floor(render.usedButtonSize * config.maximizeSizemult)) else -- Animating to maximized - check the expanding area - return mx >= math.min(render.dim.l, uiState.minModeL) and mx <= math.max(render.dim.r, uiState.minModeL + math.floor(render.usedButtonSize*config.maximizeSizemult)) and - my >= math.min(render.dim.b, uiState.minModeB) and my <= math.max(render.dim.t, uiState.minModeB + math.floor(render.usedButtonSize*config.maximizeSizemult)) + return mx >= math.min(render.dim.l, uiState.minModeL) and mx <= math.max(render.dim.r, uiState.minModeL + math.floor(render.usedButtonSize * config.maximizeSizemult)) and my >= math.min(render.dim.b, uiState.minModeB) and my <= math.max(render.dim.t, uiState.minModeB + math.floor(render.usedButtonSize * config.maximizeSizemult)) end elseif uiState.inMinMode then -- In minimized mode, check if over the minimize button area only @@ -19529,8 +20103,12 @@ function widget:IsAbove(mx, my) end function widget:MouseWheel(up, value) - if Spring.IsGUIHidden() then return end - if isMinimapMode and miscState.minimapMinimized then return end + if Spring.IsGUIHidden() then + return + end + if isMinimapMode and miscState.minimapMinimized then + return + end if not uiState.inMinMode then local mx, my = spFunc.GetMouseState() if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then @@ -19538,10 +20116,14 @@ function widget:MouseWheel(up, value) if config.altKeyRequiredForZoom then local alt = Spring.GetModKeyState() local _, _, _, middleButton = spFunc.GetMouseState() - if not alt and not middleButton then return end + if not alt and not middleButton then + return + end end -- During activity focus, pass scroll through so the game camera zooms instead - if miscState.activityFocusActive then return end + if miscState.activityFocusActive then + return + end -- Don't allow zooming when tracking a player's camera if interactionState.trackingPlayerID then return true @@ -19553,7 +20135,9 @@ function widget:MouseWheel(up, value) -- multiple scroll ticks into a single MouseWheel call with a larger value. -- Ignoring it makes zooming feel sluggish when frames are slow. local absValue = math.abs(value) - if absValue < 1 then absValue = 1 end + if absValue < 1 then + absValue = 1 + end local zoomFactor = config.zoomWheel ^ absValue if Spring.GetConfigInt("ScrollWheelSpeed", 1) > 0 then @@ -19630,9 +20214,13 @@ end function widget:MousePress(mx, my, mButton) -- Don't process input when GUI is hidden - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end -- Guard against uninitialized render dimensions - if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then return end + if not render.dim.l or not render.dim.r or not render.dim.b or not render.dim.t then + return + end -- When minimap is hidden via MinimapMinimize, only handle click on maximize button if isMinimapMode and miscState.minimapMinimized then @@ -19684,7 +20272,9 @@ function widget:MousePress(mx, my, mButton) -- Block all mouse interaction during minimize/maximize animation to prevent -- double-click from triggering an accidental minimize (which corrupts savedDimensions) - if uiState.isAnimating then return end + if uiState.isAnimating then + return + end -- Track mapmark initiation position if mouse is over PiP (for point markers with double-click) if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t and not uiState.inMinMode then @@ -19701,7 +20291,7 @@ function widget:MousePress(mx, my, mButton) local mmWidth = mmBounds.drawR - mmBounds.drawL local mmHeight = mmBounds.drawT - mmBounds.drawB local relX = (mx - mmBounds.drawL) / mmWidth - local relY = 1 - ((my - mmBounds.drawB) / mmHeight) -- Flip Y (screen Y is bottom-up, map Z is top-down) + local relY = 1 - ((my - mmBounds.drawB) / mmHeight) -- Flip Y (screen Y is bottom-up, map Z is top-down) -- Apply rotation to account for minimap rotation local minimapRotation = Spring.GetMiniMapRotation() @@ -19737,7 +20327,7 @@ function widget:MousePress(mx, my, mButton) interactionState.pipMinimapDragging = true interactionState.leftMousePressed = true - return true -- Consume the click + return true -- Consume the click end end @@ -19814,9 +20404,7 @@ function widget:MousePress(mx, my, mButton) end -- Was maximize clicked? (or ALT+drag/middle drag to move window) - if (mButton == 1 or mButton == 2) and - mx >= uiState.minModeL and mx <= uiState.minModeL + math.floor(render.usedButtonSize*config.maximizeSizemult) and - my >= uiState.minModeB and my <= uiState.minModeB + math.floor(render.usedButtonSize*config.maximizeSizemult) then + if (mButton == 1 or mButton == 2) and mx >= uiState.minModeL and mx <= uiState.minModeL + math.floor(render.usedButtonSize * config.maximizeSizemult) and my >= uiState.minModeB and my <= uiState.minModeB + math.floor(render.usedButtonSize * config.maximizeSizemult) then local altKey = Spring.GetModKeyState() -- If ALT is held or middle mouse, start tracking for drag (to move window) @@ -19879,13 +20467,11 @@ function widget:MousePress(mx, my, mButton) -- Did we click within the pip window ? if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then - -- Was it a left click? -> check buttons if mButton == 1 then - -- Resize thing (check first - highest priority) - disabled in minimap mode if not (isMinimapMode and config.minimapModeHideMoveResize) then - if render.dim.r-mx + my-render.dim.b <= render.usedButtonSize then + if render.dim.r - mx + my - render.dim.b <= render.usedButtonSize then uiState.areResizing = true return true end @@ -19902,19 +20488,19 @@ function widget:MousePress(mx, my, mButton) l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } uiState.animStartDim = { l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } uiState.animEndDim = { l = render.dim.l, r = render.dim.l + buttonSize, b = render.dim.t - buttonSize, - t = render.dim.t + t = render.dim.t, } uiState.animationProgress = 0 uiState.isAnimating = true @@ -19939,7 +20525,7 @@ function widget:MousePress(mx, my, mButton) l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } -- Calculate where the minimize button will end up @@ -19947,12 +20533,12 @@ function widget:MousePress(mx, my, mButton) if render.dim.l < sw * 0.5 then targetL = render.dim.l else - targetL = render.dim.r - math.floor(render.usedButtonSize*config.maximizeSizemult) + targetL = render.dim.r - math.floor(render.usedButtonSize * config.maximizeSizemult) end if render.dim.b < sh * 0.25 then targetB = render.dim.b else - targetB = render.dim.t - math.floor(render.usedButtonSize*config.maximizeSizemult) + targetB = render.dim.t - math.floor(render.usedButtonSize * config.maximizeSizemult) end -- Store the target position @@ -19960,18 +20546,18 @@ function widget:MousePress(mx, my, mButton) uiState.minModeB = targetB -- Start minimize animation - local buttonSize = math.floor(render.usedButtonSize*config.maximizeSizemult) + local buttonSize = math.floor(render.usedButtonSize * config.maximizeSizemult) uiState.animStartDim = { l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } uiState.animEndDim = { l = targetL, r = targetL + buttonSize, b = targetB, - t = targetB + buttonSize + t = targetB + buttonSize, } uiState.animationProgress = 0 uiState.isAnimating = true @@ -20018,16 +20604,16 @@ function widget:MousePress(mx, my, mButton) -- In minimap mode, skip move button if configured local skipButton = false if isMinimapMode and config.minimapModeHideMoveResize then - if btn.tooltipKey == 'ui.pip.move' then + if btn.tooltipKey == "ui.pip.move" then skipButton = true end end -- In minimap mode, skip switch and copy buttons (keep pip_track and pip_trackplayer) -- Allow pip_view for spectators with fullview if isMinimapMode then - if btn.command == 'pip_switch' or btn.command == 'pip_copy' then + if btn.command == "pip_switch" or btn.command == "pip_copy" then skipButton = true - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then local _, fullview = Spring.GetSpectatingState() if not fullview then skipButton = true @@ -20037,30 +20623,30 @@ function widget:MousePress(mx, my, mButton) if not skipButton then -- Show pip_track button if has selection or is tracking units (not in minimap mode) - if btn.command == 'pip_track' then + if btn.command == "pip_track" then if not isMinimapMode and (hasSelection or isTracking) then visibleButtons[#visibleButtons + 1] = btn end -- Show pip_trackplayer button if lockcamera is available or already tracking (hidden during TV) - elseif btn.command == 'pip_trackplayer' then + elseif btn.command == "pip_trackplayer" then if showPlayerTrackButton and not miscState.tvEnabled then visibleButtons[#visibleButtons + 1] = btn end -- Show pip_view button only for spectators - elseif btn.command == 'pip_view' then + elseif btn.command == "pip_view" then local _, _, spec = spFunc.GetPlayerInfo(Spring.GetMyPlayerID(), false) if spec then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_activity' then + elseif btn.command == "pip_activity" then if not isSinglePlayer and not interactionState.trackingPlayerID and not miscState.tvEnabled and not (config.activityFocusHideForSpectators and cameraState.mySpecState) then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_tv' then + elseif btn.command == "pip_tv" then if not config.tvModeSpectatorsOnly or cameraState.mySpecState then visibleButtons[#visibleButtons + 1] = btn end - elseif btn.command == 'pip_help' then + elseif btn.command == "pip_help" then visibleButtons[#visibleButtons + 1] = btn else visibleButtons[#visibleButtons + 1] = btn @@ -20115,7 +20701,7 @@ function widget:MousePress(mx, my, mButton) interactionState.areBuildDragging = true interactionState.buildDragStartX = mx interactionState.buildDragStartY = my - interactionState.buildDragPositions = {{wx = wx, wz = wz}} + interactionState.buildDragPositions = { { wx = wx, wz = wz } } return true elseif not alt then if cmdID < 0 and shift then @@ -20128,14 +20714,12 @@ function widget:MousePress(mx, my, mButton) interactionState.areBuildDragging = true interactionState.buildDragStartX = mx interactionState.buildDragStartY = my - interactionState.buildDragPositions = {{wx = wx, wz = wz}} + interactionState.buildDragPositions = { { wx = wx, wz = wz } } return true elseif cmdID > 0 then -- Check if command supports area mode local setTargetCmd = GameCMD and GameCMD.UNIT_SET_TARGET_NO_GROUND - local supportsArea = (cmdID == CMD.ATTACK or cmdID == CMD.RECLAIM or cmdID == CMD.REPAIR or - cmdID == CMD.RESURRECT or cmdID == CMD.CAPTURE or cmdID == CMD.RESTORE or - cmdID == CMD.LOAD_UNITS or (setTargetCmd and cmdID == setTargetCmd)) + local supportsArea = (cmdID == CMD.ATTACK or cmdID == CMD.RECLAIM or cmdID == CMD.REPAIR or cmdID == CMD.RESURRECT or cmdID == CMD.CAPTURE or cmdID == CMD.RESTORE or cmdID == CMD.LOAD_UNITS or (setTargetCmd and cmdID == setTargetCmd)) if supportsArea then -- Don't allow area commands as spectator (unless config allows it) local isSpec = Spring.GetSpectatingState() @@ -20188,41 +20772,40 @@ function widget:MousePress(mx, my, mButton) local alt, ctrl, meta, shift = Spring.GetModKeyState() if not alt and not interactionState.trackingPlayerID then if IsLeftClickPanActive() and not interactionState.trackingPlayerID then - interactionState.arePanning = true - interactionState.panStartX = mx - interactionState.panStartY = my - interactionState.areTracking = nil - -- Track initial click position for deselection on release (even if we're panning) - interactionState.boxSelectStartX = mx - interactionState.boxSelectStartY = my - interactionState.boxSelectEndX = mx - interactionState.boxSelectEndY = my - else - -- Start box selection instead - -- Save current selection before starting box selection - interactionState.selectionBeforeBox = Spring.GetSelectedUnits() - - interactionState.areBoxSelecting = true - interactionState.boxSelectStartX = mx - interactionState.boxSelectStartY = my - interactionState.boxSelectEndX = mx - interactionState.boxSelectEndY = my - -- Initialize modifier state - local alt, ctrl, meta, shift = Spring.GetModKeyState() - interactionState.lastModifierState = {alt, ctrl, meta, shift} - -- Check if we're starting a deselection (Ctrl held) - interactionState.areBoxDeselecting = ctrl - -- Set reference selection for smart select - if WG.SmartSelect_SetReference then - WG.SmartSelect_SetReference() + interactionState.arePanning = true + interactionState.panStartX = mx + interactionState.panStartY = my + interactionState.areTracking = nil + -- Track initial click position for deselection on release (even if we're panning) + interactionState.boxSelectStartX = mx + interactionState.boxSelectStartY = my + interactionState.boxSelectEndX = mx + interactionState.boxSelectEndY = my + else + -- Start box selection instead + -- Save current selection before starting box selection + interactionState.selectionBeforeBox = Spring.GetSelectedUnits() + + interactionState.areBoxSelecting = true + interactionState.boxSelectStartX = mx + interactionState.boxSelectStartY = my + interactionState.boxSelectEndX = mx + interactionState.boxSelectEndY = my + -- Initialize modifier state + local alt, ctrl, meta, shift = Spring.GetModKeyState() + interactionState.lastModifierState = { alt, ctrl, meta, shift } + -- Check if we're starting a deselection (Ctrl held) + interactionState.areBoxDeselecting = ctrl + -- Set reference selection for smart select + if WG.SmartSelect_SetReference then + WG.SmartSelect_SetReference() + end end end - end - -- If alt is held, fall through without starting box selection (panning will be handled in MouseMove) + -- If alt is held, fall through without starting box selection (panning will be handled in MouseMove) end return true - elseif mButton == 3 then -- Don't start right-click actions if we're already panning with left+right if interactionState.arePanning then @@ -20315,7 +20898,7 @@ function widget:MousePress(mx, my, mButton) -- Don't set pipForceShift yet - first command should replace, not queue -- We'll set it after the first node is added (in MouseMove) - if WG.customformations.StartFormation({wx, wy, wz}, actualCmd, false) then + if WG.customformations.StartFormation({ wx, wy, wz }, actualCmd, false) then interactionState.areFormationDragging = true interactionState.formationDragStartX = mx interactionState.formationDragStartY = my @@ -20335,7 +20918,9 @@ function widget:MousePress(mx, my, mButton) end function widget:MouseMove(mx, my, dx, dy, mButton) - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end -- Get modifier key states local alt, ctrl, meta, shift = Spring.GetModKeyState() @@ -20356,7 +20941,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) local mmWidth = mmBounds.drawR - mmBounds.drawL local mmHeight = mmBounds.drawT - mmBounds.drawB local relX = (mx - mmBounds.drawL) / mmWidth - local relY = 1 - ((my - mmBounds.drawB) / mmHeight) -- Flip Y (screen Y is bottom-up, map Z is top-down) + local relY = 1 - ((my - mmBounds.drawB) / mmHeight) -- Flip Y (screen Y is bottom-up, map Z is top-down) -- Apply inverse rotation to account for minimap rotation local minimapRotation = Spring.GetMiniMapRotation() @@ -20403,7 +20988,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) -- Handle minimize button drag (ALT+drag to move PIP window on screen) if interactionState.minimizeButtonClickStartX ~= 0 and not uiState.isAnimating then - local dragThreshold = 8 -- Pixels before considering it a drag + local dragThreshold = 8 -- Pixels before considering it a drag local dragDistX = math.abs(mx - interactionState.minimizeButtonClickStartX) local dragDistY = math.abs(my - interactionState.minimizeButtonClickStartY) @@ -20477,7 +21062,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) if config.cancelPlayerTrackingOnPan then interactionState.trackingPlayerID = nil else - return -- Don't pan when tracking player camera + return -- Don't pan when tracking player camera end end -- Don't pan when at minimum zoom in minimap mode @@ -20506,7 +21091,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) if config.cancelPlayerTrackingOnPan then interactionState.trackingPlayerID = nil else - return -- Don't pan when tracking player camera + return -- Don't pan when tracking player camera end end -- Don't pan when at minimum zoom in minimap mode @@ -20560,7 +21145,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) if config.cancelPlayerTrackingOnPan then interactionState.trackingPlayerID = nil else - return -- Don't pan when tracking player camera + return -- Don't pan when tracking player camera end end -- Don't pan when at minimum zoom in minimap mode @@ -20576,7 +21161,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) end if uiState.areResizing then - local minSize = math.floor(config.minPanelSize*render.widgetScale) + local minSize = math.floor(config.minPanelSize * render.widgetScale) local maxSize = math.floor(render.vsy * config.maxPanelSizeVsy) -- Apply width constraint @@ -20623,7 +21208,9 @@ function widget:MouseMove(mx, my, dx, dy, mButton) local is90 = false if render.minimapRotation then local rotDeg = math.abs(render.minimapRotation * 180 / math.pi) % 180 - if rotDeg > 45 and rotDeg < 135 then is90 = true end + if rotDeg > 45 and rotDeg < 135 then + is90 = true + end end local fzx = is90 and (rawH / mapInfo.mapSizeX) or (rawW / mapInfo.mapSizeX) local fzz = is90 and (rawW / mapInfo.mapSizeZ) or (rawH / mapInfo.mapSizeZ) @@ -20652,7 +21239,6 @@ function widget:MouseMove(mx, my, dx, dy, mButton) cameraState.targetWcz = cameraState.wcz RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() - elseif interactionState.areDragging then render.dim.l = render.dim.l + dx render.dim.r = render.dim.r + dx @@ -20664,7 +21250,6 @@ function widget:MouseMove(mx, my, dx, dy, mButton) -- Update guishader blur dimensions UpdateGuishaderBlur() - elseif interactionState.arePanning then -- In minimap mode at minimum zoom, don't allow panning - keep centered on map if IsAtMinimumZoom(cameraState.zoom) then @@ -20706,7 +21291,7 @@ function widget:MouseMove(mx, my, dx, dy, mButton) -- Apply panning with per-axis margin limits (using rotated deltas, centers on axis when view exceeds map) cameraState.wcx = ClampCameraAxis(cameraState.wcx - panDx / cameraState.zoom, visibleWorldWidth, mapInfo.mapSizeX, config.mapEdgeMargin) cameraState.wcz = ClampCameraAxis(cameraState.wcz + panDy / cameraState.zoom, visibleWorldHeight, mapInfo.mapSizeZ, config.mapEdgeMargin) - cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Panning updates instantly, not smoothly + cameraState.targetWcx, cameraState.targetWcz = cameraState.wcx, cameraState.wcz -- Panning updates instantly, not smoothly RecalculateWorldCoordinates() RecalculateGroundTextureCoordinates() @@ -20718,7 +21303,6 @@ function widget:MouseMove(mx, my, dx, dy, mButton) -- Reapply the current cursor to prevent it from disappearing after warp Spring.SetMouseCursor(Spring.GetMouseCursor()) end - elseif interactionState.areBoxSelecting then -- Update the end position of the box selection interactionState.boxSelectEndX = mx @@ -20758,14 +21342,13 @@ function widget:MouseMove(mx, my, dx, dy, mButton) end end end - elseif interactionState.areFormationDragging then -- Add formation nodes as we drag if WG.customformations and WG.customformations.AddFormationNode then if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then local wx, wz = PipToWorldCoords(mx, my) local wy = spFunc.GetGroundHeight(wx, wz) - WG.customformations.AddFormationNode({wx, wy, wz}) + WG.customformations.AddFormationNode({ wx, wy, wz }) -- After the first node is added, enable queuing for subsequent nodes -- (if shouldQueue is true - only for single unit selection) @@ -20774,7 +21357,6 @@ function widget:MouseMove(mx, my, dx, dy, mButton) end end end - elseif interactionState.areBuildDragging and not interactionState.arePanning then -- Update build drag positions (but not if we're panning) if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then @@ -20822,7 +21404,9 @@ function widget:KeyRelease(key) end function widget:MouseRelease(mx, my, mButton) - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end -- Handle world camera drag release (leftButtonPansCamera mode) if mButton == 1 and interactionState.worldCameraDragging then interactionState.worldCameraDragging = false @@ -20838,7 +21422,7 @@ function widget:MouseRelease(mx, my, mButton) -- Handle minimize button click/drag release (ALT+click to minimize, ALT/middle drag to move) if (mButton == 1 or mButton == 2) and interactionState.minimizeButtonClickStartX ~= 0 then local wasDragging = interactionState.minimizeButtonDragging - local dragThreshold = 8 -- Pixels before considering it a drag + local dragThreshold = 8 -- Pixels before considering it a drag local dragDistX = math.abs(mx - interactionState.minimizeButtonClickStartX) local dragDistY = math.abs(my - interactionState.minimizeButtonClickStartY) local wasClick = dragDistX <= dragThreshold and dragDistY <= dragThreshold @@ -20864,7 +21448,7 @@ function widget:MouseRelease(mx, my, mButton) l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } -- Calculate where the minimize button will end up @@ -20872,12 +21456,12 @@ function widget:MouseRelease(mx, my, mButton) if render.dim.l < sw * 0.5 then targetL = render.dim.l else - targetL = render.dim.r - math.floor(render.usedButtonSize*config.maximizeSizemult) + targetL = render.dim.r - math.floor(render.usedButtonSize * config.maximizeSizemult) end if render.dim.b < sh * 0.25 then targetB = render.dim.b else - targetB = render.dim.t - math.floor(render.usedButtonSize*config.maximizeSizemult) + targetB = render.dim.t - math.floor(render.usedButtonSize * config.maximizeSizemult) end -- Store the target position @@ -20885,18 +21469,18 @@ function widget:MouseRelease(mx, my, mButton) uiState.minModeB = targetB -- Start minimize animation - local buttonSize = math.floor(render.usedButtonSize*config.maximizeSizemult) + local buttonSize = math.floor(render.usedButtonSize * config.maximizeSizemult) uiState.animStartDim = { l = render.dim.l, r = render.dim.r, b = render.dim.b, - t = render.dim.t + t = render.dim.t, } uiState.animEndDim = { l = targetL, r = targetL + buttonSize, b = targetB, - t = targetB + buttonSize + t = targetB + buttonSize, } uiState.animationProgress = 0 uiState.isAnimating = true @@ -20921,7 +21505,7 @@ function widget:MouseRelease(mx, my, mButton) end end end - return -- Don't process further + return -- Don't process further end -- Store panning state BEFORE we modify it @@ -20976,14 +21560,14 @@ function widget:MouseRelease(mx, my, mButton) end Spring.SelectUnitArray(newSelection) else - Spring.SelectUnitArray({uID}, true) + Spring.SelectUnitArray({ uID }, true) end elseif shift then -- Shift+click: add to selection - Spring.SelectUnitArray({uID}, true) + Spring.SelectUnitArray({ uID }, true) else -- Normal click: select only this unit - Spring.SelectUnitArray({uID}, false) + Spring.SelectUnitArray({ uID }, false) end else -- Clicked empty space - deselect unless shift is held @@ -21075,14 +21659,14 @@ function widget:MouseRelease(mx, my, mButton) Spring.SelectUnitArray(newSelection) else -- Add to selection - Spring.SelectUnitArray({uID}, true) + Spring.SelectUnitArray({ uID }, true) end elseif shift then -- Shift+click: add to selection - Spring.SelectUnitArray({uID}, true) + Spring.SelectUnitArray({ uID }, true) else -- Normal click without modifier: select only this unit (replace selection) - Spring.SelectUnitArray({uID}, false) + Spring.SelectUnitArray({ uID }, false) end else -- Clicked empty space - deselect unless shift is held @@ -21101,7 +21685,6 @@ function widget:MouseRelease(mx, my, mButton) if WG.SmartSelect_ClearReference then WG.SmartSelect_ClearReference() end - elseif interactionState.areAreaDragging then -- Complete area command drag local minDragDistance = 5 -- Minimum pixels to consider it a drag @@ -21131,12 +21714,12 @@ function widget:MouseRelease(mx, my, mButton) -- It's a drag - issue area set target command local alt, ctrl, meta, shift = Spring.GetModKeyState() local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, false) - GiveNotifyingOrder(cmdID, {targetID, startWX, spFunc.GetGroundHeight(startWX, startWZ), startWZ, radius}, cmdOpts) + GiveNotifyingOrder(cmdID, { targetID, startWX, spFunc.GetGroundHeight(startWX, startWZ), startWZ, radius }, cmdOpts) else -- It's a click - issue single set target command local alt, ctrl, meta, shift = Spring.GetModKeyState() local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, false) - GiveNotifyingOrder(cmdID, {targetID}, cmdOpts) + GiveNotifyingOrder(cmdID, { targetID }, cmdOpts) end end else @@ -21165,7 +21748,6 @@ function widget:MouseRelease(mx, my, mButton) end interactionState.areAreaDragging = false - elseif interactionState.areFormationDragging then -- End formation drag -- Check if it was a short click vs an actual drag @@ -21181,7 +21763,7 @@ function widget:MouseRelease(mx, my, mButton) if mx >= render.dim.l and mx <= render.dim.r and my >= render.dim.b and my <= render.dim.t then local wx, wz = PipToWorldCoords(mx, my) local wy = spFunc.GetGroundHeight(wx, wz) - finalPos = {wx, wy, wz} + finalPos = { wx, wy, wz } end formationHandled = WG.customformations.EndFormation(finalPos) @@ -21245,7 +21827,6 @@ function widget:MouseRelease(mx, my, mButton) end interactionState.areFormationDragging = false - elseif interactionState.areBuildDragging then -- End build drag - issue all build commands local minDragDistance = 5 @@ -21310,7 +21891,7 @@ function widget:MouseRelease(mx, my, mButton) if isMinimapMode then -- In minimap mode, preserve current camera zoom but apply offset and limits -- Get current world camera zoom equivalent from height/dist - local referenceHeight = 1200 -- At zoom 1.0 + local referenceHeight = 1200 -- At zoom 1.0 local currentHeight = curCamState.height or curCamState.dist or 2000 local currentZoom = referenceHeight / currentHeight @@ -21337,7 +21918,7 @@ function widget:MouseRelease(mx, my, mButton) if adjustZoom then -- Convert zoom to camera height/dist: height = referenceHeight / zoom -- Reference: at zoom 0.5, height is ~2400 elmos (typical gameplay view) - local referenceHeight = 1200 -- At zoom 1.0 + local referenceHeight = 1200 -- At zoom 1.0 local targetHeight = referenceHeight / targetZoom -- Set height/dist based on camera type diff --git a/luaui/Widgets/gui_pip2.lua b/luaui/Widgets/gui_pip2.lua index d923978196d..42ac646ff6c 100644 --- a/luaui/Widgets/gui_pip2.lua +++ b/luaui/Widgets/gui_pip2.lua @@ -8,15 +8,15 @@ VFS.Include("LuaUI/Widgets/gui_pip.lua") -- Override GetInfo to change the name and layer widget.GetInfo = function() return { - name = "Picture-in-Picture "..pipNumber, - desc = "Second PiP window instance", - author = "Floris", - version = "1.0", - date = "November 2025", - license = "GNU GPL, v2 or later", - layer = (99020-pipNumber), - enabled = false, - handler = true, + name = "Picture-in-Picture " .. pipNumber, + desc = "Second PiP window instance", + author = "Floris", + version = "1.0", + date = "November 2025", + license = "GNU GPL, v2 or later", + layer = (99020 - pipNumber), + enabled = false, + handler = true, } end diff --git a/luaui/Widgets/gui_pip_minimap.lua b/luaui/Widgets/gui_pip_minimap.lua index d8d4e90ace5..792a69ca1dc 100644 --- a/luaui/Widgets/gui_pip_minimap.lua +++ b/luaui/Widgets/gui_pip_minimap.lua @@ -6,23 +6,22 @@ -- - No minimize button (always visible) -- - Calls DrawInMiniMap overlays from other widgets during R2T rendering -pipNumber = 0 -- Triggers minimap mode in gui_pip.lua +pipNumber = 0 -- Triggers minimap mode in gui_pip.lua VFS.Include("LuaUI/Widgets/gui_pip.lua") - -- Override GetInfo to change the name and layer widget.GetInfo = function() return { - name = "Picture-in-Picture Minimap", - desc = "Replaces minimap with an interactive PIP-style map view. Supports panning, zooming, and unit tracking.", - author = "Floris", - version = "1.0", - date = "January 2026", - license = "GNU GPL, v2 or later", - layer = -99000, - enabled = true, - handler = true, + name = "Picture-in-Picture Minimap", + desc = "Replaces minimap with an interactive PIP-style map view. Supports panning, zooming, and unit tracking.", + author = "Floris", + version = "1.0", + date = "January 2026", + license = "GNU GPL, v2 or later", + layer = -99000, + enabled = true, + handler = true, } end diff --git a/luaui/Widgets/gui_point_tracker.lua b/luaui/Widgets/gui_point_tracker.lua index 547fb227a6e..522bb639bcf 100644 --- a/luaui/Widgets/gui_point_tracker.lua +++ b/luaui/Widgets/gui_point_tracker.lua @@ -1,4 +1,3 @@ - local widget = widget ---@type Widget function widget:GetInfo() @@ -9,11 +8,10 @@ function widget:GetInfo() date = "20211020", license = "GNU GPL, v2 or later", layer = 20, -- below most GUI elements, which generally go up to 10 - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo @@ -64,15 +62,14 @@ end -- GL4 Stuff -- local mapMarkInstanceVBO = nil -local mapMarkShader= nil +local mapMarkShader = nil local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance -local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO - +local drawInstanceVBO = InstanceVBOTable.drawInstanceVBO local function ClearPoints() mapPoints = {} @@ -80,11 +77,10 @@ local function ClearPoints() end local shaderParams = { - MAPMARKERSIZE = 0.035, - LIFEFRAMES = timeToLive, - } -local vsSrc = -[[ + MAPMARKERSIZE = 0.035, + LIFEFRAMES = timeToLive, +} +local vsSrc = [[ #version 420 layout (location = 0) in vec2 position; @@ -187,8 +183,7 @@ void main() } ]] -local fsSrc = -[[ +local fsSrc = [[ #version 420 #line 20000 @@ -205,86 +200,115 @@ void main(void) { fragColor = vec4(blendedcolor.rgba); } ]] local function goodbye(reason) - spEcho("Point Tracker GL4 widget exiting with reason: "..reason) - widgetHandler:RemoveWidget() + spEcho("Point Tracker GL4 widget exiting with reason: " .. reason) + widgetHandler:RemoveWidget() end function makeMarkerVBO() -- makes points with xyzw GL.LINES - local markerVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if markerVBO == nil then return nil end + local markerVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if markerVBO == nil then + return nil + end - local VBOLayout = { {id = 0, name = "position_xy", size = 2}, } + local VBOLayout = { { id = 0, name = "position_xy", size = 2 } } local VBOData = { -- A CROSSHAIR, each set of 4 points in a line in XY space - -1, -1, -1, 1, - -1, 1, 1, 1, - 1, 1, 1, -1, - 1, -1 , -1, -1 , - 0, -0.75, 0, -1.25, - 0.75, 0, 1.25, 0, - 0, 0.75, 0, 1.25, - -0.75, 0, -1.25, 0, - 0, 0.01, 0, -0.01, - 0.01,0, -0.01,0, + -1, + -1, + -1, + 1, + -1, + 1, + 1, + 1, + 1, + 1, + 1, + -1, + 1, + -1, + -1, + -1, + 0, + -0.75, + 0, + -1.25, + 0.75, + 0, + 1.25, + 0, + 0, + 0.75, + 0, + 1.25, + -0.75, + 0, + -1.25, + 0, + 0, + 0.01, + 0, + -0.01, + 0.01, + 0, + -0.01, + 0, } - markerVBO:Define( #VBOData/2, VBOLayout) + markerVBO:Define(#VBOData / 2, VBOLayout) markerVBO:Upload(VBOData) - return markerVBO, #VBOData/2 + return markerVBO, #VBOData / 2 end local function initGL4() - local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() vsSrc = vsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) fsSrc = fsSrc:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - mapMarkShader = LuaShader( - { - vertex = vsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderParams)), - fragment = fsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderParams)), - uniformInt = { - }, - uniformFloat = { - isMiniMap = 0, - mapRotation = 0, - pipVisibleArea = {0, 1, 0, 1}, -- left, right, bottom, top for PIP minimap - }, - }, - "mapMarkShader GL4" - ) - shaderCompiled = mapMarkShader - mapMarkShader:Initialize() - if not shaderCompiled then goodbye("Failed to compile mapMarkShader GL4 ") end - local markerVBO,numVertices = makeMarkerVBO() --xyzw - local mapMarkInstanceVBOLayout = { - {id = 1, name = 'posradius', size = 4}, -- posradius - {id = 2, name = 'colorlife', size = 4}, -- color + startgameframe - } - mapMarkInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(mapMarkInstanceVBOLayout, 32, "mapMarkInstanceVBO") - mapMarkInstanceVBO.numVertices = numVertices - mapMarkInstanceVBO.vertexVBO = markerVBO - mapMarkInstanceVBO.VAO = InstanceVBOTable.makeVAOandAttach(mapMarkInstanceVBO.vertexVBO, mapMarkInstanceVBO.instanceVBO) - mapMarkInstanceVBO.primitiveType = GL.LINES - - if false then -- testing - pushElementInstance(mapMarkInstanceVBO, { 200, 400, 200, 2000, 1, 0, 1, 1000000 }, nil, true) - end + mapMarkShader = LuaShader({ + vertex = vsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderParams)), + fragment = fsSrc:gsub("//__DEFINES__", LuaShader.CreateShaderDefinesString(shaderParams)), + uniformInt = {}, + uniformFloat = { + isMiniMap = 0, + mapRotation = 0, + pipVisibleArea = { 0, 1, 0, 1 }, -- left, right, bottom, top for PIP minimap + }, + }, "mapMarkShader GL4") + shaderCompiled = mapMarkShader + mapMarkShader:Initialize() + if not shaderCompiled then + goodbye("Failed to compile mapMarkShader GL4 ") + end + local markerVBO, numVertices = makeMarkerVBO() --xyzw + local mapMarkInstanceVBOLayout = { + { id = 1, name = "posradius", size = 4 }, -- posradius + { id = 2, name = "colorlife", size = 4 }, -- color + startgameframe + } + mapMarkInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(mapMarkInstanceVBOLayout, 32, "mapMarkInstanceVBO") + mapMarkInstanceVBO.numVertices = numVertices + mapMarkInstanceVBO.vertexVBO = markerVBO + mapMarkInstanceVBO.VAO = InstanceVBOTable.makeVAOandAttach(mapMarkInstanceVBO.vertexVBO, mapMarkInstanceVBO.instanceVBO) + mapMarkInstanceVBO.primitiveType = GL.LINES + + if false then -- testing + pushElementInstance(mapMarkInstanceVBO, { 200, 400, 200, 2000, 1, 0, 1, 1000000 }, nil, true) + end end -------------------------------------------------------------------------------- -- Draw Iteration -------------------------------------------------------------------------------- function DrawMapMarksWorld(isMiniMap) - if mapMarkInstanceVBO.usedElements > 0 then - --spEcho("DrawMapMarksWorld",isMiniMap, spGetGameFrame(), mapMarkInstanceVBO.usedElements) - glLineWidth(lineWidth) + if mapMarkInstanceVBO.usedElements > 0 then + --spEcho("DrawMapMarksWorld",isMiniMap, spGetGameFrame(), mapMarkInstanceVBO.usedElements) + glLineWidth(lineWidth) mapMarkShader:Activate() - mapMarkShader:SetUniform("isMiniMap",isMiniMap) + mapMarkShader:SetUniform("isMiniMap", isMiniMap) mapMarkShader:SetUniform("mapRotation", getCurrentMiniMapRotationOption() or 0) - + -- Pass PIP visible area if drawing in PIP minimap - if isMiniMap > 0 and WG['minimap'] and WG['minimap'].isDrawingInPip and WG['minimap'].getNormalizedVisibleArea then - local left, right, bottom, top = WG['minimap'].getNormalizedVisibleArea() + if isMiniMap > 0 and WG["minimap"] and WG["minimap"].isDrawingInPip and WG["minimap"].getNormalizedVisibleArea then + local left, right, bottom, top = WG["minimap"].getNormalizedVisibleArea() mapMarkShader:SetUniform("pipVisibleArea", left, right, bottom, top) else mapMarkShader:SetUniform("pipVisibleArea", 0, 1, 0, 1) @@ -304,7 +328,7 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - initGL4() + initGL4() myPlayerID = Spring.GetMyPlayerID() WG.PointTracker = { ClearPoints = ClearPoints, @@ -315,60 +339,65 @@ function widget:Shutdown() WG.PointTracker = nil end - - function widget:DrawScreen() if not enabled then return end - DrawMapMarksWorld(0) + DrawMapMarksWorld(0) end function widget:MapDrawCmd(playerID, cmdType, px, py, pz, label) - local spectator, fullView = GetSpectatingState() local _, _, _, playerTeam = GetPlayerInfo(playerID, false) - if label == "Start " .. playerTeam - or cmdType ~= "point" - or not (ArePlayersAllied(myPlayerID, playerID) or (spectator and fullView)) then + if label == "Start " .. playerTeam or cmdType ~= "point" or not (ArePlayersAllied(myPlayerID, playerID) or (spectator and fullView)) then return end - instanceIDgen= instanceIDgen + 1 + instanceIDgen = instanceIDgen + 1 local r, g, b = GetPlayerColor(playerID) - local gf = spGetGameFrame() - - pushElementInstance( - mapMarkInstanceVBO, - { - px, py, pz, 1.0, - r, g, b, gf - }, - instanceIDgen, -- key, generate me one if nil - true -- update exisiting - ) - if mapPoints[gf] then - mapPoints[gf][#mapPoints[gf] + 1]= instanceIDgen - else - mapPoints[gf] = {instanceIDgen} - end + local gf = spGetGameFrame() + + pushElementInstance( + mapMarkInstanceVBO, + { + px, + py, + pz, + 1.0, + r, + g, + b, + gf, + }, + instanceIDgen, -- key, generate me one if nil + true -- update exisiting + ) + if mapPoints[gf] then + mapPoints[gf][#mapPoints[gf] + 1] = instanceIDgen + else + mapPoints[gf] = { instanceIDgen } + end end function widget:GameFrame(n) - if mapPoints[n-timeToLive] then - for i, instanceID in ipairs(mapPoints[n-timeToLive]) do - popElementInstance(mapMarkInstanceVBO,instanceID) - end - end + if mapPoints[n - timeToLive] then + for i, instanceID in ipairs(mapPoints[n - timeToLive]) do + popElementInstance(mapMarkInstanceVBO, instanceID) + end + end end function widget:DrawInMiniMap(sx, sy) - if not enabled then return end + if not enabled then + return + end -- Don't draw map marks inside the PIP minimap - if WG['minimap'] and WG['minimap'].isDrawingInPip then return end + if WG["minimap"] and WG["minimap"].isDrawingInPip then + return + end -- this fixes drawing on only 1 quadrant of minimap as pwe - gl.ClipDistance ( 1, false) - gl.ClipDistance ( 3, false) - DrawMapMarksWorld(1) + gl.ClipDistance(1, false) + gl.ClipDistance(3, false) + DrawMapMarksWorld(1) end function widget:ClearMapMarks() diff --git a/luaui/Widgets/gui_pregame_build.lua b/luaui/Widgets/gui_pregame_build.lua index 05512c45424..f4657ab2e46 100644 --- a/luaui/Widgets/gui_pregame_build.lua +++ b/luaui/Widgets/gui_pregame_build.lua @@ -15,7 +15,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathAbs = math.abs local mathCeil = math.ceil @@ -71,7 +70,7 @@ local BUILD_MODE = { LINE = 1, GRID = 2, BOX = 3, - AROUND = 4 + AROUND = 4, } local SQUARE_SIZE = 8 @@ -209,7 +208,7 @@ end local function convertBuildQueueFaction(previousFactionSide, currentFactionSide) Spring.Log("gui_pregame_build", LOG.DEBUG, string.format("Calling SubLogic.processBuildQueueSubstitution (in-place) from %s to %s for %d queue items.", previousFactionSide, currentFactionSide, #buildQueue)) local result = SubLogic.processBuildQueueSubstitution(buildQueue, previousFactionSide, currentFactionSide) - + if result.substitutionFailed then spEcho(string.format("[gui_pregame_build] %s", result.summaryMessage)) end @@ -271,12 +270,12 @@ function widget:Initialize() local inBuildOptions = {} -- Ensure startDefID is valid before trying to access UnitDefs[startDefID] if startDefID and UnitDefs[startDefID] and UnitDefs[startDefID].buildOptions then - for _, opt in ipairs(UnitDefs[startDefID].buildOptions) do - inBuildOptions[opt] = true - end + for _, opt in ipairs(UnitDefs[startDefID].buildOptions) do + inBuildOptions[opt] = true + end else - Spring.Log(widget:GetInfo().name, LOG.WARNING, "setPreGamestartDefID: startDefID is nil or invalid, cannot determine build options.") - end + Spring.Log(widget:GetInfo().name, LOG.WARNING, "setPreGamestartDefID: startDefID is nil or invalid, cannot determine build options.") + end if inBuildOptions[value] then setPreGamestartDefID(value) @@ -303,7 +302,9 @@ end local function GetBuildingDimensions(unitDefID, facing) local buildingDef = UnitDefs[unitDefID] - if not buildingDef then return 0, 0 end + if not buildingDef then + return 0, 0 + end local FACING_WEST_OR_EAST = 1 if facing % 2 == FACING_WEST_OR_EAST then @@ -328,7 +329,7 @@ local function snapPosition(unitDefID, pos, facing) else result.z = mathFloor((pos.z + SQUARE_SIZE) / BUILD_SQUARE_SIZE) * BUILD_SQUARE_SIZE end - + return result end @@ -357,10 +358,10 @@ end local function calculateBuildingPlacementSteps(unitDefID, startPos, endPos, spacing, facing) local buildingWidth, buildingHeight = GetBuildingDimensions(unitDefID, facing) local delta = { x = endPos.x - startPos.x, z = endPos.z - startPos.z } - + local xSize = buildingWidth + SQUARE_SIZE * spacing * 2 local zSize = buildingHeight + SQUARE_SIZE * spacing * 2 - + local xCount = mathFloor((mathAbs(delta.x) + xSize * BUILDING_COUNT_FUDGE_FACTOR) / xSize) local zCount = mathFloor((mathAbs(delta.z) + zSize * BUILDING_COUNT_FUDGE_FACTOR) / zSize) @@ -384,12 +385,12 @@ local function getBuildPositionsLine(unitDefID, facing, startPos, endPos, spacin if not startPos or not endPos then return {} end - + local snappedStart = snapPosition(unitDefID, startPos, facing) local snappedEnd = snapPosition(unitDefID, endPos, facing) - + local xStep, zStep, xCount, zCount, delta = calculateBuildingPlacementSteps(unitDefID, snappedStart, snappedEnd, spacing or 0, facing) - + local xGreaterThanZ = mathAbs(delta.x) > mathAbs(delta.z) if xGreaterThanZ then @@ -406,7 +407,7 @@ local function getBuildPositionsGrid(unitDefID, facing, startPos, endPos, spacin if not startPos or not endPos then return {} end - + local snappedStart = snapPosition(unitDefID, startPos, facing) local snappedEnd = snapPosition(unitDefID, endPos, facing) @@ -430,7 +431,7 @@ local function getBuildPositionsBox(unitDefID, facing, startPos, endPos, spacing if not startPos or not endPos then return {} end - + local snappedStart = snapPosition(unitDefID, startPos, facing) local snappedEnd = snapPosition(unitDefID, endPos, facing) @@ -477,18 +478,18 @@ local function getBuildPositionsAround(unitDefID, facing, target) local sides = { -- top (south) - {z = target.z + targetBuildingHeight * HALF + currentBuildingHeight * HALF, count = widthBuildingCount, step = currentBuildingWidth, facing = 0, axis = "x"}, + { z = target.z + targetBuildingHeight * HALF + currentBuildingHeight * HALF, count = widthBuildingCount, step = currentBuildingWidth, facing = 0, axis = "x" }, -- bottom (north) - {z = target.z - targetBuildingHeight * HALF - currentBuildingHeight * HALF, count = widthBuildingCount, step = currentBuildingWidth, facing = 2, axis = "x"}, + { z = target.z - targetBuildingHeight * HALF - currentBuildingHeight * HALF, count = widthBuildingCount, step = currentBuildingWidth, facing = 2, axis = "x" }, -- left (west) - {x = target.x - targetBuildingWidth * HALF - currentBuildingWidth * HALF, count = heightBuildingCount, step = currentBuildingHeight, facing = 3, axis = "z"}, + { x = target.x - targetBuildingWidth * HALF - currentBuildingWidth * HALF, count = heightBuildingCount, step = currentBuildingHeight, facing = 3, axis = "z" }, -- right (east) - {x = target.x + targetBuildingWidth * HALF + currentBuildingWidth * HALF, count = heightBuildingCount, step = currentBuildingHeight, facing = 1, axis = "z"} + { x = target.x + targetBuildingWidth * HALF + currentBuildingWidth * HALF, count = heightBuildingCount, step = currentBuildingHeight, facing = 1, axis = "z" }, } for _, side in ipairs(sides) do for i = 0, side.count - 1 do - local pos = {x = side.x or startX, y = 0, z = side.z or startZ, facing = side.facing} + local pos = { x = side.x or startX, y = 0, z = side.z or startZ, facing = side.facing } if side.axis == "x" then pos.x = startX + i * side.step else @@ -529,7 +530,7 @@ local BUILD_POSITION_FUNCTIONS = { [BUILD_MODE.LINE] = getBuildPositionsLine, [BUILD_MODE.GRID] = getBuildPositionsGrid, [BUILD_MODE.BOX] = getBuildPositionsBox, - [BUILD_MODE.AROUND] = getBuildPositionsAround + [BUILD_MODE.AROUND] = getBuildPositionsAround, } local function getGhostBuildingUnderCursor(mouseX, mouseY) @@ -537,7 +538,7 @@ local function getGhostBuildingUnderCursor(mouseX, mouseY) if not cursorWorldPositionRaw then return nil end - local cursorWorldPosition = { x = cursorWorldPositionRaw[1], y = cursorWorldPositionRaw[2], z = cursorWorldPositionRaw[3]} + local cursorWorldPosition = { x = cursorWorldPositionRaw[1], y = cursorWorldPositionRaw[2], z = cursorWorldPositionRaw[3] } for buildingIndex = #buildQueue, 1, -1 do local buildingData = buildQueue[buildingIndex] @@ -545,7 +546,7 @@ local function getGhostBuildingUnderCursor(mouseX, mouseY) local ghostPosition = { x = buildingData[2], y = buildingData[3], - z = buildingData[4] + z = buildingData[4], } local distanceToBuilding = math.distance2d(cursorWorldPosition.x, cursorWorldPosition.z, ghostPosition.x, ghostPosition.z) local buildingWidth, buildingHeight = GetBuildingDimensions(buildingData[1], buildingData[5] or 0) @@ -557,7 +558,7 @@ local function getGhostBuildingUnderCursor(mouseX, mouseY) x = buildingData[2], y = buildingData[3], z = buildingData[4], - facing = buildingData[5] or 0 + facing = buildingData[5] or 0, } end end @@ -615,18 +616,9 @@ local function DrawBuilding(buildData, borderColor, drawRanges, alpha) gl.Color(1.0, 0.0, 0.0, 0.5) gl.DrawGroundCircle(bx, by, bz, Game.extractorRadius, 50) end - end if WG.StopDrawUnitShapeGL4 then - local id = buildData[1] - .. "_" - .. buildData[2] - .. "_" - .. buildData[3] - .. "_" - .. buildData[4] - .. "_" - .. buildData[5] + local id = buildData[1] .. "_" .. buildData[2] .. "_" .. buildData[3] .. "_" .. buildData[4] .. "_" .. buildData[5] addUnitShape(id, buildData[1], buildData[2], buildData[3], buildData[4], buildData[5] * (math.pi / 2), myTeamID, alpha) end end @@ -654,13 +646,13 @@ function widget:Update(dt) if not preGamestartPlayer then return end - + updateTime = updateTime + dt if updateTime < UPDATE_PERIOD then return end updateTime = 0 - + local x, y, leftButton = spGetMouseState() local _, _, _, shift = Spring.GetModKeyState() @@ -730,20 +722,20 @@ function widget:Update(dt) buildModeState.buildPositions = {} return end - + local alt, ctrl, meta, shift = Spring.GetModKeyState() - + if not shift and buildModeState.startPosition then buildModeState.startPosition = nil buildModeState.buildPositions = {} return end - + if not buildModeState.startPosition then return end local modKeys = { alt, ctrl, meta, shift } - + local buildAroundTarget = getGhostBuildingUnderCursor(x, y) local endPosition = getMouseWorldPosition(selBuildQueueDefID, x, y) @@ -921,8 +913,7 @@ function widget:MousePress(mx, my, button) buildModeState.buildPositions = {} return true end - - + if (meta or not shift) and cx ~= -100 then local cbx, cby, cbz = Spring.Pos2BuildPos(startDefID, cx, cy, cz) @@ -987,7 +978,7 @@ function widget:MousePress(mx, my, button) return true end - if button == 1 and #buildQueue > 0 and buildQueue[1][1]>0 then + if button == 1 and #buildQueue > 0 and buildQueue[1][1] > 0 then local _, pos = spTraceScreenRay(mx, my, true, false, false, isUnderwater(startDefID)) if not pos then return @@ -1007,30 +998,20 @@ function widget:MousePress(mx, my, button) end local function hasCacheExpired(currentStartPos, currentSelBuildData) - local startPosChanged = not cachedStartPosition or - cachedStartPosition.x ~= currentStartPos.x or - cachedStartPosition.y ~= currentStartPos.y or - cachedStartPosition.z ~= currentStartPos.z + local startPosChanged = not cachedStartPosition or cachedStartPosition.x ~= currentStartPos.x or cachedStartPosition.y ~= currentStartPos.y or cachedStartPosition.z ~= currentStartPos.z local currentMetrics = { - firstItemCoords = buildQueue[1] and {buildQueue[1][2], buildQueue[1][3], buildQueue[1][4]} or nil, - queueLength = #buildQueue + firstItemCoords = buildQueue[1] and { buildQueue[1][2], buildQueue[1][3], buildQueue[1][4] } or nil, + queueLength = #buildQueue, } - local queueChanged = not cachedQueueMetrics or - currentMetrics.queueLength ~= cachedQueueMetrics.queueLength or - (currentMetrics.firstItemCoords and cachedQueueMetrics.firstItemCoords and ( - currentMetrics.firstItemCoords[1] ~= cachedQueueMetrics.firstItemCoords[1] or - currentMetrics.firstItemCoords[2] ~= cachedQueueMetrics.firstItemCoords[2] or - currentMetrics.firstItemCoords[3] ~= cachedQueueMetrics.firstItemCoords[3] - )) or - (currentMetrics.firstItemCoords == nil) ~= (cachedQueueMetrics.firstItemCoords == nil) + local queueChanged = not cachedQueueMetrics or currentMetrics.queueLength ~= cachedQueueMetrics.queueLength or (currentMetrics.firstItemCoords and cachedQueueMetrics.firstItemCoords and (currentMetrics.firstItemCoords[1] ~= cachedQueueMetrics.firstItemCoords[1] or currentMetrics.firstItemCoords[2] ~= cachedQueueMetrics.firstItemCoords[2] or currentMetrics.firstItemCoords[3] ~= cachedQueueMetrics.firstItemCoords[3])) or (currentMetrics.firstItemCoords == nil) ~= (cachedQueueMetrics.firstItemCoords == nil) if startPosChanged or queueChanged or forceRefreshCache then - cachedStartPosition = {x = currentStartPos.x, y = currentStartPos.y, z = currentStartPos.z} + cachedStartPosition = { x = currentStartPos.x, y = currentStartPos.y, z = currentStartPos.z } cachedQueueMetrics = { - firstItemCoords = currentMetrics.firstItemCoords and {unpack(currentMetrics.firstItemCoords)} or nil, - queueLength = currentMetrics.queueLength + firstItemCoords = currentMetrics.firstItemCoords and { unpack(currentMetrics.firstItemCoords) } or nil, + queueLength = currentMetrics.queueLength, } forceRefreshCache = false return true @@ -1088,11 +1069,10 @@ function widget:DrawWorld() startDefID = Spring.GetTeamRulesParam(myTeamID, "startUnit") end - local sx, sy, sz = Spring.GetTeamStartPosition(myTeamID) -- Returns 0, 0, 0 when none chosen (was -100, -100, -100 previously) --should startposition not match 0,0,0 and no commander is placed, then there is a green circle on the map till one is placed --TODO: be based on the map, if position is changed from default(?) - local startChosen = (sx ~= 0) or (sy ~=0) or (sz~=0) + local startChosen = (sx ~= 0) or (sy ~= 0) or (sz ~= 0) if startChosen and startDefID then -- Correction for start positions in the air sy = spGetGroundHeight(sx, sz) @@ -1107,30 +1087,27 @@ function widget:DrawWorld() -- Check for faction change if prevStartDefID ~= startDefID then - local prevDefName = prevStartDefID and UnitDefs[prevStartDefID] and UnitDefs[prevStartDefID].name - local currentDefName = startDefID and UnitDefs[startDefID] and UnitDefs[startDefID].name - - local previousFactionSide = prevDefName and SubLogic.getSideFromUnitName(prevDefName) - local currentFactionSide = currentDefName and SubLogic.getSideFromUnitName(currentDefName) - - if previousFactionSide and currentFactionSide and previousFactionSide ~= currentFactionSide then - convertBuildQueueFaction(previousFactionSide, currentFactionSide) - if selBuildQueueDefID then - selBuildQueueDefID = handleSelectedBuildingConversion(selBuildQueueDefID, previousFactionSide, currentFactionSide, selBuildData) - end - elseif previousFactionSide and currentFactionSide and previousFactionSide == currentFactionSide then - Spring.Log(widget:GetInfo().name, LOG.DEBUG, string.format( - "Sides determined but are the same (%s), no conversion needed.", currentFactionSide)) - else - Spring.Log(widget:GetInfo().name, LOG.WARNING, string.format( - "Could not determine sides for conversion: prevDefID=%s (name: %s), currentDefID=%s (name: %s). Names might be unhandled by SubLogic.getSideFromUnitName, or SubLogic itself might be incomplete from a non-critical load error.", - tostring(prevStartDefID), tostring(prevDefName), tostring(startDefID), tostring(currentDefName))) - end - prevStartDefID = startDefID + local prevDefName = prevStartDefID and UnitDefs[prevStartDefID] and UnitDefs[prevStartDefID].name + local currentDefName = startDefID and UnitDefs[startDefID] and UnitDefs[startDefID].name + + local previousFactionSide = prevDefName and SubLogic.getSideFromUnitName(prevDefName) + local currentFactionSide = currentDefName and SubLogic.getSideFromUnitName(currentDefName) + + if previousFactionSide and currentFactionSide and previousFactionSide ~= currentFactionSide then + convertBuildQueueFaction(previousFactionSide, currentFactionSide) + if selBuildQueueDefID then + selBuildQueueDefID = handleSelectedBuildingConversion(selBuildQueueDefID, previousFactionSide, currentFactionSide, selBuildData) + end + elseif previousFactionSide and currentFactionSide and previousFactionSide == currentFactionSide then + Spring.Log(widget:GetInfo().name, LOG.DEBUG, string.format("Sides determined but are the same (%s), no conversion needed.", currentFactionSide)) + else + Spring.Log(widget:GetInfo().name, LOG.WARNING, string.format("Could not determine sides for conversion: prevDefID=%s (name: %s), currentDefID=%s (name: %s). Names might be unhandled by SubLogic.getSideFromUnitName, or SubLogic itself might be incomplete from a non-critical load error.", tostring(prevStartDefID), tostring(prevDefName), tostring(startDefID), tostring(currentDefName))) + end + prevStartDefID = startDefID end local alphaResults = cachedAlphaResults - local cacheExpired = hasCacheExpired({x = sx, y = sy, z = sz}, selBuildData) + local cacheExpired = hasCacheExpired({ x = sx, y = sy, z = sz }, selBuildData) if not alphaResults or cacheExpired then alphaResults = { queueAlphas = {}, selectedAlpha = ALPHA_DEFAULT } @@ -1365,14 +1342,8 @@ function widget:DrawWorld() if selBuildData and showSelectedBuilding then local isMex = UnitDefs[selBuildQueueDefID] and UnitDefs[selBuildQueueDefID].extractsMetal > 0 - local testOrder = spTestBuildOrder( - selBuildQueueDefID, - selBuildData[2], - selBuildData[3], - selBuildData[4], - selBuildData[5] - ) ~= 0 - + local testOrder = spTestBuildOrder(selBuildQueueDefID, selBuildData[2], selBuildData[3], selBuildData[4], selBuildData[5]) ~= 0 + local isSelectedSpawned = false local selectedAlpha = ALPHA_DEFAULT local getBuildQueueSpawnStatus = WG["getBuildQueueSpawnStatus"] @@ -1381,7 +1352,7 @@ function widget:DrawWorld() isSelectedSpawned = spawnStatus.selectedSpawned or false selectedAlpha = isSelectedSpawned and ALPHA_SPAWNED or ALPHA_DEFAULT end - + if not isMex then local color = testOrder and (isSelectedSpawned and BORDER_COLOR_SPAWNED or BORDER_COLOR_VALID) or BORDER_COLOR_INVALID DrawBuilding(selBuildData, color, true, selectedAlpha) @@ -1444,9 +1415,9 @@ function widget:GameFrame(n) if tasker then local quickStartOption = Spring.GetModOptions().quick_start local quickStartEnabled = quickStartOption ~= "disabled" - + if quickStartEnabled and #buildQueue > 0 then - --we have to temporary Echo data like this because there are reports of builds that should be spawned in quickstart not being spawned. + --we have to temporary Echo data like this because there are reports of builds that should be spawned in quickstart not being spawned. --Widget data isn't caught in replays so we have to echo this for now. 1/12/26 Spring.Echo(string.format("=== Build Queue for Commander (unitID: %d) ===", tasker)) for b = 1, #buildQueue do @@ -1459,15 +1430,10 @@ function widget:GameFrame(n) end Spring.Echo(string.format("=== Total queue items: %d ===", #buildQueue)) end - + for b = 1, #buildQueue do local buildData = buildQueue[b] - Spring.GiveOrderToUnit( - tasker, - -buildData[1], - { buildData[2], buildData[3], buildData[4], buildData[5] }, - { "shift" } - ) + Spring.GiveOrderToUnit(tasker, -buildData[1], { buildData[2], buildData[3], buildData[4], buildData[5] }, { "shift" }) end buildQueue = {} end @@ -1479,8 +1445,8 @@ function widget:GameStart() -- Ensure startDefID is current for GameStart logic, though DrawWorld might have already updated prevStartDefID local currentStartDefID_GS = Spring.GetTeamRulesParam(myTeamID, "startUnit") if startDefID ~= currentStartDefID_GS then - Spring.Log("gui_pregame_build", LOG.DEBUG, string.format("GameStart: startDefID (%s) differs from current rules param (%s). Updating.", tostring(startDefID), tostring(currentStartDefID_GS))) - startDefID = currentStartDefID_GS + Spring.Log("gui_pregame_build", LOG.DEBUG, string.format("GameStart: startDefID (%s) differs from current rules param (%s). Updating.", tostring(startDefID), tostring(currentStartDefID_GS))) + startDefID = currentStartDefID_GS end if prevStartDefID ~= startDefID then @@ -1500,7 +1466,6 @@ function widget:GameStart() prevStartDefID = startDefID end - -- Deattach pregame action handlers widgetHandler:RemoveAction("stop") widgetHandler:RemoveAction("buildfacing") @@ -1536,12 +1501,7 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - if - data.buildQueue - and spGetGameFrame() == 0 - and data.gameID - and data.gameID == (Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID")) - then + if data.buildQueue and spGetGameFrame() == 0 and data.gameID and data.gameID == (Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID")) then buildQueue = data.buildQueue end end diff --git a/luaui/Widgets/gui_pregameui.lua b/luaui/Widgets/gui_pregameui.lua index 28ad89f141b..ce7913eb93c 100644 --- a/luaui/Widgets/gui_pregameui.lua +++ b/luaui/Widgets/gui_pregameui.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "July 2021", license = "GNU GPL, v2 or later", layer = -3, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -33,13 +32,13 @@ myPlayerName = ((WG.playernames and WG.playernames.getPlayername) and WG.playern local isFFA = Spring.Utilities.Gametype.IsFFA() local isReplay = Spring.IsReplay() -local readyButtonColor = {0.05, 0.28, 0} -local unreadyButtonColor = {0.28, 0.05, 0} -local subButtonColor = {0.08, 0.22, 0} -local unsubButtonColor = {0.22, 0.08, 0} +local readyButtonColor = { 0.05, 0.28, 0 } +local unreadyButtonColor = { 0.28, 0.05, 0 } +local subButtonColor = { 0.08, 0.22, 0 } +local unsubButtonColor = { 0.22, 0.08, 0 } -local readied = false -- send readystate (in widget:GameSetup) -local pressedReady -- pressed button +local readied = false -- send readystate (in widget:GameSetup) +local pressedReady -- pressed button local startPointChosen = false local NETMSG_STARTPLAYING = 4 -- see BaseNetProtocol.h, packetID sent during the 3.2.1 countdown @@ -62,9 +61,9 @@ local buttonW = mathFloor(orgbuttonW * uiScale / 2) * 2 local buttonH = mathFloor(orgbuttonH * uiScale / 2) * 2 local buttonList, buttonHoverList -local buttonText = '' +local buttonText = "" local buttonDrawn = false -local lockText = '' +local lockText = "" local locked = false local isReadyBlocked = false local readyBlockedConditions = {} @@ -102,10 +101,10 @@ local unitshapes = {} local teamStartPositions = {} local teamList = Spring.GetTeamList() -local uiElementRect = {0,0,0,0} -local uiLockRect = {0,0,0,0} -local buttonRect = {0,0,0,0} -local lockRect = {0,0,0,0} +local uiElementRect = { 0, 0, 0, 0 } +local uiLockRect = { 0, 0, 0, 0 } +local buttonRect = { 0, 0, 0, 0 } +local lockRect = { 0, 0, 0, 0 } local blinkButton = false local function createButton() @@ -129,42 +128,42 @@ local function createButton() gl.DeleteList(buttonList) buttonList = gl.CreateList(function() UiElement(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], 1, 1, 1, 1, 1, 1, 1, 1) - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1]*0.55, color[2]*0.55, color[3]*0.55, 1 }, { color[1], color[2], color[3], 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1] * 0.55, color[2] * 0.55, color[3] * 0.55, 1 }, { color[1], color[2], color[3], 1 }) end) gl.DeleteList(buttonHoverList) buttonHoverList = gl.CreateList(function() UiElement(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], 1, 1, 1, 1, 1, 1, 1, 1) - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1]*0.85, color[2]*0.85, color[3]*0.85, 1 }, { color[1]*1.5, color[2]*1.5, color[3]*1.5, 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1] * 0.85, color[2] * 0.85, color[3] * 0.85, 1 }, { color[1] * 1.5, color[2] * 1.5, color[3] * 1.5, 1 }) end) end function widget:ViewResize(viewSizeX, viewSizeY) if mySpec then if not offeredAsSub then - buttonText = Spring.I18N('ui.substitutePlayers.offer') + buttonText = Spring.I18N("ui.substitutePlayers.offer") else - buttonText = Spring.I18N('ui.substitutePlayers.withdraw') + buttonText = Spring.I18N("ui.substitutePlayers.withdraw") end else if readied then if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = Spring.I18N("ui.initialSpawn.unlock") else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = Spring.I18N("ui.initialSpawn.lock") end else - buttonText = Spring.I18N('ui.initialSpawn.ready') + buttonText = Spring.I18N("ui.initialSpawn.ready") end end vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont(2) + font = WG["fonts"].getFont(2) uiScale = (0.75 + (vsx * vsy / 6000000)) buttonX = mathFloor(vsx * buttonPosX) buttonY = mathFloor(vsy * buttonPosY) - orgbuttonW = font:GetTextWidth(' '..buttonText) * 24 + orgbuttonW = font:GetTextWidth(" " .. buttonText) * 24 buttonW = mathFloor(orgbuttonW * uiScale / 2) * 2 buttonH = mathFloor(orgbuttonH * uiScale / 2) * 2 @@ -174,7 +173,6 @@ function widget:ViewResize(viewSizeX, viewSizeY) uiPadding = mathFloor(elementPadding * 4.5) createButton() - end local ihavejoined = false @@ -189,7 +187,7 @@ function widget:GameSetup(state, ready, playerStates) -- check when the 3.2.1 countdown starts if not gameStarting and ((Spring.GetPlayerTraffic(SYSTEM_ID, NETMSG_STARTPLAYING) or 0) > 0) then - gameStarting = true -- ugly but effective (can also detect by parsing state string) + gameStarting = true -- ugly but effective (can also detect by parsing state string) end -- if we can't choose startpositions, no need for ready button etc @@ -205,7 +203,7 @@ function widget:GameSetup(state, ready, playerStates) if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready then auto_ready_timer = auto_ready_timer - Spring.GetLastUpdateSeconds() end - if auto_ready_timer <=0 and auto_ready == true then + if auto_ready_timer <= 0 and auto_ready == true then return true, true end @@ -224,17 +222,14 @@ function widget:GameSetup(state, ready, playerStates) end return true, ready - end function widget:MousePress(sx, sy) if buttonDrawn then - -- pressing button element if sx > uiElementRect[1] and sx < uiElementRect[3] and sy > uiElementRect[2] and sy < uiElementRect[4] then -- pressing actual button if sx > buttonRect[1] and sx < buttonRect[3] and sy > buttonRect[2] and sy < buttonRect[4] then - -- if not pressed on ready if not readied then if not mySpec then @@ -249,20 +244,19 @@ function widget:MousePress(sx, sy) locked = true Spring.SendLuaRulesMsg("locking_in_place") else - spEcho(Spring.I18N('ui.initialSpawn.choosePoint')) + spEcho(Spring.I18N("ui.initialSpawn.choosePoint")) end - end -- substitute elseif eligibleAsSub then offeredAsSub = not offeredAsSub if offeredAsSub then - spEcho(Spring.I18N('ui.substitutePlayers.substitutionMessage')) + spEcho(Spring.I18N("ui.substitutePlayers.substitutionMessage")) else - spEcho(Spring.I18N('ui.substitutePlayers.offerWithdrawn')) + spEcho(Spring.I18N("ui.substitutePlayers.offerWithdrawn")) end - Spring.SendLuaRulesMsg(offeredAsSub and '\144' or '\145') + Spring.SendLuaRulesMsg(offeredAsSub and "\144" or "\145") end -- lock position text showing else @@ -279,7 +273,6 @@ function widget:MousePress(sx, sy) end return true end - end end @@ -331,9 +324,9 @@ function widget:Initialize() widget:ViewResize(vsx, vsy) checkStartPointChosen() - - WG['pregameui'] = {} - WG['pregameui'].addReadyCondition = function(conditionKey, description) + + WG["pregameui"] = {} + WG["pregameui"].addReadyCondition = function(conditionKey, description) if conditionKey and description then readyBlockedConditions[conditionKey] = description isReadyBlocked = true @@ -341,14 +334,14 @@ function widget:Initialize() createButton() end end - WG['pregameui'].removeReadyCondition = function(conditionKey) + WG["pregameui"].removeReadyCondition = function(conditionKey) if conditionKey and readyBlockedConditions[conditionKey] then readyBlockedConditions[conditionKey] = nil updateReadyTooltip() createButton() end end - WG['pregameui'].clearAllReadyConditions = function() + WG["pregameui"].clearAllReadyConditions = function() readyBlockedConditions = {} isReadyBlocked = false updateReadyTooltip() @@ -361,8 +354,8 @@ function widget:DrawScreen() checkStartPointChosen() end - if WG['guishader'] then - WG['guishader'].RemoveRect('pregameui') + if WG["guishader"] then + WG["guishader"].RemoveRect("pregameui") end buttonDrawn = false @@ -370,7 +363,7 @@ function widget:DrawScreen() -- display autoready timer if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready then local colorString = auto_ready_timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) + local text = colorString .. Spring.I18N("ui.initialSpawn.startCountdown", { time = mathMax(1, mathFloor(auto_ready_timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() @@ -393,13 +386,11 @@ function widget:DrawScreen() if gameStarting then timer = timer + Spring.GetLastUpdateSeconds() local colorString = timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) + local text = colorString .. Spring.I18N("ui.initialSpawn.startCountdown", { time = mathMax(1, 3 - mathFloor(timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() - elseif showbutton == true then - local playerList = Spring.GetPlayerList() local numPlayers = #playerList local numPlayersReady = 0 @@ -414,14 +405,8 @@ function widget:DrawScreen() end buttonDrawn = true - if WG['guishader'] then - WG['guishader'].InsertRect( - uiElementRect[1], - uiElementRect[2], - uiElementRect[3], - uiElementRect[4], - 'pregameui' - ) + if WG["guishader"] then + WG["guishader"].InsertRect(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], "pregameui") end -- draw ready button and text @@ -430,9 +415,9 @@ function widget:DrawScreen() if x > buttonRect[1] and x < buttonRect[3] and y > buttonRect[2] and y < buttonRect[4] then gl.CallList(buttonHoverList) colorString = "\255\210\210\210" - - if isReadyBlocked and WG['tooltip'] then - WG['tooltip'].ShowTooltip('pregameui', cachedTooltipText) + + if isReadyBlocked and WG["tooltip"] then + WG["tooltip"].ShowTooltip("pregameui", cachedTooltipText) end else gl.CallList(buttonList) @@ -451,11 +436,11 @@ function widget:DrawScreen() end if blinkButton and not readied and not isReadyBlocked and os.clock() % 0.75 <= 0.375 then local mult = 1.33 - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { readyButtonColor[1]*0.55*mult, readyButtonColor[2]*0.55*mult, readyButtonColor[3]*0.55*mult, 1 }, { readyButtonColor[1]*mult, readyButtonColor[2]*mult, readyButtonColor[3]*mult, 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { readyButtonColor[1] * 0.55 * mult, readyButtonColor[2] * 0.55 * mult, readyButtonColor[3] * 0.55 * mult, 1 }, { readyButtonColor[1] * mult, readyButtonColor[2] * mult, readyButtonColor[3] * mult, 1 }) end end font:Begin() - font:Print(colorString .. buttonText, buttonRect[1]+((buttonRect[3]-buttonRect[1])/2), (buttonRect[2]+((buttonRect[4]-buttonRect[2])/2)) - (buttonH * 0.16), 24 * uiScale, "co") + font:Print(colorString .. buttonText, buttonRect[1] + ((buttonRect[3] - buttonRect[1]) / 2), (buttonRect[2] + ((buttonRect[4] - buttonRect[2]) / 2)) - (buttonH * 0.16), 24 * uiScale, "co") font:End() gl.Color(1, 1, 1, 1) end @@ -478,22 +463,24 @@ local function addUnitShape(id, unitDefID, px, py, pz, rotationY, teamID, opacit end function widget:DrawWorld() - if not WG.StopDrawUnitShapeGL4 then return end + if not WG.StopDrawUnitShapeGL4 then + return + end -- draw pregamestart commander models at start positions local id for i = 1, #teamList do local teamID = teamList[i] local tsx, tsy, tsz - if WG['map_startbox'] and WG['map_startbox'].GetEffectiveStartPosition then - tsx, tsy, tsz = WG['map_startbox'].GetEffectiveStartPosition(teamID) + if WG["map_startbox"] and WG["map_startbox"].GetEffectiveStartPosition then + tsx, tsy, tsz = WG["map_startbox"].GetEffectiveStartPosition(teamID) else tsx, tsy, tsz = Spring.GetTeamStartPosition(teamID) end if tsx and tsx > 0 then - local startUnitDefID = Spring.GetTeamRulesParam(teamID, 'startUnit') + local startUnitDefID = Spring.GetTeamRulesParam(teamID, "startUnit") if startUnitDefID then - id = startUnitDefID..'_'..tsx..'_'..spGetGroundHeight(tsx, tsz)..'_'..tsz + id = startUnitDefID .. "_" .. tsx .. "_" .. spGetGroundHeight(tsx, tsz) .. "_" .. tsz if teamStartPositions[teamID] ~= id then removeUnitShape(teamStartPositions[teamID]) teamStartPositions[teamID] = id @@ -507,13 +494,13 @@ end function widget:Shutdown() gl.DeleteList(buttonList) gl.DeleteList(buttonHoverList) - if WG['guishader'] then - WG['guishader'].RemoveRect('pregameui') + if WG["guishader"] then + WG["guishader"].RemoveRect("pregameui") end if WG.StopDrawUnitShapeGL4 then for id, _ in pairs(unitshapes) do removeUnitShape(id) end end - WG['pregameui'] = nil + WG["pregameui"] = nil end diff --git a/luaui/Widgets/gui_pregameui_draft.lua b/luaui/Widgets/gui_pregameui_draft.lua index cc1aaf99d75..02ba63dc646 100644 --- a/luaui/Widgets/gui_pregameui_draft.lua +++ b/luaui/Widgets/gui_pregameui_draft.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2024", license = "GNU GPL, v2 or later", layer = -999999, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -39,14 +38,14 @@ local _, _, mySpec, myTeamID = Spring.GetPlayerInfo(myPlayerID, false) local isFFA = Spring.Utilities.Gametype.IsFFA() local isReplay = Spring.IsReplay() -local readyButtonColor = {0.05, 0.28, 0} -local unreadyButtonColor = {0.28, 0.05, 0} -local subButtonColor = {0.08, 0.22, 0} -local unsubButtonColor = {0.22, 0.08, 0} -local waitButtonColor = {0.01, 0.01, 0.01} +local readyButtonColor = { 0.05, 0.28, 0 } +local unreadyButtonColor = { 0.28, 0.05, 0 } +local subButtonColor = { 0.08, 0.22, 0 } +local unsubButtonColor = { 0.22, 0.08, 0 } +local waitButtonColor = { 0.01, 0.01, 0.01 } -local readied = false -- send readystate (in widget:GameSetup) -local pressedReady -- pressed button +local readied = false -- send readystate (in widget:GameSetup) +local pressedReady -- pressed button local startPointChosen = false local NETMSG_STARTPLAYING = 4 -- see BaseNetProtocol.h, packetID sent during the 3.2.1 countdown @@ -69,8 +68,8 @@ local buttonW = mathFloor(orgbuttonW * uiScale / 2) * 2 local buttonH = mathFloor(orgbuttonH * uiScale / 2) * 2 local buttonList, buttonHoverList -local buttonText = '' -local lockText = '' +local buttonText = "" +local lockText = "" local locked = false local showLockButton = true local buttonDrawn = false @@ -79,14 +78,14 @@ local readyBlockedConditions = {} local cachedTooltipText = "" -- Button state tracking for display list optimization -local lastButtonText = '' -local lastButtonColor = {0, 0, 0} +local lastButtonText = "" +local lastButtonColor = { 0, 0, 0 } local lastButtonW = 0 local lastButtonH = 0 local lastShowLockButton = true local lastBlinkButton = false local lastCantPlaceNow = false -local buttonStateChanged = true -- Force initial creation +local buttonStateChanged = true -- Force initial creation local function hasActiveConditions() for k, v in pairs(readyBlockedConditions) do @@ -111,7 +110,7 @@ local function updateTooltip() else cachedTooltipText = "" end - + -- If ready blocked state changed, invalidate button (function defined later) if oldReadyBlocked ~= isReadyBlocked then buttonStateChanged = true @@ -132,10 +131,10 @@ local unitshapes = {} local teamStartPositions = {} local teamList = Spring.GetTeamList() -local uiElementRect = {0,0,0,0} -local uiLockRect = {0,0,0,0} -local buttonRect = {0,0,0,0} -local lockRect = {0,0,0,0} +local uiElementRect = { 0, 0, 0, 0 } +local uiLockRect = { 0, 0, 0, 0 } +local buttonRect = { 0, 0, 0, 0 } +local lockRect = { 0, 0, 0, 0 } local blinkButton = false -- DraftOrder mod start @@ -146,8 +145,8 @@ local bigTeamAmountOfPlayers = 8 -- How many players for it to be considered big local connectionTimeOut = 45 -- How many seconds to wait for allies before placing them at the tail end of the queue in random/skill draft local VoteSkipTurnDelay = 3 local draftModeLoaded = false -local DMDefaultColorString = '\255\200\200\200' -local DMWarnColor = '\255\255\255\255' +local DMDefaultColorString = "\255\200\200\200" +local DMWarnColor = "\255\255\255\255" local myTurn = false local myAllyTeamJoined = false local ihavejoined_fair = false @@ -168,20 +167,20 @@ local TeamPlacementUIshown = false local devUItestMode = false -- flip to true to test UI with fake players -- a lot of code copied and slightly modified from advplayerlist... local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } local imgDir = LUAUI_DIRNAME .. "Images/advplayerslist/" local imageDirectory = ":lc:" .. imgDir local pics = { - readyTexture = imageDirectory .. "indicator.dds", - rank0 = imageDirectory .. "ranks/1.png", - rank1 = imageDirectory .. "ranks/2.png", - rank2 = imageDirectory .. "ranks/3.png", - rank3 = imageDirectory .. "ranks/4.png", - rank4 = imageDirectory .. "ranks/5.png", - rank5 = imageDirectory .. "ranks/6.png", - rank6 = imageDirectory .. "ranks/7.png", - rank7 = imageDirectory .. "ranks/8.png", - hourglass = imageDirectory .. "hourglass.png" + readyTexture = imageDirectory .. "indicator.dds", + rank0 = imageDirectory .. "ranks/1.png", + rank1 = imageDirectory .. "ranks/2.png", + rank2 = imageDirectory .. "ranks/3.png", + rank3 = imageDirectory .. "ranks/4.png", + rank4 = imageDirectory .. "ranks/5.png", + rank5 = imageDirectory .. "ranks/6.png", + rank6 = imageDirectory .. "ranks/7.png", + rank7 = imageDirectory .. "ranks/8.png", + hourglass = imageDirectory .. "hourglass.png", } local playerReadyState = {} local playerScale = 1.5 @@ -193,19 +192,19 @@ local glCallList = gl.CallList local glDeleteList = gl.DeleteList local function RectQuad(px, py, sx, sy) - local o = 0.008 -- texture offset, because else grey line might show at the edges - gl.TexCoord(o, 1 - o) - gl.Vertex(px, py, 0) - gl.TexCoord(1 - o, 1 - o) - gl.Vertex(sx, py, 0) - gl.TexCoord(1 - o, o) - gl.Vertex(sx, sy, 0) - gl.TexCoord(o, o) - gl.Vertex(px, sy, 0) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o, 1 - o) + gl.Vertex(px, py, 0) + gl.TexCoord(1 - o, 1 - o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1 - o, o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o, o) + gl.Vertex(px, sy, 0) end local function DrawRect(px, py, sx, sy) - gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy) + gl.BeginEnd(GL.QUADS, RectQuad, px, py, sx, sy) end local function DrawState(playerID, posX, posY) @@ -226,66 +225,65 @@ local function DrawState(playerID, posX, posY) end end gl_Texture(pics["readyTexture"]) - DrawRect(posX, posY - (1*playerScale), posX + (16*playerScale), posY + (16*playerScale)) + DrawRect(posX, posY - (1 * playerScale), posX + (16 * playerScale), posY + (16 * playerScale)) gl_Color(1, 1, 1, 1) end local function DrawHourglass(posX, posY) gl_Texture(pics["hourglass"]) - DrawRect(posX, posY - (1*playerScale), posX + (16*playerScale), posY + (16*playerScale)) + DrawRect(posX, posY - (1 * playerScale), posX + (16 * playerScale), posY + (16 * playerScale)) gl_Color(1, 1, 1, 1) end local function SetSidePics() - local playerList = Spring.GetPlayerList() - for _, playerID in pairs(playerList) do - playerReadyState[playerID] = Spring.GetGameRulesParam("player_" .. tostring(playerID) .. "_readyState") - end + local playerList = Spring.GetPlayerList() + for _, playerID in pairs(playerList) do + playerReadyState[playerID] = Spring.GetGameRulesParam("player_" .. tostring(playerID) .. "_readyState") + end end local function DrawRankImage(rankImage, posX, posY) - gl_Color(1, 1, 1, 1) - gl_Texture(rankImage) - DrawRect(posX + (3*playerScale), posY + (8*playerScale) - (7.5*playerScale), posX + (17*playerScale), posY + (8*playerScale) + (7.5*playerScale)) + gl_Color(1, 1, 1, 1) + gl_Texture(rankImage) + DrawRect(posX + (3 * playerScale), posY + (8 * playerScale) - (7.5 * playerScale), posX + (17 * playerScale), posY + (8 * playerScale) + (7.5 * playerScale)) end local function DrawRank(rank, posX, posY) - if rank == 0 then - DrawRankImage(pics["rank0"], posX, posY) - elseif rank == 1 then - DrawRankImage(pics["rank1"], posX, posY) - elseif rank == 2 then - DrawRankImage(pics["rank2"], posX, posY) - elseif rank == 3 then - DrawRankImage(pics["rank3"], posX, posY) - elseif rank == 4 then - DrawRankImage(pics["rank4"], posX, posY) - elseif rank == 5 then - DrawRankImage(pics["rank5"], posX, posY) - elseif rank == 6 then - DrawRankImage(pics["rank6"], posX, posY) - elseif rank == 7 then - DrawRankImage(pics["rank7"], posX, posY) - else - - end + if rank == 0 then + DrawRankImage(pics["rank0"], posX, posY) + elseif rank == 1 then + DrawRankImage(pics["rank1"], posX, posY) + elseif rank == 2 then + DrawRankImage(pics["rank2"], posX, posY) + elseif rank == 3 then + DrawRankImage(pics["rank3"], posX, posY) + elseif rank == 4 then + DrawRankImage(pics["rank4"], posX, posY) + elseif rank == 5 then + DrawRankImage(pics["rank5"], posX, posY) + elseif rank == 6 then + DrawRankImage(pics["rank6"], posX, posY) + elseif rank == 7 then + DrawRankImage(pics["rank7"], posX, posY) + else + end end local function DrawSkill(skill, uncertainty, posX, posY) - local fontsize = 14 * (playerScale + ((1-playerScale)*0.25)) - font:Begin() + local fontsize = 14 * (playerScale + ((1 - playerScale) * 0.25)) + font:Begin() if uncertainty > 6.65 then - font:Print("??", posX + (4.5*playerScale), posY + (5.3*playerScale), fontsize, "o") + font:Print("??", posX + (4.5 * playerScale), posY + (5.3 * playerScale), fontsize, "o") else - font:Print(skill, posX + (4.5*playerScale), posY + (5.3*playerScale), fontsize, "o") + font:Print(skill, posX + (4.5 * playerScale), posY + (5.3 * playerScale), fontsize, "o") end - font:End() + font:End() end local function round(num, idp) - local mult = 10 ^ (idp or 0) - return mathFloor(num * mult + 0.5) / mult + local mult = 10 ^ (idp or 0) + return mathFloor(num * mult + 0.5) / mult end -- advplayerlist end @@ -293,7 +291,9 @@ local function colourNames(teamID, blink) local mult = 1 local nameColourR, nameColourG, nameColourB = 0.9, 0.9, 0.9 if teamID ~= nil then - if blink then mult = 0.66 end + if blink then + mult = 0.66 + end nameColourR, nameColourG, nameColourB = Spring.GetTeamColor(teamID) end if anonymousMode ~= "disabled" and teamID ~= myTeamID then @@ -303,16 +303,18 @@ local function colourNames(teamID, blink) end local function canPlayerPlaceNow(playerID) - if draftMode == nil or draftMode == "disabled" then return true end + if draftMode == nil or draftMode == "disabled" then + return true + end if draftMode == "fair" or not myAllyTeamJoined then return myAllyTeamJoined else -- skill/random if currentPlayerIndex == nil or currentPlayerIndex <= 0 or myTeamPlayersOrder == nil then return false end - -- returns true if playerID is found before array hits index (currentPlayerIndex) + -- returns true if playerID is found before array hits index (currentPlayerIndex) for i = 1, #myTeamPlayersOrder do - if (i > currentPlayerIndex) then + if i > currentPlayerIndex then return false end if myTeamPlayersOrder[i].id == playerID then @@ -320,7 +322,7 @@ local function canPlayerPlaceNow(playerID) end end end - return false + return false end local function findPlayerName(playerID) @@ -343,16 +345,18 @@ local function findPlayerName(playerID) end tname = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID)) or Spring.GetPlayerInfo(playerID, false) if not tname then - tname = "unconnected" -- show "unconnected" instead of nil if we don't know the name + tname = "unconnected" -- show "unconnected" instead of nil if we don't know the name end return tname end local function draftModeInited() -- We want to ensure the player's UI is loaded and seen by the player before proceeding - if draftModeLoaded then return end + if draftModeLoaded then + return + end local mode = draftMode:gsub("^%l", string.upper) -- Random/Captain/Skill/Fair - spEcho(Spring.I18N('ui.draftOrderMod.mode' .. mode)..".") + spEcho(Spring.I18N("ui.draftOrderMod.mode" .. mode) .. ".") draftModeLoaded = true if mode == "Fair" then fairTimeout = os.clock() + 2 @@ -375,33 +379,33 @@ local function buttonTextRefresh() if eligibleAsSub then showLockButton = true if not offeredAsSub then - buttonText = Spring.I18N('ui.substitutePlayers.offer') + buttonText = Spring.I18N("ui.substitutePlayers.offer") else - buttonText = Spring.I18N('ui.substitutePlayers.withdraw') + buttonText = Spring.I18N("ui.substitutePlayers.withdraw") end else showLockButton = false end else - if (draftMode == nil or draftMode == "disabled") then -- regular + if draftMode == nil or draftMode == "disabled" then -- regular showLockButton = true if readied then if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = Spring.I18N("ui.initialSpawn.unlock") else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = Spring.I18N("ui.initialSpawn.lock") end else - buttonText = Spring.I18N('ui.initialSpawn.ready') + buttonText = Spring.I18N("ui.initialSpawn.ready") end else -- modded checkStartPointChosen() if not myAllyTeamJoined then -- all draftModes showLockButton = true - local text = Spring.I18N('ui.draftOrderMod.waitingForPlayers') - if (voteConTimeout) then - vcttimer = mathFloor(voteConTimeout-os.clock())+1 - if (vcttimer > 0) then + local text = Spring.I18N("ui.draftOrderMod.waitingForPlayers") + if voteConTimeout then + vcttimer = mathFloor(voteConTimeout - os.clock()) + 1 + if vcttimer > 0 then text = text .. " " .. vcttimer .. "s" end end @@ -410,9 +414,9 @@ local function buttonTextRefresh() if startPointChosen then showLockButton = true if locked then - buttonText = Spring.I18N('ui.initialSpawn.unlock') + buttonText = Spring.I18N("ui.initialSpawn.unlock") else - buttonText = Spring.I18N('ui.initialSpawn.lock') + buttonText = Spring.I18N("ui.initialSpawn.lock") end else showLockButton = false @@ -420,15 +424,17 @@ local function buttonTextRefresh() end elseif myAllyTeamJoined then -- allyTeamJoined and draftMode is random/skill showLockButton = true - buttonText = Spring.I18N('ui.draftOrderMod.waitingForTurn') - else showLockButton = false end -- how did we get here? + buttonText = Spring.I18N("ui.draftOrderMod.waitingForTurn") + else + showLockButton = false + end -- how did we get here? end end end local function PlayChooseStartLocSound() - if not mySpec and not startPointChosen and WG['notifications'] then - WG['notifications'].addEvent('ChooseStartLoc', true) + if not mySpec and not startPointChosen and WG["notifications"] then + WG["notifications"].addEvent("ChooseStartLoc", true) end end @@ -454,126 +460,132 @@ end local function DrawTeamPlacement() SetSidePics() TeamPlacementUI = glCreateList(function() - - -- Center Screen Stuff - local tmsg = "" - if currentTurnTimeout then - tmsg = mathFloor(currentTurnTimeout-os.clock())+1 - if (tmsg <= 0) then tmsg = " ?" else -- this implies that player has "connection problems" in which we will force skip that player's turn in a few seconds anyway - tmsg = tmsg .. "s" + -- Center Screen Stuff + local tmsg = "" + if currentTurnTimeout then + tmsg = mathFloor(currentTurnTimeout - os.clock()) + 1 + if tmsg <= 0 then + tmsg = " ?" + else -- this implies that player has "connection problems" in which we will force skip that player's turn in a few seconds anyway + tmsg = tmsg .. "s" + end + elseif current_playerID > -1 and next_playerID > -1 then + tmsg = "" + else + tmsg = "" end - elseif (current_playerID > -1 and next_playerID > -1) then - tmsg = "" - else - tmsg = "" - end - local amIunlocked = canPlayerPlaceNow(myPlayerID) - if not startPointChosen and next_playerID > -1 and ((amIunlocked and current_playerID == myPlayerID) or (not amIunlocked and current_playerID ~= myPlayerID)) then - font:Print(DMWarnColor .. tmsg, vsx * 0.5, vsy * 0.256, 22.0 * uiScale, "co") - end - if not amIunlocked and (current_playerID ~= myPlayerID) then - -- added because you can't place until your turn has come up or passed - if (current_playerID > -1) then - local tname = findPlayerName(current_playerID) - local tTeamID = select(4, Spring.GetPlayerInfo(current_playerID, false)) - local text = colourNames(tTeamID, false)..tname - font:Print(DMDefaultColorString .. Spring.I18N('ui.draftOrderMod.waitingFor', { name = text}), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") + local amIunlocked = canPlayerPlaceNow(myPlayerID) + if not startPointChosen and next_playerID > -1 and ((amIunlocked and current_playerID == myPlayerID) or (not amIunlocked and current_playerID ~= myPlayerID)) then + font:Print(DMWarnColor .. tmsg, vsx * 0.5, vsy * 0.256, 22.0 * uiScale, "co") end - elseif not startPointChosen then - font:Print(DMWarnColor .. Spring.I18N('ui.draftOrderMod.placeYourCom'), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") - end - if (current_playerID > -1 and next_playerID > -1) then - local tname = findPlayerName(next_playerID) - local tTeamID = select(4, Spring.GetPlayerInfo(next_playerID, false)) - local text = colourNames(tTeamID, false)..tname - font:Print(DMDefaultColorString .. Spring.I18N('ui.draftOrderMod.nextIsPlayer', { name = text}), vsx * 0.5, vsy * 0.205, 15.0 * uiScale, "co") - end - - -- Team Placement UI - local x = vsx * 0.78 - local y = vsy * 0.83 - -- ^ this is top right corner, we align everything to it - - local max_height = (#(myTeamPlayersOrder) * 26 * uiScale) + 64 - local max_width = 0 - for i, data in ipairs(myTeamPlayersOrder) do - local text = findPlayerName(data.id) or "" - local w = font:GetTextWidth(text) - if max_width < w then - max_width = w + if not amIunlocked and (current_playerID ~= myPlayerID) then + -- added because you can't place until your turn has come up or passed + if current_playerID > -1 then + local tname = findPlayerName(current_playerID) + local tTeamID = select(4, Spring.GetPlayerInfo(current_playerID, false)) + local text = colourNames(tTeamID, false) .. tname + font:Print(DMDefaultColorString .. Spring.I18N("ui.draftOrderMod.waitingFor", { name = text }), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") + end + elseif not startPointChosen then + font:Print(DMWarnColor .. Spring.I18N("ui.draftOrderMod.placeYourCom"), vsx * 0.5, vsy * 0.23, 22.0 * uiScale, "co") + end + if current_playerID > -1 and next_playerID > -1 then + local tname = findPlayerName(next_playerID) + local tTeamID = select(4, Spring.GetPlayerInfo(next_playerID, false)) + local text = colourNames(tTeamID, false) .. tname + font:Print(DMDefaultColorString .. Spring.I18N("ui.draftOrderMod.nextIsPlayer", { name = text }), vsx * 0.5, vsy * 0.205, 15.0 * uiScale, "co") end - end - local button_width = uiElementRect[3]-uiElementRect[1] - local rank_column_offset = 24 - local skill_column_offset = 58 - local player_column_offset = rank_column_offset + skill_column_offset + 24 - local padding_left = 12 - local player_name_font_size = 16 + -- Team Placement UI + local x = vsx * 0.78 + local y = vsy * 0.83 + -- ^ this is top right corner, we align everything to it + + local max_height = (#myTeamPlayersOrder * 26 * uiScale) + 64 + local max_width = 0 + for i, data in ipairs(myTeamPlayersOrder) do + local text = findPlayerName(data.id) or "" + local w = font:GetTextWidth(text) + if max_width < w then + max_width = w + end + end + local button_width = uiElementRect[3] - uiElementRect[1] - max_width = mathMax((max_width * player_name_font_size * uiScale) + padding_left + player_column_offset + padding_left, button_width) + local rank_column_offset = 24 + local skill_column_offset = 58 + local player_column_offset = rank_column_offset + skill_column_offset + 24 + local padding_left = 12 + local player_name_font_size = 16 - -- we can modify "lock position" button pos here - buttonPosX = 0.78 - buttonPosY = 0.83 - buttonX = mathFloor(vsx * buttonPosX) + max_width/2 - buttonY = mathFloor(vsy * buttonPosY) - max_height - 4 - buttonH - -- + max_width = mathMax((max_width * player_name_font_size * uiScale) + padding_left + player_column_offset + padding_left, button_width) - font:SetOutlineColor(0, 0, 0, 0.5) - UiElement(x, y - max_height, x + max_width, y, 1, 1, 1, 1, 1, 1, 1, 1, nil) - gl_Color(1, 1, 1, 1) - font:Print(DMWarnColor .. Spring.I18N('ui.draftOrderMod.teamPlacement'), x + max_width/2, y - 32, player_name_font_size * uiScale, "co") - local y_shift - for i, data in ipairs(myTeamPlayersOrder) do - y_shift = y - (i * 26 * uiScale) - 40 - local playerID = data.id - -- Draw black background with black bottom border for current player's turn -- added by Scopa - if current_playerID == playerID then - gl.Color(0, 0, 0, 0.8) -- 80% opaque black - local highlightTop = y_shift + 26 * uiScale - 7 - local highlightBottom = y_shift - 7 - gl.Rect(x, highlightTop, x + max_width, highlightBottom) - gl.Color(1, 1, 1, 1) - end + -- we can modify "lock position" button pos here + buttonPosX = 0.78 + buttonPosY = 0.83 + buttonX = mathFloor(vsx * buttonPosX) + max_width / 2 + buttonY = mathFloor(vsy * buttonPosY) - max_height - 4 - buttonH -- - local playerName = findPlayerName(playerID) - local _, active, _, playerTeamID, _, ping, _, _, rank, _, customtable = Spring.GetPlayerInfo(playerID, true) - local playerRank, playerSkill, playerSigma = 0, 0, 8.33 - if type(customtable) == 'table' then - local tsMu = customtable.skill - local tsSigma = customtable.skilluncertainty - local ts = tsMu and tonumber(tsMu:match("%d+%.?%d*")) - if (ts ~= nil) then playerSkill = round(ts, 0) end - if (rank ~= nil) then playerRank = rank end - if tsSigma then playerSigma = tonumber(tsSigma) end - end - -- | indicator/timer/hourglass | rankicon | skill/zero | [playercolor] playername | - local x_offset = padding_left - if (current_playerID == playerID) then - font:Print(DMDefaultColorString .. tmsg, x + x_offset - 1, y_shift + 3, 15 * uiScale, "lo") - elseif (canPlayerPlaceNow(playerID)) then - x_offset = padding_left - 5 - DrawState(playerID, x + x_offset, y_shift - 3) - else - x_offset = padding_left - 4 - DrawHourglass(x + x_offset + 1, y_shift - 1) - end - local colorMod = colourNames(playerTeamID) - if (not active) then - if os.clock() % 0.75 <= 0.375 then - colorMod = colourNames(playerTeamID, true) + + font:SetOutlineColor(0, 0, 0, 0.5) + UiElement(x, y - max_height, x + max_width, y, 1, 1, 1, 1, 1, 1, 1, 1, nil) + gl_Color(1, 1, 1, 1) + font:Print(DMWarnColor .. Spring.I18N("ui.draftOrderMod.teamPlacement"), x + max_width / 2, y - 32, player_name_font_size * uiScale, "co") + local y_shift + for i, data in ipairs(myTeamPlayersOrder) do + y_shift = y - (i * 26 * uiScale) - 40 + local playerID = data.id + -- Draw black background with black bottom border for current player's turn -- added by Scopa + if current_playerID == playerID then + gl.Color(0, 0, 0, 0.8) -- 80% opaque black + local highlightTop = y_shift + 26 * uiScale - 7 + local highlightBottom = y_shift - 7 + gl.Rect(x, highlightTop, x + max_width, highlightBottom) + gl.Color(1, 1, 1, 1) end - else - x_offset = padding_left + rank_column_offset - DrawRank(playerRank, x + x_offset, y_shift - 3) - x_offset = padding_left + skill_column_offset - DrawSkill(playerSkill, playerSigma, x + x_offset, y_shift - 4) + -- + local playerName = findPlayerName(playerID) + local _, active, _, playerTeamID, _, ping, _, _, rank, _, customtable = Spring.GetPlayerInfo(playerID, true) + local playerRank, playerSkill, playerSigma = 0, 0, 8.33 + if type(customtable) == "table" then + local tsMu = customtable.skill + local tsSigma = customtable.skilluncertainty + local ts = tsMu and tonumber(tsMu:match("%d+%.?%d*")) + if ts ~= nil then + playerSkill = round(ts, 0) + end + if rank ~= nil then + playerRank = rank + end + if tsSigma then + playerSigma = tonumber(tsSigma) + end + end + -- | indicator/timer/hourglass | rankicon | skill/zero | [playercolor] playername | + local x_offset = padding_left + if current_playerID == playerID then + font:Print(DMDefaultColorString .. tmsg, x + x_offset - 1, y_shift + 3, 15 * uiScale, "lo") + elseif canPlayerPlaceNow(playerID) then + x_offset = padding_left - 5 + DrawState(playerID, x + x_offset, y_shift - 3) + else + x_offset = padding_left - 4 + DrawHourglass(x + x_offset + 1, y_shift - 1) + end + local colorMod = colourNames(playerTeamID) + if not active then + if os.clock() % 0.75 <= 0.375 then + colorMod = colourNames(playerTeamID, true) + end + else + x_offset = padding_left + rank_column_offset + DrawRank(playerRank, x + x_offset, y_shift - 3) + x_offset = padding_left + skill_column_offset + DrawSkill(playerSkill, playerSigma, x + x_offset, y_shift - 4) + end + x_offset = padding_left + player_column_offset + font:Print(colorMod .. playerName, x + x_offset, y_shift + 3, player_name_font_size * uiScale, "lo") end - x_offset = padding_left + player_column_offset - font:Print(colorMod .. playerName, x + x_offset, y_shift + 3, player_name_font_size * uiScale, "lo") - end - end) TeamPlacementUIshown = true end @@ -581,14 +593,7 @@ end -- Helper function to check if button state has changed local function checkButtonStateChanged(color, cantPlaceNow, blinkButton, currentButtonW, currentButtonH) - return buttonStateChanged or - lastButtonText ~= buttonText or - lastShowLockButton ~= showLockButton or - lastButtonColor[1] ~= color[1] or lastButtonColor[2] ~= color[2] or lastButtonColor[3] ~= color[3] or - lastButtonW ~= currentButtonW or - lastButtonH ~= currentButtonH or - lastBlinkButton ~= blinkButton or - lastCantPlaceNow ~= cantPlaceNow + return buttonStateChanged or lastButtonText ~= buttonText or lastShowLockButton ~= showLockButton or lastButtonColor[1] ~= color[1] or lastButtonColor[2] ~= color[2] or lastButtonColor[3] ~= color[3] or lastButtonW ~= currentButtonW or lastButtonH ~= currentButtonH or lastBlinkButton ~= blinkButton or lastCantPlaceNow ~= cantPlaceNow end -- Helper function to update button state tracking @@ -596,7 +601,7 @@ local function updateButtonStateTracking(color, cantPlaceNow, blinkButton, curre lastButtonText = buttonText lastShowLockButton = showLockButton lastButtonColor[1] = color[1] - lastButtonColor[2] = color[2] + lastButtonColor[2] = color[2] lastButtonColor[3] = color[3] lastButtonW = currentButtonW lastButtonH = currentButtonH @@ -613,12 +618,12 @@ end local function drawButton() -- Only refresh button text if needed (this may change button state) buttonTextRefresh() - + local cantPlaceNow = not canPlayerPlaceNow(myPlayerID) if draftMode ~= nil and draftMode ~= "disabled" and buttonText == "" and not mySpec and showLockButton then showLockButton = false end - + -- Calculate button color local color = { 0.15, 0.15, 0.15 } if not mySpec then @@ -638,7 +643,7 @@ local function drawButton() end -- Calculate button dimensions - orgbuttonW = font:GetTextWidth(' '..buttonText) * 24 + orgbuttonW = font:GetTextWidth(" " .. buttonText) * 24 local currentButtonW = mathFloor(orgbuttonW * uiScale / 2) * 2 local currentButtonH = mathFloor(orgbuttonH * uiScale / 2) * 2 @@ -668,7 +673,7 @@ local function drawButton() -- Update button dimensions buttonW = currentButtonW buttonH = currentButtonH - + -- Recalculate button rectangles uiElementRect = { buttonX - (buttonW / 2) - uiPadding, buttonY - (buttonH / 2) - uiPadding, buttonX + (buttonW / 2) + uiPadding, buttonY + (buttonH / 2) + uiPadding } buttonRect = { buttonX - (buttonW / 2), buttonY - (buttonH / 2), buttonX + (buttonW / 2), buttonY + (buttonH / 2) } @@ -687,12 +692,12 @@ local function drawButton() if showLockButton then buttonList = gl.CreateList(function() UiElement(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], 1, 1, 1, 1, 1, 1, 1, 1) - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1]*0.55, color[2]*0.55, color[3]*0.55, 1 }, { color[1], color[2], color[3], 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1] * 0.55, color[2] * 0.55, color[3] * 0.55, 1 }, { color[1], color[2], color[3], 1 }) end) - + buttonHoverList = gl.CreateList(function() UiElement(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], 1, 1, 1, 1, 1, 1, 1, 1) - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1]*0.85, color[2]*0.85, color[3]*0.85, 1 }, { color[1]*1.5, color[2]*1.5, color[3]*1.5, 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { color[1] * 0.85, color[2] * 0.85, color[3] * 0.85, 1 }, { color[1] * 1.5, color[2] * 1.5, color[3] * 1.5, 1 }) end) end @@ -717,14 +722,8 @@ local function drawButton() -- Render the button (this happens every frame but uses cached display lists) if showLockButton and buttonList and buttonHoverList then -- Add GUI shader rect - if WG['guishader'] then - WG['guishader'].InsertRect( - uiElementRect[1], - uiElementRect[2], - uiElementRect[3], - uiElementRect[4], - 'pregameui_draft' - ) + if WG["guishader"] then + WG["guishader"].InsertRect(uiElementRect[1], uiElementRect[2], uiElementRect[3], uiElementRect[4], "pregameui_draft") end -- Check mouse hover and render appropriate display list @@ -734,8 +733,8 @@ local function drawButton() glCallList(buttonHoverList) colorString = "\255\210\210\210" - if isReadyBlocked and WG['tooltip'] then - WG['tooltip'].ShowTooltip('pregameui', cachedTooltipText) + if isReadyBlocked and WG["tooltip"] then + WG["tooltip"].ShowTooltip("pregameui", cachedTooltipText) end else glCallList(buttonList) @@ -755,13 +754,13 @@ local function drawButton() -- Blink effect is applied as additional rendering on top if blinkButton and not readied and not isReadyBlocked and os.clock() % 0.75 <= 0.375 then local mult = 1.33 - UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { readyButtonColor[1]*0.55*mult, readyButtonColor[2]*0.55*mult, readyButtonColor[3]*0.55*mult, 1 }, { readyButtonColor[1]*mult, readyButtonColor[2]*mult, readyButtonColor[3]*mult, 1 }) + UiButton(buttonRect[1], buttonRect[2], buttonRect[3], buttonRect[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { readyButtonColor[1] * 0.55 * mult, readyButtonColor[2] * 0.55 * mult, readyButtonColor[3] * 0.55 * mult, 1 }, { readyButtonColor[1] * mult, readyButtonColor[2] * mult, readyButtonColor[3] * mult, 1 }) end end - + -- Draw text (this is relatively cheap so we do it every frame) font:Begin() - font:Print(colorString .. buttonText, buttonRect[1]+((buttonRect[3]-buttonRect[1])/2), (buttonRect[2]+((buttonRect[4]-buttonRect[2])/2)) - (buttonH * 0.16), 24 * uiScale, "co") + font:Print(colorString .. buttonText, buttonRect[1] + ((buttonRect[3] - buttonRect[1]) / 2), (buttonRect[2] + ((buttonRect[4] - buttonRect[2]) / 2)) - (buttonH * 0.16), 24 * uiScale, "co") font:End() gl.Color(1, 1, 1, 1) end @@ -775,8 +774,8 @@ local function progressQueueLocally(shift) -- only for dev UI testing of DOM else current_playerID = -1 end - if myTeamPlayersOrder[currentPlayerIndex+1] and myTeamPlayersOrder[currentPlayerIndex+1].id ~= nil then - next_playerID = myTeamPlayersOrder[currentPlayerIndex+1].id + if myTeamPlayersOrder[currentPlayerIndex + 1] and myTeamPlayersOrder[currentPlayerIndex + 1].id ~= nil then + next_playerID = myTeamPlayersOrder[currentPlayerIndex + 1].id else next_playerID = -1 end @@ -790,7 +789,7 @@ local function progressQueueLocally(shift) -- only for dev UI testing of DOM myTurn = true PlayChooseStartLocSound() elseif next_playerID == myPlayerID then - Spring.PlaySoundFile("beep6", 1, 'ui') + Spring.PlaySoundFile("beep6", 1, "ui") elseif myTurn then myTurn = false end @@ -802,7 +801,7 @@ function widget:ViewResize(viewSizeX, viewSizeY) uiScale = (0.75 + (vsx * vsy / 6000000)) buttonX = mathFloor(vsx * buttonPosX) buttonY = mathFloor(vsy * buttonPosY) - orgbuttonW = font:GetTextWidth(' '..buttonText) * 24 + orgbuttonW = font:GetTextWidth(" " .. buttonText) * 24 buttonW = mathFloor(orgbuttonW * uiScale / 2) * 2 buttonH = mathFloor(orgbuttonH * uiScale / 2) * 2 @@ -818,7 +817,7 @@ function widget:ViewResize(viewSizeX, viewSizeY) RectRound = WG.FlowUI.Draw.RectRound elementPadding = WG.FlowUI.elementPadding uiPadding = mathFloor(elementPadding * 4.5) - + -- Button dimensions/position changed, invalidate display lists invalidateButtonState() end @@ -835,7 +834,7 @@ function widget:GameSetup(state, ready, playerStates) -- check when the 3.2.1 countdown starts if not gameStarting and ((Spring.GetPlayerTraffic(SYSTEM_ID, NETMSG_STARTPLAYING) or 0) > 0) then - gameStarting = true -- ugly but effective (can also detect by parsing state string) + gameStarting = true -- ugly but effective (can also detect by parsing state string) end -- if we can't choose startpositions, no need for ready button etc @@ -852,7 +851,7 @@ function widget:GameSetup(state, ready, playerStates) if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready then auto_ready_timer = auto_ready_timer - Spring.GetLastUpdateSeconds() end - if auto_ready_timer <=0 and auto_ready == true then + if auto_ready_timer <= 0 and auto_ready == true then return true, true end end @@ -872,17 +871,14 @@ function widget:GameSetup(state, ready, playerStates) end return true, ready - end function widget:MousePress(sx, sy) if showLockButton then - -- pressing button element if sx > uiElementRect[1] and sx < uiElementRect[3] and sy > uiElementRect[2] and sy < uiElementRect[4] then -- pressing actual button if sx > buttonRect[1] and sx < buttonRect[3] and sy > buttonRect[2] and sy < buttonRect[4] then - local cantPlaceNow = not canPlayerPlaceNow(myPlayerID) if cantPlaceNow then if not startPointChosen then @@ -904,20 +900,19 @@ function widget:MousePress(sx, sy) locked = true Spring.SendLuaRulesMsg("locking_in_place") else - spEcho(Spring.I18N('ui.initialSpawn.choosePoint')) + spEcho(Spring.I18N("ui.initialSpawn.choosePoint")) end - end -- substitute elseif eligibleAsSub then offeredAsSub = not offeredAsSub if offeredAsSub then - spEcho(Spring.I18N('ui.substitutePlayers.substitutionMessage')) + spEcho(Spring.I18N("ui.substitutePlayers.substitutionMessage")) else - spEcho(Spring.I18N('ui.substitutePlayers.offerWithdrawn')) + spEcho(Spring.I18N("ui.substitutePlayers.offerWithdrawn")) end - Spring.SendLuaRulesMsg(offeredAsSub and '\144' or '\145') + Spring.SendLuaRulesMsg(offeredAsSub and "\144" or "\145") end -- lock position text showing else @@ -934,7 +929,6 @@ function widget:MousePress(sx, sy) end return true end - end end @@ -974,8 +968,8 @@ function widget:Initialize() --end end else - -- widgetHandler:RemoveWidget() -- not removing cause we still need widget:GameSetup to return true else there is player list readystate drawn on the left side of the screen - -- return + -- widgetHandler:RemoveWidget() -- not removing cause we still need widget:GameSetup to return true else there is player list readystate drawn on the left side of the screen + -- return end local myAllyCount = getHumanCountWithinAllyTeam(myAllyTeamID) @@ -986,13 +980,13 @@ function widget:Initialize() local allyTeams = Spring.GetAllyTeamList() for i = 1, #allyTeams do local allyCount = getHumanCountWithinAllyTeam(allyTeams[i]) - if (allyCount > biggestNumberOfPlayers) then + if allyCount > biggestNumberOfPlayers then biggestNumberOfPlayers = allyCount end end if biggestNumberOfPlayers > bigTeamAmountOfPlayers then -- big team, not regular game local min_auto_ready_timer = 5 + (biggestNumberOfPlayers * (turnTimeOutBigTeam + VoteSkipTurnDelay + 1)) -- 20vs20 = 185s (5 + 180) - if (auto_ready_timer < min_auto_ready_timer) then + if auto_ready_timer < min_auto_ready_timer then auto_ready_timer = min_auto_ready_timer end end @@ -1006,24 +1000,24 @@ function widget:Initialize() widget:ViewResize(vsx, vsy) checkStartPointChosen() - if (draftMode ~= nil and draftMode ~= "disabled") then - reloadedDraftMode = os.clock()+2 -- in case you luaui reload + if draftMode ~= nil and draftMode ~= "disabled" then + reloadedDraftMode = os.clock() + 2 -- in case you luaui reload end - WG['pregameui_draft'] = {} - WG['pregameui_draft'].addReadyCondition = function(conditionKey, description) + WG["pregameui_draft"] = {} + WG["pregameui_draft"].addReadyCondition = function(conditionKey, description) if conditionKey and description then readyBlockedConditions[conditionKey] = description updateTooltip() end end - WG['pregameui_draft'].removeReadyCondition = function(conditionKey) + WG["pregameui_draft"].removeReadyCondition = function(conditionKey) if conditionKey and readyBlockedConditions[conditionKey] then readyBlockedConditions[conditionKey] = nil updateTooltip() end end - WG['pregameui_draft'].clearAllReadyConditions = function() + WG["pregameui_draft"].clearAllReadyConditions = function() readyBlockedConditions = {} updateTooltip() end @@ -1040,7 +1034,7 @@ function widget:DrawScreen() -- display autoready timer if Spring.GetGameRulesParam("all_players_joined") == 1 and not gameStarting and auto_ready and not auto_ready_disable then local colorString = auto_ready_timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, mathFloor(auto_ready_timer)) }) + local text = colorString .. Spring.I18N("ui.initialSpawn.startCountdown", { time = mathMax(1, mathFloor(auto_ready_timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() @@ -1053,15 +1047,15 @@ function widget:DrawScreen() -- "Pick a startspot within..." is probably at ~0.08 -- I have no idea how map_startbox.lua decids where to draw it, so if this mod is enabled, that widget won't draw it, instead we do it here if not mySpec then if draftMode ~= "fair" and myTeamPlayersOrder and (moreThanOneAlly or devUItestMode) then - if (TeamPlacementUIshown) then + if TeamPlacementUIshown then glCallList(TeamPlacementUI) showingTeamplacementUI = true end end if draftMode == "fair" or myAllyTeamJoined then if hasStartbox then - local infotext = Spring.I18N('ui.startSpot.anywhere') - local infotextBoxes = Spring.I18N('ui.startSpot.startbox') + local infotext = Spring.I18N("ui.startSpot.anywhere") + local infotextBoxes = Spring.I18N("ui.startSpot.startbox") font:Begin() font:Print(DMDefaultColorString .. infotextBoxes or infotext, vsx * 0.5, vsy * 0.20315, 15.0 * uiScale, "co") font:End() @@ -1079,7 +1073,7 @@ function widget:DrawScreen() voteSkipTurnTimeout = nil end - if (devUItestMode) and currentTurnTimeout then -- dev UI testing mode + if devUItestMode and currentTurnTimeout then -- dev UI testing mode if (os.clock() >= currentTurnTimeout) or (myTurn and startPointChosen) then progressQueueLocally(1) end @@ -1088,17 +1082,17 @@ function widget:DrawScreen() end end if not showingTeamplacementUI then - if WG['guishader'] then - WG['guishader'].RemoveRect('pregameui_draft') + if WG["guishader"] then + WG["guishader"].RemoveRect("pregameui_draft") end end if not mySpec and draftMode ~= "disabled" then if not myAllyTeamJoined then - local text = DMWarnColor .. Spring.I18N('ui.draftOrderMod.waitingForTeamToLoad') - if (voteConTimeout) then - vcttimer = mathFloor(voteConTimeout-os.clock())+1 - if (vcttimer > 0) then + local text = DMWarnColor .. Spring.I18N("ui.draftOrderMod.waitingForTeamToLoad") + if voteConTimeout then + vcttimer = mathFloor(voteConTimeout - os.clock()) + 1 + if vcttimer > 0 then text = text .. " " .. vcttimer .. "s" end end @@ -1117,7 +1111,7 @@ function widget:DrawScreen() end voteConTimeout = nil end - if (reloadedDraftMode and os.clock() >= reloadedDraftMode) then + if reloadedDraftMode and os.clock() >= reloadedDraftMode then reloadedDraftMode = nil Spring.SendLuaRulesMsg("send_me_the_info_again") draftModeInited() @@ -1128,7 +1122,7 @@ function widget:DrawScreen() if gameStarting then timer = timer + Spring.GetLastUpdateSeconds() local colorString = timer % 0.75 <= 0.375 and "\255\233\233\233" or "\255\255\255\255" - local text = colorString .. Spring.I18N('ui.initialSpawn.startCountdown', { time = mathMax(1, 3 - mathFloor(timer)) }) + local text = colorString .. Spring.I18N("ui.initialSpawn.startCountdown", { time = mathMax(1, 3 - mathFloor(timer)) }) font:Begin() font:Print(text, vsx * 0.5, vsy * 0.67, 18.5 * uiScale, "co") font:End() @@ -1154,22 +1148,24 @@ local function addUnitShape(id, unitDefID, px, py, pz, rotationY, teamID, opacit end function widget:DrawWorld() - if not WG.StopDrawUnitShapeGL4 then return end + if not WG.StopDrawUnitShapeGL4 then + return + end -- draw pregamestart commander models at start positions local id for i = 1, #teamList do local teamID = teamList[i] local tsx, tsy, tsz - if WG['map_startbox'] and WG['map_startbox'].GetEffectiveStartPosition then - tsx, tsy, tsz = WG['map_startbox'].GetEffectiveStartPosition(teamID) + if WG["map_startbox"] and WG["map_startbox"].GetEffectiveStartPosition then + tsx, tsy, tsz = WG["map_startbox"].GetEffectiveStartPosition(teamID) else tsx, tsy, tsz = Spring.GetTeamStartPosition(teamID) end if tsx and tsx > 0 then - local startUnitDefID = Spring.GetTeamRulesParam(teamID, 'startUnit') + local startUnitDefID = Spring.GetTeamRulesParam(teamID, "startUnit") if startUnitDefID then - id = startUnitDefID..'_'..tsx..'_'..spGetGroundHeight(tsx, tsz)..'_'..tsz + id = startUnitDefID .. "_" .. tsx .. "_" .. spGetGroundHeight(tsx, tsz) .. "_" .. tsz if teamStartPositions[teamID] ~= id then removeUnitShape(teamStartPositions[teamID]) teamStartPositions[teamID] = id @@ -1210,20 +1206,22 @@ function widget:RecvLuaMsg(msg, playerID) if words[1] == "DraftOrderPlayersOrder" then allyTeamID_about = tonumber(words[2] or -1) - if allyTeamID_about ~= myAllyTeamID then return end + if allyTeamID_about ~= myAllyTeamID then + return + end if myTeamPlayersOrder == nil then myTeamPlayersOrder = {} if devUItestMode then local fakePlayers = mathRandom(16) for i = 1, fakePlayers do - tableInsert(myTeamPlayersOrder, {id = 30+i, name = "Player"..tostring((i+9+mathRandom(1000000))) }) -- debug + tableInsert(myTeamPlayersOrder, { id = 30 + i, name = "Player" .. tostring((i + 9 + mathRandom(1000000))) }) -- debug end end for i = 3, #words do local playerid = tonumber(words[i]) tname = select(1, Spring.GetPlayerInfo(playerid, false)) tname = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerid)) or tname - tableInsert(myTeamPlayersOrder, {id = playerid, name = tname }) + tableInsert(myTeamPlayersOrder, { id = playerid, name = tname }) end if #myTeamPlayersOrder > bigTeamAmountOfPlayers then -- big team, not regular game turnTimeOut = turnTimeOutBigTeam @@ -1232,14 +1230,16 @@ function widget:RecvLuaMsg(msg, playerID) currentPlayerIndex = 1 -- simulating queue progress on local end only progressQueueLocally(0) end - if (moreThanOneAlly or devUItestMode) then + if moreThanOneAlly or devUItestMode then DrawTeamPlacement() end voteConTimeout = nil end elseif words[1] == "DraftOrderPlayerTurn" then allyTeamID_about = tonumber(words[2] or -1) - if allyTeamID_about ~= myAllyTeamID then return end + if allyTeamID_about ~= myAllyTeamID then + return + end local oldIndex = currentPlayerIndex if not devUItestMode then -- production: trust the gadget currentPlayerIndex = tonumber(words[3] or -1) @@ -1249,8 +1249,8 @@ function widget:RecvLuaMsg(msg, playerID) else current_playerID = -1 end - if myTeamPlayersOrder[currentPlayerIndex+1] and myTeamPlayersOrder[currentPlayerIndex+1].id ~= nil then - next_playerID = myTeamPlayersOrder[currentPlayerIndex+1].id + if myTeamPlayersOrder[currentPlayerIndex + 1] and myTeamPlayersOrder[currentPlayerIndex + 1].id ~= nil then + next_playerID = myTeamPlayersOrder[currentPlayerIndex + 1].id else next_playerID = -1 end @@ -1259,7 +1259,7 @@ function widget:RecvLuaMsg(msg, playerID) myTurn = true PlayChooseStartLocSound() elseif next_playerID == myPlayerID then - Spring.PlaySoundFile("beep6", 1, 'ui') + Spring.PlaySoundFile("beep6", 1, "ui") elseif myTurn then myTurn = false end @@ -1273,7 +1273,7 @@ function widget:RecvLuaMsg(msg, playerID) allyTeamID_about = tonumber(words[2] or -1) if (allyTeamID_about == myAllyTeamID) and (myAllyTeamJoined ~= true) then myAllyTeamJoined = true - invalidateButtonState() -- Ally team joining changes button state + invalidateButtonState() -- Ally team joining changes button state if draftMode == "fair" then PlayChooseStartLocSound() end @@ -1296,13 +1296,13 @@ function widget:Shutdown() glDeleteList(buttonHoverList) glDeleteList(TeamPlacementUI) gl.DeleteFont(font) - if WG['guishader'] then - WG['guishader'].RemoveRect('pregameui_draft') + if WG["guishader"] then + WG["guishader"].RemoveRect("pregameui_draft") end if WG.StopDrawUnitShapeGL4 then for id, _ in pairs(unitshapes) do removeUnitShape(id) end end - WG['pregameui_draft'] = nil + WG["pregameui_draft"] = nil end diff --git a/luaui/Widgets/gui_projectile_target_aoe.lua b/luaui/Widgets/gui_projectile_target_aoe.lua index 89d16de29bc..a4abb5aa5fe 100644 --- a/luaui/Widgets/gui_projectile_target_aoe.lua +++ b/luaui/Widgets/gui_projectile_target_aoe.lua @@ -9,7 +9,7 @@ function widget:GetInfo() date = "January 2026", license = "GNU GPL v2", layer = 0, - enabled = true + enabled = true, } end @@ -68,64 +68,64 @@ local GL_TRIANGLES = GL.TRIANGLES -- Configuration -------------------------------------------------------------------------------- local Config = { - minAoeThreshold = 30, -- Minimum AOE to show indicator - circleDivs = 32, -- Circle segments - baseLineWidth = 1.3, -- Base line width - updateInterval = 0.25, -- Seconds between projectile updates (0 = every frame) - impactFadeDuration = 0.6, -- Seconds to fade out after impact + minAoeThreshold = 30, -- Minimum AOE to show indicator + circleDivs = 32, -- Circle segments + baseLineWidth = 1.3, -- Base line width + updateInterval = 0.25, -- Seconds between projectile updates (0 = every frame) + impactFadeDuration = 0.6, -- Seconds to fade out after impact -- Colors (RGBA) - allyColor = { 1.0, 0.3, 0.2, 1.0 }, -- Red for allied (your missiles) - enemyColor = { 1.0, 0.3, 0.2, 1.0 }, -- Red for enemy (same, they shouldn't show for players) - paralyzerColor = { 0.2, 0.8, 1.0, 1.0 }, -- Cyan for paralyzer weapons - nukeAllyColor = { 1.0, 0.2, 0.0, 1.0 }, -- Orange for allied nukes - nukeEnemyColor = { 1.0, 0.0, 0.0, 1.0 }, -- Bright red for enemy nukes - junoAllyColor = { 0.2, 1.0, 0.2, 1.0 }, -- Green for allied juno missiles - junoEnemyColor = { 0.2, 1.0, 0.2, 1.0 }, -- Green for enemy juno missiles + allyColor = { 1.0, 0.3, 0.2, 1.0 }, -- Red for allied (your missiles) + enemyColor = { 1.0, 0.3, 0.2, 1.0 }, -- Red for enemy (same, they shouldn't show for players) + paralyzerColor = { 0.2, 0.8, 1.0, 1.0 }, -- Cyan for paralyzer weapons + nukeAllyColor = { 1.0, 0.2, 0.0, 1.0 }, -- Orange for allied nukes + nukeEnemyColor = { 1.0, 0.0, 0.0, 1.0 }, -- Bright red for enemy nukes + junoAllyColor = { 0.2, 1.0, 0.2, 1.0 }, -- Green for allied juno missiles + junoEnemyColor = { 0.2, 1.0, 0.2, 1.0 }, -- Green for enemy juno missiles -- Animation - blinkSpeed = 0, -- Blinks per second at max urgency - rotationSpeedMax = 100, -- Degrees per second at start - rotationSpeedMin = 30, -- Degrees per second at end + blinkSpeed = 0, -- Blinks per second at max urgency + rotationSpeedMax = 100, -- Degrees per second at start + rotationSpeedMin = 30, -- Degrees per second at end pulseMinOpacity = 0.2, pulseMaxOpacity = 0.4, -- Camera distance fade for smaller (non-nuke) starburst indicators smallAoeFadeStartDist = 3200, -- Distance at which indicators start fading - smallAoeFadeEndDist = 6400, -- Distance at which indicators are fully invisible + smallAoeFadeEndDist = 6400, -- Distance at which indicators are fully invisible -- Ring animation - ringCount = 4, -- Number of concentric rings - ringPulseSpeed = 0.015, -- Ring pulse animation speed + ringCount = 4, -- Number of concentric rings + ringPulseSpeed = 0.015, -- Ring pulse animation speed -- Nuke sub-layer animation - nukeSubLayerMin = 12, -- Minimum sub-layers per trefoil blade - nukeSubLayerMax = 64, -- Maximum sub-layers per trefoil blade - nukeSubLayerAoeDivisor = 40, -- AOE / this = number of sub-layers - nukeWaveSpeed = 1, -- Wave cycles per second (outside to inside) - nukeWaveCount = 1.2, -- Number of wave bands visible across the shape at once - nukeSubLayerGap = 0.25, -- Gap between sub-layers as fraction of layer thickness - nukeBaseOpacity = 0.9, -- Overall opacity multiplier for nuke trefoil indicator (0-1) - nukeGradientStrength = 0.75, -- Gradient strength: 0 = uniform, 1 = outer fully bright / inner fully dim + nukeSubLayerMin = 12, -- Minimum sub-layers per trefoil blade + nukeSubLayerMax = 64, -- Maximum sub-layers per trefoil blade + nukeSubLayerAoeDivisor = 40, -- AOE / this = number of sub-layers + nukeWaveSpeed = 1, -- Wave cycles per second (outside to inside) + nukeWaveCount = 1.2, -- Number of wave bands visible across the shape at once + nukeSubLayerGap = 0.25, -- Gap between sub-layers as fraction of layer thickness + nukeBaseOpacity = 0.9, -- Overall opacity multiplier for nuke trefoil indicator (0-1) + nukeGradientStrength = 0.75, -- Gradient strength: 0 = uniform, 1 = outer fully bright / inner fully dim } -------------------------------------------------------------------------------- -- State -------------------------------------------------------------------------------- -local trackedProjectiles = {} -- Active projectiles we're tracking -local trackedCount = 0 -- Number of tracked projectiles (avoids pairs iteration) -local trackedNukeCount = 0 -- Number of tracked nuke projectiles (avoids iteration) -local fadingImpacts = {} -- Recently impacted targets that should fade out -local fadingImpactCount = 0 -- Number of active fading impacts -local starburstWeapons = {} -- Cache of starburst weapon info -local circleList = nil -- Display list for circle -local targetMarkerList = nil -- Display list for target marker +local trackedProjectiles = {} -- Active projectiles we're tracking +local trackedCount = 0 -- Number of tracked projectiles (avoids pairs iteration) +local trackedNukeCount = 0 -- Number of tracked nuke projectiles (avoids iteration) +local fadingImpacts = {} -- Recently impacted targets that should fade out +local fadingImpactCount = 0 -- Number of active fading impacts +local starburstWeapons = {} -- Cache of starburst weapon info +local circleList = nil -- Display list for circle +local targetMarkerList = nil -- Display list for target marker local screenLineWidthScale = 1.0 local myAllyTeamID = 0 local myTeamID = 0 local isSpectator = false -local updateAccum = 0 -- Accumulator for update rate limiting -local currentGeneration = 0 -- Generation counter for tracking (avoids temp table allocation) +local updateAccum = 0 -- Accumulator for update rate limiting +local currentGeneration = 0 -- Generation counter for tracking (avoids temp table allocation) -------------------------------------------------------------------------------- -- Initialization - Build weapon cache @@ -190,13 +190,15 @@ local function CreateDisplayLists() end) end end) - - end local function DeleteDisplayLists() - if circleList then glDeleteList(circleList) end - if targetMarkerList then glDeleteList(targetMarkerList) end + if circleList then + glDeleteList(circleList) + end + if targetMarkerList then + glDeleteList(targetMarkerList) + end end -------------------------------------------------------------------------------- @@ -204,8 +206,8 @@ end -------------------------------------------------------------------------------- local BLADE_SEGMENTS = 16 local BLADE_SEGMENTS_MINI = 8 -local bladeGeometry = {} -- [blade][segment] = {cos, sin} for world -local bladeGeometryMini = {} -- [blade][segment] = {cos, sin} for minimap +local bladeGeometry = {} -- [blade][segment] = {cos, sin} for world +local bladeGeometryMini = {} -- [blade][segment] = {cos, sin} for minimap local function PrecomputeBladeGeometry() local bladeAngle = rad(60) @@ -239,7 +241,9 @@ end local function UpdateScreenScale() local _, screenHeight = spGetViewGeometry() screenLineWidthScale = 1.0 + (screenHeight - 1080) * (1.5 / 1080) - if screenLineWidthScale < 0.5 then screenLineWidthScale = 0.5 end + if screenLineWidthScale < 0.5 then + screenLineWidthScale = 0.5 + end end -------------------------------------------------------------------------------- @@ -302,7 +306,7 @@ local function drawAllNukeGeometry() local gradientMul = 1 - nukeGradientStrength * (1 - normalizedPos) local layerAlpha = ca * baseOpacity * waveBrightness * gradientMul - if layerAlpha > 0.005 then -- skip invisible layers + if layerAlpha > 0.005 then -- skip invisible layers glColor(cr, cg, cb, layerAlpha) local rI = radius * layerInner local rO = radius * layerOuter @@ -435,7 +439,11 @@ end local function AddFadingImpact(data, currentTime, impactProgress) local clampedProgress = impactProgress - if clampedProgress > 1 then clampedProgress = 1 elseif clampedProgress < 0 then clampedProgress = 0 end + if clampedProgress > 1 then + clampedProgress = 1 + elseif clampedProgress < 0 then + clampedProgress = 0 + end local impactRingScale = 1 - clampedProgress * 0.5 fadingImpactCount = fadingImpactCount + 1 @@ -463,22 +471,22 @@ local function GetProjectileTargetPos(proID) end -- Ground target - if targetType == 103 then -- ASCII 'g' + if targetType == 103 then -- ASCII 'g' if type(targetData) == "table" then return targetData[1], targetData[2], targetData[3] end -- Unit target - elseif targetType == 117 then -- ASCII 'u' + elseif targetType == 117 then -- ASCII 'u' local ux, uy, uz = spGetUnitPosition(targetData) if ux then return ux, uy, uz end -- Feature target - elseif targetType == 102 then -- ASCII 'f' + elseif targetType == 102 then -- ASCII 'f' -- Could add feature position lookup if needed return nil -- Projectile target (interceptor) - elseif targetType == 112 then -- ASCII 'p' + elseif targetType == 112 then -- ASCII 'p' local px, py, pz = spGetProjectilePosition(targetData) if px then return px, py, pz @@ -517,7 +525,9 @@ local function UpdateTrackedProjectiles() if isSpectator or existingData.isOwnTeam then existingData.generation = gen newCount = newCount + 1 - if existingData.weaponInfo.isNuke then newNukeCount = newNukeCount + 1 end + if existingData.weaponInfo.isNuke then + newNukeCount = newNukeCount + 1 + end local px, py, pz = spGetProjectilePosition(proID) if px then existingData.projectileX = px @@ -542,11 +552,15 @@ local function UpdateTrackedProjectiles() local estimatedFlightTime = distance / speed newCount = newCount + 1 - if weaponInfo.isNuke then newNukeCount = newNukeCount + 1 end + if weaponInfo.isNuke then + newNukeCount = newNukeCount + 1 + end -- Cache ground-adjusted target Y at creation (avoids per-frame API call) local groundY = spGetGroundHeight(tx, tz) - if groundY and groundY > ty then ty = groundY end + if groundY and groundY > ty then + ty = groundY + end trackedProjectiles[proID] = { generation = gen, @@ -592,7 +606,7 @@ end -------------------------------------------------------------------------------- -- Draws non-nuke starburst indicators (nukes are batched separately in DrawWorld) local function DrawImpactIndicator(data, currentTime, camX, camY, camZ) - local tx, ty, tz = data.targetX, data.targetY, data.targetZ -- targetY already ground-adjusted + local tx, ty, tz = data.targetX, data.targetY, data.targetZ -- targetY already ground-adjusted local weaponInfo = data.weaponInfo local aoe = weaponInfo.aoe @@ -608,7 +622,11 @@ local function DrawImpactIndicator(data, currentTime, camX, camY, camZ) local elapsed = currentTime - data.startTime local progress = elapsed / max(data.initialFlightTime, 0.1) - if progress > 1 then progress = 1 elseif progress < 0 then progress = 0 end + if progress > 1 then + progress = 1 + elseif progress < 0 then + progress = 0 + end local color if weaponInfo.isParalyzer then @@ -749,7 +767,9 @@ function widget:Update(dt) end function widget:DrawWorld() - if spIsGUIHidden() or (trackedCount == 0 and fadingImpactCount == 0) then return end + if spIsGUIHidden() or (trackedCount == 0 and fadingImpactCount == 0) then + return + end glDepthTest(false) glLineWidth(Config.baseLineWidth * screenLineWidthScale) @@ -765,7 +785,11 @@ function widget:DrawWorld() -- Collect nuke into batch for single-draw-call rendering local elapsed = currentTime - data.startTime local progress = elapsed / max(data.initialFlightTime, 0.1) - if progress > 1 then progress = 1 elseif progress < 0 then progress = 0 end + if progress > 1 then + progress = 1 + elseif progress < 0 then + progress = 0 + end local blinkPhase = 0 if Config.blinkSpeed > 0 then @@ -780,7 +804,10 @@ function widget:DrawWorld() nukeBatchSize = nukeBatchSize + 1 local nd = nukeBatch[nukeBatchSize] - if not nd then nd = {}; nukeBatch[nukeBatchSize] = nd end + if not nd then + nd = {} + nukeBatch[nukeBatchSize] = nd + end nd.tx = data.targetX nd.ty = data.targetY + 3 nd.tz = data.targetZ @@ -836,7 +863,9 @@ function widget:DrawWorld() end function widget:DrawInMiniMap(sx, sy) - if trackedNukeCount == 0 then return end + if trackedNukeCount == 0 then + return + end local currentTime = osClock() local worldToPixelX = sx / mapSizeX @@ -849,7 +878,11 @@ function widget:DrawInMiniMap(sx, sy) if data.weaponInfo.isNuke then local elapsed = currentTime - data.startTime local progress = elapsed / max(data.initialFlightTime, 0.1) - if progress > 1 then progress = 1 elseif progress < 0 then progress = 0 end + if progress > 1 then + progress = 1 + elseif progress < 0 then + progress = 0 + end local blinkPhase = 0 if Config.blinkSpeed > 0 then @@ -865,11 +898,18 @@ function widget:DrawInMiniMap(sx, sy) local trefoilWorldSize = aoe * 0.75 * (0.6 + 0.08 * sin(currentTime * tau * 0.4)) local trefoilPixelSize = trefoilWorldSize * worldToPixelX - if trefoilPixelSize < 5 then trefoilPixelSize = 5 elseif trefoilPixelSize > 40 then trefoilPixelSize = 40 end + if trefoilPixelSize < 5 then + trefoilPixelSize = 5 + elseif trefoilPixelSize > 40 then + trefoilPixelSize = 40 + end minimapNukeBatchSize = minimapNukeBatchSize + 1 local nd = minimapNukeBatch[minimapNukeBatchSize] - if not nd then nd = {}; minimapNukeBatch[minimapNukeBatchSize] = nd end + if not nd then + nd = {} + minimapNukeBatch[minimapNukeBatchSize] = nd + end nd.targPX = data.targetX * worldToPixelX nd.targPY = (1 - data.targetZ / mapSizeZ) * sy nd.projPX = data.projectileX * worldToPixelX @@ -887,7 +927,9 @@ function widget:DrawInMiniMap(sx, sy) end end - if minimapNukeBatchSize == 0 then return end + if minimapNukeBatchSize == 0 then + return + end -- Batch all lines in ONE draw call glLineWidth(1.5) diff --git a/luaui/Widgets/gui_prospector.lua b/luaui/Widgets/gui_prospector.lua index 62bc2f53ed9..edce33ef930 100644 --- a/luaui/Widgets/gui_prospector.lua +++ b/luaui/Widgets/gui_prospector.lua @@ -15,7 +15,7 @@ function widget:GetInfo() date = "9 January 2009", license = "GNU LGPL, v2.1 or later", layer = 1010, - enabled = true + enabled = true, } end @@ -36,7 +36,6 @@ local glColor = gl.Color local glRect = gl.Rect local glPolygonMode = gl.PolygonMode - local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK local GL_FILL = GL.FILL @@ -93,7 +92,7 @@ local function DrawTextWithBackground(text, x, y, size, opt) end font:Begin() - font:SetOutlineColor(0,0,0, 0.5) + font:SetOutlineColor(0, 0, 0, 0.5) font:SetTextColor(1, 1, 1, 0.85) font:Print(text, x + 4, y, size, opt) font:End() @@ -128,7 +127,6 @@ local function SetupMexDefInfos() end end end - end local function IntegrateMetal(mexDefInfo, x, z, forceUpdate) @@ -170,7 +168,7 @@ local function IntegrateMetal(mexDefInfo, x, z, forceUpdate) if dist < MEX_RADIUS then local _, metal, metal2 = GetGroundInfo(cx, cz) - if type(metal) == 'string' then + if type(metal) == "string" then -- Spring > v104 metal = metal2 end @@ -192,7 +190,6 @@ function widget:Initialize() metalMap = WG["resource_spot_finder"].isMetalMap end - function widget:DrawScreen() if once then widget:ViewResize() @@ -232,15 +229,17 @@ function widget:DrawScreen() end if not metalMap then local pos = WG["resource_spot_finder"].GetClosestMexSpot(coords[1], coords[3]) - if not pos then return end + if not pos then + return + end coords[1] = pos.x coords[3] = pos.z end IntegrateMetal(mexDefInfo, coords[1], coords[3], forceUpdate) - DrawTextWithBackground(Spring.I18N('ui.prospector.metalExtraction', { amount = strFormat("%.2f", extraction) }), mx, my, textSize, "do") + DrawTextWithBackground(Spring.I18N("ui.prospector.metalExtraction", { amount = strFormat("%.2f", extraction) }), mx, my, textSize, "do") glColor(1, 1, 1, 1) end function widget:ViewResize() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) end diff --git a/luaui/Widgets/gui_rank_icons_gl4.lua b/luaui/Widgets/gui_rank_icons_gl4.lua index 024e8459064..c429a4260f8 100644 --- a/luaui/Widgets/gui_rank_icons_gl4.lua +++ b/luaui/Widgets/gui_rank_icons_gl4.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "Feb, 2008", license = "GNU GPL, v2 or later", layer = 5, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spEcho = Spring.Echo @@ -31,12 +30,12 @@ local iconsizeMult = 1 local usedIconsize = iconsize * iconsizeMult local maximumRankXP = 0.8 -local numRanks = #VFS.DirList('LuaUI/Images/ranks', '*.png') +local numRanks = #VFS.DirList("LuaUI/Images/ranks", "*.png") local rankTextures = {} -for i = 1,numRanks do - rankTextures[i] = 'LuaUI/Images/ranks/rank'..i..'.png' +for i = 1, numRanks do + rankTextures[i] = "LuaUI/Images/ranks/rank" .. i .. ".png" end -local xpPerLevel = maximumRankXP/(numRanks-1) +local xpPerLevel = maximumRankXP / (numRanks - 1) local unitHeights = {} local spec, fullview = spGetSpectatingState() @@ -45,7 +44,7 @@ local spec, fullview = spGetSpectatingState() local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local atlasID = nil local atlasSize = 2048 @@ -58,12 +57,14 @@ local luaShaderDir = "LuaUI/Include/" local debugmode = false local function addDirToAtlas(atlas, path) - local imgExts = {bmp = true,tga = true,jpg = true,png = true,dds = true, tif = true} - local files = VFS.DirList(path, '*.png') - if debugmode then spEcho("Adding",#files, "images to atlas from", path) end - for i=1, #files do - if imgExts[string.sub(files[i],-3,-1)] then - gl.AddAtlasTexture(atlas,files[i]) + local imgExts = { bmp = true, tga = true, jpg = true, png = true, dds = true, tif = true } + local files = VFS.DirList(path, "*.png") + if debugmode then + spEcho("Adding", #files, "images to atlas from", path) + end + for i = 1, #files do + if imgExts[string.sub(files[i], -3, -1)] then + gl.AddAtlasTexture(atlas, files[i]) --atlassedImages[files[i]] = true --if debugmode then spEcho("added", files[i]) end end @@ -71,7 +72,7 @@ local function addDirToAtlas(atlas, path) end local function makeAtlas() - atlasID = gl.CreateTextureAtlas(atlasSize,atlasSize,1) + atlasID = gl.CreateTextureAtlas(atlasSize, atlasSize, 1) addDirToAtlas(atlasID, "LuaUI/Images/ranks") local result = gl.FinalizeTextureAtlas(atlasID) if debugmode then @@ -94,9 +95,9 @@ local GL_GREATER = GL.GREATER local ignoreTeams = {} for _, teamID in ipairs(Spring.GetTeamList()) do - if select(4, Spring.GetTeamInfo(teamID,false)) then -- is AI? + if select(4, Spring.GetTeamInfo(teamID, false)) then -- is AI? local luaAI = Spring.GetTeamLuaAI(teamID) - if luaAI and luaAI ~= "" and (string.find(luaAI, 'Scavengers') or string.find(luaAI, 'Raptors')) then + if luaAI and luaAI ~= "" and (string.find(luaAI, "Scavengers") or string.find(luaAI, "Raptors")) then ignoreTeams[teamID] = true end end @@ -130,14 +131,19 @@ function widget:SetConfigData(data) end end - local vbocachetable = {} -for i = 1, 18 do vbocachetable[i] = 0 end -- init this caching table to preserve mem allocs +for i = 1, 18 do + vbocachetable[i] = 0 +end -- init this caching table to preserve mem allocs local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason, rank, flash) - if debugmode then Spring.Debug.TraceEcho("add",unitID,reason) end + if debugmode then + Spring.Debug.TraceEcho("add", unitID, reason) + end if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true then - if debugmode then spEcho("Warning: Rank Icons GL4 attempted to add an invalid unitID:", unitID) end + if debugmode then + spEcho("Warning: Rank Icons GL4 attempted to add an invalid unitID:", unitID) + end return nil end local gf = (flash and Spring.GetGameFrame()) or 0 @@ -149,17 +155,17 @@ local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason, rank, fla --local texname = "unittextures/decals/".. UnitDefs[unitDefID].name .. "_aoplane.dds" --unittextures/decals/armllt_aoplane.dds --spEcho (rank, rankTextures[rank], unitIconMult[unitDefID]) - local p,q,s,t = gl.GetAtlasTexture(atlasID, rankTextures[rank]) + local p, q, s, t = gl.GetAtlasTexture(atlasID, rankTextures[rank]) vbocachetable[1] = usedIconsize -- length vbocachetable[2] = usedIconsize -- widgth vbocachetable[3] = 0 -- cornersize - vbocachetable[4] = (unitHeights[unitDefID] or iconoffset) - 8 + ((debugmode and math.random()*16 ) or 0)-- height + vbocachetable[4] = (unitHeights[unitDefID] or iconoffset) - 8 + ((debugmode and math.random() * 16) or 0) -- height --vbocachetable[5] = 0 -- spGetUnitTeam(unitID) vbocachetable[6] = 4 -- numvertices - vbocachetable[7] = gf-(doRefresh and 200 or 0) -- gameframe for animations + vbocachetable[7] = gf - (doRefresh and 200 or 0) -- gameframe for animations vbocachetable[8] = unitIconMult[unitDefID] -- size mult vbocachetable[9] = 1.0 -- alpha --vbocachetable[10] = 0 -- unused @@ -169,25 +175,27 @@ local function AddPrimitiveAtUnit(unitID, unitDefID, noUpload, reason, rank, fla vbocachetable[13] = t vbocachetable[14] = s - return pushElementInstance( rankVBO, -- push into this Instance VBO Table vbocachetable, -- yes we save 1 table alloc this way unitID, -- this is the key inside the VBO Table, should be unique per unit true, -- update existing element noUpload, -- noupload, dont use unless you know what you want to batch push/pop - unitID) -- last one should be UNITID! + unitID + ) -- last one should be UNITID! end -local function RemovePrimitive(unitID,reason) - if debugmode then Spring.Debug.TraceEcho("remove",unitID,reason) end +local function RemovePrimitive(unitID, reason) + if debugmode then + Spring.Debug.TraceEcho("remove", unitID, reason) + end if rankVBO.instanceIDtoIndex[unitID] then popElementInstance(rankVBO, unitID) end end local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 1 shaderConfig.HEIGHTOFFSET = 0 @@ -207,7 +215,9 @@ local function initGL4() shaderConfig.USE_CIRCLES = nil shaderConfig.USE_CORNERRECT = nil - if debugmode then shaderConfig.POST_SHADING = shaderConfig.POST_SHADING .. " fragColor.a += 0.25;" end + if debugmode then + shaderConfig.POST_SHADING = shaderConfig.POST_SHADING .. " fragColor.a += 0.25;" + end rankVBO, rankShader = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit(shaderConfig, "Rank Icons") if rankVBO == nil then widgetHandler:RemoveWidget() @@ -216,13 +226,15 @@ local function initGL4() makeAtlas() - if debugmode then rankVBO.debug = true end + if debugmode then + rankVBO.debug = true + end --ProcessAllUnits() return true end local function getRank(unitDefID, xp) - local rankLevel = math.ceil(xp/xpPerLevel) + local rankLevel = math.ceil(xp / xpPerLevel) if rankLevel == 0 then return 1 elseif rankLevel <= numRanks then @@ -262,32 +274,31 @@ function widget:PlayerChanged(playerID) spec, fullview = spGetSpectatingState() end - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() return end - WG['rankicons'] = {} - WG['rankicons'].getDrawDistance = function() + WG["rankicons"] = {} + WG["rankicons"].getDrawDistance = function() return distanceMult end - WG['rankicons'].setDrawDistance = function(value) + WG["rankicons"].setDrawDistance = function(value) distanceMult = value usedCutoffDistance = cutoffDistance * distanceMult end - WG['rankicons'].getScale = function() + WG["rankicons"].getScale = function() return iconsizeMult end - WG['rankicons'].setScale = function(value) + WG["rankicons"].setScale = function(value) iconsizeMult = value usedIconsize = iconsize * iconsizeMult doRefresh = true end - WG['rankicons'].getRank = function(unitDefID, xp) + WG["rankicons"].getRank = function(unitDefID, xp) return getRank(unitDefID, xp) end - WG['rankicons'].getRankTextures = function(unitDefID, xp) + WG["rankicons"].getRankTextures = function(unitDefID, xp) return rankTextures end @@ -295,7 +306,9 @@ function widget:Initialize() unitHeights[unitDefID] = ud.height + iconoffset end - if not initGL4() then return end + if not initGL4() then + return + end local allUnits = GetAllUnits() for i = 1, #allUnits do @@ -357,7 +370,6 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) doRefresh = false end - function widget:DrawScreenEffects() -- DrawScreenEffects so rank icons render after deferred lighting/distortion/bloom/tonemap; -- shader still uses engine cameraViewProj UBO and depth-test for terrain occlusion. @@ -379,9 +391,9 @@ function widget:DrawScreenEffects() --gl.DepthMask(false) glTexture(0, atlasID) rankShader:Activate() - rankShader:SetUniform("iconDistance",usedCutoffDistance) - rankShader:SetUniform("addRadius",0) - rankVBO.VAO:DrawArrays(GL.POINTS,rankVBO.usedElements) + rankShader:SetUniform("iconDistance", usedCutoffDistance) + rankShader:SetUniform("addRadius", 0) + rankVBO.VAO:DrawArrays(GL.POINTS, rankVBO.usedElements) rankShader:Deactivate() glTexture(0, false) --gl.Culling(false) diff --git a/luaui/Widgets/gui_raptorStatsPanel.lua b/luaui/Widgets/gui_raptorStatsPanel.lua index de387aa00a6..9e4ce006666 100644 --- a/luaui/Widgets/gui_raptorStatsPanel.lua +++ b/luaui/Widgets/gui_raptorStatsPanel.lua @@ -12,11 +12,10 @@ function widget:GetInfo() date = "May 04, 2008", license = "GNU GPL, v2 or later", layer = -9, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathAbs = math.abs local mathCeil = math.ceil @@ -26,7 +25,7 @@ local mathMin = math.min -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local config = VFS.Include('LuaRules/Configs/raptor_spawn_defs.lua') +local config = VFS.Include("LuaRules/Configs/raptor_spawn_defs.lua") local customScale = 1 local widgetScale = customScale @@ -123,7 +122,6 @@ local rules = { local waveColor = "\255\255\0\0" local textColor = "\255\255\255\255" - local raptorTypes = { "raptor", "raptora", @@ -142,7 +140,7 @@ local function commaValue(amount) local formatted = amount local k while true do - formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') + formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", "%1,%2") if k == 0 then break end @@ -187,57 +185,58 @@ local function CreatePanelDisplayList() local currentTime = GetGameSeconds() if currentTime > gameInfo.raptorGracePeriod then if gameInfo.raptorQueenAnger < 100 then - local gain = 0 if Spring.GetGameRulesParam("RaptorQueenAngerGain_Base") then - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerBase', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerAggression', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenAngerBase", { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) }), panelMarginX + 5, PanelRow(3), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenAngerAggression", { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) }), panelMarginX + 5, PanelRow(4), panelFontSize, "") --font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerEco', { value = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Eco"), 3) }), panelMarginX+5, PanelRow(5), panelFontSize, "") gain = math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Base"), 3) + math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Aggression"), 3) + math.round(Spring.GetGameRulesParam("RaptorQueenAngerGain_Eco"), 3) end --font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerWithGain', { anger = gameInfo.raptorQueenAnger, gain = math.round(gain, 3) }), panelMarginX, PanelRow(1), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.raptors.queenAngerWithTech', { anger = mathFloor(0.5+gameInfo.raptorQueenAnger), techAnger = gameInfo.raptorTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenAngerWithTech", { anger = mathFloor(0.5 + gameInfo.raptorQueenAnger), techAnger = gameInfo.raptorTechAnger }), panelMarginX, PanelRow(1), panelFontSize, "") local totalSeconds = (100 - gameInfo.raptorQueenAnger) / gain time = string.formatTime(totalSeconds) if totalSeconds < 1800 or revealedQueenEta then - if not revealedQueenEta then revealedQueenEta = true end - font:Print(textColor .. Spring.I18N('ui.raptors.queenETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") + if not revealedQueenEta then + revealedQueenEta = true + end + font:Print(textColor .. Spring.I18N("ui.raptors.queenETA", { count = nBosses, time = time }), panelMarginX + 5, PanelRow(2), panelFontSize, "") end if #currentlyResistantToNames > 0 then currentlyResistantToNames = {} currentlyResistantTo = {} end else - font:Print(textColor .. Spring.I18N('ui.raptors.queenHealth', {count = nBosses, health = gameInfo.raptorQueenHealth }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenHealth", { count = nBosses, health = gameInfo.raptorQueenHealth }), panelMarginX, PanelRow(1), panelFontSize, "") if Spring.GetGameRulesParam("raptorQueenStaggerActive") == false then - font:Print(textColor .. Spring.I18N('ui.raptors.queenStaggerPercentage', {count = nBosses, value = 100-Spring.GetGameRulesParam("raptorQueenStaggerPercentage") }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenStaggerPercentage", { count = nBosses, value = 100 - Spring.GetGameRulesParam("raptorQueenStaggerPercentage") }), panelMarginX, PanelRow(2), panelFontSize, "") else - font:Print("\255\255\255\0" .. Spring.I18N('ui.raptors.queenStaggerActive', {count = nBosses}), panelMarginX, PanelRow(2), panelFontSize, "") - font:Print("\255\255\255\0" .. Spring.I18N('ui.raptors.queenStaggerPercentage', {count = nBosses, value = 100-Spring.GetGameRulesParam("raptorQueenStaggerPercentage") }), panelMarginX, PanelRow(3), panelFontSize, "") + font:Print("\255\255\255\0" .. Spring.I18N("ui.raptors.queenStaggerActive", { count = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print("\255\255\255\0" .. Spring.I18N("ui.raptors.queenStaggerPercentage", { count = nBosses, value = 100 - Spring.GetGameRulesParam("raptorQueenStaggerPercentage") }), panelMarginX, PanelRow(3), panelFontSize, "") end if nBosses > 1 then - font:Print(textColor .. Spring.I18N('ui.raptors.queensKilled', { nKilled = gameInfo.raptorQueensKilled, nTotal = nBosses }), panelMarginX, PanelRow(4), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queensKilled", { nKilled = gameInfo.raptorQueensKilled, nTotal = nBosses }), panelMarginX, PanelRow(4), panelFontSize, "") end - for i = 1,#currentlyResistantToNames do + for i = 1, #currentlyResistantToNames do if i == 1 then - font:Print(textColor .. Spring.I18N('ui.raptors.queenResistantToList', {count = nBosses}), panelMarginX, PanelRow(11), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.queenResistantToList", { count = nBosses }), panelMarginX, PanelRow(11), panelFontSize, "") end - font:Print(textColor .. currentlyResistantToNames[i], panelMarginX+20, PanelRow(11+i), panelFontSize, "") + font:Print(textColor .. currentlyResistantToNames[i], panelMarginX + 20, PanelRow(11 + i), panelFontSize, "") end end else - font:Print(textColor .. Spring.I18N('ui.raptors.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.raptorGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.gracePeriod", { time = string.formatTime(mathCeil(((currentTime - gameInfo.raptorGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") end - font:Print(textColor .. Spring.I18N('ui.raptors.raptorKillCount', { count = gameInfo.raptorKills }), panelMarginX, PanelRow(6), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.raptors.raptorKillCount", { count = gameInfo.raptorKills }), panelMarginX, PanelRow(6), panelFontSize, "") local endless = "" if Spring.GetModOptions().raptor_endless then - endless = ' (' .. Spring.I18N('ui.raptors.difficulty.endless') .. ')' + endless = " (" .. Spring.I18N("ui.raptors.difficulty.endless") .. ")" end - local difficultyCaption = Spring.I18N('ui.raptors.difficulty.' .. difficultyOption) - font:Print(textColor .. Spring.I18N('ui.raptors.mode', { mode = difficultyCaption }) .. endless, 80, h - 170, panelFontSize, "") + local difficultyCaption = Spring.I18N("ui.raptors.difficulty." .. difficultyOption) + font:Print(textColor .. Spring.I18N("ui.raptors.mode", { mode = difficultyCaption }) .. endless, 80, h - 170, panelFontSize, "") font:End() gl.Texture(false) @@ -247,18 +246,18 @@ end local function getMarqueeMessage(raptorEventArgs) local messages = {} if raptorEventArgs.type == "firstWave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.firstWave1') - messages[2] = textColor .. Spring.I18N('ui.raptors.firstWave2') + messages[1] = textColor .. Spring.I18N("ui.raptors.firstWave1") + messages[2] = textColor .. Spring.I18N("ui.raptors.firstWave2") elseif raptorEventArgs.type == "queen" then - messages[1] = textColor .. Spring.I18N('ui.raptors.queenIsAngry1', {count = nBosses}) - messages[2] = textColor .. Spring.I18N('ui.raptors.queenIsAngry2') + messages[1] = textColor .. Spring.I18N("ui.raptors.queenIsAngry1", { count = nBosses }) + messages[2] = textColor .. Spring.I18N("ui.raptors.queenIsAngry2") elseif raptorEventArgs.type == "airWave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.raptors.airWave1') - messages[3] = textColor .. Spring.I18N('ui.raptors.airWave2', {unitCount = raptorEventArgs.number}) + messages[1] = textColor .. Spring.I18N("ui.raptors.wave1", { waveNumber = raptorEventArgs.waveCount }) + messages[2] = textColor .. Spring.I18N("ui.raptors.airWave1") + messages[3] = textColor .. Spring.I18N("ui.raptors.airWave2", { unitCount = raptorEventArgs.number }) elseif raptorEventArgs.type == "wave" then - messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.raptors.wave2', {unitCount = raptorEventArgs.number}) + messages[1] = textColor .. Spring.I18N("ui.raptors.wave1", { waveNumber = raptorEventArgs.waveCount }) + messages[2] = textColor .. Spring.I18N("ui.raptors.wave2", { unitCount = raptorEventArgs.number }) end refreshMarqueeMessage = false @@ -268,20 +267,19 @@ end local function getResistancesMessage() local messages = {} - messages[1] = textColor .. Spring.I18N('ui.raptors.resistanceUnits', {count = nBosses}) - for i = 1,#resistancesTable do + messages[1] = textColor .. Spring.I18N("ui.raptors.resistanceUnits", { count = nBosses }) + for i = 1, #resistancesTable do local attackerName = UnitDefs[resistancesTable[i]].name if UnitDefNames[attackerName].customParams.i18nfromunit then attackerName = UnitDefNames[attackerName].customParams.i18nfromunit end - messages[i+1] = textColor .. Spring.I18N('units.names.' .. attackerName) - currentlyResistantToNames[#currentlyResistantToNames+1] = Spring.I18N('units.names.' .. attackerName) + messages[i + 1] = textColor .. Spring.I18N("units.names." .. attackerName) + currentlyResistantToNames[#currentlyResistantToNames + 1] = Spring.I18N("units.names." .. attackerName) end resistancesTable = {} refreshMarqueeMessage = false - return messages end @@ -291,8 +289,8 @@ local function Draw() end if updatePanel then - if (guiPanel) then - gl.DeleteList(guiPanel); + if guiPanel then + gl.DeleteList(guiPanel) guiPanel = nil end guiPanel = gl.CreateList(CreatePanelDisplayList) @@ -337,8 +335,8 @@ local function UpdateRules() for _, rule in ipairs(rules) do gameInfo[rule] = Spring.GetGameRulesParam(rule) or 0 end - gameInfo.raptorCounts = getRaptorCounts('Count') - gameInfo.raptorKills = getRaptorCounts('Kills') + gameInfo.raptorCounts = getRaptorCounts("Count") + gameInfo.raptorKills = getRaptorCounts("Kills") updatePanel = true end @@ -406,7 +404,7 @@ function widget:Shutdown() end if guiPanel then - gl.DeleteList(guiPanel); + gl.DeleteList(guiPanel) guiPanel = nil end @@ -438,8 +436,6 @@ function widget:GameFrame(n) end end - - function widget:DrawScreen() Draw() end @@ -451,10 +447,7 @@ function widget:MouseMove(x, y, dx, dy, button) end function widget:MousePress(x, y, button) - if enabled and - x > x1 and x < x1 + (w * widgetScale) and - y > y1 and y < y1 + (h * widgetScale) - then + if enabled and x > x1 and x < x1 + (w * widgetScale) and y > y1 and y < y1 + (h * widgetScale) then capture = true moving = true end @@ -473,8 +466,8 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) x1 = mathFloor(x1 - viewSizeX) y1 = mathFloor(y1 - viewSizeY) diff --git a/luaui/Widgets/gui_reclaim_field_highlight.lua b/luaui/Widgets/gui_reclaim_field_highlight.lua index 9f981e4a619..8afc1788bd6 100644 --- a/luaui/Widgets/gui_reclaim_field_highlight.lua +++ b/luaui/Widgets/gui_reclaim_field_highlight.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Reclaim Field Highlight", - desc = "Highlights clusters of reclaimable material", - author = "ivand, refactored by esainane, edited for BAR by Lexon, efrec and Floris", - date = "2024", - license = "public", - layer = 1270000, - enabled = true + name = "Reclaim Field Highlight", + desc = "Highlights clusters of reclaimable material", + author = "ivand, refactored by esainane, edited for BAR by Lexon, efrec and Floris", + date = "2024", + license = "public", + layer = 1270000, + enabled = true, } end @@ -37,23 +37,23 @@ local showEnergyOption = 3 -- Same options as showOption, but for energy fields local showEnergyFields = true -- Show energy reclaim fields separately --Metal value font -local numberColor = {0.9, 0.9, 0.9, 1} -local energyNumberColor = {1.0, 0.9, 0.1, 1} +local numberColor = { 0.9, 0.9, 0.9, 1 } +local energyNumberColor = { 1.0, 0.9, 0.1, 1 } -- Resource icons (shown in front of each metal/energy value label) local showResourceIcons = false -- Enabled at runtime only in scenario games -local iconSizeRatio = 1.0 -- Icon size relative to text font size -local iconGapRatio = 0.0 -- Gap between icon and text relative to font size +local iconSizeRatio = 1.0 -- Icon size relative to text font size +local iconGapRatio = 0.0 -- Gap between icon and text relative to font size local fontSizeMin = 25 local fontSizeMax = 75 --Field color -local reclaimColor = {0, 0, 0, 0.16} -local reclaimEdgeColor = {1, 1, 1, 0.18} +local reclaimColor = { 0, 0, 0, 0.16 } +local reclaimEdgeColor = { 1, 1, 1, 0.18 } --Energy field color (yellowish tint) -local energyReclaimColor = {0.8, 0.8, 0, 0.16} -local energyReclaimEdgeColor = {1, 0.9, 0, 0.18} +local energyReclaimColor = { 0.8, 0.8, 0, 0.16 } +local energyReclaimEdgeColor = { 1, 0.9, 0, 0.18 } --Energy field settings local energyOpacityMultiplier = 0.44 -- Multiplier for energy field opacity (relative to metal fields) @@ -185,7 +185,10 @@ local spGetGameFrame = Spring.GetGameFrame local debugTiming = false local osClock = os.clock local timingAccum = { - updateReclaim = 0, drawWorldText = 0, drawPreUnit = 0, updateFunc = 0, + updateReclaim = 0, + drawWorldText = 0, + drawPreUnit = 0, + updateFunc = 0, } local timingCount = 0 local timingInterval = 120 -- echo every N draw calls @@ -216,7 +219,7 @@ local function IsInCameraView(x, y, z, radius, currentDrawCount) local dx = newCamX - cachedCameraX local dy = newCamY - cachedCameraY local dz = newCamZ - cachedCameraZ - local moved = (dx*dx + dy*dy + dz*dz) > cameraMovementThreshold * cameraMovementThreshold + local moved = (dx * dx + dy * dy + dz * dz) > cameraMovementThreshold * cameraMovementThreshold -- Check if camera has rotated significantly (dot product change) local oldDot = cachedCamFwdX * newCamForward[1] + cachedCamFwdY * newCamForward[2] + cachedCamFwdZ * newCamForward[3] @@ -244,7 +247,7 @@ local function IsInCameraView(x, y, z, radius, currentDrawCount) local dx = x - cachedCameraX local dy = y - cachedCameraY local dz = z - cachedCameraZ - local distSq = dx*dx + dy*dy + dz*dz + local distSq = dx * dx + dy * dy + dz * dz local dist = sqrt(distSq) -- Skip if too far away (beyond fade distance + radius) - early out @@ -253,7 +256,9 @@ local function IsInCameraView(x, y, z, radius, currentDrawCount) end -- Normalize direction vector - if dist < 0.01 then return true, dist end -- Camera is at the point + if dist < 0.01 then + return true, dist + end -- Camera is at the point local invDist = 1.0 / dist dx, dy, dz = dx * invDist, dy * invDist, dz * invDist @@ -328,29 +333,29 @@ local dirty = { needCluster = false, needRedraw = false, forceFullRedraw = false, - regions = {}, -- Track which regions need reclustering - clusters = {}, -- Track which specific clusters need redrawing - energyClusters = {}, -- Track which specific energy clusters need redrawing - useRegional = true, -- Enable regional optimization + regions = {}, -- Track which regions need reclustering + clusters = {}, -- Track which specific clusters need redrawing + energyClusters = {}, -- Track which specific energy clusters need redrawing + useRegional = true, -- Enable regional optimization } -- Batch queues and deferred update state (consolidated) local batch = { - toRemove = {}, -- Reusable table for batching feature removals - pendDestructions = {}, -- Queue for batching FeatureDestroyed calls - pendDestrCount = 0, -- Count of pending destructions - pendCreations = {}, -- Queue for batching FeatureCreated calls - pendCreateCount = 0, -- Count of pending creations - affectedFeatures = {}, -- Reusable table for regional clustering - affectedClusters = {}, -- Reusable table for regional clustering - deferCreations = {}, -- Features created outside view - deferDestructions = {}, -- Features destroyed outside view + toRemove = {}, -- Reusable table for batching feature removals + pendDestructions = {}, -- Queue for batching FeatureDestroyed calls + pendDestrCount = 0, -- Count of pending destructions + pendCreations = {}, -- Queue for batching FeatureCreated calls + pendCreateCount = 0, -- Count of pending creations + affectedFeatures = {}, -- Reusable table for regional clustering + affectedClusters = {}, -- Reusable table for regional clustering + deferCreations = {}, -- Features created outside view + deferDestructions = {}, -- Features destroyed outside view deferCreateCount = 0, deferDestrCount = 0, - deferOutOfView = true, -- Config: defer processing features outside view - outOfViewMargin = 350, -- Elmos margin beyond fade distance to still process immediately + deferOutOfView = true, -- Config: defer processing features outside view + outOfViewMargin = 350, -- Elmos margin beyond fade distance to still process immediately lastDeferFrame = 0, - deferInterval = 60, -- Process deferred updates every 60 frames (~2 seconds) + deferInterval = 60, -- Process deferred updates every 60 frames (~2 seconds) } -- Cache to avoid redundant Spring API calls @@ -366,7 +371,7 @@ local energyClusterVisibilityCache = {} -- {[energyCid] = {frame, inView, dist, -- Forward declare this early since it's used in draw functions local GetClusterVisibility -local epsilonSq = epsilon*epsilon +local epsilonSq = epsilon * epsilon local checkFrequency = 30 local lastFeatureCount = 0 local cachedKnownFeaturesCount = 0 -- Cached count to avoid iterating all features @@ -431,17 +436,17 @@ local animState = { nextUID = 1, -- Per-uid live anim state: {alpha, scale, animType, animT0, animDur} - clusterAnims = {}, -- metal, [uid] = state - energyClusterAnims = {}, -- energy, [uid] = state + clusterAnims = {}, -- metal, [uid] = state + energyClusterAnims = {}, -- energy, [uid] = state -- Snapshot of clusters from the previous clustering pass (for identity match) - prevSnapshot = {}, -- metal, [uid] = {fids, fidCount} - prevEnergySnapshot = {}, -- energy + prevSnapshot = {}, -- metal, [uid] = {fids, fidCount} + prevEnergySnapshot = {}, -- energy -- Clusters that disappeared and are currently fading out. They own their -- own hull copies and display lists. - fading = {}, -- metal, [uid] = entry - fadingEnergy = {}, -- energy + fading = {}, -- metal, [uid] = entry + fadingEnergy = {}, -- energy -- Group toggle fade (fields turning on/off as a whole). 0..1 toggleMetal = 0, @@ -453,8 +458,8 @@ local animState = { -- Pre-clustering snapshot of hulls (deep-copied) so we can render fadeout -- for clusters that disappear after the next clustering pass. - preHullCopies = {}, -- metal, [uid] = {hull, center, text, font, textX, textZ, alpha, isEnergy} - preEnergyHullCopies = {}, -- energy + preHullCopies = {}, -- metal, [uid] = {hull, center, text, font, textX, textZ, alpha, isEnergy} + preEnergyHullCopies = {}, -- energy -- Forward-declared functions (filled in below). Stored on the table to -- avoid creating extra upvalues in the chunk. @@ -468,7 +473,9 @@ local animState = { -- Helper function to compute a simple hash/signature of cluster state local function ComputeClusterStateHash(cluster, hull) - if not cluster or not hull then return 0 end + if not cluster or not hull then + return 0 + end -- Hash based on: member count, total value, center position, hull vertex count -- This is a simple hash - not cryptographic, just for change detection local memberCount = cluster.members and #cluster.members or 0 @@ -488,14 +495,20 @@ end -- Smoothstep ease for animation curves local function easeInOut(t) - if t <= 0 then return 0 end - if t >= 1 then return 1 end + if t <= 0 then + return 0 + end + if t >= 1 then + return 1 + end return t * t * (3 - 2 * t) end -- Pulse curve: 0 -> 1 -> 0 over [0,1] (peak at 0.5). Smooth. local function pulseCurve(t) - if t <= 0 or t >= 1 then return 0 end + if t <= 0 or t >= 1 then + return 0 + end -- sin(pi * t) gives a nice 0->1->0 hump return sin(t * 3.14159265) end @@ -609,7 +622,9 @@ local function syncSide(isEnergy) -- iterations to avoid one tally allocation per cluster). local bestOldUid, bestOverlap = nil, 0 local tally = sharedTally - for k in pairs(tally) do tally[k] = nil end + for k in pairs(tally) do + tally[k] = nil + end for fid in pairs(fids) do local oldUid = fidToOldUid[fid] if oldUid and not matchedOldUids[oldUid] then @@ -624,12 +639,14 @@ local function syncSide(isEnergy) end local uid - local pulseDir = 0 -- -1 shrink, +1 expand, 0 no pulse + local pulseDir = 0 -- -1 shrink, +1 expand, 0 no pulse if bestOldUid then local oldSnap = snapshot[bestOldUid] local oldCount = oldSnap.fidCount local maxCount = oldCount - if count > maxCount then maxCount = count end + if count > maxCount then + maxCount = count + end if maxCount > 0 and (bestOverlap / maxCount) >= animCfg.identityMinOverlap then uid = bestOldUid matchedOldUids[bestOldUid] = true @@ -638,7 +655,9 @@ local function syncSide(isEnergy) local newValue = (isEnergy and cluster.energy or cluster.metal) or 0 local oldValue = oldSnap.value or 0 local denom = oldValue - if newValue > denom then denom = newValue end + if newValue > denom then + denom = newValue + end if denom > 0 then local rel = (newValue - oldValue) / denom if rel >= animCfg.pulseMinRelativeChange then @@ -744,7 +763,9 @@ animState.SyncClusterIdentitiesAfterClustering = function() end for uid, entry in pairs(animState.fadingEnergy) do -- Force quick fadeout when energy has been disabled - if entry.t0 then entry.t0 = entry.t0 - entry.duration end + if entry.t0 then + entry.t0 = entry.t0 - entry.duration + end end end end @@ -753,11 +774,19 @@ end animState.DeleteFadingCluster = function(uid, isEnergy) local fading = isEnergy and animState.fadingEnergy or animState.fading local entry = fading[uid] - if not entry then return end + if not entry then + return + end if entry.displayLists then - if entry.displayLists.gradient then glDeleteList(entry.displayLists.gradient) end - if entry.displayLists.edge then glDeleteList(entry.displayLists.edge) end - if entry.displayLists.text then glDeleteList(entry.displayLists.text) end + if entry.displayLists.gradient then + glDeleteList(entry.displayLists.gradient) + end + if entry.displayLists.edge then + glDeleteList(entry.displayLists.edge) + end + if entry.displayLists.text then + glDeleteList(entry.displayLists.text) + end entry.displayLists = nil end fading[uid] = nil @@ -818,8 +847,12 @@ local function _tickAnimsApply(anims) a.scale = 1 - pulseShrinkDelta * pulseCurve(p) end else - if not a.alpha or a.alpha < 1 then a.alpha = 1 end - if not a.scale or a.scale ~= 1 then a.scale = 1 end + if not a.alpha or a.alpha < 1 then + a.alpha = 1 + end + if not a.scale or a.scale ~= 1 then + a.scale = 1 + end end -- Smoothed visibility (handles distance fade + frustum pop-in/out). @@ -834,10 +867,14 @@ local function _tickAnimsApply(anims) if vis ~= target then if vis < target then vis = vis + visInStep - if vis > target then vis = target end + if vis > target then + vis = target + end else vis = vis - visOutStep - if vis < target then vis = target end + if vis < target then + vis = target + end end a.vis = vis end @@ -847,7 +884,9 @@ end -- Tick all animations. Called once per draw. animState.TickClusterAnimations = function(now) local dt = now - animState.lastTickClock - if dt <= 0 then return end + if dt <= 0 then + return + end animState.lastTickClock = now local toggleStep = dt / animCfg.toggleFadeDuration @@ -855,19 +894,27 @@ animState.TickClusterAnimations = function(now) if animState.toggleMetal ~= animState.toggleMetalTarget then if animState.toggleMetal < animState.toggleMetalTarget then animState.toggleMetal = animState.toggleMetal + toggleStep - if animState.toggleMetal > animState.toggleMetalTarget then animState.toggleMetal = animState.toggleMetalTarget end + if animState.toggleMetal > animState.toggleMetalTarget then + animState.toggleMetal = animState.toggleMetalTarget + end else animState.toggleMetal = animState.toggleMetal - toggleStep - if animState.toggleMetal < animState.toggleMetalTarget then animState.toggleMetal = animState.toggleMetalTarget end + if animState.toggleMetal < animState.toggleMetalTarget then + animState.toggleMetal = animState.toggleMetalTarget + end end end if animState.toggleEnergy ~= animState.toggleEnergyTarget then if animState.toggleEnergy < animState.toggleEnergyTarget then animState.toggleEnergy = animState.toggleEnergy + toggleStep - if animState.toggleEnergy > animState.toggleEnergyTarget then animState.toggleEnergy = animState.toggleEnergyTarget end + if animState.toggleEnergy > animState.toggleEnergyTarget then + animState.toggleEnergy = animState.toggleEnergyTarget + end else animState.toggleEnergy = animState.toggleEnergy - toggleStep - if animState.toggleEnergy < animState.toggleEnergyTarget then animState.toggleEnergy = animState.toggleEnergyTarget end + if animState.toggleEnergy < animState.toggleEnergyTarget then + animState.toggleEnergy = animState.toggleEnergyTarget + end end end @@ -924,7 +971,9 @@ do local function pop(self) local size = self.size - if size == 0 then return nil end + if size == 0 then + return nil + end local pris = self.priorities local vals = self.values local value = vals[1] @@ -969,8 +1018,8 @@ do local pqMeta = { __index = { - push = push, - pop = pop, + push = push, + pop = pop, clear = clear, }, } @@ -1054,7 +1103,7 @@ GetClusterVisibility = function(cid, isEnergy, currentDrawCount) if not cluster.radius then local cdx = cluster.dx or 0 local cdz = cluster.dz or 0 - cluster.radius = sqrt(cdx*cdx + cdz*cdz) * 0.5 + cluster.radius = sqrt(cdx * cdx + cdz * cdz) * 0.5 end -- For metal fields with alwaysShowFields enabled, bypass distance culling if above threshold @@ -1065,7 +1114,7 @@ GetClusterVisibility = function(cid, isEnergy, currentDrawCount) local dx = center.x - cachedCameraX local dy = center.y - cachedCameraY local dz = center.z - cachedCameraZ - dist = sqrt(dx*dx + dy*dy + dz*dz) + dist = sqrt(dx * dx + dy * dy + dz * dz) inView = true else inView, dist = IsInCameraView(center.x, center.y, center.z, cluster.radius, currentDrawCount) @@ -1098,7 +1147,7 @@ GetClusterVisibility = function(cid, isEnergy, currentDrawCount) generation = cameraGeneration, inView = inView, dist = dist, - fadeMult = fadeMult + fadeMult = fadeMult, } end @@ -1203,14 +1252,14 @@ do local x, z = points[1].x, points[1].z -- (1) Cover all points by expanding a quadrilateral to follow these rules: - local ax, az, a_xzs_max = x, z, x - z -- Choose point A to maximize x - z. - local bx, bz, b_xza_max = x, z, x + z -- Choose point B to maximize x + z. - local cx, cz, c_xzs_min = x, z, x - z -- Choose point C to minimize x - z. - local dx, dz, d_xza_min = x, z, x + z -- Choose point D to minimize x + z. + local ax, az, a_xzs_max = x, z, x - z -- Choose point A to maximize x - z. + local bx, bz, b_xza_max = x, z, x + z -- Choose point B to maximize x + z. + local cx, cz, c_xzs_min = x, z, x - z -- Choose point C to minimize x - z. + local dx, dz, d_xza_min = x, z, x + z -- Choose point D to minimize x + z. -- (2) Find the XZ-aligned rectangle inscribed in that quadrilateral: - local rxmin, rxmax = x, x -- Rx_min = max(Cx, Dx); Rx_max = min(Ax, Bx). - local rzmin, rzmax = z, z -- Rz_min = max(Az, Dz); Rz_max = min(Bz, Cz). + local rxmin, rxmax = x, x -- Rx_min = max(Cx, Dx); Rx_max = min(Ax, Bx). + local rzmin, rzmax = z, z -- Rz_min = max(Az, Dz); Rz_max = min(Bz, Cz). -- (3) The algorithm performs two passes, with the first covering the full set. for ii = 2, #points do @@ -1218,7 +1267,7 @@ do local x, z = point.x, point.z if x <= rxmin or x >= rxmax or z <= rzmin or z >= rzmax then -- Keep points that fall outside the inscribed rectangle. - remaining[#remaining+1] = point + remaining[#remaining + 1] = point -- Update points A, B, C, D and the inner rectangle bounds. local xzs = x - z @@ -1287,19 +1336,20 @@ do local MonotoneChain do local function cross(p, q, r) - return (q.z - p.z) * (r.x - q.x) - - (q.x - p.x) * (r.z - q.z) + return (q.z - p.z) * (r.x - q.x) - (q.x - p.x) * (r.z - q.z) end - MonotoneChain = function (points) + MonotoneChain = function(points) local numPoints = #points - if numPoints < 3 then return end + if numPoints < 3 then + return + end -- tableSort(points, sortMonotonic) -- Moved to previous, shared step. local lower = {} for i = 1, numPoints do local point = points[i] - while (#lower >= 2 and cross(lower[#lower - 1], lower[#lower], point) <= 0) do + while #lower >= 2 and cross(lower[#lower - 1], lower[#lower], point) <= 0 do remove(lower) end insert(lower, point) @@ -1308,7 +1358,7 @@ do local upper = {} for i = numPoints, 1, -1 do local point = points[i] - while (#upper >= 2 and cross(upper[#upper - 1], upper[#upper], point) <= 0) do + while #upper >= 2 and cross(upper[#upper - 1], upper[#upper], point) <= 0 do remove(upper) end insert(upper, point) @@ -1334,11 +1384,13 @@ do pt.x, pt.y, pt.z = x, y, z return pt end - return {x = x, y = y, z = z} + return { x = x, y = y, z = z } end recycleHull = function(hull) - if not hull then return end + if not hull then + return + end for i = 1, #hull do local pt = hull[i] if pt and not pt.fid then @@ -1374,11 +1426,7 @@ do local angle = (i / segments) * math.pi * 2 local x = cx + math.cos(angle) * radius local z = cz + math.sin(angle) * radius - convexHull[i + 1] = acquirePoint( - x, - max(0, spGetGroundHeight(x, z)), - z - ) + convexHull[i + 1] = acquirePoint(x, max(0, spGetGroundHeight(x, z)), z) end elseif #points == 2 then -- Two wrecks: create elongated shape oriented along the line between them @@ -1412,7 +1460,7 @@ do acquirePoint(x1, max(0, spGetGroundHeight(x1, z1)), z1), acquirePoint(x2, max(0, spGetGroundHeight(x2, z2)), z2), acquirePoint(x3, max(0, spGetGroundHeight(x3, z3)), z3), - acquirePoint(x4, max(0, spGetGroundHeight(x4, z4)), z4) + acquirePoint(x4, max(0, spGetGroundHeight(x4, z4)), z4), } else -- Fall back to simple box if points are too close @@ -1426,7 +1474,7 @@ do acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmin)), zmin), acquirePoint(xmax, max(0, spGetGroundHeight(xmax, zmin)), zmin), acquirePoint(xmax, max(0, spGetGroundHeight(xmax, zmax)), zmax), - acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmax)), zmax) + acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmax)), zmax), } end end @@ -1437,10 +1485,12 @@ do end local function polygonArea(points) - if #points < 3 then return 0 end + if #points < 3 then + return 0 + end local totalArea = 0 for ii = 1, #points - 1 do - totalArea = totalArea + points[ii].x * points[ii+1].z - points[ii].z * points[ii+1].x + totalArea = totalArea + points[ii].x * points[ii + 1].z - points[ii].z * points[ii + 1].x end return 0.5 * abs(totalArea + points[#points].x * points[1].z - points[#points].z * points[1].x) end @@ -1452,7 +1502,9 @@ do -- Subdivide long edges in hull to ensure smooth expansion local function subdivideHull(hull, maxEdgeLength) - if not hull or #hull < 3 then return hull end + if not hull or #hull < 3 then + return hull + end local count = 0 local n = #hull @@ -1469,7 +1521,7 @@ do entry.y = curr.y entry.z = curr.z else - subdividedBuf[count] = {x = curr.x, y = curr.y, z = curr.z} + subdividedBuf[count] = { x = curr.x, y = curr.y, z = curr.z } end -- Calculate edge length @@ -1494,7 +1546,7 @@ do subdividedBuf[count] = { x = interpX, y = max(0, spGetGroundHeight(interpX, interpZ)), - z = interpZ + z = interpZ, } end end @@ -1512,11 +1564,13 @@ do -- Expand hull outward by a margin and create rounded corners with Catmull-Rom smoothing local function expandAndSmoothHull(hull, expandDist) - if not hull or #hull < 3 then return hull end + if not hull or #hull < 3 then + return hull + end -- Subdivide long edges first to ensure smooth, even expansion -- Use expandDist as guide for max edge length (want multiple points per expansion distance) - local maxEdgeLength = max(expandDist * 1.5, 80) -- At least one subdivision per ~expansion distance + local maxEdgeLength = max(expandDist * 1.5, 80) -- At least one subdivision per ~expansion distance hull = subdivideHull(hull, maxEdgeLength) local n = #hull @@ -1539,11 +1593,15 @@ do -- Calculate edge vectors local dx1, dz1 = curr.x - prev.x, curr.z - prev.z local len1 = sqrt(dx1 * dx1 + dz1 * dz1) - if len1 > 0 then dx1, dz1 = dx1 / len1, dz1 / len1 end + if len1 > 0 then + dx1, dz1 = dx1 / len1, dz1 / len1 + end local dx2, dz2 = next.x - curr.x, next.z - curr.z local len2 = sqrt(dx2 * dx2 + dz2 * dz2) - if len2 > 0 then dx2, dz2 = dx2 / len2, dz2 / len2 end + if len2 > 0 then + dx2, dz2 = dx2 / len2, dz2 / len2 + end -- Calculate outward normals local nx1, nz1 = -dz1, dx1 @@ -1567,7 +1625,7 @@ do -- Blend normal and radial directions for smoother, more circular expansion -- Higher weight on radial = more circular/blob-like - local blendWeight = 0.7 -- 70% radial, 30% normal-based + local blendWeight = 0.7 -- 70% radial, 30% normal-based local finalNx = nx * (1 - blendWeight) + rx * blendWeight local finalNz = nz * (1 - blendWeight) + rz * blendWeight local finalLen = sqrt(finalNx * finalNx + finalNz * finalNz) @@ -1581,7 +1639,7 @@ do local sinHalfAngle = math.sin(angle * 0.5) -- Reduced the influence of corner sharpness for more uniform expansion local expandFactor = sinHalfAngle > 0.4 and (1.0 / sinHalfAngle) or 2.5 - expandFactor = clamp(expandFactor, 1.0, 2.0) -- Tighter range for more uniformity + expandFactor = clamp(expandFactor, 1.0, 2.0) -- Tighter range for more uniformity local newX = curr.x + finalNx * expandDist * expandFactor local newZ = curr.z + finalNz * expandDist * expandFactor @@ -1595,7 +1653,7 @@ do expandedBuf[i] = { x = newX, y = max(0, spGetGroundHeight(newX, newZ)), - z = newZ + z = newZ, } end end @@ -1688,7 +1746,7 @@ do return subClusters end - processCluster = function (cluster, clusterID, points, resourceType, targetHulls, targetClusters, nextClusterId) + processCluster = function(cluster, clusterID, points, resourceType, targetHulls, targetClusters, nextClusterId) getReclaimTotal(cluster, points, resourceType or "metal") local convexHull, hullArea @@ -1762,7 +1820,7 @@ do acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmin)), zmin), acquirePoint(xmax, max(0, spGetGroundHeight(xmax, zmin)), zmin), acquirePoint(xmax, max(0, spGetGroundHeight(xmax, zmax)), zmax), - acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmax)), zmax) + acquirePoint(xmin, max(0, spGetGroundHeight(xmin, zmax)), zmax), } hullArea = (xmax - xmin) * (zmax - zmin) usedBoundingBox = true @@ -1777,11 +1835,11 @@ do -- Increased expansion values for more encompassing, uniform fields local expansion if #points == 1 then - expansion = (maxRadius * 1.5 + 35) * expansionMultiplier -- Expansion for single wrecks + expansion = (maxRadius * 1.5 + 35) * expansionMultiplier -- Expansion for single wrecks elseif usedBoundingBox then - expansion = (maxRadius * 1.5 + 40) * expansionMultiplier -- Expansion for two wrecks + expansion = (maxRadius * 1.5 + 40) * expansionMultiplier -- Expansion for two wrecks else - expansion = (maxRadius * 1.8 + 65) * expansionMultiplier -- Expansion for clusters + expansion = (maxRadius * 1.8 + 65) * expansionMultiplier -- Expansion for clusters end -- Always use the standard expand+smooth method which follows the hull shape @@ -1878,7 +1936,7 @@ do -- Spread through next-neighbors by moving to the nearest point. local pt = seedsPQ:pop() while pt do - members[#members+1] = pt + members[#members + 1] = pt pt[cidField] = clusterID local nextNeighbors = featureNeighborsMatrix[pt.fid] @@ -1919,8 +1977,8 @@ do Run = Run, SetResourceType = function(self, resourceType) currentResourceType = resourceType - end - } + end, + }, }) return object end @@ -1932,7 +1990,9 @@ end local function MarkRegionDirty(x, z, radius) -- Mark a spatial region as needing reclustering - if not dirty.useRegional then return end + if not dirty.useRegional then + return + end local newRadius = radius or epsilon * 2 local merged = false @@ -1959,12 +2019,14 @@ local function MarkRegionDirty(x, z, radius) -- Add as new region if not merged if not merged then - dirty.regions[#dirty.regions + 1] = {x = x, z = z, radius = newRadius} + dirty.regions[#dirty.regions + 1] = { x = x, z = z, radius = newRadius } end end local function IsInDirtyRegion(x, z) - if not dirty.useRegional or #dirty.regions == 0 then return true end + if not dirty.useRegional or #dirty.regions == 0 then + return true + end for i = 1, #dirty.regions do local region = dirty.regions[i] local dx, dz = x - region.x, z - region.z @@ -1986,19 +2048,21 @@ local function AddFeature(featureID) end local x, y, z = spGetFeaturePosition(featureID) - if not x then return end + if not x then + return + end -- Mark region as dirty for regional reclustering MarkRegionDirty(x, z) local radius = spGetFeatureRadius(featureID) or 0 local feature = { - fid = featureID, + fid = featureID, metal = metal or 0, energy = energy or 0, - x = x, - y = max(0, y), - z = z, + x = x, + y = max(0, y), + z = z, radius = radius, } @@ -2046,7 +2110,9 @@ end local function RemoveFeature(featureID) local feature = knownFeatures[featureID] - if not feature then return end + if not feature then + return + end -- Mark region as dirty for regional reclustering MarkRegionDirty(feature.x, feature.z) @@ -2269,7 +2335,9 @@ local function CheckAllEnergyDrained() -- Clear energy data structures energyFeatureClusters = {} - for _, hull in pairs(energyFeatureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(energyFeatureConvexHulls) do + recycleHull(hull) + end energyFeatureConvexHulls = {} end @@ -2292,8 +2360,14 @@ end -- Pre-computed offset multipliers (avoid table allocation per call) local overlapOffsetMults = { - {0, 1.5}, {0, -1.5}, {1.5, 0}, {-1.5, 0}, - {1.2, 1.2}, {-1.2, 1.2}, {1.2, -1.2}, {-1.2, -1.2}, + { 0, 1.5 }, + { 0, -1.5 }, + { 1.5, 0 }, + { -1.5, 0 }, + { 1.2, 1.2 }, + { -1.2, 1.2 }, + { 1.2, -1.2 }, + { -1.2, -1.2 }, } local function FindNonOverlappingPosition(baseX, baseZ, fontSize) @@ -2312,9 +2386,13 @@ FormatResourceText = function(value) local v = value or 0 if string.formatSI then local ok, txt = pcall(string.formatSI, v, 0) - if ok and txt then return txt end + if ok and txt then + return txt + end ok, txt = pcall(string.formatSI, v) - if ok and txt then return txt end + if ok and txt then + return txt + end end if v >= 1000000 then return string.format("%.1fM", v / 1000000) @@ -2346,7 +2424,7 @@ local function EnsureClusterTextAnchors() posEntry.z = textZ posEntry.fontSize = fontSize else - drawnTextPositions[drawnTextPositionCount] = {x = textX, z = textZ, fontSize = fontSize} + drawnTextPositions[drawnTextPositionCount] = { x = textX, z = textZ, fontSize = fontSize } end end end @@ -2371,7 +2449,7 @@ local function EnsureClusterTextAnchors() posEntry.z = textZ posEntry.fontSize = fontSize else - drawnTextPositions[drawnTextPositionCount] = {x = textX, z = textZ, fontSize = fontSize} + drawnTextPositions[drawnTextPositionCount] = { x = textX, z = textZ, fontSize = fontSize } end end end @@ -2423,7 +2501,9 @@ local function ClusterizeFeatures() -- Cluster metal featureClusters = {} - for _, hull in pairs(featureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(featureConvexHulls) do + recycleHull(hull) + end featureConvexHulls = {} opticsObject:SetResourceType("metal") opticsObject:Run() @@ -2431,7 +2511,9 @@ local function ClusterizeFeatures() -- Always cluster energy fields when clustering is needed if showEnergyFields then energyFeatureClusters = {} - for _, hull in pairs(energyFeatureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(energyFeatureConvexHulls) do + recycleHull(hull) + end energyFeatureConvexHulls = {} opticsObject:SetResourceType("energy") opticsObject:Run() @@ -2482,7 +2564,9 @@ local function ClusterizeFeatures() -- Re-run clustering (it will create new cluster IDs) featureClusters = {} - for _, hull in pairs(featureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(featureConvexHulls) do + recycleHull(hull) + end featureConvexHulls = {} opticsObject:SetResourceType("metal") opticsObject:Run() @@ -2490,7 +2574,9 @@ local function ClusterizeFeatures() -- Always cluster energy fields when clustering is needed if showEnergyFields then energyFeatureClusters = {} - for _, hull in pairs(energyFeatureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(energyFeatureConvexHulls) do + recycleHull(hull) + end energyFeatureConvexHulls = {} opticsObject:SetResourceType("energy") opticsObject:Run() @@ -2510,7 +2596,9 @@ local function ClusterizeFeatures() else -- Full reclustering featureClusters = {} - for _, hull in pairs(featureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(featureConvexHulls) do + recycleHull(hull) + end featureConvexHulls = {} opticsObject:SetResourceType("metal") opticsObject:Run() @@ -2518,7 +2606,9 @@ local function ClusterizeFeatures() -- Always cluster energy fields when clustering is needed if showEnergyFields then energyFeatureClusters = {} - for _, hull in pairs(energyFeatureConvexHulls) do recycleHull(hull) end + for _, hull in pairs(energyFeatureConvexHulls) do + recycleHull(hull) + end energyFeatureConvexHulls = {} opticsObject:SetResourceType("energy") opticsObject:Run() @@ -2574,7 +2664,7 @@ local function ClusterizeFeatures() posEntry.z = textZ posEntry.fontSize = fontSize else - drawnTextPositions[drawnTextPositionCount] = {x = textX, z = textZ, fontSize = fontSize} + drawnTextPositions[drawnTextPositionCount] = { x = textX, z = textZ, fontSize = fontSize } end end end @@ -2596,7 +2686,7 @@ local function ClusterizeFeatures() posEntry.z = textZ posEntry.fontSize = fontSize else - drawnTextPositions[drawnTextPositionCount] = {x = textX, z = textZ, fontSize = fontSize} + drawnTextPositions[drawnTextPositionCount] = { x = textX, z = textZ, fontSize = fontSize } end end end @@ -2617,7 +2707,7 @@ end IsActiveReclaimCommand = function() local _, _, _, cmdName = spGetActiveCommand() - return cmdName == 'Reclaim' + return cmdName == "Reclaim" end local UpdateDrawEnabled -- Uses the showOption setting to pick a function call. @@ -2629,7 +2719,7 @@ do local function onMapDrawMode() -- todo: would be nice to set only when it changes -- todo: eg widget:MapDrawModeChanged(newMode, oldMode) - return actionActive == true or spGetMapDrawMode() == 'metal' + return actionActive == true or spGetMapDrawMode() == "metal" end local function onSelectReclaimer() @@ -2645,20 +2735,26 @@ do return true else local _, _, _, cmdName = spGetActiveCommand() - return (cmdName and cmdName == 'Reclaim') + return (cmdName and cmdName == "Reclaim") end end local showOptionFunctions = { - --[[1]] always, - --[[2]] onMapDrawMode, - --[[3]] onSelectReclaimer, - --[[4]] onSelectResurrector, - --[[5]] onActiveCommand, - --[[6]] widgetHandler.RemoveWidget, + --[[1]] + always, + --[[2]] + onMapDrawMode, + --[[3]] + onSelectReclaimer, + --[[4]] + onSelectResurrector, + --[[5]] + onActiveCommand, + --[[6]] + widgetHandler.RemoveWidget, } - UpdateDrawEnabled = function () + UpdateDrawEnabled = function() local previousDrawEnabled = drawEnabled -- Before game starts, always enable drawing regardless of user settings if not gameStarted then @@ -2683,7 +2779,7 @@ do end local function onMapDrawMode() - return actionActive == true or spGetMapDrawMode() == 'metal' + return actionActive == true or spGetMapDrawMode() == "metal" end local function onSelectReclaimer() @@ -2699,20 +2795,28 @@ do return true else local _, _, _, cmdName = spGetActiveCommand() - return (cmdName and cmdName == 'Reclaim') + return (cmdName and cmdName == "Reclaim") end end local showEnergyOptionFunctions = { - --[[1]] always, - --[[2]] onMapDrawMode, - --[[3]] onSelectReclaimer, - --[[4]] onSelectResurrector, - --[[5]] onActiveCommand, - --[[6]] function() return false end, -- disabled + --[[1]] + always, + --[[2]] + onMapDrawMode, + --[[3]] + onSelectReclaimer, + --[[4]] + onSelectResurrector, + --[[5]] + onActiveCommand, + --[[6]] + function() + return false + end, -- disabled } - UpdateDrawEnergyEnabled = function () + UpdateDrawEnergyEnabled = function() local previousDrawEnergyEnabled = drawEnergyEnabled if not showEnergyFields then drawEnergyEnabled = false @@ -2755,7 +2859,9 @@ local innerPointsBuf = {} -- Also fills the inner area with fillAlpha local function DrawHullVerticesGradient(hull, center, colors) local hullCount = #hull - if hullCount < 3 then return end + if hullCount < 3 then + return + end -- Use provided colors or default to metal colors local reclaimCol = colors and colors.fill or reclaimColor @@ -2781,7 +2887,7 @@ local function DrawHullVerticesGradient(hull, center, colors) innerPointsBuf[i] = { x = cx + dx * innerRadius, y = hullPoint.y, - z = cz + dz * innerRadius + z = cz + dz * innerRadius, } end end @@ -2873,8 +2979,12 @@ CreateClusterDisplayList = function(cid, isEnergy, alphaMult) end alphaMult = alphaMult or 1.0 - if alphaMult < 0 then alphaMult = 0 end - if alphaMult > 1 then alphaMult = 1 end + if alphaMult < 0 then + alphaMult = 0 + end + if alphaMult > 1 then + alphaMult = 1 + end -- Compute geometry hash (alpha-independent) plus a full hash with quantized -- alpha, so the gradient rebuilds on fade while the edge list can be reused. @@ -2940,7 +3050,9 @@ CreateClusterDisplayList = function(cid, isEnergy, alphaMult) -- Create the edge display list only when the geometry actually changed; its -- opacity is applied via glColor at draw time, so alpha-only fades reuse it. if not clusterData.edge or clusterData.geomHash ~= geomHash then - if clusterData.edge then glDeleteList(clusterData.edge) end + if clusterData.edge then + glDeleteList(clusterData.edge) + end clusterData.edge = glCreateList(function() glBeginEnd(GL.LINE_LOOP, DrawHullVertices, hull) end) @@ -2962,14 +3074,22 @@ end local function CreateFadingClusterDisplayList(uid, isEnergy) local fading = isEnergy and animState.fadingEnergy or animState.fading local entry = fading[uid] - if not entry then return end + if not entry then + return + end local hull = entry.hullCopy local center = entry.center - if not hull or #hull < 3 or not center then return end + if not hull or #hull < 3 or not center then + return + end local alphaMult = entry.alpha or entry.startAlpha or 1 - if alphaMult < 0 then alphaMult = 0 end - if alphaMult > 1 then alphaMult = 1 end + if alphaMult < 0 then + alphaMult = 0 + end + if alphaMult > 1 then + alphaMult = 1 + end -- Reuse table if present; otherwise allocate local dl = entry.displayLists @@ -2977,7 +3097,10 @@ local function CreateFadingClusterDisplayList(uid, isEnergy) dl = {} entry.displayLists = dl end - if dl.gradient then glDeleteList(dl.gradient); dl.gradient = nil end + if dl.gradient then + glDeleteList(dl.gradient) + dl.gradient = nil + end local listColors if isEnergy then @@ -3011,8 +3134,7 @@ local cachedCameraFacing = 0 -- Process deferred features that may have come into view local function ProcessDeferredFeatures(frame) - if (batch.deferCreateCount == 0 and batch.deferDestrCount == 0) or - (frame - batch.lastDeferFrame < batch.deferInterval and frame % 10 ~= 0) then + if (batch.deferCreateCount == 0 and batch.deferDestrCount == 0) or (frame - batch.lastDeferFrame < batch.deferInterval and frame % 10 ~= 0) then return end @@ -3106,7 +3228,7 @@ local function ProcessFlyingFeatures(frame) for featureID, fInfo in pairs(flyingFeatures) do -- Quick validation before API call if spValidFeatureID(featureID) then - local _,_,_, vw = spGetFeatureVelocity(featureID) + local _, _, _, vw = spGetFeatureVelocity(featureID) if vw then -- Feature still exists and has velocity data if vw <= 1e-3 then @@ -3301,7 +3423,7 @@ local function UpdateReclaimFields() end local clusterRebuildDue = dirty.needCluster and (activeReclaim or dirty.forceFullRedraw or (now - lastClusterRebuildClock) >= 0.75) - if not clusterRebuildDue and not dirty.forceFullRedraw and frame - lastCheckFrame < checkFrequency and now - lastCheckFrameClock < (checkFrequency/30) then + if not clusterRebuildDue and not dirty.forceFullRedraw and frame - lastCheckFrame < checkFrequency and now - lastCheckFrameClock < (checkFrequency / 30) then return end lastCheckFrame = spGetGameFrame() @@ -3389,15 +3511,17 @@ function widget:Initialize() gameStarted = Spring.GetGameFrame() > 0 showResourceIcons = Spring.GetModOptions().scenariooptions ~= nil screenx, screeny = widgetHandler:GetViewSizes() - local f = WG['fonts'] and WG['fonts'].getFont(2, 1.5) + local f = WG["fonts"] and WG["fonts"].getFont(2, 1.5) animCfg.font = f - animCfg.getTextWidth = (f and f.GetTextWidth) and function(text) return f:GetTextWidth(text) end or gl.GetTextWidth + animCfg.getTextWidth = (f and f.GetTextWidth) and function(text) + return f:GetTextWidth(text) + end or gl.GetTextWidth -- Initialize camera scale early to avoid thick lines on first draw local cx, cy, cz = spGetCameraPosition() local desc, w = spTraceScreenRay(screenx / 2, screeny / 2, true) if desc ~= nil then - local cameraDist = min(64000000, (cx-w[1])^2 + (cy-w[2])^2 + (cz-w[3])^2) + local cameraDist = min(64000000, (cx - w[1]) ^ 2 + (cy - w[2]) ^ 2 + (cz - w[3]) ^ 2) cameraScale = sqrt(sqrt(cameraDist) / 600) else cameraScale = 1.0 @@ -3406,96 +3530,96 @@ function widget:Initialize() widgetHandler:AddAction("reclaim_highlight", enableHighlight, nil, "p") widgetHandler:AddAction("reclaim_highlight", disableHighlight, nil, "r") - WG['reclaimfieldhighlight'] = {} - WG['reclaimfieldhighlight'].getShowOption = function() + WG["reclaimfieldhighlight"] = {} + WG["reclaimfieldhighlight"].getShowOption = function() return showOption end - WG['reclaimfieldhighlight'].setShowOption = function(value) + WG["reclaimfieldhighlight"].setShowOption = function(value) showOption = value end - WG['reclaimfieldhighlight'].getSmoothingSegments = function() + WG["reclaimfieldhighlight"].getSmoothingSegments = function() return smoothingSegments end - WG['reclaimfieldhighlight'].setSmoothingSegments = function(value) + WG["reclaimfieldhighlight"].setSmoothingSegments = function(value) smoothingSegments = clamp(value, 4, 40) -- Clamp to reasonable range dirty.needCluster = true -- Force recluster with new settings end - WG['reclaimfieldhighlight'].getShowEnergyFields = function() + WG["reclaimfieldhighlight"].getShowEnergyFields = function() return showEnergyFields end - WG['reclaimfieldhighlight'].setShowEnergyFields = function(value) + WG["reclaimfieldhighlight"].setShowEnergyFields = function(value) showEnergyFields = value dirty.needCluster = true -- Force recluster with new settings end - WG['reclaimfieldhighlight'].getShowEnergyOption = function() + WG["reclaimfieldhighlight"].getShowEnergyOption = function() return showEnergyOption end - WG['reclaimfieldhighlight'].setShowEnergyOption = function(value) + WG["reclaimfieldhighlight"].setShowEnergyOption = function(value) showEnergyOption = value end - WG['reclaimfieldhighlight'].getFadeStartDistance = function() + WG["reclaimfieldhighlight"].getFadeStartDistance = function() return fadeStartDistance end - WG['reclaimfieldhighlight'].setFadeStartDistance = function(value) + WG["reclaimfieldhighlight"].setFadeStartDistance = function(value) fadeStartDistance = max(100, value) -- Ensure start < end if fadeStartDistance >= fadeEndDistance then fadeEndDistance = fadeStartDistance + 1000 end end - WG['reclaimfieldhighlight'].getFadeEndDistance = function() + WG["reclaimfieldhighlight"].getFadeEndDistance = function() return fadeEndDistance end - WG['reclaimfieldhighlight'].setFadeEndDistance = function(value) + WG["reclaimfieldhighlight"].setFadeEndDistance = function(value) fadeEndDistance = max(fadeStartDistance + 100, value) end - WG['reclaimfieldhighlight'].getAlwaysShowFields = function() + WG["reclaimfieldhighlight"].getAlwaysShowFields = function() return alwaysShowFields end - WG['reclaimfieldhighlight'].setAlwaysShowFields = function(value) + WG["reclaimfieldhighlight"].setAlwaysShowFields = function(value) alwaysShowFields = value end - WG['reclaimfieldhighlight'].getAlwaysShowFieldsThreshold = function() + WG["reclaimfieldhighlight"].getAlwaysShowFieldsThreshold = function() return alwaysShowFieldsThreshold end - WG['reclaimfieldhighlight'].setAlwaysShowFieldsThreshold = function(value) + WG["reclaimfieldhighlight"].setAlwaysShowFieldsThreshold = function(value) -- Deprecated - threshold is now auto-calculated -- This function kept for backwards compatibility end - WG['reclaimfieldhighlight'].getAlwaysShowFieldsMinThreshold = function() + WG["reclaimfieldhighlight"].getAlwaysShowFieldsMinThreshold = function() return alwaysShowFieldsMinThreshold end - WG['reclaimfieldhighlight'].setAlwaysShowFieldsMinThreshold = function(value) + WG["reclaimfieldhighlight"].setAlwaysShowFieldsMinThreshold = function(value) alwaysShowFieldsMinThreshold = max(0, value) alwaysShowFieldsThreshold = CalculateAlwaysShowThreshold() end - WG['reclaimfieldhighlight'].getAlwaysShowFieldsMaxThreshold = function() + WG["reclaimfieldhighlight"].getAlwaysShowFieldsMaxThreshold = function() return alwaysShowFieldsMaxThreshold end - WG['reclaimfieldhighlight'].setAlwaysShowFieldsMaxThreshold = function(value) + WG["reclaimfieldhighlight"].setAlwaysShowFieldsMaxThreshold = function(value) alwaysShowFieldsMaxThreshold = max(alwaysShowFieldsMinThreshold, value) alwaysShowFieldsThreshold = CalculateAlwaysShowThreshold() end - WG['reclaimfieldhighlight'].getTotalMapMetal = function() + WG["reclaimfieldhighlight"].getTotalMapMetal = function() return totalMapMetal end -- Deferred update settings - WG['reclaimfieldhighlight'].getDeferOutOfViewUpdates = function() + WG["reclaimfieldhighlight"].getDeferOutOfViewUpdates = function() return batch.deferOutOfView end - WG['reclaimfieldhighlight'].setDeferOutOfViewUpdates = function(value) + WG["reclaimfieldhighlight"].setDeferOutOfViewUpdates = function(value) batch.deferOutOfView = value end - WG['reclaimfieldhighlight'].getOutOfViewMargin = function() + WG["reclaimfieldhighlight"].getOutOfViewMargin = function() return batch.outOfViewMargin end - WG['reclaimfieldhighlight'].setOutOfViewMargin = function(value) + WG["reclaimfieldhighlight"].setOutOfViewMargin = function(value) batch.outOfViewMargin = max(0, value) end @@ -3525,7 +3649,7 @@ function widget:Shutdown() widgetHandler:RemoveAction("reclaim_highlight", "p") widgetHandler:RemoveAction("reclaim_highlight", "r") - WG['reclaimfieldhighlight'] = nil -- todo: register/deregister, right? + WG["reclaimfieldhighlight"] = nil -- todo: register/deregister, right? -- Clean up per-cluster display lists for cid in pairs(clusterDisplayLists) do @@ -3556,7 +3680,7 @@ function widget:Shutdown() end function widget:GetConfigData(data) - return { + return { showOption = showOption, showEnergyOption = showEnergyOption, smoothingSegments = smoothingSegments, @@ -3565,7 +3689,7 @@ function widget:GetConfigData(data) fadeEndDistance = fadeEndDistance, alwaysShowFields = alwaysShowFields, alwaysShowFieldsMinThreshold = alwaysShowFieldsMinThreshold, - alwaysShowFieldsMaxThreshold = alwaysShowFieldsMaxThreshold + alwaysShowFieldsMaxThreshold = alwaysShowFieldsMaxThreshold, } end @@ -3624,11 +3748,11 @@ function widget:Update(dt) local cx, cy, cz = spGetCameraPosition() -- Only recompute cameraScale if camera actually moved local dx, dy, dz = cx - cachedCameraX, cy - cachedCameraY, cz - cachedCameraZ - if dx*dx + dy*dy + dz*dz > 1 then + if dx * dx + dy * dy + dz * dz > 1 then local desc, w = spTraceScreenRay(screenx / 2, screeny / 2, true) local cameraDist = 35000000 if desc ~= nil then - cameraDist = min(64000000, (cx-w[1])^2 + (cy-w[2])^2 + (cz-w[3])^2) + cameraDist = min(64000000, (cx - w[1]) ^ 2 + (cy - w[2]) ^ 2 + (cz - w[3]) ^ 2) end cameraScale = sqrt(sqrt(cameraDist) / 600) end @@ -3693,9 +3817,11 @@ end function widget:ViewResize(viewSizeX, viewSizeY) screenx, screeny = widgetHandler:GetViewSizes() vsx, vsy = Spring.GetViewGeometry() - local f = WG['fonts'] and WG['fonts'].getFont(2, 1.5) + local f = WG["fonts"] and WG["fonts"].getFont(2, 1.5) animCfg.font = f - animCfg.getTextWidth = (f and f.GetTextWidth) and function(text) return f:GetTextWidth(text) end or gl.GetTextWidth + animCfg.getTextWidth = (f and f.GetTextWidth) and function(text) + return f:GetTextWidth(text) + end or gl.GetTextWidth end -------------------------------------------------------------------------------- @@ -3706,7 +3832,9 @@ end local function DrawLiveCluster(cid, isEnergy, drawGradient) local clusters = isEnergy and energyFeatureClusters or featureClusters local cluster = clusters[cid] - if not cluster then return 0 end + if not cluster then + return 0 + end -- Drive the smoothed visibility tween: query GetClusterVisibility on the -- gradient pass each frame so the anim entry's visTarget stays current. @@ -3715,7 +3843,9 @@ local function DrawLiveCluster(cid, isEnergy, drawGradient) end local effAlpha, animScale = animState.GetClusterAnimAlphaAndScale(cluster.uid, isEnergy) - if effAlpha <= 0.001 then return 0 end + if effAlpha <= 0.001 then + return 0 + end local clusterData if isEnergy then @@ -3744,7 +3874,11 @@ local function DrawLiveCluster(cid, isEnergy, drawGradient) if not mustRebuild then animCfg.rebuildBudgetRemaining = animCfg.rebuildBudgetRemaining - 1 end - if isEnergy then energyClusterStateHashes[cid] = nil else clusterStateHashes[cid] = nil end + if isEnergy then + energyClusterStateHashes[cid] = nil + else + clusterStateHashes[cid] = nil + end CreateClusterDisplayList(cid, isEnergy, effAlpha) clusterData = isEnergy and energyClusterDisplayLists[cid] or clusterDisplayLists[cid] end @@ -3790,17 +3924,22 @@ end local function DrawFadingCluster(uid, entry, drawGradient) local alpha = entry.alpha or 0 - if alpha <= 0.001 then return end + if alpha <= 0.001 then + return + end local center = entry.center - if not center then return end + if not center then + return + end local inView = IsInCameraView(center.x, center.y, center.z, 600, drawCounter) - if not inView then return end + if not inView then + return + end if drawGradient then local dl = entry.displayLists local mustRebuild = not dl or not dl.gradient - local wantRebuild = mustRebuild - or not entry.lastBakedAlpha or abs(alpha - entry.lastBakedAlpha) > animCfg.rebuildThreshold + local wantRebuild = mustRebuild or not entry.lastBakedAlpha or abs(alpha - entry.lastBakedAlpha) > animCfg.rebuildThreshold if wantRebuild then if animCfg.rebuildBudgetFrame ~= drawCounter then animCfg.rebuildBudgetFrame = drawCounter @@ -3832,15 +3971,17 @@ local function DrawFadingCluster(uid, entry, drawGradient) end function widget:DrawWorld() - if spIsGUIHidden() == true then return end + if spIsGUIHidden() == true then + return + end local hasFadingMetal = next(animState.fading) ~= nil local hasFadingEnergy = next(animState.fadingEnergy) ~= nil local showMetal = drawEnabled or animState.toggleMetal > 0.005 or hasFadingMetal - local showEnergy = (showEnergyFields and drawEnergyEnabled and not allEnergyFieldsDrained) - or (showEnergyFields and animState.toggleEnergy > 0.005) - or hasFadingEnergy - if not showMetal and not showEnergy then return end + local showEnergy = (showEnergyFields and drawEnergyEnabled and not allEnergyFieldsDrained) or (showEnergyFields and animState.toggleEnergy > 0.005) or hasFadingEnergy + if not showMetal and not showEnergy then + return + end local t0 = debugTiming and osClock() or 0 @@ -3890,7 +4031,7 @@ function widget:DrawWorld() for uid, entry in pairs(animState.fading) do local alpha = entry.alpha or 0 if alpha > 0.001 and entry.text then - local drawAlpha = max(alpha, 0.2) + local drawAlpha = max(alpha, 0.2) widgetFont:SetOutlineColor(0, 0, 0, 0.7 * drawAlpha) widgetFont:SetTextColor(nc[1], nc[2], nc[3], nc[4] * drawAlpha) local fs = entry.font or fontSizeMin @@ -3924,7 +4065,7 @@ function widget:DrawWorld() for uid, entry in pairs(animState.fadingEnergy) do local alpha = entry.alpha or 0 if alpha > 0.001 and entry.text then - local drawAlpha = max(alpha, 0.2) + local drawAlpha = max(alpha, 0.2) widgetFont:SetOutlineColor(0, 0, 0, 0.7 * drawAlpha) widgetFont:SetTextColor(enc[1], enc[2], enc[3], enc[4] * drawAlpha) local fs = (entry.font or fontSizeMin) * energyTextSizeMultiplier @@ -4100,9 +4241,7 @@ function widget:DrawWorldPreUnit() local hasFadingMetal = next(animState.fading) ~= nil local hasFadingEnergy = next(animState.fadingEnergy) ~= nil local showMetal = drawEnabled or animState.toggleMetal > 0.005 or hasFadingMetal - local showEnergy = (showEnergyFields and drawEnergyEnabled and not allEnergyFieldsDrained) - or (showEnergyFields and animState.toggleEnergy > 0.005) - or hasFadingEnergy + local showEnergy = (showEnergyFields and drawEnergyEnabled and not allEnergyFieldsDrained) or (showEnergyFields and animState.toggleEnergy > 0.005) or hasFadingEnergy if not showMetal and not showEnergy then return @@ -4169,16 +4308,10 @@ function widget:DrawWorldPreUnit() timingCount = timingCount + 1 if debugTiming and timingCount >= timingInterval then local div = timingCount - Spring.Echo(string.format( - "[ReclaimField TIMING] per-call avg (ms): UpdateReclaim=%.3f DrawWorldText=%.3f DrawPreUnit=%.3f | Update()=%.3f | clusters=%d features=%d", - timingAccum.updateReclaim / div * 1000, - timingAccum.drawWorldText / div * 1000, - timingAccum.drawPreUnit / div * 1000, - timingAccum.updateFunc / div * 1000, - #featureClusters, - cachedKnownFeaturesCount - )) - for k in pairs(timingAccum) do timingAccum[k] = 0 end + Spring.Echo(string.format("[ReclaimField TIMING] per-call avg (ms): UpdateReclaim=%.3f DrawWorldText=%.3f DrawPreUnit=%.3f | Update()=%.3f | clusters=%d features=%d", timingAccum.updateReclaim / div * 1000, timingAccum.drawWorldText / div * 1000, timingAccum.drawPreUnit / div * 1000, timingAccum.updateFunc / div * 1000, #featureClusters, cachedKnownFeaturesCount)) + for k in pairs(timingAccum) do + timingAccum[k] = 0 + end timingCount = 0 end end diff --git a/luaui/Widgets/gui_reclaiminfo.lua b/luaui/Widgets/gui_reclaiminfo.lua index 0f391fdd673..57a23f0792e 100644 --- a/luaui/Widgets/gui_reclaiminfo.lua +++ b/luaui/Widgets/gui_reclaiminfo.lua @@ -21,11 +21,10 @@ function widget:GetInfo() date = "Nov 17, 2007", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathSqrt = math.sqrt @@ -44,14 +43,14 @@ local spGetMiniMapGeometry = Spring.GetMiniMapGeometry local spGetGroundHeight = Spring.GetGroundHeight local spI18N = Spring.I18N -local start = false --reclaim area cylinder drawing has been started -local metal = 0 --metal count from features in cylinder -local energy = 0 --energy count from features in cylinder +local start = false --reclaim area cylinder drawing has been started +local metal = 0 --metal count from features in cylinder +local energy = 0 --energy count from features in cylinder local nonground = "" --if reclaim order done with right click on a feature or unit -local rangestart = {0, 0, 0} --counting start center +local rangestart = { 0, 0, 0 } --counting start center local rangestartinminimap = false --both start and end need to be equaly checked -local rangeend = {} --counting radius end point -local b1was = false -- cursor was outside the map? +local rangeend = {} --counting radius end point +local b1was = false -- cursor was outside the map? local vsx, vsy = widgetHandler:GetViewSizes() local form = 12 --text format depends on screen size local xstart, ystart = 0, 0 @@ -88,7 +87,7 @@ end function widget:ViewResize() vsx, vsy = Spring.GetViewGeometry() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) form = mathFloor(vsx / 87) end @@ -114,7 +113,6 @@ local function MinimapToWorld(rx, ry) end end - function widget:DrawScreen() _, cmd, _ = spGetActiveCommand() x, y, b1, _, b2 = spGetMouseState() --b1 = left button pressed? @@ -147,7 +145,7 @@ function widget:DrawScreen() b1was = true else b1was = false - rangestart = {0, 0, 0} + rangestart = { 0, 0, 0 } end --bit more precise showing when mouse is moved by 4 pixels (start) if (b1 and rangestart ~= nil and cmd == CMD.RECLAIM and start == false) or (nonground == "Reclaim" and rangestart ~= nil and start == false and b2) then @@ -158,7 +156,6 @@ function widget:DrawScreen() end -- if (b1 and rangestart ~= nil and cmd == CMD.RECLAIM and start) or (nonground == "Reclaim" and start and b2 and rangestart ~= nil) then - local inMinimap, rx, ry = InMinimap(x, y) if inMinimap and rangestartinminimap then rangeend = MinimapToWorld(rx, ry) @@ -193,7 +190,7 @@ function widget:DrawScreen() cachedEnergy = energy metalParams.metal = metal energyParams.energy = energy - cachedAreaText = " " .. spI18N('ui.reclaimInfo.metal', metalParams) .. "\255\255\255\128" .. " " .. spI18N('ui.reclaimInfo.energy', energyParams) + cachedAreaText = " " .. spI18N("ui.reclaimInfo.metal", metalParams) .. "\255\255\255\128" .. " " .. spI18N("ui.reclaimInfo.energy", energyParams) end local tx = x @@ -206,9 +203,9 @@ function widget:DrawScreen() ty = ty - form end font:Begin() - font:SetOutlineColor(0,0,0, 0.6) + font:SetOutlineColor(0, 0, 0, 0.6) font:SetTextColor(1, 1, 1, 1) - font:Print(cachedAreaText, tx, ty, form, 'o') + font:Print(cachedAreaText, tx, ty, form, "o") font:End() else -- Reset cache when not dragging @@ -233,7 +230,7 @@ function widget:DrawScreen() cachedUnitMetal = metal metalParams.metal = metal local color = isReclaimable[unitDefID] and "\255\255\255\255" or "\255\220\10\10" - cachedUnitText = color .. " " .. spI18N('ui.reclaimInfo.metal', metalParams) + cachedUnitText = color .. " " .. spI18N("ui.reclaimInfo.metal", metalParams) end local tx = x @@ -246,11 +243,10 @@ function widget:DrawScreen() ty = ty - form end font:Begin() - font:SetOutlineColor(0,0,0, 0.5) + font:SetOutlineColor(0, 0, 0, 0.5) font:SetTextColor(1, 1, 1, 1) - font:Print(cachedUnitText, tx, ty, form, 'o') + font:Print(cachedUnitText, tx, ty, form, "o") font:End() end end end - diff --git a/luaui/Widgets/gui_rejoinprogress.lua b/luaui/Widgets/gui_rejoinprogress.lua index 84241c8bc17..43417dc4a11 100644 --- a/luaui/Widgets/gui_rejoinprogress.lua +++ b/luaui/Widgets/gui_rejoinprogress.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor @@ -20,7 +19,7 @@ local mathFloor = math.floor local spGetGameFrame = Spring.GetGameFrame local showRejoinUI = false -local CATCH_UP_THRESHOLD = 11 * Game.gameSpeed -- only show the window if behind this much +local CATCH_UP_THRESHOLD = 11 * Game.gameSpeed -- only show the window if behind this much local UPDATE_RATE_F = 5 -- frames local UPDATE_RATE_S = UPDATE_RATE_F / Game.gameSpeed local t = UPDATE_RATE_S @@ -55,7 +54,7 @@ local colorZero0 = { 0, 0, 0, 0 } local colorGreenDark = { 0, 0.55, 0, 1 } local colorGreenBright = { 0, 1, 0, 1 } -local catchingUpText = Spring.I18N('ui.rejoin.catchingUp') +local catchingUpText = Spring.I18N("ui.rejoin.catchingUp") local lastGameTimeText = nil local cachedTitleText = nil @@ -68,8 +67,8 @@ end local function deleteGuiShaderDList() if dlistRejoinGuishader ~= nil then - if WG['guishader'] then - WG['guishader'].RemoveDlist('rejoinprogress') + if WG["guishader"] then + WG["guishader"].RemoveDlist("rejoinprogress") end gl.DeleteList(dlistRejoinGuishader) dlistRejoinGuishader = nil @@ -95,10 +94,10 @@ local function buildStaticRejoin() if not dlistRejoinGuishader then dlistRejoinGuishader = gl.CreateList(function() - RectRound(area[1], area[2], area[3], area[4], 5.5 * widgetScale, 0,0,1,1) + RectRound(area[1], area[2], area[3], area[4], 5.5 * widgetScale, 0, 0, 1, 1) end) - if WG['guishader'] then - WG['guishader'].InsertDlist(dlistRejoinGuishader, 'rejoinprogress') + if WG["guishader"] then + WG["guishader"].InsertDlist(dlistRejoinGuishader, "rejoinprogress") end end @@ -110,15 +109,15 @@ local function buildStaticRejoin() RectRound(barArea[1] - addedSize, barArea[2] - addedSize, barArea[3] + addedSize, barArea[4] + addedSize, barHeight * 0.33, 1, 1, 1, 1, colorDark20, colorLight16) gl.Texture(noiseBackgroundTexture) - gl.Color(1,1,1, 0.12) - TexturedRectRound(barArea[1] - addedSize - edgeWidth, barArea[2] - addedSize - edgeWidth, barArea[3] + addedSize + edgeWidth, barArea[4] + addedSize + edgeWidth, barHeight * 0.33, barWidth*0.6, 0) + gl.Color(1, 1, 1, 0.12) + TexturedRectRound(barArea[1] - addedSize - edgeWidth, barArea[2] - addedSize - edgeWidth, barArea[3] + addedSize + edgeWidth, barArea[4] + addedSize + edgeWidth, barHeight * 0.33, barWidth * 0.6, 0) gl.Texture(false) gl.Blending(GL.SRC_ALPHA, GL.ONE) RectRound(barArea[1] - addedSize, barArea[2] + addedSize, barArea[3] + addedSize, barArea[4] + addedSize, barHeight * 0.33, 1, 1, 0, 0, colorWhite0, colorWhite007) RectRound(barArea[1] - addedSize, barArea[2] - addedSize, barArea[3] + addedSize, barArea[2] + addedSize + addedSize + addedSize, barHeight * 0.2, 0, 0, 1, 1, colorWhite01, colorWhite0) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) end) end @@ -141,10 +140,10 @@ end local function updateRejoinText() local mins = mathFloor(serverFrame / 30 / 60) local secs = mathFloor(((serverFrame / 30 / 60) - mins) * 60) - local gametime = mins .. ':' .. (secs < 10 and '0' .. secs or secs) + local gametime = mins .. ":" .. (secs < 10 and "0" .. secs or secs) if gametime ~= lastGameTimeText then lastGameTimeText = gametime - cachedTitleText = '\255\225\255\225' .. catchingUpText .. ' \255\166\166\166' .. gametime + cachedTitleText = "\255\225\255\225" .. catchingUpText .. " \255\166\166\166" .. gametime end end @@ -162,12 +161,12 @@ local function drawRejoinDynamic() RectRound(barArea[1], barArea[2], barArea[1] + valueWidth, barArea[4], barHeight * 0.2, 1, 1, 1, 1, colorGreenDark, colorGreenBright) gl.Texture(stripesTexture) - gl.Color(1,1,1, 0.16) - TexturedRectRound(barArea[1], barArea[2], barArea[1] + valueWidth, barArea[4], barHeight * 0.2, 1, 1, 1, 1, stripesTexScale, - os.clock() * 0.06) + gl.Color(1, 1, 1, 0.16) + TexturedRectRound(barArea[1], barArea[2], barArea[1] + valueWidth, barArea[4], barHeight * 0.2, 1, 1, 1, 1, stripesTexScale, -os.clock() * 0.06) gl.Texture(noiseBackgroundTexture) - gl.Color(1,1,1, 0.07) - TexturedRectRound(barArea[1], barArea[2], barArea[1] + valueWidth, barArea[4], barHeight * 0.2, barWidth*0.6, 0) + gl.Color(1, 1, 1, 0.07) + TexturedRectRound(barArea[1], barArea[2], barArea[1] + valueWidth, barArea[4], barHeight * 0.2, barWidth * 0.6, 0) gl.Texture(false) gl.Blending(GL.SRC_ALPHA, GL.ONE) @@ -182,24 +181,23 @@ local function drawRejoinDynamic() DrawRect((barArea[1] + valueWidth) + (glowSize * 2), barArea[2] - glowSize, barArea[1] + valueWidth, barArea[4] + glowSize, 0.008) gl.Texture(false) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) font2:Begin() font2:SetTextColor(0.92, 0.92, 0.92, 1) font2:SetOutlineColor(0, 0, 0, 1) - font2:Print(cachedTitleText, rejoinArea[1] + ((rejoinArea[3] - rejoinArea[1]) / 2), rejoinArea[2] + barHeight * 2 + (fontsize*0.89), fontsize, 'cor') + font2:Print(cachedTitleText, rejoinArea[1] + ((rejoinArea[3] - rejoinArea[1]) / 2), rejoinArea[2] + barHeight * 2 + (fontsize * 0.89), fontsize, "cor") font2:End() end function widget:Update(dt) - -- rejoin if not isReplay and serverFrame then t = t - dt if t <= 0 then t = t + UPDATE_RATE_S - if Spring.IsGameOver() then -- not sure if widget:GameOver() even works so I do this here as well + if Spring.IsGameOver() then -- not sure if widget:GameOver() even works so I do this here as well widgetHandler:RemoveWidget() return end @@ -236,8 +234,8 @@ end function widget:ViewResize() vsx, vsy = gl.GetViewSizes() - width = mathFloor(vsy*0.23) - height = mathFloor(vsy*0.046) + width = mathFloor(vsy * 0.23) + height = mathFloor(vsy * 0.046) widgetScale = (vsy / height) * 0.0425 widgetScale = widgetScale * ui_scale @@ -245,9 +243,9 @@ function widget:ViewResize() TexturedRectRound = WG.FlowUI.Draw.TexturedRectRound UiElement = WG.FlowUI.Draw.Element - font2 = WG['fonts'].getFont(2) + font2 = WG["fonts"].getFont(2) - rejoinArea = { mathFloor(0.5*vsx)-mathFloor(width*0.5), mathFloor(posY*vsy)-mathFloor(height*0.5), mathFloor(0.5*vsx) + mathFloor(width*0.5), mathFloor(posY*vsy)+mathFloor(height*0.5) } + rejoinArea = { mathFloor(0.5 * vsx) - mathFloor(width * 0.5), mathFloor(posY * vsy) - mathFloor(height * 0.5), mathFloor(0.5 * vsx) + mathFloor(width * 0.5), mathFloor(posY * vsy) + mathFloor(height * 0.5) } updateGeometry() deleteStaticDList() deleteGuiShaderDList() @@ -259,7 +257,7 @@ function widget:ViewResize() end -- used for rejoin progress functionality -function widget:GameProgress(n) -- happens every 150 frames +function widget:GameProgress(n) -- happens every 150 frames serverFrame = n end @@ -272,15 +270,15 @@ function widget:GameStart() end function widget:RecvLuaMsg(msg, playerID) - if not serverFrame and msg:sub(1,12) == 'ServerFrame' then + if not serverFrame and msg:sub(1, 12) == "ServerFrame" then serverFrame = tonumber(msg:sub(13)) end end function widget:Initialize() widget:ViewResize() - WG['rejoin'] = {} - WG['rejoin'].showingRejoining = function() + WG["rejoin"] = {} + WG["rejoin"].showingRejoining = function() return showRejoinUI end end @@ -288,5 +286,5 @@ end function widget:Shutdown() deleteStaticDList() deleteGuiShaderDList() - WG['rejoin'] = nil + WG["rejoin"] = nil end diff --git a/luaui/Widgets/gui_replaybuttons.lua b/luaui/Widgets/gui_replaybuttons.lua index 3ffdfda32bd..a6fe0e9858e 100644 --- a/luaui/Widgets/gui_replaybuttons.lua +++ b/luaui/Widgets/gui_replaybuttons.lua @@ -14,7 +14,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor @@ -89,8 +88,8 @@ local function draw_buttons(b) font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 0.7) for i = 1, #b do - UiButton(mathFloor((b[i].x * vsx) + 0.5), mathFloor((b[i].y * vsy) + 0.5), mathFloor(((b[i].x + bWidth) * vsx) + 0.5), mathFloor(((b[i].y + bHeight) * vsy) + 0.5), 0,1,1,0, 1,1,1,1, nil, { 0, 0, 0, ui_opacity }, { 0.2, 0.2, 0.2, ui_opacity }, bgpadding * 0.5) - font:Print(b[i].text, mathFloor((b[i].x * vsx) + 0.5), mathFloor(((b[i].y + bHeight / 2) * vsy) + 0.5), mathFloor((0.0115 * vsx) + 0.5), 'vo') + UiButton(mathFloor((b[i].x * vsx) + 0.5), mathFloor((b[i].y * vsy) + 0.5), mathFloor(((b[i].x + bWidth) * vsx) + 0.5), mathFloor(((b[i].y + bHeight) * vsy) + 0.5), 0, 1, 1, 0, 1, 1, 1, 1, nil, { 0, 0, 0, ui_opacity }, { 0.2, 0.2, 0.2, ui_opacity }, bgpadding * 0.5) + font:Print(b[i].text, mathFloor((b[i].x * vsx) + 0.5), mathFloor(((b[i].y + bHeight / 2) * vsy) + 0.5), mathFloor((0.0115 * vsx) + 0.5), "vo") end font:End() end @@ -109,7 +108,7 @@ function widget:ViewResize() RectRound = WG.FlowUI.Draw.RectRound UiButton = WG.FlowUI.Draw.Button - font = WG['fonts'].getFont(2, 1.6) + font = WG["fonts"].getFont(2, 1.6) end function widget:Initialize() @@ -129,19 +128,17 @@ function widget:Initialize() end function widget:Shutdown() - if WG['guishader'] then - WG['guishader'].DeleteDlist('replaybuttons') + if WG["guishader"] then + WG["guishader"].DeleteDlist("replaybuttons") end gl.DeleteList(buttonsList) end - - function widget:DrawScreen() glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) if not isActive then - if WG['guishader'] and prevIsActive ~= isActive then - WG['guishader'].RemoveDlist('replaybuttons') + if WG["guishader"] and prevIsActive ~= isActive then + WG["guishader"].RemoveDlist("replaybuttons") end return end @@ -158,12 +155,12 @@ function widget:DrawScreen() gl.DeleteList(backgroundGuishader) end backgroundGuishader = gl.CreateList(function() - RectRound(mathFloor((wPos.x * vsx) + 0.5), mathFloor((wPos.y * vsy) + 0.5), mathFloor(((wPos.x + bWidth) * vsx) + 0.5), mathFloor(((wPos.y + dy) * vsy) + 0.5), elementCorner, 0, 1, 1, 0) + RectRound(mathFloor((wPos.x * vsx) + 0.5), mathFloor((wPos.y * vsy) + 0.5), mathFloor(((wPos.x + bWidth) * vsx) + 0.5), mathFloor(((wPos.y + dy) * vsy) + 0.5), elementCorner, 0, 1, 1, 0) end) end - - if WG['guishader'] and isActive and prevIsActive ~= isActive then - WG['guishader'].InsertDlist(backgroundGuishader, 'replaybuttons') + + if WG["guishader"] and isActive and prevIsActive ~= isActive then + WG["guishader"].InsertDlist(backgroundGuishader, "replaybuttons") end if buttonsList then @@ -171,20 +168,18 @@ function widget:DrawScreen() end local mousex, mousey, buttonstate = spGetMouseState() local b = buttons - local topbutton = #buttons-1 + local topbutton = #buttons - 1 font:Begin() font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 0.7) if point_in_rect(b[#buttons].x, b[#buttons].y, b[topbutton].x + bWidth, b[topbutton].y + bHeight, mousex / vsx, mousey / vsy) then - for i = 1, #b do if point_in_rect(b[i].x, b[i].y, b[i].x + bWidth, b[i].y + bHeight, mousex / vsx, mousey / vsy) or i == active_button then - glBlending(GL_SRC_ALPHA, GL_ONE) - RectRound(mathFloor((b[i].x * vsx) + 0.5), mathFloor((b[i].y * vsy) + 0.5), mathFloor(((b[i].x + bWidth) * vsx) + 0.5), mathFloor(((b[i].y + bHeight) * vsy) + 0.5), bgpadding * 0.5, 0,1,1,0, { 0.3, 0.3, 0.3, buttonstate and 0.25 or 0.15 }, { 1, 1, 1, buttonstate and 0.25 or 0.15 }) + RectRound(mathFloor((b[i].x * vsx) + 0.5), mathFloor((b[i].y * vsy) + 0.5), mathFloor(((b[i].x + bWidth) * vsx) + 0.5), mathFloor(((b[i].y + bHeight) * vsy) + 0.5), bgpadding * 0.5, 0, 1, 1, 0, { 0.3, 0.3, 0.3, buttonstate and 0.25 or 0.15 }, { 1, 1, 1, buttonstate and 0.25 or 0.15 }) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - font:Print(b[i].text, mathFloor((b[i].x * vsx) + 0.5), mathFloor(((b[i].y + bHeight / 2) * vsy) + 0.5), mathFloor((0.0115 * vsx) + 0.5), 'vo') + font:Print(b[i].text, mathFloor((b[i].x * vsx) + 0.5), mathFloor(((b[i].y + bHeight / 2) * vsy) + 0.5), mathFloor((0.0115 * vsx) + 0.5), "vo") break end end @@ -201,19 +196,19 @@ function widget:MousePress(x, y, button) if cb == "playpauseskip" then if spGetGameFrame() > 1 then isPaused = not isPaused - Spring.SendCommands('pause '..(isPaused and '1' or '0')) - buttons[i].text = (isPaused and ' >>' or ' ||') + Spring.SendCommands("pause " .. (isPaused and "1" or "0")) + buttons[i].text = (isPaused and " >>" or " ||") else Spring.SendCommands("skip 1") buttons[i].text = " ||" end sceduleUpdate = true return true - elseif cb ~= "NOBUTTONCLICKED" then - setReplaySpeed(speeds[i]) - sceduleUpdate = true - return true - end + elseif cb ~= "NOBUTTONCLICKED" then + setReplaySpeed(speeds[i]) + sceduleUpdate = true + return true + end end function widget:Update(dt) diff --git a/luaui/Widgets/gui_restart_with_state.lua b/luaui/Widgets/gui_restart_with_state.lua index ab3d81ddce2..cd181c9d7c9 100644 --- a/luaui/Widgets/gui_restart_with_state.lua +++ b/luaui/Widgets/gui_restart_with_state.lua @@ -1,18 +1,20 @@ -- Superseded: all logic moved into gui_options.lua (guaranteed-loaded, has startScript). -- This file is kept as a stub so existing widget handler state doesn't break. -do return end +do + return +end local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Restart With State IO", - desc = "Writes/reads the restart-with-state save file on behalf of the gadget (io is unavailable in LuaRules)", - author = "Copilot", - date = "2026", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Restart With State IO", + desc = "Writes/reads the restart-with-state save file on behalf of the gadget (io is unavailable in LuaRules)", + author = "Copilot", + date = "2026", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -35,7 +37,9 @@ function widget:RecvLuaMsg(msg, _playerID) end if msg == "rws:commit" then - if not recvBuffer then return true end + if not recvBuffer then + return true + end local data = table.concat(recvBuffer) recvBuffer = nil @@ -62,8 +66,9 @@ function widget:RecvLuaMsg(msg, _playerID) -- Truncate to empty; VFS.LoadFile returns "" for an empty file, which the -- gadget's Initialize now skips gracefully. local f = io.open(STATE_FILE, "w") - if f then f:close() end + if f then + f:close() + end return true end end - diff --git a/luaui/Widgets/gui_resurrection_halos_gl4.lua b/luaui/Widgets/gui_resurrection_halos_gl4.lua index 7f2e2245a02..83585ff15e0 100644 --- a/luaui/Widgets/gui_resurrection_halos_gl4.lua +++ b/luaui/Widgets/gui_resurrection_halos_gl4.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Resurrection Halos GL4", - desc = "Gives units have have been resurrected a little halo above it", - author = "Beherith", - date = "2022.03.05", - license = "GNU GPL, v2 or later", - layer = -50, - enabled = true - } + return { + name = "Resurrection Halos GL4", + desc = "Gives units have have been resurrected a little halo above it", + author = "Beherith", + date = "2022.03.05", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true, + } end local resurrectionHalosVBO = nil @@ -19,29 +19,29 @@ local luaShaderDir = "LuaUI/Include/" local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance -local texture = 'LuaUI/Images/halo.dds' +local texture = "LuaUI/Images/halo.dds" local chobbyInterface local OPTIONS = { - haloSize = 0.8, - haloDistance = 2.0, - skipBuildings = true, + haloSize = 0.8, + haloDistance = 2.0, + skipBuildings = true, } local unitConf = {} for unitDefID, unitDef in pairs(UnitDefs) do - if not OPTIONS.skipBuildings or (OPTIONS.skipBuildings and not (unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0)) then + if not OPTIONS.skipBuildings or (OPTIONS.skipBuildings and not (unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0)) then local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 3*( xsize*xsize + zsize*zsize )^0.5 - unitConf[unitDefID] = {scale=scale, iconSize=scale*OPTIONS.haloSize, height=math.ceil((unitDef.height+(OPTIONS.haloDistance * (scale/7))))} + local scale = 3 * (xsize * xsize + zsize * zsize) ^ 0.5 + unitConf[unitDefID] = { scale = scale, iconSize = scale * OPTIONS.haloSize, height = math.ceil((unitDef.height + (OPTIONS.haloDistance * (scale / 7)))) } end end local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.TRANSPARENCY = 0.5 @@ -55,28 +55,41 @@ local function initGL4() shaderConfig.POST_SHADING = "fragColor.rgba = texcolor;" resurrectionHalosVBO, resurrectionHalosShader = InitDrawPrimitiveAtUnit(shaderConfig, "ResurrectionHalos") - if resurrectionHalosVBO == nil then + if resurrectionHalosVBO == nil then widgetHandler:RemoveWidget() return false end return true end - function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) local rezRulesParam = Spring.GetUnitRulesParam(unitID, "resurrected") - if unitConf[unitDefID] == nil or not rezRulesParam or rezRulesParam == 0 then return end + if unitConf[unitDefID] == nil or not rezRulesParam or rezRulesParam == 0 then + return + end local gf = Spring.GetGameFrame() pushElementInstance( resurrectionHalosVBO, -- push into this Instance VBO Table { - unitConf[unitDefID].iconSize, unitConf[unitDefID].iconSize, 8, unitConf[unitDefID].height , -- lengthwidthcornerheight + unitConf[unitDefID].iconSize, + unitConf[unitDefID].iconSize, + 8, + unitConf[unitDefID].height, -- lengthwidthcornerheight 0, -- teamID 4, -- how many trianges should we make (2 = cornerrect) - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -100,13 +113,15 @@ function widget:VisibleUnitRemoved(unitID) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorld() - if chobbyInterface then return end + if chobbyInterface then + return + end if Spring.IsGUIHidden() then return end @@ -129,10 +144,12 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not initGL4() then return end + if not initGL4() then + return + end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID) end diff --git a/luaui/Widgets/gui_savegame.lua b/luaui/Widgets/gui_savegame.lua index 640a91ba87f..b641be29ad8 100644 --- a/luaui/Widgets/gui_savegame.lua +++ b/luaui/Widgets/gui_savegame.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021", license = "GNU GPL, v2 or later", layer = -9999, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor @@ -26,19 +25,18 @@ local LOAD_GAME_STRING = "loadFilename " local SAVE_TYPE = "save " local function WriteDate(dateTable) - return string.format("%02d/%02d/%04d", dateTable.day, dateTable.month, dateTable.year) - .. " " .. string.format("%02d:%02d:%02d", dateTable.hour, dateTable.min, dateTable.sec) + return string.format("%02d/%02d/%04d", dateTable.day, dateTable.month, dateTable.year) .. " " .. string.format("%02d:%02d:%02d", dateTable.hour, dateTable.min, dateTable.sec) end local function SecondsToClock(seconds) local seconds = tonumber(seconds) if seconds <= 0 then - return "00:00"; + return "00:00" else - hours = string.format("%02d", mathFloor(seconds / 3600)); - mins = string.format("%02d", mathFloor(seconds / 60 - (hours * 60))); - secs = string.format("%02d", mathFloor(seconds - hours * 3600 - mins * 60)); + hours = string.format("%02d", mathFloor(seconds / 3600)) + mins = string.format("%02d", mathFloor(seconds / 60 - (hours * 60))) + secs = string.format("%02d", mathFloor(seconds - hours * 3600 - mins * 60)) if seconds >= 3600 then return hours .. ":" .. mins .. ":" .. secs else @@ -48,7 +46,7 @@ local function SecondsToClock(seconds) end local function trim(str) - return str:match '^()%s*$' and '' or str:match '^%s*(.*%S)' + return str:match("^()%s*$") and "" or str:match("^%s*(.*%S)") end -------------------------------------------------------------------------------- @@ -73,11 +71,11 @@ local function GetSave(path) local ret = nil local success, err = pcall(function() local saveData = VFS.Include(path) - saveData.filename = string.sub(path, SAVE_DIR_LENGTH, -5) -- pure filename without directory or extension + saveData.filename = string.sub(path, SAVE_DIR_LENGTH, -5) -- pure filename without directory or extension saveData.path = path ret = saveData end) - if (not success) then + if not success then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Error getting save " .. path .. ": " .. err) else local engineSaveFilename = GetSaveWithExtension(string.sub(path, 1, -5)) @@ -94,11 +92,7 @@ local function GetSaveDescText(saveFile) if not saveFile then return "" end - return (saveFile.description or "no description") - .. "\n" .. saveFile.gameName .. " " .. saveFile.gameVersion - .. "\n" .. saveFile.map - .. "\n" .. (WG.Translate("interface", "time_ingame") or "Ingame time") .. ": " .. SecondsToClock((saveFile.totalGameframe or saveFile.gameframe or 0) / 30) - .. "\n" .. WriteDate(saveFile.date) + return (saveFile.description or "no description") .. "\n" .. saveFile.gameName .. " " .. saveFile.gameVersion .. "\n" .. saveFile.map .. "\n" .. (WG.Translate("interface", "time_ingame") or "Ingame time") .. ": " .. SecondsToClock((saveFile.totalGameframe or saveFile.gameframe or 0) / 30) .. "\n" .. WriteDate(saveFile.date) end local function FindFirstEmptySaveSlot() @@ -128,61 +122,58 @@ local function SaveGame(filename, description, requireOverwrite) if WG.Analytics and WG.Analytics.SendRepeatEvent then WG.Analytics.SendRepeatEvent("game_start:savegame", filename) end - local success, err = pcall( - function() - Spring.CreateDir(SAVE_DIR) - filename = (filename and trim(filename)) or ("save" .. string.format("%03d", FindFirstEmptySaveSlot())) - path = SAVE_DIR .. "/" .. filename .. ".lua" - local saveData = {} - --saveData.filename = filename - saveData.date = os.date('*t') - saveData.description = description or "No description" - saveData.gameName = Game.gameName - saveData.gameVersion = Game.gameVersion - saveData.engineVersion = Engine.version - saveData.map = Game.mapName - saveData.gameID = (Spring.GetGameRulesParam("save_gameID") or (Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID"))) - saveData.gameframe = spGetGameFrame() - saveData.totalGameframe = spGetGameFrame() + (Spring.GetGameRulesParam("totalSaveGameFrame") or 0) - saveData.playerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) - table.save(saveData, path) - - -- TODO: back up existing save? - --if VFS.FileExists(SAVE_DIR .. "/" .. filename) then - --end - - if requireOverwrite then - Spring.SendCommands(SAVE_TYPE .. filename .. " -y") - else - Spring.SendCommands(SAVE_TYPE .. filename) - end - Spring.Log(widget:GetInfo().name, LOG.INFO, "Saved game to " .. path) - - --DisposeWindow() + local success, err = pcall(function() + Spring.CreateDir(SAVE_DIR) + filename = (filename and trim(filename)) or ("save" .. string.format("%03d", FindFirstEmptySaveSlot())) + path = SAVE_DIR .. "/" .. filename .. ".lua" + local saveData = {} + --saveData.filename = filename + saveData.date = os.date("*t") + saveData.description = description or "No description" + saveData.gameName = Game.gameName + saveData.gameVersion = Game.gameVersion + saveData.engineVersion = Engine.version + saveData.map = Game.mapName + saveData.gameID = (Spring.GetGameRulesParam("save_gameID") or (Game.gameID and Game.gameID or Spring.GetGameRulesParam("GameID"))) + saveData.gameframe = spGetGameFrame() + saveData.totalGameframe = spGetGameFrame() + (Spring.GetGameRulesParam("totalSaveGameFrame") or 0) + saveData.playerName = Spring.GetPlayerInfo(Spring.GetMyPlayerID(), false) + table.save(saveData, path) + + -- TODO: back up existing save? + --if VFS.FileExists(SAVE_DIR .. "/" .. filename) then + --end + + if requireOverwrite then + Spring.SendCommands(SAVE_TYPE .. filename .. " -y") + else + Spring.SendCommands(SAVE_TYPE .. filename) end - ) - if (not success) then + Spring.Log(widget:GetInfo().name, LOG.INFO, "Saved game to " .. path) + + --DisposeWindow() + end) + if not success then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Error saving game: " .. err) end end local function LoadGameByFilename(filename) - local saveData = GetSave(SAVE_DIR .. '/' .. filename .. ".lua") + local saveData = GetSave(SAVE_DIR .. "/" .. filename .. ".lua") if saveData then if Spring.GetMenuName and Spring.SendLuaMenuMsg and Spring.GetMenuName() then Spring.SendLuaMenuMsg(LOAD_GAME_STRING .. filename) else - local ext = GetSaveExtension(SAVE_DIR .. '/' .. filename) + local ext = GetSaveExtension(SAVE_DIR .. "/" .. filename) if not ext then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Error loading game: cannot find save file.") return end - local success, err = pcall( - function() - -- This should perhaps be handled in chobby first? - --Spring.Log(widget:GetInfo().name, LOG.INFO, "Save file " .. path .. " loaded") + local success, err = pcall(function() + -- This should perhaps be handled in chobby first? + --Spring.Log(widget:GetInfo().name, LOG.INFO, "Save file " .. path .. " loaded") - local script = [[ + local script = [[ [GAME] { SaveFile=__FILE__; @@ -191,12 +182,11 @@ local function LoadGameByFilename(filename) MyPlayerName=__PLAYERNAME__; } ]] - script = script:gsub("__FILE__", filename .. ext) - script = script:gsub("__PLAYERNAME__", saveData.playerName) - Spring.Reload(script) - end - ) - if (not success) then + script = script:gsub("__FILE__", filename .. ext) + script = script:gsub("__PLAYERNAME__", saveData.playerName) + Spring.Reload(script) + end) + if not success then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Error loading game: " .. err) end end @@ -220,7 +210,7 @@ local function DeleteSave(filename) os.remove(saveFilePath) end end) - if (not success) then + if not success then Spring.Log(widget:GetInfo().name, LOG.ERROR, "Error deleting save " .. filename .. ": " .. err) end end @@ -230,18 +220,18 @@ local function savegameCmd(_, _, params) local savefilename = params[1] SaveGame(savefilename, savefilename, true) - if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil then + if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") ~= nil then Spring.SendLuaMenuMsg("gameSaved") end end function widget:Initialize() - WG['savegame'] = {} - widgetHandler:AddAction("savegame", savegameCmd, nil, 't') + WG["savegame"] = {} + widgetHandler:AddAction("savegame", savegameCmd, nil, "t") end function widget:Shutdown() - WG['savegame'] = nil + WG["savegame"] = nil widgetHandler:RemoveAction("savegame") end @@ -263,4 +253,5 @@ function widget:GameFrame(n) SaveGame("autosave", "", true) end end -]]-- +]] +-- diff --git a/luaui/Widgets/gui_scavStatsPanel.lua b/luaui/Widgets/gui_scavStatsPanel.lua index e0ed38d9248..6dc0a1c5fc1 100644 --- a/luaui/Widgets/gui_scavStatsPanel.lua +++ b/luaui/Widgets/gui_scavStatsPanel.lua @@ -12,11 +12,10 @@ function widget:GetInfo() date = "May 04, 2008", license = "GNU GPL, v2 or later", layer = -9, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathAbs = math.abs local mathCeil = math.ceil @@ -26,7 +25,7 @@ local mathMin = math.min -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local config = VFS.Include('LuaRules/Configs/scav_spawn_defs.lua') +local config = VFS.Include("LuaRules/Configs/scav_spawn_defs.lua") local customScale = 1 local widgetScale = customScale @@ -102,7 +101,7 @@ local function commaValue(amount) local formatted = amount local k while true do - formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') + formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", "%1,%2") if k == 0 then break end @@ -142,16 +141,15 @@ local function CreatePanelDisplayList() local currentTime = GetGameSeconds() if currentTime > gameInfo.scavGracePeriod then if gameInfo.scavBossAnger < 100 then - local gain = 0 if Spring.GetGameRulesParam("ScavBossAngerGain_Base") then - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerBase', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) }), panelMarginX+5, PanelRow(3), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerAggression', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) }), panelMarginX+5, PanelRow(4), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossAngerBase", { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) }), panelMarginX + 5, PanelRow(3), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossAngerAggression", { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) }), panelMarginX + 5, PanelRow(4), panelFontSize, "") --font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerEco', { value = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Eco"), 3) }), panelMarginX+5, PanelRow(5), panelFontSize, "") gain = math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Base"), 3) + math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Aggression"), 3) + math.round(Spring.GetGameRulesParam("ScavBossAngerGain_Eco"), 3) end --font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerWithGain', { anger = gameInfo.scavBossAnger, gain = math.round(gain, 3) }), panelMarginX, PanelRow(1), panelFontSize, "") - font:Print(textColor .. Spring.I18N('ui.scavs.bossAngerWithTech', { anger = mathFloor(0.5+gameInfo.scavBossAnger), techAnger = gameInfo.scavTechAnger}), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossAngerWithTech", { anger = mathFloor(0.5 + gameInfo.scavBossAnger), techAnger = gameInfo.scavTechAnger }), panelMarginX, PanelRow(1), panelFontSize, "") local totalSeconds = ((100 - gameInfo.scavBossAnger) / gain) if currentTime <= gameInfo.scavGracePeriod then @@ -159,43 +157,45 @@ local function CreatePanelDisplayList() end time = string.formatTime(totalSeconds) if totalSeconds < 1800 or revealedBossEta then - if not revealedBossEta then revealedBossEta = true end - font:Print(textColor .. Spring.I18N('ui.scavs.bossETA', { count = nBosses, time = time }), panelMarginX+5, PanelRow(2), panelFontSize, "") + if not revealedBossEta then + revealedBossEta = true + end + font:Print(textColor .. Spring.I18N("ui.scavs.bossETA", { count = nBosses, time = time }), panelMarginX + 5, PanelRow(2), panelFontSize, "") end if #currentlyResistantToNames > 0 then currentlyResistantToNames = {} currentlyResistantTo = {} end else - font:Print(textColor .. Spring.I18N('ui.scavs.bossHealth', { count = nBosses, health = gameInfo.scavBossHealth }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossHealth", { count = nBosses, health = gameInfo.scavBossHealth }), panelMarginX, PanelRow(1), panelFontSize, "") if Spring.GetGameRulesParam("scavBossStaggerActive") == false then - font:Print(textColor .. Spring.I18N('ui.scavs.bossStaggerPercentage', {count = nBosses, value = 100-Spring.GetGameRulesParam("scavBossStaggerPercentage") }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossStaggerPercentage", { count = nBosses, value = 100 - Spring.GetGameRulesParam("scavBossStaggerPercentage") }), panelMarginX, PanelRow(2), panelFontSize, "") else - font:Print("\255\255\255\0" .. Spring.I18N('ui.scavs.bossStaggerActive', {count = nBosses}), panelMarginX, PanelRow(2), panelFontSize, "") - font:Print("\255\255\255\0" .. Spring.I18N('ui.scavs.bossStaggerPercentage', {count = nBosses, value = 100-Spring.GetGameRulesParam("scavBossStaggerPercentage") }), panelMarginX, PanelRow(3), panelFontSize, "") + font:Print("\255\255\255\0" .. Spring.I18N("ui.scavs.bossStaggerActive", { count = nBosses }), panelMarginX, PanelRow(2), panelFontSize, "") + font:Print("\255\255\255\0" .. Spring.I18N("ui.scavs.bossStaggerPercentage", { count = nBosses, value = 100 - Spring.GetGameRulesParam("scavBossStaggerPercentage") }), panelMarginX, PanelRow(3), panelFontSize, "") end if nBosses > 1 then - font:Print(textColor .. Spring.I18N('ui.scavs.bossesKilled', { nKilled = gameInfo.scavBossesKilled, nTotal = nBosses }), panelMarginX, PanelRow(4), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossesKilled", { nKilled = gameInfo.scavBossesKilled, nTotal = nBosses }), panelMarginX, PanelRow(4), panelFontSize, "") end - for i = 1,#currentlyResistantToNames do + for i = 1, #currentlyResistantToNames do if i == 1 then - font:Print(textColor .. Spring.I18N('ui.scavs.bossResistantToList', { count = nBosses}), panelMarginX, PanelRow(12), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.bossResistantToList", { count = nBosses }), panelMarginX, PanelRow(12), panelFontSize, "") end - font:Print(textColor .. currentlyResistantToNames[i], panelMarginX+20, PanelRow(12+i), panelFontSize, "") + font:Print(textColor .. currentlyResistantToNames[i], panelMarginX + 20, PanelRow(12 + i), panelFontSize, "") end end else - font:Print(textColor .. Spring.I18N('ui.scavs.gracePeriod', { time = string.formatTime(mathCeil(((currentTime - gameInfo.scavGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") + font:Print(textColor .. Spring.I18N("ui.scavs.gracePeriod", { time = string.formatTime(mathCeil(((currentTime - gameInfo.scavGracePeriod) * -1) - 0.5)) }), panelMarginX, PanelRow(1), panelFontSize, "") end -- font:Print(textColor .. Spring.I18N('ui.scavs.scavKillCount', { count = gameInfo.scavKills }), panelMarginX, PanelRow(6), panelFontSize, "") local endless = "" if Spring.GetModOptions().scav_endless then - endless = ' (' .. Spring.I18N('ui.scavs.difficulty.endless') .. ')' + endless = " (" .. Spring.I18N("ui.scavs.difficulty.endless") .. ")" end - local difficultyCaption = Spring.I18N('ui.scavs.difficulty.' .. difficultyOption) - font:Print(textColor .. Spring.I18N('ui.scavs.mode', { mode = difficultyCaption }) .. endless, panelMarginX, h - 195, panelFontSize, "") + local difficultyCaption = Spring.I18N("ui.scavs.difficulty." .. difficultyOption) + font:Print(textColor .. Spring.I18N("ui.scavs.mode", { mode = difficultyCaption }) .. endless, panelMarginX, h - 195, panelFontSize, "") font:End() gl.Texture(false) @@ -205,18 +205,18 @@ end local function getMarqueeMessage(scavEventArgs) local messages = {} if scavEventArgs.type == "firstWave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.firstWave1') - messages[2] = textColor .. Spring.I18N('ui.scavs.firstWave2') + messages[1] = textColor .. Spring.I18N("ui.scavs.firstWave1") + messages[2] = textColor .. Spring.I18N("ui.scavs.firstWave2") elseif scavEventArgs.type == "boss" then - messages[1] = textColor .. Spring.I18N('ui.scavs.bossIsAngry1', { count = nBosses }) - messages[2] = textColor .. Spring.I18N('ui.scavs.bossIsAngry2') + messages[1] = textColor .. Spring.I18N("ui.scavs.bossIsAngry1", { count = nBosses }) + messages[2] = textColor .. Spring.I18N("ui.scavs.bossIsAngry2") elseif scavEventArgs.type == "airWave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.scavs.airWave1') - messages[3] = textColor .. Spring.I18N('ui.scavs.airWave2', {unitCount = scavEventArgs.number}) + messages[1] = textColor .. Spring.I18N("ui.scavs.wave1", { waveNumber = scavEventArgs.waveCount }) + messages[2] = textColor .. Spring.I18N("ui.scavs.airWave1") + messages[3] = textColor .. Spring.I18N("ui.scavs.airWave2", { unitCount = scavEventArgs.number }) elseif scavEventArgs.type == "wave" then - messages[1] = textColor .. Spring.I18N('ui.scavs.wave1', {waveNumber = scavEventArgs.waveCount}) - messages[2] = textColor .. Spring.I18N('ui.scavs.wave2', {unitCount = scavEventArgs.number}) + messages[1] = textColor .. Spring.I18N("ui.scavs.wave1", { waveNumber = scavEventArgs.waveCount }) + messages[2] = textColor .. Spring.I18N("ui.scavs.wave2", { unitCount = scavEventArgs.number }) end refreshMarqueeMessage = false @@ -226,29 +226,28 @@ end local function getResistancesMessage() local messages = {} - messages[1] = textColor .. (Spring.I18N('ui.scavs.resistanceUnits', { count = nBosses })) - for i = 1,#resistancesTable do + messages[1] = textColor .. (Spring.I18N("ui.scavs.resistanceUnits", { count = nBosses })) + for i = 1, #resistancesTable do local attackerName = UnitDefs[resistancesTable[i]].name - if string.sub(attackerName, -5,-1) == "_scav" then + if string.sub(attackerName, -5, -1) == "_scav" then local attackerNameNonScav = string.sub(attackerName, 1, -6) if UnitDefNames[attackerNameNonScav].customParams.i18nfromunit then attackerNameNonScav = UnitDefNames[attackerNameNonScav].customParams.i18nfromunit end - messages[i+1] = textColor .. "Scav " .. Spring.I18N('units.names.' .. attackerNameNonScav) - currentlyResistantToNames[#currentlyResistantToNames+1] = "Scav " .. Spring.I18N('units.names.' .. attackerNameNonScav) + messages[i + 1] = textColor .. "Scav " .. Spring.I18N("units.names." .. attackerNameNonScav) + currentlyResistantToNames[#currentlyResistantToNames + 1] = "Scav " .. Spring.I18N("units.names." .. attackerNameNonScav) else if UnitDefNames[attackerName].customParams.i18nfromunit then attackerName = UnitDefNames[attackerName].customParams.i18nfromunit end - messages[i+1] = textColor .. Spring.I18N('units.names.' .. attackerName) - currentlyResistantToNames[#currentlyResistantToNames+1] = Spring.I18N('units.names.' .. attackerName) + messages[i + 1] = textColor .. Spring.I18N("units.names." .. attackerName) + currentlyResistantToNames[#currentlyResistantToNames + 1] = Spring.I18N("units.names." .. attackerName) end end resistancesTable = {} refreshMarqueeMessage = false - return messages end @@ -258,8 +257,8 @@ local function Draw() end if updatePanel then - if (guiPanel) then - gl.DeleteList(guiPanel); + if guiPanel then + gl.DeleteList(guiPanel) guiPanel = nil end guiPanel = gl.CreateList(CreatePanelDisplayList) @@ -304,8 +303,8 @@ local function UpdateRules() for _, rule in ipairs(rules) do gameInfo[rule] = Spring.GetGameRulesParam(rule) or 0 end - gameInfo.scavCounts = getScavCounts('Count') - gameInfo.scavKills = getScavCounts('Kills') + gameInfo.scavCounts = getScavCounts("Count") + gameInfo.scavKills = getScavCounts("Kills") updatePanel = true end @@ -373,7 +372,7 @@ function widget:Shutdown() end if guiPanel then - gl.DeleteList(guiPanel); + gl.DeleteList(guiPanel) guiPanel = nil end @@ -405,8 +404,6 @@ function widget:GameFrame(n) end end - - function widget:DrawScreen() Draw() end @@ -418,10 +415,7 @@ function widget:MouseMove(x, y, dx, dy, button) end function widget:MousePress(x, y, button) - if enabled and - x > x1 and x < x1 + (w * widgetScale) and - y > y1 and y < y1 + (h * widgetScale) - then + if enabled and x > x1 and x < x1 + (w * widgetScale) and y > y1 and y < y1 + (h * widgetScale) then capture = true moving = true end @@ -440,8 +434,8 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) x1 = mathFloor(x1 - viewSizeX) y1 = mathFloor(y1 - viewSizeY) diff --git a/luaui/Widgets/gui_scavenger_info.lua b/luaui/Widgets/gui_scavenger_info.lua index 531f23441d2..d63992fec54 100644 --- a/luaui/Widgets/gui_scavenger_info.lua +++ b/luaui/Widgets/gui_scavenger_info.lua @@ -8,17 +8,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Scavenger Info", - desc = "", - author = "Floris", - date = "Jan 2020", + name = "Scavenger Info", + desc = "", + author = "Floris", + date = "Jan 2020", license = "GNU GPL, v2 or later", - layer = -99990, + layer = -99990, enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -26,9 +25,9 @@ local mathMax = math.max -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local show = true -- gets disabled when it has been loaded before +local show = true -- gets disabled when it has been loaded before -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local textFile = VFS.LoadFile("gamedata/scavengers/infotext.txt") @@ -43,8 +42,8 @@ local startLine = 1 local customScale = 1 local centerPosX = 0.5 local centerPosY = 0.5 -local screenX = (vsx*centerPosX) - (screenWidth/2) -local screenY = (vsy*centerPosY) + (screenHeight/2) +local screenX = (vsx * centerPosX) - (screenWidth / 2) +local screenY = (vsy * centerPosY) + (screenHeight / 2) local math_isInRect = math.isInRect @@ -59,65 +58,59 @@ local totalTextLines = 0 local maxLines = 20 -local showOnceMore = false -- used because of GUI shader delay +local showOnceMore = false -- used because of GUI shader delay local font, font2, loadedFontSize, titleRect, backgroundGuishader, textList, dlistcreated local RectRound, UiElement, UiScroller, elementCorner function widget:ViewResize() - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() widgetScale = ((vsx + vsy) / 2000) * 0.65 * customScale - widgetScale = widgetScale * (1 - (0.11 * ((vsx / vsy) - 1.78))) -- make smaller for ultrawide screens + widgetScale = widgetScale * (1 - (0.11 * ((vsx / vsy) - 1.78))) -- make smaller for ultrawide screens screenHeight = mathFloor(screenHeightOrg * widgetScale) screenWidth = mathFloor(screenWidthOrg * widgetScale) screenX = mathFloor((vsx * centerPosX) - (screenWidth / 2)) screenY = mathFloor((vsy * centerPosY) + (screenHeight / 2)) - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner RectRound = WG.FlowUI.Draw.RectRound UiElement = WG.FlowUI.Draw.Element UiScroller = WG.FlowUI.Draw.Scroller - if textList then gl.DeleteList(textList) end + if textList then + gl.DeleteList(textList) + end textList = gl.CreateList(DrawWindow) end +function DrawTextarea(x, y, width, height, scrollbar) + local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top + local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom + local scrollbarMargin = 10 * widgetScale + local scrollbarWidth = 8 * widgetScale + local scrollbarPosWidth = 4 * widgetScale -function DrawTextarea(x,y,width,height,scrollbar) - local scrollbarOffsetTop = 0 -- note: wont add the offset to the bottom, only to top - local scrollbarOffsetBottom = 0 -- note: wont add the offset to the top, only to bottom - local scrollbarMargin = 10 * widgetScale - local scrollbarWidth = 8 * widgetScale - local scrollbarPosWidth = 4 * widgetScale - - local fontSizeTitle = 18 * widgetScale - local fontSizeLine = 16 * widgetScale - local lineSeparator = 2 * widgetScale + local fontSizeTitle = 18 * widgetScale + local fontSizeLine = 16 * widgetScale + local lineSeparator = 2 * widgetScale - local fontColorTitle = {1,1,1,1} - local fontColorLine = {0.8,0.77,0.74,1} + local fontColorTitle = { 1, 1, 1, 1 } + local fontColorLine = { 0.8, 0.77, 0.74, 1 } maxLines = mathFloor(height / (lineSeparator + fontSizeTitle)) -- textarea scrollbar if scrollbar then - if (totalTextLines > maxLines or startLine > 1) then -- only show scroll above X lines - local scrollbarTop = y-scrollbarOffsetTop-scrollbarMargin-(scrollbarWidth-scrollbarPosWidth) - local scrollbarBottom = y-scrollbarOffsetBottom-height+scrollbarMargin+(scrollbarWidth-scrollbarPosWidth) - - UiScroller( - mathFloor(x + width - scrollbarMargin - scrollbarWidth), - mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), - mathFloor(x + width - scrollbarMargin), - mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), - (#textLines) * (lineSeparator + fontSizeTitle), - (startLine-1) * (lineSeparator + fontSizeTitle) - ) + if totalTextLines > maxLines or startLine > 1 then -- only show scroll above X lines + local scrollbarTop = y - scrollbarOffsetTop - scrollbarMargin - (scrollbarWidth - scrollbarPosWidth) + local scrollbarBottom = y - scrollbarOffsetBottom - height + scrollbarMargin + (scrollbarWidth - scrollbarPosWidth) + + UiScroller(mathFloor(x + width - scrollbarMargin - scrollbarWidth), mathFloor(scrollbarBottom - (scrollbarWidth - scrollbarPosWidth)), mathFloor(x + width - scrollbarMargin), mathFloor(scrollbarTop + (scrollbarWidth - scrollbarPosWidth)), #textLines * (lineSeparator + fontSizeTitle), (startLine - 1) * (lineSeparator + fontSizeTitle)) end end @@ -126,7 +119,7 @@ function DrawTextarea(x,y,width,height,scrollbar) font:Begin() local lineKey = startLine local j = 1 - while j < maxLines+1 do + while j < maxLines + 1 do -- maxlines is not exact, just a failsafe if (lineSeparator + fontSizeTitle) * j > height then break @@ -137,18 +130,17 @@ function DrawTextarea(x,y,width,height,scrollbar) local line = textLines[lineKey] local numLines - if string.find(line, '^[A-Z][A-Z]') then + if string.find(line, "^[A-Z][A-Z]") then font:SetTextColor(fontColorTitle) - font:Print(line, x-(9 * widgetScale), y-(lineSeparator+fontSizeTitle)*j, fontSizeTitle, "n") - + font:Print(line, x - (9 * widgetScale), y - (lineSeparator + fontSizeTitle) * j, fontSizeTitle, "n") else font:SetTextColor(fontColorLine) -- line - line, numLines = font:WrapText(line, (width-(50 * widgetScale))*(loadedFontSize/fontSizeLine)) - if (lineSeparator+fontSizeTitle) * (j+numLines-1) > height then + line, numLines = font:WrapText(line, (width - (50 * widgetScale)) * (loadedFontSize / fontSizeLine)) + if (lineSeparator + fontSizeTitle) * (j + numLines - 1) > height then break end - font:Print(line, x, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + font:Print(line, x, y - (lineSeparator + fontSizeTitle) * j, fontSizeLine, "n") j = j + (numLines - 1) end @@ -159,15 +151,14 @@ function DrawTextarea(x,y,width,height,scrollbar) end end - function DrawWindow() -- background - UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(screenX, screenY - screenHeight, screenX + screenWidth, screenY, 0, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) -- title background - local title = Spring.I18N('ui.topbar.button.scavengers') + local title = Spring.I18N("ui.topbar.button.scavengers") local titleFontSize = 18 * widgetScale - titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(screenY + (titleFontSize*1.7)) } + titleRect = { screenX, screenY, mathFloor(screenX + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize * 1.5)), mathFloor(screenY + (titleFontSize * 1.7)) } gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) @@ -176,28 +167,26 @@ function DrawWindow() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - font2:Print(title, screenX + (titleFontSize * 0.75), screenY + (8*widgetScale), titleFontSize, "on") + font2:Print(title, screenX + (titleFontSize * 0.75), screenY + (8 * widgetScale), titleFontSize, "on") font2:End() -- textarea - DrawTextarea(screenX+mathFloor(28 * widgetScale), screenY-mathFloor(14 * widgetScale), screenWidth-mathFloor(28 * widgetScale), screenHeight-mathFloor(28 * widgetScale), 1) + DrawTextarea(screenX + mathFloor(28 * widgetScale), screenY - mathFloor(14 * widgetScale), screenWidth - mathFloor(28 * widgetScale), screenHeight - mathFloor(28 * widgetScale), 1) end - function widget:DrawScreen() + -- draw the help + if not textList then + textList = gl.CreateList(DrawWindow) + end - -- draw the help - if not textList then - textList = gl.CreateList(DrawWindow) - end - - if show or showOnceMore then - gl.Texture(false) -- some other widget left it on + if show or showOnceMore then + gl.Texture(false) -- some other widget left it on -- draw the text panel - glCallList(textList) + glCallList(textList) - if WG['guishader'] then + if WG["guishader"] then if backgroundGuishader ~= nil then glDeleteList(backgroundGuishader) end @@ -208,37 +197,37 @@ function widget:DrawScreen() RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], elementCorner, 1, 1, 0, 0) end) dlistcreated = true - WG['guishader'].InsertDlist(backgroundGuishader, 'text') + WG["guishader"].InsertDlist(backgroundGuishader, "text") end showOnceMore = false - local x, y, pressed = Spring.GetMouseState() - if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) or math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then - Spring.SetMouseCursor('cursornormal') - end - - elseif dlistcreated and WG['guishader'] then - WG['guishader'].DeleteDlist('text') - dlistcreated = nil - end + local x, y, pressed = Spring.GetMouseState() + if math_isInRect(x, y, screenX, screenY - screenHeight, screenX + screenWidth, screenY) or math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then + Spring.SetMouseCursor("cursornormal") + end + elseif dlistcreated and WG["guishader"] then + WG["guishader"].DeleteDlist("text") + dlistcreated = nil + end end function widget:KeyPress(key) - if key == 27 then -- ESC + if key == 27 then -- ESC show = false end end function widget:MouseWheel(up, value) - if show then - local addLines = value*-3 -- direction is retarded + local addLines = value * -3 -- direction is retarded startLine = startLine + addLines if startLine >= totalTextLines - maxLines then - startLine = totalTextLines - maxLines+1 + startLine = totalTextLines - maxLines + 1 + end + if startLine < 1 then + startLine = 1 end - if startLine < 1 then startLine = 1 end if textList then glDeleteList(textList) @@ -260,7 +249,9 @@ function widget:MouseRelease(x, y, button) end function mouseEvent(x, y, button, release) - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end if show then -- on window @@ -268,7 +259,7 @@ function mouseEvent(x, y, button, release) return true elseif titleRect == nil or not math_isInRect(x, y, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then if release then - showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it + showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it show = false end return true @@ -278,16 +269,15 @@ end function widget:Initialize() if textFile then - - WG['scavengerinfo'] = {} - WG['scavengerinfo'].toggle = function(state) + WG["scavengerinfo"] = {} + WG["scavengerinfo"].toggle = function(state) if state ~= nil then show = state else show = not show end end - WG['scavengerinfo'].isvisible = function() + WG["scavengerinfo"].isvisible = function() return show end @@ -308,19 +298,17 @@ function widget:Initialize() end function widget:Shutdown() - if textList then - glDeleteList(textList) - textList = nil - end - if WG['guishader'] then - WG['guishader'].DeleteDlist('text') + if textList then + glDeleteList(textList) + textList = nil + end + if WG["guishader"] then + WG["guishader"].DeleteDlist("text") end end - - function widget:GetConfigData(data) - return {numGames = numGames} + return { numGames = numGames } end function widget:SetConfigData(data) diff --git a/luaui/Widgets/gui_screen_mode_info.lua b/luaui/Widgets/gui_screen_mode_info.lua index cd68a5579fb..b86f177483b 100644 --- a/luaui/Widgets/gui_screen_mode_info.lua +++ b/luaui/Widgets/gui_screen_mode_info.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "November 2020", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end @@ -34,13 +34,13 @@ local screenmode local heightKey, metalKey, pathKey -local screenModeOverviewTable = { highlightColor = '\255\255\255\255', textColor = '\255\215\215\215', keyset = '' } +local screenModeOverviewTable = { highlightColor = "\255\255\255\255", textColor = "\255\215\215\215", keyset = "" } local screenModeTitleTable = { screenMode = "", highlightColor = "\255\255\255\255" } -- Pre-allocated i18n parameter tables to avoid per-frame allocation -local heightParams = { keyset = '' } -local pathParams = { keyset = '' } -local metalParams = { keyset = '' } +local heightParams = { keyset = "" } +local pathParams = { keyset = "" } +local metalParams = { keyset = "" } local cachedCameraName = spGetCameraState().name or "" local cachedTitleText = "" @@ -54,7 +54,9 @@ local framecount = 0 local function getActionHotkey(action) local key = spGetActionHotkeys(action)[1] - if not key then return "none" end + if not key then + return "none" + end return keyConfig.sanitizeKey(key, currentLayout) end @@ -71,7 +73,7 @@ function widget:ViewResize() vsx, vsy = spGetViewGeometry() widgetScale = (0.80 + (vsx * vsy / 6000000)) - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) end function widget:Initialize() @@ -79,7 +81,9 @@ function widget:Initialize() end function widget:DrawScreen() - if WG['topbar'] and WG['topbar'].showingQuit() then return end + if WG["topbar"] and WG["topbar"].showingQuit() then + return + end framecount = framecount + 1 @@ -97,52 +101,56 @@ function widget:DrawScreen() needsTextRebuild = true end - local isOverview = cachedCameraName == 'ov' - if (screenmode == 'normal' or screenmode == 'los') and not isOverview then return end + local isOverview = cachedCameraName == "ov" + if (screenmode == "normal" or screenmode == "los") and not isOverview then + return + end if needsTextRebuild then needsTextRebuild = false updateKeys() - local description, title = '', '' + local description, title = "", "" local effectiveMode = screenmode if isOverview then - effectiveMode = '' - description = i18n('ui.screenMode.overview', screenModeOverviewTable) - elseif screenmode == 'height' then - title = i18n('ui.screenMode.heightTitle') + effectiveMode = "" + description = i18n("ui.screenMode.overview", screenModeOverviewTable) + elseif screenmode == "height" then + title = i18n("ui.screenMode.heightTitle") heightParams.keyset = heightKey - description = i18n('ui.screenMode.heightmap', heightParams) - elseif screenmode == 'pathTraversability' then - title = i18n('ui.screenMode.pathingTitle') + description = i18n("ui.screenMode.heightmap", heightParams) + elseif screenmode == "pathTraversability" then + title = i18n("ui.screenMode.pathingTitle") pathParams.keyset = pathKey - description = i18n('ui.screenMode.pathing', pathParams) - elseif screenmode == 'metal' then - title = i18n('ui.screenMode.resourcesTitle') + description = i18n("ui.screenMode.pathing", pathParams) + elseif screenmode == "metal" then + title = i18n("ui.screenMode.resourcesTitle") metalParams.keyset = metalKey - description = i18n('ui.screenMode.resources', metalParams) + description = i18n("ui.screenMode.resources", metalParams) end - if effectiveMode ~= '' and title ~= '' then + if effectiveMode ~= "" and title ~= "" then screenModeTitleTable.screenMode = title - cachedTitleText = '\255\233\233\233' .. i18n('ui.screenMode.title', screenModeTitleTable) + cachedTitleText = "\255\233\233\233" .. i18n("ui.screenMode.title", screenModeTitleTable) else - cachedTitleText = '' + cachedTitleText = "" end - cachedDescText = description ~= '' and ('\255\215\215\215' .. description) or '' + cachedDescText = description ~= "" and ("\255\215\215\215" .. description) or "" end - if cachedTitleText == '' and cachedDescText == '' then return end + if cachedTitleText == "" and cachedDescText == "" then + return + end glPushMatrix() glTranslate((vsx * 0.5), (vsy * 0.21), 0) --has to be below where newbie info appears! font:Begin() - if cachedTitleText ~= '' then + if cachedTitleText ~= "" then font:Print(cachedTitleText, 0, 15 * widgetScale, 20 * widgetScale, "oc") end - if cachedDescText ~= '' then + if cachedDescText ~= "" then font:Print(cachedDescText, 0, -10 * widgetScale, 17 * widgetScale, "oc") end font:End() diff --git a/luaui/Widgets/gui_scrolldown_toggleoverview.lua b/luaui/Widgets/gui_scrolldown_toggleoverview.lua index b07548c0fa3..27f34832e50 100644 --- a/luaui/Widgets/gui_scrolldown_toggleoverview.lua +++ b/luaui/Widgets/gui_scrolldown_toggleoverview.lua @@ -12,14 +12,16 @@ function widget:GetInfo() date = "Jan 2, 2023", license = "GPL2+", layer = 999999 + 1, -- one layer above widget selector - enabled = false + enabled = false, } end function widget:MouseWheel(up) local alt, ctrl, meta, shift = Spring.GetModKeyState() - if alt or ctrl or meta or shift then return end + if alt or ctrl or meta or shift then + return + end local camState = Spring.GetCameraState() local isOverview = camState.name == "ov" @@ -29,12 +31,16 @@ function widget:MouseWheel(up) end if up then - if isOverview then Spring.SendCommands({ "toggleoverview" }) end + if isOverview then + Spring.SendCommands({ "toggleoverview" }) + end return true end - if not isOverview then Spring.SendCommands({ "toggleoverview" }) end + if not isOverview then + Spring.SendCommands({ "toggleoverview" }) + end return true end diff --git a/luaui/Widgets/gui_selectedunits_gl4.lua b/luaui/Widgets/gui_selectedunits_gl4.lua index c2167a74f61..5624d26bc5b 100644 --- a/luaui/Widgets/gui_selectedunits_gl4.lua +++ b/luaui/Widgets/gui_selectedunits_gl4.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetSelectedUnits = Spring.GetSelectedUnits local spEcho = Spring.Echo @@ -56,23 +55,22 @@ local luaShaderDir = "LuaUI/Include/" local InstanceVBOTable = gl.InstanceVBOTable local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance - +local popElementInstance = InstanceVBOTable.popElementInstance -- Localize for speedups: -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local glClear = gl.Clear -local GL_ALWAYS = GL.ALWAYS -local GL_NOTEQUAL = GL.NOTEQUAL -local GL_KEEP = 0x1E00 --GL.KEEP +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glDepthTest = gl.DepthTest +local glTexture = gl.Texture +local glClear = gl.Clear +local GL_ALWAYS = GL.ALWAYS +local GL_NOTEQUAL = GL.NOTEQUAL +local GL_KEEP = 0x1E00 --GL.KEEP local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT -local GL_REPLACE = GL.REPLACE -local GL_POINTS = GL.POINTS +local GL_REPLACE = GL.REPLACE +local GL_POINTS = GL.POINTS local selUnits = {} local updateSelection = true @@ -91,18 +89,18 @@ local unitScale = {} local unitCanFly = {} local unitBuilding = {} for unitDefID, unitDef in pairs(UnitDefs) do - unitScale[unitDefID] = (7.5 * ( unitDef.xsize*unitDef.xsize + unitDef.zsize*unitDef.zsize ) ^ 0.5) + 8 + unitScale[unitDefID] = (7.5 * (unitDef.xsize * unitDef.xsize + unitDef.zsize * unitDef.zsize) ^ 0.5) + 8 if unitDef.canFly then unitCanFly[unitDefID] = true unitScale[unitDefID] = unitScale[unitDefID] * 0.7 - elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0 then + elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0 then unitBuilding[unitDefID] = { unitDef.xsize * 8.2 + 12, - unitDef.zsize * 8.2 + 12 + unitDef.zsize * 8.2 + 12, } end end -local unitBufferUniformCache = {0} +local unitBufferUniformCache = { 0 } local widgetDrawWorld = nil local widgetDrawWorldPreUnit = nil local UpdateDrawCallinsEnabled = nil @@ -123,9 +121,13 @@ function widget:LavaRenderState(tideLevel) end local function shouldUseWaterPass(unitID, unitDefID) - if not mapHasWater or unitCanFly[unitDefID] then return false end + if not mapHasWater or unitCanFly[unitDefID] then + return false + end local x, y, z = spGetUnitPosition(unitID) - if not x or not y or not z then return false end + if not x or not y or not z then + return false + end local waterLevel = getWaterLevel() local groundY = spGetGroundHeight(x, z) -- Route ships/submerged units to post-water pass to avoid water distortion. @@ -133,17 +135,22 @@ local function shouldUseWaterPass(unitID, unitDefID) end local function shouldUseWaterPassAtLevel(unitID, unitDefID, waterLevel) - if not mapHasWater or unitCanFly[unitDefID] then return false end + if not mapHasWater or unitCanFly[unitDefID] then + return false + end local x, y, z = spGetUnitPosition(unitID) - if not x or not y or not z then return false end + if not x or not y or not z then + return false + end local groundY = spGetGroundHeight(x, z) -- Route ships/submerged units to post-water pass to avoid water distortion. return (groundY < waterLevel + 1) and (y <= waterLevel + 20) end - local function AddPrimitiveAtUnit(unitID) - if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true or Spring.IsGUIHidden() then return end + if Spring.ValidUnitID(unitID) ~= true or Spring.GetUnitIsDead(unitID) == true or Spring.IsGUIHidden() then + return + end local gf = Spring.GetGameFrame() local _, _, isPaused = Spring.GetGameSpeed() if isPaused then @@ -154,7 +161,9 @@ local function AddPrimitiveAtUnit(unitID) unitUnitDefID[unitID] = Spring.GetUnitDefID(unitID) end local unitDefID = unitUnitDefID[unitID] - if unitDefID == nil then return end -- these cant be selected + if unitDefID == nil then + return + end -- these cant be selected local numVertices = 64 -- default to cornered rectangle local cornersize = 0 @@ -220,12 +229,24 @@ local function AddPrimitiveAtUnit(unitID) pushElementInstance( targetVBO, -- push into this Instance VBO Table { - length, width, cornersize, additionalheight, -- lengthwidthcornerheight + length, + width, + cornersize, + additionalheight, -- lengthwidthcornerheight unitTeam[unitID], -- teamID numVertices, -- how many trianges should we make - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -234,7 +255,6 @@ local function AddPrimitiveAtUnit(unitID) ) end - local function DrawSelections(selectionVBO, shader) if selectionVBO.usedElements > -1 then -- DrawWorld can inherit culling state from other render passes/widgets. @@ -372,12 +392,11 @@ function widget:SelectionChanged(sel) updateSelection = true end - local lastMouseOverUnitID = nil local lastMouseOverFeatureID = nil local cleanedForHiddenUI = false -local mouseOverUnitUniform = {0} -local mouseOverFeatureUniform = {0} +local mouseOverUnitUniform = { 0 } +local mouseOverFeatureUniform = { 0 } local lastMouseX, lastMouseY = -1, -1 local lastMouseP1, lastMouseMMB = false, false local nextMouseOverCheckFrame = 0 @@ -400,8 +419,6 @@ local function ClearLastMouseOver() end end - - function widget:Update(dt) local guiHidden = spIsGUIHidden() -- Handle UI visibility: clear selections when hidden, resync on show @@ -481,7 +498,7 @@ function widget:Update(dt) -- +0.5 means ally also selected unit -- +2 means its mouseovered if mouseoverHighlight then - local mx, my, p1, mmb, _, mouseOffScreen, cameraPanMode = spGetMouseState() + local mx, my, p1, mmb, _, mouseOffScreen, cameraPanMode = spGetMouseState() if mouseOffScreen or cameraPanMode or mmb or p1 then ClearLastMouseOver() else @@ -504,16 +521,16 @@ function widget:Update(dt) local result, data = spTraceScreenRay(mx, my) --spEcho(result, (type(data) == 'table') or data, lastMouseOverUnitID, lastMouseOverFeatureID) - if result == 'unit' and not guiHidden then + if result == "unit" and not guiHidden then local unitID = data if lastMouseOverUnitID ~= unitID then ClearLastMouseOver() - local newUniform = (selUnits[unitID] and 1 or 0 ) + 2 + local newUniform = (selUnits[unitID] and 1 or 0) + 2 mouseOverUnitUniform[1] = newUniform spSetUnitBufferUniforms(unitID, mouseOverUnitUniform, 6) lastMouseOverUnitID = unitID end - elseif result == 'feature' and not guiHidden then + elseif result == "feature" and not guiHidden then local featureID = data if lastMouseOverFeatureID ~= featureID then ClearLastMouseOver() @@ -556,7 +573,6 @@ function widget:UnitCreated(unitID, unitDefID, unitTeamID, builderID) unitBuiltByFactory[unitID] = true end end - end function widget:UnitFinished(unitID) @@ -588,16 +604,16 @@ local function init() updateSelection = true selUnits = {} drawCallinsEnabled = true - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE! shaderConfig.BILLBOARD = 0 shaderConfig.TRANSPARENCY = opacity shaderConfig.INITIALSIZE = 0.75 - shaderConfig.GROWTHRATE = 4 -- higher = slower - shaderConfig.TEAMCOLORIZATION = teamcolorOpacity -- not implemented, doing it via POST_SHADING below instead + shaderConfig.GROWTHRATE = 4 -- higher = slower + shaderConfig.TEAMCOLORIZATION = teamcolorOpacity -- not implemented, doing it via POST_SHADING below instead shaderConfig.HEIGHTOFFSET = 4 - shaderConfig.POST_SHADING = "fragColor.rgba = vec4(mix(g_color.rgb * texcolor.rgb + addRadius, vec3(1.0), "..(1-teamcolorOpacity)..") , texcolor.a * TRANSPARENCY + addRadius);" + shaderConfig.POST_SHADING = "fragColor.rgba = vec4(mix(g_color.rgb * texcolor.rgb + addRadius, vec3(1.0), " .. (1 - teamcolorOpacity) .. ") , texcolor.a * TRANSPARENCY + addRadius);" selectionVBOGround, selectShader = InitDrawPrimitiveAtUnit(shaderConfig, "selectedUnitsGround") local unbuiltConfig = table.copy(shaderConfig) @@ -635,7 +651,9 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not init() then return end + if not init() then + return + end WG.selectedunits = {} WG.selectedunits.getOpacity = function() return opacity @@ -668,7 +686,7 @@ function widget:Initialize() return mouseoverHighlight end - Spring.LoadCmdColorsConfig('unitBox 0 1 0 0') + Spring.LoadCmdColorsConfig("unitBox 0 1 0 0") for _, unitID in ipairs(Spring.GetAllUnits()) do widget:UnitCreated(unitID) @@ -677,7 +695,7 @@ end function widget:Shutdown() if not (WG.teamplatter or WG.highlightselunits) then - Spring.LoadCmdColorsConfig('unitBox 0 1 0 1') + Spring.LoadCmdColorsConfig("unitBox 0 1 0 1") end WG.selectedunits = nil end diff --git a/luaui/Widgets/gui_selectionbox.lua b/luaui/Widgets/gui_selectionbox.lua index d89b2d22b05..a425f239258 100644 --- a/luaui/Widgets/gui_selectionbox.lua +++ b/luaui/Widgets/gui_selectionbox.lua @@ -3,28 +3,28 @@ local widget = widget ---@type Widget function widget:GetInfo() return { name = "Selectionbox", - desc = "Customizes the appearance of the selection box rectangle" , + desc = "Customizes the appearance of the selection box rectangle", author = "Floris", date = "September 2024", license = "GNU GPL, v2 or later", layer = 999999, - enabled = true + enabled = true, } end local lineWidth = 1.5 -- Optional: Enable colored selection box based on modifier keys -local coloredModifierKeys = true -- Set to false to always use white selection box +local coloredModifierKeys = true -- Set to false to always use white selection box local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ -- Track minimap selection local minimapSelectionActive = false -local minimapSelectionStart = {x = 0, y = 0} -local minimapSelectionEnd = {x = 0, y = 0} -local minimapGeometryCache = {x = 0, y = 0, w = 0, h = 0} +local minimapSelectionStart = { x = 0, y = 0 } +local minimapSelectionEnd = { x = 0, y = 0 } +local minimapGeometryCache = { x = 0, y = 0, w = 0, h = 0 } function widget:ViewResize(vsx, vsy) lineWidth = math.max(1.5, vsy / 1080) @@ -35,12 +35,12 @@ function widget:Initialize() -- Disable engine's selection box rendering completely by setting line width to 0 -- and making the color transparent - Spring.LoadCmdColorsConfig('mouseBoxLineWidth 0') + Spring.LoadCmdColorsConfig("mouseBoxLineWidth 0") end function widget:Shutdown() -- Restore engine's default selection box - Spring.LoadCmdColorsConfig('mouseBoxLineWidth 1.5') + Spring.LoadCmdColorsConfig("mouseBoxLineWidth 1.5") end function widget:DrawScreen() -- This blurs the UI elements obscured by other UI elements (only unit stats so far!) @@ -61,24 +61,24 @@ function widget:DrawScreen() -- This blurs the UI elements obscured by other UI gl.Color(0.45, 1, 0.45, a) else -- White for normal selection - gl.Color(1, 1, 1, a*0.8) + gl.Color(1, 1, 1, a * 0.8) end -- selection box background gl.Rect(x1, y1, x2, y2) -- selection box background vignette - gl.Color(1,1,1,0.03) - gl.Texture(":n:"..LUAUI_DIRNAME.."Images/vignette.dds") + gl.Color(1, 1, 1, 0.03) + gl.Texture(":n:" .. LUAUI_DIRNAME .. "Images/vignette.dds") gl.TexRect(x1, y1, x2, y2) gl.Texture(false) -- black selection outline gl.PolygonMode(GL.FRONT_AND_BACK, GL.LINE) gl.LineWidth(lineWidth + 2.5) - gl.Color(0,0,0,0.12) + gl.Color(0, 0, 0, 0.12) gl.Rect(x1, y1, x2, y2) -- colored selection outline based on modifier keys - gl.LineStipple(true) -- animated stipplelines! + gl.LineStipple(true) -- animated stipplelines! gl.LineWidth(lineWidth) -- Determine color based on modifier keys (if enabled) @@ -102,16 +102,20 @@ function widget:DrawScreen() -- This blurs the UI elements obscured by other UI end function widget:MousePress(x, y, button) - if button ~= 1 then return false end + if button ~= 1 then + return false + end -- Don't track selection if minimap left-click-move is enabled - if WG['minimap'] and WG['minimap'].getLeftClickMove and WG['minimap'].getLeftClickMove() then + if WG["minimap"] and WG["minimap"].getLeftClickMove and WG["minimap"].getLeftClickMove() then return false end -- Check if click is on minimap local mmX, mmY, mmW, mmH, minimized, maximized = Spring.GetMiniMapGeometry() - if not mmX or minimized or maximized then return false end + if not mmX or minimized or maximized then + return false + end -- mmY is bottom edge, top edge is mmY + mmH local minimapBottom = mmY @@ -140,7 +144,7 @@ function widget:Update() if leftPressed then -- Don't track selection if minimap left-click-move is enabled - if WG['minimap'] and WG['minimap'].getLeftClickMove and WG['minimap'].getLeftClickMove() then + if WG["minimap"] and WG["minimap"].getLeftClickMove and WG["minimap"].getLeftClickMove() then if minimapSelectionActive then minimapSelectionActive = false end @@ -196,15 +200,17 @@ function widget:MouseMove(x, y, dx, dy, button) end function widget:DrawInMiniMap(minimapWidth, minimapHeight) -- Skip if PIP minimap replacement is active (it handles its own selection box) - if WG['minimap'] and WG['minimap'].isPipMinimapActive and WG['minimap'].isPipMinimapActive() then + if WG["minimap"] and WG["minimap"].isPipMinimapActive and WG["minimap"].isPipMinimapActive() then return end -- Draw selection for minimap-tracked selection - if not minimapSelectionActive then return end + if not minimapSelectionActive then + return + end -- Don't draw if minimap left-click-move is enabled - if WG['minimap'] and WG['minimap'].getLeftClickMove and WG['minimap'].getLeftClickMove() then + if WG["minimap"] and WG["minimap"].getLeftClickMove and WG["minimap"].getLeftClickMove() then return end @@ -233,15 +239,19 @@ function widget:DrawInMiniMap(minimapWidth, minimapHeight) x1 = math.max(mmX, math.min(mmX + mmW, x1)) y1 = math.max(minimapBottom, math.min(minimapTop, y1)) x2 = math.max(mmX, math.min(mmX + mmW, x2)) - y2 = math.max(minimapBottom, math.min(minimapTop, y2)) -- Convert screen coordinates to minimap pixel coordinates + y2 = math.max(minimapBottom, math.min(minimapTop, y2)) -- Convert screen coordinates to minimap pixel coordinates local mx1 = ((x1 - mmX) / mmW) * minimapWidth local my1 = ((y1 - mmY) / mmH) * minimapHeight local mx2 = ((x2 - mmX) / mmW) * minimapWidth local my2 = ((y2 - mmY) / mmH) * minimapHeight -- Ensure proper ordering (x1 < x2, y1 < y2) - if mx1 > mx2 then mx1, mx2 = mx2, mx1 end - if my1 > my2 then my1, my2 = my2, my1 end + if mx1 > mx2 then + mx1, mx2 = mx2, mx1 + end + if my1 > my2 then + my1, my2 = my2, my1 + end local width = mx2 - mx1 local height = my2 - my1 @@ -249,14 +259,14 @@ function widget:DrawInMiniMap(minimapWidth, minimapHeight) -- Skip if box is too small if width < 1 or height < 1 then return - end -- Draw filled rectangle with transparency + end -- Draw filled rectangle with transparency local a = 0.08 if ctrl then gl.Color(1, 0.25, 0.25, a) elseif shift then gl.Color(0.45, 1, 0.45, a) else - gl.Color(1, 1, 1, a*0.8) + gl.Color(1, 1, 1, a * 0.8) end gl.BeginEnd(GL.QUADS, function() gl.Vertex(mx1, my1) diff --git a/luaui/Widgets/gui_selfd_icons.lua b/luaui/Widgets/gui_selfd_icons.lua index 0c56b3ee7d1..a1238cd87d0 100644 --- a/luaui/Widgets/gui_selfd_icons.lua +++ b/luaui/Widgets/gui_selfd_icons.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Self-Destruct Icons", - desc = "Show an icon and countdown (if active) for units that have a self-destruct command", - author = "Floris", - date = "06.05.2014", - license = "GNU GPL, v2 or later", - layer = -50, - enabled = true - } + return { + name = "Self-Destruct Icons", + desc = "Show an icon and countdown (if active) for units that have a self-destruct command", + author = "Floris", + date = "06.05.2014", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true, + } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetSpectatingState = Spring.GetSpectatingState @@ -21,9 +20,9 @@ local ignoreUnitDefs = {} local unitConf = {} for udid, unitDef in pairs(UnitDefs) do local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 6*( xsize*xsize + zsize*zsize )^0.5 - unitConf[udid] = 7 +(scale/2.5) - if string.find(unitDef.name, 'droppod') then + local scale = 6 * (xsize * xsize + zsize * zsize) ^ 0.5 + unitConf[udid] = 7 + (scale / 2.5) + if string.find(unitDef.name, "droppod") then ignoreUnitDefs[udid] = true end end @@ -38,35 +37,33 @@ local queuedSelfD = {} local drawLists = {} -local glDrawListAtUnit = gl.DrawListAtUnit -local glDepthTest = gl.DepthTest -local spGetUnitDefID = spGetUnitDefID -local spIsUnitInView = Spring.IsUnitInView -local spGetUnitSelfDTime = Spring.GetUnitSelfDTime -local spGetAllUnits = Spring.GetAllUnits -local spGetUnitCommands = Spring.GetUnitCommands -local spIsUnitAllied = Spring.IsUnitAllied -local spGetCameraDirection = Spring.GetCameraDirection -local spIsGUIHidden = Spring.IsGUIHidden -local spGetUnitTransporter = Spring.GetUnitTransporter +local glDrawListAtUnit = gl.DrawListAtUnit +local glDepthTest = gl.DepthTest +local spGetUnitDefID = spGetUnitDefID +local spIsUnitInView = Spring.IsUnitInView +local spGetUnitSelfDTime = Spring.GetUnitSelfDTime +local spGetAllUnits = Spring.GetAllUnits +local spGetUnitCommands = Spring.GetUnitCommands +local spIsUnitAllied = Spring.IsUnitAllied +local spGetCameraDirection = Spring.GetCameraDirection +local spIsGUIHidden = Spring.IsGUIHidden +local spGetUnitTransporter = Spring.GetUnitTransporter local spec = spGetSpectatingState() - - local function DrawIcon(text) local iconSize = 0.9 gl.PushMatrix() gl.Color(0.9, 0.9, 0.9, 1) - gl.Texture(':n:LuaUI/Images/skull.dds') + gl.Texture(":n:LuaUI/Images/skull.dds") gl.Billboard() gl.Translate(0, -1.2, 0) - gl.TexRect(-iconSize/2, -iconSize/2, iconSize/2, iconSize/2) + gl.TexRect(-iconSize / 2, -iconSize / 2, iconSize / 2, iconSize / 2) gl.Texture(false) if text ~= 0 then - gl.Translate(iconSize/2, -iconSize/2, 0) + gl.Translate(iconSize / 2, -iconSize / 2, 0) font:Begin() font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 1) @@ -113,18 +110,18 @@ local function updateUnit(unitID) end local function init() - for k,_ in pairs(drawLists) do + for k, _ in pairs(drawLists) do gl.DeleteList(drawLists[k]) end drawLists = {} - font = WG['fonts'].getFont(2, 1.5) + font = WG["fonts"].getFont(2, 1.5) spec = spGetSpectatingState() activeSelfD = {} queuedSelfD = {} local allUnits = spGetAllUnits() - for i=1,#allUnits do + for i = 1, #allUnits do updateUnit(allUnits[i]) end end @@ -132,7 +129,7 @@ end function widget:PlayerChanged(playerID) init() end -function widget:ViewResize(vsx,vsy) +function widget:ViewResize(vsx, vsy) init() end @@ -140,33 +137,33 @@ function widget:Initialize() init() end - function widget:Shutdown() - for k,_ in pairs(drawLists) do + for k, _ in pairs(drawLists) do gl.DeleteList(drawLists[k]) end end - local sec = 0 -local prevCam = {spGetCameraDirection()} +local prevCam = { spGetCameraDirection() } function widget:Update(dt) sec = sec + dt if sec > 0.15 then sec = 0 local camX, camY, camZ = spGetCameraDirection() - if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then - for k,_ in pairs(drawLists) do + if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then + for k, _ in pairs(drawLists) do gl.DeleteList(drawLists[k]) drawLists[k] = nil end end - prevCam = {camX,camY,camZ} + prevCam = { camX, camY, camZ } end end function widget:DrawWorld() - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end glDepthTest(false) @@ -283,7 +280,6 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD queuedSelfD[unitID] = nil end - function widget:CrashingAircraft(unitID, unitDefID, teamID) activeSelfD[unitID] = nil queuedSelfD[unitID] = nil diff --git a/luaui/Widgets/gui_sensor_ranges_jammer.lua b/luaui/Widgets/gui_sensor_ranges_jammer.lua index 4d0b6372bd3..866377c3de5 100644 --- a/luaui/Widgets/gui_sensor_ranges_jammer.lua +++ b/luaui/Widgets/gui_sensor_ranges_jammer.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021.06.18", license = "GPLv2, (c) Beherith (mysterme@gmail.com)", layer = 17, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo @@ -36,25 +35,22 @@ local gaiaTeamID = Spring.GetGaiaTeamID() ------- GL4 NOTES ----- -- TODO: 2025.07.02: - - - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local jammerStencilShader = nil local jammerCircleShader = nil local circleInstanceVBO = nil -local jammerStencilTexture +local jammerStencilTexture local resolution = 4 -local vsx, vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local circleShaderSourceCache = { - shaderName = 'Jammer Ranges Circles GL4', + shaderName = "Jammer Ranges Circles GL4", vssrcpath = "LuaUI/Shaders/sensor_ranges_los.vert.glsl", fssrcpath = "LuaUI/Shaders/sensor_ranges_los.frag.glsl", shaderConfig = { @@ -74,18 +70,18 @@ local circleShaderSourceCache = { rangeColor = rangeColor, }, silent = not debugmode, -- do not print shader compile timing -} - +} + local stencilShaderSourceCache = table.copy(circleShaderSourceCache) -- copy the circle shader source cache, and modify it for stencil pass stencilShaderSourceCache.shaderConfig.STENCILPASS = 1 -- this is a stencil pass -stencilShaderSourceCache.shaderName = 'Jammer Ranges Stencil GL4' +stencilShaderSourceCache.shaderName = "Jammer Ranges Stencil GL4" local function goodbye(reason) spEcho("Sensor Ranges LOS widget exiting with reason: " .. reason) widgetHandler:RemoveWidget() return false end - + local function CreateStencilShaderAndTexture() vsx, vsy = spGetViewGeometry() circleShaderSourceCache.shaderConfig.VSX = vsx @@ -95,23 +91,25 @@ local function CreateStencilShaderAndTexture() stencilShaderSourceCache.shaderConfig.VSY = vsy stencilShaderSourceCache.forceupdate = true - jammerStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) + jammerStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) if not jammerStencilShader then - return goodbye("Failed to compile jammerrange stencil shader GL4 ") - end - jammerCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) + return goodbye("Failed to compile jammerrange stencil shader GL4 ") + end + jammerCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) if not jammerCircleShader then return goodbye("Failed to compile jammerrange shader GL4 ") end local GL_R8 = 0x8229 - vsx, vsy = spGetViewGeometry() - lineScale = (vsy + 500)/ 1300 - if jammerStencilTexture then gl.DeleteTexture(jammerStencilTexture) end - jammerStencilTexture = gl.CreateTexture(vsx/resolution, vsy/resolution, { + vsx, vsy = spGetViewGeometry() + lineScale = (vsy + 500) / 1300 + if jammerStencilTexture then + gl.DeleteTexture(jammerStencilTexture) + end + jammerStencilTexture = gl.CreateTexture(vsx / resolution, vsy / resolution, { --format = GL.RGBA8, - format = GL_R8, + format = GL_R8, fbo = true, min_filter = GL.NEAREST, mag_filter = GL.LINEAR, @@ -125,8 +123,8 @@ local function initgl4() -- Note that we are createing a special Circle VBO, that starts at the center vertex! This is needed for triangle fans local circleVBO, numVertices = InstanceVBOTable.makeCircleVBO(circleSegments, nil, true, "jammerrangeCircles") local circleInstanceVBOLayout = { - { id = 1, name = 'radius_params', size = 4 }, -- radius, gameframe, 2 unused floats - { id = 2, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, -- instData + { id = 1, name = "radius_params", size = 4 }, -- radius, gameframe, 2 unused floats + { id = 2, name = "instData", size = 4, type = GL.UNSIGNED_INT }, -- instData } circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 128, "jammerrangeVBO", 2) @@ -136,15 +134,14 @@ local function initgl4() CreateStencilShaderAndTexture() end - - + local function DrawLOSStencil() -- about 0.025 ms if circleInstanceVBO.usedElements > 0 then - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.BlendEquation(GL.MAX) gl.Blending(GL.ONE, GL.ONE) - gl.Culling(false) - + gl.Culling(false) + gl.Texture(0, "$heightmap") -- Bind the heightmap texture jammerStencilShader:Activate() circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLE_FAN, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) @@ -155,27 +152,27 @@ local function DrawLOSStencil() -- about 0.025 ms end function widget:DrawGenesis() - gl.RenderToTexture(jammerStencilTexture, DrawLOSStencil) + gl.RenderToTexture(jammerStencilTexture, DrawLOSStencil) end -- This shows the debug stencil texture in the bottom left corner of the screen -if debugmode then - function widget:DrawScreen() - jammerCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) or jammerCircleShader - jammerStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) or jammerStencilShader - gl.Color(1,1,1,1) +if debugmode then + function widget:DrawScreen() + jammerCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) or jammerCircleShader + jammerStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) or jammerStencilShader + gl.Color(1, 1, 1, 1) gl.Blending(GL.ONE, GL.ZERO) gl.Texture(jammerStencilTexture) - gl.TexRect(0, 0, vsx/resolution, vsy/resolution, 0, 0, 1, 1) + gl.TexRect(0, 0, vsx / resolution, vsy / resolution, 0, 0, 1, 1) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end -end +end -- Functions shortcuts local spGetSpectatingState = Spring.GetSpectatingState local spIsUnitAllied = Spring.IsUnitAllied local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitIsActive = Spring.GetUnitIsActive +local spGetUnitIsActive = Spring.GetUnitIsActive local GL_NOTEQUAL = GL.NOTEQUAL local GL_LINE_LOOP = GL.LINE_LOOP local GL_KEEP = 0x1E00 --GL.KEEP @@ -191,23 +188,23 @@ local unitRange = {} -- table of unit types with their radar ranges local unitList = {} -- all ally units and their coordinates and radar ranges for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.radarDistanceJam and unitDef.radarDistanceJam > minJammerDistance then -- save perf by excluding low radar range units + if unitDef.radarDistanceJam and unitDef.radarDistanceJam > minJammerDistance then -- save perf by excluding low radar range units unitRange[unitDefID] = unitDef.radarDistanceJam end end function widget:ViewResize(newX, newY) CreateStencilShaderAndTexture() -end +end -- a reusable table, since we will literally only modify its first element. -local instanceCache = {0,0,0,0,0,0,0,0} +local instanceCache = { 0, 0, 0, 0, 0, 0, 0, 0 } local function InitializeUnits() --spEcho("Sensor Ranges LOS InitializeUnits") InstanceVBOTable.clearInstanceTable(circleInstanceVBO) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID), nil, true) end @@ -232,52 +229,62 @@ function widget:Initialize() end WG.jammerrange = { - getOpacity = function() return opacity end, - setOpacity = function(value) opacity = value end, + getOpacity = function() + return opacity + end, + setOpacity = function(value) + opacity = value + end, } - initgl4() + initgl4() InitializeUnits() end function widget:Shutdown() - if jammerStencilTexture then gl.DeleteTexture(jammerStencilTexture) end + if jammerStencilTexture then + gl.DeleteTexture(jammerStencilTexture) + end WG.jammerrange = nil end -function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) +function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) --spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam, reason, noupload) unitTeam = unitTeam or spGetUnitTeam(unitID) noupload = noupload == true - if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then return end + if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then + return + end if (not (spec and fullview)) and (not spIsUnitAllied(unitID)) then -- given units are still considered allies :/ return end -- display mode for specs - if Spring.GetUnitIsBeingBuilt(unitID) then return end + if Spring.GetUnitIsBeingBuilt(unitID) then + return + end - instanceCache[1] = unitRange[unitDefID] + instanceCache[1] = unitRange[unitDefID] - local active = spGetUnitIsActive(unitID) local gameFrame = spGetGameFrame() if reason == "UnitFinished" then - if active then + if active then instanceCache[2] = spGetGameFrame() else instanceCache[2] = -2 -- start from full size end else - if active then + if active then instanceCache[2] = gameFrame else - instanceCache[2] = -1 * gameFrame + instanceCache[2] = -1 * gameFrame end end unitList[unitID] = active - pushElementInstance(circleInstanceVBO, + pushElementInstance( + circleInstanceVBO, instanceCache, unitID, --key true, -- updateExisting @@ -298,13 +305,15 @@ function widget:VisibleUnitRemoved(unitID) end function widget:GameFrame(n) - if spec and fullview then return end - if n % 15 == 0 then + if spec and fullview then + return + end + if n % 15 == 0 then for unitID, oldActive in pairs(unitList) do local active = spGetUnitIsActive(unitID) if active ~= oldActive then unitList[unitID] = active - widget:VisibleUnitAdded(unitID, Spring.GetUnitDefID(unitID), spGetUnitTeam(unitID) ) + widget:VisibleUnitAdded(unitID, Spring.GetUnitDefID(unitID), spGetUnitTeam(unitID)) end end end @@ -312,44 +321,42 @@ end function widget:DrawWorld() --if spec and fullview then return end - if Spring.IsGUIHidden() or - (circleInstanceVBO.usedElements == 0) or - (opacity <= 0.01) - then return end - + if Spring.IsGUIHidden() or (circleInstanceVBO.usedElements == 0) or (opacity <= 0.01) then + return + end + --gl.Clear(GL.STENCIL_BUFFER_BIT) -- Preemtively clear the stencil buffer gl.StencilTest(true) -- Enable stencil testing gl.StencilFunc(GL_NOTEQUAL, 8, 8) -- Always Passes, 0 Bit Plane, 0 As Mask gl.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon gl.StencilMask(15) -- Only check the first bit of the stencil buffer - + jammerCircleShader:Activate() gl.Texture(0, "$heightmap") -- Bind the heightmap texture gl.Texture(1, jammerStencilTexture) -- Bind the heightmap texture - jammerCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity ) + jammerCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity) --spEcho("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1 )) jammerCircleShader:SetUniform("teamColorMix", 0) gl.LineWidth(rangeLineWidth * lineScale * 1.0) gl.DepthTest(true) - -- Note that we are skipping the first and last vertex, as those are the center of the circle : - circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -0, 0, circleInstanceVBO.usedElements) + -- Note that we are skipping the first and last vertex, as those are the center of the circle : + circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices - 0, 0, circleInstanceVBO.usedElements) -- TODO: In the future, when BASE VERTEX works, use the following line instead: - --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) - + --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) + jammerCircleShader:Deactivate() gl.Texture(0, false) gl.Texture(1, false) gl.DepthTest(true) gl.StencilTest(false) -- Disable stencil testing - gl.LineWidth(1.0) + gl.LineWidth(1.0) gl.Clear(GL.STENCIL_BUFFER_BIT) end - function widget:GetConfigData(data) return { opacity = opacity, diff --git a/luaui/Widgets/gui_sensor_ranges_los.lua b/luaui/Widgets/gui_sensor_ranges_los.lua index 651c748835c..dd52081e62f 100644 --- a/luaui/Widgets/gui_sensor_ranges_los.lua +++ b/luaui/Widgets/gui_sensor_ranges_los.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021.06.18", license = "GPLv2, (c) Beherith (mysterme@gmail.com)", layer = 20, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetViewGeometry = Spring.GetViewGeometry @@ -37,44 +36,42 @@ local gaiaTeamID = Spring.GetGaiaTeamID() -- TODO: draw ally ranges in diff color! -- 172 vs 123 preopt -- TODO 2023.07.06: - -- X Use drawpos - -- X Stencil outlines too - -- X remove debug code - -- X validate options! - -- X The only actual param needed per unit is its los range :D - -- X refactor the opacity +-- X Use drawpos +-- X Stencil outlines too +-- X remove debug code +-- X validate options! +-- X The only actual param needed per unit is its los range :D +-- X refactor the opacity -- TODO: 2025.07.02: - -- [x] rangecorrectionelmos = 16 - -- [ ] DO NOT DELETE BRANCH ON MERGE! - -- [x] Fix screen resize - -- [-] Engine Version Check for baseVertex offset - -- [x] Teamcolor no worky - -- [x] override master - -- [x] profile - -- [x] Correctly reset GL state for build ETA - -- [ ] Try to use only one stencil clear op, use a mask that is unique - -- [x] Put SDscreenSphere into LuaShader.lua - -- [-] Draw los in minimap, add config optios for it. - - +-- [x] rangecorrectionelmos = 16 +-- [ ] DO NOT DELETE BRANCH ON MERGE! +-- [x] Fix screen resize +-- [-] Engine Version Check for baseVertex offset +-- [x] Teamcolor no worky +-- [x] override master +-- [x] profile +-- [x] Correctly reset GL state for build ETA +-- [ ] Try to use only one stencil clear op, use a mask that is unique +-- [x] Put SDscreenSphere into LuaShader.lua +-- [-] Draw los in minimap, add config optios for it. local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local losStencilShader = nil local losCircleShader = nil local circleInstanceVBO = nil -local losStencilTexture +local losStencilTexture local resolution = 4 -local vsx, vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local circleShaderSourceCache = { - shaderName = 'LOS Ranges Circles GL4', + shaderName = "LOS Ranges Circles GL4", vssrcpath = "LuaUI/Shaders/sensor_ranges_los.vert.glsl", fssrcpath = "LuaUI/Shaders/sensor_ranges_los.frag.glsl", shaderConfig = { @@ -94,8 +91,8 @@ local circleShaderSourceCache = { rangeColor = rangeColor, }, silent = not debugmode, -- do not print shader compile timing -} - +} + local stencilShaderSourceCache = table.copy(circleShaderSourceCache) -- copy the circle shader source cache, and modify it for stencil pass stencilShaderSourceCache.shaderConfig.STENCILPASS = 1 -- this is a stencil pass @@ -104,7 +101,7 @@ local function goodbye(reason) widgetHandler:RemoveWidget() return false end - + local function CreateStencilShaderAndTexture() vsx, vsy = spGetViewGeometry() circleShaderSourceCache.shaderConfig.VSX = vsx @@ -114,23 +111,25 @@ local function CreateStencilShaderAndTexture() stencilShaderSourceCache.shaderConfig.VSY = vsy stencilShaderSourceCache.forceupdate = true - losStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) + losStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) if not losStencilShader then - return goodbye("Failed to compile losrange stencil shader GL4 ") - end - losCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) + return goodbye("Failed to compile losrange stencil shader GL4 ") + end + losCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) if not losCircleShader then return goodbye("Failed to compile losrange shader GL4 ") end local GL_R8 = 0x8229 - vsx, vsy = spGetViewGeometry() - lineScale = (vsy + 500)/ 1300 - if losStencilTexture then gl.DeleteTexture(losStencilTexture) end - losStencilTexture = gl.CreateTexture(vsx/resolution, vsy/resolution, { + vsx, vsy = spGetViewGeometry() + lineScale = (vsy + 500) / 1300 + if losStencilTexture then + gl.DeleteTexture(losStencilTexture) + end + losStencilTexture = gl.CreateTexture(vsx / resolution, vsy / resolution, { --format = GL.RGBA8, - format = GL_R8, + format = GL_R8, fbo = true, min_filter = GL.NEAREST, mag_filter = GL.LINEAR, @@ -144,8 +143,8 @@ local function initgl4() -- Note that we are createing a special Circle VBO, that starts at the center vertex! This is needed for triangle fans local circleVBO, numVertices = InstanceVBOTable.makeCircleVBO(circleSegments, nil, true, "LOSRangeCircles") local circleInstanceVBOLayout = { - { id = 1, name = 'radius_params', size = 4 }, -- radius, gameframe, 2 unused floats - { id = 2, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, -- instData + { id = 1, name = "radius_params", size = 4 }, -- radius, gameframe, 2 unused floats + { id = 2, name = "instData", size = 4, type = GL.UNSIGNED_INT }, -- instData } circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 128, "losrangeVBO", 2) @@ -155,15 +154,14 @@ local function initgl4() CreateStencilShaderAndTexture() end - - + local function DrawLOSStencil() -- about 0.025 ms if circleInstanceVBO.usedElements > 0 then - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.BlendEquation(GL.MAX) gl.Blending(GL.ONE, GL.ONE) - gl.Culling(false) - + gl.Culling(false) + gl.Texture(0, "$heightmap") -- Bind the heightmap texture losStencilShader:Activate() circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLE_FAN, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) @@ -174,21 +172,21 @@ local function DrawLOSStencil() -- about 0.025 ms end function widget:DrawGenesis() - gl.RenderToTexture(losStencilTexture, DrawLOSStencil) + gl.RenderToTexture(losStencilTexture, DrawLOSStencil) end -- This shows the debug stencil texture in the bottom left corner of the screen -if debugmode then - function widget:DrawScreen() - losCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) or losCircleShader - losStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) or losStencilShader - gl.Color(1,1,1,1) +if debugmode then + function widget:DrawScreen() + losCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) or losCircleShader + losStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) or losStencilShader + gl.Color(1, 1, 1, 1) gl.Blending(GL.ONE, GL.ZERO) gl.Texture(losStencilTexture) - gl.TexRect(0, 0, vsx/resolution, vsy/resolution, 0, 0, 1, 1) + gl.TexRect(0, 0, vsx / resolution, vsy / resolution, 0, 0, 1, 1) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end -end +end -- Functions shortcuts local spGetSpectatingState = Spring.GetSpectatingState @@ -215,16 +213,16 @@ end function widget:ViewResize(newX, newY) CreateStencilShaderAndTexture() -end +end -- a reusable table, since we will literally only modify its first element. -local instanceCache = {0,0,0,0,0,0,0,0} +local instanceCache = { 0, 0, 0, 0, 0, 0, 0, 0 } local function InitializeUnits() --spEcho("Sensor Ranges LOS InitializeUnits") InstanceVBOTable.clearInstanceTable(circleInstanceVBO) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID), nil, true) end @@ -249,41 +247,56 @@ function widget:Initialize() end WG.losrange = { - getOpacity = function() return opacity end, - setOpacity = function(value) opacity = value end, - getUseTeamColors = function() return useteamcolors end, - setUseTeamColors = function(value) useteamcolors = value end, + getOpacity = function() + return opacity + end, + setOpacity = function(value) + opacity = value + end, + getUseTeamColors = function() + return useteamcolors + end, + setUseTeamColors = function(value) + useteamcolors = value + end, } - initgl4() + initgl4() InitializeUnits() end function widget:Shutdown() - if losStencilTexture then gl.DeleteTexture(losStencilTexture) end + if losStencilTexture then + gl.DeleteTexture(losStencilTexture) + end WG.losrange = nil end -function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) +function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) --spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam, reason, noupload) unitTeam = unitTeam or spGetUnitTeam(unitID) noupload = noupload == true - if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then return end + if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then + return + end if (not (spec and fullview)) and (not spIsUnitAllied(unitID)) then -- given units are still considered allies :/ return end -- display mode for specs - if Spring.GetUnitIsBeingBuilt(unitID) then return end + if Spring.GetUnitIsBeingBuilt(unitID) then + return + end - instanceCache[1] = unitRange[unitDefID] + instanceCache[1] = unitRange[unitDefID] if reason == "UnitFinished" then instanceCache[2] = Spring.GetGameFrame() else instanceCache[2] = 0 -- start from full size end - pushElementInstance(circleInstanceVBO, + pushElementInstance( + circleInstanceVBO, instanceCache, unitID, --key true, -- updateExisting @@ -304,44 +317,42 @@ end function widget:DrawWorld() --if spec and fullview then return end - if Spring.IsGUIHidden() or - (circleInstanceVBO.usedElements == 0) or - (opacity <= 0.01) - then return end - + if Spring.IsGUIHidden() or (circleInstanceVBO.usedElements == 0) or (opacity <= 0.01) then + return + end + --gl.Clear(GL.STENCIL_BUFFER_BIT) -- Preemtively clear the stencil buffer gl.StencilTest(true) -- Enable stencil testing gl.StencilFunc(GL_NOTEQUAL, 1, 1) -- Always Passes, 0 Bit Plane, 0 As Mask gl.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon gl.StencilMask(15) -- Only check the first bit of the stencil buffer - + losCircleShader:Activate() gl.Texture(0, "$heightmap") -- Bind the heightmap texture gl.Texture(1, losStencilTexture) -- Bind the heightmap texture - losCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1 )) + losCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1)) --spEcho("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1 )) losCircleShader:SetUniform("teamColorMix", useteamcolors and 1 or 0) gl.LineWidth(rangeLineWidth * lineScale * 1.0) gl.DepthTest(true) - -- Note that we are skipping the first and last vertex, as those are the center of the circle : - circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -0, 0, circleInstanceVBO.usedElements) + -- Note that we are skipping the first and last vertex, as those are the center of the circle : + circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices - 0, 0, circleInstanceVBO.usedElements) -- TODO: In the future, when BASE VERTEX works, use the following line instead: - --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) - + --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) + losCircleShader:Deactivate() gl.Texture(0, false) gl.Texture(1, false) gl.DepthTest(true) gl.StencilTest(false) -- Disable stencil testing - gl.LineWidth(1.0) + gl.LineWidth(1.0) --gl.Clear(GL.STENCIL_BUFFER_BIT) end - function widget:GetConfigData(data) return { opacity = opacity, diff --git a/luaui/Widgets/gui_sensor_ranges_radar.lua b/luaui/Widgets/gui_sensor_ranges_radar.lua index f6bb1a1bf98..01158907866 100644 --- a/luaui/Widgets/gui_sensor_ranges_radar.lua +++ b/luaui/Widgets/gui_sensor_ranges_radar.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021.06.18", license = "GPLv2, (c) Beherith (mysterme@gmail.com)", layer = 19, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo @@ -36,25 +35,22 @@ local gaiaTeamID = Spring.GetGaiaTeamID() ------- GL4 NOTES ----- -- TODO: 2025.07.02: - - - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local radarStencilShader = nil local radarCircleShader = nil local circleInstanceVBO = nil -local radarStencilTexture +local radarStencilTexture local resolution = 4 -local vsx, vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local circleShaderSourceCache = { - shaderName = 'Radar Ranges Circles GL4', + shaderName = "Radar Ranges Circles GL4", vssrcpath = "LuaUI/Shaders/sensor_ranges_los.vert.glsl", fssrcpath = "LuaUI/Shaders/sensor_ranges_los.frag.glsl", shaderConfig = { @@ -74,18 +70,18 @@ local circleShaderSourceCache = { rangeColor = rangeColor, }, silent = not debugmode, -- do not print shader compile timing -} - +} + local stencilShaderSourceCache = table.copy(circleShaderSourceCache) -- copy the circle shader source cache, and modify it for stencil pass stencilShaderSourceCache.shaderConfig.STENCILPASS = 1 -- this is a stencil pass -stencilShaderSourceCache.shaderName = 'Radar Ranges Stencil GL4' +stencilShaderSourceCache.shaderName = "Radar Ranges Stencil GL4" local function goodbye(reason) spEcho("Sensor Ranges LOS widget exiting with reason: " .. reason) widgetHandler:RemoveWidget() return false end - + local function CreateStencilShaderAndTexture() vsx, vsy = spGetViewGeometry() circleShaderSourceCache.shaderConfig.VSX = vsx @@ -95,23 +91,25 @@ local function CreateStencilShaderAndTexture() stencilShaderSourceCache.shaderConfig.VSY = vsy stencilShaderSourceCache.forceupdate = true - radarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) + radarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) if not radarStencilShader then - return goodbye("Failed to compile radarrange stencil shader GL4 ") - end - radarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) + return goodbye("Failed to compile radarrange stencil shader GL4 ") + end + radarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) if not radarCircleShader then return goodbye("Failed to compile radarrange shader GL4 ") end local GL_R8 = 0x8229 - vsx, vsy = spGetViewGeometry() - lineScale = (vsy + 500)/ 1300 - if radarStencilTexture then gl.DeleteTexture(radarStencilTexture) end - radarStencilTexture = gl.CreateTexture(vsx/resolution, vsy/resolution, { + vsx, vsy = spGetViewGeometry() + lineScale = (vsy + 500) / 1300 + if radarStencilTexture then + gl.DeleteTexture(radarStencilTexture) + end + radarStencilTexture = gl.CreateTexture(vsx / resolution, vsy / resolution, { --format = GL.RGBA8, - format = GL_R8, + format = GL_R8, fbo = true, min_filter = GL.NEAREST, mag_filter = GL.LINEAR, @@ -125,8 +123,8 @@ local function initgl4() -- Note that we are createing a special Circle VBO, that starts at the center vertex! This is needed for triangle fans local circleVBO, numVertices = InstanceVBOTable.makeCircleVBO(circleSegments, nil, true, "radarrangeCircles") local circleInstanceVBOLayout = { - { id = 1, name = 'radius_params', size = 4 }, -- radius, gameframe, 2 unused floats - { id = 2, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, -- instData + { id = 1, name = "radius_params", size = 4 }, -- radius, gameframe, 2 unused floats + { id = 2, name = "instData", size = 4, type = GL.UNSIGNED_INT }, -- instData } circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 128, "radarrangeVBO", 2) @@ -136,15 +134,14 @@ local function initgl4() CreateStencilShaderAndTexture() end - - + local function DrawLOSStencil() -- about 0.025 ms if circleInstanceVBO.usedElements > 0 then - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.BlendEquation(GL.MAX) gl.Blending(GL.ONE, GL.ONE) - gl.Culling(false) - + gl.Culling(false) + gl.Texture(0, "$heightmap") -- Bind the heightmap texture radarStencilShader:Activate() circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLE_FAN, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) @@ -155,27 +152,27 @@ local function DrawLOSStencil() -- about 0.025 ms end function widget:DrawGenesis() - gl.RenderToTexture(radarStencilTexture, DrawLOSStencil) + gl.RenderToTexture(radarStencilTexture, DrawLOSStencil) end -- This shows the debug stencil texture in the bottom left corner of the screen -if debugmode then - function widget:DrawScreen() - radarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) or radarCircleShader - radarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) or radarStencilShader - gl.Color(1,1,1,1) +if debugmode then + function widget:DrawScreen() + radarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) or radarCircleShader + radarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) or radarStencilShader + gl.Color(1, 1, 1, 1) gl.Blending(GL.ONE, GL.ZERO) gl.Texture(radarStencilTexture) - gl.TexRect(0, 0, vsx/resolution, vsy/resolution, 0, 0, 1, 1) + gl.TexRect(0, 0, vsx / resolution, vsy / resolution, 0, 0, 1, 1) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end -end +end -- Functions shortcuts local spGetSpectatingState = Spring.GetSpectatingState local spIsUnitAllied = Spring.IsUnitAllied local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitIsActive = Spring.GetUnitIsActive +local spGetUnitIsActive = Spring.GetUnitIsActive local GL_NOTEQUAL = GL.NOTEQUAL local GL_LINE_LOOP = GL.LINE_LOOP local GL_KEEP = 0x1E00 --GL.KEEP @@ -191,23 +188,23 @@ local unitRange = {} -- table of unit types with their radar ranges local unitList = {} -- all ally units and their coordinates and radar ranges for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.radarDistance and unitDef.radarDistance > minRadarDistance then -- save perf by excluding low radar range units + if unitDef.radarDistance and unitDef.radarDistance > minRadarDistance then -- save perf by excluding low radar range units unitRange[unitDefID] = unitDef.radarDistance - rangecorrectionelmos end end function widget:ViewResize(newX, newY) CreateStencilShaderAndTexture() -end +end -- a reusable table, since we will literally only modify its first element. -local instanceCache = {0,0,0,0,0,0,0,0} +local instanceCache = { 0, 0, 0, 0, 0, 0, 0, 0 } local function InitializeUnits() --spEcho("Sensor Ranges LOS InitializeUnits") InstanceVBOTable.clearInstanceTable(circleInstanceVBO) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID), nil, true) end @@ -232,52 +229,62 @@ function widget:Initialize() end WG.radarrange = { - getOpacity = function() return opacity end, - setOpacity = function(value) opacity = value end, + getOpacity = function() + return opacity + end, + setOpacity = function(value) + opacity = value + end, } - initgl4() + initgl4() InitializeUnits() end function widget:Shutdown() - if radarStencilTexture then gl.DeleteTexture(radarStencilTexture) end + if radarStencilTexture then + gl.DeleteTexture(radarStencilTexture) + end WG.radarrange = nil end -function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) +function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) --spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam, reason, noupload) unitTeam = unitTeam or spGetUnitTeam(unitID) noupload = noupload == true - if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then return end + if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then + return + end if (not (spec and fullview)) and (not spIsUnitAllied(unitID)) then -- given units are still considered allies :/ return end -- display mode for specs - if Spring.GetUnitIsBeingBuilt(unitID) then return end + if Spring.GetUnitIsBeingBuilt(unitID) then + return + end - instanceCache[1] = unitRange[unitDefID] + instanceCache[1] = unitRange[unitDefID] - local active = spGetUnitIsActive(unitID) local gameFrame = spGetGameFrame() if reason == "UnitFinished" then - if active then + if active then instanceCache[2] = spGetGameFrame() else instanceCache[2] = -2 -- start from full size end else - if active then + if active then instanceCache[2] = gameFrame else - instanceCache[2] = -1 * gameFrame + instanceCache[2] = -1 * gameFrame end end unitList[unitID] = active - pushElementInstance(circleInstanceVBO, + pushElementInstance( + circleInstanceVBO, instanceCache, unitID, --key true, -- updateExisting @@ -298,13 +305,15 @@ function widget:VisibleUnitRemoved(unitID) end function widget:GameFrame(n) - if spec and fullview then return end - if n % 15 == 2 then + if spec and fullview then + return + end + if n % 15 == 2 then for unitID, oldActive in pairs(unitList) do local active = spGetUnitIsActive(unitID) if active ~= oldActive then unitList[unitID] = active - widget:VisibleUnitAdded(unitID, Spring.GetUnitDefID(unitID), spGetUnitTeam(unitID) ) + widget:VisibleUnitAdded(unitID, Spring.GetUnitDefID(unitID), spGetUnitTeam(unitID)) end end end @@ -312,44 +321,42 @@ end function widget:DrawWorld() --if spec and fullview then return end - if Spring.IsGUIHidden() or - (circleInstanceVBO.usedElements == 0) or - (opacity <= 0.01) - then return end - + if Spring.IsGUIHidden() or (circleInstanceVBO.usedElements == 0) or (opacity <= 0.01) then + return + end + --gl.Clear(GL.STENCIL_BUFFER_BIT) -- Preemtively clear the stencil buffer gl.StencilTest(true) -- Enable stencil testing gl.StencilFunc(GL_NOTEQUAL, 4, 4) -- Always Passes, 0 Bit Plane, 0 As Mask gl.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon gl.StencilMask(15) -- Only check the first bit of the stencil buffer - + radarCircleShader:Activate() gl.Texture(0, "$heightmap") -- Bind the heightmap texture gl.Texture(1, radarStencilTexture) -- Bind the heightmap texture - radarCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity ) + radarCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity) --spEcho("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1 )) radarCircleShader:SetUniform("teamColorMix", 0) gl.LineWidth(rangeLineWidth * lineScale * 1.0) gl.DepthTest(true) - -- Note that we are skipping the first and last vertex, as those are the center of the circle : - circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -0, 0, circleInstanceVBO.usedElements) + -- Note that we are skipping the first and last vertex, as those are the center of the circle : + circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices - 0, 0, circleInstanceVBO.usedElements) -- TODO: In the future, when BASE VERTEX works, use the following line instead: - --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) - + --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) + radarCircleShader:Deactivate() gl.Texture(0, false) gl.Texture(1, false) gl.DepthTest(true) gl.StencilTest(false) -- Disable stencil testing - gl.LineWidth(1.0) + gl.LineWidth(1.0) --gl.Clear(GL.STENCIL_BUFFER_BIT) end - function widget:GetConfigData(data) return { opacity = opacity, diff --git a/luaui/Widgets/gui_sensor_ranges_radar_preview.lua b/luaui/Widgets/gui_sensor_ranges_radar_preview.lua index ad67127f189..b17417527c3 100644 --- a/luaui/Widgets/gui_sensor_ranges_radar_preview.lua +++ b/luaui/Widgets/gui_sensor_ranges_radar_preview.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021.07.12", license = "GNU GPL v2", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor @@ -25,18 +24,17 @@ local spEcho = Spring.Echo local SHADERRESOLUTION = 16 -- THIS SHOULD MATCH RADARMIPLEVEL! -local smallradarrange = 2100 -- updates to 'armrad' value -local largeradarrange = 3500 -- updates to 'armarad' value +local smallradarrange = 2100 -- updates to 'armrad' value +local largeradarrange = 3500 -- updates to 'armarad' value local cmdidtoradarsize = {} local radaremitheight = {} -local radarYOffset = 50 -- amount added to vertical height of overlay to more closely reflect engine radarLOS +local radarYOffset = 50 -- amount added to vertical height of overlay to more closely reflect engine radarLOS -- Globals local mousepos = { 0, 0, 0 } local spGetActiveCommand = Spring.GetActiveCommand - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable @@ -47,10 +45,10 @@ local largeradVAO = nil local selectedRadarUnitID = false for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.name == 'armarad' then + if unitDef.name == "armarad" then largeradarrange = unitDef.radarDistance end - if unitDef.name == 'armrad' then + if unitDef.name == "armrad" then smallradarrange = unitDef.radarDistance end @@ -71,18 +69,18 @@ local vsSrcPath = "LuaUI/Shaders/sensor_ranges_radar_preview.vert.glsl" local fsSrcPath = "LuaUI/Shaders/sensor_ranges_radar_preview.frag.glsl" local shaderSourceCache = { - vssrcpath = vsSrcPath, - fssrcpath = fsSrcPath, - shaderName = "radarTruthShader GL4", - uniformInt = { - heightmapTex = 0, - }, - uniformFloat = { - radarcenter_range = { 2000, 100, 2000, 2000 }, - resolution = { 128 }, - }, - shaderConfig = shaderConfig, - } + vssrcpath = vsSrcPath, + fssrcpath = fsSrcPath, + shaderName = "radarTruthShader GL4", + uniformInt = { + heightmapTex = 0, + }, + uniformFloat = { + radarcenter_range = { 2000, 100, 2000, 2000 }, + resolution = { 128 }, + }, + shaderConfig = shaderConfig, +} local function goodbye(reason) spEcho("radarTruthShader GL4 widget exiting with reason: " .. reason) @@ -109,14 +107,13 @@ local function initgl4() largeradVAO:AttachIndexBuffer(largi) end - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() return end - if (smallradarrange > 2200) then + if smallradarrange > 2200 then spEcho("Sensor Ranges Radar Preview does not support increased radar ranges modoptions, removing.") widgetHandler:RemoveWidget() return @@ -149,7 +146,7 @@ function widget:DrawWorld() end -- not build command end - if Spring.IsGUIHidden() or (WG['topbar'] and WG['topbar'].showingQuit()) then + if Spring.IsGUIHidden() or (WG["topbar"] and WG["topbar"].showingQuit()) then return end @@ -171,12 +168,7 @@ function widget:DrawWorld() gl.Culling(GL.BACK) gl.Texture(0, "$heightmap") radarTruthShader:Activate() - radarTruthShader:SetUniform("radarcenter_range", - mathFloor((mousepos[1] + 8) / (SHADERRESOLUTION * 2)) * (SHADERRESOLUTION * 2), - mousepos[2] + radaremitheight[cmdID], - mathFloor((mousepos[3] + 8) / (SHADERRESOLUTION * 2)) * (SHADERRESOLUTION * 2), - whichradarsize == "small" and smallradarrange or largeradarrange - ) + radarTruthShader:SetUniform("radarcenter_range", mathFloor((mousepos[1] + 8) / (SHADERRESOLUTION * 2)) * (SHADERRESOLUTION * 2), mousepos[2] + radaremitheight[cmdID], mathFloor((mousepos[3] + 8) / (SHADERRESOLUTION * 2)) * (SHADERRESOLUTION * 2), whichradarsize == "small" and smallradarrange or largeradarrange) if whichradarsize == "small" then smallradVAO:DrawElements(GL.TRIANGLES) elseif whichradarsize == "large" then @@ -187,4 +179,4 @@ function widget:DrawWorld() gl.Texture(0, false) gl.Culling(false) gl.DepthTest(true) -end \ No newline at end of file +end diff --git a/luaui/Widgets/gui_sensor_ranges_sonar.lua b/luaui/Widgets/gui_sensor_ranges_sonar.lua index 8ed30effd15..3acc5e35174 100644 --- a/luaui/Widgets/gui_sensor_ranges_sonar.lua +++ b/luaui/Widgets/gui_sensor_ranges_sonar.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "2021.06.18", license = "GPLv2, (c) Beherith (mysterme@gmail.com)", layer = 18, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spEcho = Spring.Echo @@ -36,25 +35,22 @@ local gaiaTeamID = Spring.GetGaiaTeamID() ------- GL4 NOTES ----- -- TODO: 2025.07.02: - - - local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local sonarStencilShader = nil local sonarCircleShader = nil local circleInstanceVBO = nil -local sonarStencilTexture +local sonarStencilTexture local resolution = 4 -local vsx, vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local circleShaderSourceCache = { - shaderName = 'Sonar Ranges Circles GL4', + shaderName = "Sonar Ranges Circles GL4", vssrcpath = "LuaUI/Shaders/sensor_ranges_los.vert.glsl", fssrcpath = "LuaUI/Shaders/sensor_ranges_los.frag.glsl", shaderConfig = { @@ -75,18 +71,18 @@ local circleShaderSourceCache = { rangeColor = rangeColor, }, silent = not debugmode, -- do not print shader compile timing -} - +} + local stencilShaderSourceCache = table.copy(circleShaderSourceCache) -- copy the circle shader source cache, and modify it for stencil pass stencilShaderSourceCache.shaderConfig.STENCILPASS = 1 -- this is a stencil pass -stencilShaderSourceCache.shaderName = 'Sonar Ranges Stencil GL4' +stencilShaderSourceCache.shaderName = "Sonar Ranges Stencil GL4" local function goodbye(reason) spEcho("Sensor Ranges LOS widget exiting with reason: " .. reason) widgetHandler:RemoveWidget() return false end - + local function CreateStencilShaderAndTexture() vsx, vsy = spGetViewGeometry() circleShaderSourceCache.shaderConfig.VSX = vsx @@ -96,23 +92,25 @@ local function CreateStencilShaderAndTexture() stencilShaderSourceCache.shaderConfig.VSY = vsy stencilShaderSourceCache.forceupdate = true - sonarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) + sonarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) if not sonarStencilShader then - return goodbye("Failed to compile sonarrange stencil shader GL4 ") - end - sonarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) + return goodbye("Failed to compile sonarrange stencil shader GL4 ") + end + sonarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) if not sonarCircleShader then return goodbye("Failed to compile sonarrange shader GL4 ") end local GL_R8 = 0x8229 - vsx, vsy = spGetViewGeometry() - lineScale = (vsy + 500)/ 1300 - if sonarStencilTexture then gl.DeleteTexture(sonarStencilTexture) end - sonarStencilTexture = gl.CreateTexture(vsx/resolution, vsy/resolution, { + vsx, vsy = spGetViewGeometry() + lineScale = (vsy + 500) / 1300 + if sonarStencilTexture then + gl.DeleteTexture(sonarStencilTexture) + end + sonarStencilTexture = gl.CreateTexture(vsx / resolution, vsy / resolution, { --format = GL.RGBA8, - format = GL_R8, + format = GL_R8, fbo = true, min_filter = GL.NEAREST, mag_filter = GL.LINEAR, @@ -126,8 +124,8 @@ local function initgl4() -- Note that we are createing a special Circle VBO, that starts at the center vertex! This is needed for triangle fans local circleVBO, numVertices = InstanceVBOTable.makeCircleVBO(circleSegments, nil, true, "sonarrangeCircles") local circleInstanceVBOLayout = { - { id = 1, name = 'radius_params', size = 4 }, -- radius, gameframe, 2 unused floats - { id = 2, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, -- instData + { id = 1, name = "radius_params", size = 4 }, -- radius, gameframe, 2 unused floats + { id = 2, name = "instData", size = 4, type = GL.UNSIGNED_INT }, -- instData } circleInstanceVBO = InstanceVBOTable.makeInstanceVBOTable(circleInstanceVBOLayout, 128, "sonarrangeVBO", 2) @@ -137,15 +135,14 @@ local function initgl4() CreateStencilShaderAndTexture() end - - + local function DrawLOSStencil() -- about 0.025 ms if circleInstanceVBO.usedElements > 0 then - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Clear(GL.COLOR_BUFFER_BIT, 0, 0, 0, 0) gl.BlendEquation(GL.MAX) gl.Blending(GL.ONE, GL.ONE) - gl.Culling(false) - + gl.Culling(false) + gl.Texture(0, "$heightmap") -- Bind the heightmap texture sonarStencilShader:Activate() circleInstanceVBO.VAO:DrawArrays(GL.TRIANGLE_FAN, circleInstanceVBO.numVertices, 0, circleInstanceVBO.usedElements, 0) @@ -156,28 +153,28 @@ local function DrawLOSStencil() -- about 0.025 ms end function widget:DrawGenesis() - gl.RenderToTexture(sonarStencilTexture, DrawLOSStencil) + gl.RenderToTexture(sonarStencilTexture, DrawLOSStencil) end -- This shows the debug stencil texture in the bottom left corner of the screen -if debugmode then - function widget:DrawScreen() - sonarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache,0) or sonarCircleShader - sonarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache,0) or sonarStencilShader - gl.Color(1,1,1,1) +if debugmode then + function widget:DrawScreen() + sonarCircleShader = LuaShader.CheckShaderUpdates(circleShaderSourceCache, 0) or sonarCircleShader + sonarStencilShader = LuaShader.CheckShaderUpdates(stencilShaderSourceCache, 0) or sonarStencilShader + gl.Color(1, 1, 1, 1) gl.Blending(GL.ONE, GL.ZERO) gl.Texture(sonarStencilTexture) - gl.TexRect(0, 0, vsx/resolution, vsy/resolution, 0, 0, 1, 1) + gl.TexRect(0, 0, vsx / resolution, vsy / resolution, 0, 0, 1, 1) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end -end +end -- Functions shortcuts local spGetSpectatingState = Spring.GetSpectatingState local spGetUnitDefID = Spring.GetUnitDefID local spIsUnitAllied = Spring.IsUnitAllied local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitIsActive = Spring.GetUnitIsActive +local spGetUnitIsActive = Spring.GetUnitIsActive local GL_NOTEQUAL = GL.NOTEQUAL local GL_LINE_LOOP = GL.LINE_LOOP local GL_KEEP = 0x1E00 --GL.KEEP @@ -193,10 +190,10 @@ local unitRange = {} -- table of unit types with their sonar ranges local unitList = {} -- all ally units and their coordinates and sonar ranges for unitDefID, unitDef in pairs(UnitDefs) do - if unitDef.sonarDistance and unitDef.sonarDistance >= minSonarDistance then -- save perf by excluding low sonar range units - if string.find(unitDef.name, "raptor", nil, true) then + if unitDef.sonarDistance and unitDef.sonarDistance >= minSonarDistance then -- save perf by excluding low sonar range units + if string.find(unitDef.name, "raptor", nil, true) then -- skip raptors from sonar - else + else unitRange[unitDefID] = unitDef.sonarDistance end end @@ -204,16 +201,16 @@ end function widget:ViewResize(newX, newY) CreateStencilShaderAndTexture() -end +end -- a reusable table, since we will literally only modify its first element. -local instanceCache = {0,0,0,0,0,0,0,0} +local instanceCache = { 0, 0, 0, 0, 0, 0, 0, 0 } local function InitializeUnits() --spEcho("Sensor Ranges LOS InitializeUnits") InstanceVBOTable.clearInstanceTable(circleInstanceVBO) - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - local visibleUnits = WG['unittrackerapi'].visibleUnits + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + local visibleUnits = WG["unittrackerapi"].visibleUnits for unitID, unitDefID in pairs(visibleUnits) do widget:VisibleUnitAdded(unitID, unitDefID, spGetUnitTeam(unitID), nil, true) end @@ -242,51 +239,62 @@ function widget:Initialize() end WG.sonarrange = { - getOpacity = function() return opacity end, - setOpacity = function(value) opacity = value end, + getOpacity = function() + return opacity + end, + setOpacity = function(value) + opacity = value + end, } - initgl4() + initgl4() InitializeUnits() end function widget:Shutdown() - if sonarStencilTexture then gl.DeleteTexture(sonarStencilTexture) end + if sonarStencilTexture then + gl.DeleteTexture(sonarStencilTexture) + end WG.sonarrange = nil end -function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) +function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam, reason, noupload) --spEcho("widget:VisibleUnitAdded",unitID, unitDefID, unitTeam, reason, noupload) unitTeam = unitTeam or spGetUnitTeam(unitID) noupload = noupload == true - if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then return end + if unitRange[unitDefID] == nil or unitTeam == gaiaTeamID then + return + end if (not (spec and fullview)) and (not spIsUnitAllied(unitID)) then -- given units are still considered allies :/ return end -- display mode for specs - if Spring.GetUnitIsBeingBuilt(unitID) then return end + if Spring.GetUnitIsBeingBuilt(unitID) then + return + end - instanceCache[1] = unitRange[unitDefID] + instanceCache[1] = unitRange[unitDefID] local active = spGetUnitIsActive(unitID) local gameFrame = spGetGameFrame() if reason == "UnitFinished" then - if active then + if active then instanceCache[2] = spGetGameFrame() else instanceCache[2] = -2 -- start from full size end else - if active then + if active then instanceCache[2] = gameFrame else - instanceCache[2] = -1 * gameFrame + instanceCache[2] = -1 * gameFrame end end unitList[unitID] = active - pushElementInstance(circleInstanceVBO, + pushElementInstance( + circleInstanceVBO, instanceCache, unitID, --key true, -- updateExisting @@ -307,13 +315,15 @@ function widget:VisibleUnitRemoved(unitID) end function widget:GameFrame(n) - if spec and fullview then return end + if spec and fullview then + return + end if n % 15 == 2 then for unitID, oldActive in pairs(unitList) do local active = spGetUnitIsActive(unitID) if active ~= oldActive then unitList[unitID] = active - widget:VisibleUnitAdded(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID) ) + widget:VisibleUnitAdded(unitID, spGetUnitDefID(unitID), spGetUnitTeam(unitID)) end end end @@ -321,44 +331,42 @@ end function widget:DrawWorld() --if spec and fullview then return end - if Spring.IsGUIHidden() or - (circleInstanceVBO.usedElements == 0) or - (opacity <= 0.01) - then return end - + if Spring.IsGUIHidden() or (circleInstanceVBO.usedElements == 0) or (opacity <= 0.01) then + return + end + --gl.Clear(GL.STENCIL_BUFFER_BIT) -- Preemtively clear the stencil buffer gl.StencilTest(true) -- Enable stencil testing gl.StencilFunc(GL_NOTEQUAL, 2, 2) -- Always Passes, 0 Bit Plane, 0 As Mask gl.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon gl.StencilMask(15) -- Only check the first bit of the stencil buffer - + sonarCircleShader:Activate() gl.Texture(0, "$heightmap") -- Bind the heightmap texture gl.Texture(1, sonarStencilTexture) -- Bind the heightmap texture - sonarCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity ) + sonarCircleShader:SetUniform("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity) --spEcho("rangeColor", rangeColor[1], rangeColor[2], rangeColor[3], opacity * (useteamcolors and 2 or 1 )) sonarCircleShader:SetUniform("teamColorMix", 0) gl.LineWidth(rangeLineWidth * lineScale * 1.0) gl.DepthTest(true) - -- Note that we are skipping the first and last vertex, as those are the center of the circle : - circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -0, 0, circleInstanceVBO.usedElements) + -- Note that we are skipping the first and last vertex, as those are the center of the circle : + circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices - 0, 0, circleInstanceVBO.usedElements) -- TODO: In the future, when BASE VERTEX works, use the following line instead: - --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) - + --circleInstanceVBO.VAO:DrawArrays(GL_LINE_LOOP, circleInstanceVBO.numVertices -2, 1, circleInstanceVBO.usedElements) + sonarCircleShader:Deactivate() gl.Texture(0, false) gl.Texture(1, false) gl.DepthTest(true) gl.StencilTest(false) -- Disable stencil testing - gl.LineWidth(1.0) + gl.LineWidth(1.0) --gl.Clear(GL.STENCIL_BUFFER_BIT) end - function widget:GetConfigData(data) return { opacity = opacity, diff --git a/luaui/Widgets/gui_show_orders.lua b/luaui/Widgets/gui_show_orders.lua index b0fcc26dd21..678fbb720d7 100644 --- a/luaui/Widgets/gui_show_orders.lua +++ b/luaui/Widgets/gui_show_orders.lua @@ -1,16 +1,15 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Show Orders", - desc = "Hold shift+meta to show allied units orders", - author = "Niobium", - date = "date", - version = 1.2, - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Show Orders", + desc = "Hold shift+meta to show allied units orders", + author = "Niobium", + date = "date", + version = 1.2, + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -30,11 +29,10 @@ end -- 12. Allied units tracking via callins (eliminates per-frame spGetTeamUnits calls) ----------------------------------------------------- - -- Localized Spring API for performance local spGetViewGeometry = Spring.GetViewGeometry -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() local widgetScale = vsy / 2000 ----------------------------------------------------- @@ -53,17 +51,17 @@ local updateInterval = 10 -- Distance-based scaling configuration local enableDistanceScaling = true -- Set to false to disable distance scaling for better performance -local minScaleDistance = 500 -- Distance at which icons start scaling down -local maxScaleDistance = 3000 -- Distance at which icons are at minimum scale -local minScale = 0.3 -- Minimum scale factor (0.3 = 30% of original size) -local maxScale = 1.0 -- Maximum scale factor (1.0 = 100% of original size) +local minScaleDistance = 500 -- Distance at which icons start scaling down +local maxScaleDistance = 3000 -- Distance at which icons are at minimum scale +local minScale = 0.3 -- Minimum scale factor (0.3 = 30% of original size) +local maxScale = 1.0 -- Maximum scale factor (1.0 = 100% of original size) -- Note: Distance scaling is calculated every frame for responsive zoom, but it's relatively cheap ----------------------------------------------------- -- Globals ----------------------------------------------------- local isFactory = {} -local GaiaTeamID = Spring.GetGaiaTeamID() -- set to -1 to include Gaia units +local GaiaTeamID = Spring.GetGaiaTeamID() -- set to -1 to include Gaia units local font, chobbyInterface @@ -151,16 +149,16 @@ local spGetTeamUnits = Spring.GetTeamUnits local spGetMyAllyTeamID = Spring.GetMyAllyTeamID local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition -local spWorldToScreenCoords = Spring.WorldToScreenCoords +local spWorldToScreenCoords = Spring.WorldToScreenCoords local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt local spGetUnitStates = Spring.GetUnitStates local spGetCameraPosition = Spring.GetCameraPosition local spGetTeamInfo = Spring.GetTeamInfo -local glColor = gl.Color -local glTexture = gl.Texture -local glTexRect = gl.TexRect -local glRect = gl.Rect +local glColor = gl.Color +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glRect = gl.Rect local max = math.max local min = math.min @@ -173,13 +171,15 @@ local sqrt = math.sqrt -- Calculate distance-based scale factor for icons local function GetDistanceScale(unitX, unitY, unitZ) local camX, camY, camZ = spGetCameraPosition() - if not camX then return maxScale end + if not camX then + return maxScale + end -- Calculate 3D distance from camera to unit local dx = unitX - camX local dy = unitY - camY local dz = unitZ - camZ - local distance = sqrt(dx*dx + dy*dy + dz*dz) + local distance = sqrt(dx * dx + dy * dy + dz * dz) -- Scale linearly between min and max distances if distance <= minScaleDistance then @@ -194,9 +194,9 @@ local function GetDistanceScale(unitX, unitY, unitZ) end function widget:ViewResize() - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() widgetScale = vsy / 2000 - font = WG['fonts'].getFont(2) + font = WG["fonts"].getFont(2) -- Pre-calculate scaled values cachedScaledValues.iconSize = iconSize * widgetScale @@ -236,7 +236,9 @@ local function InvalidateFactoryCache() end local function UpdateFactoryCache() - if not factoryUnitsDirty then return end + if not factoryUnitsDirty then + return + end -- Clear old cache for i = 1, #factoryUnits do @@ -351,18 +353,22 @@ function widget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) end function widget:DrawWorld() - if chobbyInterface then return end + if chobbyInterface then + return + end local _, _, meta, shift = spGetModKeyState() - if not (shift and meta) then return end + if not (shift and meta) then + return + end -- Draw commands for all tracked allied units spDrawUnitCommands(alliedUnits) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end @@ -387,17 +393,17 @@ local function UpdateRenderData() local uDefID = spGetUnitDefID(uID) if uDefID then local isBuilding, progress = spGetUnitIsBeingBuilt(uID) - local uCmds = spGetFactoryCommands(uID,-1) + local uCmds = spGetFactoryCommands(uID, -1) local cells = getCellsArray() - if (isBuilding) then + if isBuilding then local cell = getCell() cell.texture = "#" .. uDefID cell.text = percentStrings[floor(progress * 100)] or (floor(progress * 100) .. "%") cells[1] = cell else - if (#uCmds == 0) then + if #uCmds == 0 then local cell = getCell() cell.texture = "#" .. uDefID cell.text = idleString @@ -405,17 +411,17 @@ local function UpdateRenderData() end end - if (#uCmds > 0) then + if #uCmds > 0 then local uCount = 0 local prevID = -1000 for c = 1, #uCmds do local cDefID = -uCmds[c].id - if (cDefID == prevID) then + if cDefID == prevID then uCount = uCount + 1 else - if (prevID > 0) then + if prevID > 0 then local cell = getCell() cell.texture = "#" .. prevID local count = uCount + 1 @@ -428,7 +434,7 @@ local function UpdateRenderData() prevID = cDefID end - if (prevID > 0) then + if prevID > 0 then local cell = getCell() cell.texture = "#" .. prevID local count = uCount + 1 @@ -438,13 +444,13 @@ local function UpdateRenderData() end -- Cache repeat state - local isRepeat = select(4,spGetUnitStates(uID,false,true)) + local isRepeat = select(4, spGetUnitStates(uID, false, true)) -- Store render data (scale will be calculated per-frame for smooth zoom response) local renderData = { unitID = uID, cells = cells, - isRepeat = isRepeat + isRepeat = isRepeat, } cachedRenderData[#cachedRenderData + 1] = renderData end @@ -454,10 +460,14 @@ local function UpdateRenderData() end function widget:DrawScreen() - if chobbyInterface then return end + if chobbyInterface then + return + end local _, _, meta, shift = spGetModKeyState() - if not (shift and meta) then return end + if not (shift and meta) then + return + end -- Frame throttling - only update data every N frames, but always render frameCounter = frameCounter + 1 @@ -513,13 +523,14 @@ function widget:DrawScreen() for r = 0, maxRows - 1 do for c = 1, maxColumns do local cell = cells[maxColumns * r + c] - if not cell then break end + if not cell then + break + end local cx = sx + (c - 1) * scaledIconPlusBorder local cy = sy - r * scaledIconPlusBorder - glRect(cx, cy, cx + scaledIconSize + scaledBorder2x, - cy - scaledIconSize - scaledBorder2x) + glRect(cx, cy, cx + scaledIconSize + scaledBorder2x, cy - scaledIconSize - scaledBorder2x) end end @@ -530,16 +541,17 @@ function widget:DrawScreen() for r = 0, maxRows - 1 do for c = 1, maxColumns do local cell = cells[maxColumns * r + c] - if not cell then break end + if not cell then + break + end local cx = sx + (c - 1) * scaledIconPlusBorder local cy = sy - r * scaledIconPlusBorder glTexture(cell.texture) - glTexRect(cx + scaledBorderWidth, cy - scaledIconSize - scaledBorderWidth, - cx + scaledIconSize + scaledBorderWidth, cy - scaledBorderWidth) + glTexRect(cx + scaledBorderWidth, cy - scaledIconSize - scaledBorderWidth, cx + scaledIconSize + scaledBorderWidth, cy - scaledBorderWidth) - if (cell.text) then + if cell.text then -- Queue text for batched rendering textDrawQueueSize = textDrawQueueSize + 1 local textEntry = textDrawQueue[textDrawQueueSize] @@ -564,10 +576,10 @@ function widget:DrawScreen() if textDrawQueueSize > 0 then font:Begin() font:SetOutlineColor(0, 0, 0, 1) - font:SetTextColor(0.9,0.9,0.9, 1) + font:SetTextColor(0.9, 0.9, 0.9, 1) for i = 1, textDrawQueueSize do local entry = textDrawQueue[i] - font:Print(entry.text, entry.x, entry.y, entry.size, 'ob') + font:Print(entry.text, entry.x, entry.y, entry.size, "ob") end font:End() end diff --git a/luaui/Widgets/gui_spec_next_alive_player.lua b/luaui/Widgets/gui_spec_next_alive_player.lua index e2304e0e396..4ad3e220b33 100644 --- a/luaui/Widgets/gui_spec_next_alive_player.lua +++ b/luaui/Widgets/gui_spec_next_alive_player.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = 'Spectate Next Alive Player', - desc = 'Auto spectate another alive player when currently selected player died', - author = 'Floris', - date = 'February 2024', - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Spectate Next Alive Player", + desc = "Auto spectate another alive player when currently selected player died", + author = "Floris", + date = "February 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -23,9 +22,9 @@ local processTeamDiedFrame, processTeamDiedTeamID local function switchToTeam(teamID) local oldMapDrawMode = Spring.GetMapDrawMode() Spring.SelectUnitArray({}) - Spring.SendCommands('specteam ' .. teamID) + Spring.SendCommands("specteam " .. teamID) local newMapDrawMode = Spring.GetMapDrawMode() - if oldMapDrawMode == 'los' and oldMapDrawMode ~= newMapDrawMode then + if oldMapDrawMode == "los" and oldMapDrawMode ~= newMapDrawMode then Spring.SendCommands("togglelos") end end @@ -59,17 +58,17 @@ function widget:TeamDied(teamID) if spec and spGetMyTeamID() == teamID then processTeamDiedFrame = spGetGameFrame() + 1 processTeamDiedTeamID = teamID - widgetHandler:UpdateCallIn('GameFrame') + widgetHandler:UpdateCallIn("GameFrame") end end function widget:PlayerChanged(playerID) local spec = spGetSpectatingState() - local _, _, _, teamID = Spring.GetPlayerInfo(playerID, false) -- player can be spec here and team not be dead still + local _, _, _, teamID = Spring.GetPlayerInfo(playerID, false) -- player can be spec here and team not be dead still if spec and teamID and spGetMyTeamID() == teamID then processTeamDiedFrame = spGetGameFrame() + 1 processTeamDiedTeamID = teamID - widgetHandler:UpdateCallIn('GameFrame') + widgetHandler:UpdateCallIn("GameFrame") end end @@ -79,5 +78,5 @@ function widget:GameFrame(f) processTeamDiedFrame = nil processTeamDiedTeamID = nil end - widgetHandler:RemoveCallIn('GameFrame') + widgetHandler:RemoveCallIn("GameFrame") end diff --git a/luaui/Widgets/gui_spectate_selected.lua b/luaui/Widgets/gui_spectate_selected.lua index c95246fc45c..f7dcd7dfaa4 100644 --- a/luaui/Widgets/gui_spectate_selected.lua +++ b/luaui/Widgets/gui_spectate_selected.lua @@ -2,18 +2,17 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = 'Spectate Selected', - desc = 'Automatically spectates owner of selected unit', - author = 'Niobium', - version = '1.0', - date = 'April 2011', - license = 'GNU GPL v2', - layer = 0, - enabled = true + name = "Spectate Selected", + desc = "Automatically spectates owner of selected unit", + author = "Niobium", + version = "1.0", + date = "April 2011", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID local spGetSpectatingState = Spring.GetSpectatingState @@ -45,12 +44,11 @@ local sec = 0 function widget:Update(dt) if spec then sec = sec + dt - if sec > 1.5 and switchToTeam ~= nil then -- added a delay cause doing too quick changes is perf costly, happens when you area drag lots of mixed team units - + if sec > 1.5 and switchToTeam ~= nil then -- added a delay cause doing too quick changes is perf costly, happens when you area drag lots of mixed team units local oldMapDrawMode = Spring.GetMapDrawMode() - Spring.SendCommands('specteam ' .. switchToTeam) + Spring.SendCommands("specteam " .. switchToTeam) local newMapDrawMode = Spring.GetMapDrawMode() - if oldMapDrawMode == 'los' and oldMapDrawMode ~= newMapDrawMode then + if oldMapDrawMode == "los" and oldMapDrawMode ~= newMapDrawMode then Spring.SendCommands("togglelos") end diff --git a/luaui/Widgets/gui_spectatingstats.lua b/luaui/Widgets/gui_spectatingstats.lua index 6f301922d70..aa1eb994054 100644 --- a/luaui/Widgets/gui_spectatingstats.lua +++ b/luaui/Widgets/gui_spectatingstats.lua @@ -2,19 +2,19 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Spectating Stats", - desc = "", - author = "Floris", - date = "April 2023", - license = "", - layer = 0, - enabled = false, + name = "Spectating Stats", + desc = "", + author = "Floris", + date = "April 2023", + license = "", + layer = 0, + enabled = false, } end local lastupdate = os.clock() - 10 local allyTeamList = Spring.GetAllyTeamList() -local numAllyTeams = #allyTeamList-1 +local numAllyTeams = #allyTeamList - 1 local allyTeamName = {} local textcolor = "\255\200\200\200" @@ -84,8 +84,8 @@ local function GetAllyTeamStats(allyTeamID) local buildspeed = 0 if not allyTeamName[allyTeamID] then local _, playerID, _, isAiTeam = Spring.GetTeamInfo(teamlist[1], false) - local name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID) or Spring.GetPlayerInfo(playerID, false) - allyTeamName[allyTeamID] = ColorString(Spring.GetTeamColor(teamlist[1]))..name + local name = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID) or Spring.GetPlayerInfo(playerID, false) + allyTeamName[allyTeamID] = ColorString(Spring.GetTeamColor(teamlist[1])) .. name end for i, teamID in ipairs(teamlist) do local units = Spring.GetTeamUnits(teamID) @@ -114,7 +114,7 @@ function widget:DrawScreen() for i, allyTeamID in ipairs(allyTeamList) do if i <= numAllyTeams then local unitCount, armyCount, armyDps, defenseCount, defenseDps, builders, buildspeed = GetAllyTeamStats(allyTeamID) - local text = string.format(allyTeamName[allyTeamID]..textcolor..": %d units, %d army (%d DPS), defenses %d (%d DPS), builders %d (%d bp)", unitCount, armyCount, armyDps, defenseCount, defenseDps, builders, buildspeed) + local text = string.format(allyTeamName[allyTeamID] .. textcolor .. ": %d units, %d army (%d DPS), defenses %d (%d DPS), builders %d (%d bp)", unitCount, armyCount, armyDps, defenseCount, defenseDps, builders, buildspeed) Spring.Echo(text) end end @@ -122,9 +122,7 @@ function widget:DrawScreen() end function widget:GetConfigData() - return { - } + return {} end -function widget:SetConfigData(data) -end +function widget:SetConfigData(data) end diff --git a/luaui/Widgets/gui_spectator_hud.lua b/luaui/Widgets/gui_spectator_hud.lua index 6d598548ebc..efc1565ede2 100644 --- a/luaui/Widgets/gui_spectator_hud.lua +++ b/luaui/Widgets/gui_spectator_hud.lua @@ -9,11 +9,10 @@ function widget:GetInfo() license = "GNU GPL v3 (or later)", layer = 2, -- after eco stats widget which is on layer 1; see Initialize() handler = true, - enabled = false + enabled = false, } end - -- Localized functions for performance local mathSin = math.sin local mathCos = math.cos @@ -206,7 +205,7 @@ local settings = { useMovingAverage = false, movingAverageWindowSize = 16, - statsUpdateFrequency = 2, -- every 2nd frame + statsUpdateFrequency = 2, -- every 2nd frame widgetScale = 0.8, widgetConfig = constants.configLevel.basic, @@ -235,28 +234,28 @@ local metricKeys = { } local metricsAvailable = { - { key="metalIncome", configLevel=constants.configLevel.basic, text="M/s" }, - { key="reclaimMetalIncome", configLevel=constants.configLevel.unavailable, text="MR" }, - { key="energyConversionMetalIncome", configLevel=constants.configLevel.unavailable, text="EC" }, - { key="energyIncome", configLevel=constants.configLevel.basic, text="E/s" }, - { key="reclaimEnergyIncome", configLevel=constants.configLevel.unavailable, text="ER" }, - { key="buildPower", configLevel=constants.configLevel.expert, text="BP" }, - { key="metalProduced", configLevel=constants.configLevel.basic, text="MP" }, - { key="energyProduced", configLevel=constants.configLevel.basic, text="EP" }, - { key="metalExcess", configLevel=constants.configLevel.expert, text="ME" }, - { key="energyExcess", configLevel=constants.configLevel.expert, text="EE" }, - { key="armyValue", configLevel=constants.configLevel.basic, text="AV" }, - { key="defenseValue", configLevel=constants.configLevel.advanced, text="DV" }, - { key="utilityValue", configLevel=constants.configLevel.unavailable, text="UV" }, - { key="economyValue", configLevel=constants.configLevel.expert, text="EV" }, - { key="damageDealt", configLevel=constants.configLevel.advanced, text="Dmg" }, - { key="damageReceived", configLevel=constants.configLevel.unavailable, text="DR" }, - { key="damageEfficiency", configLevel=constants.configLevel.unavailable, text="D%" }, + { key = "metalIncome", configLevel = constants.configLevel.basic, text = "M/s" }, + { key = "reclaimMetalIncome", configLevel = constants.configLevel.unavailable, text = "MR" }, + { key = "energyConversionMetalIncome", configLevel = constants.configLevel.unavailable, text = "EC" }, + { key = "energyIncome", configLevel = constants.configLevel.basic, text = "E/s" }, + { key = "reclaimEnergyIncome", configLevel = constants.configLevel.unavailable, text = "ER" }, + { key = "buildPower", configLevel = constants.configLevel.expert, text = "BP" }, + { key = "metalProduced", configLevel = constants.configLevel.basic, text = "MP" }, + { key = "energyProduced", configLevel = constants.configLevel.basic, text = "EP" }, + { key = "metalExcess", configLevel = constants.configLevel.expert, text = "ME" }, + { key = "energyExcess", configLevel = constants.configLevel.expert, text = "EE" }, + { key = "armyValue", configLevel = constants.configLevel.basic, text = "AV" }, + { key = "defenseValue", configLevel = constants.configLevel.advanced, text = "DV" }, + { key = "utilityValue", configLevel = constants.configLevel.unavailable, text = "UV" }, + { key = "economyValue", configLevel = constants.configLevel.expert, text = "EV" }, + { key = "damageDealt", configLevel = constants.configLevel.advanced, text = "Dmg" }, + { key = "damageReceived", configLevel = constants.configLevel.unavailable, text = "DR" }, + { key = "damageEfficiency", configLevel = constants.configLevel.unavailable, text = "D%" }, } local metricsEnabled = {} -- set defaults before loading values from config -for _,metric in ipairs(metricsAvailable) do +for _, metric in ipairs(metricsAvailable) do settings.metricsEnabled[metric.key] = metric.configLevel == constants.configLevel.basic end @@ -304,7 +303,7 @@ local function buildUnitDefs() end local function isEconomyBuilding(unitDefID, unitDef) - return (unitDef.customParams.unitgroup == 'metal') or (unitDef.customParams.unitgroup == 'energy') + return (unitDef.customParams.unitgroup == "metal") or (unitDef.customParams.unitgroup == "energy") end local function isUtilityUnit(unitDefID, unitDef) @@ -372,32 +371,25 @@ local function addToUnitCache(teamID, unitID, unitDefID) end if unitDefsToTrack.reclaimerUnitDefs[unitDefID] then - addToUnitCacheInternal("reclaimerUnits", teamID, unitID, - unitDefsToTrack.reclaimerUnitDefs[unitDefID]) + addToUnitCacheInternal("reclaimerUnits", teamID, unitID, unitDefsToTrack.reclaimerUnitDefs[unitDefID]) end if unitDefsToTrack.energyConverterDefs[unitDefID] then - addToUnitCacheInternal("energyConverters", teamID, unitID, - unitDefsToTrack.energyConverterDefs[unitDefID]) + addToUnitCacheInternal("energyConverters", teamID, unitID, unitDefsToTrack.energyConverterDefs[unitDefID]) end if unitDefsToTrack.buildPowerDefs[unitDefID] then - addToUnitCacheInternal("buildPower", teamID, unitID, - unitDefsToTrack.buildPowerDefs[unitDefID]) + addToUnitCacheInternal("buildPower", teamID, unitID, unitDefsToTrack.buildPowerDefs[unitDefID]) end if unitDefsToTrack.armyUnitDefs[unitDefID] then - addToUnitCacheInternal("armyUnits", teamID, unitID, - unitDefsToTrack.armyUnitDefs[unitDefID]) + addToUnitCacheInternal("armyUnits", teamID, unitID, unitDefsToTrack.armyUnitDefs[unitDefID]) end if unitDefsToTrack.defenseUnitDefs[unitDefID] then - addToUnitCacheInternal("defenseUnits", teamID, unitID, - unitDefsToTrack.defenseUnitDefs[unitDefID]) + addToUnitCacheInternal("defenseUnits", teamID, unitID, unitDefsToTrack.defenseUnitDefs[unitDefID]) end if unitDefsToTrack.utilityUnitDefs[unitDefID] then - addToUnitCacheInternal("utilityUnits", teamID, unitID, - unitDefsToTrack.utilityUnitDefs[unitDefID]) + addToUnitCacheInternal("utilityUnits", teamID, unitID, unitDefsToTrack.utilityUnitDefs[unitDefID]) end if unitDefsToTrack.economyBuildingDefs[unitDefID] then - addToUnitCacheInternal("economyBuildings", teamID, unitID, - unitDefsToTrack.economyBuildingDefs[unitDefID]) + addToUnitCacheInternal("economyBuildings", teamID, unitID, unitDefsToTrack.economyBuildingDefs[unitDefID]) end end @@ -422,32 +414,25 @@ local function removeFromUnitCache(teamID, unitID, unitDefID) end if unitDefsToTrack.reclaimerUnitDefs[unitDefID] then - removeFromUnitCacheInternal("reclaimerUnits", teamID, unitID, - unitDefsToTrack.reclaimerUnitDefs[unitDefID]) + removeFromUnitCacheInternal("reclaimerUnits", teamID, unitID, unitDefsToTrack.reclaimerUnitDefs[unitDefID]) end if unitDefsToTrack.energyConverterDefs[unitDefID] then - removeFromUnitCacheInternal("energyConverters", teamID, unitID, - unitDefsToTrack.energyConverterDefs[unitDefID]) + removeFromUnitCacheInternal("energyConverters", teamID, unitID, unitDefsToTrack.energyConverterDefs[unitDefID]) end if unitDefsToTrack.buildPowerDefs[unitDefID] then - removeFromUnitCacheInternal("buildPower", teamID, unitID, - unitDefsToTrack.buildPowerDefs[unitDefID]) + removeFromUnitCacheInternal("buildPower", teamID, unitID, unitDefsToTrack.buildPowerDefs[unitDefID]) end if unitDefsToTrack.armyUnitDefs[unitDefID] then - removeFromUnitCacheInternal("armyUnits", teamID, unitID, - unitDefsToTrack.armyUnitDefs[unitDefID]) + removeFromUnitCacheInternal("armyUnits", teamID, unitID, unitDefsToTrack.armyUnitDefs[unitDefID]) end if unitDefsToTrack.defenseUnitDefs[unitDefID] then - removeFromUnitCacheInternal("defenseUnits", teamID, unitID, - unitDefsToTrack.defenseUnitDefs[unitDefID]) + removeFromUnitCacheInternal("defenseUnits", teamID, unitID, unitDefsToTrack.defenseUnitDefs[unitDefID]) end if unitDefsToTrack.utilityUnitDefs[unitDefID] then - removeFromUnitCacheInternal("utilityUnits", teamID, unitID, - unitDefsToTrack.utilityUnitDefs[unitDefID]) + removeFromUnitCacheInternal("utilityUnits", teamID, unitID, unitDefsToTrack.utilityUnitDefs[unitDefID]) end if unitDefsToTrack.economyBuildingDefs[unitDefID] then - removeFromUnitCacheInternal("economyBuildings", teamID, unitID, - unitDefsToTrack.economyBuildingDefs[unitDefID]) + removeFromUnitCacheInternal("economyBuildings", teamID, unitID, unitDefsToTrack.economyBuildingDefs[unitDefID]) end end @@ -539,7 +524,7 @@ local function buildUnitCache() unitCache[teamID].economyBuildings = {} cachedTotals[teamID].economyBuildings = 0 local unitIDs = Spring.GetTeamUnits(teamID) - for i=1,#unitIDs do + for i = 1, #unitIDs do local unitID = unitIDs[i] if not Spring.GetUnitIsBeingBuilt(unitID) then local unitDefID = Spring.GetUnitDefID(unitID) @@ -556,7 +541,7 @@ local function buildPlayerData() for _, allyID in ipairs(Spring.GetAllyTeamList()) do if allyID ~= gaiaAllyID then local teamList = Spring.GetTeamList(allyID) - for _,teamID in ipairs(teamList) do + for _, teamID in ipairs(teamList) do local playerName = nil local playerID = Spring.GetPlayerList(teamID, false) if playerID and playerID[1] then @@ -655,7 +640,7 @@ local function buildAllyTeamTable() allyTeamTable = {} local allyTeamIndex = 1 - for _,allyID in ipairs(Spring.GetAllyTeamList()) do + for _, allyID in ipairs(Spring.GetAllyTeamList()) do if allyID ~= gaiaAllyID then allyTeamTable[allyTeamIndex] = {} @@ -672,7 +657,7 @@ local function buildAllyTeamTable() allyTeamTable[allyTeamIndex].teams = {} local teamIndex = 1 - for _,teamID in ipairs(teamList) do + for _, teamID in ipairs(teamList) do allyTeamTable[allyTeamIndex].teams[teamIndex] = teamID teamIndex = teamIndex + 1 end @@ -696,7 +681,7 @@ end local function buildMetricsEnabled() metricsEnabled = {} local index = 1 - for _,metric in ipairs(metricsAvailable) do + for _, metric in ipairs(metricsAvailable) do local addMetric = false if settings.widgetConfig == constants.configLevel.custom then if settings.metricsEnabled[metric.key] then @@ -729,9 +714,7 @@ local function calculateWidgetDimensions() scaleMultiplier = ui_scale * settings.widgetScale * viewScreenWidth / 3840 -- widget is not allowed to be too tall - widgetDimensions.height = math.min( - math.floor(defaults.metricDimensions.height * #metricsEnabled * scaleMultiplier), - getWidgetHeightMax()) + widgetDimensions.height = math.min(math.floor(defaults.metricDimensions.height * #metricsEnabled * scaleMultiplier), getWidgetHeightMax()) -- every metric gets same amount of pixels metricDimensions.height = math.floor(widgetDimensions.height / #metricsEnabled) @@ -750,8 +733,8 @@ local function calculateWidgetDimensions() widgetDimensions.left = viewScreenWidth - widgetDimensions.width widgetDimensions.distanceFromTopBar = mathfloor(defaults.widgetDimensions.distanceFromTopBar * scaleMultiplier) - if WG['topbar'] and WG['topbar'].getShowButtons() then - local topBarPosition = WG['topbar'].GetPosition() + if WG["topbar"] and WG["topbar"].getShowButtons() then + local topBarPosition = WG["topbar"].GetPosition() widgetDimensions.top = (topBarPosition[6] or topBarPosition[2]) -- widgetDimensions.distanceFromTopBar else widgetDimensions.top = viewScreenHeight @@ -848,21 +831,15 @@ local function deleteTextures() end local function updateMetricTextTooltips() - if WG['tooltip'] then - for metricIndex,metric in ipairs(metricsEnabled) do + if WG["tooltip"] then + for metricIndex, metric in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height local top = bottom + metricDimensions.height local left = titleDimensions.left local right = titleDimensions.right - WG['tooltip'].AddTooltip( - string.format("spectator_hud_vsmode_%d", metric.id), - { left, bottom, right, top }, - metric.tooltip, - nil, - metric.title - ) + WG["tooltip"].AddTooltip(string.format("spectator_hud_vsmode_%d", metric.id), { left, bottom, right, top }, metric.tooltip, nil, metric.title) end end end @@ -876,7 +853,7 @@ local function initMovingAverage(movingAverage) movingAverage.average = 0 movingAverage.index = 0 movingAverage.data = {} - for i=1,settings.movingAverageWindowSize do + for i = 1, settings.movingAverageWindowSize do movingAverage.data[i] = 0 end end @@ -888,7 +865,7 @@ local function updateMovingAverage(movingAverage, newValue) end if movingAverage.index == 0 then - for i=1,settings.movingAverageWindowSize do + for i = 1, settings.movingAverageWindowSize do movingAverage.data[i] = newValue end movingAverage.average = newValue @@ -919,7 +896,7 @@ local function getOneStat(statKey, teamID) if statKey == metricKeys.metalIncome then result = select(4, Spring.GetTeamResources(teamID, "metal")) or 0 elseif statKey == metricKeys.energyConversionMetalIncome then - for unitID,_ in pairs(unitCache[teamID].energyConverters) do + for unitID, _ in pairs(unitCache[teamID].energyConverters) do result = result + unitCache.energyConverters.update(unitID, 0) end elseif statKey == metricKeys.energyIncome then @@ -1008,14 +985,14 @@ local function createTeamStats() teamStats = {} - for metricIndex,_ in ipairs(metricsEnabled) do + for metricIndex, _ in ipairs(metricsEnabled) do teamStats[metricIndex] = {} teamStats[metricIndex].aggregates = {} teamStats[metricIndex].allyTeams = {} - for allyIndex,allyTeam in ipairs(allyTeamTable) do + for allyIndex, allyTeam in ipairs(allyTeamTable) do teamStats[metricIndex].aggregates[allyIndex] = 0 teamStats[metricIndex].allyTeams[allyIndex] = {} - for teamIndex,teamID in ipairs(allyTeam.teams) do + for teamIndex, teamID in ipairs(allyTeam.teams) do teamStats[metricIndex].allyTeams[allyIndex][teamIndex] = {} initMovingAverage(teamStats[metricIndex].allyTeams[allyIndex][teamIndex]) end @@ -1024,10 +1001,10 @@ local function createTeamStats() end local function updateStats() - for metricIndex,metric in ipairs(metricsEnabled) do - for allyIndex,allyTeam in ipairs(allyTeamTable) do + for metricIndex, metric in ipairs(metricsEnabled) do + for allyIndex, allyTeam in ipairs(allyTeamTable) do local teamAggregate = 0 - for teamIndex,teamID in ipairs(allyTeam.teams) do + for teamIndex, teamID in ipairs(allyTeam.teams) do local valueTeam = getOneStat(metric.key, teamID) updateMovingAverage(teamStats[metricIndex].allyTeams[allyIndex][teamIndex], valueTeam) teamAggregate = teamAggregate + teamStats[metricIndex].allyTeams[allyIndex][teamIndex].average @@ -1060,46 +1037,26 @@ local function drawMetricBar(left, bottom, right, top, indexLeft, indexRight, me if (not mouseOver) or ((valueLeft == 0) and (valueRight == 0)) then glColor(allyTeamTable[indexLeft].colorBar) - glRect( - left, - barBottom, - left + leftBarWidth, - barTop - ) + glRect(left, barBottom, left + leftBarWidth, barTop) glColor(allyTeamTable[indexRight].colorBar) - glRect( - right - rightBarWidth, - barBottom, - right, - barTop - ) + glRect(right - rightBarWidth, barBottom, right, barTop) local lineBottom = barBottom + barDimensions.lineMiddleOffset local lineTop = barTop - barDimensions.lineMiddleOffset glColor(allyTeamTable[indexLeft].colorLine) - glRect( - left, - lineBottom, - left + leftBarWidth, - lineTop - ) + glRect(left, lineBottom, left + leftBarWidth, lineTop) glColor(allyTeamTable[indexRight].colorLine) - glRect( - right - rightBarWidth, - lineBottom, - right, - lineTop - ) + glRect(right - rightBarWidth, lineBottom, right, lineTop) else -- do "rainbow" colors local scalingFactor = barLength / (valueLeft + valueRight) local lineStart local lineEnd = left - for teamIndex,teamID in ipairs(allyTeamTable[indexLeft].teams) do + for teamIndex, teamID in ipairs(allyTeamTable[indexLeft].teams) do local teamValue = teamStats[metricIndex].allyTeams[indexLeft][teamIndex].average local teamColor = playerData[teamID].color @@ -1107,17 +1064,12 @@ local function drawMetricBar(left, bottom, right, top, indexLeft, indexRight, me lineEnd = lineStart + mathfloor(scalingFactor * teamValue) glColor(teamColor) - glRect( - lineStart, - barBottom, - lineEnd, - barTop - ) + glRect(lineStart, barBottom, lineEnd, barTop) end local lineStart local lineEnd = right - rightBarWidth - for teamIndex,teamID in ipairs(allyTeamTable[indexRight].teams) do + for teamIndex, teamID in ipairs(allyTeamTable[indexRight].teams) do local teamValue = teamStats[metricIndex].allyTeams[indexRight][teamIndex].average local teamColor = playerData[teamID].color @@ -1125,12 +1077,7 @@ local function drawMetricBar(left, bottom, right, top, indexLeft, indexRight, me lineEnd = lineStart + mathfloor(scalingFactor * teamValue) glColor(teamColor) - glRect( - lineStart, - barBottom, - lineEnd, - barTop - ) + glRect(lineStart, barBottom, lineEnd, barTop) end end end @@ -1140,13 +1087,12 @@ local function drawBars() local indexRight = teamOrder and teamOrder[2] or 2 local mouseX, mouseY = Spring.GetMouseState() - local mouseOnBar= false - if (mouseX > barDimensions.left) and (mouseX < barDimensions.right) and - (mouseY > widgetDimensions.bottom) and (mouseY < widgetDimensions.top) then + local mouseOnBar = false + if (mouseX > barDimensions.left) and (mouseX < barDimensions.right) and (mouseY > widgetDimensions.bottom) and (mouseY < widgetDimensions.top) then mouseOnBar = true end - for metricIndex,metric in ipairs(metricsEnabled) do + for metricIndex, metric in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height local top = bottom + metricDimensions.height @@ -1157,16 +1103,7 @@ local function drawBars() end end - drawMetricBar( - knobDimensions.leftKnobRight, - bottom, - knobDimensions.rightKnobLeft, - top, - indexLeft, - indexRight, - metricIndex, - mouseOver - ) + drawMetricBar(knobDimensions.leftKnobRight, bottom, knobDimensions.rightKnobLeft, top, indexLeft, indexRight, metricIndex, mouseOver) end end @@ -1178,33 +1115,23 @@ end local function doTitleTexture() local function drawTitlesToTexture() gl.Translate(-1, -1, 0) - gl.Scale( - 2 / titleDimensions.width, - 2 / widgetDimensions.height, - 0 - ) + gl.Scale(2 / titleDimensions.width, 2 / widgetDimensions.height, 0) font:Begin(true) font:SetTextColor(textColorWhite) - for metricIndex,metric in ipairs(metricsEnabled) do + for metricIndex, metric in ipairs(metricsEnabled) do local bottom = widgetDimensions.height - metricIndex * metricDimensions.height local textHCenter = titleDimensions.widthHalf local textVCenter = bottom + titleDimensions.verticalCenterOffset local textText = metricsEnabled[metricIndex].text - font:Print( - textText, - textHCenter, - textVCenter, - titleDimensions.fontSize, - 'cvo' - ) + font:Print(textText, textHCenter, textVCenter, titleDimensions.fontSize, "cvo") end font:End() end - gl.R2tHelper.RenderToTexture(titleTexture, drawTitlesToTexture, true) + gl.R2tHelper.RenderToTexture(titleTexture, drawTitlesToTexture, true) end local function updateStatsTexture() @@ -1217,95 +1144,67 @@ local function updateStatsTexture() fontSizeSmaller = fontSizeSmaller - 1 end - font:Print( - text, - mathfloor((right + left) / 2), - mathfloor((top + bottom) / 2), - fontSizeSmaller, - 'cvO' - ) + font:Print(text, mathfloor((right + left) / 2), mathfloor((top + bottom) / 2), fontSizeSmaller, "cvO") end local statsTextureWidth = knobDimensions.rightKnobRight - knobDimensions.leftKnobLeft local statsTextureHeight = widgetDimensions.height gl.Translate(-1, -1, 0) - gl.Scale( - 2 / statsTextureWidth, - 2 / statsTextureHeight, - 0 - ) + gl.Scale(2 / statsTextureWidth, 2 / statsTextureHeight, 0) font:Begin(true) - font:SetTextColor(textColorWhite) - - local indexLeft = teamOrder and teamOrder[1] or 1 - local indexRight = teamOrder and teamOrder[2] or 2 - for metricIndex,metric in ipairs(metricsEnabled) do - local bottom = widgetDimensions.height - metricIndex * metricDimensions.height - local top = bottom + metricDimensions.height - - local valueLeft = teamStats[metricIndex].aggregates[indexLeft] - local valueRight = teamStats[metricIndex].aggregates[indexRight] - - -- draw left knob text - drawMetricKnobText( - 0, - bottom, - knobDimensions.width, - top, - formatResources(valueLeft, true) - ) - - -- draw right knob text - drawMetricKnobText( - knobDimensions.rightKnobLeft - knobDimensions.leftKnobLeft, - bottom, - knobDimensions.rightKnobRight - knobDimensions.leftKnobLeft, - top, - formatResources(valueRight, true) - ) - - -- draw middle knob text - local barLength = knobDimensions.rightKnobLeft - knobDimensions.leftKnobRight - knobDimensions.width - local leftBarWidth - if valueLeft > 0 or valueRight > 0 then - leftBarWidth = mathfloor(barLength * valueLeft / (valueLeft + valueRight)) + font:SetTextColor(textColorWhite) + + local indexLeft = teamOrder and teamOrder[1] or 1 + local indexRight = teamOrder and teamOrder[2] or 2 + for metricIndex, metric in ipairs(metricsEnabled) do + local bottom = widgetDimensions.height - metricIndex * metricDimensions.height + local top = bottom + metricDimensions.height + + local valueLeft = teamStats[metricIndex].aggregates[indexLeft] + local valueRight = teamStats[metricIndex].aggregates[indexRight] + + -- draw left knob text + drawMetricKnobText(0, bottom, knobDimensions.width, top, formatResources(valueLeft, true)) + + -- draw right knob text + drawMetricKnobText(knobDimensions.rightKnobLeft - knobDimensions.leftKnobLeft, bottom, knobDimensions.rightKnobRight - knobDimensions.leftKnobLeft, top, formatResources(valueRight, true)) + + -- draw middle knob text + local barLength = knobDimensions.rightKnobLeft - knobDimensions.leftKnobRight - knobDimensions.width + local leftBarWidth + if valueLeft > 0 or valueRight > 0 then + leftBarWidth = mathfloor(barLength * valueLeft / (valueLeft + valueRight)) + else + leftBarWidth = mathfloor(barLength / 2) + end + local rightBarWidth = barLength - leftBarWidth -- TODO: remove unused variable + + local relativeLead = 0 + local relativeLeadMax = 999 + local relativeLeadString = nil + if valueLeft > valueRight then + if valueRight > 0 then + relativeLead = mathfloor(100 * mathabs(valueLeft - valueRight) / valueRight) else - leftBarWidth = mathfloor(barLength / 2) - end - local rightBarWidth = barLength - leftBarWidth -- TODO: remove unused variable - - local relativeLead = 0 - local relativeLeadMax = 999 - local relativeLeadString = nil - if valueLeft > valueRight then - if valueRight > 0 then - relativeLead = mathfloor(100 * mathabs(valueLeft - valueRight) / valueRight) - else - relativeLeadString = "∞" - end - elseif valueRight > valueLeft then - if valueLeft > 0 then - relativeLead = mathfloor(100 * mathabs(valueRight - valueLeft) / valueLeft) - else - relativeLeadString = "∞" - end + relativeLeadString = "∞" end - if relativeLead > relativeLeadMax then - relativeLeadString = string.format("%d+%%", relativeLeadMax) - elseif not relativeLeadString then - relativeLeadString = string.format("%d%%", relativeLead) + elseif valueRight > valueLeft then + if valueLeft > 0 then + relativeLead = mathfloor(100 * mathabs(valueRight - valueLeft) / valueLeft) + else + relativeLeadString = "∞" end - - local middleKnobLeft = knobDimensions.width + leftBarWidth + 1 - drawMetricKnobText( - middleKnobLeft, - bottom, - middleKnobLeft + knobDimensions.width, - top, - relativeLeadString - ) end + if relativeLead > relativeLeadMax then + relativeLeadString = string.format("%d+%%", relativeLeadMax) + elseif not relativeLeadString then + relativeLeadString = string.format("%d%%", relativeLead) + end + + local middleKnobLeft = knobDimensions.width + leftBarWidth + 1 + drawMetricKnobText(middleKnobLeft, bottom, middleKnobLeft + knobDimensions.width, top, relativeLeadString) + end font:End() end @@ -1322,7 +1221,7 @@ local function updateTextTextures() end local function deleteMetricDisplayLists() - for _,metricDisplayList in ipairs(metricDisplayLists) do + for _, metricDisplayList in ipairs(metricDisplayLists) do gl.DeleteList(metricDisplayList) end metricDisplayLists = {} @@ -1334,19 +1233,12 @@ local function createMetricDisplayLists() local left = widgetDimensions.left local right = widgetDimensions.right - for metricIndex,_ in ipairs(metricsEnabled) do + for metricIndex, _ in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height local top = bottom + metricDimensions.height - local newDisplayList = gl.CreateList(function () - WG.FlowUI.Draw.Element( - left, - bottom, - right, - top, - metricIndex == 1 and 0 or 1, 0, 0, 1, - 0 or 1, 1, 1, 1 - ) + local newDisplayList = gl.CreateList(function() + WG.FlowUI.Draw.Element(left, bottom, right, top, metricIndex == 1 and 0 or 1, 0, 0, 1, 0 or 1, 1, 1, 1) end) tableInsert(metricDisplayLists, newDisplayList) end @@ -1357,44 +1249,44 @@ local function createKnobVertices(vertexMatrix, left, bottom, right, top, corner local function addCornerVertices(vertexMatrix, startIndex, startAngle, originX, originY, cornerRadiusX, cornerRadiusY) -- first, add the corner vertex vertexMatrix[startIndex] = originX --rectRight - vertexMatrix[startIndex+1] = originY -- rectBottom - vertexMatrix[startIndex+2] = 0 - vertexMatrix[startIndex+3] = 1 + vertexMatrix[startIndex + 1] = originY -- rectBottom + vertexMatrix[startIndex + 2] = 0 + vertexMatrix[startIndex + 3] = 1 local alpha = mathPi / 2 / cornerTriangleAmount - for sliceIndex=0,cornerTriangleAmount do + for sliceIndex = 0, cornerTriangleAmount do local x = originX + cornerRadiusX * (mathCos(startAngle + alpha * sliceIndex)) local y = originY + cornerRadiusY * (mathSin(startAngle + alpha * sliceIndex)) - local vertexIndex = startIndex + (sliceIndex+1)*4 + local vertexIndex = startIndex + (sliceIndex + 1) * 4 vertexMatrix[vertexIndex] = x - vertexMatrix[vertexIndex+1] = y - vertexMatrix[vertexIndex+2] = 0 - vertexMatrix[vertexIndex+3] = 1 + vertexMatrix[vertexIndex + 1] = y + vertexMatrix[vertexIndex + 2] = 0 + vertexMatrix[vertexIndex + 3] = 1 end end local function addRectangleVertices(vertexMatrix, startIndex, rectLeft, rectBottom, rectRight, rectTop) vertexMatrix[startIndex] = rectLeft - vertexMatrix[startIndex+1] = rectTop - vertexMatrix[startIndex+2] = 0 - vertexMatrix[startIndex+3] = 1 + vertexMatrix[startIndex + 1] = rectTop + vertexMatrix[startIndex + 2] = 0 + vertexMatrix[startIndex + 3] = 1 - vertexMatrix[startIndex+4] = rectRight - vertexMatrix[startIndex+5] = rectTop - vertexMatrix[startIndex+6] = 0 - vertexMatrix[startIndex+7] = 1 + vertexMatrix[startIndex + 4] = rectRight + vertexMatrix[startIndex + 5] = rectTop + vertexMatrix[startIndex + 6] = 0 + vertexMatrix[startIndex + 7] = 1 - vertexMatrix[startIndex+8] = rectLeft - vertexMatrix[startIndex+9] = rectBottom - vertexMatrix[startIndex+10] = 0 - vertexMatrix[startIndex+11] = 1 + vertexMatrix[startIndex + 8] = rectLeft + vertexMatrix[startIndex + 9] = rectBottom + vertexMatrix[startIndex + 10] = 0 + vertexMatrix[startIndex + 11] = 1 - vertexMatrix[startIndex+12] = rectRight - vertexMatrix[startIndex+13] = rectBottom - vertexMatrix[startIndex+14] = 0 - vertexMatrix[startIndex+15] = 1 + vertexMatrix[startIndex + 12] = rectRight + vertexMatrix[startIndex + 13] = rectBottom + vertexMatrix[startIndex + 14] = 0 + vertexMatrix[startIndex + 15] = 1 end local vertexIndex = 1 @@ -1408,128 +1300,61 @@ local function createKnobVertices(vertexMatrix, left, bottom, right, top, corner local topOpenGL = coordinateScreenYToOpenGL(top) -- 1. create top-left corner triangles - addCornerVertices( - vertexMatrix, - vertexIndex, - mathPi/2, - leftOpenGL + cornerRadiusX, - topOpenGL - cornerRadiusY, - cornerRadiusX, - cornerRadiusY - ) - vertexIndex = vertexIndex + 4 + (cornerTriangleAmount+1)*4 + addCornerVertices(vertexMatrix, vertexIndex, mathPi / 2, leftOpenGL + cornerRadiusX, topOpenGL - cornerRadiusY, cornerRadiusX, cornerRadiusY) + vertexIndex = vertexIndex + 4 + (cornerTriangleAmount + 1) * 4 -- 2. create top-mid rectangle triangles - addRectangleVertices( - vertexMatrix, - vertexIndex, - leftOpenGL + cornerRadiusX, - topOpenGL - cornerRadiusY, - rightOpenGL - cornerRadiusX, - topOpenGL - ) + addRectangleVertices(vertexMatrix, vertexIndex, leftOpenGL + cornerRadiusX, topOpenGL - cornerRadiusY, rightOpenGL - cornerRadiusX, topOpenGL) vertexIndex = vertexIndex + 16 -- 3. create top-right corner triangles - addCornerVertices( - vertexMatrix, - vertexIndex, - 0, - rightOpenGL - cornerRadiusX, - topOpenGL - cornerRadiusY, - cornerRadiusX, - cornerRadiusY - ) - vertexIndex = vertexIndex + 4 + (cornerTriangleAmount+1)*4 + addCornerVertices(vertexMatrix, vertexIndex, 0, rightOpenGL - cornerRadiusX, topOpenGL - cornerRadiusY, cornerRadiusX, cornerRadiusY) + vertexIndex = vertexIndex + 4 + (cornerTriangleAmount + 1) * 4 -- 4. create mid-left rectangle triangles - addRectangleVertices( - vertexMatrix, - vertexIndex, - leftOpenGL, - bottomOpenGL + cornerRadiusY, - leftOpenGL + cornerRadiusX, - topOpenGL - cornerRadiusY - ) + addRectangleVertices(vertexMatrix, vertexIndex, leftOpenGL, bottomOpenGL + cornerRadiusY, leftOpenGL + cornerRadiusX, topOpenGL - cornerRadiusY) vertexIndex = vertexIndex + 16 -- 5. create mid-mid rectangle triangles - addRectangleVertices( - vertexMatrix, - vertexIndex, - leftOpenGL + cornerRadiusX, - bottomOpenGL + cornerRadiusY, - rightOpenGL - cornerRadiusX, - topOpenGL - cornerRadiusY - ) + addRectangleVertices(vertexMatrix, vertexIndex, leftOpenGL + cornerRadiusX, bottomOpenGL + cornerRadiusY, rightOpenGL - cornerRadiusX, topOpenGL - cornerRadiusY) vertexIndex = vertexIndex + 16 -- 6. create mid-right rectangle triangles - addRectangleVertices( - vertexMatrix, - vertexIndex, - rightOpenGL - cornerRadiusX, - bottomOpenGL + cornerRadiusY, - rightOpenGL, - topOpenGL - cornerRadiusY - ) + addRectangleVertices(vertexMatrix, vertexIndex, rightOpenGL - cornerRadiusX, bottomOpenGL + cornerRadiusY, rightOpenGL, topOpenGL - cornerRadiusY) vertexIndex = vertexIndex + 16 -- 7. create bottom-left corner triangles - addCornerVertices( - vertexMatrix, - vertexIndex, - mathPi, - leftOpenGL + cornerRadiusX, - bottomOpenGL + cornerRadiusY, - cornerRadiusX, - cornerRadiusY - ) - vertexIndex = vertexIndex + 4 + (cornerTriangleAmount+1)*4 + addCornerVertices(vertexMatrix, vertexIndex, mathPi, leftOpenGL + cornerRadiusX, bottomOpenGL + cornerRadiusY, cornerRadiusX, cornerRadiusY) + vertexIndex = vertexIndex + 4 + (cornerTriangleAmount + 1) * 4 -- 8. create bottom-mid rectangle triangles - addRectangleVertices( - vertexMatrix, - vertexIndex, - leftOpenGL + cornerRadiusX, - bottomOpenGL + cornerRadiusY, - rightOpenGL - cornerRadiusX, - bottomOpenGL - ) + addRectangleVertices(vertexMatrix, vertexIndex, leftOpenGL + cornerRadiusX, bottomOpenGL + cornerRadiusY, rightOpenGL - cornerRadiusX, bottomOpenGL) vertexIndex = vertexIndex + 16 -- 9. create bottom-left corner triangles - addCornerVertices( - vertexMatrix, - vertexIndex, - -mathPi/2, - rightOpenGL - cornerRadiusX, - bottomOpenGL + cornerRadiusY, - cornerRadiusX, - cornerRadiusY - ) - vertexIndex = vertexIndex + 4 + (cornerTriangleAmount+1)*4 + addCornerVertices(vertexMatrix, vertexIndex, -mathPi / 2, rightOpenGL - cornerRadiusX, bottomOpenGL + cornerRadiusY, cornerRadiusX, cornerRadiusY) + vertexIndex = vertexIndex + 4 + (cornerTriangleAmount + 1) * 4 return vertexIndex end local function insertKnobIndices(indexData, vertexStartIndex, cornerTriangleAmount) local function insertCornerIndices(currentVertexOffset) - for i=1,cornerTriangleAmount do + for i = 1, cornerTriangleAmount do tableInsert(indexData, currentVertexOffset + 0) tableInsert(indexData, currentVertexOffset + i) - tableInsert(indexData, currentVertexOffset + i+1) + tableInsert(indexData, currentVertexOffset + i + 1) end return currentVertexOffset + cornerTriangleAmount + 2 end local function insertRectangleIndices(currentVertexOffset) tableInsert(indexData, currentVertexOffset) - tableInsert(indexData, currentVertexOffset+1) - tableInsert(indexData, currentVertexOffset+2) - tableInsert(indexData, currentVertexOffset+1) - tableInsert(indexData, currentVertexOffset+2) - tableInsert(indexData, currentVertexOffset+3) + tableInsert(indexData, currentVertexOffset + 1) + tableInsert(indexData, currentVertexOffset + 2) + tableInsert(indexData, currentVertexOffset + 1) + tableInsert(indexData, currentVertexOffset + 2) + tableInsert(indexData, currentVertexOffset + 3) return currentVertexOffset + 4 end @@ -1585,34 +1410,18 @@ local function createKnobVAO() -- build vertexVBO local vertexDataOutline = {} - createKnobVertices( - vertexDataOutline, - 0, - 0, - width, - height, - cornerRadius, - cornerTriangleAmount - ) + createKnobVertices(vertexDataOutline, 0, 0, width, height, cornerRadius, cornerTriangleAmount) local vertexDataInner = {} - createKnobVertices( - vertexDataInner, - border, - border, - width - border, - height - border, - cornerRadius, - cornerTriangleAmount - ) + createKnobVertices(vertexDataInner, border, border, width - border, height - border, cornerRadius, cornerTriangleAmount) local vertexVBOInner = gl.GetVBO(GL.ARRAY_BUFFER, false) - vertexVBOInner:Define(#vertexDataInner/4, { + vertexVBOInner:Define(#vertexDataInner / 4, { { id = 0, name = "aPos", size = 4 }, }) vertexVBOInner:Upload(vertexDataInner) local vertexVBOOutline = gl.GetVBO(GL.ARRAY_BUFFER, false) - vertexVBOOutline:Define(#vertexDataOutline/4, { + vertexVBOOutline:Define(#vertexDataOutline / 4, { { id = 0, name = "aPos", size = 4 }, }) vertexVBOOutline:Upload(vertexDataOutline) @@ -1631,14 +1440,14 @@ local function createKnobVAO() -- create and attach instanceVBO (note: the data is populated separately) knobVAO.instanceVBOInner = gl.GetVBO(GL.ARRAY_BUFFER, true) knobVAO.instanceVBOInner:Define(instanceCount, { - { id = 1, name = "posBias", size=4 }, - { id = 2, name = "aKnobColor", size=4 }, + { id = 1, name = "posBias", size = 4 }, + { id = 2, name = "aKnobColor", size = 4 }, }) knobVAO.instanceVBOOutline = gl.GetVBO(GL.ARRAY_BUFFER, true) knobVAO.instanceVBOOutline:Define(instanceCount, { - { id = 1, name = "posBias", size=4 }, - { id = 2, name = "aKnobColor", size=4 }, + { id = 1, name = "posBias", size = 4 }, + { id = 2, name = "aKnobColor", size = 4 }, }) knobVAO.instances = 0 @@ -1658,8 +1467,8 @@ local function addKnob(knobVAO, left, bottom, color) local instanceData = {} -- posBias - tableInsert(instanceData, coordinateScreenXToOpenGL(left)+1.0) - tableInsert(instanceData, coordinateScreenYToOpenGL(bottom)+1.0) + tableInsert(instanceData, coordinateScreenXToOpenGL(left) + 1.0) + tableInsert(instanceData, coordinateScreenYToOpenGL(bottom) + 1.0) tableInsert(instanceData, 0.0) tableInsert(instanceData, 0.0) @@ -1691,7 +1500,7 @@ local function addSideKnobs() return end - for metricIndex,_ in ipairs(metricsEnabled) do + for metricIndex, _ in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height local knobBottom = bottom + knobDimensions.padding @@ -1704,7 +1513,7 @@ local function addSideKnobs() end local function addMiddleKnobs() - for metricIndex,_ in ipairs(metricsEnabled) do + for metricIndex, _ in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height + 1.0 local textBottom = bottom + titleDimensions.padding @@ -1717,7 +1526,7 @@ local function addMiddleKnobs() end end -local modifyKnobInstanceData = {0, 0, 0, 0, 0, 0, 0, 0} +local modifyKnobInstanceData = { 0, 0, 0, 0, 0, 0, 0, 0 } local function modifyKnob(knobVAO, instance, left, bottom, color) -- note: instead of using a local variable instanceData that rebuild a table every time this function is called, -- we use the global variable modifyKnobInstanceData to avoid recreating a table and instead reusing the table. @@ -1734,14 +1543,14 @@ local function modifyKnob(knobVAO, instance, left, bottom, color) modifyKnobInstanceData[6] = color[2] modifyKnobInstanceData[7] = color[3] modifyKnobInstanceData[8] = color[4] - knobVAO.instanceVBOInner:Upload(modifyKnobInstanceData, -1, instance-1) + knobVAO.instanceVBOInner:Upload(modifyKnobInstanceData, -1, instance - 1) local greyFactor = 0.5 modifyKnobInstanceData[5] = color[1] * greyFactor modifyKnobInstanceData[6] = color[2] * greyFactor modifyKnobInstanceData[7] = color[3] * greyFactor modifyKnobInstanceData[8] = color[4] * greyFactor - knobVAO.instanceVBOOutline:Upload(modifyKnobInstanceData, -1, instance-1) + knobVAO.instanceVBOOutline:Upload(modifyKnobInstanceData, -1, instance - 1) end local function moveMiddleKnobs() @@ -1749,7 +1558,7 @@ local function moveMiddleKnobs() local indexRight = teamOrder and teamOrder[2] or 2 local instanceOffset = 2 * #metricsEnabled - for metricIndex,_ in ipairs(metricsEnabled) do + for metricIndex, _ in ipairs(metricsEnabled) do local bottom = widgetDimensions.top - metricIndex * metricDimensions.height local valueLeft = teamStats[metricIndex].aggregates[indexLeft] @@ -1795,9 +1604,9 @@ end local function drawKnobVAO() shader:Activate() - local amountOfTriangles = 5*2 + 4*knobVAO.cornerTriangleAmount - knobVAO.vaoOutline:DrawElements(GL.TRIANGLES, amountOfTriangles*3, 0, knobVAO.instances) - knobVAO.vaoInner:DrawElements(GL.TRIANGLES, amountOfTriangles*3, 0, knobVAO.instances) + local amountOfTriangles = 5 * 2 + 4 * knobVAO.cornerTriangleAmount + knobVAO.vaoOutline:DrawElements(GL.TRIANGLES, amountOfTriangles * 3, 0, knobVAO.instances) + knobVAO.vaoInner:DrawElements(GL.TRIANGLES, amountOfTriangles * 3, 0, knobVAO.instances) shader:Deactivate() end @@ -1806,13 +1615,10 @@ local function initGL4() local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() knobVertexShaderSource = knobVertexShaderSource:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) knobFragmentShaderSource = knobFragmentShaderSource:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) - shader = LuaShader( - { - vertex = knobVertexShaderSource, - fragment = knobFragmentShaderSource, - }, - "spectator_hud" - ) + shader = LuaShader({ + vertex = knobVertexShaderSource, + fragment = knobFragmentShaderSource, + }, "spectator_hud") local shaderCompiled = shader:Initialize() return shaderCompiled end @@ -1820,7 +1626,9 @@ end local function hideEcostats() if widgetEnabled and widgetHandler:IsWidgetKnown("Ecostats") then local ecostatsWidget = widgetHandler:FindWidget("Ecostats") - if (not ecostatsWidget) then return end + if not ecostatsWidget then + return + end ecostatsHidden = true widgetHandler:RemoveWidget(ecostatsWidget) end @@ -1834,23 +1642,23 @@ local function showEcostats() end local function init() - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() viewScreenWidth, viewScreenHeight = Spring.GetViewGeometry() buildMetricsEnabled() if settings.widgetConfig == constants.configLevel.basic then - settings.statsUpdateFrequency = 30 -- once a second + settings.statsUpdateFrequency = 30 -- once a second settings.useMovingAverage = false elseif settings.widgetConfig == constants.configLevel.advanced then - settings.statsUpdateFrequency = 6 -- 5 times a second + settings.statsUpdateFrequency = 6 -- 5 times a second settings.useMovingAverage = true - settings.movingAverageWindowSize = 4 -- approx 1 sec + settings.movingAverageWindowSize = 4 -- approx 1 sec elseif settings.widgetConfig == constants.configLevel.expert then - settings.statsUpdateFrequency = 2 -- 15 times a second, same as engine slowUpdate + settings.statsUpdateFrequency = 2 -- 15 times a second, same as engine slowUpdate settings.useMovingAverage = true - settings.movingAverageWindowSize = 16 -- approx 1 sec + settings.movingAverageWindowSize = 16 -- approx 1 sec elseif settings.widgetConfig == constants.configLevel.custom then settings.statsUpdateFrequency = 2 settings.useMovingAverage = true @@ -1908,7 +1716,9 @@ function widget:Initialize() -- If yes, we will hide ecostats (hide at init() and show at deInit()) -- If no, we will do nothing since user might or might not be using ecostats widgetEnabled = getAmountOfAllyTeams() == 2 - if not widgetEnabled then return end + if not widgetEnabled then + return + end WG["spectator_hud"] = {} @@ -1962,8 +1772,8 @@ function widget:Shutdown() shader:Finalize() end if guishaderDlist then - if WG['guishader'] then - WG['guishader'].DeleteDlist('spechud') + if WG["guishader"] then + WG["guishader"].DeleteDlist("spechud") else gl.DeleteList(guishaderDlist) end @@ -2015,7 +1825,6 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerD end end - function widget:ViewResize() reInit() end @@ -2037,33 +1846,32 @@ function widget:GameFrame(frameNum) return end - if (frameNum > 0) and (not teamOrder) then + if (frameNum > 0) and not teamOrder then -- collect player start positions local teamStartAverages = {} for _, allyID in ipairs(Spring.GetAllyTeamList()) do if allyID ~= gaiaAllyID then local accumulator = { x = 0, z = 0 } local teamList = Spring.GetTeamList(allyID) - for _,teamID in ipairs(teamList) do + for _, teamID in ipairs(teamList) do local x, _, z = Spring.GetTeamStartPosition(teamID) accumulator.x = accumulator.x + x accumulator.z = accumulator.z + z end - local startAverage= { x = accumulator.x / #teamList, z = accumulator.z / #teamList } + local startAverage = { x = accumulator.x / #teamList, z = accumulator.z / #teamList } tableInsert(teamStartAverages, { allyID, startAverage }) end end - local _,rotY,_ = Spring.GetCameraRotation() + local _, rotY, _ = Spring.GetCameraRotation() -- sort averages and create team order (from left to right) - table.sort(teamStartAverages, function (left, right) - return ((left[2].x * mathCos(rotY) + left[2].z * mathSin(rotY)) < - (right[2].x * mathCos(rotY) + right[2].z * mathSin(rotY))) + table.sort(teamStartAverages, function(left, right) + return ((left[2].x * mathCos(rotY) + left[2].z * mathSin(rotY)) < (right[2].x * mathCos(rotY) + right[2].z * mathSin(rotY))) end) teamOrder = {} - for i,teamStart in ipairs(teamStartAverages) do - teamOrder[i] = teamStart[1] + 1 -- note: allyTeam ID's start from 0 + for i, teamStart in ipairs(teamStartAverages) do + teamOrder[i] = teamStart[1] + 1 -- note: allyTeam ID's start from 0 end -- update knob colors by overwriting all knobs @@ -2088,10 +1896,10 @@ function widget:Update(dt) sec = sec + dt if sec > 0.05 then sec = 0 - if WG['topbar'] then + if WG["topbar"] then local prevShowButtons = topbarShowButtons - if WG['topbar'].getShowButtons() ~= prevShowButtons then - topbarShowButtons = WG['topbar'].getShowButtons() + if WG["topbar"].getShowButtons() ~= prevShowButtons then + topbarShowButtons = WG["topbar"].getShowButtons() if haveFullView then init() else @@ -2124,24 +1932,24 @@ function widget:DrawScreen() gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) if not widgetEnabled or not haveFullView then - if WG['guishader'] and guishaderDlist then - WG['guishader'].DeleteDlist('spechud') + if WG["guishader"] and guishaderDlist then + WG["guishader"].DeleteDlist("spechud") guishaderDlist = nil end return end - if WG['guishader'] and (displayListsChanged or not guishaderDlist) then + if WG["guishader"] and (displayListsChanged or not guishaderDlist) then if guishaderDlist then gl.DeleteList(guishaderDlist) guishaderDlist = nil end - guishaderDlist = gl.CreateList(function () + guishaderDlist = gl.CreateList(function() for _, metricDisplayList in ipairs(metricDisplayLists) do gl.CallList(metricDisplayList) end end) - WG['guishader'].InsertDlist(guishaderDlist, 'spechud') + WG["guishader"].InsertDlist(guishaderDlist, "spechud") displayListsChanged = nil end @@ -2164,7 +1972,7 @@ function widget:GetConfigData() } result.metricsEnabled = {} - for _,metric in pairs(metricKeys) do + for _, metric in pairs(metricKeys) do result.metricsEnabled[metric] = settings.metricsEnabled[metric] end @@ -2183,7 +1991,7 @@ function widget:SetConfigData(data) end if data["metricsEnabled"] then - for _,metric in pairs(metricKeys) do + for _, metric in pairs(metricKeys) do if data["metricsEnabled"][metric] then settings.metricsEnabled[metric] = data["metricsEnabled"][metric] end diff --git a/luaui/Widgets/gui_tax_buildspeed_debuff.lua b/luaui/Widgets/gui_tax_buildspeed_debuff.lua index 631059d091e..14a44461fb6 100644 --- a/luaui/Widgets/gui_tax_buildspeed_debuff.lua +++ b/luaui/Widgets/gui_tax_buildspeed_debuff.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Buildspeed Debuff Bar", - desc = "Shows a pulsating icon above builder units debuffed after being transferred to an ally in easytax modoption.", - author = "RebelNode", - date = "2026", - license = "GNU GPL v2", - layer = -1, - enabled = true + name = "Buildspeed Debuff Bar", + desc = "Shows a pulsating icon above builder units debuffed after being transferred to an ally in easytax modoption.", + author = "RebelNode", + date = "2026", + license = "GNU GPL v2", + layer = -1, + enabled = true, } end @@ -18,21 +18,21 @@ end local debuffedUnits = {} -- unitID -> { startFrame, expireFrame, yoffset } -local spGetGameFrame = Spring.GetGameFrame +local spGetGameFrame = Spring.GetGameFrame local glDrawFuncAtUnit = gl.DrawFuncAtUnit -local glTranslate = gl.Translate -local glBillboard = gl.Billboard -local glColor = gl.Color -local glTexRect = gl.TexRect -local glTexture = gl.Texture -local mathSin = math.sin -local mathPi = math.pi -local mathCeil = math.ceil -local mathMax = math.max -local mathMin = math.min - -local ICON_SIZE = 16 -- world units half-width -local ICON_TEX = 'luaui/images/easytax/share.dds' +local glTranslate = gl.Translate +local glBillboard = gl.Billboard +local glColor = gl.Color +local glTexRect = gl.TexRect +local glTexture = gl.Texture +local mathSin = math.sin +local mathPi = math.pi +local mathCeil = math.ceil +local mathMax = math.max +local mathMin = math.min + +local ICON_SIZE = 16 -- world units half-width +local ICON_TEX = "luaui/images/easytax/share.dds" local font local unitYOffset = {} @@ -61,8 +61,12 @@ local function drawIcon(yoffset, secsLeft) end function widget:DrawWorld() - if next(debuffedUnits) == nil then return end - if Spring.IsGUIHidden() then return end + if next(debuffedUnits) == nil then + return + end + if Spring.IsGUIHidden() then + return + end local gf = spGetGameFrame() gl.DepthTest(false) @@ -78,9 +82,9 @@ end local function onUnitBuildspeedDebuff(unitID, startFrame, expireFrame) local unitDefID = Spring.GetUnitDefID(unitID) debuffedUnits[unitID] = { - startFrame = startFrame, + startFrame = startFrame, expireFrame = expireFrame, - yoffset = unitYOffset[unitDefID] or 20, + yoffset = unitYOffset[unitDefID] or 20, } end @@ -101,7 +105,7 @@ function widget:UnitDestroyed(unitID) end function widget:ViewResize() - font = WG['fonts'].getFont(nil, 1.2, 0.2, 20) + font = WG["fonts"].getFont(nil, 1.2, 0.2, 20) end function widget:Initialize() diff --git a/luaui/Widgets/gui_team_platter.lua b/luaui/Widgets/gui_team_platter.lua index efe661adc96..a33e51821be 100644 --- a/luaui/Widgets/gui_team_platter.lua +++ b/luaui/Widgets/gui_team_platter.lua @@ -20,7 +20,7 @@ local skipOwnTeam = false local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local teamplatterVBO = nil @@ -28,18 +28,18 @@ local teamplatterShader = nil local luaShaderDir = "LuaUI/Include/" -- Localize for speedups: -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glDepthTest = gl.DepthTest -local glClear = gl.Clear -local GL_ALWAYS = GL.ALWAYS -local GL_NOTEQUAL = GL.NOTEQUAL -local GL_KEEP = 0x1E00 --GL.KEEP +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glDepthTest = gl.DepthTest +local glClear = gl.Clear +local GL_ALWAYS = GL.ALWAYS +local GL_NOTEQUAL = GL.NOTEQUAL +local GL_KEEP = 0x1E00 --GL.KEEP local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT -local GL_REPLACE = GL.REPLACE -local GL_POINTS = GL.POINTS +local GL_REPLACE = GL.REPLACE +local GL_POINTS = GL.POINTS local hasBadCulling = ((Platform.gpuVendor == "AMD" and Platform.osFamily == "Linux") == true) @@ -53,14 +53,14 @@ local unitCanFly = {} local unitBuilding = {} local unitDecoration = {} for unitDefID, unitDef in pairs(UnitDefs) do - unitScale[unitDefID] = (7.5 * ( unitDef.xsize*unitDef.xsize + unitDef.zsize*unitDef.zsize ) ^ 0.5) + 8 + unitScale[unitDefID] = (7.5 * (unitDef.xsize * unitDef.xsize + unitDef.zsize * unitDef.zsize) ^ 0.5) + 8 if unitDef.canFly then unitCanFly[unitDefID] = true unitScale[unitDefID] = unitScale[unitDefID] * 0.7 - elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0 then + elseif unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0 then unitBuilding[unitDefID] = { unitDef.xsize * 8.2 + 12, - unitDef.zsize * 8.2 + 12 + unitDef.zsize * 8.2 + 12, } end if unitDef.customParams.decoration then @@ -96,12 +96,24 @@ local function AddPrimitiveAtUnit(unitID, unitDefID, unitTeamID, noUpload) pushElementInstance( teamplatterVBO, -- push into this Instance VBO Table { - length, width, cornersize, additionalheight, -- lengthwidthcornerheight + length, + width, + cornersize, + additionalheight, -- lengthwidthcornerheight unitTeamID, -- teamID numVertices, -- how many trianges should we make - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0 -- these are just padding zeros, that will get filled in + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, -- these are just padding zeros, that will get filled in }, unitID, -- this is the key inside the VBO TAble, true, -- update existing element @@ -123,7 +135,7 @@ function widget:DrawWorldPreUnit() glStencilTest(true) --https://learnopengl.com/Advanced-OpenGL/Stencil-testing glDepthTest(true) glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon this to the shader - glClear(GL_STENCIL_BUFFER_BIT ) -- set stencil buffer to 0 + glClear(GL_STENCIL_BUFFER_BIT) -- set stencil buffer to 0 glStencilFunc(GL_NOTEQUAL, 1, 1) -- use NOTEQUAL instead of ALWAYS to ensure that overlapping transparent fragments dont get written multiple times glStencilMask(1) @@ -144,7 +156,8 @@ function widget:DrawWorldPreUnit() teamplatterShader:SetUniform("addRadius", 0.15) teamplatterVBO.VAO:DrawArrays(GL_POINTS, teamplatterVBO.usedElements) - ]]-- + ]] + -- glStencilMask(1) glStencilFunc(GL_ALWAYS, 1, 1) @@ -182,7 +195,7 @@ function widget:CrashingAircraft(unitID, unitDefID, teamID) end local function init() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE! shaderConfig.TRANSPARENCY = opacity @@ -195,33 +208,35 @@ local function init() return false end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end return true end function widget:Initialize() - if not init() then return end - WG['teamplatter'] = {} - WG['teamplatter'].getOpacity = function() + if not init() then + return + end + WG["teamplatter"] = {} + WG["teamplatter"].getOpacity = function() return opacity end - WG['teamplatter'].setOpacity = function(value) + WG["teamplatter"].setOpacity = function(value) opacity = value init() end - WG['teamplatter'].getSkipOwnTeam = function() + WG["teamplatter"].getSkipOwnTeam = function() return skipOwnTeam end - WG['teamplatter'].setSkipOwnTeam = function(value) + WG["teamplatter"].setSkipOwnTeam = function(value) skipOwnTeam = value init() end end function widget:Shutdown() - WG['teamplatter'] = nil + WG["teamplatter"] = nil end function widget:GetConfigData(data) diff --git a/luaui/Widgets/gui_teamstats.lua b/luaui/Widgets/gui_teamstats.lua index 3287fd294c2..671d044e9fa 100644 --- a/luaui/Widgets/gui_teamstats.lua +++ b/luaui/Widgets/gui_teamstats.lua @@ -2,18 +2,17 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "TeamStats", - desc = "Shows game stats.", - author = "", - version = "", - date = "", - license = "", - layer = -99990, - enabled = true, + name = "TeamStats", + desc = "Shows game stats.", + author = "", + version = "", + date = "", + license = "", + layer = -99990, + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -24,26 +23,26 @@ local spGetMouseState = Spring.GetMouseState local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState -local vsx,vsy = spGetViewGeometry() +local vsx, vsy = spGetViewGeometry() -local fontSize = 22 -- is caclulated somewhere else anyway +local fontSize = 22 -- is caclulated somewhere else anyway local fontSizePercentage = 0.6 -- fontSize * X = actual fontsize local update = 30 -- in frames local replaceEndStats = false -local highLightColour = {1,1,1,0.1} -local sortHighLightColour = {1,0.87,0.87,0.22} -local sortHighLightColourDesc = {0.9,1,0.9,0.22} -local activeSortColour = {1,0.62,0.62,0.22} -local activeSortColourDesc = {0.66,1,0.66,0.22} -local oddLineColour = {0.28,0.28,0.28,0.06} -local evenLineColour = {1,1,1,0.06} -local sortLineColour = {0.82,0.82,0.82,0.1} +local highLightColour = { 1, 1, 1, 0.1 } +local sortHighLightColour = { 1, 0.87, 0.87, 0.22 } +local sortHighLightColourDesc = { 0.9, 1, 0.9, 0.22 } +local activeSortColour = { 1, 0.62, 0.62, 0.22 } +local activeSortColourDesc = { 0.66, 1, 0.66, 0.22 } +local oddLineColour = { 0.28, 0.28, 0.28, 0.06 } +local evenLineColour = { 1, 1, 1, 0.06 } +local sortLineColour = { 0.82, 0.82, 0.82, 0.1 } local widgetScale = (vsy / 1080) local math_isInRect = math.isInRect local playSounds = true -local buttonclick = 'LuaUI/Sounds/buildbar_waypoint.wav' +local buttonclick = "LuaUI/Sounds/buildbar_waypoint.wav" local lineHeight = fontSize @@ -65,15 +64,15 @@ local header = { "actionsPerMinute", } -local headerRemap = {} -- filled in initialize +local headerRemap = {} -- filled in initialize local aspectMult = vsx / vsy local guiData = { mainPanel = { relSizes = { x = { - min = 0.1 + ((0.08*aspectMult)), - max = 0.9 - ((0.08*aspectMult)), + min = 0.1 + (0.08 * aspectMult), + max = 0.9 - (0.08 * aspectMult), length = 0.49, }, y = { @@ -90,43 +89,42 @@ guiData.mainPanel.relSizes.x.length = (guiData.mainPanel.relSizes.x.max - guiDat local ui_opacity = Spring.GetConfigFloat("ui_opacity", 0.7) -local glColor = gl.Color +local glColor = gl.Color local glCreateList = gl.CreateList local glCallList = gl.CallList local glDeleteList = gl.DeleteList -local GetGaiaTeamID = Spring.GetGaiaTeamID -local GetAllyTeamList = Spring.GetAllyTeamList -local GetTeamList = Spring.GetTeamList -local GetTeamStatsHistory = Spring.GetTeamStatsHistory -local GetTeamInfo = Spring.GetTeamInfo -local GetPlayerInfo = Spring.GetPlayerInfo -local GetMouseState = spGetMouseState -local GetGameFrame = Spring.GetGameFrame -local min = mathMin -local max = mathMax -local clamp = math.clamp -local floor = mathFloor -local huge = math.huge -local sort = table.sort -local log10 = math.log10 -local round = math.round -local char = string.char -local borderRemap = {left={"x","min",-1},right={"x","max",1},top={"y","max",1},bottom={"y","min",-1}} +local GetGaiaTeamID = Spring.GetGaiaTeamID +local GetAllyTeamList = Spring.GetAllyTeamList +local GetTeamList = Spring.GetTeamList +local GetTeamStatsHistory = Spring.GetTeamStatsHistory +local GetTeamInfo = Spring.GetTeamInfo +local GetPlayerInfo = Spring.GetPlayerInfo +local GetMouseState = spGetMouseState +local GetGameFrame = Spring.GetGameFrame +local min = mathMin +local max = mathMax +local clamp = math.clamp +local floor = mathFloor +local huge = math.huge +local sort = table.sort +local log10 = math.log10 +local round = math.round +local char = string.char +local borderRemap = { left = { "x", "min", -1 }, right = { "x", "max", 1 }, top = { "y", "max", 1 }, bottom = { "y", "min", -1 } } local RectRound, UiElement, elementCorner local font, font2, backgroundGuishader, gameStarted, bgpadding, gameover local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousTeamColor = {Spring.GetConfigInt("anonymousColorR", 255)/255, Spring.GetConfigInt("anonymousColorG", 0)/255, Spring.GetConfigInt("anonymousColorB", 0)/255} +local anonymousTeamColor = { Spring.GetConfigInt("anonymousColorR", 255) / 255, Spring.GetConfigInt("anonymousColorG", 0) / 255, Spring.GetConfigInt("anonymousColorB", 0) / 255 } local isSpec = spGetSpectatingState() - local playerScale = math.clamp(25 / #Spring.GetTeamList(), 0.3, 1) -function aboveRectangle(mousePos,boxData) +function aboveRectangle(mousePos, boxData) local included = true for coordName, coordData in pairs(boxData.absSizes) do included = included and mousePos[coordName] >= coordData.min and mousePos[coordName] <= coordData.max @@ -134,21 +132,21 @@ function aboveRectangle(mousePos,boxData) return included end -function isAbove(mousePos,guiData) +function isAbove(mousePos, guiData) for boxType, boxData in pairs(guiData) do if boxData.visible then local mask = {} local border = false - if aboveRectangle(mousePos,boxData) then + if aboveRectangle(mousePos, boxData) then local draggingBorderSize = boxData.draggingBorderSize for borderName, borderData in pairs(borderRemap) do local coordName = borderRemap[borderName][1] local coordDir = borderRemap[borderName][2] local dir = borderRemap[borderName][3] if coordDir == "min" then - mask[borderName] = mousePos[coordName] < (boxData.absSizes[coordName][coordDir]+ draggingBorderSize*-1*dir) + mask[borderName] = mousePos[coordName] < (boxData.absSizes[coordName][coordDir] + draggingBorderSize * -1 * dir) else - mask[borderName] = mousePos[coordName] > (boxData.absSizes[coordName][coordDir]+ draggingBorderSize*-1*dir) + mask[borderName] = mousePos[coordName] > (boxData.absSizes[coordName][coordDir] + draggingBorderSize * -1 * dir) end border = border or mask[borderName] end @@ -158,7 +156,7 @@ function isAbove(mousePos,guiData) end end -local teamData={} +local teamData = {} local teamAPM = {} local maxColumnTextSize = 0 local columnSize = 0 @@ -168,12 +166,11 @@ local selectedColumn local textDisplayList local backgroundDisplayList local teamControllers = {} -local mousex,mousey = 0,0 +local mousex, mousey = 0, 0 local sortVar = "damageDealt" local sortAscending = false local numColums = #header - function widget:SetConfigData(data) --guiData = data.guiData or guiData -- buggy positioning, so disabled this sortVar = data.sortVar or sortVar @@ -181,14 +178,13 @@ function widget:SetConfigData(data) end function widget:GetConfigData(data) - return{ + return { guiData = guiData, sortVar = sortVar, sortAscending = sortAscending, } end - function calcAbsSizes() guiData.mainPanel.absSizes = { x = { @@ -200,16 +196,16 @@ function calcAbsSizes() min = (guiData.mainPanel.relSizes.y.min * vsy), max = (guiData.mainPanel.relSizes.y.max * vsy), length = (guiData.mainPanel.relSizes.y.length * vsy), - } + }, } end function widget:ViewResize() - vsx,vsy = spGetViewGeometry() + vsx, vsy = spGetViewGeometry() widgetScale = (vsy / 1080) - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) for _, data in pairs(headerRemap) do maxColumnTextSize = max(font:GetTextWidth(data[2]), max(font:GetTextWidth(data[1]), maxColumnTextSize)) end @@ -222,24 +218,24 @@ function widget:ViewResize() calcAbsSizes() updateFontSize() - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) end local function refreshHeaders() headerRemap = { - frame = {" ", Spring.I18N('ui.teamStats.player')}, - metalProduced = {Spring.I18N('ui.teamStats.metal'), Spring.I18N('ui.teamStats.resourceProduced')}, - metalExcess = {Spring.I18N('ui.teamStats.metal'), Spring.I18N('ui.teamStats.resourceExcess')}, - energyProduced = {Spring.I18N('ui.teamStats.energy'), Spring.I18N('ui.teamStats.resourceProduced')}, - energyExcess = {Spring.I18N('ui.teamStats.energy'), Spring.I18N('ui.teamStats.resourceExcess')}, - damageDealt = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageDealt')}, - damageReceived = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageReceived')}, - damageEfficiency = {Spring.I18N('ui.teamStats.damage'), Spring.I18N('ui.teamStats.damageEfficiency')}, - unitsProduced = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsProduced')}, - unitsDied = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsDied')}, - unitsKilled = {Spring.I18N('ui.teamStats.units'), Spring.I18N('ui.teamStats.unitsKilled')}, - aggressionLevel = {Spring.I18N('ui.teamStats.aggression'), Spring.I18N('ui.teamStats.aggressionLevel')}, - actionsPerMinute = {Spring.I18N('ui.teamStats.actionsPerMinute1'), Spring.I18N('ui.teamStats.actionsPerMinute2')}, + frame = { " ", Spring.I18N("ui.teamStats.player") }, + metalProduced = { Spring.I18N("ui.teamStats.metal"), Spring.I18N("ui.teamStats.resourceProduced") }, + metalExcess = { Spring.I18N("ui.teamStats.metal"), Spring.I18N("ui.teamStats.resourceExcess") }, + energyProduced = { Spring.I18N("ui.teamStats.energy"), Spring.I18N("ui.teamStats.resourceProduced") }, + energyExcess = { Spring.I18N("ui.teamStats.energy"), Spring.I18N("ui.teamStats.resourceExcess") }, + damageDealt = { Spring.I18N("ui.teamStats.damage"), Spring.I18N("ui.teamStats.damageDealt") }, + damageReceived = { Spring.I18N("ui.teamStats.damage"), Spring.I18N("ui.teamStats.damageReceived") }, + damageEfficiency = { Spring.I18N("ui.teamStats.damage"), Spring.I18N("ui.teamStats.damageEfficiency") }, + unitsProduced = { Spring.I18N("ui.teamStats.units"), Spring.I18N("ui.teamStats.unitsProduced") }, + unitsDied = { Spring.I18N("ui.teamStats.units"), Spring.I18N("ui.teamStats.unitsDied") }, + unitsKilled = { Spring.I18N("ui.teamStats.units"), Spring.I18N("ui.teamStats.unitsKilled") }, + aggressionLevel = { Spring.I18N("ui.teamStats.aggression"), Spring.I18N("ui.teamStats.aggressionLevel") }, + actionsPerMinute = { Spring.I18N("ui.teamStats.actionsPerMinute1"), Spring.I18N("ui.teamStats.actionsPerMinute2") }, } end @@ -257,23 +253,23 @@ function widget:Initialize() refreshHeaders() guiData.mainPanel.visible = false widget:ViewResize() - local _,_, paused = Spring.GetGameSpeed() + local _, _, paused = Spring.GetGameSpeed() if paused then - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) end - WG['teamstats'] = {} - WG['teamstats'].toggle = function(state) + WG["teamstats"] = {} + WG["teamstats"].toggle = function(state) if state ~= nil then guiData.mainPanel.visible = state else guiData.mainPanel.visible = not guiData.mainPanel.visible end if guiData.mainPanel.visible then - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) end end - WG['teamstats'].isvisible = function() + WG["teamstats"].isvisible = function() return guiData.mainPanel.visible end end @@ -281,15 +277,15 @@ end function widget:Shutdown() glDeleteList(textDisplayList) glDeleteList(backgroundDisplayList) - if WG['guishader'] then - WG['guishader'].RemoveDlist('teamstats_window') + if WG["guishader"] then + WG["guishader"].RemoveDlist("teamstats_window") end if backgroundGuishader ~= nil then glDeleteList(backgroundGuishader) end end -function compareAllyTeams(a,b) +function compareAllyTeams(a, b) if sortAscending then return a[#a][sortVar] < b[#b][sortVar] else @@ -297,7 +293,7 @@ function compareAllyTeams(a,b) end end -function compareTeams(a,b) +function compareTeams(a, b) if sortAscending then return a[sortVar] < b[sortVar] else @@ -307,45 +303,47 @@ end function widget:PlayerChanged() isSpec = spGetSpectatingState() - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) end function widget:ApmEvent(teamID, apm) teamAPM[teamID] = apm end -function widget:GameFrame(n,forceupdate) +function widget:GameFrame(n, forceupdate) if n > 0 and not gameStarted then gameStarted = true forceupdate = true end - if gameover then return end + if gameover then + return + end - if not forceupdate and (not guiData.mainPanel.visible or n%update ~= 0) then + if not forceupdate and (not guiData.mainPanel.visible or n % update ~= 0) then return end teamData = {} local totalNumLines = 2 local allyInsertCount = 1 - for _,allyTeamID in ipairs(GetAllyTeamList()) do + for _, allyTeamID in ipairs(GetAllyTeamList()) do local allyVec = {} local allyTotal = {} local teamInsertCount = 1 - for _,teamID in ipairs(GetTeamList(allyTeamID)) do + for _, teamID in ipairs(GetTeamList(allyTeamID)) do if teamID ~= GetGaiaTeamID() then local range = GetTeamStatsHistory(teamID) - local history = GetTeamStatsHistory(teamID,range) + local history = GetTeamStatsHistory(teamID, range) if history then history = history[#history] - history.resourcesProduced = history.metalProduced + history.energyProduced/60 - history.resourcesUsed = history.metalUsed + history.energyUsed/60 - history.resourcesExcess = history.metalExcess + history.energyExcess/60 - history.resourcesSent = history.metalSent + history.energySent/60 - history.resourcesReceived = history.metalReceived + history.energyReceived/60 + history.resourcesProduced = history.metalProduced + history.energyProduced / 60 + history.resourcesUsed = history.metalUsed + history.energyUsed / 60 + history.resourcesExcess = history.metalExcess + history.energyExcess / 60 + history.resourcesSent = history.metalSent + history.energySent / 60 + history.resourcesReceived = history.metalReceived + history.energyReceived / 60 history.actionsPerMinute = teamAPM[teamID] or 0 - for varName,value in pairs(history) do - allyTotal[varName] = (allyTotal[varName] or 0 ) + value + for varName, value in pairs(history) do + allyTotal[varName] = (allyTotal[varName] or 0) + value end history.time = nil local teamColor @@ -354,44 +352,44 @@ function widget:GameFrame(n,forceupdate) else teamColor = { Spring.GetTeamColor(teamID) } end - local _,leader,isDead = GetTeamInfo(teamID,false) - local playerName,isActive = GetPlayerInfo(leader,false) + local _, leader, isDead = GetTeamInfo(teamID, false) + local playerName, isActive = GetPlayerInfo(leader, false) playerName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(leader) or playerName - if Spring.GetGameRulesParam('ainame_'..teamID) then - playerName = Spring.GetGameRulesParam('ainame_'..teamID) + if Spring.GetGameRulesParam("ainame_" .. teamID) then + playerName = Spring.GetGameRulesParam("ainame_" .. teamID) end if gameStarted ~= nil then if not playerName then - playerName = teamControllers[teamID] or Spring.I18N('ui.teamStats.gone', { player = '' }) + playerName = teamControllers[teamID] or Spring.I18N("ui.teamStats.gone", { player = "" }) else teamControllers[teamID] = playerName end if isDead then - playerName = Spring.I18N('ui.teamStats.dead', { player = playerName }) + playerName = Spring.I18N("ui.teamStats.dead", { player = playerName }) elseif not isActive then - playerName = Spring.I18N('ui.teamStats.gone', { player = playerName }) + playerName = Spring.I18N("ui.teamStats.gone", { player = playerName }) end end if history.damageReceived ~= 0 then - history.damageEfficiency = (history.damageDealt/history.damageReceived)*100 + history.damageEfficiency = (history.damageDealt / history.damageReceived) * 100 else history.damageEfficiency = huge end local totalRes = history.resourcesProduced + history.resourcesReceived if totalRes ~= 0 and history.damageDealt ~= 0 then - history.aggressionLevel = round(10*log10(history.damageDealt/totalRes)) + history.aggressionLevel = round(10 * log10(history.damageDealt / totalRes)) else history.aggressionLevel = -huge end if history.unitsDied ~= 0 then - history.killEfficiency = (history.unitsKilled/history.unitsDied)*100 + history.killEfficiency = (history.unitsKilled / history.unitsDied) * 100 else history.killEfficiency = huge end - playerName = playerName or '' + playerName = playerName or "" - history.frame = Spring.Utilities.ConvertColor(teamColor[1], teamColor[2], teamColor[3]) .. playerName..' ' + history.frame = Spring.Utilities.ConvertColor(teamColor[1], teamColor[2], teamColor[3]) .. playerName .. " " allyVec[teamInsertCount] = history totalNumLines = totalNumLines + 1 @@ -400,23 +398,23 @@ function widget:GameFrame(n,forceupdate) end end if teamInsertCount ~= 1 then - sort(allyVec,compareTeams) + sort(allyVec, compareTeams) if teamInsertCount > 2 then allyTotal.frame = " " allyTotal.time = nil if allyTotal.damageReceived ~= 0 then - allyTotal.damageEfficiency = (allyTotal.damageDealt/allyTotal.damageReceived)*100 + allyTotal.damageEfficiency = (allyTotal.damageDealt / allyTotal.damageReceived) * 100 else allyTotal.damageEfficiency = huge end local totalRes = allyTotal.resourcesProduced + allyTotal.resourcesReceived if totalRes ~= 0 and allyTotal.damageDealt ~= 0 then - allyTotal.aggressionLevel = round(10*log10(allyTotal.damageDealt/totalRes)) + allyTotal.aggressionLevel = round(10 * log10(allyTotal.damageDealt / totalRes)) else allyTotal.aggressionLevel = -huge end if allyTotal.unitsDied ~= 0 then - allyTotal.killEfficiency = (allyTotal.unitsKilled/allyTotal.unitsDied)*100 + allyTotal.killEfficiency = (allyTotal.unitsKilled / allyTotal.unitsDied) * 100 else allyTotal.killEfficiency = huge end @@ -431,8 +429,8 @@ function widget:GameFrame(n,forceupdate) end end totalNumLines = totalNumLines + 1 - sort(teamData,compareAllyTeams) - guiData.mainPanel.absSizes.y.min = guiData.mainPanel.absSizes.y.max - totalNumLines*lineHeight + sort(teamData, compareAllyTeams) + guiData.mainPanel.absSizes.y.min = guiData.mainPanel.absSizes.y.max - totalNumLines * lineHeight prevNumLines = totalNumLines glDeleteList(textDisplayList) textDisplayList = glCreateList(ReGenerateTextDisplayList) @@ -440,34 +438,33 @@ function widget:GameFrame(n,forceupdate) backgroundDisplayList = glCreateList(ReGenerateBackgroundDisplayList) end - function widget:GameOver() gameover = true if replaceEndStats then guiData.mainPanel.visible = true - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) Spring.SendCommands("endgraph 0") end end -function widget:MousePress(mx,my,button) +function widget:MousePress(mx, my, button) if not guiData.mainPanel.visible then return end - return mouseEvent(mx,my,button) + return mouseEvent(mx, my, button) end -function widget:MouseRelease(mx,my,button) +function widget:MouseRelease(mx, my, button) if not guiData.mainPanel.visible then return end - return mouseEvent(mx,my,button,true) + return mouseEvent(mx, my, button, true) end -function mouseEvent(mx,my,button,release) - local boxType = isAbove({x=mx,y=my},guiData) +function mouseEvent(mx, my, button, release) + local boxType = isAbove({ x = mx, y = my }, guiData) if not boxType and guiData.mainPanel.visible then - if release then + if release then guiData.mainPanel.visible = false return false end @@ -475,18 +472,18 @@ function mouseEvent(mx,my,button,release) end if boxType == "mainPanel" then if release then - local line, column = getLineAndColumn(mx,my) + local line, column = getLineAndColumn(mx, my) if line <= 3 then -- header local newSort = header[column] if newSort then if playSounds then - Spring.PlaySoundFile(buttonclick, 0.6, 'ui') + Spring.PlaySoundFile(buttonclick, 0.6, "ui") end if sortVar == newSort then sortAscending = not sortAscending end sortVar = newSort - widget:GameFrame(GetGameFrame(),true) + widget:GameFrame(GetGameFrame(), true) end end end @@ -494,33 +491,31 @@ function mouseEvent(mx,my,button,release) end end - -function getLineAndColumn(x,y) - local relativex = x - guiData.mainPanel.absSizes.x.min - columnSize/2 +function getLineAndColumn(x, y) + local relativex = x - guiData.mainPanel.absSizes.x.min - columnSize / 2 local relativey = guiData.mainPanel.absSizes.y.max - y - local line = floor(relativey/lineHeight) +1 - local column = floor(relativex/columnSize) +1 - return line,column + local line = floor(relativey / lineHeight) + 1 + local column = floor(relativex / columnSize) + 1 + return line, column end - function updateFontSize() columnSize = guiData.mainPanel.absSizes.x.length / numColums - local fakeColumnSize = guiData.mainPanel.absSizes.x.length / (numColums-1) - fontSize = 11*widgetScale + floor(fakeColumnSize/maxColumnTextSize) + local fakeColumnSize = guiData.mainPanel.absSizes.x.length / (numColums - 1) + fontSize = 11 * widgetScale + floor(fakeColumnSize / maxColumnTextSize) fontSize = fontSize * playerScale lineHeight = fontSize - fontSize = fontSize + mathMin(fontSize * 0.5, (fontSize * ((1-playerScale)*0.7))) + fontSize = fontSize + mathMin(fontSize * 0.5, (fontSize * ((1 - playerScale) * 0.7))) end -function widget:MouseMove(mx,my,dx,dy) +function widget:MouseMove(mx, my, dx, dy) if not guiData.mainPanel.visible then return end - local boxType = isAbove({x=mx,y=my},guiData) - local newLine,newColumn + local boxType = isAbove({ x = mx, y = my }, guiData) + local newLine, newColumn if boxType == "mainPanel" then - newLine,newColumn = getLineAndColumn(mx,my) + newLine, newColumn = getLineAndColumn(mx, my) end if selectedLine ~= newLine or selectedColumn ~= newColumn then selectedLine, selectedColumn = newLine, newColumn @@ -530,11 +525,11 @@ function widget:MouseMove(mx,my,dx,dy) end function widget:Update(dt) - local x,y = GetMouseState() + local x, y = GetMouseState() if x ~= mousex or y ~= mousey then - widget:MouseMove(x,y,x-mousex,y-mousey) + widget:MouseMove(x, y, x - mousex, y - mousey) end - mousex,mousey = x,y + mousex, mousey = x, y end local function DrawBackground() @@ -542,17 +537,17 @@ local function DrawBackground() return end - gl.Color(0,0,0,WG['guishader'] and 0.8 or 0.85) - local x1,y1,x2,y2 = mathFloor(guiData.mainPanel.absSizes.x.min), mathFloor(guiData.mainPanel.absSizes.y.min), mathFloor(guiData.mainPanel.absSizes.x.max), mathFloor(guiData.mainPanel.absSizes.y.max) - UiElement(x1-bgpadding,y1-bgpadding,x2+bgpadding,y2+bgpadding, 1, 1, 1, 1, 1,1,1,1, WG.FlowUI.clampedOpacity) - if WG['guishader'] then + gl.Color(0, 0, 0, WG["guishader"] and 0.8 or 0.85) + local x1, y1, x2, y2 = mathFloor(guiData.mainPanel.absSizes.x.min), mathFloor(guiData.mainPanel.absSizes.y.min), mathFloor(guiData.mainPanel.absSizes.x.max), mathFloor(guiData.mainPanel.absSizes.y.max) + UiElement(x1 - bgpadding, y1 - bgpadding, x2 + bgpadding, y2 + bgpadding, 1, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) + if WG["guishader"] then if backgroundGuishader ~= nil then glDeleteList(backgroundGuishader) end - backgroundGuishader = glCreateList( function() - RectRound(x1-bgpadding,y1-bgpadding,x2+bgpadding,y2+bgpadding, elementCorner) + backgroundGuishader = glCreateList(function() + RectRound(x1 - bgpadding, y1 - bgpadding, x2 + bgpadding, y2 + bgpadding, elementCorner) end) - WG['guishader'].InsertDlist(backgroundGuishader,'teamstats_window') + WG["guishader"].InsertDlist(backgroundGuishader, "teamstats_window") end if backgroundDisplayList then @@ -571,8 +566,8 @@ end function widget:DrawScreen() if not guiData.mainPanel.visible then - if WG['guishader'] then - WG['guishader'].RemoveDlist('teamstats_window') + if WG["guishader"] then + WG["guishader"].RemoveDlist("teamstats_window") end return end @@ -581,21 +576,21 @@ function widget:DrawScreen() DrawAllStats() local mx, my = spGetMouseState() - local x1,y1,x2,y2 = mathFloor(guiData.mainPanel.absSizes.x.min), mathFloor(guiData.mainPanel.absSizes.y.min), mathFloor(guiData.mainPanel.absSizes.x.max), mathFloor(guiData.mainPanel.absSizes.y.max) - if math_isInRect(mx, my, x1,y1,x2,y2) then - Spring.SetMouseCursor('cursornormal') + local x1, y1, x2, y2 = mathFloor(guiData.mainPanel.absSizes.x.min), mathFloor(guiData.mainPanel.absSizes.y.min), mathFloor(guiData.mainPanel.absSizes.x.max), mathFloor(guiData.mainPanel.absSizes.y.max) + if math_isInRect(mx, my, x1, y1, x2, y2) then + Spring.SetMouseCursor("cursornormal") end end function ReGenerateBackgroundDisplayList() - gl.Texture(false) -- some other widget left it on + gl.Texture(false) -- some other widget left it on local boxSizes = guiData.mainPanel.absSizes - for lineCount=1,prevNumLines do + for lineCount = 1, prevNumLines do local colour = evenLineColour - if lineCount == 1 or lineCount == 2 then + if lineCount == 1 or lineCount == 2 then colour = sortLineColour end - if lineCount > 2 and (lineCount+1)%2 == 0 then + if lineCount > 2 and (lineCount + 1) % 2 == 0 then colour = oddLineColour end if lineCount == selectedLine and selectedLine > 3 then @@ -607,27 +602,27 @@ function ReGenerateBackgroundDisplayList() if mathFloor(boxSizes.x.min) >= guiData.mainPanel.absSizes.y.min then bottomCorner = 1 end - RectRound(mathFloor(boxSizes.x.min), mathFloor(boxSizes.y.max -lineCount*lineHeight), mathFloor(boxSizes.x.max), mathFloor(boxSizes.y.max -(lineCount-1)*lineHeight), bgpadding, 0,0,bottomCorner,bottomCorner, {colour[1],colour[2],colour[3],colour[4]*ui_opacity}, {colour[1],colour[2],colour[3],colour[4]*3*ui_opacity}) + RectRound(mathFloor(boxSizes.x.min), mathFloor(boxSizes.y.max - lineCount * lineHeight), mathFloor(boxSizes.x.max), mathFloor(boxSizes.y.max - (lineCount - 1) * lineHeight), bgpadding, 0, 0, bottomCorner, bottomCorner, { colour[1], colour[2], colour[3], colour[4] * ui_opacity }, { colour[1], colour[2], colour[3], colour[4] * 3 * ui_opacity }) elseif lineCount == 1 then --RectRound(boxSizes.x.min, boxSizes.y.max -(lineCount+1)*lineHeight, boxSizes.x.max, boxSizes.y.max -(lineCount-1)*lineHeight, 3*widgetScale) end end if selectedLine and selectedLine < 3 and selectedColumn and selectedColumn > 0 and selectedColumn <= numColums then if sortAscending then - glColor(sortHighLightColour[1], sortHighLightColour[2], sortHighLightColour[3], sortHighLightColour[4]*ui_opacity) + glColor(sortHighLightColour[1], sortHighLightColour[2], sortHighLightColour[3], sortHighLightColour[4] * ui_opacity) else - glColor(sortHighLightColourDesc[1], sortHighLightColourDesc[2], sortHighLightColourDesc[3], sortHighLightColourDesc[4]*ui_opacity) + glColor(sortHighLightColourDesc[1], sortHighLightColourDesc[2], sortHighLightColourDesc[3], sortHighLightColourDesc[4] * ui_opacity) end - RectRound(mathFloor(boxSizes.x.min +(selectedColumn)*columnSize-columnSize/2), mathFloor(boxSizes.y.max -2*lineHeight), mathFloor(boxSizes.x.min +(selectedColumn+1)*columnSize-columnSize/2), mathFloor(boxSizes.y.max), bgpadding, 0,0,1,1) + RectRound(mathFloor(boxSizes.x.min + selectedColumn * columnSize - columnSize / 2), mathFloor(boxSizes.y.max - 2 * lineHeight), mathFloor(boxSizes.x.min + (selectedColumn + 1) * columnSize - columnSize / 2), mathFloor(boxSizes.y.max), bgpadding, 0, 0, 1, 1) end for selectedIndex, headerName in ipairs(header) do if sortVar == headerName then if sortAscending then - glColor(activeSortColour[1], activeSortColour[2], activeSortColour[3], activeSortColour[4]*ui_opacity) + glColor(activeSortColour[1], activeSortColour[2], activeSortColour[3], activeSortColour[4] * ui_opacity) else - glColor(activeSortColourDesc[1], activeSortColourDesc[2], activeSortColourDesc[3], activeSortColourDesc[4]*ui_opacity) + glColor(activeSortColourDesc[1], activeSortColourDesc[2], activeSortColourDesc[3], activeSortColourDesc[4] * ui_opacity) end - RectRound(mathFloor(boxSizes.x.min +(selectedIndex)*columnSize-columnSize/2), mathFloor(boxSizes.y.max -2*lineHeight), mathFloor(boxSizes.x.min +(selectedIndex+1)*columnSize-columnSize/2), mathFloor(boxSizes.y.max), bgpadding, 0,0,1,1) + RectRound(mathFloor(boxSizes.x.min + selectedIndex * columnSize - columnSize / 2), mathFloor(boxSizes.y.max - 2 * lineHeight), mathFloor(boxSizes.x.min + (selectedIndex + 1) * columnSize - columnSize / 2), mathFloor(boxSizes.y.max), bgpadding, 0, 0, 1, 1) break end end @@ -637,62 +632,62 @@ function ReGenerateTextDisplayList() local lineCount = 1 local boxSizes = guiData.mainPanel.absSizes local baseXSize = boxSizes.x.min + columnSize - local baseYSize = boxSizes.y.max - (0.002*vsy) -- small align adjustment so text is in the middle of a row + local baseYSize = boxSizes.y.max - (0.002 * vsy) -- small align adjustment so text is in the middle of a row font:Begin() font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 1) - --print the header - local colCount = 0 - local heightCorrection = lineHeight*((1-fontSizePercentage)/2) - - for _, headerName in ipairs(header) do - font:Print(headerRemap[headerName][1], baseXSize + columnSize*colCount, baseYSize+heightCorrection-lineCount*lineHeight, (fontSize*fontSizePercentage), "dco") - font:Print(headerRemap[headerName][2], baseXSize + columnSize*colCount, baseYSize+heightCorrection-(lineCount+1)*lineHeight, (fontSize*fontSizePercentage), "dco") - colCount = colCount + 1 - end - lineCount = lineCount + 3 - - for _, allyTeamData in ipairs(teamData) do - for _, teamData in ipairs(allyTeamData) do - local colCount = 0 - for i, varName in ipairs(header) do - local value = teamData[varName] - if value == huge or value == -huge then - value = "-" - elseif tonumber(value) then - local v = tonumber(value) - if varName:sub(1,5) ~= "units" and varName ~= "aggressionLevel" then - if v and math.abs(v) < 1 then - v = 0 - end + --print the header + local colCount = 0 + local heightCorrection = lineHeight * ((1 - fontSizePercentage) / 2) + + for _, headerName in ipairs(header) do + font:Print(headerRemap[headerName][1], baseXSize + columnSize * colCount, baseYSize + heightCorrection - lineCount * lineHeight, (fontSize * fontSizePercentage), "dco") + font:Print(headerRemap[headerName][2], baseXSize + columnSize * colCount, baseYSize + heightCorrection - (lineCount + 1) * lineHeight, (fontSize * fontSizePercentage), "dco") + colCount = colCount + 1 + end + lineCount = lineCount + 3 + + for _, allyTeamData in ipairs(teamData) do + for _, teamData in ipairs(allyTeamData) do + local colCount = 0 + for i, varName in ipairs(header) do + local value = teamData[varName] + if value == huge or value == -huge then + value = "-" + elseif tonumber(value) then + local v = tonumber(value) + if varName:sub(1, 5) ~= "units" and varName ~= "aggressionLevel" then + if v and math.abs(v) < 1 then + v = 0 end - value = string.formatSI(v) end - if varName == "damageEfficiency" or varName == "killEfficiency" then - value = value .. "%" - end - local color = '' - if teamData.frame == " " then - color = '\255\255\220\130' - elseif lineCount % 2 == 1 then - color = '\255\200\200\200' - end - if i == 1 then - font2:Begin() - font2:Print(color..value, baseXSize + columnSize*colCount, baseYSize+(heightCorrection*1.66)-lineCount*lineHeight, (fontSize*fontSizePercentage), "dco") - font2:End() - else - font:Print(color..value, baseXSize + columnSize*colCount, baseYSize+heightCorrection-lineCount*lineHeight, (fontSize*fontSizePercentage), "dco") - end - colCount = colCount + 1 + value = string.formatSI(v) end - lineCount = lineCount + 1 - end - if not isFFA then - lineCount = lineCount + 1 -- add line break after end of allyteam + if varName == "damageEfficiency" or varName == "killEfficiency" then + value = value .. "%" + end + local color = "" + if teamData.frame == " " then + color = "\255\255\220\130" + elseif lineCount % 2 == 1 then + color = "\255\200\200\200" + end + if i == 1 then + font2:Begin() + font2:Print(color .. value, baseXSize + columnSize * colCount, baseYSize + (heightCorrection * 1.66) - lineCount * lineHeight, (fontSize * fontSizePercentage), "dco") + font2:End() + else + font:Print(color .. value, baseXSize + columnSize * colCount, baseYSize + heightCorrection - lineCount * lineHeight, (fontSize * fontSizePercentage), "dco") + end + colCount = colCount + 1 end + lineCount = lineCount + 1 + end + if not isFFA then + lineCount = lineCount + 1 -- add line break after end of allyteam end + end font:End() end diff --git a/luaui/Widgets/gui_tooltip.lua b/luaui/Widgets/gui_tooltip.lua index b85b7bba0c0..97c698a4de9 100644 --- a/luaui/Widgets/gui_tooltip.lua +++ b/luaui/Widgets/gui_tooltip.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathCeil = math.ceil local mathFloor = math.floor @@ -40,7 +39,8 @@ You can use 'AddTooltip' to add a screen area that will display a tooltip when y Use 'ShowTooltip' to directly show a tooltip, the name you give should be unique, and not one you desined in 'AddTooltip' (the name will be deleted after use) -]]-- +]] +-- local defaultDelay = 0.37 local cfgFontSize = 14 @@ -66,7 +66,7 @@ local RectRound, UiElement, bgpadding -- Texture pool for reusing textures instead of recreating them local texturePool = {} -local currentTooltipName = nil -- Track which tooltip is currently displayed +local currentTooltipName = nil -- Track which tooltip is currently displayed -- Get or create a texture from the pool local function getPooledTexture(width, height, key) @@ -94,7 +94,9 @@ end -- Return a texture to the pool for reuse local function returnTextureToPool(texture, width, height) - if not texture then return end + if not texture then + return + end local w = math_floor(width) local h = math_floor(height) @@ -115,31 +117,28 @@ end -- Clear all textures for a tooltip (called when content changes) local function clearTooltipTextures(name) if tooltips[name].bgTex then - returnTextureToPool(tooltips[name].bgTex, - tooltips[name].bgTexWidth, tooltips[name].bgTexHeight) + returnTextureToPool(tooltips[name].bgTex, tooltips[name].bgTexWidth, tooltips[name].bgTexHeight) tooltips[name].bgTex = nil tooltips[name].bgTexWidth = nil tooltips[name].bgTexHeight = nil end if tooltips[name].contentTex then - returnTextureToPool(tooltips[name].contentTex, - tooltips[name].contentTexWidth, tooltips[name].contentTexHeight) + returnTextureToPool(tooltips[name].contentTex, tooltips[name].contentTexWidth, tooltips[name].contentTexHeight) tooltips[name].contentTex = nil tooltips[name].contentTexWidth = nil tooltips[name].contentTexHeight = nil end end - function widget:Initialize() widget:ViewResize(vsx, vsy) - if WG['tooltip'] == nil then - WG['tooltip'] = {} - WG['tooltip'].getFontsize = function() + if WG["tooltip"] == nil then + WG["tooltip"] = {} + WG["tooltip"].getFontsize = function() return usedFontSize end - WG['tooltip'].AddTooltip = function(name, area, value, delay, title) + WG["tooltip"].AddTooltip = function(name, area, value, delay, title) if ((value ~= nil or title ~= nil) and area[1] ~= nil and area[2] ~= nil and area[3] ~= nil and area[4] ~= nil) or (tooltips[name] ~= nil and (tooltips[name].value ~= nil or tooltips[name].title ~= nil)) then if delay == nil then delay = defaultDelay @@ -158,7 +157,7 @@ function widget:Initialize() end end end - WG['tooltip'].RemoveTooltip = function(name) + WG["tooltip"].RemoveTooltip = function(name) if tooltips[name] ~= nil then if tooltips[name].dlist then gl.DeleteList(tooltips[name].dlist) @@ -168,7 +167,7 @@ function widget:Initialize() tooltips[name] = nil end end - WG['tooltip'].ShowTooltip = function(name, value, x, y, title) + WG["tooltip"].ShowTooltip = function(name, value, x, y, title) if value ~= nil or title ~= nil then if not tooltips[name] then tooltips[name] = {} @@ -202,10 +201,10 @@ function widget:Initialize() end function widget:Shutdown() - if WG['guishader'] then + if WG["guishader"] then for name, tooltip in pairs(tooltips) do - WG['guishader'].RemoveScreenRect('tooltip_' .. name) - WG['guishader'].RemoveScreenRect('2tooltip_' .. name) + WG["guishader"].RemoveScreenRect("tooltip_" .. name) + WG["guishader"].RemoveScreenRect("2tooltip_" .. name) if tooltip.dlist then gl.DeleteList(tooltip.dlist) end @@ -225,27 +224,27 @@ function widget:Shutdown() end texturePool = {} - WG['tooltip'] = nil + WG["tooltip"] = nil end function widget:ViewResize(x, y) vsx, vsy = spGetViewGeometry() - font, loadedFontSize = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2, 1.6) + font, loadedFontSize = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2, 1.6) widgetScale = (1 + ((vsy - 850) / 900)) * (0.95 + (ui_scale - 1) / 2.5) usedFontSize = cfgFontSize * widgetScale - yOffset = -mathFloor(xOffset*0.5) - usedFontSize + yOffset = -mathFloor(xOffset * 0.5) - usedFontSize bgpadding = mathCeil(WG.FlowUI.elementPadding * 0.66) RectRound = WG.FlowUI.Draw.RectRound UiElement = WG.FlowUI.Draw.Element for name, tooltip in pairs(tooltips) do - if WG['guishader'] then - WG['guishader'].RemoveScreenRect('tooltip_' .. name) - WG['guishader'].RemoveScreenRect('2tooltip_' .. name) + if WG["guishader"] then + WG["guishader"].RemoveScreenRect("tooltip_" .. name) + WG["guishader"].RemoveScreenRect("2tooltip_" .. name) end if tooltip.dlist then gl.DeleteList(tooltip.dlist) @@ -260,13 +259,8 @@ function widget:ViewResize(x, y) end local function drawTooltipBackground(addX, addY, paddingW, paddingH, maxWidth, maxHeight, borderSize) - RectRound(addX-paddingW-borderSize, addY-maxHeight - paddingH-borderSize, - addX+maxWidth + paddingW+borderSize, addY+paddingH+borderSize, - bgpadding*1.4, 1,1,1,1, {0,0,0,0.08}) - UiElement(addX-paddingW, addY-maxHeight-paddingH, addX+maxWidth + paddingW, addY+paddingH, - 1,1,1,1, 1,1,1,1, nil, - {0.85, 0.85, 0.85, (WG['guishader'] and 0.7 or 0.93)}, - {0, 0, 0, (WG['guishader'] and 0.5 or 0.56)}, bgpadding) + RectRound(addX - paddingW - borderSize, addY - maxHeight - paddingH - borderSize, addX + maxWidth + paddingW + borderSize, addY + paddingH + borderSize, bgpadding * 1.4, 1, 1, 1, 1, { 0, 0, 0, 0.08 }) + UiElement(addX - paddingW, addY - maxHeight - paddingH, addX + maxWidth + paddingW, addY + paddingH, 1, 1, 1, 1, 1, 1, 1, 1, nil, { 0.85, 0.85, 0.85, (WG["guishader"] and 0.7 or 0.93) }, { 0, 0, 0, (WG["guishader"] and 0.5 or 0.56) }, bgpadding) end local function drawTooltipContent(name, addX, addY, paddingH, lines) @@ -275,21 +269,20 @@ local function drawTooltipContent(name, addX, addY, paddingH, lines) local lineHeight = fontSize + (fontSize / 4.5) local maxHeight = math_floor(-fontSize * 0.9) - if tooltips[name].title and tooltips[name].title ~= '' then + if tooltips[name].title and tooltips[name].title ~= "" then maxHeight = math_ceil(maxHeight - (titleFontSize * 0.1)) font2:Begin(true) - font2:SetOutlineColor(0,0,0,0.6) - font2:Print('\255\205\255\205'..tooltips[name].title, addX, - maxHeight+addY, titleFontSize, "o") + font2:SetOutlineColor(0, 0, 0, 0.6) + font2:Print("\255\205\255\205" .. tooltips[name].title, addX, maxHeight + addY, titleFontSize, "o") font2:End() maxHeight = math_ceil(maxHeight - (titleFontSize * 1.12)) end - if tooltips[name].value and tooltips[name].value ~= '' then + if tooltips[name].value and tooltips[name].value ~= "" then font:Begin(true) - font:SetOutlineColor(0,0,0,0.4) + font:SetOutlineColor(0, 0, 0, 0.4) for i, line in ipairs(lines) do - font:Print('\255\244\244\244' .. line, addX, maxHeight+addY, fontSize, "o") + font:Print("\255\244\244\244" .. line, addX, maxHeight + addY, fontSize, "o") maxHeight = maxHeight - lineHeight end font:End() @@ -300,8 +293,8 @@ local function drawTooltip(name, x, y) local paddingH = math_floor(9.5 * widgetScale) local paddingW = math_floor(paddingH * 1.42) - local addX = mathFloor(vsx*0.33) -- temp add something so flowui doesnt think its near screen edge - local addY = mathFloor(vsy*0.5) -- temp add something so flowui doesnt think its near screen edge + local addX = mathFloor(vsx * 0.33) -- temp add something so flowui doesnt think its near screen edge + local addY = mathFloor(vsy * 0.5) -- temp add something so flowui doesnt think its near screen edge -- Calculate dimensions if not already done if not tooltips[name].maxWidth or not tooltips[name].maxHeight then @@ -311,12 +304,11 @@ local function drawTooltip(name, x, y) local lines local maxWidth = 0 local maxHeight = 0 - if tooltips[name].title and tooltips[name].title ~= '' then - maxWidth = math_ceil(mathMax(maxWidth, - (font:GetTextWidth(tooltips[name].title) * titleFontSize))) + if tooltips[name].title and tooltips[name].title ~= "" then + maxWidth = math_ceil(mathMax(maxWidth, (font:GetTextWidth(tooltips[name].title) * titleFontSize))) maxHeight = math_ceil(maxHeight + (titleFontSize * 1.22)) end - if tooltips[name].value and tooltips[name].value ~= '' then + if tooltips[name].value and tooltips[name].value ~= "" then -- get text dimentions lines = string_lines(tooltips[name].value) for i, line in ipairs(lines) do @@ -347,17 +339,12 @@ local function drawTooltip(name, x, y) tooltips[name].bgTexWidth = w tooltips[name].bgTexHeight = h if tooltips[name].bgTex then - gl.R2tHelper.RenderToTexture(tooltips[name].bgTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / w, 2 / h, 0) - gl.Translate(-addX + paddingW + borderSize, - -addY + maxHeight + paddingH + borderSize, 0) - drawTooltipBackground(addX, addY, paddingW, paddingH, - maxWidth, maxHeight, borderSize) - end, - true - ) + gl.R2tHelper.RenderToTexture(tooltips[name].bgTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / w, 2 / h, 0) + gl.Translate(-addX + paddingW + borderSize, -addY + maxHeight + paddingH + borderSize, 0) + drawTooltipBackground(addX, addY, paddingW, paddingH, maxWidth, maxHeight, borderSize) + end, true) end end end @@ -369,15 +356,12 @@ local function drawTooltip(name, x, y) tooltips[name].contentTexWidth = w tooltips[name].contentTexHeight = h if tooltips[name].contentTex then - gl.R2tHelper.RenderToTexture(tooltips[name].contentTex, - function() - gl.Translate(-1, -1, 0) - gl.Scale(2 / w, 2 / h, 0) - gl.Translate(-addX + paddingW, -addY + maxHeight + paddingH, 0) - drawTooltipContent(name, addX, addY, paddingH, tooltips[name].lines) - end, - true - ) + gl.R2tHelper.RenderToTexture(tooltips[name].contentTex, function() + gl.Translate(-1, -1, 0) + gl.Scale(2 / w, 2 / h, 0) + gl.Translate(-addX + paddingW, -addY + maxHeight + paddingH, 0) + drawTooltipContent(name, addX, addY, paddingH, tooltips[name].lines) + end, true) end end end @@ -398,43 +382,33 @@ local function drawTooltip(name, x, y) posY = 0 + maxHeight + paddingH + paddingH end - if WG['guishader'] then - WG['guishader'].InsertScreenRect(posX - paddingW + bgpadding, - posY - maxHeight - paddingH, posX + maxWidth + paddingW -bgpadding, - posY + paddingH, 'tooltip_' .. name) - WG['guishader'].InsertScreenRect(posX - paddingW, - posY - maxHeight - paddingH + bgpadding, posX + maxWidth + paddingW, - posY + paddingH - bgpadding, '2tooltip_' .. name) + if WG["guishader"] then + WG["guishader"].InsertScreenRect(posX - paddingW + bgpadding, posY - maxHeight - paddingH, posX + maxWidth + paddingW - bgpadding, posY + paddingH, "tooltip_" .. name) + WG["guishader"].InsertScreenRect(posX - paddingW, posY - maxHeight - paddingH + bgpadding, posX + maxWidth + paddingW, posY + paddingH - bgpadding, "2tooltip_" .. name) end if tooltips[name].bgTex then - gl.R2tHelper.BlendTexRect(tooltips[name].bgTex, - posX - paddingW - borderSize, posY - maxHeight - paddingH - borderSize, - posX + maxWidth + paddingW + borderSize, posY + paddingH + borderSize, - true) + gl.R2tHelper.BlendTexRect(tooltips[name].bgTex, posX - paddingW - borderSize, posY - maxHeight - paddingH - borderSize, posX + maxWidth + paddingW + borderSize, posY + paddingH + borderSize, true) end if tooltips[name].contentTex then - gl.R2tHelper.BlendTexRect(tooltips[name].contentTex, - posX - paddingW, posY - maxHeight - paddingH, - posX + maxWidth + paddingW, posY + paddingH, - true) + gl.R2tHelper.BlendTexRect(tooltips[name].contentTex, posX - paddingW, posY - maxHeight - paddingH, posX + maxWidth + paddingW, posY + paddingH, true) end end function widget:DrawScreen() - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then return end - if WG['unitstats'] and WG['unitstats'].isShowing() then + if WG["unitstats"] and WG["unitstats"].isShowing() then return end local x, y = spGetMouseState() local now = os.clock() - if WG['guishader'] then + if WG["guishader"] then for name, _ in pairs(cleanupGuishaderAreas) do - WG['guishader'].RemoveScreenRect('tooltip_' .. name) - WG['guishader'].RemoveScreenRect('2tooltip_' .. name) + WG["guishader"].RemoveScreenRect("tooltip_" .. name) + WG["guishader"].RemoveScreenRect("2tooltip_" .. name) cleanupGuishaderAreas[name] = nil end end @@ -465,9 +439,9 @@ function widget:DrawScreen() else if tooltip.displayTime ~= nil then tooltip.displayTime = nil - if WG['guishader'] then - WG['guishader'].RemoveScreenRect('tooltip_' .. name) - WG['guishader'].RemoveScreenRect('2tooltip_' .. name) + if WG["guishader"] then + WG["guishader"].RemoveScreenRect("tooltip_" .. name) + WG["guishader"].RemoveScreenRect("2tooltip_" .. name) end end end diff --git a/luaui/Widgets/gui_top_bar.lua b/luaui/Widgets/gui_top_bar.lua index 01c9895bb1f..95afc9d1e80 100644 --- a/luaui/Widgets/gui_top_bar.lua +++ b/luaui/Widgets/gui_top_bar.lua @@ -49,8 +49,8 @@ local cfg = { escapeKeyPressesQuit = false, allowSavegame = true, -- Spring.Utilities.ShowDevUI() spawnWarpInFrame = Game.spawnWarpInFrame, - useSkew = true, -- toggle trapezoidal/parallelogram skew on all UI elements - skewAngleDeg = 20, -- angle of skew slope in degrees + useSkew = true, -- toggle trapezoidal/parallelogram skew on all UI elements + skewAngleDeg = 20, -- angle of skew slope in degrees smallElementHeightFraction = 0.85, -- wind/tidal/coms/buttons height as fraction of topbar } @@ -63,7 +63,7 @@ local gaiaTeamID = Spring.GetGaiaTeamID() local spec = sp.GetSpectatingState() local myAllyTeamID = sp.GetMyAllyTeamID() local myTeamID = sp.GetMyTeamID() -local mmLevel = sp.GetTeamRulesParam(myTeamID, 'mmLevel') +local mmLevel = sp.GetTeamRulesParam(myTeamID, "mmLevel") local myAllyTeamList = sp.GetTeamList(myAllyTeamID) local numTeamsInAllyTeam = #myAllyTeamList @@ -80,7 +80,7 @@ local gameIsOver = false local graphsWindowVisible = false -- Resources -local r = { metal = { sp.GetTeamResources(myTeamID, 'metal') }, energy = { sp.GetTeamResources(myTeamID, 'energy') } } +local r = { metal = { sp.GetTeamResources(myTeamID, "metal") }, energy = { sp.GetTeamResources(myTeamID, "energy") } } local energyOverflowLevel, metalOverflowLevel local allyteamOverflowingMetal = false local allyteamOverflowingEnergy = false @@ -105,16 +105,16 @@ local minWind = Game.windMin local maxWind = Game.windMax local minWindText = "\255\166\166\166" .. tostring(minWind) local maxWindText = "\255\166\166\166" .. tostring(maxWind) -local noWindText1 = "\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind1') -local noWindText2 = "\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind2') -local windFunctions = VFS.Include('common/wind_functions.lua') +local noWindText1 = "\255\200\200\200" .. Spring.I18N("ui.topbar.wind.nowind1") +local noWindText2 = "\255\200\200\200" .. Spring.I18N("ui.topbar.wind.nowind2") +local windFunctions = VFS.Include("common/wind_functions.lua") local function refreshWindTidalTextCache() tidalSpeedText = "\255\255\255\255" .. tostring(tidalSpeed) minWindText = "\255\166\166\166" .. tostring(minWind) maxWindText = "\255\166\166\166" .. tostring(maxWind) - noWindText1 = "\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind1') - noWindText2 = "\255\200\200\200" .. Spring.I18N('ui.topbar.wind.nowind2') + noWindText1 = "\255\200\200\200" .. Spring.I18N("ui.topbar.wind.nowind1") + noWindText2 = "\255\200\200\200" .. Spring.I18N("ui.topbar.wind.nowind2") end -- Commanders @@ -123,7 +123,7 @@ local enemyComs = 0 -- if we are counting ourselves because we are a spec local enemyComCount = 0 -- if we are receiving a count from the gadget part (needs modoption on) local prevEnemyComCount = 0 local isCommander = {} -local commanderUnitDefIDs = {} -- Array of commander unitDefIDs for faster iteration +local commanderUnitDefIDs = {} -- Array of commander unitDefIDs for faster iteration local displayComCounter = false -- OpenGL (only localize functions used in hot paths) @@ -149,7 +149,7 @@ local textures = { energyGlow = "LuaUI/Images/paralyzed.png", blades = ":n:LuaUI/Images/wind-blades.png", waves = ":n:LuaUI/Images/tidal-waves.png", - com = ":n:Icons/corcom.png" + com = ":n:Icons/corcom.png", } local textWarnColor = "\255\255\215\215" @@ -177,7 +177,7 @@ local showButtons = true local autoHideButtons = false local showResourceBars = true local widgetSpaceMargin, bgpadding, RectRound, RectRoundOutline, TexturedRectRound, UiElement, UiButton, UiSliderKnob -local updateRes = { metal = {false,false,false,false}, energy = {false,false,false,false} } +local updateRes = { metal = { false, false, false, false }, energy = { false, false, false, false } } -- Display Lists (consolidated into table to save local slots) local dlist = { @@ -198,7 +198,7 @@ local dlist = { local cache = { lastPullIncomeText = { metal = -1, energy = -1 }, lastStorageValue = { metal = -1, energy = -1 }, - lastStorageText = { metal = '', energy = '' }, + lastStorageText = { metal = "", energy = "" }, lastWarning = { metal = nil, energy = nil }, lastValueWidth = { metal = -1, energy = -1 }, lastResbarValueWidth = { metal = 1, energy = 1 }, @@ -206,32 +206,30 @@ local cache = { } -- Reused scratch tables for DrawScreen to avoid per-frame allocations. -local resourceNames = { 'metal', 'energy' } +local resourceNames = { "metal", "energy" } local windTextScissor = { 0, 0, 0, 0 } local comCounterScissor = { 0, 0, 0, 0 } local storageScissors = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 } } local activeStorageScissors = { nil, nil } - -- Smoothing local smoothedResources = { - metal = {0, 0, 0, 0, 0, 0}, -- Init - energy = {0, 0, 0, 0, 0, 0} -- Init + metal = { 0, 0, 0, 0, 0, 0 }, -- Init + energy = { 0, 0, 0, 0, 0, 0 }, -- Init } local smoothingFactor = 0.5 local oneMinusSmoothingFactor = 1 - smoothingFactor local function smoothResources() - local sm = smoothedResources.metal - local rm = r.metal - local se = smoothedResources.energy - local re = r.energy - for i = 1, 6 do - sm[i] = sm[i] == 0 and rm[i] or (smoothingFactor * rm[i] + oneMinusSmoothingFactor * sm[i]) - se[i] = se[i] == 0 and re[i] or (smoothingFactor * re[i] + oneMinusSmoothingFactor * se[i]) - end + local sm = smoothedResources.metal + local rm = r.metal + local se = smoothedResources.energy + local re = r.energy + for i = 1, 6 do + sm[i] = sm[i] == 0 and rm[i] or (smoothingFactor * rm[i] + oneMinusSmoothingFactor * sm[i]) + se[i] = se[i] == 0 and re[i] or (smoothingFactor * re[i] + oneMinusSmoothingFactor * se[i]) + end end - -- Interactions local draggingShareIndicatorValue = {} local draggingConversionIndicatorValue, draggingShareIndicator, draggingConversionIndicator @@ -240,8 +238,8 @@ local font, font2, firstButton, fontSize, comcountChanged, showQuitscreen, resba -- Audio local playSounds = true -local leftclick = 'LuaUI/Sounds/tock.wav' -local resourceclick = 'LuaUI/Sounds/buildbar_click.wav' +local leftclick = "LuaUI/Sounds/tock.wav" +local resourceclick = "LuaUI/Sounds/buildbar_click.wav" -- Timers + intervals (consolidated into table to save local slots) local osClock = os.clock @@ -264,7 +262,7 @@ local function getPlayerLiveAllyCount() local nAllies = 0 for _, teamID in ipairs(myAllyTeamList) do if teamID ~= myTeamID then - local _, _, isDead, hasAI = Spring.GetTeamInfo(teamID,false) + local _, _, isDead, hasAI = Spring.GetTeamInfo(teamID, false) if not isDead and not hasAI then nAllies = nAllies + 1 end @@ -302,8 +300,8 @@ function widget:ViewResize() UiButton = WG.FlowUI.Draw.Button UiSliderKnob = WG.FlowUI.Draw.SliderKnob - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) for n, _ in pairs(dlist.windText) do dlist.windText[n] = glDeleteList(dlist.windText[n]) @@ -326,7 +324,7 @@ local shortCache = {} local shortCacheCount = 0 local function short(n, f) f = f or 0 - local key = n .. ':' .. f + local key = n .. ":" .. f if shortCache[key] then return shortCache[key] end @@ -356,43 +354,61 @@ local function updateButtons() local prevButtonsArea = buttonsArea -- if not buttonsArea['buttons'] then -- With this condition it doesn't actually update buttons if they were already added - buttonsArea['buttons'] = {} + buttonsArea["buttons"] = {} local margin = bgpadding - local textPadding = mathFloor(fontsize*0.8) + local textPadding = mathFloor(fontsize * 0.8) local sidePadding = textPadding local offset = sidePadding local lastbutton local function addButton(name, text) local width = mathFloor((font2:GetTextWidth(text) * fontsize) + textPadding) - buttonsArea['buttons'][name] = { buttonsArea[3] - offset - width, buttonsArea[2] + margin, buttonsArea[3] - offset, buttonsArea[4], text, buttonsArea[3] - offset - (width/2) } - if not lastbutton then buttonsArea['buttons'][name][3] = buttonsArea[3] end + buttonsArea["buttons"][name] = { buttonsArea[3] - offset - width, buttonsArea[2] + margin, buttonsArea[3] - offset, buttonsArea[4], text, buttonsArea[3] - offset - (width / 2) } + if not lastbutton then + buttonsArea["buttons"][name][3] = buttonsArea[3] + end offset = mathFloor(offset + width + 0.5) lastbutton = name end if not gameIsOver and chobbyLoaded then - addButton('quit', Spring.I18N('ui.topbar.button.lobby')) + addButton("quit", Spring.I18N("ui.topbar.button.lobby")) else - addButton('quit', Spring.I18N('ui.topbar.button.quit')) + addButton("quit", Spring.I18N("ui.topbar.button.quit")) end if not gameIsOver and not spec and gameStarted and not isSinglePlayer then - addButton('resign', Spring.I18N('ui.topbar.button.resign')) + addButton("resign", Spring.I18N("ui.topbar.button.resign")) end - if WG['options'] then addButton('options', Spring.I18N('ui.topbar.button.settings')) end - if WG['keybinds'] then addButton('keybinds', Spring.I18N('ui.topbar.button.keys')) end - if WG['changelog'] and not isScenario then addButton('changelog', Spring.I18N('ui.topbar.button.changes')) end - if WG['teamstats'] and not isScenario then addButton('stats', Spring.I18N('ui.topbar.button.stats')) end - if gameIsOver then addButton('graphs', Spring.I18N('ui.topbar.button.graphs')) end - if WG['scavengerinfo'] then addButton('scavengers', Spring.I18N('ui.topbar.button.scavengers')) end - if isScenario and WG['missioninfo'] then addButton('mission', Spring.I18N('ui.topbar.button.mission')) end - if isSinglePlayer and cfg.allowSavegame and WG['savegame'] then addButton('save', Spring.I18N('ui.topbar.button.save')) end + if WG["options"] then + addButton("options", Spring.I18N("ui.topbar.button.settings")) + end + if WG["keybinds"] then + addButton("keybinds", Spring.I18N("ui.topbar.button.keys")) + end + if WG["changelog"] and not isScenario then + addButton("changelog", Spring.I18N("ui.topbar.button.changes")) + end + if WG["teamstats"] and not isScenario then + addButton("stats", Spring.I18N("ui.topbar.button.stats")) + end + if gameIsOver then + addButton("graphs", Spring.I18N("ui.topbar.button.graphs")) + end + if WG["scavengerinfo"] then + addButton("scavengers", Spring.I18N("ui.topbar.button.scavengers")) + end + if isScenario and WG["missioninfo"] then + addButton("mission", Spring.I18N("ui.topbar.button.mission")) + end + if isSinglePlayer and cfg.allowSavegame and WG["savegame"] then + addButton("save", Spring.I18N("ui.topbar.button.save")) + end - buttonsArea['buttons'][lastbutton][1] = buttonsArea['buttons'][lastbutton][1] - sidePadding + buttonsArea["buttons"][lastbutton][1] = buttonsArea["buttons"][lastbutton][1] - sidePadding offset = offset + sidePadding - buttonsArea[1] = buttonsArea[3]-offset-margin + buttonsArea[1] = buttonsArea[3] - offset - margin -- sometimes its gets wider when (stats) button gets added if prevButtonsArea[1] and buttonsArea[1] ~= prevButtonsArea[1] then @@ -400,13 +416,15 @@ local function updateButtons() end prevButtonsArea = buttonsArea - if dlist.buttons then glDeleteList(dlist.buttons) end + if dlist.buttons then + glDeleteList(dlist.buttons) + end dlist.buttons = glCreateList(function() font2:Begin(true) font2:SetTextColor(0.92, 0.92, 0.92, 1) font2:SetOutlineColor(0, 0, 0, 1) - for name, params in pairs(buttonsArea['buttons']) do - font2:Print(params[5], params[6], params[2] + ((params[4] - params[2]) * 0.5) - (fontsize / 5), fontsize, 'co') + for name, params in pairs(buttonsArea["buttons"]) do + font2:Print(params[5], params[6], params[2] + ((params[4] - params[2]) * 0.5) - (fontsize / 5), fontsize, "co") end font2:End() end) @@ -417,7 +435,9 @@ local function updateComs(forceText) local texPath = string.lower(string.gsub(textures.com, ":.:", "")) - if dlist.coms then glDeleteList(dlist.coms) end + if dlist.coms then + glDeleteList(dlist.coms) + end comsDlistUpdate = true dlist.coms = glCreateList(function() -- Commander icon @@ -429,27 +449,27 @@ local function updateComs(forceText) local cx = area[1] + ((area[3] - area[1]) / 2) - skewCenterOffset if VFS.FileExists(texPath) then glTexture(textures.com) - glTexRect(cx - sizeHalf, area[2] + (areaH / 2) - sizeHalf +yOffset, cx + sizeHalf, area[2] + (areaH / 2) + sizeHalf+yOffset) + glTexRect(cx - sizeHalf, area[2] + (areaH / 2) - sizeHalf + yOffset, cx + sizeHalf, area[2] + (areaH / 2) + sizeHalf + yOffset) glTexture(false) end -- Text if gameFrame > 0 or forceText then font2:Begin(true) local fontsize = areaH / 2.5 - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) -- Enemy count: anchor to actual bottom-right corner of parallelogram with small padding local brCornerX = area[3] - (cfg.useSkew and areaH * skewTan or 0) - font2:Print('\255\255\000\000' .. enemyComCount, brCornerX - (1.2 * widgetScale), area[2] + (4.5 * widgetScale), fontsize, 'or') + font2:Print("\255\255\000\000" .. enemyComCount, brCornerX - (1.2 * widgetScale), area[2] + (4.5 * widgetScale), fontsize, "or") fontSize = areaH / 1.9 - font2:Print("\255\000\255\000" .. allyComs, cx, area[2] + (areaH / 1.77) - (fontSize / 5), fontSize, 'oc') + font2:Print("\255\000\255\000" .. allyComs, cx, area[2] + (areaH / 1.77) - (fontSize / 5), fontSize, "oc") font2:End() end end) comcountChanged = nil - if WG['tooltip'] and refreshUi then - WG['tooltip'].AddTooltip('coms', area, Spring.I18N('ui.topbar.commanderCountTooltip'), nil, Spring.I18N('ui.topbar.commanderCount')) + if WG["tooltip"] and refreshUi then + WG["tooltip"].AddTooltip("coms", area, Spring.I18N("ui.topbar.commanderCountTooltip"), nil, Spring.I18N("ui.topbar.commanderCount")) end end @@ -462,10 +482,14 @@ local function updateAvgWind() local avgWind = windFunctions.averageWindLookup -- pull average wind from precomputed table, if it exists - if avgWind[minWind] then avgWindValue = avgWind[minWind][maxWind] end + if avgWind[minWind] then + avgWindValue = avgWind[minWind][maxWind] + end -- fallback approximation - if not avgWindValue then avgWindValue = "~" .. tostring(mathMax(minWind, maxWind * 0.75)) end + if not avgWindValue then + avgWindValue = "~" .. tostring(mathMax(minWind, maxWind * 0.75)) + end end local function updateWind() @@ -473,27 +497,31 @@ local function updateWind() local bladesSize = (area[4] - area[2]) * 0.57 - if dlist.wind1 then glDeleteList(dlist.wind1) end + if dlist.wind1 then + glDeleteList(dlist.wind1) + end dlist.wind1 = glCreateList(function() -- blades icon local skewCenterOffset = cfg.useSkew and (area[4] - area[2]) * skewTan * 0.5 or 0 glPushMatrix() - glTranslate(area[1] + ((area[3] - area[1]) / 2) - skewCenterOffset, area[2] + (bgpadding/2) + ((area[4] - area[2]) / 2), 0) + glTranslate(area[1] + ((area[3] - area[1]) / 2) - skewCenterOffset, area[2] + (bgpadding / 2) + ((area[4] - area[2]) / 2), 0) glColor(1, 1, 1, 0.2) glTexture(textures.blades) -- gl.Rotate is done after displaying this dl, and before dl2 end) - if dlist.wind2 then glDeleteList(dlist.wind2) end + if dlist.wind2 then + glDeleteList(dlist.wind2) + end dlist.wind2 = glCreateList(function() glTexRect(-bladesSize, -bladesSize, bladesSize, bladesSize) glTexture(false) glPopMatrix() end) - if WG['tooltip'] and refreshUi then - local avgWindValueForTooltip = windFunctions.isNoWind() and Spring.I18N('ui.topbar.wind.nowind1') or avgWindValue - WG['tooltip'].AddTooltip('wind', area, Spring.I18N('ui.topbar.windspeedTooltip', { avgWindValue = avgWindValueForTooltip, riskWindValue = riskWindValue, warnColor = textWarnColor }), nil, Spring.I18N('ui.topbar.windspeed')) + if WG["tooltip"] and refreshUi then + local avgWindValueForTooltip = windFunctions.isNoWind() and Spring.I18N("ui.topbar.wind.nowind1") or avgWindValue + WG["tooltip"].AddTooltip("wind", area, Spring.I18N("ui.topbar.windspeedTooltip", { avgWindValue = avgWindValueForTooltip, riskWindValue = riskWindValue, warnColor = textWarnColor }), nil, Spring.I18N("ui.topbar.windspeed")) end end @@ -502,25 +530,27 @@ local function checkTidalRelevant() local mapMinHeight = 0 -- account for invertmap to the best of our abiltiy - if string.find(Spring.GetModOptions().debugcommands,"invertmap") then - if string.find(Spring.GetModOptions().debugcommands,"wet") then + if string.find(Spring.GetModOptions().debugcommands, "invertmap") then + if string.find(Spring.GetModOptions().debugcommands, "wet") then -- assume that they want water if keyword "wet" is involved, too violitile between initilization and subsequent post terraform checks return true - --else - -- mapMinHeight = 0 + --else + -- mapMinHeight = 0 end else - mapMinHeight = select(3,Spring.GetGroundExtremes()) + mapMinHeight = select(3, Spring.GetGroundExtremes()) end mapMinHeight = mapMinHeight - (Spring.GetModOptions().map_waterlevel or 0) - return mapMinHeight <= -20 -- armtide/cortide can be built from 20 waterdepth (hardcoded here cause am too lazy to auto cycle trhough unitdefs and read it from there) + return mapMinHeight <= -20 -- armtide/cortide can be built from 20 waterdepth (hardcoded here cause am too lazy to auto cycle trhough unitdefs and read it from there) end local function updateTidal() local area = tidalarea - if dlist.tidal2 then glDeleteList(dlist.tidal2) end + if dlist.tidal2 then + glDeleteList(dlist.tidal2) + end local wavesSize = (area[4] - area[2]) * 0.59 tidalWaveAnimationHeight = (area[4] - area[2]) * 0.1 @@ -532,14 +562,14 @@ local function updateTidal() glPopMatrix() end) - if WG['tooltip'] and refreshUi then - WG['tooltip'].AddTooltip('tidal', area, Spring.I18N('ui.topbar.tidalspeedTooltip'), nil, Spring.I18N('ui.topbar.tidalspeed')) + if WG["tooltip"] and refreshUi then + WG["tooltip"].AddTooltip("tidal", area, Spring.I18N("ui.topbar.tidalspeedTooltip"), nil, Spring.I18N("ui.topbar.tidalspeed")) end end local function drawResbarPullIncome(res) font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) + font2:SetOutlineColor(0, 0, 0, 1) -- Text: pull font2:Print("\255\240\125\125" .. "-" .. short(r[res][3]), resbarDrawinfo[res].textPull[2], resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[4], resbarDrawinfo[res].textPull[5]) -- Text: expense @@ -550,10 +580,12 @@ local function drawResbarPullIncome(res) end local function drawResbarStorage(res) - if showingWarning[res] then return end + if showingWarning[res] then + return + end font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - if res == 'metal' then + font2:SetOutlineColor(0, 0, 0, 1) + if res == "metal" then font2:SetTextColor(0.55, 0.55, 0.55, 1) else font2:SetTextColor(0.57, 0.57, 0.45, 1) @@ -573,14 +605,14 @@ local function updateResbarText(res, force) glDeleteList(dlist.resbar[res][4]) end dlist.resbar[res][4] = glCreateList(function() - if res == 'metal' then - local skew = cfg.useSkew and {blx = (resbarArea[res][4] - resbarArea[res][2]) * skewTan} or nil - WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1] + bgpadding, resbarArea[res][2] + bgpadding, resbarArea[res][3] - bgpadding, resbarArea[res][4], bgpadding * 1.25, 0,0,1,1, nil, nil, skew) - WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1], resbarArea[res][2], resbarArea[res][3], resbarArea[res][4], 5.5 * widgetScale, 0,0,1,1, nil, nil, skew) + if res == "metal" then + local skew = cfg.useSkew and { blx = (resbarArea[res][4] - resbarArea[res][2]) * skewTan } or nil + WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1] + bgpadding, resbarArea[res][2] + bgpadding, resbarArea[res][3] - bgpadding, resbarArea[res][4], bgpadding * 1.25, 0, 0, 1, 1, nil, nil, skew) + WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1], resbarArea[res][2], resbarArea[res][3], resbarArea[res][4], 5.5 * widgetScale, 0, 0, 1, 1, nil, nil, skew) else - local skew = cfg.useSkew and {brx = -((resbarArea[res][4] - resbarArea[res][2]) * skewTan)} or nil - WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1] + bgpadding, resbarArea[res][2] + bgpadding, resbarArea[res][3] - bgpadding, resbarArea[res][4], bgpadding * 1.25, 0,0,1,1, nil, nil, skew) - WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1], resbarArea[res][2], resbarArea[res][3], resbarArea[res][4], 5.5 * widgetScale, 0,0,1,1, nil, nil, skew) + local skew = cfg.useSkew and { brx = -((resbarArea[res][4] - resbarArea[res][2]) * skewTan) } or nil + WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1] + bgpadding, resbarArea[res][2] + bgpadding, resbarArea[res][3] - bgpadding, resbarArea[res][4], bgpadding * 1.25, 0, 0, 1, 1, nil, nil, skew) + WG.FlowUI.Draw.RectRoundQuad(resbarArea[res][1], resbarArea[res][2], resbarArea[res][3], resbarArea[res][4], 5.5 * widgetScale, 0, 0, 1, 1, nil, nil, skew) end end) end @@ -597,52 +629,58 @@ local function updateResbarText(res, force) end end - if cache.lastPullIncomeText[res] ~= short(r[res][3])..' '..short(r[res][4]) then - cache.lastPullIncomeText[res] = short(r[res][3])..' '..short(r[res][4]) + if cache.lastPullIncomeText[res] ~= short(r[res][3]) .. " " .. short(r[res][4]) then + cache.lastPullIncomeText[res] = short(r[res][3]) .. " " .. short(r[res][4]) updateRes[res][2] = true end if not spec and gameFrame > cfg.spawnWarpInFrame then -- display overflow notification - if (res == 'metal' and (allyteamOverflowingMetal or overflowingMetal)) or (res == 'energy' and (allyteamOverflowingEnergy or overflowingEnergy)) then - if not showOverflowTooltip[res] then showOverflowTooltip[res] = now + 1.1 end + if (res == "metal" and (allyteamOverflowingMetal or overflowingMetal)) or (res == "energy" and (allyteamOverflowingEnergy or overflowingEnergy)) then + if not showOverflowTooltip[res] then + showOverflowTooltip[res] = now + 1.1 + end if showOverflowTooltip[res] < now then local bgpadding2 = 2.2 * widgetScale - local text = '' + local text = "" - if res == 'metal' then - text = (allyteamOverflowingMetal and ' ' .. Spring.I18N('ui.topbar.resources.wastingMetal') .. ' ' or ' ' .. Spring.I18N('ui.topbar.resources.overflowing') .. ' ') - if not supressOverflowNotifs and WG['notifications'] and not isMetalmap and (not WG.sharedMetalFrame or WG.sharedMetalFrame+60 < gameFrame) then + if res == "metal" then + text = (allyteamOverflowingMetal and " " .. Spring.I18N("ui.topbar.resources.wastingMetal") .. " " or " " .. Spring.I18N("ui.topbar.resources.overflowing") .. " ") + if not supressOverflowNotifs and WG["notifications"] and not isMetalmap and (not WG.sharedMetalFrame or WG.sharedMetalFrame + 60 < gameFrame) then if allyteamOverflowingMetal then if numTeamsInAllyTeam > 1 then - WG['notifications'].queueNotification('WholeTeamWastingMetal') + WG["notifications"].queueNotification("WholeTeamWastingMetal") else - WG['notifications'].queueNotification('YouAreWastingMetal') + WG["notifications"].queueNotification("YouAreWastingMetal") end - elseif r[res][6] > 0.75 then -- supress if you are deliberately overflowing by adjustingthe share slider down - WG['notifications'].queueNotification('YouAreOverflowingMetal') + elseif r[res][6] > 0.75 then -- supress if you are deliberately overflowing by adjustingthe share slider down + WG["notifications"].queueNotification("YouAreOverflowingMetal") end end else - text = (allyteamOverflowingEnergy and ' ' .. Spring.I18N('ui.topbar.resources.wastingEnergy') .. ' ' or ' ' .. Spring.I18N('ui.topbar.resources.overflowing') .. ' ') - if not supressOverflowNotifs and WG['notifications'] and (not WG.sharedEnergyFrame or WG.sharedEnergyFrame+60 < gameFrame) then + text = (allyteamOverflowingEnergy and " " .. Spring.I18N("ui.topbar.resources.wastingEnergy") .. " " or " " .. Spring.I18N("ui.topbar.resources.overflowing") .. " ") + if not supressOverflowNotifs and WG["notifications"] and (not WG.sharedEnergyFrame or WG.sharedEnergyFrame + 60 < gameFrame) then if allyteamOverflowingEnergy then if numTeamsInAllyTeam > 1 then - WG['notifications'].queueNotification('WholeTeamWastingEnergy') + WG["notifications"].queueNotification("WholeTeamWastingEnergy") else - WG['notifications'].queueNotification('YouAreWastingEnergy') + WG["notifications"].queueNotification("YouAreWastingEnergy") end end end - end - if not showingWarning[res] then showingWarning[res] = true; updateRes[res][3] = true end + if not showingWarning[res] then + showingWarning[res] = true + updateRes[res][3] = true + end if cache.lastWarning[res] ~= text or force then cache.lastWarning[res] = text - if dlist.resbar[res][7] then glDeleteList(dlist.resbar[res][7]) end + if dlist.resbar[res][7] then + glDeleteList(dlist.resbar[res][7]) + end dlist.resbar[res][7] = glCreateList(function() local fontSize = (orgHeight * (1 + (ui_scale - 1) / 1.33) / 4) * widgetScale @@ -650,7 +688,7 @@ local function updateResbarText(res, force) -- background local color1, color2, color3, color4 - if res == 'metal' then + if res == "metal" then if allyteamOverflowingMetal then color1 = { 0.35, 0.1, 0.1, 1 } color2 = { 0.25, 0.05, 0.05, 1 } @@ -677,16 +715,16 @@ local function updateResbarText(res, force) end local bannerH = 15.5 * widgetScale - local bannerRightX = resbarArea[res][3] - bgpadding - (res == 'energy' and cfg.useSkew and bannerH * skewTan * 0.5 or 0) + local bannerRightX = resbarArea[res][3] - bgpadding - (res == "energy" and cfg.useSkew and bannerH * skewTan * 0.5 or 0) RectRound(bannerRightX - textWidth, resbarArea[res][4] - bannerH, bannerRightX, resbarArea[res][4], 3.7 * widgetScale, 0, 0, 1, 1, color1, color2) RectRound(bannerRightX - textWidth + bgpadding2, resbarArea[res][4] - bannerH + bgpadding2, bannerRightX - bgpadding2, resbarArea[res][4], 2.8 * widgetScale, 0, 0, 1, 1, color3, color4) - RectRoundOutline(bannerRightX - textWidth + bgpadding2, resbarArea[res][4] - bannerH + bgpadding2, bannerRightX - bgpadding2, resbarArea[res][4]+10, 2.8 * widgetScale, bgpadding2*1.33, 0, 0, 1, 1, {1, 1, 1, 0.15}, {1, 1, 1, 0}) + RectRoundOutline(bannerRightX - textWidth + bgpadding2, resbarArea[res][4] - bannerH + bgpadding2, bannerRightX - bgpadding2, resbarArea[res][4] + 10, 2.8 * widgetScale, bgpadding2 * 1.33, 0, 0, 1, 1, { 1, 1, 1, 0.15 }, { 1, 1, 1, 0 }) font2:Begin(true) font2:SetTextColor(1, 0.88, 0.88, 1) font2:SetOutlineColor(0.2, 0, 0, 0.6) - font2:Print(text, bannerRightX, resbarArea[res][4] - 9.3 * widgetScale, fontSize, 'or') + font2:Print(text, bannerRightX, resbarArea[res][4] - 9.3 * widgetScale, fontSize, "or") font2:End() end) end @@ -697,10 +735,15 @@ local function updateResbarText(res, force) -- Without this, the old banner dlist persists, drawResBars shows it -- immediately when overflow restarts while showingWarning stays false -- for another 1.1s, leaving storage text visible under the banner. - if dlist.resbar[res][7] then glDeleteList(dlist.resbar[res][7]) end + if dlist.resbar[res][7] then + glDeleteList(dlist.resbar[res][7]) + end dlist.resbar[res][7] = nil cache.lastWarning[res] = nil - if showingWarning[res] then showingWarning[res] = false; updateRes[res][3] = true end + if showingWarning[res] then + showingWarning[res] = false + updateRes[res][3] = true + end showOverflowTooltip[res] = nil end @@ -711,7 +754,7 @@ local function drawResbarValue(res) local value = short(smoothedResources[res][1]) cache.lastResbarValueWidth[res] = font2:GetTextWidth(value) * resbarDrawinfo[res].textCurrent[4] font2:Begin(true) - if res == 'metal' then + if res == "metal" then font2:SetTextColor(0.95, 0.95, 0.95, 1) else font2:SetTextColor(1, 1, 0.74, 1) @@ -738,8 +781,8 @@ local function updateResbar(res) -- Extra inset on the slanted side so content stays within the trapezoidal shape. -- At mid-bar-height the slanted edge has shifted inward by ~H/2 * tan(22.5 deg). local skewSideInset = cfg.useSkew and mathFloor((area[4] - area[2]) * skewTan * 0.5) or 0 - local barLeftPadding = mathFloor(53 * widgetScale) + (res == 'metal' and skewSideInset or 0) - local barRightPadding = mathFloor(14.5 * widgetScale) + (res == 'energy' and skewSideInset or 0) + local barLeftPadding = mathFloor(53 * widgetScale) + (res == "metal" and skewSideInset or 0) + local barRightPadding = mathFloor(14.5 * widgetScale) + (res == "energy" and skewSideInset or 0) local barArea = { area[1] + mathFloor((height * widgetScale) + barLeftPadding), area[2] + barHeightPadding, area[3] - barRightPadding, area[2] + barHeight + barHeightPadding } local sliderHeightAdd = mathFloor(barHeight / 1.55) local shareSliderWidth = barHeight + sliderHeightAdd + sliderHeightAdd @@ -763,7 +806,7 @@ local function updateResbar(res) -- Ensure barColor is initialized if not resbarDrawinfo[res].barColor then - if res == 'metal' then + if res == "metal" then resbarDrawinfo[res].barColor = { 1, 1, 1, 1 } else resbarDrawinfo[res].barColor = { 1, 1, 0, 1 } @@ -771,7 +814,7 @@ local function updateResbar(res) end if refreshUi then - if res == 'metal' then + if res == "metal" then resbarDrawinfo[res].barColor = { 1, 1, 1, 1 } else resbarDrawinfo[res].barColor = { 1, 1, 0, 1 } @@ -784,13 +827,12 @@ local function updateResbar(res) resbarDrawinfo[res].barGlowLeftTexRect = { barArea[1] - (glowSize * 2.5), barArea[2] - glowSize, barArea[1], barArea[4] + glowSize } resbarDrawinfo[res].barGlowRightTexRect = { barArea[3], barArea[2] - glowSize, barArea[3] + (glowSize * 2.5), barArea[4] + glowSize } - resbarDrawinfo[res].textCurrent = { short(r[res][1]), barArea[1] + barWidth / 2, barArea[2] + barHeight * 1.8, (height / 2.5) * widgetScale, 'ocd' } - resbarDrawinfo[res].textStorage = { "\255\150\150\150" .. short(r[res][2]), barArea[3], barArea[2] + barHeight * 2.1, (height / 3.2) * widgetScale, 'ord' } - resbarDrawinfo[res].textPull = { "\255\210\100\100" .. short(r[res][3]), barArea[1] - (10 * widgetScale), barArea[2] + barHeight * 2.15, (height / 3) * widgetScale, 'ord' } - resbarDrawinfo[res].textExpense = { "\255\210\100\100" .. short(r[res][5]), barArea[1] + (10 * widgetScale), barArea[2] + barHeight * 2.15, (height / 3) * widgetScale, 'old' } - resbarDrawinfo[res].textIncome = { "\255\100\210\100" .. short(r[res][4]), barArea[1] - (10 * widgetScale), barArea[2] - (barHeight * 0.55), (height / 3) * widgetScale, 'ord' } - - else -- just update values + resbarDrawinfo[res].textCurrent = { short(r[res][1]), barArea[1] + barWidth / 2, barArea[2] + barHeight * 1.8, (height / 2.5) * widgetScale, "ocd" } + resbarDrawinfo[res].textStorage = { "\255\150\150\150" .. short(r[res][2]), barArea[3], barArea[2] + barHeight * 2.1, (height / 3.2) * widgetScale, "ord" } + resbarDrawinfo[res].textPull = { "\255\210\100\100" .. short(r[res][3]), barArea[1] - (10 * widgetScale), barArea[2] + barHeight * 2.15, (height / 3) * widgetScale, "ord" } + resbarDrawinfo[res].textExpense = { "\255\210\100\100" .. short(r[res][5]), barArea[1] + (10 * widgetScale), barArea[2] + barHeight * 2.15, (height / 3) * widgetScale, "old" } + resbarDrawinfo[res].textIncome = { "\255\100\210\100" .. short(r[res][4]), barArea[1] - (10 * widgetScale), barArea[2] - (barHeight * 0.55), (height / 3) * widgetScale, "ord" } + else -- just update values resbarDrawinfo[res].textCurrent[1] = short(r[res][1]) resbarDrawinfo[res].textStorage[1] = "\255\150\150\150" .. short(r[res][2]) resbarDrawinfo[res].textPull[1] = "\255\210\100\100" .. short(r[res][3]) @@ -808,75 +850,63 @@ local function updateResbar(res) local bgpaddingHalf = mathFloor((bgpadding * 0.5) + 0.5) local texSize = mathFloor(iconSize * 2) - if res == 'metal' then + if res == "metal" then glTexture(":lr" .. texSize .. "," .. texSize .. ":LuaUI/Images/metal.png") else glTexture(":lr" .. texSize .. "," .. texSize .. ":LuaUI/Images/energy.png") end - local iconSkewShift = res == 'metal' and skewSideInset or 0 + local iconSkewShift = res == "metal" and skewSideInset or 0 glTexRect(area[1] + bgpaddingHalf + iconPadding + iconSkewShift, area[2] + bgpaddingHalf + iconPadding, area[1] + bgpaddingHalf + iconPadding + iconSkewShift + iconSize, area[4] + bgpaddingHalf - iconPadding) glTexture(false) -- Bar background local addedSize = mathFloor(((barArea[4] - barArea[2]) * 0.15) + 0.5) local borderSize = 1 - RectRound(barArea[1] - edgeWidth + borderSize, barArea[2] - edgeWidth + borderSize, barArea[3] + edgeWidth - borderSize, barArea[4] + edgeWidth - borderSize, barHeight * 0.2, 1, 1, 1, 1, { 0,0,0, 0.15 }, { 0,0,0, 0.2 }) + RectRound(barArea[1] - edgeWidth + borderSize, barArea[2] - edgeWidth + borderSize, barArea[3] + edgeWidth - borderSize, barArea[4] + edgeWidth - borderSize, barHeight * 0.2, 1, 1, 1, 1, { 0, 0, 0, 0.15 }, { 0, 0, 0, 0.2 }) -- bar dark outline - local featherHeight = addedSize*4 - WG.FlowUI.Draw.RectRoundOutline( - barArea[1] - addedSize - featherHeight - edgeWidth, barArea[2] - addedSize - featherHeight - edgeWidth, barArea[3] + addedSize + featherHeight + edgeWidth, barArea[4] + addedSize + featherHeight + edgeWidth, - barHeight * 0.8, featherHeight, - 1,1,1,1, - { 0,0,0, 0 }, { 0,0,0, 0.22 } - ) + local featherHeight = addedSize * 4 + WG.FlowUI.Draw.RectRoundOutline(barArea[1] - addedSize - featherHeight - edgeWidth, barArea[2] - addedSize - featherHeight - edgeWidth, barArea[3] + addedSize + featherHeight + edgeWidth, barArea[4] + addedSize + featherHeight + edgeWidth, barHeight * 0.8, featherHeight, 1, 1, 1, 1, { 0, 0, 0, 0 }, { 0, 0, 0, 0.22 }) featherHeight = addedSize - WG.FlowUI.Draw.RectRoundOutline( - barArea[1] - addedSize - featherHeight - edgeWidth, barArea[2] - addedSize - featherHeight - edgeWidth, barArea[3] + addedSize + featherHeight + edgeWidth, barArea[4] + addedSize + featherHeight + edgeWidth, - featherHeight*1.5, featherHeight, - 1,1,1,1, - { 0,0,0, 0 }, { 0,0,0, 0.66 } - ) + WG.FlowUI.Draw.RectRoundOutline(barArea[1] - addedSize - featherHeight - edgeWidth, barArea[2] - addedSize - featherHeight - edgeWidth, barArea[3] + addedSize + featherHeight + edgeWidth, barArea[4] + addedSize + featherHeight + edgeWidth, featherHeight * 1.5, featherHeight, 1, 1, 1, 1, { 0, 0, 0, 0 }, { 0, 0, 0, 0.66 }) -- bar inner light outline - WG.FlowUI.Draw.RectRoundOutline( - barArea[1] - addedSize - edgeWidth, barArea[2] - addedSize - edgeWidth, barArea[3] + addedSize + edgeWidth, barArea[4] + addedSize + edgeWidth, - barHeight * 0.33, barHeight * 0.1, - 1,1,1,1, - { 1, 1, 1, 0.3 }, { 1, 1, 1, 0 } - ) + WG.FlowUI.Draw.RectRoundOutline(barArea[1] - addedSize - edgeWidth, barArea[2] - addedSize - edgeWidth, barArea[3] + addedSize + edgeWidth, barArea[4] + addedSize + edgeWidth, barHeight * 0.33, barHeight * 0.1, 1, 1, 1, 1, { 1, 1, 1, 0.3 }, { 1, 1, 1, 0 }) glBlending(GL.SRC_ALPHA, GL.ONE) glTexture(textures.noiseBackground) - glColor(1,1,1, 0.88) - TexturedRectRound(barArea[1] - edgeWidth, barArea[2] - edgeWidth, barArea[3] + edgeWidth, barArea[4] + edgeWidth, barHeight * 0.33, 1, 1, 1, 1, barWidth*0.33, 0) + glColor(1, 1, 1, 0.88) + TexturedRectRound(barArea[1] - edgeWidth, barArea[2] - edgeWidth, barArea[3] + edgeWidth, barArea[4] + edgeWidth, barHeight * 0.33, 1, 1, 1, 1, barWidth * 0.33, 0) glTexture(false) RectRound(barArea[1] - addedSize - edgeWidth, barArea[2] - addedSize - edgeWidth, barArea[3] + addedSize + edgeWidth, barArea[4] + addedSize + edgeWidth, barHeight * 0.33, 1, 1, 1, 1, { 0, 0, 0, 0.1 }, { 0, 0, 0, 0.1 }) RectRound(barArea[1] - addedSize, barArea[2] - addedSize, barArea[3] + addedSize, barArea[4] + addedSize, barHeight * 0.33, 1, 1, 1, 1, { 0.15, 0.15, 0.15, 0.17 }, { 0.8, 0.8, 0.8, 0.13 }) -- -- gloss RectRound(barArea[1] - addedSize, barArea[2] + addedSize, barArea[3] + addedSize, barArea[4] + addedSize, barHeight * 0.33, 1, 1, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.05 }) - RectRound(barArea[1] - addedSize, barArea[2] - addedSize, barArea[3] + addedSize, barArea[2] + addedSize + (addedSize*1.5), barHeight * 0.2, 0, 0, 1, 1, { 1, 1, 1, 0.08 }, { 1, 1, 1, 0.0 }) + RectRound(barArea[1] - addedSize, barArea[2] - addedSize, barArea[3] + addedSize, barArea[2] + addedSize + (addedSize * 1.5), barHeight * 0.2, 0, 0, 1, 1, { 1, 1, 1, 0.08 }, { 1, 1, 1, 0.0 }) glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - end) dlist.resbar[res][2] = glCreateList(function() -- Metalmaker Conversion slider - if res == 'energy' then - mmLevel = Spring.GetTeamRulesParam(myTeamID, 'mmLevel') + if res == "energy" then + mmLevel = Spring.GetTeamRulesParam(myTeamID, "mmLevel") local convValue = mmLevel - if draggingConversionIndicatorValue then convValue = draggingConversionIndicatorValue / 100 end - if convValue == nil then convValue = 1 end + if draggingConversionIndicatorValue then + convValue = draggingConversionIndicatorValue / 100 + end + if convValue == nil then + convValue = 1 + end conversionIndicatorArea = { mathFloor(barArea[1] + (convValue * barWidth) - (shareSliderWidth / 2)), mathFloor(barArea[2] - sliderHeightAdd), mathFloor(barArea[1] + (convValue * barWidth) + (shareSliderWidth / 2)), mathFloor(barArea[4] + sliderHeightAdd) } - UiSliderKnob(mathFloor(conversionIndicatorArea[1]+((conversionIndicatorArea[3]-conversionIndicatorArea[1])/2)), mathFloor(conversionIndicatorArea[2]+((conversionIndicatorArea[4]-conversionIndicatorArea[2])/2)), mathFloor((conversionIndicatorArea[3]-conversionIndicatorArea[1])/2), { 0.95, 0.95, 0.7, 1 }) + UiSliderKnob(mathFloor(conversionIndicatorArea[1] + ((conversionIndicatorArea[3] - conversionIndicatorArea[1]) / 2)), mathFloor(conversionIndicatorArea[2] + ((conversionIndicatorArea[4] - conversionIndicatorArea[2]) / 2)), mathFloor((conversionIndicatorArea[3] - conversionIndicatorArea[1]) / 2), { 0.95, 0.95, 0.7, 1 }) end -- Share slider if not isSingle then - if res == 'energy' then + if res == "energy" then energyOverflowLevel = r[res][6] else metalOverflowLevel = r[res][6] @@ -892,34 +922,33 @@ local function updateResbar(res) shareIndicatorArea[res] = { mathFloor(barArea[1] + (value * barWidth) - (shareSliderWidth / 2)), mathFloor(barArea[2] - sliderHeightAdd), mathFloor(barArea[1] + (value * barWidth) + (shareSliderWidth / 2)), mathFloor(barArea[4] + sliderHeightAdd) } - UiSliderKnob(mathFloor(shareIndicatorArea[res][1]+((shareIndicatorArea[res][3]-shareIndicatorArea[res][1])/2)), mathFloor(shareIndicatorArea[res][2]+((shareIndicatorArea[res][4]-shareIndicatorArea[res][2])/2)), mathFloor((shareIndicatorArea[res][3]-shareIndicatorArea[res][1])/2), { 0.85, 0, 0, 1 }) + UiSliderKnob(mathFloor(shareIndicatorArea[res][1] + ((shareIndicatorArea[res][3] - shareIndicatorArea[res][1]) / 2)), mathFloor(shareIndicatorArea[res][2] + ((shareIndicatorArea[res][4] - shareIndicatorArea[res][2]) / 2)), mathFloor((shareIndicatorArea[res][3] - shareIndicatorArea[res][1]) / 2), { 0.85, 0, 0, 1 }) end end) local resourceTranslations = { - metal = Spring.I18N('ui.topbar.resources.metal'), - energy = Spring.I18N('ui.topbar.resources.energy') + metal = Spring.I18N("ui.topbar.resources.metal"), + energy = Spring.I18N("ui.topbar.resources.energy"), } local resourceName = resourceTranslations[res] -- add/update tooltips - if WG['tooltip'] and conversionIndicatorArea then - + if WG["tooltip"] and conversionIndicatorArea then -- always update for now - if res == 'energy' then - WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], conversionIndicatorArea[1], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareEnergyTooltip'), nil, Spring.I18N('ui.topbar.resources.shareEnergyTooltipTitle')) - WG['tooltip'].AddTooltip(res .. '_share_slider2', { conversionIndicatorArea[3], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareEnergyTooltip'), nil, Spring.I18N('ui.topbar.resources.shareEnergyTooltipTitle')) - WG['tooltip'].AddTooltip(res .. '_metalmaker_slider', conversionIndicatorArea, Spring.I18N('ui.topbar.resources.conversionTooltip'), nil, Spring.I18N('ui.topbar.resources.conversionTooltipTitle')) + if res == "energy" then + WG["tooltip"].AddTooltip(res .. "_share_slider", { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], conversionIndicatorArea[1], shareIndicatorArea[res][4] }, Spring.I18N("ui.topbar.resources.shareEnergyTooltip"), nil, Spring.I18N("ui.topbar.resources.shareEnergyTooltipTitle")) + WG["tooltip"].AddTooltip(res .. "_share_slider2", { conversionIndicatorArea[3], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N("ui.topbar.resources.shareEnergyTooltip"), nil, Spring.I18N("ui.topbar.resources.shareEnergyTooltipTitle")) + WG["tooltip"].AddTooltip(res .. "_metalmaker_slider", conversionIndicatorArea, Spring.I18N("ui.topbar.resources.conversionTooltip"), nil, Spring.I18N("ui.topbar.resources.conversionTooltipTitle")) else - WG['tooltip'].AddTooltip(res .. '_share_slider', { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N('ui.topbar.resources.shareMetalTooltip'), nil, Spring.I18N('ui.topbar.resources.shareMetalTooltipTitle')) + WG["tooltip"].AddTooltip(res .. "_share_slider", { resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4] }, Spring.I18N("ui.topbar.resources.shareMetalTooltip"), nil, Spring.I18N("ui.topbar.resources.shareMetalTooltipTitle")) end if refreshUi then - WG['tooltip'].AddTooltip(res .. '_pull', { resbarDrawinfo[res].textPull[2] - (resbarDrawinfo[res].textPull[4] * 2.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2] + (resbarDrawinfo[res].textPull[4] * 0.5), resbarDrawinfo[res].textPull[3] + resbarDrawinfo[res].textPull[4] }, Spring.I18N('ui.topbar.resources.pullTooltip', { resource = resourceName })) - WG['tooltip'].AddTooltip(res .. '_income', { resbarDrawinfo[res].textIncome[2] - (resbarDrawinfo[res].textIncome[4] * 2.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2] + (resbarDrawinfo[res].textIncome[4] * 0.5), resbarDrawinfo[res].textIncome[3] + resbarDrawinfo[res].textIncome[4] }, Spring.I18N('ui.topbar.resources.incomeTooltip', { resource = resourceName })) + WG["tooltip"].AddTooltip(res .. "_pull", { resbarDrawinfo[res].textPull[2] - (resbarDrawinfo[res].textPull[4] * 2.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2] + (resbarDrawinfo[res].textPull[4] * 0.5), resbarDrawinfo[res].textPull[3] + resbarDrawinfo[res].textPull[4] }, Spring.I18N("ui.topbar.resources.pullTooltip", { resource = resourceName })) + WG["tooltip"].AddTooltip(res .. "_income", { resbarDrawinfo[res].textIncome[2] - (resbarDrawinfo[res].textIncome[4] * 2.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2] + (resbarDrawinfo[res].textIncome[4] * 0.5), resbarDrawinfo[res].textIncome[3] + resbarDrawinfo[res].textIncome[4] }, Spring.I18N("ui.topbar.resources.incomeTooltip", { resource = resourceName })) --WG['tooltip'].AddTooltip(res .. '_expense', { resbarDrawinfo[res].textExpense[2] - (4 * widgetScale), resbarDrawinfo[res].textExpense[3], resbarDrawinfo[res].textExpense[2] + (30 * widgetScale), resbarDrawinfo[res].textExpense[3] + resbarDrawinfo[res].textExpense[4] }, Spring.I18N('ui.topbar.resources.expenseTooltip', { resource = resourceName })) - WG['tooltip'].AddTooltip(res .. '_storage', { resbarDrawinfo[res].textStorage[2] - (resbarDrawinfo[res].textStorage[4] * 2.75), resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3] + resbarDrawinfo[res].textStorage[4] }, Spring.I18N('ui.topbar.resources.storageTooltip', { resource = resourceName })) + WG["tooltip"].AddTooltip(res .. "_storage", { resbarDrawinfo[res].textStorage[2] - (resbarDrawinfo[res].textStorage[4] * 2.75), resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3] + resbarDrawinfo[res].textStorage[4] }, Spring.I18N("ui.topbar.resources.storageTooltip", { resource = resourceName })) end end end @@ -934,21 +963,27 @@ local function updateResbarValues(res, update) local barWidth = resbarDrawinfo[res].barArea[3] - resbarDrawinfo[res].barArea[1] -- only read values if update is needed updateRes[res][1] = true local maxStorageRes = smoothedResources[res][2] - local cappedCurRes = smoothedResources[res][1] -- limit so when production dies the value wont be much larger than what you can store - if cappedCurRes >maxStorageRes * 1.07 then cappedCurRes =maxStorageRes * 1.07 end + local cappedCurRes = smoothedResources[res][1] -- limit so when production dies the value wont be much larger than what you can store + if cappedCurRes > maxStorageRes * 1.07 then + cappedCurRes = maxStorageRes * 1.07 + end local barSize = barHeight * 0.2 - local valueWidth = mathFloor(((cappedCurRes /maxStorageRes) * barWidth)) - if valueWidth < mathCeil(barSize) then valueWidth = mathCeil(barSize) end - if valueWidth ~= cache.lastValueWidth[res] then -- only recalc if the width changed + local valueWidth = mathFloor(((cappedCurRes / maxStorageRes) * barWidth)) + if valueWidth < mathCeil(barSize) then + valueWidth = mathCeil(barSize) + end + if valueWidth ~= cache.lastValueWidth[res] then -- only recalc if the width changed cache.lastValueWidth[res] = valueWidth -- resbar - if dlist.resValuesBar[res] then glDeleteList(dlist.resValuesBar[res]) end + if dlist.resValuesBar[res] then + glDeleteList(dlist.resValuesBar[res]) + end dlist.resValuesBar[res] = glCreateList(function() local glowSize = barHeight * 7 local color1, color2, glowAlpha - if res == 'metal' then + if res == "metal" then color1 = { 0.51, 0.51, 0.5, 1 } color2 = { 0.95, 0.95, 0.95, 1 } glowAlpha = 0.025 + (0.05 * mathMin(1, cappedCurRes / r[res][2] * 40)) @@ -960,7 +995,7 @@ local function updateResbarValues(res, update) RectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 1, 1, 1, 1, color1, color2) local borderSize = 1 - RectRound(resbarDrawinfo[res].barTexRect[1]+borderSize, resbarDrawinfo[res].barTexRect[2]+borderSize, resbarDrawinfo[res].barTexRect[1] + valueWidth-borderSize, resbarDrawinfo[res].barTexRect[4]-borderSize, barSize, 1, 1, 1, 1, { 0,0,0, 0.1 }, { 0,0,0, 0.17 }) + RectRound(resbarDrawinfo[res].barTexRect[1] + borderSize, resbarDrawinfo[res].barTexRect[2] + borderSize, resbarDrawinfo[res].barTexRect[1] + valueWidth - borderSize, resbarDrawinfo[res].barTexRect[4] - borderSize, barSize, 1, 1, 1, 1, { 0, 0, 0, 0.1 }, { 0, 0, 0, 0.17 }) -- Bar value glow (recalculate glow rects dynamically based on current bar fill) local barLeft = resbarDrawinfo[res].barArea[1] @@ -980,10 +1015,10 @@ local function updateResbarValues(res, update) DrawRect(currentGlowRight + (glowSize * 3), barTop - glowSize, currentGlowRight, barBottom + glowSize, 0.008) glTexture(false) - if res == 'metal' then + if res == "metal" then glTexture(textures.noiseBackground) - glColor(1,1,1, 0.37) - TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 1, 1, 1, 1, barWidth*0.33, 0) + glColor(1, 1, 1, 0.37) + TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 1, 1, 1, 1, barWidth * 0.33, 0) glTexture(false) end @@ -992,33 +1027,35 @@ local function updateResbarValues(res, update) end -- energy glow effect - if res == 'energy' then - if dlist.energyGlow then glDeleteList(dlist.energyGlow) end + if res == "energy" then + if dlist.energyGlow then + glDeleteList(dlist.energyGlow) + end dlist.energyGlow = glCreateList(function() -- energy glow effect - glColor(1,1,1, 0.33) + glColor(1, 1, 1, 0.33) glBlending(GL.SRC_ALPHA, GL.ONE) glTexture(textures.energyGlow) - TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth/0.5, -now/80) - TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth/0.33, now/70) - TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth/0.45,-now/55) + TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth / 0.5, -now / 80) + TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth / 0.33, now / 70) + TexturedRectRound(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1] + valueWidth, resbarDrawinfo[res].barTexRect[4], barSize, 0, 0, 1, 1, barWidth / 0.45, -now / 55) glTexture(false) -- colorize a bit more (with added size) local addedSize = mathFloor((barHeight * 0.15) + 0.5) - glColor(1,1,0, 0.14) - RectRound(resbarDrawinfo[res].barTexRect[1]-addedSize, resbarDrawinfo[res].barTexRect[2]-addedSize, resbarDrawinfo[res].barTexRect[1] + valueWidth + addedSize, resbarDrawinfo[res].barTexRect[4] + addedSize, barHeight * 0.33) + glColor(1, 1, 0, 0.14) + RectRound(resbarDrawinfo[res].barTexRect[1] - addedSize, resbarDrawinfo[res].barTexRect[2] - addedSize, resbarDrawinfo[res].barTexRect[1] + valueWidth + addedSize, resbarDrawinfo[res].barTexRect[4] + addedSize, barHeight * 0.33) glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) end) end - end + end end function init() refreshUi = true - r = { metal = { sp.GetTeamResources(myTeamID, 'metal') }, energy = { sp.GetTeamResources(myTeamID, 'energy') } } + r = { metal = { sp.GetTeamResources(myTeamID, "metal") }, energy = { sp.GetTeamResources(myTeamID, "energy") } } topbarArea = { mathFloor(xPos + (cfg.borderPadding * widgetScale)), mathFloor(vsy - (height * widgetScale)), vsx, vsy } local filledWidth = 0 @@ -1026,19 +1063,19 @@ function init() -- metal local width = mathFloor(totalWidth / 4.4) - resbarArea['metal'] = { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[1] + filledWidth + width, topbarArea[4] } + resbarArea["metal"] = { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[1] + filledWidth + width, topbarArea[4] } filledWidth = filledWidth + width + widgetSpaceMargin - updateResbar('metal') + updateResbar("metal") --energy - resbarArea['energy'] = { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[1] + filledWidth + width, topbarArea[4] } + resbarArea["energy"] = { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[1] + filledWidth + width, topbarArea[4] } filledWidth = filledWidth + width + widgetSpaceMargin - updateResbar('energy') + updateResbar("energy") -- wind width = mathFloor((height * 1.18) * widgetScale) -- Small elements (wind, tidal, coms, buttons) — height fraction from cfg, top-aligned, when skew is on. - skewTan = math.tan(math.rad(cfg.skewAngleDeg)) -- refresh in case cfg changed + skewTan = math.tan(math.rad(cfg.skewAngleDeg)) -- refresh in case cfg changed local smallVPad = cfg.useSkew and mathFloor((topbarArea[4] - topbarArea[2]) * (1 - cfg.smallElementHeightFraction)) or 0 windArea = { topbarArea[1] + filledWidth, topbarArea[2] + smallVPad, topbarArea[1] + filledWidth + width, topbarArea[4] } filledWidth = filledWidth + width + widgetSpaceMargin @@ -1053,7 +1090,7 @@ function init() tidalarea = { topbarArea[1] + filledWidth, topbarArea[2] + smallVPad, topbarArea[1] + filledWidth + width, topbarArea[4] } filledWidth = filledWidth + width + widgetSpaceMargin updateTidal() - end + end end -- coms @@ -1068,24 +1105,24 @@ function init() buttonsArea = { topbarArea[3] - width, topbarArea[2] + smallVPad, topbarArea[3], topbarArea[4] } updateButtons() - if WG['topbar'] then - WG['topbar'].GetPosition = function() + if WG["topbar"] then + WG["topbar"].GetPosition = function() local leftSkewOffset = cfg.useSkew and mathFloor((topbarArea[4] - topbarArea[2]) * skewTan) or 0 - return { topbarArea[1] + leftSkewOffset + widgetSpaceMargin, topbarArea[2], topbarArea[3], topbarArea[4], widgetScale, buttonsArea[2]} + return { topbarArea[1] + leftSkewOffset + widgetSpaceMargin, topbarArea[2], topbarArea[3], topbarArea[4], widgetScale, buttonsArea[2] } end - WG['topbar'].GetFreeArea = function() - return { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[3] - width - widgetSpaceMargin, topbarArea[4], widgetScale} + WG["topbar"].GetFreeArea = function() + return { topbarArea[1] + filledWidth, topbarArea[2], topbarArea[3] - width - widgetSpaceMargin, topbarArea[4], widgetScale } end - WG['topbar'].GetSkewConfig = function() + WG["topbar"].GetSkewConfig = function() return { useSkew = cfg.useSkew, skewTan = skewTan, smallElementHeightFraction = cfg.smallElementHeightFraction } end end - updateResbarText('metal', true) - updateResbarText('energy', true) + updateResbarText("metal", true) + updateResbarText("energy", true) - updateRes = { metal = {true,true,true,true}, energy = {true,true,true,true} } + updateRes = { metal = { true, true, true, true }, energy = { true, true, true, true } } prevComAlert = nil end @@ -1094,9 +1131,9 @@ local function checkSelfStatus() myAllyTeamList = sp.GetTeamList(myAllyTeamID) myTeamID = sp.GetMyTeamID() - local startUnit = sp.GetTeamRulesParam(myTeamID, 'startUnit') + local startUnit = sp.GetTeamRulesParam(myTeamID, "startUnit") if myTeamID ~= gaiaTeamID and UnitDefs[startUnit] then - textures.com = ':n:Icons/'..UnitDefs[startUnit].name..'.png' + textures.com = ":n:Icons/" .. UnitDefs[startUnit].name .. ".png" end end @@ -1117,7 +1154,7 @@ local function countComs(forceUpdate) end local newEnemyComCount = sp.GetTeamRulesParam(myTeamID, "enemyComCount") - if type(newEnemyComCount) == 'number' then + if type(newEnemyComCount) == "number" then enemyComCount = newEnemyComCount if enemyComCount ~= prevEnemyComCount then comcountChanged = true @@ -1137,7 +1174,9 @@ end function widget:GameStart() gameStarted = true checkSelfStatus() - if displayComCounter then countComs(true) end + if displayComCounter then + countComs(true) + end init() end @@ -1176,12 +1215,16 @@ local function updateAllyTeamOverflowing() if energyPercentile > 0.0001 then overflowingEnergy = energyPercentile * 40 -- (1 / 0.025) = 40 - if overflowingEnergy > 1 then overflowingEnergy = 1 end + if overflowingEnergy > 1 then + overflowingEnergy = 1 + end end if metalPercentile > 0.0001 then overflowingMetal = metalPercentile * 40 -- (1 / 0.025) = 40 - if overflowingMetal > 1 then overflowingMetal = 1 end + if overflowingMetal > 1 then + overflowingMetal = 1 + end end end end @@ -1191,22 +1234,38 @@ local function updateAllyTeamOverflowing() if energyPercentile > 0.975 then allyteamOverflowingEnergy = (energyPercentile - 0.975) * 40 -- (1 / 0.025) = 40 - if allyteamOverflowingEnergy > 1 then allyteamOverflowingEnergy = 1 end + if allyteamOverflowingEnergy > 1 then + allyteamOverflowingEnergy = 1 + end end if metalPercentile > 0.975 then allyteamOverflowingMetal = (metalPercentile - 0.975) * 40 -- (1 / 0.025) = 40 - if allyteamOverflowingMetal > 1 then allyteamOverflowingMetal = 1 end + if allyteamOverflowingMetal > 1 then + allyteamOverflowingMetal = 1 + end end end local function hoveringElement(x, y) - if resbarArea.metal[1] and mathIsInRect(x, y, resbarArea.metal[1], resbarArea.metal[2], resbarArea.metal[3], resbarArea.metal[4]) then return 'metal' end - if resbarArea.energy[1] and mathIsInRect(x, y, resbarArea.energy[1], resbarArea.energy[2], resbarArea.energy[3], resbarArea.energy[4]) then return 'energy' end - if windArea[1] and mathIsInRect(x, y, windArea[1], windArea[2], windArea[3], windArea[4]) then return 'wind' end - if displayTidalSpeed and tidalarea[1] and mathIsInRect(x, y, tidalarea[1], tidalarea[2], tidalarea[3], tidalarea[4]) then return 'tidal' end - if displayComCounter and comsArea[1] and mathIsInRect(x, y, comsArea[1], comsArea[2], comsArea[3], comsArea[4]) then return 'com' end - if buttonsArea[1] and mathIsInRect(x, y, buttonsArea[1], buttonsArea[2], buttonsArea[3], buttonsArea[4]) then return 'menu' end + if resbarArea.metal[1] and mathIsInRect(x, y, resbarArea.metal[1], resbarArea.metal[2], resbarArea.metal[3], resbarArea.metal[4]) then + return "metal" + end + if resbarArea.energy[1] and mathIsInRect(x, y, resbarArea.energy[1], resbarArea.energy[2], resbarArea.energy[3], resbarArea.energy[4]) then + return "energy" + end + if windArea[1] and mathIsInRect(x, y, windArea[1], windArea[2], windArea[3], windArea[4]) then + return "wind" + end + if displayTidalSpeed and tidalarea[1] and mathIsInRect(x, y, tidalarea[1], tidalarea[2], tidalarea[3], tidalarea[4]) then + return "tidal" + end + if displayComCounter and comsArea[1] and mathIsInRect(x, y, comsArea[1], comsArea[2], comsArea[3], comsArea[4]) then + return "com" + end + if buttonsArea[1] and mathIsInRect(x, y, buttonsArea[1], buttonsArea[2], buttonsArea[3], buttonsArea[4]) then + return "menu" + end return false end @@ -1267,23 +1326,23 @@ function widget:Update(dt) if now > timers.nextResBarUpdate then timers.nextResBarUpdate = now + 0.05 if not spec and not showQuitscreen then - if hoveringTopbar == 'energy' then + if hoveringTopbar == "energy" then if not resbarHover then - resbarHover = 'energy' - updateResbar('energy') + resbarHover = "energy" + updateResbar("energy") end - elseif resbarHover and resbarHover == 'energy' then + elseif resbarHover and resbarHover == "energy" then resbarHover = nil - updateResbar('energy') + updateResbar("energy") end - if hoveringTopbar == 'metal' then + if hoveringTopbar == "metal" then if not resbarHover then - resbarHover = 'metal' - updateResbar('metal') + resbarHover = "metal" + updateResbar("metal") end - elseif resbarHover and resbarHover == 'metal' then + elseif resbarHover and resbarHover == "metal" then resbarHover = nil - updateResbar('metal') + updateResbar("metal") end elseif spec then local prevMyTeamID = myTeamID @@ -1293,31 +1352,31 @@ function widget:Update(dt) myTeamID = newMyTeamID draggingShareIndicatorValue = {} draggingConversionIndicatorValue = nil - updateResbar('metal') - updateResbar('energy') + updateResbar("metal") + updateResbar("energy") else -- make sure conversion/overflow sliders are adjusted if mmLevel then - local currentMmLevel = sp.GetTeamRulesParam(myTeamID, 'mmLevel') - if mmLevel ~= currentMmLevel or energyOverflowLevel ~= r['energy'][6] then + local currentMmLevel = sp.GetTeamRulesParam(myTeamID, "mmLevel") + if mmLevel ~= currentMmLevel or energyOverflowLevel ~= r["energy"][6] then mmLevel = currentMmLevel - updateResbar('energy') + updateResbar("energy") end - if metalOverflowLevel ~= r['metal'][6] then - updateResbar('metal') + if metalOverflowLevel ~= r["metal"][6] then + updateResbar("metal") end end end else -- make sure conversion/overflow sliders are adjusted if mmLevel then - local currentMmLevel = sp.GetTeamRulesParam(myTeamID, 'mmLevel') - if mmLevel ~= currentMmLevel or energyOverflowLevel ~= r['energy'][6] then + local currentMmLevel = sp.GetTeamRulesParam(myTeamID, "mmLevel") + if mmLevel ~= currentMmLevel or energyOverflowLevel ~= r["energy"][6] then mmLevel = currentMmLevel - updateResbar('energy') + updateResbar("energy") end - if metalOverflowLevel ~= r['metal'][6] then - updateResbar('metal') + if metalOverflowLevel ~= r["metal"][6] then + updateResbar("metal") end end end @@ -1331,30 +1390,26 @@ function widget:Update(dt) if now > timers.nextSlowUpdate then timers.nextSlowUpdate = now + 0.25 local prevR = r - r = { metal = { sp.GetTeamResources(myTeamID, 'metal') }, energy = { sp.GetTeamResources(myTeamID, 'energy') } } + r = { metal = { sp.GetTeamResources(myTeamID, "metal") }, energy = { sp.GetTeamResources(myTeamID, "energy") } } -- check if we need to smooth the resources - local metalDiff7 = r['metal'][7] - prevR['metal'][7] - local metalDiff8 = r['metal'][8] - prevR['metal'][8] - local energyDiff7 = r['energy'][7] - prevR['energy'][7] - local energyDiff8 = r['energy'][8] - prevR['energy'][8] - local metalStorage = r['metal'][2] - local energyStorage = r['energy'][2] - - if (r['metal'][7] > 1 and metalDiff7 ~= 0 and r['metal'][7] / metalStorage > 0.05) or - (r['metal'][8] > 1 and metalDiff8 ~= 0 and r['metal'][8] / metalStorage > 0.05) or - (r['energy'][7] > 1 and energyDiff7 ~= 0 and r['energy'][7] / energyStorage > 0.05) or - (r['energy'][8] > 1 and energyDiff8 ~= 0 and r['energy'][8] / energyStorage > 0.05) - then + local metalDiff7 = r["metal"][7] - prevR["metal"][7] + local metalDiff8 = r["metal"][8] - prevR["metal"][8] + local energyDiff7 = r["energy"][7] - prevR["energy"][7] + local energyDiff8 = r["energy"][8] - prevR["energy"][8] + local metalStorage = r["metal"][2] + local energyStorage = r["energy"][2] + + if (r["metal"][7] > 1 and metalDiff7 ~= 0 and r["metal"][7] / metalStorage > 0.05) or (r["metal"][8] > 1 and metalDiff8 ~= 0 and r["metal"][8] / metalStorage > 0.05) or (r["energy"][7] > 1 and energyDiff7 ~= 0 and r["energy"][7] / energyStorage > 0.05) or (r["energy"][8] > 1 and energyDiff8 ~= 0 and r["energy"][8] / energyStorage > 0.05) then smoothedResources = r end -- resbar values and overflow updateAllyTeamOverflowing() - updateResbarText('metal') - updateResbarText('energy') + updateResbarText("metal") + updateResbarText("energy") -- wind - currentWind = stringFormat('%.1f', select(4, sp.GetWind())) + currentWind = stringFormat("%.1f", select(4, sp.GetWind())) currentWindText = "\255\255\255\255" .. currentWind -- coms @@ -1365,31 +1420,35 @@ function widget:Update(dt) end -- --- OPTIMIZATION: Pre-defined function for RenderToTexture to avoid creating a closure. -local function clearFn() end -- no-op used for pre-clearing regions in uiTex +local function clearFn() end -- no-op used for pre-clearing regions in uiTex local function renderResbarText() glTranslate(-1, -1, 0) - glScale(2 / (topbarArea[3]-topbarArea[1]), 2 / (topbarArea[4]-topbarArea[2]), 0) + glScale(2 / (topbarArea[3] - topbarArea[1]), 2 / (topbarArea[4] - topbarArea[2]), 0) glTranslate(-topbarArea[1], -topbarArea[2], 0) - local res = 'metal' + local res = "metal" drawResbarValue(res) if updateRes[res][2] then updateRes[res][2] = false drawResbarPullIncome(res) end if updateRes[res][3] then - if not showingWarning[res] then updateRes[res][3] = false end + if not showingWarning[res] then + updateRes[res][3] = false + end drawResbarStorage(res) end - res = 'energy' + res = "energy" drawResbarValue(res) if updateRes[res][2] then updateRes[res][2] = false drawResbarPullIncome(res) end if updateRes[res][3] then - if not showingWarning[res] then updateRes[res][3] = false end + if not showingWarning[res] then + updateRes[res][3] = false + end drawResbarStorage(res) end end @@ -1408,7 +1467,7 @@ local function drawResBars() update = true end - local res = 'metal' + local res = "metal" if dlist.resbar[res][1] and dlist.resbar[res][2] then if not spec and gameFrame > cfg.spawnWarpInFrame and dlist.resbar[res][4] then glBlending(GL.SRC_ALPHA, GL.ONE) @@ -1423,7 +1482,7 @@ local function drawResBars() if process < 1 then process = 1 - process glColor(0.9, 0.4, 1, 0.045 * process) - glCallList(dlist.resbar[res][4]) -- flash bar + glCallList(dlist.resbar[res][4]) -- flash bar end end glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -1437,11 +1496,13 @@ local function drawResBars() glCallList(dlist.resbar[res][2]) -- sliders end - if showOverflowTooltip[res] and dlist.resbar[res][7] then glCallList(dlist.resbar[res][7]) end -- overflow warning + if showOverflowTooltip[res] and dlist.resbar[res][7] then + glCallList(dlist.resbar[res][7]) + end -- overflow warning end - res = 'energy' - if dlist.resbar[res][1] and dlist.resbar[res][2] then + res = "energy" + if dlist.resbar[res][1] and dlist.resbar[res][2] then if not spec and gameFrame > cfg.spawnWarpInFrame and dlist.resbar[res][4] then glBlending(GL.SRC_ALPHA, GL.ONE) if allyteamOverflowingEnergy then @@ -1472,60 +1533,62 @@ local function drawResBars() glCallList(dlist.resbar[res][2]) -- sliders end - if showOverflowTooltip[res] and dlist.resbar[res][7] then glCallList(dlist.resbar[res][7]) end -- overflow warning + if showOverflowTooltip[res] and dlist.resbar[res][7] then + glCallList(dlist.resbar[res][7]) + end -- overflow warning end glPopMatrix() if update then local scissors = {} - res = 'metal' + res = "metal" if updateRes[res][1] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textCurrent[2]-topbarArea[1])-(cache.lastResbarValueWidth[res]*0.75), - (topbarArea[4]-topbarArea[2])*0.48, - resbarDrawinfo[res].textCurrent[4]+cache.lastResbarValueWidth[res], - topbarArea[4]-topbarArea[2] + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textCurrent[2] - topbarArea[1]) - (cache.lastResbarValueWidth[res] * 0.75), + (topbarArea[4] - topbarArea[2]) * 0.48, + resbarDrawinfo[res].textCurrent[4] + cache.lastResbarValueWidth[res], + topbarArea[4] - topbarArea[2], } end if updateRes[res][2] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textPull[2]-topbarArea[1])-(resbarDrawinfo[res].textPull[4]*3.4), + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textPull[2] - topbarArea[1]) - (resbarDrawinfo[res].textPull[4] * 3.4), 0, - resbarDrawinfo[res].textPull[4]*3.5, - topbarArea[4]-topbarArea[2] + resbarDrawinfo[res].textPull[4] * 3.5, + topbarArea[4] - topbarArea[2], } end if updateRes[res][3] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textStorage[2]-topbarArea[1])-(resbarDrawinfo[res].textStorage[4]*4), - (topbarArea[4]-topbarArea[2])*0.48, - resbarDrawinfo[res].textStorage[4]*4.1, - topbarArea[4]-topbarArea[2] + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textStorage[2] - topbarArea[1]) - (resbarDrawinfo[res].textStorage[4] * 4), + (topbarArea[4] - topbarArea[2]) * 0.48, + resbarDrawinfo[res].textStorage[4] * 4.1, + topbarArea[4] - topbarArea[2], } end - res = 'energy' + res = "energy" if updateRes[res][1] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textCurrent[2]-topbarArea[1])-(cache.lastResbarValueWidth[res]*0.75), - (topbarArea[4]-topbarArea[2])*0.48, - resbarDrawinfo[res].textCurrent[4]+cache.lastResbarValueWidth[res], - topbarArea[4]-topbarArea[2] + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textCurrent[2] - topbarArea[1]) - (cache.lastResbarValueWidth[res] * 0.75), + (topbarArea[4] - topbarArea[2]) * 0.48, + resbarDrawinfo[res].textCurrent[4] + cache.lastResbarValueWidth[res], + topbarArea[4] - topbarArea[2], } end if updateRes[res][2] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textPull[2]-topbarArea[1])-(resbarDrawinfo[res].textPull[4]*3.4), + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textPull[2] - topbarArea[1]) - (resbarDrawinfo[res].textPull[4] * 3.4), 0, - resbarDrawinfo[res].textPull[4]*3.5, - topbarArea[4]-topbarArea[2] + resbarDrawinfo[res].textPull[4] * 3.5, + topbarArea[4] - topbarArea[2], } end if updateRes[res][3] then - scissors[#scissors+1] = { - (resbarDrawinfo[res].textStorage[2]-topbarArea[1])-(resbarDrawinfo[res].textStorage[4]*4), - (topbarArea[4]-topbarArea[2])*0.48, - resbarDrawinfo[res].textStorage[4]*4.1, - topbarArea[4]-topbarArea[2] + scissors[#scissors + 1] = { + (resbarDrawinfo[res].textStorage[2] - topbarArea[1]) - (resbarDrawinfo[res].textStorage[4] * 4), + (topbarArea[4] - topbarArea[2]) * 0.48, + resbarDrawinfo[res].textStorage[4] * 4.1, + topbarArea[4] - topbarArea[2], } end @@ -1536,12 +1599,14 @@ end local function drawQuitScreen() local fadeTime = 0.2 local fadeProgress = (now - showQuitscreen) / fadeTime - if fadeProgress > 1 then fadeProgress = 1 end + if fadeProgress > 1 then + fadeProgress = 1 + end - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") dlist.quit = glCreateList(function() - if WG['guishader'] then + if WG["guishader"] then glColor(0, 0, 0, (0.18 * fadeProgress)) else glColor(0, 0, 0, (0.35 * fadeProgress)) @@ -1556,19 +1621,19 @@ local function drawQuitScreen() local h = mathFloor(w / 3.5) local fontSize = h / 6 - local text = Spring.I18N('ui.topbar.quit.reallyQuit') + local text = Spring.I18N("ui.topbar.quit.reallyQuit") teamResign = false if not spec then - text = Spring.I18N('ui.topbar.quit.reallyQuitResign') + text = Spring.I18N("ui.topbar.quit.reallyQuitResign") if not gameIsOver and chobbyLoaded then if numPlayers < 3 then - text = Spring.I18N('ui.topbar.quit.reallyResign') + text = Spring.I18N("ui.topbar.quit.reallyResign") else if getPlayerLiveAllyCount() >= 1 then teamResign = true end - text = Spring.I18N('ui.topbar.quit.reallyResignSpectate') + text = Spring.I18N("ui.topbar.quit.reallyResignSpectate") end end end @@ -1582,31 +1647,31 @@ local function drawQuitScreen() local y = mathFloor((vsy / 1.8) - (h / 2)) local maxButtons = teamResign and 5 or 4 local buttonMargin = mathFloor(h / 9) - local buttonWidth = mathFloor((w - buttonMargin * maxButtons) / (maxButtons-1)) -- maxButtons+1 margins for maxButtons buttons + local buttonWidth = mathFloor((w - buttonMargin * maxButtons) / (maxButtons - 1)) -- maxButtons+1 margins for maxButtons buttons local buttonHeight = mathFloor(h * 0.30) quitscreenArea = { x, y, x + w, y + h } if teamResign then - quitscreenArea[2] = quitscreenArea[2] - mathFloor(fontSize*1.7) + quitscreenArea[2] = quitscreenArea[2] - mathFloor(fontSize * 1.7) end - quitscreenStayArea = { x + buttonMargin + 0 * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + 0 * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } + quitscreenStayArea = { x + buttonMargin + 0 * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + 0 * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } quitscreenResignArea = { x + buttonMargin + 1 * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + 1 * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } local nextButton = 2 if teamResign then quitscreenTeamResignArea = { x + buttonMargin + nextButton * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + nextButton * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } nextButton = nextButton + 1 end - quitscreenQuitArea = { x + buttonMargin + nextButton * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + nextButton * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } + quitscreenQuitArea = { x + buttonMargin + nextButton * (buttonWidth + buttonMargin), y + buttonMargin, x + buttonMargin + nextButton * (buttonWidth + buttonMargin) + buttonWidth, y + buttonMargin + buttonHeight } -- window - UiElement(quitscreenArea[1], quitscreenArea[2], quitscreenArea[3], quitscreenArea[4], 1,1,1,1, 1,1,1,1, nil, {1, 1, 1, 0.6 + (0.34 * fadeProgress)}, {0.45, 0.45, 0.4, 0.025 + (0.025 * fadeProgress)}, nil) + UiElement(quitscreenArea[1], quitscreenArea[2], quitscreenArea[3], quitscreenArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, { 1, 1, 1, 0.6 + (0.34 * fadeProgress) }, { 0.45, 0.45, 0.4, 0.025 + (0.025 * fadeProgress) }, nil) local color1, color2 font:Begin(true) font:SetTextColor(0, 0, 0, 1) - font:Print(text, quitscreenArea[1] + ((quitscreenArea[3] - quitscreenArea[1]) / 2), quitscreenArea[4]-textTopPadding, fontSize, "cn") + font:Print(text, quitscreenArea[1] + ((quitscreenArea[3] - quitscreenArea[1]) / 2), quitscreenArea[4] - textTopPadding, fontSize, "cn") font:End() font2:Begin(true) @@ -1624,8 +1689,8 @@ local function drawQuitScreen() color1 = { 0, 0.25, 0, 0.35 + (0.5 * fadeProgress) } color2 = { 0, 0.5, 0, 0.35 + (0.5 * fadeProgress) } end - UiButton(quitscreenStayArea[1], quitscreenStayArea[2], quitscreenStayArea[3], quitscreenStayArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.stay'), quitscreenStayArea[1] + ((quitscreenStayArea[3] - quitscreenStayArea[1]) / 2), quitscreenStayArea[2] + ((quitscreenStayArea[4] - quitscreenStayArea[2]) / 2) - (fontSize / 3), fontSize, "con") + UiButton(quitscreenStayArea[1], quitscreenStayArea[2], quitscreenStayArea[3], quitscreenStayArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, padding * 0.5) + font2:Print(Spring.I18N("ui.topbar.quit.stay"), quitscreenStayArea[1] + ((quitscreenStayArea[3] - quitscreenStayArea[1]) / 2), quitscreenStayArea[2] + ((quitscreenStayArea[4] - quitscreenStayArea[2]) / 2) - (fontSize / 3), fontSize, "con") end -- resign button @@ -1634,28 +1699,28 @@ local function drawQuitScreen() if mathIsInRect(mx, my, quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4]) then color1 = { 0.4, 0, 0, 0.4 + (0.5 * fadeProgress) } color2 = { 0.6, 0.05, 0.05, 0.4 + (0.5 * fadeProgress) } - mouseOver = 'resign' + mouseOver = "resign" else color1 = { 0.25, 0, 0, 0.35 + (0.5 * fadeProgress) } color2 = { 0.5, 0, 0, 0.35 + (0.5 * fadeProgress) } end - UiButton(quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.resign'), quitscreenResignArea[1] + ((quitscreenResignArea[3] - quitscreenResignArea[1]) / 2), quitscreenResignArea[2] + ((quitscreenResignArea[4] - quitscreenResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") + UiButton(quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, padding * 0.5) + font2:Print(Spring.I18N("ui.topbar.quit.resign"), quitscreenResignArea[1] + ((quitscreenResignArea[3] - quitscreenResignArea[1]) / 2), quitscreenResignArea[2] + ((quitscreenResignArea[4] - quitscreenResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") if teamResign then if mathIsInRect(mx, my, quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4]) then color1 = { 0.28, 0.28, 0.28, 0.4 + (0.5 * fadeProgress) } color2 = { 0.45, 0.45, 0.45, 0.4 + (0.5 * fadeProgress) } - mouseOver = 'teamResign' + mouseOver = "teamResign" else color1 = { 0.18, 0.18, 0.18, 0.4 + (0.5 * fadeProgress) } color2 = { 0.33, 0.33, 0.33, 0.4 + (0.5 * fadeProgress) } end - UiButton(quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.teamResign'), quitscreenTeamResignArea[1] + ((quitscreenTeamResignArea[3] - quitscreenTeamResignArea[1]) / 2), quitscreenTeamResignArea[2] + ((quitscreenTeamResignArea[4] - quitscreenTeamResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") + UiButton(quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, padding * 0.5) + font2:Print(Spring.I18N("ui.topbar.quit.teamResign"), quitscreenTeamResignArea[1] + ((quitscreenTeamResignArea[3] - quitscreenTeamResignArea[1]) / 2), quitscreenTeamResignArea[2] + ((quitscreenTeamResignArea[4] - quitscreenTeamResignArea[2]) / 2) - (fontSize / 3), fontSize, "con") end if mouseOver and teamResign then - font:Print(Spring.I18N('ui.topbar.hint.'..mouseOver), quitscreenTeamResignArea[1] - buttonMargin , quitscreenArea[2] + (2.5*fontSize / 3), fontSize*0.9, "cn") + font:Print(Spring.I18N("ui.topbar.hint." .. mouseOver), quitscreenTeamResignArea[1] - buttonMargin, quitscreenArea[2] + (2.5 * fontSize / 3), fontSize * 0.9, "cn") end end @@ -1668,8 +1733,8 @@ local function drawQuitScreen() color1 = { 0.25, 0, 0, 0.35 + (0.5 * fadeProgress) } color2 = { 0.5, 0, 0, 0.35 + (0.5 * fadeProgress) } end - UiButton(quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, padding * 0.5) - font2:Print(Spring.I18N('ui.topbar.quit.quit'), quitscreenQuitArea[1] + ((quitscreenQuitArea[3] - quitscreenQuitArea[1]) / 2), quitscreenQuitArea[2] + ((quitscreenQuitArea[4] - quitscreenQuitArea[2]) / 2) - (fontSize / 3), fontSize, "con") + UiButton(quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, padding * 0.5) + font2:Print(Spring.I18N("ui.topbar.quit.quit"), quitscreenQuitArea[1] + ((quitscreenQuitArea[3] - quitscreenQuitArea[1]) / 2), quitscreenQuitArea[2] + ((quitscreenQuitArea[4] - quitscreenQuitArea[2]) / 2) - (fontSize / 3), fontSize, "con") end font2:End() @@ -1677,9 +1742,9 @@ local function drawQuitScreen() end) -- background - if WG['guishader'] then - WG['guishader'].setScreenBlur(true) - WG['guishader'].insertRenderDlist(dlist.quit) + if WG["guishader"] then + WG["guishader"].setScreenBlur(true) + WG["guishader"].insertRenderDlist(dlist.quit) else glCallList(dlist.quit) end @@ -1688,27 +1753,27 @@ end local function drawUiBackground() if showResourceBars then if resbarArea.energy[1] then - local energySkew = cfg.useSkew and {brx = -((resbarArea.energy[4] - resbarArea.energy[2]) * skewTan)} or nil + local energySkew = cfg.useSkew and { brx = -((resbarArea.energy[4] - resbarArea.energy[2]) * skewTan) } or nil UiElement(resbarArea.energy[1], resbarArea.energy[2], resbarArea.energy[3], resbarArea.energy[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, energySkew) end if resbarArea.metal[1] then - local metalSkew = cfg.useSkew and {blx = (resbarArea.metal[4] - resbarArea.metal[2]) * skewTan} or nil + local metalSkew = cfg.useSkew and { blx = (resbarArea.metal[4] - resbarArea.metal[2]) * skewTan } or nil UiElement(resbarArea.metal[1], resbarArea.metal[2], resbarArea.metal[3], resbarArea.metal[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, metalSkew) end end if comsArea[1] then local H = comsArea[4] - comsArea[2] - local smallSkew = cfg.useSkew and {blx = -(H * skewTan), brx = -(H * skewTan)} or nil + local smallSkew = cfg.useSkew and { blx = -(H * skewTan), brx = -(H * skewTan) } or nil UiElement(comsArea[1], comsArea[2], comsArea[3], comsArea[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, smallSkew) end if windArea[1] then local H = windArea[4] - windArea[2] - local smallSkew = cfg.useSkew and {blx = -(H * skewTan), brx = -(H * skewTan)} or nil + local smallSkew = cfg.useSkew and { blx = -(H * skewTan), brx = -(H * skewTan) } or nil UiElement(windArea[1], windArea[2], windArea[3], windArea[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, smallSkew) end if displayTidalSpeed and tidalarea[1] then local H = tidalarea[4] - tidalarea[2] - local smallSkew = cfg.useSkew and {blx = -(H * skewTan), brx = -(H * skewTan)} or nil + local smallSkew = cfg.useSkew and { blx = -(H * skewTan), brx = -(H * skewTan) } or nil UiElement(tidalarea[1], tidalarea[2], tidalarea[3], tidalarea[4], 0, 0, 1, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, smallSkew) end if showButtons and buttonsArea[1] then @@ -1732,8 +1797,8 @@ local function drawUi() if windFunctions.isNoWind() then font2:Begin(true) --font2:Print("\255\200\200\200no wind", windSkewCX, windArea[2] + ((windArea[4] - windArea[2]) / 2.05) - (fontsize / 5), fontsize, 'oc') -- Wind speed text - font2:Print(noWindText1, windSkewCX, windArea[2] + ((windArea[4] - windArea[2]) / 1.5) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text - font2:Print(noWindText2, windSkewCX, windArea[2] + ((windArea[4] - windArea[2]) / 2.8) - (fontsize / 5), fontsize*1.06, 'oc') -- Wind speed text + font2:Print(noWindText1, windSkewCX, windArea[2] + ((windArea[4] - windArea[2]) / 1.5) - (fontsize / 5), fontsize * 1.06, "oc") -- Wind speed text + font2:Print(noWindText2, windSkewCX, windArea[2] + ((windArea[4] - windArea[2]) / 2.8) - (fontsize / 5), fontsize * 1.06, "oc") -- Wind speed text font2:End() end @@ -1742,7 +1807,7 @@ local function drawUi() local fontSize = (tidalarea[4] - tidalarea[2]) / 2.3 local skewCenterOffset = cfg.useSkew and (tidalarea[4] - tidalarea[2]) * skewTan * 0.5 or 0 font2:Begin(true) - font2:Print(tidalSpeedText, tidalarea[1] + ((tidalarea[3] - tidalarea[1]) / 2) - skewCenterOffset, tidalarea[2] + ((tidalarea[4] - tidalarea[2]) / 2.05) - (fontSize / 5), fontSize, 'oc') -- Tidal speed text + font2:Print(tidalSpeedText, tidalarea[1] + ((tidalarea[3] - tidalarea[1]) / 2) - skewCenterOffset, tidalarea[2] + ((tidalarea[4] - tidalarea[2]) / 2.05) - (fontSize / 5), fontSize, "oc") -- Tidal speed text font2:End() end end @@ -1750,54 +1815,54 @@ end -- --- OPTIMIZATION: Pre-defined functions for RenderToTexture to avoid creating closures. local function renderUiBackground() glTranslate(-1, -1, 0) - glScale(2 / (topbarArea[3]-topbarArea[1]), 2 / (topbarArea[4]-topbarArea[2]), 0) + glScale(2 / (topbarArea[3] - topbarArea[1]), 2 / (topbarArea[4] - topbarArea[2]), 0) glTranslate(-topbarArea[1], -topbarArea[2], 0) drawUiBackground() end local function renderUi() glTranslate(-1, -1, 0) - glScale(2 / (topbarArea[3]-topbarArea[1]), 2 / (topbarArea[4]-topbarArea[2]), 0) + glScale(2 / (topbarArea[3] - topbarArea[1]), 2 / (topbarArea[4] - topbarArea[2]), 0) glTranslate(-topbarArea[1], -topbarArea[2], 0) drawUi() end local function renderWindText() - glTranslate(-1, -1, 0) - glScale(2 / (topbarArea[3]-topbarArea[1]), 2 / (topbarArea[4]-topbarArea[2]), 0) - glTranslate(-topbarArea[1], -topbarArea[2], 0) - - local windH = windArea[4] - windArea[2] - local fontSize = windH / 2.3 - local skewCenterOffset = cfg.useSkew and windH * skewTan * 0.5 or 0 - font2:Begin(true) - font2:SetOutlineColor(0,0,0,1) - -- current wind (large, centered) - only once game has started - if gameFrame > 0 then - font2:Print(currentWindText, windArea[1] + ((windArea[3] - windArea[1]) / 2.1) - skewCenterOffset, windArea[2] + (windH / 1.85) - (fontSize / 5), fontSize, 'oc') - end - -- min wind: top area, x corrected for slope at text height - local smallFS = windH / 3.4 - local minBaseline = windArea[4] - smallFS + (1 * widgetScale) - local minWindX = windArea[3] - (cfg.useSkew and skewTan * (windArea[4] - minBaseline) or 0) - (4.5 * widgetScale) - font2:Print(minWindText, minWindX, minBaseline, smallFS, 'or') - -- max wind: bottom-right corner - local brWindX = windArea[3] - (cfg.useSkew and windH * skewTan or 0) - font2:Print(maxWindText, brWindX - (1.2 * widgetScale), windArea[2] + (4.5 * widgetScale), smallFS, 'or') - font2:End() + glTranslate(-1, -1, 0) + glScale(2 / (topbarArea[3] - topbarArea[1]), 2 / (topbarArea[4] - topbarArea[2]), 0) + glTranslate(-topbarArea[1], -topbarArea[2], 0) + + local windH = windArea[4] - windArea[2] + local fontSize = windH / 2.3 + local skewCenterOffset = cfg.useSkew and windH * skewTan * 0.5 or 0 + font2:Begin(true) + font2:SetOutlineColor(0, 0, 0, 1) + -- current wind (large, centered) - only once game has started + if gameFrame > 0 then + font2:Print(currentWindText, windArea[1] + ((windArea[3] - windArea[1]) / 2.1) - skewCenterOffset, windArea[2] + (windH / 1.85) - (fontSize / 5), fontSize, "oc") + end + -- min wind: top area, x corrected for slope at text height + local smallFS = windH / 3.4 + local minBaseline = windArea[4] - smallFS + (1 * widgetScale) + local minWindX = windArea[3] - (cfg.useSkew and skewTan * (windArea[4] - minBaseline) or 0) - (4.5 * widgetScale) + font2:Print(minWindText, minWindX, minBaseline, smallFS, "or") + -- max wind: bottom-right corner + local brWindX = windArea[3] - (cfg.useSkew and windH * skewTan or 0) + font2:Print(maxWindText, brWindX - (1.2 * widgetScale), windArea[2] + (4.5 * widgetScale), smallFS, "or") + font2:End() end local function renderComCounter() - glTranslate(-1, -1, 0) - glScale(2 / (topbarArea[3]-topbarArea[1]), 2 / (topbarArea[4]-topbarArea[2]), 0) - glTranslate(-topbarArea[1], -topbarArea[2], 0) - - if allyComs == 1 and (gameFrame % 12 < 6) then - glColor(1, 0.6, 0, 0.45) - else - glColor(1, 1, 1, 0.22) - end - glCallList(dlist.coms) + glTranslate(-1, -1, 0) + glScale(2 / (topbarArea[3] - topbarArea[1]), 2 / (topbarArea[4] - topbarArea[2]), 0) + glTranslate(-topbarArea[1], -topbarArea[2], 0) + + if allyComs == 1 and (gameFrame % 12 < 6) then + glColor(1, 0.6, 0, 0.45) + else + glColor(1, 1, 1, 0.22) + end + glCallList(dlist.coms) end function widget:DrawScreen() @@ -1805,7 +1870,7 @@ function widget:DrawScreen() local topbarHeight = topbarArea[4] - topbarArea[2] if hoveringTopbar then - sp.SetMouseCursor('cursornormal') + sp.SetMouseCursor("cursornormal") end if showButtons ~= cache.prevShowButtons then @@ -1817,7 +1882,7 @@ function widget:DrawScreen() if uiBgTex then gl.DeleteTexture(uiBgTex) end - uiBgTex = gl.CreateTexture(mathFloor(topbarArea[3]-topbarArea[1]), mathFloor(topbarArea[4]-topbarArea[2]), { + uiBgTex = gl.CreateTexture(mathFloor(topbarArea[3] - topbarArea[1]), mathFloor(topbarArea[4] - topbarArea[2]), { target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -1825,7 +1890,7 @@ function widget:DrawScreen() if uiTex then gl.DeleteTexture(uiTex) end - uiTex = gl.CreateTexture(mathFloor(topbarArea[3]-topbarArea[1]), mathFloor(topbarArea[4]-topbarArea[2]), { --*(vsy<1400 and 2 or 1) + uiTex = gl.CreateTexture(mathFloor(topbarArea[3] - topbarArea[1]), mathFloor(topbarArea[4] - topbarArea[2]), { --*(vsy<1400 and 2 or 1) target = GL.TEXTURE_2D, format = GL.ALPHA, fbo = true, @@ -1838,17 +1903,18 @@ function widget:DrawScreen() r2tHelper.RenderToTexture(uiTex, renderUi, true) end - if WG['guishader'] then - if uiBgList then glDeleteList(uiBgList) end + if WG["guishader"] then + if uiBgList then + glDeleteList(uiBgList) + end uiBgList = glCreateList(function() - glColor(1,1,1,1) + glColor(1, 1, 1, 1) gl.Texture(uiBgTex) gl.TexRect(topbarArea[1], topbarArea[2], topbarArea[3], topbarArea[4], false, true) gl.Texture(false) end) - WG['guishader'].InsertDlist(uiBgList, 'topbar_background') + WG["guishader"].InsertDlist(uiBgList, "topbar_background") end - end if uiBgTex then @@ -1866,7 +1932,7 @@ function widget:DrawScreen() if displayTidalSpeed and dlist.tidal2 then local tidalSkewCX = tidalarea[1] + ((tidalarea[3] - tidalarea[1]) / 2) - (cfg.useSkew and (tidalarea[4] - tidalarea[2]) * skewTan * 0.5 or 0) glPushMatrix() - glTranslate(tidalSkewCX, mathSin(now/PI) * tidalWaveAnimationHeight + tidalarea[2] + (bgpadding/2) + ((tidalarea[4] - tidalarea[2]) / 2), 0) + glTranslate(tidalSkewCX, mathSin(now / PI) * tidalWaveAnimationHeight + tidalarea[2] + (bgpadding / 2) + ((tidalarea[4] - tidalarea[2]) / 2), 0) glCallList(dlist.tidal2) end @@ -1880,9 +1946,9 @@ function widget:DrawScreen() if showingWarning[res] and resbarDrawinfo[res] and resbarDrawinfo[res].textStorage then scissorsCount = scissorsCount + 1 local scissor = storageScissors[scissorsCount] - scissor[1] = (resbarDrawinfo[res].textStorage[2]-topbarArea[1])-(resbarDrawinfo[res].textStorage[4]*4) + scissor[1] = (resbarDrawinfo[res].textStorage[2] - topbarArea[1]) - (resbarDrawinfo[res].textStorage[4] * 4) scissor[2] = topbarHeight * 0.48 - scissor[3] = resbarDrawinfo[res].textStorage[4]*4.1 + scissor[3] = resbarDrawinfo[res].textStorage[4] * 4.1 scissor[4] = topbarHeight end end @@ -1903,16 +1969,12 @@ function widget:DrawScreen() if not windFunctions.isNoWind() then if currentWind ~= prevWind or refreshUi then prevWind = currentWind - windTextScissor[1] = windArea[1]-topbarArea[1] - windTextScissor[2] = windArea[2]-topbarArea[2] - windTextScissor[3] = windArea[3]-windArea[1] - windTextScissor[4] = windArea[4]-windArea[2] + windTextScissor[1] = windArea[1] - topbarArea[1] + windTextScissor[2] = windArea[2] - topbarArea[2] + windTextScissor[3] = windArea[3] - windArea[1] + windTextScissor[4] = windArea[4] - windArea[2] - r2tHelper.RenderToTexture(uiTex, - renderWindText, - true, - windTextScissor - ) + r2tHelper.RenderToTexture(uiTex, renderWindText, true, windTextScissor) end end @@ -1920,26 +1982,21 @@ function widget:DrawScreen() glPushMatrix() if displayComCounter and dlist.coms then - -- commander counter if comsDlistUpdate or prevComAlert == nil or (prevComAlert ~= (allyComs == 1 and (gameFrame % 12 < 6))) then prevComAlert = (allyComs == 1 and (gameFrame % 12 < 6)) comsDlistUpdate = nil - comCounterScissor[1] = comsArea[1]-topbarArea[1] + comCounterScissor[1] = comsArea[1] - topbarArea[1] comCounterScissor[2] = 0 - comCounterScissor[3] = comsArea[3]-comsArea[1] + comCounterScissor[3] = comsArea[3] - comsArea[1] comCounterScissor[4] = topbarHeight - r2tHelper.RenderToTexture(uiTex, - renderComCounter, - true, - comCounterScissor - ) + r2tHelper.RenderToTexture(uiTex, renderComCounter, true, comCounterScissor) end end if autoHideButtons then - if buttonsArea[1] and hoveringTopbar == 'menu' then + if buttonsArea[1] and hoveringTopbar == "menu" then if not showButtons then showButtons = true end @@ -1948,28 +2005,27 @@ function widget:DrawScreen() end end - if showButtons and dlist.buttons and buttonsArea['buttons'] then - + if showButtons and dlist.buttons and buttonsArea["buttons"] then -- changelog changes highlight - if WG['changelog'] and WG['changelog'].haschanges() then - local button = 'changelog' - if buttonsArea['buttons'][button] then + if WG["changelog"] and WG["changelog"].haschanges() then + local button = "changelog" + if buttonsArea["buttons"][button] then local paddingsize = 1 - RectRound(buttonsArea['buttons'][button][1]+paddingsize, buttonsArea['buttons'][button][2]+paddingsize, buttonsArea['buttons'][button][3]-paddingsize, buttonsArea['buttons'][button][4]-paddingsize, 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1,1,1, 0.1*blinkProgress }) + RectRound(buttonsArea["buttons"][button][1] + paddingsize, buttonsArea["buttons"][button][2] + paddingsize, buttonsArea["buttons"][button][3] - paddingsize, buttonsArea["buttons"][button][4] - paddingsize, 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1, 1, 1, 0.1 * blinkProgress }) end end -- hovered? - if not showQuitscreen and buttonsArea['buttons'] and hoveringTopbar == 'menu' then - for button, pos in pairs(buttonsArea['buttons']) do + if not showQuitscreen and buttonsArea["buttons"] and hoveringTopbar == "menu" then + for button, pos in pairs(buttonsArea["buttons"]) do if mathIsInRect(mx, my, pos[1], pos[2], pos[3], pos[4]) then local paddingsize = 1 - RectRound(buttonsArea['buttons'][button][1]+paddingsize, buttonsArea['buttons'][button][2]+paddingsize, buttonsArea['buttons'][button][3]-paddingsize, buttonsArea['buttons'][button][4]-paddingsize, 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 0,0,0, 0.06 }) + RectRound(buttonsArea["buttons"][button][1] + paddingsize, buttonsArea["buttons"][button][2] + paddingsize, buttonsArea["buttons"][button][3] - paddingsize, buttonsArea["buttons"][button][4] - paddingsize, 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 0, 0, 0, 0.06 }) glBlending(GL.SRC_ALPHA, GL.ONE) - RectRound(buttonsArea['buttons'][button][1], buttonsArea['buttons'][button][2], buttonsArea['buttons'][button][3], buttonsArea['buttons'][button][4], 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1, 1, 1, mb and 0.13 or 0.03 }, { 0.44, 0.44, 0.44, mb and 0.4 or 0.2 }) + RectRound(buttonsArea["buttons"][button][1], buttonsArea["buttons"][button][2], buttonsArea["buttons"][button][3], buttonsArea["buttons"][button][4], 3.5 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1, 1, 1, mb and 0.13 or 0.03 }, { 0.44, 0.44, 0.44, mb and 0.4 or 0.2 }) local mult = 1 - RectRound(buttonsArea['buttons'][button][1], buttonsArea['buttons'][button][4] - ((buttonsArea['buttons'][button][4] - buttonsArea['buttons'][button][2]) * 0.4), buttonsArea['buttons'][button][3], buttonsArea['buttons'][button][4], 3.3 * widgetScale, 0, 0, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.18 * mult }) - RectRound(buttonsArea['buttons'][button][1], buttonsArea['buttons'][button][2], buttonsArea['buttons'][button][3], buttonsArea['buttons'][button][2] + ((buttonsArea['buttons'][button][4] - buttonsArea['buttons'][button][2]) * 0.25), 3.3 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1, 1, 1, 0.045 * mult }, { 1, 1, 1, 0 }) + RectRound(buttonsArea["buttons"][button][1], buttonsArea["buttons"][button][4] - ((buttonsArea["buttons"][button][4] - buttonsArea["buttons"][button][2]) * 0.4), buttonsArea["buttons"][button][3], buttonsArea["buttons"][button][4], 3.3 * widgetScale, 0, 0, 0, 0, { 1, 1, 1, 0 }, { 1, 1, 1, 0.18 * mult }) + RectRound(buttonsArea["buttons"][button][1], buttonsArea["buttons"][button][2], buttonsArea["buttons"][button][3], buttonsArea["buttons"][button][2] + ((buttonsArea["buttons"][button][4] - buttonsArea["buttons"][button][2]) * 0.25), 3.3 * widgetScale, 0, 0, 0, button == firstButton and 1 or 0, { 1, 1, 1, 0.045 * mult }, { 1, 1, 1, 0 }) glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) break end @@ -1978,7 +2034,9 @@ function widget:DrawScreen() end if dlist.quit then - if WG['guishader'] then WG['guishader'].removeRenderDlist(dlist.quit) end + if WG["guishader"] then + WG["guishader"].removeRenderDlist(dlist.quit) + end glDeleteList(dlist.quit) dlist.quit = nil end @@ -1995,21 +2053,29 @@ end local function adjustSliders(x, y) if draggingShareIndicator and not spec then - local shareValue = (x - resbarDrawinfo[draggingShareIndicator]['barArea'][1]) / (resbarDrawinfo[draggingShareIndicator]['barArea'][3] - resbarDrawinfo[draggingShareIndicator]['barArea'][1]) - if shareValue < 0 then shareValue = 0 end - if shareValue > 1 then shareValue = 1 end + local shareValue = (x - resbarDrawinfo[draggingShareIndicator]["barArea"][1]) / (resbarDrawinfo[draggingShareIndicator]["barArea"][3] - resbarDrawinfo[draggingShareIndicator]["barArea"][1]) + if shareValue < 0 then + shareValue = 0 + end + if shareValue > 1 then + shareValue = 1 + end Spring.SetShareLevel(draggingShareIndicator, shareValue) draggingShareIndicatorValue[draggingShareIndicator] = shareValue updateResbar(draggingShareIndicator) end if draggingConversionIndicator and not spec then - local convValue = mathFloor((x - resbarDrawinfo['energy']['barArea'][1]) / (resbarDrawinfo['energy']['barArea'][3] - resbarDrawinfo['energy']['barArea'][1]) * 100) - if convValue < 12 then convValue = 12 end - if convValue > 88 then convValue = 88 end - Spring.SendLuaRulesMsg(stringFormat(string.char(137) .. '%i', convValue)) + local convValue = mathFloor((x - resbarDrawinfo["energy"]["barArea"][1]) / (resbarDrawinfo["energy"]["barArea"][3] - resbarDrawinfo["energy"]["barArea"][1]) * 100) + if convValue < 12 then + convValue = 12 + end + if convValue > 88 then + convValue = 88 + end + Spring.SendLuaRulesMsg(stringFormat(string.char(137) .. "%i", convValue)) draggingConversionIndicatorValue = convValue - updateResbar('energy') + updateResbar("energy") end end @@ -2027,23 +2093,27 @@ end local function hideWindows() local closedWindow = false - closedWindow = closeWindow('options') or closedWindow - closedWindow = closeWindow('scavengerinfo') or closedWindow - closedWindow = closeWindow('missioninfo') or closedWindow - closedWindow = closeWindow('keybinds') or closedWindow - closedWindow = closeWindow('changelog') or closedWindow - closedWindow = closeWindow('gameinfo') or closedWindow - closedWindow = closeWindow('teamstats') or closedWindow - closedWindow = closeWindow('widgetselector') or closedWindow - if showQuitscreen then closedWindow = true end + closedWindow = closeWindow("options") or closedWindow + closedWindow = closeWindow("scavengerinfo") or closedWindow + closedWindow = closeWindow("missioninfo") or closedWindow + closedWindow = closeWindow("keybinds") or closedWindow + closedWindow = closeWindow("changelog") or closedWindow + closedWindow = closeWindow("gameinfo") or closedWindow + closedWindow = closeWindow("teamstats") or closedWindow + closedWindow = closeWindow("widgetselector") or closedWindow + if showQuitscreen then + closedWindow = true + end showQuitscreen = nil - if WG['guishader'] then WG['guishader'].setScreenBlur(false) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(false) + end if gameIsOver then -- Graphs window can only be open after game end -- Closing Graphs window if open, no way to tell if it was open or not - Spring.SendCommands('endgraph 0') + Spring.SendCommands("endgraph 0") graphsWindowVisible = false end @@ -2063,11 +2133,13 @@ local function toggleWindow(name) end local function applyButtonAction(button) - if playSounds then Spring.PlaySoundFile(leftclick, 0.8, 'ui') end + if playSounds then + Spring.PlaySoundFile(leftclick, 0.8, "ui") + end local isvisible = false - if button == 'quit' or button == 'resign' then - if not gameIsOver and chobbyLoaded and button == 'quit' then + if button == "quit" or button == "resign" then + if not gameIsOver and chobbyLoaded and button == "quit" then Spring.SendLuaMenuMsg("showLobby") else local oldShowQuitscreen @@ -2081,34 +2153,36 @@ local function applyButtonAction(button) if oldShowQuitscreen then if isvisible ~= true then showQuitscreen = oldShowQuitscreen - if WG['guishader'] then WG['guishader'].setScreenBlur(true) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(true) + end end else showQuitscreen = now end end - elseif button == 'options' then - toggleWindow('options') - elseif button == 'save' then - if isSinglePlayer and cfg.allowSavegame and WG['savegame'] then + elseif button == "options" then + toggleWindow("options") + elseif button == "save" then + if isSinglePlayer and cfg.allowSavegame and WG["savegame"] then local time = os.date("%Y%m%d_%H%M%S") - Spring.SendCommands("savegame "..time) - end - elseif button == 'scavengers' then - toggleWindow('scavengerinfo') - elseif button == 'mission' then - toggleWindow('missioninfo') - elseif button == 'keybinds' then - toggleWindow('keybinds') - elseif button == 'changelog' then - toggleWindow('changelog') - elseif button == 'stats' then - toggleWindow('teamstats') - elseif button == 'graphs' then + Spring.SendCommands("savegame " .. time) + end + elseif button == "scavengers" then + toggleWindow("scavengerinfo") + elseif button == "mission" then + toggleWindow("missioninfo") + elseif button == "keybinds" then + toggleWindow("keybinds") + elseif button == "changelog" then + toggleWindow("changelog") + elseif button == "stats" then + toggleWindow("teamstats") + elseif button == "graphs" then isvisible = graphsWindowVisible hideWindows() if gameIsOver and not isvisible then - Spring.SendCommands('endgraph 2') + Spring.SendCommands("endgraph 2") graphsWindowVisible = true end end @@ -2121,19 +2195,23 @@ function widget:GameOver() end function widget:MouseWheel(up, value) -- up = true/false , value = -1/1 - if showQuitscreen and quitscreenArea then return true end + if showQuitscreen and quitscreenArea then + return true + end end function widget:KeyPress(key) if key == 27 then -- ESC - if not WG['options'] or (WG['options'].disallowEsc and not WG['options'].disallowEsc()) then + if not WG["options"] or (WG["options"].disallowEsc and not WG["options"].disallowEsc()) then local escDidSomething = hideWindows() if cfg.escapeKeyPressesQuit and not escDidSomething then - applyButtonAction('quit') + applyButtonAction("quit") end end end - if showQuitscreen and quitscreenArea then return true end + if showQuitscreen and quitscreenArea then + return true + end end function widget:MousePress(x, y, button) @@ -2141,13 +2219,19 @@ function widget:MousePress(x, y, button) if showQuitscreen and quitscreenArea then if mathIsInRect(x, y, quitscreenArea[1], quitscreenArea[2], quitscreenArea[3], quitscreenArea[4]) then if (gameIsOver or not chobbyLoaded or not spec) and mathIsInRect(x, y, quitscreenStayArea[1], quitscreenStayArea[2], quitscreenStayArea[3], quitscreenStayArea[4]) then - if playSounds then Spring.PlaySoundFile(leftclick, 0.75, 'ui') end + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, "ui") + end showQuitscreen = nil - if WG['guishader'] then WG['guishader'].setScreenBlur(false) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(false) + end end if (gameIsOver or not chobbyLoaded) and mathIsInRect(x, y, quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4]) then - if playSounds then Spring.PlaySoundFile(leftclick, 0.75, 'ui') end + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, "ui") + end if not chobbyLoaded then Spring.SendCommands("QuitForce") -- Exit the game completely @@ -2159,32 +2243,42 @@ function widget:MousePress(x, y, button) hideQuitWindow = now end if not spec and not gameIsOver and mathIsInRect(x, y, quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4]) then - if playSounds then Spring.PlaySoundFile(leftclick, 0.75, 'ui') end + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, "ui") + end Spring.SendCommands("spectator") showQuitscreen = nil - if WG['guishader'] then WG['guishader'].setScreenBlur(false) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(false) + end end if not spec and not gameIsOver and teamResign and mathIsInRect(x, y, quitscreenTeamResignArea[1], quitscreenTeamResignArea[2], quitscreenTeamResignArea[3], quitscreenTeamResignArea[4]) then - if playSounds then Spring.PlaySoundFile(leftclick, 0.75, 'ui') end + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, "ui") + end Spring.SendCommands("say !cv resign") showQuitscreen = nil - if WG['guishader'] then WG['guishader'].setScreenBlur(false) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(false) + end end else showQuitscreen = nil - if WG['guishader'] then WG['guishader'].setScreenBlur(false) end + if WG["guishader"] then + WG["guishader"].setScreenBlur(false) + end end return true end if not spec then if not isSingle then - if mathIsInRect(x, y, shareIndicatorArea['metal'][1], shareIndicatorArea['metal'][2], shareIndicatorArea['metal'][3], shareIndicatorArea['metal'][4]) then - draggingShareIndicator = 'metal' + if mathIsInRect(x, y, shareIndicatorArea["metal"][1], shareIndicatorArea["metal"][2], shareIndicatorArea["metal"][3], shareIndicatorArea["metal"][4]) then + draggingShareIndicator = "metal" end - if mathIsInRect(x, y, shareIndicatorArea['energy'][1], shareIndicatorArea['energy'][2], shareIndicatorArea['energy'][3], shareIndicatorArea['energy'][4]) then - draggingShareIndicator = 'energy' + if mathIsInRect(x, y, shareIndicatorArea["energy"][1], shareIndicatorArea["energy"][2], shareIndicatorArea["energy"][3], shareIndicatorArea["energy"][4]) then + draggingShareIndicator = "energy" end end @@ -2193,13 +2287,15 @@ function widget:MousePress(x, y, button) end if draggingShareIndicator or draggingConversionIndicator then - if playSounds then Spring.PlaySoundFile(resourceclick, 0.7, 'ui') end + if playSounds then + Spring.PlaySoundFile(resourceclick, 0.7, "ui") + end return true end end - if buttonsArea['buttons'] then - for button, pos in pairs(buttonsArea['buttons']) do + if buttonsArea["buttons"] then + for button, pos in pairs(buttonsArea["buttons"]) do if mathIsInRect(x, y, pos[1], pos[2], pos[3], pos[4]) then applyButtonAction(button) return true @@ -2207,14 +2303,20 @@ function widget:MousePress(x, y, button) end end else - if showQuitscreen and quitscreenArea then return true end + if showQuitscreen and quitscreenArea then + return true + end end - if hoveringTopbar then return true end + if hoveringTopbar then + return true + end end function widget:MouseRelease(x, y, button) - if showQuitscreen and quitscreenArea then return true end + if showQuitscreen and quitscreenArea then + return true + end if draggingShareIndicator then adjustSliders(x, y) @@ -2232,11 +2334,13 @@ function widget:PlayerChanged() spec = sp.GetSpectatingState() checkSelfStatus() numTeamsInAllyTeam = #Spring.GetTeamList(myAllyTeamID) - if displayComCounter then countComs(true) end + if displayComCounter then + countComs(true) + end if spec then resbarHover = nil if prevMyTeamID ~= myTeamID then - r = { metal = { sp.GetTeamResources(myTeamID, 'metal') }, energy = { sp.GetTeamResources(myTeamID, 'energy') } } + r = { metal = { sp.GetTeamResources(myTeamID, "metal") }, energy = { sp.GetTeamResources(myTeamID, "energy") } } smoothedResources = r end end @@ -2279,24 +2383,26 @@ function widget:Initialize() -- determine if we want to show comcounter local allteams = Spring.GetTeamList() - local teamN = table.maxn(allteams) - 1 --remove gaia - if teamN > 2 then displayComCounter = true end + local teamN = table.maxn(allteams) - 1 --remove gaia + if teamN > 2 then + displayComCounter = true + end - if UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), 'startUnit')] then - textures.com = ':n:Icons/'..UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), 'startUnit')].name..'.png' + if UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), "startUnit")] then + textures.com = ":n:Icons/" .. UnitDefs[Spring.GetTeamRulesParam(Spring.GetMyTeamID(), "startUnit")].name .. ".png" end for _, teamID in ipairs(myAllyTeamList) do - if select(4,Spring.GetTeamInfo(teamID,false)) then -- is AI? + if select(4, Spring.GetTeamInfo(teamID, false)) then -- is AI? local luaAI = Spring.GetTeamLuaAI(teamID) - if luaAI and luaAI ~= "" and (string.find(luaAI, 'Scavengers') or string.find(luaAI, 'Raptors')) then + if luaAI and luaAI ~= "" and (string.find(luaAI, "Scavengers") or string.find(luaAI, "Raptors")) then supressOverflowNotifs = true break end end end - if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') then + if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), "chobby") then chobbyLoaded = true Spring.SendLuaMenuMsg("disableLobbyButton") end @@ -2313,37 +2419,37 @@ function widget:Initialize() end end - WG['topbar'] = {} + WG["topbar"] = {} - WG['topbar'].showingQuit = function() - return (showQuitscreen) + WG["topbar"].showingQuit = function() + return showQuitscreen end - WG['topbar'].hideWindows = function() + WG["topbar"].hideWindows = function() hideWindows() end - WG['topbar'].setAutoHideButtons = function(value) + WG["topbar"].setAutoHideButtons = function(value) refreshUi = true autoHideButtons = value showButtons = not value updateButtons() end - WG['topbar'].getAutoHideButtons = function() + WG["topbar"].getAutoHideButtons = function() return autoHideButtons end - WG['topbar'].getShowButtons = function() + WG["topbar"].getShowButtons = function() return showButtons end - WG['topbar'].updateTopBarEnergy = function(value) + WG["topbar"].updateTopBarEnergy = function(value) draggingConversionIndicatorValue = value - updateResbar('energy') + updateResbar("energy") end - WG['topbar'].setResourceBarsVisible = function(visible) + WG["topbar"].setResourceBarsVisible = function(visible) if showResourceBars == visible then return end @@ -2365,7 +2471,7 @@ function widget:Initialize() end end - WG['topbar'].getResourceBarsVisible = function() + WG["topbar"].getResourceBarsVisible = function() return showResourceBars end @@ -2380,7 +2486,7 @@ function widget:Initialize() widget:GameStart() end - if WG['resource_spot_finder'] and WG['resource_spot_finder'].metalSpotsList and #WG['resource_spot_finder'].metalSpotsList > 0 and #WG['resource_spot_finder'].metalSpotsList <= 2 then -- probably speedmetal kind of map + if WG["resource_spot_finder"] and WG["resource_spot_finder"].metalSpotsList and #WG["resource_spot_finder"].metalSpotsList > 0 and #WG["resource_spot_finder"].metalSpotsList <= 2 then -- probably speedmetal kind of map isMetalmap = true end end @@ -2396,11 +2502,21 @@ function widget:Shutdown() dlist.buttons = glDeleteList(dlist.buttons) dlist.quit = glDeleteList(dlist.quit) - for n, _ in pairs(dlist.windText) do dlist.windText[n] = glDeleteList(dlist.windText[n]) end - for n, _ in pairs(dlist.resbar['metal']) do dlist.resbar['metal'][n] = glDeleteList(dlist.resbar['metal'][n]) end - for n, _ in pairs(dlist.resbar['energy']) do dlist.resbar['energy'][n] = glDeleteList(dlist.resbar['energy'][n]) end - for res, _ in pairs(dlist.resValues) do dlist.resValues[res] = glDeleteList(dlist.resValues[res]) end - for res, _ in pairs(dlist.resValuesBar) do dlist.resValuesBar[res] = glDeleteList(dlist.resValuesBar[res]) end + for n, _ in pairs(dlist.windText) do + dlist.windText[n] = glDeleteList(dlist.windText[n]) + end + for n, _ in pairs(dlist.resbar["metal"]) do + dlist.resbar["metal"][n] = glDeleteList(dlist.resbar["metal"][n]) + end + for n, _ in pairs(dlist.resbar["energy"]) do + dlist.resbar["energy"][n] = glDeleteList(dlist.resbar["energy"][n]) + end + for res, _ in pairs(dlist.resValues) do + dlist.resValues[res] = glDeleteList(dlist.resValues[res]) + end + for res, _ in pairs(dlist.resValuesBar) do + dlist.resValuesBar[res] = glDeleteList(dlist.resValuesBar[res]) + end end if uiBgTex then @@ -2412,31 +2528,31 @@ function widget:Shutdown() uiTex = nil end - if WG['guishader'] then - WG['guishader'].DeleteDlist('topbar_background') + if WG["guishader"] then + WG["guishader"].DeleteDlist("topbar_background") end - if WG['tooltip'] then - WG['tooltip'].RemoveTooltip('coms') - WG['tooltip'].RemoveTooltip('wind') - local res = 'energy' - WG['tooltip'].RemoveTooltip(res .. '_share_slider') - WG['tooltip'].RemoveTooltip(res .. '_share_slider2') - WG['tooltip'].RemoveTooltip(res .. '_metalmaker_slider') - WG['tooltip'].RemoveTooltip(res .. '_pull') - WG['tooltip'].RemoveTooltip(res .. '_income') - WG['tooltip'].RemoveTooltip(res .. '_storage') - WG['tooltip'].RemoveTooltip(res .. '_current') - res = 'metal' - WG['tooltip'].RemoveTooltip(res .. '_share_slider') - WG['tooltip'].RemoveTooltip(res .. '_share_slider2') - WG['tooltip'].RemoveTooltip(res .. '_pull') - WG['tooltip'].RemoveTooltip(res .. '_income') - WG['tooltip'].RemoveTooltip(res .. '_storage') - WG['tooltip'].RemoveTooltip(res .. '_current') + if WG["tooltip"] then + WG["tooltip"].RemoveTooltip("coms") + WG["tooltip"].RemoveTooltip("wind") + local res = "energy" + WG["tooltip"].RemoveTooltip(res .. "_share_slider") + WG["tooltip"].RemoveTooltip(res .. "_share_slider2") + WG["tooltip"].RemoveTooltip(res .. "_metalmaker_slider") + WG["tooltip"].RemoveTooltip(res .. "_pull") + WG["tooltip"].RemoveTooltip(res .. "_income") + WG["tooltip"].RemoveTooltip(res .. "_storage") + WG["tooltip"].RemoveTooltip(res .. "_current") + res = "metal" + WG["tooltip"].RemoveTooltip(res .. "_share_slider") + WG["tooltip"].RemoveTooltip(res .. "_share_slider2") + WG["tooltip"].RemoveTooltip(res .. "_pull") + WG["tooltip"].RemoveTooltip(res .. "_income") + WG["tooltip"].RemoveTooltip(res .. "_storage") + WG["tooltip"].RemoveTooltip(res .. "_current") end - WG['topbar'] = nil + WG["topbar"] = nil end function widget:GetConfigData() @@ -2444,9 +2560,7 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - if data.autoHideButtons then autoHideButtons = data.autoHideButtons end + if data.autoHideButtons then + autoHideButtons = data.autoHideButtons + end end - - - - diff --git a/luaui/Widgets/gui_transport_weight_limit.lua b/luaui/Widgets/gui_transport_weight_limit.lua index ad0081b10fa..a3804eefdd9 100644 --- a/luaui/Widgets/gui_transport_weight_limit.lua +++ b/luaui/Widgets/gui_transport_weight_limit.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathSin = math.sin local mathCos = math.cos @@ -120,7 +119,7 @@ function widget:GameFrame(n) return end - if selectedUnitsCount < 1 or selectedUnitsCount > 20 then + if selectedUnitsCount < 1 or selectedUnitsCount > 20 then return end diff --git a/luaui/Widgets/gui_turret_trans_range.lua b/luaui/Widgets/gui_turret_trans_range.lua index 5778ce8a556..911294bea79 100644 --- a/luaui/Widgets/gui_turret_trans_range.lua +++ b/luaui/Widgets/gui_turret_trans_range.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Nano range on transport", - desc = "Draw a circle around a transport carrying a nano when its about to unload", - author = "Cheva", - date = "December 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Nano range on transport", + desc = "Draw a circle around a transport carrying a nano when its about to unload", + author = "Cheva", + date = "December 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -60,7 +60,7 @@ local function DrawNanoRange(x, y, z, range) glLineWidth(1) glColor(color[1], color[2], color[3], color[4]) glDrawGroundCircle(x, y, z, range, circleDivisions) - glColor(1,1,1,1) + glColor(1, 1, 1, 1) glLineWidth(1) end @@ -89,24 +89,31 @@ function widget:DrawWorldPreUnit() for _, unitIds in pairs(sel) do for _, unitId in pairs(unitIds) do if transportWithBuilding[unitId] then - table.insert(ranges, - { + table.insert(ranges, { unitDefID = transportWithBuilding[unitId], - range = turretRange[transportWithBuilding[unitId]] + range = turretRange[transportWithBuilding[unitId]], }) end end end - if #ranges == 0 then return end - table.sort(ranges, function(a, b) return a.range < b.range end) + if #ranges == 0 then + return + end + table.sort(ranges, function(a, b) + return a.range < b.range + end) range = ranges[1].range - if range == nil then return end + if range == nil then + return + end local turret = isTurret[ranges[1].unitDefID] color = turret and colors.turret or colors.tower --Spring.Echo(transportWithBuilding[unitId]) local mouseX, mouseY = Spring.GetMouseState() local desc, args = Spring.TraceScreenRay(mouseX, mouseY, true) - if desc == nil then return end + if desc == nil then + return + end local x, y, z = args[1], args[2], args[3] DrawNanoRange(x, y, z, range) end diff --git a/luaui/Widgets/gui_unit_energy_icons.lua b/luaui/Widgets/gui_unit_energy_icons.lua index 65625c7efa2..eb278e70518 100644 --- a/luaui/Widgets/gui_unit_energy_icons.lua +++ b/luaui/Widgets/gui_unit_energy_icons.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Unit Energy Icons", -- GL4 - desc = "Shows the lack of energy symbol above units", - author = "Floris, Beherith", - date = "October 2019", - license = "GNU GPL, v2 or later", - layer = -40, - enabled = true - } + return { + name = "Unit Energy Icons", -- GL4 + desc = "Shows the lack of energy symbol above units", + author = "Floris, Beherith", + date = "October 2019", + license = "GNU GPL, v2 or later", + layer = -40, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetUnitTeam = Spring.GetUnitTeam @@ -20,9 +19,9 @@ local spGetSpectatingState = Spring.GetSpectatingState local weaponEnergyCostFloor = 6 -local spGetTeamResources = Spring.GetTeamResources -local spGetUnitResources = Spring.GetUnitResources -local spGetUnitTeam = spGetUnitTeam +local spGetTeamResources = Spring.GetTeamResources +local spGetUnitResources = Spring.GetUnitResources +local spGetUnitTeam = spGetUnitTeam local teamEnergy = {} -- table of teamid to current energy amount local teamUnits = {} -- table of teamid to table of stallable unitID : unitDefID @@ -34,17 +33,17 @@ local unitConf = {} -- table of unitid to {iconsize, iconheight, neededEnergy, b local maxStall = 0 --Currently not used, was used to skip checking energy level when maxenergy > maxStall issue was energy symbols were not removed then for udid, unitDef in pairs(UnitDefs) do local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 6*( xsize*xsize + zsize*zsize )^0.5 + local scale = 6 * (xsize * xsize + zsize * zsize) ^ 0.5 local buildingNeedingUpkeep = false local neededEnergy = 0 local weapons = unitDef.weapons if #weapons > 0 then - for i=1, #weapons do + for i = 1, #weapons do local weaponDefID = weapons[i].weaponDef local weaponDef = WeaponDefs[weaponDefID] if weaponDef then if weaponDef.stockpile then - neededEnergy = math.floor(weaponDef.energyCost / (weaponDef.stockpileTime/30)) + neededEnergy = math.floor(weaponDef.energyCost / (weaponDef.stockpileTime / 30)) elseif weaponDef.energyCost > neededEnergy and weaponDef.energyCost >= weaponEnergyCostFloor then neededEnergy = weaponDef.energyCost --ToDO: Check if there is reloadtime < 1 sec else adjust similar to stockpile end @@ -55,7 +54,7 @@ for udid, unitDef in pairs(UnitDefs) do buildingNeedingUpkeep = true end if neededEnergy > 0 then - unitConf[udid] = {7.5 +(scale/2.2), unitDef.height, neededEnergy, buildingNeedingUpkeep} + unitConf[udid] = { 7.5 + (scale / 2.2), unitDef.height, neededEnergy, buildingNeedingUpkeep } end maxStall = math.max(maxStall, neededEnergy) end @@ -65,29 +64,29 @@ end -- how shit should work -- init - --stallable unitdefs - --count maxstall amount - --unitdefheights - --unitdefscales +--stallable unitdefs +--count maxstall amount +--unitdefheights +--unitdefscales -- on unitcreated: - -- per team - -- if unit is stallable, add to watch list - -- update maxstall +-- per team +-- if unit is stallable, add to watch list +-- update maxstall -- on destroyed: - -- per team - -- if unit in stallable list, remove from it - -- if unit in stalling list, pop it - -- update maxstall? +-- per team +-- if unit in stallable list, remove from it +-- if unit in stalling list, pop it +-- update maxstall? -- on slow update: - -- for each team - -- check if energy < maxstall - -- check if unit is under construction - -- check all stalling units if they are still stalling - -- pop if not stalling any more - -- check stallable units if they now stall - -- push if stalling - -- additional smartness for global stall/unstall +-- for each team +-- check if energy < maxstall +-- check if unit is under construction +-- check all stalling units if they are still stalling +-- pop if not stalling any more +-- check stallable units if they now stall +-- push if stalling +-- additional smartness for global stall/unstall -- GL4 Backend stuff: local energyIconVBO = nil @@ -96,13 +95,12 @@ local energyIconShader = nil local luaShaderDir = "LuaUI/Include/" local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements +local uploadAllElements = InstanceVBOTable.uploadAllElements local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance - +local popElementInstance = InstanceVBOTable.popElementInstance local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 1 @@ -113,7 +111,7 @@ local function initGL4() shaderConfig.CLIPTOLERANCE = 1.2 shaderConfig.INITIALSIZE = 0.22 shaderConfig.BREATHESIZE = 0.1 - -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader + -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader --shaderConfig.POST_VERTEX = "v_parameters.w = max(-0.2, sin(timeInfo.x * 2.0/30.0 + (v_centerpos.x + v_centerpos.z) * 0.1)) + 0.2; // match CUS glow rate" shaderConfig.ZPULL = 512.0 -- send 32 elmos forward in depth buffer" shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" @@ -133,14 +131,14 @@ end local function UpdateTeamEnergy() for i, teamID in pairs(teamList) do - teamEnergy[teamID] = select(1, spGetTeamResources(teamID, 'energy')) + teamEnergy[teamID] = select(1, spGetTeamResources(teamID, "energy")) end end function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) local spec, fullview = spGetSpectatingState() if spec then - fullview = select(2,spGetSpectatingState()) + fullview = select(2, spGetSpectatingState()) end if not fullview then teamList = Spring.GetTeamList(Spring.GetMyAllyTeamID()) @@ -157,16 +155,17 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) uploadAllElements(energyIconVBO) -- upload them all end - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() return end - if not initGL4() then return end + if not initGL4() then + return + end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end @@ -180,24 +179,40 @@ local function updateStalling() --Previous implementation of such a mechanism led to the energy symbols then remaining when the condition was reached(worked for all but starfall) for unitID, unitDefID in pairs(units) do local unitEnergy = select(4, spGetUnitResources(unitID)) - if teamEnergy[teamID] and unitConf[unitDefID][3] > teamEnergy[teamID] and -- more neededEnergy than we have - (not unitConf[unitDefID][4] or ((unitConf[unitDefID][4] and (unitEnergy or 999999)) < unitConf[unitDefID][3])) then - - if not Spring.GetUnitIsBeingBuilt(unitID) and - energyIconVBO.instanceIDtoIndex[unitID] == nil then -- not already being drawn + if + teamEnergy[teamID] + and unitConf[unitDefID][3] > teamEnergy[teamID] -- more neededEnergy than we have + and (not unitConf[unitDefID][4] or ((unitConf[unitDefID][4] and (unitEnergy or 999999)) < unitConf[unitDefID][3])) + then + if not Spring.GetUnitIsBeingBuilt(unitID) and energyIconVBO.instanceIDtoIndex[unitID] == nil then -- not already being drawn if Spring.ValidUnitID(unitID) and not Spring.GetUnitIsDead(unitID) then pushElementInstance( energyIconVBO, -- push into this Instance VBO Table - {unitConf[unitDefID][1], unitConf[unitDefID][1], 0, unitConf[unitDefID][2], -- lengthwidthcornerheight + { + unitConf[unitDefID][1], + unitConf[unitDefID][1], + 0, + unitConf[unitDefID][2], -- lengthwidthcornerheight 0, --spGetUnitTeam(featureID), -- teamID 4, -- how many vertices should we make ( 2 is a quad) - gf, 0, 0.75 , 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0,1,0,1, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in + gf, + 0, + 0.75, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in unitID, -- this is the key inside the VBO Table, should be unique per unit false, -- update existing element true, -- noupload, dont use unless you know what you want to batch push/pop - unitID) -- last one should be featureID! + unitID + ) -- last one should be featureID! end end elseif energyIconVBO.instanceIDtoIndex[unitID] then @@ -212,14 +227,16 @@ local function updateStalling() end function widget:GameFrame(n) - if spGetGameFrame() %9 == 0 then + if spGetGameFrame() % 9 == 0 then updateStalling() end end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) -- remove the corresponding ground plate if it exists if unitConf[unitDefID] and not Spring.GetUnitIsBeingBuilt(unitID) then - if teamUnits[unitTeam] == nil then teamUnits[unitTeam] = {} end + if teamUnits[unitTeam] == nil then + teamUnits[unitTeam] = {} + end teamUnits[unitTeam][unitID] = unitDefID end end @@ -235,26 +252,30 @@ function widget:VisibleUnitRemoved(unitID) -- remove the corresponding ground pl end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawScreenEffects() -- DrawScreenEffects so icons render after deferred lighting/distortion/bloom/tonemap; -- shader still uses engine cameraViewProj UBO and depth-test for terrain occlusion. - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end if energyIconVBO.usedElements > 0 then local disticon = Spring.GetConfigInt("UnitIconDistance", 200) * 27.5 -- iconLength = unitIconDist * unitIconDist * 750.0f; gl.DepthTest(true) gl.DepthMask(false) - gl.Texture('LuaUI/Images/energy-red.png') + gl.Texture("LuaUI/Images/energy-red.png") energyIconShader:Activate() - energyIconShader:SetUniform("iconDistance",disticon) - energyIconShader:SetUniform("addRadius",0) - energyIconVBO.VAO:DrawArrays(GL.POINTS,energyIconVBO.usedElements) + energyIconShader:SetUniform("iconDistance", disticon) + energyIconShader:SetUniform("addRadius", 0) + energyIconVBO.VAO:DrawArrays(GL.POINTS, energyIconVBO.usedElements) energyIconShader:Deactivate() gl.Texture(false) gl.DepthTest(false) diff --git a/luaui/Widgets/gui_unit_firestate_icons.lua b/luaui/Widgets/gui_unit_firestate_icons.lua index 183818aabbb..2c8367f12e1 100644 --- a/luaui/Widgets/gui_unit_firestate_icons.lua +++ b/luaui/Widgets/gui_unit_firestate_icons.lua @@ -2,54 +2,54 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Unit Fire State Icons", -- GL4 - desc = "Shows hold fire and return fire icons above units", - author = "Floris", - date = "2026", - license = "GNU GPL, v2 or later", - layer = -39, - enabled = true + name = "Unit Fire State Icons", -- GL4 + desc = "Shows hold fire and return fire icons above units", + author = "Floris", + date = "2026", + license = "GNU GPL, v2 or later", + layer = -39, + enabled = true, } end local showFireStateIcons = true -local showAllHoldFireIcons = false -- else only show for user triggered hold fire states +local showAllHoldFireIcons = false -- else only show for user triggered hold fire states -------------------------------------------------------------------------------- -- Localized Spring API -------------------------------------------------------------------------------- -local spGetGameFrame = Spring.GetGameFrame +local spGetGameFrame = Spring.GetGameFrame local spGetUnitRulesParam = Spring.GetUnitRulesParam -local spValidUnitID = Spring.ValidUnitID +local spValidUnitID = Spring.ValidUnitID local spGetUnitIsDead = Spring.GetUnitIsDead local spGetSelectedUnits = Spring.GetSelectedUnits local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyTeamID = Spring.GetMyTeamID local gaiaTeamID = Spring.GetGaiaTeamID() -local HOLD_FIRE = 0 +local HOLD_FIRE = 0 local RETURN_FIRE = 1 local CMD_FIRE_STATE = CMD.FIRE_STATE local CMD_USER_FIRESTATE = GameCMD.USER_FIRESTATE local Firestates = VFS.Include("modules/firestates.lua") -- Textures to display (replace with dedicated icons if available) -local holdFireTexture = "LuaUI/Images/holdfire.png" +local holdFireTexture = "LuaUI/Images/holdfire.png" local returnFireTexture = "LuaUI/Images/returnfire.png" -------------------------------------------------------------------------------- -- GL4 Backend -------------------------------------------------------------------------------- -local holdFireVBO = nil -local returnFireVBO = nil +local holdFireVBO = nil +local returnFireVBO = nil local fireIconShader = nil local luaShaderDir = "LuaUI/Include/" -local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements +local InstanceVBOTable = gl.InstanceVBOTable +local uploadAllElements = InstanceVBOTable.uploadAllElements local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance -------------------------------------------------------------------------------- -- Per-UnitDef config: [unitDefID] = {iconSize, iconHeight} @@ -57,33 +57,33 @@ local popElementInstance = InstanceVBOTable.popElementInstance -------------------------------------------------------------------------------- local unitConf = {} for udid, unitDef in pairs(UnitDefs) do - local hasWeapons = unitDef.weapons and #unitDef.weapons > 0 - local isFactory = unitDef.isFactory - local isDrone = unitDef.customParams and unitDef.customParams.drone - if (hasWeapons or isFactory) and not isDrone then - local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 2.5 * (xsize*xsize + zsize*zsize)^0.5 - unitConf[udid] = {11 + (scale / 2.2), unitDef.height} - end + local hasWeapons = unitDef.weapons and #unitDef.weapons > 0 + local isFactory = unitDef.isFactory + local isDrone = unitDef.customParams and unitDef.customParams.drone + if (hasWeapons or isFactory) and not isDrone then + local xsize, zsize = unitDef.xsize, unitDef.zsize + local scale = 2.5 * (xsize * xsize + zsize * zsize) ^ 0.5 + unitConf[udid] = { 11 + (scale / 2.2), unitDef.height } + end end -- All visible units: [unitID] = unitDefID -local visibleUnits = {} -local crashingUnits = {} -- unitIDs currently crashing; skip icon for these +local visibleUnits = {} +local crashingUnits = {} -- unitIDs currently crashing; skip icon for these local chobbyInterface = false -local unitFireState = {} -- [unitID] = cached fire state; avoids GetUnitStates every frame +local unitFireState = {} -- [unitID] = cached fire state; avoids GetUnitStates every frame local manuallyHeldFire = {} -- [unitID] = true if this client explicitly ordered hold fire -local unitToTeam = {} -- [unitID] = teamID; needed to filter dead-allyteam units -local deadAllyTeams = {} -- [allyTeamID] = true when entire allyteam has been wiped out -local teamToAllyTeam = {} -- [teamID] = allyTeamID; built at Initialize -local deadTeamCount = {} -- [allyTeamID] = number of dead teams in that allyteam +local unitToTeam = {} -- [unitID] = teamID; needed to filter dead-allyteam units +local deadAllyTeams = {} -- [allyTeamID] = true when entire allyteam has been wiped out +local teamToAllyTeam = {} -- [teamID] = allyTeamID; built at Initialize +local deadTeamCount = {} -- [allyTeamID] = number of dead teams in that allyteam local allyTeamTeamCount = {} -- [allyTeamID] = total number of teams in that allyteam -local myPlayerID = spGetMyPlayerID() -local myTeamID = spGetMyTeamID() +local myPlayerID = spGetMyPlayerID() +local myTeamID = spGetMyTeamID() local manualHoldStore = nil -- Pre-allocated and reused for every pushElementInstance call to avoid per-push table allocation -local instanceData = {0, 0, 0, 0, 0, 4, 0, 0, 0.85, 0, 0, 1, 0, 1, 0, 0, 0, 0} +local instanceData = { 0, 0, 0, 0, 0, 4, 0, 0, 0.85, 0, 0, 1, 0, 1, 0, 0, 0, 0 } -------------------------------------------------------------------------------- -- GL4 Initialization @@ -93,32 +93,27 @@ local function createFireIconVBO(shaderConfig, vboName, useGeometryShaderForThis local unitIDattribID if useGeometryShaderForThisShader then instanceLayout = { - {id = 0, name = 'lengthwidthcorner', size = 4}, - {id = 1, name = 'teamID', size = 1, type = GL.UNSIGNED_INT}, - {id = 2, name = 'numvertices', size = 1, type = GL.UNSIGNED_INT}, - {id = 3, name = 'parameters', size = 4}, - {id = 4, name = 'uvoffsets', size = 4}, - {id = 5, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 0, name = "lengthwidthcorner", size = 4 }, + { id = 1, name = "teamID", size = 1, type = GL.UNSIGNED_INT }, + { id = 2, name = "numvertices", size = 1, type = GL.UNSIGNED_INT }, + { id = 3, name = "parameters", size = 4 }, + { id = 4, name = "uvoffsets", size = 4 }, + { id = 5, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDattribID = 5 else instanceLayout = { - {id = 1, name = 'lengthwidthcorner', size = 4}, - {id = 2, name = 'teamID', size = 1, type = GL.UNSIGNED_INT}, - {id = 3, name = 'numvertices', size = 1, type = GL.UNSIGNED_INT}, - {id = 4, name = 'parameters', size = 4}, - {id = 5, name = 'uvoffsets', size = 4}, - {id = 6, name = 'instData', size = 4, type = GL.UNSIGNED_INT}, + { id = 1, name = "lengthwidthcorner", size = 4 }, + { id = 2, name = "teamID", size = 1, type = GL.UNSIGNED_INT }, + { id = 3, name = "numvertices", size = 1, type = GL.UNSIGNED_INT }, + { id = 4, name = "parameters", size = 4 }, + { id = 5, name = "uvoffsets", size = 4 }, + { id = 6, name = "instData", size = 4, type = GL.UNSIGNED_INT }, } unitIDattribID = 6 end - local vboTable = InstanceVBOTable.makeInstanceVBOTable( - instanceLayout, - 64, - vboName, - unitIDattribID - ) + local vboTable = InstanceVBOTable.makeInstanceVBOTable(instanceLayout, 64, vboName, unitIDattribID) if vboTable == nil then return nil end @@ -130,7 +125,7 @@ local function createFireIconVBO(shaderConfig, vboName, useGeometryShaderForThis else local numSlots = math.max(shaderConfig.MAXVERTICES or 64, 8) local templateVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) - templateVBO:Define(numSlots, {{id = 0, name = 'vinfo', size = 1}}) + templateVBO:Define(numSlots, { { id = 0, name = "vinfo", size = 1 } }) local vertexData = {} for slot = 0, numSlots - 1 do vertexData[#vertexData + 1] = slot @@ -172,22 +167,22 @@ local function createFireIconVBO(shaderConfig, vboName, useGeometryShaderForThis end local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit - local shaderConfig = DrawPrimitiveAtUnit.shaderConfig - - shaderConfig.BILLBOARD = 1 - shaderConfig.HEIGHTOFFSET = 0 - shaderConfig.TRANSPARENCY = 0.85 - shaderConfig.ANIMATION = 1 - shaderConfig.FULL_ROTATION = 0 - shaderConfig.CLIPTOLERANCE = 1.2 - shaderConfig.INITIALSIZE = 0.22 - shaderConfig.BREATHESIZE = 0.05 - shaderConfig.ZPULL = 512.0 - shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" - shaderConfig.MAXVERTICES = 4 - shaderConfig.USE_CIRCLES = nil + local shaderConfig = DrawPrimitiveAtUnit.shaderConfig + + shaderConfig.BILLBOARD = 1 + shaderConfig.HEIGHTOFFSET = 0 + shaderConfig.TRANSPARENCY = 0.85 + shaderConfig.ANIMATION = 1 + shaderConfig.FULL_ROTATION = 0 + shaderConfig.CLIPTOLERANCE = 1.2 + shaderConfig.INITIALSIZE = 0.22 + shaderConfig.BREATHESIZE = 0.05 + shaderConfig.ZPULL = 512.0 + shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" + shaderConfig.MAXVERTICES = 4 + shaderConfig.USE_CIRCLES = nil shaderConfig.USE_CORNERRECT = nil holdFireVBO, fireIconShader = InitDrawPrimitiveAtUnit(shaderConfig, "hold fire icons") @@ -207,17 +202,17 @@ local function initGL4() return true end -WG['unitfirestate'] = {} -WG['unitfirestate'].setEnabled = function(value) - showFireStateIcons = value +WG["unitfirestate"] = {} +WG["unitfirestate"].setEnabled = function(value) + showFireStateIcons = value end -WG['unitfirestate'].setShowAllHoldFireIcons = function(value) +WG["unitfirestate"].setShowAllHoldFireIcons = function(value) showAllHoldFireIcons = (value and true) or false if widget and widget.VisibleUnitsChanged and visibleUnits then widget:VisibleUnitsChanged(visibleUnits, nil) end end -WG['unitfirestate'].getShowAllHoldFireIcons = function() +WG["unitfirestate"].getShowAllHoldFireIcons = function() return showAllHoldFireIcons end @@ -232,12 +227,16 @@ end local function getDisplayFireState(unitID) --DEFEND FIRESTATE REWORK: Remove engine fallback; always use user_firestate rules param - if not spValidUnitID(unitID) then return nil end + if not spValidUnitID(unitID) then + return nil + end return userStateToIconState(Firestates.resolveUserFirestate(unitID)) end local function resolveUserStateFromCommand(cmdID, cmdParams, unitID) - if not cmdParams then return nil end + if not cmdParams then + return nil + end if cmdID == CMD_USER_FIRESTATE then return tonumber(cmdParams[1]) end @@ -253,14 +252,20 @@ end -- Helper: push a unit into a fire-state VBO -------------------------------------------------------------------------------- local function pushToVBO(vbo, unitID, unitDefID, gf) - if vbo.instanceIDtoIndex[unitID] then return end - if not spValidUnitID(unitID) or spGetUnitIsDead(unitID) then return end + if vbo.instanceIDtoIndex[unitID] then + return + end + if not spValidUnitID(unitID) or spGetUnitIsDead(unitID) then + return + end local conf = unitConf[unitDefID] - if not conf then return end -- unit has no weapons, skip - instanceData[1] = conf[1] -- width - instanceData[2] = conf[1] -- height - instanceData[4] = conf[2] -- unit height offset - instanceData[7] = gf -- gameframe for animation + if not conf then + return + end -- unit has no weapons, skip + instanceData[1] = conf[1] -- width + instanceData[2] = conf[1] -- height + instanceData[4] = conf[2] -- unit height offset + instanceData[7] = gf -- gameframe for animation pushElementInstance(vbo, instanceData, unitID, false, true, unitID) end @@ -300,11 +305,13 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not initGL4() then return end + if not initGL4() then + return + end -- Persist manual hold-fire flags across widget reloads within the same LuaUI session. - WG['unitfirestate_manualhold'] = WG['unitfirestate_manualhold'] or {} - manualHoldStore = WG['unitfirestate_manualhold'] + WG["unitfirestate_manualhold"] = WG["unitfirestate_manualhold"] or {} + manualHoldStore = WG["unitfirestate_manualhold"] manuallyHeldFire = manualHoldStore -- Build team → allyteam mapping @@ -317,8 +324,8 @@ function widget:Initialize() end end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end @@ -342,20 +349,32 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) end end end - if holdFireVBO.dirty then uploadAllElements(holdFireVBO) end - if returnFireVBO.dirty then uploadAllElements(returnFireVBO) end + if holdFireVBO.dirty then + uploadAllElements(holdFireVBO) + end + if returnFireVBO.dirty then + uploadAllElements(returnFireVBO) + end end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) - if unitTeam == gaiaTeamID then return end + if unitTeam == gaiaTeamID then + return + end visibleUnits[unitID] = unitDefID unitToTeam[unitID] = unitTeam - if crashingUnits[unitID] or deadAllyTeams[teamToAllyTeam[unitTeam]] then return end + if crashingUnits[unitID] or deadAllyTeams[teamToAllyTeam[unitTeam]] then + return + end local fs = getDisplayFireState(unitID) unitFireState[unitID] = fs applyFireState(unitID, unitDefID, fs, spGetGameFrame()) - if holdFireVBO.dirty then uploadAllElements(holdFireVBO) end - if returnFireVBO.dirty then uploadAllElements(returnFireVBO) end + if holdFireVBO.dirty then + uploadAllElements(holdFireVBO) + end + if returnFireVBO.dirty then + uploadAllElements(returnFireVBO) + end end function widget:VisibleUnitRemoved(unitID) @@ -372,7 +391,9 @@ function widget:VisibleUnitRemoved(unitID) end function widget:CrashingAircraft(unitID, unitDefID, teamID) - if teamID == gaiaTeamID then return end + if teamID == gaiaTeamID then + return + end crashingUnits[unitID] = true unitFireState[unitID] = nil manuallyHeldFire[unitID] = nil @@ -385,7 +406,9 @@ function widget:CrashingAircraft(unitID, unitDefID, teamID) end function widget:CommandNotify(cmdID, cmdParams, cmdOpts) - if (cmdID ~= CMD_FIRE_STATE and cmdID ~= CMD_USER_FIRESTATE) or not cmdParams then return false end + if (cmdID ~= CMD_FIRE_STATE and cmdID ~= CMD_USER_FIRESTATE) or not cmdParams then + return false + end local selectedUnits = spGetSelectedUnits() for i = 1, #selectedUnits do local unitID = selectedUnits[i] @@ -404,14 +427,22 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) end end end - if holdFireVBO.dirty then uploadAllElements(holdFireVBO) end - if returnFireVBO.dirty then uploadAllElements(returnFireVBO) end + if holdFireVBO.dirty then + uploadAllElements(holdFireVBO) + end + if returnFireVBO.dirty then + uploadAllElements(returnFireVBO) + end return false end function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) - if teamID == gaiaTeamID then return end - if cmdID ~= CMD_FIRE_STATE and cmdID ~= CMD_USER_FIRESTATE then return end + if teamID == gaiaTeamID then + return + end + if cmdID ~= CMD_FIRE_STATE and cmdID ~= CMD_USER_FIRESTATE then + return + end local userState = resolveUserStateFromCommand(cmdID, cmdParams, unitID) local fs if userState ~= nil then @@ -424,18 +455,30 @@ function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts elseif userState ~= nil then manuallyHeldFire[unitID] = nil end - if not visibleUnits[unitID] or crashingUnits[unitID] or deadAllyTeams[teamToAllyTeam[teamID]] then return end - if unitFireState[unitID] == fs then return end + if not visibleUnits[unitID] or crashingUnits[unitID] or deadAllyTeams[teamToAllyTeam[teamID]] then + return + end + if unitFireState[unitID] == fs then + return + end unitFireState[unitID] = fs applyFireState(unitID, unitDefID, fs, spGetGameFrame()) - if holdFireVBO.dirty then uploadAllElements(holdFireVBO) end - if returnFireVBO.dirty then uploadAllElements(returnFireVBO) end + if holdFireVBO.dirty then + uploadAllElements(holdFireVBO) + end + if returnFireVBO.dirty then + uploadAllElements(returnFireVBO) + end end function widget:TeamDied(teamID) - if teamID == gaiaTeamID then return end + if teamID == gaiaTeamID then + return + end local allyTeamID = teamToAllyTeam[teamID] - if not allyTeamID then return end + if not allyTeamID then + return + end deadTeamCount[allyTeamID] = (deadTeamCount[allyTeamID] or 0) + 1 if deadTeamCount[allyTeamID] < (allyTeamTeamCount[allyTeamID] or 1) then return -- still has surviving teams in this allyteam @@ -459,7 +502,9 @@ end function widget:PlayerChanged(playerID) myPlayerID = spGetMyPlayerID() myTeamID = spGetMyTeamID() - if myPlayerID == nil or myTeamID == nil then return end + if myPlayerID == nil or myTeamID == nil then + return + end for unitID, unitTeamID in pairs(unitToTeam) do if unitTeamID == myTeamID and unitFireState[unitID] == HOLD_FIRE and not manuallyHeldFire[unitID] then if holdFireVBO.instanceIDtoIndex[unitID] then @@ -467,7 +512,9 @@ function widget:PlayerChanged(playerID) end end end - if holdFireVBO.dirty then uploadAllElements(holdFireVBO) end + if holdFireVBO.dirty then + uploadAllElements(holdFireVBO) + end end function widget:UnitDestroyed(unitID) @@ -483,17 +530,23 @@ function widget:UnitTaken(unitID) end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1, 18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawScreenEffects() -- DrawScreenEffects renders after deferred lighting/distortion/bloom/tonemap; -- the shader still uses engine cameraViewProj UBO and depth-tests terrain occlusion. - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end - if not showFireStateIcons then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end + if not showFireStateIcons then + return + end if holdFireVBO.usedElements == 0 and returnFireVBO.usedElements == 0 then return diff --git a/luaui/Widgets/gui_unit_group_number.lua b/luaui/Widgets/gui_unit_group_number.lua index 5c1dda1b26a..3ec16805b64 100644 --- a/luaui/Widgets/gui_unit_group_number.lua +++ b/luaui/Widgets/gui_unit_group_number.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState @@ -33,7 +32,7 @@ local minGroupID = 0 local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance -- Configurables: diff --git a/luaui/Widgets/gui_unit_idlebuilder_icons.lua b/luaui/Widgets/gui_unit_idlebuilder_icons.lua index 8976d54bf62..80717d9d1bf 100644 --- a/luaui/Widgets/gui_unit_idlebuilder_icons.lua +++ b/luaui/Widgets/gui_unit_idlebuilder_icons.lua @@ -1,28 +1,27 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Unit Idle Builder Icons", - desc = "Shows the sleeping icon above workers that are idle", - author = "Floris, Beherith", - date = "June 2024", - license = "GNU GPL, v2 or later", - layer = -40, - enabled = true - } + return { + name = "Unit Idle Builder Icons", + desc = "Shows the sleeping icon above workers that are idle", + author = "Floris, Beherith", + date = "June 2024", + license = "GNU GPL, v2 or later", + layer = -40, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local onlyOwnTeam = true -local idleUnitDelay = 8 -- how long a unit must be idle before the icon shows up +local idleUnitDelay = 8 -- how long a unit must be idle before the icon shows up -local iconSequenceImages = 'Luaui/Images/idleicon/idlecon_' -- must be png's -local iconSequenceNum = 59 -- always starts at 1 -local iconSequenceFrametime = 0.02 -- duration per frame +local iconSequenceImages = "Luaui/Images/idleicon/idlecon_" -- must be png's +local iconSequenceNum = 59 -- always starts at 1 +local iconSequenceFrametime = 0.02 -- duration per frame local unitScope = {} -- table of teamid to table of stallable unitID : unitDefID local idleUnitList = {} @@ -41,10 +40,10 @@ local unitConf = {} for unitDefID, unitDef in pairs(UnitDefs) do local cp = unitDef.customParams if not (cp.virtualunit == "1") then - if unitDef.buildSpeed > 0 and not string.find(unitDef.name, 'spy') and not string.find(unitDef.name, 'infestor') and (unitDef.canAssist or unitDef.buildOptions[1]) and not unitDef.customParams.isairbase then + if unitDef.buildSpeed > 0 and not string.find(unitDef.name, "spy") and not string.find(unitDef.name, "infestor") and (unitDef.canAssist or unitDef.buildOptions[1]) and not unitDef.customParams.isairbase then local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 3.3 * ( (xsize+2)^2 + (zsize+2)^2 )^0.5 - unitConf[unitDefID] = {7.5 +(scale/2.2), unitDef.height-0.1, unitDef.isFactory} + local scale = 3.3 * ((xsize + 2) ^ 2 + (zsize + 2) ^ 2) ^ 0.5 + unitConf[unitDefID] = { 7.5 + (scale / 2.2), unitDef.height - 0.1, unitDef.isFactory } end end end @@ -56,16 +55,16 @@ end local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements +local uploadAllElements = InstanceVBOTable.uploadAllElements local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local iconVBO = nil local energyIconShader = nil local luaShaderDir = "LuaUI/Include/" local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 1 @@ -75,8 +74,8 @@ local function initGL4() shaderConfig.FULL_ROTATION = 0 shaderConfig.CLIPTOLERANCE = 1.2 shaderConfig.INITIALSIZE = 0.22 - shaderConfig.BREATHESIZE = 0--0.1 - -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader + shaderConfig.BREATHESIZE = 0 --0.1 + -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader --shaderConfig.POST_VERTEX = "v_parameters.w = max(-0.2, sin(timeInfo.x * 2.0/30.0 + (v_centerpos.x + v_centerpos.z) * 0.1)) + 0.2; // match CUS glow rate" shaderConfig.ZPULL = 512.0 -- send 16 elmos forward in depth buffer" shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" @@ -94,7 +93,6 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) InstanceVBOTable.clearInstanceTable(iconVBO) -- clear all instances unitScope = {} @@ -104,21 +102,18 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) uploadAllElements(iconVBO) -- upload them all end - function widget:Initialize() - if spec or not gl.CreateShader or not initGL4() then -- no shader support, so just remove the widget itself, especially for headless + if spec or not gl.CreateShader or not initGL4() then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() return end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end - local function isWorkerUnitIdle(unitID, unitDefID) - return inIdleWorkerTask[unitID] - or (unitConf[unitDefID][3] and spGetFactoryCommandCount(unitID) or spGetUnitCommandCount(unitID)) == 0 + return inIdleWorkerTask[unitID] or (unitConf[unitDefID][3] and spGetFactoryCommandCount(unitID) or spGetUnitCommandCount(unitID)) == 0 end local function updateIcons() @@ -132,16 +127,31 @@ local function updateIcons() elseif idleUnitList[unitID] < os.clock() - idleUnitDelay then pushElementInstance( iconVBO, -- push into this Instance VBO Table - {unitConf[unitDefID][1], unitConf[unitDefID][1], 0, unitConf[unitDefID][2], -- lengthwidthcornerheight - 0, --Spring.GetUnitTeam(featureID), -- teamID - 4, -- how many vertices should we make ( 2 is a quad) - gf, 0, 0.8 , 0, -- the gameFrame (for animations), and any other parameters one might want to add - 1,0,1,0, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in + { + unitConf[unitDefID][1], + unitConf[unitDefID][1], + 0, + unitConf[unitDefID][2], -- lengthwidthcornerheight + 0, --Spring.GetUnitTeam(featureID), -- teamID + 4, -- how many vertices should we make ( 2 is a quad) + gf, + 0, + 0.8, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 1, + 0, + 1, + 0, -- These are our default UV atlas tranformations, note how X axis is flipped for atlas + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in unitID, -- this is the key inside the VBO Table, should be unique per unit false, -- update existing element true, -- noupload, dont use unless you know what you want to batch push/pop - unitID) -- last one should be featureID! + unitID + ) -- last one should be featureID! end end end @@ -180,19 +190,21 @@ end function widget:DrawScreenEffects() -- DrawScreenEffects so icons render after deferred lighting/distortion/bloom/tonemap; -- shader still uses engine cameraViewProj UBO and depth-test for terrain occlusion. - if Spring.IsGUIHidden() then return end + if Spring.IsGUIHidden() then + return + end if iconVBO.usedElements > 0 then local disticon = Spring.GetConfigInt("UnitIconDistance", 200) * 27.5 -- iconLength = unitIconDist * unitIconDist * 750.0f; gl.DepthTest(true) gl.DepthMask(false) - local clock = os.clock() * (1*(iconSequenceFrametime*iconSequenceNum)) -- adjust speed relative to anim frame speed of 0.02sec per frame (59 frames in total) + local clock = os.clock() * (1 * (iconSequenceFrametime * iconSequenceNum)) -- adjust speed relative to anim frame speed of 0.02sec per frame (59 frames in total) local animFrame = math.max(1, math.ceil(iconSequenceNum * (clock - math.floor(clock)))) - gl.Texture(iconSequenceImages .. (animFrame < 100 and '0' or '') .. (animFrame < 10 and '0' or '') .. animFrame .. '.png') + gl.Texture(iconSequenceImages .. (animFrame < 100 and "0" or "") .. (animFrame < 10 and "0" or "") .. animFrame .. ".png") energyIconShader:Activate() - energyIconShader:SetUniform("iconDistance",disticon) - energyIconShader:SetUniform("addRadius",0) - iconVBO.VAO:DrawArrays(GL.POINTS,iconVBO.usedElements) + energyIconShader:SetUniform("iconDistance", disticon) + energyIconShader:SetUniform("addRadius", 0) + iconVBO.VAO:DrawArrays(GL.POINTS, iconVBO.usedElements) energyIconShader:Deactivate() gl.Texture(false) gl.DepthTest(false) diff --git a/luaui/Widgets/gui_unit_repeat_icon.lua b/luaui/Widgets/gui_unit_repeat_icon.lua index cd19e6841ab..742eb4e28d4 100644 --- a/luaui/Widgets/gui_unit_repeat_icon.lua +++ b/luaui/Widgets/gui_unit_repeat_icon.lua @@ -2,22 +2,22 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Unit Repeat Icons", -- GL4 - desc = "Shows a repeat icon above units that have the repeat order enabled", - author = "Floris", - date = "2026", - license = "GNU GPL, v2 or later", - layer = -38, - enabled = true + name = "Unit Repeat Icons", -- GL4 + desc = "Shows a repeat icon above units that have the repeat order enabled", + author = "Floris", + date = "2026", + license = "GNU GPL, v2 or later", + layer = -38, + enabled = true, } end -------------------------------------------------------------------------------- -- Localized Spring API -------------------------------------------------------------------------------- -local spGetGameFrame = Spring.GetGameFrame +local spGetGameFrame = Spring.GetGameFrame local spGetUnitStates = Spring.GetUnitStates -local spValidUnitID = Spring.ValidUnitID +local spValidUnitID = Spring.ValidUnitID local spGetUnitIsDead = Spring.GetUnitIsDead local repeatTexture = "LuaUI/Images/repeat.png" @@ -25,14 +25,14 @@ local repeatTexture = "LuaUI/Images/repeat.png" -------------------------------------------------------------------------------- -- GL4 Backend -------------------------------------------------------------------------------- -local repeatVBO = nil -local repeatShader = nil +local repeatVBO = nil +local repeatShader = nil -local luaShaderDir = "LuaUI/Include/" -local InstanceVBOTable = gl.InstanceVBOTable -local uploadAllElements = InstanceVBOTable.uploadAllElements +local luaShaderDir = "LuaUI/Include/" +local InstanceVBOTable = gl.InstanceVBOTable +local uploadAllElements = InstanceVBOTable.uploadAllElements local pushElementInstance = InstanceVBOTable.pushElementInstance -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance -------------------------------------------------------------------------------- -- Per-UnitDef config: [unitDefID] = {iconSize, iconHeight} @@ -53,40 +53,40 @@ for udid, unitDef in pairs(UnitDefs) do end if unitDef.canMove or unitDef.isFactory or hasStockpile then local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 1 * (xsize*xsize + zsize*zsize)^0.5 - unitConf[udid] = {10 + (scale / 2.2), unitDef.height} + local scale = 1 * (xsize * xsize + zsize * zsize) ^ 0.5 + unitConf[udid] = { 10 + (scale / 2.2), unitDef.height } end end -- All visible units: [unitID] = unitDefID -local visibleUnits = {} -local crashingUnits = {} -- unitIDs currently crashing; skip icon for these +local visibleUnits = {} +local crashingUnits = {} -- unitIDs currently crashing; skip icon for these local chobbyInterface = false -local unitRepeat = {} -- [unitID] = cached repeat bool; avoids GetUnitStates every frame +local unitRepeat = {} -- [unitID] = cached repeat bool; avoids GetUnitStates every frame -- Pre-allocated and reused for every pushElementInstance call to avoid per-push table allocation -local instanceData = {0, 0, 0, 0, 0, 4, 0, 0, 0.85, 0, 0, 1, 0, 1, 0, 0, 0, 0} +local instanceData = { 0, 0, 0, 0, 0, 4, 0, 0, 0.85, 0, 0, 1, 0, 1, 0, 0, 0, 0 } -------------------------------------------------------------------------------- -- GL4 Initialization -------------------------------------------------------------------------------- local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit - local shaderConfig = DrawPrimitiveAtUnit.shaderConfig - - shaderConfig.BILLBOARD = 1 - shaderConfig.HEIGHTOFFSET = 0 - shaderConfig.TRANSPARENCY = 0.85 - shaderConfig.ANIMATION = 1 - shaderConfig.FULL_ROTATION = 0 - shaderConfig.CLIPTOLERANCE = 1.2 - shaderConfig.INITIALSIZE = 0.22 - shaderConfig.BREATHESIZE = 0.05 - shaderConfig.ZPULL = 512.0 - shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" - shaderConfig.MAXVERTICES = 4 - shaderConfig.USE_CIRCLES = nil + local shaderConfig = DrawPrimitiveAtUnit.shaderConfig + + shaderConfig.BILLBOARD = 1 + shaderConfig.HEIGHTOFFSET = 0 + shaderConfig.TRANSPARENCY = 0.85 + shaderConfig.ANIMATION = 1 + shaderConfig.FULL_ROTATION = 0 + shaderConfig.CLIPTOLERANCE = 1.2 + shaderConfig.INITIALSIZE = 0.22 + shaderConfig.BREATHESIZE = 0.05 + shaderConfig.ZPULL = 512.0 + shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" + shaderConfig.MAXVERTICES = 4 + shaderConfig.USE_CIRCLES = nil shaderConfig.USE_CORNERRECT = nil repeatVBO, repeatShader = InitDrawPrimitiveAtUnit(shaderConfig, "repeat icons") @@ -101,19 +101,23 @@ end -- Push a unit into the repeat VBO -------------------------------------------------------------------------------- local function pushToVBO(unitID, unitDefID, gf) - if repeatVBO.instanceIDtoIndex[unitID] then return end - if not spValidUnitID(unitID) or spGetUnitIsDead(unitID) then return end + if repeatVBO.instanceIDtoIndex[unitID] then + return + end + if not spValidUnitID(unitID) or spGetUnitIsDead(unitID) then + return + end local conf = unitConf[unitDefID] - if not conf then return end -- unit can't receive repeatable orders, skip - instanceData[1] = conf[1] -- width - instanceData[2] = conf[1] -- height - instanceData[4] = conf[2] -- unit height offset - instanceData[7] = gf -- gameframe for animation + if not conf then + return + end -- unit can't receive repeatable orders, skip + instanceData[1] = conf[1] -- width + instanceData[2] = conf[1] -- height + instanceData[4] = conf[2] -- unit height offset + instanceData[7] = gf -- gameframe for animation pushElementInstance(repeatVBO, instanceData, unitID, false, true, unitID) end - - -------------------------------------------------------------------------------- -- Widget callbacks -------------------------------------------------------------------------------- @@ -122,10 +126,12 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - if not initGL4() then return end + if not initGL4() then + return + end - if WG['unittrackerapi'] and WG['unittrackerapi'].visibleUnits then - widget:VisibleUnitsChanged(WG['unittrackerapi'].visibleUnits, nil) + if WG["unittrackerapi"] and WG["unittrackerapi"].visibleUnits then + widget:VisibleUnitsChanged(WG["unittrackerapi"].visibleUnits, nil) end end @@ -141,23 +147,33 @@ function widget:VisibleUnitsChanged(extVisibleUnits, extNumVisibleUnits) if states then local rep = states["repeat"] unitRepeat[unitID] = rep - if rep then pushToVBO(unitID, unitDefID, gf) end + if rep then + pushToVBO(unitID, unitDefID, gf) + end end end end - if repeatVBO.dirty then uploadAllElements(repeatVBO) end + if repeatVBO.dirty then + uploadAllElements(repeatVBO) + end end function widget:VisibleUnitAdded(unitID, unitDefID, unitTeam) visibleUnits[unitID] = unitDefID - if crashingUnits[unitID] then return end + if crashingUnits[unitID] then + return + end local states = spGetUnitStates(unitID) - if not states then return end + if not states then + return + end local rep = states["repeat"] unitRepeat[unitID] = rep if rep then pushToVBO(unitID, unitDefID, spGetGameFrame()) - if repeatVBO.dirty then uploadAllElements(repeatVBO) end + if repeatVBO.dirty then + uploadAllElements(repeatVBO) + end end end @@ -179,10 +195,16 @@ function widget:CrashingAircraft(unitID, unitDefID, teamID) end function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts) - if cmdID ~= CMD.REPEAT then return end - if not visibleUnits[unitID] or crashingUnits[unitID] then return end + if cmdID ~= CMD.REPEAT then + return + end + if not visibleUnits[unitID] or crashingUnits[unitID] then + return + end local rep = (cmdParams[1] == 1) - if unitRepeat[unitID] == rep then return end + if unitRepeat[unitID] == rep then + return + end unitRepeat[unitID] = rep if rep then pushToVBO(unitID, unitDefID, spGetGameFrame()) @@ -191,19 +213,27 @@ function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts popElementInstance(repeatVBO, unitID, true) end end - if repeatVBO.dirty then uploadAllElements(repeatVBO) end + if repeatVBO.dirty then + uploadAllElements(repeatVBO) + end end function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1, 18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawScreenEffects() - if chobbyInterface then return end - if Spring.IsGUIHidden() then return end - if repeatVBO.usedElements == 0 then return end + if chobbyInterface then + return + end + if Spring.IsGUIHidden() then + return + end + if repeatVBO.usedElements == 0 then + return + end local disticon = Spring.GetConfigInt("UnitIconDistance", 200) * 27.5 diff --git a/luaui/Widgets/gui_unit_stats.lua b/luaui/Widgets/gui_unit_stats.lua index eab6c13943f..1dcc5f512c5 100644 --- a/luaui/Widgets/gui_unit_stats.lua +++ b/luaui/Widgets/gui_unit_stats.lua @@ -1,20 +1,18 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Unit Stats", - desc = "Shows detailed unit stats", - author = "Niobium + Doo", - date = "Jan 11, 2009", - version = 1.7, - license = "GNU GPL, v2 or later", - layer = -999990, - enabled = true, + name = "Unit Stats", + desc = "Shows detailed unit stats", + author = "Niobium + Doo", + date = "Jan 11, 2009", + version = 1.7, + license = "GNU GPL, v2 or later", + layer = -999990, + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -33,9 +31,9 @@ local gameName = Game.gameName if damageStats and damageStats[gameName] and damageStats[gameName].team then local rate = 0 - for k, v in pairs (damageStats[gameName].team) do + for k, v in pairs(damageStats[gameName].team) do if k ~= "games" and v.cost and v.killed_cost then - local compRate = v.killed_cost/v.cost + local compRate = v.killed_cost / v.cost if compRate > rate then highestUnitDef = k rate = compRate @@ -43,9 +41,9 @@ if damageStats and damageStats[gameName] and damageStats[gameName].team then end end local scndRate = 0 - for k, v in pairs (damageStats[gameName].team) do + for k, v in pairs(damageStats[gameName].team) do if k ~= "games" and v.cost and v.killed_cost then - local compRate = v.killed_cost/v.cost + local compRate = v.killed_cost / v.cost if compRate > scndRate and k ~= highestUnitDef then scndhighestUnitDef = k scndRate = compRate @@ -54,9 +52,9 @@ if damageStats and damageStats[gameName] and damageStats[gameName].team then end local thirdRate = 0 --local thirdhighestUnitDef - for k, v in pairs (damageStats[gameName].team) do + for k, v in pairs(damageStats[gameName].team) do if k ~= "games" and v.cost and v.killed_cost then - local compRate = v.killed_cost/v.cost + local compRate = v.killed_cost / v.cost if compRate > thirdRate and k ~= highestUnitDef and k ~= scndhighestUnitDef then --thirdhighestUnitDef = k thirdRate = compRate @@ -113,24 +111,24 @@ local cY local vsx, vsy = gl.GetViewSizes() local widgetScale = 1 -local xOffset = (32 + (fontSize*0.9))*widgetScale -local yOffset = -((32 - (fontSize*0.9))*widgetScale) -local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale",1) or 1) +local xOffset = (32 + (fontSize * 0.9)) * widgetScale +local yOffset = -((32 - (fontSize * 0.9)) * widgetScale) +local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale", 1) or 1) ------------------------------------------------------------------------------------ -- Speedups ------------------------------------------------------------------------------------ -local white = '\255\255\255\255' -local grey = '\255\190\190\190' -local green = '\255\1\255\1' -local yellow = '\255\255\255\1' -local orange = '\255\255\128\1' -local blue = '\255\128\128\255' +local white = "\255\255\255\255" +local grey = "\255\190\190\190" +local green = "\255\1\255\1" +local yellow = "\255\255\255\1" +local orange = "\255\255\128\1" +local blue = "\255\128\128\255" -local metalColor = '\255\196\196\255' -- Light blue -local energyColor = '\255\255\255\128' -- Light yellow -local buildColor = '\255\128\255\128' -- Light green +local metalColor = "\255\196\196\255" -- Light blue +local energyColor = "\255\255\255\128" -- Light yellow +local buildColor = "\255\128\255\128" -- Light green local simSpeed = Game.gameSpeed local armorTypes = Game.armorTypes @@ -189,14 +187,14 @@ local COMPUTE_INTERVAL = 6 -- Render-to-texture caching local panelTex = nil local panelTexW, panelTexH = 0, 0 -local panelOffsets = {0, 0, 0, 0} -- left, bottom, right, top offsets from screenX/screenY +local panelOffsets = { 0, 0, 0, 0 } -- left, bottom, right, top offsets from screenX/screenY local PANEL_REF_X, PANEL_REF_Y = 1000, 2000 local cachedGuishaderX, cachedGuishaderY = nil, nil local spec = spGetSpectatingState() local anonymousMode = Spring.GetModOptions().teamcolors_anonymous_mode -local anonymousName = '?????' +local anonymousName = "?????" local showStats = false @@ -220,24 +218,28 @@ end -- Functions ------------------------------------------------------------------------------------ -local function descending(a, b) return a > b end -- table.sort function +local function descending(a, b) + return a > b +end -- table.sort function local function DrawText(t1, t2) textBufferCount = textBufferCount + 1 - textBuffer[textBufferCount] = {t1, t2, bgpadding * 8, cY} + textBuffer[textBufferCount] = { t1, t2, bgpadding * 8, cY } cY = cY - fontSize - maxWidth = max(maxWidth, (font:GetTextWidth(t1)*fontSize) + (bgpadding*10), (font:GetTextWidth(t2)*fontSize)+(fontSize*6.5) + (bgpadding*10)) + maxWidth = max(maxWidth, (font:GetTextWidth(t1) * fontSize) + (bgpadding * 10), (font:GetTextWidth(t2) * fontSize) + (fontSize * 6.5) + (bgpadding * 10)) end local function buildTextDlist() - if textDlist then gl.DeleteList(textDlist) end + if textDlist then + gl.DeleteList(textDlist) + end textDlist = gl.CreateList(function() font:Begin() font:SetTextColor(1, 1, 1, 1) font:SetOutlineColor(0, 0, 0, 1) for i = 1, textBufferCount do font:Print(textBuffer[i][1], textBuffer[i][3], textBuffer[i][4], fontSize, "o") - font:Print(textBuffer[i][2], textBuffer[i][3] + (fontSize*6.5), textBuffer[i][4], fontSize, "o") + font:Print(textBuffer[i][2], textBuffer[i][3] + (fontSize * 6.5), textBuffer[i][4], fontSize, "o") end font:End() end) @@ -268,7 +270,9 @@ local function renderPanelToTexture(uDefID, uID) local w = panelRight - panelLeft local h = panelTop - panelBottom - if w < 1 or h < 1 then return end + if w < 1 or h < 1 then + return + end -- Store offsets from screenX/screenY to panel edges panelOffsets[1] = panelLeft - refX @@ -290,7 +294,9 @@ local function renderPanelToTexture(uDefID, uID) panelTexW = w panelTexH = h end - if not panelTex then return end + if not panelTex then + return + end -- Override FlowUI screen size so UiElement edge detection treats all edges as interior local savedFlowVsx = WG.FlowUI.vsx @@ -300,27 +306,20 @@ local function renderPanelToTexture(uDefID, uID) gl.R2tHelper.RenderInRect(panelTex, panelLeft, panelBottom, panelRight, panelTop, function() -- Title background - UiElement(tLeft, tBottom, tRight, tTop, 1,1,1,0, 1,1,0,1, uiOpacity) + UiElement(tLeft, tBottom, tRight, tTop, 1, 1, 1, 0, 1, 1, 0, 1, uiOpacity) -- Stats background - UiElement(sLeft, sBottom, sRight, sTop, 0,1,1,1, 1,1,1,1, uiOpacity) + UiElement(sLeft, sBottom, sRight, sTop, 0, 1, 1, 1, 1, 1, 1, 1, uiOpacity) -- Icon if uID then local iconPadding = mathMax(1, mathFloor(bgpadding * 0.8)) - glColor(1,1,1,1) - UiUnit( - tLeft + bgpadding + iconPadding, tBottom + iconPadding, tLeft + (tTop - tBottom) - iconPadding, tTop - bgpadding - iconPadding, - nil, - 1,1,1,1, - 0.13, - nil, nil, - '#' .. uDefID - ) + glColor(1, 1, 1, 1) + UiUnit(tLeft + bgpadding + iconPadding, tBottom + iconPadding, tLeft + (tTop - tBottom) - iconPadding, tTop - bgpadding - iconPadding, nil, 1, 1, 1, 1, 0.13, nil, nil, "#" .. uDefID) end -- Title text - glColor(1,1,1,1) + glColor(1, 1, 1, 1) font:Begin() font:Print(cachedTitleText, tLeft + ((tTop - tBottom) * 1.3), tBottom + titleFontSize * 0.7, titleFontSize, "o") font:End() @@ -341,36 +340,44 @@ local function renderPanelToTexture(uDefID, uID) end local function GetTeamColorCode(teamID) - if not teamID then return "\255\255\255\255" end + if not teamID then + return "\255\255\255\255" + end local R, G, B = spGetTeamColor(teamID) - if not R then return "\255\255\255\255" end + if not R then + return "\255\255\255\255" + end return Spring.Utilities.ConvertColor(R, G, B) end local function GetTeamName(teamID) - if not teamID then return 'Error:NoTeamID' end + if not teamID then + return "Error:NoTeamID" + end - local _, teamLeader = spGetTeamInfo(teamID,false) - if not teamLeader then return 'Error:NoLeader' end + local _, teamLeader = spGetTeamInfo(teamID, false) + if not teamLeader then + return "Error:NoLeader" + end - local leaderName = spGetPlayerInfo(teamLeader,false) + local leaderName = spGetPlayerInfo(teamLeader, false) leaderName = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(teamLeader)) or leaderName - if Spring.GetGameRulesParam('ainame_'..teamID) then - leaderName = Spring.GetGameRulesParam('ainame_'..teamID) - end + if Spring.GetGameRulesParam("ainame_" .. teamID) then + leaderName = Spring.GetGameRulesParam("ainame_" .. teamID) + end - if not spec and anonymousMode ~= 'disabled' then + if not spec and anonymousMode ~= "disabled" then return anonymousName end - return leaderName or 'Error:NoName' + return leaderName or "Error:NoName" end -local guishaderEnabled = false -- not a config var +local guishaderEnabled = false -- not a config var function RemoveGuishader() - if guishaderEnabled and WG['guishader'] then - WG['guishader'].DeleteScreenDlist('unit_stats_title') - WG['guishader'].DeleteScreenDlist('unit_stats_data') + if guishaderEnabled and WG["guishader"] then + WG["guishader"].DeleteScreenDlist("unit_stats_title") + WG["guishader"].DeleteScreenDlist("unit_stats_data") guishaderEnabled = false end if dlistGuishaderTitle then @@ -411,15 +418,15 @@ local function disableStats() end function widget:Initialize() - texts = Spring.I18N('ui.unitstats') + texts = Spring.I18N("ui.unitstats") - widget:ViewResize(vsx,vsy) + widget:ViewResize(vsx, vsy) - WG['unitstats'] = {} - WG['unitstats'].showUnit = function(unitID) + WG["unitstats"] = {} + WG["unitstats"].showUnit = function(unitID) showUnitID = unitID end - WG['unitstats'].isShowing = function() + WG["unitstats"].isShowing = function() return showStats end @@ -430,7 +437,7 @@ function widget:Initialize() end function widget:Shutdown() - WG['unitstats'] = nil + WG["unitstats"] = nil RemoveGuishader() invalidateContent() end @@ -441,16 +448,16 @@ end function init() vsx, vsy = gl.GetViewSizes() - widgetScale = (1+((vsy-850)/900)) * (0.95+(ui_scale-1)/2.5) + widgetScale = (1 + ((vsy - 850) / 900)) * (0.95 + (ui_scale - 1) / 2.5) fontSize = customFontSize * widgetScale - xOffset = (32 + bgpadding)*widgetScale - yOffset = -((32 + bgpadding)*widgetScale) + xOffset = (32 + bgpadding) * widgetScale + yOffset = -((32 + bgpadding) * widgetScale) end -function widget:ViewResize(n_vsx,n_vsy) - vsx,vsy = Spring.GetViewGeometry() - widgetScale = (1+((vsy-850)/1800)) * (0.95+(ui_scale-1)/2.5) +function widget:ViewResize(n_vsx, n_vsy) + vsx, vsy = Spring.GetViewGeometry() + widgetScale = (1 + ((vsy - 850) / 1800)) * (0.95 + (ui_scale - 1) / 2.5) bgpadding = WG.FlowUI.elementPadding elementCorner = WG.FlowUI.elementCorner @@ -459,7 +466,7 @@ function widget:ViewResize(n_vsx,n_vsy) UiElement = WG.FlowUI.Draw.Element UiUnit = WG.FlowUI.Draw.Unit - font = WG['fonts'].getFont() + font = WG["fonts"].getFont() init() invalidateContent() @@ -474,7 +481,6 @@ if useSelection then end end - local function computeContent(uDefID, uID, shiftBool) local shift = shiftBool @@ -500,26 +506,26 @@ local function computeContent(uDefID, uID, shiftBool) if uID then isBuilding, buildProg = Spring.GetUnitIsBeingBuilt(uID) - maxHP = select(2,Spring.GetUnitHealth(uID)) + maxHP = select(2, Spring.GetUnitHealth(uID)) uTeam = spGetUnitTeam(uID) - losRadius = spGetUnitSensorRadius(uID, 'los') or 0 - airLosRadius = spGetUnitSensorRadius(uID, 'airLos') or 0 - radarRadius = spGetUnitSensorRadius(uID, 'radar') or 0 - sonarRadius = spGetUnitSensorRadius(uID, 'sonar') or 0 - jammingRadius = spGetUnitSensorRadius(uID, 'radarJammer') or 0 - sonarJammingRadius = spGetUnitSensorRadius(uID, 'sonarJammer') or 0 - seismicRadius = spGetUnitSensorRadius(uID, 'seismic') or 0 + losRadius = spGetUnitSensorRadius(uID, "los") or 0 + airLosRadius = spGetUnitSensorRadius(uID, "airLos") or 0 + radarRadius = spGetUnitSensorRadius(uID, "radar") or 0 + sonarRadius = spGetUnitSensorRadius(uID, "sonar") or 0 + jammingRadius = spGetUnitSensorRadius(uID, "radarJammer") or 0 + sonarJammingRadius = spGetUnitSensorRadius(uID, "sonarJammer") or 0 + seismicRadius = spGetUnitSensorRadius(uID, "seismic") or 0 uExp = spGetUnitExperience(uID) - armoredMultiple = select(2,Spring.GetUnitArmored(uID)) + armoredMultiple = select(2, Spring.GetUnitArmored(uID)) end maxWidth = 0 cY = 0 - cY = cY - (bgpadding/2) + cY = cY - (bgpadding / 2) - local titleFontSize = fontSize*1.07 + local titleFontSize = fontSize * 1.07 cY = cY - 2 * titleFontSize textBuffer = {} textBufferCount = 0 @@ -528,10 +534,9 @@ local function computeContent(uDefID, uID, shiftBool) -- Units under construction ------------------------------------------------------------------------------------ if isBuilding then - local myTeamID = spGetMyTeamID() - local mCur, mStor, mPull, mInc, mExp, mShare, mSent, mRec = spGetTeamResources(myTeamID, 'metal') - local eCur, eStor, ePull, eInc, eExp, eShare, eSent, eRec = spGetTeamResources(myTeamID, 'energy') + local mCur, mStor, mPull, mInc, mExp, mShare, mSent, mRec = spGetTeamResources(myTeamID, "metal") + local eCur, eStor, ePull, eInc, eExp, eShare, eSent, eRec = spGetTeamResources(myTeamID, "energy") local mTotal = uDef.metalCost local eTotal = uDef.energyCost @@ -543,21 +548,21 @@ local function computeContent(uDefID, uID, shiftBool) local mEta = mIncome > 0 and (mRem - mCur) / mIncome or 0 local eEta = eIncome > 0 and (eRem - eCur) / eIncome or 0 - DrawText(texts.prog..":", format("%d%%", 100 * buildProg)) + DrawText(texts.prog .. ":", format("%d%%", 100 * buildProg)) if mEta >= 0 then - DrawText(texts.metal..":", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", mTotal * buildProg, mTotal, mRem, mEta)) + DrawText(texts.metal .. ":", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", mTotal * buildProg, mTotal, mRem, mEta)) else - DrawText(texts.metal..":", format("%d / %d (" .. yellow .. "%d" .. white .. ")", mTotal * buildProg, mTotal, mRem)) + DrawText(texts.metal .. ":", format("%d / %d (" .. yellow .. "%d" .. white .. ")", mTotal * buildProg, mTotal, mRem)) end if eEta >= 0 then - DrawText(texts.energy..":", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", eTotal * buildProg, eTotal, eRem, eEta)) + DrawText(texts.energy .. ":", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", eTotal * buildProg, eTotal, eRem, eEta)) else - DrawText(texts.energy..":", format("%d / %d (" .. yellow .. "%d" .. white .. ")", eTotal * buildProg, eTotal, eRem)) + DrawText(texts.energy .. ":", format("%d / %d (" .. yellow .. "%d" .. white .. ")", eTotal * buildProg, eTotal, eRem)) end - --DrawText("MaxBP:", format(white .. '%d', buildRem * uDef.buildTime / mathMax(mEta, eEta))) + --DrawText("MaxBP:", format(white .. '%d', buildRem * uDef.buildTime / mathMax(mEta, eEta))) cY = cY - fontSize end @@ -567,25 +572,22 @@ local function computeContent(uDefID, uID, shiftBool) --DrawText('Height:', uDefs[spGetUnitDefID(uID)].height) - DrawText(texts.cost..":", format(metalColor .. '%d' .. white .. ' / ' .. - energyColor .. '%d' .. white .. ' / ' .. - buildColor .. '%d', uDef.metalCost, uDef.energyCost, uDef.buildTime) - ) + DrawText(texts.cost .. ":", format(metalColor .. "%d" .. white .. " / " .. energyColor .. "%d" .. white .. " / " .. buildColor .. "%d", uDef.metalCost, uDef.energyCost, uDef.buildTime)) if not (uDef.isBuilding or uDef.isFactory) then if not uID or not Spring.GetUnitMoveTypeData(uID) then - DrawText(texts.move..":", format("%.1f / %.1f / %.0f ("..texts.speedaccelturn..")", uDef.speed, 900 * uDef.maxAcc, simSpeed * uDef.turnRate * (180 / 32767))) + DrawText(texts.move .. ":", format("%.1f / %.1f / %.0f (" .. texts.speedaccelturn .. ")", uDef.speed, 900 * uDef.maxAcc, simSpeed * uDef.turnRate * (180 / 32767))) else local mData = Spring.GetUnitMoveTypeData(uID) local mSpeed = mData.maxSpeed or uDef.speed local mAccel = mData.accRate or uDef.maxAcc local mTurnRate = mData.baseTurnRate or uDef.turnRate - DrawText(texts.move..":", format("%.1f / %.1f / %.0f ("..texts.speedaccelturn..")", mSpeed, 900 * mAccel, simSpeed * mTurnRate * (180 / 32767))) + DrawText(texts.move .. ":", format("%.1f / %.1f / %.0f (" .. texts.speedaccelturn .. ")", mSpeed, 900 * mAccel, simSpeed * mTurnRate * (180 / 32767))) end end if uDef.buildSpeed > 0 then - DrawText(texts.build..':', yellow .. uDef.buildSpeed) + DrawText(texts.build .. ":", yellow .. uDef.buildSpeed) end cY = cY - fontSize @@ -594,15 +596,27 @@ local function computeContent(uDefID, uID, shiftBool) -- Sensors and Jamming ------------------------------------------------------------------------------------ - DrawText(texts.los..':', losRadius .. (airLosRadius > losRadius and format(' ('..texts.airlos..': %d)', airLosRadius) or '')) + DrawText(texts.los .. ":", losRadius .. (airLosRadius > losRadius and format(" (" .. texts.airlos .. ": %d)", airLosRadius) or "")) - if radarRadius > 0 then DrawText(texts.radar..':', '\255\77\255\77' .. radarRadius) end - if sonarRadius > 0 then DrawText(texts.sonar..':', '\255\128\128\255' .. sonarRadius) end - if jammingRadius > 0 then DrawText(texts.jammer..':' , '\255\255\77\77' .. jammingRadius) end - if sonarJammingRadius > 0 then DrawText(texts.sonarjam..':', '\255\255\77\77' .. sonarJammingRadius) end - if seismicRadius > 0 then DrawText(texts.seis..':' , '\255\255\26\255' .. seismicRadius) end + if radarRadius > 0 then + DrawText(texts.radar .. ":", "\255\77\255\77" .. radarRadius) + end + if sonarRadius > 0 then + DrawText(texts.sonar .. ":", "\255\128\128\255" .. sonarRadius) + end + if jammingRadius > 0 then + DrawText(texts.jammer .. ":", "\255\255\77\77" .. jammingRadius) + end + if sonarJammingRadius > 0 then + DrawText(texts.sonarjam .. ":", "\255\255\77\77" .. sonarJammingRadius) + end + if seismicRadius > 0 then + DrawText(texts.seis .. ":", "\255\255\26\255" .. seismicRadius) + end - if uDef.stealth then DrawText(texts.other1..":", texts.stealth) end + if uDef.stealth then + DrawText(texts.other1 .. ":", texts.stealth) + end cY = cY - fontSize @@ -610,53 +624,48 @@ local function computeContent(uDefID, uID, shiftBool) -- Armor ------------------------------------------------------------------------------------ - DrawText(texts.armor..":", texts.class .. armorTypes[uDef.armorType or 0] or '???') + DrawText(texts.armor .. ":", texts.class .. armorTypes[uDef.armorType or 0] or "???") if uID and uExp ~= 0 then if maxHP then - DrawText(texts.exp..":", format("+%d%% "..texts.health, (maxHP/uDef.health-1)*100)) + DrawText(texts.exp .. ":", format("+%d%% " .. texts.health, (maxHP / uDef.health - 1) * 100)) else --DrawText("Exp: unknown",'\255\255\77\77') end end if paralyzeMult < 1 then if paralyzeMult == 0 then - DrawText(texts.emp..':', blue .. texts.immune) + DrawText(texts.emp .. ":", blue .. texts.immune) else local resist = 100 - (paralyzeMult * 100) - DrawText(texts.emp..':', blue .. mathFloor(resist) .. "% " .. white .. texts.resist) + DrawText(texts.emp .. ":", blue .. mathFloor(resist) .. "% " .. white .. texts.resist) end end if maxHP then - DrawText(texts.open..":", format("%s: %d", texts.maxhp, maxHP)) + DrawText(texts.open .. ":", format("%s: %d", texts.maxhp, maxHP)) if armoredMultiple and armoredMultiple ~= 1 then local message = format("%s: %d (+%d%%)", texts.maxhp, maxHP / armoredMultiple, 100 * (1 / armoredMultiple - 1)) if uDef.customParams.reactive_armor_health then - message = message .. (", %d to break, %d%s to restore"):format( - uDef.customParams.reactive_armor_health / armoredMultiple, - uDef.customParams.reactive_armor_restore, - texts.s - ) + message = message .. (", %d to break, %d%s to restore"):format(uDef.customParams.reactive_armor_health / armoredMultiple, uDef.customParams.reactive_armor_restore, texts.s) end - DrawText(texts.closed..":", message) + DrawText(texts.closed .. ":", message) end end cY = cY - fontSize - ------------------------------------------------------------------------------------ -- Transportable ------------------------------------------------------------------------------------ - if transportable and mass > 0 and size > 0 then - if mass < 751 and size < 4 then -- 3 is t1 transport max size - DrawText(texts.transportable..':', blue .. texts.transportable_light) - elseif mass < 100000 and size < 5 then - DrawText(texts.transportable..':', yellow .. texts.transportable_heavy) - end + if transportable and mass > 0 and size > 0 then + if mass < 751 and size < 4 then -- 3 is t1 transport max size + DrawText(texts.transportable .. ":", blue .. texts.transportable_light) + elseif mass < 100000 and size < 5 then + DrawText(texts.transportable .. ":", yellow .. texts.transportable_heavy) end + end cY = cY - fontSize @@ -664,25 +673,25 @@ local function computeContent(uDefID, uID, shiftBool) -- SPECIAL ABILITIES ------------------------------------------------------------------------------------ ---- Build Related - local specabs = '' - specabs = specabs..((uDef.canBuild and texts.build..", ") or "") - specabs = specabs..((uDef.canAssist and texts.assist..", ") or "") - specabs = specabs..((uDef.canRepair and texts.repair..", ") or "") - specabs = specabs..((uDef.canReclaim and texts.reclaim..", ") or "") - specabs = specabs..((uDef.canResurrect and texts.resurrect..", ") or "") - specabs = specabs..((uDef.canCapture and texts.capture..", ") or "") + local specabs = "" + specabs = specabs .. ((uDef.canBuild and texts.build .. ", ") or "") + specabs = specabs .. ((uDef.canAssist and texts.assist .. ", ") or "") + specabs = specabs .. ((uDef.canRepair and texts.repair .. ", ") or "") + specabs = specabs .. ((uDef.canReclaim and texts.reclaim .. ", ") or "") + specabs = specabs .. ((uDef.canResurrect and texts.resurrect .. ", ") or "") + specabs = specabs .. ((uDef.canCapture and texts.capture .. ", ") or "") ---- Radar/Sonar states - specabs = specabs..((uDef.canCloak and texts.cloak..", ") or "") - specabs = specabs..((uDef.stealth and texts.stealth..", ") or "") + specabs = specabs .. ((uDef.canCloak and texts.cloak .. ", ") or "") + specabs = specabs .. ((uDef.stealth and texts.stealth .. ", ") or "") ---- Attack Related - specabs = specabs..((uDef.canAttackWater and texts.waterweapon..", ") or "") - specabs = specabs..((uDef.canManualFire and texts.manuelfire..", ") or "") - specabs = specabs..((uDef.canStockpile and texts.stockpile..", ") or "") - specabs = specabs..((uDef.canParalyze and texts.paralyzer..", ") or "") - specabs = specabs..((uDef.canKamikaze and texts.kamikaze..", ") or "") - if (string.len(specabs) > 11) then - DrawText(texts.abilities..":", string.sub(specabs, 1, string.len(specabs)-2)) + specabs = specabs .. ((uDef.canAttackWater and texts.waterweapon .. ", ") or "") + specabs = specabs .. ((uDef.canManualFire and texts.manuelfire .. ", ") or "") + specabs = specabs .. ((uDef.canStockpile and texts.stockpile .. ", ") or "") + specabs = specabs .. ((uDef.canParalyze and texts.paralyzer .. ", ") or "") + specabs = specabs .. ((uDef.canKamikaze and texts.kamikaze .. ", ") or "") + if string.len(specabs) > 11 then + DrawText(texts.abilities .. ":", string.sub(specabs, 1, string.len(specabs) - 2)) cY = cY - fontSize end @@ -706,7 +715,9 @@ local function computeContent(uDefID, uID, shiftBool) end end end - tableSortStable(wepsCompact, function(a, b) return weaponGroupNumbers[a] < weaponGroupNumbers[b] end) + tableSortStable(wepsCompact, function(a, b) + return weaponGroupNumbers[a] < weaponGroupNumbers[b] + end) local selfDWeaponID = WeaponDefNames[uDef.selfDExplosion].id local deathWeaponID = WeaponDefNames[uDef.deathExplosion].id @@ -718,9 +729,9 @@ local function computeContent(uDefID, uID, shiftBool) wepsCompact = {} wepCounts[selfDWeaponID] = 1 wepCounts[deathWeaponID] = 1 - deathWeaponIndex = #wepsCompact+1 + deathWeaponIndex = #wepsCompact + 1 wepsCompact[deathWeaponIndex] = deathWeaponID - selfDWeaponIndex = #wepsCompact+1 + selfDWeaponIndex = #wepsCompact + 1 wepsCompact[selfDWeaponIndex] = selfDWeaponID end @@ -729,7 +740,6 @@ local function computeContent(uDefID, uID, shiftBool) local totalbDamages = 0 local useExp = true for i = 1, #wepsCompact do - local wDefId = wepsCompact[i] local uWep = wDefs[wDefId] @@ -755,24 +765,21 @@ local function computeContent(uDefID, uID, shiftBool) local spForkDamage = tonumber(custom.spark_forkdamage) or 0 local spCount = tonumber(custom.spark_maxunits) or 0 baseArmorDamage = baseArmorDamage + spDamage * spForkDamage * spCount - elseif custom.speceffect == "split" then burst = burst * (custom.number or 1) uWep = WeaponDefNames[custom.speceffect_def] or uWep baseArmorDamage = damages[defaultArmorIndex] - elseif custom.cluster then - local munition = uDef.name .. '_' .. custom.cluster_def + local munition = uDef.name .. "_" .. custom.cluster_def local cmNumber = custom.cluster_number local cmDamage = WeaponDefNames[munition].damages[defaultArmorIndex] baseArmorDamage = baseArmorDamage + cmDamage * cmNumber end if range > 0 and uWep.customParams.bogus ~= "1" then - local oRld = max(0.00000000001, uWep.stockpile == true and uWep.stockpileTime/30 or uWep.reload) - if uID and useExp and not ((uWep.stockpile and uWep.stockpileTime)) then - oRld = spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTimeXP") or - spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTime") or oRld + local oRld = max(0.00000000001, uWep.stockpile == true and uWep.stockpileTime / 30 or uWep.reload) + if uID and useExp and not (uWep.stockpile and uWep.stockpileTime) then + oRld = spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTimeXP") or spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTime") or oRld end local wpnName = uWep.description @@ -785,61 +792,61 @@ local function computeContent(uDefID, uID, shiftBool) oRld = uDef.selfDestructCountdown end if wepCount > 1 then - DrawText(texts.weap..":", format(yellow .. "%dx" .. white .. " %s", wepCount, wpnName)) + DrawText(texts.weap .. ":", format(yellow .. "%dx" .. white .. " %s", wepCount, wpnName)) else - DrawText(texts.weap..":", wpnName) + DrawText(texts.weap .. ":", wpnName) end if uExp ~= 0 then - local rangeBonus = range ~= 0 and (range/uWep.range-1) or 0 - local reloadBonus = reload ~= 0 and (uWep.reload/reload-1) or 0 - local accuracyBonus = accuracy ~= 0 and (uWep.accuracy/accuracy-1) or 0 - local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError/moveError-1) or 0 - DrawText(texts.exp..":", format("+%d%% "..texts.accuracy..", +%d%% "..texts.aim..", +%d%% "..texts.firerate..", +%d%% "..texts.range, accuracyBonus*100, moveErrorBonus*100, reloadBonus*100, rangeBonus*100 )) + local rangeBonus = range ~= 0 and (range / uWep.range - 1) or 0 + local reloadBonus = reload ~= 0 and (uWep.reload / reload - 1) or 0 + local accuracyBonus = accuracy ~= 0 and (uWep.accuracy / accuracy - 1) or 0 + local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError / moveError - 1) or 0 + DrawText(texts.exp .. ":", format("+%d%% " .. texts.accuracy .. ", +%d%% " .. texts.aim .. ", +%d%% " .. texts.firerate .. ", +%d%% " .. texts.range, accuracyBonus * 100, moveErrorBonus * 100, reloadBonus * 100, rangeBonus * 100)) end local infoText = "" if string.find(uWep.name, "disintegrator") then - infoText = format("%.2f", (useExp and reload or uWep.reload)).."s "..texts.reload..", "..format("%d "..texts.range, useExp and range or uWep.range) + infoText = format("%.2f", (useExp and reload or uWep.reload)) .. "s " .. texts.reload .. ", " .. format("%d " .. texts.range, useExp and range or uWep.range) elseif uWep.interceptor ~= 0 and uWep.coverageRange > 0 then local stockpile, coverage = uWep.stockpileTime / simSpeed, uWep.coverageRange infoText = format("%.2f%s %s (%d%s %s), %d %s", useExp and reload or uWep.reload, texts.s, texts.reload, stockpile, texts.s, texts.stockpile:lower(), coverage, texts.coverage) else if wpnName == texts.deathexplosion or wpnName == texts.selfdestruct then - infoText = format("%d "..texts.aoe..", %d%% "..texts.edge, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) + infoText = format("%d " .. texts.aoe .. ", %d%% " .. texts.edge, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) else - infoText = format("%.2f", (useExp and reload or uWep.reload))..texts.s.." "..texts.reload..", "..format("%d "..texts.range..", %d "..texts.aoe..", %d%% "..texts.edge, useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) + infoText = format("%.2f", (useExp and reload or uWep.reload)) .. texts.s .. " " .. texts.reload .. ", " .. format("%d " .. texts.range .. ", %d " .. texts.aoe .. ", %d%% " .. texts.edge, useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) end if damages.paralyzeDamageTime > 0 then - infoText = format("%s, %ds "..texts.paralyze, infoText, damages.paralyzeDamageTime) + infoText = format("%s, %ds " .. texts.paralyze, infoText, damages.paralyzeDamageTime) end if damages.impulseFactor > 0.123 then - infoText = format("%s, %d "..texts.impulse, infoText, damages.impulseFactor*100) + infoText = format("%s, %d " .. texts.impulse, infoText, damages.impulseFactor * 100) end if damages.craterBoost > 0 then - infoText = format("%s, %d "..texts.crater, infoText, damages.craterBoost*100) + infoText = format("%s, %d " .. texts.crater, infoText, damages.craterBoost * 100) end end - DrawText(texts.info..":", infoText) + DrawText(texts.info .. ":", infoText) -- Draw the damage and damage modifiers strings. if string.find(uWep.name, "disintegrator") then - DrawText(texts.dmg..": ", texts.infinite) + DrawText(texts.dmg .. ": ", texts.infinite) elseif uWep.interceptor ~= 0 then - DrawText(texts.dmg..": ", texts.burst.." = "..yellow..format("%d", defaultArmorDamage * burst)) + DrawText(texts.dmg .. ": ", texts.burst .. " = " .. yellow .. format("%d", defaultArmorDamage * burst)) local interceptor = uWep.interceptor local intercepts = {} for mask, targetType in pairs(targetableTypes) do if bit_and(interceptor, mask) ~= 0 then - intercepts[#intercepts+1] = targetType + intercepts[#intercepts + 1] = targetType end end - DrawText(texts.intercepts..":", table.concat(intercepts, "; ")..white..".") + DrawText(texts.intercepts .. ":", table.concat(intercepts, "; ") .. white .. ".") elseif baseArmorDamage > 0 then local damageString = "" local burstDamage = baseArmorDamage * burst if wpnName == texts.deathexplosion or wpnName == texts.selfdestruct then - damageString = texts.burst.." = "..(format(yellow .. "%d", burstDamage))..white.."." + damageString = texts.burst .. " = " .. (format(yellow .. "%d", burstDamage)) .. white .. "." else local dps = burstDamage / (useExp and reload or uWep.reload) if custom.area_onhit_damage and custom.area_onhit_time then @@ -847,11 +854,11 @@ local function computeContent(uDefID, uID, shiftBool) local duration = custom.area_onhit_time dps = max(dps + areaDps, areaDps * duration / (useExp and reload or uWep.reload)) end - totaldps = totaldps + wepCount*dps - totalbDamages = totalbDamages + wepCount* burstDamage - damageString = texts.dps.." = "..(format(yellow .. "%d", dps))..white.."; "..texts.burst.." = "..(format(yellow .. "%d", burstDamage)) .. white .. (wepCount > 1 and (" ("..texts.each..").") or (".")) + totaldps = totaldps + wepCount * dps + totalbDamages = totalbDamages + wepCount * burstDamage + damageString = texts.dps .. " = " .. (format(yellow .. "%d", dps)) .. white .. "; " .. texts.burst .. " = " .. (format(yellow .. "%d", burstDamage)) .. white .. (wepCount > 1 and (" (" .. texts.each .. ").") or ".") end - DrawText(texts.dmg..":", damageString) + DrawText(texts.dmg .. ":", damageString) local modifiers = { [defaultArmorDamage] = { armorTypes[defaultArmorIndex] } } -- [damage] = { armorClass1, armorClass2, ... } @@ -882,21 +889,13 @@ local function computeContent(uDefID, uID, shiftBool) for _, armorDamage in ipairs(sorted) do tableInsert(modifierText, ("%s = %s%d%%"):format(table.concat(modifiers[armorDamage], ", "), yellow, floor(100 * armorDamage / baseArmorDamage))) end - DrawText(texts.modifiers..":", table.concat(modifierText, white.."; ") .. white .. ".") + DrawText(texts.modifiers .. ":", table.concat(modifierText, white .. "; ") .. white .. ".") end if uWep.metalCost > 0 or uWep.energyCost > 0 then - DrawText(texts.cost..':', format(metalColor .. '%d' .. white .. ', ' .. - energyColor .. '%d' .. white .. ' = ' .. - metalColor .. '-%d' .. white .. ', ' .. - energyColor .. '-%d' .. white .. ' '..texts.persecond, - uWep.metalCost, - uWep.energyCost, - uWep.metalCost / oRld, - uWep.energyCost / oRld)) + DrawText(texts.cost .. ":", format(metalColor .. "%d" .. white .. ", " .. energyColor .. "%d" .. white .. " = " .. metalColor .. "-%d" .. white .. ", " .. energyColor .. "-%d" .. white .. " " .. texts.persecond, uWep.metalCost, uWep.energyCost, uWep.metalCost / oRld, uWep.energyCost / oRld)) end - cY = cY - fontSize local wDefIdNext = wepsCompact[i + 1] @@ -905,7 +904,7 @@ local function computeContent(uDefID, uID, shiftBool) if groupLast ~= groupNext and not (groupLast == 0 and groupNext == 1) then groupLast = groupNext if totaldps > 0 then - DrawText(texts.totaldmg..':', texts.dps.." = "..(format(yellow .. "%d", totaldps))..white..'; '..texts.burst.." = "..(format(yellow .. "%d", totalbDamages))..white..".") + DrawText(texts.totaldmg .. ":", texts.dps .. " = " .. (format(yellow .. "%d", totaldps)) .. white .. "; " .. texts.burst .. " = " .. (format(yellow .. "%d", totalbDamages)) .. white .. ".") end totaldps = 0 totalbDamages = 0 @@ -920,13 +919,13 @@ local function computeContent(uDefID, uID, shiftBool) cachedTitleFontSize = fontSize * 1.07 -- Compute title text - local effectivenessRate = '' + local effectivenessRate = "" if damageStats and damageStats[gameName] and damageStats[gameName]["team"] and damageStats[gameName]["team"][uDef.name] and damageStats[gameName]["team"][uDef.name].cost and damageStats[gameName]["team"][uDef.name].killed_cost then - effectivenessRate = " "..damageStats[gameName]["team"][uDef.name].killed_cost / damageStats[gameName]["team"][uDef.name].cost + effectivenessRate = " " .. damageStats[gameName]["team"][uDef.name].killed_cost / damageStats[gameName]["team"][uDef.name].cost end cachedTitleText = "\255\190\255\190" .. UnitDefs[uDefID].translatedHumanName if uID then - cachedTitleText = cachedTitleText .. " " .. grey .. uDef.name .. " #" .. uID .. " ".. GetTeamColorCode(uTeam) .. GetTeamName(uTeam) .. grey .. effectivenessRate + cachedTitleText = cachedTitleText .. " " .. grey .. uDef.name .. " #" .. uID .. " " .. GetTeamColorCode(uTeam) .. GetTeamName(uTeam) .. grey .. effectivenessRate end cachedTitleTextWidth = font:GetTextWidth(cachedTitleText) * cachedTitleFontSize @@ -949,8 +948,8 @@ end local function drawStats(uDefID, uID) local mx, my = spGetMouseState() local alt, ctrl, meta, shift = spGetModKeyState() - if WG['chat'] and WG['chat'].isInputActive then - if WG['chat'].isInputActive() then + if WG["chat"] and WG["chat"].isInputActive then + if WG["chat"].isInputActive() then showStats = false end end @@ -977,7 +976,9 @@ local function drawStats(uDefID, uID) computeContent(uDefID, uID, shiftBool) end - if not panelTex then return end + if not panelTex then + return + end -- === Rendering (every frame) === @@ -996,13 +997,10 @@ local function drawStats(uDefID, uID) end -- Blit cached panel texture - gl.R2tHelper.BlendTexRect(panelTex, - screenX + panelOffsets[1], screenY + panelOffsets[2], - screenX + panelOffsets[3], screenY + panelOffsets[4], - true) + gl.R2tHelper.BlendTexRect(panelTex, screenX + panelOffsets[1], screenY + panelOffsets[2], screenX + panelOffsets[3], screenY + panelOffsets[4], true) -- Update guishader only when position changed - if WG['guishader'] then + if WG["guishader"] then if cachedGuishaderX ~= screenX or cachedGuishaderY ~= screenY then guishaderEnabled = true cachedGuishaderX = screenX @@ -1014,33 +1012,37 @@ local function drawStats(uDefID, uID) local tRight = floor(screenX + cachedTitleTextWidth + (titleFontSize * 3.5)) local tTop = floor(screenY + (titleFontSize * 1.8) + bgpadding) - if dlistGuishaderTitle then gl.DeleteList(dlistGuishaderTitle) end + if dlistGuishaderTitle then + gl.DeleteList(dlistGuishaderTitle) + end dlistGuishaderTitle = gl.CreateList(function() - RectRound(tLeft, tBottom, tRight, tTop, elementCorner, 1,1,1,0) + RectRound(tLeft, tBottom, tRight, tTop, elementCorner, 1, 1, 1, 0) end) - WG['guishader'].InsertScreenDlist(dlistGuishaderTitle, 'unit_stats_title') + WG["guishader"].InsertScreenDlist(dlistGuishaderTitle, "unit_stats_title") local sLeft = floor(screenX - bgpadding) local sBottom = ceil(screenY + cachedContentBottom + (fontSize / 3) + (bgpadding * 0.3)) local sRight = ceil(screenX + cachedMaxWidth + bgpadding) local sTop = ceil(screenY - bgpadding) - if dlistGuishaderStats then gl.DeleteList(dlistGuishaderStats) end + if dlistGuishaderStats then + gl.DeleteList(dlistGuishaderStats) + end dlistGuishaderStats = gl.CreateList(function() - RectRound(sLeft, sBottom, sRight, sTop, elementCorner, 0,1,1,1) + RectRound(sLeft, sBottom, sRight, sTop, elementCorner, 0, 1, 1, 1) end) - WG['guishader'].InsertScreenDlist(dlistGuishaderStats, 'unit_stats_data') + WG["guishader"].InsertScreenDlist(dlistGuishaderStats, "unit_stats_data") end end end function widget:DrawScreen() - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then return end - if WG['chat'] and WG['chat'].isInputActive then - if WG['chat'].isInputActive() then + if WG["chat"] and WG["chat"].isInputActive then + if WG["chat"].isInputActive() then showStats = false end end @@ -1051,7 +1053,7 @@ function widget:DrawScreen() local mx, my = spGetMouseState() local uID local rType, unitID = spTraceScreenRay(mx, my) - if rType == 'unit' then + if rType == "unit" then uID = unitID end if useSelection then @@ -1065,10 +1067,13 @@ function widget:DrawScreen() end local useHoverID = false local _, activeID = Spring.GetActiveCommand() - if not activeID then activeID = 0 end - if not uID and (WG['buildmenu'] and not WG['buildmenu'].hoverID) and not (activeID < 0) then - RemoveGuishader() return - elseif WG['buildmenu'] and WG['buildmenu'].hoverID and not (activeID < 0) then + if not activeID then + activeID = 0 + end + if not uID and (WG["buildmenu"] and not WG["buildmenu"].hoverID) and not (activeID < 0) then + RemoveGuishader() + return + elseif WG["buildmenu"] and WG["buildmenu"].hoverID and not (activeID < 0) then uID = nil useHoverID = true elseif activeID < 0 then @@ -1079,7 +1084,7 @@ function widget:DrawScreen() RemoveGuishader() return end - local uDefID = (uID and spGetUnitDefID(uID)) or (useHoverID and WG['buildmenu'] and WG['buildmenu'].hoverID) or (UnitDefs[-activeID] and -activeID) + local uDefID = (uID and spGetUnitDefID(uID)) or (useHoverID and WG["buildmenu"] and WG["buildmenu"].hoverID) or (UnitDefs[-activeID] and -activeID) if not uDefID then RemoveGuishader() diff --git a/luaui/Widgets/gui_unit_wait_icons.lua b/luaui/Widgets/gui_unit_wait_icons.lua index da46febeee5..a9238153531 100644 --- a/luaui/Widgets/gui_unit_wait_icons.lua +++ b/luaui/Widgets/gui_unit_wait_icons.lua @@ -1,27 +1,27 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Unit Wait Icons", - desc = "Shows the wait/pause icon above units", - author = "Floris, Beherith, Robert82", - date = "May 2025", - license = "GNU GPL, v2 or later", - layer = -40, - enabled = true - } + return { + name = "Unit Wait Icons", + desc = "Shows the wait/pause icon above units", + author = "Floris, Beherith, Robert82", + date = "May 2025", + license = "GNU GPL, v2 or later", + layer = -40, + enabled = true, + } end -local iconSequenceImages = 'anims/icexuick_200/cursorwait_' -- must be png's -local iconSequenceNum = 44 -- always starts at 1 -local iconSequenceFrametime = 0.02 -- duration per frame +local iconSequenceImages = "anims/icexuick_200/cursorwait_" -- must be png's +local iconSequenceNum = 44 -- always starts at 1 +local iconSequenceFrametime = 0.02 -- duration per frame local CMD_WAIT = CMD.WAIT local waitingUnits = {} -local needsCheckFrame = {} -- unitID → frame -local needsCheckDefID = {} -- unitID → defID -local needsCheckTeam = {} -- unitID → team +local needsCheckFrame = {} -- unitID → frame +local needsCheckDefID = {} -- unitID → defID +local needsCheckTeam = {} -- unitID → team local checkDelay = 5 local unitsPerFrame = 300 local gf = Spring.GetGameFrame() @@ -33,15 +33,15 @@ local spec = Spring.GetSpectatingState() local myTeamID = Spring.GetMyTeamID() local spValidUnitID = Spring.ValidUnitID -local spIsGUIHidden = Spring.IsGUIHidden -local spGetConfigInt = Spring.GetConfigInt +local spIsGUIHidden = Spring.IsGUIHidden +local spGetConfigInt = Spring.GetConfigInt local unitConf = {} for udid, unitDef in pairs(UnitDefs) do if not unitDef.customParams.removewait then local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = 4 * ( (xsize+2)^2 + (zsize+2)^2 )^0.5 - unitConf[udid] = {7.5 +(scale/2.2), unitDef.height-0.1, unitDef.isFactory} + local scale = 4 * ((xsize + 2) ^ 2 + (zsize + 2) ^ 2) ^ 0.5 + unitConf[udid] = { 7.5 + (scale / 2.2), unitDef.height - 0.1, unitDef.isFactory } end end @@ -52,16 +52,16 @@ end local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance -local uploadAllElements = InstanceVBOTable.uploadAllElements +local uploadAllElements = InstanceVBOTable.uploadAllElements local iconVBO = nil local energyIconShader = nil local luaShaderDir = "LuaUI/Include/" local function initGL4() - local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DrawPrimitiveAtUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DrawPrimitiveAtUnit.InitDrawPrimitiveAtUnit local shaderConfig = DrawPrimitiveAtUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 1 @@ -71,8 +71,8 @@ local function initGL4() shaderConfig.FULL_ROTATION = 0 shaderConfig.CLIPTOLERANCE = 1.2 shaderConfig.INITIALSIZE = 0.22 - shaderConfig.BREATHESIZE = 0--0.1 - -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader + shaderConfig.BREATHESIZE = 0 --0.1 + -- MATCH CUS position as seed to sin, then pass it through geoshader into fragshader --shaderConfig.POST_VERTEX = "v_parameters.w = max(-0.2, sin(timeInfo.x * 2.0/30.0 + (v_centerpos.x + v_centerpos.z) * 0.1)) + 0.2; // match CUS glow rate" shaderConfig.POST_GEOMETRY = " gl_Position.z = (gl_Position.z) - 512.0 / (gl_Position.w); // send 16 elmos forward in depth buffer" shaderConfig.POST_SHADING = "fragColor.rgba = vec4(texcolor.rgb, texcolor.a * g_uv.z);" @@ -90,7 +90,6 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - function widget:Initialize() if spec or not gl.CreateShader or not initGL4() then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() @@ -106,7 +105,7 @@ end local function UnmarkAsWaiting(unitID, unitDefID, unitTeam) if waitingUnits[unitID] then - waitingUnits[unitID] = nil -- erase flag + waitingUnits[unitID] = nil -- erase flag end if iconVBO.instanceIDtoIndex[unitID] then popElementInstance(iconVBO, unitID) @@ -114,7 +113,9 @@ local function UnmarkAsWaiting(unitID, unitDefID, unitTeam) end local function CheckWaitingStatus(unitID, unitDefID, unitTeam) - if not unitConf[unitDefID] then return end + if not unitConf[unitDefID] then + return + end local cmdCount = spGetUnitCommandCount(unitID) if not cmdCount or cmdCount <= 0 then UnmarkAsWaiting(unitID, unitDefID, unitTeam) @@ -128,22 +129,18 @@ local function CheckWaitingStatus(unitID, unitDefID, unitTeam) end end - function forgetUnit(unitID, unitDefID, unitTeam) needsCheckFrame[unitID] = nil needsCheckDefID[unitID] = nil - needsCheckTeam[unitID] = nil + needsCheckTeam[unitID] = nil UnmarkAsWaiting(unitID, unitDefID, unitTeam) end local function updateIcons() for unitID, unitDefID in pairs(waitingUnits) do - if not iconVBO.instanceIDtoIndex[unitID] then--if visibleUnits[unitID] then + if not iconVBO.instanceIDtoIndex[unitID] then --if visibleUnits[unitID] then if spValidUnitID(unitID) then - pushElementInstance(iconVBO, - {unitConf[unitDefID][1], unitConf[unitDefID][1], 0, unitConf[unitDefID][2], - 0, 4, gf, 0, 0.75, 0, 0,1,0,1, 0,0,0,0}, - unitID, false, true, unitID) + pushElementInstance(iconVBO, { unitConf[unitDefID][1], unitConf[unitDefID][1], 0, unitConf[unitDefID][2], 0, 4, gf, 0, 0.75, 0, 0, 1, 0, 1, 0, 0, 0, 0 }, unitID, false, true, unitID) end end end @@ -166,10 +163,12 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam) end function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) - if unitTeam ~= myTeamID then return end + if unitTeam ~= myTeamID then + return + end needsCheckFrame[unitID] = gf + checkDelay needsCheckDefID[unitID] = unitDefID - needsCheckTeam[unitID] = unitTeam + needsCheckTeam[unitID] = unitTeam end function widget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID) @@ -180,7 +179,7 @@ function widget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID) -- another command finished, defer check to GameFrame batch needsCheckFrame[unitID] = gf + 1 needsCheckDefID[unitID] = unitDefID - needsCheckTeam[unitID] = unitTeam + needsCheckTeam[unitID] = unitTeam end end @@ -190,17 +189,16 @@ function widget:UnitIdle(unitID, unitDefID, unitTeam) end function initUnits() - waitingUnits = {} -- forget any previous “waiting” flags + waitingUnits = {} -- forget any previous “waiting” flags local unitDefID for _, unitID in pairs(Spring.GetTeamUnits(myTeamID)) do unitDefID = Spring.GetUnitDefID(unitID) needsCheckFrame[unitID] = gf + checkDelay needsCheckDefID[unitID] = unitDefID - needsCheckTeam[unitID] = myTeamID + needsCheckTeam[unitID] = myTeamID end end - function widget:GameFrame(n) local currentUnitPerFrame = 0 gf = n @@ -211,7 +209,7 @@ function widget:GameFrame(n) CheckWaitingStatus(unitID, needsCheckDefID[unitID], needsCheckTeam[unitID]) needsCheckFrame[unitID] = nil needsCheckDefID[unitID] = nil - needsCheckTeam[unitID] = nil + needsCheckTeam[unitID] = nil end end end @@ -223,18 +221,20 @@ end function widget:DrawScreenEffects() -- DrawScreenEffects so icons render after deferred lighting/distortion/bloom/tonemap; -- shader still uses engine cameraViewProj UBO and depth-test for terrain occlusion. - if spIsGUIHidden() then return end + if spIsGUIHidden() then + return + end if iconVBO.usedElements > 0 then local disticon = spGetConfigInt("UnitIconDistance", 200) * 27.5 -- iconLength = unitIconDist * unitIconDist * 750.0f; gl.DepthTest(true) gl.DepthMask(false) - local clock = os.clock() * (1*(iconSequenceFrametime*iconSequenceNum)) -- adjust speed relative to anim frame speed of 0.02sec per frame (59 frames in total) + local clock = os.clock() * (1 * (iconSequenceFrametime * iconSequenceNum)) -- adjust speed relative to anim frame speed of 0.02sec per frame (59 frames in total) local animFrame = math.max(1, math.ceil(iconSequenceNum * (clock - math.floor(clock)))) - gl.Texture(iconSequenceImages..animFrame..'.png') + gl.Texture(iconSequenceImages .. animFrame .. ".png") energyIconShader:Activate() - energyIconShader:SetUniform("iconDistance",disticon) - energyIconShader:SetUniform("addRadius",0) - iconVBO.VAO:DrawArrays(GL.POINTS,iconVBO.usedElements) + energyIconShader:SetUniform("iconDistance", disticon) + energyIconShader:SetUniform("addRadius", 0) + iconVBO.VAO:DrawArrays(GL.POINTS, iconVBO.usedElements) energyIconShader:Deactivate() gl.Texture(false) gl.DepthTest(false) diff --git a/luaui/Widgets/gui_unitgroups.lua b/luaui/Widgets/gui_unitgroups.lua index 21e3a33f54c..5ae52e6514e 100644 --- a/luaui/Widgets/gui_unitgroups.lua +++ b/luaui/Widgets/gui_unitgroups.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "March 2021", license = "GNU GPL, v2 or later", layer = 1, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -21,18 +20,18 @@ local mathMax = math.max local spGetViewGeometry = Spring.GetViewGeometry local spGetSpectatingState = Spring.GetSpectatingState -local alwaysShow = true -- always show AT LEAST the label -local alwaysShowLabel = true -- always show the label regardless +local alwaysShow = true -- always show AT LEAST the label +local alwaysShowLabel = true -- always show the label regardless local showWhenSpec = false -local showStack = true -- display different unitdef pics in a showStack +local showStack = true -- display different unitdef pics in a showStack local iconSizeMult = 0.98 local highlightSelectedGroups = true local playSounds = true local soundVolume = 0.5 local setHeight = 0.046 -local leftclick = 'LuaUI/Sounds/buildbar_add.wav' -local rightclick = 'LuaUI/Sounds/buildbar_click.wav' +local leftclick = "LuaUI/Sounds/buildbar_add.wav" +local rightclick = "LuaUI/Sounds/buildbar_click.wav" local vsx, vsy = spGetViewGeometry() @@ -81,8 +80,8 @@ function widget:ViewResize() vsx, vsy = spGetViewGeometry() height = setHeight * uiScale - font2 = WG['fonts'].getFont() - font = WG['fonts'].getFont(2) + font2 = WG["fonts"].getFont() + font = WG["fonts"].getFont(2) elementCorner = WG.FlowUI.elementCorner backgroundPadding = WG.FlowUI.elementPadding @@ -92,39 +91,39 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element UiUnit = WG.FlowUI.Draw.Unit - if WG['buildmenu'] then - buildmenuBottomPosition = WG['buildmenu'].getBottomPosition() - buildmenuAlwaysShow = WG['buildmenu'].getAlwaysShow() + if WG["buildmenu"] then + buildmenuBottomPosition = WG["buildmenu"].getBottomPosition() + buildmenuAlwaysShow = WG["buildmenu"].getAlwaysShow() end local omPosX, omPosY, omWidth, omHeight = 0, 0, 0, 0 - if WG['ordermenu'] then - omPosX, omPosY, omWidth, omHeight = WG['ordermenu'].getPosition() + if WG["ordermenu"] then + omPosX, omPosY, omWidth, omHeight = WG["ordermenu"].getPosition() end ordermenuPosY = omPosY if buildmenuBottomPosition then - posY = omHeight + (widgetSpaceMargin/vsy) + posY = omHeight + (widgetSpaceMargin / vsy) if omPosX <= 0.01 then - posX = omPosX + omWidth + (widgetSpaceMargin/vsx) + posX = omPosX + omWidth + (widgetSpaceMargin / vsx) else posX = 0 end else posY = 0 - posX = omPosX + omWidth + (widgetSpaceMargin/vsx) + posX = omPosX + omWidth + (widgetSpaceMargin / vsx) end if buildmenuBottomPosition and not buildmenuAlwaysShow then buildmenuShowingPosY = posY - if (not selectedUnits[1] or not WG['buildmenu'].getIsShowing()) then + if not selectedUnits[1] or not WG["buildmenu"].getIsShowing() then posY = 0 end end iconMargin = floor((backgroundPadding * 0.5) + 0.5) - groupSize = floor((height * vsy) - (posY-height > 0 and backgroundPadding or 0)) - usedHeight = groupSize + (posY-height > 0 and backgroundPadding or 0) + groupSize = floor((height * vsy) - (posY - height > 0 and backgroundPadding or 0)) + usedHeight = groupSize + (posY - height > 0 and backgroundPadding or 0) if uiTex then gl.DeleteTexture(uiBgTex) @@ -149,8 +148,8 @@ function widget:Initialize() end widget:ViewResize() widget:PlayerChanged() - WG['unitgroups'] = {} - WG['unitgroups'].getPosition = function() + WG["unitgroups"] = {} + WG["unitgroups"].getPosition = function() return posX, backgroundRect and backgroundRect[2] or posY, backgroundRect and backgroundRect[3] or posX, backgroundRect and backgroundRect[4] or posY + usedHeight end end @@ -165,41 +164,34 @@ function widget:Shutdown() if uiTex then gl.DeleteTexture(uiTex) end - if WG['guishader'] and dlistGuishader then - WG.FlowUI.guishaderDeleteDlist('unitgroups') + if WG["guishader"] and dlistGuishader then + WG.FlowUI.guishaderDeleteDlist("unitgroups") dlistGuishader = nil end - WG['unitgroups'] = nil + WG["unitgroups"] = nil end local function checkGuishader(force) if backgroundRect then - dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, 'unitgroups', function() - RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner, ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0)) + dlistGuishader = WG.FlowUI.guishaderCheckDlist(dlistGuishader, "unitgroups", function() + RectRound(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], elementCorner, ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0)) end, force) end end local function drawIcon(unitDefID, rect, lightness, zoom, texSize, highlightOpacity) - gl.Color(lightness,lightness,lightness,1) - UiUnit( - rect[1], rect[2], rect[3], rect[4], - ceil(backgroundPadding*0.5), 1,1,1,1, - zoom, - nil, mathMax(0.1, highlightOpacity or 0.1), - '#'..unitDefID, - nil, nil, nil, nil - ) + gl.Color(lightness, lightness, lightness, 1) + UiUnit(rect[1], rect[2], rect[3], rect[4], ceil(backgroundPadding * 0.5), 1, 1, 1, 1, zoom, nil, mathMax(0.1, highlightOpacity or 0.1), "#" .. unitDefID, nil, nil, nil, nil) if highlightOpacity then gl.Blending(GL_SRC_ALPHA, GL_ONE) - gl.Color(1,1,1,highlightOpacity) - RectRound(rect[1], rect[2], rect[3], rect[4], min(max(1, floor((rect[3]-rect[1]) * 0.024)), floor((vsy*0.0015)+0.5))) + gl.Color(1, 1, 1, highlightOpacity) + RectRound(rect[1], rect[2], rect[3], rect[4], min(max(1, floor((rect[3] - rect[1]) * 0.024)), floor((vsy * 0.0015) + 0.5))) gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end end local function drawBackground() - UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY-height > 0 or posX <= 0) and 1 or 0), ((posY-height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], ((posX <= 0) and 0 or 1), 1, ((posY - height > 0 or posX <= 0) and 1 or 0), ((posY - height > 0 and posX > 0) and 1 or 0), nil, nil, nil, nil, nil, nil, nil, nil) end local function drawContent() @@ -220,26 +212,26 @@ local function drawContent() floor(posX * vsx), floor(posY * vsy), floor(posX * vsx) + usedWidth - (groupWidth * numGroups), - floor(posY * vsy) + usedHeight + floor(posY * vsy) + usedHeight, } - local fontSize = height*vsy*0.25 - local offset = ((groupRect[3]-groupRect[1])/4.2) - local offsetY = -(fontSize*(posY > 0 and 0.31 or 0.44)) - local style = 'co' + local fontSize = height * vsy * 0.25 + local offset = ((groupRect[3] - groupRect[1]) / 4.2) + local offsetY = -(fontSize * (posY > 0 and 0.31 or 0.44)) + local style = "co" font2:Begin(true) font2:SetOutlineColor(0, 0, 0, 0.2) font2:SetTextColor(0.45, 0.45, 0.45, 1) - font2:Print(1, groupRect[1]+((groupRect[3]-groupRect[1])/2)-offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)+offset+offsetY, fontSize, style) - font2:Print(2, groupRect[1]+((groupRect[3]-groupRect[1])/2), groupRect[2]+((groupRect[4]-groupRect[2])/2)+offset+offsetY, fontSize, style) - font2:Print(3, groupRect[1]+((groupRect[3]-groupRect[1])/2)+offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)+offset+offsetY, fontSize, style) + font2:Print(1, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) - offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offset + offsetY, fontSize, style) + font2:Print(2, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2), groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offset + offsetY, fontSize, style) + font2:Print(3, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) + offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offset + offsetY, fontSize, style) - font2:Print(4, groupRect[1]+((groupRect[3]-groupRect[1])/2)-offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)+offsetY, fontSize, style) - font2:Print(5, groupRect[1]+((groupRect[3]-groupRect[1])/2), groupRect[2]+((groupRect[4]-groupRect[2])/2)+offsetY, fontSize, style) - font2:Print(6, groupRect[1]+((groupRect[3]-groupRect[1])/2)+offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)+offsetY, fontSize, style) + font2:Print(4, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) - offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offsetY, fontSize, style) + font2:Print(5, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2), groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offsetY, fontSize, style) + font2:Print(6, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) + offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) + offsetY, fontSize, style) - font2:Print(7, groupRect[1]+((groupRect[3]-groupRect[1])/2)-offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)-offset+offsetY, fontSize, style) - font2:Print(8, groupRect[1]+((groupRect[3]-groupRect[1])/2), groupRect[2]+((groupRect[4]-groupRect[2])/2)-offset+offsetY, fontSize, "c") - font2:Print(9, groupRect[1]+((groupRect[3]-groupRect[1])/2)+offset, groupRect[2]+((groupRect[4]-groupRect[2])/2)-offset+offsetY, fontSize, style) + font2:Print(7, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) - offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) - offset + offsetY, fontSize, style) + font2:Print(8, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2), groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) - offset + offsetY, fontSize, "c") + font2:Print(9, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2) + offset, groupRect[2] + ((groupRect[4] - groupRect[2]) / 2) - offset + offsetY, fontSize, style) font2:End() end @@ -247,7 +239,7 @@ local function drawContent() local hoveredGroup = -1 local x, y, b, b2, b3 = spGetMouseState() if groupButtons then - for i,v in pairs(groupButtons) do + for i, v in pairs(groupButtons) do if math_isInRect(x, y, groupButtons[i][1], groupButtons[i][2], groupButtons[i][3], groupButtons[i][4]) then hoveredGroup = groupButtons[i][5] break @@ -257,13 +249,13 @@ local function drawContent() local groupCounter = 0 groupButtons = {} - for group=0, 9 do + for group = 0, 9 do if existingGroups[group] then local groupRect = { - backgroundRect[1]+backgroundPadding+((groupSize-backgroundPadding)*groupCounter)+startOffsetX, - backgroundRect[2]+(posY-height > 0 and backgroundPadding or 0), - backgroundRect[1]+backgroundPadding+(groupSize-backgroundPadding)+((groupSize-backgroundPadding)*groupCounter)+startOffsetX, - backgroundRect[4]-backgroundPadding + backgroundRect[1] + backgroundPadding + ((groupSize - backgroundPadding) * groupCounter) + startOffsetX, + backgroundRect[2] + (posY - height > 0 and backgroundPadding or 0), + backgroundRect[1] + backgroundPadding + (groupSize - backgroundPadding) + ((groupSize - backgroundPadding) * groupCounter) + startOffsetX, + backgroundRect[4] - backgroundPadding, } local unitdefCounts = spGetGroupUnitsCounts(group) @@ -318,31 +310,31 @@ local function drawContent() end end - gl.Color(1,1,1,1) - groupButtons[#groupButtons+1] = {groupRect[1],groupRect[2],groupRect[3],groupRect[4],group} - local groupSize = groupRect[3]-groupRect[1]-iconMargin-iconMargin + gl.Color(1, 1, 1, 1) + groupButtons[#groupButtons + 1] = { groupRect[1], groupRect[2], groupRect[3], groupRect[4], group } + local groupSize = groupRect[3] - groupRect[1] - iconMargin - iconMargin local iconSize = groupSize * iconSizeMult local offset = 0 if showStack then if udefID_5 then - iconSize = floor(iconSize*0.78) + iconSize = floor(iconSize * 0.78) offset = floor((groupSize - iconSize) / 4) elseif udefID_4 then - iconSize = floor(iconSize*0.83) + iconSize = floor(iconSize * 0.83) offset = floor((groupSize - iconSize) / 3) elseif udefID_3 then - iconSize = floor(iconSize*0.86) + iconSize = floor(iconSize * 0.86) offset = floor((groupSize - iconSize) / 2) elseif udefID_2 then - iconSize = floor(iconSize*0.88) - offset = groupSize - (iconSize*1.06) + iconSize = floor(iconSize * 0.88) + offset = groupSize - (iconSize * 1.06) else - iconSize = floor(iconSize*0.94) + iconSize = floor(iconSize * 0.94) offset = groupSize - iconSize end end - local texSize = floor(groupSize*1.33) + local texSize = floor(groupSize * 1.33) local zoom = group == hoveredGroup and (b and 0.15 or 0.105) or 0.05 local highlightOpacity = 0 if selectedGroups[group] then @@ -353,49 +345,29 @@ local function drawContent() end if showStack then if udefID_5 then - drawIcon( - udefID_5, - {groupRect[1]+iconMargin+(offset*4), groupRect[4]-iconMargin-(offset*4)-iconSize, groupRect[1]+iconMargin+(offset*4)+iconSize, groupRect[4]-iconMargin-(offset*4)}, - 0.33, zoom, texSize, highlightOpacity - ) + drawIcon(udefID_5, { groupRect[1] + iconMargin + (offset * 4), groupRect[4] - iconMargin - (offset * 4) - iconSize, groupRect[1] + iconMargin + (offset * 4) + iconSize, groupRect[4] - iconMargin - (offset * 4) }, 0.33, zoom, texSize, highlightOpacity) end if udefID_4 then - drawIcon( - udefID_4, - {groupRect[1]+iconMargin+(offset*3), groupRect[4]-iconMargin-(offset*3)-iconSize, groupRect[1]+iconMargin+(offset*3)+iconSize, groupRect[4]-iconMargin-(offset*3)}, - 0.45, zoom, texSize, highlightOpacity - ) + drawIcon(udefID_4, { groupRect[1] + iconMargin + (offset * 3), groupRect[4] - iconMargin - (offset * 3) - iconSize, groupRect[1] + iconMargin + (offset * 3) + iconSize, groupRect[4] - iconMargin - (offset * 3) }, 0.45, zoom, texSize, highlightOpacity) end if udefID_3 then - drawIcon( - udefID_3, - {groupRect[1]+iconMargin+(offset*2), groupRect[4]-iconMargin-(offset*2)-iconSize, groupRect[1]+iconMargin+(offset*2)+iconSize, groupRect[4]-iconMargin-(offset*2)}, - 0.55, zoom, texSize, highlightOpacity - ) + drawIcon(udefID_3, { groupRect[1] + iconMargin + (offset * 2), groupRect[4] - iconMargin - (offset * 2) - iconSize, groupRect[1] + iconMargin + (offset * 2) + iconSize, groupRect[4] - iconMargin - (offset * 2) }, 0.55, zoom, texSize, highlightOpacity) end if udefID_2 then - drawIcon( - udefID_2, - {groupRect[1]+iconMargin+offset, groupRect[4]-iconMargin-offset-iconSize, groupRect[1]+iconMargin+offset+iconSize, groupRect[4]-iconMargin-offset}, - 0.7, zoom, texSize, highlightOpacity - ) + drawIcon(udefID_2, { groupRect[1] + iconMargin + offset, groupRect[4] - iconMargin - offset - iconSize, groupRect[1] + iconMargin + offset + iconSize, groupRect[4] - iconMargin - offset }, 0.7, zoom, texSize, highlightOpacity) end end - drawIcon( - udefID_1, - {groupRect[1]+iconMargin, groupRect[4]-iconMargin-iconSize, groupRect[1]+iconMargin+iconSize, groupRect[4]-iconMargin}, - 1, zoom, texSize, highlightOpacity - ) + drawIcon(udefID_1, { groupRect[1] + iconMargin, groupRect[4] - iconMargin - iconSize, groupRect[1] + iconMargin + iconSize, groupRect[4] - iconMargin }, 1, zoom, texSize, highlightOpacity) - local fontSize = height*vsy*0.4 + local fontSize = height * vsy * 0.4 font2:Begin(true) - font2:Print('\255\200\255\200'..group, groupRect[1]+((groupRect[3]-groupRect[1])/2), groupRect[2]+iconMargin + (fontSize*0.28), fontSize, "co") + font2:Print("\255\200\255\200" .. group, groupRect[1] + ((groupRect[3] - groupRect[1]) / 2), groupRect[2] + iconMargin + (fontSize * 0.28), fontSize, "co") font2:End() local amount = (showStack and largestCount_1 or spGetGroupUnitsCount(group)) if amount > 1 then - fontSize = height*vsy*0.3 + fontSize = height * vsy * 0.3 font:Begin(true) - font:Print('\255\240\240\240'..amount, groupRect[1]+iconMargin+(fontSize*0.18), groupRect[4]-iconMargin-(fontSize*0.92), fontSize, "o") + font:Print("\255\240\240\240" .. amount, groupRect[1] + iconMargin + (fontSize * 0.18), groupRect[4] - iconMargin - (fontSize * 0.92), fontSize, "o") font:End() end @@ -421,7 +393,6 @@ local function updateList() checkGuishader(true) end else - local mult = numGroups if numGroups == 0 then mult = 1 @@ -447,7 +418,7 @@ local function updateList() floor(posX * vsx), floor(posY * vsy), floor(posX * vsx) + usedWidth, - floor(posY * vsy) + usedHeight + floor(posY * vsy) + usedHeight, } if backgroundRect and (backgroundRect[3] ~= prevBackgroundX2 or backgroundRect[2] ~= prevBackgroundY1) then if uiBgTex then @@ -458,7 +429,7 @@ local function updateList() end if not uiBgTex then - uiBgTex = gl.CreateTexture(mathFloor(uiTexWidth), mathFloor(backgroundRect[4]-backgroundRect[2]), { + uiBgTex = gl.CreateTexture(mathFloor(uiTexWidth), mathFloor(backgroundRect[4] - backgroundRect[2]), { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, @@ -466,13 +437,13 @@ local function updateList() gl.R2tHelper.RenderInRect(uiBgTex, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], drawBackground, true) end if not uiTex then - uiTex = gl.CreateTexture(mathFloor(uiTexWidth)*2, mathFloor(backgroundRect[4]-backgroundRect[2])*2, { + uiTex = gl.CreateTexture(mathFloor(uiTexWidth) * 2, mathFloor(backgroundRect[4] - backgroundRect[2]) * 2, { target = GL.TEXTURE_2D, format = GL.RGBA, fbo = true, }) end - gl.R2tHelper.RenderInRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1]+uiTexWidth, backgroundRect[4], drawContent, true) + gl.R2tHelper.RenderInRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1] + uiTexWidth, backgroundRect[4], drawContent, true) end end @@ -489,7 +460,7 @@ function widget:DrawScreen() end if uiTex then -- content - gl.R2tHelper.BlendTexRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1]+uiTexWidth, backgroundRect[4], true) + gl.R2tHelper.BlendTexRect(uiTex, backgroundRect[1], backgroundRect[2], backgroundRect[1] + uiTexWidth, backgroundRect[4], true) end end end @@ -501,7 +472,7 @@ function widget:Update(dt) return end - if WG['topbar'] and WG['topbar'].showingQuit() then + if WG["topbar"] and WG["topbar"].showingQuit() then return end @@ -509,13 +480,13 @@ function widget:Update(dt) sec = sec + dt sec2 = sec2 + dt - if WG['buildmenu'] then - if buildmenuAlwaysShow ~= WG['buildmenu'].getAlwaysShow() then + if WG["buildmenu"] then + if buildmenuAlwaysShow ~= WG["buildmenu"].getAlwaysShow() then widget:ViewResize() doUpdate = true end - if buildmenuBottomPosition and not buildmenuAlwaysShow and WG['info'] then - if (not selectedUnits[1] or not WG['buildmenu'].getIsShowing()) and (posX > 0 or not WG['info'].getIsShowing()) then + if buildmenuBottomPosition and not buildmenuAlwaysShow and WG["info"] then + if (not selectedUnits[1] or not WG["buildmenu"].getIsShowing()) and (posX > 0 or not WG["info"].getIsShowing()) then if posY ~= 0 then posY = 0 doUpdate = true @@ -532,18 +503,18 @@ function widget:Update(dt) local x, y, b = spGetMouseState() if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then hovered = true - local tooltipAddition = '' + local tooltipAddition = "" if numGroups >= 1 then - tooltipAddition = tooltipAddition .. Spring.I18N('ui.unitGroups.shiftclick')..'\n'..Spring.I18N('ui.unitGroups.ctrlclick')..'\n'..Spring.I18N('ui.unitGroups.rightclick') + tooltipAddition = tooltipAddition .. Spring.I18N("ui.unitGroups.shiftclick") .. "\n" .. Spring.I18N("ui.unitGroups.ctrlclick") .. "\n" .. Spring.I18N("ui.unitGroups.rightclick") end - tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n' or '') .. Spring.I18N('ui.unitGroups.tooltip') - if WG['autogroup'] ~= nil then - tooltipAddition = tooltipAddition .. (tooltipAddition~='' and '\n\n' or '') .. "\255\200\255\200" .. Spring.I18N('ui.unitGroups.autogroupTooltip') + tooltipAddition = tooltipAddition .. (tooltipAddition ~= "" and "\n" or "") .. Spring.I18N("ui.unitGroups.tooltip") + if WG["autogroup"] ~= nil then + tooltipAddition = tooltipAddition .. (tooltipAddition ~= "" and "\n\n" or "") .. "\255\200\255\200" .. Spring.I18N("ui.unitGroups.autogroupTooltip") end - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('unitgroups', tooltipAddition, nil, nil, Spring.I18N('ui.unitGroups.name')) + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("unitgroups", tooltipAddition, nil, nil, Spring.I18N("ui.unitGroups.name")) end - Spring.SetMouseCursor('cursornormal') + Spring.SetMouseCursor("cursornormal") if b then sec = sec + 0.4 end @@ -570,7 +541,7 @@ function widget:Update(dt) groupUnitSelectedCount[group] = 0 local groupUnits = Spring.GetGroupUnits(group) groupUnitCount[group] = #groupUnits - for i=1, #groupUnits do + for i = 1, #groupUnits do if selectedUnitID[groupUnits[i]] then groupUnitSelectedCount[group] = groupUnitSelectedCount[group] + 1 end @@ -600,27 +571,27 @@ function widget:Update(dt) end end - if WG['buildmenu'] and WG['buildmenu'].getBottomPosition then + if WG["buildmenu"] and WG["buildmenu"].getBottomPosition then local prevbuildmenuBottomPos = buildmenuBottomPos - buildmenuBottomPos = WG['buildmenu'].getBottomPosition() + buildmenuBottomPos = WG["buildmenu"].getBottomPosition() if buildmenuBottomPos ~= prevbuildmenuBottomPos then widget:ViewResize() doUpdate = true end end - if WG['ordermenu'] then + if WG["ordermenu"] then local prevOrdermenuPosY = ordermenuPosY - ordermenuPosY = select(2, WG['ordermenu'].getPosition()) + ordermenuPosY = select(2, WG["ordermenu"].getPosition()) if ordermenuPosY ~= prevOrdermenuPosY then widget:ViewResize() doUpdate = true end end - doUpdate = true -- TODO: find a way to detect group changes and only doUpdate then + doUpdate = true -- TODO: find a way to detect group changes and only doUpdate then -- detect guishader toggle: force refresh when it comes back on - local guishaderActive = WG['guishader'] ~= nil + local guishaderActive = WG["guishader"] ~= nil if guishaderActive and not guishaderWasActive then checkGuishader(true) end @@ -639,13 +610,13 @@ function widget:MousePress(x, y, button) if backgroundRect and math_isInRect(x, y, backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4]) then local alt, ctrl, meta, shift = Spring.GetModKeyState() if button == 1 or button == 3 then - for i,v in pairs(groupButtons) do + for i, v in pairs(groupButtons) do if math_isInRect(x, y, groupButtons[i][1], groupButtons[i][2], groupButtons[i][3], groupButtons[i][4]) then if shift then local units = selectedUnits local groupUnits = Spring.GetGroupUnits(groupButtons[i][5]) - for i=1, #groupUnits do - units[#units+1] = groupUnits[i] + for i = 1, #groupUnits do + units[#units + 1] = groupUnits[i] end selectedUnits = units selectionHasChanged = true @@ -654,13 +625,13 @@ function widget:MousePress(x, y, button) local units = selectedUnits local groupUnits = Spring.GetGroupUnits(groupButtons[i][5]) local keyGroupUnits = {} - for i=1, #groupUnits do + for i = 1, #groupUnits do keyGroupUnits[groupUnits[i]] = true end local newUnits = {} - for i=1, #units do + for i = 1, #units do if not keyGroupUnits[units[i]] then - newUnits[#newUnits+1] = units[i] + newUnits[#newUnits + 1] = units[i] end end selectedUnits = newUnits @@ -675,7 +646,7 @@ function widget:MousePress(x, y, button) Spring.SendCommands("viewselection") end if playSounds then - Spring.PlaySoundFile((button == 3 and rightclick or leftclick), soundVolume, 'ui') + Spring.PlaySoundFile((button == 3 and rightclick or leftclick), soundVolume, "ui") end return true end @@ -689,10 +660,9 @@ function widget:SelectionChanged(sel) selectionHasChanged = true end - function widget:GetConfigData() return { - alwaysShow = alwaysShow + alwaysShow = alwaysShow, } end diff --git a/luaui/Widgets/gui_vote_interface.lua b/luaui/Widgets/gui_vote_interface.lua index 837f687029e..f6bcbac1213 100644 --- a/luaui/Widgets/gui_vote_interface.lua +++ b/luaui/Widgets/gui_vote_interface.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -26,13 +25,13 @@ local L_DEPRECATED = LOG.DEPRECATED local titlecolor = "\255\190\190\190" -- dont show vote buttons for specs when containing the following keywords (use lowercase) -local globalVoteWords = { 'forcestart', 'stop', 'joinas', 'kickban', 'gkick', 'bkick', 'nospecchat' } +local globalVoteWords = { "forcestart", "stop", "joinas", "kickban", "gkick", "bkick", "nospecchat" } -local INDIVIDUAL_RESIGN_VOTE_PATTERN = "called a vote for command \"resign ([^%s]+)\"" -local TEAM_RESIGN_VOTE_PATTERN = "called a vote for command \"resign ([^%s]+) TEAM\"" +local INDIVIDUAL_RESIGN_VOTE_PATTERN = 'called a vote for command "resign ([^%s]+)"' +local TEAM_RESIGN_VOTE_PATTERN = 'called a vote for command "resign ([^%s]+) TEAM"' local voteEndDelay = 4 -local voteTimeout = 75 -- fallback timeout in case vote is aborted undetected +local voteTimeout = 75 -- fallback timeout in case vote is aborted undetected local vsx, vsy = spGetViewGeometry() @@ -89,14 +88,14 @@ local function CloseVote() voteName = nil weAreVoteOwner = nil eligibleToVote = false - if WG['guishader'] then - WG['guishader'].DeleteDlist('voteinterface') + if WG["guishader"] then + WG["guishader"].DeleteDlist("voteinterface") end gl.DeleteList(voteDlist) end end -local function StartVote(name) -- when called without params its just to refresh (when hovering over buttons) +local function StartVote(name) -- when called without params its just to refresh (when hovering over buttons) if name then CloseVote() end @@ -112,13 +111,13 @@ local function StartVote(name) -- when called without params its just to refresh local color1, color2, w local x, y, b = spGetMouseState() - local width = mathFloor((vsy / 6) * ui_scale) * 2 -- *2 so it ensures number can be divided cleanly by 2 - local height = mathFloor((vsy / 23) * ui_scale) * 2 -- *2 so it ensures number can be divided cleanly by 2 + local width = mathFloor((vsy / 6) * ui_scale) * 2 -- *2 so it ensures number can be divided cleanly by 2 + local height = mathFloor((vsy / 23) * ui_scale) * 2 -- *2 so it ensures number can be divided cleanly by 2 local progressbarHeight = math.ceil(height * 0.055) - local fontSize = height / 5 -- title only - local minWidth = font:GetTextWidth(' ' .. voteName .. ' ') * fontSize + local fontSize = height / 5 -- title only + local minWidth = font:GetTextWidth(" " .. voteName .. " ") * fontSize if width < minWidth then width = minWidth end @@ -136,21 +135,21 @@ local function StartVote(name) -- when called without params its just to refresh local xpos = mathFloor(width / 2) local ypos = mathFloor(vsy - (height / 2)) - if WG['topbar'] ~= nil then - local topbarArea = WG['topbar'].GetPosition() - xpos = mathFloor(topbarArea[1] + (width/2) + widgetSpaceMargin + ((topbarArea[3] - topbarArea[1])/2)) + if WG["topbar"] ~= nil then + local topbarArea = WG["topbar"].GetPosition() + xpos = mathFloor(topbarArea[1] + (width / 2) + widgetSpaceMargin + ((topbarArea[3] - topbarArea[1]) / 2)) ypos = mathFloor(topbarArea[2] - widgetSpaceMargin - (height / 2)) end hovered = nil windowArea = { xpos - (width / 2), ypos - (height / 2), xpos + (width / 2), ypos + (height / 2) } - closeButtonArea = { (xpos + (width / 2)) - (height / 2), ypos + mathFloor(height / 6), xpos + (width / 2), ypos + (height / 2)} + closeButtonArea = { (xpos + (width / 2)) - (height / 2), ypos + mathFloor(height / 6), xpos + (width / 2), ypos + (height / 2) } yesButtonArea = { xpos - (width / 2) + buttonMargin, ypos - (height / 2) + buttonMargin + progressbarHeight, xpos - (buttonMargin / 2), ypos - (height / 2) + buttonHeight - buttonMargin + progressbarHeight } - noButtonArea = { xpos + (buttonMargin / 2), ypos - (height / 2) + buttonMargin + progressbarHeight, xpos + (width / 2) - buttonMargin, ypos - (height / 2) + buttonHeight - buttonMargin + progressbarHeight} + noButtonArea = { xpos + (buttonMargin / 2), ypos - (height / 2) + buttonMargin + progressbarHeight, xpos + (width / 2) - buttonMargin, ypos - (height / 2) + buttonHeight - buttonMargin + progressbarHeight } if not voteEndText then - UiElement(windowArea[1], windowArea[2], windowArea[3], windowArea[4], 1,1,1,1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(windowArea[1], windowArea[2], windowArea[3], windowArea[4], 1, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) end -- progress bar @@ -160,12 +159,12 @@ local function StartVote(name) -- when called without params its just to refresh w = mathFloor(((windowArea[3] - windowArea[1] - bgpadding - bgpadding) / votesEligible) * votesRequired) color1 = { 0, 0.6, 0, 0.1 } color2 = { 0, 1, 0, 0.1 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, elementCorner*0.6, 0, 0, 0, 1, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, elementCorner * 0.6, 0, 0, 0, 1, color1, color2) if votesEligible ~= votesRequired then -- progress bar: required minority against color1 = { 0.6, 0, 0, 0.1 } color2 = { 1, 0, 0, 0.1 } - RectRound(windowArea[1] + bgpadding + w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, elementCorner*0.6, 0, 0, 1, 0, color1, color2) + RectRound(windowArea[1] + bgpadding + w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, elementCorner * 0.6, 0, 0, 1, 0, color1, color2) end end @@ -174,37 +173,37 @@ local function StartVote(name) -- when called without params its just to refresh w = mathFloor(((windowArea[3] - windowArea[1] - bgpadding - bgpadding) / votesEligible) * votesCountYes) color1 = { 0, 0.33, 0, 1 } color2 = { 0, 0.6, 0, 1 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, elementCorner*0.6, 0, 0, 0, 1, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, elementCorner * 0.6, 0, 0, 0, 1, color1, color2) -- highlight color1 = { 1, 1, 1, 0 } color2 = { 1, 1, 1, 0.15 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding + (progressbarHeight/2), windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 0, 1, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding + (progressbarHeight / 2), windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 0, 1, color1, color2) color1 = { 1, 1, 1, 0.08 } color2 = { 1, 1, 1, 0 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + (progressbarHeight/2), 0, 0, 0, 0, 1, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[1] + bgpadding + w, windowArea[2] + bgpadding + (progressbarHeight / 2), 0, 0, 0, 0, 1, color1, color2) end -- progress bar: against if votesCountNo > 0 then w = mathFloor(((windowArea[3] - windowArea[1] - bgpadding - bgpadding) / votesEligible) * votesCountNo) color1 = { 0.33, 0, 0, 1 } color2 = { 0.6, 0, 0, 1 } - RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, elementCorner*0.6, 0, 0, 1, 0, color1, color2) + RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, elementCorner * 0.6, 0, 0, 1, 0, color1, color2) -- highlight color1 = { 1, 1, 1, 0 } color2 = { 1, 1, 1, 0.15 } - RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding + (progressbarHeight/2), windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 1, 0, color1, color2) + RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding + (progressbarHeight / 2), windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 1, 0, color1, color2) color1 = { 1, 1, 1, 0.08 } color2 = { 1, 1, 1, 0 } - RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + (progressbarHeight/2), 0, 0, 0, 1, 0, color1, color2) + RectRound(windowArea[3] - bgpadding - w, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + (progressbarHeight / 2), 0, 0, 0, 1, 0, color1, color2) end -- progress bar: highlight color1 = { 1, 1, 1, 0 } color2 = { 1, 1, 1, 0.085 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding + (progressbarHeight/2), windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 0, 0, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding + (progressbarHeight / 2), windowArea[3] - bgpadding, windowArea[2] + bgpadding + progressbarHeight, 0, 0, 0, 0, 0, color1, color2) color1 = { 1, 1, 1, 0.023 } color2 = { 1, 1, 1, 0 } - RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + (progressbarHeight/2), 0, 0, 0, 0, 0, color1, color2) + RectRound(windowArea[1] + bgpadding, windowArea[2] + bgpadding, windowArea[3] - bgpadding, windowArea[2] + bgpadding + (progressbarHeight / 2), 0, 0, 0, 0, 0, color1, color2) end fontSize = fontSize * 0.85 @@ -216,18 +215,17 @@ local function StartVote(name) -- when called without params its just to refresh font:End() if eligibleToVote and not minimized and not voteEndText then - -- ESC local color1, color2 if math_isInRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) then - hovered = 'esc' + hovered = "esc" color1 = { 0.6, 0.6, 0.6, 0.6 } color2 = { 1, 1, 1, 0.6 } else color1 = { 0.6, 0.6, 0.6, 0.08 } color2 = { 1, 1, 1, 0.08 } end - RectRound(closeButtonArea[1] + bgpadding, closeButtonArea[2] + bgpadding, closeButtonArea[3] - bgpadding, closeButtonArea[4] - bgpadding, elementCorner*0.66, 0, 1, 0, 1, color1, color2) + RectRound(closeButtonArea[1] + bgpadding, closeButtonArea[2] + bgpadding, closeButtonArea[3] - bgpadding, closeButtonArea[4] - bgpadding, elementCorner * 0.66, 0, 1, 0, 1, color1, color2) font2:Begin() font2:SetOutlineColor(1, 1, 1, 0.2) font2:SetTextColor(0, 0, 0, 0.7) @@ -236,7 +234,7 @@ local function StartVote(name) -- when called without params its just to refresh -- NO / End Vote local color1, color2, mult if math_isInRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) then - hovered = 'n' + hovered = "n" color1 = { 0.5, 0.07, 0.07, 0.8 } color2 = { 0.7, 0.1, 0.1, 0.8 } mult = 1.15 @@ -245,17 +243,17 @@ local function StartVote(name) -- when called without params its just to refresh color2 = { 0.5, 0, 0, 0.75 } mult = 1 end - UiButton(noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, elementCorner*0.4) + UiButton(noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, elementCorner * 0.4) fontSize = fontSize * 0.85 font2:SetOutlineColor(0, 0, 0, 0.4) font2:SetTextColor(1, 1, 1, 1) - font2:Print((weAreVoteOwner and Spring.I18N('ui.voting.endVote') or Spring.I18N('ui.voting.no')), noButtonArea[1] + ((noButtonArea[3] - noButtonArea[1]) / 2), noButtonArea[2] + ((noButtonArea[4] - noButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") + font2:Print((weAreVoteOwner and Spring.I18N("ui.voting.endVote") or Spring.I18N("ui.voting.no")), noButtonArea[1] + ((noButtonArea[3] - noButtonArea[1]) / 2), noButtonArea[2] + ((noButtonArea[4] - noButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") -- YES if not weAreVoteOwner then if math_isInRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4]) then - hovered = 'y' + hovered = "y" color1 = { 0.035, 0.4, 0.035, 0.8 } color2 = { 0.05, 0.6, 0.5, 0.8 } mult = 1.15 @@ -264,16 +262,16 @@ local function StartVote(name) -- when called without params its just to refresh color2 = { 0, 0.5, 0, 0.38 } mult = 1 end - UiButton(yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4], 1,1,1,1, 1,1,1,1, nil, color1, color2, elementCorner*0.4) - font2:Print(Spring.I18N('ui.voting.yes'), yesButtonArea[1] + ((yesButtonArea[3] - yesButtonArea[1]) / 2), yesButtonArea[2] + ((yesButtonArea[4] - yesButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") + UiButton(yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4], 1, 1, 1, 1, 1, 1, 1, 1, nil, color1, color2, elementCorner * 0.4) + font2:Print(Spring.I18N("ui.voting.yes"), yesButtonArea[1] + ((yesButtonArea[3] - yesButtonArea[1]) / 2), yesButtonArea[2] + ((yesButtonArea[4] - yesButtonArea[2]) / 2) - (fontSize / 3), fontSize, "con") end font2:End() end if voteEndText then - UiElement(windowArea[1], windowArea[2], windowArea[3], windowArea[4], 1,1,1,1, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(windowArea[1], windowArea[2], windowArea[3], windowArea[4], 1, 1, 1, 1, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) font:Begin() - font:Print(titlecolor .. voteEndText, windowArea[1] + ((windowArea[3] - windowArea[1]) / 2), windowArea[2] + ((windowArea[4] - windowArea[2]) / 2)-(fontSize*0.3), fontSize*1.1, "con") + font:Print(titlecolor .. voteEndText, windowArea[1] + ((windowArea[3] - windowArea[1]) / 2), windowArea[2] + ((windowArea[4] - windowArea[2]) / 2) - (fontSize * 0.3), fontSize * 1.1, "con") font:End() end @@ -281,11 +279,11 @@ local function StartVote(name) -- when called without params its just to refresh end) -- background blur - if WG['guishader'] then + if WG["guishader"] then dlistGuishader = gl.CreateList(function() RectRound(windowArea[1], windowArea[2], windowArea[3], windowArea[4], elementCorner) end) - WG['guishader'].InsertDlist(dlistGuishader, 'voteinterface') + WG["guishader"].InsertDlist(dlistGuishader, "voteinterface") end end @@ -305,8 +303,8 @@ function widget:ViewResize() UiElement = WG.FlowUI.Draw.Element UiButton = WG.FlowUI.Draw.Button - font = WG['fonts'].getFont() - font2 = WG['fonts'].getFont(2) + font = WG["fonts"].getFont() + font2 = WG["fonts"].getFont(2) end function widget:PlayerChanged(playerID) @@ -322,34 +320,34 @@ function widget:Update(dt) debugSec = debugSec + dt if debugSec > 1 and debugStep < 1 then debugStep = 1 - widget:AddConsoleLine("> [teh]cluster1[00] * [teh]N0by called a vote for command \"stop\" [!vote y, !vote n, !vote b]", false) + widget:AddConsoleLine('> [teh]cluster1[00] * [teh]N0by called a vote for command "stop" [!vote y, !vote n, !vote b]', false) widget:AddConsoleLine("> [teh]cluster1[00] * 8 users allowed to vote.", false) end if debugSec > 2 and debugStep < 2 then debugStep = 2 --widget:AddConsoleLine("> [teh]cluster1[00] * Vote in progress: \"stop\" [y:1/4, n:1/3] (43s remaining)", false) - widget:AddConsoleLine("> [teh]cluster2[00] * Vote in progress: \"resign PyroTech TEAM\" [y:1/1(4), n:0/1(3), votes:1/3] (40s remaining)", false) + widget:AddConsoleLine('> [teh]cluster2[00] * Vote in progress: "resign PyroTech TEAM" [y:1/1(4), n:0/1(3), votes:1/3] (40s remaining)', false) end if debugSec > 2.75 and debugStep < 3 then debugStep = 3 - widget:AddConsoleLine("> [teh]cluster1[00] * Vote in progress: \"stop\" [y:2/4, n:1/3] (42s remaining)", false) + widget:AddConsoleLine('> [teh]cluster1[00] * Vote in progress: "stop" [y:2/4, n:1/3] (42s remaining)', false) end if debugSec > 3.3 and debugStep < 4 then debugStep = 4 - widget:AddConsoleLine("> [teh]cluster1[00] * Vote in progress: \"stop\" [y:3/4, n:1/3] (41s remaining)", false) + widget:AddConsoleLine('> [teh]cluster1[00] * Vote in progress: "stop" [y:3/4, n:1/3] (41s remaining)', false) end if debugSec > 4.2 and debugStep < 5 then debugStep = 5 - widget:AddConsoleLine("> [teh]cluster1[00] * Vote in progress: \"stop\" [y:3/4, n:2/3] (41s remaining)", false) + widget:AddConsoleLine('> [teh]cluster1[00] * Vote in progress: "stop" [y:3/4, n:2/3] (41s remaining)', false) end if debugSec > 5.5 and debugStep < 6 then debugStep = 6 - widget:AddConsoleLine("> [teh]cluster1[00] * Vote for command \"stop\" passed.", false) + widget:AddConsoleLine('> [teh]cluster1[00] * Vote for command "stop" passed.', false) end end if not voteEndTime and voteStartTime and (voteStartTime + voteTimeout < os.clock()) then - voteEndTime = os.clock() + (voteEndDelay*0.5) + voteEndTime = os.clock() + (voteEndDelay * 0.5) voteEndText = "-----" MinimizeVote() --CloseVote() @@ -370,7 +368,7 @@ function widget:GameFrame(n) myPlayerID = Spring.GetMyPlayerID() myPlayerName, _, mySpec, myTeamID, myAllyTeamID = Spring.GetPlayerInfo(myPlayerID, false) end - widgetHandler:RemoveCallIn('GameFrame') + widgetHandler:RemoveCallIn("GameFrame") end local function colourNames(teamID) @@ -382,20 +380,18 @@ local function colourNames(teamID) end function widget:AddConsoleLine(lines, priority) - if priority and priority == L_DEPRECATED then return end - if not WG['rejoin'] or not WG['rejoin'].showingRejoining() then - - lines = lines:match('^%[f=[0-9]+%] (.*)$') or lines + if priority and priority == L_DEPRECATED then + return + end + if not WG["rejoin"] or not WG["rejoin"].showingRejoining() then + lines = lines:match("^%[f=[0-9]+%] (.*)$") or lines for line in lines:gmatch("[^\n]+") do - -- system message if ssub(line, 1, 1) == ">" and ssub(line, 3, 3) ~= "<" then - -- vote called -- > [teh]cluster1[00] * [teh]N0by called a vote for command "stop" [!vote y, !vote n, !vote b] -- > [teh]cluster2[06] * [ur]mum called a vote for command "stop please" [!vote y, !vote n, !vote b] if sfind(line, " called a vote ", nil, true) then - -- find who started the vote, and see if we're allied local ownerPlayername = false local alliedWithVoteOwner = false @@ -412,7 +408,7 @@ function widget:AddConsoleLine(lines, priority) end weAreVoteOwner = (ownerPlayername == myPlayerName) - local title = ssub(line, sfind(line, ' "') + 2, sfind(line, '" ', nil, true) - 1) .. '?' + local title = ssub(line, sfind(line, ' "') + 2, sfind(line, '" ', nil, true) - 1) .. "?" title = title:sub(1, 1):upper() .. title:sub(2) if not isreplay then @@ -445,9 +441,9 @@ function widget:AddConsoleLine(lines, priority) for _, pID in ipairs(players) do local name, _, spec, teamID, allyTeamID = Spring.GetPlayerInfo(pID, false) name = ((WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(pID)) or name - local pos = sfind(title, ' '..name..' ', nil, true) + local pos = sfind(title, " " .. name .. " ", nil, true) if pos then - title = ssub(title, 1, pos-1).. colourNames(teamID) ..' '.. name ..' '.. titlecolor .. ssub(title, pos + string.len(' '..name..' ')) + title = ssub(title, 1, pos - 1) .. colourNames(teamID) .. " " .. name .. " " .. titlecolor .. ssub(title, pos + string.len(" " .. name .. " ")) break end end @@ -461,17 +457,15 @@ function widget:AddConsoleLine(lines, priority) minimized = false StartVote(title) end - - elseif voteDlist and not voteEndTime then -- > [teh]cluster1[00] * Vote for command "stop" passed. -- > [teh]cluster1[01] * Vote for command "forcestart" passed (delay expired, away vote mode activated for ArkanisLupus,ROBOTRONIC,d if sfind(line, "* Vote for command", nil, true) then voteEndTime = os.clock() + voteEndDelay if sfind(line, " passed", nil, true) then - voteEndText = Spring.I18N('ui.voting.votepassed') + voteEndText = Spring.I18N("ui.voting.votepassed") elseif sfind(line, " failed", nil, true) then - voteEndText = Spring.I18N('ui.voting.votefailed') + voteEndText = Spring.I18N("ui.voting.votefailed") end MinimizeVote() end @@ -480,12 +474,12 @@ function widget:AddConsoleLine(lines, priority) -- > [teh]cluster2[00] * Cancelling "gKick Raiser" vote (command executed directly by Flaka) if sfind(line, "* Vote cancelled", nil, true) or sfind(line, "* Game starting, cancelling ", nil, true) or sfind(line, " vote (command executed directly by ", nil, true) then voteEndTime = os.clock() + voteEndDelay - voteEndText = Spring.I18N('ui.voting.votecancelled') + voteEndText = Spring.I18N("ui.voting.votecancelled") MinimizeVote() end -- > [teh]cluster2[00] * [Z]kynet, you cannot vote currently, there is no vote in progress. if sfind(line, ", you cannot vote currently, there is no vote in progress.", nil, true) then - voteEndTime = os.clock() + (voteEndDelay*0.5) + voteEndTime = os.clock() + (voteEndDelay * 0.5) voteEndText = "-----" MinimizeVote() end @@ -493,7 +487,7 @@ function widget:AddConsoleLine(lines, priority) -- > [teh]cluster1[00] * 10 users allowed to vote. if voteDlist and sfind(slower(line), " users allowed to vote.", nil, true) then - local text = ssub(line, sfind(slower(line), "* ", nil, true)+2, sfind(slower(line), " users allowed to vote.", nil, true)-1) + local text = ssub(line, sfind(slower(line), "* ", nil, true) + 2, sfind(slower(line), " users allowed to vote.", nil, true) - 1) if text then votesEligible = tonumber(text) end @@ -503,25 +497,25 @@ function widget:AddConsoleLine(lines, priority) -- > [teh]cluster2[00] * Vote in progress: "resign Raghna TEAM" [y:2/4(3), n:0/2(3)] (57s remaining) -- > [teh]cluster2[00] * Vote in progress: "resign [teh]Teddy TEAM" [y:1/1(4), n:0/1(3), votes:1/3] (40s remaining) if voteDlist and sfind(slower(line), "vote in progress:", nil, true) then - local text = ssub(line, sfind(slower(line), "vote in progress:", nil, true)+18) - text = ssub(text, sfind(text, "\" [", nil, true)+3) - text = ssub(text, 1, sfind(text, "]", nil, true)-1) + local text = ssub(line, sfind(slower(line), "vote in progress:", nil, true) + 18) + text = ssub(text, sfind(text, '" [', nil, true) + 3) + text = ssub(text, 1, sfind(text, "]", nil, true) - 1) -- yes votes - local str = ssub(text, sfind(text, "y:", nil, true)+2) - local yesVotes = ssub(str, 1, sfind(str, "/", nil, true)-1) - local yesVotesNeeded = ssub(str, sfind(str, "/", nil, true)+1, sfind(str, ",", nil, true)-1) + local str = ssub(text, sfind(text, "y:", nil, true) + 2) + local yesVotes = ssub(str, 1, sfind(str, "/", nil, true) - 1) + local yesVotesNeeded = ssub(str, sfind(str, "/", nil, true) + 1, sfind(str, ",", nil, true) - 1) if yesVotesNeeded and sfind(yesVotesNeeded, "(", nil, true) then - yesVotesNeeded = ssub(yesVotesNeeded, 1, sfind(yesVotesNeeded, "(", nil, true)-1) + yesVotesNeeded = ssub(yesVotesNeeded, 1, sfind(yesVotesNeeded, "(", nil, true) - 1) end -- no votes - str = ssub(text, sfind(text, "n:", nil, true)+2) - local noVotes = ssub(str, 1, sfind(str, "/", nil, true)-1) - local noVotesNeeded = ssub(str, sfind(str, "/", nil, true)+1) + str = ssub(text, sfind(text, "n:", nil, true) + 2) + local noVotes = ssub(str, 1, sfind(str, "/", nil, true) - 1) + local noVotesNeeded = ssub(str, sfind(str, "/", nil, true) + 1) if sfind(str, ",", nil, true) then - noVotesNeeded = ssub(noVotesNeeded, 1, sfind(str, ",", nil, true)-1) + noVotesNeeded = ssub(noVotesNeeded, 1, sfind(str, ",", nil, true) - 1) end if noVotesNeeded and sfind(noVotesNeeded, "(", nil, true) then - noVotesNeeded = ssub(noVotesNeeded, 1, sfind(noVotesNeeded, "(", nil, true)-1) + noVotesNeeded = ssub(noVotesNeeded, 1, sfind(noVotesNeeded, "(", nil, true) - 1) end if yesVotes and yesVotesNeeded and noVotes and noVotesNeeded then yesVotesNeeded = tonumber(yesVotesNeeded) @@ -573,17 +567,14 @@ end function widget:DrawScreen() if voteDlist then - if not WG['topbar'] or not WG['topbar'].showingQuit() then + if not WG["topbar"] or not WG["topbar"].showingQuit() then if eligibleToVote then local x, y, b = spGetMouseState() if hovered then - StartVote() -- refresh + StartVote() -- refresh elseif windowArea and math_isInRect(x, y, windowArea[1], windowArea[2], windowArea[3], windowArea[4]) then - if not weAreVoteOwner and math_isInRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4]) or - math_isInRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) or - math_isInRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) - then - StartVote() -- refresh + if not weAreVoteOwner and math_isInRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4]) or math_isInRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) or math_isInRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) then + StartVote() -- refresh end end end diff --git a/luaui/Widgets/log_unitdefids.lua b/luaui/Widgets/log_unitdefids.lua index ce7ecbeeac9..7dc3955c561 100644 --- a/luaui/Widgets/log_unitdefids.lua +++ b/luaui/Widgets/log_unitdefids.lua @@ -1,24 +1,24 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Log UnitDefIDs", - desc = "Send UnitDefIDs as LuaRules message for demo parsing", - author = "Jazcash", - date = "2021-05-23", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Log UnitDefIDs", + desc = "Send UnitDefIDs as LuaRules message for demo parsing", + author = "Jazcash", + date = "2021-05-23", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end function widget:Initialize() - local result = {}; - for key, value in ipairs(UnitDefs) do - result[key] = value.name - end + local result = {} + for key, value in ipairs(UnitDefs) do + result[key] = value.name + end - local json = Json.encode(result); + local json = Json.encode(result) - Spring.SendLuaRulesMsg('unitdefs:' .. VFS.ZlibCompress(json)) + Spring.SendLuaRulesMsg("unitdefs:" .. VFS.ZlibCompress(json)) end diff --git a/luaui/Widgets/logo_adjuster.lua b/luaui/Widgets/logo_adjuster.lua index fe6e33f6d2a..034b6608d75 100644 --- a/luaui/Widgets/logo_adjuster.lua +++ b/luaui/Widgets/logo_adjuster.lua @@ -1,18 +1,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Logo adjuster", - desc = "Changes taskbar icon", - author = "Floris", - date = "June 2021", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Logo adjuster", + desc = "Changes taskbar icon", + author = "Floris", + date = "June 2021", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -21,7 +20,7 @@ local spGetMouseState = Spring.GetMouseState local doNotify = true local doBlink = true -local imgPrefix = 'bitmaps/logo' +local imgPrefix = "bitmaps/logo" local imagePlain2 = "2.png" local imageBattle = ".png" local imageBattleNotif = "_notif.png" @@ -40,9 +39,9 @@ local initialized = false local gameover = false local currentIcon = nil -- Track currently desired icon for periodic reapplication -local faction = '_a' -if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), 'startUnit')].name == 'corcom' then - faction = '_c' +local faction = "_a" +if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), "startUnit")].name == "corcom" then + faction = "_c" end local mouseOffscreen = select(6, spGetMouseState()) @@ -54,7 +53,9 @@ local function SetIcon(path) end function widget:Initialize() - if Platform.osName == "Windows 7" then widgetHandler.RemoveWidget() end -- changing the taskbar icon causes a few secs of freezing there + if Platform.osName == "Windows 7" then + widgetHandler.RemoveWidget() + end -- changing the taskbar icon causes a few secs of freezing there WG.logo = {} WG.logo.mention = function() if mouseOffscreen then @@ -65,65 +66,65 @@ end function widget:GameStart() local prevFaction = faction - if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), 'startUnit')].name == 'corcom' then - faction = '_c' + if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), "startUnit")].name == "corcom" then + faction = "_c" else - faction = '_a' + faction = "_a" end if prevFaction ~= faction then - SetIcon(imgPrefix..faction..imageBattle) + SetIcon(imgPrefix .. faction .. imageBattle) end end - function widget:Shutdown() - SetIcon(imgPrefix..imagePlain2) + SetIcon(imgPrefix .. imagePlain2) end function widget:GameOver() gameover = true - SetIcon(imgPrefix..faction..imageBattleGameover) + SetIcon(imgPrefix .. faction .. imageBattleGameover) end function widget:Update(dt) - if gameover then return end + if gameover then + return + end - if not initialized then -- this prevents icon being changed when still on loadscreen instead of doing it in widget:initialized + if not initialized then -- this prevents icon being changed when still on loadscreen instead of doing it in widget:initialized initialized = true - SetIcon(imgPrefix..faction..imageBattle) + SetIcon(imgPrefix .. faction .. imageBattle) end sec = sec + dt if sec > 1.25 then sec = 0 local gameFrame = spGetGameFrame() if gameFrame > 0 then - local _, gameSpeed, isPaused = Spring.GetGameSpeed() local newPaused = false - if gameFrame == previousGameFrame or gameSpeed == 0 then -- when host (admin) paused its just gamespeed 0 + if gameFrame == previousGameFrame or gameSpeed == 0 then -- when host (admin) paused its just gamespeed 0 newPaused = true end if newPaused then if not paused then - SetIcon(imgPrefix..faction..imageBattlePaused) + SetIcon(imgPrefix .. faction .. imageBattlePaused) paused = true end else if paused then - SetIcon(imgPrefix..faction..imageBattle) + SetIcon(imgPrefix .. faction .. imageBattle) paused = false end end else local prevFaction = faction - if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), 'startUnit')].name == 'corcom' then - faction = '_c' + if UnitDefs[Spring.GetTeamRulesParam(spGetMyTeamID(), "startUnit")].name == "corcom" then + faction = "_c" else - faction = '_a' + faction = "_a" end if prevFaction ~= faction then - SetIcon(imgPrefix..faction..imageBattle) + SetIcon(imgPrefix .. faction .. imageBattle) end end previousGameFrame = gameFrame @@ -135,15 +136,15 @@ function widget:Update(dt) if not mouseOffscreen then if prevMouseOffscreen then notif = false - SetIcon(imgPrefix..faction..(paused and imageBattlePaused or imageBattle)) + SetIcon(imgPrefix .. faction .. (paused and imageBattlePaused or imageBattle)) end else blink = not blink if mouseOffscreen and notif then if paused then - SetIcon(imgPrefix..faction..((doBlink and blink) and imageBattlePausedNotif2 or imageBattlePausedNotif)) + SetIcon(imgPrefix .. faction .. ((doBlink and blink) and imageBattlePausedNotif2 or imageBattlePausedNotif)) else - SetIcon(imgPrefix..faction..((doBlink and blink) and imageBattleNotif2 or imageBattleNotif)) + SetIcon(imgPrefix .. faction .. ((doBlink and blink) and imageBattleNotif2 or imageBattleNotif)) end end end diff --git a/luaui/Widgets/map_auto_mapmark_eraser.lua b/luaui/Widgets/map_auto_mapmark_eraser.lua index 2eadd4886a5..0bbf55d6a58 100644 --- a/luaui/Widgets/map_auto_mapmark_eraser.lua +++ b/luaui/Widgets/map_auto_mapmark_eraser.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Auto mapmark eraser", - desc = "Erases points after a period of time.", - author = "Shaman, Floris", - date = "24 Sept 2022", - license = "", - layer = 0, - enabled = true, + name = "Auto mapmark eraser", + desc = "Erases points after a period of time.", + author = "Shaman, Floris", + date = "24 Sept 2022", + license = "", + layer = 0, + enabled = true, } end @@ -18,26 +18,26 @@ local pointsToErase = {} local recentlyErased = {} function widget:Initialize() - WG['autoeraser'] = {} - WG['autoeraser'].getEraseTime = function() + WG["autoeraser"] = {} + WG["autoeraser"].getEraseTime = function() return eraseTime end - WG['autoeraser'].setEraseTime = function(value) + WG["autoeraser"].setEraseTime = function(value) eraseTime = value end - WG['autoeraser'].getRecentlyErased = function(value) -- so mapmarks fx widget can call this and wont activate on auto erasing + WG["autoeraser"].getRecentlyErased = function(value) -- so mapmarks fx widget can call this and wont activate on auto erasing return recentlyErased end end function widget:MapDrawCmd(playerID, cmdType, px, py, pz, arg1, arg2, arg3, arg4) -- cmdType can be 'erase', 'point', or 'line', arg1 is the text or line length(?) if cmdType ~= "erase" then - local f = frame + (eraseTime*30) + local f = frame + (eraseTime * 30) local count = pointsToErase[f] and #pointsToErase[f] or 0 if count == 0 then - pointsToErase[f] = {[1] = {px, py, pz, playerID}} + pointsToErase[f] = { [1] = { px, py, pz, playerID } } else - pointsToErase[f][count+1] = {px, py, pz, playerID} + pointsToErase[f][count + 1] = { px, py, pz, playerID } end end end @@ -48,7 +48,7 @@ function widget:GameFrame(f) for i = 1, #pointsToErase[f] do local point = pointsToErase[f][i] Spring.MarkerErasePosition(point[1], point[2], point[3], nil, true, point[4], true) - recentlyErased[#recentlyErased+1] = {f, point[1], point[2], point[3] } + recentlyErased[#recentlyErased + 1] = { f, point[1], point[2], point[3] } end pointsToErase[f] = nil end @@ -56,19 +56,18 @@ function widget:GameFrame(f) local newRecentlyErased = {} for i, params in ipairs(recentlyErased) do if params[1] + 10 > f then - newRecentlyErased[#newRecentlyErased+1] = params + newRecentlyErased[#newRecentlyErased + 1] = params end end recentlyErased = newRecentlyErased end end - function widget:GetConfigData() return { eraseTime = eraseTime, pointsToErase = pointsToErase, - version = 1 + version = 1, } end diff --git a/luaui/Widgets/map_draw_blocker.lua b/luaui/Widgets/map_draw_blocker.lua index 16ad6086a02..d2042124926 100644 --- a/luaui/Widgets/map_draw_blocker.lua +++ b/luaui/Widgets/map_draw_blocker.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Map Draw Blocker", - desc = "blocks map draws from spammers", - author = "BrainDamage", - date = "-", + name = "Map Draw Blocker", + desc = "blocks map draws from spammers", + author = "BrainDamage", + date = "-", license = "WTFPL", - layer = 0, + layer = 0, enabled = false, } end @@ -30,7 +30,7 @@ local timeFrame = 1 local secondTimer = 0 local function ClearCurrentBuffer() - for i,p in pairs(GetPlayerList()) do + for i, p in pairs(GetPlayerList()) do local playerDraw = drawCmds[p] if not playerDraw then playerDraw = {} @@ -39,7 +39,7 @@ local function ClearCurrentBuffer() playerDraw.labels = {} playerDraw.accumulator = 0 else - playerDraw.counters[currentCounter-counterNum] = nil + playerDraw.counters[currentCounter - counterNum] = nil playerDraw.counters[currentCounter] = playerDraw.accumulator playerDraw.accumulator = 0 end @@ -48,10 +48,10 @@ local function ClearCurrentBuffer() end local function CheckTresholds() - for player,data in pairs(drawCmds) do + for player, data in pairs(drawCmds) do local sum = 0 local iterationCount = 0 - for _,val in pairs(data.counters) do + for _, val in pairs(data.counters) do sum = sum + val iterationCount = iterationCount + 1 end @@ -60,12 +60,12 @@ local function CheckTresholds() local wasBlocked = data.blocked data.blocked = timerCmd if not wasBlocked then - Echo( Spring.I18N('ui.mapDrawBlocker.block', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) + Echo(Spring.I18N("ui.mapDrawBlocker.block", { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player, false) })) end end - if sum < unblocklimit and data.blocked and (currentCounter-data.blocked > unblocklimit ) then + if sum < unblocklimit and data.blocked and (currentCounter - data.blocked > unblocklimit) then data.blocked = false - Echo( Spring.I18N('ui.mapDrawBlocker.unblock', { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player,false) }) ) + Echo(Spring.I18N("ui.mapDrawBlocker.unblock", { player = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(player) or GetPlayerInfo(player, false) })) end end end @@ -79,7 +79,7 @@ function widget:Update(dt) secondTimer = secondTimer + dt if secondTimer > timeFrame then secondTimer = 0 - currentCounter = currentCounter +1 + currentCounter = currentCounter + 1 -- flip buffer ClearCurrentBuffer() CheckTresholds() @@ -95,7 +95,7 @@ function widget:MapDrawCmd(playerID, cmdType, startx, starty, startz, a, b, c) if drawCmds[playerID] and cmdType ~= "erase" then local weight = 10 -- point weight if cmdType == "line" then - weight = ((startx-a)^2+(starty-b)^2+(startz-c)^2)^0.5 * drawLinedistanceWeight + weight = ((startx - a) ^ 2 + (starty - b) ^ 2 + (startz - c) ^ 2) ^ 0.5 * drawLinedistanceWeight end drawCmds[playerID].accumulator = drawCmds[playerID].accumulator + weight return drawCmds[playerID].blocked diff --git a/luaui/Widgets/map_edge_extension2.lua b/luaui/Widgets/map_edge_extension2.lua index 7a7d6aea412..8a012f114eb 100644 --- a/luaui/Widgets/map_edge_extension2.lua +++ b/luaui/Widgets/map_edge_extension2.lua @@ -1,20 +1,18 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Map Edge Extension", - version = "v0.7", - desc = "Draws a mirrored map next to the edges of the real map", - author = "ivand", - date = "2020", - license = "GPL", - layer = 0, - enabled = true, - } + return { + name = "Map Edge Extension", + version = "v0.7", + desc = "Draws a mirrored map next to the edges of the real map", + author = "ivand", + date = "2020", + license = "GPL", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -27,10 +25,10 @@ local nightFactor = 1.0 local curvature = true local fogEffect = true -local mapBorderStyle = 'texture' -- either 'texture' or 'cutaway' +local mapBorderStyle = "texture" -- either 'texture' or 'cutaway' local gridSize = 32 -local gridSizeDeferred = 2*gridSize +local gridSizeDeferred = 2 * gridSize local hasBadCulling = false @@ -45,8 +43,8 @@ local mapSizeX, mapSizeZ = Game.mapSizeX, Game.mapSizeZ local gridTex = "LuaUI/Images/vr_grid_large.dds" local realTex = "$grass" -local colorTex = (mapBorderStyle == 'texture' and realTex) or gridTex -local normalTex = '$ssmf_normals' +local colorTex = (mapBorderStyle == "texture" and realTex) or gridTex +local normalTex = "$ssmf_normals" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -54,7 +52,6 @@ local normalTex = '$ssmf_normals' local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -126,7 +123,6 @@ void main() { } ]] - -- NoGS vertex shader: expands points to quads using explicit triangle lists local vsSrcNoGS = [[ #version 330 @@ -410,7 +406,6 @@ void main() { } ]] - --[[ Results: @@ -422,7 +417,8 @@ depth only (GBUFFER_COUNT ==0) 423fps 4 buffers: 379 fps 5 buffers: 370 fps -]]-- +]] +-- local fsSrc = [[ #version 330 @@ -646,7 +642,6 @@ void main() { local numPoints local mirrorParams = {} - function widget:Initialize() if not gl.CreateShader then -- no shader support, so just remove the widget itself, especially for headless widgetHandler:RemoveWidget() @@ -656,23 +651,23 @@ function widget:Initialize() widgetHandler:RemoveWidget(self) end - WG['mapedgeextension'] = {} - WG['mapedgeextension'].getBrightness = function() + WG["mapedgeextension"] = {} + WG["mapedgeextension"].getBrightness = function() return brightness end - WG['mapedgeextension'].setBrightness = function(value) + WG["mapedgeextension"].setBrightness = function(value) brightness = value --UpdateShader() end - WG['mapedgeextension'].getCurvature = function() + WG["mapedgeextension"].getCurvature = function() return curvature end - WG['mapedgeextension'].setCurvature = function(value) + WG["mapedgeextension"].setCurvature = function(value) curvature = value --UpdateShader() end - Spring.SendCommands("mapborder 1")--..(mapBorderStyle == 'cutaway' and "1" or "0")) + Spring.SendCommands("mapborder 1") --..(mapBorderStyle == 'cutaway' and "1" or "0")) if gl.GetMapRendering("voidGround") then restoreMapBorder = false @@ -702,27 +697,24 @@ function widget:Initialize() numPoints = (mapSizeX / gridSize) * (mapSizeZ / gridSize) terrainInstanceVBO:Define(9, { - {id = 0, name = "mirrorParams", size = 4}, + { id = 0, name = "mirrorParams", size = 4 }, }) terrainVAO:AttachInstanceBuffer(terrainInstanceVBO) - - terrainInstanceVBODeferred = gl.GetVBO(GL.ARRAY_BUFFER, true) terrainInstanceVBODeferred:Define(9, { - {id = 1, name = "mirrorParams", size = 4}, + { id = 1, name = "mirrorParams", size = 4 }, }) - local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1,1,Game.mapSizeX/gridSizeDeferred,Game.mapSizeZ/gridSizeDeferred) - local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(Game.mapSizeX/gridSizeDeferred,Game.mapSizeZ/gridSizeDeferred) + local planeVBO, numVertices = InstanceVBOTable.makePlaneVBO(1, 1, Game.mapSizeX / gridSizeDeferred, Game.mapSizeZ / gridSizeDeferred) + local planeIndexVBO, numIndices = InstanceVBOTable.makePlaneIndexVBO(Game.mapSizeX / gridSizeDeferred, Game.mapSizeZ / gridSizeDeferred) planeVAO = gl.GetVAO() planeVAO:AttachVertexBuffer(planeVBO) planeVAO:AttachIndexBuffer(planeIndexVBO) planeVAO:AttachInstanceBuffer(terrainInstanceVBODeferred) - hasBadCulling = ((Platform.gpuVendor == "AMD" and Platform.osFamily == "Linux") == false) --spEcho(gsSrc) local engineUniformBufferDefs = LuaShader.GetEngineUniformBufferDefs() @@ -743,7 +735,7 @@ function widget:Initialize() mapNormalTex = 2, }, uniformFloat = { - shaderParams = {gridSize, brightness, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0}, + shaderParams = { gridSize, brightness, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0 }, }, } @@ -779,19 +771,18 @@ function widget:Initialize() return end - vsSrcDeferred = vsSrcDeferred:gsub("//__ENGINEUNIFORMBUFFERDEFS__", engineUniformBufferDefs) mapExtensionShaderDeferred = LuaShader({ - vertex = vsSrcDeferred:gsub("//__DEFINES__","#define DEFERRED_MODE 1"), + vertex = vsSrcDeferred:gsub("//__DEFINES__", "#define DEFERRED_MODE 1"), --geometry = gsSrc:gsub("//__DEFINES__","#define DEFERRED_MODE 1"), - fragment = fsSrc:gsub("//__DEFINES__","#define DEFERRED_MODE 1"), + fragment = fsSrc:gsub("//__DEFINES__", "#define DEFERRED_MODE 1"), uniformInt = { colorTex = 0, heightTex = 1, mapNormalTex = 2, }, uniformFloat = { - shaderParams = {gridSize, brightness, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0}, + shaderParams = { gridSize, brightness, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0 }, }, }, "Map Extension Shader Deferred") local shaderCompiled = mapExtensionShaderDeferred:Initialize() @@ -811,7 +802,7 @@ function widget:Initialize() end function widget:Shutdown() - Spring.SendCommands('mapborder '..(restoreMapBorder and '1' or '0')) + Spring.SendCommands("mapborder " .. (restoreMapBorder and "1" or "0")) if mapExtensionShader and mapExtensionShader.shaderObj ~= nil then mapExtensionShader:Finalize() @@ -836,16 +827,16 @@ function widget:Shutdown() end local borderMargin = 40 -local cachedCameraPosDir = {0, 0, 0, 0, 0, 0} +local cachedCameraPosDir = { 0, 0, 0, 0, 0, 0 } local function UpdateMirrorParams() local function Distance2(x1, y1, z1, x2, y2, z2) local dx, dy, dz = x1 - x2, y1 - y2, z1 - z2 - return dx*dx + dy*dy + dz*dz + return dx * dx + dy * dy + dz * dz end -- presumes normalized vectors local function DotProduct(x1, y1, z1, x2, y2, z2) - return x1*x2 + y1*y2 + z1*z2 + return x1 * x2 + y1 * y2 + z1 * z2 end local cpX, cpY, cpZ = Spring.GetCameraPosition() @@ -877,69 +868,68 @@ local function UpdateMirrorParams() -- spIsAABBInView params are copied from map_edge_extension.lua if spIsAABBInView(-Game.mapSizeX, minY, -Game.mapSizeZ, borderMargin, maxY, borderMargin) then --TL {1, 1, -1, -1} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 mirrorParams[#mirrorParams + 1] = -1 mirrorParams[#mirrorParams + 1] = -1 end if spIsAABBInView(-Game.mapSizeX, minY, -borderMargin, 0, maxY, Game.mapSizeZ) then --ML {1, 0, -1, 0} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 mirrorParams[#mirrorParams + 1] = -1 - mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 0 end if spIsAABBInView(-Game.mapSizeX, minY, Game.mapSizeZ - borderMargin, borderMargin, maxY, Game.mapSizeZ * 2) then --BL {1, 1, -1, 1} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 mirrorParams[#mirrorParams + 1] = -1 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 end if spIsAABBInView(-borderMargin, minY, -Game.mapSizeZ, Game.mapSizeX + borderMargin, maxY, borderMargin) then --TM {0, 1, 0, -1} - mirrorParams[#mirrorParams + 1] = 0 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 mirrorParams[#mirrorParams + 1] = -1 end if spIsAABBInView(-borderMargin, minY, Game.mapSizeZ * 2, Game.mapSizeX + borderMargin, maxY, Game.mapSizeZ - borderMargin) then --BM {0, 1, 0, 1} - mirrorParams[#mirrorParams + 1] = 0 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 0 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 end if spIsAABBInView(Game.mapSizeX - borderMargin, minY, -Game.mapSizeZ, Game.mapSizeX * 2, maxY, borderMargin) then --TR {1, 1, 1, -1} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 mirrorParams[#mirrorParams + 1] = -1 end if spIsAABBInView(Game.mapSizeX - borderMargin, minY, -borderMargin, Game.mapSizeX * 2, maxY, Game.mapSizeZ) then --MR {1, 0, 1, 0} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 0 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 0 end if spIsAABBInView(Game.mapSizeX - borderMargin, minY, Game.mapSizeZ - borderMargin, Game.mapSizeX * 2, maxY, Game.mapSizeZ * 2) then --BR {1, 1, 1, 1} - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 - mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 + mirrorParams[#mirrorParams + 1] = 1 end if #mirrorParams > 0 then - terrainInstanceVBODeferred:Upload(mirrorParams) -- EXTREMELY IMPORTANT: @@ -952,31 +942,30 @@ local function UpdateMirrorParams() end end - - -- depth defaults: --[[ false false GL_DEPTH_FUNC = GL_ALWAYS -]]-- +]] +-- -- blending defaults: --[[ true GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA -]]-- +]] +-- -- culling defaults --[[ false GL_CULL_FACE_MODE = GL_BACK -]]-- - +]] +-- -- This requires both the callin and the config int to be enabled -- Note that the performance of this draw call is somehow much greater than the screen space one. Very sad :? - function widget:DrawGroundDeferred() --spEcho("widget:DrawGroundDeferred") if #mirrorParams == 0 then @@ -992,17 +981,17 @@ function widget:DrawGroundDeferred() --gl.DepthTest(GL.LEQUAL) --gl.DepthMask(true) - --gl.Culling(false) -- needed for deferred one, as flipping fucks tri order + --gl.Culling(false) -- needed for deferred one, as flipping fucks tri order gl.Texture(0, colorTex) gl.Texture(1, "$heightmap") gl.Texture(2, "$normals") mapExtensionShaderDeferred:Activate() mapExtensionShaderDeferred:SetUniform("shaderParams", gridSize, brightness * nightFactor, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0) --gl.RunQuery(q, function() - --terrainVAO:DrawArrays(GL.POINTS, numPoints, 0, #mirrorParams / 4) - --planeVAO:DrawElements(GL.TRIANGLES, 1000, 0, 8 ,0) - -- draw one less element as that is unmirrored one for the seam - planeVAO:DrawElements(GL.TRIANGLES, nil, 0, math.max(0, (#mirrorParams / 4)-1) ) + --terrainVAO:DrawArrays(GL.POINTS, numPoints, 0, #mirrorParams / 4) + --planeVAO:DrawElements(GL.TRIANGLES, 1000, 0, 8 ,0) + -- draw one less element as that is unmirrored one for the seam + planeVAO:DrawElements(GL.TRIANGLES, nil, 0, math.max(0, (#mirrorParams / 4) - 1)) --end) mapExtensionShaderDeferred:Deactivate() gl.Texture(0, false) @@ -1013,10 +1002,8 @@ function widget:DrawGroundDeferred() --gl.DepthTest(false) --gl.DepthMask(false) gl.Culling(GL.BACK) - end - function widget:DrawWorldPreUnit() UpdateMirrorParams() @@ -1039,14 +1026,14 @@ function widget:DrawWorldPreUnit() mapExtensionShader:Activate() mapExtensionShader:SetUniform("shaderParams", gridSize, brightness * nightFactor, (curvature and 1.0) or 0.0, (fogEffect and 1.0) or 0.0) --gl.RunQuery(q, function() - if mapEdgeUseGeometryShader then - -- GS mode: draw points, geometry shader expands to quads - terrainVAO:DrawArrays(GL.POINTS, numPoints, 0, #mirrorParams / 4) - else - -- NoGS mode: draw explicit triangles (6 vertices per point) - -- Skip the synthetic zero-mirror seam instance here; it is handled by the GS path only. - terrainVAO:DrawArrays(GL.TRIANGLES, numPoints * 6, 0, math.max(0, (#mirrorParams / 4) - 1)) - end + if mapEdgeUseGeometryShader then + -- GS mode: draw points, geometry shader expands to quads + terrainVAO:DrawArrays(GL.POINTS, numPoints, 0, #mirrorParams / 4) + else + -- NoGS mode: draw explicit triangles (6 vertices per point) + -- Skip the synthetic zero-mirror seam instance here; it is handled by the GS path only. + terrainVAO:DrawArrays(GL.TRIANGLES, numPoints * 6, 0, math.max(0, (#mirrorParams / 4) - 1)) + end --end) mapExtensionShader:Deactivate() gl.Texture(0, false) @@ -1071,11 +1058,10 @@ function widget:GetConfigData(data) return { brightness = brightness, curvature = curvature, - fogEffect = fogEffect + fogEffect = fogEffect, } end - function widget:SetConfigData(data) if data.brightness ~= nil then brightness = data.brightness diff --git a/luaui/Widgets/map_grass_gl4.lua b/luaui/Widgets/map_grass_gl4.lua index b15d329b042..74ea90b940a 100644 --- a/luaui/Widgets/map_grass_gl4.lua +++ b/luaui/Widgets/map_grass_gl4.lua @@ -1,6 +1,6 @@ local isPotatoGpu = false local gpuMem = (Platform.gpuMemorySize and Platform.gpuMemorySize or 1000) / 1000 -if Platform ~= nil and Platform.gpuVendor == 'Intel' then +if Platform ~= nil and Platform.gpuVendor == "Intel" then isPotatoGpu = true end if gpuMem and gpuMem > 0 and gpuMem < 1800 then @@ -10,19 +10,18 @@ end local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Map Grass GL4", - version = "1.0", - desc = "Instanced rendering of custom grass", - author = "Beherith (mysterme@gmail.com)", - date = "2021.04.12", - license = "GNU GPL, v2", - layer = -999999, - enabled = not isPotatoGpu, - } + return { + name = "Map Grass GL4", + version = "1.0", + desc = "Instanced rendering of custom grass", + author = "Beherith (mysterme@gmail.com)", + date = "2021.04.12", + license = "GNU GPL, v2", + layer = -999999, + enabled = not isPotatoGpu, + } end - -- Localized functions for performance local mathAbs = math.abs local mathFloor = math.floor @@ -54,13 +53,13 @@ local spGetVisibleUnits = Spring.GetVisibleUnits -- /editgrass : allows you to edit the already defined grass (either from mapSMFgrass, or grassDistTGA, if specified) -- /dumpgrassshaders : dumps shaders -- UI to paint grass: - -- Once placement mode has been toggled with /loadgrass or /cleargrass or /editgrass - -- use the '[' and ']' keys to change brush size - -- use the left mouse button to make the grass grow, right mouse button to make it small/disappear - -- hold shift to paint max height grass/ fully remove grass - -- I also recommend binding toggle grass widget to alt+f for fast colorization reloading in uikeys.txt - -- If you want to change colorization, and want to save your 'painting progress', do /savegrass, reload the widget, then /loadgrass - -- NOTE: Shader load is MUCH higher in editing mode, and especially on large maps (pushing 10's of millions of vertices) +-- Once placement mode has been toggled with /loadgrass or /cleargrass or /editgrass +-- use the '[' and ']' keys to change brush size +-- use the left mouse button to make the grass grow, right mouse button to make it small/disappear +-- hold shift to paint max height grass/ fully remove grass +-- I also recommend binding toggle grass widget to alt+f for fast colorization reloading in uikeys.txt +-- If you want to change colorization, and want to save your 'painting progress', do /savegrass, reload the widget, then /loadgrass +-- NOTE: Shader load is MUCH higher in editing mode, and especially on large maps (pushing 10's of millions of vertices) -- Load Order -- 1. Parse Mapinfo @@ -85,39 +84,39 @@ local spGetVisibleUnits = Spring.GetVisibleUnits --------- HOW TO CONFIGURE GRASS (also important!) ------------------------- local grassConfig = { - patchResolution = 32, -- distance between patches, default is 32, which matches the SpringRTS grass map resolution. If using external .tga, you can use any resolution you wish - patchPlacementJitter = 0.66, -- how much each patch should be randomized in XZ position, in fraction of patchResolution - patchSize = 4, -- 1 or 4 clusters of blades, 4 recommended - grassMinSize = 0.3; --Size for grassmap value of 1 , min and max should be equal for old style binary grassmap (because its only 0,1) - grassMaxSize = 1.7; -- Size for grassmap value of 254 - grassShaderParams = { -- allcaps because thats how i know - MAPCOLORFACTOR = 0.6, -- how much effect the minimapcolor has - MAPCOLORBASE = 1.0, --how much more to blend the bottom of the grass patches into map color - ALPHATHRESHOLD = 0.01,--alpha limit under which to discard a fragment - WINDSTRENGTH = 0.1, -- how much the wind will blow the grass - WINDSCALE = 0.33, -- how fast the wind texture moves - WINDSAMPLESCALE = 0.001, -- tiling resolution of the noise texture - FADESTART = 5000,-- distance at which grass starts to fade - FADEEND = 8000,--distance at which grass completely fades out - SHADOWFACTOR = 0.25, -- how much shadowed grass gets darkened, lower values mean more shadows - HASSHADOWS = 1, -- 0 for disable, no real difference in this (does not work yet) - GRASSBRIGHTNESS = 1.0; -- this is for future dark mode - COMPACTVBO = 1, -- if set to 1, then the grass patch vbo will be compacted to 8 vertices per patch, otherwise it will be 17 vertices per patch - UNITBENDENABLED = 1, -- 1 to enable grass bending away from units, 0 to disable - UNITBENDSTRENGTH = 5.5, -- how strongly grass bends away from nearby units - UNITBENDFALLOFF = 0.8, -- falloff exponent for bending effect (higher = sharper falloff) - UNITBENDSHRINK = 0.55, -- how much grass shrinks near unit center (0 = no shrink, 1 = fully gone) - }, - grassBladeColorTex = "LuaUI/Images/luagrass/grass_field_medit_flowering.dds.cached.dds", -- rgb + alpha transp - mapGrassColorModTex = "$grass", -- by default this means that grass will be colorized with the minimap - grassWindPerturbTex = "bitmaps/GPL/perlin_noise.jpg", -- rgba of various frequencies of perlin noise? - grassWindMult = 4.5, -- how 'strong' the perturbation effect is - maxWindSpeed = 20, -- the fastest the wind noise texture will ever move, - -- The grassdisttex overrides the default map grass, if specified! - grassDistTGA = "", -- MUST BE 8 bit uncompressed TGA, sized Game.mapSize* / patchResolution, where 0 is no grass, and 1<= controls grass size. + patchResolution = 32, -- distance between patches, default is 32, which matches the SpringRTS grass map resolution. If using external .tga, you can use any resolution you wish + patchPlacementJitter = 0.66, -- how much each patch should be randomized in XZ position, in fraction of patchResolution + patchSize = 4, -- 1 or 4 clusters of blades, 4 recommended + grassMinSize = 0.3, --Size for grassmap value of 1 , min and max should be equal for old style binary grassmap (because its only 0,1) + grassMaxSize = 1.7, -- Size for grassmap value of 254 + grassShaderParams = { -- allcaps because thats how i know + MAPCOLORFACTOR = 0.6, -- how much effect the minimapcolor has + MAPCOLORBASE = 1.0, --how much more to blend the bottom of the grass patches into map color + ALPHATHRESHOLD = 0.01, --alpha limit under which to discard a fragment + WINDSTRENGTH = 0.1, -- how much the wind will blow the grass + WINDSCALE = 0.33, -- how fast the wind texture moves + WINDSAMPLESCALE = 0.001, -- tiling resolution of the noise texture + FADESTART = 5000, -- distance at which grass starts to fade + FADEEND = 8000, --distance at which grass completely fades out + SHADOWFACTOR = 0.25, -- how much shadowed grass gets darkened, lower values mean more shadows + HASSHADOWS = 1, -- 0 for disable, no real difference in this (does not work yet) + GRASSBRIGHTNESS = 1.0, -- this is for future dark mode + COMPACTVBO = 1, -- if set to 1, then the grass patch vbo will be compacted to 8 vertices per patch, otherwise it will be 17 vertices per patch + UNITBENDENABLED = 1, -- 1 to enable grass bending away from units, 0 to disable + UNITBENDSTRENGTH = 5.5, -- how strongly grass bends away from nearby units + UNITBENDFALLOFF = 0.8, -- falloff exponent for bending effect (higher = sharper falloff) + UNITBENDSHRINK = 0.55, -- how much grass shrinks near unit center (0 = no shrink, 1 = fully gone) + }, + grassBladeColorTex = "LuaUI/Images/luagrass/grass_field_medit_flowering.dds.cached.dds", -- rgb + alpha transp + mapGrassColorModTex = "$grass", -- by default this means that grass will be colorized with the minimap + grassWindPerturbTex = "bitmaps/GPL/perlin_noise.jpg", -- rgba of various frequencies of perlin noise? + grassWindMult = 4.5, -- how 'strong' the perturbation effect is + maxWindSpeed = 20, -- the fastest the wind noise texture will ever move, + -- The grassdisttex overrides the default map grass, if specified! + grassDistTGA = "", -- MUST BE 8 bit uncompressed TGA, sized Game.mapSize* / patchResolution, where 0 is no grass, and 1<= controls grass size. } -local nightFactor = {1,1,1,1} +local nightFactor = { 1, 1, 1, 1 } local distanceMult = 0.45 @@ -127,90 +126,90 @@ local MAX_BEND_UNITS = 128 -- map custom config -- if map has a custom mapinfo.lua configuration, then merge the keys of it with our config table -local success, mapcfg = pcall(VFS.Include,"mapinfo.lua") -- load mapinfo.lua confs +local success, mapcfg = pcall(VFS.Include, "mapinfo.lua") -- load mapinfo.lua confs if not success then - spEcho("Map Grass GL4 failed to find a mapinfo.lua, using default configs") + spEcho("Map Grass GL4 failed to find a mapinfo.lua, using default configs") else - if mapcfg and mapcfg.custom and mapcfg.custom.grassconfig then - spEcho("Loading LuaGrass custom parameters from mapinfo.lua") - for k,v in pairs(mapcfg.custom.grassconfig) do - - for kUp, _ in pairs(grassConfig) do - if k == string.lower(kUp) then k = kUp end - end - --spEcho("Found grass params",k,v) - - if string.lower(k) == "grassshaderparams" then - for k2,v2 in pairs(v) do - for k2Up, _ in pairs(grassConfig.grassShaderParams) do - --spEcho("Found grass params",k2,k2Up,v2) - if k2 == string.lower(k2Up) then k2 = k2Up end + if mapcfg and mapcfg.custom and mapcfg.custom.grassconfig then + spEcho("Loading LuaGrass custom parameters from mapinfo.lua") + for k, v in pairs(mapcfg.custom.grassconfig) do + for kUp, _ in pairs(grassConfig) do + if k == string.lower(kUp) then + k = kUp + end + end + --spEcho("Found grass params",k,v) + + if string.lower(k) == "grassshaderparams" then + for k2, v2 in pairs(v) do + for k2Up, _ in pairs(grassConfig.grassShaderParams) do + --spEcho("Found grass params",k2,k2Up,v2) + if k2 == string.lower(k2Up) then + k2 = k2Up + end + end + grassConfig[k][k2] = v2 + end + else + grassConfig[k] = v end - grassConfig[k][k2]=v2 - end - else - grassConfig[k] = v - end - end - end + end + end end -spEcho("Map is",Game.mapName) +spEcho("Map is", Game.mapName) -----------------------Old Map Overrides------------------- -local mapoverrides = { - ["DSDR 4.0"] = { - --grassDistTGA = "DSDR 4.0_grassDist.tga", - grassMaxSize = 2.0 ; -- Size for grassmap value of 254 - grassShaderParams = { - MAPCOLORFACTOR = 0.6, - }, - }, - ["DeltaSiegeDry"] = { - patchResolution = 32, - grassShaderParams = { - MAPCOLORFACTOR = 0.6, - SHADOWFACTOR = 0.001, - }, - }, - ["Pentos_V1"] = { - patchResolution = 32, - grassShaderParams = { - MAPCOLORFACTOR = 0.6, - }, - - }, - ["Taldarim_V3"] = { - patchResolution = 32, - grassShaderParams = { - MAPCOLORFACTOR = 0.5, - }, - grassDistTGA = "LuaUI/Images/luagrass/Taldarim_V3_grassDist.tga", - }, - ["Altair_Crossing_V4"] = { - patchResolution = 32, - grassMinSize = 0.5; --Size for grassmap value of 1 , min and max should be equal for old style binary grassmap (because its only 0,1) - grassMaxSize = 2.0; -- Size for grassmap value of 254 - grassShaderParams = { - MAPCOLORFACTOR = -1.2, - }, - - }, +local mapoverrides = { + ["DSDR 4.0"] = { + --grassDistTGA = "DSDR 4.0_grassDist.tga", + grassMaxSize = 2.0, -- Size for grassmap value of 254 + grassShaderParams = { + MAPCOLORFACTOR = 0.6, + }, + }, + ["DeltaSiegeDry"] = { + patchResolution = 32, + grassShaderParams = { + MAPCOLORFACTOR = 0.6, + SHADOWFACTOR = 0.001, + }, + }, + ["Pentos_V1"] = { + patchResolution = 32, + grassShaderParams = { + MAPCOLORFACTOR = 0.6, + }, + }, + ["Taldarim_V3"] = { + patchResolution = 32, + grassShaderParams = { + MAPCOLORFACTOR = 0.5, + }, + grassDistTGA = "LuaUI/Images/luagrass/Taldarim_V3_grassDist.tga", + }, + ["Altair_Crossing_V4"] = { + patchResolution = 32, + grassMinSize = 0.5, --Size for grassmap value of 1 , min and max should be equal for old style binary grassmap (because its only 0,1) + grassMaxSize = 2.0, -- Size for grassmap value of 254 + grassShaderParams = { + MAPCOLORFACTOR = -1.2, + }, + }, } if mapoverrides[Game.mapName] then - spEcho("Overriding map grass") - for k,v in pairs(mapoverrides[Game.mapName]) do - if k == "grassShaderParams" then - for k2,v2 in pairs(v) do - grassConfig[k][k2]=v2 - end - else - grassConfig[k] = v - end - end + spEcho("Overriding map grass") + for k, v in pairs(mapoverrides[Game.mapName]) do + if k == "grassShaderParams" then + for k2, v2 in pairs(v) do + grassConfig[k][k2] = v2 + end + else + grassConfig[k] = v + end + end end - -------------------------------------------------------------------------------- local patchResolution = grassConfig.patchResolution local spGetGroundHeight = Spring.GetGroundHeight @@ -223,9 +222,9 @@ local removedBelowHeight local lastLavaLevel local lavaCheckInterval = 30 -- check every N game frames -local processChanges = false -- auto enabled when map has grass or editmode toggles +local processChanges = false -- auto enabled when map has grass or editmode toggles -local mousepos = {0,0,0} +local mousepos = { 0, 0, 0 } local cursorradius = 50 local removeUnitGrassFrames = 25 local placementMode = false -- this controls wether we are in 'game mode' or placement map dev mode @@ -248,7 +247,7 @@ local grassPatchCount = 0 local LuaShader = gl.LuaShader local InstanceVBOTable = gl.InstanceVBOTable -local grassRowInstance = {0} -- a table of row, instanceidx from top side of the view +local grassRowInstance = { 0 } -- a table of row, instanceidx from top side of the view local windDirX = 0 local windDirZ = 0 @@ -270,7 +269,9 @@ end local unitBendSSBO = nil local unitBendData = {} local unitBendCount = 0 -for i = 1, MAX_BEND_UNITS * 4 do unitBendData[i] = 0 end +for i = 1, MAX_BEND_UNITS * 4 do + unitBendData[i] = 0 +end local unitBendRadius = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -293,7 +294,9 @@ local nextUnitScanGF = 0 local function scanUnitPositions(gf) -- When previously skipped, avoid all API calls until recheck time - if gf < skipBendUntilGF then return end + if gf < skipBendUntilGF then + return + end local cx, cy, cz = spGetCameraPosition() local gh = Spring.GetGroundHeight(cx, cz) or 0 @@ -335,7 +338,7 @@ local function scanUnitPositions(gf) if entry then entry[1], entry[2], entry[3] = ux, uz, radius + 15 else - cachedUnitList[count] = {ux, uz, radius + 15} + cachedUnitList[count] = { ux, uz, radius + 15 } end end end @@ -347,10 +350,14 @@ local function scanUnitPositions(gf) end local function updateUnitBendSSBO() - if not unitBendSSBO then return end + if not unitBendSSBO then + return + end -- Skip upload if nothing changed - if not unitScanDirty and lastUploadedCount == cachedUnitCount then return end + if not unitScanDirty and lastUploadedCount == cachedUnitCount then + return + end unitScanDirty = false -- Pack SSBO from cached unit list (indexed array, no pairs()) @@ -377,52 +384,54 @@ local function updateUnitBendSSBO() end local function goodbye(reason) - spEcho("Map Grass GL4 widget exiting with reason: "..reason) - if grassPatchVBO then grassPatchVBO = nil end - if grassInstanceVBO then grassInstanceVBO = nil end - if unitBendSSBO then unitBendSSBO = nil end - if grassVAO then grassVAO = nil end - --if grassShader then grassShader:Finalize() end - widgetHandler:RemoveWidget() + spEcho("Map Grass GL4 widget exiting with reason: " .. reason) + if grassPatchVBO then + grassPatchVBO = nil + end + if grassInstanceVBO then + grassInstanceVBO = nil + end + if unitBendSSBO then + unitBendSSBO = nil + end + if grassVAO then + grassVAO = nil + end + --if grassShader then grassShader:Finalize() end + widgetHandler:RemoveWidget() end -------------------------------------------------------------------------------- -- using: http://ogldev.atspace.co.uk/www/tutorial33/tutorial33.html local function makeGrassPatchVBO(grassPatchSize) -- grassPatchSize = 1|4, see the commented out python section at the bottom to make a custom vbo - grassPatchVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if grassPatchVBO == nil then goodbye("No LuaVAO support") end + grassPatchVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if grassPatchVBO == nil then + goodbye("No LuaVAO support") + end - local VBOLayout= { {id = 0, name = "position", size = 3}, - {id = 1, name = "normal", size = 3}, - {id = 2, name = "stangent", size = 3}, - {id = 3, name = "ttangent", size = 3}, - {id = 4, name = "texcoords0", size = 2}, - {id = 5, name = "texcoords1", size = 2}, - {id = 6, name = "pieceindex", size = 1},} --khm, this should be unsigned int + local VBOLayout = { { id = 0, name = "position", size = 3 }, { id = 1, name = "normal", size = 3 }, { id = 2, name = "stangent", size = 3 }, { id = 3, name = "ttangent", size = 3 }, { id = 4, name = "texcoords0", size = 2 }, { id = 5, name = "texcoords1", size = 2 }, { id = 6, name = "pieceindex", size = 1 } } --khm, this should be unsigned int local VBOData = VFS.Include("LuaUI/Include/grassPatches.lua") if grassPatchSize == 1 then grassPatchVBOsize = 36 VBOData = VBOData[1] - elseif grassPatchSize == 4 then grassPatchVBOsize = 144 VBOData = VBOData[4] end -- What if we went down to 8 vertices? if grassConfig.grassShaderParams.COMPACTVBO == 1 then - - VBOLayout= { {id = 0, name = "pos_u"},{id = 1, name = "norm_v"}} + VBOLayout = { { id = 0, name = "pos_u" }, { id = 1, name = "norm_v" } } local compactVBO = {} for v = 1, grassPatchVBOsize do - compactVBO[8 * (v-1) + 1] = VBOData[17 * (v-1) + 1] -- px - compactVBO[8 * (v-1) + 2] = VBOData[17 * (v-1) + 2] -- py - compactVBO[8 * (v-1) + 3] = VBOData[17 * (v-1) + 3] -- pz - compactVBO[8 * (v-1) + 4] = VBOData[17 * (v-1) + 13] -- u - compactVBO[8 * (v-1) + 5] = VBOData[17 * (v-1) + 4] -- nx - compactVBO[8 * (v-1) + 6] = VBOData[17 * (v-1) + 5] -- ny - compactVBO[8 * (v-1) + 7] = VBOData[17 * (v-1) + 6] -- nz - compactVBO[8 * (v-1) + 8] = VBOData[17 * (v-1) + 14] -- v + compactVBO[8 * (v - 1) + 1] = VBOData[17 * (v - 1) + 1] -- px + compactVBO[8 * (v - 1) + 2] = VBOData[17 * (v - 1) + 2] -- py + compactVBO[8 * (v - 1) + 3] = VBOData[17 * (v - 1) + 3] -- pz + compactVBO[8 * (v - 1) + 4] = VBOData[17 * (v - 1) + 13] -- u + compactVBO[8 * (v - 1) + 5] = VBOData[17 * (v - 1) + 4] -- nx + compactVBO[8 * (v - 1) + 6] = VBOData[17 * (v - 1) + 5] -- ny + compactVBO[8 * (v - 1) + 7] = VBOData[17 * (v - 1) + 6] -- nz + compactVBO[8 * (v - 1) + 8] = VBOData[17 * (v - 1) + 14] -- v end VBOData = compactVBO end @@ -435,11 +444,11 @@ local function makeGrassPatchVBO(grassPatchSize) -- grassPatchSize = 1|4, see th -- Try making an indexVBO too -- NOTE THAT THIS DOES NOT WORK YET! - grassPatchIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER,false) -- order is 1 2 3 3 4 1 + grassPatchIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) -- order is 1 2 3 3 4 1 grassPatchIndexVBO:Define(grassPatchVBOsize * 6) -- 6 indices per patch local indexVBO = {} for i = 1, grassPatchVBOsize do - local baseidx = 6*(i-1) + local baseidx = 6 * (i - 1) indexVBO[baseidx + 1] = baseidx indexVBO[baseidx + 2] = baseidx + 1 indexVBO[baseidx + 3] = baseidx + 2 @@ -449,62 +458,62 @@ local function makeGrassPatchVBO(grassPatchSize) -- grassPatchSize = 1|4, see th end grassPatchIndexVBO:Upload(indexVBO) - grassPatchVBO:Upload(VBOData) end -local function fsrand(a,b) -- fast, repeatable random vec2 - local s = math.sin((a*12.9898 + b*78.233)) - return math.fract(s* 43758.5453), math.fract(s* 41758.5453) +local function fsrand(a, b) -- fast, repeatable random vec2 + local s = math.sin((a * 12.9898 + b * 78.233)) + return math.fract(s * 43758.5453), math.fract(s * 41758.5453) end local function testForGrass(mx, mz) - if grassConfig.obeyGrassMap then - if (spGetGrass(mx,mz) == 1) then - return spGetGroundHeight(mx,mz) - else - return nil - end - else - local gx, gy, gz, gs = Spring.GetGroundNormal (mx,mz ) - local gh = spGetGroundHeight(mx,mz) - if (gh > grassConfig.grassMinHeight) and - (gh < grassConfig.grassMaxHeight) and - (gy > grassConfig.grassMaxSlope) then - return gh - else - return nil - end - end + if grassConfig.obeyGrassMap then + if spGetGrass(mx, mz) == 1 then + return spGetGroundHeight(mx, mz) + else + return nil + end + else + local gx, gy, gz, gs = Spring.GetGroundNormal(mx, mz) + local gh = spGetGroundHeight(mx, mz) + if (gh > grassConfig.grassMinHeight) and (gh < grassConfig.grassMaxHeight) and (gy > grassConfig.grassMaxSlope) then + return gh + else + return nil + end + end end - local function mapHasSMFGrass() -- returns 255 is SMF has no grass, 0 if map has no grass, 1 if map has old style binary grass, 2<= <=254 if map has new style uint grass - local highestgrassmapvalue = 0 - local patchResolution = 32 - - for x = patchResolution / 2, mapSizeX, patchResolution do - for z = patchResolution / 2, mapSizeZ, patchResolution do - local localgrass = spGetGrass(x,z) - if (localgrass == 255) then - return 255 - else - highestgrassmapvalue = mathMax(highestgrassmapvalue, localgrass) + local highestgrassmapvalue = 0 + local patchResolution = 32 + + for x = patchResolution / 2, mapSizeX, patchResolution do + for z = patchResolution / 2, mapSizeZ, patchResolution do + local localgrass = spGetGrass(x, z) + if localgrass == 255 then + return 255 + else + highestgrassmapvalue = mathMax(highestgrassmapvalue, localgrass) + end end - end - end - return highestgrassmapvalue + end + return highestgrassmapvalue end local function grassByteToPatchMult(grassbyte) -- coverts grassmap byte to size multiplier for instancebuffer - if grassbyte == 0 then return 0 end - return (grassConfig.grassMinSize + (grassConfig.grassMaxSize - grassConfig.grassMinSize) * (grassbyte/254.0) ) + if grassbyte == 0 then + return 0 + end + return (grassConfig.grassMinSize + (grassConfig.grassMaxSize - grassConfig.grassMinSize) * (grassbyte / 254.0)) end local function grassPatchMultToByte(grasspatchsize) -- converts instancebuffer size to grassmap byte - if grasspatchsize < grassConfig.grassMinSize then return 0 end + if grasspatchsize < grassConfig.grassMinSize then + return 0 + end local grassbyte = (grasspatchsize - grassConfig.grassMinSize) - grassbyte = grassbyte / (grassConfig.grassMaxSize - grassConfig.grassMinSize) *254.0 + grassbyte = grassbyte / (grassConfig.grassMaxSize - grassConfig.grassMinSize) * 254.0 return math.clamp(grassbyte, 1, 254) end @@ -513,8 +522,10 @@ local function world2grassmap(wx, wz) -- returns an index into the elements of a local gz = mathFloor(wz / grassConfig.patchResolution) local cols = mathFloor(mapSizeX / grassConfig.patchResolution) --spEcho(gx, gz, cols) - local index = (gz*cols + gx) - if index <= 1 then return 0 end + local index = (gz * cols + gx) + if index <= 1 then + return 0 + end return index end @@ -522,46 +533,60 @@ local gCT = {} -- Grass Cache Table local function updateGrassInstanceVBO(wx, wz, size, sizemod, vboOffset) -- we are assuming that we can do this --spEcho(wx, wz, sizemod) - if not grassInstanceVBO then return end - local vboOffset = vboOffset or world2grassmap(wx,wz) * grassInstanceVBOStep - if vboOffset<0 or vboOffset >= #grassInstanceData then -- top left of map gets vboOffset: 0 + if not grassInstanceVBO then + return + end + local vboOffset = vboOffset or world2grassmap(wx, wz) * grassInstanceVBOStep + if vboOffset < 0 or vboOffset >= #grassInstanceData then -- top left of map gets vboOffset: 0 --spEcho(boOffset > #grassInstanceData",vboOffset,#grassInstanceData, " you probably need to /editgrass") return end local oldsize = grassInstanceData[vboOffset + 4] - if (not oldsize or oldsize <= 0) and not placementMode then return end + if (not oldsize or oldsize <= 0) and not placementMode then + return + end local oldpx = grassInstanceData[vboOffset + 1] -- We must read all instance params, because we need to write them all at once local oldry = grassInstanceData[vboOffset + 2] local oldpz = grassInstanceData[vboOffset + 3] - if sizemod then size = mathMin(grassConfig.grassMaxSize, oldsize * sizemod) end + if sizemod then + size = mathMin(grassConfig.grassMaxSize, oldsize * sizemod) + end local shift = false if placementMode then _, _, _, shift = Spring.GetModKeyState() end if sizemod < 1 then - if size < grassConfig.grassMinSize or shift then size = 0 end + if size < grassConfig.grassMinSize or shift then + size = 0 + end else if shift then size = grassConfig.grassMaxSize else - size = mathMax(grassConfig.grassMinSize,size) + size = mathMax(grassConfig.grassMinSize, size) end end grassInstanceData[vboOffset + 4] = size --spEcho("updateGrassInstanceVBO:",oldpx, "x", wx, oldpz ,"z", wz, oldsize, "s", size) --size_t LuaVBOImpl::Upload(const sol::stack_table& luaTblData, const sol::optional attribIdxOpt, const sol::optional elemOffsetOpt, const sol::optional luastartInstanceIndexndexOpt, const sol::optional luaFinishIndexOpt) gCT[1], gCT[2], gCT[3], gCT[4] = oldpx, oldry, oldpz, size - grassInstanceVBO:Upload(gCT, 7, vboOffset/4) -- We _must_ upload whole instance params at once + grassInstanceVBO:Upload(gCT, 7, vboOffset / 4) -- We _must_ upload whole instance params at once end function widget:KeyPress(key, modifier, isRepeat) - if not placementMode then return false end - if key == KEYSYMS.LEFTBRACKET then cursorradius = mathMax(8, cursorradius *0.8) end - if key == KEYSYMS.RIGHTBRACKET then cursorradius = mathMin(512, cursorradius *1.2) end + if not placementMode then + return false + end + if key == KEYSYMS.LEFTBRACKET then + cursorradius = mathMax(8, cursorradius * 0.8) + end + if key == KEYSYMS.RIGHTBRACKET then + cursorradius = mathMin(512, cursorradius * 1.2) + end return false end @@ -572,13 +597,13 @@ local function adjustGrass(px, pz, radius, multiplier) if x >= 0 and x <= mapSizeX then for z = pz - radius, pz + radius, grassConfig.patchResolution do if z >= 0 and z <= mapSizeZ then - if (x-px)*(x-px) + (z-pz)*(z-pz) < radius*radius then - local vboOffset = world2grassmap(x,z) * grassInstanceVBOStep + if (x - px) * (x - px) + (z - pz) * (z - pz) < radius * radius then + local vboOffset = world2grassmap(x, z) * grassInstanceVBOStep if vboOffset then - local sizeMod = 1-(mathAbs(((x-px)/radius)) + mathAbs(((z-pz)/radius))) / 2 -- sizemode in range 0...1 - sizeMod = (sizeMod*2-mathMin(0.66, radius/100)) -- adjust sizemod so inner grass is gone fully and not just the very center dot - sizeMod = sizeMod*multiplier -- apply multiplier to animate it over time - updateGrassInstanceVBO(x,z, 1, 1-sizeMod, vboOffset) + local sizeMod = 1 - (mathAbs(((x - px) / radius)) + mathAbs(((z - pz) / radius))) / 2 -- sizemode in range 0...1 + sizeMod = (sizeMod * 2 - mathMin(0.66, radius / 100)) -- adjust sizemod so inner grass is gone fully and not just the very center dot + sizeMod = sizeMod * multiplier -- apply multiplier to animate it over time + updateGrassInstanceVBO(x, z, 1, 1 - sizeMod, vboOffset) end end end @@ -594,9 +619,9 @@ local function adjustUnitGrass(unitID, multiplier) if not buildingRadius[unitDefID] then return end - radius = buildingRadius[unitDefID]*1.7 -- enlarge radius so it can gradually diminish in size more - local px,_,pz = spGetUnitPosition(unitID) - unitGrassRemovedHistory[unitID] = {px, pz, unitDefID, radius, multiplier or 1, 0} + radius = buildingRadius[unitDefID] * 1.7 -- enlarge radius so it can gradually diminish in size more + local px, _, pz = spGetUnitPosition(unitID) + unitGrassRemovedHistory[unitID] = { px, pz, unitDefID, radius, multiplier or 1, 0 } end local params = unitGrassRemovedHistory[unitID] radius = params[4] @@ -605,13 +630,13 @@ local function adjustUnitGrass(unitID, multiplier) if x >= 0 and x <= mapSizeX then for z = params[2] - radius, params[2] + radius, grassConfig.patchResolution do if z >= 0 and z <= mapSizeZ then - if (x-params[1])*(x-params[1]) + (z-params[2])*(z-params[2]) < radius*radius then - local vboOffset = world2grassmap(x,z) * grassInstanceVBOStep + if (x - params[1]) * (x - params[1]) + (z - params[2]) * (z - params[2]) < radius * radius then + local vboOffset = world2grassmap(x, z) * grassInstanceVBOStep if vboOffset then - local sizeMod = 1-(mathAbs(((x-params[1])/radius)) + mathAbs(((z-params[2])/radius))) / 2 -- sizemode in range 0...1 - sizeMod = (sizeMod*2-mathMin(0.25, radius/120)) -- adjust sizemod so inner grass is gone fully and not just the very center dot - sizeMod = (params[5]*sizeMod) -- apply multiplier to animate it over time - updateGrassInstanceVBO(x,z, 1, 1-sizeMod, vboOffset) + local sizeMod = 1 - (mathAbs(((x - params[1]) / radius)) + mathAbs(((z - params[2]) / radius))) / 2 -- sizemode in range 0...1 + sizeMod = (sizeMod * 2 - mathMin(0.25, radius / 120)) -- adjust sizemod so inner grass is gone fully and not just the very center dot + sizeMod = (params[5] * sizeMod) -- apply multiplier to animate it over time + updateGrassInstanceVBO(x, z, 1, 1 - sizeMod, vboOffset) end end end @@ -632,13 +657,13 @@ local function clearAllUnitGrass() end local function clearGeothermalGrass() - if WG['resource_spot_finder'] then - local spots = WG['resource_spot_finder'].geoSpotsList + if WG["resource_spot_finder"] then + local spots = WG["resource_spot_finder"].geoSpotsList if spots then local maxValue = 15 for i = 1, #spots do local spot = spots[i] - adjustGrass(spot.x, spot.z, mathMax(96, mathMax((spot.maxZ-spot.minZ), (spot.maxX-spot.minX))*1.2), 1) + adjustGrass(spot.x, spot.z, mathMax(96, mathMax((spot.maxZ - spot.minZ), (spot.maxX - spot.minX)) * 1.2), 1) end end end @@ -646,15 +671,15 @@ end -- because not all maps have done this for us local function clearMetalspotGrass() - if WG['resource_spot_finder'] then - local spots = WG['resource_spot_finder'].metalSpotsList + if WG["resource_spot_finder"] then + local spots = WG["resource_spot_finder"].metalSpotsList if spots then local maxValue = 15 for i = 1, #spots do local spot = spots[i] - local value = string.format("%0.1f",math.round(spot.worth/1000,1)) + local value = string.format("%0.1f", math.round(spot.worth / 1000, 1)) if tonumber(value) > 0.001 and tonumber(value) < maxValue then - adjustGrass(spot.x, spot.z, mathMax((spot.maxZ-spot.minZ), (spot.maxX-spot.minX))*1.2, 1) + adjustGrass(spot.x, spot.z, mathMax((spot.maxZ - spot.minZ), (spot.maxX - spot.minX)) * 1.2, 1) end end end @@ -678,7 +703,6 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam) end end - function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) if processChanges and not placementMode and buildingRadius[unitDefID] then removeUnitGrassQueue[unitID] = nil @@ -730,8 +754,8 @@ function widget:GameFrame(gf) local lavaLevel = Spring.GetGameRulesParam("lavaLevel") if lavaLevel and lavaLevel ~= -99999 and (not lastLavaLevel or lavaLevel > lastLavaLevel) then lastLavaLevel = lavaLevel - if WG['grassgl4'] and WG['grassgl4'].removeGrassBelowHeight then - WG['grassgl4'].removeGrassBelowHeight(lavaLevel) + if WG["grassgl4"] and WG["grassgl4"].removeGrassBelowHeight then + WG["grassgl4"].removeGrassBelowHeight(lavaLevel) end end end @@ -747,14 +771,14 @@ function widget:GameFrame(gf) local allUnits = spGetAllUnits() for _, unitID in pairs(allUnits) do if isCommander[Spring.GetUnitDefID(unitID)] then - local x,_,z = spGetUnitPosition(unitID) + local x, _, z = spGetUnitPosition(unitID) adjustGrass(x, z, 90, 1) end end end end -function widget:MousePress(x,y,button) +function widget:MousePress(x, y, button) if placementMode then return true end @@ -768,14 +792,16 @@ function widget:Update(dt) if firstUpdate then firstUpdate = false - clearGeothermalGrass() -- uses Spring.GetAllFeatures() which is empty at the time of widget:Initialize + clearGeothermalGrass() -- uses Spring.GetAllFeatures() which is empty at the time of widget:Initialize end - if not placementMode then return end - local mx, my, lp, mp, rp, offscreen = spGetMouseState ( ) - local _ , coords = spTraceScreenRay(mx,my,true) + if not placementMode then + return + end + local mx, my, lp, mp, rp, offscreen = spGetMouseState() + local _, coords = spTraceScreenRay(mx, my, true) if coords then - mousepos = {coords[1],coords[2],coords[3]} + mousepos = { coords[1], coords[2], coords[3] } else return end @@ -784,8 +810,8 @@ function widget:Update(dt) if lp or rp then for x = coords[1] - cursorradius, coords[1] + cursorradius, grassConfig.patchResolution do for z = coords[3] - cursorradius, coords[3] + cursorradius, grassConfig.patchResolution do - if (x-coords[1])*(x-coords[1]) + (z-coords[3])*(z-coords[3]) < cursorradius*cursorradius then - updateGrassInstanceVBO(x,z, 1, (lp and 1.025) or (rp and 0.975)) + if (x - coords[1]) * (x - coords[1]) + (z - coords[3]) * (z - coords[3]) < cursorradius * cursorradius then + updateGrassInstanceVBO(x, z, 1, (lp and 1.025) or (rp and 0.975)) end end end @@ -794,29 +820,33 @@ function widget:Update(dt) end local function MakeAndAttachToVAO() - if grassVAO then - grassVAO = nil - end - grassVAO = gl.GetVAO() - - if grassVAO == nil then goodbye("Failed to create grassVAO") end - grassVAO:AttachVertexBuffer(grassPatchVBO) - if grassPatchIndexVBO then - grassVAO:AttachIndexBuffer(grassPatchIndexVBO) - end - grassVAO:AttachInstanceBuffer(grassInstanceVBO) + if grassVAO then + grassVAO = nil + end + grassVAO = gl.GetVAO() + + if grassVAO == nil then + goodbye("Failed to create grassVAO") + end + grassVAO:AttachVertexBuffer(grassPatchVBO) + if grassPatchIndexVBO then + grassVAO:AttachIndexBuffer(grassPatchIndexVBO) + end + grassVAO:AttachInstanceBuffer(grassInstanceVBO) end local function defineUploadGrassInstanceVBOData() grassInstanceVBO = nil - grassInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if grassInstanceVBO == nil then goodbye("Failed to create grassInstanceVBO") end + grassInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if grassInstanceVBO == nil then + goodbye("Failed to create grassInstanceVBO") + end grassInstanceVBO:Define( - mathMax(1,#grassInstanceData/grassInstanceVBOStep),--?we dont know how big yet! + mathMax(1, #grassInstanceData / grassInstanceVBOStep), --?we dont know how big yet! { - {id = 7, name = 'instanceposrotscale', size = 4}, -- a vec4 for pos + random rotation + scale - } - ) + { id = 7, name = "instanceposrotscale", size = 4 }, -- a vec4 for pos + random rotation + scale + } + ) grassInstanceVBOSize = #grassInstanceData if grassInstanceVBOSize > 0 then grassInstanceVBO:Upload(grassInstanceData) @@ -826,7 +856,7 @@ end local function LoadGrassTGA(filename) local texture, loadfailed = Spring.Utilities.LoadTGA(filename) if loadfailed then - spEcho("Grass: Failed to load image for grass:",filename, loadfailed) + spEcho("Grass: Failed to load image for grass:", filename, loadfailed) return nil end if texture.channels ~= 1 then @@ -838,8 +868,7 @@ local function LoadGrassTGA(filename) local patchPlacementJitter = grassConfig.patchPlacementJitter local offset = 0 - - grassRowInstance = {0} + grassRowInstance = { 0 } local rowIndex = 1 grassPatchCount = 0 @@ -848,27 +877,28 @@ local function LoadGrassTGA(filename) rowIndex = rowIndex + 1 for x = 1, texture.width do --if placementMode or texture[z][x] > 0 then - local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution*patchPlacementJitter - local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution*patchPlacementJitter - grassPatchCount = grassPatchCount + 1 - grassInstanceData[offset*4 + 1] = lx - grassInstanceData[offset*4 + 2] = mathRandom()*6.28 - grassInstanceData[offset*4 + 3] = lz - grassInstanceData[offset*4 + 4] = grassByteToPatchMult(texture[z][x]) - offset = offset + 1 + local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution * patchPlacementJitter + local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution * patchPlacementJitter + grassPatchCount = grassPatchCount + 1 + grassInstanceData[offset * 4 + 1] = lx + grassInstanceData[offset * 4 + 2] = mathRandom() * 6.28 + grassInstanceData[offset * 4 + 3] = lz + grassInstanceData[offset * 4 + 4] = grassByteToPatchMult(texture[z][x]) + offset = offset + 1 --end end end return true end - local function makeGrassInstanceVBO() - grassInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if grassInstanceVBO == nil then goodbye("No LuaVAO support") end + grassInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if grassInstanceVBO == nil then + goodbye("No LuaVAO support") + end - grassInstanceData= {} - grassRowInstance = {0} + grassInstanceData = {} + grassRowInstance = { 0 } -- upload image type if exists if grassConfig.grassDistTGA and grassConfig.grassDistTGA ~= "" then LoadGrassTGA(grassConfig.grassDistTGA) @@ -876,33 +906,34 @@ local function makeGrassInstanceVBO() defineUploadGrassInstanceVBOData() MakeAndAttachToVAO() else -- try to load builtin grass type - local mapprocessChanges = mapHasSMFGrass() --spEcho("mapHasSMFGrass",mapprocessChanges, placementMode) - if (mapprocessChanges == 0 or mapprocessChanges == 255) and (not placementMode) then return nil end -- bail if none specified at all anywhere + if (mapprocessChanges == 0 or mapprocessChanges == 255) and not placementMode then + return nil + end -- bail if none specified at all anywhere local rowIndex = 1 for z = patchResolution / 2, mapSizeZ, patchResolution do grassRowInstance[rowIndex] = grassPatchCount rowIndex = rowIndex + 1 for x = patchResolution / 2, mapSizeX, patchResolution do - local localgrass = spGetGrass(x,z) + local localgrass = spGetGrass(x, z) --if localgrass > 0 or placementMode then - local lx = x + (mathRandom() -0.5) * patchResolution/1.5 - local lz = z + (mathRandom() -0.5) * patchResolution/1.5 - local grasssize = localgrass - if grasssize > 0 then - if mapprocessChanges == 1 then - grasssize = grassConfig.grassMinSize + mathRandom() * (grassConfig.grassMaxSize - grassConfig.grassMinSize ) - else - grasssize = grassConfig.grassMinSize + (localgrass/254.0) * (grassConfig.grassMaxSize - grassConfig.grassMinSize ) - end + local lx = x + (mathRandom() - 0.5) * patchResolution / 1.5 + local lz = z + (mathRandom() - 0.5) * patchResolution / 1.5 + local grasssize = localgrass + if grasssize > 0 then + if mapprocessChanges == 1 then + grasssize = grassConfig.grassMinSize + mathRandom() * (grassConfig.grassMaxSize - grassConfig.grassMinSize) + else + grasssize = grassConfig.grassMinSize + (localgrass / 254.0) * (grassConfig.grassMaxSize - grassConfig.grassMinSize) end - grassPatchCount = grassPatchCount + 1 - grassInstanceData[#grassInstanceData+1] = lx - grassInstanceData[#grassInstanceData+1] = mathRandom()*6.28 -- rotation 2 pi - grassInstanceData[#grassInstanceData+1] = lz - grassInstanceData[#grassInstanceData+1] = grasssize -- size + end + grassPatchCount = grassPatchCount + 1 + grassInstanceData[#grassInstanceData + 1] = lx + grassInstanceData[#grassInstanceData + 1] = mathRandom() * 6.28 -- rotation 2 pi + grassInstanceData[#grassInstanceData + 1] = lz + grassInstanceData[#grassInstanceData + 1] = grasssize -- size --end end end @@ -916,27 +947,25 @@ end local vsSrcPath = "LuaUI/Shaders/map_grass_gl4.vert.glsl" local fsSrcPath = "LuaUI/Shaders/map_grass_gl4.frag.glsl" - - local function makeShaderVAO() local shaderSourceCache = { vssrcpath = vsSrcPath, fssrcpath = fsSrcPath, shaderName = "GrassShaderGL4", uniformInt = { - grassBladeColorTex = 0,-- rgb + alpha transp + grassBladeColorTex = 0, -- rgb + alpha transp --grassBladeNormalTex = 1,-- xyz + specular factor mapGrassColorModTex = 1, -- minimap grassWindPerturbTex = 2, -- perlin shadowTex = 3, -- perlin losTex = 4, -- perlin heightmapTex = 5, -- perlin - }, + }, uniformFloat = { - grassuniforms = {1,1,1,1}, + grassuniforms = { 1, 1, 1, 1 }, distanceMult = distanceMult, - nightFactor = {1,1,1,1}, - }, + nightFactor = { 1, 1, 1, 1 }, + }, shaderConfig = grassConfig.grassShaderParams, silent = true, } @@ -945,21 +974,23 @@ local function makeShaderVAO() shaderSourceCache.uniformInt.unitBendCount = 0 end - grassShader = LuaShader.CheckShaderUpdates(shaderSourceCache) + grassShader = LuaShader.CheckShaderUpdates(shaderSourceCache) - if not grassShader then goodbye("Failed to compile grassShader GL4 ") end + if not grassShader then + goodbye("Failed to compile grassShader GL4 ") + end end local weaponConf = {} -for i=1, #WeaponDefs do +for i = 1, #WeaponDefs do local radius = WeaponDefs[i].damageAreaOfEffect * 1.2 local edgeEffectiveness = WeaponDefs[i].edgeEffectiveness * 1.75 - if WeaponDefs[i].type == 'DGun' then + if WeaponDefs[i].type == "DGun" then radius = radius * 2 edgeEffectiveness = 4 end - if radius*edgeEffectiveness > 9 then - weaponConf[i] = {radius, edgeEffectiveness} + if radius * edgeEffectiveness > 9 then + weaponConf[i] = { radius, edgeEffectiveness } end end @@ -968,7 +999,7 @@ function widget:VisibleExplosion(px, py, pz, weaponID, ownerID) return end if not placementMode and weaponConf[weaponID] ~= nil and py - 10 < spGetGroundHeight(px, pz) then - adjustGrass(px, pz, weaponConf[weaponID][1], mathMin(1, (weaponConf[weaponID][1]*weaponConf[weaponID][2])/45)) + adjustGrass(px, pz, weaponConf[weaponID][1], mathMin(1, (weaponConf[weaponID][1] * weaponConf[weaponID][2]) / 45)) end end @@ -979,7 +1010,9 @@ local function placegrassCmd(_, _, params) end local function savegrassCmd(_, _, params) - if not params[1] then return end + if not params[1] then + return + end local filename = params[1] if string.len(filename) < 2 then @@ -987,23 +1020,24 @@ local function savegrassCmd(_, _, params) end spEcho("Savegrass: ", filename) - texture = Spring.Utilities.NewTGA( - mathFloor(mapSizeX / grassConfig.patchResolution), - mathFloor(mapSizeZ / grassConfig.patchResolution), - 1) + texture = Spring.Utilities.NewTGA(mathFloor(mapSizeX / grassConfig.patchResolution), mathFloor(mapSizeZ / grassConfig.patchResolution), 1) local offset = 0 for y = 1, texture.height do for x = 1, texture.width do - texture[y][x] = grassPatchMultToByte(grassInstanceData[offset*4 + 4]) + texture[y][x] = grassPatchMultToByte(grassInstanceData[offset * 4 + 4]) offset = offset + 1 end end local success = Spring.Utilities.SaveTGA(texture, filename) - if success then spEcho("Saving grass map image failed",filename,success) end + if success then + spEcho("Saving grass map image failed", filename, success) + end end local function loadgrassCmd(_, _, params) - if not params[1] then return end + if not params[1] then + return + end placementMode = true local filename = params[1] @@ -1031,15 +1065,14 @@ local function cleargrassCmd(_, _, params) placementMode = true local patchResolution = grassConfig.patchResolution local offset = 0 - for z = 1, mathFloor(mapSizeZ/patchResolution )do - for x = 1, mathFloor(mapSizeX/patchResolution)do - - local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution/1.5 - local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution/1.5 - grassInstanceData[offset*4 + 1] = lx - grassInstanceData[offset*4 + 2] = mathRandom()*6.28 - grassInstanceData[offset*4 + 3] = lz - grassInstanceData[offset*4 + 4] = 0 + for z = 1, mathFloor(mapSizeZ / patchResolution) do + for x = 1, mathFloor(mapSizeX / patchResolution) do + local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution / 1.5 + local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution / 1.5 + grassInstanceData[offset * 4 + 1] = lx + grassInstanceData[offset * 4 + 2] = mathRandom() * 6.28 + grassInstanceData[offset * 4 + 3] = lz + grassInstanceData[offset * 4 + 4] = 0 offset = offset + 1 end end @@ -1060,44 +1093,46 @@ function widget:Initialize() widgetHandler:RemoveWidget() return end - WG['grassgl4'] = {} - WG['grassgl4'].getDistanceMult = function() + WG["grassgl4"] = {} + WG["grassgl4"].getDistanceMult = function() return distanceMult end - WG['grassgl4'].setDistanceMult = function(value) + WG["grassgl4"].setDistanceMult = function(value) distanceMult = value end - WG['grassgl4'].getUnitBendEnabled = function() + WG["grassgl4"].getUnitBendEnabled = function() return unitBendSSBO ~= nil end - WG['grassgl4'].removeGrass = function(wx,wz,radius) + WG["grassgl4"].removeGrass = function(wx, wz, radius) radius = radius or grassConfig.patchResolution for x = wx - radius, wx + radius, grassConfig.patchResolution do for z = wz - radius, wz + radius, grassConfig.patchResolution do - if (x-wx)*(x-wx) + (z-wz)*(z-wz) < radius*radius then - local sizeMod = 1-(mathAbs(((x-wx)/radius)) + mathAbs(((z-wz)/radius))) / 2 -- sizemode in range 0...1 - sizeMod = (sizeMod*2-mathMin(0.66, radius/100)) -- adjust sizemod so inner grass is gone fully and not just the very center dot - updateGrassInstanceVBO(x,z, 1, 1-sizeMod) + if (x - wx) * (x - wx) + (z - wz) * (z - wz) < radius * radius then + local sizeMod = 1 - (mathAbs(((x - wx) / radius)) + mathAbs(((z - wz) / radius))) / 2 -- sizemode in range 0...1 + sizeMod = (sizeMod * 2 - mathMin(0.66, radius / 100)) -- adjust sizemod so inner grass is gone fully and not just the very center dot + updateGrassInstanceVBO(x, z, 1, 1 - sizeMod) end end end end - WG['grassgl4'].removeGrassBelowHeight = function(height) - if #grassInstanceData == 0 then return nil end + WG["grassgl4"].removeGrassBelowHeight = function(height) + if #grassInstanceData == 0 then + return nil + end if not removedBelowHeight or height > removedBelowHeight then removedBelowHeight = height local patchResolution = grassConfig.patchResolution local offset = 0 - for z = 1, mathFloor(mapSizeZ/patchResolution )do - for x = 1, mathFloor(mapSizeX/patchResolution)do - if spGetGroundHeight(x*patchResolution,z*patchResolution) <= height then - local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution/1.5 - local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution/1.5 - grassInstanceData[offset*4 + 1] = lx - grassInstanceData[offset*4 + 2] = mathRandom()*6.28 - grassInstanceData[offset*4 + 3] = lz - grassInstanceData[offset*4 + 4] = 0 + for z = 1, mathFloor(mapSizeZ / patchResolution) do + for x = 1, mathFloor(mapSizeX / patchResolution) do + if spGetGroundHeight(x * patchResolution, z * patchResolution) <= height then + local lx = (x - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution / 1.5 + local lz = (z - 0.5) * patchResolution + (mathRandom() - 0.5) * patchResolution / 1.5 + grassInstanceData[offset * 4 + 1] = lx + grassInstanceData[offset * 4 + 2] = mathRandom() * 6.28 + grassInstanceData[offset * 4 + 3] = lz + grassInstanceData[offset * 4 + 4] = 0 end offset = offset + 1 end @@ -1114,7 +1149,7 @@ function widget:Initialize() if grassConfig.grassShaderParams.UNITBENDENABLED == 1 then unitBendSSBO = gl.GetVBO(GL.SHADER_STORAGE_BUFFER, false) if unitBendSSBO then - unitBendSSBO:Define(MAX_BEND_UNITS, {{id = 0, name = 'unitBendPositions', size = 4}}) + unitBendSSBO:Define(MAX_BEND_UNITS, { { id = 0, name = "unitBendPositions", size = 4 } }) unitBendSSBO:Upload(unitBendData) end end @@ -1122,33 +1157,35 @@ function widget:Initialize() clearAllUnitGrass() clearMetalspotGrass() if Game.waterDamage > 0 then - WG['grassgl4'].removeGrassBelowHeight(20) + WG["grassgl4"].removeGrassBelowHeight(20) end -- initial lava check local initLavaLevel = Spring.GetGameRulesParam("lavaLevel") if initLavaLevel and initLavaLevel ~= -99999 then lastLavaLevel = initLavaLevel - WG['grassgl4'].removeGrassBelowHeight(initLavaLevel) + WG["grassgl4"].removeGrassBelowHeight(initLavaLevel) end processChanges = next(grassInstanceData) ~= nil - widgetHandler:AddAction("placegrass", placegrassCmd, nil, 't') - widgetHandler:AddAction("savegrass", savegrassCmd, nil, 't') - widgetHandler:AddAction("loadgrass", loadgrassCmd, nil, 't') - widgetHandler:AddAction("editgrass", editgrassCmd, nil, 't') - widgetHandler:AddAction("cleargrass", cleargrassCmd, nil, 't') - widgetHandler:AddAction("dumpgrassshaders", dumpgrassshadersCmd, nil, 't') + widgetHandler:AddAction("placegrass", placegrassCmd, nil, "t") + widgetHandler:AddAction("savegrass", savegrassCmd, nil, "t") + widgetHandler:AddAction("loadgrass", loadgrassCmd, nil, "t") + widgetHandler:AddAction("editgrass", editgrassCmd, nil, "t") + widgetHandler:AddAction("cleargrass", cleargrassCmd, nil, "t") + widgetHandler:AddAction("dumpgrassshaders", dumpgrassshadersCmd, nil, "t") end function widget:GadgetRemoveGrass(posx, posz, radius) - if WG['grassgl4'] then - WG['grassgl4'].removeGrass(posx, posz, radius) + if WG["grassgl4"] then + WG["grassgl4"].removeGrass(posx, posz, radius) end end function widget:Shutdown() - if unitBendSSBO then unitBendSSBO = nil end + if unitBendSSBO then + unitBendSSBO = nil + end widgetHandler:RemoveAction("placegrass") widgetHandler:RemoveAction("savegrass") @@ -1183,9 +1220,9 @@ local function getWindSpeed() end local function mapcoordtorow(mapz, offset) -- is this even worth it? - local rownum = math.ceil((mapz - patchResolution/2) /patchResolution) + local rownum = math.ceil((mapz - patchResolution / 2) / patchResolution) rownum = mathMax(1, mathMin(#grassRowInstance, rownum + offset)) - return grassRowInstance[rownum] + return grassRowInstance[rownum] end local function GetStartEndRows(cz, fadeEnd) @@ -1205,100 +1242,105 @@ local glTexture = gl.Texture local smoothGrassFadeExp = 1 - function widget:DrawWorldPreUnit() if not processChanges then return end - if #grassInstanceData == 0 then return end - local mapDrawMode = Spring.GetMapDrawMode() - if mapDrawMode ~= 'normal' and mapDrawMode ~= 'los' then return end + if #grassInstanceData == 0 then + return + end + local mapDrawMode = Spring.GetMapDrawMode() + if mapDrawMode ~= "normal" and mapDrawMode ~= "los" then + return + end if placementMode then --spEcho("circle",mousepos[1],mousepos[2]+10,mousepos[3]) gl.LineWidth(2) gl.Color(0.3, 1.0, 0.2, 0.75) - gl.DrawGroundCircle(mousepos[1],mousepos[2]+10,mousepos[3],cursorradius,16) - end - local newGameSeconds = os.clock() - local timePassed = newGameSeconds - oldGameSeconds - oldGameSeconds = newGameSeconds - - local cx, cy, cz = spGetCameraPosition() - local gh = (Spring.GetGroundHeight(cx,cz) or 0) - - local fadeEnd = grassConfig.grassShaderParams.FADEEND * distanceMult - local fadeStart = grassConfig.grassShaderParams.FADESTART * distanceMult - local camHeight = cy - gh - local globalgrassfade = math.clamp((fadeEnd - camHeight) / (fadeEnd - fadeStart), 0, 1) - - local expFactor = mathMin(1.0, 3 * timePassed) -- ADJUST THE TEMPORAL FACTOR OF 3 - smoothGrassFadeExp = smoothGrassFadeExp * (1.0 - expFactor) + globalgrassfade * expFactor - - local grassDataLen = #grassInstanceData - if camHeight < fadeEnd and grassVAO ~= nil and grassDataLen > 0 then - local startInstanceIndex = 0 - local instanceCount = grassDataLen / 4 - if not placementMode then - startInstanceIndex, instanceCount = GetStartEndRows(cz, fadeEnd) - end - if instanceCount <= 0 or startInstanceIndex == grassDataLen / 4 then return end - local _, _, isPaused = Spring.GetGameSpeed() - if not isPaused then - getWindSpeed() - offsetX = offsetX - ((windDirX * grassConfig.grassWindMult) * timePassed) - offsetZ = offsetZ - ((windDirZ * grassConfig.grassWindMult) * timePassed) - end - - - gl.DepthTest(GL.LEQUAL) - gl.DepthMask(true) - gl.Culling(GL.BACK) -- needs better front and back instead of using this - - glTexture(0, grassConfig.grassBladeColorTex) - glTexture(1, grassConfig.mapGrassColorModTex) - glTexture(2, grassConfig.grassWindPerturbTex) - glTexture(3, "$shadow") - glTexture(4, "$info") - glTexture(5, "$heightmap") - - -- Bind unit bending SSBO - if unitBendSSBO then - updateUnitBendSSBO() - unitBendSSBO:BindBufferRange(6) - end - - grassShader:Activate() - --spEcho("globalgrassfade",globalgrassfade) - local windStrength = mathMin(grassConfig.maxWindSpeed, mathMax(4.0, mathAbs(windDirX) + mathAbs(windDirZ))) - grassShader:SetUniform("grassuniforms", offsetX, offsetZ, windStrength, smoothGrassFadeExp) - grassShader:SetUniform("distanceMult", distanceMult) - grassShader:SetUniform("nightFactor", nightFactor[1], nightFactor[2], nightFactor[3], nightFactor[4]) - if unitBendSSBO then - grassShader:SetUniformInt("unitBendCount", unitBendCount) - end - - - -- NOTE THAT INDEXED DRAWING DOESNT WORK YET! - grassVAO:DrawArrays(GL.TRIANGLES, grassPatchVBOsize, 0, instanceCount, startInstanceIndex) - - if placementMode and Spring.GetGameFrame()%30 == 0 then spEcho("Drawing",instanceCount,"grass patches") end - grassShader:Deactivate() - - if unitBendSSBO then - unitBendSSBO:UnbindBufferRange(6) - end - - glTexture(0, false) - glTexture(1, false) - glTexture(2, false) - glTexture(3, false) - glTexture(4, false) - glTexture(5, false) - - gl.DepthTest(GL.ALWAYS) - gl.DepthMask(false) - gl.Culling(GL.BACK) - end + gl.DrawGroundCircle(mousepos[1], mousepos[2] + 10, mousepos[3], cursorradius, 16) + end + local newGameSeconds = os.clock() + local timePassed = newGameSeconds - oldGameSeconds + oldGameSeconds = newGameSeconds + + local cx, cy, cz = spGetCameraPosition() + local gh = (Spring.GetGroundHeight(cx, cz) or 0) + + local fadeEnd = grassConfig.grassShaderParams.FADEEND * distanceMult + local fadeStart = grassConfig.grassShaderParams.FADESTART * distanceMult + local camHeight = cy - gh + local globalgrassfade = math.clamp((fadeEnd - camHeight) / (fadeEnd - fadeStart), 0, 1) + + local expFactor = mathMin(1.0, 3 * timePassed) -- ADJUST THE TEMPORAL FACTOR OF 3 + smoothGrassFadeExp = smoothGrassFadeExp * (1.0 - expFactor) + globalgrassfade * expFactor + + local grassDataLen = #grassInstanceData + if camHeight < fadeEnd and grassVAO ~= nil and grassDataLen > 0 then + local startInstanceIndex = 0 + local instanceCount = grassDataLen / 4 + if not placementMode then + startInstanceIndex, instanceCount = GetStartEndRows(cz, fadeEnd) + end + if instanceCount <= 0 or startInstanceIndex == grassDataLen / 4 then + return + end + local _, _, isPaused = Spring.GetGameSpeed() + if not isPaused then + getWindSpeed() + offsetX = offsetX - ((windDirX * grassConfig.grassWindMult) * timePassed) + offsetZ = offsetZ - ((windDirZ * grassConfig.grassWindMult) * timePassed) + end + + gl.DepthTest(GL.LEQUAL) + gl.DepthMask(true) + gl.Culling(GL.BACK) -- needs better front and back instead of using this + + glTexture(0, grassConfig.grassBladeColorTex) + glTexture(1, grassConfig.mapGrassColorModTex) + glTexture(2, grassConfig.grassWindPerturbTex) + glTexture(3, "$shadow") + glTexture(4, "$info") + glTexture(5, "$heightmap") + + -- Bind unit bending SSBO + if unitBendSSBO then + updateUnitBendSSBO() + unitBendSSBO:BindBufferRange(6) + end + + grassShader:Activate() + --spEcho("globalgrassfade",globalgrassfade) + local windStrength = mathMin(grassConfig.maxWindSpeed, mathMax(4.0, mathAbs(windDirX) + mathAbs(windDirZ))) + grassShader:SetUniform("grassuniforms", offsetX, offsetZ, windStrength, smoothGrassFadeExp) + grassShader:SetUniform("distanceMult", distanceMult) + grassShader:SetUniform("nightFactor", nightFactor[1], nightFactor[2], nightFactor[3], nightFactor[4]) + if unitBendSSBO then + grassShader:SetUniformInt("unitBendCount", unitBendCount) + end + + -- NOTE THAT INDEXED DRAWING DOESNT WORK YET! + grassVAO:DrawArrays(GL.TRIANGLES, grassPatchVBOsize, 0, instanceCount, startInstanceIndex) + + if placementMode and Spring.GetGameFrame() % 30 == 0 then + spEcho("Drawing", instanceCount, "grass patches") + end + grassShader:Deactivate() + + if unitBendSSBO then + unitBendSSBO:UnbindBufferRange(6) + end + + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) + glTexture(4, false) + glTexture(5, false) + + gl.DepthTest(GL.ALWAYS) + gl.DepthMask(false) + gl.Culling(GL.BACK) + end end local function NightFactorChanged(red, green, blue, shadow, altitude) @@ -1355,4 +1397,5 @@ for objline in open(sys.argv[1]).readlines(): outfile.write('\n}\nlocal numVerts = %d\n'%numverts) outfile.close() -]]-- +]] +-- diff --git a/luaui/Widgets/map_lighting_adjuster.lua b/luaui/Widgets/map_lighting_adjuster.lua index 67efb2bf192..e4ab70da664 100644 --- a/luaui/Widgets/map_lighting_adjuster.lua +++ b/luaui/Widgets/map_lighting_adjuster.lua @@ -1,87 +1,86 @@ - local currentMapname = Game.mapName:lower() local mapSunLighting = { - ['eye of horus v13'] = { + ["eye of horus v13"] = { groundDiffuseColor = { 0.7, 0.56, 0.54 }, - unitAmbientColor = {0.8, 0.66, 0.5}, - unitDiffuseColor = {0.8, 0.72, 0.65}, - unitSpecularColor = {0.95, 0.75, 0.7}, + unitAmbientColor = { 0.8, 0.66, 0.5 }, + unitDiffuseColor = { 0.8, 0.72, 0.65 }, + unitSpecularColor = { 0.95, 0.75, 0.7 }, modelShadowDensity = 0.55, }, - ['valles_marineris_v2'] = { + ["valles_marineris_v2"] = { groundAmbientColor = { 0.4, 0.55, 0.55 }, groundDiffuseColor = { 0.92, 0.58, 0.45 }, - unitAmbientColor = {0.66, 0.5, 0.43}, - unitDiffuseColor = {1.1, 0.82, 0.7}, + unitAmbientColor = { 0.66, 0.5, 0.43 }, + unitDiffuseColor = { 1.1, 0.82, 0.7 }, modelShadowDensity = 0.9, groundShadowDensity = 0.9, }, - ['titan v3.1'] = { + ["titan v3.1"] = { groundAmbientColor = { 0.52, 0.48, 0.48 }, groundDiffuseColor = { 0.65, 0.58, 0.55 }, modelShadowDensity = 0.66, - unitAmbientColor = {0.83, 0.73, 0.63}, + unitAmbientColor = { 0.83, 0.73, 0.63 }, }, - ['tempest'] = { + ["tempest"] = { groundDiffuseColor = { 0.32, 0.28, 0.34 }, - unitAmbientColor = {0.8, 0.77, 0.77}, - unitDiffuseColor = {0.66, 0.65, 0.63}, - unitSpecularColor = {0.5, 0.5, 0.5}, + unitAmbientColor = { 0.8, 0.77, 0.77 }, + unitDiffuseColor = { 0.66, 0.65, 0.63 }, + unitSpecularColor = { 0.5, 0.5, 0.5 }, modelShadowDensity = 0.77, }, - ['tempest dry'] = { + ["tempest dry"] = { groundDiffuseColor = { 0.32, 0.28, 0.34 }, - unitAmbientColor = {0.8, 0.77, 0.77}, - unitDiffuseColor = {0.66, 0.65, 0.63}, - unitSpecularColor = {0.5, 0.5, 0.5}, + unitAmbientColor = { 0.8, 0.77, 0.77 }, + unitDiffuseColor = { 0.66, 0.65, 0.63 }, + unitSpecularColor = { 0.5, 0.5, 0.5 }, modelShadowDensity = 0.77, }, - ['seths_ravine_v4'] = { - unitAmbientColor = {0.36, 0.36, 0.36}, - unitDiffuseColor = {0.88, 0.78, 0.68}, - unitSpecularColor = {0.88, 0.78, 0.68}, + ["seths_ravine_v4"] = { + unitAmbientColor = { 0.36, 0.36, 0.36 }, + unitDiffuseColor = { 0.88, 0.78, 0.68 }, + unitSpecularColor = { 0.88, 0.78, 0.68 }, modelShadowDensity = 0.77, }, - ['kolmogorov'] = { + ["kolmogorov"] = { groundDiffuseColor = { 0.95, 0.75, 0.4 }, - unitAmbientColor = {0.6, 0.5, 0.45}, - unitDiffuseColor = {1.2, 0.75, 0.35}, + unitAmbientColor = { 0.6, 0.5, 0.45 }, + unitDiffuseColor = { 1.2, 0.75, 0.35 }, modelShadowDensity = 0.7, }, - ['sapphireshores_v2.2'] = { - unitAmbientColor = {0.5, 0.5, 0.6}, - unitDiffuseColor = {1, 1, 1.2}, - unitSpecularColor = {1, 1, 1.2}, + ["sapphireshores_v2.2"] = { + unitAmbientColor = { 0.5, 0.5, 0.6 }, + unitDiffuseColor = { 1, 1, 1.2 }, + unitSpecularColor = { 1, 1, 1.2 }, modelShadowDensity = 0.55, groundShadowDensity = 0.66, }, - ['otago 1.4'] = { - unitAmbientColor = {0.85, 0.6, 0.66}, + ["otago 1.4"] = { + unitAmbientColor = { 0.85, 0.6, 0.66 }, modelShadowDensity = 0.8, groundShadowDensity = 0.85, }, - ['tropical-v2'] = { + ["tropical-v2"] = { groundDiffuseColor = { 0.77, 0.5, 0.26 }, - unitDiffuseColor = {1, 0.8, 0.65}, - unitSpecularColor = {1, 0.77, 0.7}, + unitDiffuseColor = { 1, 0.8, 0.65 }, + unitSpecularColor = { 1, 0.77, 0.7 }, modelShadowDensity = 0.5, groundShadowDensity = 0.8, }, - ['mescaline_v2'] = { + ["mescaline_v2"] = { modelShadowDensity = 0.9, groundShadowDensity = 0.88, }, - ['downs_of_destruction_fix'] = { - unitDiffuseColor = {1.4, 1.4, 1.3}, + ["downs_of_destruction_fix"] = { + unitDiffuseColor = { 1.4, 1.4, 1.3 }, }, - ['twin lakes park 1'] = { + ["twin lakes park 1"] = { groundDiffuseColor = { 0.97, 1, 0.97 }, groundAmbientColor = { 0.87, 0.9, 0.87 }, - unitAmbientColor = {0.7, 0.75, 0.7}, + unitAmbientColor = { 0.7, 0.75, 0.7 }, modelShadowDensity = 0.75, }, - ['comet catcher remake 1.8'] = { + ["comet catcher remake 1.8"] = { unitAmbientColor = { 0.75, 0.75, 0.75 }, }, --['flats and forests remake v1'] = { @@ -105,57 +104,58 @@ local mapSunLighting = { -- unitDiffuseColor = {1.0, 0.7, 0.7}, -- unitSpecularColor = {1.0, 0.5, 0.5}, --}, - ['rosetta 1.4'] = { + ["rosetta 1.4"] = { unitAmbientColor = { 0.7, 0.7, 0.7 }, - unitDiffuseColor = {1.1, 1.05, 1.0}, - unitSpecularColor = {1.0, 0.9, 0.9}, + unitDiffuseColor = { 1.1, 1.05, 1.0 }, + unitSpecularColor = { 1.0, 0.9, 0.9 }, modelShadowDensity = 0.7, groundShadowDensity = 0.7, }, - ['tma20x 1.8'] = { + ["tma20x 1.8"] = { unitAmbientColor = { 0.6, 0.6, 0.6 }, - unitDiffuseColor = {1.1, 1.1, 1.0}, - unitSpecularColor = {1.2, 1.05, 1.05}, + unitDiffuseColor = { 1.1, 1.1, 1.0 }, + unitSpecularColor = { 1.2, 1.05, 1.05 }, modelShadowDensity = 0.82, groundShadowDensity = 0.9, }, - ['swirly rock v1.1'] = { + ["swirly rock v1.1"] = { unitAmbientColor = { 0.44, 0.44, 0.44 }, unitDiffuseColor = { 0.88, 0.88, 0.88 }, }, } local mapSun = { - ['eye of horus v13'] = {0.23, 0.62, 0.6}, - ['tabula-v4'] = {0.45, 0.65, 0.25}, - ['titan v3.1'] = { 0.6, 0.82, -0.33 }, - ['tempest'] = { -0.35, 0.83, 0.47 }, - ['tempest dry'] = { -0.35, 0.83, 0.47 }, - ['seths_ravine_v4'] = { -0.6, 0.63, 0.43 }, - ['kolmogorov'] = { 0.4, 0.75, -0.43}, - ['otago 1.4'] = { -0.55, 0.5, 0.55}, - ['tropical-v2'] = { 0.6, 0.33, 0.27}, - ['downs_of_destruction_fix'] = { 0.65, 0.43, -65}, - ['flats and forests remake v1'] = {0.55, 0.5, -0.5}, + ["eye of horus v13"] = { 0.23, 0.62, 0.6 }, + ["tabula-v4"] = { 0.45, 0.65, 0.25 }, + ["titan v3.1"] = { 0.6, 0.82, -0.33 }, + ["tempest"] = { -0.35, 0.83, 0.47 }, + ["tempest dry"] = { -0.35, 0.83, 0.47 }, + ["seths_ravine_v4"] = { -0.6, 0.63, 0.43 }, + ["kolmogorov"] = { 0.4, 0.75, -0.43 }, + ["otago 1.4"] = { -0.55, 0.5, 0.55 }, + ["tropical-v2"] = { 0.6, 0.33, 0.27 }, + ["downs_of_destruction_fix"] = { 0.65, 0.43, -65 }, + ["flats and forests remake v1"] = { 0.55, 0.5, -0.5 }, } - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Map Lighting Adjuster", - desc = "Adjusts map lighting on various maps (pre game-start)", - author = "Floris", - date = "August 2021", - license = "GNU GPL, v2 or later", - layer = -1000000, - enabled = true + name = "Map Lighting Adjuster", + desc = "Adjusts map lighting on various maps (pre game-start)", + author = "Floris", + date = "August 2021", + license = "GNU GPL, v2 or later", + layer = -1000000, + enabled = true, } end function widget:Initialize() - if not mapSunLighting[currentMapname] and not mapSun[currentMapname] then return end + if not mapSunLighting[currentMapname] and not mapSun[currentMapname] then + return + end if Spring.GetGameFrame() < 1 then if mapSun[currentMapname] then Spring.SetSunDirection(mapSun[currentMapname][1], mapSun[currentMapname][2], mapSun[currentMapname][3]) @@ -173,7 +173,9 @@ local lastSunChanged = -1 function widget:SunChanged() -- Note that map_nightmode.lua gadget has to change sun twice in a single draw frame to update all local df = Spring.GetDrawFrame() - if df == lastSunChanged then return end + if df == lastSunChanged then + return + end lastSunChanged = df end diff --git a/luaui/Widgets/map_start_position_suggestions.lua b/luaui/Widgets/map_start_position_suggestions.lua index ac6097053af..4fd22cc3a93 100644 --- a/luaui/Widgets/map_start_position_suggestions.lua +++ b/luaui/Widgets/map_start_position_suggestions.lua @@ -6,11 +6,10 @@ function widget:GetInfo() desc = "Show expert recommended starting locations on the map", license = "GNU GPL, v2 or later", layer = 10000, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathCeil = math.ceil local mathMax = math.max @@ -68,7 +67,7 @@ local config = { local CIRCLE_RADIUS_SQUARED = config.circleRadius * config.circleRadius local vsx, vsy = spGetViewGeometry() -local resMult = vsy/1440 +local resMult = vsy / 1440 -- engine call optimizations -- ========================= @@ -128,7 +127,6 @@ local glPopMatrix = gl.PopMatrix ---@alias WidgetStartPositions table - -- loading and processing code -- =========================== @@ -173,14 +171,10 @@ local function processModoptionTeamConfig(positions, teamPositions) end local function selectModoptionConfigForPlayers(modoptionData, allyTeamCount, playersPerTeam) - Spring.Log( - widget:GetInfo().name, - LOG.INFO, - "Searching for start positions for " .. table.toString({ - allyTeamCount = allyTeamCount, - playersPerTeam = playersPerTeam, - }) - ) + Spring.Log(widget:GetInfo().name, LOG.INFO, "Searching for start positions for " .. table.toString({ + allyTeamCount = allyTeamCount, + playersPerTeam = playersPerTeam, + })) for _, teamConfig in ipairs(modoptionData.team) do if teamConfig.playersPerTeam == playersPerTeam and teamConfig.teamCount == allyTeamCount then @@ -212,10 +206,7 @@ local function loadStartPositions() return end - local positions = processModoptionTeamConfig( - parsed.positions, - selectedConfig - ) + local positions = processModoptionTeamConfig(parsed.positions, selectedConfig) return positions end @@ -503,11 +494,11 @@ local function getCaptions(role) elseif #roles > 1 then local title1 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".title") local title2 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".title") - title = Spring.I18N("ui.startPositionSuggestions.multiRole.title", { role1 = title1, role2 = title2}) + title = Spring.I18N("ui.startPositionSuggestions.multiRole.title", { role1 = title1, role2 = title2 }) local description1 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[1] .. ".description") local description2 = Spring.I18N("ui.startPositionSuggestions.roles." .. roles[2] .. ".description") - description = Spring.I18N("ui.startPositionSuggestions.multiRole.description", { role1 = description1, role2 = description2}) + description = Spring.I18N("ui.startPositionSuggestions.multiRole.description", { role1 = description1, role2 = description2 }) end captionsCache[role] = { title = title, description = description } @@ -561,10 +552,7 @@ local function drawAllStartLocationsText() local cameraMode = cameraState.mode local roundedRy = mathCeil(ry * 100) / 100 - local needsRebuild = not textDisplayListID - or textDisplayListCameraFlipped ~= cameraFlipped - or textDisplayListCameraMode ~= cameraMode - or (cameraMode == 2 and textDisplayListCameraRy ~= roundedRy) + local needsRebuild = not textDisplayListID or textDisplayListCameraFlipped ~= cameraFlipped or textDisplayListCameraMode ~= cameraMode or (cameraMode == 2 and textDisplayListCameraRy ~= roundedRy) if needsRebuild then invalidateTextDisplayList() @@ -607,12 +595,9 @@ local function wrapLine(str, maxLength) end local function wrapText(str, maxLength) - local result = string.gsub(str, - "[^\n]*", - function(s) - return wrapLine(s, maxLength) - end - ) + local result = string.gsub(str, "[^\n]*", function(s) + return wrapLine(s, maxLength) + end) return result end @@ -633,20 +618,11 @@ local function drawTooltip() end if not wrappedDescriptionCache[tooltipKey] then - wrappedDescriptionCache[tooltipKey] = wrapText( - getCaptions(tooltipKey).description, - config.tooltipMaxWidthChars - ) + wrappedDescriptionCache[tooltipKey] = wrapText(getCaptions(tooltipKey).description, config.tooltipMaxWidthChars) end local xOffset, yOffset = 20, -12 - WG["tooltip"].ShowTooltip( - "startPositionTooltip", - wrappedDescriptionCache[tooltipKey], - x + xOffset, - y + yOffset, - getCaptions(tooltipKey).title - ) + WG["tooltip"].ShowTooltip("startPositionTooltip", wrappedDescriptionCache[tooltipKey], x + xOffset, y + yOffset, getCaptions(tooltipKey).title) end local function drawTutorial() @@ -655,44 +631,25 @@ local function drawTutorial() end if not cachedTutorialText then - cachedTutorialText = wrapText( - Spring.I18N("ui.startPositionSuggestions.tutorial"), - config.tutorialMaxWidthChars - ) + cachedTutorialText = wrapText(Spring.I18N("ui.startPositionSuggestions.tutorial"), config.tutorialMaxWidthChars) end - fontTutorial:SetOutlineColor(0,0,0,1) + fontTutorial:SetOutlineColor(0, 0, 0, 1) fontTutorial:SetTextColor(0.9, 0.9, 0.9, 1) - fontTutorial:Print( - cachedTutorialText, - vsx * 0.5, - vsy * 0.75, - config.tutorialTextSize*resMult, - "cao" - ) + fontTutorial:Print(cachedTutorialText, vsx * 0.5, vsy * 0.75, config.tutorialTextSize * resMult, "cao") end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - resMult = vsy/1440 + resMult = vsy / 1440 local baseFontSize = mathMax(config.playerTextSize, config.roleTextSize) * 0.6 - font = gl.LoadFont( - "fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf"), - baseFontSize*resMult, - (baseFontSize*resMult) / 14, - 1 - ) - fontTutorial = gl.LoadFont( - "fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf"), - config.tutorialTextSize*resMult, - (config.tutorialTextSize*resMult) / 14, - 1 - ) + font = gl.LoadFont("fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf"), baseFontSize * resMult, (baseFontSize * resMult) / 14, 1) + fontTutorial = gl.LoadFont("fonts/" .. Spring.GetConfigString("bar_font2", "Exo2-SemiBold.otf"), config.tutorialTextSize * resMult, (config.tutorialTextSize * resMult) / 14, 1) end function widget:GetConfigData() return { - hasRunBefore = true + hasRunBefore = true, } end @@ -778,10 +735,7 @@ local function getPlacedCommanders() for i = 1, #newPlacedCommanders do local old = placedCommanders[i] local new = newPlacedCommanders[i] - if old.teamID ~= new.teamID or - old.position[1] ~= new.position[1] or - old.position[2] ~= new.position[2] or - old.position[3] ~= new.position[3] then + if old.teamID ~= new.teamID or old.position[1] ~= new.position[1] or old.position[2] ~= new.position[2] or old.position[3] ~= new.position[3] then modified = true break end diff --git a/luaui/Widgets/map_startbox.lua b/luaui/Widgets/map_startbox.lua index 42401e5a640..82169a4e347 100644 --- a/luaui/Widgets/map_startbox.lua +++ b/luaui/Widgets/map_startbox.lua @@ -9,7 +9,7 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", layer = 0, enabled = true, - depends = {'gl4'} + depends = { "gl4" }, } end @@ -65,7 +65,7 @@ local font2 = gl.LoadFont(fontfile2, fontfileSize * fontfileScale, fontfileOutli local useThickLeterring = false local fontSize = 18 -local fontShadow = true -- only shows if font has a white outline +local fontShadow = true -- only shows if font has a white outline local shadowOpacity = 0.35 local infotextFontsize = 13 @@ -77,9 +77,9 @@ local widgetScale = (1 + (vsx * vsy / 5500000)) local startPosRatio = 0.0001 local startPosScale if getCurrentMiniMapRotationOption() == ROTATION.DEG_90 or getCurrentMiniMapRotationOption() == ROTATION.DEG_270 then - startPosScale = (vsx*startPosRatio) / select(4, Spring.GetMiniMapGeometry()) + startPosScale = (vsx * startPosRatio) / select(4, Spring.GetMiniMapGeometry()) else - startPosScale = (vsx*startPosRatio) / select(3, Spring.GetMiniMapGeometry()) + startPosScale = (vsx * startPosRatio) / select(3, Spring.GetMiniMapGeometry()) end local isSpec = spGetSpectatingState() or Spring.IsReplay() @@ -141,8 +141,8 @@ VFS.Include("common/lib_startpoint_guesser.lua") -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local aiNameI18NTable = {name = ""} -local aiLocationI18NTable = {playerName = "", aiName = ""} +local aiNameI18NTable = { name = "" } +local aiLocationI18NTable = { playerName = "", aiName = "" } local aiNameCache = {} local aiNameLockedCache = {} @@ -160,12 +160,12 @@ local function getAIName(teamID, includeLock) local _, playerID, _, isAI = spGetTeamInfo(teamID, false) if isAI then local _, _, _, aiName = Spring.GetAIInfo(teamID) - local niceName = Spring.GetGameRulesParam('ainame_' .. teamID) + local niceName = Spring.GetGameRulesParam("ainame_" .. teamID) if niceName then aiName = niceName end aiNameI18NTable.name = aiName - baseName = Spring.I18N('ui.playersList.aiName', aiNameI18NTable) + baseName = Spring.I18N("ui.playersList.aiName", aiNameI18NTable) else local name = spGetPlayerInfo(playerID, false) baseName = WG.playernames and WG.playernames.getPlayername(playerID) or name @@ -209,7 +209,7 @@ local function getCachedManualPlacement(teamID) end end - aiManualPlacementCache[teamID] = {raw = raw, x = x, z = z} + aiManualPlacementCache[teamID] = { raw = raw, x = x, z = z } return x, z, raw end @@ -253,7 +253,7 @@ local function assignTeamColors() local cached = teamColorComponents[teamID] if not cached or cached[1] ~= r or cached[2] ~= g or cached[3] ~= b then if not cached then - teamColorComponents[teamID] = {r, g, b} + teamColorComponents[teamID] = { r, g, b } else cached[1], cached[2], cached[3] = r, g, b end @@ -271,8 +271,8 @@ end local function createCommanderNameList(name, teamID) commanderNameList[teamID] = {} - commanderNameList[teamID]['name'] = name - commanderNameList[teamID]['list'] = gl.CreateList(function() + commanderNameList[teamID]["name"] = name + commanderNameList[teamID]["list"] = gl.CreateList(function() local x, y = 0, 0 local r, g, b = GetTeamColor(teamID) local outlineColor = { 0, 0, 0, 1 } @@ -298,7 +298,7 @@ local function createCommanderNameList(name, teamID) font2:End() end font2:Begin() - font2:SetTextColor({r, g, b}) + font2:SetTextColor({ r, g, b }) font2:SetOutlineColor(outlineColor) font2:Print(name, x, y, usedFontSize, "con") font2:End() @@ -306,21 +306,21 @@ local function createCommanderNameList(name, teamID) end local function drawName(x, y, name, teamID) - if commanderNameList[teamID] == nil or commanderNameList[teamID]['name'] ~= name then + if commanderNameList[teamID] == nil or commanderNameList[teamID]["name"] ~= name then if commanderNameList[teamID] ~= nil then - gl.DeleteList(commanderNameList[teamID]['list']) + gl.DeleteList(commanderNameList[teamID]["list"]) end createCommanderNameList(name, teamID) end glPushMatrix() glTranslate(mathFloor(x), mathFloor(y), 0) - glCallList(commanderNameList[teamID]['list']) + glCallList(commanderNameList[teamID]["list"]) glPopMatrix() end local function createInfotextList() - local infotext = Spring.I18N('ui.startSpot.anywhere') - local infotextBoxes = Spring.I18N('ui.startSpot.startbox') + local infotext = Spring.I18N("ui.startSpot.anywhere") + local infotextBoxes = Spring.I18N("ui.startSpot.startbox") if infotextList then gl.DeleteList(infotextList) @@ -335,7 +335,6 @@ local function createInfotextList() end) end - local posCache = {} local function getEffectiveStartPosition(teamID) @@ -376,7 +375,7 @@ local function getEffectiveStartPosition(teamID) if posCacheTeam then posCacheTeam[1], posCacheTeam[2], posCacheTeam[3], posCacheTeam[4] = x, y, z, true else - posCache[teamID] = {x, y, z, true} + posCache[teamID] = { x, y, z, true } end return x, y, z end @@ -412,8 +411,7 @@ local function shouldRenderTeam(teamID, excludeMyTeam) local x, y, z = getEffectiveStartPosition(teamID) - local isVisible = (not spec or isAI) and teamID ~= gaiaTeamID and - (not isAI or teamAllyTeamID == myAllyTeamID or isSpec or allowEnemyAIPlacement) + local isVisible = (not spec or isAI) and teamID ~= gaiaTeamID and (not isAI or teamAllyTeamID == myAllyTeamID or isSpec or allowEnemyAIPlacement) local isValidPosition = x ~= nil and x > 0 and z > 0 and y > -500 @@ -426,13 +424,15 @@ local function notifySpawnPositionsChanged() return end - for k in pairs(allSpawnPositions) do allSpawnPositions[k] = nil end + for k in pairs(allSpawnPositions) do + allSpawnPositions[k] = nil + end for _, teamID in ipairs(cachedTeamList) do local shouldRender, x, y, z = shouldRenderTeam(teamID, false) if shouldRender then local entry = allSpawnPositions[teamID] if not entry then - allSpawnPositions[teamID] = {x = x, z = z} + allSpawnPositions[teamID] = { x = x, z = z } else entry.x, entry.z = x, z end @@ -465,7 +465,7 @@ local function invalidateMinimapIcons() end local function CoopStartPoint(playerID, x, y, z) - coopStartPoints[playerID] = {x, y, z} + coopStartPoints[playerID] = { x, y, z } invalidateMinimapIcons() notifySpawnPositionsChanged() end @@ -506,34 +506,34 @@ local pushElementInstance = InstanceVBOTable.pushElementInstance -- spEcho('Spring.GetGroundExtremes', minY, maxY, waterlevel) local shaderSourceCache = { - vssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.vert.glsl", - fssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.frag.glsl", - uniformInt = { - mapDepths = 0, - myAllyTeamID = -1, - isMiniMap = 0, - roationMiniMap = 0, - mapNormals = 1, - heightMapTex = 2, - scavTexture = 3, - raptorTexture = 4, - }, - uniformFloat = { - pingData = {0,0,0,-10000}, -- x,y,z, time - isMiniMap = 0, - pipVisibleArea = {0, 1, 0, 1}, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap - }, - shaderName = "Start Polygons GL4", - shaderConfig = { - ALPHA = 0.5, - NUM_POLYGONS = 0, - NUM_POINTS = 0, - MAX_STEEPNESS = math.cos(math.rad(54)), - SCAV_ALLYTEAM_ID = scavengerAIAllyTeamID, -- these neatly become undefined if not present - RAPTOR_ALLYTEAM_ID = raptorsAIAllyTeamID, - }, - silent = (not autoReload), - } + vssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.vert.glsl", + fssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.frag.glsl", + uniformInt = { + mapDepths = 0, + myAllyTeamID = -1, + isMiniMap = 0, + roationMiniMap = 0, + mapNormals = 1, + heightMapTex = 2, + scavTexture = 3, + raptorTexture = 4, + }, + uniformFloat = { + pingData = { 0, 0, 0, -10000 }, -- x,y,z, time + isMiniMap = 0, + pipVisibleArea = { 0, 1, 0, 1 }, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap + }, + shaderName = "Start Polygons GL4", + shaderConfig = { + ALPHA = 0.5, + NUM_POLYGONS = 0, + NUM_POINTS = 0, + MAX_STEEPNESS = math.cos(math.rad(54)), + SCAV_ALLYTEAM_ID = scavengerAIAllyTeamID, -- these neatly become undefined if not present + RAPTOR_ALLYTEAM_ID = raptorsAIAllyTeamID, + }, + silent = not autoReload, +} local fullScreenRectVAO local startPolygonShader @@ -548,27 +548,26 @@ local coneShaderSourceCache = { }, uniformFloat = { isMiniMap = 0, - pipVisibleArea = {0, 1, 0, 1}, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap + pipVisibleArea = { 0, 1, 0, 1 }, -- left, right, bottom, top in normalized [0,1] coords for PIP minimap }, shaderName = "Start Cones GL4", shaderConfig = { ALPHA = 0.5, }, - silent = (not autoReload), + silent = not autoReload, } local startConeVBOTable = nil local startConeShader = nil local function DrawStartPolygons(inminimap) - local _, advMapShading = Spring.HaveAdvShading() if advMapShading then gl.Texture(0, "$map_gbuffer_zvaltex") else - if WG['screencopymanager'] and WG['screencopymanager'].GetDepthCopy() then - gl.Texture(0, WG['screencopymanager'].GetDepthCopy()) + if WG["screencopymanager"] and WG["screencopymanager"].GetDepthCopy() then + gl.Texture(0, WG["screencopymanager"].GetDepthCopy()) else spEcho("Start Polygons: Adv map shading not available, and no depth copy available") return @@ -576,7 +575,7 @@ local function DrawStartPolygons(inminimap) end gl.Texture(1, "$normals") - gl.Texture(2, "$heightmap")-- Texture file + gl.Texture(2, "$heightmap") -- Texture file gl.Texture(3, scavengerStartBoxTexture) gl.Texture(4, raptorStartBoxTexture) @@ -595,8 +594,8 @@ local function DrawStartPolygons(inminimap) startPolygonShader:SetUniformInt("myAllyTeamID", myAllyTeamID or -1) -- Pass PIP visible area if drawing in PIP minimap - if inminimap and WG['minimap'] and WG['minimap'].isDrawingInPip and WG['minimap'].getNormalizedVisibleArea then - local left, right, bottom, top = WG['minimap'].getNormalizedVisibleArea() + if inminimap and WG["minimap"] and WG["minimap"].isDrawingInPip and WG["minimap"].getNormalizedVisibleArea then + local left, right, bottom, top = WG["minimap"].getNormalizedVisibleArea() startPolygonShader:SetUniform("pipVisibleArea", left, right, bottom, top) else startPolygonShader:SetUniform("pipVisibleArea", 0, 1, 0, 1) @@ -618,8 +617,8 @@ local function DrawStartCones(inminimap) startConeShader:SetUniformInt("rotationMiniMap", getCurrentMiniMapRotationOption() or ROTATION.DEG_0) -- Pass PIP visible area if drawing in PIP minimap - if inminimap and WG['minimap'] and WG['minimap'].isDrawingInPip and WG['minimap'].getNormalizedVisibleArea then - local left, right, bottom, top = WG['minimap'].getNormalizedVisibleArea() + if inminimap and WG["minimap"] and WG["minimap"].isDrawingInPip and WG["minimap"].getNormalizedVisibleArea then + local left, right, bottom, top = WG["minimap"].getNormalizedVisibleArea() startConeShader:SetUniform("pipVisibleArea", left, right, bottom, top) else startConeShader:SetUniform("pipVisibleArea", 0, 1, 0, 1) @@ -709,19 +708,19 @@ end local function getStartUnitTexture(teamID) -- Don't cache - need to update when player changes faction - local startUnitDefID = spGetTeamRulesParam(teamID, 'startUnit') + local startUnitDefID = spGetTeamRulesParam(teamID, "startUnit") if startUnitDefID then local uDef = UnitDefs[startUnitDefID] if uDef then -- Check if it's a "random" faction (dummy unit) if uDef.name == "yourmomdummy" or string.sub(uDef.name, 1, 3) == "dum" then - return 'unitpics/other/dice.dds' + return "unitpics/other/dice.dds" end - return 'unitpics/' .. uDef.name .. '.dds' + return "unitpics/" .. uDef.name .. ".dds" end end -- Fallback: dice for unknown/random - return 'unitpics/other/dice.dds' + return "unitpics/other/dice.dds" end local function buildIconList(sx, sz) @@ -867,7 +866,9 @@ local function DrawStartUnitIcons(sx, sz, inPip) glCallList(pipIconList) return end - if pipIconList then gl.DeleteList(pipIconList) end + if pipIconList then + gl.DeleteList(pipIconList) + end pipIconList = buildIconList(sx, sz) pipIconListSx = sx pipIconListSz = sz @@ -877,7 +878,9 @@ local function DrawStartUnitIcons(sx, sz, inPip) glCallList(minimapIconList) return end - if minimapIconList then gl.DeleteList(minimapIconList) end + if minimapIconList then + gl.DeleteList(minimapIconList) + end minimapIconList = buildIconList(sx, sz) minimapIconListSx = sx minimapIconListSz = sz @@ -885,11 +888,10 @@ local function DrawStartUnitIcons(sx, sz, inPip) end end - local function InitStartPolygons() local gaiaAllyTeamID if Spring.GetGaiaTeamID() then - gaiaAllyTeamID = select(6, spGetTeamInfo(Spring.GetGaiaTeamID() , false)) + gaiaAllyTeamID = select(6, spGetTeamInfo(Spring.GetGaiaTeamID(), false)) end -- Polygon overlays render only for explicit modoption sources. When the @@ -907,7 +909,7 @@ local function InitStartPolygons() for allyTeamID, entry in pairs(startBoxConfig) do if allyTeamID ~= gaiaAllyTeamID and activeAllyTeams[allyTeamID] and entry.boxes then for _, polygon in ipairs(entry.boxes) do - StartPolygons[#StartPolygons + 1] = {team = allyTeamID, poly = polygon} + StartPolygons[#StartPolygons + 1] = { team = allyTeamID, poly = polygon } end configLoaded = true end @@ -920,7 +922,7 @@ local function InitStartPolygons() for i, teamID in ipairs(Spring.GetAllyTeamList()) do if teamID ~= gaiaAllyTeamID then local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(teamID) - StartPolygons[#StartPolygons + 1] = {team = teamID, poly = {{xn, zn}, {xp, zn}, {xp, zp}, {xn, zp}}} + StartPolygons[#StartPolygons + 1] = { team = teamID, poly = { { xn, zn }, { xp, zn }, { xp, zp }, { xn, zp } } } end end end @@ -929,17 +931,17 @@ local function InitStartPolygons() -- MANUAL OVERRIDE FOR DEBUGGING -- lets add a bunch of silly StartPolygons: StartPolygons = {} - for i = 2,8 do + for i = 2, 8 do local x0 = mathRandom(0, Game.mapSizeX) local y0 = mathRandom(0, Game.mapSizeZ) - local polygon = {{x0, y0}} + local polygon = { { x0, y0 } } for j = 2, math.ceil(mathRandom() * 10) do local x1 = mathRandom(0, Game.mapSizeX / 5) local y1 = mathRandom(0, Game.mapSizeZ / 5) - polygon[#polygon+1] = {x0+x1, y0+y1} + polygon[#polygon + 1] = { x0 + x1, y0 + y1 } end - StartPolygons[#StartPolygons+1] = {team = i, poly = polygon} + StartPolygons[#StartPolygons + 1] = { team = i, poly = polygon } end end @@ -988,23 +990,25 @@ local function InitStartPolygons() local numPoints = #polygon for _, vertex in ipairs(polygon) do local x, z = vertex[1], vertex[2] - bufferdata[#bufferdata+1] = teamID - bufferdata[#bufferdata+1] = numPoints - bufferdata[#bufferdata+1] = x - bufferdata[#bufferdata+1] = z + bufferdata[#bufferdata + 1] = teamID + bufferdata[#bufferdata + 1] = numPoints + bufferdata[#bufferdata + 1] = x + bufferdata[#bufferdata + 1] = z numvertices = numvertices + 1 end end -- SHADER_STORAGE_BUFFER MUST HAVE 64 byte aligned data if numvertices % 4 ~= 0 then - for i=1, ((4 - (numvertices % 4)) * 4) do bufferdata[#bufferdata+1] = -1 end + for i = 1, ((4 - (numvertices % 4)) * 4) do + bufferdata[#bufferdata + 1] = -1 + end numvertices = numvertices + (4 - numvertices % 4) end startPolygonBuffer = gl.GetVBO(GL_SHADER_STORAGE_BUFFER, false) -- not updated a lot - startPolygonBuffer:Define(numvertices, {{id = 0, name = 'starttriangles', size = 4}}) - startPolygonBuffer:Upload(bufferdata)--, -1, 0, 0, numvertices-1) + startPolygonBuffer:Define(numvertices, { { id = 0, name = "starttriangles", size = 4 } }) + startPolygonBuffer:Upload(bufferdata) --, -1, 0, 0, numvertices-1) shaderSourceCache.shaderConfig.NUM_POLYGONS = numPolygons shaderSourceCache.shaderConfig.NUM_POINTS = numvertices @@ -1021,8 +1025,8 @@ local function InitStartPolygons() startConeVBOTable = InstanceVBOTable.makeInstanceVBOTable( { -- Cause 0-1-2 contain primitive per-vertex data - {id = 3, name = 'worldposradius', size = 4}, -- xpos, ypos, zpos, radius - {id = 4, name = 'teamColor', size = 4}, -- rgba + { id = 3, name = "worldposradius", size = 4 }, -- xpos, ypos, zpos, radius + { id = 4, name = "teamColor", size = 4 }, -- rgba }, 64, -- maxelements "StartConeVBO" -- name @@ -1036,7 +1040,7 @@ local function InitStartPolygons() startConeVBOTable.vertexVBO = coneVBO - startConeVBOTable.VAO = InstanceVBOTable.makeVAOandAttach(startConeVBOTable.vertexVBO,startConeVBOTable.instanceVBO) + startConeVBOTable.VAO = InstanceVBOTable.makeVAOandAttach(startConeVBOTable.vertexVBO, startConeVBOTable.instanceVBO) startConeShader = LuaShader.CheckShaderUpdates(coneShaderSourceCache) or startConeShader @@ -1045,7 +1049,6 @@ local function InitStartPolygons() widgetHandler:RemoveWidget() return end - end -------------------------------------------------------------------------------- @@ -1058,8 +1061,8 @@ function widget:Initialize() tooCloseToSpawn = Spring.GetGameRulesParam("tooCloseToSpawn") or 350 - WG['map_startbox'] = {} - WG['map_startbox'].GetEffectiveStartPosition = getEffectiveStartPosition + WG["map_startbox"] = {} + WG["map_startbox"].GetEffectiveStartPosition = getEffectiveStartPosition updateTeamList() assignTeamColors() @@ -1081,7 +1084,7 @@ function widget:Initialize() end if startX and startZ then - aiPlacedPositions[teamID] = {x = startX, z = startZ} + aiPlacedPositions[teamID] = { x = startX, z = startZ } aiPlacementStatus[teamID] = true end else @@ -1120,7 +1123,7 @@ function widget:Shutdown() gl.DeleteFont(font) gl.DeleteFont(font2) gl.DeleteFont(shadowFont) - WG['map_startbox'] = nil + WG["map_startbox"] = nil end -------------------------------------------------------------------------------- @@ -1229,11 +1232,10 @@ function widget:DrawInMiniMap(sx, sz) end -- Check if we're being called from PIP minimap - local inPip = WG['minimap'] and WG['minimap'].isDrawingInPip + local inPip = WG["minimap"] and WG["minimap"].isDrawingInPip DrawStartPolygons(true) DrawStartUnitIcons(sx, sz, inPip) - end function widget:ViewResize(x, y) @@ -1242,9 +1244,9 @@ function widget:ViewResize(x, y) local currRot = getCurrentMiniMapRotationOption() if currRot == ROTATION.DEG_90 or currRot == ROTATION.DEG_270 then - startPosScale = (vsx*startPosRatio) / select(4, Spring.GetMiniMapGeometry()) + startPosScale = (vsx * startPosRatio) / select(4, Spring.GetMiniMapGeometry()) else - startPosScale = (vsx*startPosRatio) / select(3, Spring.GetMiniMapGeometry()) + startPosScale = (vsx * startPosRatio) / select(3, Spring.GetMiniMapGeometry()) end removeTeamLists() invalidateMinimapIcons() @@ -1285,9 +1287,9 @@ function widget:Update(delta) end if draftMode == nil or draftMode == "disabled" then -- otherwise draft mod will play it instead - if not isSpec and not amPlaced and not playedChooseStartLoc and placeVoiceNotifTimer < os.clock() and WG['notifications'] then + if not isSpec and not amPlaced and not playedChooseStartLoc and placeVoiceNotifTimer < os.clock() and WG["notifications"] then playedChooseStartLoc = true - WG['notifications'].addEvent('ChooseStartLoc', true) + WG["notifications"].addEvent("ChooseStartLoc", true) end end @@ -1303,7 +1305,9 @@ function widget:Update(delta) if gameFrame <= 0 and Game.startPosType == 2 then updateCounter = updateCounter + 1 if updateCounter % 30 == 0 then - for k in pairs(currentPlacements) do currentPlacements[k] = nil end + for k in pairs(currentPlacements) do + currentPlacements[k] = nil + end updateTeamList() local hasResync = false @@ -1321,7 +1325,7 @@ function widget:Update(delta) hasResync = true end else - aiPlacedPositions[teamID] = {x = startX, z = startZ} + aiPlacedPositions[teamID] = { x = startX, z = startZ } hasResync = true end aiPlacementStatus[teamID] = true @@ -1337,7 +1341,7 @@ function widget:Update(delta) hasResync = true end else - aiPlacedPositions[teamID] = {x = mxNum, z = mzNum} + aiPlacedPositions[teamID] = { x = mxNum, z = mzNum } hasResync = true end aiPlacementStatus[teamID] = true @@ -1373,7 +1377,7 @@ function widget:Update(delta) if existing then existing.x, existing.z = x, z else - currentPlacements[teamID] = {x = x, z = z} + currentPlacements[teamID] = { x = x, z = z } end end end @@ -1382,9 +1386,7 @@ function widget:Update(delta) local hasChanges = hasResync if not hasChanges then for teamID, placement in pairs(currentPlacements) do - if not lastKnownPlacements[teamID] or - lastKnownPlacements[teamID].x ~= placement.x or - lastKnownPlacements[teamID].z ~= placement.z then + if not lastKnownPlacements[teamID] or lastKnownPlacements[teamID].x ~= placement.x or lastKnownPlacements[teamID].z ~= placement.z then hasChanges = true break end @@ -1401,24 +1403,30 @@ function widget:Update(delta) end if hasChanges then - for k in pairs(lastKnownPlacements) do lastKnownPlacements[k] = nil end + for k in pairs(lastKnownPlacements) do + lastKnownPlacements[k] = nil + end for teamID, placement in pairs(currentPlacements) do local existing = lastKnownPlacements[teamID] if existing then existing.x, existing.z = placement.x, placement.z else - lastKnownPlacements[teamID] = {x = placement.x, z = placement.z} + lastKnownPlacements[teamID] = { x = placement.x, z = placement.z } end end - for k in pairs(aiPredictedPositions) do aiPredictedPositions[k] = nil end - for k in pairs(startPointTable) do startPointTable[k] = nil end + for k in pairs(aiPredictedPositions) do + aiPredictedPositions[k] = nil + end + for k in pairs(startPointTable) do + startPointTable[k] = nil + end for teamID, placement in pairs(currentPlacements) do local existing = startPointTable[teamID] if existing then existing[1], existing[2] = placement.x, placement.z else - startPointTable[teamID] = {placement.x, placement.z} + startPointTable[teamID] = { placement.x, placement.z } end end @@ -1435,7 +1443,7 @@ function widget:Update(delta) if existing then existing.x, existing.z = x, z else - aiPredictedPositions[teamID] = {x = x, z = z} + aiPredictedPositions[teamID] = { x = x, z = z } end invalidatePosCacheEntry(teamID) hasChanges = true @@ -1475,14 +1483,14 @@ function widget:RecvLuaMsg(msg) invalidatePosCacheEntry(teamID) aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) - Spring.SendMessage(Spring.I18N('ui.startbox.aiStartLocationRemoved', aiLocationI18NTable)) + Spring.SendMessage(Spring.I18N("ui.startbox.aiStartLocationRemoved", aiLocationI18NTable)) else - aiPlacedPositions[teamID] = {x = x, z = z} + aiPlacedPositions[teamID] = { x = x, z = z } aiPlacementStatus[teamID] = true invalidatePosCacheEntry(teamID) aiLocationI18NTable.playerName = spGetPlayerInfo(Spring.GetMyPlayerID(), false) aiLocationI18NTable.aiName = getAIName(teamID) - Spring.SendMessage(Spring.I18N('ui.startbox.aiStartLocationChanged', aiLocationI18NTable)) + Spring.SendMessage(Spring.I18N("ui.startbox.aiStartLocationChanged", aiLocationI18NTable)) end invalidateMinimapIcons() @@ -1599,7 +1607,7 @@ function widget:MouseRelease(x, y, button) if xmin < xmax and zmin < zmax then if finalX >= xmin and finalX <= xmax and finalZ >= zmin and finalZ <= zmax then - aiPlacedPositions[draggingTeamID] = {x = finalX, z = finalZ} + aiPlacedPositions[draggingTeamID] = { x = finalX, z = finalZ } posCache[draggingTeamID] = nil Spring.SendLuaRulesMsg("aiPlacedPosition:" .. draggingTeamID .. ":" .. finalX .. ":" .. finalZ) notifySpawnPositionsChanged() diff --git a/luaui/Widgets/map_startpolygon_gl4.lua b/luaui/Widgets/map_startpolygon_gl4.lua index 38e291e8d01..10c0b60e568 100644 --- a/luaui/Widgets/map_startpolygon_gl4.lua +++ b/luaui/Widgets/map_startpolygon_gl4.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathRandom = math.random @@ -29,7 +28,7 @@ local spEcho = Spring.Echo -- TODO: -- [ ] Handle overlapping of boxes and myAllyTeamID -- [X] Handle Minimap drawing too - -- [X] handle flipped minimaps +-- [X] handle flipped minimaps -- [ ] Pass in my team too -- [ ] Handle Scavengers in scavenger color -- [ ] Handle Raptors in raptor color @@ -55,33 +54,33 @@ local InstanceVBOTable = gl.InstanceVBOTable local minY, maxY = Spring.GetGroundExtremes() local shaderSourceCache = { - vssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.vert.glsl", - fssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.frag.glsl", - uniformInt = { - mapDepths = 0, - myAllyTeamID = -1, - isMiniMap = 0, - rotationMiniMap = 0, - mapNormals = 1, - heightMapTex = 2, - scavTexture = 3, - raptorTexture = 4, - }, - uniformFloat = { - pingData = {0,0,0,-10000}, -- x,y,z, time - }, - shaderName = "Start Polygons GL4", - shaderConfig = { - ALPHA = 0.5, - NUM_POLYGONS = 0, - NUM_POINTS = 0, - MINY = minY - 10, - MAXY = maxY + 100, - MAX_STEEPNESS = 0.5877, -- 45 degrees yay (cos is 0.7071? (54 degrees, so cos of that is 0.5877 ) - SCAV_ALLYTEAM_ID = scavengerAIAllyTeamID, -- these neatly become undefined if not present - RAPTOR_ALLYTEAM_ID = raptorsAIAllyTeamID, - }, - } + vssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.vert.glsl", + fssrcpath = "LuaUI/Shaders/map_startpolygon_gl4.frag.glsl", + uniformInt = { + mapDepths = 0, + myAllyTeamID = -1, + isMiniMap = 0, + rotationMiniMap = 0, + mapNormals = 1, + heightMapTex = 2, + scavTexture = 3, + raptorTexture = 4, + }, + uniformFloat = { + pingData = { 0, 0, 0, -10000 }, -- x,y,z, time + }, + shaderName = "Start Polygons GL4", + shaderConfig = { + ALPHA = 0.5, + NUM_POLYGONS = 0, + NUM_POINTS = 0, + MINY = minY - 10, + MAXY = maxY + 100, + MAX_STEEPNESS = 0.5877, -- 45 degrees yay (cos is 0.7071? (54 degrees, so cos of that is 0.5877 ) + SCAV_ALLYTEAM_ID = scavengerAIAllyTeamID, -- these neatly become undefined if not present + RAPTOR_ALLYTEAM_ID = raptorsAIAllyTeamID, + }, +} local fullScreenRectVAO local startPolygonShader @@ -93,8 +92,8 @@ local function DrawStartPolygons(inminimap) if advMapShading then gl.Texture(0, "$map_gbuffer_zvaltex") else - if WG['screencopymanager'] and WG['screencopymanager'].GetDepthCopy() then - gl.Texture(0, WG['screencopymanager'].GetDepthCopy()) + if WG["screencopymanager"] and WG["screencopymanager"].GetDepthCopy() then + gl.Texture(0, WG["screencopymanager"].GetDepthCopy()) else spEcho("Start Polygons: Adv map shading not available, and no depth copy available") return @@ -102,7 +101,7 @@ local function DrawStartPolygons(inminimap) end gl.Texture(1, "$normals") - gl.Texture(2, "$heightmap")-- Texture file + gl.Texture(2, "$heightmap") -- Texture file gl.Texture(3, scavengerStartBoxTexture) gl.Texture(4, raptorStartBoxTexture) @@ -144,14 +143,14 @@ end function widget:Initialize() local gaiaAllyTeamID if Spring.GetGaiaTeamID() then - gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID() , false)) + gaiaAllyTeamID = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID(), false)) end for i, teamID in ipairs(Spring.GetAllyTeamList()) do if teamID ~= gaiaAllyTeamID then --and teamID ~= scavengerAIAllyTeamID and teamID ~= raptorsAIAllyTeamID then local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(teamID) --spEcho("Allyteam",teamID,"startbox",xn, zn, xp, zp) - StartPolygons[teamID] = {{xn, zn}, {xp, zn}, {xp, zp}, {xn, zp}} + StartPolygons[teamID] = { { xn, zn }, { xp, zn }, { xp, zp }, { xn, zp } } end end @@ -159,17 +158,17 @@ function widget:Initialize() -- MANUAL OVERRIDE FOR DEBUGGING -- lets add a bunch of silly StartPolygons: StartPolygons = {} - for i = 2,8 do + for i = 2, 8 do local x0 = mathRandom(0, Game.mapSizeX) local y0 = mathRandom(0, Game.mapSizeZ) - local polygon = {{x0, y0}} + local polygon = { { x0, y0 } } for j = 2, math.ceil(mathRandom() * 10) do local x1 = mathRandom(0, Game.mapSizeX / 5) local y1 = mathRandom(0, Game.mapSizeZ / 5) - polygon[#polygon+1] = {x0+x1, y0+y1} + polygon[#polygon + 1] = { x0 + x1, y0 + y1 } end - StartPolygons[#StartPolygons+1] = polygon + StartPolygons[#StartPolygons + 1] = polygon end end @@ -185,23 +184,25 @@ function widget:Initialize() --spEcho("teamID", teamID, "at " ,xn, zn, xp, zp) for vertexID, vertex in ipairs(polygon) do local x, z = vertex[1], vertex[2] - bufferdata[#bufferdata+1] = teamID - bufferdata[#bufferdata+1] = numPoints - bufferdata[#bufferdata+1] = x - bufferdata[#bufferdata+1] = z + bufferdata[#bufferdata + 1] = teamID + bufferdata[#bufferdata + 1] = numPoints + bufferdata[#bufferdata + 1] = x + bufferdata[#bufferdata + 1] = z numvertices = numvertices + 1 end end -- SHADER_STORAGE_BUFFER MUST HAVE 64 byte aligned data if numvertices % 4 ~= 0 then - for i=1, ((4 - (numvertices % 4)) * 4) do bufferdata[#bufferdata+1] = -1 end + for i = 1, ((4 - (numvertices % 4)) * 4) do + bufferdata[#bufferdata + 1] = -1 + end numvertices = numvertices + (4 - numvertices % 4) end startPolygonBuffer = gl.GetVBO(GL.SHADER_STORAGE_BUFFER, false) -- not updated a lot - startPolygonBuffer:Define(numvertices, {{id = 0, name = 'starttriangles', size = 4}}) - startPolygonBuffer:Upload(bufferdata)--, -1, 0, 0, numvertices-1) + startPolygonBuffer:Define(numvertices, { { id = 0, name = "starttriangles", size = 4 } }) + startPolygonBuffer:Upload(bufferdata) --, -1, 0, 0, numvertices-1) shaderSourceCache.shaderConfig.NUM_POLYGONS = numPolygons shaderSourceCache.shaderConfig.NUM_POINTS = numvertices diff --git a/luaui/Widgets/minimap_relative.lua b/luaui/Widgets/minimap_relative.lua index 687846a8b3b..0568949f4e0 100644 --- a/luaui/Widgets/minimap_relative.lua +++ b/luaui/Widgets/minimap_relative.lua @@ -14,18 +14,17 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "RelativeMinimap", - desc = "Keeps the minimap at a relative size (maxspect)", - author = "trepan", - date = "Feb 5, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "RelativeMinimap", + desc = "Keeps the minimap at a relative size (maxspect)", + author = "trepan", + date = "Feb 5, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -- Localized functions for performance local mathFloor = math.floor @@ -44,7 +43,6 @@ local yoff = 2 local xmax = 0.262 local ymax = 0.310 - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -54,7 +52,6 @@ local ymax = 0.310 xoff = mathFloor(xoff) yoff = mathFloor(yoff) - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -62,36 +59,34 @@ local getCurrentMiniMapRotationOption = VFS.Include("luaui/Include/minimap_utils local ROTATION = VFS.Include("luaui/Include/minimap_utils.lua").ROTATION function widget:Initialize() - widget:ViewResize(widgetHandler:GetViewSizes()) + widget:ViewResize(widgetHandler:GetViewSizes()) end - function widget:ViewResize(viewSizeX, viewSizeY) - -- the extra 2 pixels are for the minimap border - local xp = mathFloor(viewSizeX * xmax) - xoff - 2 - local yp = mathFloor(viewSizeY * ymax) - yoff - 2 - local limitAspect = (xp / yp) - local currRot = getCurrentMiniMapRotationOption() - local mapAspect - if currRot == ROTATION.DEG_90 or currRot == ROTATION.DEG_270 then - mapAspect = (Game.mapSizeZ / Game.mapSizeX) - else - mapAspect = (Game.mapSizeX / Game.mapSizeZ) - end - - local sx, sy - if (mapAspect > limitAspect) then - sx = xp - sy = xp / mapAspect - else - sx = yp * mapAspect - sy = yp - end - sx = mathFloor(sx) - sy = mathFloor(sy) - gl.ConfigMiniMap(xoff, viewSizeY - sy - yoff, sx, sy) + -- the extra 2 pixels are for the minimap border + local xp = mathFloor(viewSizeX * xmax) - xoff - 2 + local yp = mathFloor(viewSizeY * ymax) - yoff - 2 + local limitAspect = (xp / yp) + local currRot = getCurrentMiniMapRotationOption() + local mapAspect + if currRot == ROTATION.DEG_90 or currRot == ROTATION.DEG_270 then + mapAspect = (Game.mapSizeZ / Game.mapSizeX) + else + mapAspect = (Game.mapSizeX / Game.mapSizeZ) + end + + local sx, sy + if mapAspect > limitAspect then + sx = xp + sy = xp / mapAspect + else + sx = yp * mapAspect + sy = yp + end + sx = mathFloor(sx) + sy = mathFloor(sy) + gl.ConfigMiniMap(xoff, viewSizeY - sy - yoff, sx, sy) end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/luaui/Widgets/minimap_rotation_manager.lua b/luaui/Widgets/minimap_rotation_manager.lua index 5189b82caa7..e2aae2cc727 100644 --- a/luaui/Widgets/minimap_rotation_manager.lua +++ b/luaui/Widgets/minimap_rotation_manager.lua @@ -10,7 +10,6 @@ function widget:GetInfo() } end - -- Localized functions for performance local mathFloor = math.floor @@ -47,7 +46,8 @@ local spEcho = Spring.Echo - minimap_rotate mode autoRotate - minimap_rotate set 90 absolute - minimap_rotate toggleTracking -]]-- +]] +-- local CameraRotationModes = { none = 1, @@ -65,17 +65,16 @@ local autoFitTargetRot = nil local autoFitCameraApplied = false local lastGameID = nil - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local spSetMiniRot = Spring.SetMiniMapRotation -local spGetMiniRot = Spring.GetMiniMapRotation -local spGetCameraState = Spring.GetCameraState +local spSetMiniRot = Spring.SetMiniMapRotation +local spGetMiniRot = Spring.GetMiniMapRotation +local spGetCameraState = Spring.GetCameraState local PI = math.pi local HALFPI = PI / 2 local TWOPI = PI * 2 -local AUTOFIT_HYSTERESIS = PI / 6 -- ~30°: camera must move this far past the midpoint before the minimap flips +local AUTOFIT_HYSTERESIS = PI / 6 -- ~30°: camera must move this far past the midpoint before the minimap flips -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -104,12 +103,10 @@ local function minimapRotateHandler(_, _, args) return end - WG['options'].applyOptionValue("minimaprotation", newMode) + WG["options"].applyOptionValue("minimaprotation", newMode) spEcho("[MinimapManager] Mode set to " .. args[2]) return true - elseif module == "set" then - local rotationArg = tonumber(args[2]) or nil local absoluteArg = args[3] == "absolute" @@ -136,7 +133,6 @@ local function minimapRotateHandler(_, _, args) spSetMiniRot(newRotation) return true - elseif module == "toggleTracking" then trackingLock = not trackingLock spEcho("[MinimapManager] Tracking lock is now " .. (trackingLock and "enabled" or "disabled")) @@ -147,13 +143,19 @@ local function minimapRotateHandler(_, _, args) end local function isValidOption(num) - if num == nil then return false end - if num < CameraRotationModes.none or num > CameraRotationModes.autoLandscape then return false end + if num == nil then + return false + end + if num < CameraRotationModes.none or num > CameraRotationModes.autoLandscape then + return false + end return true end local function applyAutoFitRotation() - if mode ~= CameraRotationModes.autoLandscape then return end + if mode ~= CameraRotationModes.autoLandscape then + return + end local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ if mapSizeZ > mapSizeX then @@ -208,8 +210,8 @@ local function applyAutoFitRotation() end function widget:Initialize() - WG['minimaprotationmanager'] = {} - WG['minimaprotationmanager'].setMode = function(newMode) + WG["minimaprotationmanager"] = {} + WG["minimaprotationmanager"].setMode = function(newMode) if isValidOption(newMode) then mode = newMode prevSnap = nil @@ -232,11 +234,11 @@ function widget:Initialize() end end - WG['minimaprotationmanager'].getMode = function() + WG["minimaprotationmanager"].getMode = function() return mode end - local temp = WG['options'].getOptionValue("minimaprotation") + local temp = WG["options"].getOptionValue("minimaprotation") if isValidOption(temp) then -- Sync up when the widget was unloaded mode = temp end @@ -257,14 +259,18 @@ function widget:Initialize() end function widget:Shutdown() - WG['minimaprotationmanager'] = nil + WG["minimaprotationmanager"] = nil end function widget:Update() - if mode ~= CameraRotationModes.autoLandscape or autoFitApplied then return end + if mode ~= CameraRotationModes.autoLandscape or autoFitApplied then + return + end local currentGameID = Game.gameID or Spring.GetGameRulesParam("GameID") - if not currentGameID then return end -- game not loaded yet + if not currentGameID then + return + end -- game not loaded yet if currentGameID ~= lastGameID then -- New game: reset so it recalculates direction @@ -282,7 +288,9 @@ function widget:Update() end function widget:CameraRotationChanged(_, roty) - if trackingLock then return end + if trackingLock then + return + end if mode == CameraRotationModes.autoLandscape then if Game.mapSizeZ > Game.mapSizeX then @@ -297,7 +305,7 @@ function widget:CameraRotationChanged(_, roty) -- Hysteresis: only flip when camera is well past the midpoint boundary if prevSnap ~= nil and newRot ~= prevSnap then if distFromBoundary < AUTOFIT_HYSTERESIS then - return -- too close to boundary, keep current orientation + return -- too close to boundary, keep current orientation end end if newRot ~= prevSnap then @@ -323,7 +331,7 @@ function widget:CameraRotationChanged(_, roty) return else -- Square map: free 90° rotation like autoRotate - local newRot = HALFPI * (mathFloor((roty/HALFPI) + 0.5) % 4) + local newRot = HALFPI * (mathFloor((roty / HALFPI) + 0.5) % 4) if newRot ~= prevSnap then prevSnap = newRot spSetMiniRot(newRot) @@ -332,12 +340,14 @@ function widget:CameraRotationChanged(_, roty) end end - if mode == CameraRotationModes.none then return end + if mode == CameraRotationModes.none then + return + end local newRot if mode == CameraRotationModes.autoFlip then - newRot = PI * mathFloor((roty/PI) + 0.5) + newRot = PI * mathFloor((roty / PI) + 0.5) elseif mode == CameraRotationModes.autoRotate then - newRot = HALFPI * (mathFloor((roty/HALFPI) + 0.5) % 4) + newRot = HALFPI * (mathFloor((roty / HALFPI) + 0.5) % 4) end if newRot and newRot ~= prevSnap then prevSnap = newRot diff --git a/luaui/Widgets/snd_mapmark_ping.lua b/luaui/Widgets/snd_mapmark_ping.lua index 9f0019b30c0..5c54a2fbd6b 100644 --- a/luaui/Widgets/snd_mapmark_ping.lua +++ b/luaui/Widgets/snd_mapmark_ping.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Mapmark Ping", - desc = "Plays a sound when a point mapmark is placed by an allied player.", - author = "hihoman23", - date = "June 2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Mapmark Ping", + desc = "Plays a sound when a point mapmark is placed by an allied player.", + author = "hihoman23", + date = "June 2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end local mapmarkFile = "sounds/ui/mappoint2.wav" @@ -26,12 +26,12 @@ local function IsIgnoredPlayer(playerID) if accountID and ignoredAccounts[accountID] then return true end - if name and name ~= '' and ignoredAccounts[name] then + if name and name ~= "" and ignoredAccounts[name] then return true end local aliasName = (WG.playernames and WG.playernames.getPlayername) and WG.playernames.getPlayername(playerID) - if aliasName and aliasName ~= '' and ignoredAccounts[aliasName] then + if aliasName and aliasName ~= "" and ignoredAccounts[aliasName] then return true end @@ -39,23 +39,23 @@ local function IsIgnoredPlayer(playerID) end function widget:Initialize() - WG['mapmarkping'] = {} - WG['mapmarkping'].getMapmarkVolume = function() + WG["mapmarkping"] = {} + WG["mapmarkping"].getMapmarkVolume = function() return volume end - WG['mapmarkping'].setMapmarkVolume = function(value) + WG["mapmarkping"].setMapmarkVolume = function(value) volume = value end end function widget:MapDrawCmd(playerID, cmdType, x, y, z, a, b, c) - if IsIgnoredPlayer(playerID) then + if IsIgnoredPlayer(playerID) then return end - if cmdType == "point" then - Spring.PlaySoundFile( mapmarkFile, volume*20, x, y, z, nil, nil, nil, "ui") - Spring.PlaySoundFile( mapmarkFile, volume*0.3, nil, "ui" ) -- to make sure it's still somewhat audible when far away - end + if cmdType == "point" then + Spring.PlaySoundFile(mapmarkFile, volume * 20, x, y, z, nil, nil, nil, "ui") + Spring.PlaySoundFile(mapmarkFile, volume * 0.3, nil, "ui") -- to make sure it's still somewhat audible when far away + end end function widget:GetConfigData(data) diff --git a/luaui/Widgets/snd_notifications.lua b/luaui/Widgets/snd_notifications.lua index 94051ed3489..14eeb05ea56 100644 --- a/luaui/Widgets/snd_notifications.lua +++ b/luaui/Widgets/snd_notifications.lua @@ -9,7 +9,7 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", version = 1, layer = 5, - enabled = true + enabled = true, } end @@ -24,22 +24,22 @@ local spGetMouseState = Spring.GetMouseState local spEcho = Spring.Echo local spGetSpectatingState = Spring.GetSpectatingState -local defaultVoiceSet = 'en/cephis' +local defaultVoiceSet = "en/cephis" -local windFunctions = VFS.Include('common/wind_functions.lua') +local windFunctions = VFS.Include("common/wind_functions.lua") -local useDefaultVoiceFallback = Spring.GetConfigInt('NotificationsSubstitute', 0) == 1 --false -- when a voiceset has missing file, try to load the default voiceset file instead -local playWelcome = Spring.GetConfigInt('WelcomeMessagePlayed', 0) == 0 +local useDefaultVoiceFallback = Spring.GetConfigInt("NotificationsSubstitute", 0) == 1 --false -- when a voiceset has missing file, try to load the default voiceset file instead +local playWelcome = Spring.GetConfigInt("WelcomeMessagePlayed", 0) == 0 local playedWelcome = false -local silentTime = 0.7 -- silent time between queued notifications +local silentTime = 0.7 -- silent time between queued notifications local globalVolume = 0.7 local muteWhenIdle = true --local idleTime = 10 -- after this much sec: mark user as idle local displayMessages = true local spoken = true -local idleBuilderNotificationDelay = 10 * 30 -- (in gameframes) -local tutorialPlayLimit = 2 -- display the same tutorial message only this many times in total (max is always 1 play per game) +local idleBuilderNotificationDelay = 10 * 30 -- (in gameframes) +local tutorialPlayLimit = 2 -- display the same tutorial message only this many times in total (max is always 1 play per game) local updateCommandersFrames = Game.gameSpeed * 5 local victoryConditionAllyID = 999 @@ -49,10 +49,10 @@ end -------------------------------------------------------------------------------- -local wavFileLengths = VFS.Include('sounds/sound_file_lengths.lua') -VFS.Include('common/wav.lua') +local wavFileLengths = VFS.Include("sounds/sound_file_lengths.lua") +VFS.Include("common/wav.lua") -local voiceSet = Spring.GetConfigString('voiceset', defaultVoiceSet) +local voiceSet = Spring.GetConfigString("voiceset", defaultVoiceSet) if #VFS.DirList("sounds/voice/" .. voiceSet, "*.wav") == 0 then voiceSet = defaultVoiceSet end @@ -73,9 +73,9 @@ local soundEffectsFolder = string.gsub("sounds/voice-soundeffects/", "\\", "/") local defaultSoundFolder = string.gsub("sounds/voice/" .. defaultVoiceSet .. "/", "\\", "/") -- load and parse sound files/notifications -local notificationTable = VFS.Include('sounds/voice/config.lua') -if VFS.FileExists(soundFolder .. 'config.lua') then - local voicesetNotificationTable = VFS.Include(soundFolder .. 'config.lua') +local notificationTable = VFS.Include("sounds/voice/config.lua") +if VFS.FileExists(soundFolder .. "config.lua") then + local voicesetNotificationTable = VFS.Include(soundFolder .. "config.lua") notificationTable = table.merge(notificationTable, voicesetNotificationTable) end @@ -93,37 +93,37 @@ local function processNotificationDefs() if notifDef.notifText then notifTexts[currentEntry] = notifDef.notifText else - notifTexts[currentEntry] = 'tips.notifications.' .. string.sub(notifID, 1, 1):lower() .. string.sub(notifID, 2) + notifTexts[currentEntry] = "tips.notifications." .. string.sub(notifID, 1, 1):lower() .. string.sub(notifID, 2) end - if VFS.FileExists(soundFolder .. notifID .. '.wav') then - notifSounds[currentEntry] = soundFolder .. notifID .. '.wav' + if VFS.FileExists(soundFolder .. notifID .. ".wav") then + notifSounds[currentEntry] = soundFolder .. notifID .. ".wav" end for i = 1, 20 do - if VFS.FileExists(soundFolder .. notifID .. i .. '.wav') then + if VFS.FileExists(soundFolder .. notifID .. i .. ".wav") then currentEntry = currentEntry + 1 - notifSounds[currentEntry] = soundFolder .. notifID .. i .. '.wav' + notifSounds[currentEntry] = soundFolder .. notifID .. i .. ".wav" end end if useDefaultVoiceFallback and #notifSounds == 0 then - if VFS.FileExists(defaultSoundFolder .. notifID .. '.wav') then - notifSounds[currentEntry] = defaultSoundFolder .. notifID .. '.wav' + if VFS.FileExists(defaultSoundFolder .. notifID .. ".wav") then + notifSounds[currentEntry] = defaultSoundFolder .. notifID .. ".wav" end for i = 1, 20 do - if VFS.FileExists(defaultSoundFolder .. notifID .. i .. '.wav') then + if VFS.FileExists(defaultSoundFolder .. notifID .. i .. ".wav") then currentEntry = currentEntry + 1 - notifSounds[currentEntry] = defaultSoundFolder .. notifID .. i .. '.wav' + notifSounds[currentEntry] = defaultSoundFolder .. notifID .. i .. ".wav" end end end - if VFS.FileExists(soundFolder .. notifID .. '_rare' .. '.wav') then - notifSoundsRare[currentEntryRare] = soundFolder .. notifID .. '_rare' .. '.wav' + if VFS.FileExists(soundFolder .. notifID .. "_rare" .. ".wav") then + notifSoundsRare[currentEntryRare] = soundFolder .. notifID .. "_rare" .. ".wav" end for i = 1, 20 do - if VFS.FileExists(soundFolder .. notifID .. '_rare' .. i .. '.wav') then + if VFS.FileExists(soundFolder .. notifID .. "_rare" .. i .. ".wav") then currentEntryRare = currentEntryRare + 1 - notifSoundsRare[currentEntryRare] = soundFolder .. notifID .. '_rare' .. i .. '.wav' + notifSoundsRare[currentEntryRare] = soundFolder .. notifID .. "_rare" .. i .. ".wav" end end @@ -153,71 +153,71 @@ end processNotificationDefs() local unitsOfInterestNames = { - armemp = 'UnitDetected/EmpSiloDetected', - cortron = 'UnitDetected/TacticalNukeSiloDetected', - legperdition = "UnitDetected/LongRangeNapalmLauncherDetected", - armsilo = 'UnitDetected/NuclearSiloDetected', - corsilo = 'UnitDetected/NuclearSiloDetected', - corint = 'UnitDetected/LrpcDetected', - armbrtha = 'UnitDetected/LrpcDetected', - leglrpc = 'UnitDetected/LrpcDetected', - corbuzz = 'UnitDetected/CalamityDetected', - armvulc = 'UnitDetected/RagnarokDetected', - legstarfall = 'UnitDetected/StarfallDetected', - armliche = 'UnitDetected/LicheDetected', - corjugg = 'UnitDetected/BehemothDetected', - corkorg = 'UnitDetected/JuggernautDetected', - armbanth = 'UnitDetected/TitanDetected', - armthor = "UnitDetected/ThorDetected", - legeheatraymech = 'UnitDetected/SolinvictusDetected', - armatlas = 'UnitDetected/AirTransportDetected', - corvalk = 'UnitDetected/AirTransportDetected', - leglts = 'UnitDetected/AirTransportDetected', - armhvytrans = 'UnitDetected/AirTransportDetected', - corhvytrans = 'UnitDetected/AirTransportDetected', - legatrans = 'UnitDetected/AirTransportDetected', - armdfly = 'UnitDetected/AirTransportDetected', - corseah = 'UnitDetected/AirTransportDetected', - legstronghold = 'UnitDetected/AirTransportDetected', - legelrpcmech = 'UnitDetected/AstraeusDetected', - - armraz = "UnitDetected/RazorbackDetected", - armmar = "UnitDetected/MarauderDetected", - armvang = "UnitDetected/VanguardDetected", - armlun = "UnitDetected/LunkheadDetected", - armepoch = 'UnitDetected/EpochDetected', - cordemon = "UnitDetected/DemonDetected", - corshiva = "UnitDetected/ShivaDetected", - corsok = "UnitDetected/CataphractDetected", - corkarg = "UnitDetected/KarganethDetected", - corcat = "UnitDetected/CatapultDetected", - corblackhy = 'UnitDetected/BlackHydraDetected', - legeshotgunmech = "UnitDetected/PraetorianDetected", - legjav = "UnitDetected/JavelinDetected", + armemp = "UnitDetected/EmpSiloDetected", + cortron = "UnitDetected/TacticalNukeSiloDetected", + legperdition = "UnitDetected/LongRangeNapalmLauncherDetected", + armsilo = "UnitDetected/NuclearSiloDetected", + corsilo = "UnitDetected/NuclearSiloDetected", + corint = "UnitDetected/LrpcDetected", + armbrtha = "UnitDetected/LrpcDetected", + leglrpc = "UnitDetected/LrpcDetected", + corbuzz = "UnitDetected/CalamityDetected", + armvulc = "UnitDetected/RagnarokDetected", + legstarfall = "UnitDetected/StarfallDetected", + armliche = "UnitDetected/LicheDetected", + corjugg = "UnitDetected/BehemothDetected", + corkorg = "UnitDetected/JuggernautDetected", + armbanth = "UnitDetected/TitanDetected", + armthor = "UnitDetected/ThorDetected", + legeheatraymech = "UnitDetected/SolinvictusDetected", + armatlas = "UnitDetected/AirTransportDetected", + corvalk = "UnitDetected/AirTransportDetected", + leglts = "UnitDetected/AirTransportDetected", + armhvytrans = "UnitDetected/AirTransportDetected", + corhvytrans = "UnitDetected/AirTransportDetected", + legatrans = "UnitDetected/AirTransportDetected", + armdfly = "UnitDetected/AirTransportDetected", + corseah = "UnitDetected/AirTransportDetected", + legstronghold = "UnitDetected/AirTransportDetected", + legelrpcmech = "UnitDetected/AstraeusDetected", + + armraz = "UnitDetected/RazorbackDetected", + armmar = "UnitDetected/MarauderDetected", + armvang = "UnitDetected/VanguardDetected", + armlun = "UnitDetected/LunkheadDetected", + armepoch = "UnitDetected/EpochDetected", + cordemon = "UnitDetected/DemonDetected", + corshiva = "UnitDetected/ShivaDetected", + corsok = "UnitDetected/CataphractDetected", + corkarg = "UnitDetected/KarganethDetected", + corcat = "UnitDetected/CatapultDetected", + corblackhy = "UnitDetected/BlackHydraDetected", + legeshotgunmech = "UnitDetected/PraetorianDetected", + legjav = "UnitDetected/JavelinDetected", legeallterrainmech = "UnitDetected/MyrmidonDetected", - legkeres = "UnitDetected/KeresDetected", - legehovertank = "UnitDetected/CharybdisDetected", - legerailtank = "UnitDetected/DaedalusDetected", - leganavyflagship = 'UnitDetected/NeptuneDetected', - leganavyartyship = 'UnitDetected/CorinthDetected', - - armmanni = "UnitDetected/StarlightDetected", - armmerl = "UnitDetected/AmbassadorDetected", - armfboy = "UnitDetected/FatboyDetected", - corsumo = "UnitDetected/MammothDetected", - corhrk = "UnitDetected/ArbiterDetected", - corgol = "UnitDetected/TzarDetected", - corvroc = "UnitDetected/NegotiatorDetected", - cortrem = "UnitDetected/TremorDetected", - corban = "UnitDetected/BanisherDetected", - corcrwh = "UnitDetected/DragonDetected", - leghrk = "UnitDetected/ThanatosDetected", - legsrail = "UnitDetected/ArquebusDetected", - leginc = "UnitDetected/IncineratorDetected", - legaheattank = "UnitDetected/PrometheusDetected", - legmed = "UnitDetected/MedusaDetected", - leginf = "UnitDetected/InfernoDetected", - legfort = "UnitDetected/TyrannusDetected", + legkeres = "UnitDetected/KeresDetected", + legehovertank = "UnitDetected/CharybdisDetected", + legerailtank = "UnitDetected/DaedalusDetected", + leganavyflagship = "UnitDetected/NeptuneDetected", + leganavyartyship = "UnitDetected/CorinthDetected", + + armmanni = "UnitDetected/StarlightDetected", + armmerl = "UnitDetected/AmbassadorDetected", + armfboy = "UnitDetected/FatboyDetected", + corsumo = "UnitDetected/MammothDetected", + corhrk = "UnitDetected/ArbiterDetected", + corgol = "UnitDetected/TzarDetected", + corvroc = "UnitDetected/NegotiatorDetected", + cortrem = "UnitDetected/TremorDetected", + corban = "UnitDetected/BanisherDetected", + corcrwh = "UnitDetected/DragonDetected", + leghrk = "UnitDetected/ThanatosDetected", + legsrail = "UnitDetected/ArquebusDetected", + leginc = "UnitDetected/IncineratorDetected", + legaheattank = "UnitDetected/PrometheusDetected", + legmed = "UnitDetected/MedusaDetected", + leginf = "UnitDetected/InfernoDetected", + legfort = "UnitDetected/TyrannusDetected", } for name, unitDef in pairs(UnitDefNames) do @@ -226,8 +226,6 @@ for name, unitDef in pairs(UnitDefNames) do end end - - -- convert unitname -> unitDefID local unitsOfInterest = {} for unitName, sound in pairs(unitsOfInterestNames) do @@ -240,14 +238,13 @@ for unitName, sound in pairs(unitsOfInterestNames) do end unitsOfInterestNames = nil - -- added this so they wont get immediately triggered after gamestart -LastPlay['YouAreOverflowingMetal'] = spGetGameFrame() + 1200 +LastPlay["YouAreOverflowingMetal"] = spGetGameFrame() + 1200 --LastPlay['YouAreOverflowingEnergy'] = spGetGameFrame()+300 -LastPlay['YouAreWastingMetal'] = spGetGameFrame() -LastPlay['YouAreWastingEnergy'] = spGetGameFrame() -LastPlay['WholeTeamWastingMetal'] = spGetGameFrame() -LastPlay['WholeTeamWastingEnergy'] = spGetGameFrame() +LastPlay["YouAreWastingMetal"] = spGetGameFrame() +LastPlay["YouAreWastingEnergy"] = spGetGameFrame() +LastPlay["WholeTeamWastingMetal"] = spGetGameFrame() +LastPlay["WholeTeamWastingEnergy"] = spGetGameFrame() local soundQueue = {} local nextSoundQueued = 0 @@ -279,48 +276,48 @@ local myAllyTeamID = Spring.GetMyAllyTeamID() local myRank = select(9, Spring.GetPlayerInfo(myPlayerID)) local spGetTeamResources = Spring.GetTeamResources -local e_currentLevel, e_storage, e_pull, e_income, e_expense, e_share, e_sent, e_received = spGetTeamResources(myTeamID, 'energy') -local m_currentLevel, m_storage, m_pull, m_income, m_expense, m_share, m_sent, m_received = spGetTeamResources(myTeamID, 'metal') +local e_currentLevel, e_storage, e_pull, e_income, e_expense, e_share, e_sent, e_received = spGetTeamResources(myTeamID, "energy") +local m_currentLevel, m_storage, m_pull, m_income, m_expense, m_share, m_sent, m_received = spGetTeamResources(myTeamID, "metal") local tutorialMode = (myRank == 0) local doTutorialMode = tutorialMode -local tutorialPlayed = {} -- store the number of times a tutorial event has played across games -local tutorialPlayedThisGame = {} -- log that a tutorial event has played this game +local tutorialPlayed = {} -- store the number of times a tutorial event has played across games +local tutorialPlayedThisGame = {} -- log that a tutorial event has played this game local unitIsReadyTab = { - { UnitDefNames['armvulc'].id, 'UnitReady/RagnarokIsReady' }, - { UnitDefNames['armbanth'].id, 'UnitReady/TitanIsReady' }, - { UnitDefNames['armepoch'].id, 'UnitReady/FlagshipIsReady' }, - { UnitDefNames['armthor'].id, 'UnitReady/ThorIsReady' }, - { UnitDefNames['armfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['armckfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['armuwfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['armafus'].id, 'UnitReady/AdvancedFusionIsReady' }, - { UnitDefNames['armsilo'].id, 'UnitReady/NuclearSiloIsReady' }, - - { UnitDefNames['corbuzz'].id, 'UnitReady/CalamityIsReady' }, - { UnitDefNames['corkorg'].id, 'UnitReady/JuggernautIsReady' }, - { UnitDefNames['corjugg'].id, 'UnitReady/BehemothIsReady' }, - { UnitDefNames['corblackhy'].id, 'UnitReady/FlagshipIsReady' }, - { UnitDefNames['corfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['coruwfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['corafus'].id, 'UnitReady/AdvancedFusionIsReady' }, - { UnitDefNames['corsilo'].id, 'UnitReady/NuclearSiloIsReady' }, - - { UnitDefNames['legstarfall'] and UnitDefNames['legstarfall'].id, 'UnitReady/StarfallIsReady' }, - { UnitDefNames['legelrpcmech'] and UnitDefNames['legelrpcmech'].id, 'UnitReady/AstraeusIsReady' }, - { UnitDefNames['legeheatraymech'] and UnitDefNames['legeheatraymech'].id, 'UnitReady/SolinvictusIsReady' }, - { UnitDefNames['legfus'] and UnitDefNames['legfus'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['leganavalfusion'] and UnitDefNames['leganavalfusion'].id, 'UnitReady/FusionIsReady' }, - { UnitDefNames['legafus'] and UnitDefNames['legafus'].id, 'UnitReady/AdvancedFusionIsReady' }, - { UnitDefNames['legsilo'] and UnitDefNames['legsilo'].id, 'UnitReady/NuclearSiloIsReady' }, + { UnitDefNames["armvulc"].id, "UnitReady/RagnarokIsReady" }, + { UnitDefNames["armbanth"].id, "UnitReady/TitanIsReady" }, + { UnitDefNames["armepoch"].id, "UnitReady/FlagshipIsReady" }, + { UnitDefNames["armthor"].id, "UnitReady/ThorIsReady" }, + { UnitDefNames["armfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["armckfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["armuwfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["armafus"].id, "UnitReady/AdvancedFusionIsReady" }, + { UnitDefNames["armsilo"].id, "UnitReady/NuclearSiloIsReady" }, + + { UnitDefNames["corbuzz"].id, "UnitReady/CalamityIsReady" }, + { UnitDefNames["corkorg"].id, "UnitReady/JuggernautIsReady" }, + { UnitDefNames["corjugg"].id, "UnitReady/BehemothIsReady" }, + { UnitDefNames["corblackhy"].id, "UnitReady/FlagshipIsReady" }, + { UnitDefNames["corfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["coruwfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["corafus"].id, "UnitReady/AdvancedFusionIsReady" }, + { UnitDefNames["corsilo"].id, "UnitReady/NuclearSiloIsReady" }, + + { UnitDefNames["legstarfall"] and UnitDefNames["legstarfall"].id, "UnitReady/StarfallIsReady" }, + { UnitDefNames["legelrpcmech"] and UnitDefNames["legelrpcmech"].id, "UnitReady/AstraeusIsReady" }, + { UnitDefNames["legeheatraymech"] and UnitDefNames["legeheatraymech"].id, "UnitReady/SolinvictusIsReady" }, + { UnitDefNames["legfus"] and UnitDefNames["legfus"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["leganavalfusion"] and UnitDefNames["leganavalfusion"].id, "UnitReady/FusionIsReady" }, + { UnitDefNames["legafus"] and UnitDefNames["legafus"].id, "UnitReady/AdvancedFusionIsReady" }, + { UnitDefNames["legsilo"] and UnitDefNames["legsilo"].id, "UnitReady/NuclearSiloIsReady" }, } if UnitDefNames["armcom_scav"] then -- quick check if scav units exist local unitIsReadyScavAppend = {} - for i = 1,#unitIsReadyTab do - if UnitDefNames[UnitDefs[unitIsReadyTab[1][1]].name .. "_scav" ].id then - unitIsReadyScavAppend[#unitIsReadyScavAppend+1] = {UnitDefNames[UnitDefs[unitIsReadyTab[i][1]].name .. "_scav" ].id, unitIsReadyTab[i][2]} + for i = 1, #unitIsReadyTab do + if UnitDefNames[UnitDefs[unitIsReadyTab[1][1]].name .. "_scav"].id then + unitIsReadyScavAppend[#unitIsReadyScavAppend + 1] = { UnitDefNames[UnitDefs[unitIsReadyTab[i][1]].name .. "_scav"].id, unitIsReadyTab[i][2] } end end table.append(unitIsReadyTab, unitIsReadyScavAppend) @@ -341,21 +338,21 @@ local isT3mobile = {} local isT4mobile = {} local isMine = {} for udefID, def in ipairs(UnitDefs) do - if not string.find(def.name, 'critter') and not string.find(def.name, 'raptor') and (not def.modCategories or not def.modCategories.object) then + if not string.find(def.name, "critter") and not string.find(def.name, "raptor") and (not def.modCategories or not def.modCategories.object) then if def.canFly and not def.customParams.drone then isAircraft[udefID] = true end if def.customParams.techlevel then - if def.customParams.techlevel == '2' and not (def.customParams.iscommander or def.customParams.isscavcommander) then + if def.customParams.techlevel == "2" and not (def.customParams.iscommander or def.customParams.isscavcommander) then isT2[udefID] = true end - if def.customParams.techlevel == '2' and not (def.customParams.iscommander or def.customParams.isscavcommander or def.isBuilding) then + if def.customParams.techlevel == "2" and not (def.customParams.iscommander or def.customParams.isscavcommander or def.isBuilding) then isT2mobile[udefID] = true end - if def.customParams.techlevel == '3' and not def.isBuilding then + if def.customParams.techlevel == "3" and not def.isBuilding then isT3mobile[udefID] = true end - if def.customParams.techlevel == '4' and not def.isBuilding then + if def.customParams.techlevel == "4" and not def.isBuilding then isT4mobile[udefID] = true --there are no units with this techlevel assigned, need to see which ones end end @@ -389,7 +386,7 @@ local function updateCommanders() local unitID = units[i] local unitDefID = spGetUnitDefID(unitID) if isCommander[unitDefID] then - commanders[unitID] = select(2, spGetUnitHealth(unitID)) -- maxhealth + commanders[unitID] = select(2, spGetUnitHealth(unitID)) -- maxhealth end end end @@ -405,9 +402,8 @@ end local notifRulesMemory = {} local function checkNotificationRules(notifDef) - if notifDef.rulesPlayOnlyIfDisabled then - for i = 1,#notifDef.rulesPlayOnlyIfDisabled do + for i = 1, #notifDef.rulesPlayOnlyIfDisabled do if notifRulesMemory[notifDef.rulesPlayOnlyIfDisabled[i]] then return false end @@ -415,7 +411,7 @@ local function checkNotificationRules(notifDef) end if notifDef.rulesPlayOnlyIfEnabled then - for i = 1,#notifDef.rulesPlayOnlyIfEnabled do + for i = 1, #notifDef.rulesPlayOnlyIfEnabled do if not notifRulesMemory[notifDef.rulesPlayOnlyIfEnabled[i]] then return false end @@ -427,7 +423,7 @@ end local function applyNotificationRules(notifDef) if notifDef.rulesEnable then - for i = 1,#notifDef.rulesEnable do + for i = 1, #notifDef.rulesEnable do if not notifRulesMemory[notifDef.rulesEnable[i]] then notifRulesMemory[notifDef.rulesEnable[i]] = true end @@ -435,7 +431,7 @@ local function applyNotificationRules(notifDef) end if notifDef.rulesDisable then - for i = 1,#notifDef.rulesEnable do + for i = 1, #notifDef.rulesEnable do if notifRulesMemory[notifDef.rulesDisable[i]] then notifRulesMemory[notifDef.rulesDisable[i]] = false end @@ -453,7 +449,7 @@ local function queueNotification(event, forceplay) soundQueue[#soundQueue + 1] = event applyNotificationRules(notification[event]) else - LastPlay[event] = spGetGameFrame() - ((notification[event].delay - 2)*30) + LastPlay[event] = spGetGameFrame() - ((notification[event].delay - 2) * 30) end end end @@ -490,7 +486,7 @@ local function gadgetNotificationEvent(msg) return end - local forceplay = (string.sub(msg, string.len(msg) - 1) == ' y') + local forceplay = (string.sub(msg, string.len(msg) - 1) == " y") if not isSpec or (isSpec and lockPlayerID ~= nil) or forceplay then local event = string.sub(msg, 1, string.find(msg, " ", nil, true) - 1) local player = string.sub(msg, string.find(msg, " ", nil, true) + 1, string.len(msg)) @@ -503,20 +499,20 @@ end function widget:Initialize() widget:PlayerChanged() - WG['notifications'] = {} + WG["notifications"] = {} for sound, params in pairs(notification) do - WG['notifications']['getNotification' .. sound] = function() + WG["notifications"]["getNotification" .. sound] = function() return notificationList[sound] or false end - WG['notifications']['setNotification' .. sound] = function(value) + WG["notifications"]["setNotification" .. sound] = function(value) notificationList[sound] = value end end - WG['notifications'].getNotificationList = function() + WG["notifications"].getNotificationList = function() local soundInfo = {} for i, event in pairs(notificationOrder) do - soundInfo[#soundInfo+1] = { event, notificationList[event], notification[event].textID, #notification[event].voiceFiles } + soundInfo[#soundInfo + 1] = { event, notificationList[event], notification[event].textID, #notification[event].voiceFiles } end tableSort(soundInfo, function(a, b) @@ -527,78 +523,78 @@ function widget:Initialize() return soundInfo end - WG['notifications'].getTutorial = function() + WG["notifications"].getTutorial = function() return tutorialMode end - WG['notifications'].setTutorial = function(value) + WG["notifications"].setTutorial = function(value) tutorialMode = value if tutorialMode then tutorialPlayed = {} end widget:PlayerChanged() end - WG['notifications'].getVolume = function() + WG["notifications"].getVolume = function() return globalVolume end - WG['notifications'].setVolume = function(value) + WG["notifications"].setVolume = function(value) globalVolume = value end - WG['notifications'].getSpoken = function() + WG["notifications"].getSpoken = function() return spoken end - WG['notifications'].setSpoken = function(value) + WG["notifications"].setSpoken = function(value) spoken = value end - WG['notifications'].getMessages = function() + WG["notifications"].getMessages = function() return displayMessages end - WG['notifications'].setMessages = function(value) + WG["notifications"].setMessages = function(value) displayMessages = value end - WG['notifications'].addEvent = function(value, force) + WG["notifications"].addEvent = function(value, force) if notification[value] then queueNotification(value, force) end end - WG['notifications'].queueNotification = function(event, forceplay) + WG["notifications"].queueNotification = function(event, forceplay) queueNotification(event, forceplay) end - WG['notifications'].playNotification = function(event) + WG["notifications"].playNotification = function(event) if notification[event] then if notification[event].voiceFiles and #notification[event].voiceFiles > 0 then local m = #notification[event].voiceFiles > 1 and mathRandom(1, #notification[event].voiceFiles) or 1 local mRare = #notification[event].voiceFilesRare > 1 and mathRandom(1, #notification[event].voiceFilesRare) or 1 if math.random() < 0.05 and notification[event].voiceFilesRare[mRare] then - Spring.PlaySoundFile(notification[event].voiceFilesRare[mRare], globalVolume, 'ui') + Spring.PlaySoundFile(notification[event].voiceFilesRare[mRare], globalVolume, "ui") elseif notification[event].voiceFiles[m] then - Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, 'ui') + Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, "ui") else - spEcho('notification "'..event..'" missing sound file: #'..m) + spEcho('notification "' .. event .. '" missing sound file: #' .. m) end end if notification[event].soundEffect then - Spring.PlaySoundFile(soundEffectsFolder .. notification[event].soundEffect .. ".wav", globalVolume, 'ui') + Spring.PlaySoundFile(soundEffectsFolder .. notification[event].soundEffect .. ".wav", globalVolume, "ui") end - if displayMessages and WG['messages'] and notification[event].textID and not notification[event].notext then + if displayMessages and WG["messages"] and notification[event].textID and not notification[event].notext then if not notification[event].customText then - WG['messages'].addMessage(Spring.I18N(notification[event].textID)) + WG["messages"].addMessage(Spring.I18N(notification[event].textID)) else - WG['messages'].addMessage(notification[event].textID) + WG["messages"].addMessage(notification[event].textID) end end end end - WG['notifications'].resetEventDelay = function(event) + WG["notifications"].resetEventDelay = function(event) LastPlay[event] = spGetGameFrame() end - WG['notifications'].addNotificationDefs = function(tableOfNotifs) + WG["notifications"].addNotificationDefs = function(tableOfNotifs) notificationTable = table.merge(notificationTable, tableOfNotifs) processNotificationDefs() end - WG['notifications'].addUnitDetected = function(unitName, notifName) + WG["notifications"].addUnitDetected = function(unitName, notifName) if UnitDefNames[unitName] then unitsOfInterest[UnitDefNames[unitName].id] = notifName end @@ -608,13 +604,13 @@ function widget:Initialize() end RegisteredCustomNotifWidgets = {} - WG['notifications'].registerCustomNotifWidget = function(widgetName) + WG["notifications"].registerCustomNotifWidget = function(widgetName) if not RegisteredCustomNotifWidgets[widgetName] then RegisteredCustomNotifWidgets[widgetName] = true end end - WG['notifications'].registeredCustomNotifWidgets = function() + WG["notifications"].registeredCustomNotifWidgets = function() return RegisteredCustomNotifWidgets end @@ -624,9 +620,8 @@ function widget:Initialize() Spring.Echo("Notification Sound Items Loaded") end - if Spring.Utilities.Gametype.IsRaptors() and Spring.Utilities.Gametype.IsScavengers() then - queueNotification('RaptorsAndScavsMixed') + queueNotification("RaptorsAndScavsMixed") end end @@ -635,39 +630,39 @@ function widget:NotificationEvent(msg) end function widget:Shutdown() - WG['notifications'] = nil + WG["notifications"] = nil end function widget:GameFrame(gf) gameframe = gf - if isSpec or (not displayMessages and not spoken) or gameframe < 60 then -- dont alert stuff for first 2 secs so gadgets can still spawn stuff without it triggering notifications + if isSpec or (not displayMessages and not spoken) or gameframe < 60 then -- dont alert stuff for first 2 secs so gadgets can still spawn stuff without it triggering notifications return end if gameframe % 30 == 15 then - e_currentLevel, e_storage, e_pull, e_income, e_expense, e_share, e_sent, e_received = spGetTeamResources(myTeamID, 'energy') - m_currentLevel, m_storage, m_pull, m_income, m_expense, m_share, m_sent, m_received = spGetTeamResources(myTeamID, 'metal') + e_currentLevel, e_storage, e_pull, e_income, e_expense, e_share, e_sent, e_received = spGetTeamResources(myTeamID, "energy") + m_currentLevel, m_storage, m_pull, m_income, m_expense, m_share, m_sent, m_received = spGetTeamResources(myTeamID, "metal") -- raptors and scavs mixed check if Spring.Utilities.Gametype.IsRaptors() and Spring.Utilities.Gametype.IsScavengers() then - queueNotification('RaptorsAndScavsMixed') + queueNotification("RaptorsAndScavsMixed") end -- low resources check if e_currentLevel and (e_currentLevel / e_storage) < 0.025 and e_currentLevel < 3000 then - queueNotification('LowPower') + queueNotification("LowPower") end - if m_currentLevel and (m_currentLevel / m_storage) < 0.025 and (m_income*2 < m_pull or m_income+100 < m_pull) and m_currentLevel < 1000 then - queueNotification('LowMetal') + if m_currentLevel and (m_currentLevel / m_storage) < 0.025 and (m_income * 2 < m_pull or m_income + 100 < m_pull) and m_currentLevel < 1000 then + queueNotification("LowMetal") end -- idle builder check for unitID, frame in pairs(idleBuilder) do if Spring.GetUnitTeam(unitID) == myTeamID then - if frame < gf and m_currentLevel > m_storage*0.5 and e_currentLevel > e_storage*0.5 then - queueNotification('IdleConstructors') - idleBuilder[unitID] = nil -- do not repeat + if frame < gf and m_currentLevel > m_storage * 0.5 and e_currentLevel > e_storage * 0.5 then + queueNotification("IdleConstructors") + idleBuilder[unitID] = nil -- do not repeat end else idleBuilder[unitID] = nil @@ -677,7 +672,7 @@ function widget:GameFrame(gf) -- max units check local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) if currentUnits >= maxUnits then - queueNotification('MaxUnitsReached') + queueNotification("MaxUnitsReached") end end @@ -706,7 +701,6 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end if unitTeam == myTeamID then - if not isCommander[unitDefID] then if isMex[unitDefID] then hasBuildMex = true @@ -717,14 +711,14 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end if isT2mobile[unitDefID] then - queueNotification('UnitReady/Tech2UnitReady') + queueNotification("UnitReady/Tech2UnitReady") elseif isT3mobile[unitDefID] then - queueNotification('UnitReady/Tech3UnitReady') + queueNotification("UnitReady/Tech3UnitReady") elseif isT4mobile[unitDefID] then - queueNotification('UnitReady/Tech4UnitReady') + queueNotification("UnitReady/Tech4UnitReady") end - for index,tab in pairs(unitIsReadyTab) do -- Play Unit Is Ready notifs based on the table's content + for index, tab in pairs(unitIsReadyTab) do -- Play Unit Is Ready notifs based on the table's content if unitDefID == tab[1] then queueNotification(tab[2]) break @@ -734,11 +728,11 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) if #Spring.GetTeamList(myAllyTeamID) > 1 then if isT2mobile[unitDefID] then - queueNotification('Tech2TeamReached') + queueNotification("Tech2TeamReached") elseif isT3mobile[unitDefID] then - queueNotification('Tech3TeamReached') + queueNotification("Tech3TeamReached") elseif isT4mobile[unitDefID] then - queueNotification('Tech4TeamReached') + queueNotification("Tech4TeamReached") end end end @@ -757,24 +751,24 @@ function widget:UnitEnteredLos(unitID, unitTeam) local udefID = spGetUnitDefID(unitID) -- single detection events below - queueNotification('UnitDetected/EnemyDetected') + queueNotification("UnitDetected/EnemyDetected") if isAircraft[udefID] then - queueNotification('UnitDetected/AircraftDetected') + queueNotification("UnitDetected/AircraftDetected") end if isT2mobile[udefID] then - queueNotification('UnitDetected/Tech2UnitDetected') + queueNotification("UnitDetected/Tech2UnitDetected") end if isT3mobile[udefID] then - queueNotification('UnitDetected/Tech3UnitDetected') + queueNotification("UnitDetected/Tech3UnitDetected") end if isT4mobile[udefID] then - queueNotification('UnitDetected/Tech4UnitDetected') + queueNotification("UnitDetected/Tech4UnitDetected") end if isMine[udefID] then -- ignore when far away local x, _, z = spGetUnitPosition(unitID) if #Spring.GetUnitsInCylinder(x, z, 1700, myTeamID) > 0 then - queueNotification('UnitDetected/MinesDetected') + queueNotification("UnitDetected/MinesDetected") end end @@ -792,7 +786,7 @@ function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) end local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) if currentUnits >= maxUnits then - queueNotification('MaxUnitsReached') + queueNotification("MaxUnitsReached") end end end @@ -804,7 +798,7 @@ function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) end local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) if currentUnits >= maxUnits then - queueNotification('MaxUnitsReached') + queueNotification("MaxUnitsReached") end end end @@ -816,7 +810,7 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam) if unitTeam == myTeamID then local maxUnits, currentUnits = Spring.GetTeamMaxUnits(myTeamID) if currentUnits >= maxUnits then - queueNotification('MaxUnitsReached') + queueNotification("MaxUnitsReached") end if not hasMadeT2 and isT2[unitDefID] then @@ -827,7 +821,7 @@ function widget:UnitCreated(unitID, unitDefID, unitTeam) commanders[unitID] = select(2, spGetUnitHealth(unitID)) end if windNotGood and isWind[unitDefID] then - queueNotification('WindNotGood') + queueNotification("WindNotGood") end end end @@ -846,7 +840,7 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) commandersDamages[unitID] = {} end local gameframe = spGetGameFrame() - commandersDamages[unitID][gameframe] = damage -- if widget:UnitDamaged can be called multiple times during 1 gameframe then you need to add those up, i dont know + commandersDamages[unitID][gameframe] = damage -- if widget:UnitDamaged can be called multiple times during 1 gameframe then you need to add those up, i dont know -- count total damage of last few secs local totalDamage = 0 @@ -858,8 +852,8 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) commandersDamages[unitID][gf] = nil end end - if totalDamage >= commanders[unitID] * 0.2 and spGetUnitHealth(unitID)/commanders[unitID] <= 0.85 then - queueNotification('ComHeavyDamage') + if totalDamage >= commanders[unitID] * 0.2 and spGetUnitHealth(unitID) / commanders[unitID] <= 0.85 then + queueNotification("ComHeavyDamage") end end end @@ -877,12 +871,12 @@ local function playNextSound() if not muteWhenIdle or not isIdle or notification[event].tutorial then if spoken and #notification[event].voiceFiles > 0 then if Spring.GetGameFrame() < 30 then - math.randomseed(tonumber(math.ceil(os.clock()*10))) -- brute force this because early game random seems not very random. + math.randomseed(tonumber(math.ceil(os.clock() * 10))) -- brute force this because early game random seems not very random. end local m = #notification[event].voiceFiles > 1 and mathRandom(1, #notification[event].voiceFiles) or 1 local mRare = #notification[event].voiceFilesRare > 1 and mathRandom(1, #notification[event].voiceFilesRare) or 1 if math.random() < 0.05 and notification[event].voiceFilesRare[mRare] then - Spring.PlaySoundFile(notification[event].voiceFilesRare[mRare], globalVolume, 'ui') + Spring.PlaySoundFile(notification[event].voiceFilesRare[mRare], globalVolume, "ui") local duration = wavFileLengths[string.sub(notification[event].voiceFilesRare[mRare], 8)] if not duration then duration = ReadWAV(notification[event].voiceFilesRare[mRare]) @@ -890,7 +884,7 @@ local function playNextSound() end nextSoundQueued = sec + (duration or 3) + silentTime elseif notification[event].voiceFiles[m] then - Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, 'ui') + Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, "ui") local duration = wavFileLengths[string.sub(notification[event].voiceFiles[m], 8)] if not duration then duration = ReadWAV(notification[event].voiceFiles[m]) @@ -898,20 +892,20 @@ local function playNextSound() end nextSoundQueued = sec + (duration or 3) + silentTime else - spEcho('notification "'..event..'" missing sound file: #'..m) + spEcho('notification "' .. event .. '" missing sound file: #' .. m) end end if notification[event].soundEffect then - Spring.PlaySoundFile(soundEffectsFolder .. notification[event].soundEffect .. ".wav", globalVolume, 'ui') + Spring.PlaySoundFile(soundEffectsFolder .. notification[event].soundEffect .. ".wav", globalVolume, "ui") end - if displayMessages and WG['messages'] and notification[event].textID and (not notification[event].notext) then - WG['messages'].addMessage(Spring.I18N(notification[event].textID)) + if displayMessages and WG["messages"] and notification[event].textID and not notification[event].notext then + WG["messages"].addMessage(Spring.I18N(notification[event].textID)) end end LastPlay[event] = spGetGameFrame() if notification[event].resetOtherEventDelay and #notification[event].resetOtherEventDelay > 0 then - for i = 1,#notification[event].resetOtherEventDelay do + for i = 1, #notification[event].resetOtherEventDelay do LastPlay[notification[event].resetOtherEventDelay[i]] = spGetGameFrame() end end @@ -963,19 +957,19 @@ function widget:Update(dt) --if lastUserInputTime < os.clock() - idleTime then -- isIdle = true --else - isIdle = false + isIdle = false --end - if WG['rejoin'] and WG['rejoin'].showingRejoining() then + if WG["rejoin"] and WG["rejoin"].showingRejoining() then isIdle = true end if playWelcome then - Spring.SetConfigInt('WelcomeMessagePlayed', 1) - queueNotification('Welcome', true) + Spring.SetConfigInt("WelcomeMessagePlayed", 1) + queueNotification("Welcome", true) playWelcome = false playedWelcome = true elseif not playedWelcome then - queueNotification('WelcomeShort', true) + queueNotification("WelcomeShort", true) playedWelcome = true end end @@ -994,7 +988,7 @@ function widget:KeyPress() end function widget:GameStart() - queueNotification('GameStarted', true) + queueNotification("GameStarted", true) end function widget:GameOver(winningAllyTeams) @@ -1016,11 +1010,11 @@ function widget:GameOver(winningAllyTeams) soundQueue = {} if gameOverState == "victory" then - queueNotification('BattleVictory',true) + queueNotification("BattleVictory", true) elseif gameOverState == "defeat" then - queueNotification('BattleDefeat',true) + queueNotification("BattleDefeat", true) else - queueNotification('BattleEnded',true) + queueNotification("BattleEnded", true) end --widgetHandler:RemoveWidget() end @@ -1028,9 +1022,9 @@ end function widget:GamePaused(playerID, isGamePaused) if not gameover then if isGamePaused then - queueNotification('GamePaused',true) + queueNotification("GamePaused", true) else - queueNotification('GameUnpaused', true) + queueNotification("GameUnpaused", true) end end end @@ -1050,7 +1044,7 @@ function widget:GetConfigData(data) end function widget:SetConfigData(data) - if data.notificationList ~= nil and type(data.notificationList) == 'table' then + if data.notificationList ~= nil and type(data.notificationList) == "table" then for sound, enabled in pairs(data.notificationList) do if notification[sound] then notificationList[sound] = enabled diff --git a/luaui/Widgets/snd_notifications_addon_ally_alerts.lua b/luaui/Widgets/snd_notifications_addon_ally_alerts.lua index 40328e9beb7..b18a2bc7597 100644 --- a/luaui/Widgets/snd_notifications_addon_ally_alerts.lua +++ b/luaui/Widgets/snd_notifications_addon_ally_alerts.lua @@ -1,43 +1,40 @@ function widget:GetInfo() - return { - name = "Ally Request Listener", - desc = "Listens for resource requests and triggers notifications.", - author = "Inimitable_Wolf", - version = "1.0", - date = "2025-11-18", - license = "GPLv2", - layer = 0, - enabled = true - } + return { + name = "Ally Request Listener", + desc = "Listens for resource requests and triggers notifications.", + author = "Inimitable_Wolf", + version = "1.0", + date = "2025-11-18", + license = "GPLv2", + layer = 0, + enabled = true, + } end function widget:RecvLuaMsg(msg, playerID) - -- Check for message types - if msg ~= 'alert:allyRequest:energy' and msg ~= 'alert:allyRequest:metal' then - return - end + -- Check for message types + if msg ~= "alert:allyRequest:energy" and msg ~= "alert:allyRequest:metal" then + return + end - -- Get local and sender ally team ID and spectator status - local myAllyTeamID = Spring.GetLocalAllyTeamID() - local isSpec = Spring.GetSpectatingState() - local _, _, senderIsSpec, _, senderAllyTeamID = Spring.GetPlayerInfo(playerID, false) + -- Get local and sender ally team ID and spectator status + local myAllyTeamID = Spring.GetLocalAllyTeamID() + local isSpec = Spring.GetSpectatingState() + local _, _, senderIsSpec, _, senderAllyTeamID = Spring.GetPlayerInfo(playerID, false) - -- Ignore if I am spectator, sender is spectator or sender is not an ally - if isSpec or senderIsSpec or (myAllyTeamID ~= senderAllyTeamID) then - return - end - - if WG['notifications'] and WG['notifications'].queueNotification then - - -- Check which resource is being requested - if msg == 'alert:allyRequest:energy' then - WG['notifications'].queueNotification("AllyRequestEnergy") - return true - - elseif msg == 'alert:allyRequest:metal' then - WG['notifications'].queueNotification("AllyRequestMetal") - return true - end + -- Ignore if I am spectator, sender is spectator or sender is not an ally + if isSpec or senderIsSpec or (myAllyTeamID ~= senderAllyTeamID) then + return + end - end -end \ No newline at end of file + if WG["notifications"] and WG["notifications"].queueNotification then + -- Check which resource is being requested + if msg == "alert:allyRequest:energy" then + WG["notifications"].queueNotification("AllyRequestEnergy") + return true + elseif msg == "alert:allyRequest:metal" then + WG["notifications"].queueNotification("AllyRequestMetal") + return true + end + end +end diff --git a/luaui/Widgets/snd_notifications_addon_playerstatus.lua b/luaui/Widgets/snd_notifications_addon_playerstatus.lua index fcfd646a388..80001ed2a0a 100644 --- a/luaui/Widgets/snd_notifications_addon_playerstatus.lua +++ b/luaui/Widgets/snd_notifications_addon_playerstatus.lua @@ -1,15 +1,14 @@ function widget:GetInfo() - return { - name = "Player Status Notifications", - desc = "Sends player status events to the Notification Widget", - author = "Damgam", - date = "2025", - layer = 5, - enabled = true -- loaded by default? - } + return { + name = "Player Status Notifications", + desc = "Sends player status events to the Notification Widget", + author = "Damgam", + date = "2025", + layer = 5, + enabled = true, -- loaded by default? + } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState local spGetPlayerInfo = Spring.GetPlayerInfo @@ -22,156 +21,167 @@ local lockPlayerID PlayersInformationMemory = {} function UpdatePlayerData(playerID) - if playerID then - local playerName = select(1, spGetPlayerInfo(playerID)) - --spEcho("Player Changed", playerID, playerName) - - if not PlayersInformationMemory[playerName] then PlayersInformationMemory[playerName] = {} end - - PlayersInformationMemory[playerName].id = playerID - PlayersInformationMemory[playerName].spectator = select(3, spGetPlayerInfo(playerID)) - PlayersInformationMemory[playerName].teamID = select(4, spGetPlayerInfo(playerID)) - PlayersInformationMemory[playerName].allyTeamID = select(5, spGetPlayerInfo(playerID)) - PlayersInformationMemory[playerName].ping = select(6, spGetPlayerInfo(playerID)) - end -end + if playerID then + local playerName = select(1, spGetPlayerInfo(playerID)) + --spEcho("Player Changed", playerID, playerName) + if not PlayersInformationMemory[playerName] then + PlayersInformationMemory[playerName] = {} + end + + PlayersInformationMemory[playerName].id = playerID + PlayersInformationMemory[playerName].spectator = select(3, spGetPlayerInfo(playerID)) + PlayersInformationMemory[playerName].teamID = select(4, spGetPlayerInfo(playerID)) + PlayersInformationMemory[playerName].allyTeamID = select(5, spGetPlayerInfo(playerID)) + PlayersInformationMemory[playerName].ping = select(6, spGetPlayerInfo(playerID)) + end +end function ComparePlayerData(playerID) - if playerID then - local Differences = {} - - local playerName = select(1, spGetPlayerInfo(playerID)) - - local id = playerID - local spectator = select(3, spGetPlayerInfo(playerID)) - local teamID = select(4, spGetPlayerInfo(playerID)) - local allyTeamID = select(5, spGetPlayerInfo(playerID)) - local ping = select(6, spGetPlayerInfo(playerID)) - - if id ~= PlayersInformationMemory[playerName].id then Differences["id"] = true end - if spectator ~= PlayersInformationMemory[playerName].spectator then Differences["spectator"] = spectator end - if teamID ~= PlayersInformationMemory[playerName].teamID then Differences["teamID"] = teamID end - if allyTeamID ~= PlayersInformationMemory[playerName].allyTeamID then Differences["allyteamid"] = allyTeamID end - if ping then Differences["ping"] = ping end - - return Differences - end - return {} + if playerID then + local Differences = {} + + local playerName = select(1, spGetPlayerInfo(playerID)) + + local id = playerID + local spectator = select(3, spGetPlayerInfo(playerID)) + local teamID = select(4, spGetPlayerInfo(playerID)) + local allyTeamID = select(5, spGetPlayerInfo(playerID)) + local ping = select(6, spGetPlayerInfo(playerID)) + + if id ~= PlayersInformationMemory[playerName].id then + Differences["id"] = true + end + if spectator ~= PlayersInformationMemory[playerName].spectator then + Differences["spectator"] = spectator + end + if teamID ~= PlayersInformationMemory[playerName].teamID then + Differences["teamID"] = teamID + end + if allyTeamID ~= PlayersInformationMemory[playerName].allyTeamID then + Differences["allyteamid"] = allyTeamID + end + if ping then + Differences["ping"] = ping + end + + return Differences + end + return {} end UpdateTimer = 0 function widget:Update(dt) - UpdateTimer = UpdateTimer+dt - if UpdateTimer >= 1 and (not gameOver) and Spring.GetGameFrame() > 90 then - UpdateTimer = UpdateTimer - 1 - if WG.lockcamera and WG.lockcamera.GetPlayerID ~= nil then + UpdateTimer = UpdateTimer + dt + if UpdateTimer >= 1 and not gameOver and Spring.GetGameFrame() > 90 then + UpdateTimer = UpdateTimer - 1 + if WG.lockcamera and WG.lockcamera.GetPlayerID ~= nil then lockPlayerID = WG.lockcamera.GetPlayerID() end - for playerName, data in pairs(PlayersInformationMemory) do - local ping = select(6, spGetPlayerInfo(data.id)) - if ping and ping > 5 and not PlayersInformationMemory[playerName].timingout then - if (not PlayersInformationMemory[playerName].spectator) and (not PlayersInformationMemory[playerName].resigned) then - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerLagging", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateLagging", true) - else - WG['notifications'].queueNotification("EnemyPlayerLagging", true) - end - end - PlayersInformationMemory[playerName].timingout = true - elseif ping and ping <= 2 and PlayersInformationMemory[playerName].timingout and (not PlayersInformationMemory[playerName].hasDisconnected) then - if (not PlayersInformationMemory[playerName].spectator) and (not PlayersInformationMemory[playerName].resigned) then - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerCaughtUp", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateCaughtUp", true) - else - WG['notifications'].queueNotification("EnemyPlayerCaughtUp", true) - end - end - PlayersInformationMemory[playerName].timingout = false - end - end - end + for playerName, data in pairs(PlayersInformationMemory) do + local ping = select(6, spGetPlayerInfo(data.id)) + if ping and ping > 5 and not PlayersInformationMemory[playerName].timingout then + if (not PlayersInformationMemory[playerName].spectator) and not PlayersInformationMemory[playerName].resigned then + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerLagging", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateLagging", true) + else + WG["notifications"].queueNotification("EnemyPlayerLagging", true) + end + end + PlayersInformationMemory[playerName].timingout = true + elseif ping and ping <= 2 and PlayersInformationMemory[playerName].timingout and not PlayersInformationMemory[playerName].hasDisconnected then + if (not PlayersInformationMemory[playerName].spectator) and not PlayersInformationMemory[playerName].resigned then + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerCaughtUp", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateCaughtUp", true) + else + WG["notifications"].queueNotification("EnemyPlayerCaughtUp", true) + end + end + PlayersInformationMemory[playerName].timingout = false + end + end + end end function widget:Initialize() - local players = Spring.GetPlayerList() - for i = 1,#players do - UpdatePlayerData(players[i]) - end + local players = Spring.GetPlayerList() + for i = 1, #players do + UpdatePlayerData(players[i]) + end end function widget:PlayerChanged(playerID) - if playerID and (not gameOver) then - local playerName = select(1, spGetPlayerInfo(playerID)) - local Differences = {} - if PlayersInformationMemory[playerName] then - Differences = ComparePlayerData(playerID) - - if (not PlayersInformationMemory[playerName].resigned) then - if Differences.spectator then - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerResigned", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateResigned", true) - else - WG['notifications'].queueNotification("EnemyPlayerResigned", true) - end - PlayersInformationMemory[playerName].resigned = true - end - if PlayersInformationMemory[playerName].hasDisconnected and (not (Differences.spectator or PlayersInformationMemory[playerName].spectator)) then - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerReconnected", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateReconnected", true) - else - WG['notifications'].queueNotification("EnemyPlayerReconnected", true) - end - PlayersInformationMemory[playerName].hasDisconnected = false - end - end - end - - UpdatePlayerData(playerID) - end + if playerID and not gameOver then + local playerName = select(1, spGetPlayerInfo(playerID)) + local Differences = {} + if PlayersInformationMemory[playerName] then + Differences = ComparePlayerData(playerID) + + if not PlayersInformationMemory[playerName].resigned then + if Differences.spectator then + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerResigned", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateResigned", true) + else + WG["notifications"].queueNotification("EnemyPlayerResigned", true) + end + PlayersInformationMemory[playerName].resigned = true + end + if PlayersInformationMemory[playerName].hasDisconnected and not (Differences.spectator or PlayersInformationMemory[playerName].spectator) then + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerReconnected", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateReconnected", true) + else + WG["notifications"].queueNotification("EnemyPlayerReconnected", true) + end + PlayersInformationMemory[playerName].hasDisconnected = false + end + end + end + + UpdatePlayerData(playerID) + end end function widget:PlayerRemoved(playerID) - if playerID and (not gameOver) then - local playerName = select(1, spGetPlayerInfo(playerID)) - --local Differences = {} - if PlayersInformationMemory[playerName] then - --Differences = ComparePlayerData(playerID) - - if (not PlayersInformationMemory[playerName].spectator) and (not PlayersInformationMemory[playerName].resigned) then - if PlayersInformationMemory[playerName].timingout then - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerTimedout", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateTimedout", true) - else - WG['notifications'].queueNotification("EnemyPlayerTimedout", true) - end - else - if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then - WG['notifications'].queueNotification("NeutralPlayerDisconnected", true) - elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then - WG['notifications'].queueNotification("TeammateDisconnected", true) - else - WG['notifications'].queueNotification("EnemyPlayerDisconnected", true) - end - end - PlayersInformationMemory[playerName].hasDisconnected = true - end - end - - UpdatePlayerData(playerID) - end + if playerID and not gameOver then + local playerName = select(1, spGetPlayerInfo(playerID)) + --local Differences = {} + if PlayersInformationMemory[playerName] then + --Differences = ComparePlayerData(playerID) + + if (not PlayersInformationMemory[playerName].spectator) and not PlayersInformationMemory[playerName].resigned then + if PlayersInformationMemory[playerName].timingout then + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerTimedout", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateTimedout", true) + else + WG["notifications"].queueNotification("EnemyPlayerTimedout", true) + end + else + if (spGetSpectatingState() and lockPlayerID == nil) or PlayersInformationMemory[playerName].teamID == spGetLocalTeamID() then + WG["notifications"].queueNotification("NeutralPlayerDisconnected", true) + elseif PlayersInformationMemory[playerName].allyTeamID == spGetLocalAllyTeamID() then + WG["notifications"].queueNotification("TeammateDisconnected", true) + else + WG["notifications"].queueNotification("EnemyPlayerDisconnected", true) + end + end + PlayersInformationMemory[playerName].hasDisconnected = true + end + end + + UpdatePlayerData(playerID) + end end function widget:GameOver(winningAllyTeams) - gameOver = true -end \ No newline at end of file + gameOver = true +end diff --git a/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua b/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua index 9c7ba7a5a97..79809acd5ba 100644 --- a/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua +++ b/luaui/Widgets/snd_notifications_addon_scavraptorstatus.lua @@ -1,12 +1,12 @@ function widget:GetInfo() - return { - name = "PvE Status Notifications", - desc = "Sends PvE status events to the Notification Widget", - author = "Damgam", - date = "2025", - layer = 5, - enabled = true -- loaded by default? - } + return { + name = "PvE Status Notifications", + desc = "Sends PvE status events to the Notification Widget", + author = "Damgam", + date = "2025", + layer = 5, + enabled = true, -- loaded by default? + } end if (not Spring.Utilities.Gametype.IsRaptors()) and (not Spring.Utilities.Gametype.IsScavengers()) then @@ -17,177 +17,174 @@ local PlayedMessages = {} UpdateTimer = 0 function widget:Update(dt) - UpdateTimer = UpdateTimer+dt - if UpdateTimer >= 1 then - UpdateTimer = UpdateTimer - 1 - - if Spring.Utilities.Gametype.IsRaptors() then - FinalBossProgress = Spring.GetGameRulesParam("raptorQueenAnger") - FinalBossHealth = Spring.GetGameRulesParam("raptorQueenHealth") - TechProgress = Spring.GetGameRulesParam("raptorTechAnger") - - if TechProgress and TechProgress >= 50 and not PlayedMessages["AntiNukeReminder1"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder1"] = true - end - if TechProgress and TechProgress >= 60 and not PlayedMessages["AntiNukeReminder2"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder2"] = true - end - if TechProgress and TechProgress >= 65 and not PlayedMessages["AntiNukeReminder3"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder3"] = true - end - - if FinalBossProgress ~= nil and FinalBossHealth ~= nil and FinalBossProgress < 100 then - if FinalBossProgress >= 50 and not PlayedMessages["FinalBossProgress50"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen50Ready") - PlayedMessages["FinalBossProgress50"] = true - end - if FinalBossProgress >= 75 and not PlayedMessages["FinalBossProgress75"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen75Ready") - PlayedMessages["FinalBossProgress75"] = true - end - if FinalBossProgress >= 90 and not PlayedMessages["FinalBossProgress90"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen90Ready") - PlayedMessages["FinalBossProgress90"] = true - end - if FinalBossProgress >= 95 and not PlayedMessages["FinalBossProgress95"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen95Ready") - PlayedMessages["FinalBossProgress95"] = true - end - if FinalBossProgress >= 98 and not PlayedMessages["FinalBossProgress98"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen98Ready") - PlayedMessages["FinalBossProgress98"] = true - end - - if FinalBossIsAlive and FinalBossHealth <= 0 and not PlayedMessages["FinalBossIsDestroyed"] then - WG['notifications'].queueNotification("PvE/Raptor_QueenIsDestroyed") - PlayedMessages["FinalBossIsDestroyed"] = true - if Spring.GetModOptions().scav_endless then - FinalBossIsAlive = false - PlayedMessages = {} - end - end - end - - if FinalBossHealth ~= nil and FinalBossProgress ~= nil and FinalBossHealth > 0 then - FinalBossIsAlive = true - if FinalBossProgress >= 100 and not PlayedMessages["FinalBossProgress100"] then - WG['notifications'].queueNotification("PvE/Raptor_QueenIsReady") - PlayedMessages["FinalBossProgress100"] = true - end - if FinalBossHealth <= 50 and not PlayedMessages["FinalBossHealth50"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen50HealthLeft") - PlayedMessages["FinalBossHealth50"] = true - end - if FinalBossHealth <= 25 and not PlayedMessages["FinalBossHealth25"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen25HealthLeft") - PlayedMessages["FinalBossHealth25"] = true - end - if FinalBossHealth <= 10 and not PlayedMessages["FinalBossHealth10"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen10HealthLeft") - PlayedMessages["FinalBossHealth10"] = true - end - if FinalBossHealth <= 5 and not PlayedMessages["FinalBossHealth5"] then - WG['notifications'].queueNotification("PvE/Raptor_Queen5HealthLeft") - PlayedMessages["FinalBossHealth5"] = true - end - - CurrentlyStaggered = Spring.GetGameRulesParam("raptorQueenStaggerActive") - if CurrentlyStaggered == true and not PlayedMessages["FinalBossStaggered"] then - PlayedMessages["FinalBossStaggered"] = true - WG["notifications"].queueNotification("PvE/Raptor_QueenGotStaggered") - elseif PlayedMessages["FinalBossStaggered"] and CurrentlyStaggered == false then - PlayedMessages["FinalBossStaggered"] = false - WG["notifications"].queueNotification("PvE/Raptor_QueenNoLongerStaggered") - end - end - - elseif Spring.Utilities.Gametype.IsScavengers() then - FinalBossProgress = Spring.GetGameRulesParam("scavBossAnger") - FinalBossHealth = Spring.GetGameRulesParam("scavBossHealth") - TechProgress = Spring.GetGameRulesParam("scavTechAnger") - - if TechProgress and TechProgress >= 50 and not PlayedMessages["AntiNukeReminder1"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder1"] = true - end - if TechProgress and TechProgress >= 60 and not PlayedMessages["AntiNukeReminder2"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder2"] = true - end - if TechProgress and TechProgress >= 65 and not PlayedMessages["AntiNukeReminder3"] then - WG['notifications'].queueNotification("PvE/AntiNukeReminder") - PlayedMessages["AntiNukeReminder3"] = true - end - - - if FinalBossProgress ~= nil and FinalBossHealth ~= nil and FinalBossProgress < 100 then - if FinalBossProgress >= 50 and not PlayedMessages["FinalBossProgress50"] then - WG['notifications'].queueNotification("PvE/Scav_Boss50Ready") - PlayedMessages["FinalBossProgress50"] = true - end - if FinalBossProgress >= 75 and not PlayedMessages["FinalBossProgress75"] then - WG['notifications'].queueNotification("PvE/Scav_Boss75Ready") - PlayedMessages["FinalBossProgress75"] = true - end - if FinalBossProgress >= 90 and not PlayedMessages["FinalBossProgress90"] then - WG['notifications'].queueNotification("PvE/Scav_Boss90Ready") - PlayedMessages["FinalBossProgress90"] = true - end - if FinalBossProgress >= 95 and not PlayedMessages["FinalBossProgress95"] then - WG['notifications'].queueNotification("PvE/Scav_Boss95Ready") - PlayedMessages["FinalBossProgress95"] = true - end - if FinalBossProgress >= 98 and not PlayedMessages["FinalBossProgress98"] then - WG['notifications'].queueNotification("PvE/Scav_Boss98Ready") - PlayedMessages["FinalBossProgress98"] = true - end - - if FinalBossIsAlive and FinalBossHealth <= 0 and not PlayedMessages["FinalBossIsDestroyed"] then - WG['notifications'].queueNotification("PvE/Scav_BossIsDestroyed") - PlayedMessages["FinalBossIsDestroyed"] = true - if Spring.GetModOptions().scav_endless then - FinalBossIsAlive = false - PlayedMessages = {} - end - end - end - - - if FinalBossHealth ~= nil and FinalBossProgress ~= nil and FinalBossHealth > 0 then - FinalBossIsAlive = true - if FinalBossProgress >= 100 and not PlayedMessages["FinalBossProgress100"] then - WG['notifications'].queueNotification("PvE/Scav_BossIsReady") - PlayedMessages["FinalBossProgress100"] = true - end - if FinalBossHealth <= 50 and not PlayedMessages["FinalBossHealth50"] then - WG['notifications'].queueNotification("PvE/Scav_Boss50HealthLeft") - PlayedMessages["FinalBossHealth50"] = true - end - if FinalBossHealth <= 25 and not PlayedMessages["FinalBossHealth25"] then - WG['notifications'].queueNotification("PvE/Scav_Boss25HealthLeft") - PlayedMessages["FinalBossHealth25"] = true - end - if FinalBossHealth <= 10 and not PlayedMessages["FinalBossHealth10"] then - WG['notifications'].queueNotification("PvE/Scav_Boss10HealthLeft") - PlayedMessages["FinalBossHealth10"] = true - end - if FinalBossHealth <= 5 and not PlayedMessages["FinalBossHealth5"] then - WG['notifications'].queueNotification("PvE/Scav_Boss5HealthLeft") - PlayedMessages["FinalBossHealth5"] = true - end - - CurrentlyStaggered = Spring.GetGameRulesParam("scavBossStaggerActive") - if CurrentlyStaggered == true and not PlayedMessages["FinalBossStaggered"] then - PlayedMessages["FinalBossStaggered"] = true - WG["notifications"].queueNotification("PvE/Scav_BossGotStaggered") - elseif PlayedMessages["FinalBossStaggered"] and CurrentlyStaggered == false then - PlayedMessages["FinalBossStaggered"] = false - WG["notifications"].queueNotification("PvE/Scav_BossNoLongerStaggered") - end - end - end - end -end \ No newline at end of file + UpdateTimer = UpdateTimer + dt + if UpdateTimer >= 1 then + UpdateTimer = UpdateTimer - 1 + + if Spring.Utilities.Gametype.IsRaptors() then + FinalBossProgress = Spring.GetGameRulesParam("raptorQueenAnger") + FinalBossHealth = Spring.GetGameRulesParam("raptorQueenHealth") + TechProgress = Spring.GetGameRulesParam("raptorTechAnger") + + if TechProgress and TechProgress >= 50 and not PlayedMessages["AntiNukeReminder1"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder1"] = true + end + if TechProgress and TechProgress >= 60 and not PlayedMessages["AntiNukeReminder2"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder2"] = true + end + if TechProgress and TechProgress >= 65 and not PlayedMessages["AntiNukeReminder3"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder3"] = true + end + + if FinalBossProgress ~= nil and FinalBossHealth ~= nil and FinalBossProgress < 100 then + if FinalBossProgress >= 50 and not PlayedMessages["FinalBossProgress50"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen50Ready") + PlayedMessages["FinalBossProgress50"] = true + end + if FinalBossProgress >= 75 and not PlayedMessages["FinalBossProgress75"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen75Ready") + PlayedMessages["FinalBossProgress75"] = true + end + if FinalBossProgress >= 90 and not PlayedMessages["FinalBossProgress90"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen90Ready") + PlayedMessages["FinalBossProgress90"] = true + end + if FinalBossProgress >= 95 and not PlayedMessages["FinalBossProgress95"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen95Ready") + PlayedMessages["FinalBossProgress95"] = true + end + if FinalBossProgress >= 98 and not PlayedMessages["FinalBossProgress98"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen98Ready") + PlayedMessages["FinalBossProgress98"] = true + end + + if FinalBossIsAlive and FinalBossHealth <= 0 and not PlayedMessages["FinalBossIsDestroyed"] then + WG["notifications"].queueNotification("PvE/Raptor_QueenIsDestroyed") + PlayedMessages["FinalBossIsDestroyed"] = true + if Spring.GetModOptions().scav_endless then + FinalBossIsAlive = false + PlayedMessages = {} + end + end + end + + if FinalBossHealth ~= nil and FinalBossProgress ~= nil and FinalBossHealth > 0 then + FinalBossIsAlive = true + if FinalBossProgress >= 100 and not PlayedMessages["FinalBossProgress100"] then + WG["notifications"].queueNotification("PvE/Raptor_QueenIsReady") + PlayedMessages["FinalBossProgress100"] = true + end + if FinalBossHealth <= 50 and not PlayedMessages["FinalBossHealth50"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen50HealthLeft") + PlayedMessages["FinalBossHealth50"] = true + end + if FinalBossHealth <= 25 and not PlayedMessages["FinalBossHealth25"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen25HealthLeft") + PlayedMessages["FinalBossHealth25"] = true + end + if FinalBossHealth <= 10 and not PlayedMessages["FinalBossHealth10"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen10HealthLeft") + PlayedMessages["FinalBossHealth10"] = true + end + if FinalBossHealth <= 5 and not PlayedMessages["FinalBossHealth5"] then + WG["notifications"].queueNotification("PvE/Raptor_Queen5HealthLeft") + PlayedMessages["FinalBossHealth5"] = true + end + + CurrentlyStaggered = Spring.GetGameRulesParam("raptorQueenStaggerActive") + if CurrentlyStaggered == true and not PlayedMessages["FinalBossStaggered"] then + PlayedMessages["FinalBossStaggered"] = true + WG["notifications"].queueNotification("PvE/Raptor_QueenGotStaggered") + elseif PlayedMessages["FinalBossStaggered"] and CurrentlyStaggered == false then + PlayedMessages["FinalBossStaggered"] = false + WG["notifications"].queueNotification("PvE/Raptor_QueenNoLongerStaggered") + end + end + elseif Spring.Utilities.Gametype.IsScavengers() then + FinalBossProgress = Spring.GetGameRulesParam("scavBossAnger") + FinalBossHealth = Spring.GetGameRulesParam("scavBossHealth") + TechProgress = Spring.GetGameRulesParam("scavTechAnger") + + if TechProgress and TechProgress >= 50 and not PlayedMessages["AntiNukeReminder1"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder1"] = true + end + if TechProgress and TechProgress >= 60 and not PlayedMessages["AntiNukeReminder2"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder2"] = true + end + if TechProgress and TechProgress >= 65 and not PlayedMessages["AntiNukeReminder3"] then + WG["notifications"].queueNotification("PvE/AntiNukeReminder") + PlayedMessages["AntiNukeReminder3"] = true + end + + if FinalBossProgress ~= nil and FinalBossHealth ~= nil and FinalBossProgress < 100 then + if FinalBossProgress >= 50 and not PlayedMessages["FinalBossProgress50"] then + WG["notifications"].queueNotification("PvE/Scav_Boss50Ready") + PlayedMessages["FinalBossProgress50"] = true + end + if FinalBossProgress >= 75 and not PlayedMessages["FinalBossProgress75"] then + WG["notifications"].queueNotification("PvE/Scav_Boss75Ready") + PlayedMessages["FinalBossProgress75"] = true + end + if FinalBossProgress >= 90 and not PlayedMessages["FinalBossProgress90"] then + WG["notifications"].queueNotification("PvE/Scav_Boss90Ready") + PlayedMessages["FinalBossProgress90"] = true + end + if FinalBossProgress >= 95 and not PlayedMessages["FinalBossProgress95"] then + WG["notifications"].queueNotification("PvE/Scav_Boss95Ready") + PlayedMessages["FinalBossProgress95"] = true + end + if FinalBossProgress >= 98 and not PlayedMessages["FinalBossProgress98"] then + WG["notifications"].queueNotification("PvE/Scav_Boss98Ready") + PlayedMessages["FinalBossProgress98"] = true + end + + if FinalBossIsAlive and FinalBossHealth <= 0 and not PlayedMessages["FinalBossIsDestroyed"] then + WG["notifications"].queueNotification("PvE/Scav_BossIsDestroyed") + PlayedMessages["FinalBossIsDestroyed"] = true + if Spring.GetModOptions().scav_endless then + FinalBossIsAlive = false + PlayedMessages = {} + end + end + end + + if FinalBossHealth ~= nil and FinalBossProgress ~= nil and FinalBossHealth > 0 then + FinalBossIsAlive = true + if FinalBossProgress >= 100 and not PlayedMessages["FinalBossProgress100"] then + WG["notifications"].queueNotification("PvE/Scav_BossIsReady") + PlayedMessages["FinalBossProgress100"] = true + end + if FinalBossHealth <= 50 and not PlayedMessages["FinalBossHealth50"] then + WG["notifications"].queueNotification("PvE/Scav_Boss50HealthLeft") + PlayedMessages["FinalBossHealth50"] = true + end + if FinalBossHealth <= 25 and not PlayedMessages["FinalBossHealth25"] then + WG["notifications"].queueNotification("PvE/Scav_Boss25HealthLeft") + PlayedMessages["FinalBossHealth25"] = true + end + if FinalBossHealth <= 10 and not PlayedMessages["FinalBossHealth10"] then + WG["notifications"].queueNotification("PvE/Scav_Boss10HealthLeft") + PlayedMessages["FinalBossHealth10"] = true + end + if FinalBossHealth <= 5 and not PlayedMessages["FinalBossHealth5"] then + WG["notifications"].queueNotification("PvE/Scav_Boss5HealthLeft") + PlayedMessages["FinalBossHealth5"] = true + end + + CurrentlyStaggered = Spring.GetGameRulesParam("scavBossStaggerActive") + if CurrentlyStaggered == true and not PlayedMessages["FinalBossStaggered"] then + PlayedMessages["FinalBossStaggered"] = true + WG["notifications"].queueNotification("PvE/Scav_BossGotStaggered") + elseif PlayedMessages["FinalBossStaggered"] and CurrentlyStaggered == false then + PlayedMessages["FinalBossStaggered"] = false + WG["notifications"].queueNotification("PvE/Scav_BossNoLongerStaggered") + end + end + end + end +end diff --git a/luaui/Widgets/snd_unit_finished.lua b/luaui/Widgets/snd_unit_finished.lua index f28404531ce..f0f5acd95be 100644 --- a/luaui/Widgets/snd_unit_finished.lua +++ b/luaui/Widgets/snd_unit_finished.lua @@ -1,15 +1,15 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Unit Finished Sounds", - desc = "Plays a sound when a unit is built", - author = "TheFatController", - date = "30 Sep 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "Unit Finished Sounds", + desc = "Plays a sound when a unit is built", + author = "TheFatController", + date = "30 Sep 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- @@ -22,19 +22,19 @@ local configVolume = tonumber(Spring.GetConfigString("snd_volunitreply") or 100) local volume = ((configVolume or 100) / 100) function widget:Initialize() - for unitDefID,defs in pairs(UnitDefs) do - if defs["sounds"]["select"][1] and (not (defs["sounds"]["activate"][1])) then - activateSounds[unitDefID] = (defs["sounds"]["select"][1]["name"]) - end - end + for unitDefID, defs in pairs(UnitDefs) do + if defs["sounds"]["select"][1] and not defs["sounds"]["activate"][1] then + activateSounds[unitDefID] = defs["sounds"]["select"][1]["name"] + end + end end function widget:UnitFinished(unitID, unitDefID, unitTeam) - if activateSounds[unitDefID] then - local x,y,z = GetUnitPosition(unitID) - PlaySoundFile(activateSounds[unitDefID],volume,x,y,z, 'sfx') - end + if activateSounds[unitDefID] then + local x, y, z = GetUnitPosition(unitID) + PlaySoundFile(activateSounds[unitDefID], volume, x, y, z, "sfx") + end end - + +-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/luaui/Widgets/snd_volume_osd.lua b/luaui/Widgets/snd_volume_osd.lua index 108e79c3240..05b58ca343f 100644 --- a/luaui/Widgets/snd_volume_osd.lua +++ b/luaui/Widgets/snd_volume_osd.lua @@ -17,11 +17,10 @@ function widget:GetInfo() date = "Jan 10, 2012", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spEcho = Spring.Echo @@ -39,7 +38,7 @@ local dt = -1 -------------------------------------------------------------------------------- -- SETTINGS, configurable -------------------------------------------------------------------------------- -local TEST_SOUND = 'LuaUI/sounds/volume_osd/pop.wav' +local TEST_SOUND = "LuaUI/sounds/volume_osd/pop.wav" local step = 8 -- how many steps to change sound volume on one key press local dtime = 3 --How long time the volume display is drawn, in seconds local ftime = 2.5 --How long time before the volume display starts fading, in seconds @@ -71,7 +70,7 @@ local function sndVolumeIncreaseHandler(_, _, _, _, isRepeat) Spring.SetConfigInt("snd_volmaster", volume) --spEcho("Volume = " .. volume) if not isRepeat then - Spring.PlaySoundFile(TEST_SOUND, 1.0, 'ui') + Spring.PlaySoundFile(TEST_SOUND, 1.0, "ui") end dt = os.clock() return true @@ -89,7 +88,7 @@ local function sndVolumeDecreaseHandler(_, _, _, _, isRepeat) Spring.SetConfigInt("snd_volmaster", volume) --spEcho("Volume = " .. volume) if not isRepeat then - Spring.PlaySoundFile(TEST_SOUND, 1.0, 'ui') + Spring.PlaySoundFile(TEST_SOUND, 1.0, "ui") end dt = os.clock() return true @@ -98,14 +97,12 @@ end function widget:Initialize() volume = Spring.GetConfigInt("snd_volmaster", 60) - widgetHandler:AddAction("snd_volume_increase", sndVolumeIncreaseHandler, nil, 'pR') - widgetHandler:AddAction("snd_volume_decrease", sndVolumeDecreaseHandler, nil, 'pR') + widgetHandler:AddAction("snd_volume_increase", sndVolumeIncreaseHandler, nil, "pR") + widgetHandler:AddAction("snd_volume_decrease", sndVolumeDecreaseHandler, nil, "pR") widget:ViewResize(vsx, vsy) end - - function widget:DrawScreen() local y1 = widgetPosY local y2 = widgetPosY + widgetHeight @@ -134,7 +131,7 @@ function widget:DrawScreen() RectRound(u1 + padding, y1 + padding, u2 - padding, y2 - padding, (u2 - u1) / 5.5, 1, 1, 1, 1, { 1, 1, 1, 0.035 * alpha }, { 1, 1, 1, 0.02 * alpha }) end local vol2 = math.floor((volume / (100 / rectangles)) / 2) - gl.Color(0, 0.85, 0, alpha) -- draws filled rectangles + gl.Color(0, 0.85, 0, alpha) -- draws filled rectangles local spacer2 = boxwidth / 10 for i = 1, vol2 do local u1 = x1 + (i - 1) * boxwidth @@ -156,9 +153,7 @@ function IsOnButton(x, y, BLcornerX, BLcornerY, TRcornerX, TRcornerY) end -- check if the mouse is in a rectangle - return x >= BLcornerX and x <= TRcornerX - and y >= BLcornerY - and y <= TRcornerY + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY end function widget:ViewResize(viewSizeX, viewSizeY) diff --git a/luaui/Widgets/stats_damage.lua b/luaui/Widgets/stats_damage.lua index 5cd047432ed..a3140d3e20e 100644 --- a/luaui/Widgets/stats_damage.lua +++ b/luaui/Widgets/stats_damage.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Statistics Collection", - desc = "Receive unit stats and write to file in /luaui/config \nIf your experiment needs statistics, you should have done a better experiment", - author = "Bluestone", - date = "", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Statistics Collection", + desc = "Receive unit stats and write to file in /luaui/config \nIf your experiment needs statistics, you should have done a better experiment", + author = "Bluestone", + date = "", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -23,7 +23,7 @@ All statistics are mean averages, except for 'n', which is the number of samples ]] local info -local STATS_FILE = 'LuaUI/Config/BAR_damageStats.lua' +local STATS_FILE = "LuaUI/Config/BAR_damageStats.lua" local INTERNAL_VERSION = 1 -- bump to reset stats file (user can delete file with same effect) local game = Game.gameName @@ -34,70 +34,78 @@ local unitMetalCost = {} local unitEnergyCost = {} local unitHumanName = {} for unitDefID, unitDef in pairs(UnitDefs) do - unitName[unitDefID] = unitDef.name - unitMetalCost[unitDefID] = unitDef.metalCost - unitEnergyCost[unitDefID] = unitDef.energyCost - unitHumanName[unitDefID] = unitDef.translatedHumanName + unitName[unitDefID] = unitDef.name + unitMetalCost[unitDefID] = unitDef.metalCost + unitEnergyCost[unitDefID] = unitDef.energyCost + unitHumanName[unitDefID] = unitDef.translatedHumanName end local chunk, err = loadfile(STATS_FILE) if chunk then - local tmp = {} - setfenv(chunk, tmp) - stats = chunk() + local tmp = {} + setfenv(chunk, tmp) + stats = chunk() end - function RecieveGameMode(mode) - mode = mode or "unknown" + mode = mode or "unknown" - stats = stats or {} - if not stats.internal_version or stats.internal_version < INTERNAL_VERSION then stats = {} end - stats.internal_version = INTERNAL_VERSION + stats = stats or {} + if not stats.internal_version or stats.internal_version < INTERNAL_VERSION then + stats = {} + end + stats.internal_version = INTERNAL_VERSION - stats[game] = stats[game] or {} - stats[game][mode] = stats[game][mode] or {} + stats[game] = stats[game] or {} + stats[game][mode] = stats[game][mode] or {} - info = stats[game][mode] - info.games = info.games or 0 - info.games = info.games + 1 + info = stats[game][mode] + info.games = info.games or 0 + info.games = info.games + 1 - info["_games_per_version"] = info["_games_per_version"] or {} - info["_games_per_version"][version] = info["_games_per_version"][version] or 0 - info["_games_per_version"][version] = info["_games_per_version"][version] + 1 + info["_games_per_version"] = info["_games_per_version"] or {} + info["_games_per_version"][version] = info["_games_per_version"][version] or 0 + info["_games_per_version"][version] = info["_games_per_version"][version] + 1 end function RecieveStats(uDID, n, ts, dmg_dealt, dmg_rec, minutes, kills, killed_cost) - if not info then return end - local name = unitName[uDID] - if not name then return end - - local cost = unitMetalCost[uDID] + unitEnergyCost[uDID] / 60 - info[name] = info[name] or {dmg_dealt=0,dmg_rec=0,n=0,ts=0,name=unitHumanName[uDID],minutes=0,kills=0,killed_cost=0, cost=cost} - - local old_n = info[name].n - info[name].ts = ((info[name].ts or 0) * old_n + ts)/(old_n+n) - info[name].dmg_dealt = ((info[name].dmg_dealt or 0) * old_n + dmg_dealt)/(old_n+n) - info[name].dmg_rec = ((info[name].dmg_rec or 0) * old_n + dmg_rec)/(old_n+n) - info[name].minutes = ((info[name].minutes or 0) * old_n + minutes)/(old_n+n) - info[name].kills = ((info[name].kills or 0) * old_n + kills)/(old_n+n) - info[name].killed_cost = ((info[name].killed_cost or 0) * old_n + killed_cost)/(old_n+n) - - info[name].n = info[name].n + n + if not info then + return + end + local name = unitName[uDID] + if not name then + return + end + + local cost = unitMetalCost[uDID] + unitEnergyCost[uDID] / 60 + info[name] = info[name] or { dmg_dealt = 0, dmg_rec = 0, n = 0, ts = 0, name = unitHumanName[uDID], minutes = 0, kills = 0, killed_cost = 0, cost = cost } + + local old_n = info[name].n + info[name].ts = ((info[name].ts or 0) * old_n + ts) / (old_n + n) + info[name].dmg_dealt = ((info[name].dmg_dealt or 0) * old_n + dmg_dealt) / (old_n + n) + info[name].dmg_rec = ((info[name].dmg_rec or 0) * old_n + dmg_rec) / (old_n + n) + info[name].minutes = ((info[name].minutes or 0) * old_n + minutes) / (old_n + n) + info[name].kills = ((info[name].kills or 0) * old_n + kills) / (old_n + n) + info[name].killed_cost = ((info[name].killed_cost or 0) * old_n + killed_cost) / (old_n + n) + + info[name].n = info[name].n + n end function widget:SendStats_GameMode(mode) - RecieveGameMode(mode) + RecieveGameMode(mode) end function widget:SendStats(uDID, n, ts, dmg_dealt, dmg_rec, minutes, kills, killed_cost) - RecieveStats(uDID, n, ts, dmg_dealt, dmg_rec, minutes, kills, killed_cost) + RecieveStats(uDID, n, ts, dmg_dealt, dmg_rec, minutes, kills, killed_cost) end function widget:GameOver() - if not info or Spring.IsReplay() then return end - if Spring.Utilities.IsDevMode() then return end - - table.save(stats, STATS_FILE, '-- Damage Stats') + if not info or Spring.IsReplay() then + return + end + if Spring.Utilities.IsDevMode() then + return + end + + table.save(stats, STATS_FILE, "-- Damage Stats") end - diff --git a/luaui/Widgets/test_DPAT.lua b/luaui/Widgets/test_DPAT.lua index 21834a7663f..af8f3489e20 100644 --- a/luaui/Widgets/test_DPAT.lua +++ b/luaui/Widgets/test_DPAT.lua @@ -12,7 +12,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spEcho = Spring.Echo local spGetUnitTeam = Spring.GetUnitTeam @@ -24,7 +23,7 @@ local texture = "luaui/images/backgroundtile.png" local InstanceVBOTable = gl.InstanceVBOTable -local popElementInstance = InstanceVBOTable.popElementInstance +local popElementInstance = InstanceVBOTable.popElementInstance local pushElementInstance = InstanceVBOTable.pushElementInstance local selectionVBO = nil @@ -32,94 +31,112 @@ local selectShader = nil local luaShaderDir = "LuaUI/Include/" -- Localize for speedups: -local glStencilFunc = gl.StencilFunc -local glStencilOp = gl.StencilOp -local glStencilTest = gl.StencilTest -local glStencilMask = gl.StencilMask -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local glClear = gl.Clear -local GL_ALWAYS = GL.ALWAYS -local GL_NOTEQUAL = GL.NOTEQUAL -local GL_KEEP = 0x1E00 --GL.KEEP +local glStencilFunc = gl.StencilFunc +local glStencilOp = gl.StencilOp +local glStencilTest = gl.StencilTest +local glStencilMask = gl.StencilMask +local glDepthTest = gl.DepthTest +local glTexture = gl.Texture +local glClear = gl.Clear +local GL_ALWAYS = GL.ALWAYS +local GL_NOTEQUAL = GL.NOTEQUAL +local GL_KEEP = 0x1E00 --GL.KEEP local GL_STENCIL_BUFFER_BIT = GL.STENCIL_BUFFER_BIT -local GL_REPLACE = GL.REPLACE -local GL_POINTS = GL.POINTS - +local GL_REPLACE = GL.REPLACE +local GL_POINTS = GL.POINTS local function AddPrimitiveAtUnit(unitID, unitDefID) local gf = Spring.GetGameFrame() unitDefID = unitDefID or Spring.GetUnitDefID(unitID) - if unitDefID == nil then return end -- these cant be selected - local numVertices = 64 -- default to cornered rectangle + if unitDefID == nil then + return + end -- these cant be selected + local numVertices = 64 -- default to cornered rectangle local cornersize = 0 - + local radius = Spring.GetUnitRadius(unitID) * 2.6 or 64 - local width = radius + local width = radius local length = radius local additionalheight = 0 - + local unitDef = UnitDefs[unitDefID] - if UnitDefs[unitDefID].canFly then + if UnitDefs[unitDefID].canFly then numVertices = 3 - width = radius /2 - length = radius /2 + width = radius / 2 + length = radius / 2 end -- triangles for planes - if unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0 then + if unitDef.isBuilding or unitDef.isFactory or unitDef.speed == 0 then width = unitDef.xsize * 8 + 16 - length = unitDef.zsize * 8 + 16 + length = unitDef.zsize * 8 + 16 cornersize = (width + length) * 0.075 numVertices = 2 end - + --spEcho(unitID,radius,radius, spGetUnitTeam(unitID), numvertices, 1, gf) pushElementInstance( selectionVBO, -- push into this Instance VBO Table - {length, width, cornersize, additionalheight, -- lengthwidthcornerheight + { + length, + width, + cornersize, + additionalheight, -- lengthwidthcornerheight spGetUnitTeam(unitID), -- teamID numVertices, -- how many trianges should we make - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in - unitID, -- this is the key inside the VBO TAble, + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in + unitID, -- this is the key inside the VBO TAble, true, -- update existing element - nil, -- noupload, dont use unless you - unitID) -- last one should be UNITID? + nil, -- noupload, dont use unless you + unitID + ) -- last one should be UNITID? end local drawFrame = 0 function widget:DrawWorldPreUnit() drawFrame = drawFrame + 1 - if selectionVBO.usedElements > 0 then - if drawFrame % 100 == 0 then spEcho("selectionVBO.usedElements",selectionVBO.usedElements) end + if selectionVBO.usedElements > 0 then + if drawFrame % 100 == 0 then + spEcho("selectionVBO.usedElements", selectionVBO.usedElements) + end local disticon = Spring.GetConfigInt("UnitIconDist", 200) -- iconLength = unitIconDist * unitIconDist * 750.0f; --gl.Culling(false) disticon = disticon * 27 -- should be sqrt(750) but not really glTexture(0, texture) selectShader:Activate() - selectShader:SetUniform("iconDistance",disticon) -- pass + selectShader:SetUniform("iconDistance", disticon) -- pass glStencilTest(true) --https://learnopengl.com/Advanced-OpenGL/Stencil-testing glDepthTest(true) glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE) -- Set The Stencil Buffer To 1 Where Draw Any Polygon this to the shader - glClear(GL_STENCIL_BUFFER_BIT ) -- set stencil buffer to 0 + glClear(GL_STENCIL_BUFFER_BIT) -- set stencil buffer to 0 - glStencilFunc(GL_NOTEQUAL, 1, 1); -- use NOTEQUAL instead of ALWAYS to ensure that overlapping transparent fragments dont get written multiple times + glStencilFunc(GL_NOTEQUAL, 1, 1) -- use NOTEQUAL instead of ALWAYS to ensure that overlapping transparent fragments dont get written multiple times glStencilMask(1) - - selectShader:SetUniform("addRadius",0) -- pass this - selectionVBO.VAO:DrawArrays(GL_POINTS,selectionVBO.usedElements) - - glStencilFunc(GL_NOTEQUAL, 1, 1); + + selectShader:SetUniform("addRadius", 0) -- pass this + selectionVBO.VAO:DrawArrays(GL_POINTS, selectionVBO.usedElements) + + glStencilFunc(GL_NOTEQUAL, 1, 1) glStencilMask(0) glDepthTest(true) - - selectShader:SetUniform("addRadius",2) -- pass this - selectionVBO.VAO:DrawArrays(GL_POINTS,selectionVBO.usedElements) - + + selectShader:SetUniform("addRadius", 2) -- pass this + selectionVBO.VAO:DrawArrays(GL_POINTS, selectionVBO.usedElements) + glStencilMask(1) - glStencilFunc(GL_ALWAYS, 1, 1); + glStencilFunc(GL_ALWAYS, 1, 1) glDepthTest(true) - + selectShader:Deactivate() glTexture(0, false) end @@ -161,12 +178,12 @@ function widget:UnitDestroyedByTeam(unitID, unitDefID, unitTeam, attackerTeamID) end function widget:Initialize() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE! shaderConfig.BILLBOARD = 0 selectionVBO, selectShader = InitDrawPrimitiveAtUnit(shaderConfig, "TESTDPAU") - if selectionVBO == nil then + if selectionVBO == nil then widgetHandler:RemoveWidget() return end @@ -178,5 +195,4 @@ function widget:Initialize() end end -function widget:ShutDown() -end \ No newline at end of file +function widget:ShutDown() end diff --git a/luaui/Widgets/test_dpat_minimal_example.lua b/luaui/Widgets/test_dpat_minimal_example.lua index 919ca082766..02157c75b68 100644 --- a/luaui/Widgets/test_dpat_minimal_example.lua +++ b/luaui/Widgets/test_dpat_minimal_example.lua @@ -24,49 +24,68 @@ local selectionVBO = nil local selectShader = nil local luaShaderDir = "LuaUI/Include/" -local glTexture = gl.Texture +local glTexture = gl.Texture local function AddPrimitiveAtUnit(unitID, unitDefID) local gf = Spring.GetGameFrame() unitDefID = unitDefID or Spring.GetUnitDefID(unitID) - if unitDefID == nil then return end -- these cant be selected + if unitDefID == nil then + return + end -- these cant be selected local numVertices = 62 -- default to circle local cornersize = 0 - + local radius = Spring.GetUnitRadius(unitID) * 2.6 or 64 - local width = radius + local width = radius local length = radius - local additionalheight = 2*radius - + local additionalheight = 2 * radius + pushElementInstance( selectionVBO, -- push into this Instance VBO Table - {length, width, cornersize, additionalheight, -- lengthwidthcornerheight + { + length, + width, + cornersize, + additionalheight, -- lengthwidthcornerheight Spring.GetUnitTeam(unitID), -- teamID numVertices, -- how many trianges should we make - gf, 0, 0, 0, -- the gameFrame (for animations), and any other parameters one might want to add - 0, 1, 0, 1, -- These are our default UV atlas tranformations - 0, 0, 0, 0}, -- these are just padding zeros, that will get filled in + gf, + 0, + 0, + 0, -- the gameFrame (for animations), and any other parameters one might want to add + 0, + 1, + 0, + 1, -- These are our default UV atlas tranformations + 0, + 0, + 0, + 0, + }, -- these are just padding zeros, that will get filled in unitID, -- this is the key inside the VBO TAble, should be unique per unit true, -- update existing element - nil, -- noupload, dont use unless you - unitID) -- last one should be UNITID! + nil, -- noupload, dont use unless you + unitID + ) -- last one should be UNITID! end function widget:DrawWorldPreUnit() - if selectionVBO.usedElements > 0 then + if selectionVBO.usedElements > 0 then local disticon = 27 * Spring.GetConfigInt("UnitIconDist", 200) -- iconLength = unitIconDist * unitIconDist * 750.0f; glTexture(0, texture) selectShader:Activate() - selectShader:SetUniform("iconDistance",disticon) - selectShader:SetUniform("addRadius",0) - selectionVBO.VAO:DrawArrays(GL.POINTS,selectionVBO.usedElements) + selectShader:SetUniform("iconDistance", disticon) + selectShader:SetUniform("addRadius", 0) + selectionVBO.VAO:DrawArrays(GL.POINTS, selectionVBO.usedElements) selectShader:Deactivate() glTexture(0, false) end end function widget:UnitCreated(unitID) - if not Spring.IsUnitAllied(unitID) then return end + if not Spring.IsUnitAllied(unitID) then + return + end AddPrimitiveAtUnit(unitID) end @@ -75,7 +94,7 @@ function widget:UnitDestroyed(unitID) end function widget:Initialize() - local DPatUnit = VFS.Include(luaShaderDir.."DrawPrimitiveAtUnit.lua") + local DPatUnit = VFS.Include(luaShaderDir .. "DrawPrimitiveAtUnit.lua") local InitDrawPrimitiveAtUnit = DPatUnit.InitDrawPrimitiveAtUnit local shaderConfig = DPatUnit.shaderConfig -- MAKE SURE YOU READ THE SHADERCONFIG TABLE in DrawPrimitiveAtUnit.lua shaderConfig.BILLBOARD = 1 @@ -89,5 +108,4 @@ function widget:Initialize() end end -function widget:ShutDown() -end \ No newline at end of file +function widget:ShutDown() end diff --git a/luaui/Widgets/tweakdefs_unit_translations.lua b/luaui/Widgets/tweakdefs_unit_translations.lua index 6ef85b5351a..597dc83d059 100644 --- a/luaui/Widgets/tweakdefs_unit_translations.lua +++ b/luaui/Widgets/tweakdefs_unit_translations.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "Dec 20, 2024", license = "GNU GPL, v2 or later", layer = -1000000, -- must run before gui_language - enabled = true + enabled = true, } end @@ -24,11 +24,11 @@ local function updateTranslations() local customTooltip = unitDef.customParams[tooltipKey] if customHumanName then - Spring.I18N.set(currentLanguage .. '.units.names.' .. unitDefName, customHumanName) + Spring.I18N.set(currentLanguage .. ".units.names." .. unitDefName, customHumanName) end if customTooltip then - Spring.I18N.set(currentLanguage .. '.units.descriptions.' .. unitDefName, customTooltip) + Spring.I18N.set(currentLanguage .. ".units.descriptions." .. unitDefName, customTooltip) end end end @@ -39,4 +39,4 @@ end function widget:LanguageChanged() updateTranslations() -end \ No newline at end of file +end diff --git a/luaui/Widgets/unit_alt_set_target_type.lua b/luaui/Widgets/unit_alt_set_target_type.lua index b6846959153..8f002fdeb44 100644 --- a/luaui/Widgets/unit_alt_set_target_type.lua +++ b/luaui/Widgets/unit_alt_set_target_type.lua @@ -2,37 +2,36 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Set unit type target", - desc = "Hold down Alt and set target on an enemy unit to make selected units set target on all future enemies of that type", - author = "Flameink", - date = "August 1, 2025", + name = "Set unit type target", + desc = "Hold down Alt and set target on an enemy unit to make selected units set target on all future enemies of that type", + author = "Flameink", + date = "August 1, 2025", version = "1.0", license = "GNU GPL, v2 or later", - layer = -1, -- won't work at layer 0 for unknown reasons - enabled = true + layer = -1, -- won't work at layer 0 for unknown reasons + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetUnitTeam = Spring.GetUnitTeam local spGiveOrderArrayToUnit = Spring.GiveOrderArrayToUnit -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetMyTeamID = Spring.GetMyTeamID -local spGetActiveCommand = Spring.GetActiveCommand -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local spGetModKeyState = Spring.GetModKeyState +local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetMyTeamID = Spring.GetMyTeamID +local spGetActiveCommand = Spring.GetActiveCommand +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local spGetModKeyState = Spring.GetModKeyState local trackedUnitsToUnitDefID = {} local unitRanges = {} -local cursorPos -- current cursor position (table{x,y,z}) +local cursorPos -- current cursor position (table{x,y,z}) local snappedPos -- snapped valid target position (table{x,y,z}) local POLLING_RATE = 15 @@ -64,50 +63,54 @@ for udid, ud in pairs(UnitDefs) do end local function GetUnitsInAttackRangeWithDef(unitID, unitDefIDToTarget) - local unitsInRange = {} + local unitsInRange = {} local unitTeam = spGetUnitTeam(unitID) - if unitTeam == nil then return unitsInRange end + if unitTeam == nil then + return unitsInRange + end - local ux, uy, uz = spGetUnitPosition(unitID) - if not ux then return unitsInRange end + local ux, uy, uz = spGetUnitPosition(unitID) + if not ux then + return unitsInRange + end - local maxRange = unitRanges[spGetUnitDefID(unitID)] - if maxRange == nil or maxRange <= 0 then return unitsInRange end + local maxRange = unitRanges[spGetUnitDefID(unitID)] + if maxRange == nil or maxRange <= 0 then + return unitsInRange + end maxRange = maxRange * UNIT_RANGE_MULTIPLIER - local candidateUnits = spGetUnitsInCylinder(ux, uz, maxRange) + local candidateUnits = spGetUnitsInCylinder(ux, uz, maxRange) for _, targetID in ipairs(candidateUnits) do local targetTeam = spGetUnitTeam(targetID) - if targetID ~= unitID and targetTeam ~= nil then - local isAllied = spAreTeamsAllied(unitTeam, targetTeam) + if targetID ~= unitID and targetTeam ~= nil then + local isAllied = spAreTeamsAllied(unitTeam, targetTeam) if not isAllied and spGetUnitDefID(targetID) == unitDefIDToTarget then table.insert(unitsInRange, targetID) - end - end - end + end + end + end - return unitsInRange + return unitsInRange end local function distance(point1, point2) if not point1 or not point2 then return -1 end - - return math.diag(point1[1] - point2[1], - point1[2] - point2[2], - point1[3] - point2[3]) + + return math.diag(point1[1] - point2[1], point1[2] - point2[2], point1[3] - point2[3]) end local function clear() - cursorPos = nil - snappedPos = nil + cursorPos = nil + snappedPos = nil end local function MakeLine(x1, y1, z1, x2, y2, z2) - gl.Vertex(x1, y1, z1) - gl.Vertex(x2, y2, z2) + gl.Vertex(x1, y1, z1) + gl.Vertex(x2, y2, z2) end local function FindNearestEnemyUnit(x, y, z, radius, myTeam) @@ -122,7 +125,7 @@ local function FindNearestEnemyUnit(x, y, z, radius, myTeam) if targetTeam and not spAreTeamsAllied(myTeam, targetTeam) then local ux, uy, uz = spGetUnitPosition(candidateID) if ux then - local distSq = distance({x, y, z}, {ux, uy, uz}) + local distSq = distance({ x, y, z }, { ux, uy, uz }) if distSq < closestDistance then closestUnit = candidateID @@ -136,43 +139,41 @@ local function FindNearestEnemyUnit(x, y, z, radius, myTeam) end function widget:DrawWorld() - if not cursorPos or not snappedPos then return end - gl.DepthTest(false) - gl.LineWidth(2) - gl.Color(0.3, 1, 0.3, 0.45) - gl.BeginEnd(GL.LINE_STRIP, MakeLine, cursorPos.x, cursorPos.y, cursorPos.z, snappedPos.x, snappedPos.y, snappedPos.z) - gl.LineWidth(1) - gl.DepthTest(true) + if not cursorPos or not snappedPos then + return + end + gl.DepthTest(false) + gl.LineWidth(2) + gl.Color(0.3, 1, 0.3, 0.45) + gl.BeginEnd(GL.LINE_STRIP, MakeLine, cursorPos.x, cursorPos.y, cursorPos.z, snappedPos.x, snappedPos.y, snappedPos.z) + gl.LineWidth(1) + gl.DepthTest(true) end local function handleSelectionLine() local _, cmdID = spGetActiveCommand() - local alt, ctrl, meta, shift = spGetModKeyState() + local alt, ctrl, meta, shift = spGetModKeyState() local correctCommand = cmdID == CMD_SET_TARGET and alt and not ctrl and not meta and not shift if not correctCommand then - clear() - return - end + clear() + return + end - local mx, my = spGetMouseState() - local _, worldPos = spTraceScreenRay(mx, my, true) - if not worldPos then - clear() - return - end + local mx, my = spGetMouseState() + local _, worldPos = spTraceScreenRay(mx, my, true) + if not worldPos then + clear() + return + end if worldPos and worldPos[1] then local myTeam = spGetMyTeamID() - local targetID = FindNearestEnemyUnit( - worldPos[1], worldPos[2], worldPos[3], - SNAP_RADIUS, - myTeam - ) + local targetID = FindNearestEnemyUnit(worldPos[1], worldPos[2], worldPos[3], SNAP_RADIUS, myTeam) if targetID then local ux, uy, uz = spGetUnitPosition(targetID) -- Enable the line - snappedPos = { x = ux, y = uy, z = uz } - cursorPos = { x = worldPos[1], y = worldPos[2], z = worldPos[3] } + snappedPos = { x = ux, y = uy, z = uz } + cursorPos = { x = worldPos[1], y = worldPos[2], z = worldPos[3] } else clear() return @@ -192,11 +193,11 @@ function widget:GameFrame(frame) local commandsToGive = {} for _, targetID in ipairs(candidateUnits) do local newCmdOpts = {} - if #commandsToGive ~= 0 then + if #commandsToGive ~= 0 then newCmdOpts = { "shift" } end - commandsToGive[#commandsToGive+1] = { CMD_SET_TARGET, { targetID }, newCmdOpts } + commandsToGive[#commandsToGive + 1] = { CMD_SET_TARGET, { targetID }, newCmdOpts } end spGiveOrderArrayToUnit(unitID, commandsToGive) @@ -227,16 +228,12 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) if #cmdParams == 4 and not shouldCleanupTargeting then local mx, my = spGetMouseState() local _, worldPos = spTraceScreenRay(mx, my, true) - + if worldPos and worldPos[1] then local myTeam = spGetMyTeamID() -- Blocked on https://github.com/beyond-all-reason/RecoilEngine/issues/2793 -- targetID = Spring.GetClosestEnemyUnit(worldPos[1], worldPos[2], worldPos[3], SNAP_RADIUS, myTeam) - targetID = FindNearestEnemyUnit( - worldPos[1], worldPos[2], worldPos[3], - SNAP_RADIUS, - myTeam - ) + targetID = FindNearestEnemyUnit(worldPos[1], worldPos[2], worldPos[3], SNAP_RADIUS, myTeam) -- If there's no enemy to snap the command to, clean up the targeting if targetID == nil then shouldCleanupTargeting = true diff --git a/luaui/Widgets/unit_area_reclaim_enemy.lua b/luaui/Widgets/unit_area_reclaim_enemy.lua index 480d9987d5b..d8402e88ea9 100644 --- a/luaui/Widgets/unit_area_reclaim_enemy.lua +++ b/luaui/Widgets/unit_area_reclaim_enemy.lua @@ -1,14 +1,13 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Area Reclaim Enemy", - desc = "Hold down Space an give area reclaim order on the ground or enemy to target enemies only during reclaim.", - author = "NemoTheHero", - date = "July 26, 2025", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Area Reclaim Enemy", + desc = "Hold down Space an give area reclaim order on the ground or enemy to target enemies only during reclaim.", + author = "NemoTheHero", + date = "July 26, 2025", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -23,33 +22,31 @@ local spWorldToScreenCoords = Spring.WorldToScreenCoords local spTraceScreenRay = Spring.TraceScreenRay local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitCmdDescs= Spring.GetUnitCmdDescs -local spGetUnitPosition= Spring.GetUnitPosition +local spGetUnitCmdDescs = Spring.GetUnitCmdDescs +local spGetUnitPosition = Spring.GetUnitPosition local reclaimEnemy = Game.reclaimAllowEnemies local CMD_RECLAIM = CMD.RECLAIM - - function maybeRemoveSelf() - if Spring.GetSpectatingState() and (Spring.GetGameFrame() > 0) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (Spring.GetGameFrame() > 0) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - maybeRemoveSelf() + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() then + if Spring.IsReplay() then maybeRemoveSelf() - end + end end function widget:CommandNotify(id, params, options) @@ -57,13 +54,13 @@ function widget:CommandNotify(id, params, options) if id ~= CMD_RECLAIM or #params ~= 4 or not options.meta then return end - + local cx, cy, cz, cr = unpack(params) - local mx,my,mz = spWorldToScreenCoords(cx, cy, cz) - local cType,id = spTraceScreenRay(mx,my) + local mx, my, mz = spWorldToScreenCoords(cx, cy, cz) + local cType, id = spTraceScreenRay(mx, my) - if not ( cType == "unit" or cType == "ground" ) then + if not (cType == "unit" or cType == "ground") then return end @@ -72,7 +69,7 @@ function widget:CommandNotify(id, params, options) local areaUnits = spGetUnitsInCylinder(cx, cz, cr) local enemyUnits = {} -- get all enemy units in the area - for i=1,#areaUnits do + for i = 1, #areaUnits do local unitID = areaUnits[i] local enemyUnit = not Spring.AreTeamsAllied(Spring.GetUnitTeam(unitID), Spring.GetMyTeamID()) if enemyUnit then @@ -87,16 +84,12 @@ function widget:CommandNotify(id, params, options) -- get avg point of selected units local avgx, avgy, avgz = Spring.GetUnitArrayCentroid(selectedUnits) -- sort enemyUnits by distance from averagePoint of selected units - table.sort(enemyUnits, - function (unit1, unit2) - local x1, _, z1 = spGetUnitPosition(unit1) - local x2, _, z2 = spGetUnitPosition(unit2) - --distance formula - return math.hypot(avgx-x1, avgz-z1) < - math.hypot(avgx-x2, avgz-z2) - end - ) - + table.sort(enemyUnits, function(unit1, unit2) + local x1, _, z1 = spGetUnitPosition(unit1) + local x2, _, z2 = spGetUnitPosition(unit2) + --distance formula + return math.hypot(avgx - x1, avgz - z1) < math.hypot(avgx - x2, avgz - z2) + end) -- create array of commands to reclaim each enemy unit local newCmds = {} @@ -108,7 +101,7 @@ function widget:CommandNotify(id, params, options) end -- cmd_reclaim with 1 arg reclaims specific unitid, 4 args untargeted -- reclaim, 5 args is targeted area reclaim - newCmds[#newCmds + 1] = { CMD_RECLAIM, {unitID, cx, cy, cz, cr} , cmdOpts } + newCmds[#newCmds + 1] = { CMD_RECLAIM, { unitID, cx, cy, cz, cr }, cmdOpts } end -- add the command to all units with reclaim @@ -117,5 +110,3 @@ function widget:CommandNotify(id, params, options) return true end end - - diff --git a/luaui/Widgets/unit_attackMoveNotification.lua b/luaui/Widgets/unit_attackMoveNotification.lua index e89bc257434..2abed533240 100644 --- a/luaui/Widgets/unit_attackMoveNotification.lua +++ b/luaui/Widgets/unit_attackMoveNotification.lua @@ -8,15 +8,14 @@ function widget:GetInfo() date = "Dec , 2011", license = "GPLv2", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathRandom = math.random -local alarmInterval = 15 --seconds +local alarmInterval = 15 --seconds local spGetLocalTeamID = Spring.GetLocalTeamID local spPlaySoundFile = Spring.PlaySoundFile @@ -97,7 +96,7 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) end if unitHumanName[unitDefID] then lastAlarmTime = now - spEcho( Spring.I18N('ui.moveAttackNotify.underAttack', { unit = unitHumanName[unitDefID] }) ) + spEcho(Spring.I18N("ui.moveAttackNotify.underAttack", { unit = unitHumanName[unitDefID] })) if unitUnderattackSounds[unitDefID] then local id = random(1, #unitUnderattackSounds[unitDefID]) --pick a sound from the table by random --(id 138, name warning2, volume 1) @@ -115,7 +114,7 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) end function widget:UnitMoveFailed(unitID, unitDefID, unitTeam) - spEcho( Spring.I18N('ui.moveAttackNotify.cantMove', { unit = unitHumanName[unitDefID] }) ) + spEcho(Spring.I18N("ui.moveAttackNotify.cantMove", { unit = unitHumanName[unitDefID] })) end function widget:LanguageChanged() diff --git a/luaui/Widgets/unit_auto_cloak.lua b/luaui/Widgets/unit_auto_cloak.lua index 00c08c35349..acbc4ab83d5 100644 --- a/luaui/Widgets/unit_auto_cloak.lua +++ b/luaui/Widgets/unit_auto_cloak.lua @@ -2,33 +2,33 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Auto Cloak Units", - desc = "Auto cloaks Units with Cloak", - author = "wilkubyk", - date = "2022.12.29", - license = "GNU GPL, v2 or later", - layer = -99999, - enabled = true + name = "Auto Cloak Units", + desc = "Auto cloaks Units with Cloak", + author = "wilkubyk", + date = "2022.12.29", + license = "GNU GPL, v2 or later", + layer = -99999, + enabled = true, } end -- defaults local unitdefConfigNames = { - ['armdecom'] = false, - ['cordecom'] = false, - ['armferret'] = false, - ['armamb'] = false, - ['armpb'] = false, - ['armsnipe'] = false, - ['corsktl'] = false, - ['armgremlin'] = true, - ['armamex'] = true, - ['armshockwave'] = true, - ['armckfus'] = true, - ['armspy'] = true, - ['corspy'] = true, - ['legaspy'] = true, - ['corphantom'] = true, + ["armdecom"] = false, + ["cordecom"] = false, + ["armferret"] = false, + ["armamb"] = false, + ["armpb"] = false, + ["armsnipe"] = false, + ["corsktl"] = false, + ["armgremlin"] = true, + ["armamex"] = true, + ["armshockwave"] = true, + ["armckfus"] = true, + ["armspy"] = true, + ["corspy"] = true, + ["legaspy"] = true, + ["corphantom"] = true, } -- convert unitname -> unitDefID local unitdefConfig = {} @@ -46,56 +46,53 @@ local giveOrderToUnit = Spring.GiveOrderToUnit --optimization local spUnitTeam = Spring.GetMyTeamID --optimization local function cloakDeActive(unitID, unitDefID) --DeActivator of Cloak for all units with clock - if unitdefConfig[unitDefID] then - cloakunits[unitID] = true - giveOrderToUnit(unitID, cloak, {0}, 0) - end + if unitdefConfig[unitDefID] then + cloakunits[unitID] = true + giveOrderToUnit(unitID, cloak, { 0 }, 0) + end end local function cloakActive(unitID, unitDefID) --Activator of Cloak - if unitdefConfig[unitDefID] then - cloakunits[unitID] = true - giveOrderToUnit(unitID, cloak, {1}, 0) - end + if unitdefConfig[unitDefID] then + cloakunits[unitID] = true + giveOrderToUnit(unitID, cloak, { 1 }, 0) + end end local function unitIDs(unitID, unitDefID) --check later if could be removed - if unitdefConfig[unitDefID] then - cloakunits[unitID] = true - end + if unitdefConfig[unitDefID] then + cloakunits[unitID] = true + end end local function NewUnit(unitID, unitDefID, unitTeam) --check later if could be removed - if unitTeam ~= spUnitTeam then - return - unitIDs(unitID, unitDefID) - end + if unitTeam ~= spUnitTeam then + return unitIDs(unitID, unitDefID) + end end - local function maybeRemoveSelf() if Spring.GetSpectatingState() then widgetHandler:RemoveWidget() end end - function widget:Initialize() - if Spring.IsReplay() or Spring.GetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or Spring.GetGameFrame() > 0 then + maybeRemoveSelf() + end - WG['autocloak'] = {} - WG['autocloak'].getUnitdefConfig = function() + WG["autocloak"] = {} + WG["autocloak"].getUnitdefConfig = function() return unitdefConfig end - WG['autocloak'].setUnitdefConfig = function(data) + WG["autocloak"].setUnitdefConfig = function(data) local type, value = data[1], data[2] unitdefConfig[type] = value end local allUnits = Spring.GetAllUnits() - for i=1, #allUnits do + for i = 1, #allUnits do local unitID = allUnits[i] cloakActive(unitID, Spring.GetUnitDefID(unitID)) end @@ -127,7 +124,7 @@ function widget:UnitGiven(unitID, unitDefID, unitTeam) end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:GetConfigData() diff --git a/luaui/Widgets/unit_auto_group.lua b/luaui/Widgets/unit_auto_group.lua index ed7d284ea63..acff3a8c176 100644 --- a/luaui/Widgets/unit_auto_group.lua +++ b/luaui/Widgets/unit_auto_group.lua @@ -1,20 +1,19 @@ -local versionNum = '5.00' +local versionNum = "5.00" local widget = widget ---@type Widget function widget:GetInfo() return { name = "Auto Group", - desc = "v" .. (versionNum) .. " Alt+0-9 sets autogroup# for selected unit type(s). Newly built units get added to group# equal to their autogroup#. Alt BACKQUOTE (~) remove units. Type '/luaui autogroup help' for help or view settings at: Settings/Interface/AutoGroup'.", + desc = "v" .. versionNum .. " Alt+0-9 sets autogroup# for selected unit type(s). Newly built units get added to group# equal to their autogroup#. Alt BACKQUOTE (~) remove units. Type '/luaui autogroup help' for help or view settings at: Settings/Interface/AutoGroup'.", author = "Licho", date = "Mar 23, 2007", license = "GNU GPL, v2 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized functions for performance local tableInsert = table.insert @@ -66,7 +65,6 @@ for i = 0, 9 do end local unit2group = presets[currPreset] -- list of unit types to group - local mobileBuilders = {} local builtInPlace = {} @@ -100,7 +98,6 @@ local GetGameFrame = spGetGameFrame local Echo = Spring.Echo local GetUnitRulesParam = Spring.GetUnitRulesParam - function widget:GameStart() gameStarted = true widget:PlayerChanged() @@ -125,7 +122,9 @@ local function addAllUnits() end local function changeUnitTypeAutogroup(gr, removeAll) - if not removeAll and not gr then return end -- noop if add to autogroup and no argument + if not removeAll and not gr then + return + end -- noop if add to autogroup and no argument if removeAll then gr = nil @@ -153,9 +152,9 @@ local function changeUnitTypeAutogroup(gr, removeAll) for udid, _ in pairs(selUnitDefIDs) do if verbose then if gr then - Echo( Spring.I18N('ui.autogroups.unitAdded', { unit = UnitDefs[udid].translatedHumanName, groupNumber = gr }) ) + Echo(Spring.I18N("ui.autogroups.unitAdded", { unit = UnitDefs[udid].translatedHumanName, groupNumber = gr })) else - Echo( Spring.I18N('ui.autogroups.unitRemoved', { unit = UnitDefs[udid].translatedHumanName }) ) + Echo(Spring.I18N("ui.autogroups.unitRemoved", { unit = UnitDefs[udid].translatedHumanName })) end end end @@ -182,7 +181,7 @@ end local function changeUnitTypeAutogroupHandler(_, _, args, data) local gr = args and args[1] - local removeAll = data and data['removeAll'] + local removeAll = data and data["removeAll"] changeUnitTypeAutogroup(gr, removeAll) end @@ -222,7 +221,7 @@ local function loadAutogroupPreset(newPreset) currPreset = newPreset - Echo(Spring.I18N("ui.autogroups.presetSelected", {presetNum = currPreset})) + Echo(Spring.I18N("ui.autogroups.presetSelected", { presetNum = currPreset })) unit2group = presets[currPreset] if not unit2group then @@ -246,9 +245,7 @@ local function loadAutogroupPresetHandler(cmd, optLine, optWords, data, isRepeat loadAutogroupPreset(tonumber(optWords[1])) end - function widget:Initialize() - widget:PlayerChanged() widgetHandler:AddAction("add_to_autogroup", changeUnitTypeAutogroupHandler, nil, "p") -- With a parameter, adds all units of this type to a specific autogroup @@ -256,33 +253,33 @@ function widget:Initialize() widgetHandler:AddAction("remove_one_unit_from_group", removeOneUnitFromGroupHandler, nil, "p") -- Removes the closest of selected units from groups and selects only it widgetHandler:AddAction("load_autogroup_preset", loadAutogroupPresetHandler, nil, "p") -- Changes the autogroup preset - WG['autogroup'] = {} - WG['autogroup'].getImmediate = function() + WG["autogroup"] = {} + WG["autogroup"].getImmediate = function() return immediate end - WG['autogroup'].setImmediate = function(value) + WG["autogroup"].setImmediate = function(value) immediate = value end - WG['autogroup'].getPersist = function() + WG["autogroup"].getPersist = function() return persist end - WG['autogroup'].setPersist = function(value) + WG["autogroup"].setPersist = function(value) persist = value end - WG['autogroup'].getGroups = function() + WG["autogroup"].getGroups = function() return unit2group end - WG['autogroup'].addCurrentSelectionToAutogroup = function(groupNumber) + WG["autogroup"].addCurrentSelectionToAutogroup = function(groupNumber) changeUnitTypeAutogroup(groupNumber) end - WG['autogroup'].removeCurrentSelectionFromAutogroup = function() + WG["autogroup"].removeCurrentSelectionFromAutogroup = function() changeUnitTypeAutogroup(nil, true) end - WG['autogroup'].removeOneUnitFromGroup = function() + WG["autogroup"].removeOneUnitFromGroup = function() removeOneUnitFromGroupHandler() end - WG['autogroup'].loadAutogroupPreset = function(newPreset) + WG["autogroup"].loadAutogroupPreset = function(newPreset) loadAutogroupPreset(newPreset) end if GetGameFrame() > 0 then @@ -291,7 +288,7 @@ function widget:Initialize() end function widget:Shutdown() - WG['autogroup'] = nil + WG["autogroup"] = nil end function widget:UnitFinished(unitID, unitDefID, unitTeam) @@ -334,7 +331,9 @@ function widget:GameFrame(n) end function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if unitTeam ~= myTeam then return end + if unitTeam ~= myTeam then + return + end createdFrame[unitID] = GetGameFrame() @@ -427,7 +426,7 @@ function widget:GetConfigData() end function widget:SetConfigData(data) - if data and type(data) == 'table' and data.version and (data.version + 0) > 2.1 and (data.version + 0) < 5 then -- still use v4 saves + if data and type(data) == "table" and data.version and (data.version + 0) > 2.1 and (data.version + 0) < 5 then -- still use v4 saves if data.immediate ~= nil then immediate = data.immediate verbose = data.verbose @@ -437,9 +436,9 @@ function widget:SetConfigData(data) persist = data.persist end local groupData = data.groups - if groupData and type(groupData) == 'table' then + if groupData and type(groupData) == "table" then for _, nam in ipairs(groupData) do - if type(nam) == 'table' then + if type(nam) == "table" then local gr = UnitDefNames[nam[1]] if gr ~= nil then unit2group[gr.id] = tonumber(nam[2]) @@ -449,7 +448,7 @@ function widget:SetConfigData(data) end presets[1] = unit2group end - if data and type(data) == 'table' and data.version and (data.version + 0) >= 5 then + if data and type(data) == "table" and data.version and (data.version + 0) >= 5 then if data.immediate ~= nil then immediate = data.immediate verbose = data.verbose @@ -459,10 +458,10 @@ function widget:SetConfigData(data) persist = data.persist end local groupData = data.presets - if groupData and type(groupData) == 'table' and groupData[1] and type(groupData[1]) == 'table' then + if groupData and type(groupData) == "table" and groupData[1] and type(groupData[1]) == "table" then for p, preset in pairs(groupData) do for _, group in ipairs(preset) do - if type(group) == 'table' then + if type(group) == "table" then local gr = UnitDefNames[group[1]] if gr then presets[p][gr.id] = tonumber(group[2]) diff --git a/luaui/Widgets/unit_auto_repair_idle_builders.lua b/luaui/Widgets/unit_auto_repair_idle_builders.lua index 1a66a3b1291..86a0296a29b 100644 --- a/luaui/Widgets/unit_auto_repair_idle_builders.lua +++ b/luaui/Widgets/unit_auto_repair_idle_builders.lua @@ -2,39 +2,39 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Auto Repair Idle Builders", - desc = "Idle mobile builders automatically repair nearby damaged allied units within a leash radius based on movement state", - author = "Flameink", - date = "2026-03-23", + name = "Auto Repair Idle Builders", + desc = "Idle mobile builders automatically repair nearby damaged allied units within a leash radius based on movement state", + author = "Flameink", + date = "2026-03-23", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end ---------------------------------------------------------------- -- Speedups ---------------------------------------------------------------- -local spGetMyTeamID = Spring.GetMyTeamID -local spGetTeamUnits = Spring.GetTeamUnits -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitHealth = Spring.GetUnitHealth -local spGetUnitStates = Spring.GetUnitStates -local spGetUnitCommandCount = Spring.GetUnitCommandCount +local spGetMyTeamID = Spring.GetMyTeamID +local spGetTeamUnits = Spring.GetTeamUnits +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitStates = Spring.GetUnitStates +local spGetUnitCommandCount = Spring.GetUnitCommandCount local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand -local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt -local spGetUnitIsDead = Spring.GetUnitIsDead -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spValidUnitID = Spring.ValidUnitID -local spGetGameFrame = Spring.GetGameFrame -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetUnitRulesParam = Spring.GetUnitRulesParam - -local CMD_REPAIR = CMD.REPAIR -local CMD_MOVE = CMD.MOVE -local CMD_RECLAIM = CMD.RECLAIM +local spGetUnitIsBeingBuilt = Spring.GetUnitIsBeingBuilt +local spGetUnitIsDead = Spring.GetUnitIsDead +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spValidUnitID = Spring.ValidUnitID +local spGetGameFrame = Spring.GetGameFrame +local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetUnitRulesParam = Spring.GetUnitRulesParam + +local CMD_REPAIR = CMD.REPAIR +local CMD_MOVE = CMD.MOVE +local CMD_RECLAIM = CMD.RECLAIM local CMD_MOVE_STATE = CMD.MOVE_STATE local CMD_WANT_CLOAK = GameCMD.WANT_CLOAK local ALLY_UNITS = Spring.ALLY_UNITS @@ -43,10 +43,10 @@ local ALLY_UNITS = Spring.ALLY_UNITS -- Constants ---------------------------------------------------------------- local LEASH_EXTRA = { - [-1] = 0, -- Structure - [0] = 0, -- hold position - [1] = 100, -- maneuver - [2] = 200, -- roam + [-1] = 0, -- Structure + [0] = 0, -- hold position + [1] = 100, -- maneuver + [2] = 200, -- roam } local DEFAULT_LEASH_EXTRA = 100 local POLL_INTERVAL = Game.gameSpeed @@ -128,7 +128,9 @@ end local function hasActiveReclaimers(targetID) for _, tid in pairs(activeReclaimers) do - if tid == targetID then return true end + if tid == targetID then + return true + end end return false @@ -165,7 +167,7 @@ function widget:Initialize() activeRepairs = table.ensureTable(WG, "InIdleWorkerTask") for _, unitID in ipairs(spGetTeamUnits(myTeam)) do - local unitDefID = spGetUnitDefID(unitID) + local unitDefID = spGetUnitDefID(unitID) if isMobileBuilder[unitDefID] and spGetUnitCommandCount(unitID) == 0 then local x, y, z = spGetUnitPosition(unitID) idleBuilders[unitID] = { homeX = x, homeY = y, homeZ = z } @@ -210,8 +212,8 @@ function widget:UnitIdle(unitID, unitDefID, unitTeam) end onReclaimerStopped(unitID) - if not isMobileBuilder[unitDefID] then - return + if not isMobileBuilder[unitDefID] then + return end local x, y, z = spGetUnitPosition(unitID) @@ -297,7 +299,7 @@ function widget:GameFrame(frame) -- Phase 2: Monitor active repairs for builderID, info in pairs(activeRepairs) do - local cloakState = spGetUnitRulesParam(builderID, 'wantcloak') + local cloakState = spGetUnitRulesParam(builderID, "wantcloak") local wantsCloak = (cloakState and cloakState == 1) if not isUnitAlive(builderID) then activeRepairs[builderID] = nil @@ -309,7 +311,7 @@ function widget:GameFrame(frame) -- Repair complete sendHome(builderID, info) else - local unitDefID = spGetUnitDefID(info.targetID) + local unitDefID = spGetUnitDefID(info.targetID) local unitDef = cachedUnitDefs[unitDefID] -- Check if target has left leash radius local tx, _, tz = spGetUnitPosition(info.targetID) @@ -331,7 +333,7 @@ function widget:GameFrame(frame) -- Phase 3: Assign idle builders to repair targets for builderID, homePos in pairs(idleBuilders) do - local cloakState = spGetUnitRulesParam(builderID, 'wantcloak') + local cloakState = spGetUnitRulesParam(builderID, "wantcloak") local wantsCloak = (cloakState and cloakState == 1) if activeRepairs[builderID] then -- Already assigned (shouldn't happen but guard against it) @@ -350,10 +352,7 @@ function widget:GameFrame(frame) local bestDistSq = math.huge for _, candidateID in ipairs(nearbyUnits) do - if candidateID ~= builderID - and not reclaimBlacklist[candidateID] - and not spGetUnitIsBeingBuilt(candidateID) - then + if candidateID ~= builderID and not reclaimBlacklist[candidateID] and not spGetUnitIsBeingBuilt(candidateID) then local health, maxHealth = spGetUnitHealth(candidateID) if health and maxHealth and health < maxHealth then local tx, _, tz = spGetUnitPosition(candidateID) diff --git a/luaui/Widgets/unit_autofirstbuildfacing.lua b/luaui/Widgets/unit_autofirstbuildfacing.lua index bf13272ec21..dc0d0db0e41 100644 --- a/luaui/Widgets/unit_autofirstbuildfacing.lua +++ b/luaui/Widgets/unit_autofirstbuildfacing.lua @@ -1,71 +1,68 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Auto First Build Facing", - desc = "Set buildfacing toward map center on the first building placed", - author = "zwzsg with lotsa help from #lua channel", - date = "October 26, 2008", - license = "Free", - layer = 0, - enabled = true - } + return { + name = "Auto First Build Facing", + desc = "Set buildfacing toward map center on the first building placed", + author = "zwzsg with lotsa help from #lua channel", + date = "October 26, 2008", + license = "Free", + layer = 0, + enabled = true, + } end - - -- Localized functions for performance local mathAbs = math.abs -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID -local facing=0 -local x=0 -local z=0 -local n=0 +local facing = 0 +local x = 0 +local z = 0 +local n = 0 -- Count all units and calculate their barycenter function widget:GameFrame(f) - if f==3 then - if Spring.GetTeamUnitCount(spGetMyTeamID()) and Spring.GetTeamUnitCount(spGetMyTeamID())>0 then - local units = Spring.GetTeamUnits(spGetMyTeamID()) - for i=1,#units do - local ux=0 - local uz=0 - ux,_,uz=Spring.GetUnitPosition(units[i]) - if ux and uz then - x=x+ux - z=z+uz - n=n+1 - end - end - end - x=x/n - z=z/n - widget.widgetHandler.RemoveCallIn(widget.widget,"GameFrame") - end + if f == 3 then + if Spring.GetTeamUnitCount(spGetMyTeamID()) and Spring.GetTeamUnitCount(spGetMyTeamID()) > 0 then + local units = Spring.GetTeamUnits(spGetMyTeamID()) + for i = 1, #units do + local ux = 0 + local uz = 0 + ux, _, uz = Spring.GetUnitPosition(units[i]) + if ux and uz then + x = x + ux + z = z + uz + n = n + 1 + end + end + end + x = x / n + z = z / n + widget.widgetHandler.RemoveCallIn(widget.widget, "GameFrame") + end end -- Set buildfacing the first time a building is about to be built function widget:Update() - local _,cmd=Spring.GetActiveCommand() - if cmd and cmd<0 then - if mathAbs(Game.mapSizeX - 2*x) > mathAbs(Game.mapSizeZ - 2*z) then - if (2*x>Game.mapSizeX) then - facing="west" - else - facing="east" - end - else - if (2*z>Game.mapSizeZ) then - facing="north" - else - facing="south" - end - end - Spring.SendCommands({"buildfacing "..facing}) - widget.widgetHandler.RemoveCallIn(widget.widget,"Update") - end + local _, cmd = Spring.GetActiveCommand() + if cmd and cmd < 0 then + if mathAbs(Game.mapSizeX - 2 * x) > mathAbs(Game.mapSizeZ - 2 * z) then + if 2 * x > Game.mapSizeX then + facing = "west" + else + facing = "east" + end + else + if 2 * z > Game.mapSizeZ then + facing = "north" + else + facing = "south" + end + end + Spring.SendCommands({ "buildfacing " .. facing }) + widget.widgetHandler.RemoveCallIn(widget.widget, "Update") + end end diff --git a/luaui/Widgets/unit_bombers_default_hold_fire.lua b/luaui/Widgets/unit_bombers_default_hold_fire.lua index 836ece5ac55..ae02a6541c6 100644 --- a/luaui/Widgets/unit_bombers_default_hold_fire.lua +++ b/luaui/Widgets/unit_bombers_default_hold_fire.lua @@ -2,12 +2,12 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "BombersDefaultHoldFire", - desc = "Sets produced bombers to Hold Fire after leaving an airlab.", - author = "Pexo", - date = "2026-02-27", + name = "BombersDefaultHoldFire", + desc = "Sets produced bombers to Hold Fire after leaving an airlab.", + author = "Pexo", + date = "2026-02-27", license = "GNU GPL, v2 or later", - layer = 0, + layer = 0, enabled = true, } end diff --git a/luaui/Widgets/unit_builder_priority.lua b/luaui/Widgets/unit_builder_priority.lua index 2e5f39e5bd9..f4c70870198 100644 --- a/luaui/Widgets/unit_builder_priority.lua +++ b/luaui/Widgets/unit_builder_priority.lua @@ -10,11 +10,10 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", layer = 0, version = 8, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID local spEcho = Spring.Echo diff --git a/luaui/Widgets/unit_clean_builder_queue.lua b/luaui/Widgets/unit_clean_builder_queue.lua index 5b5a8599da2..6e55f243c0b 100644 --- a/luaui/Widgets/unit_clean_builder_queue.lua +++ b/luaui/Widgets/unit_clean_builder_queue.lua @@ -1,50 +1,50 @@ function widget:GetInfo() return { - name = "Clean Builder Queue", - desc = "Removes completed buildings from all builders unit queue in case they werent there completing it (unless they have repeat enabled)", - author = "Floris", - date = "May 2025", + name = "Clean Builder Queue", + desc = "Removes completed buildings from all builders unit queue in case they werent there completing it (unless they have repeat enabled)", + author = "Floris", + date = "May 2025", license = "GNU GPL v2", - layer = 0, + layer = 0, enabled = true, } end -local GetUnitCommands = Spring.GetUnitCommands -local GetUnitCommandCount = Spring.GetUnitCommandCount -local GetUnitStates = Spring.GetUnitStates -local GiveOrderToUnit = Spring.GiveOrderToUnit -local GetUnitPosition = Spring.GetUnitPosition -local GetUnitDefID = Spring.GetUnitDefID -local GetTeamUnits = Spring.GetTeamUnits -local GetMyTeamID = Spring.GetMyTeamID -local GetSpectatingState = Spring.GetSpectatingState -local GetUnitsInCylinder = Spring.GetUnitsInCylinder -local select = select +local GetUnitCommands = Spring.GetUnitCommands +local GetUnitCommandCount = Spring.GetUnitCommandCount +local GetUnitStates = Spring.GetUnitStates +local GiveOrderToUnit = Spring.GiveOrderToUnit +local GetUnitPosition = Spring.GetUnitPosition +local GetUnitDefID = Spring.GetUnitDefID +local GetTeamUnits = Spring.GetTeamUnits +local GetMyTeamID = Spring.GetMyTeamID +local GetSpectatingState = Spring.GetSpectatingState +local GetUnitsInCylinder = Spring.GetUnitsInCylinder +local select = select -local CMD_REMOVE = CMD.REMOVE -local CMD_REPEAT = CMD.REPEAT +local CMD_REMOVE = CMD.REMOVE +local CMD_REPEAT = CMD.REPEAT -local REMOVE_TOLERANCE = 5 * 5 -- squared distance +local REMOVE_TOLERANCE = 5 * 5 -- squared distance -local trackedBuilders = {} -local isBuilding = {} -local builderDefs = {} -local myTeamID = GetMyTeamID() +local trackedBuilders = {} +local isBuilding = {} +local builderDefs = {} +local myTeamID = GetMyTeamID() -- Calculate maximum build distance from all builder units + margin -local maxBuildDistance = 0 +local maxBuildDistance = 0 for udid, ud in pairs(UnitDefs) do if ud.isBuilder and ud.buildDistance then maxBuildDistance = math.max(maxBuildDistance, ud.buildDistance) end end -local SEARCH_RADIUS = maxBuildDistance + 200 -- Max build distance + safety margin +local SEARCH_RADIUS = maxBuildDistance + 200 -- Max build distance + safety margin -- Cache repeat status to avoid repeated lookups -local repeatStatus = {} +local repeatStatus = {} -- Reusable table for nearby builders to reduce allocations -local nearbyBuilders = {} +local nearbyBuilders = {} local function IsUnitRepeatOn(unitID) if repeatStatus[unitID] ~= nil then @@ -120,11 +120,15 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end local x, _, z = GetUnitPosition(unitID) - if not x then return end + if not x then + return + end -- Use spatial query to only check nearby units (team-filtered to reduce table size) local nearbyUnits = GetUnitsInCylinder(x, z, SEARCH_RADIUS, myTeamID) - if not nearbyUnits or #nearbyUnits == 0 then return end + if not nearbyUnits or #nearbyUnits == 0 then + return + end -- Clear and reuse nearbyBuilders table to reduce allocations local builderCount = 0 @@ -136,7 +140,9 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end end - if builderCount == 0 then return end + if builderCount == 0 then + return + end local targetCmdID = -unitDefID @@ -145,9 +151,9 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) -- For subsequent builders with the same queue, we can either: -- - Skip entirely if no match was found (saves full GetUnitCommands + scan) -- - Fetch only up to the known match index to get the per-unit tag - local sharedCmdCount -- command count of the first-scanned builder - local sharedMatchIndex -- index of the matching command (nil = no match found) - local sharedFirstCmdId -- first command id of the shared queue (for identity check) + local sharedCmdCount -- command count of the first-scanned builder + local sharedMatchIndex -- index of the matching command (nil = no match found) + local sharedFirstCmdId -- first command id of the shared queue (for identity check) for i = 1, builderCount do local builderID = nearbyBuilders[i] @@ -174,9 +180,7 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) -- would drop the wrong queued build from this builder. if cmd.id == targetCmdID then local params = cmd.params - if params and params[1] and params[3] - and coordsMatch(x, z, params[1], params[3], REMOVE_TOLERANCE) - then + if params and params[1] and params[3] and coordsMatch(x, z, params[1], params[3], REMOVE_TOLERANCE) then GiveOrderToUnit(builderID, CMD_REMOVE, { cmd.tag }, {}) else -- Probe matched first cmd by id only; queue is diff --git a/luaui/Widgets/unit_cloak_firestate.lua b/luaui/Widgets/unit_cloak_firestate.lua index c77d12301ad..ba1dc7ae916 100644 --- a/luaui/Widgets/unit_cloak_firestate.lua +++ b/luaui/Widgets/unit_cloak_firestate.lua @@ -5,17 +5,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Cloak Fire State", - desc = "Sets units to Hold Fire when cloaked, reverts to original state when decloaked", - author = "KingRaptor (L.J. Lim)", - date = "Feb 14, 2010", - license = "GNU GPL, v2 or later", - layer = -1, - enabled = true + name = "Cloak Fire State", + desc = "Sets units to Hold Fire when cloaked, reverts to original state when decloaked", + author = "KingRaptor (L.J. Lim)", + date = "Feb 14, 2010", + license = "GNU GPL, v2 or later", + layer = -1, + enabled = true, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID @@ -23,9 +22,9 @@ local spGetMyTeamID = Spring.GetMyTeamID -------------------------------------------------------------------------------- -- Speedups -local GiveOrderToUnit = Spring.GiveOrderToUnit -local GetUnitStates = Spring.GetUnitStates -local CMD_WANT_CLOAK = GameCMD.WANT_CLOAK +local GiveOrderToUnit = Spring.GiveOrderToUnit +local GetUnitStates = Spring.GetUnitStates +local CMD_WANT_CLOAK = GameCMD.WANT_CLOAK local FIRESTATE_HOLDFIRE = CMD.FIRESTATE_HOLDFIRE -------------------------------------------------------------------------------- @@ -42,10 +41,14 @@ end local decloakFireState = {} --stores the desired fire state when decloaked of each unitID function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) - if teamID ~= myTeam then return end + if teamID ~= myTeam then + return + end if cmdID == CMD_WANT_CLOAK and cmdParams[1] ~= nil then -- is cloak command - if not cloakFireState[unitDefID] then return end + if not cloakFireState[unitDefID] then + return + end if cmdParams[1] == 1 then -- store current fire state and cloak decloakFireState[unitID] = select(1, GetUnitStates(unitID, false)) --store last state @@ -65,7 +68,7 @@ end function widget:UnitCreated(unitID, unitDefID, unitTeam) if unitTeam == myTeam then - decloakFireState[unitID] = select(1, GetUnitStates(unitID, false)) -- 1=firestate + decloakFireState[unitID] = select(1, GetUnitStates(unitID, false)) -- 1=firestate else decloakFireState[unitID] = nil end diff --git a/luaui/Widgets/unit_debug_alt_set_target_type.lua b/luaui/Widgets/unit_debug_alt_set_target_type.lua index b1e0c3a35ad..d19dfe40ba5 100644 --- a/luaui/Widgets/unit_debug_alt_set_target_type.lua +++ b/luaui/Widgets/unit_debug_alt_set_target_type.lua @@ -2,28 +2,27 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Set unit type target debug", - desc = "Hold down Alt and set target on an enemy unit to make selected units set target on all future enemies of that type. Debug version", - author = "Flameink", - date = "August 1, 2025", + name = "Set unit type target debug", + desc = "Hold down Alt and set target on an enemy unit to make selected units set target on all future enemies of that type. Debug version", + author = "Flameink", + date = "August 1, 2025", version = "1.0", license = "GNU GPL, v2 or later", - layer = 0, - enabled = false + layer = 0, + enabled = false, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitsInCylinder = Spring.GetUnitsInCylinder -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetUnitTeam = Spring.GetUnitTeam local spGiveOrderArrayToUnit = Spring.GiveOrderArrayToUnit -local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetSelectedUnits = Spring.GetSelectedUnits local trackedUnitsToUnitDefID = {} local unitRanges = {} @@ -38,9 +37,9 @@ local UNIT_RANGE_MULTIPLIER = 1.5 local shouldLog = true local function printf(arg) - if shouldLog then - Spring.Echo(arg) - end + if shouldLog then + Spring.Echo(arg) + end end local gameStarted @@ -63,74 +62,77 @@ for udid, ud in pairs(UnitDefs) do end local function GetUnitsInAttackRangeWithDef(unitID, unitDefIDToTarget) - local unitsInRange = {} + local unitsInRange = {} - local ux, uy, uz = spGetUnitPosition(unitID) - if not ux then return unitsInRange end + local ux, uy, uz = spGetUnitPosition(unitID) + if not ux then + return unitsInRange + end - local maxRange = unitRanges[spGetUnitDefID(unitID)] - if maxRange == nil or maxRange <= 0 then return unitsInRange end + local maxRange = unitRanges[spGetUnitDefID(unitID)] + if maxRange == nil or maxRange <= 0 then + return unitsInRange + end maxRange = maxRange * UNIT_RANGE_MULTIPLIER - local candidateUnits = spGetUnitsInCylinder(ux, uz, maxRange) + local candidateUnits = spGetUnitsInCylinder(ux, uz, maxRange) for _, targetID in ipairs(candidateUnits) do - if targetID ~= unitID then - local isAllied = spAreTeamsAllied(myAllyTeam, spGetUnitTeam(targetID)) + if targetID ~= unitID then + local isAllied = spAreTeamsAllied(myAllyTeam, spGetUnitTeam(targetID)) if not isAllied and spGetUnitDefID(targetID) == unitDefIDToTarget then table.insert(unitsInRange, targetID) - end - end - end - printf("CAT7: Units in attack range: " .. unitsInRange) + end + end + end + printf("CAT7: Units in attack range: " .. unitsInRange) - return unitsInRange + return unitsInRange end function widget:GameFrame(frame) - if frame % POLLING_RATE ~= 0 then return end - printf("CAT1: Hitting update") + printf("CAT1: Hitting update") for unitID, targetUnitDefID in pairs(trackedUnitsToUnitDefID) do local candidateUnits = GetUnitsInAttackRangeWithDef(unitID, targetUnitDefID) local commandsToGive = {} for _, targetID in ipairs(candidateUnits) do local newCmdOpts = {} - if #commandsToGive ~= 0 then + if #commandsToGive ~= 0 then newCmdOpts = { "shift" } end - commandsToGive[#commandsToGive+1] = { CMD_SET_TARGET, { targetID }, newCmdOpts } + commandsToGive[#commandsToGive + 1] = { CMD_SET_TARGET, { targetID }, newCmdOpts } end - printf("CAT1: Giving unit " .. unitID .. " setTargets: " .. commandsToGive) + printf("CAT1: Giving unit " .. unitID .. " setTargets: " .. commandsToGive) spGiveOrderArrayToUnit(unitID, commandsToGive) end end local function cleanupUnitTargeting(unitID) - printf("CAT2: Cleaning up " .. unitID) + printf("CAT2: Cleaning up " .. unitID) trackedUnitsToUnitDefID[unitID] = nil end function widget:CommandNotify(cmdID, cmdParams, cmdOpts) - printf("CAT3: Hitting CommandNotify. cmdID: " .. cmdID .. " params: " .. cmdParams) + printf("CAT3: Hitting CommandNotify. cmdID: " .. cmdID .. " params: " .. cmdParams) local shouldCleanupTargeting = false local selectedUnits = spGetSelectedUnits() if cmdID == CMD_UNIT_CANCEL_TARGET or cmdID == CMD_STOP then - printf("CAT4: Hitting CancelTarget or Stop command") + printf("CAT4: Hitting CancelTarget or Stop command") shouldCleanupTargeting = true end if cmdID == CMD_SET_TARGET and not cmdOpts.alt then - printf("CAT4: Hitting non-alt set target") + printf("CAT4: Hitting non-alt set target") shouldCleanupTargeting = true end if cmdID == CMD_SET_TARGET and #cmdParams ~= 1 then - printf("CAT4: Hitting set target with >1 args") + printf("CAT4: Hitting set target with >1 args") shouldCleanupTargeting = true end @@ -141,7 +143,7 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) end if cmdID ~= CMD_SET_TARGET or not cmdOpts.alt or #cmdParams ~= 1 then - printf("CAT4: Bad args, not proceeding with alt set target") + printf("CAT4: Bad args, not proceeding with alt set target") return end @@ -150,39 +152,38 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) for _, unitID in ipairs(selectedUnits) do cleanupUnitTargeting(unitID) - printf("CAT5: Tracking " .. unitID) - trackedUnitsToUnitDefID[unitID] = targetUnitDefID + printf("CAT5: Tracking " .. unitID) + trackedUnitsToUnitDefID[unitID] = targetUnitDefID end end function maybeRemoveSelf() if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - printf("CAT6: removing self for some reason") + printf("CAT6: removing self for some reason") widgetHandler:RemoveWidget() end end function widget:GameStart() gameStarted = true - printf("CAT6: Game starting") + printf("CAT6: Game starting") maybeRemoveSelf() end function widget:PlayerChanged(playerID) - printf("CAT6: Player changed") + printf("CAT6: Player changed") maybeRemoveSelf() end function widget:Initialize() - printf("CAT6: Init widget") + printf("CAT6: Init widget") if Spring.IsReplay() or spGetGameFrame() > 0 then maybeRemoveSelf() end end function widget:TextCommand(command) - if string.find(command, "astt_toggleLog", nil, true) == 1 then - shouldLog = not shouldLog - end - -end \ No newline at end of file + if string.find(command, "astt_toggleLog", nil, true) == 1 then + shouldLog = not shouldLog + end +end diff --git a/luaui/Widgets/unit_default_spy_move_cloaked.lua b/luaui/Widgets/unit_default_spy_move_cloaked.lua index 928f4895915..0f63e945a10 100644 --- a/luaui/Widgets/unit_default_spy_move_cloaked.lua +++ b/luaui/Widgets/unit_default_spy_move_cloaked.lua @@ -2,13 +2,13 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Cloaked Buildpower Default Move", - desc = "Prevents accidental reclaim, load, and attack commands on cloaked units\nMakes move the default command for commanders, decoys, and spies when cloaked", - author = "Catcow, BrainDamage", - date = "11/14/25", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, + name = "Cloaked Buildpower Default Move", + desc = "Prevents accidental reclaim, load, and attack commands on cloaked units\nMakes move the default command for commanders, decoys, and spies when cloaked", + author = "Catcow, BrainDamage", + date = "11/14/25", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end @@ -60,7 +60,9 @@ local function update() cloakedBuilderMovableSelected = false -- above a little amount we likely aren't micro-ing cloaked things anymore... - if selectedUnitsCount == 0 or selectedUnitsCount > 20 then return end + if selectedUnitsCount == 0 or selectedUnitsCount > 20 then + return + end local selectedUnitTypes = spGetSelectedUnitsSorted() for unitDefID, units in pairs(selectedUnitTypes) do @@ -81,7 +83,7 @@ function widget:SelectionChanged(sel) end function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts, cmdTag, playerID, fromSynced, fromLua) - if (cmdID == CMD_WANT_CLOAK) and (idCanBuildCloakMove[unitDefID]) and (teamID == spGetMyTeamID()) then + if (cmdID == CMD_WANT_CLOAK) and idCanBuildCloakMove[unitDefID] and (teamID == spGetMyTeamID()) then update() end end diff --git a/luaui/Widgets/unit_dgun_stall_assist.lua b/luaui/Widgets/unit_dgun_stall_assist.lua index b9fc71976d7..9a1e8e774ac 100644 --- a/luaui/Widgets/unit_dgun_stall_assist.lua +++ b/luaui/Widgets/unit_dgun_stall_assist.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "DGun Stall Assist", - desc = "Waits cons/facs when trying to dgun and stalling", - author = "Niobium", - date = "2 April 2010", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "DGun Stall Assist", + desc = "Waits cons/facs when trying to dgun and stalling", + author = "Niobium", + date = "2 April 2010", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -53,24 +52,24 @@ local CMD_RECLAIM = CMD.RECLAIM ---------------------------------------------------------------- function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end for uDefID, uDef in pairs(UnitDefs) do if uDef.buildSpeed > 0 and not uDef.canManualFire and (uDef.canAssist or uDef.buildOptions[1]) then @@ -83,7 +82,6 @@ function widget:Initialize() end function widget:Update(dt) - local _, activeCmdID = spGetActiveCommand() if activeCmdID == CMD_DGUN then local selection = Spring.GetSelectedUnitsCounts() @@ -110,7 +108,6 @@ function widget:Update(dt) watchTime = watchTime - dt if waitedUnits and watchTime < 0 then - local toUnwait = {} for i = 1, #waitedUnits do local uID = waitedUnits[i] @@ -134,11 +131,9 @@ function widget:Update(dt) end if watchTime > 0 and not waitedUnits then - local myTeamID = spGetMyTeamID() local currentEnergy, energyStorage = spGetTeamResources(myTeamID, "energy") if currentEnergy < targetEnergy and energyStorage >= targetEnergy then - waitedUnits = {} local myUnits = spGetTeamUnits(myTeamID) for i = 1, #myUnits do diff --git a/luaui/Widgets/unit_factory_assist_fix.lua b/luaui/Widgets/unit_factory_assist_fix.lua index 385dc196551..57d21ccc1fc 100644 --- a/luaui/Widgets/unit_factory_assist_fix.lua +++ b/luaui/Widgets/unit_factory_assist_fix.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Factory Assist Fix", - desc = "Fixes factory assist so that builders don't leave to repair damaged finished units", - author = "TheDujin", - date = "Jun 30 2025", + name = "Factory Assist Fix", + desc = "Fixes factory assist so that builders don't leave to repair damaged finished units", + author = "TheDujin", + date = "Jun 30 2025", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID local spGetTeamUnits = Spring.GetTeamUnits @@ -63,11 +62,11 @@ local function maybeRemoveRepairCmd(builderUnitID, builtUnitID, factID) end function widget:UnitFromFactory(unitID, _, unitTeam, factID) - if (not spAreTeamsAllied(myTeam, unitTeam)) then + if not spAreTeamsAllied(myTeam, unitTeam) then return -- no in-game reason to ever be assisting enemy factory end local unitHealth, unitMaxHealth = spGetUnitHealth(unitID) - if (unitHealth >= unitMaxHealth) then + if unitHealth >= unitMaxHealth then return -- if unit comes out with full health, guard works just fine end for myBuilderID in pairs(myAssistBuilders) do diff --git a/luaui/Widgets/unit_factory_quota.lua b/luaui/Widgets/unit_factory_quota.lua index a661db9f057..14c5b341a88 100644 --- a/luaui/Widgets/unit_factory_quota.lua +++ b/luaui/Widgets/unit_factory_quota.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Factory Quotas", - desc = "Creates quotas of units that should be maintained(for example 5 Sheldons, 5 Sumos), that will be queued before factory queue.", - author = "hihoman23", - date = "2024", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } + return { + name = "Factory Quotas", + desc = "Creates quotas of units that should be maintained(for example 5 Sheldons, 5 Sumos), that will be queued before factory queue.", + author = "hihoman23", + date = "2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID @@ -31,14 +29,14 @@ local factoryDefIDs = {} local metalcosts = {} for unitDefID, uDef in pairs(UnitDefs) do - metalcosts[unitDefID] = uDef.metalCost - if uDef.isFactory then - factoryDefIDs[unitDefID] = true - for _, opt in pairs(uDef.buildOptions) do - possibleFactories[opt] = possibleFactories[opt] or {} - possibleFactories[opt][unitDefID] = true - end - end + metalcosts[unitDefID] = uDef.metalCost + if uDef.isFactory then + factoryDefIDs[unitDefID] = true + for _, opt in pairs(uDef.buildOptions) do + possibleFactories[opt] = possibleFactories[opt] or {} + possibleFactories[opt][unitDefID] = true + end + end end ----- Speed ups ------ @@ -58,144 +56,143 @@ local CMD_QUOTA_BUILD_TOGGLE = GameCMD.QUOTA_BUILD_TOGGLE --------- quota logic ------------- local function getNumberOfUnits(factoryID, unitDefID) - local numberOfUnits - if builtUnits[factoryID] and builtUnits[factoryID][unitDefID] then - numberOfUnits = table.count(builtUnits[factoryID][unitDefID]) - else - numberOfUnits = 0 - end - return numberOfUnits + local numberOfUnits + if builtUnits[factoryID] and builtUnits[factoryID][unitDefID] then + numberOfUnits = table.count(builtUnits[factoryID][unitDefID]) + else + numberOfUnits = 0 + end + return numberOfUnits end local function getMostNeedQuota(quota, factoryID) - local minimumQuota - local minimumUnitDefID - local minimumRatio - for unitDefID, quotaNumber in pairs(quota) do - if not minimumQuota then - minimumQuota = quotaNumber - minimumUnitDefID = unitDefID - minimumRatio = getNumberOfUnits(factoryID, unitDefID)/quotaNumber - - else - local currentRatio = getNumberOfUnits(factoryID, unitDefID)/quotaNumber - if currentRatio < minimumRatio then - minimumQuota = quotaNumber - minimumUnitDefID = unitDefID - minimumRatio = currentRatio - end - end - end - return minimumQuota, minimumUnitDefID + local minimumQuota + local minimumUnitDefID + local minimumRatio + for unitDefID, quotaNumber in pairs(quota) do + if not minimumQuota then + minimumQuota = quotaNumber + minimumUnitDefID = unitDefID + minimumRatio = getNumberOfUnits(factoryID, unitDefID) / quotaNumber + else + local currentRatio = getNumberOfUnits(factoryID, unitDefID) / quotaNumber + if currentRatio < minimumRatio then + minimumQuota = quotaNumber + minimumUnitDefID = unitDefID + minimumRatio = currentRatio + end + end + end + return minimumQuota, minimumUnitDefID end local function isFactoryUsable(factoryID) - local commandQueue = spGetFactoryCommands(factoryID, 2) - if not commandQueue then - return true - end - return commandQueue and( #commandQueue == 0 or not (commandQueue[1].options.alt or (commandQueue[2] and (commandQueue[2].options.alt or (commandQueue[2].id == CMD.WAIT))) or (commandQueue[1].id == CMD.WAIT))) + local commandQueue = spGetFactoryCommands(factoryID, 2) + if not commandQueue then + return true + end + return commandQueue and (#commandQueue == 0 or not (commandQueue[1].options.alt or (commandQueue[2] and (commandQueue[2].options.alt or (commandQueue[2].id == CMD.WAIT))) or (commandQueue[1].id == CMD.WAIT))) end local function appendToFactoryQueue(factoryID, unitDefID) - local currentCmdID, targetID = Spring.GetUnitWorkerTask(factoryID) - local insertPosition = 1 - if targetID then - local _, _, _, _, buildProgress = Spring.GetUnitHealth(targetID) - if buildProgress < maxBuildProg and metalcosts[-currentCmdID] and (buildProgress * metalcosts[-currentCmdID]) < maxMetal then -- 7.5 % is the most that it is willing to cancel, and maximally 500 metal - insertPosition = 0 - end - else - insertPosition = 0 -- put in front of factory queue - end - spGiveOrderToUnit(factoryID, CMD_INSERT, {insertPosition, -unitDefID, CMD_OPT_ALT + CMD_OPT_INTERNAL}, CMD_OPT_ALT + CMD_OPT_CTRL) + local currentCmdID, targetID = Spring.GetUnitWorkerTask(factoryID) + local insertPosition = 1 + if targetID then + local _, _, _, _, buildProgress = Spring.GetUnitHealth(targetID) + if buildProgress < maxBuildProg and metalcosts[-currentCmdID] and (buildProgress * metalcosts[-currentCmdID]) < maxMetal then -- 7.5 % is the most that it is willing to cancel, and maximally 500 metal + insertPosition = 0 + end + else + insertPosition = 0 -- put in front of factory queue + end + spGiveOrderToUnit(factoryID, CMD_INSERT, { insertPosition, -unitDefID, CMD_OPT_ALT + CMD_OPT_INTERNAL }, CMD_OPT_ALT + CMD_OPT_CTRL) end local function fillQuotas() - for factoryID, quota in pairs(quotas) do - if isFactoryUsable(factoryID) then - for unitDefID, num in pairs(quota) do - if num == 0 then - quota[unitDefID] = nil - end - end - if table.count(quota)>0 then - local quotaNum, unitDefID = getMostNeedQuota(quota, factoryID) - if quotaNum > getNumberOfUnits(factoryID, unitDefID) then - appendToFactoryQueue(factoryID, unitDefID) - end - end - end - end + for factoryID, quota in pairs(quotas) do + if isFactoryUsable(factoryID) then + for unitDefID, num in pairs(quota) do + if num == 0 then + quota[unitDefID] = nil + end + end + if table.count(quota) > 0 then + local quotaNum, unitDefID = getMostNeedQuota(quota, factoryID) + if quotaNum > getNumberOfUnits(factoryID, unitDefID) then + appendToFactoryQueue(factoryID, unitDefID) + end + end + end + end end function widget:GameFrame(n) - if n % 15 == 0 then -- improve perfomance - fillQuotas() - end + if n % 15 == 0 then -- improve perfomance + fillQuotas() + end end ----- handle toggle local function isOnQuotaBuildMode(unitID) - local cmdDescIndex = spFindUnitCmdDesc(unitID, CMD_QUOTA_BUILD_TOGGLE) - return cmdDescIndex and spGetUnitCmdDescs(unitID)[cmdDescIndex].params[1]+0 == 1 + local cmdDescIndex = spFindUnitCmdDesc(unitID, CMD_QUOTA_BUILD_TOGGLE) + return cmdDescIndex and spGetUnitCmdDescs(unitID)[cmdDescIndex].params[1] + 0 == 1 end ----- handle unit tracking function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) - if builderID and unitTeam == myTeam and factoryDefIDs[spGetUnitDefID(builderID)] then - builtUnits[builderID] = builtUnits[builderID] or {} - builtUnits[builderID][unitDefID] = builtUnits[builderID][unitDefID] or {} - builtUnits[builderID][unitDefID][unitID] = true - unitToFactoryID[unitID] = builderID - end + if builderID and unitTeam == myTeam and factoryDefIDs[spGetUnitDefID(builderID)] then + builtUnits[builderID] = builtUnits[builderID] or {} + builtUnits[builderID][unitDefID] = builtUnits[builderID][unitDefID] or {} + builtUnits[builderID][unitDefID][unitID] = true + unitToFactoryID[unitID] = builderID + end end local function removeUnit(unitID, unitDefID, unitTeam) - if unitTeam == myTeam then --check if it was built by the same player - local factoryID = unitToFactoryID[unitID] - if factoryID and builtUnits[factoryID] and builtUnits[factoryID][unitDefID] then - builtUnits[factoryID][unitDefID][unitID] = nil - unitToFactoryID[unitID] = nil - elseif builtUnits[unitID] then - builtUnits[unitID] = nil - quotas[unitID] = nil - end - end + if unitTeam == myTeam then --check if it was built by the same player + local factoryID = unitToFactoryID[unitID] + if factoryID and builtUnits[factoryID] and builtUnits[factoryID][unitDefID] then + builtUnits[factoryID][unitDefID][unitID] = nil + unitToFactoryID[unitID] = nil + elseif builtUnits[unitID] then + builtUnits[unitID] = nil + quotas[unitID] = nil + end + end end function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) - removeUnit(unitID, unitDefID, unitTeam) + removeUnit(unitID, unitDefID, unitTeam) end function widget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) - if myTeam == oldTeam and myTeam ~= newTeam then - removeUnit(unitID, unitDefID, myTeam) - end + if myTeam == oldTeam and myTeam ~= newTeam then + removeUnit(unitID, unitDefID, myTeam) + end end function widget:PlayerChanged(playerID) - if Spring.GetSpectatingState() then - widgetHandler:RemoveWidget() - end - myTeam = spGetMyTeamID() + if Spring.GetSpectatingState() then + widgetHandler:RemoveWidget() + end + myTeam = spGetMyTeamID() end function widget:Initialize() - widget:PlayerChanged() + widget:PlayerChanged() - WG.Quotas = {} - WG.Quotas.getQuotas = function() - return quotas - end - WG.Quotas.getUnitAmount = function(factoryID, unitDefID) - return getNumberOfUnits(factoryID, unitDefID) - end - WG.Quotas.isOnQuotaMode = function(unitID) - return isOnQuotaBuildMode(unitID) - end + WG.Quotas = {} + WG.Quotas.getQuotas = function() + return quotas + end + WG.Quotas.getUnitAmount = function(factoryID, unitDefID) + return getNumberOfUnits(factoryID, unitDefID) + end + WG.Quotas.isOnQuotaMode = function(unitID) + return isOnQuotaBuildMode(unitID) + end end function widget:Shutdown() - WG.Quotas = nil + WG.Quotas = nil end diff --git a/luaui/Widgets/unit_ghostradar_gl4.lua b/luaui/Widgets/unit_ghostradar_gl4.lua index 70dd3e1d0a5..5176bf7343b 100644 --- a/luaui/Widgets/unit_ghostradar_gl4.lua +++ b/luaui/Widgets/unit_ghostradar_gl4.lua @@ -2,22 +2,21 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Ghost Radar GL4", - desc = "Allows ghosted unit shape below radar blips", - author = "very_bad_soldier, Floris (GL4)", - date = "July 21, 2008", - license = "GNU GPL v2", - layer = 0, - enabled = true + name = "Ghost Radar GL4", + desc = "Allows ghosted unit shape below radar blips", + author = "very_bad_soldier, Floris (GL4)", + date = "July 21, 2008", + license = "GNU GPL v2", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState local shapeOpacity = 0.5 -local addHeight = 8 -- compensate for unit wobbling underground +local addHeight = 8 -- compensate for unit wobbling underground local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitPosition = Spring.GetUnitPosition @@ -25,11 +24,11 @@ local spIsUnitInView = Spring.IsUnitInView local unitshapes = {} local dots = {} -local spec,specFullView = spGetSpectatingState() +local spec, specFullView = spGetSpectatingState() local gaiaTeamID = Spring.GetGaiaTeamID() local includedUnitDefIDs = {} -for unitDefID,unitDef in ipairs(UnitDefs) do +for unitDefID, unitDef in ipairs(UnitDefs) do if unitDef.isBuilding == false and unitDef.isFactory == false then if unitDef.model and unitDef.model.textures and unitDef.model.textures.tex1:lower() == "arm_color.dds" then includedUnitDefIDs[unitDefID] = true @@ -50,12 +49,12 @@ local function addUnitShape(unitID, unitDefID, px, py, pz, rotationY, teamID) if unitshapes[unitID] then removeUnitShape(unitID) end - unitshapes[unitID] = WG.DrawUnitShapeGL4(unitDefID, px, py+addHeight, pz, rotationY, shapeOpacity, teamID, nil, nil) + unitshapes[unitID] = WG.DrawUnitShapeGL4(unitDefID, px, py + addHeight, pz, rotationY, shapeOpacity, teamID, nil, nil) return unitshapes[unitID] end function widget:PlayerChanged() - spec,specFullView = spGetSpectatingState() + spec, specFullView = spGetSpectatingState() if specFullView then for unitID, _ in pairs(unitshapes) do removeUnitShape(unitID) @@ -65,13 +64,13 @@ end function widget:UnitEnteredRadar(unitID, unitTeam) if dots[unitID] then - dots[unitID][3] = true -- radar + dots[unitID][3] = true -- radar end end function widget:UnitLeftRadar(unitID, unitTeam) if dots[unitID] then - dots[unitID][3] = false -- radar + dots[unitID][3] = false -- radar --if not dots[unitID][4] then -- not in LOS - forget unit type -- dots[unitID][1] = nil -- unitDefID --end @@ -81,12 +80,12 @@ end function widget:UnitEnteredLos(unitID, unitTeam) local unitDefID = spGetUnitDefID(unitID) - if unitDefID and includedUnitDefIDs[unitDefID] and unitTeam ~= gaiaTeamID then -- update unitID info, ID could have been reused already! + if unitDefID and includedUnitDefIDs[unitDefID] and unitTeam ~= gaiaTeamID then -- update unitID info, ID could have been reused already! dots[unitID] = { [1] = spGetUnitDefID(unitID), [2] = unitTeam, - [3] = true, -- radar - [4] = true, -- los + [3] = true, -- radar + [4] = true, -- los } else dots[unitID] = nil @@ -109,7 +108,7 @@ end function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) if dots[unitID] then - dots[unitID] = nil -- kill the dot info if this unitID gets reused + dots[unitID] = nil -- kill the dot info if this unitID gets reused end end @@ -147,16 +146,16 @@ function widget:Update(dt) widgetHandler:RemoveWidget() end if spec then - _,specFullView,_ = spGetSpectatingState() + _, specFullView, _ = spGetSpectatingState() end if not specFullView then for unitID, shape in pairs(unitshapes) do local x, y, z = spGetUnitPosition(unitID) if not x then dots[unitID] = nil - removeUnitShape(unitID) -- needs to be done cause we dont know if unit has died + removeUnitShape(unitID) -- needs to be done cause we dont know if unit has died elseif spIsUnitInView(unitID) then - addUnitShape(unitID, dots[unitID][1], x, y, z, 0, dots[unitID][2]) -- update because unit position does change + addUnitShape(unitID, dots[unitID][1], x, y, z, 0, dots[unitID][2]) -- update because unit position does change end end else diff --git a/luaui/Widgets/unit_ghostsite_gl4.lua b/luaui/Widgets/unit_ghostsite_gl4.lua index e0a97a24146..f6d998e5216 100644 --- a/luaui/Widgets/unit_ghostsite_gl4.lua +++ b/luaui/Widgets/unit_ghostsite_gl4.lua @@ -2,17 +2,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Ghost Site GL4", - desc = "Displays ghosted buildings for buildings in progress", -- engine nowadays already draws it, but we can add a highlight effect to distinct it! - author = "very_bad_soldier, Bluestone, Floris (GL4)", - date = "April 7, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Ghost Site GL4", + desc = "Displays ghosted buildings for buildings in progress", -- engine nowadays already draws it, but we can add a highlight effect to distinct it! + author = "very_bad_soldier, Bluestone, Floris (GL4)", + date = "April 7, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetSpectatingState = Spring.GetSpectatingState @@ -32,7 +31,7 @@ local math_rad = math.rad local sec = 0 local ghostSites = {} local unitshapes = {} -local _,fullview = spGetSpectatingState() +local _, fullview = spGetSpectatingState() local includedUnitDefIDs = {} for unitDefID, unitDef in pairs(UnitDefs) do @@ -56,7 +55,7 @@ local function addUnitShape(unitID, unitDefID, px, py, pz, rotationY, teamID) if unitshapes[unitID] then removeUnitShape(unitID) end - unitshapes[unitID] = WG.DrawUnitShapeGL4(unitDefID, px, py+0.1, pz, math_rad(rotationY), shapeOpacity, teamID, nil, highlightAmount) + unitshapes[unitID] = WG.DrawUnitShapeGL4(unitDefID, px, py + 0.1, pz, math_rad(rotationY), shapeOpacity, teamID, nil, highlightAmount) return unitshapes[unitID] end @@ -67,12 +66,12 @@ function widget:UnitEnteredLos(unitID, teamID) if fullview or spIsUnitAllied(unitID) then return end - local unitDefID = spGetUnitDefID(unitID) + local unitDefID = spGetUnitDefID(unitID) if includedUnitDefIDs[unitDefID] and Spring.GetUnitIsBeingBuilt(unitID) then local x, y, z = spGetUnitBasePosition(unitID) - local dx,_,dz = spGetUnitDirection(unitID) - local angle = math_deg(math_atan2(dx,dz)) - ghostSites[unitID] = { unitDefID=unitDefID, x=x, y=y, z=z, teamID=teamID, angle=angle } + local dx, _, dz = spGetUnitDirection(unitID) + local angle = math_deg(math_atan2(dx, dz)) + ghostSites[unitID] = { unitDefID = unitDefID, x = x, y = y, z = z, teamID = teamID, angle = angle } end end @@ -87,7 +86,7 @@ end local function updateGhostSites() for unitID, site in pairs(ghostSites) do if not unitshapes[unitID] then - local _,inLos,_ = spGetPositionLosState(site.x, site.y, site.z) + local _, inLos, _ = spGetPositionLosState(site.x, site.y, site.z) if inLos and not Spring.GetUnitIsBeingBuilt(unitID) then removeUnitShape(unitID) ghostSites[unitID] = nil @@ -97,7 +96,9 @@ local function updateGhostSites() end function widget:Update(dt) - if fullview then return end + if fullview then + return + end if not WG.DrawUnitShapeGL4 then widgetHandler:RemoveWidget() end @@ -109,7 +110,7 @@ function widget:Update(dt) end function widget:PlayerChanged() - _,fullview = spGetSpectatingState() + _, fullview = spGetSpectatingState() if fullview then for unitID, _ in pairs(unitshapes) do removeUnitShape(unitID) @@ -152,7 +153,7 @@ function widget:Initialize() widgetHandler:RemoveWidget() end for unitID, site in pairs(ghostSites) do - local _,inLos,_ = spGetPositionLosState(site.x, site.y, site.z) + local _, inLos, _ = spGetPositionLosState(site.x, site.y, site.z) if not inLos then addUnitShape(unitID, site.unitDefID, site.x, site.y, site.z, site.angle, site.teamID) end diff --git a/luaui/Widgets/unit_hold_position.lua b/luaui/Widgets/unit_hold_position.lua index 55de4e9505b..4a0edf4dd3c 100644 --- a/luaui/Widgets/unit_hold_position.lua +++ b/luaui/Widgets/unit_hold_position.lua @@ -1,19 +1,17 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Everything hold position", - desc = "Sets every unit built or received to hold position (except air)", - author = "Hobo Joe", - date = "April 2024", + name = "Everything hold position", + desc = "Sets every unit built or received to hold position (except air)", + author = "Hobo Joe", + date = "April 2024", license = "GNU GPL, v2 or later", - layer = -9999, -- Run before everything, so that other movestate handling will override it - enabled = false + layer = -9999, -- Run before everything, so that other movestate handling will override it + enabled = false, } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID @@ -65,4 +63,4 @@ end function widget:GameStart() widget:PlayerChanged() -end \ No newline at end of file +end diff --git a/luaui/Widgets/unit_idle_guard.lua b/luaui/Widgets/unit_idle_guard.lua index be999b61ee5..7d800b8d10e 100644 --- a/luaui/Widgets/unit_idle_guard.lua +++ b/luaui/Widgets/unit_idle_guard.lua @@ -2,41 +2,47 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Idle Constructor Guard After Build", - desc = "Constructors guard factories after building if they have nothing to do afterwards", - author = "TheFutureKnight", - date = "2025-1-27", + name = "Idle Constructor Guard After Build", + desc = "Constructors guard factories after building if they have nothing to do afterwards", + author = "TheFutureKnight", + date = "2025-1-27", license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + layer = 0, + enabled = true, } end -local CMD_GUARD = CMD.GUARD -local OPT_SHIFT = CMD.OPT_SHIFT -local spGetMyTeamID = Spring.GetMyTeamID -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spGetUnitsInSphere = Spring.GetUnitsInSphere -local spGetUnitDefID = Spring.GetUnitDefID +local CMD_GUARD = CMD.GUARD +local OPT_SHIFT = CMD.OPT_SHIFT +local spGetMyTeamID = Spring.GetMyTeamID +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitsInSphere = Spring.GetUnitsInSphere +local spGetUnitDefID = Spring.GetUnitDefID local validGuardingBuilders = {} for unitDefID, ud in pairs(UnitDefs) do validGuardingBuilders[unitDefID] = (ud.isBuilder and ud.canAssist and ud.canMove and not ud.isFactory) end - -function widget:UnitCmdDone(unitID, unitDefID, unitTeam, - cmdID, cmdParams, _, _) - if not validGuardingBuilders[unitDefID] then return end +function widget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, _, _) + if not validGuardingBuilders[unitDefID] then + return + end local isRepair = (cmdID == CMD.REPAIR) - if not (isRepair or cmdID < 0) then return end - if unitTeam ~= spGetMyTeamID() then return end - if Spring.GetUnitCommandCount(unitID) > 0 then return end + if not (isRepair or cmdID < 0) then + return + end + if unitTeam ~= spGetMyTeamID() then + return + end + if Spring.GetUnitCommandCount(unitID) > 0 then + return + end - local buildeeDef = isRepair - and UnitDefs[spGetUnitDefID(cmdParams[1])] - or UnitDefs[-cmdID] + local buildeeDef = isRepair and UnitDefs[spGetUnitDefID(cmdParams[1])] or UnitDefs[-cmdID] - if not (buildeeDef and buildeeDef.isFactory) then return end + if not (buildeeDef and buildeeDef.isFactory) then + return + end if isRepair then spGiveOrderToUnit(unitID, CMD_GUARD, cmdParams[1], OPT_SHIFT) diff --git a/luaui/Widgets/unit_immobile_builder.lua b/luaui/Widgets/unit_immobile_builder.lua index b12f4adde33..27a6578e415 100644 --- a/luaui/Widgets/unit_immobile_builder.lua +++ b/luaui/Widgets/unit_immobile_builder.lua @@ -1,28 +1,27 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "ImmobileBuilder", - desc = "Sets immobile builders to MANEUVER, with a FIGHT command", - author = "trepan", - date = "Jan 8, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } + return { + name = "ImmobileBuilder", + desc = "Sets immobile builders to MANEUVER, with a FIGHT command", + author = "trepan", + date = "Jan 8, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame -local CMD_MOVE_STATE = CMD.MOVE_STATE -local CMD_FIGHT = CMD.FIGHT -local spGetMyTeamID = Spring.GetMyTeamID -local spGetTeamUnits = Spring.GetTeamUnits -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitPosition = Spring.GetUnitPosition -local spGiveOrderToUnit = Spring.GiveOrderToUnit +local CMD_MOVE_STATE = CMD.MOVE_STATE +local CMD_FIGHT = CMD.FIGHT +local spGetMyTeamID = Spring.GetMyTeamID +local spGetTeamUnits = Spring.GetTeamUnits +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGiveOrderToUnit = Spring.GiveOrderToUnit local spGetUnitCommandCount = Spring.GetUnitCommandCount local spGetUnitCurrentCommand = Spring.GetUnitCurrentCommand @@ -46,42 +45,42 @@ end local function setupUnit(unitID) local x, y, z = spGetUnitPosition(unitID) if x and y and z then - if (x > halfMapSizeX) then -- Avoid issuing commands outside map - x = x - 50 - else - x = x + 50 - end - if (z > halfMapSizeZ) then - z = z - 50 - else - z = z + 50 - end + if x > halfMapSizeX then -- Avoid issuing commands outside map + x = x - 50 + else + x = x + 50 + end + if z > halfMapSizeZ then + z = z - 50 + else + z = z + 50 + end -- Meta enables reclaim enemy units, alt autoresurrect (if available) - spGiveOrderToUnit(unitID, CMD_FIGHT, { x, y, z }, {"meta"}) + spGiveOrderToUnit(unitID, CMD_FIGHT, { x, y, z }, { "meta" }) end end local function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() myTeamID = spGetMyTeamID() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end - for _,unitID in ipairs(spGetTeamUnits(spGetMyTeamID())) do + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end + for _, unitID in ipairs(spGetTeamUnits(spGetMyTeamID())) do local unitDefID = spGetUnitDefID(unitID) if isImmobileBuilder[unitDefID] then spGiveOrderToUnit(unitID, CMD_MOVE_STATE, 1, 0) diff --git a/luaui/Widgets/unit_key_select.lua b/luaui/Widgets/unit_key_select.lua index e1f87d62e87..617749b03a5 100644 --- a/luaui/Widgets/unit_key_select.lua +++ b/luaui/Widgets/unit_key_select.lua @@ -8,7 +8,7 @@ function widget:GetInfo() date = "Aug 24, 2024", license = "Public Domain", layer = 1, - enabled = false + enabled = false, } end @@ -26,5 +26,5 @@ function widget:Initialize() end function widget:Shutdown() - WG['keyselect'] = nil + WG["keyselect"] = nil end diff --git a/luaui/Widgets/unit_load_own_moving.lua b/luaui/Widgets/unit_load_own_moving.lua index cf35474a591..ec8dfa10f52 100644 --- a/luaui/Widgets/unit_load_own_moving.lua +++ b/luaui/Widgets/unit_load_own_moving.lua @@ -1,20 +1,18 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Load Own Moving", - desc = "Enables loading of your own units when they're moving", - author = "Niobium", - version = "1.0", - date = "June 18, 2010", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true + name = "Load Own Moving", + desc = "Enables loading of your own units when they're moving", + author = "Niobium", + version = "1.0", + date = "June 18, 2010", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -50,9 +48,10 @@ local gameStarted -- Local functions ------------------------------------------------------------------- local function GetTransportTarget(uID) - local uCmd, _, _, cmdParam1, cmdParam2 = spGetUnitCurrentCommand(uID) - if not uCmd then return end + if not uCmd then + return + end if uCmd == CMD_LOAD_UNITS and cmdParam2 == nil then if spGetUnitTeam(cmdParam1) == spGetMyTeamID() then return cmdParam1 @@ -68,7 +67,7 @@ function widget:UnitCommand(uID, uDefID, uTeam) local wasEmpty = not next(watchList) watchList[uID] = true if wasEmpty then - widgetHandler:UpdateCallIn('GameFrame') + widgetHandler:UpdateCallIn("GameFrame") end end end @@ -77,23 +76,21 @@ function widget:UnitCmdDone(uID, uDefID, uTeam) end function widget:GameFrame(n) - -- Limit command rate to 3/sec (Sufficient for coms) - if n % 10 > 0 then return end + if n % 10 > 0 then + return + end for uID, _ in pairs(watchList) do - -- Re-get transports target local tID = GetTransportTarget(uID) if tID then - -- Only issue if transport is close if spGetUnitSeparation(uID, tID, true) < 100 then - -- Only issue if target is moving local vx, _, vz = spGetUnitVelocity(tID) if vx ~= 0 or vz ~= 0 then - spGiveOrderToUnit(uID, CMD_INSERT, {0, CMD_LOAD_UNITS, 0, tID}, CMD_OPT_ALT) + spGiveOrderToUnit(uID, CMD_INSERT, { 0, CMD_LOAD_UNITS, 0, tID }, CMD_OPT_ALT) end end else @@ -102,7 +99,7 @@ function widget:GameFrame(n) end end if not next(watchList) then - widgetHandler:RemoveCallIn('GameFrame') + widgetHandler:RemoveCallIn("GameFrame") end end @@ -111,22 +108,22 @@ function widget:UnitTaken(uID) end function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end end diff --git a/luaui/Widgets/unit_loop_select.lua b/luaui/Widgets/unit_loop_select.lua index f0502e4042b..570fdb5a856 100644 --- a/luaui/Widgets/unit_loop_select.lua +++ b/luaui/Widgets/unit_loop_select.lua @@ -1,16 +1,15 @@ - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Loop Select", - desc = "Selects units inside drawn loop (Hold meta to draw loop)", - author = "Niobium", - version = "v1.1", - date = "Jul 18, 2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false + name = "Loop Select", + desc = "Selects units inside drawn loop (Hold meta to draw loop)", + author = "Niobium", + version = "v1.1", + date = "Jul 18, 2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end @@ -68,84 +67,94 @@ local add = false --------------------------------------------------------------------------- function widget:Update(dt) - - if (fAlpha > 0) then + if fAlpha > 0 then fAlpha = fAlpha - fadeRate * dt end if dragging then - local mx, my = spGetMouseState() local _, pos = spTraceScreenRay(mx, my, true) if pos then - local wx, wy, wz = pos[1], pos[2], pos[3] - if ((wx ~= lx) or (wy ~= ly) or (wz ~= lz)) then - sNodes[#sNodes + 1] = {wx, wy, wz} - lx = wx; ly = wy; lz = wz + if (wx ~= lx) or (wy ~= ly) or (wz ~= lz) then + sNodes[#sNodes + 1] = { wx, wy, wz } + lx = wx + ly = wy + lz = wz end end end end local function sVerts(nodes) - for i=1, #nodes do + for i = 1, #nodes do local node = nodes[i] glVertex(node[1], node[2], node[3]) end end function widget:RecvLuaMsg(msg) - if msg:sub(1,18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end function widget:DrawWorld() - if chobbyInterface then return end + if chobbyInterface then + return + end glDepthTest(false) glLineWidth(2.0) - if (#sNodes > 1) then - + if #sNodes > 1 then glColor(1.0, 1.0, 1.0, 1.0) glBeginEnd(GL_LINE_STRIP, sVerts, sNodes) glColor(1.0, 1.0, 1.0, conLineAlpha) - glBeginEnd(GL_LINE_STRIP, sVerts, {{sx, sy, sz}, {lx, ly, lz}}) + glBeginEnd(GL_LINE_STRIP, sVerts, { { sx, sy, sz }, { lx, ly, lz } }) end - if ((fAlpha > 0) and (#fNodes > 1)) then - + if (fAlpha > 0) and (#fNodes > 1) then glColor(1.0, 1.0, 1.0, fAlpha) glBeginEnd(GL_LINE_LOOP, sVerts, fNodes) end end function widget:MousePress(mx, my, mButton) - -- Only left click - if (mButton ~= 1) then return false end + if mButton ~= 1 then + return false + end -- Only handle if there is no active command local _, actCmdID = spGetActiveCommand() - if (actCmdID ~= nil) then return false end + if actCmdID ~= nil then + return false + end -- Only handle if active - if not active then return false end + if not active then + return false + end -- Start dragging local _, pos = spTraceScreenRay(mx, my, true) - if not pos then return false end + if not pos then + return false + end local wx, wy, wz = pos[1], pos[2], pos[3] - sNodes[1] = {wx, wy, wz} - sx = wx; sy = wy; sz = wz - lx = wx; ly = wy; lz = wz + sNodes[1] = { wx, wy, wz } + sx = wx + sy = wy + sz = wz + lx = wx + ly = wy + lz = wz -- Return true, this gives us the next MouseMove/MouseRelease calls. dragging = true @@ -153,30 +162,34 @@ function widget:MousePress(mx, my, mButton) end function widget:MouseMove(mx, my) - local _, pos = spTraceScreenRay(mx, my, true) - if not pos then return end + if not pos then + return + end local wx, wy, wz = pos[1], pos[2], pos[3] - sNodes[#sNodes + 1] = {wx, wy, wz} - lx = wx; ly = wy; lz = wz + sNodes[#sNodes + 1] = { wx, wy, wz } + lx = wx + ly = wy + lz = wz end function widget:MouseRelease(mx, my) - -- Add final node (If different) local _, pos = spTraceScreenRay(mx, my, true) if pos then local wx, wy, wz = pos[1], pos[2], pos[3] - if ((wx ~= lx) or (wy ~= ly) or (wz ~= lz)) then - sNodes[#sNodes + 1] = {wx, wy, wz} - lx = wx; ly = wy; lz = wz + if (wx ~= lx) or (wy ~= ly) or (wz ~= lz) then + sNodes[#sNodes + 1] = { wx, wy, wz } + lx = wx + ly = wy + lz = wz end end - if (#sNodes < 2) then + if #sNodes < 2 then -- Not enough nodes -- Reset nodes sNodes = {} @@ -196,15 +209,14 @@ function widget:MouseRelease(mx, my) -- otherwise we can get a 'break' in the loop local sp = sNodes[#sNodes - 1] local spx, spy = sp[1], sp[3] - if (s2x == spx) then + if s2x == spx then s2x = s2x + 0.01 end - if (s2y == spy) then + if s2y == spy then s2y = s2y + 0.01 end - for i=1, #sNodes do - + for i = 1, #sNodes do local s1x = s2x local s1y = s2y @@ -218,16 +230,16 @@ function widget:MouseRelease(mx, my) -- Easiest solution: Add small number to make non-vert/horz -- Note: These changes will propogate due to 's1x = s2x' etc -- So changing values does not bring about inconsistancies or non-connecting lines - if (s2y == s1y) then + if s2y == s1y then s2y = s2y + 0.01 end - if (s2x == s1x) then + if s2x == s1x then s2x = s2x + 0.01 end local Ms = (s2y - s1y) / (s2x - s1x) - sLines[i] = {s1x, s1y, s2x, s2y, Ms, s1y - Ms * s1x} + sLines[i] = { s1x, s1y, s2x, s2y, Ms, s1y - Ms * s1x } end -- Now we find the selected units @@ -247,8 +259,7 @@ function widget:MouseRelease(mx, my) local toSelCount = 0 -- Loop over each unit - for i=1, #visUnits do - + for i = 1, #visUnits do -- Get screen position for unit local uID = visUnits[i] local ux, _, uz = spGetUnitPos(uID) @@ -261,8 +272,7 @@ function widget:MouseRelease(mx, my) -- Count intercepts local intercepts = 0 - for i=1, #sNodes do - + for i = 1, #sNodes do -- Speed local sLine = sLines[i] @@ -271,17 +281,13 @@ function widget:MouseRelease(mx, my) local iy = Mu * ix -- Check bounds - if ((-ix) * (ix - ux) >= 0) and - ((-iy) * (iy - uz) >= 0) and - ((sLine[1] - ix) * (ix - sLine[3]) >= 0) and - ((sLine[2] - iy) * (iy - sLine[4]) >= 0) then - - intercepts = intercepts + 1 + if (-ix * (ix - ux) >= 0) and (-iy * (iy - uz) >= 0) and ((sLine[1] - ix) * (ix - sLine[3]) >= 0) and ((sLine[2] - iy) * (iy - sLine[4]) >= 0) then + intercepts = intercepts + 1 end end -- Even = outside, Odd = inside. - if ((intercepts % 2) == 1) then + if (intercepts % 2) == 1 then toSelCount = toSelCount + 1 toSel[toSelCount] = uID end @@ -294,14 +300,13 @@ function widget:MouseRelease(mx, my) local selUnits = spGetSelUnits() -- Loop over selected units - for i=1, #selUnits do - + for i = 1, #selUnits do local uID = selUnits[i] local match = false -- Check this unit against poly units - for j=1, toSelCount do - if (toSel[j] == uID) then + for j = 1, toSelCount do + if toSel[j] == uID then match = j break end @@ -319,19 +324,17 @@ function widget:MouseRelease(mx, my) end else if add then - -- Easy, add units we already have selected, unless they are in poly -- We probably don't want to have duplicates in what we select local selUnits = spGetSelUnits() - for i=1, #selUnits do - + for i = 1, #selUnits do local uID = selUnits[i] local inPoly = false -- Check this unit against poly units - for j=1, toSelCount do - if (toSel[j] == uID) then + for j = 1, toSelCount do + if toSel[j] == uID then inPoly = true break end @@ -357,27 +360,27 @@ function widget:MouseRelease(mx, my) end local function setActive() - active = true + active = true end local function unsetActive() - active = false + active = false end local function setDeselect() - deselect = true + deselect = true end local function unsetDeselect() - deselect = false + deselect = false end local function setAdd() - add = true + add = true end local function unsetAdd() - add = false + add = false end function widget:Initialize() diff --git a/luaui/Widgets/unit_only_fighters_patrol.lua b/luaui/Widgets/unit_only_fighters_patrol.lua index dabc2ef8da7..8c0d9a49af5 100644 --- a/luaui/Widgets/unit_only_fighters_patrol.lua +++ b/luaui/Widgets/unit_only_fighters_patrol.lua @@ -12,22 +12,20 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local widget = widget ---@type Widget function widget:GetInfo() return { - name = "OnlyFightersPatrol", - desc = "Only fighters go on factory's patrol route after leaving airlab. Reduces lag.", - author = "dizekat", - date = "2008-04-22", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false, + name = "OnlyFightersPatrol", + desc = "Only fighters go on factory's patrol route after leaving airlab. Reduces lag.", + author = "dizekat", + date = "2008-04-22", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame local spGetMyTeamID = Spring.GetMyTeamID @@ -44,8 +42,8 @@ local isBuilder = {} local checkMustStop = {} local function UnitHasPatrolOrder(unitID) - local queue=GetUnitCommands(unitID,20) - for i=1,#queue do + local queue = GetUnitCommands(unitID, 20) + for i = 1, #queue do local cmd = queue[i] if cmd.id == CMD.PATROL then return true @@ -61,7 +59,7 @@ for udid, ud in pairs(UnitDefs) do if ud.isBuilder then isBuilder[udid] = true end - if ud.canFly and (ud.weaponCount==0 or not ud.isFighterAirUnit or string.find(ud.name,"liche") or ud.noAutoFire) then -- liche is classified as one somehow + if ud.canFly and (ud.weaponCount == 0 or not ud.isFighterAirUnit or string.find(ud.name, "liche") or ud.noAutoFire) then -- liche is classified as one somehow checkMustStop[udid] = true end end @@ -79,35 +77,35 @@ end function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) if unitTeam ~= myTeamID then return - elseif (userOrders) then + elseif userOrders then return end if not isFactory[factDefID] then return end if MustStop(unitID, unitDefID) then - Spring.GiveOrderToUnit(unitID,CMD.STOP,{},0) + Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, 0) end end function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end function widget:PlayerChanged(playerID) myTeamID = spGetMyTeamID() - maybeRemoveSelf() + maybeRemoveSelf() end function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end end diff --git a/luaui/Widgets/unit_set_fighters_fly.lua b/luaui/Widgets/unit_set_fighters_fly.lua index 5f60138479c..466de1cb281 100644 --- a/luaui/Widgets/unit_set_fighters_fly.lua +++ b/luaui/Widgets/unit_set_fighters_fly.lua @@ -3,25 +3,23 @@ local widget = widget ---@type Widget function widget:GetInfo() - return { - name = "Set fighters on Fly mode", - desc = "Setting fighters on Fly mode", - author = "Floris (original unit_air_allways_fly widget by [teh]Decay)", - date = "july 2017", - license = "GNU GPL, v2 or later", - version = 1, - layer = 5, - enabled = true - } + return { + name = "Set fighters on Fly mode", + desc = "Setting fighters on Fly mode", + author = "Floris (original unit_air_allways_fly widget by [teh]Decay)", + date = "july 2017", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = true, + } end - -- Localized Spring API for performance local spGetMyTeamID = Spring.GetMyTeamID -- this widget is a variant of unit_air_allways_fly: project page on github: https://github.com/jamerlan/unit_air_allways_fly - -------------------------------------------------------------------------------- local spGiveOrderToUnit = Spring.GiveOrderToUnit @@ -32,51 +30,49 @@ local myTeamID = spGetMyTeamID() local isFighter = {} for udid, ud in pairs(UnitDefs) do - if ud.customParams.fighter or ud.customParams.drone or ud.customParams.flyingcarrier then - isFighter[udid] = true - end + if ud.customParams.fighter or ud.customParams.drone or ud.customParams.flyingcarrier then + isFighter[udid] = true + end end -------------------------------------------------------------------------------- function widget:UnitCreated(unitID, unitDefID, teamID, builderID) - if isFighter[unitDefID] and teamID == myTeamID then - spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) - end + if isFighter[unitDefID] and teamID == myTeamID then + spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) + end end function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - if isFighter[unitDefID] and newTeam == myTeamID then - spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) - end + if isFighter[unitDefID] and newTeam == myTeamID then + spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) + end end function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - if isFighter[unitDefID] and unitTeam == myTeamID then - spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) - end + if isFighter[unitDefID] and unitTeam == myTeamID then + spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) + end end function widget:PlayerChanged(playerID) - myTeamID = spGetMyTeamID() - if Spring.GetSpectatingState() then - widgetHandler:RemoveWidget() - end + myTeamID = spGetMyTeamID() + if Spring.GetSpectatingState() then + widgetHandler:RemoveWidget() + end end function widget:Initialize() - if Spring.IsReplay() or Spring.GetGameFrame() > 0 then - widget:PlayerChanged() - end - for _, unitID in ipairs(spGetTeamUnits(myTeamID)) do -- init existing labs - if isFighter[spGetUnitDefID(unitID)] then - spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) - end - end + if Spring.IsReplay() or Spring.GetGameFrame() > 0 then + widget:PlayerChanged() + end + for _, unitID in ipairs(spGetTeamUnits(myTeamID)) do -- init existing labs + if isFighter[spGetUnitDefID(unitID)] then + spGiveOrderToUnit(unitID, cmdFly, { 0 }, 0) + end + end end function widget:GameStart() - widget:PlayerChanged() + widget:PlayerChanged() end - - diff --git a/luaui/Widgets/unit_share_tracker.lua b/luaui/Widgets/unit_share_tracker.lua index fa9edcf16be..34c79f278a9 100644 --- a/luaui/Widgets/unit_share_tracker.lua +++ b/luaui/Widgets/unit_share_tracker.lua @@ -10,11 +10,10 @@ function widget:GetInfo() date = "17 August 2009", license = "GNU LGPL, v2.1 or later", layer = 0, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetUnitPosition = Spring.GetUnitPosition local spGetViewGeometry = Spring.GetViewGeometry @@ -212,8 +211,12 @@ function widget:DrawScreen() end local xDiff = mathAbs(sx - sMidX) local yDiff = mathAbs(sy - sMidY) - if xDiff < 0.001 then xDiff = 0.001 end - if yDiff < 0.001 then yDiff = 0.001 end + if xDiff < 0.001 then + xDiff = 0.001 + end + if yDiff < 0.001 then + yDiff = 0.001 + end local xRatio = sMidX / xDiff local yRatio = sMidY / yDiff local edgeDist, textX, textY, textOptions @@ -271,7 +274,7 @@ end function widget:ViewResize() vsx, vsy = spGetViewGeometry() - font = WG['fonts'].getFont(1, 1.5) + font = WG["fonts"].getFont(1, 1.5) sMidX = vsx * 0.5 sMidY = vsy * 0.5 @@ -293,7 +296,7 @@ function widget:UnitTaken(unitID, unitDefID, oldTeam, newTeam) local x, y, z = spGetUnitPosition(unitID) local r, g, b = spGetTeamColor(oldTeam) if x and r then - mapPoints[unitID] = { r = r, g = g, b = b, x = x, y = y, z = z, unitName = spI18N('ui.unitShare.unit', { unit = UnitDefs[unitDefID].translatedHumanName }), time = (timeNow + ttl), highlightSize = UnitDefs[unitDefID].radius * 0.6 } + mapPoints[unitID] = { r = r, g = g, b = b, x = x, y = y, z = z, unitName = spI18N("ui.unitShare.unit", { unit = UnitDefs[unitDefID].translatedHumanName }), time = (timeNow + ttl), highlightSize = UnitDefs[unitDefID].radius * 0.6 } unitCount = unitCount + 1 end end @@ -315,8 +318,8 @@ function widget:Update(dt) if unitCount > 0 then msgTimer = msgTimer + dt if msgTimer > 0.1 then - spEcho( spI18N('ui.unitShare.received', { count = unitCount }) ) - spPlaySoundFile("beep4", 1, 'ui') + spEcho(spI18N("ui.unitShare.received", { count = unitCount })) + spPlaySoundFile("beep4", 1, "ui") unitCount = 0 msgTimer = 0 end diff --git a/luaui/Widgets/unit_smart_area_reclaim.lua b/luaui/Widgets/unit_smart_area_reclaim.lua index 4923de5b7cb..c53e374a610 100644 --- a/luaui/Widgets/unit_smart_area_reclaim.lua +++ b/luaui/Widgets/unit_smart_area_reclaim.lua @@ -15,17 +15,16 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Smart Area Reclaim", - desc = "Area reclaims only metal or energy depending on the center feature", - author = "aegis", - date = "Jun 25, 2010", - license = "Public Domain", - layer = 0, - enabled = true + name = "Smart Area Reclaim", + desc = "Area reclaims only metal or energy depending on the center feature", + author = "aegis", + date = "Jun 25, 2010", + license = "Public Domain", + layer = 0, + enabled = true, } end - -- Localized Spring API for performance local spGetGameFrame = Spring.GetGameFrame @@ -70,47 +69,44 @@ for udefID, def in ipairs(UnitDefs) do end end - local function maybeRemoveSelf() - if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then - widgetHandler:RemoveWidget() - end + if Spring.GetSpectatingState() and (spGetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget() + end end - function widget:GameStart() - gameStarted = true - maybeRemoveSelf() + gameStarted = true + maybeRemoveSelf() end - function widget:PlayerChanged() - maybeRemoveSelf() + maybeRemoveSelf() end - function widget:Initialize() - if Spring.IsReplay() or spGetGameFrame() > 0 then - maybeRemoveSelf() - end + if Spring.IsReplay() or spGetGameFrame() > 0 then + maybeRemoveSelf() + end end - local function tsp(rList, tList, dx, dz) dx = dx or 0 dz = dz or 0 tList = tList or {} - if rList == nil then return end + if rList == nil then + return + end local closestDist local closestItem local closestIndex - for i=1, #rList do + for i = 1, #rList do local item = rList[i] if item ~= nil and item ~= 0 then - local distx, distz = item[1]-dx, item[2]-dz + local distx, distz = item[1] - dx, item[2] - dz local dist = abs(distx) + abs(distz) if closestDist == nil or dist < closestDist then closestDist = dist @@ -120,21 +116,22 @@ local function tsp(rList, tList, dx, dz) end end - if closestItem == nil then return tList end + if closestItem == nil then + return tList + end - tList[#tList+1] = closestItem + tList[#tList + 1] = closestItem rList[closestIndex] = 0 return tsp(rList, tList, closestItem[1], closestItem[2]) end - local function stationary(rList) local sList = {} local sKeys = {} local sKeysCount = 0 local lastKey, lastItem local lastItemCount = 0 - for i=1, #rList do + for i = 1, #rList do local item = rList[i] local dx, dz = item[1], item[2] @@ -142,7 +139,7 @@ local function stationary(rList) if lastKey ~= theta then sKeysCount = sKeysCount + 1 sKeys[sKeysCount] = theta - lastItem = {item} + lastItem = { item } lastItemCount = 1 sList[theta] = lastItem else @@ -155,10 +152,10 @@ local function stationary(rList) local oList = {} local oListCount = 0 sort(sKeys) - for i=1, #sKeys do + for i = 1, #sKeys do local theta = sKeys[i] local values = sList[theta] - for j=1, #values do + for j = 1, #values do oListCount = oListCount + 1 oList[oListCount] = values[j] end @@ -166,11 +163,10 @@ local function stationary(rList) return oList end - local function issue(rList, shift) local opts = {} - for i=1, #rList do + for i = 1, #rList do local item = rList[i] local uid, fid = item[3], item[4] @@ -179,12 +175,11 @@ local function issue(rList, shift) opt = OPT_SHIFT end - GiveOrderToUnit(uid, RECLAIM, {fid+maxUnits}, opt) + GiveOrderToUnit(uid, RECLAIM, { fid + maxUnits }, opt) opts[uid] = 1 end end - -- we use the previous unit loop iterating on cmds to store reclaim orders -- and return cmds for its original usage local function storeReclaimOrders(uid) @@ -203,9 +198,8 @@ local function storeReclaimOrders(uid) return cmds end - local function checkNoDuplicateOrder(uid, fid) - local orderParam = fid+maxUnits + local orderParam = fid + maxUnits for _, reclaimParam in pairs(reclaimOrders[uid] or {}) do if reclaimParam == orderParam then @@ -216,11 +210,14 @@ local function checkNoDuplicateOrder(uid, fid) return true end - function widget:CommandNotify(id, params, options) -- early exit if criteria does not match - if id ~= RECLAIM then return false end - if not params[4] then return false end + if id ~= RECLAIM then + return false + end + if not params[4] then + return false + end local x, y, z, r = params[1], params[2], params[3], params[4] @@ -232,7 +229,9 @@ function widget:CommandNotify(id, params, options) local mx, my = WorldToScreenCoords(x, y, z) local type, originFeatureId = TraceScreenRay(mx, my) - if type ~= "feature" then return false end + if type ~= "feature" then + return false + end local commandHeight = Spring.GetGroundHeight(x, z) @@ -246,7 +245,7 @@ function widget:CommandNotify(id, params, options) -- clear reclaim orders cache reclaimOrders = {} - for i=1, #sUnits do + for i = 1, #sUnits do local uid = sUnits[i] local udid = GetUnitDefID(uid) if unitCanReclaim[udid] then @@ -261,7 +260,7 @@ function widget:CommandNotify(id, params, options) local ux, _, uz = GetUnitPosition(uid) if options.shift then local cmds = storeReclaimOrders(uid) - for ci=#cmds, 1, -1 do + for ci = #cmds, 1, -1 do local cmd = cmds[ci] if cmd.id == MOVE then ux, uz = cmd.params[1], cmd.params[3] @@ -270,7 +269,7 @@ function widget:CommandNotify(id, params, options) end end rUnitsCount = rUnitsCount + 1 - rUnits[rUnitsCount] = {uid=uid, ux=ux, uz=uz} + rUnits[rUnitsCount] = { uid = uid, ux = ux, uz = uz } end end @@ -279,7 +278,7 @@ function widget:CommandNotify(id, params, options) -- Sort features by above water, below water, metal value, energy value local features = Spring.GetFeaturesInCylinder(x, z, r) - for i=1, #features, 1 do + for i = 1, #features, 1 do local featureID = features[i] local _, featY, _ = GetFeaturePosition(featureID) local featM, _, featE = GetFeatureResources(featureID) @@ -315,22 +314,22 @@ function widget:CommandNotify(id, params, options) filteredFeatures = retw end - for i=1,#filteredFeatures do + for i = 1, #filteredFeatures do local fid = filteredFeatures[i] if fid ~= nil then local fx, _, fz = GetFeaturePosition(fid) - for ui=1,#rUnits do + for ui = 1, #rUnits do local unit = rUnits[ui] local uid, ux, uz = unit.uid, unit.ux, unit.uz - local dx, dz = ux-fx, uz-fz - local item = {dx, dz, uid, fid} + local dx, dz = ux - fx, uz - fz + local item = { dx, dz, uid, fid } if mobiles[uid] ~= nil then if not options.shift or checkNoDuplicateOrder(uid, fid) then mListCount = mListCount + 1 mList[mListCount] = item end elseif stationaries[uid] ~= nil then - if sqrt((dx*dx)+(dz*dz)) <= stationaries[uid] and (not options.shift or checkNoDuplicateOrder(uid, fid)) then + if sqrt((dx * dx) + (dz * dz)) <= stationaries[uid] and (not options.shift or checkNoDuplicateOrder(uid, fid)) then sListCount = sListCount + 1 sList[sListCount] = item end diff --git a/luaui/Widgets/unit_smart_select.lua b/luaui/Widgets/unit_smart_select.lua index 1f0b8d550ff..e907b16233d 100644 --- a/luaui/Widgets/unit_smart_select.lua +++ b/luaui/Widgets/unit_smart_select.lua @@ -8,11 +8,10 @@ function widget:GetInfo() date = "Jan 2, 2011", license = "Public Domain", layer = -999999, - enabled = true + enabled = true, } end - -- Localized Spring API for performance local spGetSelectedUnits = Spring.GetSelectedUnits local spGetMyTeamID = Spring.GetMyTeamID @@ -28,7 +27,7 @@ local inMiniMapSel = false local referenceX, referenceY -local selectBuildingsWithMobile = false -- whether to select buildings when mobile units are inside selection rectangle +local selectBuildingsWithMobile = false -- whether to select buildings when mobile units are inside selection rectangle local includeNanosAsMobile = true local includeBuilders = false local includeResurrectors = false @@ -38,13 +37,13 @@ local includeJammer = false -- selection modifiers local mods = { - idle = false, -- whether to select only idle units - same = false, -- whether to select only units that share type with current selection - deselect = false, -- whether to select units not present in current selection - all = false, -- whether to select without filters and append (backwards compatibility, it's like append+any) - mobile = false, -- whether to select only mobile units - append = false, -- whether to append units to current selection - any = false, -- whether to select without filters + idle = false, -- whether to select only idle units + same = false, -- whether to select only units that share type with current selection + deselect = false, -- whether to select units not present in current selection + all = false, -- whether to select without filters and append (backwards compatibility, it's like append+any) + mobile = false, -- whether to select only mobile units + append = false, -- whether to append units to current selection + any = false, -- whether to select without filters } local customFilterDef = "" local lastMods = mods @@ -90,13 +89,13 @@ local jammerFilter = {} local customFilter = {} for udid, udef in pairs(UnitDefs) do - if udef.modCategories['object'] or udef.customParams.objectify then + if udef.modCategories["object"] or udef.customParams.objectify then ignoreUnits[udid] = true end local isMobile = not udef.isImmobile or (includeNanosAsMobile and (udef.isStaticBuilder and not udef.isFactory)) - local builder = (udef.buildOptions and udef.buildOptions[1]) or ((udef.canRepair and udef.repairSpeed > 0) or (udef.canReclaim and udef.reclaimSpeed > 0)) and not (udef.canResurrect and udef.resurrectSpeed > 0) - local resurrector = (udef.canResurrect and udef.resurrectSpeed > 0) and not (udef.buildOptions and udef.buildOptions[1]) + local builder = (udef.buildOptions and udef.buildOptions[1]) or ((udef.canRepair and udef.repairSpeed > 0) or (udef.canReclaim and udef.reclaimSpeed > 0)) and not (udef.canResurrect and udef.resurrectSpeed > 0) + local resurrector = (udef.canResurrect and udef.resurrectSpeed > 0) and not (udef.buildOptions and udef.buildOptions[1]) local building = (isMobile == false) local isUtil = udef.customParams.unitgroup == "util" local antinuke = isMobile and udef.customParams.unitgroup == "antinuke" @@ -127,18 +126,18 @@ local function smartSelectIncludeFilter(udid) end local smartSelectFilters = { - {include = includeBuilders, filter = builderFilter}, - {include = includeResurrectors, filter = resurrectorFilter}, - {include = includeAntinuke, filter = antinukeFilter}, - {include = includeRadar, filter = radarFilter}, - {include = includeJammer, filter = jammerFilter} + { include = includeBuilders, filter = builderFilter }, + { include = includeResurrectors, filter = resurrectorFilter }, + { include = includeAntinuke, filter = antinukeFilter }, + { include = includeRadar, filter = radarFilter }, + { include = includeJammer, filter = jammerFilter }, } - for _, unit in ipairs(smartSelectFilters) do - if not unit.include and unit.filter[udid] then - return false - end - end - return true + for _, unit in ipairs(smartSelectFilters) do + if not unit.include and unit.filter[udid] then + return false + end + end + return true end local dualScreen @@ -162,7 +161,7 @@ local function GetUnitsInMinimapRectangle(x, y) left, right = sort(left, right) bottom, top = sort(bottom, top) - return spGetUnitsInRectangle(left, bottom, right, top, not spec and -2) -- -2 = own units + return spGetUnitsInRectangle(left, bottom, right, top, not spec and -2) -- -2 = own units end local function handleSetModifier(_, _, _, data) @@ -185,7 +184,6 @@ local function isUnitIdle(unitID) return inIdleWorkerTask[unitID] or spGetUnitCommandCount(unitID) == 0 end - function widget:ViewResize() dualScreen = Spring.GetMiniMapDualScreen() _, _, _, vpy = spGetViewGeometry() @@ -213,7 +211,7 @@ function widget:SelectionChanged(sel) selectedUnits = sel end --- function mousePress is called after all widgets have had their chance with widget:MousePress. +-- function mousePress is called after all widgets have had their chance with widget:MousePress. -- If any of those widgets change the selection on mouse press, referenceSelection will not only become stale, it will be stale inconsistently because widget:SelectionChanged is deferred. -- So we make a snapshot of the selection before any widget has had a chance to change it (layer -999999), and use that as the reference for the selection box. -- This produces a consistent behavior for Ctrl+drag deselect, even if other widgets select on mouse press (e.g. Squad Selection on ctrl+left click). @@ -226,7 +224,7 @@ end -- this widget gets called early due to its layer -- this function will get called after all widgets have had their chance with widget:MousePress -local function mousePress(x, y, button, hasMouseOwner) --function widget:MousePress(x, y, button) +local function mousePress(x, y, button, hasMouseOwner) --function widget:MousePress(x, y, button) if hasMouseOwner or button ~= 1 then skipSel = true return @@ -263,29 +261,30 @@ function widget:Update(dt) end local x, y, lmb = spGetMouseState() - if lmb == false then inMiniMapSel = false end + if lmb == false then + inMiniMapSel = false + end local x1, y1, x2, y2 = spGetSelectionBox() local selRectChanged = false - if (prevSelRect[1] and prevSelRect[1] ~= x1) or (not prevSelRect[1] and x1) or - (prevSelRect[2] and prevSelRect[2] ~= y1) or (not prevSelRect[2] and y1) or - (prevSelRect[3] and prevSelRect[3] ~= x2) or (not prevSelRect[3] and x2) or - (prevSelRect[4] and prevSelRect[4] ~= y2) or (not prevSelRect[4] and y2) - then + if (prevSelRect[1] and prevSelRect[1] ~= x1) or (not prevSelRect[1] and x1) or (prevSelRect[2] and prevSelRect[2] ~= y1) or (not prevSelRect[2] and y1) or (prevSelRect[3] and prevSelRect[3] ~= x2) or (not prevSelRect[3] and x2) or (prevSelRect[4] and prevSelRect[4] ~= y2) or (not prevSelRect[4] and y2) then selRectChanged = true end - prevSelRect = {x1, y1, x2, y2} + prevSelRect = { x1, y1, x2, y2 } inSelection = inMiniMapSel or (x1 ~= nil) - if not inSelection then return end -- not in valid selection box (mouserelease/minimum threshold/chorded/etc) + if not inSelection then + return + end -- not in valid selection box (mouserelease/minimum threshold/chorded/etc) - if #referenceSelection == 0 then -- no point in inverting an empty selection + if #referenceSelection == 0 then -- no point in inverting an empty selection mods.deselect = false end -- limit updaterate (cause Spring.GetUnitsIn.... expensive mem alloc wise) - if (not selRectChanged and sec < 1/30) -- limit to 30 updates per sec when selection rectangle didnt change - or selRectChanged and sec < 1/60 -- limit to 60 updates per sec + if + (not selRectChanged and sec < 1 / 30) -- limit to 30 updates per sec when selection rectangle didnt change + or selRectChanged and sec < 1 / 60 -- limit to 60 updates per sec then return end @@ -297,7 +296,7 @@ function widget:Update(dt) if inMiniMapSel then mouseSelection = GetUnitsInMinimapRectangle(x, y) else - mouseSelection = spGetUnitsInScreenRectangle(x1, y1, x2, y2, not spec and not isGodMode and -2) or {} -- -2 = own units + mouseSelection = spGetUnitsInScreenRectangle(x1, y1, x2, y2, not spec and not isGodMode and -2) or {} -- -2 = own units end local newSelection = {} @@ -315,9 +314,11 @@ function widget:Update(dt) for i = 1, #mouseSelection do uid = mouseSelection[i] - if not spGetUnitNoSelect(uid) and -- filter unselectable units - -- filter gaia units + ignored units (objects) - (isGodMode or ((not spec or spGetUnitTeam(uid) ~= GaiaTeamID) and not ignoreUnits[spGetUnitDefID(uid)])) then + if + not spGetUnitNoSelect(uid) -- filter unselectable units + -- filter gaia units + ignored units (objects) + and (isGodMode or ((not spec or spGetUnitTeam(uid) ~= GaiaTeamID) and not ignoreUnits[spGetUnitDefID(uid)])) + then n = n + 1 included[n] = uid if equalsMouseSelection and not lastMouseSelection[uid] then @@ -325,16 +326,7 @@ function widget:Update(dt) end end end - if equalsMouseSelection - and mods.idle == lastMods[1] - and mods.same == lastMods[2] - and mods.deselect == lastMods[3] - and mods.all == lastMods[4] - and mods.mobile == lastMods[5] - and mods.append == lastMods[6] - and mods.any == lastMods[7] - and customFilterDef == lastCustomFilterDef - then + if equalsMouseSelection and mods.idle == lastMods[1] and mods.same == lastMods[2] and mods.deselect == lastMods[3] and mods.all == lastMods[4] and mods.mobile == lastMods[5] and mods.append == lastMods[6] and mods.any == lastMods[7] and customFilterDef == lastCustomFilterDef then return end @@ -385,19 +377,19 @@ function widget:Update(dt) included = {} for i = 1, #mouseSelection do uid = mouseSelection[i] - if referenceSelectionTypes[ spGetUnitDefID(uid) ] ~= nil then + if referenceSelectionTypes[spGetUnitDefID(uid)] ~= nil then included[#included + 1] = uid end end mouseSelection = included end - if mods.mobile then -- only select mobile combat units + if mods.mobile then -- only select mobile combat units if not mods.deselect then included = {} for i = 1, #referenceSelection do uid = referenceSelection[i] - if combatFilter[ spGetUnitDefID(uid) ] then -- is a combat unit + if combatFilter[spGetUnitDefID(uid)] then -- is a combat unit included[#included + 1] = uid end end @@ -407,18 +399,17 @@ function widget:Update(dt) included = {} for i = 1, #mouseSelection do uid = mouseSelection[i] - if combatFilter[ spGetUnitDefID(uid) ] then -- is a combat unit + if combatFilter[spGetUnitDefID(uid)] then -- is a combat unit included[#included + 1] = uid end end mouseSelection = included - elseif selectBuildingsWithMobile == false and (mods.any == false and mods.all == false) and mods.deselect == false then -- only select mobile units, not buildings local mobiles = false for i = 1, #mouseSelection do uid = mouseSelection[i] - if mobileFilter[ spGetUnitDefID(uid) ] then + if mobileFilter[spGetUnitDefID(uid)] then mobiles = true break end @@ -459,28 +450,24 @@ function widget:Update(dt) included = {} for i = 1, #newSelection do uid = newSelection[i] - if not negative[uid] then + if not negative[uid] then included[#included + 1] = uid end end newSelection = included selectedUnits = newSelection spSelectUnitArray(selectedUnits) - - elseif (mods.append or mods.all) then -- append units inside selection rectangle to current selection + elseif mods.append or mods.all then -- append units inside selection rectangle to current selection spSelectUnitArray(newSelection) spSelectUnitArray(mouseSelection, true) selectedUnits = spGetSelectedUnits() - - elseif #mouseSelection > 0 then -- select units inside selection rectangle + elseif #mouseSelection > 0 then -- select units inside selection rectangle selectedUnits = mouseSelection spSelectUnitArray(selectedUnits) - elseif #mouseSelection == 0 then selectedUnits = {} spSelectUnitArray(selectedUnits) - - else -- keep current selection while dragging until more things are selected + else -- keep current selection while dragging until more things are selected selectedUnits = referenceSelection spSelectUnitArray(selectedUnits) end @@ -504,7 +491,7 @@ end --end -- function widget:Shutdown() - WG['smartselect'] = nil + WG["smartselect"] = nil WG.SmartSelect_MousePress2 = nil WG.SmartSelect_SelectUnits = nil @@ -523,7 +510,7 @@ function widget:Initialize() externalSelectionReference[current[i]] = true end end - + -- Function to clear the reference selection WG.SmartSelect_ClearReference = function() externalSelectionReference = {} @@ -534,23 +521,22 @@ function widget:Initialize() -- Apply smart select filtering to the provided units local mouseSelection = units local uid, udid - + local included = {} - + -- Filter unselectable units and ignored units (always apply this basic filter) local isGodMode = spIsGodModeEnabled() for i = 1, #mouseSelection do uid = mouseSelection[i] - if not spGetUnitNoSelect(uid) and - (isGodMode or ((not spec or spGetUnitTeam(uid) ~= GaiaTeamID) and not ignoreUnits[spGetUnitDefID(uid)])) then + if not spGetUnitNoSelect(uid) and (isGodMode or ((not spec or spGetUnitTeam(uid) ~= GaiaTeamID) and not ignoreUnits[spGetUnitDefID(uid)])) then included[#included + 1] = uid end end mouseSelection = included - + -- Check modifiers to determine mode local _, ctrl, _, shift = spGetModKeyState() - + -- Ctrl mode: deselect units in mouseSelection from current selection -- Use RAW mouseSelection (no filters) for deselect to match engine behavior if ctrl then @@ -560,13 +546,13 @@ function widget:Initialize() spSelectUnitArray(selectedUnits) return end - + -- Build set of units to deselect (use RAW list, no filters) local unitsToDeselect = {} for i = 1, #mouseSelection do unitsToDeselect[mouseSelection[i]] = true end - + -- Keep units from reference that are not in the deselect set local newSelection = {} for unitID, _ in pairs(externalSelectionReference) do @@ -574,14 +560,14 @@ function widget:Initialize() newSelection[#newSelection + 1] = unitID end end - + selectedUnits = newSelection spSelectUnitArray(selectedUnits) return end - + -- For non-deselect modes, apply smart select filters - + -- Apply custom filter if set if next(customFilter) ~= nil then included = {} @@ -595,7 +581,7 @@ function widget:Initialize() mouseSelection = included end end - + -- Apply idle filter if active if mods.idle then included = {} @@ -607,7 +593,7 @@ function widget:Initialize() end mouseSelection = included end - + -- Apply same-type filter if active if mods.same and next(referenceSelectionTypes) ~= nil then included = {} @@ -619,7 +605,7 @@ function widget:Initialize() end mouseSelection = included end - + -- Apply mobile filter if active if mods.mobile then included = {} @@ -640,7 +626,7 @@ function widget:Initialize() break end end - + if mobiles then included = {} local excluded = {} @@ -661,19 +647,19 @@ function widget:Initialize() mouseSelection = included end end - + -- Shift mode: append units to reference selection if shift and next(externalSelectionReference) ~= nil then -- Append mode with reference - start with reference units, then add/keep box units local combined = {} local unitSet = {} - + -- Add reference selection (units selected before box drag started) for unitID, _ in pairs(externalSelectionReference) do unitSet[unitID] = true combined[#combined + 1] = unitID end - + -- Add new units from box selection for i = 1, #mouseSelection do if not unitSet[mouseSelection[i]] then @@ -681,7 +667,7 @@ function widget:Initialize() combined[#combined + 1] = mouseSelection[i] end end - + selectedUnits = combined spSelectUnitArray(selectedUnits) else @@ -699,41 +685,41 @@ function widget:Initialize() widgetHandler:AddAction("selectbox", handleSetCustomFilter, nil, "p") widgetHandler:AddAction("selectbox", handleClearCustomFilter, nil, "r") - WG['smartselect'] = {} - WG['smartselect'].getIncludeBuildings = function() + WG["smartselect"] = {} + WG["smartselect"].getIncludeBuildings = function() return selectBuildingsWithMobile end - WG['smartselect'].setIncludeBuildings = function(value) + WG["smartselect"].setIncludeBuildings = function(value) selectBuildingsWithMobile = value end - WG['smartselect'].getIncludeBuilders = function() + WG["smartselect"].getIncludeBuilders = function() return includeBuilders end - WG['smartselect'].setIncludeBuilders = function(value) + WG["smartselect"].setIncludeBuilders = function(value) includeBuilders = value end - WG['smartselect'].getIncludeResurrectors = function() + WG["smartselect"].getIncludeResurrectors = function() return includeResurrectors end - WG['smartselect'].setIncludeResurrectors = function(value) + WG["smartselect"].setIncludeResurrectors = function(value) includeResurrectors = value end - WG['smartselect'].getIncludeAntinuke = function() + WG["smartselect"].getIncludeAntinuke = function() return includeAntinuke end - WG['smartselect'].setIncludeAntinuke = function(value) + WG["smartselect"].setIncludeAntinuke = function(value) includeAntinuke = value end - WG['smartselect'].getIncludeRadar = function() + WG["smartselect"].getIncludeRadar = function() return includeRadar end - WG['smartselect'].setIncludeRadar = function(value) + WG["smartselect"].setIncludeRadar = function(value) includeRadar = value end - WG['smartselect'].getIncludeJammer = function() + WG["smartselect"].getIncludeJammer = function() return includeJammer end - WG['smartselect'].setIncludeJammer = function(value) + WG["smartselect"].setIncludeJammer = function(value) includeJammer = value end @@ -748,7 +734,7 @@ function widget:GetConfigData() includeResurrectors = includeResurrectors, includeAntinuke = includeAntinuke, includeRadar = includeRadar, - includeJammer = includeJammer + includeJammer = includeJammer, } end diff --git a/luaui/Widgets/unit_stateprefs.lua b/luaui/Widgets/unit_stateprefs.lua index c466dc3bcaf..0c5114ee359 100644 --- a/luaui/Widgets/unit_stateprefs.lua +++ b/luaui/Widgets/unit_stateprefs.lua @@ -15,7 +15,6 @@ function widget:GetInfo() } end - -- Localized Spring API for performance local spGetUnitDefID = Spring.GetUnitDefID local spGetSelectedUnits = Spring.GetSelectedUnits @@ -34,7 +33,8 @@ bind alt stateprefs_clear bind ctrl stateprefs_record bind sc_\ stateprefs_clearunit ---]]------------------------------------------------------------------------------ +--]] +------------------------------------------------------------------------------ local unitName = {} for udid, ud in pairs(UnitDefs) do @@ -87,7 +87,7 @@ function widget:SetConfigData(data) pruneAllUnitPrefs() end -local clearSound = 'LuaUI/Sounds/switchoff.wav' +local clearSound = "LuaUI/Sounds/switchoff.wav" local CMDTYPE_ICON_MODE = CMDTYPE.ICON_MODE local isRecordPressed = false local isClearPressed = false @@ -138,26 +138,24 @@ function widget:Initialize() widgetHandler:AddAction("stateprefs_clear", onClearPress, nil, "p") widgetHandler:AddAction("stateprefs_clear", onClearRelease, nil, "r") widgetHandler:AddAction("stateprefs_clearunit", doClearUnit, nil, "p") - end function onRecordPress() - isRecordPressed = true + isRecordPressed = true end function onRecordRelease() - isRecordPressed = false + isRecordPressed = false end function onClearPress() - isClearPressed = true + isClearPressed = true end function onClearRelease() - isClearPressed = false + isClearPressed = false end - function doClearUnit() local selectedUnits = spGetSelectedUnits() for i = 1, #selectedUnits do @@ -167,12 +165,12 @@ function doClearUnit() unitSet[name] = nil spEcho("All state prefs removed for unit: " .. name) end - Spring.PlaySoundFile(clearSound , 0.6, 'ui') + Spring.PlaySoundFile(clearSound, 0.6, "ui") end function widget:CommandNotify(cmdID, cmdParams, cmdOpts) - if not isRecordPressed and not isClearPressed then - return false + if not isRecordPressed and not isClearPressed then + return false end local index = Spring.GetCmdDescIndex(cmdID) @@ -188,7 +186,7 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOpts) local unitDefID = spGetUnitDefID(unitID) local name = unitName[unitDefID] local prefs = unitSet[name] - + if #cmdParams == 1 and isClearPressed then if prefs and prefs[cmdID] ~= nil then prefs[cmdID] = nil diff --git a/luaui/Widgets/unit_waypoint_dragger_2.lua b/luaui/Widgets/unit_waypoint_dragger_2.lua index 2aa322dc81b..b7c6830cfe7 100644 --- a/luaui/Widgets/unit_waypoint_dragger_2.lua +++ b/luaui/Widgets/unit_waypoint_dragger_2.lua @@ -2,60 +2,60 @@ local widget = widget ---@type Widget function widget:GetInfo() return { - name = "Waypoint Dragger", - desc = "Enables Waypoint Dragging", - author = "Kloot", - date = "Aug. 8, 2007 [updated Aug. 14, 2009]", - license = "GNU GPL v2", - layer = 5, - enabled = true + name = "Waypoint Dragger", + desc = "Enables Waypoint Dragging", + author = "Kloot", + date = "Aug. 8, 2007 [updated Aug. 14, 2009]", + license = "GNU GPL v2", + layer = 5, + enabled = true, } end -local spGetActiveCommand = Spring.GetActiveCommand -local spGetGameSeconds = Spring.GetGameSeconds -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetUnitCommands = Spring.GetUnitCommands -local spGetMouseState = Spring.GetMouseState -local spGetModKeyState = Spring.GetModKeyState -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spIsAboveMiniMap = Spring.IsAboveMiniMap +local spGetActiveCommand = Spring.GetActiveCommand +local spGetGameSeconds = Spring.GetGameSeconds +local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetUnitCommands = Spring.GetUnitCommands +local spGetMouseState = Spring.GetMouseState +local spGetModKeyState = Spring.GetModKeyState +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spIsAboveMiniMap = Spring.IsAboveMiniMap local spWorldToScreenCoords = Spring.WorldToScreenCoords -local spTraceScreenRay = Spring.TraceScreenRay +local spTraceScreenRay = Spring.TraceScreenRay local floor = math.floor -local glVertex = gl.Vertex -local glBeginEnd = gl.BeginEnd -local glColor = gl.Color -local glLineStipple = gl.LineStipple +local glVertex = gl.Vertex +local glBeginEnd = gl.BeginEnd +local glColor = gl.Color +local glLineStipple = gl.LineStipple local glDrawGroundCircle = gl.DrawGroundCircle local cmdColorsTbl = { - [CMD.MOVE] = {0.5, 1.0, 0.5, 0.55}, - [CMD.PATROL] = {0.3, 0.3, 1.0, 0.55}, - [CMD.RECLAIM] = {1.0, 0.2, 1.0, 0.55}, - [CMD.REPAIR] = {0.3, 1.0, 1.0, 0.55}, - [CMD.ATTACK] = {1.0, 0.2, 0.2, 0.55}, - [CMD.AREA_ATTACK] = {1.0, 0.2, 0.2, 0.55}, - [CMD.FIGHT] = {0.5, 0.5, 1.0, 0.55}, - [CMD.LOAD_UNITS] = {0.3, 1.0, 1.0, 0.55}, - [CMD.UNLOAD_UNITS] = {1.0, 1.0, 0.0, 0.55}, - [CMD.RESURRECT] = {0.2, 0.6, 1.0, 0.55}, - [CMD.RESTORE] = {0.0, 1.0, 0.0, 0.55}, + [CMD.MOVE] = { 0.5, 1.0, 0.5, 0.55 }, + [CMD.PATROL] = { 0.3, 0.3, 1.0, 0.55 }, + [CMD.RECLAIM] = { 1.0, 0.2, 1.0, 0.55 }, + [CMD.REPAIR] = { 0.3, 1.0, 1.0, 0.55 }, + [CMD.ATTACK] = { 1.0, 0.2, 0.2, 0.55 }, + [CMD.AREA_ATTACK] = { 1.0, 0.2, 0.2, 0.55 }, + [CMD.FIGHT] = { 0.5, 0.5, 1.0, 0.55 }, + [CMD.LOAD_UNITS] = { 0.3, 1.0, 1.0, 0.55 }, + [CMD.UNLOAD_UNITS] = { 1.0, 1.0, 0.0, 0.55 }, + [CMD.RESURRECT] = { 0.2, 0.6, 1.0, 0.55 }, + [CMD.RESTORE] = { 0.0, 1.0, 0.0, 0.55 }, } local cmdAreaBlockDragging = { - [CMD.RECLAIM] = true, - [CMD.REPAIR] = true, - [CMD.RESURRECT] = true, - [CMD.RESTORE] = true, - [CMD.CAPTURE] = true, - [CMD.ATTACK] = true, - [CMD.AREA_ATTACK] = true, - [CMD.LOAD_UNITS] = true, - [CMD.UNLOAD_UNITS] = true, + [CMD.RECLAIM] = true, + [CMD.REPAIR] = true, + [CMD.RESURRECT] = true, + [CMD.RESTORE] = true, + [CMD.CAPTURE] = true, + [CMD.ATTACK] = true, + [CMD.AREA_ATTACK] = true, + [CMD.LOAD_UNITS] = true, + [CMD.UNLOAD_UNITS] = true, [GameCMD.AREA_ATTACK_GROUND] = true, } @@ -63,7 +63,6 @@ local wayPtSelDist = 15 local wayPtSelDistSqr = wayPtSelDist * wayPtSelDist local selWayPtsTbl = {} - local function GetCommandColor(cmdID) if cmdColorsTbl[cmdID] ~= nil then return cmdColorsTbl[cmdID][1], cmdColorsTbl[cmdID][2], cmdColorsTbl[cmdID][3], cmdColorsTbl[cmdID][4] @@ -115,20 +114,20 @@ local function GetWayPointsNearCursor(wpTbl, mx, my) for i = 1, #selUnitsTbl do local unitID = selUnitsTbl[i] - local commands = spGetUnitCommands(unitID,20) + local commands = spGetUnitCommands(unitID, 20) if commands then for cmdNum = 1, #commands do - local curCmd = commands[cmdNum ] + local curCmd = commands[cmdNum] if cmdColorsTbl[curCmd.id] then - local nxtCmd = commands[cmdNum + 1] + local nxtCmd = commands[cmdNum + 1] local x, y, z, fr = GetCommandWorldPosition(curCmd) if x and y and z then - local p, q = spWorldToScreenCoords(x, y, z) - if GetSqDist2D(mx,my,p,q) < wayPtSelDistSqr then + local p, q = spWorldToScreenCoords(x, y, z) + if GetSqDist2D(mx, my, p, q) < wayPtSelDistSqr then -- save the tag of the next command local wpLink = (nxtCmd and nxtCmd.tag) or nil - local wpData = {x, y, z, fr, wpLink, curCmd, unitID} - local wpKey = tostring(unitID) .. "-" .. tostring(curCmd.tag) + local wpData = { x, y, z, fr, wpLink, curCmd, unitID } + local wpKey = tostring(unitID) .. "-" .. tostring(curCmd.tag) wpTbl[wpKey] = wpData numSelWayPts = numSelWayPts + 1 @@ -165,10 +164,10 @@ local function MoveWayPoints(wpTbl, mx, my, finalize) -- facing for build orders, -- radius for area orders local cmdFacRad = wpData[4] - local cmdLink = wpData[5] - local cmdID = wpData[6].id - local cmdPars = wpData[6].params - local cmdTag = wpData[6].tag + local cmdLink = wpData[5] + local cmdID = wpData[6].id + local cmdPars = wpData[6].params + local cmdTag = wpData[6].tag local cmdUnitID = wpData[7] if finalize then @@ -177,13 +176,13 @@ local function MoveWayPoints(wpTbl, mx, my, finalize) end if cmdFacRad > 0 then -- spGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdNum, cmdID, 0, cx, cy, cz, cmdFacRad}, {"alt"}) - spGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdLink, cmdID, 0, cx, cy, cz, cmdFacRad}, 0) + spGiveOrderToUnit(cmdUnitID, CMD.INSERT, { cmdLink, cmdID, 0, cx, cy, cz, cmdFacRad }, 0) else -- spGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdNum, cmdID, 0, cx, cy, cz}, {"alt"}) - spGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdLink, cmdID, 0, cx, cy, cz}, 0) + spGiveOrderToUnit(cmdUnitID, CMD.INSERT, { cmdLink, cmdID, 0, cx, cy, cz }, 0) end if not alt then - spGiveOrderToUnit(cmdUnitID, CMD.REMOVE, {cmdTag}, 0) + spGiveOrderToUnit(cmdUnitID, CMD.REMOVE, { cmdTag }, 0) end else wpData[1] = cx @@ -205,11 +204,11 @@ local function UpdateWayPoints(wpTbl) local badWayPtsTbl = {} for wpKey, wpData in pairs(wpTbl) do - local cmdTag = wpData[6].tag + local cmdTag = wpData[6].tag local cmdUnitID = wpData[7] - local cmdValid = false + local cmdValid = false - local unitCmds = spGetUnitCommands(cmdUnitID,20) + local unitCmds = spGetUnitCommands(cmdUnitID, 20) -- check if the command has not been completed -- since the MousePress() event occurred (tags @@ -219,7 +218,8 @@ local function UpdateWayPoints(wpTbl) if unitCmds then for unitCmdNum = 1, #unitCmds do if unitCmds[unitCmdNum].tag == cmdTag then - cmdValid = true; break + cmdValid = true + break end end end @@ -246,7 +246,7 @@ function widget:MousePress(mx, my, mb) -- 3. we pressed the LEFT mouse button (otherwise shift-move orders would break) -- 4. our mouse cursor is within "grabbing" radius of (at least) -- one waypoint of at least one of the units we have selected - local _, actCmdID, _, _ = spGetActiveCommand() + local _, actCmdID, _, _ = spGetActiveCommand() if actCmdID and actCmdID < 0 then return false end @@ -255,9 +255,13 @@ function widget:MousePress(mx, my, mb) return false end local _, _, _, shift = spGetModKeyState() - local numWayPts = 0 - if not shift then return false end - if mb ~= 1 then return false end + local numWayPts = 0 + if not shift then + return false + end + if mb ~= 1 then + return false + end numWayPts = GetWayPointsNearCursor(selWayPtsTbl, mx, my) if numWayPts == 0 then return false @@ -289,12 +293,12 @@ function widget:DrawWorld() return end for _, wpData in pairs(selWayPtsTbl) do - local cmd = wpData[6] - local nx, ny, nz = wpData[1], wpData[2], wpData[3] + local cmd = wpData[6] + local nx, ny, nz = wpData[1], wpData[2], wpData[3] local ox, oy, oz, _ = GetCommandWorldPosition(cmd) - local p, q = spWorldToScreenCoords(ox, oy, oz) - local d = GetSqDist2D(mx, my, p, q) - local r, g, b, a = GetCommandColor(cmd.id) + local p, q = spWorldToScreenCoords(ox, oy, oz) + local d = GetSqDist2D(mx, my, p, q) + local r, g, b, a = GetCommandColor(cmd.id) glColor(r, g, b, a) if d > (wayPtSelDist * wayPtSelDist) then @@ -304,12 +308,10 @@ function widget:DrawWorld() local pattern = (65536 - 775) local offset = floor((spGetGameSeconds() * 16) % 16) glLineStipple(2, pattern, -offset) - glBeginEnd(GL.LINES, - function() - glVertex(ox, oy, oz) - glVertex(nx, ny, nz) - end - ) + glBeginEnd(GL.LINES, function() + glVertex(ox, oy, oz) + glVertex(nx, ny, nz) + end) glLineStipple(false) end glColor(1.0, 1.0, 1.0, 1.0) diff --git a/luaui/Widgets/widget_selector.lua b/luaui/Widgets/widget_selector.lua index 68e7d54edc3..b57483f9c63 100644 --- a/luaui/Widgets/widget_selector.lua +++ b/luaui/Widgets/widget_selector.lua @@ -27,11 +27,10 @@ function widget:GetInfo() license = "GNU GPL, v2 or later", layer = 999999, handler = true, - enabled = true + enabled = true, } end - -- Localized functions for performance local mathFloor = math.floor local mathMax = math.max @@ -57,7 +56,6 @@ local WhiteStr = "\255\255\255\255" local sizeMultiplier = 1 - local buttons = {} local floor = mathFloor @@ -125,44 +123,44 @@ local widgetScale = (vsy / 1080) local allowuserwidgets = true if not Spring.GetModOptions().allowuserwidgets and not Spring.IsReplay() then allowuserwidgets = false - buttons[3] = '' + buttons[3] = "" end local buttonFontSize = 15 local buttonHeight = 24 local buttonTop = 40 -- offset between top of buttons and bottom of widget -local utf8 = VFS.Include('common/luaUtilities/utf8.lua') +local utf8 = VFS.Include("common/luaUtilities/utf8.lua") local textInputDlist local uiList local updateTextInputDlist = true local textCursorRect local showTextInput = true -local inputText = '' +local inputText = "" local inputTextPosition = 0 local cursorBlinkTimer = 0 local cursorBlinkDuration = 1 -local maxTextInputChars = 127 -- tested 127 as being the true max +local maxTextInputChars = 127 -- tested 127 as being the true max local inputTextInsertActive = false local floor = mathFloor -local inputMode = '' +local inputMode = "" local chobbyInterface function widget:RecvLuaMsg(msg, playerID) - if msg:sub(1, 18) == 'LobbyOverlayActive' then - chobbyInterface = (msg:sub(1, 19) == 'LobbyOverlayActive1') + if msg:sub(1, 18) == "LobbyOverlayActive" then + chobbyInterface = (msg:sub(1, 19) == "LobbyOverlayActive1") end end -function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it +function widget:TextInput(char) -- if it isnt working: chobby probably hijacked it if not chobbyInterface and not Spring.IsGUIHidden() and showTextInput and show then if inputTextInsertActive then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 2) if inputTextPosition <= utf8.len(inputText) then inputTextPosition = inputTextPosition + 1 end else - inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. char .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition + 1 end if string.len(inputText) > maxTextInputChars then @@ -173,8 +171,8 @@ function widget:TextInput(char) -- if it isnt working: chobby probably hijacked end cursorBlinkTimer = 0 updateTextInputDlist = true - if WG['limitidlefps'] and WG['limitidlefps'].update then - WG['limitidlefps'].update() + if WG["limitidlefps"] and WG["limitidlefps"].update then + WG["limitidlefps"].update() end UpdateList(true) return true @@ -183,12 +181,12 @@ end local function clearChatInput() --showTextInput = false - inputText = '' + inputText = "" inputTextPosition = 0 inputTextInsertActive = false --backgroundGuishader = gl.DeleteList(backgroundGuishader) - if WG['guishader'] then - WG['guishader'].RemoveRect('selectorinput') + if WG["guishader"] then + WG["guishader"].RemoveRect("selectorinput") end UpdateList(true) end @@ -196,16 +194,16 @@ end local function cancelChatInput() clearChatInput() Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() UpdateList(true) end function drawChatInputCursor() if textCursorRect then local a = 1 - (cursorBlinkTimer * (1 / cursorBlinkDuration)) + 0.15 - gl.Color(0.7,0.7,0.7,a) + gl.Color(0.7, 0.7, 0.7, a) gl.Rect(textCursorRect[1], textCursorRect[2], textCursorRect[3], textCursorRect[4]) - gl.Color(1,1,1,1) + gl.Color(1, 1, 1, 1) end end @@ -214,21 +212,21 @@ function drawChatInput() updateTextInputDlist = false textInputDlist = gl.DeleteList(textInputDlist) textInputDlist = gl.CreateList(function() - local activationArea = {floor(minx - (bgPadding * sizeMultiplier)), floor(miny - (bgPadding * sizeMultiplier)), floor(maxx + (bgPadding * sizeMultiplier)), floor(maxy + (bgPadding * sizeMultiplier))} + local activationArea = { floor(minx - (bgPadding * sizeMultiplier)), floor(miny - (bgPadding * sizeMultiplier)), floor(maxx + (bgPadding * sizeMultiplier)), floor(maxy + (bgPadding * sizeMultiplier)) } local usedFontSize = 15 * widgetScale local lineHeight = floor(usedFontSize * 1.15) - local x,y,_ = spGetMouseState() + local x, y, _ = spGetMouseState() local chatlogHeightDiff = 0 local inputFontSize = floor(usedFontSize * 1.03) local inputHeight = floor(inputFontSize * 2.15) - local leftOffset = floor(lineHeight*0.7) + local leftOffset = floor(lineHeight * 0.7) local distance = 0 --elementMargin - local usedFont = inputMode == '' and font3 or font - local modeText = Spring.I18N('ui.settings.filter') - if inputMode ~= '' then + local usedFont = inputMode == "" and font3 or font + local modeText = Spring.I18N("ui.settings.filter") + if inputMode ~= "" then modeText = inputMode end - local modeTextPosX = floor(activationArea[1]+elementPadding+elementPadding+leftOffset) + local modeTextPosX = floor(activationArea[1] + elementPadding + elementPadding + leftOffset) local textPosX = floor(modeTextPosX + (usedFont:GetTextWidth(modeText) * inputFontSize) + leftOffset + inputFontSize) local textCursorWidth = 1 + mathFloor(inputFontSize / 14) if inputTextInsertActive then @@ -237,35 +235,35 @@ function drawChatInput() local textCursorPos = floor(usedFont:GetTextWidth(utf8.sub(inputText, 1, inputTextPosition)) * inputFontSize) -- background - local x2 = mathMax(textPosX+lineHeight+floor(usedFont:GetTextWidth(inputText) * inputFontSize), floor(activationArea[1]+((activationArea[3]-activationArea[1])/2))) - chatInputArea = { activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance } - UiElement(chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4], 0,0,nil,nil, 0,nil,nil,nil, WG.FlowUI.clampedOpacity) + local x2 = mathMax(textPosX + lineHeight + floor(usedFont:GetTextWidth(inputText) * inputFontSize), floor(activationArea[1] + ((activationArea[3] - activationArea[1]) / 2))) + chatInputArea = { activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance } + UiElement(chatInputArea[1], chatInputArea[2], chatInputArea[3], chatInputArea[4], 0, 0, nil, nil, 0, nil, nil, nil, WG.FlowUI.clampedOpacity) - if WG['guishader'] and activeGuishader then - WG['guishader'].InsertRect(activationArea[1], activationArea[2]+chatlogHeightDiff-distance-inputHeight, x2, activationArea[2]+chatlogHeightDiff-distance, 'selectorinput') + if WG["guishader"] and activeGuishader then + WG["guishader"].InsertRect(activationArea[1], activationArea[2] + chatlogHeightDiff - distance - inputHeight, x2, activationArea[2] + chatlogHeightDiff - distance, "selectorinput") end -- button background - local inputButtonRect = {activationArea[1]+elementPadding, activationArea[2]+chatlogHeightDiff-distance-inputHeight+elementPadding, textPosX-inputFontSize, activationArea[2]+chatlogHeightDiff-distance} - if inputMode ~= '' then + local inputButtonRect = { activationArea[1] + elementPadding, activationArea[2] + chatlogHeightDiff - distance - inputHeight + elementPadding, textPosX - inputFontSize, activationArea[2] + chatlogHeightDiff - distance } + if inputMode ~= "" then gl.Color(0.03, 0.12, 0.03, 0.3) else gl.Color(0, 0, 0, 0.3) end - RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner*0.6, 0,0,0,1) - gl.Color(1,1,1,0.033) - gl.Rect(inputButtonRect[3]-1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) + RectRound(inputButtonRect[1], inputButtonRect[2], inputButtonRect[3], inputButtonRect[4], elementCorner * 0.6, 0, 0, 0, 1) + gl.Color(1, 1, 1, 0.033) + gl.Rect(inputButtonRect[3] - 1, inputButtonRect[2], inputButtonRect[3], inputButtonRect[4]) -- button text usedFont:Begin() usedFont:SetTextColor(0.62, 0.62, 0.62, 1) - usedFont:Print(modeText, modeTextPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:Print(modeText, modeTextPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") -- text cursor - textCursorRect = { textPosX + textCursorPos, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)-(inputFontSize*0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.5)+(inputFontSize*0.64) } + textCursorRect = { textPosX + textCursorPos, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) - (inputFontSize * 0.6), textPosX + textCursorPos + textCursorWidth, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.5) + (inputFontSize * 0.64) } usedFont:SetTextColor(0.95, 0.95, 0.95, 1) - usedFont:Print(inputText, textPosX, activationArea[2]+chatlogHeightDiff-distance-(inputHeight*0.61), inputFontSize, "o") + usedFont:Print(inputText, textPosX, activationArea[2] + chatlogHeightDiff - distance - (inputHeight * 0.61), inputFontSize, "o") usedFont:End() end) end @@ -273,7 +271,6 @@ end ------------------------------------------------------------------------------- - local function UpdateGeometry() midx = vsx * 0.5 midy = vsy * 0.5 @@ -317,12 +314,12 @@ end local function widgetselectorCmd(_, _, params) show = not show if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! Spring.SetConfigInt("widgetselector", 1) else Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() end end @@ -344,62 +341,60 @@ local function userwidgetsCmd(_, _, params) end function widget:Initialize() - buttons = { --see MouseRelease for which functions are called by which buttons - [1] = Spring.I18N('ui.widgetselector.button_reloadluaui'), - [2] = Spring.I18N('ui.widgetselector.button_unloadallwidgets'), - [3] = Spring.I18N('ui.widgetselector.button_disallowuserwidgets'), - [4] = Spring.I18N('ui.widgetselector.button_resetluaui'), - [5] = Spring.I18N('ui.widgetselector.button_factoryresetluaui'), + [1] = Spring.I18N("ui.widgetselector.button_reloadluaui"), + [2] = Spring.I18N("ui.widgetselector.button_unloadallwidgets"), + [3] = Spring.I18N("ui.widgetselector.button_disallowuserwidgets"), + [4] = Spring.I18N("ui.widgetselector.button_resetluaui"), + [5] = Spring.I18N("ui.widgetselector.button_factoryresetluaui"), } if not allowuserwidgets then - buttons[3] = '' + buttons[3] = "" else if widgetHandler.allowUserWidgets then - buttons[3] = Spring.I18N('ui.widgetselector.button_disallowuserwidgets') + buttons[3] = Spring.I18N("ui.widgetselector.button_disallowuserwidgets") else - buttons[3] = Spring.I18N('ui.widgetselector.button_allowuserwidgets') + buttons[3] = Spring.I18N("ui.widgetselector.button_allowuserwidgets") end end widgetHandler.knownChanged = true - Spring.SendCommands('unbindkeyset f11') + Spring.SendCommands("unbindkeyset f11") - WG['widgetselector'] = {} - WG['widgetselector'].toggle = function(state) + WG["widgetselector"] = {} + WG["widgetselector"].toggle = function(state) local newShow = state if newShow == nil then newShow = not show end - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! Spring.SetConfigInt("widgetselector", 1) else Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() end end - WG['widgetselector'].isvisible = function() + WG["widgetselector"].isvisible = function() return show end - WG['widgetselector'].getLocalWidgetCount = function() + WG["widgetselector"].getLocalWidgetCount = function() return localWidgetCount end widget:ViewResize(spGetViewGeometry()) UpdateList() - widgetHandler.actionHandler:AddAction(self, "widgetselector", widgetselectorCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "factoryreset", factoryresetCmd, nil, 't') - widgetHandler.actionHandler:AddAction(self, "userwidgets", userwidgetsCmd, nil, 't') + widgetHandler.actionHandler:AddAction(self, "widgetselector", widgetselectorCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "factoryreset", factoryresetCmd, nil, "t") + widgetHandler.actionHandler:AddAction(self, "userwidgets", userwidgetsCmd, nil, "t") end - local function ScrollUp(step) startEntry = startEntry - step UpdateListScroll() @@ -417,7 +412,7 @@ function widget:MouseWheel(up, value) local a, c, m, s = Spring.GetModKeyState() if a or m then - return false -- alt and meta allow normal control + return false -- alt and meta allow normal control end local step = (s and 4) or (c and 1) or 2 if up then @@ -436,8 +431,12 @@ local function fuzzyScore(query, target) local qi = 1 local qlen = #query local tlen = #target - if qlen == 0 then return 0 end - if qlen > tlen then return 0 end + if qlen == 0 then + return 0 + end + if qlen > tlen then + return 0 + end local score = 0 local consecutive = 0 @@ -446,11 +445,15 @@ local function fuzzyScore(query, target) local lastMatchPos = 0 for ti = 1, tlen do - if qi > qlen then break end + if qi > qlen then + break + end local tc = string.byte(target, ti) local qc = string.byte(query, qi) if tc == qc then - if not firstMatchPos then firstMatchPos = ti end + if not firstMatchPos then + firstMatchPos = ti + end qi = qi + 1 -- Gap penalty if lastMatchPos > 0 then @@ -506,7 +509,7 @@ local function SortWidgetListFunc(nd1, nd2) end -- mod widgets first, then user widgets - if (nd1[2].fromZip ~= nd2[2].fromZip) then + if nd1[2].fromZip ~= nd2[2].fromZip then return nd1[2].fromZip end @@ -524,7 +527,7 @@ function UpdateList(force) --maxWidth = 0 widgetsList = {} fullWidgetsList = {} - local lowerInput = inputText and inputText ~= '' and string.lower(inputText) or nil + local lowerInput = inputText and inputText ~= "" and string.lower(inputText) or nil local queryWords, queryNoSpaces if lowerInput then queryWords = {} @@ -535,18 +538,18 @@ function UpdateList(force) end local scoredList = lowerInput and {} or nil for name, data in pairs(widgetHandler.knownWidgets) do - if name ~= myName and name ~= 'Write customparam.__def to files' then + if name ~= myName and name ~= "Write customparam.__def to files" then if not lowerInput then - fullWidgetsList[#fullWidgetsList+1] = { name, data } + fullWidgetsList[#fullWidgetsList + 1] = { name, data } local width = fontSize * font:GetTextWidth(name) if width > maxWidth then maxWidth = width end else local lowerName = string.lower(name) - local lowerDesc = data.desc and string.lower(data.desc) or '' - local lowerBase = data.basename and string.lower(data.basename) or '' - local lowerAuthor = data.author and string.lower(data.author) or '' + local lowerDesc = data.desc and string.lower(data.desc) or "" + local lowerBase = data.basename and string.lower(data.basename) or "" + local lowerAuthor = data.author and string.lower(data.author) or "" local score = 0 -- Tier 1: Exact substring in name (score 300+) @@ -625,11 +628,11 @@ function UpdateList(force) end end - if force and WG['guishader']then + if force and WG["guishader"] then activeGuishader = false - WG['guishader'].RemoveDlist('widgetselector') - WG['guishader'].RemoveDlist('widgetselector2') - WG['guishader'].RemoveRect('selectorinput') + WG["guishader"].RemoveDlist("widgetselector") + WG["guishader"].RemoveDlist("widgetselector2") + WG["guishader"].RemoveRect("selectorinput") if textInputDlist then textInputDlist = gl.DeleteList(textInputDlist) end @@ -667,24 +670,24 @@ end function widget:KeyPress(key, mods, isRepeat) if show and key == KEYSYMS.ESCAPE or (key == KEYSYMS.F11 and not isRepeat and not (mods.alt or mods.ctrl or mods.meta or mods.shift)) then - if key == KEYSYMS.ESCAPE and inputText and inputText ~= '' then + if key == KEYSYMS.ESCAPE and inputText and inputText ~= "" then clearChatInput() else local newShow = not show - if newShow and WG['topbar'] then - WG['topbar'].hideWindows() + if newShow and WG["topbar"] then + WG["topbar"].hideWindows() end show = newShow if show and not (Spring.Utilities.IsDevMode() or Spring.Utilities.ShowDevUI() or Spring.GetConfigInt("widgetselector", 0) == 1 or localWidgetCount > 0) then show = false end if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! Spring.SetConfigInt("widgetselector", 1) else Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() end end return true @@ -699,9 +702,11 @@ function widget:KeyPress(key, mods, isRepeat) end --return false - if not show then return false end + if not show then + return false + end - if key >= 282 and key <= 293 then -- Function keys + if key >= 282 and key <= 293 then -- Function keys return false end @@ -710,18 +715,18 @@ function widget:KeyPress(key, mods, isRepeat) clearChatInput() elseif key == 8 then -- BACKSPACE if inputTextPosition > 0 then - inputText = utf8.sub(inputText, 1, inputTextPosition-1) .. utf8.sub(inputText, inputTextPosition+1) + inputText = utf8.sub(inputText, 1, inputTextPosition - 1) .. utf8.sub(inputText, inputTextPosition + 1) inputTextPosition = inputTextPosition - 1 end cursorBlinkTimer = 0 - if inputText == '' then + if inputText == "" then clearChatInput() else UpdateList(true) end elseif key == 127 then -- DELETE if inputTextPosition < utf8.len(inputText) then - inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition+2) + inputText = utf8.sub(inputText, 1, inputTextPosition) .. utf8.sub(inputText, inputTextPosition + 2) end cursorBlinkTimer = 0 UpdateList(true) @@ -746,11 +751,8 @@ function widget:KeyPress(key, mods, isRepeat) inputTextPosition = utf8.len(inputText) cursorBlinkTimer = 0 elseif key == 273 then -- UP - elseif key == 274 then -- DOWN - elseif key == 9 then -- TAB - else -- regular chars/keys handled in widget:TextInput end @@ -760,18 +762,22 @@ function widget:KeyPress(key, mods, isRepeat) end function widget:Update(dt) - if not show then return end + if not show then + return + end cursorBlinkTimer = cursorBlinkTimer + dt - if cursorBlinkTimer > cursorBlinkDuration then cursorBlinkTimer = 0 end + if cursorBlinkTimer > cursorBlinkDuration then + cursorBlinkTimer = 0 + end end function widget:DrawScreen() if not show then - if WG['guishader'] and activeGuishader then + if WG["guishader"] and activeGuishader then activeGuishader = false - WG['guishader'].RemoveDlist('widgetselector') - WG['guishader'].RemoveDlist('widgetselector2') - WG['guishader'].RemoveRect('selectorinput') + WG["guishader"].RemoveDlist("widgetselector") + WG["guishader"].RemoveDlist("widgetselector2") + WG["guishader"].RemoveRect("selectorinput") if textInputDlist then textInputDlist = gl.DeleteList(textInputDlist) end @@ -779,7 +785,7 @@ function widget:DrawScreen() return end - if not WG['guishader'] then + if not WG["guishader"] then activeGuishader = false end @@ -801,9 +807,9 @@ function widget:DrawScreen() if updateUi then updateTextInputDlist = true - local title = Spring.I18N('ui.widgetselector.title') + local title = Spring.I18N("ui.widgetselector.title") local titleFontSize = 18 * widgetScale - titleRect = { backgroundRect[1], backgroundRect[4], mathFloor(backgroundRect[1] + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize*1.5)), mathFloor(backgroundRect[4] + (titleFontSize*1.7)) } + titleRect = { backgroundRect[1], backgroundRect[4], mathFloor(backgroundRect[1] + (font2:GetTextWidth(title) * titleFontSize) + (titleFontSize * 1.5)), mathFloor(backgroundRect[4] + (titleFontSize * 1.7)) } dlistGuishader = gl.DeleteList(dlistGuishader) dlistGuishader = gl.CreateList(function() RectRound(floor(minx - (bgPadding * sizeMultiplier)), floor(miny - (bgPadding * sizeMultiplier)), floor(maxx + (bgPadding * sizeMultiplier)), floor(maxy + (bgPadding * sizeMultiplier)), 6 * sizeMultiplier) @@ -815,7 +821,7 @@ function widget:DrawScreen() uiList = gl.DeleteList(uiList) uiList = gl.CreateList(function() - UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], 0, 1, 1, 0, 1,1,1,1, WG.FlowUI.clampedOpacity) + UiElement(backgroundRect[1], backgroundRect[2], backgroundRect[3], backgroundRect[4], 0, 1, 1, 0, 1, 1, 1, 1, WG.FlowUI.clampedOpacity) -- title background gl.Color(0, 0, 0, WG.FlowUI.clampedOpacity) @@ -825,16 +831,16 @@ function widget:DrawScreen() font2:Begin() font2:SetTextColor(1, 1, 1, 1) font2:SetOutlineColor(0, 0, 0, 0.4) - font2:Print(title, backgroundRect[1] + (titleFontSize * 0.75), backgroundRect[4] + (8*widgetScale), titleFontSize, "on") + font2:Print(title, backgroundRect[1] + (titleFontSize * 0.75), backgroundRect[4] + (8 * widgetScale), titleFontSize, "on") font2:End() end) end - if WG['guishader'] and not activeGuishader then + if WG["guishader"] and not activeGuishader then activeGuishader = true if dlistGuishader then - WG['guishader'].InsertDlist(dlistGuishader, 'widgetselector') - WG['guishader'].InsertDlist(dlistGuishader2, 'widgetselector2') + WG["guishader"].InsertDlist(dlistGuishader, "widgetselector") + WG["guishader"].InsertDlist(dlistGuishader2, "widgetselector2") end end @@ -863,17 +869,16 @@ function widget:DrawScreen() local prevFromZip = true local customWidgetPosy for _, namedata in ipairs(widgetsList) do - local name = namedata[1] local data = namedata[2] if prevFromZip ~= data.fromZip then customWidgetPosy = posy font2:SetTextColor(0.5, 0.5, 0.5, 0.4) - font2:Print(Spring.I18N('ui.widgetselector.islocal'), minx + fontSize * sizeMultiplier * 0.25, posy + (fontSize * sizeMultiplier) * 0.33, fontSize * sizeMultiplier, "") + font2:Print(Spring.I18N("ui.widgetselector.islocal"), minx + fontSize * sizeMultiplier * 0.25, posy + (fontSize * sizeMultiplier) * 0.33, fontSize * sizeMultiplier, "") end - local color = '' + local color = "" local pointed = (pointedName == name) local order = widgetHandler.orderList[name] local enabled = order and (order > 0) @@ -883,10 +888,10 @@ function widget:DrawScreen() if not pagestepped and (lmb or mmb or rmb) then color = WhiteStr else - color = (active and '\255\128\255\128') or (enabled and '\255\255\255\128') or '\255\255\128\128' + color = (active and "\255\128\255\128") or (enabled and "\255\255\255\128") or "\255\255\128\128" end else - color = (active and '\255\064\224\064') or (enabled and '\255\200\200\064') or '\255\224\064\064' + color = (active and "\255\064\224\064") or (enabled and "\255\200\200\064") or "\255\224\064\064" end prevFromZip = data.fromZip font:Print(color .. name, midx, posy + (fontSize * sizeMultiplier) * 0.5, fontSize * sizeMultiplier, "vc") @@ -894,9 +899,9 @@ function widget:DrawScreen() end if customWidgetPosy then gl.Color(1, 1, 1, 0.07) - RectRound(backgroundRect[1]+elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85), backgroundRect[3]-elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85)-1, 0, 0,0,0,0) + RectRound(backgroundRect[1] + elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85), backgroundRect[3] - elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85) - 1, 0, 0, 0, 0, 0) gl.Color(1, 1, 1, 0.035) - RectRound(backgroundRect[1]+elementPadding, backgroundRect[2]+elementPadding, backgroundRect[3]-elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85), elementPadding, 0,0,1,0) + RectRound(backgroundRect[1] + elementPadding, backgroundRect[2] + elementPadding, backgroundRect[3] - elementPadding, customWidgetPosy + mathFloor(yStep * sizeMultiplier * 0.85), elementPadding, 0, 0, 1, 0) end -- scrollbar @@ -905,12 +910,7 @@ function widget:DrawScreen() sbheight = sby1 - sby2 sbsize = sbheight * #widgetsList / #fullWidgetsList if activescrollbar then - startEntry = mathMax(0, mathMin( - floor(#fullWidgetsList * - ((sby1 - sbsize) - - (my - mathMin(scrollbargrabpos, sbsize))) - / sbheight + 0.5), - #fullWidgetsList - curMaxEntries)) + 1 + startEntry = mathMax(0, mathMin(floor(#fullWidgetsList * ((sby1 - sbsize) - (my - mathMin(scrollbargrabpos, sbsize))) / sbheight + 0.5), #fullWidgetsList - curMaxEntries)) + 1 end local sizex = maxx - minx sbposx = minx + sizex + 1.0 + (scrollbarOffset * widgetScale) @@ -926,7 +926,7 @@ function widget:DrawScreen() end -- scroller - if (sbposx < mx and mx < sbposx + sbsizex and sby2 < my and my < sby2 + sbheight) then + if sbposx < mx and mx < sbposx + sbsizex and sby2 < my and my < sby2 + sbheight then gl.Color(1, 1, 1, 0.1) gl.Blending(GL.SRC_ALPHA, GL.ONE) RectRound(sbposx + scrollerPadding, sbposy, sbposx + sbsizex - scrollerPadding, sbposy + sbsizey, 1.75 * sizeMultiplier) @@ -943,7 +943,6 @@ function widget:DrawScreen() -- highlight label if (sbposx < mx and mx < sbposx + sbsizex and miny < my and my < maxy) or activescrollbar then - else if pointedY then local xn = minx + 0.5 @@ -982,45 +981,45 @@ function widget:DrawScreen() for i, name in ipairs(buttons) do tcol = WhiteStr if minx < mx and mx < maxx and miny - (buttonTop * sizeMultiplier) - i * (buttonHeight * sizeMultiplier) < my and my < miny - (buttonTop * sizeMultiplier) - (i - 1) * (buttonHeight * sizeMultiplier) then - tcol = '\255\031\031\031' + tcol = "\255\031\031\031" end font:Print(tcol .. buttons[i], (minx + maxx) / 2, miny - (buttonTop * sizeMultiplier) - (i * (buttonHeight * sizeMultiplier)), buttonFontSize * sizeMultiplier, "oc") end font:End() end - if WG['tooltip'] ~= nil then + if WG["tooltip"] ~= nil then if aboveWidget then local n = aboveWidget[1] local d = aboveWidget[2] --local tt = (d.active and GreenStr) or (enabled and YellowStr) or RedStr - local tooltipTitle = '' + local tooltipTitle = "" local order = widgetHandler.orderList[n] if order then if order >= 1 then if not d.active then - tooltipTitle = '\255\255\240\160'..n..'\n' + tooltipTitle = "\255\255\240\160" .. n .. "\n" else - tooltipTitle = '\255\130\255\160'..n..'\n' + tooltipTitle = "\255\130\255\160" .. n .. "\n" end else - tooltipTitle = '\255\255\160\160'..n..'\n' + tooltipTitle = "\255\255\160\160" .. n .. "\n" end end - local tooltip = '' - local maxWidth = WG['tooltip'].getFontsize() * 90 - if d.desc and d.desc ~= '' then + local tooltip = "" + local maxWidth = WG["tooltip"].getFontsize() * 90 + if d.desc and d.desc ~= "" then local textLines, numLines = font:WrapText(d.desc, maxWidth) - tooltip = tooltip..WhiteStr..string.gsub(textLines, '[\n]', '\n'..WhiteStr)..'\n' + tooltip = tooltip .. WhiteStr .. string.gsub(textLines, "[\n]", "\n" .. WhiteStr) .. "\n" end - if d.author and d.author ~= '' then + if d.author and d.author ~= "" then local textLines, numLines = font:WrapText(d.author, maxWidth) - tooltip = tooltip.."\255\175\175\175" .. Spring.I18N('ui.widgetselector.author')..': ' ..string.gsub(textLines, '[\n]', "\n\255\175\175\175")..'\n' + tooltip = tooltip .. "\255\175\175\175" .. Spring.I18N("ui.widgetselector.author") .. ": " .. string.gsub(textLines, "[\n]", "\n\255\175\175\175") .. "\n" end - tooltip = tooltip .."\255\175\175\175".. Spring.I18N('ui.widgetselector.file')..': ' ..d.basename .. (not d.fromZip and ' ('..Spring.I18N('ui.widgetselector.islocal')..')' or '') - if WG['tooltip'] then - WG['tooltip'].ShowTooltip('info', tooltip, nil, nil, tooltipTitle) + tooltip = tooltip .. "\255\175\175\175" .. Spring.I18N("ui.widgetselector.file") .. ": " .. d.basename .. (not d.fromZip and " (" .. Spring.I18N("ui.widgetselector.islocal") .. ")" or "") + if WG["tooltip"] then + WG["tooltip"].ShowTooltip("info", tooltip, nil, nil, tooltipTitle) end end end @@ -1031,8 +1030,8 @@ function widget:DrawScreen() if showTextInput and textInputDlist then gl.CallList(textInputDlist) drawChatInputCursor() - elseif WG['guishader'] then - WG['guishader'].RemoveRect('selectorinput') + elseif WG["guishader"] then + WG["guishader"].RemoveRect("selectorinput") textInputDlist = gl.DeleteList(textInputDlist) end @@ -1104,15 +1103,14 @@ function widget:MousePress(x, y, button) else show = false Spring.SDLStopTextInput() - widgetHandler.textOwner = nil --widgetHandler:DisownText() + widgetHandler.textOwner = nil --widgetHandler:DisownText() return false end end function widget:MouseMove(x, y, dx, dy, button) if show and activescrollbar then - startEntry = mathMax(0, mathMin(floor((#fullWidgetsList * ((sby1 - sbsize) - (y - mathMin(scrollbargrabpos, sbsize))) / sbheight) + 0.5), - #fullWidgetsList - curMaxEntries)) + 1 + startEntry = mathMax(0, mathMin(floor((#fullWidgetsList * ((sby1 - sbsize) - (y - mathMin(scrollbargrabpos, sbsize))) / sbheight) + 0.5), #fullWidgetsList - curMaxEntries)) + 1 UpdateListScroll() return true end @@ -1216,10 +1214,10 @@ function widget:MouseRelease(x, y, mb) end if mb == 2 then widgetHandler:LowerWidget(w) - spEcho('widgetHandler:LowerWidget') + spEcho("widgetHandler:LowerWidget") else widgetHandler:RaiseWidget(w) - spEcho('widgetHandler:RaiseWidget') + spEcho("widgetHandler:RaiseWidget") end widgetHandler:SaveConfigData() end @@ -1227,8 +1225,7 @@ function widget:MouseRelease(x, y, mb) end function aboveLabel(x, y) - if x < minx or y < (miny + bordery) or - x > maxx or y > (maxy - bordery) then + if x < minx or y < (miny + bordery) or x > maxx or y > (maxy - bordery) then return nil end local count = #widgetsList @@ -1246,7 +1243,6 @@ function aboveLabel(x, y) return widgetsList[i] end - function widget:GetConfigData() local data = { startEntry = startEntry, show = show } return data @@ -1256,17 +1252,17 @@ function widget:SetConfigData(data) startEntry = data.startEntry or startEntry show = data.show or show if show then - widgetHandler.textOwner = self --widgetHandler:OwnText() - Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! + widgetHandler.textOwner = self --widgetHandler:OwnText() + Spring.SDLStartTextInput() -- because: touch chobby's text edit field once and widget:TextInput is gone for the game, so we make sure its started! end end function widget:Shutdown() - Spring.SendCommands('bind f11 luaui selector') -- if this one is removed or crashes, then have the backup one take over. + Spring.SendCommands("bind f11 luaui selector") -- if this one is removed or crashes, then have the backup one take over. cancelChatInput() - if WG['guishader'] then - WG['guishader'].DeleteDlist('widgetselector') - WG['guishader'].DeleteDlist('widgetselector2') + if WG["guishader"] then + WG["guishader"].DeleteDlist("widgetselector") + WG["guishader"].DeleteDlist("widgetselector2") end uiList = gl.DeleteList(uiList) uiList2 = gl.DeleteList(uiList2) diff --git a/luaui/actions.lua b/luaui/actions.lua index 21dd0d54921..4cc8d163742 100644 --- a/luaui/actions.lua +++ b/luaui/actions.lua @@ -12,25 +12,25 @@ -------------------------------------------------------------------------------- local actionHandler = { - textActions = {}, - keyPressActions = {}, - keyRepeatActions = {}, - keyReleaseActions = {}, - syncActions = {} + textActions = {}, + keyPressActions = {}, + keyRepeatActions = {}, + keyReleaseActions = {}, + syncActions = {}, } -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function ParseTypes(types, def) - if (type(types) ~= "string") then - types = def - end - local text = (string.find(types, "t") ~= nil) - local keyPress = (string.find(types, "p") ~= nil) - local keyRepeat = (string.find(types, "R") ~= nil) - local keyRelease = (string.find(types, "r") ~= nil) - return text, keyPress, keyRepeat, keyRelease + if type(types) ~= "string" then + types = def + end + local text = (string.find(types, "t") ~= nil) + local keyPress = (string.find(types, "p") ~= nil) + local keyRepeat = (string.find(types, "R") ~= nil) + local keyRelease = (string.find(types, "r") ~= nil) + return text, keyPress, keyRepeat, keyRelease end -------------------------------------------------------------------------------- @@ -40,67 +40,70 @@ end -- local function InsertCallInfo(callInfoList, widget, func, data) - local layer = widget.whInfo.layer - local index = 1 - for i,ci in ipairs(callInfoList) do - local w = ci[1] - if (w == widget) then - return false -- already in the table - end - if (layer >= w.whInfo.layer) then - index = i + 1 - end - end - table.insert(callInfoList, index, { widget, func, data }) - return true + local layer = widget.whInfo.layer + local index = 1 + for i, ci in ipairs(callInfoList) do + local w = ci[1] + if w == widget then + return false -- already in the table + end + if layer >= w.whInfo.layer then + index = i + 1 + end + end + table.insert(callInfoList, index, { widget, func, data }) + return true end - function actionHandler:AddAction(widget, cmd, func, data, types) - local function add(actionMap) - local callInfoList = actionMap[cmd] - if (callInfoList == nil) then - callInfoList = {} - actionMap[cmd] = callInfoList - end - return InsertCallInfo(callInfoList, widget, func, data) - end - - -- make sure that this is a fully initialized widget - if (not widget.whInfo) then - error("LuaUI error adding action: please use widget:Initialize()") - end - - -- default to text and keyPress (not repeat or releases) - local text, keyPress, keyRepeat, keyRelease = ParseTypes(types, "tp") - - local tSuccess, pSuccess, RSuccess, rSuccess = false, false, false, false - - if (text) then tSuccess = add(self.textActions) end - if (keyPress) then pSuccess = add(self.keyPressActions) end - if (keyRepeat) then RSuccess = add(self.keyRepeatActions) end - if (keyRelease) then rSuccess = add(self.keyReleaseActions) end - - return tSuccess, pSuccess, RSuccess, rSuccess + local function add(actionMap) + local callInfoList = actionMap[cmd] + if callInfoList == nil then + callInfoList = {} + actionMap[cmd] = callInfoList + end + return InsertCallInfo(callInfoList, widget, func, data) + end + + -- make sure that this is a fully initialized widget + if not widget.whInfo then + error("LuaUI error adding action: please use widget:Initialize()") + end + + -- default to text and keyPress (not repeat or releases) + local text, keyPress, keyRepeat, keyRelease = ParseTypes(types, "tp") + + local tSuccess, pSuccess, RSuccess, rSuccess = false, false, false, false + + if text then + tSuccess = add(self.textActions) + end + if keyPress then + pSuccess = add(self.keyPressActions) + end + if keyRepeat then + RSuccess = add(self.keyRepeatActions) + end + if keyRelease then + rSuccess = add(self.keyReleaseActions) + end + + return tSuccess, pSuccess, RSuccess, rSuccess end - local function AddMapAction(map, widget, cmd, func, data) - local callInfoList = map[cmd] - if (callInfoList == nil) then - callInfoList = {} - map[cmd] = callInfoList - end - return InsertCallInfo(callInfoList, widget, func, data) + local callInfoList = map[cmd] + if callInfoList == nil then + callInfoList = {} + map[cmd] = callInfoList + end + return InsertCallInfo(callInfoList, widget, func, data) end - function actionHandler:AddSyncAction(widget, cmd, func, data) - return AddMapAction(self.syncActions, widget, cmd, func, data) + return AddMapAction(self.syncActions, widget, cmd, func, data) end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -108,176 +111,178 @@ end -- local function RemoveCallInfo(callInfoList, widget) - local count = 0 - for i,callInfo in ipairs(callInfoList) do - local w = callInfo[1] - if (w == widget) then - table.remove(callInfoList, i) - count = count + 1 - -- break - end - end - return count + local count = 0 + for i, callInfo in ipairs(callInfoList) do + local w = callInfo[1] + if w == widget then + table.remove(callInfoList, i) + count = count + 1 + -- break + end + end + return count end - function actionHandler:RemoveAction(widget, cmd, types) - local function remove(actionMap) - local callInfoList = actionMap[cmd] - if (callInfoList == nil) then - return false - end - local count = RemoveCallInfo(callInfoList, widget) - if (#callInfoList <= 0) then - actionMap[cmd] = nil - end - return (count > 0) - end - - -- default to removing all - local text, keyPress, keyRepeat, keyRelease = ParseTypes(types, "tpRr") - - local tSuccess, pSuccess, RSuccess, rSuccess = false, false, false, false - - if (text) then tSuccess = remove(self.textActions) end - if (keyPress) then pSuccess = remove(self.keyPressActions) end - if (keyRepeat) then RSuccess = remove(self.keyRepeatActions) end - if (keyRelease) then rSuccess = remove(self.keyReleaseActions) end - - return tSuccess, pSuccess, RSuccess, rSuccess + local function remove(actionMap) + local callInfoList = actionMap[cmd] + if callInfoList == nil then + return false + end + local count = RemoveCallInfo(callInfoList, widget) + if #callInfoList <= 0 then + actionMap[cmd] = nil + end + return (count > 0) + end + + -- default to removing all + local text, keyPress, keyRepeat, keyRelease = ParseTypes(types, "tpRr") + + local tSuccess, pSuccess, RSuccess, rSuccess = false, false, false, false + + if text then + tSuccess = remove(self.textActions) + end + if keyPress then + pSuccess = remove(self.keyPressActions) + end + if keyRepeat then + RSuccess = remove(self.keyRepeatActions) + end + if keyRelease then + rSuccess = remove(self.keyReleaseActions) + end + + return tSuccess, pSuccess, RSuccess, rSuccess end - local function RemoveMapAction(map, widget, cmd) - local callInfoList = map[cmd] - if (callInfoList == nil) then - return false - end - local count = RemoveCallInfo(callInfoList, widget) - if (#callInfoList <= 0) then - map[cmd] = nil - end - return (count > 0) + local callInfoList = map[cmd] + if callInfoList == nil then + return false + end + local count = RemoveCallInfo(callInfoList, widget) + if #callInfoList <= 0 then + map[cmd] = nil + end + return (count > 0) end - function actionHandler:RemoveSyncAction(widget, cmd) - return RemoveMapAction(self.syncActions, widget, cmd) + return RemoveMapAction(self.syncActions, widget, cmd) end - function actionHandler:RemoveWidgetActions(widget) - local function clearActionList(actionMap) - for _, callInfoList in pairs(actionMap) do - RemoveCallInfo(callInfoList, widget) - end - end - clearActionList(self.textActions) - clearActionList(self.keyPressActions) - clearActionList(self.keyRepeatActions) - clearActionList(self.keyReleaseActions) + local function clearActionList(actionMap) + for _, callInfoList in pairs(actionMap) do + RemoveCallInfo(callInfoList, widget) + end + end + clearActionList(self.textActions) + clearActionList(self.keyPressActions) + clearActionList(self.keyRepeatActions) + clearActionList(self.keyReleaseActions) end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Calls -- - local function TryAction(actionMap, cmd, optLine, optWords, isRepeat, release, actions) - local callInfoList = actionMap[cmd] - if (callInfoList == nil) then - return false - end - for _, callInfo in ipairs(callInfoList) do - --local widget = callInfo[1] - local func = callInfo[2] - local data = callInfo[3] - if (func(cmd, optLine, optWords, data, isRepeat, release, actions)) then - return true - end - end - return false + local callInfoList = actionMap[cmd] + if callInfoList == nil then + return false + end + for _, callInfo in ipairs(callInfoList) do + --local widget = callInfo[1] + local func = callInfo[2] + local data = callInfo[3] + if func(cmd, optLine, optWords, data, isRepeat, release, actions) then + return true + end + end + return false end - function actionHandler:KeyAction(press, _, _, isRepeat, _, actions) - if (not(actions and next(actions))) then return false end - - local actionSet - if (press) then - actionSet = isRepeat and self.keyRepeatActions or self.keyPressActions - else - actionSet = self.keyReleaseActions - end - - for _, bAction in ipairs(actions) do - local cmd = bAction["command"] - local extra = bAction["extra"] - local words = string.split(extra) - - if (TryAction(actionSet, cmd, extra, words, isRepeat, not press, actions)) then - return true - end - end - - return false + if not (actions and next(actions)) then + return false + end + + local actionSet + if press then + actionSet = isRepeat and self.keyRepeatActions or self.keyPressActions + else + actionSet = self.keyReleaseActions + end + + for _, bAction in ipairs(actions) do + local cmd = bAction["command"] + local extra = bAction["extra"] + local words = string.split(extra) + + if TryAction(actionSet, cmd, extra, words, isRepeat, not press, actions) then + return true + end + end + + return false end - function actionHandler:TextAction(line) - local words = string.split(line) - local cmd = words[1] - if (cmd == nil) then - return false - end - -- remove the command from the words list and the raw line - table.remove(words, 1) - _,_,line = string.find(line, "[^%s]+[%s]+(.*)") - if (line == nil) then - line = "" -- no args - end - return TryAction(self.textActions, cmd, line, words, false, nil) + local words = string.split(line) + local cmd = words[1] + if cmd == nil then + return false + end + -- remove the command from the words list and the raw line + table.remove(words, 1) + _, _, line = string.find(line, "[^%s]+[%s]+(.*)") + if line == nil then + line = "" -- no args + end + return TryAction(self.textActions, cmd, line, words, false, nil) end - function actionHandler:RecvFromSynced(...) - local arg1, arg2 = ... - if (type(arg1) == 'string') then - -- a raw sync msg - local callInfoList = self.syncActions[arg1] - if (callInfoList == nil) then - return false - end - - for _,callInfo in ipairs(callInfoList) do - -- local widget = callInfo[1] - local func = callInfo[2] - if (func(...)) then - return true - end - end - return false - end - - if (type(arg1) == 'number') then - -- a proxied chat msg - if (type(arg2) == 'string') then - return GotChatMsg(arg2, arg1) - end - return false - end - - return false -- unknown type + local arg1, arg2 = ... + if type(arg1) == "string" then + -- a raw sync msg + local callInfoList = self.syncActions[arg1] + if callInfoList == nil then + return false + end + + for _, callInfo in ipairs(callInfoList) do + -- local widget = callInfo[1] + local func = callInfo[2] + if func(...) then + return true + end + end + return false + end + + if type(arg1) == "number" then + -- a proxied chat msg + if type(arg2) == "string" then + return GotChatMsg(arg2, arg1) + end + return false + end + + return false -- unknown type end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -actionHandler.HaveSyncAction = function() return (next(self.syncActions) ~= nil) end +actionHandler.HaveSyncAction = function() + return (next(self.syncActions) ~= nil) +end return actionHandler diff --git a/luaui/barwidgets.lua b/luaui/barwidgets.lua index fad71c66ead..00d41d80e5b 100644 --- a/luaui/barwidgets.lua +++ b/luaui/barwidgets.lua @@ -11,24 +11,24 @@ -------------------------------------------------------------------------------- VFS.Include(LUAUI_DIRNAME .. "Headers/keysym.h.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "system.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "callins.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "savetable.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "system.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "callins.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "savetable.lua", nil, VFS.ZIP) local gl = gl -local CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.gameShortName .. '.lua' -local WIDGET_DIRNAME = LUAUI_DIRNAME .. 'Widgets/' -local RML_WIDGET_DIRNAME = LUAUI_DIRNAME .. 'RmlWidgets/' +local CONFIG_FILENAME = LUAUI_DIRNAME .. "Config/" .. Game.gameShortName .. ".lua" +local WIDGET_DIRNAME = LUAUI_DIRNAME .. "Widgets/" +local RML_WIDGET_DIRNAME = LUAUI_DIRNAME .. "RmlWidgets/" -local SELECTOR_BASENAME = 'selector.lua' +local SELECTOR_BASENAME = "selector.lua" local SAFEWRAP = 1 -- 0: disabled -- 1: enabled, but can be overriden by widget.GetInfo().unsafe -- 2: always enabled -local SAFEDRAW = false -- requires SAFEWRAP to work +local SAFEDRAW = false -- requires SAFEWRAP to work local glPopAttrib = gl.PopAttrib local glPushAttrib = gl.PushAttrib @@ -51,7 +51,9 @@ if anonymousMode ~= "disabled" then -- disabling individual Spring functions isnt really good enough -- disabling user widget draw access would probably do the job but that wouldnt be easy to do - Spring.SetTeamColor = function() return true end + Spring.SetTeamColor = function() + return true + end if not Spring.GetSpectatingState() then Spring.SendCommands("info 0") @@ -90,7 +92,7 @@ widgetHandler = { mouseOwner = nil, ownedButton = 0, - chobbyInterface = false, -- will be true when chobby interface is on top + chobbyInterface = false, -- will be true when chobby interface is on top xViewSize = 1, yViewSize = 1, @@ -98,85 +100,84 @@ widgetHandler = { yViewSizeOld = 1, } - -- these call-ins are set to 'nil' if not used -- they are setup in UpdateCallIns() local flexCallIns = { - 'GameOver', - 'GameFrame', - 'GameFramePost', - 'GameSetup', - 'GamePaused', - 'TeamDied', - 'TeamChanged', - 'PlayerAdded', - 'PlayerRemoved', - 'PlayerChanged', - 'ShockFront', - 'WorldTooltip', - 'MapDrawCmd', - 'ActiveCommandChanged', - 'CameraRotationChanged', - 'CameraPositionChanged', - 'DefaultCommand', - 'UnitCreated', - 'UnitFinished', - 'UnitFromFactory', - 'UnitDestroyed', - 'UnitDestroyedByTeam', -- NB: called via gadget, not engine - 'RenderUnitDestroyed', - 'UnitExperience', - 'UnitTaken', - 'UnitGiven', - 'UnitIdle', - 'UnitCommand', - 'UnitCmdDone', - 'UnitDamaged', + "GameOver", + "GameFrame", + "GameFramePost", + "GameSetup", + "GamePaused", + "TeamDied", + "TeamChanged", + "PlayerAdded", + "PlayerRemoved", + "PlayerChanged", + "ShockFront", + "WorldTooltip", + "MapDrawCmd", + "ActiveCommandChanged", + "CameraRotationChanged", + "CameraPositionChanged", + "DefaultCommand", + "UnitCreated", + "UnitFinished", + "UnitFromFactory", + "UnitDestroyed", + "UnitDestroyedByTeam", -- NB: called via gadget, not engine + "RenderUnitDestroyed", + "UnitExperience", + "UnitTaken", + "UnitGiven", + "UnitIdle", + "UnitCommand", + "UnitCmdDone", + "UnitDamaged", "UnitStunned", - 'UnitEnteredRadar', - 'UnitEnteredLos', - 'UnitLeftRadar', - 'UnitLeftLos', - 'UnitEnteredWater', - 'UnitEnteredAir', - 'UnitLeftWater', - 'UnitLeftAir', - 'UnitSeismicPing', - 'UnitLoaded', - 'UnitUnloaded', - 'UnitCloaked', - 'UnitDecloaked', - 'UnitMoveFailed', - 'MetaUnitAdded', - 'MetaUnitRemoved', - 'RecvLuaMsg', - 'StockpileChanged', - 'SelectionChanged', - 'DrawGenesis', - 'DrawGroundDeferred', - 'DrawWorld', - 'DrawWorldPreUnit', - 'DrawPreDecals', - 'DrawWorldPreParticles', - 'DrawWorldShadow', - 'DrawWorldReflection', - 'DrawWorldRefraction', - 'DrawUnitsPostDeferred', - 'DrawFeaturesPostDeferred', - 'DrawScreenEffects', - 'DrawScreenPost', - 'DrawInMiniMap', - 'DrawBuildSquare', - 'DrawOpaqueUnitsLua', - 'DrawOpaqueFeaturesLua', - 'DrawAlphaUnitsLua', - 'DrawAlphaFeaturesLua', - 'DrawShadowUnitsLua', - 'DrawShadowFeaturesLua', - 'SunChanged', - 'FeatureCreated', - 'FeatureDestroyed', - 'UnsyncedHeightMapUpdate', + "UnitEnteredRadar", + "UnitEnteredLos", + "UnitLeftRadar", + "UnitLeftLos", + "UnitEnteredWater", + "UnitEnteredAir", + "UnitLeftWater", + "UnitLeftAir", + "UnitSeismicPing", + "UnitLoaded", + "UnitUnloaded", + "UnitCloaked", + "UnitDecloaked", + "UnitMoveFailed", + "MetaUnitAdded", + "MetaUnitRemoved", + "RecvLuaMsg", + "StockpileChanged", + "SelectionChanged", + "DrawGenesis", + "DrawGroundDeferred", + "DrawWorld", + "DrawWorldPreUnit", + "DrawPreDecals", + "DrawWorldPreParticles", + "DrawWorldShadow", + "DrawWorldReflection", + "DrawWorldRefraction", + "DrawUnitsPostDeferred", + "DrawFeaturesPostDeferred", + "DrawScreenEffects", + "DrawScreenPost", + "DrawInMiniMap", + "DrawBuildSquare", + "DrawOpaqueUnitsLua", + "DrawOpaqueFeaturesLua", + "DrawAlphaUnitsLua", + "DrawAlphaFeaturesLua", + "DrawShadowUnitsLua", + "DrawShadowFeaturesLua", + "SunChanged", + "FeatureCreated", + "FeatureDestroyed", + "UnsyncedHeightMapUpdate", } local flexCallInMap = {} for _, ci in ipairs(flexCallIns) do @@ -184,83 +185,83 @@ for _, ci in ipairs(flexCallIns) do end local callInLists = { - 'FontsChanged', - 'GamePreload', - 'GameStart', - 'Shutdown', - 'Update', - 'TextCommand', - 'CommandNotify', - 'AddConsoleLine', - 'ViewResize', - 'DrawScreen', - 'KeyPress', - 'KeyRelease', - 'TextInput', - 'MousePress', - 'MouseWheel', - 'ControllerAdded', - 'ControllerRemoved', - 'ControllerConnected', - 'ControllerDisconnected', - 'ControllerRemapped', - 'ControllerButtonUp', - 'ControllerButtonDown', - 'ControllerAxisMotion', - 'IsAbove', - 'GetTooltip', - 'GroupChanged', - 'GameProgress', - 'CommandsChanged', - 'LanguageChanged', - 'UnitBlocked', - 'VisibleUnitAdded', - 'VisibleUnitRemoved', - 'VisibleUnitsChanged', - 'AlliedUnitAdded', - 'AlliedUnitRemoved', - 'AlliedUnitsChanged', - 'UnitSale', - 'UnitSold', - 'VisibleExplosion', - 'Barrelfire', - 'CrashingAircraft', - 'SendStats', - 'SendStats_GameMode', - 'ActivityEvent', - 'FpsEvent', - 'ApmEvent', - 'GpuMemEvent', - 'LuaMemEvent', - 'SystemEvent', - 'RankingEvent', - 'MouseCursorEvent', - 'CameraBroadcastEvent', - 'FeatureReclaimStartedETA', - 'UnitBuildspeedDebuffHealthbars', - 'UnitBuildspeedDebuffEndHealthbars', - 'GadgetAddMessage', - 'GadgetReceiveAwards', - 'UnitScriptLight', - 'UnitScriptDistortion', - 'UnitScriptDecal', - 'GadgetRemoveGrass', - 'GadgetCoopStartPoint', - 'NotificationEvent', - 'NightFactorChanged', - 'ScavEvent', - 'RaptorEvent', - 'FeatureReclaimStartedHealthbars', - 'UnitCaptureStartedHealthbars', - 'ProjectileCreatedReloadHB', - 'UnitParalyzeDamageHealthbars', - 'UnitParalyzeDamageEffect', - 'SelectedUnitsClear', - 'SelectedUnitsBatchUpdate', - 'SelectedUnitsRemove', - 'SelectedUnitsAdd', - 'LavaRenderState', - 'ClearMapMarks', + "FontsChanged", + "GamePreload", + "GameStart", + "Shutdown", + "Update", + "TextCommand", + "CommandNotify", + "AddConsoleLine", + "ViewResize", + "DrawScreen", + "KeyPress", + "KeyRelease", + "TextInput", + "MousePress", + "MouseWheel", + "ControllerAdded", + "ControllerRemoved", + "ControllerConnected", + "ControllerDisconnected", + "ControllerRemapped", + "ControllerButtonUp", + "ControllerButtonDown", + "ControllerAxisMotion", + "IsAbove", + "GetTooltip", + "GroupChanged", + "GameProgress", + "CommandsChanged", + "LanguageChanged", + "UnitBlocked", + "VisibleUnitAdded", + "VisibleUnitRemoved", + "VisibleUnitsChanged", + "AlliedUnitAdded", + "AlliedUnitRemoved", + "AlliedUnitsChanged", + "UnitSale", + "UnitSold", + "VisibleExplosion", + "Barrelfire", + "CrashingAircraft", + "SendStats", + "SendStats_GameMode", + "ActivityEvent", + "FpsEvent", + "ApmEvent", + "GpuMemEvent", + "LuaMemEvent", + "SystemEvent", + "RankingEvent", + "MouseCursorEvent", + "CameraBroadcastEvent", + "FeatureReclaimStartedETA", + "UnitBuildspeedDebuffHealthbars", + "UnitBuildspeedDebuffEndHealthbars", + "GadgetAddMessage", + "GadgetReceiveAwards", + "UnitScriptLight", + "UnitScriptDistortion", + "UnitScriptDecal", + "GadgetRemoveGrass", + "GadgetCoopStartPoint", + "NotificationEvent", + "NightFactorChanged", + "ScavEvent", + "RaptorEvent", + "FeatureReclaimStartedHealthbars", + "UnitCaptureStartedHealthbars", + "ProjectileCreatedReloadHB", + "UnitParalyzeDamageHealthbars", + "UnitParalyzeDamageEffect", + "SelectedUnitsClear", + "SelectedUnitsBatchUpdate", + "SelectedUnitsRemove", + "SelectedUnitsAdd", + "LavaRenderState", + "ClearMapMarks", -- these use mouseOwner instead of lists -- 'MouseMove', @@ -275,7 +276,7 @@ end -- initialize the call-in lists do for _, listname in ipairs(callInLists) do - widgetHandler[listname .. 'List'] = {} + widgetHandler[listname .. "List"] = {} end end @@ -292,7 +293,7 @@ function widgetHandler:LoadConfigData() end return {} elseif chunk() == nil then - Spring.Log("barwidgets.lua", LOG.ERROR, 'Luaui config file was blank') + Spring.Log("barwidgets.lua", LOG.ERROR, "Luaui config file was blank") return {} end local tmp = {} @@ -319,7 +320,7 @@ function widgetHandler:SaveConfigData() filetable.order = self.orderList filetable.data = self.configData filetable.allowUserWidgets = self.allowUserWidgets - table.save(filetable, CONFIG_FILENAME, '-- Widget Custom data and order, order = 0 disabled widget') + table.save(filetable, CONFIG_FILENAME, "-- Widget Custom data and order, order = 0 disabled widget") end function widgetHandler:SendConfigData() @@ -332,10 +333,9 @@ function widgetHandler:SendConfigData() end end - -------------------------------------------------------------------------------- local unsortedWidgets -local doMoreYield = (Spring.Yield ~= nil); +local doMoreYield = (Spring.Yield ~= nil) local function Yield() if doMoreYield then @@ -352,8 +352,8 @@ local function loadWidgetFiles(folder, vfsMode) local fromZip = vfsMode ~= VFS.RAW local widgetFiles = VFS.DirList(folder, "*.lua", vfsMode) - for _, subDirectory in ipairs( VFS.SubDirs(folder) ) do - table.append( widgetFiles, VFS.DirList(subDirectory, "*.lua", vfsMode) ) + for _, subDirectory in ipairs(VFS.SubDirs(folder)) do + table.append(widgetFiles, VFS.DirList(subDirectory, "*.lua", vfsMode)) end for _, file in ipairs(widgetFiles) do @@ -373,14 +373,14 @@ local function CreateSandboxedSystem() end local SandboxedSpring = {} for k, v in pairs(Spring) do - if string.find(k, '^GiveOrder') then + if string.find(k, "^GiveOrder") then SandboxedSpring[k] = disabledOrder else SandboxedSpring[k] = v end end for k, v in pairs(System) do - if k == 'Spring' then + if k == "Spring" then SandboxedSystem[k] = SandboxedSpring else SandboxedSystem[k] = v @@ -397,7 +397,7 @@ function widgetHandler:Initialize() self.allowUserWidgets = true end - Spring.CreateDir(LUAUI_DIRNAME .. 'Config') + Spring.CreateDir(LUAUI_DIRNAME .. "Config") unsortedWidgets = {} @@ -455,23 +455,22 @@ function widgetHandler:AddSpadsMessage(contents) -- The game sends a lua message, which should be base64'd to prevent wierd character bullshit: -- Lua Message Format: - -- leetspeek luaspads:base64message - -- lu@$p@d$:ABCEDFGS== - -- Must contain, with triangle bracket literals [space][space] + -- leetspeek luaspads:base64message + -- lu@$p@d$:ABCEDFGS== + -- Must contain, with triangle bracket literals [space][space] -- will get parsed by barmanager, and forwarded to autohostmonitor as: -- match-event <35> local myPlayerID = Spring.GetMyPlayerID() - local myPlayerName = Spring.GetPlayerInfo(myPlayerID,false) - local gameSeconds = math.max(0,math.round(Spring.GetGameFrame() / 30)) - if type(contents) == 'table' then + local myPlayerName = Spring.GetPlayerInfo(myPlayerID, false) + local gameSeconds = math.max(0, math.round(Spring.GetGameFrame() / 30)) + if type(contents) == "table" then contents = Json.encode(contents) end local rawmessage = string.format("<%s> <%s> <%d>", myPlayerName, contents, gameSeconds) - local b64message = 'lu@$p@d$:' .. string.base64Encode(rawmessage) + local b64message = "lu@$p@d$:" .. string.base64Encode(rawmessage) Spring.SendLuaRulesMsg(b64message) end - function widgetHandler:ReloadUserWidgetFromGameRaw(name) local ki = self.knownWidgets[name] if not VFS.FileExists(ki.filename, VFS.ZIP) then @@ -480,17 +479,16 @@ function widgetHandler:ReloadUserWidgetFromGameRaw(name) local w = widgetHandler:LoadWidget(ki.filename, true, ki.localsAccess, true) if w then widgetHandler:InsertWidgetRaw(w) - Spring.Echo('Reloaded from game: ' .. name .. " (user 'unit control' widgets disabled for this game)") + Spring.Echo("Reloaded from game: " .. name .. " (user 'unit control' widgets disabled for this game)") end return w end - function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) local basename = Basename(filename) local text = VFS.LoadFile(filename, not (self.allowUserWidgets and allowuserwidgets and not reload) and VFS.ZIP or VFS.RAW_FIRST) if text == nil then - Spring.Echo('Failed to load: ' .. basename .. ' (missing file: ' .. filename .. ')') + Spring.Echo("Failed to load: " .. basename .. " (missing file: " .. filename .. ")") return nil end @@ -499,13 +497,13 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) -- opposed to not being able to access them at all from outside the widget). This is accomplished by loading the -- widget with an additional code snippet to list all of the local variables, getting that result, and then -- loading again with a code snippet that sets up external access to those variables. - localsAccess = localsAccess or VFS.Include('common/testing/locals_access.lua') + localsAccess = localsAccess or VFS.Include("common/testing/locals_access.lua") local textWithLocalsDetector = text .. localsAccess.localsDetectorString local chunk, err = loadstring(textWithLocalsDetector, filename) if chunk == nil then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Echo("Failed to load: " .. basename .. " (" .. err .. ")") return nil end @@ -513,7 +511,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) setfenv(chunk, widget) local success, err = pcall(chunk) if not success then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Echo("Failed to load: " .. basename .. " (" .. err .. ")") return nil end if err == false then @@ -527,7 +525,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) local chunk, err = loadstring(text, filename) if chunk == nil then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Echo("Failed to load: " .. basename .. " (" .. err .. ")") return nil end @@ -535,7 +533,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) setfenv(chunk, widget) local success, err = pcall(chunk) if not success then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Echo("Failed to load: " .. basename .. " (" .. err .. ")") return nil end if err == false then @@ -552,7 +550,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) if fromZip or true then widget.widgetHandler = self else - Spring.Echo('Failed to load: ' .. basename .. ' (user widgets may not access widgetHandler)', fromZip, filename, allowuserwidgets) + Spring.Echo("Failed to load: " .. basename .. " (user widgets may not access widgetHandler)", fromZip, filename, allowuserwidgets) return nil end end @@ -560,19 +558,19 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) self:FinalizeWidget(widget, filename, basename) local name = widget.whInfo.name if basename == SELECTOR_BASENAME then - self.orderList[name] = 1 -- always load the widget selector + self.orderList[name] = 1 -- always load the widget selector end err = self:ValidateWidget(widget) if err then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') + Spring.Echo("Failed to load: " .. basename .. " (" .. err .. ")") return nil end local knownInfo = self.knownWidgets[name] if knownInfo and not reload then if knownInfo.active then - Spring.Echo('Failed to load: ' .. basename .. ' (duplicate name)') + Spring.Echo("Failed to load: " .. basename .. " (duplicate name)") return nil end else @@ -591,7 +589,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) knownInfo.localsAccess = enableLocalsAccess if widget.GetInfo == nil then - Spring.Echo('Failed to load: ' .. basename .. ' (no GetInfo() call)') + Spring.Echo("Failed to load: " .. basename .. " (no GetInfo() call)") return nil end @@ -618,7 +616,7 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) return nil end if not fromZip then - local md5 = VFS.CalculateHash(text,0) + local md5 = VFS.CalculateHash(text, 0) if widgetHandler.widgetHashes[md5] == nil then widgetHandler.widgetHashes[md5] = filename end @@ -633,14 +631,12 @@ function widgetHandler:LoadWidget(filename, fromZip, enableLocalsAccess, reload) return widget end -local WidgetMeta = -{ +local WidgetMeta = { __index = System, __metatable = true, } -local SandboxedWidgetMeta = -{ +local SandboxedWidgetMeta = { __index = SandboxedSystem, __metatable = true, } @@ -662,7 +658,7 @@ function widgetHandler:NewWidget(enableLocalsAccess, fromZip, filename) setmetatable(widget, metaRef) end - widget.WG = self.WG -- the shared table + widget.WG = self.WG -- the shared table widget.widget = widget -- easy self referencing -- wrapped calls (closures) @@ -762,30 +758,30 @@ function widgetHandler:FinalizeWidget(widget, filename, basename) wi.enabled = info.enabled or false end - widget.whInfo = {} -- a proxy table + widget.whInfo = {} -- a proxy table local mt = { __index = wi, __newindex = function() error("whInfo tables are read-only") end, - __metatable = "protected" + __metatable = "protected", } setmetatable(widget.whInfo, mt) -- cache tracy zone name strings to avoid per-frame string allocation. Saves 0.5us per tracy call, (1 us -> 0.5us) if tracy then - widget._tracyUpdateName = "W:Update:" .. wi.name - widget._tracyViewResizeName = "W:ViewResize:" .. wi.name - widget._tracyDrawScreenName = "W:DrawScreen:" .. wi.name - widget._tracyDrawGenesisName = "W:DrawGenesis:" .. wi.name - widget._tracyDrawWorldName = "W:DrawWorld:" .. wi.name - widget._tracyDrawWorldPreUnitName = "W:DrawWorldPreUnit:" .. wi.name - widget._tracyDrawScreenEffectsName = "W:DrawScreenEffects:" .. wi.name - widget._tracyDrawScreenPostName = "W:DrawScreenPost:" .. wi.name - widget._tracyGameStartName = "W:GameStart:" .. wi.name - widget._tracyPlayerChangedName = "W:PlayerChanged:" .. wi.name - widget._tracyGameFrameName = "W:GameFrame:" .. wi.name - widget._tracyGameFramePostName = "W:GameFramePost:" .. wi.name - widget._tracyVisibleUnitsChangedName= "W:VisibleUnitsChanged:".. wi.name + widget._tracyUpdateName = "W:Update:" .. wi.name + widget._tracyViewResizeName = "W:ViewResize:" .. wi.name + widget._tracyDrawScreenName = "W:DrawScreen:" .. wi.name + widget._tracyDrawGenesisName = "W:DrawGenesis:" .. wi.name + widget._tracyDrawWorldName = "W:DrawWorld:" .. wi.name + widget._tracyDrawWorldPreUnitName = "W:DrawWorldPreUnit:" .. wi.name + widget._tracyDrawScreenEffectsName = "W:DrawScreenEffects:" .. wi.name + widget._tracyDrawScreenPostName = "W:DrawScreenPost:" .. wi.name + widget._tracyGameStartName = "W:GameStart:" .. wi.name + widget._tracyPlayerChangedName = "W:PlayerChanged:" .. wi.name + widget._tracyGameFrameName = "W:GameFrame:" .. wi.name + widget._tracyGameFramePostName = "W:GameFramePost:" .. wi.name + widget._tracyVisibleUnitsChangedName = "W:VisibleUnitsChanged:" .. wi.name end end @@ -796,24 +792,23 @@ function widgetHandler:ValidateWidget(widget) return nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function widgetFailure(w, funcName, errorMsg) local name = w.whInfo.name - local errorBase = 'Error' - if funcName ~= 'Shutdown' then + local errorBase = "Error" + if funcName ~= "Shutdown" then widgetHandler:RemoveWidget(w) if not w.canControlUnits and errorMsg:find(SANDBOXED_ERROR_MSG) then - errorBase = 'Sandbox error' + errorBase = "Sandbox error" widgetHandler:ReloadUserWidgetFromGame(name) end else - Spring.Echo('Error in Shutdown()') + Spring.Echo("Error in Shutdown()") end - Spring.Echo(errorBase .. ' in ' .. funcName .. '(): ' .. tostring(errorMsg)) - Spring.Echo('Removed widget: ' .. name) + Spring.Echo(errorBase .. " in " .. funcName .. "(): " .. tostring(errorMsg)) + Spring.Echo("Removed widget: " .. name) return nil end @@ -846,7 +841,7 @@ local function SafeWrapFunc(func, funcName) if not SAFEDRAW then return SafeWrapFuncNoGL(func, funcName) else - if string.sub(funcName, 1, 4) ~= 'Draw' then + if string.sub(funcName, 1, 4) ~= "Draw" then return SafeWrapFuncNoGL(func, funcName) else return SafeWrapFuncGL(func, funcName) @@ -859,7 +854,7 @@ local function SafeWrapWidget(widget) return elseif SAFEWRAP == 1 then if widget.GetInfo and widget.GetInfo().unsafe then - Spring.Echo('LuaUI: loaded unsafe widget: ' .. widget.whInfo.name) + Spring.Echo("LuaUI: loaded unsafe widget: " .. widget.whInfo.name) return end end @@ -871,11 +866,10 @@ local function SafeWrapWidget(widget) end if widget.Initialize then - widget.Initialize = SafeWrapFunc(widget.Initialize, 'Initialize') + widget.Initialize = SafeWrapFunc(widget.Initialize, "Initialize") end end - -------------------------------------------------------------------------------- local function ArrayInsert(t, f, w) @@ -906,7 +900,6 @@ local function ArrayRemove(t, value) end end - -------------------------------------------------------------------------------- --- Safe reordering @@ -924,11 +917,11 @@ local callinDepth = 0 function widgetHandler:HookReorderSpecialFuncs() -- Methods that need manual PerformReorders calls because of not -- being wrapped by UpdateCallIns. - self:HookReorderPost('DrawScreen', true) - self:HookReorderPost('Update', true) - self:HookReorderPost('MouseMove') - self:HookReorderPost('MouseRelease') - self:HookReorderPost('ConfigureLayout') + self:HookReorderPost("DrawScreen", true) + self:HookReorderPost("Update", true) + self:HookReorderPost("MouseMove") + self:HookReorderPost("MouseRelease") + self:HookReorderPost("ConfigureLayout") end function widgetHandler:HookReorderPost(name, topMethod) @@ -937,15 +930,15 @@ function widgetHandler:HookReorderPost(name, topMethod) -- We define some methods to be topMethod, those will hard set the callinDepth as a consistency -- measure. local func = self[name] - if not func or not type(func) == 'function' then + if not func or not type(func) == "function" then Spring.Log("barwidgets.lua", LOG.WARNING, name .. " does not exist or isn't a function") return end - if self[name .. 'Raw'] then + if self[name .. "Raw"] then Spring.Log("barwidgets.lua", LOG.WARNING, name .. "Raw already exists") return end - self[name .. 'Raw'] = func + self[name .. "Raw"] = func self[name] = function(...) callinDepth = topMethod and 1 or callinDepth + 1 local res = func(...) @@ -961,13 +954,12 @@ end function widgetHandler:CreateQueuedReorderFuncs() -- This will create an array with linked Raw methods so we can find them by index. -- It will also create the widgetHandler usual api queing the calls. - local reorderFuncNames = {'InsertWidget', 'RemoveWidget', 'EnableWidget', 'DisableWidget', 'ReloadUserWidgetFromGame', - 'ToggleWidget', 'LowerWidget', 'RaiseWidget', 'UpdateWidgetCallIn', 'RemoveWidgetCallIn'} + local reorderFuncNames = { "InsertWidget", "RemoveWidget", "EnableWidget", "DisableWidget", "ReloadUserWidgetFromGame", "ToggleWidget", "LowerWidget", "RaiseWidget", "UpdateWidgetCallIn", "RemoveWidgetCallIn" } local queueReorder = widgetHandler.QueueReorder for idx, name in ipairs(reorderFuncNames) do -- linked method index - reorderFuncs[#reorderFuncs + 1] = widgetHandler[name .. 'Raw'] + reorderFuncs[#reorderFuncs + 1] = widgetHandler[name .. "Raw"] -- widgetHandler api widgetHandler[name] = function(s, ...) @@ -977,7 +969,7 @@ function widgetHandler:CreateQueuedReorderFuncs() end function widgetHandler:QueueReorder(methodIndex, ...) - reorderQueue[#reorderQueue + 1] = {methodIndex, ...} + reorderQueue[#reorderQueue + 1] = { methodIndex, ... } reorderNeeded = true end @@ -1003,7 +995,6 @@ end -------------------------------------------------------------------------------- --- Unsafe insert/remove - function widgetHandler:InsertWidgetRaw(widget) if widget == nil then return @@ -1013,14 +1004,14 @@ function widgetHandler:InsertWidgetRaw(widget) if self.knownWidgets[name] then self.knownWidgets[name].active = false end - Spring.Echo('Missing capabilities: ' .. name .. '. Disabling.') + Spring.Echo("Missing capabilities: " .. name .. ". Disabling.") return end -- Gracefully ignore/reload good control widgets advertising themselves as such, if user 'unit control' widgets disabled. if widget.GetInfo and widget:GetInfo().control and not widget.canControlUnits then local name = widget.whInfo.name if not self:ReloadUserWidgetFromGameRaw(name) then - Spring.Echo('Blocked loading: ' .. name .. " (user 'unit control' widgets disabled for this game)") + Spring.Echo("Blocked loading: " .. name .. " (user 'unit control' widgets disabled for this game)") end return end @@ -1030,8 +1021,8 @@ function widgetHandler:InsertWidgetRaw(widget) ArrayInsert(self.widgets, true, widget) for _, listname in ipairs(callInLists) do local func = widget[listname] - if type(func) == 'function' then - ArrayInsert(self[listname .. 'List'], func, widget) + if type(func) == "function" then + ArrayInsert(self[listname .. "List"], func, widget) end end self:UpdateCallIns() @@ -1065,7 +1056,7 @@ function widgetHandler:RemoveWidgetRaw(widget) self:RemoveWidgetGlobals(widget) self.actionHandler:RemoveWidgetActions(widget) for _, listname in ipairs(callInLists) do - ArrayRemove(self[listname .. 'List'], widget) + ArrayRemove(self[listname .. "List"], widget) end self:UpdateCallIns() end @@ -1073,11 +1064,11 @@ end -------------------------------------------------------------------------------- function widgetHandler:UpdateCallIn(name) - local listName = name .. 'List' - if name == 'Update' or name == 'DrawScreen' then + local listName = name .. "List" + if name == "Update" or name == "DrawScreen" then return end - if #self[listName] > 0 or not flexCallInMap[name] or (name == 'GotChatMsg' and actionHandler.HaveChatAction()) or (name == 'RecvFromSynced' and actionHandler.HaveSyncAction()) then + if #self[listName] > 0 or not flexCallInMap[name] or (name == "GotChatMsg" and actionHandler.HaveChatAction()) or (name == "RecvFromSynced" and actionHandler.HaveSyncAction()) then -- always assign these call-ins local selffunc = self[name] @@ -1102,29 +1093,29 @@ function widgetHandler:UpdateCallIn(name) end function widgetHandler:UpdateWidgetCallInRaw(name, w) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then local func = w[name] - if type(func) == 'function' then + if type(func) == "function" then ArrayInsert(ciList, func, w) else ArrayRemove(ciList, w) end self:UpdateCallIn(name) else - Spring.Echo('UpdateWidgetCallIn: bad name: ' .. name) + Spring.Echo("UpdateWidgetCallIn: bad name: " .. name) end end function widgetHandler:RemoveWidgetCallInRaw(name, w) - local listName = name .. 'List' + local listName = name .. "List" local ciList = self[listName] if ciList then ArrayRemove(ciList, w) self:UpdateCallIn(name) else - Spring.Echo('RemoveWidgetCallIn: bad name: ' .. name) + Spring.Echo("RemoveWidgetCallIn: bad name: " .. name) end end @@ -1147,7 +1138,7 @@ function widgetHandler:EnableWidgetRaw(name, enableLocalsAccess) return false end if not ki.active then - Spring.Echo('Loading: ' .. ki.filename .. (enableLocalsAccess and " (with locals)" or "")) + Spring.Echo("Loading: " .. ki.filename .. (enableLocalsAccess and " (with locals)" or "")) local order = widgetHandler.orderList[name] if not order or order <= 0 then self.orderList[name] = 1 @@ -1173,8 +1164,8 @@ function widgetHandler:DisableWidgetRaw(name) if not w then return false end - Spring.Echo('Removed: ' .. ki.filename) - self:RemoveWidgetRaw(w) -- deactivate + Spring.Echo("Removed: " .. ki.filename) + self:RemoveWidgetRaw(w) -- deactivate self.orderList[name] = 0 -- disable self:SaveConfigData() end @@ -1199,7 +1190,6 @@ function widgetHandler:ToggleWidgetRaw(name) return true end - -------------------------------------------------------------------------------- local function FindWidgetIndex(t, w) @@ -1240,7 +1230,7 @@ function widgetHandler:RaiseWidgetRaw(widget) end Raise(self.widgets, true, widget) for _, listname in ipairs(callInLists) do - Raise(self[listname .. 'List'], widget[listname], widget) + Raise(self[listname .. "List"], widget[listname], widget) end end @@ -1268,18 +1258,18 @@ function widgetHandler:LowerWidgetRaw(widget) end local n = FindHighestIndex(t, i, w.whInfo.layer) if n and n > i then - table.insert(t, n+1, w) + table.insert(t, n + 1, w) table.remove(t, i) end end Lower(self.widgets, true, widget) for _, listname in ipairs(callInLists) do - Lower(self[listname .. 'List'], widget[listname], widget) + Lower(self[listname .. "List"], widget[listname], widget) end end function widgetHandler:FindWidget(name) - if type(name) ~= 'string' then + if type(name) ~= "string" then return nil end for k, v in ipairs(self.widgets) do @@ -1290,7 +1280,6 @@ function widgetHandler:FindWidget(name) return nil end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1335,7 +1324,6 @@ function widgetHandler:RemoveWidgetGlobals(owner) return count end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1356,7 +1344,6 @@ function widgetHandler:ConfigLayoutHandler(data) ConfigLayoutHandler(data) end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -1371,7 +1358,7 @@ function widgetHandler:Shutdown() -- save config if self.__blankOutConfig then - table.save({ ["allowUserWidgets"] = self.allowUserWidgets }, CONFIG_FILENAME, '-- Widget Custom data and order') + table.save({ ["allowUserWidgets"] = self.allowUserWidgets }, CONFIG_FILENAME, "-- Widget Custom data and order") else self:SaveConfigData() end @@ -1388,11 +1375,9 @@ function widgetHandler:BlankOut() end end - local gcCheckCounter = 0 function widgetHandler:Update() - gcCheckCounter = gcCheckCounter + 1 if gcCheckCounter >= 30 then gcCheckCounter = 0 @@ -1407,7 +1392,7 @@ function widgetHandler:Update() hourTimer = (hourTimer + deltaTime) % 3600.0 tracy.ZoneBeginN("W:Update") for _, w in ipairs(self.UpdateList) do - tracy.ZoneBeginN("W:Update:"..w.whInfo.name) + tracy.ZoneBeginN("W:Update:" .. w.whInfo.name) w:Update(deltaTime) tracy.ZoneEnd() end @@ -1416,27 +1401,26 @@ function widgetHandler:Update() end function widgetHandler:ConfigureLayout(command) - - if command == 'reconf' then + if command == "reconf" then self:SendConfigData() return true - elseif command == 'selector' then + elseif command == "selector" then for _, w in ipairs(self.widgets) do if w.whInfo.basename == SELECTOR_BASENAME then - return true -- there can only be one + return true -- there can only be one end end local sw = self:LoadWidget(LUAUI_DIRNAME .. SELECTOR_BASENAME, true) -- load the game's included widget_selector.lua, instead of the default selector.lua self:InsertWidgetRaw(sw) self:RaiseWidgetRaw(sw) return true - elseif string.find(command, 'togglewidget') == 1 then + elseif string.find(command, "togglewidget") == 1 then self:ToggleWidgetRaw(string.sub(command, 14)) return true - elseif string.find(command, 'enablewidget') == 1 then + elseif string.find(command, "enablewidget") == 1 then self:EnableWidgetRaw(string.sub(command, 14)) return true - elseif string.find(command, 'disablewidget') == 1 then + elseif string.find(command, "disablewidget") == 1 then self:DisableWidgetRaw(string.sub(command, 15)) return true end @@ -1463,7 +1447,7 @@ end function widgetHandler:CameraRotationChanged(rotx, roty, rotz) tracy.ZoneBeginN("W:CameraRotationChanged") - for _,w in ipairs(self.CameraRotationChangedList) do + for _, w in ipairs(self.CameraRotationChangedList) do w:CameraRotationChanged(rotx, roty, rotz) end tracy.ZoneEnd() @@ -1471,7 +1455,7 @@ end function widgetHandler:CameraPositionChanged(posx, posy, posz) tracy.ZoneBeginN("W:CameraPositionChanged") - for _,w in ipairs(self.CameraPositionChangedList) do + for _, w in ipairs(self.CameraPositionChangedList) do w:CameraPositionChanged(posx, posy, posz) end tracy.ZoneEnd() @@ -1524,13 +1508,11 @@ function widgetHandler:CommandsChanged() return end - -------------------------------------------------------------------------------- -- -- Drawing call-ins -- - -- generates ViewResize() calls for the widgets function widgetHandler:SetViewSize(vsx, vsy) tracy.ZoneBeginN("W:SetViewSize") @@ -1546,10 +1528,10 @@ function widgetHandler:SetViewSize(vsx, vsy) end function widgetHandler:ViewResize(vsx, vsy) - if type(vsx) == 'table' then + if type(vsx) == "table" then vsy = vsx.viewSizeY vsx = vsx.viewSizeX - print('real ViewResize') -- FIXME + print("real ViewResize") -- FIXME end tracy.ZoneBeginN("W:ViewResize") @@ -1567,11 +1549,10 @@ function widgetHandler:ViewResize(vsx, vsy) return end - function widgetHandler:DrawScreen() tracy.ZoneBeginN("W:DrawScreen") if not Spring.IsGUIHidden() then - if not self.chobbyInterface then + if not self.chobbyInterface then local list = self.DrawScreenList for i = #list, 1, -1 do local w = list[i] @@ -1614,7 +1595,7 @@ end function widgetHandler:DrawWorld() tracy.ZoneBeginN("W:DrawWorld") - if not self.chobbyInterface then + if not self.chobbyInterface then local list = self.DrawWorldList for i = #list, 1, -1 do local w = list[i] @@ -1629,7 +1610,7 @@ end function widgetHandler:DrawWorldPreUnit() tracy.ZoneBeginN("W:DrawWorldPreUnit") - if not self.chobbyInterface then + if not self.chobbyInterface then local list = self.DrawWorldPreUnitList for i = #list, 1, -1 do local w = list[i] @@ -1827,15 +1808,15 @@ function widgetHandler:DrawInMiniMap(xSize, ySize) end function widgetHandler:DrawBuildSquare(unitDefID, x, z, facing, statuses) - for _,w in ripairs(self.DrawBuildSquareList) do - w:DrawBuildSquare(unitDefID, x, z, facing, statuses) - end - return + for _, w in ripairs(self.DrawBuildSquareList) do + w:DrawBuildSquare(unitDefID, x, z, facing, statuses) + end + return end function widgetHandler:SunChanged() tracy.ZoneBeginN("W:SunChanged") - local nmp = _G['NightModeParams'] + local nmp = _G["NightModeParams"] local list = self.SunChangedList for i = #list, 1, -1 do list[i]:SunChanged(nmp) @@ -2122,7 +2103,7 @@ function widgetHandler:GetTooltip(x, y) for _, w in ipairs(self.GetTooltipList) do if w:IsAbove(x, y) then local tip = w:GetTooltip(x, y) - if type(tip) == 'string' and #tip > 0 then + if type(tip) == "string" and #tip > 0 then tracy.ZoneEnd() return tip end @@ -2132,7 +2113,6 @@ function widgetHandler:GetTooltip(x, y) return "" end - -------------------------------------------------------------------------------- -- -- Game call-ins @@ -2237,7 +2217,6 @@ function widgetHandler:GameFrame(frameNum) return end - function widgetHandler:GameFramePost(frameNum) tracy.ZoneBeginN("W:GameFramePost") for _, w in ipairs(self.GameFramePostList) do @@ -2340,7 +2319,7 @@ function widgetHandler:WorldTooltip(ttType, ...) tracy.ZoneBeginN("W:WorldTooltip") for _, w in ipairs(self.WorldTooltipList) do local tt = w:WorldTooltip(ttType, ...) - if type(tt) == 'string' and #tt > 0 then + if type(tt) == "string" and #tt > 0 then tracy.ZoneEnd() return tt end @@ -2389,13 +2368,13 @@ function widgetHandler:DefaultCommand(...) local list = self.DefaultCommandList for i = #list, 1, -1 do local result = list[i]:DefaultCommand(...) - if type(result) == 'number' then + if type(result) == "number" then tracy.ZoneEnd() return result end end tracy.ZoneEnd() - return nil -- not a number, use the default engine command + return nil -- not a number, use the default engine command end function widgetHandler:LanguageChanged() @@ -2414,7 +2393,6 @@ function widgetHandler:UnitBlocked(unitDefID, reasons) tracy.ZoneEnd() end - -------------------------------------------------------------------------------- -- -- Unit call-ins @@ -2442,7 +2420,6 @@ function widgetHandler:UnitCreated(unitID, unitDefID, unitTeam, builderID) widgetHandler:MetaUnitAdded(unitID, unitDefID, unitTeam) tracy.ZoneBeginN("W:UnitCreated") for _, w in ipairs(self.UnitCreatedList) do - w:UnitCreated(unitID, unitDefID, unitTeam, builderID) end tracy.ZoneEnd() @@ -2461,8 +2438,7 @@ end function widgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) tracy.ZoneBeginN("W:UnitFromFactory") for _, w in ipairs(self.UnitFromFactoryList) do - w:UnitFromFactory(unitID, unitDefID, unitTeam, - factID, factDefID, userOrders) + w:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) end tracy.ZoneEnd() return @@ -2500,8 +2476,7 @@ end function widgetHandler:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) tracy.ZoneBeginN("W:UnitExperience") for _, w in ipairs(self.UnitExperienceList) do - w:UnitExperience(unitID, unitDefID, unitTeam, - experience, oldExperience) + w:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) end tracy.ZoneEnd() return @@ -2703,7 +2678,7 @@ end function widgetHandler:RecvLuaMsg(msg, playerID) tracy.ZoneBeginN("W:RecvLuaMsg") local retval = false - if msg:sub(1, 18) == 'LobbyOverlayActive' then + if msg:sub(1, 18) == "LobbyOverlayActive" then self.chobbyInterface = (msg:byte(19) == 49) -- 49 == string.byte('1') retval = true end @@ -2713,7 +2688,7 @@ function widgetHandler:RecvLuaMsg(msg, playerID) end end tracy.ZoneEnd() - return retval -- FIXME -- another actionHandler type? + return retval -- FIXME -- another actionHandler type? end function widgetHandler:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount) @@ -2775,7 +2750,6 @@ function widgetHandler:AlliedUnitsChanged(visibleUnits, numVisibleUnits) tracy.ZoneEnd() end - -------------------------------------------------------------------------------- -- -- GFX @@ -3123,7 +3097,6 @@ function widgetHandler:LavaRenderState(tideLevel, heatDistortX, heatDistortZ) return end - -------------------------------------------------------------------------------- -- -- Feature call-ins diff --git a/luaui/callins.lua b/luaui/callins.lua index 7eb97da5968..760e5a7a0fa 100644 --- a/luaui/callins.lua +++ b/luaui/callins.lua @@ -149,5 +149,5 @@ CallInsList = { CallInsMap = {} for _, callin in ipairs(CallInsList) do - CallInsMap[callin] = true + CallInsMap[callin] = true end diff --git a/luaui/configs/DeferredLightsGL4WeaponsConfig.lua b/luaui/configs/DeferredLightsGL4WeaponsConfig.lua index 59a7c772cad..3d2813edc7d 100644 --- a/luaui/configs/DeferredLightsGL4WeaponsConfig.lua +++ b/luaui/configs/DeferredLightsGL4WeaponsConfig.lua @@ -1,41 +1,59 @@ -- This configures all the lights weapon effects, including: - -- Projectile attached lights - -- Muzzle flashes - -- Explosion lights - -- Pieceprojectiles (gibs on death) lights +-- Projectile attached lights +-- Muzzle flashes +-- Explosion lights +-- Pieceprojectiles (gibs on death) lights -- note that weapondef customparams need to be moved out of unitdefs, for ease of configability. - -- customparams= { - -- expl_light_skip = bool , -- no explosion on projectile death - -- expl_light_color = {rgba} , -- color of the explosion light at peak? - -- expl_light_opacity = a, -- alpha or power of the light - -- expl_light_mult = ,-- fuck if i know? - -- expl_light_radius = , -- radius - -- expl_light_radius_mult = , -- why? - -- expl_light_life = , life of the expl light? +-- customparams= { +-- expl_light_skip = bool , -- no explosion on projectile death +-- expl_light_color = {rgba} , -- color of the explosion light at peak? +-- expl_light_opacity = a, -- alpha or power of the light +-- expl_light_mult = ,-- fuck if i know? +-- expl_light_radius = , -- radius +-- expl_light_radius_mult = , -- why? +-- expl_light_life = , life of the expl light? -- concept is: - -- Make a few base classes of lights - -- auto-assign the majority - -- offer overrideability +-- Make a few base classes of lights +-- auto-assign the majority +-- offer overrideability -- note that Y offset will be very different for points and for beams! -- (c) Beherith (mysterme@gmail.com) local exampleLight = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam pieceName = nil, -- optional yOffset = 10, -- optional, gives extra Y height fraction = 3, -- optional, only every nth projectile gets the effect (randomly) lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 0, - r = 1, g = 1, b = 1, a = 1, - color2r = 1, color2g = 1, color2b = 1, colortime = 15, -- point lights only, colortime in seconds for unit-attached - dirx = 0, diry = 0, dirz = 1, theta = 0.5, -- cone lights only, specify direction and half-angle in radians - pos2x = 100, pos2y = 100, pos2z = 100, -- beam lights only, specifies the endpoint of the beam - modelfactor = 1, specular = 1, scattering = 1, lensflare = 1, - lifetime = 0, sustain = 1, selfshadowing = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 0, + r = 1, + g = 1, + b = 1, + a = 1, + color2r = 1, + color2g = 1, + color2b = 1, + colortime = 15, -- point lights only, colortime in seconds for unit-attached + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.5, -- cone lights only, specify direction and half-angle in radians + pos2x = 100, + pos2y = 100, + pos2z = 100, -- beam lights only, specifies the endpoint of the beam + modelfactor = 1, + specular = 1, + scattering = 1, + lensflare = 1, + lifetime = 0, + sustain = 1, + selfshadowing = 0, }, } - -- Local Variables -------------------------------------------------------------------------------- @@ -48,226 +66,452 @@ local exampleLight = { --------------------------------General Base Light Classes for further useage -------- local BaseClasses = { LaserProjectile = { - lightType = 'beam', -- or cone or beam + lightType = "beam", -- or cone or beam lightConfig = { - posx = 0, posy = 10, posz = 0, radius = 100, - r = 1, g = 1, b = 1, a = 0.75, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 1.6, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam lights only, specifies the endpoint of the beam - modelfactor = 1, specular = 0.5, scattering = 2.5, lensflare = 1, - lifetime = 15, sustain = 1.5, selfshadowing = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 100, + r = 1, + g = 1, + b = 1, + a = 0.75, + color2r = 0.2, + color2g = 0.2, + color2b = 0.2, + colortime = 1.6, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam lights only, specifies the endpoint of the beam + modelfactor = 1, + specular = 0.5, + scattering = 2.5, + lensflare = 1, + lifetime = 15, + sustain = 1.5, + selfshadowing = 0, }, }, GreenLaserProjectile = { - lightType = 'beam', -- or cone or beam + lightType = "beam", -- or cone or beam lightConfig = { - posx = 0, posy = 10, posz = 0, radius = 100, - r = 1, g = 1, b = 1, a = 1.0, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 9, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam lights only, specifies the endpoint of the beam - modelfactor = 0.3, specular = 0.4, scattering = 2.0, lensflare = 1, - lifetime = 20, sustain = 2, selfshadowing = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 100, + r = 1, + g = 1, + b = 1, + a = 1.0, + color2r = 0.2, + color2g = 0.2, + color2b = 0.2, + colortime = 9, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam lights only, specifies the endpoint of the beam + modelfactor = 0.3, + specular = 0.4, + scattering = 2.0, + lensflare = 1, + lifetime = 20, + sustain = 2, + selfshadowing = 0, }, }, BlueLaserProjectile = { - lightType = 'beam', -- or cone or beam + lightType = "beam", -- or cone or beam lightConfig = { - posx = 0, posy = 10, posz = 0, radius = 100, - r = 1, g = 1, b = 1, a = 0.75, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 1.6, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam lights only, specifies the endpoint of the beam - modelfactor = 1, specular = 0.5, scattering = 1.5, lensflare = 1, - lifetime = 15, sustain = 1.5, selfshadowing = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 100, + r = 1, + g = 1, + b = 1, + a = 0.75, + color2r = 0.2, + color2g = 0.2, + color2b = 0.2, + colortime = 1.6, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam lights only, specifies the endpoint of the beam + modelfactor = 1, + specular = 0.5, + scattering = 1.5, + lensflare = 1, + lifetime = 15, + sustain = 1.5, + selfshadowing = 0, }, }, CannonProjectile = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam lightConfig = { - posx = 0, posy = 10, posz = 0, radius = 125, - r = 1, g = 0.8, b = 0.45, a = 0.11, + posx = 0, + posy = 10, + posz = 0, + radius = 125, + r = 1, + g = 0.8, + b = 0.45, + a = 0.11, --color2r = 0.5, color2g = 0.4, color2b = 0.23, colortime = 1.5, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.5, specular = 0.6, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0, + modelfactor = 0.5, + specular = 0.6, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, }, }, LRPCProjectile = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, + posx = 0, + posy = 0, + posz = 0, + radius = 150, --pos2x = 100, pos2y = 100, pos2z = 100, --dirx = 1, diry = 0, dirz = 1, theta = 0.4, - r = 1.2, g = 0.80, b = 0.3, a = 0.2, - color2r = 0.9, color2g = 0.45, color2b = 0.15, colortime = 60, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.1, specular = -0.2, scattering = 0.6, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0, + r = 1.2, + g = 0.80, + b = 0.3, + a = 0.2, + color2r = 0.9, + color2g = 0.45, + color2b = 0.15, + colortime = 60, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.1, + specular = -0.2, + scattering = 0.6, + lensflare = 2, + lifetime = 0, + sustain = 0, + selfshadowing = 0, }, }, - MissileProjectile = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, - r = 1, g = 0.7, b = 0.2, a = 0.15, - color2r = 0.6, color2g = 0.4, color2b = 0.10, colortime = 1.6, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.3, specular = 0.1, scattering = 0.6, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 150, + r = 1, + g = 0.7, + b = 0.2, + a = 0.15, + color2r = 0.6, + color2g = 0.4, + color2b = 0.10, + colortime = 1.6, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.3, + specular = 0.1, + scattering = 0.6, + lensflare = 8, + lifetime = 0, + sustain = 0, + selfshadowing = 0, }, }, MissileProjectileEMP = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, - r = 1, g = 1, b = 2, a = 0.7, - color2r = 0.2, color2g = 0.2, color2b = 0.5, colortime = 8, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.3, specular = 0.1, scattering = 0.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 3, + posx = 0, + posy = 0, + posz = 0, + radius = 150, + r = 1, + g = 1, + b = 2, + a = 0.7, + color2r = 0.2, + color2g = 0.2, + color2b = 0.5, + colortime = 8, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.3, + specular = 0.1, + scattering = 0.5, + lensflare = 8, + lifetime = 0, + sustain = 0, + selfshadowing = 3, }, }, LaserAimProjectile = { - lightType = 'cone', -- or cone or beam + lightType = "cone", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 500, - r = 5, g = 0, b = 0, a = 1, - dirx = 1, diry = 0, dirz = 1, theta = 0.02, -- cone lights only, specify direction and half-angle in radians - modelfactor = 10, specular = 0.5, scattering = 1, lensflare = 1, - lifetime = 0, sustain = 1, selfshadowing = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 500, + r = 5, + g = 0, + b = 0, + a = 1, + dirx = 1, + diry = 0, + dirz = 1, + theta = 0.02, -- cone lights only, specify direction and half-angle in radians + modelfactor = 10, + specular = 0.5, + scattering = 1, + lensflare = 1, + lifetime = 0, + sustain = 1, + selfshadowing = 0, }, }, TorpedoProjectile = { - lightType = 'cone', -- or cone or beam + lightType = "cone", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 100, - r = 0, g = 0, b = 0, a = 1, - color2r = 1, color2g = 0.55, color2b = 0.12, colortime = 30, - dirx = 1, diry = 0, dirz = 1, theta = 0.15, -- cone lights only, specify direction and half-angle in radians - modelfactor = 1, specular = 0, scattering = 1, lensflare = 1, - lifetime = 0, sustain = 1, selfshadowing = 4, + posx = 0, + posy = 0, + posz = 0, + radius = 100, + r = 0, + g = 0, + b = 0, + a = 1, + color2r = 1, + color2g = 0.55, + color2b = 0.12, + colortime = 30, + dirx = 1, + diry = 0, + dirz = 1, + theta = 0.15, -- cone lights only, specify direction and half-angle in radians + modelfactor = 1, + specular = 0, + scattering = 1, + lensflare = 1, + lifetime = 0, + sustain = 1, + selfshadowing = 4, }, }, FlameProjectile = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam fraction = 3, -- only spawn every nth light lightConfig = { - posx = 0, posy = 15, posz = 0, radius = 25, - r = 0.2, g = 0.12, b = 0.05, a = 0.2, - color2r = 1.0, color2g = 0.45, color2b = 0.22, colortime = 33, -- point lights only, colortime in seconds for unit-attached - modelfactor = -0.2, specular = -0.3, scattering = 0.05, lensflare = 0, - lifetime = 33, sustain = 10, selfshadowing = 0, + posx = 0, + posy = 15, + posz = 0, + radius = 25, + r = 0.2, + g = 0.12, + b = 0.05, + a = 0.2, + color2r = 1.0, + color2g = 0.45, + color2b = 0.22, + colortime = 33, -- point lights only, colortime in seconds for unit-attached + modelfactor = -0.2, + specular = -0.3, + scattering = 0.05, + lensflare = 0, + lifetime = 33, + sustain = 10, + selfshadowing = 0, }, }, Explosion = { -- spawned on explosions - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 240, - dirx = 0, diry = 10, dirz = 0, theta = 0.93, -- Give explosions a bit of a vertical bounce component - r = 2, g = 2, b = 2, a = 0.6, - color2r = 0.7, color2g = 0.55, color2b = 0.28, colortime = 0.1, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.15, specular = 0.15, scattering = 0.4, lensflare = 1, - lifetime = 12, sustain = 3, selfshadowing = 4, + posx = 0, + posy = 0, + posz = 0, + radius = 240, + dirx = 0, + diry = 10, + dirz = 0, + theta = 0.93, -- Give explosions a bit of a vertical bounce component + r = 2, + g = 2, + b = 2, + a = 0.6, + color2r = 0.7, + color2g = 0.55, + color2b = 0.28, + colortime = 0.1, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.15, + specular = 0.15, + scattering = 0.4, + lensflare = 1, + lifetime = 12, + sustain = 3, + selfshadowing = 4, }, }, ExplosionXL = { -- spawned on explosions - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 240, - dirx = 0, diry = 5, dirz = 0, theta = 0.93, -- Give explosions a bit of a vertical bounce component - r = 2, g = 2, b = 2, a = 0.6, - color2r = 0.7, color2g = 0.55, color2b = 0.28, colortime = 0.1, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.15, specular = 0.15, scattering = 0.4, lensflare = 1, - lifetime = 12, sustain = 3, selfshadowing = 4, + posx = 0, + posy = 0, + posz = 0, + radius = 240, + dirx = 0, + diry = 5, + dirz = 0, + theta = 0.93, -- Give explosions a bit of a vertical bounce component + r = 2, + g = 2, + b = 2, + a = 0.6, + color2r = 0.7, + color2g = 0.55, + color2b = 0.28, + colortime = 0.1, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.15, + specular = 0.15, + scattering = 0.4, + lensflare = 1, + lifetime = 12, + sustain = 3, + selfshadowing = 4, }, }, ExplosionEMP = { -- spawned on explosions - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam yOffset = 12, -- Y offsets are only ever used for explosions! lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 140, + posx = 0, + posy = 0, + posz = 0, + radius = 140, --dirx = 0, diry = 0.018, dirz = 0, theta = 0.93, - dirx = 0, diry = 0.2, dirz = 0, theta = 0.93, - r = 2, g = 2, b = 4, a = 1.2, - color2r = 0.3, color2g = 0.3, color2b = 0.6, colortime = 1.5, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.3, specular = -0.5, scattering = 0.5, lensflare = 0, - lifetime = 90, sustain = 50, selfshadowing = 2, + dirx = 0, + diry = 0.2, + dirz = 0, + theta = 0.93, + r = 2, + g = 2, + b = 4, + a = 1.2, + color2r = 0.3, + color2g = 0.3, + color2b = 0.6, + colortime = 1.5, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.3, + specular = -0.5, + scattering = 0.5, + lensflare = 0, + lifetime = 90, + sustain = 50, + selfshadowing = 2, }, }, MuzzleFlash = { -- spawned on projectilecreated - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, - r = 2, g = 2, b = 2, a = 0.7, - color2r = 0.75, color2g = 0.72, color2b = 0.6, colortime = 0, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.8, specular = 0.5, scattering = 0.6, lensflare = 8, - lifetime = 6, sustain = 0.0035, selfshadowing = 4, + posx = 0, + posy = 0, + posz = 0, + radius = 150, + r = 2, + g = 2, + b = 2, + a = 0.7, + color2r = 0.75, + color2g = 0.72, + color2b = 0.6, + colortime = 0, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.8, + specular = 0.5, + scattering = 0.6, + lensflare = 8, + lifetime = 6, + sustain = 0.0035, + selfshadowing = 4, }, }, MuzzleFlashCone = { -- not used yet - no idea - lightType = 'cone', -- or cone or beam + lightType = "cone", -- or cone or beam lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, - r = 2, g = 2, b = 2, a = 0.7, - dirx = 1, diry = 0, dirz = 1, theta = 0.15, - color2r = 0.75, color2g = 0.72, color2b = 0.6, colortime = 0, -- point lights only, colortime in seconds for unit-attached - modelfactor = 0.8, specular = 0.5, scattering = 0.6, lensflare = 8, - lifetime = 6, sustain = 0.0035, selfshadowing = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 150, + r = 2, + g = 2, + b = 2, + a = 0.7, + dirx = 1, + diry = 0, + dirz = 1, + theta = 0.15, + color2r = 0.75, + color2g = 0.72, + color2b = 0.6, + colortime = 0, -- point lights only, colortime in seconds for unit-attached + modelfactor = 0.8, + specular = 0.5, + scattering = 0.6, + lensflare = 8, + lifetime = 6, + sustain = 0.0035, + selfshadowing = 0, }, }, } - local SizeRadius = { - Pico = 26, - Nano = 34, - Micro = 44, - Tiniest = 56, - Tiny = 72, - Smallest = 90, - Smaller = 115, - Small = 140, - Smallish = 165, - SmallMedium = 190, - Medium = 220, - Mediumer = 260, - MediumLarge = 300, - Large = 400, - Larger = 500, - Largest = 650, - Mega = 800, - MegaXL = 1000, - MegaXXL = 1500, - Giga = 2000, - Tera = 3500, - Planetary = 5000, + Pico = 26, + Nano = 34, + Micro = 44, + Tiniest = 56, + Tiny = 72, + Smallest = 90, + Smaller = 115, + Small = 140, + Smallish = 165, + SmallMedium = 190, + Medium = 220, + Mediumer = 260, + MediumLarge = 300, + Large = 400, + Larger = 500, + Largest = 650, + Mega = 800, + MegaXL = 1000, + MegaXXL = 1500, + Giga = 2000, + Tera = 3500, + Planetary = 5000, } local ColorSets = { -- TODO add advanced dual-color sets! - Red = {r = 1, g = 0, b = 0}, - Green = {r = 0, g = 1, b = 0}, - Blue = {r = 0, g = 0, b = 1}, - Purple = {r = 0.7, g = 0.3, b = 1}, - Yellow = {r = 1, g = 1, b = 0}, - White = {r = 1, g = 1, b = 1}, - Plasma = {r = 1, g = 0.8, b = 0.45}, - HeatRay = {r = 0.88, g = 0.65, b = 0.10}, - Emg = {r = 0.42, g = 0.32, b = 0.07}, - Fire = {r = 0.8, g = 0.3, b = 0.05}, - Warm = {r = 0.7, g = 0.7, b = 0.1}, - Cold = {r = 0.5, g = 0.75, b = 1.0}, - Emp = {r = 0.5, g = 0.5, b = 1.0}, - Team = {r = -1, g = -1, b = -1}, + Red = { r = 1, g = 0, b = 0 }, + Green = { r = 0, g = 1, b = 0 }, + Blue = { r = 0, g = 0, b = 1 }, + Purple = { r = 0.7, g = 0.3, b = 1 }, + Yellow = { r = 1, g = 1, b = 0 }, + White = { r = 1, g = 1, b = 1 }, + Plasma = { r = 1, g = 0.8, b = 0.45 }, + HeatRay = { r = 0.88, g = 0.65, b = 0.10 }, + Emg = { r = 0.42, g = 0.32, b = 0.07 }, + Fire = { r = 0.8, g = 0.3, b = 0.05 }, + Warm = { r = 0.7, g = 0.7, b = 0.1 }, + Cold = { r = 0.5, g = 0.75, b = 1.0 }, + Emp = { r = 0.5, g = 0.5, b = 1.0 }, + Team = { r = -1, g = -1, b = -1 }, } local globalDamageMult = Spring.GetModOptions().multiplier_weapondamage or 1 @@ -276,22 +520,22 @@ local function GetClosestSizeClass(desiredsize) local delta = math.huge local best = nil for classname, size in pairs(SizeRadius) do - if math.abs(size-desiredsize) < delta then - delta = math.abs(size-desiredsize) + if math.abs(size - desiredsize) < delta then + delta = math.abs(size - desiredsize) best = classname end end return best, SizeRadius[best] end -local Lifetimes = {Fast = 5, Quick = 10, Moderate = 30, Long = 90, Glacial = 270} +local Lifetimes = { Fast = 5, Quick = 10, Moderate = 30, Long = 90, Glacial = 270 } local lightClasses = {} local function deepcopy(orig) local orig_type = type(orig) local copy - if orig_type == 'table' then + if orig_type == "table" then copy = {} for orig_key, orig_value in next, orig, nil do copy[deepcopy(orig_key)] = deepcopy(orig_value) @@ -305,8 +549,8 @@ end local usedclasses = 0 local function GetLightClass(baseClassname, colorkey, sizekey, additionaloverrides) local lightClassKey = baseClassname .. (colorkey or "") .. (sizekey or "") - if additionaloverrides and type(additionaloverrides) == 'table' then - for k,v in pairs(additionaloverrides) do + if additionaloverrides and type(additionaloverrides) == "table" then + for k, v in pairs(additionaloverrides) do lightClassKey = lightClassKey .. "_" .. tostring(k) .. "=" .. tostring(v) end end @@ -325,7 +569,7 @@ local function GetLightClass(baseClassname, colorkey, sizekey, additionaloverrid lightConfig.r = ColorSets[colorkey].r lightConfig.g = ColorSets[colorkey].g lightConfig.b = ColorSets[colorkey].b - if lightClasses[lightClassKey].lightType == 'point' then + if lightClasses[lightClassKey].lightType == "point" then lightConfig.color2r = ColorSets[colorkey].color2r or lightConfig.color2r lightConfig.color2g = ColorSets[colorkey].color2g or lightConfig.color2g lightConfig.color2b = ColorSets[colorkey].color2b or lightConfig.color2b @@ -333,7 +577,7 @@ local function GetLightClass(baseClassname, colorkey, sizekey, additionaloverrid end end if additionaloverrides then - for k,v in pairs(additionaloverrides) do + for k, v in pairs(additionaloverrides) do lightConfig[k] = v end end @@ -344,14 +588,28 @@ end -------------------------------------------------------------------------------- local gibLight = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam pieceName = nil, -- optional lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 36, - r = 1, g = 0.9, b = 0.5, a = 0.08, - color2r = 0.9, color2g = 0.75, color2b = 0.25, colortime = 0.3, -- point lights only, colortime in seconds for unit-attache - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 300, sustain = 3, selfshadowing = 0 + posx = 0, + posy = 0, + posz = 0, + radius = 36, + r = 1, + g = 0.9, + b = 0.5, + a = 0.08, + color2r = 0.9, + color2g = 0.75, + color2b = 0.25, + colortime = 0.3, -- point lights only, colortime in seconds for unit-attache + modelfactor = 0.4, + specular = 0.5, + scattering = 0.5, + lensflare = 0, + lifetime = 300, + sustain = 3, + selfshadowing = 0, }, } @@ -359,36 +617,32 @@ local gibLight = { local muzzleFlashLights = {} local explosionLights = {} -local projectileDefLights = { - ['default'] = { - lightType = 'point', - lightConfig = { posx = 0, posy = 16, posz = 0, radius = 420, - color2r = 1, color2g = 1, color2b = 1, colortime = 15, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.2, specular = 1, scattering = 1, lensflare = 1, - lifetime = 50, sustain = 20, selfshadowing = 0}, - } +local projectileDefLights = { + ["default"] = { + lightType = "point", + lightConfig = { posx = 0, posy = 16, posz = 0, radius = 420, color2r = 1, color2g = 1, color2b = 1, colortime = 15, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.2, specular = 1, scattering = 1, lensflare = 1, lifetime = 50, sustain = 20, selfshadowing = 0 }, + }, } ----------------------------------- local function AssignLightsToAllWeapons() - for weaponID=1, #WeaponDefs do + for weaponID = 1, #WeaponDefs do local weaponDef = WeaponDefs[weaponID] local damage = 100 - for cat=0, #weaponDef.damages do - if Game.armorTypes[cat] and Game.armorTypes[cat] == 'default' then + for cat = 0, #weaponDef.damages do + if Game.armorTypes[cat] and Game.armorTypes[cat] == "default" then damage = weaponDef.damages[cat] break end end -- correct damage multiplier modoption to more sane value - damage = (damage / globalDamageMult) + ((damage * (globalDamageMult-1))*0.25) + damage = (damage / globalDamageMult) + ((damage * (globalDamageMult - 1)) * 0.25) - local radius = ((weaponDef.damageAreaOfEffect*2) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) - local orgMult = math.clamp(damage/1600, 0.1, 0.6) + (radius/2800) - local life = 8 + (5*(radius/2000)+(orgMult * 5)) + local radius = ((weaponDef.damageAreaOfEffect * 2) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) + local orgMult = math.clamp(damage / 1600, 0.1, 0.6) + (radius / 2800) + local life = 8 + (5 * (radius / 2000) + (orgMult * 5)) radius = ((orgMult * 75) + (radius * 2.4)) * 0.33 local r, g, b = 1, 0.8, 0.45 @@ -402,7 +656,7 @@ local function AssignLightsToAllWeapons() local explosionLight = true local sizeclass = GetClosestSizeClass(radius) local t = {} - local aa = string.find(weaponDef.cegTag, 'aa') + local aa = string.find(weaponDef.cegTag, "aa") if aa then r, g, b = 1, 0.5, 0.6 t.color2r, t.color2g, t.color2b = 1, 0.5, 0.6 @@ -411,7 +665,7 @@ local function AssignLightsToAllWeapons() r, g, b = 0.5, 0.5, 1 t.color2r, t.color2g, t.color2b = 0.25, 0.25, 1 end - local scavenger = string.find(weaponDef.name, '_scav') + local scavenger = string.find(weaponDef.name, "_scav") if scavenger then r, g, b = 0.3, 0.1, 0.7 t.color2r, t.color2g, t.color2b = 0.3, 0.1, 0.7 @@ -424,18 +678,16 @@ local function AssignLightsToAllWeapons() -- r, g, b = 0.45, 1, 0.45 -- end - if weaponDef.type == 'BeamLaser' then + if weaponDef.type == "BeamLaser" then --muzzleFlash = true -- doesnt work - if not weaponDef.paralyzer then local muzzleFlash = true - t.color2r, t.color2g, t.color2b = (r *0.1), (g*0.1), (b *0.1) - t.r, t.g, t.b = math.min(1, r+0.25), math.min(1, g+0.25), math.min(1, b+0.25) + t.color2r, t.color2g, t.color2b = (r * 0.1), (g * 0.1), (b * 0.1) + t.r, t.g, t.b = math.min(1, r + 0.25), math.min(1, g + 0.25), math.min(1, b + 0.25) t.life = 4 t.colortime = 10 + (weaponDef.beamtime * 50) t.sustain = 1.5 + (weaponDef.beamtime * 10) - end radius = (6.3 * (weaponDef.size * weaponDef.size)) + (4 * radius * orgMult) @@ -453,44 +705,40 @@ local function AssignLightsToAllWeapons() projectileDefLights[weaponID] = GetLightClass("LaserProjectile", nil, sizeclass, t) projectileDefLights[weaponID].lightConfig.selfshadowing = 5 -- Screen Space Light Shadows elseif damage < 500 then - projectileDefLights[weaponID] = GetLightClass("GreenLaserProjectile", nil, sizeclass, t) - projectileDefLights[weaponID].lightConfig.selfshadowing = 5 -- Screen Space Light Shadows + projectileDefLights[weaponID] = GetLightClass("GreenLaserProjectile", nil, sizeclass, t) + projectileDefLights[weaponID].lightConfig.selfshadowing = 5 -- Screen Space Light Shadows else - projectileDefLights[weaponID] = GetLightClass("BlueLaserProjectile", nil, sizeclass, t) - projectileDefLights[weaponID].lightConfig.selfshadowing = 5 -- Screen Space Light Shadows + projectileDefLights[weaponID] = GetLightClass("BlueLaserProjectile", nil, sizeclass, t) + projectileDefLights[weaponID].lightConfig.selfshadowing = 5 -- Screen Space Light Shadows end if not weaponDef.paralyzer then radius = ((orgMult * 2500) + radius) * 0.2 sizeclass = GetClosestSizeClass(radius) end - - elseif weaponDef.type == 'LaserCannon' then + elseif weaponDef.type == "LaserCannon" then radius = (4 * (weaponDef.size * weaponDef.size * weaponDef.size)) + (3 * radius * orgMult) t.a = (orgMult * 0.1) + weaponDef.duration sizeclass = GetClosestSizeClass(radius) projectileDefLights[weaponID] = GetLightClass("CannonProjectile", "Warm", sizeclass, t) --projectileDefLights[weaponID].lightConfig.selfshadowing = 1 -- Screen Space Light Shadows - - elseif weaponDef.type == 'LightningCannon' then + elseif weaponDef.type == "LightningCannon" then if not scavenger then t.r, t.g, t.b = 0.2, 0.45, 1 end t.a = 0.13 + (orgMult * 0.5) - sizeclass = GetClosestSizeClass(33 + (radius*2.5)) + sizeclass = GetClosestSizeClass(33 + (radius * 2.5)) projectileDefLights[weaponID] = GetLightClass("LaserProjectile", "Cold", sizeclass, t) - - elseif weaponDef.type == 'MissileLauncher' then + elseif weaponDef.type == "MissileLauncher" then t.a = orgMult * 0.33 - if string.find(weaponDef.name, 'advsam') then --for LRAA - radius = radius * 0.45 - t.a = orgMult * 0.44 + if string.find(weaponDef.name, "advsam") then --for LRAA + radius = radius * 0.45 + t.a = orgMult * 0.44 end sizeclass = GetClosestSizeClass(radius) projectileDefLights[weaponID] = GetLightClass("MissileProjectile", "Warm", sizeclass, t) - - elseif weaponDef.type == 'StarburstLauncher' then + elseif weaponDef.type == "StarburstLauncher" then t.a = orgMult * 0.44 if weaponDef.interceptor == 1 then @@ -503,46 +751,40 @@ local function AssignLightsToAllWeapons() sizeclass = GetClosestSizeClass(radius * 0.4) projectileDefLights[weaponID] = GetLightClass("MissileProjectileEMP", "Warm", sizeclass, t) else - sizeclass = GetClosestSizeClass(radius) - radius = ((orgMult * 75) + (radius * 4)) * 0.4 - life = 8 + (5*(radius/2000)+(orgMult * 5)) - projectileDefLights[weaponID] = GetLightClass("MissileProjectile", "Warm", sizeclass, t) + sizeclass = GetClosestSizeClass(radius) + radius = ((orgMult * 75) + (radius * 4)) * 0.4 + life = 8 + (5 * (radius / 2000) + (orgMult * 5)) + projectileDefLights[weaponID] = GetLightClass("MissileProjectile", "Warm", sizeclass, t) end - - - elseif weaponDef.type == 'Cannon' then - t.a = orgMult*0.17 + elseif weaponDef.type == "Cannon" then + t.a = orgMult * 0.17 radius = (radius + (weaponDef.size * 35)) * 0.48 sizeclass = GetClosestSizeClass(radius) projectileDefLights[weaponID] = GetLightClass("CannonProjectile", "Plasma", sizeclass, t) - radius = ((weaponDef.damageAreaOfEffect*2) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) + radius = ((weaponDef.damageAreaOfEffect * 2) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) projectileDefLights[weaponID].lightConfig.selfshadowing = 1 -- Screen Space Light Shadows - - elseif weaponDef.type == 'DGun' then + elseif weaponDef.type == "DGun" then muzzleFlash = true --doesnt work sizeclass = "Medium" - t.a = orgMult*0.66 * 1.5 + t.a = orgMult * 0.66 * 1.5 projectileDefLights[weaponID] = GetLightClass("CannonProjectile", "Warm", sizeclass, t) projectileDefLights[weaponID].yOffset = 32 projectileDefLights[weaponID].lightConfig.selfshadowing = 1 -- Screen Space Light Shadows --Spring.Echo(WeaponDefNames[weaponID], weaponDef.type, weaponDef.name) - - elseif weaponDef.type == 'TorpedoLauncher' then + elseif weaponDef.type == "TorpedoLauncher" then sizeclass = "Small" t.r, t.g, t.b = 0.1, 0.2, 0.5 projectileDefLights[weaponID] = GetLightClass("TorpedoProjectile", "Cold", sizeclass, t) - - elseif weaponDef.type == 'Shield' then + elseif weaponDef.type == "Shield" then sizeclass = "Large" projectileDefLights[weaponID] = GetLightClass("CannonProjectile", "Cold", sizeclass, t) -- elseif weaponDef.type == 'AircraftBomb' then -- t.a = life * 1.8 -- projectileDefLights[weaponID] = GetLightClass("MissileProjectile", "Warm", sizeclass, t) - - elseif weaponDef.type == 'Flame' then + elseif weaponDef.type == "Flame" then --sizeclass = "Small" - sizeclass = GetClosestSizeClass(radius*2.5) + sizeclass = GetClosestSizeClass(radius * 2.5) --t.a = orgMult * 0.17 projectileDefLights[weaponID] = GetLightClass("FlameProjectile", nil, sizeclass, t) end @@ -554,23 +796,23 @@ local function AssignLightsToAllWeapons() if scavenger then t.r, t.g, t.b = 0.35, 0.15, 0.7 end - t.a = orgMult*2.3 + t.a = orgMult * 2.3 t.colortime = 2.5 - if string.find(weaponDef.name, 'flak') then - radius = radius * 0.25 - --t.a = orgMult*0.8 + if string.find(weaponDef.name, "flak") then + radius = radius * 0.25 + --t.a = orgMult*0.8 end - if string.find(weaponDef.name, 'legflak') then - radius = radius * 3 - t.a = orgMult*1.2 + if string.find(weaponDef.name, "legflak") then + radius = radius * 3 + t.a = orgMult * 1.2 end local adjusted_radius = radius * 0.65 if damage < 150 then -- increase muzzleflash for low-damage units to remain visible - adjusted_radius = adjusted_radius * 2.9 -- Increase for low-damage weapons + adjusted_radius = adjusted_radius * 2.9 -- Increase for low-damage weapons t.colortime = 2.0 end @@ -589,40 +831,40 @@ local function AssignLightsToAllWeapons() t.colortime = 35 / life --t.colortime = life * 0.17 t.a = orgMult * 1.1 - if weaponDef.type == 'DGun' then - t.a = orgMult*0.17 + if weaponDef.type == "DGun" then + t.a = orgMult * 0.17 --Spring.Echo('-==DGUN==-', weaponDef.name, radius, lightclass, sizeclass, t.a) - elseif weaponDef.type == 'Flame' then - t.a = orgMult*0.22 - elseif weaponDef.type == 'MissileLauncher' then - if string.find(weaponDef.name, 'advsam') then --for LRAA - --damage = 1000 - --radius = 675 - orgMult = 0.25 - radius = radius * 0.5 - --t.a = orgMult * 2.44 - --Spring.Echo(WeaponDefNames[weaponID], weaponDef.type, weaponDef.name) - --Spring.Echo('-==--===-', weaponDef.name, radius, lightClassName, sizeclass, t.a) - sizeclass = GetClosestSizeClass(radius) - explosionLights[weaponID] = GetLightClass("Explosion", nil, sizeclass, t) + elseif weaponDef.type == "Flame" then + t.a = orgMult * 0.22 + elseif weaponDef.type == "MissileLauncher" then + if string.find(weaponDef.name, "advsam") then --for LRAA + --damage = 1000 + --radius = 675 + orgMult = 0.25 + radius = radius * 0.5 + --t.a = orgMult * 2.44 + --Spring.Echo(WeaponDefNames[weaponID], weaponDef.type, weaponDef.name) + --Spring.Echo('-==--===-', weaponDef.name, radius, lightClassName, sizeclass, t.a) + sizeclass = GetClosestSizeClass(radius) + explosionLights[weaponID] = GetLightClass("Explosion", nil, sizeclass, t) end - elseif weaponDef.type == 'TorpedoLauncher' then + elseif weaponDef.type == "TorpedoLauncher" then -- t.r = t.r * 0.5 -- make more red -- t.g = t.g * 0.5 -- make more red -- t.b = t.b * 1.4 -- make more red -- t.color2r = 0.9 -- t.color2g = 0.6 -- t.color2b = 0.8 - elseif weaponDef.type == 'BeamLaser' then + elseif weaponDef.type == "BeamLaser" then local mult = 0.85 - t.color2r, t.color2g, t.color2b = r*mult, g*mult, b*mult + t.color2r, t.color2g, t.color2b = r * mult, g * mult, b * mult t.colortime = 8 t.lifetime = life * 0.6 - t.a = 0.02 + ((orgMult*0.055) / weaponDef.beamtime) + (weaponDef.range*0.000035) - radius = 1.2 * ((weaponDef.damageAreaOfEffect*4) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.1)) + (weaponDef.range*0.08) - if string.find(weaponDef.name, 'heat') then + t.a = 0.02 + ((orgMult * 0.055) / weaponDef.beamtime) + (weaponDef.range * 0.000035) + radius = 1.2 * ((weaponDef.damageAreaOfEffect * 4) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.1)) + (weaponDef.range * 0.08) + if string.find(weaponDef.name, "heat") then radius = (radius / 2.5) - t.a = 0.01 + ((orgMult*0.035) / weaponDef.beamtime) + (weaponDef.range*0.000025) + t.a = 0.01 + ((orgMult * 0.035) / weaponDef.beamtime) + (weaponDef.range * 0.000025) t.color2r = 1.2 t.color2g = 0.5 t.color2b = 0.2 @@ -630,33 +872,32 @@ local function AssignLightsToAllWeapons() t.lifetime = 4 end sizeclass = GetClosestSizeClass(radius) - elseif weaponDef.type == 'LightningCannon' then - t.a = orgMult*1.25 + elseif weaponDef.type == "LightningCannon" then + t.a = orgMult * 1.25 t.color2r = 0.1 t.color2g = 0.3 t.color2b = 0.9 - sizeclass = GetClosestSizeClass(radius*1.2) + sizeclass = GetClosestSizeClass(radius * 1.2) else - if weaponDef.type == 'AircraftBomb' then + if weaponDef.type == "AircraftBomb" then if weaponDef.paralyzer then - t.r = t.r * 1.7 -- make more red - t.g = t.g * 0.4 -- make more red - t.b = t.b * 0.4 -- make more red - life = life * 1.1 -- too high and it will flicker somehow! + t.r = t.r * 1.7 -- make more red + t.g = t.g * 0.4 -- make more red + t.b = t.b * 0.4 -- make more red + life = life * 1.1 -- too high and it will flicker somehow! orgMult = orgMult * 0.15 t.colortime = 31 / life else - t.r = t.r * 1.7 -- make more red - t.g = t.g * 0.4 -- make more red - t.b = t.b * 0.4 -- make more red + t.r = t.r * 1.7 -- make more red + t.g = t.g * 0.4 -- make more red + t.b = t.b * 0.4 -- make more red life = life * 1.2 t.colortime = 19 / life end t.lifetime = life - end - radius = ((weaponDef.damageAreaOfEffect*1.9) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) - if string.find(weaponDef.name, 'juno') then + radius = ((weaponDef.damageAreaOfEffect * 1.9) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) + if string.find(weaponDef.name, "juno") then radius = 675 orgMult = 0.25 t.r = 1.05 @@ -680,7 +921,7 @@ local function AssignLightsToAllWeapons() -- t.color2r = (1.5 + t.color2r) / 2.3 -- t.color2g = (1.5 + t.color2g) / 2.3 -- t.color2b = (1.5 + t.color2b) / 2.3 - t.a = orgMult*2.8 + t.a = orgMult * 2.8 t.lifetime = life * 1.15 --t.colortime = 8 else @@ -688,11 +929,11 @@ local function AssignLightsToAllWeapons() t.r = (1.4 + t.r) / 1.8 t.g = (1.4 + t.g) / 1.8 t.b = (1.4 + t.b) / 1.8 - t.a = orgMult*1.3 --make all explosions bit stronger + t.a = orgMult * 1.3 --make all explosions bit stronger end local mult = 0.6 - t.color2r, t.color2g, t.color2b = r*mult, g*mult, b*mult + t.color2r, t.color2g, t.color2b = r * mult, g * mult, b * mult sizeclass = GetClosestSizeClass(radius) end if not weaponDef.customParams.noexplosionlight then @@ -701,50 +942,81 @@ local function AssignLightsToAllWeapons() end end end - Spring.Echo(Spring.GetGameFrame(),"DLGL4 weapons conf using",usedclasses,"light types") + Spring.Echo(Spring.GetGameFrame(), "DLGL4 weapons conf using", usedclasses, "light types") end AssignLightsToAllWeapons() - -----------------Manual Overrides-------------------- local explosionLightsNames = {} local muzzleFlashLightsNames = {} local projectileDefLightsNames = {} --cortrem -explosionLightsNames["cortrem_tremor_focus_fire"] = -GetLightClass("Explosion", nil, "Tiny", { - colortime = 3.5, sustain = 1, lifetime = 1, scattering = 0.7}) +explosionLightsNames["cortrem_tremor_focus_fire"] = GetLightClass("Explosion", nil, "Tiny", { + colortime = 3.5, + sustain = 1, + lifetime = 1, + scattering = 0.7, +}) -explosionLightsNames["cortrem_tremor_spread_fire"] = -GetLightClass("Explosion", nil, "Smallish", { - colortime = 2.5, sustain = 2, lifetime = 6, scattering = 0.7}) +explosionLightsNames["cortrem_tremor_spread_fire"] = GetLightClass("Explosion", nil, "Smallish", { + colortime = 2.5, + sustain = 2, + lifetime = 6, + scattering = 0.7, +}) --corforge -projectileDefLightsNames["corforge_flamethrower_ce"] = -GetLightClass("FlameProjectile", "Fire", "Micro", { - r = 1, a = 0.02791886, g = 0.94, b = 0.88}) +projectileDefLightsNames["corforge_flamethrower_ce"] = GetLightClass("FlameProjectile", "Fire", "Micro", { + r = 1, + a = 0.02791886, + g = 0.94, + b = 0.88, +}) --armthor -explosionLightsNames["armthor_thunder"] = -GetLightClass("Explosion", nil, "Smallish", { - r = 1.5, g = 1.5, b = 1.5, a = 0.08, radius = 120, - color2r = 0.3, color2g = 0.3, color2b = 0.4, colortime = 5, - sustain = 1.5, lifetime = 5, - modelfactor = 0.1, specular = 0.4, scattering = 0.1, lensflare = 4}) +explosionLightsNames["armthor_thunder"] = GetLightClass("Explosion", nil, "Smallish", { + r = 1.5, + g = 1.5, + b = 1.5, + a = 0.08, + radius = 120, + color2r = 0.3, + color2g = 0.3, + color2b = 0.4, + colortime = 5, + sustain = 1.5, + lifetime = 5, + modelfactor = 0.1, + specular = 0.4, + scattering = 0.1, + lensflare = 4, +}) --corint -muzzleFlashLightsNames["corint_lrpc"] = -GetLightClass("MuzzleFlash", nil, "Large", { - posx = 0, posy = 0, posz = 0, radius = 240, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 50, - r = 1.2, g = 1.0, b = 0.9, a = 0.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 17, sustain = 2}) +muzzleFlashLightsNames["corint_lrpc"] = GetLightClass("MuzzleFlash", nil, "Large", { + posx = 0, + posy = 0, + posz = 0, + radius = 240, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 50, + r = 1.2, + g = 1.0, + b = 0.9, + a = 0.5, + modelfactor = 0.5, + specular = 0.3, + scattering = 0.3, + lensflare = 0, + lifetime = 17, + sustain = 2, +}) muzzleFlashLightsNames["corint_lrpc"].yOffset = 16 -explosionLightsNames["corint_lrpc"] = -GetLightClass("ExplosionXL", nil, "Large", {colortime = 4, sustain = 12, lifetime = 26, scattering = 0.7}) +explosionLightsNames["corint_lrpc"] = GetLightClass("ExplosionXL", nil, "Large", { colortime = 4, sustain = 12, lifetime = 26, scattering = 0.7 }) -- muzzleFlashLightsNames["corint_lrpc"] = -- GetLightClass("MuzzleFlash", nil, "Large", {posx = 0, posy = 0, posz = 0, radius = 240, @@ -755,9 +1027,7 @@ GetLightClass("ExplosionXL", nil, "Large", {colortime = 4, sustain = 12, lifetim -- muzzleFlashLightsNames["corint_lrpc"].yOffset = 16 --armstil -explosionLightsNames["armstil_stiletto_bomb"] = -GetLightClass("ExplosionEMP", nil, "Medium", { -}) +explosionLightsNames["armstil_stiletto_bomb"] = GetLightClass("ExplosionEMP", nil, "Medium", {}) -- --armemp -- projectileDefLightsNames["armemp_armemp_weapon"] = @@ -767,83 +1037,58 @@ GetLightClass("ExplosionEMP", nil, "Medium", { -- }) --armbrtha -muzzleFlashLightsNames["armbrtha_lrpc"] = -GetLightClass("MuzzleFlash", nil, "Medium", { - posx = 0, posy = 0, posz = 0, - color2r = 0.3, color2g = 0.1, color2b = 0.05, colortime = 13, - r = 1.2, g = 1.1, b = 1.0, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 20, sustain = 2}) +muzzleFlashLightsNames["armbrtha_lrpc"] = GetLightClass("MuzzleFlash", nil, "Medium", { + posx = 0, + posy = 0, + posz = 0, + color2r = 0.3, + color2g = 0.1, + color2b = 0.05, + colortime = 13, + r = 1.2, + g = 1.1, + b = 1.0, + a = 0.6, + modelfactor = 0.5, + specular = 0.3, + scattering = 0.3, + lensflare = 0, + lifetime = 20, + sustain = 2, +}) muzzleFlashLightsNames["armbrtha_lrpc"].yOffset = 8 -explosionLightsNames["armbrtha_lrpc"] = -GetLightClass("ExplosionXL", nil, "Large", { - colortime = 4, sustain = 12, lifetime = 26, scattering = 0.7}) +explosionLightsNames["armbrtha_lrpc"] = GetLightClass("ExplosionXL", nil, "Large", { + colortime = 4, + sustain = 12, + lifetime = 26, + scattering = 0.7, +}) --armvulc -muzzleFlashLightsNames["armvulc_rflrpc"] = -GetLightClass("MuzzleFlash", nil, "Medium", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 1.1, b = 1.0, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 17, sustain = 2}) +muzzleFlashLightsNames["armvulc_rflrpc"] = GetLightClass("MuzzleFlash", nil, "Medium", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 1.1, b = 1.0, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 17, sustain = 2 }) muzzleFlashLightsNames["armvulc_rflrpc"].yOffset = 4 -explosionLightsNames["armvulc_rflrpc"] = -GetLightClass("ExplosionXL", nil, "Large", {colortime = 3.5, sustain = 14, lifetime = 26, scattering = 0.7}) - -projectileDefLightsNames["armvulc_rflrpc"] = -GetLightClass("LRPCProjectile", nil, "Mediumer") +explosionLightsNames["armvulc_rflrpc"] = GetLightClass("ExplosionXL", nil, "Large", { colortime = 3.5, sustain = 14, lifetime = 26, scattering = 0.7 }) +projectileDefLightsNames["armvulc_rflrpc"] = GetLightClass("LRPCProjectile", nil, "Mediumer") --corbuzz -muzzleFlashLightsNames["corbuzz_rflrpc"] = -GetLightClass("MuzzleFlash", nil, "Medium", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 1.1, b = 1.0, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 17, sustain = 2}) +muzzleFlashLightsNames["corbuzz_rflrpc"] = GetLightClass("MuzzleFlash", nil, "Medium", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 1.1, b = 1.0, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 17, sustain = 2 }) muzzleFlashLightsNames["corbuzz_rflrpc"].yOffset = 4 -explosionLightsNames["corbuzz_rflrpc"] = -GetLightClass("ExplosionXL", nil, "Large", {colortime = 3.5, sustain = 14, lifetime = 26, scattering = 0.7}) - -projectileDefLightsNames["corbuzz_rflrpc"] = -GetLightClass("LRPCProjectile", nil, "Mediumer") - -muzzleFlashLightsNames["armsnipe_old_armsnipe_weapon"] = -GetLightClass("MuzzleFlash", nil, "SmallMedium", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 0.85, b = 0.6, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 13, sustain = 1.5}) - -muzzleFlashLightsNames["armpb_armpb_weapon"] = -GetLightClass("MuzzleFlash", nil, "Smaller", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 0.85, b = 0.6, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 13, sustain = 1.5}) +explosionLightsNames["corbuzz_rflrpc"] = GetLightClass("ExplosionXL", nil, "Large", { colortime = 3.5, sustain = 14, lifetime = 26, scattering = 0.7 }) + +projectileDefLightsNames["corbuzz_rflrpc"] = GetLightClass("LRPCProjectile", nil, "Mediumer") + +muzzleFlashLightsNames["armsnipe_old_armsnipe_weapon"] = GetLightClass("MuzzleFlash", nil, "SmallMedium", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 0.85, b = 0.6, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 13, sustain = 1.5 }) + +muzzleFlashLightsNames["armpb_armpb_weapon"] = GetLightClass("MuzzleFlash", nil, "Smaller", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 0.85, b = 0.6, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 13, sustain = 1.5 }) -- arm t1 naval def turret -muzzleFlashLightsNames["armnavaldefturret_arm_medium_gauss_cannon"] = -GetLightClass("MuzzleFlash", nil, "Smaller", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 0.85, b = 0.6, a = 0.35, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 13, sustain = 1.5}) - -muzzleFlashLightsNames["corlevlr_corlevlr_weapon"] = -GetLightClass("MuzzleFlash", nil, "Smaller", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 0.85, b = 0.6, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 13, sustain = 1.5}) - -muzzleFlashLightsNames["cormort_cor_mort"] = -GetLightClass("MuzzleFlash", nil, "Tiniest", {posx = 0, posy = 0, posz = 0, - r = 1.2, g = 1, b = 0.9, a = 0.5, - color2r = 0.25, color2g = 0.14, color2b = 0.07, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 13, sustain = 1.5}) +muzzleFlashLightsNames["armnavaldefturret_arm_medium_gauss_cannon"] = GetLightClass("MuzzleFlash", nil, "Smaller", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 0.85, b = 0.6, a = 0.35, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 13, sustain = 1.5 }) + +muzzleFlashLightsNames["corlevlr_corlevlr_weapon"] = GetLightClass("MuzzleFlash", nil, "Smaller", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 0.85, b = 0.6, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 13, sustain = 1.5 }) + +muzzleFlashLightsNames["cormort_cor_mort"] = GetLightClass("MuzzleFlash", nil, "Tiniest", { posx = 0, posy = 0, posz = 0, r = 1.2, g = 1, b = 0.9, a = 0.5, color2r = 0.25, color2g = 0.14, color2b = 0.07, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 13, sustain = 1.5 }) -- muzzleFlashLightsNames["corvipe_vipersabot"] = -- GetLightClass("MuzzleFlash", nil, "Smaller", {posx = 0, posy = 0, posz = 0, @@ -860,30 +1105,17 @@ GetLightClass("MuzzleFlash", nil, "Tiniest", {posx = 0, posy = 0, posz = 0, -- color2r = 0.22, color2g = 0.37, color2b = 0.79, colortime = 5, -- }) - --corsilo -explosionLightsNames["corsilo_crblmssl"] = -GetLightClass("Explosion", nil, "Tera", {r = 3, g = 3, b = 2.8, a = 0.2, - color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, - sustain = 30, lifetime = 200, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) +explosionLightsNames["corsilo_crblmssl"] = GetLightClass("Explosion", nil, "Tera", { r = 3, g = 3, b = 2.8, a = 0.2, color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, sustain = 30, lifetime = 200, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) --corsilo engine -projectileDefLightsNames["corsilo_crblmssl"] = -GetLightClass("MissileProjectile", "Warm", "Large", {a = 0.6, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) +projectileDefLightsNames["corsilo_crblmssl"] = GetLightClass("MissileProjectile", "Warm", "Large", { a = 0.6, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) --RAPTOR Nuclear Meteor -explosionLightsNames["raptor_turret_meteor_t4_v1_weapon"] = -GetLightClass("Explosion", nil, "Tera", {r = 3, g = 3, b = 2.8, a = 0.2, - color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, - sustain = 30, lifetime = 200, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) +explosionLightsNames["raptor_turret_meteor_t4_v1_weapon"] = GetLightClass("Explosion", nil, "Tera", { r = 3, g = 3, b = 2.8, a = 0.2, color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, sustain = 30, lifetime = 200, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) --RAPTOR Nuclear Meteor engine -projectileDefLightsNames["raptor_turret_meteor_t4_v1_weapon"] = -GetLightClass("MissileProjectile", "Fire", "Large", {a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) +projectileDefLightsNames["raptor_turret_meteor_t4_v1_weapon"] = GetLightClass("MissileProjectile", "Fire", "Large", { a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) -- --corsilo SCAV -- explosionLightsNames["corsilo_scav_crblmssl"] = @@ -899,48 +1131,23 @@ GetLightClass("MissileProjectile", "Fire", "Large", {a = 0.8, -- modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) --armsilo -explosionLightsNames["armsilo_nuclear_missile"] = -GetLightClass("Explosion", nil, "Giga", {r = 3, g = 3, b = 2.8, a = 0.18, - color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 110, - sustain = 25, lifetime = 180, selfshadowing = 4, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) - - --armsilo -explosionLightsNames["armguardnuke_plasma"] = -GetLightClass("Explosion", nil, "Giga", {r = 3, g = 2.9, b = 2.8, a = 0.18, - posx = 0, posy = 1, posz = 0, - dirx = 0, diry = -0.12, dirz = 0, - color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 110, - sustain = 25, lifetime = 155, selfshadowing = 3, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) - -projectileDefLightsNames["armguardnuke_plasma"] = -GetLightClass("MissileProjectile", "Warm", "Medium", {a = 0.4, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) +explosionLightsNames["armsilo_nuclear_missile"] = GetLightClass("Explosion", nil, "Giga", { r = 3, g = 3, b = 2.8, a = 0.18, color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 110, sustain = 25, lifetime = 180, selfshadowing = 4, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) -projectileDefLightsNames["armguardnuke_plasma_high"] = -GetLightClass("MissileProjectile", "Warm", "Medium", {a = 0.4, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) +--armsilo +explosionLightsNames["armguardnuke_plasma"] = GetLightClass("Explosion", nil, "Giga", { r = 3, g = 2.9, b = 2.8, a = 0.18, posx = 0, posy = 1, posz = 0, dirx = 0, diry = -0.12, dirz = 0, color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 110, sustain = 25, lifetime = 155, selfshadowing = 3, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) +projectileDefLightsNames["armguardnuke_plasma"] = GetLightClass("MissileProjectile", "Warm", "Medium", { a = 0.4, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) +projectileDefLightsNames["armguardnuke_plasma_high"] = GetLightClass("MissileProjectile", "Warm", "Medium", { a = 0.4, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) --armsilo engine -projectileDefLightsNames["armsilo_nuclear_missile"] = -GetLightClass("MissileProjectile", "Warm", "Large", {a = 0.6, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) +projectileDefLightsNames["armsilo_nuclear_missile"] = GetLightClass("MissileProjectile", "Warm", "Large", { a = 0.6, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) --legsilo -explosionLightsNames["legsilo_legicbm"] = -GetLightClass("Explosion", nil, "Tera", {r = 3, g = 3, b = 2.8, a = 0.2, - color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, - sustain = 30, lifetime = 200, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) +explosionLightsNames["legsilo_legicbm"] = GetLightClass("Explosion", nil, "Tera", { r = 3, g = 3, b = 2.8, a = 0.2, color2r = 1.0, color2g = 0.6, color2b = 0.18, colortime = 120, sustain = 30, lifetime = 200, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) --legsilo engine -projectileDefLightsNames["legsilo_legicbm"] = -GetLightClass("MissileProjectile", "Warm", "Large", {a = 0.6, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0}) - +projectileDefLightsNames["legsilo_legicbm"] = GetLightClass("MissileProjectile", "Warm", "Large", { a = 0.6, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0 }) -- --armsilo SCAV -- explosionLightsNames["armsilo_scav_nuclear_missile"] = @@ -956,54 +1163,24 @@ GetLightClass("MissileProjectile", "Warm", "Large", {a = 0.6, -- modelfactor = 0.1, specular = 0.1, scattering = 0.4, lensflare = 0}) --legbart -explosionLightsNames["legbart_clusternapalm"] = -GetLightClass("Explosion", "Fire", "SmallMedium", {r = 0.32, g = 0.24, b = 0.1, a = 0.1, - color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, - sustain = 120, lifetime = 180, - modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0}) +explosionLightsNames["legbart_clusternapalm"] = GetLightClass("Explosion", "Fire", "SmallMedium", { r = 0.32, g = 0.24, b = 0.1, a = 0.1, color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, sustain = 120, lifetime = 180, modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0 }) --legbar -explosionLightsNames["legbar_clusternapalm"] = -GetLightClass("Explosion", "Fire", "Small", {r = 0.32, g = 0.24, b = 0.1, a = 0.005, - color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, - sustain = 120, lifetime = 180, - modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0}) +explosionLightsNames["legbar_clusternapalm"] = GetLightClass("Explosion", "Fire", "Small", { r = 0.32, g = 0.24, b = 0.1, a = 0.005, color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, sustain = 120, lifetime = 180, modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0 }) --leginf -explosionLightsNames["leginf_rapidnapalm"] = -GetLightClass("Explosion", "Fire", "Small", {r = 0.32, g = 0.24, b = 0.1, a = 0.001, - color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 180, - sustain = 30, lifetime = 180, - modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0}) +explosionLightsNames["leginf_rapidnapalm"] = GetLightClass("Explosion", "Fire", "Small", { r = 0.32, g = 0.24, b = 0.1, a = 0.001, color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 180, sustain = 30, lifetime = 180, modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0 }) --legnap -explosionLightsNames["legnap_napalmbombs"] = -GetLightClass("Explosion", "Fire", "Small", {r = 0.32, g = 0.24, b = 0.1, a = 0.1, - color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, - sustain = 120, lifetime = 180, - modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0}) +explosionLightsNames["legnap_napalmbombs"] = GetLightClass("Explosion", "Fire", "Small", { r = 0.32, g = 0.24, b = 0.1, a = 0.1, color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, sustain = 120, lifetime = 180, modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0 }) --legperdition -explosionLightsNames["legperdition_napalmmissile"] = -GetLightClass("Explosion", "Fire", "Large", {r = 0.32, g = 0.24, b = 0.1, a = 0.1, - color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, - sustain = 120, lifetime = 180, - modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0}) +explosionLightsNames["legperdition_napalmmissile"] = GetLightClass("Explosion", "Fire", "Large", { r = 0.32, g = 0.24, b = 0.1, a = 0.1, color2r = 0.8, color2g = 0.4, color2b = 0.1, colortime = 44, sustain = 120, lifetime = 180, modelfactor = -0.3, specular = -0.3, scattering = 0.3, lensflare = 0 }) --legphoenix -explosionLightsNames["legphoenix_skybeam"] = -GetLightClass("Explosion", "Fire", "Small", {r = 0.54, g = 0.45, b = 0.12, a = 0.35, - color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.25, - sustain = 2, lifetime = 3, - modelfactor = -0.3, specular = -0.3, scattering = 0.45, lensflare = 0}) - -projectileDefLightsNames["legphoenix_skybeam"] = -GetLightClass("LaserProjectile", "Warm", "Tiny", {a = 0.25, - r = 1.0, g = 0.65, b = 0.1, - color2r = 0.3, color2g = 0.1, color2b = 0.03, colortime = 15, - pos2x = 0, pos2y = 0, pos2z = 0, - modelfactor = 0.5, specular = 0.05, scattering = 1.3, lensflare = 16, - lifetime = 3, sustain = 2,}) +explosionLightsNames["legphoenix_skybeam"] = GetLightClass("Explosion", "Fire", "Small", { r = 0.54, g = 0.45, b = 0.12, a = 0.35, color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.25, sustain = 2, lifetime = 3, modelfactor = -0.3, specular = -0.3, scattering = 0.45, lensflare = 0 }) + +projectileDefLightsNames["legphoenix_skybeam"] = GetLightClass("LaserProjectile", "Warm", "Tiny", { a = 0.25, r = 1.0, g = 0.65, b = 0.1, color2r = 0.3, color2g = 0.1, color2b = 0.03, colortime = 15, pos2x = 0, pos2y = 0, pos2z = 0, modelfactor = 0.5, specular = 0.05, scattering = 1.3, lensflare = 16, lifetime = 3, sustain = 2 }) --legaheattank -- explosionLightsNames["legaheattank_heat_ray"] = @@ -1023,125 +1200,203 @@ GetLightClass("LaserProjectile", "Warm", "Tiny", {a = 0.25, --explosionLightsNames["legbastion_t2heatray"].yOffset = 28 -projectileDefLightsNames["legbastion_t2heatray"] = -GetLightClass("LaserProjectile", nil, "Small", {r = 1.0, g = 0.65, b = 0.1, a = 0.18, - color2r = 0.15, color2g = 0.04, color2b = 0.015, colortime = 0.03, - --pos2x = 0, pos2y = 0, pos2z = 0, - modelfactor = 0.5, specular = -0.1, scattering = 2.9, lensflare = 0, - lifetime = 3, sustain = 2}) +projectileDefLightsNames["legbastion_t2heatray"] = GetLightClass("LaserProjectile", nil, "Small", { + r = 1.0, + g = 0.65, + b = 0.1, + a = 0.18, + color2r = 0.15, + color2g = 0.04, + color2b = 0.015, + colortime = 0.03, + --pos2x = 0, pos2y = 0, pos2z = 0, + modelfactor = 0.5, + specular = -0.1, + scattering = 2.9, + lensflare = 0, + lifetime = 3, + sustain = 2, +}) --leginc -explosionLightsNames["leginc_heatraylarge"] = -GetLightClass("Explosion", "Fire", "Smaller", {r = 0.54, g = 0.45, b = 0.12, a = 0.15, - color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.3, - sustain = 2, lifetime = 3, - modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0}) +explosionLightsNames["leginc_heatraylarge"] = GetLightClass("Explosion", "Fire", "Smaller", { r = 0.54, g = 0.45, b = 0.12, a = 0.15, color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.3, sustain = 2, lifetime = 3, modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 }) explosionLightsNames["leginc_heatraylarge"].yOffset = 32 -projectileDefLightsNames["leginc_heatraylarge"] = -GetLightClass("LaserProjectile", "Warm", "Smallest", {r = 1.0, g = 0.65, b = 0.1, a = 0.15, - color2r = 0.15, color2g = 0.05, color2b = 0.015, colortime = 0.03, - --pos2x = 0, pos2y = 0, pos2z = 0, - modelfactor = 0.3, specular = -0.05, scattering = 0.3, lensflare = 16, - sustain = 2, lifetime = 3, }) +projectileDefLightsNames["leginc_heatraylarge"] = GetLightClass("LaserProjectile", "Warm", "Smallest", { + r = 1.0, + g = 0.65, + b = 0.1, + a = 0.15, + color2r = 0.15, + color2g = 0.05, + color2b = 0.015, + colortime = 0.03, + --pos2x = 0, pos2y = 0, pos2z = 0, + modelfactor = 0.3, + specular = -0.05, + scattering = 0.3, + lensflare = 16, + sustain = 2, + lifetime = 3, +}) --legeheatraymech -explosionLightsNames["legeheatraymech_heatray1"] = -GetLightClass("Explosion", "Fire", "SmallMedium", {r = 0.26, g = 0.26, b = 0.06, a = 0.09, - color2r = 0.9, color2g = 0.5, color2b = 0.2, colortime = 0.5, - sustain = 2, lifetime = 3, - modelfactor = -0.3, specular = -0.2, scattering = 0.8, lensflare = 0}) +explosionLightsNames["legeheatraymech_heatray1"] = GetLightClass("Explosion", "Fire", "SmallMedium", { r = 0.26, g = 0.26, b = 0.06, a = 0.09, color2r = 0.9, color2g = 0.5, color2b = 0.2, colortime = 0.5, sustain = 2, lifetime = 3, modelfactor = -0.3, specular = -0.2, scattering = 0.8, lensflare = 0 }) explosionLightsNames["legeheatraymech_heatray1"].yOffset = 32 -projectileDefLightsNames["legeheatraymech_heatray1"] = -GetLightClass("LaserProjectile", "Warm", "Smallest", {r = 1.0, g = 0.65, b = 0.1, a = 0.25, - color2r = 0.15, color2g = 0.05, color2b = 0.015, colortime = 0.03, - --pos2x = 0, pos2y = 0, pos2z = 0, - modelfactor = 0.3, specular = -0.05, scattering = 3.9, lensflare = 16, - sustain = 2, lifetime = 3, }) - +projectileDefLightsNames["legeheatraymech_heatray1"] = GetLightClass("LaserProjectile", "Warm", "Smallest", { + r = 1.0, + g = 0.65, + b = 0.1, + a = 0.25, + color2r = 0.15, + color2g = 0.05, + color2b = 0.015, + colortime = 0.03, + --pos2x = 0, pos2y = 0, pos2z = 0, + modelfactor = 0.3, + specular = -0.05, + scattering = 3.9, + lensflare = 16, + sustain = 2, + lifetime = 3, +}) --armthundt4 -explosionLightsNames["armthundt4_armbomb"] = -GetLightClass("Explosion", nil, "Large", {r = 2, g = 1.5, b = 1.0, a = 0.22, - color2r = 0.9, color2g = 0.5, color2b = 0.15, colortime = 65, - sustain = 4, lifetime = 55, - modelfactor = 0.1, specular = 0.4, scattering = 0.4, lensflare = 6}) +explosionLightsNames["armthundt4_armbomb"] = GetLightClass("Explosion", nil, "Large", { r = 2, g = 1.5, b = 1.0, a = 0.22, color2r = 0.9, color2g = 0.5, color2b = 0.15, colortime = 65, sustain = 4, lifetime = 55, modelfactor = 0.1, specular = 0.4, scattering = 0.4, lensflare = 6 }) --armmerl -projectileDefLightsNames["armmerl_armtruck_rocket"] = -GetLightClass("MissileProjectile", "Warm", "Small", {a = 0.60, - modelfactor = 0.1, specular = 0.01, scattering = 0.5, lensflare = 8}) +projectileDefLightsNames["armmerl_armtruck_rocket"] = GetLightClass("MissileProjectile", "Warm", "Small", { a = 0.60, modelfactor = 0.1, specular = 0.01, scattering = 0.5, lensflare = 8 }) --armmerl -projectileDefLightsNames["corvroc_cortruck_rocket"] = -GetLightClass("MissileProjectile", "Warm", "Small", {a = 0.60, - modelfactor = 0.1, specular = 0.01, scattering = 0.5, lensflare = 8}) +projectileDefLightsNames["corvroc_cortruck_rocket"] = GetLightClass("MissileProjectile", "Warm", "Small", { a = 0.60, modelfactor = 0.1, specular = 0.01, scattering = 0.5, lensflare = 8 }) -- armbeamer -projectileDefLightsNames["armbeamer_armbeamer_weapon"] = -GetLightClass("LaserProjectile", nil, "Medium", {a = 0.20, - --r = 1.0, g = 0.65, b = 0.1, radius = 240, - r = 0.1, g = 0.1, b = 1, radius = 110, - color2r = 0.03, color2g = 0.05, color2b = 0.3, colortime = 1.6, - pos2x = 0, pos2y = 100, pos2z = 0, - modelfactor = 0.5, specular = 0.05, scattering = 0.5, lensflare = 16, - selfshadowing = 5, - lifetime = 6, sustain = 0}) +projectileDefLightsNames["armbeamer_armbeamer_weapon"] = GetLightClass("LaserProjectile", nil, "Medium", { + a = 0.20, + --r = 1.0, g = 0.65, b = 0.1, radius = 240, + r = 0.1, + g = 0.1, + b = 1, + radius = 110, + color2r = 0.03, + color2g = 0.05, + color2b = 0.3, + colortime = 1.6, + pos2x = 0, + pos2y = 100, + pos2z = 0, + modelfactor = 0.5, + specular = 0.05, + scattering = 0.5, + lensflare = 16, + selfshadowing = 5, + lifetime = 6, + sustain = 0, +}) -- corcan -projectileDefLightsNames["corcan_cor_canlaser"] = -GetLightClass("LaserProjectile", nil, "Medium", {a = 0.15, - --r = 1.0, g = 0.65, b = 0.1, radius = 240, - r = 0.3, g = 1, b = 0.3, radius = 110, - color2r = 0.1, color2g = 0.5, color2b = 0.1, colortime = 2.5, - pos2x = 0, pos2y = 100, pos2z = 0, - modelfactor = 0.5, specular = 0.05, scattering = 0.5, lensflare = 16, - lifetime = 4, sustain = 0, selfshadowing = 5,}) +projectileDefLightsNames["corcan_cor_canlaser"] = GetLightClass("LaserProjectile", nil, "Medium", { + a = 0.15, + --r = 1.0, g = 0.65, b = 0.1, radius = 240, + r = 0.3, + g = 1, + b = 0.3, + radius = 110, + color2r = 0.1, + color2g = 0.5, + color2b = 0.1, + colortime = 2.5, + pos2x = 0, + pos2y = 100, + pos2z = 0, + modelfactor = 0.5, + specular = 0.05, + scattering = 0.5, + lensflare = 16, + lifetime = 4, + sustain = 0, + selfshadowing = 5, +}) -- corsumo -projectileDefLightsNames["corsumo_corsumo_weapon"] = -GetLightClass("LaserProjectile", nil, "Medium", {a = 0.15, - --r = 1.0, g = 0.65, b = 0.1, radius = 240, - r = 0.4, g = 1.0, b = 0.4, radius = 110, - color2r = 0.05, color2g = 0.1, color2b = 0.05, colortime = 5.6, - pos2x = 0, pos2y = 100, pos2z = 0, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 16, - lifetime = 2.8, sustain = 0, selfshadowing = 5,}) +projectileDefLightsNames["corsumo_corsumo_weapon"] = GetLightClass("LaserProjectile", nil, "Medium", { + a = 0.15, + --r = 1.0, g = 0.65, b = 0.1, radius = 240, + r = 0.4, + g = 1.0, + b = 0.4, + radius = 110, + color2r = 0.05, + color2g = 0.1, + color2b = 0.05, + colortime = 5.6, + pos2x = 0, + pos2y = 100, + pos2z = 0, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 16, + lifetime = 2.8, + sustain = 0, + selfshadowing = 5, +}) --corsumo -muzzleFlashLightsNames["corsumo_corsumo_weapon"] = -GetLightClass("MuzzleFlashCone", nil, "Large", { - posx = 0, posy = 0, posz = 0, radius = 240, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 50, - r = 1.2, g = 1.0, b = 0.9, a = 0.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 17, sustain = 2}) +muzzleFlashLightsNames["corsumo_corsumo_weapon"] = GetLightClass("MuzzleFlashCone", nil, "Large", { + posx = 0, + posy = 0, + posz = 0, + radius = 240, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 50, + r = 1.2, + g = 1.0, + b = 0.9, + a = 0.5, + modelfactor = 0.5, + specular = 0.3, + scattering = 0.3, + lensflare = 0, + lifetime = 17, + sustain = 2, +}) --legflak -- muzzleFlashLightsNames["legflak_legflak_gun"] = -- GetLightClass("MuzzleFlash", nil, "Small") - --corkorg -explosionLightsNames["corkorg_corkorg_laser"] = -GetLightClass("Explosion", "Fire", "Smallish", {r = 0.54, g = 0.45, b = 0.12, a = 0.33, - color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.3, - sustain = 2, lifetime = 3, - modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0}) +explosionLightsNames["corkorg_corkorg_laser"] = GetLightClass("Explosion", "Fire", "Smallish", { r = 0.54, g = 0.45, b = 0.12, a = 0.33, color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.3, sustain = 2, lifetime = 3, modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 }) -- org korglaser -projectileDefLightsNames["corkorg_corkorg_laser"] = -GetLightClass("LaserProjectile", nil, "Medium", {a = 0.09, - --r = 1.0, g = 0.65, b = 0.1, radius = 240, - r = 1.0, g = 0.75, b = 0.4, radius = 240, - color2r = 0.33, color2g = 0.05, color2b = 0.03, colortime = 3, - pos2x = 0, pos2y = 100, pos2z = 0, - modelfactor = 0.5, specular = 0.05, scattering = 0.05, lensflare = 16, - selfshadowing = 5, - lifetime = 6, sustain = 2}) +projectileDefLightsNames["corkorg_corkorg_laser"] = GetLightClass("LaserProjectile", nil, "Medium", { + a = 0.09, + --r = 1.0, g = 0.65, b = 0.1, radius = 240, + r = 1.0, + g = 0.75, + b = 0.4, + radius = 240, + color2r = 0.33, + color2g = 0.05, + color2b = 0.03, + colortime = 3, + pos2x = 0, + pos2y = 100, + pos2z = 0, + modelfactor = 0.5, + specular = 0.05, + scattering = 0.05, + lensflare = 16, + selfshadowing = 5, + lifetime = 6, + sustain = 2, +}) -- custom sharp white center beam -- projectileDefLightsNames["corkorg_corkorg_laser"] = @@ -1154,121 +1409,174 @@ GetLightClass("LaserProjectile", nil, "Medium", {a = 0.09, -- selfshadowing = 8, -- lifetime = 23, sustain = 2}) -muzzleFlashLightsNames["corkorg_corkorg_laser"] = -GetLightClass("MuzzleFlash", "Fire", "Mega", {posx = 120, posy = 82, posz = 0, - r = 1.2, g = 1.1, b = 0.5, a = 0.9, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 20, - modelfactor = 0.5, specular = 0.3, scattering = 2.8, lensflare = 9, - lifetime = 120, sustain = 4}) +muzzleFlashLightsNames["corkorg_corkorg_laser"] = GetLightClass("MuzzleFlash", "Fire", "Mega", { posx = 120, posy = 82, posz = 0, r = 1.2, g = 1.1, b = 0.5, a = 0.9, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 20, modelfactor = 0.5, specular = 0.3, scattering = 2.8, lensflare = 9, lifetime = 120, sustain = 4 }) --muzzleflashes for corkorg broken?? -muzzleFlashLightsNames["corkorg_corkorg_fire"] = -GetLightClass("MuzzleFlash", "Plasma", "Tiny", { - r = 1.1, g = 0.85, b = 0.3, a = 0.6, - color2r = 0.3, color2g = 0.12, color2b = 0.04, colortime = 15, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 20, sustain = 2}) +muzzleFlashLightsNames["corkorg_corkorg_fire"] = GetLightClass("MuzzleFlash", "Plasma", "Tiny", { + r = 1.1, + g = 0.85, + b = 0.3, + a = 0.6, + color2r = 0.3, + color2g = 0.12, + color2b = 0.04, + colortime = 15, + modelfactor = 0.5, + specular = 0.3, + scattering = 0.1, + lensflare = 0, + lifetime = 20, + sustain = 2, +}) --corkorg_shotgun -projectileDefLightsNames["corkorg_corkorg_fire"] = -GetLightClass("CannonProjectile", "Plasma", "Smaller", {a = 0.012, radius = 200, - selfshadowing = 4, - modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 3}) - -explosionLightsNames["corkorg_corkorg_fire"] = -GetLightClass("Explosion", "Fire", "Tiny", {r = 0.5, g = 0.3, b = 0.08, a = 0.4, - color2r = 1.2, color2g = 0.6, color2b = 0.4, colortime = 0.6, - sustain = 2, lifetime = 6, - modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 - }) - -projectileDefLightsNames["corpyro_flamethrower"] = -GetLightClass("FlameProjectile", nil, "Tiny", { - r = 0.7, g = 0.7, b = 0.65, a = 0.14, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 30, sustain = 15, - }) - -explosionLightsNames["corpyro_flamethrower"] = -GetLightClass("FlameProjectile", nil, "Smallest", { - r = 1.7, g = 0.7, b = 0.65, a = 0.03, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 6, sustain = 2, - }) +projectileDefLightsNames["corkorg_corkorg_fire"] = GetLightClass("CannonProjectile", "Plasma", "Smaller", { a = 0.012, radius = 200, selfshadowing = 4, modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 3 }) + +explosionLightsNames["corkorg_corkorg_fire"] = GetLightClass("Explosion", "Fire", "Tiny", { r = 0.5, g = 0.3, b = 0.08, a = 0.4, color2r = 1.2, color2g = 0.6, color2b = 0.4, colortime = 0.6, sustain = 2, lifetime = 6, modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 }) + +projectileDefLightsNames["corpyro_flamethrower"] = GetLightClass("FlameProjectile", nil, "Tiny", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.14, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 30, + sustain = 15, +}) ---explosionLightsNames["corpyro_flamethrower"].fraction = 5 +explosionLightsNames["corpyro_flamethrower"] = GetLightClass("FlameProjectile", nil, "Smallest", { + r = 1.7, + g = 0.7, + b = 0.65, + a = 0.03, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 6, + sustain = 2, +}) -projectileDefLightsNames["cormaw_dmaw"] = -GetLightClass("FlameProjectile", nil, "Smallish", { - r = 0.7, g = 0.7, b = 0.65, a = 0.03, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 70, sustain = 30, - }) +--explosionLightsNames["corpyro_flamethrower"].fraction = 5 -projectileDefLightsNames["corfship_dmaw"] = -GetLightClass("FlameProjectile", nil, "Smallish", { - r = 0.7, g = 0.7, b = 0.65, a = 0.05, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 70, sustain = 30, - }) +projectileDefLightsNames["cormaw_dmaw"] = GetLightClass("FlameProjectile", nil, "Smallish", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.03, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 70, + sustain = 30, +}) +projectileDefLightsNames["corfship_dmaw"] = GetLightClass("FlameProjectile", nil, "Smallish", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.05, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 70, + sustain = 30, +}) -projectileDefLightsNames["corcrwh_dragonmawh"] = -GetLightClass("FlameProjectile", nil, "Smallest", { - r = 0.7, g = 0.7, b = 0.65, a = 0.19, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 70, sustain = 30, selfshadowing = 0, - }) +projectileDefLightsNames["corcrwh_dragonmawh"] = GetLightClass("FlameProjectile", nil, "Smallest", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.19, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 70, + sustain = 30, + selfshadowing = 0, +}) projectileDefLightsNames["corcrwh_dragonmawh"].yOffset = 32 -explosionLightsNames["corcrwh_dragonmawh"] = -GetLightClass("FlameProjectile", nil, "Smaller", { - r = 0.3, g = 0.2, b = 0.09, a = 0.020, - color2r = 1.0, color2g = 0.45, color2b = 0.22, colortime = 10, - lifetime = 20, sustain = 3, selfshadowing = 0, - }) +explosionLightsNames["corcrwh_dragonmawh"] = GetLightClass("FlameProjectile", nil, "Smaller", { + r = 0.3, + g = 0.2, + b = 0.09, + a = 0.020, + color2r = 1.0, + color2g = 0.45, + color2b = 0.22, + colortime = 10, + lifetime = 20, + sustain = 3, + selfshadowing = 0, +}) explosionLightsNames["corcrwh_dragonmawh"].yOffset = 32 --explosionLightsNames["corcrwh_dragonmawh"].fraction = 5 -explosionLightsNames["corcrwh_krowlaserh"] = -GetLightClass("Explosion", "Red", "Micro", { - r = 1, g = 0.3, b = 0.08, a = 0.4, - color2r = 1.2, color2g = 0.6, color2b = 0.4, colortime = 0.6, - sustain = 1, lifetime = 3, - --modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 - }) - - +explosionLightsNames["corcrwh_krowlaserh"] = GetLightClass("Explosion", "Red", "Micro", { + r = 1, + g = 0.3, + b = 0.08, + a = 0.4, + color2r = 1.2, + color2g = 0.6, + color2b = 0.4, + colortime = 0.6, + sustain = 1, + lifetime = 3, + --modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 +}) -projectileDefLightsNames["corcrwt4_kmaw"] = -GetLightClass("FlameProjectile", nil, "Medium", { - r = 0.7, g = 0.7, b = 0.65, a = 0.13, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 70, sustain = 30, - }) +projectileDefLightsNames["corcrwt4_kmaw"] = GetLightClass("FlameProjectile", nil, "Medium", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.13, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 70, + sustain = 30, +}) -projectileDefLightsNames["cordemon_newdmaw"] = -GetLightClass("FlameProjectile", nil, "Medium", { - r = 0.7, g = 0.7, b = 0.65, a = 0.05, - color2r = 1.0, color2g = 0.70, color2b = 0.4, colortime = 12, - lifetime = 40, sustain = 30, - }) +projectileDefLightsNames["cordemon_newdmaw"] = GetLightClass("FlameProjectile", nil, "Medium", { + r = 0.7, + g = 0.7, + b = 0.65, + a = 0.05, + color2r = 1.0, + color2g = 0.70, + color2b = 0.4, + colortime = 12, + lifetime = 40, + sustain = 30, +}) --corkorg_rocket -projectileDefLightsNames["corkorg_corkorg_rocket"] = -GetLightClass("MissileProjectile", "Warm", "SmallMedium", {a = 0.40, - r = 1.2, g = 0.65, b = 0.1, radius = 80, - color2r = 1.2, color2g = 0.7, color2b = 0.4, - modelfactor = 0.5, specular = 0.05, scattering = 0.45, lensflare = 5}) - -explosionLightsNames["corkorg_corkorg_rocket"] = -GetLightClass("Explosion", "Fire", "Medium", {r = 0.4, g = 0.2, b = 0.08, a = 0.5, radius = 240, - color2r = 1.2, color2g = 0.9, color2b = 0.4, - sustain = 4, lifetime = 10, - --modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 - }) +projectileDefLightsNames["corkorg_corkorg_rocket"] = GetLightClass("MissileProjectile", "Warm", "SmallMedium", { a = 0.40, r = 1.2, g = 0.65, b = 0.1, radius = 80, color2r = 1.2, color2g = 0.7, color2b = 0.4, modelfactor = 0.5, specular = 0.05, scattering = 0.45, lensflare = 5 }) + +explosionLightsNames["corkorg_corkorg_rocket"] = GetLightClass("Explosion", "Fire", "Medium", { + r = 0.4, + g = 0.2, + b = 0.08, + a = 0.5, + radius = 240, + color2r = 1.2, + color2g = 0.9, + color2b = 0.4, + sustain = 4, + lifetime = 10, + --modelfactor = -0.3, specular = -0.1, scattering = 1.95, lensflare = 0 +}) -- --corkorg_scav -- projectileDefLightsNames["corkorg_scav_corkorg_laser"] = @@ -1278,40 +1586,38 @@ GetLightClass("Explosion", "Fire", "Medium", {r = 0.4, g = 0.2, b = 0.08, a = 0. -- lifetime = 4, sustain = 0}) --cordoomt3 -projectileDefLightsNames["cordoomt3_armagmheat"] = -GetLightClass("LaserProjectile", "HeatRay", "Mediumer", {a = 0.09, - color2r = 0.5, color2g = 0.3, color2b = 0.2, colortime = 10, - modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 4, sustain = 0}) +projectileDefLightsNames["cordoomt3_armagmheat"] = GetLightClass("LaserProjectile", "HeatRay", "Mediumer", { a = 0.09, color2r = 0.5, color2g = 0.3, color2b = 0.2, colortime = 10, modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 4, sustain = 0 }) --cortron -explosionLightsNames["cortron_cortron_weapon"] = -GetLightClass("Explosion", nil, "Large", {r = 3, g = 2.5, b = 2.0, a = 0.25, - color2r = 0.5, color2g = 0.2, color2b = 0.09, colortime = 10, - sustain = 4, lifetime = 120, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) - -projectileDefLightsNames["cortron_cortron_weapon"] = -GetLightClass("MissileProjectile", "Red", "SmallMedium", { - --lifetime = 200, - --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, - modelfactor = 0.3, specular = 0.1, scattering = 0.4, lensflare = 7}) - +explosionLightsNames["cortron_cortron_weapon"] = GetLightClass("Explosion", nil, "Large", { r = 3, g = 2.5, b = 2.0, a = 0.25, color2r = 0.5, color2g = 0.2, color2b = 0.09, colortime = 10, sustain = 4, lifetime = 120, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) + +projectileDefLightsNames["cortron_cortron_weapon"] = GetLightClass("MissileProjectile", "Red", "SmallMedium", { + --lifetime = 200, + --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, + modelfactor = 0.3, + specular = 0.1, + scattering = 0.4, + lensflare = 7, +}) --armjuno -projectileDefLightsNames["armjuno_juno_pulse"] = -GetLightClass("MissileProjectile", "Green", "SmallMedium", {r = 0.02, g = 0.05, b = 0.01, a = 0.25, - color2r = 0.88, color2g = 1.5, color2b = 0.6, colortime = 150, - --lifetime = 200, - --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, - modelfactor = 0.3, specular = 0.1, scattering = 0.4, lensflare = 7}) -explosionLightsNames["armjuno_juno_pulse"] = -GetLightClass("Explosion", "Green", "Largest", {a = 0.6, - posx = 0, posy = 100, posz = 0, - r = 0.9, g = 1.1, b = 0.45, - color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 100, - sustain = 15, lifetime = 500, - modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6}) +projectileDefLightsNames["armjuno_juno_pulse"] = GetLightClass("MissileProjectile", "Green", "SmallMedium", { + r = 0.02, + g = 0.05, + b = 0.01, + a = 0.25, + color2r = 0.88, + color2g = 1.5, + color2b = 0.6, + colortime = 150, + --lifetime = 200, + --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, + modelfactor = 0.3, + specular = 0.1, + scattering = 0.4, + lensflare = 7, +}) +explosionLightsNames["armjuno_juno_pulse"] = GetLightClass("Explosion", "Green", "Largest", { a = 0.6, posx = 0, posy = 100, posz = 0, r = 0.9, g = 1.1, b = 0.45, color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 100, sustain = 15, lifetime = 500, modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6 }) -- --armjuno SCAV -- projectileDefLightsNames["armjuno_scav_juno_pulse"] = @@ -1327,78 +1633,59 @@ GetLightClass("Explosion", "Green", "Largest", {a = 0.6, -- modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6}) --corjuno -projectileDefLightsNames["corjuno_juno_pulse"] = -GetLightClass("MissileProjectile", "Green", "SmallMedium", {r = 0.02, g = 0.05, b = 0.01, a = 0.25, - color2r = 0.88, color2g = 1.5, color2b = 0.6, colortime = 150, - --lifetime = 200, - --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, - modelfactor = 0.3, specular = 0.1, scattering = 0.4, lensflare = 7}) -explosionLightsNames["corjuno_juno_pulse"] = -GetLightClass("Explosion", "Green", "Largest", {a = 0.6, - posx = 0, posy = 100, posz = 0, - r = 0.9, g = 1.1, b = 0.45, - color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 50, - sustain = 10, lifetime = 400, - modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6}) +projectileDefLightsNames["corjuno_juno_pulse"] = GetLightClass("MissileProjectile", "Green", "SmallMedium", { + r = 0.02, + g = 0.05, + b = 0.01, + a = 0.25, + color2r = 0.88, + color2g = 1.5, + color2b = 0.6, + colortime = 150, + --lifetime = 200, + --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, + modelfactor = 0.3, + specular = 0.1, + scattering = 0.4, + lensflare = 7, +}) +explosionLightsNames["corjuno_juno_pulse"] = GetLightClass("Explosion", "Green", "Largest", { a = 0.6, posx = 0, posy = 100, posz = 0, r = 0.9, g = 1.1, b = 0.45, color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 50, sustain = 10, lifetime = 400, modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6 }) --legjuno -projectileDefLightsNames["legjuno_juno_pulse"] = -GetLightClass("MissileProjectile", "Green", "SmallMedium", {r = 0.02, g = 0.05, b = 0.01, a = 0.25, - color2r = 0.88, color2g = 1.5, color2b = 0.6, colortime = 150, - --lifetime = 200, - --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, - modelfactor = 0.3, specular = 0.1, scattering = 0.4, lensflare = 7}) -explosionLightsNames["legjuno_juno_pulse"] = -GetLightClass("Explosion", "Green", "Largest", {a = 0.6, - posx = 0, posy = 100, posz = 0, - r = 0.9, g = 1.1, b = 0.45, - color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 100, - sustain = 15, lifetime = 500, - modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6}) - +projectileDefLightsNames["legjuno_juno_pulse"] = GetLightClass("MissileProjectile", "Green", "SmallMedium", { + r = 0.02, + g = 0.05, + b = 0.01, + a = 0.25, + color2r = 0.88, + color2g = 1.5, + color2b = 0.6, + colortime = 150, + --lifetime = 200, + --color2r = 0.75, color2g = 0.9, color2b = 0.3, colortime = 25, + modelfactor = 0.3, + specular = 0.1, + scattering = 0.4, + lensflare = 7, +}) +explosionLightsNames["legjuno_juno_pulse"] = GetLightClass("Explosion", "Green", "Largest", { a = 0.6, posx = 0, posy = 100, posz = 0, r = 0.9, g = 1.1, b = 0.45, color2r = 0.32, color2g = 0.5, color2b = 0.12, colortime = 100, sustain = 15, lifetime = 500, modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6 }) --armpw machinegun -muzzleFlashLightsNames["armpw_emg"] = -GetLightClass("MuzzleFlash", "Warm", "Medium", {posx = 1, posy = 1, posz = 1, radius = 50, - r = 1.2, g = 1.1, b = 1.0, a = 0.5, - color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, - lifetime = 17, sustain = 2}) +muzzleFlashLightsNames["armpw_emg"] = GetLightClass("MuzzleFlash", "Warm", "Medium", { posx = 1, posy = 1, posz = 1, radius = 50, r = 1.2, g = 1.1, b = 1.0, a = 0.5, color2r = 0.3, color2g = 0.12, color2b = 0.05, colortime = 4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 14, lifetime = 17, sustain = 2 }) --armmanni -projectileDefLightsNames["armmanni_atam"] = -GetLightClass("LaserProjectile", "Blue", "SmallMedium", {a = 0.09, - color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 10, - modelfactor = 0.5, specular = 0.1, scattering = 0.7, lensflare = 0, - selfshadowing = 8, - lifetime = 0, sustain = 0}) +projectileDefLightsNames["armmanni_atam"] = GetLightClass("LaserProjectile", "Blue", "SmallMedium", { a = 0.09, color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 10, modelfactor = 0.5, specular = 0.1, scattering = 0.7, lensflare = 0, selfshadowing = 8, lifetime = 0, sustain = 0 }) --corjugg -explosionLightsNames["corjugg_juggernaut_fire"] = -GetLightClass("Explosion", nil, "Small", {r = 1.3, g = 1.1, b = 0.8, a = 0.4, - color2r = 0.35, color2g = 0.20, color2b = 0.05, colortime = 3, - sustain = 4, lifetime = 20, scattering = 0.2}) +explosionLightsNames["corjugg_juggernaut_fire"] = GetLightClass("Explosion", nil, "Small", { r = 1.3, g = 1.1, b = 0.8, a = 0.4, color2r = 0.35, color2g = 0.20, color2b = 0.05, colortime = 3, sustain = 4, lifetime = 20, scattering = 0.2 }) -projectileDefLightsNames["corjugg_juggernaut_fire"] = -GetLightClass("CannonProjectile", nil, "Large", {a = 0.5, - color2r = 0.5, color2g = 0.5, color2b = 0.6, colortime = 10, - modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 26, sustain = 20}) +projectileDefLightsNames["corjugg_juggernaut_fire"] = GetLightClass("CannonProjectile", nil, "Large", { a = 0.5, color2r = 0.5, color2g = 0.5, color2b = 0.6, colortime = 10, modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 26, sustain = 20 }) -- --armanni -projectileDefLightsNames["armanni_ata"] = -GetLightClass("LaserProjectile", "Blue", "Medium", {a = 0.09, - color2r = 0.5, color2g = 0.5, color2b = 0.6, colortime = 10, - modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0}) +projectileDefLightsNames["armanni_ata"] = GetLightClass("LaserProjectile", "Blue", "Medium", { a = 0.09, color2r = 0.5, color2g = 0.5, color2b = 0.6, colortime = 10, modelfactor = 0.5, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0 }) --corcat -explosionLightsNames["corcat_exp_heavyrocket"] = -GetLightClass("Explosion", nil, "Mediumer", {r = 3, g = 2.5, b = 2.0, a = 0.25, - color2r = 0.75, color2g = 0.40, color2b = 0.09, colortime = 4, - sustain = 7, lifetime = 32, - modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4}) - +explosionLightsNames["corcat_exp_heavyrocket"] = GetLightClass("Explosion", nil, "Mediumer", { r = 3, g = 2.5, b = 2.0, a = 0.25, color2r = 0.75, color2g = 0.40, color2b = 0.09, colortime = 4, sustain = 7, lifetime = 32, modelfactor = 0.1, specular = 0.2, scattering = 0.1, lensflare = 4 }) -- --corjuno SCAV -- projectileDefLightsNames["corjuno_scav_juno_pulse"] = @@ -1413,22 +1700,14 @@ GetLightClass("Explosion", nil, "Mediumer", {r = 3, g = 2.5, b = 2.0, a = 0.25, -- sustain = 10, lifetime = 400, -- modelfactor = 0.1, specular = 0.2, scattering = 0.3, lensflare = 6}) --scavengerbossv4 -explosionLightsNames['scavengerbossv4_normal_turbo_napalm'] = -GetLightClass("Explosion", "Fire", "SmallMedium", {r = 0.54, g = 0.45, b = 0.12, a = 0.29, - color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.03, - sustain = 40, lifetime = 150, - modelfactor = 0.3, specular = 0.8, scattering = 1.5, lensflare = 0}) - - +explosionLightsNames["scavengerbossv4_normal_turbo_napalm"] = GetLightClass("Explosion", "Fire", "SmallMedium", { r = 0.54, g = 0.45, b = 0.12, a = 0.29, color2r = 1.2, color2g = 0.5, color2b = 0.2, colortime = 0.03, sustain = 40, lifetime = 150, modelfactor = 0.3, specular = 0.8, scattering = 1.5, lensflare = 0 }) --duplicate lights from scavengerbossv4_normal_turbo_napalm for all scavengerbossv4 variants, including _scav -local scavengerBossV4Table = {'scavengerbossv4_veryeasy_turbo_napalm', 'scavengerbossv4_easy_turbo_napalm', 'scavengerbossv4_hard_turbo_napalm', 'scavengerbossv4_veryhard_turbo_napalm', 'scavengerbossv4_epic_turbo_napalm', - 'scavengerbossv4_veryeasy_scav_turbo_napalm', 'scavengerbossv4_easy_scav_turbo_napalm', 'scavengerbossv4_normal_scav_turbo_napalm', 'scavengerbossv4_hard_scav_turbo_napalm', 'scavengerbossv4_veryhard_scav_turbo_napalm', 'scavengerbossv4_epic_scav_turbo_napalm'} +local scavengerBossV4Table = { "scavengerbossv4_veryeasy_turbo_napalm", "scavengerbossv4_easy_turbo_napalm", "scavengerbossv4_hard_turbo_napalm", "scavengerbossv4_veryhard_turbo_napalm", "scavengerbossv4_epic_turbo_napalm", "scavengerbossv4_veryeasy_scav_turbo_napalm", "scavengerbossv4_easy_scav_turbo_napalm", "scavengerbossv4_normal_scav_turbo_napalm", "scavengerbossv4_hard_scav_turbo_napalm", "scavengerbossv4_veryhard_scav_turbo_napalm", "scavengerbossv4_epic_scav_turbo_napalm" } for _, name in pairs(scavengerBossV4Table) do - explosionLightsNames[name] = table.copy(explosionLightsNames['scavengerbossv4_normal_turbo_napalm']) + explosionLightsNames[name] = table.copy(explosionLightsNames["scavengerbossv4_normal_turbo_napalm"]) end - -- --armannit3 -- projectileDefLightsNames["armannit3_ata"] = -- GetLightClass("LaserProjectile", "Blue", "Mediumer", {a = 0.09, @@ -1554,23 +1833,20 @@ GetLightClass("Explosion", nil, "Small", {r = 1.3, g = 1.1, b = 0.8, a = 0.75, sustain = 8, lifetime = 26, scattering = 0.7}) ]] - -- hue hue turning these on will completely break the game... --projectileDefLightsNames["armrock_arm_bot_rocket"] = GetLightClass("LaserAimProjectile", "Red", "Large") --projectileDefLightsNames["corstorm_cor_bot_rocket"] = GetLightClass("LaserAimProjectile", "Red", "Large") - - -- duplicate all weapons for scavengers function applyScavVariants(name, params) local pos = name:find("_", 1, true) - local scavName = string.sub(name, 1, pos-1)..'_scav'..string.sub(name, pos) - if WeaponDefNames[scavName] then + local scavName = string.sub(name, 1, pos - 1) .. "_scav" .. string.sub(name, pos) + if WeaponDefNames[scavName] then local paramsScav = deepcopy(params) paramsScav.lightConfig.r, paramsScav.lightConfig.g, paramsScav.lightConfig.b = 0.3, 0.1, 0.7 paramsScav.lightConfig.color2r, paramsScav.lightConfig.color2g, paramsScav.lightConfig.color2b = 0.3, 0.1, 0.7 - return scavName, paramsScav - end + return scavName, paramsScav + end end -- convert weaponname -> weaponDefID @@ -1609,8 +1885,6 @@ for name, params in pairs(projectileDefLightsNames) do end projectileDefLightsNames = nil - - -- verification questions: -- colortime determines how slow the initial rgb color(1) fades to color2 ? -- too low colortime can induce flicker, why? @@ -1627,8 +1901,7 @@ projectileDefLightsNames = nil -- 3. DGun only has explosion GL4 lights, projectile lights do not seem to show/work properly (also muzzleflash does not work on DGun weapons) -- 4. When projectiles hit water, they get asigned a different explosion CEG, but also lighting is removed. I think some subtle blue-ish explo light on water can make it look better.. but how? - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Projectile Collection -return {muzzleFlashLights = muzzleFlashLights, projectileDefLights = projectileDefLights, explosionLights = explosionLights, gibLight = gibLight} +return { muzzleFlashLights = muzzleFlashLights, projectileDefLights = projectileDefLights, explosionLights = explosionLights, gibLight = gibLight } diff --git a/luaui/configs/DeferredLightsGL4config.lua b/luaui/configs/DeferredLightsGL4config.lua index 59c0a3fa2cc..45da262a29f 100644 --- a/luaui/configs/DeferredLightsGL4config.lua +++ b/luaui/configs/DeferredLightsGL4config.lua @@ -5,9 +5,8 @@ -- nanolasers should also be here -- (c) Beherith (mysterme@gmail.com) - local exampleLight = { - lightType = 'point', -- or cone or beam + lightType = "point", -- or cone or beam -- if pieceName == nil then the light is treated as WORLD-SPACE -- if pieceName == valid piecename, then the light is attached to that piece -- if pieceName == invalid piecename, then the light is attached to base of unit @@ -17,16 +16,35 @@ local exampleLight = { -- Lights that should spawn even if they are outside of view need this set: alwaysVisible = nil, lightConfig = { - posx = 0, posy = 0, posz = 0, radius = 100, - r = 1, g = 1, b = 1, a = 1, + posx = 0, + posy = 0, + posz = 0, + radius = 100, + r = 1, + g = 1, + b = 1, + a = 1, -- point lights only, colortime in seconds for unit-attached: - color2r = 1, color2g = 1, color2b = 1, colortime = 15, + color2r = 1, + color2g = 1, + color2b = 1, + colortime = 15, -- cone lights only, specify direction and half-angle in radians: - dirx = 0, diry = 0, dirz = 1, theta = 0.5, + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.5, -- beam lights only, specifies the endpoint of the beam: - pos2x = 100, pos2y = 100, pos2z = 100, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 1, - lifetime = 0, sustain = 1, selfshadowing = 0 + pos2x = 100, + pos2y = 100, + pos2z = 100, + modelfactor = 1, + specular = 1, + scattering = 1, + lensflare = 1, + lifetime = 0, + sustain = 1, + selfshadowing = 0, }, } @@ -34,390 +52,227 @@ local exampleLight = { local unitLights = { - - ['armpw'] = { + ["armpw"] = { headlightpw = { -- this is the lightname - lightType = 'cone', - pieceName = 'head', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 2, posz = 1, radius = 50, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.29, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = -0.5, specular = -1.5, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "cone", + pieceName = "head", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 2, posz = 1, radius = 50, dirx = 0, diry = -0.07, dirz = 1, theta = 0.29, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = -0.5, specular = -1.5, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 2.0, posz = 8.3, radius = 5, - color2r = 0.6, color2g = 0.5, color2b = 0.4, colortime = 30, - r = 1.2, g = 1, b = 0.25, a = 0.8, - modelfactor = 0.8, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 2.0, posz = 8.3, radius = 5, color2r = 0.6, color2g = 0.5, color2b = 0.4, colortime = 30, r = 1.2, g = 1, b = 0.25, a = 0.8, modelfactor = 0.8, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'lgun', - lightConfig = { posx = 0, posy = 0, posz = 3.5, radius = 2, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1.2, g = 1, b = 0.25, a = 1, - modelfactor = 0.8, specular = 0.6, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lgun", + lightConfig = { posx = 0, posy = 0, posz = 3.5, radius = 2, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1.2, g = 1, b = 0.25, a = 1, modelfactor = 0.8, specular = 0.6, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2 = { - lightType = 'point', - pieceName = 'rgun', - lightConfig = { posx = 0, posy = 0, posz = 3.5, radius = 2, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1.2, g = 1, b = 0.25, a = 1, - modelfactor = 0.8, specular = 0.6, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rgun", + lightConfig = { posx = 0, posy = 0, posz = 3.5, radius = 2, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1.2, g = 1, b = 0.25, a = 1, modelfactor = 0.8, specular = 0.6, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 4, posy = 3.5, posz = -8, radius = 3.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 2.5, - modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 4, posy = 3.5, posz = -8, radius = 3.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 2.5, modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -4, posy = 3.5, posz = -8, radius = 3.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 2.5, - modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -4, posy = 3.5, posz = -8, radius = 3.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 2.5, modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armwar'] = { + ["armwar"] = { arm1 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 7.5, posy = 1.5, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 7.5, posy = 1.5, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -7.5, posy = 1.5, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -7.5, posy = 1.5, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 11, posz = 8.5, radius = 7, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.7, - modelfactor = 0.3, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 11, posz = 8.5, radius = 7, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.7, modelfactor = 0.3, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- - lightType = 'cone', - pieceName = 'torso', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 11, posz = 5, radius = 40, - dirx = 0, diry = -0.12, dirz = 1, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 11, posz = 5, radius = 40, dirx = 0, diry = -0.12, dirz = 1, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, toplight = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 17, posz = -10, radius = 7, - color2r = 1, color2g = 1, color2b = 1, colortime = -2, - r = -1, g = 1, b = 1, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 17, posz = -10, radius = 7, color2r = 1, color2g = 1, color2b = 1, colortime = -2, r = -1, g = 1, b = 1, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfatf'] = { + ["armfatf"] = { greenblob = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 12, - r = 0, g = 1.5, b = 0, a = 0.8, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 20, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 12, r = 0, g = 1.5, b = 0, a = 0.8, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 20, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 6.5, posz = 6, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 6.5, posz = 6, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10, posy = 6.5, posz = 28, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10, posy = 6.5, posz = 28, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 6.5, posz = -19.5, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 6.5, posz = -19.5, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -19, posy = 6.5, posz = -19, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -19, posy = 6.5, posz = -19, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfrad'] = { + ["armfrad"] = { greenblob = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 54, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 54, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'tower', - lightConfig = { posx = -8, posy = -2.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tower", + lightConfig = { posx = -8, posy = -2.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'tower', - lightConfig = { posx = 8, posy = -2.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tower", + lightConfig = { posx = 8, posy = -2.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'tower', - lightConfig = { posx = 0, posy = -2.5, posz = 8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tower", + lightConfig = { posx = 0, posy = -2.5, posz = 8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'tower', - lightConfig = { posx = 0, posy = -2.5, posz = -8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tower", + lightConfig = { posx = 0, posy = -2.5, posz = -8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 7, posz = 15, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 7, posz = 15, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 7, posz = 15, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 7, posz = 15, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 7, posz = -15, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 7, posz = -15, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 7, posz = -15, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 7, posz = -15, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armamex'] = { + ["armamex"] = { mid1 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 34, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 34, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsonar'] = { + ["armsonar"] = { mid1 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = -4, posy = 24.5, posz = 0, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = -4, posy = 24.5, posz = 0, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 4, posy = 24.5, posz = 0, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 4, posy = 24.5, posz = 0, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 24.5, posz = 4, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 24.5, posz = 4, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 24.5, posz = -4, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 24.5, posz = -4, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armrad'] = { + ["armrad"] = { greenblob = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 38, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 38, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -8, posy = -15.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -8, posy = -15.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 8, posy = -15.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 8, posy = -15.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = -15.5, posz = 8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = -15.5, posz = 8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = -15.5, posz = -8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = -15.5, posz = -8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, radarwhite = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 0, posz = -9, radius = 32, - color2r = 1, color2g = 1, color2b = 1, colortime = -2, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.1, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 0, posz = -9, radius = 32, color2r = 1, color2g = 1, color2b = 1, colortime = -2, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.1, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corrad'] = { + ["corrad"] = { greenblob = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 82, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 82, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfrad'] = { + ["corfrad"] = { greenblob = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 82, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 82, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cortide'] = { + ["cortide"] = { energy1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 22.8, posz = 16.2, radius = 1.4, - pos2x = 0, pos2y = 22.8, pos2z = 18.2, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.0, - r = 1.1, g = 0.85, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 22.8, posz = 16.2, radius = 1.4, pos2x = 0, pos2y = 22.8, pos2z = 18.2, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.0, r = 1.1, g = 0.85, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, energy2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 22.8, posz = -16.2, radius = 1.4, - pos2x = 0, pos2y = 22.8, pos2z = -18.2, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.0, - r = 1.1, g = 0.85, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 22.8, posz = -16.2, radius = 1.4, pos2x = 0, pos2y = 22.8, pos2z = -18.2, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.0, r = 1.1, g = 0.85, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmart'] = { + ["armmart"] = { -- front = { -- lightType = 'point', -- pieceName = 'sleeve', @@ -428,415 +283,237 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, searchlightglow = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 3, posz = 22, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 3, posz = 22, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'barrel', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 3, posz = 19, radius = 70, - dirx = 0, diry = -0.2, dirz = 1, theta = 0.62, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "barrel", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 3, posz = 19, radius = 70, dirx = 0, diry = -0.2, dirz = 1, theta = 0.62, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topglow = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 8, posz = 0.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 8, posz = 0.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armferret'] = { + ["armferret"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 12, posz = 0, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 12, posz = 0, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 12, posz = 0, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 12, posz = 0, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = 17, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = 17, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = -17, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = -17, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrhapsis'] = { + ["legrhapsis"] = { searchlight = { - lightType = 'cone', - pieceName = 'searchLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "searchLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armkraken'] = { + ["armkraken"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 23.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 23.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 23.5, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 23.5, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23.5, posz = 20, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23.5, posz = 20, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23.5, posz = -20, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23.5, posz = -20, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 8, posy = 4, posz = -8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 8, posy = 4, posz = -8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -8, posy = 4, posz = -8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -8, posy = 4, posz = -8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 14, posy = -3, posz = -8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 14, posy = -3, posz = -8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back4 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -14, posy = -3, posz = -8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -14, posy = -3, posz = -8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 8, posy = 5, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 8, posy = 5, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -8, posy = 5, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -8, posy = 5, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 14, posy = -2, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 14, posy = -2, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front4 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -14, posy = -2, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -14, posy = -2, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armflak'] = { + ["armflak"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12.0, posy = 14, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12.0, posy = 14, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 14, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 14, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = -12, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = -12, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = 12, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = 12, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'xturret', - lightConfig = { posx = 3.7, posy = 9.5, posz = 11, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "xturret", + lightConfig = { posx = 3.7, posy = 9.5, posz = 11, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'xturret', - lightConfig = { posx = -3.7, posy = 9.5, posz = 11, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "xturret", + lightConfig = { posx = -3.7, posy = 9.5, posz = 11, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'xturret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 9.5, posz = 11, radius = 475, - dirx = 0, diry = 0.4, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "xturret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 9.5, posz = 11, radius = 475, dirx = 0, diry = 0.4, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennaaa = { - lightType = 'point', - pieceName = 'xturret', - lightConfig = { posx = 0, posy = 38.0, posz = -27.0, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "xturret", + lightConfig = { posx = 0, posy = 38.0, posz = -27.0, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.5, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel1aa = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel2aa = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel3aa = { - lightType = 'point', - pieceName = 'barrel3', - lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel3", + lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel4aa = { - lightType = 'point', - pieceName = 'barrel4', - lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel4", + lightConfig = { posx = 0, posy = 0.0, posz = 23.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfflak'] = { + ["armfflak"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10, posy = 16, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10, posy = 16, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10, posy = 16, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10, posy = 16, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = -10, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = -10, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = 10, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = 10, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel1aa = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = 0, posy = 0.0, posz = 8.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { posx = 0, posy = 0.0, posz = 8.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel2aa = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = 0, posy = 0.0, posz = 8.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { posx = 0, posy = 0.0, posz = 8.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'sleeve1', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 5.2, posy = 4.8, posz = 12, radius = 475, - dirx = 0.08, diry = 0.0, dirz = 1, theta = 0.10, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve1", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 5.2, posy = 4.8, posz = 12, radius = 475, dirx = 0.08, diry = 0.0, dirz = 1, theta = 0.10, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'sleeve2', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -5.2, posy = 4.8, posz = 12, radius = 475, - dirx = -0.08, diry = 0.0, dirz = 1, theta = 0.10, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve2", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -5.2, posy = 4.8, posz = 12, radius = 475, dirx = -0.08, diry = 0.0, dirz = 1, theta = 0.10, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armdl'] = { + ["armdl"] = { top = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 4, posz = -5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 4, posz = -5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = -1, posz = -22.2, radius = 1.9, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = -1, posz = -22.2, radius = 1.9, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topsideanim1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -19, posy = -1, posz = 0, radius = 5, - dirx = 0, diry = 0, dirz = 0.5, theta = -11.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.1, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -19, posy = -1, posz = 0, radius = 5, dirx = 0, diry = 0, dirz = 0.5, theta = -11.2, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.1, g = 1, b = 0.2, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topsideanim2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 19, posy = -1, posz = 0, radius = 5, - dirx = 0, diry = 0, dirz = 0.5, theta = -11.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.1, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 19, posy = -1, posz = 0, radius = 5, dirx = 0, diry = 0, dirz = 0.5, theta = -11.2, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.1, g = 1, b = 0.2, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topside1 = { -- lightType = 'point', @@ -857,40 +534,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 14, posz = -16, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 14, posz = -16, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 14, posz = 16, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 14, posz = 16, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 14, posz = -16, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 14, posz = -16, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 14, posz = 16, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 14, posz = 16, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- base5 = { -- lightType = 'point', @@ -929,267 +590,152 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cordl'] = { + ["cordl"] = { depthchargeflashl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7.5, posy = 50.6, posz = -7, radius = 1.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7.5, posy = 50.6, posz = -7, radius = 1.5, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7.5, posy = 50.6, posz = -7, radius = 1.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7.5, posy = 50.6, posz = -7, radius = 1.5, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashfl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7.5, posy = 50.6, posz = 7, radius = 1.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7.5, posy = 50.6, posz = 7, radius = 1.5, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashfr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7.5, posy = 50.6, posz = 7, radius = 1.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7.5, posy = 50.6, posz = 7, radius = 1.5, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8, posz = -12, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8, posz = -12, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8, posz = 12, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8, posz = 12, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8, posz = -12, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8, posz = -12, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8, posz = 12, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8, posz = 12, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.8, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmark'] = { + ["armmark"] = { greenblob = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 10.5, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 10.5, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaradk'] = { + ["legaradk"] = { leggreenblob = { - lightType = 'point', - pieceName = 'dishTower', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.44, - modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dishTower", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.44, modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legavrad'] ={ + ["legavrad"] = { greenbloba = { - lightType = 'point', - pieceName = 'radarlight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobb = { - lightType = 'point', - pieceName = 'radarlight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobc = { - lightType = 'point', - pieceName = 'radarlight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobd = { - lightType = 'point', - pieceName = 'radarlight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['corvoyr'] = { + ["corvoyr"] = { greenblob = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.44, - modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.44, modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -3.7, posy = 17, posz = -1.3, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -3.7, posy = 17, posz = -1.3, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 0.4, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backside = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 4.7, posy = 8.3, posz = -4.7, radius = 8.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 4.7, posy = 8.3, posz = -4.7, radius = 8.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 7.5, posz = 6.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 7.5, posz = 6.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, dish1 = { - lightType = 'point', - pieceName = 'dish1', - lightConfig = { posx = -8.1, posy = 0, posz = 0, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 0.3, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish1", + lightConfig = { posx = -8.1, posy = 0, posz = 0, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 0.3, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, dish2 = { - lightType = 'point', - pieceName = 'dish2', - lightConfig = { posx = 8.1, posy = 0, posz = 0, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 0.3, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish2", + lightConfig = { posx = 8.1, posy = 0, posz = 0, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 0.3, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cortrem'] = { + ["cortrem"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.8, posy = 11.6, posz = 22.5, radius = 2, - pos2x = 2.8, pos2y = 11.6, pos2z = 22.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.8, posy = 11.6, posz = 22.5, radius = 2, pos2x = 2.8, pos2y = 11.6, pos2z = 22.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.8, posy = 11.6, posz = 22.5, radius = 2, - pos2x = -3.8, pos2y = 11.6, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.8, posy = 11.6, posz = 22.5, radius = 2, pos2x = -3.8, pos2y = 11.6, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.8, posy = 11.6, posz = 22.5, radius = 2, - pos2x = 3.8, pos2y = 11.6, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.8, posy = 11.6, posz = 22.5, radius = 2, pos2x = 3.8, pos2y = 11.6, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretright = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -10.9, posy = 14.5, posz = 1.0, radius = 1.5, - pos2x = -10.9, pos2y = 14.5, pos2z = -1.2, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = -1, g = 0.2, b = 0.2, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -10.9, posy = 14.5, posz = 1.0, radius = 1.5, pos2x = -10.9, pos2y = 14.5, pos2z = -1.2, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = -1, g = 0.2, b = 0.2, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretright2 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -12.3, posy = 13.1, posz = 1.0, radius = 1.5, - pos2x = -12.3, pos2y = 13.1, pos2z = -1.2, - color2r = -100, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 0, b = 0, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -12.3, posy = 13.1, posz = 1.0, radius = 1.5, pos2x = -12.3, pos2y = 13.1, pos2z = -1.2, color2r = -100, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 0, b = 0, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretleft = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 10.9, posy = 14.5, posz = 1.0, radius = 1.5, - pos2x = 10.9, pos2y = 14.5, pos2z = -1.2, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = -1, g = 0.2, b = 0.2, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 10.9, posy = 14.5, posz = 1.0, radius = 1.5, pos2x = 10.9, pos2y = 14.5, pos2z = -1.2, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = -1, g = 0.2, b = 0.2, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretleft2 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 12.3, posy = 13.1, posz = 1.0, radius = 1.5, - pos2x = 12.3, pos2y = 13.1, pos2z = -1.2, - color2r = -100, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 0, b = 0, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 12.3, posy = 13.1, posz = 1.0, radius = 1.5, pos2x = 12.3, pos2y = 13.1, pos2z = -1.2, color2r = -100, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 0, b = 0, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -1201,101 +747,56 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 5, posz = 15, radius = 55, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 5, posz = 15, radius = 55, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -16, posy = 9, posz = 15, radius = 30, colortime = -2, - dirx = -0.6, diry = -0.5, dirz = 1, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -16, posy = 9, posz = 15, radius = 30, colortime = -2, dirx = -0.6, diry = -0.5, dirz = 1, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 16, posy = 9, posz = 15, radius = 30, colortime = -2, - dirx = 0.6, diry = -0.5, dirz = 1, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 16, posy = 9, posz = 15, radius = 30, colortime = -2, dirx = 0.6, diry = -0.5, dirz = 1, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corvroc'] = { + ["corvroc"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2.5, posy = 23.8, posz = 22.5, radius = 2, - pos2x = 8.5, pos2y = 23.8, pos2z = 22.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2.5, posy = 23.8, posz = 22.5, radius = 2, pos2x = 8.5, pos2y = 23.8, pos2z = 22.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2, posy = 23.8, posz = 22.5, radius = 2, - pos2x = 2, pos2y = 23.8, pos2z = 13.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2, posy = 23.8, posz = 22.5, radius = 2, pos2x = 2, pos2y = 23.8, pos2z = 13.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 9, posy = 23.8, posz = 22.5, radius = 2, - pos2x = 9, pos2y = 23.8, pos2z = 13.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 9, posy = 23.8, posz = 22.5, radius = 2, pos2x = 9, pos2y = 23.8, pos2z = 13.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.4, posy = -6, posz = 21, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.4, posy = -6, posz = 21, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.4, posy = -6, posz = 21, radius = 3.5, - color2r = -100, color2g = 0, color2b = 0, colortime = 120, - r = 0, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.4, posy = -6, posz = 21, radius = 3.5, color2r = -100, color2g = 0, color2b = 0, colortime = 120, r = 0, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncherleft = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.4, posy = -9.5, posz = 8, radius = 4.9, - dirx = 0, diry = 0, dirz = 1, theta = -6.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.4, posy = -9.5, posz = 8, radius = 4.9, dirx = 0, diry = 0, dirz = 1, theta = -6.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncherright = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.4, posy = -9.5, posz = 8, radius = 4.9, - dirx = 0, diry = 0, dirz = 1, theta = -6.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.4, posy = -9.5, posz = 8, radius = 4.9, dirx = 0, diry = 0, dirz = 1, theta = -6.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -1325,25 +826,16 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmerl'] = { + ["armmerl"] = { eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -14, posy = 23.2, posz = 13.5, radius = 4, - pos2x = -14, pos2y = 23.2, pos2z = -13.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 0, b = 0, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -14, posy = 23.2, posz = 13.5, radius = 4, pos2x = -14, pos2y = 23.2, pos2z = -13.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 0, b = 0, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrelteamglow = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = -4.8, posz = 18, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = -4.8, posz = 18, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- teamlauncherleft = { -- lightType = 'point', @@ -1356,259 +848,137 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, teamlauncherflash = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.6, posy = -4.8, posz = 8, radius = 5.3, - dirx = 0, diry = 0, dirz = 1, theta = -10.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.6, posy = -4.8, posz = 8, radius = 5.3, dirx = 0, diry = 0, dirz = 1, theta = -10.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cortron'] = { + ["cortron"] = { --UNStockpiled base1 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = -13.9, posy = -2.9, posz = 24.9, radius = 1.3, - pos2x = -12.1, pos2y = -2.9, pos2z = 24.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = -13.9, posy = -2.9, posz = 24.9, radius = 1.3, pos2x = -12.1, pos2y = -2.9, pos2z = 24.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = 13.9, posy = -2.9, posz = 24.9, radius = 1.3, - pos2x = 12.1, pos2y = -2.9, pos2z = 24.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = 13.9, posy = -2.9, posz = 24.9, radius = 1.3, pos2x = 12.1, pos2y = -2.9, pos2z = 24.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = -13.9, posy = -2.9, posz = -24.9, radius = 1.3, - pos2x = -12.1, pos2y = -2.9, pos2z = -24.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = -13.9, posy = -2.9, posz = -24.9, radius = 1.3, pos2x = -12.1, pos2y = -2.9, pos2z = -24.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = 13.9, posy = -2.9, posz = -24.9, radius = 1.3, - pos2x = 12.1, pos2y = -2.9, pos2z = -24.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = 13.9, posy = -2.9, posz = -24.9, radius = 1.3, pos2x = 12.1, pos2y = -2.9, pos2z = -24.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = -24.9, posy = -2.9, posz = 12.1, radius = 1.3, - pos2x = -24.9, pos2y = -2.9, pos2z = 13.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = -24.9, posy = -2.9, posz = 12.1, radius = 1.3, pos2x = -24.9, pos2y = -2.9, pos2z = 13.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = 24.9, posy = -2.9, posz = 12.1, radius = 1.3, - pos2x = 24.9, pos2y = -2.9, pos2z = 13.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = 24.9, posy = -2.9, posz = 12.1, radius = 1.3, pos2x = 24.9, pos2y = -2.9, pos2z = 13.9, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base7 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = -24.9, posy = -2.9, posz = -13.9, radius = 1.3, - pos2x = -24.9, pos2y = -2.9, pos2z = -12.1, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = -24.9, posy = -2.9, posz = -13.9, radius = 1.3, pos2x = -24.9, pos2y = -2.9, pos2z = -12.1, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base8 = { - lightType = 'beam', - pieceName = 'orangelight', - lightConfig = { posx = 24.9, posy = -2.9, posz = -13.9, radius = 1.3, - pos2x = 24.9, pos2y = -2.9, pos2z = -12.1, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "orangelight", + lightConfig = { posx = 24.9, posy = -2.9, posz = -13.9, radius = 1.3, pos2x = 24.9, pos2y = -2.9, pos2z = -12.1, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --Stockpiled loaded1 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = -13.9, posy = -2.9, posz = 24.9, radius = 1.3, - pos2x = -12.1, pos2y = -2.9, pos2z = 24.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = -13.9, posy = -2.9, posz = 24.9, radius = 1.3, pos2x = -12.1, pos2y = -2.9, pos2z = 24.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded2 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = 13.9, posy = -2.9, posz = 24.9, radius = 1.3, - pos2x = 12.1, pos2y = -2.9, pos2z = 24.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = 13.9, posy = -2.9, posz = 24.9, radius = 1.3, pos2x = 12.1, pos2y = -2.9, pos2z = 24.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded3 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = -13.9, posy = -2.9, posz = -24.9, radius = 1.3, - pos2x = -12.1, pos2y = -2.9, pos2z = -24.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = -13.9, posy = -2.9, posz = -24.9, radius = 1.3, pos2x = -12.1, pos2y = -2.9, pos2z = -24.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded4 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = 13.9, posy = -2.9, posz = -24.9, radius = 1.3, - pos2x = 12.1, pos2y = -2.9, pos2z = -24.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = 13.9, posy = -2.9, posz = -24.9, radius = 1.3, pos2x = 12.1, pos2y = -2.9, pos2z = -24.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded5 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = -24.9, posy = -2.9, posz = 12.1, radius = 1.3, - pos2x = -24.9, pos2y = -2.9, pos2z = 13.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = -24.9, posy = -2.9, posz = 12.1, radius = 1.3, pos2x = -24.9, pos2y = -2.9, pos2z = 13.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded6 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = 24.9, posy = -2.9, posz = 12.1, radius = 1.3, - pos2x = 24.9, pos2y = -2.9, pos2z = 13.9, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = 24.9, posy = -2.9, posz = 12.1, radius = 1.3, pos2x = 24.9, pos2y = -2.9, pos2z = 13.9, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded7 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = -24.9, posy = -2.9, posz = -13.9, radius = 1.3, - pos2x = -24.9, pos2y = -2.9, pos2z = -12.1, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = -24.9, posy = -2.9, posz = -13.9, radius = 1.3, pos2x = -24.9, pos2y = -2.9, pos2z = -12.1, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, loaded8 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = 24.9, posy = -2.9, posz = -13.9, radius = 1.3, - pos2x = 24.9, pos2y = -2.9, pos2z = -12.1, - color2r = 0, color2g = 0, color2b = 0, colortime =15, - r = 1, g = 0.2, b = 0.0, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = 24.9, posy = -2.9, posz = -13.9, radius = 1.3, pos2x = 24.9, pos2y = -2.9, pos2z = -12.1, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.0, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - - }, - ['armseer'] = { + ["armseer"] = { greenblob = { - lightType = 'point', - pieceName = 'eye', - lightConfig = { posx = 0, posy = 5.5, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "eye", + lightConfig = { posx = 0, posy = 5.5, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'eye', - lightConfig = { posx = 0, posy = 0, posz = 5, radius = 10, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "eye", + lightConfig = { posx = 0, posy = 0, posz = 5, radius = 10, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corvrad'] = { + ["corvrad"] = { greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.45, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.45, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2, posy = 9.1, posz = 12.5, radius = 2, - pos2x = 2, pos2y = 9.1, pos2z = 12.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2, posy = 9.1, posz = 12.5, radius = 2, pos2x = 2, pos2y = 9.1, pos2z = 12.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2, posy = 9.1, posz = 12.5, radius = 2, - pos2x = -2, pos2y = 9.1, pos2z = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2, posy = 9.1, posz = 12.5, radius = 2, pos2x = -2, pos2y = 9.1, pos2z = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2, posy = 9.1, posz = 12.5, radius = 2, - pos2x = 2, pos2y = 9.1, pos2z = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2, posy = 9.1, posz = 12.5, radius = 2, pos2x = 2, pos2y = 9.1, pos2z = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 7, posz = -15.5, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0, g = 1, b = 0, a = 2, - modelfactor = 0.7, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 7, posz = -15.5, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0, g = 1, b = 0, a = 2, modelfactor = 0.7, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 7, posz = -15.5, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0, g = 1, b = 0, a = 2, - modelfactor = 0.7, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 7, posz = -15.5, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0, g = 1, b = 0, a = 2, modelfactor = 0.7, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -1638,196 +1008,115 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armarad'] = { + ["armarad"] = { greenblob = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 64, posz = 0, radius = 24, - color2r = 0, color2g = 2, color2b = 0, colortime = 40, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 64, posz = 0, radius = 24, color2r = 0, color2g = 2, color2b = 0, colortime = 40, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 10, posz = -15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 10, posz = -15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 10, posz = -15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 10, posz = -15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 10, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 10, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 10, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 10, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 21, posz = -6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 21, posz = -6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 21, posz = -6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 21, posz = -6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 21, posz = 6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 21, posz = 6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 21, posz = 6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 21, posz = 6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corarad'] = { + ["corarad"] = { greenblob = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 90, posz = 0, radius = 20, - color2r = 0, color2g = 2, color2b = 0, colortime = 40, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 90, posz = 0, radius = 20, color2r = 0, color2g = 2, color2b = 0, colortime = 40, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armtarg'] = { + ["armtarg"] = { greenblob = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 147, posz = -1.5, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 40, - r = 0, g = 1.5, b = 0, a = 0.8, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 20, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 147, posz = -1.5, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 40, r = 0, g = 1.5, b = 0, a = 0.8, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 20, selfshadowing = 0 }, }, frontbarleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 95, posz = -12, radius = 9.5, - pos2x = 10.51, pos2y = 110, pos2z = -9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.1, scattering = 0.33, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 95, posz = -12, radius = 9.5, pos2x = 10.51, pos2y = 110, pos2z = -9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.1, scattering = 0.33, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, }, - ['armllt'] = { + ["armllt"] = { searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 5, posz = 3, radius = 380, - dirx = 0, diry = 0, dirz = 1, theta = 0.24, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 3}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 5, posz = 3, radius = 380, dirx = 0, diry = 0, dirz = 1, theta = 0.24, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 3 }, }, headlight = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 5, posz = 6.5, radius = 7, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 5, posz = 6.5, radius = 7, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 10, posz = 9, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 10, posz = 9, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 10, posz = 9, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 10, posz = 9, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 10, posz = -9, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 10, posz = -9, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 10, posz = -9, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 10, posz = -9, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 34, posz = -9.5, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 34, posz = -9.5, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 34, posz = 9.5, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 34, posz = 9.5, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topteam = { -- lightType = 'point', @@ -1839,22 +1128,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, topteamback1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 2, posz = -14, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 2, posz = -14, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteamback2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = -3, posz = -14, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = -3, posz = -14, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- sidetop1 = { -- lightType = 'point', @@ -1875,35 +1156,21 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corllt'] = { + ["corllt"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 5, posz = 5.8, radius = 380, - dirx = 0, diry = 0, dirz = 1, theta = 0.24, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.8, specular = -0.3, scattering = 1.8, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 5, posz = 5.8, radius = 380, dirx = 0, diry = 0, dirz = 1, theta = 0.24, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.8, specular = -0.3, scattering = 1.8, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopfrontleft = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.8, posy = 3, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.8, posy = 3, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopfrontright = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.8, posy = 3, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.8, posy = 3, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topteamback1 = { -- lightType = 'point', @@ -1915,95 +1182,53 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corhllt'] = { + ["corhllt"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret2', - lightConfig = { posx = 0, posy = 5, posz = 5.8, radius = 380, - dirx = 0, diry = 0, dirz = 1, theta = 0.22, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.4, specular = -1.5, scattering = 2, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret2", + lightConfig = { posx = 0, posy = 5, posz = 5.8, radius = 380, dirx = 0, diry = 0, dirz = 1, theta = 0.22, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.4, specular = -1.5, scattering = 2, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teambotleft = { - lightType = 'point', - pieceName = 'turret1', - lightConfig = { posx = 4.8, posy = 3.5, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret1", + lightConfig = { posx = 4.8, posy = 3.5, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teambotright = { - lightType = 'point', - pieceName = 'turret1', - lightConfig = { posx = -4.8, posy = 3.5, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret1", + lightConfig = { posx = -4.8, posy = 3.5, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopleft = { - lightType = 'point', - pieceName = 'turret2', - lightConfig = { posx = 4.8, posy = 3.5, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret2", + lightConfig = { posx = 4.8, posy = 3.5, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopright = { - lightType = 'point', - pieceName = 'turret2', - lightConfig = { posx = -4.8, posy = 3.5, posz = 2.9, radius = 4, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret2", + lightConfig = { posx = -4.8, posy = 3.5, posz = 2.9, radius = 4, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corhlt'] = { + ["corhlt"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 0, posz = 5.8, radius = 320, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.8, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 0, posz = 5.8, radius = 320, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.8, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 0, posz = 7.8, radius = 8, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 1.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 0, posz = 7.8, radius = 8, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.2, scattering = 1.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopfrontleft = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 3.8, posy = 27, posz = -11, radius = 3.5, - dirx = 0, diry = 0, dirz = 1, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 3.8, posy = 27, posz = -11, radius = 3.5, dirx = 0, diry = 0, dirz = 1, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopfrontright = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -3.8, posy = 27, posz = -11, radius = 3.5, - dirx = 0, diry = 0, dirz = 1, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -3.8, posy = 27, posz = -11, radius = 3.5, dirx = 0, diry = 0, dirz = 1, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topteamback1 = { -- lightType = 'point', @@ -2015,219 +1240,123 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmercury'] = { + ["armmercury"] = { base2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9, posz = 10.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9, posz = 10.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightsource = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 2, posy = 2.5, posz = 11.5, radius = 1.9, - pos2x = -2, pos2y = 2.5, pos2z = 11.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 2, posy = 2.5, posz = 11.5, radius = 1.9, pos2x = -2, pos2y = 2.5, pos2z = 11.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, - dirx = 0, diry = 0.4, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, dirx = 0, diry = 0.4, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunleftaa1 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = 7.5, posy = 5.5, posz = 13.3, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = 7.5, posy = 5.5, posz = 13.3, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunleftaa2 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = 4.2, posy = 7.8, posz = 13.3, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = 4.2, posy = 7.8, posz = 13.3, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunleftaa3 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = 7.5, posy = 5.5, posz = -13.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = 7.5, posy = 5.5, posz = -13.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunleftaa4 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = 4.2, posy = 7.8, posz = -13.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = 4.2, posy = 7.8, posz = -13.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunrightaa1 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = -7.5, posy = 5.5, posz = 13.3, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = -7.5, posy = 5.5, posz = 13.3, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunrightaa2 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = -4.2, posy = 7.8, posz = 13.3, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = -4.2, posy = 7.8, posz = 13.3, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunrightaa3 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = -7.5, posy = 5.5, posz = -13.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = -7.5, posy = 5.5, posz = -13.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunrightaa4 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = -4.2, posy = 7.8, posz = -13.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = -4.2, posy = 7.8, posz = -13.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['armbeamer'] = { + ["armbeamer"] = { searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = -8, posz = 0, radius = 430, - dirx = 0, diry = 0, dirz = 1, theta = 0.18, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.4, specular = -1.5, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = -8, posz = 0, radius = 430, dirx = 0, diry = 0, dirz = 1, theta = 0.18, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.4, specular = -1.5, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, glow = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 0, posz = 6, radius = 17, - color2r = 0, color2g = 0.07, color2b = 0.65, colortime = 45, - r = 0, g = 0.15, b = 1.5, a = 1, - modelfactor = 1, specular = 1, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 0, posz = 6, radius = 17, color2r = 0, color2g = 0.07, color2b = 0.65, colortime = 45, r = 0, g = 0.15, b = 1.5, a = 1, modelfactor = 1, specular = 1, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topanimright = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = -5, posy = 2.9, posz = -24.5, radius = 2, - dirx = 0, diry = 0, dirz = 1, theta = -10.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 4.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = -5, posy = 2.9, posz = -24.5, radius = 2, dirx = 0, diry = 0, dirz = 1, theta = -10.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 4.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topanimleft = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 5, posy = 2.9, posz = -24.5, radius = 2, - dirx = 0, diry = 0, dirz = 1, theta = -10.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 4.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 5, posy = 2.9, posz = -24.5, radius = 2, dirx = 0, diry = 0, dirz = 1, theta = -10.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 4.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 8, posz = 8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 8, posz = 8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 8, posz = -8, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 8, posz = -8, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4back = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 7, posz = -13, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 7, posz = -13, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = -4.5, posz = 13, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = -4.5, posz = 13, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = -4.5, posz = 13, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = -4.5, posz = 13, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = -4.5, posz = -13, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = -4.5, posz = -13, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = -4.5, posz = -13, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = -4.5, posz = -13, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- base5 = { -- lightType = 'point', @@ -2266,361 +1395,213 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armassistdrone_land'] = { + ["armassistdrone_land"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, - dirx = 1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, dirx = 1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, - dirx = -1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, dirx = -1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corassistdrone_land'] = { + ["corassistdrone_land"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armnanotct2'] = { + ["armnanotct2"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cornanotct2'] = { + ["cornanotct2"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legnanotc'] = { + ["legnanotc"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legmohoconct'] = { + ["legmohoconct"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legmohocon'] = { + ["legmohocon"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legnanotcplat'] = { + ["legnanotcplat"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 33, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armnanotc'] = { + ["armnanotc"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.5, specular = 0.3, scattering = 1.1, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.5, specular = 0.3, scattering = 1.1, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanoflash = { - lightType = 'point', - pieceName = 'aim', - lightConfig = { posx = 0, posy = 5, posz = 0.5, radius = 10, - color2r = -15, color2g = -15, color2b = -15, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aim", + lightConfig = { posx = 0, posy = 5, posz = 0.5, radius = 10, color2r = -15, color2g = -15, color2b = -15, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 26.3, posz = 5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 26.3, posz = 5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 26.3, posz = 5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 26.3, posz = 5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 26.3, posz = -5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 26.3, posz = -5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 26.3, posz = -5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 26.3, posz = -5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cornanotc'] = { + ["cornanotc"] = { nanolight = { - lightType = 'point', - pieceName = 'emitnano', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitnano", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanopassive = { - lightType = 'point', - pieceName = 'aim', - lightConfig = { posx = 0, posy = 6, posz = 14, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aim", + lightConfig = { posx = 0, posy = 6, posz = 14, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanoflash = { - lightType = 'point', - pieceName = 'aim', - lightConfig = { posx = 0, posy = 15, posz = 0, radius = 8, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aim", + lightConfig = { posx = 0, posy = 15, posz = 0, radius = 8, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armhlt'] = { + ["armhlt"] = { searchlight = { - lightType = 'cone', - pieceName = 'gunl', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, - dirx = 0, diry = 0, dirz = 1, theta = 0.18, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "gunl", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, dirx = 0, diry = 0, dirz = 1, theta = 0.18, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -10, posz = 15, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -10, posz = 15, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -10, posz = -15, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -10, posz = -15, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = -10, posz = 0, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = -10, posz = 0, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = -10, posz = 0, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = -10, posz = 0, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 24, posz = 0, radius = 9, - color2r = -5, color2g = -5, color2b = -5, colortime = 20, - r = 0, g = 1.5, b = 0, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 24, posz = 0, radius = 9, color2r = -5, color2g = -5, color2b = -5, colortime = 20, r = 0, g = 1.5, b = 0, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun1 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = -13, posy = 0, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.15, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = -13, posy = 0, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.15, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun2 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = 13, posy = 0, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.15, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = 13, posy = 0, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.15, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfhlt'] = { + ["armfhlt"] = { searchlight = { - lightType = 'cone', - pieceName = 'gunl', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, - dirx = 0, diry = 0, dirz = 1, theta = 0.18, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "gunl", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, dirx = 0, diry = 0, dirz = 1, theta = 0.18, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, float1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -19, posy = 8, posz = 19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -19, posy = 8, posz = 19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, float2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 19, posy = 8, posz = 19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 19, posy = 8, posz = 19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, float3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -19, posy = 8, posz = -19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -19, posy = 8, posz = -19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, float4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 19, posy = 8, posz = -19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 19, posy = 8, posz = -19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 28, posz = 0, radius = 8, - color2r = -5, color2g = -5, color2b = -5, colortime = 20, - r = 0, g = 1.5, b = 0, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 28, posz = 0, radius = 8, color2r = -5, color2g = -5, color2b = -5, colortime = 20, r = 0, g = 1.5, b = 0, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topglow = { -- lightType = 'point', @@ -2632,43 +1613,26 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, gun1 = { - lightType = 'point', - pieceName = 'gunl', - lightConfig = { posx = -13, posy = 0, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.15, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunl", + lightConfig = { posx = -13, posy = 0, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.15, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun2 = { - lightType = 'point', - pieceName = 'gunr', - lightConfig = { posx = 13, posy = 0, posz = 15, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.15, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunr", + lightConfig = { posx = 13, posy = 0, posz = 15, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.15, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armrl'] = { + ["armrl"] = { searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 450, colortime = -1.5, - dirx = 0, diry = 0, dirz = 1, theta = 0.2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 450, colortime = -1.5, dirx = 0, diry = 0, dirz = 1, theta = 0.2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, toplights = { - lightType = 'beam', - pieceName = 'launcher', - lightConfig = { posx = 0, posy = 11, posz = 5, radius = 4, - pos2x = 0, pos2y = 11, pos2z = -15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.3, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "launcher", + lightConfig = { posx = 0, posy = 11, posz = 5, radius = 4, pos2x = 0, pos2y = 11, pos2z = -15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 0.4, a = 0.5, modelfactor = 0.3, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -2734,648 +1698,373 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, basetop1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -9, posy = 20, posz = 3, radius = 10, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -9, posy = 20, posz = 3, radius = 10, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basetop2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 9, posy = 20, posz = 3, radius = 10, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 9, posy = 20, posz = 3, radius = 10, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfrt'] = { + ["armfrt"] = { searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 450, - dirx = 0, diry = 0, dirz = 1, theta = 0.2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 450, dirx = 0, diry = 0, dirz = 1, theta = 0.2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 12, posz = -19, radius = 21, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 12, posz = -19, radius = 21, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 12, posz = -26, radius = 21, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 12, posz = -26, radius = 21, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 12, posz = -33, radius = 21, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 12, posz = -33, radius = 21, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 12, posz = -40, radius = 21, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 12, posz = -40, radius = 21, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topback1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = -50, radius = 17, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = -50, radius = 17, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topback2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -7, posy = 0, posz = -47.5, radius = 17, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -7, posy = 0, posz = -47.5, radius = 17, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topback3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 7, posy = 0, posz = -47.5, radius = 17, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 7, posy = 0, posz = -47.5, radius = 17, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basetop1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -9, posy = 21, posz = -1, radius = 13, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -9, posy = 21, posz = -1, radius = 13, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basetop2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -9, posy = 21, posz = -1, radius = 13, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -9, posy = 21, posz = -1, radius = 13, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corrl'] = { + ["corrl"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 2, posz = 7, radius = 450, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 2, posz = 7, radius = 450, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.2, posy = 3, posz = -11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.2, posy = 3, posz = -11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.2, posy = 3, posz = -11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.2, posy = 3, posz = -11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.2, posy = 3, posz = 11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.2, posy = 3, posz = 11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa14 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.2, posy = 3, posz = 11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.2, posy = 3, posz = 11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfrt'] = { + ["corfrt"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 2, posz = 7, radius = 450, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 2, posz = 7, radius = 450, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.2, posy = 17, posz = -11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.2, posy = 17, posz = -11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.2, posy = 17, posz = -11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.2, posy = 17, posz = -11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.2, posy = 17, posz = 11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.2, posy = 17, posz = 11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footaa14 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.2, posy = 17, posz = 11.2, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.2, posy = 17, posz = 11.2, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcir'] = { + ["armcir"] = { searchlight = { - lightType = 'cone', - pieceName = 'spindle', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "spindle", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelights1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1, posy = 20, posz = 19, radius = 4, - pos2x = 1, pos2y = 20, pos2z = 19, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1, posy = 20, posz = 19, radius = 4, pos2x = 1, pos2y = 20, pos2z = 19, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelights2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1, posy = 20, posz = -19, radius = 4, - pos2x = 1, pos2y = 20, pos2z = -19, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1, posy = 20, posz = -19, radius = 4, pos2x = 1, pos2y = 20, pos2z = -19, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelights3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -19, posy = 20, posz = -1, radius = 4, - pos2x = -19, pos2y = 20, pos2z = 1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -19, posy = 20, posz = -1, radius = 4, pos2x = -19, pos2y = 20, pos2z = 1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelights4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 19, posy = 20, posz = -1, radius = 4, - pos2x = 19, pos2y = 20, pos2z = 1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 19, posy = 20, posz = -1, radius = 4, pos2x = 19, pos2y = 20, pos2z = 1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormadsam'] = { + ["cormadsam"] = { searchlight = { - lightType = 'cone', - pieceName = 'launcher', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "launcher", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = -13.5, posy = 9.0, posz = 7.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = -13.5, posy = 9.0, posz = 7.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = 13.5, posy = 9.0, posz = 7.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = 13.5, posy = 9.0, posz = 7.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corflak'] = { + ["corflak"] = { searchlight = { - lightType = 'cone', - pieceName = 'gunbase', - lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "gunbase", + lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'gunbase', - lightConfig = { posx = -11.5, posy = 3.0, posz = 35.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunbase", + lightConfig = { posx = -11.5, posy = 3.0, posz = 35.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'gunbase', - lightConfig = { posx = 11.5, posy = 3.0, posz = 35.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunbase", + lightConfig = { posx = 11.5, posy = 3.0, posz = 35.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corenaa'] = { + ["corenaa"] = { searchlight = { - lightType = 'cone', - pieceName = 'gunbase', - lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "gunbase", + lightConfig = { posx = 0, posy = 2, posz = 2, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'gunbase', - lightConfig = { posx = -11.5, posy = 3.0, posz = 35.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunbase", + lightConfig = { posx = -11.5, posy = 3.0, posz = 35.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'gunbase', - lightConfig = { posx = 11.5, posy = 3.0, posz = 35.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gunbase", + lightConfig = { posx = 11.5, posy = 3.0, posz = 35.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfrock'] = { + ["corfrock"] = { searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -13.5, posy = 9.0, posz = 7.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -13.5, posy = 9.0, posz = 7.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 13.5, posy = 9.0, posz = 7.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 13.5, posy = 9.0, posz = 7.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corerad'] = { + ["corerad"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = -4, posy = 19, posz = 15, radius = 475, - dirx = -0.06, diry = 0.5, dirz = 1, theta = 0.08, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = -4, posy = 19, posz = 15, radius = 475, dirx = -0.06, diry = 0.5, dirz = 1, theta = 0.08, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 4, posy = 19, posz = 15, radius = 475, - dirx = 0.06, diry = 0.5, dirz = 1, theta = 0.08, - r = 1, g = 1, b = 1, a = 0.35, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 4, posy = 19, posz = 15, radius = 475, dirx = 0.06, diry = 0.5, dirz = 1, theta = 0.08, r = 1, g = 1, b = 1, a = 0.35, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -21.0, posy = 23.0, posz = 0.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -21.0, posy = 23.0, posz = 0.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 21.0, posy = 23.0, posz = 0.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 21.0, posy = 23.0, posz = 0.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armjamt'] = { + ["armjamt"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 15, posz = 0, radius = 25, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 15, posz = 0, radius = 25, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 21, posz = 6.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 21, posz = 6.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 21, posz = 6.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 21, posz = 6.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 21, posz = -6.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 21, posz = -6.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 21, posz = -6.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 21, posz = -6.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corshroud'] = { + ["corshroud"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armjuno'] = { + ["armjuno"] = { top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 68, posz = 0, radius = 24, - color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, - r = 1.1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 68, posz = 0, radius = 24, color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, r = 1.1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11, posy = 24, posz = 11, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 24, posz = 11, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 24, posz = 11, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 24, posz = 11, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11, posy = 24, posz = -11, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 24, posz = -11, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 24, posz = -11, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 24, posz = -11, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.3, posy = 42, posz = 10.3, radius = 4, - color2r = -5, color2g = -5, color2b = -5, colortime = 45, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.3, posy = 42, posz = 10.3, radius = 4, color2r = -5, color2g = -5, color2b = -5, colortime = 45, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.3, posy = 42, posz = 10.3, radius = 4, - color2r = -5, color2g = -5, color2b = -5, colortime = 45, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.3, posy = 42, posz = 10.3, radius = 4, color2r = -5, color2g = -5, color2b = -5, colortime = 45, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.3, posy = 42, posz = -10.3, radius = 4, - color2r = -5, color2g = -5, color2b = -5, colortime = 45, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.3, posy = 42, posz = -10.3, radius = 4, color2r = -5, color2g = -5, color2b = -5, colortime = 45, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.3, posy = 42, posz = -10.3, radius = 4, - color2r = -5, color2g = -5, color2b = -5, colortime = 45, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, - }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.3, posy = 42, posz = -10.3, radius = 4, color2r = -5, color2g = -5, color2b = -5, colortime = 45, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, }, - ['corjuno'] = { + ["corjuno"] = { top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 68, posz = 0, radius = 24, - color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, - r = 1.1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 68, posz = 0, radius = 24, color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, r = 1.1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legjuno'] = { + ["legjuno"] = { top = { - lightType = 'point', - pieceName = 'junoSphere', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, - r = 1.1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "junoSphere", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0, color2g = 0, color2b = 0.2, colortime = -1, r = 1.1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armjam'] = { + ["armjam"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 20, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 20, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16.5, posz = 13.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16.5, posz = 13.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corjamt'] = { + ["corjamt"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coreter'] = { + ["coreter"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = -3.5, radius = 24, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = -3.5, radius = 24, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.4, posy = 11.6, posz = 19.5, radius = 2, - pos2x = 3.4, pos2y = 11.6, pos2z = 19.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.4, posy = 11.6, posz = 19.5, radius = 2, pos2x = 3.4, pos2y = 11.6, pos2z = 19.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.6, posy = 11.6, posz = 19.5, radius = 2, - pos2x = -3.6, pos2y = 11.6, pos2z = 13.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.6, posy = 11.6, posz = 19.5, radius = 2, pos2x = -3.6, pos2y = 11.6, pos2z = 13.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.6, posy = 11.6, posz = 19.5, radius = 2, - pos2x = 3.6, pos2y = 11.6, pos2z = 13.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.6, posy = 11.6, posz = 19.5, radius = 2, pos2x = 3.6, pos2y = 11.6, pos2z = 13.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- nojamleft = { -- lightType = 'beam', @@ -3406,340 +2095,198 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, nojamleft = { - lightType = 'point', - pieceName = 'nojam', - lightConfig = { posx = -11, posy = 14.5, posz = -0.3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 1, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nojam", + lightConfig = { posx = -11, posy = 14.5, posz = -0.3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nojamright = { - lightType = 'point', - pieceName = 'nojam', - lightConfig = { posx = 11, posy = 14.5, posz = -0.3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 1, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nojam", + lightConfig = { posx = 11, posy = 14.5, posz = -0.3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armaser'] = { + ["armaser"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = -5, posy = 0, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 1, g = 0, b = 0, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = -5, posy = 0, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 1, g = 0, b = 0, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corspec'] = { + ["corspec"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legavjam'] = { + ["legavjam"] = { cloaklightred = { - lightType = 'point', - pieceName = 'cloaklight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 16, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cloaklight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 16, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legajamk'] = { + ["legajamk"] = { legcloaklightred = { - lightType = 'point', - pieceName = 'blob', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blob", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leganavyradjamship']={ + ["leganavyradjamship"] = { cloaklightred = { - lightType = 'point', - pieceName = 'cloaklight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 16, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cloaklight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 16, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenbloba = { - lightType = 'point', - pieceName = 'radarlight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobb = { - lightType = 'point', - pieceName = 'radarlight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobc = { - lightType = 'point', - pieceName = 'radarlight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, greenblobd = { - lightType = 'point', - pieceName = 'radarlight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.15, - modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "radarlight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.15, modelfactor = 0.4, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['armveil'] = { + ["armveil"] = { cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 8.5, posy = 2, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 8.5, posy = 2, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -8.5, posy = 2, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -8.5, posy = 2, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 2, posz = 8.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 2, posz = 8.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret4 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 2, posz = -8.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 2, posz = -8.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 24, posz = 0, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 24, posz = 0, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 24, posz = 0, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 24, posz = 0, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 24, posz = 14, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 24, posz = 14, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 24, posz = -14, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 24, posz = -14, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - - ['corsiegebreaker'] = { - + ["corsiegebreaker"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = 52, radius = 11, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = 52, radius = 11, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.8, posy = 8, posz = 51, radius = 9, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.8, posy = 8, posz = 51, radius = 9, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.8, posy = 8, posz = 51, radius = 9, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.8, posy = 8, posz = 51, radius = 9, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - r1 = { - lightType = 'point', - pieceName = 'r1', - lightConfig = { posx = 3.5, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "r1", + lightConfig = { posx = 3.5, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, r2 = { - lightType = 'point', - pieceName = 'r2', - lightConfig = { posx = 3.5, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "r2", + lightConfig = { posx = 3.5, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, r3 = { - lightType = 'point', - pieceName = 'r3', - lightConfig = { posx = 3.6, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "r3", + lightConfig = { posx = 3.6, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- this has a _g but not using for testing atm -- seems to be using x offsets from piece origin but not y or z ??? l1 = { - lightType = 'point', - pieceName = 'l1', - lightConfig = { posx = -3.4, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "l1", + lightConfig = { posx = -3.4, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, l2 = { - lightType = 'point', - pieceName = 'l2', - lightConfig = { posx = -3.4, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "l2", + lightConfig = { posx = -3.4, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, l3 = { - lightType = 'point', - pieceName = 'l3', - lightConfig = { posx = -3.6, posy = 1.4, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 1, - modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "l3", + lightConfig = { posx = -3.6, posy = 1.4, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 1, modelfactor = 0.1, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - chamberglow = { - lightType = 'point', - pieceName = 'chamber_flare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 2, - color2r = 1, color2g = 0.8, color2b = 0, color2a = 30, colortime = 0, - r = 1, g = 0.3, b = 0.0, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chamber_flare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 2, color2r = 1, color2g = 0.8, color2b = 0, color2a = 30, colortime = 0, r = 1, g = 0.3, b = 0.0, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - - }, - ['corack'] = { + ["corack"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = -2, posy = 3, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = -2, posy = 3, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 2, posy = 3, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 2, posy = 3, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- buildlight = { -- this is the lightname -- lightType = 'cone', @@ -3778,40 +2325,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, nanolight1 = { - lightType = 'point', - pieceName = 'lnano', - lightConfig = { posx = -2, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lnano", + lightConfig = { posx = -2, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'rnano', - lightConfig = { posx = 2, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rnano", + lightConfig = { posx = 2, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge1 = { - lightType = 'point', - pieceName = 'lbeamhinge', - lightConfig = { posx = 4.3, posy = 1, posz = -1, radius = 8, - color2r = 0.3, color2g = 0.22, color2b = 0.04, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.8, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lbeamhinge", + lightConfig = { posx = 4.3, posy = 1, posz = -1, radius = 8, color2r = 0.3, color2g = 0.22, color2b = 0.04, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.8, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge2 = { - lightType = 'point', - pieceName = 'rbeamhinge', - lightConfig = { posx = -7, posy = 1, posz = 0, radius = 6, - color2r = 0.6, color2g = 0.5, color2b = 0.2, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rbeamhinge", + lightConfig = { posx = -7, posy = 1, posz = 0, radius = 6, color2r = 0.6, color2g = 0.5, color2b = 0.2, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- nanolight1bright = { -- lightType = 'point', @@ -3822,929 +2353,530 @@ local unitLights = { -- modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 0, -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, - }, - ['legack'] = { + ["legack"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, canisters = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -2, posy = 8, posz = -12, radius = 20, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -2, posy = 8, posz = -12, radius = 20, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -2.4, posy = 2.9, posz = 16.75, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -2.4, posy = 2.9, posz = 16.75, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legamphtank'] = { + ["legamphtank"] = { frontlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -5, posz = 21, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -5, posz = 21, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 10, posz = -9, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 10, posz = -9, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaabot'] = { + ["legaabot"] = { frontlight1 = { - lightType = 'point', - pieceName = 'frontLight1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frontLight1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight2 = { - lightType = 'point', - pieceName = 'frontLight2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frontLight2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelight = { - lightType = 'point', - pieceName = 'sideLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sideLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --colortime -1 frontlight1time = { - lightType = 'point', - pieceName = 'frontLight1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - frontlight2time= { - lightType = 'point', - pieceName = 'frontLight2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frontLight1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + frontlight2time = { + lightType = "point", + pieceName = "frontLight2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelighttime = { - lightType = 'point', - pieceName = 'sideLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sideLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['legadveconv'] = { + ["legadveconv"] = { enabled1 = { - lightType = 'point', - pieceName = 'lightFlare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lightFlare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'lightFlare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lightFlare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled3 = { - lightType = 'point', - pieceName = 'lightFlare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lightFlare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled4 = { - lightType = 'point', - pieceName = 'lightFlare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lightFlare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled5 = { - lightType = 'point', - pieceName = 'lightFlare5', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 42, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lightFlare5", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 42, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leganavaleconv'] = { + ["leganavaleconv"] = { enabled1 = { - lightType = 'point', - pieceName = 'toprightLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "toprightLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'botrightLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "botrightLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled3 = { - lightType = 'point', - pieceName = 'botLeftLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "botLeftLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled4 = { - lightType = 'point', - pieceName = 'topLeftLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "topLeftLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled5 = { - lightType = 'point', - pieceName = 'topLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 42, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "topLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 42, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legeconv'] = { + ["legeconv"] = { enabled1 = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = -14, posy = 6, posz = 0, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = -14, posy = 6, posz = 0, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled3 = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 14, posy = 6, posz = 0, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 14, posy = 6, posz = 0, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leghp'] = { + ["leghp"] = { buildlight1 = { - lightType = 'cone', - pieceName = 'buildlight1Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight1Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'buildlight2Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight2Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight3 = { - lightType = 'cone', - pieceName = 'buildlight3Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight3Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight4 = { - lightType = 'cone', - pieceName = 'buildlight4Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight4Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['legfhp'] = { + ["legfhp"] = { buildlight1 = { - lightType = 'cone', - pieceName = 'buildlight1Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight1Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'buildlight2Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight2Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight3 = { - lightType = 'cone', - pieceName = 'buildlight3Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight3Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight4 = { - lightType = 'cone', - pieceName = 'buildlight4Point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildlight4Point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "flare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['legfeconv'] = { + ["legfeconv"] = { enabled1 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 13, posz = 0, radius = 35, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelight1 = { - lightType = 'point', - pieceName = 'sidelight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight2 = { - lightType = 'point', - pieceName = 'sidelight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight3 = { - lightType = 'point', - pieceName = 'sidelight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight12 = { - lightType = 'point', - pieceName = 'sidelight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight22 = { - lightType = 'point', - pieceName = 'sidelight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight32 = { - lightType = 'point', - pieceName = 'sidelight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, ---- animated floatanim1 = { - lightType = 'point', - pieceName = 'floatlight1', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, - dirx = -0.25, diry = 0.25, dirz = 0.25, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.35, g = 1, b = 0.35, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "floatlight1", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, dirx = -0.25, diry = 0.25, dirz = 0.25, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.35, g = 1, b = 0.35, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, floatnim2 = { - lightType = 'point', - pieceName = 'floatlight2', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, - dirx = 0.25, diry = -0.25, dirz = 0.25, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.35, g = 1, b = 0.35, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "floatlight2", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, dirx = 0.25, diry = -0.25, dirz = 0.25, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.35, g = 1, b = 0.35, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, floatnim3 = { - lightType = 'point', - pieceName = 'floatlight3', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, - dirx = 0.25, diry = 0.25, dirz = 0, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.35, g = 1, b = 0.35, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "floatlight3", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 2, dirx = 0.25, diry = 0.25, dirz = 0, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.35, g = 1, b = 0.35, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leguwestore'] = { + ["leguwestore"] = { sidelight1 = { - lightType = 'point', - pieceName = 'sidelight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight2 = { - lightType = 'point', - pieceName = 'sidelight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight3 = { - lightType = 'point', - pieceName = 'sidelight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight4 = { - lightType = 'point', - pieceName = 'sidelight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "sidelight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, shortlight1 = { - lightType = 'point', - pieceName = 'shortlight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "shortlight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, shortlight2 = { - lightType = 'point', - pieceName = 'shortlight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "shortlight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, shortlight3 = { - lightType = 'point', - pieceName = 'shortlight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "shortlight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, shortlight4 = { - lightType = 'point', - pieceName = 'shortlight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "shortlight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, sidelight12 = { - lightType = 'point', - pieceName = 'sidelight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "sidelight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, sidelight22 = { - lightType = 'point', - pieceName = 'sidelight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "sidelight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, sidelight32 = { - lightType = 'point', - pieceName = 'sidelight3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "sidelight3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, sidelight42 = { - lightType = 'point', - pieceName = 'sidelight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "sidelight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, ---- animated shortlightanim1 = { - lightType = 'point', - pieceName = 'shortlight1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, - dirx = 0.5, diry = 0, dirz = 0, theta = -18, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.9, g = 0.7, b = 0.45, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "shortlight1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, dirx = 0.5, diry = 0, dirz = 0, theta = -18, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.9, g = 0.7, b = 0.45, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shortlightanim2 = { - lightType = 'point', - pieceName = 'shortlight2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - dirx = -0.5, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.9, g = 0.7, b = 0.45, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "shortlight2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, dirx = -0.5, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.9, g = 0.7, b = 0.45, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shortlightanim3 = { - lightType = 'point', - pieceName = 'shortlight3', - lightConfig = { posx = 0, posy = 0, posz = -1, radius = 5, - dirx = -0.5, diry = 0, dirz = 0, theta = -18, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.9, g = 0.7, b = 0.45, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "shortlight3", + lightConfig = { posx = 0, posy = 0, posz = -1, radius = 5, dirx = -0.5, diry = 0, dirz = 0, theta = -18, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.9, g = 0.7, b = 0.45, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shortlightanim4 = { - lightType = 'point', - pieceName = 'shortlight4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - dirx = 0.5, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 0.9, g = 0.7, b = 0.45, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "shortlight4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, dirx = 0.5, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 0.9, g = 0.7, b = 0.45, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legscout'] = { + ["legscout"] = { bodylight = { - lightType = 'point', - pieceName = 'bodylight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bodylight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leggat'] = { + ["leggat"] = { gatbodylighta = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 4.5, posy = 3, posz = 21, radius = 24, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 4.5, posy = 3, posz = 21, radius = 24, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gatbodylightb = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 4.5, posy = 4, posz = 20, radius = 24, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 4.5, posy = 4, posz = 20, radius = 24, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legafcv'] = { + ["legafcv"] = { buildlight1 = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nanoFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, bodylight1 = { - lightType = 'point', - pieceName = 'cannisterLightR', - lightConfig = { posx = -2, posy = 0, posz = 0, radius = 24, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "cannisterLightR", + lightConfig = { posx = -2, posy = 0, posz = 0, radius = 24, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, bodylight2 = { - lightType = 'point', - pieceName = 'cannisterLightL', - lightConfig = { posx = 2, posy = 0, posz = 0, radius = 24, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "cannisterLightL", + lightConfig = { posx = 2, posy = 0, posz = 0, radius = 24, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['legvcarry'] = { + ["legvcarry"] = { lightglowtarget = { - lightType = 'point', - pieceName = 'targetLightGlow', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "targetLightGlow", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, animtype = 0 }, }, lightflashtarget = { - lightType = 'point', - pieceName = 'targetLightFlash', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 0.2, g = 1, b = 0.2, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "targetLightFlash", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 0.2, g = 1, b = 0.2, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['armack'] = { + ["armack"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight1emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight1emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight2emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontsidel = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -8.5, posy = 13, posz = 12.8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -8.5, posy = 13, posz = 12.8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontsider = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8.5, posy = 13, posz = 12.8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8.5, posy = 13, posz = 12.8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -7.5, posy = 8, posz = -14, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -7.5, posy = 8, posz = -14, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 7.5, posy = 8, posz = -14, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 7.5, posy = 8, posz = -14, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -8.3, posy = 6, posz = 14.8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 90, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -8.3, posy = 6, posz = 14.8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 90, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8.3, posy = 6, posz = 14.8, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 90, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8.3, posy = 6, posz = 14.8, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 90, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfark'] = { + ["armfark"] = { armbuildlight = { - lightType = 'point', - pieceName = 'armhexl_emit', - lightConfig = { posx = 0, posy = 1.1, posz = -0.1, radius = 8.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0.89, b = 0.1, a = 1.2, - modelfactor = 0.25, specular = 0.35, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl_emit", + lightConfig = { posx = 0, posy = 1.1, posz = -0.1, radius = 8.2, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0.89, b = 0.1, a = 1.2, modelfactor = 0.25, specular = 0.35, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armbuildlight2 = { - lightType = 'point', - pieceName = 'armhexl2_emit', - lightConfig = { posx = 0, posy = 1.1, posz = -0.1, radius = 8.2, - color2r = 1.2, color2g = 0.89, color2b = 0.1, colortime = 30, - r = 0, g = 0, b = 0, a = 1.2, - modelfactor = 0.25, specular = 0.35, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl2_emit", + lightConfig = { posx = 0, posy = 1.1, posz = -0.1, radius = 8.2, color2r = 1.2, color2g = 0.89, color2b = 0.1, colortime = 30, r = 0, g = 0, b = 0, a = 1.2, modelfactor = 0.25, specular = 0.35, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'lnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'rnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyer = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -1.4, posy = 10, posz = 4.6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -1.4, posy = 10, posz = 4.6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyel = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 1.4, posy = 10, posz = 4.6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 1.4, posy = 10, posz = 4.6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, pelvis = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 0, posz = 4.5, radius = 3.9, - color2r = -5, color2g = -5, color2b = -5, colortime = 30, - r = -1, g = 1, b = 1, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 0, posz = 4.5, radius = 3.9, color2r = -5, color2g = -5, color2b = -5, colortime = 30, r = -1, g = 1, b = 1, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lfeet = { - lightType = 'point', - pieceName = 'lfeet', - lightConfig = { posx = 2.7, posy = 3.3, posz = 2.3, radius = 0.7, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 0.2, a = 2.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfeet", + lightConfig = { posx = 2.7, posy = 3.3, posz = 2.3, radius = 0.7, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.7, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 0.2, a = 2.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rfeet = { - lightType = 'point', - pieceName = 'lfeet', - lightConfig = { posx = -2.7, posy = 3.3, posz = 2.3, radius = 0.7, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 0.2, a = 2.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfeet", + lightConfig = { posx = -2.7, posy = 3.3, posz = 2.3, radius = 0.7, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.7, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 0.2, a = 2.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfido'] = { + ["armfido"] = { -- eyesglow = { -- lightType = 'point', -- pieceName = 'torso', @@ -4755,76 +2887,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 1.7, posz = 26.4, radius = 1.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 1, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 1.7, posz = 26.4, radius = 1.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 1, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 3.7, posy = 0.6, posz = 26.8, radius = 1.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 3.7, posy = 0.6, posz = 26.8, radius = 1.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -3.7, posy = 0.6, posz = 26.8, radius = 1.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -3.7, posy = 0.6, posz = 26.8, radius = 1.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -3.6, posy = -1.1, posz = 27.0, radius = 0.8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 1.2, - modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -3.6, posy = -1.1, posz = 27.0, radius = 0.8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 1.2, modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 3.2, posy = -1.1, posz = 27.0, radius = 0.8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 1.2, - modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 3.2, posy = -1.1, posz = 27.0, radius = 0.8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 1.2, modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 0, posz = 15, radius = 70, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, - r = 1, g = 1, b = 0.89, a = 0.36, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 0, posz = 15, radius = 70, dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, r = 1, g = 1, b = 0.89, a = 0.36, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidered = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 5, posy = 3.5, posz = 5, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.25, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 5, posy = 3.5, posz = 5, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.25, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sideyellow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -4.5, posy = -1, posz = 6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -4.5, posy = -1, posz = 6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- sidetopyellow = { -- lightType = 'point', @@ -4836,1659 +2936,977 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turret1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -4.5, posy = 1.6, posz = -4.8, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 0.33, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -4.5, posy = 1.6, posz = -4.8, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 0.33, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 4.5, posy = 1.6, posz = -4.8, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 0.33, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 4.5, posy = 1.6, posz = -4.8, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 0.33, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armham'] = { + ["armham"] = { body = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 6, posz = 2, radius = 10, - color2r = 0.4, color2g = 0.3, color2b = 0.05, colortime = -1.5, - r = 1.2, g = 1, b = 0.33, a = 1.2, - modelfactor = 0.5, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 6, posz = 2, radius = 10, color2r = 0.4, color2g = 0.3, color2b = 0.05, colortime = -1.5, r = 1.2, g = 1, b = 0.33, a = 1.2, modelfactor = 0.5, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyefrontlow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -5, posz = 5, radius = 8, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.6, - modelfactor = 0.3, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = -5, posz = 5, radius = 8, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.6, modelfactor = 0.3, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armshltx'] = { + ["armshltx"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'nano5', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano5", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna1a = { - lightType = 'point', - pieceName = 'blink1a', - lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1a", + lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna1b = { - lightType = 'point', - pieceName = 'blink1b', - lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1b", + lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna1c = { - lightType = 'point', - pieceName = 'blink1c', - lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1c", + lightConfig = { posx = -2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna2a = { - lightType = 'point', - pieceName = 'blink2a', - lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2a", + lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna2b = { - lightType = 'point', - pieceName = 'blink2b', - lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2b", + lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashantenna2c = { - lightType = 'point', - pieceName = 'blink2c', - lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 4, - modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2c", + lightConfig = { posx = 2.5, posy = -11, posz = 0, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 4, modelfactor = 0.8, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink1a = { - lightType = 'point', - pieceName = 'blink1a', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1a", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink1b = { - lightType = 'point', - pieceName = 'blink1b', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1b", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink1c = { - lightType = 'point', - pieceName = 'blink1c', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1c", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink2a = { - lightType = 'point', - pieceName = 'blink2a', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2a", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink2b = { - lightType = 'point', - pieceName = 'blink2b', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2b", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blink2c = { - lightType = 'point', - pieceName = 'blink2c', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2c", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 38.5, posz = -4, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 38.5, posz = -4, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 45, posy = 21.5, posz = -6.6, radius = 3.5, - pos2x = 62, pos2y = 10.5, pos2z = -6.6, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 45, + posy = 21.5, + posz = -6.6, + radius = 3.5, + pos2x = 62, + pos2y = 10.5, + pos2z = -6.6, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -45, posy = 21.5, posz = -6.6, radius = 3.5, - pos2x = -62, pos2y = 10.5, pos2z = -6.6, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armasy'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -45, + posy = 21.5, + posz = -6.6, + radius = 3.5, + pos2x = -62, + pos2y = 10.5, + pos2z = -6.6, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armasy"] = { buildlight1 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = -8.2, posy = 0, posz = 3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 4, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = -8.2, posy = 0, posz = 3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 4, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1B = { -- this is the lightname - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = -8.2, posy = 0, posz = -3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = -8.2, posy = 0, posz = -3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 8.2, posy = 0, posz = 3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 8.2, posy = 0, posz = 3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { -- this is the lightname - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 8.2, posy = 0, posz = -3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 8.2, posy = 0, posz = -3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 8.2, posy = 0, posz = -3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 8.2, posy = 0, posz = -3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3B = { -- this is the lightname - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 8.2, posy = 0, posz = 3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 8.2, posy = 0, posz = 3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight4 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = -8.2, posy = 0, posz = -3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = -8.2, posy = 0, posz = -3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight4B = { -- this is the lightname - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = -8.2, posy = 0, posz = 3.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = -8.2, posy = 0, posz = 3.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = -1, posz = 53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = -1, posz = 53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 53, posy = -1, posz = 53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 53, posy = -1, posz = 53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = -1, posz = -53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = -1, posz = -53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 53, posy = -1, posz = -53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 53, posy = -1, posz = -53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end1 = { - lightType = 'point', - pieceName = 'end1', - lightConfig = { posx = -1, posy = 7.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end1", + lightConfig = { posx = -1, posy = 7.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end2 = { - lightType = 'point', - pieceName = 'end2', - lightConfig = { posx = 1, posy = 7.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end2", + lightConfig = { posx = 1, posy = 7.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end3 = { - lightType = 'point', - pieceName = 'end3', - lightConfig = { posx = 1, posy = 7.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end3", + lightConfig = { posx = 1, posy = 7.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end4 = { - lightType = 'point', - pieceName = 'end4', - lightConfig = { posx = -1, posy = 7.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end4", + lightConfig = { posx = -1, posy = 7.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'mid1', - lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mid1", + lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'mid2', - lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mid2", + lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'mid3', - lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mid3", + lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'mid4', - lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mid4", + lightConfig = { posx = 0, posy = 6.5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coraap'] = { + ["coraap"] = { buildlight1A = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1B = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2A = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob1 = { - lightType = 'point', - pieceName = 'blink1', - lightConfig = { posx = 0, posy = 0, posz = -1, radius = 15, - color2r = -2, color2g = -2, color2b = -2, colortime = 50, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink1", + lightConfig = { posx = 0, posy = 0, posz = -1, radius = 15, color2r = -2, color2g = -2, color2b = -2, colortime = 50, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob2 = { - lightType = 'point', - pieceName = 'blink2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = -2, color2g = -2, color2b = -2, colortime = 50, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = -2, color2g = -2, color2b = -2, colortime = 50, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 1, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 1, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'nano5', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano5", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight6 = { - lightType = 'point', - pieceName = 'nano6', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano6", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight7 = { - lightType = 'point', - pieceName = 'nano7', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano7", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight8 = { - lightType = 'point', - pieceName = 'nano8', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano8", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 53, posy = 25, posz = -7.5, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 53, posy = 25, posz = -7.5, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 53, posy = 25, posz = 7.5, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 53, posy = 25, posz = 7.5, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = 25, posz = -7.5, radius = 20, - olor2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = 25, posz = -7.5, radius = 20, olor2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = 25, posz = 7.5, radius = 20, - olor2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = 25, posz = 7.5, radius = 20, olor2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coramsub'] = { + ["coramsub"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13, posz = -25, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13, posz = -25, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflashleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 13, posz = -25, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 13, posz = -25, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflashright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 13, posz = -25, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 13, posz = -25, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35.5, posy = 19.5, posz = 3, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35.5, posy = 19.5, posz = 3, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35.5, posy = 19.5, posz = -11, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35.5, posy = 19.5, posz = -11, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35.5, posy = 19.5, posz = -25, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35.5, posy = 19.5, posz = -25, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35.5, posy = 19.5, posz = 3, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35.5, posy = 19.5, posz = 3, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35.5, posy = 19.5, posz = -11, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35.5, posy = 19.5, posz = -11, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35.5, posy = 19.5, posz = -25, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35.5, posy = 19.5, posz = -25, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legamsub'] = { + ["legamsub"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -39.5, posy = 19.5, posz = 3, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -39.5, posy = 19.5, posz = 3, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -39.5, posy = 19.5, posz = -11, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -39.5, posy = 19.5, posz = -11, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -39.5, posy = 19.5, posz = -25, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -39.5, posy = 19.5, posz = -25, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 39.5, posy = 19.5, posz = 3, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 39.5, posy = 19.5, posz = 3, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 39.5, posy = 19.5, posz = -11, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 39.5, posy = 19.5, posz = -11, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 39.5, posy = 19.5, posz = -25, radius = 30, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 39.5, posy = 19.5, posz = -25, radius = 30, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coralab'] = { + ["coralab"] = { buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 3, posy = 2, posz = 0, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 3, posy = 2, posz = 0, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = -3, posy = 2, posz = 0, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = -3, posy = 2, posz = 0, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlightB = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 49, posy = 28, posz = 41.5, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 49, posy = 28, posz = 41.5, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -49, posy = 28, posz = 41.5, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -49, posy = 28, posz = 41.5, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 49, posy = 28, posz = -29, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 49, posy = 28, posz = -29, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -49, posy = 28, posz = -29, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -49, posy = 28, posz = -29, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.6, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corasy'] = { + ["corasy"] = { buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash3 = { - lightType = 'point', - pieceName = 'cagelight3', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight3", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash4 = { - lightType = 'point', - pieceName = 'cagelight4', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight4", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3 = { - lightType = 'cone', - pieceName = 'cagelight_emit3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight4 = { - lightType = 'cone', - pieceName = 'cagelight_emit4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'nano5', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano5", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight6 = { - lightType = 'point', - pieceName = 'nano6', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano6", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight7 = { - lightType = 'point', - pieceName = 'nano7', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano7", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight8 = { - lightType = 'point', - pieceName = 'nano8', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano8", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corgant'] = { + ["corgant"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 23, - dirx = 1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 23, dirx = 1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 23, - dirx = -1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 23, dirx = -1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit3', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit3", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit3', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 21, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit3", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 21, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash3 = { - lightType = 'point', - pieceName = 'cagelight3', - lightConfig = { posx = 0, posy = -3, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight3", + lightConfig = { posx = 0, posy = -3, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'n1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'n2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'n3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'n4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'n5', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n5", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight6 = { - lightType = 'point', - pieceName = 'n6', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n6", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight7 = { - lightType = 'point', - pieceName = 'n7', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n7", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight8 = { - lightType = 'point', - pieceName = 'n8', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n8", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight9 = { - lightType = 'point', - pieceName = 'n9', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n9", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight10 = { - lightType = 'point', - pieceName = 'n10', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n10", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight11 = { - lightType = 'point', - pieceName = 'n11', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n11", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight12 = { - lightType = 'point', - pieceName = 'n12', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "n12", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsy'] = { + ["corsy"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armason'] = { + ["armason"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 32, posz = 5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 32, posz = 5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 32, posz = 5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 32, posz = 5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 32, posz = -5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 32, posz = -5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 32, posz = -5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 32, posz = -5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennasonar = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 69, posz = 0, radius = 3.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 50, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 69, posz = 0, radius = 3.7, color2r = -2, color2g = -2, color2b = -2, colortime = 50, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsub'] = { + ["armsub"] = { headlighttorpedo = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 8.2, posz = 5, radius = 80, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.18, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 8.2, posz = 5, radius = 80, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.18, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.6, posy = 13.5, posz = 7.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.6, posy = 13.5, posz = 7.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2.6, posy = 13.5, posz = 7.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2.6, posy = 13.5, posz = 7.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = 14, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = 14, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.4, posy = 8.0, posz = 11.0, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.4, posy = 8.0, posz = 11.0, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.6, posy = 8.0, posz = 11.0, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.6, posy = 8.0, posz = 11.0, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armroy'] = { + ["armroy"] = { sidelightl = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 15, posy = 5.8, posz = -8.0, radius = 2.5, - pos2x = 15, pos2y = 5.8, pos2z = 0.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 15, posy = 5.8, posz = -8.0, radius = 2.5, pos2x = 15, pos2y = 5.8, pos2z = 0.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightr = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -15, posy = 5.8, posz = -8.0, radius = 2.5, - pos2x = -15, pos2y = 5.8, pos2z = 0.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -15, posy = 5.8, posz = -8.0, radius = 2.5, pos2x = -15, pos2y = 5.8, pos2z = 0.2, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'depthturret', - lightConfig = { posx = -10, posy = 2, posz = 9.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "depthturret", + lightConfig = { posx = -10, posy = 2, posz = 9.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'depthturret', - lightConfig = { posx = 10, posy = 2, posz = 9.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "depthturret", + lightConfig = { posx = 10, posy = 2, posz = 9.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash1 = { - lightType = 'point', - pieceName = 'depthturret', - lightConfig = { posx = 0, posy = 2.4, posz = -11.3, radius = 1.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "depthturret", + lightConfig = { posx = 0, posy = 2.4, posz = -11.3, radius = 1.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashside1 = { - lightType = 'beam', - pieceName = 'depthturret', - lightConfig = { posx = -8.7, posy = 4.4, posz = -2.1, radius = 0.9, - pos2x = -8.7, pos2y = 4.4, pos2z = -4.9, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "depthturret", + lightConfig = { posx = -8.7, posy = 4.4, posz = -2.1, radius = 0.9, pos2x = -8.7, pos2y = 4.4, pos2z = -4.9, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 2, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashside2 = { - lightType = 'beam', - pieceName = 'depthturret', - lightConfig = { posx = 8.7, posy = 4.4, posz = -2.1, radius = 0.9, - pos2x = 8.7, pos2y = 4.4, pos2z = -4.9, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "depthturret", + lightConfig = { posx = 8.7, posy = 4.4, posz = -2.1, radius = 0.9, pos2x = 8.7, pos2y = 4.4, pos2z = -4.9, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 2, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 18, posz = -3.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 18, posz = -3.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 18, posz = -3.5, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 18, posz = -3.5, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 18, posz = -3.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 18, posz = -3.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 10, posz = -33.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 10, posz = -33.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 10, posz = -33.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 10, posz = -33.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcs'] = { + ["armcs"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 3, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 3, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1spot = { - lightType = 'point', - pieceName = 'cagelight_emit', - lightConfig = { posx = 4.5, posy = -1.0, posz = 1, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1.3, g = 1, b = 0.2, a = 1.1, - modelfactor = 0.5, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight_emit", + lightConfig = { posx = 4.5, posy = -1.0, posz = 1, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1.3, g = 1, b = 0.2, a = 1.1, modelfactor = 0.5, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = -3, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = -3, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2spot = { - lightType = 'point', - pieceName = 'cagelight_emit', - lightConfig = { posx = -4.5, posy = -1.0, posz = 1, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1.3, g = 1, b = 0.2, a = 1.1, - modelfactor = 0.5, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight_emit", + lightConfig = { posx = -4.5, posy = -1.0, posz = 1, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1.3, g = 1, b = 0.2, a = 1.1, modelfactor = 0.5, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 18, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 18, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28.2, posz = 0, radius = 4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28.2, posz = 0, radius = 4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 15, posz = 6.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 15, posz = 6.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 15, posz = 6.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 15, posz = 6.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 15, posz = -6.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 15, posz = -6.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 15, posz = -6.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 15, posz = -6.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corpt'] = { + ["corpt"] = { searchlightaa = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 200, colortime = -1.5, - dirx = 0, diry = 0, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 200, colortime = -1.5, dirx = 0, diry = 0, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -6500,62 +3918,36 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.3, posz = 16.2, radius = 1.8, - pos2x = 0, pos2y = 4.5, pos2z = 18.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.3, posz = 16.2, radius = 1.8, pos2x = 0, pos2y = 4.5, pos2z = 18.0, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob1 = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = -8.5, posy = 0, posz = 2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = -8.5, posy = 0, posz = 2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob2 = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 8.5, posy = 0, posz = 2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 8.5, posy = 0, posz = 2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcs'] = { + ["corcs"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.66, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.66, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4, posy = 6.6, posz = 14.8, radius = 1.8, - pos2x = 4, pos2y = 6.6, pos2z = 14.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.3, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4, posy = 6.6, posz = 14.8, radius = 1.8, pos2x = 4, pos2y = 6.6, pos2z = 14.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.3, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -6567,97 +3959,56 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1.6, posy = 16.2, posz = 0.1, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.5, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1.6, posy = 16.2, posz = 0.1, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.5, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 9.5, posz = -14.5, radius = 7, - pos2x = 3.5, pos2y = 9.5, pos2z = -14.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 9.5, posz = -14.5, radius = 7, pos2x = 3.5, pos2y = 9.5, pos2z = -14.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennaleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.7, posy = 10.5, posz = 8.8, radius = 3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.7, posy = 10.5, posz = 8.8, radius = 3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennaright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1.7, posy = 10.5, posz = 8.8, radius = 3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1.7, posy = 10.5, posz = 8.8, radius = 3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcsa'] = { + ["armcsa"] = { buildlight = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -3.5, posz = -21, radius = 13.6, - color2r = 0.3, color2g = 0.2, color2b = 0.025, colortime = 18, - r = 1.2, g = 0.85, b = 0.1, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = -3.5, posz = -21, radius = 13.6, color2r = 0.3, color2g = 0.2, color2b = 0.025, colortime = 18, r = 1.2, g = 0.85, b = 0.1, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20.5, posy = 6.5, posz = -4.8, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20.5, posy = 6.5, posz = -4.8, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20.5, posy = 6.5, posz = -2.1, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20.5, posy = 6.5, posz = -2.1, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20.5, posy = 6.5, posz = -4.8, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20.5, posy = 6.5, posz = -4.8, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20.5, posy = 6.5, posz = -2.1, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20.5, posy = 6.5, posz = -2.1, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- backpack = { -- lightType = 'point', @@ -6669,115 +4020,66 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustera = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 7.3, posz = -14.5, radius = 8, - color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.7, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 7.3, posz = -14.5, radius = 8, color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.7, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusterb = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 7.3, posz = -14.5, radius = 8, - color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.7, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 7.3, posz = -14.5, radius = 8, color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.7, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcsa'] = { + ["corcsa"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.3, posy = 5, posz = -19, radius = 9, - color2r = 0.8, color2g = 0.8, color2b = 0.1, colortime = 5, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.3, posy = 5, posz = -19, radius = 9, color2r = 0.8, color2g = 0.8, color2b = 0.1, colortime = 5, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.3, posy = 5, posz = -19, radius = 9, - color2r = 0.8, color2g = 0.8, color2b = 0.1, colortime = 6, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.3, posy = 5, posz = -19, radius = 9, color2r = 0.8, color2g = 0.8, color2b = 0.1, colortime = 6, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.25, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.25, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'point', - pieceName = 'thrust2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.25, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.25, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.9, posy = 9, posz = 22.5, radius = 1.8, - pos2x = 1.9, pos2y = 9, pos2z = 22.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.3, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.9, posy = 9, posz = 22.5, radius = 1.8, pos2x = 1.9, pos2y = 9, pos2z = 22.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.3, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.0, posy = 12.0, posz = 2.3, radius = 3.5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.0, posy = 12.0, posz = 2.3, radius = 3.5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.0, posy = 12.0, posz = 4.3, radius = 3.5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.0, posy = 12.0, posz = 4.3, radius = 3.5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -6789,531 +4091,305 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armdronecarry'] = { + ["armdronecarry"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, towerfront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armtrident'] = { + ["armtrident"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, towerfront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armdronecarryland'] = { + ["armdronecarryland"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 21, posz = -5, radius = 18, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, towerfront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22.5, posy = 11, posz = 10.5, radius = 22, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcarry'] = { + ["armcarry"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanoemit1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.33, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanoemit1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.33, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nanoemit2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanoemit2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 18, posz = 0, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 18, posz = 0, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, unstocked = { - lightType = 'point', - pieceName = 'unstocked', + lightType = "point", + pieceName = "unstocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = 2, g = 0.8, b = 0, a = 0.8, - modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = 2, g = 0.8, b = 0, a = 0.8, modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, stocked = { - lightType = 'point', - pieceName = 'stocked', + lightType = "point", + pieceName = "stocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 0.9, - modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 0.9, modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 56, posz = 25, radius = 28, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 56, posz = 25, radius = 28, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27, posy = 21, posz = 5, radius = 33, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27, posy = 21, posz = 5, radius = 33, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27, posy = 21, posz = -5, radius = 33, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27, posy = 21, posz = -5, radius = 33, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door1_1 = { - lightType = 'point', - pieceName = 'door1', - lightConfig = { posx = 8, posy = 0, posz = 11, radius = 19, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door1", + lightConfig = { posx = 8, posy = 0, posz = 11, radius = 19, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door1_2 = { - lightType = 'point', - pieceName = 'door1', - lightConfig = { posx = 8, posy = 5, posz = -11, radius = 19, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door1", + lightConfig = { posx = 8, posy = 5, posz = -11, radius = 19, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door2_1 = { - lightType = 'point', - pieceName = 'door2', - lightConfig = { posx = -8, posy = 0, posz = 11, radius = 19, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door2", + lightConfig = { posx = -8, posy = 0, posz = 11, radius = 19, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door2_2 = { - lightType = 'point', - pieceName = 'door2', - lightConfig = { posx = -8, posy = 5, posz = -11, radius = 19, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door2", + lightConfig = { posx = -8, posy = 5, posz = -11, radius = 19, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 11, posz = 78, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 11, posz = 78, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 11, posz = 78, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 11, posz = 78, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 11, posz = 34, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 11, posz = 34, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 11, posz = 34, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 11, posz = 34, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 11, posz = -78, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 11, posz = -78, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 11, posz = -78, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 11, posz = -78, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 11, posz = -34, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 11, posz = -34, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 11, posz = -34, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 11, posz = -34, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armantiship'] = { + ["armantiship"] = { greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.55, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.55, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, unstocked = { - lightType = 'point', - pieceName = 'unstocked', + lightType = "point", + pieceName = "unstocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 20, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = 2, g = 0.8, b = 0, a = 0.8, - modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 20, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = 2, g = 0.8, b = 0, a = 0.8, modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, stocked = { - lightType = 'point', - pieceName = 'stocked', + lightType = "point", + pieceName = "stocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 11, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 0.9, - modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 11, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 0.9, modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = 66, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = 66, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = -50.5, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = -50.5, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = -33, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = -33, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, whitemid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12.5, posz = 19, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12.5, posz = 19, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door1_1 = { - lightType = 'point', - pieceName = 'door1', - lightConfig = { posx = 8, posy = 0, posz = 11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door1", + lightConfig = { posx = 8, posy = 0, posz = 11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door1_2 = { - lightType = 'point', - pieceName = 'door1', - lightConfig = { posx = 8, posy = 5, posz = -11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door1", + lightConfig = { posx = 8, posy = 5, posz = -11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door2_1 = { - lightType = 'point', - pieceName = 'door2', - lightConfig = { posx = -8, posy = 0, posz = 11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door2", + lightConfig = { posx = -8, posy = 0, posz = 11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, door2_2 = { - lightType = 'point', - pieceName = 'door2', - lightConfig = { posx = -8, posy = 5, posz = -11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "door2", + lightConfig = { posx = -8, posy = 5, posz = -11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cordrone'] = { + ["cordrone"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.5, posz = 8, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.5, posz = 8, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cordronecarry'] = { + ["cordronecarry"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsentinel'] = { + ["corsentinel"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cordronecarryair'] = { + ["cordronecarryair"] = { tower = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16.5, posy = 20, posz = -34, radius = 17, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.4, specular = 0.4, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcarry'] = { + ["corcarry"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.33, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.33, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 47, posz = 16, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 47, posz = 16, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = 16, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = 16, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 47, posz = -5, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 47, posz = -5, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = -5, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = -5, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corantiship'] = { + ["corantiship"] = { eyesfronttop = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20.4, posz = 60, radius = 5.0, - pos2x = 0, pos2y = 18, pos2z = 78, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 20.4, posz = 60, radius = 5.0, pos2x = 0, pos2y = 18, pos2z = 78, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.8, posy = 12.5, posz = 77, radius = 3.0, - pos2x = 4.8, pos2y = 12.5, pos2z = 77, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.8, posy = 12.5, posz = 77, radius = 3.0, pos2x = 4.8, pos2y = 12.5, pos2z = 77, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob1 = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 20, posz = -1, radius = 15, - color2r = -2, color2g = -2, color2b = -2, colortime = 50, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 20, posz = -1, radius = 15, color2r = -2, color2g = -2, color2b = -2, colortime = 50, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyestop = { -- lightType = 'point', @@ -7325,66 +4401,40 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, orangelight1 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = -17.0, posy = 19.0, posz = -38.8, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = -17.0, posy = 19.0, posz = -38.8, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight12 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 17.0, posy = 19.0, posz = -38.8, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 17.0, posy = 19.0, posz = -38.8, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenlight1 = { - lightType = 'point', - pieceName = 'greendbr', + lightType = "point", + pieceName = "greendbr", alliedOnly = true, - lightConfig = { posx = -12, posy = 28.5, posz = -18, radius = 12, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, - + lightConfig = { posx = -12, posy = 28.5, posz = -18, radius = 12, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight2 = { - lightType = 'point', - pieceName = 'greendbr', + lightType = "point", + pieceName = "greendbr", alliedOnly = true, - lightConfig = { posx = -12, posy = 28.5, posz = 6, radius = 12, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = -12, posy = 28.5, posz = 6, radius = 12, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight3 = { - lightType = 'point', - pieceName = 'greendbl', + lightType = "point", + pieceName = "greendbl", alliedOnly = true, - lightConfig = { posx = 12, posy = 28.5, posz = -18, radius = 12, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 12, posy = 28.5, posz = -18, radius = 12, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight4 = { - lightType = 'point', - pieceName = 'greendbl', + lightType = "point", + pieceName = "greendbl", alliedOnly = true, - lightConfig = { posx = 12, posy = 28.5, posz = 6, radius = 12, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 12, posy = 28.5, posz = 6, radius = 12, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, -- eyesside1 = { -- lightType = 'point', @@ -7414,70 +4464,41 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, backr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 26, posz = -53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 26, posz = -53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 26, posz = -53, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 26, posz = -53, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 26, posz = -28, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 26, posz = -28, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 26, posz = -28, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 26, posz = -28, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfship'] = { + ["corfship"] = { flamelight = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 2, posz = 19, radius = 14, - color2r = 0.89999998, color2g = 0.5, color2b = 0.05, colortime = 5, - r = 0.95, g = 0.66, b = 0.07, a = 0.5, - modelfactor = 0.4, specular = 0.8, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 2, posz = 19, radius = 14, color2r = 0.89999998, color2g = 0.5, color2b = 0.05, colortime = 5, r = 0.95, g = 0.66, b = 0.07, a = 0.5, modelfactor = 0.4, specular = 0.8, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, flamebright = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 19, radius = 4, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, - r = 0.95, g = 0.66, b = 0.07, a = 1.9, - modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 19, radius = 4, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, r = 0.95, g = 0.66, b = 0.07, a = 1.9, modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeshighfront = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -2.8, posy = 5.5, posz = 6.2, radius = 1.0, - pos2x = 2.8, pos2y = 5.5, pos2z = 6.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -2.8, posy = 5.5, posz = 6.2, radius = 1.0, pos2x = 2.8, pos2y = 5.5, pos2z = 6.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -7498,44 +4519,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turretnrgrighttop = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 9, posy = 8, posz = 6, radius = 7, - pos2x = 9, pos2y = 8, pos2z = -1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 9, posy = 8, posz = 6, radius = 7, pos2x = 9, pos2y = 8, pos2z = -1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretnrgleftttop = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -9, posy = 8, posz = 6, radius = 7, - pos2x = -9, pos2y = 8, pos2z = -1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -9, posy = 8, posz = 6, radius = 7, pos2x = -9, pos2y = 8, pos2z = -1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretnrgrightbot = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 14, posy = 3, posz = 4, radius = 7, - pos2x = 14, pos2y = 3, pos2z = -5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 14, posy = 3, posz = 4, radius = 7, pos2x = 14, pos2y = 3, pos2z = -5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretnrglefttbot = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -14, posy = 3, posz = 4, radius = 7, - pos2x = -14, pos2y = 3, pos2z = -5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -14, posy = 3, posz = 4, radius = 7, pos2x = -14, pos2y = 3, pos2z = -5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turret_right1 = { -- lightType = 'point', @@ -7574,24 +4575,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, backleftnrg = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 4, posz = -23, radius = 4, - pos2x = 6.2, pos2y = 4, pos2z = -30, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 4, posz = -23, radius = 4, pos2x = 6.2, pos2y = 4, pos2z = -30, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backrightnrg = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 4, posz = -23, radius = 4, - pos2x = -6.2, pos2y = 4, pos2z = -30, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 4, posz = -23, radius = 4, pos2x = -6.2, pos2y = 4, pos2z = -30, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- back_right1 = { -- lightType = 'point', @@ -7630,61 +4621,36 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, aalightright = { - lightType = 'point', - pieceName = 'mturret', - lightConfig = { posx = -3.5, posy = 7.0, posz = -0.7, radius = 2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mturret", + lightConfig = { posx = -3.5, posy = 7.0, posz = -0.7, radius = 2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightleft = { - lightType = 'point', - pieceName = 'mturret', - lightConfig = { posx = 3.5, posy = 7.0, posz = -0.7, radius = 2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mturret", + lightConfig = { posx = 3.5, posy = 7.0, posz = -0.7, radius = 2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coracsub'] = { + ["coracsub"] = { nanolight1 = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.2, posy = 15.0, posz = 12.6, radius = 2.5, - pos2x = 4.2, pos2y = 15.0, pos2z = 12.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.2, posy = 15.0, posz = 12.6, radius = 2.5, pos2x = 4.2, pos2y = 15.0, pos2z = 12.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.3, posy = 14, posz = 17.2, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.3, posy = 14, posz = 17.2, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.3, posy = 14, posz = 17.2, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.3, posy = 14, posz = 17.2, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -7714,33 +4680,21 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armacsub'] = { + ["armacsub"] = { buildflash = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = 32, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = 32, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front = { -- lightType = 'point', @@ -7752,61 +4706,36 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, frontside1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 15, posz = 30, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 15, posz = 30, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontside2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 15, posz = 30, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 15, posz = 30, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormls'] = { + ["cormls"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.6, posy = 9.3, posz = 15.2, radius = 1.2, - pos2x = 2.6, pos2y = 9.3, pos2z = 15.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.6, posy = 9.3, posz = 15.2, radius = 1.2, pos2x = 2.6, pos2y = 9.3, pos2z = 15.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.5, posy = 12.6, posz = -16.5, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.5, posy = 12.6, posz = -16.5, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.5, posy = 12.6, posz = -16.5, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.5, posy = 12.6, posz = -16.5, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -7818,43 +4747,26 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corshark'] = { + ["corshark"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.2, posy = 4.9, posz = 30, radius = 3, - pos2x = 4.2, pos2y = 4.9, pos2z = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.2, posy = 4.9, posz = 30, radius = 3, pos2x = 4.2, pos2y = 4.9, pos2z = 30, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlighttorpedo = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4.2, posz = 18, radius = 70, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.58, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4.2, posz = 18, radius = 70, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.58, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9.8, posy = 4.6, posz = 22.0, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9.8, posy = 4.6, posz = 22.0, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9.8, posy = 4.6, posz = 22.0, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9.8, posy = 4.6, posz = 22.0, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -7875,107 +4787,63 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cordesolator'] = { + ["cordesolator"] = { nukelight = { - lightType = 'cone', - pieceName = 'firing1', + lightType = "cone", + pieceName = "firing1", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = -5, radius = 50, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - r = 1, g = 0.2, b = 0.2, a = 0.45, - modelfactor = 0.5, specular = 1, scattering = 6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = -5, radius = 50, dirx = 0, diry = 0, dirz = 1, theta = 0.07, r = 1, g = 0.2, b = 0.2, a = 0.45, modelfactor = 0.5, specular = 1, scattering = 6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nukelight2 = { - lightType = 'cone', - pieceName = 'firing2', + lightType = "cone", + pieceName = "firing2", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = -5, radius = 50, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - r = 1, g = 0.2, b = 0.2, a = 0.45, - modelfactor = 0.5, specular = 1, scattering = 6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = -5, radius = 50, dirx = 0, diry = 0, dirz = 1, theta = 0.07, r = 1, g = 0.2, b = 0.2, a = 0.45, modelfactor = 0.5, specular = 1, scattering = 6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.5, posy = 32, posz = 4, radius = 27, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.115, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.5, posy = 32, posz = 4, radius = 27, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.115, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.5, posy = 32, posz = 4, radius = 27, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.5, posy = 32, posz = 4, radius = 27, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 58, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 58, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coronager'] = { + ["coronager"] = { engine = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = -25, radius = 25, - color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.5, b = 0.1, a = 0.165, - modelfactor = 0.3, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = -25, radius = 25, color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 0, r = 0.6, g = 0.5, b = 0.1, a = 0.165, modelfactor = 0.3, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2, posy = 10, posz = 8, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.065, - modelfactor = 0.3, specular = 0, scattering = 3.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2, posy = 10, posz = 8, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.065, modelfactor = 0.3, specular = 0, scattering = 3.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['corblackhy'] = { + ["corblackhy"] = { eyesfront = { - lightType = 'beam', - pieceName = 'tur1', - lightConfig = { posx = -7.8, posy = 31, posz = 15, radius = 2, - pos2x = 7.8, pos2y = 31, pos2z = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "tur1", + lightConfig = { posx = -7.8, posy = 31, posz = 15, radius = 2, pos2x = 7.8, pos2y = 31, pos2z = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'tur1', - lightConfig = { posx = -8.5, posy = 31, posz = 15, radius = 2, - pos2x = -12, pos2y = 31, pos2z = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "tur1", + lightConfig = { posx = -8.5, posy = 31, posz = 15, radius = 2, pos2x = -12, pos2y = 31, pos2z = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'tur1', - lightConfig = { posx = 8.5, posy = 31, posz = 15, radius = 2, - pos2x = 12, pos2y = 31, pos2z = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "tur1", + lightConfig = { posx = 8.5, posy = 31, posz = 15, radius = 2, pos2x = 12, pos2y = 31, pos2z = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -8005,333 +4873,184 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 32, posz = 69, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 32, posz = 69, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 32, posz = 69, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 32, posz = 69, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = -11.5, posy = 37, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = -11.5, posy = 37, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = 11.5, posy = 37, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = 11.5, posy = 37, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = -6.0, posy = 37.5, posz = 6.5, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.2, g = 1, b = 0.33, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = -6.0, posy = 37.5, posz = 6.5, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.2, g = 1, b = 0.33, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = 6.0, posy = 37.5, posz = 6.5, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.2, g = 1, b = 0.33, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = 6.0, posy = 37.5, posz = 6.5, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.2, g = 1, b = 0.33, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = -8, posy = 12, posz = -5, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = -8, posy = 12, posz = -5, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret1 = { - lightType = 'point', - pieceName = 'gun6', - lightConfig = { posx = 0, posy = 7.6, posz = -3, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun6", + lightConfig = { posx = 0, posy = 7.6, posz = -3, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret2 = { - lightType = 'point', - pieceName = 'gun5', - lightConfig = { posx = 0, posy = 7.6, posz = -3, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun5", + lightConfig = { posx = 0, posy = 7.6, posz = -3, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret3 = { - lightType = 'point', - pieceName = 'gun2', - lightConfig = { posx = 0, posy = 7.6, posz = -5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun2", + lightConfig = { posx = 0, posy = 7.6, posz = -5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aagunright = { - lightType = 'beam', - pieceName = 'sleeves4', - lightConfig = { posx = 0, posy = 4.1, posz = -1, radius = 2, - pos2x = 0, pos2y = 4.1, pos2z = 1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves4", + lightConfig = { posx = 0, posy = 4.1, posz = -1, radius = 2, pos2x = 0, pos2y = 4.1, pos2z = 1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightaaright = { - lightType = 'cone', - pieceName = 'sleeves4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, colortime = -1.5, - dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeves4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, colortime = -1.5, dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aagunleft = { - lightType = 'beam', - pieceName = 'sleeves3', - lightConfig = { posx = 0, posy = 4.1, posz = -1, radius = 2, - pos2x = 0, pos2y = 4.1, pos2z = 1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves3", + lightConfig = { posx = 0, posy = 4.1, posz = -1, radius = 2, pos2x = 0, pos2y = 4.1, pos2z = 1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightaaleft = { - lightType = 'cone', - pieceName = 'sleeves3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, colortime = -1.5, - dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeves3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, colortime = -1.5, dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightrightsource1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -34, posy = 22.9, posz = 5.2, radius = 7, - pos2x = -30.5, pos2y = 26.4, pos2z = 5.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -34, posy = 22.9, posz = 5.2, radius = 7, pos2x = -30.5, pos2y = 26.4, pos2z = 5.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightright1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -25, posy = 27, posz = 5.2, radius = 75, colortime = -2, - dirx = -1, diry = -0.3, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -25, posy = 27, posz = 5.2, radius = 75, colortime = -2, dirx = -1, diry = -0.3, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightrightsource2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -34, posy = 22.9, posz = 36.8, radius = 7, - pos2x = -30.5, pos2y = 26.4, pos2z = 36.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -34, posy = 22.9, posz = 36.8, radius = 7, pos2x = -30.5, pos2y = 26.4, pos2z = 36.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightright2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -25, posy = 27, posz = 36.8, radius = 75, colortime = -2, - dirx = -1, diry = -0.3, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -25, posy = 27, posz = 36.8, radius = 75, colortime = -2, dirx = -1, diry = -0.3, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightleftsource1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 34, posy = 22.9, posz = 5.2, radius = 7, - pos2x = 30.5, pos2y = 26.4, pos2z = 5.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 34, posy = 22.9, posz = 5.2, radius = 7, pos2x = 30.5, pos2y = 26.4, pos2z = 5.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightleft1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 25, posy = 27, posz = 5.2, radius = 75, colortime = -2, - dirx = 1, diry = -0.3, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 25, posy = 27, posz = 5.2, radius = 75, colortime = -2, dirx = 1, diry = -0.3, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightleftsource2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 34, posy = 22.9, posz = 36.8, radius = 7, - pos2x = 30.5, pos2y = 26.4, pos2z = 36.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 34, posy = 22.9, posz = 36.8, radius = 7, pos2x = 30.5, pos2y = 26.4, pos2z = 36.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightleft2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 25, posy = 27, posz = 36.8, radius = 75, colortime = -2, - dirx = 1, diry = -0.3, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 25, posy = 27, posz = 36.8, radius = 75, colortime = -2, dirx = 1, diry = -0.3, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfblackhyt4'] = { + ["corfblackhyt4"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 67, posz = -34, radius = 24, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 67, posz = -34, radius = 24, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 67, posz = -37, radius = 20, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 67, posz = -37, radius = 20, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 67, posz = -37, radius = 20, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 67, posz = -37, radius = 20, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 32, posz = 69, radius = 33, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 32, posz = 69, radius = 33, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 32, posz = 69, radius = 33, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 32, posz = 69, radius = 33, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.5, posy = 73, posz = -50.5, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.5, posy = 73, posz = -50.5, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.5, posy = 73, posz = -50.5, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.075, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.5, posy = 73, posz = -50.5, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.075, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 73, posz = -44, radius = 12, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.33, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 73, posz = -44, radius = 12, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.33, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 73, posz = -44, radius = 12, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.33, a = 0.05, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 73, posz = -44, radius = 12, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.33, a = 0.05, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustl1', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustl1", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustl2', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustl2", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustr1', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustr1", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustr2', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustr2", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormship'] = { + ["cormship"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'base', @@ -8351,238 +5070,126 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -6.2, posy = 28, posz = -33.3, radius = 2, - pos2x = 6.2, pos2y = 28, pos2z = -33.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -6.2, posy = 28, posz = -33.3, radius = 2, pos2x = 6.2, pos2y = 28, pos2z = -33.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 5, posz = 3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 5, posz = 3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11, posy = 42, posz = -35, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 42, posz = -35, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 42, posz = -35, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 42, posz = -35, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncherl = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = 7, posy = 0.1, posz = 16, radius = 1.8, - dirx = -1, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = 7, posy = 0.1, posz = 16, radius = 1.8, dirx = -1, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncherr = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = -7, posy = 0.1, posz = 16, radius = 1.8, - dirx = 1, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - aagunleft= { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 5.1, posy = 3.5, posz = -1, radius = 2, - pos2x = 5.1, pos2y = 3.5, pos2z = -0.5, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - aagunright= { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = -5.1, posy = 3.5, posz = -1, radius = 2, - pos2x = -5.1, pos2y = 3.5, pos2z = -0.5, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = -7, posy = 0.1, posz = 16, radius = 1.8, dirx = 1, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + aagunleft = { + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 5.1, posy = 3.5, posz = -1, radius = 2, pos2x = 5.1, pos2y = 3.5, pos2z = -0.5, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + aagunright = { + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = -5.1, posy = 3.5, posz = -1, radius = 2, pos2x = -5.1, pos2y = 3.5, pos2z = -0.5, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightaa = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 160, colortime = -1.5, - dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 160, colortime = -1.5, dirx = 0, diry = 0.3, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcrus'] = { + ["corcrus"] = { headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'sleeve', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 3.2, posz = -1, radius = 75, colortime = -2, - dirx = 0, diry = -0.1, dirz = 1, theta = 0.15, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 3.2, posz = -1, radius = 75, colortime = -2, dirx = 0, diry = -0.1, dirz = 1, theta = 0.15, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunleft1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 12.8, posy = 5, posz = 6.5, radius = 2.5, - dirx = -1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 12.8, posy = 5, posz = 6.5, radius = 2.5, dirx = -1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunleft2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 12.8, posy = 5, posz = 1, radius = 2.5, - dirx = -1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 12.8, posy = 5, posz = 1, radius = 2.5, dirx = -1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunleft3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 12.8, posy = 5, posz = -4.5, radius = 2.5, - dirx = -1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 12.8, posy = 5, posz = -4.5, radius = 2.5, dirx = -1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunright1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -12.8, posy = 5, posz = 5.5, radius = 2.5, - dirx = 1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -12.8, posy = 5, posz = 5.5, radius = 2.5, dirx = 1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunright2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -12.8, posy = 5, posz = 1, radius = 2.5, - dirx = 1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -12.8, posy = 5, posz = 1, radius = 2.5, dirx = 1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunright3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -12.8, posy = 5, posz = -4.5, radius = 2.5, - dirx = 1, diry = 1, dirz = 0, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -12.8, posy = 5, posz = -4.5, radius = 2.5, dirx = 1, diry = 1, dirz = 0, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunbarrelright = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -7.8, posy = 0.6, posz = 16.5, radius = 6.5, - color2r = 0, color2g = 0.3, color2b = 0, colortime = 35, - r = 0, g = 1.5, b = 0, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -7.8, posy = 0.6, posz = 16.5, radius = 6.5, color2r = 0, color2g = 0.3, color2b = 0, colortime = 35, r = 0, g = 1.5, b = 0, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunbarrelleft = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 7.8, posy = 0.6, posz = 16.5, radius = 6.5, - color2r = 0, color2g = 0.3, color2b = 0, colortime = 35, - r = 0, g = 1.5, b = 0, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 7.8, posy = 0.6, posz = 16.5, radius = 6.5, color2r = 0, color2g = 0.3, color2b = 0, colortime = 35, r = 0, g = 1.5, b = 0, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 18.9, posz = -7.2, radius = 1.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 18.9, posz = -7.2, radius = 1.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret1l = { - lightType = 'point', - pieceName = 'foreturret', - lightConfig = { posx = 3.2, posy = 6.7, posz = 2.5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "foreturret", + lightConfig = { posx = 3.2, posy = 6.7, posz = 2.5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret1r = { - lightType = 'point', - pieceName = 'foreturret', - lightConfig = { posx = -3.2, posy = 6.7, posz = 2.5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "foreturret", + lightConfig = { posx = -3.2, posy = 6.7, posz = 2.5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret2l = { - lightType = 'point', - pieceName = 'aftturret', - lightConfig = { posx = 3.2, posy = 6.7, posz = 2.5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aftturret", + lightConfig = { posx = 3.2, posy = 6.7, posz = 2.5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret2r = { - lightType = 'point', - pieceName = 'aftturret', - lightConfig = { posx = -3.2, posy = 6.7, posz = 2.5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aftturret", + lightConfig = { posx = -3.2, posy = 6.7, posz = 2.5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightdepthchargef = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -6, posy = 5.2, posz = -7, radius = 200, - color2r = 0.35, color2g = 0.37, color2b = 0.45, colortime = 120, - dirx = 0, diry = -0.7, dirz = 0.6, theta = 0.55, - r = 0.69, g = 0.75, b = 0.9, a = 0.1, - modelfactor = 0.5, specular = 0.3, scattering = 14.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -6, posy = 5.2, posz = -7, radius = 200, color2r = 0.35, color2g = 0.37, color2b = 0.45, colortime = 120, dirx = 0, diry = -0.7, dirz = 0.6, theta = 0.55, r = 0.69, g = 0.75, b = 0.9, a = 0.1, modelfactor = 0.5, specular = 0.3, scattering = 14.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headlightdepthchargeb = { -- this is the lightname -- lightType = 'cone', @@ -8594,84 +5201,46 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corbats'] = { + ["corbats"] = { eyesfront = { - lightType = 'beam', - pieceName = 'turretb', - lightConfig = { posx = -3.2, posy = 19, posz = 4.5, radius = 2, - pos2x = 3.2, pos2y = 19, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turretb", + lightConfig = { posx = -3.2, posy = 19, posz = 4.5, radius = 2, pos2x = 3.2, pos2y = 19, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsource1 = { - lightType = 'beam', - pieceName = 'turretb', - lightConfig = { posx = -17, posy = 1.2, posz = -3.5, radius = 6, - pos2x = -17, pos2y = 1.2, pos2z = -12.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turretb", + lightConfig = { posx = -17, posy = 1.2, posz = -3.5, radius = 6, pos2x = -17, pos2y = 1.2, pos2z = -12.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mainturret1 = { - lightType = 'point', - pieceName = 'sleeveb1', - lightConfig = { posx = 1.4, posy = 0.1, posz = 6.1, radius = 1.2, - dirx = 0, diry = 0, dirz = 1, theta = -2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 30, - r = 1, g = 0.8, b = 0.2, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeveb1", + lightConfig = { posx = 1.4, posy = 0.1, posz = 6.1, radius = 1.2, dirx = 0, diry = 0, dirz = 1, theta = -2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 30, r = 1, g = 0.8, b = 0.2, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mainturret2 = { - lightType = 'point', - pieceName = 'sleeveb2', - lightConfig = { posx = -0, posy = 0.1, posz = 6.1, radius = 1.2, - dirx = 0, diry = 0, dirz = 1, theta = -2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 30, - r = 1, g = 0.8, b = 0.2, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeveb2", + lightConfig = { posx = -0, posy = 0.1, posz = 6.1, radius = 1.2, dirx = 0, diry = 0, dirz = 1, theta = -2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 30, r = 1, g = 0.8, b = 0.2, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mainturret3 = { - lightType = 'point', - pieceName = 'sleeveb3', - lightConfig = { posx = -1.4, posy = 0.1, posz = 6.1, radius = 1.2, - dirx = 0, diry = 0, dirz = 1, theta = -2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 30, - r = 1, g = 0.8, b = 0.2, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeveb3", + lightConfig = { posx = -1.4, posy = 0.1, posz = 6.1, radius = 1.2, dirx = 0, diry = 0, dirz = 1, theta = -2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 30, r = 1, g = 0.8, b = 0.2, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsource2 = { - lightType = 'beam', - pieceName = 'turretb', - lightConfig = { posx = 17, posy = 1.2, posz = -3.5, radius = 6, - pos2x = 17, pos2y = 1.2, pos2z = -12.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turretb", + lightConfig = { posx = 17, posy = 1.2, posz = -3.5, radius = 6, pos2x = 17, pos2y = 1.2, pos2z = -12.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'turretb', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -6, posy = 1.2, posz = -7, radius = 75, colortime = -2, - dirx = -1, diry = -0.5, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turretb", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -6, posy = 1.2, posz = -7, radius = 75, colortime = -2, dirx = -1, diry = -0.5, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'turretb', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 6, posy = 1.2, posz = -7, radius = 75, colortime = -2, - dirx = 1, diry = -0.5, dirz = 0, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.55, - modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turretb", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 6, posy = 1.2, posz = -7, radius = 75, colortime = -2, dirx = 1, diry = -0.5, dirz = 0, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.55, modelfactor = 0.1, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -8692,41 +5261,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, antenna1 = { - lightType = 'point', - pieceName = 'turretb', - lightConfig = { posx = -0.3, posy = 35, posz = -16, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "turretb", + lightConfig = { posx = -0.3, posy = 35, posz = -16, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'turretb', - lightConfig = { posx = 4.8, posy = 31, posz = -16, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretb", + lightConfig = { posx = 4.8, posy = 31, posz = -16, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna3 = { - lightType = 'point', - pieceName = 'turretb', - lightConfig = { posx = -4.8, posy = 28, posz = -16, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretb", + lightConfig = { posx = -4.8, posy = 28, posz = -16, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamturret1 = { - lightType = 'point', - pieceName = 'sleevea', - lightConfig = { posx = 0, posy = 8.7, posz = 0, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevea", + lightConfig = { posx = 0, posy = 8.7, posz = 0, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- teamturret1A = { -- lightType = 'point', @@ -8759,104 +5311,60 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corssub'] = { + ["corssub"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4, posy = 18, posz = 20, radius = 3, - pos2x = 4, pos2y = 18, pos2z = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4, posy = 18, posz = 20, radius = 3, pos2x = 4, pos2y = 18, pos2z = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8.2, posz = 33, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8.2, posz = 33, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17.9, posy = 8.2, posz = 6.2, radius = 1.8, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17.9, posy = 8.2, posz = 6.2, radius = 1.8, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17.9, posy = 8.2, posz = 6.2, radius = 1.8, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17.9, posy = 8.2, posz = 6.2, radius = 1.8, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corarch'] = { + ["corarch"] = { searchlight1 = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = -2, posz = 8, radius = 350, colortime = -1.5, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = -2, posz = 8, radius = 350, colortime = -1.5, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aagunfront = { - lightType = 'beam', - pieceName = 'boxa', - lightConfig = { posx = -0.7, posy = 5.3, posz = -0.8, radius = 3.2, - pos2x = 0.7, pos2y = 5.3, pos2z = -0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxa", + lightConfig = { posx = -0.7, posy = 5.3, posz = -0.8, radius = 3.2, pos2x = 0.7, pos2y = 5.3, pos2z = -0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aagunback = { - lightType = 'beam', - pieceName = 'boxb', - lightConfig = { posx = -0.7, posy = 5.3, posz = -0.8, radius = 3.2, - pos2x = 0.7, pos2y = 5.3, pos2z = -0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxb", + lightConfig = { posx = -0.7, posy = 5.3, posz = -0.8, radius = 3.2, pos2x = 0.7, pos2y = 5.3, pos2z = -0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'boxa', - lightConfig = { posx = 0, posy = 4.5, posz = 1.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "boxa", + lightConfig = { posx = 0, posy = 4.5, posz = 1.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'boxb', - lightConfig = { posx = 0, posy = 4.5, posz = 1.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "boxb", + lightConfig = { posx = 0, posy = 4.5, posz = 1.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmship'] = { + ["armmship"] = { frontlight = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 6.7, posy = 10.2, posz = 31, radius = 2.4, - pos2x = -6.7, pos2y = 10.2, pos2z = 31.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 6.7, posy = 10.2, posz = 31, radius = 2.4, pos2x = -6.7, pos2y = 10.2, pos2z = 31.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -8868,170 +5376,96 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, searchlight = { - lightType = 'cone', - pieceName = 'launcher2', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 150, - dirx = 0, diry = 0.1, dirz = 1, theta = 0.14, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "launcher2", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 150, dirx = 0, diry = 0.1, dirz = 1, theta = 0.14, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1A = { - lightType = 'beam', - pieceName = 'launcher2', - lightConfig = { posx = -4.4, posy = 4.7, posz = 5.7, radius = 1.3, - pos2x = -4.4, pos2y = 4.7, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "launcher2", + lightConfig = { posx = -4.4, posy = 4.7, posz = 5.7, radius = 1.3, pos2x = -4.4, pos2y = 4.7, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1B = { - lightType = 'beam', - pieceName = 'launcher2', - lightConfig = { posx = 4.4, posy = 4.7, posz = 5.7, radius = 1.3, - pos2x = 4.4, pos2y = 4.7, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "launcher2", + lightConfig = { posx = 4.4, posy = 4.7, posz = 5.7, radius = 1.3, pos2x = 4.4, pos2y = 4.7, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 9, posz = 6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 9, posz = 6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 8, posz = 6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 8, posz = 6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 8, posz = -14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 8, posz = -14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 8, posz = -14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 8, posz = -14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 8, posz = -33.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 8, posz = -33.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 8, posz = -33.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 8, posz = -33.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 1, posz = -41, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.3, g = 1, b = 0.2, a = 0.95, - modelfactor = 0.4, specular = 0.25, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 1, posz = -41, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.3, g = 1, b = 0.2, a = 0.95, modelfactor = 0.4, specular = 0.25, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, aalight1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13.6, posy = -3, posz = 22.4, radius = 1.4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13.6, posy = -3, posz = 22.4, radius = 1.4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13.6, posy = -3, posz = 10.8, radius = 1.4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13.6, posy = -3, posz = 10.8, radius = 1.4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13.6, posy = -3, posz = 22.4, radius = 1.4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13.6, posy = -3, posz = 22.4, radius = 1.4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13.6, posy = -3, posz = 10.8, radius = 1.4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13.6, posy = -3, posz = 10.8, radius = 1.4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsjam'] = { + ["armsjam"] = { mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = 7.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = 7.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = -7.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = -7.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred1 = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 5, posz = -20, radius = 10, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 5, posz = -20, radius = 10, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred2 = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 4, posz = 20, radius = 10, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 4, posz = 20, radius = 10, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { --eyes need beam! -- lightType = 'point', @@ -9043,90 +5477,54 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armsubk'] = { + ["armsubk"] = { headlighttorpedo = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4.2, posz = 18, radius = 70, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.58, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4.2, posz = 18, radius = 70, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.58, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 4, posz = 31, radius = 3.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 4, posz = 31, radius = 3.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.5, posy = 4, posz = 31, radius = 3.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.5, posy = 4, posz = 31, radius = 3.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = -11, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = -11, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = -26, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = -26, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.1, posy = 6.8, posz = 19.2, radius = 1.2, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.1, posy = 6.8, posz = 19.2, radius = 1.2, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.1, posy = 6.8, posz = 19.2, radius = 1.2, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.1, posy = 6.8, posz = 19.2, radius = 1.2, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armseadragon'] = { + ["armseadragon"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = 55, radius = 22, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.5, g = 0.4, b = 0.2, a = 0.22, - modelfactor = 0.3, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = 55, radius = 22, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 0.5, g = 0.4, b = 0.2, a = 0.22, modelfactor = 0.3, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nukelight = { - lightType = 'cone', - pieceName = 'firing1', + lightType = "cone", + pieceName = "firing1", alliedOnly = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 250, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - r = 1, g = 1, b = 0.2, a = 0.25, - modelfactor = 0.5, specular = 1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 250, dirx = 0, diry = 0, dirz = 1, theta = 0.07, r = 1, g = 1, b = 0.2, a = 0.25, modelfactor = 0.5, specular = 1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- nukelight2 = { -- lightType = 'cone', @@ -9138,299 +5536,163 @@ local unitLights = { -- modelfactor = 0.5, specular = 1, scattering = 6, lensflare = 0, -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, - - }, - ['armexcalibur'] = { + ["armexcalibur"] = { antenna = { - lightType = 'point', - pieceName = 'antenna', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 8, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "antenna", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 8, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 4, posz = 15, radius = 19, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.7, g = 0.6, b = 0.2, a = 0.155, - modelfactor = 1.4, specular = 0.25, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 4, posz = 15, radius = 19, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 0.7, g = 0.6, b = 0.2, a = 0.155, modelfactor = 1.4, specular = 0.25, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 4, posz = 15, radius = 19, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.7, g = 0.6, b = 0.2, a = 0.155, - modelfactor = 1.4, specular = 0.25, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 4, posz = 15, radius = 19, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 0.7, g = 0.6, b = 0.2, a = 0.155, modelfactor = 1.4, specular = 0.25, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'condar', - lightConfig = { posx = 0, posy = 1, posz = 2, radius = 20, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.105, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "condar", + lightConfig = { posx = 0, posy = 1, posz = 2, radius = 20, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.105, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, engine = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = -33, radius = 20, - color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.45, b = 0.1, a = 0.115, - modelfactor = 0.3, specular = 0, scattering = 2.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = -33, radius = 20, color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 0, r = 0.6, g = 0.45, b = 0.1, a = 0.115, modelfactor = 0.3, specular = 0, scattering = 2.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armbats'] = { + ["armbats"] = { top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 42, posz = -22, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 42, posz = -22, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aftlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = -65, radius = 2.9, - dirx = 0, diry = 1, dirz = 1, theta = -2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = -65, radius = 2.9, dirx = 0, diry = 1, dirz = 1, theta = -2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontgun1 = { - lightType = 'point', - pieceName = 'sleeve2', - lightConfig = { posx = 10.0, posy = 6.2, posz = -0.4, radius = 0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve2", + lightConfig = { posx = 10.0, posy = 6.2, posz = -0.4, radius = 0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontgun2 = { - lightType = 'point', - pieceName = 'sleeve2', - lightConfig = { posx = -10.0, posy = 6.2, posz = -0.4, radius = 0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve2", + lightConfig = { posx = -10.0, posy = 6.2, posz = -0.4, radius = 0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topgun1 = { - lightType = 'point', - pieceName = 'sleeve1', - lightConfig = { posx = 10.0, posy = 5.6, posz = -0.4, radius = 0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve1", + lightConfig = { posx = 10.0, posy = 5.6, posz = -0.4, radius = 0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topgun2 = { - lightType = 'point', - pieceName = 'sleeve1', - lightConfig = { posx = -10.0, posy = 5.6, posz = -0.4, radius = 0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve1", + lightConfig = { posx = -10.0, posy = 5.6, posz = -0.4, radius = 0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 18, posz = -4, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 18, posz = -4, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 18, posz = -4, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 18, posz = -4, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightr = { - lightType = 'beam', - pieceName = 'turret1', - lightConfig = { posx = -21, posy = 7.8, posz = -3.9, radius = 3.5, - pos2x = -21, pos2y = 7.8, pos2z = 2.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret1", + lightConfig = { posx = -21, posy = 7.8, posz = -3.9, radius = 3.5, pos2x = -21, pos2y = 7.8, pos2z = 2.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightl = { - lightType = 'beam', - pieceName = 'turret1', - lightConfig = { posx = 21, posy = 7.8, posz = -3.9, radius = 3.5, - pos2x = 21, pos2y = 7.8, pos2z = 2.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret1", + lightConfig = { posx = 21, posy = 7.8, posz = -3.9, radius = 3.5, pos2x = 21, pos2y = 7.8, pos2z = 2.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armepoch'] = { + ["armepoch"] = { searchlight = { - lightType = 'cone', - pieceName = 'misbox2', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 250, - dirx = 0, diry = 0, dirz = 1, theta = 0.14, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "misbox2", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 250, dirx = 0, diry = 0, dirz = 1, theta = 0.14, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 11, posy = 9.5, posz = 54, radius = 9.4, - pos2x = -11, pos2y = 9.5, pos2z = 54, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 11, posy = 9.5, posz = 54, radius = 9.4, pos2x = -11, pos2y = 9.5, pos2z = 54, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, yellowlightr = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -15.5, posy = 40, posz = -33.5, radius = 10, - pos2x = -21, pos2y = 40, pos2z = -39, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -15.5, posy = 40, posz = -33.5, radius = 10, pos2x = -21, pos2y = 40, pos2z = -39, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, yellowlightl = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 15.5, posy = 40, posz = -33.5, radius = 10, - pos2x = 21, pos2y = 40, pos2z = -39, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 15.5, posy = 40, posz = -33.5, radius = 10, pos2x = 21, pos2y = 40, pos2z = -39, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightl = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 15, posy = 13, posz = -2, radius = 11.4, - pos2x = 15, pos2y = 13, pos2z = -22, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 15, posy = 13, posz = -2, radius = 11.4, pos2x = 15, pos2y = 13, pos2z = -22, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightr = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -15, posy = 13, posz = -2, radius = 11.4, - pos2x = -15, pos2y = 13, pos2z = -22, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -15, posy = 13, posz = -2, radius = 11.4, pos2x = -15, pos2y = 13, pos2z = -22, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sideglowl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 11, posz = -12, radius = 27, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 11, posz = -12, radius = 27, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sideglowr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 11, posz = -12, radius = 27, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 11, posz = -12, radius = 27, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunglowr = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = -24, posy = 8.2, posz = -5, radius = 7.6, - dirx = 0, diry = 0, dirz = 0.25, theta = -8.2, - color2r = -2, color2g = -2, color2b = -2, colortime = 120, - r = -1, g = 1, b = 1.2, a = 1.5, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = -24, posy = 8.2, posz = -5, radius = 7.6, dirx = 0, diry = 0, dirz = 0.25, theta = -8.2, color2r = -2, color2g = -2, color2b = -2, colortime = 120, r = -1, g = 1, b = 1.2, a = 1.5, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, maingunglowl = { - lightType = 'point', - pieceName = 'tur1', - lightConfig = { posx = 24, posy = 8.2, posz = -5, radius = 7.6, - dirx = 0, diry = 0, dirz = 0.25, theta = -8.2, - color2r = -2, color2g = -2, color2b = -2, colortime = 120, - r = -1, g = 1, b = 1.2, a = 1.5, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tur1", + lightConfig = { posx = 24, posy = 8.2, posz = -5, radius = 7.6, dirx = 0, diry = 0, dirz = 0.25, theta = -8.2, color2r = -2, color2g = -2, color2b = -2, colortime = 120, r = -1, g = 1, b = 1.2, a = 1.5, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1A = { - lightType = 'beam', - pieceName = 'misbox1', - lightConfig = { posx = -4.7, posy = 4.6, posz = 6.6, radius = 1.3, - pos2x = -4.7, pos2y = 4.6, pos2z = 4.2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox1", + lightConfig = { posx = -4.7, posy = 4.6, posz = 6.6, radius = 1.3, pos2x = -4.7, pos2y = 4.6, pos2z = 4.2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1B = { - lightType = 'beam', - pieceName = 'misbox1', - lightConfig = { posx = 4.7, posy = 4.6, posz = 6.6, radius = 1.3, - pos2x = 4.7, pos2y = 4.6, pos2z = 4.2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox1", + lightConfig = { posx = 4.7, posy = 4.6, posz = 6.6, radius = 1.3, pos2x = 4.7, pos2y = 4.6, pos2z = 4.2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile2A = { - lightType = 'beam', - pieceName = 'misbox2', - lightConfig = { posx = -4.7, posy = 4.6, posz = 6.6, radius = 1.3, - pos2x = -4.7, pos2y = 4.6, pos2z = 4.2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox2", + lightConfig = { posx = -4.7, posy = 4.6, posz = 6.6, radius = 1.3, pos2x = -4.7, pos2y = 4.6, pos2z = 4.2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile2B = { - lightType = 'beam', - pieceName = 'misbox2', - lightConfig = { posx = 4.7, posy = 4.6, posz = 6.6, radius = 1.3, - pos2x = 4.7, pos2y = 4.6, pos2z = 4.2, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox2", + lightConfig = { posx = 4.7, posy = 4.6, posz = 6.6, radius = 1.3, pos2x = 4.7, pos2y = 4.6, pos2z = 4.2, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.6, - modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.6, modelfactor = 0.8, specular = 0.9, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turret1 = { -- lightType = 'point', @@ -9451,22 +5713,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, backlightwhite1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 41, posz = -75, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.1, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 41, posz = -75, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.1, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backlightwhite2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 41, posz = -75, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.1, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 41, posz = -75, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.1, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- side2 = { -- lightType = 'point', @@ -9514,355 +5768,200 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, frontturretf = { - lightType = 'point', - pieceName = 'sleeve2', - lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve2", + lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontturretb = { - lightType = 'point', - pieceName = 'sleeve2', - lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve2", + lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret1f = { - lightType = 'point', - pieceName = 'sleeve4', - lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve4", + lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret1b = { - lightType = 'point', - pieceName = 'sleeve4', - lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve4", + lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret2f = { - lightType = 'point', - pieceName = 'sleeve5', - lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve5", + lightConfig = { posx = 0, posy = 8, posz = 1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret2b = { - lightType = 'point', - pieceName = 'sleeve5', - lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve5", + lightConfig = { posx = 0, posy = 8, posz = -1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 28.7, posy = 8, posz = 13.3, radius = 1.5, - color2r = -8, color2g = -8, color2b = -8, colortime = 40, - r = -1, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 28.7, posy = 8, posz = 13.3, radius = 1.5, color2r = -8, color2g = -8, color2b = -8, colortime = 40, r = -1, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -28.7, posy = 8, posz = 13.3, radius = 1.5, - color2r = -8, color2g = -8, color2b = -8, colortime = 40, - r = -1, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -28.7, posy = 8, posz = 13.3, radius = 1.5, color2r = -8, color2g = -8, color2b = -8, colortime = 40, r = -1, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfepocht4'] = { + ["armfepocht4"] = { turret1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 41, posz = -36, radius = 40, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 41, posz = -36, radius = 40, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 41, posz = -36, radius = 40, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 41, posz = -36, radius = 40, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 41, posz = -75, radius = 35, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 41, posz = -75, radius = 35, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 41, posz = -75, radius = 35, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 41, posz = -75, radius = 35, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 15, posz = -5, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 15, posz = -5, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 15, posz = -19, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 15, posz = -19, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 15, posz = -5, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 15, posz = -5, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 15, posz = -19, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 15, posz = -19, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 10.5, posz = 54, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 10.5, posz = 54, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7, posy = 10.5, posz = 54, radius = 27, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7, posy = 10.5, posz = 54, radius = 27, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontturret = { - lightType = 'point', - pieceName = 'sleeve2', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.045, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve2", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.045, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret1 = { - lightType = 'point', - pieceName = 'sleeve4', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.045, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve4", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.045, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midturret2 = { - lightType = 'point', - pieceName = 'sleeve5', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.045, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve5", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 14, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.045, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustl1', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustl1", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustl2', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustl2", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustr1', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustr1", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 115, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustr2', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.7, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustr2", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 125, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.7, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcrus'] = { + ["armcrus"] = { teamtopglow = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9.8, posz = -1.6, radius = 3, - pos2x = 0, pos2y = 9.8, pos2z = 1.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9.8, posz = -1.6, radius = 3, pos2x = 0, pos2y = 9.8, pos2z = 1.2, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -6.7, posy = 3.5, posz = 11.7, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -6.7, posy = 3.5, posz = 11.7, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 6.7, posy = 3.5, posz = 11.7, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 6.7, posy = 3.5, posz = 11.7, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'foregun', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "foregun", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontgun = { - lightType = 'point', - pieceName = 'foregun', - lightConfig = { posx = 0, posy = -0.6, posz = 10.1, radius = 2.2, - color2r = 0.9, color2g = 0, color2b = 0, colortime = 33, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "foregun", + lightConfig = { posx = 0, posy = -0.6, posz = 10.1, radius = 2.2, color2r = 0.9, color2g = 0, color2b = 0, colortime = 33, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'aftgun', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 13, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.05, - modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aftgun", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 13, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.05, modelfactor = 0.4, specular = 0.25, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backgun = { - lightType = 'point', - pieceName = 'aftgun', - lightConfig = { posx = 0, posy = -0.6, posz = 9.9, radius = 2.2, - color2r = 0.9, color2g = 0, color2b = 0, colortime = 33, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aftgun", + lightConfig = { posx = 0, posy = -0.6, posz = 9.9, radius = 2.2, color2r = 0.9, color2g = 0, color2b = 0, colortime = 33, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 5.2, posz = -49.2, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 5.2, posz = -49.2, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 5.2, posz = -49.2, radius = 1.3, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 5.2, posz = -49.2, radius = 1.3, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightdepthcharge = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -6, posy = 5.2, posz = -7, radius = 200, - color2r = 0.35, color2g = 0.37, color2b = 0.45, colortime = 120, - dirx = 0, diry = -0.7, dirz = 0.6, theta = 0.55, - r = 0.69, g = 0.75, b = 0.9, a = 0.1, - modelfactor = 0.5, specular = 0.3, scattering = 14.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -6, posy = 5.2, posz = -7, radius = 200, color2r = 0.35, color2g = 0.37, color2b = 0.45, colortime = 120, dirx = 0, diry = -0.7, dirz = 0.6, theta = 0.55, r = 0.69, g = 0.75, b = 0.9, a = 0.1, modelfactor = 0.5, specular = 0.3, scattering = 14.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armserp'] = { + ["armserp"] = { headlighttorpedo1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -2, posy = 14.2, posz = 22, radius = 70, colortime = -2, - dirx = -0.2, diry = -0.3, dirz = 1, theta = 0.24, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -2, posy = 14.2, posz = 22, radius = 70, colortime = -2, dirx = -0.2, diry = -0.3, dirz = 1, theta = 0.24, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlighttorpedo2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 2, posy = 14.2, posz = 22, radius = 70, colortime = -2, - dirx = 0.2, diry = -0.3, dirz = 1, theta = 0.24, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 2, posy = 14.2, posz = 22, radius = 70, colortime = -2, dirx = 0.2, diry = -0.3, dirz = 1, theta = 0.24, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 5, posy = 20.5, posz = 20.5, radius = 3.8, - pos2x = -5, pos2y = 20.5, pos2z = 20.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 5, posy = 20.5, posz = 20.5, radius = 3.8, pos2x = -5, pos2y = 20.5, pos2z = 20.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -9874,16 +5973,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armaas'] = { + ["armaas"] = { eyes = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 12.5, posz = 33, radius = 1.6, - pos2x = 4.5, pos2y = 12.5, pos2z = 33, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 12.5, posz = 33, radius = 1.6, pos2x = 4.5, pos2y = 12.5, pos2z = 33, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -9895,100 +5989,54 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, fronteye1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.5, posy = 4.5, posz = 36, radius = 1.5, - dirx = 0, diry = 1, dirz = 0, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.5, posy = 4.5, posz = 36, radius = 1.5, dirx = 0, diry = 1, dirz = 0, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronteye2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.5, posy = 4.5, posz = 36, radius = 1.5, - dirx = 0, diry = 1, dirz = 0, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.5, posy = 4.5, posz = 36, radius = 1.5, dirx = 0, diry = 1, dirz = 0, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { - lightType = 'cone', - pieceName = 'turretgun2', - lightConfig = { posx = -3.9, posy = 3, posz = 8, radius = 350, colortime = -1.5, - dirx = -0.06, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turretgun2", + lightConfig = { posx = -3.9, posy = 3, posz = 8, radius = 350, colortime = -1.5, dirx = -0.06, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { - lightType = 'cone', - pieceName = 'turretgun2', - lightConfig = { posx = 3.9, posy = 3, posz = 8, radius = 350, colortime = -1.5, - dirx = 0.06, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turretgun2", + lightConfig = { posx = 3.9, posy = 3, posz = 8, radius = 350, colortime = -1.5, dirx = 0.06, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight1 = { - lightType = 'point', - pieceName = 'turretgun2', - lightConfig = { posx = -3.9, posy = 3, posz = 13, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretgun2", + lightConfig = { posx = -3.9, posy = 3, posz = 13, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight2 = { - lightType = 'point', - pieceName = 'turretgun2', - lightConfig = { posx = 3.9, posy = 3, posz = 13, radius = 8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretgun2", + lightConfig = { posx = 3.9, posy = 3, posz = 13, radius = 8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1A = { - lightType = 'beam', - pieceName = 'missilebox1', - lightConfig = { posx = -3.9, posy = 4, posz = 5.7, radius = 1.2, - pos2x = -3.9, pos2y = 4, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "missilebox1", + lightConfig = { posx = -3.9, posy = 4, posz = 5.7, radius = 1.2, pos2x = -3.9, pos2y = 4, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile1B = { - lightType = 'beam', - pieceName = 'missilebox1', - lightConfig = { posx = 3.9, posy = 4, posz = 5.7, radius = 1.2, - pos2x = 3.9, pos2y = 4, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "missilebox1", + lightConfig = { posx = 3.9, posy = 4, posz = 5.7, radius = 1.2, pos2x = 3.9, pos2y = 4, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile2A = { - lightType = 'beam', - pieceName = 'missilebox2', - lightConfig = { posx = -3.9, posy = 4, posz = 5.7, radius = 1.2, - pos2x = -3.9, pos2y = 4, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "missilebox2", + lightConfig = { posx = -3.9, posy = 4, posz = 5.7, radius = 1.2, pos2x = -3.9, pos2y = 4, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalightsmissile2B = { - lightType = 'beam', - pieceName = 'missilebox2', - lightConfig = { posx = 3.9, posy = 4, posz = 5.7, radius = 1.2, - pos2x = 3.9, pos2y = 4, pos2z = 3.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "missilebox2", + lightConfig = { posx = 3.9, posy = 4, posz = 5.7, radius = 1.2, pos2x = 3.9, pos2y = 4, pos2z = 3.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front1 = { -- lightType = 'point', @@ -10009,63 +6057,36 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmls'] = { + ["armmls"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanoemit', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanoemit", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 4, posy = 10.5, posz = -6.1, radius = 2.8, - pos2x = -4, pos2y = 10.5, pos2z = -6.1, - color2r = -4, color2g = -4, color2b = -4, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 4, posy = 10.5, posz = -6.1, radius = 2.8, pos2x = -4, pos2y = 10.5, pos2z = -6.1, color2r = -4, color2g = -4, color2b = -4, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightl = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -6.4, posy = 10.5, posz = -9.6, radius = 2.4, - pos2x = -5.3, pos2y = 10.5, pos2z = -6.3, - color2r = -4, color2g = -4, color2b = -4, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -6.4, posy = 10.5, posz = -9.6, radius = 2.4, pos2x = -5.3, pos2y = 10.5, pos2z = -6.3, color2r = -4, color2g = -4, color2b = -4, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightr = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 6.4, posy = 10.5, posz = -9.6, radius = 2.4, - pos2x = 5.3, pos2y = 10.5, pos2z = -6.3, - color2r = -4, color2g = -4, color2b = -4, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 6.4, posy = 10.5, posz = -9.6, radius = 2.4, pos2x = 5.3, pos2y = 10.5, pos2z = -6.3, color2r = -4, color2g = -4, color2b = -4, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbuildflashl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9.8, posy = 2.5, posz = 6.6, radius = 4, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9.8, posy = 2.5, posz = 6.6, radius = 4, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbuildflashr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9.8, posy = 2.5, posz = 6.6, radius = 4, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9.8, posy = 2.5, posz = 6.6, radius = 4, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -10086,427 +6107,242 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armrecl'] = { + ["armrecl"] = { nanolight1 = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = 19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = 19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.5, posy = 8.5, posz = 24.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.5, posy = 8.5, posz = 24.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.5, posy = 8.5, posz = 24.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.5, posy = 8.5, posz = 24.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.5, posz = -5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 0.9, b = 0.1, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.5, posz = -5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 0.9, b = 0.1, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corplat'] = { + ["corplat"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 37, posy = 19, posz = -7.5, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 37, posy = 19, posz = -7.5, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 37, posy = 19, posz = 7.5, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 37, posy = 19, posz = 7.5, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -37, posy = 19, posz = -7.5, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -37, posy = 19, posz = -7.5, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -37, posy = 19, posz = 7.5, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -37, posy = 19, posz = 7.5, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coravp'] = { + ["coravp"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlightB = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 21, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'nano5', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano5", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight6 = { - lightType = 'point', - pieceName = 'nano6', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano6", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight7 = { - lightType = 'point', - pieceName = 'nano7', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano7", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight8 = { - lightType = 'point', - pieceName = 'nano8', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano8", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -39, posy = 7, posz = -53, radius = 11, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -39, posy = 7, posz = -53, radius = 11, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 39, posy = 7, posz = -53, radius = 11, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 39, posy = 7, posz = -53, radius = 11, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 7, posz = -62, radius = 11, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 7, posz = -62, radius = 11, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27, posy = 7, posz = -62, radius = 11, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27, posy = 7, posz = -62, radius = 11, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armdecade'] = { + ["armdecade"] = { frontlight = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2.3, posy = 8.8, posz = 18.5, radius = 2.4, - pos2x = -2.3, pos2y = 8.8, pos2z = 18.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2.3, posy = 8.8, posz = 18.5, radius = 2.4, pos2x = -2.3, pos2y = 8.8, pos2z = 18.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 18.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 18.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -3.6, posz = -30, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.3, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -3.6, posz = -30, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.3, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3, posz = 20, radius = 65, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 3, posz = 20, radius = 65, dirx = 0, diry = -0.08, dirz = 1, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headfrontleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2, posy = 4.5, posz = 30.2, radius = 3, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2, posy = 4.5, posz = 30.2, radius = 3, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow1A = { - lightType = 'point', - pieceName = 'abarrela', - lightConfig = { posx = 0, posy = 0.2, posz = 8.9, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.9, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "abarrela", + lightConfig = { posx = 0, posy = 0.2, posz = 8.9, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.9, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow1B = { - lightType = 'point', - pieceName = 'abarrelb', - lightConfig = { posx = 0, posy = 0.2, posz = 9.9, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.9, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "abarrelb", + lightConfig = { posx = 0, posy = 0.2, posz = 9.9, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.9, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2A = { - lightType = 'point', - pieceName = 'bbarrela', - lightConfig = { posx = 0, posy = 0.2, posz = 8.9, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.9, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bbarrela", + lightConfig = { posx = 0, posy = 0.2, posz = 8.9, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.9, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2B = { - lightType = 'point', - pieceName = 'bbarrelb', - lightConfig = { posx = 0, posy = 0.2, posz = 9.9, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.9, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bbarrelb", + lightConfig = { posx = 0, posy = 0.2, posz = 9.9, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.9, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headfrontright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2, posy = 4.5, posz = 30.2, radius = 3, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2, posy = 4.5, posz = 30.2, radius = 3, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10, posy = 7, posz = 7, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10, posy = 7, posz = 7, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top2 = { -- lightType = 'point', @@ -10518,29 +6354,18 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, sidelightl = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 11, posy = 7.0, posz = 8, radius = 5, - pos2x = 11, pos2y = 7.0, pos2z = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 11, posy = 7.0, posz = 8, radius = 5, pos2x = 11, pos2y = 7.0, pos2z = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightr = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -11, posy = 7.0, posz = 8, radius = 5, - pos2x = -11, pos2y = 7.0, pos2z = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -11, posy = 7.0, posz = 8, radius = 5, pos2x = -11, pos2y = 7.0, pos2z = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['coresupp'] = { + ["coresupp"] = { -- front = { -- lightType = 'point', -- pieceName = 'base', @@ -10551,60 +6376,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, backr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.1, posy = 1.8, posz = -19, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.1, posy = 1.8, posz = -19, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.1, posy = 1.8, posz = -19, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.1, posy = 1.8, posz = -19, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontturretlight = { - lightType = 'beam', - pieceName = 'fturret', - lightConfig = { posx = 0.7, posy = 1.5, posz = 0.9, radius = 0.8, - pos2x = -0.7, pos2y = 1.5, pos2z = 0.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "fturret", + lightConfig = { posx = 0.7, posy = 1.5, posz = 0.9, radius = 0.8, pos2x = -0.7, pos2y = 1.5, pos2z = 0.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backturretlight = { - lightType = 'beam', - pieceName = 'bturret', - lightConfig = { posx = 0.7, posy = 1.5, posz = 0.9, radius = 0.8, - pos2x = -0.7, pos2y = 1.5, pos2z = 0.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "bturret", + lightConfig = { posx = 0.7, posy = 1.5, posz = 0.9, radius = 0.8, pos2x = -0.7, pos2y = 1.5, pos2z = 0.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightf = { - lightType = 'cone', - pieceName = 'fturret', - lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 70, - dirx = 0, diry = -0.05, dirz = 1, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "fturret", + lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 70, dirx = 0, diry = -0.05, dirz = 1, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightb = { - lightType = 'cone', - pieceName = 'bturret', - lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 70, - dirx = 0, diry = -0.05, dirz = 1, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "bturret", + lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 70, dirx = 0, diry = -0.05, dirz = 1, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headfrontleft = { -- lightType = 'point', @@ -10616,40 +6415,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, gunglow1A = { - lightType = 'point', - pieceName = 'frbarrel', - lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frbarrel", + lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, color2r = -2, color2g = -2, color2b = -2, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow1B = { - lightType = 'point', - pieceName = 'flbarrel', - lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flbarrel", + lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, color2r = -2, color2g = -2, color2b = -2, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2A = { - lightType = 'point', - pieceName = 'blbarrel', - lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blbarrel", + lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, color2r = -2, color2g = -2, color2b = -2, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2B = { - lightType = 'point', - pieceName = 'brbarrel', - lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "brbarrel", + lightConfig = { posx = 0, posy = 0.1, posz = 3.2, radius = 2.5, color2r = -2, color2g = -2, color2b = -2, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headfrontright = { -- lightType = 'point', @@ -10698,75 +6481,42 @@ local unitLights = { -- modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, - }, - ['armlship'] = { + ["armlship"] = { back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = -29, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = -29, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightl = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 3, posy = 10.0, posz = 0, radius = 5, - pos2x = 3, pos2y = 10.0, pos2z = -5.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 3, posy = 10.0, posz = 0, radius = 5, pos2x = 3, pos2y = 10.0, pos2z = -5.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelight3r = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -3, posy = 9.0, posz = 0., radius = 5, - pos2x = -3, pos2y = 9.0, pos2z = -5.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -3, posy = 9.0, posz = 0., radius = 5, pos2x = -3, pos2y = 9.0, pos2z = -5.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponglow = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 0, posz = 33, radius = 9, - color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.6, - modelfactor = 0.1, specular = 0.75, scattering = 1.2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 0, posz = 33, radius = 9, color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.6, modelfactor = 0.1, specular = 0.75, scattering = 1.2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponspark = { - lightType = 'point', - pieceName = 'spark_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 55, - color2r = 0, color2g = 0, color2b = 0, colortime = 2, - r = 1, g = 1, b = 1, a = 0.85, - modelfactor = 0.3, specular = 0.75, scattering = 0.3, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "spark_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 55, color2r = 0, color2g = 0, color2b = 0, colortime = 2, r = 1, g = 1, b = 1, a = 0.85, modelfactor = 0.3, specular = 0.75, scattering = 0.3, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponflash = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 3.2, posz = 23, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -4.6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1.2, a = 1.2, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 3.2, posz = 23, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -4.6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1.2, a = 1.2, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponflash2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 4.2, posz = 23, radius = 4.6, - dirx = 0, diry = 0, dirz = 0.25, theta = -4.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 1, b = 1.2, a = 1.5, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 4.2, posz = 23, radius = 4.6, dirx = 0, diry = 0, dirz = 0.25, theta = -4.2, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 1, b = 1.2, a = 1.5, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turret = { -- lightType = 'point', @@ -10778,99 +6528,56 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turretfront1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 5.7, posy = 0, posz = 16.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 5.7, posy = 0, posz = 16.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretfront2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -5.7, posy = 0, posz = 16.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -5.7, posy = 0, posz = 16.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights1 = { - lightType = 'beam', - pieceName = 'misbox', - lightConfig = { posx = -3, posy = 3, posz = 4.3, radius = 0.9, - pos2x = -3, pos2y = 3, pos2z = 2.7, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox", + lightConfig = { posx = -3, posy = 3, posz = 4.3, radius = 0.9, pos2x = -3, pos2y = 3, pos2z = 2.7, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights2 = { - lightType = 'beam', - pieceName = 'misbox', - lightConfig = { posx = 3, posy = 3, posz = 4.3, radius = 0.9, - pos2x = 3, pos2y = 3, pos2z = 2.7, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "misbox", + lightConfig = { posx = 3, posy = 3, posz = 4.3, radius = 0.9, pos2x = 3, pos2y = 3, pos2z = 2.7, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['correcl'] = { + ["correcl"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.5, posz = 23.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.5, posz = 23.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontwhiteleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.8, posy = 4.5, posz = 22, radius = 6, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.8, posy = 4.5, posz = 22, radius = 6, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontwhiteright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.8, posy = 4.5, posz = 22, radius = 6, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.8, posy = 4.5, posz = 22, radius = 6, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4, posy = 16.3, posz = 19.8, radius = 1.8, - pos2x = 4, pos2y = 16.3, pos2z = 19.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4, posy = 16.3, posz = 19.8, radius = 1.8, pos2x = 4, pos2y = 16.3, pos2z = 19.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eye1 = { -- lightType = 'point', @@ -10900,75 +6607,40 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, topbuildlightmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0.2, posy = 19.8, posz = 13.3, radius = 1.8, - pos2x = 0.2, pos2y = 19.8, pos2z = 10.8, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0.2, posy = 19.8, posz = 13.3, radius = 1.8, pos2x = 0.2, pos2y = 19.8, pos2z = 10.8, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topbuildlightleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.3, posy = 19.8, posz = 13.3, radius = 1.8, - pos2x = 3.3, pos2y = 19.8, pos2z = 10.8, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.3, posy = 19.8, posz = 13.3, radius = 1.8, pos2x = 3.3, pos2y = 19.8, pos2z = 10.8, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topbuildlightright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.0, posy = 19.8, posz = 13.3, radius = 1.8, - pos2x = -3.0, pos2y = 19.8, pos2z = 10.8, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.0, posy = 19.8, posz = 13.3, radius = 1.8, pos2x = -3.0, pos2y = 19.8, pos2z = 10.8, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topred1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -10, posy = 19.3, posz = 13.7, radius = 1.8, - pos2x = -10, pos2y = 19.3, pos2z = 10.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -10, posy = 19.3, posz = 13.7, radius = 1.8, pos2x = -10, pos2y = 19.3, pos2z = 10.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topred2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 10, posy = 19.3, posz = 13.7, radius = 1.8, - pos2x = 10, pos2y = 19.3, pos2z = 10.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 10, posy = 19.3, posz = 13.7, radius = 1.8, pos2x = 10, pos2y = 19.3, pos2z = 10.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topred3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -10, posy = 19.3, posz = -13.5, radius = 1.8, - pos2x = -10, pos2y = 19.3, pos2z = -10.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -10, posy = 19.3, posz = -13.5, radius = 1.8, pos2x = -10, pos2y = 19.3, pos2z = -10.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topred4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 10, posy = 19.3, posz = -13.5, radius = 1.8, - pos2x = 10, pos2y = 19.3, pos2z = -10.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 10, posy = 19.3, posz = -13.5, radius = 1.8, pos2x = 10, pos2y = 19.3, pos2z = -10.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -11025,44 +6697,28 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corsd'] = { + ["corsd"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 17, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 17, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corscreamer'] = { + ["corscreamer"] = { eyes1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -20, posy = 34, posz = 11, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -20, posy = 34, posz = 11, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 34, posz = 11, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 34, posz = 11, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'barrel', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 10, posz = 8, radius = 475, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "barrel", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 10, posz = 8, radius = 475, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turretaa1 = { -- lightType = 'point', @@ -11074,44 +6730,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turretaa2a = { - lightType = 'beam', - pieceName = 'barrel', - lightConfig = { posx = 8.8, posy = 15.0, posz = 11.6, radius = 2.2, - pos2x = 8.8, pos2y = 15, pos2z = 13.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "barrel", + lightConfig = { posx = 8.8, posy = 15.0, posz = 11.6, radius = 2.2, pos2x = 8.8, pos2y = 15, pos2z = 13.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2b = { - lightType = 'beam', - pieceName = 'barrel', - lightConfig = { posx = -8.8, posy = 15.0, posz = 11.6, radius = 2.2, - pos2x = -8.8, pos2y = 15, pos2z = 13.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "barrel", + lightConfig = { posx = -8.8, posy = 15.0, posz = 11.6, radius = 2.2, pos2x = -8.8, pos2y = 15, pos2z = 13.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa3a = { - lightType = 'beam', - pieceName = 'barrel', - lightConfig = { posx = 8.8, posy = 15.0, posz = -11.6, radius = 2.2, - pos2x = 8.8, pos2y = 15, pos2z = -13.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "barrel", + lightConfig = { posx = 8.8, posy = 15.0, posz = -11.6, radius = 2.2, pos2x = 8.8, pos2y = 15, pos2z = -13.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa3b = { - lightType = 'beam', - pieceName = 'barrel', - lightConfig = { posx = -8.8, posy = 15.0, posz = -11.6, radius = 2.2, - pos2x = -8.8, pos2y = 15, pos2z = -13.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "barrel", + lightConfig = { posx = -8.8, posy = 15.0, posz = -11.6, radius = 2.2, pos2x = -8.8, pos2y = 15, pos2z = -13.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turretaa3 = { -- lightType = 'point', @@ -11123,35 +6759,21 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corsub'] = { + ["corsub"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.2, posy = 6.5, posz = 22.5, radius = 3, - pos2x = 1.2, pos2y = 6.5, pos2z = 22.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.2, posy = 6.5, posz = 22.5, radius = 3, pos2x = 1.2, pos2y = 6.5, pos2z = 22.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfrontup = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.2, posy = 11, posz = -0.9, radius = 3, - pos2x = 1.2, pos2y = 11, pos2z = -0.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.2, posy = 11, posz = -0.9, radius = 3, pos2x = 1.2, pos2y = 11, pos2z = -0.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlighttorpedo = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 9.2, posz = 12, radius = 60, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.18, - r = 0.69, g = 0.75, b = 0.9, a = 0.20, - modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 9.2, posz = 12, radius = 60, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.18, r = 0.69, g = 0.75, b = 0.9, a = 0.20, modelfactor = -0.5, specular = -0.3, scattering = 10, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -11172,55 +6794,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corpship'] = { + ["corpship"] = { eyes1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 12, posz = 5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.25, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 12, posz = 5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.25, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeshighfront = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -1.8, posy = 11.3, posz = 2.2, radius = 2, - pos2x = 1.8, pos2y = 11.3, pos2z = 2.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -1.8, posy = 11.3, posz = 2.2, radius = 2, pos2x = 1.8, pos2y = 11.3, pos2z = 2.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 34.5, posz = -29.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 34.5, posz = -29.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.5, posy = 30, posz = -29.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.5, posy = 30, posz = -29.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2.5, posy = 32, posz = -29.5, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2.5, posy = 32, posz = -29.5, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsjam'] = { + ["corsjam"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'base', @@ -11231,63 +6832,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.2, posy = 19.9, posz = -7.9, radius = 2.5, - pos2x = 1.2, pos2y = 19.9, pos2z = -7.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.2, posy = 19.9, posz = -7.9, radius = 2.5, pos2x = 1.2, pos2y = 19.9, pos2z = -7.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred = { - lightType = 'point', - pieceName = 'jam', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jam", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redjambarr = { - lightType = 'beam', - pieceName = 'jam', - lightConfig = { posx = -9.7, posy = 3.8, posz = -25.7, radius = 0.9, - pos2x = -8.5, pos2y = 5.1, pos2z = -25.7, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "jam", + lightConfig = { posx = -9.7, posy = 3.8, posz = -25.7, radius = 0.9, pos2x = -8.5, pos2y = 5.1, pos2z = -25.7, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redjambarr2 = { - lightType = 'beam', - pieceName = 'jam', - lightConfig = { posx = -9.7, posy = 3.8, posz = -27.5, radius = 0.9, - pos2x = -8.5, pos2y = 5.1, pos2z = -27.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "jam", + lightConfig = { posx = -9.7, posy = 3.8, posz = -27.5, radius = 0.9, pos2x = -8.5, pos2y = 5.1, pos2z = -27.5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redjambarl = { - lightType = 'beam', - pieceName = 'jam', - lightConfig = { posx = 9.7, posy = 3.8, posz = -25.7, radius = 0.9, - pos2x = 8.5, pos2y = 5.1, pos2z = -25.7, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "jam", + lightConfig = { posx = 9.7, posy = 3.8, posz = -25.7, radius = 0.9, pos2x = 8.5, pos2y = 5.1, pos2z = -25.7, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redjambarl2 = { - lightType = 'beam', - pieceName = 'jam', - lightConfig = { posx = 9.7, posy = 3.8, posz = -27.5, radius = 0.9, - pos2x = 8.5, pos2y = 5.1, pos2z = -27.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "jam", + lightConfig = { posx = 9.7, posy = 3.8, posz = -27.5, radius = 0.9, pos2x = 8.5, pos2y = 5.1, pos2z = -27.5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- redmid = { -- lightType = 'point', @@ -11299,83 +6871,46 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corroy'] = { + ["corroy"] = { eyeshighfront = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -2.8, posy = 7.1, posz = 4.2, radius = 2, - pos2x = 2.8, pos2y = 7.1, pos2z = 4.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -2.8, posy = 7.1, posz = 4.2, radius = 2, pos2x = 2.8, pos2y = 7.1, pos2z = 4.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeshighglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 21.5, posz = -30, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 21.5, posz = -30, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topgun1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7.2, posy = 0, posz = 10.6, radius = 0.9, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7.2, posy = 0, posz = 10.6, radius = 0.9, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topgun2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7.2, posy = 0, posz = 10.6, radius = 0.9, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7.2, posy = 0, posz = 10.6, radius = 0.9, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeslowleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.8, posy = 5.8, posz = -20, radius = 1.6, - pos2x = 3.8, pos2y = 5.8, pos2z = -15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.8, posy = 5.8, posz = -20, radius = 1.6, pos2x = 3.8, pos2y = 5.8, pos2z = -15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeslowright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.8, posy = 5.8, posz = -20, radius = 1.6, - pos2x = -3.8, pos2y = 5.8, pos2z = -15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.8, posy = 5.8, posz = -20, radius = 1.6, pos2x = -3.8, pos2y = 5.8, pos2z = -15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeslowfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.0, posy = 5.8, posz = -14, radius = 1.6, - pos2x = 1.0, pos2y = 5.8, pos2z = -14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.0, posy = 5.8, posz = -14, radius = 1.6, pos2x = 1.0, pos2y = 5.8, pos2z = -14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -0.7, posy = 8.8, posz = 22.5, radius = 1.0, - pos2x = 0.7, pos2y = 8.8, pos2z = 22.5, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -0.7, posy = 8.8, posz = 22.5, radius = 1.0, pos2x = 0.7, pos2y = 8.8, pos2z = 22.5, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -11423,54 +6958,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armpt'] = { + ["armpt"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.8, posy = 4.5, posz = 4.2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.8, posy = 4.5, posz = 4.2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.8, posy = 4.5, posz = 4.2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.8, posy = 4.5, posz = 4.2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.0, posy = 2.8, posz = -3.9, radius = 1.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.0, posy = 2.8, posz = -3.9, radius = 1.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.0, posy = 2.8, posz = -3.9, radius = 1.5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.0, posy = 2.8, posz = -3.9, radius = 1.5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob1 = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armpship'] = { + ["armpship"] = { -- front1 = { -- lightType = 'point', -- pieceName = 'base', @@ -11508,329 +7023,183 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, sidelightr = { - lightType = 'beam', - pieceName = 'turret1', - lightConfig = { posx = -9, posy = 3.7, posz = -4.4, radius = 2.5, - pos2x = -9, pos2y = 3.7, pos2z = 0.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret1", + lightConfig = { posx = -9, posy = 3.7, posz = -4.4, radius = 2.5, pos2x = -9, pos2y = 3.7, pos2z = 0.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightl = { - lightType = 'beam', - pieceName = 'turret1', - lightConfig = { posx = 9, posy = 3.7, posz = -4.4, radius = 2.5, - pos2x = 9, pos2y = 3.7, pos2z = 0.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 3, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret1", + lightConfig = { posx = 9, posy = 3.7, posz = -4.4, radius = 2.5, pos2x = 9, pos2y = 3.7, pos2z = 0.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 3, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob1 = { - lightType = 'point', - pieceName = 'radar', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radar", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsy'] = { + ["armsy"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.45, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -25, posy = 16.5, posz = 21.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -25, posy = 16.5, posz = 21.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 25, posy = 16.5, posz = 21.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 25, posy = 16.5, posz = 21.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -25, posy = 16.5, posz = -21.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -25, posy = 16.5, posz = -21.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 25, posy = 16.5, posz = -21.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 25, posy = 16.5, posz = -21.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanotop1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanotop2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanotop3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanotop4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armavp'] = { + ["armavp"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlightB = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontvent1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -46, posy = 34, posz = 37, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -46, posy = 34, posz = 37, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -45, posy = 37, posz = 11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -45, posy = 37, posz = 11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontvent3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 46, posy = 34, posz = 37, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 46, posy = 34, posz = 37, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 46, posy = 37, posz = 11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 46, posy = 37, posz = 11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbarcenter = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -9, posy = 34, posz = 3, radius = 14.5, - pos2x = 9, pos2y = 34, pos2z = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -9, posy = 34, posz = 3, radius = 14.5, pos2x = 9, pos2y = 34, pos2z = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbarleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -17, posy = 34, posz = 1, radius = 14.5, - pos2x = -22, pos2y = 34, pos2z = -3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -17, posy = 34, posz = 1, radius = 14.5, pos2x = -22, pos2y = 34, pos2z = -3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbarright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 17, posy = 34, posz = 1, radius = 14.5, - pos2x = 22, pos2y = 34, pos2z = -3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 17, posy = 34, posz = 1, radius = 14.5, pos2x = 22, pos2y = 34, pos2z = -3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backbarcenter = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -22, posy = 34, posz = -73, radius = 17.5, - pos2x = 22, pos2y = 34, pos2z = -73, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -22, posy = 34, posz = -73, radius = 17.5, pos2x = 22, pos2y = 34, pos2z = -73, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- backmainglow = { -- lightType = 'point', @@ -11977,437 +7346,362 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armalab'] = { + ["armalab"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 0, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28.5, posz = -3, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28.5, posz = -3, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleftpoint = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 36, posy = 15, posz = -5.8, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 36, posy = 15, posz = -5.8, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 32, posy = 16, posz = -5.8, radius = 3.5, - pos2x = 45, pos2y = 9, pos2z = -5.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 32, + posy = 16, + posz = -5.8, + radius = 3.5, + pos2x = 45, + pos2y = 9, + pos2z = -5.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -32, posy = 16, posz = -5.8, radius = 3.5, - pos2x = -45, pos2y = 9, pos2z = -5.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -32, + posy = 16, + posz = -5.8, + radius = 3.5, + pos2x = -45, + pos2y = 9, + pos2z = -5.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamlefttop = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 11.5, posy = 63, posz = -53.7, radius = 3.5, - pos2x = 14, pos2y = 57, pos2z = -53.7, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 11.5, + posy = 63, + posz = -53.7, + radius = 3.5, + pos2x = 14, + pos2y = 57, + pos2z = -53.7, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamrighttop = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -11.5, posy = 63, posz = -53.7, radius = 3.5, - pos2x = -14, pos2y = 57, pos2z = -53.7, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -11.5, + posy = 63, + posz = -53.7, + radius = 3.5, + pos2x = -14, + pos2y = 57, + pos2z = -53.7, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.5, + r = -1, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teambacktop = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 55, posz = -67.5, radius = 8.5, - pos2x = 0, pos2y = 27, pos2z = -68.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armamsub'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 0, + posy = 55, + posz = -67.5, + radius = 8.5, + pos2x = 0, + pos2y = 27, + pos2z = -68.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = -1, + g = 1, + b = 0.2, + a = 0.8, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armamsub"] = { buildlight1 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = -0.2, posy = 5.2, posz = 2.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 4, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = -0.2, posy = 5.2, posz = 2.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 4, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 3.2, posy = 0, posz = 4.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 3.2, posy = 0, posz = 4.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight3 = { -- this is the lightname - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = -0.2, posy = 5.2, posz = -2.7, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = -0.2, posy = 5.2, posz = -2.7, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, main1 = { -- this is the lightname - lightType = 'point', - pieceName = 'main1', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "main1", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, main2 = { -- this is the lightname - lightType = 'point', - pieceName = 'main2', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "main2", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, main3 = { -- this is the lightname - lightType = 'point', - pieceName = 'main3', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "main3", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end1 = { - lightType = 'point', - pieceName = 'end1', - lightConfig = { posx = -3.9, posy = 1, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end1", + lightConfig = { posx = -3.9, posy = 1, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end2 = { - lightType = 'point', - pieceName = 'end2', - lightConfig = { posx = 0, posy = 4.2, posz = 0.6, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end2", + lightConfig = { posx = 0, posy = 4.2, posz = 0.6, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, end3 = { - lightType = 'point', - pieceName = 'end3', - lightConfig = { posx = 3.9, posy = 1, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "end3", + lightConfig = { posx = 3.9, posy = 1, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backbarcenter = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -22, posy = 15, posz = -49, radius = 9.0, - pos2x = 22, pos2y = 15, pos2z = -49, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -22, posy = 15, posz = -49, radius = 9.0, pos2x = 22, pos2y = 15, pos2z = -49, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armplat'] = { + ["armplat"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 12, - color2r = 0, color2g = 0.3, color2b = 0, colortime = 50, - r = 0, g = 1, b = 0, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 12, color2r = 0, color2g = 0.3, color2b = 0, colortime = 50, r = 0, g = 1, b = 0, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armaap'] = { + ["armaap"] = { buildlightflare1 = { - lightType = 'point', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0.1, posz = 0, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 0, - r = 1.1, g = 0.8, b = 0.2, a = 2, - modelfactor = -0.4, specular = 0, scattering = 0, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0.1, posz = 0, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 0, r = 1.1, g = 0.8, b = 0.2, a = 2, modelfactor = -0.4, specular = 0, scattering = 0, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlightflare2 = { - lightType = 'point', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0.1, posz = 0, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 0, - r = 1.1, g = 0.8, b = 0.2, a = 2, - modelfactor = -0.4, specular = 0, scattering = 0, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0.1, posz = 0, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 0, r = 1.1, g = 0.8, b = 0.2, a = 2, modelfactor = -0.4, specular = 0, scattering = 0, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlightB = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2B = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenlight = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = -1.5, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = -1.5, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 0, g = 1, b = 0, a = 0.5, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 0, g = 1, b = 0, a = 0.5, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- nanolight3 = { -- lightType = 'point', @@ -12428,13 +7722,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --dishlight = { -- lightType = 'point', @@ -12446,13 +7736,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.2, specular = 0.5, scattering = 2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- towermid1 = { -- lightType = 'point', @@ -12482,136 +7768,124 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, towerwhiteback1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 48, posz = -68, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 48, posz = -68, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, towerwhiteback2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 48, posz = -68, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 48, posz = -68, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, towerwhite2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 53, posz = -18, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 53, posz = -18, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, plateau1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 40, posz = -25, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 40, posz = -25, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, plateau2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20, posy = 40, posz = 40, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20, posy = 40, posz = 40, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, plateau3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 40, posz = -25, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.3, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 40, posz = -25, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.3, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, plateau4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 40, posz = 40, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.3, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 40, posz = 40, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.3, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 52, posy = 29, posz = 6.5, radius = 5.5, - pos2x = 62, pos2y = 25.1, pos2z = 6.6, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 52, + posy = 29, + posz = 6.5, + radius = 5.5, + pos2x = 62, + pos2y = 25.1, + pos2z = 6.6, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = -1, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -52, posy = 29, posz = 7.0, radius = 5.5, - pos2x = -62, pos2y = 25.1, pos2z = 7.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['corlab'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -52, + posy = 29, + posz = 7.0, + radius = 5.5, + pos2x = -62, + pos2y = 25.1, + pos2z = 7.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = -1, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["corlab"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = -1, posz = 1, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = -1, posz = 1, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = -1, posz = 1, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = -1, posz = 1, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- teamlightbuildbay = { -- lightType = 'point', @@ -12623,22 +7897,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -36, posy = 29, posz = -6, radius = 17, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.5, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -36, posy = 29, posz = -6, radius = 17, color2r = 0, color2g = 0, color2b = -1, colortime = -1.5, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -36, posy = 29, posz = -26, radius = 17, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.5, - r = 1.2, g = 1, b = 0.3, a = 0.66, - modelfactor = 0.3, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -36, posy = 29, posz = -26, radius = 17, color2r = 0, color2g = 0, color2b = -1, colortime = -1.5, r = 1.2, g = 1, b = 0.3, a = 0.66, modelfactor = 0.3, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- build orbit light that moves on the Z axis, and changes color @@ -12653,372 +7919,212 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['leglab'] = { + ["leglab"] = { nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight1_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight1_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, forge = { - lightType = 'point', - pieceName = 'forge', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 0.5, b = 0.1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "forge", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 0.5, b = 0.1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legsy'] = { + ["legsy"] = { nanolight1 = { - lightType = 'point', - pieceName = 'beam1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'beam2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'beam3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'beam4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "beam4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'domelight_emit', - lightConfig = { posx = 1, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "domelight_emit", + lightConfig = { posx = 1, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'domelight_emit', - lightConfig = { posx = -1, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "domelight_emit", + lightConfig = { posx = -1, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legadvshipyard'] = { + ["legadvshipyard"] = { nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'buildlight_emit', - lightConfig = { posx = 1, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "buildlight_emit", + lightConfig = { posx = 1, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'buildlight_emit', - lightConfig = { posx = -1, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "buildlight_emit", + lightConfig = { posx = -1, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashl1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 12, posz = 80, radius = 5.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 12, posz = 80, radius = 5.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashl2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 12, posz = 120, radius = 4.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 12, posz = 120, radius = 4.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashl3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 12, posz = 160, radius = 3.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 12, posz = 160, radius = 3.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashl4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 12, posz = 200, radius = 2.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 12, posz = 200, radius = 2.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashl5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20, posy = 12, posz = 240, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20, posy = 12, posz = 240, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashr1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -40, posy = 12, posz = 80, radius = 5.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -40, posy = 12, posz = 80, radius = 5.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashr2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -40, posy = 12, posz = 120, radius = 4.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -40, posy = 12, posz = 120, radius = 4.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashr3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -40, posy = 12, posz = 160, radius = 3.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -40, posy = 12, posz = 160, radius = 3.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashr4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -40, posy = 12, posz = 200, radius = 2.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -40, posy = 12, posz = 200, radius = 2.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, guideflashr5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -40, posy = 12, posz = 240, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -40, posy = 12, posz = 240, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corvp'] = { + ["corvp"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -46, posy = 10, posz = -25, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -46, posy = 10, posz = -25, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 46, posy = 10, posz = -25, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 46, posy = 10, posz = -25, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -46, posy = 10, posz = -38, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -46, posy = 10, posz = -38, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir4 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 46, posy = 10, posz = -38, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 46, posy = 10, posz = -38, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- resevoir5 = { -- lightType = 'point', @@ -13030,13 +8136,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, resevoir6 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -27.5, posy = 29, posz = 42, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -27.5, posy = 29, posz = 42, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- resevoir7 = { -- lightType = 'point', @@ -13048,551 +8150,315 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, resevoir8 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 27.5, posy = 29, posz = 42, radius = 9, - color2r = 0, color2g = 0, color2b = -1, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 27.5, posy = 29, posz = 42, radius = 9, color2r = 0, color2g = 0, color2b = -1, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corhp'] = { + ["corhp"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -38, posy = 10, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -38, posy = 10, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 38, posy = 10, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 38, posy = 10, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -38, posy = 10, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -38, posy = 10, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir4 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 38, posy = 10, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 38, posy = 10, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfhp'] = { + ["corfhp"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -38, posy = 10, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -38, posy = 10, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 38, posy = 10, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 38, posy = 10, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -38, posy = 10, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -38, posy = 10, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir4 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 38, posy = 10, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 38, posy = 10, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corap'] = { + ["corap"] = { greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 3, posy = 5, posz = 3, radius = 13, - color2r = -2, color2g = -2, color2b = -2, colortime = 50, - r = 0, g = 1, b = 0, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 3, posy = 5, posz = 3, radius = 13, color2r = -2, color2g = -2, color2b = -2, colortime = 50, r = 0, g = 1, b = 0, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 19, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 3.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -50, posy = 15, posz = -18, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -50, posy = 15, posz = -18, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -50, posy = 15, posz = -30, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -50, posy = 15, posz = -30, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 46, posy = 12, posz = -31, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 46, posy = 12, posz = -31, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corapt3'] = { + ["corapt3"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -96, posy = 30, posz = -38, radius = 50, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -96, posy = 30, posz = -38, radius = 50, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -96, posy = 30, posz = -58, radius = 50, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -96, posy = 30, posz = -58, radius = 50, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 90, posy = 20, posz = -62, radius = 42, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 90, posy = 20, posz = -62, radius = 42, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legap'] = { + ["legap"] = { greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 0, g = 1, b = 0, a = 0.5, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 0, g = 1, b = 0, a = 0.5, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight1_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight1_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaap'] = { + ["legaap"] = { greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 0, g = 1, b = 0, a = 0.5, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 0, g = 1, b = 0, a = 0.5, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare5', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare5", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare7', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare7", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight1_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight1_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legalab'] = { + ["legalab"] = { nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'flare5', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare5", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'flare7', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare7", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight1_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight1_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legafus'] = { + ["legafus"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 72, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 72, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionglow2 = { -- lightType = 'point', @@ -13613,24 +8479,16 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['legafust3'] = { + ["legafust3"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 144, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 144, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionglow2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionorb = { -- lightType = 'point', @@ -13642,695 +8500,465 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['legapt3'] = { + ["legapt3"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -96, posy = 30, posz = -38, radius = 50, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -96, posy = 30, posz = -38, radius = 50, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -96, posy = 30, posz = -58, radius = 50, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -96, posy = 30, posz = -58, radius = 50, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, resevoir3 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 90, posy = 20, posz = -62, radius = 42, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 90, posy = 20, posz = -62, radius = 42, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armhp'] = { + ["armhp"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'emitr', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitr", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'emitl', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitl", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner1 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = -38, posy = 4, posz = 35, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = -38, posy = 4, posz = 35, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner2 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = 40, posy = 4, posz = 36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = 40, posy = 4, posz = 36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner3 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = -40, posy = 4, posz = -36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = -40, posy = 4, posz = -36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner4 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = 40, posy = 4, posz = -36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = 40, posy = 4, posz = -36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfhp'] = { + ["armfhp"] = { buildlight = { - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'emitr', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitr", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'emitl', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emitl", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner1 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = -38, posy = 4, posz = 35, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = -38, posy = 4, posz = 35, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner2 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = 40, posy = 4, posz = 36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = 40, posy = 4, posz = 36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner3 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = -40, posy = 4, posz = -36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = -40, posy = 4, posz = -36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner4 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = 40, posy = 4, posz = -36, radius = 15.6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = 40, posy = 4, posz = -36, radius = 15.6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armvp'] = { + ["armvp"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheel1 = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = -3, posy = 0, posz = 13.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = -3, posy = 0, posz = 13.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheel1B = { - lightType = 'point', - pieceName = 'wheel1', - lightConfig = { posx = 3, posy = 0, posz = 13.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel1", + lightConfig = { posx = 3, posy = 0, posz = 13.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheel2 = { - lightType = 'point', - pieceName = 'wheel2', - lightConfig = { posx = 3, posy = 0, posz = 13.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel2", + lightConfig = { posx = 3, posy = 0, posz = 13.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheel2B = { - lightType = 'point', - pieceName = 'wheel2', - lightConfig = { posx = -3, posy = 0, posz = 13.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wheel2", + lightConfig = { posx = -3, posy = 0, posz = 13.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.15, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -39, posy = 11, posz = 1, radius = 9.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -39, posy = 11, posz = 1, radius = 9.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 39, posy = 11, posz = 1, radius = 9.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 39, posy = 11, posz = 1, radius = 9.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armap'] = { + ["armap"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.7, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.7, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.2, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenlight = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = -1.5, posz = 0, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = -1.5, posz = 0, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'blink', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 0, g = 1, b = 0, a = 0.5, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 0, g = 1, b = 0, a = 0.5, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nano3', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano3", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight4 = { - lightType = 'point', - pieceName = 'nano4', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano4", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 51, posy = 33, posz = 0, radius = 5.5, - pos2x = 61, pos2y = 29, pos2z = 0.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armlab'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 51, + posy = 33, + posz = 0, + radius = 5.5, + pos2x = 61, + pos2y = 29, + pos2z = 0.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = -1, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armlab"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 32, posy = 16, posz = -11.8, radius = 3.5, - pos2x = 45, pos2y = 8, pos2z = -11.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 32, + posy = 16, + posz = -11.8, + radius = 3.5, + pos2x = 45, + pos2y = 8, + pos2z = -11.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = -1, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -32, posy = 16, posz = -11.8, radius = 3.5, - pos2x = -45, pos2y = 8, pos2z = -11.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armck'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -32, + posy = 16, + posz = -11.8, + radius = 3.5, + pos2x = -45, + pos2y = 8, + pos2z = -11.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = -1, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.3, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armck"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - aboveUnit = 'yes', - lightConfig = { posx = 0, posy = 0, posz = -0.3, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.65, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 2.5, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + aboveUnit = "yes", + lightConfig = { posx = 0, posy = 0, posz = -0.3, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.65, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 2.5, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = -0.3, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.65, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 2.5, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = -0.3, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.65, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 2.5, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = -2.5, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = -2.5, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 3, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 3, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 12, posz = -7, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 12, posz = -7, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armart'] = { + ["armart"] = { light = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -3, posy = 2.7, posz = 9.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -3, posy = 2.7, posz = 9.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, headlightglow1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 12, posz = 6, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 12, posz = 6, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightglow2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 12, posz = 6, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 12, posz = 6, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.5, specular = 0.3, scattering = 2, lensflare = 25, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -12, posy = 12, posz = 5, radius = 35, - dirx = 0.12, diry = -0.22, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -12, posy = 12, posz = 5, radius = 35, dirx = 0.12, diry = -0.22, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 12, posy = 12, posz = 5, radius = 35, - dirx = -0.12, diry = -0.22, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 12, posy = 12, posz = 5, radius = 35, dirx = -0.12, diry = -0.22, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1.5, posy = 6.6, posz = -12.8, radius = 6, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.97, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1.5, posy = 6.6, posz = -12.8, radius = 6, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.97, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.5, posy = 6.6, posz = -12.8, radius = 6, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.97, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.5, posy = 6.6, posz = -12.8, radius = 6, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.97, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armflash'] = { + ["armflash"] = { back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 6, posz = -13, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.97, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 6, posz = -13, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.97, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.5, posy = 6, posz = -13, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.97, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.5, posy = 6, posz = -13, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.97, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.5, posy = 5.8, posz = 3.6, radius = 3, - color2r = 0.4, color2g = 0.3, color2b = 0.01, colortime = 60, - r = 1.1, g = 0.9, b = 0.3, a = 0.7, - modelfactor = 0.2, specular = 0.5, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.5, posy = 5.8, posz = 3.6, radius = 3, color2r = 0.4, color2g = 0.3, color2b = 0.01, colortime = 60, r = 1.1, g = 0.9, b = 0.3, a = 0.7, modelfactor = 0.2, specular = 0.5, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 5.8, posz = 3.6, radius = 3, - color2r = 0.4, color2g = 0.3, color2b = 0.01, colortime = 60, - r = 1.2, g = 0.95, b = 0.35, a = 0.7, - modelfactor = 0.2, specular = 0.5, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 5.8, posz = 3.6, radius = 3, color2r = 0.4, color2g = 0.3, color2b = 0.01, colortime = 60, r = 1.2, g = 0.95, b = 0.35, a = 0.7, modelfactor = 0.2, specular = 0.5, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'cone', - pieceName = 'lbarrel', - lightConfig = { posx = 0, posy = 0, posz = 11, radius = 10, - dirx = 0, diry = 0, dirz = -1, theta = 0.19, - r = 1.6, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.7, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lbarrel", + lightConfig = { posx = 0, posy = 0, posz = 11, radius = 10, dirx = 0, diry = 0, dirz = -1, theta = 0.19, r = 1.6, g = 1, b = 0.2, a = 0.9, modelfactor = 0.7, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'cone', - pieceName = 'rbarrel', - lightConfig = { posx = 0, posy = 0, posz = 11, radius = 10, - dirx = 0, diry = 0, dirz = -1, theta = 0.19, - r = 1.6, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.7, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rbarrel", + lightConfig = { posx = 0, posy = 0, posz = 11, radius = 10, dirx = 0, diry = 0, dirz = -1, theta = 0.19, r = 1.6, g = 1, b = 0.2, a = 0.9, modelfactor = 0.7, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightleft = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 10, posy = 3, posz = -5, radius = 60, - dirx = -0.1, diry = -0.08, dirz = 1, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 10, posy = 3, posz = -5, radius = 60, dirx = -0.1, diry = -0.08, dirz = 1, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightright = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = -10, posy = 3, posz = -5, radius = 60, - dirx = 0.1, diry = -0.08, dirz = 1, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = -10, posy = 3, posz = -5, radius = 60, dirx = 0.1, diry = -0.08, dirz = 1, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 5.5, posz = 10.5, radius = 7, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 5.5, posz = 10.5, radius = 7, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 5.5, posz = 10.5, radius = 7, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 5.5, posz = 10.5, radius = 7, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- barrel1old = { -- lightType = 'point', @@ -14351,154 +8979,90 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corfav'] = { + ["corfav"] = { back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = -11, radius = 8, - color2r = 0.5, color2g = 0.1, color2b = 0.1, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = -11, radius = 8, color2r = 0.5, color2g = 0.1, color2b = 0.1, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 7.7, posz = 9, radius = 4, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 7.7, posz = 9, radius = 4, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.2, posy = 7.7, posz = 9, radius = 4, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.2, posy = 7.7, posz = 9, radius = 4, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamintel = { - lightType = 'point', - pieceName = 'rdrdish', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rdrdish", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 8, posz = 3, radius = 70, - dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 8, posz = 3, radius = 70, dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfav'] = { + ["armfav"] = { light = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = -10, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 25, - r = 1.2, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = -10, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 25, r = 1.2, g = 1, b = 0.4, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 6, posz = 10, radius = 120, - dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 6, posz = 10, radius = 120, dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.7, posz = 8, radius = 4, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.7, posz = 8, radius = 4, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteamback1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13.4, posz = -11.2, radius = 2.1, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13.4, posz = -11.2, radius = 2.1, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteamback2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = -11.2, radius = 2.1, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = -11.2, radius = 2.1, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armjanus'] = { + ["armjanus"] = { turretlamp = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 1, posz = 9, radius = 6, - color2r = 1, color2g = 1, color2b = 1, colortime = -1, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 1, posz = 9, radius = 6, color2r = 1, color2g = 1, color2b = 1, colortime = -1, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12.8, posy = 2.5, posz = 16, radius = 8, - color2r = 1, color2g = 0.9, color2b = 0.4, colortime = -1.5, - r = 1, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.3, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12.8, posy = 2.5, posz = 16, radius = 8, color2r = 1, color2g = 0.9, color2b = 0.4, colortime = -1.5, r = 1, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.3, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12.8, posy = 2.5, posz = 16, radius = 8, - color2r = 1, color2g = 0.9, color2b = 0.4, colortime = -1.5, - r = 1, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.3, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12.8, posy = 2.5, posz = 16, radius = 8, color2r = 1, color2g = 0.9, color2b = 0.4, colortime = -1.5, r = 1, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.3, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 1, posz = -8, radius = 80, - dirx = -0.1, diry = -0.07, dirz = 1, theta = 0.09, - r = 1, g = 0.8, b = 0.8, a = 0.4, - modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 1, posz = -8, radius = 80, dirx = -0.1, diry = -0.07, dirz = 1, theta = 0.09, r = 1, g = 0.8, b = 0.8, a = 0.4, modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 1, posz = -8, radius = 80, - dirx = 0.1, diry = -0.07, dirz = 1, theta = 0.09, - r = 1, g = 0.8, b = 0.8, a = 0.55, - modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 1, posz = -8, radius = 80, dirx = 0.1, diry = -0.07, dirz = 1, theta = 0.09, r = 1, g = 0.8, b = 0.8, a = 0.55, modelfactor = -0.4, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamside1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = -14, radius = 9.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = -14, radius = 9.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.2, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- teambase1 = { -- lightType = 'point', @@ -14519,487 +9083,349 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, redglowl = { - lightType = 'point', - pieceName = 'barrell', - lightConfig = { posx = 0.3, posy = 0, posz = 5.7, radius = 4, - color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrell", + lightConfig = { posx = 0.3, posy = 0, posz = 5.7, radius = 4, color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowr = { - lightType = 'point', - pieceName = 'barrelr', - lightConfig = { posx = -0.3, posy = 0, posz = 5.7, radius = 4, - color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelr", + lightConfig = { posx = -0.3, posy = 0, posz = 5.7, radius = 4, color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armpincer'] = { + ["armpincer"] = { searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = 7, radius = 55, - dirx = 0, diry = -0.09, dirz = 1, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.36, colortime = -3, - modelfactor = -0.9, specular = -0.3, scattering = 2.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = 7, radius = 55, dirx = 0, diry = -0.09, dirz = 1, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.36, colortime = -3, modelfactor = -0.9, specular = -0.3, scattering = 2.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 14.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.9, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 14.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.9, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, teamlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = -16.5, radius = 6.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = -16.5, radius = 6.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.5, posy = 14.5, posz = -7, radius = 3, - color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, - r = -1, g = 1, b = 1, a = 1.1, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.5, posy = 14.5, posz = -7, radius = 3, color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, r = -1, g = 1, b = 1, a = 1.1, modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.5, posy = 14.5, posz = -7, radius = 3, - color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, - r = -1, g = 1, b = 1, a = 1.1, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.5, posy = 14.5, posz = -7, radius = 3, color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, r = -1, g = 1, b = 1, a = 1.1, modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtop3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.5, posy = 14.5, posz = 6.6, radius = 3, - color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, - r = -1, g = 1, b = 1, a = 1.1, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.5, posy = 14.5, posz = 6.6, radius = 3, color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, r = -1, g = 1, b = 1, a = 1.1, modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtop4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.5, posy = 14.5, posz = 6.6, radius = 3, - color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, - r = -1, g = 1, b = 1, a = 1.1, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.5, posy = 14.5, posz = 6.6, radius = 3, color2r = 0.6, color2g = 0.6, color2b = 0.6, colortime = 60, r = -1, g = 1, b = 1, a = 1.1, modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsaber'] = { + ["armsaber"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 7.5, posz = 10.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 7.5, posz = 10.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 7.5, posz = 10.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 7.5, posz = 10.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 4.5, posz = -5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 4.5, posz = -5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 4.5, posz = -5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 4.5, posz = -5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsb'] = { + ["armsb"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 13.5, posz = 21.2, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 13.5, posz = 21.2, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 13.5, posz = 21.2, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 13.5, posz = 21.2, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.3, posy = 18, posz = -9, radius = 13, - color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.7, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.3, posy = 18, posz = -9, radius = 13, color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.7, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.3, posy = 18, posz = -9, radius = 13, - color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.7, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.3, posy = 18, posz = -9, radius = 13, color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.7, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 11, posz = -29, radius = 9, - color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.7, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 11, posz = -29, radius = 9, color2r = 0.2, color2g = 0.7, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.7, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustc = { - lightType = 'point', - pieceName = 'thrustc', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.6, g = 1, b = 0.6, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustc", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.6, g = 1, b = 0.6, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsam'] = { + ["armsam"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.7, posy = 4, posz = 18.3, radius = 3.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.15, g = 1, b = 0.35, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.7, posy = 4, posz = 18.3, radius = 3.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.15, g = 1, b = 0.35, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.7, posy = 4, posz = 18.3, radius = 3.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.15, g = 1, b = 0.35, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.7, posy = 4, posz = 18.3, radius = 3.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.15, g = 1, b = 0.35, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rocketglowambient = { - lightType = 'point', - pieceName = 'mlauncher', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 9.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1, b = 0.35, a = 0.3, - modelfactor = 0.5, specular = 0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mlauncher", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 9.2, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1, b = 0.35, a = 0.3, modelfactor = 0.5, specular = 0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rocketglow = { - lightType = 'beam', - pieceName = 'mlauncher', - lightConfig = { posx = -3.4, posy = 1.5, posz = 9.55, radius = 1.4, - pos2x = 3.4, pos2y = 1.5, pos2z = 9.55, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 4.0, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mlauncher", + lightConfig = { + posx = -3.4, + posy = 1.5, + posz = 9.55, + radius = 1.4, + pos2x = 3.4, + pos2y = 1.5, + pos2z = 9.55, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = -1, + color2g = -1, + color2b = -1, + colortime = 45, + r = -1, + g = 0.1, + b = 0.1, + a = 4.0, + modelfactor = 0.6, + specular = 0.4, + scattering = 0, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, rocketglow2 = { - lightType = 'beam', - pieceName = 'mlauncher', - lightConfig = { posx = -3.4, posy = -1.1, posz = 9.55, radius = 1.4, - pos2x = 3.4, pos2y = -1.1, pos2z = 9.55, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 4.0, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mlauncher", + lightConfig = { + posx = -3.4, + posy = -1.1, + posz = 9.55, + radius = 1.4, + pos2x = 3.4, + pos2y = -1.1, + pos2z = 9.55, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = -1, + color2g = -1, + color2b = -1, + colortime = 45, + r = -1, + g = 0.1, + b = 0.1, + a = 4.0, + modelfactor = 0.6, + specular = 0.4, + scattering = 0, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, searchlight = { - lightType = 'cone', - pieceName = 'mlauncher', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 120, colortime = -1.5, - dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "mlauncher", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 120, colortime = -1.5, dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.4, posy = 4.5, posz = -21, radius = 1.4, - pos2x = 3.4, pos2y = 4.5, pos2z = -21, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.1, b = 0.1, a = 1.6, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armstump'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -3.4, + posy = 4.5, + posz = -21, + radius = 1.4, + pos2x = 3.4, + pos2y = 4.5, + pos2z = -21, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -2, + r = -1, + g = 0.1, + b = 0.1, + a = 1.6, + modelfactor = 0.6, + specular = 0.4, + scattering = 0, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armstump"] = { searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = 3, radius = 70, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, - r = 1, g = 1, b = 0.89, a = 0.36, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = 3, radius = 70, dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, r = 1, g = 1, b = 0.89, a = 0.36, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronthead = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 12, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 12, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 3.5, posz = 8.5, radius = 11, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.75, g = 0.75, b = 1, a = 0.09, - modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 3.5, posz = 8.5, radius = 11, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.75, g = 0.75, b = 1, a = 0.09, modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontteamlight = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 4, posz = 7.5, radius = 6, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 0.75, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 4, posz = 7.5, radius = 6, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 0.75, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack = { - lightType = 'point', - pieceName = 'epack', - lightConfig = { posx = 0, posy = 2.5, posz = -6, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.85, - modelfactor = 0.25, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "epack", + lightConfig = { posx = 0, posy = 2.5, posz = -6, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.85, modelfactor = 0.25, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcrash'] = { + ["corcrash"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 4.5, posz = 7.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 4.5, posz = 7.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 13, posz = -12, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.2, b = 0.2, a = 0.66, - modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 13, posz = -12, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.2, b = 0.2, a = 0.66, modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -13, posy = 13, posz = 0, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.2, b = 0.2, a = 0.66, - modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -13, posy = 13, posz = 0, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.2, b = 0.2, a = 0.66, modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 13, posy = 13, posz = 0, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.2, b = 0.2, a = 0.66, - modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 13, posy = 13, posz = 0, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.2, b = 0.2, a = 0.66, modelfactor = 0.6, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 300, colortime = -1.5, - dirx = 0, diry = 0.7, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 300, colortime = -1.5, dirx = 0, diry = 0.7, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfast'] = { + ["corfast"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0, posz = 6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 0, posz = 6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flare = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armback = { - lightType = 'point', - pieceName = 'rlarm', - lightConfig = { posx = 0, posy = -2, posz = -4.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rlarm", + lightConfig = { posx = 0, posy = -2, posz = -4.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armfront = { - lightType = 'point', - pieceName = 'rlarm', - lightConfig = { posx = 0, posy = -2, posz = 4.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rlarm", + lightConfig = { posx = 0, posy = -2, posz = 4.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cornecro'] = { + ["cornecro"] = { corbuildlight = { - lightType = 'point', - pieceName = 'corhexl_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 8.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.25, specular = 0.35, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "corhexl_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 8.2, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.25, specular = 0.35, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 4, posz = 10.5, radius = 8, - color2r = 0.3, color2g = 0.03, color2b = 0.01, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 0.85, - modelfactor = 0.6, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 4, posz = 10.5, radius = 8, color2r = 0.3, color2g = 0.03, color2b = 0.01, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 0.85, modelfactor = 0.6, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 13, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanoflash = { - lightType = 'point', - pieceName = 'corhexl', - lightConfig = { posx = 0, posy = 2.5, posz = -1.5, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "corhexl", + lightConfig = { posx = 0, posy = 2.5, posz = -1.5, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armrectr'] = { + ["armrectr"] = { armbuildlight = { - lightType = 'point', - pieceName = 'armhexl_emit', - lightConfig = { posx = 0, posy = 1, posz = -1, radius = 8.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.25, specular = 0.35, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl_emit", + lightConfig = { posx = 0, posy = 1, posz = -1, radius = 8.2, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.25, specular = 0.35, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 19, posz = -8, radius = 10, - color2r = 1, color2g = 1, color2b = 0.5, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.85, - modelfactor = 0.4, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 19, posz = -8, radius = 10, color2r = 1, color2g = 1, color2b = 0.5, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.85, modelfactor = 0.4, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 3, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 3, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanoflash = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 33, posz = -3.8, radius = 7, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1, g = 0.8, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 33, posz = -3.8, radius = 7, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1, g = 0.8, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- legwhiteleft = { -- lightType = 'point', @@ -15020,262 +9446,148 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmlv'] = { + ["armmlv"] = { backpack = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = -17, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = -17, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 3, posz = 16, radius = 6, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 3, posz = 16, radius = 6, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3, posz = 4, radius = 10, - color2r = 0.8, color2g = 0.8, color2b = 1, colortime = 0, - r = 0.8, g = 0.8, b = 1, a = 0.06, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3, posz = 4, radius = 10, color2r = 0.8, color2g = 0.8, color2b = 1, colortime = 0, r = 0.8, g = 0.8, b = 1, a = 0.06, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7, posy = 8, posz = -2, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7, posy = 8, posz = -2, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7, posy = 8, posz = -2, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.4, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7, posy = 8, posz = -2, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.4, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'lflare', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lflare", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'rflare', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rflare", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20, posz = 9, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.9, specular = 0.35, scattering = 0.7, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 20, posz = 9, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.9, specular = 0.35, scattering = 0.7, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armbanth'] = { + ["armbanth"] = { searchlight = { - lightType = 'cone', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 4.1, posz = 8, radius = 470, - dirx = 0, diry = -0.12, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "turret", + lightConfig = { posx = 0, posy = 4.1, posz = 8, radius = 470, dirx = 0, diry = -0.12, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, antenna1 = { - lightType = 'point', - pieceName = 'antenna', - lightConfig = { posx = 3, posy = 27, posz = 1.5, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 2.5, - modelfactor = 0.8, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "antenna", + lightConfig = { posx = 3, posy = 27, posz = 1.5, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 2.5, modelfactor = 0.8, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'antenna', - lightConfig = { posx = 5, posy = 0, posz = 0, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 1, - modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "antenna", + lightConfig = { posx = 5, posy = 0, posz = 0, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 1, modelfactor = 0.6, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 2, posz = 7, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.75, g = 0.75, b = 1, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 2, posz = 7, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.75, g = 0.75, b = 1, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, torsotop = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 38, posz = -4, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 38, posz = -4, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, uparm1 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -7.5, posy = -5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -7.5, posy = -5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, uparm2 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 7.5, posy = -5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 7.5, posy = -5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = -10.5, posy = -1.7, posz = 0.5, radius = 4, - color2r = -6, color2g = -6, color2b = -6, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = -10.5, posy = -1.7, posz = 0.5, radius = 4, color2r = -6, color2g = -6, color2b = -6, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1b = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = -9.0, posy = 1.0, posz = 1.2, radius = 4, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 35, - r = 0, g = 0, b = 0, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = -9.0, posy = 1.0, posz = 1.2, radius = 4, color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 35, r = 0, g = 0, b = 0, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1canim = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = -9.2, posy = -1.9, posz = 7.5, radius = 10.4, - dirx = 0, diry = 0, dirz = 0.5, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = -9.2, posy = -1.9, posz = 7.5, radius = 10.4, dirx = 0, diry = 0, dirz = 0.5, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, arm2 = { - lightType = 'point', - pieceName = 'lloarm', - lightConfig = { posx = 9.0, posy = -1.7, posz = 0.5, radius = 4, - color2r = -6, color2g = -6, color2b = -6, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lloarm", + lightConfig = { posx = 9.0, posy = -1.7, posz = 0.5, radius = 4, color2r = -6, color2g = -6, color2b = -6, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2b = { - lightType = 'point', - pieceName = 'lloarm', - lightConfig = { posx = 9.0, posy = 1.0, posz = 1.2, radius = 4, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 35, - r = 0, g = 0, b = 0, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lloarm", + lightConfig = { posx = 9.0, posy = 1.0, posz = 1.2, radius = 4, color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 35, r = 0, g = 0, b = 0, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2canim = { - lightType = 'point', - pieceName = 'lloarm', - lightConfig = { posx = 9.2, posy = -1.9, posz = 7.5, radius = 10.4, - dirx = 0, diry = 0, dirz = 0.5, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "lloarm", + lightConfig = { posx = 9.2, posy = -1.9, posz = 7.5, radius = 10.4, dirx = 0, diry = 0, dirz = 0.5, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, rocketbarrelteamglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -10, posy = 47, posz = -20.5, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 1, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -10, posy = 47, posz = -20.5, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 1, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rocketbarrelbot = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -10, posy = 10, posz = -20, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.2, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -10, posy = 10, posz = -20, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.2, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 5.7, posy = 26, posz = 14, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1.2, g = 1, b = 0.2, a = 1.92, - modelfactor = 0.2, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 5.7, posy = 26, posz = 14, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1.2, g = 1, b = 0.2, a = 1.92, modelfactor = 0.2, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -7, posy = 26, posz = 19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 180, - r = 1, g = 1, b = 1, a = 0.44, - modelfactor = 0.2, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -7, posy = 26, posz = 19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 180, r = 1, g = 1, b = 1, a = 0.44, modelfactor = 0.2, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front3 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 10, posy = 14, posz = 19, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 180, - r = 1, g = 1, b = 1, a = 0.44, - modelfactor = 0.2, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 10, posy = 14, posz = 19, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 180, r = 1, g = 1, b = 1, a = 0.44, modelfactor = 0.2, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 17, posy = 15, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 17, posy = 15, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -17, posy = 15.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -17, posy = 15.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turret = { -- lightType = 'point', @@ -15287,166 +9599,91 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turretbeam = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9.5, posz = 13, radius = 3.9, - pos2x = 0, pos2y = 10, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.3, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9.5, posz = 13, radius = 3.9, pos2x = 0, pos2y = 10, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.3, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashturret = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 10, posz = 12, radius = 3.3, - dirx = 0, diry = 0, dirz = 1, theta = -12.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 3, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 10, posz = 12, radius = 3.3, dirx = 0, diry = 0, dirz = 1, theta = -12.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 3, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot1 = { - lightType = 'point', - pieceName = 'rthigh', - lightConfig = { posx = -7, posy = -17, posz = 0.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthigh", + lightConfig = { posx = -7, posy = -17, posz = 0.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot2 = { - lightType = 'point', - pieceName = 'rthigh', - lightConfig = { posx = 7.5, posy = -17, posz = 0.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthigh", + lightConfig = { posx = 7.5, posy = -17, posz = 0.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot3 = { - lightType = 'point', - pieceName = 'lthigh', - lightConfig = { posx = -7.5, posy = -17, posz = 0.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthigh", + lightConfig = { posx = -7.5, posy = -17, posz = 0.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot4 = { - lightType = 'point', - pieceName = 'lthigh', - lightConfig = { posx = 7, posy = -17, posz = 0.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthigh", + lightConfig = { posx = 7, posy = -17, posz = 0.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corkarg'] = { + ["corkarg"] = { eyesbeam = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 7.2, posy = 4.3, posz = 18.8, radius = 1.6, - pos2x = -7.2, pos2y = 4.3, pos2z = 18.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 7.2, posy = 4.3, posz = 18.8, radius = 1.6, pos2x = -7.2, pos2y = 4.3, pos2z = 18.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesglow = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 3, posz = 20, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.4, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 3, posz = 20, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.4, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topbeam = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 11.8, posz = 16.0, radius = 3.0, - pos2x = 0, pos2y = 15.7, pos2z = 11.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 1.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 0, posy = 11.8, posz = 16.0, radius = 3.0, pos2x = 0, pos2y = 15.7, pos2z = 11.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 1.9, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashtop = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 13.5, posz = 14, radius = 2.8, - dirx = 0, diry = -1, dirz = 1, theta = -2.1, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 13.5, posz = 14, radius = 2.8, dirx = 0, diry = -1, dirz = 1, theta = -2.1, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourcefrontr = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -10.1, posy = 4.2, posz = 16.7, radius = 1.6, - pos2x = -10.5, pos2y = 4.2, pos2z = 16.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -10.1, posy = 4.2, posz = 16.7, radius = 1.6, pos2x = -10.5, pos2y = 4.2, pos2z = 16.7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourcefronl = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 10.1, posy = 4.2, posz = 16.7, radius = 1.6, - pos2x = 10.5, pos2y = 4.2, pos2z = 16.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 10.1, posy = 4.2, posz = 16.7, radius = 1.6, pos2x = 10.5, pos2y = 4.2, pos2z = 16.7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 10.1, posy = 4.2, posz = 16.7, radius = 110, colortime = -2, - dirx = 0.08, diry = -0.12, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 10.1, posy = 4.2, posz = 16.7, radius = 110, colortime = -2, dirx = 0.08, diry = -0.12, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -10.1, posy = 4.2, posz = 16.7, radius = 110, colortime = -2, - dirx = -0.08, diry = -0.12, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -10.1, posy = 4.2, posz = 16.7, radius = 110, colortime = -2, dirx = -0.08, diry = -0.12, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottomlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = 0, radius = 45, - color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.1, - modelfactor = 0.15, specular = 0.4, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = 0, radius = 45, color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.1, modelfactor = 0.15, specular = 0.4, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -12, posy = 23.8, posz = -3, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -12, posy = 23.8, posz = -3, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 12, posy = 23.8, posz = -3, radius = 5, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 12, posy = 23.8, posz = -3, radius = 5, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes2 = { -- lightType = 'point', @@ -15458,24 +9695,16 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corjugg'] = { + ["corjugg"] = { antenna1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -5, posy = 57.5, posz = -28, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0, b = 0, a = 0.9, - modelfactor = 0.3, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -5, posy = 57.5, posz = -28, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0, b = 0, a = 0.9, modelfactor = 0.3, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -1, posy = 47, posz = -28, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.9, - modelfactor = 0.2, specular = 0.2, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -1, posy = 47, posz = -28, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.9, modelfactor = 0.2, specular = 0.2, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- searchlightmaintop = { -- lightType = 'cone', @@ -15496,23 +9725,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, searchlightmainside = { - lightType = 'cone', - pieceName = 'mainbarrel', - lightConfig = { posx = -14, posy = -1, posz = -30, radius = 350, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.15, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "mainbarrel", + lightConfig = { posx = -14, posy = -1, posz = -30, radius = 350, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.15, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightsourcemainside = { - lightType = 'beam', - pieceName = 'mainbarrel', - lightConfig = { posx = -14, posy = 2.2, posz = -7, radius = 3.8, - pos2x = -14, pos2y = -4, pos2z = -7.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mainbarrel", + lightConfig = { posx = -14, posy = 2.2, posz = -7, radius = 3.8, pos2x = -14, pos2y = -4, pos2z = -7.1, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headlightsourcefrontrb = { -- lightType = 'beam', @@ -15525,342 +9745,223 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, weaponsglowmain = { - lightType = 'cone', - pieceName = 'mainbarrel', - lightConfig = { posx = 0, posy = 0, posz = -40, radius = 70, - dirx = 0, diry = 0, dirz = 1, theta = 0.10, - color2r = 0.18, color2g = 0.08, color2b = 0.03, colortime = 60, - r = 1.2, g = 0.8, b = 0.2, a = 1.2, - modelfactor = 0, specular = 1, scattering = 3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "mainbarrel", + lightConfig = { posx = 0, posy = 0, posz = -40, radius = 70, dirx = 0, diry = 0, dirz = 1, theta = 0.10, color2r = 0.18, color2g = 0.08, color2b = 0.03, colortime = 60, r = 1.2, g = 0.8, b = 0.2, a = 1.2, modelfactor = 0, specular = 1, scattering = 3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglow = { - lightType = 'point', - pieceName = 'mainbarrel', - lightConfig = { posx = 0, posy = 0, posz = 5, radius = 7, - color2r = 0.18, color2g = 0.08, color2b = 0.03, colortime = 120, - r = 1, g = 0.15, b = 0.06, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mainbarrel", + lightConfig = { posx = 0, posy = 0, posz = 5, radius = 7, color2r = 0.18, color2g = 0.08, color2b = 0.03, colortime = 120, r = 1, g = 0.15, b = 0.06, a = 1.5, modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redburn = { - lightType = 'point', - pieceName = 'mainbarrel', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 7, - dirx = 0, diry = 0, dirz = 0.25, theta = -1.9, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 14, - r = 0.95, g = 0.66, b = 0.07, a = 0.4, - modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mainbarrel", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 7, dirx = 0, diry = 0, dirz = 0.25, theta = -1.9, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 14, r = 0.95, g = 0.66, b = 0.07, a = 0.4, modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, yellowaccentburn = { - lightType = 'point', - pieceName = 'mainbarrel', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, - dirx = 0, diry = 0, dirz = 0.14, theta = -2.1, - color2r = 0.8, color2g = 0.7, color2b = 0.05, colortime = 14, - r = 0.95, g = 0.66, b = 0.07, a = 0.4, - modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mainbarrel", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, dirx = 0, diry = 0, dirz = 0.14, theta = -2.1, color2r = 0.8, color2g = 0.7, color2b = 0.05, colortime = 14, r = 0.95, g = 0.66, b = 0.07, a = 0.4, modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lasertoptip = { - lightType = 'point', - pieceName = 'toplaser', - lightConfig = { posx = 0.2, posy = 4.1, posz = 13.4, radius = 2.6, - color2r = -30, color2g = -30, color2b = -30, colortime = 60, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "toplaser", + lightConfig = { posx = 0.2, posy = 4.1, posz = 13.4, radius = 2.6, color2r = -30, color2g = -30, color2b = -30, colortime = 60, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlasertopl = { - lightType = 'point', - pieceName = 'toplaser', - lightConfig = { posx = 2.3, posy = 6.4, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "toplaser", + lightConfig = { posx = 2.3, posy = 6.4, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlasertopr = { - lightType = 'point', - pieceName = 'toplaser', - lightConfig = { posx = -2.3, posy = 6.4, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "toplaser", + lightConfig = { posx = -2.3, posy = 6.4, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserright = { - lightType = 'point', - pieceName = 'rlaser', - lightConfig = { posx = 0.2, posy = 0, posz = 13.4, radius = 2.6, - color2r = -30, color2g = -30, color2b = -30, colortime = 60, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rlaser", + lightConfig = { posx = 0.2, posy = 0, posz = 13.4, radius = 2.6, color2r = -30, color2g = -30, color2b = -30, colortime = 60, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlaserr1 = { - lightType = 'point', - pieceName = 'rlaser', - lightConfig = { posx = -2.2, posy = 2.2, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rlaser", + lightConfig = { posx = -2.2, posy = 2.2, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlaserr2 = { - lightType = 'point', - pieceName = 'rlaser', - lightConfig = { posx = 2.2, posy = 2.2, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rlaser", + lightConfig = { posx = 2.2, posy = 2.2, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserleft = { - lightType = 'point', - pieceName = 'llaser', - lightConfig = { posx = 0.2, posy = 0, posz = 13.4, radius = 2.6, - color2r = -30, color2g = -30, color2b = -30, colortime = 60, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "llaser", + lightConfig = { posx = 0.2, posy = 0, posz = 13.4, radius = 2.6, color2r = -30, color2g = -30, color2b = -30, colortime = 60, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlaserl1 = { - lightType = 'point', - pieceName = 'llaser', - lightConfig = { posx = 2.2, posy = 2.2, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "llaser", + lightConfig = { posx = 2.2, posy = 2.2, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlaserl2 = { - lightType = 'point', - pieceName = 'llaser', - lightConfig = { posx = -2.2, posy = 2.2, posz = 0, radius = 2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "llaser", + lightConfig = { posx = -2.2, posy = 2.2, posz = 0, radius = 2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -2.4, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armvang'] = { + ["armvang"] = { top = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 10.8, posz = 14.2, radius = 1.2, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 10.8, posz = 14.2, radius = 1.2, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteam1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 2.9, posy = 7.5, posz = -2.8, radius = 3.5, - --dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1.2, g = 1, b = 0.2, a = 1.4, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { + posx = 2.9, + posy = 7.5, + posz = -2.8, + radius = 3.5, + --dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.1, + color2r = -1, + color2g = -1, + color2b = -1, + colortime = 45, + r = -1.2, + g = 1, + b = 0.2, + a = 1.4, + modelfactor = 0.4, + specular = 0.2, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, topteam2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.9, posy = 7.5, posz = -0.8, radius = 1.2, - --dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1.2, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { + posx = -2.9, + posy = 7.5, + posz = -0.8, + radius = 1.2, + --dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.1, + color2r = -1, + color2g = -1, + color2b = -1, + colortime = 45, + r = -1.2, + g = 1, + b = 0.2, + a = 1.2, + modelfactor = 0.4, + specular = 0.2, + scattering = 0.7, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, topblink = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0.2, posy = 8.1, posz = 1.9, radius = 2.2, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0.2, posy = 8.1, posz = 1.9, radius = 2.2, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topwhitebeam = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 6, posz = 17, radius = 2, - pos2x = 0, pos2y = 6, pos2z = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 6, posz = 17, radius = 2, pos2x = 0, pos2y = 6, pos2z = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, targetlight = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0., posy = 9.4, posz = 20.0, radius = 2.9, - color2r = -2, color2g = -2, color2b = -2, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0., posy = 9.4, posz = 20.0, radius = 2.9, color2r = -2, color2g = -2, color2b = -2, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 9.4, posz = 18, radius = 370, - dirx = 0, diry = 0, dirz = 1, theta = 0.10, - r = 1, g = 1, b = 1, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 9.4, posz = 18, radius = 370, dirx = 0, diry = 0, dirz = 1, theta = 0.10, r = 1, g = 1, b = 1, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, backglow = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0.0, posy = 0.5, posz = -10.0, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0.0, posy = 0.5, posz = -10.0, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, teamcolorsidel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12.0, posy = 8.5, posz = 6.4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12.0, posy = 8.5, posz = 6.4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamcolorsidel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8.5, posz = -0.2, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.27, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8.5, posz = -0.2, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.27, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamcolorsidel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8.5, posz = -7.1, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8.5, posz = -7.1, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamcolorsider1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8.5, posz = 6.4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8.5, posz = 6.4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamcolorsider2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8.5, posz = -0.2, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8.5, posz = -0.2, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamcolorsider3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8.5, posz = -7.1, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1.2, g = 1, b = 0.2, a = 1.0, - modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8.5, posz = -7.1, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1.2, g = 1, b = 0.2, a = 1.0, modelfactor = 0.2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topsleeveteamr = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = -7.8, posy = 7.5, posz = -5.5, radius = 3, - pos2x = -6.3, pos2y = 7.7, pos2z = 11.7, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 1.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = -7.8, posy = 7.5, posz = -5.5, radius = 3, pos2x = -6.3, pos2y = 7.7, pos2z = 11.7, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 1.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topsleeveteaml = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 7.8, posy = 7.5, posz = -5.5, radius = 3, - pos2x = 6.3, pos2y = 7.7, pos2z = 11.7, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 1.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 7.8, posy = 7.5, posz = -5.5, radius = 3, pos2x = 6.3, pos2y = 7.7, pos2z = 11.7, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 1.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legmr = { - lightType = 'beam', - pieceName = 'mrleg', - lightConfig = { posx = -4.3, posy = 0.5, posz = -3, radius = 2, - pos2x = -4.3, pos2y = 0.5, pos2z = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mrleg", + lightConfig = { posx = -4.3, posy = 0.5, posz = -3, radius = 2, pos2x = -4.3, pos2y = 0.5, pos2z = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legml = { - lightType = 'beam', - pieceName = 'mlleg', - lightConfig = { posx = 4.3, posy = 0.5, posz = -3, radius = 2, - pos2x = 4.3, pos2y = 0.5, pos2z = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mlleg", + lightConfig = { posx = 4.3, posy = 0.5, posz = -3, radius = 2, pos2x = 4.3, pos2y = 0.5, pos2z = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legbr = { - lightType = 'beam', - pieceName = 'brleg', - lightConfig = { posx = -3, posy = 0.5, posz = -4.3, radius = 2, - pos2x = 3, pos2y = 0.5, pos2z = -4.3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "brleg", + lightConfig = { posx = -3, posy = 0.5, posz = -4.3, radius = 2, pos2x = 3, pos2y = 0.5, pos2z = -4.3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legbl = { - lightType = 'beam', - pieceName = 'blleg', - lightConfig = { posx = -3, posy = 0.5, posz = -4.3, radius = 2, - pos2x = 3, pos2y = 0.5, pos2z = -4.3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "blleg", + lightConfig = { posx = -3, posy = 0.5, posz = -4.3, radius = 2, pos2x = 3, pos2y = 0.5, pos2z = -4.3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legfr = { - lightType = 'beam', - pieceName = 'frleg', - lightConfig = { posx = -3, posy = 0.5, posz = 4.3, radius = 2, - pos2x = 3, pos2y = 0.5, pos2z = 4.3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "frleg", + lightConfig = { posx = -3, posy = 0.5, posz = 4.3, radius = 2, pos2x = 3, pos2y = 0.5, pos2z = 4.3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legfl = { - lightType = 'beam', - pieceName = 'flleg', - lightConfig = { posx = -3, posy = 0.5, posz = 4.3, radius = 2, - pos2x = 3, pos2y = 0.5, pos2z = 4.3, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "flleg", + lightConfig = { posx = -3, posy = 0.5, posz = 4.3, radius = 2, pos2x = 3, pos2y = 0.5, pos2z = 4.3, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, -- ['armvang-old'] = { @@ -15966,7 +10067,7 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, -- }, - ['corkorg'] = { + ["corkorg"] = { -- searchlight = { -- lightType = 'cone', -- pieceName = 'head', @@ -15977,13 +10078,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, bodyglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -5, posz = 8, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.9, b = 0.1, a = 0.3, - modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = -5, posz = 8, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.9, b = 0.1, a = 0.3, modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- noselight = { -- lightType = 'point', @@ -16004,101 +10101,56 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headtop = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = 0, posy = 13, posz = 16, radius = 7, - pos2x = 0, pos2y = 24, pos2z = -13, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = 0, posy = 13, posz = 16, radius = 7, pos2x = 0, pos2y = 24, pos2z = -13, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 3, posz = 16.8, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.1, a = 1.2, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 3, posz = 16.8, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.1, a = 1.2, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderlightkorgleft = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 10, posy = 20, posz = 0, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 10, posy = 20, posz = 0, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderlightkorgright = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -10, posy = 20, posz = 0, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -10, posy = 20, posz = 0, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglowright = { - lightType = 'point', - pieceName = 'rarm', - lightConfig = { posx = 2.5, posy = -16.2, posz = 11.5, radius = 4, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rarm", + lightConfig = { posx = 2.5, posy = -16.2, posz = 11.5, radius = 4, dirx = 0, diry = -0.6666667, dirz = 0, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglowleft = { - lightType = 'point', - pieceName = 'larm', - lightConfig = { posx = -2.5, posy = -16.2, posz = 11.5, radius = 4, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "larm", + lightConfig = { posx = -2.5, posy = -16.2, posz = 11.5, radius = 4, dirx = 0, diry = -0.6666667, dirz = 0, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcom'] = { + ["armcom"] = { headlightarmcom = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 2.2, posz = 0, radius = 250, - dirx = 0, diry = -0.25, dirz = 1, theta = 0.18, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 2.2, posz = 0, radius = 250, dirx = 0, diry = -0.25, dirz = 1, theta = 0.18, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, headlightteam = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 2.2, posz = 0, radius = 110, - dirx = 0, diry = -0.25, dirz = 1, theta = 0.13, - r = -1, g = 1, b = 1, a = 1.75, - modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 2.2, posz = 0, radius = 110, dirx = 0, diry = -0.25, dirz = 1, theta = 0.13, r = -1, g = 1, b = 1, a = 1.75, modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, chestheadlightl = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = -7, posy = 9.5, posz = 0, radius = 46, - dirx = -0.3, diry = -0.98, dirz = 0.6, theta = 0.58, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.3, scattering = 4.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = -7, posy = 9.5, posz = 0, radius = 46, dirx = -0.3, diry = -0.98, dirz = 0.6, theta = 0.58, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.3, scattering = 4.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chestheadlightr = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 7, posy = 9.5, posz = 0, radius = 46, - dirx = 0.3, diry = -0.98, dirz = 0.6, theta = 0.58, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.4, specular = 0.3, scattering = 4.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 7, posy = 9.5, posz = 0, radius = 46, dirx = 0.3, diry = -0.98, dirz = 0.6, theta = 0.58, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.4, specular = 0.3, scattering = 4.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- buildlight1 = { -- this is the lightname -- lightType = 'cone', @@ -16119,31 +10171,19 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, buildlight1 = { -- this is the lightname - lightType = 'point', - pieceName = 'armhexl_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'point', - pieceName = 'armhexl2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, radarblip = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, - r = 0, g = 1, b = 0, a = 1.0, - modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 2.5, posz = 2.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, r = 0, g = 1, b = 0, a = 1.0, modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, -- backpackpoint = { -- lightType = 'point', @@ -16155,114 +10195,64 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, backpackbeam = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 14.9, posz = -10.4, radius = 8, - pos2x = 0, pos2y = 9.0, pos2z = -10.8, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 0.95, b = 0.6, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 0, posy = 14.9, posz = -10.4, radius = 8, pos2x = 0, pos2y = 9.0, pos2z = -10.8, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 0.95, b = 0.6, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, shoulder1 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -8.5, posy = 0, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -8.5, posy = 0, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder2 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 8.5, posy = 0, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 8.5, posy = 0, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip1 = { - lightType = 'point', - pieceName = 'lthigh', - lightConfig = { posx = -14, posy = 6, posz = -4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.95, b = 0.55, a = 0.3, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthigh", + lightConfig = { posx = -14, posy = 6, posz = -4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.95, b = 0.55, a = 0.3, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip2 = { - lightType = 'point', - pieceName = 'rthigh', - lightConfig = { posx = 14, posy = 6, posz = -4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.95, b = 0.55, a = 0.3, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthigh", + lightConfig = { posx = 14, posy = 6, posz = -4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.95, b = 0.55, a = 0.3, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesbeam = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = -2.2, posy = 0.9, posz = 5.5, radius = 1.3, - pos2x = 2.2, pos2y = 0.9, pos2z = 5.5, - color2r = 0.7, color2g = 0.5, color2b = 0.1, colortime = 0, - r = -1.25, g = 0.95, b = 0.55, a = 1.8, - modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = -2.2, posy = 0.9, posz = 5.5, radius = 1.3, pos2x = 2.2, pos2y = 0.9, pos2z = 5.5, color2r = 0.7, color2g = 0.5, color2b = 0.1, colortime = 0, r = -1.25, g = 0.95, b = 0.55, a = 1.8, modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0.8, posz = 6.2, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 180, - r = -1.25, g = 0.95, b = 0.55, a = 0.6, - modelfactor = 0.15, specular = 0.1, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 0.8, posz = 6.2, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 180, r = -1.25, g = 0.95, b = 0.55, a = 0.6, modelfactor = 0.15, specular = 0.1, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = -5, posy = -10.5, posz = -2, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.85, b = 0.55, a = 0.8, - modelfactor = 0.15, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = -5, posy = -10.5, posz = -2, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.85, b = 0.55, a = 0.8, modelfactor = 0.15, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1builder = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = -4.0, posy = -13.5, posz = 3.4, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = -4.0, posy = -13.5, posz = 3.4, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1builder2 = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = 4.0, posy = -13.5, posz = 3.4, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = 4.0, posy = -13.5, posz = 3.4, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2dgunl = { - lightType = 'point', - pieceName = 'bigguncyl', - lightConfig = { posx = 5, posy = 0, posz = 0, radius = 10.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 0.85, b = 0.4, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "point", + pieceName = "bigguncyl", + lightConfig = { posx = 5, posy = 0, posz = 0, radius = 10.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 0.85, b = 0.4, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, arm2dgunr = { - lightType = 'point', - pieceName = 'bigguncyl', - lightConfig = { posx = -5, posy = 0, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 0.85, b = 0.4, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "point", + pieceName = "bigguncyl", + lightConfig = { posx = -5, posy = 0, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 0.85, b = 0.4, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, -- arm2gunlight1 = { -- lightType = 'point', @@ -16274,43 +10264,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, arm2gunlightred = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = -0.1, posy = -13.8, posz = 8.3, radius = 1.6, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 0.085, b = 0.03, a = 1.6, - modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = -0.1, posy = -13.8, posz = 8.3, radius = 1.6, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 0.085, b = 0.03, a = 1.6, modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight1 = { - lightType = 'beam', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -5.7, posz = 4.5, radius = 0.6, - pos2x = 2.1, pos2y = -5.7, pos2z = 3.55, - color2r = -1, color2g = -1, color2b = -1, colortime = 20, - r = 1, g = 0.6, b = 0.1, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -5.7, posz = 4.5, radius = 0.6, pos2x = 2.1, pos2y = -5.7, pos2z = 3.55, color2r = -1, color2g = -1, color2b = -1, colortime = 20, r = 1, g = 0.6, b = 0.1, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight2 = { - lightType = 'beam', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -7.0, posz = 4.5, radius = 0.6, - pos2x = 2.1, pos2y = -7.0, pos2z = 3.55, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.45, b = 0.1, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -7.0, posz = 4.5, radius = 0.6, pos2x = 2.1, pos2y = -7.0, pos2z = 3.55, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.45, b = 0.1, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight3 = { - lightType = 'beam', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -8.3, posz = 4.5, radius = 0.6, - pos2x = 2.1, pos2y = -8.3, pos2z = 3.55, - color2r = -1, color2g = -1, color2b = -1, colortime = 40, - r = 1, g = 0.2, b = 0.1, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -8.3, posz = 4.5, radius = 0.6, pos2x = 2.1, pos2y = -8.3, pos2z = 3.55, color2r = -1, color2g = -1, color2b = -1, colortime = 40, r = 1, g = 0.2, b = 0.1, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- arm2gunsidelight2 = { @@ -16332,43 +10303,27 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, chest1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 7.5, posy = 7.5, posz = 4.5, radius = 5, - color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = 120, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.15, specular = 0.1, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 7.5, posy = 7.5, posz = 4.5, radius = 5, color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = 120, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.15, specular = 0.1, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, chest2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -7.5, posy = 7.5, posz = 4.5, radius = 5, - color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = 110, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.15, specular = 0.1, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -7.5, posy = 7.5, posz = 4.5, radius = 5, color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = 110, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.15, specular = 0.1, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 23, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 23, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcomlvl3'] = { + ["armcomlvl3"] = { headlightarmcom = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 420, - dirx = 0, diry = -0.25, dirz = 1, theta = 0.25999999, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 420, dirx = 0, diry = -0.25, dirz = 1, theta = 0.25999999, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- buildlight1 = { -- this is the lightname -- lightType = 'cone', @@ -16389,103 +10344,59 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, buildlight1 = { -- this is the lightname - lightType = 'point', - pieceName = 'armhexl_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'point', - pieceName = 'armhexl2_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armhexl2_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, radarblip = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 0, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.33, - modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 0, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.33, modelfactor = 0.1, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 11, posz = -7, radius = 20, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.6, a = 0.3, - modelfactor = 0.15, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 11, posz = -7, radius = 20, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.6, a = 0.3, modelfactor = 0.15, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder1 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -8.5, posy = 0, posz = 0, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -8.5, posy = 0, posz = 0, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder2 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 8.5, posy = 0, posz = 0, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 8.5, posy = 0, posz = 0, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip1 = { - lightType = 'point', - pieceName = 'lthigh', - lightConfig = { posx = -14, posy = 6, posz = -4, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthigh", + lightConfig = { posx = -14, posy = 6, posz = -4, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip2 = { - lightType = 'point', - pieceName = 'rthigh', - lightConfig = { posx = 14, posy = 6, posz = -4, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthigh", + lightConfig = { posx = 14, posy = 6, posz = -4, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 1, posz = 6.5, radius = 10, - color2r = 1, color2g = 1, color2b = 0.33, colortime = 0, - r = 1, g = 1, b = 0.33, a = 0.12, - modelfactor = 0.2, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 1, posz = 6.5, radius = 10, color2r = 1, color2g = 1, color2b = 0.33, colortime = 0, r = 1, g = 1, b = 0.33, a = 0.12, modelfactor = 0.2, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'rloarm', - lightConfig = { posx = 0, posy = -12.25, posz = 0, radius = 15, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.55, a = 0.14, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rloarm", + lightConfig = { posx = 0, posy = -12.25, posz = 0, radius = 15, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.55, a = 0.14, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2 = { - lightType = 'point', - pieceName = 'bigguncyl', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 18, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.4, a = 0.36, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bigguncyl", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 18, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.4, a = 0.36, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- arm2gunlight1 = { -- lightType = 'point', @@ -16497,70 +10408,42 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, arm2gunlightred = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = -0.1, posy = -13.8, posz = 8.3, radius = 1.6, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 0.085, b = 0.03, a = 1.6, - modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = -0.1, posy = -13.8, posz = 8.3, radius = 1.6, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 0.085, b = 0.03, a = 1.6, modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight1 = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -7.0, posz = 4, radius = 0.6, - color2r = 1, color2g = 0.85, color2b = 0.3, colortime = 20, - r = -0, g = 0, b = 0, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -7.0, posz = 4, radius = 0.6, color2r = 1, color2g = 0.85, color2b = 0.3, colortime = 20, r = -0, g = 0, b = 0, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight2 = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -8.3, posz = 4, radius = 0.6, - color2r = 0, color2g = 0, color2b = 0, colortime = 40, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -8.3, posz = 4, radius = 0.6, color2r = 0, color2g = 0, color2b = 0, colortime = 40, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2gunsidelight3 = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 1.9, posy = -5.7, posz = 4, radius = 0.6, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 1.9, posy = -5.7, posz = 4, radius = 0.6, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chest1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 7.5, posy = 7, posz = 6, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 7.5, posy = 7, posz = 6, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chest2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -7.5, posy = 7, posz = 6, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -7.5, posy = 7, posz = 6, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 23, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 23, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcomboss'] = { + ["armcomboss"] = { --headlightarmcom = { -- lightType = 'cone', -- pieceName = 'head', @@ -16571,367 +10454,207 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, backpack = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 38, posz = -20, radius = 60, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.6, a = 0.3, - modelfactor = 0.15, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 38, posz = -20, radius = 60, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.6, a = 0.3, modelfactor = 0.15, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder1 = { - lightType = 'point', - pieceName = 'emit_shoulder1', - lightConfig = { posx = -5, posy = 6, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_shoulder1", + lightConfig = { posx = -5, posy = 6, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder2 = { - lightType = 'point', - pieceName = 'emit_shoulder2', - lightConfig = { posx = 5, posy = 6, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_shoulder2", + lightConfig = { posx = 5, posy = 6, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip1 = { - lightType = 'point', - pieceName = 'emit_hip1', - lightConfig = { posx = -5, posy = 6, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_hip1", + lightConfig = { posx = -5, posy = 6, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hip2 = { - lightType = 'point', - pieceName = 'emit_hip2', - lightConfig = { posx = 1.5, posy = 2, posz = 0, radius = 9, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.95, b = 0.55, a = 0.065, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_hip2", + lightConfig = { posx = 1.5, posy = 2, posz = 0, radius = 9, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.95, b = 0.55, a = 0.065, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 4, posz = 23, radius = 32, - color2r = 1, color2g = 1, color2b = 0.33, colortime = 0, - r = 1, g = 1, b = 0.33, a = 0.11, - modelfactor = 0.2, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 4, posz = 23, radius = 32, color2r = 1, color2g = 1, color2b = 0.33, colortime = 0, r = 1, g = 1, b = 0.33, a = 0.11, modelfactor = 0.2, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'emit_arm1', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.55, a = 0.14, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_arm1", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.55, a = 0.14, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2 = { - lightType = 'point', - pieceName = 'emit_arm2', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 52, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 0.85, b = 0.4, a = 0.3, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_arm2", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 52, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 0.85, b = 0.4, a = 0.3, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chest1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 25, posy = 22, posz = 18, radius = 36, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 25, posy = 22, posz = 18, radius = 36, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chest2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -25, posy = 22, posz = 18, radius = 36, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -25, posy = 22, posz = 18, radius = 36, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 60, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 60, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['scavengerbossv4_normal'] = { + ["scavengerbossv4_normal"] = { vortex1 = { - lightType = 'point', - pieceName = 'vortex3', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.75, g = 0.1, b = 1, a = 0.5, - modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "vortex3", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.75, g = 0.1, b = 1, a = 0.5, modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, vortex2 = { - lightType = 'point', - pieceName = 'vortex2', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 0.057, b = 0.75, a = 0.2, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "vortex2", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 0.057, b = 0.75, a = 0.2, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, leftarmgunflareglow = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 0, posy = -93, posz = 6.5, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 0.057, b = 0.75, a = 0.7, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 0, posy = -93, posz = 6.5, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 0.057, b = 0.75, a = 0.7, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, backpackglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 48, posz = -35, radius = 35, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 0.057, b = 0.75, a = 0.6, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 12, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 48, posz = -35, radius = 35, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 0.057, b = 0.75, a = 0.6, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 12, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, --TURBO weapon lights turbominigunspot = { --shows when TURBO minigun - lightType = 'cone', - pieceName = 'laserflarelight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, - dirx = 0.001, diry = -0.99, dirz = 0.001, theta = 0.36, - r = 0.75, g = 0.1, b = 1, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "laserflarelight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, dirx = 0.001, diry = -0.99, dirz = 0.001, theta = 0.36, r = 0.75, g = 0.1, b = 1, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turbominigunlighthotpoint = { - lightType = 'point', - pieceName = 'laserflarelight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 0.057, b = 0.75, a = 0.8, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "laserflarelight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 0.057, b = 0.75, a = 0.8, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, turboshotgunspot = { --shows when TURBO shotgun - lightType = 'cone', - pieceName = 'lflare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, - dirx = 0.001, diry = 0.001, dirz = 0.99, theta = 0.36, - r = 0.75, g = 0.1, b = 1, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lflare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, dirx = 0.001, diry = 0.001, dirz = 0.99, theta = 0.36, r = 0.75, g = 0.1, b = 1, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turbomissilespot = { --shows when TURBO missile - lightType = 'cone', - pieceName = 'misflare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, - dirx = 0.001, diry = 0.001, dirz = 0.99, theta = 0.36, - r = 0.75, g = 0.1, b = 1, a = 0.9, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "misflare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 420, dirx = 0.001, diry = 0.001, dirz = 0.99, theta = 0.36, r = 0.75, g = 0.1, b = 1, a = 0.9, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turbomissilehotpoint = { - lightType = 'point', - pieceName = 'misflare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.6, g = 0.057, b = 0.75, a = 0.8, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "misflare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.6, g = 0.057, b = 0.75, a = 0.8, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, turbolrpc1 = { - lightType = 'point', - pieceName = 'railflarer', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.75, g = 0.1, b = 1, a = 0.9, - modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 1, selfshadowing = 1}, + lightType = "point", + pieceName = "railflarer", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.75, g = 0.1, b = 1, a = 0.9, modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 1, selfshadowing = 1 }, }, turbolrpc2 = { - lightType = 'point', - pieceName = 'railflarel', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.75, g = 0.1, b = 1, a = 0.9, - modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "railflarel", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.75, g = 0.1, b = 1, a = 0.9, modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, eaterbeamactivelight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 300, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.75, g = 0.1, b = 1, a = 0.8, - modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 1, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 300, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.75, g = 0.1, b = 1, a = 0.8, modelfact3r = 0.1, specular = 1.6, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 1, selfshadowing = 0 }, }, - }, - ['legcom'] = { + ["legcom"] = { headlightcomteam = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 1, posz = -1.5, radius = 85, - dirx = 0, diry = -0.19, dirz = 1, theta = 0.17, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 1, posz = -1.5, radius = 85, dirx = 0, diry = -0.19, dirz = 1, theta = 0.17, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, headlightcomwhite = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = -1, posy = 1, posz = -1.5, radius = 220, - dirx = 0, diry = -0.19, dirz = 1, theta = 0.18, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = -1, posy = 1, posz = -1.5, radius = 220, dirx = 0, diry = -0.19, dirz = 1, theta = 0.18, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, eyesbeam = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0.8, posz = 5.4, radius = 1.1, - pos2x = 0, pos2y = -0.7, pos2z = 5.2, - color2r = 0.7, color2g = 0.5, color2b = 0.1, colortime = 0, - r = -1.25, g = 0.95, b = 0.55, a = 1.8, - modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = 0, posy = 0.8, posz = 5.4, radius = 1.1, pos2x = 0, pos2y = -0.7, pos2z = 5.2, color2r = 0.7, color2g = 0.5, color2b = 0.1, colortime = 0, r = -1.25, g = 0.95, b = 0.55, a = 1.8, modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, radarblip = { - lightType = 'point', - pieceName = 'aabarrel', - lightConfig = { posx = 0, posy = 1, posz = 2.4, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, - r = 0, g = 1, b = 0, a = 1.0, - modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "aabarrel", + lightConfig = { posx = 0, posy = 1, posz = 2.4, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, r = 0, g = 1, b = 0, a = 1.0, modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, legcomdgunlightred = { - lightType = 'point', - pieceName = 'barreldgun', - lightConfig = { posx = 0, posy = 0, posz = 8.8, radius = 2.55, - color2r = 0, color2g = 0, color2b = 0, colortime = 40, - r = 1, g = 0.25, b = 0.03, a = 1.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barreldgun", + lightConfig = { posx = 0, posy = 0, posz = 8.8, radius = 2.55, color2r = 0, color2g = 0, color2b = 0, colortime = 40, r = 1, g = 0.25, b = 0.03, a = 1.6, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, legcombuildlight1 = { - lightType = 'point', - pieceName = 'rhand', - lightConfig = { posx = -2.5, posy = -5.4, posz = 19, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rhand", + lightConfig = { posx = -2.5, posy = -5.4, posz = 19, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2dgunr = { - lightType = 'point', - pieceName = 'lhand', - lightConfig = { posx = 2.9, posy = -5.1, posz = 5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 0.85, b = 0.4, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "point", + pieceName = "lhand", + lightConfig = { posx = 2.9, posy = -5.1, posz = 5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 0.85, b = 0.4, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, legcombackpacksglow = { - lightType = 'point', - pieceName = 'pack', - lightConfig = { posx = 0, posy = 36, posz = -13, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 0, g = 0.9, b = 0.2, a = 0.33, - modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "pack", + lightConfig = { posx = 0, posy = 36, posz = -13, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 0, g = 0.9, b = 0.2, a = 0.33, modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, legcomlaser = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, - r = 1, g = 0.85, b = 0, a = 0.8, - modelfactor = 0.1, specular = 1, scattering = 0.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, r = 1, g = 0.85, b = 0, a = 0.8, modelfactor = 0.1, specular = 1, scattering = 0.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, legcomnanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 24, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.66, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 24, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.66, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcom'] = { + ["corcom"] = { headlightcorcoml = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0.5, posy = 4, posz = -4, radius = 200, - dirx = 0.14, diry = -0.21, dirz = 1, theta = 0.15, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0.5, posy = 4, posz = -4, radius = 200, dirx = 0.14, diry = -0.21, dirz = 1, theta = 0.15, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, headlightcorcomr = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = -0.5, posy = 4, posz = -4, radius = 200, - dirx = -0.14, diry = -0.21, dirz = 1, theta = 0.15, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 6}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = -0.5, posy = 4, posz = -4, radius = 200, dirx = -0.14, diry = -0.21, dirz = 1, theta = 0.15, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.1, specular = 0.5, scattering = 3.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 6 }, }, headlightteaml = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 4, posz = -4, radius = 85, - dirx = 0.130, diry = -0.21, dirz = 1, theta = 0.14, - r = -1, g = 1, b = 1, a = 1.75, - modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 4, posz = -4, radius = 85, dirx = 0.130, diry = -0.21, dirz = 1, theta = 0.14, r = -1, g = 1, b = 1, a = 1.75, modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightteamr = { - lightType = 'cone', - pieceName = 'head', - lightConfig = { posx = 0, posy = 4, posz = -4, radius = 85, - dirx = -0.130, diry = -0.21, dirz = 1, theta = 0.14, - r = -1, g = 1, b = 1, a = 1.75, - modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "head", + lightConfig = { posx = 0, posy = 4, posz = -4, radius = 85, dirx = -0.130, diry = -0.21, dirz = 1, theta = 0.14, r = -1, g = 1, b = 1, a = 1.75, modelfactor = 0.1, specular = 0.5, scattering = 2.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headtopbeam1 = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = -2.5, posy = 6.1, posz = -2.73, radius = 0.8, - pos2x = -3.2, pos2y = 6.1, pos2z = -2.73, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1, g = 0.9, b = 0.25, a = 0.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = -2.5, posy = 6.1, posz = -2.73, radius = 0.8, pos2x = -3.2, pos2y = 6.1, pos2z = -2.73, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1, g = 0.9, b = 0.25, a = 0.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headtopbeam2 = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = 2.5, posy = 6.1, posz = -2.73, radius = 0.8, - pos2x = 3.2, pos2y = 6.1, pos2z = -2.73, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1, g = 0.9, b = 0.25, a = 0.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = 2.5, posy = 6.1, posz = -2.73, radius = 0.8, pos2x = 3.2, pos2y = 6.1, pos2z = -2.73, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1, g = 0.9, b = 0.25, a = 0.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headlightcorcomold = { -- lightType = 'cone', @@ -16961,81 +10684,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, corbuildlight = { - lightType = 'point', - pieceName = 'cagelight_emit', - lightConfig = { posx = 1, posy = 2, posz = 0, radius = 7.6, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1.2, g = 0.89, b = 0.1, a = 1, - modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "cagelight_emit", + lightConfig = { posx = 1, posy = 2, posz = 0, radius = 7.6, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1.2, g = 0.89, b = 0.1, a = 1, modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, dgunlightred = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 0.2, posy = 1.3, posz = 16.0, radius = 2.55, - color2r = 0, color2g = 0, color2b = 0, colortime = 40, - r = 1, g = 0.085, b = 0.03, a = 1.6, - modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 0.2, posy = 1.3, posz = 16.0, radius = 2.55, color2r = 0, color2g = 0, color2b = 0, colortime = 40, r = 1, g = 0.085, b = 0.03, a = 1.6, modelfactor = 0.15, specular = 0.5, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, dgunredglow = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 0, posy = -5, posz = 18, radius = 3.5, - color2r = 0.46, color2g = 0.012, color2b = 0.03, colortime = 120, - r = 1, g = 0.15, b = 0.06, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 0, posy = -5, posz = 18, radius = 3.5, color2r = 0.46, color2g = 0.012, color2b = 0.03, colortime = 120, r = 1, g = 0.15, b = 0.06, a = 1.5, modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, dgunburn = { - lightType = 'point', - pieceName = 'biggun', - lightConfig = { posx = 0, posy = -5, posz = 17, radius = 3, - dirx = 0, diry = 0, dirz = 0.25, theta = -1.5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 14, - r = 0.95, g = 0.66, b = 0.07, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "biggun", + lightConfig = { posx = 0, posy = -5, posz = 17, radius = 3, dirx = 0, diry = 0, dirz = 0.25, theta = -1.5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 14, r = 0.95, g = 0.66, b = 0.07, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cornanobeam1 = { - lightType = 'beam', - pieceName = 'nanol1', - lightConfig = { posx = 0.1, posy = 0.1, posz = 0, radius = 1.8, - pos2x = 0.55, pos2y = 0.55, pos2z = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "nanol1", + lightConfig = { posx = 0.1, posy = 0.1, posz = 0, radius = 1.8, pos2x = 0.55, pos2y = 0.55, pos2z = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cornanobeam2 = { - lightType = 'beam', - pieceName = 'nanol1', - lightConfig = { posx = -6.6, posy = 0.1, posz = 0, radius = 1.8, - pos2x = -7.1, pos2y = 0.55, pos2z = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "nanol1", + lightConfig = { posx = -6.6, posy = 0.1, posz = 0, radius = 1.8, pos2x = -7.1, pos2y = 0.55, pos2z = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cornanobeam3 = { - lightType = 'beam', - pieceName = 'nanol1', - lightConfig = { posx = 0.1, posy = -6.6, posz = 0, radius = 1.8, - pos2x = 0.55, pos2y = -7.1, pos2z = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "nanol1", + lightConfig = { posx = 0.1, posy = -6.6, posz = 0, radius = 1.8, pos2x = 0.55, pos2y = -7.1, pos2z = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cornanobeam4 = { - lightType = 'beam', - pieceName = 'nanol1', - lightConfig = { posx = -6.6, posy = -6.6, posz = 0, radius = 1.8, - pos2x = -7.1, pos2y = -7.1, pos2z = -1.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 0.85, b = 0.3, a = 1.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "nanol1", + lightConfig = { posx = -6.6, posy = -6.6, posz = 0, radius = 1.8, pos2x = -7.1, pos2y = -7.1, pos2z = -1.8, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 0.85, b = 0.3, a = 1.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- backpack1 = { -- lightType = 'point', @@ -17056,13 +10742,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 5}, -- }, backpacksglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 22, posz = -12.9, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.80, b = 0.25, a = 0.33, - modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 22, posz = -12.9, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.80, b = 0.25, a = 0.33, modelfactor = 0.15, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- shoulder1 = { -- lightType = 'point', @@ -17074,24 +10756,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, shoulder1beam = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -7.7, posy = 17, posz = 0, radius = 3, - pos2x = -11, pos2y = 17, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1, g = 0.25, b = 0.25, a = 0.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -7.7, posy = 17, posz = 0, radius = 3, pos2x = -11, pos2y = 17, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1, g = 0.25, b = 0.25, a = 0.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder2beam = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 7.7, posy = 17, posz = 0, radius = 3, - pos2x = 11, pos2y = 17, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1, g = 0.25, b = 0.25, a = 0.8, - modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 7.7, posy = 17, posz = 0, radius = 3, pos2x = 11, pos2y = 17, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1, g = 0.25, b = 0.25, a = 0.8, modelfactor = 0.15, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- shoulder2 = { -- lightType = 'point', @@ -17112,24 +10784,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyerightbeam = { - lightType = 'beam', - pieceName = 'reye', - lightConfig = { posx = -3.0, posy = 0.15, posz = -0.39, radius = 1.28, - pos2x = 0, pos2y = -0.15, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 0.35, b = 0.20, a = 1.8, - modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "reye", + lightConfig = { posx = -3.0, posy = 0.15, posz = -0.39, radius = 1.28, pos2x = 0, pos2y = -0.15, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 0.35, b = 0.20, a = 1.8, modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeleftbeam = { - lightType = 'beam', - pieceName = 'leye', - lightConfig = { posx = 3.0, posy = 0.15, posz = -0.39, radius = 1.28, - pos2x = 0, pos2y = -0.15, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 0.35, b = 0.20, a = 1.8, - modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "leye", + lightConfig = { posx = 3.0, posy = 0.15, posz = -0.39, radius = 1.28, pos2x = 0, pos2y = -0.15, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 0.35, b = 0.20, a = 1.8, modelfactor = 0.25, specular = 0.1, scattering = 3.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --xmas_nose = { -- lightType = 'point', @@ -17150,25 +10812,17 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, laser = { - lightType = 'point', - pieceName = 'lfirept', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0.75, color2g = 0.6, color2b = 0, colortime = 45, - r = 1, g = 0.85, b = 0, a = 0.14, - modelfactor = 0.1, specular = 1, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfirept", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0.75, color2g = 0.6, color2b = 0, colortime = 45, r = 1, g = 0.85, b = 0, a = 0.14, modelfactor = 0.1, specular = 1, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nanospray', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.75, - modelfactor = 0.5, specular = 0.2, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanospray", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.75, modelfactor = 0.5, specular = 0.2, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcomboss'] = { + ["corcomboss"] = { --headlightcorcom = { -- lightType = 'cone', -- pieceName = 'head', @@ -17179,235 +10833,128 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, backpack1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -12, posy = 55, posz = -23, radius = 70, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.75, a = 0.15, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -12, posy = 55, posz = -23, radius = 70, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.75, a = 0.15, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 12, posy = 55, posz = -23, radius = 70, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.75, a = 0.15, - modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 12, posy = 55, posz = -23, radius = 70, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.75, a = 0.15, modelfactor = 0.15, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -27, posy = 55, posz = 0, radius = 32, - color2r = 1, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 0.25, b = 0.25, a = 0.11, - modelfactor = 0.15, specular = 0.5, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -27, posy = 55, posz = 0, radius = 32, color2r = 1, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 0.25, b = 0.25, a = 0.11, modelfactor = 0.15, specular = 0.5, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulder2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 27, posy = 55, posz = 0, radius = 32, - color2r = 1, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 0.25, b = 0.25, a = 0.11, - modelfactor = 0.15, specular = 0.5, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 27, posy = 55, posz = 0, radius = 32, color2r = 1, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 0.25, b = 0.25, a = 0.11, modelfactor = 0.15, specular = 0.5, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -8.5, posy = 8, posz = 20, radius = 25, - color2r = 1, color2g = 0.25, color2b = 0.25, colortime = 0, - r = 1, g = 0.25, b = 0.25, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -8.5, posy = 8, posz = 20, radius = 25, color2r = 1, color2g = 0.25, color2b = 0.25, colortime = 0, r = 1, g = 0.25, b = 0.25, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 8.5, posy = 8, posz = 20, radius = 25, - color2r = 1, color2g = 0.25, color2b = 0.25, colortime = 0, - r = 1, g = 0.25, b = 0.25, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 8.5, posy = 8, posz = 20, radius = 25, color2r = 1, color2g = 0.25, color2b = 0.25, colortime = 0, r = 1, g = 0.25, b = 0.25, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laser = { - lightType = 'point', - pieceName = 'lfirept', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 0.75, color2g = 0.6, color2b = 0, colortime = 45, - r = 1, g = 0.85, b = 0, a = 0.14, - modelfactor = 0.1, specular = 1, scattering = 1.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfirept", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 0.75, color2g = 0.6, color2b = 0, colortime = 45, r = 1, g = 0.85, b = 0, a = 0.14, modelfactor = 0.1, specular = 1, scattering = 1.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nanospray', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 60, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanospray", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 60, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armbull'] = { + ["armbull"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.8, posy = 10.5, posz = 17, radius = 7, - color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.25, specular = 0.4, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.8, posy = 10.5, posz = 17, radius = 7, color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.25, specular = 0.4, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.8, posy = 10.5, posz = 17, radius = 7, - color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, - r = -1, g = 1, b = 1, a = 1.0, - modelfactor = 0.25, specular = 0.4, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.8, posy = 10.5, posz = 17, radius = 7, color2r = 0.7, color2g = 0.7, color2b = 0.7, colortime = -1.5, r = -1, g = 1, b = 1, a = 1.0, modelfactor = 0.25, specular = 0.4, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightleft = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 8, posy = 11, posz = 3, radius = 66, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.32, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 8, posy = 11, posz = 3, radius = 66, dirx = 0, diry = -0.08, dirz = 1, theta = 0.32, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightright = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = -8, posy = 11, posz = 3, radius = 66, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.32, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = -8, posy = 11, posz = 3, radius = 66, dirx = 0, diry = -0.08, dirz = 1, theta = 0.32, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, toplight = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 8, posz = 5, radius = 5.5, - color2r = 1, color2g = 1, color2b = 1, colortime = -2, - r = -1, g = 1, b = 1, a = 2.5, - modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 8, posz = 5, radius = 5.5, color2r = 1, color2g = 1, color2b = 1, colortime = -2, r = -1, g = 1, b = 1, a = 2.5, modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteaml1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 8.2, posy = 16.3, posz = 12.0, radius = 1.1, - pos2x = 12.3, pos2y = 16.3, pos2z = 12.0, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 8.2, posy = 16.3, posz = 12.0, radius = 1.1, pos2x = 12.3, pos2y = 16.3, pos2z = 12.0, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteaml2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 8.2, posy = 16.3, posz = 7.4, radius = 1.1, - pos2x = 12.3, pos2y = 16.3, pos2z = 7.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 8.2, posy = 16.3, posz = 7.4, radius = 1.1, pos2x = 12.3, pos2y = 16.3, pos2z = 7.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteaml3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 8.2, posy = 16.3, posz = 2.8, radius = 1.1, - pos2x = 12.3, pos2y = 16.3, pos2z = 2.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 8.2, posy = 16.3, posz = 2.8, radius = 1.1, pos2x = 12.3, pos2y = 16.3, pos2z = 2.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteamr1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -8.2, posy = 16.3, posz = 12.0, radius = 1.1, - pos2x = -12.3, pos2y = 16.3, pos2z = 12.0, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -8.2, posy = 16.3, posz = 12.0, radius = 1.1, pos2x = -12.3, pos2y = 16.3, pos2z = 12.0, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteamr2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -8.2, posy = 16.3, posz = 7.4, radius = 1.1, - pos2x = -12.3, pos2y = 16.3, pos2z = 7.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -8.2, posy = 16.3, posz = 7.4, radius = 1.1, pos2x = -12.3, pos2y = 16.3, pos2z = 7.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodyteamr3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -8.2, posy = 16.3, posz = 2.8, radius = 1.1, - pos2x = -12.3, pos2y = 16.3, pos2z = 2.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -8.2, posy = 16.3, posz = 2.8, radius = 1.1, pos2x = -12.3, pos2y = 16.3, pos2z = 2.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheell = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 20.5, posy = 6.8, posz = -14.6, radius = 1.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 20.5, posy = 6.8, posz = -14.6, radius = 1.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wheelr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -20.5, posy = 6.8, posz = -14.6, radius = 1.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -20.5, posy = 6.8, posz = -14.6, radius = 1.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - - }, - ['armcroc'] = { + ["armcroc"] = { frontlighteye = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3, posy = 18, posz = 19, radius = 2.8, - pos2x = -3, pos2y = 18, pos2z = 19, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3, posy = 18, posz = 19, radius = 2.8, pos2x = -3, pos2y = 18, pos2z = 19, color2r = -1, color2g = -1, color2b = -1, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteam1 = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 1.2, posy = 5.5, posz = 7.2, radius = 4.0, - pos2x = -1.2, pos2y = 5.5, pos2z = 7.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 1.2, posy = 5.5, posz = 7.2, radius = 4.0, pos2x = -1.2, pos2y = 5.5, pos2z = 7.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topteam2 = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 1.2, posy = 5.5, posz = -7.2, radius = 4.0, - pos2x = -1.2, pos2y = 5.5, pos2z = -7.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = -1, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 1.2, posy = 5.5, posz = -7.2, radius = 4.0, pos2x = -1.2, pos2y = 5.5, pos2z = -7.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = -1, g = 1, b = 0.2, a = 1.2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front = { -- lightType = 'point', @@ -17419,204 +10966,118 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armconsul'] = { + ["armconsul"] = { front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.66, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.66, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 4, posz = 4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.66, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 4, posz = 4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.66, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 4, posz = 4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.66, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 4, posz = 4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.66, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11, posy = 4, posz = -7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.66, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 4, posz = -7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.66, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 4, posz = -7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.66, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 4, posz = -7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.66, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'lnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "lnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'rnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "rnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflasharml1 = { - lightType = 'point', - pieceName = 'larm2', - lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "larm2", + lightConfig = { posx = 0, posy = 1.5, posz = 0, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflasharml2 = { - lightType = 'point', - pieceName = 'larm2', - lightConfig = { posx = 3.7, posy = 1.5, posz = 10.8, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "larm2", + lightConfig = { posx = 3.7, posy = 1.5, posz = 10.8, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflasharmr1 = { - lightType = 'point', - pieceName = 'rarm2', - lightConfig = { posx = 0, posy = 2.6, posz = 0, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rarm2", + lightConfig = { posx = 0, posy = 2.6, posz = 0, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflasharmr2 = { - lightType = 'point', - pieceName = 'rarm2', - lightConfig = { posx = -3.7, posy = 2.6, posz = 10.8, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rarm2", + lightConfig = { posx = -3.7, posy = 2.6, posz = 10.8, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcan'] = { + ["corcan"] = { footfront1 = { - lightType = 'point', - pieceName = 'lfoot', - lightConfig = { posx = 1, posy = -2.3, posz = 6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfoot", + lightConfig = { posx = 1, posy = -2.3, posz = 6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footfront2 = { - lightType = 'point', - pieceName = 'rfoot', - lightConfig = { posx = -1, posy = -2.3, posz = 6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfoot", + lightConfig = { posx = -1, posy = -2.3, posz = 6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footback1 = { - lightType = 'point', - pieceName = 'lfoot', - lightConfig = { posx = 1, posy = -2.3, posz = -6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfoot", + lightConfig = { posx = 1, posy = -2.3, posz = -6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, footback2 = { - lightType = 'point', - pieceName = 'rfoot', - lightConfig = { posx = -1, posy = -2.3, posz = -6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfoot", + lightConfig = { posx = -1, posy = -2.3, posz = -6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamfootleft = { - lightType = 'point', - pieceName = 'lfoot', - lightConfig = { posx = 4, posy = 8.8, posz = 1, radius = 2, - dirx = 0, diry = 0, dirz = 1, theta = -1.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfoot", + lightConfig = { posx = 4, posy = 8.8, posz = 1, radius = 2, dirx = 0, diry = 0, dirz = 1, theta = -1.7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamfootright = { - lightType = 'point', - pieceName = 'rfoot', - lightConfig = { posx = -4, posy = 8.8, posz = 1, radius = 2, - dirx = 0, diry = 0, dirz = 1, theta = -1.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfoot", + lightConfig = { posx = -4, posy = 8.8, posz = 1, radius = 2, dirx = 0, diry = 0, dirz = 1, theta = -1.7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, head1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -12.7, posy = 3.5, posz = 0, radius = 3, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = -1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.9, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -12.7, posy = 3.5, posz = 0, radius = 3, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = -1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.9, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, head2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 12.7, posy = 3.5, posz = 0, radius = 3, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = -1, g = 0.2, b = 0.2, a = 1, - modelfactor = 0.9, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 12.7, posy = 3.5, posz = 0, radius = 3, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = -1, g = 0.2, b = 0.2, a = 1, modelfactor = 0.9, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headback = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 7, posz = -11.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 7, posz = -11.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 0.4, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corspy'] = { + ["corspy"] = { eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 19, posz = 8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 19, posz = 8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormando'] = { + ["cormando"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'head', @@ -17636,14 +11097,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, flasheyes1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 3, posz = 3, radius = 1.0, - dirx = 1, diry = 0, dirz = 0, theta = -3.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 3, posz = 3, radius = 1.0, dirx = 1, diry = 0, dirz = 0, theta = -3.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- flasheyes2 = { -- lightType = 'point', @@ -17656,263 +11112,147 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, cloaklightred = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9, posz = 0, radius = 9, - color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.5, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9, posz = 0, radius = 9, color2r = 0.6, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.5, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -8, posy = 10, posz = -3, radius = 5, - color2r = 0, color2g = 0.4, color2b = 0, colortime = 60, - r = 0, g = 1, b = 0, a = 0.95, - modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -8, posy = 10, posz = -3, radius = 5, color2r = 0, color2g = 0.4, color2b = 0, colortime = 60, r = 0, g = 1, b = 0, a = 0.95, modelfactor = 0.6, specular = 0.6, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 2, posz = 7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 2, posz = 7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormandot4'] = { + ["cormandot4"] = { eyes1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 4, posz = 7, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 4, posz = 7, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 7, posz = 11, radius = 20, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 60, - r = 1, g = 1, b = 0.4, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 7, posz = 11, radius = 20, color2r = 1, color2g = 1, color2b = 0.3, colortime = 60, r = 1, g = 1, b = 0.4, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lnanoflareglow = { - lightType = 'point', - pieceName = 'lnano', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 60, - r = 0.7, g = 0.7, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lnano", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 1, color2g = 1, color2b = 0.3, colortime = 60, r = 0.7, g = 0.7, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corphantom'] = { + ["corphantom"] = { eyes1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 0, posy = 19, posz = 4, radius = 20, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.12, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 0, posy = 19, posz = 4, radius = 20, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.12, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cortoast'] = { + ["cortoast"] = { doorlight1a = { - lightType = 'beam', - pieceName = 'door1', - lightConfig = { posx = 2.9, posy = 1.2, posz = 1.8, radius = 1.4, - pos2x = 2.9, pos2y = 1.2, pos2z = 4.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "door1", + lightConfig = { posx = 2.9, posy = 1.2, posz = 1.8, radius = 1.4, pos2x = 2.9, pos2y = 1.2, pos2z = 4.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, doorlight1b = { - lightType = 'beam', - pieceName = 'door1', - lightConfig = { posx = 2.9, posy = 1.2, posz = -1.8, radius = 1.4, - pos2x = 2.9, pos2y = 1.2, pos2z = -4.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "door1", + lightConfig = { posx = 2.9, posy = 1.2, posz = -1.8, radius = 1.4, pos2x = 2.9, pos2y = 1.2, pos2z = -4.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, doorlight2a = { - lightType = 'beam', - pieceName = 'door2', - lightConfig = { posx = -2.9, posy = 1.2, posz = 1.8, radius = 1.4, - pos2x = -2.9, pos2y = 1.2, pos2z = 4.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "door2", + lightConfig = { posx = -2.9, posy = 1.2, posz = 1.8, radius = 1.4, pos2x = -2.9, pos2y = 1.2, pos2z = 4.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, doorlight2b = { - lightType = 'beam', - pieceName = 'door2', - lightConfig = { posx = -2.9, posy = 1.2, posz = -1.8, radius = 1.4, - pos2x = -2.9, pos2y = 1.2, pos2z = -4.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "door2", + lightConfig = { posx = -2.9, posy = 1.2, posz = -1.8, radius = 1.4, pos2x = -2.9, pos2y = 1.2, pos2z = -4.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corvipe'] = { + ["corvipe"] = { eyesfront = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -1, posy = 41.5, posz = 7.3, radius = 2, - pos2x = -5.5, pos2y = 41.5, pos2z = 7.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -1, posy = 41.5, posz = 7.3, radius = 2, pos2x = -5.5, pos2y = 41.5, pos2z = 7.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlock1 = { - lightType = 'beam', - pieceName = 'lock1', - lightConfig = { posx = 0.9, posy = 9.3, posz = 17.8, radius = 1.2, - pos2x = -0.9, pos2y = 9.3, pos2z = 17.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "lock1", + lightConfig = { posx = 0.9, posy = 9.3, posz = 17.8, radius = 1.2, pos2x = -0.9, pos2y = 9.3, pos2z = 17.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlock2 = { - lightType = 'beam', - pieceName = 'lock2', - lightConfig = { posx = 0.9, posy = 9.3, posz = -17.8, radius = 1.2, - pos2x = -0.9, pos2y = 9.3, pos2z = -17.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "lock2", + lightConfig = { posx = 0.9, posy = 9.3, posz = -17.8, radius = 1.2, pos2x = -0.9, pos2y = 9.3, pos2z = -17.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light1a = { - lightType = 'point', - pieceName = 'lock1', - lightConfig = { posx = 2.1, posy = 12.3, posz = -13.4, radius = 0.88, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1.5, b = 0.2, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lock1", + lightConfig = { posx = 2.1, posy = 12.3, posz = -13.4, radius = 0.88, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1.5, b = 0.2, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light1b = { - lightType = 'point', - pieceName = 'lock1', - lightConfig = { posx = -2.2, posy = 12.3, posz = -13.4, radius = 0.88, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1.5, b = 0.2, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lock1", + lightConfig = { posx = -2.2, posy = 12.3, posz = -13.4, radius = 0.88, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1.5, b = 0.2, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light2a = { - lightType = 'point', - pieceName = 'lock2', - lightConfig = { posx = 2.1, posy = 12.3, posz = 13.4, radius = 0.88, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1.5, b = 0.2, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lock2", + lightConfig = { posx = 2.1, posy = 12.3, posz = 13.4, radius = 0.88, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1.5, b = 0.2, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light2b = { - lightType = 'point', - pieceName = 'lock2', - lightConfig = { posx = -2.2, posy = 12.3, posz = 13.4, radius = 0.88, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = -1, g = 1.5, b = 0.2, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lock2", + lightConfig = { posx = -2.2, posy = 12.3, posz = 13.4, radius = 0.88, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = -1, g = 1.5, b = 0.2, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corparrow'] = { + ["corparrow"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.5, posy = 13.8, posz = 24.8, radius = 2, - pos2x = 2.5, pos2y = 13.8, pos2z = 24.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.5, posy = 13.8, posz = 24.8, radius = 2, pos2x = 2.5, pos2y = 13.8, pos2z = 24.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.3, posy = 13.8, posz = 24.8, radius = 2, - pos2x = -2.3, pos2y = 13.8, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.3, posy = 13.8, posz = 24.8, radius = 2, pos2x = -2.3, pos2y = 13.8, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2.3, posy = 13.8, posz = 24.8, radius = 2, - pos2x = 2.3, pos2y = 13.8, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2.3, posy = 13.8, posz = 24.8, radius = 2, pos2x = 2.3, pos2y = 13.8, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourceright = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -7.7, posy = 3, posz = 4.5, radius = 1.4, - pos2x = -7.71, pos2y = 2, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -7.7, posy = 3, posz = 4.5, radius = 1.4, pos2x = -7.71, pos2y = 2, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourceleft = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 7.7, posy = 3, posz = 4.5, radius = 1.4, - pos2x = 7.71, pos2y = 2, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 7.7, posy = 3, posz = 4.5, radius = 1.4, pos2x = 7.71, pos2y = 2, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -7.7, posy = 2.5, posz = 3, radius = 55, colortime = -2, - dirx = -0.4, diry = -0.3, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -7.7, posy = 2.5, posz = 3, radius = 55, colortime = -2, dirx = -0.4, diry = -0.3, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 7.7, posy = 2.5, posz = 3, radius = 55, colortime = -2, - dirx = 0.4, diry = -0.3, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 7.7, posy = 2.5, posz = 3, radius = 55, colortime = -2, dirx = 0.4, diry = -0.3, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- barrelglow = { -- lightType = 'point', @@ -17951,144 +11291,81 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cormart'] = { + ["cormart"] = { rackbl1 = { - lightType = 'point', - pieceName = 'trackbl', - lightConfig = { posx = 6, posy = -3.5, posz = -9.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbl", + lightConfig = { posx = 6, posy = -3.5, posz = -9.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rackbl2 = { - lightType = 'point', - pieceName = 'trackbl', - lightConfig = { posx = 6, posy = -2.3, posz = -6.7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbl", + lightConfig = { posx = 6, posy = -2.3, posz = -6.7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rackbl3 = { - lightType = 'point', - pieceName = 'trackbl', - lightConfig = { posx = 6, posy = -1.1, posz = -3.9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbl", + lightConfig = { posx = 6, posy = -1.1, posz = -3.9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfl1 = { - lightType = 'point', - pieceName = 'trackfl', - lightConfig = { posx = 6, posy = -3.5, posz = 9.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfl", + lightConfig = { posx = 6, posy = -3.5, posz = 9.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfl2 = { - lightType = 'point', - pieceName = 'trackfl', - lightConfig = { posx = 6, posy = -2.3, posz = 6.7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfl", + lightConfig = { posx = 6, posy = -2.3, posz = 6.7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfl3 = { - lightType = 'point', - pieceName = 'trackfl', - lightConfig = { posx = 6, posy = -1.1, posz = 3.9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfl", + lightConfig = { posx = 6, posy = -1.1, posz = 3.9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rackbr1 = { - lightType = 'point', - pieceName = 'trackbr', - lightConfig = { posx = -6, posy = -3.5, posz = -9.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbr", + lightConfig = { posx = -6, posy = -3.5, posz = -9.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rackbr2 = { - lightType = 'point', - pieceName = 'trackbr', - lightConfig = { posx = -6, posy = -2.3, posz = -6.7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbr", + lightConfig = { posx = -6, posy = -2.3, posz = -6.7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rackbr3 = { - lightType = 'point', - pieceName = 'trackbr', - lightConfig = { posx = -6, posy = -1.1, posz = -3.9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackbr", + lightConfig = { posx = -6, posy = -1.1, posz = -3.9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfr1 = { - lightType = 'point', - pieceName = 'trackfr', - lightConfig = { posx = -6, posy = -3.5, posz = 9.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfr", + lightConfig = { posx = -6, posy = -3.5, posz = 9.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfr2 = { - lightType = 'point', - pieceName = 'trackfr', - lightConfig = { posx = -6, posy = -2.3, posz = 6.7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfr", + lightConfig = { posx = -6, posy = -2.3, posz = 6.7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trackfr3 = { - lightType = 'point', - pieceName = 'trackfr', - lightConfig = { posx = -6, posy = -1.1, posz = 3.9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "trackfr", + lightConfig = { posx = -6, posy = -1.1, posz = 3.9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.35, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.5, posy = 10.5, posz = 22, radius = 2, - pos2x = 2.5, pos2y = 10.5, pos2z = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.5, posy = 10.5, posz = 22, radius = 2, pos2x = 2.5, pos2y = 10.5, pos2z = 22, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.8, posy = 10.5, posz = 22, radius = 2, - pos2x = -3.9, pos2y = 10.5, pos2z = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.8, posy = 10.5, posz = 22, radius = 2, pos2x = -3.9, pos2y = 10.5, pos2z = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 2.8, posy = 10.5, posz = 22, radius = 2, - pos2x = 3.9, pos2y = 10.5, pos2z = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 2.8, posy = 10.5, posz = 22, radius = 2, pos2x = 3.9, pos2y = 10.5, pos2z = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.05, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { @@ -18119,22 +11396,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, sleeve = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.9, posy = -1.2, posz = -1, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -2.9, posy = -1.2, posz = -1, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redlightside = { -- this is the lightname - lightType = 'cone', - pieceName = 'sleeve', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -2.9, posy = -1.2, posz = -5, radius = 20, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.20, - r = 1, g = 0.5, b = 0.5, a = 1.9, - modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -2.9, posy = -1.2, posz = -5, radius = 20, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.20, r = 1, g = 0.5, b = 0.5, a = 1.9, modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- teamlauncherleft = { -- lightType = 'point', @@ -18147,87 +11416,51 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 12, posz = 20, radius = 40, colortime = -2, - dirx = 0, diry = -0.95, dirz = 0.8, theta = 0.9, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 12, posz = 20, radius = 40, colortime = -2, dirx = 0, diry = -0.95, dirz = 0.8, theta = 0.9, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corban'] = { + ["corban"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17.8, posy = 14, posz = 5.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17.8, posy = 14, posz = 5.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13.8, posy = 14, posz = 5.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13.8, posy = 14, posz = 5.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17.8, posy = 14, posz = 5.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17.8, posy = 14, posz = 5.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13.8, posy = 14, posz = 5.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13.8, posy = 14, posz = 5.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17.8, posy = 14, posz = -12.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17.8, posy = 14, posz = -12.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13.8, posy = 14, posz = -12.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13.8, posy = 14, posz = -12.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17.8, posy = 14, posz = -12.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17.8, posy = 14, posz = -12.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13.8, posy = 14, posz = -12.5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13.8, posy = 14, posz = -12.5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- redglowlight = { -- lightType = 'point', @@ -18259,54 +11492,32 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, redglowl = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = 4, posy = 4.3, posz = 6.7, radius = 4, - pos2x = 4, pos2y = 4.3, pos2z = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0, b = 0, a = 0.7, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = 4, posy = 4.3, posz = 6.7, radius = 4, pos2x = 4, pos2y = 4.3, pos2z = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0, b = 0, a = 0.7, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowr = { - lightType = 'beam', - pieceName = 'sleeve', - lightConfig = { posx = -4, posy = 4.3, posz = 0, radius = 4, - pos2x = -4, pos2y = 4.3, pos2z = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0, b = 0, a = 0.7, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeve", + lightConfig = { posx = -4, posy = 4.3, posz = 0, radius = 4, pos2x = -4, pos2y = 4.3, pos2z = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0, b = 0, a = 0.7, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashl = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 2.7, posy = 9.5, posz = -6.6, radius = 1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 2.7, posy = 9.5, posz = -6.6, radius = 1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.9, posy = 9.5, posz = -6.6, radius = 1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -2.9, posy = 9.5, posz = -6.6, radius = 1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 180, colortime = -1.5, - dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 180, colortime = -1.5, dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['correap'] = { + ["correap"] = { -- headlight = { -- this is the lightname -- lightType = 'cone', -- pieceName = 'base', -- invalid ones will attach to the worldpos of the unit @@ -18317,95 +11528,97 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, frontright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.95, posy = 7, posz = 12, radius = 1.8, - pos2x = -4.95, pos2y = 6, pos2z = 12.75, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 1, g = 1, b = 0.2, a = 1, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.95, posy = 7, posz = 12, radius = 1.8, pos2x = -4.95, pos2y = 6, pos2z = 12.75, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 1, g = 1, b = 0.2, a = 1, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 4.95, posy = 7, posz = 12, radius = 1.8, - pos2x = 4.95, pos2y = 6, pos2z = 12.75, - color2r = 0, color2g = 0, color2b = 0, colortime = -5, - r = 1, g = 1, b = 0.2, a = 1, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 4.95, posy = 7, posz = 12, radius = 1.8, pos2x = 4.95, pos2y = 6, pos2z = 12.75, color2r = 0, color2g = 0, color2b = 0, colortime = -5, r = 1, g = 1, b = 0.2, a = 1, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 8.5, posz = 17.5, radius = 1.8, - dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 8.5, posz = 17.5, radius = 1.8, dirx = 0, diry = 0, dirz = 1, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 8.5, posz = 17.5, radius = 1.8, - dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 8.5, posz = 17.5, radius = 1.8, dirx = 0, diry = 0, dirz = 1, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 14.4, posy = 6.4, posz = -21.25, radius = 4, - pos2x = 11, pos2y = 6.4, pos2z = -21.25, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.1, b = 0.1, a = 1.9, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 14.4, + posy = 6.4, + posz = -21.25, + radius = 4, + pos2x = 11, + pos2y = 6.4, + pos2z = -21.25, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1, + g = 0.1, + b = 0.1, + a = 1.9, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.3, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, backright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -14.4, posy = 6.4, posz = -21.25, radius = 4, - pos2x = -11, pos2y = 6.4, pos2z = -21.25, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.1, b = 0.1, a = 1.9, - modelfactor = 0.5, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -14.4, + posy = 6.4, + posz = -21.25, + radius = 4, + pos2x = -11, + pos2y = 6.4, + pos2z = -21.25, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1, + g = 0.1, + b = 0.1, + a = 1.9, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.3, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, sleeveglow1 = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = 5.2, posy = 2.3, posz = 6.5, radius = 1.5, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = 5.2, posy = 2.3, posz = 6.5, radius = 1.5, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sleeveglow2 = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = -5.2, posy = 2.3, posz = 6.5, radius = 1.5, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = -5.2, posy = 2.3, posz = 6.5, radius = 1.5, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennaflash = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 1.842, posy = 15.3, posz = -5.45, radius = 1.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 1.842, posy = 15.3, posz = -5.45, radius = 1.5, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 1.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front = { -- lightType = 'point', @@ -18417,118 +11630,68 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corhrk'] = { + ["corhrk"] = { eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -2.7, posy = 13, posz = 15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.85, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -2.7, posy = 13, posz = 15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.85, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 2.7, posy = 13, posz = 15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.85, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 2.7, posy = 13, posz = 15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.85, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglowl = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = 11.3, posy = 0, posz = 12, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = 11.3, posy = 0, posz = 12, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglowr = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = -11.3, posy = 0, posz = 12, radius = 5, - color2r = -100, color2g = 0, color2b = 0, colortime = 120, - r = 0, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = -11.3, posy = 0, posz = 12, radius = 5, color2r = -100, color2g = 0, color2b = 0, colortime = 120, r = 0, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmid = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = -0.1, posy = 0.5, posz = 10.5, radius = 1.3, - color2r = -4, color2g = -4, color2b = -4, colortime = 15, - r = 1.5, g = 0, b = 0, a = 2.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = -0.1, posy = 0.5, posz = 10.5, radius = 1.3, color2r = -4, color2g = -4, color2b = -4, colortime = 15, r = 1.5, g = 0, b = 0, a = 2.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmid2 = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = -2.9, posy = 0.5, posz = 10.5, radius = 1.3, - color2r = -4, color2g = -4, color2b = -4, colortime = 25, - r = 1, g = 0, b = 0, a = 2.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = -2.9, posy = 0.5, posz = 10.5, radius = 1.3, color2r = -4, color2g = -4, color2b = -4, colortime = 25, r = 1, g = 0, b = 0, a = 2.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmid3 = { - lightType = 'point', - pieceName = 'launcher', - lightConfig = { posx = 2.6, posy = 0.5, posz = 10.5, radius = 1.3, - color2r = -4, color2g = -4, color2b = -4, colortime = 25, - r = 1, g = 0, b = 0, a = 2.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "launcher", + lightConfig = { posx = 2.6, posy = 0.5, posz = 10.5, radius = 1.3, color2r = -4, color2g = -4, color2b = -4, colortime = 25, r = 1, g = 0, b = 0, a = 2.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corak'] = { + ["corak"] = { eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -2.9, posy = 8, posz = 8, radius = 4.5, - dirx = 0, diry = 0, dirz = -0.33, theta = -1.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -2.9, posy = 8, posz = 8, radius = 4.5, dirx = 0, diry = 0, dirz = -0.33, theta = -1.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 2.9, posy = 8, posz = 8, radius = 4.5, - dirx = 0, diry = 0, dirz = -0.33, theta = -1.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 2.9, posy = 8, posz = 8, radius = 4.5, dirx = 0, diry = 0, dirz = -0.33, theta = -1.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'torso', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 3, posz = 2, radius = 50, - dirx = 0, diry = 0.03, dirz = 1, theta = 0.29, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 3, posz = 2, radius = 50, dirx = 0, diry = 0.03, dirz = 1, theta = 0.29, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 2, posz = 7.2, radius = 3, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 2, posz = 7.2, radius = 3, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teambackpack = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 9.5, posz = -8, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 1, b = 1, a = 2.5, - modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 9.5, posz = -8, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 1, b = 1, a = 2.5, modelfactor = 0.2, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- headlightglowold = { -- this is the lightname -- lightType = 'cone', @@ -18567,116 +11730,68 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corgator'] = { + ["corgator"] = { headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'justattachtobase', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 10, posz = 3, radius = 70, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.40, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "justattachtobase", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 10, posz = 3, radius = 70, dirx = 0, diry = -0.07, dirz = 1, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.40, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.5, posy = 5.5, posz = 5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, - r = 1, g = 0.15, b = 0.15, a = 0.8, - modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.5, posy = 5.5, posz = 5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, r = 1, g = 0.15, b = 0.15, a = 0.8, modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.5, posy = 5.5, posz = 5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, - r = 1, g = 0.15, b = 0.15, a = 0.8, - modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.5, posy = 5.5, posz = 5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, r = 1, g = 0.15, b = 0.15, a = 0.8, modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.5, posy = 5.5, posz = -5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, - r = 1, g = 0.15, b = 0.15, a = 0.8, - modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.5, posy = 5.5, posz = -5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, r = 1, g = 0.15, b = 0.15, a = 0.8, modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.5, posy = 5.5, posz = -5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, - r = 1, g = 0.15, b = 0.15, a = 0.8, - modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.5, posy = 5.5, posz = -5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.15, colortime = 30, r = 1, g = 0.15, b = 0.15, a = 0.8, modelfactor = 0.5, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corca'] = { + ["corca"] = { nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 12, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 12, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.8, posz = 16.5, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.45, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.8, posz = 16.5, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.45, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.8, posy = 4.7, posz = 13.3, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.8, posy = 4.7, posz = 13.3, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.8, posy = 4.7, posz = 13.3, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.8, posy = 4.7, posz = 13.3, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, passivethruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = -15.7, radius = 4.8, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = -15.7, radius = 4.8, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7, posy = 6, posz = -17, radius = 6.5, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7, posy = 6, posz = -17, radius = 6.5, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 6, posz = -17, radius = 6.5, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 6, posz = -17, radius = 6.5, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thrustyellow = { -- lightType = 'point', @@ -18688,451 +11803,258 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustblue = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 14, - color2r = 0.5, color2g = 0.7, color2b = 0.9, - r = 0.8, g = 0.9, b = 1.1, a = 0.45, colortime = 14, - modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 14, color2r = 0.5, color2g = 0.7, color2b = 0.9, r = 0.8, g = 0.9, b = 1.1, a = 0.45, colortime = 14, modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfink'] = { + ["corfink"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 2, posz = -18, radius = 3.1, - color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.80, b = 0.15, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 2, posz = -18, radius = 3.1, color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.80, b = 0.15, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 2, posz = -18, radius = 3.1, - color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.80, b = 0.15, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 2, posz = -18, radius = 3.1, color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.80, b = 0.15, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 12, - color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, - r = 1.3, g = 0.75, b = 0.2, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 12, color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, r = 1.3, g = 0.75, b = 0.2, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 12, - color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, - r = 1.3, g = 0.75, b = 0.2, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 12, color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, r = 1.3, g = 0.75, b = 0.2, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsb'] = { + ["corsb"] = { thrustera = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 2.8, posz = -23, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 2.8, posz = -23, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusterb = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 2.8, posz = -23, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 2.8, posz = -23, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 27, radius = 17, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 27, radius = 17, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cords'] = { + ["cords"] = { antenna = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 51.7, posz = 42.5, radius = 10, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 51.7, posz = 42.5, radius = 10, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 34, posz = 58, radius = 16, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 34, posz = 58, radius = 16, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 34, posz = 56, radius = 12, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 34, posz = 56, radius = 12, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 34, posz = 56, radius = 12, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 34, posz = 56, radius = 12, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backeyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 36.5, posz = 31, radius = 14, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 36.5, posz = 31, radius = 14, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backeyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 36.5, posz = 31, radius = 14, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 36.5, posz = 31, radius = 14, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 17, posz = 47, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 17, posz = 47, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 17, posz = 47, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 17, posz = 47, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 17, posz = -47, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 17, posz = -47, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 17, posz = -47, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 17, posz = -47, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb1l_eyes1 = { - lightType = 'point', - pieceName = 'bomb1l', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb1l", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb1l_eyes2 = { - lightType = 'point', - pieceName = 'bomb1l', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb1l", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb1r_eyes1 = { - lightType = 'point', - pieceName = 'bomb1r', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb1r", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb1r_eyes2 = { - lightType = 'point', - pieceName = 'bomb1r', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb1r", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb2l_eyes1 = { - lightType = 'point', - pieceName = 'bomb2l', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb2l", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb2l_eyes2 = { - lightType = 'point', - pieceName = 'bomb2l', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb2l", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb2r_eyes1 = { - lightType = 'point', - pieceName = 'bomb2r', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb2r", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb2r_eyes2 = { - lightType = 'point', - pieceName = 'bomb2r', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb2r", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb3l_eyes1 = { - lightType = 'point', - pieceName = 'bomb3l', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb3l", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb3l_eyes2 = { - lightType = 'point', - pieceName = 'bomb3l', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb3l", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb3r_eyes1 = { - lightType = 'point', - pieceName = 'bomb3r', - lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb3r", + lightConfig = { posx = -2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb3r_eyes2 = { - lightType = 'point', - pieceName = 'bomb3r', - lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb3r", + lightConfig = { posx = 2.9, posy = -2.5, posz = 7.2, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsfig'] = { + ["corsfig"] = { thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = -15, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = -15, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.3, posz = 3.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.3, posz = 3.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8.5, posz = -4, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8.5, posz = -4, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corseap'] = { + ["corseap"] = { thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = -14, radius = 12, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = -14, radius = 12, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = 19, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = 19, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13, posz = 9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13, posz = 9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corhunt'] = { + ["corhunt"] = { thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = -19, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = -19, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.5, posz = 21, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.5, posz = 21, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcut'] = { + ["corcut"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.6, posy = 3.8, posz = -22.5, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.6, posy = 3.8, posz = -22.5, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.6, posy = 3.8, posz = -22.5, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.6, posy = 3.8, posz = -22.5, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.3, posy = 8.9, posz = 10, radius = 1.8, - pos2x = 2.3, pos2y = 8.9, pos2z = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.3, posy = 8.9, posz = 10, radius = 1.8, pos2x = 2.3, pos2y = 8.9, pos2z = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -19144,14 +12066,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, topred1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10.5, posz = 3.0, radius = 1.8, - pos2x = 0, pos2y = 10.5, pos2z = -6.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.2, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 10.5, posz = 3.0, radius = 1.8, pos2x = 0, pos2y = 10.5, pos2z = -6.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.2, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -19172,89 +12089,53 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corhurc'] = { + ["corhurc"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7.8, posz = -25, radius = 20, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.16, - modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7.8, posz = -25, radius = 20, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.16, modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8.2, posy = 7.8, posz = -23, radius = 15, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 7, - r = 0.88, g = 0.83, b = 0.2, a = 0.13, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8.2, posy = 7.8, posz = -23, radius = 15, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 7, r = 0.88, g = 0.83, b = 0.2, a = 0.13, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8.2, posy = 7.8, posz = -23, radius = 15, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.13, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8.2, posy = 7.8, posz = -23, radius = 15, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.13, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'point', - pieceName = 'thrusta1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'point', - pieceName = 'thrusta2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.2, posy = 12.8, posz = 31.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.2, posy = 12.8, posz = 31.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.2, posy = 12.8, posz = 31.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.2, posy = 12.8, posz = 31.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corshad'] = { + ["corshad"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = -22, radius = 9, - color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.95, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.15, scattering = 0.5, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = -22, radius = 9, color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.95, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.15, scattering = 0.5, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thruster2 = { -- lightType = 'point', @@ -19293,40 +12174,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -1, radius = 18, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = 2, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -1, radius = 18, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = 2, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 21, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 21, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wingleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32.8, posy = 6.2, posz = -11.5, radius = 6, - color2r = -15, color2g = -15, color2b = -15, colortime = 55, - r = 1.5, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.8, specular = 0.4, scattering = 0.45, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32.8, posy = 6.2, posz = -11.5, radius = 6, color2r = -15, color2g = -15, color2b = -15, colortime = 55, r = 1.5, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.8, specular = 0.4, scattering = 0.45, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wingright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32.8, posy = 6.2, posz = -11.5, radius = 6, - color2r = -15, color2g = -15, color2b = -15, colortime = 55, - r = 0.2, g = 1.5, b = 0.2, a = 1.0, - modelfactor = 0.8, specular = 0.4, scattering = 0.45, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32.8, posy = 6.2, posz = -11.5, radius = 6, color2r = -15, color2g = -15, color2b = -15, colortime = 55, r = 0.2, g = 1.5, b = 0.2, a = 1.0, modelfactor = 0.8, specular = 0.4, scattering = 0.45, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes2 = { -- lightType = 'point', @@ -19338,15 +12203,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cortitan'] = { + ["cortitan"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7.5, posz = 26, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7.5, posz = 26, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes2 = { -- lightType = 'point', @@ -19358,209 +12219,121 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, depthchargeflashl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 19.5, posy = 5.8, posz = 15.0, radius = 2.1, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 19.5, posy = 5.8, posz = 15.0, radius = 2.1, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashlr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -19.5, posy = 5.8, posz = 15.0, radius = 2.1, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -19.5, posy = 5.8, posz = 15.0, radius = 2.1, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashbl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 19.5, posy = 5.8, posz = -2.5, radius = 2.1, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 19.5, posy = 5.8, posz = -2.5, radius = 2.1, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashbr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -19.5, posy = 5.8, posz = -2.5, radius = 2.1, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -19.5, posy = 5.8, posz = -2.5, radius = 2.1, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta1 = { - lightType = 'point', - pieceName = 'thrusta1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta2 = { - lightType = 'point', - pieceName = 'thrusta2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb1 = { - lightType = 'point', - pieceName = 'thrustb1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb2 = { - lightType = 'point', - pieceName = 'thrustb2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coraca'] = { + ["coraca"] = { nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.2, posy = 8.7, posz = 17.3, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.2, posy = 8.7, posz = 17.3, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.2, posy = 8.7, posz = 17.3, radius = 5, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.2, posy = 8.7, posz = 17.3, radius = 5, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = -15.7, radius = 14, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.18, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = -15.7, radius = 14, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.18, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -7, posy = 6, posz = -17, radius = 7, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.075, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -7, posy = 6, posz = -17, radius = 7, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.075, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 7, posy = 6, posz = -17, radius = 7, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.075, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 7, posy = 6, posz = -17, radius = 7, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.075, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfig'] = { + ["armfig"] = { front1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.5, posy = 4, posz = 12.5, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.5, posy = 4, posz = 12.5, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.5, posy = 4, posz = 12.5, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.5, posy = 4, posz = 12.5, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7, posy = 4, posz = -13, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7, posy = 4, posz = -13, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7, posy = 4, posz = -13, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7, posy = 4, posz = -13, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -3, posy = 6, posz = -8.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -3, posy = 6, posz = -8.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 3, posy = 6, posz = -8.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 3, posy = 6, posz = -8.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 10, - r = 1.1, g = 0.8, b = 0.5, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 10, r = 1.1, g = 0.8, b = 0.5, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armca'] = { + ["armca"] = { --nanolightarmca = { -- lightType = 'cone', -- pieceName = 'nano', @@ -19571,22 +12344,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, buildlight = { - lightType = 'point', - pieceName = 'nanolight', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 22, - r = 1.2, g = 0.85, b = 0.1, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanolight", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 22, r = 1.2, g = 0.85, b = 0.1, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = -8, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = -8, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front1 = { -- lightType = 'point', @@ -19616,182 +12381,101 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 7, posz = -12, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 7, posz = -12, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 7, posz = -12, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 7, posz = -12, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 8.5, posz = -6.5, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 8.5, posz = -6.5, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 8.5, posz = -6.5, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 8.5, posz = -6.5, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 8.5, posz = 6.5, radius = 4, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 8.5, posz = 6.5, radius = 4, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 8.5, posz = 6.5, radius = 4, - color2r = -10, color2g = -10, color2b = -10, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 8.5, posz = 6.5, radius = 4, color2r = -10, color2g = -10, color2b = -10, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 1, posz = -3, radius = 16, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, - r = 1.1, g = 0.8, b = 0.5, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 1, posz = -3, radius = 16, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, r = 1.1, g = 0.8, b = 0.5, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armpb'] = { + ["armpb"] = { turrettop = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 2.2, posy = 17, posz = 0, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 2.2, posy = 17, posz = 0, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turrettopside1 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 2.2, posy = 0, posz = 6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 2.2, posy = 0, posz = 6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turrettopside2 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = -8, posy = 0, posz = 6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = -8, posy = 0, posz = 6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretsideanimr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -6.9, posy = -12, posz = -0.2, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -13.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -6.9, posy = -12, posz = -0.2, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -13.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretsideaniml = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 6.9, posy = -6, posz = -0.2, radius = 6, - dirx = 0, diry = 1, dirz = 0, theta = -17.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 6.9, posy = -6, posz = -0.2, radius = 6, dirx = 0, diry = 1, dirz = 0, theta = -17.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretsideanimcircle = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.5, posy = 11, posz = -0.2, radius = 7, - dirx = -1, diry = 0, dirz = 0, theta = -3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = -1, g = 1, b = 1, a = 1.2, - modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.5, posy = 11, posz = -0.2, radius = 7, dirx = -1, diry = 0, dirz = 0, theta = -3.5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = -1, g = 1, b = 1, a = 1.2, modelfactor = 0.6, specular = 0.1, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretfront = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -1.6, posy = -23.8, posz = 4.5, radius = 2.4, - pos2x = 1.6, pos2y = -23.8, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -1.6, posy = -23.8, posz = 4.5, radius = 2.4, pos2x = 1.6, pos2y = -23.8, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretback = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -1.6, posy = -23.8, posz = -4.9, radius = 2.4, - pos2x = 1.6, pos2y = -23.8, pos2z = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -1.6, posy = -23.8, posz = -4.9, radius = 2.4, pos2x = 1.6, pos2y = -23.8, pos2z = -4.9, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 9, posz = 16, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 9, posz = 16, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 9, posz = 16, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 9, posz = 16, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 9, posz = -16, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 9, posz = -16, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 9, posz = -16, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 9, posz = -16, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- baseside1 = { -- lightType = 'point', @@ -19812,16 +12496,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armtide'] = { + ["armtide"] = { enabled_mainglowbeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 11, posz = -5.8, radius = 5, - pos2x = 0, pos2y = 11, pos2z = 5.8, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.1, g = 0.85, b = 0.25, a = 0.9, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 0, posy = 11, posz = -5.8, radius = 5, pos2x = 0, pos2y = 11, pos2z = 5.8, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.1, g = 0.85, b = 0.25, a = 0.9, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -19851,33 +12530,21 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armthund'] = { + ["armthund"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 19, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.85, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 19, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.85, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 2.2, posz = -8, radius = 5, - color2r = 1, color2g = 1, color2b = 1, colortime = -1, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 2.2, posz = -8, radius = 5, color2r = 1, color2g = 1, color2b = 1, colortime = -1, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 2.2, posz = -8, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 2.2, posz = -8, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- engine1 = { -- lightType = 'point', @@ -19916,13 +12583,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustermain = { - lightType = 'point', - pieceName = 'enginec', - lightConfig = { posx = 0, posy = -6, posz = 0, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.93, g = 0.81, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "enginec", + lightConfig = { posx = 0, posy = -6, posz = 0, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.93, g = 0.81, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thrusteractive = { -- lightType = 'cone', @@ -19934,13 +12597,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustleft = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = -3, posy = 0, posz = -5, radius = 14, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, - r = 1, g = 0.8, b = 0.5, a = 0.7, - modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = -3, posy = 0, posz = -5, radius = 14, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, r = 1, g = 0.8, b = 0.5, a = 0.7, modelfactor = 0.4, specular = 0, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thrustright = { -- lightType = 'point', @@ -19961,49 +12620,29 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrustmain = { - lightType = 'point', - pieceName = 'thrustc', - lightConfig = { posx = 0, posy = 0, posz = -7, radius = 19, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustc", + lightConfig = { posx = 0, posy = 0, posz = -7, radius = 19, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'point', - pieceName = 'thrust2', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust2", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'point', - pieceName = 'thrust3', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 29, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust3", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 29, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'point', - pieceName = 'thrust4', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 27, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust4", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 10, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 27, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thrust1 = { -- lightType = 'cone', @@ -20042,498 +12681,285 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armstil'] = { + ["armstil"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 9, posz = 27, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 9, posz = 27, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 9, posz = 27, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 9, posz = 27, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 6, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 6, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 9, posz = 2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 9, posz = 2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 9, posz = 2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 9, posz = 2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midback1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 9, posz = -11, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 9, posz = -11, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midback2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 9, posz = -11, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 9, posz = -11, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplight21 = { - lightType = 'point', - pieceName = 'wingr', - lightConfig = { posx = 0, posy = 17, posz = -2, radius = 12, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, - lifetime = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wingr", + lightConfig = { posx = 0, posy = 17, posz = -2, radius = 12, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, selfshadowing = 0 }, }, emplight2 = { - lightType = 'point', - pieceName = 'wingl', - lightConfig = { posx = 0, posy = 17, posz = -2, radius = 12, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, - lifetime = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "wingl", + lightConfig = { posx = 0, posy = 17, posz = -2, radius = 12, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, selfshadowing = 0 }, }, }, - ['armhawk'] = { + ["armhawk"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = 16.5, radius = 15, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.05, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = 16.5, radius = 15, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.05, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 12, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 12, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 5, posz = -22, radius = 14, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 5, posz = -22, radius = 14, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 5, posz = -22, radius = 14, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 5, posz = -22, radius = 14, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armpeep'] = { + ["armpeep"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 15.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 15.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10, posy = 4.4, posz = -13.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.88, g = 0.83, b = 0.2, a = 0.45, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10, posy = 4.4, posz = -13.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.88, g = 0.83, b = 0.2, a = 0.45, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10, posy = 4.4, posz = -13.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.88, g = 0.83, b = 0.2, a = 0.45, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10, posy = 4.4, posz = -13.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.88, g = 0.83, b = 0.2, a = 0.45, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'point', - pieceName = 'jet1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jet1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'point', - pieceName = 'jet2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jet2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = 5, radius = 12, - color2r = 0, color2g = 1, color2b = 0, colortime = 30, - r = 0, g = 2, b = 0, a = 0.33, - modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = 5, radius = 12, color2r = 0, color2g = 1, color2b = 0, colortime = 30, r = 0, g = 2, b = 0, a = 0.33, modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armkam'] = { + ["armkam"] = { front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 11, posz = 17, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 11, posz = 17, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.7, posy = 10, posz = 9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.7, posy = 10, posz = 9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2.7, posy = 10, posz = 9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2.7, posy = 10, posz = 9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, - r = 1, g = 0.8, b = 0.5, a = 0.7, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 30, r = 1, g = 0.8, b = 0.5, a = 0.7, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 25, - r = 1, g = 0.8, b = 0.5, a = 0.7, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 25, r = 1, g = 0.8, b = 0.5, a = 0.7, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armlance'] = { + ["armlance"] = { thrust = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.44, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.44, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash1 = { - lightType = 'point', - pieceName = 'rventblade', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rventblade", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflash2 = { - lightType = 'point', - pieceName = 'lventblade', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lventblade", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 4.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armbrawl'] = { + ["armbrawl"] = { frontcockpit = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = 25, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = 25, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashtop = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13.5, posz = 9, radius = 3.8, - dirx = 0, diry = 0, dirz = 1, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13.5, posz = 9, radius = 3.8, dirx = 0, diry = 0, dirz = 1, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.0, posy = 14, posz = 14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.0, posy = 14, posz = 14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.0, posy = 14, posz = 14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.0, posy = 14, posz = 14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0.3, posy = 8.5, posz = 20, radius = 80, - dirx = -0.1, diry = -0.4, dirz = 1, theta = 0.28, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0.3, posy = 8.5, posz = 20, radius = 80, dirx = -0.1, diry = -0.4, dirz = 1, theta = 0.28, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0.3, posy = 8.5, posz = 24.5, radius = 8, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0.3, posy = 8.5, posz = 24.5, radius = 8, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armpnix'] = { + ["armpnix"] = { front1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4, posy = 11, posz = 26, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4, posy = 11, posz = 26, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4, posy = 11, posz = 26, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4, posy = 11, posz = 26, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.7, posy = 6.3, posz = -23.5, radius = 10, - color2r = 1.2, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.7, posy = 6.3, posz = -23.5, radius = 10, color2r = 1.2, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.7, posy = 6.3, posz = -23.5, radius = 10, - color2r = 1.2, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.7, posy = 6.3, posz = -23.5, radius = 10, color2r = 1.2, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 26, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.44, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 26, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.44, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 26, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.44, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 26, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.44, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 11, posz = -17.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 11, posz = -17.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 11, posz = -17.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 11, posz = -17.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backbottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 2, posz = -17.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 2, posz = -17.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backbottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 2, posz = -17.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 2, posz = -17.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armaca'] = { + ["armaca"] = { buildlight = { - lightType = 'point', - pieceName = 'nanolight', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 19, - r = 1.2, g = 0.85, b = 0.1, a = 0.8, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nanolight", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 19, r = 1.2, g = 0.85, b = 0.1, a = 0.8, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9.5, posy = 8.5, posz = -3.7, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9.5, posy = 8.5, posz = -3.7, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backtop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9.5, posy = 8.5, posz = -3.7, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9.5, posy = 8.5, posz = -3.7, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9.5, posy = 8.5, posz = 4.2, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9.5, posy = 8.5, posz = 4.2, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9.5, posy = 8.5, posz = 4.2, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9.5, posy = 8.5, posz = 4.2, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top = { -- lightType = 'point', @@ -20572,34 +12998,22 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, back1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -12, posy = 5, posz = -26, radius = 15, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.04, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -12, posy = 5, posz = -26, radius = 15, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.04, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 12, posy = 5, posz = -26, radius = 15, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.04, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 12, posy = 5, posz = -26, radius = 15, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.04, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armgremlin'] = { + ["armgremlin"] = { -- cloaklightred1 = { -- lightType = 'point', -- pieceName = 'flleg', @@ -20646,126 +13060,72 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 4}, -- }, inside1 = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", --alliedOnly = true, - lightConfig = { posx = 8.8, posy = 7.6, posz = 8.8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 8.8, posy = 7.6, posz = 8.8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inside2 = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", --alliedOnly = true, - lightConfig = { posx = -8.8, posy = 7.6, posz = 8.8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = -8.8, posy = 7.6, posz = 8.8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inside3 = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", --alliedOnly = true, - lightConfig = { posx = -8.8, posy = 7.6, posz = -8.8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = -8.8, posy = 7.6, posz = -8.8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inside4 = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", --alliedOnly = true, - lightConfig = { posx = 8.8, posy = 7.6, posz = -8.8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 8.8, posy = 7.6, posz = -8.8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armamd'] = { + ["armamd"] = { orangelightamd = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, - + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, greenlightamd = { - lightType = 'point', - pieceName = 'greenlight', + lightType = "point", + pieceName = "greenlight", alliedOnly = true, - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 32, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 4}, - + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 32, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 30, posy = 17, posz = -6, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 30, posy = 17, posz = -6, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 30, posy = 17, posz = 6, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 30, posy = 17, posz = 6, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 28, posz = 16, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 28, posz = 16, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 29, posz = -18, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 29, posz = -18, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 20, posz = 18, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 20, posz = 18, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hinge4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx =- 11, posy = 20, posz = -18, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 20, posz = -18, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- door1_2 = { -- lightType = 'point', @@ -20795,102 +13155,60 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corfmd'] = { + ["corfmd"] = { orangelightcenter = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 0, posy = 15, posz = 0, radius = 10.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 15, posz = 0, radius = 10.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight1 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = -20, posy = 6, posz = 0, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = -20, posy = 6, posz = 0, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight2 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 20, posy = 6, posz = 0, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 20, posy = 6, posz = 0, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight3 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 0, posy = 6, posz = 20, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 6, posz = 20, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight4 = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 0, posy = 6, posz = -20, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 6, posz = -20, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenlight1 = { - lightType = 'point', - pieceName = 'greendbr', + lightType = "point", + pieceName = "greendbr", alliedOnly = true, - lightConfig = { posx = -14, posy = 30, posz = -14, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, - + lightConfig = { posx = -14, posy = 30, posz = -14, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight2 = { - lightType = 'point', - pieceName = 'greendbl', + lightType = "point", + pieceName = "greendbl", alliedOnly = true, - lightConfig = { posx = 14, posy = 30, posz = -14, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 14, posy = 30, posz = -14, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight3 = { - lightType = 'point', - pieceName = 'greendtr', + lightType = "point", + pieceName = "greendtr", alliedOnly = true, - lightConfig = { posx = -14, posy = 30, posz = 14, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = -14, posy = 30, posz = 14, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight4 = { - lightType = 'point', - pieceName = 'greendtl', + lightType = "point", + pieceName = "greendtl", alliedOnly = true, - lightConfig = { posx = 14, posy = 30, posz = 14, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 14, posy = 30, posz = 14, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, -- side1 = { -- lightType = 'point', @@ -20911,7 +13229,7 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corvalk'] = { + ["corvalk"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'base', @@ -20931,73 +13249,39 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, transportlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -1, posz = 0, radius = 18, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -1, posz = 0, radius = 18, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, teamtopfront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 22, posz = 4.9, radius = 3.0, - dirx = 0, diry = 0, dirz = -1, theta = -1.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 22, posz = 4.9, radius = 3.0, dirx = 0, diry = 0, dirz = -1, theta = -1.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopback = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 22, posz = -4.9, radius = 3.0, - dirx = 0, diry = 0, dirz = -1, theta = -1.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 22, posz = -4.9, radius = 3.0, dirx = 0, diry = 0, dirz = -1, theta = -1.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flasheye1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 15, posz = 28, radius = 2.8, - dirx = 0, diry = 1, dirz = 0, theta = -10, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 15, posz = 28, radius = 2.8, dirx = 0, diry = 1, dirz = 0, theta = -10, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flasheye1b = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4, posy = 12, posz = 28, radius = 2.8, - dirx = 0, diry = 1, dirz = -1, theta = -4, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4, posy = 12, posz = 28, radius = 2.8, dirx = 0, diry = 1, dirz = -1, theta = -4, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flasheye2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 15, posz = 28, radius = 2.8, - dirx = 0, diry = 1, dirz = 0, theta = -10, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 15, posz = 28, radius = 2.8, dirx = 0, diry = 1, dirz = 0, theta = -10, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flasheye2b = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = 12, posz = 28, radius = 2.8, - dirx = 0, diry = 1, dirz = -1, theta = -4, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = 12, posz = 28, radius = 2.8, dirx = 0, diry = 1, dirz = -1, theta = -4, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes3 = { -- lightType = 'point', @@ -21036,83 +13320,47 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thruster1 = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'thrust2', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust2", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'thrust3', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust3", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster4 = { - lightType = 'point', - pieceName = 'thrust4', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust4", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrust1', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 60, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust1", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 60, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrust2', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 55, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust2", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 55, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrust3', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 65, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust3", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 65, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrust4', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 63, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust4", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 63, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corhvytrans'] = { + ["corhvytrans"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'base', @@ -21132,53 +13380,29 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, transportlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = 8, radius = 18, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = 8, radius = 18, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, teamtopfront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23, posz = 3.8, radius = 3.0, - dirx = 0, diry = 0, dirz = -1, theta = -1.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23, posz = 3.8, radius = 3.0, dirx = 0, diry = 0, dirz = -1, theta = -1.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopmid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23, posz = -5.1, radius = 3.0, - dirx = 0, diry = 0, dirz = -1, theta = -1.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23, posz = -5.1, radius = 3.0, dirx = 0, diry = 0, dirz = -1, theta = -1.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtopback = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23, posz = -14.9, radius = 3.0, - dirx = 0, diry = 0, dirz = -1, theta = -1.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23, posz = -14.9, radius = 3.0, dirx = 0, diry = 0, dirz = -1, theta = -1.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flasheye1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2, posy = 15, posz = 28, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2, posy = 15, posz = 28, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- flasheye1b = { -- lightType = 'point', @@ -21191,14 +13415,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, flasheye2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2, posy = 15, posz = 28, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -7, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2, posy = 15, posz = 28, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -7, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- flasheye2b = { -- lightType = 'point', @@ -21211,832 +13430,491 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thruster1 = { - lightType = 'point', - pieceName = 'thrustbl', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustbl", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'thrustbr', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustbr", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'thrustfl', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustfl", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster4 = { - lightType = 'point', - pieceName = 'thrustfr', - lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustfr", + lightConfig = { posx = -2, posy = 0, posz = -10, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustbl', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 60, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustbl", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 60, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustbr', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 55, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustbr", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 55, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustfl', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 65, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfl", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 65, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustfr', - lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.6, - color2r = 0.7, color2g = 0.66, color2b = 0.15, - r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 63, - modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfr", + lightConfig = { posx = -2, posy = 0, posz = 4, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.6, color2r = 0.7, color2g = 0.66, color2b = 0.15, r = 1, g = 0.8, b = 0.33, a = 0.1, colortime = 63, modelfactor = -1.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armemp'] = { + ["armemp"] = { emplight1 = { - lightType = 'point', - pieceName = 'orangelight', - lightConfig = { posx = 37, posy = 3, posz = 0, radius = 16, - color2r = -0.15, color2g = -0.15, color2b = -0.35, colortime = 45, - r = 0.80, g = 0.85, b = 1.3, a = 0.6, - modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "orangelight", + lightConfig = { posx = 37, posy = 3, posz = 0, radius = 16, color2r = -0.15, color2g = -0.15, color2b = -0.35, colortime = 45, r = 0.80, g = 0.85, b = 1.3, a = 0.6, modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplight2 = { - lightType = 'point', - pieceName = 'orangelight', - lightConfig = { posx = -37, posy = 3, posz = 0, radius = 16, - color2r = -0.15, color2g = -0.15, color2b = -0.35, colortime = 45, - r = 0.80, g = 0.85, b = 1.3, a = 0.6, - modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "orangelight", + lightConfig = { posx = -37, posy = 3, posz = 0, radius = 16, color2r = -0.15, color2g = -0.15, color2b = -0.35, colortime = 45, r = 0.80, g = 0.85, b = 1.3, a = 0.6, modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightloaded1 = { - lightType = 'point', - pieceName = 'greenlight', - lightConfig = { posx = 37, posy = 3, posz = 0, radius = 16, - color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 15, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "greenlight", + lightConfig = { posx = 37, posy = 3, posz = 0, radius = 16, color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 15, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightloaded2 = { - lightType = 'point', - pieceName = 'greenlight', - lightConfig = { posx = -37, posy = 3, posz = 0, radius = 16, - color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 15, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "greenlight", + lightConfig = { posx = -37, posy = 3, posz = 0, radius = 16, color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 15, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empbarloaded1 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = -28, posy = 20.5, posz = 0, radius = 8, - pos2x = -16, pos2y = 20.51, pos2z = 0, - color2r = 0.4, color2g = 0.4, color2b = 0.8, colortime = 15, - r = 0.80, g = 0.85, b = 1.3, a = 2, - modelfactor = 0.3, specular = 0.1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = -28, posy = 20.5, posz = 0, radius = 8, pos2x = -16, pos2y = 20.51, pos2z = 0, color2r = 0.4, color2g = 0.4, color2b = 0.8, colortime = 15, r = 0.80, g = 0.85, b = 1.3, a = 2, modelfactor = 0.3, specular = 0.1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empbarloaded2 = { - lightType = 'beam', - pieceName = 'greenlight', - lightConfig = { posx = 28, posy = 20.5, posz = 0, radius = 8, - pos2x = 16, pos2y = 20.51, pos2z = 0, - color2r = 0.4, color2g = 0.4, color2b = 0.8, colortime = 15, - r = 0.80, g = 0.85, b = 1.3, a = 2, - modelfactor = 0.3, specular = 0.1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "beam", + pieceName = "greenlight", + lightConfig = { posx = 28, posy = 20.5, posz = 0, radius = 8, pos2x = 16, pos2y = 20.51, pos2z = 0, color2r = 0.4, color2g = 0.4, color2b = 0.8, colortime = 15, r = 0.80, g = 0.85, b = 1.3, a = 2, modelfactor = 0.3, specular = 0.1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'orangelight', - lightConfig = { posx = -23, posy = 20.5, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "orangelight", + lightConfig = { posx = -23, posy = 20.5, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'orangelight', - lightConfig = { posx = 23, posy = 20.5, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "orangelight", + lightConfig = { posx = 23, posy = 20.5, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armgplat'] = { + ["armgplat"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15.5, posy = 10, posz = 15.5, radius = 18, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.045, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15.5, posy = 10, posz = 15.5, radius = 18, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.045, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15.5, posy = 10, posz = 15.5, radius = 18, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.045, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15.5, posy = 10, posz = 15.5, radius = 18, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.045, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15.5, posy = 10, posz = -15.5, radius = 18, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.045, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15.5, posy = 10, posz = -15.5, radius = 18, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.045, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15.5, posy = 10, posz = -15.5, radius = 18, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.045, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15.5, posy = 10, posz = -15.5, radius = 18, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.045, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel1 = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = -2, posy = -8, posz = 2.5, radius = 16, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { posx = -2, posy = -8, posz = 2.5, radius = 16, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = 2, posy = -8, posz = 2.5, radius = 16, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { posx = 2, posy = -8, posz = 2.5, radius = 16, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armatl'] = { + ["armatl"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15.5, posy = 11, posz = 15.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15.5, posy = 11, posz = 15.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15.5, posy = 11, posz = 15.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15.5, posy = 11, posz = 15.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, torpedoflash = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14.8, posy = 26, posz = -15.5, radius = 5.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14.8, posy = 26, posz = -15.5, radius = 5.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14.8, posy = 24, posz = -15.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14.8, posy = 24, posz = -15.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coratl'] = { + ["coratl"] = { torpedoflash1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -16.7, posy = -2.2, posz = 9, radius = 2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -16.7, posy = -2.2, posz = 9, radius = 2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, torpedoflash2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 16.7, posy = -2.2, posz = 9, radius = 2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 16.7, posy = -2.2, posz = 9, radius = 2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armatlas'] = { + ["armatlas"] = { jetm = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2, posz = -32, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 6, - r = 0.88, g = 0.14, b = 0.14, a = 0.14, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2, posz = -32, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 6, r = 0.88, g = 0.14, b = 0.14, a = 0.14, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetm = { - lightType = 'point', - pieceName = 'thrustm', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 20, - color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, - r = 1, g = 0.8, b = 0.5, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustm", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 20, color2r = 0.7, color2g = 0.5, color2b = 0.25, colortime = 28, r = 1, g = 0.8, b = 0.5, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetr = { - lightType = 'point', - pieceName = 'thrustr', - lightConfig = { posx = -2, posy = 0, posz = -4, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustr", + lightConfig = { posx = -2, posy = 0, posz = -4, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustflashlf = { - lightType = 'point', - pieceName = 'jetl', - lightConfig = { posx = 2.5, posy = 5.5, posz = 1, radius = 4.8, - dirx = 0, diry = 0, dirz = 1, theta = -6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetl", + lightConfig = { posx = 2.5, posy = 5.5, posz = 1, radius = 4.8, dirx = 0, diry = 0, dirz = 1, theta = -6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustflashlb = { - lightType = 'point', - pieceName = 'jetl', - lightConfig = { posx = 2.5, posy = -5.5, posz = 1, radius = 4.8, - dirx = 0, diry = 0, dirz = 1, theta = -4.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetl", + lightConfig = { posx = 2.5, posy = -5.5, posz = 1, radius = 4.8, dirx = 0, diry = 0, dirz = 1, theta = -4.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustflashrf = { - lightType = 'point', - pieceName = 'jetr', - lightConfig = { posx = -2.5, posy = 5.5, posz = 1, radius = 4.8, - dirx = 0, diry = 0, dirz = 1, theta = -6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetr", + lightConfig = { posx = -2.5, posy = 5.5, posz = 1, radius = 4.8, dirx = 0, diry = 0, dirz = 1, theta = -6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustflashrb = { - lightType = 'point', - pieceName = 'jetr', - lightConfig = { posx = -2.5, posy = -5.5, posz = 1, radius = 4.8, - dirx = 0, diry = 0, dirz = 1, theta = -4.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetr", + lightConfig = { posx = -2.5, posy = -5.5, posz = 1, radius = 4.8, dirx = 0, diry = 0, dirz = 1, theta = -4.2, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetl = { - lightType = 'point', - pieceName = 'thrustl', - lightConfig = { posx = 2, posy = 0, posz = -4, radius = 16, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustl", + lightConfig = { posx = 2, posy = 0, posz = -4, radius = 16, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11, posy = 10, posz = -18.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.95, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11, posy = 10, posz = -18.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.95, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11, posy = 10, posz = -18.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.95, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11, posy = 10, posz = -18.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.95, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, transportlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -3, posz = -8, radius = 12, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -3, posz = -8, radius = 12, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armhvytrans'] = { + ["armhvytrans"] = { jetbltop = { - lightType = 'point', - pieceName = 'jetbl', - lightConfig = { posx = 7, posy = 0, posz = 7.3, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.8, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetbl", + lightConfig = { posx = 7, posy = 0, posz = 7.3, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.8, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetbrtop = { - lightType = 'point', - pieceName = 'jetbr', - lightConfig = { posx = -7, posy = 0, posz = 7.3, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.8, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetbr", + lightConfig = { posx = -7, posy = 0, posz = 7.3, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.8, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetfltop = { - lightType = 'point', - pieceName = 'jetfl', - lightConfig = { posx = 9.5, posy = 0, posz = 11.2, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.8, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetfl", + lightConfig = { posx = 9.5, posy = 0, posz = 11.2, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.8, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jetfrtop = { - lightType = 'point', - pieceName = 'jetfr', - lightConfig = { posx = -9.5, posy = 0, posz = 11.2, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.8, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetfr", + lightConfig = { posx = -9.5, posy = 0, posz = 11.2, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.8, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustbl = { - lightType = 'point', - pieceName = 'thrustbl', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustbl", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustbr = { - lightType = 'point', - pieceName = 'thrustbr', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustbr", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustfl = { - lightType = 'point', - pieceName = 'thrustfl', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustfl", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustfr = { - lightType = 'point', - pieceName = 'thrustfr', - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, - color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, - r = 1.3, g = 0.75, b = 0.3, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustfr", + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 18, color2r = 0.7, color2g = 0.66, color2b = 0.15, colortime = -1.5, r = 1.3, g = 0.75, b = 0.3, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronttop = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 17, posz = 23, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 17, posz = 23, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontbot = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 1, posz = 23, radius = 6.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 1, posz = 23, radius = 6.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 18, posz = -3, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.7, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 18, posz = -3, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.7, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 18, posz = -3, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.7, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 18, posz = -3, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.7, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, transportlightl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 6, posz = -10, radius = 12, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 6, posz = -10, radius = 12, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, transportlightr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7, posy = 6, posz = -10, radius = 12, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7, posy = 6, posz = -10, radius = 12, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armeyes'] = { + ["armeyes"] = { light = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 0, posy = 22, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.15, - modelfactor = 0.25, specular = 0.1, scattering = 0.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 0, posy = 22, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.15, modelfactor = 0.25, specular = 0.1, scattering = 0.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeglow = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 0, posy = 22, posz = 0, radius = 110, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.8, g = 0.8, b = 0.8, a = 0.14, - modelfactor = 0.1, specular = -0.1, scattering = 0.7, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 0, posy = 22, posz = 0, radius = 110, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.8, g = 0.8, b = 0.8, a = 0.14, modelfactor = 0.1, specular = -0.1, scattering = 0.7, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, }, - ['coreyes'] = { + ["coreyes"] = { eyeglow = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 0, posy = 25, posz = 0, radius = 120, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.8, g = 0.8, b = 0.8, a = 0.11, - modelfactor = 0.1, specular = 0.1, scattering = 0.7, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 0, posy = 25, posz = 0, radius = 120, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.8, g = 0.8, b = 0.8, a = 0.11, modelfactor = 0.1, specular = 0.1, scattering = 0.7, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 10, posy = 13, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 10, posy = 13, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = -10, posy = 13, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = -10, posy = 13, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 0, posy = 13, posz = 10, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 0, posy = 13, posz = 10, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes4 = { - lightType = 'point', - pieceName = 'sphere', - lightConfig = { posx = 0, posy = 13, posz = -10, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sphere", + lightConfig = { posx = 0, posy = 13, posz = -10, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armanni'] = { + ["armanni"] = { searchlight = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 950, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - color2r = 0.8, color2g = 0.8, color2b = 0.8, colortime = -1.0, -- whiten with texture anim pulsing - r = 1, g = 1, b = 0.8, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 950, + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.07, + color2r = 0.8, + color2g = 0.8, + color2b = 0.8, + colortime = -1.0, -- whiten with texture anim pulsing + r = 1, + g = 1, + b = 0.8, + a = 0.45, + modelfactor = 0, + specular = 1, + scattering = 2, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, radarlight = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 7, - color2r = -25, color2g = -25, color2b = -25, colortime = 40, - r = 0, g = 1, b = 0, a = 1.0, - modelfactor = 0.5, specular = 0.4, scattering = 0.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 7, color2r = -25, color2g = -25, color2b = -25, colortime = 40, r = 0, g = 1, b = 0, a = 1.0, modelfactor = 0.5, specular = 0.4, scattering = 0.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- build orbit light that moves on the Z axis, and changes color zoomlight = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 1, posz = -4, radius = 20, - dirx = 0, diry = 0, dirz = 0.5, theta = -18, - color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, - r = 0.1, g = 0.3, b = 1.2, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 1, posz = -4, radius = 20, dirx = 0, diry = 0, dirz = 0.5, theta = -18, color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, r = 0.1, g = 0.3, b = 1.2, a = 2.5, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, zoomlight2 = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 1.5, posz = -4, radius = 4, - dirx = 0, diry = 0, dirz = 0.5, theta = -18, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 1, b = 2, a = 6, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, -}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 1.5, posz = -4, radius = 4, dirx = 0, diry = 0, dirz = 0.5, theta = -18, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 1, b = 2, a = 6, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 19, posz = 39, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 19, posz = 39, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 19, posz = -39, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 19, posz = -39, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 33, posy = 22, posz = 10, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 33, posy = 22, posz = 10, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 33, posy = 22, posz = -10, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 33, posy = 22, posz = -10, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -33, posy = 22, posz = 10, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -33, posy = 22, posz = 10, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -33, posy = 22, posz = -10, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -33, posy = 22, posz = -10, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = -2, posy = 1.5, posz = 2.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = -2, posy = 1.5, posz = 2.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 5.5, posy = 14, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0.2, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 5.5, posy = 14, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0.2, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -5.5, posy = 14, posz = 0, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -5.5, posy = 14, posz = 0, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna1 = { - lightType = 'point', - pieceName = 'antenna', - lightConfig = { posx = 2, posy = 21, posz = 0, radius = 8.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, - r = 1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "antenna", + lightConfig = { posx = 2, posy = 21, posz = 0, radius = 8.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, r = 1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'antenna', - lightConfig = { posx = 2, posy = 12, posz = -2, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, - r = 1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "antenna", + lightConfig = { posx = 2, posy = 12, posz = -2, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, r = 1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armannit3'] = { + ["armannit3"] = { searchlight = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 1250, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 1250, dirx = 0, diry = 0, dirz = 1, theta = 0.07, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 30, posz = 57, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 30, posz = 57, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 30, posz = -57, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 30, posz = -57, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 49, posy = 35, posz = 14, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 49, posy = 35, posz = 14, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 49, posy = 35, posz = -14, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 49, posy = 35, posz = -14, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -49, posy = 35, posz = 14, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -49, posy = 35, posz = 14, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -49, posy = 35, posz = -14, radius = 42, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -49, posy = 35, posz = -14, radius = 42, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.13, - modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.13, modelfactor = 0.4, specular = 0.5, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 6.5, posy = 19, posz = -2, radius = 32, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 6.5, posy = 19, posz = -2, radius = 32, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -6.5, posy = 19, posz = -2, radius = 32, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -6.5, posy = 19, posz = -2, radius = 32, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -9.7, posy = 52, posz = -12, radius = 10, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -9.7, posy = 52, posz = -12, radius = 10, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antenna2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -9.7, posy = 39.5, posz = -15.4, radius = 7.5, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -9.7, posy = 39.5, posz = -15.4, radius = 7.5, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armblade'] = { + ["armblade"] = { fan = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7, posz = 4, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7, posz = 4, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -22048,170 +13926,97 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.3, posz = -17.5, radius = 7, - color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.94, g = 0.83, b = 0.2, a = 0.085, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.3, posz = -17.5, radius = 7, color2r = 1.1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.94, g = 0.83, b = 0.2, a = 0.085, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.65, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.65, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0.3, posy = 3.5, posz = 23.5, radius = 8, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.9, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0.3, posy = 3.5, posz = 23.5, radius = 8, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.9, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0.3, posy = 3.5, posz = 20, radius = 80, - dirx = -0.1, diry = -0.4, dirz = 1, theta = 0.28, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0.3, posy = 3.5, posz = 20, radius = 80, dirx = -0.1, diry = -0.4, dirz = 1, theta = 0.28, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armdfly'] = { + ["armdfly"] = { flashtop = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 3.2, posz = 0.7, radius = 2.5, - dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 3.2, posz = 0.7, radius = 2.5, dirx = 0, diry = 0, dirz = 1, theta = -2.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplight = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 0, posz = 10.5, radius = 10, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 25, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 0, posz = 10.5, radius = 10, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 25, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empblast = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 2.7, posz = 6, radius = 25, - color2r = 0.2, color2g = 0.2, color2b = 0.6, colortime = 2, - r = 0.85, g = 0.85, b = 1.1, a = 1.5, - modelfactor = 0.8, specular = 0.8, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 2.7, posz = 6, radius = 25, color2r = 0.2, color2g = 0.2, color2b = 0.6, colortime = 2, r = 0.85, g = 0.85, b = 1.1, a = 1.5, modelfactor = 0.8, specular = 0.8, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32.8, posy = 11, posz = 15.3, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32.8, posy = 11, posz = 15.3, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32.8, posy = 11, posz = 15.3, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32.8, posy = 11, posz = 15.3, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32.8, posy = 11, posz = -15.3, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32.8, posy = 11, posz = -15.3, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32.8, posy = 11, posz = -15.3, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32.8, posy = 11, posz = -15.3, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 6.5, posz = -50, radius = 12, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.14, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 6.5, posz = -50, radius = 12, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.14, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 6.5, posz = -50, radius = 12, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.14, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 6.5, posz = -50, radius = 12, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.14, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 13, posz = 42, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 13, posz = 42, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, transportlight1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 2, posz = 21, radius = 14, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 2, posz = 21, radius = 14, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, transportlight2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 2, posz = 21, radius = 14, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 2, posz = 21, radius = 14, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, -- inner1 = { -- lightType = 'point', @@ -22232,192 +14037,112 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, inner3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 5.5, posz = -20, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 5.5, posz = -20, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 5.5, posz = -20, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 5.5, posz = -20, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corbw'] = { + ["corbw"] = { emplight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 1.5, posz = 5.8, radius = 8, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare =15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 1.5, posz = 5.8, radius = 8, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empblast = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 2.7, posz = 6, radius = 25, - color2r = 0.2, color2g = 0.2, color2b = 0.6, colortime = 2, - r = 0.85, g = 0.85, b = 1.1, a = 1.5, - modelfactor = 0.8, specular = 0.8, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 2.7, posz = 6, radius = 25, color2r = 0.2, color2g = 0.2, color2b = 0.6, colortime = 2, r = 0.85, g = 0.85, b = 1.1, a = 1.5, modelfactor = 0.8, specular = 0.8, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamback = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.7, posz = -8.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = -1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.3, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.7, posz = -8.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = -1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.3, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 3, posz = -4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.45, g = 0.7, b = 1, a = 1.1, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 3, posz = -4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.45, g = 0.7, b = 1, a = 1.1, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 3, posz = -4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.45, g = 0.7, b = 1, a = 1.1, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 3, posz = -4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.45, g = 0.7, b = 1, a = 1.1, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corawac'] = { + ["corawac"] = { dish = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 15, posz = -1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 15, posz = -1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1.3, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = -20, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.16, - modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = -20, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.16, modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7, posy = 5, posz = -24, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.16, - modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7, posy = 5, posz = -24, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.16, modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 5, posz = -24, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.16, - modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 5, posz = -24, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.16, modelfactor = 0.3, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - thrustl = { - lightType = 'point', - pieceName = 'lthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - thrustr = { - lightType = 'point', - pieceName = 'rthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + }, + thrustl = { + lightType = "point", + pieceName = "lthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + thrustr = { + lightType = "point", + pieceName = "rthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, thrustm = { - lightType = 'point', - pieceName = 'mthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armseap'] = { + ["armseap"] = { thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = -11.5, radius = 9, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = -11.5, radius = 9, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustm = { - lightType = 'point', - pieceName = 'thrustm', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustm", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsfig'] = { + ["armsfig"] = { front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = 15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = 15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 7, posz = 3.5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 7, posz = 3.5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fan2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 7, posz = 3.5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 7, posz = 3.5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.9, posz = -16, radius = 5, - color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, - r = 0.3, g = 0.8, b = 0.6, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.9, posz = -16, radius = 5, color2r = 0.2, color2g = 0.8, color2b = 0.45, colortime = 6, r = 0.3, g = 0.8, b = 0.6, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- thrusterl = { -- lightType = 'point', @@ -22438,69 +14163,41 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.5, g = 1, b = 0.5, a = 0.75, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.5, g = 1, b = 0.5, a = 0.75, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsehak'] = { + ["armsehak"] = { greenblob1 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 0, posy = 4, posz = -6, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.45, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 0, posy = 4, posz = -6, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.45, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1, posy = 13.5, posz = 13.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.65, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1, posy = 13.5, posz = 13.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.65, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 8, posz = 13, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 8, posz = 13, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 8, posz = 13, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 8, posz = 13, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 8, posz = -13, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 8, posz = -13, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 8, posz = -13, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 8, posz = -13, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.3, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- corner1 = { -- lightType = 'point', @@ -22539,448 +14236,264 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, fanfr = { - lightType = 'point', - pieceName = 'fanfr', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "fanfr", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fanfl = { - lightType = 'point', - pieceName = 'fanfl', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "fanfl", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fanbr = { - lightType = 'point', - pieceName = 'fanbr', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "fanbr", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fanbl = { - lightType = 'point', - pieceName = 'fanbl', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "fanbl", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armminebomber'] = { + ["armminebomber"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 0, posz = -62.5, radius = 22, - color2r = 1, color2g = 0.6, color2b = 0.2, colortime = 7, - r = 0.88, g = 0.5, b = 0.14, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 0, posz = -62.5, radius = 22, color2r = 1, color2g = 0.6, color2b = 0.2, colortime = 7, r = 0.88, g = 0.5, b = 0.14, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 0, posz = -62.5, radius = 22, - color2r = 1, color2g = 0.6, color2b = 0.2, colortime = 7, - r = 0.88, g = 0.5, b = 0.14, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 0, posz = -62.5, radius = 22, color2r = 1, color2g = 0.6, color2b = 0.2, colortime = 7, r = 0.88, g = 0.5, b = 0.14, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armliche'] = { + ["armliche"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9.5, posz = -22, radius = 8, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 7, - r = 0.88, g = 0.14, b = 0.14, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9.5, posz = -22, radius = 8, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 7, r = 0.88, g = 0.14, b = 0.14, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8.5, posz = -25, radius = 9, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 6, - r = 0.88, g = 0.14, b = 0.14, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8.5, posz = -25, radius = 9, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 6, r = 0.88, g = 0.14, b = 0.14, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8.5, posz = -25, radius = 9, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 5, - r = 0.88, g = 0.14, b = 0.14, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8.5, posz = -25, radius = 9, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 5, r = 0.88, g = 0.14, b = 0.14, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 0.7, b = 0.6, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 0.7, b = 0.6, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 0.7, b = 0.6, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 0.7, b = 0.6, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustc = { - lightType = 'point', - pieceName = 'thrustc', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 0.7, b = 0.6, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustc", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 0.7, b = 0.6, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontthruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 8.5, posz = 13, radius = 7, - color2r = 1, color2g = 0.4, color2b = 0.2, colortime = 7, - r = 0.95, g = 0.27, b = 0.17, a = 0.44, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 8.5, posz = 13, radius = 7, color2r = 1, color2g = 0.4, color2b = 0.2, colortime = 7, r = 0.95, g = 0.27, b = 0.17, a = 0.44, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontthruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 8.5, posz = 13, radius = 7, - color2r = 1, color2g = 0.4, color2b = 0.2, colortime = 6, - r = 0.95, g = 0.17, b = 0.17, a = 0.44, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 8.5, posz = 13, radius = 7, color2r = 1, color2g = 0.4, color2b = 0.2, colortime = 6, r = 0.95, g = 0.17, b = 0.17, a = 0.44, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21, posy = 26, posz = -17, radius = 6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21, posy = 26, posz = -17, radius = 6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 26, posz = -17, radius = 6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 26, posz = -17, radius = 6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashbomb1 = { - lightType = 'point', - pieceName = 'bomb1', - lightConfig = { posx = 0, posy = 0.3, posz = 10.6, radius = 4.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 22, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.3, specular = 0.2, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb1", + lightConfig = { posx = 0, posy = 0.3, posz = 10.6, radius = 4.5, color2r = -1, color2g = -1, color2b = -1, colortime = 22, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.3, specular = 0.2, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corape'] = { + ["corape"] = { thruster1 = { - lightType = 'point', - pieceName = 'rjet', - lightConfig = { posx = 0, posy = 0, posz = -7, radius = 5.5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rjet", + lightConfig = { posx = 0, posy = 0, posz = -7, radius = 5.5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'ljet', - lightConfig = { posx = 0, posy = 0, posz = -7, radius = 5.5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ljet", + lightConfig = { posx = 0, posy = 0, posz = -7, radius = 5.5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustl = { - lightType = 'point', - pieceName = 'lthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustr = { - lightType = 'point', - pieceName = 'rthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armawac'] = { + ["armawac"] = { greenblob1 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = 7, posy = 5, posz = 0, radius = 10, - color2r = 0, color2g = 1, color2b = 0, colortime = 30, - r = 0, g = 2, b = 0, a = 0.33, - modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = 7, posy = 5, posz = 0, radius = 10, color2r = 0, color2g = 1, color2b = 0, colortime = 30, r = 0, g = 2, b = 0, a = 0.33, modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblob2 = { - lightType = 'point', - pieceName = 'dish', - lightConfig = { posx = -7, posy = 5, posz = 0, radius = 10, - color2r = 0, color2g = 1, color2b = 0, colortime = 30, - r = 0, g = 2, b = 0, a = 0.33, - modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dish", + lightConfig = { posx = -7, posy = 5, posz = 0, radius = 10, color2r = 0, color2g = 1, color2b = 0, colortime = 30, r = 0, g = 2, b = 0, a = 0.33, modelfactor = 0.8, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 11, posz = -14, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 11, posz = -14, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.5, posy = 11, posz = -14, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.5, posy = 11, posz = -14, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 12, posz = 11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 12, posz = 11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 12, posz = 11, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 12, posz = 11, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, passivethruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.3, posz = -30, radius = 8, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.3, posz = -30, radius = 8, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust = { - lightType = 'point', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = -4, radius = 22, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = -4, radius = 22, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormine4'] = { + ["cormine4"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 4.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 4.5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfmine3'] = { + ["corfmine3"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8.5, posz = 0, radius = 3.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8.5, posz = 0, radius = 3.5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, core = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 6.5, - color2r = -1, color2g = -1, color2b = -1, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 6.5, color2r = -1, color2g = -1, color2b = -1, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormine3'] = { + ["cormine3"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 3.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 3.5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, core = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 6.5, - color2r = -1, color2g = -1, color2b = -1, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 6.5, color2r = -1, color2g = -1, color2b = -1, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormine2'] = { + ["cormine2"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 4.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 4.5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormine1'] = { + ["cormine1"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 4.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 4.5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfmine3'] = { + ["armfmine3"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10.5, posz = 0, radius = 4.0, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10.5, posz = 0, radius = 4.0, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmine3'] = { + ["armmine3"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 4.5, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 4.5, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmine2'] = { + ["armmine2"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.2, posz = 0, radius = 4.0, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.2, posz = 0, radius = 4.0, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmine1'] = { + ["armmine1"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7.2, posz = 0, radius = 3.5, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7.2, posz = 0, radius = 3.5, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsd'] = { + ["armsd"] = { antenna = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 25, posz = 8.5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 1, b = 1, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 25, posz = 8.5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 1, b = 1, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 9, posz = 12, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 3}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 9, posz = 12, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 3 }, }, }, - ['armvulc'] = { + ["armvulc"] = { whitemid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -37, posy = 44, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -37, posy = 44, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, whitemid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -37, posy = 44, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -37, posy = 44, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, whitemid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 37, posy = 44, posz = -37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 37, posy = 44, posz = -37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, whitemid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 37, posy = 44, posz = 37, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 37, posy = 44, posz = 37, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mid1 = { -- lightType = 'point', @@ -23019,124 +14532,64 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, base1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -8, posy = 17, posz = 45, radius = 16, - pos2x = 8, pos2y = 17.1, pos2z = 45, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -8, posy = 17, posz = 45, radius = 16, pos2x = 8, pos2y = 17.1, pos2z = 45, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -8, posy = 17, posz = -45, radius = 16, - pos2x = 8, pos2y = 17.1, pos2z = -45, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -8, posy = 17, posz = -45, radius = 16, pos2x = 8, pos2y = 17.1, pos2z = -45, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 45, posy = 17, posz = -8, radius = 16, - pos2x = 45, pos2y = 17.1, pos2z = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 45, posy = 17, posz = -8, radius = 16, pos2x = 45, pos2y = 17.1, pos2z = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -45, posy = 17, posz = -8, radius = 16, - pos2x = -45, pos2y = 17.1, pos2z = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -45, posy = 17, posz = -8, radius = 16, pos2x = -45, pos2y = 17.1, pos2z = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -6, posy = 44, posz = 42, radius = 14, - pos2x = 6, pos2y = 44.1, pos2z = 42, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -6, posy = 44, posz = 42, radius = 14, pos2x = 6, pos2y = 44.1, pos2z = 42, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -6, posy = 44, posz = -42, radius = 14, - pos2x = 6, pos2y = 44.1, pos2z = -42, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -6, posy = 44, posz = -42, radius = 14, pos2x = 6, pos2y = 44.1, pos2z = -42, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 42, posy = 44, posz = -6, radius = 14, - pos2x = 42, pos2y = 44.1, pos2z = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 42, posy = 44, posz = -6, radius = 14, pos2x = 42, pos2y = 44.1, pos2z = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basemid4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -42, posy = 44, posz = -6, radius = 14, - pos2x = -42, pos2y = 44.1, pos2z = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -42, posy = 44, posz = -6, radius = 14, pos2x = -42, pos2y = 44.1, pos2z = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basehigh1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 66, posz = 37, radius = 13, - pos2x = 4.5, pos2y = 66.1, pos2z = 37, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 66, posz = 37, radius = 13, pos2x = 4.5, pos2y = 66.1, pos2z = 37, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basehigh2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 66, posz = -37, radius = 13, - pos2x = 4.5, pos2y = 66.1, pos2z = -37, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 66, posz = -37, radius = 13, pos2x = 4.5, pos2y = 66.1, pos2z = -37, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basehigh3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 37, posy = 66, posz = -4.5, radius = 13, - pos2x = 37, pos2y = 66.1, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 37, posy = 66, posz = -4.5, radius = 13, pos2x = 37, pos2y = 66.1, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, basehigh4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -37, posy = 66, posz = -4.5, radius = 13, - pos2x = -37, pos2y = 66.1, pos2z = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.3, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -37, posy = 66, posz = -4.5, radius = 13, pos2x = -37, pos2y = 66.1, pos2z = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.3, g = 1, b = 0.2, a = 0.4, modelfactor = 0.3, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- base2 = { @@ -23248,44 +14701,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turretbase1up = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -18, posy = 30, posz = -19, radius = 15.4, - dirx = 0, diry = 0.5, dirz = 0, theta = -21, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -18, posy = 30, posz = -19, radius = 15.4, dirx = 0, diry = 0.5, dirz = 0, theta = -21, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, turretbase2up = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 18, posy = 30, posz = -19, radius = 15.4, - dirx = 0, diry = 0.5, dirz = 0, theta = -21, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 18, posy = 30, posz = -19, radius = 15.4, dirx = 0, diry = 0.5, dirz = 0, theta = -21, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.6, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, trustflashlf = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 19.1, posy = 29.5, posz = 0, radius = 4.3, - dirx = 0, diry = 2, dirz = 0, theta = -12, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 19.1, posy = 29.5, posz = 0, radius = 4.3, dirx = 0, diry = 2, dirz = 0, theta = -12, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trustflashrf = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -19.1, posy = 29.5, posz = 0, radius = 4.3, - dirx = 0, diry = 2, dirz = 0, theta = -12, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -19.1, posy = 29.5, posz = 0, radius = 4.3, dirx = 0, diry = 2, dirz = 0, theta = -12, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- turretbase2 = { -- lightType = 'point', @@ -23315,120 +14748,72 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, turrettop1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 16, posy = 67, posz = -18, radius = 15, - color2r = -2, color2g = -2, color2b = -2, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 16, posy = 67, posz = -18, radius = 15, color2r = -2, color2g = -2, color2b = -2, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, turrettop2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -16, posy = 67, posz = -18, radius = 15, - color2r = -2, color2g = -2, color2b = -2, colortime = 30, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -16, posy = 67, posz = -18, radius = 15, color2r = -2, color2g = -2, color2b = -2, colortime = 30, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, }, - ['armtl'] = { + ["armtl"] = { barrel1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = -2.4, posz = -6, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = -2.4, posz = -6, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = -2.4, posz = 6, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = -2.4, posz = 6, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = -2.4, posz = -6, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = -2.4, posz = -6, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = -2.4, posz = 6, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = -2.4, posz = 6, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, torpedoflash = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 3.7, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 3.7, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cortl'] = { + ["cortl"] = { torpedoflash = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 0.2, posy = -4.3, posz = 17.5, radius = 2.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 0.2, posy = -4.3, posz = 17.5, radius = 2.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armbotrail'] = { + ["armbotrail"] = { top = { - lightType = 'point', - pieceName = 'rail', - lightConfig = { posx = 0, posy = 63, posz = -113, radius = 40, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rail", + lightConfig = { posx = 0, posy = 63, posz = -113, radius = 40, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, inner = { - lightType = 'point', - pieceName = 'rail', - lightConfig = { posx = 0, posy = 33, posz = -70, radius = 32, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.13, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rail", + lightConfig = { posx = 0, posy = 33, posz = -70, radius = 32, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.13, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfus'] = { + ["armfus"] = { fusionglow1 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 16, posz = 0, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 1.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 16, posz = 0, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 1.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionglow2 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = 16, posz = 0, radius = 9, - color2r = -0.2, color2g = -0.2, color2b = -0.2, colortime = 70, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 1.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = 16, posz = 0, radius = 9, color2r = -0.2, color2g = -0.2, color2b = -0.2, colortime = 70, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 1.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionglow3 = { -- lightType = 'point', @@ -23467,40 +14852,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, fusionglow7 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 7, posz = 0, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 7, posz = 0, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionglow8 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = 7, posz = 0, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = 7, posz = 0, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top_outter1 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.4, g = 1, b = 0.2, a = 2.7, - modelfactor = 1.4, specular = 0.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.4, g = 1, b = 0.2, a = 2.7, modelfactor = 1.4, specular = 0.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top_outter2 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.4, g = 1, b = 0.2, a = 2.7, - modelfactor = 1.4, specular = 1.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.4, g = 1, b = 0.2, a = 2.7, modelfactor = 1.4, specular = 1.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top_outter1 = { -- lightType = 'point', @@ -23647,118 +15016,64 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, side1 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = -26, posy = -32, posz = 0, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.8, specular = 0.4, scattering = 1.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = -26, posy = -32, posz = 0, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.8, specular = 0.4, scattering = 1.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -32, posz = -25, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -32, posz = -25, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -32, posz = 25, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -32, posz = 25, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 26, posy = -32, posz = 0, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 26, posy = -32, posz = 0, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side5 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -32, posz = -25, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -32, posz = -25, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side6 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -32, posz = 25, radius = 13, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.2, g = 1, b = 0.7, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -32, posz = 25, radius = 13, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.2, g = 1, b = 0.7, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 80, - dirx = -1, diry = -0.45, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 80, dirx = -1, diry = -0.45, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, - dirx = 0, diry = -0.45, dirz = -1, theta = 0.29, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, dirx = 0, diry = -0.45, dirz = -1, theta = 0.29, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, - dirx = 0, diry = -0.45, dirz = 1, theta = 0.29, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, dirx = 0, diry = -0.45, dirz = 1, theta = 0.29, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4cone = { - lightType = 'cone', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, - dirx = 0, diry = -0.45, dirz = -1, theta = 0.29, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, dirx = 0, diry = -0.45, dirz = -1, theta = 0.29, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side5cone = { - lightType = 'cone', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 80, - dirx = 1, diry = -0.45, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 80, dirx = 1, diry = -0.45, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side6cone = { - lightType = 'cone', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, - dirx = 0, diry = -0.45, dirz = 1, theta = 0.29, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -28, posz = 0, radius = 50, dirx = 0, diry = -0.45, dirz = 1, theta = 0.29, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- cylinder1 = { -- lightType = 'point', @@ -23869,7 +15184,7 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corfus'] = { + ["corfus"] = { -- fusionglowcoretimed = { -- lightType = 'point', -- pieceName = 'emit', @@ -23891,125 +15206,93 @@ local unitLights = { -- }, fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 41, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, -- Negative colortime means modulate it - --dirx = 0.1, diry = 0.11, dirz = 0.12, theta = -12.0, -- Orbit at a radius of 16 elmos with a period of ~0.1Hz - r = -1, g = 1, b = 1, a = 0.66, - modelfactor = 0.1, specular = 1.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 41, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 0, -- Negative colortime means modulate it + --dirx = 0.1, diry = 0.11, dirz = 0.12, theta = -12.0, -- Orbit at a radius of 16 elmos with a period of ~0.1Hz + r = -1, + g = 1, + b = 1, + a = 0.66, + modelfactor = 0.1, + specular = 1.2, + scattering = 2, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, teamflashbot1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.3, posy = 17.1, posz = 24.2, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.3, posy = 17.1, posz = 24.2, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashbot2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.3, posy = 17.1, posz = 24.2, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.3, posy = 17.1, posz = 24.2, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashtopright1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18.3, posy = 17.1, posz = -16.6, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18.3, posy = 17.1, posz = -16.6, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashtopright2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23.4, posy = 17.1, posz = -7.5, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23.4, posy = 17.1, posz = -7.5, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashtopleft1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18.3, posy = 17.1, posz = -16.6, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18.3, posy = 17.1, posz = -16.6, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashtopleft2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23.4, posy = 17.1, posz = -7.5, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23.4, posy = 17.1, posz = -7.5, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashbotleft1 = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = -19.4, posy = 12.0, posz = 13.6, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = -19.4, posy = 12.0, posz = 13.6, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashbotleft2 = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = -21.7, posy = 12.0, posz = 10.0, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = -21.7, posy = 12.0, posz = 10.0, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashbotright1 = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = 19.4, posy = 12.0, posz = 13.6, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = 19.4, posy = 12.0, posz = 13.6, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashbotright2 = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = 21.7, posy = 12.0, posz = 10.0, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = 21.7, posy = 12.0, posz = 10.0, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashtopright = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = 2.3, posy = 12.0, posz = -23.6, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = 2.3, posy = 12.0, posz = -23.6, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashtopleft = { - lightType = 'point', - pieceName = 'sleevbasees', - lightConfig = { posx = -2.3, posy = 12.0, posz = -23.6, radius = 1.2, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevbasees", + lightConfig = { posx = -2.3, posy = 12.0, posz = -23.6, radius = 1.2, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 1.0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionorb = { @@ -24022,35 +15305,23 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['legfus'] = { + ["legfus"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 45, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 45, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionglow2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 55, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 55, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corafus'] = { + ["corafus"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 81, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.68, - modelfactor = 0.1, specular = 1.2, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 81, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.68, modelfactor = 0.1, specular = 1.2, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionglowmid = { -- lightType = 'point', @@ -24062,107 +15333,60 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, chargeflashright = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 40, posy = 33, posz = 24, radius = 10.0, - dirx = 0, diry = 0.333333, dirz = 0, theta = -16, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.1, b = 0.1, a = 3.5, - modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 8}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 40, posy = 33, posz = 24, radius = 10.0, dirx = 0, diry = 0.333333, dirz = 0, theta = -16, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.1, b = 0.1, a = 3.5, modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 8 }, }, chargeflashleft = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -40, posy = 33, posz = 24, radius = 10.0, - dirx = 0, diry = 0.333333, dirz = 0, theta = -16, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 8}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -40, posy = 33, posz = 24, radius = 10.0, dirx = 0, diry = 0.333333, dirz = 0, theta = -16, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 8 }, }, chargeflashtop = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 33, posz = -45, radius = 10.0, - dirx = 0, diry = 0.333333, dirz = 0, theta = -16, - color2r = -1, color2g = -1, color2b = -1, colortime = 90, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 8}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 33, posz = -45, radius = 10.0, dirx = 0, diry = 0.333333, dirz = 0, theta = -16, color2r = -1, color2g = -1, color2b = -1, colortime = 90, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 8 }, }, teamflashlowleft1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.3, posy = 9.5, posz = 51.8, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.3, posy = 9.5, posz = 51.8, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlowright1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.3, posy = 9.5, posz = 51.8, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.3, posy = 9.5, posz = 51.8, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashhighleft1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.3, posy = 26.9, posz = 32.3, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.3, posy = 26.9, posz = 32.3, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashhighright1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.3, posy = 26.9, posz = 32.3, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 20, - r = -1, g = 0, b = 0, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.3, posy = 26.9, posz = 32.3, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 20, r = -1, g = 0, b = 0, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlowleft2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -47.8, posy = 9.5, posz = -20.4, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -47.8, posy = 9.5, posz = -20.4, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlowright2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -41.5, posy = 9.5, posz = -31.0, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -41.5, posy = 9.5, posz = -31.0, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlowleft3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 47.8, posy = 9.5, posz = -20.4, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 47.8, posy = 9.5, posz = -20.4, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashlowright3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 41.5, posy = 9.5, posz = -31.3, radius = 1.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 41.5, posy = 9.5, posz = -31.3, radius = 1.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionorb = { -- lightType = 'point', @@ -24174,15 +15398,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corafust3'] = { + ["corafust3"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.66, - modelfactor = 0.1, specular = 1.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.66, modelfactor = 0.1, specular = 1.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionorb = { -- lightType = 'point', @@ -24194,53 +15414,33 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armafus'] = { + ["armafus"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 92, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1.2, scattering = 0.9, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 8}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 92, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1.2, scattering = 0.9, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 8 }, }, fusionglow2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -55, posz = 0, radius = 112, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -2, g = 1, b = 1, a = 0.3, - modelfactor = 0.3, specular = 1.2, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = -55, posz = 0, radius = 112, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -2, g = 1, b = 1, a = 0.3, modelfactor = 0.3, specular = 1.2, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionorb = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 80, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 80, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armafust3'] = { + ["armafust3"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 144, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 144, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1.2, scattering = 2, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fusionglow2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 164, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.2, scattering = 1.5, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- fusionorb = { -- lightType = 'point', @@ -24252,175 +15452,102 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['resourcecheat'] = { + ["resourcecheat"] = { fusionglow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 220, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.1, specular = 0.66, scattering = 1, lensflare = 5, - lifetime = 0, sustain = 0, selfshadowing = 8}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 220, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.1, specular = 0.66, scattering = 1, lensflare = 5, lifetime = 0, sustain = 0, selfshadowing = 8 }, }, fusionorb = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 0.2, - modelfactor = 0.1, specular = 1, scattering = 9, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 0.2, modelfactor = 0.1, specular = 1, scattering = 9, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, }, - ['armzeus'] = { + ["armzeus"] = { eyes = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 4.3, posz = 10, radius = 11, - color2r = 0.15, color2g = 0.15, color2b = 0.05, colortime = -1, - r = 1, g = 1, b = 0.5, a = 0.25, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 4.3, posz = 10, radius = 11, color2r = 0.15, color2g = 0.15, color2b = 0.05, colortime = -1, r = 1, g = 1, b = 0.5, a = 0.25, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 4.3, posz = 3, radius = 60, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, - r = 1, g = 1, b = 0.89, a = 0.3, - modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 4.3, posz = 3, radius = 60, dirx = 0, diry = -0.08, dirz = 1, theta = 0.7, r = 1, g = 1, b = 0.89, a = 0.3, modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponglow = { - lightType = 'point', - pieceName = 'gun_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, - color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.6, - modelfactor = 0.1, specular = 0.75, scattering = 1.2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 9, color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.6, modelfactor = 0.1, specular = 0.75, scattering = 1.2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponspark = { - lightType = 'point', - pieceName = 'spark_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 55, - color2r = 0, color2g = 0, color2b = 0, colortime = 2, - r = 1, g = 1, b = 1, a = 0.85, - modelfactor = 0.1, specular = 0.75, scattering = 0.2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "spark_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 55, color2r = 0, color2g = 0, color2b = 0, colortime = 2, r = 1, g = 1, b = 1, a = 0.85, modelfactor = 0.1, specular = 0.75, scattering = 0.2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningbackpackglow = { - lightType = 'point', - pieceName = 'static_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.65, - modelfactor = 0.1, specular = 0.75, scattering = 2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "static_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 0.4, color2g = 0.7, color2b = 1.2, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.65, modelfactor = 0.1, specular = 0.75, scattering = 2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armclaw'] = { + ["armclaw"] = { weaponglow = { - lightType = 'point', - pieceName = 'glow', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.65, - modelfactor = 0.1, specular = 0.75, scattering = 1.5, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "glow", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.65, modelfactor = 0.1, specular = 0.75, scattering = 1.5, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponspark = { - lightType = 'point', - pieceName = 'sparkemit', - lightConfig = { posx = 0, posy = -4, posz = 0, radius = 46, - color2r = 0, color2g = 0, color2b = 0, colortime = 2, - r = 0.6, g = 0.8, b = 1, a = 0.70, - modelfactor = 0.1, specular = 0.05, scattering = 0.2, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sparkemit", + lightConfig = { posx = 0, posy = -4, posz = 0, radius = 46, color2r = 0, color2g = 0, color2b = 0, colortime = 2, r = 0.6, g = 0.8, b = 1, a = 0.70, modelfactor = 0.1, specular = 0.05, scattering = 0.2, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armyork'] = { + ["armyork"] = { searchlightsource = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 1.1, posy = 8.2, posz = 5.3, radius = 1.9, - pos2x = -1.1, pos2y = 8.2, pos2z = 5.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 1.1, posy = 8.2, posz = 5.3, radius = 1.9, pos2x = -1.1, pos2y = 8.2, pos2z = 5.3, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'turret', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 8.2, posz = 5, radius = 475, - dirx = 0, diry = 0.6, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, - modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 8.2, posz = 5, radius = 475, dirx = 0, diry = 0.6, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.45, colortime = -1.5, modelfactor = 0, specular = 0.5, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 15, posz = 13.4, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 15, posz = 13.4, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 15, posz = 13.4, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 15, posz = 13.4, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennaaa = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 27.8, posz = -17.7, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 1.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 27.8, posz = -17.7, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 1.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel1aa = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = -5, posy = 0.0, posz = 18.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { posx = -5, posy = 0.0, posz = 18.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel2aa = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = 5, posy = 0.0, posz = 18.0, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { posx = 5, posy = 0.0, posz = 18.0, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel3aa = { - lightType = 'point', - pieceName = 'barrel3', - lightConfig = { posx = -5, posy = 0.0, posz = 17.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel3", + lightConfig = { posx = -5, posy = 0.0, posz = 17.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretbarrel4aa = { - lightType = 'point', - pieceName = 'barrel4', - lightConfig = { posx = 5, posy = 0.0, posz = 17.5, radius = 4, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel4", + lightConfig = { posx = 5, posy = 0.0, posz = 17.5, radius = 4, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front1 = { -- lightType = 'point', @@ -24441,142 +15568,102 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmanni'] = { + ["armmanni"] = { antenna = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -5, posy = 23, posz = -6, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, - r = 1, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -5, posy = 23, posz = -6, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -2.0, r = 1, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, zoomlight = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 7.5, posz = 19, radius = 18, - dirx = 0, diry = 0, dirz = 0.5, theta = -10, - color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, - r = 0.1, g = 0.3, b = 1.2, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 7.5, posz = 19, radius = 18, dirx = 0, diry = 0, dirz = 0.5, theta = -10, color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, r = 0.1, g = 0.3, b = 1.2, a = 2.5, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, zoomlightglow = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 8.5, posz = 19, radius = 4, - dirx = 0, diry = 0, dirz = 0.5, theta = -10, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = 1, g = 1, b = 2, a = 3, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 8.5, posz = 19, radius = 4, dirx = 0, diry = 0, dirz = 0.5, theta = -10, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = 1, g = 1, b = 2, a = 3, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 15, posz = 5, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0.2, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 15, posz = 5, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.2, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0.2, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = -6, posy = 7.5, posz = 14, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.07, - color2r = 0.8, color2g = 0.8, color2b = 0.8, colortime = -1.0, -- whiten with texture anim pulsing - r = 1, g = 1, b = 0.8, a = 0.25, - modelfactor = 0, specular = 1, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { + posx = -6, + posy = 7.5, + posz = 14, + radius = 400, + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.07, + color2r = 0.8, + color2g = 0.8, + color2b = 0.8, + colortime = -1.0, -- whiten with texture anim pulsing + r = 1, + g = 1, + b = 0.8, + a = 0.25, + modelfactor = 0, + specular = 1, + scattering = 1, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, front = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -6, posy = 8, posz = 14, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -6, posy = 8, posz = 14, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armlatnk'] = { + ["armlatnk"] = { lightningweaponglow = { - lightType = 'point', - pieceName = 'emit_spark', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, - color2r = 0.4, color2g = 0.7, color2b = 1.25, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.6, - modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit_spark", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 8, color2r = 0.4, color2g = 0.7, color2b = 1.25, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.6, modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponflashl = { - lightType = 'point', - pieceName = 'lturret', - lightConfig = { posx = 0, posy = 2, posz = 10, radius = 2.6, - dirx = 0, diry = 0, dirz = 1, theta = -3, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1.2, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturret", + lightConfig = { posx = 0, posy = 2, posz = 10, radius = 2.6, dirx = 0, diry = 0, dirz = 1, theta = -3, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1.2, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'lturret', - lightConfig = { posx = -7, posy = 0, posz = 4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturret", + lightConfig = { posx = -7, posy = 0, posz = 4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'lturret', - lightConfig = { posx = 7, posy = 0, posz = 4, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturret", + lightConfig = { posx = 7, posy = 0, posz = 4, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelightl = { - lightType = 'beam', - pieceName = 'lturret', - lightConfig = { posx = 6.5, posy = 4.7, posz = 1.9, radius = 2.7, - pos2x = 6.5, pos2y = 4.5, pos2z = -0.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.3, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "lturret", + lightConfig = { posx = 6.5, posy = 4.7, posz = 1.9, radius = 2.7, pos2x = 6.5, pos2y = 4.5, pos2z = -0.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.3, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sidelight3 = { - lightType = 'beam', - pieceName = 'lturret', - lightConfig = { posx = -6.5, posy = 4.7, posz = 1.9, radius = 2.7, - pos2x = -6.5, pos2y = 4.5, pos2z = -0.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.3, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "lturret", + lightConfig = { posx = -6.5, posy = 4.7, posz = 1.9, radius = 2.7, pos2x = -6.5, pos2y = 4.5, pos2z = -0.9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.3, g = 1, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights1 = { - lightType = 'beam', - pieceName = 'mbarrel', - lightConfig = { posx = -3.6, posy = 1.6, posz = 3.3, radius = 0.9, - pos2x = -3.6, pos2y = 1.6, pos2z = 1.8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mbarrel", + lightConfig = { posx = -3.6, posy = 1.6, posz = 3.3, radius = 0.9, pos2x = -3.6, pos2y = 1.6, pos2z = 1.8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights2 = { - lightType = 'beam', - pieceName = 'mbarrel', - lightConfig = { posx = 3.6, posy = 1.6, posz = 3.3, radius = 0.9, - pos2x = 3.6, pos2y = 1.6, pos2z = 1.8, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "mbarrel", + lightConfig = { posx = 3.6, posy = 1.6, posz = 3.3, radius = 0.9, pos2x = 3.6, pos2y = 1.6, pos2z = 1.8, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -24597,331 +15684,191 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armsptk'] = { + ["armsptk"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 8.5, posz = 16.5, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.3, g = 1, b = 0.3, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 5}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 8.5, posz = 16.5, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.3, g = 1, b = 0.3, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 5 }, }, bodybackr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 14, posz = -15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.4, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 14, posz = -15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.4, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodybackl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 14, posz = -15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.4, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 14, posz = -15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.4, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 8.5, posz = -0.3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 90, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 8.5, posz = -0.3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 90, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -4.5, posy = 8.5, posz = -0.3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -4.5, posy = 8.5, posz = -0.3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 4.5, posy = 8.5, posz = -0.3, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 4.5, posy = 8.5, posz = -0.3, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsptkt4'] = { + ["armsptkt4"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = 32, radius = 32, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = 32, radius = 32, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20, posz = -28, radius = 19, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 0.3, a = 0.1, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 20, posz = -28, radius = 19, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 0.3, a = 0.1, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 16, posz = 0, radius = 19, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 1, a = 0.07, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 16, posz = 0, radius = 19, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 1, a = 0.07, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -7.7, posy = 16, posz = 0, radius = 19, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 1, a = 0.07, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -7.7, posy = 16, posz = 0, radius = 19, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 1, a = 0.07, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 7.7, posy = 16, posz = 0, radius = 19, - color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 1, a = 0.07, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 7.7, posy = 16, posz = 0, radius = 19, color2r = 1, color2g = 1, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 1, a = 0.07, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armspid'] = { + ["armspid"] = { nanolight = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 0, posz = 1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 0, posz = 1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplight = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 0.2, posz = 6.3, radius = 8, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 0.2, posz = 6.3, radius = 8, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empblast = { - lightType = 'point', - pieceName = 'emplight', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 25, - color2r = 0.3, color2g = 0.3, color2b = 0.7, colortime = 1.5, - r = 0.85, g = 0.85, b = 1.1, a = 0.2, - modelfactor = 0.2, specular = 0.3, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "emplight", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 25, color2r = 0.3, color2g = 0.3, color2b = 0.7, colortime = 1.5, r = 0.85, g = 0.85, b = 1.1, a = 0.2, modelfactor = 0.2, specular = 0.3, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9, posz = 6.2, radius = 4.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.4, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9, posz = 6.2, radius = 4.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.4, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, midwhite = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -1.5, posy = 4.0, posz = -0.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 25, - r = 0.85, g = 0.85, b = 1.1, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -1.5, posy = 4.0, posz = -0.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 25, r = 0.85, g = 0.85, b = 1.1, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13, posz = -9, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.3, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13, posz = -9, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.3, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armjeth'] = { + ["armjeth"] = { eyes = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 14.5, posz = 5.5, radius = 3.1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 14.5, posz = 5.5, radius = 3.1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 12, posz = -8, radius = 5, - color2r = 1, color2g = 1, color2b = 0.3, colortime = -1.5, - r = 1.2, g = 1, b = 0.3, a = 0.8, - modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 12, posz = -8, radius = 5, color2r = 1, color2g = 1, color2b = 0.3, colortime = -1.5, r = 1.2, g = 1, b = 0.3, a = 0.8, modelfactor = 0.4, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 7.5, posz = 9, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 7.5, posz = 9, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm1 = { - lightType = 'point', - pieceName = 'lturret', - lightConfig = { posx = 1.5, posy = 0, posz = 8, radius = 3, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturret", + lightConfig = { posx = 1.5, posy = 0, posz = 8, radius = 3, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, arm2 = { - lightType = 'point', - pieceName = 'rturret', - lightConfig = { posx = -1.5, posy = 0, posz = 8, radius = 3, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rturret", + lightConfig = { posx = -1.5, posy = 0, posz = 8, radius = 3, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 300, - dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 300, dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfboy'] = { + ["armfboy"] = { top = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9.5, posz = -1.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9.5, posz = -1.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topfront1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -6.0, posy = 2.5, posz = 6.0, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -6.0, posy = 2.5, posz = 6.0, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topfront2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 6.5, posy = 2.5, posz = 6.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 6.5, posy = 2.5, posz = 6.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 0, posy = 9.0, posz = 11.0, radius = 5.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 0.9, g = 1, b = 1, a = 0.44, - modelfactor = 0.4, specular = 0.8, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 0, posy = 9.0, posz = 11.0, radius = 5.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 0.9, g = 1, b = 1, a = 0.44, modelfactor = 0.4, specular = 0.8, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -13, posy = 5.5, posz = -19, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -13, posy = 5.5, posz = -19, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 13, posy = 5.5, posz = -19, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 13, posy = 5.5, posz = -19, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightglow1 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 10.5, posy = 0.5, posz = 15.6, radius = 2.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 10.5, posy = 0.5, posz = 15.6, radius = 2.4, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightglow2 = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = -10.5, posy = 0.5, posz = 15.6, radius = 2.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1, g = 1, b = 1, a = 1.0, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = -10.5, posy = 0.5, posz = 15.6, radius = 2.4, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1, g = 1, b = 1, a = 1.0, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { - lightType = 'cone', - pieceName = 'body', - lightConfig = { posx = 8, posy = 2.8, posz = 14, radius = 30, - dirx = 0.95, diry = -0.9, dirz = 0.9, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.36, - modelfactor = -0.9, specular = -0.3, scattering = 1.8, lensflare = 0.0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "body", + lightConfig = { posx = 8, posy = 2.8, posz = 14, radius = 30, dirx = 0.95, diry = -0.9, dirz = 0.9, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.36, modelfactor = -0.9, specular = -0.3, scattering = 1.8, lensflare = 0.0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { - lightType = 'cone', - pieceName = 'body', - lightConfig = { posx = -8, posy = 2.8, posz = 14, radius = 30, - dirx = -0.95, diry = -0.9, dirz = 0.9, theta = 0.5, - r = 1, g = 1, b = 0.89, a = 0.36, - modelfactor = -0.9, specular = -0.3, scattering = 1.8, lensflare = 0.0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "body", + lightConfig = { posx = -8, posy = 2.8, posz = 14, radius = 30, dirx = -0.95, diry = -0.9, dirz = 0.9, theta = 0.5, r = 1, g = 1, b = 0.89, a = 0.36, modelfactor = -0.9, specular = -0.3, scattering = 1.8, lensflare = 0.0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfast'] = { + ["armfast"] = { top = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 6.8, posz = -1.9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 6.8, posz = -1.9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 3, posz = 5.1, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.1, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 3, posz = 5.1, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.1, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- front = { -- lightType = 'point', @@ -24933,220 +15880,122 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, frontbeam = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 5.5, posz = 5.2, radius = 2, - pos2x = 0, pos2y = 3, pos2z = 5.19, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.1, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 0, posy = 5.5, posz = 5.2, radius = 2, pos2x = 0, pos2y = 3, pos2z = 5.19, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.1, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashgunside = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = -3, posy = -6.8, posz = 1, radius = 2.2, - dirx = 0, diry = -2, dirz = 0, theta = -2.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = -3, posy = -6.8, posz = 1, radius = 2.2, dirx = 0, diry = -2, dirz = 0, theta = -2.7, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashgunback = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = -2, posy = -6.8, posz = 0, radius = 2.2, - dirx = 0, diry = -2, dirz = 0, theta = -2.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = -2, posy = -6.8, posz = 0, radius = 2.2, dirx = 0, diry = -2, dirz = 0, theta = -2.7, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashguninside = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 2.1, posy = -6.8, posz = 0, radius = 2.2, - dirx = 0, diry = -2, dirz = 0, theta = -2.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 2.1, posy = -6.8, posz = 0, radius = 2.2, dirx = 0, diry = -2, dirz = 0, theta = -2.7, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashguninside2 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 2.3, posy = -6.8, posz = 1, radius = 2.2, - dirx = 0, diry = -2, dirz = 0, theta = -2.7, - color2r = -1, color2g = -1, color2b = -1, colortime = 15, - r = -1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 2.3, posy = -6.8, posz = 1, radius = 2.2, dirx = 0, diry = -2, dirz = 0, theta = -2.7, color2r = -1, color2g = -1, color2b = -1, colortime = 15, r = -1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.4, specular = 0.9, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armscab'] = { + ["armscab"] = { eyes = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 0, posy = 23, posz = 21.5, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 0, posy = 23, posz = 21.5, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, unstocked = { - lightType = 'point', - pieceName = 'unstocked', + lightType = "point", + pieceName = "unstocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = 2, g = 0.8, b = 0, a = 0.8, - modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, - + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = 2, g = 0.8, b = 0, a = 0.8, modelfactor = 0.1, specular = 0.3, scattering = 0.55, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, stocked = { - lightType = 'point', - pieceName = 'stocked', + lightType = "point", + pieceName = "stocked", alliedOnly = true, - lightConfig = { posx = 0, posy = 1.0, posz = 0, radius = 17, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 0.75, - modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 4}, - + lightConfig = { posx = 0, posy = 1.0, posz = 0, radius = 17, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 0.75, modelfactor = -0.1, specular = 0.1, scattering = 0.3, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top1 = { - lightType = 'point', - pieceName = 'ldoor', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ldoor", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'rdoor', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 17, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1, g = 1, b = 0.25, a = 0.11, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rdoor", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 17, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1, g = 1, b = 0.25, a = 0.11, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmav'] = { + ["armmav"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 1, posz = 14.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 1, posz = 14.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -5.5, posy = 2.5, posz = 6.2, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -5.5, posy = 2.5, posz = 6.2, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 5.5, posy = 2.5, posz = 6.2, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 5.5, posy = 2.5, posz = 6.2, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, visorbar1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -1.8, posz = 15, radius = 1.4, - dirx = 1, diry = 0, dirz = 0, theta = -3.6, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1, a = 2.5, - modelfactor = 0.1, specular = 0.9, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -1.8, posz = 15, radius = 1.4, dirx = 1, diry = 0, dirz = 0, theta = -3.6, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1, a = 2.5, modelfactor = 0.1, specular = 0.9, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun1 = { - lightType = 'point', - pieceName = 'rhandgun', - lightConfig = { posx = 0, posy = -6.5, posz = 1, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.2, g = 1, b = 0.25, a = 1.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rhandgun", + lightConfig = { posx = 0, posy = -6.5, posz = 1, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.2, g = 1, b = 0.25, a = 1.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightgun1 = { - lightType = 'cone', - pieceName = 'rhandgun', - lightConfig = { posx = 0, posy = 6, posz = 1, radius = 35, - dirx = 0, diry = -1, dirz = -0.01, theta = 0.17, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1, g = 0.95, b = 0.7, a = 0.9, - modelfactor = -0.4, specular = -1.5, scattering = 2.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rhandgun", + lightConfig = { posx = 0, posy = 6, posz = 1, radius = 35, dirx = 0, diry = -1, dirz = -0.01, theta = 0.17, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1, g = 0.95, b = 0.7, a = 0.9, modelfactor = -0.4, specular = -1.5, scattering = 2.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun2 = { - lightType = 'point', - pieceName = 'lhandgun', - lightConfig = { posx = 0, posy = -6.5, posz = 1, radius = 7, - color2r = 1.2, color2g = 1, color2b = 0.25, colortime = 60, - r = 0, g = 0, b = 0, a = 1.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lhandgun", + lightConfig = { posx = 0, posy = -6.5, posz = 1, radius = 7, color2r = 1.2, color2g = 1, color2b = 0.25, colortime = 60, r = 0, g = 0, b = 0, a = 1.7, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightgun2 = { - lightType = 'cone', - pieceName = 'lhandgun', - lightConfig = { posx = 0, posy = 6, posz = 1, radius = 35, - dirx = 0, diry = -1, dirz = -0.01, theta = 0.17, - color2r = 1, color2g = 0.95, color2b = 0.7, colortime = 60, - r = 0, g = 0, b = 0, a = 0.9, - modelfactor = -0.4, specular = -1.5, scattering = 2.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lhandgun", + lightConfig = { posx = 0, posy = 6, posz = 1, radius = 35, dirx = 0, diry = -1, dirz = -0.01, theta = 0.17, color2r = 1, color2g = 0.95, color2b = 0.7, colortime = 60, r = 0, g = 0, b = 0, a = 0.9, modelfactor = -0.4, specular = -1.5, scattering = 2.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armrock'] = { + ["armrock"] = { barrel = { - lightType = 'point', - pieceName = 'lmisspod', - lightConfig = { posx = 3, posy = 0, posz = 4.5, radius = 9, - color2r = 1, color2g = 1, color2b = 0.25, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.8, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lmisspod", + lightConfig = { posx = 3, posy = 0, posz = 4.5, radius = 9, color2r = 1, color2g = 1, color2b = 0.25, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.8, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -2, posy = 11.5, posz = 0, radius = 9, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -2, posy = 11.5, posz = 0, radius = 9, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shieldlight = { - lightType = 'point', - pieceName = 'rshield', - lightConfig = { posx = -2.5, posy = 11, posz = 0, radius = 5.5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.4, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rshield", + lightConfig = { posx = -2.5, posy = 11, posz = 0, radius = 5.5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.4, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- - lightType = 'cone', - pieceName = 'lbarrel', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, - dirx = 0, diry = -1, dirz = 0.01, theta = 0.14, - r = 1, g = 1, b = 0.89, a = 0.35, colortime = -2.5, - modelfactor = -1, specular = -1, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lbarrel", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, dirx = 0, diry = -1, dirz = 0.01, theta = 0.14, r = 1, g = 1, b = 0.89, a = 0.35, colortime = -2.5, modelfactor = -1, specular = -1, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top2 = { -- lightType = 'point', @@ -25158,159 +16007,95 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['coramph'] = { + ["coramph"] = { front1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 4, posy = -6.6, posz = 7.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 4, posy = -6.6, posz = 7.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -4, posy = -6.6, posz = 7.5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 0.25, a = 0.9, - modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -4, posy = -6.6, posz = 7.5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 0.25, a = 0.9, modelfactor = 0.4, specular = 0.8, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8.8, posy = 10, posz = -5, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8.8, posy = 10, posz = -5, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -8.8, posy = 10, posz = -5, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -8.8, posy = 10, posz = -5, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armamph'] = { + ["armamph"] = { top = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 2, posz = -5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 2, posz = -5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontweapon = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 2.7, posz = 9.5, radius = 4, - color2r = -3, color2g = -3, color2b = -3, colortime = 22, - r = 1.2, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 2.7, posz = 9.5, radius = 4, color2r = -3, color2g = -3, color2b = -3, colortime = 22, r = 1.2, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -7.9, posy = 8.9, posz = 1.3, radius = 3.1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -7.9, posy = 8.9, posz = 1.3, radius = 3.1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalight2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8, posy = 8.9, posz = 1.3, radius = 3.1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8, posy = 8.9, posz = 1.3, radius = 3.1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = -8, posy = 8.5, posz = 0, radius = 300, - dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = -8, posy = 8.5, posz = 0, radius = 300, dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armaak'] = { + ["armaak"] = { top = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 3.5, posz = 2.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 3.5, posz = 2.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpackr = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -3.7, posy = 2.0, posz = -10.9, radius = 3.1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -3.7, posy = 2.0, posz = -10.9, radius = 3.1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpackl = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 3.5, posy = 2.0, posz = -10.9, radius = 3.1, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 3.5, posy = 2.0, posz = -10.9, radius = 3.1, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -2, posz = -4, radius = 300, - dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = -2, posz = -4, radius = 300, dirx = 0, diry = 0.5, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.28, colortime = -1.5, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coraak'] = { + ["coraak"] = { top = { - lightType = 'point', - pieceName = 'flakgun', - lightConfig = { posx = 0, posy = 4, posz = -3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.8, - modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flakgun", + lightConfig = { posx = 0, posy = 4, posz = -3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.8, modelfactor = 0.4, specular = 0.8, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 11, posz = 7, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 11, posz = 7, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 300, colortime = -1.5, - dirx = 0, diry = 0.7, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 300, colortime = -1.5, dirx = 0, diry = 0.7, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsent'] = { + ["corsent"] = { -- top = { -- lightType = 'point', -- pieceName = 'turret', @@ -25321,33 +16106,21 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyes = { - lightType = 'point', - pieceName = 'guns', - lightConfig = { posx = 0, posy = 4, posz = 3, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "guns", + lightConfig = { posx = 0, posy = 4, posz = 3, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.8, specular = 0.2, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'guns', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 150, colortime = -1.5, - dirx = 0, diry = 0.2, dirz = 1, theta = 0.16, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "guns", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 150, colortime = -1.5, dirx = 0, diry = 0.2, dirz = 1, theta = 0.16, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armflea'] = { + ["armflea"] = { body = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 11, posz = -1.5, radius = 7, - color2r = 1, color2g = 1, color2b = 0.25, colortime = -1.5, - r = 1.2, g = 1, b = 0.25, a = 0.6, - modelfactor = 0.5, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 11, posz = -1.5, radius = 7, color2r = 1, color2g = 1, color2b = 0.25, colortime = -1.5, r = 1.2, g = 1, b = 0.25, a = 0.6, modelfactor = 0.5, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- nanoflashtop = { -- lightType = 'point', @@ -25359,72 +16132,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, nanoflashbot = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 9.5, posz = 10.5, radius = 6, - color2r = -5, color2g = -5, color2b = -5, colortime = -1, - r = -1, g = 1, b = 1, a = 0.75, - modelfactor = 0.7, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 9.5, posz = 10.5, radius = 6, color2r = -5, color2g = -5, color2b = -5, colortime = -1, r = -1, g = 1, b = 1, a = 0.75, modelfactor = 0.7, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corpyro'] = { + ["corpyro"] = { flamelight = { - lightType = 'point', - pieceName = 'lloarm', - lightConfig = { posx = 0, posy = -0.8, posz = 12, radius = 14, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, - r = 0.95, g = 0.66, b = 0.07, a = 0.6, - modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "lloarm", + lightConfig = { posx = 0, posy = -0.8, posz = 12, radius = 14, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, r = 0.95, g = 0.66, b = 0.07, a = 0.6, modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, flamebright = { - lightType = 'point', - pieceName = 'lloarm', - lightConfig = { posx = 0, posy = -1.4, posz = 18, radius = 8, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, - r = 0.95, g = 0.66, b = 0.07, a = 1.9, - modelfactor = 0.4, specular = 0.9, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lloarm", + lightConfig = { posx = 0, posy = -1.4, posz = 18, radius = 8, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, r = 0.95, g = 0.66, b = 0.07, a = 1.9, modelfactor = 0.4, specular = 0.9, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 3.8, posz = 6.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 3.8, posz = 6.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack1 = { - lightType = 'point', - pieceName = 'backpack', - lightConfig = { posx = 0, posy = 8, posz = -4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.75, a = 0.6, - modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "backpack", + lightConfig = { posx = 0, posy = 8, posz = -4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.75, a = 0.6, modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack2 = { - lightType = 'point', - pieceName = 'backpack', - lightConfig = { posx = -6, posy = 7, posz = -4, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.75, a = 0.6, - modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "backpack", + lightConfig = { posx = -6, posy = 7, posz = -4, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.75, a = 0.6, modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backpack3 = { - lightType = 'point', - pieceName = 'backpack', - lightConfig = { posx = 6, posy = 7, posz = -4, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.75, a = 0.6, - modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "backpack", + lightConfig = { posx = 6, posy = 7, posz = -4, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.75, a = 0.6, modelfactor = 0.15, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsumo'] = { + ["corsumo"] = { -- eyesl = { -- lightType = 'point', -- pieceName = 'torso', @@ -25444,153 +16189,79 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headlightsourceright = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -2.6, posy = 6.7, posz = 18, radius = 1.0, - pos2x = -2.6, pos2y = 5, pos2z = 18.1, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -2.6, posy = 6.7, posz = 18, radius = 1.0, pos2x = -2.6, pos2y = 5, pos2z = 18.1, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourcemid = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -0.2, posy = 6.7, posz = 18, radius = 1.0, - pos2x = -0.2, pos2y = 5, pos2z = 18.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -0.2, posy = 6.7, posz = 18, radius = 1.0, pos2x = -0.2, pos2y = 5, pos2z = 18.1, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourceleft = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 2.2, posy = 6.7, posz = 18, radius = 1.0, - pos2x = 2.2, pos2y = 5, pos2z = 18.1, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 2.2, posy = 6.7, posz = 18, radius = 1.0, pos2x = 2.2, pos2y = 5, pos2z = 18.1, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 60, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -3, posy = 10.0, posz = 16, radius = 2.5, - pos2x = 3, pos2y = 10.0, pos2z = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -3, posy = 10.0, posz = 16, radius = 2.5, pos2x = 3, pos2y = 10.0, pos2z = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -4, posy = 10.0, posz = 15, radius = 2.5, - pos2x = -6.5, pos2y = 10.0, pos2z = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -4, posy = 10.0, posz = 15, radius = 2.5, pos2x = -6.5, pos2y = 10.0, pos2z = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 4, posy = 10.0, posz = 15, radius = 2.5, - pos2x = 6.5, pos2y = 10.0, pos2z = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 4, posy = 10.0, posz = 15, radius = 2.5, pos2x = 6.5, pos2y = 10.0, pos2z = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backredleft = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 3.3, posy = 8.3, posz = -18.0, radius = 1.2, - pos2x = 3.3, pos2y = 11.8, pos2z = -16.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 3.3, posy = 8.3, posz = -18.0, radius = 1.2, pos2x = 3.3, pos2y = 11.8, pos2z = -16.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backredright = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -3.3, posy = 8.3, posz = -18.0, radius = 1.2, - pos2x = -3.3, pos2y = 11.8, pos2z = -16.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -3.3, posy = 8.3, posz = -18.0, radius = 1.2, pos2x = -3.3, pos2y = 11.8, pos2z = -16.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sideright = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -20.5, posy = 9.9, posz = 1, radius = 1.5, - pos2x = -20.5, pos2y = 9.9, pos2z = -1.1, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -20.5, posy = 9.9, posz = 1, radius = 1.5, pos2x = -20.5, pos2y = 9.9, pos2z = -1.1, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sideleft = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 20.5, posy = 9.9, posz = 1, radius = 1.5, - pos2x = 20.5, pos2y = 9.9, pos2z = -1.1, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 20.5, posy = 9.9, posz = 1, radius = 1.5, pos2x = 20.5, pos2y = 9.9, pos2z = -1.1, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashgun1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.5, posy = 1.8, posz = 4.6, radius = 1.3, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 0, g = 1, b = 0, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -2.5, posy = 1.8, posz = 4.6, radius = 1.3, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 0, g = 1, b = 0, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashgun2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 2.6, posy = 1.8, posz = 4.6, radius = 1.3, - dirx = 0, diry = 0, dirz = 1, theta = -1.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 0, g = 1, b = 0, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 2.6, posy = 1.8, posz = 4.6, radius = 1.3, dirx = 0, diry = 0, dirz = 1, theta = -1.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 0, g = 1, b = 0, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teambeambackl = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 4.5, posy = -1, posz = -7.4, radius = 1.0, - pos2x = 4.5, pos2y = 1.3, pos2z = -7.41, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.2, b = 0.2, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 4.5, posy = -1, posz = -7.4, radius = 1.0, pos2x = 4.5, pos2y = 1.3, pos2z = -7.41, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.2, b = 0.2, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teambeambackr = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -4.2, posy = -1, posz = -7.5, radius = 1.0, - pos2x = -4.2, pos2y = 1.3, pos2z = -7.51, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 0.2, b = 0.2, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -4.2, posy = -1, posz = -7.5, radius = 1.0, pos2x = -4.2, pos2y = 1.3, pos2z = -7.51, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 0.2, b = 0.2, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'torso', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 10, posz = 15, radius = 95, colortime = -2, - dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 10, posz = 15, radius = 95, colortime = -2, dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, -- ['corsumo-old'] = { @@ -25681,77 +16352,86 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, -- }, - ['corsala'] = { + ["corsala"] = { teamtopfront = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 7.5, posz = -0.5, radius = 1.6, - dirx = 0, diry = 0, dirz = 1, theta = -2.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = -1, g = 1, b = 1, a = 2, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 7.5, posz = -0.5, radius = 1.6, dirx = 0, diry = 0, dirz = 1, theta = -2.3, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = -1, g = 1, b = 1, a = 2, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourceright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -10, posy = 7.7, posz = 15.2, radius = 1.4, - pos2x = -13, pos2y = 7.7, pos2z = 15.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -10, posy = 7.7, posz = 15.2, radius = 1.4, pos2x = -13, pos2y = 7.7, pos2z = 15.2, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourceleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 10, posy = 7.7, posz = 15.2, radius = 1.4, - pos2x = 13, pos2y = 7.7, pos2z = 15.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 10, posy = 7.7, posz = 15.2, radius = 1.4, pos2x = 13, pos2y = 7.7, pos2z = 15.2, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -11.5, posy = 6, posz = 10, radius = 35, colortime = -2, - dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -11.5, posy = 6, posz = 10, radius = 35, colortime = -2, dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 11.5, posy = 6, posz = 10, radius = 35, colortime = -2, - dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.25, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 11.5, posy = 6, posz = 10, radius = 35, colortime = -2, dirx = 0, diry = -0.12, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.25, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sleeve1point = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = -2.2, posy = 0, posz = 16.4, radius = 2.2, - --dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { + posx = -2.2, + posy = 0, + posz = 16.4, + radius = 2.2, + --dirx = 0, diry = 0, dirz = 1, theta = -2.5, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 60, + r = 1.2, + g = 1, + b = 0.2, + a = 2.5, + modelfactor = 1.7, + specular = 0.8, + scattering = 0.15, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, sleeve2point = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = -2.2, posy = 0, posz = 16.4, radius = 2.2, - --dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 60, - r = 0, g = 0, b = 0, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { + posx = -2.2, + posy = 0, + posz = 16.4, + radius = 2.2, + --dirx = 0, diry = 0, dirz = 1, theta = -2.5, + color2r = 1.2, + color2g = 1, + color2b = 0.2, + colortime = 60, + r = 0, + g = 0, + b = 0, + a = 2.5, + modelfactor = 1.7, + specular = 0.8, + scattering = 0.15, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, }, - ['cortermite'] = { + ["cortermite"] = { -- eyes = { -- lightType = 'point', -- pieceName = 'head', @@ -25762,23 +16442,14 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'head', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 65, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "head", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 65, dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = -3, posy = 2, posz = 3.5, radius = 3, - pos2x = 3, pos2y = 2, pos2z = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = -3, posy = 2, posz = 3.5, radius = 3, pos2x = 3, pos2y = 2, pos2z = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- body = { -- lightType = 'point', @@ -25790,13 +16461,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, bodynrg = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 0, posy = 10, posz = -9, radius = 8, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = -1, - r = 0, g = 0, b = 0, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 1.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 0, posy = 10, posz = -9, radius = 8, color2r = 1.2, color2g = 1, color2b = 0.2, colortime = -1, r = 0, g = 0, b = 0, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 1.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- sleeve1beam = { -- lightType = 'beam', @@ -25810,65 +16477,80 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, sleeve1point = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = 0, posy = 0, posz = 9.4, radius = 2.2, - --dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { + posx = 0, + posy = 0, + posz = 9.4, + radius = 2.2, + --dirx = 0, diry = 0, dirz = 1, theta = -2.5, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 60, + r = 1.2, + g = 1, + b = 0.2, + a = 2.5, + modelfactor = 1.7, + specular = 0.8, + scattering = 0.15, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, sleeve2point = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = -0.5, posy = 0, posz = 9.1, radius = 2.2, - --dirx = 0, diry = 0, dirz = 1, theta = -2.5, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 60, - r = 0, g = 0, b = 0, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { + posx = -0.5, + posy = 0, + posz = 9.1, + radius = 2.2, + --dirx = 0, diry = 0, dirz = 1, theta = -2.5, + color2r = 1.2, + color2g = 1, + color2b = 0.2, + colortime = 60, + r = 0, + g = 0, + b = 0, + a = 2.5, + modelfactor = 1.7, + specular = 0.8, + scattering = 0.15, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, }, - ['corthermite'] = { + ["corthermite"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 6, posz = 8, radius = 28, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 6, posz = 8, radius = 28, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corstorm'] = { + ["corstorm"] = { eyes = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 4.1, posz = 8.1, radius = 8, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.55, - modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 4.1, posz = 8.1, radius = 8, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.55, modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topflashsingle = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 9.5, posz = 0, radius = 3.7, - dirx = 0, diry = 0, dirz = 1, theta = -4.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1, a = 2.9, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 9.5, posz = 0, radius = 3.7, dirx = 0, diry = 0, dirz = 1, theta = -4.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1, a = 2.9, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'cone', - pieceName = 'launcher', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 75, - dirx = 0, diry = -0.03, dirz = 1, theta = 0.13, - r = 1, g = 1, b = 0.89, a = 0.5, - modelfactor = -1, specular = -1, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "launcher", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 75, dirx = 0, diry = -0.03, dirz = 1, theta = 0.13, r = 1, g = 1, b = 0.89, a = 0.5, modelfactor = -1, specular = -1, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topflash = { -- lightType = 'point', @@ -25891,72 +16573,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cormort'] = { + ["cormort"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0, posz = 12, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 1.3, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 0, posz = 12, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 1.3, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -9.1, posz = 9, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -9.1, posz = 9, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -5.7, posz = 8.9, radius = 2.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -5.7, posz = 8.9, radius = 2.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 3, posy = -9, posz = -12, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 3, posy = -9, posz = -12, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -3, posy = -9, posz = -12, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -3, posy = -9, posz = -12, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -4.3, posy = 6.5, posz = -9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.25, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -4.3, posy = 6.5, posz = -9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.25, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 4.3, posy = 6.5, posz = -9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.25, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 4.3, posy = 6.5, posz = -9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.25, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corthud'] = { + ["corthud"] = { -- eyes = { -- lightType = 'point', -- pieceName = 'torso', @@ -25967,35 +16621,22 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesfront = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 9, posz = 6.2, radius = 2, - pos2x = 0, pos2y = 15, pos2z = 6.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 0, posy = 9, posz = 6.2, radius = 2, pos2x = 0, pos2y = 15, pos2z = 6.2, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armright = { - lightType = 'point', - pieceName = 'rbarrel', - lightConfig = { posx = -8.3, posy = 2, posz = 11, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 1.8, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rbarrel", + lightConfig = { posx = -8.3, posy = 2, posz = 11, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 1.8, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armleft = { - lightType = 'point', - pieceName = 'lbarrel', - lightConfig = { posx = 8.3, posy = 2, posz = 11, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 1.8, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lbarrel", + lightConfig = { posx = 8.3, posy = 2, posz = 11, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 1.8, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsktl'] = { + ["corsktl"] = { -- eyes = { -- lightType = 'point', -- pieceName = 'base', @@ -26006,26 +16647,17 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesbeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3, posy = 1.4, posz = 9.7, radius = 3, - pos2x = 3, pos2y = 1.4, pos2z = 9.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3, posy = 1.4, posz = 9.7, radius = 3, pos2x = 3, pos2y = 1.4, pos2z = 9.7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodybomb = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0.5, posz = -9.5, radius = 5, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0.5, posz = -9.5, radius = 5, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.9, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corroach'] = { + ["corroach"] = { -- baseback = { -- lightType = 'point', -- pieceName = 'base', @@ -26036,979 +16668,577 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, basefront = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.5, posz = 2.2, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.15, specular = 0.5, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.5, posz = 2.2, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.75, a = 0.8, modelfactor = 0.15, specular = 0.5, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.5, posz = 7.2, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.5, posz = 7.2, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bodybomb = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 7.5, posz = -8.5, radius = 4, - color2r = -10, color2g = -10, color2b = -10, colortime = 25, - r = 1.2, g = 1, b = 0.2, a = 1.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 7.5, posz = -8.5, radius = 4, color2r = -10, color2g = -10, color2b = -10, colortime = 25, r = 1.2, g = 1, b = 0.2, a = 1.9, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2, posz = -7, radius = 40, colortime = -1.5, - dirx = 0, diry = 0, dirz = 1, theta = 0.35, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 2, posz = -7, radius = 40, colortime = -1.5, dirx = 0, diry = 0, dirz = 1, theta = 0.35, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legsnapper'] = { + ["legsnapper"] = { base = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = -1.5, radius = 14, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.75, a = 0.08, - modelfactor = 0.95, specular = 0.5, scattering = 0.75, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = -1.5, radius = 14, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.75, a = 0.08, modelfactor = 0.95, specular = 0.5, scattering = 0.75, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4.4, posz = 7.2, radius = 12, - color2r = 0.1, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.20, - modelfactor = 0.6, specular = 0, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4.4, posz = 7.2, radius = 12, color2r = 0.1, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.20, modelfactor = 0.6, specular = 0, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legca'] = { + ["legca"] = { nanolight = { - lightType = 'point', - pieceName = 'beam', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "beam", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mainthrust = { - lightType = 'point', - pieceName = 'mainThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mainThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, minithrusta = { - lightType = 'point', - pieceName = 'thrustA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, minithrustb = { - lightType = 'point', - pieceName = 'thrustB', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.35, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustB", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.35, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'chassis', - lightConfig = { posx = 0, posy = 1.5, posz = 15.5, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chassis", + lightConfig = { posx = 0, posy = 1.5, posz = 15.5, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legatrans'] = { + ["legatrans"] = { lgThrust = { - lightType = 'cone', - pieceName = 'leftGroundThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, - dirx = 0, diry = -1, dirz = 0, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftGroundThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, dirx = 0, diry = -1, dirz = 0, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rgThrust = { - lightType = 'cone', - pieceName = 'rightGroundThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, - dirx = 0, diry = -1, dirz = 0, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightGroundThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, dirx = 0, diry = -1, dirz = 0, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lmainthrust = { - lightType = 'cone', - pieceName = 'leftMainThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftMainThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rmainthrust = { - lightType = 'cone', - pieceName = 'rightMainThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightMainThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lminithrust = { - lightType = 'cone', - pieceName = 'leftMiniThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftMiniThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rminithrust = { - lightType = 'cone', - pieceName = 'rightMiniThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightMiniThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, trieyes = { - lightType = 'point', - pieceName = 'chassis', - lightConfig = { posx = 0, posy = 4.3, posz = 15.5, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chassis", + lightConfig = { posx = 0, posy = 4.3, posz = 15.5, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['legcib'] = { + ["legcib"] = { eyes = { - lightType = 'point', - pieceName = 'chassis', - lightConfig = { posx = 0, posy = 1, posz = 19, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chassis", + lightConfig = { posx = 0, posy = 1, posz = 19, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rthrust = { - lightType = 'cone', - pieceName = 'rThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightType = "cone", + pieceName = "rThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lthrust = { - lightType = 'cone', - pieceName = 'lThrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lThrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legmos'] = { + ["legmos"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -3, posz = 16, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -3, posz = 16, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustMain = { - lightType = 'cone', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blurl = { - lightType = 'cone', - pieceName = 'blur', - lightConfig = { posx = 3, posy = 0, posz = 2.5, radius = 35, - dirx = 1, diry = -0.1, dirz = 0, theta = 0.6, - r = -1, g = 1, b = 1, a = 4.9, - modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "blur", + lightConfig = { posx = 3, posy = 0, posz = 2.5, radius = 35, dirx = 1, diry = -0.1, dirz = 0, theta = 0.6, r = -1, g = 1, b = 1, a = 4.9, modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blurr = { - lightType = 'cone', - pieceName = 'blur', - lightConfig = { posx = -3, posy = 0, posz = 2.5, radius = 35, - dirx = -1, diry = -0.1, dirz = 0, theta = 0.6, - r = -1, g = 1, b = 1, a = 4.9, - modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "blur", + lightConfig = { posx = -3, posy = 0, posz = 2.5, radius = 35, dirx = -1, diry = -0.1, dirz = 0, theta = 0.6, r = -1, g = 1, b = 1, a = 4.9, modelfactor = 0.3, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legkam'] = { + ["legkam"] = { thrustMain = { - lightType = 'cone', - pieceName = 'thrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb1 = { - lightType = 'point', - pieceName = 'bomb', - lightConfig = { posx = 0, posy = 0, posz = -1.9, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb", + lightConfig = { posx = 0, posy = 0, posz = -1.9, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bomb2 = { - lightType = 'point', - pieceName = 'bomb', - lightConfig = { posx = 0, posy = 0, posz = -9.9, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bomb", + lightConfig = { posx = 0, posy = 0, posz = -9.9, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legatorpbomber'] = { + ["legatorpbomber"] = { thrustrightAJet = { - lightType = 'cone', - pieceName = 'rightAJet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightAJet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustrightBJet = { - lightType = 'cone', - pieceName = 'rightBJet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightBJet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustleftAJet = { - lightType = 'cone', - pieceName = 'leftAJet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftAJet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustleftBJet = { - lightType = 'cone', - pieceName = 'leftBJet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftBJet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaheattank'] = { + ["legaheattank"] = { gunglow1 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = -8.4, posy = -2.9, posz = 11.4, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 60, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = -8.4, posy = -2.9, posz = 11.4, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 60, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 8.4, posy = -2.9, posz = 11.4, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 60, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 8.4, posy = -2.9, posz = 11.4, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 60, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legionnaire'] = { + ["legionnaire"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 3.7, posz = -16, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 3.7, posz = -16, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 3.7, posz = -16, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 3.7, posz = -16, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.7, posz = -18, radius = 15, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.7, posz = -18, radius = 15, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusta = { - lightType = 'point', - pieceName = 'thrusta', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrusta", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legvenator'] = { + ["legvenator"] = { thruster1 = { - lightType = 'point', - pieceName = 'lthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'rthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legphoenix'] = { + ["legphoenix"] = { dish = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 15, posz = -1, radius = 28, - color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.04, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 15, posz = -1, radius = 28, color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.04, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = -27, radius = 11, - color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 6, - r = 0.88, g = 0.14, b = 0.14, a = 0.11, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = -27, radius = 11, color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 6, r = 0.88, g = 0.14, b = 0.14, a = 0.11, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 5, posz = -29, radius = 12, - color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 7, - r = 0.88, g = 0.14, b = 0.14, a = 0.11, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 5, posz = -29, radius = 12, color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 7, r = 0.88, g = 0.14, b = 0.14, a = 0.11, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 5, posz = -29, radius = 12, - color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 5, - r = 0.88, g = 0.14, b = 0.14, a = 0.11, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 5, posz = -29, radius = 12, color2r = 1, color2g = 0.9, color2b = 0.2, colortime = 5, r = 0.88, g = 0.14, b = 0.14, a = 0.11, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustl = { - lightType = 'point', - pieceName = 'lthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.8, g = 1, b = 0.1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.8, g = 1, b = 0.1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustr = { - lightType = 'point', - pieceName = 'rthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.8, g = 1, b = 0.1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.8, g = 1, b = 0.1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustm = { - lightType = 'point', - pieceName = 'mthrust', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.8, g = 1, b = 0.1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "mthrust", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 33, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.8, g = 1, b = 0.1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legbastion'] = { + ["legbastion"] = { dish = { - lightType = 'point', - pieceName = 'ambienttop', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, - r = 1.0, g = 0.8, b = 0.1, a = 0.21, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ambienttop", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, r = 1.0, g = 0.8, b = 0.1, a = 0.21, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'fireline', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 1100, - dirx = 0, diry = 0, dirz = 1, theta = 0.04, - r = 0.9, g = 0.65, b = 0.15, a = 0.95, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "fireline", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 1100, dirx = 0, diry = 0, dirz = 1, theta = 0.04, r = 0.9, g = 0.65, b = 0.15, a = 0.95, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lp1 = { - lightType = 'cone', - pieceName = 'lp1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - dirx = 2, diry = 6, dirz = -2, theta = 0.67, - r = 1, g = 1, b = 1, a = 0.30, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lp1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, dirx = 2, diry = 6, dirz = -2, theta = 0.67, r = 1, g = 1, b = 1, a = 0.30, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lp2 = { - lightType = 'cone', - pieceName = 'lp2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - dirx = 2, diry = 6, dirz = 2, theta = 0.67, - r = 1, g = 1, b = 1, a = 0.30, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lp2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, dirx = 2, diry = 6, dirz = 2, theta = 0.67, r = 1, g = 1, b = 1, a = 0.30, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lp3 = { - lightType = 'cone', - pieceName = 'lp3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - dirx = -2, diry = 6, dirz = -2, theta = 0.67, - r = 1, g = 1, b = 1, a = 0.30, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lp3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, dirx = -2, diry = 6, dirz = -2, theta = 0.67, r = 1, g = 1, b = 1, a = 0.30, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lp4 = { - lightType = 'cone', - pieceName = 'lp4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - dirx = -2, diry = 6, dirz = 2, theta = 0.67, - r = 1, g = 1, b = 1, a = 0.30, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "lp4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, dirx = -2, diry = 6, dirz = 2, theta = 0.67, r = 1, g = 1, b = 1, a = 0.30, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['leganavyartyship']={ + ["leganavyartyship"] = { exhaustlights = { - lightType = 'point', - pieceName = 'cell2', - lightConfig = { posx = 0, posy = 10, posz = -5, radius = 80, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell2", + lightConfig = { posx = 0, posy = 10, posz = -5, radius = 80, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, exhaustlightsambient = { - lightType = 'point', - pieceName = 'cell2', - lightConfig = { posx = 0, posy = 10, posz = -5, radius = 40, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell2", + lightConfig = { posx = 0, posy = 10, posz = -5, radius = 40, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leganavyflagship'] = { + ["leganavyflagship"] = { bigtoroid = { - lightType = 'point', - pieceName = 'torus1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torus1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 80, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, firinglight = { - lightType = 'point', - pieceName = 'toroidFireFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, - r = 0.44, g = 0.40, b = 0.1, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "toroidFireFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, r = 0.44, g = 0.40, b = 0.1, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, firinglight2 = { - lightType = 'point', - pieceName = 'toroidFireFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 75, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 0, - r = 0.44, g = 0.40, b = 0.1, a = 1, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "toroidFireFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 75, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 0, r = 0.44, g = 0.40, b = 0.1, a = 1, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightright = { - lightType = 'cone', - pieceName = 'heatrayFlareRight', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "heatrayFlareRight", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightleft = { - lightType = 'cone', - pieceName = 'heatrayFlareLeft', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "heatrayFlareLeft", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, gunglow1 = { - lightType = 'point', - pieceName = 'heatrayFlareRight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "heatrayFlareRight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2 = { - lightType = 'point', - pieceName = 'heatrayFlareLeft', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "heatrayFlareLeft", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - -- lp1 = { - -- lightType = 'cone', - -- pieceName = 'lp1', - -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - -- dirx = 2, diry = 6, dirz = -2, theta = 0.67, - -- r = 1, g = 1, b = 1, a = 0.30, - -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - -- lifetime = 0, sustain = 0, selfshadowing = 0}, - -- }, - -- lp2 = { - -- lightType = 'cone', - -- pieceName = 'lp2', - -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - -- dirx = 2, diry = 6, dirz = 2, theta = 0.67, - -- r = 1, g = 1, b = 1, a = 0.30, - -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - -- lifetime = 0, sustain = 0, selfshadowing = 0}, - -- }, - -- lp3 = { - -- lightType = 'cone', - -- pieceName = 'lp3', - -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - -- dirx = -2, diry = 6, dirz = -2, theta = 0.67, - -- r = 1, g = 1, b = 1, a = 0.30, - -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - -- lifetime = 0, sustain = 0, selfshadowing = 0}, - -- }, - -- lp4 = { - -- lightType = 'cone', - -- pieceName = 'lp4', - -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - -- dirx = -2, diry = 6, dirz = 2, theta = 0.67, - -- r = 1, g = 1, b = 1, a = 0.30, - -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - -- lifetime = 0, sustain = 0, selfshadowing = 0}, - -- }, - ['legbart'] = { + -- lp1 = { + -- lightType = 'cone', + -- pieceName = 'lp1', + -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, + -- dirx = 2, diry = 6, dirz = -2, theta = 0.67, + -- r = 1, g = 1, b = 1, a = 0.30, + -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, + -- lifetime = 0, sustain = 0, selfshadowing = 0}, + -- }, + -- lp2 = { + -- lightType = 'cone', + -- pieceName = 'lp2', + -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, + -- dirx = 2, diry = 6, dirz = 2, theta = 0.67, + -- r = 1, g = 1, b = 1, a = 0.30, + -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, + -- lifetime = 0, sustain = 0, selfshadowing = 0}, + -- }, + -- lp3 = { + -- lightType = 'cone', + -- pieceName = 'lp3', + -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, + -- dirx = -2, diry = 6, dirz = -2, theta = 0.67, + -- r = 1, g = 1, b = 1, a = 0.30, + -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, + -- lifetime = 0, sustain = 0, selfshadowing = 0}, + -- }, + -- lp4 = { + -- lightType = 'cone', + -- pieceName = 'lp4', + -- lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, + -- dirx = -2, diry = 6, dirz = 2, theta = 0.67, + -- r = 1, g = 1, b = 1, a = 0.30, + -- modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, + -- lifetime = 0, sustain = 0, selfshadowing = 0}, + -- }, + ["legbart"] = { cannisterlight = { - lightType = 'point', - pieceName = 'cannisterFlare', - lightConfig = { posx = -1, posy = 1, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterFlare", + lightConfig = { posx = -1, posy = 1, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leginf'] = { + ["leginf"] = { cannisterlightl = { - lightType = 'point', - pieceName = 'leftCannisterLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "leftCannisterLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlightr = { - lightType = 'point', - pieceName = 'rightCannisterLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rightCannisterLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topbarrela = { - lightType = 'point', - pieceName = 'topBarrelLightA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "topBarrelLightA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topbarrelb = { - lightType = 'point', - pieceName = 'topBarrelLightB', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "topBarrelLightB", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, leftbarrel = { - lightType = 'point', - pieceName = 'rightBarrelLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rightBarrelLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rightbarrel = { - lightType = 'point', - pieceName = 'leftBarrelLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "leftBarrelLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legeheatraymech'] = { + ["legeheatraymech"] = { bigtoroid = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 10, posz = -25, radius = 78, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 10, posz = -25, radius = 78, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, righttoroid = { - lightType = 'point', - pieceName = 'rToroidFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, - r = 0.44, g = 0.40, b = 0.1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rToroidFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, r = 0.44, g = 0.40, b = 0.1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lefttoroid = { - lightType = 'point', - pieceName = 'lToroidFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, - r = 0.44, g = 0.40, b = 0.1, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lToroidFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, r = 0.44, g = 0.40, b = 0.1, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightright = { - lightType = 'cone', - pieceName = 'rHeatrayFlare', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "rHeatrayFlare", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightleft = { - lightType = 'cone', - pieceName = 'lHeatrayFlare', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "lHeatrayFlare", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, gunglow1 = { - lightType = 'point', - pieceName = 'lHeatrayFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lHeatrayFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gunglow2 = { - lightType = 'point', - pieceName = 'rHeatrayFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, - r = 0.88, g = 0.83, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rHeatrayFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 10, r = 0.88, g = 0.83, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headeyeglow1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -1, posz = 6, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 0.92, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -1, posz = 6, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 0.92, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headeyeglow2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -1, posz = 6, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 0.92, b = 0.4, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -1, posz = 6, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 0.92, b = 0.4, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, firingpin1 = { - lightType = 'point', - pieceName = 'lFiringPin', - lightConfig = { posx = 0, posy = 2, posz = -3, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, - r = 0.44, g = 0.40, b = 0.1, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lFiringPin", + lightConfig = { posx = 0, posy = 2, posz = -3, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, r = 0.44, g = 0.40, b = 0.1, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, firingpin2 = { - lightType = 'point', - pieceName = 'rFiringPin', - lightConfig = { posx = 0, posy = 2, posz = -3, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, - r = 0.44, g = 0.40, b = 0.1, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rFiringPin", + lightConfig = { posx = 0, posy = 2, posz = -3, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 30, r = 0.44, g = 0.40, b = 0.1, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rcannon1 = { - lightType = 'point', - pieceName = 'rCannon', - lightConfig = { posx = 0, posy = 8, posz = -4, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rCannon", + lightConfig = { posx = 0, posy = 8, posz = -4, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rcannon2 = { - lightType = 'point', - pieceName = 'rCannon', - lightConfig = { posx = 0, posy = 8, posz = 2, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rCannon", + lightConfig = { posx = 0, posy = 8, posz = 2, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rcannon3 = { - lightType = 'point', - pieceName = 'rCannon', - lightConfig = { posx = 0, posy = 8, posz = 7, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rCannon", + lightConfig = { posx = 0, posy = 8, posz = 7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lcannon1 = { - lightType = 'point', - pieceName = 'lCannon', - lightConfig = { posx = 0, posy = 8, posz = -3, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lCannon", + lightConfig = { posx = 0, posy = 8, posz = -3, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lcannon2 = { - lightType = 'point', - pieceName = 'lCannon', - lightConfig = { posx = 0, posy = 8, posz = 2, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lCannon", + lightConfig = { posx = 0, posy = 8, posz = 2, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lcannon3 = { - lightType = 'point', - pieceName = 'lCannon', - lightConfig = { posx = 0, posy = 8, posz = 7, radius = 10, - color2r =0, color2g =0, color2b =0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lCannon", + lightConfig = { posx = 0, posy = 8, posz = 7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chestglow1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 10, posy = 8, posz = 15, radius = 16, - dirx = 0, diry = -0.159375, dirz = 0, theta = -3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.25, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 10, posy = 8, posz = 15, radius = 16, dirx = 0, diry = -0.159375, dirz = 0, theta = -3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.25, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chestglow2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -10, posy = 8, posz = 15, radius = 16, - dirx = 0, diry = -0.159375, dirz = 0, theta = -3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.92, b = 0.66, a = 0.25, - modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -10, posy = 8, posz = 15, radius = 16, dirx = 0, diry = -0.159375, dirz = 0, theta = -3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.92, b = 0.66, a = 0.25, modelfactor = 0.4, specular = 0.2, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['legeheatraymech_old'] = { + ["legeheatraymech_old"] = { bigtoroid = { - lightType = 'point', - pieceName = 'bigToroidLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "bigToroidLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, righttoroid = { - lightType = 'point', - pieceName = 'rightToroidLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rightToroidLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lefttoroid = { - lightType = 'point', - pieceName = 'leftToroidLight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "leftToroidLight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 60, color2r = 0.3, color2g = 0.8, color2b = 0.8, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightright = { - lightType = 'cone', - pieceName = 'rShoulderFlare', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "rShoulderFlare", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, headlightleft = { - lightType = 'cone', - pieceName = 'lShoulderFlare', - lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, - dirx = 0, diry = 0, dirz = 1, theta = 0.05, - r = 0.8, g = 0.55, b = 0.13, a = 0.85, - color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, - modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "lShoulderFlare", + lightConfig = { posx = 0, posy = 0, posz = -16, radius = 400, dirx = 0, diry = 0, dirz = 1, theta = 0.05, r = 0.8, g = 0.55, b = 0.13, a = 0.85, color2r = 1.0, color2g = 0.55, color2b = 0.2, colortime = 60, modelfactor = 0, specular = 1, scattering = 4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, - }, - ['legehovertank'] = { + ["legehovertank"] = { bigtoroid = { - lightType = 'point', - pieceName = 'outter_ring', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 16, - color2r = 0.9, color2g = 0.7, color2b = 0.45, colortime = -1, - r = 0.9, g = 0.7, b = 0.7, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "outter_ring", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 16, color2r = 0.9, color2g = 0.7, color2b = 0.45, colortime = -1, r = 0.9, g = 0.7, b = 0.7, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, smalltoroid = { - lightType = 'point', - pieceName = 'vertical_ring', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0.9, color2g = 0.7, color2b = 0.45, colortime = -1, - r = 0.9, g = 0.7, b = 0.7, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "vertical_ring", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0.9, color2g = 0.7, color2b = 0.45, colortime = -1, r = 0.9, g = 0.7, b = 0.7, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'body', - lightConfig = { posx = 0, posy = -4, posz = 16, radius = 8, - color2r = 0.025, color2g = 0.2, color2b = 0.05, colortime = -1, - r = 0.1, g = 0.8, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "body", + lightConfig = { posx = 0, posy = -4, posz = 16, radius = 8, color2r = 0.025, color2g = 0.2, color2b = 0.05, colortime = -1, r = 0.1, g = 0.8, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, exhaust = { - lightType = 'point', - pieceName = 'rear_engine', - lightConfig = { posx = 0, posy = -10, posz = 0, radius = 8, - color2r = 0.2, color2g = 0.125, color2b = 0.05, colortime = 30, - r = 0.8, g = 0.5, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rear_engine", + lightConfig = { posx = 0, posy = -10, posz = 0, radius = 8, color2r = 0.2, color2g = 0.125, color2b = 0.05, colortime = 30, r = 0.8, g = 0.5, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - - ['armvader'] = { + ["armvader"] = { -- redlight = { -- lightType = 'point', -- pieceName = 'body', @@ -27047,293 +17277,183 @@ local unitLights = { -- }, }, - ['armthor'] = { + ["armthor"] = { searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 15, posz = 18, radius = 88, - dirx = 0, diry = -0.06, dirz = 1, theta = 0.52, - r = 1, g = 1, b = 0.89, a = 0.32, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 15, posz = 18, radius = 88, dirx = 0, diry = -0.06, dirz = 1, theta = 0.52, r = 1, g = 1, b = 0.89, a = 0.32, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponflashl = { - lightType = 'point', - pieceName = 'ltbarrel', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 5.6, - dirx = 0, diry = 0, dirz = 1, theta = -8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1.2, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ltbarrel", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 5.6, dirx = 0, diry = 0, dirz = 1, theta = -8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1.2, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightningweaponflashr = { - lightType = 'point', - pieceName = 'rtbarrel', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 5.6, - dirx = 0, diry = 0, dirz = 1, theta = -8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 1, b = 1.2, a = 1.0, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rtbarrel", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 5.6, dirx = 0, diry = 0, dirz = 1, theta = -8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 1, b = 1.2, a = 1.0, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightr = { - lightType = 'point', - pieceName = 'rempbarrel', - lightConfig = { posx = 0, posy = 0, posz = 8.5, radius = 2.5, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 1.2, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "rempbarrel", + lightConfig = { posx = 0, posy = 0, posz = 8.5, radius = 2.5, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 1.2, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightl = { - lightType = 'point', - pieceName = 'lempbarrel', - lightConfig = { posx = 0, posy = 0, posz = 8.5, radius = 2.5, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 1.2, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "lempbarrel", + lightConfig = { posx = 0, posy = 0, posz = 8.5, radius = 2.5, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 1.2, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightllauncher = { - lightType = 'point', - pieceName = 'llauncher', - lightConfig = { posx = 24, posy = 0, posz = 11.5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare =15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "llauncher", + lightConfig = { posx = 24, posy = 0, posz = 11.5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emplightrlauncher = { - lightType = 'point', - pieceName = 'rlauncher', - lightConfig = { posx = -24, posy = 0, posz = 11.5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare =15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "rlauncher", + lightConfig = { posx = -24, posy = 0, posz = 11.5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponwhiteglowrt = { - lightType = 'point', - pieceName = 'rtbarrel', - lightConfig = { posx = 0, posy = 0, posz = 11, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rtbarrel", + lightConfig = { posx = 0, posy = 0, posz = 11, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponwhiteglowlt = { - lightType = 'point', - pieceName = 'ltbarrel', - lightConfig = { posx = 0, posy = 0, posz = 11, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ltbarrel", + lightConfig = { posx = 0, posy = 0, posz = 11, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponglowrt = { - lightType = 'point', - pieceName = 'rtbarrel', - lightConfig = { posx = 0, posy = 0, posz = 18, radius = 13, - color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.8, - modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rtbarrel", + lightConfig = { posx = 0, posy = 0, posz = 18, radius = 13, color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.8, modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponglowlt = { - lightType = 'point', - pieceName = 'ltbarrel', - lightConfig = { posx = 0, posy = 0, posz = 18, radius = 13, - color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, - r = 0.2, g = 0.5, b = 1, a = 0.8, - modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ltbarrel", + lightConfig = { posx = 0, posy = 0, posz = 18, radius = 13, color2r = 0.40000001, color2g = 0.69999999, color2b = 1.20000005, colortime = 30, r = 0.2, g = 0.5, b = 1, a = 0.8, modelfactor = 0.1, specular = 0.75, scattering = 1, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponspark1 = { - lightType = 'point', - pieceName = 'spark_emit1', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 100, - color2r = 0.1, color2g = 0.1, color2b = 0.3, colortime = 2, - r = 0.9, g = 0.9, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "spark_emit1", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 100, color2r = 0.1, color2g = 0.1, color2b = 0.3, colortime = 2, r = 0.9, g = 0.9, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, weaponspark2 = { - lightType = 'point', - pieceName = 'spark_emit2', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 100, - color2r = 0.1, color2g = 0.1, color2b = 0.3, colortime = 2, - r = 0.9, g = 0.9, b = 1, a = 0.75, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "spark_emit2", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 100, color2r = 0.1, color2g = 0.1, color2b = 0.3, colortime = 2, r = 0.9, g = 0.9, b = 1, a = 0.75, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backenergybeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4, posy = 14, posz = -20, radius = 9, - pos2x = 4, pos2y = 14, pos2z = -20, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.3, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4, posy = 14, posz = -20, radius = 9, pos2x = 4, pos2y = 14, pos2z = -20, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.3, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backenergy1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.5, posy = 16, posz = -25, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.3, g = 1, b = 0.2, a = 1.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.5, posy = 16, posz = -25, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.3, g = 1, b = 0.2, a = 1.9, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backenergy2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 16, posz = -25, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.3, g = 1, b = 0.2, a = 1.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 16, posz = -25, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.3, g = 1, b = 0.2, a = 1.9, modelfactor = 0.3, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armthundt4'] = { + ["armthundt4"] = { tipleft = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 5, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.2, specular = 0.5, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 5, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.2, specular = 0.5, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, tipright = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 5, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.2, specular = 0.5, scattering = 1.2, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 5, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.2, specular = 0.5, scattering = 1.2, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 23, posz = 58, radius = 36, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 23, posz = 58, radius = 36, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35, posy = 8.5, posz = -23, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35, posy = 8.5, posz = -23, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35, posy = 8.5, posz = -23, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35, posy = 8.5, posz = -23, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, engine1 = { - lightType = 'point', - pieceName = 'engines', - lightConfig = { posx = -62, posy = -18, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "engines", + lightConfig = { posx = -62, posy = -18, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, engine2 = { - lightType = 'point', - pieceName = 'engines', - lightConfig = { posx = 62, posy = -18, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "engines", + lightConfig = { posx = 62, posy = -18, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, engine3 = { - lightType = 'point', - pieceName = 'engines', - lightConfig = { posx = -45, posy = -18, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "engines", + lightConfig = { posx = -45, posy = -18, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, engine4 = { - lightType = 'point', - pieceName = 'engines', - lightConfig = { posx = 45, posy = -18, posz = 0, radius = 27, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "engines", + lightConfig = { posx = 45, posy = -18, posz = 0, radius = 27, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster = { - lightType = 'point', - pieceName = 'enginec', - lightConfig = { posx = 0, posy = -16, posz = 0, radius = 14, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 0, - r = 0.88, g = 0.83, b = 0.2, a = 0.12, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "enginec", + lightConfig = { posx = 0, posy = -16, posz = 0, radius = 14, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 0, r = 0.88, g = 0.83, b = 0.2, a = 0.12, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrusteractive = { - lightType = 'point', - pieceName = 'thrustc', - lightConfig = { posx = -5, posy = 0, posz = -5, radius = 300, - --dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustc", + lightConfig = { + posx = -5, + posy = 0, + posz = -5, + radius = 300, + --dirx = 0, diry = 0, dirz = -1, theta = 0.8, + r = 1, + g = 0.8, + b = 0.33, + a = 0.3, + modelfactor = 0, + specular = 1, + scattering = 0.5, + lensflare = 2, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrust1', - lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust1", + lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrust2', - lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust2", + lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrust3', - lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust3", + lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrust4', - lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 1, g = 0.8, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrust4", + lightConfig = { posx = -5, posy = 0, posz = -5, radius = 250, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 1, g = 0.8, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsnipe'] = { + ["armsnipe"] = { -- headreddot = { -- lightType = 'cone', -- pieceName = 'head', @@ -27344,13 +17464,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 2}, -- }, sniperreddot = { - lightType = 'cone', - pieceName = 'laser', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 700, - dirx = 0, diry = 1, dirz = 0.0001, theta = 0.006, - r = 2, g = 0, b = 0, a = 0.85, - modelfactor = 0.1, specular = 4, scattering = 2, lensflare = 4, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "laser", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 700, dirx = 0, diry = 1, dirz = 0.0001, theta = 0.006, r = 2, g = 0, b = 0, a = 0.85, modelfactor = 0.1, specular = 4, scattering = 2, lensflare = 4, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, -- eyes = { -- lightType = 'point', @@ -27362,13 +17478,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, weaponwhiteglowlaser = { - lightType = 'point', - pieceName = 'laser', - lightConfig = { posx = 0, posy = 0.2, posz = -2.2, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 14, - r = 1.2, g = 0.5, b = 0.15, a = 1.0, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "laser", + lightConfig = { posx = 0, posy = 0.2, posz = -2.2, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 14, r = 1.2, g = 0.5, b = 0.15, a = 1.0, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, -- weaponwhiteglow = { -- lightType = 'point', @@ -27380,184 +17492,105 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eye = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 1, posz = 5.5, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.4, g = 1.1, b = 0.25, a = 0.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 1, posz = 5.5, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.4, g = 1.1, b = 0.25, a = 0.9, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headback = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 3, posz = -3.8, radius = 8, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.1, - modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 3, posz = -3.8, radius = 8, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.1, modelfactor = 0.4, specular = 0.8, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, body = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -5, posz = 9.5, radius = 14, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.12, - modelfactor = 0.4, specular = 0.8, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = -5, posz = 9.5, radius = 14, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.12, modelfactor = 0.4, specular = 0.8, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corvamp'] = { + ["corvamp"] = { thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3.5, posy = 3.7, posz = -16, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3.5, posy = 3.7, posz = -16, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 3.7, posz = -16, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 3.7, posz = -16, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.7, posz = -18, radius = 15, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.7, posz = -18, radius = 15, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrustb = { - lightType = 'point', - pieceName = 'thrustb', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrustb", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corveng'] = { + ["corveng"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.2, posz = 12.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.2, posz = 12.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wingleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 26.2, posy = -1, posz = -4.5, radius = 5, - color2r = -25, color2g = -25, color2b = -25, colortime = 40, - r = 1.5, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 26.2, posy = -1, posz = -4.5, radius = 5, color2r = -25, color2g = -25, color2b = -25, colortime = 40, r = 1.5, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, wingright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -26.2, posy = -1, posz = -4.5, radius = 5, - color2r = -25, color2g = -25, color2b = -25, colortime = 40, - r = 0.2, g = 1.5, b = 0.2, a = 1.0, - modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -26.2, posy = -1, posz = -4.5, radius = 5, color2r = -25, color2g = -25, color2b = -25, colortime = 40, r = 0.2, g = 1.5, b = 0.2, a = 1.0, modelfactor = 0.8, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, passivethruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 0.5, posz = -13, radius = 4.4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, - r = 0.88, g = 0.83, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 0.5, posz = -13, radius = 4.4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 4, r = 0.88, g = 0.83, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, passivethruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 0.5, posz = -13, radius = 4.4, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, - r = 0.88, g = 0.83, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 0.5, posz = -13, radius = 4.4, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 5, r = 0.88, g = 0.83, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'point', - pieceName = 'thrust1', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 13, - color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, - r = 1.3, g = 0.75, b = 0.2, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust1", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 13, color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 14, r = 1.3, g = 0.75, b = 0.2, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'point', - pieceName = 'thrust2', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 13, - color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 15, - r = 1.3, g = 0.75, b = 0.2, a = 0.8, - modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thrust2", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 13, color2r = 0.4, color2g = 0.3, color2b = 0.02, colortime = 15, r = 1.3, g = 0.75, b = 0.2, a = 0.8, modelfactor = 0.6, specular = 0.2, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corseah'] = { + ["corseah"] = { eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.3, posy = 21.3, posz = 43, radius = 2.2, - pos2x = 3.3, pos2y = 21.3, pos2z = 43, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.3, posy = 21.3, posz = 43, radius = 2.2, pos2x = 3.3, pos2y = 21.3, pos2z = 43, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfrontright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.2, posy = 21.3, posz = 42, radius = 2.2, - pos2x = -4.2, pos2y = 21.3, pos2z = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.2, posy = 21.3, posz = 42, radius = 2.2, pos2x = -4.2, pos2y = 21.3, pos2z = 38, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfrontleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 4.2, posy = 21.3, posz = 42, radius = 2.2, - pos2x = 4.2, pos2y = 21.3, pos2z = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 4.2, posy = 21.3, posz = 42, radius = 2.2, pos2x = 4.2, pos2y = 21.3, pos2z = 38, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, transportlightright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.5, posy = 8.0, posz = 13.5, radius = 17, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.5, posy = 8.0, posz = 13.5, radius = 17, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, transportlightleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.5, posy = 8.0, posz = 13.5, radius = 17, - color2r = -3, color2g = -3, color2b = -3, colortime = 40, - r = -1, g = 1, b = 0, a = 1.1, - modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.5, posy = 8.0, posz = 13.5, radius = 17, color2r = -3, color2g = -3, color2b = -3, colortime = 40, r = -1, g = 1, b = 0, a = 1.1, modelfactor = 0.4, specular = 0.1, scattering = 2.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, -- eyes1 = { -- lightType = 'point', @@ -27587,325 +17620,185 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustrra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustrla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustfla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustfra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 90, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcrwt4'] = { + ["corcrwt4"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 47, posz = 26, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 47, posz = 26, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 47, posz = 9, radius = 32, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 47, posz = 9, radius = 32, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 47, posz = 9, radius = 32, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 47, posz = 9, radius = 32, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9, posy = 36, posz = 62, radius = 26, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9, posy = 36, posz = 62, radius = 26, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9, posy = 36, posz = 62, radius = 26, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9, posy = 36, posz = 62, radius = 26, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 49.5, posz = -11.2, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 49.5, posz = -11.2, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 49.5, posz = -21.7, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 7, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 49.5, posz = -21.7, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 7, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 49.5, posz = -32.3, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 9, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 49.5, posz = -32.3, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 9, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 49.5, posz = -11.2, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 8, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 49.5, posz = -11.2, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 8, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 49.5, posz = -21.7, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 5, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 49.5, posz = -21.7, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 5, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 49.5, posz = -32.3, radius = 52, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 49.5, posz = -32.3, radius = 52, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustrra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustrla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustfla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustfra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.45, g = 0.7, b = 1, a = 0.3, - modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 150, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.45, g = 0.7, b = 1, a = 0.3, modelfactor = 0.4, specular = 1, scattering = 0.3, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcrw'] = { + ["corcrw"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 32, posz = 18, radius = 15, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 32, posz = 18, radius = 15, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 32, posz = 9, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 32, posz = 9, radius = 18, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 32, posz = 9, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.055, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 32, posz = 9, radius = 18, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.055, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.5, posy = 24, posz = 42, radius = 16, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.5, posy = 24, posz = 42, radius = 16, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.5, posy = 24, posz = 42, radius = 16, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.5, posy = 24, posz = 42, radius = 16, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -7, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -7, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -15, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.3, colortime = 7, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -15, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.3, colortime = 7, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -22, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 9, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -22, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 9, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -7, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 8, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -7, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 8, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -15, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 5, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -15, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 5, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -22, radius = 32, - color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, - r = 1, g = 1, b = 0.3, a = 0.05, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -22, radius = 32, color2r = 0.7, color2g = 0.7, color2b = 0.25, colortime = 6, r = 1, g = 1, b = 0.3, a = 0.05, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustrra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustrla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustfla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustfra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcrwh'] = { + ["corcrwh"] = { flamelight = { - lightType = 'point', - pieceName = 'sleevef', - lightConfig = { posx = 0, posy = -1, posz = 14.2, radius = 5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, - r = 0.95, g = 0.66, b = 0.07, a = 2.9, - modelfactor = 0.4, specular = 0.9, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevef", + lightConfig = { posx = 0, posy = -1, posz = 14.2, radius = 5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 7, r = 0.95, g = 0.66, b = 0.07, a = 2.9, modelfactor = 0.4, specular = 0.9, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- flamebright = { -- lightType = 'point', @@ -27917,80 +17810,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3, posy = 32, posz = 26.3, radius = 2, - pos2x = 3, pos2y = 32, pos2z = 26.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3, posy = 32, posz = 26.3, radius = 2, pos2x = 3, pos2y = 32, pos2z = 26.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfrontlow = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3, posy = 24, posz = 48.3, radius = 2, - pos2x = 3, pos2y = 24, pos2z = 48.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3, posy = 24, posz = 48.3, radius = 2, pos2x = 3, pos2y = 24, pos2z = 48.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -3, posy = 31, posz = 21, radius = 2.8, - dirx = 0, diry = 0, dirz = 1, theta = -5.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -3, posy = 31, posz = 21, radius = 2.8, dirx = 0, diry = 0, dirz = 1, theta = -5.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 31, posz = 21, radius = 2.8, - dirx = 0, diry = 0, dirz = 1, theta = -5.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 31, posz = 21, radius = 2.8, dirx = 0, diry = 0, dirz = 1, theta = -5.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashantenna1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4.1, posy = 36.5, posz = -57.8, radius = 5.3, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4.1, posy = 36.5, posz = -57.8, radius = 5.3, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.4, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, yellowflashantenna1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.1, posy = 36.5, posz = -57.8, radius = 4.3, - color2r = -20, color2g = -20, color2b = -20, colortime = 60, - r = 1.1, g = 0.9, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.1, posy = 36.5, posz = -57.8, radius = 4.3, color2r = -20, color2g = -20, color2b = -20, colortime = 60, r = 1.1, g = 0.9, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa1 = { - lightType = 'point', - pieceName = 'sleeveaa', - lightConfig = { posx = -4.5, posy = 4.0, posz = 2.2, radius = 3, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeveaa", + lightConfig = { posx = -4.5, posy = 4.0, posz = 2.2, radius = 3, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretaa2 = { - lightType = 'point', - pieceName = 'sleeveaa', - lightConfig = { posx = 4.5, posy = 4.0, posz = 2.2, radius = 3, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeveaa", + lightConfig = { posx = 4.5, posy = 4.0, posz = 2.2, radius = 3, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -28038,290 +17895,162 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, flashenergy1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14.6, posy = 31, posz = -7, radius = 5.2, - dirx = 0, diry = 0, dirz = 1, theta = -15.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 0.9, b = 0.2, a = 4.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14.6, posy = 31, posz = -7, radius = 5.2, dirx = 0, diry = 0, dirz = 1, theta = -15.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 0.9, b = 0.2, a = 4.5, modelfactor = 0.8, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashenergy2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14.6, posy = 31, posz = -7, radius = 5.2, - dirx = 0, diry = 0, dirz = 1, theta = -15.0, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1.1, g = 0.9, b = 0.2, a = 4.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14.6, posy = 31, posz = -7, radius = 5.2, dirx = 0, diry = 0, dirz = 1, theta = -15.0, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1.1, g = 0.9, b = 0.2, a = 4.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = 7, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = 7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -7, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.9, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.9, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -15, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -15, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 15, posy = 35, posz = -22, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 15, posy = 35, posz = -22, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = 7, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = 7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -7, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.9, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.9, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top9 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -15, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -15, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top10 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -15, posy = 35, posz = -22, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.3, a = 0.5, - modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -15, posy = 35, posz = -22, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.3, a = 0.5, modelfactor = 0.3, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust1 = { - lightType = 'cone', - pieceName = 'thrustrra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust2 = { - lightType = 'cone', - pieceName = 'thrustrla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustrla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust3 = { - lightType = 'cone', - pieceName = 'thrustfla', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfla", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thrust4 = { - lightType = 'cone', - pieceName = 'thrustfra', - lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.74, - r = 0.45, g = 0.7, b = 1, a = 0.24, - modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "thrustfra", + lightConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.74, r = 0.45, g = 0.7, b = 1, a = 0.24, modelfactor = 0.4, specular = 1, scattering = 0.5, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armwin'] = { + ["armwin"] = { light1 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = -4, posy = 0, posz = 0, radius = 9, - color2r = 0.2, color2g = 0.08, color2b = 0.05, colortime = -2, - r = 1, g = 0.8, b = 0.2, a = 0.44, - modelfactor = 0.5, specular = 1.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = -4, posy = 0, posz = 0, radius = 9, color2r = 0.2, color2g = 0.08, color2b = 0.05, colortime = -2, r = 1, g = 0.8, b = 0.2, a = 0.44, modelfactor = 0.5, specular = 1.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 4, posy = 0, posz = 0, radius = 9, - color2r = 0.2, color2g = 0.08, color2b = 0.05, colortime = -2, - r = 1, g = 0.8, b = 0.2, a = 0.44, - modelfactor = 0.5, specular = 1.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 4, posy = 0, posz = 0, radius = 9, color2r = 0.2, color2g = 0.08, color2b = 0.05, colortime = -2, r = 1, g = 0.8, b = 0.2, a = 0.44, modelfactor = 0.5, specular = 1.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennalight = { - lightType = 'point', - pieceName = 'turbine', - lightConfig = { posx = 0, posy = 2, posz = 9.5, radius = 8, - color2r = -28, color2g = -28, color2b = -28, colortime = -1.5, - r = -1, g = 0.8, b = 0.8, a = 2.0, - modelfactor = 0.3, specular = 0.5, scattering = 0.05, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbine", + lightConfig = { posx = 0, posy = 2, posz = 9.5, radius = 8, color2r = -28, color2g = -28, color2b = -28, colortime = -1.5, r = -1, g = 0.8, b = 0.8, a = 2.0, modelfactor = 0.3, specular = 0.5, scattering = 0.05, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armwint2'] = { + ["armwint2"] = { light = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 73, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 73, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corwin'] = { + ["corwin"] = { antennalight = { - lightType = 'point', - pieceName = 'cradle', - lightConfig = { posx = 0, posy = 62, posz = -7.6, radius = 10, - color2r = -25, color2g = -25, color2b = -25, colortime = -1, - r = 1.5, g = 1.5, b = 1.5, a = 1.0, - modelfactor = 0.5, specular = 0.4, scattering = 0.03, lensflare = 7, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cradle", + lightConfig = { posx = 0, posy = 62, posz = -7.6, radius = 10, color2r = -25, color2g = -25, color2b = -25, colortime = -1, r = 1.5, g = 1.5, b = 1.5, a = 1.0, modelfactor = 0.5, specular = 0.4, scattering = 0.03, lensflare = 7, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, antennalight2 = { - lightType = 'point', - pieceName = 'cradle', - lightConfig = { posx = 0, posy = 54, posz = 2.7, radius = 4, - color2r = -100, color2g = -4, color2b = -4, colortime = -1, - r = 0, g = 0, b = 0, a = 1.0, - modelfactor = 0.4, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cradle", + lightConfig = { posx = 0, posy = 54, posz = 2.7, radius = 4, color2r = -100, color2g = -4, color2b = -4, colortime = -1, r = 0, g = 0, b = 0, a = 1.0, modelfactor = 0.4, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cradle', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 50, posz = -6, radius = 55, - dirx = 0, diry = -1, dirz = 0.01, theta = 0.22, - r = 1, g = 1, b = 0.89, a = 0.45, colortime = -1.5, - modelfactor = 0.3, specular = 0.2, scattering = 2.2, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cradle", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 50, posz = -6, radius = 55, dirx = 0, diry = -1, dirz = 0.01, theta = 0.22, r = 1, g = 1, b = 0.89, a = 0.45, colortime = -1.5, modelfactor = 0.3, specular = 0.2, scattering = 2.2, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corestor'] = { + ["corestor"] = { top = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = 1.2, g = 0.86, b = 0.25, a = 1.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = 1.2, g = 0.86, b = 0.25, a = 1.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = -11.5, posy = -26, posz = 19.5, radius = 8, - pos2x = -9.1, pos2y = -10, pos2z = 15.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = -11.5, posy = -26, posz = 19.5, radius = 8, pos2x = -9.1, pos2y = -10, pos2z = 15.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = -23.5, posy = -26, posz = 0, radius = 8, - pos2x = -16.1, pos2y = -10, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = -23.5, posy = -26, posz = 0, radius = 8, pos2x = -16.1, pos2y = -10, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = -11.5, posy = -26, posz = -19.5, radius = 8, - pos2x = -9.1, pos2y = -10, pos2z = -15.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = -11.5, posy = -26, posz = -19.5, radius = 8, pos2x = -9.1, pos2y = -10, pos2z = -15.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = 11.5, posy = -26, posz = 19.5, radius = 8, - pos2x = 9.1, pos2y = -10, pos2z = 15.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = 11.5, posy = -26, posz = 19.5, radius = 8, pos2x = 9.1, pos2y = -10, pos2z = 15.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side5 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = 23.5, posy = -26, posz = 0, radius = 8, - pos2x = 16.1, pos2y = -10, pos2z = 0, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = 23.5, posy = -26, posz = 0, radius = 8, pos2x = 16.1, pos2y = -10, pos2z = 0, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side6 = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = 11.5, posy = -26, posz = -19.5, radius = 8, - pos2x = 9.1, pos2y = -10, pos2z = -15.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.44, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = 11.5, posy = -26, posz = -19.5, radius = 8, pos2x = 9.1, pos2y = -10, pos2z = -15.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.44, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- side1 = { -- lightType = 'point', @@ -28378,98 +18107,54 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['coruwfus'] = { + ["coruwfus"] = { light = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 25, posz = 0, radius = 47, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 2.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 25, posz = 0, radius = 47, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 2.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coruwmmm'] = { + ["coruwmmm"] = { botright = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = -25, posy = 0, posz = -21, radius = 7, - pos2x = -21, pos2y = 0, pos2z = -25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.85, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = -25, posy = 0, posz = -21, radius = 7, pos2x = -21, pos2y = 0, pos2z = -25, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.85, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, botleft = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = 25, posy = 0, posz = -21, radius = 7, - pos2x = 21, pos2y = 0, pos2z = -25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.85, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = 25, posy = 0, posz = -21, radius = 7, pos2x = 21, pos2y = 0, pos2z = -25, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.85, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topright = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = -25, posy = 0, posz = 21, radius = 7, - pos2x = -21, pos2y = 0, pos2z = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.85, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = -25, posy = 0, posz = 21, radius = 7, pos2x = -21, pos2y = 0, pos2z = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.85, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topleft = { - lightType = 'beam', - pieceName = 'emit', - lightConfig = { posx = 25, posy = 0, posz = 21, radius = 7, - pos2x = 21, pos2y = 0, pos2z = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.85, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "emit", + lightConfig = { posx = 25, posy = 0, posz = 21, radius = 7, pos2x = 21, pos2y = 0, pos2z = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.85, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, botrightstop = { - lightType = 'beam', - pieceName = 'stop', - lightConfig = { posx = -25, posy = 0, posz = -21, radius = 7, - pos2x = -21, pos2y = 0, pos2z = -25, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0, b = 0, a = 1.25, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "stop", + lightConfig = { posx = -25, posy = 0, posz = -21, radius = 7, pos2x = -21, pos2y = 0, pos2z = -25, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0, b = 0, a = 1.25, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, botleftstop = { - lightType = 'beam', - pieceName = 'stop', - lightConfig = { posx = 25, posy = 0, posz = -21, radius = 7, - pos2x = 21, pos2y = 0, pos2z = -25, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0, b = 0, a = 1.25, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "stop", + lightConfig = { posx = 25, posy = 0, posz = -21, radius = 7, pos2x = 21, pos2y = 0, pos2z = -25, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0, b = 0, a = 1.25, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, toprightstop = { - lightType = 'beam', - pieceName = 'stop', - lightConfig = { posx = -25, posy = 0, posz = 21, radius = 7, - pos2x = -21, pos2y = 0, pos2z = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0, b = 0, a = 1.25, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "stop", + lightConfig = { posx = -25, posy = 0, posz = 21, radius = 7, pos2x = -21, pos2y = 0, pos2z = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0, b = 0, a = 1.25, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topleftstop = { - lightType = 'beam', - pieceName = 'stop', - lightConfig = { posx = 25, posy = 0, posz = 21, radius = 7, - pos2x = 21, pos2y = 0, pos2z = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 30, - r = 1.2, g = 0, b = 0, a = 1.25, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "stop", + lightConfig = { posx = 25, posy = 0, posz = 21, radius = 7, pos2x = 21, pos2y = 0, pos2z = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 30, r = 1.2, g = 0, b = 0, a = 1.25, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- side1 = { -- lightType = 'point', @@ -28508,146 +18193,82 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['coruwmme'] = { + ["coruwmme"] = { metalglowtop = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 24, posz = 0, radius = 15, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 24, posz = 0, radius = 15, color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, metalglowbig = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -10, posz = 0, radius = 44, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = -10, posz = 0, radius = 44, color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coruwes'] = { + ["coruwes"] = { light = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 47, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.1, specular = 0, scattering = 2.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 47, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.1, specular = 0, scattering = 2.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coruwadves'] = { + ["coruwadves"] = { light = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 34, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.1, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 34, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.1, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, - dirx = -1, diry = -0.75, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, dirx = -1, diry = -0.75, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, - dirx = 0, diry = -0.75, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, dirx = 0, diry = -0.75, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, - dirx = 1, diry = -0.75, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, dirx = 1, diry = -0.75, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, - dirx = 0, diry = -0.75, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 69, dirx = 0, diry = -0.75, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.2, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armestor'] = { + ["armestor"] = { top = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.86, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.86, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topconstant = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 12, - color2r = 0.6, color2g = 0.48, color2b = 0.16, colortime = 25, - r = 1, g = 0.86, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 12, color2r = 0.6, color2g = 0.48, color2b = 0.16, colortime = 25, r = 1, g = 0.86, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = -1, diry = -1.5, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = -1, diry = -1.5, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side2cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = 1, diry = -1.5, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = 1, diry = -1.5, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side3cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = 1, diry = -1.5, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = 1, diry = -1.5, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side4cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = -1, diry = -1.5, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = -1, diry = -1.5, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, -- side1 = { -- lightType = 'point', @@ -28686,15 +18307,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmstor'] = { + ["armmstor"] = { mid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20, posz = 0, radius = 25, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 40, - r = 1, g = 1, b = 1, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 20, posz = 0, radius = 25, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 40, r = 1, g = 1, b = 1, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top = { -- lightType = 'point', @@ -28706,15 +18323,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cormstor'] = { + ["cormstor"] = { mid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = -6, posz = 0, radius = 28, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 40, - r = 1, g = 1, b = 1, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = -6, posz = 0, radius = 28, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 40, r = 1, g = 1, b = 1, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top = { -- lightType = 'point', @@ -28726,142 +18339,80 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armuwmex'] = { + ["armuwmex"] = { light = { - lightType = 'point', - pieceName = 'spinner', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 25, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "spinner", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 25, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armuwes'] = { + ["armuwes"] = { light = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 75, - r = 1, g = 0.86, b = 0.25, a = 0.2, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 75, r = 1, g = 0.86, b = 0.25, a = 0.2, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 19, posy = -25, posz = 19, radius = 28, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1, g = 1, b = 0.25, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 19, posy = -25, posz = 19, radius = 28, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1, g = 1, b = 0.25, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = -19, posy = -25, posz = 19, radius = 28, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1, g = 1, b = 0.25, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = -19, posy = -25, posz = 19, radius = 28, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1, g = 1, b = 0.25, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 19, posy = -25, posz = -19, radius = 28, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1, g = 1, b = 0.25, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 19, posy = -25, posz = -19, radius = 28, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1, g = 1, b = 0.25, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = -19, posy = -25, posz = -19, radius = 28, - color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, - r = 1, g = 1, b = 0.25, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = -19, posy = -25, posz = -19, radius = 28, color2r = 1, color2g = 1, color2b = 0.25, colortime = 0, r = 1, g = 1, b = 0.25, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armuwadves'] = { + ["armuwadves"] = { light1 = { - lightType = 'point', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.86, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.86, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light2 = { - lightType = 'point', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.86, b = 0.25, a = 0.8, - modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.86, b = 0.25, a = 0.8, modelfactor = 0.3, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = -1, diry = -1.5, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = -1, diry = -1.5, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2cone = { - lightType = 'cone', - pieceName = 'emit1', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = 1, diry = -1.5, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit1", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = 1, diry = -1.5, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3cone = { - lightType = 'cone', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = 1, diry = -1.5, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = 1, diry = -1.5, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4cone = { - lightType = 'cone', - pieceName = 'emit2', - lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, - dirx = -1, diry = -1.5, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit2", + lightConfig = { posx = 0, posy = -2, posz = 0, radius = 52, dirx = -1, diry = -1.5, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side5cone = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = -2, posy = 37, posz = 0, radius = 52, - dirx = -1, diry = -1.5, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = -2, posy = 37, posz = 0, radius = 52, dirx = -1, diry = -1.5, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side6cone = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 2, posy = 37, posz = 0, radius = 52, - dirx = 1, diry = -1.5, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.75, a = 0.8, - modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 2, posy = 37, posz = 0, radius = 52, dirx = 1, diry = -1.5, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.75, a = 0.8, modelfactor = 0.5, specular = 0.2, scattering = 4.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- side1 = { -- lightType = 'point', @@ -28918,98 +18469,56 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armbrtha'] = { + ["armbrtha"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 54, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 54, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 54, posz = 8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 54, posz = 8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 54, posz = -8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 54, posz = -8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 54, posz = -8, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 54, posz = -8, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topblink = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -13, posy = 3.7, posz = -1.3, radius = 0.9, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = -1, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -13, posy = 3.7, posz = -1.3, radius = 0.9, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = -1, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topslide = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -12.5, posy = 2.8, posz = -1.3, radius = 0.9, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -12.5, posy = 2.8, posz = -1.3, radius = 0.9, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topblink2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 13, posy = 3.7, posz = -1.3, radius = 0.9, - color2r = -7, color2g = -7, color2b = -7, colortime = 25, - r = -1, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 13, posy = 3.7, posz = -1.3, radius = 0.9, color2r = -7, color2g = -7, color2b = -7, colortime = 25, r = -1, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topslide2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 12.5, posy = 2.8, posz = -1.3, radius = 0.9, - dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.3, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 12.5, posy = 2.8, posz = -1.3, radius = 0.9, dirx = 0, diry = 0, dirz = 0.6666667, theta = -1.3, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 1.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -18, posy = 0, posz = 0, radius = 8, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -18, posy = 0, posz = 0, radius = 8, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 18, posy = 0, posz = 0, radius = 8, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 18, posy = 0, posz = 0, radius = 8, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- back1 = { -- lightType = 'point', @@ -29030,34 +18539,19 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, topanimleft = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 4.6, posy = 10.9, posz = -3.4, radius = 4.0, - dirx = 0, diry = 0, dirz = 0.5, theta = -6.3, - color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 4.6, posy = 10.9, posz = -3.4, radius = 4.0, dirx = 0, diry = 0, dirz = 0.5, theta = -6.3, color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topanimright = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -4.6, posy = 11.1, posz = -3.4, radius = 4.0, - dirx = 0, diry = 0, dirz = 0.5, theta = -6.3, - color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -4.6, posy = 11.1, posz = -3.4, radius = 4.0, dirx = 0, diry = 0, dirz = 0.5, theta = -6.3, color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontanimright = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -6.2, posy = -2.5, posz = 46.4, radius = 2.1, - dirx = 0, diry = 0, dirz = 0.5, theta = -3.9, - color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, - r = 1.2, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -6.2, posy = -2.5, posz = 46.4, radius = 2.1, dirx = 0, diry = 0, dirz = 0.5, theta = -3.9, color2r = -0.5, color2g = -0.5, color2b = -0.5, colortime = 60, r = 1.2, g = 1, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- top1 = { -- lightType = 'point', @@ -29096,40 +18590,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, topmid1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 6.8, posy = 8, posz = 24, radius = 5.5, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 6.8, posy = 8, posz = 24, radius = 5.5, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topmid2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -6.8, posy = 8, posz = 24, radius = 5.5, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -6.8, posy = 8, posz = 24, radius = 5.5, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topmid3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 8, posy = -2.5, posz = 24, radius = 5, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 8, posy = -2.5, posz = 24, radius = 5, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topmid4 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -8, posy = -2.5, posz = 24, radius = 5, - color2r = -2, color2g = -2, color2b = -2, colortime = -1, - r = 1.2, g = 1, b = 0.25, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -8, posy = -2.5, posz = 24, radius = 5, color2r = -2, color2g = -2, color2b = -2, colortime = -1, r = 1.2, g = 1, b = 0.25, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topfront1 = { -- lightType = 'point', @@ -29150,7 +18628,7 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armgmm'] = { + ["armgmm"] = { -- light = { -- lightType = 'point', -- pieceName = 'base', @@ -29161,250 +18639,230 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, top1anim = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.5, posy = 29, posz = -11.8, radius = 5, - dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.5, posy = 29, posz = -11.8, radius = 5, dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1anim2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.5, posy = 29, posz = -11.8, radius = 5, - dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.5, posy = 29, posz = -11.8, radius = 5, dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1anim3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.5, posy = 29, posz = 11.8, radius = 5, - dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.5, posy = 29, posz = 11.8, radius = 5, dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1anim4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.5, posy = 29, posz = 11.8, radius = 5, - dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.5, posy = 29, posz = 11.8, radius = 5, dirx = 0, diry = 0.6666667, dirz = 0, theta = -1, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 23, posz = -33, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 23, posz = -33, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 23, posz = -33, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 23, posz = -33, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 23, posz = 33, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 23, posz = 33, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 23, posz = 33, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 23, posz = 33, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -33, posy = 23, posz = -6.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -33, posy = 23, posz = -6.5, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -33, posy = 23, posz = 6.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -33, posy = 23, posz = 6.5, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 33, posy = 23, posz = -6.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 33, posy = 23, posz = -6.5, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 33, posy = 23, posz = 6.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0., colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 33, posy = 23, posz = 6.5, radius = 14, color2r = 0, color2g = 0, color2b = 0., colortime = -1, r = 1.2, g = 0.86, b = 0.25, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, botbeam1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -27, posy = 8, posz = -17, radius = 9.0, - pos2x = -17, pos2y = 8, pos2z = -27, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -27, + posy = 8, + posz = -17, + radius = 9.0, + pos2x = -17, + pos2y = 8, + pos2z = -27, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1.2, + g = 0.86, + b = 0.25, + a = 0.2, + modelfactor = 0.4, + specular = 0.4, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, botbeam2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 27, posy = 8, posz = -17, radius = 9.0, - pos2x = 17, pos2y = 8, pos2z = -27, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 27, + posy = 8, + posz = -17, + radius = 9.0, + pos2x = 17, + pos2y = 8, + pos2z = -27, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1.2, + g = 0.86, + b = 0.25, + a = 0.2, + modelfactor = 0.4, + specular = 0.4, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, botbeam3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -27, posy = 8, posz = 17, radius = 9.0, - pos2x = -17, pos2y = 8, pos2z = 27, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -27, + posy = 8, + posz = 17, + radius = 9.0, + pos2x = -17, + pos2y = 8, + pos2z = 27, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1.2, + g = 0.86, + b = 0.25, + a = 0.2, + modelfactor = 0.4, + specular = 0.4, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, botbeam4 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 27, posy = 8, posz = 17, radius = 9.0, - pos2x = 17, pos2y = 8, pos2z = 27, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.86, b = 0.25, a = 0.2, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['corbhmth'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 27, + posy = 8, + posz = 17, + radius = 9.0, + pos2x = 17, + pos2y = 8, + pos2z = 27, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = 1.2, + g = 0.86, + b = 0.25, + a = 0.2, + modelfactor = 0.4, + specular = 0.4, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["corbhmth"] = { corner1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21, posy = 15, posz = 21, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.9, b = 0.2, a = 0.85, - modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21, posy = 15, posz = 21, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.9, b = 0.2, a = 0.85, modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 15, posz = 21, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.9, b = 0.2, a = 0.85, - modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 15, posz = 21, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.9, b = 0.2, a = 0.85, modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21, posy = 15, posz = -21, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.9, b = 0.2, a = 0.85, - modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21, posy = 15, posz = -21, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.9, b = 0.2, a = 0.85, modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, corner4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 15, posz = -21, radius = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 0.9, b = 0.2, a = 0.85, - modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 15, posz = -21, radius = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 0.9, b = 0.2, a = 0.85, modelfactor = 0.45, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chimney = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0.4, posy = 37, posz = -5.7, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.2, g = 0.9, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0.4, posy = 37, posz = -5.7, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.2, g = 0.9, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashl1 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 14.8, posy = 33, posz = -6.1, radius = 1.4, - pos2x = 16.8, pos2y = 33, pos2z = -6.1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 14.8, posy = 33, posz = -6.1, radius = 1.4, pos2x = 16.8, pos2y = 33, pos2z = -6.1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashl2 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 14.8, posy = 33, posz = -8.5, radius = 1.4, - pos2x = 16.8, pos2y = 33, pos2z = -8.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 14.8, posy = 33, posz = -8.5, radius = 1.4, pos2x = 16.8, pos2y = 33, pos2z = -8.5, color2r = -10, color2g = -10, color2b = -10, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr1 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -14.2, posy = 33, posz = -6.1, radius = 1.4, - pos2x = -16.2, pos2y = 33, pos2z = -6.1, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -14.2, posy = 33, posz = -6.1, radius = 1.4, pos2x = -16.2, pos2y = 33, pos2z = -6.1, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr2 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -14.2, posy = 33, posz = -8.5, radius = 1.4, - pos2x = -16.2, pos2y = 33, pos2z = -8.5, - color2r = -10, color2g = -10, color2b = -10, colortime = 90, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -14.2, posy = 33, posz = -8.5, radius = 1.4, pos2x = -16.2, pos2y = 33, pos2z = -8.5, color2r = -10, color2g = -10, color2b = -10, colortime = 90, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corgeo'] = { + ["corgeo"] = { --top1 = { -- lightType = 'point', -- pieceName = 'base', @@ -29424,256 +18882,147 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, chimney = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 54, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 54, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28, posz = 29, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28, posz = 29, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 25, posy = 28, posz = -15, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 25, posy = 28, posz = -15, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -25, posy = 28, posz = -15, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -25, posy = 28, posz = -15, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coruwgeo'] = { + ["coruwgeo"] = { chimney = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 43, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 43, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28, posz = -29, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28, posz = -29, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 25, posy = 28, posz = 15, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 25, posy = 28, posz = 15, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -25, posy = 28, posz = 15, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -25, posy = 28, posz = 15, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corageo'] = { + ["corageo"] = { chimney = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 60, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 60, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod1 = { - lightType = 'point', - pieceName = 'rod2', - lightConfig = { posx = 0, posy = 63, posz = 22, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod2", + lightConfig = { posx = 0, posy = 63, posz = 22, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod2 = { - lightType = 'point', - pieceName = 'rod3', - lightConfig = { posx = 19, posy = 63, posz = -11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod3", + lightConfig = { posx = 19, posy = 63, posz = -11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod3 = { - lightType = 'point', - pieceName = 'rod1', - lightConfig = { posx = -19, posy = 63, posz = -11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod1", + lightConfig = { posx = -19, posy = 63, posz = -11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 40, posz = 34, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 40, posz = 34, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27, posy = 40, posz = -16, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27, posy = 40, posz = -16, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 40, posz = -16, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 40, posz = -16, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coruwageo'] = { + ["coruwageo"] = { chimney = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 60, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.8, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 60, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.8, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod1 = { - lightType = 'point', - pieceName = 'rod2', - lightConfig = { posx = 0, posy = 63, posz = -22, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod2", + lightConfig = { posx = 0, posy = 63, posz = -22, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod2 = { - lightType = 'point', - pieceName = 'rod3', - lightConfig = { posx = 19, posy = 63, posz = 11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod3", + lightConfig = { posx = 19, posy = 63, posz = 11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rod3 = { - lightType = 'point', - pieceName = 'rod1', - lightConfig = { posx = -19, posy = 63, posz = 11, radius = 11, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.9, b = 0.2, a = 1.9, - modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rod1", + lightConfig = { posx = -19, posy = 63, posz = 11, radius = 11, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.9, b = 0.2, a = 1.9, modelfactor = 0.6, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 40, posz = -34, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 40, posz = -34, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27, posy = 40, posz = 16, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27, posy = 40, posz = 16, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27, posy = 40, posz = 16, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armgeo'] = { - top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = 9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27, posy = 40, posz = 16, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.3, specular = 0, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + }, + ["armgeo"] = { + top1 = { + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = 9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = -17, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = -17, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = 9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = 9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = -17, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = -17, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1animated = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 41.1, posz = 21.7, radius = 3, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 41.1, posz = 21.7, radius = 3, dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mid1beam = { -- lightType = 'beam', @@ -29687,152 +19036,177 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, mid2beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 33, posz = -29.0, radius = 3.0, - pos2x = 0, pos2y = 48, pos2z = -29.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 0, + posy = 33, + posz = -29.0, + radius = 3.0, + pos2x = 0, + pos2y = 48, + pos2z = -29.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, mid3beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 25, posy = 33, posz = -4, radius = 3.0, - pos2x = 25, pos2y = 48, pos2z = -4.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 25, + posy = 33, + posz = -4, + radius = 3.0, + pos2x = 25, + pos2y = 48, + pos2z = -4.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, mid4beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -25, posy = 33, posz = -4, radius = 3.0, - pos2x = -25, pos2y = 48, pos2z = -4.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -25, + posy = 33, + posz = -4, + radius = 3.0, + pos2x = -25, + pos2y = 48, + pos2z = -4.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, bottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 9, posz = 25, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 0.7, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 9, posz = 25, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 0.7, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 9, posz = 25, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 0.7, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 9, posz = 25, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 0.7, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottombeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -18, posy = 2, posz = 24, radius = 4.0, - pos2x = 18, pos2y = 2, pos2z = 24.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.4, g = 0.9, b = 0.2, a = 0.2, - modelfactor = 0.5, specular = 0.2, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -18, + posy = 2, + posz = 24, + radius = 4.0, + pos2x = 18, + pos2y = 2, + pos2z = 24.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = 1.4, + g = 0.9, + b = 0.2, + a = 0.2, + modelfactor = 0.5, + specular = 0.2, + scattering = 1.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, bottoml = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 2, posz = 24, radius = 7, - dirx = 0.6666667, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 2, posz = 24, radius = 7, dirx = 0.6666667, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottomr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 2, posz = 24, radius = 7, - dirx = -0.6666667, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 2, posz = 24, radius = 7, dirx = -0.6666667, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hotl = { - lightType = 'point', - pieceName = 'hotl', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 0.35, b = 0.1, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "hotl", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 0.35, b = 0.1, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hotr = { - lightType = 'point', - pieceName = 'hotr', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.35, b = 0.1, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "hotr", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.35, b = 0.1, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armgeo'] = { + ["armgeo"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = 9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = 9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = -17, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = -17, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = 9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = 9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = -17, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = -17, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1animated = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 41.1, posz = 21.7, radius = 3, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 41.1, posz = 21.7, radius = 3, dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mid1beam = { -- lightType = 'beam', @@ -29846,153 +19220,178 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, mid2beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 33, posz = -29.0, radius = 3.0, - pos2x = 0, pos2y = 48, pos2z = -29.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 0, + posy = 33, + posz = -29.0, + radius = 3.0, + pos2x = 0, + pos2y = 48, + pos2z = -29.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, mid3beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 25, posy = 33, posz = -4, radius = 3.0, - pos2x = 25, pos2y = 48, pos2z = -4.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 25, + posy = 33, + posz = -4, + radius = 3.0, + pos2x = 25, + pos2y = 48, + pos2z = -4.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, mid4beam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -25, posy = 33, posz = -4, radius = 3.0, - pos2x = -25, pos2y = 48, pos2z = -4.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -25, + posy = 33, + posz = -4, + radius = 3.0, + pos2x = -25, + pos2y = 48, + pos2z = -4.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.1, + r = 1.2, + g = 1, + b = 0.2, + a = 0.6, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, bottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 9, posz = 25, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 0.7, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 9, posz = 25, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 0.7, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 9, posz = 25, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 0.7, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 9, posz = 25, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 0.7, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottombeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -18, posy = 2, posz = 24, radius = 4.0, - pos2x = 18, pos2y = 2, pos2z = 24.1, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.4, g = 0.9, b = 0.2, a = 0.2, - modelfactor = 0.5, specular = 0.2, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = -18, + posy = 2, + posz = 24, + radius = 4.0, + pos2x = 18, + pos2y = 2, + pos2z = 24.1, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1.2, + r = 1.4, + g = 0.9, + b = 0.2, + a = 0.2, + modelfactor = 0.5, + specular = 0.2, + scattering = 1.5, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, bottoml = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 8, posy = 2, posz = 24, radius = 7, - dirx = 0.6666667, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 8, posy = 2, posz = 24, radius = 7, dirx = 0.6666667, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottomr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -8, posy = 2, posz = 24, radius = 7, - dirx = -0.6666667, diry = 0, dirz = 0, theta = -9, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -8, posy = 2, posz = 24, radius = 7, dirx = -0.6666667, diry = 0, dirz = 0, theta = -9, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hotl = { - lightType = 'point', - pieceName = 'hotl', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 0.35, b = 0.1, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "hotl", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 0.35, b = 0.1, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, hotr = { - lightType = 'point', - pieceName = 'hotr', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.35, b = 0.1, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "hotr", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7.5, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.35, b = 0.1, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armuwgeo'] = { + ["armuwgeo"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = 13, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = 13, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -13, posy = 47, posz = -13, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -13, posy = 47, posz = -13, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = 13, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = 13, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 13, posy = 47, posz = -13, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.1, g = 0.9, b = 0.3, a = 0.45, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 13, posy = 47, posz = -13, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.1, g = 0.9, b = 0.3, a = 0.45, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1animated = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 41.1, posz = 25.7, radius = 3, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.2, a = 1.0, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 41.1, posz = 25.7, radius = 3, dirx = 0, diry = -0.6666667, dirz = 0, theta = -8.5, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.2, a = 1.0, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mid1beam = { -- lightType = 'beam', @@ -30050,134 +19449,82 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['legestor'] = { + ["legestor"] = { rturbb = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 24, posz = 0, radius = 32, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 24, posz = 0, radius = 32, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leggeo'] = { + ["leggeo"] = { turb1 = { - lightType = 'point', - pieceName = 'turbine', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbine", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leguwgeo'] = { + ["leguwgeo"] = { enabled1 = { - lightType = 'point', - pieceName = 'turbine', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.9, b = 0.45, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbine", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.9, b = 0.45, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'turbine', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.9, g = 0.9, b = 0.45, a = 0.45, - modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbine", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.9, g = 0.9, b = 0.45, a = 0.45, modelfactor = 0.4, specular = 0, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legageo'] = { + ["legageo"] = { aturbf = { - lightType = 'point', - pieceName = 'turbinef', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbinef", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aturbl = { - lightType = 'point', - pieceName = 'turbinel', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbinel", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aturbr = { - lightType = 'point', - pieceName = 'turbiner', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbiner", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrampart'] = { + ["legrampart"] = { rturbb = { - lightType = 'point', - pieceName = 'turbinef', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbinef", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rturbl = { - lightType = 'point', - pieceName = 'turbinel', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbinel", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rturbr = { - lightType = 'point', - pieceName = 'turbiner', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, - color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, - r = 1, g = 0.9, b = 0.3, a = 0.3, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turbiner", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 40, color2r = 1, color2g = 0.7, color2b = 0.15, colortime = 0, r = 1, g = 0.9, b = 0.3, a = 0.3, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jamlight1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 58, posz = 32, radius = 25, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 58, posz = 32, radius = 25, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jamlight2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -27.5, posy = 58, posz = -16, radius = 25, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -27.5, posy = 58, posz = -16, radius = 25, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, jamlight3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 27.5, posy = 58, posz = -16, radius = 25, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 27.5, posy = 58, posz = -16, radius = 25, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armageo'] = { + ["armageo"] = { --light = { -- lightType = 'point', -- pieceName = 'base', @@ -30188,175 +19535,97 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 49, posz = 8, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 49, posz = 8, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 49, posz = -3.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 49, posz = -3.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 49, posz = -3.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 49, posz = -3.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1anim = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 44, posz = 6, radius = 8, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 44, posz = 6, radius = 8, dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2anim = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.5, posy = 44, posz = -3.5, radius = 8, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.5, posy = 44, posz = -3.5, radius = 8, dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3anim = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.5, posy = 44, posz = -3.5, radius = 8, - dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, - color2r = -1, color2g = -1, color2b = -1, colortime = 45, - r = 1.1, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.5, posy = 44, posz = -3.5, radius = 8, dirx = 0, diry = -0.6666667, dirz = 0, theta = -3, color2r = -1, color2g = -1, color2b = -1, colortime = 45, r = 1.1, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.1, specular = 0.1, scattering = 1.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 29, posz = 45, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 29, posz = 45, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 27, posz = 45, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 27, posz = 45, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32, posy = 274, posz = -42, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32, posy = 274, posz = -42, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -50, posy = 27, posz = -4, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -50, posy = 27, posz = -4, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32, posy = 27, posz = -42, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32, posy = 27, posz = -42, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 50, posy = 27, posz = -4, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 50, posy = 27, posz = -4, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 45, posz = 47, radius = 60, - dirx = 0, diry = -1.5, dirz = 1, theta = 0.6, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 0, posy = 45, posz = 47, radius = 60, dirx = 0, diry = -1.5, dirz = 1, theta = 0.6, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = -39, posy = 45, posz = -21, radius = 60, - dirx = -1.66, diry = -2, dirz = -1, theta = 0.6, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = -39, posy = 45, posz = -21, radius = 60, dirx = -1.66, diry = -2, dirz = -1, theta = 0.6, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3cone = { - lightType = 'cone', - pieceName = 'emit', - lightConfig = { posx = 39, posy = 45, posz = -21, radius = 60, - dirx = 1.66, diry = -2, dirz = -1, theta = 0.6, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "emit", + lightConfig = { posx = 39, posy = 45, posz = -21, radius = 60, dirx = 1.66, diry = -2, dirz = -1, theta = 0.6, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.2, scattering = 2.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = -40, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = -40, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35, posy = 10, posz = 19, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35, posy = 10, posz = 19, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35, posy = 10, posz = 19, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35, posy = 10, posz = 19, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armuwageo'] = { + ["armuwageo"] = { --light = { -- lightType = 'point', -- pieceName = 'base', @@ -30367,13 +19636,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, --}, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 59, posz = 0, radius = 19, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 3}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 59, posz = 0, radius = 19, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 3 }, }, -- top2 = { -- lightType = 'point', @@ -30424,58 +19689,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17, posy = 29, posz = -45, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17, posy = 29, posz = -45, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 17, posy = 27, posz = -45, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 17, posy = 27, posz = -45, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32, posy = 274, posz = 42, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32, posy = 274, posz = 42, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -50, posy = 27, posz = 4, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -50, posy = 27, posz = 4, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32, posy = 27, posz = 42, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32, posy = 27, posz = 42, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 50, posy = 27, posz = 4, radius = 22, - color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, - r = 1.1, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 50, posy = 27, posz = 4, radius = 22, color2r = -1, color2g = -1, color2b = -1, colortime = -1.5, r = 1.1, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- side1cone = { -- lightType = 'cone', @@ -30508,206 +19749,118 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, bottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = 40, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = 40, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 35, posy = 10, posz = -19, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 35, posy = 10, posz = -19, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -35, posy = 10, posz = -19, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.6, g = 0.42, b = 0.05, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -35, posy = 10, posz = -19, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.6, g = 0.42, b = 0.05, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armuwmme'] = { + ["armuwmme"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, head1 = { - lightType = 'point', - pieceName = 'headtip1', - lightConfig = { posx = 0, posy = 00, posz = 0, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "headtip1", + lightConfig = { posx = 0, posy = 00, posz = 0, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, head2 = { - lightType = 'point', - pieceName = 'headtip2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "headtip2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armemit1 = { - lightType = 'point', - pieceName = 'armemit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armemit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, armemit2 = { - lightType = 'point', - pieceName = 'armemit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armemit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmoho'] = { + ["armmoho"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'arms1', - lightConfig = { posx = 30, posy = 62, posz = 17, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "arms1", + lightConfig = { posx = 30, posy = 62, posz = 17, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'arms1', - lightConfig = { posx = -30, posy = 62, posz = 17, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "arms1", + lightConfig = { posx = -30, posy = 62, posz = 17, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'arms1', - lightConfig = { posx = 0, posy = 62, posz = -34, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "arms1", + lightConfig = { posx = 0, posy = 62, posz = -34, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- topmid = { -- lightType = 'point', @@ -30719,263 +19872,150 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armshockwave'] = { + ["armshockwave"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14, posy = 13, posz = 19, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23, posy = 13, posz = 3, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.8, b = 0.6, a = 0.12, - modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -12, posy = 13, posz = -21, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.8, b = 0.6, a = 0.12, modelfactor = 0.3, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'clock', - lightConfig = { posx = 32, posy = 35, posz = -20, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "clock", + lightConfig = { posx = 32, posy = 35, posz = -20, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'clock', - lightConfig = { posx = -32, posy = 35, posz = -20, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "clock", + lightConfig = { posx = -32, posy = 35, posz = -20, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top3 = { - lightType = 'point', - pieceName = 'clock', - lightConfig = { posx = 0, posy = 35, posz = 34, radius = 26, - color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, - r = 1, g = 0.8, b = 0.6, a = 1, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "clock", + lightConfig = { posx = 0, posy = 35, posz = 34, radius = 26, color2r = 0.4, color2g = 0.3, color2b = 0.2, colortime = 60, r = 1, g = 0.8, b = 0.6, a = 1, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, empcannon = { - lightType = 'point', - pieceName = 'emp', - lightConfig = { posx = 0, posy = 0.5, posz = 22.5, radius = 5, - color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, - r = 0.80, g = 0.85, b = 1.3, a = 0.8, - modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare =15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "emp", + lightConfig = { posx = 0, posy = 0.5, posz = 22.5, radius = 5, color2r = 0.15, color2g = 0.15, color2b = 0.35, colortime = 25, r = 0.80, g = 0.85, b = 1.3, a = 0.8, modelfactor = 0.2, specular = 0.3, scattering = 0.7, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsolar'] = { + ["corsolar"] = { light_small_1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.5, posy = 6, posz = 34.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.44, - modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.5, posy = 6, posz = 34.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.44, modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 6, posz = 34.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.44, - modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 6, posz = 34.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.44, modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.5, posy = 6, posz = -34.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.44, - modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.5, posy = 6, posz = -34.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.44, modelfactor = 0.3, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 6, posz = -34.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.39, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 6, posz = -34.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.39, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 34.5, posy = 6, posz = -10.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.39, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 34.5, posy = 6, posz = -10.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.39, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 34.5, posy = 6, posz = 10.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.39, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 34.5, posy = 6, posz = 10.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.39, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -34.5, posy = 6, posz = -10.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.39, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -34.5, posy = 6, posz = -10.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.39, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_small_8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -34.5, posy = 6, posz = 10.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.39, - modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -34.5, posy = 6, posz = 10.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.39, modelfactor = 0.3, specular = 0.4, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21, posy = 8, posz = 30, radius = 10, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21, posy = 8, posz = 30, radius = 10, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 8, posz = 30, radius = 10, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 8, posz = 30, radius = 10, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21, posy = 8, posz = -30, radius = 10, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21, posy = 8, posz = -30, radius = 10, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21, posy = 8, posz = -30, radius = 10, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21, posy = 8, posz = -30, radius = 10, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -30.2, posy = 8, posz = 20.7, radius = 11, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -30.2, posy = 8, posz = 20.7, radius = 11, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 30.2, posy = 8, posz = 20.7, radius = 11, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 30.2, posy = 8, posz = 20.7, radius = 11, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -30.2, posy = 8, posz = -20.7, radius = 11, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -30.2, posy = 8, posz = -20.7, radius = 11, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light_large_8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 30.2, posy = 8, posz = -20.7, radius = 11, - color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.5, a = 0.35, - modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 30.2, posy = 8, posz = -20.7, radius = 11, color2r = 0.2, color2g = 0.18, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.5, a = 0.35, modelfactor = 0.2, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamtop = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28, posz = 0, radius = 15, - color2r = -100, color2g = 0.18, color2b = 0, colortime = -1, - r = 0, g = 0, b = 0, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28, posz = 0, radius = 15, color2r = -100, color2g = 0.18, color2b = 0, colortime = -1, r = 0, g = 0, b = 0, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['armmex'] = { + ["armmex"] = { base = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 20, - r = 1, g = 1, b = 1, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 7, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 20, r = 1, g = 1, b = 1, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mineglow = { -- lightType = 'point', @@ -30996,73 +20036,43 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18.5, posy = -9, posz = 18.5, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18.5, posy = -9, posz = 18.5, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18.5, posy = -9, posz = 18.5, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18.5, posy = -9, posz = 18.5, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18.5, posy = -9, posz = -18.5, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18.5, posy = -9, posz = -18.5, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, side4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18.5, posy = -9, posz = -18.5, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.4, a = 0.33, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18.5, posy = -9, posz = -18.5, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.4, a = 0.33, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, }, - ['armsolar'] = { + ["armsolar"] = { light = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.3, a = 0.7, - modelfactor = 0.4, specular = 0.3, scattering = 0.25, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.3, a = 0.7, modelfactor = 0.4, specular = 0.3, scattering = 0.25, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armadvsol'] = { + ["armadvsol"] = { side1cone = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = -13, radius = 19, - dirx = 0, diry = -1.7, dirz = -1, theta = 0.75, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.75, a = 0.7, - modelfactor = 0.5, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = -13, radius = 19, dirx = 0, diry = -1.7, dirz = -1, theta = 0.75, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.75, a = 0.7, modelfactor = 0.5, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2cone = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 10, posz = 13, radius = 19, - dirx = 0, diry = -1.7, dirz = 1, theta = 0.75, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1.1, g = 1, b = 0.75, a = 0.7, - modelfactor = 0.5, specular = 0.2, scattering = 1.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 10, posz = 13, radius = 19, dirx = 0, diry = -1.7, dirz = 1, theta = 0.75, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1.1, g = 1, b = 0.75, a = 0.7, modelfactor = 0.5, specular = 0.2, scattering = 1.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- glow1 = { -- lightType = 'point', @@ -31101,15 +20111,11 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['cormex'] = { + ["cormex"] = { base = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 10, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 60, - r = 1, g = 1, b = 1, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 10, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 60, r = 1, g = 1, b = 1, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- mineglow = { -- lightType = 'point', @@ -31130,261 +20136,148 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, side1 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = 0, posy = 7.5, posz = 20, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = 0, posy = 7.5, posz = 20, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = -16, posy = 7.5, posz = -9, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = -16, posy = 7.5, posz = -9, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = 16, posy = 7.5, posz = -9, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = 16, posy = 7.5, posz = -9, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corexp'] = { + ["corexp"] = { base = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 4, posz = 0, radius = 10, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 60, - r = 1, g = 1, b = 1, a = 2.8, - modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 4, posz = 0, radius = 10, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 60, r = 1, g = 1, b = 1, a = 2.8, modelfactor = 0.4, specular = 0.5, scattering = 1.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lasertoptip1 = { - lightType = 'point', - pieceName = 'barrel1', - lightConfig = { posx = 0.2, posy = 0, posz = 1., radius = 2.0, - color2r = -30, color2g = -30, color2b = -30, colortime = 60, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel1", + lightConfig = { posx = 0.2, posy = 0, posz = 1., radius = 2.0, color2r = -30, color2g = -30, color2b = -30, colortime = 60, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lasertoptip2 = { - lightType = 'point', - pieceName = 'barrel2', - lightConfig = { posx = 0.2, posy = 0, posz = 1., radius = 2.0, - color2r = -30, color2g = -30, color2b = -30, colortime = 60, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel2", + lightConfig = { posx = 0.2, posy = 0, posz = 1., radius = 2.0, color2r = -30, color2g = -30, color2b = -30, colortime = 60, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = 0, posy = 7.5, posz = 20, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = 0, posy = 7.5, posz = 20, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = -16, posy = 7.5, posz = -9, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = -16, posy = 7.5, posz = -9, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'stand', - lightConfig = { posx = 16, posy = 7.5, posz = -9, radius = 13, - color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "stand", + lightConfig = { posx = 16, posy = 7.5, posz = -9, radius = 13, color2r = 1, color2g = 1, color2b = 0.4, colortime = 0, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormoho'] = { + ["cormoho"] = { side1 = { - lightType = 'point', - pieceName = 'column', - lightConfig = { posx = 0, posy = -4, posz = 20, radius = 17, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "column", + lightConfig = { posx = 0, posy = -4, posz = 20, radius = 17, color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'column', - lightConfig = { posx = -16, posy = -4, posz = -9, radius = 17, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "column", + lightConfig = { posx = -16, posy = -4, posz = -9, radius = 17, color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'column', - lightConfig = { posx = 16, posy = -4, posz = -9, radius = 17, - color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, - r = 1, g = 1, b = 1, a = 1, - modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "column", + lightConfig = { posx = 16, posy = -4, posz = -9, radius = 17, color2r = 0.2, color2g = 0.2, color2b = 0.2, colortime = 30, r = 1, g = 1, b = 1, a = 1, modelfactor = 0.3, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coradvsol'] = { + ["coradvsol"] = { glow = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.2, a = 0.9, - modelfactor = 0.2, specular = 0.35, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.2, a = 0.9, modelfactor = 0.2, specular = 0.35, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legadvsol'] = { + ["legadvsol"] = { glow1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 22, posz = 26, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.14, - modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 22, posz = 26, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.14, modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, glow2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -22, posy = 22, posz = -13, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.14, - modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -22, posy = 22, posz = -13, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.14, modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, glow3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 22, posy = 22, posz = -13, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 0.4, a = 0.14, - modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 22, posy = 22, posz = -13, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 0.4, a = 0.14, modelfactor = 0.33, specular = 1.5, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - - ['cormakr'] = { + ["cormakr"] = { side1cone = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, - dirx = -1, diry = -0.8, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, dirx = -1, diry = -0.8, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone2 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, - dirx = 1, diry = -0.8, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, dirx = 1, diry = -0.8, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone3 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, - dirx = 0, diry = -0.8, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, dirx = 0, diry = -0.8, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone4 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, - dirx = 0, diry = -0.8, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 8, posz = 0, radius = 37, dirx = 0, diry = -0.8, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled1 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 15, posz = 0, radius = 18, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.5, - r = 1.2, g = 0.85, b = 0.25, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 15, posz = 0, radius = 18, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.5, r = 1.2, g = 0.85, b = 0.25, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfmkr'] = { + ["corfmkr"] = { enabled1 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 14, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.5, - r = 1.2, g = 0.85, b = 0.25, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 14, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1.5, r = 1.2, g = 0.85, b = 0.25, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, - dirx = -1, diry = -0.8, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, dirx = -1, diry = -0.8, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone2 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, - dirx = 1, diry = -0.8, dirz = 0, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, dirx = 1, diry = -0.8, dirz = 0, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone3 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, - dirx = 0, diry = -0.8, dirz = 1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, dirx = 0, diry = -0.8, dirz = 1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone4 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, - dirx = 0, diry = -0.8, dirz = -1, theta = 0.4, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 6, posz = 0, radius = 45, dirx = 0, diry = -0.8, dirz = -1, theta = 0.4, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- enabled2 = { -- lightType = 'point', @@ -31423,7 +20316,7 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armuwmmm'] = { + ["armuwmmm"] = { -- light1 = { -- lightType = 'point', -- pieceName = 'light1', @@ -31443,44 +20336,24 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, enabled_mainglowbeamtop1 = { - lightType = 'beam', - pieceName = 'light1', - lightConfig = { posx = -13, posy = 0, posz = -22, radius = 9, - pos2x = 13, pos2y = 0, pos2z = -22, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.2, g = 0.85, b = 0.25, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "light1", + lightConfig = { posx = -13, posy = 0, posz = -22, radius = 9, pos2x = 13, pos2y = 0, pos2z = -22, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.2, g = 0.85, b = 0.25, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_mainglowbeamtop2 = { - lightType = 'beam', - pieceName = 'light1', - lightConfig = { posx = -13, posy = 0, posz = 22, radius = 9, - pos2x = 13, pos2y = 0, pos2z = 22, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.2, g = 0.85, b = 0.25, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "light1", + lightConfig = { posx = -13, posy = 0, posz = 22, radius = 9, pos2x = 13, pos2y = 0, pos2z = 22, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.2, g = 0.85, b = 0.25, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_mainglowbeambot1 = { - lightType = 'beam', - pieceName = 'light2', - lightConfig = { posx = -13, posy = 0, posz = -22, radius = 9, - pos2x = 13, pos2y = 0, pos2z = -22, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.2, g = 0.85, b = 0.25, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "light2", + lightConfig = { posx = -13, posy = 0, posz = -22, radius = 9, pos2x = 13, pos2y = 0, pos2z = -22, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.2, g = 0.85, b = 0.25, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_mainglowbeambot2 = { - lightType = 'beam', - pieceName = 'light2', - lightConfig = { posx = -13, posy = 0, posz = 22, radius = 9, - pos2x = 13, pos2y = 0, pos2z = 22, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.2, g = 0.85, b = 0.25, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "light2", + lightConfig = { posx = -13, posy = 0, posz = 22, radius = 9, pos2x = 13, pos2y = 0, pos2z = 22, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.2, g = 0.85, b = 0.25, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- light1_2 = { -- lightType = 'point', @@ -31546,26 +20419,16 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armmakr'] = { + ["armmakr"] = { side1cone = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 39, - dirx = 0, diry = -0.8, dirz = -1, theta = 0.8, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 39, dirx = 0, diry = -0.8, dirz = -1, theta = 0.8, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1cone2 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 39, - dirx = 0, diry = -0.8, dirz = 1, theta = 0.8, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.7, - modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 39, dirx = 0, diry = -0.8, dirz = 1, theta = 0.8, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.7, modelfactor = 0.3, specular = 0.1, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- enabled1 = { -- lightType = 'point', @@ -31595,74 +20458,46 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['armfmkr'] = { + ["armfmkr"] = { enabled1 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 34, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.085, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 34, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.085, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled2 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 3, posz = -18, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 3, posz = -18, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled3 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 3, posz = 18, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0.9, g = 0.7, b = 0.45, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 3, posz = 18, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0.9, g = 0.7, b = 0.45, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.35, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormmkr'] = { + ["cormmkr"] = { enabled_top = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 0, posy = 8.5, posz = 0, radius = 19.5, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.2, g = 0.85, b = 0.25, a = 1.2, - modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 0, posy = 8.5, posz = 0, radius = 19.5, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.2, g = 0.85, b = 0.25, a = 1.2, modelfactor = 0.5, specular = 0.3, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_side1 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = -15, posy = -13, posz = 26, radius = 11, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.4, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = -15, posy = -13, posz = 26, radius = 11, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.4, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_side2 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = -15, posy = -13, posz = -26, radius = 11, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.4, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = -15, posy = -13, posz = -26, radius = 11, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.4, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_side3 = { - lightType = 'point', - pieceName = 'light', - lightConfig = { posx = 30, posy = -13, posz = 0, radius = 11, - color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, - r = 1, g = 1, b = 0.89, a = 0.4, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light", + lightConfig = { posx = 30, posy = -13, posz = 0, radius = 11, color2r = 0, color2g = 0, color2b = 0.0, colortime = -1, r = 1, g = 1, b = 0.89, a = 0.4, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmmkr'] = { + ["armmmkr"] = { -- enabled_cone1x = { -- lightType = 'cone', -- pieceName = 'light', @@ -31691,889 +20526,505 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, enabled_mainglowbeam = { - lightType = 'beam', - pieceName = 'light', - lightConfig = { posx = -15, posy = 9, posz = 0, radius = 9, - pos2x = 15, pos2y = 9, pos2z = 0, - color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, - r = 1.1, g = 0.85, b = 0.25, a = 0.9, - modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "light", + lightConfig = { posx = -15, posy = 9, posz = 0, radius = 9, pos2x = 15, pos2y = 9, pos2z = 0, color2r = 0.0, color2g = 0.0, color2b = 0.0, colortime = -1, r = 1.1, g = 0.85, b = 0.25, a = 0.9, modelfactor = 0.5, specular = 0.3, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_cone1 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 4, posz = 15, radius = 30, - dirx = 0, diry = -0.9, dirz = 0.5, theta = 0.80, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1.0, b = 0.6, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 4, posz = 15, radius = 30, dirx = 0, diry = -0.9, dirz = 0.5, theta = 0.80, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1.0, b = 0.6, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, enabled_cone2 = { - lightType = 'cone', - pieceName = 'light', - lightConfig = { posx = 0, posy = 4, posz = -15, radius = 30, - dirx = 0, diry = -0.9, dirz = -0.5, theta = 0.80, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1.0, b = 0.6, a = 0.6, - modelfactor = 0.3, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "light", + lightConfig = { posx = 0, posy = 4, posz = -15, radius = 30, dirx = 0, diry = -0.9, dirz = -0.5, theta = 0.80, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1.0, b = 0.6, a = 0.6, modelfactor = 0.3, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['lootboxbronze'] = { + ["lootboxbronze"] = { blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blinkc', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkc", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blinkd', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkd", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['lootboxsilver'] = { + ["lootboxsilver"] = { blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blinkc', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkc", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blinkd', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkd", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 75, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 75, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['lootboxgold'] = { + ["lootboxgold"] = { blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blinkc', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkc", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blinkd', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkd", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['lootboxplatinum'] = { + ["lootboxplatinum"] = { blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blinkc', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkc", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blinkd', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkd", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 67.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 125, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 125, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 200, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['lootboxsilver'] = { + ["lootboxsilver"] = { blinka = { - lightType = 'point', - pieceName = 'blinka', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinka", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blinkb', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkb", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blinkc', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkc", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blinkd', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkd", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 37.5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 75, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 75, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['scavbeacon_t1'] = { + ["scavbeacon_t1"] = { blinka = { - lightType = 'point', - pieceName = 'blink1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blink2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkc = { - lightType = 'point', - pieceName = 'blink3', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink3", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkd = { - lightType = 'point', - pieceName = 'blink4', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink4", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 0.3, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkinside = { - lightType = 'point', - pieceName = 'blinkinside', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkinside", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 0.4, specular = 0.2, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['scavbeacon_t2'] = { + ["scavbeacon_t2"] = { blinka = { - lightType = 'point', - pieceName = 'blink1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blink2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blink3', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink3", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blink4', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink4", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkinside = { - lightType = 'point', - pieceName = 'blinkinside', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkinside", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['scavbeacon_t3'] = { + ["scavbeacon_t3"] = { blinka = { - lightType = 'point', - pieceName = 'blink1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blink2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blink3', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink3", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blink4', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink4", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkinside = { - lightType = 'point', - pieceName = 'blinkinside', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkinside", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['scavbeacon_t4'] = { + ["scavbeacon_t4"] = { blinka = { - lightType = 'point', - pieceName = 'blink1', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "blink1", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, blinkb = { - lightType = 'point', - pieceName = 'blink2', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink2", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkc = { - lightType = 'point', - pieceName = 'blink3', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink3", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkd = { - lightType = 'point', - pieceName = 'blink4', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blink4", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 50, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinktop = { - lightType = 'point', - pieceName = 'blinktop', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinktop", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, blinkinside = { - lightType = 'point', - pieceName = 'blinkinside', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.85000002, - modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "blinkinside", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.85000002, modelfactor = 1, specular = 1, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, emit = { - lightType = 'point', - pieceName = 'emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 150, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.1, specular = 1.6, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsilo'] = { + ["armsilo"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23.5, posy = 54, posz = 23.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23.5, posy = 54, posz = 23.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23.5, posy = 54, posz = 23.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23.5, posy = 54, posz = 23.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23.5, posy = 54, posz = -23.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23.5, posy = 54, posz = -23.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23.5, posy = 54, posz = -23.5, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23.5, posy = 54, posz = -23.5, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32, posy = 8, posz = 18, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32, posy = 8, posz = 18, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32, posy = 8, posz = -18, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32, posy = 8, posz = -18, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32, posy = 8, posz = 18, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32, posy = 8, posz = 18, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32, posy = 8, posz = -18, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32, posy = 8, posz = -18, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 8, posz = -32, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 8, posz = -32, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 8, posz = -32, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 8, posz = -32, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 8, posz = 32, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 8, posz = 32, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 8, posz = 32, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.25, - modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 8, posz = 32, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.25, modelfactor = 0.2, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light1 = { - lightType = 'point', - pieceName = 'light1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 3, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "light1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 3, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light2 = { - lightType = 'point', - pieceName = 'light2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 3, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "light2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 3, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light3 = { - lightType = 'point', - pieceName = 'light3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 3, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "light3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 3, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, light4 = { - lightType = 'point', - pieceName = 'light4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 3, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "light4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 3, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, }, - ['corsilo'] = { + ["corsilo"] = { top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28, posz = -25, radius = 12, - color2r = -2, color2g = -2, color2b = -2, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28, posz = -25, radius = 12, color2r = -2, color2g = -2, color2b = -2, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 28, posz = 25, radius = 12, - color2r = -2, color2g = -2, color2b = -2, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 28, posz = 25, radius = 12, color2r = -2, color2g = -2, color2b = -2, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 25, posy = 28, posz = 0, radius = 12, - color2r = -2, color2g = -2, color2b = -2, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 25, posy = 28, posz = 0, radius = 12, color2r = -2, color2g = -2, color2b = -2, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, top4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -25, posy = 28, posz = 0, radius = 12, - color2r = -2, color2g = -2, color2b = -2, colortime = 60, - r = 1.5, g = 1.0, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -25, posy = 28, posz = 0, radius = 12, color2r = -2, color2g = -2, color2b = -2, colortime = 60, r = 1.5, g = 1.0, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, red1 = { - lightType = 'point', - pieceName = 'cagelight1', - lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 0.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "cagelight1", + lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 0.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, red2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 0.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 0.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, red3 = { - lightType = 'point', - pieceName = 'cagelight3', - lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 0.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "cagelight3", + lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 0.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, red4 = { - lightType = 'point', - pieceName = 'cagelight4', - lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.5, g = 0.0, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "point", + pieceName = "cagelight4", + lightConfig = { posx = 0, posy = 2.1, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.5, g = 0.0, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.5, scattering = 0.44, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, launchlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.1, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.1, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, launchlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.1, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.1, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, launchlight3 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.1, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.1, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, launchlight4 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.1, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.1, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legsilo'] = { + ["legsilo"] = { launchlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.0, g = 0.8, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.0, g = 0.8, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, launchlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.0, g = 0.8, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.0, g = 0.8, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, launchlight3 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.0, g = 0.8, b = 0, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.0, g = 0.8, b = 0, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1, lensflare = 2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corint'] = { + ["corint"] = { teamflashr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -31, posy = 46.4, posz = 0, radius = 1.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -31, posy = 46.4, posz = 0, radius = 1.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 31, posy = 46.4, posz = 0, radius = 1.2, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 31, posy = 46.4, posz = 0, radius = 1.2, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mainturret1 = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 0.2, posy = 27, posz = -2, radius = 1.2, - dirx = 0, diry = 0, dirz = 0.5, theta = -1.4, - color2r = -2, color2g = -2, color2b = -2, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 2, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 0.2, posy = 27, posz = -2, radius = 1.2, dirx = 0, diry = 0, dirz = 0.5, theta = -1.4, color2r = -2, color2g = -2, color2b = -2, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 2, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- hotbarrel1 = { -- lightType = 'point', @@ -32594,975 +21045,564 @@ local unitLights = { -- lifetime = 300, sustain = 1, selfshadowing = 0}, -- }, }, - ['corgplat'] = { + ["corgplat"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 12, posz = 11, radius = 14, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.11, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 12, posz = 11, radius = 14, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.11, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corfhlt'] = { + ["corfhlt"] = { eyes = { - lightType = 'point', - pieceName = 'turret1', - lightConfig = { posx = 5, posy = 12, posz = 17.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.81, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret1", + lightConfig = { posx = 5, posy = 12, posz = 17.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.81, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'turret2', - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, - dirx = 0, diry = 0.1, dirz = 1, theta = 0.18, - r = 0.95, g = 0.95, b = 0.88, a = 0.4, - modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "turret2", + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 440, dirx = 0, diry = 0.1, dirz = 1, theta = 0.18, r = 0.95, g = 0.95, b = 0.88, a = 0.4, modelfactor = -0.3, specular = -1.2, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corcv'] = { + ["corcv"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.3, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 3, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 3, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'beam', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "beam", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 19, posz = 26, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 1, - modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 19, posz = 26, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 1, modelfactor = 0.4, specular = 0.3, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, - dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legcv'] = { + ["legcv"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'beam', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, - } + lightType = "point", + pieceName = "beam", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, }, - ['legacv']={ + ["legacv"] = { buildlight1 = { --top spinning light - lightType = 'cone', - pieceName = 'conLightA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLightA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2 = { -- other top spinning light - lightType = 'cone', - pieceName = 'conLightB', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 1, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLightB", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 1, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlareL', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - nanolight2= { - lightType = 'point', - pieceName = 'nanoFlareR', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - }, - ['legavantinuke']={ + lightType = "point", + pieceName = "nanoFlareL", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + nanolight2 = { + lightType = "point", + pieceName = "nanoFlareR", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + }, + ["legavantinuke"] = { cannisterlightambient = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -17.4, posy = -6.5, posz = 0.1, radius = 28, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, - r = 0.2, g = 1, b = 0.4, a = 0.15, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -17.4, posy = -6.5, posz = 0.1, radius = 28, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, r = 0.2, g = 1, b = 0.4, a = 0.15, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, sensorlight1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.7, posy = 1.8, posz = 26.9, radius = 8, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = -1, - r = 0.2, g = 1, b = 0.4, a = 0.12, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.7, posy = 1.8, posz = 26.9, radius = 8, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = -1, r = 0.2, g = 1, b = 0.4, a = 0.12, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, sensorlight2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -4.5, posy = 1.8, posz = 24.7, radius = 8, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = -1, - r = 0.2, g = 1, b = 0.4, a = 0.12, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -4.5, posy = 1.8, posz = 24.7, radius = 8, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = -1, r = 0.2, g = 1, b = 0.4, a = 0.12, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, floodlightambient = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -0.5, posy = 6.1, posz = 26.7, radius = 18, - color2r = 0.4, color2g = 0.5, color2b = 0.4, colortime = 0, - r = 0.4, g = 1, b = 0.8, a = 0.12, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -0.5, posy = 6.1, posz = 26.7, radius = 18, color2r = 0.4, color2g = 0.5, color2b = 0.4, colortime = 0, r = 0.4, g = 1, b = 0.8, a = 0.12, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, floodlightpoint1 = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = -2, posy = 6.1, posz = 25.7, radius = 32, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 0.4, g = 1, b = 0.8, a = 0.75, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = -2, posy = 6.1, posz = 25.7, radius = 32, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 0.4, g = 1, b = 0.8, a = 0.75, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, floodlightpoint2 = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = -0.5, posy = 6.1, posz = 25.7, radius = 32, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 0.4, g = 1, b = 0.8, a = 0.75, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = -0.5, posy = 6.1, posz = 25.7, radius = 32, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 0.4, g = 1, b = 0.8, a = 0.75, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, floodlightpoint3 = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 1, posy = 6.1, posz = 25.7, radius = 32, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 0.4, g = 1, b = 0.8, a = 0.75, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 1, posy = 6.1, posz = 25.7, radius = 32, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 0.4, g = 1, b = 0.8, a = 0.75, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legnavyconship']={ + ["legnavyconship"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, --spin lights buildlight1a = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1a', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1a", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight1b = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1b', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1b", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2a = { --top spinning light - lightType = 'cone', - pieceName = 'conLight2a', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight2a", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2b = { --top spinning light - lightType = 'cone', - pieceName = 'conLight2b', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight2b", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['legnavyrezsub']={ + ["legnavyrezsub"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nanoFlare', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 0.35, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 0.35, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['leganavyengineer']={ + ["leganavyengineer"] = { --spin lights buildlight1a = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1a', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1a", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight1b = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1b', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1b", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.125, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.125, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1b = { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.125, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.125, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2b = { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['leganavyconsub']={ + ["leganavyconsub"] = { --spin lights buildlight1a = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1a', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1a", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight1b = { --top spinning light - lightType = 'cone', - pieceName = 'conLight1b', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "conLight1b", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, dirx = 0, diry = 0, dirz = -1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.125, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.125, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1b = { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.125, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.125, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight2b = { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 1, a = 0.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = -1.5, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 1, a = 0.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, }, - ['legnavyaaship']={ + ["legnavyaaship"] = { greenblobA = { - lightType = 'point', - pieceName = 'dishA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.1, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dishA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.1, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblobB = { - lightType = 'point', - pieceName = 'dishA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.3, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dishA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.3, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaca']={ + ["legaca"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - nanolight2= { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + nanolight2 = { + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, airjet1 = { - lightType = 'cone', - pieceName = 'airjet1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "airjet1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, airjet2 = { - lightType = 'cone', - pieceName = 'airjet2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "airjet2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legwhisper']={ + ["legwhisper"] = { airjet1 = { - lightType = 'cone', - pieceName = 'bigAirJet1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "bigAirJet1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, airjet2 = { - lightType = 'cone', - pieceName = 'bigAirJet2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.1, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "bigAirJet2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.1, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light1 = { - lightType = 'point', - pieceName = 'light1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light2 = { - lightType = 'point', - pieceName = 'smallLight1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "smallLight1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 10, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light3 = { - lightType = 'point', - pieceName = 'light2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light4 = { - lightType = 'point', - pieceName = 'light3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light5 = { - lightType = 'point', - pieceName = 'radarBlink', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "radarBlink", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- --colortime -1 light1ct = { - lightType = 'point', - pieceName = 'light1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - light2ct= { - lightType = 'point', - pieceName = 'smallLight1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, + light2ct = { + lightType = "point", + pieceName = "smallLight1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light3ct = { - lightType = 'point', - pieceName = 'light2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, light4ct = { - lightType = 'point', - pieceName = 'light3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legafigdef']={ + ["legafigdef"] = { airjet1 = { - lightType = 'cone', - pieceName = 'leftAirjet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "leftAirjet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, airjet2 = { - lightType = 'cone', - pieceName = 'rightAirjet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.3, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "rightAirjet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 35, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.3, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, airjet3 = { - lightType = 'cone', - pieceName = 'mainAirjet', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, - dirx = 0, diry = 0, dirz = -1, theta = 0.8, - r = 0.33, g = 1, b = 0.33, a = 0.6, - modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "mainAirjet", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 50, dirx = 0, diry = 0, dirz = -1, theta = 0.8, r = 0.33, g = 1, b = 0.33, a = 0.6, modelfactor = 0, specular = 1, scattering = 0.5, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrezbot']={ + ["legrezbot"] = { buildlight1 = { --top spinning light - lightType = 'cone', - pieceName = 'buildLightFlareLeft', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = 1, diry = -1, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildLightFlareLeft", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = 1, diry = -1, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2 = { -- other top spinning light - lightType = 'cone', - pieceName = 'buildLightFlareRight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = 1, diry = 1, dirz = 1, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildLightFlareRight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = 1, diry = 1, dirz = 1, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.1, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - nanolight2= { - lightType = 'point', - pieceName = 'nanoFlare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.1, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.1, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + nanolight2 = { + lightType = "point", + pieceName = "nanoFlare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.1, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, frontlight1 = { - lightType = 'point', - pieceName = 'frontLight', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frontLight", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --colortime -1 frontlight1colortime = { - lightType = 'point', - pieceName = 'frontLight', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "frontLight", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legamphlab']={ + ["legamphlab"] = { buildlight1 = { --top spinning light - lightType = 'cone', - pieceName = 'buildFlare1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = 1, diry = 0, dirz = 0, theta = 0.999, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildFlare1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = 1, diry = 0, dirz = 0, theta = 0.999, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight2 = { -- other top spinning light - lightType = 'cone', - pieceName = 'buildFlare2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = 1, diry = 0, dirz = 0, theta = 0.999, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildFlare2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = 1, diry = 0, dirz = 0, theta = 0.999, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight3 = { --top spinning light - lightType = 'cone', - pieceName = 'buildFlare3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = -1, diry = 0, dirz = 0, theta = 0.999, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildFlare3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = -1, diry = 0, dirz = 0, theta = 0.999, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, buildlight4 = { -- other top spinning light - lightType = 'cone', - pieceName = 'buildFlare4', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, - dirx = -1, diry = 0, dirz = 0, theta = 0.999, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "cone", + pieceName = "buildFlare4", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10, dirx = -1, diry = 0, dirz = 0, theta = 0.999, r = 1.29999995, g = 0.89999998, b = 0.1, a = 1, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight1 = { - lightType = 'point', - pieceName = 'nanoFlareR1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - nanolight2= { - lightType = 'point', - pieceName = 'nanoFlareR2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlareR1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + nanolight2 = { + lightType = "point", + pieceName = "nanoFlareR2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nanoFlareL1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, - }, - nanolight4= { - lightType = 'point', - pieceName = 'nanoFlareL2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0}, + lightType = "point", + pieceName = "nanoFlareL1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, + }, + nanolight4 = { + lightType = "point", + pieceName = "nanoFlareL2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0 }, }, cannisterlight1 = { - lightType = 'point', - pieceName = 'cannisterLight1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight2 = { - lightType = 'point', - pieceName = 'cannisterLight2', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight2", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight3 = { - lightType = 'point', - pieceName = 'cannisterLight3', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight3", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 28, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --colortime -1 cannisterlight1ct = { - lightType = 'point', - pieceName = 'cannisterLight1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight2ct = { - lightType = 'point', - pieceName = 'cannisterLight2', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight2", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight3ct = { - lightType = 'point', - pieceName = 'cannisterLight3', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.2, g = 1, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cannisterLight3", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 14, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.2, g = 1, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leggant']={ + ["leggant"] = { nanolight1 = { - lightType = 'point', - pieceName = 'nanofr', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, - }, - nanolight2= { - lightType = 'point', - pieceName = 'nanofl', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "nanofr", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, + }, + nanolight2 = { + lightType = "point", + pieceName = "nanofl", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, nanolight3 = { - lightType = 'point', - pieceName = 'nanobr', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, - }, - nanolight4= { - lightType = 'point', - pieceName = 'nanobl', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "nanobr", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, + }, + nanolight4 = { + lightType = "point", + pieceName = "nanobl", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, nanolight5 = { - lightType = 'point', - pieceName = 'nanotop', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, - }, - nanolight6= { - lightType = 'point', - pieceName = 'nanobot', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "nanotop", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, + }, + nanolight6 = { + lightType = "point", + pieceName = "nanobot", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 30, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, animtype = 0, selfshadowing = 1 }, }, cannisterlight1 = { - lightType = 'point', - pieceName = 'cell1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, - color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, - r = 1, g = 0.5, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, r = 1, g = 0.5, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight2 = { - lightType = 'point', - pieceName = 'cell2', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, - color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, - r = 1, g = 0.5, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell2", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, r = 1, g = 0.5, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight3 = { - lightType = 'point', - pieceName = 'cell3', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, - color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, - r = 1, g = 0.5, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell3", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, r = 1, g = 0.5, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight4 = { - lightType = 'point', - pieceName = 'cell4', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, - color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, - r = 1, g = 0.5, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell4", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 40, color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 0, r = 1, g = 0.5, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, --colortime -1 cannisterlight1ct = { - lightType = 'point', - pieceName = 'cell1', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.5, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell1", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.5, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight2ct = { - lightType = 'point', - pieceName = 'cell2', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.5, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell2", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.5, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight3ct = { - lightType = 'point', - pieceName = 'cell3', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.5, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell3", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.5, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cannisterlight4ct = { - lightType = 'point', - pieceName = 'cell4', - lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.5, b = 0.2, a = 0.3, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cell4", + lightConfig = { posx = 0, posy = -2, posz = 1, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.5, b = 0.2, a = 0.3, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legch'] = { + ["legch"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, - } + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, }, - ['armraz'] = { + ["armraz"] = { searchlightl = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 7, posy = 9, posz = 3, radius = 100, - dirx = 0.2, diry = -0.4, dirz = 1, theta = 0.27, - r = 1, g = 1, b = 0.89, a = 0.4, - modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 7, posy = 9, posz = 3, radius = 100, dirx = 0.2, diry = -0.4, dirz = 1, theta = 0.27, r = 1, g = 1, b = 0.89, a = 0.4, modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightr = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = -7, posy = 9, posz = 3, radius = 100, - dirx = -0.2, diry = -0.4, dirz = 1, theta = 0.27, - r = 1, g = 1, b = 0.89, a = 0.4, - modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = -7, posy = 9, posz = 3, radius = 100, dirx = -0.2, diry = -0.4, dirz = 1, theta = 0.27, r = 1, g = 1, b = 0.89, a = 0.4, modelfactor = -0.5, specular = -0.3, scattering = 2.5, lensflare = 1.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 2, posy = 12.0, posz = 22.5, radius = 3.8, - pos2x = -2, pos2y = 12.0, pos2z = 22.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 2, posy = 12.0, posz = 22.5, radius = 3.8, pos2x = -2, pos2y = 12.0, pos2z = 22.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = -3.7, posy = 12.0, posz = 22.5, radius = 3.8, - pos2x = -5, pos2y = 11.0, pos2z = 18.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = -3.7, posy = 12.0, posz = 22.5, radius = 3.8, pos2x = -5, pos2y = 11.0, pos2z = 18.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 3.7, posy = 12.0, posz = 22.5, radius = 3.8, - pos2x = 5, pos2y = 11.0, pos2z = 18.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 3.7, posy = 12.0, posz = 22.5, radius = 3.8, pos2x = 5, pos2y = 11.0, pos2z = 18.5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes = { -- lightType = 'point', @@ -33601,58 +21641,34 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0 }, -- }, shoulderfront1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8, posy = 10, posz = 7, radius = 7, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.2, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8, posy = 10, posz = 7, radius = 7, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.2, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderfront2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -8, posy = 10, posz = 7, radius = 7, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.4, - modelfactor = 0.2, specular = 0.4, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -8, posy = 10, posz = 7, radius = 7, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.2, specular = 0.4, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderback1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -6.8, posy = 11, posz = -12.1, radius = 3, - color2r = -13, color2g = -13, color2b = -13, colortime = 50, - r = 1, g = 0.1, b = 0.1, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -6.8, posy = 11, posz = -12.1, radius = 3, color2r = -13, color2g = -13, color2b = -13, colortime = 50, r = 1, g = 0.1, b = 0.1, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderback2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 6.8, posy = 11, posz = -12.1, radius = 3, - color2r = -13, color2g = -13, color2b = -13, colortime = 50, - r = 1, g = 0.1, b = 0.1, a = 0.8, - modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 6.8, posy = 11, posz = -12.1, radius = 3, color2r = -13, color2g = -13, color2b = -13, colortime = 50, r = 1, g = 0.1, b = 0.1, a = 0.8, modelfactor = 0.3, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot1 = { - lightType = 'point', - pieceName = 'rfoot', - lightConfig = { posx = 0, posy = 4.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "rfoot", + lightConfig = { posx = 0, posy = 4.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot2 = { - lightType = 'point', - pieceName = 'lfoot', - lightConfig = { posx = 0, posy = 4.5, posz = 0, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "lfoot", + lightConfig = { posx = 0, posy = 4.5, posz = 0, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- gun1 = { -- lightType = 'point', @@ -33691,13 +21707,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, gun5 = { - lightType = 'point', - pieceName = 'rcannon', - lightConfig = { posx = -0.3, posy = 6, posz = 8.6, radius = 2.5, - color2r = -5, color2g = -5, color2b = -5, colortime = 50, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rcannon", + lightConfig = { posx = -0.3, posy = 6, posz = 8.6, radius = 2.5, color2r = -5, color2g = -5, color2b = -5, colortime = 50, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- gun6 = { -- lightType = 'point', @@ -33745,13 +21757,9 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, gun11 = { - lightType = 'point', - pieceName = 'lcannon', - lightConfig = { posx = 0.3, posy = 6, posz = 8.6, radius = 2.5, - color2r = -5, color2g = -5, color2b = -5, colortime = 50, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lcannon", + lightConfig = { posx = 0.3, posy = 6, posz = 8.6, radius = 2.5, color2r = -5, color2g = -5, color2b = -5, colortime = 50, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- gun12 = { -- lightType = 'point', @@ -33772,69 +21780,41 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0 }, -- }, }, - ['armmar'] = { + ["armmar"] = { foot1 = { - lightType = 'point', - pieceName = 'rfoot', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfoot", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, foot2 = { - lightType = 'point', - pieceName = 'lfoot', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfoot", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, leg1A = { - lightType = 'point', - pieceName = 'rleg', - lightConfig = { posx = -3.5, posy = 5, posz = -5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 3.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rleg", + lightConfig = { posx = -3.5, posy = 5, posz = -5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 3.8, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, leg2A = { - lightType = 'point', - pieceName = 'lleg', - lightConfig = { posx = 3.5, posy = 5, posz = -5, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 3.8, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lleg", + lightConfig = { posx = 3.5, posy = 5, posz = -5, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 3.8, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0, posy = 0.5, posz = 12, radius = 13, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0, posy = 0.5, posz = 12, radius = 13, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turbine1 = { - lightType = 'point', - pieceName = 'rturbine', - lightConfig = { posx = 0, posy = 0, posz = -0.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rturbine", + lightConfig = { posx = 0, posy = 0, posz = -0.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turbine2 = { - lightType = 'point', - pieceName = 'lturbine', - lightConfig = { posx = 0, posy = 0, posz = -0.5, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturbine", + lightConfig = { posx = 0, posy = 0, posz = -0.5, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 45, r = 1.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -33864,152 +21844,87 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0 }, -- }, frontlighttop = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 13, posz = -6, radius = 7.4, - pos2x = 0, pos2y = 5, pos2z = 9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.3, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 0, posy = 13, posz = -6, radius = 7.4, pos2x = 0, pos2y = 5, pos2z = 9, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.3, g = 1, b = 0.2, a = 0.5, modelfactor = 0.3, specular = 0.4, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightleft = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 8.4, posy = 5, posz = 2.5, radius = 3, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 8.4, posy = 5, posz = 2.5, radius = 3, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlightright = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -8.4, posy = 5, posz = 2.5, radius = 3, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -8.4, posy = 5, posz = 2.5, radius = 3, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.25, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightleft = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 8, posy = 6, posz = -2, radius = 120, - dirx = 0.07, diry = -0.08, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 8, posy = 6, posz = -2, radius = 120, dirx = 0.07, diry = -0.08, dirz = 1, theta = 0.12, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightright = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = -8, posy = 6, posz = -2, radius = 120, - dirx = -0.07, diry = -0.08, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = -8, posy = 6, posz = -2, radius = 120, dirx = -0.07, diry = -0.08, dirz = 1, theta = 0.12, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1mid = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 9, posz = -16, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 9, posz = -16, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -5, posy = 0, posz = -8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -5, posy = 0, posz = -8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 5, posy = 0, posz = -8, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 5, posy = 0, posz = -8, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'ruparm', - lightConfig = { posx = -5, posy = 0, posz = 9, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ruparm", + lightConfig = { posx = -5, posy = 0, posz = 9, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'luparm', - lightConfig = { posx = 5, posy = 0, posz = 9, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.2, g = 1, b = 0.2, a = 0.3, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "luparm", + lightConfig = { posx = 5, posy = 0, posz = 9, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.2, g = 1, b = 0.2, a = 0.3, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thigh1 = { - lightType = 'point', - pieceName = 'rthigh', - lightConfig = { posx = -7, posy = 0.7, posz = 1, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rthigh", + lightConfig = { posx = -7, posy = 0.7, posz = 1, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thigh2 = { - lightType = 'point', - pieceName = 'lthigh', - lightConfig = { posx = 7, posy = 0.7, posz = 1, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lthigh", + lightConfig = { posx = 7, posy = 0.7, posz = 1, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, knee1 = { - lightType = 'point', - pieceName = 'rleg', - lightConfig = { posx = -5, posy = 0.5, posz = 0, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rleg", + lightConfig = { posx = -5, posy = 0.5, posz = 0, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, knee2 = { - lightType = 'point', - pieceName = 'lleg', - lightConfig = { posx = 5, posy = 0.5, posz = 0, radius = 1.4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lleg", + lightConfig = { posx = 5, posy = 0.5, posz = 0, radius = 1.4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, leg1 = { - lightType = 'point', - pieceName = 'rleg', - lightConfig = { posx = -2, posy = -9, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rleg", + lightConfig = { posx = -2, posy = -9, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, leg2 = { - lightType = 'point', - pieceName = 'lleg', - lightConfig = { posx = 2, posy = -9, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.44, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lleg", + lightConfig = { posx = 2, posy = -9, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.44, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armamb'] = { + ["armamb"] = { -- sleeve1beam = { --needs BOS update to show/hide part - light shines through closed version -- lightType = 'beam', -- pieceName = 'turret', @@ -34022,100 +21937,104 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, teamflashl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 12.5, posy = 0, posz = 0, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 12.5, posy = 0, posz = 0, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -12.5, posy = 0, posz = 0, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -12.5, posy = 0, posz = 0, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armguard'] = { + ["armguard"] = { base1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 21, posz = 19, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 21, posz = 19, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 21, posz = -19, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 21, posz = -19, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -16, posy = 21, posz = 9, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -16, posy = 21, posz = 9, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 16, posy = 21, posz = 9, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 16, posy = 21, posz = 9, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 16, posy = 21, posz = -9, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 16, posy = 21, posz = -9, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -16, posy = 21, posz = -9, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -16, posy = 21, posz = -9, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sleeve1beam = { - lightType = 'beam', - pieceName = 'sleeves', - lightConfig = { posx = 3.5, posy = 2, posz = 14.3, radius = 5, - pos2x = 3.5, pos2y = 2, pos2z = 9, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 2.0, color2g = 1.8, color2b = 0.5, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 1.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves", + lightConfig = { + posx = 3.5, + posy = 2, + posz = 14.3, + radius = 5, + pos2x = 3.5, + pos2y = 2, + pos2z = 9, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 2.0, + color2g = 1.8, + color2b = 0.5, + colortime = 45, + r = 1.2, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 1.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, sleeve2beam = { - lightType = 'beam', - pieceName = 'sleeves', - lightConfig = { posx = -3.5, posy = 2, posz = 14.3, radius = 5, - pos2x = -3.5, pos2y = 2, pos2z = 9, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 2.0, color2g = 1.8, color2b = 0.5, colortime = 45, - r = 1.2, g = 1, b = 0.2, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 1.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves", + lightConfig = { + posx = -3.5, + posy = 2, + posz = 14.3, + radius = 5, + pos2x = -3.5, + pos2y = 2, + pos2z = 9, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 2.0, + color2g = 1.8, + color2b = 0.5, + colortime = 45, + r = 1.2, + g = 1, + b = 0.2, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 1.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, -- sleeves1 = { -- lightType = 'point', @@ -34136,25 +22055,17 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0 }, -- }, teamflashl = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = 15, posy = 0, posz = 0, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = 15, posy = 0, posz = 0, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = -15, posy = 0, posz = 0, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = -15, posy = 0, posz = 0, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corpun'] = { + ["corpun"] = { -- base1 = { -- lightType = 'point', -- pieceName = 'head', @@ -34192,26 +22103,62 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0 }, -- }, sleeve1beam = { - lightType = 'beam', - pieceName = 'sleeves', - lightConfig = { posx = -4.2, posy = 6, posz = 18.3, radius = 1, - pos2x = -4.2, pos2y = 6, pos2z = 8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 45, - r = 0.6, g = 0.5, b = 0.1, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 3.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves", + lightConfig = { + posx = -4.2, + posy = 6, + posz = 18.3, + radius = 1, + pos2x = -4.2, + pos2y = 6, + pos2z = 8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 1.2, + color2g = 1, + color2b = 0.2, + colortime = 45, + r = 0.6, + g = 0.5, + b = 0.1, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 3.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, sleeve2beam = { - lightType = 'beam', - pieceName = 'sleeves', - lightConfig = { posx = 4.2, posy = 6, posz = 18.3, radius = 1, - pos2x = 4.2, pos2y = 6, pos2z = 8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 1.2, color2g = 1, color2b = 0.2, colortime = 45, - r = 0.6, g = 0.5, b = 0.1, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 3.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "sleeves", + lightConfig = { + posx = 4.2, + posy = 6, + posz = 18.3, + radius = 1, + pos2x = 4.2, + pos2y = 6, + pos2z = 8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 1.2, + color2g = 1, + color2b = 0.2, + colortime = 45, + r = 0.6, + g = 0.5, + b = 0.1, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 3.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, -- sleeve2beam = { -- lightType = 'beam', @@ -34225,154 +22172,86 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, teamflashl = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = 12, posy = 0, posz = -4, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = 12, posy = 0, posz = -4, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamflashr = { - lightType = 'point', - pieceName = 'sleeves', - lightConfig = { posx = -12, posy = 0, posz = -4, radius = 2.4, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeves", + lightConfig = { posx = -12, posy = 0, posz = -4, radius = 2.4, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corbuzz'] = { + ["corbuzz"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20, posz = 46, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 20, posz = 46, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 20, posz = -46, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 20, posz = -46, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base3 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -46, posy = 20, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -46, posy = 20, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base4 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 46, posy = 20, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 46, posy = 20, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base5 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32.5, posy = 20, posz = 32.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32.5, posy = 20, posz = 32.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base6 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32.5, posy = 20, posz = 32.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32.5, posy = 20, posz = 32.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base7 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 32.5, posy = 20, posz = -32.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 32.5, posy = 20, posz = -32.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base8 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -32.5, posy = 20, posz = -32.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -32.5, posy = 20, posz = -32.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = -1, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamartyflashl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 34, posy = 118.2, posz = 0, radius = 2.0, - color2r = -3, color2g = -3, color2b = -3, colortime = 60, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 34, posy = 118.2, posz = 0, radius = 2.0, color2r = -3, color2g = -3, color2b = -3, colortime = 60, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamartyflashr = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -34, posy = 118.2, posz = 0, radius = 2.0, - color2r = -3, color2g = -3, color2b = -3, colortime = 60, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -34, posy = 118.2, posz = 0, radius = 2.0, color2r = -3, color2g = -3, color2b = -3, colortime = 60, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chargeflashl1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 29, posy = 80, posz = -9, radius = 4.3, - dirx = 0, diry = 0.5, dirz = 0, theta = -40, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 29, posy = 80, posz = -9, radius = 4.3, dirx = 0, diry = 0.5, dirz = 0, theta = -40, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, chargeflashl2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 29, posy = 80, posz = 9, radius = 4.3, - dirx = 0, diry = 0.5, dirz = 0, theta = -40, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 29, posy = 80, posz = 9, radius = 4.3, dirx = 0, diry = 0.5, dirz = 0, theta = -40, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, chargeflashr1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -29, posy = 80, posz = -9, radius = 6.3, - dirx = 0, diry = 0.5, dirz = 0, theta = -40, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -29, posy = 80, posz = -9, radius = 6.3, dirx = 0, diry = 0.5, dirz = 0, theta = -40, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, chargeflashr2 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -29, posy = 80, posz = 9, radius = 6.3, - dirx = 0, diry = 0.5, dirz = 0, theta = -40, - color2r = -1, color2g = -1, color2b = -1, colortime = 60, - r = -1, g = 0.1, b = 0.1, a = 2.0, - modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -29, posy = 80, posz = 9, radius = 6.3, dirx = 0, diry = 0.5, dirz = 0, theta = -40, color2r = -1, color2g = -1, color2b = -1, colortime = 60, r = -1, g = 0.1, b = 0.1, a = 2.0, modelfactor = 0.8, specular = 0.2, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, -- sleeve1beam = { -- lightType = 'beam', @@ -34396,150 +22275,85 @@ local unitLights = { -- modelfactor = 0.5, specular = 0.2, scattering = 3.4, lensflare = 0, -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, - }, - ['corcat'] = { + ["corcat"] = { eyes = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = -0.5, posz = 21.5, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = -0.5, posz = 21.5, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = -8.3, posy = -6.5, posz = 25, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = -8.3, posy = -6.5, posz = 25, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 8.3, posy = -6.5, posz = 25, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 1, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 8.3, posy = -6.5, posz = 25, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 1, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'head', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -8.3, posy = -6.5, posz = 20, radius = 110, colortime = -2, - dirx = 0, diry = -0.02, dirz = 1, theta = 0.20, - r = 1, g = 1, b = 0.89, a = 0.34, - color2r = 0, color2g = 0, color2b = 0, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "head", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -8.3, posy = -6.5, posz = 20, radius = 110, colortime = -2, dirx = 0, diry = -0.02, dirz = 1, theta = 0.20, r = 1, g = 1, b = 0.89, a = 0.34, color2r = 0, color2g = 0, color2b = 0, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'head', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 8.3, posy = -6.5, posz = 20, radius = 110, colortime = -2, - dirx = 0, diry = -0.02, dirz = 1, theta = 0.20, - r = 1, g = 1, b = 0.89, a = 0.34, - color2r = 0, color2g = 0, color2b = 0, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "head", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 8.3, posy = -6.5, posz = 20, radius = 110, colortime = -2, dirx = 0, diry = -0.02, dirz = 1, theta = 0.20, r = 1, g = 1, b = 0.89, a = 0.34, color2r = 0, color2g = 0, color2b = 0, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret1 = { - lightType = 'point', - pieceName = 'rturret', - lightConfig = { posx = -23.6, posy = 13.3, posz = 8.3, radius = 4, - color2r = -7, color2g = -7, color2b = -7, colortime = 45, - r = 1, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rturret", + lightConfig = { posx = -23.6, posy = 13.3, posz = 8.3, radius = 4, color2r = -7, color2g = -7, color2b = -7, colortime = 45, r = 1, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret2 = { - lightType = 'point', - pieceName = 'lturret', - lightConfig = { posx = 23.6, posy = 13.3, posz = 8.3, radius = 4, - color2r = -7, color2g = -7, color2b = -7, colortime = 45, - r = 1, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lturret", + lightConfig = { posx = 23.6, posy = 13.3, posz = 8.3, radius = 4, color2r = -7, color2g = -7, color2b = -7, colortime = 45, r = 1, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = -13, posy = 4.5, posz = 3, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = -13, posy = 4.5, posz = 3, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = 13, posy = 4.5, posz = 3, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = 13, posy = 4.5, posz = 3, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back3 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = -13, posy = -4.7, posz = 2.7, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = -13, posy = -4.7, posz = 2.7, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back4 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = 13, posy = -0.5, posz = 5.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = 13, posy = -0.5, posz = 5.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back5 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = -13, posy = 0.5, posz = -5.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = -13, posy = 0.5, posz = -5.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back6 = { - lightType = 'point', - pieceName = 'thing', - lightConfig = { posx = 13, posy = 0.5, posz = -5.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.75, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "thing", + lightConfig = { posx = 13, posy = 0.5, posz = -5.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.75, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corshiva'] = { + ["corshiva"] = { eyes = { - lightType = 'beam', - pieceName = 'torso', - lightConfig = { posx = 3.20, posy = 11.0, posz = 28.8, radius = 1.5, - pos2x = -3.2, pos2y = 11.0, pos2z = 28.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "torso", + lightConfig = { posx = 3.20, posy = 11.0, posz = 28.8, radius = 1.5, pos2x = -3.2, pos2y = 11.0, pos2z = 28.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redlauncherbeam = { - lightType = 'beam', - pieceName = 'rocketpod', - lightConfig = { posx = -1.0, posy = 6.7, posz = -9.2, radius = 1.2, - pos2x = 1.0, pos2y = 6.7, pos2z = -9.2, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "rocketpod", + lightConfig = { posx = -1.0, posy = 6.7, posz = -9.2, radius = 1.2, pos2x = 1.0, pos2y = 6.7, pos2z = -9.2, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- redlauncherl = { -- lightType = 'point', @@ -34551,62 +22365,38 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, eyesglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 11.5, posz = 30, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 11.5, posz = 30, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'torso', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 5, posy = 1, posz = 3, radius = 125, colortime = -2.5, - dirx = 0.1, diry = -0.1, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 5, posy = 1, posz = 3, radius = 125, colortime = -2.5, dirx = 0.1, diry = -0.1, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'torso', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -5, posy = 1, posz = 3, radius = 125, colortime = -2, - dirx = -0.1, diry = -0.1, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -5, posy = 1, posz = 3, radius = 125, colortime = -2, dirx = -0.1, diry = -0.1, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderlightleft = { - lightType = 'point', - pieceName = 'lgun', - lightConfig = { posx = 10, posy = 8.2, posz = 2, radius = 3.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lgun", + lightConfig = { posx = 10, posy = 8.2, posz = 2, radius = 3.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, shoulderlightright = { - lightType = 'point', - pieceName = 'rgun', - lightConfig = { posx = -10, posy = 8.2, posz = 2, radius = 3.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 1.0, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rgun", + lightConfig = { posx = -10, posy = 8.2, posz = 2, radius = 3.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 1.0, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, topgunplasma = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0.0, posy = 20.4, posz = 13.6, radius = 0.8, - color2r = -3, color2g = -3, color2b = -3, colortime = 45, - r = -1, g = 0.8, b = 0.2, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0.0, posy = 20.4, posz = 13.6, radius = 0.8, color2r = -3, color2g = -3, color2b = -3, colortime = 45, r = -1, g = 0.8, b = 0.2, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cordoom'] = { + ["cordoom"] = { -- searchlightmaintop = { -- lightType = 'cone', -- pieceName = 'mainbarrel', @@ -34626,33 +22416,19 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, searchlightbluelaser = { - lightType = 'cone', - pieceName = 'barrelb', - lightConfig = { posx = 0, posy = -1, posz = -1, radius = 350, colortime = 60, - dirx = 0, diry = 0, dirz = 1, theta = 0.09, - r = 0.5, g = 0.5, b = 1, a = 0.55, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "barrelb", + lightConfig = { posx = 0, posy = -1, posz = -1, radius = 350, colortime = 60, dirx = 0, diry = 0, dirz = 1, theta = 0.09, r = 0.5, g = 0.5, b = 1, a = 0.55, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, bluelightzoomlight = { - lightType = 'point', - pieceName = 'barrelb', - lightConfig = { posx = 0, posy = -1, posz = 18, radius = 20, - dirx = 0, diry = 0, dirz = 0.5, theta = -4, - color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, - r = 0.1, g = 0.3, b = 1.2, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 13, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "barrelb", + lightConfig = { posx = 0, posy = -1, posz = 18, radius = 20, dirx = 0, diry = 0, dirz = 0.5, theta = -4, color2r = -1.0, color2g = -1.0, color2b = -1.0, colortime = 60, r = 0.1, g = 0.3, b = 1.2, a = 2.5, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 13, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, searchlightgreenlaser = { - lightType = 'cone', - pieceName = 'barrelg', - lightConfig = { posx = 0, posy = 0, posz = -15, radius = 50, - dirx = 0, diry = 0, dirz = 1, theta = 0.11, - color2r = -5, color2g = -5, color2b = -5, colortime = 60, - r = 0.5, g = 1, b = 0.5, a = 0.55, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "barrelg", + lightConfig = { posx = 0, posy = 0, posz = -15, radius = 50, dirx = 0, diry = 0, dirz = 1, theta = 0.11, color2r = -5, color2g = -5, color2b = -5, colortime = 60, r = 0.5, g = 1, b = 0.5, a = 0.55, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, -- headlightsourcemainside = { -- lightType = 'beam', @@ -34714,311 +22490,172 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, lasergreentip = { - lightType = 'point', - pieceName = 'barrelg', - lightConfig = { posx = 0.2, posy = 0.1, posz = 5.1, radius = 2.5, - color2r = -20, color2g = -20, color2b = -20, colortime = 60, - r = 0, g = 2, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelg", + lightConfig = { posx = 0.2, posy = 0.1, posz = 5.1, radius = 2.5, color2r = -20, color2g = -20, color2b = -20, colortime = 60, r = 0, g = 2, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserredtipl = { - lightType = 'point', - pieceName = 'barrelr', - lightConfig = { posx = 12, posy = 0.2, posz = 31.5, radius = 2.3, - color2r = -30, color2g = -30, color2b = -30, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelr", + lightConfig = { posx = 12, posy = 0.2, posz = 31.5, radius = 2.3, color2r = -30, color2g = -30, color2b = -30, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserredtipr = { - lightType = 'point', - pieceName = 'barrelr', - lightConfig = { posx = -11.9, posy = 0.2, posz = 31.5, radius = 2.3, - color2r = -30, color2g = -30, color2b = -30, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelr", + lightConfig = { posx = -11.9, posy = 0.2, posz = 31.5, radius = 2.3, color2r = -30, color2g = -30, color2b = -30, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['corfdoom'] = { + ["corfdoom"] = { searchlightyellow = { - lightType = 'cone', - pieceName = 'barrelb', - lightConfig = { posx = 0, posy = -1, posz = -1, radius = 350, colortime = 60, - dirx = 0, diry = 0, dirz = 1, theta = 0.09, - r = 1, g = 1, b = 0.5, a = 0.55, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "barrelb", + lightConfig = { posx = 0, posy = -1, posz = -1, radius = 350, colortime = 60, dirx = 0, diry = 0, dirz = 1, theta = 0.09, r = 1, g = 1, b = 0.5, a = 0.55, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, bluelightzoomlight = { - lightType = 'point', - pieceName = 'barrelb', - lightConfig = { posx = 0, posy = 0, posz = 18.7, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = 1.1, g = 0.85, b = 0.3, a = 2.5, - modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelb", + lightConfig = { posx = 0, posy = 0, posz = 18.7, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = 1.1, g = 0.85, b = 0.3, a = 2.5, modelfactor = 1.7, specular = 0.8, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlightgreenlaser = { - lightType = 'cone', - pieceName = 'barrelg', - lightConfig = { posx = 0, posy = 0, posz = -15, radius = 50, - dirx = 0, diry = 0, dirz = 1, theta = 0.11, - color2r = -5, color2g = -5, color2b = -5, colortime = 60, - r = 0.5, g = 1, b = 0.5, a = 0.55, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightType = "cone", + pieceName = "barrelg", + lightConfig = { posx = 0, posy = 0, posz = -15, radius = 50, dirx = 0, diry = 0, dirz = 1, theta = 0.11, color2r = -5, color2g = -5, color2b = -5, colortime = 60, r = 0.5, g = 1, b = 0.5, a = 0.55, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, lasergreentip = { - lightType = 'point', - pieceName = 'barrelg', - lightConfig = { posx = 0.2, posy = 0.1, posz = 5.1, radius = 2.5, - color2r = -20, color2g = -20, color2b = -20, colortime = 60, - r = 0, g = 2, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelg", + lightConfig = { posx = 0.2, posy = 0.1, posz = 5.1, radius = 2.5, color2r = -20, color2g = -20, color2b = -20, colortime = 60, r = 0, g = 2, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserredtipl = { - lightType = 'point', - pieceName = 'barrelr', - lightConfig = { posx = 9, posy = 0.2, posz = 24.5, radius = 2.3, - color2r = -30, color2g = -30, color2b = -30, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelr", + lightConfig = { posx = 9, posy = 0.2, posz = 24.5, radius = 2.3, color2r = -30, color2g = -30, color2b = -30, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, laserredtipr = { - lightType = 'point', - pieceName = 'barrelr', - lightConfig = { posx = -9, posy = 0.2, posz = 24.5, radius = 2.3, - color2r = -30, color2g = -30, color2b = -30, colortime = 45, - r = 1, g = 0, b = 0, a = 1.5, - modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrelr", + lightConfig = { posx = -9, posy = 0.2, posz = 24.5, radius = 2.3, color2r = -30, color2g = -30, color2b = -30, colortime = 45, r = 1, g = 0, b = 0, a = 1.5, modelfactor = 0.6, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - }, - ['cordemon'] = { + ["cordemon"] = { eyes = { - lightType = 'beam', - pieceName = 'head', - lightConfig = { posx = 2.2, posy = 7.5, posz = 8.5, radius = 2.8, - pos2x = -2.2, pos2y = 7.5, pos2z = 8.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 1.9, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "head", + lightConfig = { posx = 2.2, posy = 7.5, posz = 8.5, radius = 2.8, pos2x = -2.2, pos2y = 7.5, pos2z = 8.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 1.9, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightlbig = { - lightType = 'point', - pieceName = 'lfbarrel1', - lightConfig = { posx = 0, posy = 1.6, posz = 2, radius = 14, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfbarrel1", + lightConfig = { posx = 0, posy = 1.6, posz = 2, radius = 14, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightrbig = { - lightType = 'point', - pieceName = 'rfbarrel1', - lightConfig = { posx = 0, posy = 1.6, posz = 2, radius = 14, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfbarrel1", + lightConfig = { posx = 0, posy = 1.6, posz = 2, radius = 14, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.4, specular = 0.9, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightl1 = { - lightType = 'point', - pieceName = 'lfbarrel1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfbarrel1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightl2 = { - lightType = 'point', - pieceName = 'lfbarrel2', - lightConfig = { posx = 0, posy = 0, posz = 2.2, radius = 5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lfbarrel2", + lightConfig = { posx = 0, posy = 0, posz = 2.2, radius = 5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 5, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightr1 = { - lightType = 'point', - pieceName = 'rfbarrel1', - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfbarrel1", + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flamelightr2 = { - lightType = 'point', - pieceName = 'rfbarrel2', - lightConfig = { posx = 0, posy = 0, posz = 2.3, radius = 5, - color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, - r = 0.95, g = 0.66, b = 0.07, a = 0.7, - modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rfbarrel2", + lightConfig = { posx = 0, posy = 0, posz = 2.3, radius = 5, color2r = 0.9, color2g = 0.5, color2b = 0.05, colortime = 6, r = 0.95, g = 0.66, b = 0.07, a = 0.7, modelfactor = 0.5, specular = 0.1, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightl = { -- this is the lightname - lightType = 'cone', - pieceName = 'boxl', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 95, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "boxl", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 95, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightr = { -- this is the lightname - lightType = 'cone', - pieceName = 'boxr', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 95, colortime = -2, - dirx = 0, diry = 0, dirz = 1, theta = 0.25, - r = 1, g = 1, b = 0.89, a = 0.34, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "boxr", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 0, posz = 2, radius = 95, colortime = -2, dirx = 0, diry = 0, dirz = 1, theta = 0.25, r = 1, g = 1, b = 0.89, a = 0.34, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights1 = { - lightType = 'beam', - pieceName = 'boxl', - lightConfig = { posx = 0, posy = 3.3, posz = -2.3, radius = 2.6, - pos2x = 0, pos2y = 3.4, pos2z = -0.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxl", + lightConfig = { posx = 0, posy = 3.3, posz = -2.3, radius = 2.6, pos2x = 0, pos2y = 3.4, pos2z = -0.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights1red = { - lightType = 'beam', - pieceName = 'boxl', - lightConfig = { posx = -0.5, posy = 3.2, posz = 0.6, radius = 1.3, - pos2x = 0.5, pos2y = 3.2, pos2z = 0.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = -1, - r = 1, g = 0.1, b = 0.1, a = 0.5, - modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxl", + lightConfig = { posx = -0.5, posy = 3.2, posz = 0.6, radius = 1.3, pos2x = 0.5, pos2y = 3.2, pos2z = 0.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = -1, r = 1, g = 0.1, b = 0.1, a = 0.5, modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights2 = { - lightType = 'beam', - pieceName = 'boxr', - lightConfig = { posx = 0, posy = 3.3, posz = -2.3, radius = 2.6, - pos2x = 0, pos2y = 3.4, pos2z = -0.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxr", + lightConfig = { posx = 0, posy = 3.3, posz = -2.3, radius = 2.6, pos2x = 0, pos2y = 3.4, pos2z = -0.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aalights2red = { - lightType = 'beam', - pieceName = 'boxr', - lightConfig = { posx = -0.5, posy = 3.2, posz = 0.6, radius = 1.3, - pos2x = 0.5, pos2y = 3.2, pos2z = 0.6, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = -1, - r = 1, g = 0.1, b = 0.1, a = 0.5, - modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "boxr", + lightConfig = { posx = -0.5, posy = 3.2, posz = 0.6, radius = 1.3, pos2x = 0.5, pos2y = 3.2, pos2z = 0.6, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = -1, r = 1, g = 0.1, b = 0.1, a = 0.5, modelfactor = 0.4, specular = 0.1, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['coracv'] = { + ["coracv"] = { buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2.5, - modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2.5, modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2.5, - modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 22, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2.5, modelfactor = 0.1, specular = 0.2, scattering = 1.8, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash1 = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = -2.1, posy = 2.1, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = -2.1, posy = 2.1, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'cagelight2', - lightConfig = { posx = 2.1, posy = 2.1, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight2", + lightConfig = { posx = 2.1, posy = 2.1, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 4.4, posy = 18.6, posz = 23.3, radius = 2, - pos2x = 4.4, pos2y = 18.6, pos2z = 11.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 4.4, posy = 18.6, posz = 23.3, radius = 2, pos2x = 4.4, pos2y = 18.6, pos2z = 11.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.4, posy = 18.6, posz = 23.3, radius = 2, - pos2x = -4.4, pos2y = 18.6, pos2z = 11.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.4, posy = 18.6, posz = 23.3, radius = 2, pos2x = -4.4, pos2y = 18.6, pos2z = 11.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesmid = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4, posy = 18.6, posz = 23.3, radius = 2, - pos2x = 4, pos2y = 18.6, pos2z = 23.3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4, posy = 18.6, posz = 23.3, radius = 2, pos2x = 4, pos2y = 18.6, pos2z = 23.3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, - dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -35048,437 +22685,239 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corgol'] = { + ["corgol"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 21.1, posy = 19.5, posz = -3, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -3.5, - r = -1, g = 0.2, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 21.1, posy = 19.5, posz = -3, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = -3.5, r = -1, g = 0.2, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 23.1, posy = 17.3, posz = -3, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 23.1, posy = 17.3, posz = -3, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redlightside = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 21, posy = 19.5, posz = -9, radius = 25, colortime = -1.1, - dirx = 0, diry = 0, dirz = 1, theta = 0.4, - r = -1, g = 0.5, b = 0.5, a = 1.9, - modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 21, posy = 19.5, posz = -9, radius = 25, colortime = -1.1, dirx = 0, diry = 0, dirz = 1, theta = 0.4, r = -1, g = 0.5, b = 0.5, a = 1.9, modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redlightside2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -21, posy = 19.5, posz = -9, radius = 25, colortime = -1.1, - dirx = 0, diry = 0, dirz = 1, theta = 0.4, - r = -1, g = 0.5, b = 0.5, a = 1.9, - modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -21, posy = 19.5, posz = -9, radius = 25, colortime = -1.1, dirx = 0, diry = 0, dirz = 1, theta = 0.4, r = -1, g = 0.5, b = 0.5, a = 1.9, modelfactor = 0.5, specular = 0.3, scattering = 3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -21.1, posy = 19.5, posz = -3, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -3.5, - r = -1, g = 0.2, b = 0.2, a = 2.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -21.1, posy = 19.5, posz = -3, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = -3.5, r = -1, g = 0.2, b = 0.2, a = 2.5, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2B = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -23.1, posy = 17.3, posz = -3, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 0.2, b = 0.2, a = 0.9, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -23.1, posy = 17.3, posz = -3, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 0.2, b = 0.2, a = 0.9, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 19.5, posy = 18.8, posz = -16.5, radius = 2, - pos2x = 13.5, pos2y = 18.8, pos2z = -16.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 19.5, posy = 18.8, posz = -16.5, radius = 2, pos2x = 13.5, pos2y = 18.8, pos2z = -16.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 19.5, posy = 18.8, posz = -21, radius = 2, - pos2x = 13.5, pos2y = 18.8, pos2z = -21, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 19.5, posy = 18.8, posz = -21, radius = 2, pos2x = 13.5, pos2y = 18.8, pos2z = -21, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 19.5, posy = 18.8, posz = -25.5, radius = 2, - pos2x = 13.5, pos2y = 18.8, pos2z = -25.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 19.5, posy = 18.8, posz = -25.5, radius = 2, pos2x = 13.5, pos2y = 18.8, pos2z = -25.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft1side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 20.8, posy = 18.5, posz = -16.5, radius = 2, - pos2x = 23.8, pos2y = 14.6, pos2z = -16.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 20.8, posy = 18.5, posz = -16.5, radius = 2, pos2x = 23.8, pos2y = 14.6, pos2z = -16.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft2side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 20.8, posy = 18.5, posz = -21, radius = 2, - pos2x = 23.8, pos2y = 14.6, pos2z = -21, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 20.8, posy = 18.5, posz = -21, radius = 2, pos2x = 23.8, pos2y = 14.6, pos2z = -21, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft3side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 20.8, posy = 18.5, posz = -25.5, radius = 2, - pos2x = 23.8, pos2y = 14.6, pos2z = -25.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 20.8, posy = 18.5, posz = -25.5, radius = 2, pos2x = 23.8, pos2y = 14.6, pos2z = -25.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -19.5, posy = 18.8, posz = -16.5, radius = 2, - pos2x = -13.5, pos2y = 18.8, pos2z = -16.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -19.5, posy = 18.8, posz = -16.5, radius = 2, pos2x = -13.5, pos2y = 18.8, pos2z = -16.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -19.5, posy = 18.8, posz = -21, radius = 2, - pos2x = -13.5, pos2y = 18.8, pos2z = -21, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -19.5, posy = 18.8, posz = -21, radius = 2, pos2x = -13.5, pos2y = 18.8, pos2z = -21, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright3 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -19.5, posy = 18.8, posz = -25.5, radius = 2, - pos2x = -13.5, pos2y = 18.8, pos2z = -25.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -19.5, posy = 18.8, posz = -25.5, radius = 2, pos2x = -13.5, pos2y = 18.8, pos2z = -25.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright1side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -20.8, posy = 18.5, posz = -16.5, radius = 2, - pos2x = -23.8, pos2y = 14.6, pos2z = -16.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -20.8, posy = 18.5, posz = -16.5, radius = 2, pos2x = -23.8, pos2y = 14.6, pos2z = -16.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright2side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -20.8, posy = 18.5, posz = -21, radius = 2, - pos2x = -23.8, pos2y = 14.6, pos2z = -21, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -20.8, posy = 18.5, posz = -21, radius = 2, pos2x = -23.8, pos2y = 14.6, pos2z = -21, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright3side = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -20.8, posy = 18.5, posz = -25.5, radius = 2, - pos2x = -23.8, pos2y = 14.6, pos2z = -25.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.5, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -20.8, posy = 18.5, posz = -25.5, radius = 2, pos2x = -23.8, pos2y = 14.6, pos2z = -25.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.5, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlightsourcefront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -1.2, posy = 13.2, posz = 24.7, radius = 1.6, - pos2x = 1.2, pos2y = 13.2, pos2z = 24.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -1.2, posy = 13.2, posz = 24.7, radius = 1.6, pos2x = 1.2, pos2y = 13.2, pos2z = 24.7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 13, posz = 25, radius = 55, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.98, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 13, posz = 25, radius = 55, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.98, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrelglow = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 0, posz = 8.9, radius = 3, - color2r = 0.7, color2g = 0.35, color2b = 0.05, colortime = 60, - r = 1.2, g = 0.80, b = 0.12, a = 1.5, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 0, posz = 8.9, radius = 3, color2r = 0.7, color2g = 0.35, color2b = 0.05, colortime = 60, r = 1.2, g = 0.80, b = 0.12, a = 1.5, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corgolt4'] = { + ["corgolt4"] = { base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 44, posy = 38, posz = -6, radius = 34, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 44, posy = 38, posz = -6, radius = 34, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -44, posy = 38, posz = -6, radius = 34, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -44, posy = 38, posz = -6, radius = 34, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 30, posy = 48, posz = -42, radius = 44, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 30, posy = 48, posz = -42, radius = 44, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 52, posy = 34, posz = -42, radius = 44, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 52, posy = 34, posz = -42, radius = 44, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -30, posy = 48, posz = -42, radius = 44, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -30, posy = 48, posz = -42, radius = 44, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -52, posy = 34, posz = -42, radius = 44, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -52, posy = 34, posz = -42, radius = 44, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormabm'] = { + ["cormabm"] = { orangelightcenter = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 0, posy = 22, posz = -5, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, - + lightConfig = { posx = 0, posy = 22, posz = -5, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight1A = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = -17.0, posy = 6.0, posz = 3.3, radius = 3.5, - color2r = 2, color2g = 0.8, color2b = 0, colortime = 15, - r = 0, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = -17.0, posy = 6.0, posz = 3.3, radius = 3.5, color2r = 2, color2g = 0.8, color2b = 0, colortime = 15, r = 0, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight1B = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = -17.0, posy = 6.0, posz = -11.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = -17.0, posy = 6.0, posz = -11.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight2A = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 17.0, posy = 6.0, posz = 3.3, radius = 3.5, - color2r = 2, color2g = 0.8, color2b = 0, colortime = 15, - r = 0, g = 0, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 17.0, posy = 6.0, posz = 3.3, radius = 3.5, color2r = 2, color2g = 0.8, color2b = 0, colortime = 15, r = 0, g = 0, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, orangelight2B = { - lightType = 'point', - pieceName = 'orangelight', + lightType = "point", + pieceName = "orangelight", alliedOnly = true, - lightConfig = { posx = 17.0, posy = 6.0, posz = -11.2, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 15, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 17.0, posy = 6.0, posz = -11.2, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = 15, r = 2, g = 0.8, b = 0, a = 1, modelfactor = 0.1, specular = 0.5, scattering = 0.66, lensflare = 18, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -4.3, posy = 4.8, posz = 29.7, radius = 2, - pos2x = 4.3, pos2y = 4.8, pos2z = 29.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -4.3, posy = 4.8, posz = 29.7, radius = 2, pos2x = 4.3, pos2y = 4.8, pos2z = 29.7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesright = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -5.5, posy = 4.8, posz = 28.2, radius = 2, - pos2x = -5.5, pos2y = 4.8, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -5.5, posy = 4.8, posz = 28.2, radius = 2, pos2x = -5.5, pos2y = 4.8, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyesleft = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 5.5, posy = 4.8, posz = 28.2, radius = 2, - pos2x = 5.5, pos2y = 4.8, pos2z = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 5.5, posy = 4.8, posz = 28.2, radius = 2, pos2x = 5.5, pos2y = 4.8, pos2z = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenlight1 = { - lightType = 'point', - pieceName = 'greendbr', + lightType = "point", + pieceName = "greendbr", alliedOnly = true, - lightConfig = { posx = -11.4, posy = 13.4, posz = -11.4, radius = 12, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, - + lightConfig = { posx = -11.4, posy = 13.4, posz = -11.4, radius = 12, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight2 = { - lightType = 'point', - pieceName = 'greendbl', + lightType = "point", + pieceName = "greendbl", alliedOnly = true, - lightConfig = { posx = 11.4, posy = 16.4, posz = -11.4, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 11.4, posy = 16.4, posz = -11.4, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight3 = { - lightType = 'point', - pieceName = 'greendtr', + lightType = "point", + pieceName = "greendtr", alliedOnly = true, - lightConfig = { posx = -11.4, posy = 16.4, posz = 11.4, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = -11.4, posy = 16.4, posz = 11.4, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, greenlight4 = { - lightType = 'point', - pieceName = 'greendtl', + lightType = "point", + pieceName = "greendtl", alliedOnly = true, - lightConfig = { posx = 11.4, posy = 13.4, posz = 11.4, radius = 16, - color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, - r = 2, g = 0.8, b = 0, a = 1, - modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, - lifetime = 0, sustain = 0, selfshadowing = 2}, + lightConfig = { posx = 11.4, posy = 13.4, posz = 11.4, radius = 16, color2r = 2.5, color2g = 1.15, color2b = 0, colortime = 60, r = 2, g = 0.8, b = 0, a = 1, modelfactor = -0.1, specular = 0.3, scattering = 0.2, lensflare = 3, lifetime = 0, sustain = 0, selfshadowing = 2 }, }, teamlauncher1 = { - lightType = 'point', - pieceName = 'dtr', - lightConfig = { posx = -12.2, posy = 3.5, posz = 12.2, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -5.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dtr", + lightConfig = { posx = -12.2, posy = 3.5, posz = 12.2, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -5.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncher2 = { - lightType = 'point', - pieceName = 'dtl', - lightConfig = { posx = 12.2, posy = 0.5, posz = 12.2, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -5.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dtl", + lightConfig = { posx = 12.2, posy = 0.5, posz = 12.2, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -5.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncher3 = { - lightType = 'point', - pieceName = 'dbr', - lightConfig = { posx = -12.2, posy = 0.5, posz = -12.2, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -5.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dbr", + lightConfig = { posx = -12.2, posy = 0.5, posz = -12.2, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -5.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamlauncher4 = { - lightType = 'point', - pieceName = 'dbl', - lightConfig = { posx = 12.2, posy = 3.5, posz = -12.2, radius = 2.0, - dirx = 0, diry = 1, dirz = 0, theta = -5.8, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dbl", + lightConfig = { posx = 12.2, posy = 3.5, posz = -12.2, radius = 2.0, dirx = 0, diry = 1, dirz = 0, theta = -5.8, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.6, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4, posz = 25, radius = 35, colortime = -2, - dirx = 0, diry = -0.3, dirz = 1, theta = 0.98, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4, posz = 25, radius = 35, colortime = -2, dirx = 0, diry = -0.3, dirz = 1, theta = 0.98, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes1 = { -- lightType = 'point', @@ -35526,64 +22965,38 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corgarp'] = { + ["corgarp"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5.5, posz = 20.8, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = 1, g = 0.2, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5.5, posz = 20.8, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = 1, g = 0.2, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.2, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corlevlr'] = { + ["corlevlr"] = { headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 5, posz = 2, radius = 45, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, colortime = -5, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 5, posz = 2, radius = 45, dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, colortime = -5, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5, posy = 6, posz = -16, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5, posy = 6, posz = -16, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5, posy = 6, posz = -16, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 0.2, b = 0.2, a = 1.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5, posy = 6, posz = -16, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 0.2, b = 0.2, a = 1.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2.7, posy = 12.5, posz = 9.1, radius = 2.8, - dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2.7, posy = 12.5, posz = 9.1, radius = 2.8, dirx = 0, diry = 0, dirz = 1, theta = -4.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, flashfront2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.7, posy = 12.5, posz = 9.1, radius = 2.8, - dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 1, g = 0.1, b = 0.1, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.7, posy = 12.5, posz = 9.1, radius = 2.8, dirx = 0, diry = 0, dirz = 1, theta = -4.9, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 1, g = 0.1, b = 0.1, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- flashfrontcenter = { -- lightType = 'point', @@ -35606,26 +23019,62 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, leftbeam = { - lightType = 'beam', - pieceName = 'reye', - lightConfig = { posx = 12, posy = 12, posz = 4.2, radius = 3, - pos2x = 12, pos2y = 12, pos2z = 10.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = 145, - r = -1, g = 0.1, b = 0.1, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "reye", + lightConfig = { + posx = 12, + posy = 12, + posz = 4.2, + radius = 3, + pos2x = 12, + pos2y = 12, + pos2z = 10.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 145, + r = -1, + g = 0.1, + b = 0.1, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, rightbeam = { - lightType = 'beam', - pieceName = 'reye', - lightConfig = { posx = -12, posy = 12, posz = 4.2, radius = 3, - pos2x = -12, pos2y = 12, pos2z = 10.8, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = 145, - r = -1, g = 0.1, b = 0.1, a = 1.5, - modelfactor = 0.5, specular = 0.2, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "reye", + lightConfig = { + posx = -12, + posy = 12, + posz = 4.2, + radius = 3, + pos2x = -12, + pos2y = 12, + pos2z = 10.8, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 145, + r = -1, + g = 0.1, + b = 0.1, + a = 1.5, + modelfactor = 0.5, + specular = 0.2, + scattering = 0.4, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, }, -- frontleft = { -- lightType = 'point', @@ -35673,409 +23122,237 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, }, - ['corraid'] = { + ["corraid"] = { headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'justattachtobase', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 9, posz = 7, radius = 75, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "justattachtobase", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 9, posz = 7, radius = 75, dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -11.3, posy = 9, posz = -20, radius = 4, - color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, - r = -1, g = 0.15, b = 0.15, a = 1.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -11.3, posy = 9, posz = -20, radius = 4, color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, r = -1, g = 0.15, b = 0.15, a = 1.5, modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 11.3, posy = 9, posz = -20, radius = 4, - color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, - r = -1, g = 0.15, b = 0.15, a = 1.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 11.3, posy = 9, posz = -20, radius = 4, color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, r = -1, g = 0.15, b = 0.15, a = 1.5, modelfactor = 0.5, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13, posz = 13.5, radius = 8, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 0, - r = -1, g = 0.15, b = 0.15, a = 0.4 , - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13, posz = 13.5, radius = 8, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 0, r = -1, g = 0.15, b = 0.15, a = 0.4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corwolv'] = { + ["corwolv"] = { headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 5, posz = 2, radius = 55, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 5, posz = 2, radius = 55, dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.3, posy = 9, posz = -22, radius = 6, - color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, - r = -1, g = 0.15, b = 0.15, a = 1.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.3, posy = 9, posz = -22, radius = 6, color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, r = -1, g = 0.15, b = 0.15, a = 1.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.3, posy = 9, posz = -22, radius = 6, - color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, - r = -1, g = 0.15, b = 0.15, a = 1.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.3, posy = 9, posz = -22, radius = 6, color2r = 0.45, color2g = 0.15, color2b = 0.15, colortime = -1, r = -1, g = 0.15, b = 0.15, a = 1.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = 6.5, radius = 6, - color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 0, - r = 1, g = 1, b = 1, a = 0.4 , - modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = 6.5, radius = 6, color2r = 0.3, color2g = 0.3, color2b = 0.3, colortime = 0, r = 1, g = 1, b = 1, a = 0.4, modelfactor = 0.5, specular = 0.3, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormlv'] = { + ["cormlv"] = { nanolight = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 2, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 2, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, cloaklightred = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6.7, posz = 13, radius = 4, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6.7, posz = 13, radius = 4, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 5, posz = 10.5, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.065, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 5, posz = 10.5, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.065, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -7, posy = 10, posz = 10, radius = 40, - dirx = -0.2, diry = -0.05, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -7, posy = 10, posz = 10, radius = 40, dirx = -0.2, diry = -0.05, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 7, posy = 10, posz = 10, radius = 40, - dirx = 0.2, diry = -0.05, dirz = 1, theta = 0.45, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 7, posy = 10, posz = 10, radius = 40, dirx = 0.2, diry = -0.05, dirz = 1, theta = 0.45, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7, posy = 10, posz = 12, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 2.2, - modelfactor = 0.9, specular = 0.5, scattering = 0.4, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7, posy = 10, posz = 12, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 2.2, modelfactor = 0.9, specular = 0.5, scattering = 0.4, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 10, posz = 12, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 1, g = 1, b = 1, a = 2.2, - modelfactor = 0.9, specular = 0.5, scattering = 0.4, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 10, posz = 12, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 1, g = 1, b = 1, a = 2.2, modelfactor = 0.9, specular = 0.5, scattering = 0.4, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, canister = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 8, posz = 0, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 0.95, b = 0.4, a = 0.9, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 8, posz = 0, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 0.95, b = 0.4, a = 0.9, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 2, posz = 6, radius = 8, - color2r = 0.8, color2g = 0.8, color2b = 1, colortime = 0, - r = 0.8, g = 0.8, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 2, posz = 6, radius = 8, color2r = 0.8, color2g = 0.8, color2b = 1, colortime = 0, r = 0.8, g = 0.8, b = 1, a = 0.06, modelfactor = 0.4, specular = 0.5, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -9.8, posy = 11.5, posz = -7, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 25, - r = 1.1, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -9.8, posy = 11.5, posz = -7, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 25, r = 1.1, g = 1, b = 0.4, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 9.8, posy = 11.5, posz = -7, radius = 4, - color2r = -4, color2g = -4, color2b = -4, colortime = 25, - r = 1.1, g = 1, b = 0.4, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 9.8, posy = 11.5, posz = -7, radius = 4, color2r = -4, color2g = -4, color2b = -4, colortime = 25, r = 1.1, g = 1, b = 0.4, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legmlv'] = { + ["legmlv"] = { eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2, posy = 5, posz = 10, radius = 30, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2, posy = 5, posz = 10, radius = 30, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, rear1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 0, posz = -2, radius = 40, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 0, posz = -2, radius = 40, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrwall'] = { + ["legrwall"] = { eye1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 42.35, posz = 16, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 75, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 42.35, posz = 16, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 75, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 42.35, posz = -16, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 42.35, posz = -16, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 16, posy = 42.35, posz = 0, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 65, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 16, posy = 42.35, posz = 0, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 65, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -16, posy = 42.35, posz = 0, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -16, posy = 42.35, posz = 0, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, detailglow = { - lightType = 'point', - pieceName = 'sleevedeco2', - lightConfig = { posx = 0.0, posy = 0.0, posz = 0.0, radius = 16.0, - color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 90, - r = 0.8, g = 0.3, b = 0.1, a = 0.33, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleevedeco2", + lightConfig = { posx = 0.0, posy = 0.0, posz = 0.0, radius = 16.0, color2r = 1, color2g = 0.5, color2b = 0.2, colortime = 90, r = 0.8, g = 0.3, b = 0.1, a = 0.33, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legjav'] = { + ["legjav"] = { eye1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -2.55, posz = 15, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 75, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = -2.55, posz = 15, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 75, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = -4.75, posz = 14.4, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = -4.75, posz = 14.4, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 3.75, posz = 10.3, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 65, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 3.75, posz = 10.3, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 65, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye4 = { - lightType = 'point', - pieceName = 'aasleeve', - lightConfig = { posx = -2.75, posy = 1.25, posz = 1.8, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "aasleeve", + lightConfig = { posx = -2.75, posy = 1.25, posz = 1.8, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, floodlightglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -4, posy = -6.5, posz = 11.4, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -4, posy = -6.5, posz = 11.4, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legbunk'] = { + ["legbunk"] = { searchlight = { - lightType = 'cone', - pieceName = 'torch', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 425, - dirx = 0, diry = 0, dirz = 1, theta = 0.18, - r = 0.2, g = 1.0, b = 0.2, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - } + lightType = "cone", + pieceName = "torch", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 425, dirx = 0, diry = 0, dirz = 1, theta = 0.18, r = 0.2, g = 1.0, b = 0.2, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, + }, }, - ['legkark'] = { + ["legkark"] = { eye1 = { - lightType = 'point', - pieceName = 'armortorso', - lightConfig = { posx = 5.4, posy = -2.1, posz = 1.9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 75, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "armortorso", + lightConfig = { posx = 5.4, posy = -2.1, posz = 1.9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 75, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -0.4, posy = 1.9, posz = 10.6, radius = 2, - color2r = 0, color2g = 0, color2b = 0, colortime = 80, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -0.4, posy = 1.9, posz = 10.6, radius = 2, color2r = 0, color2g = 0, color2b = 0, colortime = 80, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -1.9, posy = 5, posz = 12.1, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 65, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -1.9, posy = 5, posz = 12.1, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 65, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye4 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -0.8, posy = 6, posz = 12.1, radius = 2.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -0.8, posy = 6, posz = 12.1, radius = 2.5, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, tankl = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 5.6, posy = 12.5, posz = -10.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 5.6, posy = 12.5, posz = -10.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, tankr = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -5.6, posy = 12.5, posz = -10.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = 70, - r = 0.3, g = 0.85, b = 0.3, a = 0.6, - modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -5.6, posy = 12.5, posz = -10.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = 70, r = 0.3, g = 0.85, b = 0.3, a = 0.6, modelfactor = 0.15, specular = 0.3, scattering = 0.7, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormuskrat'] = { + ["cormuskrat"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 3.8, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 1, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 15, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 1, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 1, lensflare = 15, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 11.2, posz = 24, radius = 7, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 1, g = 0.2, b = 0.2, a = 0.8, - modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 11.2, posz = 24, radius = 7, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 1, g = 0.2, b = 0.2, a = 0.8, modelfactor = 0.5, specular = 0.3, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- eyes2 = { -- lightType = 'point', @@ -36096,72 +23373,44 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, baseleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6, posy = 15.5, posz = 4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.4, a = 0.75, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6, posy = 15.5, posz = 4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.4, a = 0.75, modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, baseright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6, posy = 15.5, posz = 4, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 0.9, b = 0.4, a = 0.75, - modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6, posy = 15.5, posz = 4, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 0.9, b = 0.4, a = 0.75, modelfactor = 0.5, specular = 0.3, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legotter'] = { + ["legotter"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'beam', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "beam", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, frontlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 4, posy = -5, posz = 30, radius = 18, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 4, posy = -5, posz = 30, radius = 18, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, backlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 0, posz = -31, radius = 18, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 0, posz = -31, radius = 18, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 0.4, specular = 0, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormist'] = { + ["cormist"] = { -- eyes1 = { -- lightType = 'point', -- pieceName = 'base', @@ -36190,1014 +23439,597 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, searchlight = { - lightType = 'cone', - pieceName = 'gun', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 180, colortime = -1.5, - dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "gun", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 180, colortime = -1.5, dirx = 0, diry = 0.1, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, centerbeam = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13.5, posz = 7, radius = 4, - pos2x = 0, pos2y = 13.5, pos2z = 15, - --dirx = 0, diry = 0, dirz = 1, theta = -4.9, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = -1, g = 0.1, b = 0.1, a = 1.0, - modelfactor = 0.3, specular = 0.2, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - }, - }, - ['armbeaver'] = { + lightType = "beam", + pieceName = "base", + lightConfig = { + posx = 0, + posy = 13.5, + posz = 7, + radius = 4, + pos2x = 0, + pos2y = 13.5, + pos2z = 15, + --dirx = 0, diry = 0, dirz = 1, theta = -4.9, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = -1, + r = -1, + g = 0.1, + b = 0.1, + a = 1.0, + modelfactor = 0.3, + specular = 0.2, + scattering = 0.9, + lensflare = 0, + lifetime = 0, + sustain = 0, + selfshadowing = 0, + }, + }, + }, + ["armbeaver"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = 1, diry = 0, dirz = 0, theta = 0.99, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = 1, diry = 0, dirz = 0, theta = 0.99, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, - dirx = -1, diry = 0, dirz = 0, theta = 0.99, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 17, dirx = -1, diry = 0, dirz = 0, theta = 0.99, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 16, posz = 24, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 16, posz = 24, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 3, posy = 17, posz = 22, radius = 30, - dirx = -0.06, diry = -0.75, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 3, posy = 17, posz = 22, radius = 30, dirx = -0.06, diry = -0.75, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armch'] = { + ["armch"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'beam', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 1.2, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "beam", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 12, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 1.2, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1.9, posy = 4.5, posz = 14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1.9, posy = 4.5, posz = 14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.9, posy = 4.5, posz = 14, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.055, - modelfactor = 0.4, specular = 0.5, scattering = 0.6, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.9, posy = 4.5, posz = 14, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.055, modelfactor = 0.4, specular = 0.5, scattering = 0.6, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.3, posy = 8, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.3, posy = 8, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.3, posy = 8, posz = 0, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.3, posy = 8, posz = 0, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 1, posz = -16, radius = 6, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 15, - r = 1.3, g = 0.9, b = 0.1, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 1, posz = -16, radius = 6, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 15, r = 1.3, g = 0.9, b = 0.1, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corhal'] = { + ["corhal"] = { back1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.4, posy = 8.5, posz = -13.2, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.4, posy = 8.5, posz = -13.2, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.4, posy = 8.5, posz = -13.2, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.4, posy = 8.5, posz = -13.2, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -5.4, posy = 8.5, posz = 2.6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 25, - r = 0, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -5.4, posy = 8.5, posz = 2.6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 25, r = 0, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 5.4, posy = 8.5, posz = 2.6, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 25, - r = 0, g = 1, b = 0.2, a = 0.7, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 5.4, posy = 8.5, posz = 2.6, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 25, r = 0, g = 1, b = 0.2, a = 0.7, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightfront1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -10.1, posy = -2.1, posz = 19.8, radius = 1.3, - pos2x = -15.5, pos2y = -2.1, pos2z = 19.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -10.1, posy = -2.1, posz = 19.8, radius = 1.3, pos2x = -15.5, pos2y = -2.1, pos2z = 19.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightfront2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 10.1, posy = -2.1, posz = 19.8, radius = 1.3, - pos2x = 15.5, pos2y = -2.1, pos2z = 19.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 10.1, posy = -2.1, posz = 19.8, radius = 1.3, pos2x = 15.5, pos2y = -2.1, pos2z = 19.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 12.5, posy = -1, posz = 12, radius = 55, - dirx = 0, diry = -0.03, dirz = 1, theta = 0.4, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 12.5, posy = -1, posz = 12, radius = 55, dirx = 0, diry = -0.03, dirz = 1, theta = 0.4, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = -12.5, posy = -1, posz = 12, radius = 55, - dirx = 0, diry = -0.03, dirz = 1, theta = 0.4, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = -12.5, posy = -1, posz = 12, radius = 55, dirx = 0, diry = -0.03, dirz = 1, theta = 0.4, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsh'] = { + ["corsh"] = { thruster = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3, posz = -12.5, radius = 10, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, - r = 0.88, g = 0.83, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3, posz = -12.5, radius = 10, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 6, r = 0.88, g = 0.83, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corch'] = { + ["corch"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - dirx = 1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, dirx = 1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, - dirx = -1, diry = 0, dirz = 0, theta = 0.9, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 1, posz = 0, radius = 15, dirx = -1, diry = 0, dirz = 0, theta = 0.9, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 2.5, posz = 0, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.25, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.25, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolightbright = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 3, posz = 9, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 3, posz = 9, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.6, posy = 10.5, posz = -7.7, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.6, posy = 10.5, posz = -7.7, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, top2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.6, posy = 10.5, posz = -7.7, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, - r = 1.1, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.6, posy = 10.5, posz = -7.7, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.1, r = 1.1, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.5, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 11, posz = 15, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 11, posz = 15, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsnap'] = { + ["corsnap"] = { lightfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -2.1, posy = -1.8, posz = 20.8, radius = 2, - pos2x = 2.1, pos2y = -1.8, pos2z = 20.8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -2.1, posy = -1.8, posz = 20.8, radius = 2, pos2x = 2.1, pos2y = -1.8, pos2z = 20.8, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'justattachtobase', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 9, posz = 14, radius = 75, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "justattachtobase", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 9, posz = 14, radius = 75, dirx = 0, diry = -0.07, dirz = 1, theta = 0.8, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsh'] = { + ["corsh"] = { lightfront = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -0.5, posy = 3.2, posz = 8.7, radius = 0.9, - pos2x = 0.5, pos2y = 3.2, pos2z = 8.7, - color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, - r = 1, g = 1, b = 1, a = 1.8, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -0.5, posy = 3.2, posz = 8.7, radius = 0.9, pos2x = 0.5, pos2y = 3.2, pos2z = 8.7, color2r = 0, color2g = 0, color2b = 0, colortime = -2.5, r = 1, g = 1, b = 1, a = 1.8, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.4, posz = -11.9, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1.2, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.2, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.4, posz = -11.9, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1.2, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.2, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 3, posz = 2, radius = 75, - dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, - r = 1, g = 1, b = 0.89, a = 0.35, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 3, posz = 2, radius = 75, dirx = 0, diry = -0.05, dirz = 1, theta = 0.21, r = 1, g = 1, b = 0.89, a = 0.35, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['cormh'] = { + ["cormh"] = { lightfront1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.1, posy = -1.4, posz = 16.1, radius = 1.2, - pos2x = -0.8, pos2y = -1.4, pos2z = 15.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.1, posy = -1.4, posz = 16.1, radius = 1.2, pos2x = -0.8, pos2y = -1.4, pos2z = 15.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightfront2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.1, posy = -1.4, posz = 16.1, radius = 1.2, - pos2x = 0.8, pos2y = -1.4, pos2z = 15.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.1, posy = -1.4, posz = 16.1, radius = 1.2, pos2x = 0.8, pos2y = -1.4, pos2z = 15.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4, posz = 12, radius = 35, - dirx = 0, diry = -0.22, dirz = 1, theta = 0.7, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4, posz = 12, radius = 35, dirx = 0, diry = -0.22, dirz = 1, theta = 0.7, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglowl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 3.4, posy = -0.4, posz = 8, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 3.4, posy = -0.4, posz = 8, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglow3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -3.4, posy = -0.4, posz = 8, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -3.4, posy = -0.4, posz = 8, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmid = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -0.1, posy = 2.5, posz = 5.0, radius = 1.1, - color2r = -4, color2g = -4, color2b = -4, colortime = 15, - r = 1.5, g = 0, b = 0, a = 2.5, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -0.1, posy = 2.5, posz = 5.0, radius = 1.1, color2r = -4, color2g = -4, color2b = -4, colortime = 15, r = 1.5, g = 0, b = 0, a = 2.5, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.4, posz = -12.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1.2, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 1.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.4, posz = -12.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1.2, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 1.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armah'] = { + ["armah"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 3.2, posz = 11.8, radius = 3.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 3.2, posz = 11.8, radius = 3.1, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 2, posz = 0, radius = 300, colortime = -1.5, - dirx = 0, diry = 0.7, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "torso", + lightConfig = { posx = 0, posy = 2, posz = 0, radius = 300, colortime = -1.5, dirx = 0, diry = 0.7, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.3, posy = 1.4, posz = -12.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.3, posy = 1.4, posz = -12.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 2.3, posy = 1.4, posz = -12.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 2.3, posy = 1.4, posz = -12.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armanac'] = { + ["armanac"] = { front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.5, posz = 10, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.1, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.5, posz = 10, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.1, g = 1, b = 0.2, a = 0.4, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, fronthead = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.5, posz = 10, radius = 12, - color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, - r = 1, g = 1, b = 1, a = 0.33, - modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.5, posz = 10, radius = 12, color2r = 0.5, color2g = 0.5, color2b = 0.5, colortime = 45, r = 1, g = 1, b = 1, a = 0.33, modelfactor = 0.25, specular = 0.4, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 2.5, posz = 3, radius = 70, - dirx = 0, diry = -0.08, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.36, - modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 2.5, posz = 3, radius = 70, dirx = 0, diry = -0.08, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.36, modelfactor = -0.9, specular = -0.3, scattering = 1.5, lensflare = 0.6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14.5, posy = 3, posz = 3.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14.5, posy = 3, posz = 3.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -14.5, posy = 3, posz = -3.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -14.5, posy = 3, posz = -3.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14.5, posy = 3, posz = 3.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14.5, posy = 3, posz = 3.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side4 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14.5, posy = 3, posz = -3.3, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = 1.15, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14.5, posy = 3, posz = -3.3, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = 1.15, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turret = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.8, posy = 5, posz = 2.7, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 0.2, a = 0.45, - modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -2.8, posy = 5, posz = 2.7, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 0.2, a = 0.45, modelfactor = 0.4, specular = 0.4, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrel = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -2.8, posy = 1.7, posz = 7, radius = 4, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.08, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -2.8, posy = 1.7, posz = 7, radius = 4, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.08, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armmh'] = { + ["armmh"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 6, posz = 16, radius = 3.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 0., lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 6, posz = 16, radius = 3.5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 0., lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4, posz = 10, radius = 35, - dirx = 0.12, diry = -0.22, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4, posz = 10, radius = 35, dirx = 0.12, diry = -0.22, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, barrelteamglow = { - lightType = 'point', - pieceName = 'box', - lightConfig = { posx = 0, posy = 4, posz = 10, radius = 7.5, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "box", + lightConfig = { posx = 0, posy = 4, posz = 10, radius = 7.5, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, back = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -2.8, posy = 12, posz = -15, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -2.8, posy = 12, posz = -15, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -10.5, posy = 12, posz = -4, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -10.5, posy = 12, posz = -4, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, mid2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 10.5, posy = 12, posz = -4, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.2, g = 1, b = 0.5, a = 0.7, - modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 10.5, posy = 12, posz = -4, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.2, g = 1, b = 0.5, a = 0.7, modelfactor = 0.3, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armsh'] = { + ["armsh"] = { searchlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 9.2, posz = 4, radius = 90, - dirx = 0, diry = -0.07, dirz = 1, theta = 0.21, - r = 1, g = 1, b = 0.89, a = 0.44, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 9.2, posz = 4, radius = 90, dirx = 0, diry = -0.07, dirz = 1, theta = 0.21, r = 1, g = 1, b = 0.89, a = 0.44, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 1, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 9.2, posz = 9, radius = 4, - color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, - r = 0.8, g = 0.9, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 9.2, posz = 9, radius = 4, color2r = 0.8, color2g = 0.9, color2b = 1, colortime = 0, r = 0.8, g = 0.9, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.2, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, gun = { - lightType = 'point', - pieceName = 'gun', - lightConfig = { posx = 0, posy = 4.5, posz = 1, radius = 5, - color2r = 1, color2g = 1, color2b = 1, colortime = 0, - r = 1, g = 1, b = 1, a = 0.06, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "gun", + lightConfig = { posx = 0, posy = 4.5, posz = 1, radius = 5, color2r = 1, color2g = 1, color2b = 1, colortime = 0, r = 1, g = 1, b = 1, a = 0.06, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armlun'] = { + ["armlun"] = { searchlight = { - lightType = 'cone', - pieceName = 'base', - lightConfig = { posx = 0, posy = 15.8, posz = 15, radius = 150, colortime = -1.5, - dirx = 0, diry = 0.0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", + lightConfig = { posx = 0, posy = 15.8, posz = 15, radius = 150, colortime = -1.5, dirx = 0, diry = 0.0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, base2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 15.8, posz = 17, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1.2, g = 1, b = 0.2, a = 0.65, - modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 15.8, posz = 17, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1.2, g = 1, b = 0.2, a = 0.65, modelfactor = 0.4, specular = 0.3, scattering = 0.15, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowl = { - lightType = 'point', - pieceName = 'lbarrel', - lightConfig = { posx = 0, posy = 0, posz = 13.7, radius = 4, - color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "lbarrel", + lightConfig = { posx = 0, posy = 0, posz = 13.7, radius = 4, color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redglowr = { - lightType = 'point', - pieceName = 'rbarrel', - lightConfig = { posx = 0, posy = 0, posz = 13.7, radius = 4, - color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, - r = 1, g = 0, b = 0, a = 1, - modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rbarrel", + lightConfig = { posx = 0, posy = 0, posz = 13.7, radius = 4, color2r = 0.2, color2g = 0.01, color2b = 0.01, colortime = 120, r = 1, g = 0, b = 0, a = 1, modelfactor = 0.2, specular = 0.1, scattering = 0.9, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -7.3, posy = 12.8, posz = -30.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = -1, g = 0.9, b = 0.4, a = 1.75, - modelfactor = 0.3, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -7.3, posy = 12.8, posz = -30.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = -1, g = 0.9, b = 0.4, a = 1.75, modelfactor = 0.3, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7.3, posy = 12.8, posz = -30.5, radius = 6, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, - r = -1, g = 0.9, b = 0.4, a = 1.75, - modelfactor = 0.3, specular = 0.4, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7.3, posy = 12.8, posz = -30.5, radius = 6, color2r = 0, color2g = 0, color2b = 0, colortime = -1.0, r = -1, g = 0.9, b = 0.4, a = 1.75, modelfactor = 0.3, specular = 0.4, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corah'] = { + ["corah"] = { eyes = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 13, posz = 16, radius = 7, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, - r = 1, g = 0.2, b = 0.2, a = 0.6, - modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 13, posz = 16, radius = 7, color2r = 0, color2g = 0, color2b = 0, colortime = -1.2, r = 1, g = 0.2, b = 0.2, a = 0.6, modelfactor = 0.3, specular = 0.4, scattering = 0.2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, aatop1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 0, posy = 13, posz = -1, radius = 7, - color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, - r = 1, g = 0.7, b = 0.85, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 0, posy = 13, posz = -1, radius = 7, color2r = -0.6, color2g = -0.4, color2b = -0.5, colortime = 45, r = 1, g = 0.7, b = 0.85, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.4, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, searchlight = { - lightType = 'cone', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 10, radius = 300, colortime = -1.5, - dirx = 0, diry = 0, dirz = 1, theta = 0.12, - r = 1, g = 1, b = 1, a = 0.32, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 10, radius = 300, colortime = -1.5, dirx = 0, diry = 0, dirz = 1, theta = 0.12, r = 1, g = 1, b = 1, a = 0.32, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corsok'] = { + ["corsok"] = { lightfront1 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = -3.1, posy = -1.4, posz = 16.1, radius = 1.2, - pos2x = -0.8, pos2y = -1.4, pos2z = 15.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = -3.1, posy = -1.4, posz = 16.1, radius = 1.2, pos2x = -0.8, pos2y = -1.4, pos2z = 15.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, lightfront2 = { - lightType = 'beam', - pieceName = 'base', - lightConfig = { posx = 3.1, posy = -1.4, posz = 16.1, radius = 1.2, - pos2x = 0.8, pos2y = -1.4, pos2z = 15.1, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, - r = 1, g = 1, b = 1, a = 1.2, - modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "base", + lightConfig = { posx = 3.1, posy = -1.4, posz = 16.1, radius = 1.2, pos2x = 0.8, pos2y = -1.4, pos2z = 15.1, color2r = 0, color2g = 0, color2b = 0, colortime = -1.8, r = 1, g = 1, b = 1, a = 1.2, modelfactor = 0.4, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 4, posz = 22, radius = 35, - dirx = 0, diry = -0.22, dirz = 1, theta = 0.9, - r = 1, g = 1, b = 0.89, a = 0.30, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 4, posz = 22, radius = 35, dirx = 0, diry = -0.22, dirz = 1, theta = 0.9, r = 1, g = 1, b = 0.89, a = 0.30, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglowl = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 3.4, posy = -0.4, posz = 8, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 3.4, posy = -0.4, posz = 8, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, teamglow3 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -3.4, posy = -0.4, posz = 8, radius = 3, - color2r = 0, color2g = 0, color2b = 0, colortime = 120, - r = -1, g = 0, b = 0, a = 2, - modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -3.4, posy = -0.4, posz = 8, radius = 3, color2r = 0, color2g = 0, color2b = 0, colortime = 120, r = -1, g = 0, b = 0, a = 2, modelfactor = 0.5, specular = 0.3, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmidl = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 28, posy = 13.5, posz = 3.0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0, b = 0, a = 0.2, - modelfactor = 0.1, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 28, posy = 13.5, posz = 3.0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0, b = 0, a = 0.2, modelfactor = 0.1, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, redmidr = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -28, posy = 13.5, posz = 3.0, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 0, b = 0, a = 0.2, - modelfactor = 0.1, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -28, posy = 13.5, posz = 3.0, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 0, b = 0, a = 0.2, modelfactor = 0.1, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashlf = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 5.0, posy = 5.7, posz = -6.0, radius = 1.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 5.0, posy = 5.7, posz = -6.0, radius = 1.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashlb = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = 5.0, posy = 5.7, posz = -8.5, radius = 1.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = 5.0, posy = 5.7, posz = -8.5, radius = 1.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashrf = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -5.0, posy = 5.7, posz = -6.0, radius = 1.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -5.0, posy = 5.7, posz = -6.0, radius = 1.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, depthchargeflashrb = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -5.0, posy = 5.7, posz = -8.5, radius = 1.0, - color2r = -2, color2g = -2, color2b = -2, colortime = 25, - r = 0.6, g = 0.8, b = 1, a = 3, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -5.0, posy = 5.7, posz = -8.5, radius = 1.0, color2r = -2, color2g = -2, color2b = -2, colortime = 25, r = 0.6, g = 0.8, b = 1, a = 3, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, energyback1 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 0.0, posy = -5.1, posz = -17.8, radius = 1.5, - pos2x = 0.0, pos2y = -8.9, pos2z = -17.81, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 0.0, posy = -5.1, posz = -17.8, radius = 1.5, pos2x = 0.0, pos2y = -8.9, pos2z = -17.81, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, energyback2 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = -4.6, posy = -5.1, posz = -17.8, radius = 1.5, - pos2x = -4.6, pos2y = -8.9, pos2z = -17.81, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = -4.6, posy = -5.1, posz = -17.8, radius = 1.5, pos2x = -4.6, pos2y = -8.9, pos2z = -17.81, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, energyback3 = { - lightType = 'beam', - pieceName = 'turret', - lightConfig = { posx = 4.6, posy = -5.1, posz = -17.8, radius = 1.5, - pos2x = 4.6, pos2y = -8.9, pos2z = -17.81, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1.2, g = 1, b = 0.2, a = 1.6, - modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "beam", + pieceName = "turret", + lightConfig = { posx = 4.6, posy = -5.1, posz = -17.8, radius = 1.5, pos2x = 4.6, pos2y = -8.9, pos2z = -17.81, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1.2, g = 1, b = 0.2, a = 1.6, modelfactor = 0.4, specular = 0.4, scattering = 0.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster1 = { - lightType = 'point', - pieceName = 'jetl', - lightConfig = { posx = 0, posy = -5.0, posz = 0, radius = 7, - color2r = 1.05, color2g = 0.80, color2b = 0.39, colortime = 6, - r = 1.18, g = 0.92, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetl", + lightConfig = { posx = 0, posy = -5.0, posz = 0, radius = 7, color2r = 1.05, color2g = 0.80, color2b = 0.39, colortime = 6, r = 1.18, g = 0.92, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, thruster2 = { - lightType = 'point', - pieceName = 'jetr', - lightConfig = { posx = 0, posy = -5.0, posz = 0, radius = 7, - color2r = 1.05, color2g = 0.78, color2b = 0.40, colortime = 5, - r = 1.25, g = 0.9, b = 0.4, a = 0.45, - modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "jetr", + lightConfig = { posx = 0, posy = -5.0, posz = 0, radius = 7, color2r = 1.05, color2g = 0.78, color2b = 0.40, colortime = 5, r = 1.25, g = 0.9, b = 0.4, a = 0.45, modelfactor = 0.3, specular = 0.4, scattering = 1.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armcv'] = { + ["armcv"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = -1, radius = 16, - dirx = 1, diry = 0, dirz = 0, theta = 0.9, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = -1, radius = 16, dirx = 1, diry = 0, dirz = 0, theta = 0.9, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = -1, radius = 16, - dirx = -1, diry = 0, dirz = 0, theta = 0.9, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = -1, radius = 16, dirx = -1, diry = 0, dirz = 0, theta = 0.9, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'nano2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "nano2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, front = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3, posy = 9, posz = 25, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 1, g = 1, b = 1, a = 0.8, - modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3, posy = 9, posz = 25, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 1, g = 1, b = 1, a = 0.8, modelfactor = 0.4, specular = 0.5, scattering = 0.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = -2.5, radius = 6, - color2r = -11, color2g = -11, color2b = -11, colortime = 45, - r = 1.1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = -2.5, radius = 6, color2r = -11, color2g = -11, color2b = -11, colortime = 45, r = 1.1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.45, specular = 0.2, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, headlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 3, posy = 11, posz = 21, radius = 32, - dirx = -0.06, diry = -0.33, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 3, posy = 11, posz = 21, radius = 32, dirx = -0.06, diry = -0.33, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armacv'] = { + ["armacv"] = { buildflash1 = { - lightType = 'point', - pieceName = 'ldoor', - lightConfig = { posx = -3, posy = 10, posz = -15.5, radius = 6, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "ldoor", + lightConfig = { posx = -3, posy = 10, posz = -15.5, radius = 6, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash2 = { - lightType = 'point', - pieceName = 'rdoor', - lightConfig = { posx = 3, posy = 10, posz = -15.5, radius = 6, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "rdoor", + lightConfig = { posx = 3, posy = 10, posz = -15.5, radius = 6, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight1 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 2, posy = 0, posz = 0, radius = 17, - dirx = 0.001, diry = 0, dirz = 1, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 2, posy = 0, posz = 0, radius = 17, dirx = 0.001, diry = 0, dirz = 1, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { - lightType = 'cone', - pieceName = 'cagelight_emit2', - lightConfig = { posx = -2, posy = 0, posz = 0, radius = 17, - dirx = 0.001, diry = 0, dirz = 1, theta = 0.99, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit2", + lightConfig = { posx = -2, posy = 0, posz = 0, radius = 17, dirx = 0.001, diry = 0, dirz = 1, theta = 0.99, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 6, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'lnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "lnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'rnano', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.3, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0 }, + lightType = "point", + pieceName = "rnano", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 18, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.3, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, -- buildflash = { -- lightType = 'point', @@ -37209,622 +24041,360 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, headlight = { - lightType = 'cone', - pieceName = 'base', -- invalid ones will attach to the worldpos of the unit - lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, - dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, - r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, - modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "base", -- invalid ones will attach to the worldpos of the unit + lightConfig = { posx = 0, posy = 21, posz = 21, radius = 34, dirx = -0.06, diry = -0.77, dirz = 1, theta = 0.6, r = 1, g = 1, b = 0.89, a = 0.25, colortime = -3, modelfactor = -0.5, specular = -0.3, scattering = 1.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corck'] = { + ["corck"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.3, g = 0.9, b = 0.1, a = 2, - modelfactor = 0.2, specular = 0.2, scattering = 1.7, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.3, g = 0.9, b = 0.1, a = 2, modelfactor = 0.2, specular = 0.2, scattering = 1.7, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildlight2 = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.2, specular = 0.2, scattering = 1.7, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = -1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.2, specular = 0.2, scattering = 1.7, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, buildflash = { - lightType = 'point', - pieceName = 'cagelight', - lightConfig = { posx = 0, posy = 0, posz = -3, radius = 7, - color2r = -4, color2g = -4, color2b = -4, colortime = 60, - r = 1, g = 0.8, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "cagelight", + lightConfig = { posx = 0, posy = 0, posz = -3, radius = 7, color2r = -4, color2g = -4, color2b = -4, colortime = 60, r = 1, g = 0.8, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.5, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 1, posy = 0, posz = 1, radius = 17, - color2r = 0, color2g = 0, color2b = 0, colortime = -2, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 1, posy = 0, posz = 1, radius = 17, color2r = 0, color2g = 0, color2b = 0, colortime = -2, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolightbright = { - lightType = 'point', - pieceName = 'nano', - lightConfig = { posx = 1, posy = 0, posz = 1, radius = 10, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "nano", + lightConfig = { posx = 1, posy = 0, posz = 1, radius = 10, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, side = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 9.2, posy = 5.7, posz = 0, radius = 8, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 1.1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 9.2, posy = 5.7, posz = 0, radius = 8, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 1.1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 5.7, posy = 4, posz = 17, radius = 5, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 5.7, posy = 4, posz = 17, radius = 5, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -5.7, posy = 4, posz = 17, radius = 5, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, - r = 1, g = 0.2, b = 0.2, a = 0.6, - modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -5.7, posy = 4, posz = 17, radius = 5, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = -1, r = 1, g = 0.2, b = 0.2, a = 0.6, modelfactor = 0.4, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legck'] = { + ["legck"] = { buildlight = { -- this is the lightname - lightType = 'cone', - pieceName = 'cagelight_emit', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, - r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, - modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "cagelight_emit", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, dirx = 1, diry = 0, dirz = 0, theta = 0.99000001, r = 1.29999995, g = 0.89999998, b = 0.1, a = 2, modelfactor = 0.1, specular = 0.2, scattering = 1.5, lensflare = 8, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, tankglow = { - lightType = 'point', - pieceName = 'tankdecor', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "tankdecor", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 32, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.15, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.15, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.15, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.15, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 4, posy = 7, posz = 4, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 4, posy = 7, posz = 4, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes2 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -4, posy = 7, posz = 4, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -4, posy = 7, posz = 4, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legaceb'] = { + ["legaceb"] = { tankglow = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = 0, posy = 4.5, posz = -12, radius = 32, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = 0, posy = 4.5, posz = -12, radius = 32, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight = { - lightType = 'point', - pieceName = 'flare1', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.15, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare1", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.15, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, nanolight2 = { - lightType = 'point', - pieceName = 'flare2', - lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = -1, g = 1, b = 1, a = 0.15, - modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare2", + lightConfig = { posx = 0, posy = 0, posz = 1, radius = 15, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = -1, g = 1, b = 1, a = 0.15, modelfactor = 0.5, specular = 0.5, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyes1 = { - lightType = 'point', - pieceName = 'torso', - lightConfig = { posx = -1.5, posy = 3, posz = 13, radius = 10, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.15, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "torso", + lightConfig = { posx = -1.5, posy = 3, posz = 13, radius = 10, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.15, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrail'] = { + ["legrail"] = { eye1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.3, posy = -0.3, posz = 15.3, radius = 1.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.3, posy = -0.3, posz = 15.3, radius = 1.0, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.3, posy = -1.3, posz = 15.3, radius = 1.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.3, posy = -1.3, posz = 15.3, radius = 1.0, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 1.3, posy = -2.3, posz = 15.3, radius = 1.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 1.3, posy = -2.3, posz = 15.3, radius = 1.0, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.2, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeturret1 = { - lightType = 'point', - pieceName = 'turret', - lightConfig = { posx = -5.1, posy = 5.58, posz = 1.02, radius = 2.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turret", + lightConfig = { posx = -5.1, posy = 5.58, posz = 1.02, radius = 2.0, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeturret2 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -8.05, posy = 0.55, posz = 5.26, radius = 1.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -8.05, posy = 0.55, posz = 5.26, radius = 1.5, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeturret3 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = -0.38, posy = 2.79, posz = 5.64, radius = 1.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = -0.38, posy = 2.79, posz = 5.64, radius = 1.5, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eyeturret4 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0.38, posy = 2.79, posz = 5.64, radius = 1.5, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.8, - modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0.38, posy = 2.79, posz = 5.64, radius = 1.5, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.8, modelfactor = 0.4, specular = 0, scattering = 0.2, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, capacitor1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -0.5, posy = 5, posz = 3, radius = 6.0, - color2r = 0, color2g = 0, color2b = 0, colortime = -3, - r = 0.2, g = 1, b = 0.2, a = 0.5, - modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -0.5, posy = 5, posz = 3, radius = 6.0, color2r = 0, color2g = 0, color2b = 0, colortime = -3, r = 0.2, g = 1, b = 0.2, a = 0.5, modelfactor = 0.8, specular = 0.2, scattering = 0.5, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, railglow1 = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0, posy = 0, posz = 16, radius = 2.5, - dirx = 0, diry = 0, dirz = 1, theta = -6.5, - color2r = -1, color2g = -1, color2b = -1, colortime = 30, - r = 0.5, g = 1.0, b = 1.0, a = 2.5, - modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 2.0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0, posy = 0, posz = 16, radius = 2.5, dirx = 0, diry = 0, dirz = 1, theta = -6.5, color2r = -1, color2g = -1, color2b = -1, colortime = 30, r = 0.5, g = 1.0, b = 1.0, a = 2.5, modelfactor = 0.8, specular = 0.2, scattering = 0, lensflare = 2.0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legsrail'] = { + ["legsrail"] = { eye1 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = -2.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = -2.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 2.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 2.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, capacitors = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0.0, posy = 3.5, posz = -2.0, radius = 20.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.3, b = 0.1, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0.0, posy = 3.5, posz = -2.0, radius = 20.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.6, g = 0.3, b = 0.1, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sleeveglow = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0.0, posy = 0.0, posz = -4.0, radius = 8.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.3, b = 0.1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0.0, posy = 0.0, posz = -4.0, radius = 8.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.6, g = 0.3, b = 0.1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legsrailt4'] = { + ["legsrailt4"] = { eye1 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = -2.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = -2.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye2 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 0.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 0.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, eye3 = { - lightType = 'point', - pieceName = 'pelvis', - lightConfig = { posx = 2.0, posy = 14.0, posz = 10.0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.1, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "pelvis", + lightConfig = { posx = 2.0, posy = 14.0, posz = 10.0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.1, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, capacitors = { - lightType = 'point', - pieceName = 'sleeve', - lightConfig = { posx = 0.0, posy = 3.5, posz = -2.0, radius = 20.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.3, b = 0.1, a = 0.2, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "sleeve", + lightConfig = { posx = 0.0, posy = 3.5, posz = -2.0, radius = 20.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.6, g = 0.3, b = 0.1, a = 0.2, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, sleeveglow = { - lightType = 'point', - pieceName = 'barrel', - lightConfig = { posx = 0.0, posy = 0.0, posz = -4.0, radius = 8.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.6, g = 0.3, b = 0.1, a = 0.25, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "barrel", + lightConfig = { posx = 0.0, posy = 0.0, posz = -4.0, radius = 8.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.6, g = 0.3, b = 0.1, a = 0.25, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legelrpcmech'] = { + ["legelrpcmech"] = { chassislight1 = { - lightType = 'point', - pieceName = 'chassisLightLeft', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chassisLightLeft", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, chassislight2 = { - lightType = 'point', - pieceName = 'chassisLightRight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "chassisLightRight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretlight1 = { - lightType = 'point', - pieceName = 'turretLightLeft', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretLightLeft", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, turretlight2 = { - lightType = 'point', - pieceName = 'turretLightRight', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, - color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, - r = 0.2, g = 1, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "turretLightRight", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 10.0, color2r = 1, color2g = 0.2, color2b = 0.2, colortime = 0, r = 0.2, g = 1, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legstarfall'] = { + ["legstarfall"] = { --other glows otherglow1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 14, posy = 5, posz = -48, radius = 48, - color2r = 0.44, color2g = 0.3, color2b = 0.1, colortime = 15, - r = 0.88, g = 0.6, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 14, posy = 5, posz = -48, radius = 48, color2r = 0.44, color2g = 0.3, color2b = 0.1, colortime = 15, r = 0.88, g = 0.6, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = 7, posz = -24, radius = 24, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, - r = 0.3, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = 7, posz = -24, radius = 24, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, r = 0.3, g = 1, b = 0.4, a = 0.5, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 2, posz = 49, radius = 24, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, - r = 0.3, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 2, posz = 49, radius = 24, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, r = 0.3, g = 1, b = 0.4, a = 0.5, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow2_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -53, posy = 7, posz = -24, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.3, g = 1, b = 0.4, a = 0.25, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -53, posy = 7, posz = -24, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.3, g = 1, b = 0.4, a = 0.25, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, otherglow3_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 2, posz = 49, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.3, g = 1, b = 0.4, a = 0.25, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 2, posz = 49, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.3, g = 1, b = 0.4, a = 0.25, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, }, - ['legministarfall'] = { + ["legministarfall"] = { --other glows otherglow1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 7, posy = 2.5, posz = -24, radius = 24, - color2r = 0.44, color2g = 0.3, color2b = 0.1, colortime = 15, - r = 0.88, g = 0.6, b = 0.2, a = 0.4, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 7, posy = 2.5, posz = -24, radius = 24, color2r = 0.44, color2g = 0.3, color2b = 0.1, colortime = 15, r = 0.88, g = 0.6, b = 0.2, a = 0.4, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -26.5, posy = 3.5, posz = -12, radius = 12, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, - r = 0.3, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -26.5, posy = 3.5, posz = -12, radius = 12, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, r = 0.3, g = 1, b = 0.4, a = 0.5, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 1, posz = 24.5, radius = 12, - color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, - r = 0.3, g = 1, b = 0.4, a = 0.5, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 1, posz = 24.5, radius = 12, color2r = 0.1, color2g = 0.5, color2b = 0.2, colortime = 30, r = 0.3, g = 1, b = 0.4, a = 0.5, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, otherglow2_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -26.5, posy = 3.5, posz = -12, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.3, g = 1, b = 0.4, a = 0.25, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -26.5, posy = 3.5, posz = -12, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.3, g = 1, b = 0.4, a = 0.25, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, otherglow3_2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 3.5, posy = 1, posz = 24.5, radius = 16, - color2r = 0, color2g = 0, color2b = 0, colortime = -1, - r = 0.3, g = 1, b = 0.4, a = 0.25, - modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 1}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 3.5, posy = 1, posz = 24.5, radius = 16, color2r = 0, color2g = 0, color2b = 0, colortime = -1, r = 0.3, g = 1, b = 0.4, a = 0.25, modelfactor = 0.0, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 1 }, }, }, - ['armgate'] = { + ["armgate"] = { shieldglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 26, posz = -4, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.2, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 2.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 26, posz = -4, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.2, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 2.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottomanimated = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 21, posz = 26, radius = 5, - dirx = 1, diry = 0, dirz = 0, theta = -7.2, - color2r = 0, color2g = 0, color2b = 0, colortime = -4, - r = 1.1, g = 1, b = 0.2, a = 1.8, - modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 21, posz = 26, radius = 5, dirx = 1, diry = 0, dirz = 0, theta = -7.2, color2r = 0, color2g = 0, color2b = 0, colortime = -4, r = 1.1, g = 1, b = 0.2, a = 1.8, modelfactor = 0.6, specular = 0.4, scattering = 0.1, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.2, posy = 20, posz = 26, radius = 18, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.2, posy = 20, posz = 26, radius = 18, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.2, posy = 20, posz = 26, radius = 18, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.2, posy = 20, posz = 26, radius = 18, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['armfgate'] = { + ["armfgate"] = { shieldglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 32, posz = -4, radius = 38, - color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, - r = 0.2, g = 0.9, b = 0.3, a = 0.5, - modelfactor = 0.4, specular = 0.4, scattering = 2.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 5}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 32, posz = -4, radius = 38, color2r = 0, color2g = 0, color2b = 0, colortime = -1.5, r = 0.2, g = 0.9, b = 0.3, a = 0.5, modelfactor = 0.4, specular = 0.4, scattering = 2.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 5 }, }, }, - ['armgatet3'] = { + ["armgatet3"] = { shieldglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 66, posz = -5, radius = 68, - color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, - r = 0.2, g = 0.9, b = 0.3, a = 0.25, - modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 66, posz = -5, radius = 68, color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, r = 0.2, g = 0.9, b = 0.3, a = 0.25, modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom1 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 20, posz = 26, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 20, posz = 26, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -6.2, posy = 20, posz = 26, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -6.2, posy = 20, posz = 26, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom3 = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 6.2, posy = 20, posz = 26, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.07, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 6.2, posy = 20, posz = 26, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.07, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leggatet3'] = { + ["leggatet3"] = { shieldglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 50, posz = 0, radius = 88, - color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, - r = 0.2, g = 0.9, b = 0.3, a = 0.25, - modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 50, posz = 0, radius = 88, color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, r = 0.2, g = 0.9, b = 0.3, a = 0.25, modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom1 = { - lightType = 'point', - pieceName = 'light1', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.21, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light1", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.21, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom2 = { - lightType = 'point', - pieceName = 'light2', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.21, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light2", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.21, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, bottom3 = { - lightType = 'point', - pieceName = 'light3', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.21, - modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "light3", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 1, color2g = 1, color2b = 0.2, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.21, modelfactor = 0.4, specular = 0, scattering = 0.7, lensflare = 0.5, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['corgate'] = { + ["corgate"] = { -- shieldglowold = { -- lightType = 'point', -- pieceName = 'base', @@ -37835,108 +24405,75 @@ local unitLights = { -- lifetime = 0, sustain = 0, selfshadowing = 0}, -- }, greenbright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 44, posz = 0, radius = 55, - color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, - r = 0.2, g = 0.9, b = 0.3, a = 0.8, - modelfactor = 0.4, specular = 1.0, scattering = 0.7, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 4}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 44, posz = 0, radius = 55, color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, r = 0.2, g = 0.9, b = 0.3, a = 0.8, modelfactor = 0.4, specular = 1.0, scattering = 0.7, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 4 }, }, }, - ['corgatet3'] = { + ["corgatet3"] = { shieldglow = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 42, posz = 0, radius = 55, - color2r = 0.15, color2g = 0.45, color2b = 0.15, colortime = 70, - r = 0.2, g = 0.9, b = 0.3, a = 0.25, - modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 42, posz = 0, radius = 55, color2r = 0.15, color2g = 0.45, color2b = 0.15, colortime = 70, r = 0.2, g = 0.9, b = 0.3, a = 0.25, modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legdeflector'] = { + ["legdeflector"] = { shieldglow = { - lightType = 'point', - pieceName = 'shieldFlare', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, - color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, - r = 0.2, g = 0.9, b = 0.3, a = 0.25, - modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "shieldFlare", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 55, color2r = 0.1, color2g = 0.45, color2b = 0.15, colortime = 70, r = 0.2, g = 0.9, b = 0.3, a = 0.25, modelfactor = 0.4, specular = 1.0, scattering = 1.3, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrad'] = { + ["legrad"] = { greenblobA = { - lightType = 'point', - pieceName = 'dishA', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dishA", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, greenblobB = { - lightType = 'point', - pieceName = 'dishB', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - color2r = 0, color2g = 0, color2b = 0, colortime = 0, - r = 0, g = 1, b = 0, a = 0.60000002, - modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "dishB", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 20, color2r = 0, color2g = 0, color2b = 0, colortime = 0, r = 0, g = 1, b = 0, a = 0.60000002, modelfactor = 0.80000001, specular = 0.89999998, scattering = 1, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legjam'] = { + ["legjam"] = { cloaklightred = { - lightType = 'point', - pieceName = 'strut', - lightConfig = { posx = 0, posy = 7, posz = 0, radius = 32, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 0, b = 0, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "strut", + lightConfig = { posx = 0, posy = 7, posz = 0, radius = 32, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 0, b = 0, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['leginc'] = { + ["leginc"] = { bigheatray = { - lightType = 'point', - pieceName = 'flare', - lightConfig = { posx = 0, posy = 7, posz = 0, radius = 32, - color2r = 0, color2g = 0, color2b = 1, colortime = 0, - r = 1, g = 1, b = 0.2, a = 0.6, - modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "flare", + lightConfig = { posx = 0, posy = 7, posz = 0, radius = 32, color2r = 0, color2g = 0, color2b = 1, colortime = 0, r = 1, g = 1, b = 0.2, a = 0.6, modelfactor = 0.5, specular = 0.5, scattering = 1.5, lensflare = 10, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, }, - ['legrl'] = { + ["legrl"] = { searchlight = { - lightType = 'cone', - pieceName = 'barrel', - lightConfig = { posx = 0, posy = 9, posz = 8, radius = 450, - dirx = 0, diry = 0, dirz = 1, theta = 0.2, - r = 1, g = 1, b = 1, a = 0.45, - modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, + lightType = "cone", + pieceName = "barrel", + lightConfig = { posx = 0, posy = 9, posz = 8, radius = 450, dirx = 0, diry = 0, dirz = 1, theta = 0.2, r = 1, g = 1, b = 1, a = 0.45, modelfactor = 0, specular = 1, scattering = 2, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, }, - } + }, } - -unitLights['armtorps'] = unitLights['armmls'] +unitLights["armtorps"] = unitLights["armmls"] --unitLights['coruwgeo'] = unitLights['corgeo'] --unitLights['coruwageo'] = unitLights['corageo'] --unitLights['armuwgeo'] = unitLights['armgeo'] --unitLights['armuwageo'] = unitLights['armageo'] -unitLights['armshltxuw'] = unitLights['armshltx'] -unitLights['corgantuw'] = unitLights['corgant'] -unitLights['armdecom'] = unitLights['armcom'] -unitLights['cordecom'] = unitLights['corcom'] -unitLights['armcomcon'] = unitLights['armcom'] -unitLights['corcomcon'] = unitLights['corcom'] -unitLights['armdf'] = table.copy(unitLights['armfus']) -unitLights['armuwfus'] = table.copy(unitLights['armfus']) -unitLights['armckfus'] = table.copy(unitLights['armfus']) -unitLights['legdecom'] = unitLights['legcom'] +unitLights["armshltxuw"] = unitLights["armshltx"] +unitLights["corgantuw"] = unitLights["corgant"] +unitLights["armdecom"] = unitLights["armcom"] +unitLights["cordecom"] = unitLights["corcom"] +unitLights["armcomcon"] = unitLights["armcom"] +unitLights["corcomcon"] = unitLights["corcom"] +unitLights["armdf"] = table.copy(unitLights["armfus"]) +unitLights["armuwfus"] = table.copy(unitLights["armfus"]) +unitLights["armckfus"] = table.copy(unitLights["armfus"]) +unitLights["legdecom"] = unitLights["legcom"] local unitEventLightsNames = { ------------------------------------ Put lights that are slaved to ProjectileCreated here! --------------------------------- @@ -37972,329 +24509,225 @@ local unitEventLightsNames = { --corint disabled for now since it has static positioning - now only 'working' when shooting to east: UnitScriptLights = { - ['armcom'] = { + ["armcom"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lflare', - lightName = 'dgunbarrelglow', + lightType = "point", + pieceName = "lflare", + lightName = "dgunbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = 31, radius = 80, - color2r = 1, color2g = 0.2, color2b = 0, colortime = 400, - r = 0.4, g = 0.06, b = 0, a = 0.9, - modelfactor = 2, specular = 1, scattering = 0.4, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 7, posz = 31, radius = 80, color2r = 1, color2g = 0.2, color2b = 0, colortime = 400, r = 0.4, g = 0.06, b = 0, a = 0.9, modelfactor = 2, specular = 1, scattering = 0.4, lensflare = 0, lifetime = 200, sustain = 3 }, }, }, - ['armdecom'] = { + ["armdecom"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lflare', - lightName = 'dgunbarrelglow', + lightType = "point", + pieceName = "lflare", + lightName = "dgunbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = 31, radius = 80, - color2r = 1, color2g = 0.2, color2b = 0, colortime = 400, - r = 0.4, g = 0.06, b = 0, a = 0.9, - modelfactor = 2, specular = 1, scattering = 0.4, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 7, posz = 31, radius = 80, color2r = 1, color2g = 0.2, color2b = 0, colortime = 400, r = 0.4, g = 0.06, b = 0, a = 0.9, modelfactor = 2, specular = 1, scattering = 0.4, lensflare = 0, lifetime = 200, sustain = 3 }, }, }, - ['corcom'] = { + ["corcom"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'biggun', - lightName = 'corcombarrelglow', + lightType = "point", + pieceName = "biggun", + lightName = "corcombarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 22, radius = 16, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, - r = 1, g = 0.3, b = 0, a = 0.55, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 200, sustain = 2}, + lightConfig = { posx = 0, posy = 0, posz = 22, radius = 16, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, r = 1, g = 0.3, b = 0, a = 0.55, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 200, sustain = 2 }, }, }, - ['cordecom'] = { + ["cordecom"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'biggun', - lightName = 'corcombarrelglow', + lightType = "point", + pieceName = "biggun", + lightName = "corcombarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 22, radius = 16, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, - r = 1, g = 0.3, b = 0, a = 0.55, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 200, sustain = 2}, + lightConfig = { posx = 0, posy = 0, posz = 22, radius = 16, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, r = 1, g = 0.3, b = 0, a = 0.55, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 200, sustain = 2 }, }, }, - ['legheavydrone'] = { + ["legheavydrone"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare', - lightName = 'hvydronheatToroidGlow', + lightType = "point", + pieceName = "flare", + lightName = "hvydronheatToroidGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = 1, radius = 12, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 80, sustain = 5}, + lightConfig = { posx = 0, posy = 7, posz = 1, radius = 12, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 80, sustain = 5 }, }, }, - ['leghelios'] = { + ["leghelios"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'turret', - lightName = 'heatToroidGlow', + lightType = "point", + pieceName = "turret", + lightName = "heatToroidGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = 1, radius = 12, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 80, sustain = 5}, + lightConfig = { posx = 0, posy = 7, posz = 1, radius = 12, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 80, sustain = 5 }, }, }, - ['legkark'] = { + ["legkark"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rflare', - lightName = 'LegkarkHeatrayGlow', + lightType = "point", + pieceName = "rflare", + lightName = "LegkarkHeatrayGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 200, - r = 1, g = 0.3, b = 0, a = 0.05, - modelfactor = 1.5, specular = 1, scattering = 1, lensflare = 0, - lifetime = 200, sustain = 5}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 200, r = 1, g = 0.3, b = 0, a = 0.05, modelfactor = 1.5, specular = 1, scattering = 1, lensflare = 0, lifetime = 200, sustain = 5 }, }, }, - ['legcom'] = { + ["legcom"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare', - lightName = 'LegcomHeatrayGlow', + lightType = "point", + pieceName = "flare", + lightName = "LegcomHeatrayGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 200, - r = 1, g = 0.3, b = 0, a = 0.05, - modelfactor = 1.5, specular = 1, scattering = 1, lensflare = 0, - lifetime = 200, sustain = 5}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 12, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 200, r = 1, g = 0.3, b = 0, a = 0.05, modelfactor = 1.5, specular = 1, scattering = 1, lensflare = 0, lifetime = 200, sustain = 5 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rgbarrel', - lightName = 'LegcomRailgunGlow', + lightType = "point", + pieceName = "rgbarrel", + lightName = "LegcomRailgunGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 7, radius = 6, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 1, g = 0.3, b = 0, a = 0.25, - modelfactor = 1, specular = 1, scattering = 0, lensflare = 0, - lifetime = 100, sustain = 5}, + lightConfig = { posx = 0, posy = 0, posz = 7, radius = 6, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 1, g = 0.3, b = 0, a = 0.25, modelfactor = 1, specular = 1, scattering = 0, lensflare = 0, lifetime = 100, sustain = 5 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barreldgun', - lightName = 'LegcomDGunGlow', + lightType = "point", + pieceName = "barreldgun", + lightName = "LegcomDGunGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 15, radius = 16, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, - r = 1, g = 0.3, b = 0, a = 0.55, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 200, sustain = 2}, + lightConfig = { posx = 0, posy = 0, posz = 15, radius = 16, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 400, r = 1, g = 0.3, b = 0, a = 0.55, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 200, sustain = 2 }, }, }, - ['legjav'] = { + ["legjav"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lbarrel', - lightName = 'legjavlbarrelglow', + lightType = "point", + pieceName = "lbarrel", + lightName = "legjavlbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 12, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0, colortime = 200, - r = 0.4, g = 0.06, b = 0, a = 0.6, - modelfactor = 2, specular = 1, scattering = 0.0, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 0, posz = 12, radius = 18, color2r = 1, color2g = 0.2, color2b = 0, colortime = 200, r = 0.4, g = 0.06, b = 0, a = 0.6, modelfactor = 2, specular = 1, scattering = 0.0, lensflare = 0, lifetime = 200, sustain = 3 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rbarrel', - lightName = 'legjavrbarrelglow', + lightType = "point", + pieceName = "rbarrel", + lightName = "legjavrbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 12, radius = 18, - color2r = 1, color2g = 0.2, color2b = 0, colortime = 200, - r = 0.3, g = 0.06, b = 0, a = 0.6, - modelfactor = 2, specular = 1, scattering = 0.0, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 0, posz = 12, radius = 18, color2r = 1, color2g = 0.2, color2b = 0, colortime = 200, r = 0.3, g = 0.06, b = 0, a = 0.6, modelfactor = 2, specular = 1, scattering = 0.0, lensflare = 0, lifetime = 200, sustain = 3 }, }, }, - ['legrwall'] = { + ["legrwall"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rgbarrel', - lightName = 'wallRailgunGlow', + lightType = "point", + pieceName = "rgbarrel", + lightName = "wallRailgunGlow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 14, radius = 18, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 1, g = 0.3, b = 0, a = 0.25, - modelfactor = 1, specular = 1, scattering = 0, lensflare = 0, - lifetime = 100, sustain = 5}, + lightConfig = { posx = 0, posy = 0, posz = 14, radius = 18, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 1, g = 0.3, b = 0, a = 0.25, modelfactor = 1, specular = 1, scattering = 0, lensflare = 0, lifetime = 100, sustain = 5 }, }, }, - ['corint'] = { + ["corint"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'light', - lightName = 'corintbarrelglow', + lightType = "point", + pieceName = "light", + lightName = "corintbarrelglow", alwaysVisible = true, - lightConfig = { posx = -12, posy = 2, posz = 0, radius = 28, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 800, - r = 1, g = 0.3, b = 0, a = 0.55, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 400, sustain = 2}, + lightConfig = { posx = -12, posy = 2, posz = 0, radius = 28, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 800, r = 1, g = 0.3, b = 0, a = 0.55, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 400, sustain = 2 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'light', - lightName = 'corintbarrelglow', + lightType = "point", + pieceName = "light", + lightName = "corintbarrelglow", alwaysVisible = true, - lightConfig = { posx = 12, posy = 2, posz = 0, radius = 28, - color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 800, - r = 1, g = 0.3, b = 0, a = 0.55, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 400, sustain = 2}, + lightConfig = { posx = 12, posy = 2, posz = 0, radius = 28, color2r = 0.55, color2g = 0.1, color2b = 0, colortime = 800, r = 1, g = 0.3, b = 0, a = 0.55, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 400, sustain = 2 }, }, }, - ['armbrtha'] = { + ["armbrtha"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel', - lightName = 'armbrthabarrelglow', + lightType = "point", + pieceName = "barrel", + lightName = "armbrthabarrelglow", alwaysVisible = true, - lightConfig = { posx = -12, posy = 2, posz = 65, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = -12, posy = 2, posz = 65, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel', - lightName = 'armbrthabarrelglow', + lightType = "point", + pieceName = "barrel", + lightName = "armbrthabarrelglow", alwaysVisible = true, - lightConfig = { posx = 12, posy = 2, posz = 65, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 12, posy = 2, posz = 65, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel', - lightName = 'armbrthalights', + lightType = "point", + pieceName = "barrel", + lightName = "armbrthalights", alwaysVisible = true, - lightConfig = { posx = 0, posy = 9, posz = -42, radius = 36, - color2r = 0.1, color2g = 0.1, color2b = 0.1, colortime = 120, - r = 1, g = 1, b = 1, a = 0.55, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 80, sustain = 2}, + lightConfig = { posx = 0, posy = 9, posz = -42, radius = 36, color2r = 0.1, color2g = 0.1, color2b = 0.1, colortime = 120, r = 1, g = 1, b = 1, a = 0.55, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 80, sustain = 2 }, }, }, - ['legaheattank'] = { + ["legaheattank"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'gun', - lightName = 'toroidglow', + lightType = "point", + pieceName = "gun", + lightName = "toroidglow", alwaysVisible = true, - lightConfig = { posx = -8, posy = 8, posz = -6.4, radius = 64, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 80, sustain = 5}, + lightConfig = { posx = -8, posy = 8, posz = -6.4, radius = 64, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 80, sustain = 5 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'gun', - lightName = 'toroidglow', + lightType = "point", + pieceName = "gun", + lightName = "toroidglow", alwaysVisible = true, - lightConfig = { posx = 8, posy = 8, posz = -6.4, radius = 64, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 80, sustain = 5}, + lightConfig = { posx = 8, posy = 8, posz = -6.4, radius = 64, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 160, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 80, sustain = 5 }, }, }, - ['legelrpcmech'] = { + ["legelrpcmech"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightTopFlare', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightTopFlare", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftTopFlare', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftTopFlare", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightBottomFlare', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightBottomFlare", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftBottomFlare', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftBottomFlare", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [7] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'chassisLightLeft', - lightName = 'chassislightl', + lightType = "point", + pieceName = "chassisLightLeft", + lightName = "chassislightl", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [8] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'chassisLightRight', - lightName = 'chassislightr', + lightType = "point", + pieceName = "chassisLightRight", + lightName = "chassislightr", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, -- [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, -- lightType = 'point', @@ -38308,1566 +24741,1159 @@ local unitEventLightsNames = { -- lifetime = 320, sustain = 20}, -- }, [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'coolingCellA', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "coolingCellA", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 1.0, g = 0.8, b = 0.1, a = 0.09, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 1.0, g = 0.8, b = 0.1, a = 0.09, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, [10] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'coolingCellB', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "coolingCellB", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 1.0, g = 0.8, b = 0.1, a = 0.09, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 1.0, g = 0.8, b = 0.1, a = 0.09, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, [11] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'coolingCellC', - lightName = 'exhaustcellglow3', - alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 1.0, g = 0.8, b = 0.1, a = 0.09, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightType = "point", + pieceName = "coolingCellC", + lightName = "exhaustcellglow3", + alwaysVisible = true, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 1.0, g = 0.8, b = 0.1, a = 0.09, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, [12] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'turretLightLeft', - lightName = 'turrlightl', + lightType = "point", + pieceName = "turretLightLeft", + lightName = "turrlightl", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [13] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'turretLightRight', - lightName = 'turrlightr', + lightType = "point", + pieceName = "turretLightRight", + lightName = "turrlightr", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, - }, - ['leganavyartyship'] = { + ["leganavyartyship"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightTopFlare1', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightTopFlare1", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftTopFlare1', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftTopFlare1", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightBottomFlare1', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightBottomFlare1", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftBottomFlare1', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftBottomFlare1", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [5] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightTopFlare2', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightTopFlare2", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [6] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftTopFlare2', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftTopFlare2", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [7] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightBottomFlare2', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "rightBottomFlare2", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [8] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftBottomFlare2', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "leftBottomFlare2", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 18, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, -- other glows [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'cell2', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "cell2", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 0.7, g = 0.4, b = 0.05, a = 0.18, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 0.7, g = 0.4, b = 0.05, a = 0.18, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, [10] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'cell4', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "cell4", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 0.7, g = 0.4, b = 0.05, a = 0.18, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 0.7, g = 0.4, b = 0.05, a = 0.18, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, [11] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'cell5', - lightName = 'exhaustcellglow3', + lightType = "point", + pieceName = "cell5", + lightName = "exhaustcellglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, - r = 0.7, g = 0.4, b = 0.05, a = 0.18, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 32, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 600, r = 0.7, g = 0.4, b = 0.05, a = 0.18, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 320, sustain = 20 }, }, - }, - ['leglrpc'] = { + ["leglrpc"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelA', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelA", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 3, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 3, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelA', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelA", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 7, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelB', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelB", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 3.5, posy = -2, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 3.5, posy = -2, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelB', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelB", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = 8.5, posy = -5, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 8.5, posy = -5, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [5] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelC', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelC", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = -8.5, posy = -5, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = -8.5, posy = -5, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [6] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelC', - lightName = 'leglrpcbarrelglow', + lightType = "point", + pieceName = "barrelC", + lightName = "leglrpcbarrelglow", alwaysVisible = true, - lightConfig = { posx = -3.5, posy = -2, posz = 33, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = -3.5, posy = -2, posz = 33, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 20, selfshadowing = 0 }, }, [7] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'turretSleeve', - lightName = 'pipinglights', + lightType = "point", + pieceName = "turretSleeve", + lightName = "pipinglights", alwaysVisible = true, - lightConfig = { posx = 29, posy = 30, posz = -11.6, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 29, posy = 30, posz = -11.6, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [8] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'turretSleeve', - lightName = 'exhaustglow', + lightType = "point", + pieceName = "turretSleeve", + lightName = "exhaustglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 32, posz = -11, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 32, posz = -11, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'exhaustCell', - lightName = 'exhaustcellglow', + lightType = "point", + pieceName = "exhaustCell", + lightName = "exhaustcellglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = -9, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 0, posy = 5, posz = -9, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [10] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'pipinglights', + lightType = "point", + pieceName = "base", + lightName = "pipinglights", alwaysVisible = true, - lightConfig = { posx = -31, posy = 10, posz = 18, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = -31, posy = 10, posz = 18, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, [11] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'pipinglights', + lightType = "point", + pieceName = "base", + lightName = "pipinglights", alwaysVisible = true, - lightConfig = { posx = 31, posy = 10, posz = -18, radius = 36, - color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, - r = 0.2, g = 1, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 20}, + lightConfig = { posx = 31, posy = 10, posz = -18, radius = 36, color2r = 0.2, color2g = 1, color2b = 0.2, colortime = 600, r = 0.2, g = 1, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 20 }, }, }, - ['legstarfall'] = { + ["legstarfall"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare1', - lightName = 'leglrpcbarrelglow1', + lightType = "point", + pieceName = "flare1", + lightName = "leglrpcbarrelglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare2', - lightName = 'leglrpcbarrelglow2', + lightType = "point", + pieceName = "flare2", + lightName = "leglrpcbarrelglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare3', - lightName = 'leglrpcbarrelglow3', + lightType = "point", + pieceName = "flare3", + lightName = "leglrpcbarrelglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare4', - lightName = 'leglrpcbarrelglow4', + lightType = "point", + pieceName = "flare4", + lightName = "leglrpcbarrelglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [5] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare5', - lightName = 'leglrpcbarrelglow5', + lightType = "point", + pieceName = "flare5", + lightName = "leglrpcbarrelglow5", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [6] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare6', - lightName = 'leglrpcbarrelglow6', + lightType = "point", + pieceName = "flare6", + lightName = "leglrpcbarrelglow6", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [7] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare7', - lightName = 'leglrpcbarrelglow7', + lightType = "point", + pieceName = "flare7", + lightName = "leglrpcbarrelglow7", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, --exhaust lights [8] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelBackSmoke', - lightName = 'exhaustglow1', + lightType = "point", + pieceName = "barrelBackSmoke", + lightName = "exhaustglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = -10, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.25, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 0, posz = -10, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.25, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell1', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "powerCell1", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [10] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell4', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "powerCell4", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [11] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow3', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [12] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow4', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [13] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelBackSmoke', - lightName = 'exhaustglow1', + lightType = "point", + pieceName = "barrelBackSmoke", + lightName = "exhaustglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [14] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell1', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "powerCell1", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [15] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell4', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "powerCell4", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [16] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow3', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [17] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow4', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, --other glows [18] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'otherglow1', + lightType = "point", + pieceName = "base", + lightName = "otherglow1", alwaysVisible = true, - lightConfig = { posx = 14, posy = 5, posz = -48, radius = 48, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.05, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 14, posy = 5, posz = -48, radius = 48, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.05, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [19] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'otherglow2', + lightType = "point", + pieceName = "base", + lightName = "otherglow2", alwaysVisible = true, - lightConfig = { posx = -53, posy = 7, posz = -24, radius = 24, - color2r = 0.3, color2g = 1, color2b = 0.4, colortime = 600, - r = 0.1, g = 0.85, b = 0.2, a = 0.1, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = -53, posy = 7, posz = -24, radius = 24, color2r = 0.3, color2g = 1, color2b = 0.4, colortime = 600, r = 0.1, g = 0.85, b = 0.2, a = 0.1, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [20] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'otherglow3', + lightType = "point", + pieceName = "base", + lightName = "otherglow3", alwaysVisible = true, - lightConfig = { posx = 7, posy = 2, posz = 49, radius = 24, - color2r = 0.3, color2g = 1, color2b = 0.4, colortime = 600, - r = 0.1, g = 0.85, b = 0.2, a = 0.1, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 7, posy = 2, posz = 49, radius = 24, color2r = 0.3, color2g = 1, color2b = 0.4, colortime = 600, r = 0.1, g = 0.85, b = 0.2, a = 0.1, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, - }, - ['legministarfall'] = { + ["legministarfall"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare1', - lightName = 'leglrpcbarrelglow1', + lightType = "point", + pieceName = "flare1", + lightName = "leglrpcbarrelglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare2', - lightName = 'leglrpcbarrelglow2', + lightType = "point", + pieceName = "flare2", + lightName = "leglrpcbarrelglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare3', - lightName = 'leglrpcbarrelglow3', + lightType = "point", + pieceName = "flare3", + lightName = "leglrpcbarrelglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare4', - lightName = 'leglrpcbarrelglow4', + lightType = "point", + pieceName = "flare4", + lightName = "leglrpcbarrelglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [5] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare5', - lightName = 'leglrpcbarrelglow5', + lightType = "point", + pieceName = "flare5", + lightName = "leglrpcbarrelglow5", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [6] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare6', - lightName = 'leglrpcbarrelglow6', + lightType = "point", + pieceName = "flare6", + lightName = "leglrpcbarrelglow6", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, [7] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare7', - lightName = 'leglrpcbarrelglow7', + lightType = "point", + pieceName = "flare7", + lightName = "leglrpcbarrelglow7", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, - r = 1, g = 0.4, b = 0.02, a = 1.0, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, - lifetime = 275, sustain = 18, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.5, color2g = 0.1, color2b = 0.01, colortime = 550, r = 1, g = 0.4, b = 0.02, a = 1.0, modelfactor = 2, specular = 1, scattering = 0, lensflare = 0, lifetime = 275, sustain = 18, selfshadowing = 0 }, }, --exhaust lights [8] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelBackSmoke', - lightName = 'exhaustglow1', + lightType = "point", + pieceName = "barrelBackSmoke", + lightName = "exhaustglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = -10, radius = 12, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.25, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 0, posz = -10, radius = 12, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.25, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [9] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell1', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "powerCell1", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [10] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell4', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "powerCell4", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [11] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow3', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [12] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow4', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 8}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 8 }, }, [13] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelBackSmoke', - lightName = 'exhaustglow1', + lightType = "point", + pieceName = "barrelBackSmoke", + lightName = "exhaustglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [14] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell1', - lightName = 'exhaustcellglow1', + lightType = "point", + pieceName = "powerCell1", + lightName = "exhaustcellglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [15] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell4', - lightName = 'exhaustcellglow2', + lightType = "point", + pieceName = "powerCell4", + lightName = "exhaustcellglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [16] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow3', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, [17] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'powerCell3', - lightName = 'exhaustcellglow4', + lightType = "point", + pieceName = "powerCell3", + lightName = "exhaustcellglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, - r = 0.88, g = 0.6, b = 0.2, a = 0.0045, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 320, sustain = 2}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 24, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 600, r = 0.88, g = 0.6, b = 0.2, a = 0.0045, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 320, sustain = 2 }, }, }, - ['leglraa'] = { + ["leglraa"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare', - lightName = 'raillights', + lightType = "point", + pieceName = "flare", + lightName = "raillights", alwaysVisible = true, - lightConfig = { posx = 29, posy = 30, posz = -11.6, radius = 64, - color2r = 1, color2g = 0.33, color2b = 0.7, colortime = 10, - r = 1, g = 0.33, b = 0.7, a = 1.0, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 10, sustain = 1}, + lightConfig = { posx = 29, posy = 30, posz = -11.6, radius = 64, color2r = 1, color2g = 0.33, color2b = 0.7, colortime = 10, r = 1, g = 0.33, b = 0.7, a = 1.0, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 10, sustain = 1 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'exhaustCellLeft', - lightName = 'exhaustcellglow', + lightType = "point", + pieceName = "exhaustCellLeft", + lightName = "exhaustcellglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 36, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 320, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 160, sustain = 10}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 36, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 320, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 160, sustain = 10 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'exhaustCellRight', - lightName = 'exhaustcellglow', + lightType = "point", + pieceName = "exhaustCellRight", + lightName = "exhaustcellglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 36, - color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 320, - r = 0.88, g = 0.83, b = 0.2, a = 0.09, - modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, - lifetime = 160, sustain = 10}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 36, color2r = 1, color2g = 0.92, color2b = 0.66, colortime = 320, r = 0.88, g = 0.83, b = 0.2, a = 0.09, modelfactor = 1.5, specular = 2, scattering = 2, lensflare = 0, lifetime = 160, sustain = 10 }, }, }, - ['armvulc'] = { + ["armvulc"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel01', - lightName = 'armvulcbarrelglow1', + lightType = "point", + pieceName = "barrel01", + lightName = "armvulcbarrelglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 82, radius = 36, + lightConfig = { + posx = 0, + posy = 0, + posz = 82, + radius = 36, --dirx = 0, diry = -0.5, dirz = 0.02, theta = 0.70, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 120, - r = 1, g = 0.3, b = 0, a = 0.4, - modelfactor = 2, specular = 1, scattering = 0.8, lensflare = 8, - lifetime = 60, sustain = 15}, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 120, + r = 1, + g = 0.3, + b = 0, + a = 0.4, + modelfactor = 2, + specular = 1, + scattering = 0.8, + lensflare = 8, + lifetime = 60, + sustain = 15, + }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel02', - lightName = 'armvulcbarrelglow2', + lightType = "point", + pieceName = "barrel02", + lightName = "armvulcbarrelglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 82, radius = 36, + lightConfig = { + posx = 0, + posy = 0, + posz = 82, + radius = 36, --dirx = -1, diry = 0, dirz = 0, theta = 0.70, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 120, - r = 1, g = 0.3, b = 0, a = 0.4, - modelfactor = 2, specular = 1, scattering = 0.8, lensflare = 8, - lifetime = 60, sustain = 15}, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 120, + r = 1, + g = 0.3, + b = 0, + a = 0.4, + modelfactor = 2, + specular = 1, + scattering = 0.8, + lensflare = 8, + lifetime = 60, + sustain = 15, + }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel03', - lightName = 'armvulcbarrelglow2', + lightType = "point", + pieceName = "barrel03", + lightName = "armvulcbarrelglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 82, radius = 36, + lightConfig = { + posx = 0, + posy = 0, + posz = 82, + radius = 36, --dirx = -1, diry = 0, dirz = 0, theta = 0.70, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 120, - r = 1, g = 0.3, b = 0, a = 0.4, - modelfactor = 2, specular = 1, scattering = 0.8, lensflare = 8, - lifetime = 60, sustain = 15}, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 120, + r = 1, + g = 0.3, + b = 0, + a = 0.4, + modelfactor = 2, + specular = 1, + scattering = 0.8, + lensflare = 8, + lifetime = 60, + sustain = 15, + }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel04', - lightName = 'armvulcbarrelglow4', + lightType = "point", + pieceName = "barrel04", + lightName = "armvulcbarrelglow4", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 82, radius = 36, + lightConfig = { + posx = 0, + posy = 0, + posz = 82, + radius = 36, --dirx = -1, diry = 0, dirz = 0, theta = 0.70, - color2r = 0.5, color2g = 0.1, color2b = 0, colortime = 120, - r = 1, g = 0.3, b = 0, a = 0.4, - modelfactor = 2, specular = 1, scattering = 0.8, lensflare = 8, - lifetime = 60, sustain = 15}, + color2r = 0.5, + color2g = 0.1, + color2b = 0, + colortime = 120, + r = 1, + g = 0.3, + b = 0, + a = 0.4, + modelfactor = 2, + specular = 1, + scattering = 0.8, + lensflare = 8, + lifetime = 60, + sustain = 15, + }, }, }, - ['armsnipe'] = { + ["armsnipe"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel2', - lightName = 'armsnipebarrelglow', + lightType = "point", + pieceName = "barrel2", + lightName = "armsnipebarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = -5, radius = 24, - color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 400, - r = 1.1, g = 0.45, b = 0, a = 0.36, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 7, posz = -5, radius = 24, color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 400, r = 1.1, g = 0.45, b = 0, a = 0.36, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - ['legrail'] = { + ["legrail"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'beam', - pieceName = 'flare', - lightName = 'railglow', + lightType = "beam", + pieceName = "flare", + lightName = "railglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 5, - pos2x = 0, pos2y = 0, pos2z = 6, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 5, pos2x = 0, pos2y = 0, pos2z = 6, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'beam', - pieceName = 'flare', - lightName = 'railglowaa', + lightType = "beam", + pieceName = "flare", + lightName = "railglowaa", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = -6, radius = 5, - pos2x = 0, pos2y = 0, pos2z = 6, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = -6, radius = 5, pos2x = 0, pos2y = 0, pos2z = 6, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, }, - ['legsrail'] = { + ["legsrail"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare1', - lightName = 'railglowt2', + lightType = "point", + pieceName = "flare1", + lightName = "railglowt2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare1', - lightName = 'railglowt2aa', + lightType = "point", + pieceName = "flare1", + lightName = "railglowt2aa", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 1.0, g = 0.33, b = 0.7, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 1.0, g = 0.33, b = 0.7, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, }, - ['legsrailt4'] = { + ["legsrailt4"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'beam', - pieceName = 'flare1', - lightName = 'railglowt2', + lightType = "beam", + pieceName = "flare1", + lightName = "railglowt2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 32, pos2x = 0, pos2y = 10, pos2z = -50, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 800, - r = 0.6, g = 0.225, b = 0.075, a = 0.375, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 1000, sustain = 25, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 32, pos2x = 0, pos2y = 10, pos2z = -50, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 800, r = 0.6, g = 0.225, b = 0.075, a = 0.375, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 1000, sustain = 25, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flare1', - lightName = 'railglowt2aa', + lightType = "point", + pieceName = "flare1", + lightName = "railglowt2aa", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 2500, - r = 1.0, g = 0.33, b = 0.7, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 3000, sustain = 25, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 48, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 2500, r = 1.0, g = 0.33, b = 0.7, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 3000, sustain = 25, selfshadowing = 0 }, }, }, - ['legerailtank'] = { + ["legerailtank"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightFlare', - lightName = 'railglow1', + lightType = "point", + pieceName = "rightFlare", + lightName = "railglow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'midFlare', - lightName = 'railglow2', + lightType = "point", + pieceName = "midFlare", + lightName = "railglow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftFlare', - lightName = 'railglow3', + lightType = "point", + pieceName = "leftFlare", + lightName = "railglow3", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, - color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, - r = 0.5, g = 0.3, b = 0.1, a = 0.50, - modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 24, color2r = 0.01, color2g = 0.1, color2b = 0.2, colortime = 550, r = 0.5, g = 0.3, b = 0.1, a = 0.50, modelfactor = 2, specular = 1, scattering = 0, lensflare = 1, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, }, - ['legphoenix'] = { + ["legphoenix"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'ringlight', - lightName = 'phoenixringlight', + lightType = "point", + pieceName = "ringlight", + lightName = "phoenixringlight", alwaysVisible = true, - lightConfig = { posx = 0, posy = 7, posz = -5, radius = 54, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 200, - r = 1.0, g = 0.8, b = 0.1, a = 0.56, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 7, posz = -5, radius = 54, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 200, r = 1.0, g = 0.8, b = 0.1, a = 0.56, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - ['legbastion'] = { + ["legbastion"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lightpoint', - lightName = 'bastionringlight', + lightType = "point", + pieceName = "lightpoint", + lightName = "bastionringlight", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.8, b = 0.1, a = 0.66, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.8, b = 0.1, a = 0.66, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - ['leganavyflagship'] = { + ["leganavyflagship"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'torus3', - lightName = 'ringlight1', + lightType = "point", + pieceName = "torus3", + lightName = "ringlight1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 0, radius = 100, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.6, b = 0.1, a = 0.01, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 0, radius = 100, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.6, b = 0.1, a = 0.01, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - ['legeheatraymech'] = { + ["legeheatraymech"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightToroidLight', - lightName = 'righttoroidlight', + lightType = "point", + pieceName = "rightToroidLight", + lightName = "righttoroidlight", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.8, b = 0.1, a = 0.66, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.8, b = 0.1, a = 0.66, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftToroidLight', - lightName = 'lefttoroidlight', - alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.8, b = 0.1, a = 0.66, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightType = "point", + pieceName = "leftToroidLight", + lightName = "lefttoroidlight", + alwaysVisible = true, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.8, b = 0.1, a = 0.66, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - ['legeheatraymech_old'] = { + ["legeheatraymech_old"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rightToroidLight', - lightName = 'righttoroidlight', + lightType = "point", + pieceName = "rightToroidLight", + lightName = "righttoroidlight", alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.8, b = 0.1, a = 0.66, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.8, b = 0.1, a = 0.66, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'leftToroidLight', - lightName = 'lefttoroidlight', - alwaysVisible = true, - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, - color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, - r = 1.0, g = 0.8, b = 0.1, a = 0.66, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, - lifetime = 200, sustain = 15, selfshadowing = 0}, + lightType = "point", + pieceName = "leftToroidLight", + lightName = "lefttoroidlight", + alwaysVisible = true, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 78, color2r = 1, color2g = 0.87, color2b = 0.3, colortime = 400, r = 1.0, g = 0.8, b = 0.1, a = 0.66, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 9, lifetime = 200, sustain = 15, selfshadowing = 0 }, }, }, - - ['cordemon'] = { + ["cordemon"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lfbarrel2', - lightName = 'l2glow', + lightType = "point", + pieceName = "lfbarrel2", + lightName = "l2glow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 8, radius = 16, - color2r = 0.8, color2g = 0.26, color2b = 0.05, colortime = 300, - r = 0, g = 0, b = 0, a = 2.9, - modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, - lifetime = 200, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 8, radius = 16, color2r = 0.8, color2g = 0.26, color2b = 0.05, colortime = 300, r = 0, g = 0, b = 0, a = 2.9, modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, lifetime = 200, sustain = 5, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rfbarrel2', - lightName = 'r2glow', + lightType = "point", + pieceName = "rfbarrel2", + lightName = "r2glow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 5, posz = 8, radius = 16, - color2r = 0.8, color2g = 0.26, color2b = 0.05, colortime = 300, - r = 0, g = 0, b = 0, a = 2.9, - modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, - lifetime = 200, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 5, posz = 8, radius = 16, color2r = 0.8, color2g = 0.26, color2b = 0.05, colortime = 300, r = 0, g = 0, b = 0, a = 2.9, modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, lifetime = 200, sustain = 5, selfshadowing = 0 }, }, }, - ['corthermite'] = { + ["corthermite"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel1', - lightName = 'thermiteleft', + lightType = "point", + pieceName = "barrel1", + lightName = "thermiteleft", alwaysVisible = true, - lightConfig = { posx = 0, posy = 4, posz = 8, radius = 33, - color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, - r = 0, g = 0, b = 0, a = 0.03, - modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 4, posz = 8, radius = 33, color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, r = 0, g = 0, b = 0, a = 0.03, modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrelr', - lightName = 'thermiteright', + lightType = "point", + pieceName = "barrelr", + lightName = "thermiteright", alwaysVisible = true, - lightConfig = { posx = 0, posy = 4, posz = 8, radius = 33, - color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, - r = 0, g = 0, b = 0, a = 0.03, - modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, - lifetime = 100, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 4, posz = 8, radius = 33, color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, r = 0, g = 0, b = 0, a = 0.03, modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, lifetime = 100, sustain = 5, selfshadowing = 0 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'flameflarer', - lightName = 'thermiteflame', + lightType = "point", + pieceName = "flameflarer", + lightName = "thermiteflame", alwaysVisible = true, - lightConfig = { posx = 0, posy = 4, posz = 8, radius = 15, - color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, - r = 0, g = 0, b = 0, a = 0.03, - modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, - lifetime = 200, sustain = 5, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 4, posz = 8, radius = 15, color2r = 0.8, color2g = 0.37, color2b = 0, colortime = 300, r = 0, g = 0, b = 0, a = 0.03, modelfactor = 2, specular = 1, scattering = 0.05, lensflare = 0, lifetime = 200, sustain = 5, selfshadowing = 0 }, }, - }, - ['corsiegebreaker'] = { + ["corsiegebreaker"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel_glow', - lightName = 'siegebreakerbarrelglow', + lightType = "point", + pieceName = "barrel_glow", + lightName = "siegebreakerbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 3, posz = 3, radius = 18, - color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 400, - r = 1.1, g = 0.45, b = 0, a = 0.36, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 150, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 3, posz = 3, radius = 18, color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 400, r = 1.1, g = 0.45, b = 0, a = 0.36, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, lifetime = 150, sustain = 15, selfshadowing = 0 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel_glow_overcharge', - lightName = 'siegebreakerbarrelglowovercharge', + lightType = "point", + pieceName = "barrel_glow_overcharge", + lightName = "siegebreakerbarrelglowovercharge", alwaysVisible = true, - lightConfig = { posx = 0, posy = 3, posz = 3, radius = 20, - color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 500, - r = 1.1, g = 0.45, b = 0, a = 0.46, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 250, sustain = 15, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 3, posz = 3, radius = 20, color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 500, r = 1.1, g = 0.45, b = 0, a = 0.46, modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, lifetime = 250, sustain = 15, selfshadowing = 0 }, }, }, - - ['corsok'] = { + ["corsok"] = { [1] = { - lightType = 'point', - pieceName = 'flare1', - lightName = 'glow1', + lightType = "point", + pieceName = "flare1", + lightName = "glow1", alwaysVisible = true, - lightConfig = { posx = 0, posy = 2, posz = 2, radius = 18, + lightConfig = { + posx = 0, + posy = 2, + posz = 2, + radius = 18, --color2r = 0.6, color2g = 0.07, color2b = 0, colortime = 400, - color2r = 0.02, color2g = 0.1, color2b = 0.2, colortime = 400, + color2r = 0.02, + color2g = 0.1, + color2b = 0.2, + colortime = 400, --r = 1.1, g = 0.45, b = 0, a = 0.36, - r = 0.2, g = 0.45, b = 0.8, a = 0.36, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 200, sustain = 15, selfshadowing = 0}, + r = 0.2, + g = 0.45, + b = 0.8, + a = 0.36, + modelfactor = 2, + specular = 1, + scattering = 0.5, + lensflare = 0, + lifetime = 200, + sustain = 15, + selfshadowing = 0, + }, }, [2] = { - lightType = 'point', - pieceName = 'flare2', - lightName = 'glow2', + lightType = "point", + pieceName = "flare2", + lightName = "glow2", alwaysVisible = true, - lightConfig = { posx = 0, posy = 2, posz = 2, radius = 18, - color2r = 0.02, color2g = 0.1, color2b = 0.2, colortime = 400, + lightConfig = { + posx = 0, + posy = 2, + posz = 2, + radius = 18, + color2r = 0.02, + color2g = 0.1, + color2b = 0.2, + colortime = 400, --r = 1.1, g = 0.45, b = 0, a = 0.36, - r = 0.2, g = 0.45, b = 0.8, a = 0.36, - modelfactor = 2, specular = 1, scattering = 0.5, lensflare = 0, - lifetime = 200, sustain = 15, selfshadowing = 0}, + r = 0.2, + g = 0.45, + b = 0.8, + a = 0.36, + modelfactor = 2, + specular = 1, + scattering = 0.5, + lensflare = 0, + lifetime = 200, + sustain = 15, + selfshadowing = 0, + }, }, }, - ['armraz'] = { + ["armraz"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lcannon', - lightName = 'lbarrelglow', + lightType = "point", + pieceName = "lcannon", + lightName = "lbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 6, posz = 29, radius = 17, - color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 200, - r = 0.30, g = 0.06, b = 0, a = 0.68, - modelfactor = 2, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 6, posz = 29, radius = 17, color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 200, r = 0.30, g = 0.06, b = 0, a = 0.68, modelfactor = 2, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 200, sustain = 3 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rcannon', - lightName = 'rbarrelglow', + lightType = "point", + pieceName = "rcannon", + lightName = "rbarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 6, posz = 29, radius = 17, - color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 200, - r = 0.30, g = 0.06, b = 0, a = 0.68, - modelfactor = 2, specular = 0.5, scattering = 0, lensflare = 0, - lifetime = 200, sustain = 3}, + lightConfig = { posx = 0, posy = 6, posz = 29, radius = 17, color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 200, r = 0.30, g = 0.06, b = 0, a = 0.68, modelfactor = 2, specular = 0.5, scattering = 0, lensflare = 0, lifetime = 200, sustain = 3 }, }, [3] = { --red light on back of gun - lightType = 'point', - pieceName = 'lcannon', - lightName = 'lightsl', + lightType = "point", + pieceName = "lcannon", + lightName = "lightsl", alwaysVisible = true, - lightConfig = { posx = 0.3, posy = 6, posz = -7.6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 25, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = 0.3, posy = 6, posz = -7.6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 25, sustain = 20, selfshadowing = 0 }, }, [4] = { --red light on back of gun - lightType = 'point', - pieceName = 'rcannon', - lightName = 'lightsr', + lightType = "point", + pieceName = "rcannon", + lightName = "lightsr", alwaysVisible = true, - lightConfig = { posx = -0.3, posy = 6, posz = -7.6, radius = 4, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 1, g = 0, b = 0, a = 0.9, - modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, - lifetime = 25, sustain = 20, selfshadowing = 0}, + lightConfig = { posx = -0.3, posy = 6, posz = -7.6, radius = 4, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 1, g = 0, b = 0, a = 0.9, modelfactor = 0.4, specular = 0, scattering = 0.6, lensflare = 0, lifetime = 25, sustain = 20, selfshadowing = 0 }, }, [5] = { --red light on shoulder - lightType = 'point', - pieceName = 'torso', - lightName = 'lightsls', + lightType = "point", + pieceName = "torso", + lightName = "lightsls", alwaysVisible = true, - lightConfig = { posx = 6.8, posy = 10, posz = -12.1, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 1, g = 0.1, b = 0.1, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 25, sustain = 10, selfshadowing = 0}, + lightConfig = { posx = 6.8, posy = 10, posz = -12.1, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 1, g = 0.1, b = 0.1, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 25, sustain = 10, selfshadowing = 0 }, }, [6] = { --red light on shoulder - lightType = 'point', - pieceName = 'torso', - lightName = 'lightsrs', + lightType = "point", + pieceName = "torso", + lightName = "lightsrs", alwaysVisible = true, - lightConfig = { posx = -6.8, posy = 10, posz = -12.1, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 50, - r = 1, g = 0.1, b = 0.1, a = 0.8, - modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, - lifetime = 25, sustain = 10, selfshadowing = 0}, + lightConfig = { posx = -6.8, posy = 10, posz = -12.1, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 50, r = 1, g = 0.1, b = 0.1, a = 0.8, modelfactor = 0.3, specular = 0.1, scattering = 0.2, lensflare = 0, lifetime = 25, sustain = 10, selfshadowing = 0 }, }, }, - ['corcat'] = { + ["corcat"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lturret', - lightName = 'lbarrelglow', + lightType = "point", + pieceName = "lturret", + lightName = "lbarrelglow", alwaysVisible = true, - lightConfig = { posx = 18.3, posy = 5, posz = 18, radius = 8, - color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, - r = 1.1, g = 0.22, b = 0, a = 0.9, - modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 400, sustain = 25}, + lightConfig = { posx = 18.3, posy = 5, posz = 18, radius = 8, color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, r = 1.1, g = 0.22, b = 0, a = 0.9, modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 400, sustain = 25 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'lturret', - lightName = 'lbarrelglow2', + lightType = "point", + pieceName = "lturret", + lightName = "lbarrelglow2", alwaysVisible = true, - lightConfig = { posx = 10.3, posy = 5, posz = 18, radius = 8, - color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, - r = 1.1, g = 0.22, b = 0, a = 0.9, - modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 400, sustain = 25}, + lightConfig = { posx = 10.3, posy = 5, posz = 18, radius = 8, color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, r = 1.1, g = 0.22, b = 0, a = 0.9, modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 400, sustain = 25 }, }, [3] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rturret', - lightName = 'rbarrelglow', + lightType = "point", + pieceName = "rturret", + lightName = "rbarrelglow", alwaysVisible = true, - lightConfig = { posx = -18.3, posy = 5, posz = 18, radius = 8, - color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, - r = 1.1, g = 0.22, b = 0, a = 0.9, - modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 400, sustain = 25}, + lightConfig = { posx = -18.3, posy = 5, posz = 18, radius = 8, color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, r = 1.1, g = 0.22, b = 0, a = 0.9, modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 400, sustain = 25 }, }, [4] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'rturret', - lightName = 'rbarrelglow2', + lightType = "point", + pieceName = "rturret", + lightName = "rbarrelglow2", alwaysVisible = true, - lightConfig = { posx = -10.3, posy = 5, posz = 18, radius = 8, - color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, - r = 1.1, g = 0.22, b = 0, a = 0.9, - modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 400, sustain = 25}, + lightConfig = { posx = -10.3, posy = 5, posz = 18, radius = 8, color2r = 0.30, color2g = 0.06, color2b = 0, colortime = 550, r = 1.1, g = 0.22, b = 0, a = 0.9, modelfactor = 2, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 400, sustain = 25 }, }, }, - ['armanni'] = { + ["armanni"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel', - lightName = 'armsnipebarrelglow', + lightType = "point", + pieceName = "barrel", + lightName = "armsnipebarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 15, posz = -8, radius = 23, - color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 150, - r = 0.3, g = 0.05, b = 0, a = 0.5, - modelfactor = 1, specular = 1, scattering = 0.3, lensflare = 0, - lifetime = 200, sustain = 10}, + lightConfig = { posx = 0, posy = 15, posz = -8, radius = 23, color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 150, r = 0.3, g = 0.05, b = 0, a = 0.5, modelfactor = 1, specular = 1, scattering = 0.3, lensflare = 0, lifetime = 200, sustain = 10 }, }, }, - [UnitDefNames['armexcalibur'].id] = { + [UnitDefNames["armexcalibur"].id] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'barrel', - lightName = 'armsnipebarrelglow', + lightType = "point", + pieceName = "barrel", + lightName = "armsnipebarrelglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 2, posz = 5, radius = 23, - color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 150, - r = 0.3, g = 0.05, b = 0, a = 0.4, - modelfactor = 1, specular = 1, scattering = 0.3, lensflare = 0, - lifetime = 200, sustain = 10}, + lightConfig = { posx = 0, posy = 2, posz = 5, radius = 23, color2r = 1.1, color2g = 0.22, color2b = 0, colortime = 150, r = 0.3, g = 0.05, b = 0, a = 0.4, modelfactor = 1, specular = 1, scattering = 0.3, lensflare = 0, lifetime = 200, sustain = 10 }, }, }, - ['corsilo'] = { + ["corsilo"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'corsiloafterglow', + lightType = "point", + pieceName = "base", + lightName = "corsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 14, posz = 0, radius = 50, - color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 660, - r = 1, g = 0.5, b = 0, a = 0.85, - modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, - lifetime = 330, sustain = 50}, + lightConfig = { posx = 0, posy = 14, posz = 0, radius = 50, color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 660, r = 1, g = 0.5, b = 0, a = 0.85, modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, lifetime = 330, sustain = 50 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'cone', - pieceName = 'base', - lightName = 'corsiloafterglow', + lightType = "cone", + pieceName = "base", + lightName = "corsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 40, posz = 0, radius = 70, - dirx = 0, diry = -10, dirz = 0, theta = 0.70, - color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, - r = 1, g = 0.45, b = 0, a = 0.85, - modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, - lifetime = 340, sustain = 30}, + lightConfig = { posx = 0, posy = 40, posz = 0, radius = 70, dirx = 0, diry = -10, dirz = 0, theta = 0.70, color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, r = 1, g = 0.45, b = 0, a = 0.85, modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, lifetime = 340, sustain = 30 }, }, }, - ['legsilo'] = { + ["legsilo"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'legsiloafterglow', + lightType = "point", + pieceName = "base", + lightName = "legsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 10, posz = 0, radius = 50, - color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 660, - r = 1, g = 0.5, b = 0, a = 0.85, - modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, - lifetime = 330, sustain = 50}, + lightConfig = { posx = 0, posy = 10, posz = 0, radius = 50, color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 660, r = 1, g = 0.5, b = 0, a = 0.85, modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, lifetime = 330, sustain = 50 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'cone', - pieceName = 'base', - lightName = 'legsiloafterglow', + lightType = "cone", + pieceName = "base", + lightName = "legsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 36, posz = 0, radius = 70, - dirx = 0, diry = -10, dirz = 0, theta = 0.70, - color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, - r = 1, g = 0.45, b = 0, a = 0.85, - modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, - lifetime = 340, sustain = 30}, + lightConfig = { posx = 0, posy = 36, posz = 0, radius = 70, dirx = 0, diry = -10, dirz = 0, theta = 0.70, color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, r = 1, g = 0.45, b = 0, a = 0.85, modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, lifetime = 340, sustain = 30 }, }, }, - ['armsilo'] = { + ["armsilo"] = { [1] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'point', - pieceName = 'base', - lightName = 'armsiloafterglow', + lightType = "point", + pieceName = "base", + lightName = "armsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 42, posz = 0, radius = 32, - color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 680, - r = 1, g = 0.5, b = 0, a = 0.85, - modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, - lifetime = 340, sustain = 50}, + lightConfig = { posx = 0, posy = 42, posz = 0, radius = 32, color2r = 0.5, color2g = 0.2, color2b = 0, colortime = 680, r = 1, g = 0.5, b = 0, a = 0.85, modelfactor = 0.1, specular = 0.1, scattering = 5.5, lensflare = 0, lifetime = 340, sustain = 50 }, }, [2] = { --lightIndex as above, MUST BE AN INTEGER, Give it a nice name in a comment, - lightType = 'cone', - pieceName = 'base', - lightName = 'armsiloafterglow', + lightType = "cone", + pieceName = "base", + lightName = "armsiloafterglow", alwaysVisible = true, - lightConfig = { posx = 0, posy = 74, posz = 0, radius = 70, - dirx = 0, diry = -10, dirz = 0, theta = 0.60, - color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, - r = 1, g = 0.45, b = 0, a = 0.85, - modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, - lifetime = 340, sustain = 30}, + lightConfig = { posx = 0, posy = 74, posz = 0, radius = 70, dirx = 0, diry = -10, dirz = 0, theta = 0.60, color2r = 0.5, color2g = 0.002, color2b = 0, colortime = 680, r = 1, g = 0.45, b = 0, a = 0.85, modelfactor = 1.5, specular = 1.5, scattering = 0, lensflare = 0, lifetime = 340, sustain = 30 }, }, }, }, - - - ------------------------------- Put additional lights tied to events here! -------------------------------- - UnitIdle = { - ['armcom'] = { + UnitIdle = { + ["armcom"] = { idleBlink = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 22, posz = 12, radius = 90, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.7, - modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 22, posz = 12, radius = 90, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.7, modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['corcom'] = { + ["corcom"] = { idleBlink = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 25, posz = 0, radius = 110, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 25, posz = 0, radius = 110, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['legcom'] = { + ["legcom"] = { idleBlink = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 25, posz = 0, radius = 110, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 25, posz = 0, radius = 110, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.4, specular = 0.6, scattering = 0.7, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armck'] = { + ["armck"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", aboveUnit = 5, - lightConfig = { posx = 0, posy = 0, posz = 2, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.8, + lightConfig = { + posx = 0, + posy = 0, + posz = 2, + radius = 32, + color2r = 0, + color2g = 0, + color2b = 0, + colortime = 24, + r = -1, + g = 1, + b = 1, + a = 0.8, --r = 1.3, g = 0.9, b = 0.1, a = 0.5, - modelfactor = 0.9, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + modelfactor = 0.9, + specular = 0.2, + scattering = 0.2, + lensflare = 0, + lifetime = 12, + sustain = 0, + selfshadowing = 0, + }, }, }, - ['armcv'] = { + ["armcv"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", aboveUnit = 7, --posy was 32 - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 44, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.9, specular = 0.2, scattering = 0.2, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 44, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.9, specular = 0.2, scattering = 0.2, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armbeaver'] = { + ["armbeaver"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", aboveUnit = 7, --posy was 28 - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 39, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.8, - modelfactor = 0.9, specular = 0.2, scattering = 0.1, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 39, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.8, modelfactor = 0.9, specular = 0.2, scattering = 0.1, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armca'] = { + ["armca"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", aboveUnit = 7, --posy was 17 - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.9, - modelfactor = 0.9, specular = 0.3, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.9, modelfactor = 0.9, specular = 0.3, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armcsa'] = { + ["armcsa"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', + lightType = "point", + pieceName = "base", --aboveUnit = 3, - lightConfig = { posx = 0, posy = 11, posz = 0, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.85, - modelfactor = 0.9, specular = 0.3, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 11, posz = 0, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.85, modelfactor = 0.9, specular = 0.3, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armcs'] = { + ["armcs"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 31, posz = 0, radius = 32, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 31, posz = 0, radius = 32, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, idleBlinkleft = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 18, posy = 12, posz = 0, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 18, posy = 12, posz = 0, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, idleBlinkright = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -18, posy = 12, posz = 0, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -18, posy = 12, posz = 0, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 1, specular = 0.9, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, - }, - ['armacsub'] = { + ["armacsub"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 35, posz = 0, radius = 42, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.9, specular = 0.5, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 35, posz = 0, radius = 42, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.9, specular = 0.5, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armch'] = { + ["armch"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 19, posz = 14, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 1, specular = 0.75, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 19, posz = 14, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 1, specular = 0.75, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, idleBlinkBack = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 19, posz = -14, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 1, specular = 0.75, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 19, posz = -14, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 1, specular = 0.75, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armack'] = { + ["armack"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 36, posz = -3, radius = 28, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 0.95, - modelfactor = 0.95, specular = 0.2, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 36, posz = -3, radius = 28, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 0.95, modelfactor = 0.95, specular = 0.2, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armacv'] = { + ["armacv"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = -1, posy = 24, posz = 25, radius = 26, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.9, specular = 0.2, scattering = 0.75, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = -1, posy = 24, posz = 25, radius = 26, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.9, specular = 0.2, scattering = 0.75, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, - ['armaca'] = { + ["armaca"] = { idleBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 14, posz = 12, radius = 25, - color2r = 0, color2g = 0, color2b = 0, colortime = 24, - r = -1, g = 1, b = 1, a = 1, - modelfactor = 0.95, specular = 0.45, scattering = 0.35, lensflare = 0, - lifetime = 12, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 14, posz = 12, radius = 25, color2r = 0, color2g = 0, color2b = 0, colortime = 24, r = -1, g = 1, b = 1, a = 1, modelfactor = 0.95, specular = 0.45, scattering = 0.35, lensflare = 0, lifetime = 12, sustain = 0, selfshadowing = 0 }, }, }, --[[ @@ -39882,20 +25908,17 @@ local unitEventLightsNames = { lifetime = 12, sustain = 0, selfshadowing = 0}, }, } - ]]-- + ]] + -- }, UnitFinished = { default = { default = { - lightType = 'cone', + lightType = "cone", --pieceName = 'base', aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 160, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.18, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 20, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 160, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.18, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 20, sustain = 2, selfshadowing = 0 }, }, }, }, @@ -39903,28 +25926,20 @@ local unitEventLightsNames = { UnitCreated = { default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.16, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.16, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, UnitCloaked = { - ['armcom'] = { + ["armcom"] = { cloakBlink = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.45, - modelfactor = 0.2, specular = 0.3, scattering = 1.5, lensflare = 10, - lifetime = 30, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.45, modelfactor = 0.2, specular = 0.3, scattering = 1.5, lensflare = 10, lifetime = 30, sustain = 0, selfshadowing = 0 }, }, -- cloakFlash = { -- lightType = 'point', @@ -39938,180 +25953,142 @@ local unitEventLightsNames = { }, default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.16, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.16, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, UnitDecloaked = { - ['armcom'] = { + ["armcom"] = { cloakBlink = { - lightType = 'point', - pieceName = 'head', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - color2r = 0, color2g = 0, color2b = 0, colortime = 60, - r = -1, g = 1, b = 1, a = 0.45, - modelfactor = 0.2, specular = 0.3, scattering = 1.5, lensflare = 10, - lifetime = 30, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "head", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 100, color2r = 0, color2g = 0, color2b = 0, colortime = 60, r = -1, g = 1, b = 1, a = 0.45, modelfactor = 0.2, specular = 0.3, scattering = 1.5, lensflare = 10, lifetime = 30, sustain = 0, selfshadowing = 0 }, }, }, default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.16, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.16, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, StockpileChanged = { - ['legmos'] = { + ["legmos"] = { cloakBlink = { - lightType = 'point', - pieceName = 'base', - lightConfig = { posx = 0, posy = 17, posz = 12, radius = 22, - color2r = 0, color2g = 0, color2b = 0, colortime = 20, - r = -1, g = 1, b = 1, a = 0.6, - modelfactor = 0.5, specular = 0.3, scattering = 0.25, lensflare = 0, - lifetime = 10, sustain = 0, selfshadowing = 0}, + lightType = "point", + pieceName = "base", + lightConfig = { posx = 0, posy = 17, posz = 12, radius = 22, color2r = 0, color2g = 0, color2b = 0, colortime = 20, r = -1, g = 1, b = 1, a = 0.6, modelfactor = 0.5, specular = 0.3, scattering = 0.25, lensflare = 0, lifetime = 10, sustain = 0, selfshadowing = 0 }, }, }, default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 0, b = 0, a = 0.5, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 0, b = 0, a = 0.5, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, UnitMoveFailed = { default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = 1, g = 0, b = 0, a = 0.16, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = 1, g = 0, b = 0, a = 0.16, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, - }, UnitGiven = { default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, UnitTaken = { default = { default = { - lightType = 'cone', - pieceName = 'base', + lightType = "cone", + pieceName = "base", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = -1, g = 1, b = 1, a = 0.5, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = -1, g = 1, b = 1, a = 0.5, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, UnitDestroyed = { -- note: dont do piece-attached lights here! default = { default = { - lightType = 'cone', - pieceName = '', + lightType = "cone", + pieceName = "", aboveUnit = 100, - lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, - dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, - r = 1, g = 0, b = 0, a = 0.26, - modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, - lifetime = 15, sustain = 2, selfshadowing = 0}, + lightConfig = { posx = 0, posy = 32, posz = 0, radius = 200, dirx = 0, diry = -0.99, dirz = 0.02, theta = 0.4, r = 1, g = 0, b = 0, a = 0.26, modelfactor = 0.2, specular = 1, scattering = 0.7, lensflare = 0, lifetime = 15, sustain = 2, selfshadowing = 0 }, }, }, }, } --duplicate lights from armcom for Armada Evocom -local armComTable = {'armcomlvl2', 'armcomlvl4', 'armcomlvl5', 'armcomlvl6', 'armcomlvl7', 'armcomlvl8', 'armcomlvl9', 'armcomlvl10'} +local armComTable = { "armcomlvl2", "armcomlvl4", "armcomlvl5", "armcomlvl6", "armcomlvl7", "armcomlvl8", "armcomlvl9", "armcomlvl10" } for _, name in pairs(armComTable) do - if name == 'armcomlvl2' then - unitLights[name] = table.copy(unitLights['armcom']) + if name == "armcomlvl2" then + unitLights[name] = table.copy(unitLights["armcom"]) else - unitLights[name] = table.copy(unitLights['armcomlvl3']) + unitLights[name] = table.copy(unitLights["armcomlvl3"]) end - unitEventLightsNames.UnitDecloaked[name] = table.copy(unitEventLightsNames.UnitDecloaked['armcom']) - unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle['armcom']) - unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights['armcom']) + unitEventLightsNames.UnitDecloaked[name] = table.copy(unitEventLightsNames.UnitDecloaked["armcom"]) + unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle["armcom"]) + unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights["armcom"]) end --duplicate lights from corcom for Cortex Evocom -local corComTable = {'corcomlvl2', 'corcomlvl3', 'corcomlvl4', 'corcomlvl5', 'corcomlvl6', 'corcomlvl7', 'corcomlvl8', 'corcomlvl9', 'corcomlvl10'} +local corComTable = { "corcomlvl2", "corcomlvl3", "corcomlvl4", "corcomlvl5", "corcomlvl6", "corcomlvl7", "corcomlvl8", "corcomlvl9", "corcomlvl10" } for _, name in pairs(corComTable) do - unitLights[name] = table.copy(unitLights['corcom']) - unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle['corcom']) - unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights['corcom']) + unitLights[name] = table.copy(unitLights["corcom"]) + unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle["corcom"]) + unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights["corcom"]) end --duplicate lights from legcom for Legion Evocom -local legComTable = {'legcomlvl2', 'legcomlvl3', 'legcomlvl4', 'legcomlvl5', 'legcomlvl6', 'legcomlvl7', 'legcomlvl8', 'legcomlvl9', 'legcomlvl10', 'legdecomlvl3', 'legdecomlvl6', 'legdecomlvl10'} +local legComTable = { "legcomlvl2", "legcomlvl3", "legcomlvl4", "legcomlvl5", "legcomlvl6", "legcomlvl7", "legcomlvl8", "legcomlvl9", "legcomlvl10", "legdecomlvl3", "legdecomlvl6", "legdecomlvl10" } for _, name in pairs(legComTable) do - unitLights[name] = table.copy(unitLights['legcom']) - unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle['legcom']) - unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights['legcom']) + unitLights[name] = table.copy(unitLights["legcom"]) + unitEventLightsNames.UnitIdle[name] = table.copy(unitEventLightsNames.UnitIdle["legcom"]) + unitEventLightsNames.UnitScriptLights[name] = table.copy(unitEventLightsNames.UnitScriptLights["legcom"]) end --duplicate lights from scavengerbossv4_normal for all scavengerbossv4 variants -local scavengerBossV4Table = {'scavengerbossv4_veryeasy', 'scavengerbossv4_easy', 'scavengerbossv4_hard', 'scavengerbossv4_veryhard', 'scavengerbossv4_epic'} +local scavengerBossV4Table = { "scavengerbossv4_veryeasy", "scavengerbossv4_easy", "scavengerbossv4_hard", "scavengerbossv4_veryhard", "scavengerbossv4_epic" } for _, name in pairs(scavengerBossV4Table) do - unitLights[name] = table.copy(unitLights['scavengerbossv4_normal']) + unitLights[name] = table.copy(unitLights["scavengerbossv4_normal"]) end --AND THE REST ---unitEventLightsNames -> unitEventLights local unitEventLights = {} for key, subtables in pairs(unitEventLightsNames) do - unitEventLights[key] = {} - for subKey, lights in pairs(subtables) do - if UnitDefNames[subKey] then - unitEventLights[key][UnitDefNames[subKey].id] = lights - else - unitEventLights[key][subKey] = lights --preserve defaults etc - end + unitEventLights[key] = {} + for subKey, lights in pairs(subtables) do + if UnitDefNames[subKey] then + unitEventLights[key][UnitDefNames[subKey].id] = lights + else + unitEventLights[key][subKey] = lights --preserve defaults etc end + end end unitEventLightsNames = nil - -- convert unitname -> unitDefID local unitDefLights = {} for unitName, lights in pairs(unitLights) do @@ -40143,80 +26120,96 @@ end -- deep copy helper local function deepcopy(orig) - local orig_type = type(orig) - if orig_type ~= 'table' then - return orig - end - local copy = {} - for k, v in pairs(orig) do - copy[k] = deepcopy(v) - end - return copy + local orig_type = type(orig) + if orig_type ~= "table" then + return orig + end + local copy = {} + for k, v in pairs(orig) do + copy[k] = deepcopy(v) + end + return copy end -- add scavenger equivalents with adjusted head/search-light colors local scavUnitDefLights = {} for unitDefID, lights in pairs(unitDefLights) do - local baseName = UnitDefs[unitDefID].name - local scavUD = UnitDefNames[baseName .. '_scav'] - if scavUD then - local newLights = {} - for lightName, lightDef in pairs(lights) do - local ld = deepcopy(lightDef) - -- only tweak headlight or searchlight variants - local lname = lightName:lower() - if lname:find('headlight') or lname:find('searchlight') then - ld.lightConfig.r = 0.50 - ld.lightConfig.g = 0.20 - ld.lightConfig.b = 1.1 + local baseName = UnitDefs[unitDefID].name + local scavUD = UnitDefNames[baseName .. "_scav"] + if scavUD then + local newLights = {} + for lightName, lightDef in pairs(lights) do + local ld = deepcopy(lightDef) + -- only tweak headlight or searchlight variants + local lname = lightName:lower() + if lname:find("headlight") or lname:find("searchlight") then + ld.lightConfig.r = 0.50 + ld.lightConfig.g = 0.20 + ld.lightConfig.b = 1.1 ld.lightConfig.a = 1.0 ld.lightConfig.color2r = 0.58 - ld.lightConfig.color2g = 0.42 - ld.lightConfig.color2b = 1.15 - end - if lname:find('eye') or lname:find('eyes') or lname:find('thrust') or lname:find('engine') or lname:find('lightning') then - ld.lightConfig.r = 0.48 - ld.lightConfig.g = 0.20 - ld.lightConfig.b = 1.1 + ld.lightConfig.color2g = 0.42 + ld.lightConfig.color2b = 1.15 + end + if lname:find("eye") or lname:find("eyes") or lname:find("thrust") or lname:find("engine") or lname:find("lightning") then + ld.lightConfig.r = 0.48 + ld.lightConfig.g = 0.20 + ld.lightConfig.b = 1.1 --ld.lightConfig.a = 2.5 ld.lightConfig.color2r = 0.55 - ld.lightConfig.color2g = 0.38 - ld.lightConfig.color2b = 1.2 - end - if lname:find('flash') then - ld.lightConfig.r = 0.48 - ld.lightConfig.g = 0.20 - ld.lightConfig.b = 1.1 - end - newLights[lightName] = ld - end - scavUnitDefLights[scavUD.id] = newLights - end + ld.lightConfig.color2g = 0.38 + ld.lightConfig.color2b = 1.2 + end + if lname:find("flash") then + ld.lightConfig.r = 0.48 + ld.lightConfig.g = 0.20 + ld.lightConfig.b = 1.1 + end + newLights[lightName] = ld + end + scavUnitDefLights[scavUD.id] = newLights + end end unitDefLights = table.merge(unitDefLights, scavUnitDefLights) scavUnitDefLights = nil - - -------------------- Feature Lights -local featureDefLights = { -} +local featureDefLights = {} local WreckBaseLight = { - lightType = 'point', - lightConfig = { posx = 1, posy = -2 , posz = 1, radius = 9, -- underground relative to unit, radius will be overwritten - dirx = 0.003, diry = 0.0035, dirz = 0.003, theta = 0.9, - r = 1.2, g = 0.60, b = 0, a = 0.12, -- start at orange - color2r = 0.6, color2g = 0.08, color2b = -0.5, colortime = 28, -- in 450 frames, transition to dull red - modelfactor = 3.0, specular = -0.25, scattering = 4.6, lensflare = 0, -- no scatterin - lifetime = 300, sustain = 1.1, selfshadowing = 0}, -- remove at 300 frames, sustain is exp alpha fade + lightType = "point", + lightConfig = { + posx = 1, + posy = -2, + posz = 1, + radius = 9, -- underground relative to unit, radius will be overwritten + dirx = 0.003, + diry = 0.0035, + dirz = 0.003, + theta = 0.9, + r = 1.2, + g = 0.60, + b = 0, + a = 0.12, -- start at orange + color2r = 0.6, + color2g = 0.08, + color2b = -0.5, + colortime = 28, -- in 450 frames, transition to dull red + modelfactor = 3.0, + specular = -0.25, + scattering = 4.6, + lensflare = 0, -- no scatterin + lifetime = 300, + sustain = 1.1, + selfshadowing = 0, + }, -- remove at 300 frames, sustain is exp alpha fade } for featureDefID, featureDef in pairs(FeatureDefs) do local name = featureDef.name - if string.sub(name, string.len(name)-4) == "_dead" then + if string.sub(name, string.len(name) - 4) == "_dead" then local wreckRng = math.random() * 2 - 1 local featureSize = math.sqrt((featureDef.xsize or 1) * (featureDef.zsize or 1)) / 2.1 --Spring.Echo(name, featureDef.xsize , featureDef.zsize) @@ -40227,44 +26220,37 @@ for featureDefID, featureDef in pairs(FeatureDefs) do --featureDefLight.lightConfig.sustain = featureDefLight.lightConfig.sustain / (featureSize * 1.4) featureDefLight.lightConfig.posx = featureDefLight.lightConfig.posx * (wreckRng * featureSize * 7) featureDefLight.lightConfig.posz = featureDefLight.lightConfig.posz * (wreckRng * featureSize * 7) - if (featureSize > 3) then --for super large structures/units - lower light posy + if featureSize > 3 then --for super large structures/units - lower light posy featureDefLight.lightConfig.posy = featureDefLight.lightConfig.posy * (featureSize * 4) end featureDefLight.lightConfig.dirx = featureDefLight.lightConfig.dirx * (wreckRng * (featureSize / 4) * 2) featureDefLight.lightConfig.dirz = featureDefLight.lightConfig.dirz * (wreckRng * (featureSize / 4) * 2) - featureDefLights[featureDefID] = {FeatureCreated = featureDefLight} + featureDefLights[featureDefID] = { FeatureCreated = featureDefLight } end end - - - -local crystalLightBase = { - lightType = 'point', - lightConfig = { posx = 0, posy = 12, posz = 0, radius = 72, - color2r = 0, color2g = 0, color2b = 0, colortime = 0.1, - r = -1, g = 1, b = 1, a = 0.66, - modelfactor = 1.1, specular = 0.9, scattering = 0.8, lensflare = 0, - lifetime = 0, sustain = 0, selfshadowing = 0}, - } +local crystalLightBase = { + lightType = "point", + lightConfig = { posx = 0, posy = 12, posz = 0, radius = 72, color2r = 0, color2g = 0, color2b = 0, colortime = 0.1, r = -1, g = 1, b = 1, a = 0.66, modelfactor = 1.1, specular = 0.9, scattering = 0.8, lensflare = 0, lifetime = 0, sustain = 0, selfshadowing = 0 }, +} local crystalColors = { -- note that the underscores are needed here - [""] = {0.78,0.46,0.94,0.11}, -- same as violet - _violet = {0.8,0.5,0.95,0.33}, - _blue = {0.1,0.2,0.9,0.33}, - _green = {0.1,0.8,0.1,0.15}, - _lime = {0.4,1,0.2,0.15}, - _obsidian = {0.3,0.2,0.2,0.33}, - _quartz = {0.3,0.3,0.5,0.33}, - _orange = {1,0.5,0,0.11}, - _red = {1,0.2,0.2,0.067}, - _teal = {0,1,1,0.15}, - _team = {1,1,1,0.15}, - } + [""] = { 0.78, 0.46, 0.94, 0.11 }, -- same as violet + _violet = { 0.8, 0.5, 0.95, 0.33 }, + _blue = { 0.1, 0.2, 0.9, 0.33 }, + _green = { 0.1, 0.8, 0.1, 0.15 }, + _lime = { 0.4, 1, 0.2, 0.15 }, + _obsidian = { 0.3, 0.2, 0.2, 0.33 }, + _quartz = { 0.3, 0.3, 0.5, 0.33 }, + _orange = { 1, 0.5, 0, 0.11 }, + _red = { 1, 0.2, 0.2, 0.067 }, + _teal = { 0, 1, 1, 0.15 }, + _team = { 1, 1, 1, 0.15 }, +} for colorname, colorvalues in pairs(crystalColors) do - for size = 1,3 do - local crystaldefname = 'pilha_crystal' .. colorname .. tostring(size) + for size = 1, 3 do + local crystaldefname = "pilha_crystal" .. colorname .. tostring(size) if FeatureDefNames[crystaldefname] then local crystalLight = table.copy(crystalLightBase) crystalLight.lightConfig.r = colorvalues[1] @@ -40272,15 +26258,14 @@ for colorname, colorvalues in pairs(crystalColors) do crystalLight.lightConfig.b = colorvalues[3] crystalLight.lightConfig.a = colorvalues[4] - crystalLight.lightConfig.color2r = colorvalues[1] * 0.6 - crystalLight.lightConfig.color2g = colorvalues[2] * 0.6 - crystalLight.lightConfig.color2b = colorvalues[3] * 0.6 + crystalLight.lightConfig.color2r = colorvalues[1] * 0.6 + crystalLight.lightConfig.color2g = colorvalues[2] * 0.6 + crystalLight.lightConfig.color2b = colorvalues[3] * 0.6 crystalLight.lightConfig.colortime = 0.002 + 0.01 / size - crystalLight.lightConfig.radius = (size + 0.2) * (crystalLight.lightConfig.radius * 0.6) crystalLight.lightConfig.posy = (size + 1.5) * crystalLight.lightConfig.posy - featureDefLights[FeatureDefNames[crystaldefname].id] = {crystalLight = crystalLight} + featureDefLights[FeatureDefNames[crystaldefname].id] = { crystalLight = crystalLight } end end end @@ -40291,16 +26276,11 @@ if day <= 25 then fraction = fraction + (25 - day) end local xmaslightbase = { - fraction = fraction, - lightType = 'point', - lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, - color2r = 0, color2g = 0, color2b = 0, colortime = 0.1, - r = 1, g = 1, b = 1, a = 0.12, - modelfactor = 1.1, specular = 0.9, scattering = 4.5, lensflare = 20, - lifetime = 0, sustain = 0, selfshadowing = 0}, + fraction = fraction, + lightType = "point", + lightConfig = { posx = 0, posy = 0, posz = 0, radius = 5, color2r = 0, color2g = 0, color2b = 0, colortime = 0.1, r = 1, g = 1, b = 1, a = 0.12, modelfactor = 1.1, specular = 0.9, scattering = 4.5, lensflare = 20, lifetime = 0, sustain = 0, selfshadowing = 0 }, } - -- Supreme Isthmus Winter 1.8.2 -- Ascendancy 2.2 -- Avalanche 3.4 @@ -40313,16 +26293,16 @@ local xmaslightbase = { -- Ice Scream v2.5.1 -- add colorful xmas lights to a percentage of certain snowy trees if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("%d") <= "26" - local snowy_tree_keys = {allpinesb_ad0 = 60, __tree_fir_tall_3 = 60, __tree_fir_ = 60} + local snowy_tree_keys = { allpinesb_ad0 = 60, __tree_fir_tall_3 = 60, __tree_fir_ = 60 } local xmasColors = { - [1] = {234,13,13}, -- red - [2] = {251,11,36}, -- orange - [3] = {251,242,26}, -- yellow - [4] = {36, 208, 36}, -- green - [5] = {10,83, 222}, -- blue + [1] = { 234, 13, 13 }, -- red + [2] = { 251, 11, 36 }, -- orange + [3] = { 251, 242, 26 }, -- yellow + [4] = { 36, 208, 36 }, -- green + [5] = { 10, 83, 222 }, -- blue } - for featureDefID , featureDef in pairs(FeatureDefs) do + for featureDefID, featureDef in pairs(FeatureDefs) do local featureName = featureDef.name -- Check if its a snowy tree: -- estimate its height/ radius via model extrema @@ -40336,10 +26316,10 @@ if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("% local maxx = featureDef.model.maxx local maxz = featureDef.model.maxz - for i= 1, count do + for i = 1, count do local xmaslight = table.copy(xmaslightbase) - local y = maxy * (math.random() * 0.8 + 0.1) + local y = maxy * (math.random() * 0.8 + 0.1) local rely = 1.0 - y / maxy local x = rely * maxx * (math.random() - 0.5) * 1.5 @@ -40355,10 +26335,9 @@ if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("% xmaslight.lightConfig.g = xmasColors[color][2] / 255 xmaslight.lightConfig.b = xmasColors[color][3] / 255 - xmaslight.lightConfig.color2r = xmasColors[color+1][1] /255 - xmaslight.lightConfig.color2g = xmasColors[color+1][2] /255 - xmaslight.lightConfig.color2b = xmasColors[color+1][3] /255 - + xmaslight.lightConfig.color2r = xmasColors[color + 1][1] / 255 + xmaslight.lightConfig.color2g = xmasColors[color + 1][2] / 255 + xmaslight.lightConfig.color2b = xmasColors[color + 1][3] / 255 --[[ @@ -40369,12 +26348,12 @@ if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("% xmaslight.lightConfig.color2r = math.random() > 0.5 and 1 or 0 xmaslight.lightConfig.color2g = math.random()> 0.5 and 1 or 0 xmaslight.lightConfig.color2b = math.random()> 0.5 and 1 or 0 - ]]-- - - xmaslight.lightConfig.colortime = 0.005 + math.random()* 0.005 + ]] + -- - featureDefLights[featureDefID]['xmaslight' .. tostring(i)] = xmaslight + xmaslight.lightConfig.colortime = 0.005 + math.random() * 0.005 + featureDefLights[featureDefID]["xmaslight" .. tostring(i)] = xmaslight end break end @@ -40382,7 +26361,7 @@ if Spring.Utilities.Gametype.GetCurrentHolidays()["xmas"] then --and os.date("% end end -local allLights = {unitEventLights = unitEventLights, unitDefLights = unitDefLights, featureDefLights = featureDefLights} +local allLights = { unitEventLights = unitEventLights, unitDefLights = unitDefLights, featureDefLights = featureDefLights } ----------------- Debugging code to do the reverse dump --------------- --[[ @@ -40423,11 +26402,9 @@ for typename, typetable in pairs(allLights) do end end end -]]-- +]] +-- -- Icexuick Check-list - return allLights - - diff --git a/luaui/configs/DistortionGL4Config.lua b/luaui/configs/DistortionGL4Config.lua index eb7b522e76b..c639e31e8d2 100644 --- a/luaui/configs/DistortionGL4Config.lua +++ b/luaui/configs/DistortionGL4Config.lua @@ -5,9 +5,8 @@ -- nanolasers should also be here -- (c) Beherith (mysterme@gmail.com) - local exampleDistortion = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam -- if pieceName == nil then the distortion is treated as WORLD-SPACE -- if pieceName == valid piecename, then the distortion is attached to that piece -- if pieceName == invalid piecename, then the distortion is attached to base of unit @@ -17,12 +16,22 @@ local exampleDistortion = { -- Distortions that should spawn even if they are outside of view need this set: alwaysVisible = nil, distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 100, + posx = 0, + posy = 0, + posz = 0, + radius = 100, -- cone distortions only, specify direction and half-angle in radians: - dirx = 0, diry = 0, dirz = 1, theta = 0.5, + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.5, -- beam distortions only, specifies the endpoint of the beam: - pos2x = 100, pos2y = 100, pos2z = 100, - lifeTime = 0, sustain = 1, selfshadowing = 0 + pos2x = 100, + pos2y = 100, + pos2z = 100, + lifeTime = 0, + sustain = 1, + selfshadowing = 0, }, } @@ -41,352 +50,224 @@ local unitDistortions = { -- }, -- }, - ['armcom'] = { + ["armcom"] = { distortion = { - distortionType = 'point', - pieceName = 'biggun', - distortionConfig = { posx = 0, posy = -12, posz = -1, radius = 4.3, - noiseStrength = 0.8, noiseScaleSpace = 1.8, distanceFalloff = 0.5, - lifeTime = 0, rampUp = 30, decay = -1.2, - effectType = 0}, + distortionType = "point", + pieceName = "biggun", + distortionConfig = { posx = 0, posy = -12, posz = -1, radius = 4.3, noiseStrength = 0.8, noiseScaleSpace = 1.8, distanceFalloff = 0.5, lifeTime = 0, rampUp = 30, decay = -1.2, effectType = 0 }, }, }, - ['corcom'] = { + ["corcom"] = { distortion = { - distortionType = 'point', - pieceName = 'biggun', - distortionConfig = { posx = 0, posy = -4.9, posz = 16, radius = 2.7, - noiseStrength = 2, noiseScaleSpace = -1.6, distanceFalloff = 0.5, - windAffected = -0.5, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "biggun", + distortionConfig = { posx = 0, posy = -4.9, posz = 16, radius = 2.7, noiseStrength = 2, noiseScaleSpace = -1.6, distanceFalloff = 0.5, windAffected = -0.5, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armmakr'] = { + ["armmakr"] = { distortion = { - distortionType = 'point', - pieceName = 'light', - distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 18, - noiseStrength = 0.6, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - lifeTime = 0, rampUp = 30, decay = -1.2, - effectType = 0}, + distortionType = "point", + pieceName = "light", + distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 18, noiseStrength = 0.6, noiseScaleSpace = 1.5, distanceFalloff = 0.5, lifeTime = 0, rampUp = 30, decay = -1.2, effectType = 0 }, }, }, - ['cormakr'] = { + ["cormakr"] = { distortion = { - distortionType = 'point', - pieceName = 'light', - distortionConfig = { posx = 0, posy = 3, posz = 0, radius = 16, - noiseStrength = 0.6, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - lifeTime = 0, rampUp = 30, decay = -1.2, - effectType = 0}, + distortionType = "point", + pieceName = "light", + distortionConfig = { posx = 0, posy = 3, posz = 0, radius = 16, noiseStrength = 0.6, noiseScaleSpace = 1.5, distanceFalloff = 0.5, lifeTime = 0, rampUp = 30, decay = -1.2, effectType = 0 }, }, }, - ['armmmkr'] = { + ["armmmkr"] = { distortion = { - distortionType = 'point', - pieceName = 'light', - distortionConfig = { posx = 0, posy = -3, posz = 0, radius = 24, - noiseStrength = 0.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, - lifeTime = 0, rampUp = 30, decay = -1.2, - effectType = 0}, + distortionType = "point", + pieceName = "light", + distortionConfig = { posx = 0, posy = -3, posz = 0, radius = 24, noiseStrength = 0.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, lifeTime = 0, rampUp = 30, decay = -1.2, effectType = 0 }, }, }, - ['cormmkr'] = { + ["cormmkr"] = { distortion = { - distortionType = 'point', - pieceName = 'light', - distortionConfig = { posx = 0, posy = -1, posz = 0, radius = 18, - noiseStrength = 0.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, - lifeTime = 0, rampUp = 30, decay = -1.2, - effectType = 0}, + distortionType = "point", + pieceName = "light", + distortionConfig = { posx = 0, posy = -1, posz = 0, radius = 18, noiseStrength = 0.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, lifeTime = 0, rampUp = 30, decay = -1.2, effectType = 0 }, }, }, - ['armestor'] = { + ["armestor"] = { distortion = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = -6.5, posz = 0.01, radius = 23, - pos2x = 0, pos2y = 15, pos2z = 0, radius2 = 23, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = -6.5, posz = 0.01, radius = 23, pos2x = 0, pos2y = 15, pos2z = 0, radius2 = 23, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['armvang'] = { + ["armvang"] = { distortion = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 2.0, posy = 5, posz = -12, radius = 2.4, - pos2x = -2.0, pos2y = 5, pos2z = -12, radius2 = 23, - noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 30, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 2.0, posy = 5, posz = -12, radius = 2.4, pos2x = -2.0, pos2y = 5, pos2z = -12, radius2 = 23, noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 30, decay = 0, lifeTime = 0, effectType = 0 }, }, }, - ['corcat'] = { + ["corcat"] = { distortionl = { - distortionType = 'point', - pieceName = 'lturret', - distortionConfig = { posx = 14, posy = 13, posz = 3, radius = 5, - noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 30, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "lturret", + distortionConfig = { posx = 14, posy = 13, posz = 3, radius = 5, noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 30, decay = 0, lifeTime = 0, effectType = 0 }, }, distortionr = { - distortionType = 'point', - pieceName = 'rturret', - distortionConfig = { posx = -14, posy = 13, posz = 3, radius = 5, - noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 30, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "rturret", + distortionConfig = { posx = -14, posy = 13, posz = 3, radius = 5, noiseStrength = 0.7, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 30, decay = 0, lifeTime = 0, effectType = 0 }, }, }, - ['armthor'] = { + ["armthor"] = { distortionbackenergy = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -4, posy = 14, posz = -25, radius = 9, - pos2x = 4, pos2y = 14, pos2z = -25, - noiseStrength = 0.5, noiseScaleSpace = -1.5, distanceFalloff = 0.8, - rampUp = 30, decay = 5, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -4, posy = 14, posz = -25, radius = 9, pos2x = 4, pos2y = 14, pos2z = -25, noiseStrength = 0.5, noiseScaleSpace = -1.5, distanceFalloff = 0.8, rampUp = 30, decay = 5, lifeTime = 0, effectType = 0 }, }, distortionbarrell = { - distortionType = 'beam', - pieceName = 'ltbarrel', - distortionConfig = { posx = 0, posy = 0, posz = -8, radius = 6, - pos2x = 0, pos2y = 0, pos2z = -9, - noiseStrength = 0.7, noiseScaleSpace = -2.5, distanceFalloff = 0.8, - rampUp = 0, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "ltbarrel", + distortionConfig = { posx = 0, posy = 0, posz = -8, radius = 6, pos2x = 0, pos2y = 0, pos2z = -9, noiseStrength = 0.7, noiseScaleSpace = -2.5, distanceFalloff = 0.8, rampUp = 0, decay = 0, lifeTime = 0, effectType = 0 }, }, distortionbarrelr = { - distortionType = 'beam', - pieceName = 'rtbarrel', - distortionConfig = { posx = 0, posy = 0, posz = -8, radius = 6, - pos2x = 0, pos2y = 0, pos2z = -9, - noiseStrength = 0.7, noiseScaleSpace = -2.5, distanceFalloff = 0.8, - rampUp = 0, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "rtbarrel", + distortionConfig = { posx = 0, posy = 0, posz = -8, radius = 6, pos2x = 0, pos2y = 0, pos2z = -9, noiseStrength = 0.7, noiseScaleSpace = -2.5, distanceFalloff = 0.8, rampUp = 0, decay = 0, lifeTime = 0, effectType = 0 }, }, }, - ['armlship'] = { + ["armlship"] = { distortion1 = { - distortionType = 'beam', - pieceName = 'turret', - distortionConfig = { posx = 3, posy = 9.0, posz = 0, radius = 2,4, - pos2x = 3, pos2y = 9.0, pos2z = -5, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "turret", + distortionConfig = { posx = 3, posy = 9.0, posz = 0, radius = 2, 4, pos2x = 3, pos2y = 9.0, pos2z = -5, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, distortion2 = { - distortionType = 'beam', - pieceName = 'turret', - distortionConfig = { posx = -3, posy = 9.0, posz = 0, radius = 2.4, - pos2x = -3, pos2y = 9.0, pos2z = -5, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "turret", + distortionConfig = { posx = -3, posy = 9.0, posz = 0, radius = 2.4, pos2x = -3, pos2y = 9.0, pos2z = -5, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['corfship'] = { + ["corfship"] = { distortionflame = { - distortionType = 'beam', - pieceName = 'sleeve', - distortionConfig = { posx = 0, posy = 0, posz = 22, radius = 4, - pos2x = 0, pos2y = 0, pos2z = 19, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, - rampUp = 0, decay = -1.5, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "sleeve", + distortionConfig = { posx = 0, posy = 0, posz = 22, radius = 4, pos2x = 0, pos2y = 0, pos2z = 19, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 0.8, rampUp = 0, decay = -1.5, lifeTime = 0, effectType = 0 }, }, }, - ['armantiship'] = { + ["armantiship"] = { distortionback1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -10, posy = 10, posz = -50, radius = 13, - pos2x = 10, pos2y = 10, pos2z = -50.1, radius2 = 23, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -10, posy = 10, posz = -50, radius = 13, pos2x = 10, pos2y = 10, pos2z = -50.1, radius2 = 23, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, distortionback2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -10, posy = 10, posz = -33, radius = 13, - pos2x = 10, pos2y = 10, pos2z = -33, radius2 = 23, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -10, posy = 10, posz = -33, radius = 13, pos2x = 10, pos2y = 10, pos2z = -33, radius2 = 23, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['armuwadves'] = { + ["armuwadves"] = { distortion1 = { - distortionType = 'beam', - pieceName = 'emit1', - distortionConfig = { posx = 0, posy = -20, posz = 0.01, radius = 20, - pos2x = 0, pos2y = -5, pos2z = 0, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "emit1", + distortionConfig = { posx = 0, posy = -20, posz = 0.01, radius = 20, pos2x = 0, pos2y = -5, pos2z = 0, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, distortion2 = { - distortionType = 'beam', - pieceName = 'emit2', - distortionConfig = { posx = 0, posy = -20, posz = 0.01, radius = 20, - pos2x = 0, pos2y = -5, pos2z = 0, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "emit2", + distortionConfig = { posx = 0, posy = -20, posz = 0.01, radius = 20, pos2x = 0, pos2y = -5, pos2z = 0, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['corestor'] = { + ["corestor"] = { distortion = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 0, posz = 0.01, radius = 28, - pos2x = 0, pos2y = 20, pos2z = 0, radius2 = 28, - noiseStrength = 0.7, noiseScaleSpace = -1.3, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, - + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = 0, posz = 0.01, radius = 28, pos2x = 0, pos2y = 20, pos2z = 0, radius2 = 28, noiseStrength = 0.7, noiseScaleSpace = -1.3, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['coruwadves'] = { + ["coruwadves"] = { distortion = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 0, posz = 0.01, radius = 40, - pos2x = 0, pos2y = 25, pos2z = 0, radius2 = 40, - noiseStrength = 0.5, noiseScaleSpace = -1.4, distanceFalloff = 0.8, - rampUp = 30, decay = -1.3, - lifeTime = 0, effectType = 0}, - + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = 0, posz = 0.01, radius = 40, pos2x = 0, pos2y = 25, pos2z = 0, radius2 = 40, noiseStrength = 0.5, noiseScaleSpace = -1.4, distanceFalloff = 0.8, rampUp = 30, decay = -1.3, lifeTime = 0, effectType = 0 }, }, }, - ['armguard'] = { + ["armguard"] = { sleeve1 = { - distortionType = 'beam', - pieceName = 'sleeves', - distortionConfig = { posx = 3.5, posy = 2, posz = 16.3, radius = 5, - pos2x = 3.5, pos2y = 2, pos2z = 9, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "sleeves", + distortionConfig = { posx = 3.5, posy = 2, posz = 16.3, radius = 5, pos2x = 3.5, pos2y = 2, pos2z = 9, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -2, lifeTime = 0, effectType = 0 }, }, sleeve2 = { - distortionType = 'beam', - pieceName = 'sleeves', - distortionConfig = { posx = -3.5, posy = 2, posz = 16.3, radius = 5, - pos2x = -3.5, pos2y = 2, pos2z = 9, - noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, - rampUp = 30, decay = -2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "sleeves", + distortionConfig = { posx = -3.5, posy = 2, posz = 16.3, radius = 5, pos2x = -3.5, pos2y = 2, pos2z = 9, noiseStrength = 0.5, noiseScaleSpace = -1, distanceFalloff = 0.8, rampUp = 30, decay = -2, lifeTime = 0, effectType = 0 }, }, }, - ['armbull'] = { + ["armbull"] = { distortion = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 20, posz = -10, radius = 20, - noiseStrength = 0.3, noiseScaleSpace = -2, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 20, posz = -10, radius = 20, noiseStrength = 0.3, noiseScaleSpace = -2, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armvp'] = { + ["armvp"] = { heatvent1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -32, posy = 26, posz = -11.5, radius = 5, - pos2x = -32, pos2y = 32, pos2z = -11.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -32, posy = 26, posz = -11.5, radius = 5, pos2x = -32, pos2y = 32, pos2z = -11.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatvent2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -32, posy = 26, posz = -35.5, radius = 5, - pos2x = -32, pos2y = 32, pos2z = -35.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -32, posy = 26, posz = -35.5, radius = 5, pos2x = -32, pos2y = 32, pos2z = -35.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatvent3 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 32, posy = 26, posz = -11.5, radius = 5, - pos2x = 32, pos2y = 32, pos2z = -11.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 32, posy = 26, posz = -11.5, radius = 5, pos2x = 32, pos2y = 32, pos2z = -11.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatvent4 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 32, posy = 26, posz = -35.5, radius = 5, - pos2x = 32, pos2y = 32, pos2z = -35.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 32, posy = 26, posz = -35.5, radius = 5, pos2x = 32, pos2y = 32, pos2z = -35.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corhal'] = { + ["corhal"] = { heatventfront1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -13, posy = -3, posz = 12, radius = 7, - pos2x = -13, pos2y = 4, pos2z = 12.1, - noiseStrength = 0.4, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -13, posy = -3, posz = 12, radius = 7, pos2x = -13, pos2y = 4, pos2z = 12.1, noiseStrength = 0.4, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 13, posy = -3, posz = 12, radius = 7, - pos2x = 13, pos2y = 4, pos2z = 12.1, - noiseStrength = 0.4, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 13, posy = -3, posz = 12, radius = 7, pos2x = 13, pos2y = 4, pos2z = 12.1, noiseStrength = 0.4, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corvp'] = { + ["corvp"] = { heatvent1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -7, posy = 30, posz = -32.5, radius = 12, - pos2x = 7, pos2y = 30, pos2z = -32.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -7, posy = 30, posz = -32.5, radius = 12, pos2x = 7, pos2y = 30, pos2z = -32.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -25.5, posy = 15, posz = 46.5, radius = 5, - pos2x = -25.5, pos2y = 24, pos2z = 51.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -25.5, posy = 15, posz = 46.5, radius = 5, pos2x = -25.5, pos2y = 24, pos2z = 51.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 25.5, posy = 15, posz = 46.5, radius = 5, - pos2x = 25.5, pos2y = 24, pos2z = 51.4, - noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 25.5, posy = 15, posz = 46.5, radius = 5, pos2x = 25.5, pos2y = 24, pos2z = 51.4, noiseStrength = 0.4, noiseScaleSpace = -3, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, -- heatvent3 = { -- distortionType = 'beam', @@ -408,160 +289,109 @@ local unitDistortions = { -- }, }, - ['armsd'] = { + ["armsd"] = { distortion = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 18, posz = -24.5, radius = 9, - noiseStrength = 0.6, noiseScaleSpace = -2, distanceFalloff = 1, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 18, posz = -24.5, radius = 9, noiseStrength = 0.6, noiseScaleSpace = -2, distanceFalloff = 1, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armanac'] = { + ["armanac"] = { fanheat1 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -8, posy = 6.5, posz = -5, radius = 2.3, - noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -8, posy = 6.5, posz = -5, radius = 2.3, noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, fanheat2 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 8, posy = 6.5, posz = -5, radius = 2.3, - noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 8, posy = 6.5, posz = -5, radius = 2.3, noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, fanheat3 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -8, posy = 6.5, posz = 4, radius = 2.3, - noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -8, posy = 6.5, posz = 4, radius = 2.3, noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, fanheat4 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 8, posy = 6.5, posz = 4, radius = 2.3, - noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 8, posy = 6.5, posz = 4, radius = 2.3, noiseStrength = 0.4, noiseScaleSpace = -8, distanceFalloff = 1, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armgeo'] = { + ["armgeo"] = { fanheat = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 50, posz = -5, radius = 20, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 50, posz = -5, radius = 20, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, barrell = { - distortionType = 'point', - pieceName = 'hotl', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6, - noiseStrength = 0.9, noiseScaleSpace = -1.7, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "hotl", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6, noiseStrength = 0.9, noiseScaleSpace = -1.7, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, barrelr = { - distortionType = 'point', - pieceName = 'hotr', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6, - noiseStrength = 0.9, noiseScaleSpace = -1.7, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "hotr", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6, noiseStrength = 0.9, noiseScaleSpace = -1.7, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armgmm'] = { + ["armgmm"] = { fanheat = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 30, posz = 0, radius = 16, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 30, posz = 0, radius = 16, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armageo'] = { + ["armageo"] = { storageheatcenter = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 30, posz = 0, radius = 12, - pos2x = 0, pos2y = 45, pos2z = 0.1, - noiseStrength = 0.5, noiseScaleSpace = -1.4, distanceFalloff = 0.8, - rampUp = 30, decay = 0, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = 30, posz = 0, radius = 12, pos2x = 0, pos2y = 45, pos2z = 0.1, noiseStrength = 0.5, noiseScaleSpace = -1.4, distanceFalloff = 0.8, rampUp = 30, decay = 0, lifeTime = 0, effectType = 0 }, }, storageheat1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 5, posz = 34, radius = 17, - pos2x = 0, pos2y = 35, pos2z = 34.1, - noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = 5, posz = 34, radius = 17, pos2x = 0, pos2y = 35, pos2z = 34.1, noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, storageheat2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -29, posy = 5, posz = -16, radius = 17, - pos2x = -29, pos2y = 35, pos2z = -16.1, - noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -29, posy = 5, posz = -16, radius = 17, pos2x = -29, pos2y = 35, pos2z = -16.1, noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, storageheat3 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 29, posy = 5, posz = -16, radius = 17, - pos2x = 29, pos2y = 35, pos2z = -16.1, - noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, - rampUp = 30, decay = -1.2, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 29, posy = 5, posz = -16, radius = 17, pos2x = 29, pos2y = 35, pos2z = -16.1, noiseStrength = 0.6, noiseScaleSpace = -1.4, distanceFalloff = 0.8, rampUp = 30, decay = -1.2, lifeTime = 0, effectType = 0 }, }, }, - ['corkarg'] = { + ["corkarg"] = { engineheatr = { - distortionType = 'point', - pieceName = 'turret', - distortionConfig = { posx = -24.4, posy = 13, posz = 10.5, radius = 4, - noiseStrength = 0.5, noiseScaleSpace = 2, distanceFalloff = 0.8, - windAffected = -0.5, riseRate = -2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "turret", + distortionConfig = { posx = -24.4, posy = 13, posz = 10.5, radius = 4, noiseStrength = 0.5, noiseScaleSpace = 2, distanceFalloff = 0.8, windAffected = -0.5, riseRate = -2, lifeTime = 0, effectType = "heatDistortion" }, }, engineheatl = { - distortionType = 'point', - pieceName = 'turret', - distortionConfig = { posx = 24.4, posy = 13, posz = 10.5, radius = 4, - noiseStrength = 0.5, noiseScaleSpace = 2, distanceFalloff = 0.8, - windAffected = -0.5, riseRate = -2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "turret", + distortionConfig = { posx = 24.4, posy = 13, posz = 10.5, radius = 4, noiseStrength = 0.5, noiseScaleSpace = 2, distanceFalloff = 0.8, windAffected = -0.5, riseRate = -2, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corkorg'] = { + ["corkorg"] = { engineheatr = { - distortionType = 'point', - pieceName = 'ruparm', - distortionConfig = { posx = -10, posy = -2, posz = -17, radius = 10, - noiseStrength = 0.7, noiseScaleSpace = 2, distanceFalloff = 0.8, - windAffected = -0.5, riseRate = -2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "ruparm", + distortionConfig = { posx = -10, posy = -2, posz = -17, radius = 10, noiseStrength = 0.7, noiseScaleSpace = 2, distanceFalloff = 0.8, windAffected = -0.5, riseRate = -2, lifeTime = 0, effectType = "heatDistortion" }, }, engineheatl = { - distortionType = 'point', - pieceName = 'luparm', - distortionConfig = { posx = 10, posy = -2, posz = -17, radius = 10, - noiseStrength = 0.7, noiseScaleSpace = 2, distanceFalloff = 0.8, - windAffected = -0.5, riseRate = -2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "luparm", + distortionConfig = { posx = 10, posy = -2, posz = -17, radius = 10, noiseStrength = 0.7, noiseScaleSpace = 2, distanceFalloff = 0.8, windAffected = -0.5, riseRate = -2, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['armadvsol'] = { + ["armadvsol"] = { -- magnifier = { -- distortionType = 'point', -- pieceName = 'base', @@ -571,245 +401,154 @@ local unitDistortions = { -- }, }, - ['armhawk'] = { + ["armhawk"] = { thrust = { - distortionType = 'cone', - pieceName = 'thrust', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 15.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrust", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 15.0, lifeTime = 0, effectType = 0 }, }, }, - ['armblade'] = { + ["armblade"] = { thrustdown = { - distortionType = 'cone', - pieceName = 'trust', - distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 40, - dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, - noiseStrength = 0.7, noiseScaleSpace = 1.45, distanceFalloff = 1.0, - effectStrength = 1.5, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "trust", + distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 40, dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, noiseStrength = 0.7, noiseScaleSpace = 1.45, distanceFalloff = 1.0, effectStrength = 1.5, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, - ['armbrawl'] = { + ["armbrawl"] = { thrustdown = { - distortionType = 'point', - pieceName = 'fan', - distortionConfig = { posx = 0, posy = -11, posz = 0, radius = 10, - noiseStrength = 0.7, noiseScaleSpace = -1.45, distanceFalloff = 1.2, - effectStrength = 1.5, - riseRate = -6, lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "fan", + distortionConfig = { posx = 0, posy = -11, posz = 0, radius = 10, noiseStrength = 0.7, noiseScaleSpace = -1.45, distanceFalloff = 1.2, effectStrength = 1.5, riseRate = -6, lifeTime = 0, effectType = 0 }, }, }, - ['armstil'] = { + ["armstil"] = { thrusta = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, thrustb = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, }, - ['armdfly'] = { + ["armdfly"] = { thrust1 = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = -19.8, posy = 5, posz = 64.3, radius = 40, - dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, - noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, - effectStrength = 1.2, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = -19.8, posy = 5, posz = 64.3, radius = 40, dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, effectStrength = 1.2, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust2 = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = 19.8, posy = 5, posz = 64.3, radius = 40, - dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, - noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, - effectStrength = 1.2, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = 19.8, posy = 5, posz = 64.3, radius = 40, dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, effectStrength = 1.2, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust3 = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = -19.8, posy = 5, posz = 34, radius = 40, - dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, - noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, - effectStrength = 1.2, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = -19.8, posy = 5, posz = 34, radius = 40, dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, effectStrength = 1.2, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust4 = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = 19.8, posy = 5, posz = 34, radius = 40, - dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, - noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, - effectStrength = 1.2, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = 19.8, posy = 5, posz = 34, radius = 40, dirx = 0, diry = -1, dirz = 0.1, theta = 0.8, noiseStrength = 1, noiseScaleSpace = 0.65, distanceFalloff = 1.0, effectStrength = 1.2, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, - ['armawac'] = { + ["armawac"] = { thrust = { - distortionType = 'cone', - pieceName = 'thrust', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrust", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.05, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, }, - ['armpnix'] = { + ["armpnix"] = { thrusta = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 130, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.06, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 10.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 130, dirx = 0, diry = -0, dirz = -1.0, theta = 0.06, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 10.0, lifeTime = 0, effectType = 0 }, }, thrustb = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 130, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.06, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 10.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = 0, posy = -1, posz = 20, radius = 130, dirx = 0, diry = -0, dirz = -1.0, theta = 0.06, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 10.0, lifeTime = 0, effectType = 0 }, }, }, - ['armliche'] = { + ["armliche"] = { engineheata = { - distortionType = 'point', - pieceName = 'wing1', - distortionConfig = { posx = 0, posy = 0, posz = -24, radius = 3.5, - noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, - windAffected = 1, riseRate = 0.5, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "wing1", + distortionConfig = { posx = 0, posy = 0, posz = -24, radius = 3.5, noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, windAffected = 1, riseRate = 0.5, lifeTime = 0, effectType = "heatDistortion" }, }, engineheatb = { - distortionType = 'point', - pieceName = 'wing2', - distortionConfig = { posx = 0, posy = 0, posz = -24, radius = 3.5, - noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, - windAffected = 1, riseRate = 0.5, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "wing2", + distortionConfig = { posx = 0, posy = 0, posz = -24, radius = 3.5, noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, windAffected = 1, riseRate = 0.5, lifeTime = 0, effectType = "heatDistortion" }, }, engineheatc = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 9, posz = -21, radius = 3.5, - noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, - windAffected = 1, riseRate = 0.5, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 9, posz = -21, radius = 3.5, noiseStrength = 0.8, noiseScaleSpace = 3, distanceFalloff = 0.8, windAffected = 1, riseRate = 0.5, lifeTime = 0, effectType = "heatDistortion" }, }, thrusta = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = 0, posy = -1, posz = -25, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = 0, posy = -1, posz = -25, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, thrustb = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = 0, posy = -1, posz = -25, radius = 120, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = 0, posy = -1, posz = -25, radius = 120, dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, thrustc = { - distortionType = 'cone', - pieceName = 'thrustc', - distortionConfig = { posx = 0, posy = -1, posz = 0, radius = 100, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustc", + distortionConfig = { posx = 0, posy = -1, posz = 0, radius = 100, dirx = 0, diry = -0, dirz = -1.0, theta = 0.09, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 2.0, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, }, - ['armtide'] = { + ["armtide"] = { waterflow = { - distortionType = 'beam', - pieceName = 'wheel', - distortionConfig = { posx = 0, posy = -2.2, posz = -18, radius = 12, - pos2x = 0, pos2y = -2.2, pos2z = 18, radius2 = 12, - noiseStrength = 2.5, noiseScaleSpace = 0.7, distanceFalloff = 0.75, - rampUp = 0, decay = 0, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 0}, - + distortionType = "beam", + pieceName = "wheel", + distortionConfig = { posx = 0, posy = -2.2, posz = -18, radius = 12, pos2x = 0, pos2y = -2.2, pos2z = 18, radius2 = 12, noiseStrength = 2.5, noiseScaleSpace = 0.7, distanceFalloff = 0.75, rampUp = 0, decay = 0, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = 0 }, }, }, - ['cortide'] = { + ["cortide"] = { waterflow = { - distortionType = 'beam', - pieceName = 'wheel', - distortionConfig = { posx = 0, posy = -2.2, posz = -10, radius = 22, - pos2x = 0, pos2y = -2.2, pos2z = 10, - noiseStrength = 2.5, noiseScaleSpace = 0.7, distanceFalloff = 0.75, - rampUp = 0, decay = 0, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 0}, - + distortionType = "beam", + pieceName = "wheel", + distortionConfig = { posx = 0, posy = -2.2, posz = -10, radius = 22, pos2x = 0, pos2y = -2.2, pos2z = 10, noiseStrength = 2.5, noiseScaleSpace = 0.7, distanceFalloff = 0.75, rampUp = 0, decay = 0, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = 0 }, }, }, - ['corvamp'] = { + ["corvamp"] = { thrust = { - distortionType = 'cone', - pieceName = 'thrust', - distortionConfig = { posx = 0, posy = 0, posz = 20, radius = 100, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.15, - noiseStrength = 2, noiseScaleSpace = 0.75, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrust", + distortionConfig = { posx = 0, posy = 0, posz = 20, radius = 100, dirx = 0, diry = -0, dirz = -1.0, theta = 0.15, noiseStrength = 2, noiseScaleSpace = 0.75, lifeTime = 0, effectType = 0 }, }, }, - ['armpeep'] = { + ["armpeep"] = { thrust1 = { - distortionType = 'cone', - pieceName = 'jet1', - distortionConfig = { posx = 0, posy = 0, posz = 5, radius = 130, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.08, - noiseStrength = 3, noiseScaleSpace = 0.85, distanceFalloff = 1.9, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "jet1", + distortionConfig = { posx = 0, posy = 0, posz = 5, radius = 130, dirx = 0, diry = -0, dirz = -1.0, theta = 0.08, noiseStrength = 3, noiseScaleSpace = 0.85, distanceFalloff = 1.9, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, thrust2 = { - distortionType = 'cone', - pieceName = 'jet2', - distortionConfig = { posx = 0, posy = 0, posz = 5, radius = 130, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.08, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 1.9, - effectStrength = 3.0, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "jet2", + distortionConfig = { posx = 0, posy = 0, posz = 5, radius = 130, dirx = 0, diry = -0, dirz = -1.0, theta = 0.08, noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 1.9, effectStrength = 3.0, lifeTime = 0, effectType = 0 }, }, }, @@ -845,7 +584,7 @@ local unitDistortions = { -- }, -- }, - ['armsnipe'] = { + ["armsnipe"] = { -- snipecloakbeam = { -- distortionType = 'point', -- pieceName = 'head', @@ -857,32 +596,24 @@ local unitDistortions = { -- }, }, - ['armamex'] = { + ["armamex"] = { cloakbeam = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 34, posz = 0.01, radius = 20, - pos2x = 0, pos2y = 35, pos2z = 0, - windAffected = -1, riseRate = -0.5, - noiseStrength = 2, noiseScaleSpace = 1, distanceFalloff = 0.25, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 0, posy = 34, posz = 0.01, radius = 20, pos2x = 0, pos2y = 35, pos2z = 0, windAffected = -1, riseRate = -0.5, noiseStrength = 2, noiseScaleSpace = 1, distanceFalloff = 0.25, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corvroc'] = { + ["corvroc"] = { cloakblobf = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 5.5, posy = 20.6, posz = 22.7, radius = 2.0, - lifeTime = 0, - magnificationRate = 1.2, effectType = "magnifier"}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 5.5, posy = 20.6, posz = 22.7, radius = 2.0, lifeTime = 0, magnificationRate = 1.2, effectType = "magnifier" }, }, cloakmodule1 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 5, posy = 18.5, posz = -10.2, radius = 6.0, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 5, posy = 18.5, posz = -10.2, radius = 6.0, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, -- cloakmodule2 = { -- distortionType = 'point', @@ -907,33 +638,27 @@ local unitDistortions = { -- }, }, - ['armrectr'] = { + ["armrectr"] = { cloakmodule = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 27.0, posz = -6.7, radius = 3.3, - noiseStrength = 3, noiseScaleSpace = 2.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 27.0, posz = -6.7, radius = 3.3, noiseStrength = 3, noiseScaleSpace = 2.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, }, - ['cornecro'] = { + ["cornecro"] = { cloakmodule = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 18.4, posz = -4.2, radius = 3.0, - noiseStrength = 3, noiseScaleSpace = 2.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 18.4, posz = -4.2, radius = 3.0, noiseStrength = 3, noiseScaleSpace = 2.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armmerl'] = { + ["armmerl"] = { cloakblobf = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 6.5, posy = 16.2, posz = 23.7, radius = 2.0, - lifeTime = 0, - magnificationRate = 1.2, effectType = "magnifier"}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 6.5, posy = 16.2, posz = 23.7, radius = 2.0, lifeTime = 0, magnificationRate = 1.2, effectType = "magnifier" }, }, -- cloakblobb = { -- distortionType = 'point', @@ -943,67 +668,50 @@ local unitDistortions = { -- magnificationRate = 1.6, effectType = "magnifier"}, -- }, cloakmodule1 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 16, posy = 14.5, posz = 10.7, radius = 5.0, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 16, posy = 14.5, posz = 10.7, radius = 5.0, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, cloakmodule2 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -16, posy = 14.5, posz = 10.7, radius = 5.0, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -16, posy = 14.5, posz = 10.7, radius = 5.0, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, cloakmodule3 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 16, posy = 14.5, posz = -10.7, radius = 5.0, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 16, posy = 14.5, posz = -10.7, radius = 5.0, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, cloakmodule4 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -16, posy = 14.5, posz = -10.7, radius = 5.0, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -16, posy = 14.5, posz = -10.7, radius = 5.0, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, onlyModelMap = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armmlv'] = { + ["armmlv"] = { cloakblob = { - distortionType = 'point', - pieceName = 'turret', - distortionConfig = { posx = 0, posy = 3, posz = 15, radius = 1.8, - lifeTime = 0, - magnificationRate = 0.6, effectType = "magnifier"}, + distortionType = "point", + pieceName = "turret", + distortionConfig = { posx = 0, posy = 3, posz = 15, radius = 1.8, lifeTime = 0, magnificationRate = 0.6, effectType = "magnifier" }, }, cloakblobdistort = { - distortionType = 'point', - pieceName = 'turret', - distortionConfig = { posx = 0, posy = 3, posz = 15, radius = 1.9, - noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "turret", + distortionConfig = { posx = 0, posy = 3, posz = 15, radius = 1.9, noiseStrength = 3, noiseScaleSpace = 1.5, distanceFalloff = 0.75, lifeTime = 0, effectType = 0 }, }, - }, - ['armgremlin'] = { + ["armgremlin"] = { cloakblobf = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 2.8, posz = 10.2, radius = 1.8, - lifeTime = 0, - magnificationRate = 0.6, effectType = "magnifier"}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 2.8, posz = 10.2, radius = 1.8, lifeTime = 0, magnificationRate = 0.6, effectType = "magnifier" }, }, cloakblobb = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 0, posy = 2.8, posz = -10.2, radius = 1.8, - lifeTime = 0, - magnificationRate = 1.6, effectType = "magnifier"}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 0, posy = 2.8, posz = -10.2, radius = 1.8, lifeTime = 0, magnificationRate = 1.6, effectType = "magnifier" }, }, -- cloakblobsleeve = { -- distortionType = 'point', @@ -1034,40 +742,28 @@ local unitDistortions = { -- lifeTime = 0, effectType = 0}, -- }, cloakmodule1 = { - distortionType = 'point', - pieceName = 'blleg', - distortionConfig = { posx = 2.5, posy = 4.5, posz = -3.7, radius = 4.0, - noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "blleg", + distortionConfig = { posx = 2.5, posy = 4.5, posz = -3.7, radius = 4.0, noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, cloakmodule2 = { - distortionType = 'point', - pieceName = 'frleg', - distortionConfig = { posx = -5.0, posy = 4.5, posz = 3.7, radius = 4.0, - noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "frleg", + distortionConfig = { posx = -5.0, posy = 4.5, posz = 3.7, radius = 4.0, noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, cloakmodule3 = { - distortionType = 'point', - pieceName = 'brleg', - distortionConfig = { posx = -5.0, posy = 4.5, posz = -3.7, radius = 4.0, - noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "brleg", + distortionConfig = { posx = -5.0, posy = 4.5, posz = -3.7, radius = 4.0, noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, cloakmodule4 = { - distortionType = 'point', - pieceName = 'flleg', - distortionConfig = { posx = 5.0, posy = 4.5, posz = 3.7, radius = 4.0, - noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "flleg", + distortionConfig = { posx = 5.0, posy = 4.5, posz = 3.7, radius = 4.0, noiseStrength = 3, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['armspy'] = { + ["armspy"] = { -- fullstealth = { -- distortionType = 'point', -- pieceName = 'body', @@ -1077,32 +773,23 @@ local unitDistortions = { -- lifeTime = 0, effectType = 0}, -- }, spycloakhead = { - distortionType = 'point', - pieceName = 'body', - distortionConfig = { posx = -0.3, posy = 5.7, posz = 13, radius = 4.4, - noiseStrength = 12, noiseScaleSpace = -1.7, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "body", + distortionConfig = { posx = -0.3, posy = 5.7, posz = 13, radius = 4.4, noiseStrength = 12, noiseScaleSpace = -1.7, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, spycloakpelvisr = { - distortionType = 'point', - pieceName = 'pelvis', - distortionConfig = { posx = -6.0, posy = 0, posz = 0, radius = 3.0, - noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "pelvis", + distortionConfig = { posx = -6.0, posy = 0, posz = 0, radius = 3.0, noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, spycloakpelvisl = { - distortionType = 'point', - pieceName = 'pelvis', - distortionConfig = { posx = 5.0, posy = 0, posz = 0, radius = 3.0, - noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "pelvis", + distortionConfig = { posx = 5.0, posy = 0, posz = 0, radius = 3.0, noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.75, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corspy'] = { + ["corspy"] = { -- spycloakhead = { -- distortionType = 'point', -- pieceName = 'body', @@ -1112,20 +799,14 @@ local unitDistortions = { -- lifeTime = 0, effectType = 0}, -- }, spycloakl = { - distortionType = 'point', - pieceName = 'head', - distortionConfig = { posx = -7.5, posy = 4.8, posz = 0, radius = 5.5, - noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.9, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "head", + distortionConfig = { posx = -7.5, posy = 4.8, posz = 0, radius = 5.5, noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.9, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, spycloakr = { - distortionType = 'point', - pieceName = 'head', - distortionConfig = { posx = 7.5, posy = 4.8, posz = 0, radius = 5.5, - noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.9, onlyModelMap = -1, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "head", + distortionConfig = { posx = 7.5, posy = 4.8, posz = 0, radius = 5.5, noiseStrength = 24, noiseScaleSpace = -1.5, distanceFalloff = 0.9, onlyModelMap = -1, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, }, @@ -1156,7 +837,7 @@ local unitDistortions = { -- }, -- }, - ['armveil'] = { + ["armveil"] = { -- magnifier = { -- distortionType = 'point', -- pieceName = 'base', @@ -1165,276 +846,187 @@ local unitDistortions = { -- magnificationRate = 10.0, effectType = "magnifier"}, -- }, jamdistortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 18, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armjam'] = { + ["armjam"] = { jamdistortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = -12, posz = 0, radius = 10, - noiseStrength = 20, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = -12, posz = 0, radius = 10, noiseStrength = 20, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['coreter'] = { + ["coreter"] = { jamdistortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = -3, radius = 11, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.2, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = -3, radius = 11, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.2, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corshroud'] = { + ["corshroud"] = { jamdistortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 18, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 18, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corap'] = { + ["corap"] = { heatvent1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -43, posy = 28, posz = 16.5, radius = 8, - pos2x = -43, pos2y = 35, pos2z = 16.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -43, posy = 28, posz = 16.5, radius = 8, pos2x = -43, pos2y = 35, pos2z = 16.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corpyro'] = { + ["corpyro"] = { flameheat = { - distortionType = 'beam', - pieceName = 'lloarm', - distortionConfig = { posx = 0, posy = -0.4, posz = 17, radius = 5.5, - pos2x = 0, pos2y = -0.4, pos2z = 18, - noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, - effectStrength = 1.0, - windAffected = 0.5, riseRate = 1.2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "lloarm", + distortionConfig = { posx = 0, posy = -0.4, posz = 17, radius = 5.5, pos2x = 0, pos2y = -0.4, pos2z = 18, noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, effectStrength = 1.0, windAffected = 0.5, riseRate = 1.2, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['cordemon'] = { + ["cordemon"] = { flameheatl = { - distortionType = 'beam', - pieceName = 'lfbarrel1', - distortionConfig = { posx = -2, posy = -0.4, posz = 5, radius = 8.5, - pos2x = -2, pos2y = -0.4, pos2z = 6, - noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, - effectStrength = 1.0, - windAffected = 0.5, riseRate = 1.2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "lfbarrel1", + distortionConfig = { posx = -2, posy = -0.4, posz = 5, radius = 8.5, pos2x = -2, pos2y = -0.4, pos2z = 6, noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, effectStrength = 1.0, windAffected = 0.5, riseRate = 1.2, lifeTime = 0, effectType = "heatDistortion" }, }, flameheatr = { - distortionType = 'beam', - pieceName = 'rfbarrel1', - distortionConfig = { posx = -2, posy = -0.4, posz = 5, radius = 8.5, - pos2x = -2, pos2y = -0.4, pos2z = 6, - noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, - effectStrength = 1.0, - windAffected = 0.5, riseRate = 1.2, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "rfbarrel1", + distortionConfig = { posx = -2, posy = -0.4, posz = 5, radius = 8.5, pos2x = -2, pos2y = -0.4, pos2z = 6, noiseStrength = 1.0, noiseScaleSpace = -2.0, distanceFalloff = 1.5, effectStrength = 1.0, windAffected = 0.5, riseRate = 1.2, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corint'] = { + ["corint"] = { heatvent1 = { - distortionType = 'beam', - pieceName = 'gun', - distortionConfig = { posx = 0, posy = 20, posz = -14.5, radius = 8, - pos2x = 0, pos2y = 26, pos2z = -14.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "gun", + distortionConfig = { posx = 0, posy = 20, posz = -14.5, radius = 8, pos2x = 0, pos2y = 26, pos2z = -14.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['coravp'] = { + ["coravp"] = { factoryheat = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -7, posy = 40, posz = -35, radius = 12, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -7, posy = 40, posz = -35, radius = 12, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, lifeTime = 0, effectType = "heatDistortion" }, }, factoryheat2 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 7, posy = 40, posz = -35, radius = 12, - noiseStrength = 0.6, noiseScaleSpace = -1.9, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 7, posy = 40, posz = -35, radius = 12, noiseStrength = 0.6, noiseScaleSpace = -1.9, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, factoryheatback1 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -55, posy = 12, posz = -42, radius = 9, - noiseStrength = 0.9, noiseScaleSpace = -2.9, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -55, posy = 12, posz = -42, radius = 9, noiseStrength = 0.9, noiseScaleSpace = -2.9, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, factoryheatback2 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 55, posy = 12, posz = -42, radius = 9, - noiseStrength = 0.9, noiseScaleSpace = -2.9, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 55, posy = 12, posz = -42, radius = 9, noiseStrength = 0.9, noiseScaleSpace = -2.9, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corgant'] = { + ["corgant"] = { factoryheat1 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = -60, posy = 55, posz = -51, radius = 20, - noiseStrength = 0.6, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = -60, posy = 55, posz = -51, radius = 20, noiseStrength = 0.6, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, lifeTime = 0, effectType = "heatDistortion" }, }, factoryheat2 = { - distortionType = 'point', - pieceName = 'base', - distortionConfig = { posx = 60, posy = 55, posz = -51, radius = 20, - noiseStrength = 0.6, noiseScaleSpace = -1.9, distanceFalloff = 1.4, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "point", + pieceName = "base", + distortionConfig = { posx = 60, posy = 55, posz = -51, radius = 20, noiseStrength = 0.6, noiseScaleSpace = -1.9, distanceFalloff = 1.4, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront1 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 54, posy = 60, posz = 5.5, radius = 10, - pos2x = 54, pos2y = 60, pos2z = 22.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 54, posy = 60, posz = 5.5, radius = 10, pos2x = 54, pos2y = 60, pos2z = 22.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront1B = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 83, posy = 60, posz = 5.5, radius = 10, - pos2x = 83, pos2y = 60, pos2z = 22.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 83, posy = 60, posz = 5.5, radius = 10, pos2x = 83, pos2y = 60, pos2z = 22.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront2 = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -54, posy = 60, posz = 5.5, radius = 10, - pos2x = -54, pos2y = 60, pos2z = 22.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -54, posy = 60, posz = 5.5, radius = 10, pos2x = -54, pos2y = 60, pos2z = 22.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, heatventfront2B = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -83, posy = 60, posz = 5.5, radius = 10, - pos2x = -83, pos2y = 60, pos2z = 22.4, - noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, - windAffected = -1, riseRate = 1, - lifeTime = 0, effectType = 'heatDistortion'}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -83, posy = 60, posz = 5.5, radius = 10, pos2x = -83, pos2y = 60, pos2z = 22.4, noiseStrength = 0.5, noiseScaleSpace = -2, distanceFalloff = 1.4, windAffected = -1, riseRate = 1, lifeTime = 0, effectType = "heatDistortion" }, }, }, - ['corfus'] = { + ["corfus"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 23, - noiseStrength = 3.3, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 23, noiseStrength = 3.3, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, }, - ['corafus'] = { + ["corafus"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 38, - noiseStrength = 2.3, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 38, noiseStrength = 2.3, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, }, - ['corafust3'] = { + ["corafust3"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 72, - noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 72, noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, }, - ['legfus'] = { + ["legfus"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 25, noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, }, - ['legafus'] = { + ["legafus"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 40, - noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 40, noiseStrength = 1.5, noiseScaleSpace = 1.4, distanceFalloff = 0.5, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, }, - ['armfus'] = { + ["armfus"] = { distortion1 = { - distortionType = 'point', - pieceName = 'emit1', - distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 15, - noiseStrength = 2, noiseScaleSpace = -1.5, distanceFalloff = 0.9, - windAffected = -0.5, riseRate = -2, decay = -1.3, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit1", + distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 15, noiseStrength = 2, noiseScaleSpace = -1.5, distanceFalloff = 0.9, windAffected = -0.5, riseRate = -2, decay = -1.3, lifeTime = 0, effectType = 0 }, }, distortion2 = { - distortionType = 'point', - pieceName = 'emit2', - distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 15, - noiseStrength = 2, noiseScaleSpace = -1.2, distanceFalloff = 0.9, - windAffected = -0.5, riseRate = -2, decay = -1.3, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit2", + distortionConfig = { posx = 0, posy = -2, posz = 0, radius = 15, noiseStrength = 2, noiseScaleSpace = -1.2, distanceFalloff = 0.9, windAffected = -0.5, riseRate = -2, decay = -1.3, lifeTime = 0, effectType = 0 }, }, }, - ['armafus'] = { + ["armafus"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 31, - noiseStrength = 3, noiseScaleSpace = 2, distanceFalloff = 0.6, - windAffected = -0.5, riseRate = -0.7, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 31, noiseStrength = 3, noiseScaleSpace = 2, distanceFalloff = 0.6, windAffected = -0.5, riseRate = -0.7, lifeTime = 0, effectType = 0 }, }, -- distortion-old-ugly-icexuick = { -- distortionType = 'point', @@ -1454,38 +1046,27 @@ local unitDistortions = { -- }, }, - ['armafust3'] = { + ["armafust3"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 62, - noiseStrength = 1.8, noiseScaleSpace = 1.0, distanceFalloff = 0.6, - windAffected = -0.5, riseRate = -0.7, - effectStrength = 2.0, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 62, noiseStrength = 1.8, noiseScaleSpace = 1.0, distanceFalloff = 0.6, windAffected = -0.5, riseRate = -0.7, effectStrength = 2.0, lifeTime = 0, effectType = 0 }, }, }, - ['legafust3'] = { + ["legafust3"] = { distortion = { - distortionType = 'point', - pieceName = 'emit', - distortionConfig = { posx = 0, posy = 10, posz = 0, radius = 76, - noiseStrength = 1.8, noiseScaleSpace = 1.0, distanceFalloff = 0.6, - windAffected = -0.5, riseRate = -0.7, - effectStrength = 2.0, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "emit", + distortionConfig = { posx = 0, posy = 10, posz = 0, radius = 76, noiseStrength = 1.8, noiseScaleSpace = 1.0, distanceFalloff = 0.6, windAffected = -0.5, riseRate = -0.7, effectStrength = 2.0, lifeTime = 0, effectType = 0 }, }, }, - ['armgate'] = { + ["armgate"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 24, posz = -5, radius = 14, - noiseStrength = 1, noiseScaleSpace = 0.5, distanceFalloff = 0.3, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 24, posz = -5, radius = 14, noiseStrength = 1, noiseScaleSpace = 0.5, distanceFalloff = 0.3, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, -- cloakblob = { -- distortionType = 'point', @@ -1509,25 +1090,19 @@ local unitDistortions = { -- }, }, - ['armfgate'] = { + ["armfgate"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 25, posz = 0, radius = 16, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 25, posz = 0, radius = 16, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corgate'] = { + ["corgate"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 40, posz = 0, radius = 12, - noiseStrength = 1, noiseScaleSpace = 0.5, distanceFalloff = 0.3, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 40, posz = 0, radius = 12, noiseStrength = 1, noiseScaleSpace = 0.5, distanceFalloff = 0.3, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, -- distortionold = { -- distortionType = 'point', @@ -1539,67 +1114,48 @@ local unitDistortions = { -- }, }, - ['corfgate'] = { + ["corfgate"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 42, posz = 0, radius = 16, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 42, posz = 0, radius = 16, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corjamt'] = { + ["corjamt"] = { distortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 12, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 12, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armjamt'] = { + ["armjamt"] = { jamdistortion = { - distortionType = 'point', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 15, posz = 0, radius = 12, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, riseRate = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 15, posz = 0, radius = 12, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, riseRate = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corsjam'] = { + ["corsjam"] = { distortionbeam = { - distortionType = 'beam', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = -4, radius = 4.5, - pos2x = 0, pos2y = 0, pos2z = 4, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = -4, radius = 4.5, pos2x = 0, pos2y = 0, pos2z = 4, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['cormando'] = { + ["cormando"] = { distortionbeam = { - distortionType = 'beam', - pieceName = 'turret', - distortionConfig = { posx = 0, posy = 7, posz = 0, radius = 3.5, - pos2x = 0, pos2y = 6, pos2z = 0.1, - noiseStrength = 2, noiseScaleSpace = -1.8, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "turret", + distortionConfig = { posx = 0, posy = 7, posz = 0, radius = 3.5, pos2x = 0, pos2y = 6, pos2z = 0.1, noiseStrength = 2, noiseScaleSpace = -1.8, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, cloakblob = { - distortionType = 'point', - pieceName = 'turret', - distortionConfig = { posx = 0, posy = 6.5, posz = 0, radius = 3, - lifeTime = 0, - magnificationRate = 0.6, effectType = "magnifier"}, + distortionType = "point", + pieceName = "turret", + distortionConfig = { posx = 0, posy = 6.5, posz = 0, radius = 3, lifeTime = 0, magnificationRate = 0.6, effectType = "magnifier" }, }, -- magnifier = { -- distortionType = 'point', @@ -1610,15 +1166,11 @@ local unitDistortions = { -- }, }, - ['scavengerbossv4_normal'] = { + ["scavengerbossv4_normal"] = { distortionbeam = { - distortionType = 'point', - pieceName = 'head', - distortionConfig = { posx = 0, posy = -22, posz = 8, radius = 42, - pos2x = 0, pos2y = 6, pos2z = 0.1, - noiseStrength = 2, noiseScaleSpace = -0.6, distanceFalloff = 1.0, - windAffected = -1, effectStrength = 1.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "head", + distortionConfig = { posx = 0, posy = -22, posz = 8, radius = 42, pos2x = 0, pos2y = 6, pos2z = 0.1, noiseStrength = 2, noiseScaleSpace = -0.6, distanceFalloff = 1.0, windAffected = -1, effectStrength = 1.5, lifeTime = 0, effectType = 0 }, }, -- cloakblob = { -- distortionType = 'point', @@ -1636,28 +1188,20 @@ local unitDistortions = { -- }, }, - ['armsjam'] = { + ["armsjam"] = { distortionbeam1 = { - distortionType = 'beam', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = -15, radius = 4.5, - pos2x = 0, pos2y = 0, pos2z = -22, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = -15, radius = 4.5, pos2x = 0, pos2y = 0, pos2z = -22, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, distortionbeam2 = { - distortionType = 'beam', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 15, radius = 4.5, - pos2x = 0, pos2y = 0, pos2z = 22, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 15, radius = 4.5, pos2x = 0, pos2y = 0, pos2z = 22, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['armmark'] = { + ["armmark"] = { -- radarring = { -- distortionType = 'point', -- pieceName = 'none', @@ -1668,191 +1212,147 @@ local unitDistortions = { -- }, }, - ['armaser'] = { + ["armaser"] = { distortionbeam = { - distortionType = 'beam', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, - pos2x = -9, pos2y = 0, pos2z = 0.1, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, pos2x = -9, pos2y = 0, pos2z = 0.1, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corspec'] = { + ["corspec"] = { distortionbeam = { - distortionType = 'beam', - pieceName = 'jam', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, - pos2x = 0, pos2y = 0, pos2z = 2, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "jam", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, pos2x = 0, pos2y = 0, pos2z = 2, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['legajamk'] = { + ["legajamk"] = { legdistortionbeam = { - distortionType = 'beam', - pieceName = 'blob', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, - pos2x = 0, pos2y = 0, pos2z = 2, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "blob", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, pos2x = 0, pos2y = 0, pos2z = 2, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['legavjam'] = { + ["legavjam"] = { legdistortionbeam = { - distortionType = 'beam', - pieceName = 'cloaklight', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, - pos2x = 0, pos2y = 0, pos2z = 2, - noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, - windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "cloaklight", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 6.5, pos2x = 0, pos2y = 0, pos2z = 2, noiseStrength = 10, noiseScaleSpace = 0.4, distanceFalloff = 1.5, windAffected = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corjuno'] = { + ["corjuno"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 72, posz = 0, radius = 11, - noiseStrength = 3, noiseScaleSpace = -0.2, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 72, posz = 0, radius = 11, noiseStrength = 3, noiseScaleSpace = -0.2, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corjugg'] = { + ["corjugg"] = { distortion = { - distortionType = 'point', - pieceName = 'mainbarrel', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 3.6, - noiseStrength = 3, noiseScaleSpace = -1.6, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "mainbarrel", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 3.6, noiseStrength = 3, noiseScaleSpace = -1.6, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, cloakblob = { - distortionType = 'point', - pieceName = 'mainbarrel', - distortionConfig = { posx = 0, posy = 0, posz = 2, radius = 4.5, - lifeTime = 0, - magnificationRate = -0.2, effectType = "magnifier"}, + distortionType = "point", + pieceName = "mainbarrel", + distortionConfig = { posx = 0, posy = 0, posz = 2, radius = 4.5, lifeTime = 0, magnificationRate = -0.2, effectType = "magnifier" }, }, }, - - ['armjuno'] = { + ["armjuno"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 72, posz = 0, radius = 11, - noiseStrength = 3, noiseScaleSpace = -0.2, distanceFalloff = 0.5, - windAffected = -0.5, --riseRate = -0.9, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { + posx = 0, + posy = 72, + posz = 0, + radius = 11, + noiseStrength = 3, + noiseScaleSpace = -0.2, + distanceFalloff = 0.5, + windAffected = -0.5, --riseRate = -0.9, + lifeTime = 0, + effectType = 0, + }, }, }, - ['lootboxbronze'] = { + ["lootboxbronze"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 34, posz = 0, radius = 14, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 34, posz = 0, radius = 14, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['lootboxsilver'] = { + ["lootboxsilver"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 52, posz = 0, radius = 18, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 52, posz = 0, radius = 18, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['lootboxgold'] = { + ["lootboxgold"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 69, posz = 0, radius = 23, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 69, posz = 0, radius = 23, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['lootboxplatinum'] = { + ["lootboxplatinum"] = { distortion = { - distortionType = 'point', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 87, posz = 0, radius = 30, - noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, - windAffected = -0.5, - lifeTime = 0, effectType = 0}, + distortionType = "point", + pieceName = "none", + distortionConfig = { posx = 0, posy = 87, posz = 0, radius = 30, noiseStrength = 1, noiseScaleSpace = 1.5, distanceFalloff = 0.5, windAffected = -0.5, lifeTime = 0, effectType = 0 }, }, }, - ['armblade'] = { + ["armblade"] = { thrust = { - distortionType = 'cone', - pieceName = 'thrust', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -1, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrust", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -1, lifeTime = 0, effectType = 0 }, }, }, - ['corape'] = { + ["corape"] = { rthrust = { - distortionType = 'cone', - pieceName = 'rthrust', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "rthrust", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, lthrust = { - distortionType = 'cone', - pieceName = 'lthrust', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "lthrust", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, - ['armkam'] = { + ["armkam"] = { thrusta = { - distortionType = 'cone', - pieceName = 'thrusta', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrusta", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustb = { - distortionType = 'cone', - pieceName = 'thrustb', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustb", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, - ['legmos'] = { + ["legmos"] = { -- motionl = { --motion blur only works when unit is moving -- distortionType = 'point', -- pieceName = 'blur', @@ -1864,155 +1364,95 @@ local unitDistortions = { -- lifeTime = 0, effectType = 11}, -- }, blurl = { - distortionType = 'cone', - pieceName = 'blur', - distortionConfig = { posx = 3, posy = -1, posz = 2.5, radius = 40, - dirx = 1, diry = -0.05, dirz = 0, theta = 0.9, - distanceFalloff = 0.85, - noiseStrength = 6.1, noiseScaleSpace = 0.4, - riseRate = -8, windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "blur", + distortionConfig = { posx = 3, posy = -1, posz = 2.5, radius = 40, dirx = 1, diry = -0.05, dirz = 0, theta = 0.9, distanceFalloff = 0.85, noiseStrength = 6.1, noiseScaleSpace = 0.4, riseRate = -8, windAffected = -1, lifeTime = 0, effectType = 0 }, }, blurr = { - distortionType = 'cone', - pieceName = 'blur', - distortionConfig = { posx = -3.0, posy = -1, posz = 2.5, radius = 40, - dirx = -1, diry = -0.05, dirz = 0, theta = 0.9, - distanceFalloff = 0.85, onlyModelMap = 0, - noiseStrength = 6.1, noiseScaleSpace = 0.4, - riseRate = -8, windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "blur", + distortionConfig = { posx = -3.0, posy = -1, posz = 2.5, radius = 40, dirx = -1, diry = -0.05, dirz = 0, theta = 0.9, distanceFalloff = 0.85, onlyModelMap = 0, noiseStrength = 6.1, noiseScaleSpace = 0.4, riseRate = -8, windAffected = -1, lifeTime = 0, effectType = 0 }, }, thrustdistortion = { - distortionType = 'cone', - pieceName = 'thruster', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 25, - dirx = 0, diry = 0, dirz = -1, theta = 0.2, - distanceFalloff = 1.3, - noiseStrength = 6, noiseScaleSpace = 0.55, - riseRate = 0.5, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thruster", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 25, dirx = 0, diry = 0, dirz = -1, theta = 0.2, distanceFalloff = 1.3, noiseStrength = 6, noiseScaleSpace = 0.55, riseRate = 0.5, lifeTime = 0, effectType = 0 }, }, }, - ['legmost3'] = { + ["legmost3"] = { blurl = { - distortionType = 'cone', - pieceName = 'blur', - distortionConfig = { posx = 3, posy = -1, posz = 2.5, radius = 80, - dirx = 1, diry = 0.05, dirz = 0, theta = 0.9, - distanceFalloff = 0.85, - noiseStrength = 6.1, noiseScaleSpace = 0.4, - riseRate = -8, windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "blur", + distortionConfig = { posx = 3, posy = -1, posz = 2.5, radius = 80, dirx = 1, diry = 0.05, dirz = 0, theta = 0.9, distanceFalloff = 0.85, noiseStrength = 6.1, noiseScaleSpace = 0.4, riseRate = -8, windAffected = -1, lifeTime = 0, effectType = 0 }, }, blurr = { - distortionType = 'cone', - pieceName = 'blur', - distortionConfig = { posx = -3.0, posy = -1, posz = 2.5, radius = 80, - dirx = -1, diry = 0.15, dirz = 0, theta = 0.9, - distanceFalloff = 0.85, onlyModelMap = 0, - noiseStrength = 6.1, noiseScaleSpace = 0.4, - riseRate = -8, windAffected = -1, - lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "blur", + distortionConfig = { posx = -3.0, posy = -1, posz = 2.5, radius = 80, dirx = -1, diry = 0.15, dirz = 0, theta = 0.9, distanceFalloff = 0.85, onlyModelMap = 0, noiseStrength = 6.1, noiseScaleSpace = 0.4, riseRate = -8, windAffected = -1, lifeTime = 0, effectType = 0 }, }, thrustdistortion = { - distortionType = 'cone', - pieceName = 'thrust', - distortionConfig = { posx = 2, posy = 0, posz = 14, radius = 65, - dirx = 0, diry = 0, dirz = -1, theta = 0.2, - distanceFalloff = 1.3, - noiseStrength = 6, noiseScaleSpace = 0.55, - riseRate = 0.5, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrust", + distortionConfig = { posx = 2, posy = 0, posz = 14, radius = 65, dirx = 0, diry = 0, dirz = -1, theta = 0.2, distanceFalloff = 1.3, noiseStrength = 6, noiseScaleSpace = 0.55, riseRate = 0.5, lifeTime = 0, effectType = 0 }, }, }, - ['corcrwh'] = { + ["corcrwh"] = { thrust1 = { - distortionType = 'cone', - pieceName = 'thrustrra', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustrra", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust2 = { - distortionType = 'cone', - pieceName = 'thrustrla', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustrla", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust3 = { - distortionType = 'cone', - pieceName = 'thrustfla', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustfla", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust4 = { - distortionType = 'cone', - pieceName = 'thrustfra', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustfra", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 80, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, distortionleft = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = 15, posy = 32, posz = -21, radius = 8, - pos2x = 15, pos2y = 32, pos2z = 7, radius2 = 28, - noiseStrength = 0.2, noiseScaleSpace = -2.1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.5, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = 15, posy = 32, posz = -21, radius = 8, pos2x = 15, pos2y = 32, pos2z = 7, radius2 = 28, noiseStrength = 0.2, noiseScaleSpace = -2.1, distanceFalloff = 0.8, rampUp = 30, decay = -1.5, lifeTime = 0, effectType = 0 }, }, distortionright = { - distortionType = 'beam', - pieceName = 'base', - distortionConfig = { posx = -15, posy = 32, posz = -21, radius = 8, - pos2x = -15, pos2y = 32, pos2z = 7, radius2 = 28, - noiseStrength = 0.2, noiseScaleSpace = -2.1, distanceFalloff = 0.8, - rampUp = 30, decay = -1.5, - lifeTime = 0, effectType = 0}, + distortionType = "beam", + pieceName = "base", + distortionConfig = { posx = -15, posy = 32, posz = -21, radius = 8, pos2x = -15, pos2y = 32, pos2z = 7, radius2 = 28, noiseStrength = 0.2, noiseScaleSpace = -2.1, distanceFalloff = 0.8, rampUp = 30, decay = -1.5, lifeTime = 0, effectType = 0 }, }, }, - ['corcrwt4'] = { + ["corcrwt4"] = { thrust1 = { - distortionType = 'cone', - pieceName = 'thrustrra', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustrra", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust2 = { - distortionType = 'cone', - pieceName = 'thrustrla', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustrla", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust3 = { - distortionType = 'cone', - pieceName = 'thrustfla', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustfla", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrust4 = { - distortionType = 'cone', - pieceName = 'thrustfra', - distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustfra", + distortionConfig = { posx = -2, posy = 0, posz = -2, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, -- distortionleft = { -- distortionType = 'beam', @@ -2034,75 +1474,51 @@ local unitDistortions = { -- }, }, - ['armfepocht4'] = { + ["armfepocht4"] = { thrustl1 = { - distortionType = 'cone', - pieceName = 'thrustl1', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustl1", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustl2 = { - distortionType = 'cone', - pieceName = 'thrustl2', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustl2", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustr1 = { - distortionType = 'cone', - pieceName = 'thrustr1', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustr1", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustr2 = { - distortionType = 'cone', - pieceName = 'thrustr2', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustr2", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, - ['corfblackhyt4'] = { + ["corfblackhyt4"] = { thrustl1 = { - distortionType = 'cone', - pieceName = 'thrustl1', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustl1", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustl2 = { - distortionType = 'cone', - pieceName = 'thrustl2', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustl2", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustr1 = { - distortionType = 'cone', - pieceName = 'thrustr1', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustr1", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, thrustr2 = { - distortionType = 'cone', - pieceName = 'thrustr2', - distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, - dirx = 0, diry = 0, dirz = -1, theta = 0.4, - noiseStrength = 1, noiseScaleSpace = 0.65, - riseRate = -8, lifeTime = 0, effectType = 0}, + distortionType = "cone", + pieceName = "thrustr2", + distortionConfig = { posx = -2, posy = 0, posz = 8, radius = 120, dirx = 0, diry = 0, dirz = -1, theta = 0.4, noiseStrength = 1, noiseScaleSpace = 0.65, riseRate = -8, lifeTime = 0, effectType = 0 }, }, }, } @@ -2113,11 +1529,23 @@ local airjets_effects = VFS.Include("luaui/configs/airjet_effects.lua") --}, do -- This is the base effect for the airjet distortion, tune it to affect all airjets - local longAirJet = { posx = 0, posy = 0, posz = 0, radius = 130, - dirx = 0, diry = -0, dirz = -1.0, theta = 0.08, - noiseStrength = 2, noiseScaleSpace = 0.85, distanceFalloff = 1.5, - effectStrength = 4.0, onlyModelMap = 0, -- I want it on unit and background too - lifeTime = 0, effectType = 0} + local longAirJet = { + posx = 0, + posy = 0, + posz = 0, + radius = 130, + dirx = 0, + diry = -0, + dirz = -1.0, + theta = 0.08, + noiseStrength = 2, + noiseScaleSpace = 0.85, + distanceFalloff = 1.5, + effectStrength = 4.0, + onlyModelMap = 0, -- I want it on unit and background too + lifeTime = 0, + effectType = 0, + } for unitDefName, airjets in pairs(airjets_effects) do if not unitDistortions[unitDefName] then @@ -2134,8 +1562,7 @@ do end end if not alreadyhasjet then - - local effectname = 'airjet' .. tostring(i) .. airjet.piece + local effectname = "airjet" .. tostring(i) .. airjet.piece local airjetConfig = table.copy(longAirJet) -- The radius and cone angle are set to be close to the airjet length and width @@ -2145,21 +1572,19 @@ do --Spring.Echo("airjetConfig.theta", airjetConfig.theta, airjet.width, airjet.length) - unitDistortions[unitDefName][effectname] = { - distortionType = 'cone', + distortionType = "cone", pieceName = airjet.piece, distortionConfig = airjetConfig, } end end - end end -- Effect duplications: -unitDistortions['armdecom'] = unitDistortions['armcom'] -unitDistortions['corgantuw'] = unitDistortions['corgant'] +unitDistortions["armdecom"] = unitDistortions["armcom"] +unitDistortions["corgantuw"] = unitDistortions["corgant"] local unitEventDistortionsNames = { ------------------------------------ Put distortions that are slaved to ProjectileCreated here! --------------------------------- @@ -2196,132 +1621,235 @@ local unitEventDistortionsNames = { UnitScriptDistortions = { - ['corkorg'] = { + ["corkorg"] = { [1] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'corkorgfootstep', - pieceName = 'none', - distortionConfig = { posx = 0, posy = 0, posz = 8, radius = 120, - noiseStrength = 1.2, noiseScaleSpace = 0.5, distanceFalloff = 0.4, onlyModelMap = 1, - effectStrength = 1.0, --needed for shockwave - lifeTime = 25, rampUp = 3, decay = 15, startRadius = 0.3, - shockWidth = 5, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "corkorgfootstep", + pieceName = "none", + distortionConfig = { + posx = 0, + posy = 0, + posz = 8, + radius = 120, + noiseStrength = 1.2, + noiseScaleSpace = 0.5, + distanceFalloff = 0.4, + onlyModelMap = 1, + effectStrength = 1.0, --needed for shockwave + lifeTime = 25, + rampUp = 3, + decay = 15, + startRadius = 0.3, + shockWidth = 5, + effectType = "groundShockwave", + }, }, }, - ['corsumo'] = { + ["corsumo"] = { [1] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'corsumofootstepfl', - pieceName = 'footfl', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - noiseStrength = 0.35, noiseScaleSpace = 0.9, distanceFalloff = 0.7, onlyModelMap = 1, - effectStrength = 0.8, refractiveIndex = -1.02, --needed for shockwave - lifeTime = 15, rampUp = 3, decay = 10, startRadius = 0.4, - shockWidth = 0.6, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "corsumofootstepfl", + pieceName = "footfl", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 20, + noiseStrength = 0.35, + noiseScaleSpace = 0.9, + distanceFalloff = 0.7, + onlyModelMap = 1, + effectStrength = 0.8, + refractiveIndex = -1.02, --needed for shockwave + lifeTime = 15, + rampUp = 3, + decay = 10, + startRadius = 0.4, + shockWidth = 0.6, + effectType = "groundShockwave", + }, }, [2] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'corsumofootstepbr', - pieceName = 'footbr', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - noiseStrength = 0.35, noiseScaleSpace = 0.9, distanceFalloff = 0.7, onlyModelMap = 1, - effectStrength = 0.8, refractiveIndex = -1.02, --needed for shockwave - lifeTime = 15, rampUp = 3, decay = 10, startRadius = 0.4, - shockWidth = 0.6, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "corsumofootstepbr", + pieceName = "footbr", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 20, + noiseStrength = 0.35, + noiseScaleSpace = 0.9, + distanceFalloff = 0.7, + onlyModelMap = 1, + effectStrength = 0.8, + refractiveIndex = -1.02, --needed for shockwave + lifeTime = 15, + rampUp = 3, + decay = 10, + startRadius = 0.4, + shockWidth = 0.6, + effectType = "groundShockwave", + }, }, [3] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'corsumofootstepfr', - pieceName = 'footfr', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - noiseStrength = 0.35, noiseScaleSpace = 0.9, distanceFalloff = 0.7, onlyModelMap = 1, - effectStrength = 0.8, refractiveIndex = -1.02, --needed for shockwave - lifeTime = 15, rampUp = 3, decay = 10, startRadius = 0.4, - shockWidth = 0.6, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "corsumofootstepfr", + pieceName = "footfr", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 20, + noiseStrength = 0.35, + noiseScaleSpace = 0.9, + distanceFalloff = 0.7, + onlyModelMap = 1, + effectStrength = 0.8, + refractiveIndex = -1.02, --needed for shockwave + lifeTime = 15, + rampUp = 3, + decay = 10, + startRadius = 0.4, + shockWidth = 0.6, + effectType = "groundShockwave", + }, }, [4] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'corsumofootstepbl', - pieceName = 'footbl', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 20, - noiseStrength = 0.35, noiseScaleSpace = 0.9, distanceFalloff = 0.7, onlyModelMap = 1, - effectStrength = 0.8, refractiveIndex = -1.02, --needed for shockwave - lifeTime = 15, rampUp = 3, decay = 10, startRadius = 0.4, - shockWidth = 0.6, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "corsumofootstepbl", + pieceName = "footbl", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 20, + noiseStrength = 0.35, + noiseScaleSpace = 0.9, + distanceFalloff = 0.7, + onlyModelMap = 1, + effectStrength = 0.8, + refractiveIndex = -1.02, --needed for shockwave + lifeTime = 15, + rampUp = 3, + decay = 10, + startRadius = 0.4, + shockWidth = 0.6, + effectType = "groundShockwave", + }, }, }, - ['corjugg'] = { + ["corjugg"] = { [1] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'bigassfootstep', - pieceName = 'lfootstepf', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - noiseStrength = 1.1, noiseScaleSpace = 0.6, distanceFalloff = 0.4, onlyModelMap = 1, - effectStrength = 1.2, --needed for shockwave - lifeTime = 18, rampUp = 10, decay = 10, - shockWidth = 1.5, startRadius = 0.1, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "bigassfootstep", + pieceName = "lfootstepf", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 60, + noiseStrength = 1.1, + noiseScaleSpace = 0.6, + distanceFalloff = 0.4, + onlyModelMap = 1, + effectStrength = 1.2, --needed for shockwave + lifeTime = 18, + rampUp = 10, + decay = 10, + shockWidth = 1.5, + startRadius = 0.1, + effectType = "groundShockwave", + }, }, [2] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'bigassfootstep2', - pieceName = 'rfootstepf', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 60, - noiseStrength = 1.1, noiseScaleSpace = 0.6, distanceFalloff = 0.4, onlyModelMap = 1, - effectStrength = 1.2, --needed for shockwave - lifeTime = 18, rampUp = 10, decay = 10, - shockWidth = 1.5, startRadius = 0.1, effectType = 'groundShockwave'}, + distortionType = "point", + distortionName = "bigassfootstep2", + pieceName = "rfootstepf", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 60, + noiseStrength = 1.1, + noiseScaleSpace = 0.6, + distanceFalloff = 0.4, + onlyModelMap = 1, + effectStrength = 1.2, --needed for shockwave + lifeTime = 18, + rampUp = 10, + decay = 10, + shockWidth = 1.5, + startRadius = 0.1, + effectType = "groundShockwave", + }, }, [3] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'bigassfootstep3', - pieceName = 'lfootstepb', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 52, - noiseStrength = 1.1, noiseScaleSpace = 0.6, distanceFalloff = 0.4, onlyModelMap = 1, - effectStrength = 1.2, --needed for shockwave - lifeTime = 18, rampUp = 10, decay = 10, - shockWidth = 1.5, startRadius = 0.1, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "bigassfootstep3", + pieceName = "lfootstepb", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 52, + noiseStrength = 1.1, + noiseScaleSpace = 0.6, + distanceFalloff = 0.4, + onlyModelMap = 1, + effectStrength = 1.2, --needed for shockwave + lifeTime = 18, + rampUp = 10, + decay = 10, + shockWidth = 1.5, + startRadius = 0.1, + effectType = "groundShockwave", + }, }, [4] = { -- Footstep shockwave alwaysVisible = false, - distortionType = 'point', - distortionName = 'bigassfootstep4', - pieceName = 'rfootstepb', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 52, - noiseStrength = 1.1, noiseScaleSpace = 0.6, distanceFalloff = 0.4, onlyModelMap = 1, - effectStrength = 1.2, --needed for shockwave - lifeTime = 18, rampUp = 10, decay = 10, - shockWidth = 1.5, startRadius = 0.1, effectType = 'groundShockwave'}, - + distortionType = "point", + distortionName = "bigassfootstep4", + pieceName = "rfootstepb", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 52, + noiseStrength = 1.1, + noiseScaleSpace = 0.6, + distanceFalloff = 0.4, + onlyModelMap = 1, + effectStrength = 1.2, --needed for shockwave + lifeTime = 18, + rampUp = 10, + decay = 10, + shockWidth = 1.5, + startRadius = 0.1, + effectType = "groundShockwave", + }, }, }, - -- ['armmark'] = { -- [1] = { -- -- radarwave @@ -2338,34 +1866,54 @@ local unitEventDistortionsNames = { -- }, -- }, - ['cordemon'] = { + ["cordemon"] = { [1] = { -- Barrel Heat alwaysVisible = false, - distortionType = 'point', - distortionName = 'flameheat1', - pieceName = 'lfbarrel2', - distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 11, - noiseStrength = 0.4, noiseScaleSpace = 1.8, distanceFalloff = 1.1, - onlyModelMap = 0, - effectStrength = 1.0, --needed for heat - riseRate = 1.2, windAffected = 0.3, - lifeTime = 250, rampUp = 40, decay = 120, - effectType = 0}, + distortionType = "point", + distortionName = "flameheat1", + pieceName = "lfbarrel2", + distortionConfig = { + posx = 0, + posy = 5, + posz = 0, + radius = 11, + noiseStrength = 0.4, + noiseScaleSpace = 1.8, + distanceFalloff = 1.1, + onlyModelMap = 0, + effectStrength = 1.0, --needed for heat + riseRate = 1.2, + windAffected = 0.3, + lifeTime = 250, + rampUp = 40, + decay = 120, + effectType = 0, + }, }, [2] = { -- Barrel Heat alwaysVisible = false, - distortionType = 'point', - distortionName = 'flameheat2', - pieceName = 'rfbarrel2', - distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 11, - noiseStrength = 0.4, noiseScaleSpace = 1.8, distanceFalloff = 1.1, - onlyModelMap = 0, - effectStrength = 1.0, --needed for heat - riseRate = 1.2, windAffected = 0.3, - lifeTime = 250, rampUp = 40, decay = 120, - effectType = 0}, + distortionType = "point", + distortionName = "flameheat2", + pieceName = "rfbarrel2", + distortionConfig = { + posx = 0, + posy = 5, + posz = 0, + radius = 11, + noiseStrength = 0.4, + noiseScaleSpace = 1.8, + distanceFalloff = 1.1, + onlyModelMap = 0, + effectStrength = 1.0, --needed for heat + riseRate = 1.2, + windAffected = 0.3, + lifeTime = 250, + rampUp = 40, + decay = 120, + effectType = 0, + }, }, -- [3] = { -- -- Flame distort @@ -2385,109 +1933,137 @@ local unitEventDistortionsNames = { [3] = { -- Flame distort alwaysVisible = false, - distortionType = 'cone', - distortionName = 'flamedistort', - pieceName = 'rfbarrel2', - distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 350, - dirx = 0, diry = 0, dirz = 1.0, theta = 0.3, - noiseStrength = 4, noiseScaleSpace = -0.2, distanceFalloff = 3.5, - onlyModelMap = 0, - effectStrength = 3.0, --needed for heat - windAffected = 0.1, riseRate = -0.5, - lifeTime = 15, rampUp = 25, decay = 0, - effectType = 0}, + distortionType = "cone", + distortionName = "flamedistort", + pieceName = "rfbarrel2", + distortionConfig = { + posx = 0, + posy = 5, + posz = 0, + radius = 350, + dirx = 0, + diry = 0, + dirz = 1.0, + theta = 0.3, + noiseStrength = 4, + noiseScaleSpace = -0.2, + distanceFalloff = 3.5, + onlyModelMap = 0, + effectStrength = 3.0, --needed for heat + windAffected = 0.1, + riseRate = -0.5, + lifeTime = 15, + rampUp = 25, + decay = 0, + effectType = 0, + }, }, [4] = { -- Flame distort alwaysVisible = false, - distortionType = 'cone', - distortionName = 'flamedistort', - pieceName = 'lfbarrel2', - distortionConfig = { posx = 0, posy = 5, posz = 0, radius = 350, - dirx = 0, diry = 0, dirz = 1.0, theta = 0.4, - noiseStrength = 4, noiseScaleSpace = 0.12, distanceFalloff = 3.5, - onlyModelMap = 0, - effectStrength = 2.0, --needed for heat - windAffected = 0.1, riseRate = -0.5, - lifeTime = 15, rampUp = 25, decay = 0, - effectType = 0}, + distortionType = "cone", + distortionName = "flamedistort", + pieceName = "lfbarrel2", + distortionConfig = { + posx = 0, + posy = 5, + posz = 0, + radius = 350, + dirx = 0, + diry = 0, + dirz = 1.0, + theta = 0.4, + noiseStrength = 4, + noiseScaleSpace = 0.12, + distanceFalloff = 3.5, + onlyModelMap = 0, + effectStrength = 2.0, --needed for heat + windAffected = 0.1, + riseRate = -0.5, + lifeTime = 15, + rampUp = 25, + decay = 0, + effectType = 0, + }, }, }, - ['armraz'] = { + ["armraz"] = { [1] = { -- Barrel Heat alwaysVisible = false, - distortionType = 'point', - distortionName = 'barrelheatl', - pieceName = 'lcannon', - distortionConfig = { posx = 0, posy = 5, posz = 23.5, radius = 8, - noiseStrength = 0.3, noiseScaleSpace = -1.8, distanceFalloff = 0.8, - onlyModelMap = 0, - effectStrength = 0.5, --needed for heat - lifeTime = 160, rampUp = 25, decay = 25, - riseRate = 0.2, windAffected = -0.3, - effectType = 0}, + distortionType = "point", + distortionName = "barrelheatl", + pieceName = "lcannon", + distortionConfig = { + posx = 0, + posy = 5, + posz = 23.5, + radius = 8, + noiseStrength = 0.3, + noiseScaleSpace = -1.8, + distanceFalloff = 0.8, + onlyModelMap = 0, + effectStrength = 0.5, --needed for heat + lifeTime = 160, + rampUp = 25, + decay = 25, + riseRate = 0.2, + windAffected = -0.3, + effectType = 0, + }, }, [2] = { -- Barrel Heat alwaysVisible = false, - distortionType = 'point', - distortionName = 'barrelheatr', - pieceName = 'rcannon', - distortionConfig = { posx = 0, posy = 5, posz = 23.5, radius = 8, - noiseStrength = 0.3, noiseScaleSpace = -1.8, distanceFalloff = 0.8, - onlyModelMap = 0, - effectStrength = 0.5, --needed for heat - lifeTime = 160, rampUp = 25, decay = 25, - riseRate = 0.2, windAffected = -0.3, - effectType = 0}, + distortionType = "point", + distortionName = "barrelheatr", + pieceName = "rcannon", + distortionConfig = { + posx = 0, + posy = 5, + posz = 23.5, + radius = 8, + noiseStrength = 0.3, + noiseScaleSpace = -1.8, + distanceFalloff = 0.8, + onlyModelMap = 0, + effectStrength = 0.5, --needed for heat + lifeTime = 160, + rampUp = 25, + decay = 25, + riseRate = 0.2, + windAffected = -0.3, + effectType = 0, + }, }, }, - - ['armbrtha'] = { + ["armbrtha"] = { [1] = { -- Barrel Heat after shot alwaysVisible = false, - distortionType = 'beam', - distortionName = 'brthabarrelheat', - pieceName = 'flare', - distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 10, - pos2x = 0, pos2y = 4, pos2z = -16, - onlyModelMap = 0, - riseRate = 0.5, windAffected = -0.5, - noiseStrength = 0.3, noiseScaleSpace = 1.0, distanceFalloff = 1.0, - rampUp = 5, decay = 200, - lifeTime = 240, effectType = 0}, - + distortionType = "beam", + distortionName = "brthabarrelheat", + pieceName = "flare", + distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 10, pos2x = 0, pos2y = 4, pos2z = -16, onlyModelMap = 0, riseRate = 0.5, windAffected = -0.5, noiseStrength = 0.3, noiseScaleSpace = 1.0, distanceFalloff = 1.0, rampUp = 5, decay = 200, lifeTime = 240, effectType = 0 }, }, }, - ['corint'] = { + ["corint"] = { [1] = { -- Barrel Heat after shot alwaysVisible = false, - distortionType = 'beam', - distortionName = 'corintbarrelheat', - pieceName = 'heat', - distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 10, - pos2x = 0, pos2y = 4, pos2z = -16, - onlyModelMap = 0, - riseRate = 0.5, windAffected = -0.5, - noiseStrength = 0.3, noiseScaleSpace = 1.0, distanceFalloff = 1.0, - rampUp = 5, decay = 200, - lifeTime = 240, effectType = 0}, - + distortionType = "beam", + distortionName = "corintbarrelheat", + pieceName = "heat", + distortionConfig = { posx = 0, posy = 4, posz = 4, radius = 10, pos2x = 0, pos2y = 4, pos2z = -16, onlyModelMap = 0, riseRate = 0.5, windAffected = -0.5, noiseStrength = 0.3, noiseScaleSpace = 1.0, distanceFalloff = 1.0, rampUp = 5, decay = 200, lifeTime = 240, effectType = 0 }, }, }, }, - - - ------------------------------- Put additional distortions tied to events here! -------------------------------- - UnitIdle = { + UnitIdle = { --[[ ['armcom'] = { idleBlink = { @@ -2497,7 +2073,8 @@ local unitEventDistortionsNames = { lifeTime = 12, effectType = 0}, }, }, - ]]-- + ]] + -- }, UnitFinished = { @@ -2512,7 +2089,8 @@ local unitEventDistortionsNames = { lifeTime = 20, sustain = 2, effectType = 0}, }, }, - ]]-- + ]] + -- }, UnitCreated = { @@ -2527,7 +2105,8 @@ local unitEventDistortionsNames = { lifeTime = 15, sustain = 2, effectType = 0}, }, }, - ]]-- + ]] + -- }, UnitCloaked = { @@ -2559,7 +2138,8 @@ local unitEventDistortionsNames = { lifeTime = 15, effectType = 0}, }, }, - ]]-- + ]] + -- }, UnitDecloaked = { @@ -2582,18 +2162,15 @@ local unitEventDistortionsNames = { lifeTime = 15, effectType = 0}, }, }, - ]]-- + ]] + -- }, - StockpileChanged = { - }, - UnitMoveFailed = { - }, + StockpileChanged = {}, + UnitMoveFailed = {}, - UnitGiven = { - }, - UnitTaken = { - }, + UnitGiven = {}, + UnitTaken = {}, UnitDestroyed = { -- note: dont do piece-attached distortions here! --[[ default = { @@ -2606,7 +2183,8 @@ local unitEventDistortionsNames = { lifeTime = 15, effectType = 0}, }, }, - ]]-- + ]] + -- }, } @@ -2614,7 +2192,7 @@ local unitEventDistortionsNames = { local function DuplicateDistortions(source, targets) for i, target in pairs(targets) do if UnitDefNames[source] and UnitDefNames[target] then - if unitDistortions[source] then + if unitDistortions[source] then unitDistortions[target] = table.copy(unitDistortions[source]) end @@ -2627,44 +2205,37 @@ local function DuplicateDistortions(source, targets) end end - --duplicate distortions from armcom for Armada Evocom -local armComTable = {'armcomlvl2', 'armcomlvl4', 'armcomlvl5', 'armcomlvl6', 'armcomlvl7', 'armcomlvl8', 'armcomlvl9', 'armcomlvl10'} -DuplicateDistortions('armcom', armComTable) - +local armComTable = { "armcomlvl2", "armcomlvl4", "armcomlvl5", "armcomlvl6", "armcomlvl7", "armcomlvl8", "armcomlvl9", "armcomlvl10" } +DuplicateDistortions("armcom", armComTable) --duplicate distortions from corcom for Cortex Evocom -local corComTable = {'corcomlvl2', 'corcomlvl3', 'corcomlvl4', 'corcomlvl5', 'corcomlvl6', 'corcomlvl7', 'corcomlvl8', 'corcomlvl9', 'corcomlvl10'} -DuplicateDistortions('corcom', corComTable) - - +local corComTable = { "corcomlvl2", "corcomlvl3", "corcomlvl4", "corcomlvl5", "corcomlvl6", "corcomlvl7", "corcomlvl8", "corcomlvl9", "corcomlvl10" } +DuplicateDistortions("corcom", corComTable) --duplicate distortions from legcom for Legion Evocom -local legComTable = {'legcomlvl2', 'legcomlvl3', 'legcomlvl4', 'legcomlvl5', 'legcomlvl6', 'legcomlvl7', 'legcomlvl8', 'legcomlvl9', 'legcomlvl10', 'legdecomlvl3', 'legdecomlvl6', 'legdecomlvl10'} -DuplicateDistortions('legcom', legComTable) - +local legComTable = { "legcomlvl2", "legcomlvl3", "legcomlvl4", "legcomlvl5", "legcomlvl6", "legcomlvl7", "legcomlvl8", "legcomlvl9", "legcomlvl10", "legdecomlvl3", "legdecomlvl6", "legdecomlvl10" } +DuplicateDistortions("legcom", legComTable) --duplicate distortions from scavengerbossv4_normal for all scavengerbossv4 variants -local scavengerBossV4Table = {'scavengerbossv4_veryeasy', 'scavengerbossv4_easy', 'scavengerbossv4_hard', 'scavengerbossv4_veryhard', 'scavengerbossv4_epic'} -DuplicateDistortions('scavengerbossv4_normal', scavengerBossV4Table) - +local scavengerBossV4Table = { "scavengerbossv4_veryeasy", "scavengerbossv4_easy", "scavengerbossv4_hard", "scavengerbossv4_veryhard", "scavengerbossv4_epic" } +DuplicateDistortions("scavengerbossv4_normal", scavengerBossV4Table) --AND THE REST ---unitEventDistortionsNames -> unitEventDistortions local unitEventDistortions = {} for key, subtables in pairs(unitEventDistortionsNames) do - unitEventDistortions[key] = {} - for subKey, distortions in pairs(subtables) do - if UnitDefNames[subKey] then - unitEventDistortions[key][UnitDefNames[subKey].id] = distortions - else - unitEventDistortions[key][subKey] = distortions --preserve defaults etc - end + unitEventDistortions[key] = {} + for subKey, distortions in pairs(subtables) do + if UnitDefNames[subKey] then + unitEventDistortions[key][UnitDefNames[subKey].id] = distortions + else + unitEventDistortions[key][subKey] = distortions --preserve defaults etc end + end end unitEventDistortionsNames = nil - -- convert unitname -> unitDefID local unitDefDistortions = {} for unitName, distortions in pairs(unitDistortions) do @@ -2698,44 +2269,37 @@ end -- add scavenger equivalents local scavUnitDefDistortions = {} for unitDefID, distortions in pairs(unitDefDistortions) do - if UnitDefNames[UnitDefs[unitDefID].name..'_scav'] then - scavUnitDefDistortions[UnitDefNames[UnitDefs[unitDefID].name..'_scav'].id] = distortions + if UnitDefNames[UnitDefs[unitDefID].name .. "_scav"] then + scavUnitDefDistortions[UnitDefNames[UnitDefs[unitDefID].name .. "_scav"].id] = distortions end end unitDefDistortions = table.merge(unitDefDistortions, scavUnitDefDistortions) scavUnitDefDistortions = nil -local featureDefDistortions = { +local featureDefDistortions = {} +local crystalDistortionBase = { + distortionType = "point", + distortionConfig = { posx = 0, posy = 8, posz = 0, radius = 20, onlyModelMap = 0, riseRate = 0.5, windAffected = -0.5, noiseStrength = 0.4, noiseScaleSpace = 2.2, distanceFalloff = 1.2, lifeTime = 0, effectType = 0 }, } -local crystalDistortionBase = { - distortionType = 'point', - distortionConfig = { posx = 0, posy = 8, posz = 0, radius = 20, - onlyModelMap = 0, - riseRate = 0.5, windAffected = -0.5, - - noiseStrength = 0.4, noiseScaleSpace = 2.2, distanceFalloff = 1.2, - lifeTime = 0, effectType = 0}, - } - local crystalColors = { -- note that the underscores are needed here - [""] = {0.78,0.46,0.94,0.11}, -- same as violet - _violet = {0.8,0.5,0.95,0.33}, - _blue = {0.1,0.2,0.9,0.33}, - _green = {0.1,0.8,0.1,0.15}, - _lime = {0.4,1,0.2,0.15}, - _obsidian = {0.3,0.2,0.2,0.33}, - _quartz = {0.3,0.3,0.5,0.33}, - _orange = {1,0.5,0,0.11}, - _red = {1,0.2,0.2,0.067}, - _teal = {0,1,1,0.15}, - _team = {1,1,1,0.15}, - } + [""] = { 0.78, 0.46, 0.94, 0.11 }, -- same as violet + _violet = { 0.8, 0.5, 0.95, 0.33 }, + _blue = { 0.1, 0.2, 0.9, 0.33 }, + _green = { 0.1, 0.8, 0.1, 0.15 }, + _lime = { 0.4, 1, 0.2, 0.15 }, + _obsidian = { 0.3, 0.2, 0.2, 0.33 }, + _quartz = { 0.3, 0.3, 0.5, 0.33 }, + _orange = { 1, 0.5, 0, 0.11 }, + _red = { 1, 0.2, 0.2, 0.067 }, + _teal = { 0, 1, 1, 0.15 }, + _team = { 1, 1, 1, 0.15 }, +} for colorname, colorvalues in pairs(crystalColors) do - for size = 1,3 do - local crystaldefname = 'pilha_crystal' .. colorname .. tostring(size) + for size = 1, 3 do + local crystaldefname = "pilha_crystal" .. colorname .. tostring(size) if FeatureDefNames[crystaldefname] then local crystalDistortion = table.copy(crystalDistortionBase) crystalDistortion.distortionConfig.r = colorvalues[1] @@ -2743,21 +2307,19 @@ for colorname, colorvalues in pairs(crystalColors) do crystalDistortion.distortionConfig.b = colorvalues[3] crystalDistortion.distortionConfig.a = colorvalues[4] - crystalDistortion.distortionConfig.color2r = colorvalues[1] * 0.6 - crystalDistortion.distortionConfig.color2g = colorvalues[2] * 0.6 - crystalDistortion.distortionConfig.color2b = colorvalues[3] * 0.6 + crystalDistortion.distortionConfig.color2r = colorvalues[1] * 0.6 + crystalDistortion.distortionConfig.color2g = colorvalues[2] * 0.6 + crystalDistortion.distortionConfig.color2b = colorvalues[3] * 0.6 crystalDistortion.distortionConfig.colortime = 0.002 + 0.01 / size - crystalDistortion.distortionConfig.radius = (size + 0.2) * (crystalDistortion.distortionConfig.radius * 0.6) crystalDistortion.distortionConfig.posy = (size + 1.5) * crystalDistortion.distortionConfig.posy - featureDefDistortions[FeatureDefNames[crystaldefname].id] = {crystalDistortion = crystalDistortion} + featureDefDistortions[FeatureDefNames[crystaldefname].id] = { crystalDistortion = crystalDistortion } end end end - -local allDistortions = {unitEventDistortions = unitEventDistortions, unitDefDistortions = unitDefDistortions, featureDefDistortions = featureDefDistortions} +local allDistortions = { unitEventDistortions = unitEventDistortions, unitDefDistortions = unitDefDistortions, featureDefDistortions = featureDefDistortions } ----------------- Debugging code to do the reverse dump --------------- --[[ @@ -2798,11 +2360,9 @@ for typename, typetable in pairs(allDistortions) do end end end -]]-- +]] +-- -- Icexuick Check-list - return allDistortions - - diff --git a/luaui/configs/DistortionGL4WeaponsConfig.lua b/luaui/configs/DistortionGL4WeaponsConfig.lua index c7ce065c25c..41630b4d422 100644 --- a/luaui/configs/DistortionGL4WeaponsConfig.lua +++ b/luaui/configs/DistortionGL4WeaponsConfig.lua @@ -1,54 +1,84 @@ -- This configures all the distortions weapon effects, including: - -- Projectile attached distortions - -- Muzzle flashes - -- Explosion distortions - -- Pieceprojectiles (gibs on death) distortions +-- Projectile attached distortions +-- Muzzle flashes +-- Explosion distortions +-- Pieceprojectiles (gibs on death) distortions -- note that weapondef customparams need to be moved out of unitdefs, for ease of configability. - -- customparams= { - -- expl_distortion_skip = bool , -- no explosion on projectile death - -- expl_distortion_color = {rgba} , -- color of the explosion distortion at peak? - -- expl_distortion_opacity = a, -- alpha or power of the distortion - -- expl_distortion_mult = ,-- fuck if i know? - -- expl_distortion_radius = , -- radius - -- expl_distortion_radius_mult = , -- why? - -- expl_distortion_life = , life of the expl distortion? +-- customparams= { +-- expl_distortion_skip = bool , -- no explosion on projectile death +-- expl_distortion_color = {rgba} , -- color of the explosion distortion at peak? +-- expl_distortion_opacity = a, -- alpha or power of the distortion +-- expl_distortion_mult = ,-- fuck if i know? +-- expl_distortion_radius = , -- radius +-- expl_distortion_radius_mult = , -- why? +-- expl_distortion_life = , life of the expl distortion? -- concept is: - -- Make a few base classes of distortions - -- auto-assign the majority - -- offer overrideability +-- Make a few base classes of distortions +-- auto-assign the majority +-- offer overrideability -- note that Y offset will be very different for points and for beams! -- (c) Beherith (mysterme@gmail.com) local exampleDistortion = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam pieceName = nil, -- optional yOffset = 10, -- optional, gives extra Y height fraction = 3, -- optional, only every nth projectile gets the effect (randomly) distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 0, - r = 1, g = 1, b = 1, a = 1, - color2r = 1, color2g = 1, color2b = 1, colortime = 15, -- point distortions only, colortime in seconds for unit-attached - dirx = 0, diry = 0, dirz = 1, theta = 0.5, -- cone distortions only, specify direction and half-angle in radians - pos2x = 100, pos2y = 100, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - modelfactor = 1, specular = 1, scattering = 1, lensflare = 1, - lifeTime = 0, sustain = 1, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 0, + r = 1, + g = 1, + b = 1, + a = 1, + color2r = 1, + color2g = 1, + color2b = 1, + colortime = 15, -- point distortions only, colortime in seconds for unit-attached + dirx = 0, + diry = 0, + dirz = 1, + theta = 0.5, -- cone distortions only, specify direction and half-angle in radians + pos2x = 100, + pos2y = 100, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + modelfactor = 1, + specular = 1, + scattering = 1, + lensflare = 1, + lifeTime = 0, + sustain = 1, + effectType = 0, }, } - local exampleDistortionBeamShockwave = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam pieceName = nil, -- optional distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 150, - r = 1, g = 1, b = 1, a = 0.075, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - modelfactor = 1, specular = 0.5, scattering = 0.1, lensflare = 1, - lifeTime = 10, sustain = 1, effectType = 'groundShockwave', + posx = 0, + posy = 10, + posz = 0, + radius = 150, + r = 1, + g = 1, + b = 1, + a = 0.075, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + modelfactor = 1, + specular = 0.5, + scattering = 0.1, + lensflare = 1, + lifeTime = 10, + sustain = 1, + effectType = "groundShockwave", }, } - -- Local Variables -------------------------------------------------------------------------------- @@ -61,342 +91,567 @@ local exampleDistortionBeamShockwave = { --------------------------------General Base Distortion Classes for further useage -------- local BaseClasses = { NoEffect = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 0, - lifeTime = 0, sustain = 0, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 0, + lifeTime = 0, + sustain = 0, + effectType = 0, }, }, LaserProjectile = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 100, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, sustain = 1, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 100, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + sustain = 1, + effectType = 0, }, }, CannonProjectile = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 125, - lifeTime = 0, sustain = 0, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 125, + lifeTime = 0, + sustain = 0, + effectType = 0, }, }, LaserCannonExplosion = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 125, - lifeTime = 0, sustain = 0, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 125, + lifeTime = 0, + sustain = 0, + effectType = 0, }, }, PlasmaTrailProjectile = { - distortionType = 'cone', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - dirx = 0, diry = 1, dirz = 1.0, theta = 0.09, - noiseStrength = 6, noiseScaleSpace = 0.25, distanceFalloff = 1.5, onlyModelMap = 1, - windAffected = -1, riseRate = 0, yoffset = 5, - lifeTime = 0, rampUp = 30, decay = 5, effectType = 0}, + distortionType = "cone", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, dirx = 0, diry = 1, dirz = 1.0, theta = 0.09, noiseStrength = 6, noiseScaleSpace = 0.25, distanceFalloff = 1.5, onlyModelMap = 1, windAffected = -1, riseRate = 0, yoffset = 5, lifeTime = 0, rampUp = 30, decay = 5, effectType = 0 }, }, RailgunTrailProjectile = { - distortionType = 'point', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - --dirx = 0, diry = 1, dirz = 1.0, theta = 0.12, - noiseStrength = 8, noiseScaleSpace = -0.35, distanceFalloff = 0.8, onlyModelMap = 0, - refractiveIndex = 1.04, - windAffected = -0.5, riseRate = 0.5, --yoffset = -2, - lifeTime = 0, rampUp = 0, decay = 0, effectType = 0}, + distortionType = "point", + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 100, + --dirx = 0, diry = 1, dirz = 1.0, theta = 0.12, + noiseStrength = 8, + noiseScaleSpace = -0.35, + distanceFalloff = 0.8, + onlyModelMap = 0, + refractiveIndex = 1.04, + windAffected = -0.5, + riseRate = 0.5, --yoffset = -2, + lifeTime = 0, + rampUp = 0, + decay = 0, + effectType = 0, + }, }, LaserBeamShockWaveProjectile = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 150, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 10, sustain = 1, effectType = 'groundShockwave', + posx = 0, + posy = 10, + posz = 0, + radius = 150, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 10, + sustain = 1, + effectType = "groundShockwave", }, }, LaserBeamHeat = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - noiseStrength = 0.3, noiseScaleSpace = 0.3, effectStrength = 0.5, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, rampUp = 2, decay = 0, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + noiseStrength = 0.3, + noiseScaleSpace = 0.3, + effectStrength = 0.5, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + rampUp = 2, + decay = 0, + effectType = 0, }, }, HeatRayHeat = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - noiseStrength = 0.75, noiseScaleSpace = 0.15, distanceFalloff = 1.5, - windAffected = -1, riseRate = 0.2, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 3, rampUp = 3, decay = 0, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + noiseStrength = 0.75, + noiseScaleSpace = 0.15, + distanceFalloff = 1.5, + windAffected = -1, + riseRate = 0.2, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 3, + rampUp = 3, + decay = 0, + effectType = 0, }, }, HeatRayHeatXL = { --heaviest laserbeam (corkorg) - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - pos2x = 0, pos2y = 0, pos2z = 0, radius2 = 1, - noiseStrength = 1.2, noiseScaleSpace = 0.022, distanceFalloff = 0.2, - effectStrength = 1.0, - windAffected = -1, riseRate = 4.2, onlyModelMap = 0, - --refractiveIndex = 1.15, - lifeTime = 0, rampUp = 0, decay = 0, effectType = 7, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + pos2x = 0, + pos2y = 0, + pos2z = 0, + radius2 = 1, + noiseStrength = 1.2, + noiseScaleSpace = 0.022, + distanceFalloff = 0.2, + effectStrength = 1.0, + windAffected = -1, + riseRate = 4.2, + onlyModelMap = 0, + --refractiveIndex = 1.15, + lifeTime = 0, + rampUp = 0, + decay = 0, + effectType = 7, }, }, TachyonBeam = { --original for armbanth - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 2.2, noiseScaleSpace = 0.03, - windAffected = -1, riseRate = 2.6, onlyModelMap = 0, - pos2x = 100, pos2y = 500, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 10, sustain = 1, rampUp = 0, decay = 3, effectType = 7, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 2.2, + noiseScaleSpace = 0.03, + windAffected = -1, + riseRate = 2.6, + onlyModelMap = 0, + pos2x = 100, + pos2y = 500, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 10, + sustain = 1, + rampUp = 0, + decay = 3, + effectType = 7, }, }, TachyonBeam2 = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 0.3, noiseScaleSpace = 0.025, distanceFalloff = -1, - windAffected = -0.8, riseRate = -0.2, effectStrength = 0.5, - pos2x = 100, pos2y = 500, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, sustain = 0, rampUp = 0, decay = 3, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 0.3, + noiseScaleSpace = 0.025, + distanceFalloff = -1, + windAffected = -0.8, + riseRate = -0.2, + effectStrength = 0.5, + pos2x = 100, + pos2y = 500, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + sustain = 0, + rampUp = 0, + decay = 3, + effectType = 0, }, }, TachyonBeam3 = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 1.0, noiseScaleSpace = 0.020, - windAffected = -0.5, riseRate = 0.3, effectStrength = 1, - pos2x = 0, pos2y = 0, pos2z = 0, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, sustain = 0, rampUp = 0, decay = 0, effectType = 12, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 1.0, + noiseScaleSpace = 0.020, + windAffected = -0.5, + riseRate = 0.3, + effectStrength = 1, + pos2x = 0, + pos2y = 0, + pos2z = 0, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + sustain = 0, + rampUp = 0, + decay = 0, + effectType = 12, }, }, LightningBeam = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - noiseStrength = 0.7, noiseScaleSpace = 0.07, distanceFalloff = 2.5, - effectStrength = 4.0, - --windAffected = 2, riseRate = 2, - windAffected = -1, riseRate = -0.6, - pos2x = 100, pos2y = 1000, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, rampUp = 0, decay = 0, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + noiseStrength = 0.7, + noiseScaleSpace = 0.07, + distanceFalloff = 2.5, + effectStrength = 4.0, + --windAffected = 2, riseRate = 2, + windAffected = -1, + riseRate = -0.6, + pos2x = 100, + pos2y = 1000, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + rampUp = 0, + decay = 0, + effectType = 0, }, }, EMPBeam = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - noiseStrength = 1.0, noiseScaleSpace = 0.16, distanceFalloff = 1.0, - effectStrength = 2.5, - --onlyModelMap = 1, - --windAffected = 2, riseRate = 2, - windAffected = -1, riseRate = -3.2, - pos2x = 100, pos2y = 100, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, rampUp = 0, decay = 2, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + noiseStrength = 1.0, + noiseScaleSpace = 0.16, + distanceFalloff = 1.0, + effectStrength = 2.5, + --onlyModelMap = 1, + --windAffected = 2, riseRate = 2, + windAffected = -1, + riseRate = -3.2, + pos2x = 100, + pos2y = 100, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + rampUp = 0, + decay = 2, + effectType = 0, }, }, EMPBeamXL = { - distortionType = 'beam', -- or cone or beam + distortionType = "beam", -- or cone or beam distortionConfig = { - posx = 0, posy = 10, posz = 0, radius = 10, - noiseStrength = 1.0, noiseScaleSpace = 0.12, distanceFalloff = 0.5, - effectStrength = 3.0, - --onlyModelMap = 1, - --windAffected = 2, riseRate = 2, - windAffected = -1, riseRate = -2.2, - pos2x = 100, pos2y = 100, pos2z = 100, -- beam distortions only, specifies the endpoint of the beam - lifeTime = 0, rampUp = 0, decay = 1, effectType = 0, + posx = 0, + posy = 10, + posz = 0, + radius = 10, + noiseStrength = 1.0, + noiseScaleSpace = 0.12, + distanceFalloff = 0.5, + effectStrength = 3.0, + --onlyModelMap = 1, + --windAffected = 2, riseRate = 2, + windAffected = -1, + riseRate = -2.2, + pos2x = 100, + pos2y = 100, + pos2z = 100, -- beam distortions only, specifies the endpoint of the beam + lifeTime = 0, + rampUp = 0, + decay = 1, + effectType = 0, }, }, AirBombProjectile = { - distortionType = 'cone', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 70, - dirx = 0, diry = 1, dirz = 1.0, theta = 0.2, - startRadius = 0.5, onlyModelMap = 1, - noiseStrength = 1.45, noiseScaleSpace = 0.75, distanceFalloff = 1.8, - onlyModelMap = 0, yoffset = 8, - effectStrength = 2.0, windAffected = -1, riseRate = -0.3, - rampUp = 15, lifeTime = 0, sustain = 0, effectType = 0}, + distortionType = "cone", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 70, dirx = 0, diry = 1, dirz = 1.0, theta = 0.2, startRadius = 0.5, onlyModelMap = 1, noiseStrength = 1.45, noiseScaleSpace = 0.75, distanceFalloff = 1.8, onlyModelMap = 0, yoffset = 8, effectStrength = 2.0, windAffected = -1, riseRate = -0.3, rampUp = 15, lifeTime = 0, sustain = 0, effectType = 0 }, }, MissileProjectile = { - distortionType = 'cone', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - dirx = 0, diry = 1, dirz = 1.0, theta = 0.1, - startRadius = 0.5, onlyModelMap = 1, - noiseStrength = 1.45, noiseScaleSpace = 0.75, distanceFalloff = 1.8, - onlyModelMap = 0, yoffset = 8, - effectStrength = 1.0, windAffected = -1, riseRate = -0.3, - rampUp = 15, lifeTime = 0, sustain = 0, effectType = 0}, + distortionType = "cone", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, dirx = 0, diry = 1, dirz = 1.0, theta = 0.1, startRadius = 0.5, onlyModelMap = 1, noiseStrength = 1.45, noiseScaleSpace = 0.75, distanceFalloff = 1.8, onlyModelMap = 0, yoffset = 8, effectStrength = 1.0, windAffected = -1, riseRate = -0.3, rampUp = 15, lifeTime = 0, sustain = 0, effectType = 0 }, }, - - MissileProjectileXL = { - distortionType = 'cone', - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 130, - startRadius = 0.5, onlyModelMap = 1, - dirx = 0, diry = 1, dirz = 1.0, theta = 0.08, - noiseStrength = 4, noiseScaleSpace = 0.37, distanceFalloff = 1.8, - onlyModelMap = 0, yoffset = 10, - effectStrength = 1.2, windAffected = -1, riseRate = -0.3, - rampUp = 4, lifeTime = 0, sustain = 0, effectType = 0}, + distortionType = "cone", + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 130, startRadius = 0.5, onlyModelMap = 1, dirx = 0, diry = 1, dirz = 1.0, theta = 0.08, noiseStrength = 4, noiseScaleSpace = 0.37, distanceFalloff = 1.8, onlyModelMap = 0, yoffset = 10, effectStrength = 1.2, windAffected = -1, riseRate = -0.3, rampUp = 4, lifeTime = 0, sustain = 0, effectType = 0 }, }, MissileNukeProjectile = { - distortionType = 'cone', - distortionConfig = { posx = 0, posy = 0, posz = 00, radius = 200, - dirx = 0, diry = 1, dirz = 1.0, theta = 0.3, - noiseStrength = 4, noiseScaleSpace = 0.3, distanceFalloff = 1.0, onlyModelMap = 0, - rampUp = 30, yoffset = 8, - lifeTime = 0, sustain = 0, effectType = 0}, + distortionType = "cone", + distortionConfig = { posx = 0, posy = 0, posz = 00, radius = 200, dirx = 0, diry = 1, dirz = 1.0, theta = 0.3, noiseStrength = 4, noiseScaleSpace = 0.3, distanceFalloff = 1.0, onlyModelMap = 0, rampUp = 30, yoffset = 8, lifeTime = 0, sustain = 0, effectType = 0 }, }, - LaserAimProjectile = { - distortionType = 'cone', -- or cone or beam + distortionType = "cone", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 500, - dirx = 1, diry = 0, dirz = 1, theta = 0.02, -- cone distortions only, specify direction and half-angle in radians - lifeTime = 0, sustain = 1, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 500, + dirx = 1, + diry = 0, + dirz = 1, + theta = 0.02, -- cone distortions only, specify direction and half-angle in radians + lifeTime = 0, + sustain = 1, + effectType = 0, }, }, GroundShockWaveXS = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.6, noiseStrength = 0.35, noiseScaleSpace = 0.8, - lifeTime = 12, decay = 8, rampUp = 4, onlyModelMap = 1, - effectStrength = 1.2, --needed for shockwaves - shockWidth = 1, refractiveIndex = 1.1, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.6, + noiseStrength = 0.35, + noiseScaleSpace = 0.8, + lifeTime = 12, + decay = 8, + rampUp = 4, + onlyModelMap = 1, + effectStrength = 1.2, --needed for shockwaves + shockWidth = 1, + refractiveIndex = 1.1, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, GroundShockWave = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.1, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 21, decay = 16, rampUp = 4, onlyModelMap = 1, - effectStrength = 1.5, --needed for shockwaves - shockWidth = 1.2, refractiveIndex = -1.2, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.1, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 21, + decay = 16, + rampUp = 4, + onlyModelMap = 1, + effectStrength = 1.5, --needed for shockwaves + shockWidth = 1.2, + refractiveIndex = -1.2, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, GroundShockWaveHeat = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, --fraction = 5, --doesn't work - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.1, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 16, decay = 13, rampUp = 3, onlyModelMap = 1, - effectStrength = 0.8, --needed for shockwaves - shockWidth = -1.9, refractiveIndex = -2.04, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.1, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 16, + decay = 13, + rampUp = 3, + onlyModelMap = 1, + effectStrength = 0.8, --needed for shockwaves + shockWidth = -1.9, + refractiveIndex = -2.04, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, AirShockWaveCommander = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.9, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 13, refractiveIndex = 2.0, decay = 7, rampUp = 5, - effectStrength = 4.0, startRadius = 0.24, shockWidth = -0.85, --needed for airshockwaves - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 0.9, + noiseStrength = 0.2, + onlyModelMap = 0, + lifeTime = 13, + refractiveIndex = 2.0, + decay = 7, + rampUp = 5, + effectStrength = 4.0, + startRadius = 0.24, + shockWidth = -0.85, --needed for airshockwaves + effectType = "airShockwave", + }, }, GroundShockWaveCommander = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 2, noiseScaleSpace = 0.10, - effectStrength = 1.5, --needed for shockwaves - lifeTime = 20, decay = 10, rampUp = 10, - shockWidth = 4, refractiveIndex = -2.1, - startRadius = 0.16, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 2, + noiseScaleSpace = 0.10, + effectStrength = 1.5, --needed for shockwaves + lifeTime = 20, + decay = 10, + rampUp = 10, + shockWidth = 4, + refractiveIndex = -2.1, + startRadius = 0.16, + effectType = "groundShockwave", + }, }, GroundShockWaveCommanderSlow = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 1.5, noiseScaleSpace = 0.30, - effectStrength = 0.7, --needed for shockwaves - lifeTime = 100, decay = 75, rampUp = 25, - shockWidth = 1, refractiveIndex = -10.1, - startRadius = 0.15, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 1.5, + noiseScaleSpace = 0.30, + effectStrength = 0.7, --needed for shockwaves + lifeTime = 100, + decay = 75, + rampUp = 25, + shockWidth = 1, + refractiveIndex = -10.1, + startRadius = 0.15, + effectType = "groundShockwave", + }, }, GroundShockWaveNuke = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 2, noiseScaleSpace = 0.10, - effectStrength = 1.0, --needed for shockwaves - lifeTime = 100, decay = 25, rampUp = 5, - shockWidth = 16, refractiveIndex = -1.1, - startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 2, + noiseScaleSpace = 0.10, + effectStrength = 1.0, --needed for shockwaves + lifeTime = 100, + decay = 25, + rampUp = 5, + shockWidth = 16, + refractiveIndex = -1.1, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, GroundShockWaveFuzzy = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 1.0, onlyModelMap = 0, - effectStrength = 1.2, --needed for shockwaves - shockWidth = 3, startRadius = 0.24, - lifeTime = 25, effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 1.0, + onlyModelMap = 0, + effectStrength = 1.2, --needed for shockwaves + shockWidth = 3, + startRadius = 0.24, + lifeTime = 25, + effectType = "groundShockwave", + }, }, GroundAcidExplo = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.9, noiseStrength = 0.5, noiseScaleSpace = 0.7, - lifeTime = 200, decay = 150, rampUp = 50, - effectStrength = 0.75, --needed for shockwaves - windAffected = -0.5, riseRate = 6, --used for width of shockwave - shockWidth = 6, refractiveIndex = -1.2, startRadius = 0.5, - onlyModelMap = 1, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.9, + noiseStrength = 0.5, + noiseScaleSpace = 0.7, + lifeTime = 200, + decay = 150, + rampUp = 50, + effectStrength = 0.75, --needed for shockwaves + windAffected = -0.5, + riseRate = 6, --used for width of shockwave + shockWidth = 6, + refractiveIndex = -1.2, + startRadius = 0.5, + onlyModelMap = 1, + effectType = "groundShockwave", + }, }, ExploUnitAirShockWave = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.15, noiseStrength = 0.3, onlyModelMap = 0, - lifeTime = 12, refractiveIndex = 1.04, decay = 5, rampUp = 1, - effectStrength = 5.0, startRadius = 0.3, shockWidth = -0.70, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.15, noiseStrength = 0.3, onlyModelMap = 0, lifeTime = 12, refractiveIndex = 1.04, decay = 5, rampUp = 1, effectStrength = 5.0, startRadius = 0.3, shockWidth = -0.70, effectType = "airShockwave" }, }, AirShockWaveXS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 1.1, noiseStrength = 0.01, onlyModelMap = 1, - lifeTime = 7, refractiveIndex = 1.03, decay = 4, rampUp = 3, - effectStrength = 2.0, startRadius = 0.20, shockWidth = -0.60, --needed for all distortions - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 1.1, + noiseStrength = 0.01, + onlyModelMap = 1, + lifeTime = 7, + refractiveIndex = 1.03, + decay = 4, + rampUp = 3, + effectStrength = 2.0, + startRadius = 0.20, + shockWidth = -0.60, --needed for all distortions + effectType = "airShockwave", + }, }, -- AirShockWaveMG = { --for machineguns -- distortionType = 'point', -- or cone or beam @@ -407,494 +662,693 @@ local BaseClasses = { -- effectType = "airShockwave", }, -- }, AirShockWave = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 11, refractiveIndex = 1.04, decay = 4, rampUp = 2, - effectStrength = 2.8, startRadius = 0.25, shockWidth = -0.80, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 11, refractiveIndex = 1.04, decay = 4, rampUp = 2, effectStrength = 2.8, startRadius = 0.25, shockWidth = -0.80, effectType = "airShockwave" }, }, AirShockWaveDgun = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.5, noiseStrength = 1, onlyModelMap = 0, - lifeTime = 30, refractiveIndex = -4.0, decay = 5, rampUp = 15, - startRadius = 0.24, shockWidth = -0.95, + distortionType = "point", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 0.5, + noiseStrength = 1, + onlyModelMap = 0, + lifeTime = 30, + refractiveIndex = -4.0, + decay = 5, + rampUp = 15, + startRadius = 0.24, + shockWidth = -0.95, effectStrength = 0.9, --needed for airshockwaves - effectType = "airShockwave", }, - + effectType = "airShockwave", + }, }, AirShockWaveNuke = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.05, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 25, refractiveIndex = 1.1, decay = 20, rampUp = 1, - effectStrength = 20.0, startRadius = 0.2, shockWidth = -0.70,--needed for airshockwaves - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 0.05, + noiseStrength = 0.2, + onlyModelMap = 0, + lifeTime = 25, + refractiveIndex = 1.1, + decay = 20, + rampUp = 1, + effectStrength = 20.0, + startRadius = 0.2, + shockWidth = -0.70, --needed for airshockwaves + effectType = "airShockwave", + }, }, AirShockWaveNukeBlast = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 225, - noiseScaleSpace = 0.3, noiseStrength = 0.5, onlyModelMap = 1, - lifeTime = 150, refractiveIndex = 1.5, decay = 60, rampUp = 40, - effectStrength = 1.0, startRadius = 0.05, shockWidth = 0.25, - windAffected = 3, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 225, noiseScaleSpace = 0.3, noiseStrength = 0.5, onlyModelMap = 1, lifeTime = 150, refractiveIndex = 1.5, decay = 60, rampUp = 40, effectStrength = 1.0, startRadius = 0.05, shockWidth = 0.25, windAffected = 3, effectType = "airShockwave" }, }, TorpedoShockWave = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 1.2, noiseStrength = 0.8, onlyModelMap = 0, - lifeTime = 10, refractiveIndex = 1.2, decay = 3, rampUp = 3, - effectStrength = 2.2, startRadius = 0.25, shockWidth = -0.95, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 1.2, noiseStrength = 0.8, onlyModelMap = 0, lifeTime = 10, refractiveIndex = 1.2, decay = 3, rampUp = 3, effectStrength = 2.2, startRadius = 0.25, shockWidth = -0.95, effectType = "airShockwave" }, }, -- ALL CANNON explosion Classes ExploShockWaveXS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 4, refractiveIndex = 1.04, decay = 3, rampUp = 1, - effectStrength = 3.0, startRadius = 0.4, shockWidth = -1.2, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 4, refractiveIndex = 1.04, decay = 3, rampUp = 1, effectStrength = 3.0, startRadius = 0.4, shockWidth = -1.2, effectType = "airShockwave" }, }, ExploShockWaveS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 4.5, refractiveIndex = 1.04, decay = 3.5, rampUp = 1, - effectStrength = 3.0, startRadius = 0.39, shockWidth = -1.1, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 4.5, refractiveIndex = 1.04, decay = 3.5, rampUp = 1, effectStrength = 3.0, startRadius = 0.39, shockWidth = -1.1, effectType = "airShockwave" }, }, ExploShockWaveM = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - noiseScaleSpace = 0.3, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 5.5, refractiveIndex = 1.09, decay = 3, rampUp = 1, - effectStrength = 3.5, startRadius = 0.39, shockWidth = -0.99, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, noiseScaleSpace = 0.3, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 5.5, refractiveIndex = 1.09, decay = 3, rampUp = 1, effectStrength = 3.5, startRadius = 0.39, shockWidth = -0.99, effectType = "airShockwave" }, }, ExploShockWaveL = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 380, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 11, refractiveIndex = 1.03, decay = 4, rampUp = 6, - effectStrength = 4.1, startRadius = 0.33, shockWidth = -0.50, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 380, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 11, refractiveIndex = 1.03, decay = 4, rampUp = 6, effectStrength = 4.1, startRadius = 0.33, shockWidth = -0.50, effectType = "airShockwave" }, }, ExploShockWaveXL = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 480, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 24, refractiveIndex = 1.02, decay = 4, rampUp = 4, - effectStrength = 4, startRadius = 0.28, shockWidth = -0.50, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 480, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 24, refractiveIndex = 1.02, decay = 4, rampUp = 4, effectStrength = 4, startRadius = 0.28, shockWidth = -0.50, effectType = "airShockwave" }, }, -- ALL UNIT Explosion Classes UnitExploShockWaveXS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 5, refractiveIndex = 1.07, decay = 4, rampUp = 1, - effectStrength = 4.5, startRadius = 0.45, shockWidth = -0.50, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 100, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 5, refractiveIndex = 1.07, decay = 4, rampUp = 1, effectStrength = 4.5, startRadius = 0.45, shockWidth = -0.50, effectType = "airShockwave" }, }, UnitExploShockWaveS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 6, refractiveIndex = 1.05, decay = 4, rampUp = 2, - effectStrength = 4.25, startRadius = 0.41, shockWidth = -0.55, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 6, refractiveIndex = 1.05, decay = 4, rampUp = 2, effectStrength = 4.25, startRadius = 0.41, shockWidth = -0.55, effectType = "airShockwave" }, }, UnitExploShockWaveM = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 9, refractiveIndex = 1.045, decay = 5, rampUp = 2, - effectStrength = 4.0, startRadius = 0.38, shockWidth = -0.60, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 9, refractiveIndex = 1.045, decay = 5, rampUp = 2, effectStrength = 4.0, startRadius = 0.38, shockWidth = -0.60, effectType = "airShockwave" }, }, UnitExploShockWaveL = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 400, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 11, refractiveIndex = 1.041, decay = 5, rampUp = 3, - effectStrength = 4.2, startRadius = 0.33, shockWidth = -0.61, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 400, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 11, refractiveIndex = 1.041, decay = 5, rampUp = 3, effectStrength = 4.2, startRadius = 0.33, shockWidth = -0.61, effectType = "airShockwave" }, }, UnitExploShockWaveXL = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 480, - noiseScaleSpace = 0.1, noiseStrength = 0.4, onlyModelMap = 0, - lifeTime = 14, refractiveIndex = 1.035, decay = 6, rampUp = 3, - effectStrength = 4.5, startRadius = 0.20, shockWidth = -0.36, - effectType = "airShockwave", }, + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 480, noiseScaleSpace = 0.1, noiseStrength = 0.4, onlyModelMap = 0, lifeTime = 14, refractiveIndex = 1.035, decay = 6, rampUp = 3, effectStrength = 4.5, startRadius = 0.20, shockWidth = -0.36, effectType = "airShockwave" }, }, UnitGroundShockWave = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.5, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 25, decay = 25, rampUp = 15, - effectStrength = 1.5, --needed for shockwaves - shockWidth = 3, refractiveIndex = -1.2, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.5, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 25, + decay = 25, + rampUp = 15, + effectStrength = 1.5, --needed for shockwaves + shockWidth = 3, + refractiveIndex = -1.2, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, UnitGroundShockWaveXL = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.5, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 25, decay = 25, rampUp = 15, - effectStrength = 1.5, --needed for shockwaves - shockWidth = 3, refractiveIndex = -1.2, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.5, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 25, + decay = 25, + rampUp = 15, + effectStrength = 1.5, --needed for shockwaves + shockWidth = 3, + refractiveIndex = -1.2, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, BuildingGroundShockWave = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.5, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 25, decay = 25, rampUp = 15, - effectStrength = 1.5, --needed for shockwaves - shockWidth = 3, refractiveIndex = -1.2, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.5, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 25, + decay = 25, + rampUp = 15, + effectStrength = 1.5, --needed for shockwaves + shockWidth = 3, + refractiveIndex = -1.2, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, BuildingGroundShockWaveXL = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam alwaysVisible = false, - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 200, - distanceFalloff = 0.5, noiseStrength = 0.5, noiseScaleSpace = 0.8, - lifeTime = 25, decay = 25, rampUp = 15, - effectStrength = 1.5, --needed for shockwaves - shockWidth = 3, refractiveIndex = -1.2, startRadius = 0.24, - effectType = 'groundShockwave'}, + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 200, + distanceFalloff = 0.5, + noiseStrength = 0.5, + noiseScaleSpace = 0.8, + lifeTime = 25, + decay = 25, + rampUp = 15, + effectStrength = 1.5, --needed for shockwaves + shockWidth = 3, + refractiveIndex = -1.2, + startRadius = 0.24, + effectType = "groundShockwave", + }, }, BuildingExploEnergy = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 2, noiseScaleSpace = 0.95, distanceFalloff = 1.5, - onlyModelMap = 0, startRadius = 0.3, - lifeTime = 20, rampUp = 7, decay = 13, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 2, + noiseScaleSpace = 0.95, + distanceFalloff = 1.5, + onlyModelMap = 0, + startRadius = 0.3, + lifeTime = 20, + rampUp = 7, + decay = 13, + effectType = 0, }, }, MuzzleShockWaveXS = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.2, noiseStrength = 0.3, onlyModelMap = 0, - lifeTime = 6, refractiveIndex = 1.03, decay = 3, rampUp = 1, - effectStrength = 1.9, startRadius = 0.2, shockWidth = -0.80, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.2, noiseStrength = 0.3, onlyModelMap = 0, lifeTime = 6, refractiveIndex = 1.03, decay = 3, rampUp = 1, effectStrength = 1.9, startRadius = 0.2, shockWidth = -0.80, effectType = "airShockwave" }, }, MuzzleShockWave = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.2, noiseStrength = 0.3, onlyModelMap = 0, - lifeTime = 7, refractiveIndex = 1.03, decay = 6, rampUp = 1, - effectStrength = 2.2, startRadius = 0.6, shockWidth = -0.80, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.2, noiseStrength = 0.3, onlyModelMap = 0, lifeTime = 7, refractiveIndex = 1.03, decay = 6, rampUp = 1, effectStrength = 2.2, startRadius = 0.6, shockWidth = -0.80, effectType = "airShockwave" }, }, MuzzleShockWaveXL = { - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, - lifeTime = 9, refractiveIndex = 1.02, decay = 6, rampUp = 2, - effectStrength = 4.0, startRadius = 0.5, shockWidth = -0.75, - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, noiseScaleSpace = 0.1, noiseStrength = 0.2, onlyModelMap = 0, lifeTime = 9, refractiveIndex = 1.02, decay = 6, rampUp = 2, effectStrength = 4.0, startRadius = 0.5, shockWidth = -0.75, effectType = "airShockwave" }, }, - AirShockWaveBeam = { - distortionType = 'beam', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.5, noiseStrength = 1.0, - lifeTime = 15, refractiveIndex = 1.05, + distortionType = "beam", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 0.5, + noiseStrength = 1.0, + lifeTime = 15, + refractiveIndex = 1.05, -- effectStrength = 1.0, --needed for irshockwaves - effectType = 'airShockwave', }, - + effectType = "airShockwave", + }, }, TorpedoProjectile = { - distortionType = 'cone', -- or cone or beam + distortionType = "cone", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 300, - dirx = 1, diry = 0, dirz = 1, theta = 0.10, -- cone distortions only, specify direction and half-angle in radians - noiseStrength = 2, noiseScaleSpace = 0.90, distanceFalloff = 0.9, onlyModelMap = 0, - lifeTime = 0, sustain = 1, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 300, + dirx = 1, + diry = 0, + dirz = 1, + theta = 0.10, -- cone distortions only, specify direction and half-angle in radians + noiseStrength = 2, + noiseScaleSpace = 0.90, + distanceFalloff = 0.9, + onlyModelMap = 0, + lifeTime = 0, + sustain = 1, + effectType = 0, }, }, FlameProjectile = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam fraction = 5, -- only spawn every nth distortion distortionConfig = { - posx = 0, posy = 15, posz = 0, radius = 25, - noiseStrength = 8, noiseScaleSpace = -0.30, distanceFalloff = 0.9, onlyModelMap = 0, - windAffected = 0.2, riseRate = -0.5, - lifeTime = 29, rampUp = 15, decay = 10, effectType = 0, + posx = 0, + posy = 15, + posz = 0, + radius = 25, + noiseStrength = 8, + noiseScaleSpace = -0.30, + distanceFalloff = 0.9, + onlyModelMap = 0, + windAffected = 0.2, + riseRate = -0.5, + lifeTime = 29, + rampUp = 15, + decay = 10, + effectType = 0, }, }, FlameProjectileXL = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam fraction = 3, -- only spawn every nth distortion (lowered from 8 -- cordemon/corcrwh have long flame ranges and 1-in-8 left visible gaps) distortionConfig = { - posx = 0, posy = 45, posz = 0, radius = 25, - noiseStrength = 4, noiseScaleSpace = -0.45, distanceFalloff = 1.6, onlyModelMap = 0, - windAffected = 0.1, riseRate = -0.5, - lifeTime = 40, rampUp = 30, decay = 30, effectType = 0, + posx = 0, + posy = 45, + posz = 0, + radius = 25, + noiseStrength = 4, + noiseScaleSpace = -0.45, + distanceFalloff = 1.6, + onlyModelMap = 0, + windAffected = 0.1, + riseRate = -0.5, + lifeTime = 40, + rampUp = 30, + decay = 30, + effectType = 0, }, }, FireHeat = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 1.3, noiseScaleSpace = 0.60, distanceFalloff = 0.5, - startRadius = 0.3, onlyModelMap = 0, refractiveIndex = 0.9, - windAffected = 1.3, riseRate = 1.5, - lifeTime = 20, rampUp = 10, decay = 10, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 1.3, + noiseScaleSpace = 0.60, + distanceFalloff = 0.5, + startRadius = 0.3, + onlyModelMap = 0, + refractiveIndex = 0.9, + windAffected = 1.3, + riseRate = 1.5, + lifeTime = 20, + rampUp = 10, + decay = 10, + effectType = 0, }, }, ExplosionDistort = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 2, noiseScaleSpace = 0.95, distanceFalloff = 1.5, - onlyModelMap = 0, startRadius = 0.3, - lifeTime = 20, rampUp = 7, decay = 13, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 2, + noiseScaleSpace = 0.95, + distanceFalloff = 1.5, + onlyModelMap = 0, + startRadius = 0.3, + lifeTime = 20, + rampUp = 7, + decay = 13, + effectType = 0, }, }, ExplosionHeatXS = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 1, noiseScaleSpace = 0.75, distanceFalloff = 0.5, onlyModelMap = 0, - lifeTime = 30, rampUp = 15, decay = 20, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 1, + noiseScaleSpace = 0.75, + distanceFalloff = 0.5, + onlyModelMap = 0, + lifeTime = 30, + rampUp = 15, + decay = 20, + effectType = 0, }, }, ExplosionHeat = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 1, noiseScaleSpace = 0.75, distanceFalloff = 0.5, - startRadius = 0.3, onlyModelMap = 0, - lifeTime = 60, rampUp = 30, decay = 30, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 1, + noiseScaleSpace = 0.75, + distanceFalloff = 0.5, + startRadius = 0.3, + onlyModelMap = 0, + lifeTime = 60, + rampUp = 30, + decay = 30, + effectType = 0, }, }, ExplosionHeatNuke = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 75, noiseScaleSpace = 0.034, distanceFalloff = 0.5, onlyModelMap = 0, - windAffected = -1, riseRate = 0.3, startRadius = 0.4, - lifeTime = 12, rampUp = 2, decay = 10, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 75, + noiseScaleSpace = 0.034, + distanceFalloff = 0.5, + onlyModelMap = 0, + windAffected = -1, + riseRate = 0.3, + startRadius = 0.4, + lifeTime = 12, + rampUp = 2, + decay = 10, + effectType = 0, }, }, ExplosionRadiationNuke = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 20, noiseScaleSpace = 0.1, distanceFalloff = 0.5, onlyModelMap = 0, - windAffected = -1, riseRate = -0.5, - lifeTime = 200, rampUp = 100, decay = 100, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 20, + noiseScaleSpace = 0.1, + distanceFalloff = 0.5, + onlyModelMap = 0, + windAffected = -1, + riseRate = -0.5, + lifeTime = 200, + rampUp = 100, + decay = 100, + effectType = 0, }, }, ExplosionRadiationDgun = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! fraction = 6, distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 6, noiseScaleSpace = 0.55, distanceFalloff = 1.2, onlyModelMap = 1, - windAffected = -1, riseRate = -0.5, - lifeTime = 50, rampUp = 20, decay = 25, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 6, + noiseScaleSpace = 0.55, + distanceFalloff = 1.2, + onlyModelMap = 1, + windAffected = -1, + riseRate = -0.5, + lifeTime = 50, + rampUp = 20, + decay = 25, + effectType = 0, }, }, JunoHeat = { -- unused - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 1, noiseScaleSpace = 0.75, distanceFalloff = 0.5, onlyModelMap = 0, - lifeTime = 60, rampUp = 30, decay = 30, effectType = 7, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 1, + noiseScaleSpace = 0.75, + distanceFalloff = 0.5, + onlyModelMap = 0, + lifeTime = 60, + rampUp = 30, + decay = 30, + effectType = 7, }, }, EMPShockWave = { -- Short distortion wave for EMP - distortionType = 'point', + distortionType = "point", yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 2.5, noiseScaleSpace = 0.13, distanceFalloff = 0.1, onlyModelMap = 1, - lifeTime = 20, effectStrength = -1.5, startRadius = 0.4, - rampUp = 5, decay = 15, shockWidth = 8, effectType = 2, + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 2.5, + noiseScaleSpace = 0.13, + distanceFalloff = 0.1, + onlyModelMap = 1, + lifeTime = 20, + effectStrength = -1.5, + startRadius = 0.4, + rampUp = 5, + decay = 15, + shockWidth = 8, + effectType = 2, }, }, EMPNoise = { -- Circle area-distortion-effect for EMP - distortionType = 'point', + distortionType = "point", yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 0.85, noiseScaleSpace = 0.1, distanceFalloff = 0.1, onlyModelMap = 1, - startRadius = 0.60, shockWidth = 20, refractiveIndex = -1.2, + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 0.85, + noiseScaleSpace = 0.1, + distanceFalloff = 0.1, + onlyModelMap = 1, + startRadius = 0.60, + shockWidth = 20, + refractiveIndex = -1.2, effectStrength = 0.7, - windAffected = -0.95, riseRate = -0.95, - lifeTime = 80, rampUp = 10, decay = 30, effectType = 13, + windAffected = -0.95, + riseRate = -0.95, + lifeTime = 80, + rampUp = 10, + decay = 30, + effectType = 13, }, }, EMPRipples = { -- Circle area-distortion-effect for EMP - distortionType = 'point', + distortionType = "point", yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 200, - noiseStrength = 6.0, noiseScaleSpace = 0.38, distanceFalloff = 0.1, onlyModelMap = -1, - startRadius = 0.5, shockWidth = 1.05, refractiveIndex = -1.2, + posx = 0, + posy = 0, + posz = 0, + radius = 200, + noiseStrength = 6.0, + noiseScaleSpace = 0.38, + distanceFalloff = 0.1, + onlyModelMap = -1, + startRadius = 0.5, + shockWidth = 1.05, + refractiveIndex = -1.2, effectStrength = 5, - windAffected = -1, riseRate = -1, - lifeTime = 59, rampUp = 19, decay = 40, effectType = 'groundShockwave', + windAffected = -1, + riseRate = -1, + lifeTime = 59, + rampUp = 19, + decay = 40, + effectType = "groundShockwave", }, }, AirShockWaveEMP = { -- Noised/electric Shockwave ripple on units - distortionType = 'point', -- or cone or beam - distortionConfig = { posx = 0, posy = 0, posz = 0, radius = 150, - noiseScaleSpace = 0.15, noiseStrength = 0.8, onlyModelMap = 0, - lifeTime = 12, refractiveIndex = 1.03, decay = 4, rampUp = 8, - effectStrength = 1.75, shockWidth = -0.30, --needed for airshockwaves - effectType = "airShockwave", }, - + distortionType = "point", -- or cone or beam + distortionConfig = { + posx = 0, + posy = 0, + posz = 0, + radius = 150, + noiseScaleSpace = 0.15, + noiseStrength = 0.8, + onlyModelMap = 0, + lifeTime = 12, + refractiveIndex = 1.03, + decay = 4, + rampUp = 8, + effectStrength = 1.75, + shockWidth = -0.30, --needed for airshockwaves + effectType = "airShockwave", + }, }, JunoShockWave = { -- big distorted shockwave - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 2.5, noiseScaleSpace = 0.13, distanceFalloff = 0.1, onlyModelMap = 1, - lifeTime = 40, effectStrength = -11, startRadius = 0.2, - rampUp = 10, decay = 30, shockWidth = 14, effectType = 2, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 2.5, + noiseScaleSpace = 0.13, + distanceFalloff = 0.1, + onlyModelMap = 1, + lifeTime = 40, + effectStrength = -11, + startRadius = 0.2, + rampUp = 10, + decay = 30, + shockWidth = 14, + effectType = 2, }, }, JunoNoise = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 600, - noiseStrength = 0.45, noiseScaleSpace = 1.5, distanceFalloff = 0.1, onlyModelMap = 1, - startRadius = 0.90, shockWidth = 20, refractiveIndex = -1.2, + posx = 0, + posy = 0, + posz = 0, + radius = 600, + noiseStrength = 0.45, + noiseScaleSpace = 1.5, + distanceFalloff = 0.1, + onlyModelMap = 1, + startRadius = 0.90, + shockWidth = 20, + refractiveIndex = -1.2, effectStrength = 0.7, - windAffected = -0.5, riseRate = 2, - lifeTime = 675, rampUp = 100, decay = 500, effectType = 13, + windAffected = -0.5, + riseRate = 2, + lifeTime = 675, + rampUp = 100, + decay = 500, + effectType = 13, }, }, ProjectileDgun = { -- spawned on explosions - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam yOffset = 0, -- Y offsets are only ever used for explosions! distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 10, - noiseStrength = 20, noiseScaleSpace = -0.1, distanceFalloff = 0.5, onlyModelMap = 0, - windAffected = -1, riseRate = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 10, + noiseStrength = 20, + noiseScaleSpace = -0.1, + distanceFalloff = 0.5, + onlyModelMap = 0, + windAffected = -1, + riseRate = 0, --magnificationRate = 8.0, - lifeTime = 75, rampUp = 50, decay = 25, effectType = 0, + lifeTime = 75, + rampUp = 50, + decay = 25, + effectType = 0, }, }, MuzzleFlash = { -- spawned on projectilecreated - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 150, - lifeTime = 6, sustain = 0.0035, effectType = 0, + posx = 0, + posy = 0, + posz = 0, + radius = 150, + lifeTime = 6, + sustain = 0.0035, + effectType = 0, }, }, } - local SizeRadius = { - Quaco = 2.5, - Zetto = 5, - Atto = 10, - Banthlaser = 13, - Femto = 16, - KorgLaser = 19, - Pico = 26, - Nano = 34, - Micro = 44, - DGun = 50, - Tiniest = 56, - Tiny = 72, - Smallest = 90, - Smaller = 115, - Small = 140, - Smallish = 165, - SmallMedium = 190, - Medium = 220, - Mediumer = 260, - MediumLarge = 300, - Large = 400, - Juno = 450, - Larger = 500, - Largest = 650, - Mega = 800, - MegaXL = 1000, - Armnuke = 1280, - MegaXXL = 1500, - Cornuke = 1920, - Giga = 2000, - Tera = 3500, - Planetary = 5000, + Quaco = 2.5, + Zetto = 5, + Atto = 10, + Banthlaser = 13, + Femto = 16, + KorgLaser = 19, + Pico = 26, + Nano = 34, + Micro = 44, + DGun = 50, + Tiniest = 56, + Tiny = 72, + Smallest = 90, + Smaller = 115, + Small = 140, + Smallish = 165, + SmallMedium = 190, + Medium = 220, + Mediumer = 260, + MediumLarge = 300, + Large = 400, + Juno = 450, + Larger = 500, + Largest = 650, + Mega = 800, + MegaXL = 1000, + Armnuke = 1280, + MegaXXL = 1500, + Cornuke = 1920, + Giga = 2000, + Tera = 3500, + Planetary = 5000, } - local globalDamageMult = Spring.GetModOptions().multiplier_weapondamage or 1 local function GetClosestSizeClass(desiredsize) local delta = math.huge local best = nil for classname, size in pairs(SizeRadius) do - if math.abs(size-desiredsize) < delta then - delta = math.abs(size-desiredsize) + if math.abs(size - desiredsize) < delta then + delta = math.abs(size - desiredsize) best = classname end end return best, SizeRadius[best] end -local lifeTimes = {Fast = 5, Quick = 10, Moderate = 30, Long = 90, Glacial = 270} +local lifeTimes = { Fast = 5, Quick = 10, Moderate = 30, Long = 90, Glacial = 270 } local distortionClasses = {} local function deepcopy(orig) local orig_type = type(orig) local copy - if orig_type == 'table' then + if orig_type == "table" then copy = {} for orig_key, orig_value in next, orig, nil do copy[deepcopy(orig_key)] = deepcopy(orig_value) @@ -907,9 +1361,9 @@ local function deepcopy(orig) end local usedclasses = 0 local function GetDistortionClass(baseClassname, sizekey, additionaloverrides) - local distortionClassKey = baseClassname .. (sizekey or "") - if additionaloverrides and type(additionaloverrides) == 'table' then - for k,v in pairs(additionaloverrides) do + local distortionClassKey = baseClassname .. (sizekey or "") + if additionaloverrides and type(additionaloverrides) == "table" then + for k, v in pairs(additionaloverrides) do distortionClassKey = distortionClassKey .. "_" .. tostring(k) .. "=" .. tostring(v) end end @@ -920,21 +1374,21 @@ local function GetDistortionClass(baseClassname, sizekey, additionaloverrides) if not BaseClasses[baseClassname] then error("BaseClasses[" .. tostring(baseClassname) .. "] is nil!") end - distortionClasses[distortionClassKey] = deepcopy(BaseClasses[baseClassname]) - distortionClasses[distortionClassKey].distortionClassName = distortionClassKey - usedclasses = usedclasses + 1 - local distortionConfig = distortionClasses[distortionClassKey].distortionConfig or {} - - if sizekey and SizeRadius[sizekey] then - distortionConfig.radius = SizeRadius[sizekey] - if additionaloverrides then - for k,v in pairs(additionaloverrides) do - distortionConfig[k] = v - end + distortionClasses[distortionClassKey] = deepcopy(BaseClasses[baseClassname]) + distortionClasses[distortionClassKey].distortionClassName = distortionClassKey + usedclasses = usedclasses + 1 + local distortionConfig = distortionClasses[distortionClassKey].distortionConfig or {} + + if sizekey and SizeRadius[sizekey] then + distortionConfig.radius = SizeRadius[sizekey] + if additionaloverrides then + for k, v in pairs(additionaloverrides) do + distortionConfig[k] = v end - else - print("Warning: sizekey or SizeRadius[sizekey] is nil!") - end + end + else + print("Warning: sizekey or SizeRadius[sizekey] is nil!") + end end return distortionClasses[distortionClassKey] end @@ -942,11 +1396,16 @@ end -------------------------------------------------------------------------------- local gibDistortion = { - distortionType = 'point', -- or cone or beam + distortionType = "point", -- or cone or beam pieceName = nil, -- optional distortionConfig = { - posx = 0, posy = 0, posz = 0, radius = 12, - lifeTime = 75, decay = 75, effectType = 0 + posx = 0, + posy = 0, + posz = 0, + radius = 12, + lifeTime = 75, + decay = 75, + effectType = 0, }, } @@ -954,12 +1413,11 @@ local gibDistortion = { local muzzleFlashDistortions = {} local explosionDistortions = {} -local projectileDefDistortions = { - ['default'] = { - distortionType = 'point', - distortionConfig = { posx = 0, posy = 16, posz = 0, radius = 420, - lifeTime = 50, sustain = 20, effectType = 0}, - } +local projectileDefDistortions = { + ["default"] = { + distortionType = "point", + distortionConfig = { posx = 0, posy = 16, posz = 0, radius = 420, lifeTime = 50, sustain = 20, effectType = 0 }, + }, } ----------------------------------- @@ -969,446 +1427,407 @@ local projectileDefDistortions = { -- should have a muzzleFlash, projectileDistortion, or an explosionDistortion. -- See https://docs.google.com/document/d/16mvYJX8WJ8cNjGe_3zhrymTOzPoSkFprr78i_vpH7yA/edit?tab=overrideTable.0#heading=h.qx93abxpcjjo for details - -- 1. explosionDistortion - Weapon explosions based on damage and type - -- Note that this must be a table of distortions, as an explosion can consist of multiple effects, e.g.: - -- explosionDistortions[weaponID] = {GetDistortionClass("ExplosionHeat"), GetDistortionClass("GroundShockWave"), GetDistortionClass("AirShockWave")} +-- Note that this must be a table of distortions, as an explosion can consist of multiple effects, e.g.: +-- explosionDistortions[weaponID] = {GetDistortionClass("ExplosionHeat"), GetDistortionClass("GroundShockWave"), GetDistortionClass("AirShockWave")} -- 2. muzzleFlash - -- Note that this must be a table of distortions, as a muzzle flash can consist of multiple effects, e.g.: - -- muzzleFlashDistortions[weaponID] = {GetDistortionClass("GroundShockWave"), GetDistortionClass("AirShockWave")} +-- Note that this must be a table of distortions, as a muzzle flash can consist of multiple effects, e.g.: +-- muzzleFlashDistortions[weaponID] = {GetDistortionClass("GroundShockWave"), GetDistortionClass("AirShockWave")} -- 3. Weapon Projectiles, projectileDistortion - -- NOTE THAT ONLY A SINGLE DISTORTION CAN BE ASSIGNED TO A FLYING PROJECTILE!, e.g.: - -- projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile") +-- NOTE THAT ONLY A SINGLE DISTORTION CAN BE ASSIGNED TO A FLYING PROJECTILE!, e.g.: +-- projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile") -- 4-5. Unit/building Explosions, these also go into explosionDistortions, as tables. - -- Note that the weapons that define these explosions are in weapons/Unit_Explosions.lua, - -- and the weaponDef.customParams.unitexplosion is set to 1. - -- Unit / building explosions are not differentiated, they could easily be, by adding a customParam to the weaponDef, such as - -- weaponDef.customParams.buildingexplosion = 1 - -- In this case, also also edit DeferredLightsGL4Config to ensure that both unitexplosions and weaponexplosions are handled correctly. - -- (search for weaponDef.customParams.unitexplosion) - - - - -- CegTag -> distortion override tables for missile thruster trails - -- Uses MissileProjectile as base class with per-size overrides (same pattern as manual overrides) - local missileDistortionByCeg = { - missiletrailtiny = { radius = 70, theta = 0.07, noiseStrength = 4.0, noiseScaleSpace = 0.85, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 10 }, - missiletrailsmall = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, - ["missiletrailsmall-simple"] = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, - ["missiletrailsmall-red"] = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, - ["missiletrailsmall-starburst"] = { radius = 75, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, - missiletrailfighter = { radius = 75, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, - missiletrailaa = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, - missiletrailmedium = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, - ["missiletrailmedium-red"] = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, - ["missiletrailmedium-starburst"] = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, - missiletrailviper = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, - ["missiletraillarge-red"] = { radius = 140, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, - ["missiletrailaa-large"] = { radius = 140, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, - missiletrailmship = { radius = 140, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, - ["missiletrail-juno"] = { radius = 140, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, - ["cruisemissiletrail-tacnuke"] = { radius = 160, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, - ["cruisemissiletrail-emp"] = { radius = 150, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, - nuketrail = { radius = 230, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.6, distanceFalloff = 1.0, effectStrength = 3.3, yoffset = 20 }, - } - - local function AssignDistortionsToAllWeapons() - for weaponID=1, #WeaponDefs do - local weaponDef = WeaponDefs[weaponID] - local damage = 100 - for cat=0, #weaponDef.damages do - if Game.armorTypes[cat] and Game.armorTypes[cat] == 'default' then - damage = weaponDef.damages[cat] - break - end +-- Note that the weapons that define these explosions are in weapons/Unit_Explosions.lua, +-- and the weaponDef.customParams.unitexplosion is set to 1. +-- Unit / building explosions are not differentiated, they could easily be, by adding a customParam to the weaponDef, such as +-- weaponDef.customParams.buildingexplosion = 1 +-- In this case, also also edit DeferredLightsGL4Config to ensure that both unitexplosions and weaponexplosions are handled correctly. +-- (search for weaponDef.customParams.unitexplosion) + +-- CegTag -> distortion override tables for missile thruster trails +-- Uses MissileProjectile as base class with per-size overrides (same pattern as manual overrides) +local missileDistortionByCeg = { + missiletrailtiny = { radius = 70, theta = 0.07, noiseStrength = 4.0, noiseScaleSpace = 0.85, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 10 }, + missiletrailsmall = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, + ["missiletrailsmall-simple"] = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, + ["missiletrailsmall-red"] = { radius = 75, theta = 0.08, noiseStrength = 4.0, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, + ["missiletrailsmall-starburst"] = { radius = 75, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, + missiletrailfighter = { radius = 75, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 12 }, + missiletrailaa = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, + missiletrailmedium = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, + ["missiletrailmedium-red"] = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, + ["missiletrailmedium-starburst"] = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, + missiletrailviper = { radius = 110, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.75, distanceFalloff = 1.4, effectStrength = 2.5, yoffset = 16 }, + ["missiletraillarge-red"] = { radius = 140, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, + ["missiletrailaa-large"] = { radius = 140, theta = 0.08, noiseStrength = 4.5, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, + missiletrailmship = { radius = 140, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.7, distanceFalloff = 1.4, effectStrength = 3.3, yoffset = 20 }, + ["missiletrail-juno"] = { radius = 140, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, + ["cruisemissiletrail-tacnuke"] = { radius = 160, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, + ["cruisemissiletrail-emp"] = { radius = 150, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.65, distanceFalloff = 1.2, effectStrength = 3.3, yoffset = 20 }, + nuketrail = { radius = 230, theta = 0.08, noiseStrength = 5.0, noiseScaleSpace = 0.6, distanceFalloff = 1.0, effectStrength = 3.3, yoffset = 20 }, +} + +local function AssignDistortionsToAllWeapons() + for weaponID = 1, #WeaponDefs do + local weaponDef = WeaponDefs[weaponID] + local damage = 100 + for cat = 0, #weaponDef.damages do + if Game.armorTypes[cat] and Game.armorTypes[cat] == "default" then + damage = weaponDef.damages[cat] + break end + end - -- Start by collecting some common parameters of the weapon - damage = (damage / globalDamageMult) + ((damage * (globalDamageMult-1))*0.25) - - local projectileSpeed = weaponDef.weaponVelocity or 10 - local weaponRange = weaponDef.range or 0 - local weaponReloadTime = weaponDef.reloadtime - local areaofeffect = weaponDef.damageAreaOfEffect or 0 - --local weaponImpulse = weaponDef.impulseFactor or 0 (doesn't seem to work) - local life = 12 - local radius = ((areaofeffect*0.7) + (areaofeffect * weaponDef.edgeEffectiveness * 1.1)) - local muzzleflashRadius = radius^0.75 + (weaponRange * 0.015) + (projectileSpeed * 0.045) --for muzzleflashes - --local effectiveRangeExplo = ((areaofeffect * 1.2) - ((1 - weaponDef.edgeEffectiveness) * areaofeffect * 0.5)) --+ (weaponImpulse * 1000) - local effectiveRangeExplo = areaofeffect * (0.75 + (0.4 * math.sqrt(weaponDef.edgeEffectiveness))) - --local effectiveUnitRangeExplo = areaofeffect * 2 - - - --local radius = (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.55) - - local muzzleFlash = true -- by default add muzzleflash to weapon being fired - local explosionDistortion = true -- by default, add explosion distortion to weapon on explosion - local sizeclass = GetClosestSizeClass(radius) - local t = {} - local overrideTable = {} - local antiair = string.find(weaponDef.cegTag, 'aa') or false - local paralyzer = (weaponDef.paralyzer) or false - local scavenger = string.find(weaponDef.name, '_scav') or false - local juno = string.find(weaponDef.name, 'juno') or false - --local isBuilding = - local isUnitExplosion = string.find(weaponDef.name, 'explosion') or false - local isBuildingExplosion = string.find(weaponDef.name, 'buildingexplosion') or false - - -- Assign projectileDistortions based on type, and decide weather muzzleflashes or explosiondistortions are needed - if weaponDef.type == 'BeamLaser' then - muzzleFlash = false - - if string.find(weaponDef.name, 'heat') then - -- Heat rays get their own stronger distortion class - local heatRadius = (1.5 * (weaponDef.size * weaponDef.size * weaponDef.size)) + (5 * radius) - sizeclass = GetClosestSizeClass(heatRadius * 0.25) - projectileDefDistortions[weaponID] = GetDistortionClass("HeatRayHeat", sizeclass, overrideTable) - else - -- -- Auto-scale distortion based on beam power and size - -- local beamThickness = weaponDef.thickness or 2 - -- local beamSize = weaponDef.size or 1 - -- -- DPS from reloadtime captures rapid-fire beams (armbeamer) correctly - -- local dps = damage / math.max(weaponReloadTime or 1, 0.05) - -- -- Power factor: 0..1 range, light rapid-fire ~0.18, heavy beams ~1.0 - -- local powerFactor = math.min(1.0, dps / 1500) - - -- -- Distortion radius: floor of 20 so even light beams produce visible shimmer - -- local beamDistRadius = math.max(5, beamThickness * 1.1 + beamSize * 1.1) - -- if weaponDef.paralyzer then - -- beamDistRadius = beamDistRadius * 0.6 - -- end - -- sizeclass = GetClosestSizeClass(beamDistRadius) - - -- -- Scale noise and effect strength by power - -- local beamOverrides = { - -- noiseStrength = 0.4 + 0.3 * powerFactor, - -- effectStrength = 1.2 + 0.75 * powerFactor, - -- noiseScaleSpace = 2.3 - 4.0 * powerFactor, -- tighter noise for heavier beams - -- } - - -- projectileDefDistortions[weaponID] = GetDistortionClass("LaserBeamHeat", sizeclass, beamOverrides) - end - - elseif weaponDef.type == 'LaserCannon' then - -- take the name in lower-case - local lname = weaponDef.name:lower() - - -- if it's a machine-gun or rapid-fire, give it NO distortion - if lname:find('mg_weapon') or lname:find('legflak') or lname:find('machinegun') or lname:find('shotgun') then - Spring.Echo("LaserCannon no distortion for "..weaponDef.name) - --projectileDefDistortions[weaponID] = GetDistortionClass("NoEffect", sizeclass, overrideTable) - - -- otherwise give it the regular cannon distortion - else - local sizeclass = GetClosestSizeClass(radius) - projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) - end - - - - - elseif weaponDef.type == 'DistortionningCannon' then - --sizeclass = GetClosestSizeClass(33 + (radius*2.5)) - projectileDefDistortions[weaponID] = GetDistortionClass("LaserProjectile", sizeclass, overrideTable) - - elseif weaponDef.type == 'MissileLauncher'then - local tag = weaponDef.cegTag and weaponDef.cegTag:lower() or "" - local thrusterOverrides = missileDistortionByCeg[tag] - if thrusterOverrides then - --Spring.Echo("[DistortionConfig] MissileLauncher " .. weaponDef.name .. " cegTag=" .. tag .. " radius=" .. thrusterOverrides.radius) - projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, thrusterOverrides) - else - projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, overrideTable) - end - - elseif weaponDef.type == 'StarburstLauncher' then - local tag = weaponDef.cegTag and weaponDef.cegTag:lower() or "" - local thrusterOverrides = missileDistortionByCeg[tag] - if thrusterOverrides then - --Spring.Echo("[DistortionConfig] StarburstLauncher " .. weaponDef.name .. " cegTag=" .. tag .. " radius=" .. thrusterOverrides.radius) - projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, thrusterOverrides) - else - projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, overrideTable) - end - sizeclass = GetClosestSizeClass(radius) - - - elseif weaponDef.type == 'Cannon' then - - -- if string.find(weaponDef.name, 'flak') then - -- sizeclass = 0 - -- life = 0 + -- Start by collecting some common parameters of the weapon + damage = (damage / globalDamageMult) + ((damage * (globalDamageMult - 1)) * 0.25) + + local projectileSpeed = weaponDef.weaponVelocity or 10 + local weaponRange = weaponDef.range or 0 + local weaponReloadTime = weaponDef.reloadtime + local areaofeffect = weaponDef.damageAreaOfEffect or 0 + --local weaponImpulse = weaponDef.impulseFactor or 0 (doesn't seem to work) + local life = 12 + local radius = ((areaofeffect * 0.7) + (areaofeffect * weaponDef.edgeEffectiveness * 1.1)) + local muzzleflashRadius = radius ^ 0.75 + (weaponRange * 0.015) + (projectileSpeed * 0.045) --for muzzleflashes + --local effectiveRangeExplo = ((areaofeffect * 1.2) - ((1 - weaponDef.edgeEffectiveness) * areaofeffect * 0.5)) --+ (weaponImpulse * 1000) + local effectiveRangeExplo = areaofeffect * (0.75 + (0.4 * math.sqrt(weaponDef.edgeEffectiveness))) + --local effectiveUnitRangeExplo = areaofeffect * 2 + + --local radius = (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.55) + + local muzzleFlash = true -- by default add muzzleflash to weapon being fired + local explosionDistortion = true -- by default, add explosion distortion to weapon on explosion + local sizeclass = GetClosestSizeClass(radius) + local t = {} + local overrideTable = {} + local antiair = string.find(weaponDef.cegTag, "aa") or false + local paralyzer = weaponDef.paralyzer or false + local scavenger = string.find(weaponDef.name, "_scav") or false + local juno = string.find(weaponDef.name, "juno") or false + --local isBuilding = + local isUnitExplosion = string.find(weaponDef.name, "explosion") or false + local isBuildingExplosion = string.find(weaponDef.name, "buildingexplosion") or false + + -- Assign projectileDistortions based on type, and decide weather muzzleflashes or explosiondistortions are needed + if weaponDef.type == "BeamLaser" then + muzzleFlash = false + + if string.find(weaponDef.name, "heat") then + -- Heat rays get their own stronger distortion class + local heatRadius = (1.5 * (weaponDef.size * weaponDef.size * weaponDef.size)) + (5 * radius) + sizeclass = GetClosestSizeClass(heatRadius * 0.25) + projectileDefDistortions[weaponID] = GetDistortionClass("HeatRayHeat", sizeclass, overrideTable) + else + -- -- Auto-scale distortion based on beam power and size + -- local beamThickness = weaponDef.thickness or 2 + -- local beamSize = weaponDef.size or 1 + -- -- DPS from reloadtime captures rapid-fire beams (armbeamer) correctly + -- local dps = damage / math.max(weaponReloadTime or 1, 0.05) + -- -- Power factor: 0..1 range, light rapid-fire ~0.18, heavy beams ~1.0 + -- local powerFactor = math.min(1.0, dps / 1500) + + -- -- Distortion radius: floor of 20 so even light beams produce visible shimmer + -- local beamDistRadius = math.max(5, beamThickness * 1.1 + beamSize * 1.1) + -- if weaponDef.paralyzer then + -- beamDistRadius = beamDistRadius * 0.6 -- end - --muzzleFlash = true - sizeclass = GetClosestSizeClass(radius) - --projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) - - + -- sizeclass = GetClosestSizeClass(beamDistRadius) + -- -- Scale noise and effect strength by power + -- local beamOverrides = { + -- noiseStrength = 0.4 + 0.3 * powerFactor, + -- effectStrength = 1.2 + 0.75 * powerFactor, + -- noiseScaleSpace = 2.3 - 4.0 * powerFactor, -- tighter noise for heavier beams + -- } - elseif weaponDef.type == 'DGun' then - --muzzleFlash = true --doesnt work - sizeclass = "DGun" - - projectileDefDistortions[weaponID] = GetDistortionClass("AirShockWaveDgun", sizeclass, overrideTable) - --projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) - projectileDefDistortions[weaponID].yOffset = 32 + -- projectileDefDistortions[weaponID] = GetDistortionClass("LaserBeamHeat", sizeclass, beamOverrides) + end + elseif weaponDef.type == "LaserCannon" then + -- take the name in lower-case + local lname = weaponDef.name:lower() - elseif weaponDef.type == 'TorpedoLauncher' then - sizeclass = "Small" - projectileDefDistortions[weaponID] = GetDistortionClass("TorpedoProjectile", sizeclass, overrideTable) + -- if it's a machine-gun or rapid-fire, give it NO distortion + if lname:find("mg_weapon") or lname:find("legflak") or lname:find("machinegun") or lname:find("shotgun") then + Spring.Echo("LaserCannon no distortion for " .. weaponDef.name) + --projectileDefDistortions[weaponID] = GetDistortionClass("NoEffect", sizeclass, overrideTable) - elseif weaponDef.type == 'Shield' then - sizeclass = "Large" + -- otherwise give it the regular cannon distortion + else + local sizeclass = GetClosestSizeClass(radius) projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) - - elseif weaponDef.type == 'AircraftBomb' then - projectileDefDistortions[weaponID] = GetDistortionClass("AirBombProjectile", "Warm", sizeclass, overrideTable) - - elseif weaponDef.type == 'Flame' then - --sizeclass = "Small" - --sizeclass = GetClosestSizeClass(radius*3) - projectileDefDistortions[weaponID] = GetDistortionClass("FlameProjectile", sizeclass, overrideTable) end - - -- Add a muzzle flash if needed: - if muzzleFlash then - local mymuzzleFlash - - if damage < 100 then - --Spring.Echo("Skipping muzzle flash for low damage:", damage) - elseif damage < 275 then - mymuzzleFlash = GetDistortionClass("MuzzleShockWaveXS", GetClosestSizeClass(muzzleflashRadius * 0.7), overrideTable) - --mymuzzleflash.yOffset = 10 --This does not seem to work - --mymuzzleflash.distortionConfig.radius = radius * 0.6 --What does this do? - elseif damage <= 500 then - mymuzzleFlash = GetDistortionClass("MuzzleShockWave", GetClosestSizeClass(muzzleflashRadius ), overrideTable) - else - mymuzzleFlash = GetDistortionClass("MuzzleShockWaveXL", GetClosestSizeClass(muzzleflashRadius * 0.6), overrideTable) - - end - muzzleFlashDistortions[weaponID] = { mymuzzleFlash } -- note that multiple distortions can be added + elseif weaponDef.type == "DistortionningCannon" then + --sizeclass = GetClosestSizeClass(33 + (radius*2.5)) + projectileDefDistortions[weaponID] = GetDistortionClass("LaserProjectile", sizeclass, overrideTable) + elseif weaponDef.type == "MissileLauncher" then + local tag = weaponDef.cegTag and weaponDef.cegTag:lower() or "" + local thrusterOverrides = missileDistortionByCeg[tag] + if thrusterOverrides then + --Spring.Echo("[DistortionConfig] MissileLauncher " .. weaponDef.name .. " cegTag=" .. tag .. " radius=" .. thrusterOverrides.radius) + projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, thrusterOverrides) + else + projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, overrideTable) end + elseif weaponDef.type == "StarburstLauncher" then + local tag = weaponDef.cegTag and weaponDef.cegTag:lower() or "" + local thrusterOverrides = missileDistortionByCeg[tag] + if thrusterOverrides then + --Spring.Echo("[DistortionConfig] StarburstLauncher " .. weaponDef.name .. " cegTag=" .. tag .. " radius=" .. thrusterOverrides.radius) + projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, thrusterOverrides) + else + projectileDefDistortions[weaponID] = GetDistortionClass("MissileProjectile", sizeclass, overrideTable) + end + sizeclass = GetClosestSizeClass(radius) + elseif weaponDef.type == "Cannon" then + -- if string.find(weaponDef.name, 'flak') then + -- sizeclass = 0 + -- life = 0 + -- end + --muzzleFlash = true + sizeclass = GetClosestSizeClass(radius) + --projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) + elseif weaponDef.type == "DGun" then + --muzzleFlash = true --doesnt work + sizeclass = "DGun" + + projectileDefDistortions[weaponID] = GetDistortionClass("AirShockWaveDgun", sizeclass, overrideTable) + --projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) + projectileDefDistortions[weaponID].yOffset = 32 + elseif weaponDef.type == "TorpedoLauncher" then + sizeclass = "Small" + projectileDefDistortions[weaponID] = GetDistortionClass("TorpedoProjectile", sizeclass, overrideTable) + elseif weaponDef.type == "Shield" then + sizeclass = "Large" + projectileDefDistortions[weaponID] = GetDistortionClass("CannonProjectile", sizeclass, overrideTable) + elseif weaponDef.type == "AircraftBomb" then + projectileDefDistortions[weaponID] = GetDistortionClass("AirBombProjectile", "Warm", sizeclass, overrideTable) + elseif weaponDef.type == "Flame" then + --sizeclass = "Small" + --sizeclass = GetClosestSizeClass(radius*3) + projectileDefDistortions[weaponID] = GetDistortionClass("FlameProjectile", sizeclass, overrideTable) + end + -- Add a muzzle flash if needed: + if muzzleFlash then + local mymuzzleFlash + + if damage < 100 then + --Spring.Echo("Skipping muzzle flash for low damage:", damage) + elseif damage < 275 then + mymuzzleFlash = GetDistortionClass("MuzzleShockWaveXS", GetClosestSizeClass(muzzleflashRadius * 0.7), overrideTable) + --mymuzzleflash.yOffset = 10 --This does not seem to work + --mymuzzleflash.distortionConfig.radius = radius * 0.6 --What does this do? + elseif damage <= 500 then + mymuzzleFlash = GetDistortionClass("MuzzleShockWave", GetClosestSizeClass(muzzleflashRadius), overrideTable) + else + mymuzzleFlash = GetDistortionClass("MuzzleShockWaveXL", GetClosestSizeClass(muzzleflashRadius * 0.6), overrideTable) + end + muzzleFlashDistortions[weaponID] = { mymuzzleFlash } -- note that multiple distortions can be added + end - -- Add explosiondistortions if needed: - if explosionDistortion then - - if weaponDef.type == 'DGun' then - - elseif weaponDef.type == 'Flame' then - explosionDistortions[weaponID] = {GetDistortionClass("FireHeat", GetClosestSizeClass(radius), overrideTable)} + -- Add explosiondistortions if needed: + if explosionDistortion then + if weaponDef.type == "DGun" then + elseif weaponDef.type == "Flame" then + explosionDistortions[weaponID] = { GetDistortionClass("FireHeat", GetClosestSizeClass(radius), overrideTable) } -- elseif weaponDef.type == 'LaserCannon' then -- No shockwaves for lasercannons -- explosionDistortions[weaponID] = {GetDistortionClass("AirShockWaveMG", GetClosestSizeClass(radius), overrideTable)} + elseif weaponDef.type == "TorpedoLauncher" then + explosionDistortions[weaponID] = { GetDistortionClass("TorpedoShockWave", GetClosestSizeClass(radius), overrideTable) } + elseif weaponDef.type == "BeamLaser" then + sizeclass = GetClosestSizeClass(radius * 0.15) -- works + overrideTable = { lifeTime = 2 } -- doesnt work + elseif weaponDef.type == "DistortionningCannon" then + sizeclass = GetClosestSizeClass(radius * 1.2) + else + if weaponDef.type == "AircraftBomb" then + if weaponDef.paralyzer then + else + explosionDistortions[weaponID] = { GetDistortionClass("AirShockWave", GetClosestSizeClass(radius), overrideTable) } + explosionDistortions[weaponID] = { GetDistortionClass("GroundShockWave", GetClosestSizeClass(radius), overrideTable) } + explosionDistortions[weaponID] = { GetDistortionClass("ExplosionHeat", GetClosestSizeClass(radius), overrideTable) } + end + end + + -- radius = ((weaponDef.damageAreaOfEffect*1.9) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) + -- if string.find(weaponDef.name, 'juno') then + -- radius = 675 + -- end - elseif weaponDef.type == 'TorpedoLauncher' then - explosionDistortions[weaponID] = {GetDistortionClass("TorpedoShockWave", GetClosestSizeClass(radius), overrideTable)} + -- UNIT explosions + if weaponDef.customParams.unitexplosion then + effectiveRangeExplo = effectiveRangeExplo * 2.1 - elseif weaponDef.type == 'BeamLaser' then - sizeclass = GetClosestSizeClass(radius*0.15) -- works - overrideTable = {lifeTime = 2} -- doesnt work + if string.find(weaponDef.name, "windboom") then + effectiveRangeExplo = 40 + --areaofeffect = areaofeffect * 0.5 + end - elseif weaponDef.type == 'DistortionningCannon' then - sizeclass = GetClosestSizeClass(radius*1.2) + if string.find(weaponDef.name, "nanoboom") then + effectiveRangeExplo = 58 + --areaofeffect = areaofeffect * 0.5 + end - else - if weaponDef.type == 'AircraftBomb' then - if weaponDef.paralyzer then + if string.find(weaponDef.name, "energystorage") then + effectiveRangeExplo = effectiveRangeExplo * 0.6 + end - else - explosionDistortions[weaponID] = {GetDistortionClass("AirShockWave", GetClosestSizeClass(radius), overrideTable)} - explosionDistortions[weaponID] = {GetDistortionClass("GroundShockWave", GetClosestSizeClass(radius), overrideTable)} - explosionDistortions[weaponID] = {GetDistortionClass("ExplosionHeat", GetClosestSizeClass(radius), overrideTable)} - end + if string.find(weaponDef.name, "geo") then --currently override + effectiveRangeExplo = 100 end - -- radius = ((weaponDef.damageAreaOfEffect*1.9) + (weaponDef.damageAreaOfEffect * weaponDef.edgeEffectiveness * 1.35)) - -- if string.find(weaponDef.name, 'juno') then - -- radius = 675 - -- end - - -- UNIT explosions - if weaponDef.customParams.unitexplosion then - effectiveRangeExplo = effectiveRangeExplo * 2.1 - - if string.find(weaponDef.name, 'windboom') then - effectiveRangeExplo = 40 - --areaofeffect = areaofeffect * 0.5 - end - - if string.find(weaponDef.name, 'nanoboom') then - effectiveRangeExplo = 58 - --areaofeffect = areaofeffect * 0.5 - end - - if string.find(weaponDef.name, 'energystorage') then - effectiveRangeExplo = effectiveRangeExplo * 0.6 - end - - if string.find(weaponDef.name, 'geo') then --currently override - effectiveRangeExplo = 100 - end - - if string.find(weaponDef.name, 'building') then - effectiveRangeExplo = effectiveRangeExplo * 0.5 - end - - if string.find(weaponDef.name, 'penetrator') then - effectiveRangeExplo = effectiveRangeExplo * 0.6 - end - - if string.find(weaponDef.name, 'explosiont3') then - effectiveRangeExplo = effectiveRangeExplo * 1.5 - end - - if effectiveRangeExplo < 24 then - distortionClass = "UnitExploShockWaveXS" - elseif effectiveRangeExplo < 48 then - distortionClass = "UnitExploShockWaveS" - elseif effectiveRangeExplo < 92 then - distortionClass = "UnitExploShockWaveM" - elseif effectiveRangeExplo < 184 then - distortionClass = "UnitExploShockWaveL" - else -- - distortionClass = "UnitExploShockWaveXL" - end - - - - else -- regular CANNON explosions - if effectiveRangeExplo < 24 then - distortionClass = "ExploShockWaveXS" - elseif effectiveRangeExplo < 48 then - distortionClass = "ExploShockWaveS" - elseif effectiveRangeExplo < 92 then - distortionClass = "ExploShockWaveM" - elseif effectiveRangeExplo < 184 then - distortionClass = "ExploShockWaveL" - else -- - distortionClass = "ExploShockWaveXL" - end + if string.find(weaponDef.name, "building") then + effectiveRangeExplo = effectiveRangeExplo * 0.5 end - if string.find(weaponDef.name, 'flak') then - areaofeffect = 0 + if string.find(weaponDef.name, "penetrator") then + effectiveRangeExplo = effectiveRangeExplo * 0.6 end - -- Check weapon distortion class assignment (enter weapon name here) - -- if string.find(weaponDef.name, 'cortruck_missile') then - -- Spring.Echo('-==--===-', weaponDef.customParams.unitexplosion, distortionClass, effectiveRangeExplo, GetClosestSizeClass(effectiveRangeExplo), GetDistortionClass(distortionClass, GetClosestSizeClass(effectiveRangeExplo), overrideTable)) - -- end + if string.find(weaponDef.name, "explosiont3") then + effectiveRangeExplo = effectiveRangeExplo * 1.5 + end - if not weaponDef.customParams.noexplosionlight and areaofeffect > 15 then --need to add noexplosiondistortion to units - now used same as lights - explosionDistortions[weaponID] = {GetDistortionClass(distortionClass, GetClosestSizeClass(effectiveRangeExplo), overrideTable)} + if effectiveRangeExplo < 24 then + distortionClass = "UnitExploShockWaveXS" + elseif effectiveRangeExplo < 48 then + distortionClass = "UnitExploShockWaveS" + elseif effectiveRangeExplo < 92 then + distortionClass = "UnitExploShockWaveM" + elseif effectiveRangeExplo < 184 then + distortionClass = "UnitExploShockWaveL" + else -- + distortionClass = "UnitExploShockWaveXL" end + else -- regular CANNON explosions + if effectiveRangeExplo < 24 then + distortionClass = "ExploShockWaveXS" + elseif effectiveRangeExplo < 48 then + distortionClass = "ExploShockWaveS" + elseif effectiveRangeExplo < 92 then + distortionClass = "ExploShockWaveM" + elseif effectiveRangeExplo < 184 then + distortionClass = "ExploShockWaveL" + else -- + distortionClass = "ExploShockWaveXL" + end + end + + if string.find(weaponDef.name, "flak") then + areaofeffect = 0 + end + + -- Check weapon distortion class assignment (enter weapon name here) + -- if string.find(weaponDef.name, 'cortruck_missile') then + -- Spring.Echo('-==--===-', weaponDef.customParams.unitexplosion, distortionClass, effectiveRangeExplo, GetClosestSizeClass(effectiveRangeExplo), GetDistortionClass(distortionClass, GetClosestSizeClass(effectiveRangeExplo), overrideTable)) + -- end + if not weaponDef.customParams.noexplosionlight and areaofeffect > 15 then --need to add noexplosiondistortion to units - now used same as lights + explosionDistortions[weaponID] = { GetDistortionClass(distortionClass, GetClosestSizeClass(effectiveRangeExplo), overrideTable) } end end end - Spring.Echo(Spring.GetGameFrame(),"DLGL4 weapons conf using",usedclasses,"distortion types") end - AssignDistortionsToAllWeapons() -- disable this if it doest work - + Spring.Echo(Spring.GetGameFrame(), "DLGL4 weapons conf using", usedclasses, "distortion types") +end +AssignDistortionsToAllWeapons() -- disable this if it doest work -----------------Manual Overrides-------------------- local explosionDistortionsNames = {} local muzzleFlashDistortionsNames = {} local projectileDefDistortionsNames = {} - -- projectileDefDistortionsNames["armcom_disintegrator"] = -- GetDistortionClass("ProjectileDgun", "Micro") -- GetDistortionClass("AirShockWaveDgun", "Micro") -projectileDefDistortionsNames["corjugg_juggernaut_fire"] = - GetDistortionClass("AirShockWaveDgun", "Nano", { - lifeTime = 40, - }) +projectileDefDistortionsNames["corjugg_juggernaut_fire"] = GetDistortionClass("AirShockWaveDgun", "Nano", { + lifeTime = 40, +}) -explosionDistortionsNames['corjugg_juggernaut_fire'] = { +explosionDistortionsNames["corjugg_juggernaut_fire"] = { --GetDistortionClass("GroundShockWave", "Smaller", { -- lifeTime = 24, }), --GetDistortionClass("AirShockWaveDgun", "Smaller"), GetDistortionClass("ExplosionRadiationDgun", "Micro"), } -projectileDefDistortionsNames["cormort_cor_mort"] = - GetDistortionClass("PlasmaTrailProjectile", "Small", { - theta = 0.08, noiseStrength = 5, noiseScaleSpace = 0.88, distanceFalloff = 1.5, - lifeTime = 60, rampUp = 15, decay = 0, effectStrength = 1.5, - radius = 170, startRadius = 0.1, yoffset = 8, - }) -explosionDistortionsNames['cormort_cor_mort'] = { +projectileDefDistortionsNames["cormort_cor_mort"] = GetDistortionClass("PlasmaTrailProjectile", "Small", { + theta = 0.08, + noiseStrength = 5, + noiseScaleSpace = 0.88, + distanceFalloff = 1.5, + lifeTime = 60, + rampUp = 15, + decay = 0, + effectStrength = 1.5, + radius = 170, + startRadius = 0.1, + yoffset = 8, +}) +explosionDistortionsNames["cormort_cor_mort"] = { -- GetDistortionClass("GroundShockWave", "Pico", { -- lifeTime = 18, }), GetDistortionClass("AirShockWaveXS", "Femto", { - lifeTime = 6, effectStrength = 4.5, }), + lifeTime = 6, + effectStrength = 4.5, + }), } -projectileDefDistortionsNames["armmav_armmav_weapon"] = - GetDistortionClass("PlasmaTrailProjectile", "Smaller", { - theta = 0.11, noiseStrength = 15, noiseScaleSpace = 0.55, - lifeTime = 60, rampUp = 20, decay = 0, radius = 40, +projectileDefDistortionsNames["armmav_armmav_weapon"] = GetDistortionClass("PlasmaTrailProjectile", "Smaller", { + theta = 0.11, + noiseStrength = 15, + noiseScaleSpace = 0.55, + lifeTime = 60, + rampUp = 20, + decay = 0, + radius = 40, }) -explosionDistortionsNames['armmav_armmav_weapon'] = { +explosionDistortionsNames["armmav_armmav_weapon"] = { GetDistortionClass("GroundShockWave", "Micro", { - lifeTime = 19, effectStrength = 1.0, + lifeTime = 19, + effectStrength = 1.0, }), } -explosionDistortionsNames['armemp_armemp_weapon'] = { +explosionDistortionsNames["armemp_armemp_weapon"] = { GetDistortionClass("EMPShockWave", "Medium", { - effectStrength = -2.5, - }), - GetDistortionClass("EMPNoise", "SmallMedium", { - }), - GetDistortionClass("EMPRipples", "Medium", { - }), - GetDistortionClass("AirShockWaveEMP", "Tiny", { + effectStrength = -2.5, }), + GetDistortionClass("EMPNoise", "SmallMedium", {}), + GetDistortionClass("EMPRipples", "Medium", {}), + GetDistortionClass("AirShockWaveEMP", "Tiny", {}), } -explosionDistortionsNames['armthor_empmissile'] = { +explosionDistortionsNames["armthor_empmissile"] = { GetDistortionClass("EMPShockWave", "Small", { - effectStrength = -2.5, - }), - GetDistortionClass("EMPNoise", "Smallest", { - }), - GetDistortionClass("EMPRipples", "Small", { - }), - GetDistortionClass("AirShockWaveEMP", "Nano", { + effectStrength = -2.5, }), + GetDistortionClass("EMPNoise", "Smallest", {}), + GetDistortionClass("EMPRipples", "Small", {}), + GetDistortionClass("AirShockWaveEMP", "Nano", {}), } -explosionDistortionsNames['spybombx'] = { +explosionDistortionsNames["spybombx"] = { GetDistortionClass("EMPShockWave", "Medium", { - effectStrength = -2.5, - }), - GetDistortionClass("EMPNoise", "SmallMedium", { - }), - GetDistortionClass("EMPRipples", "Medium", { - }), - GetDistortionClass("AirShockWaveEMP", "Tiny", { + effectStrength = -2.5, }), + GetDistortionClass("EMPNoise", "SmallMedium", {}), + GetDistortionClass("EMPRipples", "Medium", {}), + GetDistortionClass("AirShockWaveEMP", "Tiny", {}), } -explosionDistortionsNames['armstil_stiletto_bomb'] = { - GetDistortionClass("EMPShockWave", "Smaller", { - }), - GetDistortionClass("EMPNoise", "Smaller", { - }), - GetDistortionClass("EMPRipples", "SmallMedium", { - }), - GetDistortionClass("AirShockWaveEMP", "Micro", { - }), +explosionDistortionsNames["armstil_stiletto_bomb"] = { + GetDistortionClass("EMPShockWave", "Smaller", {}), + GetDistortionClass("EMPNoise", "Smaller", {}), + GetDistortionClass("EMPRipples", "SmallMedium", {}), + GetDistortionClass("AirShockWaveEMP", "Micro", {}), } - - -- OLD ACIDBOMB EXPLOSION DISTORTIONS -- explosionDistortionsNames['raptor_air_bomber_acid_t2_v1_acidbomb'] = { -- GetDistortionClass("GroundShockWave", "Smallish", { @@ -1419,7 +1838,7 @@ explosionDistortionsNames['armstil_stiletto_bomb'] = { -- }), -- } -explosionDistortionsNames['raptor_air_bomber_acid_t2_v1_acidbomb'] = { +explosionDistortionsNames["raptor_air_bomber_acid_t2_v1_acidbomb"] = { GetDistortionClass("GroundAcidExplo", "Small", { -- noiseStrength = 15.0, noiseScaleSpace = 0.90, distanceFalloff = 0.9, onlyModelMap = 1, -- lifeTime = 190, effectStrength = 2, @@ -1429,7 +1848,7 @@ explosionDistortionsNames['raptor_air_bomber_acid_t2_v1_acidbomb'] = { GetDistortionClass("AirShockWave", "Smaller"), } -explosionDistortionsNames['raptor_land_assault_acid_t2_v1_acidspit'] = { +explosionDistortionsNames["raptor_land_assault_acid_t2_v1_acidspit"] = { GetDistortionClass("GroundAcidExplo", "SmallMedium", { -- noiseStrength = 15.0, noiseScaleSpace = 0.90, distanceFalloff = 0.9, onlyModelMap = 1, -- lifeTime = 190, effectStrength = 2, @@ -1439,9 +1858,11 @@ explosionDistortionsNames['raptor_land_assault_acid_t2_v1_acidspit'] = { --GetDistortionClass("AirShockWave", "Smaller"), } -explosionDistortionsNames['raptor_allterrain_arty_acid_t2_v1_acidspit'] = { +explosionDistortionsNames["raptor_allterrain_arty_acid_t2_v1_acidspit"] = { GetDistortionClass("GroundAcidExplo", "Medium", { - noiseStrength = 0.9, noiseScaleSpace = 0.50, distanceFalloff = 0.9, + noiseStrength = 0.9, + noiseScaleSpace = 0.50, + distanceFalloff = 0.9, effectStrength = 1.7, --onlyModelMap = 1, -- lifeTime = 190, effectStrength = 2, @@ -1451,16 +1872,14 @@ explosionDistortionsNames['raptor_allterrain_arty_acid_t2_v1_acidspit'] = { --GetDistortionClass("AirShockWave", "Smaller"), } -explosionDistortionsNames['armjuno_juno_pulse'] = { +explosionDistortionsNames["armjuno_juno_pulse"] = { -- GetDistortionClass("JunoHeat", "Juno", { -- pos2x = 0, pos2y = 0, pos2z = 0, -- noiseStrength = 6.5, noiseScaleSpace = 0.5, distanceFalloff = -0.1, -- lifeTime = 900, rampUp = 0, decay = 0, onlyModelMap = 0, -- }), - GetDistortionClass("JunoShockWave", "Juno", { - }), - GetDistortionClass("JunoNoise", "Juno", { - }), + GetDistortionClass("JunoShockWave", "Juno", {}), + GetDistortionClass("JunoNoise", "Juno", {}), -- GetDistortionClass("GroundShockWave", "Larger", { -- noiseStrength = 5.0, noiseScaleSpace = 0.13, distanceFalloff = 0.1, onlyModelMap = 0, -- lifeTime = 35, effectStrength = -20, @@ -1472,34 +1891,36 @@ explosionDistortionsNames['armjuno_juno_pulse'] = { -- windAffected = -1, riseRate = 9, -- lifeTime = 900, rampUp = 100, decay = 150, onlyModelMap = 1, -- }), - } -explosionDistortionsNames['corjuno_juno_pulse'] = { - GetDistortionClass("JunoShockWave", "Juno", { - }), - GetDistortionClass("JunoNoise", "Juno", { - }), +explosionDistortionsNames["corjuno_juno_pulse"] = { + GetDistortionClass("JunoShockWave", "Juno", {}), + GetDistortionClass("JunoNoise", "Juno", {}), } -explosionDistortionsNames['legjuno_juno_pulse'] = { - GetDistortionClass("JunoShockWave", "Juno", { - }), - GetDistortionClass("JunoNoise", "Juno", { - }), +explosionDistortionsNames["legjuno_juno_pulse"] = { + GetDistortionClass("JunoShockWave", "Juno", {}), + GetDistortionClass("JunoNoise", "Juno", {}), } -- corlevlr -projectileDefDistortionsNames["corlevlr_corlevlr_weapon"] = - GetDistortionClass("PlasmaTrailProjectile", "Smaller", { - theta = 0.11, noiseStrength = 24, noiseScaleSpace = 0.55, - lifeTime = 60, rampUp = 20, decay = 0, radius = 40, yoffset = 8, +projectileDefDistortionsNames["corlevlr_corlevlr_weapon"] = GetDistortionClass("PlasmaTrailProjectile", "Smaller", { + theta = 0.11, + noiseStrength = 24, + noiseScaleSpace = 0.55, + lifeTime = 60, + rampUp = 20, + decay = 0, + radius = 40, + yoffset = 8, }) - explosionDistortionsNames["corlevlr_corlevlr_weapon"] = { GetDistortionClass("GroundShockWave", "Tiny", { - lifeTime = 12, effectStrength = 1.5, startRadius = 0.40, shockWidth = 0.5, + lifeTime = 12, + effectStrength = 1.5, + startRadius = 0.40, + shockWidth = 0.5, }), GetDistortionClass("AirShockWave", "Micro", { lifeTime = 14, @@ -1525,13 +1946,14 @@ explosionDistortionsNames["corlevlr_corlevlr_weapon"] = { -- lifeTime = 0, rampUp = 0, decay = 0, radius = 3, yoffset = 5, -- }) -muzzleFlashDistortionsNames['armguard_plasma'] = { +muzzleFlashDistortionsNames["armguard_plasma"] = { GetDistortionClass("MuzzleShockWave", "Nano", { - lifeTime = 8, effectStrength = 1.2, + lifeTime = 8, + effectStrength = 1.2, }), } -muzzleFlashDistortionsNames['armguard_plasma_high'] = { - GetDistortionClass("MuzzleShockWave", "Tiny") +muzzleFlashDistortionsNames["armguard_plasma_high"] = { + GetDistortionClass("MuzzleShockWave", "Tiny"), } -- muzzleFlashDistortionsNames['armepoch_mediumplasma'] = { @@ -1541,72 +1963,87 @@ muzzleFlashDistortionsNames['armguard_plasma_high'] = { -- GetDistortionClass("MuzzleShockWaveXL", "Tiniest") -- } -explosionDistortionsNames['corape_vtol_rocket'] = { +explosionDistortionsNames["corape_vtol_rocket"] = { GetDistortionClass("AirShockWave", "Nano", { - lifeTime = 6, rampUp = 1,}) - } -explosionDistortionsNames['armepoch_heavyplasma'] = { + lifeTime = 6, + rampUp = 1, + }), +} +explosionDistortionsNames["armepoch_heavyplasma"] = { GetDistortionClass("AirShockWave", "Tiny"), GetDistortionClass("ExplosionHeat", "Micro"), } -muzzleFlashDistortionsNames['armepoch_heavyplasma'] = { - GetDistortionClass("MuzzleShockWave", "Nano") +muzzleFlashDistortionsNames["armepoch_heavyplasma"] = { + GetDistortionClass("MuzzleShockWave", "Nano"), } -muzzleFlashDistortionsNames['corblackhy_heavyplasma'] = { - GetDistortionClass("MuzzleShockWave", "Tiny") +muzzleFlashDistortionsNames["corblackhy_heavyplasma"] = { + GetDistortionClass("MuzzleShockWave", "Tiny"), } -explosionDistortionsNames['corblackhy_heavyplasma'] = { +explosionDistortionsNames["corblackhy_heavyplasma"] = { GetDistortionClass("AirShockWave", "Tiny"), GetDistortionClass("ExplosionHeat", "Micro"), } -projectileDefDistortionsNames["cormaw_dmaw"] = - GetDistortionClass("FlameProjectile", "Nano", { - lifeTime = 42, rampUp = 30, - }) +projectileDefDistortionsNames["cormaw_dmaw"] = GetDistortionClass("FlameProjectile", "Nano", { + lifeTime = 42, + rampUp = 30, +}) -projectileDefDistortionsNames["corpyro_flamethrower"] = - GetDistortionClass("FlameProjectile", "Pico") +projectileDefDistortionsNames["corpyro_flamethrower"] = GetDistortionClass("FlameProjectile", "Pico") -projectileDefDistortionsNames["cordemon_newdmaw"] = - GetDistortionClass("FlameProjectileXL", "Smaller", { - noiseStrength = 11, startRadius = 0.4, --noiseScaleSpace = 0.20, - lifeTime = 55, rampUp = 15, decay = 60, - }) +projectileDefDistortionsNames["cordemon_newdmaw"] = GetDistortionClass("FlameProjectileXL", "Smaller", { + noiseStrength = 11, + startRadius = 0.4, --noiseScaleSpace = 0.20, + lifeTime = 55, + rampUp = 15, + decay = 60, +}) -projectileDefDistortionsNames["corcrwh_dragonmawh"] = - GetDistortionClass("FlameProjectileXL", "Smaller", { - noiseStrength = 15, startRadius = 0.4, --noiseScaleSpace = -0.20, - lifeTime = 50, rampUp = 15, decay = 70, - }) +projectileDefDistortionsNames["corcrwh_dragonmawh"] = GetDistortionClass("FlameProjectileXL", "Smaller", { + noiseStrength = 15, + startRadius = 0.4, --noiseScaleSpace = -0.20, + lifeTime = 50, + rampUp = 15, + decay = 70, +}) -projectileDefDistortionsNames["corfship_dmaw"] = - GetDistortionClass("FlameProjectile", "Tiny") +projectileDefDistortionsNames["corfship_dmaw"] = GetDistortionClass("FlameProjectile", "Tiny") -projectileDefDistortionsNames["corvipe_vipersabot"] = -GetDistortionClass("PlasmaTrailProjectile", "Smaller", { - theta = 0.07, noiseStrength = 10, noiseScaleSpace = 0.35, - lifeTime = 30, rampUp = 10, decay = 5, radius = 120, +projectileDefDistortionsNames["corvipe_vipersabot"] = GetDistortionClass("PlasmaTrailProjectile", "Smaller", { + theta = 0.07, + noiseStrength = 10, + noiseScaleSpace = 0.35, + lifeTime = 30, + rampUp = 10, + decay = 5, + radius = 120, yoffset = 18, }) -explosionDistortionsNames['corvipe_vipersabot'] = { +explosionDistortionsNames["corvipe_vipersabot"] = { GetDistortionClass("GroundShockWaveXS", "Micro", { - startRadius = 0.50, }), + startRadius = 0.50, + }), GetDistortionClass("AirShockWaveXS", "Pico", { - lifeTime = 9, effectStrength = 0.8, }), + lifeTime = 9, + effectStrength = 0.8, + }), GetDistortionClass("ExplosionHeatXS", "Nano"), } -projectileDefDistortionsNames["armmship_rocket"] = - GetDistortionClass("MissileProjectile", "Medium", { - theta = 0.16, noiseStrength = 5, noiseScaleSpace = 0.35, - windAffected = -1, riseRate = -0.5, - lifeTime = 110, rampUp = 20, decay = 40, radius = 200, yoffset = 4, - }) - - +projectileDefDistortionsNames["armmship_rocket"] = GetDistortionClass("MissileProjectile", "Medium", { + theta = 0.16, + noiseStrength = 5, + noiseScaleSpace = 0.35, + windAffected = -1, + riseRate = -0.5, + lifeTime = 110, + rampUp = 20, + decay = 40, + radius = 200, + yoffset = 4, +}) -- projectileDefDistortionsNames["armblade_vtol_sabot"] = -- GetDistortionClass("MissileProjectile", "Smaller", { @@ -1614,8 +2051,6 @@ projectileDefDistortionsNames["armmship_rocket"] = -- lifeTime = 27, rampUp = 10, decay = 10, radius = 150, -- }) - - -- projectileDefDistortionsNames["corkarg_super_missile"] = -- GetDistortionClass("MissileProjectile", "Medium", { -- theta = 0.08, noiseStrength = 4, noiseScaleSpace = 0.67, @@ -1623,13 +2058,17 @@ projectileDefDistortionsNames["armmship_rocket"] = -- effectStrength = 2.2, distanceFalloff = 1.3, -- startRadius = 0.3, onlyModelMap = 1, -- }) -explosionDistortionsNames['corkarg_super_missile'] = { +explosionDistortionsNames["corkarg_super_missile"] = { GetDistortionClass("GroundShockWaveXS", "Tiny", { - lifeTime = 8, decay = 3, rampUp = 1, - shockWidth = 0.5, }), + lifeTime = 8, + decay = 3, + rampUp = 1, + shockWidth = 0.5, + }), GetDistortionClass("AirShockWave", "Nano", { --lifeTime = 16, - effectStrength = 2.0, }), + effectStrength = 2.0, + }), } -- projectileDefDistortionsNames["corhrk_corhrk_rocket"] = @@ -1646,69 +2085,72 @@ explosionDistortionsNames['corkarg_super_missile'] = { projectileDefDistortionsNames["armsubk_armsmart_torpedo"] = GetDistortionClass("TorpedoProjectile", "SmallMedium") -explosionDistortionsNames["armsubk_armsmart_torpedo"] = { GetDistortionClass("TorpedoShockWave", "Nano")} +explosionDistortionsNames["armsubk_armsmart_torpedo"] = { GetDistortionClass("TorpedoShockWave", "Nano") } -- projectileDefDistortionsNames['armmanni_atam'] = -- GetDistortionClass("AirShockWaveBeam", "Small") -projectileDefDistortionsNames['armmanni_atam'] = - GetDistortionClass("TachyonBeam", "Femto", { - noiseStrength = 1, noiseScaleSpace = 0.03, - windAffected = -0.8, riseRate = -0.2, - }) - -projectileDefDistortionsNames['armanni_ata'] = - GetDistortionClass("TachyonBeam", "Femto", { - noiseStrength = 1.0, noiseScaleSpace = 0.04, - windAffected = -0.9, riseRate = -0.2, - --lifeTime = 0, rampUp = 20, decay = 0, - }) - -projectileDefDistortionsNames['cordoom_atadr'] = - GetDistortionClass("TachyonBeam", "Femto", { - noiseStrength = 1.0, noiseScaleSpace = 0.04, - windAffected = -0.9, riseRate = -0.2, - --lifeTime = 0, rampUp = 20, decay = 0, - }) +projectileDefDistortionsNames["armmanni_atam"] = GetDistortionClass("TachyonBeam", "Femto", { + noiseStrength = 1, + noiseScaleSpace = 0.03, + windAffected = -0.8, + riseRate = -0.2, +}) + +projectileDefDistortionsNames["armanni_ata"] = GetDistortionClass("TachyonBeam", "Femto", { + noiseStrength = 1.0, + noiseScaleSpace = 0.04, + windAffected = -0.9, + riseRate = -0.2, + --lifeTime = 0, rampUp = 20, decay = 0, +}) + +projectileDefDistortionsNames["cordoom_atadr"] = GetDistortionClass("TachyonBeam", "Femto", { + noiseStrength = 1.0, + noiseScaleSpace = 0.04, + windAffected = -0.9, + riseRate = -0.2, + --lifeTime = 0, rampUp = 20, decay = 0, +}) -- original shield beam - -- projectileDefDistortionsNames['armbanth_tehlazerofdewm'] = - -- GetDistortionClass("TachyonBeam", "Femto", { - -- noiseStrength = 1.5, noiseScaleSpace = 0.025, - -- windAffected = -0.8, riseRate = -0.2, - -- }) +-- projectileDefDistortionsNames['armbanth_tehlazerofdewm'] = +-- GetDistortionClass("TachyonBeam", "Femto", { +-- noiseStrength = 1.5, noiseScaleSpace = 0.025, +-- windAffected = -0.8, riseRate = -0.2, +-- }) -- new concept armbanth -- projectileDefDistortionsNames['armbanth_tehlazerofdewm'] = -- GetDistortionClass("TachyonBeam2", "Atto", { -- }) -projectileDefDistortionsNames['armbanth_tehlazerofdewm'] = -GetDistortionClass("TachyonBeam3", "Banthlaser", { -}) +projectileDefDistortionsNames["armbanth_tehlazerofdewm"] = GetDistortionClass("TachyonBeam3", "Banthlaser", {}) -projectileDefDistortionsNames["corhlt_cor_laserh1"] = - GetDistortionClass("LaserBeamHeat", "Atto") +projectileDefDistortionsNames["corhlt_cor_laserh1"] = GetDistortionClass("LaserBeamHeat", "Atto") -- Heatrays should all get this class -projectileDefDistortionsNames["corsala_cor_heat_laser"] = - GetDistortionClass("HeatRayHeat", "Atto") +projectileDefDistortionsNames["corsala_cor_heat_laser"] = GetDistortionClass("HeatRayHeat", "Atto") -projectileDefDistortionsNames["corkorg_corkorg_laser"] = - GetDistortionClass("HeatRayHeatXL", "KorgLaser") +projectileDefDistortionsNames["corkorg_corkorg_laser"] = GetDistortionClass("HeatRayHeatXL", "KorgLaser") -muzzleFlashDistortionsNames['corkorg_corkorg_fire'] = { +muzzleFlashDistortionsNames["corkorg_corkorg_fire"] = { GetDistortionClass("MuzzleShockWaveXL", "Nano", { - decay = 5, rampUp = 0, + decay = 5, + rampUp = 0, startRadius = 0.7, - windAffected = -1, riseRate = -1, - lifeTime = 6, effectStrength = 2.0, shockWidth = -0.92, - }) + windAffected = -1, + riseRate = -1, + lifeTime = 6, + effectStrength = 2.0, + shockWidth = -0.92, + }), } -muzzleFlashDistortionsNames['armguard_plasma'] = { +muzzleFlashDistortionsNames["armguard_plasma"] = { GetDistortionClass("MuzzleShockWave", "Nano", { - lifeTime = 8, effectStrength = 1.2, + lifeTime = 8, + effectStrength = 1.2, }), } @@ -1736,8 +2178,8 @@ projectileDefDistortionsNames["armthor_emp"] = --doesnt work on lightning cannon projectileDefDistortionsNames["armthor_thunder"] = --doesnt work on lightning cannon GetDistortionClass("LightningBeam", "Pico") -muzzleFlashDistortionsNames['armthor_thunder'] = { - GetDistortionClass("MuzzleShockWave", "Micro") +muzzleFlashDistortionsNames["armthor_thunder"] = { + GetDistortionClass("MuzzleShockWave", "Micro"), } -- explosionDistortionsNames['armbull_arm_bull'] = { @@ -1746,16 +2188,19 @@ muzzleFlashDistortionsNames['armthor_thunder'] = { -- --GetDistortionClass("ExplosionHeatXS", "Nano"), -- } -muzzleFlashDistortionsNames['armbull_arm_bull'] = { - GetDistortionClass("MuzzleShockWave", "Femto") +muzzleFlashDistortionsNames["armbull_arm_bull"] = { + GetDistortionClass("MuzzleShockWave", "Femto"), } -explosionDistortionsNames['cortrem_tremor_spread_fire'] = { +explosionDistortionsNames["cortrem_tremor_spread_fire"] = { GetDistortionClass("AirShockWaveXS", "Micro", { - lifeTime = 6, effectStrength = 2.5, - decay = 4, rampUp = 1, + lifeTime = 6, + effectStrength = 2.5, + decay = 4, + rampUp = 1, shockWidth = -0.60, - startRadius = 0.66, }), + startRadius = 0.66, + }), -- GetDistortionClass("GroundShockWave", "Tiny", { -- lifeTime = 12, }), --GetDistortionClass("ExplosionHeat", "Pico"), @@ -1767,15 +2212,18 @@ explosionDistortionsNames['cortrem_tremor_spread_fire'] = { -- GetDistortionClass("ExplosionHeatXS", "Nano"), -- } -explosionDistortionsNames['armthund_armbomb'] = { +explosionDistortionsNames["armthund_armbomb"] = { GetDistortionClass("AirShockWave", "Nano", { - lifeTime = 15, effectStrength = 1.6, }), + lifeTime = 15, + effectStrength = 1.6, + }), GetDistortionClass("GroundShockWave", "Tiny", { - lifeTime = 12, }), + lifeTime = 12, + }), GetDistortionClass("ExplosionHeat", "Pico"), } -explosionDistortionsNames['legphoenix_skybeam'] = { +explosionDistortionsNames["legphoenix_skybeam"] = { --GetDistortionClass("AirShockWave", "Small"), --GetDistortionClass("GroundShockWave", "Smallest"), GetDistortionClass("GroundShockWaveHeat", "Tiniest"), @@ -1784,28 +2232,27 @@ explosionDistortionsNames['legphoenix_skybeam'] = { -- a -explosionDistortionsNames['legphoenix_legphtarg'] = { +explosionDistortionsNames["legphoenix_legphtarg"] = { --GetDistortionClass("AirShockWave", "Small"), } -explosionDistortionsNames['corscreamer_cor_advsam'] = { +explosionDistortionsNames["corscreamer_cor_advsam"] = { GetDistortionClass("AirShockWave", "Small"), } -explosionDistortionsNames['armmercury_arm_advsam'] = { +explosionDistortionsNames["armmercury_arm_advsam"] = { GetDistortionClass("AirShockWave", "Small"), } -projectileDefDistortionsNames["legphoenix_legphtarg"] = - GetDistortionClass("NoEffect", 0) +projectileDefDistortionsNames["legphoenix_legphtarg"] = GetDistortionClass("NoEffect", 0) -explosionDistortionsNames['armfboy_arm_fatboy_notalaser'] = { +explosionDistortionsNames["armfboy_arm_fatboy_notalaser"] = { GetDistortionClass("AirShockWave", "Small"), --GetDistortionClass("GroundShockWave", "SmallMedium"), GetDistortionClass("ExplosionHeat", "Tiniest"), } -explosionDistortionsNames['armliche_arm_pidr'] = { +explosionDistortionsNames["armliche_arm_pidr"] = { GetDistortionClass("GroundShockWaveNuke", "Larger", { shockWidth = 8, }), @@ -1813,28 +2260,33 @@ explosionDistortionsNames['armliche_arm_pidr'] = { -- lifeTime = 25, effectStrength = 1.2, -- refractiveIndex = -1.03, }), GetDistortionClass("AirShockWave", "Medium", { - lifeTime = 15, effectStrength = 16.0, - refractiveIndex = 1.1, }), + lifeTime = 15, + effectStrength = 16.0, + refractiveIndex = 1.1, + }), GetDistortionClass("ExplosionHeatNuke", "Medium", { - noiseScaleSpace = 0.1, noiseStrength = 9, - lifeTime = 80, decay = 25, rampUp = 50, - }), + noiseScaleSpace = 0.1, + noiseStrength = 9, + lifeTime = 80, + decay = 25, + rampUp = 50, + }), } -explosionDistortionsNames['armlichet4_nuclear_missile'] = { +explosionDistortionsNames["armlichet4_nuclear_missile"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke"), GetDistortionClass("GroundShockWaveNuke", "Armnuke"), } -explosionDistortionsNames['commanderexplosion'] = { +explosionDistortionsNames["commanderexplosion"] = { --GetDistortionClass("ExplosionHeatNuke", "Large"), GetDistortionClass("AirShockWaveCommander", "Large"), GetDistortionClass("GroundShockWaveCommander", "Mega"), GetDistortionClass("GroundShockWaveCommanderSlow", "Large"), } -explosionDistortionsNames['armsilo_nuclear_missile'] = { +explosionDistortionsNames["armsilo_nuclear_missile"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke"), GetDistortionClass("GroundShockWaveNuke", "Armnuke"), @@ -1847,76 +2299,95 @@ explosionDistortionsNames['armsilo_nuclear_missile'] = { -- projectileDefDistortionsNames["armsilo_nuclear_missile"] = --armnuke -- GetDistortionClass("MissileNukeProjectile", "Large") -explosionDistortionsNames['geo'] = { +explosionDistortionsNames["geo"] = { --GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Medium", { - lifeTime = 13, decay = 7, rampUp = 6, + lifeTime = 13, + decay = 7, + rampUp = 6, effectStrength = 3.0, - }), + }), GetDistortionClass("GroundShockWave", "Medium", { - lifeTime = 20, decay = 15, rampUp = 5, - }), + lifeTime = 20, + decay = 15, + rampUp = 5, + }), } -explosionDistortionsNames['customfusionexplo'] = { +explosionDistortionsNames["customfusionexplo"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke", { - lifeTime = 20, decay = 15, rampUp = 5, + lifeTime = 20, + decay = 15, + rampUp = 5, effectStrength = 10.0, - }), + }), GetDistortionClass("GroundShockWaveNuke", "Armnuke", { - lifeTime = 50, decay = 40, rampUp = 10, - }), + lifeTime = 50, + decay = 40, + rampUp = 10, + }), } -explosionDistortionsNames['fusionExplosion-uw'] = { +explosionDistortionsNames["fusionExplosion-uw"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke", { - lifeTime = 20, decay = 15, rampUp = 5, + lifeTime = 20, + decay = 15, + rampUp = 5, effectStrength = 10.0, - }), + }), GetDistortionClass("GroundShockWaveNuke", "Armnuke", { - lifeTime = 50, decay = 40, rampUp = 10, - }), + lifeTime = 50, + decay = 40, + rampUp = 10, + }), } -explosionDistortionsNames['crawl_blastsmlscavboss'] = { +explosionDistortionsNames["crawl_blastsmlscavboss"] = { GetDistortionClass("ExplosionHeatNuke", "MegaXL", { - lifeTime = 30, decay = 20, rampUp = 10, + lifeTime = 30, + decay = 20, + rampUp = 10, --effectStrength = 1.0, --refractiveIndex = 1.25, - }), + }), GetDistortionClass("AirShockWaveNuke", "Cornuke", { - lifeTime = 60, decay = 25, rampUp = 10, + lifeTime = 60, + decay = 25, + rampUp = 10, effectStrength = 15.0, refractiveIndex = 1.25, - }), + }), GetDistortionClass("GroundShockWaveNuke", "Planetary", { - lifeTime = 120, decay = 100, rampUp = 50, - effectStrength = 3.0, startRadius = 0.10, + lifeTime = 120, + decay = 100, + rampUp = 50, + effectStrength = 3.0, + startRadius = 0.10, shockWidth = 32, - }), + }), } -explosionDistortionsNames['korgexplosion'] = { +explosionDistortionsNames["korgexplosion"] = { --GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke"), GetDistortionClass("GroundShockWaveNuke", "Armnuke"), } -explosionDistortionsNames['korgexplosionselfd'] = { +explosionDistortionsNames["korgexplosionselfd"] = { --GetDistortionClass("ExplosionHeatNuke", "Mega"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), GetDistortionClass("GroundShockWaveNuke", "Cornuke"), } -explosionDistortionsNames['advancedfusionexplosionselfd'] = { +explosionDistortionsNames["advancedfusionexplosionselfd"] = { GetDistortionClass("ExplosionHeatNuke", "Mega"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), GetDistortionClass("GroundShockWaveNuke", "Cornuke"), } -explosionDistortionsNames['corsilo_crblmssl'] = { +explosionDistortionsNames["corsilo_crblmssl"] = { GetDistortionClass("ExplosionHeatNuke", "Mega"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), GetDistortionClass("GroundShockWaveNuke", "Cornuke"), @@ -1925,7 +2396,7 @@ explosionDistortionsNames['corsilo_crblmssl'] = { -- projectileDefDistortionsNames["corsilo_crblmssl"] = --armnuke -- GetDistortionClass("MissileNukeProjectile", "Large") -explosionDistortionsNames['legsilo_legicbm'] = { +explosionDistortionsNames["legsilo_legicbm"] = { GetDistortionClass("ExplosionHeatNuke", "Mega"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), GetDistortionClass("GroundShockWaveNuke", "Cornuke"), @@ -1935,30 +2406,29 @@ explosionDistortionsNames['legsilo_legicbm'] = { -- GetDistortionClass("MissileNukeProjectile", "Large") -- RAPTOR meteor Nuke Tentacle -explosionDistortionsNames['raptor_turret_meteor_t4_v1_weapon'] = { - GetDistortionClass("ExplosionHeatNuke", "Mega"), - GetDistortionClass("AirShockWaveNuke", "Cornuke"), - GetDistortionClass("GroundShockWaveNuke", "Cornuke"), - } +explosionDistortionsNames["raptor_turret_meteor_t4_v1_weapon"] = { + GetDistortionClass("ExplosionHeatNuke", "Mega"), + GetDistortionClass("AirShockWaveNuke", "Cornuke"), + GetDistortionClass("GroundShockWaveNuke", "Cornuke"), +} -explosionDistortionsNames['nuketest_nuketest'] = { +explosionDistortionsNames["nuketest_nuketest"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("AirShockWaveNuke", "Armnuke"), GetDistortionClass("GroundShockWaveNuke", "Armnuke"), } -explosionDistortionsNames['nuketestcor_nuketestcor'] = { +explosionDistortionsNames["nuketestcor_nuketestcor"] = { GetDistortionClass("ExplosionHeatNuke", "Mega"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), GetDistortionClass("GroundShockWaveNuke", "Cornuke"), } -explosionDistortionsNames['armguardnuke_plasma'] = { +explosionDistortionsNames["armguardnuke_plasma"] = { GetDistortionClass("ExplosionHeatNuke", "Larger"), GetDistortionClass("GroundShockWaveNuke", "Armnuke"), --GetDistortionClass("ExplosionRadiationNuke", "Larger"), --no use yet --GetDistortionClass("AirShockWaveNukeBlast", "MegaXXL"), - } -- projectileDefDistortionsNames["armguardnuke_plasma"] = --armnuke -- GetDistortionClass("MissileNukeProjectile", "Large") @@ -1966,7 +2436,7 @@ explosionDistortionsNames['armguardnuke_plasma'] = { -- projectileDefDistortionsNames["armguardnuke_plasma_high"] = --armnuke -- GetDistortionClass("MissileNukeProjectile", "Large") -explosionDistortionsNames['armguardnuke_plasma_high'] = { --cornuke +explosionDistortionsNames["armguardnuke_plasma_high"] = { --cornuke GetDistortionClass("ExplosionHeatNuke", "Mega"), --GetDistortionClass("GroundShockWave", "Medium"), GetDistortionClass("AirShockWaveNuke", "Cornuke"), @@ -1974,7 +2444,7 @@ explosionDistortionsNames['armguardnuke_plasma_high'] = { --cornuke --GetDistortionClass("ExplosionHeat", "Smallest"), } -explosionDistortionsNames['cortron_cortron_weapon'] = { +explosionDistortionsNames["cortron_cortron_weapon"] = { GetDistortionClass("GroundShockWaveNuke", "MediumLarge"), GetDistortionClass("AirShockWaveNuke", "SmallMedium"), GetDistortionClass("ExplosionHeatNuke", "Medium"), @@ -1990,14 +2460,14 @@ explosionDistortionsNames['cortron_cortron_weapon'] = { -- lifeTime = 14, refractiveIndex = 1.03, decay = 3, -- shockWidth = -0.5, effectStrength = 1.5, -- startRadius = 0.3,}), - -- GetDistortionClass("GroundShockWave", "Atto", { - -- shockWidth = 2.5, startRadius = 0.2, - -- }), - -- GetDistortionClass("ExplosionHeat", "Atto"), - --GetDistortionClass("ExplosionDistort", "Atto"), +-- GetDistortionClass("GroundShockWave", "Atto", { +-- shockWidth = 2.5, startRadius = 0.2, +-- }), +-- GetDistortionClass("ExplosionHeat", "Atto"), +--GetDistortionClass("ExplosionDistort", "Atto"), --} -explosionDistortionsNames['corgol_cor_gol'] = { +explosionDistortionsNames["corgol_cor_gol"] = { GetDistortionClass("AirShockWave", "Small"), --GetDistortionClass("GroundShockWave", "SmallMedium"), GetDistortionClass("ExplosionHeat", "Tiniest"), @@ -2028,65 +2498,93 @@ explosionDistortionsNames['corgol_cor_gol'] = { -- lifeTime = 40, decay = 10, rampup = 5, startRadius = 50}), -- } -explosionDistortionsNames['corcat_exp_heavyrocket'] = { +explosionDistortionsNames["corcat_exp_heavyrocket"] = { GetDistortionClass("AirShockWave", "Smallest", { - lifeTime = 8, effectStrength = 1.0, + lifeTime = 8, + effectStrength = 1.0, shockWidth = 0.50, }), GetDistortionClass("GroundShockWave", "Smaller", { - lifeTime = 10, shockWidth = 1.5, startRadius = 0.2,}), + lifeTime = 10, + shockWidth = 1.5, + startRadius = 0.2, + }), -- GetDistortionClass("ExplosionHeat", "Micro", { -- lifeTime = 50, -- }), } -muzzleFlashDistortionsNames['armmav_armmav_weapon'] = { - GetDistortionClass("MuzzleShockWave", "Atto") +muzzleFlashDistortionsNames["armmav_armmav_weapon"] = { + GetDistortionClass("MuzzleShockWave", "Atto"), } -muzzleFlashDistortionsNames['corint_lrpc'] = { - GetDistortionClass("MuzzleShockWaveXL", "Tiny") +muzzleFlashDistortionsNames["corint_lrpc"] = { + GetDistortionClass("MuzzleShockWaveXL", "Tiny"), } -explosionDistortionsNames['corint_lrpc'] = { +explosionDistortionsNames["corint_lrpc"] = { GetDistortionClass("AirShockWave", "Smaller", { - lifeTime = 11, refractiveIndex = -1.5, decay = 4, - shockWidth = -0.5, effectStrength = 1.0, - startRadius = 0.3}), + lifeTime = 11, + refractiveIndex = -1.5, + decay = 4, + shockWidth = -0.5, + effectStrength = 1.0, + startRadius = 0.3, + }), GetDistortionClass("GroundShockWave", "Smallest"), GetDistortionClass("ExplosionHeat", "Smallest", { - lifeTime = 80, decay = 40, rampup = 5}), + lifeTime = 80, + decay = 40, + rampup = 5, + }), } -muzzleFlashDistortionsNames['armbrtha_lrpc'] = { - GetDistortionClass("MuzzleShockWaveXL", "Tiny") +muzzleFlashDistortionsNames["armbrtha_lrpc"] = { + GetDistortionClass("MuzzleShockWaveXL", "Tiny"), } -explosionDistortionsNames['armbrtha_lrpc'] = { +explosionDistortionsNames["armbrtha_lrpc"] = { GetDistortionClass("ExploShockWaveXL", "Smaller", { --lifeTime = 11, refractiveIndex = -1.5, decay = 4, --shockWidth = -0.5, effectStrength = 1.0, - startRadius = 0.3}), + startRadius = 0.3, + }), GetDistortionClass("GroundShockWave", "Smallest"), GetDistortionClass("ExplosionHeat", "Smallest", { - lifeTime = 80, decay = 40, rampup = 5}), + lifeTime = 80, + decay = 40, + rampup = 5, + }), } -muzzleFlashDistortionsNames['corbuzz_rflrpc'] = { +muzzleFlashDistortionsNames["corbuzz_rflrpc"] = { GetDistortionClass("MuzzleShockWaveXL", "Tiny", { - lifeTime = 18, effectStrength = 4.0, startRadius = 0.35, - decay = 7, rampUp = 1, - }) -} -projectileDefDistortionsNames["corbuzz_rflrpc"] = -GetDistortionClass("PlasmaTrailProjectile", "Smallish", { - theta = 0.09, noiseStrength = 15, noiseScaleSpace = 0.12, radius = 380, - distanceFalloff = 2.2, effectStrength = 3.8, + lifeTime = 18, + effectStrength = 4.0, + startRadius = 0.35, + decay = 7, + rampUp = 1, + }), +} +projectileDefDistortionsNames["corbuzz_rflrpc"] = GetDistortionClass("PlasmaTrailProjectile", "Smallish", { + theta = 0.09, + noiseStrength = 15, + noiseScaleSpace = 0.12, + radius = 380, + distanceFalloff = 2.2, + effectStrength = 3.8, }) -explosionDistortionsNames['corbuzz_rflrpc'] = { +explosionDistortionsNames["corbuzz_rflrpc"] = { GetDistortionClass("AirShockWave", "Smaller", { - lifeTime = 9, refractiveIndex = -1.5, decay = 4, - shockWidth = -0.5, effectStrength = 1.0, - startRadius = 0.3}), + lifeTime = 9, + refractiveIndex = -1.5, + decay = 4, + shockWidth = -0.5, + effectStrength = 1.0, + startRadius = 0.3, + }), GetDistortionClass("GroundShockWave", "Smallest"), GetDistortionClass("ExplosionHeat", "Smallest", { - lifeTime = 80, decay = 40, rampup = 5}), + lifeTime = 80, + decay = 40, + rampup = 5, + }), } -- muzzleFlashDistortionsNames['armvulc_rflrpc'] = { @@ -2095,30 +2593,36 @@ explosionDistortionsNames['corbuzz_rflrpc'] = { -- decay = 8, rampUp = 3, shockWidth = -0.55, -- }) -- } -projectileDefDistortionsNames["corbhmth_corbhmth_weapon"] = -GetDistortionClass("PlasmaTrailProjectile", "Smallish", { - theta = 0.09, noiseStrength = 3, noiseScaleSpace = 0.5, radius = 200, +projectileDefDistortionsNames["corbhmth_corbhmth_weapon"] = GetDistortionClass("PlasmaTrailProjectile", "Smallish", { + theta = 0.09, + noiseStrength = 3, + noiseScaleSpace = 0.5, + radius = 200, distanceFalloff = 0.94, }) -projectileDefDistortionsNames["armvulc_rflrpc"] = -GetDistortionClass("PlasmaTrailProjectile", "Smallish", { - theta = 0.09, noiseStrength = 5, noiseScaleSpace = 0.4, radius = 380, +projectileDefDistortionsNames["armvulc_rflrpc"] = GetDistortionClass("PlasmaTrailProjectile", "Smallish", { + theta = 0.09, + noiseStrength = 5, + noiseScaleSpace = 0.4, + radius = 380, distanceFalloff = 0.9, }) -explosionDistortionsNames['armvulc_rflrpc'] = { +explosionDistortionsNames["armvulc_rflrpc"] = { GetDistortionClass("ExploShockWaveL", "Smaller", { --lifeTime = 9, refractiveIndex = -1.5, decay = 4, --shockWidth = -0.5, effectStrength = 1.0, - startRadius = 0.1}), + startRadius = 0.1, + }), GetDistortionClass("GroundShockWave", "Smallest"), GetDistortionClass("ExplosionHeat", "Smallest", { - lifeTime = 80, decay = 40, rampup = 5}), + lifeTime = 80, + decay = 40, + rampup = 5, + }), } -projectileDefDistortionsNames["legerailtank_t3_rail_accelerator"] = -GetDistortionClass("RailgunTrailProjectile", "Femto", { -}) +projectileDefDistortionsNames["legerailtank_t3_rail_accelerator"] = GetDistortionClass("RailgunTrailProjectile", "Femto", {}) local scavbosses = { "veryeasy", @@ -2133,37 +2637,37 @@ local scavbosses = { "hard_scav", "veryhard_scav", "epic_scav", - } +} for i, name in pairs(scavbosses) do - muzzleFlashDistortionsNames['scavengerbossv4_' .. name .. '_shoulderturrets'] = { - GetDistortionClass("MuzzleShockWaveXS", "Nano") - } - muzzleFlashDistortionsNames['scavengerbossv4_' .. name .. '_turbo_shoulderturrets'] = { - GetDistortionClass("MuzzleShockWaveXS", "Tiny") - } - explosionDistortionsNames['scavengerbossv4_' .. name .. '_missilelauncher'] = { - GetDistortionClass("AirShockWave", "Smallest") - } - explosionDistortionsNames['scavengerbossv4_' .. name .. '_turbo_missilelauncher'] = { - GetDistortionClass("AirShockWave", "Smaller") - } + muzzleFlashDistortionsNames["scavengerbossv4_" .. name .. "_shoulderturrets"] = { + GetDistortionClass("MuzzleShockWaveXS", "Nano"), + } + muzzleFlashDistortionsNames["scavengerbossv4_" .. name .. "_turbo_shoulderturrets"] = { + GetDistortionClass("MuzzleShockWaveXS", "Tiny"), + } + explosionDistortionsNames["scavengerbossv4_" .. name .. "_missilelauncher"] = { + GetDistortionClass("AirShockWave", "Smallest"), + } + explosionDistortionsNames["scavengerbossv4_" .. name .. "_turbo_missilelauncher"] = { + GetDistortionClass("AirShockWave", "Smaller"), + } end -- duplicate all weapondistortions for scavengers function applyScavVariants(name, params) - local scavName - local pos = name:find("_", 1, true) - if pos then - scavName = string.sub(name, 1, pos-1)..'_scav'..string.sub(name, pos) - else - scavName = name..'_scav' - end - if WeaponDefNames[scavName] then - local paramsScav = deepcopy(params) - --paramsScav.distortionConfig.color2r, paramsScav.distortionConfig.color2g, paramsScav.distortionConfig.color2b = 0.3, 0.1, 0.7 - return scavName, paramsScav - end + local scavName + local pos = name:find("_", 1, true) + if pos then + scavName = string.sub(name, 1, pos - 1) .. "_scav" .. string.sub(name, pos) + else + scavName = name .. "_scav" + end + if WeaponDefNames[scavName] then + local paramsScav = deepcopy(params) + --paramsScav.distortionConfig.color2r, paramsScav.distortionConfig.color2g, paramsScav.distortionConfig.color2b = 0.3, 0.1, 0.7 + return scavName, paramsScav + end end -- convert weaponname -> weaponDefID @@ -2206,8 +2710,7 @@ for name, params in pairs(projectileDefDistortionsNames) do end projectileDefDistortionsNames = nil - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Projectile Collection -return {muzzleFlashDistortions = muzzleFlashDistortions, projectileDefDistortions = projectileDefDistortions, explosionDistortions = explosionDistortions, gibDistortion = gibDistortion} +return { muzzleFlashDistortions = muzzleFlashDistortions, projectileDefDistortions = projectileDefDistortions, explosionDistortions = explosionDistortions, gibDistortion = gibDistortion } diff --git a/luaui/configs/airjet_effects.lua b/luaui/configs/airjet_effects.lua index 2e871282a8d..b3366023001 100644 --- a/luaui/configs/airjet_effects.lua +++ b/luaui/configs/airjet_effects.lua @@ -1,4 +1,3 @@ - return { -- land vechs @@ -49,7 +48,7 @@ return { { color = { 0.1, 0.4, 0.6 }, width = 3.5, length = 35, piece = "thrusta" }, }, ["legfig"] = { - { color = { 0.2, 0.4, 0.2 }, width = 2, length = 15, piece = "thrust", light = 1}, + { color = { 0.2, 0.4, 0.2 }, width = 2, length = 15, piece = "thrust", light = 1 }, }, ["legafigdef"] = { { color = { 0.2, 0.8, 0.2 }, width = 3, length = 37, piece = "rightAirjet", light = 1 }, @@ -248,7 +247,6 @@ return { { color = { 0.2, 0.8, 0.2 }, width = 3.7, length = 15, piece = "thrustb", light = 1 }, }, - -- bladewing ["corbw"] = { { color = { 0.1, 0.4, 0.6 }, width = 1.8, length = 7.5, piece = "thrusta" }, @@ -420,7 +418,6 @@ return { { color = { 0.2, 0.8, 0.2 }, width = 3, length = 20, piece = "thrusttrail", emitVector = { 0, 0, -1 }, xzVelocity = 1.5, light = 1 }, }, - -- flying ships ["armfepocht4"] = { { color = { 0.7, 0.4, 0.1 }, width = 13, length = 27, piece = "thrustl1", light = 0.62 }, diff --git a/luaui/configs/badwords.lua b/luaui/configs/badwords.lua index 1a8bc9eab59..0560448b897 100644 --- a/luaui/configs/badwords.lua +++ b/luaui/configs/badwords.lua @@ -107,7 +107,6 @@ local wordList = { "^zbatbybvqf?$", "^cnxvf?$", - --DE "^nefputrfvpugr?e?$", "^nssranefpusvpxre$", @@ -144,8 +143,8 @@ local wordList = { "^sbgmratrfvpugr?e?$", "^tnffrauhera?$", "^unpxserffra?$", - "^uhe?raf[^\s]*ar?a?$", - "^uhaqrf[^\s]*ar?a?$", + "^uhe?raf[^s]*ar?a?$", + "^uhaqrf[^s]*ar?a?$", "^uheraxvaqr?e?$", "^uheraonfgneqr?$", "^uherasvpxre$", @@ -178,13 +177,13 @@ local wordList = { "^jvpufre$", "^jvpuftrohegr?a?$", "^jvpufynccra$", - } +} local from = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" -local to = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm" +local to = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm" for index, w in ipairs(wordList) do - local dword = string.gsub(w, '%a', function(c) + local dword = string.gsub(w, "%a", function(c) local decodeIndex = from:find(c, 1, true) return decodeIndex and string.sub(to, decodeIndex, decodeIndex) end) diff --git a/luaui/configs/buildmenu_sorting.lua b/luaui/configs/buildmenu_sorting.lua index cc41ea7e6e5..b0db01a685b 100644 --- a/luaui/configs/buildmenu_sorting.lua +++ b/luaui/configs/buildmenu_sorting.lua @@ -1,361 +1,360 @@ ---@type table local unitOrderTable = { --- UNITS + -- UNITS --CONSTRUCTORS - ['armck'] = 001100, --BOTS - ['corck'] = 001110, - ['legck'] = 001115, + ["armck"] = 001100, --BOTS + ["corck"] = 001110, + ["legck"] = 001115, - ['armcv'] = 001120, --VEH - ['corcv'] = 001130, - ['legcv'] = 001135, - ['armbeaver'] = 001140, - ['cormuskrat'] = 001150, - ['legotter'] = 001155, + ["armcv"] = 001120, --VEH + ["corcv"] = 001130, + ["legcv"] = 001135, + ["armbeaver"] = 001140, + ["cormuskrat"] = 001150, + ["legotter"] = 001155, - ['armca'] = 001160, --AIR - ['corca'] = 001165, - ['legca'] = 001166, + ["armca"] = 001160, --AIR + ["corca"] = 001165, + ["legca"] = 001166, - ['legassistdrone'] = 001167, - ['armassistdrone'] = 001168, --ASSISTDRONES - ['corassistdrone'] = 001169, + ["legassistdrone"] = 001167, + ["armassistdrone"] = 001168, --ASSISTDRONES + ["corassistdrone"] = 001169, - ['armcsa'] = 001170, --SEAPLANES - ['corcsa'] = 001175, - ['legspcon'] = 001176, + ["armcsa"] = 001170, --SEAPLANES + ["corcsa"] = 001175, + ["legspcon"] = 001176, - ['armcs'] = 001180, --SHIPS - ['corcs'] = 001190, - ['legnavyconship'] = 001191, + ["armcs"] = 001180, --SHIPS + ["corcs"] = 001190, + ["legnavyconship"] = 001191, - ['armch'] = 002000, --HOVER - ['corch'] = 002050, - ['legch'] = 002060, + ["armch"] = 002000, --HOVER + ["corch"] = 002050, + ["legch"] = 002060, - ['armrectr'] = 002100, --REZ BOTS - ['cornecro'] = 002150, - ['legrezbot'] = 002151, + ["armrectr"] = 002100, --REZ BOTS + ["cornecro"] = 002150, + ["legrezbot"] = 002151, - ['armmlv'] = 002200, --MINELAYERS - ['cormlv'] = 002250, - ['legmlv'] = 002250, + ["armmlv"] = 002200, --MINELAYERS + ["cormlv"] = 002250, + ["legmlv"] = 002250, - ['armrecl'] = 002300, --REZ SUBS - ['correcl'] = 002350, - ['legnavyrezsub'] = 002351, + ["armrecl"] = 002300, --REZ SUBS + ["correcl"] = 002350, + ["legnavyrezsub"] = 002351, - ['armack'] = 002400, - ['corack'] = 002450, - ['legack'] = 002455, + ["armack"] = 002400, + ["corack"] = 002450, + ["legack"] = 002455, - ['armacv'] = 002500, - ['coracv'] = 002550, - ['legacv'] = 002555, + ["armacv"] = 002500, + ["coracv"] = 002550, + ["legacv"] = 002555, - ['armaca'] = 002600, - ['coraca'] = 002650, - ['legaca'] = 002660, + ["armaca"] = 002600, + ["coraca"] = 002650, + ["legaca"] = 002660, - ['armacsub'] = 002700, - ['coracsub'] = 002750, - ['leganavyconsub'] = 002760, + ["armacsub"] = 002700, + ["coracsub"] = 002750, + ["leganavyconsub"] = 002760, --NANO SUPPORT - ['armfark'] = 003100, --BOTS - ['corfast'] = 003200, - ['legaceb'] = 003250, + ["armfark"] = 003100, --BOTS + ["corfast"] = 003200, + ["legaceb"] = 003250, - ['armconsul'] = 003300, --VEH - ['legafcv'] = 003305, --VEH - ['corprinter'] = 003325, --VEH - ['corvac'] = 003326, --VEH - ['corvacct'] = 003327, --VEH - ['corforge'] = 003350, --VEH + ["armconsul"] = 003300, --VEH + ["legafcv"] = 003305, --VEH + ["corprinter"] = 003325, --VEH + ["corvac"] = 003326, --VEH + ["corvacct"] = 003327, --VEH + ["corforge"] = 003350, --VEH - ['armmls'] = 003400, --SHIP - ['cormls'] = 003500, --SHIP - ['leganavyengineer'] = 003510, --SHIP + ["armmls"] = 003400, --SHIP + ["cormls"] = 003500, --SHIP + ["leganavyengineer"] = 003510, --SHIP - ['armdecom'] = 003600, --SUPPORT COMS - ['legdecom'] = 003650, - ['cordecom'] = 003700, + ["armdecom"] = 003600, --SUPPORT COMS + ["legdecom"] = 003650, + ["cordecom"] = 003700, - ['cormando'] = 003800, --COMMANDO + ["cormando"] = 003800, --COMMANDO - ['armspy'] = 003900, --SPIES - ['corspy'] = 004000, - ['legaspy'] = 004001, - ['corphantom'] = 004010, + ["armspy"] = 003900, --SPIES + ["corspy"] = 004000, + ["legaspy"] = 004001, + ["corphantom"] = 004010, -- AIR SCOUTS LAND UNARMED - ['armpeep'] = 004030, --AIR - ['corfink'] = 004040, - ['armsehak'] = 004050, --SEAPLANES - ['corhunt'] = 004051, - ['legspradarsonarplane'] = 004052, - ['armawac'] = 004060, - ['corawac'] = 004061, - ['legwhisper'] = 004062, + ["armpeep"] = 004030, --AIR + ["corfink"] = 004040, + ["armsehak"] = 004050, --SEAPLANES + ["corhunt"] = 004051, + ["legspradarsonarplane"] = 004052, + ["armawac"] = 004060, + ["corawac"] = 004061, + ["legwhisper"] = 004062, -- SCOUTS/UTILITY LAND - ['armmark'] = 004100, - ['corvoyr'] = 004110, - ['legaradk'] = 004115, - ['armaser'] = 004120, - ['corspec'] = 004130, - ['legajamk'] = 004135, - - ['armseer'] = 004200, - ['corvrad'] = 004210, - ['armjam'] = 004220, - ['coreter'] = 004230, - ['legavrad'] = 004221, - ['legavjam'] = 004222, - - ['armsjam'] = 004250, - ['corsjam'] = 004260, + ["armmark"] = 004100, + ["corvoyr"] = 004110, + ["legaradk"] = 004115, + ["armaser"] = 004120, + ["corspec"] = 004130, + ["legajamk"] = 004135, + + ["armseer"] = 004200, + ["corvrad"] = 004210, + ["armjam"] = 004220, + ["coreter"] = 004230, + ["legavrad"] = 004221, + ["legavjam"] = 004222, + + ["armsjam"] = 004250, + ["corsjam"] = 004260, -- AIRCRAFT - ['armfig'] = 004300, --FIGHTERS - ['corveng'] = 004305, - ['legfig'] = 004306, - ['armhawk'] = 004310, --FIGHTERS T2 - ['corvamp'] = 004315, - ['legionnaire'] = 004316, - ['legafigdef'] = 004316, - ['legvenator'] = 004317, - ['armsfig2'] = 004316, -- T2 Heavy Fighter (air rework mod) - ['corsfig2'] = 004317, - - ['armkam'] = 004320, --GUNSHIPS - ['legmos'] = 004322, - ['armsaber'] = 004325, - ['corcut'] = 004330, - ['legspsurfacegunship'] = 004331, - ['legstronghold'] = 004332, - - ['armbrawl'] = 004335, --GUNSHIPS T2 - ['corape'] = 004340, - ['armblade'] = 004345, - ['corcrw'] = 004348, - ['corcrwh'] = 004347, - ['legfort'] = 004349, - - ['armthund'] = 004350, --BOMBERS - ['corshad'] = 004355, - ['legcib'] = 004356, - ['legkam'] = 004357, - ['armsb'] = 004360, - ['corsb'] = 004365, - ['legspbomber'] = 004366, - - ['armpnix'] = 004370, --BOMBERS T2 - ['corhurc'] = 004380, - ['legnap'] = 004381, - ['legmineb'] = 004382, - ['legphoenix'] = 004383, - ['armliche'] = 004385, - ['armstil'] = 004390, + ["armfig"] = 004300, --FIGHTERS + ["corveng"] = 004305, + ["legfig"] = 004306, + ["armhawk"] = 004310, --FIGHTERS T2 + ["corvamp"] = 004315, + ["legionnaire"] = 004316, + ["legafigdef"] = 004316, + ["legvenator"] = 004317, + ["armsfig2"] = 004316, -- T2 Heavy Fighter (air rework mod) + ["corsfig2"] = 004317, + + ["armkam"] = 004320, --GUNSHIPS + ["legmos"] = 004322, + ["armsaber"] = 004325, + ["corcut"] = 004330, + ["legspsurfacegunship"] = 004331, + ["legstronghold"] = 004332, + + ["armbrawl"] = 004335, --GUNSHIPS T2 + ["corape"] = 004340, + ["armblade"] = 004345, + ["corcrw"] = 004348, + ["corcrwh"] = 004347, + ["legfort"] = 004349, + + ["armthund"] = 004350, --BOMBERS + ["corshad"] = 004355, + ["legcib"] = 004356, + ["legkam"] = 004357, + ["armsb"] = 004360, + ["corsb"] = 004365, + ["legspbomber"] = 004366, + + ["armpnix"] = 004370, --BOMBERS T2 + ["corhurc"] = 004380, + ["legnap"] = 004381, + ["legmineb"] = 004382, + ["legphoenix"] = 004383, + ["armliche"] = 004385, + ["armstil"] = 004390, -- SCOUTS LAND ARMED - ['armflea'] = 004400, --BOTS + ["armflea"] = 004400, --BOTS - ['armfav'] = 004410, --VEH - ['corfav'] = 004420, - ['legscout'] = 004430, + ["armfav"] = 004410, --VEH + ["corfav"] = 004420, + ["legscout"] = 004430, - ['armsh'] = 004500, --HOVER - ['corsh'] = 004510, - ['legsh'] = 004520, + ["armsh"] = 004500, --HOVER + ["corsh"] = 004510, + ["legsh"] = 004520, -- EMP - ['corbw'] = 004800, --EMP - ['armspid'] = 004810, --EMP + ["corbw"] = 004800, --EMP + ["armspid"] = 004810, --EMP -- T1 LAND ATTACK - ['armpw'] = 005000, --FAST - ['corak'] = 005010, - ['leggob'] = 005015, - ['leglob'] = 005016, - ['armflash'] = 005020, - ['corgator'] = 005030, - ['leghades'] = 005031, - ['legcen'] = 005032, - - ['armjanus'] = 005200, --MAIN BATTLE - ['corlevlr'] = 005210, - ['armstump'] = 005220, - ['corraid'] = 005230, - ['leghelios'] = 005231, - ['leggat'] = 005232, - ['armanac'] = 005240, - ['corsnap'] = 005250, - ['legner'] = 005255, - - ['armrock'] = 005300, --ROCKETS - ['corstorm'] = 005310, - ['legbal'] = 005311, - - ['armham'] = 005400, --ARTILLERY - ['corthud'] = 005410, - ['armart'] = 005420, - ['corwolv'] = 005430, - ['legbar'] = 005435, - ['armmh'] = 005440, - ['cormh'] = 005450, - ['legmh'] = 005460, - - - ['armwar'] = 005600, --STRONK - ['legkark'] = 005610, - ['corkark'] = 005620, - - ['armsam'] = 005800, --LAND + AA - ['cormist'] = 005810, - ['legrail'] = 005811, - - ['armpincer'] = 005900, --LAND + AMPHIBIOUS - ['corgarp'] = 005910, - ['legamphtank'] = 005920, + ["armpw"] = 005000, --FAST + ["corak"] = 005010, + ["leggob"] = 005015, + ["leglob"] = 005016, + ["armflash"] = 005020, + ["corgator"] = 005030, + ["leghades"] = 005031, + ["legcen"] = 005032, + + ["armjanus"] = 005200, --MAIN BATTLE + ["corlevlr"] = 005210, + ["armstump"] = 005220, + ["corraid"] = 005230, + ["leghelios"] = 005231, + ["leggat"] = 005232, + ["armanac"] = 005240, + ["corsnap"] = 005250, + ["legner"] = 005255, + + ["armrock"] = 005300, --ROCKETS + ["corstorm"] = 005310, + ["legbal"] = 005311, + + ["armham"] = 005400, --ARTILLERY + ["corthud"] = 005410, + ["armart"] = 005420, + ["corwolv"] = 005430, + ["legbar"] = 005435, + ["armmh"] = 005440, + ["cormh"] = 005450, + ["legmh"] = 005460, + + ["armwar"] = 005600, --STRONK + ["legkark"] = 005610, + ["corkark"] = 005620, + + ["armsam"] = 005800, --LAND + AA + ["cormist"] = 005810, + ["legrail"] = 005811, + + ["armpincer"] = 005900, --LAND + AMPHIBIOUS + ["corgarp"] = 005910, + ["legamphtank"] = 005920, -- T2 LAND ATTACK - ['armgremlin'] = 006005, - - ['armfast'] = 006100, --FAST - ['legstr'] = 006105, - ['corpyro'] = 006110, - ['armlatnk'] = 006120, - ['cortorch'] = 006125, - ['legmrv'] = 006130, - - ['armzeus'] = 006300, --MAIN BATTLE - ['armmav'] = 006310, - ['armbull'] = 006320, - ['corftiger'] = 006325, - ['correap'] = 006330, - ['legaskirmtank'] = 006335, - ['armmanni'] = 006340, - ['corgatreap'] = 006350, - - ['corhrk'] = 006400, --ROCKETS - ['leghrk'] = 006410, - ['corvroc'] = 006420, - ['armmerl'] = 006430, - ['legavroc'] = 006435, - ['corban'] = 006440, - ['legmed'] = 006450, - - ['armfido'] = 006500, --ARTILLERY - ['cormort'] = 006510, - ['legbart'] = 006515, - ['legvcarry'] = 006516, - ['legspcarrier'] = 006517, - ['armmart'] = 006520, - ['cormart'] = 006530, - ['legamcluster'] = 006535, - ['cortrem'] = 006540, - ['leginf'] = 006550, - - ['armsptk'] = 006600, --ALL-TERRAIN - ['cortermite'] = 006610, - ['leginfestor'] = 006614, - ['legsrail'] = 006615, - ['legsrailt4'] = 006616, - - ['armfboy'] = 006700, --STRONK - ['corcan'] = 006710, - ['legshot'] = 006715, - ['armsnipe'] = 006720, - ['cordeadeye'] = 006725, - ['corsumo'] = 006730, - ['corgol'] = 006740, - ['leginc'] = 006750, - ['legaheattank'] = 006760, - - ['armvader'] = 006810, --AMPHIBIOUS KAMIKAZE BOMBS - ['corroach'] = 006820, - ['legsnapper'] = 006825, - ['corsktl'] = 006830, - - ['armamph'] = 006900, --LAND + AMPHIBIOUS - ['coramph'] = 006910, - ['legamph'] = 006915, - ['armcroc'] = 006920, - ['corseal'] = 006930, - ['corsala'] = 006935, - ['corparrow'] = 006940, - ['legfloat'] = 006941, - - -- T2 HOVER - ['corhal'] = 006950, + ["armgremlin"] = 006005, + + ["armfast"] = 006100, --FAST + ["legstr"] = 006105, + ["corpyro"] = 006110, + ["armlatnk"] = 006120, + ["cortorch"] = 006125, + ["legmrv"] = 006130, + + ["armzeus"] = 006300, --MAIN BATTLE + ["armmav"] = 006310, + ["armbull"] = 006320, + ["corftiger"] = 006325, + ["correap"] = 006330, + ["legaskirmtank"] = 006335, + ["armmanni"] = 006340, + ["corgatreap"] = 006350, + + ["corhrk"] = 006400, --ROCKETS + ["leghrk"] = 006410, + ["corvroc"] = 006420, + ["armmerl"] = 006430, + ["legavroc"] = 006435, + ["corban"] = 006440, + ["legmed"] = 006450, + + ["armfido"] = 006500, --ARTILLERY + ["cormort"] = 006510, + ["legbart"] = 006515, + ["legvcarry"] = 006516, + ["legspcarrier"] = 006517, + ["armmart"] = 006520, + ["cormart"] = 006530, + ["legamcluster"] = 006535, + ["cortrem"] = 006540, + ["leginf"] = 006550, + + ["armsptk"] = 006600, --ALL-TERRAIN + ["cortermite"] = 006610, + ["leginfestor"] = 006614, + ["legsrail"] = 006615, + ["legsrailt4"] = 006616, + + ["armfboy"] = 006700, --STRONK + ["corcan"] = 006710, + ["legshot"] = 006715, + ["armsnipe"] = 006720, + ["cordeadeye"] = 006725, + ["corsumo"] = 006730, + ["corgol"] = 006740, + ["leginc"] = 006750, + ["legaheattank"] = 006760, + + ["armvader"] = 006810, --AMPHIBIOUS KAMIKAZE BOMBS + ["corroach"] = 006820, + ["legsnapper"] = 006825, + ["corsktl"] = 006830, + + ["armamph"] = 006900, --LAND + AMPHIBIOUS + ["coramph"] = 006910, + ["legamph"] = 006915, + ["armcroc"] = 006920, + ["corseal"] = 006930, + ["corsala"] = 006935, + ["corparrow"] = 006940, + ["legfloat"] = 006941, + + -- T2 HOVER + ["corhal"] = 006950, --T3 LAND ATTACK - ['armmar'] = 007000, - ['legjav'] = 007005, - ['corcat'] = 007010, - ['legbunk'] = 007015, - ['armraz'] = 007020, - ['corkarg'] = 007030, - ['armvang'] = 007040, - ['legeallterrainmech'] = 007041, - ['legelrpcmech'] = 007042, - ['corshiva'] = 007050, - ['legkeres'] = 007051, - ['legerailtank'] = 007052, - ['legpede'] = 007055, - ['armthor'] = 007060, - ['legeshotgunmech'] = 007065, - ['leegmech'] = 007066, - ['corkorg'] = 007070, - ['legeheatraymech'] = 007071, - ['armbanth'] = 007080, - ['corjugg'] = 007090, + ["armmar"] = 007000, + ["legjav"] = 007005, + ["corcat"] = 007010, + ["legbunk"] = 007015, + ["armraz"] = 007020, + ["corkarg"] = 007030, + ["armvang"] = 007040, + ["legeallterrainmech"] = 007041, + ["legelrpcmech"] = 007042, + ["corshiva"] = 007050, + ["legkeres"] = 007051, + ["legerailtank"] = 007052, + ["legpede"] = 007055, + ["armthor"] = 007060, + ["legeshotgunmech"] = 007065, + ["leegmech"] = 007066, + ["corkorg"] = 007070, + ["legeheatraymech"] = 007071, + ["armbanth"] = 007080, + ["corjugg"] = 007090, --T3 HOVER - ['armlun'] = 007100, --hover - ['corsok'] = 007110, --hover - ['legehovertank'] = 007111, --hover + ["armlun"] = 007100, --hover + ["corsok"] = 007110, --hover + ["legehovertank"] = 007111, --hover --T4 LAND ATTACK (SCAVS) - ['armmeatball'] = 007200, - ['armlunchbox'] = 007210, - ['armassimilator'] = 007220, - - ['armpwt4'] = 007300, - ['corakt4'] = 007310, - ['leggobt3'] = 007315, - ['armsptkt4'] = 007320, - ['cordemon'] = 007330, - ['corkarganetht4'] = 007340, - ['corthermite'] = 007341, - - ['armvadert4'] = 007400, - ['armrattet4'] = 007410, - ['corgolt4'] = 007420, - - ['armthundt4'] = 007500, - ['armfepocht4'] = 007510, - ['corfblackhyt4'] = 007520, - ['legmost3'] = 007525, - ['corcrwt4'] = 007530, - ['legfortt4'] = 007540, + ["armmeatball"] = 007200, + ["armlunchbox"] = 007210, + ["armassimilator"] = 007220, + + ["armpwt4"] = 007300, + ["corakt4"] = 007310, + ["leggobt3"] = 007315, + ["armsptkt4"] = 007320, + ["cordemon"] = 007330, + ["corkarganetht4"] = 007340, + ["corthermite"] = 007341, + + ["armvadert4"] = 007400, + ["armrattet4"] = 007410, + ["corgolt4"] = 007420, + + ["armthundt4"] = 007500, + ["armfepocht4"] = 007510, + ["corfblackhyt4"] = 007520, + ["legmost3"] = 007525, + ["corcrwt4"] = 007530, + ["legfortt4"] = 007540, -- LAND AA - ['armjeth'] = 008000, - ['corcrash'] = 008010, - ['legaabot'] = 008011, - ['armaak'] = 008020, - ['coraak'] = 008030, - ['legadvaabot'] = 008031, + ["armjeth"] = 008000, + ["corcrash"] = 008010, + ["legaabot"] = 008011, + ["armaak"] = 008020, + ["coraak"] = 008030, + ["legadvaabot"] = 008031, - ['armyork'] = 008200, - ['corsent'] = 008210, - ['legvflak'] = 008220, + ["armyork"] = 008200, + ["corsent"] = 008210, + ["legvflak"] = 008220, - ['armah'] = 008300, - ['corah'] = 008310, - ['legah'] = 008320, + ["armah"] = 008300, + ["corah"] = 008310, + ["legah"] = 008320, -- -- T2 AA -- ['armaak'] = 008500, @@ -368,479 +367,478 @@ local unitOrderTable = { -- ['corvamp'] = 008550, -- WATER SCOUTS - ['armpt'] = 009000, --SCOUTS AA - ['coresupp'] = 009010, - ['legnavyaaship'] = 009015, + ["armpt"] = 009000, --SCOUTS AA + ["coresupp"] = 009010, + ["legnavyaaship"] = 009015, -- T1 WATER ATTACK - ['armdecade'] = 009100, --FAST - ['corpt'] = 009110, - ['legnavyscout'] = 009120, + ["armdecade"] = 009100, --FAST + ["corpt"] = 009110, + ["legnavyscout"] = 009120, - ['armpship'] = 009200, --MAIN BATTLE - ['corpship'] = 009210, - ['legnavyfrigate'] = 009211, - ['legnavydestro'] = 009212, - ['armroy'] = 009220, - ['corroy'] = 009230, + ["armpship"] = 009200, --MAIN BATTLE + ["corpship"] = 009210, + ["legnavyfrigate"] = 009211, + ["legnavydestro"] = 009212, + ["armroy"] = 009220, + ["corroy"] = 009230, - ['legnavyartyship'] = 009231, + ["legnavyartyship"] = 009231, -- T2 WATER ATTACK - ['armlship'] = 009280, --ANTISWARM - ['corfship'] = 009290, - ['leganavyantiswarm'] = 009295, - - ['armcrus'] = 009300, --MAIN BATTLE - ['corcrus'] = 009310, - ['leganavycruiser'] = 009320, - - ['armmship'] = 009340, --ROCKETS - ['cormship'] = 009350, - ['leganavymissileship'] = 009355, - - ['armdronecarry'] = 009360, --DRONE CARRIERS - ['cordronecarry'] = 009361, - ['armdtrident'] = 009362, --DEPTH CHARGE DRONE CARRIERS - ['corsentinel'] = 009363, - - ['armbats'] = 009370, --STRONK - ['corbats'] = 009380, - ['leganavybattleship'] = 009380, - - ['armepoch'] = 009400, --FLAGSHIPS - ['corblackhy'] = 009410, - ['leganavyartyship'] = 009420, - ['leganavyflagship'] = 009430, - - ['armdecadet3'] = 009450, --SCAV SHIPS - ['coresuppt3'] = 009460, - ['corprince'] = 009461, - ['armpshipt3'] = 009470, - ['corslrpc'] = 009480, + ["armlship"] = 009280, --ANTISWARM + ["corfship"] = 009290, + ["leganavyantiswarm"] = 009295, + + ["armcrus"] = 009300, --MAIN BATTLE + ["corcrus"] = 009310, + ["leganavycruiser"] = 009320, + + ["armmship"] = 009340, --ROCKETS + ["cormship"] = 009350, + ["leganavymissileship"] = 009355, + + ["armdronecarry"] = 009360, --DRONE CARRIERS + ["cordronecarry"] = 009361, + ["armdtrident"] = 009362, --DEPTH CHARGE DRONE CARRIERS + ["corsentinel"] = 009363, + + ["armbats"] = 009370, --STRONK + ["corbats"] = 009380, + ["leganavybattleship"] = 009380, + + ["armepoch"] = 009400, --FLAGSHIPS + ["corblackhy"] = 009410, + ["leganavyartyship"] = 009420, + ["leganavyflagship"] = 009430, + + ["armdecadet3"] = 009450, --SCAV SHIPS + ["coresuppt3"] = 009460, + ["corprince"] = 009461, + ["armpshipt3"] = 009470, + ["corslrpc"] = 009480, -- T1 AA - ['armsfig'] = 009500, - ['corsfig'] = 009510, - ['legspfighter'] = 009520, + ["armsfig"] = 009500, + ["corsfig"] = 009510, + ["legspfighter"] = 009520, -- T2 AA - ['armaas'] = 009600, - ['corarch'] = 009610, - ['leganavyaaship'] = 009610, + ["armaas"] = 009600, + ["corarch"] = 009610, + ["leganavyaaship"] = 009610, -- UNDERWATER ATTACK - ['armseap'] = 009800, - ['corseap'] = 009810, - ['legsptorpgunship'] = 009815, - ['armsub'] = 009820, - ['corsub'] = 009830, - ['legnavysub'] = 009831, - - ['armlance'] = 009900, - ['cortitan'] = 009910, - ['legatorpbomber'] = 009915, - ['armsubk'] = 009920, - ['corshark'] = 009930, - ['armserp'] = 009940, - ['corssub'] = 009941, - ['coronager'] = 009950, - ['armexcalibur'] = 009951, - ['cordesolator'] = 009952, - ['armseadragon'] = 009953, - - - ['armserpt3'] = 009960, - ['armptt2'] = 009962, + ["armseap"] = 009800, + ["corseap"] = 009810, + ["legsptorpgunship"] = 009815, + ["armsub"] = 009820, + ["corsub"] = 009830, + ["legnavysub"] = 009831, + + ["armlance"] = 009900, + ["cortitan"] = 009910, + ["legatorpbomber"] = 009915, + ["armsubk"] = 009920, + ["corshark"] = 009930, + ["armserp"] = 009940, + ["corssub"] = 009941, + ["coronager"] = 009950, + ["armexcalibur"] = 009951, + ["cordesolator"] = 009952, + ["armseadragon"] = 009953, + + ["armserpt3"] = 009960, + ["armptt2"] = 009962, -- TRANSPORTS - ['armatlas'] = 010500, - ['corvalk'] = 010505, - ['corhvytrans'] = 010510, - ['armhvytrans'] = 010515, - ['leglts'] = 010520, - ['legatrans'] = 010525, + ["armatlas"] = 010500, + ["corvalk"] = 010505, + ["corhvytrans"] = 010510, + ["armhvytrans"] = 010515, + ["leglts"] = 010520, + ["legatrans"] = 010525, - ['armdfly'] = 010610, - ['corseah'] = 010620, + ["armdfly"] = 010610, + ["corseah"] = 010620, -- ANTINUKES - ['armscab'] = 020000, - ['cormabm'] = 020010, - ['legavantinuke'] = 020011, - - ['armcarry'] = 020100, - ['armantiship'] = 020101, - ['corcarry'] = 020110, - ['corantiship'] = 020111, - ['leganavyantinukecarrier'] = 020112, - ['leganavyradjamship'] = 020120, - --- BUILDINGS - --ECO METAL MEX - ['armmex'] = 100000, - ['cormex'] = 100050, - ['legmex'] = 100060, - ['armamex'] = 100100, - ['corexp'] = 100150, - ['legmext15'] = 100160, - - ['armmoho'] = 100200, - ['cormoho'] = 100250, - ['legmoho'] = 100260, - ['armshockwave'] = 100290, - ['cormexp'] = 100300, - ['legmohocon'] = 100310, - - --ECO ENERGY CONVERTERS - ['armmakr'] = 100500, - ['cormakr'] = 100550, - ['legeconv'] = 100550, - ['armmmkr'] = 100600, - ['cormmkr'] = 100650, - ['legadveconv'] = 100651, - - --ECO METAL STORAGE - ['armmstor'] = 100800, - ['cormstor'] = 100850, - ['legmstor'] = 100860, - ['armuwadvms'] = 100900, - ['coruwadvms'] = 100950, - ['legamstor'] = 100960, - - --ECO NRG GENS - ['armwin'] = 101000, - ['corwin'] = 101020, - ['legwin'] = 101060, - ['armwint2'] = 101040, --scavengers - ['corwint2'] = 101050, --scavengers - ['legwint2'] = 101060, --scavengers - ['armsolar'] = 101070, - ['corsolar'] = 101080, - ['legsolar'] = 101090, - ['armadvsol'] = 101100, - ['coradvsol'] = 101150, - ['legadvsol'] = 101170, - - --ECO NRG GEOS - ['armgeo'] = 101200, - --['armuwgeo'] = 101201, - ['corgeo'] = 101250, - --['coruwgeo'] = 101251, - ['leggeo'] = 101275, - ['armgmm'] = 101300, - ['legageo'] = 101325, - ['corageo'] = 101350, - --['coruwageo'] = 101351, - ['armageo'] = 101400, - --['armuwageo'] = 101401, - ['corbhmth'] = 101450, - ['legrampart'] = 101475, - - --ECO NRG FUSIONS - ['armfus'] = 101525, - ['armckfus'] = 101550, - ['corfus'] = 101600, - ['legfus'] = 101650, - ['armafus'] = 101700, - ['corafus'] = 101750, - ['legafus'] = 101780, - - --ECO NRG STORAGE - ['armestor'] = 101800, - ['corestor'] = 101850, - ['legestor'] = 101875, - ['armuwadves'] = 101900, - ['coruwadves'] = 101950, - ['legadvestore'] = 101951, - - --NANOS - ['armnanotc'] = 102010, - ['cornanotc'] = 102020, - ['legnanotc'] = 102030, - ['armnanotct2'] = 102010, - ['cornanotct2'] = 102020, - ['legnanotct2'] = 102030, - - --FACTORIES - ['armlab'] = 102100, - ['corlab'] = 102125, - ['leglab'] = 102126, - ['armvp'] = 102150, - ['corvp'] = 102175, - ['legvp'] = 102176, - ['armap'] = 102200, - ['corap'] = 102225, - ['legap'] = 102230, - ['armhp'] = 102250, - ['corhp'] = 102275, - ['leghp'] = 102278, - - ['armalab'] = 102400, - ['coralab'] = 102425, - ['legalab'] = 102426, - ['armavp'] = 102450, - ['coravp'] = 102475, - ['legavp'] = 102477, - ['armaap'] = 102500, - ['coraap'] = 102525, - ['legaap'] = 102530, - ['armshltx'] = 102550, - ['corgant'] = 102575, - ['leggant'] = 102576, - ['armapt3'] = 102700, --scavengers - ['corapt3'] = 102725, --scavengers - - --UTILITIES - - ['armeyes'] = 103000, - ['coreyes'] = 103050, - ['legeyes'] = 103075, - ['armrad'] = 103100, - ['corrad'] = 103150, - ['legrad'] = 103160, - ['armarad'] = 103200, - ['corarad'] = 103250, - ['legarad'] = 103251, - ['armjamt'] = 103300, - ['corjamt'] = 103350, - ['legjam'] = 103360, - ['armveil'] = 103400, - ['corshroud'] = 103450, - ['legajam'] = 103451, - ['armjuno'] = 103500, - ['corjuno'] = 103550, - ['legjuno'] = 103551, - - ['armsd'] = 103600, - ['corsd'] = 103625, - ['legsd'] = 103626, - ['armtarg'] = 103650, - ['cortarg'] = 103675, - ['legtarg'] = 103676, - ['armgate'] = 103700, - ['legdeflector'] = 103701, - ['corgate'] = 103725, - ['armdf'] = 103750, --Fake Fusion - - --DEFENSES LAND (WALLS) - ['armdrag'] = 104000, - ['cordrag'] = 104100, - ['corscavdrag'] = 104205, --scavengers - ['legdrag'] = 104206, --exscavengers - ['armfort'] = 104300, - ['corfort'] = 104400, - ['corscavfort'] = 104505, --scavengers - ['legforti'] = 104506, --exscavengers - ['armclaw'] = 104600, - ['armlwall'] = 104650, - ['legdtr'] = 104704, --legion - ['corscavdtl'] = 104705, --scavengers - ['legdtl'] = 104706, --exscavengers - ['cormaw'] = 104800, - ['cormwall'] = 104850, - ['legrwall'] = 104875, - ['corscavdtf'] = 104905, --scavengers - ['legdtf'] = 104906, --exscavengers - ['corscavdtm'] = 104915, --scavengers - ['legdtm'] = 104916, --exscavengers - - --MINES - ['armmine1'] = 105100, - ['cormine1'] = 105200, - ['legmine1'] = 105250, - ['armmine2'] = 105300, - ['cormine2'] = 105400, - ['legmine2'] = 105450, - ['cormine4'] = 105500, --cormando - ['armmine3'] = 105600, - ['cormine3'] = 105700, - ['legmine3'] = 105750, - - --DEFENSES LAND T1 - ['armllt'] = 106100, - ['corllt'] = 106200, - ['leglht'] = 106250, - ['armbeamer'] = 106300, - ['corhllt'] = 106400, - ['corhllllt'] = 106500, --scavengers - ['armhlt'] = 106600, - ['corhlt'] = 106700, - ['leghive'] = 106800, - ['armguard'] = 106800, - ['corpun'] = 106900, - ['legcluster'] = 106950, - - --DEFENSES LAND T2 - ['legmg'] = 107000, --land/AA machinegun - ['armpb'] = 107100, - ['corvipe'] = 107200, - ['legbombard'] = 107250, - ['legapopupdef'] = 107251, - ['armamb'] = 107300, - ['cortoast'] = 107400, - ['legacluster'] = 107450, - ['armanni'] = 107500, - ['cordoom'] = 107600, - ['legbastion'] = 107650, - ['armannit3'] = 107700, --scavengers - ['cordoomt3'] = 107800, --scavengers - - --DEFENSES LAND LRPC - ['armbrtha'] = 110100, - ['corint'] = 110200, - ['leglrpc'] = 110300, - ['armminivulc'] = 120100, --scavengers - ['corminibuzz'] = 120200, --scavengers - ['legministarfall']= 120250, --scavengers - ['armvulc'] = 120300, - ['corbuzz'] = 120400, - ['legstarfall'] = 120450, - ['armbotrail'] = 120500, --scavengers - - --DEFENSES AA - ['armrl'] = 130100, - ['corrl'] = 130200, - ['legrl'] = 130250, - ['armferret'] = 130300, - ['cormadsam'] = 130400, - ['legrhapsis'] = 130450, - ['armcir'] = 130500, - ['corerad'] = 130600, - ['leglupara'] = 130700, - - ['armflak'] = 153000, - ['corflak'] = 153500, - ['legflak'] = 153600, - ['armmercury'] = 154000, - ['corscreamer'] = 154500, - ['leglraa'] = 154600, - - --DEFENSES TO WATER - ['armdl'] = 155000, - ['cordl'] = 155500, - ['legctl'] = 155501, - - --DEFENSES MISSILE LAUNCHERS - ['armemp'] = 165000, - ['cortron'] = 165500, - ['legperdition'] = 165600, - ['armamd'] = 166000, - ['legabm'] = 166250, - ['corfmd'] = 166500, - ['armsilo'] = 180000, - ['corsilo'] = 180500, - ['legsilo'] = 180600, - - --WATER ECO METAL - ['armuwmme'] = 200000, - ['coruwmme'] = 200100, - - --WATER ECO NRG CONVERTERS - ['armfmkr'] = 200400, - ['corfmkr'] = 200500, - ['legfeconv'] = 200550, - ['armuwmmm'] = 200600, - ['coruwmmm'] = 200700, - - --WATER ECO METAL STORAGE - ['armuwms'] = 201000, - ['coruwms'] = 201500, - ['leguwmstore'] = 201501, - - --WATER ECO NRG GENS - ['armtide'] = 203000, - ['cortide'] = 203100, - ['legtide'] = 203200, - - --WATER ECO NRG GEOS - ['armuwgeo'] = 204000, - ['coruwgeo'] = 204100, - ['leguwgeo'] = 204101, - ['armuwageo'] = 204500, - ['coruwageo'] = 204600, - - --WATER ECO NRG FUSIONS - ['armuwfus'] = 205000, - ['coruwfus'] = 205500, - - --WATER ECO NRG STORAGE - ['armuwes'] = 207000, - ['coruwes'] = 207500, - ['leguwestore'] = 207501, - - --WATER CONSTRUCTION - ['armnanotcplat'] = 210000, - ['cornanotcplat'] = 210500, - ['legnanotcplat'] = 210550, - - ['armsy'] = 211100, - ['corsy'] = 211200, - ['legsy'] = 211300, - ['armfhp'] = 212100, - ['corfhp'] = 212200, - ['legfhp'] = 212250, - ['armamsub'] = 213100, - ['coramsub'] = 213200, - ['legamphlab'] = 213250, - ['armplat'] = 214100, - ['corplat'] = 214200, - ['legsplab'] = 214300, - --T2 - ['armasy'] = 215000, - ['corasy'] = 215100, - ['legadvshipyard'] = 215200, - --T3 - ['armshltxuw'] = 216100, - ['corgantuw'] = 216200, - ['leggantuw'] = 216300, - - --WATER MINES - ['armfmine3'] = 217100, - ['corfmine3'] = 217200, - - --WATER UTILITIES - ['armfrad'] = 220100, - ['legfrad'] = 220101, - ['corfrad'] = 220150, - ['armason'] = 220200, - ['corason'] = 220250, - ['armfatf'] = 220400, - ['corfatf'] = 220450, - - --WATER DEFENSES LAND - ['armfdrag'] = 230100, - ['corfdrag'] = 230200, - ['legfdrag'] = 230250, - ['armfhlt'] = 230300, - ['corfhlt'] = 230400, - ['legfmg'] = 230401, - - ['armnavaldefturret'] = 230301, - ['cornavaldefturret'] = 230401, - ['legnavaldefturret'] = 230402, - - ['legfhive'] = 230450, - ['armkraken'] = 230500, - ['corfdoom'] = 230600, - - ['armanavaldefturret'] = 230451, - ['coranavaldefturret'] = 230501, - ['leganavaldefturret'] = 230601, - - --WATER DEFENSES AA - ['armfrt'] = 255100, - ['corfrt'] = 255200, - ['legfrl'] = 255200, - ['armfflak'] = 255300, - ['corenaa'] = 255400, - - --WATER DEFENSES NAVAL - ['armtl'] = 260300, - ['cortl'] = 260400, - ['legtl'] = 260401, - ['armatl'] = 260500, - ['coratl'] = 260600, + ["armscab"] = 020000, + ["cormabm"] = 020010, + ["legavantinuke"] = 020011, + + ["armcarry"] = 020100, + ["armantiship"] = 020101, + ["corcarry"] = 020110, + ["corantiship"] = 020111, + ["leganavyantinukecarrier"] = 020112, + ["leganavyradjamship"] = 020120, + + -- BUILDINGS + --ECO METAL MEX + ["armmex"] = 100000, + ["cormex"] = 100050, + ["legmex"] = 100060, + ["armamex"] = 100100, + ["corexp"] = 100150, + ["legmext15"] = 100160, + + ["armmoho"] = 100200, + ["cormoho"] = 100250, + ["legmoho"] = 100260, + ["armshockwave"] = 100290, + ["cormexp"] = 100300, + ["legmohocon"] = 100310, + + --ECO ENERGY CONVERTERS + ["armmakr"] = 100500, + ["cormakr"] = 100550, + ["legeconv"] = 100550, + ["armmmkr"] = 100600, + ["cormmkr"] = 100650, + ["legadveconv"] = 100651, + + --ECO METAL STORAGE + ["armmstor"] = 100800, + ["cormstor"] = 100850, + ["legmstor"] = 100860, + ["armuwadvms"] = 100900, + ["coruwadvms"] = 100950, + ["legamstor"] = 100960, + + --ECO NRG GENS + ["armwin"] = 101000, + ["corwin"] = 101020, + ["legwin"] = 101060, + ["armwint2"] = 101040, --scavengers + ["corwint2"] = 101050, --scavengers + ["legwint2"] = 101060, --scavengers + ["armsolar"] = 101070, + ["corsolar"] = 101080, + ["legsolar"] = 101090, + ["armadvsol"] = 101100, + ["coradvsol"] = 101150, + ["legadvsol"] = 101170, + + --ECO NRG GEOS + ["armgeo"] = 101200, + --['armuwgeo'] = 101201, + ["corgeo"] = 101250, + --['coruwgeo'] = 101251, + ["leggeo"] = 101275, + ["armgmm"] = 101300, + ["legageo"] = 101325, + ["corageo"] = 101350, + --['coruwageo'] = 101351, + ["armageo"] = 101400, + --['armuwageo'] = 101401, + ["corbhmth"] = 101450, + ["legrampart"] = 101475, + + --ECO NRG FUSIONS + ["armfus"] = 101525, + ["armckfus"] = 101550, + ["corfus"] = 101600, + ["legfus"] = 101650, + ["armafus"] = 101700, + ["corafus"] = 101750, + ["legafus"] = 101780, + + --ECO NRG STORAGE + ["armestor"] = 101800, + ["corestor"] = 101850, + ["legestor"] = 101875, + ["armuwadves"] = 101900, + ["coruwadves"] = 101950, + ["legadvestore"] = 101951, + + --NANOS + ["armnanotc"] = 102010, + ["cornanotc"] = 102020, + ["legnanotc"] = 102030, + ["armnanotct2"] = 102010, + ["cornanotct2"] = 102020, + ["legnanotct2"] = 102030, + + --FACTORIES + ["armlab"] = 102100, + ["corlab"] = 102125, + ["leglab"] = 102126, + ["armvp"] = 102150, + ["corvp"] = 102175, + ["legvp"] = 102176, + ["armap"] = 102200, + ["corap"] = 102225, + ["legap"] = 102230, + ["armhp"] = 102250, + ["corhp"] = 102275, + ["leghp"] = 102278, + + ["armalab"] = 102400, + ["coralab"] = 102425, + ["legalab"] = 102426, + ["armavp"] = 102450, + ["coravp"] = 102475, + ["legavp"] = 102477, + ["armaap"] = 102500, + ["coraap"] = 102525, + ["legaap"] = 102530, + ["armshltx"] = 102550, + ["corgant"] = 102575, + ["leggant"] = 102576, + ["armapt3"] = 102700, --scavengers + ["corapt3"] = 102725, --scavengers + + --UTILITIES + + ["armeyes"] = 103000, + ["coreyes"] = 103050, + ["legeyes"] = 103075, + ["armrad"] = 103100, + ["corrad"] = 103150, + ["legrad"] = 103160, + ["armarad"] = 103200, + ["corarad"] = 103250, + ["legarad"] = 103251, + ["armjamt"] = 103300, + ["corjamt"] = 103350, + ["legjam"] = 103360, + ["armveil"] = 103400, + ["corshroud"] = 103450, + ["legajam"] = 103451, + ["armjuno"] = 103500, + ["corjuno"] = 103550, + ["legjuno"] = 103551, + + ["armsd"] = 103600, + ["corsd"] = 103625, + ["legsd"] = 103626, + ["armtarg"] = 103650, + ["cortarg"] = 103675, + ["legtarg"] = 103676, + ["armgate"] = 103700, + ["legdeflector"] = 103701, + ["corgate"] = 103725, + ["armdf"] = 103750, --Fake Fusion + + --DEFENSES LAND (WALLS) + ["armdrag"] = 104000, + ["cordrag"] = 104100, + ["corscavdrag"] = 104205, --scavengers + ["legdrag"] = 104206, --exscavengers + ["armfort"] = 104300, + ["corfort"] = 104400, + ["corscavfort"] = 104505, --scavengers + ["legforti"] = 104506, --exscavengers + ["armclaw"] = 104600, + ["armlwall"] = 104650, + ["legdtr"] = 104704, --legion + ["corscavdtl"] = 104705, --scavengers + ["legdtl"] = 104706, --exscavengers + ["cormaw"] = 104800, + ["cormwall"] = 104850, + ["legrwall"] = 104875, + ["corscavdtf"] = 104905, --scavengers + ["legdtf"] = 104906, --exscavengers + ["corscavdtm"] = 104915, --scavengers + ["legdtm"] = 104916, --exscavengers + + --MINES + ["armmine1"] = 105100, + ["cormine1"] = 105200, + ["legmine1"] = 105250, + ["armmine2"] = 105300, + ["cormine2"] = 105400, + ["legmine2"] = 105450, + ["cormine4"] = 105500, --cormando + ["armmine3"] = 105600, + ["cormine3"] = 105700, + ["legmine3"] = 105750, + + --DEFENSES LAND T1 + ["armllt"] = 106100, + ["corllt"] = 106200, + ["leglht"] = 106250, + ["armbeamer"] = 106300, + ["corhllt"] = 106400, + ["corhllllt"] = 106500, --scavengers + ["armhlt"] = 106600, + ["corhlt"] = 106700, + ["leghive"] = 106800, + ["armguard"] = 106800, + ["corpun"] = 106900, + ["legcluster"] = 106950, + + --DEFENSES LAND T2 + ["legmg"] = 107000, --land/AA machinegun + ["armpb"] = 107100, + ["corvipe"] = 107200, + ["legbombard"] = 107250, + ["legapopupdef"] = 107251, + ["armamb"] = 107300, + ["cortoast"] = 107400, + ["legacluster"] = 107450, + ["armanni"] = 107500, + ["cordoom"] = 107600, + ["legbastion"] = 107650, + ["armannit3"] = 107700, --scavengers + ["cordoomt3"] = 107800, --scavengers + + --DEFENSES LAND LRPC + ["armbrtha"] = 110100, + ["corint"] = 110200, + ["leglrpc"] = 110300, + ["armminivulc"] = 120100, --scavengers + ["corminibuzz"] = 120200, --scavengers + ["legministarfall"] = 120250, --scavengers + ["armvulc"] = 120300, + ["corbuzz"] = 120400, + ["legstarfall"] = 120450, + ["armbotrail"] = 120500, --scavengers + + --DEFENSES AA + ["armrl"] = 130100, + ["corrl"] = 130200, + ["legrl"] = 130250, + ["armferret"] = 130300, + ["cormadsam"] = 130400, + ["legrhapsis"] = 130450, + ["armcir"] = 130500, + ["corerad"] = 130600, + ["leglupara"] = 130700, + + ["armflak"] = 153000, + ["corflak"] = 153500, + ["legflak"] = 153600, + ["armmercury"] = 154000, + ["corscreamer"] = 154500, + ["leglraa"] = 154600, + + --DEFENSES TO WATER + ["armdl"] = 155000, + ["cordl"] = 155500, + ["legctl"] = 155501, + + --DEFENSES MISSILE LAUNCHERS + ["armemp"] = 165000, + ["cortron"] = 165500, + ["legperdition"] = 165600, + ["armamd"] = 166000, + ["legabm"] = 166250, + ["corfmd"] = 166500, + ["armsilo"] = 180000, + ["corsilo"] = 180500, + ["legsilo"] = 180600, + + --WATER ECO METAL + ["armuwmme"] = 200000, + ["coruwmme"] = 200100, + + --WATER ECO NRG CONVERTERS + ["armfmkr"] = 200400, + ["corfmkr"] = 200500, + ["legfeconv"] = 200550, + ["armuwmmm"] = 200600, + ["coruwmmm"] = 200700, + + --WATER ECO METAL STORAGE + ["armuwms"] = 201000, + ["coruwms"] = 201500, + ["leguwmstore"] = 201501, + + --WATER ECO NRG GENS + ["armtide"] = 203000, + ["cortide"] = 203100, + ["legtide"] = 203200, + + --WATER ECO NRG GEOS + ["armuwgeo"] = 204000, + ["coruwgeo"] = 204100, + ["leguwgeo"] = 204101, + ["armuwageo"] = 204500, + ["coruwageo"] = 204600, + + --WATER ECO NRG FUSIONS + ["armuwfus"] = 205000, + ["coruwfus"] = 205500, + + --WATER ECO NRG STORAGE + ["armuwes"] = 207000, + ["coruwes"] = 207500, + ["leguwestore"] = 207501, + + --WATER CONSTRUCTION + ["armnanotcplat"] = 210000, + ["cornanotcplat"] = 210500, + ["legnanotcplat"] = 210550, + + ["armsy"] = 211100, + ["corsy"] = 211200, + ["legsy"] = 211300, + ["armfhp"] = 212100, + ["corfhp"] = 212200, + ["legfhp"] = 212250, + ["armamsub"] = 213100, + ["coramsub"] = 213200, + ["legamphlab"] = 213250, + ["armplat"] = 214100, + ["corplat"] = 214200, + ["legsplab"] = 214300, + --T2 + ["armasy"] = 215000, + ["corasy"] = 215100, + ["legadvshipyard"] = 215200, + --T3 + ["armshltxuw"] = 216100, + ["corgantuw"] = 216200, + ["leggantuw"] = 216300, + + --WATER MINES + ["armfmine3"] = 217100, + ["corfmine3"] = 217200, + + --WATER UTILITIES + ["armfrad"] = 220100, + ["legfrad"] = 220101, + ["corfrad"] = 220150, + ["armason"] = 220200, + ["corason"] = 220250, + ["armfatf"] = 220400, + ["corfatf"] = 220450, + + --WATER DEFENSES LAND + ["armfdrag"] = 230100, + ["corfdrag"] = 230200, + ["legfdrag"] = 230250, + ["armfhlt"] = 230300, + ["corfhlt"] = 230400, + ["legfmg"] = 230401, + + ["armnavaldefturret"] = 230301, + ["cornavaldefturret"] = 230401, + ["legnavaldefturret"] = 230402, + + ["legfhive"] = 230450, + ["armkraken"] = 230500, + ["corfdoom"] = 230600, + + ["armanavaldefturret"] = 230451, + ["coranavaldefturret"] = 230501, + ["leganavaldefturret"] = 230601, + + --WATER DEFENSES AA + ["armfrt"] = 255100, + ["corfrt"] = 255200, + ["legfrl"] = 255200, + ["armfflak"] = 255300, + ["corenaa"] = 255400, + + --WATER DEFENSES NAVAL + ["armtl"] = 260300, + ["cortl"] = 260400, + ["legtl"] = 260401, + ["armatl"] = 260500, + ["coratl"] = 260600, } ---@type table diff --git a/luaui/configs/gridmenu_config.lua b/luaui/configs/gridmenu_config.lua index 4d7f5f989fd..8afe0af7adc 100644 --- a/luaui/configs/gridmenu_config.lua +++ b/luaui/configs/gridmenu_config.lua @@ -1,14 +1,12 @@ - - -local configs = VFS.Include('luaui/configs/gridmenu_layouts.lua') +local configs = VFS.Include("luaui/configs/gridmenu_layouts.lua") local labGrids = configs.LabGrids local unitGrids = configs.UnitGrids local priorityUnits = configs.PriorityUnits or {} -local unitGridPos = { } -local gridPosUnit = { } -local hasUnitGrid = { } -local homeGridPos = { } +local unitGridPos = {} +local gridPosUnit = {} +local hasUnitGrid = {} +local homeGridPos = {} local homePriority = {} local unitCategories = {} @@ -22,7 +20,7 @@ local categories = { BUILDCAT_ECONOMY, BUILDCAT_COMBAT, BUILDCAT_UTILITY, - BUILDCAT_PRODUCTION + BUILDCAT_PRODUCTION, } local rows = 3 @@ -50,11 +48,11 @@ local categoryGroupMapping = { for uname, ugrid in pairs(unitGrids) do local builder = UnitDefNames[uname] if not builder then - Spring.Echo('gridmenu config: no unitdefname found for: '..uname) + Spring.Echo("gridmenu config: no unitdefname found for: " .. uname) else local builderId = builder.id - unitGridPos[builderId] = { {}, {}, {}, {}} + unitGridPos[builderId] = { {}, {}, {}, {} } gridPosUnit[builderId] = {} hasUnitGrid[builderId] = {} homeGridPos[builderId] = { {}, {}, {}, {} } @@ -65,10 +63,10 @@ for uname, ugrid in pairs(unitGrids) do builderCanBuild[uBuilds[i]] = true end - local uncategorizedCount = 0; - for cat=1,4 do - for row =1,3 do - for col =1,4 do + local uncategorizedCount = 0 + for cat = 1, 4 do + for row = 1, 3 do + for col = 1, 4 do local unitAtPos = ugrid[cat] and ugrid[cat][row] and ugrid[cat][row][col] if unitAtPos then @@ -84,7 +82,7 @@ for uname, ugrid in pairs(unitGrids) do end end end - uncategorizedCount = 0; + uncategorizedCount = 0 end end end @@ -92,7 +90,7 @@ end for uname, ugrid in pairs(labGrids) do local udef = UnitDefNames[uname] if not udef then - Spring.Echo('gridmenu config: no unitdefname found for: '..uname) + Spring.Echo("gridmenu config: no unitdefname found for: " .. uname) else local uid = udef.id @@ -105,8 +103,8 @@ for uname, ugrid in pairs(labGrids) do uCanBuild[uBuilds[i]] = true end - for r=1,3 do - for c=1,4 do + for r = 1, 3 do + for c = 1, 4 do local index = (r - 1) * 4 + c local ugdefname = ugrid[index] @@ -126,25 +124,29 @@ end for _, unit in ipairs(priorityUnits) do local prioritDef = UnitDefNames[unit] if not prioritDef then - Spring.Echo('gridmenu config: no unitdefname found for: '..unit) + Spring.Echo("gridmenu config: no unitdefname found for: " .. unit) else local priorityId = prioritDef.id - homePriority[priorityId] = true + homePriority[priorityId] = true end end - for unitDefID, unitDef in pairs(UnitDefs) do unitCategories[unitDefID] = categoryGroupMapping[unitDef.customParams.unitgroup] or BUILDCAT_UTILITY end - local function getCategoryIndex(category) - if category == BUILDCAT_ECONOMY then return 1 - elseif category == BUILDCAT_COMBAT then return 2 - elseif category == BUILDCAT_UTILITY then return 3 - elseif category == BUILDCAT_PRODUCTION then return 4 - else return nil end + if category == BUILDCAT_ECONOMY then + return 1 + elseif category == BUILDCAT_COMBAT then + return 2 + elseif category == BUILDCAT_UTILITY then + return 3 + elseif category == BUILDCAT_PRODUCTION then + return 4 + else + return nil + end end local function constructBuildOption(uDefID, cmd) @@ -152,13 +154,12 @@ local function constructBuildOption(uDefID, cmd) cmd = { id = -uDefID, name = UnitDefs[uDefID].name, - params = {} + params = {}, } end return cmd end - local function getGridForCategory(builderId, buildOptions, currentCategory) local options = {} -- lay out the category @@ -179,7 +180,6 @@ local function getGridForCategory(builderId, buildOptions, currentCategory) end end if not (hasUnitGrid[builderId] and hasUnitGrid[builderId][opt]) and unitCategories[opt] == currentCategory then - -- if this unit doesn't have a defined position in the grid, find an empty spot for it table.insert(undefinedOpts, opt) end @@ -200,18 +200,18 @@ local function getGridForCategory(builderId, buildOptions, currentCategory) end local function filterByPriority(categoryOpts, homePriority) - local priorityOpts = {} + local priorityOpts = {} if not categoryOpts or next(homePriority) == nil then return priorityOpts end - for _, unitID in ipairs(categoryOpts) do + for _, unitID in ipairs(categoryOpts) do if homePriority[unitID] then table.insert(priorityOpts, unitID) end end - return priorityOpts + return priorityOpts end -- grid indices are laid out like this @@ -238,13 +238,12 @@ function homeOptionsForBuilder(builderId, buildOptions) end optionsInRow = optionsInRow + 1 -- The grid is sorted by row, starting at the bottom. We want to order these items by column, so we switch their positions by changing the index - local index = (cat) + ((optionsInRow - 1) * columns) - options[index] = constructBuildOption(uDefID) - usedOptions[uDefID] = true + local index = cat + ((optionsInRow - 1) * columns) + options[index] = constructBuildOption(uDefID) + usedOptions[uDefID] = true end optionsInRow = 0 end - else -- if the unit doesn't have a predefined grid we still want the "home" page to have units -- So we build all the categories and grab the first 3 items from each one @@ -256,7 +255,7 @@ function homeOptionsForBuilder(builderId, buildOptions) end optionsInRow = optionsInRow + 1 -- The grid is sorted by row, starting at the bottom. We want to order these items by column, so we switch their positions by changing the index - local index = (cat) + ((optionsInRow - 1) * columns) + local index = cat + ((optionsInRow - 1) * columns) options[index] = opt local usedID = -opt.id usedOptions[usedID] = true @@ -265,14 +264,14 @@ function homeOptionsForBuilder(builderId, buildOptions) end end for cat = 1, 4 do - -- Replace the top row with the first unused priority unit in each category + -- Replace the top row with the first unused priority unit in each category local possibleOpts = {} for _, opt in pairs(categoryOptions[cat]) do local optID = -opt.id table.insert(possibleOpts, optID) end local priorityOpts = filterByPriority(possibleOpts, homePriority) - local row = 3 + local row = 3 local index = cat + ((row - 1) * columns) local topOption = options[index] if next(priorityOpts) ~= nil then @@ -293,11 +292,10 @@ function homeOptionsForBuilder(builderId, buildOptions) end end end - + return options end - local function getSortedGridForBuilder(builderId, buildOptions, currentCategory) if not builderId then return @@ -313,10 +311,9 @@ local function getSortedGridForBuilder(builderId, buildOptions, currentCategory) return getGridForCategory(builderId, buildOptions, currentCategory) end -- last resort for units that have no grid - return { } + return {} end - -- labs use cmds instead of buildoptions because they need to have state information like current queue count local function getSortedGridForLab(builderId, cmds) local options = {} @@ -326,8 +323,8 @@ local function getSortedGridForLab(builderId, cmds) for _, cmd in pairs(cmds) do if type(cmd) == "table" and not cmd.disabled then local id = -cmd.id - if string.sub(cmd.action, 1, 10) == 'buildunit_' then - if (unitGridPos[builderId] and unitGridPos[builderId][id]) then + if string.sub(cmd.action, 1, 10) == "buildunit_" then + if unitGridPos[builderId] and unitGridPos[builderId][id] then local row = string.sub(unitGridPos[builderId][id], 1, 1) local col = string.sub(unitGridPos[builderId][id], 2, 2) local index = col + ((row - 1) * columns) diff --git a/luaui/configs/gridmenu_layouts.lua b/luaui/configs/gridmenu_layouts.lua index a17621d770b..62249df8071 100644 --- a/luaui/configs/gridmenu_layouts.lua +++ b/luaui/configs/gridmenu_layouts.lua @@ -1,312 +1,733 @@ local labGrids = { -- T1 bot armlab = { - "armck", "armrectr", "armpw", "armflea", -- T1 con, rez bot, peewee, flea - "armrock", "armham", "armwar", "", -- rocko, hammer, warrior - "", "", "armjeth", -- aa bot + "armck", + "armrectr", + "armpw", + "armflea", -- T1 con, rez bot, peewee, flea + "armrock", + "armham", + "armwar", + "", -- rocko, hammer, warrior + "", + "", + "armjeth", -- aa bot }, corlab = { - "corck", "cornecro", "corak", "", -- T1 con, rez bot, AK - "corstorm", "corthud", "", "", -- storm, thud - "", "", "corcrash", -- aa bot + "corck", + "cornecro", + "corak", + "", -- T1 con, rez bot, AK + "corstorm", + "corthud", + "", + "", -- storm, thud + "", + "", + "corcrash", -- aa bot }, leglab = { - "legck", "legrezbot", "leggob", "", -- T1 con, rez bot, AK - "legbal", "leglob", "legkark", "legcen", -- storm, thud - "", "", "legaabot", -- aa bot + "legck", + "legrezbot", + "leggob", + "", -- T1 con, rez bot, AK + "legbal", + "leglob", + "legkark", + "legcen", -- storm, thud + "", + "", + "legaabot", -- aa bot }, -- T2 bot armalab = { - "armack", "armfark", "armfast", "armspy", -- T2 con, fark, zipper, spy - "armmark", "armaser", "armzeus", "armmav", -- radar bot, jammer bot, zeus, maverick - "armfido", "armsnipe", "armaak", "armfboy", -- fido, sniper, AA bot, fatboi + "armack", + "armfark", + "armfast", + "armspy", -- T2 con, fark, zipper, spy + "armmark", + "armaser", + "armzeus", + "armmav", -- radar bot, jammer bot, zeus, maverick + "armfido", + "armsnipe", + "armaak", + "armfboy", -- fido, sniper, AA bot, fatboi }, coralab = { - "corack", "corfast", "corpyro", "corspy", -- T2 con, freaker, pyro, spy - "corvoyr", "corspec", "corcan", "corhrk", -- radar bot, jammer bot, can, dominator - "cormort", "corroach", "coraak", "corsumo", -- morty, skuttle, AA bot, sumo + "corack", + "corfast", + "corpyro", + "corspy", -- T2 con, freaker, pyro, spy + "corvoyr", + "corspec", + "corcan", + "corhrk", -- radar bot, jammer bot, can, dominator + "cormort", + "corroach", + "coraak", + "corsumo", -- morty, skuttle, AA bot, sumo }, legalab = { -- page1 - "legack", "legaceb", "legstr", "legaspy", -- T2 con, proteus, hoplite, spy - "legaradk", "legajamk", "legshot", "leghrk", -- radar bot, jammer bot, phalanx, Thanatos - "legbart", "legsrail", "legadvaabot", "leginc", -- belcher, railgun, AA bot, incinerator + "legack", + "legaceb", + "legstr", + "legaspy", -- T2 con, proteus, hoplite, spy + "legaradk", + "legajamk", + "legshot", + "leghrk", -- radar bot, jammer bot, phalanx, Thanatos + "legbart", + "legsrail", + "legadvaabot", + "leginc", -- belcher, railgun, AA bot, incinerator -- page2 - "legamph", "leginfestor", "legsnapper", "corsktl", -- amphbious bot, infestor, snapper, skuttle - "legdecom", -- decoycom + "legamph", + "leginfestor", + "legsnapper", + "corsktl", -- amphbious bot, infestor, snapper, skuttle + "legdecom", -- decoycom }, -- T1 vehicle armvp = { - "armcv", "armmlv", "armflash", "armfav", -- T1 con, minelayer, flash, scout - "armstump", "armjanus", "armart", "", -- stumpy, janus, arty - "armbeaver", "armpincer", "armsam", "", -- amphib con, amphib tank, missile truck + "armcv", + "armmlv", + "armflash", + "armfav", -- T1 con, minelayer, flash, scout + "armstump", + "armjanus", + "armart", + "", -- stumpy, janus, arty + "armbeaver", + "armpincer", + "armsam", + "", -- amphib con, amphib tank, missile truck }, corvp = { - "corcv", "cormlv", "corgator", "corfav", -- T1 con, minelayer, gator, scout - "corraid", "corlevlr", "corwolv", "", -- raider, leveler, art - "cormuskrat", "corgarp", "cormist", "", -- amphib con, amphib tank, missile truck + "corcv", + "cormlv", + "corgator", + "corfav", -- T1 con, minelayer, gator, scout + "corraid", + "corlevlr", + "corwolv", + "", -- raider, leveler, art + "cormuskrat", + "corgarp", + "cormist", + "", -- amphib con, amphib tank, missile truck }, legvp = { - "legcv", "legmlv", "leghades", "legscout", -- T1 con, minelayer, gator, scout - "leghelios", "leggat", "legbar", "", -- raider, leveler, art - "legotter", "legamphtank", "legrail", "", -- amphib con, amphib tank, missile truck + "legcv", + "legmlv", + "leghades", + "legscout", -- T1 con, minelayer, gator, scout + "leghelios", + "leggat", + "legbar", + "", -- raider, leveler, art + "legotter", + "legamphtank", + "legrail", + "", -- amphib con, amphib tank, missile truck }, -- T2 vehicle armavp = { - "armacv", "armconsul", "armbull", "armmart", -- T2 con, consul, bulldog, luger - "armseer", "armjam", "armmanni", "armst", -- radar, jammer, penetrator, gremlin - "armlatnk", "armcroc", "armyork", "armmerl", -- panther, triton, AA, merl + "armacv", + "armconsul", + "armbull", + "armmart", -- T2 con, consul, bulldog, luger + "armseer", + "armjam", + "armmanni", + "armst", -- radar, jammer, penetrator, gremlin + "armlatnk", + "armcroc", + "armyork", + "armmerl", -- panther, triton, AA, merl }, coravp = { - "coracv", "corban", "correap", "cormart", -- T2 con, banisher, reaper, pillager - "corvrad", "coreter", "corgol", "cortrem", -- radar, jammer, goli, tremor - "corseal", "corparrow", "corsent", "corvroc", -- croc, poison arrow, AA, diplomat + "coracv", + "corban", + "correap", + "cormart", -- T2 con, banisher, reaper, pillager + "corvrad", + "coreter", + "corgol", + "cortrem", -- radar, jammer, goli, tremor + "corseal", + "corparrow", + "corsent", + "corvroc", -- croc, poison arrow, AA, diplomat }, legavp = { -- page1 - "legacv", "legafcv", "legaskirmtank", "legamcluster", -- T2 con, medusa, gladiator, cleaver - "legavrad", "legavjam", "legaheattank", "leginf", -- radar, jammer, prometheus, inferno - "legmrv", "legfloat", "legvflak", "legmed", -- Quickshot, new triton, AA, boreas + "legacv", + "legafcv", + "legaskirmtank", + "legamcluster", -- T2 con, medusa, gladiator, cleaver + "legavrad", + "legavjam", + "legaheattank", + "leginf", -- radar, jammer, prometheus, inferno + "legmrv", + "legfloat", + "legvflak", + "legmed", -- Quickshot, new triton, AA, boreas -- page2 - "legvcarry", "legavroc", "legavantinuke", -- mantis, chiron, veh antinuke + "legvcarry", + "legavroc", + "legavantinuke", -- mantis, chiron, veh antinuke }, -- T1 air armap = { - "armca", "armfig", "armkam", "armthund", -- T1 con, fig, gunship, bomber - "armpeep", "armatlas", "armhvytrans", -- radar, light transport, medium transport + "armca", + "armfig", + "armkam", + "armthund", -- T1 con, fig, gunship, bomber + "armpeep", + "armatlas", + "armhvytrans", -- radar, light transport, medium transport }, corap = { - "corca", "corveng", "corbw", "corshad", -- T1 con, fig, drone, bomber - "corfink", "corvalk", "corhvytrans", -- radar, light transport, medium transport - }, - legap = { - "legca", "legfig", "legmos", "legkam", -- T1 con, fig, drone, bomber - "legcib", "leglts", "legatrans", -- radar, light transport, medium transport + "corca", + "corveng", + "corbw", + "corshad", -- T1 con, fig, drone, bomber + "corfink", + "corvalk", + "corhvytrans", -- radar, light transport, medium transport + }, + legap = { + "legca", + "legfig", + "legmos", + "legkam", -- T1 con, fig, drone, bomber + "legcib", + "leglts", + "legatrans", -- radar, light transport, medium transport }, -- T2 air armaap = { - "armaca", "armhawk", "armbrawl", "armpnix", -- T2 con, fig, gunship, bomber - "armawac", "armdfly", "armlance", "armsfig2", -- radar, transport, torpedo, heavy fighter (mod) - "armliche", "armblade", "armstil", -- liche, blade, stiletto + "armaca", + "armhawk", + "armbrawl", + "armpnix", -- T2 con, fig, gunship, bomber + "armawac", + "armdfly", + "armlance", + "armsfig2", -- radar, transport, torpedo, heavy fighter (mod) + "armliche", + "armblade", + "armstil", -- liche, blade, stiletto }, coraap = { - "coraca", "corvamp", "corape", "corhurc", -- T2 con, fig, gunship, bomber - "corawac", "corseah", "cortitan", "corsfig2", -- radar, transport, torpedo, heavy fighter (mod) - "corcrw","corcrwh", -- krow + "coraca", + "corvamp", + "corape", + "corhurc", -- T2 con, fig, gunship, bomber + "corawac", + "corseah", + "cortitan", + "corsfig2", -- radar, transport, torpedo, heavy fighter (mod) + "corcrw", + "corcrwh", -- krow }, legaap = { - "legaca", "legafigdef", "legvenator", "legphoenix", --T2 con, defensive fig, interceptor, phoenix - "legwhisper", "legstronghold", "legatorpbomber", "", --radar, transport(gunship), torpedo, - "legfort", "", "legmineb", "" --flying fort, empty, minebomber + "legaca", + "legafigdef", + "legvenator", + "legphoenix", --T2 con, defensive fig, interceptor, phoenix + "legwhisper", + "legstronghold", + "legatorpbomber", + "", --radar, transport(gunship), torpedo, + "legfort", + "", + "legmineb", + "", --flying fort, empty, minebomber }, -- seaplanes armplat = { - "armcsa", "armsfig", "armsaber", "armsb", -- seaplane con, fig, gunship, bomber - "armsehak", "armseap", -- radar, torpedo + "armcsa", + "armsfig", + "armsaber", + "armsb", -- seaplane con, fig, gunship, bomber + "armsehak", + "armseap", -- radar, torpedo }, corplat = { - "corcsa", "corsfig", "corcut", "corsb", -- seaplane con, fig, gunship, bomber - "corhunt", "corseap", -- radar, torpedo + "corcsa", + "corsfig", + "corcut", + "corsb", -- seaplane con, fig, gunship, bomber + "corhunt", + "corseap", -- radar, torpedo }, legsplab = { - "legspcon", "legspfighter", "legspsurfacegunship", "legspbomber", -- seaplane con, fig, gunship, bomber - "legspradarsonarplane", "legsptorpgunship", "legspcarrier", -- radar, torpedo + "legspcon", + "legspfighter", + "legspsurfacegunship", + "legspbomber", -- seaplane con, fig, gunship, bomber + "legspradarsonarplane", + "legsptorpgunship", + "legspcarrier", -- radar, torpedo }, -- T1 boats armsy = { - "armcs", "armrecl", "armdecade", "", -- T1 sea con, rez sub, decade - "armpship", "armroy", "", "", -- frigate, destroyer, transport ("armtship",) - "armsub", "", "armpt", -- sub, PT boat + "armcs", + "armrecl", + "armdecade", + "", -- T1 sea con, rez sub, decade + "armpship", + "armroy", + "", + "", -- frigate, destroyer, transport ("armtship",) + "armsub", + "", + "armpt", -- sub, PT boat }, corsy = { - "corcs", "correcl", "coresupp", "", -- T1 sea con, rez sub, supporter, missile boat - "corpship", "corroy", "", "", -- frigate, destroyer, transport ("cortship",) - "corsub", "", "corpt", -- sub, missile boat + "corcs", + "correcl", + "coresupp", + "", -- T1 sea con, rez sub, supporter, missile boat + "corpship", + "corroy", + "", + "", -- frigate, destroyer, transport ("cortship",) + "corsub", + "", + "corpt", -- sub, missile boat }, legsy = { - "legnavyconship", "legnavyrezsub", "legnavyscout", "", -- T1 sea con, rez sub, supporter, missile boat - "legnavyfrigate", "legnavydestro", "legnavyartyship", "", -- frigate, destroyer, transport ("cortship",) - "legnavysub", "", "legnavyaaship", -- sub, missile boat + "legnavyconship", + "legnavyrezsub", + "legnavyscout", + "", -- T1 sea con, rez sub, supporter, missile boat + "legnavyfrigate", + "legnavydestro", + "legnavyartyship", + "", -- frigate, destroyer, transport ("cortship",) + "legnavysub", + "", + "legnavyaaship", -- sub, missile boat }, -- T2 boats armasy = { - "armacsub", "armmls", "armcrus", "armmship", -- T2 con sub, naval engineer, cruiser, rocket ship - "armcarry", "armsjam", "armbats", "armepoch", -- carrier, jammer, battleship, flagship - "armsubk", "armserp", "armaas", -- sub killer, battlesub, AA + "armacsub", + "armmls", + "armcrus", + "armmship", -- T2 con sub, naval engineer, cruiser, rocket ship + "armcarry", + "armsjam", + "armbats", + "armepoch", -- carrier, jammer, battleship, flagship + "armsubk", + "armserp", + "armaas", -- sub killer, battlesub, AA }, corasy = { - "coracsub", "cormls", "corcrus", "cormship", -- T2 con sub, naval engineer, cruiser, rocket ship - "corcarry", "corsjam", "corbats", "corblackhy", -- carrier, jammer, battleship, flagship - "corshark", "corssub", "corarch", -- sub killer, battlesub, AA + "coracsub", + "cormls", + "corcrus", + "cormship", -- T2 con sub, naval engineer, cruiser, rocket ship + "corcarry", + "corsjam", + "corbats", + "corblackhy", -- carrier, jammer, battleship, flagship + "corshark", + "corssub", + "corarch", -- sub killer, battlesub, AA }, legadvshipyard = { - "leganavyconsub", "leganavyengineer", "leganavycruiser", "leganavymissileship", -- T2 con sub, naval engineer, cruiser, rocket ship - "leganavyantinukecarrier", "leganavyradjamship", "leganavybattleship", "leganavyflagship", -- carrier, jammer, battleship, flagship - "leganavybattlesub", "leganavyheavysub", "leganavyaaship", "leganavyartyship", -- sub killer, battlesub, AA - - "leganavyantiswarm","","","", + "leganavyconsub", + "leganavyengineer", + "leganavycruiser", + "leganavymissileship", -- T2 con sub, naval engineer, cruiser, rocket ship + "leganavyantinukecarrier", + "leganavyradjamship", + "leganavybattleship", + "leganavyflagship", -- carrier, jammer, battleship, flagship + "leganavybattlesub", + "leganavyheavysub", + "leganavyaaship", + "leganavyartyship", -- sub killer, battlesub, AA + + "leganavyantiswarm", + "", + "", + "", }, -- amphibious labs armamsub = { - "armbeaver", "armdecom", "armpincer", "", - "armcroc", "", "", "", - "", "armjeth", "armaak", + "armbeaver", + "armdecom", + "armpincer", + "", + "armcroc", + "", + "", + "", + "", + "armjeth", + "armaak", }, coramsub = { - "cormuskrat", "cordecom", "corgarp", "", - "corseal", "corparrow", "", "", - "", "corcrash", "coraak", + "cormuskrat", + "cordecom", + "corgarp", + "", + "corseal", + "corparrow", + "", + "", + "", + "corcrash", + "coraak", }, legamphlab = { - "legotter", "legdecom", "legamphtank", "", -- amphibious con, decoy com, t1 amphibious tank, idk - "", "legfloat", "legamph", "", -- idk, t2 floating tank, idk, idk - "", "legaabot", "legadvaabot", "", -- idk, t1 aa bot, t2 aa bot, idk + "legotter", + "legdecom", + "legamphtank", + "", -- amphibious con, decoy com, t1 amphibious tank, idk + "", + "legfloat", + "legamph", + "", -- idk, t2 floating tank, idk, idk + "", + "legaabot", + "legadvaabot", + "", -- idk, t1 aa bot, t2 aa bot, idk }, -- hover labs armhp = { - "armch", "", "armsh", "", -- hover con, seeker - "armanac", "armmh", "", "", -- crocodile, possum - "", "", "armah", -- hover AA + "armch", + "", + "armsh", + "", -- hover con, seeker + "armanac", + "armmh", + "", + "", -- crocodile, possum + "", + "", + "armah", -- hover AA }, corhp = { - "corch", "", "corsh", "", -- hover con, goon - "corsnap", "cormh", "corhal", "", -- cayman, mangonel, halberd - "", "", "corah", -- hover AA - }, - - leghp = { - "legch", "", "legsh", "", -- hover con, glaucus - "legner", "legmh", "legcar", "", -- nereus, salacia, cardea - "", "", "legah", -- hover AA + "corch", + "", + "corsh", + "", -- hover con, goon + "corsnap", + "cormh", + "corhal", + "", -- cayman, mangonel, halberd + "", + "", + "corah", -- hover AA + }, + + leghp = { + "legch", + "", + "legsh", + "", -- hover con, glaucus + "legner", + "legmh", + "legcar", + "", -- nereus, salacia, cardea + "", + "", + "legah", -- hover AA }, -- naval hover labs armfhp = { - "armch", "", "armsh", "", - "armanac", "armmh", "", "", - "", "", "armah", + "armch", + "", + "armsh", + "", + "armanac", + "armmh", + "", + "", + "", + "", + "armah", }, corfhp = { - "corch", "", "corsh", "", - "corsnap", "cormh", "corhal", "", - "", "", "corah", + "corch", + "", + "corsh", + "", + "corsnap", + "cormh", + "corhal", + "", + "", + "", + "corah", }, legfhp = { - "legch", "", "legsh", "", -- hover con, glaucus - "legner", "legmh", "legcar", "", -- nereus, salacia, cardea - "", "", "legah", -- hover AA + "legch", + "", + "legsh", + "", -- hover con, glaucus + "legner", + "legmh", + "legcar", + "", -- nereus, salacia, cardea + "", + "", + "legah", -- hover AA }, -- T3 labs armshltx = { - "armmar", "armraz", "armvang", "armthor", -- marauder, razorback, vanguard, thor - "armbanth", "armlun", -- titan, lunkhead + "armmar", + "armraz", + "armvang", + "armthor", -- marauder, razorback, vanguard, thor + "armbanth", + "armlun", -- titan, lunkhead }, corgant = { - "corcat", "corkarg", "corshiva", "corkorg", -- catapult, Karganeth, shiva, juggernaut - "corjugg", "corsok", -- behemoth, cataphract + "corcat", + "corkarg", + "corshiva", + "corkorg", -- catapult, Karganeth, shiva, juggernaut + "corjugg", + "corsok", -- behemoth, cataphract }, leggant = { - "legjav", "legkeres", "legeallterrainmech", "legeheatraymech", -- javelin, keres, myrmidon, sol invictus - "legelrpcmech", "legehovertank", "legeshotgunmech", "legerailtank", -- astraeus, charybdis, praetorian, daedalus + "legjav", + "legkeres", + "legeallterrainmech", + "legeheatraymech", -- javelin, keres, myrmidon, sol invictus + "legelrpcmech", + "legehovertank", + "legeshotgunmech", + "legerailtank", -- astraeus, charybdis, praetorian, daedalus }, -- T3 underwater labs armshltxuw = { - "armbantha", "armmar", "armcroc", "armlun", -- titan, marauder, turtle, lunkhead + "armbantha", + "armmar", + "armcroc", + "armlun", -- titan, marauder, turtle, lunkhead }, corgantuw = { - "corkorg", "corshiva", "corsala", "corparrow", -- juggernaut, shiva, salamander, poison arrow - "corsok", -- cataphract + "corkorg", + "corshiva", + "corsala", + "corparrow", -- juggernaut, shiva, salamander, poison arrow + "corsok", -- cataphract }, -- Split Tier Labs corhalab = { - "corhack", "cordecom", "corpyro", "corspec", - "", "corshiva", "corsumo", "corsktl", - "", "", "coraak", "", + "corhack", + "cordecom", + "corpyro", + "corspec", + "", + "corshiva", + "corsumo", + "corsktl", + "", + "", + "coraak", + "", }, armhalab = { - "armhack", "armdecom", "armmar", "armaser", - "armsnipe", "armfboy", "armzeus", "armspy", - "armscab", "", "armaak", "", + "armhack", + "armdecom", + "armmar", + "armaser", + "armsnipe", + "armfboy", + "armzeus", + "armspy", + "armscab", + "", + "armaak", + "", }, leghalab = { - "leghack", "legdecom", "legjav", "legajamk", - "legsrail", "leginc", "legshot", "", - "", "legamph", "legadvaabot", "", + "leghack", + "legdecom", + "legjav", + "legajamk", + "legsrail", + "leginc", + "legshot", + "", + "", + "legamph", + "legadvaabot", + "", }, armhaap = { - "armhaca", "armhawk", "armbrawl", "armpnix", -- T2 con, fig, gunship, bomber - "armawac", "armdfly", "armlance", "armsfig2", -- radar, transport, torpedo, heavy fighter (mod) - "armliche", "armblade", "armstil", -- empty rows + "armhaca", + "armhawk", + "armbrawl", + "armpnix", -- T2 con, fig, gunship, bomber + "armawac", + "armdfly", + "armlance", + "armsfig2", -- radar, transport, torpedo, heavy fighter (mod) + "armliche", + "armblade", + "armstil", -- empty rows }, armhaapuw = { - "armhaca", "armsfig", "armsaber", "armsb", -- T2 con, seaplane, gunship, bomber - "armsehak", "armhvytrans", "armseap", "", -- radar, torpedo, empty, empty - "", "", "", "", -- empty rows + "armhaca", + "armsfig", + "armsaber", + "armsb", -- T2 con, seaplane, gunship, bomber + "armsehak", + "armhvytrans", + "armseap", + "", -- radar, torpedo, empty, empty + "", + "", + "", + "", -- empty rows }, corhaap = { - "coraca", "corvamp", "corape", "corhurc", -- T2 con, fig, gunship, bomber - "corawac", "corseah", "cortitan", "corsfig2", -- radar, transport, torpedo, heavy fighter (mod) - "corcrw","corcrwh", -- empty rows + "coraca", + "corvamp", + "corape", + "corhurc", -- T2 con, fig, gunship, bomber + "corawac", + "corseah", + "cortitan", + "corsfig2", -- radar, transport, torpedo, heavy fighter (mod) + "corcrw", + "corcrwh", -- empty rows }, corhaapuw = { - "corhaca", "corsfig", "corcut", "corsb", -- T2 con, seaplane, gunship, bomber - "corhunt", "corhvytrans", "corseap", "", -- radar, torpedo, empty, empty - "", "", "", "", -- empty rows + "corhaca", + "corsfig", + "corcut", + "corsb", -- T2 con, seaplane, gunship, bomber + "corhunt", + "corhvytrans", + "corseap", + "", -- radar, torpedo, empty, empty + "", + "", + "", + "", -- empty rows }, - + leghaap = { - "legaca", "legafigdef", "legvenator", "legphoenix", --T2 con, defensive fig, interceptor, phoenix - "legwhisper", "legstronghold", "legatorpbomber", "", --radar, transport(gunship), torpedo, - "legfort", "", "legmineb", "" --flying fort, empty, minebomber + "legaca", + "legafigdef", + "legvenator", + "legphoenix", --T2 con, defensive fig, interceptor, phoenix + "legwhisper", + "legstronghold", + "legatorpbomber", + "", --radar, transport(gunship), torpedo, + "legfort", + "", + "legmineb", + "", --flying fort, empty, minebomber }, armhasy = { - "armhacs", "", "armlship", "armantiship", - "armmship", "armepoch", "armbats", "", - "armserp", "armlun", "armaas", "", + "armhacs", + "", + "armlship", + "armantiship", + "armmship", + "armepoch", + "armbats", + "", + "armserp", + "armlun", + "armaas", + "", }, corhasy = { - "corhacs", "", "corfship", "corantiship", - "cormship", "corblackhy", "corbats", "", - "corssub", "corsok", "corarch", "", + "corhacs", + "", + "corfship", + "corantiship", + "cormship", + "corblackhy", + "corbats", + "", + "corssub", + "corsok", + "corarch", + "", }, armhavp = { - "armhacv", "", "armlatnk", "armjam", - "armmanni", "armmerl", "armbull", "armgremlin", - "", "armlun", "armyork", "", + "armhacv", + "", + "armlatnk", + "armjam", + "armmanni", + "armmerl", + "armbull", + "armgremlin", + "", + "armlun", + "armyork", + "", }, corhavp = { - "corhacv", "", "corsala", "coreter", - "cortrem", "corgol", "corparrow", "", - "cormabm", "corsok", "corsent", "corvroc", + "corhacv", + "", + "corsala", + "coreter", + "cortrem", + "corgol", + "corparrow", + "", + "cormabm", + "corsok", + "corsent", + "corvroc", }, leghavp = { - "leghacv", "", "legmrv", "legavjam", - "leginf", "legmed", "legaheattank", "", - "legavantinuke", "legehovertank", "legvflak", "legavroc", + "leghacv", + "", + "legmrv", + "legavjam", + "leginf", + "legmed", + "legaheattank", + "", + "legavantinuke", + "legehovertank", + "legvflak", + "legavroc", }, } @@ -314,2227 +735,2224 @@ local unitGrids = { -- Air assist drones armassistdrone = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", "", "armuwms", "armtide"}, -- T1 converter, uw m storage, tidal - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, uw e storage, floating converter + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr", "", "armuwms", "armtide" }, -- T1 converter, uw m storage, tidal + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, uw e storage, floating converter }, { - { "armllt", "armtl", }, -- LLT, offshore torp launcher - { "armrl", "armfrt", }, -- basic AA, floating AA - { "armdl", }, -- coastal torp launcher + { "armllt", "armtl" }, -- LLT, offshore torp launcher + { "armrl", "armfrt" }, -- basic AA, floating AA + { "armdl" }, -- coastal torp launcher }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "armhp", "armfhp", }, -- hover lab, floating hover lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "armhp", "armfhp" }, -- hover lab, floating hover lab + }, }, corassistdrone = { { - { "cormex", "corsolar", "corwin", }, -- mex, solar, wind - { "cormakr", "", "coruwms", "cortide"}, -- T1 converter, uw m storage, tidal - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m sotrage, uw e storage, floating converter + { "cormex", "corsolar", "corwin" }, -- mex, solar, wind + { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw m storage, tidal + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "corllt", "cortl", }, -- LLT, offshore torp launcher - { "corrl", "corfrt", }, -- basic AA, floating AA - { "cordl", }, -- coastal torp launcher + { "corllt", "cortl" }, -- LLT, offshore torp launcher + { "corrl", "corfrt" }, -- basic AA, floating AA + { "cordl" }, -- coastal torp launcher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "corhp", "corfhp", }, -- hover lab, floating hover lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "corhp", "corfhp" }, -- hover lab, floating hover lab + }, }, legassistdrone = { { - { "legmex", "legsolar", "legwin", }, -- mex, solar, wind - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter + { "legmex", "legsolar", "legwin" }, -- mex, solar, wind + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "leglht", "legtl", }, -- LLT, offshore torp launcher - { "legrl", "legfrl", }, -- basic AA, floating AA - { "legctl", }, -- coastal torp launcher + { "leglht", "legtl" }, -- LLT, offshore torp launcher + { "legrl", "legfrl" }, -- basic AA, floating AA + { "legctl" }, -- coastal torp launcher }, { - { "legrad", "legeyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "legrad", "legeyes", "legdrag" }, -- radar, perimeter camera, dragon's teeth + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, -- Land assist drones (mini amphibs) armassistdrone_land = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", "", "armuwms", "armtide"}, -- T1 converter, uw m storage, tidal - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, uw e storage, floating converter + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr", "", "armuwms", "armtide" }, -- T1 converter, uw m storage, tidal + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, uw e storage, floating converter }, { - { "armllt", "armtl", }, -- LLT, offshore torp launcher - { "armrl", "armfrt", }, -- basic AA, floating AA - { "armdl", }, -- coastal torp launcher + { "armllt", "armtl" }, -- LLT, offshore torp launcher + { "armrl", "armfrt" }, -- basic AA, floating AA + { "armdl" }, -- coastal torp launcher }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "armhp", "armfhp", }, -- hover lab, floating hover lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "armhp", "armfhp" }, -- hover lab, floating hover lab + }, }, corassistdrone_land = { { - { "cormex", "corsolar", "corwin", }, -- mex, solar, wind - { "cormakr", "", "coruwms", "cortide"}, -- T1 converter, uw m storage, tidal - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m sotrage, uw e storage, floating converter + { "cormex", "corsolar", "corwin" }, -- mex, solar, wind + { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw m storage, tidal + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "corllt", "cortl", }, -- LLT, offshore torp launcher - { "corrl", "corfrt", }, -- basic AA, floating AA - { "cordl", }, -- coastal torp launcher + { "corllt", "cortl" }, -- LLT, offshore torp launcher + { "corrl", "corfrt" }, -- basic AA, floating AA + { "cordl" }, -- coastal torp launcher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "corhp", "corfhp", }, -- hover lab, floating hover lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "corhp", "corfhp" }, -- hover lab, floating hover lab + }, }, legassistdrone_land = { { - { "legmex", "legsolar", "legwin", }, -- mex, solar, wind - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter + { "legmex", "legsolar", "legwin" }, -- mex, solar, wind + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "leglht", "legtl", }, -- LLT, offshore torp launcher - { "legrl", "legfrl", }, -- basic AA, floating AA - { "legctl", }, -- coastal torp launcher + { "leglht", "legtl" }, -- LLT, offshore torp launcher + { "legrl", "legfrl" }, -- basic AA, floating AA + { "legctl" }, -- coastal torp launcher }, { - { "legrad", "legeyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "legrad", "legeyes", "legdrag" }, -- radar, perimeter camera, dragon's teeth + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, -- Commanders armcom = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", "", "armuwms", "armtide"}, -- T1 converter, uw m storage, tidal - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, uw e storage, floating converter + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr", "", "armuwms", "armtide" }, -- T1 converter, uw m storage, tidal + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, uw e storage, floating converter }, { - { "armllt", "armtl", }, -- LLT, offshore torp launcher - { "armrl", "armfrt", }, -- basic AA, floating AA - { "armdl", }, -- coastal torp launcher + { "armllt", "armtl" }, -- LLT, offshore torp launcher + { "armrl", "armfrt" }, -- basic AA, floating AA + { "armdl" }, -- coastal torp launcher }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "armhp", "armfhp", }, -- hover lab, floating hover lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "armhp", "armfhp" }, -- hover lab, floating hover lab + }, }, armcomlvl2 = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", "", "armuwms", "armtide"}, -- T1 converter, uw m storage, tidal - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, uw e storage, floating converter + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr", "", "armuwms", "armtide" }, -- T1 converter, uw m storage, tidal + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, uw e storage, floating converter }, { - { "armllt", "armbeamer", "armhlt", "", }, -- LLT, beamer, HLT - { "armrl", "armferret", "armcir", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armguard", "armtl", "armfrock"}, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT + { "armllt", "armbeamer", "armhlt", "" }, -- LLT, beamer, HLT + { "armrl", "armferret", "armcir", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armguard", "armtl", "armfrock" }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { "", "armmine1", "armmine2", "armmine3", }, -- empty, Lmine, Mmine, Hmine + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + { "", "armmine1", "armmine2", "armmine3" }, -- empty, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "armhp", "armfhp", }, -- hover lab, floating hover lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "armhp", "armfhp" }, -- hover lab, floating hover lab + }, }, armcomlvl3 = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armtide", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armtide" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armguard", "armtl", "armfrock"}, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armguard", "armtl", "armfrock" }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl4 = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armtide", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armtide" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armpb", "armbeamer", "armhlt", "armclaw", }, -- pitbull, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armamb", "armtl", }, -- coastal torp launcher, rattlesnake, offshore torp launcher, + { "armpb", "armbeamer", "armhlt", "armclaw" }, -- pitbull, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armamb", "armtl" }, -- coastal torp launcher, rattlesnake, offshore torp launcher, }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl5 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl6 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl7 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl8 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl9 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, armcomlvl10 = { { - { "armmoho", "armfus", "armafus", "armadvsol", }, -- moho, fusion, afus, advsolar - { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal - { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm",},--hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter + { "armmoho", "armfus", "armafus", "armadvsol" }, -- moho, fusion, afus, advsolar + { "armmmkr", "armageo", "armamex", "armtide" }, -- T2 converter, T2 geo, twilight, tidal + { "armuwadves", "armuwadvms", "armuwmme", "armuwmmm" }, --hardened energy storage, hardened metal storage, uw t2 metal extract, floating adv Econverter }, { - { "armpb", "armanni", "armamb", "armclaw", }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw - { "armflak", "armmercury", "armbeamer", "armfflak", },-- flak, long-range AA, beamer, floating flak - { "armdl", "", "armatl", }, -- coastal torpedo launcher, adv torpedo launcher, lolcannon + { "armpb", "armanni", "armamb", "armclaw" }, -- pop-up gauss, annihilator, pop-up artillery, dragonclaw + { "armflak", "armmercury", "armbeamer", "armfflak" }, -- flak, long-range AA, beamer, floating flak + { "armdl", "", "armatl" }, -- coastal torpedo launcher, adv torpedo launcher, lolcannon }, { - { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer - { "armfrad", "armfdrag", "armdrag", "" }, -- - { "armjuno", "armmine1", "armmine2", "armmine3", },-- juno, Lmine, Mmine, Hmine + { "armarad", "armeyes", "armfort", "armjamt" }, -- adv radar, camera, t2 wall, cloak jammer + { "armfrad", "armfdrag", "armdrag", "" }, -- + { "armjuno", "armmine1", "armmine2", "armmine3" }, -- juno, Lmine, Mmine, Hmine }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "", "armnanotcplat", }, -- nano, empty, floating nano - { "armhp", "armfhp", "", "armdecom",}, -- hover lab, floating hover lab, empty, decoy commander - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "", "armnanotcplat" }, -- nano, empty, floating nano + { "armhp", "armfhp", "", "armdecom" }, -- hover lab, floating hover lab, empty, decoy commander + }, }, corcom = { { - { "cormex", "corsolar", "corwin", }, -- mex, solar, wind - { "cormakr", "", "coruwms", "cortide"}, -- T1 converter, uw m storage, tidal - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m sotrage, uw e storage, floating converter + { "cormex", "corsolar", "corwin" }, -- mex, solar, wind + { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw m storage, tidal + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "corllt", "cortl", }, -- LLT, offshore torp launcher - { "corrl", "corfrt", }, -- basic AA, floating AA - { "cordl", }, -- coastal torp launcher + { "corllt", "cortl" }, -- LLT, offshore torp launcher + { "corrl", "corfrt" }, -- basic AA, floating AA + { "cordl" }, -- coastal torp launcher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "corhp", "corfhp", }, -- hover lab, floating hover lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "corhp", "corfhp" }, -- hover lab, floating hover lab + }, }, corcomlvl2 = { { - { "cormex", "corsolar", "corwin", }, -- mex, solar, wind - { "cormakr", "", "coruwms", "cortide"}, -- T1 converter, uw m storage, tidal - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m sotrage, uw e storage, floating converter + { "cormex", "corsolar", "corwin" }, -- mex, solar, wind + { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw m storage, tidal + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "corllt", "cortl", }, -- LLT, offshore torp launcher - { "corrl", "corfrt", }, -- basic AA, floating AA - { "cordl", }, -- coastal torp launcher + { "corllt", "cortl" }, -- LLT, offshore torp launcher + { "corrl", "corfrt" }, -- basic AA, floating AA + { "cordl" }, -- coastal torp launcher }, { - { "corrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "corrad", "coreyes", "legdrag" }, -- radar, perimeter camera, dragon's teeth + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "corhp", "corfhp", }, -- hover lab, floating hover lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "corhp", "corfhp" }, -- hover lab, floating hover lab + }, }, corcomlvl3 = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", "cortide", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp", "cortide" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "cortl", "", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun", "cortl", "" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl4 = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", "cortide", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp", "cortide" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "cortl", "", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun", "cortl", "" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl5 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl6 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl7 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl8 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl9 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, corcomlvl10 = { { - { "cormoho", "corfus", "corwin", "coradvsol",}, -- moho, fusion, afus, adv solar + { "cormoho", "corfus", "corwin", "coradvsol" }, -- moho, fusion, afus, adv solar { "cormmkr", "corageo", "cormexp", "cortide" }, -- T2 converter, T2 geo, armed moho, tidal generator - { "coruwadves", "coruwadvms", "coruwmme","coruwmmm",}, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker + { "coruwadves", "coruwadvms", "coruwmme", "coruwmmm" }, -- hardened energy storage, hardened metal storage, uw metal extractor, floating metalmaker }, { - { "corvipe", "cordoom", "cortoast", "cormaw", }, -- pop-up gauss, DDM, pop-up artillery, dragon maw - { "corflak", "corscreamer", "corhllt", "cornaa", }, -- flak, long-range AA, twin guard, floating flak - { "cordl", "", "coratl", }, -- coastal torpedo launcher, empty, adv torpedo launcher + { "corvipe", "cordoom", "cortoast", "cormaw" }, -- pop-up gauss, DDM, pop-up artillery, dragon maw + { "corflak", "corscreamer", "corhllt", "cornaa" }, -- flak, long-range AA, twin guard, floating flak + { "cordl", "", "coratl" }, -- coastal torpedo launcher, empty, adv torpedo launcher }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, t2wall, adv jammer - { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, - { "corjuno", }, -- juno + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, t2wall, adv jammer + { "corfrad", "corfdrag", "cordrag", "" }, --floating radar, floating dragteeth, drag teeth, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "", "cornanotcplat", }, -- nano, floating nano - { "corhp", "corfhp", "", "corplat", }, -- hover lab, floating hover lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "", "cornanotcplat" }, -- nano, floating nano + { "corhp", "corfhp", "", "corplat" }, -- hover lab, floating hover lab, seaplane lab + }, }, -- legion commanders - legcom = { + legcom = { { - { "legmex", "legsolar", "legwin", }, -- mex, solar, wind - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter + { "legmex", "legsolar", "legwin" }, -- mex, solar, wind + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "leglht", "legtl", }, -- LLT, offshore torp launcher - { "legrl", "legfrl", }, -- basic AA, floating AA - { "legctl", }, -- coastal torp launcher + { "leglht", "legtl" }, -- LLT, offshore torp launcher + { "legrl", "legfrl" }, -- basic AA, floating AA + { "legctl" }, -- coastal torp launcher }, { - { "legrad", "legeyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "legrad", "legeyes", "legdrag" }, -- radar, perimeter camera, dragon's teeth + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl2 = { { - { "legmex", "legsolar", "legwin", }, -- mex, solar, wind - { "legeconv", "", "leguwmstore", "legtide"}, -- T1.5 mex, uw m storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m sotrage, uw e storage, floating converter + { "legmex", "legsolar", "legwin" }, -- mex, solar, wind + { "legeconv", "", "leguwmstore", "legtide" }, -- T1.5 mex, uw m storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m sotrage, uw e storage, floating converter }, { - { "leglht", "legtl", "leggob", "leglob",}, -- LLT, offshore torp launcher, goblin, lobber - { "legrl", "legfrl", "legrail", "legbar",}, -- basic AA, floating AA, blank, barrage - { "legctl", }, -- coastal torp launcher + { "leglht", "legtl", "leggob", "leglob" }, -- LLT, offshore torp launcher, goblin, lobber + { "legrl", "legfrl", "legrail", "legbar" }, -- basic AA, floating AA, blank, barrage + { "legctl" }, -- coastal torp launcher }, { - { "legrad", "legeyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { "legrad", "legeyes", "legdrag" }, -- radar, perimeter camera, dragon's teeth + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + {}, -- empty }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { }, -- empty row - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + {}, -- empty row + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl3 = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", "legtide", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15", "legtide" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leggat", "legbar", "legkark", "legcen", }, -- decurion, barrage, karkinos, centaur - { "legrl", "legrail", "legmg", "legdtr", }, -- basic AA, lance, cacophony, dragon maw - { "legctl", "leghive", "legtl", "", },-- coastal torp launcher, hive, offshore torp launcher, dragon tail + { "leggat", "legbar", "legkark", "legcen" }, -- decurion, barrage, karkinos, centaur + { "legrl", "legrail", "legmg", "legdtr" }, -- basic AA, lance, cacophony, dragon maw + { "legctl", "leghive", "legtl", "" }, -- coastal torp launcher, hive, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legdrag", "legavjam", }, -- radar bot, perimeter camera, dragon's teeth, jammer bot - { "legfrad", "legfdrag",}, -- floating radar, shark's teeth - { "legjuno", "legrad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legdrag", "legavjam" }, -- radar bot, perimeter camera, dragon's teeth, jammer bot + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + { "legjuno", "legrad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl4 = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", "legtide", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15", "legtide" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leggat", "legbart", "legshot", "legstr", }, -- decurion, belcher, phalanx, strider - { "legvflak", "legmed", "legmg", "legdtr", }, -- aa vehicle, medusa, cacophony, dragon maw - { "legctl", "legvcarry", "leganavaltorpturret", "", }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail + { "leggat", "legbart", "legshot", "legstr" }, -- decurion, belcher, phalanx, strider + { "legvflak", "legmed", "legmg", "legdtr" }, -- aa vehicle, medusa, cacophony, dragon maw + { "legctl", "legvcarry", "leganavaltorpturret", "" }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl5 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legstr", }, -- decurion, belcher, phalanx, strider - { "legvflak", "legmed", "legmg", "legdtr", }, -- aa vehicle, medusa, cacophony, dragon maw - { "legctl", "legvcarry", "leganavaltorpturret", "", }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail + { "legaheattank", "leginf", "legshot", "legstr" }, -- decurion, belcher, phalanx, strider + { "legvflak", "legmed", "legmg", "legdtr" }, -- aa vehicle, medusa, cacophony, dragon maw + { "legctl", "legvcarry", "leganavaltorpturret", "" }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl6 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legmrv", }, -- decurion, belcher, phalanx, quickshot - { "legvflak", "legmed", "legmg", "legkeres", }, -- aa vehicle, medusa, cacophony, keres - { "legctl", "legvcarry", "leganavaltorpturret", "legdtr", }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail + { "legaheattank", "leginf", "legshot", "legmrv" }, -- decurion, belcher, phalanx, quickshot + { "legvflak", "legmed", "legmg", "legkeres" }, -- aa vehicle, medusa, cacophony, keres + { "legctl", "legvcarry", "leganavaltorpturret", "legdtr" }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legforti", "legajam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legajam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl7 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legmrv", }, -- decurion, belcher, phalanx, quickshot - { "corsent", "legmed", "legmg", "legkeres", }, -- aa vehicle, medusa, cacophony, keres - { "legctl", "legvcarry", "leganavaltorpturret", "legdtr", }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail + { "legaheattank", "leginf", "legshot", "legmrv" }, -- decurion, belcher, phalanx, quickshot + { "corsent", "legmed", "legmg", "legkeres" }, -- aa vehicle, medusa, cacophony, keres + { "legctl", "legvcarry", "leganavaltorpturret", "legdtr" }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl8 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legmrv", }, -- decurion, belcher, phalanx, quickshot - { "legvflak", "legmed", "legmg", "legkeres", }, -- aa vehicle, medusa, cacophony, keres - { "legctl", "legvcarry", "leganavaltorpturret", "legdtr", }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail + { "legaheattank", "leginf", "legshot", "legmrv" }, -- decurion, belcher, phalanx, quickshot + { "legvflak", "legmed", "legmg", "legkeres" }, -- aa vehicle, medusa, cacophony, keres + { "legctl", "legvcarry", "leganavaltorpturret", "legdtr" }, -- coastal torp launcher, mantis, offshore torp launcher, dragon tail }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl9 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legmrv", }, -- decurion, belcher, phalanx, quickshot - { "legvflak", "legmed", "legmg", "legkeres", }, -- aa vehicle, medusa, cacophony, keres - { "legctl", "legvcarry", "leganavaltorpturret", "legeshotgunmech", }, -- coastal torp launcher, mantis, offshore torp launcher, praetorian + { "legaheattank", "leginf", "legshot", "legmrv" }, -- decurion, belcher, phalanx, quickshot + { "legvflak", "legmed", "legmg", "legkeres" }, -- aa vehicle, medusa, cacophony, keres + { "legctl", "legvcarry", "leganavaltorpturret", "legeshotgunmech" }, -- coastal torp launcher, mantis, offshore torp launcher, praetorian }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, legcomlvl10 = { { - { "legmoho", "legfus", "legwin", "legadvsol", }, -- adv mex, fusion, wind, adv. solar - { "legadveconv", "leggeo", "", "legtide", }, -- adv metalmaker, adv geo, empty, tidal generator - { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv", },-- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legwin", "legadvsol" }, -- adv mex, fusion, wind, adv. solar + { "legadveconv", "leggeo", "", "legtide" }, -- adv metalmaker, adv geo, empty, tidal generator + { "legadvestore", "legamstor", "leganavalmex", "leganavaleconv" }, -- hardened energy storage, hardened metal storage, }, { - { "legaheattank", "leginf", "legshot", "legmrv", }, -- decurion, belcher, phalanx, quickshot - { "legvflak", "legmed", "legmg", "legkeres", }, -- aa vehicle, medusa, cacophony, keres - { "legctl", "legvcarry", "leganavaltorpturret", "legeshotgunmech", }, -- coastal torp launcher, mantis, offshore torp launcher, praetorian + { "legaheattank", "leginf", "legshot", "legmrv" }, -- decurion, belcher, phalanx, quickshot + { "legvflak", "legmed", "legmg", "legkeres" }, -- aa vehicle, medusa, cacophony, keres + { "legctl", "legvcarry", "leganavaltorpturret", "legeshotgunmech" }, -- coastal torp launcher, mantis, offshore torp launcher, praetorian }, { - { "legavrad", "legeyes", "legforti", "legavjam", }, -- radar bot, perimeter camera, t2 wall, jammer bot - { "legfrad", "legfdrag", "legdrag", ""}, -- floating radar, sharks teeth, dragons teeth, - { "legjuno", "legarad", "legstronghold"}, -- juno, radar, t2 transport + { "legavrad", "legeyes", "legforti", "legavjam" }, -- radar bot, perimeter camera, t2 wall, jammer bot + { "legfrad", "legfdrag", "legdrag", "" }, -- floating radar, sharks teeth, dragons teeth, + { "legjuno", "legarad", "legstronghold" }, -- juno, radar, t2 transport }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "leginfestor", "legnanotcplat",}, -- nano, infestor, floating nano - { "leghp", "legfhp", }, -- hover lab, floating hover lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "leginfestor", "legnanotcplat" }, -- nano, infestor, floating nano + { "leghp", "legfhp" }, -- hover lab, floating hover lab + }, }, -- T1 bot con armck = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", }, -- basic AA, ferret, chainsaw - { "armdl", "armguard", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir" }, -- basic AA, ferret, chainsaw + { "armdl", "armguard" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + {}, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armalab", }, -- nano, T2 lab - { "armhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armalab" }, -- nano, T2 lab + { "armhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, corck = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + {}, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coralab", }, -- nano, T2 lab - { "corhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coralab" }, -- nano, T2 lab + { "corhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, - legck = { + legck = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "leglupara", }, -- basic AA, SAM, eradicator - { "legctl", "legcluster", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "leglupara" }, -- basic AA, SAM, eradicator + { "legctl", "legcluster" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legalab", }, -- nano, T2 lab - { "leghp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legalab" }, -- nano, T2 lab + { "leghp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, -- T1 vehicle con armcv = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", }, -- basic AA, ferret, chainsaw - { "armdl", "armguard", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir" }, -- basic AA, ferret, chainsaw + { "armdl", "armguard" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + {}, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", }, -- nano, T2 lab - { "armhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp" }, -- nano, T2 lab + { "armhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, corcv = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + {}, + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp", }, -- nano, T2 lab - { "corhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp" }, -- nano, T2 lab + { "corhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, - legcv = { + legcv = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "leglupara", }, -- basic AA, SAM, eradicator - { "legctl", "legcluster", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "leglupara" }, -- basic AA, SAM, eradicator + { "legctl", "legcluster" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "coralab", }, -- nano, T2 lab - { "leghp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "coralab" }, -- nano, T2 lab + { "leghp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, -- T1 air con armca = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", }, -- basic AA, ferret, chainsaw - { "armdl", "armguard", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir" }, -- basic AA, ferret, chainsaw + { "armdl", "armguard" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "armjuno", } -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armaap", }, -- nano, T2 lab - { "armhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armaap" }, -- nano, T2 lab + { "armhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, corca = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "corjuno", } -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coraap", }, -- nano, T2 lab - { "corhp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coraap" }, -- nano, T2 lab + { "corhp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, - legca = { + legca = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "leglupara", }, -- basic AA, SAM, eradicator - { "legctl", "legcluster", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "leglupara" }, -- basic AA, SAM, eradicator + { "legctl", "legcluster" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legaap", }, -- nano, T2 lab - { "leghp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legaap" }, -- nano, T2 lab + { "leghp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, -- T1 sea con armcs = { { - { "armmex", "armtide", }, -- mex, tidal - { "armfmkr", "armgeo", }, -- floating T1 converter, geo - { "armuwes", "armuwms", }, -- uw e stor, uw m stor + { "armmex", "armtide" }, -- mex, tidal + { "armfmkr", "armgeo" }, -- floating T1 converter, geo + { "armuwes", "armuwms" }, -- uw e stor, uw m stor }, { - { "armtl", "armfhlt", "armnavaldefturret", "armclaw", }, -- offshore torp launcher, floating HLT - { "armfrt", }, -- floating AA - { "armdl", "armguard", }, -- coastal torp launcher, guardian, lightning turret + { "armtl", "armfhlt", "armnavaldefturret", "armclaw" }, -- offshore torp launcher, floating HLT + { "armfrt" }, -- floating AA + { "armdl", "armguard" }, -- coastal torp launcher, guardian, lightning turret }, { - { "armfrad", "armeyes","armfdrag", }, -- floating radar, perimeter camera, shark's teeth - { "", "armdrag", "", ""}, -- dragon's teeth + { "armfrad", "armeyes", "armfdrag" }, -- floating radar, perimeter camera, shark's teeth + { "", "armdrag", "", "" }, -- dragon's teeth }, { - { "armsy", "armvp", "armap", "armlab", }, -- shipyard, veh lab, air lab, bot lab - { "armnanotcplat", "armasy", }, -- floating nano, T2 shipyard - { "armfhp", "", "armamsub", "armplat", }, -- floating hover lab, amphibious lab, seaplane lab - } + { "armsy", "armvp", "armap", "armlab" }, -- shipyard, veh lab, air lab, bot lab + { "armnanotcplat", "armasy" }, -- floating nano, T2 shipyard + { "armfhp", "", "armamsub", "armplat" }, -- floating hover lab, amphibious lab, seaplane lab + }, }, corcs = { { - { "cormex", "cortide", }, -- mex, tidal - { "corfmkr", "corgeo", }, -- floating T1 converter, geo - { "coruwes", "coruwms", }, -- uw e stor, uw m stor + { "cormex", "cortide" }, -- mex, tidal + { "corfmkr", "corgeo" }, -- floating T1 converter, geo + { "coruwes", "coruwms" }, -- uw e stor, uw m stor }, { - { "cortl", "corfhlt", "cornavaldefturret", "cormaw" }, -- offshore torp launcher, floating HLT - { "corfrt", }, -- floating AA - { "cordl", "corpun", }, -- coastal torp launcher, punisher, flame turret + { "cortl", "corfhlt", "cornavaldefturret", "cormaw" }, -- offshore torp launcher, floating HLT + { "corfrt" }, -- floating AA + { "cordl", "corpun" }, -- coastal torp launcher, punisher, flame turret }, { - { "corfrad", "coreyes", "corfdrag", }, -- floating radar, perimeter camera, shark's teeth - { "", "cordrag", "", "" }, -- dragon's teeth + { "corfrad", "coreyes", "corfdrag" }, -- floating radar, perimeter camera, shark's teeth + { "", "cordrag", "", "" }, -- dragon's teeth }, { - { "corsy", "corvp", "corap", "corlab", }, -- shipyard, vehicle lab, air lab, bot lab - { "cornanotcplat", "corasy", }, -- floating nano, T2 shipyard - { "corfhp", "", "coramsub", "corplat", }, -- floating hover, amphibious lab, seaplane lab - } + { "corsy", "corvp", "corap", "corlab" }, -- shipyard, vehicle lab, air lab, bot lab + { "cornanotcplat", "corasy" }, -- floating nano, T2 shipyard + { "corfhp", "", "coramsub", "corplat" }, -- floating hover, amphibious lab, seaplane lab + }, }, legnavyconship = { { - { "legmex", "legtide","" }, -- mex, tidal - { "legfeconv", "leggeo", "legmext15", }, -- floating T1 converter, geo , t1.5 mex - { "leguwestore", "leguwmstore", }, -- uw e stor, uw m stor + { "legmex", "legtide", "" }, -- mex, tidal + { "legfeconv", "leggeo", "legmext15" }, -- floating T1 converter, geo , t1.5 mex + { "leguwestore", "leguwmstore" }, -- uw e stor, uw m stor }, { - { "legtl", "legfmg", "legnavaldefturret", "legdtr" }, -- offshore torp launcher, floating HLT - { "legfrl", "legfhive", "", ""}, -- floating AA - { "legctl", "legcluster", "", ""}, -- coastal torp launcher, punisher, flame turret + { "legtl", "legfmg", "legnavaldefturret", "legdtr" }, -- offshore torp launcher, floating HLT + { "legfrl", "legfhive", "", "" }, -- floating AA + { "legctl", "legcluster", "", "" }, -- coastal torp launcher, punisher, flame turret }, { - { "legfrad", "legeyes", "legfdrag", }, -- floating radar, perimeter camera, shark's teeth - { "", "legdrag", "", "" }, -- dragon's teeth + { "legfrad", "legeyes", "legfdrag" }, -- floating radar, perimeter camera, shark's teeth + { "", "legdrag", "", "" }, -- dragon's teeth }, { - { "legsy", "legvp", "legap", "leglab", }, -- shipyard, vehicle lab, air lab, bot lab - { "legnanotcplat", "legadvshipyard", }, -- floating nano, T2 shipyard - { "legfhp", "", "legamphlab", "legsplab", }, -- floating hover, amphibious lab, seaplane lab - } + { "legsy", "legvp", "legap", "leglab" }, -- shipyard, vehicle lab, air lab, bot lab + { "legnanotcplat", "legadvshipyard" }, -- floating nano, T2 shipyard + { "legfhp", "", "legamphlab", "legsplab" }, -- floating hover, amphibious lab, seaplane lab + }, }, -- Hover cons armch = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armtide", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armtide" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armguard", "armtl", "armfhlt", }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT - { "armnavaldefturret", "", "", "", }, + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armguard", "armtl", "armfhlt" }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT + { "armnavaldefturret", "", "", "" }, }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", "armnanotcplat", "armasy", }, -- nano, T2 veh lab, floating nano, T2 shipyard - { "armhp", "armfhp", "armamsub", "armplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp", "armnanotcplat", "armasy" }, -- nano, T2 veh lab, floating nano, T2 shipyard + { "armhp", "armfhp", "armamsub", "armplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, corch = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", "cortide", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp", "cortide" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "cortl", "corfhlt", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT - { "cornavaldefturret", "", "", "", }, + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun", "cortl", "corfhlt" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "cornavaldefturret", "", "", "" }, }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp", "cornanotcplat", "corasy", }, -- nano, T2 veh lab, floating nano, T2 shipyard - { "corhp", "corfhp", "coramsub", "corplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp", "cornanotcplat", "corasy" }, -- nano, T2 veh lab, floating nano, T2 shipyard + { "corhp", "corfhp", "coramsub", "corplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab }, }, legch = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", "legtide", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15", "legtide" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, rhapsis, t1.5 flak, floating AA - { "legctl", "legcluster", "legtl", "legfmg", }, -- coastal torp launcher, amputator, offshore torp launcher, floating HLT - { "legnavaldefturret", "", "", "", }, + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, rhapsis, t1.5 flak, floating AA + { "legctl", "legcluster", "legtl", "legfmg" }, -- coastal torp launcher, amputator, offshore torp launcher, floating HLT + { "legnavaldefturret", "", "", "" }, }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legavp", "legnanotcplat", "legadvshipyard", }, -- nano, T2 veh lab, floating nano - { "leghp", "legfhp", "legamphlab", "legsplab", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legavp", "legnanotcplat", "legadvshipyard" }, -- nano, T2 veh lab, floating nano + { "leghp", "legfhp", "legamphlab", "legsplab" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, -- Seaplane cons armcsa = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armtide", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armtide" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armguard", "armtl", "armfhlt", }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT - { "armnavaldefturret", "", "", "", }, + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armguard", "armtl", "armfhlt" }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT + { "armnavaldefturret", "", "", "" }, }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armfrad", "armfdrag", "", "" }, -- floating radar, shark's teeth - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armfrad", "armfdrag", "", "" }, -- floating radar, shark's teeth + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armnanotcplat", "armaap"}, -- nano, floating nano - { "armhp", "armfhp", "armamsub", "armplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armnanotcplat", "armaap" }, -- nano, floating nano + { "armhp", "armfhp", "armamsub", "armplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, corcsa = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", "cortide", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp", "cortide" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "cortl", "corfhlt", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT - { "cornavaldefturret", "", "", "", }, + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun", "cortl", "corfhlt" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "cornavaldefturret", "", "", "" }, }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corfrad", "corfdrag", "", "" }, -- floating radar, shark's teeth - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corfrad", "corfdrag", "", "" }, -- floating radar, shark's teeth + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "cornanotcplat", "coraap"}, -- nano, floating nano - { "corhp", "corfhp", "coramsub", "corplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "cornanotcplat", "coraap" }, -- nano, floating nano + { "corhp", "corfhp", "coramsub", "corplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, - legspcon = { + legspcon = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", "legtide", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15", "legtide" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "legdtr", }, -- LLT, machine gun, HLT, flame turret - { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, SAM, eradicator, floating AA - { "legctl", "legcluster", "legtl", "legfmg", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT - { "legnavaldefturret", "legfhive", "", "", }, + { "leglht", "legmg", "corhlt", "legdtr" }, -- LLT, machine gun, HLT, flame turret + { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, SAM, eradicator, floating AA + { "legctl", "legcluster", "legtl", "legfmg" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "legnavaldefturret", "legfhive", "", "" }, }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legnanotcplat", "legaap", }, -- nano, T2 veh lab, floating nano - { "leghp", "legfhp", "legamphlab", "legsplab", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legnanotcplat", "legaap" }, -- nano, T2 veh lab, floating nano + { "leghp", "legfhp", "legamphlab", "legsplab" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, -- Amphibious vehicle cons armbeaver = { { - { "armmex", "armsolar", "armwin", "armadvsol", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armtide", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armadvsol" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armtide" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "armcir", "armfrt",}, -- basic AA, ferret, chainsaw, floating AA - { "armdl", "armguard", "armtl", "armfhlt", }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT - { "armnavaldefturret", "", "", "", }, + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "armcir", "armfrt" }, -- basic AA, ferret, chainsaw, floating AA + { "armdl", "armguard", "armtl", "armfhlt" }, -- coastal torp launcher, guardian, offshore torp launcher, floating HLT + { "armnavaldefturret", "", "", "" }, }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armfrad", "armfdrag", }, -- floating radar, shark's teeth - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armfrad", "armfdrag" }, -- floating radar, shark's teeth + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", "armnanotcplat", }, -- nano, T2 veh lab, floating nano - { "armhp", "armfhp", "armamsub", "armplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp", "armnanotcplat" }, -- nano, T2 veh lab, floating nano + { "armhp", "armfhp", "armamsub", "armplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, cormuskrat = { { - { "cormex", "corsolar", "corwin", "coradvsol", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", "cortide", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "coradvsol" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp", "cortide" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "cortl", "corfhlt", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT - { "cornavaldefturret", "", "", "", }, + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "corerad" }, -- basic AA, SAM, eradicator + { "cordl", "corpun", "cortl", "corfhlt" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "cornavaldefturret", "", "", "" }, }, { - { "corrad", "coreyes", "cordrag", "corjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { "corjuno", }, -- juno + { "corrad", "coreyes", "cordrag", "corjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corfrad", "corfdrag" }, -- floating radar, shark's teeth + { "corjuno" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp", "cornanotcplat", }, -- nano, T2 veh lab, floating nano - { "corhp", "corfhp", "coramsub", "corplat", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp", "cornanotcplat" }, -- nano, T2 veh lab, floating nano + { "corhp", "corfhp", "coramsub", "corplat" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, - legotter = { + legotter = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", "legtide", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15", "legtide" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "legdtr", }, -- LLT, machine gun, HLT, flame turret - { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, SAM, eradicator, floating AA - { "legctl", "legcluster", "legtl", "legfmg", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT - { "legnavaldefturret", "", "", "", }, + { "leglht", "legmg", "corhlt", "legdtr" }, -- LLT, machine gun, HLT, flame turret + { "legrl", "legrhapsis", "leglupara", "legfrl" }, -- basic AA, SAM, eradicator, floating AA + { "legctl", "legcluster", "legtl", "legfmg" }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "legnavaldefturret", "", "", "" }, }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "legfrad", "legfdrag", }, -- floating radar, shark's teeth - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "legfrad", "legfdrag" }, -- floating radar, shark's teeth + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legavp", "legnanotcplat", }, -- nano, T2 veh lab, floating nano - { "leghp", "legfhp", "legamphlab", "legsplab", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legavp", "legnanotcplat" }, -- nano, T2 veh lab, floating nano + { "leghp", "legfhp", "legamphlab", "legsplab" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, --T2 bot cons armack = { { - { "armmoho", "armfus", "armafus", "armgmm", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "armgmm" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armvulc", "armsilo", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armvulc", "armsilo" }, -- LRPC, ICBM, lolcannon }, { - { "armarad", "armtarg", "armfort", "armveil" }, -- adv radar, targeting facility, wall, adv jammer - { "armsd", "armdf", "" }, -- intrusion counter, decoy fusion, - { "armgate", }, -- shield + { "armarad", "armtarg", "armfort", "armveil" }, -- adv radar, targeting facility, wall, adv jammer + { "armsd", "armdf", "" }, -- intrusion counter, decoy fusion, + { "armgate" }, -- shield }, { - { "armlab", }, -- T1 lab, - { "armshltx", "armalab", }, -- T3 lab, T2 lab - { }, -- - } + { "armlab" }, -- T1 lab, + { "armshltx", "armalab" }, -- T3 lab, T2 lab + {}, -- + }, }, corack = { { - { "cormoho", "corfus", "corafus", }, -- moho, fusion, afus - { "cormmkr", "corageo", "cormexp", }, -- T2 converter, T2 geo, armed moho - { "coruwadves", "coruwadvms", }, -- hardened energy storage, hardened metal storage, + { "cormoho", "corfus", "corafus" }, -- moho, fusion, afus + { "cormmkr", "corageo", "cormexp" }, -- T2 converter, T2 geo, armed moho + { "coruwadves", "coruwadvms" }, -- hardened energy storage, hardened metal storage, }, { - { "corvipe", "cordoom", "cortoast", "cortron", }, -- pop-up gauss, DDM, pop-up artillery, tac nuke - { "corflak", "corscreamer", "corfmd", "corbhmth", }, -- flak, long-range AA, anti-nuke, cerberus - { "corint", "corbuzz", "corsilo", }, -- LRPC, ICBM, lolcannon + { "corvipe", "cordoom", "cortoast", "cortron" }, -- pop-up gauss, DDM, pop-up artillery, tac nuke + { "corflak", "corscreamer", "corfmd", "corbhmth" }, -- flak, long-range AA, anti-nuke, cerberus + { "corint", "corbuzz", "corsilo" }, -- LRPC, ICBM, lolcannon }, { - { "corarad", "cortarg", "corfort", "corshroud", }, -- adv radar, targeting facility, wall, adv jammer - { "corsd", "", "" }, -- intrusion counter, - { "corgate", }, -- anti-nuke, shield + { "corarad", "cortarg", "corfort", "corshroud" }, -- adv radar, targeting facility, wall, adv jammer + { "corsd", "", "" }, -- intrusion counter, + { "corgate" }, -- anti-nuke, shield }, { - { "corlab", }, -- T1 lab, - { "corgant", "coralab", }, -- T3 lab, T2 lab - { }, -- - } + { "corlab" }, -- T1 lab, + { "corgant", "coralab" }, -- T3 lab, T2 lab + {}, -- + }, }, legack = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon", }, -- T2 converter, T2 geo, nano mex, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon" }, -- T2 converter, T2 geo, nano mex, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "legrampart", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "legrampart" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "leglab", }, -- T1 lab, - { "leggant", "legalab", }, -- T3 lab, T2 lab - { }, -- seaplane lab (aircon only) - } + { "leglab" }, -- T1 lab, + { "leggant", "legalab" }, -- T3 lab, T2 lab + {}, -- seaplane lab (aircon only) + }, }, --T2 vehicle cons armacv = { { - { "armmoho", "armfus", "armafus", "armgmm", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "armgmm" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armvulc", "armsilo", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armvulc", "armsilo" }, -- LRPC, ICBM, lolcannon }, { - { "armarad", "armtarg", "armfort", "armveil", }, -- adv radar, targeting facility, wall, adv jammer - { "armsd", "armdf", "" }, -- intrusion counter, decoy fusion, - { "armgate", }, -- shield + { "armarad", "armtarg", "armfort", "armveil" }, -- adv radar, targeting facility, wall, adv jammer + { "armsd", "armdf", "" }, -- intrusion counter, decoy fusion, + { "armgate" }, -- shield }, { - { "armvp", }, -- T1 lab, - { "armshltx", "armavp", }, -- T3 lab, T2 lab - { }, -- - } + { "armvp" }, -- T1 lab, + { "armshltx", "armavp" }, -- T3 lab, T2 lab + {}, -- + }, }, coracv = { { - { "cormoho", "corfus", "corafus", }, -- moho, fusion, afus - { "cormmkr", "corageo", "cormexp", }, -- T2 converter, T2 geo, armed moho - { "coruwadves", "coruwadvms", }, -- hardened energy storage, hardened metal storage, + { "cormoho", "corfus", "corafus" }, -- moho, fusion, afus + { "cormmkr", "corageo", "cormexp" }, -- T2 converter, T2 geo, armed moho + { "coruwadves", "coruwadvms" }, -- hardened energy storage, hardened metal storage, }, { - { "corvipe", "cordoom", "cortoast", "cortron", }, -- pop-up gauss, DDM, pop-up artillery, tac nuke - { "corflak", "corscreamer", "corfmd", "corbhmth", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "corbuzz", "corsilo", }, -- LRPC, ICBM, lolcannon + { "corvipe", "cordoom", "cortoast", "cortron" }, -- pop-up gauss, DDM, pop-up artillery, tac nuke + { "corflak", "corscreamer", "corfmd", "corbhmth" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "corbuzz", "corsilo" }, -- LRPC, ICBM, lolcannon }, { - { "corarad", "cortarg", "corfort", "corshroud", }, -- adv radar, targeting facility, wall, adv jammer - { "corsd", "", "" }, -- intrusion counter, - { "corgate", }, -- anti-nuke, shield + { "corarad", "cortarg", "corfort", "corshroud" }, -- adv radar, targeting facility, wall, adv jammer + { "corsd", "", "" }, -- intrusion counter, + { "corgate" }, -- anti-nuke, shield }, { - { "corvp", }, -- T1 lab, - { "corgant", "coravp", }, -- T3 lab, T2 lab - { }, -- - } + { "corvp" }, -- T1 lab, + { "corgant", "coravp" }, -- T3 lab, T2 lab + {}, -- + }, }, legacv = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon", }, -- T2 converter, T2 geo, nano mex, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon" }, -- T2 converter, T2 geo, nano mex, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "legrampart", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "legrampart" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "legvp", }, -- T1 lab, - { "leggant", "legavp", }, -- T3 lab, T2 lab - { }, -- seaplane lab (aircon only) - } + { "legvp" }, -- T1 lab, + { "leggant", "legavp" }, -- T3 lab, T2 lab + {}, -- seaplane lab (aircon only) + }, }, --T2 air cons armaca = { { - { "armmoho", "armfus", "armafus", "armgmm", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "armgmm" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "armckfus", "armshockwave" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armsilo", "armvulc", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armsilo", "armvulc" }, -- LRPC, ICBM, lolcannon }, { - { "armarad", "armtarg", "armfort", "armveil", }, -- adv radar, targeting facility, wall, adv jammer - { "armsd", "armdf", "", "" }, -- intrusion counter, decoy fusion, - { "armgate", }, -- shield + { "armarad", "armtarg", "armfort", "armveil" }, -- adv radar, targeting facility, wall, adv jammer + { "armsd", "armdf", "", "" }, -- intrusion counter, decoy fusion, + { "armgate" }, -- shield }, { - { "armap", }, -- T1 lab, - { "armshltx", "armaap", }, -- T3 lab, T2 lab - { "armplat", }, -- seaplane lab (aircon only) -- - } + { "armap" }, -- T1 lab, + { "armshltx", "armaap" }, -- T3 lab, T2 lab + { "armplat" }, -- seaplane lab (aircon only) -- + }, }, coraca = { { - { "cormoho", "corfus", "corafus", }, -- moho, fusion, afus - { "cormmkr", "corageo", "cormexp","coruwageo", }, -- T2 converter, T2 geo, armed moho - { "coruwadves", "coruwadvms", }, -- hardened energy storage, hardened metal storage, + { "cormoho", "corfus", "corafus" }, -- moho, fusion, afus + { "cormmkr", "corageo", "cormexp", "coruwageo" }, -- T2 converter, T2 geo, armed moho + { "coruwadves", "coruwadvms" }, -- hardened energy storage, hardened metal storage, }, { - { "corvipe", "cordoom", "cortoast", "cortron" }, -- pop-up gauss, DDM, pop-up artillery, tac nuke + { "corvipe", "cordoom", "cortoast", "cortron" }, -- pop-up gauss, DDM, pop-up artillery, tac nuke { "corflak", "corscreamer", "corfmd", "corbhmth" }, -- flak, long-range AA, anti-nuke, cerberus - { "corint", "corbuzz", "corsilo" }, -- LRPC, ICBM, lolcannon + { "corint", "corbuzz", "corsilo" }, -- LRPC, ICBM, lolcannon }, { - { "corarad", "cortarg", "corfort", "corshroud" }, -- adv radar, targeting facility, wall, adv jammer - { "corsd", "", "", "" }, -- intrusion counter, - { "corgate", }, -- anti-nuke, shield + { "corarad", "cortarg", "corfort", "corshroud" }, -- adv radar, targeting facility, wall, adv jammer + { "corsd", "", "", "" }, -- intrusion counter, + { "corgate" }, -- anti-nuke, shield }, { - { "corap", }, -- T1 lab, - { "corgant", "coraap", }, -- T3 lab, T2 lab - { "corplat", }, -- seaplane lab (aircon only) - } + { "corap" }, -- T1 lab, + { "corgant", "coraap" }, -- T3 lab, T2 lab + { "corplat" }, -- seaplane lab (aircon only) + }, }, legaca = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon","leganavaladvgeo", }, -- T2 converter, T2 geo, nano mex, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon", "leganavaladvgeo" }, -- T2 converter, T2 geo, nano mex, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "legrampart", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "legrampart" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "legap", }, -- T1 lab, - { "leggant", "legaap", }, -- T3 lab, T2 lab - { "legsplab", }, -- seaplane lab (aircon only) - } + { "legap" }, -- T1 lab, + { "leggant", "legaap" }, -- T3 lab, T2 lab + { "legsplab" }, -- seaplane lab (aircon only) + }, }, --T2 sub cons armacsub = { { - { "armuwmme", "armuwfus", }, -- uw moho, uw fusion, - { "armuwmmm", "armuwageo" }, -- floating T2 converter, adv geo powerplant - { "armuwadves", "armuwadvms", }, -- uw e stor, uw metal stor + { "armuwmme", "armuwfus" }, -- uw moho, uw fusion, + { "armuwmmm", "armuwageo" }, -- floating T2 converter, adv geo powerplant + { "armuwadves", "armuwadvms" }, -- uw e stor, uw metal stor }, { - { "armatl", "armkraken", "armanavaldefturret" }, -- adv torp launcher, floating heavy platform - { "armfflak", }, -- floating flak - { }, -- + { "armatl", "armkraken", "armanavaldefturret" }, -- adv torp launcher, floating heavy platform + { "armfflak" }, -- floating flak + {}, -- }, { - { "armason", "armfatf" }, -- adv sonar, floating targeting facility - { "", "", "", "" }, -- - { }, -- + { "armason", "armfatf" }, -- adv sonar, floating targeting facility + { "", "", "", "" }, -- + {}, -- }, { - { "armsy", }, -- T1 shipyard - { "armshltxuw", "armasy", }, -- amphibious gantry, T2 shipyard - { }, -- - } + { "armsy" }, -- T1 shipyard + { "armshltxuw", "armasy" }, -- amphibious gantry, T2 shipyard + {}, -- + }, }, coracsub = { { - { "coruwmme", "coruwfus", }, -- uw moho, uw fusion, - { "coruwmmm", "coruwageo" }, -- floating T2 converter, adv geo powerplant - { "coruwadves", "coruwadvms", }, -- uw e stor, uw metal stor + { "coruwmme", "coruwfus" }, -- uw moho, uw fusion, + { "coruwmmm", "coruwageo" }, -- floating T2 converter, adv geo powerplant + { "coruwadves", "coruwadvms" }, -- uw e stor, uw metal stor }, { - { "coratl", "corfdoom","coranavaldefturret", }, -- adv torp launcher, floating heavy platform - { "corenaa", }, -- floating flak - { }, -- + { "coratl", "corfdoom", "coranavaldefturret" }, -- adv torp launcher, floating heavy platform + { "corenaa" }, -- floating flak + {}, -- }, { - { "corason", "corfatf", }, -- adv sonar, floating targeting facility - { "", "", "", "" }, -- + { "corason", "corfatf" }, -- adv sonar, floating targeting facility + { "", "", "", "" }, -- }, { - { "corsy", }, -- T1 shipyard - { "corgantuw", "corasy" }, -- amphibious gantry, T2 shipyard - { }, -- - } + { "corsy" }, -- T1 shipyard + { "corgantuw", "corasy" }, -- amphibious gantry, T2 shipyard + {}, -- + }, }, leganavyconsub = { { - { "leganavalmex", "leganavalfusion", }, -- uw moho, uw fusion, - { "leganavaleconv", "leganavaladvgeo" }, -- floating T2 converter, adv geo powerplant - { "legadvestore", "legamstor", }, -- uw e stor, uw metal stor + { "leganavalmex", "leganavalfusion" }, -- uw moho, uw fusion, + { "leganavaleconv", "leganavaladvgeo" }, -- floating T2 converter, adv geo powerplant + { "legadvestore", "legamstor" }, -- uw e stor, uw metal stor }, { - { "leganavaltorpturret", "leganavaldefturret", }, -- adv torp launcher, floating heavy platform - { "leganavalaaturret", }, -- floating flak - { }, -- + { "leganavaltorpturret", "leganavaldefturret" }, -- adv torp launcher, floating heavy platform + { "leganavalaaturret" }, -- floating flak + {}, -- }, { - { "leganavalsonarstation", "leganavalpinpointer", }, -- adv sonar, floating targeting facility - { "", "", "", "" }, -- + { "leganavalsonarstation", "leganavalpinpointer" }, -- adv sonar, floating targeting facility + { "", "", "", "" }, -- }, { - { "legsy", }, -- T1 shipyard - { "leggantuw", "legadvshipyard" }, -- amphibious gantry, T2 shipyard - { }, -- - } + { "legsy" }, -- T1 shipyard + { "leggantuw", "legadvshipyard" }, -- amphibious gantry, T2 shipyard + {}, -- + }, }, -- Split tier cons armhaca = { { - { "armmoho", "armfus", "armafus", "", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armsilo", "armvulc", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armsilo", "armvulc" }, -- LRPC, ICBM, lolcannon }, { - { "armtarg", "armdf", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer - { "armveil", "", "armasp" }, -- intrusion counter, decoy fusion, air repair pad - { "armgate", }, -- shield + { "armtarg", "armdf", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer + { "armveil", "", "armasp" }, -- intrusion counter, decoy fusion, air repair pad + { "armgate" }, -- shield }, { - { "armlab", "armvp", "armap", "armsy", }, -- T1 lab, - { "armhaap", "armaap", }, -- T3 lab, T2 lab - { }, -- - } + { "armlab", "armvp", "armap", "armsy" }, -- T1 lab, + { "armhaap", "armaap" }, -- T3 lab, T2 lab + {}, -- + }, }, corhaca = { { - {"cormoho","corfus","corafus","",}, - {"cormmkr","corageo","cormexp","corbhmth",}, - {"coruwadves","coruwadvms","","",}, + { "cormoho", "corfus", "corafus", "" }, + { "cormmkr", "corageo", "cormexp", "corbhmth" }, + { "coruwadves", "coruwadvms", "", "" }, }, { - {"corvipe","cordoom","cortoast","cortron",}, - {"corflak","corscreamer","corfmd","",}, - {"corint","corsilo","corbuzz","",}, + { "corvipe", "cordoom", "cortoast", "cortron" }, + { "corflak", "corscreamer", "corfmd", "" }, + { "corint", "corsilo", "corbuzz", "" }, }, { - {"cortarg","corsd","corfort","",}, - {"","","","",}, - {"corgate","","","",}, + { "cortarg", "corsd", "corfort", "" }, + { "", "", "", "" }, + { "corgate", "", "", "" }, }, { - {"corlab", "corvp", "corap", "corsy", }, - {"cornanotc", "coraap", "", "", }, - {"", "corhaap", "", "", }, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coraap", "", "" }, + { "", "corhaap", "", "" }, }, }, leghaca = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon", "legrampart"}, -- T2 converter, T2 geo, nano max, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon", "legrampart" }, -- T2 converter, T2 geo, nano max, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, - { "legnanotc", "legaap", "leggant" }, -- T3 lab, T2 lab - { "", "leghaap", "", "" }, -- seaplane lab (aircon only) - } + { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, + { "legnanotc", "legaap", "leggant" }, -- T3 lab, T2 lab + { "", "leghaap", "", "" }, -- seaplane lab (aircon only) + }, }, - + armhack = { { - { "armmoho", "armfus", "armafus", "", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armsilo", "armvulc", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armsilo", "armvulc" }, -- LRPC, ICBM, lolcannon }, { - { "armtarg", "armsd", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer - { "", "armdf", "" }, -- intrusion counter, decoy fusion, air repair pad - { "armgate", }, -- shield + { "armtarg", "armsd", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer + { "", "armdf", "" }, -- intrusion counter, decoy fusion, air repair pad + { "armgate" }, -- shield }, { - { "armlab", "armvp", "armap", "armsy", }, -- T1 lab, - { "armnanotc", "armalab", "", "",}, -- T3 lab, T2 lab - { "", "armhalab", "", "" }, -- - } + { "armlab", "armvp", "armap", "armsy" }, -- T1 lab, + { "armnanotc", "armalab", "", "" }, -- T3 lab, T2 lab + { "", "armhalab", "", "" }, -- + }, }, corhack = { { - {"cormoho","corfus","corafus","",}, - {"cormmkr","corageo","cormexp","corbhmth",}, - {"coruwadves","coruwadvms","","",}, + { "cormoho", "corfus", "corafus", "" }, + { "cormmkr", "corageo", "cormexp", "corbhmth" }, + { "coruwadves", "coruwadvms", "", "" }, }, { - {"corvipe","cordoom","cortoast","cortron",}, - {"corflak","corscreamer","corfmd","",}, - {"corint","corsilo","corbuzz","",}, + { "corvipe", "cordoom", "cortoast", "cortron" }, + { "corflak", "corscreamer", "corfmd", "" }, + { "corint", "corsilo", "corbuzz", "" }, }, { - {"cortarg","corsd","corfort","",}, - {"","","","",}, - {"corgate","","","",}, + { "cortarg", "corsd", "corfort", "" }, + { "", "", "", "" }, + { "corgate", "", "", "" }, }, { - {"corlab", "corvp", "corap", "corsy", }, - {"cornanotc", "coralab", "", "", }, - {"", "corhalab", "", "", }, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coralab", "", "" }, + { "", "corhalab", "", "" }, }, }, leghack = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon", "legrampart"}, -- T2 converter, T2 geo, nano mex, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon", "legrampart" }, -- T2 converter, T2 geo, nano mex, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, - { "legnanotc", "legalab", "leggant" }, -- T3 lab, T2 lab - { "", "leghalab", "", "" }, -- seaplane lab (aircon only) - } + { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, + { "legnanotc", "legalab", "leggant" }, -- T3 lab, T2 lab + { "", "leghalab", "", "" }, -- seaplane lab (aircon only) + }, }, armhacv = { { - { "armmoho", "armfus", "armafus", "", }, -- moho, fusion, afus, safe geo - { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion - { "armuwadves", "armuwadvms", }, -- hardened energy storage, hardened metal storage + { "armmoho", "armfus", "armafus", "" }, -- moho, fusion, afus, safe geo + { "armmmkr", "armageo", "", "" }, -- T2 converter, T2 geo, cloaked fusion + { "armuwadves", "armuwadvms" }, -- hardened energy storage, hardened metal storage }, { - { "armpb", "armanni", "armamb", "armemp", }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile - { "armflak", "armmercury", "armamd", }, -- flak, long-range AA, anti-nuke - { "armbrtha", "armsilo", "armvulc", }, -- LRPC, ICBM, lolcannon + { "armpb", "armanni", "armamb", "armemp" }, -- pop-up gauss, annihilator, pop-up artillery, EMP missile + { "armflak", "armmercury", "armamd" }, -- flak, long-range AA, anti-nuke + { "armbrtha", "armsilo", "armvulc" }, -- LRPC, ICBM, lolcannon }, { - { "armtarg", "armsd", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer - { "", "armdf", "" }, -- intrusion counter, decoy fusion, air repair pad - { "armgate", }, -- shield + { "armtarg", "armsd", "armfort", "" }, -- adv radar, targeting facility, wall, adv jammer + { "", "armdf", "" }, -- intrusion counter, decoy fusion, air repair pad + { "armgate" }, -- shield }, { - { "armlab", "armvp", "armap", "armsy", }, -- T1 lab, - { "armnanotc", "armavp", "", "",}, -- T3 lab, T2 lab - { "", "armhavp", "", "" }, -- - } + { "armlab", "armvp", "armap", "armsy" }, -- T1 lab, + { "armnanotc", "armavp", "", "" }, -- T3 lab, T2 lab + { "", "armhavp", "", "" }, -- + }, }, corhacv = { { - {"cormoho","corfus","corafus","",}, - {"cormmkr","corageo","cormexp","corbhmth",}, - {"coruwadves","coruwadvms","","",}, + { "cormoho", "corfus", "corafus", "" }, + { "cormmkr", "corageo", "cormexp", "corbhmth" }, + { "coruwadves", "coruwadvms", "", "" }, }, { - {"corvipe","cordoom","cortoast","cortron",}, - {"corflak","corscreamer","corfmd","",}, - {"corint","corsilo","corbuzz","",}, + { "corvipe", "cordoom", "cortoast", "cortron" }, + { "corflak", "corscreamer", "corfmd", "" }, + { "corint", "corsilo", "corbuzz", "" }, }, { - {"cortarg","corsd","corfort","",}, - {"","","","",}, - {"corgate","","","",}, + { "cortarg", "corsd", "corfort", "" }, + { "", "", "", "" }, + { "corgate", "", "", "" }, }, { - {"corlab", "corvp", "corap", "corsy", }, - {"cornanotc", "coravp", "", "", }, - {"", "corhavp", "", "", }, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coravp", "", "" }, + { "", "corhavp", "", "" }, }, }, leghacv = { { - { "legmoho", "legfus", "legafus", }, -- moho, fusion, afus - { "legadveconv", "legageo", "legmohocon", "legrampart"}, -- T2 converter, T2 geo, nano mex, fortified geo - { "legadvestore", "legamstor", }, -- hardened energy storage, hardened metal storage, + { "legmoho", "legfus", "legafus" }, -- moho, fusion, afus + { "legadveconv", "legageo", "legmohocon", "legrampart" }, -- T2 converter, T2 geo, nano mex, fortified geo + { "legadvestore", "legamstor" }, -- hardened energy storage, hardened metal storage, }, { - { "legapopupdef", "legbastion", "legacluster", "legperdition", }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke - { "legflak", "leglraa", "legabm", "", }, -- flak, long-range AA, anti-nuke, cerberus - { "leglrpc", "legstarfall", "legsilo", }, -- LRPC, ICBM, lolcannon + { "legapopupdef", "legbastion", "legacluster", "legperdition" }, -- pop-up gauss, heavy defence, pop-up artillery, tac nuke + { "legflak", "leglraa", "legabm", "" }, -- flak, long-range AA, anti-nuke, cerberus + { "leglrpc", "legstarfall", "legsilo" }, -- LRPC, ICBM, lolcannon }, { - { "legarad", "legtarg", "legforti", "legajam", }, -- adv radar, targeting facility, wall, adv jammer - { "legsd", "", "", }, -- intrusion counter, - { "legdeflector", }, -- anti-nuke, shield + { "legarad", "legtarg", "legforti", "legajam" }, -- adv radar, targeting facility, wall, adv jammer + { "legsd", "", "" }, -- intrusion counter, + { "legdeflector" }, -- anti-nuke, shield }, { - { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, - { "legnanotc", "legavp", "leggant" }, -- T3 lab, T2 lab - { "", "leghavp", "", "" }, -- seaplane lab (aircon only) - } + { "leglab", "legvp", "legap", "legsy" }, -- T1 lab, + { "legnanotc", "legavp", "leggant" }, -- T3 lab, T2 lab + { "", "leghavp", "", "" }, -- seaplane lab (aircon only) + }, }, armhacs = { { - {"armuwmme", "armtide", "armuwfus", "armafus",}, - {"armuwmmm","","armuwageo","",}, - {"armuwadves","armuwadvms","","",}, + { "armuwmme", "armtide", "armuwfus", "armafus" }, + { "armuwmmm", "", "armuwageo", "" }, + { "armuwadves", "armuwadvms", "", "" }, }, { - {"armkraken", "armpb", "armanni", "armanavaldefturret",}, - {"armfflak","armmercury","","",}, - {"armatl","","","",}, + { "armkraken", "armpb", "armanni", "armanavaldefturret" }, + { "armfflak", "armmercury", "", "" }, + { "armatl", "", "", "" }, }, { - {"armfatf", "", "", "", }, - {"", "", "", "", }, - {"", "", "", "", }, + { "armfatf", "", "", "" }, + { "", "", "", "" }, + { "", "", "", "" }, }, { - { "armlab", "armvp", "armap", "armsy", }, -- T1 lab, - { "armnanotcplat", "armasy", "", "",}, -- T3 lab, T2 lab - { "", "armhasy", "", "" }, -- - } + { "armlab", "armvp", "armap", "armsy" }, -- T1 lab, + { "armnanotcplat", "armasy", "", "" }, -- T3 lab, T2 lab + { "", "armhasy", "", "" }, -- + }, }, corhacs = { { - {"coruwmme", "cortide", "coruwfus", "corafus",}, - {"coruwmmm","coruwagea","corafus","",}, - {"coruwadves","coruwadvms","","",}, + { "coruwmme", "cortide", "coruwfus", "corafus" }, + { "coruwmmm", "coruwagea", "corafus", "" }, + { "coruwadves", "coruwadvms", "", "" }, }, { - {"corfdoom", "corvipe", "cordoom", "coranavaldefturret",}, - {"corenaa","corscreamer","","",}, - {"coratl","","","",}, + { "corfdoom", "corvipe", "cordoom", "coranavaldefturret" }, + { "corenaa", "corscreamer", "", "" }, + { "coratl", "", "", "" }, }, { - {"corason", "corfdrag", "corgate", "corsd", }, - {"", "", "", "", }, - {"", "", "", "", }, + { "corason", "corfdrag", "corgate", "corsd" }, + { "", "", "", "" }, + { "", "", "", "" }, }, { - {"corlab", "corvp", "corap", "corsy", }, - {"cornanotcplat", "corasy", "", "", }, - {"", "corhasy", "", "", }, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotcplat", "corasy", "", "" }, + { "", "corhasy", "", "" }, }, }, - --minelayers armmlv = { { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { "", "armeyes", "armdrag", }, -- camera, dragon's teeth - { }, -- - { "armmine1", "armmine2", "armmine3", }, -- light mine, med mine, heavy mine + { "", "armeyes", "armdrag" }, -- camera, dragon's teeth + {}, -- + { "armmine1", "armmine2", "armmine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- - { }, -- - } + {}, -- + {}, -- + {}, -- + }, }, cormlv = { { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { "", "coreyes", "cordrag", }, -- camera, dragon's teeth - { }, -- - { "cormine1", "cormine2", "cormine3", }, -- light mine, med mine, heavy mine + { "", "coreyes", "cordrag" }, -- camera, dragon's teeth + {}, -- + { "cormine1", "cormine2", "cormine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- - { }, -- - } + {}, -- + {}, -- + {}, -- + }, }, legmlv = { { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { "", "legeyes", "legdrag", }, -- camera, dragon's teeth - { }, -- - { "legmine1", "legmine2", "legmine3", }, -- light mine, med mine, heavy mine + { "", "legeyes", "legdrag" }, -- camera, dragon's teeth + {}, -- + { "legmine1", "legmine2", "legmine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- - { }, -- - } + {}, -- + {}, -- + {}, -- + }, }, --Decoy commanders armdecom = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", "", "armuwms", "armtide"}, -- T1 converter, uw ms storage, tidal - { "armestor", "armmstor", "armuwes", "armfmkr", }, -- e storage, m storage, uw e storage, floating T1 converter + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr", "", "armuwms", "armtide" }, -- T1 converter, uw ms storage, tidal + { "armestor", "armmstor", "armuwes", "armfmkr" }, -- e storage, m storage, uw e storage, floating T1 converter }, { - { "armllt", }, -- LLT - { "armrl", }, -- basic AA - { }, -- + { "armllt" }, -- LLT + { "armrl" }, -- basic AA + {}, -- }, { - { "armrad", }, -- radar - { }, -- - { "armmine1", "armmine2", "armmine3", }, -- light mine, med mine, heavy mine + { "armrad" }, -- radar + {}, -- + { "armmine1", "armmine2", "armmine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- empty row - { }, -- - } + {}, -- + {}, -- empty row + {}, -- + }, }, cordecom = { { - { "cormex", "corsolar", "corwin", }, -- mex, solar, wind - { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw ms storage, tidal - { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, uw e storage, floating T1 converter + { "cormex", "corsolar", "corwin" }, -- mex, solar, wind + { "cormakr", "", "coruwms", "cortide" }, -- T1 converter, uw ms storage, tidal + { "corestor", "cormstor", "coruwes", "corfmkr" }, -- e storage, m storage, uw e storage, floating T1 converter }, { - { "corllt", }, -- LLT - { "corrl", }, -- basic AA - { }, -- + { "corllt" }, -- LLT + { "corrl" }, -- basic AA + {}, -- }, { - { "corrad", }, -- radar - { }, -- - { "cormine1", "cormine2", "cormine3", }, -- light mine, med mine, heavy mine + { "corrad" }, -- radar + {}, -- + { "cormine1", "cormine2", "cormine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- empty row - { }, -- - } + {}, -- + {}, -- empty row + {}, -- + }, }, legdecom = { { - { "legmex", "legsolar", "legwin", }, -- mex, solar, wind - { "legeconv", "", "leguwmstore", "legtide" }, -- T1 converter, uw ms storage, tidal - { "legestor", "legmstor", "leguwestore", "legfeconv", }, -- e storage, m storage, uw e storage, floating T1 converter + { "legmex", "legsolar", "legwin" }, -- mex, solar, wind + { "legeconv", "", "leguwmstore", "legtide" }, -- T1 converter, uw ms storage, tidal + { "legestor", "legmstor", "leguwestore", "legfeconv" }, -- e storage, m storage, uw e storage, floating T1 converter }, { - { "leglht", }, -- LLT - { "legrl", }, -- basic AA - { }, -- + { "leglht" }, -- LLT + { "legrl" }, -- basic AA + {}, -- }, { - { "legrad", }, -- radar - { }, -- - { "legmine1", "legmine2", "legmine3", }, -- light mine, med mine, heavy mine + { "legrad" }, -- radar + {}, -- + { "legmine1", "legmine2", "legmine3" }, -- light mine, med mine, heavy mine }, { - { }, -- - { }, -- empty row - { }, -- - } + {}, -- + {}, -- empty row + {}, -- + }, }, --fark armfark = { { - { "armmex", "armsolar", "armwin", }, -- mex, solar, wind - { "armmakr", }, -- T1 converter - { }, -- + { "armmex", "armsolar", "armwin" }, -- mex, solar, wind + { "armmakr" }, -- T1 converter + {}, -- }, { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { "armmark", "armeyes", "armaser", }, -- radar bot, perimeter camera, jammer bot - { }, -- - { }, -- + { "armmark", "armeyes", "armaser" }, -- radar bot, perimeter camera, jammer bot + {}, -- + {}, -- }, { - { }, -- - { }, -- - { }, -- - } + {}, -- + {}, -- + {}, -- + }, }, --freaker corfast = { { - { "cormex", "corsolar", }, -- mex, solar - { }, -- solar - { }, -- + { "cormex", "corsolar" }, -- mex, solar + {}, -- solar + {}, -- }, { - { "corhllt", "corpyro", "cortoast", }, -- HLLT, pyro, toaster - { "corflak", "cormadsam", "corcrash", "corak", }, -- flak, SAM, T1 aa bot, AK - { "cordl", "corroy", "cortermite", "coramph", }, -- coastal torp launcher, destroyer, termite, gimp + { "corhllt", "corpyro", "cortoast" }, -- HLLT, pyro, toaster + { "corflak", "cormadsam", "corcrash", "corak" }, -- flak, SAM, T1 aa bot, AK + { "cordl", "corroy", "cortermite", "coramph" }, -- coastal torp launcher, destroyer, termite, gimp }, { - { "corarad", "coreyes", "corfort", "corshroud", }, -- adv radar, camera, wall, adv jammer - { }, -- - { "cormine2", }, -- med mine + { "corarad", "coreyes", "corfort", "corshroud" }, -- adv radar, camera, wall, adv jammer + {}, -- + { "cormine2" }, -- med mine }, { - { "corlab", "corck", }, -- bot lab, bot con - { "cornanotc", "corcs", }, -- nano, sea con - { "cormando", }, -- commando - } + { "corlab", "corck" }, -- bot lab, bot con + { "cornanotc", "corcs" }, -- nano, sea con + { "cormando" }, -- commando + }, }, --proteus legaceb = { { - { "legmex", "legsolar", }, -- 0.5 mex, solar - { }, -- - { }, -- + { "legmex", "legsolar" }, -- 0.5 mex, solar + {}, -- + {}, -- }, { - { "legdtr", "legstr", "legacluster", }, -- dragon's jaw, strider, t2 cluster arty - { "legflak", "", "legaabot", "leggob", }, -- Ravager Flak, intentional blank, T1 aa bot, Goblin - { "legctl", "legnavyfrigate", "", "legamph" }, -- coastal torp launcher, frigate, intentional blank, Telchine + { "legdtr", "legstr", "legacluster" }, -- dragon's jaw, strider, t2 cluster arty + { "legflak", "", "legaabot", "leggob" }, -- Ravager Flak, intentional blank, T1 aa bot, Goblin + { "legctl", "legnavyfrigate", "", "legamph" }, -- coastal torp launcher, frigate, intentional blank, Telchine }, { - { "legarad", "legeyes", "legforti", "legajam", }, -- adv radar, camera, wall, adv jammer - { }, -- - { }, -- med mine -- intentional blank + { "legarad", "legeyes", "legforti", "legajam" }, -- adv radar, camera, wall, adv jammer + {}, -- + {}, -- med mine -- intentional blank }, { - { "leglab", "legck", }, -- bot lab, bot con - { "legnanotc", "legnavyconship", }, -- nano, naval con - { }, -- - } + { "leglab", "legck" }, -- bot lab, bot con + { "legnanotc", "legnavyconship" }, -- nano, naval con + {}, -- + }, }, --aceso - legafcv = { + legafcv = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "", "legdtr", }, -- LLT, machine gun, HLT, flame turret - { "legrl", "legrhapsis", "leglupara", }, -- basic AA, SAM, eradicator - { "legctl", "legcluster", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "", "legdtr" }, -- LLT, machine gun, HLT, flame turret + { "legrl", "legrhapsis", "leglupara" }, -- basic AA, SAM, eradicator + { "legctl", "legcluster" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "coralab", }, -- nano, T2 lab - { "leghp", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "coralab" }, -- nano, T2 lab + { "leghp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, }, --consul armconsul = { { - { "armmex", "armsolar", }, -- mex, solar - { }, -- - { }, -- + { "armmex", "armsolar" }, -- mex, solar + {}, -- + {}, -- }, { - { "armbeamer", "armfast", "armamb", "armmav", }, -- beamer, sprinter, ambusher, maverick - { "armflak", "armferret", "armjeth", "armpw", }, -- flak, ferret, T1 aa bot, peewee - { "armdl", "armroy", "armspid", "armamph", }, -- coastal torp launcher, destroyer, emp spider, platypus + { "armbeamer", "armfast", "armamb", "armmav" }, -- beamer, sprinter, ambusher, maverick + { "armflak", "armferret", "armjeth", "armpw" }, -- flak, ferret, T1 aa bot, peewee + { "armdl", "armroy", "armspid", "armamph" }, -- coastal torp launcher, destroyer, emp spider, platypus }, { - { "armarad", "armeyes", "armfort", "armveil", }, -- adv radar, camera, wall, adv jammer - { }, -- - { "armmine2" }, -- med. mine + { "armarad", "armeyes", "armfort", "armveil" }, -- adv radar, camera, wall, adv jammer + {}, -- + { "armmine2" }, -- med. mine }, { - { "armcv", "armvp" }, -- T1 veh con, vehicle lab - { "armnanotc" }, -- nano - { "armcs" }, -- sea con - } + { "armcv", "armvp" }, -- T1 veh con, vehicle lab + { "armnanotc" }, -- nano + { "armcs" }, -- sea con + }, }, --commando cormando = { { - { }, -- - { }, -- - { }, -- + {}, -- + {}, -- + {}, -- }, { - { "cormaw", }, -- flame turret - { }, -- - { }, -- + { "cormaw" }, -- flame turret + {}, -- + {}, -- }, { - { "cormine2", "coreyes", "cordrag", "corjamt", }, -- commando mine, camera, dragon's teeth, jammer - { "corvalk", }, -- transport - { "corfink" }, -- scout plane + { "cormine2", "coreyes", "cordrag", "corjamt" }, -- commando mine, camera, dragon's teeth, jammer + { "corvalk" }, -- transport + { "corfink" }, -- scout plane }, { - { }, -- - { }, -- - { }, -- - } + {}, -- + {}, -- + {}, -- + }, }, --corprinter corprinter = { { - {'corsolar', 'cormex' }, - { }, - { }, -- solar, mex + { "corsolar", "cormex" }, + {}, + {}, -- solar, mex }, { - { }, - { }, - { }, + {}, + {}, + {}, }, { - { 'corrad','', 'corfort'}, - { }, - { }, --radar, t2 wall + { "corrad", "", "corfort" }, + {}, + {}, --radar, t2 wall }, { - { }, - { }, - { }, - } + {}, + {}, + {}, + }, }, --naval engineers armmls = { { - { "armmex", "armtide", }, -- mex, tidal - { }, -- - { }, -- + { "armmex", "armtide" }, -- mex, tidal + {}, -- + {}, -- }, { - { "armtl", "armkraken", "armamb", "armfhlt", }, -- torp launcher, kraken, ambusher, fHLT - { "armfflak", "armpt", "armamph", }, -- fl flak, PT boat, pelican - { "armdecade", "armroy", }, -- decade, destroyer - { "armnavaldefturret", "armanavaldefturret", "", "", }, + { "armtl", "armkraken", "armamb", "armfhlt" }, -- torp launcher, kraken, ambusher, fHLT + { "armfflak", "armpt", "armamph" }, -- fl flak, PT boat, pelican + { "armdecade", "armroy" }, -- decade, destroyer + { "armnavaldefturret", "armanavaldefturret", "", "" }, }, { - { "armfrad", "armarad", }, -- fl radar, adv radar - { }, -- - { "armfmine3", }, -- naval mine + { "armfrad", "armarad" }, -- fl radar, adv radar + {}, -- + { "armfmine3" }, -- naval mine }, { - { "armsy", "armcs", }, -- shipyard, sea con - { "armnanotcplat", }, -- fl nano - { }, -- - } + { "armsy", "armcs" }, -- shipyard, sea con + { "armnanotcplat" }, -- fl nano + {}, -- + }, }, cormls = { { - { "cormex", "cortide", }, -- mex, tidal - { }, -- - { }, -- + { "cormex", "cortide" }, -- mex, tidal + {}, -- + {}, -- }, { - { "cortl", "corfdoom", "cortoast", "corfhlt", }, -- torp launcher, fl DDM, toaster, fHLT - { "corenaa", "corpt", }, -- fl flak, searcher - { "coresupp", "corroy", }, -- supporter, destroyer - { "cornavaldefturret", "coranavaldefturret", "", "", }, + { "cortl", "corfdoom", "cortoast", "corfhlt" }, -- torp launcher, fl DDM, toaster, fHLT + { "corenaa", "corpt" }, -- fl flak, searcher + { "coresupp", "corroy" }, -- supporter, destroyer + { "cornavaldefturret", "coranavaldefturret", "", "" }, }, { - { "corfrad", "corarad", }, -- fl radar, adv radar - { }, -- - { "corfmine3", }, -- naval mine + { "corfrad", "corarad" }, -- fl radar, adv radar + {}, -- + { "corfmine3" }, -- naval mine }, { - { "corsy", "corcs", }, -- shipyard, sea con - { "cornanotcplat", }, -- fl nano - { }, -- - } + { "corsy", "corcs" }, -- shipyard, sea con + { "cornanotcplat" }, -- fl nano + {}, -- + }, }, - leganavyengineer = { { - { "legmex", "legtide", }, -- mex, tidal - { }, -- - { }, -- + { "legmex", "legtide" }, -- mex, tidal + {}, -- + {}, -- }, { - { "legtl", "leganavaldefturret", "legacluster", "corfhlt", }, -- torp launcher, fl DDM, toaster, fHLT - { "leganavalaaturret", "legnavyaaship", }, -- fl flak, searcher - { "legnavyscout", "legnavydestro", }, -- supporter, destroyer - { "legnavaldefturret", "legfhive", "", "", }, + { "legtl", "leganavaldefturret", "legacluster", "corfhlt" }, -- torp launcher, fl DDM, toaster, fHLT + { "leganavalaaturret", "legnavyaaship" }, -- fl flak, searcher + { "legnavyscout", "legnavydestro" }, -- supporter, destroyer + { "legnavaldefturret", "legfhive", "", "" }, }, { - { "legfrad", "legarad", }, -- fl radar, adv radar - { }, -- - { "corfmine3", }, -- naval mine + { "legfrad", "legarad" }, -- fl radar, adv radar + {}, -- + { "corfmine3" }, -- naval mine }, { - { "legsy", "legnavyconship", }, -- shipyard, sea con - { "legnanotcplat", }, -- fl nano - { }, -- - } + { "legsy", "legnavyconship" }, -- shipyard, sea con + { "legnanotcplat" }, -- fl nano + {}, -- + }, }, } -local priorityUnits = {"armshltx","armshltxuw","corgant","corgantuw","leggant","leggantuw","armalab", "armavp", "armasy", "armaap", "coralab", "coravp", "corasy", "coraap", "legalab", "legavp", "legadvshipyard", "legaap"} +local priorityUnits = { "armshltx", "armshltxuw", "corgant", "corgantuw", "leggant", "leggantuw", "armalab", "armavp", "armasy", "armaap", "coralab", "coravp", "corasy", "coraap", "legalab", "legavp", "legadvshipyard", "legaap" } unitGrids["dummycom"] = unitGrids["armcom"] if Spring.GetModOptions().experimentalextraunits or Spring.GetModOptions().scavunitsforplayers then - for _, builder in pairs({"armaca", "coraca", "legaca", "armack", "corack", "legack", "armacv", "coracv", "legacv"}) do + for _, builder in pairs({ "armaca", "coraca", "legaca", "armack", "corack", "legack", "armacv", "coracv", "legacv" }) do local faction = builder:sub(1, 3) - unitGrids[builder][1][3][3] = faction .. "wint2" + unitGrids[builder][1][3][3] = faction .. "wint2" unitGrids[builder][4][1][2] = faction .. "apt3" unitGrids[builder][4][1][3] = faction .. "nanotct2" end unitGrids["armacsub"][4][1][3] = "armnanotc2plat" unitGrids["coracsub"][4][1][3] = "cornanotc2plat" - end if Spring.Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallunits then @@ -2543,7 +2961,7 @@ if Spring.Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallun for unitName, content in pairs(labGrids) do local scavContent = {} if #content > 0 then - for i = 1,#content do + for i = 1, #content do if content[i] and content[i] ~= "" then scavContent[i] = content[i] .. "_scav" end @@ -2555,13 +2973,13 @@ if Spring.Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallun for unitName, content in pairs(unitGrids) do local scavContent = {} if content and #content > 0 then - for i = 1,#content do + for i = 1, #content do if content[i] and #content[i] > 0 then scavContent[i] = {} - for j = 1,#content[i] do + for j = 1, #content[i] do if content[i][j] and #content[i][j] > 0 then scavContent[i][j] = {} - for k = 1,#content[i][j] do + for k = 1, #content[i][j] do if content[i][j][k] then scavContent[i][j][k] = {} if #content[i][j][k] > 0 then @@ -2580,137 +2998,134 @@ if Spring.Utilities.Gametype.IsScavengers() or Spring.GetModOptions().forceallun table.mergeInPlace(unitGrids, scavUnitGrids) end - if Spring.GetModOptions().techsplit then - -- Unit Grids - unitGrids["armck"] = { { - { "armmex", "armsolar", "armwin", "", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "", }, -- basic AA, ferret, chainsaw - { "armdl", "", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "" }, -- basic AA, ferret, chainsaw + { "armdl", "" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armjamt",}, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armjamt" }, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armalab", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armalab" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armcs"] = { { - { "armmex", "armtide", }, -- mex, tidal - { "armfmkr", "", }, -- floating T1 converter, geo - { "armuwes", "armuwms", }, -- uw e stor, uw m stor + { "armmex", "armtide" }, -- mex, tidal + { "armfmkr", "" }, -- floating T1 converter, geo + { "armuwes", "armuwms" }, -- uw e stor, uw m stor }, { - { "armtl", "armfhlt", "armbeamer", "armclaw", }, -- offshore torp launcher, floating HLT - { "armfrt", "armferret" }, -- floating AA - { "armdl", "", }, -- coastal torp launcher, guardian, lightning turret + { "armtl", "armfhlt", "armbeamer", "armclaw" }, -- offshore torp launcher, floating HLT + { "armfrt", "armferret" }, -- floating AA + { "armdl", "" }, -- coastal torp launcher, guardian, lightning turret }, { - { "armfrad", "armeyes","armfdrag", }, -- floating radar, perimeter camera, shark's teeth - { "", "armdrag", "", ""}, - { "armjuno", "", "", ""}, -- dragon's teeth + { "armfrad", "armeyes", "armfdrag" }, -- floating radar, perimeter camera, shark's teeth + { "", "armdrag", "", "" }, + { "armjuno", "", "", "" }, -- dragon's teeth }, { - { "armsy", "armvp", "armap", "armlab", }, -- shipyard, veh lab, air lab, bot lab - { "armnanotcplat", "armasy", "", "", }, -- floating nano, T2 shipyard - { "", "", "", "", }, -- floating hover lab, amphibious lab, seaplane lab - } + { "armsy", "armvp", "armap", "armlab" }, -- shipyard, veh lab, air lab, bot lab + { "armnanotcplat", "armasy", "", "" }, -- floating nano, T2 shipyard + { "", "", "", "" }, -- floating hover lab, amphibious lab, seaplane lab + }, } - + unitGrids["armcv"] = { { - { "armmex", "armsolar", "armwin", "", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "", }, -- basic AA, ferret, chainsaw - { "armdl", "", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "" }, -- basic AA, ferret, chainsaw + { "armdl", "" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armjamt",}, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armjamt" }, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armbeaver"] = { { - { "armmex", "armsolar", "armwin", "armtide", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", "armfmkr", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "armtide" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex", "armfmkr" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "", }, -- basic AA, ferret, chainsaw - { "armdl", "armtl", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "" }, -- basic AA, ferret, chainsaw + { "armdl", "armtl" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", "armjamt", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armjamt",}, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag", "armjamt" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armjamt" }, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", "", "armasy", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp", "", "armasy" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armca"] = { { - { "armmex", "armsolar", "armwin", "", }, -- mex, solar, wind, adv. solar - { "armmakr", "armgeo", "armamex", }, -- T1 converter, geo, twilight, (tidal) - { "armestor", "armmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "armmex", "armsolar", "armwin", "" }, -- mex, solar, wind, adv. solar + { "armmakr", "armgeo", "armamex" }, -- T1 converter, geo, twilight, (tidal) + { "armestor", "armmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "armllt", "armbeamer", "armhlt", "armclaw", }, -- LLT, beamer, HLT, lightning turret - { "armrl", "armferret", "", }, -- basic AA, ferret, chainsaw - { "armdl", "", }, -- coastal torp launcher, guardian + { "armllt", "armbeamer", "armhlt", "armclaw" }, -- LLT, beamer, HLT, lightning turret + { "armrl", "armferret", "" }, -- basic AA, ferret, chainsaw + { "armdl", "" }, -- coastal torp launcher, guardian }, { - { "armrad", "armeyes", "armdrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "armjamt",}, - { "armjuno", }, -- juno + { "armrad", "armeyes", "armdrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "armjamt" }, + { "armjuno" }, -- juno }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armaap", "", "", }, -- nano, T2 lab - { "", "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armaap", "", "" }, -- nano, T2 lab + { "", "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } - + unitGrids["armack"] = { { - { "armmoho", "armfus", "", "armadvsol", }, - { "armmakr", "armageo", "armckfus", "armgmm", }, - { "armestor", "armmstor", "", "", }, + { "armmoho", "armfus", "", "armadvsol" }, + { "armmakr", "armageo", "armckfus", "armgmm" }, + { "armestor", "armmstor", "", "" }, }, { - { "armbeamer", "armhlt", "armpb", "armguard", }, - { "armferret", "armcir", "", "", }, - { "armdl", "", "", "", }, + { "armbeamer", "armhlt", "armpb", "armguard" }, + { "armferret", "armcir", "", "" }, + { "armdl", "", "", "" }, }, { { "armarad", "armsd", "", "" }, @@ -2718,22 +3133,22 @@ if Spring.GetModOptions().techsplit then { "armjuno", "", "", "" }, }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armalab", "", "", }, -- nano, T2 lab - { "", "armhalab" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armalab", "", "" }, -- nano, T2 lab + { "", "armhalab" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armacv"] = { { - { "armmoho", "armfus", "", "armadvsol", }, - { "armmakr", "armageo", "armckfus", "armgmm", }, - { "armestor", "armmstor", "", "", }, + { "armmoho", "armfus", "", "armadvsol" }, + { "armmakr", "armageo", "armckfus", "armgmm" }, + { "armestor", "armmstor", "", "" }, }, { - { "armbeamer", "armhlt", "armpb", "armguard", }, - { "armferret", "armcir", "", "", }, - { "armdl", "", "", "", }, + { "armbeamer", "armhlt", "armpb", "armguard" }, + { "armferret", "armcir", "", "" }, + { "armdl", "", "", "" }, }, { { "armarad", "armsd", "", "" }, @@ -2741,22 +3156,22 @@ if Spring.GetModOptions().techsplit then { "armjuno", "", "", "" }, }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", "", "", }, -- nano, T2 lab - { "", "armhavp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp", "", "" }, -- nano, T2 lab + { "", "armhavp" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armch"] = { { - { "armmoho", "armfus", "", "armadvsol", }, - { "armmakr", "armageo", "armckfus", "armgmm", }, - { "armestor", "armmstor", "", "", }, + { "armmoho", "armfus", "", "armadvsol" }, + { "armmakr", "armageo", "armckfus", "armgmm" }, + { "armestor", "armmstor", "", "" }, }, { - { "armbeamer", "armhlt", "armpb", "armguard", }, - { "armferret", "armcir", "", "", }, - { "armdl", "armtl", "", "", }, + { "armbeamer", "armhlt", "armpb", "armguard" }, + { "armferret", "armcir", "", "" }, + { "armdl", "armtl", "", "" }, }, { { "armarad", "armsd", "armason", "" }, @@ -2764,22 +3179,22 @@ if Spring.GetModOptions().techsplit then { "armjuno", "", "", "" }, }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armavp", "armhaapuw", "armasy", }, -- nano, T2 lab - { "", "armhavp", "", "armhasy", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armavp", "armhaapuw", "armasy" }, -- nano, T2 lab + { "", "armhavp", "", "armhasy" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armaca"] = { { - { "armmoho", "armfus", "", "armadvsol", }, - { "armmakr", "armageo", "armckfus", "armgmm", }, - { "armestor", "armmstor", "", "", }, + { "armmoho", "armfus", "", "armadvsol" }, + { "armmakr", "armageo", "armckfus", "armgmm" }, + { "armestor", "armmstor", "", "" }, }, { - { "armbeamer", "armhlt", "armpb", "armguard", }, - { "armferret", "armcir", "", "", }, - { "armdl", "", "", "", }, + { "armbeamer", "armhlt", "armpb", "armguard" }, + { "armferret", "armcir", "", "" }, + { "armdl", "", "", "" }, }, { { "armarad", "armsd", "", "" }, @@ -2787,547 +3202,676 @@ if Spring.GetModOptions().techsplit then { "armjuno", "", "", "" }, }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotc", "armaap", "", "", }, -- nano, T2 lab - { "", "armhaap" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotc", "armaap", "", "" }, -- nano, T2 lab + { "", "armhaap" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["armacsub"] = { { - { "armuwmme", "armtide", "armuwfus", }, -- uw moho, uw fusion, - { "armuwmmm", "armuwageo" }, -- floating T2 converter, adv geo powerplant - { "armuwes", "armuwms", }, -- uw e stor, uw metal stor + { "armuwmme", "armtide", "armuwfus" }, -- uw moho, uw fusion, + { "armuwmmm", "armuwageo" }, -- floating T2 converter, adv geo powerplant + { "armuwes", "armuwms" }, -- uw e stor, uw metal stor }, { - { "armatl", "armfhlt", "armkraken", }, -- adv torp launcher, floating heavy platform - { "armfrt", "armferret", "armcir", }, -- floating flak - {"armpb", "armguard",}, -- + { "armatl", "armfhlt", "armkraken" }, -- adv torp launcher, floating heavy platform + { "armfrt", "armferret", "armcir" }, -- floating flak + { "armpb", "armguard" }, -- }, { - { "armason", "armfdrag", }, -- adv sonar, floating targeting facility - { "armfatf", "", "", }, -- Floating air repair pad - { "armjuno", "", "", ""}, -- + { "armason", "armfdrag" }, -- adv sonar, floating targeting facility + { "armfatf", "", "" }, -- Floating air repair pad + { "armjuno", "", "", "" }, -- }, { - { "armlab", "armvp", "armap", "armsy", }, -- bot lab, veh lab, air lab, shipyard - { "armnanotcplat", "armasy", "", "", }, -- nano, T2 lab - { "", "armhasy" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "armlab", "armvp", "armap", "armsy" }, -- bot lab, veh lab, air lab, shipyard + { "armnanotcplat", "armasy", "", "" }, -- nano, T2 lab + { "", "armhasy" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["corck"] = { { - { "cormex", "corsolar", "corwin", "", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "", }, -- basic AA, SAM, eradicator - { "cordl", "", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "" }, -- basic AA, SAM, eradicator + { "cordl", "" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corjamt", }, - { "corjuno", "", "", "", }, -- juno + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corjamt" }, + { "corjuno", "", "", "" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coralab", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coralab" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["corcv"] = { { - { "cormex", "corsolar", "corwin", "", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "", }, -- basic AA, SAM, eradicator - { "cordl", "", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "" }, -- basic AA, SAM, eradicator + { "cordl", "" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corjamt", }, - {"corjuno","","","",}, -- juno + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corjamt" }, + { "corjuno", "", "", "" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["cormuskrat"] = { { - { "cormex", "corsolar", "corwin", "", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "corhllt", "corhlt", "cormaw", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "cormadsam", "", }, -- basic AA, SAM, eradicator - { "cordl", "cortl", }, -- coastal torp launcher, punisher + { "corllt", "corhllt", "corhlt", "cormaw" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "cormadsam", "" }, -- basic AA, SAM, eradicator + { "cordl", "cortl" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corjamt", }, - {"corjuno","","","",}, -- juno + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corjamt" }, + { "corjuno", "", "", "" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp","", "corasy", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp", "", "corasy" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["corca"] = { { - { "cormex", "corsolar", "corwin", "", }, -- mex, solar, wind, adv. solar - { "cormakr", "corgeo", "corexp", }, -- T1 converter, geo, exploiter, (tidal) - { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "cormex", "corsolar", "corwin", "" }, -- mex, solar, wind, adv. solar + { "cormakr", "corgeo", "corexp" }, -- T1 converter, geo, exploiter, (tidal) + { "corestor", "cormstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "corllt", "", "", "", }, -- LLT, Double LLT, HLT, flame turret - { "corrl", "", "", }, -- basic AA, SAM, eradicator - { "cordl", "", }, -- coastal torp launcher, punisher + { "corllt", "", "", "" }, -- LLT, Double LLT, HLT, flame turret + { "corrl", "", "" }, -- basic AA, SAM, eradicator + { "cordl", "" }, -- coastal torp launcher, punisher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth, jammer - { "corjamt", }, - {"corjuno","","","",}, -- juno + { "corrad", "coreyes", "cordrag" }, -- radar, perimeter camera, dragon's teeth, jammer + { "corjamt" }, + { "corjuno", "", "", "" }, -- juno }, { - { "corlab", "corvp", "corap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "cornanotc", "coravp", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "corlab", "corvp", "corap", "corsy" }, -- bot lab, veh lab, air lab, shipyard + { "cornanotc", "coravp" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["corcs"] = { { - { "cormex", "cortide", }, -- mex, tidal - { "corfmkr", "coruwgeo", }, -- floating T1 converter, geo - { "coruwes", "coruwms", }, -- uw e stor, uw m stor + { "cormex", "cortide" }, -- mex, tidal + { "corfmkr", "coruwgeo" }, -- floating T1 converter, geo + { "coruwes", "coruwms" }, -- uw e stor, uw m stor }, { - { "cortl", "corfhlt", "corhllt", "cormaw" }, -- offshore torp launcher, floating HLT - { "corfrt", "cormadsam" }, -- floating AA - { "cordl", "", }, -- coastal torp launcher, punisher, flame turret + { "cortl", "corfhlt", "corhllt", "cormaw" }, -- offshore torp launcher, floating HLT + { "corfrt", "cormadsam" }, -- floating AA + { "cordl", "" }, -- coastal torp launcher, punisher, flame turret }, { - { "corfrad", "coreyes", "corfdrag", }, -- floating radar, perimeter camera, shark's teeth - { "", "cordrag", "", "" }, -- dragon's teeth - {"corjuno","","","",}, + { "corfrad", "coreyes", "corfdrag" }, -- floating radar, perimeter camera, shark's teeth + { "", "cordrag", "", "" }, -- dragon's teeth + { "corjuno", "", "", "" }, }, { - { "corsy", "corvp", "corap", "corlab", }, -- shipyard, vehicle lab, air lab, bot lab - { "cornanotcplat", "corasy", }, -- floating nano, T2 shipyard - { "", "", "", "", }, -- floating hover, amphibious lab, seaplane lab - } + { "corsy", "corvp", "corap", "corlab" }, -- shipyard, vehicle lab, air lab, bot lab + { "cornanotcplat", "corasy" }, -- floating nano, T2 shipyard + { "", "", "", "" }, -- floating hover, amphibious lab, seaplane lab + }, } - - unitGrids["corack"] = { { - {"cormoho","corfus","","coradvsol",}, - {"cormakr","corageo","","corbhmth",}, - {"corestor","cormstor","","",}, + { "cormoho", "corfus", "", "coradvsol" }, + { "cormakr", "corageo", "", "corbhmth" }, + { "corestor", "cormstor", "", "" }, }, { - {"corhllt","corhlt","corvipe","corpun",}, - {"cormadsam","corerad","","",}, - {"cordl","corjuno","","",}, + { "corhllt", "corhlt", "corvipe", "corpun" }, + { "cormadsam", "corerad", "", "" }, + { "cordl", "corjuno", "", "" }, }, { - {"cararad","corsd","","",}, - {"corshroud","","","",}, - {"corjuno","","","",}, + { "cararad", "corsd", "", "" }, + { "corshroud", "", "", "" }, + { "corjuno", "", "", "" }, }, { - {"corlab","corvp","corap","corsy",}, - {"cornanotc","coralab","","",}, - {"","corhalab","","",}, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coralab", "", "" }, + { "", "corhalab", "", "" }, }, } unitGrids["coracv"] = { { - {"cormoho","corfus","","coradvsol",}, - {"cormakr","corageo","","corbhmth",}, - {"corestor","cormstor","","",}, + { "cormoho", "corfus", "", "coradvsol" }, + { "cormakr", "corageo", "", "corbhmth" }, + { "corestor", "cormstor", "", "" }, }, { - {"corhllt","corhlt","corvipe","corpun",}, - {"cormadsam","corerad","","",}, - {"cordl","corjuno","","",}, + { "corhllt", "corhlt", "corvipe", "corpun" }, + { "cormadsam", "corerad", "", "" }, + { "cordl", "corjuno", "", "" }, }, { - {"cararad","corsd","","",}, - {"corshroud","","","",}, - {"","","","",}, + { "cararad", "corsd", "", "" }, + { "corshroud", "", "", "" }, + { "", "", "", "" }, }, { - {"corlab","corvp","corap","corsy",}, - {"cornanotc","coravp","","",}, - {"","corhavp","","",}, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coravp", "", "" }, + { "", "corhavp", "", "" }, }, } unitGrids["corch"] = { { - {"cormoho","corfus","","coradvsol",}, - {"cormakr","corageo","","corbhmth",}, - {"corestor","cormstor","","",}, + { "cormoho", "corfus", "", "coradvsol" }, + { "cormakr", "corageo", "", "corbhmth" }, + { "corestor", "cormstor", "", "" }, }, { - {"corhllt","corhlt","corvipe","corpun",}, - {"cormadsam","corerad","","",}, - {"cordl","cortl","corjuno","",}, + { "corhllt", "corhlt", "corvipe", "corpun" }, + { "cormadsam", "corerad", "", "" }, + { "cordl", "cortl", "corjuno", "" }, }, { - {"cararad","corsd","corason","",}, - {"corshroud","cordrag","corfdrag","",}, - {"","","","",}, + { "cararad", "corsd", "corason", "" }, + { "corshroud", "cordrag", "corfdrag", "" }, + { "", "", "", "" }, }, { - {"corlab","corvp","corap","corsy",}, - {"cornanotc","coravp","corhaapuw","corasy",}, - {"","corhavp","","",}, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coravp", "corhaapuw", "corasy" }, + { "", "corhavp", "", "" }, }, } unitGrids["coraca"] = { { - {"cormoho","corfus","","coradvsol",}, - {"cormakr","corageo","","corbhmth",}, - {"corestor","cormstor","","",}, + { "cormoho", "corfus", "", "coradvsol" }, + { "cormakr", "corageo", "", "corbhmth" }, + { "corestor", "cormstor", "", "" }, }, { - {"corhllt","corhlt","corvipe","corpun",}, - {"cormadsam","corerad","","",}, - {"cordl","corjuno","","",}, + { "corhllt", "corhlt", "corvipe", "corpun" }, + { "cormadsam", "corerad", "", "" }, + { "cordl", "corjuno", "", "" }, }, { - {"cararad","corsd","","",}, - {"corshroud","","","",}, - {"","","","",}, + { "cararad", "corsd", "", "" }, + { "corshroud", "", "", "" }, + { "", "", "", "" }, }, { - {"corlab","corvp","corap","corsy",}, - {"cornanotc","coraap","","",}, - {"","corhaap","","",}, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotc", "coraap", "", "" }, + { "", "corhaap", "", "" }, }, } unitGrids["coracsub"] = { { - {"cormoho","corfus","","coradvsol",}, - {"cormakr","corageo","","corbhmth",}, - {"corestor","cormstor","","",}, + { "cormoho", "corfus", "", "coradvsol" }, + { "cormakr", "corageo", "", "corbhmth" }, + { "corestor", "cormstor", "", "" }, }, { - { "coratl", "corfhlt", }, -- adv torp launcher, floating heavy platform - { "corfrl", "cormadsam", "corerad", }, -- floating flak - { "corpun", "corvipe" }, -- + { "coratl", "corfhlt" }, -- adv torp launcher, floating heavy platform + { "corfrl", "cormadsam", "corerad" }, -- floating flak + { "corpun", "corvipe" }, -- }, { - { "corason", "corfdrag", "corarad", "corshroud", }, -- adv sonar, floating targeting facility - { "", "", "", "" }, -- Floating air repair pad + { "corason", "corfdrag", "corarad", "corshroud" }, -- adv sonar, floating targeting facility + { "", "", "", "" }, -- Floating air repair pad }, { - {"corlab","corvp","corap","corsy",}, - {"cornanotcplat", "corasy", "", "",}, - {"","corhasy","","",}, + { "corlab", "corvp", "corap", "corsy" }, + { "cornanotcplat", "corasy", "", "" }, + { "", "corhasy", "", "" }, }, } unitGrids["legck"] = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "legcluster", }, -- basic AA, SAM, eradicator - { "legctl", "", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "legcluster" }, -- basic AA, SAM, eradicator + { "legctl", "" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legalab", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legalab" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["legca"] = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "legcluster", }, -- basic AA, SAM, eradicator - { "legctl", "", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "legcluster" }, -- basic AA, SAM, eradicator + { "legctl", "" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legaap", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legaap" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["legcv"] = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "legcluster", }, -- basic AA, SAM, eradicator - { "legctl", "", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "legcluster" }, -- basic AA, SAM, eradicator + { "legctl", "" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legavp", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legavp" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["legotter"] = { { - { "legmex", "legsolar", "legwin", "legadvsol", }, -- mex, solar, wind, adv. solar - { "legeconv", "leggeo", "legmext15", }, -- T1 converter, geo, T1.5 legion mex, (tidal) - { "legestor", "legmstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) + { "legmex", "legsolar", "legwin", "legadvsol" }, -- mex, solar, wind, adv. solar + { "legeconv", "leggeo", "legmext15" }, -- T1 converter, geo, T1.5 legion mex, (tidal) + { "legestor", "legmstor" }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "leghive", "legdtr", }, -- LLT, machine gun, hive, riot turret - { "legrl", "legrhapsis", "legcluster", }, -- basic AA, SAM, eradicator - { "legctl", "legtl", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "leghive", "legdtr" }, -- LLT, machine gun, hive, riot turret + { "legrl", "legrhapsis", "legcluster" }, -- basic AA, SAM, eradicator + { "legctl", "legtl" }, -- coastal torp launcher, punisher }, { - { "legrad", "legeyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { "", "", "", "" }, -- - { "legjuno", }, -- juno + { "legrad", "legeyes", "legdrag", "legjam" }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "", "" }, -- + { "legjuno" }, -- juno }, { - { "leglab", "legvp", "legap", "legsy", }, -- bot lab, veh lab, air lab, shipyard - { "legnanotc", "legavp", "", "legadvshipyard", }, -- nano, T2 lab - { "", }, -- hover lab, floating hover lab, amphibious lab, seaplane lab - } + { "leglab", "legvp", "legap", "legsy" }, -- bot lab, veh lab, air lab, shipyard + { "legnanotc", "legavp", "", "legadvshipyard" }, -- nano, T2 lab + { "" }, -- hover lab, floating hover lab, amphibious lab, seaplane lab + }, } unitGrids["legack"] = { { - {"legmoho","legfus","","legadvsol",}, - {"legeconv","legageo","","legrampart",}, - {"legestor","legmstor","","",}, + { "legmoho", "legfus", "", "legadvsol" }, + { "legeconv", "legageo", "", "legrampart" }, + { "legestor", "legmstor", "", "" }, }, { - {"legmg","leghive","legapopupdef","legcluster",}, - {"legrhapsis","leglupara","legabm","",}, - {"legctl","legdl","","",}, + { "legmg", "leghive", "legapopupdef", "legcluster" }, + { "legrhapsis", "leglupara", "legabm", "" }, + { "legctl", "legdl", "", "" }, }, { - {"legrad","legsd","","",}, - {"legajam","","","",}, - {"legjuno","","","",}, + { "legrad", "legsd", "", "" }, + { "legajam", "", "", "" }, + { "legjuno", "", "", "" }, }, { - {"leglab","legvp","legap","legsy",}, - {"legnanotc","legalab","","",}, - {"","leghalab","","",}, + { "leglab", "legvp", "legap", "legsy" }, + { "legnanotc", "legalab", "", "" }, + { "", "leghalab", "", "" }, }, } unitGrids["legacv"] = { { - {"legmoho","legfus","","legadvsol",}, - {"legeconv","legageo","","legrampart",}, - {"legestor","legmstor","","",}, + { "legmoho", "legfus", "", "legadvsol" }, + { "legeconv", "legageo", "", "legrampart" }, + { "legestor", "legmstor", "", "" }, }, { - {"legmg","leghive","legapopupdef","legcluster",}, - {"legrhapsis","leglupara","legabm","",}, - {"legctl","legdl","","",}, + { "legmg", "leghive", "legapopupdef", "legcluster" }, + { "legrhapsis", "leglupara", "legabm", "" }, + { "legctl", "legdl", "", "" }, }, { - {"legrad","legsd","","",}, - {"legajam","","","",}, - {"legjuno","","","",}, + { "legrad", "legsd", "", "" }, + { "legajam", "", "", "" }, + { "legjuno", "", "", "" }, }, { - {"leglab","legvp","legap","legsy",}, - {"legnanotc","legavp","","",}, - {"","leghavp","","",}, + { "leglab", "legvp", "legap", "legsy" }, + { "legnanotc", "legavp", "", "" }, + { "", "leghavp", "", "" }, }, } unitGrids["legch"] = { { - {"legmoho","legfus","","legadvsol",}, - {"legeconv","legageo","","legrampart",}, - {"legestor","legmstor","","",}, + { "legmoho", "legfus", "", "legadvsol" }, + { "legeconv", "legageo", "", "legrampart" }, + { "legestor", "legmstor", "", "" }, }, { - {"legmg","leghive","legapopupdef","legcluster",}, - {"legrhapsis","leglupara","legabm","",}, - {"legctl","legtl","","",}, + { "legmg", "leghive", "legapopupdef", "legcluster" }, + { "legrhapsis", "leglupara", "legabm", "" }, + { "legctl", "legtl", "", "" }, }, { - {"legrad","legsd","","",}, - {"legajam","","","",}, - {"legjuno","","","",}, + { "legrad", "legsd", "", "" }, + { "legajam", "", "", "" }, + { "legjuno", "", "", "" }, }, { - {"leglab","legvp","legap","legsy",}, - {"legnanotc","legavp","","legadvshipyard",}, - {"","leghavp","","corhasy",}, + { "leglab", "legvp", "legap", "legsy" }, + { "legnanotc", "legavp", "", "legadvshipyard" }, + { "", "leghavp", "", "corhasy" }, }, } unitGrids["legaca"] = { { - {"legmoho","legfus","","legadvsol",}, - {"legeconv","legageo","","legrampart",}, - {"legestor","legmstor","","",}, + { "legmoho", "legfus", "", "legadvsol" }, + { "legeconv", "legageo", "", "legrampart" }, + { "legestor", "legmstor", "", "" }, }, { - {"legmg","leghive","legapopupdef","legcluster",}, - {"legrhapsis","leglupara","legabm","",}, - {"legctl","legdl","","",}, + { "legmg", "leghive", "legapopupdef", "legcluster" }, + { "legrhapsis", "leglupara", "legabm", "" }, + { "legctl", "legdl", "", "" }, }, { - {"legrad","legsd","","",}, - {"legajam","","","",}, - {"legjuno","","","",}, + { "legrad", "legsd", "", "" }, + { "legajam", "", "", "" }, + { "legjuno", "", "", "" }, }, { - {"leglab","legvp","legap","legsy",}, - {"legnanotc","legaap","","",}, - {"","leghaap","","",}, + { "leglab", "legvp", "legap", "legsy" }, + { "legnanotc", "legaap", "", "" }, + { "", "leghaap", "", "" }, }, } -- Lab Grids labGrids["armlab"] = { - "armck", "armrectr", "armpw", "armflea", -- T1 con, rez bot, peewee, flea - "armrock", "armwar", "armham", "", -- rocko, hammer, warrior - "", "", "armjeth", + "armck", + "armrectr", + "armpw", + "armflea", -- T1 con, rez bot, peewee, flea + "armrock", + "armwar", + "armham", + "", -- rocko, hammer, warrior + "", + "", + "armjeth", } labGrids["armvp"] = { - "armcv", "armmlv", "armflash", "armfav", -- T1 con, minelayer, flash, scout - "armart", "armjanus", "armstump", "", -- stumpy, janus, arty - "armbeaver", "armpincer", "armsam", "", -- amphib con, amphib tank, missile truck + "armcv", + "armmlv", + "armflash", + "armfav", -- T1 con, minelayer, flash, scout + "armart", + "armjanus", + "armstump", + "", -- stumpy, janus, arty + "armbeaver", + "armpincer", + "armsam", + "", -- amphib con, amphib tank, missile truck } labGrids["corvp"] = { - "corcv", "cormlv", "corgator", "corfav", -- T1 con, minelayer, gator, scout - "corwolv", "corlevlr", "corraid", "", -- raider, leveler, art - "cormuskrat", "corgarp", "cormist", "", -- amphib con, amphib tank, missile truck + "corcv", + "cormlv", + "corgator", + "corfav", -- T1 con, minelayer, gator, scout + "corwolv", + "corlevlr", + "corraid", + "", -- raider, leveler, art + "cormuskrat", + "corgarp", + "cormist", + "", -- amphib con, amphib tank, missile truck } labGrids["armalab"] = { - "armack", "armspid", "armfast", "armmark", - "armsptk", "armfido", "armzeus", "armspy", - "armvader", "armamph", "armaak", "armmav", + "armack", + "armspid", + "armfast", + "armmark", + "armsptk", + "armfido", + "armzeus", + "armspy", + "armvader", + "armamph", + "armaak", + "armmav", } labGrids["coralab"] = { - "corack", "cormando", "corpyro", "corvoyr", - "corhrk", "cormort", "corcan", "corspy", - "", "coramph", "coraak", "cortermite", + "corack", + "cormando", + "corpyro", + "corvoyr", + "corhrk", + "cormort", + "corcan", + "corspy", + "", + "coramph", + "coraak", + "cortermite", } labGrids["legalab"] = { - "legack", "leginfestor", "legstr", "legaradk", - "leghrk", "legbart", "legshot", "legaspy", - "legsnapper", "legamph", "legadvaabot", "", + "legack", + "leginfestor", + "legstr", + "legaradk", + "leghrk", + "legbart", + "legshot", + "legaspy", + "legsnapper", + "legamph", + "legadvaabot", + "", } labGrids["armavp"] = { - "armacv", "armch", "armlatnk", "armseer", - "armmart", "armmh", "armmanac", "armsh", - "", "armcroc", "armah", "armgremlin", + "armacv", + "armch", + "armlatnk", + "armseer", + "armmart", + "armmh", + "armmanac", + "armsh", + "", + "armcroc", + "armah", + "armgremlin", } labGrids["coravp"] = { - "coracv", "corch", "corsala", "corvrad", - "cormart", "corban", "correap", "corsh", - "corsnap", "corhal", "corah", "cormh", + "coracv", + "corch", + "corsala", + "corvrad", + "cormart", + "corban", + "correap", + "corsh", + "corsnap", + "corhal", + "corah", + "cormh", } labGrids["legavp"] = { - "legacv", "legvcarry", "legmrv", "legavrad", - "legamcluster", "legaskirmtank", "legner", "legnavyconship", - "legch", "legfloat", "legah", "legmh", + "legacv", + "legvcarry", + "legmrv", + "legavrad", + "legamcluster", + "legaskirmtank", + "legner", + "legnavyconship", + "legch", + "legfloat", + "legah", + "legmh", } labGrids["armasy"] = { - "armacsub", "armch", "armlship", "armsjam", - "armmship", "armcrus", "armanac", "armsh", - "armsubk", "armcroc", "armah", "armmh", + "armacsub", + "armch", + "armlship", + "armsjam", + "armmship", + "armcrus", + "armanac", + "armsh", + "armsubk", + "armcroc", + "armah", + "armmh", } labGrids["corasy"] = { - "coracsub", "corch", "corfship", "corsjam", - "cormship", "corcrus", "corsnap", "corsh", - "corshark", "corsala", "corah", "cormh", + "coracsub", + "corch", + "corfship", + "corsjam", + "cormship", + "corcrus", + "corsnap", + "corsh", + "corshark", + "corsala", + "corah", + "cormh", } labGrids["coraap"] = { - "coraca", "corsfig", "corcut", "corsb", - "corawac", "corhvytrans", "corseap", "", - "", "", "", "", + "coraca", + "corsfig", + "corcut", + "corsb", + "corawac", + "corhvytrans", + "corseap", + "", + "", + "", + "", + "", } labGrids["armaap"] = { - "armaca", "armsfig", "armsaber", "armsb", - "armsehak", "armhvytrans", "armseap", "", - "", "", "", "", + "armaca", + "armsfig", + "armsaber", + "armsb", + "armsehak", + "armhvytrans", + "armseap", + "", + "", + "", + "", + "", } - labGrids["legaap"] ={ - "legaca", "corsfig", "corcut", "corsb", - "corawac", "corhvytrans", "corseap", "", - "", "", "", "", + labGrids["legaap"] = { + "legaca", + "corsfig", + "corcut", + "corsb", + "corawac", + "corhvytrans", + "corseap", + "", + "", + "", + "", + "", } labGrids[""] = { - "", "", "", "", - "", "", "", "", - "", "", "", "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", } - - end - return { LabGrids = labGrids, UnitGrids = unitGrids, - PriorityUnits = priorityUnits + PriorityUnits = priorityUnits, } diff --git a/luaui/configs/keyboard_layouts.lua b/luaui/configs/keyboard_layouts.lua index 376d3f6b683..1fddc727f56 100644 --- a/luaui/configs/keyboard_layouts.lua +++ b/luaui/configs/keyboard_layouts.lua @@ -8,7 +8,7 @@ end scanToCode["qwertz"]["Y"] = "Z" scanToCode["qwertz"]["Z"] = "Y" - -- NEEDS CORRECTION BELOW +-- NEEDS CORRECTION BELOW scanToCode["qwertz"][";"] = ";" scanToCode["qwertz"]["'"] = "'" scanToCode["qwertz"][","] = "," @@ -18,7 +18,7 @@ scanToCode["qwertz"]["`"] = "`" scanToCode["qwertz"]["-"] = "-" scanToCode["qwertz"]["="] = "=" scanToCode["qwertz"]["\\"] = "\\" - -- NEEDS CORRECTION ABOVE +-- NEEDS CORRECTION ABOVE scanToCode["azerty"] = { Q = "A", W = "Z", @@ -114,7 +114,6 @@ scanToCode["colemak-dh"] = { ["\\"] = "\\", } - scanToCode["canary"] = { Q = "W", W = "L", @@ -153,7 +152,6 @@ scanToCode["canary"] = { ["\\"] = "\\", } - scanToCode["canary-ortho"] = { Q = "W", W = "L", @@ -192,7 +190,6 @@ scanToCode["canary-ortho"] = { ["\\"] = "\\", } - scanToCode["dvorak"] = { Q = "'", W = ",", @@ -315,18 +312,17 @@ scanToCode["workman"] = { ["\\"] = "\\", } - local layouts = { - 'qwerty', - 'qwertz', - 'azerty', - 'colemak', - 'colemak-dh', - 'canary', - 'canary-ortho', - 'dvorak', - 'de-neo', - 'workman', + "qwerty", + "qwertz", + "azerty", + "colemak", + "colemak-dh", + "canary", + "canary-ortho", + "dvorak", + "de-neo", + "workman", } local function sanitizeKey(key, layout) @@ -336,7 +332,7 @@ local function sanitizeKey(key, layout) layout = layout or Spring.GetConfigString("KeyboardLayout", "qwerty") - key = key:upper():gsub("ANY%+", '') + key = key:upper():gsub("ANY%+", "") key = key:gsub("SC_(.)", function(c) return scanToCode[layout][c] or c end) @@ -345,19 +341,19 @@ local function sanitizeKey(key, layout) end local keybindingLayouts = { - 'Grid', -- the first element will be the default value if a fallback is ever needed - 'Grid (60% Keyboard)', - 'Legacy', - 'Legacy (60% Keyboard)', - 'Custom' + "Grid", -- the first element will be the default value if a fallback is ever needed + "Grid (60% Keyboard)", + "Legacy", + "Legacy (60% Keyboard)", + "Custom", } local keybindingPresets = { - [keybindingLayouts[1]] = 'luaui/configs/hotkeys/grid_keys.txt', -- the first element will be the default value if a fallback is ever needed - [keybindingLayouts[2]] = 'luaui/configs/hotkeys/grid_keys_60pct.txt', - [keybindingLayouts[3]] = 'luaui/configs/hotkeys/legacy_keys.txt', - [keybindingLayouts[4]] = 'luaui/configs/hotkeys/legacy_keys_60pct.txt', - [keybindingLayouts[5]] = 'uikeys.txt', + [keybindingLayouts[1]] = "luaui/configs/hotkeys/grid_keys.txt", -- the first element will be the default value if a fallback is ever needed + [keybindingLayouts[2]] = "luaui/configs/hotkeys/grid_keys_60pct.txt", + [keybindingLayouts[3]] = "luaui/configs/hotkeys/legacy_keys.txt", + [keybindingLayouts[4]] = "luaui/configs/hotkeys/legacy_keys_60pct.txt", + [keybindingLayouts[5]] = "uikeys.txt", } local keybindingLayoutFiles = {} diff --git a/luaui/configs/unit_buildmenu_config.lua b/luaui/configs/unit_buildmenu_config.lua index 32605e6f27d..4f57fcf98d9 100644 --- a/luaui/configs/unit_buildmenu_config.lua +++ b/luaui/configs/unit_buildmenu_config.lua @@ -3,7 +3,6 @@ --- DateTime: 4/26/2023 8:48 PM --- - local unitEnergyCost = {} ---@type table local unitMetalCost = {} ---@type table local unitGroup = {} ---@type table @@ -16,7 +15,6 @@ local isMex = {} ---@type table local unitMaxWeaponRange = {} ---@type table for unitDefID, unitDef in pairs(UnitDefs) do - unitGroup[unitDefID] = unitDef.customParams.unitgroup if unitDef.maxWeaponRange > 16 then @@ -40,8 +38,6 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end - - ------------------------------------ -- UNIT ORDER ---------------------- ------------------------------------ @@ -82,13 +78,12 @@ table.sort(unitOrder, function(aID, bID) local aOrder = unitOrderManualOverrideTable[aID] or maxOrder local bOrder = unitOrderManualOverrideTable[bID] or maxOrder - if (aOrder == bOrder) then + if aOrder == bOrder then return aID < bID end return aOrder < bOrder end) - local units = { unitEnergyCost = unitEnergyCost, unitMetalCost = unitMetalCost, diff --git a/luaui/debug.lua b/luaui/debug.lua index d8d372585d4..6ec156f023b 100644 --- a/luaui/debug.lua +++ b/luaui/debug.lua @@ -11,330 +11,310 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - function PrintInCommand() - local cmdIndex, cmdId, cmdType, name = Spring.GetActiveCommand() - print("InCommand: ", cmdIndex, cmdId, cmdType, name) + local cmdIndex, cmdId, cmdType, name = Spring.GetActiveCommand() + print("InCommand: ", cmdIndex, cmdId, cmdType, name) end - function PrintBuildQueue(unitID) - local queue, count = Spring.GetRealBuildQueue(unitID) - print("BuildQueue(" .. unitID .."): " .. count) - for i,v in pairs(queue) do - for i2,v2 in pairs(v) do - print(' ' .. i .. ': ' .. i2 .. ' x' .. v2) - end - end + local queue, count = Spring.GetRealBuildQueue(unitID) + print("BuildQueue(" .. unitID .. "): " .. count) + for i, v in pairs(queue) do + for i2, v2 in pairs(v) do + print(" " .. i .. ": " .. i2 .. " x" .. v2) + end + end end - function PrintSelection() - local udTable, n = Spring.GetSelectedUnitsSorted() - local selectedGroup = Spring.GetSelectedGroup() - print("Selected Group = " .. selectedGroup) - print("Selected: " .. n .. " types") - for udid,uTable in pairs(udTable) do - print(' ' .. udid .. '=' .. UnitDefs[udid].name .. ' count ' .. uTable.n) - for _,uid in ipairs(uTable) do - local health, maxHealth, paralyze, capture, build = Spring.GetUnitHealth(uid) - print(' ', uid, health, maxHealth, paralyze, capture, build) - PrintCommandQueue(uid) - end - end - for udid,uTable in pairs(udTable) do - for uid,udid2 in pairs(uTable) do - PrintBuildQueue(uid) - end - end + local udTable, n = Spring.GetSelectedUnitsSorted() + local selectedGroup = Spring.GetSelectedGroup() + print("Selected Group = " .. selectedGroup) + print("Selected: " .. n .. " types") + for udid, uTable in pairs(udTable) do + print(" " .. udid .. "=" .. UnitDefs[udid].name .. " count " .. uTable.n) + for _, uid in ipairs(uTable) do + local health, maxHealth, paralyze, capture, build = Spring.GetUnitHealth(uid) + print(" ", uid, health, maxHealth, paralyze, capture, build) + PrintCommandQueue(uid) + end + end + for udid, uTable in pairs(udTable) do + for uid, udid2 in pairs(uTable) do + PrintBuildQueue(uid) + end + end end - function PrintCommandQueue(uid) - local queue = Spring.GetUnitCommands(uid, -1) - if (queue ~= nil) then - local msg = '' - local count = 0 - for i,cmd in pairs(queue) do - local name = CommandNames[cmd] - if (name ~= nil) then - count = count + 1 - msg = msg .. ' ' .. CommandNames[cmd] .. ',' - if (count >= 8) then - break - end - end - end - print('', 'commands: ' .. msg) - end + local queue = Spring.GetUnitCommands(uid, -1) + if queue ~= nil then + local msg = "" + local count = 0 + for i, cmd in pairs(queue) do + local name = CommandNames[cmd] + if name ~= nil then + count = count + 1 + msg = msg .. " " .. CommandNames[cmd] .. "," + if count >= 8 then + break + end + end + end + print("", "commands: " .. msg) + end end - function PrintGroups() - local groupList, count = Spring.GetGroupList() - print("GetGroupList: " .. tostring(count)) - for i, v in pairs(groupList) do - local groupName = Spring.GetGroupAIName(i) - if (groupName == nil) then groupName = "" end - print(' ' .. i .. '\t' .. v .. '\t' .. groupName) - end - - for g, c in pairs(groupList) do - print("Units in Group " .. g) - local udTable = Spring.GetGroupUnitsSorted(g) - print(" MyTeamUnits: " .. udTable.n .. " types") - udTable.n = nil - for udid,uTable in pairs(udTable) do - print(' ' .. udid .. '=' .. UnitDefs[udid].name .. ' count ' .. uTable.n) - uTable.n = nil - for _,uid in ipairs(uTable) do - print(' ', uid) - end - end - end + local groupList, count = Spring.GetGroupList() + print("GetGroupList: " .. tostring(count)) + for i, v in pairs(groupList) do + local groupName = Spring.GetGroupAIName(i) + if groupName == nil then + groupName = "" + end + print(" " .. i .. "\t" .. v .. "\t" .. groupName) + end + + for g, c in pairs(groupList) do + print("Units in Group " .. g) + local udTable = Spring.GetGroupUnitsSorted(g) + print(" MyTeamUnits: " .. udTable.n .. " types") + udTable.n = nil + for udid, uTable in pairs(udTable) do + print(" " .. udid .. "=" .. UnitDefs[udid].name .. " count " .. uTable.n) + uTable.n = nil + for _, uid in ipairs(uTable) do + print(" ", uid) + end + end + end end - function PrintTeamUnits(team) - udTable = Spring.GetTeamUnitsSorted(team) --- print("TeamUnits(" .. team .. "): " .. udTable.n .. " types") --- udTable.n = nil - if (udTable == nil) then - return - end - udTable.n = nil - for udid,uTable in pairs(udTable) do - print(' ' .. udid .. '=' .. UnitDefs[udid].name .. ' count ' .. uTable.n) - uTable.n = nil - for _,uid in ipairs(uTable) do - print(' ', uid) - end - end + udTable = Spring.GetTeamUnitsSorted(team) + -- print("TeamUnits(" .. team .. "): " .. udTable.n .. " types") + -- udTable.n = nil + if udTable == nil then + return + end + udTable.n = nil + for udid, uTable in pairs(udTable) do + print(" " .. udid .. "=" .. UnitDefs[udid].name .. " count " .. uTable.n) + uTable.n = nil + for _, uid in ipairs(uTable) do + print(" ", uid) + end + end end - function PrintTeamUnitsCounts(team) - print("Team Units Count:" .. team) - local countTable = Spring.GetTeamUnitsCounts(team) - if (countTable == nil) then - return - end - countTable.n = nil - for udid,count in pairs(countTable) do - print(' ' .. udid .. '=' .. UnitDefs[udid].name .. ': ' .. count) - end + print("Team Units Count:" .. team) + local countTable = Spring.GetTeamUnitsCounts(team) + if countTable == nil then + return + end + countTable.n = nil + for udid, count in pairs(countTable) do + print(" " .. udid .. "=" .. UnitDefs[udid].name .. ": " .. count) + end end - function PrintAlliedUnits() - local teamTable = Spring.GetTeamList(Spring.GetMyAllyTeamID()) --- print("AlliedUnits: " .. teamTable.n .. " teams") - teamTable.n = nil - for n,tid in pairs(teamTable) do - PrintTeamUnits(tid); - end + local teamTable = Spring.GetTeamList(Spring.GetMyAllyTeamID()) + -- print("AlliedUnits: " .. teamTable.n .. " teams") + teamTable.n = nil + for n, tid in pairs(teamTable) do + PrintTeamUnits(tid) + end end - function PrintAllyTeamList() - local allyTeamTable = Spring.GetAllyTeamList() - local msg = "AllyTeams(" .. allyTeamTable.n .. ")" - allyTeamTable.n = nil - for n,atid in pairs(allyTeamTable) do - msg = msg .. " " .. atid - end - print(msg) + local allyTeamTable = Spring.GetAllyTeamList() + local msg = "AllyTeams(" .. allyTeamTable.n .. ")" + allyTeamTable.n = nil + for n, atid in pairs(allyTeamTable) do + msg = msg .. " " .. atid + end + print(msg) end - function PrintTeamList(allyTeam) - local teamTable - if (allyTeam == nil) then - teamTable = Spring.GetTeamList() - else - teamTable = Spring.GetTeamList(allyTeam) - end - if (teamTable == nil) then - return - end - - local msg = "Teams(" .. teamTable.n .. ")" - teamTable.n = nil - for n,tid in pairs(teamTable) do - msg = msg .. " " .. tid - end - print(msg) + local teamTable + if allyTeam == nil then + teamTable = Spring.GetTeamList() + else + teamTable = Spring.GetTeamList(allyTeam) + end + if teamTable == nil then + return + end + + local msg = "Teams(" .. teamTable.n .. ")" + teamTable.n = nil + for n, tid in pairs(teamTable) do + msg = msg .. " " .. tid + end + print(msg) end - function PrintPlayerList(team) - local playerTable - if (team == nil) then - playerTable = Spring.GetTeamList() - else - playerTable = Spring.GetTeamList(team) - end - if (playerTable == nil) then - return - end - - local msg = "Players(" .. playerTable.n .. ")" - playerTable.n = nil - for n,pid in pairs(playerTable) do - msg = msg .. " " .. pid - end - print(msg) + local playerTable + if team == nil then + playerTable = Spring.GetTeamList() + else + playerTable = Spring.GetTeamList(team) + end + if playerTable == nil then + return + end + + local msg = "Players(" .. playerTable.n .. ")" + playerTable.n = nil + for n, pid in pairs(playerTable) do + msg = msg .. " " .. pid + end + print(msg) end - function PrintPlayerTree() - local atTable = Spring.GetAllyTeamList() - for atn,atid in ipairs(atTable) do - print('Ally team: ' .. atid) - local tTable = Spring.GetTeamList(atid) - for tn,tid in ipairs(tTable) do - print(' Team: ' .. tid) - local pTable = Spring.GetPlayerList(tid) - for pn,pid in ipairs(pTable) do - local pname, active = Spring.GetPlayerInfo(pid, false) - if (active) then - print(' Player: ' .. pid .. " " .. pname) - end - end - end - end + local atTable = Spring.GetAllyTeamList() + for atn, atid in ipairs(atTable) do + print("Ally team: " .. atid) + local tTable = Spring.GetTeamList(atid) + for tn, tid in ipairs(tTable) do + print(" Team: " .. tid) + local pTable = Spring.GetPlayerList(tid) + for pn, pid in ipairs(pTable) do + local pname, active = Spring.GetPlayerInfo(pid, false) + if active then + print(" Player: " .. pid .. " " .. pname) + end + end + end + end end - function PrintTeamInfo(teamID) - local num, leader, dead, isAI, side, allyTeam = Spring.GetTeamInfo(teamID, false) - print('Team number: ' .. num) - print(' leader: ' .. leader) - print(' dead: ' .. tostring(dead)) - print(' isAI: ' .. tostring(isAI)) - print(' side: ' .. side) - print(' allyTeam: ' .. allyTeam) + local num, leader, dead, isAI, side, allyTeam = Spring.GetTeamInfo(teamID, false) + print("Team number: " .. num) + print(" leader: " .. leader) + print(" dead: " .. tostring(dead)) + print(" isAI: " .. tostring(isAI)) + print(" side: " .. side) + print(" allyTeam: " .. allyTeam) end - function PrintTeamResources(teamID, type) - local current, storage, pull, income, expense, - share, sent, received = Spring.GetTeamResources(teamID, type) - if (current ~= nil) then - print('Team number: ' .. teamID) - print(' ' .. type .. ': ' .. current) - print(' ' .. type .. ' storage: ' .. storage) - print(' ' .. type .. ' pull: ' .. pull) - print(' ' .. type .. ' income: ' .. income) - print(' ' .. type .. ' expense: ' .. expense) - print(' ' .. type .. ' share: ' .. share) - print(' ' .. type .. ' sent: ' .. sent) - print(' ' .. type .. ' received: ' .. received) - end + local current, storage, pull, income, expense, share, sent, received = Spring.GetTeamResources(teamID, type) + if current ~= nil then + print("Team number: " .. teamID) + print(" " .. type .. ": " .. current) + print(" " .. type .. " storage: " .. storage) + print(" " .. type .. " pull: " .. pull) + print(" " .. type .. " income: " .. income) + print(" " .. type .. " expense: " .. expense) + print(" " .. type .. " share: " .. share) + print(" " .. type .. " sent: " .. sent) + print(" " .. type .. " received: " .. received) + end end - function PrintTeamUnitStats(teamID) - local kills, deaths, caps, losses, recv, sent = Spring.GetTeamUnitStats(teamID) - if (kills ~= nil) then - print('Team number: ' .. teamID) - print(' kills: ' .. kills) - print(' deaths: ' .. deaths) - print(' caps: ' .. caps) - print(' losses: ' .. losses) - print(' recv: ' .. recv) - print(' sent: ' .. sent) - end + local kills, deaths, caps, losses, recv, sent = Spring.GetTeamUnitStats(teamID) + if kills ~= nil then + print("Team number: " .. teamID) + print(" kills: " .. kills) + print(" deaths: " .. deaths) + print(" caps: " .. caps) + print(" losses: " .. losses) + print(" recv: " .. recv) + print(" sent: " .. sent) + end end - function PrintPlayerInfo(playerID) - local name, active, spectator, team, allyteam, ping, cpuUsage = - Spring.GetPlayerInfo(playerID, false) - print(' name: '..name) - print(' id: '..playerID) - print(' active: '..tostring(active)) - print(' spectator '..tostring(spectator)) - print(' team: '..team) - print(' allyteam: '..allyteam) - print(' ping: '..ping) - print(' cpu: '..(100*cpuUsage)..'%') + local name, active, spectator, team, allyteam, ping, cpuUsage = Spring.GetPlayerInfo(playerID, false) + print(" name: " .. name) + print(" id: " .. playerID) + print(" active: " .. tostring(active)) + print(" spectator " .. tostring(spectator)) + print(" team: " .. team) + print(" allyteam: " .. allyteam) + print(" ping: " .. ping) + print(" cpu: " .. (100 * cpuUsage) .. "%") end - function PrintCommands(commands) - for i, v in pairs(commands) do - if (type(v) == "table") then - local txt = "" - for i2, v2 in pairs(v) do - txt = txt .. '"' .. i2 .. '"' .. ' = ' - if (type(v2) ~= "table") then - txt = txt .. tostring(v2) .. ', ' - else - txt = txt .. '{ ' - for i3,v3 in pairs(v2) do - txt = txt .. '"' .. v3 .. '", ' - end - txt = txt .. '}, ' - end - end - print(txt) - else - print(i, v) - end - end + for i, v in pairs(commands) do + if type(v) == "table" then + local txt = "" + for i2, v2 in pairs(v) do + txt = txt .. '"' .. i2 .. '"' .. " = " + if type(v2) ~= "table" then + txt = txt .. tostring(v2) .. ", " + else + txt = txt .. "{ " + for i3, v3 in pairs(v2) do + txt = txt .. '"' .. v3 .. '", ' + end + txt = txt .. "}, " + end + end + print(txt) + else + print(i, v) + end + end end - function Debug() - for i,v in pairs(UnitDefs) do - if (v ~= nil) then - print(i ..' '.. v.name) - end - end - for i,v in pairs(WeaponDefs) do - if (v ~= nil) then - print(i ..' '.. v.name) - end - end - - print("Game.version = " .. Engine.version) - print("Game.commEnds = " .. tostring(Game.commEnds)) - print("Game.gravity = " .. Game.gravity) - print("Game.tidal = " .. Game.tidal) - print("Game.windMin = " .. Game.windMin) - print("Game.windMax = " .. Game.windMax) - print("Game.mapX = " .. Game.mapX) - print("Game.mapY = " .. Game.mapY) - print("Game.mapSizeX = " .. Game.mapSizeX) - print("Game.mapSizeZ = " .. Game.mapSizeZ) - print("Game.mapName = " .. Game.mapName) - print("Game.modName = " .. Game.modName) - print("Game.limitDGun = " .. tostring(Game.limitDGun)) - print("Game.Game.diminishingMetal = " .. tostring(Game.diminishingMetal)) - - PrintAllyTeamList() - PrintTeamList() - PrintPlayerList() - - PrintPlayerTree() - - PrintAlliedUnits() - - PrintSelection() - PrintGroups() - PrintInCommand() - print("UserName = " .. Spring.GetConfigString("name", "")) - print("Shadows = " .. Spring.GetConfigString("Shadows", 0)) - print("ReflectiveWater = " .. Spring.GetConfigString("ReflectiveWater", 1)) - - PrintTeamUnits(Spring.GetMyTeamID()) - - print("My Player Info:") - local myPlayerID = Spring.GetMyPlayerID() - PrintPlayerInfo(myPlayerID) - - PrintTeamUnitsCounts(Spring.GetMyTeamID()) + for i, v in pairs(UnitDefs) do + if v ~= nil then + print(i .. " " .. v.name) + end + end + for i, v in pairs(WeaponDefs) do + if v ~= nil then + print(i .. " " .. v.name) + end + end + + print("Game.version = " .. Engine.version) + print("Game.commEnds = " .. tostring(Game.commEnds)) + print("Game.gravity = " .. Game.gravity) + print("Game.tidal = " .. Game.tidal) + print("Game.windMin = " .. Game.windMin) + print("Game.windMax = " .. Game.windMax) + print("Game.mapX = " .. Game.mapX) + print("Game.mapY = " .. Game.mapY) + print("Game.mapSizeX = " .. Game.mapSizeX) + print("Game.mapSizeZ = " .. Game.mapSizeZ) + print("Game.mapName = " .. Game.mapName) + print("Game.modName = " .. Game.modName) + print("Game.limitDGun = " .. tostring(Game.limitDGun)) + print("Game.Game.diminishingMetal = " .. tostring(Game.diminishingMetal)) + + PrintAllyTeamList() + PrintTeamList() + PrintPlayerList() + + PrintPlayerTree() + + PrintAlliedUnits() + + PrintSelection() + PrintGroups() + PrintInCommand() + print("UserName = " .. Spring.GetConfigString("name", "")) + print("Shadows = " .. Spring.GetConfigString("Shadows", 0)) + print("ReflectiveWater = " .. Spring.GetConfigString("ReflectiveWater", 1)) + + PrintTeamUnits(Spring.GetMyTeamID()) + + print("My Player Info:") + local myPlayerID = Spring.GetMyPlayerID() + PrintPlayerInfo(myPlayerID) + + PrintTeamUnitsCounts(Spring.GetMyTeamID()) end - - diff --git a/luaui/i18nhelpers.lua b/luaui/i18nhelpers.lua index 0e00bd26d96..9239bcf825d 100644 --- a/luaui/i18nhelpers.lua +++ b/luaui/i18nhelpers.lua @@ -1,4 +1,4 @@ -local unitI18Nfile = VFS.LoadFile('language/en/units.json') +local unitI18Nfile = VFS.LoadFile("language/en/units.json") local unitI18Nlua = Json.decode(unitI18Nfile) local i18nDescriptionEntries = unitI18Nlua.units.descriptions @@ -12,18 +12,18 @@ local function refreshUnitDefs() local proxyUnitDef = UnitDefNames[proxyUnitDefName] proxyUnitDefName = proxyUnitDef and proxyUnitDef.customParams.i18nfromunit or proxyUnitDefName - local fromUnitHumanName = Spring.I18N('units.names.' .. proxyUnitDefName) - humanName = Spring.I18N('units.scavenger', { name = fromUnitHumanName }) + local fromUnitHumanName = Spring.I18N("units.names." .. proxyUnitDefName) + humanName = Spring.I18N("units.scavenger", { name = fromUnitHumanName }) - if (i18nDescriptionEntries[unitDefName]) then - tooltip = Spring.I18N('units.descriptions.' .. unitDefName) + if i18nDescriptionEntries[unitDefName] then + tooltip = Spring.I18N("units.descriptions." .. unitDefName) else - tooltip = Spring.I18N('units.descriptions.' .. proxyUnitDefName) + tooltip = Spring.I18N("units.descriptions." .. proxyUnitDefName) end else local proxyUnitDefName = unitDef.customParams.i18nfromunit or unitDefName - humanName = Spring.I18N('units.names.' .. proxyUnitDefName) - tooltip = Spring.I18N('units.descriptions.' .. proxyUnitDefName) + humanName = Spring.I18N("units.names." .. proxyUnitDefName) + tooltip = Spring.I18N("units.descriptions." .. proxyUnitDefName) end unitDef.translatedHumanName = humanName @@ -32,10 +32,10 @@ local function refreshUnitDefs() end local function setCorpseDescription(unitHumanName, featureDef) - if featureDef.customParams.category == 'corpses' then - featureDef.translatedDescription = Spring.I18N('units.dead', { name = unitHumanName }) - elseif featureDef.customParams.category == 'heaps' then - featureDef.translatedDescription = Spring.I18N('units.heap', { name = unitHumanName }) + if featureDef.customParams.category == "corpses" then + featureDef.translatedDescription = Spring.I18N("units.dead", { name = unitHumanName }) + elseif featureDef.customParams.category == "heaps" then + featureDef.translatedDescription = Spring.I18N("units.heap", { name = unitHumanName }) end end @@ -55,7 +55,7 @@ local function refreshFeatureDefs() for name, featureDef in pairs(FeatureDefNames) do if not processedFeatureDefs[featureDef.id] then local proxyName = featureDef.customParams.i18nfrom or name - featureDef.translatedDescription = Spring.I18N('features.names.' .. proxyName) + featureDef.translatedDescription = Spring.I18N("features.names." .. proxyName) end end end @@ -74,4 +74,4 @@ end return { RefreshDefs = refreshDefs, -} \ No newline at end of file +} diff --git a/luaui/images/decals_gl4/decalsgl4_atlas_diffuse.lua b/luaui/images/decals_gl4/decalsgl4_atlas_diffuse.lua index b11b25169d5..e5e2b5a8b3c 100644 --- a/luaui/images/decals_gl4/decalsgl4_atlas_diffuse.lua +++ b/luaui/images/decals_gl4/decalsgl4_atlas_diffuse.lua @@ -1,71 +1,90 @@ -- This file has been automatically generated by texture_atlas_builder.ipynb -- Do not edit this file! --- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size +-- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size local atlas = { atlasimage = "luaui/images/decals_gl4/decalsgl4_atlas_diffuse.dds", width = 4096, height = 4096, - flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end , - pad = function(t,p) for k,v in pairs(t) do if type(v) == "table" then p = p or 0.5; local px,py = p/t.width, p/t.height; v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py end end end , - getUVCoords = function(t, name) if t[name] then return t[name][1], t[name][2], t[name][3], t[name][4] else return 0,1,0,1 end end , - ["luaui/images/decals_gl4/footprints/f_armack_a.png"] = {0.03125,0.0625,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_armbanth_a.png"] = {0.0625,0.125,0.90625,0.9375,256,128}, - ["luaui/images/decals_gl4/footprints/f_armck_a.png"] = {0.03125,0.0625,0.90625,0.9375,128,128}, - ["luaui/images/decals_gl4/footprints/f_armcom_a.png"] = {0.0625,0.125,0.875,0.90625,256,128}, - ["luaui/images/decals_gl4/footprints/f_armfboy_a.png"] = {0.0625,0.125,0.84375,0.875,256,128}, - ["luaui/images/decals_gl4/footprints/f_armham_a.png"] = {0.03125,0.0625,0.875,0.90625,128,128}, - ["luaui/images/decals_gl4/footprints/f_armmar_a.png"] = {0.0625,0.125,0.8125,0.84375,256,128}, - ["luaui/images/decals_gl4/footprints/f_armmav_a.png"] = {0.03125,0.0625,0.84375,0.875,128,128}, - ["luaui/images/decals_gl4/footprints/f_armraz_a.png"] = {0.0625,0.125,0.78125,0.8125,256,128}, - ["luaui/images/decals_gl4/footprints/f_armrock_a.png"] = {0.03125,0.0625,0.8125,0.84375,128,128}, - ["luaui/images/decals_gl4/footprints/f_armvang_a.png"] = {0.03125,0.0625,0.78125,0.8125,128,128}, - ["luaui/images/decals_gl4/footprints/f_armwar_a.png"] = {0.03125,0.0625,0.75,0.78125,128,128}, - ["luaui/images/decals_gl4/footprints/f_armzeus_a.png"] = {0.03125,0.0625,0.71875,0.75,128,128}, - ["luaui/images/decals_gl4/footprints/f_clamp_a.png"] = {0.03125,0.0625,0.6875,0.71875,128,128}, - ["luaui/images/decals_gl4/footprints/f_coramph_a.png"] = {0.0625,0.125,0.75,0.78125,256,128}, - ["luaui/images/decals_gl4/footprints/f_corcan_a.png"] = {0.0625,0.125,0.71875,0.75,256,128}, - ["luaui/images/decals_gl4/footprints/f_corcat_a.png"] = {0.03125,0.0625,0.65625,0.6875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corck_a.png"] = {0.0,0.03125,0.65625,0.6875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corcom_a.png"] = {0.0625,0.125,0.6875,0.71875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corhrk_a.png"] = {0.0625,0.125,0.65625,0.6875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corjugg_a.png"] = {0.0625,0.125,0.625,0.65625,256,128}, - ["luaui/images/decals_gl4/footprints/f_corkorg_a.png"] = {0.0,0.0625,0.625,0.65625,256,128}, - ["luaui/images/decals_gl4/footprints/f_cormando_a.png"] = {0.0625,0.09375,0.96875,1.0,128,128}, - ["luaui/images/decals_gl4/footprints/f_corpyro_a.png"] = {0.125,0.1875,0.96875,1.0,256,128}, - ["luaui/images/decals_gl4/footprints/f_corshiva_a.png"] = {0.09375,0.125,0.96875,1.0,128,128}, - ["luaui/images/decals_gl4/footprints/f_corstorm_a.png"] = {0.125,0.1875,0.9375,0.96875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corsumo_a.png"] = {0.09375,0.125,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corthud_a.png"] = {0.0625,0.09375,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_raptor_a.tga"] = {0.1875,0.25,0.9375,1.0,256,256}, - ["luaui/images/decals_gl4/groundScars/F_armbanth_a.tga"] = {0.1875,0.25,0.875,0.9375,256,256}, - ["luaui/images/decals_gl4/groundScars/F_corkorg_a.tga"] = {0.125,0.1875,0.875,0.9375,256,256}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_01_a.tga"] = {0.125,0.25,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_03_a.tga"] = {0.125,0.25,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_04_a.tga"] = {0.25,0.375,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_05_a.tga"] = {0.25,0.375,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_06_a.tga"] = {0.25,0.375,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_07_a.tga"] = {0.375,0.5,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_08_a.tga"] = {0.375,0.5,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_09_a.tga"] = {0.5,1.0,0.0,0.5,2048,2048}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_10_a.tga"] = {0.375,0.5,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_11_a.tga"] = {0.375,0.5,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_12_a.tga"] = {0.25,0.375,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_13_a.tga"] = {0.125,0.25,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_14_a.tga"] = {0.0,0.125,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_15_a.tga"] = {0.5,0.625,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_16_a.tga"] = {0.625,0.75,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_17_a.tga"] = {0.625,0.75,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_18_a.tga"] = {0.5,0.625,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_19_a.tga"] = {0.75,0.875,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_20_a.tga"] = {0.75,0.875,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_21_a.tga"] = {0.0,0.5,0.0,0.5,2048,2048}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_22_a.tga"] = {0.75,0.875,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_23_a.tga"] = {0.5,0.75,0.5,0.75,1024,1024}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_24_a.tga"] = {0.875,1.0,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_25_a.tga"] = {0.875,1.0,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_26_a.tga"] = {0.875,1.0,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_27_a.tga"] = {0.875,1.0,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/testing/T_GroundCrack_00_a.png"] = {0.75,0.875,0.5,0.625,512,512}, - + flip = function(t) + for k, v in pairs(t) do + if type(v) == "table" then + v[3], v[4] = 1.0 - v[3], 1.0 - v[4] + end + end + end, + pad = function(t, p) + for k, v in pairs(t) do + if type(v) == "table" then + p = p or 0.5 + local px, py = p / t.width, p / t.height + v[1], v[2], v[3], v[4] = v[1] + px, v[2] - px, v[3] + py, v[4] - py + end + end + end, + getUVCoords = function(t, name) + if t[name] then + return t[name][1], t[name][2], t[name][3], t[name][4] + else + return 0, 1, 0, 1 + end + end, + ["luaui/images/decals_gl4/footprints/f_armack_a.png"] = { 0.03125, 0.0625, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armbanth_a.png"] = { 0.0625, 0.125, 0.90625, 0.9375, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armck_a.png"] = { 0.03125, 0.0625, 0.90625, 0.9375, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armcom_a.png"] = { 0.0625, 0.125, 0.875, 0.90625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armfboy_a.png"] = { 0.0625, 0.125, 0.84375, 0.875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armham_a.png"] = { 0.03125, 0.0625, 0.875, 0.90625, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armmar_a.png"] = { 0.0625, 0.125, 0.8125, 0.84375, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armmav_a.png"] = { 0.03125, 0.0625, 0.84375, 0.875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armraz_a.png"] = { 0.0625, 0.125, 0.78125, 0.8125, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armrock_a.png"] = { 0.03125, 0.0625, 0.8125, 0.84375, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armvang_a.png"] = { 0.03125, 0.0625, 0.78125, 0.8125, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armwar_a.png"] = { 0.03125, 0.0625, 0.75, 0.78125, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armzeus_a.png"] = { 0.03125, 0.0625, 0.71875, 0.75, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_clamp_a.png"] = { 0.03125, 0.0625, 0.6875, 0.71875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_coramph_a.png"] = { 0.0625, 0.125, 0.75, 0.78125, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcan_a.png"] = { 0.0625, 0.125, 0.71875, 0.75, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcat_a.png"] = { 0.03125, 0.0625, 0.65625, 0.6875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corck_a.png"] = { 0.0, 0.03125, 0.65625, 0.6875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcom_a.png"] = { 0.0625, 0.125, 0.6875, 0.71875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corhrk_a.png"] = { 0.0625, 0.125, 0.65625, 0.6875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corjugg_a.png"] = { 0.0625, 0.125, 0.625, 0.65625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corkorg_a.png"] = { 0.0, 0.0625, 0.625, 0.65625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_cormando_a.png"] = { 0.0625, 0.09375, 0.96875, 1.0, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corpyro_a.png"] = { 0.125, 0.1875, 0.96875, 1.0, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corshiva_a.png"] = { 0.09375, 0.125, 0.96875, 1.0, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corstorm_a.png"] = { 0.125, 0.1875, 0.9375, 0.96875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corsumo_a.png"] = { 0.09375, 0.125, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corthud_a.png"] = { 0.0625, 0.09375, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_raptor_a.tga"] = { 0.1875, 0.25, 0.9375, 1.0, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/F_armbanth_a.tga"] = { 0.1875, 0.25, 0.875, 0.9375, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/F_corkorg_a.tga"] = { 0.125, 0.1875, 0.875, 0.9375, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_01_a.tga"] = { 0.125, 0.25, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_03_a.tga"] = { 0.125, 0.25, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_04_a.tga"] = { 0.25, 0.375, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_05_a.tga"] = { 0.25, 0.375, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_06_a.tga"] = { 0.25, 0.375, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_07_a.tga"] = { 0.375, 0.5, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_08_a.tga"] = { 0.375, 0.5, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_09_a.tga"] = { 0.5, 1.0, 0.0, 0.5, 2048, 2048 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_10_a.tga"] = { 0.375, 0.5, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_11_a.tga"] = { 0.375, 0.5, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_12_a.tga"] = { 0.25, 0.375, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_13_a.tga"] = { 0.125, 0.25, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_14_a.tga"] = { 0.0, 0.125, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_15_a.tga"] = { 0.5, 0.625, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_16_a.tga"] = { 0.625, 0.75, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_17_a.tga"] = { 0.625, 0.75, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_18_a.tga"] = { 0.5, 0.625, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_19_a.tga"] = { 0.75, 0.875, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_20_a.tga"] = { 0.75, 0.875, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_21_a.tga"] = { 0.0, 0.5, 0.0, 0.5, 2048, 2048 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_22_a.tga"] = { 0.75, 0.875, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_23_a.tga"] = { 0.5, 0.75, 0.5, 0.75, 1024, 1024 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_24_a.tga"] = { 0.875, 1.0, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_25_a.tga"] = { 0.875, 1.0, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_26_a.tga"] = { 0.875, 1.0, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_27_a.tga"] = { 0.875, 1.0, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/testing/T_GroundCrack_00_a.png"] = { 0.75, 0.875, 0.5, 0.625, 512, 512 }, } return atlas diff --git a/luaui/images/decals_gl4/decalsgl4_atlas_normal.lua b/luaui/images/decals_gl4/decalsgl4_atlas_normal.lua index d7cece34195..7e330db99d4 100644 --- a/luaui/images/decals_gl4/decalsgl4_atlas_normal.lua +++ b/luaui/images/decals_gl4/decalsgl4_atlas_normal.lua @@ -1,71 +1,90 @@ -- This file has been automatically generated by texture_atlas_builder.ipynb -- Do not edit this file! --- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size +-- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size local atlas = { atlasimage = "luaui/images/decals_gl4/decalsgl4_atlas_normal.dds", width = 4096, height = 4096, - flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end , - pad = function(t,p) for k,v in pairs(t) do if type(v) == "table" then p = p or 0.5; local px,py = p/t.width, p/t.height; v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py end end end , - getUVCoords = function(t, name) if t[name] then return t[name][1], t[name][2], t[name][3], t[name][4] else return 0,1,0,1 end end , - ["luaui/images/decals_gl4/footprints/f_armack_n.png"] = {0.03125,0.0625,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_armbanth_n.png"] = {0.0625,0.125,0.90625,0.9375,256,128}, - ["luaui/images/decals_gl4/footprints/f_armck_n.png"] = {0.03125,0.0625,0.90625,0.9375,128,128}, - ["luaui/images/decals_gl4/footprints/f_armcom_n.png"] = {0.0625,0.125,0.875,0.90625,256,128}, - ["luaui/images/decals_gl4/footprints/f_armfboy_n.png"] = {0.0625,0.125,0.84375,0.875,256,128}, - ["luaui/images/decals_gl4/footprints/f_armham_n.png"] = {0.03125,0.0625,0.875,0.90625,128,128}, - ["luaui/images/decals_gl4/footprints/f_armmar_n.png"] = {0.0625,0.125,0.8125,0.84375,256,128}, - ["luaui/images/decals_gl4/footprints/f_armmav_n.png"] = {0.03125,0.0625,0.84375,0.875,128,128}, - ["luaui/images/decals_gl4/footprints/f_armraz_n.png"] = {0.0625,0.125,0.78125,0.8125,256,128}, - ["luaui/images/decals_gl4/footprints/f_armrock_n.png"] = {0.03125,0.0625,0.8125,0.84375,128,128}, - ["luaui/images/decals_gl4/footprints/f_armvang_n.png"] = {0.03125,0.0625,0.78125,0.8125,128,128}, - ["luaui/images/decals_gl4/footprints/f_armwar_n.png"] = {0.03125,0.0625,0.75,0.78125,128,128}, - ["luaui/images/decals_gl4/footprints/f_armzeus_n.png"] = {0.03125,0.0625,0.71875,0.75,128,128}, - ["luaui/images/decals_gl4/footprints/f_clamp_n.png"] = {0.03125,0.0625,0.6875,0.71875,128,128}, - ["luaui/images/decals_gl4/footprints/f_coramph_n.png"] = {0.0625,0.125,0.75,0.78125,256,128}, - ["luaui/images/decals_gl4/footprints/f_corcan_n.png"] = {0.0625,0.125,0.71875,0.75,256,128}, - ["luaui/images/decals_gl4/footprints/f_corcat_n.png"] = {0.03125,0.0625,0.65625,0.6875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corck_n.png"] = {0.0,0.03125,0.65625,0.6875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corcom_n.png"] = {0.0625,0.125,0.6875,0.71875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corhrk_n.png"] = {0.0625,0.125,0.65625,0.6875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corjugg_n.png"] = {0.0625,0.125,0.625,0.65625,256,128}, - ["luaui/images/decals_gl4/footprints/f_corkorg_n.png"] = {0.0,0.0625,0.625,0.65625,256,128}, - ["luaui/images/decals_gl4/footprints/f_cormando_n.png"] = {0.0625,0.09375,0.96875,1.0,128,128}, - ["luaui/images/decals_gl4/footprints/f_corpyro_n.png"] = {0.125,0.1875,0.96875,1.0,256,128}, - ["luaui/images/decals_gl4/footprints/f_corshiva_n.png"] = {0.09375,0.125,0.96875,1.0,128,128}, - ["luaui/images/decals_gl4/footprints/f_corstorm_n.png"] = {0.125,0.1875,0.9375,0.96875,256,128}, - ["luaui/images/decals_gl4/footprints/f_corsumo_n.png"] = {0.09375,0.125,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_corthud_n.png"] = {0.0625,0.09375,0.9375,0.96875,128,128}, - ["luaui/images/decals_gl4/footprints/f_raptor_n.tga"] = {0.1875,0.25,0.9375,1.0,256,256}, - ["luaui/images/decals_gl4/groundScars/F_armbanth_n.tga"] = {0.1875,0.25,0.875,0.9375,256,256}, - ["luaui/images/decals_gl4/groundScars/F_corkorg_n.tga"] = {0.125,0.1875,0.875,0.9375,256,256}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_01_n.tga"] = {0.125,0.25,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_03_n.tga"] = {0.125,0.25,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_04_n.tga"] = {0.25,0.375,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_05_n.tga"] = {0.25,0.375,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_06_n.tga"] = {0.25,0.375,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_07_n.tga"] = {0.375,0.5,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_08_n.tga"] = {0.375,0.5,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_09_n.tga"] = {0.5,1.0,0.0,0.5,2048,2048}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_10_n.tga"] = {0.375,0.5,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_11_n.tga"] = {0.375,0.5,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_12_n.tga"] = {0.25,0.375,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_13_n.tga"] = {0.125,0.25,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_14_n.tga"] = {0.0,0.125,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_15_n.tga"] = {0.5,0.625,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_16_n.tga"] = {0.625,0.75,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_17_n.tga"] = {0.625,0.75,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_18_n.tga"] = {0.5,0.625,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_19_n.tga"] = {0.75,0.875,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_20_n.tga"] = {0.75,0.875,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_21_n.tga"] = {0.0,0.5,0.0,0.5,2048,2048}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_22_n.tga"] = {0.75,0.875,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_23_n.tga"] = {0.5,0.75,0.5,0.75,1024,1024}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_24_n.tga"] = {0.875,1.0,0.875,1.0,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_25_n.tga"] = {0.875,1.0,0.75,0.875,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_26_n.tga"] = {0.875,1.0,0.625,0.75,512,512}, - ["luaui/images/decals_gl4/groundScars/T_GroundCrack_27_n.tga"] = {0.875,1.0,0.5,0.625,512,512}, - ["luaui/images/decals_gl4/testing/T_GroundCrack_00_n.png"] = {0.75,0.875,0.5,0.625,512,512}, - + flip = function(t) + for k, v in pairs(t) do + if type(v) == "table" then + v[3], v[4] = 1.0 - v[3], 1.0 - v[4] + end + end + end, + pad = function(t, p) + for k, v in pairs(t) do + if type(v) == "table" then + p = p or 0.5 + local px, py = p / t.width, p / t.height + v[1], v[2], v[3], v[4] = v[1] + px, v[2] - px, v[3] + py, v[4] - py + end + end + end, + getUVCoords = function(t, name) + if t[name] then + return t[name][1], t[name][2], t[name][3], t[name][4] + else + return 0, 1, 0, 1 + end + end, + ["luaui/images/decals_gl4/footprints/f_armack_n.png"] = { 0.03125, 0.0625, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armbanth_n.png"] = { 0.0625, 0.125, 0.90625, 0.9375, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armck_n.png"] = { 0.03125, 0.0625, 0.90625, 0.9375, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armcom_n.png"] = { 0.0625, 0.125, 0.875, 0.90625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armfboy_n.png"] = { 0.0625, 0.125, 0.84375, 0.875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armham_n.png"] = { 0.03125, 0.0625, 0.875, 0.90625, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armmar_n.png"] = { 0.0625, 0.125, 0.8125, 0.84375, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armmav_n.png"] = { 0.03125, 0.0625, 0.84375, 0.875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armraz_n.png"] = { 0.0625, 0.125, 0.78125, 0.8125, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_armrock_n.png"] = { 0.03125, 0.0625, 0.8125, 0.84375, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armvang_n.png"] = { 0.03125, 0.0625, 0.78125, 0.8125, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armwar_n.png"] = { 0.03125, 0.0625, 0.75, 0.78125, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_armzeus_n.png"] = { 0.03125, 0.0625, 0.71875, 0.75, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_clamp_n.png"] = { 0.03125, 0.0625, 0.6875, 0.71875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_coramph_n.png"] = { 0.0625, 0.125, 0.75, 0.78125, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcan_n.png"] = { 0.0625, 0.125, 0.71875, 0.75, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcat_n.png"] = { 0.03125, 0.0625, 0.65625, 0.6875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corck_n.png"] = { 0.0, 0.03125, 0.65625, 0.6875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corcom_n.png"] = { 0.0625, 0.125, 0.6875, 0.71875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corhrk_n.png"] = { 0.0625, 0.125, 0.65625, 0.6875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corjugg_n.png"] = { 0.0625, 0.125, 0.625, 0.65625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corkorg_n.png"] = { 0.0, 0.0625, 0.625, 0.65625, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_cormando_n.png"] = { 0.0625, 0.09375, 0.96875, 1.0, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corpyro_n.png"] = { 0.125, 0.1875, 0.96875, 1.0, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corshiva_n.png"] = { 0.09375, 0.125, 0.96875, 1.0, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corstorm_n.png"] = { 0.125, 0.1875, 0.9375, 0.96875, 256, 128 }, + ["luaui/images/decals_gl4/footprints/f_corsumo_n.png"] = { 0.09375, 0.125, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_corthud_n.png"] = { 0.0625, 0.09375, 0.9375, 0.96875, 128, 128 }, + ["luaui/images/decals_gl4/footprints/f_raptor_n.tga"] = { 0.1875, 0.25, 0.9375, 1.0, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/F_armbanth_n.tga"] = { 0.1875, 0.25, 0.875, 0.9375, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/F_corkorg_n.tga"] = { 0.125, 0.1875, 0.875, 0.9375, 256, 256 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_01_n.tga"] = { 0.125, 0.25, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_03_n.tga"] = { 0.125, 0.25, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_04_n.tga"] = { 0.25, 0.375, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_05_n.tga"] = { 0.25, 0.375, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_06_n.tga"] = { 0.25, 0.375, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_07_n.tga"] = { 0.375, 0.5, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_08_n.tga"] = { 0.375, 0.5, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_09_n.tga"] = { 0.5, 1.0, 0.0, 0.5, 2048, 2048 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_10_n.tga"] = { 0.375, 0.5, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_11_n.tga"] = { 0.375, 0.5, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_12_n.tga"] = { 0.25, 0.375, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_13_n.tga"] = { 0.125, 0.25, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_14_n.tga"] = { 0.0, 0.125, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_15_n.tga"] = { 0.5, 0.625, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_16_n.tga"] = { 0.625, 0.75, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_17_n.tga"] = { 0.625, 0.75, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_18_n.tga"] = { 0.5, 0.625, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_19_n.tga"] = { 0.75, 0.875, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_20_n.tga"] = { 0.75, 0.875, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_21_n.tga"] = { 0.0, 0.5, 0.0, 0.5, 2048, 2048 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_22_n.tga"] = { 0.75, 0.875, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_23_n.tga"] = { 0.5, 0.75, 0.5, 0.75, 1024, 1024 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_24_n.tga"] = { 0.875, 1.0, 0.875, 1.0, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_25_n.tga"] = { 0.875, 1.0, 0.75, 0.875, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_26_n.tga"] = { 0.875, 1.0, 0.625, 0.75, 512, 512 }, + ["luaui/images/decals_gl4/groundScars/T_GroundCrack_27_n.tga"] = { 0.875, 1.0, 0.5, 0.625, 512, 512 }, + ["luaui/images/decals_gl4/testing/T_GroundCrack_00_n.png"] = { 0.75, 0.875, 0.5, 0.625, 512, 512 }, } return atlas diff --git a/luaui/layout.lua b/luaui/layout.lua index dd9f85f96fc..a63071a02e4 100644 --- a/luaui/layout.lua +++ b/luaui/layout.lua @@ -23,13 +23,13 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local function CopyTable(outtable,intable) - for i,v in pairs(intable) do - if (type(v)=='table') then - if (type(outtable[i])~='table') then +local function CopyTable(outtable, intable) + for i, v in pairs(intable) do + if type(v) == "table" then + if type(outtable[i]) ~= "table" then outtable[i] = {} end - CopyTable(outtable[i],v) + CopyTable(outtable[i], v) else outtable[i] = v end @@ -40,7 +40,7 @@ end -- No longer used for UI, but necessary for custom commands to function properly local function DummyLayoutHandler(xIcons, yIcons, cmdCount, commands) - widgetHandler.commands = commands + widgetHandler.commands = commands widgetHandler.commands.n = cmdCount widgetHandler:CommandsChanged() local reParamsCmds = {} @@ -48,42 +48,41 @@ local function DummyLayoutHandler(xIcons, yIcons, cmdCount, commands) local cnt = 0 local AddCommand = function(command) local cc = {} - CopyTable(cc,command ) + CopyTable(cc, command) cnt = cnt + 1 - cc.cmdDescID = cmdCount+cnt - if (cc.params) then - if (not cc.actions) then --// workaround for params + cc.cmdDescID = cmdCount + cnt + if cc.params then + if not cc.actions then --// workaround for params local params = cc.params - for i=1,#params+1 do - params[i-1] = params[i] + for i = 1, #params + 1 do + params[i - 1] = params[i] end cc.actions = params end reParamsCmds[cc.cmdDescID] = cc.params end --// remove api keys (custom keys are prohibited in the engine handler) - cc.pos = nil + cc.pos = nil cc.cmdDescID = nil - cc.params = nil - customCmds[#customCmds+1] = cc + cc.params = nil + customCmds[#customCmds + 1] = cc end --// preprocess the Custom Commands - for i=1,#widgetHandler.customCommands do + for i = 1, #widgetHandler.customCommands do AddCommand(widgetHandler.customCommands[i]) end - if (cmdCount <= 0) then + if cmdCount <= 0 then return "", xIcons, yIcons, {}, customCmds, {}, {}, {}, {}, reParamsCmds, {} --prevent CommandChanged() from being called twice when deselecting all units (copied from ca_layout.lua) end - return "", xIcons, yIcons, {}, customCmds, {}, {}, {}, {}, reParamsCmds, {[1337]=9001} + return "", xIcons, yIcons, {}, customCmds, {}, {}, {}, {}, reParamsCmds, { [1337] = 9001 } end - function ConfigLayoutHandler(data) - if (type(data) == 'function') then + if type(data) == "function" then LayoutButtons = data - elseif (data == nil) then + elseif data == nil then LayoutButtons = nil else LayoutButtons = DummyLayoutHandler @@ -91,7 +90,5 @@ function ConfigLayoutHandler(data) end LayoutButtons = DummyLayoutHandler - -- refresh, this prevents default engine buildmenu still showing up after a luaui reload Spring.ForceLayoutUpdate() - diff --git a/luaui/main.lua b/luaui/main.lua index 2ef5ec6f1c3..d0b51ae249e 100644 --- a/luaui/main.lua +++ b/luaui/main.lua @@ -19,21 +19,21 @@ spSendCommands("ctrlpanel " .. LUAUI_DIRNAME .. "ctrlpanel.txt") VFS.Include("init.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "rml_setup.lua", nil, VFS.ZIP) -Spring.I18N.setLanguage( Spring.GetConfigString('language', 'en') ) - -VFS.Include(LUAUI_DIRNAME .. "utils.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "setupdefs.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "savetable.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "debug.lua", nil, VFS.ZIP) -VFS.Include(LUAUI_DIRNAME .. "layout.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "rml_setup.lua", nil, VFS.ZIP) +Spring.I18N.setLanguage(Spring.GetConfigString("language", "en")) + +VFS.Include(LUAUI_DIRNAME .. "utils.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "setupdefs.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "savetable.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "debug.lua", nil, VFS.ZIP) +VFS.Include(LUAUI_DIRNAME .. "layout.lua", nil, VFS.ZIP) VFS.Include(LUAUI_DIRNAME .. "barwidgets.lua", nil, VFS.ZIP) -------------------------------------------------------------------------------- ------------------------------------------------------------------------------- function Say(msg) - spSendCommands('say ' .. msg) + spSendCommands("say " .. msg) end ------------------------------------------------------------------------------- @@ -45,7 +45,6 @@ function Update() return end - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- @@ -141,12 +140,9 @@ function GroupChanged(groupID) return widgetHandler:GroupChanged(groupID) end - -- -- The unit (and some of the Draw) call-ins are handled -- differently (see LuaUI/widgets.lua / UpdateCallIns()) -- - -------------------------------------------------------------------------------- - diff --git a/luaui/rml_setup.lua b/luaui/rml_setup.lua index b5c9dfc20e4..78c296167d7 100644 --- a/luaui/rml_setup.lua +++ b/luaui/rml_setup.lua @@ -5,7 +5,7 @@ -- Copyright (C) 2024. -- Licensed under the terms of the GNU GPL, v2 or later. -if (RmlGuard or not RmlUi) then +if RmlGuard or not RmlUi then return end -- don't allow this initialization code to be run multiple times @@ -55,7 +55,7 @@ RmlUi.CreateContext = NewCreateContext -- Load fonts RmlUi.LoadFontFace("fonts/Poppins-Regular.otf", true) -local font_files = VFS.DirList('fonts/exo2', '*.ttf') +local font_files = VFS.DirList("fonts/exo2", "*.ttf") for _, file in ipairs(font_files) do Spring.Echo("loading font", file) RmlUi.LoadFontFace(file, true) @@ -73,12 +73,12 @@ end ]] -- when "cursor: normal" is set via RCSS, "cursornormal" will be sent to the engine... and so on for the rest -RmlUi.SetMouseCursorAlias("default", 'cursornormal') -RmlUi.SetMouseCursorAlias("pointer", 'Move') -- command cursors use the command name. TODO: replace with actual pointer cursor? -RmlUi.SetMouseCursorAlias("move", 'uimove') -RmlUi.SetMouseCursorAlias("nesw-resize", 'uiresized2') -RmlUi.SetMouseCursorAlias("nwse-resize", 'uiresized1') -RmlUi.SetMouseCursorAlias("ns-resize", 'uiresizev') -RmlUi.SetMouseCursorAlias("ew-resize", 'uiresizeh') +RmlUi.SetMouseCursorAlias("default", "cursornormal") +RmlUi.SetMouseCursorAlias("pointer", "Move") -- command cursors use the command name. TODO: replace with actual pointer cursor? +RmlUi.SetMouseCursorAlias("move", "uimove") +RmlUi.SetMouseCursorAlias("nesw-resize", "uiresized2") +RmlUi.SetMouseCursorAlias("nwse-resize", "uiresized1") +RmlUi.SetMouseCursorAlias("ns-resize", "uiresizev") +RmlUi.SetMouseCursorAlias("ew-resize", "uiresizeh") RmlUi.CreateContext("shared") diff --git a/luaui/savetable.lua b/luaui/savetable.lua index ce2fdea01b6..ab4151fed94 100644 --- a/luaui/savetable.lua +++ b/luaui/savetable.lua @@ -11,159 +11,174 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (table.save) then - return +if table.save then + return end -local indentString = '\t' +local indentString = "\t" local savedTables = {} -- setup a lua keyword map local keyWords = { - "and", "break", "do", "else", "elseif", "end", "false", "for", "function", - "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", - "until", "while" + "and", + "break", + "do", + "else", + "elseif", + "end", + "false", + "for", + "function", + "if", + "in", + "local", + "nil", + "not", + "or", + "repeat", + "return", + "then", + "true", + "until", + "while", } local keyWordSet = {} -for _,w in ipairs(keyWords) do - keyWordSet[w] = true +for _, w in ipairs(keyWords) do + keyWordSet[w] = true end -keyWords = nil -- don't need the array anymore - +keyWords = nil -- don't need the array anymore -------------------------------------------------------------------------------- local function encloseStr(s) - return string.format('%q', s) + return string.format("%q", s) end - local function encloseKey(s) - local wrap = not (string.find(s, '^%a[_%a%d]*$')) - if (not wrap) then - if (string.len(s) <= 0) then wrap = true end - end - if (not wrap) then - if (keyWordSet[s]) then wrap = true end - end - - if (wrap) then - return string.format('[%q]', s) - else - return s - end + local wrap = not (string.find(s, "^%a[_%a%d]*$")) + if not wrap then + if string.len(s) <= 0 then + wrap = true + end + end + if not wrap then + if keyWordSet[s] then + wrap = true + end + end + + if wrap then + return string.format("[%q]", s) + else + return s + end end - local keyTypes = { - ['string'] = true, - ['number'] = true, - ['boolean'] = true, + ["string"] = true, + ["number"] = true, + ["boolean"] = true, } local valueTypes = { - ['string'] = true, - ['number'] = true, - ['boolean'] = true, - ['table'] = true, + ["string"] = true, + ["number"] = true, + ["boolean"] = true, + ["table"] = true, } - local function CompareKeys(kv1, kv2) - local k1, v1 = kv1[1], kv1[2] - local k2, v2 = kv2[1], kv2[2] - - local ktype1 = type(k1) - local ktype2 = type(k2) - if (ktype1 ~= ktype2) then - return (ktype1 > ktype2) - end - - local vtype1 = type(v1) - local vtype2 = type(v2) - if ((vtype1 == 'table') and (vtype2 ~= 'table')) then - return false - end - if ((vtype1 ~= 'table') and (vtype2 == 'table')) then - return true - end - - return (k1 < k2) + local k1, v1 = kv1[1], kv1[2] + local k2, v2 = kv2[1], kv2[2] + + local ktype1 = type(k1) + local ktype2 = type(k2) + if ktype1 ~= ktype2 then + return (ktype1 > ktype2) + end + + local vtype1 = type(v1) + local vtype2 = type(v2) + if (vtype1 == "table") and (vtype2 ~= "table") then + return false + end + if (vtype1 ~= "table") and (vtype2 == "table") then + return true + end + + return (k1 < k2) end - local function MakeSortedTable(t) - local st = {} - for k,v in pairs(t) do - if (keyTypes[type(k)] and valueTypes[type(v)]) then - table.insert(st, { k, v }) - end - end - table.sort(st, CompareKeys) - return st + local st = {} + for k, v in pairs(t) do + if keyTypes[type(k)] and valueTypes[type(v)] then + table.insert(st, { k, v }) + end + end + table.sort(st, CompareKeys) + return st end - local function SaveTable(t, file, indent) - file:write('{\n') - local indent = indent .. indentString - - local st = MakeSortedTable(t) - - for _,kv in ipairs(st) do - local k, v = kv[1], kv[2] - local ktype = type(k) - local vtype = type(v) - -- output the key - if (ktype == 'string') then - file:write(indent..encloseKey(k)..' = ') - else - file:write(indent..'['..tostring(k)..'] = ') - end - -- output the value - if (vtype == 'string') then - file:write(encloseStr(v)..',\n') - elseif (vtype == 'number') then - if (v == math.huge) then - file:write('math.huge,\n') - elseif (v == -math.huge) then - file:write('-math.huge,\n') - else - file:write(tostring(v)..',\n') - end - elseif (vtype == 'boolean') then - file:write(tostring(v)..',\n') - elseif (vtype == 'table') then - if (savedTables[v]) then - error("table.save() does not support recursive tables") - end - if (next(v)) then - savedTables[t] = true - SaveTable(v, file, indent) - file:write(indent..'},\n') - savedTables[t] = nil - else - file:write('{},\n') -- empty table - end - end - end + file:write("{\n") + local indent = indent .. indentString + + local st = MakeSortedTable(t) + + for _, kv in ipairs(st) do + local k, v = kv[1], kv[2] + local ktype = type(k) + local vtype = type(v) + -- output the key + if ktype == "string" then + file:write(indent .. encloseKey(k) .. " = ") + else + file:write(indent .. "[" .. tostring(k) .. "] = ") + end + -- output the value + if vtype == "string" then + file:write(encloseStr(v) .. ",\n") + elseif vtype == "number" then + if v == math.huge then + file:write("math.huge,\n") + elseif v == -math.huge then + file:write("-math.huge,\n") + else + file:write(tostring(v) .. ",\n") + end + elseif vtype == "boolean" then + file:write(tostring(v) .. ",\n") + elseif vtype == "table" then + if savedTables[v] then + error("table.save() does not support recursive tables") + end + if next(v) then + savedTables[t] = true + SaveTable(v, file, indent) + file:write(indent .. "},\n") + savedTables[t] = nil + else + file:write("{},\n") -- empty table + end + end + end end - function table.save(t, filename, header) - local file = io.open(filename, 'w') - if (file == nil) then - return - end - if (header) then - file:write(header..'\n') - end - file:write('return ') - SaveTable(t, file, '') - file:write('}\n') - file:close() - for k,v in pairs(savedTables) do - savedTables[k] = nil - end + local file = io.open(filename, "w") + if file == nil then + return + end + if header then + file:write(header .. "\n") + end + file:write("return ") + SaveTable(t, file, "") + file:write("}\n") + file:close() + for k, v in pairs(savedTables) do + savedTables[k] = nil + end end diff --git a/luaui/setupdefs.lua b/luaui/setupdefs.lua index f04aa588680..58737d2badb 100644 --- a/luaui/setupdefs.lua +++ b/luaui/setupdefs.lua @@ -12,24 +12,32 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -for _,ud in pairs(UnitDefs) do +for _, ud in pairs(UnitDefs) do -- set the cost value (same as shown in the tooltip) ud.cost = ud.metalCost + (ud.energyCost / 60.0) -- add the custom weapons based parameters - ud.hasShield = false - ud.canParalyze = false - ud.canStockpile = false + ud.hasShield = false + ud.canParalyze = false + ud.canStockpile = false ud.canAttackWater = false ud.wDefs = {} for i, wt in ipairs(ud.weapons) do local wd = WeaponDefs[wt.weaponDef] ud.wDefs[i] = wd - if (wd) then - if (wd.isShield) then ud.hasShield = true end - if (wd.paralyzer) then ud.canParalyze = true end - if (wd.stockpile) then ud.canStockpile = true end - if (wd.waterWeapon) then ud.canAttackWater = true end + if wd then + if wd.isShield then + ud.hasShield = true + end + if wd.paralyzer then + ud.canParalyze = true + end + if wd.stockpile then + ud.canStockpile = true + end + if wd.waterWeapon then + ud.canAttackWater = true + end end end end @@ -40,7 +48,7 @@ end -- setup the UnitDefNames{} table do local tbl = {} - for _,def in pairs(UnitDefs) do + for _, def in pairs(UnitDefs) do tbl[def.name] = def end UnitDefNames = tbl @@ -49,7 +57,7 @@ end -- setup the FeatureDefNames{} table do local tbl = {} - for _,def in pairs(FeatureDefs) do + for _, def in pairs(FeatureDefs) do tbl[def.name] = def end FeatureDefNames = tbl @@ -58,7 +66,7 @@ end -- setup the WeaponDefNames{} table do local tbl = {} - for _,def in pairs(WeaponDefs) do + for _, def in pairs(WeaponDefs) do tbl[def.name] = def end WeaponDefNames = tbl @@ -69,5 +77,5 @@ end -- Run I18N initialization here in case any widgets try to look up unit names/descriptions outside of callins -- as that will happen before the gui_language widget gets a chance to run. -local i18nDefs = VFS.Include('luaui/i18nhelpers.lua') -i18nDefs.RefreshDefs() \ No newline at end of file +local i18nDefs = VFS.Include("luaui/i18nhelpers.lua") +i18nDefs.RefreshDefs() diff --git a/luaui/system.lua b/luaui/system.lua index 6096b844806..d75a40ec2f6 100644 --- a/luaui/system.lua +++ b/luaui/system.lua @@ -11,18 +11,28 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - - -if (System == nil) then +if System == nil then if tracy == nil then Spring.Echo("Tracy: No support detected, replacing tracy.* with function stubs.") tracy = {} - tracy.ZoneBeginN = function () return end - tracy.ZoneBegin = function () return end - tracy.ZoneEnd = function () return end --Spring.Echo("No Tracy") return end - tracy.Message = function () return end - tracy.ZoneName = function () return end - tracy.ZoneText = function () return end + tracy.ZoneBeginN = function() + return + end + tracy.ZoneBegin = function() + return + end + tracy.ZoneEnd = function() + return + end --Spring.Echo("No Tracy") return end + tracy.Message = function() + return + end + tracy.ZoneName = function() + return + end + tracy.ZoneText = function() + return + end end System = { @@ -49,12 +59,12 @@ if (System == nil) then CMDTYPE = CMDTYPE, LOG = LOG, - UnitDefs = UnitDefs, - UnitDefNames = UnitDefNames, - FeatureDefs = FeatureDefs, + UnitDefs = UnitDefs, + UnitDefNames = UnitDefNames, + FeatureDefs = FeatureDefs, FeatureDefNames = FeatureDefNames, - WeaponDefs = WeaponDefs, - WeaponDefNames = WeaponDefNames, + WeaponDefs = WeaponDefs, + WeaponDefNames = WeaponDefNames, -- -- Standard libraries @@ -75,50 +85,50 @@ if (System == nil) then RmlUi = RmlUi, -- luasocket - socket = socket, + socket = socket, -- -- Standard functions and variables -- - assert = assert, - error = error, + assert = assert, + error = error, - print = print, + print = print, - next = next, - pairs = pairs, - pairsByKeys = pairsByKeys, -- custom: defined in `common\tablefunctions.lua` - ipairs = ipairs, + next = next, + pairs = pairs, + pairsByKeys = pairsByKeys, -- custom: defined in `common\tablefunctions.lua` + ipairs = ipairs, - tonumber = tonumber, - tostring = tostring, - type = type, + tonumber = tonumber, + tostring = tostring, + type = type, collectgarbage = collectgarbage, - gcinfo = gcinfo, + gcinfo = gcinfo, - unpack = unpack, - select = select, + unpack = unpack, + select = select, - dofile = dofile, - loadfile = loadfile, - loadlib = loadlib, - loadstring = loadstring, - require = require, + dofile = dofile, + loadfile = loadfile, + loadlib = loadlib, + loadstring = loadstring, + require = require, - getmetatable = getmetatable, - setmetatable = setmetatable, + getmetatable = getmetatable, + setmetatable = setmetatable, - rawequal = rawequal, - rawget = rawget, - rawset = rawset, + rawequal = rawequal, + rawget = rawget, + rawset = rawset, - getfenv = getfenv, - setfenv = setfenv, + getfenv = getfenv, + setfenv = setfenv, - pcall = pcall, - xpcall = xpcall, + pcall = pcall, + xpcall = xpcall, - _VERSION = _VERSION + _VERSION = _VERSION, } end diff --git a/luaui/utils.lua b/luaui/utils.lua index 922bf7df2a9..913b37378de 100644 --- a/luaui/utils.lua +++ b/luaui/utils.lua @@ -11,48 +11,45 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -if (UtilsGuard) then - return +if UtilsGuard then + return end UtilsGuard = true - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function Say(msg) - Spring.SendCommands({'say ' .. msg}) + Spring.SendCommands({ "say " .. msg }) end - function SendCommand(msg) - Spring.SendCommands({msg}) + Spring.SendCommands({ msg }) end - -------------------------------------------------------------------------------- -- -- returns: basename, dirname -- function Basename(fullpath) - local _,_,base = string.find(fullpath, "([^\\/:]*)$") - local _,_,path = string.find(fullpath, "(.*[\\/:])[^\\/:]*$") - if (path == nil) then path = "" end - return base, path + local _, _, base = string.find(fullpath, "([^\\/:]*)$") + local _, _, path = string.find(fullpath, "(.*[\\/:])[^\\/:]*$") + if path == nil then + path = "" + end + return base, path end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function include(filename, envTable) - if (string.find(filename, '.h.lua', 1, true)) then - filename = 'Headers/' .. filename - end - return VFS.Include(LUAUI_DIRNAME .. filename, envTable) + if string.find(filename, ".h.lua", 1, true) then + filename = "Headers/" .. filename + end + return VFS.Include(LUAUI_DIRNAME .. filename, envTable) end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/modelmaterials/001_units_s3o_assimp.lua b/modelmaterials/001_units_s3o_assimp.lua index fe57675874b..4206c7f262f 100644 --- a/modelmaterials/001_units_s3o_assimp.lua +++ b/modelmaterials/001_units_s3o_assimp.lua @@ -1,7 +1,7 @@ local matTemplate = VFS.Include("ModelMaterials/Templates/defaultMaterialTemplate.lua") local unitsNormalMapTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%UNITDEFID:0", [1] = "%%UNITDEFID:1", [2] = "%NORMALTEX", @@ -62,7 +62,7 @@ local GL_INT = 0x1404 -- args= local mySetMaterialUniform = { [false] = Spring.UnitRendering.SetForwardMaterialUniform, - [true] = Spring.UnitRendering.SetDeferredMaterialUniform, + [true] = Spring.UnitRendering.SetDeferredMaterialUniform, } local armTanks = {} @@ -71,7 +71,7 @@ local raptorUnits = {} local otherUnits = {} local spGetUnitHealth = Spring.GetUnitHealth local unitsHealth = {} --cache -local healthArray = {[1] = 0.0} +local healthArray = { [1] = 0.0 } local function SendHealthInfo(unitID, unitDefID, hasStd, hasDef, hasShad) local h, mh = spGetUnitHealth(unitID) @@ -95,7 +95,7 @@ local function SendHealthInfo(unitID, unitDefID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[0]", GL_FLOAT, healthArray) @@ -105,7 +105,7 @@ end local healthMod = {} --cache local vertDisp = {} --cache -local vdhmArray = {[1] = 0.0, [2] = 0.0} +local vdhmArray = { [1] = 0.0, [2] = 0.0 } local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasShad) -- fill caches, if empty if not healthMod[unitDefID] then @@ -125,7 +125,7 @@ local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasSha mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) @@ -133,14 +133,14 @@ local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasSha end end -local uidArray = {[1] = 0} +local uidArray = { [1] = 0 } local function SendUnitID(unitID, hasStd, hasDef, hasShad) uidArray[1] = unitID if hasStd then mySetMaterialUniform[false](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "intOptions[0]", GL_INT, uidArray) @@ -151,7 +151,7 @@ local spGetUnitVelocity = Spring.GetUnitVelocity local spGetUnitDirection = Spring.GetUnitDirection local floor = math.floor local treadSpeeds = {} --cache -local treadsArray = {[1] = 0.0} +local treadsArray = { [1] = 0.0 } local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) if not treadSpeeds[unitID] then @@ -166,7 +166,7 @@ local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) end local udx, udy, udz = spGetUnitDirection(unitID) - if udx > 0 and usx < 0 or udx < 0 and usx > 0 or udz > 0 and usz < 0 or udz < 0 and usz > 0 then + if udx > 0 and usx < 0 or udx < 0 and usx > 0 or udz > 0 and usz < 0 or udz < 0 and usz > 0 then speed = -speed end @@ -177,14 +177,15 @@ local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end --[[ -- tank tracks usually don't contribute much to shadows look if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end - ]]-- + ]] + -- end end @@ -224,7 +225,7 @@ end local materials = { unitsNormalMapArmTanks = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", @@ -236,15 +237,21 @@ local materials = { treads_arm = true, materialIndex = 1, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(armTanks, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(armTanks, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(armTanks, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(armTanks, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(true, armTanks, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(true, armTanks, gf, mat) + end, UnitDamaged = UnitDamaged, }), unitsNormalMapCorTanks = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", @@ -256,28 +263,39 @@ local materials = { treads_core = true, materialIndex = 2, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(corTanks, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(corTanks, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(corTanks, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(corTanks, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(true, corTanks, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(true, corTanks, gf, mat) + end, UnitDamaged = UnitDamaged, }), unitsNormalMapOthersArmCor = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", }, - shaderOptions = { - }, + shaderOptions = {}, deferredOptions = { materialIndex = 3, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(otherUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(otherUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(otherUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(otherUnits, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(false, otherUnits, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(false, otherUnits, gf, mat) + end, UnitDamaged = UnitDamaged, }), @@ -299,8 +317,12 @@ local materials = { }, -- are these below required? - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(otherUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(otherUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(otherUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(otherUnits, unitID, unitDefID) + end, --GameFrame = function (gf, mat) GameFrame(false, otherUnits, gf, mat) end, @@ -331,10 +353,16 @@ local materials = { }, -- are these below required? - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(raptorUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(raptorUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(raptorUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(raptorUnits, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(false, raptorUnits, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(false, raptorUnits, gf, mat) + end, UnitDamaged = UnitDamaged, }), @@ -365,7 +393,6 @@ for id = 1, #UnitDefs do local udef = UnitDefs[id] if not cusUnitMaterials[id] and udef.modeltype == "s3o" then - local udefCM = udef.customParams local udefName = udef.name or "" @@ -377,18 +404,18 @@ for id = 1, #UnitDefs do if udef.modCategories["tank"] then if facName == "arm" then - unitMaterials[id] = {"unitsNormalMapArmTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapArmTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } elseif facName == "cor" then - unitMaterials[id] = {"unitsNormalMapCorTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapCorTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } end else if wreckAtlas then - unitMaterials[id] = {"unitsNormalMapOthersArmCor", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapOthersArmCor", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } else if facName == "rap" then - unitMaterials[id] = {"unitsNormalMapRaptors", NORMALTEX = normalTex} + unitMaterials[id] = { "unitsNormalMapRaptors", NORMALTEX = normalTex } else - unitMaterials[id] = {"unitsNormalMapOthers", NORMALTEX = normalTex} + unitMaterials[id] = { "unitsNormalMapOthers", NORMALTEX = normalTex } end end end diff --git a/modelmaterials/128_features_special.lua b/modelmaterials/128_features_special.lua index 6a10f748725..dea1403b559 100644 --- a/modelmaterials/128_features_special.lua +++ b/modelmaterials/128_features_special.lua @@ -8,17 +8,16 @@ local GL_INT = 0x1404 -- args= local mySetMaterialUniform = { [false] = Spring.FeatureRendering.SetForwardMaterialUniform, - [true] = Spring.FeatureRendering.SetDeferredMaterialUniform, + [true] = Spring.FeatureRendering.SetDeferredMaterialUniform, } local spGetFeatureHealth = Spring.GetFeatureHealth local featuresHealth = {} --cache -local healthArray = {[1] = 0.0} +local healthArray = { [1] = 0.0 } local function SendHealthInfo(featureID, featureDefID, hasStd, hasDef, hasShad) local h, mh = spGetFeatureHealth(featureID) if h and mh then - h = math.max(h, 0) mh = math.max(mh, 0.01) @@ -37,7 +36,7 @@ local function SendHealthInfo(featureID, featureDefID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "floatOptions[0]", GL_FLOAT, healthArray) @@ -47,7 +46,7 @@ end local healthMod = {} --cache local vertDisp = {} --cache -local vdhmArray = {[1] = 0.0, [2] = 0.0} +local vdhmArray = { [1] = 0.0, [2] = 0.0 } local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, hasShad) -- fill caches, if empty if not healthMod[featureDefID] then @@ -67,7 +66,7 @@ local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, mySetMaterialUniform[false](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) @@ -75,14 +74,14 @@ local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, end end -local fidArray = {[1] = 0} +local fidArray = { [1] = 0 } local function SendFeatureID(featureID, hasStd, hasDef, hasShad) fidArray[1] = featureID if hasStd then mySetMaterialUniform[false](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "intOptions[0]", GL_INT, fidArray) @@ -120,7 +119,7 @@ end -------------------------------------------------------------------------------- local featureTreeTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -169,7 +168,7 @@ local featureTreeTemplate = table.merge(matTemplate, { }) local featuresMetalTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -207,7 +206,7 @@ local featuresMetalTemplate = table.merge(matTemplate, { local materials = { featuresTreeNormal = table.merge(featureTreeTemplate, { - texUnits = { + texUnits = { [2] = "%NORMALTEX", }, shaderOptions = { @@ -224,7 +223,7 @@ local materials = { featuresTreeAutoNormal = table.merge(featureTreeTemplate, { shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 129, @@ -237,7 +236,7 @@ local materials = { shaderOptions = { treewind = false, autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { treewind = false, @@ -249,7 +248,7 @@ local materials = { }), featuresMetalDeadOrHeap = table.merge(featuresMetalTemplate, { - texUnits = { + texUnits = { [2] = "%NORMALTEX", }, shaderOptions = { @@ -269,13 +268,12 @@ local materials = { featuresMetalNoWreck = table.merge(featuresMetalTemplate, { shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 1, }, }), - } -------------------------------------------------------------------------------- @@ -283,41 +281,41 @@ local materials = { local featureNameTrees = { -- all of the 0ad, beherith and artturi features start with these. - {str = "ad0_", prefix = true, fakeNormal = true}, - {str = "art", prefix = true, fakeNormal = true}, + { str = "ad0_", prefix = true, fakeNormal = true }, + { str = "art", prefix = true, fakeNormal = true }, -- from BAR - {str = "allpinesb", prefix = true, fakeNormal = true}, - {str = "bush", prefix = true, fakeNormal = true}, - {str = "vegetation", prefix = true, fakeNormal = true}, - {str = "vegitation", prefix = true, fakeNormal = true}, - {str = "baobab", prefix = true, fakeNormal = true}, - {str = "aleppo", prefix = true, fakeNormal = true}, - {str = "pine", prefix = true, fakeNormal = true}, - {str = "senegal", prefix = true, fakeNormal = true}, - {str = "palm", prefix = true, fakeNormal = true}, - {str = "shrub", prefix = true, fakeNormal = true}, - {str = "bloodthorn", prefix = true, fakeNormal = true}, - {str = "birch", prefix = true, fakeNormal = true}, - {str = "maple", prefix = true, fakeNormal = true}, - {str = "oak", prefix = true, fakeNormal = true}, - {str = "fern", prefix = true, fakeNormal = true}, - {str = "grass", prefix = true, fakeNormal = true}, - {str = "weed", prefix = true, fakeNormal = true}, - {str = "plant", prefix = true, fakeNormal = true}, - {str = "palmetto", prefix = true, fakeNormal = true}, - {str = "lowpoly_tree", prefix = true, fakeNormal = false}, - - {str = "treetype", prefix = true, fakeNormal = true}, --engine trees - - {str = "btree", prefix = true, fakeNormal = false}, --beherith trees don't gain from fake normal + { str = "allpinesb", prefix = true, fakeNormal = true }, + { str = "bush", prefix = true, fakeNormal = true }, + { str = "vegetation", prefix = true, fakeNormal = true }, + { str = "vegitation", prefix = true, fakeNormal = true }, + { str = "baobab", prefix = true, fakeNormal = true }, + { str = "aleppo", prefix = true, fakeNormal = true }, + { str = "pine", prefix = true, fakeNormal = true }, + { str = "senegal", prefix = true, fakeNormal = true }, + { str = "palm", prefix = true, fakeNormal = true }, + { str = "shrub", prefix = true, fakeNormal = true }, + { str = "bloodthorn", prefix = true, fakeNormal = true }, + { str = "birch", prefix = true, fakeNormal = true }, + { str = "maple", prefix = true, fakeNormal = true }, + { str = "oak", prefix = true, fakeNormal = true }, + { str = "fern", prefix = true, fakeNormal = true }, + { str = "grass", prefix = true, fakeNormal = true }, + { str = "weed", prefix = true, fakeNormal = true }, + { str = "plant", prefix = true, fakeNormal = true }, + { str = "palmetto", prefix = true, fakeNormal = true }, + { str = "lowpoly_tree", prefix = true, fakeNormal = false }, + + { str = "treetype", prefix = true, fakeNormal = true }, --engine trees + + { str = "btree", prefix = true, fakeNormal = false }, --beherith trees don't gain from fake normal -- Other trees will probably contain "tree" as a substring. - {str = "tree", prefix = false, fakeNormal = true}, + { str = "tree", prefix = false, fakeNormal = true }, } local featureNameTreesNoSway = { - "fern1", --doesn't look good on DownPour_v1 + "fern1", --doesn't look good on DownPour_v1 "fern6", "fern8", } @@ -339,8 +337,7 @@ local function GetTreeInfo(fdef) for _, treeInfo in ipairs(featureNameTrees) do local idx = fdef.name:find(treeInfo.str) - if idx and ((treeInfo.prefix and idx == 1) or (not treeInfo.prefix)) then - + if idx and ((treeInfo.prefix and idx == 1) or not treeInfo.prefix) then local isException = false for _, exc in ipairs(featureNameTreeExceptions) do isException = isException or fdef.name:find(exc) ~= nil @@ -385,15 +382,14 @@ for id = 1, #FeatureDefs do if isTree then if normalMap then - featureMaterials[id] = {"featuresTreeNormal", NORMALTEX = normalMap} + featureMaterials[id] = { "featuresTreeNormal", NORMALTEX = normalMap } else if noSway then - featureMaterials[id] = {"featuresTreeAutoNormalNoSway"} + featureMaterials[id] = { "featuresTreeAutoNormalNoSway" } else - featureMaterials[id] = {"featuresTreeAutoNormal"} + featureMaterials[id] = { "featuresTreeAutoNormal" } end end - elseif metallic then local fromUnit = featureDef.name:find("_dead") or featureDef.name:find("_heap") @@ -401,34 +397,35 @@ for id = 1, #FeatureDefs do Spring.PreloadFeatureDefModel(id) local lowercasetex1 = "" - if featureDef.model.textures.tex1 == nil then - Spring.Echo("nil texture 1 detected for",featureDef.name) + if featureDef.model.textures.tex1 == nil then + Spring.Echo("nil texture 1 detected for", featureDef.name) else - lowercasetex1 = string.lower( featureDef.model.textures.tex1) + lowercasetex1 = string.lower(featureDef.model.textures.tex1) end - local wreckNormalTex = featureDef.model.textures.tex1 and - ((lowercasetex1:find("arm_wreck") and "unittextures/Arm_wreck_color_normal.dds") or - (lowercasetex1:find("arm_color") and "unittextures/Arm_normal.dds") or -- for things like dead dragons claw armclaw - (lowercasetex1:find("cor_color.dds",1,true) and "unittextures/cor_normal.dds") or -- for things like dead dragons maw cormaw - (lowercasetex1:find("cor_color_wreck") and "unittextures/cor_color_wreck_normal.dds")) + local wreckNormalTex = featureDef.model.textures.tex1 and ( + (lowercasetex1:find("arm_wreck") and "unittextures/Arm_wreck_color_normal.dds") + or (lowercasetex1:find("arm_color") and "unittextures/Arm_normal.dds") -- for things like dead dragons claw armclaw + or (lowercasetex1:find("cor_color.dds", 1, true) and "unittextures/cor_normal.dds") -- for things like dead dragons maw cormaw + or (lowercasetex1:find("cor_color_wreck") and "unittextures/cor_color_wreck_normal.dds") + ) if not wreckNormalTex then table.insert(failedwrecknormaltex, 1, featureDef.name) - Spring.Echo("Failed to find normal map for unit wreck: ", featureDef.name,lowercasetex1) + Spring.Echo("Failed to find normal map for unit wreck: ", featureDef.name, lowercasetex1) end - featureMaterials[id] = {"featuresMetalDeadOrHeap", NORMALTEX = wreckNormalTex} + featureMaterials[id] = { "featuresMetalDeadOrHeap", NORMALTEX = wreckNormalTex } else - featureMaterials[id] = {"featuresMetalNoWreck"} + featureMaterials[id] = { "featuresMetalNoWreck" } end end -- 133_feature_other will handle the rest of features end end -if #failedwrecknormaltex > 0 then - Spring.Echo("Failed to find normal map for unit wreck: ", table.concat(failedwrecknormaltex,',')) +if #failedwrecknormaltex > 0 then + Spring.Echo("Failed to find normal map for unit wreck: ", table.concat(failedwrecknormaltex, ",")) end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/modelmaterials/133_features_other.lua b/modelmaterials/133_features_other.lua index 97bd1dfeb9f..432537e5aa1 100644 --- a/modelmaterials/133_features_other.lua +++ b/modelmaterials/133_features_other.lua @@ -2,7 +2,7 @@ local matTemplate = VFS.Include("ModelMaterials/Templates/defaultMaterialTemplat local materials = { featuresOther = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -35,12 +35,12 @@ local materials = { }, shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 133, }, - }) + }), } -------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ local featureMaterials = {} for id = 1, #FeatureDefs do local fdef = FeatureDefs[id] if not cusFeaturesMaterials[id] and fdef.modeltype ~= "3do" then - featureMaterials[id] = {"featuresOther"} + featureMaterials[id] = { "featuresOther" } end end diff --git a/modelmaterials/Templates/defaultMaterialTemplate.lua b/modelmaterials/Templates/defaultMaterialTemplate.lua index 7859eeee7a3..3d37ca488a1 100644 --- a/modelmaterials/Templates/defaultMaterialTemplate.lua +++ b/modelmaterials/Templates/defaultMaterialTemplate.lua @@ -1,5 +1,5 @@ local shaderTemplate = { -vertex = [[ + vertex = [[ //shader version is added via gadget %%GLOBAL_NAMESPACE%% @@ -347,7 +347,7 @@ vertex = [[ } ]], -fragment = [[ + fragment = [[ //shader version is added via gadget #if (RENDERING_MODE == 2) //shadows pass. AMD requests that extensions are declared right on top of the shader @@ -1477,27 +1477,27 @@ fragment = [[ #endif ]], uniformInt = { - texture1 = 0, - texture2 = 1, - normalTex = 2, + texture1 = 0, + texture2 = 1, + normalTex = 2, - texture1w = 3, - texture2w = 4, - normalTexw = 5, + texture1w = 3, + texture2w = 4, + normalTexw = 5, - shadowTex = 6, - reflectTex = 7, + shadowTex = 6, + reflectTex = 7, - losMapTex = 8, - brdfLUT = 9, - envLUT = 10, - rgbNoise = 11, + losMapTex = 8, + brdfLUT = 9, + envLUT = 10, + rgbNoise = 11, }, uniformFloat = { - sunAmbient = {gl.GetSun("ambient" ,"unit")}, - sunDiffuse = {gl.GetSun("diffuse" ,"unit")}, - sunSpecular = {gl.GetSun("specular" ,"unit")}, - shadowDensity = gl.GetSun("shadowDensity" ,"unit"), + sunAmbient = { gl.GetSun("ambient", "unit") }, + sunDiffuse = { gl.GetSun("diffuse", "unit") }, + sunSpecular = { gl.GetSun("specular", "unit") }, + shadowDensity = gl.GetSun("shadowDensity", "unit"), }, } @@ -1505,9 +1505,9 @@ local defaultMaterialTemplate = { --standardUniforms --locs, set by api_cus --deferredUniforms --locs, set by api_cus - shader = shaderTemplate, -- `shader` is replaced with standardShader later in api_cus + shader = shaderTemplate, -- `shader` is replaced with standardShader later in api_cus deferred = shaderTemplate, -- `deferred` is replaced with deferredShader later in api_cus - shadow = shaderTemplate, -- `shadow` is replaced with deferredShader later in api_cus + shadow = shaderTemplate, -- `shadow` is replaced with deferredShader later in api_cus -- note these definitions below are not inherited!!! -- they need to be redefined on every child material that has its own {shader,deferred,shadow}Definitions @@ -1519,61 +1519,61 @@ local defaultMaterialTemplate = { }, shadowDefinitions = { "#define RENDERING_MODE 2", - "#define SUPPORT_DEPTH_LAYOUT ".. tostring((Platform.glSupportFragDepthLayout and 1) or 0), - "#define SUPPORT_CLIP_CONTROL ".. tostring((Platform.glSupportClipSpaceControl and 1) or 0), + "#define SUPPORT_DEPTH_LAYOUT " .. tostring((Platform.glSupportFragDepthLayout and 1) or 0), + "#define SUPPORT_CLIP_CONTROL " .. tostring((Platform.glSupportClipSpaceControl and 1) or 0), }, shaderOptions = { - shadowmapping = true, - normalmapping = false, + shadowmapping = true, + normalmapping = false, - vertex_ao = false, - flashlights = false, - normalmap_flip = false, + vertex_ao = false, + flashlights = false, + normalmap_flip = false, - treads_arm = false, - treads_core = false, + treads_arm = false, + treads_core = false, - health_displace = false, + health_displace = false, health_texturing = false, health_texraptors = false, - modelsfog = true, + modelsfog = true, - treewind = false, - autonormal = false, + treewind = false, + autonormal = false, - shadowsQuality = 2, + shadowsQuality = 2, - autoNormalParams = {1.0, 0.00200}, -- Sampling distance, autonormal value + autoNormalParams = { 1.0, 0.00200 }, -- Sampling distance, autonormal value }, deferredOptions = { - shadowmapping = true, - normalmapping = false, + shadowmapping = true, + normalmapping = false, - vertex_ao = false, - flashlights = false, - normalmap_flip = false, + vertex_ao = false, + flashlights = false, + normalmap_flip = false, - treads_arm = false, - treads_core = false, + treads_arm = false, + treads_core = false, - modelsfog = true, + modelsfog = true, - health_displace = false, + health_displace = false, health_texturing = false, health_texraptors = false, - treewind = false, - autonormal = false, + treewind = false, + autonormal = false, - shadowsQuality = 0, - materialIndex = 0, + shadowsQuality = 0, + materialIndex = 0, }, shadowOptions = { - treewind = false, + treewind = false, }, feature = false, @@ -1598,9 +1598,7 @@ local defaultMaterialTemplate = { usecamera = false, -- usecamera ? {gl_ModelViewMatrix, gl_NormalMatrix} = {modelViewMatrix, modelViewNormalMatrix} : {modelMatrix, modelNormalMatrix} } -local shaderPlugins = { -} - +local shaderPlugins = {} --[[ #define OPTION_SHADOWMAPPING 0 @@ -1621,7 +1619,8 @@ local shaderPlugins = { #define OPTION_TREEWIND 11 #define OPTION_AUTONORMAL 21 -]]-- +]] +-- -- bit = (index - 1) local knownBitOptions = { @@ -1647,7 +1646,6 @@ local knownBitOptions = { local knownIntOptions = { ["shadowsQuality"] = 1, ["materialIndex"] = 1, - } local knownFloatOptions = { ["autoNormalParams"] = 2, @@ -1670,7 +1668,7 @@ local function ProcessOptions(materialDef, optName, optValues) materialDef.originalOptions[3] = table.copy(materialDef.shadowOptions) end - for id, optTable in ipairs({materialDef.shaderOptions, materialDef.deferredOptions, materialDef.shadowOptions}) do + for id, optTable in ipairs({ materialDef.shaderOptions, materialDef.deferredOptions, materialDef.shadowOptions }) do if knownBitOptions[optName] then --boolean local optValue = unpack(optValues or {}) local optOriginalValue = materialDef.originalOptions[id][optName] @@ -1701,7 +1699,6 @@ local function ProcessOptions(materialDef, optName, optValues) end local function ApplyOptions(luaShader, materialDef, key) - local optionsTbl if key == 1 then optionsTbl = materialDef.shaderOptions @@ -1715,24 +1712,19 @@ local function ApplyOptions(luaShader, materialDef, key) for optName, optValue in pairs(optionsTbl) do if knownBitOptions[optName] then --boolean - intOption = EncodeBitmaskField(intOption, optValue, knownBitOptions[optName]) --encode options into Int. - elseif knownIntOptions[optName] then --integer - if type(optValue) == "number" and knownIntOptions[optName] == 1 then luaShader:SetUniformInt(optName, optValue) elseif type(optValue) == "table" and knownIntOptions[optName] == #optValue then luaShader:SetUniformInt(optName, unpack(optValue)) end - elseif knownFloatOptions[optName] then --float if type(optValue) == "number" and knownFloatOptions[optName] == 1 then luaShader:SetUniformFloat(optName, optValue) elseif type(optValue) == "table" and knownFloatOptions[optName] == #optValue then luaShader:SetUniformFloat(optName, unpack(optValue)) end - end end @@ -1758,21 +1750,21 @@ local function GetAllOptions() end local function SunChanged(luaShader) - luaShader:SetUniformAlways("shadowDensity", gl.GetSun("shadowDensity" ,"unit")) + luaShader:SetUniformAlways("shadowDensity", gl.GetSun("shadowDensity", "unit")) - luaShader:SetUniformAlways("sunAmbient", gl.GetSun("ambient" ,"unit")) - luaShader:SetUniformAlways("sunDiffuse", gl.GetSun("diffuse" ,"unit")) - luaShader:SetUniformAlways("sunSpecular", gl.GetSun("specular" ,"unit")) + luaShader:SetUniformAlways("sunAmbient", gl.GetSun("ambient", "unit")) + luaShader:SetUniformAlways("sunDiffuse", gl.GetSun("diffuse", "unit")) + luaShader:SetUniformAlways("sunSpecular", gl.GetSun("specular", "unit")) luaShader:SetUniformFloatArrayAlways("pbrParams", { - Spring.GetConfigFloat("tonemapA", 4.75), - Spring.GetConfigFloat("tonemapB", 0.75), - Spring.GetConfigFloat("tonemapC", 3.5), - Spring.GetConfigFloat("tonemapD", 0.85), - Spring.GetConfigFloat("tonemapE", 1.0), - Spring.GetConfigFloat("envAmbient", 0.25), - Spring.GetConfigFloat("unitSunMult", 1.0), - Spring.GetConfigFloat("unitExposureMult", 1.0), + Spring.GetConfigFloat("tonemapA", 4.75), + Spring.GetConfigFloat("tonemapB", 0.75), + Spring.GetConfigFloat("tonemapC", 3.5), + Spring.GetConfigFloat("tonemapD", 0.85), + Spring.GetConfigFloat("tonemapE", 1.0), + Spring.GetConfigFloat("envAmbient", 0.25), + Spring.GetConfigFloat("unitSunMult", 1.0), + Spring.GetConfigFloat("unitExposureMult", 1.0), }) luaShader:SetUniformFloatAlways("gamma", Spring.GetConfigFloat("modelGamma", 1.0)) end diff --git a/modelmaterials_gl4/001_units_s3o_assimp.lua b/modelmaterials_gl4/001_units_s3o_assimp.lua index 8bbe5ab1c2f..1552137e023 100644 --- a/modelmaterials_gl4/001_units_s3o_assimp.lua +++ b/modelmaterials_gl4/001_units_s3o_assimp.lua @@ -1,7 +1,7 @@ local matTemplate = VFS.Include("ModelMaterials/Templates/defaultMaterialTemplate.lua") local unitsNormalMapTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%UNITDEFID:0", [1] = "%%UNITDEFID:1", [2] = "%NORMALTEX", @@ -62,7 +62,7 @@ local GL_INT = 0x1404 -- args= local mySetMaterialUniform = { [false] = Spring.UnitRendering.SetForwardMaterialUniform, - [true] = Spring.UnitRendering.SetDeferredMaterialUniform, + [true] = Spring.UnitRendering.SetDeferredMaterialUniform, } local armTanks = {} @@ -71,7 +71,7 @@ local raptorUnits = {} local otherUnits = {} local spGetUnitHealth = Spring.GetUnitHealth local unitsHealth = {} --cache -local healthArray = {[1] = 0.0} +local healthArray = { [1] = 0.0 } local function SendHealthInfo(unitID, unitDefID, hasStd, hasDef, hasShad) local h, mh = spGetUnitHealth(unitID) @@ -95,7 +95,7 @@ local function SendHealthInfo(unitID, unitDefID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[0]", GL_FLOAT, healthArray) @@ -105,7 +105,7 @@ end local healthMod = {} --cache local vertDisp = {} --cache -local vdhmArray = {[1] = 0.0, [2] = 0.0} +local vdhmArray = { [1] = 0.0, [2] = 0.0 } local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasShad) -- fill caches, if empty if not healthMod[unitDefID] then @@ -125,7 +125,7 @@ local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasSha mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) @@ -133,14 +133,14 @@ local function SendVertDispAndHelthMod(unitID, unitDefID, hasStd, hasDef, hasSha end end -local uidArray = {[1] = 0} +local uidArray = { [1] = 0 } local function SendUnitID(unitID, hasStd, hasDef, hasShad) uidArray[1] = unitID if hasStd then mySetMaterialUniform[false](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "intOptions[0]", GL_INT, uidArray) end if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "intOptions[0]", GL_INT, uidArray) @@ -151,7 +151,7 @@ local spGetUnitVelocity = Spring.GetUnitVelocity local spGetUnitDirection = Spring.GetUnitDirection local floor = math.floor local treadSpeeds = {} --cache -local treadsArray = {[1] = 0.0} +local treadsArray = { [1] = 0.0 } local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) if not treadSpeeds[unitID] then @@ -166,7 +166,7 @@ local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) end local udx, udy, udz = spGetUnitDirection(unitID) - if udx > 0 and usx < 0 or udx < 0 and usx > 0 or udz > 0 and usz < 0 or udz < 0 and usz > 0 then + if udx > 0 and usx < 0 or udx < 0 and usx > 0 or udz > 0 and usz < 0 or udz < 0 and usz > 0 then speed = -speed end @@ -177,14 +177,15 @@ local function SendTracksOffset(unitID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end if hasDef then - mySetMaterialUniform[true ](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) + mySetMaterialUniform[true](unitID, "opaque", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end --[[ -- tank tracks usually don't contribute much to shadows look if hasShad then mySetMaterialUniform[false](unitID, "shadow", 3, "floatOptions[3]", GL_FLOAT, treadsArray) end - ]]-- + ]] + -- end end @@ -224,7 +225,7 @@ end local materials = { unitsNormalMapArmTanks = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", @@ -236,15 +237,21 @@ local materials = { treads_arm = true, materialIndex = 1, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(armTanks, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(armTanks, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(armTanks, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(armTanks, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(true, armTanks, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(true, armTanks, gf, mat) + end, UnitDamaged = UnitDamaged, }), unitsNormalMapCorTanks = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", @@ -256,28 +263,39 @@ local materials = { treads_core = true, materialIndex = 2, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(corTanks, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(corTanks, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(corTanks, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(corTanks, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(true, corTanks, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(true, corTanks, gf, mat) + end, UnitDamaged = UnitDamaged, }), unitsNormalMapOthersArmCor = table.merge(unitsNormalMapTemplate, { - texUnits = { + texUnits = { [3] = "%TEXW1", [4] = "%TEXW2", [5] = "%NORMALTEX2", }, - shaderOptions = { - }, + shaderOptions = {}, deferredOptions = { materialIndex = 3, }, - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(otherUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(otherUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(otherUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(otherUnits, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(false, otherUnits, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(false, otherUnits, gf, mat) + end, UnitDamaged = UnitDamaged, }), @@ -299,8 +317,12 @@ local materials = { }, -- are these below required? - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(otherUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(otherUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(otherUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(otherUnits, unitID, unitDefID) + end, --GameFrame = function (gf, mat) GameFrame(false, otherUnits, gf, mat) end, @@ -331,10 +353,16 @@ local materials = { }, -- are these below required? - UnitCreated = function (unitID, unitDefID, mat) UnitCreated(raptorUnits, unitID, unitDefID, mat) end, - UnitDestroyed = function (unitID, unitDefID) UnitDestroyed(raptorUnits, unitID, unitDefID) end, + UnitCreated = function(unitID, unitDefID, mat) + UnitCreated(raptorUnits, unitID, unitDefID, mat) + end, + UnitDestroyed = function(unitID, unitDefID) + UnitDestroyed(raptorUnits, unitID, unitDefID) + end, - GameFrame = function (gf, mat) GameFrame(false, raptorUnits, gf, mat) end, + GameFrame = function(gf, mat) + GameFrame(false, raptorUnits, gf, mat) + end, UnitDamaged = UnitDamaged, }), @@ -377,7 +405,6 @@ for id = 1, #UnitDefs do local udef = UnitDefs[id] if not cusUnitMaterials[id] and udef.modeltype == "s3o" then - local udefCM = udef.customParams local udefName = udef.name or "" @@ -389,18 +416,18 @@ for id = 1, #UnitDefs do if udef.modCategories["tank"] then if facName == "arm" then - unitMaterials[id] = {"unitsNormalMapArmTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapArmTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } elseif facName == "cor" then - unitMaterials[id] = {"unitsNormalMapCorTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapCorTanks", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } end else if wreckAtlas then - unitMaterials[id] = {"unitsNormalMapOthersArmCor", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3]} + unitMaterials[id] = { "unitsNormalMapOthersArmCor", NORMALTEX = normalTex, TEXW1 = wreckAtlas[1], TEXW2 = wreckAtlas[2], NORMALTEX2 = wreckAtlas[3] } else if facName == "rap" then - unitMaterials[id] = {"unitsNormalMapRaptors", NORMALTEX = normalTex} + unitMaterials[id] = { "unitsNormalMapRaptors", NORMALTEX = normalTex } else - unitMaterials[id] = {"unitsNormalMapOthers", NORMALTEX = normalTex} + unitMaterials[id] = { "unitsNormalMapOthers", NORMALTEX = normalTex } end end end diff --git a/modelmaterials_gl4/128_features_special.lua b/modelmaterials_gl4/128_features_special.lua index 6a10f748725..dea1403b559 100644 --- a/modelmaterials_gl4/128_features_special.lua +++ b/modelmaterials_gl4/128_features_special.lua @@ -8,17 +8,16 @@ local GL_INT = 0x1404 -- args= local mySetMaterialUniform = { [false] = Spring.FeatureRendering.SetForwardMaterialUniform, - [true] = Spring.FeatureRendering.SetDeferredMaterialUniform, + [true] = Spring.FeatureRendering.SetDeferredMaterialUniform, } local spGetFeatureHealth = Spring.GetFeatureHealth local featuresHealth = {} --cache -local healthArray = {[1] = 0.0} +local healthArray = { [1] = 0.0 } local function SendHealthInfo(featureID, featureDefID, hasStd, hasDef, hasShad) local h, mh = spGetFeatureHealth(featureID) if h and mh then - h = math.max(h, 0) mh = math.max(mh, 0.01) @@ -37,7 +36,7 @@ local function SendHealthInfo(featureID, featureDefID, hasStd, hasDef, hasShad) mySetMaterialUniform[false](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "floatOptions[0]", GL_FLOAT, healthArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "floatOptions[0]", GL_FLOAT, healthArray) @@ -47,7 +46,7 @@ end local healthMod = {} --cache local vertDisp = {} --cache -local vdhmArray = {[1] = 0.0, [2] = 0.0} +local vdhmArray = { [1] = 0.0, [2] = 0.0 } local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, hasShad) -- fill caches, if empty if not healthMod[featureDefID] then @@ -67,7 +66,7 @@ local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, mySetMaterialUniform[false](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "floatOptions[1]", GL_FLOAT, vdhmArray) @@ -75,14 +74,14 @@ local function SendVertDispAndHelthMod(featureID, featureDefID, hasStd, hasDef, end end -local fidArray = {[1] = 0} +local fidArray = { [1] = 0 } local function SendFeatureID(featureID, hasStd, hasDef, hasShad) fidArray[1] = featureID if hasStd then mySetMaterialUniform[false](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) end if hasDef then - mySetMaterialUniform[true ](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) + mySetMaterialUniform[true](featureID, "opaque", 3, "intOptions[0]", GL_INT, fidArray) end if hasShad then mySetMaterialUniform[false](featureID, "shadow", 3, "intOptions[0]", GL_INT, fidArray) @@ -120,7 +119,7 @@ end -------------------------------------------------------------------------------- local featureTreeTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -169,7 +168,7 @@ local featureTreeTemplate = table.merge(matTemplate, { }) local featuresMetalTemplate = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -207,7 +206,7 @@ local featuresMetalTemplate = table.merge(matTemplate, { local materials = { featuresTreeNormal = table.merge(featureTreeTemplate, { - texUnits = { + texUnits = { [2] = "%NORMALTEX", }, shaderOptions = { @@ -224,7 +223,7 @@ local materials = { featuresTreeAutoNormal = table.merge(featureTreeTemplate, { shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 129, @@ -237,7 +236,7 @@ local materials = { shaderOptions = { treewind = false, autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { treewind = false, @@ -249,7 +248,7 @@ local materials = { }), featuresMetalDeadOrHeap = table.merge(featuresMetalTemplate, { - texUnits = { + texUnits = { [2] = "%NORMALTEX", }, shaderOptions = { @@ -269,13 +268,12 @@ local materials = { featuresMetalNoWreck = table.merge(featuresMetalTemplate, { shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 1, }, }), - } -------------------------------------------------------------------------------- @@ -283,41 +281,41 @@ local materials = { local featureNameTrees = { -- all of the 0ad, beherith and artturi features start with these. - {str = "ad0_", prefix = true, fakeNormal = true}, - {str = "art", prefix = true, fakeNormal = true}, + { str = "ad0_", prefix = true, fakeNormal = true }, + { str = "art", prefix = true, fakeNormal = true }, -- from BAR - {str = "allpinesb", prefix = true, fakeNormal = true}, - {str = "bush", prefix = true, fakeNormal = true}, - {str = "vegetation", prefix = true, fakeNormal = true}, - {str = "vegitation", prefix = true, fakeNormal = true}, - {str = "baobab", prefix = true, fakeNormal = true}, - {str = "aleppo", prefix = true, fakeNormal = true}, - {str = "pine", prefix = true, fakeNormal = true}, - {str = "senegal", prefix = true, fakeNormal = true}, - {str = "palm", prefix = true, fakeNormal = true}, - {str = "shrub", prefix = true, fakeNormal = true}, - {str = "bloodthorn", prefix = true, fakeNormal = true}, - {str = "birch", prefix = true, fakeNormal = true}, - {str = "maple", prefix = true, fakeNormal = true}, - {str = "oak", prefix = true, fakeNormal = true}, - {str = "fern", prefix = true, fakeNormal = true}, - {str = "grass", prefix = true, fakeNormal = true}, - {str = "weed", prefix = true, fakeNormal = true}, - {str = "plant", prefix = true, fakeNormal = true}, - {str = "palmetto", prefix = true, fakeNormal = true}, - {str = "lowpoly_tree", prefix = true, fakeNormal = false}, - - {str = "treetype", prefix = true, fakeNormal = true}, --engine trees - - {str = "btree", prefix = true, fakeNormal = false}, --beherith trees don't gain from fake normal + { str = "allpinesb", prefix = true, fakeNormal = true }, + { str = "bush", prefix = true, fakeNormal = true }, + { str = "vegetation", prefix = true, fakeNormal = true }, + { str = "vegitation", prefix = true, fakeNormal = true }, + { str = "baobab", prefix = true, fakeNormal = true }, + { str = "aleppo", prefix = true, fakeNormal = true }, + { str = "pine", prefix = true, fakeNormal = true }, + { str = "senegal", prefix = true, fakeNormal = true }, + { str = "palm", prefix = true, fakeNormal = true }, + { str = "shrub", prefix = true, fakeNormal = true }, + { str = "bloodthorn", prefix = true, fakeNormal = true }, + { str = "birch", prefix = true, fakeNormal = true }, + { str = "maple", prefix = true, fakeNormal = true }, + { str = "oak", prefix = true, fakeNormal = true }, + { str = "fern", prefix = true, fakeNormal = true }, + { str = "grass", prefix = true, fakeNormal = true }, + { str = "weed", prefix = true, fakeNormal = true }, + { str = "plant", prefix = true, fakeNormal = true }, + { str = "palmetto", prefix = true, fakeNormal = true }, + { str = "lowpoly_tree", prefix = true, fakeNormal = false }, + + { str = "treetype", prefix = true, fakeNormal = true }, --engine trees + + { str = "btree", prefix = true, fakeNormal = false }, --beherith trees don't gain from fake normal -- Other trees will probably contain "tree" as a substring. - {str = "tree", prefix = false, fakeNormal = true}, + { str = "tree", prefix = false, fakeNormal = true }, } local featureNameTreesNoSway = { - "fern1", --doesn't look good on DownPour_v1 + "fern1", --doesn't look good on DownPour_v1 "fern6", "fern8", } @@ -339,8 +337,7 @@ local function GetTreeInfo(fdef) for _, treeInfo in ipairs(featureNameTrees) do local idx = fdef.name:find(treeInfo.str) - if idx and ((treeInfo.prefix and idx == 1) or (not treeInfo.prefix)) then - + if idx and ((treeInfo.prefix and idx == 1) or not treeInfo.prefix) then local isException = false for _, exc in ipairs(featureNameTreeExceptions) do isException = isException or fdef.name:find(exc) ~= nil @@ -385,15 +382,14 @@ for id = 1, #FeatureDefs do if isTree then if normalMap then - featureMaterials[id] = {"featuresTreeNormal", NORMALTEX = normalMap} + featureMaterials[id] = { "featuresTreeNormal", NORMALTEX = normalMap } else if noSway then - featureMaterials[id] = {"featuresTreeAutoNormalNoSway"} + featureMaterials[id] = { "featuresTreeAutoNormalNoSway" } else - featureMaterials[id] = {"featuresTreeAutoNormal"} + featureMaterials[id] = { "featuresTreeAutoNormal" } end end - elseif metallic then local fromUnit = featureDef.name:find("_dead") or featureDef.name:find("_heap") @@ -401,34 +397,35 @@ for id = 1, #FeatureDefs do Spring.PreloadFeatureDefModel(id) local lowercasetex1 = "" - if featureDef.model.textures.tex1 == nil then - Spring.Echo("nil texture 1 detected for",featureDef.name) + if featureDef.model.textures.tex1 == nil then + Spring.Echo("nil texture 1 detected for", featureDef.name) else - lowercasetex1 = string.lower( featureDef.model.textures.tex1) + lowercasetex1 = string.lower(featureDef.model.textures.tex1) end - local wreckNormalTex = featureDef.model.textures.tex1 and - ((lowercasetex1:find("arm_wreck") and "unittextures/Arm_wreck_color_normal.dds") or - (lowercasetex1:find("arm_color") and "unittextures/Arm_normal.dds") or -- for things like dead dragons claw armclaw - (lowercasetex1:find("cor_color.dds",1,true) and "unittextures/cor_normal.dds") or -- for things like dead dragons maw cormaw - (lowercasetex1:find("cor_color_wreck") and "unittextures/cor_color_wreck_normal.dds")) + local wreckNormalTex = featureDef.model.textures.tex1 and ( + (lowercasetex1:find("arm_wreck") and "unittextures/Arm_wreck_color_normal.dds") + or (lowercasetex1:find("arm_color") and "unittextures/Arm_normal.dds") -- for things like dead dragons claw armclaw + or (lowercasetex1:find("cor_color.dds", 1, true) and "unittextures/cor_normal.dds") -- for things like dead dragons maw cormaw + or (lowercasetex1:find("cor_color_wreck") and "unittextures/cor_color_wreck_normal.dds") + ) if not wreckNormalTex then table.insert(failedwrecknormaltex, 1, featureDef.name) - Spring.Echo("Failed to find normal map for unit wreck: ", featureDef.name,lowercasetex1) + Spring.Echo("Failed to find normal map for unit wreck: ", featureDef.name, lowercasetex1) end - featureMaterials[id] = {"featuresMetalDeadOrHeap", NORMALTEX = wreckNormalTex} + featureMaterials[id] = { "featuresMetalDeadOrHeap", NORMALTEX = wreckNormalTex } else - featureMaterials[id] = {"featuresMetalNoWreck"} + featureMaterials[id] = { "featuresMetalNoWreck" } end end -- 133_feature_other will handle the rest of features end end -if #failedwrecknormaltex > 0 then - Spring.Echo("Failed to find normal map for unit wreck: ", table.concat(failedwrecknormaltex,',')) +if #failedwrecknormaltex > 0 then + Spring.Echo("Failed to find normal map for unit wreck: ", table.concat(failedwrecknormaltex, ",")) end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- diff --git a/modelmaterials_gl4/133_features_other.lua b/modelmaterials_gl4/133_features_other.lua index 97bd1dfeb9f..432537e5aa1 100644 --- a/modelmaterials_gl4/133_features_other.lua +++ b/modelmaterials_gl4/133_features_other.lua @@ -2,7 +2,7 @@ local matTemplate = VFS.Include("ModelMaterials/Templates/defaultMaterialTemplat local materials = { featuresOther = table.merge(matTemplate, { - texUnits = { + texUnits = { [0] = "%%FEATUREDEFID:0", [1] = "%%FEATUREDEFID:1", }, @@ -35,12 +35,12 @@ local materials = { }, shaderOptions = { autonormal = true, - autoNormalParams = {1.5, 0.005}, + autoNormalParams = { 1.5, 0.005 }, }, deferredOptions = { materialIndex = 133, }, - }) + }), } -------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ local featureMaterials = {} for id = 1, #FeatureDefs do local fdef = FeatureDefs[id] if not cusFeaturesMaterials[id] and fdef.modeltype ~= "3do" then - featureMaterials[id] = {"featuresOther"} + featureMaterials[id] = { "featuresOther" } end end diff --git a/modelmaterials_gl4/known_feature_trees.lua b/modelmaterials_gl4/known_feature_trees.lua index 9f4eec32859..cddd02f2175 100644 --- a/modelmaterials_gl4/known_feature_trees.lua +++ b/modelmaterials_gl4/known_feature_trees.lua @@ -1,461 +1,461 @@ local knowntrees = { - ad0_banyan_1 = 'treeBanyan', - ad0_banyan_2 = 'treeBanyan', - ad0_banyan_3 = 'treeBanyan', - ad0_banyan_4 = 'treeBanyan', - ad0_banyan_5 = 'treeBanyan', - ad0_banyan_6 = 'treeBanyan', - ad0_aleppo_1 = 'treeAleppoPine', - ad0_aleppo_2 = 'treeAleppoPine', - ad0_aleppo_3 = 'treeAleppoPine', - ad0_aleppo_4 = 'treeAleppoPine', - ad0_aleppo_5 = 'treeAleppoPine', - ad0_aleppo_6 = 'treeAleppoPine', - ad0_aleppo_7 = 'treeAleppoPine', - ad0_aleppo_8 = 'treeAleppoPine', - ad0_aleppo_9 = 'treeAleppoPine', - ad0_aleppo_10 = 'treeAleppoPine', - ad0_aleppo2_dense_dark_l = 'treeAleppoPine', - ad0_aleppo2_dense_dark_m = 'treeAleppoPine', - ad0_aleppo2_dense_dark_s = 'treeAleppoPine', - ad0_aleppo2_dense_dark_xl = 'treeAleppoPine', - ad0_aleppo2_dense_dead_l = 'treeAleppoPine', - ad0_aleppo2_dense_dead_m = 'treeAleppoPine', - ad0_aleppo2_dense_dead_s = 'treeAleppoPine', - ad0_aleppo2_dense_dead_xl = 'treeAleppoPine', - ad0_aleppo2_dense_light_l = 'treeAleppoPine', - ad0_aleppo2_dense_light_m = 'treeAleppoPine', - ad0_aleppo2_dense_light_s = 'treeAleppoPine', - ad0_aleppo2_dense_light_xl = 'treeAleppoPine', - ad0_aleppo2_dense_med_l = 'treeAleppoPine', - ad0_aleppo2_dense_med_m = 'treeAleppoPine', - ad0_aleppo2_dense_med_s = 'treeAleppoPine', - ad0_aleppo2_dense_med_xl = 'treeAleppoPine', - ad0_aleppo2_double_dark_l = 'treeAleppoPine', - ad0_aleppo2_double_dark_m = 'treeAleppoPine', - ad0_aleppo2_double_dark_s = 'treeAleppoPine', - ad0_aleppo2_double_dark_xl = 'treeAleppoPine', - ad0_aleppo2_double_dead_l = 'treeAleppoPine', - ad0_aleppo2_double_dead_m = 'treeAleppoPine', - ad0_aleppo2_double_dead_s = 'treeAleppoPine', - ad0_aleppo2_double_dead_xl = 'treeAleppoPine', - ad0_aleppo2_double_light_l = 'treeAleppoPine', - ad0_aleppo2_double_light_m = 'treeAleppoPine', - ad0_aleppo2_double_light_s = 'treeAleppoPine', - ad0_aleppo2_double_light_xl = 'treeAleppoPine', - ad0_aleppo2_double_med_l = 'treeAleppoPine', - ad0_aleppo2_double_med_m = 'treeAleppoPine', - ad0_aleppo2_double_med_s = 'treeAleppoPine', - ad0_aleppo2_double_med_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_l = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_m = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_s = 'treeAleppoPine', - ad0_aleppo2_sparse_dark_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_l = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_m = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_s = 'treeAleppoPine', - ad0_aleppo2_sparse_dead_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_light_l = 'treeAleppoPine', - ad0_aleppo2_sparse_light_m = 'treeAleppoPine', - ad0_aleppo2_sparse_light_s = 'treeAleppoPine', - ad0_aleppo2_sparse_light_xl = 'treeAleppoPine', - ad0_aleppo2_sparse_med_l = 'treeAleppoPine', - ad0_aleppo2_sparse_med_m = 'treeAleppoPine', - ad0_aleppo2_sparse_med_s = 'treeAleppoPine', - ad0_aleppo2_sparse_med_xl = 'treeAleppoPine', -- ad0_aleppo2_[sparse|dense|double]_[dark|med|light|dead]_[s|m|l|xl] - ad0_baobab_0 = 'treeBaobab', - ad0_baobab_1 = 'treeBaobab', - ad0_baobab_2 = 'treeBaobab', - ad0_baobab_3 = 'treeBaobab', - ad0_baobab_4 = 'treeBaobab', - ad0_bush_2_l = 'bush', - ad0_bush_2_m = 'bush', - ad0_bush_2_s = 'bush', - ['ad0_bushes_l_1'] = 'bushLarge', - ['ad0_bushes_l_2'] = 'bushLarge', - ['ad0_bushes_l_3'] = 'bushLarge', - ['ad0_bushes_l_4'] = 'bushLarge', - ['ad0_bushes_l_5'] = 'bushLarge', - ['ad0_bushes_l_6'] = 'bushLarge', - ['ad0_bushes_l_7'] = 'bushLarge', - ['ad0_bushes_l_8'] = 'bushLarge', - ['ad0_bushes_xl_1'] = 'bushLarger', - ad0_bushes_xl_2 = 'bushLarger', - ad0_bushes_xl_3 = 'bushLarger', - ad0_bushes_xl_4 = 'bushLarger', - ad0_bushes_xl_5 = 'bushLarger', - ad0_bushes_xl_6 = 'bushLarger', - ad0_bushes_xl_7 = 'bushLarger', - ad0_bushes_m_1 = 'bushMedium', - ad0_bushes_m_2 = 'bushMedium', - ad0_bushes_m_3 = 'bushMedium', - ad0_bushes_m_4 = 'bushMedium', - ad0_bushes_m_5 = 'bushMedium', - ad0_bushes_m_6 = 'bushMedium', - ad0_bushes_m_7 = 'bushMedium', - ad0_bushes_s_1 = 'bushSmall', - ad0_bushes_s_2 = 'bushSmall', - ad0_bushes_s_3 = 'bushSmall', - ad0_bushes_s_4 = 'bushSmall', - ad0_bushes_s_5 = 'bushSmall', - ad0_bushes_s_6 = 'bushSmall', - ad0_bushes_s_7 = 'bushSmall', - btreechi_3 = 'treeCedar', - btreechi_4 = 'treeCedar', - btreeclo_1 = 'treeCedar', - btreeclo_2 = 'treeCedar', - btreeclo_4 = 'treeCedar', - cluster1_dead = 'treeDeadPalms', - cluster2_dead = 'treeDeadPalms', - cluster3_dead = 'treeDeadPalms', - artbirchbighi = 'treeDeciduous', - artbirchmediumhi = 'treeDeciduous', - artbircholdhi = 'treeDeciduous', - artbirchsmallhi = 'treeDeciduous', - artbirchwinterhi = 'treeDeciduous', - artbush1hi = 'treeDeciduous', - artbush2hi = 'treeDeciduous', - artbush3hi = 'treeDeciduous', - artbushweird1hi = 'treeDeciduous', - artbushweird2hi = 'treeDeciduous', - artmaplebasichi = 'treeDeciduous', - artmaplebighi = 'treeDeciduous', - artmapleoldhi = 'treeDeciduous', - artmapletallhi = 'treeDeciduous', - artmaplevarhi = 'treeDeciduous', - artmaplewinterhi = 'treeDeciduous', - artmapleyounghi = 'treeDeciduous', - artoakbasichi = 'treeDeciduous', - artoakbasicvarhi = 'treeDeciduous', - artoakbighi = 'treeDeciduous', - artoakgrandhi = 'treeDeciduous', - artoakoldhi = 'treeDeciduous', - artoaktallhi = 'treeDeciduous', - artoakyounghi = 'treeDeciduous', - ['btreea-1'] = 'treeDeciduous', - ['btreea-2'] = 'treeDeciduous', - ['btreea-3'] = 'treeDeciduous', - ['btreea-4'] = 'treeDeciduous', - ['btreea-5'] = 'treeDeciduous', - ['btreebhi-1'] = 'treeDeciduous', - ['btreebhi-2'] = 'treeDeciduous', - ['btreebhi-3'] = 'treeDeciduous', - ['btreebhi-4'] = 'treeDeciduous', - ['btreebhi-5'] = 'treeDeciduous', - ['btreeblo-1'] = 'treeDeciduous', - ['btreeblo-2'] = 'treeDeciduous', - ['btreeblo-3'] = 'treeDeciduous', - ['btreeblo-4'] = 'treeDeciduous', - ['btreeblo-5'] = 'treeDeciduous', - ['btreechi-1'] = 'treeDeciduous', - ['btreechi-2'] = 'treeDeciduous', - ['btreechi-3'] = 'treeDeciduous', - ['btreechi-4'] = 'treeDeciduous', - ['btreechi-5'] = 'treeDeciduous', - ['btreeclo-1'] = 'treeDeciduous', - ['btreeclo-2'] = 'treeDeciduous', - ['btreeclo-3'] = 'treeDeciduous', - ['btreeclo-4'] = 'treeDeciduous', - ['btreeclo-5'] = 'treeDeciduous', - cycas2 = 'fern', - fern_sword = 'fern', - fern2 = 'fern', - cycas6 = 'fernsStone', - cycas8 = 'fernsStone', - fern6 = 'fernStone', - fern8 = 'fernStone', - cycas1 = 'fernStones', - fern1 = 'fernStones', - cycas3 = 'ferns', - cycas4 = 'ferns', - cycas5 = 'ferns', - cycas7 = 'ferns', - fern3 = 'ferns', - fern4 = 'ferns', - fern5 = 'ferns', - fern7 = 'ferns', - fir_tree_small_1__tree_fir_tall_1 = 'treeFir', - fir_tree_small_1__tree_fir_tall_2 = 'treeFir', - fir_tree_small_1__tree_fir_tall_3 = 'treeFir', - fir_tree_small_1__tree_fir_tall_4 = 'treeFir', - fir_tree_small_1__tree_fir_tall_5 = 'treeFir', - fir_tree_small_2__tree_fir_tall_1 = 'treeFir', - fir_tree_small_2__tree_fir_tall_2 = 'treeFir', - fir_tree_small_2__tree_fir_tall_3 = 'treeFir', - fir_tree_small_2__tree_fir_tall_4 = 'treeFir', - fir_tree_small_2__tree_fir_tall_5 = 'treeFir', - fir_tree_small_3__tree_fir_tall_1 = 'treeFir', - fir_tree_small_3__tree_fir_tall_2 = 'treeFir', - fir_tree_small_3__tree_fir_tall_3 = 'treeFir', - fir_tree_small_3__tree_fir_tall_4 = 'treeFir', - fir_tree_small_3__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_1__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_2__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_3__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_4__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_5__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_6__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_7__tree_fir_tall_5 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_1 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_2 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_3 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_4 = 'treeFir', - fir_tree_tall_8__tree_fir_tall_5 = 'treeFir', - ad0_senegal_1 = 'treePalm', - ad0_senegal_1_large = 'treePalm', - ad0_senegal_2 = 'treePalm', - ad0_senegal_2_large = 'treePalm', - ad0_senegal_3 = 'treePalm', - ad0_senegal_3_large = 'treePalm', - ad0_senegal_4 = 'treePalm', - ad0_senegal_4_large = 'treePalm', - ad0_senegal_5 = 'treePalm', - ad0_senegal_5_large = 'treePalm', - ad0_senegal_6 = 'treePalm', - ad0_senegal_6_large = 'treePalm', - ad0_senegal_7 = 'treePalm', - ad0_senegal_7_large = 'treePalm', - cluster1 = 'treePalms', - cluster2 = 'treePalms', - cluster3 = 'treePalms', - treecluster1 = 'treePalms', - treecluster2 = 'treePalms', - treecluster3 = 'treePalms', - palmetto_1 = 'treePalmetto', - palmetto_2 = 'treePalmetto', - palmetto_3 = 'treePalmetto', - allpinesb_ad0_brown_a_l = 'treePine', - allpinesb_ad0_brown_a_l_lod1 = 'treePine', - allpinesb_ad0_brown_a_m = 'treePine', - allpinesb_ad0_brown_a_m_lod1 = 'treePine', - allpinesb_ad0_brown_a_s = 'treePine', - allpinesb_ad0_brown_a_s_lod1 = 'treePine', - allpinesb_ad0_brown_a_xl = 'treePine', - allpinesb_ad0_brown_a_xl_lod1 = 'treePine', - allpinesb_ad0_brown_a_xs = 'treePine', - allpinesb_ad0_brown_a_xxl = 'treePine', - allpinesb_ad0_brown_a_xxl_lod1 = 'treePine', - allpinesb_ad0_brown_b_l = 'treePine', - allpinesb_ad0_brown_b_l_lod1 = 'treePine', - allpinesb_ad0_brown_b_m = 'treePine', - allpinesb_ad0_brown_b_m_lod1 = 'treePine', - allpinesb_ad0_brown_b_s = 'treePine', - allpinesb_ad0_brown_b_s_lod1 = 'treePine', - allpinesb_ad0_brown_b_xl = 'treePine', - allpinesb_ad0_brown_b_xl_lod1 = 'treePine', - allpinesb_ad0_brown_b_xs = 'treePine', - allpinesb_ad0_brown_b_xxl = 'treePine', - allpinesb_ad0_brown_b_xxl_lod1 = 'treePine', - allpinesb_ad0_brown_c_l = 'treePine', - allpinesb_ad0_brown_c_l_lod1 = 'treePine', - allpinesb_ad0_brown_c_m = 'treePine', - allpinesb_ad0_brown_c_m_lod1 = 'treePine', - allpinesb_ad0_brown_c_s = 'treePine', - allpinesb_ad0_brown_c_s_lod1 = 'treePine', - allpinesb_ad0_brown_c_xl = 'treePine', - allpinesb_ad0_brown_c_xl_lod1 = 'treePine', - allpinesb_ad0_brown_c_xs = 'treePine', - allpinesb_ad0_brown_c_xxl = 'treePine', - allpinesb_ad0_brown_c_xxl_lod1 = 'treePine', - allpinesb_ad0_green_a_l = 'treePine', - allpinesb_ad0_green_a_l_lod1 = 'treePine', - allpinesb_ad0_green_a_m = 'treePine', - allpinesb_ad0_green_a_m_lod1 = 'treePine', - allpinesb_ad0_green_a_s = 'treePine', - allpinesb_ad0_green_a_s_lod1 = 'treePine', - allpinesb_ad0_green_a_xl = 'treePine', - allpinesb_ad0_green_a_xl_lod1 = 'treePine', - allpinesb_ad0_green_a_xs = 'treePine', - allpinesb_ad0_green_a_xxl = 'treePine', - allpinesb_ad0_green_a_xxl_lod1 = 'treePine', - allpinesb_ad0_green_b_l = 'treePine', - allpinesb_ad0_green_b_l_lod1 = 'treePine', - allpinesb_ad0_green_b_m = 'treePine', - allpinesb_ad0_green_b_m_lod1 = 'treePine', - allpinesb_ad0_green_b_s = 'treePine', - allpinesb_ad0_green_b_s_lod1 = 'treePine', - allpinesb_ad0_green_b_xl = 'treePine', - allpinesb_ad0_green_b_xl_lod1 = 'treePine', - allpinesb_ad0_green_b_xs = 'treePine', - allpinesb_ad0_green_b_xxl = 'treePine', - allpinesb_ad0_green_b_xxl_lod1 = 'treePine', - allpinesb_ad0_green_c_l = 'treePine', - allpinesb_ad0_green_c_l_lod1 = 'treePine', - allpinesb_ad0_green_c_m = 'treePine', - allpinesb_ad0_green_c_m_lod1 = 'treePine', - allpinesb_ad0_green_c_s = 'treePine', - allpinesb_ad0_green_c_s_lod1 = 'treePine', - allpinesb_ad0_green_c_xl = 'treePine', - allpinesb_ad0_green_c_xl_lod1 = 'treePine', - allpinesb_ad0_green_c_xs = 'treePine', - allpinesb_ad0_green_c_xxl = 'treePine', - allpinesb_ad0_green_c_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_a_l = 'treePine', - allpinesb_ad0_snow_a_l_lod1 = 'treePine', - allpinesb_ad0_snow_a_m = 'treePine', - allpinesb_ad0_snow_a_m_lod1 = 'treePine', - allpinesb_ad0_snow_a_s = 'treePine', - allpinesb_ad0_snow_a_s_lod1 = 'treePine', - allpinesb_ad0_snow_a_xl = 'treePine', - allpinesb_ad0_snow_a_xl_lod1 = 'treePine', - allpinesb_ad0_snow_a_xs = 'treePine', - allpinesb_ad0_snow_a_xxl = 'treePine', - allpinesb_ad0_snow_a_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_b_l = 'treePine', - allpinesb_ad0_snow_b_l_lod1 = 'treePine', - allpinesb_ad0_snow_b_m = 'treePine', - allpinesb_ad0_snow_b_m_lod1 = 'treePine', - allpinesb_ad0_snow_b_s = 'treePine', - allpinesb_ad0_snow_b_s_lod1 = 'treePine', - allpinesb_ad0_snow_b_xl = 'treePine', - allpinesb_ad0_snow_b_xl_lod1 = 'treePine', - allpinesb_ad0_snow_b_xs = 'treePine', - allpinesb_ad0_snow_b_xxl = 'treePine', - allpinesb_ad0_snow_b_xxl_lod1 = 'treePine', - allpinesb_ad0_snow_c_l = 'treePine', - allpinesb_ad0_snow_c_l_lod1 = 'treePine', - allpinesb_ad0_snow_c_m = 'treePine', - allpinesb_ad0_snow_c_m_lod1 = 'treePine', - allpinesb_ad0_snow_c_s = 'treePine', - allpinesb_ad0_snow_c_s_lod1 = 'treePine', - allpinesb_ad0_snow_c_xl = 'treePine', - allpinesb_ad0_snow_c_xl_lod1 = 'treePine', - allpinesb_ad0_snow_c_xs = 'treePine', - allpinesb_ad0_snow_c_xxl = 'treePine', - allpinesb_ad0_snow_c_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_l = 'treePine', - allpinesb_ad0_snowgreen_a_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_m = 'treePine', - allpinesb_ad0_snowgreen_a_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_s = 'treePine', - allpinesb_ad0_snowgreen_a_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_xl = 'treePine', - allpinesb_ad0_snowgreen_a_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_a_xs = 'treePine', - allpinesb_ad0_snowgreen_a_xxl = 'treePine', - allpinesb_ad0_snowgreen_a_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_l = 'treePine', - allpinesb_ad0_snowgreen_b_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_m = 'treePine', - allpinesb_ad0_snowgreen_b_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_s = 'treePine', - allpinesb_ad0_snowgreen_b_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_xl = 'treePine', - allpinesb_ad0_snowgreen_b_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_b_xs = 'treePine', - allpinesb_ad0_snowgreen_b_xxl = 'treePine', - allpinesb_ad0_snowgreen_b_xxl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_l = 'treePine', - allpinesb_ad0_snowgreen_c_l_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_m = 'treePine', - allpinesb_ad0_snowgreen_c_m_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_s = 'treePine', - allpinesb_ad0_snowgreen_c_s_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_xl = 'treePine', - allpinesb_ad0_snowgreen_c_xl_lod1 = 'treePine', - allpinesb_ad0_snowgreen_c_xs = 'treePine', - allpinesb_ad0_snowgreen_c_xxl = 'treePine', - allpinesb_ad0_snowgreen_c_xxl_lod1 = 'treePine', - lowpoly_tree_pinetree1large = 'treePine', - lowpoly_tree_pinetree1largeburnt = 'treePine', - lowpoly_tree_pinetree1medium = 'treePine', - lowpoly_tree_pinetree1mediumburnt = 'treePine', - lowpoly_tree_pinetree1small = 'treePine', - lowpoly_tree_pinetree1smallburnt = 'treePine', - lowpoly_tree_pinetree1tiny = 'treePine', - lowpoly_tree_pinetree1tinyburnt = 'treePine', - lowpoly_tree_pinetree2large = 'treePine', - lowpoly_tree_pinetree2largeburnt = 'treePine', - lowpoly_tree_pinetree2medium = 'treePine', - lowpoly_tree_pinetree2mediumburnt = 'treePine', - lowpoly_tree_pinetree2small = 'treePine', - lowpoly_tree_pinetree2smallburnt = 'treePine', - lowpoly_tree_pinetree2tiny = 'treePine', - lowpoly_tree_pinetree2tinyburnt = 'treePine', - lowpoly_tree_pinetree3large = 'treePine', - lowpoly_tree_pinetree3largeburnt = 'treePine', - lowpoly_tree_pinetree3medium = 'treePine', - lowpoly_tree_pinetree3mediumburnt = 'treePine', - lowpoly_tree_pinetree3small = 'treePine', - lowpoly_tree_pinetree3smallburnt = 'treePine', - lowpoly_tree_pinetree3tiny = 'treePine', - lowpoly_tree_pinetree3tinyburnt = 'treePine', - lowpoly_tree_snowypinetree1large = 'treePine', - lowpoly_tree_snowypinetree1medium = 'treePine', - lowpoly_tree_snowypinetree1small = 'treePine', - lowpoly_tree_snowypinetree1tiny = 'treePine', - lowpoly_tree_snowypinetree2large = 'treePine', - lowpoly_tree_snowypinetree2medium = 'treePine', - lowpoly_tree_snowypinetree2small = 'treePine', - lowpoly_tree_snowypinetree2tiny = 'treePine', - lowpoly_tree_snowypinetree3large = 'treePine', - lowpoly_tree_snowypinetree3medium = 'treePine', - lowpoly_tree_snowypinetree3small = 'treePine', - lowpoly_tree_snowypinetree3tiny = 'treePine', - cedar_atlas_1__cedar_atlas_1 = 'treeCedar', - cedar_atlas_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_1__cedar_atlas_dead = 'treeCedar', - cedar_atlas_2__cedar_atlas_1 = 'treeCedar', - cedar_atlas_2__cedar_atlas_2 = 'treeCedar', - cedar_atlas_2__cedar_atlas_dead = 'treeCedar', - cedar_atlas_3__cedar_atlas_1 = 'treeCedar', - cedar_atlas_3__cedar_atlas_2 = 'treeCedar', - cedar_atlas_3__cedar_atlas_dead = 'treeCedar', - cedar_atlas_sapling_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_1__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_1__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_2__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_2__cedar_atlas_2 = 'treeCedar', - cedar_atlas_young_3__cedar_atlas_1 = 'treeCedar', - cedar_atlas_young_3__cedar_atlas_2 = 'treeCedar', - fir_sapling_1__cedar_atlas_2 = 'treeFir', - fir_sapling_2__cedar_atlas_2 = 'treeFir', + ad0_banyan_1 = "treeBanyan", + ad0_banyan_2 = "treeBanyan", + ad0_banyan_3 = "treeBanyan", + ad0_banyan_4 = "treeBanyan", + ad0_banyan_5 = "treeBanyan", + ad0_banyan_6 = "treeBanyan", + ad0_aleppo_1 = "treeAleppoPine", + ad0_aleppo_2 = "treeAleppoPine", + ad0_aleppo_3 = "treeAleppoPine", + ad0_aleppo_4 = "treeAleppoPine", + ad0_aleppo_5 = "treeAleppoPine", + ad0_aleppo_6 = "treeAleppoPine", + ad0_aleppo_7 = "treeAleppoPine", + ad0_aleppo_8 = "treeAleppoPine", + ad0_aleppo_9 = "treeAleppoPine", + ad0_aleppo_10 = "treeAleppoPine", + ad0_aleppo2_dense_dark_l = "treeAleppoPine", + ad0_aleppo2_dense_dark_m = "treeAleppoPine", + ad0_aleppo2_dense_dark_s = "treeAleppoPine", + ad0_aleppo2_dense_dark_xl = "treeAleppoPine", + ad0_aleppo2_dense_dead_l = "treeAleppoPine", + ad0_aleppo2_dense_dead_m = "treeAleppoPine", + ad0_aleppo2_dense_dead_s = "treeAleppoPine", + ad0_aleppo2_dense_dead_xl = "treeAleppoPine", + ad0_aleppo2_dense_light_l = "treeAleppoPine", + ad0_aleppo2_dense_light_m = "treeAleppoPine", + ad0_aleppo2_dense_light_s = "treeAleppoPine", + ad0_aleppo2_dense_light_xl = "treeAleppoPine", + ad0_aleppo2_dense_med_l = "treeAleppoPine", + ad0_aleppo2_dense_med_m = "treeAleppoPine", + ad0_aleppo2_dense_med_s = "treeAleppoPine", + ad0_aleppo2_dense_med_xl = "treeAleppoPine", + ad0_aleppo2_double_dark_l = "treeAleppoPine", + ad0_aleppo2_double_dark_m = "treeAleppoPine", + ad0_aleppo2_double_dark_s = "treeAleppoPine", + ad0_aleppo2_double_dark_xl = "treeAleppoPine", + ad0_aleppo2_double_dead_l = "treeAleppoPine", + ad0_aleppo2_double_dead_m = "treeAleppoPine", + ad0_aleppo2_double_dead_s = "treeAleppoPine", + ad0_aleppo2_double_dead_xl = "treeAleppoPine", + ad0_aleppo2_double_light_l = "treeAleppoPine", + ad0_aleppo2_double_light_m = "treeAleppoPine", + ad0_aleppo2_double_light_s = "treeAleppoPine", + ad0_aleppo2_double_light_xl = "treeAleppoPine", + ad0_aleppo2_double_med_l = "treeAleppoPine", + ad0_aleppo2_double_med_m = "treeAleppoPine", + ad0_aleppo2_double_med_s = "treeAleppoPine", + ad0_aleppo2_double_med_xl = "treeAleppoPine", + ad0_aleppo2_sparse_dark_l = "treeAleppoPine", + ad0_aleppo2_sparse_dark_m = "treeAleppoPine", + ad0_aleppo2_sparse_dark_s = "treeAleppoPine", + ad0_aleppo2_sparse_dark_xl = "treeAleppoPine", + ad0_aleppo2_sparse_dead_l = "treeAleppoPine", + ad0_aleppo2_sparse_dead_m = "treeAleppoPine", + ad0_aleppo2_sparse_dead_s = "treeAleppoPine", + ad0_aleppo2_sparse_dead_xl = "treeAleppoPine", + ad0_aleppo2_sparse_light_l = "treeAleppoPine", + ad0_aleppo2_sparse_light_m = "treeAleppoPine", + ad0_aleppo2_sparse_light_s = "treeAleppoPine", + ad0_aleppo2_sparse_light_xl = "treeAleppoPine", + ad0_aleppo2_sparse_med_l = "treeAleppoPine", + ad0_aleppo2_sparse_med_m = "treeAleppoPine", + ad0_aleppo2_sparse_med_s = "treeAleppoPine", + ad0_aleppo2_sparse_med_xl = "treeAleppoPine", -- ad0_aleppo2_[sparse|dense|double]_[dark|med|light|dead]_[s|m|l|xl] + ad0_baobab_0 = "treeBaobab", + ad0_baobab_1 = "treeBaobab", + ad0_baobab_2 = "treeBaobab", + ad0_baobab_3 = "treeBaobab", + ad0_baobab_4 = "treeBaobab", + ad0_bush_2_l = "bush", + ad0_bush_2_m = "bush", + ad0_bush_2_s = "bush", + ["ad0_bushes_l_1"] = "bushLarge", + ["ad0_bushes_l_2"] = "bushLarge", + ["ad0_bushes_l_3"] = "bushLarge", + ["ad0_bushes_l_4"] = "bushLarge", + ["ad0_bushes_l_5"] = "bushLarge", + ["ad0_bushes_l_6"] = "bushLarge", + ["ad0_bushes_l_7"] = "bushLarge", + ["ad0_bushes_l_8"] = "bushLarge", + ["ad0_bushes_xl_1"] = "bushLarger", + ad0_bushes_xl_2 = "bushLarger", + ad0_bushes_xl_3 = "bushLarger", + ad0_bushes_xl_4 = "bushLarger", + ad0_bushes_xl_5 = "bushLarger", + ad0_bushes_xl_6 = "bushLarger", + ad0_bushes_xl_7 = "bushLarger", + ad0_bushes_m_1 = "bushMedium", + ad0_bushes_m_2 = "bushMedium", + ad0_bushes_m_3 = "bushMedium", + ad0_bushes_m_4 = "bushMedium", + ad0_bushes_m_5 = "bushMedium", + ad0_bushes_m_6 = "bushMedium", + ad0_bushes_m_7 = "bushMedium", + ad0_bushes_s_1 = "bushSmall", + ad0_bushes_s_2 = "bushSmall", + ad0_bushes_s_3 = "bushSmall", + ad0_bushes_s_4 = "bushSmall", + ad0_bushes_s_5 = "bushSmall", + ad0_bushes_s_6 = "bushSmall", + ad0_bushes_s_7 = "bushSmall", + btreechi_3 = "treeCedar", + btreechi_4 = "treeCedar", + btreeclo_1 = "treeCedar", + btreeclo_2 = "treeCedar", + btreeclo_4 = "treeCedar", + cluster1_dead = "treeDeadPalms", + cluster2_dead = "treeDeadPalms", + cluster3_dead = "treeDeadPalms", + artbirchbighi = "treeDeciduous", + artbirchmediumhi = "treeDeciduous", + artbircholdhi = "treeDeciduous", + artbirchsmallhi = "treeDeciduous", + artbirchwinterhi = "treeDeciduous", + artbush1hi = "treeDeciduous", + artbush2hi = "treeDeciduous", + artbush3hi = "treeDeciduous", + artbushweird1hi = "treeDeciduous", + artbushweird2hi = "treeDeciduous", + artmaplebasichi = "treeDeciduous", + artmaplebighi = "treeDeciduous", + artmapleoldhi = "treeDeciduous", + artmapletallhi = "treeDeciduous", + artmaplevarhi = "treeDeciduous", + artmaplewinterhi = "treeDeciduous", + artmapleyounghi = "treeDeciduous", + artoakbasichi = "treeDeciduous", + artoakbasicvarhi = "treeDeciduous", + artoakbighi = "treeDeciduous", + artoakgrandhi = "treeDeciduous", + artoakoldhi = "treeDeciduous", + artoaktallhi = "treeDeciduous", + artoakyounghi = "treeDeciduous", + ["btreea-1"] = "treeDeciduous", + ["btreea-2"] = "treeDeciduous", + ["btreea-3"] = "treeDeciduous", + ["btreea-4"] = "treeDeciduous", + ["btreea-5"] = "treeDeciduous", + ["btreebhi-1"] = "treeDeciduous", + ["btreebhi-2"] = "treeDeciduous", + ["btreebhi-3"] = "treeDeciduous", + ["btreebhi-4"] = "treeDeciduous", + ["btreebhi-5"] = "treeDeciduous", + ["btreeblo-1"] = "treeDeciduous", + ["btreeblo-2"] = "treeDeciduous", + ["btreeblo-3"] = "treeDeciduous", + ["btreeblo-4"] = "treeDeciduous", + ["btreeblo-5"] = "treeDeciduous", + ["btreechi-1"] = "treeDeciduous", + ["btreechi-2"] = "treeDeciduous", + ["btreechi-3"] = "treeDeciduous", + ["btreechi-4"] = "treeDeciduous", + ["btreechi-5"] = "treeDeciduous", + ["btreeclo-1"] = "treeDeciduous", + ["btreeclo-2"] = "treeDeciduous", + ["btreeclo-3"] = "treeDeciduous", + ["btreeclo-4"] = "treeDeciduous", + ["btreeclo-5"] = "treeDeciduous", + cycas2 = "fern", + fern_sword = "fern", + fern2 = "fern", + cycas6 = "fernsStone", + cycas8 = "fernsStone", + fern6 = "fernStone", + fern8 = "fernStone", + cycas1 = "fernStones", + fern1 = "fernStones", + cycas3 = "ferns", + cycas4 = "ferns", + cycas5 = "ferns", + cycas7 = "ferns", + fern3 = "ferns", + fern4 = "ferns", + fern5 = "ferns", + fern7 = "ferns", + fir_tree_small_1__tree_fir_tall_1 = "treeFir", + fir_tree_small_1__tree_fir_tall_2 = "treeFir", + fir_tree_small_1__tree_fir_tall_3 = "treeFir", + fir_tree_small_1__tree_fir_tall_4 = "treeFir", + fir_tree_small_1__tree_fir_tall_5 = "treeFir", + fir_tree_small_2__tree_fir_tall_1 = "treeFir", + fir_tree_small_2__tree_fir_tall_2 = "treeFir", + fir_tree_small_2__tree_fir_tall_3 = "treeFir", + fir_tree_small_2__tree_fir_tall_4 = "treeFir", + fir_tree_small_2__tree_fir_tall_5 = "treeFir", + fir_tree_small_3__tree_fir_tall_1 = "treeFir", + fir_tree_small_3__tree_fir_tall_2 = "treeFir", + fir_tree_small_3__tree_fir_tall_3 = "treeFir", + fir_tree_small_3__tree_fir_tall_4 = "treeFir", + fir_tree_small_3__tree_fir_tall_5 = "treeFir", + fir_tree_tall_1__tree_fir_tall_1 = "treeFir", + fir_tree_tall_1__tree_fir_tall_2 = "treeFir", + fir_tree_tall_1__tree_fir_tall_3 = "treeFir", + fir_tree_tall_1__tree_fir_tall_4 = "treeFir", + fir_tree_tall_1__tree_fir_tall_5 = "treeFir", + fir_tree_tall_2__tree_fir_tall_1 = "treeFir", + fir_tree_tall_2__tree_fir_tall_2 = "treeFir", + fir_tree_tall_2__tree_fir_tall_3 = "treeFir", + fir_tree_tall_2__tree_fir_tall_4 = "treeFir", + fir_tree_tall_2__tree_fir_tall_5 = "treeFir", + fir_tree_tall_3__tree_fir_tall_1 = "treeFir", + fir_tree_tall_3__tree_fir_tall_2 = "treeFir", + fir_tree_tall_3__tree_fir_tall_3 = "treeFir", + fir_tree_tall_3__tree_fir_tall_4 = "treeFir", + fir_tree_tall_3__tree_fir_tall_5 = "treeFir", + fir_tree_tall_4__tree_fir_tall_1 = "treeFir", + fir_tree_tall_4__tree_fir_tall_2 = "treeFir", + fir_tree_tall_4__tree_fir_tall_3 = "treeFir", + fir_tree_tall_4__tree_fir_tall_4 = "treeFir", + fir_tree_tall_4__tree_fir_tall_5 = "treeFir", + fir_tree_tall_5__tree_fir_tall_1 = "treeFir", + fir_tree_tall_5__tree_fir_tall_2 = "treeFir", + fir_tree_tall_5__tree_fir_tall_3 = "treeFir", + fir_tree_tall_5__tree_fir_tall_4 = "treeFir", + fir_tree_tall_5__tree_fir_tall_5 = "treeFir", + fir_tree_tall_6__tree_fir_tall_1 = "treeFir", + fir_tree_tall_6__tree_fir_tall_2 = "treeFir", + fir_tree_tall_6__tree_fir_tall_3 = "treeFir", + fir_tree_tall_6__tree_fir_tall_4 = "treeFir", + fir_tree_tall_6__tree_fir_tall_5 = "treeFir", + fir_tree_tall_7__tree_fir_tall_1 = "treeFir", + fir_tree_tall_7__tree_fir_tall_2 = "treeFir", + fir_tree_tall_7__tree_fir_tall_3 = "treeFir", + fir_tree_tall_7__tree_fir_tall_4 = "treeFir", + fir_tree_tall_7__tree_fir_tall_5 = "treeFir", + fir_tree_tall_8__tree_fir_tall_1 = "treeFir", + fir_tree_tall_8__tree_fir_tall_2 = "treeFir", + fir_tree_tall_8__tree_fir_tall_3 = "treeFir", + fir_tree_tall_8__tree_fir_tall_4 = "treeFir", + fir_tree_tall_8__tree_fir_tall_5 = "treeFir", + ad0_senegal_1 = "treePalm", + ad0_senegal_1_large = "treePalm", + ad0_senegal_2 = "treePalm", + ad0_senegal_2_large = "treePalm", + ad0_senegal_3 = "treePalm", + ad0_senegal_3_large = "treePalm", + ad0_senegal_4 = "treePalm", + ad0_senegal_4_large = "treePalm", + ad0_senegal_5 = "treePalm", + ad0_senegal_5_large = "treePalm", + ad0_senegal_6 = "treePalm", + ad0_senegal_6_large = "treePalm", + ad0_senegal_7 = "treePalm", + ad0_senegal_7_large = "treePalm", + cluster1 = "treePalms", + cluster2 = "treePalms", + cluster3 = "treePalms", + treecluster1 = "treePalms", + treecluster2 = "treePalms", + treecluster3 = "treePalms", + palmetto_1 = "treePalmetto", + palmetto_2 = "treePalmetto", + palmetto_3 = "treePalmetto", + allpinesb_ad0_brown_a_l = "treePine", + allpinesb_ad0_brown_a_l_lod1 = "treePine", + allpinesb_ad0_brown_a_m = "treePine", + allpinesb_ad0_brown_a_m_lod1 = "treePine", + allpinesb_ad0_brown_a_s = "treePine", + allpinesb_ad0_brown_a_s_lod1 = "treePine", + allpinesb_ad0_brown_a_xl = "treePine", + allpinesb_ad0_brown_a_xl_lod1 = "treePine", + allpinesb_ad0_brown_a_xs = "treePine", + allpinesb_ad0_brown_a_xxl = "treePine", + allpinesb_ad0_brown_a_xxl_lod1 = "treePine", + allpinesb_ad0_brown_b_l = "treePine", + allpinesb_ad0_brown_b_l_lod1 = "treePine", + allpinesb_ad0_brown_b_m = "treePine", + allpinesb_ad0_brown_b_m_lod1 = "treePine", + allpinesb_ad0_brown_b_s = "treePine", + allpinesb_ad0_brown_b_s_lod1 = "treePine", + allpinesb_ad0_brown_b_xl = "treePine", + allpinesb_ad0_brown_b_xl_lod1 = "treePine", + allpinesb_ad0_brown_b_xs = "treePine", + allpinesb_ad0_brown_b_xxl = "treePine", + allpinesb_ad0_brown_b_xxl_lod1 = "treePine", + allpinesb_ad0_brown_c_l = "treePine", + allpinesb_ad0_brown_c_l_lod1 = "treePine", + allpinesb_ad0_brown_c_m = "treePine", + allpinesb_ad0_brown_c_m_lod1 = "treePine", + allpinesb_ad0_brown_c_s = "treePine", + allpinesb_ad0_brown_c_s_lod1 = "treePine", + allpinesb_ad0_brown_c_xl = "treePine", + allpinesb_ad0_brown_c_xl_lod1 = "treePine", + allpinesb_ad0_brown_c_xs = "treePine", + allpinesb_ad0_brown_c_xxl = "treePine", + allpinesb_ad0_brown_c_xxl_lod1 = "treePine", + allpinesb_ad0_green_a_l = "treePine", + allpinesb_ad0_green_a_l_lod1 = "treePine", + allpinesb_ad0_green_a_m = "treePine", + allpinesb_ad0_green_a_m_lod1 = "treePine", + allpinesb_ad0_green_a_s = "treePine", + allpinesb_ad0_green_a_s_lod1 = "treePine", + allpinesb_ad0_green_a_xl = "treePine", + allpinesb_ad0_green_a_xl_lod1 = "treePine", + allpinesb_ad0_green_a_xs = "treePine", + allpinesb_ad0_green_a_xxl = "treePine", + allpinesb_ad0_green_a_xxl_lod1 = "treePine", + allpinesb_ad0_green_b_l = "treePine", + allpinesb_ad0_green_b_l_lod1 = "treePine", + allpinesb_ad0_green_b_m = "treePine", + allpinesb_ad0_green_b_m_lod1 = "treePine", + allpinesb_ad0_green_b_s = "treePine", + allpinesb_ad0_green_b_s_lod1 = "treePine", + allpinesb_ad0_green_b_xl = "treePine", + allpinesb_ad0_green_b_xl_lod1 = "treePine", + allpinesb_ad0_green_b_xs = "treePine", + allpinesb_ad0_green_b_xxl = "treePine", + allpinesb_ad0_green_b_xxl_lod1 = "treePine", + allpinesb_ad0_green_c_l = "treePine", + allpinesb_ad0_green_c_l_lod1 = "treePine", + allpinesb_ad0_green_c_m = "treePine", + allpinesb_ad0_green_c_m_lod1 = "treePine", + allpinesb_ad0_green_c_s = "treePine", + allpinesb_ad0_green_c_s_lod1 = "treePine", + allpinesb_ad0_green_c_xl = "treePine", + allpinesb_ad0_green_c_xl_lod1 = "treePine", + allpinesb_ad0_green_c_xs = "treePine", + allpinesb_ad0_green_c_xxl = "treePine", + allpinesb_ad0_green_c_xxl_lod1 = "treePine", + allpinesb_ad0_snow_a_l = "treePine", + allpinesb_ad0_snow_a_l_lod1 = "treePine", + allpinesb_ad0_snow_a_m = "treePine", + allpinesb_ad0_snow_a_m_lod1 = "treePine", + allpinesb_ad0_snow_a_s = "treePine", + allpinesb_ad0_snow_a_s_lod1 = "treePine", + allpinesb_ad0_snow_a_xl = "treePine", + allpinesb_ad0_snow_a_xl_lod1 = "treePine", + allpinesb_ad0_snow_a_xs = "treePine", + allpinesb_ad0_snow_a_xxl = "treePine", + allpinesb_ad0_snow_a_xxl_lod1 = "treePine", + allpinesb_ad0_snow_b_l = "treePine", + allpinesb_ad0_snow_b_l_lod1 = "treePine", + allpinesb_ad0_snow_b_m = "treePine", + allpinesb_ad0_snow_b_m_lod1 = "treePine", + allpinesb_ad0_snow_b_s = "treePine", + allpinesb_ad0_snow_b_s_lod1 = "treePine", + allpinesb_ad0_snow_b_xl = "treePine", + allpinesb_ad0_snow_b_xl_lod1 = "treePine", + allpinesb_ad0_snow_b_xs = "treePine", + allpinesb_ad0_snow_b_xxl = "treePine", + allpinesb_ad0_snow_b_xxl_lod1 = "treePine", + allpinesb_ad0_snow_c_l = "treePine", + allpinesb_ad0_snow_c_l_lod1 = "treePine", + allpinesb_ad0_snow_c_m = "treePine", + allpinesb_ad0_snow_c_m_lod1 = "treePine", + allpinesb_ad0_snow_c_s = "treePine", + allpinesb_ad0_snow_c_s_lod1 = "treePine", + allpinesb_ad0_snow_c_xl = "treePine", + allpinesb_ad0_snow_c_xl_lod1 = "treePine", + allpinesb_ad0_snow_c_xs = "treePine", + allpinesb_ad0_snow_c_xxl = "treePine", + allpinesb_ad0_snow_c_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_l = "treePine", + allpinesb_ad0_snowgreen_a_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_m = "treePine", + allpinesb_ad0_snowgreen_a_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_s = "treePine", + allpinesb_ad0_snowgreen_a_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_xl = "treePine", + allpinesb_ad0_snowgreen_a_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_a_xs = "treePine", + allpinesb_ad0_snowgreen_a_xxl = "treePine", + allpinesb_ad0_snowgreen_a_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_l = "treePine", + allpinesb_ad0_snowgreen_b_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_m = "treePine", + allpinesb_ad0_snowgreen_b_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_s = "treePine", + allpinesb_ad0_snowgreen_b_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_xl = "treePine", + allpinesb_ad0_snowgreen_b_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_b_xs = "treePine", + allpinesb_ad0_snowgreen_b_xxl = "treePine", + allpinesb_ad0_snowgreen_b_xxl_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_l = "treePine", + allpinesb_ad0_snowgreen_c_l_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_m = "treePine", + allpinesb_ad0_snowgreen_c_m_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_s = "treePine", + allpinesb_ad0_snowgreen_c_s_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_xl = "treePine", + allpinesb_ad0_snowgreen_c_xl_lod1 = "treePine", + allpinesb_ad0_snowgreen_c_xs = "treePine", + allpinesb_ad0_snowgreen_c_xxl = "treePine", + allpinesb_ad0_snowgreen_c_xxl_lod1 = "treePine", + lowpoly_tree_pinetree1large = "treePine", + lowpoly_tree_pinetree1largeburnt = "treePine", + lowpoly_tree_pinetree1medium = "treePine", + lowpoly_tree_pinetree1mediumburnt = "treePine", + lowpoly_tree_pinetree1small = "treePine", + lowpoly_tree_pinetree1smallburnt = "treePine", + lowpoly_tree_pinetree1tiny = "treePine", + lowpoly_tree_pinetree1tinyburnt = "treePine", + lowpoly_tree_pinetree2large = "treePine", + lowpoly_tree_pinetree2largeburnt = "treePine", + lowpoly_tree_pinetree2medium = "treePine", + lowpoly_tree_pinetree2mediumburnt = "treePine", + lowpoly_tree_pinetree2small = "treePine", + lowpoly_tree_pinetree2smallburnt = "treePine", + lowpoly_tree_pinetree2tiny = "treePine", + lowpoly_tree_pinetree2tinyburnt = "treePine", + lowpoly_tree_pinetree3large = "treePine", + lowpoly_tree_pinetree3largeburnt = "treePine", + lowpoly_tree_pinetree3medium = "treePine", + lowpoly_tree_pinetree3mediumburnt = "treePine", + lowpoly_tree_pinetree3small = "treePine", + lowpoly_tree_pinetree3smallburnt = "treePine", + lowpoly_tree_pinetree3tiny = "treePine", + lowpoly_tree_pinetree3tinyburnt = "treePine", + lowpoly_tree_snowypinetree1large = "treePine", + lowpoly_tree_snowypinetree1medium = "treePine", + lowpoly_tree_snowypinetree1small = "treePine", + lowpoly_tree_snowypinetree1tiny = "treePine", + lowpoly_tree_snowypinetree2large = "treePine", + lowpoly_tree_snowypinetree2medium = "treePine", + lowpoly_tree_snowypinetree2small = "treePine", + lowpoly_tree_snowypinetree2tiny = "treePine", + lowpoly_tree_snowypinetree3large = "treePine", + lowpoly_tree_snowypinetree3medium = "treePine", + lowpoly_tree_snowypinetree3small = "treePine", + lowpoly_tree_snowypinetree3tiny = "treePine", + cedar_atlas_1__cedar_atlas_1 = "treeCedar", + cedar_atlas_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_1__cedar_atlas_dead = "treeCedar", + cedar_atlas_2__cedar_atlas_1 = "treeCedar", + cedar_atlas_2__cedar_atlas_2 = "treeCedar", + cedar_atlas_2__cedar_atlas_dead = "treeCedar", + cedar_atlas_3__cedar_atlas_1 = "treeCedar", + cedar_atlas_3__cedar_atlas_2 = "treeCedar", + cedar_atlas_3__cedar_atlas_dead = "treeCedar", + cedar_atlas_sapling_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_1__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_1__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_2__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_2__cedar_atlas_2 = "treeCedar", + cedar_atlas_young_3__cedar_atlas_1 = "treeCedar", + cedar_atlas_young_3__cedar_atlas_2 = "treeCedar", + fir_sapling_1__cedar_atlas_2 = "treeFir", + fir_sapling_2__cedar_atlas_2 = "treeFir", smothdeadtree1 = "deadTree", smothtree123dead = "deadTree", - treetype0 = 'tree', - treetype1 = 'tree', - treetype2 = 'tree', - treetype3 = 'tree', - treetype4 = 'tree', - treetype5 = 'tree', - treetype6 = 'tree', - treetype7 = 'tree', - treetype8 = 'tree', - treetype9 = 'tree', - treetype10 = 'tree', - treetype11 = 'tree', - treetype12 = 'tree', - treetype13 = 'tree', - treetype14 = 'tree', - treetype15 = 'tree', + treetype0 = "tree", + treetype1 = "tree", + treetype2 = "tree", + treetype3 = "tree", + treetype4 = "tree", + treetype5 = "tree", + treetype6 = "tree", + treetype7 = "tree", + treetype8 = "tree", + treetype9 = "tree", + treetype10 = "tree", + treetype11 = "tree", + treetype12 = "tree", + treetype13 = "tree", + treetype14 = "tree", + treetype15 = "tree", } -return knowntrees \ No newline at end of file +return knowntrees diff --git a/modelmaterials_gl4/templates/defaultMaterialTemplate.lua b/modelmaterials_gl4/templates/defaultMaterialTemplate.lua index a7a5a2a1506..8415e3df919 100644 --- a/modelmaterials_gl4/templates/defaultMaterialTemplate.lua +++ b/modelmaterials_gl4/templates/defaultMaterialTemplate.lua @@ -5,42 +5,40 @@ local shaderTemplate = { vertex = vssrc, - fragment = fssrc, + fragment = fssrc, uniformInt = { - texture1 = 0, - texture2 = 1, - normalTex = 2, + texture1 = 0, + texture2 = 1, + normalTex = 2, - texture1w = 3, - texture2w = 4, - normalTexw = 5, + texture1w = 3, + texture2w = 4, + normalTexw = 5, - shadowTex = 6, - reflectTex = 7, + shadowTex = 6, + reflectTex = 7, - losMapTex = 8, - brdfLUT = 9, + losMapTex = 8, + brdfLUT = 9, noisetex3dcube = 10, envLUT = 11, -- envLUT = 10, -- uncomment this if we want environment mapping back USE_ENVIRONMENT_DIFFUSE || USE_ENVIRONMENT_SPECULAR }, - uniformFloat = { - - }, + uniformFloat = {}, } -- local SKIN_SUPPORT = Script.IsEngineMinVersion(105, 0, 1653) and "1" or "0" -- SKIN_SUPPORT is now always on since 1653 local USEQUATERNIONS = (Engine.FeatureSupport.transformsInGL4 and "1") or "0" -local SLERPQUATERIONS = nil-- "#define SLERPQUATERIONS 1" -- nil to disable slerping and just use lerp +local SLERPQUATERIONS = nil -- "#define SLERPQUATERIONS 1" -- nil to disable slerping and just use lerp local defaultMaterialTemplate = { --standardUniforms --locs, set by api_cus --deferredUniforms --locs, set by api_cus - shader = shaderTemplate, -- `shader` is replaced with standardShader later in api_cus - deferred = shaderTemplate, -- `deferred` is replaced with deferredShader later in api_cus - shadow = shaderTemplate, -- `shadow` is replaced with deferredShader later in api_cus + shader = shaderTemplate, -- `shader` is replaced with standardShader later in api_cus + deferred = shaderTemplate, -- `deferred` is replaced with deferredShader later in api_cus + shadow = shaderTemplate, -- `shadow` is replaced with deferredShader later in api_cus reflection = shaderTemplate, -- `shadow` is replaced with deferredShader later in api_cus -- note these definitions below are not inherited!!! @@ -60,7 +58,7 @@ local defaultMaterialTemplate = { "#define TONEMAP(c) CustomTM(c)", "#define SHIFT_RGBHSV", - "#define USEQUATERNIONS "..USEQUATERNIONS, + "#define USEQUATERNIONS " .. USEQUATERNIONS, SLERPQUATERIONS, }, deferredDefinitions = { @@ -78,13 +76,13 @@ local defaultMaterialTemplate = { "#define TONEMAP(c) CustomTM(c)", "#define SHIFT_RGBHSV", - "#define USEQUATERNIONS "..USEQUATERNIONS, + "#define USEQUATERNIONS " .. USEQUATERNIONS, SLERPQUATERIONS, }, shadowDefinitions = { "#define RENDERING_MODE 2", - "#define SUPPORT_DEPTH_LAYOUT ".. tostring((Platform.glSupportFragDepthLayout and 1) or 0), - "#define SUPPORT_CLIP_CONTROL ".. tostring((Platform.glSupportClipSpaceControl and 1) or 0), + "#define SUPPORT_DEPTH_LAYOUT " .. tostring((Platform.glSupportFragDepthLayout and 1) or 0), + "#define SUPPORT_CLIP_CONTROL " .. tostring((Platform.glSupportClipSpaceControl and 1) or 0), [[ #if (RENDERING_MODE == 2) //shadows pass. AMD requests that extensions are declared right on top of the shader #if (SUPPORT_DEPTH_LAYOUT == 1) @@ -95,7 +93,7 @@ local defaultMaterialTemplate = { #endif #endif ]], - "#define USEQUATERNIONS "..USEQUATERNIONS, + "#define USEQUATERNIONS " .. USEQUATERNIONS, SLERPQUATERIONS, }, reflectionDefinitions = { @@ -113,58 +111,57 @@ local defaultMaterialTemplate = { "#define TONEMAP(c) CustomTM(c)", "#define REFLECT_DISCARD", - "#define USEQUATERNIONS "..USEQUATERNIONS, + "#define USEQUATERNIONS " .. USEQUATERNIONS, SLERPQUATERIONS, }, shaderOptions = { - shadowmapping = true, - normalmapping = false, + shadowmapping = true, + normalmapping = false, - vertex_ao = false, - flashlights = false, - shift_rgbhsv = false, + vertex_ao = false, + flashlights = false, + shift_rgbhsv = false, - treads_arm = false, - treads_core = false, + treads_arm = false, + treads_core = false, - health_displace = false, + health_displace = false, health_texturing = false, health_texraptors = false, - modelsfog = true, - - treewind = false, + modelsfog = true, - shadowsQuality = 2, + treewind = false, + shadowsQuality = 2, }, deferredOptions = { - shadowmapping = true, - normalmapping = false, + shadowmapping = true, + normalmapping = false, - vertex_ao = false, - flashlights = false, - shift_rgbhsv = false, + vertex_ao = false, + flashlights = false, + shift_rgbhsv = false, - treads_arm = false, - treads_core = false, + treads_arm = false, + treads_core = false, - modelsfog = true, + modelsfog = true, - health_displace = false, + health_displace = false, health_texturing = false, health_texraptors = false, - treewind = false, + treewind = false, - shadowsQuality = 0, - materialIndex = 0, + shadowsQuality = 0, + materialIndex = 0, }, shadowOptions = { - treewind = false, + treewind = false, }, feature = false, @@ -192,18 +189,16 @@ local shaderPlugins = { -- Inserted between %%TARGET%% blocks via InsertPlugin } - local function SunChanged(luaShader) - luaShader:SetUniformFloatArrayAlways("pbrParams", { - Spring.GetConfigFloat("tonemapA", 4.75), - Spring.GetConfigFloat("tonemapB", 0.75), - Spring.GetConfigFloat("tonemapC", 3.5), - Spring.GetConfigFloat("tonemapD", 0.85), - Spring.GetConfigFloat("tonemapE", 1.0), - Spring.GetConfigFloat("envAmbient", 0.125), - Spring.GetConfigFloat("unitSunMult", 1.0), - Spring.GetConfigFloat("unitExposureMult", 1.0), + Spring.GetConfigFloat("tonemapA", 4.75), + Spring.GetConfigFloat("tonemapB", 0.75), + Spring.GetConfigFloat("tonemapC", 3.5), + Spring.GetConfigFloat("tonemapD", 0.85), + Spring.GetConfigFloat("tonemapE", 1.0), + Spring.GetConfigFloat("envAmbient", 0.125), + Spring.GetConfigFloat("unitSunMult", 1.0), + Spring.GetConfigFloat("unitExposureMult", 1.0), }) luaShader:SetUniformFloatAlways("gamma", Spring.GetConfigFloat("modelGamma", 1.0)) end diff --git a/modinfo.lua b/modinfo.lua index f97bb3a47af..c537684f9dc 100644 --- a/modinfo.lua +++ b/modinfo.lua @@ -1,11 +1,11 @@ return { - name = 'Beyond All Reason', - description = 'Beyond All Reason', - shortName = 'BYAR', -- 'BAR' is used by original bar project still - version = '$VERSION', - mutator = 'Official', - game = 'Beyond All Reason', - shortGame = 'BYAR', - modtype = 1, - url = "https://www.beyondallreason.info", -} \ No newline at end of file + name = "Beyond All Reason", + description = "Beyond All Reason", + shortName = "BYAR", -- 'BAR' is used by original bar project still + version = "$VERSION", + mutator = "Official", + game = "Beyond All Reason", + shortGame = "BYAR", + modtype = 1, + url = "https://www.beyondallreason.info", +} diff --git a/modoptions.lua b/modoptions.lua index 3b81c8eb85b..954cd2c073b 100644 --- a/modoptions.lua +++ b/modoptions.lua @@ -30,2439 +30,2408 @@ local options = { - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Main + Restrictions - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { - key = "options_main", - name = "Main", - desc = "", - type = "section", - weight = 7, - }, - - { - key = "sub_header", - name = "Options for changing base game settings.", - desc = "", - section = "options_main", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - section = "options_main", - type = "separator", - }, - - { - key = "ranked_game", - name = "Ranked Game", - desc = "Should game results affect OpenSkill. Note that games with AI or games that are not balanced are always unranked.", - type = "bool", - section = "options_main", - def = true, - }, - - - { - key = "allowuserwidgets", - name = "Allow Custom Widgets", - desc = "Allow custom user widgets or disallow them", - type = "bool", - def = true, - hidden = true, - section = "options_main", - }, - - { - key = "allowunitcontrolwidgets", - name = "Allow Custom 'Unit Control' Widgets", - desc = "Allow custom user 'unit control' widgets or disallow them", - type = "bool", - def = true, - section = "options_main", - }, - - { - key = "allowpausegameplay", - name = "Allow Commands While Paused", - desc = "Allow giving unit commands while paused", - type = "bool", - def = true, - section = "options_main", - }, - - { - key = "sub_header", - section = "options_main", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Gameplay Settings", - desc = "", - section = "options_main", - type = "subheader", - def = true, - }, - - { - key = "maxunits", - name = "Max Units Per Player", - desc = "Keep in mind there is an absolute limit of units, 32 000, divided between each team. If you set this value higher than possible it will force itself down to the maximum it can be.", - type = "number", - def = 2000, - min = 500, - max = 32000, - step = 1, -- quantization is aligned to the def value, (step <= 0) means that there is no quantization - section = "options_main", - }, - { - key = "deathmode", - name = "Game End Mode", - desc = "What it takes to eliminate a team", - type = "list", - def = "com", - section = "options_main", - items = { - { key = "neverend", name = "Never ending", desc = "Teams are never eliminated", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, - { key = "com", name = "Kill all enemy Commanders", desc = "When a team has no Commanders left, it loses", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, - { key= "territorial_domination", name= "Territorial Domination", desc="Teams earn points by capturing territory to stay in the game. At the end of the final round, the team with the most points wins.", unlock = {"territorial_domination_config", "territorial_domination_elimination_threshold_multiplier"} }, - { key = "builders", name = "Kill all Builders", desc = "When a team has no builders left, it loses", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, - { key = "killall", name = "Kill everything", desc = "Every last unit must be eliminated, no exceptions!", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, - { key = "own_com", name = "Player resign on Com death", desc = "When player commander dies, you auto-resign.", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, - } - }, - - { - key = "territorial_domination_config", - name = "Territorial Domination Length", - desc = - "Configures the grace period and the amount of time in minutes it takes to reach the maximum required territory.", - type = "list", - def = "25_minutes", - section = "options_main", - items = { - { key = "20_minutes", name = "4 Rounds, 20 Minutes", desc = "Early tech emphasis, comebacks very likely, elimination unlikely." }, - { key = "25_minutes", name = "5 Rounds, 25 Minutes(Default)", desc = "Mid/late-game tech, comebacks a significant factor, eliminations uncommon" }, - { key = "30_minutes", name = "6 Rounds, 30 Minutes", desc = "Late-game tech, comebacks less significant, eliminations likely" }, - { key = "35_minutes", name = "7 Rounds, 35 Minutes", desc = "Super lategame tech, eliminations extremely likely" }, - } - }, - - { - key = "territorial_domination_elimination_threshold_multiplier", - name = "Elimination Threshold Multiplier", - desc = "Teams are eliminated at round end when score < elimination threshold which is set by highest score multiplied by this value. Lower values are more lenient.", - type = "number", - def = 1.2, - min = 1.0, - max = 1.5, - step = 0.1, - section = "options_main", - }, - - { - key = "draft_mode", - name = "Draft Spawn Order Mode", - desc = "Random/Captain/Skill/Fair based startPosType modes. Default: Random.", - type = "list", - section = "options_main", - def = "random", - items = { - { key = "disabled", name = "Disabled", desc = "Disable draft mod. Fast-PC place first." }, - { key = "random", name = "Random Order", desc = "Players get to pick a start position with a delay in a random order." }, - { key = "captain", name = "Captains First", desc = "Captain picks first, then everyone else in a random order." }, - { key = "skill", name = "Skill Order", desc = "Skill-based order, instead of random." }, - { key = "fair", name = "After full team has loaded", desc = "Everyone must join the game first - after that (+2sec delay) everyone can place." } - }, - }, - - { - key = "teamcolors_anonymous_mode", - name = "Anonymous Mode", - desc = "Anonymize players by changing colors (based on chosen mode) and replacing names with question marks, making it harder to know who's who.", - type = "list", - section = "options_main", - def = "disabled", - items = { - { key = "disabled", name = "Disabled" }, - { key = "global", name = "Shuffle Globally", desc = "You can distinguish different players and everyone sees the same colors globally. Diplomacy is the same as usual except using colors instead of names (e.g. \"Red, let's ally against Blue\")." }, - { key = "local", name = "Shuffle Locally", desc = "You can distinguish different players but everyone sees different colors locally. Diplomacy is harder but possible using positions (e.g. \"Southeast, let's ally against Northeast\")." }, - { key = "disco", name = "Shuffle Locally (Continiously)", desc = "Same as local shuffle, except that colors are reshuffled every 2 mins for extra spicyness." }, - { key = "allred", name = "Everyone Is Red", desc = "You cannot distinguish different players, they all have the same color (red by default, can be changed in accessibility settings). Diplomacy is very hard." }, - }, - }, - - { - key = "transportenemy", - name = "Enemy Transporting", - desc = "Toggle which enemy units you can kidnap with an air transport", - hidden = true, - type = "list", - def = "notcoms", - section = "options_main", - items = { - { key= "notcoms", name= "All But Commanders", desc= "Only commanders are immune to napping" }, - { key= "none", name= "Disallow All", desc= "No enemy units can be napped" }, - } - }, - - { - key = "teamffa_start_boxes_shuffle", - name = "Shuffle TeamFFA Start Boxes", - desc = "In TeamFFA games (more than 2 teams, excluding Raptors / Scavengers), start boxes will be randomly assigned to each team: team 1 might be assigned any start box rather than team 1 always being assigned start box 1.", - type = "bool", - section = "options_main", - def = true, - }, - - { - key = "fixedallies", - name = "Disabled Dynamic Alliances", - desc = "Disables the possibility of players to dynamically change alliances ingame", - type = "bool", - def = true, - hidden = true, - section = "options_main", - }, - - { - key = "disablemapdamage", - name = "Disable Map Deformation", - desc = "Prevents the map shape from being changed by weapons", - type = "bool", - def = false, - section = "options_main", - }, - - { - key = "disable_fogofwar", - name = "Disable Fog of War", - desc = "Disable Fog of War", - type = "bool", - section = "options_main", - def = false, - }, - - { - key = "norushtimer", - name = "No Rush Time".."\255\128\128\128".." [minutes]", - desc = "Set timer in which players cannot get out of their startbox, so you have time to prepare before fighting.\n".. - "PLEASE NOTE: For this to work, the game needs to have set startboxes.\n".. + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Main + Restrictions + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + key = "options_main", + name = "Main", + desc = "", + type = "section", + weight = 7, + }, + + { + key = "sub_header", + name = "Options for changing base game settings.", + desc = "", + section = "options_main", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + section = "options_main", + type = "separator", + }, + + { + key = "ranked_game", + name = "Ranked Game", + desc = "Should game results affect OpenSkill. Note that games with AI or games that are not balanced are always unranked.", + type = "bool", + section = "options_main", + def = true, + }, + + { + key = "allowuserwidgets", + name = "Allow Custom Widgets", + desc = "Allow custom user widgets or disallow them", + type = "bool", + def = true, + hidden = true, + section = "options_main", + }, + + { + key = "allowunitcontrolwidgets", + name = "Allow Custom 'Unit Control' Widgets", + desc = "Allow custom user 'unit control' widgets or disallow them", + type = "bool", + def = true, + section = "options_main", + }, + + { + key = "allowpausegameplay", + name = "Allow Commands While Paused", + desc = "Allow giving unit commands while paused", + type = "bool", + def = true, + section = "options_main", + }, + + { + key = "sub_header", + section = "options_main", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Gameplay Settings", + desc = "", + section = "options_main", + type = "subheader", + def = true, + }, + + { + key = "maxunits", + name = "Max Units Per Player", + desc = "Keep in mind there is an absolute limit of units, 32 000, divided between each team. If you set this value higher than possible it will force itself down to the maximum it can be.", + type = "number", + def = 2000, + min = 500, + max = 32000, + step = 1, -- quantization is aligned to the def value, (step <= 0) means that there is no quantization + section = "options_main", + }, + { + key = "deathmode", + name = "Game End Mode", + desc = "What it takes to eliminate a team", + type = "list", + def = "com", + section = "options_main", + items = { + { key = "neverend", name = "Never ending", desc = "Teams are never eliminated", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + { key = "com", name = "Kill all enemy Commanders", desc = "When a team has no Commanders left, it loses", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + { key = "territorial_domination", name = "Territorial Domination", desc = "Teams earn points by capturing territory to stay in the game. At the end of the final round, the team with the most points wins.", unlock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + { key = "builders", name = "Kill all Builders", desc = "When a team has no builders left, it loses", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + { key = "killall", name = "Kill everything", desc = "Every last unit must be eliminated, no exceptions!", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + { key = "own_com", name = "Player resign on Com death", desc = "When player commander dies, you auto-resign.", lock = { "territorial_domination_config", "territorial_domination_elimination_threshold_multiplier" } }, + }, + }, + + { + key = "territorial_domination_config", + name = "Territorial Domination Length", + desc = "Configures the grace period and the amount of time in minutes it takes to reach the maximum required territory.", + type = "list", + def = "25_minutes", + section = "options_main", + items = { + { key = "20_minutes", name = "4 Rounds, 20 Minutes", desc = "Early tech emphasis, comebacks very likely, elimination unlikely." }, + { key = "25_minutes", name = "5 Rounds, 25 Minutes(Default)", desc = "Mid/late-game tech, comebacks a significant factor, eliminations uncommon" }, + { key = "30_minutes", name = "6 Rounds, 30 Minutes", desc = "Late-game tech, comebacks less significant, eliminations likely" }, + { key = "35_minutes", name = "7 Rounds, 35 Minutes", desc = "Super lategame tech, eliminations extremely likely" }, + }, + }, + + { + key = "territorial_domination_elimination_threshold_multiplier", + name = "Elimination Threshold Multiplier", + desc = "Teams are eliminated at round end when score < elimination threshold which is set by highest score multiplied by this value. Lower values are more lenient.", + type = "number", + def = 1.2, + min = 1.0, + max = 1.5, + step = 0.1, + section = "options_main", + }, + + { + key = "draft_mode", + name = "Draft Spawn Order Mode", + desc = "Random/Captain/Skill/Fair based startPosType modes. Default: Random.", + type = "list", + section = "options_main", + def = "random", + items = { + { key = "disabled", name = "Disabled", desc = "Disable draft mod. Fast-PC place first." }, + { key = "random", name = "Random Order", desc = "Players get to pick a start position with a delay in a random order." }, + { key = "captain", name = "Captains First", desc = "Captain picks first, then everyone else in a random order." }, + { key = "skill", name = "Skill Order", desc = "Skill-based order, instead of random." }, + { key = "fair", name = "After full team has loaded", desc = "Everyone must join the game first - after that (+2sec delay) everyone can place." }, + }, + }, + + { + key = "teamcolors_anonymous_mode", + name = "Anonymous Mode", + desc = "Anonymize players by changing colors (based on chosen mode) and replacing names with question marks, making it harder to know who's who.", + type = "list", + section = "options_main", + def = "disabled", + items = { + { key = "disabled", name = "Disabled" }, + { key = "global", name = "Shuffle Globally", desc = 'You can distinguish different players and everyone sees the same colors globally. Diplomacy is the same as usual except using colors instead of names (e.g. "Red, let\'s ally against Blue").' }, + { key = "local", name = "Shuffle Locally", desc = 'You can distinguish different players but everyone sees different colors locally. Diplomacy is harder but possible using positions (e.g. "Southeast, let\'s ally against Northeast").' }, + { key = "disco", name = "Shuffle Locally (Continiously)", desc = "Same as local shuffle, except that colors are reshuffled every 2 mins for extra spicyness." }, + { key = "allred", name = "Everyone Is Red", desc = "You cannot distinguish different players, they all have the same color (red by default, can be changed in accessibility settings). Diplomacy is very hard." }, + }, + }, + + { + key = "transportenemy", + name = "Enemy Transporting", + desc = "Toggle which enemy units you can kidnap with an air transport", + hidden = true, + type = "list", + def = "notcoms", + section = "options_main", + items = { + { key = "notcoms", name = "All But Commanders", desc = "Only commanders are immune to napping" }, + { key = "none", name = "Disallow All", desc = "No enemy units can be napped" }, + }, + }, + + { + key = "teamffa_start_boxes_shuffle", + name = "Shuffle TeamFFA Start Boxes", + desc = "In TeamFFA games (more than 2 teams, excluding Raptors / Scavengers), start boxes will be randomly assigned to each team: team 1 might be assigned any start box rather than team 1 always being assigned start box 1.", + type = "bool", + section = "options_main", + def = true, + }, + + { + key = "fixedallies", + name = "Disabled Dynamic Alliances", + desc = "Disables the possibility of players to dynamically change alliances ingame", + type = "bool", + def = true, + hidden = true, + section = "options_main", + }, + + { + key = "disablemapdamage", + name = "Disable Map Deformation", + desc = "Prevents the map shape from being changed by weapons", + type = "bool", + def = false, + section = "options_main", + }, + + { + key = "disable_fogofwar", + name = "Disable Fog of War", + desc = "Disable Fog of War", + type = "bool", + section = "options_main", + def = false, + }, + + { + key = "norushtimer", + name = "No Rush Time" .. "\255\128\128\128" .. " [minutes]", + desc = "Set timer in which players cannot get out of their startbox, so you have time to prepare before fighting.\n" + .. "PLEASE NOTE: For this to work, the game needs to have set startboxes.\n" -- tabs don't do much in chobby - " It won't work in FFA mode without boxes.\n".. - " Also, it does not affect Scavengers and Raptors.\n".. - "\255\75\0\100".."WARNING: No Rush Time over 30 minutes may cause performance or stability issues due to excessive unit buildup.", - type = "number", - section = "options_main", - def = 0, - min = 0, - max = 120, - step = 1, - }, - { - key = "norushmiddlefree", - name = "No Rush Non Base FFA", - desc = "Allows units to leave startboxes but disallows commands issued in enemy startboxes.\n".. - "Does not prevent commands onto the other side of startboxes so recommend East/West or North/South startboxes.", - type = "bool", - section = "options_main", - def = false, - }, - - { - key = "sub_header", - section = "options_main", - type = "separator", - }, - { - key = "sub_header", - name = "-- Sharing and Taxes", - section = "options_main", - type = "subheader", - def = true, - }, - { - key = "tax_resource_sharing_amount", - name = "Resource Sharing Tax", - desc = "Taxes resource sharing".."\255\128\128\128".." and overflow (engine TODO:)\n".. - "Set to [0] to turn off. Recommended: [0.4]. (Ranges: 0 - 0.99)", - type = "number", - def = 0, - min = 0, - max = 0.99, - step = 0.01, - section = "options_main", - column = 1, - }, - { - key = "disable_unit_sharing", - name = "Disable Unit Sharing", - desc = "Disable sharing units and structures to allies", - type = "bool", - section = "options_main", - def = false, - }, - { - key = "disable_assist_ally_construction", - name = "Disable Assist Ally Construction", - desc = "Disables assisting allied blueprints and labs.", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - { - key = "sub_header", - section = "options_main", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Unit Restrictions", - desc = "", - section = "options_main", - type = "subheader", - def = true, - }, - - { - key = "unit_restrictions_notech15", - name = "Disable Tech 1.5", - desc = "Disables: Sea Plane Labs, Hovercraft labs, and Amphibious labs. (Considered Tier 1.5)", - type = "bool", - section = "options_main", - def = false, - column = 1, - }, - - { - key = "unit_restrictions_notech2", - name = "Disable Tech 2", - desc = "Disable Tech 2", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - - { - key = "unit_restrictions_notech3", - name = "Disable Tech 3", - desc = "Disable Tech 3", - type = "bool", - section = "options_main", - def = false, - column = 2.33, - }, - - { - key = "unit_restrictions_noair", - name = "Disable Air Units", - desc = "Disable Air Units", - type = "bool", - section = "options_main", - def = false, - column = 1, - }, - - { - key = "unit_restrictions_nosea", - name = "Disable Sea Units", - desc = "Disable Sea Units", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - - { - key = "unit_restrictions_noextractors", - name = "Disable Metal Extractors", - desc = "Disable Metal Extractors", - type = "bool", - section = "options_main", - def = false, - column = 1, - }, - - { - key = "unit_restrictions_noconverters", - name = "Disable Energy Converters", - desc = "Disable Energy Converters", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - - { - key = "unit_restrictions_nofusion", - name = "Disable Fusion Generators", - desc = "Disables Normal and Advanced Fusion Energy Generators", - type = "bool", - section = "options_main", - def = false, - column = 2.33, - }, - - { - key = "unit_restrictions_notacnukes", - name = "Disable Tactical Missiles/EMPs", - desc = "Disables Cortex Tactical Missile Launcher and Armada EMP Missile Launcher", - type = "bool", - section = "options_main", - def = false, - column = 1, - }, - - { - key = "unit_restrictions_nonukes", - name = "Disable Nuclear Missiles", - desc = "Disable Nuclear Missiles", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - - { - key = "unit_restrictions_noantinuke", - name = "Disable Anti-Nuke Defence", - desc = "Disables Nuke Interceptor Units and Structures.", - type = "bool", - section = "options_main", - def = false, - column = 2.33, - }, - - { - key = "unit_restrictions_nolrpc", - name = "Disable Long Range Artilery (LRPC)", - desc = "Disable Long Range Plasma Artilery (LRPC) structures", - type = "bool", - section = "options_main", - def = false, - column = 1, - }, - - { - key = "unit_restrictions_noendgamelrpc", - name = "Disable Endgame Artilery (LRPC)", - desc = "Disable Endgame Long Range Plasma Artilery (LRPC) structures (AKA lolcannons)", - type = "bool", - section = "options_main", - def = false, - column = 1.66, - }, - - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Other Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "options", - name = "Other", - desc = "Options", - type = "section", - }, - - { - key = "map_tidal", - name = "Tidal Strength", - desc = "Unchanged = map setting, low = 13e/sec, medium = 18e/sec, high = 23e/sec.", - hidden = true, - type = "list", - def = "unchanged", - section = "options", - items = { - { key = "unchanged", name = "Unchanged", desc = "Use map settings" }, - { key = "low", name = "Low", desc = "Set tidal incomes to 13 energy per second" }, - { key = "medium", name = "Medium", desc = "Set tidal incomes to 18 energy per second" }, - { key = "high", name = "High", desc = "Set tidal incomes to 23 energy per second" }, - } - }, - - { - key = "critters", - name = "Animal amount", - desc = "This multiplier will be applied on the amount of critters a map will end up with", - hidden = true, - type = "number", - section = "options", - def = 1, - min = 0, - max = 2, - step = 0.2, - }, - - { - key = "map_atmosphere", - name = "Map Atmosphere and Ambient Sounds", - desc = "", - type = "bool", - def = true, - hidden = true, - section = "options", - }, - - { - key = "ffa_wreckage", - name = "FFA Mode Wreckage", - desc = "Killed players will blow up but leave wreckages", - hidden = true, - type = "bool", - def = false, - section = "options", - }, - - { - key = "wreck_metal_ratio", - name = "Wreck Metal Percent", - desc = "Percent of unit metal that is left in its wrecks", - hidden = true, - type = "number", - section = "options", - def = 0.6, - min = 0, - max = 1, - step = 0.05, - }, - - { - key = "heap_metal_ratio", - name = "Heap Metal Percent", - desc = "Percent of unit metal that is left in its heaps", - hidden = true, - type = "number", - section = "options", - def = 0.25, - min = 0, - max = 1, - step = 0.05, - }, - - { - key = "coop", - name = "Cooperative mode", - desc = "Adds extra commanders to id-sharing teams, 1 com per player", - type = "bool", - hidden = true, - def = false, - section = "options", - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Multiplier Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Raptors - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { - key = "raptor_defense_options", - name = "Raptors", - desc = "Various gameplay options that will change how the Raptor Defense is played.", - type = "section", - weight = 4, - }, - - { - key = "sub_header", - name = "Raptors Gamemode Options.", - desc = "", - section = "raptor_defense_options", - type = "subheader", - def = true, - }, - - { - key = "raptors_dev_channel_link", - name = "Development Discussion", - desc = "Raptors development discussion.", - section = "raptor_defense_options", - type = "link", - link = "https://discord.com/channels/549281623154229250/781097030692110346", - width = 275, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "sub_header", - name = "To Play Add a Raptors AI to the enemy Team: [Add AI], [RaptorsDefense AI]", - desc = "", - section = "raptor_defense_options", - type = "subheader", - }, - - { - key = "sub_header", - section = "raptor_defense_options", - type = "separator", - }, - - { - key = "raptor_difficulty", - name = "Base Difficulty", - desc = "Raptors difficulty", - type = "list", - def = "normal", - section = "raptor_defense_options", - items = { - { key = "veryeasy", name = "Very Easy", desc="Very Easy" }, - { key = "easy", name = "Easy", desc="Easy" }, - { key = "normal", name = "Normal", desc="Normal" }, - { key = "hard", name = "Hard", desc="Hard" }, - { key = "veryhard", name = "Very Hard", desc="Very Hard" }, - { key = "epic", name = "Epic", desc="Epic" }, - } - }, - - { - key = "sub_header", - section = "raptor_defense_options", - type = "separator", - }, - - { - key = "raptor_raptorstart", - name = "Hives Placement", - desc = "Control where hives spawn", - type = "list", - def = "initialbox", - section = "raptor_defense_options", - items = { - { key = "avoid", name = "Spawn Anywhere", desc = "Hives avoid player units" }, - { key = "initialbox", name = "Growing Spawn Box", desc = "Hives spawn in limited area that increases over time" }, - { key = "alwaysbox", name = "Always Start Box", desc = "Hives always spawn in raptor start box" }, - } - }, - - { - key = "raptor_endless", - name = "Endless Mode", - desc = "When you kill the queen, the game doesn't end, but loops around at higher difficulty instead, infinitely.", - type = "bool", - def = false, - section = "raptor_defense_options", - }, - - { - key = "sub_header", - section = "raptor_defense_options", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Advanced Options, Change at your own risk.", - desc = "", - section = "raptor_defense_options", - type = "subheader", - def = true, - }, - - { - key = "raptor_queentimemult", - name = "Queen Hatching Time Multiplier", - desc = "(Range: 0.1 - 2). How quickly Queen Hatch goes from 0 to 100%", - type = "number", - def = 1, - min = 0.1, - max = 2, - step = 0.1, - section = "raptor_defense_options", - }, - - { - key = "raptor_queen_count", - name = "Raptor Queen Count", - desc = "(Range: 1 - 100). Number of queens that will spawn.", - type = "number", - def = 1, - min = 1, - max = 100, - step = 1, - section = "raptor_defense_options", - }, - - { - key = "raptor_spawncountmult", - name = "Unit Spawn Per Wave Multiplier", - desc = "(Range: 1 - 5). How many times more raptors will spawn per wave.", - type = "number", - def = 1, - min = 1, - max = 5, - step = 1, - section = "raptor_defense_options", - }, - - { - key = "raptor_firstwavesboost", - name = "First Waves Size Boost", - desc = "(Range: 1 - 10). Intended to use with heavily modified settings. Makes first waves larger, the bigger the number the larger they are. Cools down within first few waves.", - type = "number", - def = 1, - min = 1, - max = 10, - step = 1, - section = "raptor_defense_options", - }, - - { - key = "raptor_spawntimemult", - name = "Waves Amount Multiplier", - desc = "(Range: 1 - 5). How often new waves will spawn. Bigger Number = More Waves", - type = "number", - def = 1, - min = 1, - max = 5, - step = 0.1, - section = "raptor_defense_options", - }, - - { - key = "raptor_graceperiodmult", - name = "Grace Period Time Multiplier", - desc = "(Range: 0.1 - 3). Time before Raptors become active. ", - type = "number", - def = 1, - min = 0.1, - max = 3, - step = 0.1, - section = "raptor_defense_options", - }, - - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Scavengers - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { - key = "scav_defense_options", - name = "Scavengers", - desc = "Gameplay options for Scavengers gamemode", - type = "section", - weight = 3, - }, - - { - key = "sub_header", - name = "Scavengers Gamemode Options.", - desc = "", - section = "scav_defense_options", - type = "subheader", - def = true, - }, - - { - key = "scavengers_dev_channel_link", - name = "Development Discussion", - desc = "Scavengers development discussion.", - section = "scav_defense_options", - type = "link", - link = "https://discord.com/channels/549281623154229250/659550298653589504", - width = 275, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "sub_header", - name = "To Play Add a Scavangers AI to the enemy Team: [Add AI], [ScavengersDefense AI]", - desc = "", - section = "scav_defense_options", - type = "subheader", - }, - - - { - key = "sub_header", - section = "scav_defense_options", - type = "separator", - }, - - { - key = "scav_difficulty", - name = "Base Difficulty", - desc = "Scavs difficulty", - type = "list", - def = "normal", - section = "scav_defense_options", - items = { - { key = "veryeasy", name = "Very Easy", desc = "Very Easy" }, - { key = "easy", name = "Easy", desc = "Easy" }, - { key = "normal", name = "Normal", desc = "Normal" }, - { key = "hard", name = "Hard", desc = "Hard" }, - { key = "veryhard", name = "Very Hard", desc = "Very Hard" }, - { key = "epic", name = "Epic", desc = "Epic" }, - } - }, - - { - key = "sub_header", - section = "scav_defense_options", - type = "separator", - }, - - { - key = "scav_scavstart", - name = "Spawn Beacons Placement", - desc = "Control where spawners appear", - type = "list", - def = "initialbox", - section = "scav_defense_options", - items = { - { key = "avoid", name = "Spawn Anywhere", desc="Beacons avoid player units" }, - { key = "initialbox", name = "Growing Spawn Box", desc="Beacons spawn in limited area that increases over time" }, - --{ key = "alwaysbox", name = "Always Start Box", desc="Beacons always spawn in scav start box" }, - } - }, - - { - key = "scav_endless", - name = "Endless Mode", - desc = "When you kill the boss, the game doesn't end, but loops around at higher difficulty instead, infinitely.", - type = "bool", - def = false, - section = "scav_defense_options", - }, - - { - key = "sub_header", - section = "scav_defense_options", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Advanced Options, Change at your own risk.", - desc = "", - section = "scav_defense_options", - type = "subheader", - def = true, - }, - - { - key = "scav_bosstimemult", - name = "Boss Preparation Time Multiplier", - desc = "(Range: 0.1 - 2). How quickly Boss Anger goes from 0 to 100%.", - type = "number", - def = 1, - min = 0.1, - max = 2, - step = 0.1, - section = "scav_defense_options", - }, - - { - key = "scav_boss_count", - name = "Scavengers Boss Count", - desc = "(Range: 1 - 20). Number of bosses that will spawn.", - type = "number", - def = 1, - min = 1, - max = 20, - step = 1, - section = "scav_defense_options", - }, - - { - key = "scav_spawncountmult", - name = "Unit Spawn Per Wave Multiplier", - desc = "(Range: 1 - 5). How many times more scavs will spawn per wave.", - type = "number", - def = 1, - min = 1, - max = 5, - step = 1, - section = "scav_defense_options", - }, - - { - key = "scav_spawntimemult", - name = "Waves Amount Multiplier", - desc = "(Range: 1 - 5). How often new waves will spawn. Bigger Number = More Waves", - type = "number", - def = 1, - min = 1, - max = 5, - step = 0.1, - section = "scav_defense_options", - }, - - { - key = "scav_graceperiodmult", - name = "Grace Period Time Multiplier", - desc = "(Range: 0.1 - 3). Time before Scavs become active. ", - type = "number", - def = 1, - min = 0.1, - max = 3, - step = 0.1, - section = "scav_defense_options", - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Extra Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "options_extra", - name = "Extras", - desc = "Extra options", - type = "section", - weight = 2, - }, - - - { - key = "sub_header", - name = "Extra options for shaking up the gameplay or balancing. Not intended for ranked games.", - desc = "", - section = "options_extra", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - - { - key = "experimentalextraunits", - name = "Extra Units Pack", - desc = "Pack of units that didn't make it to the main game roster. Balanced for PvP", - type = "bool", - section = "options_extra", - def = false, - }, - - { - key = "scavunitsforplayers", - name = "Scavengers Units Pack", - desc = "Units made for Scavengers, mostly silly and unbalanced for PvP.", - type = "bool", - section = "options_extra", - def = false, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - - { - key = "map_waterlevel", - name = "Water Level", - desc = "Doesn't work if Map Deformation is disabled! <0 = Decrease water level, >0 = Increase water level", - type = "number", - def = 0, - min = -10000, - max = 10000, - step = 1, - section = "options_extra", - }, - - { - key = "map_waterislava", - name = "Water Is Lava", - desc = "Turns water into Lava", - type = "bool", - def = false, - section = "options_extra", - unlock = {"map_lavatiderhythm", "map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell","map_tweaklava"}, - lock = {"sub_header_lava3", "sub_header_lava4"}, - bitmask = 1, - }, - - { - key = "map_lavatiderhythm", - name = "Lava Tides", - desc = "Lava level periodicially cycles height when tides are present", - type = "list", - def = "default", - section = "options_extra", - column = 1, - items = { - { key= "default", name= "Default", desc= "Map Settings", - lock = - {"map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4"}, - unlock = - { "sub_header_lava1", "sub_header_lava2"}}, - { key= "enabled", name= "Enable/Override",desc= "Lava tides will use these settings over the map defaults", - unlock = - {"map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4"}, - lock = - { "sub_header_lava1", "sub_header_lava2"}}, - { key= "disabled", name= "Disable",desc= "Lava will not have tides, even on maps that normally have it", - lock = - {"map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4"}, - unlock = - { "sub_header_lava1", "sub_header_lava2"}}, - }, - bitmask = 2, - }, - - { - key = "map_lavatidemode", - name = "Lava Tide Mode", - desc = "Toggle whether lava starts at high or low tide.", - hidden = false, - type = "list", - def = "lavastartlow", - section = "options_extra", - items = { - { key= "lavastartlow", name= "Start Low", desc= "Lava starts at low tide" }, - { key= "lavastarthigh", name= "Start High",desc= "Lava starts at high tide" }, - } - }, - - { - key = "map_lavahighlevel", - name = "Lava High Tide Level", - desc = "Lava level at high tide", - type = "number", - def = 0, - min = 0, - max = 10000, - step = 1, - section = "options_extra", - column = 1, - }, - - { - key = "map_lavahighdwell", - name = "Lava High Tide Time", - desc = "Time in seconds lava waits at high tide", - type = "number", - def = 60, - min = 1, - max = 30000, - step = 1, - section = "options_extra", - column = 2.0, - }, - - { - key = "map_lavalowlevel", - name = "Lava Low Tide Level", - desc = "Lava level at low tide", - type = "number", - def = 0, - min = 0, - max = 10000, - step = 1, - section = "options_extra", - column = 1, - }, - - { - key = "map_lavalowdwell", - name = "Lava Low Tide Time", - desc = "Time in seconds lava waits at low tide", - type = "number", - def = 300, - min = 1, - max = 30000, - step = 1, - section = "options_extra", - column = 2.0, - }, - - { - key = "map_tweaklava", - name = "Advanced Tide Rhythm", - desc = "Table with format {MapHeight (elmo), Rate (elmo/s), Dwell Time (s)}, e.g. {0, 6, 60},{100, 3, 20}", - hidden = true, - hint = "{Lava Height, Rise/Fall Rate, Dwell Time}", - type = "string", - def = "", - section = "options_extra", - }, - - { key = "sub_header_lava1", section = "options_extra", type = "subheader", name = "",}, - { key = "sub_header_lava2", section = "options_extra", type = "subheader", name = "",}, - { key = "sub_header_lava3", section = "options_extra", type = "subheader", name = "",}, - { key = "sub_header_lava4", section = "options_extra", type = "subheader", name = "",}, - - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - { - key = "ruins", - name = "Ruins", - desc = "Remains of the battles once fought", - type = "list", - def = "scav_only", - section = "options_extra", - items = { - { key = "enabled", name = "Enabled", unlock = {"ruins_density", "ruins_only_t1"} }, - { key = "scav_only", name = "Enabled for Scavengers only", unlock = {"ruins_density", "ruins_only_t1"} }, - { key = "disabled", name = "Disabled", lock = {"ruins_density", "ruins_only_t1"} }, - } - }, - - { - key = "ruins_density", - name = "Ruins: Density", - type = "list", - def = "normal", - section = "options_extra", - items = { - { key = "verydense", name = "Very Dense" }, - { key = "dense", name = "Dense" }, - { key = "normal", name = "Normal" }, - { key = "rare", name = "Rare" }, - { key = "veryrare", name = "Very Rare" }, - } - }, - - { - key = "ruins_only_t1", - name = "Ruins: Only Tech 1", - type = "bool", - def = false, - section = "options_extra", - }, - - { - key = "ruins_civilian_disable", - name = "Ruins: Disable Civilian (Not Implemented Yet)", - type = "bool", - def = false, - section = "options", - hidden = true, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - - { - key = "lootboxes", - name = "Lootboxes", - desc = "Random drops of valuable stuff.", - type = "list", - def = "scav_only", - section = "options_extra", - items = { - { key = "enabled", name = "Enabled", unlock = {"lootboxes_density"} }, - { key = "scav_only", name = "Enabled for Scavengers only", unlock = {"lootboxes_density"} }, - { key = "disabled", name = "Disabled", lock = {"lootboxes_density"} }, - } - }, - - { - key = "lootboxes_density", - name = "Lootboxes: Density", - type = "list", - def = "normal", - section = "options_extra", - items = { - { key = "normal", name = "Normal" }, - { key = "rare", name = "Rare" }, - { key = "veryrare", name = "Very Rare" }, - } - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - { - key = "evocom", - name = "Evolving Commanders", - desc = "Commanders evolve, gaining new weapons and abilities.", - type = "bool", - def = false, - section = "options_extra", - bitmask = 1, - unlock = {"evocomlevelupmethod","evocomlevelcap","evocomxpmultiplier", "evocomleveluptime", "evocomlevelupmultiplier"}, - --lock = {"buffer_fix"}, - }, - - { - key = "evocom_feedback_thread_link", - name = "Feedback thread", - desc = "Discord discussion about Evolving Commanders.", - section = "options_extra", - type = "link", - link = "https://discord.com/channels/549281623154229250/1233887661291343913", - width = 215, - column = 2, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "evocomlevelupmethod", - name = "EvoCom: Leveling Method", - desc = "Dynamic: Commanders evolve to keep up with the highest power player. Timed: Static Evolution Rate", - type = "list", - def = "dynamic", - section = "options_extra", - bitmask = 2, - items = { - { key = "dynamic", name = "Dynamic", lock = {"evocomleveluptime"}, unlock = {"evocomlevelupmultiplier"}}, - { key = "timed", name = "Timed", lock = {"evocomlevelupmultiplier"}, unlock = {"evocomleveluptime"}}, - } - }, - - - { - key = "evocomlevelupmultiplier", - name = "EvoCom: Evolution Mult.", - desc = "(Range 0.1x - 3x Multiplier) Adjusts the thresholds at which Dynamic evolutions occur", - type = "number", - section = "options_extra", - def = 1, - min = 0.1, - max = 3, - step = 0.1, - }, - - { - key = "evocomleveluptime", - name = "EvoCom: Evolution Time ", - desc = "(Range 0.1 - 20 Minutes) Rate at which commanders will evolve if Timed method is selected.", - type = "number", - section = "options_extra", - def = 5, - min = 0.1, - max = 20, - step = 0.1, - }, - - { - key = "evocomlevelcap", - name = "EvoCom: Max Level", - desc = "(Range 2 - 10) Changes the Evolving Commanders maximum level", - type = "number", - section = "options_extra", - def = 10, - min = 2, - max = 10, - step = 1, - }, - - { - key = "evocomxpmultiplier", - name = "EvoCom: Commander XP Multiplier", - desc = "(Range 0.1 - 10) Does not affect leveling! Changes the rate at which Evolving Commanders gain Experience.", - type = "number", - section = "options_extra", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - - { - key = "comrespawn", - name = "Commander Respawning", - desc = "Commanders can build one Effigy. The first one is free and given for you at the start. When the commander dies, the Effigy is sacrificed in its place.", - type = "list", - def = "evocom", - section = "options_extra", - items = { - { key = "evocom", name = "Evolving Commanders Only" }, - { key = "all", name = "All Commanders" }, - { key = "disabled", name = "Disabled" }, - } - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - { - key = "quick_start", - name = "Quick Start", - desc = "Each player gets pre-game resources to spend on structures to be instantly spawned at the beginning of the game.", - type = "list", - def = "default", - section = "options_extra", - unlock = {"quick_start_amount"}, - items = { - { key = "default", name = "Default", lock = {"quick_start_amount"}, desc = "Default settings for game modes." }, - { key = "enabled", name = "Enabled", unlock = {"quick_start_amount"}, desc = "Quick Start alone, deducts 400 energy and 800 metal from starting resources." }, - { key = "factory_discount", name = "Enabled: Discounted First Factory", desc = - "Quick Start The commander's first factory is discounted at any time. Deducts 400 energy and 800 metal from starting resources.", unlock = {"quick_start_amount"} }, - { key = "factory_discount_only", name = "First Factory Discount Only", desc = "No base budget, only first factory discount. No deduction from starting resources.", lock = {"quick_start_amount"} }, - { key = "disabled", name = "Disabled", desc = "Disabled quick start for all game modes.", lock = {"quick_start_amount"} }, - } - }, - - { - key = "quick_start_link", - name = "Feedback thread", - desc = "Discord discussion about quick start.", - section = "options_extra", - type = "link", - link = "https://discord.com/channels/549281623154229250/1413936809980858408", - width = 215, - column = 2, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "quick_start_amount", - name = "Quick Start Base Budget", - desc = "How much pre-game resources you have to spend on pre-queuing structures.", - type = "list", - def = "default", - section = "options_extra", - items = { - { key = "default", name = "Default", desc = "Uses the default amount based on game mode" }, - { key = "small", name = "Small", desc = "800 Base Budget" }, - { key = "normal", name = "Normal", desc = "1200 Base Budget" }, - { key = "large", name = "Large", desc = "2400 Base Budget" }, - } - }, - - { - key = "enable_quickstart_overrides", - name = "Enable Quick Start Overrides", - desc = "Allow overriding quick start range and budget (for debugging/modding).", - type = "bool", - def = false, - section = "options_extra", - hidden = true, - }, - - { - key = "override_quick_start_range", - name = "Override Quick Start Range", - desc = "Override the quick start build range when overrides are enabled (values below 200 are clamped to 200).", - type = "number", - def = 600, - min = 200, - max = 2000, - step = 1, - section = "options_extra", - hidden = true, - }, - - { - key = "override_quick_start_budget", - name = "Override Quick Start Budget", - desc = "Override the quick start starting resources when overrides are enabled.", - type = "number", - def = 1200, - min = 100, - max = 1000000, - step = 1, - section = "options_extra", - hidden = true, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - { - key = "assistdronesenabled", -- TODO, turn this into booleam modoption - name = "Commander Drones", - type = "list", - def = "disabled", - section = "options_extra", - items = { - { key = "enabled", name = "Enabled", unlock = {"assistdronesbuildpowermultiplier", "assistdronescount", "assistdronesair"} }, - { key = "disabled", name = "Disabled", lock = {"assistdronesbuildpowermultiplier", "assistdronescount", "assistdronesair"} }, - } - }, - - { - key = "assistdronesbuildpowermultiplier", - name = "ComDrones: Buildpower Multiplier", - desc = "(Range 0.5 - 5). How much buildpower commander drones should have", - type = "number", - section = "options_extra", - def = 1, - min = 0.5, - max = 5, - step = 0.1, - }, - - { - key = "assistdronescount", - name = "ComDrones: Count", - desc = "How many assist drones per commander should be spawned", - type = "number", - section = "options_extra", - def = 10, - min = 1, - max = 30, - step = 1, - }, - - { - key = "assistdronesair", - name = "ComDrones: Use Air Drones", - desc = "Switch between aircraft drones and amphibious vehicle drones.", - type = "bool", - def = true, - section = "options_extra", - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - - { - key = "commanderbuildersenabled", -- TODO, turn this into boolean modoption - name = "Base Builder Turret", - type = "list", - def = "disabled", - section = "options_extra", - items = { - { key = "enabled", name = "Enabled", unlock = {"commanderbuildersrange", "commanderbuildersbuildpower"} }, - { key = "disabled", name = "Disabled", lock = {"commanderbuildersrange", "commanderbuildersbuildpower"} }, - } - }, - - { - key = "commanderbuildersrange", - name = "Base Builder Turret: Range", - desc = "(Range 500 - 2000).", - type = "number", - section = "options_extra", - def = 1000, - min = 500, - max = 2000, - step = 1, - }, - - { - key = "commanderbuildersbuildpower", - name = "Base Builder Turret: Buildpower", - desc = "(Range 100 - 1000).", - type = "number", - section = "options_extra", - def = 400, - min = 100, - max = 1000, - step = 1, - }, - - { - key = "sub_header", - section = "options_extra", - type = "separator", - }, - - { - key = "zombies", - name = "Scavenger Zombies", - type = "list", - def = "disabled", - section = "options_extra", - hidden = false, - items = { - { key = "disabled", name = "Disabled", desc = "Disabled"}, - { key = "normal", name = "Normal", desc = "Slow revival rate, normal strength."}, - { key = "hard", name = "Hard", desc = "Fast revival rate, stronger Scavenger Zombies." }, - { key = "nightmare", name = "Nightmare", desc = "Extreme revival rate, stronger Scavenger Zombies, 2-5 spawn per corpse." }, - } - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Experimental Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "options_experimental", - name = "Experimental", - desc = "Experimental options", - type = "section", - weight = 1, - }, - - { - key = "sub_header", - name = "Options for testing various new and unfinished features. Not intended for ranked games.", - desc = "", - section = "options_experimental", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - name = "When any of these options are changed, there is no guarantee they will work properly, especially when combined.", - desc = "", - section = "options_experimental", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - section = "options_experimental", - type = "separator", - }, - - { - key = "proposed_unit_reworks", - name = "Placeholder for BLT testing", - desc = "Placeholder for official balance testing mod option", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "community_balance_patch", - name = "Community Balance Patch 5-6/26", - desc = "Enable community balance patch changes\n(overwrites changes in official seasonal balance test)", - type = "list", - def = "disabled", - section = "options_experimental", - items = { - { key = "disabled", name = "Disabled", desc = "No community balance changes", - lock = {"community_balance_corspy","community_balance_armmav","community_balance_corcan","community_balance_corkarg","community_balance_armkam","community_balance_armblade"} }, - - { key = "enabled", name = "Enabled", desc = "Enable all community balance changes\nSpectre\nGunslinger\nSumo\nKarganeth\nBanshee\nHornet", - lock = {"community_balance_corspy","community_balance_armmav","community_balance_corcan","community_balance_corkarg","community_balance_armkam","community_balance_armblade"} }, - - { key = "custom", name = "Custom", desc = "Customize individual community balance changes", - unlock = {"community_balance_corspy", "community_balance_armmav", "community_balance_corcan", "community_balance_corkarg", "community_balance_armkam", "community_balance_armblade"} }, - } - }, - - { - key = "community_balance_patch_changelog_link", - name = "Changelog/Feedback", - desc = "Community Balance Patch discussion", - section = "options_experimental", - type = "link", - link = "https://discord.com/channels/549281623154229250/1512596823070740550", - width = 235, - column = 2.025, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "community_balance_corspy", - name = "(CBP) Spectre", - desc = "(From February)\nEnergy cost: 8800 (from 12500)\nMetal cost: 135 (from 165)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "community_balance_armmav", - name = "(CBP) Gunslinger", - desc = "(From April)\nMetal cost: 520 (from 650)\nEnergy cost: 6500 (from 11000)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "community_balance_corcan", - name = "(CBP) Sumo", - desc = "(From April)\nMain laser range: 300 (from 275)\nMain laser beam time: 0.24 (from 0.16)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "community_balance_corkarg", - name = "(CBP) Karganeth", - desc = "(New)\nSight distance: 515 (from 455)\nMax acceleration: 0.18 (from 0.1104)\nTurn rate: 515 (from 400)\nTurn-in-place speed limit: 1.25 (from 0.99)\nStrafe to attack: true (from false)\nMissile trajectory height: 0.25 (from none)\nMetal cost: 2650 (from 2500)\nBuild time: 100000 (from 94000)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "community_balance_armkam", - name = "(CBP) Banshee", - desc = "(New)\nMax acceleration: 0.35 (from 0.15)\nWeapon range: 425 (from 350)\nWeapon reload: 3.0 (from 0.7)\nWeapon damage: 116 single shot (from 9 x 3 burst)\nArea of effect: 32 (from 40)\nEdge effectiveness: 0.25 (from 0.5)\nProjectile velocity: 900 (from 1000)\nImpulse factor: 2.5 (from 0.123)\nWeapon visual: genericshellexplosion-small-bomb (from plasmahit-small)\nWeapon sound: mavgun4 (from flashemg)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "community_balance_armblade", - name = "(CBP) Hornet", - desc = "(New)\nMax acceleration: 0.28 (from 0.6)\nMax deceleration: 0.55 (from 0.35)\nSpeed: 165 (from 204)\nTurn angle limit: 120 (from 360)\nTurn rate: 420 (from 720)\nSight distance: 720 (from 624)\nWeapon range: 1100 (from 420)\nWeapon reload: 5.5 (from 2.26667)\nWeapon damage: 410 x 2 burst (from 190 x 2 burst)\nBurst rate: 0.15 (from 0.23333)\nArea of effect: 24 (from 32)\nEdge effectiveness: 0.25 (from 0.15)\nProjectile type: Cannon (from MissileLauncher)\nProjectile velocity: 1090 (from 1000)\nImpulse factor: 2.33 (from 0.123)\nWeapon visual: impulse-trail / genericshellexplosion-medium-bomb (from missiletrailsmall-simple / genericshellexplosion-medium)\nWeapon sound: mavgun5 / xplomed2 (from SabotFire / SabotHit)\nTurret: true (from false)\nFiring arc: 45° forward (from unrestricted)", - type = "bool", - def = false, - section = "options_experimental", - }, - - { - key = "experimentallegionfaction", - name = "Legion Faction", - desc = "3rd experimental faction", - type = "bool", - section = "options_experimental", - def = false, - }, - - { - key = "legionsimplifiedmexes", - name = "Legion Simplified Mexes", - desc = "Changes the legion T1 mex to act the same as the other T1 mexes. Legion light T1 units are given a higher metal cost but lower E cost, and heavy T1 units are given a higher E cost and slightly lower metal cost.", - type = "bool", - section = "options_experimental", - def = false, - }, - - { - key = "experimentallegionfaction_link", - name = "Development Discussion", - desc = "Discord discussion about Legion faction.", - section = "options_experimental", - type = "link", - link = "https://discord.com/channels/549281623154229250/1063217502898884701/1441480747629412675", - width = 275, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "easytax", - name = "Easy Tax v2", - desc = "Anti co-op sharing tax mod. Overwrites other tax settings. Don't combine with other sharing restriction mods, everything you need is included with easy tax.", - type = "bool", - section = "options_experimental", - def = false, - }, - - { - key = "easytax_link", - name = "Changelog", - desc = "Easy Tax v2 description.", - section = "options_experimental", - type = "link", - link = "https://gist.github.com/RebelNode/43b986f29b9cfacbe95cf634cac25c49", - width = 215, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - -- Hidden Tests - - { - key = "techsplit", - name = "Tech Split", - desc = "Adds a new tier between T1 and T2 for bots and vehicles", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "techsplit_balance", - name = "Tech Split Balance Test", - desc = "Adjusts the balance of units in the proposed tech split.", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "experimental_defend_firestate", - name = "Defend Combat Stance", - desc = "Replaces Return Fire with the new Defend combat stance.\nDefending units will shoot threats to themselves when they become threats on a 1v1 basis.", - type = "bool", - section = "options_experimental", - def = false, - }, - - { - key = "experimental_defend_firestate_link", - name = "Feedback thread", - desc = "Discord discussion about the Defend Combat Stance rework.", - section = "options_experimental", - type = "link", - link = "https://discord.com/channels/549281623154229250/1520166826435280998", - width = 215, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "air_rework", - name = "Air Rework", - desc = "Prototype version with more maneuverable, slower air units and more differentiation between them.", - hidden = true, - type = "bool", - section = "options_experimental", - def = false, - }, - - { - key = "skyshift", - name = "Skyshift: Air Rework", - desc = "A complete overhaul of air units and mechanics", - type = "bool", - def = false, - section = "options_experimental", - hidden = true, - }, - - { - key = "emprework", - name = "EMP Rework", - desc = "EMP is changed to slow units movement and firerate, before eventually stunning.", - type = "bool", - hidden = true, - section = "options_experimental", - - def = false, - }, - - { - key = "junorework", - name = "Juno Rework", - desc = "Juno stuns certain units (such as radars and jammers) rather than magically deleting them", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "releasecandidates", - name = "Release Candidate Units", - desc = "Adds additional units to the game which are being considered for mainline integration and are balanced, or in end tuning stages. Currently adds Printer, Siegebreaker, Phantom (Core T2 veh), Shockwave (Arm T2 EMP Mex), and Drone Carriers for armada and cortex", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "naval_balance_tweaks", - name = "Proposed Naval Balance Tweaks", - desc = "Modoption used to test specific balance adjustments dedicated towards naval units.", - type = "bool", - --hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "naval_balance_tweaks_link", - name = "Feedback thread", - desc = "Discord discussion about naval balance tweaks.", - section = "options_experimental", - type = "link", - link = "https://discord.com/channels/549281623154229250/1428031834045939833", - width = 215, - column = 1.65, - linkheight = 325, - linkwidth = 350, - }, - - { - key = "forge_volcano", - name = "Forge Volcano Event", - desc = "Enable the cinematic volcano eruption event on Forge v2.3.", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - { - key = "factory_costs", - name = "Factory Costs Test Patch", - desc = "Cheaper and more efficient factories, more expensive nanos, and slower to build higher-tech units. Experimental, not expected to be balanced by itself - a test to try how the game plays if each player is more able to afford their own T2 factory, while making assisting them less efficient.", - type = "bool", - hidden = true, - section = "options_experimental", - def = false, - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Unused Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "modes", - name = "GameModes", - desc = "Game Modes", - hidden = true, - type = "section", - }, - - { - key = "shareddynamicalliancevictory", - name = "Dynamic Ally Victory", - desc = "Ingame alliance should count for game over condition.", - hidden = true, - type = "bool", - section = "options", - def = false, - }, - - { - key = "ai_incomemultiplier", - name = "AI Income Multiplier", - desc = "Multiplies AI resource income", - hidden = true, - type = "number", - section = "options", - def = 1, - min = 1, - max = 10, - step = 0.1, - }, - - { - key = "defaultdecals", - name = "Default Decals", - desc = "Use the default explosion decals instead of Decals GL4", - section = "options_experimental", - type = "bool", - def = true, - hidden = true, - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- DEV mode only mod option otherwise hidden by chobby - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "dev", - name = "_DEV", - desc = "tab that should be hidden by chobby", - hidden = true, - type = "section", - }, - { - key = "teamcolors_icon_dev_mode", - name = "Icon Dev Mode ", - desc = "(Don't use in normal games) Forces teamcolors to be an specific one, for all teams", - type = "list", - section = "dev", - def = "disabled", - items = { - { key = "disabled", name = "Disabled", desc = "description" }, - { key = "armblue", name = "Armada Blue", desc = "description" }, - { key = "corred", name = "Cortex Red", desc = "description" }, - { key = "scavpurp", name = "Scavenger Purple", desc = "description" }, - { key = "raptororange", name = "Raptor Orange", desc = "description" }, - { key = "gaiagray", name = "Gaia Gray", desc = "description" }, - { key = "leggren", name = "Legion Green", desc = "description" }, - } - }, - { - key = "debugcommands", - name = "Debug Commands", - desc = "A pipe separated list of commands to execute at [gameframe]:luarules benchmark|100:forcequit...", -- example: debugcommands=150:cheat 1|200:luarules benchmark|600:quitforce; - section = "dev", - type = "string", - def = "", - }, - { - key = "animationcleanup", - name = "Animation Cleanup", - desc = "Use animations from the BOSCleanup branch", -- example: debugcommands=150:cheat 1|200:luarules benchmark|600:quitforce; - section = "dev", - type = "bool", - def = false, - }, - { - key = "pushresistant", - name = "Pushresistance", - desc = "Enable to do desync test by the use of pushresistance", - section = "dev", - type = "bool", - def = false, - }, - { - key = "dummyboolfeelfreetotouch", - name = "dummy to hide some modoptions", - desc = "This is a dummy to hide some modoptions to not bloat the changed options panel with unneeded information", - section = "dev", - type = "bool", - -- This doesn't have a default on purpse, do not add one - unlock = {"dummyboolfeelfreetotouch", "factionlimiter", "date_year", "date_month", "date_day", "date_hour"}, - }, - { key = "date_year", name = "Year", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 3000, step = 1, }, - { key = "date_month", name = "Month", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 12, step = 1, }, - { key = "date_day", name = "Day", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 31, step = 1, }, - { key = "date_hour", name = "Hour", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 24, step = 1, }, - { - key = "factionlimiter", - name = "Faction Limiter:".."\255\255\191\76".." ON\n".."\255\125\125\125".."BITMASK", - desc = [[BITMASK to be used via custom ui, only visible when boss + .. " It won't work in FFA mode without boxes.\n" + .. " Also, it does not affect Scavengers and Raptors.\n" + .. "\255\75\0\100" + .. "WARNING: No Rush Time over 30 minutes may cause performance or stability issues due to excessive unit buildup.", + type = "number", + section = "options_main", + def = 0, + min = 0, + max = 120, + step = 1, + }, + { + key = "norushmiddlefree", + name = "No Rush Non Base FFA", + desc = "Allows units to leave startboxes but disallows commands issued in enemy startboxes.\n" .. "Does not prevent commands onto the other side of startboxes so recommend East/West or North/South startboxes.", + type = "bool", + section = "options_main", + def = false, + }, + + { + key = "sub_header", + section = "options_main", + type = "separator", + }, + { + key = "sub_header", + name = "-- Sharing and Taxes", + section = "options_main", + type = "subheader", + def = true, + }, + { + key = "tax_resource_sharing_amount", + name = "Resource Sharing Tax", + desc = "Taxes resource sharing" .. "\255\128\128\128" .. " and overflow (engine TODO:)\n" .. "Set to [0] to turn off. Recommended: [0.4]. (Ranges: 0 - 0.99)", + type = "number", + def = 0, + min = 0, + max = 0.99, + step = 0.01, + section = "options_main", + column = 1, + }, + { + key = "disable_unit_sharing", + name = "Disable Unit Sharing", + desc = "Disable sharing units and structures to allies", + type = "bool", + section = "options_main", + def = false, + }, + { + key = "disable_assist_ally_construction", + name = "Disable Assist Ally Construction", + desc = "Disables assisting allied blueprints and labs.", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + { + key = "sub_header", + section = "options_main", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Unit Restrictions", + desc = "", + section = "options_main", + type = "subheader", + def = true, + }, + + { + key = "unit_restrictions_notech15", + name = "Disable Tech 1.5", + desc = "Disables: Sea Plane Labs, Hovercraft labs, and Amphibious labs. (Considered Tier 1.5)", + type = "bool", + section = "options_main", + def = false, + column = 1, + }, + + { + key = "unit_restrictions_notech2", + name = "Disable Tech 2", + desc = "Disable Tech 2", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + + { + key = "unit_restrictions_notech3", + name = "Disable Tech 3", + desc = "Disable Tech 3", + type = "bool", + section = "options_main", + def = false, + column = 2.33, + }, + + { + key = "unit_restrictions_noair", + name = "Disable Air Units", + desc = "Disable Air Units", + type = "bool", + section = "options_main", + def = false, + column = 1, + }, + + { + key = "unit_restrictions_nosea", + name = "Disable Sea Units", + desc = "Disable Sea Units", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + + { + key = "unit_restrictions_noextractors", + name = "Disable Metal Extractors", + desc = "Disable Metal Extractors", + type = "bool", + section = "options_main", + def = false, + column = 1, + }, + + { + key = "unit_restrictions_noconverters", + name = "Disable Energy Converters", + desc = "Disable Energy Converters", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + + { + key = "unit_restrictions_nofusion", + name = "Disable Fusion Generators", + desc = "Disables Normal and Advanced Fusion Energy Generators", + type = "bool", + section = "options_main", + def = false, + column = 2.33, + }, + + { + key = "unit_restrictions_notacnukes", + name = "Disable Tactical Missiles/EMPs", + desc = "Disables Cortex Tactical Missile Launcher and Armada EMP Missile Launcher", + type = "bool", + section = "options_main", + def = false, + column = 1, + }, + + { + key = "unit_restrictions_nonukes", + name = "Disable Nuclear Missiles", + desc = "Disable Nuclear Missiles", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + + { + key = "unit_restrictions_noantinuke", + name = "Disable Anti-Nuke Defence", + desc = "Disables Nuke Interceptor Units and Structures.", + type = "bool", + section = "options_main", + def = false, + column = 2.33, + }, + + { + key = "unit_restrictions_nolrpc", + name = "Disable Long Range Artilery (LRPC)", + desc = "Disable Long Range Plasma Artilery (LRPC) structures", + type = "bool", + section = "options_main", + def = false, + column = 1, + }, + + { + key = "unit_restrictions_noendgamelrpc", + name = "Disable Endgame Artilery (LRPC)", + desc = "Disable Endgame Long Range Plasma Artilery (LRPC) structures (AKA lolcannons)", + type = "bool", + section = "options_main", + def = false, + column = 1.66, + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Other Options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "options", + name = "Other", + desc = "Options", + type = "section", + }, + + { + key = "map_tidal", + name = "Tidal Strength", + desc = "Unchanged = map setting, low = 13e/sec, medium = 18e/sec, high = 23e/sec.", + hidden = true, + type = "list", + def = "unchanged", + section = "options", + items = { + { key = "unchanged", name = "Unchanged", desc = "Use map settings" }, + { key = "low", name = "Low", desc = "Set tidal incomes to 13 energy per second" }, + { key = "medium", name = "Medium", desc = "Set tidal incomes to 18 energy per second" }, + { key = "high", name = "High", desc = "Set tidal incomes to 23 energy per second" }, + }, + }, + + { + key = "critters", + name = "Animal amount", + desc = "This multiplier will be applied on the amount of critters a map will end up with", + hidden = true, + type = "number", + section = "options", + def = 1, + min = 0, + max = 2, + step = 0.2, + }, + + { + key = "map_atmosphere", + name = "Map Atmosphere and Ambient Sounds", + desc = "", + type = "bool", + def = true, + hidden = true, + section = "options", + }, + + { + key = "ffa_wreckage", + name = "FFA Mode Wreckage", + desc = "Killed players will blow up but leave wreckages", + hidden = true, + type = "bool", + def = false, + section = "options", + }, + + { + key = "wreck_metal_ratio", + name = "Wreck Metal Percent", + desc = "Percent of unit metal that is left in its wrecks", + hidden = true, + type = "number", + section = "options", + def = 0.6, + min = 0, + max = 1, + step = 0.05, + }, + + { + key = "heap_metal_ratio", + name = "Heap Metal Percent", + desc = "Percent of unit metal that is left in its heaps", + hidden = true, + type = "number", + section = "options", + def = 0.25, + min = 0, + max = 1, + step = 0.05, + }, + + { + key = "coop", + name = "Cooperative mode", + desc = "Adds extra commanders to id-sharing teams, 1 com per player", + type = "bool", + hidden = true, + def = false, + section = "options", + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Multiplier Options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Raptors + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + key = "raptor_defense_options", + name = "Raptors", + desc = "Various gameplay options that will change how the Raptor Defense is played.", + type = "section", + weight = 4, + }, + + { + key = "sub_header", + name = "Raptors Gamemode Options.", + desc = "", + section = "raptor_defense_options", + type = "subheader", + def = true, + }, + + { + key = "raptors_dev_channel_link", + name = "Development Discussion", + desc = "Raptors development discussion.", + section = "raptor_defense_options", + type = "link", + link = "https://discord.com/channels/549281623154229250/781097030692110346", + width = 275, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "sub_header", + name = "To Play Add a Raptors AI to the enemy Team: [Add AI], [RaptorsDefense AI]", + desc = "", + section = "raptor_defense_options", + type = "subheader", + }, + + { + key = "sub_header", + section = "raptor_defense_options", + type = "separator", + }, + + { + key = "raptor_difficulty", + name = "Base Difficulty", + desc = "Raptors difficulty", + type = "list", + def = "normal", + section = "raptor_defense_options", + items = { + { key = "veryeasy", name = "Very Easy", desc = "Very Easy" }, + { key = "easy", name = "Easy", desc = "Easy" }, + { key = "normal", name = "Normal", desc = "Normal" }, + { key = "hard", name = "Hard", desc = "Hard" }, + { key = "veryhard", name = "Very Hard", desc = "Very Hard" }, + { key = "epic", name = "Epic", desc = "Epic" }, + }, + }, + + { + key = "sub_header", + section = "raptor_defense_options", + type = "separator", + }, + + { + key = "raptor_raptorstart", + name = "Hives Placement", + desc = "Control where hives spawn", + type = "list", + def = "initialbox", + section = "raptor_defense_options", + items = { + { key = "avoid", name = "Spawn Anywhere", desc = "Hives avoid player units" }, + { key = "initialbox", name = "Growing Spawn Box", desc = "Hives spawn in limited area that increases over time" }, + { key = "alwaysbox", name = "Always Start Box", desc = "Hives always spawn in raptor start box" }, + }, + }, + + { + key = "raptor_endless", + name = "Endless Mode", + desc = "When you kill the queen, the game doesn't end, but loops around at higher difficulty instead, infinitely.", + type = "bool", + def = false, + section = "raptor_defense_options", + }, + + { + key = "sub_header", + section = "raptor_defense_options", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Advanced Options, Change at your own risk.", + desc = "", + section = "raptor_defense_options", + type = "subheader", + def = true, + }, + + { + key = "raptor_queentimemult", + name = "Queen Hatching Time Multiplier", + desc = "(Range: 0.1 - 2). How quickly Queen Hatch goes from 0 to 100%", + type = "number", + def = 1, + min = 0.1, + max = 2, + step = 0.1, + section = "raptor_defense_options", + }, + + { + key = "raptor_queen_count", + name = "Raptor Queen Count", + desc = "(Range: 1 - 100). Number of queens that will spawn.", + type = "number", + def = 1, + min = 1, + max = 100, + step = 1, + section = "raptor_defense_options", + }, + + { + key = "raptor_spawncountmult", + name = "Unit Spawn Per Wave Multiplier", + desc = "(Range: 1 - 5). How many times more raptors will spawn per wave.", + type = "number", + def = 1, + min = 1, + max = 5, + step = 1, + section = "raptor_defense_options", + }, + + { + key = "raptor_firstwavesboost", + name = "First Waves Size Boost", + desc = "(Range: 1 - 10). Intended to use with heavily modified settings. Makes first waves larger, the bigger the number the larger they are. Cools down within first few waves.", + type = "number", + def = 1, + min = 1, + max = 10, + step = 1, + section = "raptor_defense_options", + }, + + { + key = "raptor_spawntimemult", + name = "Waves Amount Multiplier", + desc = "(Range: 1 - 5). How often new waves will spawn. Bigger Number = More Waves", + type = "number", + def = 1, + min = 1, + max = 5, + step = 0.1, + section = "raptor_defense_options", + }, + + { + key = "raptor_graceperiodmult", + name = "Grace Period Time Multiplier", + desc = "(Range: 0.1 - 3). Time before Raptors become active. ", + type = "number", + def = 1, + min = 0.1, + max = 3, + step = 0.1, + section = "raptor_defense_options", + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Scavengers + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + key = "scav_defense_options", + name = "Scavengers", + desc = "Gameplay options for Scavengers gamemode", + type = "section", + weight = 3, + }, + + { + key = "sub_header", + name = "Scavengers Gamemode Options.", + desc = "", + section = "scav_defense_options", + type = "subheader", + def = true, + }, + + { + key = "scavengers_dev_channel_link", + name = "Development Discussion", + desc = "Scavengers development discussion.", + section = "scav_defense_options", + type = "link", + link = "https://discord.com/channels/549281623154229250/659550298653589504", + width = 275, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "sub_header", + name = "To Play Add a Scavangers AI to the enemy Team: [Add AI], [ScavengersDefense AI]", + desc = "", + section = "scav_defense_options", + type = "subheader", + }, + + { + key = "sub_header", + section = "scav_defense_options", + type = "separator", + }, + + { + key = "scav_difficulty", + name = "Base Difficulty", + desc = "Scavs difficulty", + type = "list", + def = "normal", + section = "scav_defense_options", + items = { + { key = "veryeasy", name = "Very Easy", desc = "Very Easy" }, + { key = "easy", name = "Easy", desc = "Easy" }, + { key = "normal", name = "Normal", desc = "Normal" }, + { key = "hard", name = "Hard", desc = "Hard" }, + { key = "veryhard", name = "Very Hard", desc = "Very Hard" }, + { key = "epic", name = "Epic", desc = "Epic" }, + }, + }, + + { + key = "sub_header", + section = "scav_defense_options", + type = "separator", + }, + + { + key = "scav_scavstart", + name = "Spawn Beacons Placement", + desc = "Control where spawners appear", + type = "list", + def = "initialbox", + section = "scav_defense_options", + items = { + { key = "avoid", name = "Spawn Anywhere", desc = "Beacons avoid player units" }, + { key = "initialbox", name = "Growing Spawn Box", desc = "Beacons spawn in limited area that increases over time" }, + --{ key = "alwaysbox", name = "Always Start Box", desc="Beacons always spawn in scav start box" }, + }, + }, + + { + key = "scav_endless", + name = "Endless Mode", + desc = "When you kill the boss, the game doesn't end, but loops around at higher difficulty instead, infinitely.", + type = "bool", + def = false, + section = "scav_defense_options", + }, + + { + key = "sub_header", + section = "scav_defense_options", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Advanced Options, Change at your own risk.", + desc = "", + section = "scav_defense_options", + type = "subheader", + def = true, + }, + + { + key = "scav_bosstimemult", + name = "Boss Preparation Time Multiplier", + desc = "(Range: 0.1 - 2). How quickly Boss Anger goes from 0 to 100%.", + type = "number", + def = 1, + min = 0.1, + max = 2, + step = 0.1, + section = "scav_defense_options", + }, + + { + key = "scav_boss_count", + name = "Scavengers Boss Count", + desc = "(Range: 1 - 20). Number of bosses that will spawn.", + type = "number", + def = 1, + min = 1, + max = 20, + step = 1, + section = "scav_defense_options", + }, + + { + key = "scav_spawncountmult", + name = "Unit Spawn Per Wave Multiplier", + desc = "(Range: 1 - 5). How many times more scavs will spawn per wave.", + type = "number", + def = 1, + min = 1, + max = 5, + step = 1, + section = "scav_defense_options", + }, + + { + key = "scav_spawntimemult", + name = "Waves Amount Multiplier", + desc = "(Range: 1 - 5). How often new waves will spawn. Bigger Number = More Waves", + type = "number", + def = 1, + min = 1, + max = 5, + step = 0.1, + section = "scav_defense_options", + }, + + { + key = "scav_graceperiodmult", + name = "Grace Period Time Multiplier", + desc = "(Range: 0.1 - 3). Time before Scavs become active. ", + type = "number", + def = 1, + min = 0.1, + max = 3, + step = 0.1, + section = "scav_defense_options", + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Extra Options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "options_extra", + name = "Extras", + desc = "Extra options", + type = "section", + weight = 2, + }, + + { + key = "sub_header", + name = "Extra options for shaking up the gameplay or balancing. Not intended for ranked games.", + desc = "", + section = "options_extra", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "experimentalextraunits", + name = "Extra Units Pack", + desc = "Pack of units that didn't make it to the main game roster. Balanced for PvP", + type = "bool", + section = "options_extra", + def = false, + }, + + { + key = "scavunitsforplayers", + name = "Scavengers Units Pack", + desc = "Units made for Scavengers, mostly silly and unbalanced for PvP.", + type = "bool", + section = "options_extra", + def = false, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "map_waterlevel", + name = "Water Level", + desc = "Doesn't work if Map Deformation is disabled! <0 = Decrease water level, >0 = Increase water level", + type = "number", + def = 0, + min = -10000, + max = 10000, + step = 1, + section = "options_extra", + }, + + { + key = "map_waterislava", + name = "Water Is Lava", + desc = "Turns water into Lava", + type = "bool", + def = false, + section = "options_extra", + unlock = { "map_lavatiderhythm", "map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "map_tweaklava" }, + lock = { "sub_header_lava3", "sub_header_lava4" }, + bitmask = 1, + }, + + { + key = "map_lavatiderhythm", + name = "Lava Tides", + desc = "Lava level periodicially cycles height when tides are present", + type = "list", + def = "default", + section = "options_extra", + column = 1, + items = { + { key = "default", name = "Default", desc = "Map Settings", lock = { "map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4" }, unlock = { "sub_header_lava1", "sub_header_lava2" } }, + { key = "enabled", name = "Enable/Override", desc = "Lava tides will use these settings over the map defaults", unlock = { "map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4" }, lock = { "sub_header_lava1", "sub_header_lava2" } }, + { key = "disabled", name = "Disable", desc = "Lava will not have tides, even on maps that normally have it", lock = { "map_lavatidemode", "map_lavahighlevel", "map_lavahighdwell", "map_lavalowlevel", "map_lavalowdwell", "sub_header_lava3", "sub_header_lava4" }, unlock = { "sub_header_lava1", "sub_header_lava2" } }, + }, + bitmask = 2, + }, + + { + key = "map_lavatidemode", + name = "Lava Tide Mode", + desc = "Toggle whether lava starts at high or low tide.", + hidden = false, + type = "list", + def = "lavastartlow", + section = "options_extra", + items = { + { key = "lavastartlow", name = "Start Low", desc = "Lava starts at low tide" }, + { key = "lavastarthigh", name = "Start High", desc = "Lava starts at high tide" }, + }, + }, + + { + key = "map_lavahighlevel", + name = "Lava High Tide Level", + desc = "Lava level at high tide", + type = "number", + def = 0, + min = 0, + max = 10000, + step = 1, + section = "options_extra", + column = 1, + }, + + { + key = "map_lavahighdwell", + name = "Lava High Tide Time", + desc = "Time in seconds lava waits at high tide", + type = "number", + def = 60, + min = 1, + max = 30000, + step = 1, + section = "options_extra", + column = 2.0, + }, + + { + key = "map_lavalowlevel", + name = "Lava Low Tide Level", + desc = "Lava level at low tide", + type = "number", + def = 0, + min = 0, + max = 10000, + step = 1, + section = "options_extra", + column = 1, + }, + + { + key = "map_lavalowdwell", + name = "Lava Low Tide Time", + desc = "Time in seconds lava waits at low tide", + type = "number", + def = 300, + min = 1, + max = 30000, + step = 1, + section = "options_extra", + column = 2.0, + }, + + { + key = "map_tweaklava", + name = "Advanced Tide Rhythm", + desc = "Table with format {MapHeight (elmo), Rate (elmo/s), Dwell Time (s)}, e.g. {0, 6, 60},{100, 3, 20}", + hidden = true, + hint = "{Lava Height, Rise/Fall Rate, Dwell Time}", + type = "string", + def = "", + section = "options_extra", + }, + + { key = "sub_header_lava1", section = "options_extra", type = "subheader", name = "" }, + { key = "sub_header_lava2", section = "options_extra", type = "subheader", name = "" }, + { key = "sub_header_lava3", section = "options_extra", type = "subheader", name = "" }, + { key = "sub_header_lava4", section = "options_extra", type = "subheader", name = "" }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "ruins", + name = "Ruins", + desc = "Remains of the battles once fought", + type = "list", + def = "scav_only", + section = "options_extra", + items = { + { key = "enabled", name = "Enabled", unlock = { "ruins_density", "ruins_only_t1" } }, + { key = "scav_only", name = "Enabled for Scavengers only", unlock = { "ruins_density", "ruins_only_t1" } }, + { key = "disabled", name = "Disabled", lock = { "ruins_density", "ruins_only_t1" } }, + }, + }, + + { + key = "ruins_density", + name = "Ruins: Density", + type = "list", + def = "normal", + section = "options_extra", + items = { + { key = "verydense", name = "Very Dense" }, + { key = "dense", name = "Dense" }, + { key = "normal", name = "Normal" }, + { key = "rare", name = "Rare" }, + { key = "veryrare", name = "Very Rare" }, + }, + }, + + { + key = "ruins_only_t1", + name = "Ruins: Only Tech 1", + type = "bool", + def = false, + section = "options_extra", + }, + + { + key = "ruins_civilian_disable", + name = "Ruins: Disable Civilian (Not Implemented Yet)", + type = "bool", + def = false, + section = "options", + hidden = true, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "lootboxes", + name = "Lootboxes", + desc = "Random drops of valuable stuff.", + type = "list", + def = "scav_only", + section = "options_extra", + items = { + { key = "enabled", name = "Enabled", unlock = { "lootboxes_density" } }, + { key = "scav_only", name = "Enabled for Scavengers only", unlock = { "lootboxes_density" } }, + { key = "disabled", name = "Disabled", lock = { "lootboxes_density" } }, + }, + }, + + { + key = "lootboxes_density", + name = "Lootboxes: Density", + type = "list", + def = "normal", + section = "options_extra", + items = { + { key = "normal", name = "Normal" }, + { key = "rare", name = "Rare" }, + { key = "veryrare", name = "Very Rare" }, + }, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "evocom", + name = "Evolving Commanders", + desc = "Commanders evolve, gaining new weapons and abilities.", + type = "bool", + def = false, + section = "options_extra", + bitmask = 1, + unlock = { "evocomlevelupmethod", "evocomlevelcap", "evocomxpmultiplier", "evocomleveluptime", "evocomlevelupmultiplier" }, + --lock = {"buffer_fix"}, + }, + + { + key = "evocom_feedback_thread_link", + name = "Feedback thread", + desc = "Discord discussion about Evolving Commanders.", + section = "options_extra", + type = "link", + link = "https://discord.com/channels/549281623154229250/1233887661291343913", + width = 215, + column = 2, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "evocomlevelupmethod", + name = "EvoCom: Leveling Method", + desc = "Dynamic: Commanders evolve to keep up with the highest power player. Timed: Static Evolution Rate", + type = "list", + def = "dynamic", + section = "options_extra", + bitmask = 2, + items = { + { key = "dynamic", name = "Dynamic", lock = { "evocomleveluptime" }, unlock = { "evocomlevelupmultiplier" } }, + { key = "timed", name = "Timed", lock = { "evocomlevelupmultiplier" }, unlock = { "evocomleveluptime" } }, + }, + }, + + { + key = "evocomlevelupmultiplier", + name = "EvoCom: Evolution Mult.", + desc = "(Range 0.1x - 3x Multiplier) Adjusts the thresholds at which Dynamic evolutions occur", + type = "number", + section = "options_extra", + def = 1, + min = 0.1, + max = 3, + step = 0.1, + }, + + { + key = "evocomleveluptime", + name = "EvoCom: Evolution Time ", + desc = "(Range 0.1 - 20 Minutes) Rate at which commanders will evolve if Timed method is selected.", + type = "number", + section = "options_extra", + def = 5, + min = 0.1, + max = 20, + step = 0.1, + }, + + { + key = "evocomlevelcap", + name = "EvoCom: Max Level", + desc = "(Range 2 - 10) Changes the Evolving Commanders maximum level", + type = "number", + section = "options_extra", + def = 10, + min = 2, + max = 10, + step = 1, + }, + + { + key = "evocomxpmultiplier", + name = "EvoCom: Commander XP Multiplier", + desc = "(Range 0.1 - 10) Does not affect leveling! Changes the rate at which Evolving Commanders gain Experience.", + type = "number", + section = "options_extra", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "comrespawn", + name = "Commander Respawning", + desc = "Commanders can build one Effigy. The first one is free and given for you at the start. When the commander dies, the Effigy is sacrificed in its place.", + type = "list", + def = "evocom", + section = "options_extra", + items = { + { key = "evocom", name = "Evolving Commanders Only" }, + { key = "all", name = "All Commanders" }, + { key = "disabled", name = "Disabled" }, + }, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "quick_start", + name = "Quick Start", + desc = "Each player gets pre-game resources to spend on structures to be instantly spawned at the beginning of the game.", + type = "list", + def = "default", + section = "options_extra", + unlock = { "quick_start_amount" }, + items = { + { key = "default", name = "Default", lock = { "quick_start_amount" }, desc = "Default settings for game modes." }, + { key = "enabled", name = "Enabled", unlock = { "quick_start_amount" }, desc = "Quick Start alone, deducts 400 energy and 800 metal from starting resources." }, + { key = "factory_discount", name = "Enabled: Discounted First Factory", desc = "Quick Start The commander's first factory is discounted at any time. Deducts 400 energy and 800 metal from starting resources.", unlock = { "quick_start_amount" } }, + { key = "factory_discount_only", name = "First Factory Discount Only", desc = "No base budget, only first factory discount. No deduction from starting resources.", lock = { "quick_start_amount" } }, + { key = "disabled", name = "Disabled", desc = "Disabled quick start for all game modes.", lock = { "quick_start_amount" } }, + }, + }, + + { + key = "quick_start_link", + name = "Feedback thread", + desc = "Discord discussion about quick start.", + section = "options_extra", + type = "link", + link = "https://discord.com/channels/549281623154229250/1413936809980858408", + width = 215, + column = 2, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "quick_start_amount", + name = "Quick Start Base Budget", + desc = "How much pre-game resources you have to spend on pre-queuing structures.", + type = "list", + def = "default", + section = "options_extra", + items = { + { key = "default", name = "Default", desc = "Uses the default amount based on game mode" }, + { key = "small", name = "Small", desc = "800 Base Budget" }, + { key = "normal", name = "Normal", desc = "1200 Base Budget" }, + { key = "large", name = "Large", desc = "2400 Base Budget" }, + }, + }, + + { + key = "enable_quickstart_overrides", + name = "Enable Quick Start Overrides", + desc = "Allow overriding quick start range and budget (for debugging/modding).", + type = "bool", + def = false, + section = "options_extra", + hidden = true, + }, + + { + key = "override_quick_start_range", + name = "Override Quick Start Range", + desc = "Override the quick start build range when overrides are enabled (values below 200 are clamped to 200).", + type = "number", + def = 600, + min = 200, + max = 2000, + step = 1, + section = "options_extra", + hidden = true, + }, + + { + key = "override_quick_start_budget", + name = "Override Quick Start Budget", + desc = "Override the quick start starting resources when overrides are enabled.", + type = "number", + def = 1200, + min = 100, + max = 1000000, + step = 1, + section = "options_extra", + hidden = true, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "assistdronesenabled", -- TODO, turn this into booleam modoption + name = "Commander Drones", + type = "list", + def = "disabled", + section = "options_extra", + items = { + { key = "enabled", name = "Enabled", unlock = { "assistdronesbuildpowermultiplier", "assistdronescount", "assistdronesair" } }, + { key = "disabled", name = "Disabled", lock = { "assistdronesbuildpowermultiplier", "assistdronescount", "assistdronesair" } }, + }, + }, + + { + key = "assistdronesbuildpowermultiplier", + name = "ComDrones: Buildpower Multiplier", + desc = "(Range 0.5 - 5). How much buildpower commander drones should have", + type = "number", + section = "options_extra", + def = 1, + min = 0.5, + max = 5, + step = 0.1, + }, + + { + key = "assistdronescount", + name = "ComDrones: Count", + desc = "How many assist drones per commander should be spawned", + type = "number", + section = "options_extra", + def = 10, + min = 1, + max = 30, + step = 1, + }, + + { + key = "assistdronesair", + name = "ComDrones: Use Air Drones", + desc = "Switch between aircraft drones and amphibious vehicle drones.", + type = "bool", + def = true, + section = "options_extra", + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "commanderbuildersenabled", -- TODO, turn this into boolean modoption + name = "Base Builder Turret", + type = "list", + def = "disabled", + section = "options_extra", + items = { + { key = "enabled", name = "Enabled", unlock = { "commanderbuildersrange", "commanderbuildersbuildpower" } }, + { key = "disabled", name = "Disabled", lock = { "commanderbuildersrange", "commanderbuildersbuildpower" } }, + }, + }, + + { + key = "commanderbuildersrange", + name = "Base Builder Turret: Range", + desc = "(Range 500 - 2000).", + type = "number", + section = "options_extra", + def = 1000, + min = 500, + max = 2000, + step = 1, + }, + + { + key = "commanderbuildersbuildpower", + name = "Base Builder Turret: Buildpower", + desc = "(Range 100 - 1000).", + type = "number", + section = "options_extra", + def = 400, + min = 100, + max = 1000, + step = 1, + }, + + { + key = "sub_header", + section = "options_extra", + type = "separator", + }, + + { + key = "zombies", + name = "Scavenger Zombies", + type = "list", + def = "disabled", + section = "options_extra", + hidden = false, + items = { + { key = "disabled", name = "Disabled", desc = "Disabled" }, + { key = "normal", name = "Normal", desc = "Slow revival rate, normal strength." }, + { key = "hard", name = "Hard", desc = "Fast revival rate, stronger Scavenger Zombies." }, + { key = "nightmare", name = "Nightmare", desc = "Extreme revival rate, stronger Scavenger Zombies, 2-5 spawn per corpse." }, + }, + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Experimental Options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "options_experimental", + name = "Experimental", + desc = "Experimental options", + type = "section", + weight = 1, + }, + + { + key = "sub_header", + name = "Options for testing various new and unfinished features. Not intended for ranked games.", + desc = "", + section = "options_experimental", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + name = "When any of these options are changed, there is no guarantee they will work properly, especially when combined.", + desc = "", + section = "options_experimental", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + section = "options_experimental", + type = "separator", + }, + + { + key = "proposed_unit_reworks", + name = "Placeholder for BLT testing", + desc = "Placeholder for official balance testing mod option", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "community_balance_patch", + name = "Community Balance Patch 5-6/26", + desc = "Enable community balance patch changes\n(overwrites changes in official seasonal balance test)", + type = "list", + def = "disabled", + section = "options_experimental", + items = { + { key = "disabled", name = "Disabled", desc = "No community balance changes", lock = { "community_balance_corspy", "community_balance_armmav", "community_balance_corcan", "community_balance_corkarg", "community_balance_armkam", "community_balance_armblade" } }, + + { key = "enabled", name = "Enabled", desc = "Enable all community balance changes\nSpectre\nGunslinger\nSumo\nKarganeth\nBanshee\nHornet", lock = { "community_balance_corspy", "community_balance_armmav", "community_balance_corcan", "community_balance_corkarg", "community_balance_armkam", "community_balance_armblade" } }, + + { key = "custom", name = "Custom", desc = "Customize individual community balance changes", unlock = { "community_balance_corspy", "community_balance_armmav", "community_balance_corcan", "community_balance_corkarg", "community_balance_armkam", "community_balance_armblade" } }, + }, + }, + + { + key = "community_balance_patch_changelog_link", + name = "Changelog/Feedback", + desc = "Community Balance Patch discussion", + section = "options_experimental", + type = "link", + link = "https://discord.com/channels/549281623154229250/1512596823070740550", + width = 235, + column = 2.025, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "community_balance_corspy", + name = "(CBP) Spectre", + desc = "(From February)\nEnergy cost: 8800 (from 12500)\nMetal cost: 135 (from 165)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "community_balance_armmav", + name = "(CBP) Gunslinger", + desc = "(From April)\nMetal cost: 520 (from 650)\nEnergy cost: 6500 (from 11000)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "community_balance_corcan", + name = "(CBP) Sumo", + desc = "(From April)\nMain laser range: 300 (from 275)\nMain laser beam time: 0.24 (from 0.16)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "community_balance_corkarg", + name = "(CBP) Karganeth", + desc = "(New)\nSight distance: 515 (from 455)\nMax acceleration: 0.18 (from 0.1104)\nTurn rate: 515 (from 400)\nTurn-in-place speed limit: 1.25 (from 0.99)\nStrafe to attack: true (from false)\nMissile trajectory height: 0.25 (from none)\nMetal cost: 2650 (from 2500)\nBuild time: 100000 (from 94000)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "community_balance_armkam", + name = "(CBP) Banshee", + desc = "(New)\nMax acceleration: 0.35 (from 0.15)\nWeapon range: 425 (from 350)\nWeapon reload: 3.0 (from 0.7)\nWeapon damage: 116 single shot (from 9 x 3 burst)\nArea of effect: 32 (from 40)\nEdge effectiveness: 0.25 (from 0.5)\nProjectile velocity: 900 (from 1000)\nImpulse factor: 2.5 (from 0.123)\nWeapon visual: genericshellexplosion-small-bomb (from plasmahit-small)\nWeapon sound: mavgun4 (from flashemg)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "community_balance_armblade", + name = "(CBP) Hornet", + desc = "(New)\nMax acceleration: 0.28 (from 0.6)\nMax deceleration: 0.55 (from 0.35)\nSpeed: 165 (from 204)\nTurn angle limit: 120 (from 360)\nTurn rate: 420 (from 720)\nSight distance: 720 (from 624)\nWeapon range: 1100 (from 420)\nWeapon reload: 5.5 (from 2.26667)\nWeapon damage: 410 x 2 burst (from 190 x 2 burst)\nBurst rate: 0.15 (from 0.23333)\nArea of effect: 24 (from 32)\nEdge effectiveness: 0.25 (from 0.15)\nProjectile type: Cannon (from MissileLauncher)\nProjectile velocity: 1090 (from 1000)\nImpulse factor: 2.33 (from 0.123)\nWeapon visual: impulse-trail / genericshellexplosion-medium-bomb (from missiletrailsmall-simple / genericshellexplosion-medium)\nWeapon sound: mavgun5 / xplomed2 (from SabotFire / SabotHit)\nTurret: true (from false)\nFiring arc: 45° forward (from unrestricted)", + type = "bool", + def = false, + section = "options_experimental", + }, + + { + key = "experimentallegionfaction", + name = "Legion Faction", + desc = "3rd experimental faction", + type = "bool", + section = "options_experimental", + def = false, + }, + + { + key = "legionsimplifiedmexes", + name = "Legion Simplified Mexes", + desc = "Changes the legion T1 mex to act the same as the other T1 mexes. Legion light T1 units are given a higher metal cost but lower E cost, and heavy T1 units are given a higher E cost and slightly lower metal cost.", + type = "bool", + section = "options_experimental", + def = false, + }, + + { + key = "experimentallegionfaction_link", + name = "Development Discussion", + desc = "Discord discussion about Legion faction.", + section = "options_experimental", + type = "link", + link = "https://discord.com/channels/549281623154229250/1063217502898884701/1441480747629412675", + width = 275, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "easytax", + name = "Easy Tax v2", + desc = "Anti co-op sharing tax mod. Overwrites other tax settings. Don't combine with other sharing restriction mods, everything you need is included with easy tax.", + type = "bool", + section = "options_experimental", + def = false, + }, + + { + key = "easytax_link", + name = "Changelog", + desc = "Easy Tax v2 description.", + section = "options_experimental", + type = "link", + link = "https://gist.github.com/RebelNode/43b986f29b9cfacbe95cf634cac25c49", + width = 215, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + -- Hidden Tests + + { + key = "techsplit", + name = "Tech Split", + desc = "Adds a new tier between T1 and T2 for bots and vehicles", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "techsplit_balance", + name = "Tech Split Balance Test", + desc = "Adjusts the balance of units in the proposed tech split.", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "experimental_defend_firestate", + name = "Defend Combat Stance", + desc = "Replaces Return Fire with the new Defend combat stance.\nDefending units will shoot threats to themselves when they become threats on a 1v1 basis.", + type = "bool", + section = "options_experimental", + def = false, + }, + + { + key = "experimental_defend_firestate_link", + name = "Feedback thread", + desc = "Discord discussion about the Defend Combat Stance rework.", + section = "options_experimental", + type = "link", + link = "https://discord.com/channels/549281623154229250/1520166826435280998", + width = 215, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "air_rework", + name = "Air Rework", + desc = "Prototype version with more maneuverable, slower air units and more differentiation between them.", + hidden = true, + type = "bool", + section = "options_experimental", + def = false, + }, + + { + key = "skyshift", + name = "Skyshift: Air Rework", + desc = "A complete overhaul of air units and mechanics", + type = "bool", + def = false, + section = "options_experimental", + hidden = true, + }, + + { + key = "emprework", + name = "EMP Rework", + desc = "EMP is changed to slow units movement and firerate, before eventually stunning.", + type = "bool", + hidden = true, + section = "options_experimental", + + def = false, + }, + + { + key = "junorework", + name = "Juno Rework", + desc = "Juno stuns certain units (such as radars and jammers) rather than magically deleting them", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "releasecandidates", + name = "Release Candidate Units", + desc = "Adds additional units to the game which are being considered for mainline integration and are balanced, or in end tuning stages. Currently adds Printer, Siegebreaker, Phantom (Core T2 veh), Shockwave (Arm T2 EMP Mex), and Drone Carriers for armada and cortex", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "naval_balance_tweaks", + name = "Proposed Naval Balance Tweaks", + desc = "Modoption used to test specific balance adjustments dedicated towards naval units.", + type = "bool", + --hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "naval_balance_tweaks_link", + name = "Feedback thread", + desc = "Discord discussion about naval balance tweaks.", + section = "options_experimental", + type = "link", + link = "https://discord.com/channels/549281623154229250/1428031834045939833", + width = 215, + column = 1.65, + linkheight = 325, + linkwidth = 350, + }, + + { + key = "forge_volcano", + name = "Forge Volcano Event", + desc = "Enable the cinematic volcano eruption event on Forge v2.3.", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + { + key = "factory_costs", + name = "Factory Costs Test Patch", + desc = "Cheaper and more efficient factories, more expensive nanos, and slower to build higher-tech units. Experimental, not expected to be balanced by itself - a test to try how the game plays if each player is more able to afford their own T2 factory, while making assisting them less efficient.", + type = "bool", + hidden = true, + section = "options_experimental", + def = false, + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Unused Options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "modes", + name = "GameModes", + desc = "Game Modes", + hidden = true, + type = "section", + }, + + { + key = "shareddynamicalliancevictory", + name = "Dynamic Ally Victory", + desc = "Ingame alliance should count for game over condition.", + hidden = true, + type = "bool", + section = "options", + def = false, + }, + + { + key = "ai_incomemultiplier", + name = "AI Income Multiplier", + desc = "Multiplies AI resource income", + hidden = true, + type = "number", + section = "options", + def = 1, + min = 1, + max = 10, + step = 0.1, + }, + + { + key = "defaultdecals", + name = "Default Decals", + desc = "Use the default explosion decals instead of Decals GL4", + section = "options_experimental", + type = "bool", + def = true, + hidden = true, + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- DEV mode only mod option otherwise hidden by chobby + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "dev", + name = "_DEV", + desc = "tab that should be hidden by chobby", + hidden = true, + type = "section", + }, + { + key = "teamcolors_icon_dev_mode", + name = "Icon Dev Mode ", + desc = "(Don't use in normal games) Forces teamcolors to be an specific one, for all teams", + type = "list", + section = "dev", + def = "disabled", + items = { + { key = "disabled", name = "Disabled", desc = "description" }, + { key = "armblue", name = "Armada Blue", desc = "description" }, + { key = "corred", name = "Cortex Red", desc = "description" }, + { key = "scavpurp", name = "Scavenger Purple", desc = "description" }, + { key = "raptororange", name = "Raptor Orange", desc = "description" }, + { key = "gaiagray", name = "Gaia Gray", desc = "description" }, + { key = "leggren", name = "Legion Green", desc = "description" }, + }, + }, + { + key = "debugcommands", + name = "Debug Commands", + desc = "A pipe separated list of commands to execute at [gameframe]:luarules benchmark|100:forcequit...", -- example: debugcommands=150:cheat 1|200:luarules benchmark|600:quitforce; + section = "dev", + type = "string", + def = "", + }, + { + key = "animationcleanup", + name = "Animation Cleanup", + desc = "Use animations from the BOSCleanup branch", -- example: debugcommands=150:cheat 1|200:luarules benchmark|600:quitforce; + section = "dev", + type = "bool", + def = false, + }, + { + key = "pushresistant", + name = "Pushresistance", + desc = "Enable to do desync test by the use of pushresistance", + section = "dev", + type = "bool", + def = false, + }, + { + key = "dummyboolfeelfreetotouch", + name = "dummy to hide some modoptions", + desc = "This is a dummy to hide some modoptions to not bloat the changed options panel with unneeded information", + section = "dev", + type = "bool", + -- This doesn't have a default on purpse, do not add one + unlock = { "dummyboolfeelfreetotouch", "factionlimiter", "date_year", "date_month", "date_day", "date_hour" }, + }, + { key = "date_year", name = "Year", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 3000, step = 1 }, + { key = "date_month", name = "Month", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 12, step = 1 }, + { key = "date_day", name = "Day", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 31, step = 1 }, + { key = "date_hour", name = "Hour", desc = "Spads (Multiplayer) / Skirmish Interface (Singleplayer) fed, auto-overwriten", section = "dev", type = "number", def = 0, min = 0, max = 24, step = 1 }, + { + key = "factionlimiter", + name = "Faction Limiter:" .. "\255\255\191\76" .. " ON\n" .. "\255\125\125\125" .. "BITMASK", + desc = [[BITMASK to be used via custom ui, only visible when boss Set to [0] To disable. Otherwise: 0th, 1st and 2nd bit are armada, cortex and legion respectively. Offset by 3 for each consecutive team. If a team's bitmask is 0, All are Enabled. Example: Armada VS Cortex VS Legion: 273 or 100 010 001 or 256 + 16 + 1]], - section = "dev", - type = "number", - def = 0, - min = 0, - max = 16777215,-- math hard, 24 bit limitish? - step = 1, - }, - - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Map Metadata options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- - -- The modoptions below are intended to be set automatically by lobby/spads based on the selected - -- map name. They are used for a dynamic map configuration where the configruation values are not - -- tied to either game version or reside inside of the map file, allowing for independent distribution - -- from the maps metadata source of truth: https://github.com/beyond-all-reason/maps-metadata - { - key = "mapmetadata", - name = "MapMetadata", - desc = "mapmetadata tab that should be hidden by chobby, which would have ideally been achieved by just not listing it and the following options here in the first place, but then SPADS refuses to set the modoption", - hidden = true, - type = "section", - }, - { - key = "sub_header", - name = "Hidden map metadata options that are supposed to be set automatically by lobby/spads based on the map name.", - desc = "", - section = "mapmetadata", - type = "subheader", - hidden = true, - def = true, - }, - { - key = "mapmetadata_startpos", - name = "Map Metadata: StartPos", - desc = "StartPos configuration. Format is: base64url(zlib(json))", - hidden = true, - section = "mapmetadata", - type = "string", - def = "", - }, - { - key = "mapmetadata_startboxes_set", - name = "Map Metadata: Startboxes Set", - desc = "Per-team-count startbox arrangements (rect or polygon). Format is: base64url(zlib(json))", - hidden = true, - section = "mapmetadata", - type = "string", - def = "", - }, - { - key = "mapmetadata_startbox_override", - name = "Map Metadata: Startbox Override", - desc = "Custom startbox arrangement that overrides the set when its team count matches. Format is: base64url(zlib(json))", - hidden = true, - section = "mapmetadata", - type = "string", - def = "", - }, - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- Cheats - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - { - key = "options_cheats", - name = "Cheats", - desc = "Options that alter the game balance in unintended way, Use at your own risk.", - type = "section", - weight = -1, - }, - - { - key = "sub_header", - name = "Warning: changing these options will alter the intended game experience and may have bad results. Proceed at your own risk!", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - name = "When any of these options are changed, there is no guarantee they will work properly, especially when combined.", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "sub_header", - section = "options_cheats", - type = "separator", - }, - - { - key = "sub_header", - name = "-- AI Cheats", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "dynamiccheats", - name = "Dynamic Cheats", - desc = "Cheats marked as [Dynamic] react to the game state and are suspended when the opposition is losing", - type = "bool", - def = true, - section = "options_cheats", - }, - - { - key = "nowasting", - name = "No Resource Wasting", - desc = "[Dynamic] Increases Buildpower for the affected team's builders and factories to prevent resource", - type = "list", - def = "default", - section = "options_cheats", - items = { - { key= "default", name= "Default", desc="Disabled, unless other features use it"}, - { key= "disabled", name= "Disabled", desc="Disabled"}, - { key= "ai", name= "AI Only", desc="All AI except Scavengers and Raptors"}, - { key= "all", name= "All", desc="AI and Player Teams both excluding Scavengers and Raptors" }, - } - }, - - { - key = "allow_enemy_ai_spawn_placement", - name = "Allow Hostile AI Spawn Placement", - desc = "When enabled, allows enemy allyteams to view and place enemy AI start positions during the pregame", - type = "bool", - def = false, - section = "options_cheats", - }, - - { - key = "sub_header", - section = "options_cheats", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Starting Resources", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "startmetal", - name = "Starting Metal", - desc = "(Range 0 - 10 000). Determines amount of metal and metal storage that each player will start with", - type = "number", - section = "options_cheats", - def = 1000, - min = 0, - max = 10000, - step = 1, - }, - - { - key = "startmetalstorage", - name = "Starting Metal Storage", - desc = "(Range 1000 - 20 000). Only works if it's higher than Starting metal. Determines amount of metal and metal storage that each player will start with", - type = "number", - section = "options_cheats", - def = 1000, - min = 1000, - max = 20000, - step = 1, - }, - - { - key = "startenergy", - name = "Starting Energy", - desc = "(Range 0 - 10 000). Determines amount of energy and energy storage that each player will start with", - type = "number", - section = "options_cheats", - def = 1000, - min = 0, - max = 10000, - step = 1, - }, - - { - key = "startenergystorage", - name = "Starting Energy Storage", - desc = "(Range 1000 - 20 000). Only works if it's higher than Starting energy. Determines amount of energy and energy storage that each player will start with", - type = "number", - section = "options_cheats", - def = 1000, - min = 1000, - max = 20000, - step = 1, - }, - - { - key = "bonusstartresourcemultiplier", - name = "Apply Bonus to Starting Resources", - desc = "If enabled, multiplies each players starting resources with their bonus.", - type = "bool", - section = "options_cheats", - def = false, - }, - - { - key = "sub_header", - section = "options_cheats", - type = "separator", - }, - - { - key = "sub_header", - name = "-- Resource Multipliers", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "multiplier_resourceincome", - name = "Overall Resource Income", - desc = "(Range 0.1 - 10). Stacks up with the three options below.", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_metalextraction", - name = "Metal Extraction ", - desc = "(Range 0.1 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_energyconversion", - name = "Energy Conversion Efficiency", - desc = "(Range 0.1 - 2). lower means you get less metal per energy converted", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 2, - step = 0.1, - }, - - { - key = "multiplier_energyproduction", - name = "Energy Production", - desc = "(Range 0.1 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "sub_header", - section = "options_cheats", - type = "separator", - }, - - { - key = "cheatsdescription7", - name = "-- Unit Parameter Multipliers", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "multiplier_maxvelocity", - name = "Unit Max Velocity", - desc = "(Range 0.1 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_turnrate", - name = "Unit Turn Rate", - desc = "(Range 0.1 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_builddistance", - name = "Build Range", - desc = "(Range 0.5 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.5, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_buildpower", - name = "Build Power", - desc = "(Range 0.1 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_losrange", - name = "Vision Range", - desc = "(Range 0.5 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.5, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_radarrange", - name = "Radar And Sonar Range", - desc = "(Range 0.5 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.5, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_weaponrange", - name = "Weapon Range", - desc = "(Range 0.5 - 10).", - type = "number", - section = "options_cheats", - def = 1, - min = 0.5, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_weapondamage", - name = "Weapon Damage", - desc = "(Range 0.1 - 10). Also affects unit death explosions.", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "multiplier_shieldpower", - name = "Shield Power", - desc = "(Range 0.1 - 10)", - type = "number", - section = "options_cheats", - def = 1, - min = 0.1, - max = 10, - step = 0.1, - }, - - { - key = "sub_header", - section = "options_cheats", - type = "separator", - }, - - { - key = "cheatsdescription7", - name = "-- Other", - desc = "", - section = "options_cheats", - type = "subheader", - def = true, - }, - - { - key = "experimentalshields", - name = "Shield Type Override", - desc = "Shield Type Override", - type = "list", - section = "options_cheats", - def = "unchanged", - hidden = true, - items = { - { key = "unchanged", name = "Unchanged", desc = "Unchanged" }, - { key = "absorbeverything", name = "Absorb Everything", desc = "Shields absorb everything" }, - { key = "bounceplasma", name = "Deflect Plasma", desc = "Shields deflect plasma only" }, - { key = "bounceeverything", name = "Deflect Everything", desc = "Shields deflect everything" }, - } - }, - - { - key = "tweakunits", - name = "Tweak Units", - desc = "For advanced users!!! A base64 encoded lua table of unit parameters to change.", - hint = "Input must be base64", - section = "options_cheats", - type = "string", - def = "", - }, - - { - key = "tweakdefs", - name = "Tweak Defs", - desc = "For advanced users!!! A base64 encoded snippet of code that modifies game definitions.", - hint = "Input must be base64", - section = "options_cheats", - type = "string", - def = "", - }, - - { - key = "forceallunits", - name = "Force Load All Units (Dev/Modding)", - desc = "Load all UnitDefs even if ais or options for them aren't enabled", + section = "dev", + type = "number", + def = 0, + min = 0, + max = 16777215, -- math hard, 24 bit limitish? + step = 1, + }, + + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Map Metadata options + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- + -- The modoptions below are intended to be set automatically by lobby/spads based on the selected + -- map name. They are used for a dynamic map configuration where the configruation values are not + -- tied to either game version or reside inside of the map file, allowing for independent distribution + -- from the maps metadata source of truth: https://github.com/beyond-all-reason/maps-metadata + { + key = "mapmetadata", + name = "MapMetadata", + desc = "mapmetadata tab that should be hidden by chobby, which would have ideally been achieved by just not listing it and the following options here in the first place, but then SPADS refuses to set the modoption", + hidden = true, + type = "section", + }, + { + key = "sub_header", + name = "Hidden map metadata options that are supposed to be set automatically by lobby/spads based on the map name.", + desc = "", + section = "mapmetadata", + type = "subheader", + hidden = true, + def = true, + }, + { + key = "mapmetadata_startpos", + name = "Map Metadata: StartPos", + desc = "StartPos configuration. Format is: base64url(zlib(json))", + hidden = true, + section = "mapmetadata", + type = "string", + def = "", + }, + { + key = "mapmetadata_startboxes_set", + name = "Map Metadata: Startboxes Set", + desc = "Per-team-count startbox arrangements (rect or polygon). Format is: base64url(zlib(json))", + hidden = true, + section = "mapmetadata", + type = "string", + def = "", + }, + { + key = "mapmetadata_startbox_override", + name = "Map Metadata: Startbox Override", + desc = "Custom startbox arrangement that overrides the set when its team count matches. Format is: base64url(zlib(json))", + hidden = true, + section = "mapmetadata", + type = "string", + def = "", + }, + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + -- Cheats + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + key = "options_cheats", + name = "Cheats", + desc = "Options that alter the game balance in unintended way, Use at your own risk.", + type = "section", + weight = -1, + }, + + { + key = "sub_header", + name = "Warning: changing these options will alter the intended game experience and may have bad results. Proceed at your own risk!", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + name = "When any of these options are changed, there is no guarantee they will work properly, especially when combined.", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "sub_header", + section = "options_cheats", + type = "separator", + }, + + { + key = "sub_header", + name = "-- AI Cheats", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "dynamiccheats", + name = "Dynamic Cheats", + desc = "Cheats marked as [Dynamic] react to the game state and are suspended when the opposition is losing", + type = "bool", + def = true, section = "options_cheats", - type = "bool", - def = false, }, - { - key = "holiday_events", - name = "Enable Holiday Events", - desc = "", + { + key = "nowasting", + name = "No Resource Wasting", + desc = "[Dynamic] Increases Buildpower for the affected team's builders and factories to prevent resource", + type = "list", + def = "default", + section = "options_cheats", + items = { + { key = "default", name = "Default", desc = "Disabled, unless other features use it" }, + { key = "disabled", name = "Disabled", desc = "Disabled" }, + { key = "ai", name = "AI Only", desc = "All AI except Scavengers and Raptors" }, + { key = "all", name = "All", desc = "AI and Player Teams both excluding Scavengers and Raptors" }, + }, + }, + + { + key = "allow_enemy_ai_spawn_placement", + name = "Allow Hostile AI Spawn Placement", + desc = "When enabled, allows enemy allyteams to view and place enemy AI start positions during the pregame", + type = "bool", + def = false, + section = "options_cheats", + }, + + { + key = "sub_header", + section = "options_cheats", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Starting Resources", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "startmetal", + name = "Starting Metal", + desc = "(Range 0 - 10 000). Determines amount of metal and metal storage that each player will start with", + type = "number", + section = "options_cheats", + def = 1000, + min = 0, + max = 10000, + step = 1, + }, + + { + key = "startmetalstorage", + name = "Starting Metal Storage", + desc = "(Range 1000 - 20 000). Only works if it's higher than Starting metal. Determines amount of metal and metal storage that each player will start with", + type = "number", + section = "options_cheats", + def = 1000, + min = 1000, + max = 20000, + step = 1, + }, + + { + key = "startenergy", + name = "Starting Energy", + desc = "(Range 0 - 10 000). Determines amount of energy and energy storage that each player will start with", + type = "number", + section = "options_cheats", + def = 1000, + min = 0, + max = 10000, + step = 1, + }, + + { + key = "startenergystorage", + name = "Starting Energy Storage", + desc = "(Range 1000 - 20 000). Only works if it's higher than Starting energy. Determines amount of energy and energy storage that each player will start with", + type = "number", + section = "options_cheats", + def = 1000, + min = 1000, + max = 20000, + step = 1, + }, + + { + key = "bonusstartresourcemultiplier", + name = "Apply Bonus to Starting Resources", + desc = "If enabled, multiplies each players starting resources with their bonus.", + type = "bool", + section = "options_cheats", + def = false, + }, + + { + key = "sub_header", + section = "options_cheats", + type = "separator", + }, + + { + key = "sub_header", + name = "-- Resource Multipliers", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "multiplier_resourceincome", + name = "Overall Resource Income", + desc = "(Range 0.1 - 10). Stacks up with the three options below.", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_metalextraction", + name = "Metal Extraction ", + desc = "(Range 0.1 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_energyconversion", + name = "Energy Conversion Efficiency", + desc = "(Range 0.1 - 2). lower means you get less metal per energy converted", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 2, + step = 0.1, + }, + + { + key = "multiplier_energyproduction", + name = "Energy Production", + desc = "(Range 0.1 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "sub_header", + section = "options_cheats", + type = "separator", + }, + + { + key = "cheatsdescription7", + name = "-- Unit Parameter Multipliers", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "multiplier_maxvelocity", + name = "Unit Max Velocity", + desc = "(Range 0.1 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_turnrate", + name = "Unit Turn Rate", + desc = "(Range 0.1 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_builddistance", + name = "Build Range", + desc = "(Range 0.5 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.5, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_buildpower", + name = "Build Power", + desc = "(Range 0.1 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_losrange", + name = "Vision Range", + desc = "(Range 0.5 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.5, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_radarrange", + name = "Radar And Sonar Range", + desc = "(Range 0.5 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.5, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_weaponrange", + name = "Weapon Range", + desc = "(Range 0.5 - 10).", + type = "number", + section = "options_cheats", + def = 1, + min = 0.5, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_weapondamage", + name = "Weapon Damage", + desc = "(Range 0.1 - 10). Also affects unit death explosions.", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "multiplier_shieldpower", + name = "Shield Power", + desc = "(Range 0.1 - 10)", + type = "number", + section = "options_cheats", + def = 1, + min = 0.1, + max = 10, + step = 0.1, + }, + + { + key = "sub_header", + section = "options_cheats", + type = "separator", + }, + + { + key = "cheatsdescription7", + name = "-- Other", + desc = "", + section = "options_cheats", + type = "subheader", + def = true, + }, + + { + key = "experimentalshields", + name = "Shield Type Override", + desc = "Shield Type Override", + type = "list", + section = "options_cheats", + def = "unchanged", + hidden = true, + items = { + { key = "unchanged", name = "Unchanged", desc = "Unchanged" }, + { key = "absorbeverything", name = "Absorb Everything", desc = "Shields absorb everything" }, + { key = "bounceplasma", name = "Deflect Plasma", desc = "Shields deflect plasma only" }, + { key = "bounceeverything", name = "Deflect Everything", desc = "Shields deflect everything" }, + }, + }, + + { + key = "tweakunits", + name = "Tweak Units", + desc = "For advanced users!!! A base64 encoded lua table of unit parameters to change.", + hint = "Input must be base64", + section = "options_cheats", + type = "string", + def = "", + }, + + { + key = "tweakdefs", + name = "Tweak Defs", + desc = "For advanced users!!! A base64 encoded snippet of code that modifies game definitions.", + hint = "Input must be base64", + section = "options_cheats", + type = "string", + def = "", + }, + + { + key = "forceallunits", + name = "Force Load All Units (Dev/Modding)", + desc = "Load all UnitDefs even if ais or options for them aren't enabled", section = "options_cheats", - type = "bool", - def = true, - hidden = true, + type = "bool", + def = false, }, + { + key = "holiday_events", + name = "Enable Holiday Events", + desc = "", + section = "options_cheats", + type = "bool", + def = true, + hidden = true, + }, } - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -- End Options - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +-- End Options +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- for i = 1, 9 do - options[#options + 1] = { - key = "tweakunits" .. i, - name = "Tweak Units " .. i, - desc = "A base64 encoded lua table of unit parameters to change.", - section = "options_extra", - type = "string", - def = "", - hidden = true, - } + options[#options + 1] = { + key = "tweakunits" .. i, + name = "Tweak Units " .. i, + desc = "A base64 encoded lua table of unit parameters to change.", + section = "options_extra", + type = "string", + def = "", + hidden = true, + } end for i = 1, 9 do - options[#options + 1] = { - key = "tweakdefs" .. i, - name = "Tweak Defs " .. i, - desc = "A base64 encoded snippet of code that modifies game definitions.", - section = "options_extra", - type = "string", - def = "", - hidden = true, - } + options[#options + 1] = { + key = "tweakdefs" .. i, + name = "Tweak Defs " .. i, + desc = "A base64 encoded snippet of code that modifies game definitions.", + section = "options_extra", + type = "string", + def = "", + hidden = true, + } end return options diff --git a/modules/commands.lua b/modules/commands.lua index c18a884f75a..d8a9ee52798 100644 --- a/modules/commands.lua +++ b/modules/commands.lua @@ -45,20 +45,20 @@ local function unpackInsertParams(cmdParams) for i = 1, n - 3 do cmdParams[i] = cmdParams[i + 3] end - cmdParams[n ] = nil + cmdParams[n] = nil cmdParams[n - 1] = nil cmdParams[n - 2] = nil local band = bit_and local innerOptions = { - coded = innerOptionBits, + coded = innerOptionBits, internal = 0 ~= band(innerOptionBits, OPT_INTERNAL), - alt = 0 ~= band(innerOptionBits, OPT_ALT), - ctrl = 0 ~= band(innerOptionBits, OPT_CTRL), - meta = 0 ~= band(innerOptionBits, OPT_META), - right = 0 ~= band(innerOptionBits, OPT_RIGHT), - shift = 0 ~= band(innerOptionBits, OPT_SHIFT), + alt = 0 ~= band(innerOptionBits, OPT_ALT), + ctrl = 0 ~= band(innerOptionBits, OPT_CTRL), + meta = 0 ~= band(innerOptionBits, OPT_META), + right = 0 ~= band(innerOptionBits, OPT_RIGHT), + shift = 0 ~= band(innerOptionBits, OPT_SHIFT), } ---@diagnostic disable-next-line:return-type-mismatch -- OK: CMD/number @@ -152,10 +152,10 @@ end -- Export module --------------------------------------------------------------- return { - UnpackInsertParams = unpackInsertParams, + UnpackInsertParams = unpackInsertParams, GiveInsertOrderToUnit = giveInsertOrderToUnit, - ReissueOrder = reissueOrder, - IsQueueingCommand = isQueueingCommand, - IsQueuingUnitCommand = isQueuingUnitCommand, - IsEnqueuedFirst = isEnqueuedFirst, + ReissueOrder = reissueOrder, + IsQueueingCommand = isQueueingCommand, + IsQueuingUnitCommand = isQueuingUnitCommand, + IsEnqueuedFirst = isEnqueuedFirst, } diff --git a/modules/customcommands.lua b/modules/customcommands.lua index 653cbf36421..f730f9c0474 100644 --- a/modules/customcommands.lua +++ b/modules/customcommands.lua @@ -50,24 +50,23 @@ local globalCmdDeprecatedShown = false local importCommandsToObject = function(object) if not globalCmdDeprecatedShown and not object.gadgetHandler then - local msg = 'Should not use customcmds.h.lua or importCommandsToObject. Use the CMD table directly, or read modules/customcommands.lua for more information.' - Spring.Log('CMD', LOG.DEPRECATED, msg) + local msg = "Should not use customcmds.h.lua or importCommandsToObject. Use the CMD table directly, or read modules/customcommands.lua for more information." + Spring.Log("CMD", LOG.DEPRECATED, msg) globalCmdDeprecatedShown = true end for code, cmdID in pairs(gameCommands) do - if type(code) == 'string' then - object['CMD_' .. code] = cmdID + if type(code) == "string" then + object["CMD_" .. code] = cmdID end end - end for code, cmdID in pairs(gameCommands) do if CMD[cmdID] then - Spring.Log('CMD', LOG.ERROR, 'Duplicate command id: ' .. code .. ' ' .. tostring(cmdID) .. '!') + Spring.Log("CMD", LOG.ERROR, "Duplicate command id: " .. code .. " " .. tostring(cmdID) .. "!") end if CMD[code] then - Spring.Log('CMD', LOG.ERROR, 'Duplicate command code: ' .. code .. ' ' .. tostring(cmdID) .. '!') + Spring.Log("CMD", LOG.ERROR, "Duplicate command code: " .. code .. " " .. tostring(cmdID) .. "!") end gameCommands[cmdID] = code end @@ -80,4 +79,4 @@ return { GameCMD = gameCommands, ImportCommandsToObject = importCommandsToObject, GetCommandCode = getCommandCode, - } +} diff --git a/modules/graphics/LuaShader.lua b/modules/graphics/LuaShader.lua index be21b450242..88c050b2cba 100644 --- a/modules/graphics/LuaShader.lua +++ b/modules/graphics/LuaShader.lua @@ -1,6 +1,6 @@ -local UNIFORM_TYPE_MIXED = 0 -- includes arrays; float or int -local UNIFORM_TYPE_INT = 1 -- includes arrays -local UNIFORM_TYPE_FLOAT = 2 -- includes arrays +local UNIFORM_TYPE_MIXED = 0 -- includes arrays; float or int +local UNIFORM_TYPE_INT = 1 -- includes arrays +local UNIFORM_TYPE_FLOAT = 2 -- includes arrays local UNIFORM_TYPE_FLOAT_MATRIX = 3 local glGetUniformLocation = gl.GetUniformLocation @@ -21,8 +21,7 @@ local function new(class, shaderParams, shaderName, logEntries) logEntriesSanitized = 1 end - return setmetatable( - { + return setmetatable({ shaderName = shaderName or "Unnamed Shader", shaderParams = shaderParams or {}, logEntries = logEntriesSanitized, @@ -36,10 +35,7 @@ local function new(class, shaderParams, shaderName, logEntries) end local function IsGeometryShaderSupported() - local hasGeometryShaderExtension = - gl.HasExtension("GL_ARB_geometry_shader4") or - gl.HasExtension("GL_EXT_geometry_shader4") or - gl.HasExtension("GL_OES_geometry_shader") + local hasGeometryShaderExtension = gl.HasExtension("GL_ARB_geometry_shader4") or gl.HasExtension("GL_EXT_geometry_shader4") or gl.HasExtension("GL_OES_geometry_shader") return hasGeometryShaderExtension and (gl.SetShaderParameter ~= nil or gl.SetGeometryShaderParameter ~= nil) end @@ -60,7 +56,7 @@ local function GetAdvShadingActive() end local function GetEngineUniformBufferDefs() - local eubs = [[ + local eubs = [[ layout(std140, binding = 0) uniform UniformMatrixBuffer { mat4 screenView; mat4 screenProj; @@ -275,13 +271,11 @@ vec3 rgb2hsv(vec3 c){ ]] - local waterAbsorbColorR, waterAbsorbColorG, waterAbsorbColorB = gl.GetWaterRendering("absorb") local waterMinColorR, waterMinColorG, waterMinColorB = gl.GetWaterRendering("minColor") local waterBaseColorR, waterBaseColorG, waterBaseColorB = gl.GetWaterRendering("baseColor") - local waterUniforms = -[[ + local waterUniforms = [[ #define WATERABSORBCOLOR vec3(%f,%f,%f) #define WATERMINCOLOR vec3(%f,%f,%f) #define WATERBASECOLOR vec3(%f,%f,%f) @@ -299,17 +293,13 @@ vec4 waterBlend(float fragmentheight){ return waterBlendResult; } ]] - waterUniforms = string.format(waterUniforms, - waterAbsorbColorR, waterAbsorbColorG, waterAbsorbColorB, - waterMinColorR, waterMinColorG, waterMinColorB, - waterBaseColorR, waterBaseColorG, waterBaseColorB - ) + waterUniforms = string.format(waterUniforms, waterAbsorbColorR, waterAbsorbColorG, waterAbsorbColorB, waterMinColorR, waterMinColorG, waterMinColorB, waterBaseColorR, waterBaseColorG, waterBaseColorB) - return eubs .. waterUniforms + return eubs .. waterUniforms end local function GetQuaternionDefs() -- For replacing //__QUATERNIONDEFS__ with the quaternion definitions - return [[ + return [[ // Quaternion math functions struct Transform { vec4 quat; @@ -500,17 +490,18 @@ Transform GetStaticPieceModelTransform(uint baseIndex, uint pieceID) end local function CreateShaderDefinesString(args) -- Args is a table of stuff that are the shader parameters - local defines = {} - for k, v in pairs (args) do - defines[#defines + 1] = string.format("#define %s %s\n", tostring(k), tostring(v)) - end - return table.concat(defines) + local defines = {} + for k, v in pairs(args) do + defines[#defines + 1] = string.format("#define %s %s\n", tostring(k), tostring(v)) + end + return table.concat(defines) end - local LuaShader = setmetatable({}, { - __call = function(self, ...) return new(self, ...) end, - }) + __call = function(self, ...) + return new(self, ...) + end, +}) LuaShader.__index = LuaShader LuaShader.isGeometryShaderSupported = IsGeometryShaderSupported() LuaShader.isTesselationShaderSupported = IsTesselationShaderSupported() @@ -520,19 +511,14 @@ LuaShader.GetEngineUniformBufferDefs = GetEngineUniformBufferDefs LuaShader.CreateShaderDefinesString = CreateShaderDefinesString LuaShader.GetQuaternionDefs = GetQuaternionDefs - local function CheckShaderUpdates(shadersourcecache, delaytime) -- todo: extract shaderconfig - if shadersourcecache.forceupdate or shadersourcecache.lastshaderupdate == nil or - Spring.DiffTimers(Spring.GetTimer(), shadersourcecache.lastshaderupdate) > (delaytime or 0.5) then + if shadersourcecache.forceupdate or shadersourcecache.lastshaderupdate == nil or Spring.DiffTimers(Spring.GetTimer(), shadersourcecache.lastshaderupdate) > (delaytime or 0.5) then shadersourcecache.lastshaderupdate = Spring.GetTimer() local vsSrcNew = (shadersourcecache.vssrcpath and VFS.LoadFile(shadersourcecache.vssrcpath)) or shadersourcecache.vsSrc local fsSrcNew = (shadersourcecache.fssrcpath and VFS.LoadFile(shadersourcecache.fssrcpath)) or shadersourcecache.fsSrc local gsSrcNew = (shadersourcecache.gssrcpath and VFS.LoadFile(shadersourcecache.gssrcpath)) or shadersourcecache.gsSrc - if vsSrcNew == shadersourcecache.vsSrc and - fsSrcNew == shadersourcecache.fsSrc and - gsSrcNew == shadersourcecache.gsSrc and - not shadersourcecache.forceupdate then + if vsSrcNew == shadersourcecache.vsSrc and fsSrcNew == shadersourcecache.fsSrc and gsSrcNew == shadersourcecache.gsSrc and not shadersourcecache.forceupdate then --Spring.Echo("No change in shaders") return nil else @@ -546,7 +532,7 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) local shaderDefines = LuaShader.CreateShaderDefinesString(shadersourcecache.shaderConfig) local quaternionDefines = LuaShader.GetQuaternionDefs() - local printfpattern = "^[^/]*printf%s*%(%s*([%w_%.]+)%s*%)" + local printfpattern = "^[^/]*printf%s*%(%s*([%w_%.]+)%s*%)" local printf = nil if not fsSrcNew then Spring.Echo("Warning: No fragment shader source found for", shadersourcecache.shaderName) @@ -564,21 +550,21 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) -- Figure out wether the glsl variable is a float, vec2-4 local glslvarcount = 1 -- default is 1 local dotposition = string.find(glslvariable, "%.") - local swizzle = 'x' + local swizzle = "x" if dotposition then - swizzle = string.sub(glslvariable, dotposition+1) + swizzle = string.sub(glslvariable, dotposition + 1) glslvarcount = string.len(swizzle) end - if glslvarcount>4 then + if glslvarcount > 4 then glslvarcount = 4 end - if not printf then printf = {} end + if not printf then + printf = {} + end printf["vars"] = printf["vars"] or {} - local vardata = {name = glslvariable, count = glslvarcount, line = i, index = #printf["vars"], swizzle = swizzle, shaderstage = 'f'} + local vardata = { name = glslvariable, count = glslvarcount, line = i, index = #printf["vars"], swizzle = swizzle, shaderstage = "f" } table.insert(printf["vars"], vardata) - local replacementstring = string.format('if (all(lessThan(abs(mouseScreenPos.xy- (gl_FragCoord.xy + vec2(0.5, -1.5))),vec2(0.25) ))) { printfData[%i].%s = %s;} //printfData[INDEX] = vertexPos.xyzw;', - vardata.index, string.sub('xyzw', 1, vardata.count), vardata.name - ) + local replacementstring = string.format("if (all(lessThan(abs(mouseScreenPos.xy- (gl_FragCoord.xy + vec2(0.5, -1.5))),vec2(0.25) ))) { printfData[%i].%s = %s;} //printfData[INDEX] = vertexPos.xyzw;", vardata.index, string.sub("xyzw", 1, vardata.count), vardata.name) Spring.Echo(string.format("Replacing f:%d %s", i, line)) fsSrcNewLines[i] = replacementstring end @@ -587,13 +573,15 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) -- If any substitutions were made, reassemble the shader source if printf then -- Define the shader storage buffer object, with at most SSBOSize entries - printf.SSBOSize = math.max(#printf['vars'], 16) + printf.SSBOSize = math.max(#printf["vars"], 16) --Spring.Echo("SSBOSize", printf.SSBOSize) printf.SSBO = gl.GetVBO(GL.SHADER_STORAGE_BUFFER) - printf.SSBO:Define(printf.SSBOSize, {{id = 0, name = "printfData", size = 4}}) + printf.SSBO:Define(printf.SSBOSize, { { id = 0, name = "printfData", size = 4 } }) local initZeros = {} - for i=1, 4 * printf.SSBOSize do initZeros[i] = 0 end - printf.SSBO:Upload(initZeros)--, nil, 0) + for i = 1, 4 * printf.SSBOSize do + initZeros[i] = 0 + end + printf.SSBO:Upload(initZeros) --, nil, 0) printf.SSBODefinition = [[ layout (std430, binding = 7) buffer printfBuffer { @@ -608,7 +596,7 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) if line ~= "#version 430 core" then Spring.Echo("Replacing shader version", line, "with #version 430 core") fsSrcNewLines[i] = "" - table.insert(fsSrcNewLines,1, "#version 430 core\n") + table.insert(fsSrcNewLines, 1, "#version 430 core\n") break end end @@ -616,9 +604,7 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) -- Add required extensions - local ssboextensions = {'#extension GL_ARB_shading_language_420pack: require', - '#extension GL_ARB_uniform_buffer_object : require', - '#extension GL_ARB_shader_storage_buffer_object : require'} + local ssboextensions = { "#extension GL_ARB_shading_language_420pack: require", "#extension GL_ARB_uniform_buffer_object : require", "#extension GL_ARB_shader_storage_buffer_object : require" } for j, ext in ipairs(ssboextensions) do local found = false for i, line in ipairs(fsSrcNewLines) do @@ -633,7 +619,7 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) end -- Reassemble the shader source by joining on newlines: - fsSrcNew = table.concat(fsSrcNewLines, '\n') + fsSrcNew = table.concat(fsSrcNewLines, "\n") --Spring.Echo(fsSrcNew) end if vsSrcNew then @@ -656,16 +642,13 @@ local function CheckShaderUpdates(shadersourcecache, delaytime) fsSrcNew = fsSrcNew:gsub("//__QUATERNIONDEFS__", quaternionDefines) shadersourcecache.fsSrcComplete = fsSrcNew -- the complete subbed cache should be kept as its needed to decipher lines post compilation errors end - local reinitshader = LuaShader( - { + local reinitshader = LuaShader({ vertex = vsSrcNew, fragment = fsSrcNew, geometry = gsSrcNew, uniformInt = shadersourcecache.uniformInt, uniformFloat = shadersourcecache.uniformFloat, - }, - shadersourcecache.shaderName - ) + }, shadersourcecache.shaderName) local shaderCompiled = reinitshader:Initialize() if not shadersourcecache.silent then Spring.Echo(shadersourcecache.shaderName, " recompiled in ", Spring.DiffTimers(Spring.GetTimer(), compilestarttime, true), "ms at", Spring.GetGameFrame(), "success", shaderCompiled or false) @@ -684,15 +667,16 @@ end LuaShader.CheckShaderUpdates = CheckShaderUpdates - local function lines(str) local t = {} - local function helper(line) table.insert(t, line) return "" end + local function helper(line) + table.insert(t, line) + return "" + end helper((str:gsub("(.-)\r?\n", helper))) return t end - function LuaShader:CreateLineTable() --[[ -- self.shaderParams == @@ -710,7 +694,8 @@ function LuaShader:CreateLineTable() [ geoOutputVerts = number maxVerts,] [ definitions = "string of shader #defines", ] }) - ]]-- + ]] + -- local numtoline = {} @@ -721,7 +706,7 @@ function LuaShader:CreateLineTable() -- Spring.Echo(k) --end - for _, shadertype in pairs({'vertex', 'tcs', 'tes', 'geometry', 'fragment', 'compute'}) do + for _, shadertype in pairs({ "vertex", "tcs", "tes", "geometry", "fragment", "compute" }) do if self.shaderParams[shadertype] ~= nil then local shaderLines = (self.shaderParams.definitions or "") .. self.shaderParams[shadertype] local currentlinecount = 0 @@ -734,7 +719,6 @@ function LuaShader:CreateLineTable() currentlinecount = defline end else - currentlinecount = currentlinecount + 1 end end @@ -745,15 +729,15 @@ end local function translateLines(alllines, errorcode) if string.len(errorcode) < 3 then - return ("The shader compilation error code was very short. This likely means a Linker error, check the [in] [out] blocks linking VS/GS/FS shaders to each other to make sure the structs match") + return "The shader compilation error code was very short. This likely means a Linker error, check the [in] [out] blocks linking VS/GS/FS shaders to each other to make sure the structs match" end local result = "" - for _,line in pairs(lines(errorcode)) do + for _, line in pairs(lines(errorcode)) do local pstart = line:find("(", nil, true) local pend = line:find(")", nil, true) local found = false if pstart and pend then - local lineno = line:sub(pstart +1,pend-1) + local lineno = line:sub(pstart + 1, pend - 1) --Spring.Echo(lineno) lineno = tonumber(lineno) --Spring.Echo(lineno, alllines[lineno]) @@ -763,14 +747,12 @@ local function translateLines(alllines, errorcode) end end if found == false then - result = result .. line ..'\n' + result = result .. line .. "\n" end end return result end - - -----------------============ Warnings & Error Gandling ============----------------- function LuaShader:OutputLogEntry(text, isError) local message @@ -785,15 +767,14 @@ function LuaShader:OutputLogEntry(text, isError) Spring.Echo(translateLines(linetable, text)) end - if self.logHash[message] == nil then - -- self.logHash[message] = 0 + -- self.logHash[message] = 0 end if false and self.logHash[message] <= self.logEntries then local newCnt = self.logHash[message] + 1 self.logHash[message] = newCnt - if (newCnt == self.logEntries) then + if newCnt == self.logEntries then message = message .. string.format("\nSupressing further %s of the same kind", warnErr) end Spring.Echo(message) @@ -810,10 +791,10 @@ end -----------------============ Handle Ghetto Include<> ==============----------------- local includeRegexps = { - '.-#include <(.-)>.-', - '.-#include \"(.-)\".-', - '.-#pragma(%s+)include <(.-)>.-', - '.-#pragma(%s+)include \"(.-)\".-', + ".-#include <(.-)>.-", + '.-#include "(.-)".-', + ".-#pragma(%s+)include <(.-)>.-", + '.-#pragma(%s+)include "(.-)".-', } function LuaShader:HandleIncludes(shaderCode, shaderName) @@ -833,10 +814,10 @@ function LuaShader:HandleIncludes(shaderCode, shaderName) Spring.Echo(shaderName, incFile) if incFile then - shaderCode = string.gsub(shaderCode, regEx, '', 1) + shaderCode = string.gsub(shaderCode, regEx, "", 1) table.insert(incFiles, incFile) end - until (incFile == nil) + until incFile == nil local t2 = Spring.GetTimer() Spring.Echo(Spring.DiffTimers(t2, t1, true)) @@ -866,8 +847,8 @@ function LuaShader:Compile(suppresswarnings) return false end --- LuaShader:HandleIncludes is too slow. Figure out faster way. ---[[ + -- LuaShader:HandleIncludes is too slow. Figure out faster way. + --[[ for _, shaderType in ipairs({"vertex", "tcs", "tes", "geometry", "fragment"}) do if self.shaderParams[shaderType] then local newShaderCode = LuaShader:HandleIncludes(self.shaderParams[shaderType], self.shaderName) @@ -876,7 +857,8 @@ function LuaShader:Compile(suppresswarnings) end end end -]]-- +]] + -- local shaderObj, gl_program_id = gl.CreateShader(self.shaderParams) self.shaderObj = shaderObj @@ -912,15 +894,14 @@ function LuaShader:Compile(suppresswarnings) -- Note that the function call overhead to the LuaShader:SetUniformFloat is about 500ns -- With this, a direct gl.Uniform call, this goes down to 100ns self.uniformLocations = {} - for _, uniformGeneric in ipairs({self.shaderParams.uniformFloat or {}, self.shaderParams.uniformInt or {} }) do + for _, uniformGeneric in ipairs({ self.shaderParams.uniformFloat or {}, self.shaderParams.uniformInt or {} }) do for uniName, defaultvalue in pairs(uniformGeneric) do local location = glGetUniformLocation(shaderObj, uniName) if location then self.uniformLocations[uniName] = location else - Spring.Echo(string.format("Notice from shader %s: Could not find location of uniform name: %s", "dunno", uniName )) + Spring.Echo(string.format("Notice from shader %s: Could not find location of uniform name: %s", "dunno", uniName)) end - end end @@ -954,7 +935,9 @@ function LuaShader:Activate() -- bind the printf SSBO if present if self.printf then local bindingIndex = self.printf.SSBO:BindBufferRange(7) - if bindingIndex <= 0 then Spring.Echo("Failed to bind printfData SSBO for shader", self.shaderName) end + if bindingIndex <= 0 then + Spring.Echo("Failed to bind printfData SSBO for shader", self.shaderName) + end end self.active = true @@ -977,7 +960,6 @@ function LuaShader:SetUnknownUniformIgnore(flag) self.ignoreUnkUniform = flag end - function LuaShader:ActivateWith(func, ...) if self.shaderObj ~= nil then self.active = true @@ -992,7 +974,9 @@ end function LuaShader:Deactivate() self.active = false glUseShader(0) - if gldebugannotations then gl.PopDebugGroup() end + if gldebugannotations then + gl.PopDebugGroup() + end --Spring.Echo("LuaShader:Deactivate()") if self.printf then @@ -1002,7 +986,7 @@ function LuaShader:Deactivate() --Spring.Echo(self.printf.bufferData[1],self.printf.bufferData[2],self.printf.bufferData[3],self.printf.bufferData[4]) -- Do NAN checks on bufferData array and replace with -666 if NAN: for i = 1, #self.printf.bufferData do - if type(self.printf.bufferData[i]) == 'number' and (self.printf.bufferData[i] ~= self.printf.bufferData[i]) then -- check for NAN + if type(self.printf.bufferData[i]) == "number" and (self.printf.bufferData[i] ~= self.printf.bufferData[i]) then -- check for NAN self.printf.bufferData[i] = -666 end end @@ -1018,15 +1002,15 @@ function LuaShader:Deactivate() xoffset = xoffset or 0 yoffset = yoffset or 0 - if type(sometimesself) == 'table' then + if type(sometimesself) == "table" then xoffset = xoffset or 0 yoffset = yoffset or 0 - elseif type(sometimesself) == 'number' then + elseif type(sometimesself) == "number" then yoffset = xoffset xoffset = sometimesself end - local mx,my = Spring.GetMouseState() + local mx, my = Spring.GetMouseState() mx = mx + xoffset my = my - 32 + yoffset @@ -1049,10 +1033,12 @@ function LuaShader:Deactivate() my = my - fontSize local vsx, vsy = Spring.GetViewGeometry() - local alignment = '' - if mx > (vsx - 400) then alignment = 'r' end + local alignment = "" + if mx > (vsx - 400) then + alignment = "r" + end --Spring.Echo(my,vsy) - font3:Print(message, math.floor(mx), math.floor(my), fontSize,alignment .."o" ) + font3:Print(message, math.floor(mx), math.floor(my), fontSize, alignment .. "o") end gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) @@ -1065,10 +1051,8 @@ function LuaShader:Deactivate() end end - -----------------============ End of general LuaShader methods ============----------------- - -----------------============ Friend LuaShader functions ============----------------- local function getUniformImpl(self, name) local uniform = self.uniforms[name] @@ -1151,8 +1135,6 @@ local function isUpdateRequiredNoTable(uniform, u1, u2, u3, u4) end -----------------============ End of friend LuaShader functions ============----------------- - - -----------------============ LuaShader uniform manipulation functions ============----------------- -- TODO: do it safely with types, len, size check @@ -1200,9 +1182,8 @@ end LuaShader.SetUniformFloat = LuaShader.SetUniform LuaShader.SetUniformFloatAlways = LuaShader.SetUniformAlways - --INTEGER UNIFORMS -local function setUniformIntAlwaysImpl(uniform, u1, u2, u3, u4) +local function setUniformIntAlwaysImpl(uniform, u1, u2, u3, u4) if u4 ~= nil then glUniformInt(uniform.location, u1, u2, u3, u4) elseif u3 ~= nil then @@ -1215,12 +1196,12 @@ local function setUniformIntAlwaysImpl(uniform, u1, u2, u3, u4) return true --currently there is no way to check if uniform is set or not :( end -function LuaShader:SetUniformIntAlways(name, u1, u2, u3, u4) +function LuaShader:SetUniformIntAlways(name, u1, u2, u3, u4) local uniform = getUniform(self, name) if not uniform then return false end - return setUniformIntAlwaysImpl(uniform, u1, u2, u3, u4) + return setUniformIntAlwaysImpl(uniform, u1, u2, u3, u4) end local function setUniformIntImpl(uniform, u1, u2, u3, u4) @@ -1230,15 +1211,14 @@ local function setUniformIntImpl(uniform, u1, u2, u3, u4) return true end -function LuaShader:SetUniformInt(name, u1, u2, u3, u4) +function LuaShader:SetUniformInt(name, u1, u2, u3, u4) local uniform = getUniform(self, name) if not uniform then return false end - return setUniformIntImpl(uniform, u1, u2, u3, u4) + return setUniformIntImpl(uniform, u1, u2, u3, u4) end - --FLOAT ARRAY UNIFORMS local function setUniformFloatArrayAlwaysImpl(uniform, tbl) glUniformArray(uniform.location, UNIFORM_TYPE_FLOAT, tbl) @@ -1268,7 +1248,6 @@ function LuaShader:SetUniformFloatArray(name, tbl) return setUniformFloatArrayImpl(uniform, tbl) end - --INT ARRAY UNIFORMS local function setUniformIntArrayAlwaysImpl(uniform, tbl) glUniformArray(uniform.location, UNIFORM_TYPE_INT, tbl) @@ -1298,7 +1277,6 @@ function LuaShader:SetUniformIntArray(name, tbl) return setUniformIntArrayImpl(uniform, tbl) end - --MATRIX UNIFORMS local function setUniformMatrixAlwaysImpl(uniform, tbl) glUniformMatrix(uniform.location, unpack(tbl)) @@ -1310,7 +1288,7 @@ function LuaShader:SetUniformMatrixAlways(name, ...) if not uniform then return false end - return setUniformMatrixAlwaysImpl(uniform, {...}) + return setUniformMatrixAlwaysImpl(uniform, { ... }) end local function setUniformMatrixImpl(uniform, tbl) @@ -1325,7 +1303,7 @@ function LuaShader:SetUniformMatrix(name, ...) if not uniform then return false end - return setUniformMatrixImpl(uniform, {...}) + return setUniformMatrixImpl(uniform, { ... }) end -----------------============ End of LuaShader uniform manipulation functions ============----------------- diff --git a/modules/graphics/instancevboidtable.lua b/modules/graphics/instancevboidtable.lua index 95837adc9ab..629a65b9fb1 100644 --- a/modules/graphics/instancevboidtable.lua +++ b/modules/graphics/instancevboidtable.lua @@ -6,16 +6,20 @@ local function makeInstanceVBOTable(layout, maxElements, myName, objectTypeAttri -- objectType : must be ["unitID"|"unitDefID"|"featureID"|"featureDefID"] -- returns: nil | instanceTable - if maxElements == nil then maxElements = 64 end -- default size - if myName == nil then myName = "InstanceVBOTable" end - local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if newInstanceVBO == nil then Spring.Echo("makeInstanceVBOTable, cannot get VBO for", myName); return nil end - newInstanceVBO:Define( - maxElements, - layout - ) + if maxElements == nil then + maxElements = 64 + end -- default size + if myName == nil then + myName = "InstanceVBOTable" + end + local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if newInstanceVBO == nil then + Spring.Echo("makeInstanceVBOTable, cannot get VBO for", myName) + return nil + end + newInstanceVBO:Define(maxElements, layout) local instanceStep = 0 - for i,attribute in pairs(layout) do + for i, attribute in pairs(layout) do instanceStep = instanceStep + attribute.size end local instanceData = {} @@ -23,19 +27,19 @@ local function makeInstanceVBOTable(layout, maxElements, myName, objectTypeAttri instanceData[i] = 0 end local instanceTable = { - instanceVBO = newInstanceVBO, - instanceData = instanceData, - instanceStep = instanceStep, - usedElements = 0, - maxElements = maxElements, - myName = myName, - instanceIDtoIndex = {}, -- this maps each instance ID to where it is in the buffer, 1 based - indextoInstanceID = {}, -- this tells us what instanceID is located in any given pos - layout = layout, - dirty = false, - numVertices = 0, - primitiveType = GL.TRIANGLES, - debugZombies = true, + instanceVBO = newInstanceVBO, + instanceData = instanceData, + instanceStep = instanceStep, + usedElements = 0, + maxElements = maxElements, + myName = myName, + instanceIDtoIndex = {}, -- this maps each instance ID to where it is in the buffer, 1 based + indextoInstanceID = {}, -- this tells us what instanceID is located in any given pos + layout = layout, + dirty = false, + numVertices = 0, + primitiveType = GL.TRIANGLES, + debugZombies = true, } if objectTypeAttribID ~= nil then @@ -70,9 +74,15 @@ local function clearInstanceTable(iT) iT.usedElements = 0 iT.instanceIDtoIndex = {} iT.indextoInstanceID = {} - if iT.indextoUnitID then iT.indextoUnitID = {} end - if iT.indextoObjectType then iT.indextoObjectType = {} end - if iT.VAO then iT.VAO:ClearSubmission() end + if iT.indextoUnitID then + iT.indextoUnitID = {} + end + if iT.indextoObjectType then + iT.indextoObjectType = {} + end + if iT.VAO then + iT.VAO:ClearSubmission() + end end local function makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a vertex buffer to an instance buffer, and optionally, an index buffer if one is supplied. @@ -81,34 +91,36 @@ local function makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a ve --iT.indexVBO = indexVBO local newVAO = nil newVAO = gl.GetVAO() - if newVAO == nil then goodbye("Failed to create newVAO") end + if newVAO == nil then + goodbye("Failed to create newVAO") + end if vertexVBO == nil then -- the special case where are using 'vertices' as 'instances' - newVAO:AttachVertexBuffer(instanceVBO) + newVAO:AttachVertexBuffer(instanceVBO) else - newVAO:AttachVertexBuffer(vertexVBO) - newVAO:AttachInstanceBuffer(instanceVBO) + newVAO:AttachVertexBuffer(vertexVBO) + newVAO:AttachInstanceBuffer(instanceVBO) end if indexVBO then - newVAO:AttachIndexBuffer(indexVBO) + newVAO:AttachIndexBuffer(indexVBO) end return newVAO end --------------- DEBUG HELPERS -------------------------- local function comparetables(t1, t2, name) - for k,v in pairs(t1) do + for k, v in pairs(t1) do if t2[k] == nil then - Spring.Echo("Key ",k,"with value",v,"existing in t1 does not exist in t2 in ", name) + Spring.Echo("Key ", k, "with value", v, "existing in t1 does not exist in t2 in ", name) elseif t2[k] ~= v then - Spring.Echo("Value ",v,"for",k,"existing in t1 does not match value for t2",t2[k]," in ", name) + Spring.Echo("Value ", v, "for", k, "existing in t1 does not match value for t2", t2[k], " in ", name) end end - for k,v in pairs(t2) do + for k, v in pairs(t2) do if t1[k] == nil then - Spring.Echo("Key ",k,"with value",v,"existing in t2 does not exist in t1 in ", name) + Spring.Echo("Key ", k, "with value", v, "existing in t2 does not exist in t1 in ", name) elseif t1[k] ~= v then - Spring.Echo("Value ",v,"for",k,"existing in t2 does not match value for t1",t1[k]," in ", name) + Spring.Echo("Value ", v, "for", k, "existing in t2 does not match value for t1", t1[k], " in ", name) end end end @@ -117,19 +129,23 @@ local function dbgt(t, name) name = name or "" local gf = Spring.GetGameFrame() local count = 0 - local res = '' - for k,v in pairs(t) do - res = res .. tostring(k) .. ':' .. tostring(v) ..',' + local res = "" + for k, v in pairs(t) do + res = res .. tostring(k) .. ":" .. tostring(v) .. "," count = count + 1 end - Spring.Echo(tostring(gf).. " " ..name .. ' #' .. tostring(count) .. ' {'..res .. '}') + Spring.Echo(tostring(gf) .. " " .. name .. " #" .. tostring(count) .. " {" .. res .. "}") return res end local function counttable(t) local count = 0 - if type(t) ~= type({}) then return 0 end - for k, v in pairs(t) do count = count + 1 end + if type(t) ~= type({}) then + return 0 + end + for k, v in pairs(t) do + count = count + 1 + end return count end @@ -143,43 +159,45 @@ local function resizeInstanceVBOTable(iT) end Spring.Echo(tstr) end - ]]-- + ]] + -- -- iT: the InstanceVBOTable to double in size 'dynamically' resize the VBO, to double its size iT.maxElements = iT.maxElements * 2 - local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) + local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(iT.maxElements, iT.layout) - if iT.instanceVBO then iT.instanceVBO:Delete() end -- release if previous one existed + if iT.instanceVBO then + iT.instanceVBO:Delete() + end -- release if previous one existed iT.instanceVBO = newInstanceVBO - iT.instanceVBO:Upload(iT.instanceData,nil,0,1,iT.usedElements * iT.instanceStep) + iT.instanceVBO:Upload(iT.instanceData, nil, 0, 1, iT.usedElements * iT.instanceStep) if iT.VAO then -- reattach new if updated :D iT.VAO:Delete() - iT.VAO = makeVAOandAttach(iT.vertexVBO,iT.instanceVBO, iT.indexVBO) + iT.VAO = makeVAOandAttach(iT.vertexVBO, iT.instanceVBO, iT.indexVBO) end - for i, unitID in ipairs(iT.indextoUnitID) do local objecttype = iT.indextoObjectType[i] --Spring.Echo("Resize", iT.myName, i, unitID, objecttype) if objecttype == "unitID" then -- Sanity check for unitIDs if Spring.ValidUnitID(unitID) ~= true then - Spring.Echo("Invalid unitID",unitID, "at", i, "during resizing", iT.myName) + Spring.Echo("Invalid unitID", unitID, "at", i, "during resizing", iT.myName) else - iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, i - 1) end iT.VAO:AddUnitsToSubmission(unitID) - elseif objecttype == "unitDefID" then -- TODO - iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, nil, i-1) + elseif objecttype == "unitDefID" then -- TODO + iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, nil, i - 1) iT.VAO:AddUnitDefsToSubmission(unitID) elseif objecttype == "featureID" then if Spring.ValidFeatureID(unitID) ~= true then - Spring.Echo("Invalid featureID",unitID, "at", i, "during resizing", iT.myName) + Spring.Echo("Invalid featureID", unitID, "at", i, "during resizing", iT.myName) else - iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, i - 1) end iT.VAO:AddFeaturesToSubmission(unitID) elseif objecttype == "featureDefID" then - iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, i - 1) iT.VAO:AddFeatureDefsToSubmission(unitID) end end @@ -195,9 +213,10 @@ instVBO:Upload({ 0, 0, -100, }, 7, 1, 4, 6) Here is how you upload starting from 1st element and starting from 4th element in Lua array (-100) and finishing with 6th element (0), essentially it will upload (-100, 0, 0) into 7th attribute of 2nd instance. -]]-- +]] +-- -local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, noUpload, unitID, objecttype, teamID) +local function pushElementInstance(iT, thisInstance, instanceID, updateExisting, noUpload, unitID, objecttype, teamID) -- iT: instanceTable created with makeInstanceTable -- thisInstance: is a lua array of values to add to table, MUST BE INSTANCESTEP SIZED LUA ARRAY -- instanceID: an optional key given to the item, so it can be easily removed/updated by reference, defaults to the index of the instance in the buffer (1 based) @@ -205,38 +224,37 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, -- noUpload: prevent the VBO from being uploaded, if you feel like you are going to do a lot of ops and wish to manually upload when done instead -- unitID: if given, it will store then unitID corresponding to this instance, and will try to update the InstanceDataFromUnitIDs for this unit -- returns: the index of the instanceID in the table on success, else nil - if (objecttype == "unitID" and (Spring.ValidUnitID(unitID) == false)) or - (objecttype == "featureID" and (Spring.ValidFeatureID(unitID) == false)) or - (objecttype == "unitDefID" and (UnitDefs[unitID] == nil)) or - (objecttype == "featureDefID" and (FeatureDefs[unitID] == nil)) then - Spring.Echo("Tried to push invalid",objecttype,unitID,"into", iT.myName,"with instanceID", instanceID, "returning nil") + if (objecttype == "unitID" and (Spring.ValidUnitID(unitID) == false)) or (objecttype == "featureID" and (Spring.ValidFeatureID(unitID) == false)) or (objecttype == "unitDefID" and (UnitDefs[unitID] == nil)) or (objecttype == "featureDefID" and (FeatureDefs[unitID] == nil)) then + Spring.Echo("Tried to push invalid", objecttype, unitID, "into", iT.myName, "with instanceID", instanceID, "returning nil") return nil end if #thisInstance ~= iT.instanceStep then - Spring.Echo("Trying to upload an oddly sized instance into",iT.myName, #thisInstance, "instead of ",iT.instanceStep) + Spring.Echo("Trying to upload an oddly sized instance into", iT.myName, #thisInstance, "instead of ", iT.instanceStep) end local iTusedElements = iT.usedElements - local iTStep = iT.instanceStep + local iTStep = iT.instanceStep local endOffset = iTusedElements * iTStep - if instanceID == nil then instanceID = iTusedElements + 1 end + if instanceID == nil then + instanceID = iTusedElements + 1 + end local thisInstanceIndex = iT.instanceIDtoIndex[instanceID] - if (iTusedElements + 1 ) >= iT.maxElements then + if (iTusedElements + 1) >= iT.maxElements then resizeInstanceVBOTable(iT) iTusedElements = iT.usedElements -- because during validation of unitIDs during resizing, we can decrease the actual size of the table! - thisInstanceIndex = iT.instanceIDtoIndex[instanceID] -- this too, can change, TODO, also do this in VBOIDtable! + thisInstanceIndex = iT.instanceIDtoIndex[instanceID] -- this too, can change, TODO, also do this in VBOIDtable! end local isnewid = false if thisInstanceIndex == nil then -- new, register it thisInstanceIndex = iTusedElements + 1 - iT.usedElements = iTusedElements + 1 + iT.usedElements = iTusedElements + 1 iT.instanceIDtoIndex[instanceID] = thisInstanceIndex iT.indextoInstanceID[thisInstanceIndex] = instanceID isnewid = true else -- pre-existing ID, update or bail if updateExisting == nil then - Spring.Echo("Tried to add existing element to an instanceTable",iT.myName, instanceID) + Spring.Echo("Tried to add existing element to an instanceTable", iT.myName, instanceID) return nil else endOffset = (thisInstanceIndex - 1) * iTStep @@ -244,8 +262,8 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, end local instanceData = iT.instanceData - for i =1, iTStep do -- copy data, but fast - instanceData[endOffset + i] = thisInstance[i] + for i = 1, iTStep do -- copy data, but fast + instanceData[endOffset + i] = thisInstance[i] end if unitID ~= nil then --always upload? @@ -261,19 +279,26 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, --[3:59 PM] ivand: teamId is the 3rd arg --Spring.Echo("pushElementInstance,unitID, iT.objectTypeAttribID, thisInstanceIndex",unitID, iT.objectTypeAttribID, thisInstanceIndex) if objecttype == "unitID" then - iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex-1) - if isnewid then iT.VAO:AddUnitsToSubmission(unitID) end - elseif objecttype == "unitDefID" then -- TODO - iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, teamID, thisInstanceIndex-1) - if isnewid then iT.VAO:AddUnitDefsToSubmission(unitID) end + iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex - 1) + if isnewid then + iT.VAO:AddUnitsToSubmission(unitID) + end + elseif objecttype == "unitDefID" then -- TODO + iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, teamID, thisInstanceIndex - 1) + if isnewid then + iT.VAO:AddUnitDefsToSubmission(unitID) + end elseif objecttype == "featureID" then - iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex-1) - if isnewid then iT.VAO:AddFeaturesToSubmission(unitID) end + iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex - 1) + if isnewid then + iT.VAO:AddFeaturesToSubmission(unitID) + end elseif objecttype == "featureDefID" then - iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex-1) - if isnewid then iT.VAO:AddFeatureDefsToSubmission(unitID) end + iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, thisInstanceIndex - 1) + if isnewid then + iT.VAO:AddFeatureDefsToSubmission(unitID) + end end - end else iT.dirty = true @@ -287,14 +312,16 @@ local function popElementInstance(iT, instanceID, noUpload) -- instanceID: an optional key given to the item, so it can be easily removed by reference, defaults to the last element of the buffer, but this will screw up the instanceIDtoIndex table if used in mixed keys mode -- noUpload: prevent the VBO from being uploaded, if you feel like you are going to do a lot of ops and wish to manually upload when done instead -- returns nil on failure, the the index of the element on success - if instanceID == nil then instanceID = iT.usedElements end + if instanceID == nil then + instanceID = iT.usedElements + end if iT.instanceIDtoIndex[instanceID] == nil then -- if key is instanceID yet does not exist, then warn and bail - Spring.Echo("Tried to remove element ",instanceID,'From instanceTable', iT.myName, 'but it does not exist in it') + Spring.Echo("Tried to remove element ", instanceID, "From instanceTable", iT.myName, "but it does not exist in it") return nil end if iT.usedElements == 0 then -- Dont remove the last element - Spring.Echo("Tried to remove element ",instanceID,'From instanceTable', iT.myName, 'but it should be empty') + Spring.Echo("Tried to remove element ", instanceID, "From instanceTable", iT.myName, "but it should be empty") return nil end @@ -312,10 +339,14 @@ local function popElementInstance(iT, instanceID, noUpload) if oldElementIndex == lastElementIndex then -- EARLY OPT DEVILRY BAD! --Spring.Echo("Removed end element of instanceTable", lastElementIndex, instanceID, iT.indextoUnitID[oldElementIndex], iT.myName) iT.usedElements = iT.usedElements - 1 - if iT.indextoUnitID then iT.indextoUnitID[oldElementIndex] = nil end - if iT.indextoObjectType then iT.indextoObjectType[oldElementIndex] = nil end + if iT.indextoUnitID then + iT.indextoUnitID[oldElementIndex] = nil + end + if iT.indextoObjectType then + iT.indextoObjectType[oldElementIndex] = nil + end if iT.VAO then - iT.VAO:RemoveFromSubmission(oldElementIndex-1) + iT.VAO:RemoveFromSubmission(oldElementIndex - 1) --Spring.Echo("RemoveFromSubmissionLast",oldElementIndex-1 ) end @@ -326,27 +357,26 @@ local function popElementInstance(iT, instanceID, noUpload) iT.numZombies = iT.numZombies - 1 end end - else local lastElementInstanceID = iT.indextoInstanceID[lastElementIndex] local iTStep = iT.instanceStep - local endOffset = (iT.usedElements - 1)*iTStep + local endOffset = (iT.usedElements - 1) * iTStep iT.instanceIDtoIndex[lastElementInstanceID] = oldElementIndex iT.indextoInstanceID[oldElementIndex] = lastElementInstanceID iT.indextoInstanceID[lastElementIndex] = nil --- somehow this got forgotten? TODO for VBOIDtable --oldElementIndex = (oldElementIndex)*iTStep - local oldOffset = (oldElementIndex-1)*iTStep + local oldOffset = (oldElementIndex - 1) * iTStep local instanceData = iT.instanceData - for i= 1, iTStep do - instanceData[oldOffset + i ] = instanceData[endOffset + i] + for i = 1, iTStep do + instanceData[oldOffset + i] = instanceData[endOffset + i] end --size_t LuaVBOImpl::Upload(const sol::stack_table& luaTblData, const sol::optional attribIdxOpt, const sol::optional elemOffsetOpt, const sol::optional luaStartIndexOpt, const sol::optional luaFinishIndexOpt) --Spring.Echo("Removing instanceID",instanceID,"from iT at position", oldElementIndex, "shuffling back at", iT.usedElements,"endoffset=",endOffset,'oldOffset=',oldOffset) if noUpload ~= true then --Spring.Echo("Upload", oldElementIndex -1, oldOffset+1, oldOffset+iTStep) - iT.instanceVBO:Upload(iT.instanceData, nil, oldElementIndex-1, oldOffset +1, oldOffset + iTStep) + iT.instanceVBO:Upload(iT.instanceData, nil, oldElementIndex - 1, oldOffset + 1, oldOffset + iTStep) -- Do the unitID shuffle if needed: if iT.indextoUnitID then --Spring.Echo("Shuffling",lastElementIndex,"->", oldElementIndex) @@ -379,7 +409,7 @@ local function popElementInstance(iT, instanceID, noUpload) --Spring.SendCommands({"pause 1"}) end Spring.Echo(s) - Spring.Debug.TraceFullEcho(nil,nil, nil, dbgt(iT.indextoUnitID), dbgt(iT.indextoInstanceID)) + Spring.Debug.TraceFullEcho(nil, nil, nil, dbgt(iT.indextoUnitID), dbgt(iT.indextoInstanceID)) iT.zombies = {} iT.numZombies = 0 end @@ -401,16 +431,16 @@ local function popElementInstance(iT, instanceID, noUpload) iT.indextoObjectType[lastElementIndex] = nil if iT.VAO then - iT.VAO:RemoveFromSubmission(oldElementIndex-1) + iT.VAO:RemoveFromSubmission(oldElementIndex - 1) --Spring.Echo("RemoveFromSubmission",objecttype,oldElementIndex-1) end if objecttype == "unitID" or objecttype == "featureID" then if objecttype == "unitID" and Spring.ValidUnitID(myunitID) then - iT.instanceVBO:InstanceDataFromUnitIDs(myunitID, iT.objectTypeAttribID, oldElementIndex-1) - --iT.VAO:AddUnitDefsToSubmission(unitID) - elseif objecttype == "featureID" and Spring.ValidFeatureID(myunitID) then - iT.instanceVBO:InstanceDataFromFeatureIDs(myunitID, iT.objectTypeAttribID, oldElementIndex-1) + iT.instanceVBO:InstanceDataFromUnitIDs(myunitID, iT.objectTypeAttribID, oldElementIndex - 1) + --iT.VAO:AddUnitDefsToSubmission(unitID) + elseif objecttype == "featureID" and Spring.ValidFeatureID(myunitID) then + iT.instanceVBO:InstanceDataFromFeatureIDs(myunitID, iT.objectTypeAttribID, oldElementIndex - 1) else if iT.debugZombies then --Spring.Echo("Warning: Tried to pop back an invalid " .. ((iT.featureIDs and "featureID") or "unitID"), myunitID, "with instanceid:",lastElementInstanceID, "from", iT.myName, "while removing instance", instanceID, counttable(iT.instanceIDtoIndex), counttable(iT.indextoInstanceID), counttable(iT.indextoUnitID)) @@ -431,14 +461,14 @@ local function popElementInstance(iT, instanceID, noUpload) iT.numZombies = iT.numZombies + 1 end else - Spring.Echo("Tried to pop back an invalid unitID ", myunitID, "from", iT.myName, "while removing instance", instanceID,". Ensure that you remove invalid units from your instance tables") + Spring.Echo("Tried to pop back an invalid unitID ", myunitID, "from", iT.myName, "while removing instance", instanceID, ". Ensure that you remove invalid units from your instance tables") Spring.Debug.TraceFullEcho() end end elseif objecttype == "unitDefID" then - iT.instanceVBO:InstanceDataFromUnitDefIDs(myunitID, iT.objectTypeAttribID,nil, oldElementIndex-1) + iT.instanceVBO:InstanceDataFromUnitDefIDs(myunitID, iT.objectTypeAttribID, nil, oldElementIndex - 1) elseif objecttype == "featureDefID" then - iT.instanceVBO:InstanceDataFromFeatureDefIDs(myunitID, iT.objectTypeAttribID, oldElementIndex-1) + iT.instanceVBO:InstanceDataFromFeatureDefIDs(myunitID, iT.objectTypeAttribID, oldElementIndex - 1) end end else @@ -455,10 +485,12 @@ local function getElementInstanceData(iT, instanceID) -- iT: instanceTable created with makeInstanceTable -- instanceID: an optional key given to the item, so it can be easily removed by reference, defaults to the index of the instance in the buffer (1 based) local instanceIndex = iT.instanceIDtoIndex[instanceID] - if instanceIndex == nil then return nil end + if instanceIndex == nil then + return nil + end local iData = {} local iTStep = iT.instanceStep - instanceIndex = (instanceIndex-1) * iTStep + instanceIndex = (instanceIndex - 1) * iTStep for i = 1, iTStep do iData[i] = iT.instanceData[instanceIndex + i] end @@ -466,76 +498,73 @@ local function getElementInstanceData(iT, instanceID) end local function dumpAndCompareInstanceData(iT) - local gpuContents = iT.instanceVBO:Download(nil,nil,nil,true) + local gpuContents = iT.instanceVBO:Download(nil, nil, nil, true) for i = 1, iT.usedElements do Spring.Echo(string.format("%s, instanceID =%s, element %d of %d", iT.myName, tostring(iT.indextoInstanceID[i]), i, iT.usedElements)) local index = 1 - local offset = (i -1) * (iT.instanceStep) + local offset = (i - 1) * iT.instanceStep for j, layout in ipairs(iT.layout) do - local gpuData = '' - local luaData = '' - for k= 1, layout.size do + local gpuData = "" + local luaData = "" + for k = 1, layout.size do luaData = luaData .. tostring(iT.instanceData[index + offset]) .. "," gpuData = gpuData .. tostring(gpuContents[index + offset]) .. "," index = index + 1 end - local layoutstr = string.format(" ID=%d, name = %s, size = %d, type = %d, luaData = {%s}, gpuData={%s}", - layout.id, layout.name, layout.size, layout.type or GL.FLOAT, - luaData, - gpuData - ) + local layoutstr = string.format(" ID=%d, name = %s, size = %d, type = %d, luaData = {%s}, gpuData={%s}", layout.id, layout.name, layout.size, layout.type or GL.FLOAT, luaData, gpuData) Spring.Echo(layoutstr) end end end - - local function uploadAllElements(iT) -- DANGER: stuff should be removed first! -- upload all USED elements - if iT.usedElements == 0 then return end - iT.instanceVBO:Upload(iT.instanceData,nil,0, 1, iT.usedElements * iT.instanceStep) + if iT.usedElements == 0 then + return + end + iT.instanceVBO:Upload(iT.instanceData, nil, 0, 1, iT.usedElements * iT.instanceStep) iT.dirty = false - if iT.VAO then iT.VAO:ClearSubmission() end + if iT.VAO then + iT.VAO:ClearSubmission() + end for i, unitID in ipairs(iT.indextoUnitID) do local objecttype = iT.indextoObjectType[i] --Spring.Echo("Resize", iT.myName, i, unitID, objecttype) if objecttype == "unitID" then -- Sanity check for unitIDs if Spring.ValidUnitID(unitID) ~= true then - Spring.Echo("Invalid unitID",unitID, "at", i, "during resizing", iT.myName) + Spring.Echo("Invalid unitID", unitID, "at", i, "during resizing", iT.myName) else - iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.objectTypeAttribID, i - 1) end iT.VAO:AddUnitsToSubmission(unitID) - elseif objecttype == "unitDefID" then -- TODO - iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, nil, i-1) + elseif objecttype == "unitDefID" then -- TODO + iT.instanceVBO:InstanceDataFromUnitDefIDs(unitID, iT.objectTypeAttribID, nil, i - 1) iT.VAO:AddUnitDefsToSubmission(unitID) elseif objecttype == "featureID" then if Spring.ValidFeatureID(unitID) ~= true then - Spring.Echo("Invalid featureID",unitID, "at", i, "during resizing", iT.myName) + Spring.Echo("Invalid featureID", unitID, "at", i, "during resizing", iT.myName) else - iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.objectTypeAttribID, i - 1) end iT.VAO:AddFeaturesToSubmission(unitID) elseif objecttype == "featureDefID" then - iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, i-1) + iT.instanceVBO:InstanceDataFromFeatureDefIDs(unitID, iT.objectTypeAttribID, i - 1) iT.VAO:AddFeatureDefsToSubmission(unitID) end end end - local function validateInstanceVBOIDTable(iT, calledfrom) -- Check each instance, and see if it has a valid unitID associated with it -- Report with this key: "Error: validateInstanceVBOIDTable: error(2) = [string "LuaUI/Widgets - local errorKey = 'Error: validateInstanceVBOIDTable [string "LuaUI/' ..calledfrom or " " .. ' ]' + local errorKey = 'Error: validateInstanceVBOIDTable [string "LuaUI/' .. calledfrom or " " .. " ]" local removethese = {} - for i=1, iT.usedElements do + for i = 1, iT.usedElements do if iT.indextoInstanceID[i] == nil then - Spring.Echo(errorKey, "There is a hole in indextoInstanceID", iT.myName, "at", i,"out of",iT.usedElements, calledfrom) + Spring.Echo(errorKey, "There is a hole in indextoInstanceID", iT.myName, "at", i, "out of", iT.usedElements, calledfrom) --Spring.Echo() if iT.indextoUnitID[i] == nil then Spring.Echo(errorKey, "It is also missing from indextoUnitID") @@ -543,16 +572,15 @@ local function validateInstanceVBOIDTable(iT, calledfrom) Spring.Echo(errorKey, "But it does exist in indextoUnitID with an unitID of ", iT.indextoUnitID[i]) Spring.Echo(errorKey, "This is valid?", Spring.GetUnitPosition(iT.indextoUnitID[i])) end - else local instanceID = iT.indextoInstanceID[i] local objecttype = iT.indextoObjectType[i] if iT.instanceIDtoIndex[instanceID] == nil then - Spring.Echo(errorKey,"There is a hole instanceIDtoIndex", iT.myName, "at", i," iT.instanceIDtoIndex[instanceID] == nil ") + Spring.Echo(errorKey, "There is a hole instanceIDtoIndex", iT.myName, "at", i, " iT.instanceIDtoIndex[instanceID] == nil ") elseif iT.instanceIDtoIndex[instanceID] ~= i then - Spring.Echo(errorKey,"There is a problem in indextoInstanceID", iT.myName, "at i =", i," iT.indextoInstanceID[instanceID] ~= i, it is instead: ", iT.indextoInstanceID[instanceID] ) + Spring.Echo(errorKey, "There is a problem in indextoInstanceID", iT.myName, "at i =", i, " iT.indextoInstanceID[instanceID] ~= i, it is instead: ", iT.indextoInstanceID[instanceID]) end - if instanceID and objecttype and objecttype == 'unitID' then + if instanceID and objecttype and objecttype == "unitID" then local unitID = iT.indextoUnitID[i] if Spring.ValidUnitID(unitID) ~= true then removethese[instanceID] = true @@ -562,7 +590,7 @@ local function validateInstanceVBOIDTable(iT, calledfrom) end local idsremoved = "" for instanceID, _ in pairs(removethese) do - idsremoved = idsremoved .. ';' .. tostring(instanceID) + idsremoved = idsremoved .. ";" .. tostring(instanceID) popElementInstance(iT, instanceID) end if string.len(idsremoved) > 1 then @@ -575,11 +603,10 @@ local function validateInstanceVBOIDTable(iT, calledfrom) if (indextoInstanceIDsize ~= instanceIDtoIndexsize) or (instanceIDtoIndexsize ~= indextoUnitID) then Spring.Echo("Table size mismatch during validation of", iT.myName, indextoInstanceIDsize, instanceIDtoIndexsize, indextoUnitID) end - ]]-- - + ]] + -- end - --[[ function uploadElementRange(iT, startElementIndex, endElementIndex) @@ -598,7 +625,8 @@ function uploadElementRange(iT, startElementIndex, endElementIndex) iT.instanceVBO:InstanceDataFromUnitIDs(unitIDRange, iT.objectTypeAttribID, startElementIndex - 1) end end -]]-- +]] +-- return { makeInstanceVBOTable = makeInstanceVBOTable, diff --git a/modules/graphics/instancevbotable.lua b/modules/graphics/instancevbotable.lua index 21539b5f58a..b2c1b004b96 100644 --- a/modules/graphics/instancevbotable.lua +++ b/modules/graphics/instancevbotable.lua @@ -7,19 +7,21 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) -- myName: optional name, useful for debugging -- unitIDattribID: the attribute ID in the layout of the uvec4 of unitID bindings (e.g. 4 for {id = 4, name = 'instData', type = GL.UNSIGNED_INT, size= 4} ) -- returns: nil | instanceTable - if maxElements == nil then maxElements = 64 end -- default size - if myName == nil then myName = "InstanceVBOTable" end - local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if newInstanceVBO == nil then Spring.Echo("makeInstanceVBOTable, cannot get VBO for", myName); return nil end - newInstanceVBO:Define( - maxElements, - layout - ) - - + if maxElements == nil then + maxElements = 64 + end -- default size + if myName == nil then + myName = "InstanceVBOTable" + end + local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if newInstanceVBO == nil then + Spring.Echo("makeInstanceVBOTable, cannot get VBO for", myName) + return nil + end + newInstanceVBO:Define(maxElements, layout) local instanceStep = 0 - for i,attribute in pairs(layout) do + for i, attribute in pairs(layout) do instanceStep = instanceStep + attribute.size end local instanceData = {} @@ -27,20 +29,20 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) instanceData[i] = 0 end local instanceTable = { - instanceVBO = newInstanceVBO, - instanceData = instanceData, - instanceStep = instanceStep, - usedElements = 0, - maxElements = maxElements, - myName = myName, - instanceIDtoIndex = {}, -- this maps each instance ID to where it is in the buffer, 1 based - indextoInstanceID = {}, -- this tells us what instanceID is located in any given pos - layout = layout, - dirty = false, - numVertices = 0, - primitiveType = GL.TRIANGLES, - debugZombies = true, -- this is new, and its for debugging non-existing stuff on unitdestroyed - lastInstanceID = 0, + instanceVBO = newInstanceVBO, + instanceData = instanceData, + instanceStep = instanceStep, + usedElements = 0, + maxElements = maxElements, + myName = myName, + instanceIDtoIndex = {}, -- this maps each instance ID to where it is in the buffer, 1 based + indextoInstanceID = {}, -- this tells us what instanceID is located in any given pos + layout = layout, + dirty = false, + numVertices = 0, + primitiveType = GL.TRIANGLES, + debugZombies = true, -- this is new, and its for debugging non-existing stuff on unitdestroyed + lastInstanceID = 0, } if unitIDattribID ~= nil then @@ -54,7 +56,9 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) self.usedElements = 0 self.instanceIDtoIndex = {} self.indextoInstanceID = {} - if self.indextoUnitID then self.indextoUnitID = {} end + if self.indextoUnitID then + self.indextoUnitID = {} + end end function instanceTable:makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a vertex buffer to an instance buffer, and optionally, an index buffer if one is supplied. @@ -63,7 +67,9 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) --iT.indexVBO = indexVBO local newVAO = nil newVAO = gl.GetVAO() - if newVAO == nil then goodbye("Failed to create newVAO") end + if newVAO == nil then + goodbye("Failed to create newVAO") + end self.VAO = newVAO if vertexVBO == nil then -- the special case where are using 'vertices' as 'instances' newVAO:AttachVertexBuffer(instanceVBO) @@ -92,7 +98,9 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) self.usedElements = 0 self.instanceIDtoIndex = {} self.indextoInstanceID = {} - if self.indextoUnitID then self.indextoUnitID = {} end + if self.indextoUnitID then + self.indextoUnitID = {} + end end function instanceTable:compact() @@ -113,14 +121,14 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) local dstpos = newUsedElements * instanceStep local srcpos = (i - 1) * instanceStep - for j=1, instanceStep do - newInstanceData[dstpos + j] = instanceData[srcpos +j] + for j = 1, instanceStep do + newInstanceData[dstpos + j] = instanceData[srcpos + j] end newUsedElements = newUsedElements + 1 newInstanceIDtoIndex[instanceID] = newUsedElements newIndexToInstanceID[newUsedElements] = instanceID else - --Spring.Echo("compacting index",i, 'instanceID', instanceID) + --Spring.Echo("compacting index",i, 'instanceID', instanceID) end end --Spring.Echo("Post compacting", self.usedElements, newUsedElements) @@ -134,13 +142,12 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) end end - function instanceTable:draw(primitiveType) if self.usedElements > 0 then if self.indexVBO then - self.VAO:DrawElements(primitiveType or self.primitiveType, self.numVertices, 0, self.usedElements,0) + self.VAO:DrawElements(primitiveType or self.primitiveType, self.numVertices, 0, self.usedElements, 0) else - self.VAO:DrawArrays (primitiveType or self.primitiveType, self.numVertices, 0, self.usedElements,0) + self.VAO:DrawArrays(primitiveType or self.primitiveType, self.numVertices, 0, self.usedElements, 0) end end end @@ -152,28 +159,32 @@ local function makeInstanceVBOTable(layout, maxElements, myName, unitIDattribID) totalMem = totalMem + self.usedElements * self.instanceStep * 16 -- the actual instance data totalMem = totalMem + self.usedElements * 16 -- indextoinstanceid totalMem = totalMem + self.usedElements * 40 -- instanceIDtoIndex - if self.indextoUnitID then totalMem = totalMem + self.usedElements * 16 end + if self.indextoUnitID then + totalMem = totalMem + self.usedElements * 16 + end return totalMem end function instanceTable:Delete() -- Frees the instancevbo and vao for this instance table. Does not touch the vertex and index vbos. -- returns an estimate of how much ram was used - if self.instanceVBO then self.instanceVBO:Delete() end - if self.VAO then self.VAO:Delete() end + if self.instanceVBO then + self.instanceVBO:Delete() + end + if self.VAO then + self.VAO:Delete() + end local memusage = self:getMemUsage() self:clearInstanceTable() return memusage end - newInstanceVBO:Upload(instanceData) - -- I believe that the openGL spec doesnt guarantee that a buffer has an idea before data is uploaded to it, so we will fill it with zeros. - if gldebugannotations then + -- I believe that the openGL spec doesnt guarantee that a buffer has an idea before data is uploaded to it, so we will fill it with zeros. + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, newInstanceVBO:GetID(), myName) end - --register self in WG if possible if WG then @@ -203,7 +214,9 @@ local function clearInstanceTable(iT) iT.usedElements = 0 iT.instanceIDtoIndex = {} iT.indextoInstanceID = {} - if iT.indextoUnitID then iT.indextoUnitID = {} end + if iT.indextoUnitID then + iT.indextoUnitID = {} + end end local function makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a vertex buffer to an instance buffer, and optionally, an index buffer if one is supplied. @@ -212,7 +225,9 @@ local function makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a ve --iT.indexVBO = indexVBO local newVAO = nil newVAO = gl.GetVAO() - if newVAO == nil then goodbye("Failed to create newVAO") end + if newVAO == nil then + goodbye("Failed to create newVAO") + end if vertexVBO == nil then -- the special case where are using 'vertices' as 'instances' newVAO:AttachVertexBuffer(instanceVBO) else @@ -224,26 +239,24 @@ local function makeVAOandAttach(vertexVBO, instanceVBO, indexVBO) -- Attach a ve end -- this allows us to set up our sane - return newVAO end - --------------- DEBUG HELPERS -------------------------- local function comparetables(t1, t2, name) - for k,v in pairs(t1) do + for k, v in pairs(t1) do if t2[k] == nil then - Spring.Echo("Key ",k,"with value",v,"existing in t1 does not exist in t2 in ", name) + Spring.Echo("Key ", k, "with value", v, "existing in t1 does not exist in t2 in ", name) elseif t2[k] ~= v then - Spring.Echo("Value ",v,"for",k,"existing in t1 does not match value for t2",t2[k]," in ", name) + Spring.Echo("Value ", v, "for", k, "existing in t1 does not match value for t2", t2[k], " in ", name) end end - for k,v in pairs(t2) do + for k, v in pairs(t2) do if t1[k] == nil then - Spring.Echo("Key ",k,"with value",v,"existing in t2 does not exist in t1 in ", name) + Spring.Echo("Key ", k, "with value", v, "existing in t2 does not exist in t1 in ", name) elseif t1[k] ~= v then - Spring.Echo("Value ",v,"for",k,"existing in t2 does not match value for t1",t1[k]," in ", name) + Spring.Echo("Value ", v, "for", k, "existing in t2 does not match value for t1", t1[k], " in ", name) end end end @@ -252,29 +265,33 @@ local function dbgt(t, name) name = name or "" local gf = Spring.GetGameFrame() local count = 0 - local res = '' - for k,v in pairs(t) do - if type(k) == 'number' and type(v) == 'number' then - res = res .. tostring(k) .. ':' .. tostring(v) ..',' + local res = "" + for k, v in pairs(t) do + if type(k) == "number" and type(v) == "number" then + res = res .. tostring(k) .. ":" .. tostring(v) .. "," count = count + 1 end end - Spring.Echo(tostring(gf).. " " ..name .. ' #' .. tostring(count) .. ' {'..res .. '}') + Spring.Echo(tostring(gf) .. " " .. name .. " #" .. tostring(count) .. " {" .. res .. "}") return res end local function counttable(t) local count = 0 - if type(t) ~= type({}) then return 0 end - for k, v in pairs(t) do count = count + 1 end + if type(t) ~= type({}) then + return 0 + end + for k, v in pairs(t) do + count = count + 1 + end return count end local function validateInstanceVBOTable(iT, calledfrom) -- check that instanceIDtoIndex and indextoInstanceID are valid and contigous: - for i=1, iT.usedElements do + for i = 1, iT.usedElements do if iT.indextoInstanceID[i] == nil then - Spring.Echo("There is a hole in indextoInstanceID", iT.myName, "at", i,"out of",iT.usedElements, calledfrom) + Spring.Echo("There is a hole in indextoInstanceID", iT.myName, "at", i, "out of", iT.usedElements, calledfrom) --Spring.Echo() if iT.indextoUnitID[i] == nil then Spring.Echo("It is also missing from indextoUnitID") @@ -282,13 +299,12 @@ local function validateInstanceVBOTable(iT, calledfrom) Spring.Echo("But it does exist in indextoUnitID with an unitID of ", iT.indextoUnitID[i]) Spring.Echo("This is valid?", Spring.GetUnitPosition(iT.indextoUnitID[i])) end - else local instanceID = iT.indextoInstanceID[i] if iT.instanceIDtoIndex[instanceID] == nil then - Spring.Echo("There is a hole instanceIDtoIndex", iT.myName, "at", i," iT.instanceIDtoIndex[instanceID] == nil ") + Spring.Echo("There is a hole instanceIDtoIndex", iT.myName, "at", i, " iT.instanceIDtoIndex[instanceID] == nil ") elseif iT.instanceIDtoIndex[instanceID] ~= i then - Spring.Echo("There is a problem in indextoInstanceID", iT.myName, "at i =", i," iT.indextoInstanceID[instanceID] ~= i, it is instead: ", iT.indextoInstanceID[instanceID] ) + Spring.Echo("There is a problem in indextoInstanceID", iT.myName, "at i =", i, " iT.indextoInstanceID[instanceID] ~= i, it is instead: ", iT.indextoInstanceID[instanceID]) end end end @@ -298,24 +314,25 @@ local function validateInstanceVBOTable(iT, calledfrom) if (indextoInstanceIDsize ~= instanceIDtoIndexsize) or (instanceIDtoIndexsize ~= indextoUnitID) then Spring.Echo("Table size mismatch during validation of", iT.myName, indextoInstanceIDsize, instanceIDtoIndexsize, indextoUnitID) end - end function locateInvalidUnits(iT) - if iT.validinfo == nil then iT.validinfo = {} end + if iT.validinfo == nil then + iT.validinfo = {} + end local invalidcount = 0 for i, unitID in ipairs(iT.indextoUnitID) do if iT.featureIDs then if Spring.ValidFeatureID(unitID) then local px, py, pz = Spring.GetFeaturePosition(unitID) local fdefname = FeatureDefs[Spring.GetFeatureDefID(unitID)].name - iT.validinfo[unitID] = {px = px, py = py, pz = pz, fdefname = fdefname} + iT.validinfo[unitID] = { px = px, py = py, pz = pz, fdefname = fdefname } else - Spring.SendCommands({"pause 1"}) + Spring.SendCommands({ "pause 1" }) Spring.Echo("INVALID feature, last seen at", unitID) local vi = iT.validinfo[unitID] local markertext = tostring(unitID) .. "," .. dbgt(vi) - Spring.MarkerAddPoint(vi.px, vi.py, vi.pz, markertext ) + Spring.MarkerAddPoint(vi.px, vi.py, vi.pz, markertext) invalidcount = invalidcount + 1 end else @@ -323,14 +340,14 @@ function locateInvalidUnits(iT) local px, py, pz = Spring.GetUnitPosition(unitID) local unitDefID = Spring.GetUnitDefID(unitID) local unitdefname = (unitDefID and UnitDefs[unitDefID].name) or "unknown:nil" - iT.validinfo[unitID] = {px = px, py = py, pz = pz, unitdefname = unitdefname} + iT.validinfo[unitID] = { px = px, py = py, pz = pz, unitdefname = unitdefname } else - Spring.SendCommands({"pause 1"}) - Spring.Echo(iT.myName, " INVALID unitID",unitID,"#elements", iT.usedElements, "last seen at tablepos:", i) + Spring.SendCommands({ "pause 1" }) + Spring.Echo(iT.myName, " INVALID unitID", unitID, "#elements", iT.usedElements, "last seen at tablepos:", i) local vi = iT.validinfo[unitID] local markertext = tostring(unitID) .. "," .. dbgt(vi) - Spring.MarkerAddPoint(vi.px, vi.py, vi.pz, markertext ) + Spring.MarkerAddPoint(vi.px, vi.py, vi.pz, markertext) invalidcount = invalidcount + 1 end end @@ -346,10 +363,12 @@ local function resizeInstanceVBOTable(iT) -- Also performs a busload of sanity checking -- Spring.Echo("instanceVBOTable full, resizing to double size",iT.myName, iT.usedElements,iT.maxElements) iT.maxElements = iT.maxElements * 2 - local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) + local newInstanceVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) newInstanceVBO:Define(iT.maxElements, iT.layout) - if iT.instanceVBO then iT.instanceVBO:Delete() end -- release if previous one existed + if iT.instanceVBO then + iT.instanceVBO:Delete() + end -- release if previous one existed iT.instanceVBO = newInstanceVBO -- ok this needs some sanitation right here, with reporting. if iT.indextoUnitID then @@ -366,8 +385,11 @@ local function resizeInstanceVBOTable(iT) for i, objectID in ipairs(iT.indextoUnitID) do local isValidID = false - if iT.featureIDs then isValidID = Spring.ValidFeatureID(objectID) - else isValidID = Spring.ValidUnitID(objectID) end + if iT.featureIDs then + isValidID = Spring.ValidFeatureID(objectID) + else + isValidID = Spring.ValidUnitID(objectID) + end if isValidID then local offset = new_usedElements * iTStep for j = 1, iTStep do @@ -377,20 +399,20 @@ local function resizeInstanceVBOTable(iT) new_usedElements = new_usedElements + 1 local currentInstanceID = iT.indextoInstanceID[i] new_indextoInstanceID[new_usedElements] = iT.indextoInstanceID[i] - new_indextoUnitID[new_usedElements] = iT.indextoUnitID[i] + new_indextoUnitID[new_usedElements] = iT.indextoUnitID[i] new_instanceIDtoIndex[currentInstanceID] = new_usedElements --Spring.Echo("Resize:",currentInstanceID, iT.indextoUnitID[i] ) invalidcount = invalidcount + 1 else - Spring.Echo("Warning: Found invalid unit/featureID",objectID,"at",i,"while resizing",iT.myName) + Spring.Echo("Warning: Found invalid unit/featureID", objectID, "at", i, "while resizing", iT.myName) end end if invalidcount == 0 then - comparetables( iT.instanceData, new_instanceData, "instanceData") - comparetables( iT.instanceIDtoIndex, new_instanceIDtoIndex, "instanceIDtoIndex") - comparetables( iT.indextoInstanceID, new_indextoInstanceID, "indextoInstanceID") - comparetables( iT.indextoUnitID, new_indextoUnitID, "indextoUnitID") + comparetables(iT.instanceData, new_instanceData, "instanceData") + comparetables(iT.instanceIDtoIndex, new_instanceIDtoIndex, "instanceIDtoIndex") + comparetables(iT.indextoInstanceID, new_indextoInstanceID, "indextoInstanceID") + comparetables(iT.indextoUnitID, new_indextoUnitID, "indextoUnitID") end iT.instanceData = new_instanceData @@ -400,7 +422,7 @@ local function resizeInstanceVBOTable(iT) iT.indextoUnitID = new_indextoUnitID end - iT.instanceVBO:Upload(iT.instanceData,nil,0,1,iT.usedElements * iT.instanceStep) + iT.instanceVBO:Upload(iT.instanceData, nil, 0, 1, iT.usedElements * iT.instanceStep) if gldebugannotations then gl.ObjectLabel(GL_BUFFER, iT.instanceVBO:GetID(), iT.myName) @@ -408,7 +430,7 @@ local function resizeInstanceVBOTable(iT) if iT.VAO then -- reattach new if updated :D iT.VAO:Delete() - iT.VAO = makeVAOandAttach(iT.vertexVBO,iT.instanceVBO, iT.indexVBO) + iT.VAO = makeVAOandAttach(iT.vertexVBO, iT.instanceVBO, iT.indexVBO) end if iT.indextoUnitID then @@ -429,9 +451,10 @@ instVBO:Upload({ 0, 0, -100, }, 7, 1, 4, 6) Here is how you upload starting from 1st element and starting from 4th element in Lua array (-100) and finishing with 6th element (0), essentially it will upload (-100, 0, 0) into 7th attribute of 2nd instance. -]]-- +]] +-- -local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, noUpload, unitID) +local function pushElementInstance(iT, thisInstance, instanceID, updateExisting, noUpload, unitID) -- iT: instanceTable created with makeInstanceTable -- thisInstance: is a lua array of values to add to table, MUST BE INSTANCESTEP SIZED LUA ARRAY -- instanceID: an optional key given to the item, so it can be easily removed/updated by reference, defaults to the index of the instance in the buffer (1 based) @@ -440,47 +463,52 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, -- unitID: if given, it will store then unitID corresponding to this instance, and will try to update the InstanceDataFromUnitIDs for this unit -- returns: the index of the instanceID in the table on success, else nil if #thisInstance ~= iT.instanceStep then - Spring.Echo("Trying to upload an oddly sized instance into",iT.myName, #thisInstance, "instead of ",iT.instanceStep) - Spring.Debug.TraceFullEcho(20,20,20, "pushElementInstance Failure:"..iT.myName ) + Spring.Echo("Trying to upload an oddly sized instance into", iT.myName, #thisInstance, "instead of ", iT.instanceStep) + Spring.Debug.TraceFullEcho(20, 20, 20, "pushElementInstance Failure:" .. iT.myName) end local iTusedElements = iT.usedElements - local iTStep = iT.instanceStep + local iTStep = iT.instanceStep local endOffset = iTusedElements * iTStep - if instanceID == nil then instanceID = nextInstanceID(iT) end + if instanceID == nil then + instanceID = nextInstanceID(iT) + end local thisInstanceIndex = iT.instanceIDtoIndex[instanceID] - if (iTusedElements + 1 ) >= iT.maxElements then -- add 1 extra for safety (not the best idea, but we seem to be running over it by 1) + if (iTusedElements + 1) >= iT.maxElements then -- add 1 extra for safety (not the best idea, but we seem to be running over it by 1) resizeInstanceVBOTable(iT) iTusedElements = iT.usedElements -- because during validation of unitIDs during resizing, we can decrease the actual size of the table! - thisInstanceIndex = iT.instanceIDtoIndex[instanceID] -- this too, can change, TODO, also do this in VBOIDtable! + thisInstanceIndex = iT.instanceIDtoIndex[instanceID] -- this too, can change, TODO, also do this in VBOIDtable! end if thisInstanceIndex == nil then -- new, register it thisInstanceIndex = iTusedElements + 1 - iT.usedElements = iTusedElements + 1 + iT.usedElements = iTusedElements + 1 iT.instanceIDtoIndex[instanceID] = thisInstanceIndex iT.indextoInstanceID[thisInstanceIndex] = instanceID else -- pre-existing ID, update or bail if updateExisting == nil then - Spring.Echo("Tried to add existing element to an instanceTable",iT.myName, instanceID) + Spring.Echo("Tried to add existing element to an instanceTable", iT.myName, instanceID) return nil else endOffset = (thisInstanceIndex - 1) * iTStep end end local instanceData = iT.instanceData - for i =1, iTStep do -- copy data, but fast - instanceData[endOffset + i] = thisInstance[i] + for i = 1, iTStep do -- copy data, but fast + instanceData[endOffset + i] = thisInstance[i] end if unitID ~= nil then local isvalidid - if iT.featureIDs then isvalidid = Spring.ValidFeatureID(unitID) - else isvalidid = Spring.ValidUnitID(unitID) end + if iT.featureIDs then + isvalidid = Spring.ValidFeatureID(unitID) + else + isvalidid = Spring.ValidUnitID(unitID) + end if isvalidid == false then - Spring.Echo("Error: Attempted to push an invalid unit/featureID",unitID, "into", iT.myName) + Spring.Echo("Error: Attempted to push an invalid unit/featureID", unitID, "into", iT.myName) noUpload = true - Spring.Debug.TraceFullEcho(20,20,20,"invalid unit/featureID in " ..iT.myName) + Spring.Debug.TraceFullEcho(20, 20, 20, "invalid unit/featureID in " .. iT.myName) end iT.indextoUnitID[thisInstanceIndex] = unitID end @@ -490,16 +518,18 @@ local function pushElementInstance(iT,thisInstance, instanceID, updateExisting, --Spring.Echo("pushElementInstance,unitID, iT.unitIDattribID, thisInstanceIndex",unitID, iT.unitIDattribID, thisInstanceIndex) if unitID ~= nil then if iT.featureIDs then - iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.unitIDattribID, thisInstanceIndex-1) + iT.instanceVBO:InstanceDataFromFeatureIDs(unitID, iT.unitIDattribID, thisInstanceIndex - 1) else - iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.unitIDattribID, thisInstanceIndex-1) + iT.instanceVBO:InstanceDataFromUnitIDs(unitID, iT.unitIDattribID, thisInstanceIndex - 1) end end else iT.dirty = true end - if iT.debug then validateInstanceVBOTable(iT, 'push') end + if iT.debug then + validateInstanceVBOTable(iT, "push") + end return instanceID end @@ -514,12 +544,12 @@ local function popElementInstance(iT, instanceID, noUpload) end if iT.instanceIDtoIndex[instanceID] == nil then -- if key is instanceID yet does not exist, then warn and bail - Spring.Echo("Tried to remove element ",instanceID,'From instanceTable', iT.myName, 'but it does not exist in it') - Spring.Debug.TraceFullEcho(10,10,3, iT.myName) + Spring.Echo("Tried to remove element ", instanceID, "From instanceTable", iT.myName, "but it does not exist in it") + Spring.Debug.TraceFullEcho(10, 10, 3, iT.myName) return nil end if iT.usedElements == 0 then -- Dont remove the last element - Spring.Echo("Tried to remove element ",instanceID,'From instanceTable', iT.myName, 'but it should be empty') + Spring.Echo("Tried to remove element ", instanceID, "From instanceTable", iT.myName, "but it should be empty") return nil end @@ -536,7 +566,9 @@ local function popElementInstance(iT, instanceID, noUpload) --Spring.Echo("Removed end element of instanceTable", iT.myName) iT.usedElements = iT.usedElements - 1 -- if it had a related unitID stored, remove that: - if iT.indextoUnitID then iT.indextoUnitID[oldElementIndex] = nil end + if iT.indextoUnitID then + iT.indextoUnitID[oldElementIndex] = nil + end if iT.debugZombies then if iT.zombies and iT.zombies[instanceID] then @@ -545,7 +577,6 @@ local function popElementInstance(iT, instanceID, noUpload) iT.numZombies = iT.numZombies - 1 end end - else local lastElementInstanceID = iT.indextoInstanceID[lastElementIndex] if lastElementInstanceID == nil then -- @@ -555,22 +586,22 @@ local function popElementInstance(iT, instanceID, noUpload) dbgt(iT.indextoUnitID, "indextoUnitID") end local iTStep = iT.instanceStep - local endOffset = (iT.usedElements - 1)*iTStep + local endOffset = (iT.usedElements - 1) * iTStep iT.instanceIDtoIndex[lastElementInstanceID] = oldElementIndex -- lastElementInstanceID was somehow nil here? iT.indextoInstanceID[oldElementIndex] = lastElementInstanceID iT.indextoInstanceID[lastElementIndex] = nil --- somehow this got forgotten? TODO for VBOIDtable - local oldOffset = (oldElementIndex-1)*iTStep + local oldOffset = (oldElementIndex - 1) * iTStep local instanceData = iT.instanceData for i = 1, iTStep do - instanceData[oldOffset + i ] = instanceData[endOffset + i] + instanceData[oldOffset + i] = instanceData[endOffset + i] end --size_t LuaVBOImpl::Upload(const sol::stack_table& luaTblData, const sol::optional attribIdxOpt, const sol::optional elemOffsetOpt, const sol::optional luaStartIndexOpt, const sol::optional luaFinishIndexOpt) --Spring.Echo("Removing instanceID",instanceID,"from iT at position", oldElementIndex, "shuffling back at", iT.usedElements,"endoffset=",endOffset,'oldOffset=',oldOffset) if noUpload ~= true then --Spring.Echo("Upload", oldElementIndex -1, oldOffset+1, oldOffset+iTStep) - iT.instanceVBO:Upload(iT.instanceData,nil,oldElementIndex-1,oldOffset +1,oldOffset + iTStep) + iT.instanceVBO:Upload(iT.instanceData, nil, oldElementIndex - 1, oldOffset + 1, oldOffset + iTStep) else iT.dirty = true end @@ -595,10 +626,10 @@ local function popElementInstance(iT, instanceID, noUpload) if iT.numZombies and iT.numZombies > 0 then -- WE HAVE ZOMBIES AAAAARGH local s = "Warning: We have " .. tostring(iT.numZombies) .. " zombie units left over in " .. iT.myName for zombie, gf in pairs(iT.zombies) do - s = s .. " " .. tostring(zombie) ..'/'..tostring(gf) - Spring.Echo("ZOMBIE instanceID", zombie, 'gf',gf) + s = s .. " " .. tostring(zombie) .. "/" .. tostring(gf) + Spring.Echo("ZOMBIE instanceID", zombie, "gf", gf) --Spring.SendCommands({"pause 1"}) - Spring.Debug.TraceFullEcho(nil,nil,nil, iT.myName) + Spring.Debug.TraceFullEcho(nil, nil, nil, iT.myName) end Spring.Echo(s) iT.zombies = {} @@ -620,9 +651,9 @@ local function popElementInstance(iT, instanceID, noUpload) if (iT.featureIDs and Spring.ValidFeatureID(popunitID)) or Spring.ValidUnitID(popunitID) then if noUpload ~= true then if iT.featureIDs then - iT.instanceVBO:InstanceDataFromFeatureIDs(popunitID, iT.unitIDattribID, oldElementIndex-1) + iT.instanceVBO:InstanceDataFromFeatureIDs(popunitID, iT.unitIDattribID, oldElementIndex - 1) else - iT.instanceVBO:InstanceDataFromUnitIDs(popunitID, iT.unitIDattribID, oldElementIndex-1) + iT.instanceVBO:InstanceDataFromUnitIDs(popunitID, iT.unitIDattribID, oldElementIndex - 1) end end else @@ -645,7 +676,9 @@ local function popElementInstance(iT, instanceID, noUpload) iT.usedElements = iT.usedElements - 1 end - if iT.debug then validateInstanceVBOTable(iT,'pop') end + if iT.debug then + validateInstanceVBOTable(iT, "pop") + end return oldElementIndex end @@ -654,12 +687,12 @@ local function getElementInstanceData(iT, instanceID, cacheTable) -- instanceID: an optional key given to the item, so it can be easily removed by reference, defaults to the index of the instance in the buffer (1 based) local instanceIndex = iT.instanceIDtoIndex[instanceID] if instanceIndex == nil then - Spring.Echo("Tried to getElementInstanceData from",iT.myName,instanceID, "but it does not exist") + Spring.Echo("Tried to getElementInstanceData from", iT.myName, instanceID, "but it does not exist") return nil end local iData = cacheTable or {} local iTStep = iT.instanceStep - instanceIndex = (instanceIndex-1) * iTStep + instanceIndex = (instanceIndex - 1) * iTStep local instanceData = iT.instanceData for i = 1, iTStep do iData[i] = instanceData[instanceIndex + i] @@ -669,9 +702,11 @@ end local function uploadAllElements(iT) -- upload all USED elements - if iT.usedElements == 0 then return end + if iT.usedElements == 0 then + return + end - iT.instanceVBO:Upload(iT.instanceData,nil,0, 1, iT.usedElements * iT.instanceStep) + iT.instanceVBO:Upload(iT.instanceData, nil, 0, 1, iT.usedElements * iT.instanceStep) iT.dirty = false if iT.indextoUnitID then if iT.featureIDs then @@ -683,7 +718,8 @@ local function uploadAllElements(iT) end local function uploadElementRange(iT, startElementIndex, endElementIndex) - iT.instanceVBO:Upload(iT.instanceData, -- The lua mirrored VBO data + iT.instanceVBO:Upload( + iT.instanceData, -- The lua mirrored VBO data nil, -- the attribute index, nil for all attributes startElementIndex, -- vboOffset optional, , what ELEMENT offset of the VBO to start uploading into, 0 based startElementIndex * iT.instanceStep + 1, -- luaStartIndex, default 1, what element of the lua array to start uploading from. 1 is the 1st element of a lua table. @@ -709,7 +745,9 @@ end -- remove takes priority over keep local function compactInstanceVBO(iT, removelist, keeplist) local usedElements = iT.usedElements - if usedElements == 0 then return 0 end + if usedElements == 0 then + return 0 + end local instanceStep = iT.instanceStep local instanceData = iT.instanceData local indextoInstanceID = iT.indextoInstanceID @@ -720,8 +758,8 @@ local function compactInstanceVBO(iT, removelist, keeplist) local removemode = (removelist ~= nil) and (keeplist == nil) for index, instanceID in ipairs(indextoInstanceID) do -- If its in keeplist, - if (removemode and (removelist[instanceID]== nil) ) or ((removemode == false) and keeplist[instanceID]) then - local instanceOffset = (index-1) * instanceStep + if (removemode and (removelist[instanceID] == nil)) or ((removemode == false) and keeplist[instanceID]) then + local instanceOffset = (index - 1) * instanceStep local newInstanceOffset = newUsedElements * instanceStep for i = 1, instanceStep do instanceData[newInstanceOffset + i] = instanceData[instanceOffset + i] @@ -745,9 +783,9 @@ end local function drawInstanceVBO(iT) if iT.usedElements > 0 then if iT.indexVBO then - iT.VAO:DrawElements(iT.primitiveType, iT.numVertices, 0, iT.usedElements,0) + iT.VAO:DrawElements(iT.primitiveType, iT.numVertices, 0, iT.usedElements, 0) else - iT.VAO:DrawArrays(iT.primitiveType, iT.numVertices, 0, iT.usedElements,0) + iT.VAO:DrawArrays(iT.primitiveType, iT.numVertices, 0, iT.usedElements, 0) end end end @@ -756,10 +794,12 @@ local function countInvalidUnitIDs(iT) local invalids = {} for i, objectID in ipairs(iT.indextoUnitID) do local isValidID = false - if iT.featureIDs then isValidID = Spring.ValidFeatureID(objectID) - else isValidID = Spring.ValidUnitID(objectID) end + if iT.featureIDs then + isValidID = Spring.ValidFeatureID(objectID) + else + isValidID = Spring.ValidUnitID(objectID) + end if isValidID then - else invalids[#invalids + 1] = objectID end @@ -770,7 +810,6 @@ local function countInvalidUnitIDs(iT) return invalids end - --------- HELPERS FOR PRIMITIVES ------------------ local function makeCircleVBO(circleSegments, radius, startCenter, name) @@ -778,121 +817,133 @@ local function makeCircleVBO(circleSegments, radius, startCenter, name) -- can be used in both GL.LINES and GL.TRIANGLE_FAN mode -- Startcenter places a vertex in the center, this is nice for triangle fans, -- but when drawing lines with this vbo, start at an offset of 1 - -- Fun note: its NOT faster to draw stenciled circles with this. - if not radius then radius = 1 end - circleSegments = circleSegments -1 -- for po2 buffers - local circleVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if circleVBO == nil then return nil end + -- Fun note: its NOT faster to draw stenciled circles with this. + if not radius then + radius = 1 + end + circleSegments = circleSegments - 1 -- for po2 buffers + local circleVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if circleVBO == nil then + return nil + end local VBOLayout = { - {id = 0, name = "position", size = 4}, + { id = 0, name = "position", size = 4 }, } local VBOData = {} if startCenter then - VBOData[#VBOData+1] = 0 -- X - VBOData[#VBOData+1] = 0 -- Y - VBOData[#VBOData+1] = 0 -- circumference [0-1] - VBOData[#VBOData+1] = radius + VBOData[#VBOData + 1] = 0 -- X + VBOData[#VBOData + 1] = 0 -- Y + VBOData[#VBOData + 1] = 0 -- circumference [0-1] + VBOData[#VBOData + 1] = radius end - for i = 0, circleSegments do -- this is +1 - VBOData[#VBOData+1] = math.sin(math.pi*2* i / circleSegments) * radius -- X - VBOData[#VBOData+1] = math.cos(math.pi*2* i / circleSegments) * radius-- Y - VBOData[#VBOData+1] = i / circleSegments -- circumference [0-1] - VBOData[#VBOData+1] = radius + for i = 0, circleSegments do -- this is +1 + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * i / circleSegments) * radius -- X + VBOData[#VBOData + 1] = math.cos(math.pi * 2 * i / circleSegments) * radius -- Y + VBOData[#VBOData + 1] = i / circleSegments -- circumference [0-1] + VBOData[#VBOData + 1] = radius end circleVBO:Define( - circleSegments + 1 + (startCenter and 1 or 0) , -- +1 for center point if startCenter is true + circleSegments + 1 + (startCenter and 1 or 0), -- +1 for center point if startCenter is true VBOLayout ) circleVBO:Upload(VBOData) - if gldebugannotations then + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, circleVBO:GetID(), name or "CircleVBO") end - return circleVBO, #VBOData/4 + return circleVBO, #VBOData / 4 end local function makePlaneVBO(xsize, ysize, xresolution, yresolution, name) -- makes a plane from [-xsize to xsize] with xresolution subdivisions - if not xsize then xsize = 1 end - if not ysize then ysize = xsize end - if not xresolution then xresolution = 1 end - if not yresolution then yresolution = xresolution end + if not xsize then + xsize = 1 + end + if not ysize then + ysize = xsize + end + if not xresolution then + xresolution = 1 + end + if not yresolution then + yresolution = xresolution + end xresolution = math.floor(xresolution) yresolution = math.floor(yresolution) - local planeVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if planeVBO == nil then return nil end + local planeVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if planeVBO == nil then + return nil + end local VBOLayout = { - {id = 0, name = "xyworld_xyfract", size = 2}, + { id = 0, name = "xyworld_xyfract", size = 2 }, } local VBOData = {} - for x = 0, xresolution do -- this is +1 + for x = 0, xresolution do -- this is +1 for y = 0, yresolution do - VBOData[#VBOData+1] = xsize * ((x / xresolution) -0.5 ) *2 - VBOData[#VBOData+1] = ysize * ((y / yresolution) -0.5 ) * 2 + VBOData[#VBOData + 1] = xsize * ((x / xresolution) - 0.5) * 2 + VBOData[#VBOData + 1] = ysize * ((y / yresolution) - 0.5) * 2 end end - planeVBO:Define( - (xresolution + 1) * (yresolution + 1) , - VBOLayout - ) + planeVBO:Define((xresolution + 1) * (yresolution + 1), VBOLayout) planeVBO:Upload(VBOData) - if gldebugannotations then + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, planeVBO:GetID(), name or "PlaneVBO") end --Spring.Echo("PlaneVBOData up:",#VBOData, "Down", #planeVBO:Download()) - return planeVBO, #VBOData/2 + return planeVBO, #VBOData / 2 end local function makePlaneIndexVBO(xresolution, yresolution, cutcircle, name) xresolution = math.floor(xresolution) - if not yresolution then yresolution = xresolution end - local planeIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER,false) - if planeIndexVBO == nil then return nil end + if not yresolution then + yresolution = xresolution + end + local planeIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) + if planeIndexVBO == nil then + return nil + end local function xyinrad(lx, ly) local px = (lx / xresolution) * 2 - 1 local py = (ly / yresolution) * 2 - 1 - return (px*px + py*py) <= 1 + return (px * px + py * py) <= 1 end local IndexVBOData = {} local qindex = 0 local colsize = yresolution + 1 - for x = 0, xresolution-1 do -- this is +1 - for y = 0, yresolution-1 do + for x = 0, xresolution - 1 do -- this is +1 + for y = 0, yresolution - 1 do --this is only 20% optimization - if cutcircle == nil or (xyinrad(x,y) or xyinrad(x + 1,y) or xyinrad(x,y + 1 )) then + if cutcircle == nil or (xyinrad(x, y) or xyinrad(x + 1, y) or xyinrad(x, y + 1)) then -- top left one IndexVBOData[#IndexVBOData + 1] = qindex - IndexVBOData[#IndexVBOData + 1] = qindex +1 + IndexVBOData[#IndexVBOData + 1] = qindex + 1 IndexVBOData[#IndexVBOData + 1] = qindex + colsize end - if cutcircle == nil or (xyinrad(x+1,y+1) or xyinrad(x + 1,y) or xyinrad(x,y + 1 )) then + if cutcircle == nil or (xyinrad(x + 1, y + 1) or xyinrad(x + 1, y) or xyinrad(x, y + 1)) then -- bottom right one? - IndexVBOData[#IndexVBOData + 1] = qindex +1 + IndexVBOData[#IndexVBOData + 1] = qindex + 1 IndexVBOData[#IndexVBOData + 1] = qindex + colsize + 1 IndexVBOData[#IndexVBOData + 1] = qindex + colsize end qindex = qindex + 1 - end qindex = qindex + 1 end - planeIndexVBO:Define( - # IndexVBOData - ) + planeIndexVBO:Define(#IndexVBOData) planeIndexVBO:Upload(IndexVBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, planeIndexVBO:GetID(), name or "planeIndexVBO") end --Spring.Echo("PlaneIndexVBO up:",#IndexVBOData, "Down", #planeIndexVBO:Download()) @@ -904,63 +955,79 @@ local function makePointVBO(numPoints, randomFactor, name) -- can be used in both GL.LINES and GL.TRIANGLE_FAN mode numPoints = numPoints or 1 randomFactor = randomFactor or 0 - local pointVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if pointVBO == nil then return nil end + local pointVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if pointVBO == nil then + return nil + end local VBOLayout = { - {id = 0, name = "position_w", size = 4}, + { id = 0, name = "position_w", size = 4 }, } local VBOData = {} - for i = 1, numPoints do -- - VBOData[#VBOData+1] = randomFactor * math.random()-- X - VBOData[#VBOData+1] = randomFactor * math.random()-- Y - VBOData[#VBOData+1] = randomFactor * math.random()---Z - VBOData[#VBOData+1] = i/numPoints -- index for lolz? + for i = 1, numPoints do -- + VBOData[#VBOData + 1] = randomFactor * math.random() -- X + VBOData[#VBOData + 1] = randomFactor * math.random() -- Y + VBOData[#VBOData + 1] = randomFactor * math.random() ---Z + VBOData[#VBOData + 1] = i / numPoints -- index for lolz? end - pointVBO:Define( - numPoints, - VBOLayout - ) + pointVBO:Define(numPoints, VBOLayout) pointVBO:Upload(VBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, pointVBO:GetID(), name or "pointVBO") end return pointVBO, numPoints end -local function makeRectVBO(minX,minY, maxX, maxY, minU, minV, maxU, maxV, name) +local function makeRectVBO(minX, minY, maxX, maxY, minU, minV, maxU, maxV, name) if minX == nil then - minX, minY, maxX, maxY, minU, minV, maxU, maxV = 0,0,1,1,0,0,1,1 + minX, minY, maxX, maxY, minU, minV, maxU, maxV = 0, 0, 1, 1, 0, 0, 1, 1 end -- makes points with xyzw -- can be used in both GL.LINES and GL.TRIANGLE_FAN mode - local rectVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if rectVBO == nil then return nil end + local rectVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if rectVBO == nil then + return nil + end local VBOLayout = { - {id = 0, name = "position_xy_uv", size = 4}, + { id = 0, name = "position_xy_uv", size = 4 }, } local VBOData = { --bl - minX,minY, minU, minV, --bl - minX,maxY, minU, maxV, --tr - maxX,maxY, maxU, maxV, --tr - maxX,maxY, maxU, maxV, --tr - maxX,minY, maxU, minV, --br - minX,minY, minU, minV, --bl + minX, + minY, + minU, + minV, --bl + minX, + maxY, + minU, + maxV, --tr + maxX, + maxY, + maxU, + maxV, --tr + maxX, + maxY, + maxU, + maxV, --tr + maxX, + minY, + maxU, + minV, --br + minX, + minY, + minU, + minV, --bl } - rectVBO:Define( - 6, - VBOLayout - ) + rectVBO:Define(6, VBOLayout) rectVBO:Upload(VBOData) - + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, rectVBO:GetID(), name or "rectVBO") end @@ -968,247 +1035,352 @@ local function makeRectVBO(minX,minY, maxX, maxY, minU, minV, maxU, maxV, name) end local function makeRectIndexVBO(name) - local rectIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER,false) - if rectIndexVBO == nil then return nil end + local rectIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) + if rectIndexVBO == nil then + return nil + end - rectIndexVBO:Define( - 6 - ) - rectIndexVBO:Upload({0,1,2,3,4,5}) - if gldebugannotations then + rectIndexVBO:Define(6) + rectIndexVBO:Upload({ 0, 1, 2, 3, 4, 5 }) + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, rectIndexVBO:GetID(), name or "rectIndexVBO") end - return rectIndexVBO,6 + return rectIndexVBO, 6 end - - local function makeConeVBO(numSegments, height, radius, name) -- make a cone that points up, (y = height), with radius specified -- returns the VBO object, and the number of elements in it (usually == numvertices) -- needs GL.TRIANGLES - if not height then height = 1 end - if not radius then radius = 1 end - local coneVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if coneVBO == nil then return nil end + if not height then + height = 1 + end + if not radius then + radius = 1 + end + local coneVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if coneVBO == nil then + return nil + end local VBOData = {} for i = 1, numSegments do -- center vertex - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 1) / numSegments) * radius-- Y - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius-- X - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments -- top vertex - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius -- X - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 1) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 1) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments end - - coneVBO:Define(#VBOData/4, {{id = 0, name = "localpos_progress", size = 4}}) + coneVBO:Define(#VBOData / 4, { { id = 0, name = "localpos_progress", size = 4 } }) coneVBO:Upload(VBOData) - if gldebugannotations then + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, coneVBO:GetID(), name or "coneVBO") end - return coneVBO, #VBOData/4 + return coneVBO, #VBOData / 4 end - - local function makeCylinderVBO(numSegments, height, radius, hastop, hasbottom, name) -- make a cylinder that points up, (y = height), with radius specified -- returns the VBO object, and the number of elements in it (usually == numvertices) -- needs GL.TRIANGLES - if not height then height = 1 end - if not radius then radius = 1 end - local cylinderVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if cylinderVBO == nil then return nil end + if not height then + height = 1 + end + if not radius then + radius = 1 + end + local cylinderVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if cylinderVBO == nil then + return nil + end local VBOData = {} for i = 1, numSegments do if hasbottom then -- center vertex - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = -1* height - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = -1* height - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 1) / numSegments) * radius-- Y - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius-- X - VBOData[#VBOData+1] = -1* height - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments end - --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius -- X - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 1) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 1) / numSegments - - + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius -- X - VBOData[#VBOData+1] = -1 * height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 1) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 1) / numSegments - + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius -- X - VBOData[#VBOData+1] = -1 * height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments - + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = -1 * height - VBOData[#VBOData+1] = -1*math.cos(math.pi*2* (i - 1) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 1) / numSegments - - + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = -1 * height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments if hastop then -- center vertex - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = 0 - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = 0 + VBOData[#VBOData + 1] = (i - 1) / numSegments --- first cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 1) / numSegments) * radius -- X - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 1) / numSegments) * radius-- Y - VBOData[#VBOData+1] = (i - 1) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 1) / numSegments) * radius -- X + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 1) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 1) / numSegments --- second cone flat - VBOData[#VBOData+1] = math.sin(math.pi*2* (i - 0) / numSegments) * radius-- X - VBOData[#VBOData+1] = height - VBOData[#VBOData+1] = -1* math.cos(math.pi*2* (i - 0) / numSegments) * radius -- Y - VBOData[#VBOData+1] =(i - 0) / numSegments + VBOData[#VBOData + 1] = math.sin(math.pi * 2 * (i - 0) / numSegments) * radius -- X + VBOData[#VBOData + 1] = height + VBOData[#VBOData + 1] = -1 * math.cos(math.pi * 2 * (i - 0) / numSegments) * radius -- Y + VBOData[#VBOData + 1] = (i - 0) / numSegments end end - - cylinderVBO:Define(#VBOData/4, {{id = 0, name = "localpos_progress", size = 4}}) + cylinderVBO:Define(#VBOData / 4, { { id = 0, name = "localpos_progress", size = 4 } }) cylinderVBO:Upload(VBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, cylinderVBO:GetID(), name or "cylinderVBO") end - return cylinderVBO, #VBOData/4 + return cylinderVBO, #VBOData / 4 end - - local function makeBoxVBO(minX, minY, minZ, maxX, maxY, maxZ, name) -- make a box -- needs GL.TRIANGLES - local boxVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if boxVBO == nil then return nil end + local boxVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if boxVBO == nil then + return nil + end local VBOData = { - minX,minY,minZ,0 - ,minX,minY,maxZ,0 - ,minX,maxY,maxZ,0 - ,maxX,maxY,minZ,0 - ,minX,minY,minZ,0 - ,minX,maxY,minZ,0 - ,maxX,minY,maxZ,0 - ,minX,minY,minZ,0 - ,maxX,minY,minZ,0 - ,maxX,maxY,minZ,0 - ,maxX,minY,minZ,0 - ,minX,minY,minZ,0 - ,minX,minY,minZ,0 - ,minX,maxY,maxZ,0 - ,minX,maxY,minZ,0 - ,maxX,minY,maxZ,0 - ,minX,minY,maxZ,0 - ,minX,minY,minZ,0 - ,minX,maxY,maxZ,0 - ,minX,minY,maxZ,0 - ,maxX,minY,maxZ,0 - ,maxX,maxY,maxZ,0 - ,maxX,minY,minZ,0 - ,maxX,maxY,minZ,0 - ,maxX,minY,minZ,0 - ,maxX,maxY,maxZ,0 - ,maxX,minY,maxZ,0 - ,maxX,maxY,maxZ,0 - ,maxX,maxY,minZ,0 - ,minX,maxY,minZ,0 - ,maxX,maxY,maxZ,0 - ,minX,maxY,minZ,0 - ,minX,maxY,maxZ,0 - ,maxX,maxY,maxZ,0 - ,minX,maxY,maxZ,0 - ,maxX,minY,maxZ,0 + minX, + minY, + minZ, + 0, + minX, + minY, + maxZ, + 0, + minX, + maxY, + maxZ, + 0, + maxX, + maxY, + minZ, + 0, + minX, + minY, + minZ, + 0, + minX, + maxY, + minZ, + 0, + maxX, + minY, + maxZ, + 0, + minX, + minY, + minZ, + 0, + maxX, + minY, + minZ, + 0, + maxX, + maxY, + minZ, + 0, + maxX, + minY, + minZ, + 0, + minX, + minY, + minZ, + 0, + minX, + minY, + minZ, + 0, + minX, + maxY, + maxZ, + 0, + minX, + maxY, + minZ, + 0, + maxX, + minY, + maxZ, + 0, + minX, + minY, + maxZ, + 0, + minX, + minY, + minZ, + 0, + minX, + maxY, + maxZ, + 0, + minX, + minY, + maxZ, + 0, + maxX, + minY, + maxZ, + 0, + maxX, + maxY, + maxZ, + 0, + maxX, + minY, + minZ, + 0, + maxX, + maxY, + minZ, + 0, + maxX, + minY, + minZ, + 0, + maxX, + maxY, + maxZ, + 0, + maxX, + minY, + maxZ, + 0, + maxX, + maxY, + maxZ, + 0, + maxX, + maxY, + minZ, + 0, + minX, + maxY, + minZ, + 0, + maxX, + maxY, + maxZ, + 0, + minX, + maxY, + minZ, + 0, + minX, + maxY, + maxZ, + 0, + maxX, + maxY, + maxZ, + 0, + minX, + maxY, + maxZ, + 0, + maxX, + minY, + maxZ, + 0, } - boxVBO:Define(#VBOData/4, {{id = 0, name = "localpos_progress", size = 4}}) + boxVBO:Define(#VBOData / 4, { { id = 0, name = "localpos_progress", size = 4 } }) boxVBO:Upload(VBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, boxVBO:GetID(), name or "boxVBO") end - return boxVBO, #VBOData/4 + return boxVBO, #VBOData / 4 end - - ---Generate a sphere vertex VBO and the corresponding indexVBO ---The sphere is oriented in the Z direction ---Layout: @@ -1219,75 +1391,72 @@ end ---@param stackCount number how many horizontal slices along Z, usually less than sectorcount ---@param radius number how many elmos in radius, default 1 local function makeSphereVBO(sectorCount, stackCount, radius, name) -- http://www.songho.ca/opengl/gl_sphere.html - - - local sphereVBO = gl.GetVBO(GL.ARRAY_BUFFER,true) - if sphereVBO == nil then return nil end + local sphereVBO = gl.GetVBO(GL.ARRAY_BUFFER, true) + if sphereVBO == nil then + return nil + end local vertVBOLayout = { - {id = 0, name = "position", size = 4}, - {id = 1, name = "normals", size = 3}, - {id = 2, name = "uvs", size = 2}, + { id = 0, name = "position", size = 4 }, + { id = 1, name = "normals", size = 3 }, + { id = 2, name = "uvs", size = 2 }, } local VBOData = {} radius = radius or 1 - local x, y, z, xy; -- vertex position + local x, y, z, xy -- vertex position local nx, ny, nz - local lengthInv = 1.0 / radius; -- vertex normal - local s, t; -- vertex texCoord + local lengthInv = 1.0 / radius -- vertex normal + local s, t -- vertex texCoord - local sectorStep = 2 * math.pi / sectorCount; - local stackStep = math.pi / stackCount; - local sectorAngle, stackAngle; + local sectorStep = 2 * math.pi / sectorCount + local stackStep = math.pi / stackCount + local sectorAngle, stackAngle for i = 0, stackCount do - - stackAngle = math.pi / 2 - i * stackStep; -- starting from pi/2 to -pi/2 - xy = radius * math.cos(stackAngle); -- r * cos(u) - z = radius * math.sin(stackAngle); -- r * sin(u) + stackAngle = math.pi / 2 - i * stackStep -- starting from pi/2 to -pi/2 + xy = radius * math.cos(stackAngle) -- r * cos(u) + z = radius * math.sin(stackAngle) -- r * sin(u) -- add (sectorCount+1) vertices per stack -- the first and last vertices have same position and normal, but different tex coords for j = 0, sectorCount do -- for (int j = 0; j <= sectorCount; ++j) - - sectorAngle = j * sectorStep; -- starting from 0 to 2pi + sectorAngle = j * sectorStep -- starting from 0 to 2pi -- vertex position (x, y, z) - x = xy * math.cos(sectorAngle); -- r * cos(u) * cos(v) - y = xy * math.sin(sectorAngle); -- r * cos(u) * sin(v) - VBOData[#VBOData + 1] = x; - VBOData[#VBOData + 1] = y; - VBOData[#VBOData + 1] = z; - VBOData[#VBOData + 1] = sectorAngle; + x = xy * math.cos(sectorAngle) -- r * cos(u) * cos(v) + y = xy * math.sin(sectorAngle) -- r * cos(u) * sin(v) + VBOData[#VBOData + 1] = x + VBOData[#VBOData + 1] = y + VBOData[#VBOData + 1] = z + VBOData[#VBOData + 1] = sectorAngle --Spring.Echo(x,y,z) -- normalized vertex normal (nx, ny, nz) - nx = x * lengthInv; - ny = y * lengthInv; - nz = z * lengthInv; + nx = x * lengthInv + ny = y * lengthInv + nz = z * lengthInv - - VBOData[#VBOData + 1] = nx; - VBOData[#VBOData + 1] = ny; - VBOData[#VBOData + 1] = nz; + VBOData[#VBOData + 1] = nx + VBOData[#VBOData + 1] = ny + VBOData[#VBOData + 1] = nz -- vertex tex coord (s, t) range between [0, 1] - s = j / sectorCount; - t = i / stackCount; + s = j / sectorCount + t = i / stackCount - VBOData[#VBOData + 1] = s; - VBOData[#VBOData + 1] = t; + VBOData[#VBOData + 1] = s + VBOData[#VBOData + 1] = t end end - sphereVBO:Define(#VBOData/9, vertVBOLayout) + sphereVBO:Define(#VBOData / 9, vertVBOLayout) sphereVBO:Upload(VBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, sphereVBO:GetID(), name or "sphereVBO") end - local numVerts = #VBOData/9 + local numVerts = #VBOData / 9 - local sphereIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER,false) + local sphereIndexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) VBOData = {} -- generate CCW index list of sphere triangles @@ -1296,29 +1465,25 @@ local function makeSphereVBO(sectorCount, stackCount, radius, name) -- http://ww -- | / | -- k2--k2+1 local k1, k2 - for i = 0, stackCount-1 do -- for(int i = 0; i < stackCount; ++i) - - k1 = i * (sectorCount + 1) -- beginning of current stack - k2 = k1 + sectorCount + 1 -- beginning of next stack + for i = 0, stackCount - 1 do -- for(int i = 0; i < stackCount; ++i) + k1 = i * (sectorCount + 1) -- beginning of current stack + k2 = k1 + sectorCount + 1 -- beginning of next stack - for j = 0, sectorCount-1 do --for(int j = 0; j < sectorCount; ++j, ++k1, ++k2) + for j = 0, sectorCount - 1 do --for(int j = 0; j < sectorCount; ++j, ++k1, ++k2) -- Spring.Echo('indices', k1, k2) -- 2 triangles per sector excluding first and last stacks -- k1 => k2 => k1+1 if i ~= 0 then - VBOData[#VBOData + 1] = k1 VBOData[#VBOData + 1] = k2 VBOData[#VBOData + 1] = k1 + 1 end -- k1+1 => k2 => k2+1 - if i ~= (stackCount-1) then - + if i ~= (stackCount - 1) then VBOData[#VBOData + 1] = k1 + 1 VBOData[#VBOData + 1] = k2 VBOData[#VBOData + 1] = k2 + 1 - end k1 = k1 + 1 @@ -1326,47 +1491,66 @@ local function makeSphereVBO(sectorCount, stackCount, radius, name) -- http://ww end end - sphereIndexVBO:Define(#VBOData) sphereIndexVBO:Upload(VBOData) - - if gldebugannotations then + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, sphereIndexVBO:GetID(), name or "sphereIndexVBO") end return sphereVBO, numVerts, sphereIndexVBO, #VBOData end - -local function MakeTexRectVAO(minX,minY, maxX, maxY, minU, minV, maxU, maxV, name) +local function MakeTexRectVAO(minX, minY, maxX, maxY, minU, minV, maxU, maxV, name) -- Draw with myGL4TexRectVAO:DrawArrays(GL.TRIANGLES) - minX,minY,maxX,maxY,minU,minV,maxU,maxV = minX or -1,minY or -1,maxX or 1, maxY or 1, minU or 0, minV or 0, maxU or 1, maxV or 1 + minX, minY, maxX, maxY, minU, minV, maxU, maxV = minX or -1, minY or -1, maxX or 1, maxY or 1, minU or 0, minV or 0, maxU or 1, maxV or 1 local myGL4TexRectVAO - local rectVBO = gl.GetVBO(GL.ARRAY_BUFFER,false) - if rectVBO == nil then return nil end + local rectVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) + if rectVBO == nil then + return nil + end --rectVBO:Define( 6, {{id = 0, name = "position_xy_uv", size = 8}}) local z = 0.5 local w = 1 - rectVBO:Define( 6, {{id = 0, name = "pos", size = 4}}) + rectVBO:Define(6, { { id = 0, name = "pos", size = 4 } }) rectVBO:Upload({ - - minX,minY, minU, minV, --bl - maxX,maxY, maxU, maxV, --tr - minX,maxY, minU, maxV, --tl - maxX,maxY, maxU, maxV, --tr - minX,minY, minU, minV, --bl - maxX,minY, maxU, minV, --br - }) - - - if gldebugannotations then + + minX, + minY, + minU, + minV, --bl + maxX, + maxY, + maxU, + maxV, --tr + minX, + maxY, + minU, + maxV, --tl + maxX, + maxY, + maxU, + maxV, --tr + minX, + minY, + minU, + minV, --bl + maxX, + minY, + maxU, + minV, --br + }) + + if gldebugannotations then gl.ObjectLabel(GL_BUFFER, rectVBO:GetID(), name or "rectVBO") end - + myGL4TexRectVAO = gl.GetVAO() - if myGL4TexRectVAO == nil then return nil end + if myGL4TexRectVAO == nil then + return nil + end myGL4TexRectVAO:AttachVertexBuffer(rectVBO) return myGL4TexRectVAO end diff --git a/modules/graphics/r2thelper.lua b/modules/graphics/r2thelper.lua index d9b914c2902..03f306c5e18 100644 --- a/modules/graphics/r2thelper.lua +++ b/modules/graphics/r2thelper.lua @@ -52,7 +52,6 @@ local BlendTexRect = function(tex, x1, y1, x2, y2, customBlend) end end - local RenderInRect = function(tex, left, bottom, right, top, drawFn, customBlend, scissors) local w = right - left local h = top - bottom diff --git a/modules/i18n/i18n.lua b/modules/i18n/i18n.lua index 49195f1f1f3..d79c1a5b1f6 100644 --- a/modules/i18n/i18n.lua +++ b/modules/i18n/i18n.lua @@ -2,19 +2,19 @@ local currentDirectory = "modules/i18n/" I18N_PATH = currentDirectory .. "i18nlib/i18n/" -- I18N_PATH is expected to be global inside the i18n module local i18n = VFS.Include(I18N_PATH .. "init.lua", nil, VFS.ZIP) -local asianFont = 'fallbacks/SourceHanSans-Regular.ttc' -local translationDirs = VFS.SubDirs('language') +local asianFont = "fallbacks/SourceHanSans-Regular.ttc" +local translationDirs = VFS.SubDirs("language") -- map of languageCode -> map of translation key -> translation string local languageTranslations = {} local function loadTranslationTable(languageCode, currentContext, data) local composedKey - for k,v in pairs(data) do - composedKey = (currentContext and (currentContext .. '.') or "") .. tostring(k) - if type(v) == 'string' then + for k, v in pairs(data) do + composedKey = (currentContext and (currentContext .. ".") or "") .. tostring(k) + if type(v) == "string" then languageTranslations[languageCode][composedKey] = v - elseif type(v) == 'table' then + elseif type(v) == "table" then loadTranslationTable(languageCode, composedKey, v) end end @@ -22,8 +22,8 @@ end local function loadRmlTranslations(languageCode) RmlUi.ClearTranslations() - for k,v in pairs(languageTranslations[languageCode]) do - RmlUi.AddTranslationString('!!' .. k, v) + for k, v in pairs(languageTranslations[languageCode]) do + RmlUi.AddTranslationString("!!" .. k, v) end end @@ -31,8 +31,8 @@ end -- languageCode -> list of translation files associated with that language. local languageFiles = {} for _, languageDir in ipairs(translationDirs) do - local translationFiles = VFS.DirList(languageDir, '*.json') - local languageCode = table.remove( string.split(languageDir, '/') ) + local translationFiles = VFS.DirList(languageDir, "*.json") + local languageCode = table.remove(string.split(languageDir, "/")) languageFiles[languageCode] = translationFiles end @@ -65,7 +65,7 @@ local function ensureLanguageLoaded(languageCode) languageLoaded[languageCode] = true end -i18n.loadFile('language/test_unicode.lua') +i18n.loadFile("language/test_unicode.lua") i18n.languages = { en = "English", @@ -74,25 +74,27 @@ i18n.languages = { ru = "Русский", zh = "中文", es = "Español", - test_unicode = "test_unicode" + test_unicode = "test_unicode", } -- Some initialization routines requires english translations prior to the first -- i18n.setLanguage call. -ensureLanguageLoaded('en') +ensureLanguageLoaded("en") function i18n.setLanguage(language) ensureLanguageLoaded(language) i18n.setLocale(language) loadRmlTranslations(language) - if gl.AddFallbackFont then return end + if gl.AddFallbackFont then + return + end -- Font substitution is handled at the OS level, meaning we cannot control which fallback font is used -- Manually switching fonts is requred until Spring handles font substitution at the engine level -- LuaUI reload must be invoked for widgets to refresh all their font objects - local asianLanguage = language == 'zh' - local currentFont = Spring.GetConfigString('bar_font') + local asianLanguage = language == "zh" + local currentFont = Spring.GetConfigString("bar_font") if asianLanguage and currentFont ~= asianFont then Spring.SetConfigString("bar_font", asianFont) diff --git a/modules/i18n/i18nlib/i18n/init.lua b/modules/i18n/i18nlib/i18n/init.lua index ac61fe5d7f4..4fabea33ec8 100644 --- a/modules/i18n/i18nlib/i18n/init.lua +++ b/modules/i18n/i18nlib/i18n/init.lua @@ -3,217 +3,230 @@ local i18n = {} local store local locale local pluralizeFunction -local defaultLocale = 'en' +local defaultLocale = "en" local fallbackLocale = defaultLocale -- I18N_PATH is set globally -local plural = VFS.Include(I18N_PATH .. 'plural.lua') -local interpolate = VFS.Include(I18N_PATH .. 'interpolate.lua') -local variants = VFS.Include(I18N_PATH .. 'variants.lua') -local version = VFS.Include(I18N_PATH .. 'version.lua') +local plural = VFS.Include(I18N_PATH .. "plural.lua") +local interpolate = VFS.Include(I18N_PATH .. "interpolate.lua") +local variants = VFS.Include(I18N_PATH .. "variants.lua") +local version = VFS.Include(I18N_PATH .. "version.lua") i18n.plural, i18n.interpolate, i18n.variants, i18n.version, i18n._VERSION = plural, interpolate, variants, version, version - -- private stuff local function dotSplit(str) - local fields, length = {},0 - str:gsub("[^%.]+", function(c) - length = length + 1 - fields[length] = c - end) - return fields, length + local fields, length = {}, 0 + str:gsub("[^%.]+", function(c) + length = length + 1 + fields[length] = c + end) + return fields, length end local function isPluralTable(t) - return type(t) == 'table' and type(t.other) == 'string' + return type(t) == "table" and type(t.other) == "string" end local function isPresent(str) - return type(str) == 'string' and #str > 0 + return type(str) == "string" and #str > 0 end local function assertPresent(functionName, paramName, value) - if isPresent(value) then return end + if isPresent(value) then + return + end - local msg = "i18n.%s requires a non-empty string on its %s. Got %s (a %s value)." - error(msg:format(functionName, paramName, tostring(value), type(value))) + local msg = "i18n.%s requires a non-empty string on its %s. Got %s (a %s value)." + error(msg:format(functionName, paramName, tostring(value), type(value))) end local function assertPresentOrPlural(functionName, paramName, value) - if isPresent(value) or isPluralTable(value) then return end + if isPresent(value) or isPluralTable(value) then + return + end - local msg = "i18n.%s requires a non-empty string or plural-form table on its %s. Got %s (a %s value)." - error(msg:format(functionName, paramName, tostring(value), type(value))) + local msg = "i18n.%s requires a non-empty string or plural-form table on its %s. Got %s (a %s value)." + error(msg:format(functionName, paramName, tostring(value), type(value))) end local function assertPresentOrTable(functionName, paramName, value) - if isPresent(value) or type(value) == 'table' then return end + if isPresent(value) or type(value) == "table" then + return + end - local msg = "i18n.%s requires a non-empty string or table on its %s. Got %s (a %s value)." - error(msg:format(functionName, paramName, tostring(value), type(value))) + local msg = "i18n.%s requires a non-empty string or table on its %s. Got %s (a %s value)." + error(msg:format(functionName, paramName, tostring(value), type(value))) end local function assertFunctionOrNil(functionName, paramName, value) - if value == nil or type(value) == 'function' then return end + if value == nil or type(value) == "function" then + return + end - local msg = "i18n.%s requires a function (or nil) on param %s. Got %s (a %s value)." - error(msg:format(functionName, paramName, tostring(value), type(value))) + local msg = "i18n.%s requires a function (or nil) on param %s. Got %s (a %s value)." + error(msg:format(functionName, paramName, tostring(value), type(value))) end local function defaultPluralizeFunction(count) - return plural.get(variants.root(i18n.getLocale()), count) + return plural.get(variants.root(i18n.getLocale()), count) end local function pluralize(t, data) - assertPresentOrPlural('interpolatePluralTable', 't', t) - data = data or {} - local count = data.count or 1 - local plural_form = pluralizeFunction(count) - return t[plural_form] + assertPresentOrPlural("interpolatePluralTable", "t", t) + data = data or {} + local count = data.count or 1 + local plural_form = pluralizeFunction(count) + return t[plural_form] end local function treatNode(node, data) - if type(node) == 'string' then - return interpolate(node, data) - elseif isPluralTable(node) then - return interpolate(pluralize(node, data), data) - end - return node + if type(node) == "string" then + return interpolate(node, data) + elseif isPluralTable(node) then + return interpolate(pluralize(node, data), data) + end + return node end local function recursiveLoad(currentContext, data) - local composedKey - for k,v in pairs(data) do - composedKey = (currentContext and (currentContext .. '.') or "") .. tostring(k) - assertPresent('load', composedKey, k) - assertPresentOrTable('load', composedKey, v) - if type(v) == 'string' then - i18n.set(composedKey, v) - else - recursiveLoad(composedKey, v) - end - end + local composedKey + for k, v in pairs(data) do + composedKey = (currentContext and (currentContext .. ".") or "") .. tostring(k) + assertPresent("load", composedKey, k) + assertPresentOrTable("load", composedKey, v) + if type(v) == "string" then + i18n.set(composedKey, v) + else + recursiveLoad(composedKey, v) + end + end end local function localizedTranslate(key, locale, data) - local path, length = dotSplit(locale .. "." .. key) - local node = store + local path, length = dotSplit(locale .. "." .. key) + local node = store - for i=1, length do - node = node[path[i]] - if not node then return nil end - end + for i = 1, length do + node = node[path[i]] + if not node then + return nil + end + end - return treatNode(node, data) + return treatNode(node, data) end -- public interface function i18n.set(key, value) - assertPresent('set', 'key', key) - assertPresentOrPlural('set', 'value', value) + assertPresent("set", "key", key) + assertPresentOrPlural("set", "value", value) - local path, length = dotSplit(key) - local node = store + local path, length = dotSplit(key) + local node = store - for i=1, length-1 do - key = path[i] - node[key] = node[key] or {} - node = node[key] - end + for i = 1, length - 1 do + key = path[i] + node[key] = node[key] or {} + node = node[key] + end - local lastKey = path[length] - node[lastKey] = value + local lastKey = path[length] + node[lastKey] = value end local missingTranslations = {} function i18n.translate(key, data) - assertPresent('translate', 'key', key) - - data = data or {} - local usedLocale = data.locale or locale - - -- if user elected to use English unit names, force `en` locale when translating a unit name - if (Spring.GetConfigInt("language_english_unit_names", 1) == 1) and key:sub(1, #'units.names.') == 'units.names.' then - usedLocale = "en" - end - - local fallbacks = variants.fallbacks(usedLocale, fallbackLocale) - for i=1, #fallbacks do - local fallback = fallbacks[i] - local value = localizedTranslate(key, fallback, data) - if value then - return value - else - if missingTranslations[key] == nil then - missingTranslations[key] = { } - end - local missingTranslation = missingTranslations[key] - if not missingTranslation[fallback] and not (fallback == "en" and data.default) then - Spring.Log("i18n", "notice", "\"" .. key .. "\" is not translated in " .. fallback) - missingTranslation[fallback] = true - end - end - end - if missingTranslations[key] == nil then - missingTranslations[key] = { } - end - local missingTranslation = missingTranslations[key] - if not missingTranslation["_all"] and data.default == nil then - Spring.Log("i18n", "notice", "No translation found for \"" .. key .. "\"") - missingTranslation["_all"] = true - end - return data.default or key + assertPresent("translate", "key", key) + + data = data or {} + local usedLocale = data.locale or locale + + -- if user elected to use English unit names, force `en` locale when translating a unit name + if (Spring.GetConfigInt("language_english_unit_names", 1) == 1) and key:sub(1, #"units.names.") == "units.names." then + usedLocale = "en" + end + + local fallbacks = variants.fallbacks(usedLocale, fallbackLocale) + for i = 1, #fallbacks do + local fallback = fallbacks[i] + local value = localizedTranslate(key, fallback, data) + if value then + return value + else + if missingTranslations[key] == nil then + missingTranslations[key] = {} + end + local missingTranslation = missingTranslations[key] + if not missingTranslation[fallback] and not (fallback == "en" and data.default) then + Spring.Log("i18n", "notice", '"' .. key .. '" is not translated in ' .. fallback) + missingTranslation[fallback] = true + end + end + end + if missingTranslations[key] == nil then + missingTranslations[key] = {} + end + local missingTranslation = missingTranslations[key] + if not missingTranslation["_all"] and data.default == nil then + Spring.Log("i18n", "notice", 'No translation found for "' .. key .. '"') + missingTranslation["_all"] = true + end + return data.default or key end function i18n.setLocale(newLocale, newPluralizeFunction) - assertPresent('setLocale', 'newLocale', newLocale) - assertFunctionOrNil('setLocale', 'newPluralizeFunction', newPluralizeFunction) - locale = newLocale - pluralizeFunction = newPluralizeFunction or defaultPluralizeFunction + assertPresent("setLocale", "newLocale", newLocale) + assertFunctionOrNil("setLocale", "newPluralizeFunction", newPluralizeFunction) + locale = newLocale + pluralizeFunction = newPluralizeFunction or defaultPluralizeFunction end function i18n.setFallbackLocale(newFallbackLocale) - assertPresent('setFallbackLocale', 'newFallbackLocale', newFallbackLocale) - fallbackLocale = newFallbackLocale + assertPresent("setFallbackLocale", "newFallbackLocale", newFallbackLocale) + fallbackLocale = newFallbackLocale end function i18n.getFallbackLocale() - return fallbackLocale + return fallbackLocale end function i18n.getLocale() - return locale + return locale end function i18n.reset() - store = {} - plural.reset() - i18n.setLocale(defaultLocale) - i18n.setFallbackLocale(defaultLocale) + store = {} + plural.reset() + i18n.setLocale(defaultLocale) + i18n.setFallbackLocale(defaultLocale) end function i18n.load(data) - recursiveLoad(nil, data) + recursiveLoad(nil, data) end function i18n.loadFile(path) - local success, data = pcall(function() - local chunk = VFS.LoadFile(path, VFS.ZIP_FIRST) - x = assert(loadstring(chunk)) - return x() - end) - if not success then - Spring.Log("i18n", LOG.ERROR, "Failed to parse file " .. path .. ": ") - Spring.Log("i18n", LOG.ERROR, data) - return nil - end - i18n.load(data) -end - -setmetatable(i18n, {__call = function(_, ...) return i18n.translate(...) end}) + local success, data = pcall(function() + local chunk = VFS.LoadFile(path, VFS.ZIP_FIRST) + x = assert(loadstring(chunk)) + return x() + end) + if not success then + Spring.Log("i18n", LOG.ERROR, "Failed to parse file " .. path .. ": ") + Spring.Log("i18n", LOG.ERROR, data) + return nil + end + i18n.load(data) +end + +setmetatable(i18n, { + __call = function(_, ...) + return i18n.translate(...) + end, +}) i18n.reset() diff --git a/modules/i18n/i18nlib/i18n/interpolate.lua b/modules/i18n/i18nlib/i18n/interpolate.lua index 46352ca1a23..8737e2ba84e 100644 --- a/modules/i18n/i18nlib/i18n/interpolate.lua +++ b/modules/i18n/i18nlib/i18n/interpolate.lua @@ -1,55 +1,55 @@ - local unpack = unpack or table.unpack -- lua 5.2 compat local bracketDummy = "@@@@@@@@@{@@@@@@@@@" -local ltDummy = "@@@@@@@@@<@@@@@@@@@" +local ltDummy = "@@@@@@@@@<@@@@@@@@@" -- matches a string of type %{age} local function interpolateVariables(str, vars) - return str:gsub("%%{%s*(.-)%s*}", function(key) return tostring(vars[key]) end) + return str:gsub("%%{%s*(.-)%s*}", function(key) + return tostring(vars[key]) + end) end -- matches a string of type %.d local function interpolateFormattedVariables(str, vars) - return str:gsub("%%<%s*(.-)%s*>%.([cdEefgGiouXxsq])", function(key, formatChar) - return string.format("%" .. formatChar, vars[key] or 'nil') - end) + return str:gsub("%%<%s*(.-)%s*>%.([cdEefgGiouXxsq])", function(key, formatChar) + return string.format("%" .. formatChar, vars[key] or "nil") + end) end local function escapeDoublePercent(str) - return str:gsub("%%%%{", bracketDummy):gsub("%%%%<", ltDummy) + return str:gsub("%%%%{", bracketDummy):gsub("%%%%<", ltDummy) end local function unescapeDoublePercent(str) - return str:gsub(ltDummy, "%%<"):gsub(bracketDummy, "%%{") + return str:gsub(ltDummy, "%%<"):gsub(bracketDummy, "%%{") end -- formats remaining positional placeholders (%s, %d, %5d, ...); unconsumed args and lone % render raw instead of crashing local function interpolatePositionalVariables(str, vars) - if str:find('%%') and not str:find('%%{') and not str:find('%%<') then - local scan = str:gsub('%%%%', '') - local _, percentCount = scan:gsub('%%[%-%d%.]*%a', '') - local args = {} - for i = 1, percentCount do - args[i] = vars[i] or vars[tostring(i)] or 'nil' - end - local ok, formatted = pcall(string.format, str, unpack(args)) - if ok then - str = formatted - end - end - return str + if str:find("%%") and not str:find("%%{") and not str:find("%%<") then + local scan = str:gsub("%%%%", "") + local _, percentCount = scan:gsub("%%[%-%d%.]*%a", "") + local args = {} + for i = 1, percentCount do + args[i] = vars[i] or vars[tostring(i)] or "nil" + end + local ok, formatted = pcall(string.format, str, unpack(args)) + if ok then + str = formatted + end + end + return str end - local function interpolate(str, vars) - vars = vars or {} - str = escapeDoublePercent(str) - str = interpolateVariables(str, vars) - str = interpolateFormattedVariables(str, vars) - str = interpolatePositionalVariables(str, vars) - str = unescapeDoublePercent(str) - return str + vars = vars or {} + str = escapeDoublePercent(str) + str = interpolateVariables(str, vars) + str = interpolateFormattedVariables(str, vars) + str = interpolatePositionalVariables(str, vars) + str = unescapeDoublePercent(str) + return str end return interpolate diff --git a/modules/i18n/i18nlib/i18n/plural.lua b/modules/i18n/i18nlib/i18n/plural.lua index 5d5d6b5b94d..a55a630e6dc 100644 --- a/modules/i18n/i18nlib/i18n/plural.lua +++ b/modules/i18n/i18nlib/i18n/plural.lua @@ -3,51 +3,52 @@ local defaultFunction = nil -- helper functions local function assertPresentString(functionName, paramName, value) - if type(value) ~= 'string' or #value == 0 then - local msg = "Expected param %s of function %s to be a string, but got %s (a value of type %s) instead" - error(msg:format(paramName, functionName, tostring(value), type(value))) - end + if type(value) ~= "string" or #value == 0 then + local msg = "Expected param %s of function %s to be a string, but got %s (a value of type %s) instead" + error(msg:format(paramName, functionName, tostring(value), type(value))) + end end local function assertNumber(functionName, paramName, value) - if type(value) ~= 'number' then - local msg = "Expected param %s of function %s to be a number, but got %s (a value of type %s) instead" - error(msg:format(paramName, functionName, tostring(value), type(value))) - end + if type(value) ~= "number" then + local msg = "Expected param %s of function %s to be a number, but got %s (a value of type %s) instead" + error(msg:format(paramName, functionName, tostring(value), type(value))) + end end -- transforms "foo bar baz" into {'foo','bar','baz'} local function words(str) - local result, length = {}, 0 - str:gsub("%S+", function(word) - length = length + 1 - result[length] = word - end) - return result + local result, length = {}, 0 + str:gsub("%S+", function(word) + length = length + 1 + result[length] = word + end) + return result end local function isInteger(n) - return n == math.floor(n) + return n == math.floor(n) end local function between(value, min, max) - return value >= min and value <= max + return value >= min and value <= max end local function inside(v, list) - for i=1, #list do - if v == list[i] then return true end - end - return false + for i = 1, #list do + if v == list[i] then + return true + end + end + return false end - -- pluralization functions local pluralization = {} local f1 = function(n) - return n == 1 and "one" or "other" + return n == 1 and "one" or "other" end pluralization[f1] = words([[ af asa bem bez bg bn brx ca cgg chr da de dv ee el @@ -59,23 +60,20 @@ pluralization[f1] = words([[ ]]) local f2 = function(n) - return (n == 0 or n == 1) and "one" or "other" + return (n == 0 or n == 1) and "one" or "other" end pluralization[f2] = words("ak am bh fil guw hi ln mg nso ti tl wa") local f3 = function(n) - if not isInteger(n) then return 'other' end - return (n == 0 and "zero") or - (n == 1 and "one") or - (n == 2 and "two") or - (between(n % 100, 3, 10) and "few") or - (between(n % 100, 11, 99) and "many") or - "other" + if not isInteger(n) then + return "other" + end + return (n == 0 and "zero") or (n == 1 and "one") or (n == 2 and "two") or (between(n % 100, 3, 10) and "few") or (between(n % 100, 11, 99) and "many") or "other" end -pluralization[f3] = {'ar'} +pluralization[f3] = { "ar" } local f4 = function(n) - return "other" + return "other" end pluralization[f4] = words([[ az bm bo dz fa hu id ig ii ja jv ka kde kea km kn @@ -83,196 +81,161 @@ pluralization[f4] = words([[ ]]) local f5 = function(n) - if not isInteger(n) then return 'other' end - local n_10, n_100 = n % 10, n % 100 - return (n_10 == 1 and n_100 ~= 11 and 'one') or - (between(n_10, 2, 4) and not between(n_100, 12, 14) and 'few') or - ((n_10 == 0 or between(n_10, 5, 9) or between(n_100, 11, 14)) and 'many') or - 'other' + if not isInteger(n) then + return "other" + end + local n_10, n_100 = n % 10, n % 100 + return (n_10 == 1 and n_100 ~= 11 and "one") or (between(n_10, 2, 4) and not between(n_100, 12, 14) and "few") or ((n_10 == 0 or between(n_10, 5, 9) or between(n_100, 11, 14)) and "many") or "other" end -pluralization[f5] = words('be bs hr ru sh sr uk') +pluralization[f5] = words("be bs hr ru sh sr uk") local f6 = function(n) - if not isInteger(n) then return 'other' end - local n_10, n_100 = n % 10, n % 100 - return (n_10 == 1 and not inside(n_100, {11,71,91}) and 'one') or - (n_10 == 2 and not inside(n_100, {12,72,92}) and 'two') or - (inside(n_10, {3,4,9}) and - not between(n_100, 10, 19) and - not between(n_100, 70, 79) and - not between(n_100, 90, 99) - and 'few') or - (n ~= 0 and n % 1000000 == 0 and 'many') or - 'other' -end -pluralization[f6] = {'br'} + if not isInteger(n) then + return "other" + end + local n_10, n_100 = n % 10, n % 100 + return (n_10 == 1 and not inside(n_100, { 11, 71, 91 }) and "one") or (n_10 == 2 and not inside(n_100, { 12, 72, 92 }) and "two") or (inside(n_10, { 3, 4, 9 }) and not between(n_100, 10, 19) and not between(n_100, 70, 79) and not between(n_100, 90, 99) and "few") or (n ~= 0 and n % 1000000 == 0 and "many") or "other" +end +pluralization[f6] = { "br" } local f7 = function(n) - return (n == 1 and 'one') or - ((n == 2 or n == 3 or n == 4) and 'few') or - 'other' + return (n == 1 and "one") or ((n == 2 or n == 3 or n == 4) and "few") or "other" end -pluralization[f7] = {'cz', 'sk'} +pluralization[f7] = { "cz", "sk" } local f8 = function(n) - return (n == 0 and 'zero') or - (n == 1 and 'one') or - (n == 2 and 'two') or - (n == 3 and 'few') or - (n == 6 and 'many') or - 'other' + return (n == 0 and "zero") or (n == 1 and "one") or (n == 2 and "two") or (n == 3 and "few") or (n == 6 and "many") or "other" end -pluralization[f8] = {'cy'} +pluralization[f8] = { "cy" } local f9 = function(n) - return (n >= 0 and n < 2 and 'one') or - 'other' + return (n >= 0 and n < 2 and "one") or "other" end -pluralization[f9] = {'ff', 'fr', 'kab'} +pluralization[f9] = { "ff", "fr", "kab" } local f10 = function(n) - return (n == 1 and 'one') or - (n == 2 and 'two') or - ((n == 3 or n == 4 or n == 5 or n == 6) and 'few') or - ((n == 7 or n == 8 or n == 9 or n == 10) and 'many') or - 'other' + return (n == 1 and "one") or (n == 2 and "two") or ((n == 3 or n == 4 or n == 5 or n == 6) and "few") or ((n == 7 or n == 8 or n == 9 or n == 10) and "many") or "other" end -pluralization[f10] = {'ga'} +pluralization[f10] = { "ga" } local f11 = function(n) - return ((n == 1 or n == 11) and 'one') or - ((n == 2 or n == 12) and 'two') or - (isInteger(n) and (between(n, 3, 10) or between(n, 13, 19)) and 'few') or - 'other' + return ((n == 1 or n == 11) and "one") or ((n == 2 or n == 12) and "two") or (isInteger(n) and (between(n, 3, 10) or between(n, 13, 19)) and "few") or "other" end -pluralization[f11] = {'gd'} +pluralization[f11] = { "gd" } local f12 = function(n) - local n_10 = n % 10 - return ((n_10 == 1 or n_10 == 2 or n % 20 == 0) and 'one') or - 'other' + local n_10 = n % 10 + return ((n_10 == 1 or n_10 == 2 or n % 20 == 0) and "one") or "other" end -pluralization[f12] = {'gv'} +pluralization[f12] = { "gv" } local f13 = function(n) - return (n == 1 and 'one') or - (n == 2 and 'two') or - 'other' + return (n == 1 and "one") or (n == 2 and "two") or "other" end -pluralization[f13] = words('iu kw naq se sma smi smj smn sms') +pluralization[f13] = words("iu kw naq se sma smi smj smn sms") local f14 = function(n) - return (n == 0 and 'zero') or - (n == 1 and 'one') or - 'other' + return (n == 0 and "zero") or (n == 1 and "one") or "other" end -pluralization[f14] = {'ksh'} +pluralization[f14] = { "ksh" } local f15 = function(n) - return (n == 0 and 'zero') or - (n > 0 and n < 2 and 'one') or - 'other' + return (n == 0 and "zero") or (n > 0 and n < 2 and "one") or "other" end -pluralization[f15] = {'lag'} +pluralization[f15] = { "lag" } local f16 = function(n) - if not isInteger(n) then return 'other' end - if between(n % 100, 11, 19) then return 'other' end - local n_10 = n % 10 - return (n_10 == 1 and 'one') or - (between(n_10, 2, 9) and 'few') or - 'other' + if not isInteger(n) then + return "other" + end + if between(n % 100, 11, 19) then + return "other" + end + local n_10 = n % 10 + return (n_10 == 1 and "one") or (between(n_10, 2, 9) and "few") or "other" end -pluralization[f16] = {'lt'} +pluralization[f16] = { "lt" } local f17 = function(n) - return (n == 0 and 'zero') or - ((n % 10 == 1 and n % 100 ~= 11) and 'one') or - 'other' + return (n == 0 and "zero") or ((n % 10 == 1 and n % 100 ~= 11) and "one") or "other" end -pluralization[f17] = {'lv'} +pluralization[f17] = { "lv" } local f18 = function(n) - return((n % 10 == 1 and n ~= 11) and 'one') or - 'other' + return ((n % 10 == 1 and n ~= 11) and "one") or "other" end -pluralization[f18] = {'mk'} +pluralization[f18] = { "mk" } local f19 = function(n) - return (n == 1 and 'one') or - ((n == 0 or - (n ~= 1 and isInteger(n) and between(n % 100, 1, 19))) - and 'few') or - 'other' + return (n == 1 and "one") or ((n == 0 or (n ~= 1 and isInteger(n) and between(n % 100, 1, 19))) and "few") or "other" end -pluralization[f19] = {'mo', 'ro'} +pluralization[f19] = { "mo", "ro" } local f20 = function(n) - if n == 1 then return 'one' end - if not isInteger(n) then return 'other' end - local n_100 = n % 100 - return ((n == 0 or between(n_100, 2, 10)) and 'few') or - (between(n_100, 11, 19) and 'many') or - 'other' + if n == 1 then + return "one" + end + if not isInteger(n) then + return "other" + end + local n_100 = n % 100 + return ((n == 0 or between(n_100, 2, 10)) and "few") or (between(n_100, 11, 19) and "many") or "other" end -pluralization[f20] = {'mt'} +pluralization[f20] = { "mt" } local f21 = function(n) - if n == 1 then return 'one' end - if not isInteger(n) then return 'other' end - local n_10, n_100 = n % 10, n % 100 + if n == 1 then + return "one" + end + if not isInteger(n) then + return "other" + end + local n_10, n_100 = n % 10, n % 100 - return ((between(n_10, 2, 4) and not between(n_100, 12, 14)) and 'few') or - ((n_10 == 0 or n_10 == 1 or between(n_10, 5, 9) or between(n_100, 12, 14)) and 'many') or - 'other' + return ((between(n_10, 2, 4) and not between(n_100, 12, 14)) and "few") or ((n_10 == 0 or n_10 == 1 or between(n_10, 5, 9) or between(n_100, 12, 14)) and "many") or "other" end -pluralization[f21] = {'pl'} +pluralization[f21] = { "pl" } local f22 = function(n) - return (n == 0 or n == 1) and 'one' or - 'other' + return (n == 0 or n == 1) and "one" or "other" end -pluralization[f22] = {'shi'} +pluralization[f22] = { "shi" } local f23 = function(n) - local n_100 = n % 100 - return (n_100 == 1 and 'one') or - (n_100 == 2 and 'two') or - ((n_100 == 3 or n_100 == 4) and 'few') or - 'other' + local n_100 = n % 100 + return (n_100 == 1 and "one") or (n_100 == 2 and "two") or ((n_100 == 3 or n_100 == 4) and "few") or "other" end -pluralization[f23] = {'sl'} +pluralization[f23] = { "sl" } local f24 = function(n) - return (isInteger(n) and (n == 0 or n == 1 or between(n, 11, 99)) and 'one') - or 'other' + return (isInteger(n) and (n == 0 or n == 1 or between(n, 11, 99)) and "one") or "other" end -pluralization[f24] = {'tzm'} +pluralization[f24] = { "tzm" } local pluralizationFunctions = {} -for f,locales in pairs(pluralization) do - for _,locale in ipairs(locales) do - pluralizationFunctions[locale] = f - end +for f, locales in pairs(pluralization) do + for _, locale in ipairs(locales) do + pluralizationFunctions[locale] = f + end end -- public interface function plural.get(locale, n) - assertPresentString('i18n.plural.get', 'locale', locale) - assertNumber('i18n.plural.get', 'n', n) + assertPresentString("i18n.plural.get", "locale", locale) + assertNumber("i18n.plural.get", "n", n) - local f = pluralizationFunctions[locale] or defaultFunction + local f = pluralizationFunctions[locale] or defaultFunction - return f(math.abs(n)) + return f(math.abs(n)) end function plural.setDefaultFunction(f) - defaultFunction = f + defaultFunction = f end function plural.reset() - defaultFunction = pluralizationFunctions['en'] + defaultFunction = pluralizationFunctions["en"] end plural.reset() diff --git a/modules/i18n/i18nlib/i18n/variants.lua b/modules/i18n/i18nlib/i18n/variants.lua index 0cfad42f6c1..4e0d36b285d 100644 --- a/modules/i18n/i18nlib/i18n/variants.lua +++ b/modules/i18n/i18nlib/i18n/variants.lua @@ -1,49 +1,50 @@ local variants = {} local function reverse(arr, length) - local result = {} - for i=1, length do result[i] = arr[length-i+1] end - return result, length + local result = {} + for i = 1, length do + result[i] = arr[length - i + 1] + end + return result, length end local function concat(arr1, len1, arr2, len2) - for i = 1, len2 do - arr1[len1 + i] = arr2[i] - end - return arr1, len1 + len2 + for i = 1, len2 do + arr1[len1 + i] = arr2[i] + end + return arr1, len1 + len2 end function variants.ancestry(locale) - local result, length, accum = {},0,nil - locale:gsub("[^%-]+", function(c) - length = length + 1 - accum = accum and (accum .. '-' .. c) or c - result[length] = accum - end) - return reverse(result, length) + local result, length, accum = {}, 0, nil + locale:gsub("[^%-]+", function(c) + length = length + 1 + accum = accum and (accum .. "-" .. c) or c + result[length] = accum + end) + return reverse(result, length) end function variants.isParent(parent, child) - return not not child:match("^".. parent .. "%-") + return not not child:match("^" .. parent .. "%-") end function variants.root(locale) - return locale:match("[^%-]+") + return locale:match("[^%-]+") end function variants.fallbacks(locale, fallbackLocale) - if locale == fallbackLocale or - variants.isParent(fallbackLocale, locale) then - return variants.ancestry(locale) - end - if variants.isParent(locale, fallbackLocale) then - return variants.ancestry(fallbackLocale) - end - - local ancestry1, length1 = variants.ancestry(locale) - local ancestry2, length2 = variants.ancestry(fallbackLocale) - - return concat(ancestry1, length1, ancestry2, length2) + if locale == fallbackLocale or variants.isParent(fallbackLocale, locale) then + return variants.ancestry(locale) + end + if variants.isParent(locale, fallbackLocale) then + return variants.ancestry(fallbackLocale) + end + + local ancestry1, length1 = variants.ancestry(locale) + local ancestry2, length2 = variants.ancestry(fallbackLocale) + + return concat(ancestry1, length1, ancestry2, length2) end return variants diff --git a/modules/i18n/i18nlib/i18n/version.lua b/modules/i18n/i18nlib/i18n/version.lua index 6fdce1bddf7..777f79583ae 100644 --- a/modules/i18n/i18nlib/i18n/version.lua +++ b/modules/i18n/i18nlib/i18n/version.lua @@ -1 +1 @@ -return '0.9.0' +return "0.9.0" diff --git a/modules/i18n/i18nlib/spec/assert_same.lua b/modules/i18n/i18nlib/spec/assert_same.lua index 0bc02d88ded..3456d5f9b25 100644 --- a/modules/i18n/i18nlib/spec/assert_same.lua +++ b/modules/i18n/i18nlib/spec/assert_same.lua @@ -1,17 +1,23 @@ -local telescope = require 'telescope' +local telescope = require("telescope") local function same(t1, t2) - if type(t1) ~= 'table' or type(t2) ~= 'table' then return t1 == t2 end + if type(t1) ~= "table" or type(t2) ~= "table" then + return t1 == t2 + end - for k,v in pairs(t1) do - if not same(v, t2[k]) then return false end - end + for k, v in pairs(t1) do + if not same(v, t2[k]) then + return false + end + end - for k,v in pairs(t2) do - if not same(v, t1[k]) then return false end - end + for k, v in pairs(t2) do + if not same(v, t1[k]) then + return false + end + end - return true + return true end telescope.make_assertion("same", "%s to be identical to %s", same) diff --git a/modules/i18n/i18nlib/spec/en.lua b/modules/i18n/i18nlib/spec/en.lua index 376daad4305..4e2e94d165f 100644 --- a/modules/i18n/i18nlib/spec/en.lua +++ b/modules/i18n/i18nlib/spec/en.lua @@ -1,6 +1,6 @@ return { - en = { - hello = 'Hello!', - balance = 'Your account balance is %{value}.' - } + en = { + hello = "Hello!", + balance = "Your account balance is %{value}.", + }, } diff --git a/modules/i18n/i18nlib/spec/fixPackagePath.lua b/modules/i18n/i18nlib/spec/fixPackagePath.lua index 9e4dc09a806..2a2710cf1fb 100644 --- a/modules/i18n/i18nlib/spec/fixPackagePath.lua +++ b/modules/i18n/i18nlib/spec/fixPackagePath.lua @@ -1 +1 @@ -package.path = package.path .. ';./?/init.lua' +package.path = package.path .. ";./?/init.lua" diff --git a/modules/i18n/i18nlib/spec/i18n_interpolate_spec.lua b/modules/i18n/i18nlib/spec/i18n_interpolate_spec.lua index 0ce1f273a1e..265fef9526f 100644 --- a/modules/i18n/i18nlib/spec/i18n_interpolate_spec.lua +++ b/modules/i18n/i18nlib/spec/i18n_interpolate_spec.lua @@ -1,61 +1,60 @@ -require 'spec.fixPackagePath' - -local interpolate = require 'i18n.interpolate' - -describe('i18n.interpolate', function() - it("exists", function() - assert_equal('function', type(interpolate)) - end) - - it("performs standard interpolation via string.format", function() - assert_equal("My name is John, I am 13", interpolate("My name is %s, I am %d", {"John", 13})) - end) - - describe("When interpolating with hash values", function() - - it("converts non-existing items in nil values without error", function() - assert_equal("Nil = nil", interpolate("Nil = %{null}")) - end) - - it("converts variables in stringifield values", function() - assert_equal("My name is John, I am 13", interpolate("My name is %{name}, I am %{age}", {name = "John", age = 13})) - end) - - it("ignores spaces inside the brackets", function() - assert_equal("My name is John, I am 13", interpolate("My name is %{ name }, I am %{ age }", {name = "John", age = 13})) - end) - - it("is escaped via double %%", function() - assert_equal("I am a %{blue} robot.", interpolate("I am a %%{blue} robot.")) - end) - - end) - - describe("When interpolating with hash values and formats", function() - it("converts non-existing items in nil values without error", function() - assert_equal("Nil = nil", interpolate("Nil = %.s")) - end) - - it("converts variables in stringifield values", function() - assert_equal("My name is John, I am 13", interpolate("My name is %.s, I am %.d", {name = "John", age = 13})) - end) - - it("ignores spaces inside the brackets", function() - assert_equal("My name is John, I am 13", interpolate("My name is %< name >.s, I am %< age >.d", {name = "John", age = 13})) - end) - - it("is escaped via double %%", function() - assert_equal("I am a %.s robot.", interpolate("I am a %%.s robot.")) - end) - end) - - it("Interpolates everything at the same time", function() - assert_equal('A nil ref and %.d and spaced and "quoted" and something', - interpolate("A %{null} ref and %%.d and %{ spaced } and %.q and %s", { - "something", - spaced = "spaced", - quoted = "quoted" - }) - ) - end) +require("spec.fixPackagePath") + +local interpolate = require("i18n.interpolate") + +describe("i18n.interpolate", function() + it("exists", function() + assert_equal("function", type(interpolate)) + end) + + it("performs standard interpolation via string.format", function() + assert_equal("My name is John, I am 13", interpolate("My name is %s, I am %d", { "John", 13 })) + end) + + describe("When interpolating with hash values", function() + it("converts non-existing items in nil values without error", function() + assert_equal("Nil = nil", interpolate("Nil = %{null}")) + end) + + it("converts variables in stringifield values", function() + assert_equal("My name is John, I am 13", interpolate("My name is %{name}, I am %{age}", { name = "John", age = 13 })) + end) + + it("ignores spaces inside the brackets", function() + assert_equal("My name is John, I am 13", interpolate("My name is %{ name }, I am %{ age }", { name = "John", age = 13 })) + end) + + it("is escaped via double %%", function() + assert_equal("I am a %{blue} robot.", interpolate("I am a %%{blue} robot.")) + end) + end) + + describe("When interpolating with hash values and formats", function() + it("converts non-existing items in nil values without error", function() + assert_equal("Nil = nil", interpolate("Nil = %.s")) + end) + + it("converts variables in stringifield values", function() + assert_equal("My name is John, I am 13", interpolate("My name is %.s, I am %.d", { name = "John", age = 13 })) + end) + + it("ignores spaces inside the brackets", function() + assert_equal("My name is John, I am 13", interpolate("My name is %< name >.s, I am %< age >.d", { name = "John", age = 13 })) + end) + + it("is escaped via double %%", function() + assert_equal("I am a %.s robot.", interpolate("I am a %%.s robot.")) + end) + end) + + it("Interpolates everything at the same time", function() + assert_equal( + 'A nil ref and %.d and spaced and "quoted" and something', + interpolate("A %{null} ref and %%.d and %{ spaced } and %.q and %s", { + "something", + spaced = "spaced", + quoted = "quoted", + }) + ) + end) end) diff --git a/modules/i18n/i18nlib/spec/i18n_plural_spec.lua b/modules/i18n/i18nlib/spec/i18n_plural_spec.lua index 3adc898094c..a7fbb690e5b 100644 --- a/modules/i18n/i18nlib/spec/i18n_plural_spec.lua +++ b/modules/i18n/i18nlib/spec/i18n_plural_spec.lua @@ -1,232 +1,246 @@ -require 'spec.fixPackagePath' - -local plural = require 'i18n.plural' - -describe('i18n.plural', function() - before(plural.reset) - - it("exists", function() - assert_equal('table', type(plural)) - end) - - describe('plural.get', function() - - local function test_get(title, locales, plural_forms) - locales = type(locales) == 'table' and locales or {locales} - - describe(title, function() - for _,locale in ipairs(locales) do - for plural_form, numbers in pairs(plural_forms) do - numbers = type(numbers) == 'table' and numbers or {numbers} - for _,n in ipairs(numbers) do - it(('%s translates %s into %q'):format(locale, n, plural_form), function() - assert_equal(plural.get(locale, n), plural_form) - assert_equal(plural.get(locale, -n), plural_form) - end) - end - end - end - end) - end - - local function words(str) - local result, length = {}, 0 - str:gsub("%S+", function(word) - length = length + 1 - result[length] = word - end) - return result - end - - it('throws an error with the wrong parameters', function() - assert_error(function() plural.get() end) - assert_error(function() plural.get(1,1) end) - assert_error(function() plural.get('en', 'en') end) - end) - - - test_get('f1', words([[ +require("spec.fixPackagePath") + +local plural = require("i18n.plural") + +describe("i18n.plural", function() + before(plural.reset) + + it("exists", function() + assert_equal("table", type(plural)) + end) + + describe("plural.get", function() + local function test_get(title, locales, plural_forms) + locales = type(locales) == "table" and locales or { locales } + + describe(title, function() + for _, locale in ipairs(locales) do + for plural_form, numbers in pairs(plural_forms) do + numbers = type(numbers) == "table" and numbers or { numbers } + for _, n in ipairs(numbers) do + it(("%s translates %s into %q"):format(locale, n, plural_form), function() + assert_equal(plural.get(locale, n), plural_form) + assert_equal(plural.get(locale, -n), plural_form) + end) + end + end + end + end) + end + + local function words(str) + local result, length = {}, 0 + str:gsub("%S+", function(word) + length = length + 1 + result[length] = word + end) + return result + end + + it("throws an error with the wrong parameters", function() + assert_error(function() + plural.get() + end) + assert_error(function() + plural.get(1, 1) + end) + assert_error(function() + plural.get("en", "en") + end) + end) + + test_get( + "f1", + words([[ af asa bem bez bg bn brx ca cgg chr da de dv ee el en eo es et eu fi fo fur fy gl gsw gu ha haw he is it jmc kaj kcg kk kl ksb ku lb lg mas ml mn mr nah nb nd ne nl nn no nr ny nyn om or pa pap ps pt rm rof rwk saq seh sn so sq ss ssy st sv sw syr ta te teo tig tk tn ts ur ve vun wae xh xog zu - ]]), { - one = 1, - other = {0, 2, 999, 0.5, 1.2, 2.07} - }) - - test_get('f2', words("ak am bh fil guw hi ln mg nso ti tl wa"), { - one = {0, 1}, - other = {2, 999, 1.2, 2.07} - }) - - test_get('f3', 'ar', { - zero = 0, - one = 1, - two = 2, - few = {3, 10, 103, 110, 203, 210}, - many = {11, 99, 111, 199}, - other = {100, 102, 200, 202, 0.2, 1.07, 3.81} - }) - - test_get('f4', words([[ + ]]), + { + one = 1, + other = { 0, 2, 999, 0.5, 1.2, 2.07 }, + } + ) + + test_get("f2", words("ak am bh fil guw hi ln mg nso ti tl wa"), { + one = { 0, 1 }, + other = { 2, 999, 1.2, 2.07 }, + }) + + test_get("f3", "ar", { + zero = 0, + one = 1, + two = 2, + few = { 3, 10, 103, 110, 203, 210 }, + many = { 11, 99, 111, 199 }, + other = { 100, 102, 200, 202, 0.2, 1.07, 3.81 }, + }) + + test_get( + "f4", + words([[ az bm bo dz fa hu id ig ii ja jv ka kde kea km kn ko lo ms my root sah ses sg th to tr vi wo yo zh - ]]), { - other = {0 , 1, 1000, 0.5} - }) - - test_get('f5', words("be bs hr ru sh sr uk"), { - one = {1, 21, 31, 41, 51}, - few = {2,4, 22, 24, 32, 34}, - many = {0, 5, 20, 25, 30, 35, 40}, - other = {1.2, 2.07} - }) - - test_get('f6', 'br', { - one = {1, 21, 31, 41, 51}, - two = {2, 22, 32, 42, 52}, - few = {3, 4, 9, 23, 24, 29}, - many = {1000000, 100000000}, - other = {0, 5, 8, 10, 20, 25, 28, 1.2, 2.07} - }) - - test_get('f7', {'cz','sk'}, { - one = 1, - few = {2, 3, 4}, - other = {0, 5, 8, 10, 1.2, 2.07} - }) - - test_get('f8', 'cy', { - zero = 0, - one = 1, - two = 2, - few = 3, - many = 6, - other = {4, 5, 7, 10, 101, 0.2, 1.07, 3.81} - }) - - test_get('f9', {'ff', 'fr', 'kab'}, { - one = {0, 0.1, 0.5, 1, 1.5, 1.8}, - other = {2, 3, 10, 20, 2.07} - }) - - test_get('f10', 'ga', { - one = 1, - two = 2, - few = {3, 4, 5, 6}, - many = {7, 8, 9, 10}, - other = {0, 11, 12, 20, 25, 100, 1.2, 2.07 } - }) - - test_get('f11', 'gd', { - one = {1, 11}, - two = {2, 12}, - few = {3, 10, 13, 19}, - other = {0, 20, 100, 1.2, 2.07} - }) - - test_get('f12', 'gv', { - one = {0, 1, 2, 11, 12, 20, 21, 22}, - other = {3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 1.5} - }) - - test_get('f13', words('iu kw naq se sma smi smj smn sms'), { - one = 1, - two = 2, - other = {0, 3, 10, 1.2, 2.07} - }) - - test_get('f14', 'ksh', { - zero = 0, - one = 1, - other = {2, 3, 5, 10, 100, 2.3, 1.07} - }) - - test_get('f15', 'lag', { - zero = 0, - one = {0.5, 1, 1.5, 1.97}, - other = {2, 3, 10, 100, 2.10} - }) - - test_get('f16', 'lt', { - one = {1, 21, 31, 41, 51, 61}, - few = {2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24}, - other = {0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 1.5, 2.07} - }) - - test_get('f17', 'lv', { - zero = 0, - one = {1, 21, 31, 41, 51, 61}, - other = {2, 5, 10, 15, 20, 22, 23, 30, 32, 33, 40, 0.2, 2.07} - }) - - test_get('f18', 'mk', { - one = {1, 21, 31, 41, 51, 61}, - other = {0, 2, 5, 10, 100, 0.2, 2.07} - }) - - test_get('f19', {'mo','ro'}, { - one = 1, - few = {0, 2, 10, 15, 19, 101, 119, 201, 219}, - other = {20, 100, 120, 200, 220, 300, 1.2, 2.07} - }) - - test_get('f20', 'mt', { - one = 1, - few = {0, 2, 5, 10, 102, 105, 110, 202, 205, 210}, - many = {11, 15, 19, 111, 115, 119, 211, 215, 219}, - other = {20, 21, 50, 53, 101, 220, 221, 1.4, 11.61, 20.81} - }) - - test_get('f21', 'pl', { - one = 1, - few = {2, 3, 4, 22, 23, 24, 32, 33, 34}, - many = {0, 5, 6, 7, 8, 9, 10, 15, 20, 21, 25, 26, 27, 28, 29, 30, 31, 35}, - other = {1.2, 2.7, 5.94} - }) - - test_get('f22', 'shi', { - one = {0, 1}, - other = {2, 5, 10, 100, 1.2, 2.7, 5.94} - }) - - test_get('f23', 'sl', { - one = {1, 101, 201, 301, 401}, - two = {2, 102, 202, 302, 402}, - few = {3, 4, 103, 104, 203, 204}, - other = {0, 5, 6, 7, 105, 106, 107, 1.2, 11.5, 3.4} - }) - - test_get('f24', 'tzm', { - one = {0, 1, 11, 12, 15, 20, 25, 50, 98, 99}, - other = {2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101, 102, 0.5, 1.7} - }) - - describe("When the locale is not found", function() - describe("When a default function is set", function() - before(function() - plural.setDefaultFunction(function() return 'nothing' end) - end) - - test_get('non-existing languages use it', {'klingon', 'elvish'}, { - nothing = {0, 1, 1000, 0.5} - }) - - test_get('existing languages do not use it', {'fr'}, { - one = {0, 0.1, 0.5, 1, 1.5, 1.8}, - other = {2, 3, 10, 20, 2.07} - }) - end) - - describe("When a default function is not set", function() - test_get('non-existing languages use english', {'klingon', 'elvish'}, { - one = 1, - other = {0, 2, 1000, 0.5} - }) - end) - end) - end) + ]]), + { + other = { 0, 1, 1000, 0.5 }, + } + ) + + test_get("f5", words("be bs hr ru sh sr uk"), { + one = { 1, 21, 31, 41, 51 }, + few = { 2, 4, 22, 24, 32, 34 }, + many = { 0, 5, 20, 25, 30, 35, 40 }, + other = { 1.2, 2.07 }, + }) + + test_get("f6", "br", { + one = { 1, 21, 31, 41, 51 }, + two = { 2, 22, 32, 42, 52 }, + few = { 3, 4, 9, 23, 24, 29 }, + many = { 1000000, 100000000 }, + other = { 0, 5, 8, 10, 20, 25, 28, 1.2, 2.07 }, + }) + + test_get("f7", { "cz", "sk" }, { + one = 1, + few = { 2, 3, 4 }, + other = { 0, 5, 8, 10, 1.2, 2.07 }, + }) + + test_get("f8", "cy", { + zero = 0, + one = 1, + two = 2, + few = 3, + many = 6, + other = { 4, 5, 7, 10, 101, 0.2, 1.07, 3.81 }, + }) + + test_get("f9", { "ff", "fr", "kab" }, { + one = { 0, 0.1, 0.5, 1, 1.5, 1.8 }, + other = { 2, 3, 10, 20, 2.07 }, + }) + + test_get("f10", "ga", { + one = 1, + two = 2, + few = { 3, 4, 5, 6 }, + many = { 7, 8, 9, 10 }, + other = { 0, 11, 12, 20, 25, 100, 1.2, 2.07 }, + }) + + test_get("f11", "gd", { + one = { 1, 11 }, + two = { 2, 12 }, + few = { 3, 10, 13, 19 }, + other = { 0, 20, 100, 1.2, 2.07 }, + }) + + test_get("f12", "gv", { + one = { 0, 1, 2, 11, 12, 20, 21, 22 }, + other = { 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 1.5 }, + }) + + test_get("f13", words("iu kw naq se sma smi smj smn sms"), { + one = 1, + two = 2, + other = { 0, 3, 10, 1.2, 2.07 }, + }) + + test_get("f14", "ksh", { + zero = 0, + one = 1, + other = { 2, 3, 5, 10, 100, 2.3, 1.07 }, + }) + + test_get("f15", "lag", { + zero = 0, + one = { 0.5, 1, 1.5, 1.97 }, + other = { 2, 3, 10, 100, 2.10 }, + }) + + test_get("f16", "lt", { + one = { 1, 21, 31, 41, 51, 61 }, + few = { 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24 }, + other = { 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 1.5, 2.07 }, + }) + + test_get("f17", "lv", { + zero = 0, + one = { 1, 21, 31, 41, 51, 61 }, + other = { 2, 5, 10, 15, 20, 22, 23, 30, 32, 33, 40, 0.2, 2.07 }, + }) + + test_get("f18", "mk", { + one = { 1, 21, 31, 41, 51, 61 }, + other = { 0, 2, 5, 10, 100, 0.2, 2.07 }, + }) + + test_get("f19", { "mo", "ro" }, { + one = 1, + few = { 0, 2, 10, 15, 19, 101, 119, 201, 219 }, + other = { 20, 100, 120, 200, 220, 300, 1.2, 2.07 }, + }) + + test_get("f20", "mt", { + one = 1, + few = { 0, 2, 5, 10, 102, 105, 110, 202, 205, 210 }, + many = { 11, 15, 19, 111, 115, 119, 211, 215, 219 }, + other = { 20, 21, 50, 53, 101, 220, 221, 1.4, 11.61, 20.81 }, + }) + + test_get("f21", "pl", { + one = 1, + few = { 2, 3, 4, 22, 23, 24, 32, 33, 34 }, + many = { 0, 5, 6, 7, 8, 9, 10, 15, 20, 21, 25, 26, 27, 28, 29, 30, 31, 35 }, + other = { 1.2, 2.7, 5.94 }, + }) + + test_get("f22", "shi", { + one = { 0, 1 }, + other = { 2, 5, 10, 100, 1.2, 2.7, 5.94 }, + }) + + test_get("f23", "sl", { + one = { 1, 101, 201, 301, 401 }, + two = { 2, 102, 202, 302, 402 }, + few = { 3, 4, 103, 104, 203, 204 }, + other = { 0, 5, 6, 7, 105, 106, 107, 1.2, 11.5, 3.4 }, + }) + + test_get("f24", "tzm", { + one = { 0, 1, 11, 12, 15, 20, 25, 50, 98, 99 }, + other = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101, 102, 0.5, 1.7 }, + }) + + describe("When the locale is not found", function() + describe("When a default function is set", function() + before(function() + plural.setDefaultFunction(function() + return "nothing" + end) + end) + + test_get("non-existing languages use it", { "klingon", "elvish" }, { + nothing = { 0, 1, 1000, 0.5 }, + }) + + test_get("existing languages do not use it", { "fr" }, { + one = { 0, 0.1, 0.5, 1, 1.5, 1.8 }, + other = { 2, 3, 10, 20, 2.07 }, + }) + end) + + describe("When a default function is not set", function() + test_get("non-existing languages use english", { "klingon", "elvish" }, { + one = 1, + other = { 0, 2, 1000, 0.5 }, + }) + end) + end) + end) end) diff --git a/modules/i18n/i18nlib/spec/i18n_spec.lua b/modules/i18n/i18nlib/spec/i18n_spec.lua index 68779a3250b..f40a5baa073 100644 --- a/modules/i18n/i18nlib/spec/i18n_spec.lua +++ b/modules/i18n/i18nlib/spec/i18n_spec.lua @@ -1,215 +1,230 @@ -require 'spec.fixPackagePath' - -local i18n = require 'i18n' - -describe('i18n', function() - - before(function() i18n.reset() end) - - describe('translate/set', function() - it('sets a value in the internal store', function() - i18n.set('en.foo','var') - assert_equal('var', i18n('foo')) - end) - - it('splits keys via their dots', function() - i18n.set('en.message.cool', 'hello!') - assert_equal('hello!', i18n('message.cool')) - end) - - it('interpolates variables', function() - i18n.set('en.message', 'Hello %{name}, your score is %{score}') - assert_equal('Hello Vegeta, your score is 9001', i18n('message', {name = 'Vegeta', score = 9001})) - end) - - it('checks that the first two parameters are non-empty strings', function() - assert_error(function() i18n.set("","") end) - assert_error(function() i18n.set("",1) end) - assert_error(function() i18n.set(1,1) end) - assert_error(function() i18n.set() end) - end) - - describe('when an entry is missing', function() - - describe('and a locale parameter is given', function() - it('uses the given locale', function() - i18n.set('es.msg', 'hola') - assert_equal('hola', i18n('msg', {locale = 'es'})) - end) - end) - - it('looks it up in locale ancestry', function() - i18n.set('es.msg', 'hola') - i18n.setLocale('es-MX') - assert_equal('hola', i18n('msg')) - end) - - it('uses the fallback locale', function() - i18n.set('es.msg', 'hola') - i18n.setLocale('fr') - assert_nil(i18n('msg')) - i18n.setFallbackLocale('es') - assert_equal('hola', i18n('msg')) - end) - - it('uses the fallback locale ancestry', function() - i18n.set('es.msg', 'hola') - i18n.setLocale('fr') - assert_nil(i18n('msg')) - i18n.setFallbackLocale('es-MX') - assert_equal('hola', i18n('msg')) - end) - - it('uses the default parameter, if given', function() - assert_equal('bonjour', i18n('msg', {default='bonjour'})) - end) - - end) - - describe('when there is a count-type translation', function() - describe('and the locale is the default one (english)', function() - before(function() - i18n.setLocale('en') - i18n.set('en.message', { - one = "Only one message.", - other = "%{count} messages." - }) - end) - - it('pluralizes correctly', function() - assert_equal("Only one message.", i18n('message', {count = 1})) - assert_equal("2 messages.", i18n('message', {count = 2})) - assert_equal("0 messages.", i18n('message', {count = 0})) - end) - - it('defaults to 1', function() - assert_equal("Only one message.", i18n('message')) - end) - end) - - describe('and the locale is french', function() - before(function() - i18n.setLocale('fr') - i18n.set('fr.message', { - one = "Une chose.", - other = "%{count} choses." - }) - end) - - it('Ça marche', function() - assert_equal("Une chose.", i18n('message', {count = 1})) - assert_equal("Une chose.", i18n('message', {count = 1.5})) - assert_equal("2 choses.", i18n('message', {count = 2})) - assert_equal("Une chose.", i18n('message', {count = 0})) - end) - - it('defaults to 1', function() - assert_equal("Une chose.", i18n('message')) - end) - end) - - end) - end) - - describe('load', function() - it("loads a bunch of stuff", function() - i18n.load({ - en = { - hello = 'Hello!', - inter = 'Your weight: %{weight}', - plural = { - one = "One thing", - other = "%{count} things" - } - }, - es = { - hello = '¡Hola!', - inter = 'Su peso: %{weight}', - plural = { - one = "Una cosa", - other = "%{count} cosas" - } - } - }) - - assert_equal('Hello!', i18n('hello')) - assert_equal('Your weight: 5', i18n('inter', {weight = 5})) - assert_equal('One thing', i18n('plural', {count = 1})) - assert_equal('2 things', i18n('plural', {count = 2})) - i18n.setLocale('es') - assert_equal('¡Hola!', i18n('hello')) - assert_equal('Su peso: 5', i18n('inter', {weight = 5})) - assert_equal('Una cosa', i18n('plural', {count = 1})) - assert_equal('2 cosas', i18n('plural', {count = 2})) - end) - end) - - describe('loadFile', function() - it("Loads a bunch of stuff", function() - i18n.loadFile('spec/en.lua') - assert_equal('Hello!', i18n('hello')) - local balance = i18n('balance', {value = 0}) - assert_equal('Your account balance is 0.', balance) - end) - end) - - describe('set/getFallbackLocale', function() - it("defaults to en", function() - assert_equal('en', i18n.getFallbackLocale()) - end) - it("throws error on empty or erroneous locales", function() - assert_error(i18n.setFallbackLocale) - assert_error(function() i18n.setFallbackLocale(1) end) - assert_error(function() i18n.setFallbackLocale("") end) - end) - end) - - describe('set/getLocale', function() - it("defaults to en", function() - assert_equal('en', i18n.getLocale()) - end) - - it("modifies translate", function() - i18n.set('fr.foo','bar') - i18n.setLocale('fr') - assert_equal('bar', i18n('foo')) - end) - - it("does NOT modify set", function() - i18n.setLocale('fr') - i18n.set('fr.foo','bar') - assert_equal('bar', i18n('foo')) - end) - - it("does NOT modify load", function() - i18n.setLocale('fr') - i18n.load({fr = {foo = 'Foo'}}) - assert_equal('Foo', i18n('foo')) - end) - - it("does NOT modify loadFile", function() - i18n.loadFile('spec/en.lua') - assert_equal('Hello!', i18n('hello')) - end) - - describe("when a second parameter is passed", function() - it("throws an error if the second param is not a function", function() - assert_error(function() i18n.setLocale('wookie', 1) end) - assert_error(function() i18n.setLocale('wookie', 'foo') end) - assert_error(function() i18n.setLocale('wookie', {}) end) - end) - it("uses the provided function to calculate plurals", function() - local count = function(n) - return (n < 10 and "hahahaha") or "other" - end - i18n.setLocale('dracula', count) - i18n.load({dracula = { msg = { hahahaha = "Let's count to %{count}. hahahaha", other = "wha?" }}}) - - assert_equal("Let's count to 5. hahahaha", i18n('msg', {count = 5})) - assert_equal("Let's count to 3. hahahaha", i18n('msg', {count = 3})) - assert_equal("wha?", i18n('msg', {count = 11})) - end) - end) - end) - +require("spec.fixPackagePath") + +local i18n = require("i18n") + +describe("i18n", function() + before(function() + i18n.reset() + end) + + describe("translate/set", function() + it("sets a value in the internal store", function() + i18n.set("en.foo", "var") + assert_equal("var", i18n("foo")) + end) + + it("splits keys via their dots", function() + i18n.set("en.message.cool", "hello!") + assert_equal("hello!", i18n("message.cool")) + end) + + it("interpolates variables", function() + i18n.set("en.message", "Hello %{name}, your score is %{score}") + assert_equal("Hello Vegeta, your score is 9001", i18n("message", { name = "Vegeta", score = 9001 })) + end) + + it("checks that the first two parameters are non-empty strings", function() + assert_error(function() + i18n.set("", "") + end) + assert_error(function() + i18n.set("", 1) + end) + assert_error(function() + i18n.set(1, 1) + end) + assert_error(function() + i18n.set() + end) + end) + + describe("when an entry is missing", function() + describe("and a locale parameter is given", function() + it("uses the given locale", function() + i18n.set("es.msg", "hola") + assert_equal("hola", i18n("msg", { locale = "es" })) + end) + end) + + it("looks it up in locale ancestry", function() + i18n.set("es.msg", "hola") + i18n.setLocale("es-MX") + assert_equal("hola", i18n("msg")) + end) + + it("uses the fallback locale", function() + i18n.set("es.msg", "hola") + i18n.setLocale("fr") + assert_nil(i18n("msg")) + i18n.setFallbackLocale("es") + assert_equal("hola", i18n("msg")) + end) + + it("uses the fallback locale ancestry", function() + i18n.set("es.msg", "hola") + i18n.setLocale("fr") + assert_nil(i18n("msg")) + i18n.setFallbackLocale("es-MX") + assert_equal("hola", i18n("msg")) + end) + + it("uses the default parameter, if given", function() + assert_equal("bonjour", i18n("msg", { default = "bonjour" })) + end) + end) + + describe("when there is a count-type translation", function() + describe("and the locale is the default one (english)", function() + before(function() + i18n.setLocale("en") + i18n.set("en.message", { + one = "Only one message.", + other = "%{count} messages.", + }) + end) + + it("pluralizes correctly", function() + assert_equal("Only one message.", i18n("message", { count = 1 })) + assert_equal("2 messages.", i18n("message", { count = 2 })) + assert_equal("0 messages.", i18n("message", { count = 0 })) + end) + + it("defaults to 1", function() + assert_equal("Only one message.", i18n("message")) + end) + end) + + describe("and the locale is french", function() + before(function() + i18n.setLocale("fr") + i18n.set("fr.message", { + one = "Une chose.", + other = "%{count} choses.", + }) + end) + + it("Ça marche", function() + assert_equal("Une chose.", i18n("message", { count = 1 })) + assert_equal("Une chose.", i18n("message", { count = 1.5 })) + assert_equal("2 choses.", i18n("message", { count = 2 })) + assert_equal("Une chose.", i18n("message", { count = 0 })) + end) + + it("defaults to 1", function() + assert_equal("Une chose.", i18n("message")) + end) + end) + end) + end) + + describe("load", function() + it("loads a bunch of stuff", function() + i18n.load({ + en = { + hello = "Hello!", + inter = "Your weight: %{weight}", + plural = { + one = "One thing", + other = "%{count} things", + }, + }, + es = { + hello = "¡Hola!", + inter = "Su peso: %{weight}", + plural = { + one = "Una cosa", + other = "%{count} cosas", + }, + }, + }) + + assert_equal("Hello!", i18n("hello")) + assert_equal("Your weight: 5", i18n("inter", { weight = 5 })) + assert_equal("One thing", i18n("plural", { count = 1 })) + assert_equal("2 things", i18n("plural", { count = 2 })) + i18n.setLocale("es") + assert_equal("¡Hola!", i18n("hello")) + assert_equal("Su peso: 5", i18n("inter", { weight = 5 })) + assert_equal("Una cosa", i18n("plural", { count = 1 })) + assert_equal("2 cosas", i18n("plural", { count = 2 })) + end) + end) + + describe("loadFile", function() + it("Loads a bunch of stuff", function() + i18n.loadFile("spec/en.lua") + assert_equal("Hello!", i18n("hello")) + local balance = i18n("balance", { value = 0 }) + assert_equal("Your account balance is 0.", balance) + end) + end) + + describe("set/getFallbackLocale", function() + it("defaults to en", function() + assert_equal("en", i18n.getFallbackLocale()) + end) + it("throws error on empty or erroneous locales", function() + assert_error(i18n.setFallbackLocale) + assert_error(function() + i18n.setFallbackLocale(1) + end) + assert_error(function() + i18n.setFallbackLocale("") + end) + end) + end) + + describe("set/getLocale", function() + it("defaults to en", function() + assert_equal("en", i18n.getLocale()) + end) + + it("modifies translate", function() + i18n.set("fr.foo", "bar") + i18n.setLocale("fr") + assert_equal("bar", i18n("foo")) + end) + + it("does NOT modify set", function() + i18n.setLocale("fr") + i18n.set("fr.foo", "bar") + assert_equal("bar", i18n("foo")) + end) + + it("does NOT modify load", function() + i18n.setLocale("fr") + i18n.load({ fr = { foo = "Foo" } }) + assert_equal("Foo", i18n("foo")) + end) + + it("does NOT modify loadFile", function() + i18n.loadFile("spec/en.lua") + assert_equal("Hello!", i18n("hello")) + end) + + describe("when a second parameter is passed", function() + it("throws an error if the second param is not a function", function() + assert_error(function() + i18n.setLocale("wookie", 1) + end) + assert_error(function() + i18n.setLocale("wookie", "foo") + end) + assert_error(function() + i18n.setLocale("wookie", {}) + end) + end) + it("uses the provided function to calculate plurals", function() + local count = function(n) + return (n < 10 and "hahahaha") or "other" + end + i18n.setLocale("dracula", count) + i18n.load({ dracula = { msg = { hahahaha = "Let's count to %{count}. hahahaha", other = "wha?" } } }) + + assert_equal("Let's count to 5. hahahaha", i18n("msg", { count = 5 })) + assert_equal("Let's count to 3. hahahaha", i18n("msg", { count = 3 })) + assert_equal("wha?", i18n("msg", { count = 11 })) + end) + end) + end) end) diff --git a/modules/i18n/i18nlib/spec/i18n_variants_spec.lua b/modules/i18n/i18nlib/spec/i18n_variants_spec.lua index 677bbda64f8..c537367e544 100644 --- a/modules/i18n/i18nlib/spec/i18n_variants_spec.lua +++ b/modules/i18n/i18nlib/spec/i18n_variants_spec.lua @@ -1,56 +1,56 @@ -require 'spec.assert_same' -local variants = require 'i18n.variants' +require("spec.assert_same") +local variants = require("i18n.variants") describe("i18n.variants", function() - it("is a table", function() - assert_equal('table', type(variants)) - end) + it("is a table", function() + assert_equal("table", type(variants)) + end) - describe(".ancestry", function() - it("returns just the locale for simple locales", function() - assert_same(variants.ancestry('en'), {'en'}) - end) + describe(".ancestry", function() + it("returns just the locale for simple locales", function() + assert_same(variants.ancestry("en"), { "en" }) + end) - it("returns self and parents for composite locales", function() - assert_same(variants.ancestry('en-US-texas'), {'en-US-texas', 'en-US', 'en'}) - end) - end) + it("returns self and parents for composite locales", function() + assert_same(variants.ancestry("en-US-texas"), { "en-US-texas", "en-US", "en" }) + end) + end) - describe(".isParent", function() - it("works as expected", function() - assert_true(variants.isParent('en', 'en-US')) - assert_false(variants.isParent('en-US', 'en')) - assert_false(variants.isParent('en', 'fr')) - assert_false(variants.isParent('en', 'english')) - assert_false(variants.isParent('en', 'en')) - end) - end) + describe(".isParent", function() + it("works as expected", function() + assert_true(variants.isParent("en", "en-US")) + assert_false(variants.isParent("en-US", "en")) + assert_false(variants.isParent("en", "fr")) + assert_false(variants.isParent("en", "english")) + assert_false(variants.isParent("en", "en")) + end) + end) - describe(".root", function() - it("returns just the locale for simple locales", function() - assert_equal('en', variants.root('en')) - end) - it("returns the root for composite locales", function() - assert_equal('en', variants.root('en-US')) - end) - end) + describe(".root", function() + it("returns just the locale for simple locales", function() + assert_equal("en", variants.root("en")) + end) + it("returns the root for composite locales", function() + assert_equal("en", variants.root("en-US")) + end) + end) - describe(".fallbacks", function() - describe("when given locales of the same ancestry", function() - it("returns the locale ancestry if given exactly the same locale twice", function() - assert_same(variants.fallbacks('en-US','en-US'), {'en-US', 'en'}) - end) - it("returns the locale ancestry if fallbackLocale is parent of locale", function() - assert_same(variants.fallbacks('en-US','en'), {'en-US', 'en'}) - end) - it("returns the fallbackLocale ancestry if locale is parent of fallbackLocale", function() - assert_same(variants.fallbacks('en','en-US'), {'en-US', 'en'}) - end) - end) - describe("when given two different locales", function() - it("returns the first locale first, followed by the fallback locale ancestry", function() - assert_same(variants.fallbacks('fr-CA', 'en-US'), {'fr-CA', 'fr', 'en-US', 'en'}) - end) - end) - end) + describe(".fallbacks", function() + describe("when given locales of the same ancestry", function() + it("returns the locale ancestry if given exactly the same locale twice", function() + assert_same(variants.fallbacks("en-US", "en-US"), { "en-US", "en" }) + end) + it("returns the locale ancestry if fallbackLocale is parent of locale", function() + assert_same(variants.fallbacks("en-US", "en"), { "en-US", "en" }) + end) + it("returns the fallbackLocale ancestry if locale is parent of fallbackLocale", function() + assert_same(variants.fallbacks("en", "en-US"), { "en-US", "en" }) + end) + end) + describe("when given two different locales", function() + it("returns the first locale first, followed by the fallback locale ancestry", function() + assert_same(variants.fallbacks("fr-CA", "en-US"), { "fr-CA", "fr", "en-US", "en" }) + end) + end) + end) end) diff --git a/modules/i18n/modinfo.lua b/modules/i18n/modinfo.lua index 954ea62bd0c..9b599583867 100644 --- a/modules/i18n/modinfo.lua +++ b/modules/i18n/modinfo.lua @@ -1,6 +1,6 @@ return { - name='i18n', - description="Internationalization library for Spring", - version='$VERSION', - modtype=0, + name = "i18n", + description = "Internationalization library for Spring", + version = "$VERSION", + modtype = 0, } diff --git a/modules/lava.lua b/modules/lava.lua index 193d790daaf..b9964558810 100644 --- a/modules/lava.lua +++ b/modules/lava.lua @@ -52,19 +52,20 @@ local tidePeriod = 200 -- how much time between live rise up-down local effectDamage = "lavadamage" -- damage ceg effect local effectBurst = "lavasplash" -- burst ceg effect, set to false to disable -- sound arrays: always rows with {soundid, minVolume, maxVolume} -local effectBurstSounds = { {"lavaburst1", 80, 100}, {"lavaburst2", 80, 100} } -- array of sounds to use for bursts, false or empty array will disable sounds -local ambientSounds = { {"lavabubbleshort1", 25, 65}, -- ambient sounds, set ambientSounds = false to disable - {"lavabubbleshort2", 25, 65}, - {"lavarumbleshort1", 20, 40}, - {"lavarumbleshort2", 20, 40}, - {"lavarumbleshort3", 20, 40} } +local effectBurstSounds = { { "lavaburst1", 80, 100 }, { "lavaburst2", 80, 100 } } -- array of sounds to use for bursts, false or empty array will disable sounds +local ambientSounds = { + { "lavabubbleshort1", 25, 65 }, -- ambient sounds, set ambientSounds = false to disable + { "lavabubbleshort2", 25, 65 }, + { "lavarumbleshort1", 20, 40 }, + { "lavarumbleshort2", 20, 40 }, + { "lavarumbleshort3", 20, 40 }, +} --- Tide animation scenes --- each row is: { HeightLevel (elmo), Speed (elmo/second), Delay for next TideRhythm (seconds) } --- first element needs to be -1 than pre-game lava level when present local tideRhythm = {} -local defaultTide = {4, 1.5, 5*6000} - +local defaultTide = { 4, 1.5, 5 * 6000 } ---------------------------------------- -- Helper methods @@ -72,8 +73,10 @@ local defaultTide = {4, 1.5, 5*6000} local function trimMapVersion(mapName) -- Trims version from the end of the map name. -- find last space before version (version is numbers with dots, possibly preceded by v or V) - local lastSpace = mapName:match'^.*()\ [vV]*[%d%.]+' - if not lastSpace then return mapName end + local lastSpace = mapName:match("^.*() [vV]*[%d%.]+") + if not lastSpace then + return mapName + end return string.sub(mapName, 1, lastSpace - 1) end @@ -82,7 +85,9 @@ local function gameConfigPath(mapName) end local function getLavaConfig(mapName) - if voidWaterMap then return end + if voidWaterMap then + return + end -- Get lava config for map. -- mapConfig has preference over gameConfig, unless game sets 'overrideMap' local gameConfig, mapConfig @@ -91,20 +96,20 @@ local function getLavaConfig(mapName) local mapNameNoVersion = trimMapVersion(mapName) if VFS.FileExists(gameConfigPath(mapName)) then gameConfig = VFS.Include(gameConfigPath(mapName)) - Spring.Log('Lava', LOG.INFO, "Loaded map config for", mapName) + Spring.Log("Lava", LOG.INFO, "Loaded map config for", mapName) elseif mapName ~= mapNameNoVersion and VFS.FileExists(gameConfigPath(mapNameNoVersion)) then gameConfig = VFS.Include(gameConfigPath(mapNameNoVersion)) - Spring.Log('Lava', LOG.INFO, "Loaded map config for", mapNameNoVersion) + Spring.Log("Lava", LOG.INFO, "Loaded map config for", mapNameNoVersion) end end if VFS.FileExists(MAP_CONFIG_PATH) then mapConfig = VFS.Include(MAP_CONFIG_PATH) - Spring.Log('Lava', LOG.INFO, "Loaded map config for", mapNameNoVersion) + Spring.Log("Lava", LOG.INFO, "Loaded map config for", mapNameNoVersion) end if mapConfig and gameConfig and gameConfig.overrideMap then -- allow gameconfig to override map config when 'overrideMap' is set mapConfig = gameConfig - Spring.Log('Lava', LOG.INFO, "Game config overrides map") + Spring.Log("Lava", LOG.INFO, "Game config overrides map") end return mapConfig or gameConfig end @@ -171,8 +176,8 @@ local function validateTideRhythm(modoptionDataRaw) if not tonumber(value) then Spring.Echo("Lava Advanced Tide Rhythm data is not valid, non-number value: ", value) return false - else - table.insert(partRhythm, tonumber(value)) + else + table.insert(partRhythm, tonumber(value)) end end if #partRhythm ~= 3 then @@ -194,26 +199,26 @@ end local function lavaModGen(modOptions) local tweakLavaRaw = modOptions.map_tweaklava - if tweakLavaRaw ~= "" and tweakLavaRaw ~= "0" then + if tweakLavaRaw ~= "" and tweakLavaRaw ~= "0" then local advancedRhythm = validateTideRhythm(tweakLavaRaw) - if advancedRhythm then + if advancedRhythm then tideRhythm = advancedRhythm level = tideRhythm[1][1] + 1 grow = tideRhythm[1][2] - else + else Spring.Echo("Lava Advanced Tide Rhythm data is not valid, using default values") - if next(tideRhythm) == nil then + if next(tideRhythm) == nil then level = defaultTide[1] tideRhythm = { defaultTide } end end - else - local lowRhythm = {modOptions.map_lavalowlevel, 7.5, modOptions.map_lavalowdwell} --Falls faster: 450 elmo/min - local highRhythm = {modOptions.map_lavahighlevel, 4.5, modOptions.map_lavahighdwell} --Rises slower: 270 elmo/min + else + local lowRhythm = { modOptions.map_lavalowlevel, 7.5, modOptions.map_lavalowdwell } --Falls faster: 450 elmo/min + local highRhythm = { modOptions.map_lavahighlevel, 4.5, modOptions.map_lavahighdwell } --Rises slower: 270 elmo/min if modOptions.map_lavatidemode == "lavastartlow" then - tideRhythm = {lowRhythm, highRhythm} + tideRhythm = { lowRhythm, highRhythm } elseif modOptions.map_lavatidemode == "lavastarthigh" then - tideRhythm = {highRhythm, lowRhythm} + tideRhythm = { highRhythm, lowRhythm } end level = tideRhythm[1][1] + 1 grow = tideRhythm[1][2] @@ -226,18 +231,17 @@ end local mapLavaConfig = getLavaConfig(mapName) local modTideRhythm = (Spring.GetModOptions().map_waterislava and Spring.GetModOptions().map_lavatiderhythm) or "default" -if mapLavaConfig and (not voidWaterMap) then +if mapLavaConfig and not voidWaterMap then applyConfig(mapLavaConfig) if modTideRhythm == "enabled" then lavaModGen(Spring.GetModOptions()) elseif modTideRhythm == "disabled" then - tideRhythm = {tideRhythm[1]} -- only the first (starting) tide level is used - tideRhythm[1][3] = 5*6000 -- extend the first tide - level = tideRhythm[1][1] + tideRhythm = { tideRhythm[1] } -- only the first (starting) tide level is used + tideRhythm[1][3] = 5 * 6000 -- extend the first tide + level = tideRhythm[1][1] grow = tideRhythm[1][2] end - -elseif Game.waterDamage > 0 and (not voidWaterMap) then -- Waterdamagemaps - keep at the very bottom +elseif Game.waterDamage > 0 and not voidWaterMap then -- Waterdamagemaps - keep at the very bottom isLavaMap = true grow = 0 effectBurst = false @@ -262,8 +266,7 @@ elseif Game.waterDamage > 0 and (not voidWaterMap) then -- Waterdamagemaps - kee fogDistortion = 1 tideRhythm = { defaultTide } --tideRhythm = { { 1, 7.5, 5*6000 } } - -elseif Spring.GetModOptions().map_waterislava and (not voidWaterMap) then +elseif Spring.GetModOptions().map_waterislava and not voidWaterMap then isLavaMap = true if modTideRhythm == "enabled" then lavaModGen(Spring.GetModOptions()) @@ -273,8 +276,6 @@ elseif Spring.GetModOptions().map_waterislava and (not voidWaterMap) then end end - - return { isLavaMap = isLavaMap, diff --git a/modules/weaponthreat.lua b/modules/weaponthreat.lua index 91e9cbca8b2..305b985c5d5 100644 --- a/modules/weaponthreat.lua +++ b/modules/weaponthreat.lua @@ -34,11 +34,7 @@ end local function getUnitDefKamikazeDistance(unitDef) local customParams = unitDef.customParams or {} - return unitDef.kamikazeDistance - or unitDef.kamikazeDist - or unitDef.kamikazedistance - or tonumber(customParams.kamikazedistance) - or 0 + return unitDef.kamikazeDistance or unitDef.kamikazeDist or unitDef.kamikazedistance or tonumber(customParams.kamikazedistance) or 0 end local function hasKamikazeWeapon(unitDef) @@ -55,19 +51,11 @@ end function WeaponThreat.isKamikazeUnitDef(unitDef) local customParams = unitDef.customParams or {} - return unitDef.canKamikaze - or customParams.instantselfd - or customParams.unitgroup == "explo" - or customParams.mine - or customParams.detonaterange - or hasKamikazeWeapon(unitDef) + return unitDef.canKamikaze or customParams.instantselfd or customParams.unitgroup == "explo" or customParams.mine or customParams.detonaterange or hasKamikazeWeapon(unitDef) end local function getKamikazeExplosionRadius(unitDef) - local explosionRadius = math.max( - getWeaponExplosionRadius(unitDef.deathExplosion), - getWeaponExplosionRadius(unitDef.selfDExplosion) - ) + local explosionRadius = math.max(getWeaponExplosionRadius(unitDef.deathExplosion), getWeaponExplosionRadius(unitDef.selfDExplosion)) local weapons = unitDef.weapons for weaponNum = 1, #weapons do local weaponDef = WeaponDefs[weapons[weaponNum].weaponDef] @@ -98,9 +86,7 @@ function WeaponThreat.isOffensiveWeapon(weaponDef) end function WeaponThreat.isWatchableWeapon(weaponDef) - return weaponDef - and not (weaponDef.shieldRadius and weaponDef.shieldRadius > 0) - and not (weaponDef.interceptor ~= 0 and weaponDef.coverageRange) + return weaponDef and not (weaponDef.shieldRadius and weaponDef.shieldRadius > 0) and not (weaponDef.interceptor ~= 0 and weaponDef.coverageRange) end local function weaponDealsDamage(weaponDef) diff --git a/objects3d/Raptors/raptorartillery.dae.lua b/objects3d/Raptors/raptorartillery.dae.lua index 6241853d85d..0835f2e85fd 100644 --- a/objects3d/Raptors/raptorartillery.dae.lua +++ b/objects3d/Raptors/raptorartillery.dae.lua @@ -1,9 +1,9 @@ model = { - radius = 100.0, - height = 60.0, - tex1 = "raptorArtillery_1.dds", - tex2 = "raptorArtillery_2.dds", - --midpos = {0,0,0}, - --rotAxisSigns = {-1, -1, -1} + radius = 100.0, + height = 60.0, + tex1 = "raptorArtillery_1.dds", + tex2 = "raptorArtillery_2.dds", + --midpos = {0,0,0}, + --rotAxisSigns = {-1, -1, -1} } return model diff --git a/scripts/Critters/critter_crab.lua b/scripts/Critters/critter_crab.lua index 2062e7769e3..2eb1d1a0720 100644 --- a/scripts/Critters/critter_crab.lua +++ b/scripts/Critters/critter_crab.lua @@ -1,19 +1,12 @@ -local flare = piece "flare" +local flare = piece("flare") +function walk() end -function walk() -end - -function stopwalk() -end - -function script.StartMoving() -end - -function script.StopMoving() -end +function stopwalk() end +function script.StartMoving() end +function script.StopMoving() end function script.AimFromWeapon1() return flare @@ -30,9 +23,7 @@ function script.FireWeapon1() return true end -function script.Shot1() -end - +function script.Shot1() end --[[ function script.Killed(recentDamage, maxHealth) @@ -47,5 +38,5 @@ function script.Killed(recentDamage, maxHealth) end PlaySoundFile(snd,volume,x,y,z,0,0,0,'battle') end -]]-- - +]] +-- diff --git a/scripts/Critters/critter_duck.lua b/scripts/Critters/critter_duck.lua index acaf7e12ebb..88e8a3d4d21 100644 --- a/scripts/Critters/critter_duck.lua +++ b/scripts/Critters/critter_duck.lua @@ -1,54 +1,56 @@ -local foot1 = piece "foot1" -local foot2 = piece "foot2" -local body = piece "body" +local foot1 = piece("foot1") +local foot2 = piece("foot2") +local body = piece("body") local SIG_WALK = 2 -local tspeed = math.rad (180) -local ta = math.rad (30) +local tspeed = math.rad(180) +local ta = math.rad(30) function walk() Signal(SIG_WALK) - SetSignalMask(SIG_WALK) - while (true) do - Turn (foot1, x_axis, ta, tspeed) - Turn (foot2, x_axis, -ta, tspeed) - WaitForTurn (foot2, x_axis) - WaitForTurn (foot2, x_axis) - - Turn (foot1, x_axis, -ta, tspeed) - Turn (foot2, x_axis, ta, tspeed) - WaitForTurn (foot2, x_axis) - WaitForTurn (foot2, x_axis) - Sleep (10) - end + SetSignalMask(SIG_WALK) + while true do + Turn(foot1, x_axis, ta, tspeed) + Turn(foot2, x_axis, -ta, tspeed) + WaitForTurn(foot2, x_axis) + WaitForTurn(foot2, x_axis) + + Turn(foot1, x_axis, -ta, tspeed) + Turn(foot2, x_axis, ta, tspeed) + WaitForTurn(foot2, x_axis) + WaitForTurn(foot2, x_axis) + Sleep(10) + end end function stopwalk() Signal(SIG_WALK) --stop the walk thread - Turn (foot1, x_axis, 0, tspeed) - Turn (foot2, x_axis, 0, tspeed) - Turn (body, x_axis, math.rad (0), math.rad (45)) + Turn(foot1, x_axis, 0, tspeed) + Turn(foot2, x_axis, 0, tspeed) + Turn(body, x_axis, math.rad(0), math.rad(45)) end function script.StartMoving() --Spring.Echo ("start moving") - Turn (body, x_axis, math.rad (10), math.rad (45)) + Turn(body, x_axis, math.rad(10), math.rad(45)) StartThread(walk) end - + function script.StopMoving() StartThread(stopwalk) end -function script.QueryWeapon1() return body end +function script.QueryWeapon1() + return body +end -function script.AimFromWeapon1() return body end +function script.AimFromWeapon1() + return body +end -function script.AimWeapon1( heading, pitch ) +function script.AimWeapon1(heading, pitch) return true end -function script.Shot1() - -end +function script.Shot1() end diff --git a/scripts/Critters/critter_goldfish.lua b/scripts/Critters/critter_goldfish.lua index fc3c78f92d7..8b8052cdec9 100644 --- a/scripts/Critters/critter_goldfish.lua +++ b/scripts/Critters/critter_goldfish.lua @@ -1,39 +1,37 @@ -local wingr = piece "fin1" -local wingl = piece "fin2" -local tail = piece "tail" -local body = piece "body" +local wingr = piece("fin1") +local wingl = piece("fin2") +local tail = piece("tail") +local body = piece("body") local flapSpeed = math.rad(400) function script.Create() --- Spring.Echo ("goldfish here") - StartThread (flapFins) + -- Spring.Echo ("goldfish here") + StartThread(flapFins) end -function script.Killed(recentDamage, maxHealth) - -end +function script.Killed(recentDamage, maxHealth) end function flapFins() - while (true) do - for i=1,math.random (1,3) do - Turn (wingr, z_axis, -math.rad(60),flapSpeed) - Turn (wingl, z_axis, math.rad(60),flapSpeed) - WaitForTurn (wingr,z_axis) - WaitForTurn (wingr,z_axis) - Sleep (100) - Turn (wingr, z_axis, 0,flapSpeed) - Turn (wingl, z_axis, 0,flapSpeed) - WaitForTurn (wingr,z_axis) - WaitForTurn (wingr,z_axis) - end - Sleep (math.random (200,1000)) - for i=1,3,1 do - Turn (tail, x_axis, math.rad(30),flapSpeed) - WaitForTurn (tail,x_axis) - Turn (tail, x_axis, 0,flapSpeed) - WaitForTurn (tail,x_axis) - Turn (body, x_axis, math.rad (math.random (-20,20)) , flapSpeed/2) + while true do + for i = 1, math.random(1, 3) do + Turn(wingr, z_axis, -math.rad(60), flapSpeed) + Turn(wingl, z_axis, math.rad(60), flapSpeed) + WaitForTurn(wingr, z_axis) + WaitForTurn(wingr, z_axis) + Sleep(100) + Turn(wingr, z_axis, 0, flapSpeed) + Turn(wingl, z_axis, 0, flapSpeed) + WaitForTurn(wingr, z_axis) + WaitForTurn(wingr, z_axis) + end + Sleep(math.random(200, 1000)) + for i = 1, 3, 1 do + Turn(tail, x_axis, math.rad(30), flapSpeed) + WaitForTurn(tail, x_axis) + Turn(tail, x_axis, 0, flapSpeed) + WaitForTurn(tail, x_axis) + Turn(body, x_axis, math.rad(math.random(-20, 20)), flapSpeed / 2) end end end diff --git a/scripts/Critters/critter_gull.lua b/scripts/Critters/critter_gull.lua index c2064f67663..3a94d2d2165 100644 --- a/scripts/Critters/critter_gull.lua +++ b/scripts/Critters/critter_gull.lua @@ -1,34 +1,31 @@ -local wingr = piece "rwing" -local flare = piece "flare" -local wingl = piece "lwing" +local wingr = piece("rwing") +local flare = piece("flare") +local wingl = piece("lwing") local flapSpeed = math.rad(360) function script.Create() - StartThread (flapWings) + StartThread(flapWings) end -function script.Killed(recentDamage, maxHealth) - -end +function script.Killed(recentDamage, maxHealth) end function flapWings() - while (true) do - for i=1,math.random (1,3) do - Turn (wingr, z_axis, -math.rad(60),flapSpeed) - Turn (wingl, z_axis, math.rad(60),flapSpeed) - WaitForTurn (wingr,z_axis) - WaitForTurn (wingr,z_axis) - Sleep (100) - Turn (wingr, z_axis, 0,flapSpeed) - Turn (wingl, z_axis, 0,flapSpeed) - WaitForTurn (wingr,z_axis) - WaitForTurn (wingr,z_axis) - end - Sleep (math.random (500,2000)) + while true do + for i = 1, math.random(1, 3) do + Turn(wingr, z_axis, -math.rad(60), flapSpeed) + Turn(wingl, z_axis, math.rad(60), flapSpeed) + WaitForTurn(wingr, z_axis) + WaitForTurn(wingr, z_axis) + Sleep(100) + Turn(wingr, z_axis, 0, flapSpeed) + Turn(wingl, z_axis, 0, flapSpeed) + WaitForTurn(wingr, z_axis) + WaitForTurn(wingr, z_axis) + end + Sleep(math.random(500, 2000)) end end - function script.AimFromWeapon1() return flare end @@ -44,7 +41,6 @@ function script.QueryWeapon2() return flare end - function script.AimWeapon1(heading, pitch) return true end @@ -59,5 +55,4 @@ function script.FireWeapon2() return true end -function script.Shot1() -end +function script.Shot1() end diff --git a/scripts/Critters/critter_penguin.lua b/scripts/Critters/critter_penguin.lua index 09bb7a7b950..25eaed9664f 100644 --- a/scripts/Critters/critter_penguin.lua +++ b/scripts/Critters/critter_penguin.lua @@ -1,17 +1,17 @@ -local foot1 = piece "foot1" -local foot2 = piece "foot2" -local body = piece "body" -local wing1 = piece "wing1" -local wing2 = piece "wing2" -local flare1 = piece "flare1" -local flare2 = piece "flare2" +local foot1 = piece("foot1") +local foot2 = piece("foot2") +local body = piece("body") +local wing1 = piece("wing1") +local wing2 = piece("wing2") +local flare1 = piece("flare1") +local flare2 = piece("flare2") local SIG_WALK = 2 -local tspeed = math.rad (180) -local ta = math.rad (30) +local tspeed = math.rad(180) +local ta = math.rad(30) local GetGameFrame = Spring.GetGameFrame -function script.Create () +function script.Create() --Spin (wing2,x_axis, 0.5) end @@ -19,30 +19,30 @@ bodyWiggleAxis = z_axis --z while walking, y while swimming function walk() Signal(SIG_WALK) SetSignalMask(SIG_WALK) - Sleep (math.random (0, 100)) - while (true) do - Turn (foot1, x_axis, ta, tspeed) - Turn (foot2, x_axis, -ta, tspeed) - Turn (body, bodyWiggleAxis, -ta/4, tspeed) - WaitForTurn (foot2, x_axis) - WaitForTurn (foot2, x_axis) - - Turn (foot1, x_axis, -ta, tspeed) - Turn (foot2, x_axis, ta, tspeed) - Turn (body, bodyWiggleAxis, ta/4, tspeed) - WaitForTurn (foot2, x_axis) - WaitForTurn (foot2, x_axis) - Sleep (10) - - WaitForTurn (wing1, z_axis, math.rad(math.random(-20,20)), tspeed) - WaitForTurn (wing2, z_axis, math.rad(math.random(-20,20)), tspeed) - end + Sleep(math.random(0, 100)) + while true do + Turn(foot1, x_axis, ta, tspeed) + Turn(foot2, x_axis, -ta, tspeed) + Turn(body, bodyWiggleAxis, -ta / 4, tspeed) + WaitForTurn(foot2, x_axis) + WaitForTurn(foot2, x_axis) + + Turn(foot1, x_axis, -ta, tspeed) + Turn(foot2, x_axis, ta, tspeed) + Turn(body, bodyWiggleAxis, ta / 4, tspeed) + WaitForTurn(foot2, x_axis) + WaitForTurn(foot2, x_axis) + Sleep(10) + + WaitForTurn(wing1, z_axis, math.rad(math.random(-20, 20)), tspeed) + WaitForTurn(wing2, z_axis, math.rad(math.random(-20, 20)), tspeed) + end end function stopwalk() Signal(SIG_WALK) --stop the walk thread - Turn (foot1, x_axis, 0, tspeed) - Turn (foot2, x_axis, 0, tspeed) + Turn(foot1, x_axis, 0, tspeed) + Turn(foot2, x_axis, 0, tspeed) --Turn (body, x_axis, math.rad (0), math.rad (45)) end @@ -51,36 +51,37 @@ function script.StartMoving() --Turn (body, x_axis, math.rad (10), math.rad (45)) StartThread(walk) end - + function script.StopMoving() StartThread(stopwalk) - - Turn (body, z_axis, 0, tspeed*2) - Turn (body, y_axis, 0, tspeed*2) + + Turn(body, z_axis, 0, tspeed * 2) + Turn(body, y_axis, 0, tspeed * 2) end -function script.setSFXoccupy (curTerrainType) +function script.setSFXoccupy(curTerrainType) if curTerrainType == 2 then - Turn (body, x_axis, math.rad(80), tspeed) + Turn(body, x_axis, math.rad(80), tspeed) --bodyWiggleAxis = y_axis end - if curTerrainType == 4 or curTerrainType == 1 then --must be stupid like this or they change to walking too late and clip into shore - StartThread (jump) - Turn (body, x_axis, 0, tspeed*2) + if curTerrainType == 4 or curTerrainType == 1 then --must be stupid like this or they change to walking too late and clip into shore + StartThread(jump) + Turn(body, x_axis, 0, tspeed * 2) --bodyWiggleAxis = z_axis end end local lastJump = 0 function jump() - if GetGameFrame () -lastJump < 40 then return end - Move (body, y_axis, 15,40) - WaitForMove (body,y_axis) - Move (body, y_axis, 0,40) - lastJump = Spring.GetGameFrame () + if GetGameFrame() - lastJump < 40 then + return + end + Move(body, y_axis, 15, 40) + WaitForMove(body, y_axis) + Move(body, y_axis, 0, 40) + lastJump = Spring.GetGameFrame() end - function script.AimFromWeapon1() return flare1 end @@ -96,7 +97,6 @@ function script.QueryWeapon2() return flare2 end - function script.AimWeapon1(heading, pitch) return true end @@ -111,8 +111,6 @@ function script.FireWeapon2() return true end -function script.Shot1() -end +function script.Shot1() end -function script.Killed() -end +function script.Killed() end diff --git a/scripts/Units/armcom_lus.lua b/scripts/Units/armcom_lus.lua index c9da63f53c2..6eac5358a70 100644 --- a/scripts/Units/armcom_lus.lua +++ b/scripts/Units/armcom_lus.lua @@ -1,10 +1,8 @@ --INCREMENT THIS COUNTER FOR EVERY HOUR OF YOUR LIFE WASTED HERE: 38 - - --Skeleton pieces --local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl,hatpoint, crown, medalsilver, medalbronze, medalgold, cagelight, cagelight_emit = piece("head", "torso", "luparm", "biggun", "ruparm","rloarm","lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh" ,"lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1","bigguncyl","hatpoint", "crown", "medalsilver", "medalbronze", "medalgold", "cagelight", "cagelight_emit") -local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl, crown, medalsilver, medalbronze, medalgold, armhexl, armhexl2, armhexl_emit, armhexl2_emit, hatcosmeticpoint, rightshouldercosmeticpoint, leftshouldercosmeticpoint, necklacecosmeticpoint, beltcosmeticpoint = piece("head", "torso", "luparm", "biggun", "ruparm","rloarm","lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh" ,"lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1","bigguncyl", "crown", "medalsilver", "medalbronze", "medalgold", "armhexl", "armhexl2", "armhexl_emit", "armhexl2_emit", "hatcosmeticpoint", "rightshouldercosmeticpoint", "leftshouldercosmeticpoint", "necklacecosmeticpoint", "beltcosmeticpoint") +local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl, crown, medalsilver, medalbronze, medalgold, armhexl, armhexl2, armhexl_emit, armhexl2_emit, hatcosmeticpoint, rightshouldercosmeticpoint, leftshouldercosmeticpoint, necklacecosmeticpoint, beltcosmeticpoint = piece("head", "torso", "luparm", "biggun", "ruparm", "rloarm", "lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh", "lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1", "bigguncyl", "crown", "medalsilver", "medalbronze", "medalgold", "armhexl", "armhexl2", "armhexl_emit", "armhexl2_emit", "hatcosmeticpoint", "rightshouldercosmeticpoint", "leftshouldercosmeticpoint", "necklacecosmeticpoint", "beltcosmeticpoint") local weapons = { [1] = "laser", @@ -39,9 +37,7 @@ local weapons = { [30] = "dgun", [31] = "dgun", [32] = "dgun", - } - - +} local SIG_AIM = 2 local SIG_WALK = 4 @@ -50,11 +46,11 @@ local SIG_WALK = 4 local last_primary_heading = -1000000 local function BelowWater(piecename) - local _,y,_ = Spring.GetUnitPiecePosition(unitID, piecename) - -- this returns unit space, so why does it work for corcom? - local _, py, _ = Spring.GetUnitPosition(unitID) - --Spring.Echo(piecename, 'ypos', y, py) - if (y+ py) <= 0 then + local _, y, _ = Spring.GetUnitPiecePosition(unitID, piecename) + -- this returns unit space, so why does it work for corcom? + local _, py, _ = Spring.GetUnitPosition(unitID) + --Spring.Echo(piecename, 'ypos', y, py) + if (y + py) <= 0 then return true else return false @@ -80,378 +76,530 @@ local function move(piece, axis, goal, speed) end function walk() - if (bMoving) then --Frame:4 - if (leftArm) then turn(biggun, 1, -48.215180, 113.735764/animSpeed) --delta=-3.79 - turn(head, 1, -2.620635, 39.654598/animSpeed) --delta=1.32 - turn(head, 2, -3.829846, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -33.266887, 1084.110406/animSpeed) --delta=36.14 - turn(lleg, 1, 55.932201, 1005.195679/animSpeed) --delta=-33.51 - turn(lthigh, 1, -55.237751, 1023.679605/animSpeed) --delta=34.12 - turn(lthigh, 3, 10.085981, 605.673206/animSpeed) --delta=-20.19 - turn(lthigh, 2, 15.046731, 118.088344/animSpeed) --delta=3.94 - if (leftArm) then turn(luparm, 1, 9.919362, 279.367450/animSpeed) end --delta=9.31 - if (leftArm) then turn(luparm, 3, -12.399998, 114.000041/animSpeed) end--delta=-3.80 - if (leftArm) then turn(luparm, 2, 0.965138, 187.380006/animSpeed) end--delta=-6.25 - turn(pelvis, 3, -1.666667, 49.999997/animSpeed) --delta=1.67 - turn(pelvis, 2, -2.296296, 68.888891/animSpeed) --delta=-2.30 - turn(rfoot, 1, -24.788553, 756.115081/animSpeed) --delta=25.20 - turn(rleg, 1, 21.945633, 114.672797/animSpeed) --delta=3.82 - if (rightArm) then turn(rloarm, 1, -56.129627, 87.888962/animSpeed) end--delta=2.93 - turn(rthigh, 1, 3.073465, 750.722777/animSpeed) --delta=-25.02 - turn(rthigh, 3, 1.955836, 223.218383/animSpeed) --delta=7.44 - turn(rthigh, 2, -0.370374, 346.061345/animSpeed) --delta=11.54 - if (rightArm) then turn(ruparm, 1, 21.424041, 98.073542/animSpeed) end--delta=3.27 - if (rightArm) then turn(ruparm, 2, 1.762963, 52.888889/animSpeed) end--delta=1.76 - turn(torso, 1, -4.288164, 60.727696/animSpeed) --delta=2.02 - turn(torso, 3, 1.713372, 51.401158/animSpeed) --delta=-1.71 - turn(torso, 2, 7.879434, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:4 + if leftArm then + turn(biggun, 1, -48.215180, 113.735764 / animSpeed) --delta=-3.79 + turn(head, 1, -2.620635, 39.654598 / animSpeed) --delta=1.32 + turn(head, 2, -3.829846, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -33.266887, 1084.110406 / animSpeed) --delta=36.14 + turn(lleg, 1, 55.932201, 1005.195679 / animSpeed) --delta=-33.51 + turn(lthigh, 1, -55.237751, 1023.679605 / animSpeed) --delta=34.12 + turn(lthigh, 3, 10.085981, 605.673206 / animSpeed) --delta=-20.19 + turn(lthigh, 2, 15.046731, 118.088344 / animSpeed) --delta=3.94 + if leftArm then + turn(luparm, 1, 9.919362, 279.367450 / animSpeed) + end --delta=9.31 + if leftArm then + turn(luparm, 3, -12.399998, 114.000041 / animSpeed) + end --delta=-3.80 + if leftArm then + turn(luparm, 2, 0.965138, 187.380006 / animSpeed) + end --delta=-6.25 + turn(pelvis, 3, -1.666667, 49.999997 / animSpeed) --delta=1.67 + turn(pelvis, 2, -2.296296, 68.888891 / animSpeed) --delta=-2.30 + turn(rfoot, 1, -24.788553, 756.115081 / animSpeed) --delta=25.20 + turn(rleg, 1, 21.945633, 114.672797 / animSpeed) --delta=3.82 + if rightArm then + turn(rloarm, 1, -56.129627, 87.888962 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 3.073465, 750.722777 / animSpeed) --delta=-25.02 + turn(rthigh, 3, 1.955836, 223.218383 / animSpeed) --delta=7.44 + turn(rthigh, 2, -0.370374, 346.061345 / animSpeed) --delta=11.54 + if rightArm then + turn(ruparm, 1, 21.424041, 98.073542 / animSpeed) + end --delta=3.27 + if rightArm then + turn(ruparm, 2, 1.762963, 52.888889 / animSpeed) + end --delta=1.76 + turn(torso, 1, -4.288164, 60.727696 / animSpeed) --delta=2.02 + turn(torso, 3, 1.713372, 51.401158 / animSpeed) --delta=-1.71 + turn(torso, 2, 7.879434, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end - while(bMoving) do - if (bMoving) then --Frame:8 - if (leftArm) then turn(biggun, 1, -46.675856, 46.179694/animSpeed) end--delta=-1.54 - turn(head, 1, -1.563179, 31.723679/animSpeed) --delta=-1.06 - turn(head, 2, -6.127755, 68.937274/animSpeed) --delta=-2.30 - turn(lfoot, 1, 3.301643, 1097.055898/animSpeed) --delta=-36.57 - turn(lleg, 1, 21.188054, 1042.324382/animSpeed) --delta=34.74 - turn(lthigh, 1, -49.309980, 177.833127/animSpeed) --delta=-5.93 - turn(lthigh, 3, 12.410994, 69.750404/animSpeed) --delta=-2.33 - turn(lthigh, 2, 17.664281, 78.526514/animSpeed) --delta=2.62 - if (leftArm) then turn(luparm, 1, 17.175860, 217.694940/animSpeed) end--delta=-7.26 - if (leftArm) then turn(luparm, 2, 2.994882, 60.892341/animSpeed) end--delta=2.03 - move (pelvis, 2, -1.370370 , 8.888887 /animSpeed) --delta=-0.30 - turn(pelvis, 3, -4.074074, 72.222229/animSpeed) --delta=2.41 - turn(pelvis, 2, -5.185185, 86.666661/animSpeed) --delta=-2.89 - turn(rfoot, 1, -24.385273, 12.098399/animSpeed) --delta=-0.40 - turn(rleg, 1, 2.775391, 575.107266/animSpeed) --delta=19.17 - if (rightArm) then turn(rloarm, 1, -61.570378, 163.222533/animSpeed) end--delta=5.44 - turn(rthigh, 1, 24.923063, 655.487959/animSpeed) --delta=-21.85 - turn(rthigh, 3, 7.511525, 166.670667/animSpeed) --delta=-5.56 - turn(rthigh, 2, -5.809679, 163.179149/animSpeed) --delta=-5.44 - if (rightArm) then turn(ruparm, 1, 16.696394, 141.829407/animSpeed) end--delta=4.73 - if (rightArm) then turn(ruparm, 2, 5.908277, 124.359412/animSpeed) end--delta=4.15 - turn(torso, 1, -3.674753, 18.402335/animSpeed) --delta=-0.61 - turn(torso, 3, 4.188244, 74.246156/animSpeed) --delta=-2.47 - turn(torso, 2, 13.926961, 181.425790/animSpeed) --delta=6.05 - Sleep( (33*animSpeed) -1) + while bMoving do + if bMoving then --Frame:8 + if leftArm then + turn(biggun, 1, -46.675856, 46.179694 / animSpeed) + end --delta=-1.54 + turn(head, 1, -1.563179, 31.723679 / animSpeed) --delta=-1.06 + turn(head, 2, -6.127755, 68.937274 / animSpeed) --delta=-2.30 + turn(lfoot, 1, 3.301643, 1097.055898 / animSpeed) --delta=-36.57 + turn(lleg, 1, 21.188054, 1042.324382 / animSpeed) --delta=34.74 + turn(lthigh, 1, -49.309980, 177.833127 / animSpeed) --delta=-5.93 + turn(lthigh, 3, 12.410994, 69.750404 / animSpeed) --delta=-2.33 + turn(lthigh, 2, 17.664281, 78.526514 / animSpeed) --delta=2.62 + if leftArm then + turn(luparm, 1, 17.175860, 217.694940 / animSpeed) + end --delta=-7.26 + if leftArm then + turn(luparm, 2, 2.994882, 60.892341 / animSpeed) + end --delta=2.03 + move(pelvis, 2, -1.370370, 8.888887 / animSpeed) --delta=-0.30 + turn(pelvis, 3, -4.074074, 72.222229 / animSpeed) --delta=2.41 + turn(pelvis, 2, -5.185185, 86.666661 / animSpeed) --delta=-2.89 + turn(rfoot, 1, -24.385273, 12.098399 / animSpeed) --delta=-0.40 + turn(rleg, 1, 2.775391, 575.107266 / animSpeed) --delta=19.17 + if rightArm then + turn(rloarm, 1, -61.570378, 163.222533 / animSpeed) + end --delta=5.44 + turn(rthigh, 1, 24.923063, 655.487959 / animSpeed) --delta=-21.85 + turn(rthigh, 3, 7.511525, 166.670667 / animSpeed) --delta=-5.56 + turn(rthigh, 2, -5.809679, 163.179149 / animSpeed) --delta=-5.44 + if rightArm then + turn(ruparm, 1, 16.696394, 141.829407 / animSpeed) + end --delta=4.73 + if rightArm then + turn(ruparm, 2, 5.908277, 124.359412 / animSpeed) + end --delta=4.15 + turn(torso, 1, -3.674753, 18.402335 / animSpeed) --delta=-0.61 + turn(torso, 3, 4.188244, 74.246156 / animSpeed) --delta=-2.47 + turn(torso, 2, 13.926961, 181.425790 / animSpeed) --delta=6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:12 - if (leftArm) then turn(biggun, 1, -46.110552, 16.959121/animSpeed) end--delta=-0.57 - turn(head, 1, 0.023005, 47.585527/animSpeed) --delta=-1.59 - turn(head, 2, -7.659692, 45.958102/animSpeed) --delta=-1.53 - turn(lfoot, 1, 11.411680, 243.301125/animSpeed) --delta=-8.11 - turn(lleg, 1, -6.333642, 825.650884/animSpeed) --delta=27.52 - turn(lthigh, 1, -28.939382, 611.117960/animSpeed) --delta=-20.37 - turn(lthigh, 3, 10.100023, 69.329144/animSpeed) --delta=2.31 - turn(lthigh, 2, 14.540810, 93.704134/animSpeed) --delta=-3.12 - if (leftArm) then turn(luparm, 1, 20.474264, 98.952127/animSpeed) end--delta=-3.30 - if (leftArm) then turn(luparm, 2, 5.388938, 71.821661/animSpeed) end--delta=2.39 - move (pelvis, 2, -2.000000 , 18.888888 /animSpeed) --delta=-0.63 - turn(pelvis, 3, -5.000000, 27.777769/animSpeed) --delta=0.93 - turn(pelvis, 2, -6.000000, 24.444453/animSpeed) --delta=-0.81 - turn(rfoot, 1, -34.556331, 305.131751/animSpeed) --delta=10.17 - turn(rleg, 1, 32.187523, 882.363941/animSpeed) --delta=-29.41 - if (rightArm) then turn(rloarm, 1, -64.499997, 87.888552/animSpeed) end--delta=2.93 - turn(rthigh, 1, 18.715526, 186.226115/animSpeed) --delta=6.21 - turn(rthigh, 3, 9.760341, 67.464476/animSpeed) --delta=-2.25 - turn(rthigh, 2, -5.182428, 18.817525/animSpeed) --delta=0.63 - if (rightArm) then turn(ruparm, 1, 12.622570, 122.214735/animSpeed) end--delta=4.07 - if (rightArm) then turn(ruparm, 2, 6.799999, 26.751678/animSpeed) end--delta=0.89 - turn(torso, 1, -2.141225, 46.005832/animSpeed) --delta=-1.53 - turn(torso, 3, 5.140116, 28.556180/animSpeed) --delta=-0.95 - turn(torso, 2, 15.758869, 54.957239/animSpeed) --delta=1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:12 + if leftArm then + turn(biggun, 1, -46.110552, 16.959121 / animSpeed) + end --delta=-0.57 + turn(head, 1, 0.023005, 47.585527 / animSpeed) --delta=-1.59 + turn(head, 2, -7.659692, 45.958102 / animSpeed) --delta=-1.53 + turn(lfoot, 1, 11.411680, 243.301125 / animSpeed) --delta=-8.11 + turn(lleg, 1, -6.333642, 825.650884 / animSpeed) --delta=27.52 + turn(lthigh, 1, -28.939382, 611.117960 / animSpeed) --delta=-20.37 + turn(lthigh, 3, 10.100023, 69.329144 / animSpeed) --delta=2.31 + turn(lthigh, 2, 14.540810, 93.704134 / animSpeed) --delta=-3.12 + if leftArm then + turn(luparm, 1, 20.474264, 98.952127 / animSpeed) + end --delta=-3.30 + if leftArm then + turn(luparm, 2, 5.388938, 71.821661 / animSpeed) + end --delta=2.39 + move(pelvis, 2, -2.000000, 18.888888 / animSpeed) --delta=-0.63 + turn(pelvis, 3, -5.000000, 27.777769 / animSpeed) --delta=0.93 + turn(pelvis, 2, -6.000000, 24.444453 / animSpeed) --delta=-0.81 + turn(rfoot, 1, -34.556331, 305.131751 / animSpeed) --delta=10.17 + turn(rleg, 1, 32.187523, 882.363941 / animSpeed) --delta=-29.41 + if rightArm then + turn(rloarm, 1, -64.499997, 87.888552 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 18.715526, 186.226115 / animSpeed) --delta=6.21 + turn(rthigh, 3, 9.760341, 67.464476 / animSpeed) --delta=-2.25 + turn(rthigh, 2, -5.182428, 18.817525 / animSpeed) --delta=0.63 + if rightArm then + turn(ruparm, 1, 12.622570, 122.214735 / animSpeed) + end --delta=4.07 + if rightArm then + turn(ruparm, 2, 6.799999, 26.751678 / animSpeed) + end --delta=0.89 + turn(torso, 1, -2.141225, 46.005832 / animSpeed) --delta=-1.53 + turn(torso, 3, 5.140116, 28.556180 / animSpeed) --delta=-0.95 + turn(torso, 2, 15.758869, 54.957239 / animSpeed) --delta=1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:16 - - if (leftArm) then turn(biggun, 1, -47.068049, 28.724907/animSpeed) end--delta=0.96 - turn(head, 1, -0.505722, 15.861819/animSpeed) --delta=0.53 - turn(head, 2, -6.127755, 45.958102/animSpeed) --delta=1.53 - turn(lfoot, 1, 2.879686, 255.959826/animSpeed) --delta=8.53 - turn(lleg, 1, 40.292208, 1398.775490/animSpeed) --delta=-46.63 - turn(lthigh, 1, -49.313423, 611.221232/animSpeed) --delta=20.37 - turn(lthigh, 3, 11.258773, 34.762504/animSpeed) --delta=-1.16 - turn(lthigh, 2, 17.221502, 80.420765/animSpeed) --delta=2.68 - if (leftArm) then turn(luparm, 1, 19.047441, 42.804693/animSpeed) end--delta=1.43 - move (pelvis, 2, -2.833333 , 25.000005 /animSpeed) --delta=-0.83 - turn(pelvis, 3, -3.962963, 31.111110/animSpeed) --delta=-1.04 - turn(pelvis, 2, -5.026455, 29.206358/animSpeed) --delta=0.97 - turn(rfoot, 1, -27.196287, 220.801335/animSpeed) --delta=-7.36 - turn(rleg, 1, 78.322421, 1384.046960/animSpeed) --delta=-46.13 - turn(rleg, 3, -0.165893, 4.758378/animSpeed) --delta=0.16 - turn(rleg, 2, 0.140044, 4.092714/animSpeed) --delta=0.14 - if (rightArm) then turn(rloarm, 1, -62.031478, 74.055575/animSpeed) end--delta=-2.47 - turn(rthigh, 1, -2.425270, 634.223885/animSpeed) --delta=21.14 - turn(rthigh, 3, 5.889018, 116.139691/animSpeed) --delta=3.87 - turn(rthigh, 2, 2.215249, 221.930321/animSpeed) --delta=7.40 - if (rightArm) then turn(ruparm, 1, 12.782766, 4.805883/animSpeed) end--delta=-0.16 - if (rightArm) then turn(ruparm, 2, 6.141609, 19.751703/animSpeed) end--delta=-0.66 - turn(torso, 1, -3.061342, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, 4.074019, 31.982933/animSpeed) --delta=1.07 - turn(torso, 2, 13.926961, 54.957239/animSpeed) --delta=-1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:16 + if leftArm then + turn(biggun, 1, -47.068049, 28.724907 / animSpeed) + end --delta=0.96 + turn(head, 1, -0.505722, 15.861819 / animSpeed) --delta=0.53 + turn(head, 2, -6.127755, 45.958102 / animSpeed) --delta=1.53 + turn(lfoot, 1, 2.879686, 255.959826 / animSpeed) --delta=8.53 + turn(lleg, 1, 40.292208, 1398.775490 / animSpeed) --delta=-46.63 + turn(lthigh, 1, -49.313423, 611.221232 / animSpeed) --delta=20.37 + turn(lthigh, 3, 11.258773, 34.762504 / animSpeed) --delta=-1.16 + turn(lthigh, 2, 17.221502, 80.420765 / animSpeed) --delta=2.68 + if leftArm then + turn(luparm, 1, 19.047441, 42.804693 / animSpeed) + end --delta=1.43 + move(pelvis, 2, -2.833333, 25.000005 / animSpeed) --delta=-0.83 + turn(pelvis, 3, -3.962963, 31.111110 / animSpeed) --delta=-1.04 + turn(pelvis, 2, -5.026455, 29.206358 / animSpeed) --delta=0.97 + turn(rfoot, 1, -27.196287, 220.801335 / animSpeed) --delta=-7.36 + turn(rleg, 1, 78.322421, 1384.046960 / animSpeed) --delta=-46.13 + turn(rleg, 3, -0.165893, 4.758378 / animSpeed) --delta=0.16 + turn(rleg, 2, 0.140044, 4.092714 / animSpeed) --delta=0.14 + if rightArm then + turn(rloarm, 1, -62.031478, 74.055575 / animSpeed) + end --delta=-2.47 + turn(rthigh, 1, -2.425270, 634.223885 / animSpeed) --delta=21.14 + turn(rthigh, 3, 5.889018, 116.139691 / animSpeed) --delta=3.87 + turn(rthigh, 2, 2.215249, 221.930321 / animSpeed) --delta=7.40 + if rightArm then + turn(ruparm, 1, 12.782766, 4.805883 / animSpeed) + end --delta=-0.16 + if rightArm then + turn(ruparm, 2, 6.141609, 19.751703 / animSpeed) + end --delta=-0.66 + turn(torso, 1, -3.061342, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, 4.074019, 31.982933 / animSpeed) --delta=1.07 + turn(torso, 2, 13.926961, 54.957239 / animSpeed) --delta=-1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:20 + if bMoving then --Frame:20 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(lfootstep, 1024 + 2) end - if (leftArm) then turn(biggun, 1, -49.335727, 68.030323/animSpeed) end--delta=2.27 - turn(head, 1, -2.091907, 47.585562/animSpeed) --delta=1.59 - turn(head, 2, -3.829846, 68.937274/animSpeed) --delta=2.30 - turn(lfoot, 1, -11.362748, 427.273021/animSpeed) --delta=14.24 - turn(lleg, 1, 55.773467, 464.437769/animSpeed) --delta=-15.48 - turn(lthigh, 1, -43.832869, 164.416621/animSpeed) --delta=-5.48 - turn(lthigh, 3, 4.706604, 196.565054/animSpeed) --delta=6.55 - turn(lthigh, 2, 8.321622, 266.996423/animSpeed) --delta=-8.90 - if (leftArm) then turn(luparm, 1, 15.615877, 102.946916/animSpeed) end--delta=3.43 - if (leftArm) then turn(luparm, 2, 5.076670, 9.368019/animSpeed) end--delta=-0.31 - turn(pelvis, 3, -2.000000, 58.888879/animSpeed) --delta=-1.96 - turn(pelvis, 2, -2.772487, 67.619039/animSpeed) --delta=2.25 - turn(rfoot, 1, -39.119034, 357.682424/animSpeed) --delta=11.92 - turn(rleg, 1, 104.636879, 789.433742/animSpeed) --delta=-26.31 - turn(rleg, 3, 0.031377, 5.918091/animSpeed) --delta=-0.20 - turn(rleg, 2, -0.045903, 5.578386/animSpeed) --delta=-0.19 - if (rightArm) then turn(rloarm, 1, -56.185181, 175.388910/animSpeed) end--delta=-5.85 - turn(rthigh, 1, -29.245227, 804.598715/animSpeed) --delta=26.82 - turn(rthigh, 3, 3.330593, 76.752755/animSpeed) --delta=2.56 - turn(rthigh, 2, -1.498384, 111.408996/animSpeed) --delta=-3.71 - if (rightArm) then turn(ruparm, 1, 13.904138, 33.641183/animSpeed) end--delta=-1.12 - if (rightArm) then turn(ruparm, 2, 2.429630, 111.359389/animSpeed) end--delta=-3.71 - turn(torso, 1, -3.981459, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, 2.056047, 60.539158/animSpeed) --delta=2.02 - turn(torso, 2, 7.879434, 181.425790/animSpeed) --delta=-6.05 - Sleep( (33*animSpeed) -1) + if leftArm then + turn(biggun, 1, -49.335727, 68.030323 / animSpeed) + end --delta=2.27 + turn(head, 1, -2.091907, 47.585562 / animSpeed) --delta=1.59 + turn(head, 2, -3.829846, 68.937274 / animSpeed) --delta=2.30 + turn(lfoot, 1, -11.362748, 427.273021 / animSpeed) --delta=14.24 + turn(lleg, 1, 55.773467, 464.437769 / animSpeed) --delta=-15.48 + turn(lthigh, 1, -43.832869, 164.416621 / animSpeed) --delta=-5.48 + turn(lthigh, 3, 4.706604, 196.565054 / animSpeed) --delta=6.55 + turn(lthigh, 2, 8.321622, 266.996423 / animSpeed) --delta=-8.90 + if leftArm then + turn(luparm, 1, 15.615877, 102.946916 / animSpeed) + end --delta=3.43 + if leftArm then + turn(luparm, 2, 5.076670, 9.368019 / animSpeed) + end --delta=-0.31 + turn(pelvis, 3, -2.000000, 58.888879 / animSpeed) --delta=-1.96 + turn(pelvis, 2, -2.772487, 67.619039 / animSpeed) --delta=2.25 + turn(rfoot, 1, -39.119034, 357.682424 / animSpeed) --delta=11.92 + turn(rleg, 1, 104.636879, 789.433742 / animSpeed) --delta=-26.31 + turn(rleg, 3, 0.031377, 5.918091 / animSpeed) --delta=-0.20 + turn(rleg, 2, -0.045903, 5.578386 / animSpeed) --delta=-0.19 + if rightArm then + turn(rloarm, 1, -56.185181, 175.388910 / animSpeed) + end --delta=-5.85 + turn(rthigh, 1, -29.245227, 804.598715 / animSpeed) --delta=26.82 + turn(rthigh, 3, 3.330593, 76.752755 / animSpeed) --delta=2.56 + turn(rthigh, 2, -1.498384, 111.408996 / animSpeed) --delta=-3.71 + if rightArm then + turn(ruparm, 1, 13.904138, 33.641183 / animSpeed) + end --delta=-1.12 + if rightArm then + turn(ruparm, 2, 2.429630, 111.359389 / animSpeed) + end --delta=-3.71 + turn(torso, 1, -3.981459, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, 2.056047, 60.539158 / animSpeed) --delta=2.02 + turn(torso, 2, 7.879434, 181.425790 / animSpeed) --delta=-6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:24 - if (leftArm) then turn(biggun, 1, -52.006372, 80.119348/animSpeed) end--delta=2.67 - turn(head, 1, -3.149363, 31.723676/animSpeed) --delta=1.06 - turn(head, 2, 0.000000, 114.895376/animSpeed) --delta=3.83 - turn(lfoot, 1, -23.280778, 357.540911/animSpeed) --delta=11.92 - turn(lleg, 1, 46.510843, 277.878733/animSpeed) --delta=9.26 - turn(lthigh, 1, -23.415420, 612.523459/animSpeed) --delta=-20.42 - turn(lthigh, 3, 0.280779, 132.774760/animSpeed) --delta=4.43 - turn(lthigh, 2, 1.272165, 211.483711/animSpeed) --delta=-7.05 - if (leftArm) then turn(luparm, 1, 11.452920, 124.888703/animSpeed) end--delta=4.16 - if (leftArm) then turn(luparm, 2, 3.308728, 53.038265/animSpeed) end--delta=-1.77 - move (pelvis, 2, -2.000000 , 25.555551 /animSpeed) --delta=0.85 - turn(pelvis, 3, -0.000000, 60.000006/animSpeed) --delta=-2.00 - turn(pelvis, 2, 0.000000, 83.174607/animSpeed) --delta=2.77 - turn(rfoot, 1, -45.278120, 184.772566/animSpeed) --delta=6.16 - turn(rleg, 1, 90.786697, 415.505474/animSpeed) --delta=13.85 - turn(rleg, 3, 0.843235, 24.355743/animSpeed) --delta=-0.81 - turn(rleg, 2, -0.860075, 24.425185/animSpeed) --delta=-0.81 - if (rightArm) then turn(rloarm, 1, -49.299998, 206.555473/animSpeed) end--delta=-6.89 - turn(rthigh, 1, -43.951970, 441.202285/animSpeed) --delta=14.71 - turn(rthigh, 3, -2.997201, 189.833832/animSpeed) --delta=6.33 - turn(rthigh, 2, -9.866792, 251.052245/animSpeed) --delta=-8.37 - if (rightArm) then turn(ruparm, 1, 16.947865, 91.311783/animSpeed) end--delta=-3.04 - if (rightArm) then turn(ruparm, 2, 0.900000, 45.888888/animSpeed) end--delta=-1.53 - turn(torso, 1, -4.594870, 18.402335/animSpeed) --delta=0.61 - turn(torso, 3, -0.000000, 61.681404/animSpeed) --delta=2.06 - turn(torso, 2, 0.000000, 236.383029/animSpeed) --delta=-7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:24 + if leftArm then + turn(biggun, 1, -52.006372, 80.119348 / animSpeed) + end --delta=2.67 + turn(head, 1, -3.149363, 31.723676 / animSpeed) --delta=1.06 + turn(head, 2, 0.000000, 114.895376 / animSpeed) --delta=3.83 + turn(lfoot, 1, -23.280778, 357.540911 / animSpeed) --delta=11.92 + turn(lleg, 1, 46.510843, 277.878733 / animSpeed) --delta=9.26 + turn(lthigh, 1, -23.415420, 612.523459 / animSpeed) --delta=-20.42 + turn(lthigh, 3, 0.280779, 132.774760 / animSpeed) --delta=4.43 + turn(lthigh, 2, 1.272165, 211.483711 / animSpeed) --delta=-7.05 + if leftArm then + turn(luparm, 1, 11.452920, 124.888703 / animSpeed) + end --delta=4.16 + if leftArm then + turn(luparm, 2, 3.308728, 53.038265 / animSpeed) + end --delta=-1.77 + move(pelvis, 2, -2.000000, 25.555551 / animSpeed) --delta=0.85 + turn(pelvis, 3, -0.000000, 60.000006 / animSpeed) --delta=-2.00 + turn(pelvis, 2, 0.000000, 83.174607 / animSpeed) --delta=2.77 + turn(rfoot, 1, -45.278120, 184.772566 / animSpeed) --delta=6.16 + turn(rleg, 1, 90.786697, 415.505474 / animSpeed) --delta=13.85 + turn(rleg, 3, 0.843235, 24.355743 / animSpeed) --delta=-0.81 + turn(rleg, 2, -0.860075, 24.425185 / animSpeed) --delta=-0.81 + if rightArm then + turn(rloarm, 1, -49.299998, 206.555473 / animSpeed) + end --delta=-6.89 + turn(rthigh, 1, -43.951970, 441.202285 / animSpeed) --delta=14.71 + turn(rthigh, 3, -2.997201, 189.833832 / animSpeed) --delta=6.33 + turn(rthigh, 2, -9.866792, 251.052245 / animSpeed) --delta=-8.37 + if rightArm then + turn(ruparm, 1, 16.947865, 91.311783 / animSpeed) + end --delta=-3.04 + if rightArm then + turn(ruparm, 2, 0.900000, 45.888888 / animSpeed) + end --delta=-1.53 + turn(torso, 1, -4.594870, 18.402335 / animSpeed) --delta=0.61 + turn(torso, 3, -0.000000, 61.681404 / animSpeed) --delta=2.06 + turn(torso, 2, 0.000000, 236.383029 / animSpeed) --delta=-7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:28 - if (leftArm) then turn(biggun, 1, -53.142724, 34.090567/animSpeed) end--delta=1.14 - turn(head, 1, -2.620635, 15.861851/animSpeed) --delta=-0.53 - turn(head, 2, 3.829846, 114.895376/animSpeed) --delta=3.83 - turn(lfoot, 1, -28.343677, 151.886946/animSpeed) --delta=5.06 - turn(lleg, 1, 27.564644, 568.385957/animSpeed) --delta=18.95 - turn(lthigh, 1, 1.812986, 756.852171/animSpeed) --delta=-25.23 - turn(lthigh, 3, -2.460308, 82.232611/animSpeed) --delta=2.74 - turn(lthigh, 2, 0.746525, 15.769200/animSpeed) --delta=-0.53 - if (leftArm) then turn(luparm, 1, 8.807109, 79.374337/animSpeed) end--delta=2.65 - if (leftArm) then turn(luparm, 2, -0.396598, 111.159777/animSpeed) end--delta=-3.71 - move (pelvis, 2, -1.129630 , 26.111112 /animSpeed) --delta=0.87 - turn(pelvis, 3, 1.997872, 59.936146/animSpeed) --delta=-2.00 - turn(pelvis, 2, 2.771879, 83.156358/animSpeed) --delta=2.77 - turn(rfoot, 1, -33.707871, 347.107447/animSpeed) --delta=-11.57 - turn(rleg, 1, 56.067203, 1041.584826/animSpeed) --delta=34.72 - turn(rleg, 3, -0.026719, 26.098608/animSpeed) --delta=0.87 - turn(rleg, 2, 0.009522, 26.087929/animSpeed) --delta=0.87 - if (rightArm) then turn(rloarm, 1, -43.425926, 176.222159/animSpeed) end--delta=-5.87 - turn(rthigh, 1, -55.080896, 333.867775/animSpeed) --delta=11.13 - turn(rthigh, 3, -10.747290, 232.502653/animSpeed) --delta=7.75 - turn(rthigh, 2, -16.084974, 186.545461/animSpeed) --delta=-6.22 - if (rightArm) then turn(ruparm, 1, 22.234335, 158.594124/animSpeed) end--delta=-5.29 - if (rightArm) then turn(ruparm, 2, -0.812436, 51.373077/animSpeed) end--delta=-1.71 - turn(torso, 1, -4.288164, 9.201174/animSpeed) --delta=-0.31 - turn(torso, 3, -2.053859, 61.615764/animSpeed) --delta=2.05 - turn(torso, 2, -7.879434, 236.383029/animSpeed) --delta=-7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:28 + if leftArm then + turn(biggun, 1, -53.142724, 34.090567 / animSpeed) + end --delta=1.14 + turn(head, 1, -2.620635, 15.861851 / animSpeed) --delta=-0.53 + turn(head, 2, 3.829846, 114.895376 / animSpeed) --delta=3.83 + turn(lfoot, 1, -28.343677, 151.886946 / animSpeed) --delta=5.06 + turn(lleg, 1, 27.564644, 568.385957 / animSpeed) --delta=18.95 + turn(lthigh, 1, 1.812986, 756.852171 / animSpeed) --delta=-25.23 + turn(lthigh, 3, -2.460308, 82.232611 / animSpeed) --delta=2.74 + turn(lthigh, 2, 0.746525, 15.769200 / animSpeed) --delta=-0.53 + if leftArm then + turn(luparm, 1, 8.807109, 79.374337 / animSpeed) + end --delta=2.65 + if leftArm then + turn(luparm, 2, -0.396598, 111.159777 / animSpeed) + end --delta=-3.71 + move(pelvis, 2, -1.129630, 26.111112 / animSpeed) --delta=0.87 + turn(pelvis, 3, 1.997872, 59.936146 / animSpeed) --delta=-2.00 + turn(pelvis, 2, 2.771879, 83.156358 / animSpeed) --delta=2.77 + turn(rfoot, 1, -33.707871, 347.107447 / animSpeed) --delta=-11.57 + turn(rleg, 1, 56.067203, 1041.584826 / animSpeed) --delta=34.72 + turn(rleg, 3, -0.026719, 26.098608 / animSpeed) --delta=0.87 + turn(rleg, 2, 0.009522, 26.087929 / animSpeed) --delta=0.87 + if rightArm then + turn(rloarm, 1, -43.425926, 176.222159 / animSpeed) + end --delta=-5.87 + turn(rthigh, 1, -55.080896, 333.867775 / animSpeed) --delta=11.13 + turn(rthigh, 3, -10.747290, 232.502653 / animSpeed) --delta=7.75 + turn(rthigh, 2, -16.084974, 186.545461 / animSpeed) --delta=-6.22 + if rightArm then + turn(ruparm, 1, 22.234335, 158.594124 / animSpeed) + end --delta=-5.29 + if rightArm then + turn(ruparm, 2, -0.812436, 51.373077 / animSpeed) + end --delta=-1.71 + turn(torso, 1, -4.288164, 9.201174 / animSpeed) --delta=-0.31 + turn(torso, 3, -2.053859, 61.615764 / animSpeed) --delta=2.05 + turn(torso, 2, -7.879434, 236.383029 / animSpeed) --delta=-7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:32 - if (leftArm) then turn(biggun, 1, -55.253092, 63.311038/animSpeed) end--delta=2.11 - turn(head, 1, -1.563179, 31.723670/animSpeed) --delta=-1.06 - turn(head, 2, 6.127755, 68.937274/animSpeed) --delta=2.30 - turn(lfoot, 1, -21.408024, 208.069572/animSpeed) --delta=-6.94 - turn(lleg, 1, 3.737072, 714.827163/animSpeed) --delta=23.83 - turn(lthigh, 1, 24.379452, 676.993988/animSpeed) --delta=-22.57 - turn(lthigh, 3, -7.321217, 145.827258/animSpeed) --delta=4.86 - turn(lthigh, 2, 5.849079, 153.076646/animSpeed) --delta=5.10 - if (leftArm) then turn(luparm, 1, 2.317686, 194.682700/animSpeed) end--delta=6.49 - if (leftArm) then turn(luparm, 2, -5.045461, 139.465893/animSpeed) end--delta=-4.65 - turn(pelvis, 3, 3.963673, 58.974037/animSpeed) --delta=-1.97 - turn(pelvis, 2, 5.026658, 67.643372/animSpeed) --delta=2.25 - turn(rfoot, 1, -0.546122, 994.852480/animSpeed) --delta=-33.16 - turn(rleg, 1, 21.731893, 1030.059292/animSpeed) --delta=34.34 - if (rightArm) then turn(rloarm, 1, -39.457405, 119.055627/animSpeed) end--delta=-3.97 - turn(rthigh, 1, -48.555555, 195.760223/animSpeed) --delta=-6.53 - turn(rthigh, 3, -12.921380, 65.222706/animSpeed) --delta=2.17 - turn(rthigh, 2, -18.341445, 67.694124/animSpeed) --delta=-2.26 - if (rightArm) then turn(ruparm, 1, 27.520808, 158.594175/animSpeed) end--delta=-5.29 - if (rightArm) then turn(ruparm, 2, -1.893975, 32.446164/animSpeed) end--delta=-1.08 - turn(torso, 1, -3.674753, 18.402335/animSpeed) --delta=-0.61 - turn(torso, 3, -4.074748, 60.626684/animSpeed) --delta=2.02 - turn(torso, 2, -13.926961, 181.425790/animSpeed) --delta=-6.05 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:32 + if leftArm then + turn(biggun, 1, -55.253092, 63.311038 / animSpeed) + end --delta=2.11 + turn(head, 1, -1.563179, 31.723670 / animSpeed) --delta=-1.06 + turn(head, 2, 6.127755, 68.937274 / animSpeed) --delta=2.30 + turn(lfoot, 1, -21.408024, 208.069572 / animSpeed) --delta=-6.94 + turn(lleg, 1, 3.737072, 714.827163 / animSpeed) --delta=23.83 + turn(lthigh, 1, 24.379452, 676.993988 / animSpeed) --delta=-22.57 + turn(lthigh, 3, -7.321217, 145.827258 / animSpeed) --delta=4.86 + turn(lthigh, 2, 5.849079, 153.076646 / animSpeed) --delta=5.10 + if leftArm then + turn(luparm, 1, 2.317686, 194.682700 / animSpeed) + end --delta=6.49 + if leftArm then + turn(luparm, 2, -5.045461, 139.465893 / animSpeed) + end --delta=-4.65 + turn(pelvis, 3, 3.963673, 58.974037 / animSpeed) --delta=-1.97 + turn(pelvis, 2, 5.026658, 67.643372 / animSpeed) --delta=2.25 + turn(rfoot, 1, -0.546122, 994.852480 / animSpeed) --delta=-33.16 + turn(rleg, 1, 21.731893, 1030.059292 / animSpeed) --delta=34.34 + if rightArm then + turn(rloarm, 1, -39.457405, 119.055627 / animSpeed) + end --delta=-3.97 + turn(rthigh, 1, -48.555555, 195.760223 / animSpeed) --delta=-6.53 + turn(rthigh, 3, -12.921380, 65.222706 / animSpeed) --delta=2.17 + turn(rthigh, 2, -18.341445, 67.694124 / animSpeed) --delta=-2.26 + if rightArm then + turn(ruparm, 1, 27.520808, 158.594175 / animSpeed) + end --delta=-5.29 + if rightArm then + turn(ruparm, 2, -1.893975, 32.446164 / animSpeed) + end --delta=-1.08 + turn(torso, 1, -3.674753, 18.402335 / animSpeed) --delta=-0.61 + turn(torso, 3, -4.074748, 60.626684 / animSpeed) --delta=2.02 + turn(torso, 2, -13.926961, 181.425790 / animSpeed) --delta=-6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:36 - - if (leftArm) then turn(biggun, 1, -56.389444, 34.090567/animSpeed) end--delta=1.14 - turn(head, 1, 0.023005, 47.585536/animSpeed) --delta=-1.59 - turn(head, 2, 7.659692, 45.958102/animSpeed) --delta=1.53 - turn(lfoot, 1, -33.511695, 363.110120/animSpeed) --delta=12.10 - turn(lleg, 1, 32.254462, 855.521701/animSpeed) --delta=-28.52 - turn(lthigh, 1, 18.565433, 174.420577/animSpeed) --delta=5.81 - turn(lthigh, 3, -9.818104, 74.906625/animSpeed) --delta=2.50 - turn(lthigh, 2, 5.332458, 15.498655/animSpeed) --delta=-0.52 - if (leftArm) then turn(luparm, 1, -3.274263, 167.758466/animSpeed) end--delta=5.59 - if (leftArm) then turn(luparm, 2, -6.556594, 45.333998/animSpeed) end--delta=-1.51 - move (pelvis, 2, -2.000000 , 25.555555 /animSpeed) --delta=-0.85 - turn(pelvis, 3, 5.000000, 31.089813/animSpeed) --delta=-1.04 - turn(pelvis, 2, 6.000000, 29.200275/animSpeed) --delta=0.97 - turn(rfoot, 1, 4.673420, 156.586261/animSpeed) --delta=-5.22 - turn(rleg, 1, 17.968366, 112.905793/animSpeed) --delta=3.76 - if (rightArm) then turn(rloarm, 1, -38.000000, 43.722158/animSpeed) end--delta=-1.46 - turn(rthigh, 1, -40.972853, 227.481055/animSpeed) --delta=-7.58 - turn(rthigh, 3, -12.483621, 13.132763/animSpeed) --delta=-0.44 - turn(rthigh, 2, -18.495587, 4.624260/animSpeed) --delta=-0.15 - if (rightArm) then turn(ruparm, 1, 29.923749, 72.088224/animSpeed) end--delta=-2.40 - if (rightArm) then turn(ruparm, 2, -2.615000, 21.630765/animSpeed) end--delta=-0.72 - turn(torso, 1, -2.141225, 46.005832/animSpeed) --delta=-1.53 - turn(torso, 3, -5.140116, 31.961046/animSpeed) --delta=1.07 - turn(torso, 2, -15.758869, 54.957239/animSpeed) --delta=-1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:36 + if leftArm then + turn(biggun, 1, -56.389444, 34.090567 / animSpeed) + end --delta=1.14 + turn(head, 1, 0.023005, 47.585536 / animSpeed) --delta=-1.59 + turn(head, 2, 7.659692, 45.958102 / animSpeed) --delta=1.53 + turn(lfoot, 1, -33.511695, 363.110120 / animSpeed) --delta=12.10 + turn(lleg, 1, 32.254462, 855.521701 / animSpeed) --delta=-28.52 + turn(lthigh, 1, 18.565433, 174.420577 / animSpeed) --delta=5.81 + turn(lthigh, 3, -9.818104, 74.906625 / animSpeed) --delta=2.50 + turn(lthigh, 2, 5.332458, 15.498655 / animSpeed) --delta=-0.52 + if leftArm then + turn(luparm, 1, -3.274263, 167.758466 / animSpeed) + end --delta=5.59 + if leftArm then + turn(luparm, 2, -6.556594, 45.333998 / animSpeed) + end --delta=-1.51 + move(pelvis, 2, -2.000000, 25.555555 / animSpeed) --delta=-0.85 + turn(pelvis, 3, 5.000000, 31.089813 / animSpeed) --delta=-1.04 + turn(pelvis, 2, 6.000000, 29.200275 / animSpeed) --delta=0.97 + turn(rfoot, 1, 4.673420, 156.586261 / animSpeed) --delta=-5.22 + turn(rleg, 1, 17.968366, 112.905793 / animSpeed) --delta=3.76 + if rightArm then + turn(rloarm, 1, -38.000000, 43.722158 / animSpeed) + end --delta=-1.46 + turn(rthigh, 1, -40.972853, 227.481055 / animSpeed) --delta=-7.58 + turn(rthigh, 3, -12.483621, 13.132763 / animSpeed) --delta=-0.44 + turn(rthigh, 2, -18.495587, 4.624260 / animSpeed) --delta=-0.15 + if rightArm then + turn(ruparm, 1, 29.923749, 72.088224 / animSpeed) + end --delta=-2.40 + if rightArm then + turn(ruparm, 2, -2.615000, 21.630765 / animSpeed) + end --delta=-0.72 + turn(torso, 1, -2.141225, 46.005832 / animSpeed) --delta=-1.53 + turn(torso, 3, -5.140116, 31.961046 / animSpeed) --delta=1.07 + turn(torso, 2, -15.758869, 54.957239 / animSpeed) --delta=-1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:40 - - if (leftArm) then turn(biggun, 1, -55.431951, 28.724805/animSpeed) end--delta=-0.96 - turn(head, 1, -0.505722, 15.861819/animSpeed) --delta=0.53 - turn(head, 2, 6.127755, 45.958102/animSpeed) --delta=-1.53 - turn(lfoot, 1, -26.332418, 215.378302/animSpeed) --delta=-7.18 - turn(lleg, 1, 78.044494, 1373.700965/animSpeed) --delta=-45.79 - turn(lleg, 3, 0.174770, 5.001042/animSpeed) --delta=-0.17 - turn(lleg, 2, -0.146625, 4.279269/animSpeed) --delta=-0.14 - turn(lthigh, 1, -2.370128, 628.066816/animSpeed) --delta=20.94 - turn(lthigh, 3, -5.835163, 119.488247/animSpeed) --delta=-3.98 - turn(lthigh, 2, -2.219125, 226.547492/animSpeed) --delta=-7.55 - if (leftArm) then turn(luparm, 1, -3.054371, 6.596772/animSpeed) end--delta=-0.22 - if (leftArm) then turn(luparm, 2, -6.061839, 14.842650/animSpeed) end--delta=0.49 - move (pelvis, 2, -2.851852 , 25.555558 /animSpeed) --delta=-0.85 - turn(pelvis, 3, 3.933333, 31.999991/animSpeed) --delta=1.07 - turn(pelvis, 2, 4.992593, 30.222230/animSpeed) --delta=-1.01 - turn(rfoot, 1, 5.697123, 30.711083/animSpeed) --delta=-1.02 - turn(rleg, 1, 37.499340, 585.929212/animSpeed) --delta=-19.53 - if (rightArm) then turn(rloarm, 1, -40.468516, 74.055472/animSpeed) end--delta=2.47 - turn(rthigh, 1, -47.862042, 206.675650/animSpeed) --delta=6.89 - turn(rthigh, 3, -11.534632, 28.469671/animSpeed) --delta=-0.95 - turn(rthigh, 2, -17.767171, 21.852473/animSpeed) --delta=0.73 - if (rightArm) then turn(ruparm, 1, 28.884286, 31.183878/animSpeed) end--delta=1.04 - if (rightArm) then turn(ruparm, 2, -1.954060, 19.828204/animSpeed) end--delta=0.66 - turn(torso, 1, -3.061342, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, -4.043559, 32.896722/animSpeed) --delta=-1.10 - turn(torso, 2, -13.926961, 54.957239/animSpeed) --delta=1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:40 + if leftArm then + turn(biggun, 1, -55.431951, 28.724805 / animSpeed) + end --delta=-0.96 + turn(head, 1, -0.505722, 15.861819 / animSpeed) --delta=0.53 + turn(head, 2, 6.127755, 45.958102 / animSpeed) --delta=-1.53 + turn(lfoot, 1, -26.332418, 215.378302 / animSpeed) --delta=-7.18 + turn(lleg, 1, 78.044494, 1373.700965 / animSpeed) --delta=-45.79 + turn(lleg, 3, 0.174770, 5.001042 / animSpeed) --delta=-0.17 + turn(lleg, 2, -0.146625, 4.279269 / animSpeed) --delta=-0.14 + turn(lthigh, 1, -2.370128, 628.066816 / animSpeed) --delta=20.94 + turn(lthigh, 3, -5.835163, 119.488247 / animSpeed) --delta=-3.98 + turn(lthigh, 2, -2.219125, 226.547492 / animSpeed) --delta=-7.55 + if leftArm then + turn(luparm, 1, -3.054371, 6.596772 / animSpeed) + end --delta=-0.22 + if leftArm then + turn(luparm, 2, -6.061839, 14.842650 / animSpeed) + end --delta=0.49 + move(pelvis, 2, -2.851852, 25.555558 / animSpeed) --delta=-0.85 + turn(pelvis, 3, 3.933333, 31.999991 / animSpeed) --delta=1.07 + turn(pelvis, 2, 4.992593, 30.222230 / animSpeed) --delta=-1.01 + turn(rfoot, 1, 5.697123, 30.711083 / animSpeed) --delta=-1.02 + turn(rleg, 1, 37.499340, 585.929212 / animSpeed) --delta=-19.53 + if rightArm then + turn(rloarm, 1, -40.468516, 74.055472 / animSpeed) + end --delta=2.47 + turn(rthigh, 1, -47.862042, 206.675650 / animSpeed) --delta=6.89 + turn(rthigh, 3, -11.534632, 28.469671 / animSpeed) --delta=-0.95 + turn(rthigh, 2, -17.767171, 21.852473 / animSpeed) --delta=0.73 + if rightArm then + turn(ruparm, 1, 28.884286, 31.183878 / animSpeed) + end --delta=1.04 + if rightArm then + turn(ruparm, 2, -1.954060, 19.828204 / animSpeed) + end --delta=0.66 + turn(torso, 1, -3.061342, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, -4.043559, 32.896722 / animSpeed) --delta=-1.10 + turn(torso, 2, -13.926961, 54.957239 / animSpeed) --delta=1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:44 + if bMoving then --Frame:44 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(rfootstep, 1024 + 2) end - if (leftArm) then turn(biggun, 1, -53.164273, 68.030323/animSpeed) end--delta=-2.27 - turn(head, 1, -2.091907, 47.585562/animSpeed) --delta=1.59 - turn(head, 2, 3.829846, 68.937274/animSpeed) --delta=-2.30 - turn(lfoot, 1, -38.582946, 367.515848/animSpeed) --delta=12.25 - turn(lleg, 1, 104.269176, 786.740462/animSpeed) --delta=-26.22 - turn(lleg, 3, -0.034635, 6.282160/animSpeed) --delta=0.21 - turn(lleg, 2, 0.050427, 5.911553/animSpeed) --delta=0.20 - turn(lthigh, 1, -29.086507, 801.491385/animSpeed) --delta=26.72 - turn(lthigh, 3, -3.433171, 72.059742/animSpeed) --delta=-2.40 - turn(lthigh, 2, 1.068465, 98.627710/animSpeed) --delta=3.29 - if (leftArm) then turn(luparm, 1, -1.515114, 46.177713/animSpeed) end--delta=-1.54 - if (leftArm) then turn(luparm, 2, -4.161596, 57.007282/animSpeed) end--delta=1.90 - turn(pelvis, 3, 2.088889, 55.333337/animSpeed) --delta=1.84 - turn(pelvis, 2, 2.874074, 63.555555/animSpeed) --delta=-2.12 - turn(rfoot, 1, -11.381223, 512.350363/animSpeed) --delta=17.08 - turn(rleg, 1, 55.770656, 548.139483/animSpeed) --delta=-18.27 - if (rightArm) then turn(rloarm, 1, -46.314813, 175.388910/animSpeed) end--delta=5.85 - turn(rthigh, 1, -43.758461, 123.107432/animSpeed) --delta=-4.10 - turn(rthigh, 3, -5.082535, 193.562904/animSpeed) --delta=-6.45 - turn(rthigh, 2, -9.017982, 262.475666/animSpeed) --delta=8.75 - if (rightArm) then turn(ruparm, 1, 26.384334, 74.998551/animSpeed) end--delta=2.50 - if (rightArm) then turn(ruparm, 2, -0.722308, 36.952569/animSpeed) end--delta=1.23 - turn(torso, 1, -3.981459, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, -2.147426, 56.883980/animSpeed) --delta=-1.90 - turn(torso, 2, -7.879434, 181.425790/animSpeed) --delta=6.05 - Sleep( (33*animSpeed) -1) + if leftArm then + turn(biggun, 1, -53.164273, 68.030323 / animSpeed) + end --delta=-2.27 + turn(head, 1, -2.091907, 47.585562 / animSpeed) --delta=1.59 + turn(head, 2, 3.829846, 68.937274 / animSpeed) --delta=-2.30 + turn(lfoot, 1, -38.582946, 367.515848 / animSpeed) --delta=12.25 + turn(lleg, 1, 104.269176, 786.740462 / animSpeed) --delta=-26.22 + turn(lleg, 3, -0.034635, 6.282160 / animSpeed) --delta=0.21 + turn(lleg, 2, 0.050427, 5.911553 / animSpeed) --delta=0.20 + turn(lthigh, 1, -29.086507, 801.491385 / animSpeed) --delta=26.72 + turn(lthigh, 3, -3.433171, 72.059742 / animSpeed) --delta=-2.40 + turn(lthigh, 2, 1.068465, 98.627710 / animSpeed) --delta=3.29 + if leftArm then + turn(luparm, 1, -1.515114, 46.177713 / animSpeed) + end --delta=-1.54 + if leftArm then + turn(luparm, 2, -4.161596, 57.007282 / animSpeed) + end --delta=1.90 + turn(pelvis, 3, 2.088889, 55.333337 / animSpeed) --delta=1.84 + turn(pelvis, 2, 2.874074, 63.555555 / animSpeed) --delta=-2.12 + turn(rfoot, 1, -11.381223, 512.350363 / animSpeed) --delta=17.08 + turn(rleg, 1, 55.770656, 548.139483 / animSpeed) --delta=-18.27 + if rightArm then + turn(rloarm, 1, -46.314813, 175.388910 / animSpeed) + end --delta=5.85 + turn(rthigh, 1, -43.758461, 123.107432 / animSpeed) --delta=-4.10 + turn(rthigh, 3, -5.082535, 193.562904 / animSpeed) --delta=-6.45 + turn(rthigh, 2, -9.017982, 262.475666 / animSpeed) --delta=8.75 + if rightArm then + turn(ruparm, 1, 26.384334, 74.998551 / animSpeed) + end --delta=2.50 + if rightArm then + turn(ruparm, 2, -0.722308, 36.952569 / animSpeed) + end --delta=1.23 + turn(torso, 1, -3.981459, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, -2.147426, 56.883980 / animSpeed) --delta=-1.90 + turn(torso, 2, -7.879434, 181.425790 / animSpeed) --delta=6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:48 - if (leftArm) then turn(biggun, 1, -50.493628, 80.119348/animSpeed) end--delta=-2.67 - turn(head, 1, -3.149363, 31.723676/animSpeed) --delta=1.06 - turn(head, 2, 0.000000, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -44.880435, 188.924672/animSpeed) --delta=6.30 - turn(lleg, 1, 90.690391, 407.363547/animSpeed) --delta=13.58 - turn(lleg, 3, -1.028354, 29.811568/animSpeed) --delta=0.99 - turn(lleg, 2, 1.046484, 29.881704/animSpeed) --delta=1.00 - turn(lthigh, 1, -43.881824, 443.859502/animSpeed) --delta=14.80 - turn(lthigh, 3, 2.753780, 185.608529/animSpeed) --delta=-6.19 - turn(lthigh, 2, 9.180887, 243.372656/animSpeed) --delta=8.11 - if (leftArm) then turn(luparm, 1, 2.662867, 125.339441/animSpeed) end--delta=-4.18 - if (leftArm) then turn(luparm, 2, -1.793232, 71.050921/animSpeed) end--delta=2.37 - move (pelvis, 2, -2.000000 , 25.555551 /animSpeed) --delta=0.85 - turn(pelvis, 3, -0.000000, 62.666668/animSpeed) --delta=2.09 - turn(pelvis, 2, 0.000000, 86.222221/animSpeed) --delta=-2.87 - turn(rfoot, 1, -23.519080, 364.135724/animSpeed) --delta=12.14 - turn(rleg, 1, 46.484300, 278.590678/animSpeed) --delta=9.29 - if (rightArm) then turn(rloarm, 1, -53.199999, 206.555576/animSpeed) end--delta=6.89 - turn(rthigh, 1, -23.439316, 609.574354/animSpeed) --delta=-20.32 - turn(rthigh, 3, -0.344027, 142.155249/animSpeed) --delta=-4.74 - turn(rthigh, 2, -1.531381, 224.598052/animSpeed) --delta=7.49 - if (rightArm) then turn(ruparm, 1, 23.351554, 90.983396/animSpeed) end--delta=3.03 - if (rightArm) then turn(ruparm, 2, 0.479402, 36.051284/animSpeed) end--delta=1.20 - turn(torso, 1, -4.594870, 18.402335/animSpeed) --delta=0.61 - turn(torso, 3, -0.000000, 64.422792/animSpeed) --delta=-2.15 - turn(torso, 2, 0.000000, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:48 + if leftArm then + turn(biggun, 1, -50.493628, 80.119348 / animSpeed) + end --delta=-2.67 + turn(head, 1, -3.149363, 31.723676 / animSpeed) --delta=1.06 + turn(head, 2, 0.000000, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -44.880435, 188.924672 / animSpeed) --delta=6.30 + turn(lleg, 1, 90.690391, 407.363547 / animSpeed) --delta=13.58 + turn(lleg, 3, -1.028354, 29.811568 / animSpeed) --delta=0.99 + turn(lleg, 2, 1.046484, 29.881704 / animSpeed) --delta=1.00 + turn(lthigh, 1, -43.881824, 443.859502 / animSpeed) --delta=14.80 + turn(lthigh, 3, 2.753780, 185.608529 / animSpeed) --delta=-6.19 + turn(lthigh, 2, 9.180887, 243.372656 / animSpeed) --delta=8.11 + if leftArm then + turn(luparm, 1, 2.662867, 125.339441 / animSpeed) + end --delta=-4.18 + if leftArm then + turn(luparm, 2, -1.793232, 71.050921 / animSpeed) + end --delta=2.37 + move(pelvis, 2, -2.000000, 25.555551 / animSpeed) --delta=0.85 + turn(pelvis, 3, -0.000000, 62.666668 / animSpeed) --delta=2.09 + turn(pelvis, 2, 0.000000, 86.222221 / animSpeed) --delta=-2.87 + turn(rfoot, 1, -23.519080, 364.135724 / animSpeed) --delta=12.14 + turn(rleg, 1, 46.484300, 278.590678 / animSpeed) --delta=9.29 + if rightArm then + turn(rloarm, 1, -53.199999, 206.555576 / animSpeed) + end --delta=6.89 + turn(rthigh, 1, -23.439316, 609.574354 / animSpeed) --delta=-20.32 + turn(rthigh, 3, -0.344027, 142.155249 / animSpeed) --delta=-4.74 + turn(rthigh, 2, -1.531381, 224.598052 / animSpeed) --delta=7.49 + if rightArm then + turn(ruparm, 1, 23.351554, 90.983396 / animSpeed) + end --delta=3.03 + if rightArm then + turn(ruparm, 2, 0.479402, 36.051284 / animSpeed) + end --delta=1.20 + turn(torso, 1, -4.594870, 18.402335 / animSpeed) --delta=0.61 + turn(torso, 3, -0.000000, 64.422792 / animSpeed) --delta=-2.15 + turn(torso, 2, 0.000000, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:52 - if (leftArm) then turn(biggun, 1, -48.215180, 68.353460/animSpeed) end--delta=-2.28 - turn(head, 1, -2.620635, 15.861851/animSpeed) --delta=-0.53 - turn(head, 2, -3.829846, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -33.266887, 348.406447/animSpeed) --delta=-11.61 - turn(lleg, 1, 55.932201, 1042.745719/animSpeed) --delta=34.76 - turn(lleg, 3, 0.028179, 31.695983/animSpeed) --delta=-1.06 - turn(lleg, 2, -0.009821, 31.689154/animSpeed) --delta=-1.06 - turn(lthigh, 1, -55.237751, 340.677815/animSpeed) --delta=11.36 - turn(lthigh, 3, 10.085981, 219.966025/animSpeed) --delta=-7.33 - turn(lthigh, 2, 15.046731, 175.975325/animSpeed) --delta=5.87 - if (leftArm) then turn(luparm, 1, 9.919362, 217.694824/animSpeed) end--delta=-7.26 - if (leftArm) then turn(luparm, 2, 0.965138, 82.751096/animSpeed) end--delta=2.76 - move (pelvis, 2, -1.074074 , 27.777776 /animSpeed) --delta=0.93 - turn(pelvis, 3, -1.666667, 49.999997/animSpeed) --delta=1.67 - turn(pelvis, 2, -2.296296, 68.888891/animSpeed) --delta=-2.30 - turn(rfoot, 1, -24.788553, 38.084179/animSpeed) --delta=1.27 - turn(rleg, 1, 21.945633, 736.160009/animSpeed) --delta=24.54 - if (rightArm) then turn(rloarm, 1, -56.129627, 87.888859/animSpeed) end--delta=2.93 - turn(rthigh, 1, 3.073465, 795.383403/animSpeed) --delta=-26.51 - turn(rthigh, 3, 1.955836, 68.995906/animSpeed) --delta=-2.30 - turn(rthigh, 2, -0.370374, 34.830198/animSpeed) --delta=1.16 - if (rightArm) then turn(ruparm, 1, 21.424041, 57.825406/animSpeed) end--delta=1.93 - if (rightArm) then turn(ruparm, 2, 1.762963, 38.506840/animSpeed) end--delta=1.28 - turn(torso, 1, -4.288164, 9.201174/animSpeed) --delta=-0.31 - turn(torso, 3, 1.713372, 51.401158/animSpeed) --delta=-1.71 - turn(torso, 2, 7.879434, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:52 + if leftArm then + turn(biggun, 1, -48.215180, 68.353460 / animSpeed) + end --delta=-2.28 + turn(head, 1, -2.620635, 15.861851 / animSpeed) --delta=-0.53 + turn(head, 2, -3.829846, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -33.266887, 348.406447 / animSpeed) --delta=-11.61 + turn(lleg, 1, 55.932201, 1042.745719 / animSpeed) --delta=34.76 + turn(lleg, 3, 0.028179, 31.695983 / animSpeed) --delta=-1.06 + turn(lleg, 2, -0.009821, 31.689154 / animSpeed) --delta=-1.06 + turn(lthigh, 1, -55.237751, 340.677815 / animSpeed) --delta=11.36 + turn(lthigh, 3, 10.085981, 219.966025 / animSpeed) --delta=-7.33 + turn(lthigh, 2, 15.046731, 175.975325 / animSpeed) --delta=5.87 + if leftArm then + turn(luparm, 1, 9.919362, 217.694824 / animSpeed) + end --delta=-7.26 + if leftArm then + turn(luparm, 2, 0.965138, 82.751096 / animSpeed) + end --delta=2.76 + move(pelvis, 2, -1.074074, 27.777776 / animSpeed) --delta=0.93 + turn(pelvis, 3, -1.666667, 49.999997 / animSpeed) --delta=1.67 + turn(pelvis, 2, -2.296296, 68.888891 / animSpeed) --delta=-2.30 + turn(rfoot, 1, -24.788553, 38.084179 / animSpeed) --delta=1.27 + turn(rleg, 1, 21.945633, 736.160009 / animSpeed) --delta=24.54 + if rightArm then + turn(rloarm, 1, -56.129627, 87.888859 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 3.073465, 795.383403 / animSpeed) --delta=-26.51 + turn(rthigh, 3, 1.955836, 68.995906 / animSpeed) --delta=-2.30 + turn(rthigh, 2, -0.370374, 34.830198 / animSpeed) --delta=1.16 + if rightArm then + turn(ruparm, 1, 21.424041, 57.825406 / animSpeed) + end --delta=1.93 + if rightArm then + turn(ruparm, 2, 1.762963, 38.506840 / animSpeed) + end --delta=1.28 + turn(torso, 1, -4.288164, 9.201174 / animSpeed) --delta=-0.31 + turn(torso, 3, 1.713372, 51.401158 / animSpeed) --delta=-1.71 + turn(torso, 2, 7.879434, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end end end @@ -461,8 +609,8 @@ local isDancing = false local function Dance1() Signal(SIG_WALK) SetSignalMask(SIG_WALK) - local speedMult = 1/4 - local sleepTime = 33*4 + local speedMult = 1 / 4 + local sleepTime = 33 * 4 -- Frame: 6 (first step) Turn(head, y_axis, 0.104720, 3.141593 * speedMult) -- delta=6.00 @@ -475,7 +623,7 @@ local function Dance1() Turn(lthigh, x_axis, -0.547990, 6.484738 * speedMult) -- delta=12.38 Turn(lthigh, z_axis, 0.358445, 5.849047 * speedMult) -- delta=11.17 Turn(lthigh, y_axis, -0.015696, 7.280939 * speedMult) -- delta=-13.91 - Move(pelvis, x_axis, - 2.217917, 66.537516 * speedMult) -- delta=2.22 + Move(pelvis, x_axis, -2.217917, 66.537516 * speedMult) -- delta=2.22 Move(pelvis, z_axis, 0.147905, 4.437149 * speedMult) -- delta=0.15 Move(pelvis, y_axis, -2.880190, 56.405711 * speedMult) -- delta=-1.88 Turn(pelvis, z_axis, -0.005986, 0.179589 * speedMult) -- delta=-0.34 @@ -518,7 +666,7 @@ local function Dance1() Turn(luparm, x_axis, 0.239702, 2.878582 * speedMult) -- delta=5.50 Turn(luparm, z_axis, 0.308320, 0.767303 * speedMult) -- delta=1.47 Turn(luparm, y_axis, 0.007498, 3.550799 * speedMult) -- delta=-6.78 - Move(pelvis, x_axis, - 1.298512, 27.582171 * speedMult) -- delta=-0.92 + Move(pelvis, x_axis, -1.298512, 27.582171 * speedMult) -- delta=-0.92 Move(pelvis, y_axis, -2.482196, 11.939836 * speedMult) -- delta=0.40 Turn(pelvis, z_axis, -0.003503, 0.074496 * speedMult) -- delta=0.14 Turn(pelvis, y_axis, 0.083659, 1.779079 * speedMult) -- delta=-3.40 @@ -556,7 +704,7 @@ local function Dance1() Turn(luparm, x_axis, -0.031022, 8.121713 * speedMult) -- delta=15.51 Turn(luparm, z_axis, 0.380483, 2.164890 * speedMult) -- delta=4.13 Turn(luparm, y_axis, -0.326446, 10.018325 * speedMult) -- delta=-19.13 - Move(pelvis, x_axis, 1.748151, 91.399884 * speedMult) -- delta=-3.05 + Move(pelvis, x_axis, 1.748151, 91.399884 * speedMult) -- delta=-3.05 Move(pelvis, y_axis, -3.133945, 19.552481 * speedMult) -- delta=-0.65 Turn(pelvis, z_axis, 0.003503, 0.210186 * speedMult) -- delta=0.40 Turn(pelvis, y_axis, -0.083659, 5.019544 * speedMult) -- delta=-9.59 @@ -593,7 +741,7 @@ local function Dance1() Turn(luparm, x_axis, -0.126974, 2.878580 * speedMult) -- delta=5.50 Turn(luparm, z_axis, 0.406060, 0.767303 * speedMult) -- delta=1.47 Turn(luparm, y_axis, -0.444806, 3.550799 * speedMult) -- delta=-6.78 - Move(pelvis, x_axis, 2.217917, 14.092977 * speedMult) -- delta=-0.47 + Move(pelvis, x_axis, 2.217917, 14.092977 * speedMult) -- delta=-0.47 Move(pelvis, y_axis, -2.880190, 7.612646 * speedMult) -- delta=0.25 Turn(pelvis, z_axis, 0.005986, 0.074496 * speedMult) -- delta=0.14 Turn(pelvis, y_axis, -0.142962, 1.779079 * speedMult) -- delta=-3.40 @@ -630,7 +778,7 @@ local function Dance1() Turn(luparm, x_axis, -0.031022, 2.878582 * speedMult) -- delta=-5.50 Turn(luparm, z_axis, 0.380483, 0.767303 * speedMult) -- delta=-1.47 Turn(luparm, y_axis, -0.326446, 3.550799 * speedMult) -- delta=6.78 - Move(pelvis, x_axis, 1.748151, 14.092977 * speedMult) -- delta=0.47 + Move(pelvis, x_axis, 1.748151, 14.092977 * speedMult) -- delta=0.47 Move(pelvis, y_axis, -3.133945, 7.612646 * speedMult) -- delta=-0.25 Turn(pelvis, z_axis, 0.003503, 0.074496 * speedMult) -- delta=-0.14 Turn(pelvis, y_axis, -0.083659, 1.779079 * speedMult) -- delta=3.40 @@ -668,7 +816,7 @@ local function Dance1() Turn(luparm, x_axis, 0.239702, 8.121711 * speedMult) -- delta=-15.51 Turn(luparm, z_axis, 0.308320, 2.164890 * speedMult) -- delta=-4.13 Turn(luparm, y_axis, 0.007498, 10.018324 * speedMult) -- delta=19.13 - Move(pelvis, x_axis, - 1.298512, 91.399884 * speedMult) -- delta=3.05 + Move(pelvis, x_axis, -1.298512, 91.399884 * speedMult) -- delta=3.05 Move(pelvis, y_axis, -2.482196, 19.552481 * speedMult) -- delta=0.65 Turn(pelvis, z_axis, -0.003503, 0.210186 * speedMult) -- delta=-0.40 Turn(pelvis, y_axis, 0.083659, 5.019544 * speedMult) -- delta=9.59 @@ -706,7 +854,7 @@ local function Dance1() Turn(luparm, x_axis, 0.335655, 2.878582 * speedMult) -- delta=-5.50 Turn(luparm, z_axis, 0.282743, 0.767303 * speedMult) -- delta=-1.47 Turn(luparm, y_axis, 0.125858, 3.550800 * speedMult) -- delta=6.78 - Move(pelvis, x_axis, - 2.217917, 27.582171 * speedMult) -- delta=0.92 + Move(pelvis, x_axis, -2.217917, 27.582171 * speedMult) -- delta=0.92 Move(pelvis, y_axis, -2.880190, 11.939836 * speedMult) -- delta=-0.40 Turn(pelvis, z_axis, -0.005986, 0.074496 * speedMult) -- delta=-0.14 Turn(pelvis, y_axis, 0.142962, 1.779079 * speedMult) -- delta=3.40 @@ -782,7 +930,7 @@ end function SprayNano(heading, pitch) SetSignalMask(SIG_AIM) Sleep(1000) - while (true) do + while true do Turn(torso, 2, rad(10) + buildHeading, rad(10)) Sleep(2000) Turn(torso, 2, rad(-10) + buildHeading, rad(10)) @@ -791,36 +939,52 @@ function SprayNano(heading, pitch) end function StopWalking() - move(pelvis,2, -1.000000, 6.944444) - if (leftArm) then turn(biggun,1, -52.006372, 28.433941) end - turn(head,1, -1.298815, 11.896390) - turn(head,2, 0.000000, 28.723844) - turn(lfoot,1, 2.870126, 274.263975) - turn(lleg,1, 22.425678, 349.693872) - turn(lleg,2, 0.000000, 7.922289) - turn(lleg,3, 0.000000, 7.923996) - turn(lthigh,1, -21.115098, 255.919901) - turn(lthigh,2, 11.110453, 66.749106) - turn(lthigh,3, -10.103126, 151.418301) - if (leftArm) then turn(luparm,1, 19.231610, 69.841862) end - if (leftArm) then turn(luparm,2, 7.211138, 46.845002) end - if (leftArm) then turn(luparm,3, -16.200000, 28.500010) end - turn(pelvis,2, 0.000000, 21.666665) - turn(pelvis,3, 0.000000, 18.055557) - turn(rfoot,1, 0.415283, 248.713120) - turn(rleg,1, 25.768060, 346.011740) - turn(rleg,2, 0.000000, 6.521982) - turn(rleg,3, 0.000000, 6.524652) - if (rightArm) then turn(rloarm,1, -53.199995, 51.638894) end - turn(rthigh,1, -21.950628, 255.149679) - turn(rthigh,2, -11.905752, 66.515336) - turn(rthigh,3, 9.396449, 151.125663) - if (rightArm) then turn(ruparm,1, 24.693159, 39.648544) end - if (rightArm) then turn(ruparm,2, 0.000000, 31.089853) end - if (rightArm) then turn(ruparm,3, 12.399998, -7.153845) end - turn(torso,1, -2.263907, 15.181924) - turn(torso,2, 0.000000, 59.095757) - turn(torso,3, 0.000000, 18.561539) + move(pelvis, 2, -1.000000, 6.944444) + if leftArm then + turn(biggun, 1, -52.006372, 28.433941) + end + turn(head, 1, -1.298815, 11.896390) + turn(head, 2, 0.000000, 28.723844) + turn(lfoot, 1, 2.870126, 274.263975) + turn(lleg, 1, 22.425678, 349.693872) + turn(lleg, 2, 0.000000, 7.922289) + turn(lleg, 3, 0.000000, 7.923996) + turn(lthigh, 1, -21.115098, 255.919901) + turn(lthigh, 2, 11.110453, 66.749106) + turn(lthigh, 3, -10.103126, 151.418301) + if leftArm then + turn(luparm, 1, 19.231610, 69.841862) + end + if leftArm then + turn(luparm, 2, 7.211138, 46.845002) + end + if leftArm then + turn(luparm, 3, -16.200000, 28.500010) + end + turn(pelvis, 2, 0.000000, 21.666665) + turn(pelvis, 3, 0.000000, 18.055557) + turn(rfoot, 1, 0.415283, 248.713120) + turn(rleg, 1, 25.768060, 346.011740) + turn(rleg, 2, 0.000000, 6.521982) + turn(rleg, 3, 0.000000, 6.524652) + if rightArm then + turn(rloarm, 1, -53.199995, 51.638894) + end + turn(rthigh, 1, -21.950628, 255.149679) + turn(rthigh, 2, -11.905752, 66.515336) + turn(rthigh, 3, 9.396449, 151.125663) + if rightArm then + turn(ruparm, 1, 24.693159, 39.648544) + end + if rightArm then + turn(ruparm, 2, 0.000000, 31.089853) + end + if rightArm then + turn(ruparm, 3, 12.399998, -7.153845) + end + turn(torso, 1, -2.263907, 15.181924) + turn(torso, 2, 0.000000, 59.095757) + turn(torso, 3, 0.000000, 18.561539) end function GameOverAnim() @@ -841,22 +1005,22 @@ end function UnitSpeed() maxSpeed = UnitDefs[Spring.GetUnitDefID(unitID)].speed animFramesPerKeyframe = 4 --we need to calc the frames per keyframe value, from the known animtime - maxSpeed = maxSpeed + (maxSpeed /(2*animFramesPerKeyframe)) -- add fudge - while(true)do - vx,vy,vz,Speed = Spring.GetUnitVelocity(unitID) + maxSpeed = maxSpeed + (maxSpeed / (2 * animFramesPerKeyframe)) -- add fudge + while true do + vx, vy, vz, Speed = Spring.GetUnitVelocity(unitID) currentSpeed = Speed * 30 - animSpeed = (currentSpeed) - if (animSpeed<1) then - animSpeed=1 + animSpeed = currentSpeed + if animSpeed < 1 then + animSpeed = 1 end animSpeed = (maxSpeed * 4) / animSpeed - if (animSpeed<2) then - animSpeed=2 + if animSpeed < 2 then + animSpeed = 2 end - if (animSpeed>8) then + if animSpeed > 8 then animSpeed = 8 end - Sleep (131) + Sleep(131) if isDancing and (bMoving or isAiming or isBuilding) then StartThread(StopDance1) isDancing = false @@ -871,7 +1035,7 @@ function ResumeBuilding() Turn(aimy1, 2, buildHeading, rad(150.000000)) Turn(luparm, 1, rad(-55) - buildPitch, rad(45.000000)) end - return (0) + return 0 end function script.Create() @@ -920,7 +1084,9 @@ function ShowMedalBronze() end function script.StartMoving() - if isDancing then StartThread(StopDance1) end + if isDancing then + StartThread(StopDance1) + end bMoving = true StartThread(walk) end @@ -942,8 +1108,10 @@ function script.AimFromWeapon(weapon) end function script.AimWeapon(weapon, heading, pitch) - if isDancing then StartThread(StopDance1) end - --Spring.Echo("Armcom aiming:",weapons[weapon]) + if isDancing then + StartThread(StopDance1) + end + --Spring.Echo("Armcom aiming:",weapons[weapon]) if weapons[weapon] == "laser" then if isAimingDgun == true then return false @@ -953,13 +1121,13 @@ function script.AimWeapon(weapon, heading, pitch) Signal(SIG_AIM) Turn(aimy1, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-55), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-40)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + Turn(ruparm, 1, rad(-40) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) -- if the turret cannot turn to its new heading in one frame, wait for turn - if math.abs(last_primary_heading-heading)>rad(10.0000) then + if math.abs(last_primary_heading - heading) > rad(10.0000) then -- seems to take 1 frame for WaitForTurn to process - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) end - last_primary_heading=heading; + last_primary_heading = heading isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -979,9 +1147,9 @@ function script.AimWeapon(weapon, heading, pitch) Turn(aimy1, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-55), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-40)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + Turn(ruparm, 1, rad(-40) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -995,8 +1163,8 @@ function script.AimWeapon(weapon, heading, pitch) leftArm = false Turn(aimy1, 2, heading, rad(360.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(biggun, 1, rad(-105), rad(900.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(luparm, 1, rad(15)-pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(aimy1,2) + Turn(luparm, 1, rad(15) - pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + WaitForTurn(aimy1, 2) return true end end @@ -1031,21 +1199,23 @@ function script.QueryWeapon(weapon) end function script.StartBuilding(heading, pitch) - if isDancing then StartThread(StopDance1) end + if isDancing then + StartThread(StopDance1) + end Show(nano) Signal(SIG_AIM) isBuilding = true leftArm = false Turn(torso, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-40), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-55)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(ruparm,1) + Turn(ruparm, 1, rad(-55) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + WaitForTurn(ruparm, 1) Spring.UnitScript.SetUnitValue(COB.INBUILDSTANCE, true) buildHeading = heading buildPitch = pitch StartThread(SprayNano, heading, pitch) - Show (armhexl_emit) - Show (armhexl2_emit) + Show(armhexl_emit) + Show(armhexl2_emit) --Show (cagelight_emit); --Spin (cagelight, z_axis,-8); return true @@ -1059,15 +1229,15 @@ function script.StopBuilding() Signal(SIG_AIM) SetSignalMask(SIG_AIM) StartThread(Restore) - Hide (armhexl_emit) - Hide (armhexl2_emit) + Hide(armhexl_emit) + Hide(armhexl2_emit) --Turn (cagelight, z_axis,0,15); return true end function script.QueryNanoPiece() - local piecenum; - piecenum = nano; + local piecenum + piecenum = nano return piecenum end @@ -1087,8 +1257,6 @@ function Restore() last_primary_heading = -1000000 end - - function script.Killed() return 1 end diff --git a/scripts/Units/armcomhilvl.lua b/scripts/Units/armcomhilvl.lua index 7599512d5d9..a6a08616c3a 100644 --- a/scripts/Units/armcomhilvl.lua +++ b/scripts/Units/armcomhilvl.lua @@ -1,10 +1,8 @@ --INCREMENT THIS COUNTER FOR EVERY HOUR OF YOUR LIFE WASTED HERE: 44 - - --Skeleton pieces --local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl,hatpoint, crown, medalsilver, medalbronze, medalgold, cagelight, cagelight_emit = piece("head", "torso", "luparm", "biggun", "ruparm","rloarm","lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh" ,"lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1","bigguncyl","hatpoint", "crown", "medalsilver", "medalbronze", "medalgold", "cagelight", "cagelight_emit") -local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl,hatpoint, armhexl, armhexl2, armhexl_emit, armhexl2_emit, missileflare = piece("head", "torso", "luparm", "biggun", "ruparm","rloarm","lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh" ,"lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1","bigguncyl","hatpoint", "armhexl", "armhexl2", "armhexl_emit", "armhexl2_emit", "missileflare") +local head, torso, luparm, biggun, ruparm, rloarm, lflare, nano, laserflare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, rfootstep, lfoot, lfootstep, dish, barrel, aimy1, bigguncyl, hatpoint, armhexl, armhexl2, armhexl_emit, armhexl2_emit, missileflare = piece("head", "torso", "luparm", "biggun", "ruparm", "rloarm", "lflare", "nano", "laserflare", "pelvis", "rthigh", "lthigh", "lleg", "rleg", "rfoot", "rfootstep", "lfoot", "lfootstep", "dish", "barrel", "aimy1", "bigguncyl", "hatpoint", "armhexl", "armhexl2", "armhexl_emit", "armhexl2_emit", "missileflare") local weapons = { [1] = "backlauncher", @@ -39,13 +37,11 @@ local weapons = { [30] = "dgun", [31] = "dgun", [32] = "dgun", - } - - +} local SIG_AIM = 2 local SIG_WALK = 4 -local GetGameFrame = Spring.GetGameFrame +local GetGameFrame = Spring.GetGameFrame local spGetUnitStates = Spring.GetUnitStates local spSetUnitArmored = Spring.SetUnitArmored local spGetUnitHealth = Spring.GetUnitHealth @@ -55,11 +51,11 @@ local spSetUnitCloak = Spring.SetUnitCloak local last_primary_heading = -1000000 local function BelowWater(piecename) - local _,y,_ = Spring.GetUnitPiecePosition(unitID, piecename) - -- this returns unit space, so why does it work for corcom? - local _, py, _ = Spring.GetUnitPosition(unitID) - --Spring.Echo(piecename, 'ypos', y, py) - if (y+ py) <= 0 then + local _, y, _ = Spring.GetUnitPiecePosition(unitID, piecename) + -- this returns unit space, so why does it work for corcom? + local _, py, _ = Spring.GetUnitPosition(unitID) + --Spring.Echo(piecename, 'ypos', y, py) + if (y + py) <= 0 then return true else return false @@ -85,378 +81,530 @@ local function move(piece, axis, goal, speed) end function walk() - if (bMoving) then --Frame:4 - if (leftArm) then turn(biggun, 1, -48.215180, 113.735764/animSpeed) --delta=-3.79 - turn(head, 1, -2.620635, 39.654598/animSpeed) --delta=1.32 - turn(head, 2, -3.829846, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -33.266887, 1084.110406/animSpeed) --delta=36.14 - turn(lleg, 1, 55.932201, 1005.195679/animSpeed) --delta=-33.51 - turn(lthigh, 1, -55.237751, 1023.679605/animSpeed) --delta=34.12 - turn(lthigh, 3, 10.085981, 605.673206/animSpeed) --delta=-20.19 - turn(lthigh, 2, 15.046731, 118.088344/animSpeed) --delta=3.94 - if (leftArm) then turn(luparm, 1, 9.919362, 279.367450/animSpeed) end --delta=9.31 - if (leftArm) then turn(luparm, 3, -12.399998, 114.000041/animSpeed) end--delta=-3.80 - if (leftArm) then turn(luparm, 2, 0.965138, 187.380006/animSpeed) end--delta=-6.25 - turn(pelvis, 3, -1.666667, 49.999997/animSpeed) --delta=1.67 - turn(pelvis, 2, -2.296296, 68.888891/animSpeed) --delta=-2.30 - turn(rfoot, 1, -24.788553, 756.115081/animSpeed) --delta=25.20 - turn(rleg, 1, 21.945633, 114.672797/animSpeed) --delta=3.82 - if (rightArm) then turn(rloarm, 1, -56.129627, 87.888962/animSpeed) end--delta=2.93 - turn(rthigh, 1, 3.073465, 750.722777/animSpeed) --delta=-25.02 - turn(rthigh, 3, 1.955836, 223.218383/animSpeed) --delta=7.44 - turn(rthigh, 2, -0.370374, 346.061345/animSpeed) --delta=11.54 - if (rightArm) then turn(ruparm, 1, 21.424041, 98.073542/animSpeed) end--delta=3.27 - if (rightArm) then turn(ruparm, 2, 1.762963, 52.888889/animSpeed) end--delta=1.76 - turn(torso, 1, -4.288164, 60.727696/animSpeed) --delta=2.02 - turn(torso, 3, 1.713372, 51.401158/animSpeed) --delta=-1.71 - turn(torso, 2, 7.879434, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:4 + if leftArm then + turn(biggun, 1, -48.215180, 113.735764 / animSpeed) --delta=-3.79 + turn(head, 1, -2.620635, 39.654598 / animSpeed) --delta=1.32 + turn(head, 2, -3.829846, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -33.266887, 1084.110406 / animSpeed) --delta=36.14 + turn(lleg, 1, 55.932201, 1005.195679 / animSpeed) --delta=-33.51 + turn(lthigh, 1, -55.237751, 1023.679605 / animSpeed) --delta=34.12 + turn(lthigh, 3, 10.085981, 605.673206 / animSpeed) --delta=-20.19 + turn(lthigh, 2, 15.046731, 118.088344 / animSpeed) --delta=3.94 + if leftArm then + turn(luparm, 1, 9.919362, 279.367450 / animSpeed) + end --delta=9.31 + if leftArm then + turn(luparm, 3, -12.399998, 114.000041 / animSpeed) + end --delta=-3.80 + if leftArm then + turn(luparm, 2, 0.965138, 187.380006 / animSpeed) + end --delta=-6.25 + turn(pelvis, 3, -1.666667, 49.999997 / animSpeed) --delta=1.67 + turn(pelvis, 2, -2.296296, 68.888891 / animSpeed) --delta=-2.30 + turn(rfoot, 1, -24.788553, 756.115081 / animSpeed) --delta=25.20 + turn(rleg, 1, 21.945633, 114.672797 / animSpeed) --delta=3.82 + if rightArm then + turn(rloarm, 1, -56.129627, 87.888962 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 3.073465, 750.722777 / animSpeed) --delta=-25.02 + turn(rthigh, 3, 1.955836, 223.218383 / animSpeed) --delta=7.44 + turn(rthigh, 2, -0.370374, 346.061345 / animSpeed) --delta=11.54 + if rightArm then + turn(ruparm, 1, 21.424041, 98.073542 / animSpeed) + end --delta=3.27 + if rightArm then + turn(ruparm, 2, 1.762963, 52.888889 / animSpeed) + end --delta=1.76 + turn(torso, 1, -4.288164, 60.727696 / animSpeed) --delta=2.02 + turn(torso, 3, 1.713372, 51.401158 / animSpeed) --delta=-1.71 + turn(torso, 2, 7.879434, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end - while(bMoving) do - if (bMoving) then --Frame:8 - if (leftArm) then turn(biggun, 1, -46.675856, 46.179694/animSpeed) end--delta=-1.54 - turn(head, 1, -1.563179, 31.723679/animSpeed) --delta=-1.06 - turn(head, 2, -6.127755, 68.937274/animSpeed) --delta=-2.30 - turn(lfoot, 1, 3.301643, 1097.055898/animSpeed) --delta=-36.57 - turn(lleg, 1, 21.188054, 1042.324382/animSpeed) --delta=34.74 - turn(lthigh, 1, -49.309980, 177.833127/animSpeed) --delta=-5.93 - turn(lthigh, 3, 12.410994, 69.750404/animSpeed) --delta=-2.33 - turn(lthigh, 2, 17.664281, 78.526514/animSpeed) --delta=2.62 - if (leftArm) then turn(luparm, 1, 17.175860, 217.694940/animSpeed) end--delta=-7.26 - if (leftArm) then turn(luparm, 2, 2.994882, 60.892341/animSpeed) end--delta=2.03 - move (pelvis, 2, -1.370370 , 8.888887 /animSpeed) --delta=-0.30 - turn(pelvis, 3, -4.074074, 72.222229/animSpeed) --delta=2.41 - turn(pelvis, 2, -5.185185, 86.666661/animSpeed) --delta=-2.89 - turn(rfoot, 1, -24.385273, 12.098399/animSpeed) --delta=-0.40 - turn(rleg, 1, 2.775391, 575.107266/animSpeed) --delta=19.17 - if (rightArm) then turn(rloarm, 1, -61.570378, 163.222533/animSpeed) end--delta=5.44 - turn(rthigh, 1, 24.923063, 655.487959/animSpeed) --delta=-21.85 - turn(rthigh, 3, 7.511525, 166.670667/animSpeed) --delta=-5.56 - turn(rthigh, 2, -5.809679, 163.179149/animSpeed) --delta=-5.44 - if (rightArm) then turn(ruparm, 1, 16.696394, 141.829407/animSpeed) end--delta=4.73 - if (rightArm) then turn(ruparm, 2, 5.908277, 124.359412/animSpeed) end--delta=4.15 - turn(torso, 1, -3.674753, 18.402335/animSpeed) --delta=-0.61 - turn(torso, 3, 4.188244, 74.246156/animSpeed) --delta=-2.47 - turn(torso, 2, 13.926961, 181.425790/animSpeed) --delta=6.05 - Sleep( (33*animSpeed) -1) + while bMoving do + if bMoving then --Frame:8 + if leftArm then + turn(biggun, 1, -46.675856, 46.179694 / animSpeed) + end --delta=-1.54 + turn(head, 1, -1.563179, 31.723679 / animSpeed) --delta=-1.06 + turn(head, 2, -6.127755, 68.937274 / animSpeed) --delta=-2.30 + turn(lfoot, 1, 3.301643, 1097.055898 / animSpeed) --delta=-36.57 + turn(lleg, 1, 21.188054, 1042.324382 / animSpeed) --delta=34.74 + turn(lthigh, 1, -49.309980, 177.833127 / animSpeed) --delta=-5.93 + turn(lthigh, 3, 12.410994, 69.750404 / animSpeed) --delta=-2.33 + turn(lthigh, 2, 17.664281, 78.526514 / animSpeed) --delta=2.62 + if leftArm then + turn(luparm, 1, 17.175860, 217.694940 / animSpeed) + end --delta=-7.26 + if leftArm then + turn(luparm, 2, 2.994882, 60.892341 / animSpeed) + end --delta=2.03 + move(pelvis, 2, -1.370370, 8.888887 / animSpeed) --delta=-0.30 + turn(pelvis, 3, -4.074074, 72.222229 / animSpeed) --delta=2.41 + turn(pelvis, 2, -5.185185, 86.666661 / animSpeed) --delta=-2.89 + turn(rfoot, 1, -24.385273, 12.098399 / animSpeed) --delta=-0.40 + turn(rleg, 1, 2.775391, 575.107266 / animSpeed) --delta=19.17 + if rightArm then + turn(rloarm, 1, -61.570378, 163.222533 / animSpeed) + end --delta=5.44 + turn(rthigh, 1, 24.923063, 655.487959 / animSpeed) --delta=-21.85 + turn(rthigh, 3, 7.511525, 166.670667 / animSpeed) --delta=-5.56 + turn(rthigh, 2, -5.809679, 163.179149 / animSpeed) --delta=-5.44 + if rightArm then + turn(ruparm, 1, 16.696394, 141.829407 / animSpeed) + end --delta=4.73 + if rightArm then + turn(ruparm, 2, 5.908277, 124.359412 / animSpeed) + end --delta=4.15 + turn(torso, 1, -3.674753, 18.402335 / animSpeed) --delta=-0.61 + turn(torso, 3, 4.188244, 74.246156 / animSpeed) --delta=-2.47 + turn(torso, 2, 13.926961, 181.425790 / animSpeed) --delta=6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:12 - if (leftArm) then turn(biggun, 1, -46.110552, 16.959121/animSpeed) end--delta=-0.57 - turn(head, 1, 0.023005, 47.585527/animSpeed) --delta=-1.59 - turn(head, 2, -7.659692, 45.958102/animSpeed) --delta=-1.53 - turn(lfoot, 1, 11.411680, 243.301125/animSpeed) --delta=-8.11 - turn(lleg, 1, -6.333642, 825.650884/animSpeed) --delta=27.52 - turn(lthigh, 1, -28.939382, 611.117960/animSpeed) --delta=-20.37 - turn(lthigh, 3, 10.100023, 69.329144/animSpeed) --delta=2.31 - turn(lthigh, 2, 14.540810, 93.704134/animSpeed) --delta=-3.12 - if (leftArm) then turn(luparm, 1, 20.474264, 98.952127/animSpeed) end--delta=-3.30 - if (leftArm) then turn(luparm, 2, 5.388938, 71.821661/animSpeed) end--delta=2.39 - move (pelvis, 2, -2.000000 , 18.888888 /animSpeed) --delta=-0.63 - turn(pelvis, 3, -5.000000, 27.777769/animSpeed) --delta=0.93 - turn(pelvis, 2, -6.000000, 24.444453/animSpeed) --delta=-0.81 - turn(rfoot, 1, -34.556331, 305.131751/animSpeed) --delta=10.17 - turn(rleg, 1, 32.187523, 882.363941/animSpeed) --delta=-29.41 - if (rightArm) then turn(rloarm, 1, -64.499997, 87.888552/animSpeed) end--delta=2.93 - turn(rthigh, 1, 18.715526, 186.226115/animSpeed) --delta=6.21 - turn(rthigh, 3, 9.760341, 67.464476/animSpeed) --delta=-2.25 - turn(rthigh, 2, -5.182428, 18.817525/animSpeed) --delta=0.63 - if (rightArm) then turn(ruparm, 1, 12.622570, 122.214735/animSpeed) end--delta=4.07 - if (rightArm) then turn(ruparm, 2, 6.799999, 26.751678/animSpeed) end--delta=0.89 - turn(torso, 1, -2.141225, 46.005832/animSpeed) --delta=-1.53 - turn(torso, 3, 5.140116, 28.556180/animSpeed) --delta=-0.95 - turn(torso, 2, 15.758869, 54.957239/animSpeed) --delta=1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:12 + if leftArm then + turn(biggun, 1, -46.110552, 16.959121 / animSpeed) + end --delta=-0.57 + turn(head, 1, 0.023005, 47.585527 / animSpeed) --delta=-1.59 + turn(head, 2, -7.659692, 45.958102 / animSpeed) --delta=-1.53 + turn(lfoot, 1, 11.411680, 243.301125 / animSpeed) --delta=-8.11 + turn(lleg, 1, -6.333642, 825.650884 / animSpeed) --delta=27.52 + turn(lthigh, 1, -28.939382, 611.117960 / animSpeed) --delta=-20.37 + turn(lthigh, 3, 10.100023, 69.329144 / animSpeed) --delta=2.31 + turn(lthigh, 2, 14.540810, 93.704134 / animSpeed) --delta=-3.12 + if leftArm then + turn(luparm, 1, 20.474264, 98.952127 / animSpeed) + end --delta=-3.30 + if leftArm then + turn(luparm, 2, 5.388938, 71.821661 / animSpeed) + end --delta=2.39 + move(pelvis, 2, -2.000000, 18.888888 / animSpeed) --delta=-0.63 + turn(pelvis, 3, -5.000000, 27.777769 / animSpeed) --delta=0.93 + turn(pelvis, 2, -6.000000, 24.444453 / animSpeed) --delta=-0.81 + turn(rfoot, 1, -34.556331, 305.131751 / animSpeed) --delta=10.17 + turn(rleg, 1, 32.187523, 882.363941 / animSpeed) --delta=-29.41 + if rightArm then + turn(rloarm, 1, -64.499997, 87.888552 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 18.715526, 186.226115 / animSpeed) --delta=6.21 + turn(rthigh, 3, 9.760341, 67.464476 / animSpeed) --delta=-2.25 + turn(rthigh, 2, -5.182428, 18.817525 / animSpeed) --delta=0.63 + if rightArm then + turn(ruparm, 1, 12.622570, 122.214735 / animSpeed) + end --delta=4.07 + if rightArm then + turn(ruparm, 2, 6.799999, 26.751678 / animSpeed) + end --delta=0.89 + turn(torso, 1, -2.141225, 46.005832 / animSpeed) --delta=-1.53 + turn(torso, 3, 5.140116, 28.556180 / animSpeed) --delta=-0.95 + turn(torso, 2, 15.758869, 54.957239 / animSpeed) --delta=1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:16 - - if (leftArm) then turn(biggun, 1, -47.068049, 28.724907/animSpeed) end--delta=0.96 - turn(head, 1, -0.505722, 15.861819/animSpeed) --delta=0.53 - turn(head, 2, -6.127755, 45.958102/animSpeed) --delta=1.53 - turn(lfoot, 1, 2.879686, 255.959826/animSpeed) --delta=8.53 - turn(lleg, 1, 40.292208, 1398.775490/animSpeed) --delta=-46.63 - turn(lthigh, 1, -49.313423, 611.221232/animSpeed) --delta=20.37 - turn(lthigh, 3, 11.258773, 34.762504/animSpeed) --delta=-1.16 - turn(lthigh, 2, 17.221502, 80.420765/animSpeed) --delta=2.68 - if (leftArm) then turn(luparm, 1, 19.047441, 42.804693/animSpeed) end--delta=1.43 - move (pelvis, 2, -2.833333 , 25.000005 /animSpeed) --delta=-0.83 - turn(pelvis, 3, -3.962963, 31.111110/animSpeed) --delta=-1.04 - turn(pelvis, 2, -5.026455, 29.206358/animSpeed) --delta=0.97 - turn(rfoot, 1, -27.196287, 220.801335/animSpeed) --delta=-7.36 - turn(rleg, 1, 78.322421, 1384.046960/animSpeed) --delta=-46.13 - turn(rleg, 3, -0.165893, 4.758378/animSpeed) --delta=0.16 - turn(rleg, 2, 0.140044, 4.092714/animSpeed) --delta=0.14 - if (rightArm) then turn(rloarm, 1, -62.031478, 74.055575/animSpeed) end--delta=-2.47 - turn(rthigh, 1, -2.425270, 634.223885/animSpeed) --delta=21.14 - turn(rthigh, 3, 5.889018, 116.139691/animSpeed) --delta=3.87 - turn(rthigh, 2, 2.215249, 221.930321/animSpeed) --delta=7.40 - if (rightArm) then turn(ruparm, 1, 12.782766, 4.805883/animSpeed) end--delta=-0.16 - if (rightArm) then turn(ruparm, 2, 6.141609, 19.751703/animSpeed) end--delta=-0.66 - turn(torso, 1, -3.061342, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, 4.074019, 31.982933/animSpeed) --delta=1.07 - turn(torso, 2, 13.926961, 54.957239/animSpeed) --delta=-1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:16 + if leftArm then + turn(biggun, 1, -47.068049, 28.724907 / animSpeed) + end --delta=0.96 + turn(head, 1, -0.505722, 15.861819 / animSpeed) --delta=0.53 + turn(head, 2, -6.127755, 45.958102 / animSpeed) --delta=1.53 + turn(lfoot, 1, 2.879686, 255.959826 / animSpeed) --delta=8.53 + turn(lleg, 1, 40.292208, 1398.775490 / animSpeed) --delta=-46.63 + turn(lthigh, 1, -49.313423, 611.221232 / animSpeed) --delta=20.37 + turn(lthigh, 3, 11.258773, 34.762504 / animSpeed) --delta=-1.16 + turn(lthigh, 2, 17.221502, 80.420765 / animSpeed) --delta=2.68 + if leftArm then + turn(luparm, 1, 19.047441, 42.804693 / animSpeed) + end --delta=1.43 + move(pelvis, 2, -2.833333, 25.000005 / animSpeed) --delta=-0.83 + turn(pelvis, 3, -3.962963, 31.111110 / animSpeed) --delta=-1.04 + turn(pelvis, 2, -5.026455, 29.206358 / animSpeed) --delta=0.97 + turn(rfoot, 1, -27.196287, 220.801335 / animSpeed) --delta=-7.36 + turn(rleg, 1, 78.322421, 1384.046960 / animSpeed) --delta=-46.13 + turn(rleg, 3, -0.165893, 4.758378 / animSpeed) --delta=0.16 + turn(rleg, 2, 0.140044, 4.092714 / animSpeed) --delta=0.14 + if rightArm then + turn(rloarm, 1, -62.031478, 74.055575 / animSpeed) + end --delta=-2.47 + turn(rthigh, 1, -2.425270, 634.223885 / animSpeed) --delta=21.14 + turn(rthigh, 3, 5.889018, 116.139691 / animSpeed) --delta=3.87 + turn(rthigh, 2, 2.215249, 221.930321 / animSpeed) --delta=7.40 + if rightArm then + turn(ruparm, 1, 12.782766, 4.805883 / animSpeed) + end --delta=-0.16 + if rightArm then + turn(ruparm, 2, 6.141609, 19.751703 / animSpeed) + end --delta=-0.66 + turn(torso, 1, -3.061342, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, 4.074019, 31.982933 / animSpeed) --delta=1.07 + turn(torso, 2, 13.926961, 54.957239 / animSpeed) --delta=-1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:20 + if bMoving then --Frame:20 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(lfootstep, 1024 + 2) end - if (leftArm) then turn(biggun, 1, -49.335727, 68.030323/animSpeed) end--delta=2.27 - turn(head, 1, -2.091907, 47.585562/animSpeed) --delta=1.59 - turn(head, 2, -3.829846, 68.937274/animSpeed) --delta=2.30 - turn(lfoot, 1, -11.362748, 427.273021/animSpeed) --delta=14.24 - turn(lleg, 1, 55.773467, 464.437769/animSpeed) --delta=-15.48 - turn(lthigh, 1, -43.832869, 164.416621/animSpeed) --delta=-5.48 - turn(lthigh, 3, 4.706604, 196.565054/animSpeed) --delta=6.55 - turn(lthigh, 2, 8.321622, 266.996423/animSpeed) --delta=-8.90 - if (leftArm) then turn(luparm, 1, 15.615877, 102.946916/animSpeed) end--delta=3.43 - if (leftArm) then turn(luparm, 2, 5.076670, 9.368019/animSpeed) end--delta=-0.31 - turn(pelvis, 3, -2.000000, 58.888879/animSpeed) --delta=-1.96 - turn(pelvis, 2, -2.772487, 67.619039/animSpeed) --delta=2.25 - turn(rfoot, 1, -39.119034, 357.682424/animSpeed) --delta=11.92 - turn(rleg, 1, 104.636879, 789.433742/animSpeed) --delta=-26.31 - turn(rleg, 3, 0.031377, 5.918091/animSpeed) --delta=-0.20 - turn(rleg, 2, -0.045903, 5.578386/animSpeed) --delta=-0.19 - if (rightArm) then turn(rloarm, 1, -56.185181, 175.388910/animSpeed) end--delta=-5.85 - turn(rthigh, 1, -29.245227, 804.598715/animSpeed) --delta=26.82 - turn(rthigh, 3, 3.330593, 76.752755/animSpeed) --delta=2.56 - turn(rthigh, 2, -1.498384, 111.408996/animSpeed) --delta=-3.71 - if (rightArm) then turn(ruparm, 1, 13.904138, 33.641183/animSpeed) end--delta=-1.12 - if (rightArm) then turn(ruparm, 2, 2.429630, 111.359389/animSpeed) end--delta=-3.71 - turn(torso, 1, -3.981459, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, 2.056047, 60.539158/animSpeed) --delta=2.02 - turn(torso, 2, 7.879434, 181.425790/animSpeed) --delta=-6.05 - Sleep( (33*animSpeed) -1) + if leftArm then + turn(biggun, 1, -49.335727, 68.030323 / animSpeed) + end --delta=2.27 + turn(head, 1, -2.091907, 47.585562 / animSpeed) --delta=1.59 + turn(head, 2, -3.829846, 68.937274 / animSpeed) --delta=2.30 + turn(lfoot, 1, -11.362748, 427.273021 / animSpeed) --delta=14.24 + turn(lleg, 1, 55.773467, 464.437769 / animSpeed) --delta=-15.48 + turn(lthigh, 1, -43.832869, 164.416621 / animSpeed) --delta=-5.48 + turn(lthigh, 3, 4.706604, 196.565054 / animSpeed) --delta=6.55 + turn(lthigh, 2, 8.321622, 266.996423 / animSpeed) --delta=-8.90 + if leftArm then + turn(luparm, 1, 15.615877, 102.946916 / animSpeed) + end --delta=3.43 + if leftArm then + turn(luparm, 2, 5.076670, 9.368019 / animSpeed) + end --delta=-0.31 + turn(pelvis, 3, -2.000000, 58.888879 / animSpeed) --delta=-1.96 + turn(pelvis, 2, -2.772487, 67.619039 / animSpeed) --delta=2.25 + turn(rfoot, 1, -39.119034, 357.682424 / animSpeed) --delta=11.92 + turn(rleg, 1, 104.636879, 789.433742 / animSpeed) --delta=-26.31 + turn(rleg, 3, 0.031377, 5.918091 / animSpeed) --delta=-0.20 + turn(rleg, 2, -0.045903, 5.578386 / animSpeed) --delta=-0.19 + if rightArm then + turn(rloarm, 1, -56.185181, 175.388910 / animSpeed) + end --delta=-5.85 + turn(rthigh, 1, -29.245227, 804.598715 / animSpeed) --delta=26.82 + turn(rthigh, 3, 3.330593, 76.752755 / animSpeed) --delta=2.56 + turn(rthigh, 2, -1.498384, 111.408996 / animSpeed) --delta=-3.71 + if rightArm then + turn(ruparm, 1, 13.904138, 33.641183 / animSpeed) + end --delta=-1.12 + if rightArm then + turn(ruparm, 2, 2.429630, 111.359389 / animSpeed) + end --delta=-3.71 + turn(torso, 1, -3.981459, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, 2.056047, 60.539158 / animSpeed) --delta=2.02 + turn(torso, 2, 7.879434, 181.425790 / animSpeed) --delta=-6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:24 - if (leftArm) then turn(biggun, 1, -52.006372, 80.119348/animSpeed) end--delta=2.67 - turn(head, 1, -3.149363, 31.723676/animSpeed) --delta=1.06 - turn(head, 2, 0.000000, 114.895376/animSpeed) --delta=3.83 - turn(lfoot, 1, -23.280778, 357.540911/animSpeed) --delta=11.92 - turn(lleg, 1, 46.510843, 277.878733/animSpeed) --delta=9.26 - turn(lthigh, 1, -23.415420, 612.523459/animSpeed) --delta=-20.42 - turn(lthigh, 3, 0.280779, 132.774760/animSpeed) --delta=4.43 - turn(lthigh, 2, 1.272165, 211.483711/animSpeed) --delta=-7.05 - if (leftArm) then turn(luparm, 1, 11.452920, 124.888703/animSpeed) end--delta=4.16 - if (leftArm) then turn(luparm, 2, 3.308728, 53.038265/animSpeed) end--delta=-1.77 - move (pelvis, 2, -2.000000 , 25.555551 /animSpeed) --delta=0.85 - turn(pelvis, 3, -0.000000, 60.000006/animSpeed) --delta=-2.00 - turn(pelvis, 2, 0.000000, 83.174607/animSpeed) --delta=2.77 - turn(rfoot, 1, -45.278120, 184.772566/animSpeed) --delta=6.16 - turn(rleg, 1, 90.786697, 415.505474/animSpeed) --delta=13.85 - turn(rleg, 3, 0.843235, 24.355743/animSpeed) --delta=-0.81 - turn(rleg, 2, -0.860075, 24.425185/animSpeed) --delta=-0.81 - if (rightArm) then turn(rloarm, 1, -49.299998, 206.555473/animSpeed) end--delta=-6.89 - turn(rthigh, 1, -43.951970, 441.202285/animSpeed) --delta=14.71 - turn(rthigh, 3, -2.997201, 189.833832/animSpeed) --delta=6.33 - turn(rthigh, 2, -9.866792, 251.052245/animSpeed) --delta=-8.37 - if (rightArm) then turn(ruparm, 1, 16.947865, 91.311783/animSpeed) end--delta=-3.04 - if (rightArm) then turn(ruparm, 2, 0.900000, 45.888888/animSpeed) end--delta=-1.53 - turn(torso, 1, -4.594870, 18.402335/animSpeed) --delta=0.61 - turn(torso, 3, -0.000000, 61.681404/animSpeed) --delta=2.06 - turn(torso, 2, 0.000000, 236.383029/animSpeed) --delta=-7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:24 + if leftArm then + turn(biggun, 1, -52.006372, 80.119348 / animSpeed) + end --delta=2.67 + turn(head, 1, -3.149363, 31.723676 / animSpeed) --delta=1.06 + turn(head, 2, 0.000000, 114.895376 / animSpeed) --delta=3.83 + turn(lfoot, 1, -23.280778, 357.540911 / animSpeed) --delta=11.92 + turn(lleg, 1, 46.510843, 277.878733 / animSpeed) --delta=9.26 + turn(lthigh, 1, -23.415420, 612.523459 / animSpeed) --delta=-20.42 + turn(lthigh, 3, 0.280779, 132.774760 / animSpeed) --delta=4.43 + turn(lthigh, 2, 1.272165, 211.483711 / animSpeed) --delta=-7.05 + if leftArm then + turn(luparm, 1, 11.452920, 124.888703 / animSpeed) + end --delta=4.16 + if leftArm then + turn(luparm, 2, 3.308728, 53.038265 / animSpeed) + end --delta=-1.77 + move(pelvis, 2, -2.000000, 25.555551 / animSpeed) --delta=0.85 + turn(pelvis, 3, -0.000000, 60.000006 / animSpeed) --delta=-2.00 + turn(pelvis, 2, 0.000000, 83.174607 / animSpeed) --delta=2.77 + turn(rfoot, 1, -45.278120, 184.772566 / animSpeed) --delta=6.16 + turn(rleg, 1, 90.786697, 415.505474 / animSpeed) --delta=13.85 + turn(rleg, 3, 0.843235, 24.355743 / animSpeed) --delta=-0.81 + turn(rleg, 2, -0.860075, 24.425185 / animSpeed) --delta=-0.81 + if rightArm then + turn(rloarm, 1, -49.299998, 206.555473 / animSpeed) + end --delta=-6.89 + turn(rthigh, 1, -43.951970, 441.202285 / animSpeed) --delta=14.71 + turn(rthigh, 3, -2.997201, 189.833832 / animSpeed) --delta=6.33 + turn(rthigh, 2, -9.866792, 251.052245 / animSpeed) --delta=-8.37 + if rightArm then + turn(ruparm, 1, 16.947865, 91.311783 / animSpeed) + end --delta=-3.04 + if rightArm then + turn(ruparm, 2, 0.900000, 45.888888 / animSpeed) + end --delta=-1.53 + turn(torso, 1, -4.594870, 18.402335 / animSpeed) --delta=0.61 + turn(torso, 3, -0.000000, 61.681404 / animSpeed) --delta=2.06 + turn(torso, 2, 0.000000, 236.383029 / animSpeed) --delta=-7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:28 - if (leftArm) then turn(biggun, 1, -53.142724, 34.090567/animSpeed) end--delta=1.14 - turn(head, 1, -2.620635, 15.861851/animSpeed) --delta=-0.53 - turn(head, 2, 3.829846, 114.895376/animSpeed) --delta=3.83 - turn(lfoot, 1, -28.343677, 151.886946/animSpeed) --delta=5.06 - turn(lleg, 1, 27.564644, 568.385957/animSpeed) --delta=18.95 - turn(lthigh, 1, 1.812986, 756.852171/animSpeed) --delta=-25.23 - turn(lthigh, 3, -2.460308, 82.232611/animSpeed) --delta=2.74 - turn(lthigh, 2, 0.746525, 15.769200/animSpeed) --delta=-0.53 - if (leftArm) then turn(luparm, 1, 8.807109, 79.374337/animSpeed) end--delta=2.65 - if (leftArm) then turn(luparm, 2, -0.396598, 111.159777/animSpeed) end--delta=-3.71 - move (pelvis, 2, -1.129630 , 26.111112 /animSpeed) --delta=0.87 - turn(pelvis, 3, 1.997872, 59.936146/animSpeed) --delta=-2.00 - turn(pelvis, 2, 2.771879, 83.156358/animSpeed) --delta=2.77 - turn(rfoot, 1, -33.707871, 347.107447/animSpeed) --delta=-11.57 - turn(rleg, 1, 56.067203, 1041.584826/animSpeed) --delta=34.72 - turn(rleg, 3, -0.026719, 26.098608/animSpeed) --delta=0.87 - turn(rleg, 2, 0.009522, 26.087929/animSpeed) --delta=0.87 - if (rightArm) then turn(rloarm, 1, -43.425926, 176.222159/animSpeed) end--delta=-5.87 - turn(rthigh, 1, -55.080896, 333.867775/animSpeed) --delta=11.13 - turn(rthigh, 3, -10.747290, 232.502653/animSpeed) --delta=7.75 - turn(rthigh, 2, -16.084974, 186.545461/animSpeed) --delta=-6.22 - if (rightArm) then turn(ruparm, 1, 22.234335, 158.594124/animSpeed) end--delta=-5.29 - if (rightArm) then turn(ruparm, 2, -0.812436, 51.373077/animSpeed) end--delta=-1.71 - turn(torso, 1, -4.288164, 9.201174/animSpeed) --delta=-0.31 - turn(torso, 3, -2.053859, 61.615764/animSpeed) --delta=2.05 - turn(torso, 2, -7.879434, 236.383029/animSpeed) --delta=-7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:28 + if leftArm then + turn(biggun, 1, -53.142724, 34.090567 / animSpeed) + end --delta=1.14 + turn(head, 1, -2.620635, 15.861851 / animSpeed) --delta=-0.53 + turn(head, 2, 3.829846, 114.895376 / animSpeed) --delta=3.83 + turn(lfoot, 1, -28.343677, 151.886946 / animSpeed) --delta=5.06 + turn(lleg, 1, 27.564644, 568.385957 / animSpeed) --delta=18.95 + turn(lthigh, 1, 1.812986, 756.852171 / animSpeed) --delta=-25.23 + turn(lthigh, 3, -2.460308, 82.232611 / animSpeed) --delta=2.74 + turn(lthigh, 2, 0.746525, 15.769200 / animSpeed) --delta=-0.53 + if leftArm then + turn(luparm, 1, 8.807109, 79.374337 / animSpeed) + end --delta=2.65 + if leftArm then + turn(luparm, 2, -0.396598, 111.159777 / animSpeed) + end --delta=-3.71 + move(pelvis, 2, -1.129630, 26.111112 / animSpeed) --delta=0.87 + turn(pelvis, 3, 1.997872, 59.936146 / animSpeed) --delta=-2.00 + turn(pelvis, 2, 2.771879, 83.156358 / animSpeed) --delta=2.77 + turn(rfoot, 1, -33.707871, 347.107447 / animSpeed) --delta=-11.57 + turn(rleg, 1, 56.067203, 1041.584826 / animSpeed) --delta=34.72 + turn(rleg, 3, -0.026719, 26.098608 / animSpeed) --delta=0.87 + turn(rleg, 2, 0.009522, 26.087929 / animSpeed) --delta=0.87 + if rightArm then + turn(rloarm, 1, -43.425926, 176.222159 / animSpeed) + end --delta=-5.87 + turn(rthigh, 1, -55.080896, 333.867775 / animSpeed) --delta=11.13 + turn(rthigh, 3, -10.747290, 232.502653 / animSpeed) --delta=7.75 + turn(rthigh, 2, -16.084974, 186.545461 / animSpeed) --delta=-6.22 + if rightArm then + turn(ruparm, 1, 22.234335, 158.594124 / animSpeed) + end --delta=-5.29 + if rightArm then + turn(ruparm, 2, -0.812436, 51.373077 / animSpeed) + end --delta=-1.71 + turn(torso, 1, -4.288164, 9.201174 / animSpeed) --delta=-0.31 + turn(torso, 3, -2.053859, 61.615764 / animSpeed) --delta=2.05 + turn(torso, 2, -7.879434, 236.383029 / animSpeed) --delta=-7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:32 - if (leftArm) then turn(biggun, 1, -55.253092, 63.311038/animSpeed) end--delta=2.11 - turn(head, 1, -1.563179, 31.723670/animSpeed) --delta=-1.06 - turn(head, 2, 6.127755, 68.937274/animSpeed) --delta=2.30 - turn(lfoot, 1, -21.408024, 208.069572/animSpeed) --delta=-6.94 - turn(lleg, 1, 3.737072, 714.827163/animSpeed) --delta=23.83 - turn(lthigh, 1, 24.379452, 676.993988/animSpeed) --delta=-22.57 - turn(lthigh, 3, -7.321217, 145.827258/animSpeed) --delta=4.86 - turn(lthigh, 2, 5.849079, 153.076646/animSpeed) --delta=5.10 - if (leftArm) then turn(luparm, 1, 2.317686, 194.682700/animSpeed) end--delta=6.49 - if (leftArm) then turn(luparm, 2, -5.045461, 139.465893/animSpeed) end--delta=-4.65 - turn(pelvis, 3, 3.963673, 58.974037/animSpeed) --delta=-1.97 - turn(pelvis, 2, 5.026658, 67.643372/animSpeed) --delta=2.25 - turn(rfoot, 1, -0.546122, 994.852480/animSpeed) --delta=-33.16 - turn(rleg, 1, 21.731893, 1030.059292/animSpeed) --delta=34.34 - if (rightArm) then turn(rloarm, 1, -39.457405, 119.055627/animSpeed) end--delta=-3.97 - turn(rthigh, 1, -48.555555, 195.760223/animSpeed) --delta=-6.53 - turn(rthigh, 3, -12.921380, 65.222706/animSpeed) --delta=2.17 - turn(rthigh, 2, -18.341445, 67.694124/animSpeed) --delta=-2.26 - if (rightArm) then turn(ruparm, 1, 27.520808, 158.594175/animSpeed) end--delta=-5.29 - if (rightArm) then turn(ruparm, 2, -1.893975, 32.446164/animSpeed) end--delta=-1.08 - turn(torso, 1, -3.674753, 18.402335/animSpeed) --delta=-0.61 - turn(torso, 3, -4.074748, 60.626684/animSpeed) --delta=2.02 - turn(torso, 2, -13.926961, 181.425790/animSpeed) --delta=-6.05 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:32 + if leftArm then + turn(biggun, 1, -55.253092, 63.311038 / animSpeed) + end --delta=2.11 + turn(head, 1, -1.563179, 31.723670 / animSpeed) --delta=-1.06 + turn(head, 2, 6.127755, 68.937274 / animSpeed) --delta=2.30 + turn(lfoot, 1, -21.408024, 208.069572 / animSpeed) --delta=-6.94 + turn(lleg, 1, 3.737072, 714.827163 / animSpeed) --delta=23.83 + turn(lthigh, 1, 24.379452, 676.993988 / animSpeed) --delta=-22.57 + turn(lthigh, 3, -7.321217, 145.827258 / animSpeed) --delta=4.86 + turn(lthigh, 2, 5.849079, 153.076646 / animSpeed) --delta=5.10 + if leftArm then + turn(luparm, 1, 2.317686, 194.682700 / animSpeed) + end --delta=6.49 + if leftArm then + turn(luparm, 2, -5.045461, 139.465893 / animSpeed) + end --delta=-4.65 + turn(pelvis, 3, 3.963673, 58.974037 / animSpeed) --delta=-1.97 + turn(pelvis, 2, 5.026658, 67.643372 / animSpeed) --delta=2.25 + turn(rfoot, 1, -0.546122, 994.852480 / animSpeed) --delta=-33.16 + turn(rleg, 1, 21.731893, 1030.059292 / animSpeed) --delta=34.34 + if rightArm then + turn(rloarm, 1, -39.457405, 119.055627 / animSpeed) + end --delta=-3.97 + turn(rthigh, 1, -48.555555, 195.760223 / animSpeed) --delta=-6.53 + turn(rthigh, 3, -12.921380, 65.222706 / animSpeed) --delta=2.17 + turn(rthigh, 2, -18.341445, 67.694124 / animSpeed) --delta=-2.26 + if rightArm then + turn(ruparm, 1, 27.520808, 158.594175 / animSpeed) + end --delta=-5.29 + if rightArm then + turn(ruparm, 2, -1.893975, 32.446164 / animSpeed) + end --delta=-1.08 + turn(torso, 1, -3.674753, 18.402335 / animSpeed) --delta=-0.61 + turn(torso, 3, -4.074748, 60.626684 / animSpeed) --delta=2.02 + turn(torso, 2, -13.926961, 181.425790 / animSpeed) --delta=-6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:36 - - if (leftArm) then turn(biggun, 1, -56.389444, 34.090567/animSpeed) end--delta=1.14 - turn(head, 1, 0.023005, 47.585536/animSpeed) --delta=-1.59 - turn(head, 2, 7.659692, 45.958102/animSpeed) --delta=1.53 - turn(lfoot, 1, -33.511695, 363.110120/animSpeed) --delta=12.10 - turn(lleg, 1, 32.254462, 855.521701/animSpeed) --delta=-28.52 - turn(lthigh, 1, 18.565433, 174.420577/animSpeed) --delta=5.81 - turn(lthigh, 3, -9.818104, 74.906625/animSpeed) --delta=2.50 - turn(lthigh, 2, 5.332458, 15.498655/animSpeed) --delta=-0.52 - if (leftArm) then turn(luparm, 1, -3.274263, 167.758466/animSpeed) end--delta=5.59 - if (leftArm) then turn(luparm, 2, -6.556594, 45.333998/animSpeed) end--delta=-1.51 - move (pelvis, 2, -2.000000 , 25.555555 /animSpeed) --delta=-0.85 - turn(pelvis, 3, 5.000000, 31.089813/animSpeed) --delta=-1.04 - turn(pelvis, 2, 6.000000, 29.200275/animSpeed) --delta=0.97 - turn(rfoot, 1, 4.673420, 156.586261/animSpeed) --delta=-5.22 - turn(rleg, 1, 17.968366, 112.905793/animSpeed) --delta=3.76 - if (rightArm) then turn(rloarm, 1, -38.000000, 43.722158/animSpeed) end--delta=-1.46 - turn(rthigh, 1, -40.972853, 227.481055/animSpeed) --delta=-7.58 - turn(rthigh, 3, -12.483621, 13.132763/animSpeed) --delta=-0.44 - turn(rthigh, 2, -18.495587, 4.624260/animSpeed) --delta=-0.15 - if (rightArm) then turn(ruparm, 1, 29.923749, 72.088224/animSpeed) end--delta=-2.40 - if (rightArm) then turn(ruparm, 2, -2.615000, 21.630765/animSpeed) end--delta=-0.72 - turn(torso, 1, -2.141225, 46.005832/animSpeed) --delta=-1.53 - turn(torso, 3, -5.140116, 31.961046/animSpeed) --delta=1.07 - turn(torso, 2, -15.758869, 54.957239/animSpeed) --delta=-1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:36 + if leftArm then + turn(biggun, 1, -56.389444, 34.090567 / animSpeed) + end --delta=1.14 + turn(head, 1, 0.023005, 47.585536 / animSpeed) --delta=-1.59 + turn(head, 2, 7.659692, 45.958102 / animSpeed) --delta=1.53 + turn(lfoot, 1, -33.511695, 363.110120 / animSpeed) --delta=12.10 + turn(lleg, 1, 32.254462, 855.521701 / animSpeed) --delta=-28.52 + turn(lthigh, 1, 18.565433, 174.420577 / animSpeed) --delta=5.81 + turn(lthigh, 3, -9.818104, 74.906625 / animSpeed) --delta=2.50 + turn(lthigh, 2, 5.332458, 15.498655 / animSpeed) --delta=-0.52 + if leftArm then + turn(luparm, 1, -3.274263, 167.758466 / animSpeed) + end --delta=5.59 + if leftArm then + turn(luparm, 2, -6.556594, 45.333998 / animSpeed) + end --delta=-1.51 + move(pelvis, 2, -2.000000, 25.555555 / animSpeed) --delta=-0.85 + turn(pelvis, 3, 5.000000, 31.089813 / animSpeed) --delta=-1.04 + turn(pelvis, 2, 6.000000, 29.200275 / animSpeed) --delta=0.97 + turn(rfoot, 1, 4.673420, 156.586261 / animSpeed) --delta=-5.22 + turn(rleg, 1, 17.968366, 112.905793 / animSpeed) --delta=3.76 + if rightArm then + turn(rloarm, 1, -38.000000, 43.722158 / animSpeed) + end --delta=-1.46 + turn(rthigh, 1, -40.972853, 227.481055 / animSpeed) --delta=-7.58 + turn(rthigh, 3, -12.483621, 13.132763 / animSpeed) --delta=-0.44 + turn(rthigh, 2, -18.495587, 4.624260 / animSpeed) --delta=-0.15 + if rightArm then + turn(ruparm, 1, 29.923749, 72.088224 / animSpeed) + end --delta=-2.40 + if rightArm then + turn(ruparm, 2, -2.615000, 21.630765 / animSpeed) + end --delta=-0.72 + turn(torso, 1, -2.141225, 46.005832 / animSpeed) --delta=-1.53 + turn(torso, 3, -5.140116, 31.961046 / animSpeed) --delta=1.07 + turn(torso, 2, -15.758869, 54.957239 / animSpeed) --delta=-1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:40 - - if (leftArm) then turn(biggun, 1, -55.431951, 28.724805/animSpeed) end--delta=-0.96 - turn(head, 1, -0.505722, 15.861819/animSpeed) --delta=0.53 - turn(head, 2, 6.127755, 45.958102/animSpeed) --delta=-1.53 - turn(lfoot, 1, -26.332418, 215.378302/animSpeed) --delta=-7.18 - turn(lleg, 1, 78.044494, 1373.700965/animSpeed) --delta=-45.79 - turn(lleg, 3, 0.174770, 5.001042/animSpeed) --delta=-0.17 - turn(lleg, 2, -0.146625, 4.279269/animSpeed) --delta=-0.14 - turn(lthigh, 1, -2.370128, 628.066816/animSpeed) --delta=20.94 - turn(lthigh, 3, -5.835163, 119.488247/animSpeed) --delta=-3.98 - turn(lthigh, 2, -2.219125, 226.547492/animSpeed) --delta=-7.55 - if (leftArm) then turn(luparm, 1, -3.054371, 6.596772/animSpeed) end--delta=-0.22 - if (leftArm) then turn(luparm, 2, -6.061839, 14.842650/animSpeed) end--delta=0.49 - move (pelvis, 2, -2.851852 , 25.555558 /animSpeed) --delta=-0.85 - turn(pelvis, 3, 3.933333, 31.999991/animSpeed) --delta=1.07 - turn(pelvis, 2, 4.992593, 30.222230/animSpeed) --delta=-1.01 - turn(rfoot, 1, 5.697123, 30.711083/animSpeed) --delta=-1.02 - turn(rleg, 1, 37.499340, 585.929212/animSpeed) --delta=-19.53 - if (rightArm) then turn(rloarm, 1, -40.468516, 74.055472/animSpeed) end--delta=2.47 - turn(rthigh, 1, -47.862042, 206.675650/animSpeed) --delta=6.89 - turn(rthigh, 3, -11.534632, 28.469671/animSpeed) --delta=-0.95 - turn(rthigh, 2, -17.767171, 21.852473/animSpeed) --delta=0.73 - if (rightArm) then turn(ruparm, 1, 28.884286, 31.183878/animSpeed) end--delta=1.04 - if (rightArm) then turn(ruparm, 2, -1.954060, 19.828204/animSpeed) end--delta=0.66 - turn(torso, 1, -3.061342, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, -4.043559, 32.896722/animSpeed) --delta=-1.10 - turn(torso, 2, -13.926961, 54.957239/animSpeed) --delta=1.83 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:40 + if leftArm then + turn(biggun, 1, -55.431951, 28.724805 / animSpeed) + end --delta=-0.96 + turn(head, 1, -0.505722, 15.861819 / animSpeed) --delta=0.53 + turn(head, 2, 6.127755, 45.958102 / animSpeed) --delta=-1.53 + turn(lfoot, 1, -26.332418, 215.378302 / animSpeed) --delta=-7.18 + turn(lleg, 1, 78.044494, 1373.700965 / animSpeed) --delta=-45.79 + turn(lleg, 3, 0.174770, 5.001042 / animSpeed) --delta=-0.17 + turn(lleg, 2, -0.146625, 4.279269 / animSpeed) --delta=-0.14 + turn(lthigh, 1, -2.370128, 628.066816 / animSpeed) --delta=20.94 + turn(lthigh, 3, -5.835163, 119.488247 / animSpeed) --delta=-3.98 + turn(lthigh, 2, -2.219125, 226.547492 / animSpeed) --delta=-7.55 + if leftArm then + turn(luparm, 1, -3.054371, 6.596772 / animSpeed) + end --delta=-0.22 + if leftArm then + turn(luparm, 2, -6.061839, 14.842650 / animSpeed) + end --delta=0.49 + move(pelvis, 2, -2.851852, 25.555558 / animSpeed) --delta=-0.85 + turn(pelvis, 3, 3.933333, 31.999991 / animSpeed) --delta=1.07 + turn(pelvis, 2, 4.992593, 30.222230 / animSpeed) --delta=-1.01 + turn(rfoot, 1, 5.697123, 30.711083 / animSpeed) --delta=-1.02 + turn(rleg, 1, 37.499340, 585.929212 / animSpeed) --delta=-19.53 + if rightArm then + turn(rloarm, 1, -40.468516, 74.055472 / animSpeed) + end --delta=2.47 + turn(rthigh, 1, -47.862042, 206.675650 / animSpeed) --delta=6.89 + turn(rthigh, 3, -11.534632, 28.469671 / animSpeed) --delta=-0.95 + turn(rthigh, 2, -17.767171, 21.852473 / animSpeed) --delta=0.73 + if rightArm then + turn(ruparm, 1, 28.884286, 31.183878 / animSpeed) + end --delta=1.04 + if rightArm then + turn(ruparm, 2, -1.954060, 19.828204 / animSpeed) + end --delta=0.66 + turn(torso, 1, -3.061342, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, -4.043559, 32.896722 / animSpeed) --delta=-1.10 + turn(torso, 2, -13.926961, 54.957239 / animSpeed) --delta=1.83 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:44 + if bMoving then --Frame:44 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(rfootstep, 1024 + 2) end - if (leftArm) then turn(biggun, 1, -53.164273, 68.030323/animSpeed) end--delta=-2.27 - turn(head, 1, -2.091907, 47.585562/animSpeed) --delta=1.59 - turn(head, 2, 3.829846, 68.937274/animSpeed) --delta=-2.30 - turn(lfoot, 1, -38.582946, 367.515848/animSpeed) --delta=12.25 - turn(lleg, 1, 104.269176, 786.740462/animSpeed) --delta=-26.22 - turn(lleg, 3, -0.034635, 6.282160/animSpeed) --delta=0.21 - turn(lleg, 2, 0.050427, 5.911553/animSpeed) --delta=0.20 - turn(lthigh, 1, -29.086507, 801.491385/animSpeed) --delta=26.72 - turn(lthigh, 3, -3.433171, 72.059742/animSpeed) --delta=-2.40 - turn(lthigh, 2, 1.068465, 98.627710/animSpeed) --delta=3.29 - if (leftArm) then turn(luparm, 1, -1.515114, 46.177713/animSpeed) end--delta=-1.54 - if (leftArm) then turn(luparm, 2, -4.161596, 57.007282/animSpeed) end--delta=1.90 - turn(pelvis, 3, 2.088889, 55.333337/animSpeed) --delta=1.84 - turn(pelvis, 2, 2.874074, 63.555555/animSpeed) --delta=-2.12 - turn(rfoot, 1, -11.381223, 512.350363/animSpeed) --delta=17.08 - turn(rleg, 1, 55.770656, 548.139483/animSpeed) --delta=-18.27 - if (rightArm) then turn(rloarm, 1, -46.314813, 175.388910/animSpeed) end--delta=5.85 - turn(rthigh, 1, -43.758461, 123.107432/animSpeed) --delta=-4.10 - turn(rthigh, 3, -5.082535, 193.562904/animSpeed) --delta=-6.45 - turn(rthigh, 2, -9.017982, 262.475666/animSpeed) --delta=8.75 - if (rightArm) then turn(ruparm, 1, 26.384334, 74.998551/animSpeed) end--delta=2.50 - if (rightArm) then turn(ruparm, 2, -0.722308, 36.952569/animSpeed) end--delta=1.23 - turn(torso, 1, -3.981459, 27.603503/animSpeed) --delta=0.92 - turn(torso, 3, -2.147426, 56.883980/animSpeed) --delta=-1.90 - turn(torso, 2, -7.879434, 181.425790/animSpeed) --delta=6.05 - Sleep( (33*animSpeed) -1) + if leftArm then + turn(biggun, 1, -53.164273, 68.030323 / animSpeed) + end --delta=-2.27 + turn(head, 1, -2.091907, 47.585562 / animSpeed) --delta=1.59 + turn(head, 2, 3.829846, 68.937274 / animSpeed) --delta=-2.30 + turn(lfoot, 1, -38.582946, 367.515848 / animSpeed) --delta=12.25 + turn(lleg, 1, 104.269176, 786.740462 / animSpeed) --delta=-26.22 + turn(lleg, 3, -0.034635, 6.282160 / animSpeed) --delta=0.21 + turn(lleg, 2, 0.050427, 5.911553 / animSpeed) --delta=0.20 + turn(lthigh, 1, -29.086507, 801.491385 / animSpeed) --delta=26.72 + turn(lthigh, 3, -3.433171, 72.059742 / animSpeed) --delta=-2.40 + turn(lthigh, 2, 1.068465, 98.627710 / animSpeed) --delta=3.29 + if leftArm then + turn(luparm, 1, -1.515114, 46.177713 / animSpeed) + end --delta=-1.54 + if leftArm then + turn(luparm, 2, -4.161596, 57.007282 / animSpeed) + end --delta=1.90 + turn(pelvis, 3, 2.088889, 55.333337 / animSpeed) --delta=1.84 + turn(pelvis, 2, 2.874074, 63.555555 / animSpeed) --delta=-2.12 + turn(rfoot, 1, -11.381223, 512.350363 / animSpeed) --delta=17.08 + turn(rleg, 1, 55.770656, 548.139483 / animSpeed) --delta=-18.27 + if rightArm then + turn(rloarm, 1, -46.314813, 175.388910 / animSpeed) + end --delta=5.85 + turn(rthigh, 1, -43.758461, 123.107432 / animSpeed) --delta=-4.10 + turn(rthigh, 3, -5.082535, 193.562904 / animSpeed) --delta=-6.45 + turn(rthigh, 2, -9.017982, 262.475666 / animSpeed) --delta=8.75 + if rightArm then + turn(ruparm, 1, 26.384334, 74.998551 / animSpeed) + end --delta=2.50 + if rightArm then + turn(ruparm, 2, -0.722308, 36.952569 / animSpeed) + end --delta=1.23 + turn(torso, 1, -3.981459, 27.603503 / animSpeed) --delta=0.92 + turn(torso, 3, -2.147426, 56.883980 / animSpeed) --delta=-1.90 + turn(torso, 2, -7.879434, 181.425790 / animSpeed) --delta=6.05 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:48 - if (leftArm) then turn(biggun, 1, -50.493628, 80.119348/animSpeed) end--delta=-2.67 - turn(head, 1, -3.149363, 31.723676/animSpeed) --delta=1.06 - turn(head, 2, 0.000000, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -44.880435, 188.924672/animSpeed) --delta=6.30 - turn(lleg, 1, 90.690391, 407.363547/animSpeed) --delta=13.58 - turn(lleg, 3, -1.028354, 29.811568/animSpeed) --delta=0.99 - turn(lleg, 2, 1.046484, 29.881704/animSpeed) --delta=1.00 - turn(lthigh, 1, -43.881824, 443.859502/animSpeed) --delta=14.80 - turn(lthigh, 3, 2.753780, 185.608529/animSpeed) --delta=-6.19 - turn(lthigh, 2, 9.180887, 243.372656/animSpeed) --delta=8.11 - if (leftArm) then turn(luparm, 1, 2.662867, 125.339441/animSpeed) end--delta=-4.18 - if (leftArm) then turn(luparm, 2, -1.793232, 71.050921/animSpeed) end--delta=2.37 - move (pelvis, 2, -2.000000 , 25.555551 /animSpeed) --delta=0.85 - turn(pelvis, 3, -0.000000, 62.666668/animSpeed) --delta=2.09 - turn(pelvis, 2, 0.000000, 86.222221/animSpeed) --delta=-2.87 - turn(rfoot, 1, -23.519080, 364.135724/animSpeed) --delta=12.14 - turn(rleg, 1, 46.484300, 278.590678/animSpeed) --delta=9.29 - if (rightArm) then turn(rloarm, 1, -53.199999, 206.555576/animSpeed) end--delta=6.89 - turn(rthigh, 1, -23.439316, 609.574354/animSpeed) --delta=-20.32 - turn(rthigh, 3, -0.344027, 142.155249/animSpeed) --delta=-4.74 - turn(rthigh, 2, -1.531381, 224.598052/animSpeed) --delta=7.49 - if (rightArm) then turn(ruparm, 1, 23.351554, 90.983396/animSpeed) end--delta=3.03 - if (rightArm) then turn(ruparm, 2, 0.479402, 36.051284/animSpeed) end--delta=1.20 - turn(torso, 1, -4.594870, 18.402335/animSpeed) --delta=0.61 - turn(torso, 3, -0.000000, 64.422792/animSpeed) --delta=-2.15 - turn(torso, 2, 0.000000, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:48 + if leftArm then + turn(biggun, 1, -50.493628, 80.119348 / animSpeed) + end --delta=-2.67 + turn(head, 1, -3.149363, 31.723676 / animSpeed) --delta=1.06 + turn(head, 2, 0.000000, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -44.880435, 188.924672 / animSpeed) --delta=6.30 + turn(lleg, 1, 90.690391, 407.363547 / animSpeed) --delta=13.58 + turn(lleg, 3, -1.028354, 29.811568 / animSpeed) --delta=0.99 + turn(lleg, 2, 1.046484, 29.881704 / animSpeed) --delta=1.00 + turn(lthigh, 1, -43.881824, 443.859502 / animSpeed) --delta=14.80 + turn(lthigh, 3, 2.753780, 185.608529 / animSpeed) --delta=-6.19 + turn(lthigh, 2, 9.180887, 243.372656 / animSpeed) --delta=8.11 + if leftArm then + turn(luparm, 1, 2.662867, 125.339441 / animSpeed) + end --delta=-4.18 + if leftArm then + turn(luparm, 2, -1.793232, 71.050921 / animSpeed) + end --delta=2.37 + move(pelvis, 2, -2.000000, 25.555551 / animSpeed) --delta=0.85 + turn(pelvis, 3, -0.000000, 62.666668 / animSpeed) --delta=2.09 + turn(pelvis, 2, 0.000000, 86.222221 / animSpeed) --delta=-2.87 + turn(rfoot, 1, -23.519080, 364.135724 / animSpeed) --delta=12.14 + turn(rleg, 1, 46.484300, 278.590678 / animSpeed) --delta=9.29 + if rightArm then + turn(rloarm, 1, -53.199999, 206.555576 / animSpeed) + end --delta=6.89 + turn(rthigh, 1, -23.439316, 609.574354 / animSpeed) --delta=-20.32 + turn(rthigh, 3, -0.344027, 142.155249 / animSpeed) --delta=-4.74 + turn(rthigh, 2, -1.531381, 224.598052 / animSpeed) --delta=7.49 + if rightArm then + turn(ruparm, 1, 23.351554, 90.983396 / animSpeed) + end --delta=3.03 + if rightArm then + turn(ruparm, 2, 0.479402, 36.051284 / animSpeed) + end --delta=1.20 + turn(torso, 1, -4.594870, 18.402335 / animSpeed) --delta=0.61 + turn(torso, 3, -0.000000, 64.422792 / animSpeed) --delta=-2.15 + turn(torso, 2, 0.000000, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:52 - if (leftArm) then turn(biggun, 1, -48.215180, 68.353460/animSpeed) end--delta=-2.28 - turn(head, 1, -2.620635, 15.861851/animSpeed) --delta=-0.53 - turn(head, 2, -3.829846, 114.895376/animSpeed) --delta=-3.83 - turn(lfoot, 1, -33.266887, 348.406447/animSpeed) --delta=-11.61 - turn(lleg, 1, 55.932201, 1042.745719/animSpeed) --delta=34.76 - turn(lleg, 3, 0.028179, 31.695983/animSpeed) --delta=-1.06 - turn(lleg, 2, -0.009821, 31.689154/animSpeed) --delta=-1.06 - turn(lthigh, 1, -55.237751, 340.677815/animSpeed) --delta=11.36 - turn(lthigh, 3, 10.085981, 219.966025/animSpeed) --delta=-7.33 - turn(lthigh, 2, 15.046731, 175.975325/animSpeed) --delta=5.87 - if (leftArm) then turn(luparm, 1, 9.919362, 217.694824/animSpeed) end--delta=-7.26 - if (leftArm) then turn(luparm, 2, 0.965138, 82.751096/animSpeed) end--delta=2.76 - move (pelvis, 2, -1.074074 , 27.777776 /animSpeed) --delta=0.93 - turn(pelvis, 3, -1.666667, 49.999997/animSpeed) --delta=1.67 - turn(pelvis, 2, -2.296296, 68.888891/animSpeed) --delta=-2.30 - turn(rfoot, 1, -24.788553, 38.084179/animSpeed) --delta=1.27 - turn(rleg, 1, 21.945633, 736.160009/animSpeed) --delta=24.54 - if (rightArm) then turn(rloarm, 1, -56.129627, 87.888859/animSpeed) end--delta=2.93 - turn(rthigh, 1, 3.073465, 795.383403/animSpeed) --delta=-26.51 - turn(rthigh, 3, 1.955836, 68.995906/animSpeed) --delta=-2.30 - turn(rthigh, 2, -0.370374, 34.830198/animSpeed) --delta=1.16 - if (rightArm) then turn(ruparm, 1, 21.424041, 57.825406/animSpeed) end--delta=1.93 - if (rightArm) then turn(ruparm, 2, 1.762963, 38.506840/animSpeed) end--delta=1.28 - turn(torso, 1, -4.288164, 9.201174/animSpeed) --delta=-0.31 - turn(torso, 3, 1.713372, 51.401158/animSpeed) --delta=-1.71 - turn(torso, 2, 7.879434, 236.383029/animSpeed) --delta=7.88 - Sleep( (33*animSpeed) -1) + if bMoving then --Frame:52 + if leftArm then + turn(biggun, 1, -48.215180, 68.353460 / animSpeed) + end --delta=-2.28 + turn(head, 1, -2.620635, 15.861851 / animSpeed) --delta=-0.53 + turn(head, 2, -3.829846, 114.895376 / animSpeed) --delta=-3.83 + turn(lfoot, 1, -33.266887, 348.406447 / animSpeed) --delta=-11.61 + turn(lleg, 1, 55.932201, 1042.745719 / animSpeed) --delta=34.76 + turn(lleg, 3, 0.028179, 31.695983 / animSpeed) --delta=-1.06 + turn(lleg, 2, -0.009821, 31.689154 / animSpeed) --delta=-1.06 + turn(lthigh, 1, -55.237751, 340.677815 / animSpeed) --delta=11.36 + turn(lthigh, 3, 10.085981, 219.966025 / animSpeed) --delta=-7.33 + turn(lthigh, 2, 15.046731, 175.975325 / animSpeed) --delta=5.87 + if leftArm then + turn(luparm, 1, 9.919362, 217.694824 / animSpeed) + end --delta=-7.26 + if leftArm then + turn(luparm, 2, 0.965138, 82.751096 / animSpeed) + end --delta=2.76 + move(pelvis, 2, -1.074074, 27.777776 / animSpeed) --delta=0.93 + turn(pelvis, 3, -1.666667, 49.999997 / animSpeed) --delta=1.67 + turn(pelvis, 2, -2.296296, 68.888891 / animSpeed) --delta=-2.30 + turn(rfoot, 1, -24.788553, 38.084179 / animSpeed) --delta=1.27 + turn(rleg, 1, 21.945633, 736.160009 / animSpeed) --delta=24.54 + if rightArm then + turn(rloarm, 1, -56.129627, 87.888859 / animSpeed) + end --delta=2.93 + turn(rthigh, 1, 3.073465, 795.383403 / animSpeed) --delta=-26.51 + turn(rthigh, 3, 1.955836, 68.995906 / animSpeed) --delta=-2.30 + turn(rthigh, 2, -0.370374, 34.830198 / animSpeed) --delta=1.16 + if rightArm then + turn(ruparm, 1, 21.424041, 57.825406 / animSpeed) + end --delta=1.93 + if rightArm then + turn(ruparm, 2, 1.762963, 38.506840 / animSpeed) + end --delta=1.28 + turn(torso, 1, -4.288164, 9.201174 / animSpeed) --delta=-0.31 + turn(torso, 3, 1.713372, 51.401158 / animSpeed) --delta=-1.71 + turn(torso, 2, 7.879434, 236.383029 / animSpeed) --delta=7.88 + Sleep((33 * animSpeed) - 1) end end end @@ -466,8 +614,8 @@ local isDancing = false local function Dance1() Signal(SIG_WALK) SetSignalMask(SIG_WALK) - local speedMult = 1/4 - local sleepTime = 33*4 + local speedMult = 1 / 4 + local sleepTime = 33 * 4 -- Frame: 6 (first step) Turn(head, y_axis, 0.104720, 3.141593 * speedMult) -- delta=6.00 @@ -480,7 +628,7 @@ local function Dance1() Turn(lthigh, x_axis, -0.547990, 6.484738 * speedMult) -- delta=12.38 Turn(lthigh, z_axis, 0.358445, 5.849047 * speedMult) -- delta=11.17 Turn(lthigh, y_axis, -0.015696, 7.280939 * speedMult) -- delta=-13.91 - Move(pelvis, x_axis, - 2.217917, 66.537516 * speedMult) -- delta=2.22 + Move(pelvis, x_axis, -2.217917, 66.537516 * speedMult) -- delta=2.22 Move(pelvis, z_axis, 0.147905, 4.437149 * speedMult) -- delta=0.15 Move(pelvis, y_axis, -2.880190, 56.405711 * speedMult) -- delta=-1.88 Turn(pelvis, z_axis, -0.005986, 0.179589 * speedMult) -- delta=-0.34 @@ -523,7 +671,7 @@ local function Dance1() Turn(luparm, x_axis, 0.239702, 2.878582 * speedMult) -- delta=5.50 Turn(luparm, z_axis, 0.308320, 0.767303 * speedMult) -- delta=1.47 Turn(luparm, y_axis, 0.007498, 3.550799 * speedMult) -- delta=-6.78 - Move(pelvis, x_axis, - 1.298512, 27.582171 * speedMult) -- delta=-0.92 + Move(pelvis, x_axis, -1.298512, 27.582171 * speedMult) -- delta=-0.92 Move(pelvis, y_axis, -2.482196, 11.939836 * speedMult) -- delta=0.40 Turn(pelvis, z_axis, -0.003503, 0.074496 * speedMult) -- delta=0.14 Turn(pelvis, y_axis, 0.083659, 1.779079 * speedMult) -- delta=-3.40 @@ -561,7 +709,7 @@ local function Dance1() Turn(luparm, x_axis, -0.031022, 8.121713 * speedMult) -- delta=15.51 Turn(luparm, z_axis, 0.380483, 2.164890 * speedMult) -- delta=4.13 Turn(luparm, y_axis, -0.326446, 10.018325 * speedMult) -- delta=-19.13 - Move(pelvis, x_axis, 1.748151, 91.399884 * speedMult) -- delta=-3.05 + Move(pelvis, x_axis, 1.748151, 91.399884 * speedMult) -- delta=-3.05 Move(pelvis, y_axis, -3.133945, 19.552481 * speedMult) -- delta=-0.65 Turn(pelvis, z_axis, 0.003503, 0.210186 * speedMult) -- delta=0.40 Turn(pelvis, y_axis, -0.083659, 5.019544 * speedMult) -- delta=-9.59 @@ -598,7 +746,7 @@ local function Dance1() Turn(luparm, x_axis, -0.126974, 2.878580 * speedMult) -- delta=5.50 Turn(luparm, z_axis, 0.406060, 0.767303 * speedMult) -- delta=1.47 Turn(luparm, y_axis, -0.444806, 3.550799 * speedMult) -- delta=-6.78 - Move(pelvis, x_axis, 2.217917, 14.092977 * speedMult) -- delta=-0.47 + Move(pelvis, x_axis, 2.217917, 14.092977 * speedMult) -- delta=-0.47 Move(pelvis, y_axis, -2.880190, 7.612646 * speedMult) -- delta=0.25 Turn(pelvis, z_axis, 0.005986, 0.074496 * speedMult) -- delta=0.14 Turn(pelvis, y_axis, -0.142962, 1.779079 * speedMult) -- delta=-3.40 @@ -635,7 +783,7 @@ local function Dance1() Turn(luparm, x_axis, -0.031022, 2.878582 * speedMult) -- delta=-5.50 Turn(luparm, z_axis, 0.380483, 0.767303 * speedMult) -- delta=-1.47 Turn(luparm, y_axis, -0.326446, 3.550799 * speedMult) -- delta=6.78 - Move(pelvis, x_axis, 1.748151, 14.092977 * speedMult) -- delta=0.47 + Move(pelvis, x_axis, 1.748151, 14.092977 * speedMult) -- delta=0.47 Move(pelvis, y_axis, -3.133945, 7.612646 * speedMult) -- delta=-0.25 Turn(pelvis, z_axis, 0.003503, 0.074496 * speedMult) -- delta=-0.14 Turn(pelvis, y_axis, -0.083659, 1.779079 * speedMult) -- delta=3.40 @@ -673,7 +821,7 @@ local function Dance1() Turn(luparm, x_axis, 0.239702, 8.121711 * speedMult) -- delta=-15.51 Turn(luparm, z_axis, 0.308320, 2.164890 * speedMult) -- delta=-4.13 Turn(luparm, y_axis, 0.007498, 10.018324 * speedMult) -- delta=19.13 - Move(pelvis, x_axis, - 1.298512, 91.399884 * speedMult) -- delta=3.05 + Move(pelvis, x_axis, -1.298512, 91.399884 * speedMult) -- delta=3.05 Move(pelvis, y_axis, -2.482196, 19.552481 * speedMult) -- delta=0.65 Turn(pelvis, z_axis, -0.003503, 0.210186 * speedMult) -- delta=-0.40 Turn(pelvis, y_axis, 0.083659, 5.019544 * speedMult) -- delta=9.59 @@ -711,7 +859,7 @@ local function Dance1() Turn(luparm, x_axis, 0.335655, 2.878582 * speedMult) -- delta=-5.50 Turn(luparm, z_axis, 0.282743, 0.767303 * speedMult) -- delta=-1.47 Turn(luparm, y_axis, 0.125858, 3.550800 * speedMult) -- delta=6.78 - Move(pelvis, x_axis, - 2.217917, 27.582171 * speedMult) -- delta=0.92 + Move(pelvis, x_axis, -2.217917, 27.582171 * speedMult) -- delta=0.92 Move(pelvis, y_axis, -2.880190, 11.939836 * speedMult) -- delta=-0.40 Turn(pelvis, z_axis, -0.005986, 0.074496 * speedMult) -- delta=-0.14 Turn(pelvis, y_axis, 0.142962, 1.779079 * speedMult) -- delta=3.40 @@ -787,7 +935,7 @@ end function SprayNano(heading, pitch) SetSignalMask(SIG_AIM) Sleep(1000) - while (true) do + while true do Turn(torso, 2, rad(10) + buildHeading, rad(10)) Sleep(2000) Turn(torso, 2, rad(-10) + buildHeading, rad(10)) @@ -796,36 +944,52 @@ function SprayNano(heading, pitch) end function StopWalking() - move(pelvis,2, -1.000000, 6.944444) - if (leftArm) then turn(biggun,1, -52.006372, 28.433941) end - turn(head,1, -1.298815, 11.896390) - turn(head,2, 0.000000, 28.723844) - turn(lfoot,1, 2.870126, 274.263975) - turn(lleg,1, 22.425678, 349.693872) - turn(lleg,2, 0.000000, 7.922289) - turn(lleg,3, 0.000000, 7.923996) - turn(lthigh,1, -21.115098, 255.919901) - turn(lthigh,2, 11.110453, 66.749106) - turn(lthigh,3, -10.103126, 151.418301) - if (leftArm) then turn(luparm,1, 19.231610, 69.841862) end - if (leftArm) then turn(luparm,2, 7.211138, 46.845002) end - if (leftArm) then turn(luparm,3, -16.200000, 28.500010) end - turn(pelvis,2, 0.000000, 21.666665) - turn(pelvis,3, 0.000000, 18.055557) - turn(rfoot,1, 0.415283, 248.713120) - turn(rleg,1, 25.768060, 346.011740) - turn(rleg,2, 0.000000, 6.521982) - turn(rleg,3, 0.000000, 6.524652) - if (rightArm) then turn(rloarm,1, -53.199995, 51.638894) end - turn(rthigh,1, -21.950628, 255.149679) - turn(rthigh,2, -11.905752, 66.515336) - turn(rthigh,3, 9.396449, 151.125663) - if (rightArm) then turn(ruparm,1, 24.693159, 39.648544) end - if (rightArm) then turn(ruparm,2, 0.000000, 31.089853) end - if (rightArm) then turn(ruparm,3, 12.399998, -7.153845) end - turn(torso,1, -2.263907, 15.181924) - turn(torso,2, 0.000000, 59.095757) - turn(torso,3, 0.000000, 18.561539) + move(pelvis, 2, -1.000000, 6.944444) + if leftArm then + turn(biggun, 1, -52.006372, 28.433941) + end + turn(head, 1, -1.298815, 11.896390) + turn(head, 2, 0.000000, 28.723844) + turn(lfoot, 1, 2.870126, 274.263975) + turn(lleg, 1, 22.425678, 349.693872) + turn(lleg, 2, 0.000000, 7.922289) + turn(lleg, 3, 0.000000, 7.923996) + turn(lthigh, 1, -21.115098, 255.919901) + turn(lthigh, 2, 11.110453, 66.749106) + turn(lthigh, 3, -10.103126, 151.418301) + if leftArm then + turn(luparm, 1, 19.231610, 69.841862) + end + if leftArm then + turn(luparm, 2, 7.211138, 46.845002) + end + if leftArm then + turn(luparm, 3, -16.200000, 28.500010) + end + turn(pelvis, 2, 0.000000, 21.666665) + turn(pelvis, 3, 0.000000, 18.055557) + turn(rfoot, 1, 0.415283, 248.713120) + turn(rleg, 1, 25.768060, 346.011740) + turn(rleg, 2, 0.000000, 6.521982) + turn(rleg, 3, 0.000000, 6.524652) + if rightArm then + turn(rloarm, 1, -53.199995, 51.638894) + end + turn(rthigh, 1, -21.950628, 255.149679) + turn(rthigh, 2, -11.905752, 66.515336) + turn(rthigh, 3, 9.396449, 151.125663) + if rightArm then + turn(ruparm, 1, 24.693159, 39.648544) + end + if rightArm then + turn(ruparm, 2, 0.000000, 31.089853) + end + if rightArm then + turn(ruparm, 3, 12.399998, -7.153845) + end + turn(torso, 1, -2.263907, 15.181924) + turn(torso, 2, 0.000000, 59.095757) + turn(torso, 3, 0.000000, 18.561539) end function GameOverAnim() @@ -846,22 +1010,22 @@ end function UnitSpeed() maxSpeed = UnitDefs[Spring.GetUnitDefID(unitID)].speed animFramesPerKeyframe = 4 --we need to calc the frames per keyframe value, from the known animtime - maxSpeed = maxSpeed + (maxSpeed /(2*animFramesPerKeyframe)) -- add fudge - while(true)do - vx,vy,vz,Speed = Spring.GetUnitVelocity(unitID) + maxSpeed = maxSpeed + (maxSpeed / (2 * animFramesPerKeyframe)) -- add fudge + while true do + vx, vy, vz, Speed = Spring.GetUnitVelocity(unitID) currentSpeed = Speed * 30 - animSpeed = (currentSpeed) - if (animSpeed<1) then - animSpeed=1 + animSpeed = currentSpeed + if animSpeed < 1 then + animSpeed = 1 end animSpeed = (maxSpeed * 4) / animSpeed - if (animSpeed<2) then - animSpeed=2 + if animSpeed < 2 then + animSpeed = 2 end - if (animSpeed>8) then + if animSpeed > 8 then animSpeed = 8 end - Sleep (131) + Sleep(131) if isDancing and (bMoving or isAiming or isBuilding) then StartThread(StopDance1) isDancing = false @@ -876,7 +1040,7 @@ function ResumeBuilding() Turn(aimy1, 2, buildHeading, rad(150.000000)) Turn(luparm, 1, rad(-55) - buildPitch, rad(45.000000)) end - return (0) + return 0 end local unitStates = {} @@ -894,10 +1058,10 @@ function TimerCheck() if frame < wasHitTriggerWindow and flashbangReloadFrame < frame then if unitStates.cloak == true then spSetUnitArmored(unitID, true) - flashbangReloadFrame = frame+570 - flashbangArmorDurationFrame = frame+120 - EmitSfx(nano, 2048+5) - EmitSfx(nano, SFX.CEG+3) + flashbangReloadFrame = frame + 570 + flashbangArmorDurationFrame = frame + 120 + EmitSfx(nano, 2048 + 5) + EmitSfx(nano, SFX.CEG + 3) Sleep(1000) spSetUnitCloak(unitID, true) end @@ -922,7 +1086,7 @@ function script.Create() Spin(dish, 2, 2.5) isAiming = false isAimingDgun = false - isAimingTach = false + isAimingTach = false isBuilding = false isDancing = false bAiming = false @@ -937,7 +1101,9 @@ function script.Create() end function script.StartMoving() - if isDancing then StartThread(StopDance1) end + if isDancing then + StartThread(StopDance1) + end bMoving = true StartThread(walk) end @@ -955,20 +1121,22 @@ function script.AimFromWeapon(weapon) return ruparm elseif weapons[weapon] == "dgun" then return 0 -- this is somehow the best way to ensuse dgun hits whatever target its aimed at - elseif weapons[weapon] == "tachcannon" then - return luparm + elseif weapons[weapon] == "tachcannon" then + return luparm elseif weapons[weapon] == "flashbang" then - return nano + return nano elseif weapons[weapon] == "backlauncher" then return torso end end function script.AimWeapon(weapon, heading, pitch) - if isDancing then StartThread(StopDance1) end - --Spring.Echo("Armcom aiming:",weapons[weapon]) - local reloadingFrameTach = Spring.GetUnitWeaponState(unitID, 4, 'reloadFrame') - if weapons[weapon] == "laser" then + if isDancing then + StartThread(StopDance1) + end + --Spring.Echo("Armcom aiming:",weapons[weapon]) + local reloadingFrameTach = Spring.GetUnitWeaponState(unitID, 4, "reloadFrame") + if weapons[weapon] == "laser" then if isAimingDgun == true or isAimingTach == true then return false else @@ -977,13 +1145,13 @@ function script.AimWeapon(weapon, heading, pitch) Signal(SIG_AIM) Turn(aimy1, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-55), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-40)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + Turn(ruparm, 1, rad(-40) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) -- if the turret cannot turn to its new heading in one frame, wait for turn - if math.abs(last_primary_heading-heading)>rad(10.0000) then + if math.abs(last_primary_heading - heading) > rad(10.0000) then -- seems to take 1 frame for WaitForTurn to process - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) end - last_primary_heading=heading; + last_primary_heading = heading isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -1003,9 +1171,9 @@ function script.AimWeapon(weapon, heading, pitch) Turn(aimy1, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-55), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-40)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + Turn(ruparm, 1, rad(-40) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -1019,18 +1187,18 @@ function script.AimWeapon(weapon, heading, pitch) leftArm = false Turn(aimy1, 2, heading, rad(360.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(biggun, 1, rad(-105), rad(900.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(luparm, 1, rad(15)-pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(aimy1,2) + Turn(luparm, 1, rad(15) - pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + WaitForTurn(aimy1, 2) return true - elseif weapons[weapon] == "tachcannon" then - if reloadingFrameTach < GetGameFrame() then - isAimingTach = true - Turn(aimy1, 2, heading, rad(360.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) - Turn(biggun, 1, rad(-105), rad(900.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(luparm, 1, rad(15)-pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(aimy1,2) - return true - end + elseif weapons[weapon] == "tachcannon" then + if reloadingFrameTach < GetGameFrame() then + isAimingTach = true + Turn(aimy1, 2, heading, rad(360.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) + Turn(biggun, 1, rad(-105), rad(900.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) + Turn(luparm, 1, rad(15) - pitch, rad(900.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + WaitForTurn(aimy1, 2) + return true + end elseif weapons[weapon] == "flashbang" then return false elseif weapons[weapon] == "backlauncher" then @@ -1054,8 +1222,8 @@ function script.FireWeapon(weapon) turn(biggun, 1, -85, 100) move(barrel, 2, 0, 5) return true - elseif weapons[weapon] == "tachcannon" then - isAimingTach = false + elseif weapons[weapon] == "tachcannon" then + isAimingTach = false turn(luparm, 1, 20) turn(biggun, 1, -100) move(barrel, 2, -1.5) @@ -1079,7 +1247,7 @@ function script.QueryWeapon(weapon) return laserflare elseif weapons[weapon] == "dgun" then return lflare - elseif weapons[weapon] == "tachcannon" then + elseif weapons[weapon] == "tachcannon" then return lflare elseif weapons[weapon] == "flashbang" then return nano @@ -1089,21 +1257,23 @@ function script.QueryWeapon(weapon) end function script.StartBuilding(heading, pitch) - if isDancing then StartThread(StopDance1) end + if isDancing then + StartThread(StopDance1) + end Show(nano) Signal(SIG_AIM) isBuilding = true leftArm = false Turn(torso, 2, heading, rad(300.0000)) -- Turn(torso, y-axis, heading, math.rad(300)) Turn(rloarm, 1, rad(-40), rad(390.0000)) -- Turn(rloarm, x-axis, math.rad(-55), math.rad(390)) - Turn(ruparm, 1, rad(-55)-pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) - WaitForTurn(ruparm,1) + Turn(ruparm, 1, rad(-55) - pitch, rad(390.0000)) -- Turn(ruparm, x-axis, math.rad(-55) - pitch, math.rad(390)) + WaitForTurn(ruparm, 1) Spring.UnitScript.SetUnitValue(COB.INBUILDSTANCE, true) buildHeading = heading buildPitch = pitch StartThread(SprayNano, heading, pitch) - Show (armhexl_emit) - Show (armhexl2_emit) + Show(armhexl_emit) + Show(armhexl2_emit) --Show (cagelight_emit); --Spin (cagelight, z_axis,-8); return true @@ -1117,15 +1287,15 @@ function script.StopBuilding() Signal(SIG_AIM) SetSignalMask(SIG_AIM) StartThread(Restore) - Hide (armhexl_emit) - Hide (armhexl2_emit) + Hide(armhexl_emit) + Hide(armhexl2_emit) --Turn (cagelight, z_axis,0,15); return true end function script.QueryNanoPiece() - local piecenum; - piecenum = nano; + local piecenum + piecenum = nano return piecenum end @@ -1133,7 +1303,7 @@ function Restore() SetSignalMask(SIG_AIM) isAiming = false isAimingDgun = false - isAimingTach = false + isAimingTach = false Sleep(3000) turn(aimy1, 2, 0, 105) turn(biggun, 1, -38, 95.0000) @@ -1147,8 +1317,6 @@ function Restore() Spin(dish, 2, 2.5) end - - function script.Killed() return 1 end diff --git a/scripts/Units/armdecom.lua b/scripts/Units/armdecom.lua index 0ae50c689ca..432733e9388 100644 --- a/scripts/Units/armdecom.lua +++ b/scripts/Units/armdecom.lua @@ -5,43 +5,43 @@ ------------------------------------------------------- -- Piece names - head = piece 'head' - base = piece 'torso' - l_arm = piece 'luparm' - l_forearm = piece 'biggun' - r_arm = piece 'ruparm' - r_forearm = piece 'rloarm' - lflare = piece 'lflare' - nano = piece 'nano' - laserflare = piece 'laserflare' - cod = piece 'pelvis' - right_l = piece 'rthigh' - left_l = piece 'lthigh' - shin_l = piece 'lleg' - shin_r = piece 'rleg' - foot_r = piece 'rfoot' - foot_l = piece 'lfoot' - dish = piece 'dish' - teleport = piece 'teleport' +head = piece("head") +base = piece("torso") +l_arm = piece("luparm") +l_forearm = piece("biggun") +r_arm = piece("ruparm") +r_forearm = piece("rloarm") +lflare = piece("lflare") +nano = piece("nano") +laserflare = piece("laserflare") +cod = piece("pelvis") +right_l = piece("rthigh") +left_l = piece("lthigh") +shin_l = piece("lleg") +shin_r = piece("rleg") +foot_r = piece("rfoot") +foot_l = piece("lfoot") +dish = piece("dish") +teleport = piece("teleport") -- State variables - isMoving, isAiming, isAimingDgun, isBuilding, counter = false, false, false, false, 0 +isMoving, isAiming, isAimingDgun, isBuilding, counter = false, false, false, false, 0 -- used to restore build aiming - buildY, buildX = 0, 0 - firedWeapon = false +buildY, buildX = 0, 0 +firedWeapon = false -- Unit Speed - speedMult = 1.25 +speedMult = 1.25 -- Unit animation preferences - leftArm = true; - rightArm = true; - heavy = true; +leftArm = true +rightArm = true +heavy = true -- Signal definitions -local SIG_AIM = 2 -local SIG_WALK = 4 +local SIG_AIM = 2 +local SIG_WALK = 4 function script.StartMoving() isMoving = true @@ -60,8 +60,8 @@ include("include/walk.lua") --Teleport -------------------------------------------------------- local function TeleportControl() - Move(teleport,y_axis,1850,200000) - Turn(teleport, x_axis, math.rad(90),math.rad(200000)) + Move(teleport, y_axis, 1850, 200000) + Turn(teleport, x_axis, math.rad(90), math.rad(200000)) Sleep(100) EmitSfx(teleport, 1025) Sleep(2200) @@ -74,7 +74,7 @@ local function TeleportControl() counter = counter + 1 end Sleep(1000) - Move(teleport,y_axis,0,200000) + Move(teleport, y_axis, 0, 200000) end -------------------------------------------------------- @@ -84,20 +84,20 @@ function script.Create() -- Initial State --StartThread(TeleportControl) Hide(nano) - Turn(r_forearm, x_axis, math.rad(-15),math.rad(130)) - Turn(lflare, x_axis,math.rad(90)) - Turn(nano, x_axis,math.rad(90)) - Turn(laserflare, x_axis,math.rad(90)) + Turn(r_forearm, x_axis, math.rad(-15), math.rad(130)) + Turn(lflare, x_axis, math.rad(90)) + Turn(nano, x_axis, math.rad(90)) + Turn(laserflare, x_axis, math.rad(90)) Spin(dish, y_axis, 2.5) - if(heavy == true ) then + if heavy == true then SquatStance() else StandStance() end -- should do this instead of query nano piece - Spring.SetUnitNanoPieces( unitID, {nano} ) + Spring.SetUnitNanoPieces(unitID, { nano }) end ----------------------------------------------------------------------- @@ -180,7 +180,7 @@ function script.AimWeapon(weaponID, heading, pitch) Turn(base, y_axis, heading, math.rad(300)) Turn(l_forearm, x_axis, math.rad(-85), math.rad(390)) - Turn(l_arm, x_axis, math.rad(-5) - pitch, math.rad(390)) + Turn(l_arm, x_axis, math.rad(-5) - pitch, math.rad(390)) WaitForTurn(base, y_axis) WaitForTurn(l_arm, x_axis) @@ -189,7 +189,7 @@ function script.AimWeapon(weaponID, heading, pitch) StartThread(RestoreAfterDelayLeft) - firedWeapon = false + firedWeapon = false -- Spring.Echo("AimWeapon end") return true elseif not isAimingDgun then @@ -197,7 +197,7 @@ function script.AimWeapon(weaponID, heading, pitch) Turn(base, y_axis, heading, math.rad(300)) Turn(r_forearm, x_axis, math.rad(-55), math.rad(390)) - Turn(r_arm, x_axis, math.rad(-45) - pitch, math.rad(390)) + Turn(r_arm, x_axis, math.rad(-45) - pitch, math.rad(390)) WaitForTurn(base, y_axis) WaitForTurn(r_arm, x_axis) @@ -206,7 +206,7 @@ function script.AimWeapon(weaponID, heading, pitch) StartThread(RestoreAfterDelayRight) - firedWeapon = false + firedWeapon = false -- Spring.Echo("AimWeapon " .. weaponID .. " end") return true end @@ -214,7 +214,7 @@ end function script.FireWeapon(weaponID) Sleep(500) - firedWeapon = true + firedWeapon = true isAiming = false if weaponID == 3 then isAimingDgun = false @@ -223,17 +223,16 @@ end function script.StartBuilding(heading, pitch) Show(nano) --- Spring.Echo("StartBuilding") - Spring.SetUnitNanoPieces( unitID, {nano} ) - isBuilding = true; - + -- Spring.Echo("StartBuilding") + Spring.SetUnitNanoPieces(unitID, { nano }) + isBuilding = true Turn(base, x_axis, 0, math.rad(395)) Turn(cod, x_axis, 0, math.rad(395)) Turn(base, y_axis, heading, math.rad(300)) Turn(r_forearm, x_axis, math.rad(-55), math.rad(390)) - Turn(r_arm, x_axis, math.rad(-55) - pitch, math.rad(390)) + Turn(r_arm, x_axis, math.rad(-55) - pitch, math.rad(390)) WaitForTurn(r_arm, x_axis) SetUnitValue(COB.INBUILDSTANCE, 1) @@ -242,9 +241,9 @@ end function script.StopBuilding() Hide(nano) --Sleep(200) --SLEEPING HERE WILL FUCK YOUR SHIT UP! - isBuilding = false; + isBuilding = false SetUnitValue(COB.INBUILDSTANCE, 0) --- Spring.Echo("Stop Building", isAiming, isBuilding, isMoving) + -- Spring.Echo("Stop Building", isAiming, isBuilding, isMoving) end ----------------------------------------------------------------------- @@ -253,7 +252,7 @@ end function script.Killed(recentDamage, maxHealth) return 1 --cause commdeath does nothing but. -- fall over --- Turn(cod, x_axis, math.rad(270), 5) + -- Turn(cod, x_axis, math.rad(270), 5) -- reset parts -- Turn(base, y_axis, 0, 8) -- Turn(r_arm, z_axis, 4, 3) @@ -275,14 +274,14 @@ function script.Killed(recentDamage, maxHealth) -- local severity = recentDamage/maxHealth -- if (severity <= 99) then - -- Explode(l_arm, SFX.FALL) - -- Explode(r_arm, SFX.FALL) - -- Explode(l_arm, SFX.FALL) - -- Explode(l_forearm, SFX.FALL) - -- Explode(r_arm, SFX.FALL) - -- Explode(r_forearm, SFX.FALL) - -- return 3 + -- Explode(l_arm, SFX.FALL) + -- Explode(r_arm, SFX.FALL) + -- Explode(l_arm, SFX.FALL) + -- Explode(l_forearm, SFX.FALL) + -- Explode(r_arm, SFX.FALL) + -- Explode(r_forearm, SFX.FALL) + -- return 3 -- else - -- return 0 + -- return 0 -- end end diff --git a/scripts/Units/armmar_lus.lua b/scripts/Units/armmar_lus.lua index f74a63796ae..516a4f3d265 100644 --- a/scripts/Units/armmar_lus.lua +++ b/scripts/Units/armmar_lus.lua @@ -5,36 +5,36 @@ end ang = math.rad timedTurn = function(piece, axis, goal, amount, t) - local speed = amount/(t/1000) + local speed = amount / (t / 1000) Turn(piece, axis, goal, speed) end timedMove = function(piece, axis, goal, amount, t) - local speed = amount/(t/1000) + local speed = amount / (t / 1000) Move(piece, axis, goal, speed) end - + unitDefID = Spring.GetUnitDefID(unitID) defs = UnitDefs[unitDefID] unitName = UnitDefs[unitDefID].name -- rename scavenger unit -unitName = string.gsub(unitName, '_scav', '') +unitName = string.gsub(unitName, "_scav", "") pi = math.pi abs = math.abs -pi2 = pi*2 +pi2 = pi * 2 hasWpn = false currentSpeed = 200 weapons = {} -include("units/"..unitName.."_lus/setup.lua") -include("units/"..unitName.."_lus/move.lua") -include("units/"..unitName.."_lus/weaponsdata.lua") - +include("units/" .. unitName .. "_lus/setup.lua") +include("units/" .. unitName .. "_lus/move.lua") +include("units/" .. unitName .. "_lus/weaponsdata.lua") + isMoving, isAiming, isBuilding, counter, canAim, isInLoop, isUW = false, false, false, 0, false, false, false step = 1 - + function MotionControl() local justmoved = true while true do @@ -74,7 +74,7 @@ function MotionControl() justmoved = true else canAim = true - if justmoved then + if justmoved then StartThread(RestoreLegs) if not aim then StartThread(RestoreArms) @@ -88,7 +88,7 @@ end function ypos() while true do - local _,y = Spring.GetUnitPosition(unitID) + local _, y = Spring.GetUnitPosition(unitID) isUW = (y < -60) Sleep(500) end @@ -97,7 +97,7 @@ end function WeaponControl() while true do for weaponID, data in pairs(weapons) do - local data = weapons[weaponID] + local data = weapons[weaponID] local curHead, wtdHead, curPitch, wtdPitch = data.curHead, data.wtdHead, data.curPitch, data.wtdPitch local wpnReady = data.wpnReady local headSpeed = data.headSpeed @@ -108,12 +108,12 @@ function WeaponControl() if curHead < 0 then curHead = pi2 + curHead elseif curHead >= pi2 then - curHead = curHead -(pi2) + curHead = curHead - pi2 end if curPitch < 0 then curPitch = pi2 + curPitch elseif curPitch >= pi2 then - curPitch = curPitch -pi2 + curPitch = curPitch - pi2 end if canAim then local diffHead = wtdHead - curHead @@ -140,7 +140,7 @@ function WeaponControl() curHead = wtdHead headReady = true end - if absdiffPitch > pitchSpeed then + if absdiffPitch > pitchSpeed then if diffPitch < 0 then curPitch = curPitch - pitchSpeed else @@ -150,10 +150,10 @@ function WeaponControl() curPitch = wtdPitch pitchReady = true end - for id,piecenum in pairs (aimy) do + for id, piecenum in pairs(aimy) do Turn(piecenum, 2, curHead) end - for id,piecenum in pairs (aimx) do + for id, piecenum in pairs(aimx) do Turn(piecenum, 1, curPitch) end weapons[weaponID].curHead = curHead @@ -167,14 +167,14 @@ function WeaponControl() Sleep(1) end end - + function script.StartMoving() isMoving = true end function script.StopMoving() isMoving = false -end +end function script.Create() InitialPiecesSetup() @@ -190,7 +190,7 @@ function LastCallCheck(weaponID) if not weapons[weaponID].lastCall then weapons[weaponID].lastCall = f end - if weapons[weaponID].lastCall ~= f-1 then + if weapons[weaponID].lastCall ~= f - 1 then weapons[weaponID].canFire = false end weapons[weaponID].lastCall = f diff --git a/scripts/Units/armmar_lus/move.lua b/scripts/Units/armmar_lus/move.lua index 7d44e230fcf..8f67d4aeb0e 100644 --- a/scripts/Units/armmar_lus/move.lua +++ b/scripts/Units/armmar_lus/move.lua @@ -1,35 +1,25 @@ -stepTimes = {12800, 12800, 12800, 12800, 12800,12800,12800,12800} -keyFramesWalk = { --Step1 Step2 Step3 Step4... - --x y z x y z x y z x y z - [lthigh] = {Turn = {{40,0,0},{30,0,0},{0,0,0},{-25,0,0},{-30,0,0},{-10,0,0},{0,0,0},{10,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [lleg] = {Turn = {{20,0,0},{-15,0,0},{-30,0,0},{-40,0,0},{0,0,0},{20,0,0},{30,0,0},{20,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [lfoot] = {Turn = {{20,0,0},{45,0,0},{30,0,0},{15,0,0},{-30,0,0},{-30,0,0},{-30,0,0},{-10,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [rthigh] = {Turn = {{-30,0,0},{-10,0,0},{0,0,0},{10,0,0},{40,0,0},{30,0,0},{0,0,0},{-25,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [rleg] = {Turn = {{0,0,0},{20,0,0},{30,0,0},{20,0,0},{20,0,0},{-15,0,0},{-30,0,0},{-40,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [rfoot] = {Turn = {{-30,0,0},{-30,0,0},{-30,0,0},{-10,0,0},{20,0,0},{45,0,0},{30,0,0},{15,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [pelvis] = {Turn = {{0,0,2},{0,0,1},{0,0,0.5},{0,0,0},{0,0,-2},{0,0,-1},{0,0,-0.5},{0,0,0}}, - Move = {{0,1.5,0},{0,3,0},{0,1.5,0},{0,1.5,0},{0,1.5,0},{0,3,0},{0,1.5,0},{0,1.5,0}}}, - - [torso] = {Turn = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [luparm] = {Turn = {{-5,0,0},{-2.5,0,0},{0,0,0},{2.5,0,0},{5,0,0},{2.5,0,0},{0,0,0},{-2.5,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, - - [ruparm] = {Turn = {{5,0,0},{2.5,0,0},{0,0,0},{-2.5,0,0},{-5,0,0},{-2.5,0,0},{0,0,0},{2.5,0,0}}, - Move = {{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}, +stepTimes = { 12800, 12800, 12800, 12800, 12800, 12800, 12800, 12800 } +keyFramesWalk = { --Step1 Step2 Step3 Step4... + --x y z x y z x y z x y z + [lthigh] = { Turn = { { 40, 0, 0 }, { 30, 0, 0 }, { 0, 0, 0 }, { -25, 0, 0 }, { -30, 0, 0 }, { -10, 0, 0 }, { 0, 0, 0 }, { 10, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [lleg] = { Turn = { { 20, 0, 0 }, { -15, 0, 0 }, { -30, 0, 0 }, { -40, 0, 0 }, { 0, 0, 0 }, { 20, 0, 0 }, { 30, 0, 0 }, { 20, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [lfoot] = { Turn = { { 20, 0, 0 }, { 45, 0, 0 }, { 30, 0, 0 }, { 15, 0, 0 }, { -30, 0, 0 }, { -30, 0, 0 }, { -30, 0, 0 }, { -10, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [rthigh] = { Turn = { { -30, 0, 0 }, { -10, 0, 0 }, { 0, 0, 0 }, { 10, 0, 0 }, { 40, 0, 0 }, { 30, 0, 0 }, { 0, 0, 0 }, { -25, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [rleg] = { Turn = { { 0, 0, 0 }, { 20, 0, 0 }, { 30, 0, 0 }, { 20, 0, 0 }, { 20, 0, 0 }, { -15, 0, 0 }, { -30, 0, 0 }, { -40, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [rfoot] = { Turn = { { -30, 0, 0 }, { -30, 0, 0 }, { -30, 0, 0 }, { -10, 0, 0 }, { 20, 0, 0 }, { 45, 0, 0 }, { 30, 0, 0 }, { 15, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [pelvis] = { Turn = { { 0, 0, 2 }, { 0, 0, 1 }, { 0, 0, 0.5 }, { 0, 0, 0 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -0.5 }, { 0, 0, 0 } }, Move = { { 0, 1.5, 0 }, { 0, 3, 0 }, { 0, 1.5, 0 }, { 0, 1.5, 0 }, { 0, 1.5, 0 }, { 0, 3, 0 }, { 0, 1.5, 0 }, { 0, 1.5, 0 } } }, + + [torso] = { Turn = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [luparm] = { Turn = { { -5, 0, 0 }, { -2.5, 0, 0 }, { 0, 0, 0 }, { 2.5, 0, 0 }, { 5, 0, 0 }, { 2.5, 0, 0 }, { 0, 0, 0 }, { -2.5, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, + + [ruparm] = { Turn = { { 5, 0, 0 }, { 2.5, 0, 0 }, { 0, 0, 0 }, { -2.5, 0, 0 }, { -5, 0, 0 }, { -2.5, 0, 0 }, { 0, 0, 0 }, { 2.5, 0, 0 } }, Move = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } }, } PiecesToLock = { -- what pieces should be excluded from animation when moving? (and restored before aiming) @@ -47,7 +37,7 @@ for pieceNum, v in pairs(keyFramesWalk) do for step, goal in pairs(steps) do local timer = stepTimes[step] if Type == "Turn" then - for i = 1,3 do + for i = 1, 3 do goal[i] = math.rad(goal[i]) end end @@ -58,23 +48,22 @@ for pieceNum, v in pairs(keyFramesWalk) do for Type, steps in pairs(v) do for step, goal in pairs(steps) do local timer = stepTimes[step] - if keyFramesWalk[pieceNum][Type][step-1] then - for i = 1,3 do - keyFramesWalk[pieceNum][Type][step][i+3] = math.abs(goal[i] - keyFramesWalk[pieceNum][Type][step-1][i]) - end + if keyFramesWalk[pieceNum][Type][step - 1] then + for i = 1, 3 do + keyFramesWalk[pieceNum][Type][step][i + 3] = math.abs(goal[i] - keyFramesWalk[pieceNum][Type][step - 1][i]) + end elseif keyFramesWalk[pieceNum][Type][#stepTimes] then - for i = 1,3 do - keyFramesWalk[pieceNum][Type][step][i+3] = math.abs(goal[i] - keyFramesWalk[pieceNum][Type][#stepTimes][i]) + for i = 1, 3 do + keyFramesWalk[pieceNum][Type][step][i + 3] = math.abs(goal[i] - keyFramesWalk[pieceNum][Type][#stepTimes][i]) end end end end end - function walk() isInLoop = true - while (isMoving) and not (isAiming) and not (isUW) do + while isMoving and not isAiming and not isUW do local keyFrame = keyFramesWalk local timer = stepTimes[step] for pieceNum, anims in pairs(keyFrame) do @@ -98,7 +87,7 @@ end function walklegs() isInLoop = true - while (isMoving) and (isAiming) and not (isUW) do + while isMoving and isAiming and not isUW do local keyFrame = keyFramesWalk local timer = stepTimes[step] for pieceNum, anims in pairs(keyFrame) do @@ -124,36 +113,36 @@ end function swim() isInLoop = true - if (isMoving) and (isUW) then - -- swim transform anim + if isMoving and isUW then + -- swim transform anim Move(ruparm, 3, 14, 14) Move(luparm, 3, 14, 14) Move(ruparm, 2, -5, 5) Move(luparm, 2, -5, 5) - Turn(ruparm, 1, ang(175),ang(80)) - Turn(luparm, 1, ang(175),ang(80)) - Turn(rthigh, 1, ang(85), ang(100)) - Turn(lthigh, 1, ang(85), ang(100)) - Turn(rleg, 1, ang(30),ang(50)) - Turn(lleg, 1, ang(30),ang(50)) - Turn(rfoot, 1, ang(45),ang(60)) - Turn(lfoot, 1, ang(45),ang(60)) + Turn(ruparm, 1, ang(175), ang(80)) + Turn(luparm, 1, ang(175), ang(80)) + Turn(rthigh, 1, ang(85), ang(100)) + Turn(lthigh, 1, ang(85), ang(100)) + Turn(rleg, 1, ang(30), ang(50)) + Turn(lleg, 1, ang(30), ang(50)) + Turn(rfoot, 1, ang(45), ang(60)) + Turn(lfoot, 1, ang(45), ang(60)) Sleep(500) end - while (isMoving) and (isUW) do - -- swim transform anim + while isMoving and isUW do + -- swim transform anim Move(ruparm, 3, 14, 14) Move(luparm, 3, 14, 14) Move(ruparm, 2, -5, 5) Move(luparm, 2, -5, 5) - Turn(ruparm, 1, ang(180),ang(80)) - Turn(luparm, 1, ang(180),ang(80)) - Turn(rthigh, 1, ang(85), ang(100)) - Turn(lthigh, 1, ang(85), ang(100)) - Turn(rleg, 1, ang(30),ang(50)) - Turn(lleg, 1, ang(30),ang(50)) - Turn(rfoot, 1, ang(45),ang(60)) - Turn(lfoot, 1, ang(45),ang(60)) + Turn(ruparm, 1, ang(180), ang(80)) + Turn(luparm, 1, ang(180), ang(80)) + Turn(rthigh, 1, ang(85), ang(100)) + Turn(lthigh, 1, ang(85), ang(100)) + Turn(rleg, 1, ang(30), ang(50)) + Turn(lleg, 1, ang(30), ang(50)) + Turn(rfoot, 1, ang(45), ang(60)) + Turn(lfoot, 1, ang(45), ang(60)) Sleep(500) end RestoreArms() @@ -161,15 +150,14 @@ function swim() isInLoop = false end - function RestoreLegs() if isUW then - Turn(rthigh, 1, ang(85), ang(100)) + Turn(rthigh, 1, ang(85), ang(100)) Turn(lthigh, 1, ang(85), ang(100)) - Turn(rleg, 1, ang(30), ang(50)) - Turn(lleg, 1, ang(30), ang(50)) - Turn(rfoot, 1, ang(45), ang(60)) - Turn(lfoot, 1, ang(45), ang(60)) + Turn(rleg, 1, ang(30), ang(50)) + Turn(lleg, 1, ang(30), ang(50)) + Turn(rfoot, 1, ang(45), ang(60)) + Turn(lfoot, 1, ang(45), ang(60)) else for pieceNum, data in pairs(keyFramesWalk) do if not PiecesToLock[pieceNum] then @@ -191,8 +179,8 @@ function RestoreArms() Move(luparm, 3, 14, 14) Move(ruparm, 2, -5, 5) Move(luparm, 2, -5, 5) - Turn(ruparm, 1, ang(180),ang(80)) - Turn(luparm, 1, ang(180),ang(80)) + Turn(ruparm, 1, ang(180), ang(80)) + Turn(luparm, 1, ang(180), ang(80)) Move(laaturret, 2, -5.5) Move(raaturret, 2, -5.5) Turn(laacannon, 1, ang(27.5)) @@ -211,4 +199,4 @@ function RestoreArms() Turn(laacannon, 1, ang(27.5)) Turn(raacannon, 1, ang(27.5)) end -end \ No newline at end of file +end diff --git a/scripts/Units/armmar_lus/setup.lua b/scripts/Units/armmar_lus/setup.lua index cd1ebe50b52..cdc33f3648f 100644 --- a/scripts/Units/armmar_lus/setup.lua +++ b/scripts/Units/armmar_lus/setup.lua @@ -1,32 +1,29 @@ -pelvis = piece 'pelvis' - aimy1 = piece 'aimy1' - torso = piece 'torso' - aimx1 = piece 'aimx1' - luparm = piece 'luparm' - lcannon = piece 'lcannon' - lflare = piece 'lflare' - ruparm = piece 'ruparm' - rcannon = piece 'rcannon' - rflare = piece 'rflare' - laaturret = piece 'laaturret' - laacannon = piece 'laacannon' - lflareaa = piece 'lflareaa' - raaturret = piece 'raaturret' - raacannon = piece 'raacannon' - rflareaa = piece 'rflareaa' - lturbine = piece 'lturbine' - lturbfx = piece 'lturbfx' - rturbine = piece 'rturbine' - rturbfx = piece 'rturbfx' - rthigh = piece 'rthigh' - rleg = piece 'rleg' - rfoot = piece 'rfoot' - lthigh = piece 'lthigh' - lleg = piece 'lleg' - lfoot = piece 'lfoot' +pelvis = piece("pelvis") +aimy1 = piece("aimy1") +torso = piece("torso") +aimx1 = piece("aimx1") +luparm = piece("luparm") +lcannon = piece("lcannon") +lflare = piece("lflare") +ruparm = piece("ruparm") +rcannon = piece("rcannon") +rflare = piece("rflare") +laaturret = piece("laaturret") +laacannon = piece("laacannon") +lflareaa = piece("lflareaa") +raaturret = piece("raaturret") +raacannon = piece("raacannon") +rflareaa = piece("rflareaa") +lturbine = piece("lturbine") +lturbfx = piece("lturbfx") +rturbine = piece("rturbine") +rturbfx = piece("rturbfx") +rthigh = piece("rthigh") +rleg = piece("rleg") +rfoot = piece("rfoot") +lthigh = piece("lthigh") +lleg = piece("lleg") +lfoot = piece("lfoot") currentSpeed = 100 - - -function InitialPiecesSetup() -end \ No newline at end of file +function InitialPiecesSetup() end diff --git a/scripts/Units/armmar_lus/weapons.lua b/scripts/Units/armmar_lus/weapons.lua index ae2f203be60..fa0f87f0f5d 100644 --- a/scripts/Units/armmar_lus/weapons.lua +++ b/scripts/Units/armmar_lus/weapons.lua @@ -16,8 +16,7 @@ function SetWantedAim(weaponID, heading, pitch) weapons[weaponID].wtdPitch = -pitch end -function WeaponFire(weaponID) -end +function WeaponFire(weaponID) end function WeaponShot(weaponID) local ct = weapons[weaponID].counter diff --git a/scripts/Units/armmar_lus/weaponsdata.lua b/scripts/Units/armmar_lus/weaponsdata.lua index 6d0f1c4d7db..d679c641433 100644 --- a/scripts/Units/armmar_lus/weaponsdata.lua +++ b/scripts/Units/armmar_lus/weaponsdata.lua @@ -1,41 +1,47 @@ hasWpn = true -sleeptime = 3800*2 +sleeptime = 3800 * 2 --Weapon 1 - local headSpeed = math.rad(tonumber(defs.customParams["wpn"..(tostring(1)).."turrety"]))/30 - local pitchSpeed = math.rad(tonumber(defs.customParams["wpn"..(tostring(1)).."turretx"]))/30 - weapons[1] = { - curHead = 0, curPitch = 0, wtdHead = 0, wtdPitch = 0, -- Default position - wpnReady = false, -- Default state (== drawn or hidden) - headSpeed = headSpeed, -- Aimspeeds - pitchSpeed = pitchSpeed, -- Aimspeeds - aimx = {aimx1}, -- Piece for x aiming (pitch) - aimy = {aimy1}, -- Piece for y aiming (head) - canFire = false, -- Initial state: weapon not ready to fire - signal = 2^1, -- Signal value for restore threads - aimfrompiece = aimy1, - flare = {rflare, lflare}, - cannon = {rcannon, lcannon}, - counter = 1, - kickback = true, - -- subcounter = 1, - } - weapons[2] = { - curHead = 0, curPitch = 0, wtdHead = 0, wtdPitch = 0, -- Default position - wpnReady = false, -- Default state (== drawn or hidden) - headSpeed = headSpeed, -- Aimspeeds - pitchSpeed = pitchSpeed, -- Aimspeeds - aimx = {raacannon, laacannon}, -- Piece for x aiming (pitch) - aimy = {raaturret, laaturret}, -- Piece for y aiming (head) - canFire = false, -- Initial state: weapon not ready to fire - signal = 2^2, -- Signal value for restore threads - aimfrompiece = aimy1, - flare = {rflareaa, lflareaa}, - cannon = {raacannon, laacannon}, - counter = 1, - headingslavedto = 1, - kickback = false, - -- subcounter = 1, - } +local headSpeed = math.rad(tonumber(defs.customParams["wpn" .. (tostring(1)) .. "turrety"])) / 30 +local pitchSpeed = math.rad(tonumber(defs.customParams["wpn" .. (tostring(1)) .. "turretx"])) / 30 +weapons[1] = { + curHead = 0, + curPitch = 0, + wtdHead = 0, + wtdPitch = 0, -- Default position + wpnReady = false, -- Default state (== drawn or hidden) + headSpeed = headSpeed, -- Aimspeeds + pitchSpeed = pitchSpeed, -- Aimspeeds + aimx = { aimx1 }, -- Piece for x aiming (pitch) + aimy = { aimy1 }, -- Piece for y aiming (head) + canFire = false, -- Initial state: weapon not ready to fire + signal = 2 ^ 1, -- Signal value for restore threads + aimfrompiece = aimy1, + flare = { rflare, lflare }, + cannon = { rcannon, lcannon }, + counter = 1, + kickback = true, + -- subcounter = 1, +} +weapons[2] = { + curHead = 0, + curPitch = 0, + wtdHead = 0, + wtdPitch = 0, -- Default position + wpnReady = false, -- Default state (== drawn or hidden) + headSpeed = headSpeed, -- Aimspeeds + pitchSpeed = pitchSpeed, -- Aimspeeds + aimx = { raacannon, laacannon }, -- Piece for x aiming (pitch) + aimy = { raaturret, laaturret }, -- Piece for y aiming (head) + canFire = false, -- Initial state: weapon not ready to fire + signal = 2 ^ 2, -- Signal value for restore threads + aimfrompiece = aimy1, + flare = { rflareaa, lflareaa }, + cannon = { raacannon, laacannon }, + counter = 1, + headingslavedto = 1, + kickback = false, + -- subcounter = 1, +} function DrawWeapon(id) if id == 1 then @@ -47,8 +53,8 @@ function DrawWeapon(id) WaitForTurn(luparm, 1) WeaponDrawn(id) elseif id == 2 then - Move(laaturret, 2, 0,5) - Move(raaturret, 2, 0,5) + Move(laaturret, 2, 0, 5) + Move(raaturret, 2, 0, 5) Turn(laacannon, 1, ang(0), ang(27.5)) Turn(raacannon, 1, ang(0), ang(27.5)) WeaponDrawn(id) @@ -65,8 +71,7 @@ function SetWantedAim(weaponID, heading, pitch) end end -function WeaponFire(weaponID) -end +function WeaponFire(weaponID) end function WeaponShot(weaponID) weapons[weaponID].counter = weapons[weaponID].counter + 1 @@ -76,7 +81,7 @@ function WeaponShot(weaponID) if weapons[weaponID].kickback then Move(weapons[weaponID].cannon[weapons[weaponID].counter], 3, -10) Move(weapons[weaponID].cannon[weapons[weaponID].counter], 3, 0, 5) - EmitSfx(weapons[weaponID].flare[weapons[weaponID].counter], 1024+0) + EmitSfx(weapons[weaponID].flare[weapons[weaponID].counter], 1024 + 0) end end @@ -85,5 +90,5 @@ function GetAimFromPiece(weaponID) end function GetQueryPiece(weaponID) - return weapons[weaponID].flare[weapons[weaponID].counter] + return weapons[weaponID].flare[weapons[weaponID].counter] end diff --git a/scripts/Units/corageo.lua b/scripts/Units/corageo.lua index 855a12771de..87debfb0c2e 100644 --- a/scripts/Units/corageo.lua +++ b/scripts/Units/corageo.lua @@ -1,25 +1,25 @@ --pieces - local base = piece "base" - local fan1 = piece "fan1" - local fan2 = piece "fan2" - local fan3 = piece "fan3" - local rod1 = piece "rod1" - local rod2 = piece "rod2" - local rod3 = piece "rod3" - - local smokespot = piece "smokespot" - local dmgPieces = { piece "base" } +local base = piece("base") +local fan1 = piece("fan1") +local fan2 = piece("fan2") +local fan3 = piece("fan3") +local rod1 = piece("rod1") +local rod2 = piece("rod2") +local rod3 = piece("rod3") + +local smokespot = piece("smokespot") +local dmgPieces = { piece("base") } -- includes - include "dmg_smoke.lua" - include "animation.lua" +include("dmg_smoke.lua") +include("animation.lua") function script.Create() - Hide (fan2) - Hide (fan3) - Turn (fan2, y_axis, math.rad(-119), math.rad (900)) - Turn (fan3, y_axis, math.rad(119), math.rad (900)) - Sleep (10) + Hide(fan2) + Hide(fan3) + Turn(fan2, y_axis, math.rad(-119), math.rad(900)) + Turn(fan3, y_axis, math.rad(119), math.rad(900)) + Sleep(10) Show(fan2) Show(fan3) StartThread(animSmoke, unitID, smokespot) @@ -31,42 +31,39 @@ function script.Create() StartThread(rods) end - - function rods() isInLoop = true - while (true) do + while true do Move(rod1, y_axis, 5, 2) - Sleep (1000) + Sleep(1000) Move(rod2, y_axis, 5, 2) - Sleep (1000) + Sleep(1000) Move(rod3, y_axis, 5, 2) Move(rod1, y_axis, 0, 2) - Sleep (1000) + Sleep(1000) Move(rod2, y_axis, 0, 2) - Sleep (1000) + Sleep(1000) Move(rod3, y_axis, 0, 2) end end - + function script.Killed(recentDamage, maxHealth) local severity = recentDamage / maxHealth - if (severity <= .25) then - Explode(fan1,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan2,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan3,SFX.EXPLODE + SFX.NO_HEATCLOUD) + if severity <= 0.25 then + Explode(fan1, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan2, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan3, SFX.EXPLODE + SFX.NO_HEATCLOUD) return 1 -- corpsetype - - elseif (severity <= .5) then - Explode(fan1,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan2,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan3,SFX.EXPLODE + SFX.NO_HEATCLOUD) + elseif severity <= 0.5 then + Explode(fan1, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan2, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan3, SFX.EXPLODE + SFX.NO_HEATCLOUD) return 2 -- corpsetype else - Explode(fan1,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan2,SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(fan3,SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan1, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan2, SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(fan3, SFX.EXPLODE + SFX.NO_HEATCLOUD) return 3 -- corpsetype end -end \ No newline at end of file +end diff --git a/scripts/Units/coralab.lua b/scripts/Units/coralab.lua index 88b511edf55..284072c28ad 100644 --- a/scripts/Units/coralab.lua +++ b/scripts/Units/coralab.lua @@ -1,229 +1,226 @@ -local base, pad, head1, head2, nano1, nano2, nano3, nano4, center1, center2, side1, side2, mount1, mount2, cagelight, cagelight_emit, cagelight2, cagelight_emit2 = piece("base", "pad", "head1", "head2", "nano1", "nano2", "nano3", "nano4", "center1", "center2", "side1", "side2", "mount1", "mount2", "cagelight", "cagelight_emit", "cagelight2", "cagelight_emit2"); +local base, pad, head1, head2, nano1, nano2, nano3, nano4, center1, center2, side1, side2, mount1, mount2, cagelight, cagelight_emit, cagelight2, cagelight_emit2 = piece("base", "pad", "head1", "head2", "nano1", "nano2", "nano3", "nano4", "center1", "center2", "side1", "side2", "mount1", "mount2", "cagelight", "cagelight_emit", "cagelight2", "cagelight_emit2") -local spray = 0; +local spray = 0 -local SIG_ACTIVATE = 2; -local SIG_OPENCLOSE = 4; -local SIG_BUILD = 8; +local SIG_ACTIVATE = 2 +local SIG_OPENCLOSE = 4 +local SIG_BUILD = 8 -include("include/util.lua"); +include("include/util.lua") local litelab = UnitDefs[unitDefID].customParams.litelab ~= nil function open() - UnitScript.Signal(SIG_OPENCLOSE); - UnitScript.SetSignalMask(SIG_OPENCLOSE); + UnitScript.Signal(SIG_OPENCLOSE) + UnitScript.SetSignalMask(SIG_OPENCLOSE) --Activate --UnitScript.Move(side1, z_axis, 0); if not litelab then - UnitScript.Move(side1, z_axis, 24, 24); - Sleep(908); - UnitScript.Move(side2, z_axis, 10, 2.777771); - Sleep(828); + UnitScript.Move(side1, z_axis, 24, 24) + Sleep(908) + UnitScript.Move(side2, z_axis, 10, 2.777771) + Sleep(828) --Open yard end - open_yard(); + open_yard() --Get into buildstance - UnitScript.SetUnitValue(COB.INBUILDSTANCE, 1); + UnitScript.SetUnitValue(COB.INBUILDSTANCE, 1) end function close() - UnitScript.Signal(SIG_OPENCLOSE); - UnitScript.SetSignalMask(SIG_OPENCLOSE); + UnitScript.Signal(SIG_OPENCLOSE) + UnitScript.SetSignalMask(SIG_OPENCLOSE) --Get out of buildstance - UnitScript.SetUnitValue(COB.INBUILDSTANCE, 0); + UnitScript.SetUnitValue(COB.INBUILDSTANCE, 0) --Close yard - close_yard(); + close_yard() --Deactivate if not litelab then - UnitScript.Move(side1, z_axis, 0, 24); - Sleep(908); - UnitScript.Move(side2, z_axis, 0, 2.777771); - Sleep(828); + UnitScript.Move(side1, z_axis, 0, 24) + Sleep(908) + UnitScript.Move(side2, z_axis, 0, 2.777771) + Sleep(828) end end function script.Create() if litelab then - UnitScript.Move(side1, z_axis, 24, 1000); - UnitScript.Move(side2, z_axis, 10, 1000); + UnitScript.Move(side1, z_axis, 24, 1000) + UnitScript.Move(side2, z_axis, 10, 1000) end - Hide(nano1); - Hide(nano2); - Hide(nano3); - Hide(nano4); - Hide(cagelight_emit); - Hide(cagelight_emit2); - spray = 0; - UnitScript.StartThread(smoke_unit, base); + Hide(nano1) + Hide(nano2) + Hide(nano3) + Hide(nano4) + Hide(cagelight_emit) + Hide(cagelight_emit2) + spray = 0 + UnitScript.StartThread(smoke_unit, base) end function script.QueryNanoPiece() - local piecenum; - if (spray == 0) then - piecenum = nano1; + local piecenum + if spray == 0 then + piecenum = nano1 end - if (spray == 1) then - piecenum = nano2; + if spray == 1 then + piecenum = nano2 end - if (spray == 2) then - piecenum = nano3; + if spray == 2 then + piecenum = nano3 end - if (spray == 3) then - piecenum = nano4; + if spray == 3 then + piecenum = nano4 end - spray = spray + 1; - if(spray == 4) then - spray = 0; + spray = spray + 1 + if spray == 4 then + spray = 0 end - return piecenum; + return piecenum end function Activate_real() - UnitScript.Signal(SIG_ACTIVATE); - UnitScript.StartThread(open); + UnitScript.Signal(SIG_ACTIVATE) + UnitScript.StartThread(open) end function script.Activate() - UnitScript.StartThread(Activate_real); + UnitScript.StartThread(Activate_real) end function Deactivate_real() - UnitScript.Signal(SIG_ACTIVATE); - UnitScript.SetSignalMask(SIG_ACTIVATE); - Sleep(5000); - UnitScript.StartThread(close); + UnitScript.Signal(SIG_ACTIVATE) + UnitScript.SetSignalMask(SIG_ACTIVATE) + Sleep(5000) + UnitScript.StartThread(close) end function script.Deactivate() - UnitScript.StartThread(Deactivate_real); + UnitScript.StartThread(Deactivate_real) end function Build() - UnitScript.SetSignalMask(SIG_BUILD); + UnitScript.SetSignalMask(SIG_BUILD) while true do if math.random() > 0.5 then - local t = math.random(0,48); - UnitScript.Move(mount1, z_axis, t, 24); - UnitScript.Turn(head1 , y_axis, math.rad(-1.6 * t), math.rad(36) ); + local t = math.random(0, 48) + UnitScript.Move(mount1, z_axis, t, 24) + UnitScript.Turn(head1, y_axis, math.rad(-1.6 * t), math.rad(36)) UnitScript.WaitForMove(mount1, z_axis) else - local t = math.random(0,48); - UnitScript.Move(mount2, z_axis, t, 24); - UnitScript.Turn(head2 , y_axis, math.rad(1.6 * t), math.rad(36) ); + local t = math.random(0, 48) + UnitScript.Move(mount2, z_axis, t, 24) + UnitScript.Turn(head2, y_axis, math.rad(1.6 * t), math.rad(36)) UnitScript.WaitForMove(mount2, z_axis) end - end end function script.StartBuilding() - Show(nano1); - Show(nano2); - Show(nano3); - Show(nano4); - Show(cagelight_emit); - Show(cagelight_emit2); - Spin(cagelight_emit, y_axis,4); - Spin(cagelight_emit2, y_axis,4); - UnitScript.Signal(SIG_BUILD); + Show(nano1) + Show(nano2) + Show(nano3) + Show(nano4) + Show(cagelight_emit) + Show(cagelight_emit2) + Spin(cagelight_emit, y_axis, 4) + Spin(cagelight_emit2, y_axis, 4) + UnitScript.Signal(SIG_BUILD) UnitScript.StartThread(Build) end - - function script.StopBuilding() - Hide(nano1); - Hide(nano2); - Hide(nano3); - Hide(nano4); - UnitScript.Signal(SIG_BUILD); - Hide(cagelight_emit); - Hide(cagelight_emit2); - Turn(cagelight_emit, y_axis,0,15); - Turn(cagelight_emit2, y_axis,0,15); - - UnitScript.Move(mount1, z_axis, 0, 24); - UnitScript.Turn(head1 , y_axis, 0, math.rad(36) ); - UnitScript.Move(mount2, z_axis, 0, 24); - UnitScript.Turn(head2 , y_axis, 0, math.rad(36) ); - - UnitScript.Move(center1, z_axis, 0); - UnitScript.Move(center1, z_axis, 10, 20); - UnitScript.Move(center2, z_axis, 0); - UnitScript.WaitForMove(center1, z_axis); - - UnitScript.Move(center2, z_axis, 10, 20); - UnitScript.Move(center1, z_axis, 0, 20); - UnitScript.WaitForMove(center2, z_axis); - UnitScript.Move(center2, z_axis, 0, 20); - UnitScript.WaitForMove(center2, z_axis); + Hide(nano1) + Hide(nano2) + Hide(nano3) + Hide(nano4) + UnitScript.Signal(SIG_BUILD) + Hide(cagelight_emit) + Hide(cagelight_emit2) + Turn(cagelight_emit, y_axis, 0, 15) + Turn(cagelight_emit2, y_axis, 0, 15) + + UnitScript.Move(mount1, z_axis, 0, 24) + UnitScript.Turn(head1, y_axis, 0, math.rad(36)) + UnitScript.Move(mount2, z_axis, 0, 24) + UnitScript.Turn(head2, y_axis, 0, math.rad(36)) + + UnitScript.Move(center1, z_axis, 0) + UnitScript.Move(center1, z_axis, 10, 20) + UnitScript.Move(center2, z_axis, 0) + UnitScript.WaitForMove(center1, z_axis) + + UnitScript.Move(center2, z_axis, 10, 20) + UnitScript.Move(center1, z_axis, 0, 20) + UnitScript.WaitForMove(center2, z_axis) + UnitScript.Move(center2, z_axis, 0, 20) + UnitScript.WaitForMove(center2, z_axis) end function script.QueryBuildInfo() - return pad; + return pad end function script.Killed(recentDamage, maxHealth) - local severity = (recentDamage / maxHealth) * 100; - local corpsetype; - - if (severity <= 25) then - corpsetype = 1; - UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head1, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head2, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side1, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side2, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano3, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano4, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center1, SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center2, SFX.NONE + SFX.NO_HEATCLOUD); - return corpsetype; + local severity = (recentDamage / maxHealth) * 100 + local corpsetype + + if severity <= 25 then + corpsetype = 1 + UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano3, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano4, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center2, SFX.NONE + SFX.NO_HEATCLOUD) + return corpsetype end - if (severity <= 50) then - corpsetype = 2; - UnitScript.Explode(base, SFX.NONE); - UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - return corpsetype; + if severity <= 50 then + corpsetype = 2 + UnitScript.Explode(base, SFX.NONE) + UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + return corpsetype end - if (severity <= 99) then - corpsetype = 3; - UnitScript.Explode(base, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - return corpsetype; + if severity <= 99 then + corpsetype = 3 + UnitScript.Explode(base, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + return corpsetype end - corpsetype = 3; - UnitScript.Explode(base, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE+ SFX.EXPLODE + SFX.NO_HEATCLOUD); - return corpsetype; + corpsetype = 3 + UnitScript.Explode(base, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(head2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(side2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + UnitScript.Explode(center2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + return corpsetype end diff --git a/scripts/Units/corcom_lus.lua b/scripts/Units/corcom_lus.lua index a84e7e460dd..f4471670b1f 100644 --- a/scripts/Units/corcom_lus.lua +++ b/scripts/Units/corcom_lus.lua @@ -1,8 +1,5 @@ - --Skeleton pieces -local torso, lfirept, rbigflash, nanospray, nanolathe, luparm, ruparm, pelvis, rthigh, lthigh, biggun, lleg, l_foot, rleg, r_foot, head, teleport, aimx1, aimy1,hatpoint, crown, medalsilver, medalbronze, medalgold = piece("torso", "lfirept", "rbigflash", "nanospray", "nanolathe", "luparm", "ruparm", "pelvis", "rthigh", "lthigh", "biggun", "lleg", "l_foot", "rleg", "r_foot", "head", "teleport", "aimx1", "aimy1","hatpoint", "crown", "medalsilver", "medalbronze", "medalgold") - - +local torso, lfirept, rbigflash, nanospray, nanolathe, luparm, ruparm, pelvis, rthigh, lthigh, biggun, lleg, l_foot, rleg, r_foot, head, teleport, aimx1, aimy1, hatpoint, crown, medalsilver, medalbronze, medalgold = piece("torso", "lfirept", "rbigflash", "nanospray", "nanolathe", "luparm", "ruparm", "pelvis", "rthigh", "lthigh", "biggun", "lleg", "l_foot", "rleg", "r_foot", "head", "teleport", "aimx1", "aimy1", "hatpoint", "crown", "medalsilver", "medalbronze", "medalgold") local weapons = { [1] = "laser", @@ -37,18 +34,16 @@ local weapons = { [30] = "dgun", [31] = "dgun", [32] = "dgun", - } - - +} local SIG_AIM = 2 local SIG_WALK = 4 local function BelowWater(piecename) - local _,y,_ = Spring.GetUnitPiecePosition(unitID, piecename) - -- this returns unit space, so why does it work for corcom? - local _, py, _ = Spring.GetUnitPosition(unitID) - if (y+ py) <= 0 then + local _, y, _ = Spring.GetUnitPiecePosition(unitID, piecename) + -- this returns unit space, so why does it work for corcom? + local _, py, _ = Spring.GetUnitPosition(unitID) + if (y + py) <= 0 then return true else return false @@ -75,47 +70,69 @@ end function walk() SetSignalMask(SIG_WALK) - if (bMoving) then --Frame:6 - if (rightArm) then turn(biggun, 1, 7.000000, 474.333919 / animSpeed) end - if (rightArm) then turn(biggun, 3, -0.000000, 59.118463 / animSpeed) end - if (rightArm) then turn(biggun, 2, 0.000000, 4.555160 / animSpeed) end - turn(head, 1, -0.927302, 27.819048 / animSpeed) - turn(head, 2, 9.458549, 283.756478 / animSpeed) - turn(l_foot, 1, -10.561878, 244.413750 / animSpeed) - turn(l_foot, 3, 3.674625, 126.014557 / animSpeed) - turn(l_foot, 2, 0.417197, 19.723897 / animSpeed) - turn(lleg, 1, -21.193560, 635.806788 / animSpeed) - turn(lleg, 3, -5.208681, 156.260440 / animSpeed) - turn(lleg, 2, -2.267315, 68.019463 / animSpeed) - turn(lthigh, 1, 32.834741, 985.042232 / animSpeed) - turn(lthigh, 3, 2.299529, 68.985869 / animSpeed) - turn(lthigh, 2, -9.494972, 729.974777 / animSpeed) - if (leftArm) then turn(luparm, 1, -8.891101, 475.860825 / animSpeed) end - if (leftArm) then turn(luparm, 2, -9.391724, 738.230529 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, -7.000000, 413.857033 / animSpeed) end - if (leftArm) then turn(nanolathe, 3, -0.000000, 55.718905 / animSpeed) end - if (leftArm) then turn(nanolathe, 2, 0.000000, 3.308265 / animSpeed) end - move(pelvis, 2, 0.000000, 9.036713 / animSpeed) - turn(pelvis, 1, 0.500000, 15.000000 / animSpeed) - turn(pelvis, 2, 10.000000, 299.999991 / animSpeed) - turn(r_foot, 1, -13.659087, 362.223883 / animSpeed) - turn(r_foot, 3, -1.655717, 49.672541 / animSpeed) - turn(r_foot, 2, -10.105174, 303.223681 / animSpeed) - turn(rleg, 1, 53.029196, 1590.875879 / animSpeed) - turn(rleg, 3, -16.484759, 494.542767 / animSpeed) - turn(rleg, 2, 6.317234, 189.517028 / animSpeed) - turn(rthigh, 1, -61.264912, 1837.947352 / animSpeed) - turn(rthigh, 3, 14.864373, 445.931201 / animSpeed) - turn(rthigh, 2, 3.324302, 867.983501 / animSpeed) - if (rightArm) then turn(ruparm, 1, 27.254234, 557.381267 / animSpeed) end - if (rightArm) then turn(ruparm, 2, -7.659001, 145.469864 / animSpeed) end - turn(torso, 1, 0.527975, 15.839238 / animSpeed) - turn(torso, 2, -16.999999, 509.999980 / animSpeed) - Sleep(197) + if bMoving then --Frame:6 + if rightArm then + turn(biggun, 1, 7.000000, 474.333919 / animSpeed) + end + if rightArm then + turn(biggun, 3, -0.000000, 59.118463 / animSpeed) + end + if rightArm then + turn(biggun, 2, 0.000000, 4.555160 / animSpeed) + end + turn(head, 1, -0.927302, 27.819048 / animSpeed) + turn(head, 2, 9.458549, 283.756478 / animSpeed) + turn(l_foot, 1, -10.561878, 244.413750 / animSpeed) + turn(l_foot, 3, 3.674625, 126.014557 / animSpeed) + turn(l_foot, 2, 0.417197, 19.723897 / animSpeed) + turn(lleg, 1, -21.193560, 635.806788 / animSpeed) + turn(lleg, 3, -5.208681, 156.260440 / animSpeed) + turn(lleg, 2, -2.267315, 68.019463 / animSpeed) + turn(lthigh, 1, 32.834741, 985.042232 / animSpeed) + turn(lthigh, 3, 2.299529, 68.985869 / animSpeed) + turn(lthigh, 2, -9.494972, 729.974777 / animSpeed) + if leftArm then + turn(luparm, 1, -8.891101, 475.860825 / animSpeed) + end + if leftArm then + turn(luparm, 2, -9.391724, 738.230529 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, -7.000000, 413.857033 / animSpeed) end - while (bMoving) do - if (bMoving) then --Frame:12 - if (rightArm) then turn(biggun, 1, -0.000000, 210.000014 / animSpeed) end + if leftArm then + turn(nanolathe, 3, -0.000000, 55.718905 / animSpeed) + end + if leftArm then + turn(nanolathe, 2, 0.000000, 3.308265 / animSpeed) + end + move(pelvis, 2, 0.000000, 9.036713 / animSpeed) + turn(pelvis, 1, 0.500000, 15.000000 / animSpeed) + turn(pelvis, 2, 10.000000, 299.999991 / animSpeed) + turn(r_foot, 1, -13.659087, 362.223883 / animSpeed) + turn(r_foot, 3, -1.655717, 49.672541 / animSpeed) + turn(r_foot, 2, -10.105174, 303.223681 / animSpeed) + turn(rleg, 1, 53.029196, 1590.875879 / animSpeed) + turn(rleg, 3, -16.484759, 494.542767 / animSpeed) + turn(rleg, 2, 6.317234, 189.517028 / animSpeed) + turn(rthigh, 1, -61.264912, 1837.947352 / animSpeed) + turn(rthigh, 3, 14.864373, 445.931201 / animSpeed) + turn(rthigh, 2, 3.324302, 867.983501 / animSpeed) + if rightArm then + turn(ruparm, 1, 27.254234, 557.381267 / animSpeed) + end + if rightArm then + turn(ruparm, 2, -7.659001, 145.469864 / animSpeed) + end + turn(torso, 1, 0.527975, 15.839238 / animSpeed) + turn(torso, 2, -16.999999, 509.999980 / animSpeed) + Sleep(197) + end + while bMoving do + if bMoving then --Frame:12 + if rightArm then + turn(biggun, 1, -0.000000, 210.000014 / animSpeed) + end turn(head, 1, -2.018726, 32.742739 / animSpeed) turn(head, 2, 6.502752, 88.673904 / animSpeed) turn(l_foot, 3, 0.690912, 89.511375 / animSpeed) @@ -126,9 +143,15 @@ function walk() turn(lthigh, 1, 15.193594, 529.234425 / animSpeed) turn(lthigh, 3, -3.177570, 164.312977 / animSpeed) turn(lthigh, 2, -6.287450, 96.225652 / animSpeed) - if (leftArm) then turn(luparm, 1, -15.000002, 183.267021 / animSpeed) end - if (leftArm) then turn(luparm, 2, -7.060122, 69.948061 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, -4.812500, 65.625000 / animSpeed) end + if leftArm then + turn(luparm, 1, -15.000002, 183.267021 / animSpeed) + end + if leftArm then + turn(luparm, 2, -7.060122, 69.948061 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, -4.812500, 65.625000 / animSpeed) + end move(pelvis, 1, 1.424151, 42.600518 / animSpeed) move(pelvis, 2, -1.300000, 38.999999 / animSpeed) turn(pelvis, 1, 3.000000, 75.000003 / animSpeed) @@ -142,15 +165,18 @@ function walk() turn(rthigh, 1, -38.695983, 677.067876 / animSpeed) turn(rthigh, 3, -7.830160, 680.835989 / animSpeed) turn(rthigh, 2, -7.258941, 317.497309 / animSpeed) - if (rightArm) then turn(ruparm, 1, 17.856785, 281.923469 / animSpeed) end + if rightArm then + turn(ruparm, 1, 17.856785, 281.923469 / animSpeed) + end turn(torso, 1, 0.011484, 15.494713 / animSpeed) turn(torso, 3, -2.604197, 78.125917 / animSpeed) turn(torso, 2, -11.687500, 159.374994 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:18 - - if (rightArm) then turn(biggun, 1, 14.962093, 448.862786 / animSpeed) end + if bMoving then --Frame:18 + if rightArm then + turn(biggun, 1, 14.962093, 448.862786 / animSpeed) + end turn(head, 1, 6.002970, 240.650875 / animSpeed) turn(head, 2, -0.000000, 195.082586 / animSpeed) turn(l_foot, 1, -13.296228, 81.595514 / animSpeed) @@ -161,9 +187,15 @@ function walk() turn(lthigh, 1, -4.003060, 575.899605 / animSpeed) turn(lthigh, 3, -3.570822, 11.797560 / animSpeed) turn(lthigh, 2, -3.398772, 86.660360 / animSpeed) - if (leftArm) then turn(luparm, 1, -5.933402, 271.998004 / animSpeed) end - if (leftArm) then turn(luparm, 2, -5.390060, 50.101832 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, 0.000000, 144.375003 / animSpeed) end + if leftArm then + turn(luparm, 1, -5.933402, 271.998004 / animSpeed) + end + if leftArm then + turn(luparm, 2, -5.390060, 50.101832 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, 0.000000, 144.375003 / animSpeed) + end move(pelvis, 1, 0.676773, 22.421322 / animSpeed) move(pelvis, 3, 0.677474, 20.324208 / animSpeed) move(pelvis, 2, -2.000000, 21.000001 / animSpeed) @@ -178,18 +210,24 @@ function walk() turn(rthigh, 1, -36.737764, 58.746560 / animSpeed) turn(rthigh, 3, 2.700298, 315.913722 / animSpeed) turn(rthigh, 2, -1.187645, 182.138894 / animSpeed) - if (rightArm) then turn(ruparm, 1, 24.848809, 209.760710 / animSpeed) end - if (rightArm) then turn(ruparm, 2, -5.247890, 72.333343 / animSpeed) end + if rightArm then + turn(ruparm, 1, 24.848809, 209.760710 / animSpeed) + end + if rightArm then + turn(ruparm, 2, -5.247890, 72.333343 / animSpeed) + end turn(torso, 1, 7.182205, 215.121631 / animSpeed) turn(torso, 3, -1.177850, 42.790427 / animSpeed) turn(torso, 2, 0.000001, 350.625002 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:24 + if bMoving then --Frame:24 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(r_foot, 1024 + 2) end - if (rightArm) then turn(biggun, 1, -1.500000, 493.862787 / animSpeed) end + if rightArm then + turn(biggun, 1, -1.500000, 493.862787 / animSpeed) + end turn(head, 1, 1.940259, 121.881321 / animSpeed) turn(head, 2, -6.502753, 195.082587 / animSpeed) turn(l_foot, 1, -3.417831, 296.351915 / animSpeed) @@ -201,9 +239,15 @@ function walk() turn(lthigh, 1, -52.264461, 1447.842024 / animSpeed) turn(lthigh, 3, -8.297404, 141.797461 / animSpeed) turn(lthigh, 2, -4.035460, 19.100654 / animSpeed) - if (leftArm) then turn(luparm, 1, 17.338307, 698.151274 / animSpeed) end - if (leftArm) then turn(luparm, 2, 2.367461, 232.725648 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, 4.812500, 144.375000 / animSpeed) end + if leftArm then + turn(luparm, 1, 17.338307, 698.151274 / animSpeed) + end + if leftArm then + turn(luparm, 2, 2.367461, 232.725648 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, 4.812500, 144.375000 / animSpeed) + end move(pelvis, 1, 0.378759, 8.940423 / animSpeed) move(pelvis, 3, 0.000000, 20.324208 / animSpeed) move(pelvis, 2, -0.700000, 39.000000 / animSpeed) @@ -218,15 +262,21 @@ function walk() turn(rthigh, 1, -11.751762, 749.580050 / animSpeed) turn(rthigh, 3, 1.829745, 26.116573 / animSpeed) turn(rthigh, 2, 7.757604, 268.357477 / animSpeed) - if (rightArm) then turn(ruparm, 1, 2.805339, 661.304091 / animSpeed) end - if (rightArm) then turn(ruparm, 2, 6.888889, 364.103349 / animSpeed) end + if rightArm then + turn(ruparm, 1, 2.805339, 661.304091 / animSpeed) + end + if rightArm then + turn(ruparm, 2, 6.888889, 364.103349 / animSpeed) + end turn(torso, 1, 2.661677, 135.615854 / animSpeed) turn(torso, 3, -0.344737, 24.993395 / animSpeed) turn(torso, 2, 11.687500, 350.624996 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:30 - if (rightArm) then turn(biggun, 1, -7.000000, 165.000000 / animSpeed) end + if bMoving then --Frame:30 + if rightArm then + turn(biggun, 1, -7.000000, 165.000000 / animSpeed) + end turn(head, 1, -1.322678, 97.888103 / animSpeed) turn(head, 2, -9.458549, 88.673879 / animSpeed) turn(l_foot, 1, -1.066570, 70.537812 / animSpeed) @@ -237,9 +287,15 @@ function walk() turn(lthigh, 1, -67.429260, 454.943977 / animSpeed) turn(lthigh, 3, -11.475603, 95.345966 / animSpeed) turn(lthigh, 2, -5.140474, 33.150409 / animSpeed) - if (leftArm) then turn(luparm, 1, 27.578395, 307.202631 / animSpeed) end - if (leftArm) then turn(luparm, 2, 4.673861, 69.191991 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, 9.511417, 140.967523 / animSpeed) end + if leftArm then + turn(luparm, 1, 27.578395, 307.202631 / animSpeed) + end + if leftArm then + turn(luparm, 2, 4.673861, 69.191991 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, 9.511417, 140.967523 / animSpeed) + end move(pelvis, 1, 0.004134, 11.238773 / animSpeed) move(pelvis, 2, 0.000000, 21.000000 / animSpeed) turn(pelvis, 1, 0.500000, 45.000000 / animSpeed) @@ -253,15 +309,21 @@ function walk() turn(rthigh, 1, 31.823764, 1307.265781 / animSpeed) turn(rthigh, 3, -3.081961, 147.351186 / animSpeed) turn(rthigh, 2, 9.309497, 46.556798 / animSpeed) - if (rightArm) then turn(ruparm, 1, -13.287716, 482.791638 / animSpeed) end - if (rightArm) then turn(ruparm, 2, 9.299999, 72.333317 / animSpeed) end + if rightArm then + turn(ruparm, 1, -13.287716, 482.791638 / animSpeed) + end + if rightArm then + turn(ruparm, 2, 9.299999, 72.333317 / animSpeed) + end turn(torso, 1, 0.614511, 61.414985 / animSpeed) turn(torso, 3, -0.000000, 10.342095 / animSpeed) turn(torso, 2, 16.999999, 159.374968 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:36 - if (rightArm) then turn(biggun, 1, -4.812500, 65.625000 / animSpeed) end + if bMoving then --Frame:36 + if rightArm then + turn(biggun, 1, -4.812500, 65.625000 / animSpeed) + end turn(head, 1, -2.018726, 20.881451 / animSpeed) turn(head, 2, -6.502752, 88.673904 / animSpeed) turn(l_foot, 1, 2.869804, 118.091213 / animSpeed) @@ -273,9 +335,15 @@ function walk() turn(lthigh, 1, -37.186538, 907.281656 / animSpeed) turn(lthigh, 3, 10.356607, 654.966314 / animSpeed) turn(lthigh, 2, 10.497377, 469.135539 / animSpeed) - if (leftArm) then turn(luparm, 1, 16.214065, 340.929900 / animSpeed) end - if (leftArm) then turn(luparm, 2, 5.641061, 29.016001 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, 7.246843, 67.937245 / animSpeed) end + if leftArm then + turn(luparm, 1, 16.214065, 340.929900 / animSpeed) + end + if leftArm then + turn(luparm, 2, 5.641061, 29.016001 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, 7.246843, 67.937245 / animSpeed) + end move(pelvis, 1, -1.440796, 43.347901 / animSpeed) move(pelvis, 2, -1.300000, 38.999999 / animSpeed) turn(pelvis, 1, 3.000000, 75.000003 / animSpeed) @@ -289,15 +357,21 @@ function walk() turn(rthigh, 1, 15.440428, 491.500071 / animSpeed) turn(rthigh, 3, 5.573259, 259.656606 / animSpeed) turn(rthigh, 2, 5.974292, 100.056158 / animSpeed) - if (rightArm) then turn(ruparm, 1, -15.000002, 51.368598 / animSpeed) end - if (rightArm) then turn(ruparm, 2, 8.332799, 29.016001 / animSpeed) end + if rightArm then + turn(ruparm, 1, -15.000002, 51.368598 / animSpeed) + end + if rightArm then + turn(ruparm, 2, 8.332799, 29.016001 / animSpeed) + end turn(torso, 1, -0.000000, 18.435316 / animSpeed) turn(torso, 3, 2.154603, 64.638097 / animSpeed) turn(torso, 2, 11.687500, 159.374994 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:42 - if (rightArm) then turn(biggun, 1, 0.000000, 144.375003 / animSpeed) end + if bMoving then --Frame:42 + if rightArm then + turn(biggun, 1, 0.000000, 144.375003 / animSpeed) + end turn(head, 1, 5.974242, 239.789054 / animSpeed) turn(head, 2, 0.000000, 195.082586 / animSpeed) turn(l_foot, 1, 18.425190, 466.661591 / animSpeed) @@ -309,9 +383,15 @@ function walk() turn(lthigh, 1, -37.840279, 19.612239 / animSpeed) turn(lthigh, 3, 2.732531, 228.722291 / animSpeed) turn(lthigh, 2, 1.933653, 256.911741 / animSpeed) - if (leftArm) then turn(luparm, 1, 21.500320, 158.587669 / animSpeed) end - if (leftArm) then turn(luparm, 2, 3.229950, 72.333330 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, 15.006779, 232.798102 / animSpeed) end + if leftArm then + turn(luparm, 1, 21.500320, 158.587669 / animSpeed) + end + if leftArm then + turn(luparm, 2, 3.229950, 72.333330 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, 15.006779, 232.798102 / animSpeed) + end move(pelvis, 1, -0.668506, 23.168705 / animSpeed) move(pelvis, 3, 0.587918, 17.637532 / animSpeed) move(pelvis, 2, -2.000000, 21.000001 / animSpeed) @@ -325,18 +405,24 @@ function walk() turn(rthigh, 1, -3.921700, 580.863829 / animSpeed) turn(rthigh, 3, 7.907695, 70.033071 / animSpeed) turn(rthigh, 2, 3.933801, 61.214738 / animSpeed) - if (rightArm) then turn(ruparm, 1, -10.312501, 140.625023 / animSpeed) end - if (rightArm) then turn(ruparm, 2, 6.026399, 69.191998 / animSpeed) end + if rightArm then + turn(ruparm, 1, -10.312501, 140.625023 / animSpeed) + end + if rightArm then + turn(ruparm, 2, 6.026399, 69.191998 / animSpeed) + end turn(torso, 1, 7.296131, 218.883930 / animSpeed) turn(torso, 3, 0.804385, 40.506543 / animSpeed) turn(torso, 2, -0.000001, 350.625002 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:48 + if bMoving then --Frame:48 if not Spring.GetUnitIsCloaked(unitID) then UnitScript.EmitSfx(l_foot, 1024 + 2) end - if (rightArm) then turn(biggun, 1, 4.812500, 144.375000 / animSpeed) end + if rightArm then + turn(biggun, 1, 4.812500, 144.375000 / animSpeed) + end turn(head, 1, 1.854076, 123.605001 / animSpeed) turn(head, 2, 6.502753, 195.082587 / animSpeed) turn(l_foot, 1, -4.058518, 674.511255 / animSpeed) @@ -348,9 +434,15 @@ function walk() turn(lthigh, 1, -11.734723, 783.166677 / animSpeed) turn(lthigh, 3, -1.010202, 112.281987 / animSpeed) turn(lthigh, 2, -7.724249, 289.737054 / animSpeed) - if (leftArm) then turn(luparm, 1, 10.662637, 325.130494 / animSpeed) end - if (leftArm) then turn(luparm, 2, -6.888889, 303.565158 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, -1.500000, 495.203383 / animSpeed) end + if leftArm then + turn(luparm, 1, 10.662637, 325.130494 / animSpeed) + end + if leftArm then + turn(luparm, 2, -6.888889, 303.565158 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, -1.500000, 495.203383 / animSpeed) + end move(pelvis, 1, -0.247683, 12.624712 / animSpeed) move(pelvis, 3, 0.000000, 17.637532 / animSpeed) move(pelvis, 2, -0.700000, 39.000000 / animSpeed) @@ -365,15 +457,21 @@ function walk() turn(rthigh, 1, -52.243014, 1449.639431 / animSpeed) turn(rthigh, 3, 9.159658, 37.558877 / animSpeed) turn(rthigh, 2, 2.585700, 40.443027 / animSpeed) - if (rightArm) then turn(ruparm, 1, 5.305341, 468.535280 / animSpeed) end - if (rightArm) then turn(ruparm, 2, 3.273600, 82.583992 / animSpeed) end + if rightArm then + turn(ruparm, 1, 5.305341, 468.535280 / animSpeed) + end + if rightArm then + turn(ruparm, 2, 3.273600, 82.583992 / animSpeed) + end turn(torso, 1, 2.755654, 136.214300 / animSpeed) turn(torso, 3, 0.258552, 16.374982 / animSpeed) turn(torso, 2, -11.687500, 350.624996 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end - if (bMoving) then --Frame:54 - if (rightArm) then turn(biggun, 1, 7.000000, 65.625012 / animSpeed) end + if bMoving then --Frame:54 + if rightArm then + turn(biggun, 1, 7.000000, 65.625012 / animSpeed) + end turn(head, 1, -0.920485, 83.236809 / animSpeed) turn(head, 2, 9.458549, 88.673879 / animSpeed) turn(l_foot, 1, -10.560809, 195.068730 / animSpeed) @@ -385,9 +483,15 @@ function walk() turn(lthigh, 1, 32.776360, 1335.332505 / animSpeed) turn(lthigh, 3, 2.172518, 95.481604 / animSpeed) turn(lthigh, 2, -9.099435, 41.255581 / animSpeed) - if (leftArm) then turn(luparm, 1, -8.891101, 586.612163 / animSpeed) end - if (leftArm) then turn(luparm, 2, -9.299999, 72.333317 / animSpeed) end - if (leftArm) then turn(nanolathe, 1, -7.000000, 165.000000 / animSpeed) end + if leftArm then + turn(luparm, 1, -8.891101, 586.612163 / animSpeed) + end + if leftArm then + turn(luparm, 2, -9.299999, 72.333317 / animSpeed) + end + if leftArm then + turn(nanolathe, 1, -7.000000, 165.000000 / animSpeed) + end move(pelvis, 1, 0.004134, 7.554485 / animSpeed) move(pelvis, 2, 0.000000, 21.000000 / animSpeed) turn(pelvis, 1, 0.500000, 45.000000 / animSpeed) @@ -401,12 +505,16 @@ function walk() turn(rthigh, 1, -61.264912, 270.656935 / animSpeed) turn(rthigh, 3, 14.864373, 171.141472 / animSpeed) turn(rthigh, 2, 3.324302, 22.158064 / animSpeed) - if (rightArm) then turn(ruparm, 1, 27.254234, 658.466782 / animSpeed) end - if (rightArm) then turn(ruparm, 2, -7.659001, 327.978017 / animSpeed) end + if rightArm then + turn(ruparm, 1, 27.254234, 658.466782 / animSpeed) + end + if rightArm then + turn(ruparm, 2, -7.659001, 327.978017 / animSpeed) + end turn(torso, 1, 0.527975, 66.830393 / animSpeed) turn(torso, 3, -0.000000, 7.756572 / animSpeed) turn(torso, 2, -16.999999, 159.374968 / animSpeed) - Sleep((33*animSpeed) -1) + Sleep((33 * animSpeed) - 1) end end end @@ -414,7 +522,7 @@ end function SprayNano(heading, pitch) SetSignalMask(SIG_AIM) Sleep(1000) - while (true) do + while true do Sleep(1000) end end @@ -423,9 +531,15 @@ function StopWalking() move(pelvis, 1, 0.000000, 7.224650) move(pelvis, 2, -0.301224, 6.500000) move(pelvis, 3, 0.000000, 3.387368) - if (rightArm) then turn(biggun, 1, -8.811130, 82.310465) end - if (rightArm) then turn(biggun, 2, 0.151839, 0.759193) end - if (rightArm) then turn(biggun, 3, -1.970615, 9.853077) end + if rightArm then + turn(biggun, 1, -8.811130, 82.310465) + end + if rightArm then + turn(biggun, 2, 0.151839, 0.759193) + end + if rightArm then + turn(biggun, 3, -1.970615, 9.853077) + end turn(head, 1, 0.000000, 40.108479) turn(head, 2, 0.000000, 47.292746) turn(l_foot, 1, -2.414753, 112.418542) @@ -437,11 +551,21 @@ function StopWalking() turn(lthigh, 1, 0.000000, 241.307004) turn(lthigh, 2, 14.837520, 121.662463) turn(lthigh, 3, 0.000000, 109.161052) - if (leftArm) then turn(luparm, 1, 6.970926, 116.358546) end - if (leftArm) then turn(luparm, 2, 15.215961, 123.038422) end - if (leftArm) then turn(nanolathe, 1, 6.795234, 82.533897) end - if (leftArm) then turn(nanolathe, 2, -0.110275, 0.551377) end - if (leftArm) then turn(nanolathe, 3, -1.857297, 9.286484) end + if leftArm then + turn(luparm, 1, 6.970926, 116.358546) + end + if leftArm then + turn(luparm, 2, 15.215961, 123.038422) + end + if leftArm then + turn(nanolathe, 1, 6.795234, 82.533897) + end + if leftArm then + turn(nanolathe, 2, -0.110275, 0.551377) + end + if leftArm then + turn(nanolathe, 3, -1.857297, 9.286484) + end turn(pelvis, 1, 0.000000, 12.500000) turn(pelvis, 2, 0.000000, 49.999999) turn(r_foot, 1, -1.584957, 107.051862) @@ -453,8 +577,12 @@ function StopWalking() turn(rthigh, 1, 0.000000, 306.324559) turn(rthigh, 2, -25.608481, 144.663917) turn(rthigh, 3, 0.000000, 113.472665) - if (rightArm) then turn(ruparm, 1, 8.674858, 110.217349) end - if (rightArm) then turn(ruparm, 2, -12.507997, 60.683891) end + if rightArm then + turn(ruparm, 1, 8.674858, 110.217349) + end + if rightArm then + turn(ruparm, 2, -12.507997, 60.683891) + end turn(torso, 1, 0.000000, 36.480655) turn(torso, 2, 0.000000, 84.999997) turn(torso, 3, 0.000000, 13.020986) @@ -478,22 +606,22 @@ end function UnitSpeed() maxSpeed = UnitDefs[Spring.GetUnitDefID(unitID)].speed animFramesPerKeyframe = 6 --we need to calc the frames per keyframe value, from the known animtime - maxSpeed = maxSpeed + (maxSpeed /(2*animFramesPerKeyframe)) -- add fudge - while(true)do - vx,vy,vz,Speed = Spring.GetUnitVelocity(unitID) + maxSpeed = maxSpeed + (maxSpeed / (2 * animFramesPerKeyframe)) -- add fudge + while true do + vx, vy, vz, Speed = Spring.GetUnitVelocity(unitID) currentSpeed = Speed * 30 - animSpeed = (currentSpeed) - if (animSpeed<1) then - animSpeed=1 + animSpeed = currentSpeed + if animSpeed < 1 then + animSpeed = 1 end animSpeed = (maxSpeed * 6) / animSpeed - if (animSpeed<3) then - animSpeed=3 + if animSpeed < 3 then + animSpeed = 3 end - if (animSpeed>12) then + if animSpeed > 12 then animSpeed = 12 end - Sleep (131) + Sleep(131) end end @@ -503,7 +631,7 @@ function ResumeBuilding() Turn(aimy1, 2, buildheading - rad(20), rad(300.000000)) Turn(aimx1, 1, rad(-20.000000) - buildpitch, rad(90.000000)) end - return (0) + return 0 end function script.Create() @@ -572,7 +700,7 @@ function script.AimWeapon(weapon, heading, pitch) Signal(SIG_AIM) Turn(aimy1, 2, heading, rad(300.000000)) Turn(aimx1, 1, rad(-5.000000) - pitch, rad(250.000000)) - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -591,7 +719,7 @@ function script.AimWeapon(weapon, heading, pitch) Signal(SIG_AIM) Turn(aimy1, 2, heading, rad(300.000000)) Turn(aimx1, 1, rad(-5.000000) - pitch, rad(250.000000)) - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) isAiming = true if isBuilding == true then StartThread(ResumeBuilding) @@ -605,7 +733,7 @@ function script.AimWeapon(weapon, heading, pitch) leftArm = false Turn(aimy1, 2, heading, rad(300.000000)) Turn(aimx1, 1, rad(-5.000000) - pitch, rad(250.000000)) - WaitForTurn(aimy1,2) + WaitForTurn(aimy1, 2) return true end end @@ -638,9 +766,9 @@ function script.StartBuilding(heading, pitch) Signal(SIG_AIM) isBuilding = true leftArm = false - Turn(aimy1, 2, heading, rad(300.000000)) - Turn(aimx1, 1, rad(-5.000000) - pitch, rad(250.000000)) - WaitForTurn(aimy1,2) + Turn(aimy1, 2, heading, rad(300.000000)) + Turn(aimx1, 1, rad(-5.000000) - pitch, rad(250.000000)) + WaitForTurn(aimy1, 2) Spring.UnitScript.SetUnitValue(COB.INBUILDSTANCE, true) buildHeading = heading buildPitch = pitch @@ -670,8 +798,8 @@ function Restore() end function script.QueryNanoPiece() - local piecenum; - piecenum = nanospray; + local piecenum + piecenum = nanospray return piecenum end diff --git a/scripts/Units/corgeo.lua b/scripts/Units/corgeo.lua index fd166240669..fa8155b3972 100644 --- a/scripts/Units/corgeo.lua +++ b/scripts/Units/corgeo.lua @@ -1,11 +1,11 @@ --pieces - local base = piece "base" - local smokespot = piece "smokespot" - local dmgPieces = { piece "base" } +local base = piece("base") +local smokespot = piece("smokespot") +local dmgPieces = { piece("base") } -- includes - include "dmg_smoke.lua" - include "animation.lua" +include("dmg_smoke.lua") +include("animation.lua") function script.Create() StartThread(animSmoke, unitID, smokespot) @@ -13,19 +13,17 @@ function script.Create() StartThread(dmgsmoke, dmgPieces) end - function script.Killed(recentDamage, maxHealth) local severity = recentDamage / maxHealth - if (severity <= .25) then + if severity <= 0.25 then Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) return 1 -- corpsetype - - elseif (severity <= .5) then + elseif severity <= 0.5 then Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) return 2 -- corpsetype else Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) return 3 -- corpsetype end -end \ No newline at end of file +end diff --git a/scripts/Units/corlab.lua b/scripts/Units/corlab.lua index 0a85efc52f5..874aff7b8f3 100644 --- a/scripts/Units/corlab.lua +++ b/scripts/Units/corlab.lua @@ -1,216 +1,215 @@ -local pad,base,door1,door2,crane1,crane2,turret1,turret2,nano1,nano2,cagelight,cagelight_emit = piece("pad","base","door1","door2","crane1","crane2","turret1","turret2","nano1","nano2","cagelight","cagelight_emit"); +local pad, base, door1, door2, crane1, crane2, turret1, turret2, nano1, nano2, cagelight, cagelight_emit = piece("pad", "base", "door1", "door2", "crane1", "crane2", "turret1", "turret2", "nano1", "nano2", "cagelight", "cagelight_emit") -local spray = 0; +local spray = 0 -local SIG_ACTIVATE = 2; -local SIG_OPENCLOSE = 4; -local SIG_CRANE1=8; -local SIG_CRANE2=16; +local SIG_ACTIVATE = 2 +local SIG_OPENCLOSE = 4 +local SIG_CRANE1 = 8 +local SIG_CRANE2 = 16 -include("include/util.lua"); +include("include/util.lua") local litelab = UnitDefs[unitDefID].customParams.litelab ~= nil function open() - UnitScript.Signal(SIG_OPENCLOSE); - UnitScript.SetSignalMask(SIG_OPENCLOSE); + UnitScript.Signal(SIG_OPENCLOSE) + UnitScript.SetSignalMask(SIG_OPENCLOSE) --Activate if not litelab then - Move(door1, x_axis, -17, 10); - Move(door2, x_axis, 17, 10); - UnitScript.WaitForMove(door1, x_axis); - Move(crane1,x_axis,21,42); - Move(crane2,x_axis,21,42); - UnitScript.WaitForMove(crane1, x_axis); - Sleep(1000); + Move(door1, x_axis, -17, 10) + Move(door2, x_axis, 17, 10) + UnitScript.WaitForMove(door1, x_axis) + Move(crane1, x_axis, 21, 42) + Move(crane2, x_axis, 21, 42) + UnitScript.WaitForMove(crane1, x_axis) + Sleep(1000) end --Open yard - open_yard(); + open_yard() --Get into buildstance - UnitScript.SetUnitValue(COB.INBUILDSTANCE, 1); + UnitScript.SetUnitValue(COB.INBUILDSTANCE, 1) end function close() - UnitScript.Signal(SIG_OPENCLOSE); - UnitScript.SetSignalMask(SIG_OPENCLOSE); + UnitScript.Signal(SIG_OPENCLOSE) + UnitScript.SetSignalMask(SIG_OPENCLOSE) --Get out of buildstance - UnitScript.SetUnitValue(COB.INBUILDSTANCE, 0); + UnitScript.SetUnitValue(COB.INBUILDSTANCE, 0) --Close yard - close_yard(); + close_yard() --Deactivate if not litelab then - Move(crane1,x_axis,2,20); - Move(crane2,x_axis,2,20); - UnitScript.WaitForMove(crane1, x_axis); - Move(door1, x_axis, 0, 17); - Move(door2, x_axis, 0, 17); - UnitScript.WaitForMove(door1, x_axis); - Sleep(500) + Move(crane1, x_axis, 2, 20) + Move(crane2, x_axis, 2, 20) + UnitScript.WaitForMove(crane1, x_axis) + Move(door1, x_axis, 0, 17) + Move(door2, x_axis, 0, 17) + UnitScript.WaitForMove(door1, x_axis) + Sleep(500) end end function script.Create() if litelab then - Hide(door1); - Hide(door2); - UnitScript.WaitForMove(door1, x_axis); - Move(crane1,x_axis,21,1000); - Move(crane2,x_axis,21,1000); + Hide(door1) + Hide(door2) + UnitScript.WaitForMove(door1, x_axis) + Move(crane1, x_axis, 21, 1000) + Move(crane2, x_axis, 21, 1000) end - Hide(nano2); - Hide(nano1); - spray = 0; - Hide (cagelight_emit); + Hide(nano2) + Hide(nano1) + spray = 0 + Hide(cagelight_emit) --Turn (cagelight, x_axis, 45, 0); - UnitScript.StartThread(smoke_unit, base); + UnitScript.StartThread(smoke_unit, base) end function script.QueryNanoPiece() - local piecenum; - if (spray == 0) then - piecenum = nano1; + local piecenum + if spray == 0 then + piecenum = nano1 end - if (spray == 1) then - piecenum = nano2; + if spray == 1 then + piecenum = nano2 end - spray = spray + 1; - if(spray == 2) then - spray = 0; + spray = spray + 1 + if spray == 2 then + spray = 0 end - return piecenum; + return piecenum end function Activate_real() - UnitScript.Signal(SIG_ACTIVATE); - UnitScript.StartThread(open); - + UnitScript.Signal(SIG_ACTIVATE) + UnitScript.StartThread(open) end function script.Activate() - UnitScript.StartThread(Activate_real); + UnitScript.StartThread(Activate_real) end function Deactivate_real() - UnitScript.Signal(SIG_ACTIVATE); - UnitScript.SetSignalMask(SIG_ACTIVATE); + UnitScript.Signal(SIG_ACTIVATE) + UnitScript.SetSignalMask(SIG_ACTIVATE) Sleep(5000) - UnitScript.StartThread(close); + UnitScript.StartThread(close) end function script.Deactivate() - UnitScript.StartThread(Deactivate_real); + UnitScript.StartThread(Deactivate_real) end local function MoveCrane1() - Signal(SIG_CRANE1); - SetSignalMask(SIG_CRANE1); + Signal(SIG_CRANE1) + SetSignalMask(SIG_CRANE1) while true do - Move(crane1,x_axis, 40,10); - WaitForMove(crane1, x_axis); - Move(crane1,x_axis, 2, 10); - WaitForMove(crane1, x_axis); - end + Move(crane1, x_axis, 40, 10) + WaitForMove(crane1, x_axis) + Move(crane1, x_axis, 2, 10) + WaitForMove(crane1, x_axis) + end end local function MoveCrane2() - Signal(SIG_CRANE2); - SetSignalMask(SIG_CRANE2); - - while true do - Move(crane2,x_axis, 2,10); - WaitForMove(crane2, x_axis); - Move(crane2,x_axis, 40, 10); - WaitForMove(crane2, x_axis); - end + Signal(SIG_CRANE2) + SetSignalMask(SIG_CRANE2) + + while true do + Move(crane2, x_axis, 2, 10) + WaitForMove(crane2, x_axis) + Move(crane2, x_axis, 40, 10) + WaitForMove(crane2, x_axis) + end end function script.StartBuilding(heading, pitch) - Show(nano2); - Show(nano1); - StartThread(MoveCrane1); - StartThread(MoveCrane2); - Show (cagelight_emit); + Show(nano2) + Show(nano1) + StartThread(MoveCrane1) + StartThread(MoveCrane2) + Show(cagelight_emit) --Turn (cagelight, x_axis,45,1); --WaitForTurn(cagelight, x_axis); --Sleep(10) - Spin (cagelight_emit, y_axis,4); + Spin(cagelight_emit, y_axis, 4) --Spin (cagelight,x_axis,20); end function script.StopBuilding() - Hide(nano2); - Hide(nano1); - Signal(SIG_CRANE1); - Signal (SIG_CRANE2); - Hide (cagelight_emit); - Turn (cagelight_emit, y_axis,0,15); + Hide(nano2) + Hide(nano1) + Signal(SIG_CRANE1) + Signal(SIG_CRANE2) + Hide(cagelight_emit) + Turn(cagelight_emit, y_axis, 0, 15) --Turn (cagelight, x_axis,45,0); --Turn (cagelight,y_axis,0,15); - Move(crane1, x_axis, 20, 20); - Move(crane2, x_axis, 20, 20); + Move(crane1, x_axis, 20, 20) + Move(crane2, x_axis, 20, 20) end function script.QueryBuildInfo() - return pad; + return pad end function script.Killed(recentDamage, maxHealth) - local severity = (recentDamage / maxHealth) * 100; - local corpsetype; - - if (severity <= 25) then - corpsetype = 1; - UnitScript.Explode(base,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(pad,SFX.NONE + SFX.NO_HEATCLOUD); - return corpsetype; + local severity = (recentDamage / maxHealth) * 100 + local corpsetype + + if severity <= 25 then + corpsetype = 1 + UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(pad, SFX.NONE + SFX.NO_HEATCLOUD) + return corpsetype end - if (severity <= 50) then - corpsetype = 2; - UnitScript.Explode(base,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(pad,SFX.NONE + SFX.NO_HEATCLOUD); - return corpsetype; + if severity <= 50 then + corpsetype = 2 + UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(pad, SFX.NONE + SFX.NO_HEATCLOUD) + return corpsetype end - if (severity <= 99) then - corpsetype = 3; - UnitScript.Explode(base,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(pad,SFX.NONE + SFX.NO_HEATCLOUD); - return corpsetype; + if severity <= 99 then + corpsetype = 3 + UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(pad, SFX.NONE + SFX.NO_HEATCLOUD) + return corpsetype end - corpsetype = 3; - UnitScript.Explode(base,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(door2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(turret2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(nano2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane1,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(crane2,SFX.NONE + SFX.NO_HEATCLOUD); - UnitScript.Explode(pad,SFX.NONE + SFX.NO_HEATCLOUD); - return corpsetype; + corpsetype = 3 + UnitScript.Explode(base, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(door2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(turret2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(nano2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane1, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(crane2, SFX.NONE + SFX.NO_HEATCLOUD) + UnitScript.Explode(pad, SFX.NONE + SFX.NO_HEATCLOUD) + return corpsetype end diff --git a/scripts/Units/corpun.lua b/scripts/Units/corpun.lua index 3e01d8cae21..7517b44a3db 100644 --- a/scripts/Units/corpun.lua +++ b/scripts/Units/corpun.lua @@ -1,16 +1,16 @@ --pieces -local base = piece "base" -local turret = piece "turret" -local barrel1 = piece "barrel1" -local barrel2 = piece "barrel2" -local sleeves = piece "sleeves" -local flare1 = piece "flare1" -local flare2 = piece "flare2" +local base = piece("base") +local turret = piece("turret") +local barrel1 = piece("barrel1") +local barrel2 = piece("barrel2") +local sleeves = piece("sleeves") +local flare1 = piece("flare1") +local flare2 = piece("flare2") local currBarrel = 1 -local dmgPieces = { piece "base", piece "flare1", piece "flare2" } +local dmgPieces = { piece("base"), piece("flare1"), piece("flare2") } -- includes -include "dmg_smoke.lua" +include("dmg_smoke.lua") --signals local SIG_AIM = 1 @@ -27,11 +27,10 @@ local function RestoreAfterDelay(unitID) Turn(sleeves, x_axis, 0, math.rad(50)) end - function script.QueryWeapon1() - if (currBarrel == 1) then + if currBarrel == 1 then return flare1 - else + else return flare2 end end @@ -40,29 +39,29 @@ function script.AimFromWeapon1() return turret end -function script.AimWeapon1( heading, pitch ) - Signal(SIG_AIM) - SetSignalMask(SIG_AIM) - Turn(turret, y_axis, heading, math.rad(30.005495)) - Turn(sleeves, x_axis, -pitch, math.rad(45.005495)) - WaitForTurn(turret, y_axis) - WaitForTurn(sleeves, x_axis) - return true +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, math.rad(30.005495)) + Turn(sleeves, x_axis, -pitch, math.rad(45.005495)) + WaitForTurn(turret, y_axis) + WaitForTurn(sleeves, x_axis) + return true end function script.FireWeapon1() if currBarrel == 1 then - EmitSfx(flare1, 1024+0) - Move (barrel1, z_axis, -1.500000) - Sleep (150) - Move (barrel1, z_axis, 0.000000, 1.000000) + EmitSfx(flare1, 1024 + 0) + Move(barrel1, z_axis, -1.500000) + Sleep(150) + Move(barrel1, z_axis, 0.000000, 1.000000) end - + if currBarrel == 2 then - EmitSfx(flare2, 1024+0) - Move (barrel2, z_axis, -1.500000) - Sleep (150) - Move (barrel2, z_axis, 0.000000, 1.000000) + EmitSfx(flare2, 1024 + 0) + Move(barrel2, z_axis, -1.500000) + Sleep(150) + Move(barrel2, z_axis, 0.000000, 1.000000) end currBarrel = currBarrel + 1 @@ -73,27 +72,27 @@ function script.FireWeapon1() end function script.QueryWeapon2() - if (currBarrel == 1) then + if currBarrel == 1 then return flare1 - else + else return flare2 end end - + function script.AimFromWeapon2() return turret end - + function script.Killed(recentDamage, maxHealth) local severity = recentDamage / maxHealth - if severity <= .25 then + if severity <= 0.25 then Explode(turret, SFX.EXPLODE + SFX.NO_HEATCLOUD) Explode(sleeves, SFX.EXPLODE + SFX.NO_HEATCLOUD) Explode(barrel1, SFX.EXPLODE + SFX.NO_HEATCLOUD) Explode(barrel2, SFX.EXPLODE + SFX.NO_HEATCLOUD) return 1 -- corpsetype - elseif severity <= .5 then + elseif severity <= 0.5 then Explode(turret, SFX.EXPLODE + SFX.NO_HEATCLOUD) Explode(sleeves, SFX.EXPLODE + SFX.NO_HEATCLOUD) Explode(barrel1, SFX.EXPLODE + SFX.NO_HEATCLOUD) diff --git a/scripts/Units/scavbuildings/corminibuzz.lua b/scripts/Units/scavbuildings/corminibuzz.lua index 7315de3cc93..fcac46d2815 100644 --- a/scripts/Units/scavbuildings/corminibuzz.lua +++ b/scripts/Units/scavbuildings/corminibuzz.lua @@ -1,57 +1,56 @@ -local flare1 = piece 'flare1' -local flare2 = piece 'flare2' -local flare3 = piece 'flare3' -local flare4 = piece 'flare4' -local flare5 = piece 'flare5' -local flare6 = piece 'flare6' -local base = piece 'base' -local turret = piece 'turret' -local barrel1 = piece 'barrel1' -local barrel2 = piece 'barrel2' -local barrel3 = piece 'barrel3' -local barrel4 = piece 'barrel4' -local barrel5 = piece 'barrel5' -local barrel6 = piece 'barrel6' -local sleeve1 = piece 'sleeve1' -local sleeve2 = piece 'sleeve2' -local sleeve3 = piece 'sleeve3' -local sleeve4 = piece 'sleeve4' -local sleeve5 = piece 'sleeve5' -local sleeve6 = piece 'sleeve6' -local spindle = piece 'spindle' +local flare1 = piece("flare1") +local flare2 = piece("flare2") +local flare3 = piece("flare3") +local flare4 = piece("flare4") +local flare5 = piece("flare5") +local flare6 = piece("flare6") +local base = piece("base") +local turret = piece("turret") +local barrel1 = piece("barrel1") +local barrel2 = piece("barrel2") +local barrel3 = piece("barrel3") +local barrel4 = piece("barrel4") +local barrel5 = piece("barrel5") +local barrel6 = piece("barrel6") +local sleeve1 = piece("sleeve1") +local sleeve2 = piece("sleeve2") +local sleeve3 = piece("sleeve3") +local sleeve4 = piece("sleeve4") +local sleeve5 = piece("sleeve5") +local sleeve6 = piece("sleeve6") +local spindle = piece("spindle") local gun_1 = 0 -local dmgPieces = { piece "turret" } +local dmgPieces = { piece("turret") } -- Signal definitions local SIG_AIM = 1 -- includes - include "dmg_smoke.lua" +include("dmg_smoke.lua") function script.Create() - Hide(flare1) Hide(flare2) Hide(flare3) Hide(flare4) Hide(flare5) Hide(flare6) - --todo rotate flare in model - Turn( flare2 , x_axis, math.rad(-60.005495) ) - Turn( flare3 , x_axis, math.rad(-120.01099) ) - Turn( flare4 , x_axis, math.rad(-180.016485) ) - Turn( flare5 , x_axis, math.rad(-240.02198) ) - Turn( flare6 , x_axis, math.rad(-300.027475) ) - StartThread(dmgsmoke, dmgPieces) + --todo rotate flare in model + Turn(flare2, x_axis, math.rad(-60.005495)) + Turn(flare3, x_axis, math.rad(-120.01099)) + Turn(flare4, x_axis, math.rad(-180.016485)) + Turn(flare5, x_axis, math.rad(-240.02198)) + Turn(flare6, x_axis, math.rad(-300.027475)) + StartThread(dmgsmoke, dmgPieces) end function script.AimWeapon1(heading, pitch) - Signal( SIG_AIM) - SetSignalMask( SIG_AIM) - Turn( turret , y_axis, heading, math.rad(15.000000) ) - Turn( spindle , x_axis,(math.rad(60.005495) * gun_1) - pitch, math.rad(200.038462) ) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, math.rad(15.000000)) + Turn(spindle, x_axis, (math.rad(60.005495) * gun_1) - pitch, math.rad(200.038462)) --Spring.Echo(gun_1,gun_1*60) WaitForTurn(turret, y_axis) WaitForTurn(spindle, x_axis) @@ -59,86 +58,73 @@ function script.AimWeapon1(heading, pitch) end function script.FireWeapon1() - if gun_1 == 0 then - Move(barrel1 , z_axis, -6.000000, 9000 ) - EmitSfx( flare1, 1024 + 0 ) - Sleep( 100) - Move( barrel1 , z_axis, 0.000000 , 6.000000 ) + if gun_1 == 0 then + Move(barrel1, z_axis, -6.000000, 9000) + EmitSfx(flare1, 1024 + 0) + Sleep(100) + Move(barrel1, z_axis, 0.000000, 6.000000) end - if gun_1 == 1 then - - Move(barrel2 , y_axis, -5.000000 ) - Move(barrel2 , z_axis, -3.000000 ) - EmitSfx( flare2, 1024 + 0 ) - Sleep( 100) - Move( barrel2 , y_axis, 0.000000 , 5.000000 ) - Move( barrel2 , z_axis, 0.000000 , 3.000000 ) + if gun_1 == 1 then + Move(barrel2, y_axis, -5.000000) + Move(barrel2, z_axis, -3.000000) + EmitSfx(flare2, 1024 + 0) + Sleep(100) + Move(barrel2, y_axis, 0.000000, 5.000000) + Move(barrel2, z_axis, 0.000000, 3.000000) end - if gun_1 == 2 then - - Move(barrel3 , y_axis, -5.000000 ) - Move(barrel3 , z_axis, 3.000000 ) - EmitSfx( flare3, 1024 + 0 ) - Sleep( 100) - Move(barrel3 , y_axis, 0.000000 , 5.000000 ) - Move(barrel3 , z_axis, 0.000000 , 3.000000 ) + if gun_1 == 2 then + Move(barrel3, y_axis, -5.000000) + Move(barrel3, z_axis, 3.000000) + EmitSfx(flare3, 1024 + 0) + Sleep(100) + Move(barrel3, y_axis, 0.000000, 5.000000) + Move(barrel3, z_axis, 0.000000, 3.000000) end - if gun_1 == 3 then - - Move(barrel4 , z_axis, 6.000000 ) - EmitSfx(flare4, 1024 + 0 ) - Sleep( 100) - Move(barrel4 , z_axis, 0.000000 , 6.000000 ) + if gun_1 == 3 then + Move(barrel4, z_axis, 6.000000) + EmitSfx(flare4, 1024 + 0) + Sleep(100) + Move(barrel4, z_axis, 0.000000, 6.000000) end - if gun_1 == 4 then - - Move( barrel5 , y_axis, 5.000000 ) - Move( barrel5 , z_axis, 3.000000 ) - EmitSfx( flare5, 1024 + 0 ) - Sleep( 100) - Move( barrel5 , y_axis, 0.000000 , 5.000000 ) - Move( barrel5 , z_axis, 0.000000 , 3.000000 ) + if gun_1 == 4 then + Move(barrel5, y_axis, 5.000000) + Move(barrel5, z_axis, 3.000000) + EmitSfx(flare5, 1024 + 0) + Sleep(100) + Move(barrel5, y_axis, 0.000000, 5.000000) + Move(barrel5, z_axis, 0.000000, 3.000000) end - if gun_1 == 5 then - - Move( barrel6 , y_axis, 5.000000 ) - Move( barrel6 , z_axis, -3.000000 ) - EmitSfx( flare6, 1024 + 0 ) - Sleep( 100) - Move( barrel6 , y_axis, 0.000000 , 5.000000 ) - Move( barrel6 , z_axis, 0.000000 , 3.000000 ) + if gun_1 == 5 then + Move(barrel6, y_axis, 5.000000) + Move(barrel6, z_axis, -3.000000) + EmitSfx(flare6, 1024 + 0) + Sleep(100) + Move(barrel6, y_axis, 0.000000, 5.000000) + Move(barrel6, z_axis, 0.000000, 3.000000) end gun_1 = gun_1 + 1 - if gun_1 == 6 then - + if gun_1 == 6 then gun_1 = 0 end end function script.QueryWeapon1(piecenum) - - if gun_1 == 0 then - + if gun_1 == 0 then return flare1 end - if gun_1 == 1 then - + if gun_1 == 1 then return flare2 end - if gun_1 == 2 then - + if gun_1 == 2 then return flare3 end - if gun_1 == 3 then - + if gun_1 == 3 then return flare4 end - if gun_1 == 4 then - + if gun_1 == 4 then return flare5 end - if gun_1 == 5 then - + if gun_1 == 5 then return flare6 end end @@ -147,36 +133,35 @@ function script.AimFromWeapon1() return spindle end - function script.Killed(recentDamage, maxHealth) - local severity = recentDamage / maxHealth - - if (severity <= .25) then - Explode(base, SFX.EXPLODE) - Explode(barrel1, SFX.NONE + SFX.NO_HEATCLOUD) - Explode(barrel2, SFX.NONE + SFX.NO_HEATCLOUD) - Explode(barrel3, SFX.NONE + SFX.NO_HEATCLOUD) - Explode(barrel4, SFX.NONE + SFX.NO_HEATCLOUD) - Explode(barrel5, SFX.NONE + SFX.NO_HEATCLOUD) - Explode(barrel6, SFX.NONE + SFX.NO_HEATCLOUD) - return 1 -- corpsetype +function script.Killed(recentDamage, maxHealth) + local severity = recentDamage / maxHealth - elseif (severity <= .5) then - Explode(base, SFX.EXPLODE) - Explode(barrel1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel5, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel6, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - return 2 -- corpsetype - else - Explode(base, SFX.EXPLODE) - Explode(barrel1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel5, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - Explode(barrel6, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) - return 3 -- corpsetype - end - end \ No newline at end of file + if severity <= 0.25 then + Explode(base, SFX.EXPLODE) + Explode(barrel1, SFX.NONE + SFX.NO_HEATCLOUD) + Explode(barrel2, SFX.NONE + SFX.NO_HEATCLOUD) + Explode(barrel3, SFX.NONE + SFX.NO_HEATCLOUD) + Explode(barrel4, SFX.NONE + SFX.NO_HEATCLOUD) + Explode(barrel5, SFX.NONE + SFX.NO_HEATCLOUD) + Explode(barrel6, SFX.NONE + SFX.NO_HEATCLOUD) + return 1 -- corpsetype + elseif severity <= 0.5 then + Explode(base, SFX.EXPLODE) + Explode(barrel1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel5, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel6, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + return 2 -- corpsetype + else + Explode(base, SFX.EXPLODE) + Explode(barrel1, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel2, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel3, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel4, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel5, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + Explode(barrel6, SFX.SMOKE + SFX.FIRE + SFX.EXPLODE + SFX.NO_HEATCLOUD) + return 3 -- corpsetype + end +end diff --git a/scripts/animation.lua b/scripts/animation.lua index 0573d3b700f..c58e0c966ea 100644 --- a/scripts/animation.lua +++ b/scripts/animation.lua @@ -1,41 +1,40 @@ -- Animate spinning parts after the model was built function animSpin(getid, getpiece, getaxis, getspeed) - local id=getid - local piece=getpiece - local axis=getaxis - local speed=getspeed + local id = getid + local piece = getpiece + local axis = getaxis + local speed = getspeed local last_inbuilt = true - while (true) do + while true do local inProgress = Spring.GetUnitIsBeingBuilt(id) - if (inProgress ~= last_inbuilt) then + if inProgress ~= last_inbuilt then last_inbuilt = inProgress - if (inProgress) then - StopSpin( piece, axis, speed ) + if inProgress then + StopSpin(piece, axis, speed) else - Spin( piece, axis, speed ) + Spin(piece, axis, speed) end end Sleep(1000) end end - -- Start smoke effect after the model was built function animSmoke(getid, getpiece) - local id=getid - local piece=getpiece + local id = getid + local piece = getpiece local SMOKE = 257 local last_inbt = true - while (true) do + while true do local inProgress = Spring.GetUnitIsBeingBuilt(id) - if (inProgress ~= last_inbt) then + if inProgress ~= last_inbt then last_inbt = inProgress - if (inProgress) then + if inProgress then --nothing else - while (true) do + while true do EmitSfx(piece, SFX.BLACK_SMOKE) Sleep(100) end @@ -45,24 +44,23 @@ function animSmoke(getid, getpiece) end end - -- Start fire2 at low health level function animBurn(getid, getpiece) - local id=getid - local piece=getpiece + local id = getid + local piece = getpiece local last_inb = true - while (true) do + while true do local inProgress = Spring.GetUnitIsBeingBuilt(id) - if (inProgress ~= last_inb) then + if inProgress ~= last_inb then last_inb = inProgress - if (inProgress) then + if inProgress then --nothing else - while (true) do + while true do local health = GetUnitValue(COB.HEALTH) - if (health<=10) then - EmitSfx(piece, 1024+0) + if health <= 10 then + EmitSfx(piece, 1024 + 0) end Sleep(100) end @@ -70,4 +68,4 @@ function animBurn(getid, getpiece) end Sleep(1000) end -end \ No newline at end of file +end diff --git a/scripts/banana.lua b/scripts/banana.lua index a0ff0c00f3c..bded98e232c 100644 --- a/scripts/banana.lua +++ b/scripts/banana.lua @@ -1,4 +1,4 @@ -local base = piece "base" +local base = piece("base") local f = 0 function Sink() @@ -11,4 +11,4 @@ function MoveDown() f = f - 0.03 Sleep(1) end -end \ No newline at end of file +end diff --git a/scripts/bots_lus.lua b/scripts/bots_lus.lua index 768e9566899..8dab91853be 100644 --- a/scripts/bots_lus.lua +++ b/scripts/bots_lus.lua @@ -5,36 +5,36 @@ end ang = math.rad timedTurn = function(piece, axis, goal, amount, t) - local speed = amount/(t/1000) + local speed = amount / (t / 1000) Turn(piece, axis, goal, speed) end timedMove = function(piece, axis, goal, amount, t) - local speed = amount/(t/1000) + local speed = amount / (t / 1000) Move(piece, axis, goal, speed) end - + unitDefID = Spring.GetUnitDefID(unitID) defs = UnitDefs[unitDefID] unitName = UnitDefs[unitDefID].name -- rename scavenger unit -unitName = string.gsub(unitName, '_scav', '') +unitName = string.gsub(unitName, "_scav", "") pi = math.pi abs = math.abs -pi2 = pi*2 +pi2 = pi * 2 hasWpn = false currentSpeed = 200 weapons = {} -include(unitName.."_lus/setup.lua") -include(unitName.."_lus/move.lua") -include(unitName.."_lus/weaponsdata.lua") - +include(unitName .. "_lus/setup.lua") +include(unitName .. "_lus/move.lua") +include(unitName .. "_lus/weaponsdata.lua") + isMoving, isAiming, isBuilding, counter, canAim, isInLoop = false, false, false, 0, false, false step = 1 - + function MotionControl() local justmoved = true while true do @@ -58,7 +58,7 @@ function MotionControl() justmoved = true else canAim = true - if justmoved then + if justmoved then StartThread(RestoreLegs) if not aim then StartThread(RestoreArms) @@ -73,7 +73,7 @@ end function WeaponControl() while true do for weaponID, data in pairs(weapons) do - local data = weapons[weaponID] + local data = weapons[weaponID] local curHead, wtdHead, curPitch, wtdPitch = data.curHead, data.wtdHead, data.curPitch, data.wtdPitch local wpnReady = data.wpnReady local headSpeed = data.headSpeed @@ -84,12 +84,12 @@ function WeaponControl() if curHead < 0 then curHead = pi2 + curHead elseif curHead >= pi2 then - curHead = curHead -(pi2) + curHead = curHead - pi2 end if curPitch < 0 then curPitch = pi2 + curPitch elseif curPitch >= pi2 then - curPitch = curPitch -pi2 + curPitch = curPitch - pi2 end if canAim then local diffHead = wtdHead - curHead @@ -116,7 +116,7 @@ function WeaponControl() curHead = wtdHead headReady = true end - if absdiffPitch > pitchSpeed then + if absdiffPitch > pitchSpeed then if diffPitch < 0 then curPitch = curPitch - pitchSpeed else @@ -139,14 +139,14 @@ function WeaponControl() Sleep(1) end end - + function script.StartMoving() isMoving = true end function script.StopMoving() isMoving = false -end +end function script.Create() InitialPiecesSetup() @@ -161,7 +161,7 @@ function LastCallCheck(weaponID) if not weapons[weaponID].lastCall then weapons[weaponID].lastCall = f end - if weapons[weaponID].lastCall ~= f-1 then + if weapons[weaponID].lastCall ~= f - 1 then weapons[weaponID].canFire = false end weapons[weaponID].lastCall = f @@ -224,4 +224,4 @@ end function script.Killed(recentDamage, maxHealth) return 1 -end \ No newline at end of file +end diff --git a/scripts/chip.lua b/scripts/chip.lua index a0ff0c00f3c..bded98e232c 100644 --- a/scripts/chip.lua +++ b/scripts/chip.lua @@ -1,4 +1,4 @@ -local base = piece "base" +local base = piece("base") local f = 0 function Sink() @@ -11,4 +11,4 @@ function MoveDown() f = f - 0.03 Sleep(1) end -end \ No newline at end of file +end diff --git a/scripts/dice.lua b/scripts/dice.lua index e1e99e6548a..538054a7aa6 100644 --- a/scripts/dice.lua +++ b/scripts/dice.lua @@ -1,13 +1,13 @@ -local base = piece "base" +local base = piece("base") local f = 0 -local x = ((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180 -local z = ((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180 -local y = ((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180 +local x = ((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180 +local z = ((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180 +local y = ((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180 function script.Create() - Turn (base, x_axis, x, x/2.5) - Turn (base, z_axis, z, z/2.5) - Turn (base, y_axis, y, y/2.5) + Turn(base, x_axis, x, x / 2.5) + Turn(base, z_axis, z, z / 2.5) + Turn(base, y_axis, y, y / 2.5) end function Sink() @@ -23,10 +23,10 @@ function MoveDown() end function Roll() - x = x + (((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180) - z = z + (((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180) - y = y + (((math.floor((math.random()*360)/90)+1)*90)* math.pi / 180) - Turn (base, x_axis, x, x/2.5) - Turn (base, z_axis, z, z/2.5) - Turn (base, y_axis, y, y/2.5) -end \ No newline at end of file + x = x + (((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180) + z = z + (((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180) + y = y + (((math.floor((math.random() * 360) / 90) + 1) * 90) * math.pi / 180) + Turn(base, x_axis, x, x / 2.5) + Turn(base, z_axis, z, z / 2.5) + Turn(base, y_axis, y, y / 2.5) +end diff --git a/scripts/dmg_smoke.lua b/scripts/dmg_smoke.lua index 1822b2f0347..735392c7e9f 100644 --- a/scripts/dmg_smoke.lua +++ b/scripts/dmg_smoke.lua @@ -1,17 +1,16 @@ local SMOKE = 258 local random = math.random - function dmgsmoke(dmgPieces) local n = #dmgPieces - while (GetUnitValue(COB.BUILD_PERCENT_LEFT) ~= 0) do + while GetUnitValue(COB.BUILD_PERCENT_LEFT) ~= 0 do Sleep(1000) end while true do local health = GetUnitValue(COB.HEALTH) - if (health <= 50) then - EmitSfx(dmgPieces[random(1,n)], SMOKE) + if health <= 50 then + EmitSfx(dmgPieces[random(1, n)], SMOKE) end - Sleep(9*health + random(100,200)) + Sleep(9 * health + random(100, 200)) end -end \ No newline at end of file +end diff --git a/scripts/headers/common_includes_lus.lua b/scripts/headers/common_includes_lus.lua index 0a08119d056..53a71e9d2be 100644 --- a/scripts/headers/common_includes_lus.lua +++ b/scripts/headers/common_includes_lus.lua @@ -1,51 +1,51 @@ common = { - CustomEmitter = function (pieceName, effectName) + CustomEmitter = function(pieceName, effectName) --Spring.Echo(pieceName, effectName) - local x,y,z,dx,dy,dz = Spring.GetUnitPiecePosDir(unitID,pieceName) - - Spring.SpawnCEG(effectName, x,y,z, dx, dy, dz) + local x, y, z, dx, dy, dz = Spring.GetUnitPiecePosDir(unitID, pieceName) + + Spring.SpawnCEG(effectName, x, y, z, dx, dy, dz) end, - - HbotLift = function () + + HbotLift = function() Move(base, y_axis, 20, 200) --Spring.Echo("Bruh I lift") end, - - setSFXoccupy = function (setSFXoccupy_argument) + + setSFXoccupy = function(setSFXoccupy_argument) --Spring.Echo(type(setSFXoccupy_argument)) --Spring.Echo("common.setSFXoccupy is being called", setSFXoccupy_argument) --Spring.Echo(setSFXoccupy_argument == 1, setSFXoccupy_argument == 2) --Spring.Echo(setSFXoccupy_argument == 4, setSFXoccupy_argument == 3, setSFXoccupy_argument == 0) - if setSFXoccupy_argument == 1 or setSFXoccupy_argument == 2 then - Move(base, y_axis, 0, 50) - SetUnitValue(COB.UPRIGHT, 1) - --Spring.Echo("Setting Upright: 1") - elseif setSFXoccupy_argument == 4 or setSFXoccupy_argument == 3 or setSFXoccupy_argument == 0 then - SetUnitValue(COB.UPRIGHT, 0) - --Spring.Echo("Setting Upright: 0") - end - end, - - DirtTrail = function () + if setSFXoccupy_argument == 1 or setSFXoccupy_argument == 2 then + Move(base, y_axis, 0, 50) + SetUnitValue(COB.UPRIGHT, 1) + --Spring.Echo("Setting Upright: 1") + elseif setSFXoccupy_argument == 4 or setSFXoccupy_argument == 3 or setSFXoccupy_argument == 0 then + SetUnitValue(COB.UPRIGHT, 0) + --Spring.Echo("Setting Upright: 0") + end + end, + + DirtTrail = function() while isMoving do common.CustomEmitter(dirt, "dirt") -- Second argument is the piece name, third argument needs to be a string because it will be the name of the CEG effect used Sleep(400) end end, - - SmokeUnit = function (smokePieces) + + SmokeUnit = function(smokePieces) local n = #smokePieces - while (GetUnitValue(COB.BUILD_PERCENT_LEFT) ~= 0) do + while GetUnitValue(COB.BUILD_PERCENT_LEFT) ~= 0 do Sleep(1000) end while true do local health = GetUnitValue(COB.HEALTH) - if (health <= 66) then -- only smoke if less then 2/3rd health left - common.CustomEmitter(smokePieces[math.random(1,n)], "blacksmoke") --CEG name in quotes (string) + if health <= 66 then -- only smoke if less then 2/3rd health left + common.CustomEmitter(smokePieces[math.random(1, n)], "blacksmoke") --CEG name in quotes (string) end - Sleep(20*health + 200) + Sleep(20 * health + 200) end end, } -return common \ No newline at end of file +return common diff --git a/scripts/include/util.lua b/scripts/include/util.lua index ca290fc7ba8..0075a61fa52 100644 --- a/scripts/include/util.lua +++ b/scripts/include/util.lua @@ -1,47 +1,52 @@ - function still_building() - return Spring.GetUnitIsBeingBuilt(unitID); + return Spring.GetUnitIsBeingBuilt(unitID) end function get_health_percent() - local health,maxHealth = Spring.GetUnitHealth(unitID); - return ((health / maxHealth) * 100); + local health, maxHealth = Spring.GetUnitHealth(unitID) + return ((health / maxHealth) * 100) end function smoke_unit(emit_piece) - while still_building() do Sleep(400); end - - while (true) do - local health_percent = get_health_percent(); - - if (health_percent < 66) then - local smoketype = 258; - if (math.random(1, 66) < health_percent) then smoketype = 257; end - Spring.UnitScript.EmitSfx(emit_piece, smoketype); + while still_building() do + Sleep(400) + end + + while true do + local health_percent = get_health_percent() + + if health_percent < 66 then + local smoketype = 258 + if math.random(1, 66) < health_percent then + smoketype = 257 + end + Spring.UnitScript.EmitSfx(emit_piece, smoketype) + end + + local sleep_time = health_percent * 50 + if sleep_time < 200 then + sleep_time = 200 end - - local sleep_time = health_percent * 50; - if (sleep_time < 200) then sleep_time = 200; end - Sleep(sleep_time); + Sleep(sleep_time) end end function open_yard() - UnitScript.SetUnitValue(COB.YARD_OPEN, 1); - while (UnitScript.GetUnitValue(COB.YARD_OPEN) == 0) do - UnitScript.SetUnitValue(COB.BUGGER_OFF, 1); - Sleep(1500); - UnitScript.SetUnitValue(COB.YARD_OPEN, 1); + UnitScript.SetUnitValue(COB.YARD_OPEN, 1) + while UnitScript.GetUnitValue(COB.YARD_OPEN) == 0 do + UnitScript.SetUnitValue(COB.BUGGER_OFF, 1) + Sleep(1500) + UnitScript.SetUnitValue(COB.YARD_OPEN, 1) end - UnitScript.SetUnitValue(COB.BUGGER_OFF, 0); + UnitScript.SetUnitValue(COB.BUGGER_OFF, 0) end function close_yard() - UnitScript.SetUnitValue(COB.YARD_OPEN, 0); - while(UnitScript.GetUnitValue(COB.YARD_OPEN) ~= 0) do - UnitScript.SetUnitValue(COB.BUGGER_OFF, 1); - Sleep(1500); - UnitScript.SetUnitValue(COB.YARD_OPEN, 0); + UnitScript.SetUnitValue(COB.YARD_OPEN, 0) + while UnitScript.GetUnitValue(COB.YARD_OPEN) ~= 0 do + UnitScript.SetUnitValue(COB.BUGGER_OFF, 1) + Sleep(1500) + UnitScript.SetUnitValue(COB.YARD_OPEN, 0) end - UnitScript.SetUnitValue(COB.BUGGER_OFF, 0); + UnitScript.SetUnitValue(COB.BUGGER_OFF, 0) end diff --git a/scripts/include/walk.lua b/scripts/include/walk.lua index 822b9298a4b..1458d1fe96e 100644 --- a/scripts/include/walk.lua +++ b/scripts/include/walk.lua @@ -3,13 +3,13 @@ -- Author: Nemo, Smoth -- Date: 3/18/2011 ------------------------------------------------------- -local inStance = false +local inStance = false local gravFactor = Game.gravity / 120 function walk() Signal(SIG_WALK) - SetSignalMask(SIG_WALK) - + SetSignalMask(SIG_WALK) + Turn(right_l, z_axis, 0, math.rad(135)) Turn(left_l, z_axis, 0, math.rad(130)) Turn(foot_l, y_axis, 0, math.rad(130)) @@ -18,19 +18,19 @@ function walk() Turn(foot_r, x_axis, 0, math.rad(130)) Turn(foot_l, z_axis, 0, math.rad(130)) Turn(foot_r, z_axis, 0, math.rad(130)) - + Turn(right_l, y_axis, 0, math.rad(135)) Turn(left_l, y_axis, 0, math.rad(130)) - - --Spring.Echo("walk",isAiming) - local firststep=true + + --Spring.Echo("walk",isAiming) + local firststep = true while true do - if (isAiming == false) then - if (leftArm == true ) then + if isAiming == false then + if leftArm == true then Turn(l_arm, x_axis, math.rad(-20), math.rad(21 * speedMult)) end - if (rightArm == true ) then - Turn(r_arm, x_axis, math.rad(20*gravFactor), math.rad(21 * speedMult)) + if rightArm == true then + Turn(r_arm, x_axis, math.rad(20 * gravFactor), math.rad(21 * speedMult)) end end Turn(cod, y_axis, math.rad(-5), math.rad(6 * speedMult)) @@ -39,57 +39,57 @@ function walk() Turn(head, y_axis, math.rad(2), math.rad(6 * speedMult)) Turn(right_l, y_axis, math.rad(5), math.rad(6 * speedMult)) Turn(left_l, y_axis, math.rad(5), math.rad(6 * speedMult)) - + Turn(base, z_axis, math.rad(2), math.rad(2 * speedMult)) - Turn(shin_r, x_axis, math.rad(65), math.rad(137.5 * speedMult)) + Turn(shin_r, x_axis, math.rad(65), math.rad(137.5 * speedMult)) Turn(right_l, x_axis, math.rad(-50), math.rad(70 * speedMult)) Turn(left_l, x_axis, math.rad(30), math.rad(70 * speedMult)) - Sleep(400/speedMult) - - Turn(base, x_axis, math.rad(1*gravFactor), math.rad(6 * speedMult)) - + Sleep(400 / speedMult) + + Turn(base, x_axis, math.rad(1 * gravFactor), math.rad(6 * speedMult)) + Move(cod, z_axis, 0.4, 20) - Move(cod, y_axis, 0.2/gravFactor, 5) - if (firststep) then - firststep=false + Move(cod, y_axis, 0.2 / gravFactor, 5) + if firststep then + firststep = false else - Sleep(700/speedMult) + Sleep(700 / speedMult) end Turn(shin_r, x_axis, math.rad(15), math.rad(185 * speedMult)) Move(cod, z_axis, -1.5, 10) Move(cod, y_axis, -0.75, 8.75) - - --Spring.Echo("walk",isAiming) - if (isAiming == false) then - if (rightArm == true ) then + + --Spring.Echo("walk",isAiming) + if isAiming == false then + if rightArm == true then Turn(r_arm, x_axis, math.rad(-20), math.rad(21 * speedMult)) end - if (leftArm == true ) then - Turn(l_arm, x_axis, math.rad(20), math.rad(21 * speedMult)) + if leftArm == true then + Turn(l_arm, x_axis, math.rad(20), math.rad(21 * speedMult)) end end Turn(cod, y_axis, math.rad(5), math.rad(6 * speedMult)) - Turn(base, x_axis, math.rad(20*gravFactor), math.rad(10 * speedMult)) + Turn(base, x_axis, math.rad(20 * gravFactor), math.rad(10 * speedMult)) Turn(base, y_axis, math.rad(-3), math.rad(6 * speedMult)) Turn(head, y_axis, math.rad(-2), math.rad(6 * speedMult)) Turn(right_l, y_axis, math.rad(-5), math.rad(6 * speedMult)) Turn(left_l, y_axis, math.rad(-5), math.rad(6 * speedMult)) - + Turn(base, z_axis, math.rad(-2), math.rad(2 * speedMult)) Turn(shin_l, x_axis, math.rad(65), math.rad(137.5 * speedMult)) Turn(left_l, x_axis, math.rad(-50), math.rad(70 * speedMult)) Turn(right_l, x_axis, math.rad(30), math.rad(70 * speedMult)) - - Sleep(400/speedMult) - - Turn(base, x_axis, math.rad(1*gravFactor), math.rad(6 * speedMult)) + + Sleep(400 / speedMult) + + Turn(base, x_axis, math.rad(1 * gravFactor), math.rad(6 * speedMult)) Move(cod, z_axis, 0.4, 20) - Move(cod, y_axis, 0.2/gravFactor, 5) - Sleep(700/speedMult) + Move(cod, y_axis, 0.2 / gravFactor, 5) + Sleep(700 / speedMult) Turn(shin_l, x_axis, math.rad(15), math.rad(185 * speedMult)) - + Move(cod, z_axis, -1.5, 10) Move(cod, y_axis, -0.75, 8.75) end @@ -97,7 +97,7 @@ end function poser() Signal(SIG_WALK) - SetSignalMask(SIG_WALK) + SetSignalMask(SIG_WALK) Turn(cod, y_axis, math.rad(0), math.rad(20)) Turn(base, x_axis, math.rad(0), math.rad(20)) Turn(base, y_axis, math.rad(0), math.rad(20)) @@ -106,8 +106,8 @@ function poser() Move(cod, y_axis, 0, 8.75) Turn(right_l, y_axis, math.rad(0), math.rad(20)) Turn(left_l, y_axis, math.rad(0), math.rad(20)) - - if(heavy == true ) then + + if heavy == true then SquatStance() else StandStance() @@ -119,42 +119,42 @@ function StandStance() Move(cod, y_axis, 0, now) Turn(base, z_axis, 0, now) Signal(SIG_WALK) - SetSignalMask(SIG_WALK) - + SetSignalMask(SIG_WALK) + Move(cod, y_axis, math.rad(-0.5), math.rad(8000)) - + Turn(base, x_axis, math.rad(-2), math.rad(395)) - if (isAiming == false) then - if (leftArm == true ) then + if isAiming == false then + if leftArm == true then Turn(l_arm, x_axis, math.rad(10), math.rad(395)) Turn(l_arm, y_axis, math.rad(5), math.rad(395)) Turn(l_arm, z_axis, math.rad(9), math.rad(395)) Turn(l_forearm, x_axis, math.rad(-38), math.rad(395)) end - if (rightArm == true ) then + if rightArm == true then Turn(r_arm, x_axis, math.rad(10), math.rad(395)) Turn(r_arm, y_axis, math.rad(-5), math.rad(395)) Turn(r_arm, z_axis, math.rad(-9), math.rad(395)) Turn(r_forearm, x_axis, math.rad(-38), math.rad(395)) end end - + Turn(right_l, x_axis, 0, math.rad(235)) - Turn(right_l, y_axis, math.rad(-18), math.rad(135)) + Turn(right_l, y_axis, math.rad(-18), math.rad(135)) Turn(right_l, z_axis, math.rad(-15), math.rad(135)) - + Turn(left_l, x_axis, 0, math.rad(235)) - Turn(left_l, y_axis, math.rad(18), math.rad(135)) + Turn(left_l, y_axis, math.rad(18), math.rad(135)) Turn(left_l, z_axis, math.rad(15), math.rad(135)) - + Turn(shin_l, x_axis, 0, math.rad(235)) Turn(shin_r, x_axis, 0, math.rad(230)) Turn(foot_l, x_axis, math.rad(1), math.rad(395)) Turn(foot_l, y_axis, math.rad(5), math.rad(130)) Turn(foot_l, z_axis, math.rad(-15), math.rad(130)) - + Turn(foot_r, x_axis, math.rad(1), math.rad(395)) Turn(foot_r, y_axis, math.rad(-5), math.rad(130)) Turn(foot_r, z_axis, math.rad(15), math.rad(130)) @@ -162,47 +162,47 @@ function StandStance() Sleep(0) end -function SquatStance () +function SquatStance() Sleep(200) Move(cod, y_axis, -1.5, now) Turn(base, z_axis, 0, now) Signal(SIG_WALK) - SetSignalMask(SIG_WALK) - + SetSignalMask(SIG_WALK) + Turn(base, x_axis, math.rad(5), math.rad(395)) Turn(cod, x_axis, math.rad(-5), math.rad(395)) - - if (isAiming == false) then - if (leftArm == true ) then + + if isAiming == false then + if leftArm == true then Turn(l_arm, x_axis, math.rad(15), math.rad(395)) Turn(l_arm, y_axis, math.rad(5), math.rad(395)) Turn(l_arm, z_axis, math.rad(10), math.rad(395)) Turn(l_forearm, x_axis, math.rad(-50), math.rad(395)) end - if (rightArm == true ) then + if rightArm == true then Turn(r_arm, x_axis, math.rad(15), math.rad(395)) Turn(r_arm, y_axis, math.rad(-5), math.rad(395)) Turn(r_arm, z_axis, math.rad(-10), math.rad(395)) Turn(r_forearm, x_axis, math.rad(-50), math.rad(395)) end end - + Turn(right_l, x_axis, math.rad(-24), math.rad(235)) - Turn(right_l, y_axis, math.rad(-10), math.rad(135)) + Turn(right_l, y_axis, math.rad(-10), math.rad(135)) Turn(right_l, z_axis, math.rad(-20), math.rad(135)) - + Turn(left_l, x_axis, math.rad(-24), math.rad(235)) - Turn(left_l, y_axis, math.rad(10), math.rad(135)) + Turn(left_l, y_axis, math.rad(10), math.rad(135)) Turn(left_l, z_axis, math.rad(20), math.rad(135)) - + Turn(shin_l, x_axis, math.rad(45), math.rad(235)) Turn(shin_r, x_axis, math.rad(45), math.rad(230)) Turn(foot_l, x_axis, math.rad(-11), math.rad(395)) Turn(foot_l, y_axis, math.rad(10), math.rad(130)) Turn(foot_l, z_axis, math.rad(-20), math.rad(130)) - + Turn(foot_r, x_axis, math.rad(-11), math.rad(395)) Turn(foot_r, y_axis, math.rad(-10), math.rad(130)) Turn(foot_r, z_axis, math.rad(20), math.rad(130)) @@ -215,14 +215,14 @@ end function FixArms(leftflag, rightflag) Turn(l_arm, z_axis, 0, math.rad(395)) Turn(r_arm, z_axis, 0, math.rad(395)) - - if (leftflag == true ) then + + if leftflag == true then Turn(l_arm, x_axis, 0, math.rad(395)) Turn(l_arm, y_axis, 0, math.rad(395)) Turn(l_forearm, x_axis, 0, math.rad(395)) end - if (rightflag == true ) then + if rightflag == true then Turn(r_arm, x_axis, 0, math.rad(395)) Turn(r_arm, y_axis, 0, math.rad(395)) @@ -233,8 +233,8 @@ end function Dash(leftflag, rightflag) Turn(head, x_axis, math.rad(-20), math.rad(395)) Turn(cod, x_axis, math.rad(20), math.rad(395)) - - if (isAiming == false) then + + if isAiming == false then Turn(l_arm, x_axis, math.rad(30), math.rad(395)) Turn(l_arm, y_axis, math.rad(10), math.rad(395)) Turn(l_forearm, x_axis, math.rad(-45), math.rad(395)) @@ -243,16 +243,16 @@ function Dash(leftflag, rightflag) Turn(r_arm, y_axis, math.rad(-10), math.rad(395)) Turn(r_forearm, x_axis, math.rad(-45), math.rad(395)) end - + Turn(right_l, x_axis, math.rad(-50), math.rad(235)) - + Turn(left_l, x_axis, math.rad(40), math.rad(235)) - + Turn(shin_l, x_axis, 0, math.rad(235)) Turn(shin_r, x_axis, math.rad(90), math.rad(230)) Turn(foot_l, x_axis, math.rad(20), math.rad(395)) - + Turn(foot_r, x_axis, math.rad(20), math.rad(395)) Sleep(50) @@ -260,32 +260,32 @@ end function AmIBored() --[[Spring.Echo("isAiming: " , isAiming, "isBuilding: " , isBuilding, - "isAiming == false and isBuilding == false", isAiming == false and isBuilding == false)]]-- + "isAiming == false and isBuilding == false", isAiming == false and isBuilding == false)]] + -- return isAiming == false and isBuilding == false and isMoving == false end function LookAround() - while true do if AmIBored() then Turn(base, y_axis, 0, 5) - - local randomRotDegrees = math.random(10, 50) - local randomRotRadians = math.rad(randomRotDegrees) - randomAnim = math.random(1, 3) + + local randomRotDegrees = math.random(10, 50) + local randomRotRadians = math.rad(randomRotDegrees) + randomAnim = math.random(1, 3) --Spring.Echo("LookAround",isMoving, randomAnim, AmIBored()) - if randomAnim >= 2 and AmIBored() then - Turn(base, y_axis, randomRotRadians, 0.34*randomAnim) - Turn(head, y_axis, randomRotRadians/2, 0.18*randomAnim) + if randomAnim >= 2 and AmIBored() then + Turn(base, y_axis, randomRotRadians, 0.34 * randomAnim) + Turn(head, y_axis, randomRotRadians / 2, 0.18 * randomAnim) Sleep(400) end - + if randomAnim == 2 and AmIBored() then - if (isAiming == false and isMoving == false) then - Turn(r_arm, x_axis, -1.1, randomRotDegrees/10) + if isAiming == false and isMoving == false then + Turn(r_arm, x_axis, -1.1, randomRotDegrees / 10) Turn(l_arm, x_axis, 0.1, 2) Sleep(400) - end + end else Turn(r_arm, x_axis, -0.15, 0.18) Turn(l_arm, x_axis, 0.1, 2) @@ -293,22 +293,22 @@ function LookAround() end if randomAnim <= 2 and AmIBored() then - Turn(base, y_axis, -randomRotRadians, 0.34*randomAnim) - Turn(head, y_axis, -randomRotRadians/2, 0.18*randomAnim) + Turn(base, y_axis, -randomRotRadians, 0.34 * randomAnim) + Turn(head, y_axis, -randomRotRadians / 2, 0.18 * randomAnim) Sleep(400) end if AmIBored() then Sleep(500) end - + if randomAnim == 1 and AmIBored() then Turn(r_arm, x_axis, 0.1, 2) - Turn(l_arm, x_axis, -randomRotDegrees/95, randomRotDegrees/20) + Turn(l_arm, x_axis, -randomRotDegrees / 95, randomRotDegrees / 20) Sleep(400) else if randomAnim == 2 then - Turn(r_arm, x_axis, 0.1, 0.1) + Turn(r_arm, x_axis, 0.1, 0.1) else Turn(r_arm, x_axis, 0.1, 0.5) end @@ -316,8 +316,8 @@ function LookAround() Sleep(500) end Sleep(600) - else-- not aiming, not building oh lawd! - Sleep(600) + else -- not aiming, not building oh lawd! + Sleep(600) end end end diff --git a/scripts/mines_lus.lua b/scripts/mines_lus.lua index 409641faf74..4c316cdb8b4 100644 --- a/scripts/mines_lus.lua +++ b/scripts/mines_lus.lua @@ -1,4 +1,3 @@ - local base = piece("base") local unitDefID = Spring.GetUnitDefID(unitID) local triggerRange = tonumber(UnitDefs[unitDefID].customParams.detonaterange) or 64 @@ -12,19 +11,19 @@ local math_sqrt = math.sqrt function GetClosestEnemyDistance() targetID = Spring.GetUnitNearestEnemy(unitID, triggerRange) if targetID then - local tx,ty,tz = Spring.GetUnitPosition(targetID) - local dis = distance(ux,uy,uz,tx,ty,tz) + local tx, ty, tz = Spring.GetUnitPosition(targetID) + local dis = distance(ux, uy, uz, tx, ty, tz) return dis else return math.huge end end -function distance(x1,y1,z1,x2,y2,z2) - local x = (x1-x2) - local y = (y1-y2) - local z = (z1-z2) - local dist = math_sqrt(x*x + y*y + z*z) +function distance(x1, y1, z1, x2, y2, z2) + local x = (x1 - x2) + local y = (y1 - y2) + local z = (z1 - z2) + local dist = math_sqrt(x * x + y * y + z * z) return dist end @@ -40,11 +39,10 @@ function script.AimFromWeapon() return base end -function script.FireWeapon() -end +function script.FireWeapon() end function script.Create() - ux,uy,uz = Spring.GetUnitPosition(unitID) + ux, uy, uz = Spring.GetUnitPosition(unitID) StartThread(EnemyDetect) end @@ -52,7 +50,7 @@ function EnemyDetect() while true do local inProgress = Spring.GetUnitIsBeingBuilt(unitID) local firestate = Spring.GetUnitStates(unitID, false) - local stunned = Spring.GetUnitIsStunned (unitID) + local stunned = Spring.GetUnitIsStunned(unitID) if not inProgress and firestate and firestate > 0 and GetClosestEnemyDistance() <= triggerRange and not stunned then StartThread(Detonate) break @@ -69,4 +67,4 @@ end function script.Killed() return 3 -end \ No newline at end of file +end diff --git a/scripts/xmasball.lua b/scripts/xmasball.lua index ea05b4215a3..3a2a386baa4 100644 --- a/scripts/xmasball.lua +++ b/scripts/xmasball.lua @@ -1,10 +1,10 @@ -local base = piece "base" +local base = piece("base") local f = 0 function script.Create() - Turn (base, x_axis, math.random()*360, 90) - Turn (base, y_axis, math.random()*360, 90) - Turn (base, z_axis, math.random()*360, 90) + Turn(base, x_axis, math.random() * 360, 90) + Turn(base, y_axis, math.random() * 360, 90) + Turn(base, z_axis, math.random() * 360, 90) end function Sink() @@ -17,4 +17,4 @@ function MoveDown() f = f - 0.04 Sleep(1) end -end \ No newline at end of file +end diff --git a/shaders/GLSL/infoLOS.lua b/shaders/GLSL/infoLOS.lua index 4c6629e2a50..a0b780b4d56 100644 --- a/shaders/GLSL/infoLOS.lua +++ b/shaders/GLSL/infoLOS.lua @@ -111,9 +111,9 @@ return { ]], uniformFloat = { alwaysColor = alwaysColor, - losColor = losColor, + losColor = losColor, radarColor1 = radarColor, - jamColor = jamColor, + jamColor = jamColor, radarColor2 = radarColor2, }, uniformInt = { diff --git a/shaders/GLSL/infoMetal.lua b/shaders/GLSL/infoMetal.lua index e8dd01dab7c..7a149ac4156 100644 --- a/shaders/GLSL/infoMetal.lua +++ b/shaders/GLSL/infoMetal.lua @@ -18,7 +18,8 @@ LoadFromLua(Shader::IProgramObject* program, const std::string& filename) for k,v in pairs(Spring) do Spring.Echo(k,v) end -]]-- +]] +-- -- Author: Beherith (mysterme@gmail.com) diff --git a/singleplayer/scenarios/scenario001.lua b/singleplayer/scenarios/scenario001.lua index f5c1c709af9..b30ea5f6c49 100644 --- a/singleplayer/scenarios/scenario001.lua +++ b/singleplayer/scenarios/scenario001.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 1, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "supcrossingvsbarbs001", -- no spaces, lowercase, this will be used to save the score - version = "1", -- increment this to keep the score when changing a mission - title = "Outsmart the Barbarians", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario001.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Rocks can contain a lot of metal...", -- This text will be drawn over image - summary = [[Three aggressive barbarians have landed in the top right corner of the map. Neutralize them.]], -briefing = [[Fortify your side of the crossing as soon as possible, before the hordes start moving across. All units can pass through the central shallow isthmus, with the notable exception of Ticks. The shallow water connects the two seas, and control over the vast amount of metal they hold is key to victory. + index = 1, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "supcrossingvsbarbs001", -- no spaces, lowercase, this will be used to save the score + version = "1", -- increment this to keep the score when changing a mission + title = "Outsmart the Barbarians", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario001.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Rocks can contain a lot of metal...", -- This text will be drawn over image + summary = [[Three aggressive barbarians have landed in the top right corner of the map. Neutralize them.]], + briefing = [[Fortify your side of the crossing as soon as possible, before the hordes start moving across. All units can pass through the central shallow isthmus, with the notable exception of Ticks. The shallow water connects the two seas, and control over the vast amount of metal they hold is key to victory. Score: 1. Speed: destroy the enemy Commanders as fast as possible. @@ -17,52 +17,52 @@ Tips: 1. The map contains many rocks, reclaim them for metal to quickly progress. ]], - mapfilename = "Supreme_Crossing_V1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "25%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "75%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 3000, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 8, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , - - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "supcrossingvsbarbs001", + mapfilename = "Supreme_Crossing_V1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "25%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "75%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 3000, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 8, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, + + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "supcrossingvsbarbs001", disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- The following keys MUST be present in startscript below - -- __SCENARIOOPTIONS__ - -- __PLAYERNAME__ - -- __BARVERSION__ - -- __MAPNAME__ - - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ - - startscript = [[[Game] + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- The following keys MUST be present in startscript below + -- __SCENARIOOPTIONS__ + -- __PLAYERNAME__ + -- __BARVERSION__ + -- __MAPNAME__ + + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ + + startscript = [[[Game] { [allyTeam0] { @@ -179,7 +179,6 @@ Tips: } } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario002.lua b/singleplayer/scenarios/scenario002.lua index 8e0075e13a1..303e35331f2 100644 --- a/singleplayer/scenarios/scenario002.lua +++ b/singleplayer/scenarios/scenario002.lua @@ -1,43 +1,43 @@ local scenariodata = { - index = 999, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "dguntestscenario", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "DGunning the enemy Commander", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario002.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "In a 1v1 situation, the first to DGun dies.", -- This text will be drawn over image - summary = [[How Does DGunning enemy Commander work? Try it here.]], - briefing = [[In order to preven unfair situations in multiplayer games when the victory conditions are to destroy all enemy Commanders, DGunning the last standing enemy Commander is forbidden. If the last enemy Commander is dgunned, the team who DGunned the last Commander loses, instead of the team who got DGunned. + index = 999, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "dguntestscenario", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "DGunning the enemy Commander", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario002.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "In a 1v1 situation, the first to DGun dies.", -- This text will be drawn over image + summary = [[How Does DGunning enemy Commander work? Try it here.]], + briefing = [[In order to preven unfair situations in multiplayer games when the victory conditions are to destroy all enemy Commanders, DGunning the last standing enemy Commander is forbidden. If the last enemy Commander is dgunned, the team who DGunned the last Commander loses, instead of the team who got DGunned. You will have to resort to other methods of killing the last commands. ]], - mapfilename = "BarR 1.1", -- the name of the map to be displayed here - playerstartx = "50%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 300, -- par time in seconds - parresources = 10000, -- par resource amount - difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - armavp = 0, - coravp = 0, - } , + mapfilename = "BarR 1.1", -- the name of the map to be displayed here + playerstartx = "50%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 300, -- par time in seconds + parresources = 10000, -- par resource amount + difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + armavp = 0, + coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "dguntestscenario", --must be present for scores + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "dguntestscenario", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ [Game] + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] { @@ -117,7 +117,6 @@ local scenariodata = { } } ]], - } return nil -- scenariodata diff --git a/singleplayer/scenarios/scenario003.lua b/singleplayer/scenarios/scenario003.lua index 0b30881e084..dcc792959b9 100644 --- a/singleplayer/scenarios/scenario003.lua +++ b/singleplayer/scenarios/scenario003.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 2, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "threebarbscomet", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "Catch those rare Comets", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario003.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "", -- This text will be drawn over image - summary = [[Destroy three Barbarian AI's on large, metal rich flat map.]], - briefing = [[This scenario is a true test of a players skill, only the very few top players can handle three Barbarian AI players on such a metal-rich map. If you win this scenario on at least Normal difficulty, dont forget to post your replay on our Discord server for bragging rights. + index = 2, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "threebarbscomet", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "Catch those rare Comets", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario003.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "", -- This text will be drawn over image + summary = [[Destroy three Barbarian AI's on large, metal rich flat map.]], + briefing = [[This scenario is a true test of a players skill, only the very few top players can handle three Barbarian AI players on such a metal-rich map. If you win this scenario on at least Normal difficulty, dont forget to post your replay on our Discord server for bragging rights. Tips: - One of the three AI's will likely start with an Aircraft plant @@ -19,37 +19,37 @@ Tips: Good luck, you will need all your skill here! ]], - mapfilename = "Comet Catcher Remake 1.8", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "40%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 10, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - -- armavp = 0, -- disables arm advanced vehicle plant - -- coravp = 0, - } , - - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "threebarbscomet", + mapfilename = "Comet Catcher Remake 1.8", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "40%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 10, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + -- armavp = 0, -- disables arm advanced vehicle plant + -- coravp = 0, + }, + + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "threebarbscomet", disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] diff --git a/singleplayer/scenarios/scenario004.lua b/singleplayer/scenarios/scenario004.lua index dd7b7f7427a..884d639b9d1 100644 --- a/singleplayer/scenarios/scenario004.lua +++ b/singleplayer/scenarios/scenario004.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 3, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "tma20ffabarbs", -- no spaces, lowercase, this will be used to save the score - version = "1", -- increment this to keep the score when changing a mission - title = "One by One", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario004.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "You can hide behind radar jammers.", -- This text will be drawn over image - summary = [[Competition for resources has never been this intense. Eliminate all 7 of your enemies in a free-for-all battle.]], - briefing = [[The Tycho Magnetic Anomaly 20 asteroid is very rich in resources, and has attracted the attention of your competition. There are a total of 7 enemy commanders on this map, all hell bent on destroying any opposition. Even cloaked Commanders emit a radar signature, but radar jammers can hide that as well. Armada's Sneaky Pete (Cloakable Radar Jammer Tower) can ensure that you dont fall victim to any surprise attacks. + index = 3, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "tma20ffabarbs", -- no spaces, lowercase, this will be used to save the score + version = "1", -- increment this to keep the score when changing a mission + title = "One by One", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario004.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "You can hide behind radar jammers.", -- This text will be drawn over image + summary = [[Competition for resources has never been this intense. Eliminate all 7 of your enemies in a free-for-all battle.]], + briefing = [[The Tycho Magnetic Anomaly 20 asteroid is very rich in resources, and has attracted the attention of your competition. There are a total of 7 enemy commanders on this map, all hell bent on destroying any opposition. Even cloaked Commanders emit a radar signature, but radar jammers can hide that as well. Armada's Sneaky Pete (Cloakable Radar Jammer Tower) can ensure that you dont fall victim to any surprise attacks. Score: 1. Speed: destroy all enemy Commanders as fast as possible. @@ -22,51 +22,51 @@ Tips: 6. Sieze any opportunity to score a kill on an enemy Commander, and try to kill at least one Commander before advancing your tech tree. Use the metal from the spoils to quickly tech up. ]], - mapfilename = "TMA20X 1.8", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "75%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "30%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , - - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "tma20ffabarbs", + mapfilename = "TMA20X 1.8", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "75%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "30%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, + + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "tma20ffabarbs", disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- The following keys MUST be present in startscript below - -- __SCENARIOOPTIONS__ - -- __PLAYERNAME__ - -- __BARVERSION__ - -- __MAPNAME__ - - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ - - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- The following keys MUST be present in startscript below + -- __SCENARIOOPTIONS__ + -- __PLAYERNAME__ + -- __BARVERSION__ + -- __MAPNAME__ + + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ + + startscript = [[ [Game] { [allyTeam4] diff --git a/singleplayer/scenarios/scenario005.lua b/singleplayer/scenarios/scenario005.lua index b1fbbbd7645..4a6e83a3777 100644 --- a/singleplayer/scenarios/scenario005.lua +++ b/singleplayer/scenarios/scenario005.lua @@ -2,15 +2,15 @@ -- Author: Zow local scenariodata = { - index = 5, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "stealtech005", -- no spaces, lowercase, this will be used to save the score - version = "1", -- increment this to keep the score when changing a mission - title = "Steal Cortex's Tech!", -- can be anything - author = "Zow", -- your name here - imagepath = "scenario005.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "", -- This text will be drawn over image - summary = [[Your Armada commander lost the blueprints to most factories and units. Oops! But perhaps your Cortex enemy has a solution for you...]], - briefing = [[In this challenge, most Armada combat units and factories are disabled. Use your Commander and static defenses to hold your frontline and your expansions. Find and resurrect an enemy constructor to build combat units. Resurrection Bots (Cortex Graverobber and Armada Lazarus) can resurrect and repair units, but cannot build structures. They are also stealthy, so they dont show up on the enemy's radar. Use your commander's d-gun wisely, as it completely destroys units, including their wrecks. Use terrain to your advantage when playing defensively. + index = 5, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "stealtech005", -- no spaces, lowercase, this will be used to save the score + version = "1", -- increment this to keep the score when changing a mission + title = "Steal Cortex's Tech!", -- can be anything + author = "Zow", -- your name here + imagepath = "scenario005.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "", -- This text will be drawn over image + summary = [[Your Armada commander lost the blueprints to most factories and units. Oops! But perhaps your Cortex enemy has a solution for you...]], + briefing = [[In this challenge, most Armada combat units and factories are disabled. Use your Commander and static defenses to hold your frontline and your expansions. Find and resurrect an enemy constructor to build combat units. Resurrection Bots (Cortex Graverobber and Armada Lazarus) can resurrect and repair units, but cannot build structures. They are also stealthy, so they dont show up on the enemy's radar. Use your commander's d-gun wisely, as it completely destroys units, including their wrecks. Use terrain to your advantage when playing defensively. Score: 1. Speed: destroy the enemy Commander as fast as possible. @@ -23,64 +23,64 @@ Tips: 4. You will be forced onto the Armada side. Try to get your hands on Cortex technology if possible! ]], - mapfilename = "BarR 1.1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 3000, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it - --armavp = 0, - --coravp = 0, - armaap=0, - armalab=0, - armap=0, - armavp=0, - armhp=0, - armshltx=0, - armvp=0, - armflea=0, - armham=0, - armjeth=0, - armpw=0, - armrock=0, - armwar=0, - } , + mapfilename = "BarR 1.1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 3000, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it + --armavp = 0, + --coravp = 0, + armaap = 0, + armalab = 0, + armap = 0, + armavp = 0, + armhp = 0, + armshltx = 0, + armvp = 0, + armflea = 0, + armham = 0, + armjeth = 0, + armpw = 0, + armrock = 0, + armwar = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "stealtech005", - disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "stealtech005", + disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- The following keys MUST be present in startscript below - -- __SCENARIOOPTIONS__ - -- __PLAYERNAME__ - -- __BARVERSION__ - -- __MAPNAME__ + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- The following keys MUST be present in startscript below + -- __SCENARIOOPTIONS__ + -- __PLAYERNAME__ + -- __BARVERSION__ + -- __MAPNAME__ - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[Game] + startscript = [[[Game] { [allyTeam0] { @@ -154,7 +154,6 @@ Tips: } } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario006.lua b/singleplayer/scenarios/scenario006.lua index 3979d5afabf..6d29a6651db 100644 --- a/singleplayer/scenarios/scenario006.lua +++ b/singleplayer/scenarios/scenario006.lua @@ -2,15 +2,15 @@ -- Author: Zow local scenariodata = { - index = 6, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "twobarbspwakonly006", -- no spaces, lowercase, this will be used to save the score - version = "1", -- increment this to keep the score when changing a mission - title = "Infantry Simulator", -- can be anything - author = "Zow", -- your name here - imagepath = "scenario006.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "You can resurrect your fallen infantry units", -- This text will be drawn over image - summary = [[Defeat two hostile but primitive Barbarians with nothing but your own primitive infantry.]], - briefing = [[Both you and your enemy may only make infantry units. Since you're up against a larger enemy, be sure to expand quickly and reclaim/resurrect effectively to maintain an advantage. Don't forget to raid the enemy! + index = 6, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "twobarbspwakonly006", -- no spaces, lowercase, this will be used to save the score + version = "1", -- increment this to keep the score when changing a mission + title = "Infantry Simulator", -- can be anything + author = "Zow", -- your name here + imagepath = "scenario006.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "You can resurrect your fallen infantry units", -- This text will be drawn over image + summary = [[Defeat two hostile but primitive Barbarians with nothing but your own primitive infantry.]], + briefing = [[Both you and your enemy may only make infantry units. Since you're up against a larger enemy, be sure to expand quickly and reclaim/resurrect effectively to maintain an advantage. Don't forget to raid the enemy! Score: 1. Speed: destroy the enemy Commanders as fast as possible. @@ -23,58 +23,58 @@ Tips: 4. Grunts have more range than Pawns, but less damage for their cost. Both have their strengths and weaknesses! ]], - mapfilename = "Red Comet Remake 1.8", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 7, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - --armavp = 0, - --coravp = 0, - armaap=0, - armalab=0, - armap=0, - armavp=0, - armhp=0, - armshltx=0, - armvp=0, - armflea=0, - armham=0, - armjeth=0, - armrock=0, - armwar=0, - coraap=0, - coralab=0, - corap=0, - coravp=0, - corhp=0, - corgant=0, - corvp=0, - corcrash=0, - corstorm=0, - corthud=0, - } , + mapfilename = "Red Comet Remake 1.8", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 7, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + --armavp = 0, + --coravp = 0, + armaap = 0, + armalab = 0, + armap = 0, + armavp = 0, + armhp = 0, + armshltx = 0, + armvp = 0, + armflea = 0, + armham = 0, + armjeth = 0, + armrock = 0, + armwar = 0, + coraap = 0, + coralab = 0, + corap = 0, + coravp = 0, + corhp = 0, + corgant = 0, + corvp = 0, + corcrash = 0, + corstorm = 0, + corthud = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "twobarbspwakonly006", - disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "twobarbspwakonly006", + disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] diff --git a/singleplayer/scenarios/scenario007.lua b/singleplayer/scenarios/scenario007.lua index 8f29c14601f..5a0e4500f0e 100644 --- a/singleplayer/scenarios/scenario007.lua +++ b/singleplayer/scenarios/scenario007.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 7, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "acidicquarrybarbs", -- no spaces, lowercase, this will be used to save the score - version = "1", -- increment this to keep the score when changing a mission - title = "The Sky is the Limit", -- can be anything - author = "BasiC", - imagepath = "scenario007.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Acidic water damages any unit coming into contact with it", -- This text will be drawn over image - summary = [[Acidic rains prevent any land or sea units, so you must take to the skies to defeat two enemy Commanders. The acidic environment also prevent use of the usual anti-air defensive turrets. Bomb your way to victory.]], - briefing = [[ + index = 7, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "acidicquarrybarbs", -- no spaces, lowercase, this will be used to save the score + version = "1", -- increment this to keep the score when changing a mission + title = "The Sky is the Limit", -- can be anything + author = "BasiC", + imagepath = "scenario007.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Acidic water damages any unit coming into contact with it", -- This text will be drawn over image + summary = [[Acidic rains prevent any land or sea units, so you must take to the skies to defeat two enemy Commanders. The acidic environment also prevent use of the usual anti-air defensive turrets. Bomb your way to victory.]], + briefing = [[ The environmental conditions prevent the use of your mainstay army options, so plan your aircraft raids on the enemy platforms wisely. @@ -26,33 +26,33 @@ Scoring: 1. Speed: destroy the enemy Commanders as fast as possible. 2. Efficiency: minimize the amount of metal and energy used. ]], - mapfilename = "AcidicQuarry 5.16", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "15%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "75%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, + mapfilename = "AcidicQuarry 5.16", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "15%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "75%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 means disable it -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, armcir = 0, - armferret = 0, - armflak = 0, - armmercury = 0, - armrl = 0, - armalab = 0, + armferret = 0, + armflak = 0, + armmercury = 0, + armrl = 0, + armalab = 0, armavp = 0, armhp = 0, armlab = 0, @@ -69,30 +69,30 @@ Scoring: corhp = 0, corlab = 0, corvp = 0, - } , + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "acidicquarrybarbs", + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "acidicquarrybarbs", disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- The following keys MUST be present in startscript below - -- __SCENARIOOPTIONS__ - -- __PLAYERNAME__ - -- __BARVERSION__ - -- __MAPNAME__ - - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ - - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- The following keys MUST be present in startscript below + -- __SCENARIOOPTIONS__ + -- __PLAYERNAME__ + -- __BARVERSION__ + -- __MAPNAME__ + + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ + + startscript = [[ [Game] { [allyTeam0] diff --git a/singleplayer/scenarios/scenario008.lua b/singleplayer/scenarios/scenario008.lua index 02d74a42fd5..dd4ceb4a037 100644 --- a/singleplayer/scenarios/scenario008.lua +++ b/singleplayer/scenarios/scenario008.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 8, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "Fallendellheadstart008", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "A Head Start", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario008.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Your starting base", -- This text will be drawn over image - summary = [[An enemy Commander has set up operations on Fallendell, where you already have a strong presence. Prevent him from taking further territory.]], - briefing = [[You will start with a small base of operations, and a considerable amount of resources. Use your initial scouting units to locate the enemy commander and liquidate him before he gains a foothold. + index = 8, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "Fallendellheadstart008", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "A Head Start", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario008.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Your starting base", -- This text will be drawn over image + summary = [[An enemy Commander has set up operations on Fallendell, where you already have a strong presence. Prevent him from taking further territory.]], + briefing = [[You will start with a small base of operations, and a considerable amount of resources. Use your initial scouting units to locate the enemy commander and liquidate him before he gains a foothold. Tips: @@ -28,37 +28,37 @@ Scoring: ]], - mapfilename = "Fallendell_V4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "20%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "20%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 3000, -- par time in seconds (time a mission is expected to take on average) - parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all enemy construction units", -- This is plaintext, but should be reflected in startscript - losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "Fallendell_V4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "20%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "20%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 3000, -- par time in seconds (time a mission is expected to take on average) + parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all enemy construction units", -- This is plaintext, but should be reflected in startscript + losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "Fallendellheadstart008", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "Fallendellheadstart008", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -68,121 +68,120 @@ Scoring: -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - {name = 'corcom', x = 5393, y = 52, z = 2270, rot = -8148 , team = 1}, - {name = 'armcom', x = 1657, y = 154, z = 836, rot = 22554 , team = 0}, - {name = 'cormex', x = 5816, y = 4, z = 3032, rot = 0 , team = 1}, - {name = 'armmex', x = 1048, y = 154, z = 952, rot = 16384 , team = 0}, - {name = 'cormex', x = 5992, y = 4, z = 2808, rot = 0 , team = 1}, - {name = 'armmex', x = 1288, y = 154, z = 984, rot = 16384 , team = 0}, - {name = 'armsolar', x = 1032, y = 154, z = 888, rot = 16384 , team = 0}, - {name = 'armmex', x = 1176, y = 154, z = 680, rot = 16384 , team = 0}, - {name = 'armwin', x = 1080, y = 154, z = 792, rot = 16384 , team = 0}, - {name = 'armwin', x = 1032, y = 154, z = 792, rot = 16384 , team = 0}, - {name = 'cormex', x = 5944, y = 51, z = 2040, rot = 0 , team = 1}, - {name = 'armwin', x = 984, y = 154, z = 792, rot = 16384 , team = 0}, - {name = 'armwin', x = 984, y = 154, z = 744, rot = 16384 , team = 0}, - {name = 'corsolar', x = 5688, y = 52, z = 2168, rot = -16384 , team = 1}, - {name = 'armwin', x = 1032, y = 154, z = 744, rot = 16384 , team = 0}, - {name = 'armwin', x = 1080, y = 154, z = 744, rot = 16384 , team = 0}, - {name = 'corlab', x = 5696, y = 52, z = 2000, rot = 32767 , team = 1}, - {name = 'armlab', x = 1280, y = 154, z = 832, rot = 16384 , team = 0}, - {name = 'armflea', x = 1180, y = 161, z = 1137, rot = -16814 , team = 0}, - {name = 'corwin', x = 5784, y = 52, z = 2008, rot = 32767 , team = 1}, - {name = 'armck', x = 2294, y = 52, z = 2245, rot = 7150 , team = 0}, - {name = 'corwin', x = 5784, y = 52, z = 1864, rot = 32767 , team = 1}, - {name = 'corwin', x = 5816, y = 52, z = 2120, rot = 0 , team = 1}, - {name = 'armllt', x = 992, y = 157, z = 1008, rot = 16384 , team = 0}, - {name = 'armck', x = 243, y = 4, z = 2187, rot = -7164 , team = 0}, - {name = 'corsolar', x = 5640, y = 52, z = 1864, rot = -16384 , team = 1}, - {name = 'armllt', x = 1424, y = 154, z = 624, rot = 16384 , team = 0}, - {name = 'armpw', x = 1399, y = 154, z = 773, rot = -22048 , team = 0}, - {name = 'armwin', x = 1352, y = 154, z = 648, rot = 16384 , team = 0}, - {name = 'armwin', x = 1304, y = 154, z = 648, rot = 16384 , team = 0}, - {name = 'armpw', x = 1397, y = 154, z = 846, rot = 30828 , team = 0}, - {name = 'armwin', x = 1256, y = 154, z = 648, rot = 16384 , team = 0}, - {name = 'armmex', x = 2472, y = 101, z = 248, rot = 16384 , team = 0}, - {name = 'armpw', x = 1389, y = 154, z = 915, rot = 30522 , team = 0}, - {name = 'armwin', x = 1256, y = 154, z = 600, rot = 16384 , team = 0}, - {name = 'armmex', x = 1288, y = 52, z = 1368, rot = 16384 , team = 0}, - {name = 'armwin', x = 1304, y = 154, z = 600, rot = 16384 , team = 0}, - {name = 'armck', x = 1048, y = 154, z = 842, rot = -15558 , team = 0}, - {name = 'corwin', x = 5912, y = 52, z = 1864, rot = 16384 , team = 1}, - {name = 'armwin', x = 1352, y = 154, z = 600, rot = 16384 , team = 0}, - {name = 'armllt', x = 2576, y = 101, z = 320, rot = 16384 , team = 0}, - {name = 'cormakr', x = 5704, y = 52, z = 1832, rot = 32767 , team = 1}, - {name = 'armllt', x = 1296, y = 52, z = 1456, rot = 16384 , team = 0}, - {name = 'armck', x = 1385, y = 154, z = 611, rot = -25716 , team = 0}, - {name = 'armck', x = 1082, y = 155, z = 538, rot = 1161 , team = 0}, - {name = 'cormakr', x = 5960, y = 53, z = 2120, rot = 16384 , team = 1}, - {name = 'cormakr', x = 5640, y = 52, z = 1720, rot = 32767 , team = 1}, - {name = 'armck', x = 3359, y = 52, z = 769, rot = 15796 , team = 0}, - {name = 'armnanotc', x = 1160, y = 154, z = 776, rot = 16384 , team = 0}, - {name = 'armmex', x = 2248, y = 52, z = 2264, rot = 16384 , team = 0}, - {name = 'corsolar', x = 5576, y = 52, z = 2008, rot = -16384 , team = 1}, - {name = 'armpw', x = 1396, y = 154, z = 699, rot = -17280 , team = 0}, - {name = 'armwin', x = 1352, y = 208, z = 216, rot = 16384 , team = 0}, - {name = 'armllt', x = 2368, y = 52, z = 2336, rot = 16384 , team = 0}, - {name = 'corhlt', x = 5280, y = 70, z = 2016, rot = -16384 , team = 1}, - {name = 'armmex', x = 392, y = 5, z = 2088, rot = 16384 , team = 0}, - {name = 'cormex', x = 5112, y = 101, z = 1544, rot = 0 , team = 1}, - {name = 'armwin', x = 1304, y = 208, z = 216, rot = 16384 , team = 0}, - {name = 'armnanotc', x = 1160, y = 154, z = 856, rot = 16384 , team = 0}, - {name = 'corsolar', x = 5288, y = 52, z = 2136, rot = 0 , team = 1}, - {name = 'armrad', x = 2352, y = 52, z = 2224, rot = 16384 , team = 0}, - {name = 'armnanotc', x = 1160, y = 154, z = 936, rot = 16384 , team = 0}, - {name = 'armwin', x = 1256, y = 208, z = 216, rot = 16384 , team = 0}, - {name = 'armmex', x = 168, y = 4, z = 2280, rot = 16384 , team = 0}, - {name = 'armwin', x = 1208, y = 208, z = 216, rot = 16384 , team = 0}, - {name = 'armllt', x = 336, y = 5, z = 2240, rot = 16384 , team = 0}, - {name = 'corwin', x = 6120, y = 52, z = 1864, rot = 16384 , team = 1}, - {name = 'armwin', x = 1160, y = 209, z = 216, rot = 16384 , team = 0}, - {name = 'cormex', x = 5048, y = 101, z = 1320, rot = 0 , team = 1}, - {name = 'armflea', x = 1147, y = 160, z = 1131, rot = -10036 , team = 0}, - {name = 'armflea', x = 1203, y = 164, z = 1155, rot = -7163 , team = 0}, - {name = 'armrad', x = 208, y = 4, z = 2144, rot = 16384 , team = 0}, - {name = 'armflea', x = 1249, y = 162, z = 1142, rot = -14099 , team = 0}, - {name = 'armwin', x = 1112, y = 209, z = 216, rot = 16384 , team = 0}, - {name = 'cormstor', x = 5992, y = 52, z = 1864, rot = -16384 , team = 1}, - {name = 'armrad', x = 1328, y = 154, z = 928, rot = 16384 , team = 0}, - {name = 'armmex', x = 3096, y = 52, z = 728, rot = 16384 , team = 0}, - {name = 'armllt', x = 1408, y = 157, z = 1088, rot = 16384 , team = 0}, - {name = 'armrl', x = 1304, y = 155, z = 520, rot = 16384 , team = 0}, - {name = 'armrl', x = 1128, y = 155, z = 1016, rot = 16384 , team = 0}, - {name = 'corak', x = 5697, y = 52, z = 1720, rot = -29165 , team = 1}, - {name = 'armrl', x = 920, y = 154, z = 856, rot = 16384 , team = 0}, - --{name = 'armestor', x = 1096, y = 154, z = 664, rot = 16384 , team = 0}, - {name = 'corthud', x = 5744, y = 52, z = 1790, rot = -32739 , team = 1}, - {name = 'armmex', x = 3480, y = 52, z = 776, rot = 16384 , team = 0}, - {name = 'corrad', x = 5296, y = 53, z = 2368, rot = 0 , team = 1}, - {name = 'corak', x = 5698, y = 52, z = 1998, rot = 32767 , team = 1}, - + { name = "corcom", x = 5393, y = 52, z = 2270, rot = -8148, team = 1 }, + { name = "armcom", x = 1657, y = 154, z = 836, rot = 22554, team = 0 }, + { name = "cormex", x = 5816, y = 4, z = 3032, rot = 0, team = 1 }, + { name = "armmex", x = 1048, y = 154, z = 952, rot = 16384, team = 0 }, + { name = "cormex", x = 5992, y = 4, z = 2808, rot = 0, team = 1 }, + { name = "armmex", x = 1288, y = 154, z = 984, rot = 16384, team = 0 }, + { name = "armsolar", x = 1032, y = 154, z = 888, rot = 16384, team = 0 }, + { name = "armmex", x = 1176, y = 154, z = 680, rot = 16384, team = 0 }, + { name = "armwin", x = 1080, y = 154, z = 792, rot = 16384, team = 0 }, + { name = "armwin", x = 1032, y = 154, z = 792, rot = 16384, team = 0 }, + { name = "cormex", x = 5944, y = 51, z = 2040, rot = 0, team = 1 }, + { name = "armwin", x = 984, y = 154, z = 792, rot = 16384, team = 0 }, + { name = "armwin", x = 984, y = 154, z = 744, rot = 16384, team = 0 }, + { name = "corsolar", x = 5688, y = 52, z = 2168, rot = -16384, team = 1 }, + { name = "armwin", x = 1032, y = 154, z = 744, rot = 16384, team = 0 }, + { name = "armwin", x = 1080, y = 154, z = 744, rot = 16384, team = 0 }, + { name = "corlab", x = 5696, y = 52, z = 2000, rot = 32767, team = 1 }, + { name = "armlab", x = 1280, y = 154, z = 832, rot = 16384, team = 0 }, + { name = "armflea", x = 1180, y = 161, z = 1137, rot = -16814, team = 0 }, + { name = "corwin", x = 5784, y = 52, z = 2008, rot = 32767, team = 1 }, + { name = "armck", x = 2294, y = 52, z = 2245, rot = 7150, team = 0 }, + { name = "corwin", x = 5784, y = 52, z = 1864, rot = 32767, team = 1 }, + { name = "corwin", x = 5816, y = 52, z = 2120, rot = 0, team = 1 }, + { name = "armllt", x = 992, y = 157, z = 1008, rot = 16384, team = 0 }, + { name = "armck", x = 243, y = 4, z = 2187, rot = -7164, team = 0 }, + { name = "corsolar", x = 5640, y = 52, z = 1864, rot = -16384, team = 1 }, + { name = "armllt", x = 1424, y = 154, z = 624, rot = 16384, team = 0 }, + { name = "armpw", x = 1399, y = 154, z = 773, rot = -22048, team = 0 }, + { name = "armwin", x = 1352, y = 154, z = 648, rot = 16384, team = 0 }, + { name = "armwin", x = 1304, y = 154, z = 648, rot = 16384, team = 0 }, + { name = "armpw", x = 1397, y = 154, z = 846, rot = 30828, team = 0 }, + { name = "armwin", x = 1256, y = 154, z = 648, rot = 16384, team = 0 }, + { name = "armmex", x = 2472, y = 101, z = 248, rot = 16384, team = 0 }, + { name = "armpw", x = 1389, y = 154, z = 915, rot = 30522, team = 0 }, + { name = "armwin", x = 1256, y = 154, z = 600, rot = 16384, team = 0 }, + { name = "armmex", x = 1288, y = 52, z = 1368, rot = 16384, team = 0 }, + { name = "armwin", x = 1304, y = 154, z = 600, rot = 16384, team = 0 }, + { name = "armck", x = 1048, y = 154, z = 842, rot = -15558, team = 0 }, + { name = "corwin", x = 5912, y = 52, z = 1864, rot = 16384, team = 1 }, + { name = "armwin", x = 1352, y = 154, z = 600, rot = 16384, team = 0 }, + { name = "armllt", x = 2576, y = 101, z = 320, rot = 16384, team = 0 }, + { name = "cormakr", x = 5704, y = 52, z = 1832, rot = 32767, team = 1 }, + { name = "armllt", x = 1296, y = 52, z = 1456, rot = 16384, team = 0 }, + { name = "armck", x = 1385, y = 154, z = 611, rot = -25716, team = 0 }, + { name = "armck", x = 1082, y = 155, z = 538, rot = 1161, team = 0 }, + { name = "cormakr", x = 5960, y = 53, z = 2120, rot = 16384, team = 1 }, + { name = "cormakr", x = 5640, y = 52, z = 1720, rot = 32767, team = 1 }, + { name = "armck", x = 3359, y = 52, z = 769, rot = 15796, team = 0 }, + { name = "armnanotc", x = 1160, y = 154, z = 776, rot = 16384, team = 0 }, + { name = "armmex", x = 2248, y = 52, z = 2264, rot = 16384, team = 0 }, + { name = "corsolar", x = 5576, y = 52, z = 2008, rot = -16384, team = 1 }, + { name = "armpw", x = 1396, y = 154, z = 699, rot = -17280, team = 0 }, + { name = "armwin", x = 1352, y = 208, z = 216, rot = 16384, team = 0 }, + { name = "armllt", x = 2368, y = 52, z = 2336, rot = 16384, team = 0 }, + { name = "corhlt", x = 5280, y = 70, z = 2016, rot = -16384, team = 1 }, + { name = "armmex", x = 392, y = 5, z = 2088, rot = 16384, team = 0 }, + { name = "cormex", x = 5112, y = 101, z = 1544, rot = 0, team = 1 }, + { name = "armwin", x = 1304, y = 208, z = 216, rot = 16384, team = 0 }, + { name = "armnanotc", x = 1160, y = 154, z = 856, rot = 16384, team = 0 }, + { name = "corsolar", x = 5288, y = 52, z = 2136, rot = 0, team = 1 }, + { name = "armrad", x = 2352, y = 52, z = 2224, rot = 16384, team = 0 }, + { name = "armnanotc", x = 1160, y = 154, z = 936, rot = 16384, team = 0 }, + { name = "armwin", x = 1256, y = 208, z = 216, rot = 16384, team = 0 }, + { name = "armmex", x = 168, y = 4, z = 2280, rot = 16384, team = 0 }, + { name = "armwin", x = 1208, y = 208, z = 216, rot = 16384, team = 0 }, + { name = "armllt", x = 336, y = 5, z = 2240, rot = 16384, team = 0 }, + { name = "corwin", x = 6120, y = 52, z = 1864, rot = 16384, team = 1 }, + { name = "armwin", x = 1160, y = 209, z = 216, rot = 16384, team = 0 }, + { name = "cormex", x = 5048, y = 101, z = 1320, rot = 0, team = 1 }, + { name = "armflea", x = 1147, y = 160, z = 1131, rot = -10036, team = 0 }, + { name = "armflea", x = 1203, y = 164, z = 1155, rot = -7163, team = 0 }, + { name = "armrad", x = 208, y = 4, z = 2144, rot = 16384, team = 0 }, + { name = "armflea", x = 1249, y = 162, z = 1142, rot = -14099, team = 0 }, + { name = "armwin", x = 1112, y = 209, z = 216, rot = 16384, team = 0 }, + { name = "cormstor", x = 5992, y = 52, z = 1864, rot = -16384, team = 1 }, + { name = "armrad", x = 1328, y = 154, z = 928, rot = 16384, team = 0 }, + { name = "armmex", x = 3096, y = 52, z = 728, rot = 16384, team = 0 }, + { name = "armllt", x = 1408, y = 157, z = 1088, rot = 16384, team = 0 }, + { name = "armrl", x = 1304, y = 155, z = 520, rot = 16384, team = 0 }, + { name = "armrl", x = 1128, y = 155, z = 1016, rot = 16384, team = 0 }, + { name = "corak", x = 5697, y = 52, z = 1720, rot = -29165, team = 1 }, + { name = "armrl", x = 920, y = 154, z = 856, rot = 16384, team = 0 }, + --{name = 'armestor', x = 1096, y = 154, z = 664, rot = 16384 , team = 0}, + { name = "corthud", x = 5744, y = 52, z = 1790, rot = -32739, team = 1 }, + { name = "armmex", x = 3480, y = 52, z = 776, rot = 16384, team = 0 }, + { name = "corrad", x = 5296, y = 53, z = 2368, rot = 0, team = 1 }, + { name = "corak", x = 5698, y = 52, z = 1998, rot = 32767, team = 1 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -260,8 +259,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata - diff --git a/singleplayer/scenarios/scenario009.lua b/singleplayer/scenarios/scenario009.lua index cd4e5fd8e48..60b0548ca04 100644 --- a/singleplayer/scenarios/scenario009.lua +++ b/singleplayer/scenarios/scenario009.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 9, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "Tundrabackfromthedead009", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Back from the Dead", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario009.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "All is not lost", -- This text will be drawn over image - summary = [[After a ferocious battle, you are left with only a handful of Rezzer's, tasked to resurrect your army. Beware though, it seems that you might not be alone with this goal]], - briefing = [[You will start with some Graverobbers (Resurrection and Repair Bots), that can resurrect units from their wrecks, though they are unable to resurrect units that have been destroyed beyond repair into just heaps of metal. While Graverobbers cannot build any units on their own, your only hope is to find the wrecks of some construction bots and rebuild everything anew. Units that are resurrected, become active with 0 health, but Graverobbers will continue to repair them back to full health. Graverobbers can also reclaim wrecks from the battlefield for their metal very rapidly, if needed. + index = 9, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "Tundrabackfromthedead009", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Back from the Dead", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario009.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "All is not lost", -- This text will be drawn over image + summary = [[After a ferocious battle, you are left with only a handful of Rezzer's, tasked to resurrect your army. Beware though, it seems that you might not be alone with this goal]], + briefing = [[You will start with some Graverobbers (Resurrection and Repair Bots), that can resurrect units from their wrecks, though they are unable to resurrect units that have been destroyed beyond repair into just heaps of metal. While Graverobbers cannot build any units on their own, your only hope is to find the wrecks of some construction bots and rebuild everything anew. Units that are resurrected, become active with 0 health, but Graverobbers will continue to repair them back to full health. Graverobbers can also reclaim wrecks from the battlefield for their metal very rapidly, if needed. Tips: - Resurrection bots will use Energy to resurrect units, at a flat cost of 75e per second while resurrecting. @@ -24,37 +24,37 @@ Scoring: - Resources spent to get a confirmed kill on all enemy units. ]], - mapfilename = "Tundra_V2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "15%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "15%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 2000, -- par time in seconds (time a mission is expected to take on average) - parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 3, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Cortex"}, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all construction units", -- This is plaintext, but should be reflected in startscript - losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "Tundra_V2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "15%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "15%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 2000, -- par time in seconds (time a mission is expected to take on average) + parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 3, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Cortex" }, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all construction units", -- This is plaintext, but should be reflected in startscript + losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "Tundrabackfromthedead009", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "Tundrabackfromthedead009", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -64,138 +64,135 @@ Scoring: -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - - {name = 'armadvsol', x = 6704, y = 90, z = 7184, rot = -16384 , team = 1}, - {name = 'armadvsol', x = 6704, y = 90, z = 7248, rot = -16384 , team = 1}, - {name = 'armadvsol', x = 6704, y = 90, z = 7312, rot = -16384 , team = 1}, - {name = 'armadvsol', x = 6704, y = 90, z = 7376, rot = -16384 , team = 1}, - {name = 'armadvsol', x = 6768, y = 90, z = 7184, rot = -16384 , team = 1}, - {name = 'armrectr', x = 6338, y = 91, z = 7203, rot = -28093 , team = 1}, - {name = 'armrectr', x = 6396, y = 90, z = 7203, rot = -24876 , team = 1}, - {name = 'armrectr', x = 6449, y = 90, z = 7203, rot = 32287 , team = 1}, - {name = 'armrectr', x = 6511, y = 90, z = 7185, rot = -27573 , team = 1}, - {name = 'armrectr', x = 6511, y = 90, z = 7209, rot = -29780 , team = 1}, - {name = 'coradvsol', x = 1312, y = 90, z = 944, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 1376, y = 89, z = 816, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 1376, y = 90, z = 1008, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 1376, y = 90, z = 1072, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 1376, y = 90, z = 880, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 1376, y = 90, z = 944, rot = -16384 , team = 0}, - {name = 'cornecro', x = 1443, y = 90, z = 1233, rot = -19970 , team = 0}, - {name = 'cornecro', x = 1556, y = 90, z = 1238, rot = -21582 , team = 0}, - {name = 'cornecro', x = 1670, y = 90, z = 1246, rot = -14935 , team = 0}, - {name = 'cornecro', x = 1770, y = 90, z = 1226, rot = 13024 , team = 0}, - {name = 'cornecro', x = 1903, y = 93, z = 1203, rot = 15314 , team = 0}, - + { name = "armadvsol", x = 6704, y = 90, z = 7184, rot = -16384, team = 1 }, + { name = "armadvsol", x = 6704, y = 90, z = 7248, rot = -16384, team = 1 }, + { name = "armadvsol", x = 6704, y = 90, z = 7312, rot = -16384, team = 1 }, + { name = "armadvsol", x = 6704, y = 90, z = 7376, rot = -16384, team = 1 }, + { name = "armadvsol", x = 6768, y = 90, z = 7184, rot = -16384, team = 1 }, + { name = "armrectr", x = 6338, y = 91, z = 7203, rot = -28093, team = 1 }, + { name = "armrectr", x = 6396, y = 90, z = 7203, rot = -24876, team = 1 }, + { name = "armrectr", x = 6449, y = 90, z = 7203, rot = 32287, team = 1 }, + { name = "armrectr", x = 6511, y = 90, z = 7185, rot = -27573, team = 1 }, + { name = "armrectr", x = 6511, y = 90, z = 7209, rot = -29780, team = 1 }, + { name = "coradvsol", x = 1312, y = 90, z = 944, rot = -16384, team = 0 }, + { name = "coradvsol", x = 1376, y = 89, z = 816, rot = -16384, team = 0 }, + { name = "coradvsol", x = 1376, y = 90, z = 1008, rot = -16384, team = 0 }, + { name = "coradvsol", x = 1376, y = 90, z = 1072, rot = -16384, team = 0 }, + { name = "coradvsol", x = 1376, y = 90, z = 880, rot = -16384, team = 0 }, + { name = "coradvsol", x = 1376, y = 90, z = 944, rot = -16384, team = 0 }, + { name = "cornecro", x = 1443, y = 90, z = 1233, rot = -19970, team = 0 }, + { name = "cornecro", x = 1556, y = 90, z = 1238, rot = -21582, team = 0 }, + { name = "cornecro", x = 1670, y = 90, z = 1246, rot = -14935, team = 0 }, + { name = "cornecro", x = 1770, y = 90, z = 1226, rot = 13024, team = 0 }, + { name = "cornecro", x = 1903, y = 93, z = 1203, rot = 15314, team = 0 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - {name = 'armack_dead', x = 1320, y = 89, z = 460, rot = -928 , resurrectas = 'armack', team = 0}, -{name = 'armadvsol_dead', x = 6768, y = 90, z = 7248, rot = -16384 , resurrectas = 'armadvsol', team = 1}, -{name = 'armadvsol_dead', x = 6768, y = 90, z = 7312, rot = -16384 , resurrectas = 'armadvsol', team = 1}, -{name = 'armadvsol_dead', x = 6768, y = 90, z = 7376, rot = -16384 , resurrectas = 'armadvsol', team = 1}, -{name = 'armbeamer_dead', x = 6272, y = 92, z = 6848, rot = -16384 , resurrectas = 'armbeamer', team = 1}, -{name = 'armbeamer_dead', x = 6496, y = 90, z = 6848, rot = -16384 , resurrectas = 'armbeamer', team = 1}, -{name = 'armbeamer_dead', x = 6672, y = 89, z = 6832, rot = -16384 , resurrectas = 'armbeamer', team = 1}, -{name = 'armbeamer_dead', x = 6848, y = 91, z = 6832, rot = -16384 , resurrectas = 'armbeamer', team = 1}, -{name = 'armck_dead', x = 5629, y = 128, z = 7599, rot = -1055 , resurrectas = 'armck', team = 1}, -{name = 'armck_dead', x = 6207, y = 92, z = 7342, rot = -17568 , resurrectas = 'armck', team = 1}, -{name = 'armck_dead', x = 6472, y = 90, z = 7249, rot = 10199 , resurrectas = 'armck', team = 1}, -{name = 'armck_dead', x = 6661, y = 90, z = 7204, rot = 25148 , resurrectas = 'armck', team = 1}, -{name = 'armck_dead', x = 6721, y = 90, z = 6852, rot = 18051 , resurrectas = 'armck', team = 1}, -{name = 'armestor_dead', x = 6744, y = 90, z = 7112, rot = -16384 , resurrectas = 'armestor', team = 1}, -{name = 'armlab_dead', x = 6464, y = 89, z = 7312, rot = -16384 , resurrectas = 'armlab', team = 1}, -{name = 'armllt_dead', x = 5600, y = 127, z = 7520, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 5616, y = 126, z = 7424, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 5616, y = 128, z = 7280, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 5616, y = 129, z = 7728, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 5632, y = 131, z = 7120, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 5712, y = 133, z = 6992, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6016, y = 107, z = 7136, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6016, y = 110, z = 6976, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6160, y = 95, z = 6848, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6384, y = 90, z = 6832, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6576, y = 90, z = 6832, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6752, y = 89, z = 6832, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armllt_dead', x = 6928, y = 110, z = 6832, rot = -16384 , resurrectas = 'armllt', team = 1}, -{name = 'armmex_dead', x = 6456, y = 85, z = 7608, rot = -16384 , resurrectas = 'armmex', team = 1}, -{name = 'armmex_dead', x = 6472, y = 90, z = 7160, rot = -16384 , resurrectas = 'armmex', team = 1}, -{name = 'armmex_dead', x = 6728, y = 90, z = 7448, rot = -16384 , resurrectas = 'armmex', team = 1}, -{name = 'armmoho_dead', x = 1432, y = 89, z = 680, rot = -16384 , resurrectas = 'armmoho', team = 0}, -{name = 'armnanotc_dead', x = 6568, y = 89, z = 7320, rot = -16384 , resurrectas = 'armnanotc', team = 1}, -{name = 'armnanotc_dead', x = 6568, y = 90, z = 7208, rot = -16384 , resurrectas = 'armnanotc', team = 1}, -{name = 'armnanotc_dead', x = 6568, y = 90, z = 7272, rot = -16384 , resurrectas = 'armnanotc', team = 1}, -{name = 'armrad_dead', x = 6128, y = 95, z = 7312, rot = -16384 , resurrectas = 'armrad', team = 1}, -{name = 'armrad_dead', x = 6288, y = 91, z = 7280, rot = -16384 , resurrectas = 'armrad', team = 1}, -{name = 'armwin_dead', x = 6552, y = 88, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6552, y = 88, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6600, y = 88, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6600, y = 89, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6648, y = 89, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6648, y = 89, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6696, y = 89, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6696, y = 89, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6744, y = 89, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6744, y = 89, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6792, y = 89, z = 7592, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'armwin_dead', x = 6792, y = 90, z = 7544, rot = -16384 , resurrectas = 'armwin', team = 1}, -{name = 'coradvsol_dead', x = 1312, y = 89, z = 816, rot = -16384 , resurrectas = 'coradvsol', team = 0}, -{name = 'coradvsol_dead', x = 1312, y = 89, z = 880, rot = -16384 , resurrectas = 'coradvsol', team = 0}, -{name = 'coradvsol_dead', x = 1312, y = 90, z = 1008, rot = -16384 , resurrectas = 'coradvsol', team = 0}, -{name = 'coradvsol_dead', x = 1312, y = 90, z = 1072, rot = -16384 , resurrectas = 'coradvsol', team = 0}, -{name = 'corck_dead', x = 1500, y = 89, z = 1427, rot = -29942 , resurrectas = 'corck', team = 0}, -{name = 'corck_dead', x = 1554, y = 89, z = 794, rot = -13057 , resurrectas = 'corck', team = 0}, -{name = 'corck_dead', x = 1857, y = 91, z = 1016, rot = -19032 , resurrectas = 'corck', team = 0}, -{name = 'corck_dead', x = 1902, y = 91, z = 917, rot = -24128 , resurrectas = 'corck', team = 0}, -{name = 'corck_dead', x = 2060, y = 98, z = 1322, rot = 25705 , resurrectas = 'corck', team = 0}, -{name = 'corestor_dead', x = 1440, y = 89, z = 832, rot = -16384 , resurrectas = 'corestor', team = 0}, -{name = 'corexp_dead', x = 1496, y = 90, z = 1784, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corexp_dead', x = 1896, y = 91, z = 2296, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corexp_dead', x = 3048, y = 131, z = 920, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corexp_dead', x = 3368, y = 131, z = 1032, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corexp_dead', x = 3448, y = 131, z = 1688, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corexp_dead', x = 3592, y = 131, z = 808, rot = -16384 , resurrectas = 'corexp', team = 0}, -{name = 'corlab_dead', x = 1536, y = 90, z = 1008, rot = 0 , resurrectas = 'corlab', team = 0}, -{name = 'corllt_dead', x = 1280, y = 106, z = 1408, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 1456, y = 90, z = 1392, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 1680, y = 90, z = 1392, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 1872, y = 91, z = 1360, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 2032, y = 98, z = 1184, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 2048, y = 83, z = 560, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 2048, y = 90, z = 768, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'corllt_dead', x = 2048, y = 97, z = 976, rot = -16384 , resurrectas = 'corllt', team = 0}, -{name = 'cormaw_dead', x = 2048, y = 98, z = 1072, rot = -16384 , resurrectas = 'cormaw', team = 0}, -{name = 'cormex_dead', x = 1512, y = 89, z = 680, rot = 0 , resurrectas = 'cormex', team = 0}, -{name = 'cormex_dead', x = 1688, y = 90, z = 1048, rot = 0 , resurrectas = 'cormex', team = 0}, -{name = 'cormex_dead', x = 1720, y = 85, z = 584, rot = 0 , resurrectas = 'cormex', team = 0}, -{name = 'cornanotc_dead', x = 1576, y = 89, z = 872, rot = -16384 , resurrectas = 'cornanotc', team = 0}, -{name = 'cornanotc_dead', x = 1672, y = 89, z = 872, rot = -16384 , resurrectas = 'cornanotc', team = 0}, -{name = 'cornanotc_dead', x = 1768, y = 89, z = 872, rot = -16384 , resurrectas = 'cornanotc', team = 0}, - - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + { name = "armack_dead", x = 1320, y = 89, z = 460, rot = -928, resurrectas = "armack", team = 0 }, + { name = "armadvsol_dead", x = 6768, y = 90, z = 7248, rot = -16384, resurrectas = "armadvsol", team = 1 }, + { name = "armadvsol_dead", x = 6768, y = 90, z = 7312, rot = -16384, resurrectas = "armadvsol", team = 1 }, + { name = "armadvsol_dead", x = 6768, y = 90, z = 7376, rot = -16384, resurrectas = "armadvsol", team = 1 }, + { name = "armbeamer_dead", x = 6272, y = 92, z = 6848, rot = -16384, resurrectas = "armbeamer", team = 1 }, + { name = "armbeamer_dead", x = 6496, y = 90, z = 6848, rot = -16384, resurrectas = "armbeamer", team = 1 }, + { name = "armbeamer_dead", x = 6672, y = 89, z = 6832, rot = -16384, resurrectas = "armbeamer", team = 1 }, + { name = "armbeamer_dead", x = 6848, y = 91, z = 6832, rot = -16384, resurrectas = "armbeamer", team = 1 }, + { name = "armck_dead", x = 5629, y = 128, z = 7599, rot = -1055, resurrectas = "armck", team = 1 }, + { name = "armck_dead", x = 6207, y = 92, z = 7342, rot = -17568, resurrectas = "armck", team = 1 }, + { name = "armck_dead", x = 6472, y = 90, z = 7249, rot = 10199, resurrectas = "armck", team = 1 }, + { name = "armck_dead", x = 6661, y = 90, z = 7204, rot = 25148, resurrectas = "armck", team = 1 }, + { name = "armck_dead", x = 6721, y = 90, z = 6852, rot = 18051, resurrectas = "armck", team = 1 }, + { name = "armestor_dead", x = 6744, y = 90, z = 7112, rot = -16384, resurrectas = "armestor", team = 1 }, + { name = "armlab_dead", x = 6464, y = 89, z = 7312, rot = -16384, resurrectas = "armlab", team = 1 }, + { name = "armllt_dead", x = 5600, y = 127, z = 7520, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 5616, y = 126, z = 7424, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 5616, y = 128, z = 7280, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 5616, y = 129, z = 7728, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 5632, y = 131, z = 7120, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 5712, y = 133, z = 6992, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6016, y = 107, z = 7136, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6016, y = 110, z = 6976, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6160, y = 95, z = 6848, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6384, y = 90, z = 6832, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6576, y = 90, z = 6832, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6752, y = 89, z = 6832, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armllt_dead", x = 6928, y = 110, z = 6832, rot = -16384, resurrectas = "armllt", team = 1 }, + { name = "armmex_dead", x = 6456, y = 85, z = 7608, rot = -16384, resurrectas = "armmex", team = 1 }, + { name = "armmex_dead", x = 6472, y = 90, z = 7160, rot = -16384, resurrectas = "armmex", team = 1 }, + { name = "armmex_dead", x = 6728, y = 90, z = 7448, rot = -16384, resurrectas = "armmex", team = 1 }, + { name = "armmoho_dead", x = 1432, y = 89, z = 680, rot = -16384, resurrectas = "armmoho", team = 0 }, + { name = "armnanotc_dead", x = 6568, y = 89, z = 7320, rot = -16384, resurrectas = "armnanotc", team = 1 }, + { name = "armnanotc_dead", x = 6568, y = 90, z = 7208, rot = -16384, resurrectas = "armnanotc", team = 1 }, + { name = "armnanotc_dead", x = 6568, y = 90, z = 7272, rot = -16384, resurrectas = "armnanotc", team = 1 }, + { name = "armrad_dead", x = 6128, y = 95, z = 7312, rot = -16384, resurrectas = "armrad", team = 1 }, + { name = "armrad_dead", x = 6288, y = 91, z = 7280, rot = -16384, resurrectas = "armrad", team = 1 }, + { name = "armwin_dead", x = 6552, y = 88, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6552, y = 88, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6600, y = 88, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6600, y = 89, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6648, y = 89, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6648, y = 89, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6696, y = 89, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6696, y = 89, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6744, y = 89, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6744, y = 89, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6792, y = 89, z = 7592, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "armwin_dead", x = 6792, y = 90, z = 7544, rot = -16384, resurrectas = "armwin", team = 1 }, + { name = "coradvsol_dead", x = 1312, y = 89, z = 816, rot = -16384, resurrectas = "coradvsol", team = 0 }, + { name = "coradvsol_dead", x = 1312, y = 89, z = 880, rot = -16384, resurrectas = "coradvsol", team = 0 }, + { name = "coradvsol_dead", x = 1312, y = 90, z = 1008, rot = -16384, resurrectas = "coradvsol", team = 0 }, + { name = "coradvsol_dead", x = 1312, y = 90, z = 1072, rot = -16384, resurrectas = "coradvsol", team = 0 }, + { name = "corck_dead", x = 1500, y = 89, z = 1427, rot = -29942, resurrectas = "corck", team = 0 }, + { name = "corck_dead", x = 1554, y = 89, z = 794, rot = -13057, resurrectas = "corck", team = 0 }, + { name = "corck_dead", x = 1857, y = 91, z = 1016, rot = -19032, resurrectas = "corck", team = 0 }, + { name = "corck_dead", x = 1902, y = 91, z = 917, rot = -24128, resurrectas = "corck", team = 0 }, + { name = "corck_dead", x = 2060, y = 98, z = 1322, rot = 25705, resurrectas = "corck", team = 0 }, + { name = "corestor_dead", x = 1440, y = 89, z = 832, rot = -16384, resurrectas = "corestor", team = 0 }, + { name = "corexp_dead", x = 1496, y = 90, z = 1784, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corexp_dead", x = 1896, y = 91, z = 2296, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corexp_dead", x = 3048, y = 131, z = 920, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corexp_dead", x = 3368, y = 131, z = 1032, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corexp_dead", x = 3448, y = 131, z = 1688, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corexp_dead", x = 3592, y = 131, z = 808, rot = -16384, resurrectas = "corexp", team = 0 }, + { name = "corlab_dead", x = 1536, y = 90, z = 1008, rot = 0, resurrectas = "corlab", team = 0 }, + { name = "corllt_dead", x = 1280, y = 106, z = 1408, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 1456, y = 90, z = 1392, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 1680, y = 90, z = 1392, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 1872, y = 91, z = 1360, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 2032, y = 98, z = 1184, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 2048, y = 83, z = 560, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 2048, y = 90, z = 768, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "corllt_dead", x = 2048, y = 97, z = 976, rot = -16384, resurrectas = "corllt", team = 0 }, + { name = "cormaw_dead", x = 2048, y = 98, z = 1072, rot = -16384, resurrectas = "cormaw", team = 0 }, + { name = "cormex_dead", x = 1512, y = 89, z = 680, rot = 0, resurrectas = "cormex", team = 0 }, + { name = "cormex_dead", x = 1688, y = 90, z = 1048, rot = 0, resurrectas = "cormex", team = 0 }, + { name = "cormex_dead", x = 1720, y = 85, z = 584, rot = 0, resurrectas = "cormex", team = 0 }, + { name = "cornanotc_dead", x = 1576, y = 89, z = 872, rot = -16384, resurrectas = "cornanotc", team = 0 }, + { name = "cornanotc_dead", x = 1672, y = 89, z = 872, rot = -16384, resurrectas = "cornanotc", team = 0 }, + { name = "cornanotc_dead", x = 1768, y = 89, z = 872, rot = -16384, resurrectas = "cornanotc", team = 0 }, + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -274,8 +271,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata - diff --git a/singleplayer/scenarios/scenario010.lua b/singleplayer/scenarios/scenario010.lua index d088213a096..98f37de2b3d 100644 --- a/singleplayer/scenarios/scenario010.lua +++ b/singleplayer/scenarios/scenario010.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 10, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "strongholdkilltraitor010", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Keep your secrets", -- can be anything - - author = "Beherith", -- your name here - imagepath = "scenario010.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "The captured Cortex Commander", -- This text will be drawn over image - summary = [[Armada have captured and taken a Cortex Commander hostage, and intend to steal Cortex technology and infiltrate your ranks. Foil their plans by any means necessary to neutralize this threat]], - briefing = [[ + index = 10, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "strongholdkilltraitor010", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Keep your secrets", -- can be anything + + author = "Beherith", -- your name here + imagepath = "scenario010.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "The captured Cortex Commander", -- This text will be drawn over image + summary = [[Armada have captured and taken a Cortex Commander hostage, and intend to steal Cortex technology and infiltrate your ranks. Foil their plans by any means necessary to neutralize this threat]], + briefing = [[ Your intelligence reports state that the captured commander is still being held, but his programming has been compromised. To minimize the risk of our technology being stolen. A small forward position has been established on the map, which is hidden with radar jammers for now. You do not have much time before the enemy discovers your presence, so you must liquidate the captured Commander as fast as possible. Tips: @@ -22,37 +22,37 @@ Scoring: - Resources spent to get a confirmed kill on the captured commander. ]], - mapfilename = "Stronghold V4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 3000, -- par time in seconds (time a mission is expected to take on average) - parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 4, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=-50}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=-25}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=50}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=100}, - }, - allowedsides = {"Cortex"}, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill the Cortex Commander", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , - - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "strongholdkilltraitor010", -- this MUST be present and identical to the one defined at start + mapfilename = "Stronghold V4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 3000, -- par time in seconds (time a mission is expected to take on average) + parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 4, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Cortex" }, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill the Cortex Commander", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, + + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "strongholdkilltraitor010", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -62,254 +62,251 @@ Scoring: -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - - {name = 'corcom', x = 6930, y = 534, z = 7623, rot = -7963 , team = 0}, - {name = 'corsolar', x = 7080, y = 534, z = 7512, rot = -16384 , team = 0}, - {name = 'corsolar', x = 7080, y = 534, z = 7592, rot = -16384 , team = 0}, - {name = 'corsolar', x = 7080, y = 534, z = 7672, rot = -16384 , team = 0}, - {name = 'armfort', x = 752, y = 534, z = 576, rot = -16384 , team = 1}, - {name = 'armfort', x = 720, y = 534, z = 576, rot = 0 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 576, rot = 0 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 544, rot = 0 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 576, rot = -16384 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 544, rot = -16384 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 512, rot = -16384 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 480, rot = -16384 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 448, rot = -16384 , team = 1}, - {name = 'armfort', x = 752, y = 534, z = 448, rot = -16384 , team = 1}, - {name = 'armfort', x = 720, y = 534, z = 448, rot = -16384 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 448, rot = -16384 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 480, rot = -16384 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 512, rot = -16384 , team = 1}, - {name = 'armgate', x = 1040, y = 534, z = 832, rot = -16384 , team = 1}, - {name = 'corlab', x = 6944, y = 534, z = 7504, rot = 32767 , team = 0}, - {name = 'cormex', x = 7176, y = 534, z = 7320, rot = 32767 , team = 0}, - {name = 'cormex', x = 7224, y = 534, z = 7784, rot = 32767 , team = 0}, - {name = 'cormex', x = 7416, y = 397, z = 6712, rot = 32767 , team = 0}, - {name = 'cormex', x = 6616, y = 534, z = 7544, rot = 32767 , team = 0}, - {name = 'cornanotc', x = 6888, y = 534, z = 7752, rot = 32767 , team = 0}, - {name = 'cornanotc', x = 6968, y = 534, z = 7752, rot = 32767 , team = 0}, - {name = 'cormex', x = 7640, y = 397, z = 6216, rot = 32767 , team = 0}, - {name = 'cornanotc', x = 7032, y = 534, z = 7752, rot = 32767 , team = 0}, - {name = 'cormex', x = 7928, y = 397, z = 6504, rot = 32767 , team = 0}, - {name = 'corrad', x = 7712, y = 397, z = 6576, rot = 32767 , team = 0}, - {name = 'corjamt', x = 7648, y = 397, z = 6496, rot = 32767 , team = 0}, - {name = 'corjamt', x = 7184, y = 534, z = 7552, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 7848, y = 397, z = 6328, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 7704, y = 397, z = 6328, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 7544, y = 397, z = 6328, rot = 32767 , team = 0}, - {name = 'corjamt', x = 6800, y = 534, z = 7552, rot = 32767 , team = 0}, - {name = 'corjamt', x = 6944, y = 534, z = 7280, rot = 32767 , team = 0}, - {name = 'corrad', x = 7024, y = 534, z = 7312, rot = 32767 , team = 0}, - {name = 'coradvsol', x = 6816, y = 534, z = 7808, rot = 32767 , team = 0}, - {name = 'coradvsol', x = 6880, y = 534, z = 7808, rot = 32767 , team = 0}, - {name = 'coradvsol', x = 6944, y = 534, z = 7808, rot = 32767 , team = 0}, - {name = 'coradvsol', x = 7008, y = 534, z = 7808, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 7288, y = 534, z = 7448, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 7288, y = 534, z = 7656, rot = 32767 , team = 0}, - {name = 'coradvsol', x = 7072, y = 534, z = 7808, rot = 32767 , team = 0}, - {name = 'cormadsam', x = 6696, y = 534, z = 7672, rot = 32767 , team = 0}, - {name = 'corhlt', x = 6624, y = 534, z = 7504, rot = 32767 , team = 0}, - {name = 'corhlt', x = 6720, y = 534, z = 7408, rot = 32767 , team = 0}, + { name = "corcom", x = 6930, y = 534, z = 7623, rot = -7963, team = 0 }, + { name = "corsolar", x = 7080, y = 534, z = 7512, rot = -16384, team = 0 }, + { name = "corsolar", x = 7080, y = 534, z = 7592, rot = -16384, team = 0 }, + { name = "corsolar", x = 7080, y = 534, z = 7672, rot = -16384, team = 0 }, + { name = "armfort", x = 752, y = 534, z = 576, rot = -16384, team = 1 }, + { name = "armfort", x = 720, y = 534, z = 576, rot = 0, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 576, rot = 0, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 544, rot = 0, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 576, rot = -16384, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 544, rot = -16384, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 512, rot = -16384, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 480, rot = -16384, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 448, rot = -16384, team = 1 }, + { name = "armfort", x = 752, y = 534, z = 448, rot = -16384, team = 1 }, + { name = "armfort", x = 720, y = 534, z = 448, rot = -16384, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 448, rot = -16384, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 480, rot = -16384, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 512, rot = -16384, team = 1 }, + { name = "armgate", x = 1040, y = 534, z = 832, rot = -16384, team = 1 }, + { name = "corlab", x = 6944, y = 534, z = 7504, rot = 32767, team = 0 }, + { name = "cormex", x = 7176, y = 534, z = 7320, rot = 32767, team = 0 }, + { name = "cormex", x = 7224, y = 534, z = 7784, rot = 32767, team = 0 }, + { name = "cormex", x = 7416, y = 397, z = 6712, rot = 32767, team = 0 }, + { name = "cormex", x = 6616, y = 534, z = 7544, rot = 32767, team = 0 }, + { name = "cornanotc", x = 6888, y = 534, z = 7752, rot = 32767, team = 0 }, + { name = "cornanotc", x = 6968, y = 534, z = 7752, rot = 32767, team = 0 }, + { name = "cormex", x = 7640, y = 397, z = 6216, rot = 32767, team = 0 }, + { name = "cornanotc", x = 7032, y = 534, z = 7752, rot = 32767, team = 0 }, + { name = "cormex", x = 7928, y = 397, z = 6504, rot = 32767, team = 0 }, + { name = "corrad", x = 7712, y = 397, z = 6576, rot = 32767, team = 0 }, + { name = "corjamt", x = 7648, y = 397, z = 6496, rot = 32767, team = 0 }, + { name = "corjamt", x = 7184, y = 534, z = 7552, rot = 32767, team = 0 }, + { name = "cormadsam", x = 7848, y = 397, z = 6328, rot = 32767, team = 0 }, + { name = "cormadsam", x = 7704, y = 397, z = 6328, rot = 32767, team = 0 }, + { name = "cormadsam", x = 7544, y = 397, z = 6328, rot = 32767, team = 0 }, + { name = "corjamt", x = 6800, y = 534, z = 7552, rot = 32767, team = 0 }, + { name = "corjamt", x = 6944, y = 534, z = 7280, rot = 32767, team = 0 }, + { name = "corrad", x = 7024, y = 534, z = 7312, rot = 32767, team = 0 }, + { name = "coradvsol", x = 6816, y = 534, z = 7808, rot = 32767, team = 0 }, + { name = "coradvsol", x = 6880, y = 534, z = 7808, rot = 32767, team = 0 }, + { name = "coradvsol", x = 6944, y = 534, z = 7808, rot = 32767, team = 0 }, + { name = "coradvsol", x = 7008, y = 534, z = 7808, rot = 32767, team = 0 }, + { name = "cormadsam", x = 7288, y = 534, z = 7448, rot = 32767, team = 0 }, + { name = "cormadsam", x = 7288, y = 534, z = 7656, rot = 32767, team = 0 }, + { name = "coradvsol", x = 7072, y = 534, z = 7808, rot = 32767, team = 0 }, + { name = "cormadsam", x = 6696, y = 534, z = 7672, rot = 32767, team = 0 }, + { name = "corhlt", x = 6624, y = 534, z = 7504, rot = 32767, team = 0 }, + { name = "corhlt", x = 6720, y = 534, z = 7408, rot = 32767, team = 0 }, --{name = 'corestor', x = 7696, y = 397, z = 6480, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6480, y = 534, z = 7568, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6496, y = 534, z = 7536, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6544, y = 534, z = 7472, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6576, y = 534, z = 7440, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6624, y = 534, z = 7376, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6640, y = 534, z = 7344, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6688, y = 534, z = 7280, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6720, y = 534, z = 7248, rot = 32767 , team = 0}, - {name = 'cordrag', x = 6736, y = 534, z = 7216, rot = 32767 , team = 0}, - {name = 'armmex', x = 936, y = 533, z = 488, rot = 32767 , team = 1}, - {name = 'armmex', x = 1448, y = 534, z = 680, rot = 32767 , team = 1}, - {name = 'armmex', x = 968, y = 534, z = 968, rot = 32767 , team = 1}, - {name = 'armmex', x = 728, y = 397, z = 1560, rot = 32767 , team = 1}, - {name = 'armmex', x = 216, y = 397, z = 1704, rot = 32767 , team = 1}, - {name = 'armmex', x = 552, y = 397, z = 2072, rot = 32767 , team = 1}, - {name = 'armrad', x = 480, y = 397, z = 1824, rot = 32767 , team = 1}, - {name = 'armcir', x = 768, y = 397, z = 1728, rot = 32767 , team = 1}, - {name = 'armcir', x = 672, y = 397, z = 2112, rot = 32767 , team = 1}, - {name = 'armcir', x = 224, y = 397, z = 2176, rot = 32767 , team = 1}, - {name = 'armcir', x = 448, y = 397, z = 2224, rot = 32767 , team = 1}, - {name = 'armferret', x = 344, y = 397, z = 2200, rot = 32767 , team = 1}, - {name = 'armferret', x = 584, y = 397, z = 2200, rot = 32767 , team = 1}, - {name = 'armferret', x = 792, y = 397, z = 1976, rot = 32767 , team = 1}, - {name = 'armcir', x = 2128, y = 534, z = 576, rot = 32767 , team = 1}, - {name = 'armcir', x = 2128, y = 534, z = 496, rot = 32767 , team = 1}, - {name = 'armpb', x = 1976, y = 534, z = 728, rot = 32767 , team = 1}, - {name = 'armpb', x = 1848, y = 531, z = 856, rot = 32767 , team = 1}, - {name = 'armpb', x = 1704, y = 531, z = 1000, rot = 32767 , team = 1}, - {name = 'armpb', x = 1528, y = 533, z = 1192, rot = 32767 , team = 1}, - {name = 'armamb', x = 1400, y = 534, z = 1240, rot = 32767 , team = 1}, - {name = 'armanni', x = 1744, y = 534, z = 912, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1744, y = 534, z = 592, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1744, y = 534, z = 624, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1744, y = 534, z = 656, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1712, y = 534, z = 656, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1680, y = 534, z = 656, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1680, y = 534, z = 624, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1680, y = 534, z = 592, rot = 32767 , team = 1}, - {name = 'armdrag', x = 1712, y = 534, z = 592, rot = 32767 , team = 1}, - {name = 'armdrag', x = 880, y = 535, z = 608, rot = 32767 , team = 1}, - {name = 'armdrag', x = 880, y = 534, z = 640, rot = 32767 , team = 1}, - {name = 'armdrag', x = 880, y = 534, z = 672, rot = 32767 , team = 1}, - {name = 'armdrag', x = 912, y = 534, z = 672, rot = 32767 , team = 1}, - {name = 'armdrag', x = 944, y = 534, z = 672, rot = 32767 , team = 1}, - {name = 'armdrag', x = 944, y = 535, z = 640, rot = 32767 , team = 1}, - {name = 'armdrag', x = 944, y = 535, z = 608, rot = 32767 , team = 1}, - {name = 'armdrag', x = 912, y = 535, z = 608, rot = 32767 , team = 1}, - {name = 'armnanotc', x = 1096, y = 535, z = 568, rot = 32767 , team = 1}, - {name = 'armnanotc', x = 1288, y = 534, z = 568, rot = 32767 , team = 1}, - {name = 'armlab', x = 1184, y = 534, z = 704, rot = 0 , team = 1}, + { name = "cordrag", x = 6480, y = 534, z = 7568, rot = 32767, team = 0 }, + { name = "cordrag", x = 6496, y = 534, z = 7536, rot = 32767, team = 0 }, + { name = "cordrag", x = 6544, y = 534, z = 7472, rot = 32767, team = 0 }, + { name = "cordrag", x = 6576, y = 534, z = 7440, rot = 32767, team = 0 }, + { name = "cordrag", x = 6624, y = 534, z = 7376, rot = 32767, team = 0 }, + { name = "cordrag", x = 6640, y = 534, z = 7344, rot = 32767, team = 0 }, + { name = "cordrag", x = 6688, y = 534, z = 7280, rot = 32767, team = 0 }, + { name = "cordrag", x = 6720, y = 534, z = 7248, rot = 32767, team = 0 }, + { name = "cordrag", x = 6736, y = 534, z = 7216, rot = 32767, team = 0 }, + { name = "armmex", x = 936, y = 533, z = 488, rot = 32767, team = 1 }, + { name = "armmex", x = 1448, y = 534, z = 680, rot = 32767, team = 1 }, + { name = "armmex", x = 968, y = 534, z = 968, rot = 32767, team = 1 }, + { name = "armmex", x = 728, y = 397, z = 1560, rot = 32767, team = 1 }, + { name = "armmex", x = 216, y = 397, z = 1704, rot = 32767, team = 1 }, + { name = "armmex", x = 552, y = 397, z = 2072, rot = 32767, team = 1 }, + { name = "armrad", x = 480, y = 397, z = 1824, rot = 32767, team = 1 }, + { name = "armcir", x = 768, y = 397, z = 1728, rot = 32767, team = 1 }, + { name = "armcir", x = 672, y = 397, z = 2112, rot = 32767, team = 1 }, + { name = "armcir", x = 224, y = 397, z = 2176, rot = 32767, team = 1 }, + { name = "armcir", x = 448, y = 397, z = 2224, rot = 32767, team = 1 }, + { name = "armferret", x = 344, y = 397, z = 2200, rot = 32767, team = 1 }, + { name = "armferret", x = 584, y = 397, z = 2200, rot = 32767, team = 1 }, + { name = "armferret", x = 792, y = 397, z = 1976, rot = 32767, team = 1 }, + { name = "armcir", x = 2128, y = 534, z = 576, rot = 32767, team = 1 }, + { name = "armcir", x = 2128, y = 534, z = 496, rot = 32767, team = 1 }, + { name = "armpb", x = 1976, y = 534, z = 728, rot = 32767, team = 1 }, + { name = "armpb", x = 1848, y = 531, z = 856, rot = 32767, team = 1 }, + { name = "armpb", x = 1704, y = 531, z = 1000, rot = 32767, team = 1 }, + { name = "armpb", x = 1528, y = 533, z = 1192, rot = 32767, team = 1 }, + { name = "armamb", x = 1400, y = 534, z = 1240, rot = 32767, team = 1 }, + { name = "armanni", x = 1744, y = 534, z = 912, rot = 32767, team = 1 }, + { name = "armdrag", x = 1744, y = 534, z = 592, rot = 32767, team = 1 }, + { name = "armdrag", x = 1744, y = 534, z = 624, rot = 32767, team = 1 }, + { name = "armdrag", x = 1744, y = 534, z = 656, rot = 32767, team = 1 }, + { name = "armdrag", x = 1712, y = 534, z = 656, rot = 32767, team = 1 }, + { name = "armdrag", x = 1680, y = 534, z = 656, rot = 32767, team = 1 }, + { name = "armdrag", x = 1680, y = 534, z = 624, rot = 32767, team = 1 }, + { name = "armdrag", x = 1680, y = 534, z = 592, rot = 32767, team = 1 }, + { name = "armdrag", x = 1712, y = 534, z = 592, rot = 32767, team = 1 }, + { name = "armdrag", x = 880, y = 535, z = 608, rot = 32767, team = 1 }, + { name = "armdrag", x = 880, y = 534, z = 640, rot = 32767, team = 1 }, + { name = "armdrag", x = 880, y = 534, z = 672, rot = 32767, team = 1 }, + { name = "armdrag", x = 912, y = 534, z = 672, rot = 32767, team = 1 }, + { name = "armdrag", x = 944, y = 534, z = 672, rot = 32767, team = 1 }, + { name = "armdrag", x = 944, y = 535, z = 640, rot = 32767, team = 1 }, + { name = "armdrag", x = 944, y = 535, z = 608, rot = 32767, team = 1 }, + { name = "armdrag", x = 912, y = 535, z = 608, rot = 32767, team = 1 }, + { name = "armnanotc", x = 1096, y = 535, z = 568, rot = 32767, team = 1 }, + { name = "armnanotc", x = 1288, y = 534, z = 568, rot = 32767, team = 1 }, + { name = "armlab", x = 1184, y = 534, z = 704, rot = 0, team = 1 }, --{name = 'armestor', x = 1080, y = 535, z = 440, rot = 0 , team = 1}, - {name = 'armadvsol', x = 1152, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armadvsol', x = 1216, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armadvsol', x = 1216, y = 534, z = 448, rot = 0 , team = 1}, - {name = 'armadvsol', x = 1152, y = 534, z = 448, rot = 0 , team = 1}, + { name = "armadvsol", x = 1152, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armadvsol", x = 1216, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armadvsol", x = 1216, y = 534, z = 448, rot = 0, team = 1 }, + { name = "armadvsol", x = 1152, y = 534, z = 448, rot = 0, team = 1 }, --{name = 'armestor', x = 1080, y = 535, z = 376, rot = 0 , team = 1}, - {name = 'coreyes', x = 1716, y = 534, z = 621, rot = 0 , team = 0}, - {name = 'coreyes', x = 909, y = 535, z = 635, rot = 0 , team = 0}, - {name = 'armfort', x = 816, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armanni', x = 1584, y = 534, z = 1072, rot = 0 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armfort', x = 752, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armfort', x = 720, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 534, z = 576, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 535, z = 544, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 535, z = 512, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 535, z = 480, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 535, z = 448, rot = 0 , team = 1}, - {name = 'armfort', x = 816, y = 535, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 784, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 752, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 720, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 688, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 448, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 480, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 512, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 544, rot = 0 , team = 1}, - {name = 'armfort', x = 656, y = 534, z = 576, rot = 0 , team = 1}, - {name = 'cormadsam', x = 7016, y = 534, z = 7080, rot = 0 , team = 0}, - {name = 'corrad', x = 6752, y = 534, z = 7616, rot = 0 , team = 0}, - {name = 'armflak', x = 1072, y = 534, z = 1568, rot = 0 , team = 1}, - {name = 'armflak', x = 768, y = 397, z = 1856, rot = 0 , team = 1}, - {name = 'armflak', x = 1680, y = 534, z = 368, rot = 0 , team = 1}, - {name = 'armap', x = 440, y = 397, z = 1568, rot = 0 , team = 1}, - {name = 'armnanotc', x = 456, y = 397, z = 1768, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 816, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 784, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 752, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 720, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 688, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 656, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 640, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 608, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 576, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 544, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 512, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 480, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 448, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 416, rot = 0 , team = 1}, - {name = 'armdrag', x = 624, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 656, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 688, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 720, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 752, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 784, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 816, y = 534, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 384, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 416, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 448, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 480, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 512, rot = 0 , team = 1}, - {name = 'armbeamer', x = 592, y = 534, z = 672, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 544, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 576, rot = 0 , team = 1}, - {name = 'armdrag', x = 848, y = 535, z = 608, rot = 0 , team = 1}, - {name = 'armbeamer', x = 880, y = 535, z = 352, rot = 0 , team = 1}, - {name = 'armbeamer', x = 592, y = 534, z = 352, rot = 0 , team = 1}, - {name = 'armfort', x = 1632, y = 533, z = 1056, rot = -16384 , team = 1}, - {name = 'armfort', x = 1632, y = 529, z = 1088, rot = -16384 , team = 1}, - {name = 'armfort', x = 1632, y = 520, z = 1120, rot = -16384 , team = 1}, - {name = 'armfort', x = 1600, y = 529, z = 1120, rot = 32767 , team = 1}, - {name = 'armfort', x = 1568, y = 533, z = 1120, rot = 32767 , team = 1}, - {name = 'armfort', x = 1536, y = 534, z = 1120, rot = 32767 , team = 1}, - {name = 'armfort', x = 1536, y = 534, z = 1088, rot = 16384 , team = 1}, - {name = 'armfort', x = 1536, y = 534, z = 1056, rot = 16384 , team = 1}, - {name = 'armfort', x = 1536, y = 534, z = 1024, rot = 16384 , team = 1}, - {name = 'armfort', x = 1568, y = 534, z = 1024, rot = 0 , team = 1}, - {name = 'armfort', x = 1600, y = 534, z = 1024, rot = 0 , team = 1}, - {name = 'armfort', x = 1632, y = 534, z = 1024, rot = 0 , team = 1}, - {name = 'armfort', x = 1792, y = 533, z = 896, rot = -16384 , team = 1}, - {name = 'armfort', x = 1792, y = 529, z = 928, rot = -16384 , team = 1}, - {name = 'armfort', x = 1792, y = 520, z = 960, rot = -16384 , team = 1}, - {name = 'armfort', x = 1760, y = 529, z = 960, rot = 32767 , team = 1}, - {name = 'armfort', x = 1728, y = 533, z = 960, rot = 32767 , team = 1}, - {name = 'armfort', x = 1696, y = 533, z = 960, rot = 32767 , team = 1}, - {name = 'armfort', x = 1696, y = 534, z = 928, rot = 16384 , team = 1}, - {name = 'armfort', x = 1696, y = 534, z = 896, rot = 16384 , team = 1}, - {name = 'armfort', x = 1696, y = 534, z = 864, rot = 16384 , team = 1}, - {name = 'armfort', x = 1728, y = 534, z = 864, rot = 0 , team = 1}, - {name = 'armfort', x = 1760, y = 534, z = 864, rot = 0 , team = 1}, - {name = 'armfort', x = 1792, y = 534, z = 864, rot = 0 , team = 1}, - {name = 'armsolar', x = 1384, y = 534, z = 440, rot = 0 , team = 1}, - {name = 'armsolar', x = 1464, y = 534, z = 440, rot = 0 , team = 1}, - {name = 'armsolar', x = 1544, y = 534, z = 440, rot = 0 , team = 1}, - {name = 'armsolar', x = 1544, y = 534, z = 360, rot = 0 , team = 1}, - {name = 'armsolar', x = 1464, y = 534, z = 360, rot = 0 , team = 1}, - {name = 'armsolar', x = 1384, y = 534, z = 360, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1432, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 397, z = 1432, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 397, z = 1352, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1352, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1272, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 397, z = 1272, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 397, z = 1192, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1192, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1112, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 399, z = 1112, rot = 0 , team = 1}, - {name = 'armwin', x = 344, y = 400, z = 1032, rot = 0 , team = 1}, - {name = 'armwin', x = 264, y = 397, z = 1032, rot = 0 , team = 1}, - {name = 'cormaw', x = 6656, y = 534, z = 7312, rot = 0 , team = 0}, - {name = 'cormaw', x = 6592, y = 534, z = 7408, rot = 0 , team = 0}, - {name = 'cormaw', x = 6512, y = 534, z = 7504, rot = 0 , team = 0}, - {name = 'armpb', x = 1272, y = 534, z = 1400, rot = 0 , team = 1}, - {name = 'corcom', x = 735, y = 534, z = 513, rot = 8469 , team = 1}, - + { name = "coreyes", x = 1716, y = 534, z = 621, rot = 0, team = 0 }, + { name = "coreyes", x = 909, y = 535, z = 635, rot = 0, team = 0 }, + { name = "armfort", x = 816, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armanni", x = 1584, y = 534, z = 1072, rot = 0, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armfort", x = 752, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armfort", x = 720, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 534, z = 576, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 535, z = 544, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 535, z = 512, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 535, z = 480, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 535, z = 448, rot = 0, team = 1 }, + { name = "armfort", x = 816, y = 535, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 784, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 752, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 720, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 688, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 448, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 480, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 512, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 544, rot = 0, team = 1 }, + { name = "armfort", x = 656, y = 534, z = 576, rot = 0, team = 1 }, + { name = "cormadsam", x = 7016, y = 534, z = 7080, rot = 0, team = 0 }, + { name = "corrad", x = 6752, y = 534, z = 7616, rot = 0, team = 0 }, + { name = "armflak", x = 1072, y = 534, z = 1568, rot = 0, team = 1 }, + { name = "armflak", x = 768, y = 397, z = 1856, rot = 0, team = 1 }, + { name = "armflak", x = 1680, y = 534, z = 368, rot = 0, team = 1 }, + { name = "armap", x = 440, y = 397, z = 1568, rot = 0, team = 1 }, + { name = "armnanotc", x = 456, y = 397, z = 1768, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 816, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 784, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 752, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 720, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 688, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 656, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 640, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 608, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 576, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 544, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 512, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 480, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 448, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 416, rot = 0, team = 1 }, + { name = "armdrag", x = 624, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 656, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 688, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 720, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 752, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 784, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 816, y = 534, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 384, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 416, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 448, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 480, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 512, rot = 0, team = 1 }, + { name = "armbeamer", x = 592, y = 534, z = 672, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 544, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 576, rot = 0, team = 1 }, + { name = "armdrag", x = 848, y = 535, z = 608, rot = 0, team = 1 }, + { name = "armbeamer", x = 880, y = 535, z = 352, rot = 0, team = 1 }, + { name = "armbeamer", x = 592, y = 534, z = 352, rot = 0, team = 1 }, + { name = "armfort", x = 1632, y = 533, z = 1056, rot = -16384, team = 1 }, + { name = "armfort", x = 1632, y = 529, z = 1088, rot = -16384, team = 1 }, + { name = "armfort", x = 1632, y = 520, z = 1120, rot = -16384, team = 1 }, + { name = "armfort", x = 1600, y = 529, z = 1120, rot = 32767, team = 1 }, + { name = "armfort", x = 1568, y = 533, z = 1120, rot = 32767, team = 1 }, + { name = "armfort", x = 1536, y = 534, z = 1120, rot = 32767, team = 1 }, + { name = "armfort", x = 1536, y = 534, z = 1088, rot = 16384, team = 1 }, + { name = "armfort", x = 1536, y = 534, z = 1056, rot = 16384, team = 1 }, + { name = "armfort", x = 1536, y = 534, z = 1024, rot = 16384, team = 1 }, + { name = "armfort", x = 1568, y = 534, z = 1024, rot = 0, team = 1 }, + { name = "armfort", x = 1600, y = 534, z = 1024, rot = 0, team = 1 }, + { name = "armfort", x = 1632, y = 534, z = 1024, rot = 0, team = 1 }, + { name = "armfort", x = 1792, y = 533, z = 896, rot = -16384, team = 1 }, + { name = "armfort", x = 1792, y = 529, z = 928, rot = -16384, team = 1 }, + { name = "armfort", x = 1792, y = 520, z = 960, rot = -16384, team = 1 }, + { name = "armfort", x = 1760, y = 529, z = 960, rot = 32767, team = 1 }, + { name = "armfort", x = 1728, y = 533, z = 960, rot = 32767, team = 1 }, + { name = "armfort", x = 1696, y = 533, z = 960, rot = 32767, team = 1 }, + { name = "armfort", x = 1696, y = 534, z = 928, rot = 16384, team = 1 }, + { name = "armfort", x = 1696, y = 534, z = 896, rot = 16384, team = 1 }, + { name = "armfort", x = 1696, y = 534, z = 864, rot = 16384, team = 1 }, + { name = "armfort", x = 1728, y = 534, z = 864, rot = 0, team = 1 }, + { name = "armfort", x = 1760, y = 534, z = 864, rot = 0, team = 1 }, + { name = "armfort", x = 1792, y = 534, z = 864, rot = 0, team = 1 }, + { name = "armsolar", x = 1384, y = 534, z = 440, rot = 0, team = 1 }, + { name = "armsolar", x = 1464, y = 534, z = 440, rot = 0, team = 1 }, + { name = "armsolar", x = 1544, y = 534, z = 440, rot = 0, team = 1 }, + { name = "armsolar", x = 1544, y = 534, z = 360, rot = 0, team = 1 }, + { name = "armsolar", x = 1464, y = 534, z = 360, rot = 0, team = 1 }, + { name = "armsolar", x = 1384, y = 534, z = 360, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1432, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 397, z = 1432, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 397, z = 1352, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1352, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1272, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 397, z = 1272, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 397, z = 1192, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1192, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1112, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 399, z = 1112, rot = 0, team = 1 }, + { name = "armwin", x = 344, y = 400, z = 1032, rot = 0, team = 1 }, + { name = "armwin", x = 264, y = 397, z = 1032, rot = 0, team = 1 }, + { name = "cormaw", x = 6656, y = 534, z = 7312, rot = 0, team = 0 }, + { name = "cormaw", x = 6592, y = 534, z = 7408, rot = 0, team = 0 }, + { name = "cormaw", x = 6512, y = 534, z = 7504, rot = 0, team = 0 }, + { name = "armpb", x = 1272, y = 534, z = 1400, rot = 0, team = 1 }, + { name = "corcom", x = 735, y = 534, z = 513, rot = 8469, team = 1 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - -- {name = 'armack_dead', x = 1320, y = 89, z = 460, rot = -928 , resurrectas = 'armack', team = 0}, - - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; - - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ - - startscript = [[[GAME] + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + -- {name = 'armack_dead', x = 1320, y = 89, z = 460, rot = -928 , resurrectas = 'armack', team = 0}, + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; + + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ + + startscript = [[[GAME] { [allyTeam0] { @@ -388,7 +385,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata @@ -468,4 +464,5 @@ return scenariodata nohelperais = 0; } -]]-- +]] +-- diff --git a/singleplayer/scenarios/scenario011.lua b/singleplayer/scenarios/scenario011.lua index 1192b503157..46f8dd2eb7e 100644 --- a/singleplayer/scenarios/scenario011.lua +++ b/singleplayer/scenarios/scenario011.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 11, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "SpeedMetalSnipe011", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Tick Tock", -- can be anything - author = "Zow", -- your name here - imagepath = "scenario011.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Enemy Behemoths", -- This text will be drawn over image - summary = [[On the metal-rich Speed Metal road, you find yourself face to face with an enemy Cortex commander and its four pet Behemoths.]], - briefing = [[You've been tasked to defeat an enemy who is rumored to have four of the tankiest units in the game: the Cortex Behemoth. While they are slow, they spell almost certain doom for your base should they reach it. Your intelligence team has snuck dragon eyes into the enemy base and along the long Speed Metal road to report on the position of these beasts, but are otherwise defenseless against them. Perhaps you must snipe the enemy commander to demoralize their army... + index = 11, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "SpeedMetalSnipe011", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Tick Tock", -- can be anything + author = "Zow", -- your name here + imagepath = "scenario011.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Enemy Behemoths", -- This text will be drawn over image + summary = [[On the metal-rich Speed Metal road, you find yourself face to face with an enemy Cortex commander and its four pet Behemoths.]], + briefing = [[You've been tasked to defeat an enemy who is rumored to have four of the tankiest units in the game: the Cortex Behemoth. While they are slow, they spell almost certain doom for your base should they reach it. Your intelligence team has snuck dragon eyes into the enemy base and along the long Speed Metal road to report on the position of these beasts, but are otherwise defenseless against them. Perhaps you must snipe the enemy commander to demoralize their army... Tips: - On Speed Metal, metal extractors can be built anywhere and have a rather high output. Wind generators are by far the best energy source here, being consistently set to the maximum possible wind (25 e/s). @@ -21,37 +21,37 @@ Scoring: - Resources spent to kill the enemy commander ]], - mapfilename = "SpeedMetal BAR V2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "45%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 300, -- par time in seconds (time a mission is expected to take on average) - parresources = 8000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 8, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill the Enemy Commander", -- This is plaintext, but should be reflected in startscript - losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "SpeedMetal BAR V2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "45%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 300, -- par time in seconds (time a mission is expected to take on average) + parresources = 8000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 8, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission, ch0ose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill the Enemy Commander", -- This is plaintext, but should be reflected in startscript + losscondition = "Death of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "SpeedMetalSnipe011", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "SpeedMetalSnipe011", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -61,73 +61,73 @@ Scoring: -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - {name = 'corcom', x = 12330, y = 118, z = 1000, rot = 0 , team = 1}, - {name = 'corjugg', x = 13150, y = 118, z = 182, rot = 0 , team = 1}, - {name = 'corjugg', x = 13150, y = 118, z = 644, rot = 0 , team = 1}, - {name = 'corjugg', x = 13150, y = 118, z = 1378, rot = 0 , team = 1}, - {name = 'corjugg', x = 13150, y = 118, z = 1861, rot = 0 , team = 1}, - {name = 'armcom', x = 1044, y = 118, z = 1000, rot = 0 , team = 0}, - {name = 'coreyes', x = 550, y = 118, z = 1000, rot = 0 , team = 1}, - {name = 'armsolar', x = 936, y = 118, z = 984, rot = -16384 , team = 0}, - {name = 'armsolar', x = 936, y = 118, z = 1064, rot = -16384 , team = 0}, - {name = 'armsolar', x = 856, y = 118, z = 984, rot = -16384 , team = 0}, - {name = 'armsolar', x = 776, y = 118, z = 984, rot = -16384 , team = 0}, - {name = 'armeyes', x = 2013, y = 118, z = 809, rot = 0 , team = 0}, - {name = 'armsolar', x = 696, y = 118, z = 984, rot = -16384 , team = 0}, - {name = 'armeyes', x = 2005, y = 118, z = 1232, rot = 0 , team = 0}, - {name = 'armeyes', x = 5968, y = 118, z = 807, rot = 0 , team = 0}, - {name = 'armsolar', x = 856, y = 118, z = 1064, rot = -16384 , team = 0}, - {name = 'armeyes', x = 5955, y = 118, z = 1242, rot = 0 , team = 0}, - {name = 'armeyes', x = 7335, y = 118, z = 812, rot = 0 , team = 0}, - {name = 'armeyes', x = 7347, y = 118, z = 1229, rot = 0 , team = 0}, - {name = 'armsolar', x = 776, y = 118, z = 1064, rot = -16384 , team = 0}, - {name = 'armeyes', x = 11308, y = 118, z = 819, rot = 0 , team = 0}, - {name = 'armeyes', x = 11304, y = 118, z = 1231, rot = 0 , team = 0}, - {name = 'armsolar', x = 696, y = 118, z = 1064, rot = -16384 , team = 0}, - {name = 'armeyes', x = 13285, y = 118, z = 67, rot = 0 , team = 0}, - {name = 'armeyes', x = 13280, y = 118, z = 704, rot = 0 , team = 0}, - {name = 'armeyes', x = 13279, y = 118, z = 1342, rot = 0 , team = 0}, - {name = 'armeyes', x = 13284, y = 118, z = 1984, rot = 0 , team = 0}, - {name = 'corllt', x = 11488, y = 118, z = 732, rot = 0 , team = 1}, - {name = 'corllt', x = 11485, y = 118, z = 474, rot = 0 , team = 1}, - {name = 'corllt', x = 11484, y = 118, z = 219, rot = 0 , team = 1}, - {name = 'corllt', x = 11486, y = 118, z = 1312, rot = 0 , team = 1}, - {name = 'corllt', x = 11484, y = 118, z = 1563, rot = 0 , team = 1}, - {name = 'corllt', x = 11485, y = 118, z = 1824, rot = 0 , team = 1}, - {name = 'corrl', x = 11608, y = 118, z = 600, rot = -16384 , team = 1}, - {name = 'corrl', x = 11608, y = 118, z = 360, rot = -16384 , team = 1}, - {name = 'corrl', x = 11608, y = 118, z = 1448, rot = -16384 , team = 1}, - {name = 'corrl', x = 11608, y = 118, z = 1688, rot = -16384 , team = 1}, - {name = 'corrad', x = 11600, y = 118, z = 1568, rot = -16384 , team = 1}, - {name = 'corrad', x = 11600, y = 118, z = 480, rot = -16384 , team = 1}, - {name = 'armllt', x = 7201, y = 118, z = 1020, rot = 0 , team = 0}, + { name = "corcom", x = 12330, y = 118, z = 1000, rot = 0, team = 1 }, + { name = "corjugg", x = 13150, y = 118, z = 182, rot = 0, team = 1 }, + { name = "corjugg", x = 13150, y = 118, z = 644, rot = 0, team = 1 }, + { name = "corjugg", x = 13150, y = 118, z = 1378, rot = 0, team = 1 }, + { name = "corjugg", x = 13150, y = 118, z = 1861, rot = 0, team = 1 }, + { name = "armcom", x = 1044, y = 118, z = 1000, rot = 0, team = 0 }, + { name = "coreyes", x = 550, y = 118, z = 1000, rot = 0, team = 1 }, + { name = "armsolar", x = 936, y = 118, z = 984, rot = -16384, team = 0 }, + { name = "armsolar", x = 936, y = 118, z = 1064, rot = -16384, team = 0 }, + { name = "armsolar", x = 856, y = 118, z = 984, rot = -16384, team = 0 }, + { name = "armsolar", x = 776, y = 118, z = 984, rot = -16384, team = 0 }, + { name = "armeyes", x = 2013, y = 118, z = 809, rot = 0, team = 0 }, + { name = "armsolar", x = 696, y = 118, z = 984, rot = -16384, team = 0 }, + { name = "armeyes", x = 2005, y = 118, z = 1232, rot = 0, team = 0 }, + { name = "armeyes", x = 5968, y = 118, z = 807, rot = 0, team = 0 }, + { name = "armsolar", x = 856, y = 118, z = 1064, rot = -16384, team = 0 }, + { name = "armeyes", x = 5955, y = 118, z = 1242, rot = 0, team = 0 }, + { name = "armeyes", x = 7335, y = 118, z = 812, rot = 0, team = 0 }, + { name = "armeyes", x = 7347, y = 118, z = 1229, rot = 0, team = 0 }, + { name = "armsolar", x = 776, y = 118, z = 1064, rot = -16384, team = 0 }, + { name = "armeyes", x = 11308, y = 118, z = 819, rot = 0, team = 0 }, + { name = "armeyes", x = 11304, y = 118, z = 1231, rot = 0, team = 0 }, + { name = "armsolar", x = 696, y = 118, z = 1064, rot = -16384, team = 0 }, + { name = "armeyes", x = 13285, y = 118, z = 67, rot = 0, team = 0 }, + { name = "armeyes", x = 13280, y = 118, z = 704, rot = 0, team = 0 }, + { name = "armeyes", x = 13279, y = 118, z = 1342, rot = 0, team = 0 }, + { name = "armeyes", x = 13284, y = 118, z = 1984, rot = 0, team = 0 }, + { name = "corllt", x = 11488, y = 118, z = 732, rot = 0, team = 1 }, + { name = "corllt", x = 11485, y = 118, z = 474, rot = 0, team = 1 }, + { name = "corllt", x = 11484, y = 118, z = 219, rot = 0, team = 1 }, + { name = "corllt", x = 11486, y = 118, z = 1312, rot = 0, team = 1 }, + { name = "corllt", x = 11484, y = 118, z = 1563, rot = 0, team = 1 }, + { name = "corllt", x = 11485, y = 118, z = 1824, rot = 0, team = 1 }, + { name = "corrl", x = 11608, y = 118, z = 600, rot = -16384, team = 1 }, + { name = "corrl", x = 11608, y = 118, z = 360, rot = -16384, team = 1 }, + { name = "corrl", x = 11608, y = 118, z = 1448, rot = -16384, team = 1 }, + { name = "corrl", x = 11608, y = 118, z = 1688, rot = -16384, team = 1 }, + { name = "corrad", x = 11600, y = 118, z = 1568, rot = -16384, team = 1 }, + { name = "corrad", x = 11600, y = 118, z = 480, rot = -16384, team = 1 }, + { name = "armllt", x = 7201, y = 118, z = 1020, rot = 0, team = 0 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -194,7 +194,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario012.lua b/singleplayer/scenarios/scenario012.lua index 3bac6f3a1b9..36e91745c2e 100644 --- a/singleplayer/scenarios/scenario012.lua +++ b/singleplayer/scenarios/scenario012.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 12, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "avalanchemines012", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Mines, all mine!", -- can be anything - - author = "Beherith", -- your name here - imagepath = "scenario012.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Mines explode on the slightest touch", -- This text will be drawn over image - summary = [[The Armada are amassing reinforcements at a rally point near one of your stealthy outposts. You do not have any technology except for minelayers and scouts. Lay mines around the area, and then you must distract and draw these forces onto minefields, without allowing Armada to detect and destroy your base of operations.]], - briefing = [[ + index = 12, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "avalanchemines012", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Mines, all mine!", -- can be anything + + author = "Beherith", -- your name here + imagepath = "scenario012.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Mines explode on the slightest touch", -- This text will be drawn over image + summary = [[The Armada are amassing reinforcements at a rally point near one of your stealthy outposts. You do not have any technology except for minelayers and scouts. Lay mines around the area, and then you must distract and draw these forces onto minefields, without allowing Armada to detect and destroy your base of operations.]], + briefing = [[ Tips: - Mines automatically detonate if an enemy gets within range of it, or if it is destroyed. - Mines can be manually detonated immediately by self-destructing them (Ctrl + D). @@ -26,29 +26,29 @@ Scoring: ]], - mapfilename = "Avalanche 3.4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 600, -- par time in seconds (time a mission is expected to take on average) - parresources = 10000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 2, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50 , enemyhandicap = 0}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = 0}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0}, - {name = "Hard" , playerhandicap = -25, enemyhandicap = 0}, - {name = "Brutal" , playerhandicap = -50, enemyhandicap = 0}, - }, - allowedsides = {"Cortex"}, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all Armada reinforcements", -- This is plaintext, but should be reflected in startscript - losscondition = "Lose all your units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, + mapfilename = "Avalanche 3.4", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "85%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "85%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 600, -- par time in seconds (time a mission is expected to take on average) + parresources = 10000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 2, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = -25, enemyhandicap = 0 }, + { name = "Brutal", playerhandicap = -50, enemyhandicap = 0 }, + }, + allowedsides = { "Cortex" }, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all Armada reinforcements", -- This is plaintext, but should be reflected in startscript + losscondition = "Lose all your units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, corcv = 0, corgator = 0, corraid = 0, @@ -57,14 +57,14 @@ Scoring: corlevlr = 0, corgarp = 0, cormuskrat = 0, - } , + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "avalanchemines012", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "avalanchemines012", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -74,277 +74,274 @@ Scoring: -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - -{name = 'corvp', x = 3656, y = 323, z = 3528, rot = 0 , team = 0}, -{name = 'cormex', x = 3848, y = 322, z = 3832, rot = 0 , team = 0}, -{name = 'cormlv', x = 3542, y = 320, z = 3633, rot = -16384 , team = 0}, -{name = 'cormex', x = 3880, y = 325, z = 3432, rot = 0 , team = 0}, -{name = 'cormlv', x = 3466, y = 322, z = 3271, rot = -16384 , team = 0}, -{name = 'cormlv', x = 3513, y = 321, z = 3557, rot = -16384 , team = 0}, -{name = 'corfav', x = 3514, y = 322, z = 3449, rot = -16384 , team = 0}, -{name = 'corfav', x = 3575, y = 321, z = 3543, rot = -16384 , team = 0}, -{name = 'corfav', x = 3582, y = 319, z = 3628, rot = -16384 , team = 0}, -{name = 'corfav', x = 3512, y = 322, z = 3409, rot = -16384 , team = 0}, -{name = 'corfav', x = 3566, y = 322, z = 3375, rot = -16384 , team = 0}, -{name = 'cormex', x = 3464, y = 324, z = 3160, rot = 0 , team = 0}, -{name = 'corrad', x = 3696, y = 324, z = 3392, rot = 0 , team = 0}, ---{name = 'corestor', x = 3776, y = 321, z = 3552, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3824, y = 319, z = 3680, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3760, y = 321, z = 3680, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3696, y = 319, z = 3680, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3696, y = 321, z = 3744, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3760, y = 320, z = 3744, rot = 0 , team = 0}, -{name = 'coradvsol', x = 3824, y = 319, z = 3744, rot = 0 , team = 0}, -{name = 'corrad', x = 1065, y = 325, z = 4047, rot = 0 , team = 0}, -{name = 'corjamt', x = 3680, y = 323, z = 3424, rot = 0 , team = 0}, -{name = 'cordrag', x = 4080, y = 326, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 4048, y = 326, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 4016, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3984, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3952, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3920, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3888, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3856, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3824, y = 324, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3568, y = 324, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3536, y = 325, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3504, y = 324, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3472, y = 324, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3440, y = 323, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3120, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3152, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3184, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3216, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3248, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 323, z = 3280, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 322, z = 3312, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 322, z = 3344, rot = 0 , team = 0}, -{name = 'cormine1', x = 3768, y = 323, z = 3080, rot = 0 , team = 0}, -{name = 'cormine1', x = 3704, y = 323, z = 3080, rot = 0 , team = 0}, -{name = 'cormine1', x = 3640, y = 323, z = 3080, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 304, z = 3664, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 300, z = 3696, rot = 0 , team = 0}, -{name = 'cormine1', x = 3336, y = 323, z = 3320, rot = 0 , team = 0}, -{name = 'cormine1', x = 3240, y = 323, z = 3320, rot = 0 , team = 0}, -{name = 'cormine1', x = 3240, y = 319, z = 3400, rot = 0 , team = 0}, -{name = 'cormine1', x = 3240, y = 309, z = 3480, rot = 0 , team = 0}, -{name = 'cormine1', x = 3240, y = 293, z = 3560, rot = 0 , team = 0}, -{name = 'cormine1', x = 3240, y = 275, z = 3640, rot = 0 , team = 0}, -{name = 'cormine1', x = 3336, y = 282, z = 3640, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 296, z = 3728, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 284, z = 3760, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 274, z = 3792, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 272, z = 3824, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 271, z = 3856, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 271, z = 3888, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 269, z = 3920, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 265, z = 3952, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 261, z = 3984, rot = 0 , team = 0}, -{name = 'corrad', x = 3853, y = 683, z = 122, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 263, z = 4016, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 265, z = 4048, rot = 0 , team = 0}, -{name = 'cordrag', x = 3408, y = 270, z = 4080, rot = 0 , team = 0}, -{name = 'armstump', x = 907, y = 144, z = 3084, rot = 0 , team = 1}, -{name = 'armstump', x = 948, y = 144, z = 3084, rot = 0 , team = 1}, -{name = 'armstump', x = 989, y = 144, z = 3084, rot = 0 , team = 1}, -{name = 'armstump', x = 1029, y = 144, z = 3083, rot = 0 , team = 1}, -{name = 'armstump', x = 1070, y = 144, z = 3084, rot = 0 , team = 1}, -{name = 'armstump', x = 917, y = 143, z = 3123, rot = 0 , team = 1}, -{name = 'armstump', x = 957, y = 144, z = 3123, rot = 0 , team = 1}, -{name = 'armstump', x = 998, y = 144, z = 3123, rot = 0 , team = 1}, -{name = 'armstump', x = 1038, y = 144, z = 3122, rot = 0 , team = 1}, -{name = 'armstump', x = 1078, y = 144, z = 3123, rot = 0 , team = 1}, -{name = 'armstump', x = 905, y = 142, z = 3162, rot = 0 , team = 1}, -{name = 'armstump', x = 945, y = 143, z = 3162, rot = 0 , team = 1}, -{name = 'armstump', x = 987, y = 144, z = 3162, rot = 0 , team = 1}, -{name = 'armstump', x = 1027, y = 145, z = 3161, rot = 0 , team = 1}, -{name = 'armstump', x = 1068, y = 145, z = 3162, rot = 0 , team = 1}, -{name = 'armstump', x = 913, y = 143, z = 3201, rot = 0 , team = 1}, -{name = 'armstump', x = 953, y = 144, z = 3202, rot = 0 , team = 1}, -{name = 'armstump', x = 994, y = 145, z = 3202, rot = 0 , team = 1}, -{name = 'armstump', x = 1034, y = 146, z = 3201, rot = 0 , team = 1}, -{name = 'armstump', x = 1074, y = 146, z = 3202, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 327, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 328, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 329, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 330, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 332, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 335, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 338, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 341, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 345, z = 1459, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 327, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 328, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 329, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 331, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 334, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 336, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 339, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 343, z = 1491, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 325, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 328, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 329, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 331, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 332, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 333, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 336, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 340, z = 1523, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 327, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 327, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 329, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 330, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 331, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 332, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 334, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 337, z = 1555, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 328, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 328, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 328, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 329, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 330, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 331, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 332, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 334, z = 1587, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 327, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 327, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 328, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 328, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 329, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 329, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 329, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 332, z = 1619, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 327, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 327, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 327, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 328, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 326, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 329, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 330, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 331, z = 1651, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 326, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 327, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 327, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 326, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 327, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 327, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 328, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 328, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 329, z = 1683, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 325, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 326, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 327, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 326, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 326, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 327, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 327, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 327, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 328, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 328, z = 1715, rot = 0 , team = 1}, -{name = 'armpw', x = 2208, y = 325, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2240, y = 326, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2272, y = 326, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2304, y = 326, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2336, y = 326, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2368, y = 326, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2400, y = 327, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2432, y = 327, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2464, y = 328, z = 1747, rot = 0 , team = 1}, -{name = 'armpw', x = 2496, y = 328, z = 1747, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 595, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 593, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 592, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 594, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 594, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 593, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 592, z = 391, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 595, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 594, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 592, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 593, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 593, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 593, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 592, z = 423, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 595, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 594, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 593, z = 455, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 594, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 594, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 593, z = 487, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 594, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 593, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 592, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 593, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 593, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 594, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 594, z = 519, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3374, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3406, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3438, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3470, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3502, y = 594, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3534, y = 593, z = 551, rot = 0 , team = 1}, -{name = 'armflash', x = 3310, y = 593, z = 583, rot = 0 , team = 1}, -{name = 'armflash', x = 3342, y = 593, z = 583, rot = 0 , team = 1}, -{name = 'cornanotc', x = 3771, y = 321, z = 3614, rot = 0 , team = 0}, - + { name = "corvp", x = 3656, y = 323, z = 3528, rot = 0, team = 0 }, + { name = "cormex", x = 3848, y = 322, z = 3832, rot = 0, team = 0 }, + { name = "cormlv", x = 3542, y = 320, z = 3633, rot = -16384, team = 0 }, + { name = "cormex", x = 3880, y = 325, z = 3432, rot = 0, team = 0 }, + { name = "cormlv", x = 3466, y = 322, z = 3271, rot = -16384, team = 0 }, + { name = "cormlv", x = 3513, y = 321, z = 3557, rot = -16384, team = 0 }, + { name = "corfav", x = 3514, y = 322, z = 3449, rot = -16384, team = 0 }, + { name = "corfav", x = 3575, y = 321, z = 3543, rot = -16384, team = 0 }, + { name = "corfav", x = 3582, y = 319, z = 3628, rot = -16384, team = 0 }, + { name = "corfav", x = 3512, y = 322, z = 3409, rot = -16384, team = 0 }, + { name = "corfav", x = 3566, y = 322, z = 3375, rot = -16384, team = 0 }, + { name = "cormex", x = 3464, y = 324, z = 3160, rot = 0, team = 0 }, + { name = "corrad", x = 3696, y = 324, z = 3392, rot = 0, team = 0 }, + --{name = 'corestor', x = 3776, y = 321, z = 3552, rot = 0 , team = 0}, + { name = "coradvsol", x = 3824, y = 319, z = 3680, rot = 0, team = 0 }, + { name = "coradvsol", x = 3760, y = 321, z = 3680, rot = 0, team = 0 }, + { name = "coradvsol", x = 3696, y = 319, z = 3680, rot = 0, team = 0 }, + { name = "coradvsol", x = 3696, y = 321, z = 3744, rot = 0, team = 0 }, + { name = "coradvsol", x = 3760, y = 320, z = 3744, rot = 0, team = 0 }, + { name = "coradvsol", x = 3824, y = 319, z = 3744, rot = 0, team = 0 }, + { name = "corrad", x = 1065, y = 325, z = 4047, rot = 0, team = 0 }, + { name = "corjamt", x = 3680, y = 323, z = 3424, rot = 0, team = 0 }, + { name = "cordrag", x = 4080, y = 326, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 4048, y = 326, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 4016, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3984, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3952, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3920, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3888, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3856, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3824, y = 324, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3568, y = 324, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3536, y = 325, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3504, y = 324, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3472, y = 324, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3440, y = 323, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3120, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3152, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3184, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3216, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3248, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 323, z = 3280, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 322, z = 3312, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 322, z = 3344, rot = 0, team = 0 }, + { name = "cormine1", x = 3768, y = 323, z = 3080, rot = 0, team = 0 }, + { name = "cormine1", x = 3704, y = 323, z = 3080, rot = 0, team = 0 }, + { name = "cormine1", x = 3640, y = 323, z = 3080, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 304, z = 3664, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 300, z = 3696, rot = 0, team = 0 }, + { name = "cormine1", x = 3336, y = 323, z = 3320, rot = 0, team = 0 }, + { name = "cormine1", x = 3240, y = 323, z = 3320, rot = 0, team = 0 }, + { name = "cormine1", x = 3240, y = 319, z = 3400, rot = 0, team = 0 }, + { name = "cormine1", x = 3240, y = 309, z = 3480, rot = 0, team = 0 }, + { name = "cormine1", x = 3240, y = 293, z = 3560, rot = 0, team = 0 }, + { name = "cormine1", x = 3240, y = 275, z = 3640, rot = 0, team = 0 }, + { name = "cormine1", x = 3336, y = 282, z = 3640, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 296, z = 3728, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 284, z = 3760, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 274, z = 3792, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 272, z = 3824, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 271, z = 3856, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 271, z = 3888, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 269, z = 3920, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 265, z = 3952, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 261, z = 3984, rot = 0, team = 0 }, + { name = "corrad", x = 3853, y = 683, z = 122, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 263, z = 4016, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 265, z = 4048, rot = 0, team = 0 }, + { name = "cordrag", x = 3408, y = 270, z = 4080, rot = 0, team = 0 }, + { name = "armstump", x = 907, y = 144, z = 3084, rot = 0, team = 1 }, + { name = "armstump", x = 948, y = 144, z = 3084, rot = 0, team = 1 }, + { name = "armstump", x = 989, y = 144, z = 3084, rot = 0, team = 1 }, + { name = "armstump", x = 1029, y = 144, z = 3083, rot = 0, team = 1 }, + { name = "armstump", x = 1070, y = 144, z = 3084, rot = 0, team = 1 }, + { name = "armstump", x = 917, y = 143, z = 3123, rot = 0, team = 1 }, + { name = "armstump", x = 957, y = 144, z = 3123, rot = 0, team = 1 }, + { name = "armstump", x = 998, y = 144, z = 3123, rot = 0, team = 1 }, + { name = "armstump", x = 1038, y = 144, z = 3122, rot = 0, team = 1 }, + { name = "armstump", x = 1078, y = 144, z = 3123, rot = 0, team = 1 }, + { name = "armstump", x = 905, y = 142, z = 3162, rot = 0, team = 1 }, + { name = "armstump", x = 945, y = 143, z = 3162, rot = 0, team = 1 }, + { name = "armstump", x = 987, y = 144, z = 3162, rot = 0, team = 1 }, + { name = "armstump", x = 1027, y = 145, z = 3161, rot = 0, team = 1 }, + { name = "armstump", x = 1068, y = 145, z = 3162, rot = 0, team = 1 }, + { name = "armstump", x = 913, y = 143, z = 3201, rot = 0, team = 1 }, + { name = "armstump", x = 953, y = 144, z = 3202, rot = 0, team = 1 }, + { name = "armstump", x = 994, y = 145, z = 3202, rot = 0, team = 1 }, + { name = "armstump", x = 1034, y = 146, z = 3201, rot = 0, team = 1 }, + { name = "armstump", x = 1074, y = 146, z = 3202, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 327, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 328, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 329, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 330, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 332, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 335, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 338, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 341, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 345, z = 1459, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 327, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 328, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 329, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 331, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 334, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 336, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 339, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 343, z = 1491, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 325, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 328, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 329, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 331, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 332, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 333, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 336, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 340, z = 1523, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 327, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 327, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 329, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 330, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 331, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 332, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 334, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 337, z = 1555, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 328, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 328, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 328, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 329, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 330, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 331, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 332, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 334, z = 1587, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 327, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 327, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 328, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 328, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 329, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 329, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 329, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 332, z = 1619, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 327, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 327, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 327, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 328, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 326, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 329, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 330, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 331, z = 1651, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 326, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 327, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 327, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 326, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 327, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 327, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 328, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 328, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 329, z = 1683, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 325, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 326, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 327, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 326, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 326, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 327, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 327, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 327, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 328, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 328, z = 1715, rot = 0, team = 1 }, + { name = "armpw", x = 2208, y = 325, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2240, y = 326, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2272, y = 326, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2304, y = 326, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2336, y = 326, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2368, y = 326, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2400, y = 327, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2432, y = 327, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2464, y = 328, z = 1747, rot = 0, team = 1 }, + { name = "armpw", x = 2496, y = 328, z = 1747, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 595, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 593, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 592, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 594, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 594, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 593, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 592, z = 391, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 595, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 594, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 592, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 593, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 593, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 593, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 592, z = 423, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 595, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 594, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 593, z = 455, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 594, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 594, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 593, z = 487, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 594, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 593, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 592, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 593, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 593, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 594, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 594, z = 519, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3374, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3406, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3438, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3470, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3502, y = 594, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3534, y = 593, z = 551, rot = 0, team = 1 }, + { name = "armflash", x = 3310, y = 593, z = 583, rot = 0, team = 1 }, + { name = "armflash", x = 3342, y = 593, z = 583, rot = 0, team = 1 }, + { name = "cornanotc", x = 3771, y = 321, z = 3614, rot = 0, team = 0 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - -- {name = 'armack_dead', x = 1320, y = 89, z = 460, rot = -928 , resurrectas = 'armack', team = 0}, - - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; - - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ - - startscript = [[ + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + -- {name = 'armack_dead', x = 1320, y = 89, z = 460, rot = -928 , resurrectas = 'armack', team = 0}, + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; + + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ + + startscript = [[ [Game] { [allyTeam0] @@ -429,7 +426,6 @@ Scoring: } ]], - } return scenariodata @@ -508,4 +504,5 @@ return scenariodata nohelperais = 0; } -]]-- +]] +-- diff --git a/singleplayer/scenarios/scenario013.lua b/singleplayer/scenarios/scenario013.lua index b9c7968634a..452c7c65639 100644 --- a/singleplayer/scenarios/scenario013.lua +++ b/singleplayer/scenarios/scenario013.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 13, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "shoretoshorevsbarb013", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "Testing the Waters", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario013.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Shipyards can be assisted by all constructors", -- This text will be drawn over image - summary = [[Test your skill in naval and aircraft warfare on one of the widest maps. You must defeat a single enemy, who like you, is still quite new to naval combat..]], - briefing = [[Naval battles in BAR are focused on the interaction between ships, submarines, hovercraft, aircraft and occasionally, amphibious units. + index = 13, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "shoretoshorevsbarb013", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "Testing the Waters", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario013.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Shipyards can be assisted by all constructors", -- This text will be drawn over image + summary = [[Test your skill in naval and aircraft warfare on one of the widest maps. You must defeat a single enemy, who like you, is still quite new to naval combat..]], + briefing = [[Naval battles in BAR are focused on the interaction between ships, submarines, hovercraft, aircraft and occasionally, amphibious units. Tips: @@ -34,36 +34,36 @@ Scoring: ]], - mapfilename = "Shore_to_Shore_V3", -- the name of the map to be displayed here - playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = 0}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = 0}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100}, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all construction units", -- This is plaintext, but should be reflected in startscript - losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "Shore_to_Shore_V3", -- the name of the map to be displayed here + playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all construction units", -- This is plaintext, but should be reflected in startscript + losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "shoretoshorevsbarb013", --must be present for scores + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "shoretoshorevsbarb013", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { @@ -147,7 +147,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario014.lua b/singleplayer/scenarios/scenario014.lua index de874aa64eb..96c1f547cb6 100644 --- a/singleplayer/scenarios/scenario014.lua +++ b/singleplayer/scenarios/scenario014.lua @@ -1,13 +1,13 @@ local scenariodata = { - index = 14, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "pinewoodvsbarb014", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "A Safe Haven", -- can be anything - author = "Beherith", -- your name here - imagepath = "scenario014.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Build a shipyard from the shores.", -- This text will be drawn over image - summary = [[An enemy Commander has landed on the southeast corner of the map, neutralize it and destroy every last unit to claim all the resources of this world.]], - briefing = [[The map is split in two by a river, which is passable on both sides by hovercraft and amphibious units. The central bridge can be easily defended from the outcrops on the top. Make sure to set up some light defences on your end of the bridge as soon as possible. The mountain ranges will provide adequate cover against long-range plasma cannons. + index = 14, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "pinewoodvsbarb014", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "A Safe Haven", -- can be anything + author = "Beherith", -- your name here + imagepath = "scenario014.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Build a shipyard from the shores.", -- This text will be drawn over image + summary = [[An enemy Commander has landed on the southeast corner of the map, neutralize it and destroy every last unit to claim all the resources of this world.]], + briefing = [[The map is split in two by a river, which is passable on both sides by hovercraft and amphibious units. The central bridge can be easily defended from the outcrops on the top. Make sure to set up some light defences on your end of the bridge as soon as possible. The mountain ranges will provide adequate cover against long-range plasma cannons. Tips: @@ -39,36 +39,36 @@ The difficulty modifier will change the amount of resources you and the enemy ca ]], - mapfilename = "Pinewood_Derby_V1", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "25%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1200, -- par time in seconds - parresources = 100000, -- par resource amount - difficulty = 2, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all construction units", -- This is plaintext, but should be reflected in startscript - losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - --armavp = 0, - --coravp = 0, - } , - - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "pinewoodvsbarb014", --must be present for scores + mapfilename = "Pinewood_Derby_V1", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "25%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1200, -- par time in seconds + parresources = 100000, -- par resource amount + difficulty = 2, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all construction units", -- This is plaintext, but should be reflected in startscript + losscondition = "Lose all of your construction units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + --armavp = 0, + --coravp = 0, + }, + + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "pinewoodvsbarb014", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { @@ -153,7 +153,6 @@ The difficulty modifier will change the amount of resources you and the enemy ca nohelperais = 0; } ]], - } return scenariodata -- scenariodata diff --git a/singleplayer/scenarios/scenario015.lua b/singleplayer/scenarios/scenario015.lua index 4547f572272..4e0144927fc 100644 --- a/singleplayer/scenarios/scenario015.lua +++ b/singleplayer/scenarios/scenario015.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 15, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "thronekoth015", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "King of the Hill", -- can be anything - author = "Beherith", -- your name here + index = 15, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "thronekoth015", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "King of the Hill", -- can be anything + author = "Beherith", -- your name here isnew = true, - imagepath = "scenario015.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Its cold and lonely up here", -- This text will be drawn over image - summary = [[7 enemy Commanders are allied against you, at the top of Throne. Destroy all of them to keep your crown.]], - briefing = [[The seven outcroppings on the edge of Throne all occupied by enemy Commanders. They will send early scouting forces, and if left to expand too much, will advance in technology rapidly. The third level is secured for you with the most basic defences, and some light anti-air. + imagepath = "scenario015.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Its cold and lonely up here", -- This text will be drawn over image + summary = [[7 enemy Commanders are allied against you, at the top of Throne. Destroy all of them to keep your crown.]], + briefing = [[The seven outcroppings on the edge of Throne all occupied by enemy Commanders. They will send early scouting forces, and if left to expand too much, will advance in technology rapidly. The third level is secured for you with the most basic defences, and some light anti-air. Tips: @@ -38,58 +38,57 @@ The difficulty modifier will change the amount of resources you and the enemy ca ]], - mapfilename = "Throne_V8", -- the name of the map to be displayed here - playerstartx = "50%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 1000000, -- par resource amount - difficulty = 3, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Cortex"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - --armavp = 0, - --coravp = 0, - } , - + mapfilename = "Throne_V8", -- the name of the map to be displayed here + playerstartx = "50%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 1000000, -- par resource amount + difficulty = 3, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Cortex" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "thronekoth015", --must be present for scores + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "thronekoth015", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides unitloadout = { - {name = 'corrad', x = 5760, y = 751, z = 5616, rot = 0 , team = 7}, - {name = 'coradvsol', x = 5760, y = 753, z = 5664, rot = 0 , team = 7}, - {name = 'cormaw', x = 5264, y = 531, z = 4928, rot = 0 , team = 7}, - {name = 'cormadsam', x = 5640, y = 578, z = 6472, rot = 0 , team = 7}, - {name = 'cormaw', x = 5520, y = 535, z = 4736, rot = 0 , team = 7}, - {name = 'cormadsam', x = 7064, y = 565, z = 5576, rot = 0 , team = 7}, - {name = 'cormaw', x = 7344, y = 552, z = 5408, rot = 0 , team = 7}, - {name = 'cormaw', x = 7360, y = 554, z = 5696, rot = 0 , team = 7}, - {name = 'cormadsam', x = 5512, y = 556, z = 4952, rot = 0 , team = 7}, - {name = 'cormaw', x = 5712, y = 565, z = 6784, rot = 0 , team = 7}, - {name = 'cormaw', x = 5408, y = 561, z = 6656, rot = 0 , team = 7}, - {name = 'corcom', x = 6068, y = 755, z = 5565, rot = -688 , team = 7}, - {name = 'armcom', x = 1405, y = 85, z = 2774, rot = 0 , team = 0}, - {name = 'corcom', x = 5334, y = 88, z = 844, rot = 0 , team = 1}, - {name = 'armcom', x = 10114, y = 86, z = 2076, rot = 0 , team = 2}, - {name = 'corcom', x = 11342, y = 89, z = 6616, rot = 0 , team = 3}, - {name = 'armcom', x = 8995, y = 87, z = 10831, rot = 0 , team = 4}, - {name = 'armcom', x = 4417, y = 88, z = 11187, rot = -11476 , team = 5}, - {name = 'corcom', x = 903, y = 87, z = 7821, rot = 0 , team = 6}, - } - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + { name = "corrad", x = 5760, y = 751, z = 5616, rot = 0, team = 7 }, + { name = "coradvsol", x = 5760, y = 753, z = 5664, rot = 0, team = 7 }, + { name = "cormaw", x = 5264, y = 531, z = 4928, rot = 0, team = 7 }, + { name = "cormadsam", x = 5640, y = 578, z = 6472, rot = 0, team = 7 }, + { name = "cormaw", x = 5520, y = 535, z = 4736, rot = 0, team = 7 }, + { name = "cormadsam", x = 7064, y = 565, z = 5576, rot = 0, team = 7 }, + { name = "cormaw", x = 7344, y = 552, z = 5408, rot = 0, team = 7 }, + { name = "cormaw", x = 7360, y = 554, z = 5696, rot = 0, team = 7 }, + { name = "cormadsam", x = 5512, y = 556, z = 4952, rot = 0, team = 7 }, + { name = "cormaw", x = 5712, y = 565, z = 6784, rot = 0, team = 7 }, + { name = "cormaw", x = 5408, y = 561, z = 6656, rot = 0, team = 7 }, + { name = "corcom", x = 6068, y = 755, z = 5565, rot = -688, team = 7 }, + { name = "armcom", x = 1405, y = 85, z = 2774, rot = 0, team = 0 }, + { name = "corcom", x = 5334, y = 88, z = 844, rot = 0, team = 1 }, + { name = "armcom", x = 10114, y = 86, z = 2076, rot = 0, team = 2 }, + { name = "corcom", x = 11342, y = 89, z = 6616, rot = 0, team = 3 }, + { name = "armcom", x = 8995, y = 87, z = 10831, rot = 0, team = 4 }, + { name = "armcom", x = 4417, y = 88, z = 11187, rot = -11476, team = 5 }, + { name = "corcom", x = 903, y = 87, z = 7821, rot = 0, team = 6 }, + }, + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [game] { @@ -309,7 +308,6 @@ The difficulty modifier will change the amount of resources you and the enemy ca } ]], - } return scenariodata -- scenariodata diff --git a/singleplayer/scenarios/scenario016.lua b/singleplayer/scenarios/scenario016.lua index 405ae1b5d76..05a89a84d08 100644 --- a/singleplayer/scenarios/scenario016.lua +++ b/singleplayer/scenarios/scenario016.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 16, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "neuropeww225", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "World War XXV", -- can be anything - author = "Beherith", -- your name here + index = 16, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "neuropeww225", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "World War XXV", -- can be anything + author = "Beherith", -- your name here isnew = true, - imagepath = "scenario016.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Neurope has experienced quite the geological shift", -- This text will be drawn over image - summary = [[Multiple allegiances have formed around continental Neurope, and you must retake the entire continental area from the northwest island]], - briefing = [[One large alliance of three commanders controls the center of the continent, the other is formed between the east, southeast and southwest. The northern and central territories have attempted to remain neutral, but are gearing up for battle. + imagepath = "scenario016.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Neurope has experienced quite the geological shift", -- This text will be drawn over image + summary = [[Multiple allegiances have formed around continental Neurope, and you must retake the entire continental area from the northwest island]], + briefing = [[One large alliance of three commanders controls the center of the continent, the other is formed between the east, southeast and southwest. The northern and central territories have attempted to remain neutral, but are gearing up for battle. You will start on the northwestern large island, and the northern resource rich island is still unclaimed according to our scouting reports. @@ -31,39 +31,39 @@ The difficulty modifier will change the amount of resources you and the enemy re - Brutal: Regular resources for you, +100% for the enemy ]], - mapfilename = "Neurope_Remake 4.2", -- the name of the map to be displayed here - playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 3000, -- par time in seconds - parresources = 10000000, -- par resource amount - difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of your Commander", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "Neurope_Remake 4.2", -- the name of the map to be displayed here + playerstartx = "5%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 3000, -- par time in seconds + parresources = 10000000, -- par resource amount + difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of your Commander", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "neuropeww225", --must be present for scores + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "neuropeww225", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides --unitloadout = { -- {name = 'corrad', x = 5760, y = 751, z = 5616, rot = 0 , team = 7}, --} - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { @@ -297,7 +297,6 @@ The difficulty modifier will change the amount of resources you and the enemy re } ]], - } return scenariodata -- scenariodata diff --git a/singleplayer/scenarios/scenario017.lua b/singleplayer/scenarios/scenario017.lua index db0c9efdf7e..64ad8adf92f 100644 --- a/singleplayer/scenarios/scenario017.lua +++ b/singleplayer/scenarios/scenario017.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 17, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "archsimkatshelpers017", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "A Helping Hand", -- can be anything - author = "Beherith", -- your name here + index = 17, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "archsimkatshelpers017", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "A Helping Hand", -- can be anything + author = "Beherith", -- your name here isnew = true, - imagepath = "scenario017.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Construction units and Nano turrets can assist in building anything.", -- This text will be drawn over image - summary = [[You and a team of two other Commanders are tasked with destroying all other Commanders on the enemy team.]], - briefing = [[Three enemy Commanders are also gaining a foothold in this area. The map is made up of three main lanes, you must push through your lane to destroy all of them. Two friendly Commanders have joined in the fight with you, and while they arent the brightest bulbs, they will make holding your portion of the map easier. + imagepath = "scenario017.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Construction units and Nano turrets can assist in building anything.", -- This text will be drawn over image + summary = [[You and a team of two other Commanders are tasked with destroying all other Commanders on the enemy team.]], + briefing = [[Three enemy Commanders are also gaining a foothold in this area. The map is made up of three main lanes, you must push through your lane to destroy all of them. Two friendly Commanders have joined in the fight with you, and while they arent the brightest bulbs, they will make holding your portion of the map easier. Tips: - Almost all units can pass the shallow water separating the lanes on the map. @@ -28,38 +28,38 @@ The difficulty modifier will change the amount of resources you and the enemy re - Brutal: Regular resources for you, +100% for the enemy ]], - mapfilename = "Archsimkats_Valley_V1", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1500, -- par time in seconds - parresources = 50000, -- par resource amount - difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Armada","Cortex","Random"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of all allied Commanders", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - --armavp = 0, - --coravp = 0, - } , - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "archsimkatshelpers017", --must be present for scores + mapfilename = "Archsimkats_Valley_V1", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "50%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1500, -- par time in seconds + parresources = 50000, -- par resource amount + difficulty = 1, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Armada", "Cortex", "Random" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of all allied Commanders", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + --armavp = 0, + --coravp = 0, + }, + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "archsimkatshelpers017", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides --unitloadout = { -- {name = 'corrad', x = 5760, y = 751, z = 5616, rot = 0 , team = 7}, --} - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] @@ -226,7 +226,6 @@ The difficulty modifier will change the amount of resources you and the enemy re ]], - } return scenariodata -- scenariodata diff --git a/singleplayer/scenarios/scenario018.lua b/singleplayer/scenarios/scenario018.lua index 3987451396e..ca251192b68 100644 --- a/singleplayer/scenarios/scenario018.lua +++ b/singleplayer/scenarios/scenario018.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 18, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "pinewoodfatboy018", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "One Robot Army", -- can be anything - author = "Beherith", -- your name here - isnew = true, - imagepath = "scenario018.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Gunslingers heal and gain experience quickly.", -- This text will be drawn over image - summary = [[You are left with a rogue force of a handful of units, and no base to take on the dreadful Cortex. Fatboy, Gunslinger, Welder and a minor foray of supporting units are your last hope.]], - briefing = [[After a lost battle, your base is left crippled beyond repair, and you only have a few units remaining to take out the Cortex stronghold. Destroy the Cortex Commander with what you have left, while trying to keep all of your units alive. + index = 18, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "pinewoodfatboy018", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "One Robot Army", -- can be anything + author = "Beherith", -- your name here + isnew = true, + imagepath = "scenario018.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Gunslingers heal and gain experience quickly.", -- This text will be drawn over image + summary = [[You are left with a rogue force of a handful of units, and no base to take on the dreadful Cortex. Fatboy, Gunslinger, Welder and a minor foray of supporting units are your last hope.]], + briefing = [[After a lost battle, your base is left crippled beyond repair, and you only have a few units remaining to take out the Cortex stronghold. Destroy the Cortex Commander with what you have left, while trying to keep all of your units alive. You start the game with Fatboy, Gunslinger, Welder, a Compass radar bot, some Ghost spies, and two Lazarus resurrections bots, and just enough energy to keep the spies cloaked, and the radar in working condition. @@ -38,344 +38,344 @@ The difficulty modifier will change the amount of resources you and the enemy re - Brutal: Regular resources for you, +100% for the enemy ]], - mapfilename = "Pinewood_Derby_V1", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "25%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1200, -- par time in seconds - parresources = 50000, -- par resource amount - difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of all your units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - coravp = 0, + mapfilename = "Pinewood_Derby_V1", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "25%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1200, -- par time in seconds + parresources = 50000, -- par resource amount + difficulty = 5, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of all your units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + coravp = 0, coralab = 0, corsy = 0, corhp = 0, corfhp = 0, corpun = 0, corap = 0, - } , - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", - scenarioid = "pinewoodfatboy018", --must be present for scores + }, + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", + scenarioid = "pinewoodfatboy018", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides unitloadout = { --{name = 'armcom', x = 5500, y = 198, z = 2500, rot = 0 , team = 1}, --{name = 'armcom', x = 576, y = 198, z = 381, rot = 25658 , team = 0}, - {name = 'corllt', x = 944, y = 169, z = 2128, rot = 16384 , team = 1}, - {name = 'corllt', x = 1376, y = 83, z = 2016, rot = 16384 , team = 1}, - {name = 'corllt', x = 1312, y = 79, z = 2144, rot = 16384 , team = 1}, - {name = 'corrad', x = 1072, y = 179, z = 2560, rot = 16384 , team = 1}, + { name = "corllt", x = 944, y = 169, z = 2128, rot = 16384, team = 1 }, + { name = "corllt", x = 1376, y = 83, z = 2016, rot = 16384, team = 1 }, + { name = "corllt", x = 1312, y = 79, z = 2144, rot = 16384, team = 1 }, + { name = "corrad", x = 1072, y = 179, z = 2560, rot = 16384, team = 1 }, --{name = 'corca', x = 4795, y = 400, z = 2260, rot = 5578 , team = 1}, - {name = 'corllt', x = 752, y = 141, z = 2160, rot = 16384 , team = 1}, - {name = 'cordrag', x = 496, y = 92, z = 2160, rot = 16384 , team = 1}, - {name = 'corhlt', x = 800, y = 173, z = 2800, rot = 16384 , team = 1}, - {name = 'corrad', x = 928, y = 177, z = 2736, rot = 16384 , team = 1}, - {name = 'corexp', x = 1880, y = 237, z = 2808, rot = 16384 , team = 1}, - {name = 'cordrag', x = 1824, y = 236, z = 2672, rot = 16384 , team = 1}, - {name = 'cordrag', x = 1792, y = 236, z = 2784, rot = 16384 , team = 1}, - {name = 'cordrag', x = 1744, y = 226, z = 2880, rot = 16384 , team = 1}, - {name = 'cordrag', x = 1712, y = 222, z = 2928, rot = 16384 , team = 1}, - {name = 'cordrag', x = 1776, y = 235, z = 2832, rot = 16384 , team = 1}, - {name = 'corjamt', x = 1936, y = 239, z = 2880, rot = 16384 , team = 1}, - {name = 'corjamt', x = 1968, y = 237, z = 2752, rot = 16384 , team = 1}, - {name = 'corerad', x = 1872, y = 239, z = 2960, rot = 16384 , team = 1}, - {name = 'corerad', x = 1904, y = 238, z = 2688, rot = 16384 , team = 1}, - {name = 'corrad', x = 1792, y = 238, z = 2992, rot = 16384 , team = 1}, + { name = "corllt", x = 752, y = 141, z = 2160, rot = 16384, team = 1 }, + { name = "cordrag", x = 496, y = 92, z = 2160, rot = 16384, team = 1 }, + { name = "corhlt", x = 800, y = 173, z = 2800, rot = 16384, team = 1 }, + { name = "corrad", x = 928, y = 177, z = 2736, rot = 16384, team = 1 }, + { name = "corexp", x = 1880, y = 237, z = 2808, rot = 16384, team = 1 }, + { name = "cordrag", x = 1824, y = 236, z = 2672, rot = 16384, team = 1 }, + { name = "cordrag", x = 1792, y = 236, z = 2784, rot = 16384, team = 1 }, + { name = "cordrag", x = 1744, y = 226, z = 2880, rot = 16384, team = 1 }, + { name = "cordrag", x = 1712, y = 222, z = 2928, rot = 16384, team = 1 }, + { name = "cordrag", x = 1776, y = 235, z = 2832, rot = 16384, team = 1 }, + { name = "corjamt", x = 1936, y = 239, z = 2880, rot = 16384, team = 1 }, + { name = "corjamt", x = 1968, y = 237, z = 2752, rot = 16384, team = 1 }, + { name = "corerad", x = 1872, y = 239, z = 2960, rot = 16384, team = 1 }, + { name = "corerad", x = 1904, y = 238, z = 2688, rot = 16384, team = 1 }, + { name = "corrad", x = 1792, y = 238, z = 2992, rot = 16384, team = 1 }, --{name = 'coraca', x = 5892, y = 198, z = 2299, rot = 30645 , team = 1}, - {name = 'corfort', x = 5424, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2464, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2464, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2496, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2496, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2528, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2528, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5424, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5392, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5456, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5488, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5520, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5552, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5456, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5488, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5520, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5552, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2528, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2496, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2464, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5584, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2560, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2528, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2496, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2464, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5616, y = 198, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5456, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5488, y = 198, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5520, y = 199, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5552, y = 199, z = 2432, rot = 16384 , team = 1}, - {name = 'corfort', x = 5552, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5520, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'corfort', x = 5488, y = 199, z = 2400, rot = 16384 , team = 1}, + { name = "corfort", x = 5424, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2464, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2464, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2496, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2496, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2528, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2528, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5424, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5392, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5456, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5488, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5520, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5552, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5456, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5488, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5520, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5552, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2528, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2496, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2464, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5584, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2560, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2528, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2496, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2464, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5616, y = 198, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5456, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5488, y = 198, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5520, y = 199, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5552, y = 199, z = 2432, rot = 16384, team = 1 }, + { name = "corfort", x = 5552, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5520, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "corfort", x = 5488, y = 199, z = 2400, rot = 16384, team = 1 }, --{name = 'corca', x = 5493, y = 116, z = 689, rot = 18785 , team = 1}, - {name = 'corcom', x = 5500, y = 199, z = 2500, rot = 18785 , team = 1}, - {name = 'corfort', x = 5456, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5360, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5328, y = 198, z = 2592, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5392, y = 198, z = 2624, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5392, y = 198, z = 2656, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5616, y = 198, z = 2624, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5616, y = 198, z = 2656, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5648, y = 199, z = 2592, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5680, y = 199, z = 2592, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5648, y = 198, z = 2400, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5680, y = 198, z = 2400, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5616, y = 198, z = 2368, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5616, y = 198, z = 2336, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5392, y = 199, z = 2368, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5392, y = 198, z = 2336, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5360, y = 199, z = 2400, rot = 16384 , team = 1}, - {name = 'cordrag', x = 5328, y = 198, z = 2400, rot = 16384 , team = 1}, - {name = 'cormex', x = 5480, y = 198, z = 2712, rot = 16384 , team = 1}, - {name = 'cormex', x = 5752, y = 198, z = 2504, rot = 16384 , team = 1}, - {name = 'cormex', x = 5656, y = 198, z = 2200, rot = 16384 , team = 1}, - {name = 'cornanotc', x = 5816, y = 199, z = 2040, rot = 16384 , team = 1}, - {name = 'cornanotc', x = 5768, y = 199, z = 2040, rot = 16384 , team = 1}, - {name = 'cornanotc', x = 5448, y = 198, z = 2024, rot = 16384 , team = 1}, - {name = 'cornanotc', x = 5400, y = 198, z = 2024, rot = 16384 , team = 1}, - {name = 'corlab', x = 5440, y = 198, z = 1904, rot = 32767 , team = 1}, - {name = 'corvp', x = 5784, y = 198, z = 1912, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5488, y = 198, z = 2128, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5424, y = 198, z = 2128, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5360, y = 199, z = 2128, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5744, y = 199, z = 2144, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5808, y = 198, z = 2144, rot = 32767 , team = 1}, - {name = 'coradvsol', x = 5872, y = 198, z = 2144, rot = 32767 , team = 1}, - {name = 'corwin', x = 5256, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5320, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5384, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5448, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5512, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5576, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5640, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corwin', x = 5704, y = 198, z = 2776, rot = 32767 , team = 1}, - {name = 'corexp', x = 3704, y = 237, z = 1368, rot = 32767 , team = 1}, - {name = 'corwin', x = 5704, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5640, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5576, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5512, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5448, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5384, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corrad', x = 3808, y = 234, z = 1232, rot = 32767 , team = 1}, - {name = 'corwin', x = 5320, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5256, y = 198, z = 2840, rot = 32767 , team = 1}, - {name = 'corwin', x = 5256, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corllt', x = 3680, y = 239, z = 1728, rot = 32767 , team = 1}, - {name = 'corwin', x = 5320, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corwin', x = 5384, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corhlt', x = 3568, y = 238, z = 1648, rot = 32767 , team = 1}, - {name = 'corwin', x = 5448, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corwin', x = 5512, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corhlt', x = 3520, y = 240, z = 1472, rot = 32767 , team = 1}, - {name = 'corwin', x = 5576, y = 199, z = 2904, rot = 32767 , team = 1}, - {name = 'corwin', x = 5640, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'corwin', x = 5704, y = 198, z = 2904, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3504, y = 131, z = 1776, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3472, y = 128, z = 1808, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3440, y = 128, z = 1840, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3424, y = 128, z = 1872, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3312, y = 128, z = 2000, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3280, y = 128, z = 2032, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3248, y = 124, z = 2064, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3488, y = 131, z = 1744, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3456, y = 128, z = 1776, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3440, y = 128, z = 1808, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3408, y = 128, z = 1840, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3296, y = 128, z = 1968, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3280, y = 128, z = 2000, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3248, y = 128, z = 2032, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3472, y = 129, z = 1712, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3440, y = 128, z = 1744, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3424, y = 128, z = 1776, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3392, y = 128, z = 1808, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3280, y = 128, z = 1936, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3248, y = 128, z = 1968, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3232, y = 128, z = 2000, rot = 32767 , team = 1}, - {name = 'cordrag', x = 3200, y = 129, z = 2032, rot = 32767 , team = 1}, - {name = 'cormex', x = 5880, y = 79, z = 616, rot = 32767 , team = 1}, - {name = 'cormex', x = 5896, y = 77, z = 264, rot = 32767 , team = 1}, - {name = 'cormex', x = 5000, y = 178, z = 568, rot = 32767 , team = 1}, - {name = 'corexp', x = 4472, y = 78, z = 952, rot = 32767 , team = 1}, - {name = 'corexp', x = 4136, y = 232, z = 200, rot = 32767 , team = 1}, - {name = 'corwin', x = 5736, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5672, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5608, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5544, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5480, y = 79, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5416, y = 80, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5352, y = 84, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5288, y = 94, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5224, y = 103, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5160, y = 103, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5096, y = 100, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 5032, y = 97, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4904, y = 82, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4840, y = 79, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4776, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4712, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4648, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4584, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4520, y = 78, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4456, y = 77, z = 104, rot = 32767 , team = 1}, - {name = 'corwin', x = 4520, y = 79, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 4584, y = 79, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 4648, y = 78, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 4712, y = 79, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 4776, y = 80, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 4840, y = 84, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5288, y = 101, z = 168, rot = 32767 , team = 1}, + { name = "corcom", x = 5500, y = 199, z = 2500, rot = 18785, team = 1 }, + { name = "corfort", x = 5456, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "cordrag", x = 5360, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "cordrag", x = 5328, y = 198, z = 2592, rot = 16384, team = 1 }, + { name = "cordrag", x = 5392, y = 198, z = 2624, rot = 16384, team = 1 }, + { name = "cordrag", x = 5392, y = 198, z = 2656, rot = 16384, team = 1 }, + { name = "cordrag", x = 5616, y = 198, z = 2624, rot = 16384, team = 1 }, + { name = "cordrag", x = 5616, y = 198, z = 2656, rot = 16384, team = 1 }, + { name = "cordrag", x = 5648, y = 199, z = 2592, rot = 16384, team = 1 }, + { name = "cordrag", x = 5680, y = 199, z = 2592, rot = 16384, team = 1 }, + { name = "cordrag", x = 5648, y = 198, z = 2400, rot = 16384, team = 1 }, + { name = "cordrag", x = 5680, y = 198, z = 2400, rot = 16384, team = 1 }, + { name = "cordrag", x = 5616, y = 198, z = 2368, rot = 16384, team = 1 }, + { name = "cordrag", x = 5616, y = 198, z = 2336, rot = 16384, team = 1 }, + { name = "cordrag", x = 5392, y = 199, z = 2368, rot = 16384, team = 1 }, + { name = "cordrag", x = 5392, y = 198, z = 2336, rot = 16384, team = 1 }, + { name = "cordrag", x = 5360, y = 199, z = 2400, rot = 16384, team = 1 }, + { name = "cordrag", x = 5328, y = 198, z = 2400, rot = 16384, team = 1 }, + { name = "cormex", x = 5480, y = 198, z = 2712, rot = 16384, team = 1 }, + { name = "cormex", x = 5752, y = 198, z = 2504, rot = 16384, team = 1 }, + { name = "cormex", x = 5656, y = 198, z = 2200, rot = 16384, team = 1 }, + { name = "cornanotc", x = 5816, y = 199, z = 2040, rot = 16384, team = 1 }, + { name = "cornanotc", x = 5768, y = 199, z = 2040, rot = 16384, team = 1 }, + { name = "cornanotc", x = 5448, y = 198, z = 2024, rot = 16384, team = 1 }, + { name = "cornanotc", x = 5400, y = 198, z = 2024, rot = 16384, team = 1 }, + { name = "corlab", x = 5440, y = 198, z = 1904, rot = 32767, team = 1 }, + { name = "corvp", x = 5784, y = 198, z = 1912, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5488, y = 198, z = 2128, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5424, y = 198, z = 2128, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5360, y = 199, z = 2128, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5744, y = 199, z = 2144, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5808, y = 198, z = 2144, rot = 32767, team = 1 }, + { name = "coradvsol", x = 5872, y = 198, z = 2144, rot = 32767, team = 1 }, + { name = "corwin", x = 5256, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5320, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5384, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5448, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5512, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5576, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5640, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corwin", x = 5704, y = 198, z = 2776, rot = 32767, team = 1 }, + { name = "corexp", x = 3704, y = 237, z = 1368, rot = 32767, team = 1 }, + { name = "corwin", x = 5704, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5640, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5576, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5512, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5448, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5384, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corrad", x = 3808, y = 234, z = 1232, rot = 32767, team = 1 }, + { name = "corwin", x = 5320, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5256, y = 198, z = 2840, rot = 32767, team = 1 }, + { name = "corwin", x = 5256, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corllt", x = 3680, y = 239, z = 1728, rot = 32767, team = 1 }, + { name = "corwin", x = 5320, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corwin", x = 5384, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corhlt", x = 3568, y = 238, z = 1648, rot = 32767, team = 1 }, + { name = "corwin", x = 5448, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corwin", x = 5512, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corhlt", x = 3520, y = 240, z = 1472, rot = 32767, team = 1 }, + { name = "corwin", x = 5576, y = 199, z = 2904, rot = 32767, team = 1 }, + { name = "corwin", x = 5640, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "corwin", x = 5704, y = 198, z = 2904, rot = 32767, team = 1 }, + { name = "cordrag", x = 3504, y = 131, z = 1776, rot = 32767, team = 1 }, + { name = "cordrag", x = 3472, y = 128, z = 1808, rot = 32767, team = 1 }, + { name = "cordrag", x = 3440, y = 128, z = 1840, rot = 32767, team = 1 }, + { name = "cordrag", x = 3424, y = 128, z = 1872, rot = 32767, team = 1 }, + { name = "cordrag", x = 3312, y = 128, z = 2000, rot = 32767, team = 1 }, + { name = "cordrag", x = 3280, y = 128, z = 2032, rot = 32767, team = 1 }, + { name = "cordrag", x = 3248, y = 124, z = 2064, rot = 32767, team = 1 }, + { name = "cordrag", x = 3488, y = 131, z = 1744, rot = 32767, team = 1 }, + { name = "cordrag", x = 3456, y = 128, z = 1776, rot = 32767, team = 1 }, + { name = "cordrag", x = 3440, y = 128, z = 1808, rot = 32767, team = 1 }, + { name = "cordrag", x = 3408, y = 128, z = 1840, rot = 32767, team = 1 }, + { name = "cordrag", x = 3296, y = 128, z = 1968, rot = 32767, team = 1 }, + { name = "cordrag", x = 3280, y = 128, z = 2000, rot = 32767, team = 1 }, + { name = "cordrag", x = 3248, y = 128, z = 2032, rot = 32767, team = 1 }, + { name = "cordrag", x = 3472, y = 129, z = 1712, rot = 32767, team = 1 }, + { name = "cordrag", x = 3440, y = 128, z = 1744, rot = 32767, team = 1 }, + { name = "cordrag", x = 3424, y = 128, z = 1776, rot = 32767, team = 1 }, + { name = "cordrag", x = 3392, y = 128, z = 1808, rot = 32767, team = 1 }, + { name = "cordrag", x = 3280, y = 128, z = 1936, rot = 32767, team = 1 }, + { name = "cordrag", x = 3248, y = 128, z = 1968, rot = 32767, team = 1 }, + { name = "cordrag", x = 3232, y = 128, z = 2000, rot = 32767, team = 1 }, + { name = "cordrag", x = 3200, y = 129, z = 2032, rot = 32767, team = 1 }, + { name = "cormex", x = 5880, y = 79, z = 616, rot = 32767, team = 1 }, + { name = "cormex", x = 5896, y = 77, z = 264, rot = 32767, team = 1 }, + { name = "cormex", x = 5000, y = 178, z = 568, rot = 32767, team = 1 }, + { name = "corexp", x = 4472, y = 78, z = 952, rot = 32767, team = 1 }, + { name = "corexp", x = 4136, y = 232, z = 200, rot = 32767, team = 1 }, + { name = "corwin", x = 5736, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5672, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5608, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5544, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5480, y = 79, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5416, y = 80, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5352, y = 84, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5288, y = 94, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5224, y = 103, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5160, y = 103, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5096, y = 100, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 5032, y = 97, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4904, y = 82, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4840, y = 79, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4776, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4712, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4648, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4584, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4520, y = 78, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4456, y = 77, z = 104, rot = 32767, team = 1 }, + { name = "corwin", x = 4520, y = 79, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 4584, y = 79, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 4648, y = 78, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 4712, y = 79, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 4776, y = 80, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 4840, y = 84, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5288, y = 101, z = 168, rot = 32767, team = 1 }, --{name = 'armca', x = 669, y = 199, z = 206, rot = -32576 , team = 0}, - {name = 'corwin', x = 5352, y = 90, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5416, y = 82, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5480, y = 79, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5544, y = 78, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5608, y = 78, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5672, y = 78, z = 168, rot = 32767 , team = 1}, - {name = 'corwin', x = 5736, y = 78, z = 168, rot = 32767 , team = 1}, - {name = 'armadvsol', x = 752, y = 198, z = 656, rot = 32767 , team = 0}, - {name = 'corwin', x = 5736, y = 79, z = 232, rot = 32767 , team = 1}, - {name = 'armadvsol', x = 688, y = 199, z = 656, rot = 32767 , team = 0}, - {name = 'corwin', x = 5672, y = 78, z = 232, rot = 32767 , team = 1}, - {name = 'corwin', x = 5608, y = 78, z = 232, rot = 32767 , team = 1}, - {name = 'corwin', x = 5544, y = 79, z = 232, rot = 32767 , team = 1}, - {name = 'armadvsol', x = 624, y = 199, z = 656, rot = 32767 , team = 0}, - {name = 'corwin', x = 5480, y = 80, z = 232, rot = 32767 , team = 1}, - {name = 'corwin', x = 4776, y = 83, z = 232, rot = 32767 , team = 1}, + { name = "corwin", x = 5352, y = 90, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5416, y = 82, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5480, y = 79, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5544, y = 78, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5608, y = 78, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5672, y = 78, z = 168, rot = 32767, team = 1 }, + { name = "corwin", x = 5736, y = 78, z = 168, rot = 32767, team = 1 }, + { name = "armadvsol", x = 752, y = 198, z = 656, rot = 32767, team = 0 }, + { name = "corwin", x = 5736, y = 79, z = 232, rot = 32767, team = 1 }, + { name = "armadvsol", x = 688, y = 199, z = 656, rot = 32767, team = 0 }, + { name = "corwin", x = 5672, y = 78, z = 232, rot = 32767, team = 1 }, + { name = "corwin", x = 5608, y = 78, z = 232, rot = 32767, team = 1 }, + { name = "corwin", x = 5544, y = 79, z = 232, rot = 32767, team = 1 }, + { name = "armadvsol", x = 624, y = 199, z = 656, rot = 32767, team = 0 }, + { name = "corwin", x = 5480, y = 80, z = 232, rot = 32767, team = 1 }, + { name = "corwin", x = 4776, y = 83, z = 232, rot = 32767, team = 1 }, --{name = 'armestor', x = 760, y = 198, z = 600, rot = 32767 , team = 0}, - {name = 'corwin', x = 4712, y = 80, z = 232, rot = 32767 , team = 1}, - {name = 'corwin', x = 4648, y = 81, z = 232, rot = 32767 , team = 1}, - {name = 'corwin', x = 4584, y = 82, z = 232, rot = 32767 , team = 1}, - {name = 'armjamt', x = 688, y = 198, z = 592, rot = 32767 , team = 0}, - {name = 'armrad', x = 624, y = 199, z = 592, rot = 32767 , team = 0}, - {name = 'armadvsol', x = 624, y = 198, z = 544, rot = 32767 , team = 0}, - {name = 'armadvsol', x = 688, y = 198, z = 544, rot = 32767 , team = 0}, - {name = 'armadvsol', x = 752, y = 198, z = 544, rot = 32767 , team = 0}, - {name = 'armdrag', x = 768, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 736, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 704, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 672, y = 199, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 640, y = 199, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 608, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 672, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 640, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 608, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 576, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 544, rot = 32767 , team = 0}, - {name = 'armdrag', x = 576, y = 198, z = 512, rot = 32767 , team = 0}, - {name = 'armdrag', x = 608, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 640, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 672, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 704, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 736, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 768, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 512, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 544, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 576, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 608, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 640, rot = 32767 , team = 0}, - {name = 'armdrag', x = 800, y = 198, z = 672, rot = 32767 , team = 0}, - {name = 'armclaw', x = 576, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armclaw', x = 576, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armclaw', x = 800, y = 198, z = 480, rot = 32767 , team = 0}, - {name = 'armclaw', x = 800, y = 198, z = 704, rot = 32767 , team = 0}, - {name = 'armdrag', x = 16, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 48, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 80, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 112, y = 199, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 144, y = 199, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 176, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 208, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 240, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 272, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armfboy', x = 326, y = 198, z = 741, rot = -3181 , team = 0}, - {name = 'armdrag', x = 304, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 336, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 368, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 400, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 432, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armmav', x = 414, y = 198, z = 743, rot = 113 , team = 0}, - {name = 'armdrag', x = 832, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armdrag', x = 864, y = 199, z = 848, rot = 32767 , team = 0}, - {name = 'armzeus', x = 511, y = 198, z = 700, rot = 5129 , team = 0}, - {name = 'armmark', x = 538, y = 198, z = 784, rot = 28873 , team = 0}, - {name = 'armrectr', x = 465, y = 198, z = 509, rot = -28531 , team = 0}, - {name = 'armrectr', x = 343, y = 199, z = 525, rot = 22301 , team = 0}, - {name = 'corllt', x = 4672, y = 396, z = 1792, rot = 32767 , team = 1}, - {name = 'corhllt', x = 4640, y = 391, z = 1920, rot = 32767 , team = 1}, - {name = 'corerad', x = 4880, y = 399, z = 1744, rot = 32767 , team = 1}, - {name = 'corerad', x = 4736, y = 398, z = 2064, rot = 32767 , team = 1}, - {name = 'corhlt', x = 3600, y = 74, z = 2384, rot = 32767 , team = 1}, - {name = 'corhlt', x = 2288, y = 235, z = 1744, rot = 32767 , team = 1}, - {name = 'corhlt', x = 2208, y = 195, z = 1392, rot = 32767 , team = 1}, - {name = 'corllt', x = 2208, y = 195, z = 1520, rot = 32767 , team = 1}, - {name = 'cordrag', x = 2320, y = 128, z = 816, rot = 32767 , team = 1}, - {name = 'cordrag', x = 2336, y = 128, z = 944, rot = 32767 , team = 1}, - {name = 'cordrag', x = 2352, y = 128, z = 1056, rot = 32767 , team = 1}, - {name = 'corrad', x = 2464, y = 238, z = 1440, rot = 32767 , team = 1}, - {name = 'armclaw', x = 464, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'armclaw', x = 800, y = 198, z = 848, rot = 32767 , team = 0}, - {name = 'cordl', x = 3296, y = 20, z = 2384, rot = 32767 , team = 1}, - {name = 'cordl', x = 3264, y = 25, z = 2528, rot = 32767 , team = 1}, - {name = 'cordl', x = 3216, y = 22, z = 2672, rot = 32767 , team = 1}, - {name = 'cordl', x = 3184, y = 25, z = 2800, rot = 32767 , team = 1}, - {name = 'cordl', x = 3152, y = 31, z = 2928, rot = 32767 , team = 1}, - {name = 'cordl', x = 3120, y = 28, z = 3024, rot = 32767 , team = 1}, - {name = 'cordl', x = 3952, y = 39, z = 608, rot = 32767 , team = 1}, - {name = 'cordl', x = 3920, y = 43, z = 720, rot = 32767 , team = 1}, - {name = 'cordl', x = 3856, y = 33, z = 832, rot = 32767 , team = 1}, - {name = 'armspy', x = 380, y = 198, z = 620, rot = 7963 , team = 0}, - {name = 'armspy', x = 500, y = 198, z = 631, rot = 14701 , team = 0}, - {name = 'armspy', x = 268, y = 198, z = 627, rot = 1521 , team = 0}, - {name = 'corgeo', x = 4816, y = 398, z = 1808, rot = 32767 , team = 1}, + { name = "corwin", x = 4712, y = 80, z = 232, rot = 32767, team = 1 }, + { name = "corwin", x = 4648, y = 81, z = 232, rot = 32767, team = 1 }, + { name = "corwin", x = 4584, y = 82, z = 232, rot = 32767, team = 1 }, + { name = "armjamt", x = 688, y = 198, z = 592, rot = 32767, team = 0 }, + { name = "armrad", x = 624, y = 199, z = 592, rot = 32767, team = 0 }, + { name = "armadvsol", x = 624, y = 198, z = 544, rot = 32767, team = 0 }, + { name = "armadvsol", x = 688, y = 198, z = 544, rot = 32767, team = 0 }, + { name = "armadvsol", x = 752, y = 198, z = 544, rot = 32767, team = 0 }, + { name = "armdrag", x = 768, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 736, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 704, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 672, y = 199, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 640, y = 199, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 608, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 672, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 640, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 608, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 576, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 544, rot = 32767, team = 0 }, + { name = "armdrag", x = 576, y = 198, z = 512, rot = 32767, team = 0 }, + { name = "armdrag", x = 608, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 640, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 672, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 704, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 736, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 768, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 512, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 544, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 576, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 608, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 640, rot = 32767, team = 0 }, + { name = "armdrag", x = 800, y = 198, z = 672, rot = 32767, team = 0 }, + { name = "armclaw", x = 576, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armclaw", x = 576, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armclaw", x = 800, y = 198, z = 480, rot = 32767, team = 0 }, + { name = "armclaw", x = 800, y = 198, z = 704, rot = 32767, team = 0 }, + { name = "armdrag", x = 16, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 48, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 80, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 112, y = 199, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 144, y = 199, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 176, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 208, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 240, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 272, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armfboy", x = 326, y = 198, z = 741, rot = -3181, team = 0 }, + { name = "armdrag", x = 304, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 336, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 368, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 400, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 432, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armmav", x = 414, y = 198, z = 743, rot = 113, team = 0 }, + { name = "armdrag", x = 832, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armdrag", x = 864, y = 199, z = 848, rot = 32767, team = 0 }, + { name = "armzeus", x = 511, y = 198, z = 700, rot = 5129, team = 0 }, + { name = "armmark", x = 538, y = 198, z = 784, rot = 28873, team = 0 }, + { name = "armrectr", x = 465, y = 198, z = 509, rot = -28531, team = 0 }, + { name = "armrectr", x = 343, y = 199, z = 525, rot = 22301, team = 0 }, + { name = "corllt", x = 4672, y = 396, z = 1792, rot = 32767, team = 1 }, + { name = "corhllt", x = 4640, y = 391, z = 1920, rot = 32767, team = 1 }, + { name = "corerad", x = 4880, y = 399, z = 1744, rot = 32767, team = 1 }, + { name = "corerad", x = 4736, y = 398, z = 2064, rot = 32767, team = 1 }, + { name = "corhlt", x = 3600, y = 74, z = 2384, rot = 32767, team = 1 }, + { name = "corhlt", x = 2288, y = 235, z = 1744, rot = 32767, team = 1 }, + { name = "corhlt", x = 2208, y = 195, z = 1392, rot = 32767, team = 1 }, + { name = "corllt", x = 2208, y = 195, z = 1520, rot = 32767, team = 1 }, + { name = "cordrag", x = 2320, y = 128, z = 816, rot = 32767, team = 1 }, + { name = "cordrag", x = 2336, y = 128, z = 944, rot = 32767, team = 1 }, + { name = "cordrag", x = 2352, y = 128, z = 1056, rot = 32767, team = 1 }, + { name = "corrad", x = 2464, y = 238, z = 1440, rot = 32767, team = 1 }, + { name = "armclaw", x = 464, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "armclaw", x = 800, y = 198, z = 848, rot = 32767, team = 0 }, + { name = "cordl", x = 3296, y = 20, z = 2384, rot = 32767, team = 1 }, + { name = "cordl", x = 3264, y = 25, z = 2528, rot = 32767, team = 1 }, + { name = "cordl", x = 3216, y = 22, z = 2672, rot = 32767, team = 1 }, + { name = "cordl", x = 3184, y = 25, z = 2800, rot = 32767, team = 1 }, + { name = "cordl", x = 3152, y = 31, z = 2928, rot = 32767, team = 1 }, + { name = "cordl", x = 3120, y = 28, z = 3024, rot = 32767, team = 1 }, + { name = "cordl", x = 3952, y = 39, z = 608, rot = 32767, team = 1 }, + { name = "cordl", x = 3920, y = 43, z = 720, rot = 32767, team = 1 }, + { name = "cordl", x = 3856, y = 33, z = 832, rot = 32767, team = 1 }, + { name = "armspy", x = 380, y = 198, z = 620, rot = 7963, team = 0 }, + { name = "armspy", x = 500, y = 198, z = 631, rot = 14701, team = 0 }, + { name = "armspy", x = 268, y = 198, z = 627, rot = 1521, team = 0 }, + { name = "corgeo", x = 4816, y = 398, z = 1808, rot = 32767, team = 1 }, --{name = 'coraca', x = 4745, y = 96, z = 1008, rot = -12630 , team = 1}, - {name = 'corvipe', x = 5464, y = 125, z = 1128, rot = 32767 , team = 1}, - {name = 'corflak', x = 4896, y = 180, z = 864, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5056, y = 179, z = 864, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5232, y = 149, z = 880, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5360, y = 118, z = 944, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5408, y = 154, z = 1264, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5312, y = 178, z = 1376, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5168, y = 169, z = 1456, rot = 32767 , team = 1}, - {name = 'corhllt', x = 5072, y = 156, z = 1472, rot = 32767 , team = 1}, - {name = 'corrad', x = 5088, y = 177, z = 720, rot = 32767 , team = 1}, - {name = 'mission_command_tower', x = 5500, y = 200, z = 2302, rot = 0 , team = 1}, + { name = "corvipe", x = 5464, y = 125, z = 1128, rot = 32767, team = 1 }, + { name = "corflak", x = 4896, y = 180, z = 864, rot = 32767, team = 1 }, + { name = "corhllt", x = 5056, y = 179, z = 864, rot = 32767, team = 1 }, + { name = "corhllt", x = 5232, y = 149, z = 880, rot = 32767, team = 1 }, + { name = "corhllt", x = 5360, y = 118, z = 944, rot = 32767, team = 1 }, + { name = "corhllt", x = 5408, y = 154, z = 1264, rot = 32767, team = 1 }, + { name = "corhllt", x = 5312, y = 178, z = 1376, rot = 32767, team = 1 }, + { name = "corhllt", x = 5168, y = 169, z = 1456, rot = 32767, team = 1 }, + { name = "corhllt", x = 5072, y = 156, z = 1472, rot = 32767, team = 1 }, + { name = "corrad", x = 5088, y = 177, z = 720, rot = 32767, team = 1 }, + { name = "mission_command_tower", x = 5500, y = 200, z = 2302, rot = 0, team = 1 }, }, - + featureloadout = { - {name = 'cormlv_dead', x = 274, y = 199, z = 140, rot = 0 , scale = 1.0, resurrectas = "cormlv"}, - } - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + { name = "cormlv_dead", x = 274, y = 199, z = 140, rot = 0, scale = 1.0, resurrectas = "cormlv" }, + }, + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] diff --git a/singleplayer/scenarios/scenario019.lua b/singleplayer/scenarios/scenario019.lua index 3fa60a7c11e..3b5879066f8 100644 --- a/singleplayer/scenarios/scenario019.lua +++ b/singleplayer/scenarios/scenario019.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 19, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "glaciergoliath018", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "David vs. Goliath", -- can be anything - author = "Beherith", -- your name here - isnew = true, - imagepath = "scenario019.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Scour the map for hidden treasures", -- This text will be drawn over image - summary = [[Only a few units remain, Tzar, Tiger, Negotiator and a few supporting roles. Navigate your way through this glacier pass without building a base, and destroy the waves of Armada Tier 1 units to get to their Commander.]], - briefing = [[You only have a couple of vehicles to navigate the treacherous Glacer Pass, straight through an Armada base. Luckily this Armada Commander does not have much useful technology at his disposal. + index = 19, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "glaciergoliath018", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "David vs. Goliath", -- can be anything + author = "Beherith", -- your name here + isnew = true, + imagepath = "scenario019.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Scour the map for hidden treasures", -- This text will be drawn over image + summary = [[Only a few units remain, Tzar, Tiger, Negotiator and a few supporting roles. Navigate your way through this glacier pass without building a base, and destroy the waves of Armada Tier 1 units to get to their Commander.]], + briefing = [[You only have a couple of vehicles to navigate the treacherous Glacer Pass, straight through an Armada base. Luckily this Armada Commander does not have much useful technology at his disposal. Intelligence reports mines around the walled entrance to the main Armada base, enter cautiously, or use the massive area of effect damage of the Tzar to clear mines. @@ -33,26 +33,26 @@ The difficulty modifier will change the amount of resources you and the enemy re - Brutal: Regular resources for you, +100% for the enemy ]], - mapfilename = "Glacier Pass 1.2", -- the name of the map to be displayed here - playerstartx = "80%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "80%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1800, -- par time in seconds - parresources = 50000, -- par resource amount - difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Beginner", playerhandicap = 50 , enemyhandicap = -50}, - {name = "Novice" , playerhandicap = 25 , enemyhandicap = -25}, - {name = "Normal" , playerhandicap = 0 , enemyhandicap = 0 }, - {name = "Hard" , playerhandicap = 0, enemyhandicap = 50 }, - {name = "Brutal" , playerhandicap = 0, enemyhandicap = 100 }, - }, - allowedsides = {"Cortex"}, --these are the permitted factions for this mission - victorycondition= "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of all your units", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it - -- dont use the one in startscript, put it here! - armck = 0, + mapfilename = "Glacier Pass 1.2", -- the name of the map to be displayed here + playerstartx = "80%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "80%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1800, -- par time in seconds + parresources = 50000, -- par resource amount + difficulty = 6, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Beginner", playerhandicap = 50, enemyhandicap = -50 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -25 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 50 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 100 }, + }, + allowedsides = { "Cortex" }, --these are the permitted factions for this mission + victorycondition = "Kill all enemy Commanders", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of all your units", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberoftese units, 0 is disable it + -- dont use the one in startscript, put it here! + armck = 0, armcv = 0, armmlv = 0, armbeaver = 0, @@ -62,454 +62,453 @@ The difficulty modifier will change the amount of resources you and the enemy re armhp = 0, armfhp = 0, armrectr = 0, - } , - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - --myoption = "dostuff", - scenarioid = "glaciergoliath018", --must be present for scores + }, + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + --myoption = "dostuff", + scenarioid = "glaciergoliath018", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides unitloadout = { -- {name = 'corcom', x = 872, y = 1103, z = 1443, rot = 25860 , team = 1}, -- {name = 'armcom', x = 4062, y = 1064, z = 3609, rot = 0 , team = 0}, -- {name = 'corca', x = 4400, y = 1108, z = 4251, rot = 10273 , team = 0}, - {name = 'coradvsol', x = 4160, y = 1121, z = 4192, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4224, y = 1116, z = 4192, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4288, y = 1111, z = 4192, rot = -16384 , team = 0}, + { name = "coradvsol", x = 4160, y = 1121, z = 4192, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4224, y = 1116, z = 4192, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4288, y = 1111, z = 4192, rot = -16384, team = 0 }, --{name = 'corestor', x = 4160, y = 1126, z = 4256, rot = -16384 , team = 0}, - {name = 'corrad', x = 4208, y = 1123, z = 4240, rot = -16384 , team = 0}, - {name = 'corjamt', x = 4208, y = 1123, z = 4272, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4288, y = 1115, z = 4256, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4160, y = 1126, z = 4320, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4224, y = 1122, z = 4320, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 4288, y = 1116, z = 4320, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1121, z = 4144, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1124, z = 4176, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1129, z = 4208, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1129, z = 4240, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1129, z = 4272, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1130, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1130, z = 4336, rot = -16384 , team = 0}, - {name = 'corfort', x = 4112, y = 1136, z = 4368, rot = -16384 , team = 0}, - {name = 'corfort', x = 4144, y = 1128, z = 4368, rot = -16384 , team = 0}, - {name = 'corfort', x = 4176, y = 1124, z = 4368, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4080, y = 1133, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4208, y = 1122, z = 4368, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4048, y = 1136, z = 4304, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4016, y = 1136, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4240, y = 1121, z = 4368, rot = -16384 , team = 0}, - {name = 'corfort', x = 4272, y = 1119, z = 4368, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1124, z = 4400, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1124, z = 4432, rot = -16384 , team = 0}, - {name = 'corfort', x = 4304, y = 1119, z = 4368, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1124, z = 4464, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1119, z = 4368, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1120, z = 4400, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1116, z = 4336, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1120, z = 4432, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1114, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1112, z = 4272, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1119, z = 4464, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1110, z = 4240, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1107, z = 4208, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4368, y = 1112, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1106, z = 4176, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4400, y = 1112, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4336, y = 1102, z = 4144, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4432, y = 1112, z = 4304, rot = -16384 , team = 0}, - {name = 'corfort', x = 4304, y = 1107, z = 4144, rot = -16384 , team = 0}, - {name = 'corfort', x = 4272, y = 1108, z = 4144, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4368, y = 1103, z = 4208, rot = -16384 , team = 0}, - {name = 'corfort', x = 4240, y = 1111, z = 4144, rot = -16384 , team = 0}, - {name = 'corfort', x = 4208, y = 1113, z = 4144, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4400, y = 1102, z = 4208, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4432, y = 1099, z = 4208, rot = -16384 , team = 0}, - {name = 'corfort', x = 4176, y = 1117, z = 4144, rot = -16384 , team = 0}, - {name = 'corfort', x = 4144, y = 1119, z = 4144, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1105, z = 4112, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1100, z = 4080, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4272, y = 1097, z = 4048, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1112, z = 4112, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1110, z = 4080, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4176, y = 1105, z = 4048, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4112, y = 1116, z = 4096, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4080, y = 1121, z = 4144, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4080, y = 1139, z = 4368, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4112, y = 1136, z = 4400, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4336, y = 1120, z = 4400, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4368, y = 1118, z = 4368, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4368, y = 1101, z = 4144, rot = -16384 , team = 0}, - {name = 'cormaw', x = 4336, y = 1100, z = 4112, rot = -16384 , team = 0}, - {name = 'corhlt', x = 4224, y = 1102, z = 4048, rot = -16384 , team = 0}, - {name = 'corhlt', x = 4416, y = 1108, z = 4256, rot = -16384 , team = 0}, - {name = 'corhlt', x = 4016, y = 1130, z = 4256, rot = -16384 , team = 0}, - {name = 'corhlt', x = 4224, y = 1121, z = 4448, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4080, y = 1131, z = 4208, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4048, y = 1130, z = 4208, rot = -16384 , team = 0}, - {name = 'cordrag', x = 4016, y = 1127, z = 4208, rot = -16384 , team = 0}, - {name = 'corgol', x = 3960, y = 1086, z = 3923, rot = -27407 , team = 0}, - {name = 'correap', x = 3866, y = 1098, z = 4025, rot = 20908 , team = 0}, - {name = 'corvrad', x = 3882, y = 1094, z = 3947, rot = 23521 , team = 0}, - {name = 'coreter', x = 4013, y = 1101, z = 4038, rot = 19007 , team = 0}, - {name = 'cornecro', x = 3874, y = 1119, z = 4207, rot = 24246 , team = 0}, - {name = 'cornecro', x = 3792, y = 1116, z = 4201, rot = 19920 , team = 0}, + { name = "corrad", x = 4208, y = 1123, z = 4240, rot = -16384, team = 0 }, + { name = "corjamt", x = 4208, y = 1123, z = 4272, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4288, y = 1115, z = 4256, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4160, y = 1126, z = 4320, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4224, y = 1122, z = 4320, rot = -16384, team = 0 }, + { name = "coradvsol", x = 4288, y = 1116, z = 4320, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1121, z = 4144, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1124, z = 4176, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1129, z = 4208, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1129, z = 4240, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1129, z = 4272, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1130, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1130, z = 4336, rot = -16384, team = 0 }, + { name = "corfort", x = 4112, y = 1136, z = 4368, rot = -16384, team = 0 }, + { name = "corfort", x = 4144, y = 1128, z = 4368, rot = -16384, team = 0 }, + { name = "corfort", x = 4176, y = 1124, z = 4368, rot = -16384, team = 0 }, + { name = "cordrag", x = 4080, y = 1133, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4208, y = 1122, z = 4368, rot = -16384, team = 0 }, + { name = "cordrag", x = 4048, y = 1136, z = 4304, rot = -16384, team = 0 }, + { name = "cordrag", x = 4016, y = 1136, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4240, y = 1121, z = 4368, rot = -16384, team = 0 }, + { name = "corfort", x = 4272, y = 1119, z = 4368, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1124, z = 4400, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1124, z = 4432, rot = -16384, team = 0 }, + { name = "corfort", x = 4304, y = 1119, z = 4368, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1124, z = 4464, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1119, z = 4368, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1120, z = 4400, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1116, z = 4336, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1120, z = 4432, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1114, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1112, z = 4272, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1119, z = 4464, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1110, z = 4240, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1107, z = 4208, rot = -16384, team = 0 }, + { name = "cordrag", x = 4368, y = 1112, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1106, z = 4176, rot = -16384, team = 0 }, + { name = "cordrag", x = 4400, y = 1112, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4336, y = 1102, z = 4144, rot = -16384, team = 0 }, + { name = "cordrag", x = 4432, y = 1112, z = 4304, rot = -16384, team = 0 }, + { name = "corfort", x = 4304, y = 1107, z = 4144, rot = -16384, team = 0 }, + { name = "corfort", x = 4272, y = 1108, z = 4144, rot = -16384, team = 0 }, + { name = "cordrag", x = 4368, y = 1103, z = 4208, rot = -16384, team = 0 }, + { name = "corfort", x = 4240, y = 1111, z = 4144, rot = -16384, team = 0 }, + { name = "corfort", x = 4208, y = 1113, z = 4144, rot = -16384, team = 0 }, + { name = "cordrag", x = 4400, y = 1102, z = 4208, rot = -16384, team = 0 }, + { name = "cordrag", x = 4432, y = 1099, z = 4208, rot = -16384, team = 0 }, + { name = "corfort", x = 4176, y = 1117, z = 4144, rot = -16384, team = 0 }, + { name = "corfort", x = 4144, y = 1119, z = 4144, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1105, z = 4112, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1100, z = 4080, rot = -16384, team = 0 }, + { name = "cordrag", x = 4272, y = 1097, z = 4048, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1112, z = 4112, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1110, z = 4080, rot = -16384, team = 0 }, + { name = "cordrag", x = 4176, y = 1105, z = 4048, rot = -16384, team = 0 }, + { name = "cormaw", x = 4112, y = 1116, z = 4096, rot = -16384, team = 0 }, + { name = "cormaw", x = 4080, y = 1121, z = 4144, rot = -16384, team = 0 }, + { name = "cormaw", x = 4080, y = 1139, z = 4368, rot = -16384, team = 0 }, + { name = "cormaw", x = 4112, y = 1136, z = 4400, rot = -16384, team = 0 }, + { name = "cormaw", x = 4336, y = 1120, z = 4400, rot = -16384, team = 0 }, + { name = "cormaw", x = 4368, y = 1118, z = 4368, rot = -16384, team = 0 }, + { name = "cormaw", x = 4368, y = 1101, z = 4144, rot = -16384, team = 0 }, + { name = "cormaw", x = 4336, y = 1100, z = 4112, rot = -16384, team = 0 }, + { name = "corhlt", x = 4224, y = 1102, z = 4048, rot = -16384, team = 0 }, + { name = "corhlt", x = 4416, y = 1108, z = 4256, rot = -16384, team = 0 }, + { name = "corhlt", x = 4016, y = 1130, z = 4256, rot = -16384, team = 0 }, + { name = "corhlt", x = 4224, y = 1121, z = 4448, rot = -16384, team = 0 }, + { name = "cordrag", x = 4080, y = 1131, z = 4208, rot = -16384, team = 0 }, + { name = "cordrag", x = 4048, y = 1130, z = 4208, rot = -16384, team = 0 }, + { name = "cordrag", x = 4016, y = 1127, z = 4208, rot = -16384, team = 0 }, + { name = "corgol", x = 3960, y = 1086, z = 3923, rot = -27407, team = 0 }, + { name = "correap", x = 3866, y = 1098, z = 4025, rot = 20908, team = 0 }, + { name = "corvrad", x = 3882, y = 1094, z = 3947, rot = 23521, team = 0 }, + { name = "coreter", x = 4013, y = 1101, z = 4038, rot = 19007, team = 0 }, + { name = "cornecro", x = 3874, y = 1119, z = 4207, rot = 24246, team = 0 }, + { name = "cornecro", x = 3792, y = 1116, z = 4201, rot = 19920, team = 0 }, -- {name = 'armca', x = 1567, y = 1035, z = 2520, rot = -24106 , team = 1}, - {name = 'armmex', x = 952, y = 1101, z = 1592, rot = -16384 , team = 1}, - {name = 'armmex', x = 744, y = 1104, z = 1496, rot = -16384 , team = 1}, - {name = 'armmex', x = 760, y = 1101, z = 1864, rot = -16384 , team = 1}, - {name = 'corvroc', x = 3977, y = 1108, z = 4094, rot = 26479 , team = 0}, - {name = 'armcom', x = 597, y = 1109, z = 777, rot = 25306 , team = 1}, - {name = 'armfort', x = 544, y = 1112, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1107, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1110, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1114, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1116, z = 720, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1113, z = 720, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1115, z = 752, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1118, z = 752, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1118, z = 784, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1113, z = 784, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1112, z = 816, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1118, z = 816, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1117, z = 848, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1111, z = 848, rot = -16384 , team = 1}, - {name = 'armfort', x = 576, y = 1111, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 608, y = 1102, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 640, y = 1089, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 672, y = 1074, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1059, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1047, z = 688, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1055, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1068, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 672, y = 1080, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 640, y = 1093, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 608, y = 1103, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 576, y = 1111, z = 656, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1056, z = 720, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1043, z = 720, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1045, z = 752, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1058, z = 752, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1065, z = 784, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1053, z = 784, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1065, z = 816, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1075, z = 816, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1087, z = 848, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1079, z = 848, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1093, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1100, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 672, y = 1107, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 640, y = 1114, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 608, y = 1119, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 576, y = 1119, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1114, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1109, z = 880, rot = -16384 , team = 1}, - {name = 'armfort', x = 512, y = 1108, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 544, y = 1111, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 576, y = 1115, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 608, y = 1120, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 640, y = 1118, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 672, y = 1115, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 704, y = 1112, z = 912, rot = -16384 , team = 1}, - {name = 'armfort', x = 736, y = 1106, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 480, y = 1099, z = 624, rot = -16384 , team = 1}, - {name = 'armdrag', x = 768, y = 1060, z = 624, rot = -16384 , team = 1}, - {name = 'armdrag', x = 768, y = 1114, z = 944, rot = -16384 , team = 1}, - {name = 'armdrag', x = 480, y = 1106, z = 944, rot = -16384 , team = 1}, - {name = 'armdrag', x = 464, y = 1099, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 432, y = 1095, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 400, y = 1092, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1104, z = 624, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1101, z = 592, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1098, z = 560, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1066, z = 624, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1079, z = 592, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1091, z = 560, rot = -16384 , team = 1}, - {name = 'armdrag', x = 768, y = 1047, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 800, y = 1044, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 832, y = 1048, z = 656, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1108, z = 944, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1107, z = 976, rot = -16384 , team = 1}, - {name = 'armdrag', x = 512, y = 1107, z = 1008, rot = -16384 , team = 1}, - {name = 'armdrag', x = 480, y = 1107, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 448, y = 1105, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 416, y = 1102, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1116, z = 944, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1119, z = 976, rot = -16384 , team = 1}, - {name = 'armdrag', x = 736, y = 1116, z = 1008, rot = -16384 , team = 1}, - {name = 'armdrag', x = 768, y = 1103, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 800, y = 1102, z = 912, rot = -16384 , team = 1}, - {name = 'armdrag', x = 832, y = 1104, z = 912, rot = -16384 , team = 1}, - {name = 'armllt', x = 3520, y = 1103, z = 2368, rot = -16384 , team = 1}, - {name = 'armllt', x = 3728, y = 1097, z = 2336, rot = -16384 , team = 1}, - {name = 'armllt', x = 3920, y = 1092, z = 2352, rot = -16384 , team = 1}, - {name = 'armllt', x = 4144, y = 1094, z = 2400, rot = -16384 , team = 1}, - {name = 'armllt', x = 4384, y = 1090, z = 2464, rot = -16384 , team = 1}, - {name = 'armrad', x = 4224, y = 1089, z = 2112, rot = -16384 , team = 1}, - {name = 'armdrag', x = 4240, y = 1093, z = 2432, rot = -16384 , team = 1}, - {name = 'armdrag', x = 3632, y = 1099, z = 2368, rot = -16384 , team = 1}, - {name = 'armdrag', x = 3376, y = 1112, z = 2368, rot = -16384 , team = 1}, - {name = 'armferret', x = 3768, y = 1091, z = 2184, rot = -16384 , team = 1}, - {name = 'armferret', x = 4232, y = 1094, z = 2232, rot = -16384 , team = 1}, - {name = 'armferret', x = 4536, y = 1080, z = 2136, rot = -16384 , team = 1}, - {name = 'armlab', x = 976, y = 1101, z = 1760, rot = 0 , team = 1}, - {name = 'armnanotc', x = 872, y = 1100, z = 1640, rot = 0 , team = 1}, - {name = 'armnanotc', x = 824, y = 1100, z = 1640, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1102, z = 1512, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1101, z = 1512, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1099, z = 1512, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1097, z = 1576, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1099, z = 1576, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1100, z = 1576, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1099, z = 1640, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1097, z = 1640, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1096, z = 1640, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1095, z = 1704, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1096, z = 1704, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1098, z = 1704, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1097, z = 1768, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1096, z = 1768, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1094, z = 1768, rot = 0 , team = 1}, - {name = 'armwin', x = 456, y = 1094, z = 1832, rot = 0 , team = 1}, - {name = 'armwin', x = 520, y = 1095, z = 1832, rot = 0 , team = 1}, - {name = 'armwin', x = 584, y = 1097, z = 1832, rot = 0 , team = 1}, - {name = 'armvp', x = 856, y = 1115, z = 4240, rot = 16384 , team = 1}, - {name = 'armnanotc', x = 696, y = 1108, z = 4216, rot = 16384 , team = 1}, - {name = 'armnanotc', x = 696, y = 1107, z = 4264, rot = 16384 , team = 1}, - {name = 'armmex', x = 808, y = 1112, z = 4376, rot = 16384 , team = 1}, - {name = 'armmex', x = 1048, y = 1125, z = 4456, rot = 16384 , team = 1}, - {name = 'armmex', x = 760, y = 1112, z = 4136, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1101, z = 4344, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1096, z = 4344, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1090, z = 4344, rot = 16384 , team = 1}, - {name = 'armwin', x = 440, y = 1084, z = 4408, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1090, z = 4408, rot = 16384 , team = 1}, - {name = 'armmex', x = 2344, y = 893, z = 744, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1095, z = 4408, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1100, z = 4408, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1098, z = 4472, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1092, z = 4472, rot = 16384 , team = 1}, - {name = 'armrad', x = 2000, y = 901, z = 896, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1086, z = 4472, rot = 16384 , team = 1}, - {name = 'armwin', x = 440, y = 1077, z = 4472, rot = 16384 , team = 1}, - {name = 'armllt', x = 2400, y = 895, z = 848, rot = 16384 , team = 1}, - {name = 'armwin', x = 440, y = 1074, z = 4536, rot = 16384 , team = 1}, - {name = 'armllt', x = 2368, y = 889, z = 992, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1083, z = 4536, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1090, z = 4536, rot = 16384 , team = 1}, - {name = 'armllt', x = 2384, y = 924, z = 1168, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1095, z = 4536, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1092, z = 4600, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1085, z = 4600, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1080, z = 4600, rot = 16384 , team = 1}, - {name = 'armwin', x = 440, y = 1073, z = 4600, rot = 16384 , team = 1}, - {name = 'armwin', x = 440, y = 1071, z = 4664, rot = 16384 , team = 1}, - {name = 'armwin', x = 504, y = 1076, z = 4664, rot = 16384 , team = 1}, - {name = 'armwin', x = 568, y = 1079, z = 4664, rot = 16384 , team = 1}, - {name = 'armwin', x = 632, y = 1085, z = 4664, rot = 16384 , team = 1}, - {name = 'armfort', x = 2704, y = 1189, z = 3696, rot = 16384 , team = 1}, - {name = 'armfort', x = 2720, y = 1154, z = 3728, rot = 16384 , team = 1}, - {name = 'armfort', x = 2752, y = 1142, z = 3760, rot = 16384 , team = 1}, - {name = 'armfort', x = 2768, y = 1145, z = 3792, rot = 16384 , team = 1}, - {name = 'armfort', x = 2800, y = 1131, z = 3824, rot = 16384 , team = 1}, - {name = 'armfort', x = 2816, y = 1110, z = 3856, rot = 16384 , team = 1}, - {name = 'armfort', x = 2848, y = 1113, z = 3888, rot = 16384 , team = 1}, - {name = 'armfort', x = 2864, y = 1101, z = 3920, rot = 16384 , team = 1}, - {name = 'armfort', x = 2896, y = 1121, z = 3952, rot = 16384 , team = 1}, - {name = 'armfort', x = 2912, y = 1130, z = 3984, rot = 16384 , team = 1}, - {name = 'armfort', x = 2928, y = 1134, z = 4016, rot = 16384 , team = 1}, - {name = 'armfort', x = 2960, y = 1167, z = 4048, rot = 16384 , team = 1}, - {name = 'armfort', x = 2976, y = 1177, z = 4080, rot = 16384 , team = 1}, - {name = 'armfort', x = 3008, y = 1165, z = 4112, rot = 16384 , team = 1}, - {name = 'armhlt', x = 2416, y = 963, z = 1296, rot = 16384 , team = 1}, - {name = 'armfort', x = 3024, y = 1163, z = 4144, rot = 16384 , team = 1}, - {name = 'armfort', x = 3056, y = 1163, z = 4176, rot = 16384 , team = 1}, - {name = 'armfort', x = 3072, y = 1164, z = 4208, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2560, y = 767, z = 880, rot = 16384 , team = 1}, - {name = 'armfort', x = 3104, y = 1188, z = 4240, rot = 16384 , team = 1}, - {name = 'armfort', x = 3120, y = 1214, z = 4272, rot = 16384 , team = 1}, - {name = 'armfort', x = 3136, y = 1221, z = 4240, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2560, y = 807, z = 1120, rot = 16384 , team = 1}, - {name = 'armfort', x = 3120, y = 1195, z = 4208, rot = 16384 , team = 1}, - {name = 'armfort', x = 3088, y = 1179, z = 4176, rot = 16384 , team = 1}, - {name = 'armfort', x = 3072, y = 1206, z = 4144, rot = 16384 , team = 1}, - {name = 'armfort', x = 3040, y = 1192, z = 4112, rot = 16384 , team = 1}, - {name = 'armfort', x = 3024, y = 1209, z = 4080, rot = 16384 , team = 1}, - {name = 'armfort', x = 2992, y = 1204, z = 4048, rot = 16384 , team = 1}, - {name = 'armfort', x = 2976, y = 1183, z = 4016, rot = 16384 , team = 1}, - {name = 'armfort', x = 2944, y = 1159, z = 3984, rot = 16384 , team = 1}, - {name = 'armfort', x = 2928, y = 1155, z = 3952, rot = 16384 , team = 1}, - {name = 'armfort', x = 2896, y = 1132, z = 3920, rot = 16384 , team = 1}, - {name = 'armwin', x = 2184, y = 917, z = 1032, rot = 16384 , team = 1}, - {name = 'armfort', x = 2880, y = 1144, z = 3888, rot = 16384 , team = 1}, - {name = 'armfort', x = 2848, y = 1143, z = 3856, rot = 16384 , team = 1}, - {name = 'armfort', x = 2832, y = 1157, z = 3824, rot = 16384 , team = 1}, - {name = 'armwin', x = 2120, y = 923, z = 1032, rot = 16384 , team = 1}, - {name = 'armfort', x = 2800, y = 1177, z = 3792, rot = 16384 , team = 1}, - {name = 'armfort', x = 2784, y = 1179, z = 3760, rot = 16384 , team = 1}, - {name = 'armwin', x = 2120, y = 935, z = 1096, rot = 16384 , team = 1}, - {name = 'armfort', x = 2752, y = 1165, z = 3728, rot = 16384 , team = 1}, - {name = 'armwin', x = 2184, y = 929, z = 1096, rot = 16384 , team = 1}, - {name = 'armfort', x = 2736, y = 1186, z = 3696, rot = 16384 , team = 1}, - {name = 'armwin', x = 2184, y = 937, z = 1160, rot = 16384 , team = 1}, - {name = 'armwin', x = 2120, y = 942, z = 1160, rot = 16384 , team = 1}, - {name = 'armwin', x = 2120, y = 955, z = 1224, rot = 16384 , team = 1}, - {name = 'armwin', x = 2184, y = 945, z = 1224, rot = 16384 , team = 1}, - {name = 'armrad', x = 1984, y = 993, z = 1360, rot = 16384 , team = 1}, - {name = 'armrad', x = 800, y = 1110, z = 4512, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2608, y = 685, z = 528, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2624, y = 692, z = 560, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2640, y = 696, z = 592, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2656, y = 694, z = 624, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2672, y = 691, z = 656, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2688, y = 686, z = 688, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2704, y = 681, z = 720, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2720, y = 675, z = 752, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2720, y = 669, z = 1264, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2704, y = 676, z = 1296, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2672, y = 685, z = 1328, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2656, y = 698, z = 1360, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2640, y = 710, z = 1392, rot = 16384 , team = 1}, - {name = 'armdrag', x = 2624, y = 716, z = 1424, rot = 16384 , team = 1}, - {name = 'armjamt', x = 784, y = 1101, z = 1760, rot = 16384 , team = 1}, - {name = 'armrad', x = 672, y = 1102, z = 1616, rot = 16384 , team = 1}, - {name = 'armrad', x = 784, y = 1102, z = 1584, rot = 16384 , team = 1}, - {name = 'armllt', x = 1184, y = 1092, z = 2880, rot = 16384 , team = 1}, - {name = 'armllt', x = 1040, y = 1089, z = 2976, rot = 16384 , team = 1}, - {name = 'armllt', x = 896, y = 1094, z = 3120, rot = 16384 , team = 1}, - {name = 'armllt', x = 816, y = 1099, z = 3248, rot = 16384 , team = 1}, - {name = 'armllt', x = 720, y = 1097, z = 3376, rot = 16384 , team = 1}, - {name = 'armllt', x = 656, y = 1102, z = 3584, rot = 16384 , team = 1}, - {name = 'armllt', x = 672, y = 1107, z = 3760, rot = 16384 , team = 1}, - {name = 'armllt', x = 720, y = 1106, z = 3872, rot = 16384 , team = 1}, - {name = 'armllt', x = 864, y = 1112, z = 4016, rot = 16384 , team = 1}, - {name = 'armllt', x = 992, y = 1117, z = 4096, rot = 16384 , team = 1}, - {name = 'armllt', x = 1152, y = 1119, z = 4208, rot = 16384 , team = 1}, - {name = 'armllt', x = 1344, y = 1120, z = 4304, rot = 16384 , team = 1}, - {name = 'armllt', x = 1456, y = 1126, z = 4320, rot = 16384 , team = 1}, - {name = 'armfort', x = 16, y = 1023, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 48, y = 1024, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 80, y = 1031, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 112, y = 1040, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 144, y = 1048, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 176, y = 1055, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 208, y = 1064, z = 1968, rot = 16384 , team = 1}, - {name = 'armhlt', x = 1088, y = 1108, z = 4160, rot = 16384 , team = 1}, - {name = 'armfort', x = 240, y = 1077, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 272, y = 1090, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 304, y = 1093, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 336, y = 1093, z = 1968, rot = 16384 , team = 1}, - {name = 'armhlt', x = 768, y = 1110, z = 3920, rot = 16384 , team = 1}, - {name = 'armfort', x = 368, y = 1094, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 400, y = 1096, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 432, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armhlt', x = 672, y = 1100, z = 3440, rot = 16384 , team = 1}, - {name = 'armfort', x = 464, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 496, y = 1100, z = 1968, rot = 16384 , team = 1}, - {name = 'armhlt', x = 848, y = 1097, z = 3152, rot = 16384 , team = 1}, - {name = 'armfort', x = 528, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 560, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 592, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 592, y = 1100, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 560, y = 1100, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 528, y = 1100, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 496, y = 1100, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 464, y = 1099, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 432, y = 1099, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 400, y = 1098, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 368, y = 1094, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 336, y = 1092, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 304, y = 1088, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 272, y = 1085, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 240, y = 1084, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 208, y = 1063, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 176, y = 1055, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 144, y = 1046, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 112, y = 1036, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 80, y = 1026, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 48, y = 1019, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 16, y = 1019, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1088, y = 1098, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1120, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1152, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1184, y = 1099, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1216, y = 1097, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1248, y = 1097, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1280, y = 1097, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1312, y = 1096, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1344, y = 1094, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1376, y = 1093, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1408, y = 1091, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1440, y = 1090, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1472, y = 1088, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1504, y = 1086, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1536, y = 1085, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1568, y = 1083, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1600, y = 1081, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1632, y = 1081, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1664, y = 1080, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1696, y = 1081, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1728, y = 1083, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1760, y = 1086, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1792, y = 1090, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1824, y = 1094, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1856, y = 1100, z = 1968, rot = 16384 , team = 1}, - {name = 'armfort', x = 1856, y = 1105, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1824, y = 1096, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1792, y = 1088, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1760, y = 1084, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1728, y = 1082, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1696, y = 1079, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1664, y = 1078, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1632, y = 1078, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1600, y = 1078, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1568, y = 1080, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1536, y = 1082, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1504, y = 1084, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1472, y = 1085, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1440, y = 1087, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1408, y = 1089, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1376, y = 1091, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1344, y = 1092, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1312, y = 1094, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1280, y = 1095, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1248, y = 1096, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1216, y = 1096, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1184, y = 1098, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1152, y = 1098, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1120, y = 1098, z = 2000, rot = 16384 , team = 1}, - {name = 'armfort', x = 1088, y = 1097, z = 2000, rot = 16384 , team = 1}, - {name = 'armpb', x = 712, y = 1102, z = 1992, rot = 16384 , team = 1}, - {name = 'armpb', x = 968, y = 1099, z = 1992, rot = 16384 , team = 1}, - {name = 'armflak', x = 1232, y = 1103, z = 1520, rot = 16384 , team = 1}, - {name = 'armflak', x = 1264, y = 1105, z = 1776, rot = 16384 , team = 1}, - {name = 'armflak', x = 368, y = 1092, z = 1840, rot = 16384 , team = 1}, - {name = 'armflak', x = 1216, y = 1088, z = 1168, rot = 16384 , team = 1}, - {name = 'armpb', x = 552, y = 1109, z = 952, rot = 16384 , team = 1}, - {name = 'armpb', x = 696, y = 1119, z = 952, rot = 16384 , team = 1}, - {name = 'corspy', x = 3807, y = 1113, z = 4143, rot = 20165 , team = 0}, - {name = 'corspy', x = 3891, y = 1108, z = 4123, rot = 17985 , team = 0}, - {name = 'corspy', x = 3924, y = 1098, z = 4045, rot = 17072 , team = 0}, - {name = 'armllt', x = 4800, y = 996, z = 2448, rot = 16384 , team = 1}, - {name = 'armllt', x = 4608, y = 1069, z = 2464, rot = 16384 , team = 1}, - {name = 'armgeo', x = 1488, y = 1048, z = 2448, rot = 16384 , team = 1}, - + { name = "armmex", x = 952, y = 1101, z = 1592, rot = -16384, team = 1 }, + { name = "armmex", x = 744, y = 1104, z = 1496, rot = -16384, team = 1 }, + { name = "armmex", x = 760, y = 1101, z = 1864, rot = -16384, team = 1 }, + { name = "corvroc", x = 3977, y = 1108, z = 4094, rot = 26479, team = 0 }, + { name = "armcom", x = 597, y = 1109, z = 777, rot = 25306, team = 1 }, + { name = "armfort", x = 544, y = 1112, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1107, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1110, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1114, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1116, z = 720, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1113, z = 720, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1115, z = 752, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1118, z = 752, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1118, z = 784, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1113, z = 784, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1112, z = 816, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1118, z = 816, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1117, z = 848, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1111, z = 848, rot = -16384, team = 1 }, + { name = "armfort", x = 576, y = 1111, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 608, y = 1102, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 640, y = 1089, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 672, y = 1074, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1059, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1047, z = 688, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1055, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1068, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 672, y = 1080, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 640, y = 1093, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 608, y = 1103, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 576, y = 1111, z = 656, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1056, z = 720, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1043, z = 720, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1045, z = 752, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1058, z = 752, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1065, z = 784, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1053, z = 784, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1065, z = 816, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1075, z = 816, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1087, z = 848, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1079, z = 848, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1093, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1100, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 672, y = 1107, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 640, y = 1114, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 608, y = 1119, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 576, y = 1119, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1114, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1109, z = 880, rot = -16384, team = 1 }, + { name = "armfort", x = 512, y = 1108, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 544, y = 1111, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 576, y = 1115, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 608, y = 1120, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 640, y = 1118, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 672, y = 1115, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 704, y = 1112, z = 912, rot = -16384, team = 1 }, + { name = "armfort", x = 736, y = 1106, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 480, y = 1099, z = 624, rot = -16384, team = 1 }, + { name = "armdrag", x = 768, y = 1060, z = 624, rot = -16384, team = 1 }, + { name = "armdrag", x = 768, y = 1114, z = 944, rot = -16384, team = 1 }, + { name = "armdrag", x = 480, y = 1106, z = 944, rot = -16384, team = 1 }, + { name = "armdrag", x = 464, y = 1099, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 432, y = 1095, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 400, y = 1092, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1104, z = 624, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1101, z = 592, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1098, z = 560, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1066, z = 624, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1079, z = 592, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1091, z = 560, rot = -16384, team = 1 }, + { name = "armdrag", x = 768, y = 1047, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 800, y = 1044, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 832, y = 1048, z = 656, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1108, z = 944, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1107, z = 976, rot = -16384, team = 1 }, + { name = "armdrag", x = 512, y = 1107, z = 1008, rot = -16384, team = 1 }, + { name = "armdrag", x = 480, y = 1107, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 448, y = 1105, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 416, y = 1102, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1116, z = 944, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1119, z = 976, rot = -16384, team = 1 }, + { name = "armdrag", x = 736, y = 1116, z = 1008, rot = -16384, team = 1 }, + { name = "armdrag", x = 768, y = 1103, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 800, y = 1102, z = 912, rot = -16384, team = 1 }, + { name = "armdrag", x = 832, y = 1104, z = 912, rot = -16384, team = 1 }, + { name = "armllt", x = 3520, y = 1103, z = 2368, rot = -16384, team = 1 }, + { name = "armllt", x = 3728, y = 1097, z = 2336, rot = -16384, team = 1 }, + { name = "armllt", x = 3920, y = 1092, z = 2352, rot = -16384, team = 1 }, + { name = "armllt", x = 4144, y = 1094, z = 2400, rot = -16384, team = 1 }, + { name = "armllt", x = 4384, y = 1090, z = 2464, rot = -16384, team = 1 }, + { name = "armrad", x = 4224, y = 1089, z = 2112, rot = -16384, team = 1 }, + { name = "armdrag", x = 4240, y = 1093, z = 2432, rot = -16384, team = 1 }, + { name = "armdrag", x = 3632, y = 1099, z = 2368, rot = -16384, team = 1 }, + { name = "armdrag", x = 3376, y = 1112, z = 2368, rot = -16384, team = 1 }, + { name = "armferret", x = 3768, y = 1091, z = 2184, rot = -16384, team = 1 }, + { name = "armferret", x = 4232, y = 1094, z = 2232, rot = -16384, team = 1 }, + { name = "armferret", x = 4536, y = 1080, z = 2136, rot = -16384, team = 1 }, + { name = "armlab", x = 976, y = 1101, z = 1760, rot = 0, team = 1 }, + { name = "armnanotc", x = 872, y = 1100, z = 1640, rot = 0, team = 1 }, + { name = "armnanotc", x = 824, y = 1100, z = 1640, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1102, z = 1512, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1101, z = 1512, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1099, z = 1512, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1097, z = 1576, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1099, z = 1576, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1100, z = 1576, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1099, z = 1640, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1097, z = 1640, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1096, z = 1640, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1095, z = 1704, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1096, z = 1704, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1098, z = 1704, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1097, z = 1768, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1096, z = 1768, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1094, z = 1768, rot = 0, team = 1 }, + { name = "armwin", x = 456, y = 1094, z = 1832, rot = 0, team = 1 }, + { name = "armwin", x = 520, y = 1095, z = 1832, rot = 0, team = 1 }, + { name = "armwin", x = 584, y = 1097, z = 1832, rot = 0, team = 1 }, + { name = "armvp", x = 856, y = 1115, z = 4240, rot = 16384, team = 1 }, + { name = "armnanotc", x = 696, y = 1108, z = 4216, rot = 16384, team = 1 }, + { name = "armnanotc", x = 696, y = 1107, z = 4264, rot = 16384, team = 1 }, + { name = "armmex", x = 808, y = 1112, z = 4376, rot = 16384, team = 1 }, + { name = "armmex", x = 1048, y = 1125, z = 4456, rot = 16384, team = 1 }, + { name = "armmex", x = 760, y = 1112, z = 4136, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1101, z = 4344, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1096, z = 4344, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1090, z = 4344, rot = 16384, team = 1 }, + { name = "armwin", x = 440, y = 1084, z = 4408, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1090, z = 4408, rot = 16384, team = 1 }, + { name = "armmex", x = 2344, y = 893, z = 744, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1095, z = 4408, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1100, z = 4408, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1098, z = 4472, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1092, z = 4472, rot = 16384, team = 1 }, + { name = "armrad", x = 2000, y = 901, z = 896, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1086, z = 4472, rot = 16384, team = 1 }, + { name = "armwin", x = 440, y = 1077, z = 4472, rot = 16384, team = 1 }, + { name = "armllt", x = 2400, y = 895, z = 848, rot = 16384, team = 1 }, + { name = "armwin", x = 440, y = 1074, z = 4536, rot = 16384, team = 1 }, + { name = "armllt", x = 2368, y = 889, z = 992, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1083, z = 4536, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1090, z = 4536, rot = 16384, team = 1 }, + { name = "armllt", x = 2384, y = 924, z = 1168, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1095, z = 4536, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1092, z = 4600, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1085, z = 4600, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1080, z = 4600, rot = 16384, team = 1 }, + { name = "armwin", x = 440, y = 1073, z = 4600, rot = 16384, team = 1 }, + { name = "armwin", x = 440, y = 1071, z = 4664, rot = 16384, team = 1 }, + { name = "armwin", x = 504, y = 1076, z = 4664, rot = 16384, team = 1 }, + { name = "armwin", x = 568, y = 1079, z = 4664, rot = 16384, team = 1 }, + { name = "armwin", x = 632, y = 1085, z = 4664, rot = 16384, team = 1 }, + { name = "armfort", x = 2704, y = 1189, z = 3696, rot = 16384, team = 1 }, + { name = "armfort", x = 2720, y = 1154, z = 3728, rot = 16384, team = 1 }, + { name = "armfort", x = 2752, y = 1142, z = 3760, rot = 16384, team = 1 }, + { name = "armfort", x = 2768, y = 1145, z = 3792, rot = 16384, team = 1 }, + { name = "armfort", x = 2800, y = 1131, z = 3824, rot = 16384, team = 1 }, + { name = "armfort", x = 2816, y = 1110, z = 3856, rot = 16384, team = 1 }, + { name = "armfort", x = 2848, y = 1113, z = 3888, rot = 16384, team = 1 }, + { name = "armfort", x = 2864, y = 1101, z = 3920, rot = 16384, team = 1 }, + { name = "armfort", x = 2896, y = 1121, z = 3952, rot = 16384, team = 1 }, + { name = "armfort", x = 2912, y = 1130, z = 3984, rot = 16384, team = 1 }, + { name = "armfort", x = 2928, y = 1134, z = 4016, rot = 16384, team = 1 }, + { name = "armfort", x = 2960, y = 1167, z = 4048, rot = 16384, team = 1 }, + { name = "armfort", x = 2976, y = 1177, z = 4080, rot = 16384, team = 1 }, + { name = "armfort", x = 3008, y = 1165, z = 4112, rot = 16384, team = 1 }, + { name = "armhlt", x = 2416, y = 963, z = 1296, rot = 16384, team = 1 }, + { name = "armfort", x = 3024, y = 1163, z = 4144, rot = 16384, team = 1 }, + { name = "armfort", x = 3056, y = 1163, z = 4176, rot = 16384, team = 1 }, + { name = "armfort", x = 3072, y = 1164, z = 4208, rot = 16384, team = 1 }, + { name = "armdrag", x = 2560, y = 767, z = 880, rot = 16384, team = 1 }, + { name = "armfort", x = 3104, y = 1188, z = 4240, rot = 16384, team = 1 }, + { name = "armfort", x = 3120, y = 1214, z = 4272, rot = 16384, team = 1 }, + { name = "armfort", x = 3136, y = 1221, z = 4240, rot = 16384, team = 1 }, + { name = "armdrag", x = 2560, y = 807, z = 1120, rot = 16384, team = 1 }, + { name = "armfort", x = 3120, y = 1195, z = 4208, rot = 16384, team = 1 }, + { name = "armfort", x = 3088, y = 1179, z = 4176, rot = 16384, team = 1 }, + { name = "armfort", x = 3072, y = 1206, z = 4144, rot = 16384, team = 1 }, + { name = "armfort", x = 3040, y = 1192, z = 4112, rot = 16384, team = 1 }, + { name = "armfort", x = 3024, y = 1209, z = 4080, rot = 16384, team = 1 }, + { name = "armfort", x = 2992, y = 1204, z = 4048, rot = 16384, team = 1 }, + { name = "armfort", x = 2976, y = 1183, z = 4016, rot = 16384, team = 1 }, + { name = "armfort", x = 2944, y = 1159, z = 3984, rot = 16384, team = 1 }, + { name = "armfort", x = 2928, y = 1155, z = 3952, rot = 16384, team = 1 }, + { name = "armfort", x = 2896, y = 1132, z = 3920, rot = 16384, team = 1 }, + { name = "armwin", x = 2184, y = 917, z = 1032, rot = 16384, team = 1 }, + { name = "armfort", x = 2880, y = 1144, z = 3888, rot = 16384, team = 1 }, + { name = "armfort", x = 2848, y = 1143, z = 3856, rot = 16384, team = 1 }, + { name = "armfort", x = 2832, y = 1157, z = 3824, rot = 16384, team = 1 }, + { name = "armwin", x = 2120, y = 923, z = 1032, rot = 16384, team = 1 }, + { name = "armfort", x = 2800, y = 1177, z = 3792, rot = 16384, team = 1 }, + { name = "armfort", x = 2784, y = 1179, z = 3760, rot = 16384, team = 1 }, + { name = "armwin", x = 2120, y = 935, z = 1096, rot = 16384, team = 1 }, + { name = "armfort", x = 2752, y = 1165, z = 3728, rot = 16384, team = 1 }, + { name = "armwin", x = 2184, y = 929, z = 1096, rot = 16384, team = 1 }, + { name = "armfort", x = 2736, y = 1186, z = 3696, rot = 16384, team = 1 }, + { name = "armwin", x = 2184, y = 937, z = 1160, rot = 16384, team = 1 }, + { name = "armwin", x = 2120, y = 942, z = 1160, rot = 16384, team = 1 }, + { name = "armwin", x = 2120, y = 955, z = 1224, rot = 16384, team = 1 }, + { name = "armwin", x = 2184, y = 945, z = 1224, rot = 16384, team = 1 }, + { name = "armrad", x = 1984, y = 993, z = 1360, rot = 16384, team = 1 }, + { name = "armrad", x = 800, y = 1110, z = 4512, rot = 16384, team = 1 }, + { name = "armdrag", x = 2608, y = 685, z = 528, rot = 16384, team = 1 }, + { name = "armdrag", x = 2624, y = 692, z = 560, rot = 16384, team = 1 }, + { name = "armdrag", x = 2640, y = 696, z = 592, rot = 16384, team = 1 }, + { name = "armdrag", x = 2656, y = 694, z = 624, rot = 16384, team = 1 }, + { name = "armdrag", x = 2672, y = 691, z = 656, rot = 16384, team = 1 }, + { name = "armdrag", x = 2688, y = 686, z = 688, rot = 16384, team = 1 }, + { name = "armdrag", x = 2704, y = 681, z = 720, rot = 16384, team = 1 }, + { name = "armdrag", x = 2720, y = 675, z = 752, rot = 16384, team = 1 }, + { name = "armdrag", x = 2720, y = 669, z = 1264, rot = 16384, team = 1 }, + { name = "armdrag", x = 2704, y = 676, z = 1296, rot = 16384, team = 1 }, + { name = "armdrag", x = 2672, y = 685, z = 1328, rot = 16384, team = 1 }, + { name = "armdrag", x = 2656, y = 698, z = 1360, rot = 16384, team = 1 }, + { name = "armdrag", x = 2640, y = 710, z = 1392, rot = 16384, team = 1 }, + { name = "armdrag", x = 2624, y = 716, z = 1424, rot = 16384, team = 1 }, + { name = "armjamt", x = 784, y = 1101, z = 1760, rot = 16384, team = 1 }, + { name = "armrad", x = 672, y = 1102, z = 1616, rot = 16384, team = 1 }, + { name = "armrad", x = 784, y = 1102, z = 1584, rot = 16384, team = 1 }, + { name = "armllt", x = 1184, y = 1092, z = 2880, rot = 16384, team = 1 }, + { name = "armllt", x = 1040, y = 1089, z = 2976, rot = 16384, team = 1 }, + { name = "armllt", x = 896, y = 1094, z = 3120, rot = 16384, team = 1 }, + { name = "armllt", x = 816, y = 1099, z = 3248, rot = 16384, team = 1 }, + { name = "armllt", x = 720, y = 1097, z = 3376, rot = 16384, team = 1 }, + { name = "armllt", x = 656, y = 1102, z = 3584, rot = 16384, team = 1 }, + { name = "armllt", x = 672, y = 1107, z = 3760, rot = 16384, team = 1 }, + { name = "armllt", x = 720, y = 1106, z = 3872, rot = 16384, team = 1 }, + { name = "armllt", x = 864, y = 1112, z = 4016, rot = 16384, team = 1 }, + { name = "armllt", x = 992, y = 1117, z = 4096, rot = 16384, team = 1 }, + { name = "armllt", x = 1152, y = 1119, z = 4208, rot = 16384, team = 1 }, + { name = "armllt", x = 1344, y = 1120, z = 4304, rot = 16384, team = 1 }, + { name = "armllt", x = 1456, y = 1126, z = 4320, rot = 16384, team = 1 }, + { name = "armfort", x = 16, y = 1023, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 48, y = 1024, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 80, y = 1031, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 112, y = 1040, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 144, y = 1048, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 176, y = 1055, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 208, y = 1064, z = 1968, rot = 16384, team = 1 }, + { name = "armhlt", x = 1088, y = 1108, z = 4160, rot = 16384, team = 1 }, + { name = "armfort", x = 240, y = 1077, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 272, y = 1090, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 304, y = 1093, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 336, y = 1093, z = 1968, rot = 16384, team = 1 }, + { name = "armhlt", x = 768, y = 1110, z = 3920, rot = 16384, team = 1 }, + { name = "armfort", x = 368, y = 1094, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 400, y = 1096, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 432, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armhlt", x = 672, y = 1100, z = 3440, rot = 16384, team = 1 }, + { name = "armfort", x = 464, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 496, y = 1100, z = 1968, rot = 16384, team = 1 }, + { name = "armhlt", x = 848, y = 1097, z = 3152, rot = 16384, team = 1 }, + { name = "armfort", x = 528, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 560, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 592, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 592, y = 1100, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 560, y = 1100, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 528, y = 1100, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 496, y = 1100, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 464, y = 1099, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 432, y = 1099, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 400, y = 1098, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 368, y = 1094, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 336, y = 1092, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 304, y = 1088, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 272, y = 1085, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 240, y = 1084, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 208, y = 1063, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 176, y = 1055, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 144, y = 1046, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 112, y = 1036, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 80, y = 1026, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 48, y = 1019, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 16, y = 1019, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1088, y = 1098, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1120, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1152, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1184, y = 1099, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1216, y = 1097, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1248, y = 1097, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1280, y = 1097, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1312, y = 1096, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1344, y = 1094, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1376, y = 1093, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1408, y = 1091, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1440, y = 1090, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1472, y = 1088, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1504, y = 1086, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1536, y = 1085, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1568, y = 1083, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1600, y = 1081, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1632, y = 1081, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1664, y = 1080, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1696, y = 1081, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1728, y = 1083, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1760, y = 1086, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1792, y = 1090, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1824, y = 1094, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1856, y = 1100, z = 1968, rot = 16384, team = 1 }, + { name = "armfort", x = 1856, y = 1105, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1824, y = 1096, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1792, y = 1088, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1760, y = 1084, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1728, y = 1082, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1696, y = 1079, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1664, y = 1078, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1632, y = 1078, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1600, y = 1078, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1568, y = 1080, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1536, y = 1082, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1504, y = 1084, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1472, y = 1085, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1440, y = 1087, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1408, y = 1089, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1376, y = 1091, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1344, y = 1092, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1312, y = 1094, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1280, y = 1095, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1248, y = 1096, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1216, y = 1096, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1184, y = 1098, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1152, y = 1098, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1120, y = 1098, z = 2000, rot = 16384, team = 1 }, + { name = "armfort", x = 1088, y = 1097, z = 2000, rot = 16384, team = 1 }, + { name = "armpb", x = 712, y = 1102, z = 1992, rot = 16384, team = 1 }, + { name = "armpb", x = 968, y = 1099, z = 1992, rot = 16384, team = 1 }, + { name = "armflak", x = 1232, y = 1103, z = 1520, rot = 16384, team = 1 }, + { name = "armflak", x = 1264, y = 1105, z = 1776, rot = 16384, team = 1 }, + { name = "armflak", x = 368, y = 1092, z = 1840, rot = 16384, team = 1 }, + { name = "armflak", x = 1216, y = 1088, z = 1168, rot = 16384, team = 1 }, + { name = "armpb", x = 552, y = 1109, z = 952, rot = 16384, team = 1 }, + { name = "armpb", x = 696, y = 1119, z = 952, rot = 16384, team = 1 }, + { name = "corspy", x = 3807, y = 1113, z = 4143, rot = 20165, team = 0 }, + { name = "corspy", x = 3891, y = 1108, z = 4123, rot = 17985, team = 0 }, + { name = "corspy", x = 3924, y = 1098, z = 4045, rot = 17072, team = 0 }, + { name = "armllt", x = 4800, y = 996, z = 2448, rot = 16384, team = 1 }, + { name = "armllt", x = 4608, y = 1069, z = 2464, rot = 16384, team = 1 }, + { name = "armgeo", x = 1488, y = 1048, z = 2448, rot = 16384, team = 1 }, }, - + featureloadout = { - {name = 'armrectr_dead', x = 5000, y = 815, z = 2444, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = 'armflea_dead', x = 4982, y = 834, z = 2413, rot = 0 , scale = 1.0, resurrectas = "armflea"}, - {name = 'armpb_dead', x = 4133, y = 1013, z = 1214, rot = 0 , scale = 1.0, resurrectas = "armpb"}, - {name = 'armflea_dead', x = 4925, y = 902, z = 2418, rot = 0 , scale = 1.0, resurrectas = "armflea"}, - {name = 'armflea_dead', x = 4914, y = 910, z = 2491, rot = 0 , scale = 1.0, resurrectas = "armflea"}, - {name = 'armrectr_dead', x = 5042, y = 631, z = 183, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = 'armrectr_dead', x = 4948, y = 650, z = 194, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = 'armrad_dead', x = 4257, y = 1066, z = 1710, rot = 0 , scale = 1.0, resurrectas = "armrad"}, - {name = 'armpb_dead', x = 3744, y = 994, z = 1784, rot = 0 , scale = 1.0, resurrectas = "armpb"}, - {name = 'corgeo_dead', x = 2767, y = 1156, z = 3027, rot = 0 , scale = 1.0, resurrectas = "corgeo"}, - {name = 'armmlv_dead', x = 426, y = 1079, z = 2926, rot = 0 , scale = 1.0, resurrectas = "armmlv"}, - {name = 'armpb_dead', x = 4015, y = 1013, z = 1560, rot = 0 , scale = 1.0, resurrectas = "armpb"}, - } - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + { name = "armrectr_dead", x = 5000, y = 815, z = 2444, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armflea_dead", x = 4982, y = 834, z = 2413, rot = 0, scale = 1.0, resurrectas = "armflea" }, + { name = "armpb_dead", x = 4133, y = 1013, z = 1214, rot = 0, scale = 1.0, resurrectas = "armpb" }, + { name = "armflea_dead", x = 4925, y = 902, z = 2418, rot = 0, scale = 1.0, resurrectas = "armflea" }, + { name = "armflea_dead", x = 4914, y = 910, z = 2491, rot = 0, scale = 1.0, resurrectas = "armflea" }, + { name = "armrectr_dead", x = 5042, y = 631, z = 183, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armrectr_dead", x = 4948, y = 650, z = 194, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armrad_dead", x = 4257, y = 1066, z = 1710, rot = 0, scale = 1.0, resurrectas = "armrad" }, + { name = "armpb_dead", x = 3744, y = 994, z = 1784, rot = 0, scale = 1.0, resurrectas = "armpb" }, + { name = "corgeo_dead", x = 2767, y = 1156, z = 3027, rot = 0, scale = 1.0, resurrectas = "corgeo" }, + { name = "armmlv_dead", x = 426, y = 1079, z = 2926, rot = 0, scale = 1.0, resurrectas = "armmlv" }, + { name = "armpb_dead", x = 4015, y = 1013, z = 1560, rot = 0, scale = 1.0, resurrectas = "armpb" }, + }, + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { [allyTeam0] diff --git a/singleplayer/scenarios/scenario020.lua b/singleplayer/scenarios/scenario020.lua index 1c769ad7f9c..ee69ea4b343 100644 --- a/singleplayer/scenarios/scenario020.lua +++ b/singleplayer/scenarios/scenario020.lua @@ -1,46 +1,46 @@ local scenariodata = { - index = 20, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "FortressAssault", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Fortress Assault", -- can be anything - author = "Watch The Fort", -- your name here - imagepath = "scenario020.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "", -- This text will be drawn over image - summary = [[An abandoned enemy base lies nearby, though its defences still work. Destroy it, Commander!]], - briefing = [[The enemy is purely defending, so you won't have to worry about any incoming attacks. + index = 20, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "FortressAssault", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Fortress Assault", -- can be anything + author = "Watch The Fort", -- your name here + imagepath = "scenario020.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "", -- This text will be drawn over image + summary = [[An abandoned enemy base lies nearby, though its defences still work. Destroy it, Commander!]], + briefing = [[The enemy is purely defending, so you won't have to worry about any incoming attacks. There are multiple approaches to the base, with some more defended than others.]], - mapfilename = "Death Valley v1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "19%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "87%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 1200, -- par time in seconds (time a mission is expected to take on average) - parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 0, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - -- {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - -- {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - -- {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - -- {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all enemy factories", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of all your builders and factories", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - --armavp = 0, - --coravp = 0, - } , + mapfilename = "Death Valley v1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "19%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "87%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 1200, -- par time in seconds (time a mission is expected to take on average) + parresources = 1000000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 0, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + -- {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, + -- {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + -- {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, + -- {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all enemy factories", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of all your builders and factories", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + --armavp = 0, + --coravp = 0, + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "FortressAssault", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "FortressAssault", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -50,514 +50,514 @@ There are multiple approaches to the base, with some more defended than others.] -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - {name = 'armcom', x = 552, y = 8, z = 6767, rot = 0 , team = 0, neutral = false}, - {name = 'cormex', x = 3680, y = 6, z = 720, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3344, y = 6, z = 528, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3440, y = 6, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3024, y = 6, z = 1808, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4320, y = 6, z = 1632, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4240, y = 6, z = 2736, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5024, y = 6, z = 2528, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5392, y = 6, z = 2064, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5664, y = 6, z = 1776, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5872, y = 6, z = 2144, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5152, y = 6, z = 832, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 2656, y = 7, z = 224, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 288, y = 6, z = 272, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 160, y = 6, z = 1024, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 592, y = 6, z = 816, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5984, y = 6, z = 6144, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5552, y = 6, z = 6368, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5584, y = 6, z = 5824, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 2016, y = 6, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1856, y = 6, z = 2096, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1440, y = 77, z = 400, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1376, y = 76, z = 96, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4704, y = 77, z = 6784, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4768, y = 76, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4288, y = 6, z = 5072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4128, y = 6, z = 4864, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 2080, y = 150, z = 624, rot = 32767 , team = 1, neutral = false}, - {name = 'corllt', x = 2128, y = 139, z = 1040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1728, y = 120, z = 352, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1728, y = 119, z = 384, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 127, z = 416, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 125, z = 448, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 128, z = 480, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 126, z = 512, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 120, z = 544, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1776, y = 121, z = 576, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1856, y = 104, z = 1264, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1872, y = 107, z = 1232, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1872, y = 105, z = 1200, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1888, y = 105, z = 1168, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1888, y = 102, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1904, y = 103, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1904, y = 101, z = 1072, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1920, y = 104, z = 1040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1920, y = 104, z = 1008, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1696, y = 100, z = 720, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1712, y = 100, z = 752, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 101, z = 784, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 100, z = 816, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1792, y = 100, z = 848, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1808, y = 99, z = 880, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1840, y = 99, z = 912, rot = 32767 , team = 1, neutral = false}, - {name = 'corhllt', x = 336, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'corhllt', x = 5712, y = 7, z = 6128, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3504, y = 7, z = 2720, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3248, y = 16, z = 2576, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4080, y = 12, z = 3072, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 7, z = 2960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3376, y = 8, z = 2656, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 8, z = 3008, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3536, y = 7, z = 2752, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3280, y = 9, z = 2592, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4112, y = 22, z = 3088, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 7, z = 2976, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3408, y = 7, z = 2672, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 7, z = 3024, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3568, y = 7, z = 2768, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 9, z = 2608, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 39, z = 3104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3952, y = 7, z = 2992, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3440, y = 7, z = 2688, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 3040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3344, y = 8, z = 2640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3472, y = 7, z = 2704, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3824, y = 7, z = 2912, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3856, y = 7, z = 2928, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3184, y = 56, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3216, y = 35, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 72, z = 3120, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 105, z = 3152, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3152, y = 83, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3120, y = 102, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 7, z = 2592, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 8, z = 2624, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 8, z = 2624, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2624, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2592, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2560, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 7, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 7, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2304, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2336, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 2336, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 8, z = 2336, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 7, z = 2304, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 7, z = 2272, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 8, z = 2272, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2272, rot = 32767 , team = 1, neutral = false}, - {name = 'corlab', x = 4656, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'corlab', x = 3680, y = 7, z = 1520, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 96, y = 7, z = 624, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5520, y = 7, z = 6128, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 180, z = 6064, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3760, y = 165, z = 6096, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3776, y = 160, z = 6128, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3792, y = 149, z = 6160, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3808, y = 140, z = 6192, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3872, y = 139, z = 6320, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 138, z = 6352, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 136, z = 6384, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3904, y = 138, z = 6416, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3904, y = 134, z = 6448, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 138, z = 6480, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 138, z = 6512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3856, y = 134, z = 6640, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3824, y = 133, z = 6672, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3808, y = 138, z = 6704, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3792, y = 143, z = 6736, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3776, y = 167, z = 6768, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4112, y = 138, z = 6000, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4208, y = 142, z = 6544, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 4600, y = 66, z = 6136, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 2152, y = 142, z = 840, rot = 0 , team = 1, neutral = false}, - {name = 'corfhp', x = 4736, y = -4, z = 1208, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 6104, y = 8, z = 40, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5992, y = 7, z = 40, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5992, y = 7, z = 152, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 6104, y = 7, z = 152, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 3976, y = 7, z = 2312, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 3432, y = 8, z = 2104, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 4488, y = 8, z = 2712, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1488, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1520, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1552, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1552, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1520, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1488, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1456, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 8, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3680, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3712, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2080, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2176, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4624, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4624, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'coraap', x = 5392, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5304, y = 7, z = 552, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5304, y = 8, z = 600, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5480, y = 7, z = 600, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5480, y = 7, z = 552, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5440, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5408, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5376, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5344, y = 8, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5344, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5376, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5408, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5440, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5280, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 608, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 544, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5280, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5504, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 544, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 608, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5504, y = 7, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cormaw', x = 5312, y = 8, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cormaw', x = 5472, y = 7, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cormaw', x = 5312, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cormaw', x = 5472, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5680, y = 6, z = 656, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5280, y = 6, z = 304, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5352, y = 7, z = 824, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5464, y = 8, z = 824, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5464, y = 7, z = 936, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5352, y = 7, z = 936, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3816, y = 7, z = 1032, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3928, y = 7, z = 1032, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3928, y = 7, z = 1144, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3816, y = 7, z = 1144, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5536, y = 7, z = 288, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 3456, y = 384, z = 4864, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 1472, y = 384, z = 3664, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 4688, y = 385, z = 3488, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 4016, y = 384, z = 7104, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 2704, y = 384, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 2112, y = 384, z = 80, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 384, z = 80, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 383, z = 112, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2112, y = 384, z = 112, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 383, z = 112, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 383, z = 80, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 382, z = 48, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2112, y = 384, z = 48, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 386, z = 48, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 384, z = 2304, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 384, z = 2336, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2704, y = 383, z = 2336, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 381, z = 2336, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 383, z = 2304, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 383, z = 2272, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2704, y = 384, z = 2272, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 383, z = 2272, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 385, z = 3488, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 386, z = 3520, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 385, z = 3520, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3520, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3488, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3456, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 385, z = 3456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 385, z = 3456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7104, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7136, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 385, z = 7136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 385, z = 7136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 384, z = 7104, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 384, z = 7072, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 384, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 383, z = 4864, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 384, z = 4896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3456, y = 384, z = 4896, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4896, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4864, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4832, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3456, y = 383, z = 4832, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 382, z = 4832, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 385, z = 3664, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 384, z = 3696, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1472, y = 384, z = 3696, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3696, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3664, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3632, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1472, y = 384, z = 3632, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 385, z = 3632, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 2096, y = 7, z = 2912, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4016, y = 8, z = 4288, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4288, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4320, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 8, z = 4320, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4320, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4288, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4256, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 8, z = 4256, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4256, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2912, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2944, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2096, y = 7, z = 2944, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2944, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2912, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2880, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2096, y = 7, z = 2880, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2880, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 376, y = 7, z = 680, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 5672, y = 7, z = 6088, rot = 0 , team = 1, neutral = false}, - {name = 'corvp', x = 3192, y = 7, z = 824, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3264, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3296, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3264, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3296, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'corhllt', x = 3344, y = 7, z = 832, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 4752, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 3680, y = 7, z = 1424, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3376, y = 8, z = 2384, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3664, y = 7, z = 2576, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3952, y = 7, z = 2768, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4240, y = 10, z = 2944, rot = 0 , team = 1, neutral = false}, - {name = 'corhlt', x = 3616, y = 8, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'corhlt', x = 4176, y = 7, z = 2592, rot = 0 , team = 1, neutral = false}, - {name = 'corhllt', x = 3920, y = 7, z = 2480, rot = 0 , team = 1, neutral = false}, - {name = 'cormadsam', x = 5656, y = 7, z = 408, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 5600, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 5952, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4736, y = 7, z = 528, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 4736, y = 7, z = 176, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 208, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 208, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 208, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 176, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 144, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 528, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 560, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 560, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 528, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 496, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 496, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 496, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5600, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5600, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5952, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5952, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1152, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1184, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1216, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1216, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1184, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1152, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotcplat', x = 4616, y = 0, z = 1208, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotcplat', x = 4856, y = 0, z = 1208, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4624, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4592, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4848, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4880, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corrad', x = 4224, y = 7, z = 2000, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 2000, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 2032, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4224, y = 7, z = 2032, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 2032, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 2000, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 1968, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4224, y = 7, z = 1968, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 1968, rot = -16384 , team = 1, neutral = false}, - {name = 'corfrt', x = 5072, y = -4, z = 1376, rot = -16384 , team = 1, neutral = false}, - {name = 'corfrt', x = 4480, y = -4, z = 992, rot = -16384 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 9, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, + { name = "armcom", x = 552, y = 8, z = 6767, rot = 0, team = 0, neutral = false }, + { name = "cormex", x = 3680, y = 6, z = 720, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3344, y = 6, z = 528, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3440, y = 6, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3024, y = 6, z = 1808, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4320, y = 6, z = 1632, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4240, y = 6, z = 2736, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5024, y = 6, z = 2528, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5392, y = 6, z = 2064, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5664, y = 6, z = 1776, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5872, y = 6, z = 2144, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5152, y = 6, z = 832, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 2656, y = 7, z = 224, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 288, y = 6, z = 272, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 160, y = 6, z = 1024, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 592, y = 6, z = 816, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5984, y = 6, z = 6144, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5552, y = 6, z = 6368, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5584, y = 6, z = 5824, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 2016, y = 6, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1856, y = 6, z = 2096, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1440, y = 77, z = 400, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1376, y = 76, z = 96, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4704, y = 77, z = 6784, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4768, y = 76, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4288, y = 6, z = 5072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4128, y = 6, z = 4864, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 2080, y = 150, z = 624, rot = 32767, team = 1, neutral = false }, + { name = "corllt", x = 2128, y = 139, z = 1040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1728, y = 120, z = 352, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1728, y = 119, z = 384, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 127, z = 416, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 125, z = 448, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 128, z = 480, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 126, z = 512, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 120, z = 544, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1776, y = 121, z = 576, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1856, y = 104, z = 1264, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1872, y = 107, z = 1232, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1872, y = 105, z = 1200, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1888, y = 105, z = 1168, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1888, y = 102, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1904, y = 103, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1904, y = 101, z = 1072, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1920, y = 104, z = 1040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1920, y = 104, z = 1008, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1696, y = 100, z = 720, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1712, y = 100, z = 752, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 101, z = 784, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 100, z = 816, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1792, y = 100, z = 848, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1808, y = 99, z = 880, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1840, y = 99, z = 912, rot = 32767, team = 1, neutral = false }, + { name = "corhllt", x = 336, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "corhllt", x = 5712, y = 7, z = 6128, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3504, y = 7, z = 2720, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3248, y = 16, z = 2576, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4080, y = 12, z = 3072, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 7, z = 2960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3376, y = 8, z = 2656, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 8, z = 3008, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3536, y = 7, z = 2752, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3280, y = 9, z = 2592, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4112, y = 22, z = 3088, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 7, z = 2976, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3408, y = 7, z = 2672, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 7, z = 3024, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3568, y = 7, z = 2768, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 9, z = 2608, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 39, z = 3104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3952, y = 7, z = 2992, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3440, y = 7, z = 2688, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 3040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3344, y = 8, z = 2640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3472, y = 7, z = 2704, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3824, y = 7, z = 2912, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3856, y = 7, z = 2928, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3184, y = 56, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3216, y = 35, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 72, z = 3120, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 105, z = 3152, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3152, y = 83, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3120, y = 102, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 7, z = 2592, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 8, z = 2624, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 8, z = 2624, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2624, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2592, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2560, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 7, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 7, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2304, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2336, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 2336, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 8, z = 2336, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 7, z = 2304, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 7, z = 2272, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 8, z = 2272, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2272, rot = 32767, team = 1, neutral = false }, + { name = "corlab", x = 4656, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "corlab", x = 3680, y = 7, z = 1520, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 96, y = 7, z = 624, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5520, y = 7, z = 6128, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 180, z = 6064, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3760, y = 165, z = 6096, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3776, y = 160, z = 6128, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3792, y = 149, z = 6160, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3808, y = 140, z = 6192, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3872, y = 139, z = 6320, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 138, z = 6352, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 136, z = 6384, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3904, y = 138, z = 6416, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3904, y = 134, z = 6448, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 138, z = 6480, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 138, z = 6512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3856, y = 134, z = 6640, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3824, y = 133, z = 6672, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3808, y = 138, z = 6704, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3792, y = 143, z = 6736, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3776, y = 167, z = 6768, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4112, y = 138, z = 6000, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4208, y = 142, z = 6544, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 4600, y = 66, z = 6136, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 2152, y = 142, z = 840, rot = 0, team = 1, neutral = false }, + { name = "corfhp", x = 4736, y = -4, z = 1208, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 6104, y = 8, z = 40, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5992, y = 7, z = 40, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5992, y = 7, z = 152, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 6104, y = 7, z = 152, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 3976, y = 7, z = 2312, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 3432, y = 8, z = 2104, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 4488, y = 8, z = 2712, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1488, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1520, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1552, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1552, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1520, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1488, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1456, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 8, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3680, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3712, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2080, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2176, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4624, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4624, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "coraap", x = 5392, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5304, y = 7, z = 552, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5304, y = 8, z = 600, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5480, y = 7, z = 600, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5480, y = 7, z = 552, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5440, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5408, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5376, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5344, y = 8, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5344, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5376, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5408, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5440, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5280, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 608, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 544, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5280, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5504, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 544, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 608, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5504, y = 7, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cormaw", x = 5312, y = 8, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cormaw", x = 5472, y = 7, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cormaw", x = 5312, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cormaw", x = 5472, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5680, y = 6, z = 656, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5280, y = 6, z = 304, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5352, y = 7, z = 824, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5464, y = 8, z = 824, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5464, y = 7, z = 936, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5352, y = 7, z = 936, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3816, y = 7, z = 1032, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3928, y = 7, z = 1032, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3928, y = 7, z = 1144, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3816, y = 7, z = 1144, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5536, y = 7, z = 288, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 3456, y = 384, z = 4864, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 1472, y = 384, z = 3664, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 4688, y = 385, z = 3488, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 4016, y = 384, z = 7104, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 2704, y = 384, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 2112, y = 384, z = 80, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 384, z = 80, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 383, z = 112, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2112, y = 384, z = 112, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 383, z = 112, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 383, z = 80, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 382, z = 48, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2112, y = 384, z = 48, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 386, z = 48, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 384, z = 2304, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 384, z = 2336, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2704, y = 383, z = 2336, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 381, z = 2336, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 383, z = 2304, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 383, z = 2272, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2704, y = 384, z = 2272, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 383, z = 2272, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 385, z = 3488, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 386, z = 3520, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 385, z = 3520, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3520, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3488, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3456, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 385, z = 3456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 385, z = 3456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7104, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7136, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 385, z = 7136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 385, z = 7136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 384, z = 7104, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 384, z = 7072, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 384, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 383, z = 4864, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 384, z = 4896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3456, y = 384, z = 4896, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4896, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4864, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4832, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3456, y = 383, z = 4832, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 382, z = 4832, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 385, z = 3664, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 384, z = 3696, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 1472, y = 384, z = 3696, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3696, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3664, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3632, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 1472, y = 384, z = 3632, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 385, z = 3632, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 2096, y = 7, z = 2912, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4016, y = 8, z = 4288, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4288, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4320, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 8, z = 4320, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4320, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4288, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4256, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 8, z = 4256, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4256, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2912, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2944, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2096, y = 7, z = 2944, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2944, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2912, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2880, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2096, y = 7, z = 2880, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2880, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 376, y = 7, z = 680, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 5672, y = 7, z = 6088, rot = 0, team = 1, neutral = false }, + { name = "corvp", x = 3192, y = 7, z = 824, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3264, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3296, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3264, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3296, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "corhllt", x = 3344, y = 7, z = 832, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 4752, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 3680, y = 7, z = 1424, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3376, y = 8, z = 2384, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3664, y = 7, z = 2576, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3952, y = 7, z = 2768, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4240, y = 10, z = 2944, rot = 0, team = 1, neutral = false }, + { name = "corhlt", x = 3616, y = 8, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "corhlt", x = 4176, y = 7, z = 2592, rot = 0, team = 1, neutral = false }, + { name = "corhllt", x = 3920, y = 7, z = 2480, rot = 0, team = 1, neutral = false }, + { name = "cormadsam", x = 5656, y = 7, z = 408, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 5600, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 5952, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4736, y = 7, z = 528, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 4736, y = 7, z = 176, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 208, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 208, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 208, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 176, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 144, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 528, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 560, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 560, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 528, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 496, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 496, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 496, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5600, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5600, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5952, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5952, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1152, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1184, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1216, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1216, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1184, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1152, rot = -16384, team = 1, neutral = false }, + { name = "cornanotcplat", x = 4616, y = 0, z = 1208, rot = -16384, team = 1, neutral = false }, + { name = "cornanotcplat", x = 4856, y = 0, z = 1208, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4624, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4592, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4848, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4880, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corrad", x = 4224, y = 7, z = 2000, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 2000, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 2032, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4224, y = 7, z = 2032, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 2032, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 2000, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 1968, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4224, y = 7, z = 1968, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 1968, rot = -16384, team = 1, neutral = false }, + { name = "corfrt", x = 5072, y = -4, z = 1376, rot = -16384, team = 1, neutral = false }, + { name = "corfrt", x = 4480, y = -4, z = 992, rot = -16384, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 9, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, --{name = 'corestor', x = 6000, y = 7, z = 2032, rot = 32767 , team = 1, neutral = false}, --{name = 'corestor', x = 3616, y = 7, z = 160, rot = 32767 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5776, y = 7, z = 528, rot = 32767 , team = 1, neutral = false}, - {name = 'corexp', x = 5808, y = 6, z = 256, rot = 0 , team = 1, neutral = false}, - {name = 'cormstor', x = 5781, y = 7, z = 6285, rot = 0 , team = 1, neutral = false}, - {name = 'cormstor', x = 382, y = 7, z = 939, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 896, y = 7, z = 2112, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 952, y = 7, z = 2104, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 952, y = 8, z = 2152, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 904, y = 7, z = 2168, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 856, y = 7, z = 2168, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 840, y = 7, z = 2120, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 840, y = 7, z = 2072, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 888, y = 7, z = 2056, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 936, y = 7, z = 2056, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5328, y = 7, z = 4944, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 5384, y = 7, z = 4936, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5384, y = 8, z = 4984, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5336, y = 7, z = 5000, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 5288, y = 7, z = 5000, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 5272, y = 7, z = 4952, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5272, y = 7, z = 4904, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5320, y = 7, z = 4888, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 5368, y = 7, z = 4888, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4648, y = 7, z = 2216, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4696, y = 7, z = 2216, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4648, y = 7, z = 2008, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4696, y = 7, z = 2008, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3784, y = 7, z = 1480, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3784, y = 7, z = 1528, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3576, y = 7, z = 1528, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3576, y = 7, z = 1480, rot = 0 , team = 1, neutral = false}, + { name = "coradvsol", x = 5776, y = 7, z = 528, rot = 32767, team = 1, neutral = false }, + { name = "corexp", x = 5808, y = 6, z = 256, rot = 0, team = 1, neutral = false }, + { name = "cormstor", x = 5781, y = 7, z = 6285, rot = 0, team = 1, neutral = false }, + { name = "cormstor", x = 382, y = 7, z = 939, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 896, y = 7, z = 2112, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 952, y = 7, z = 2104, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 952, y = 8, z = 2152, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 904, y = 7, z = 2168, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 856, y = 7, z = 2168, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 840, y = 7, z = 2120, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 840, y = 7, z = 2072, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 888, y = 7, z = 2056, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 936, y = 7, z = 2056, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5328, y = 7, z = 4944, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 5384, y = 7, z = 4936, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 5384, y = 8, z = 4984, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 5336, y = 7, z = 5000, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 5288, y = 7, z = 5000, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 5272, y = 7, z = 4952, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 5272, y = 7, z = 4904, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 5320, y = 7, z = 4888, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 5368, y = 7, z = 4888, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4648, y = 7, z = 2216, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4696, y = 7, z = 2216, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4648, y = 7, z = 2008, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4696, y = 7, z = 2008, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3784, y = 7, z = 1480, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3784, y = 7, z = 1528, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3576, y = 7, z = 1528, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3576, y = 7, z = 1480, rot = 0, team = 1, neutral = false }, --{name = 'corestor', x = 3184, y = 7, z = 912, rot = 0 , team = 1, neutral = false}, --{name = 'corestor', x = 3184, y = 7, z = 736, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 928, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 960, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3200, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3168, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 928, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 720, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 720, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 688, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3168, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3200, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 3272, y = 7, z = 856, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotc', x = 3272, y = 7, z = 792, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 7, z = 784, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 7, z = 864, rot = -16384 , team = 1, neutral = false}, + { name = "cordrag", x = 3232, y = 7, z = 928, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 960, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3200, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3168, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 928, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 720, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 720, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 688, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3168, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3200, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 3272, y = 7, z = 856, rot = -16384, team = 1, neutral = false }, + { name = "cornanotc", x = 3272, y = 7, z = 792, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 7, z = 784, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 7, z = 864, rot = -16384, team = 1, neutral = false }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -626,7 +626,6 @@ There are multiple approaches to the base, with some more defended than others.] nohelperais = 0; } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario021.lua b/singleplayer/scenarios/scenario021.lua index 21353fa1308..facece615bb 100644 --- a/singleplayer/scenarios/scenario021.lua +++ b/singleplayer/scenarios/scenario021.lua @@ -1,42 +1,42 @@ local scenariodata = { - index = 21, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "Begin04", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "New Beginning", -- can be anything - author = "wilkubyk", -- your name here - imagepath = "scenario021.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Ghost time", -- This text will be drawn over image - summary = [[Incoming Transmission: + index = 21, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "Begin04", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "New Beginning", -- can be anything + author = "wilkubyk", -- your name here + imagepath = "scenario021.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Ghost time", -- This text will be drawn over image + summary = [[Incoming Transmission: Commander...intel report that it is cortex ba... ,it is...functio...,seek and des... transmission interrupted! ]], - briefing = [[Tips: - Build a Shield as soon as possible + briefing = [[Tips: - Build a Shield as soon as possible - Try to Capture enemy constructor to gain access to foe Tech - Don't forget early AA ]], - mapfilename = "Death Valley v1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "19%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "87%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 2400, -- par time in seconds (time a mission is expected to take on average) - parresources = 4000000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 9, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=0}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=0}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = 0, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = 0, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all enemy factories", -- This is plaintext, but should be reflected in startscript - losscondition = "Loss of all your builders and factories", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - corlab = 2, + mapfilename = "Death Valley v1", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "19%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "87%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 2400, -- par time in seconds (time a mission is expected to take on average) + parresources = 4000000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 9, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = 0 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = 0 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = 0, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = 0, enemyhandicap = 50 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all enemy factories", -- This is plaintext, but should be reflected in startscript + losscondition = "Loss of all your builders and factories", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + corlab = 2, coralab = 1, corck = 3, corack = 3, @@ -75,14 +75,14 @@ Commander...intel report that it is cortex ba... ,it is...functio...,seek and de armamsub = 0, armafus = 2, armmmkr = 6, - } , + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "Begin04", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "Begin04", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -92,592 +92,592 @@ Commander...intel report that it is cortex ba... ,it is...functio...,seek and de -- Note: If you have ANY units in loadout, then there will be no initial units spawned for anyone, so you have to take care of that -- so you must spawn the initial commanders then! - {name = 'armcom', x = 552, y = 8, z = 6767, rot = 0 , team = 0, neutral = false}, - {name = 'cormex', x = 3680, y = 6, z = 720, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3344, y = 6, z = 528, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3440, y = 6, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 3024, y = 6, z = 1808, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4320, y = 6, z = 1632, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4240, y = 6, z = 2736, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5024, y = 6, z = 2528, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5392, y = 6, z = 2064, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5664, y = 6, z = 1776, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5872, y = 6, z = 2144, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5152, y = 6, z = 832, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 2656, y = 7, z = 224, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 288, y = 6, z = 272, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 160, y = 6, z = 1024, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 592, y = 6, z = 816, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5984, y = 6, z = 6144, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5552, y = 6, z = 6368, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5584, y = 6, z = 5824, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 2016, y = 6, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1856, y = 6, z = 2096, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1440, y = 77, z = 400, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 1376, y = 76, z = 96, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4704, y = 77, z = 6784, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4768, y = 76, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4288, y = 6, z = 5072, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 4128, y = 6, z = 4864, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 2080, y = 150, z = 624, rot = 32767 , team = 1, neutral = false}, - {name = 'corllt', x = 2128, y = 139, z = 1040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1728, y = 120, z = 352, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1728, y = 119, z = 384, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 127, z = 416, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 125, z = 448, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 128, z = 480, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 126, z = 512, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 120, z = 544, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1776, y = 121, z = 576, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1856, y = 104, z = 1264, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1872, y = 107, z = 1232, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1872, y = 105, z = 1200, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1888, y = 105, z = 1168, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1888, y = 102, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1904, y = 103, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1904, y = 101, z = 1072, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1920, y = 104, z = 1040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1920, y = 104, z = 1008, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1696, y = 100, z = 720, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1712, y = 100, z = 752, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1744, y = 101, z = 784, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1760, y = 100, z = 816, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1792, y = 100, z = 848, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1808, y = 99, z = 880, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1840, y = 99, z = 912, rot = 32767 , team = 1, neutral = false}, - {name = 'corhllt', x = 336, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'corhllt', x = 5712, y = 7, z = 6128, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3504, y = 7, z = 2720, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3248, y = 16, z = 2576, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4080, y = 12, z = 3072, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 7, z = 2960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3376, y = 8, z = 2656, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 8, z = 3008, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3536, y = 7, z = 2752, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3280, y = 9, z = 2592, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4112, y = 22, z = 3088, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 7, z = 2976, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3408, y = 7, z = 2672, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 7, z = 3024, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3568, y = 7, z = 2768, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 9, z = 2608, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 39, z = 3104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3952, y = 7, z = 2992, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3440, y = 7, z = 2688, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 3040, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3344, y = 8, z = 2640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3472, y = 7, z = 2704, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3824, y = 7, z = 2912, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3856, y = 7, z = 2928, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3184, y = 56, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3216, y = 35, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 72, z = 3120, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 105, z = 3152, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3152, y = 83, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3120, y = 102, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 7, z = 2592, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 8, z = 2624, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 8, z = 2624, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2624, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2592, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4144, y = 7, z = 2560, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4176, y = 7, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4208, y = 7, z = 2560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2304, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2336, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 2336, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 8, z = 2336, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 7, z = 2304, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3584, y = 7, z = 2272, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 8, z = 2272, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 7, z = 2272, rot = 32767 , team = 1, neutral = false}, - {name = 'corlab', x = 4656, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'corlab', x = 3680, y = 7, z = 1520, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 96, y = 7, z = 624, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5520, y = 7, z = 6128, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 180, z = 6064, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3760, y = 165, z = 6096, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3776, y = 160, z = 6128, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3792, y = 149, z = 6160, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3808, y = 142, z = 6192, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3872, y = 139, z = 6320, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 138, z = 6352, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3888, y = 136, z = 6384, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3904, y = 138, z = 6416, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3904, y = 134, z = 6448, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 138, z = 6480, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3920, y = 138, z = 6512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3856, y = 134, z = 6640, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3824, y = 133, z = 6672, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3808, y = 138, z = 6704, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3792, y = 143, z = 6736, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3776, y = 167, z = 6768, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4112, y = 138, z = 6000, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4208, y = 142, z = 6544, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 4600, y = 66, z = 6136, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 2152, y = 142, z = 840, rot = 0 , team = 1, neutral = false}, - {name = 'corfhp', x = 4736, y = -4, z = 1208, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 6104, y = 8, z = 40, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5992, y = 7, z = 40, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5992, y = 7, z = 152, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 6104, y = 7, z = 152, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 3976, y = 7, z = 2312, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 3432, y = 8, z = 2104, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 4488, y = 8, z = 2712, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1488, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1520, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1552, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1552, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1520, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1488, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3616, y = 7, z = 1456, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3648, y = 8, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3680, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3712, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3744, y = 7, z = 1456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2080, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2176, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4624, y = 7, z = 2176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4624, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 7, z = 2048, rot = 0 , team = 1, neutral = false}, - {name = 'coraap', x = 5392, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5304, y = 7, z = 552, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5304, y = 8, z = 600, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5480, y = 7, z = 600, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 5480, y = 7, z = 552, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5440, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5408, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5376, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5344, y = 8, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5344, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5376, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5408, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5440, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5280, y = 7, z = 640, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 608, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5264, y = 7, z = 544, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5280, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5504, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 544, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 576, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5520, y = 7, z = 608, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5504, y = 7, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5312, y = 8, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5472, y = 7, z = 640, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5312, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5472, y = 7, z = 512, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5680, y = 6, z = 656, rot = 0 , team = 1, neutral = false}, - {name = 'cormex', x = 5280, y = 6, z = 304, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5352, y = 7, z = 824, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5464, y = 8, z = 824, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5464, y = 7, z = 936, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 5352, y = 7, z = 936, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3816, y = 7, z = 1032, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3928, y = 7, z = 1032, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3928, y = 7, z = 1144, rot = 0 , team = 1, neutral = false}, - {name = 'corsolar', x = 3816, y = 7, z = 1144, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5536, y = 7, z = 288, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 3456, y = 384, z = 4864, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 1472, y = 384, z = 3664, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 4688, y = 385, z = 3488, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 4016, y = 384, z = 7104, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 2704, y = 384, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'corrad', x = 2112, y = 384, z = 80, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 384, z = 80, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 383, z = 112, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2112, y = 384, z = 112, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 383, z = 112, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 383, z = 80, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2080, y = 382, z = 48, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2112, y = 384, z = 48, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2144, y = 386, z = 48, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 384, z = 2304, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 384, z = 2336, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2704, y = 380, z = 2336, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 378, z = 2336, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 383, z = 2304, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2672, y = 383, z = 2272, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2704, y = 384, z = 2272, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2736, y = 383, z = 2272, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 385, z = 3488, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 386, z = 3520, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 385, z = 3520, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3520, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3488, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4656, y = 385, z = 3456, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4688, y = 385, z = 3456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4720, y = 385, z = 3456, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7104, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7136, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 385, z = 7136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 385, z = 7136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 384, z = 7104, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 384, z = 7072, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 384, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 384, z = 7072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 382, z = 4864, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 382, z = 4896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3456, y = 384, z = 4896, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4896, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4864, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3424, y = 383, z = 4832, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3456, y = 383, z = 4832, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3488, y = 380, z = 4832, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 385, z = 3664, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 384, z = 3696, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1472, y = 384, z = 3696, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3696, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3664, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1440, y = 384, z = 3632, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 1472, y = 384, z = 3632, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 1504, y = 385, z = 3632, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 2096, y = 7, z = 2912, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4016, y = 8, z = 4288, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4288, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4320, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 8, z = 4320, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4320, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4288, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3984, y = 7, z = 4256, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4016, y = 8, z = 4256, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4048, y = 8, z = 4256, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2912, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2944, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2096, y = 7, z = 2944, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2944, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2912, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2064, y = 7, z = 2880, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 2096, y = 7, z = 2880, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 2128, y = 7, z = 2880, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 376, y = 7, z = 680, rot = 0 , team = 1, neutral = false}, - {name = 'corrl', x = 5672, y = 7, z = 6088, rot = 0 , team = 1, neutral = false}, - {name = 'corvp', x = 3192, y = 7, z = 824, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3264, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3296, y = 7, z = 896, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3264, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3296, y = 7, z = 752, rot = -16384 , team = 1, neutral = false}, - {name = 'corhllt', x = 3344, y = 7, z = 832, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 4752, y = 7, z = 2112, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 3680, y = 7, z = 1424, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3376, y = 8, z = 2384, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3664, y = 7, z = 2576, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 3952, y = 7, z = 2768, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4240, y = 10, z = 2944, rot = 0 , team = 1, neutral = false}, - {name = 'corhlt', x = 3616, y = 8, z = 2304, rot = 0 , team = 1, neutral = false}, - {name = 'corhlt', x = 4176, y = 7, z = 2592, rot = 0 , team = 1, neutral = false}, - {name = 'corhllt', x = 3920, y = 7, z = 2480, rot = 0 , team = 1, neutral = false}, - {name = 'cormadsam', x = 5656, y = 7, z = 408, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 5600, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 5952, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'corllt', x = 4736, y = 7, z = 528, rot = -16384 , team = 1, neutral = false}, - {name = 'corllt', x = 4736, y = 7, z = 176, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 176, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 208, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 208, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 208, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 176, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 144, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 144, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 528, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 560, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 560, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 560, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 528, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4704, y = 7, z = 496, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4736, y = 7, z = 496, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4768, y = 7, z = 496, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5600, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5568, y = 7, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5600, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5632, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1104, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1136, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 5952, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1136, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1104, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5920, y = 7, z = 1072, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 5952, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 5984, y = 7, z = 1072, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1152, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1184, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1216, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4656, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1216, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1184, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4816, y = -3, z = 1152, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotcplat', x = 4616, y = 0, z = 1208, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotcplat', x = 4856, y = 0, z = 1208, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4624, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4592, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4848, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corfdrag', x = 4880, y = -3, z = 1248, rot = -16384 , team = 1, neutral = false}, - {name = 'corrad', x = 4224, y = 7, z = 2000, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 2000, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 2032, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 4224, y = 7, z = 2032, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 2032, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 2000, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4192, y = 7, z = 1968, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 4224, y = 7, z = 1968, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 4256, y = 7, z = 1968, rot = -16384 , team = 1, neutral = false}, - {name = 'corfrt', x = 5072, y = -4, z = 1376, rot = -16384 , team = 1, neutral = false}, - {name = 'corfrt', x = 4480, y = -4, z = 992, rot = -16384 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1880, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6008, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5944, y = 7, z = 1816, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 8, z = 1944, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 8, z = 1560, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1688, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 5880, y = 7, z = 1432, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1752, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1496, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 6072, y = 7, z = 1624, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 8, z = 72, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 136, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 200, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3688, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3752, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3816, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3880, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 3944, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4008, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4072, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4136, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4200, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4264, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4328, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corwin', x = 4392, y = 7, z = 264, rot = 32767 , team = 1, neutral = false}, - {name = 'corestor', x = 6000, y = 7, z = 2032, rot = 32767 , team = 1, neutral = false}, - {name = 'corestor', x = 3616, y = 7, z = 160, rot = 32767 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5776, y = 7, z = 528, rot = 32767 , team = 1, neutral = false}, - {name = 'corexp', x = 5808, y = 6, z = 256, rot = 0 , team = 1, neutral = false}, - {name = 'cormstor', x = 5781, y = 7, z = 6285, rot = 0 , team = 1, neutral = false}, - {name = 'cormstor', x = 382, y = 7, z = 939, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 896, y = 7, z = 2112, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 952, y = 7, z = 2104, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 952, y = 7, z = 2152, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 904, y = 7, z = 2168, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 856, y = 7, z = 2168, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 840, y = 7, z = 2120, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 840, y = 7, z = 2072, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 888, y = 7, z = 2056, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 936, y = 7, z = 2056, rot = 0 , team = 1, neutral = false}, - {name = 'coradvsol', x = 5328, y = 7, z = 4944, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 5384, y = 7, z = 4936, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5384, y = 8, z = 4984, rot = -16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5336, y = 7, z = 5000, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 5288, y = 7, z = 5000, rot = 32767 , team = 1, neutral = false}, - {name = 'cormakr', x = 5272, y = 7, z = 4952, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5272, y = 7, z = 4904, rot = 16384 , team = 1, neutral = false}, - {name = 'cormakr', x = 5320, y = 7, z = 4888, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 5368, y = 8, z = 4888, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4648, y = 7, z = 2216, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4696, y = 7, z = 2216, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4648, y = 7, z = 2008, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 4696, y = 7, z = 2008, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3784, y = 7, z = 1480, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3784, y = 7, z = 1528, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3576, y = 7, z = 1528, rot = 0 , team = 1, neutral = false}, - {name = 'cormakr', x = 3576, y = 7, z = 1480, rot = 0 , team = 1, neutral = false}, - {name = 'corestor', x = 3184, y = 7, z = 912, rot = 0 , team = 1, neutral = false}, - {name = 'corestor', x = 3184, y = 7, z = 736, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 928, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 960, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3200, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3168, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 960, rot = 32767 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 928, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 720, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 720, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3136, y = 7, z = 688, rot = 16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3168, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3200, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cordrag', x = 3232, y = 7, z = 688, rot = 0 , team = 1, neutral = false}, - {name = 'cornanotc', x = 3272, y = 7, z = 856, rot = -16384 , team = 1, neutral = false}, - {name = 'cornanotc', x = 3272, y = 7, z = 792, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 7, z = 784, rot = -16384 , team = 1, neutral = false}, - {name = 'cordrag', x = 3312, y = 7, z = 864, rot = -16384 , team = 1, neutral = false}, - {name = 'armckfus', x = 584, y = 7, z = 7008, rot = 32767 , team = 0, neutral = false}, - {name = 'armjamt', x = 656, y = 7, z = 6624, rot = 32767 , team = 0, neutral = false}, - {name = 'cordoom', x = 1376, y = 370, z = 3888, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 1648, y = 376, z = 3904, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 1552, y = 385, z = 3632, rot = 32767 , team = 1, neutral = false}, - {name = 'corflak', x = 1504, y = 383, z = 3824, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 1392, y = 383, z = 3664, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 3248, y = 371, z = 4752, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 3536, y = 372, z = 5040, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 3520, y = 373, z = 4816, rot = 32767 , team = 1, neutral = false}, - {name = 'corflak', x = 3392, y = 381, z = 4784, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 3536, y = 378, z = 4880, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3672, y = 245, z = 5848, rot = 32767 , team = 1, neutral = false}, - {name = 'corflak', x = 3648, y = 239, z = 5728, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 3840, y = 144, z = 5744, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 3856, y = 142, z = 5808, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3848, y = 151, z = 6184, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3928, y = 142, z = 6312, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4032, y = 141, z = 6096, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4128, y = 127, z = 6272, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4224, y = 109, z = 6224, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 4240, y = 102, z = 6096, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3960, y = 141, z = 6472, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4144, y = 143, z = 6480, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4112, y = 373, z = 6976, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4112, y = 384, z = 7104, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 4040, y = 374, z = 6968, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4176, y = 373, z = 7056, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 4176, y = 378, z = 7120, rot = 32767 , team = 1, neutral = false}, - {name = 'corfmd', x = 4528, y = 95, z = 6768, rot = 32767 , team = 1, neutral = false}, - {name = 'corfmd', x = 4160, y = 9, z = 5408, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4880, y = 66, z = 6496, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 5712, y = 7, z = 5984, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4464, y = 7, z = 5040, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 5392, y = 7, z = 4704, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4048, y = 7, z = 4400, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 4336, y = 8, z = 4096, rot = 32767 , team = 1, neutral = false}, - {name = 'corgate', x = 4368, y = 7, z = 4384, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 3616, y = 7, z = 4240, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 3824, y = 7, z = 4000, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4032, y = 8, z = 3776, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3528, y = 7, z = 4232, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3736, y = 7, z = 3992, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3944, y = 7, z = 3752, rot = 32767 , team = 1, neutral = false}, - {name = 'corflak', x = 4080, y = 7, z = 3856, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4384, y = 370, z = 3456, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4368, y = 367, z = 3296, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 4544, y = 381, z = 3568, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 2896, y = 370, z = 2400, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 2768, y = 370, z = 2448, rot = 32767 , team = 1, neutral = false}, - {name = 'cordoom', x = 2672, y = 372, z = 2384, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3496, y = 7, z = 2408, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3608, y = 7, z = 2440, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3800, y = 7, z = 2536, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 3880, y = 7, z = 2600, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 4040, y = 7, z = 2680, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 4120, y = 7, z = 2744, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 4200, y = 8, z = 2840, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 2024, y = 374, z = 184, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 2456, y = 242, z = 1320, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 2024, y = 137, z = 808, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 2056, y = 130, z = 1048, rot = 32767 , team = 1, neutral = false}, - {name = 'corvipe', x = 1992, y = 148, z = 616, rot = 32767 , team = 1, neutral = false}, - {name = 'corshroud', x = 448, y = 2, z = 3248, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwadves', x = 40, y = -143, z = 3576, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwadvms', x = 224, y = -141, z = 3584, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwadves', x = 392, y = -139, z = 3592, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwadvms', x = 576, y = -138, z = 3600, rot = 32767 , team = 1, neutral = false}, - {name = 'coratl', x = 152, y = -2, z = 3720, rot = 32767 , team = 1, neutral = false}, - {name = 'coratl', x = 472, y = -2, z = 3736, rot = 32767 , team = 1, neutral = false}, - {name = 'coratl', x = 648, y = -2, z = 3736, rot = 32767 , team = 1, neutral = false}, - {name = 'corason', x = 312, y = -123, z = 3496, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwfus', x = 232, y = -143, z = 3800, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwfus', x = 488, y = -142, z = 3800, rot = 32767 , team = 1, neutral = false}, - {name = 'coruwfus', x = 712, y = -135, z = 3816, rot = 32767 , team = 1, neutral = false}, - {name = 'armmoho', x = 464, y = 6, z = 6512, rot = 0 , team = 0, neutral = false}, - {name = 'armmoho', x = 336, y = 6, z = 6913, rot = 0 , team = 0, neutral = false}, - {name = 'armmoho', x = 861, y = 6, z = 6867, rot = 0 , team = 0, neutral = false}, + { name = "armcom", x = 552, y = 8, z = 6767, rot = 0, team = 0, neutral = false }, + { name = "cormex", x = 3680, y = 6, z = 720, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3344, y = 6, z = 528, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3440, y = 6, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 3024, y = 6, z = 1808, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4320, y = 6, z = 1632, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4240, y = 6, z = 2736, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5024, y = 6, z = 2528, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5392, y = 6, z = 2064, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5664, y = 6, z = 1776, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5872, y = 6, z = 2144, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5152, y = 6, z = 832, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 2656, y = 7, z = 224, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 288, y = 6, z = 272, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 160, y = 6, z = 1024, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 592, y = 6, z = 816, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5984, y = 6, z = 6144, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5552, y = 6, z = 6368, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5584, y = 6, z = 5824, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 2016, y = 6, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1856, y = 6, z = 2096, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1440, y = 77, z = 400, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 1376, y = 76, z = 96, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4704, y = 77, z = 6784, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4768, y = 76, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4288, y = 6, z = 5072, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 4128, y = 6, z = 4864, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 2080, y = 150, z = 624, rot = 32767, team = 1, neutral = false }, + { name = "corllt", x = 2128, y = 139, z = 1040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1728, y = 120, z = 352, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1728, y = 119, z = 384, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 127, z = 416, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 125, z = 448, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 128, z = 480, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 126, z = 512, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 120, z = 544, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1776, y = 121, z = 576, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1856, y = 104, z = 1264, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1872, y = 107, z = 1232, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1872, y = 105, z = 1200, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1888, y = 105, z = 1168, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1888, y = 102, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1904, y = 103, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1904, y = 101, z = 1072, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1920, y = 104, z = 1040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1920, y = 104, z = 1008, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1696, y = 100, z = 720, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1712, y = 100, z = 752, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1744, y = 101, z = 784, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1760, y = 100, z = 816, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1792, y = 100, z = 848, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1808, y = 99, z = 880, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1840, y = 99, z = 912, rot = 32767, team = 1, neutral = false }, + { name = "corhllt", x = 336, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "corhllt", x = 5712, y = 7, z = 6128, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3504, y = 7, z = 2720, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3248, y = 16, z = 2576, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4080, y = 12, z = 3072, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 7, z = 2960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3376, y = 8, z = 2656, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 8, z = 3008, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3536, y = 7, z = 2752, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3280, y = 9, z = 2592, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4112, y = 22, z = 3088, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 7, z = 2976, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3408, y = 7, z = 2672, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 7, z = 3024, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3568, y = 7, z = 2768, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 9, z = 2608, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 39, z = 3104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3952, y = 7, z = 2992, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3440, y = 7, z = 2688, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 3040, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3344, y = 8, z = 2640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3472, y = 7, z = 2704, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3824, y = 7, z = 2912, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3856, y = 7, z = 2928, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3184, y = 56, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3216, y = 35, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 72, z = 3120, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 105, z = 3152, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3152, y = 83, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3120, y = 102, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 7, z = 2592, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 8, z = 2624, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 8, z = 2624, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2624, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2592, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4144, y = 7, z = 2560, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4176, y = 7, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4208, y = 7, z = 2560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2304, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2336, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 2336, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 8, z = 2336, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 7, z = 2304, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3584, y = 7, z = 2272, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 8, z = 2272, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 7, z = 2272, rot = 32767, team = 1, neutral = false }, + { name = "corlab", x = 4656, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "corlab", x = 3680, y = 7, z = 1520, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 96, y = 7, z = 624, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5520, y = 7, z = 6128, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 180, z = 6064, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3760, y = 165, z = 6096, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3776, y = 160, z = 6128, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3792, y = 149, z = 6160, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3808, y = 142, z = 6192, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3872, y = 139, z = 6320, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 138, z = 6352, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3888, y = 136, z = 6384, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3904, y = 138, z = 6416, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3904, y = 134, z = 6448, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 138, z = 6480, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3920, y = 138, z = 6512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3856, y = 134, z = 6640, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3824, y = 133, z = 6672, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3808, y = 138, z = 6704, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3792, y = 143, z = 6736, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3776, y = 167, z = 6768, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4112, y = 138, z = 6000, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4208, y = 142, z = 6544, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 4600, y = 66, z = 6136, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 2152, y = 142, z = 840, rot = 0, team = 1, neutral = false }, + { name = "corfhp", x = 4736, y = -4, z = 1208, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 6104, y = 8, z = 40, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5992, y = 7, z = 40, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5992, y = 7, z = 152, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 6104, y = 7, z = 152, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 3976, y = 7, z = 2312, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 3432, y = 8, z = 2104, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 4488, y = 8, z = 2712, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1488, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1520, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1552, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1552, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1520, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1488, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3616, y = 7, z = 1456, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3648, y = 8, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3680, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3712, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3744, y = 7, z = 1456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2080, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2176, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4624, y = 7, z = 2176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4624, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 7, z = 2048, rot = 0, team = 1, neutral = false }, + { name = "coraap", x = 5392, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5304, y = 7, z = 552, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5304, y = 8, z = 600, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5480, y = 7, z = 600, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 5480, y = 7, z = 552, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5440, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5408, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5376, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5344, y = 8, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5344, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5376, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5408, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5440, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5280, y = 7, z = 640, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 608, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5264, y = 7, z = 544, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5280, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5504, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 544, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 576, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5520, y = 7, z = 608, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5504, y = 7, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5312, y = 8, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5472, y = 7, z = 640, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5312, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5472, y = 7, z = 512, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5680, y = 6, z = 656, rot = 0, team = 1, neutral = false }, + { name = "cormex", x = 5280, y = 6, z = 304, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5352, y = 7, z = 824, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5464, y = 8, z = 824, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5464, y = 7, z = 936, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 5352, y = 7, z = 936, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3816, y = 7, z = 1032, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3928, y = 7, z = 1032, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3928, y = 7, z = 1144, rot = 0, team = 1, neutral = false }, + { name = "corsolar", x = 3816, y = 7, z = 1144, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5536, y = 7, z = 288, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 3456, y = 384, z = 4864, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 1472, y = 384, z = 3664, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 4688, y = 385, z = 3488, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 4016, y = 384, z = 7104, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 2704, y = 384, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "corrad", x = 2112, y = 384, z = 80, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 384, z = 80, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 383, z = 112, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2112, y = 384, z = 112, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 383, z = 112, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 383, z = 80, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2080, y = 382, z = 48, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2112, y = 384, z = 48, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2144, y = 386, z = 48, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 384, z = 2304, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 384, z = 2336, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2704, y = 380, z = 2336, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 378, z = 2336, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 383, z = 2304, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2672, y = 383, z = 2272, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2704, y = 384, z = 2272, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2736, y = 383, z = 2272, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 385, z = 3488, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 386, z = 3520, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 385, z = 3520, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3520, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3488, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4656, y = 385, z = 3456, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4688, y = 385, z = 3456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4720, y = 385, z = 3456, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7104, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7136, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 385, z = 7136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 385, z = 7136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 384, z = 7104, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 384, z = 7072, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 384, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 384, z = 7072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 382, z = 4864, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 382, z = 4896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3456, y = 384, z = 4896, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4896, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4864, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3424, y = 383, z = 4832, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3456, y = 383, z = 4832, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3488, y = 380, z = 4832, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 385, z = 3664, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 384, z = 3696, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 1472, y = 384, z = 3696, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3696, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3664, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 1440, y = 384, z = 3632, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 1472, y = 384, z = 3632, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 1504, y = 385, z = 3632, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 2096, y = 7, z = 2912, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4016, y = 8, z = 4288, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4288, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4320, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 8, z = 4320, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4320, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4288, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3984, y = 7, z = 4256, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4016, y = 8, z = 4256, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4048, y = 8, z = 4256, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2912, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2944, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 2096, y = 7, z = 2944, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2944, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2912, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2064, y = 7, z = 2880, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 2096, y = 7, z = 2880, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 2128, y = 7, z = 2880, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 376, y = 7, z = 680, rot = 0, team = 1, neutral = false }, + { name = "corrl", x = 5672, y = 7, z = 6088, rot = 0, team = 1, neutral = false }, + { name = "corvp", x = 3192, y = 7, z = 824, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3264, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3296, y = 7, z = 896, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3264, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3296, y = 7, z = 752, rot = -16384, team = 1, neutral = false }, + { name = "corhllt", x = 3344, y = 7, z = 832, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 4752, y = 7, z = 2112, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 3680, y = 7, z = 1424, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3376, y = 8, z = 2384, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3664, y = 7, z = 2576, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 3952, y = 7, z = 2768, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4240, y = 10, z = 2944, rot = 0, team = 1, neutral = false }, + { name = "corhlt", x = 3616, y = 8, z = 2304, rot = 0, team = 1, neutral = false }, + { name = "corhlt", x = 4176, y = 7, z = 2592, rot = 0, team = 1, neutral = false }, + { name = "corhllt", x = 3920, y = 7, z = 2480, rot = 0, team = 1, neutral = false }, + { name = "cormadsam", x = 5656, y = 7, z = 408, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 5600, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 5952, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "corllt", x = 4736, y = 7, z = 528, rot = -16384, team = 1, neutral = false }, + { name = "corllt", x = 4736, y = 7, z = 176, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 176, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 208, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 208, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 208, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 176, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 144, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 144, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 528, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 560, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 560, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 560, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 528, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4704, y = 7, z = 496, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4736, y = 7, z = 496, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4768, y = 7, z = 496, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5600, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5568, y = 7, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5600, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5632, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1104, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1136, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 5952, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1136, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1104, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5920, y = 7, z = 1072, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 5952, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 5984, y = 7, z = 1072, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1152, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1184, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1216, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4656, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1216, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1184, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4816, y = -3, z = 1152, rot = -16384, team = 1, neutral = false }, + { name = "cornanotcplat", x = 4616, y = 0, z = 1208, rot = -16384, team = 1, neutral = false }, + { name = "cornanotcplat", x = 4856, y = 0, z = 1208, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4624, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4592, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4848, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corfdrag", x = 4880, y = -3, z = 1248, rot = -16384, team = 1, neutral = false }, + { name = "corrad", x = 4224, y = 7, z = 2000, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 2000, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 2032, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 4224, y = 7, z = 2032, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 2032, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 2000, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4192, y = 7, z = 1968, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 4224, y = 7, z = 1968, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 4256, y = 7, z = 1968, rot = -16384, team = 1, neutral = false }, + { name = "corfrt", x = 5072, y = -4, z = 1376, rot = -16384, team = 1, neutral = false }, + { name = "corfrt", x = 4480, y = -4, z = 992, rot = -16384, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1880, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6008, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5944, y = 7, z = 1816, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 8, z = 1944, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 8, z = 1560, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1688, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 5880, y = 7, z = 1432, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1752, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1496, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 6072, y = 7, z = 1624, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 8, z = 72, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 136, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 200, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3688, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3752, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3816, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3880, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 3944, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4008, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4072, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4136, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4200, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4264, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4328, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corwin", x = 4392, y = 7, z = 264, rot = 32767, team = 1, neutral = false }, + { name = "corestor", x = 6000, y = 7, z = 2032, rot = 32767, team = 1, neutral = false }, + { name = "corestor", x = 3616, y = 7, z = 160, rot = 32767, team = 1, neutral = false }, + { name = "coradvsol", x = 5776, y = 7, z = 528, rot = 32767, team = 1, neutral = false }, + { name = "corexp", x = 5808, y = 6, z = 256, rot = 0, team = 1, neutral = false }, + { name = "cormstor", x = 5781, y = 7, z = 6285, rot = 0, team = 1, neutral = false }, + { name = "cormstor", x = 382, y = 7, z = 939, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 896, y = 7, z = 2112, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 952, y = 7, z = 2104, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 952, y = 7, z = 2152, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 904, y = 7, z = 2168, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 856, y = 7, z = 2168, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 840, y = 7, z = 2120, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 840, y = 7, z = 2072, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 888, y = 7, z = 2056, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 936, y = 7, z = 2056, rot = 0, team = 1, neutral = false }, + { name = "coradvsol", x = 5328, y = 7, z = 4944, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 5384, y = 7, z = 4936, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 5384, y = 8, z = 4984, rot = -16384, team = 1, neutral = false }, + { name = "cormakr", x = 5336, y = 7, z = 5000, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 5288, y = 7, z = 5000, rot = 32767, team = 1, neutral = false }, + { name = "cormakr", x = 5272, y = 7, z = 4952, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 5272, y = 7, z = 4904, rot = 16384, team = 1, neutral = false }, + { name = "cormakr", x = 5320, y = 7, z = 4888, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 5368, y = 8, z = 4888, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4648, y = 7, z = 2216, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4696, y = 7, z = 2216, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4648, y = 7, z = 2008, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 4696, y = 7, z = 2008, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3784, y = 7, z = 1480, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3784, y = 7, z = 1528, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3576, y = 7, z = 1528, rot = 0, team = 1, neutral = false }, + { name = "cormakr", x = 3576, y = 7, z = 1480, rot = 0, team = 1, neutral = false }, + { name = "corestor", x = 3184, y = 7, z = 912, rot = 0, team = 1, neutral = false }, + { name = "corestor", x = 3184, y = 7, z = 736, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 928, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 960, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3200, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3168, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 960, rot = 32767, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 928, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 720, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 720, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3136, y = 7, z = 688, rot = 16384, team = 1, neutral = false }, + { name = "cordrag", x = 3168, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3200, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cordrag", x = 3232, y = 7, z = 688, rot = 0, team = 1, neutral = false }, + { name = "cornanotc", x = 3272, y = 7, z = 856, rot = -16384, team = 1, neutral = false }, + { name = "cornanotc", x = 3272, y = 7, z = 792, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 7, z = 784, rot = -16384, team = 1, neutral = false }, + { name = "cordrag", x = 3312, y = 7, z = 864, rot = -16384, team = 1, neutral = false }, + { name = "armckfus", x = 584, y = 7, z = 7008, rot = 32767, team = 0, neutral = false }, + { name = "armjamt", x = 656, y = 7, z = 6624, rot = 32767, team = 0, neutral = false }, + { name = "cordoom", x = 1376, y = 370, z = 3888, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 1648, y = 376, z = 3904, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 1552, y = 385, z = 3632, rot = 32767, team = 1, neutral = false }, + { name = "corflak", x = 1504, y = 383, z = 3824, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 1392, y = 383, z = 3664, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 3248, y = 371, z = 4752, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 3536, y = 372, z = 5040, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 3520, y = 373, z = 4816, rot = 32767, team = 1, neutral = false }, + { name = "corflak", x = 3392, y = 381, z = 4784, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 3536, y = 378, z = 4880, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3672, y = 245, z = 5848, rot = 32767, team = 1, neutral = false }, + { name = "corflak", x = 3648, y = 239, z = 5728, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 3840, y = 144, z = 5744, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 3856, y = 142, z = 5808, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3848, y = 151, z = 6184, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3928, y = 142, z = 6312, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4032, y = 141, z = 6096, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4128, y = 127, z = 6272, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4224, y = 109, z = 6224, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 4240, y = 102, z = 6096, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3960, y = 141, z = 6472, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4144, y = 143, z = 6480, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4112, y = 373, z = 6976, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4112, y = 384, z = 7104, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 4040, y = 374, z = 6968, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4176, y = 373, z = 7056, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 4176, y = 378, z = 7120, rot = 32767, team = 1, neutral = false }, + { name = "corfmd", x = 4528, y = 95, z = 6768, rot = 32767, team = 1, neutral = false }, + { name = "corfmd", x = 4160, y = 9, z = 5408, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4880, y = 66, z = 6496, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 5712, y = 7, z = 5984, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4464, y = 7, z = 5040, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 5392, y = 7, z = 4704, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4048, y = 7, z = 4400, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 4336, y = 8, z = 4096, rot = 32767, team = 1, neutral = false }, + { name = "corgate", x = 4368, y = 7, z = 4384, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 3616, y = 7, z = 4240, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 3824, y = 7, z = 4000, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4032, y = 8, z = 3776, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3528, y = 7, z = 4232, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3736, y = 7, z = 3992, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3944, y = 7, z = 3752, rot = 32767, team = 1, neutral = false }, + { name = "corflak", x = 4080, y = 7, z = 3856, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4384, y = 370, z = 3456, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4368, y = 367, z = 3296, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 4544, y = 381, z = 3568, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 2896, y = 370, z = 2400, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 2768, y = 370, z = 2448, rot = 32767, team = 1, neutral = false }, + { name = "cordoom", x = 2672, y = 372, z = 2384, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3496, y = 7, z = 2408, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3608, y = 7, z = 2440, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3800, y = 7, z = 2536, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 3880, y = 7, z = 2600, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 4040, y = 7, z = 2680, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 4120, y = 7, z = 2744, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 4200, y = 8, z = 2840, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 2024, y = 374, z = 184, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 2456, y = 242, z = 1320, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 2024, y = 137, z = 808, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 2056, y = 130, z = 1048, rot = 32767, team = 1, neutral = false }, + { name = "corvipe", x = 1992, y = 148, z = 616, rot = 32767, team = 1, neutral = false }, + { name = "corshroud", x = 448, y = 2, z = 3248, rot = 32767, team = 1, neutral = false }, + { name = "coruwadves", x = 40, y = -143, z = 3576, rot = 32767, team = 1, neutral = false }, + { name = "coruwadvms", x = 224, y = -141, z = 3584, rot = 32767, team = 1, neutral = false }, + { name = "coruwadves", x = 392, y = -139, z = 3592, rot = 32767, team = 1, neutral = false }, + { name = "coruwadvms", x = 576, y = -138, z = 3600, rot = 32767, team = 1, neutral = false }, + { name = "coratl", x = 152, y = -2, z = 3720, rot = 32767, team = 1, neutral = false }, + { name = "coratl", x = 472, y = -2, z = 3736, rot = 32767, team = 1, neutral = false }, + { name = "coratl", x = 648, y = -2, z = 3736, rot = 32767, team = 1, neutral = false }, + { name = "corason", x = 312, y = -123, z = 3496, rot = 32767, team = 1, neutral = false }, + { name = "coruwfus", x = 232, y = -143, z = 3800, rot = 32767, team = 1, neutral = false }, + { name = "coruwfus", x = 488, y = -142, z = 3800, rot = 32767, team = 1, neutral = false }, + { name = "coruwfus", x = 712, y = -135, z = 3816, rot = 32767, team = 1, neutral = false }, + { name = "armmoho", x = 464, y = 6, z = 6512, rot = 0, team = 0, neutral = false }, + { name = "armmoho", x = 336, y = 6, z = 6913, rot = 0, team = 0, neutral = false }, + { name = "armmoho", x = 861, y = 6, z = 6867, rot = 0, team = 0, neutral = false }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -754,7 +754,6 @@ Commander...intel report that it is cortex ba... ,it is...functio...,seek and de nohelperais = 0; } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario022.lua b/singleplayer/scenarios/scenario022.lua index ecdebbdf471..dc81300291b 100644 --- a/singleplayer/scenarios/scenario022.lua +++ b/singleplayer/scenarios/scenario022.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 22, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "Begin06", -- no spaces, lowercase, this will be used to save the score and can be used gadget side - version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) - title = "Supremacy", -- can be anything - author = "wilkubyk", -- your name here + index = 22, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "Begin06", -- no spaces, lowercase, this will be used to save the score and can be used gadget side + version = "1", -- increment this to reset the score when changing a mission, as scores are keyed by (scenarioid,version,difficulty) + title = "Supremacy", -- can be anything + author = "wilkubyk", -- your name here isnew = true, - imagepath = "scenario022.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "River Assault", -- This text will be drawn over image - summary = [[After a ferocious battle, Cortex Commander decided to join Armada forces. Unfortunately, other Cortex commanders discovered the intent of the treacherous plan and sent a mighty force to prevent it.]], - briefing = [[You will start with some Lazarus (Resurrection and Repair Bots), that can resurrect units from their wrecks. Your Only hope is to hide your position and build mighty army to crush all opposing forces. + imagepath = "scenario022.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "River Assault", -- This text will be drawn over image + summary = [[After a ferocious battle, Cortex Commander decided to join Armada forces. Unfortunately, other Cortex commanders discovered the intent of the treacherous plan and sent a mighty force to prevent it.]], + briefing = [[You will start with some Lazarus (Resurrection and Repair Bots), that can resurrect units from their wrecks. Your Only hope is to hide your position and build mighty army to crush all opposing forces. !!! DO NOT UNDERESTIMATE YOUR ENEMY !!! @@ -38,28 +38,28 @@ Scoring: Brutal: Your Resources = -20%, Enemy Resources= +50% ]], - mapfilename = "Lake Carne v2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed - playerstartx = "16%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "26%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 5400, -- par time in seconds (time a mission is expected to take on average) - parresources = 1500000, -- par resource amount (amount of metal one is expected to spend on mission) - difficulty = 10, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Normal", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - -- handicap values range [-100 - +100], with 0 being regular resources - -- Currently difficulty modifier only affects the resource bonuses - {name = "Beginner", playerhandicap = 50, enemyhandicap=-20}, - {name = "Novice" , playerhandicap = 25, enemyhandicap=-10}, - {name = "Normal" , playerhandicap = 0, enemyhandicap=0}, - {name = "Hard" , playerhandicap = -10, enemyhandicap=25}, - {name = "Brutal" , playerhandicap = -20, enemyhandicap=50}, - }, - allowedsides = {"Armada"}, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} - victorycondition= "Kill all enemy builders", -- This is plaintext, but should be reflected in startscript - losscondition = "All builders or AI Command Tower", -- This is plaintext, but should be reflected in startscript - unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it - -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! - corbuzz = 0, + mapfilename = "Lake Carne v2", -- the name of the map to be displayed here, and which to play on, no .smf ending needed + playerstartx = "16%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "26%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 5400, -- par time in seconds (time a mission is expected to take on average) + parresources = 1500000, -- par resource amount (amount of metal one is expected to spend on mission) + difficulty = 10, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Normal", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + -- handicap values range [-100 - +100], with 0 being regular resources + -- Currently difficulty modifier only affects the resource bonuses + { name = "Beginner", playerhandicap = 50, enemyhandicap = -20 }, + { name = "Novice", playerhandicap = 25, enemyhandicap = -10 }, + { name = "Normal", playerhandicap = 0, enemyhandicap = 0 }, + { name = "Hard", playerhandicap = -10, enemyhandicap = 25 }, + { name = "Brutal", playerhandicap = -20, enemyhandicap = 50 }, + }, + allowedsides = { "Armada" }, --these are the permitted factions for this mission, choose from {"Armada", "Cortex", "Random"} + victorycondition = "Kill all enemy builders", -- This is plaintext, but should be reflected in startscript + losscondition = "All builders or AI Command Tower", -- This is plaintext, but should be reflected in startscript + unitlimits = { -- table of unitdefname : maxnumberofthese units, 0 means disable it + -- dont use the one in startscript, put the disabled stuff here so we can show it in scenario window! + corbuzz = 0, corint = 0, corafus = 1, cormmkr = 6, @@ -77,14 +77,14 @@ Scoring: armmercury = 0, armemp = 1, armlun = 0, - } , + }, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - myoption = "dostuff", -- blank - scenarioid = "Begin06", -- this MUST be present and identical to the one defined at start + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + myoption = "dostuff", -- blank + scenarioid = "Begin06", -- this MUST be present and identical to the one defined at start disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides - unitloadout = { + unitloadout = { -- You can specify units that you wish to spawn here, they only show up once game starts, -- You can create these lists easily using the feature/unit dumper by using dbg_feature_dumper.lua widget pinned to the #challenges channel on discord -- Set up a skirmish like your scenario, so the team ID's will be correct @@ -96,385 +96,385 @@ Scoring: --{name = 'corcom', x = 5444, y = 34, z = 4403, rot = 0 , team = 1}, --{name = 'armcom', x = 700, y = 34, z = 716, rot = 0 , team = 0}, - {name = 'armsolar', x = 1112, y = 99, z = 1224, rot = -16384 , team = 0}, - {name = 'armsolar', x = 1272, y = 93, z = 1224, rot = -16384 , team = 0}, - {name = 'armsolar', x = 1350, y = 34, z = 218, rot = -16384 , team = 0}, - {name = 'armsolar', x = 1272, y = 34, z = 206, rot = -16384 , team = 0}, - {name = 'armrectr', x = 1176, y = 100, z = 1414, rot = 12977 , team = 0}, - {name = 'armrectr', x = 716, y = 34, z = 1290, rot = 12977 , team = 0}, - {name = 'armrectr', x = 1265, y = 34, z = 898, rot = 12977 , team = 0}, - {name = 'armmakr', x = 1192, y = 95, z = 1224, rot = -16384 , team = 0}, - {name = "armdrag", x = 1856, y = 34, z = 240, rot = -16384 , team = 0}, - {name = "armdrag", x = 1296, y = 34, z = 16, rot = -16384 , team = 0}, - {name = "armdrag", x = 1312, y = 34, z = 64, rot = -16384 , team = 0}, - {name = "armdrag", x = 1328, y = 34, z = 112, rot = -16384 , team = 0}, - {name = "armdrag", x = 1344, y = 34, z = 160, rot = -16384 , team = 0}, - {name = "armdrag", x = 1392, y = 34, z = 176, rot = -16384 , team = 0}, - {name = "armdrag", x = 1408, y = 34, z = 224, rot = -16384 , team = 0}, - {name = "armdrag", x = 1840, y = 34, z = 16, rot = -16384 , team = 0}, - {name = "armdrag", x = 1856, y = 33, z = 64, rot = -16384 , team = 0}, - {name = "armdrag", x = 1840, y = 55, z = 128, rot = -16384 , team = 0}, - {name = "armdrag", x = 1856, y = 33, z = 176, rot = -16384 , team = 0}, - {name = 'coradvsol', x = 5120, y = 102, z = 4096, rot = -16384 , team = 1}, - {name = 'coradvsol', x = 5016, y = 100, z = 4097, rot = -16384 , team = 1}, - {name = 'cormakr', x = 5320, y = 35, z = 4152, rot = -16384 , team = 1}, - {name = 'corjamt', x = 5136, y = 96, z = 4224, rot = -16384 , team = 1}, - {name = 'cornecro', x = 5281, y = 34, z = 4394, rot = -7263 , team = 1}, - {name = 'cornecro', x = 5915, y = 34, z = 4963, rot = -7263 , team = 1}, - {name = 'cornecro', x = 5707, y = 34, z = 4966, rot = -7263 , team = 1}, - {name = 'cornecro', x = 5427, y = 34, z = 4976, rot = -7263 , team = 1}, - {name = 'cornecro', x = 5968, y = 34, z = 4752, rot = -7263 , team = 1}, - {name = 'corfrad', x = 1160, y = -4, z = 4024, rot = 32767 , team = 3}, - {name = 'corfrad', x = 2696, y = -4, z = 3064, rot = 32767 , team = 3}, - {name = 'corfrad', x = 3416, y = -4, z = 2024, rot = 32767 , team = 2}, - {name = 'corfrad', x = 4776, y = -4, z = 1080, rot = 32767 , team = 2}, - {name = 'cordronecarry', x = 5164, y = -8, z = 615, rot = 10868 , team = 2}, - {name = 'cordronecarry', x = 846, y = -8, z = 4430, rot = -27437 , team = 3}, - {name = 'correcl', x = 176, y = -80, z = 4786, rot = 9073 , team = 3}, - {name = 'corblackhy', x = 650, y = 0, z = 4602, rot = -23614 , team = 3}, - {name = 'correcl', x = 5397, y = -80, z = 331, rot = -18068 , team = 2}, - {name = 'corblackhy', x = 5369, y = 0, z = 489, rot = -26161 , team = 2}, - {name = 'coruwadvms', x = 5216, y = -104, z = 160, rot = -16384 , team = 2}, - {name = 'coruwadves', x = 5224, y = -104, z = 232, rot = -16384 , team = 2}, - {name = 'coruwfus', x = 5144, y = -104, z = 200, rot = -16384 , team = 2}, - {name = 'coruwfus', x = 5304, y = -104, z = 184, rot = -16384 , team = 2}, - {name = 'coruwfus', x = 5224, y = -104, z = 88, rot = -16384 , team = 2}, - {name = 'coruwfus', x = 5224, y = -104, z = 312, rot = -16384 , team = 2}, - {name = 'corenaa', x = 5088, y = 0, z = 720, rot = -16384 , team = 2}, - {name = 'corason', x = 5256, y = -104, z = 440, rot = -16384 , team = 2}, - {name = 'corenaa', x = 5488, y = 0, z = 720, rot = -16384 , team = 2}, - {name = 'corenaa', x = 4944, y = 0, z = 400, rot = -16384 , team = 2}, - {name = 'corenaa', x = 5456, y = 0, z = 272, rot = -16384 , team = 2}, - {name = 'coratl', x = 5320, y = -2, z = 616, rot = -16384 , team = 2}, - {name = 'coratl', x = 5192, y = -2, z = 504, rot = -16384 , team = 2}, - {name = 'coratl', x = 5560, y = -2, z = 744, rot = -16384 , team = 2}, - {name = 'coratl', x = 5032, y = -2, z = 792, rot = -16384 , team = 2}, - {name = 'coratl', x = 4872, y = -2, z = 408, rot = -16384 , team = 2}, - {name = 'corfdoom', x = 4800, y = -3, z = 432, rot = -16384 , team = 2}, - {name = 'corfdoom', x = 4976, y = -3, z = 880, rot = -16384 , team = 2}, - {name = 'corfdoom', x = 5552, y = -3, z = 848, rot = -16384 , team = 2}, - {name = 'corsjam', x = 5314, y = 0, z = 251, rot = 20439 , team = 2}, - {name = 'corsjam', x = 5580, y = 0, z = 303, rot = 1649 , team = 2}, - {name = 'coratl', x = 5256, y = -2, z = 856, rot = -16384 , team = 2}, - {name = 'coratl', x = 4904, y = -2, z = 664, rot = -16384 , team = 2}, - {name = 'corfatf', x = 5344, y = -3, z = 32, rot = -16384 , team = 2}, - {name = 'corfatf', x = 5408, y = -3, z = 32, rot = -16384 , team = 2}, - {name = 'corfatf', x = 5408, y = -3, z = 160, rot = -16384 , team = 2}, - {name = 'coratl', x = 5752, y = -2, z = 632, rot = -16384 , team = 2}, - {name = 'coratl', x = 4856, y = -2, z = 296, rot = -16384 , team = 2}, - {name = 'correcl', x = 593, y = -80, z = 4691, rot = -8019 , team = 3}, - {name = 'corfdrag', x = 4800, y = -3, z = 16, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4800, y = -3, z = 48, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4784, y = -3, z = 80, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4784, y = -3, z = 112, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4768, y = -3, z = 144, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4768, y = -3, z = 176, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4752, y = -3, z = 208, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4752, y = -3, z = 240, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4752, y = -3, z = 272, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4736, y = -3, z = 304, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4736, y = -3, z = 336, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4720, y = -3, z = 368, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4720, y = -3, z = 400, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4704, y = -3, z = 432, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4704, y = -3, z = 464, rot = -16384 , team = 2}, - {name = 'corarch', x = 5086, y = 0, z = 93, rot = 0 , team = 2}, - {name = 'corarch', x = 5684, y = 0, z = 555, rot = 0 , team = 2}, - {name = 'corarch', x = 5052, y = 0, z = 395, rot = 0 , team = 2}, - {name = 'corarch', x = 5398, y = 0, z = 665, rot = -15506 , team = 2}, - {name = 'corfdrag', x = 4720, y = -3, z = 496, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4736, y = -3, z = 528, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4752, y = -3, z = 560, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4768, y = -3, z = 592, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4784, y = -3, z = 624, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4816, y = -3, z = 640, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4848, y = -3, z = 656, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4848, y = -3, z = 688, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4864, y = -3, z = 720, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4880, y = -3, z = 752, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 784, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 816, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 848, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 880, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4896, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4928, y = -3, z = 960, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4960, y = -3, z = 960, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 4992, y = -3, z = 960, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5024, y = -3, z = 960, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5056, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5088, y = -3, z = 928, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5120, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5152, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5184, y = -3, z = 896, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5216, y = -3, z = 896, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5248, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5280, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5312, y = -3, z = 928, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5344, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5376, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5408, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5440, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5472, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5504, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5536, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5568, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5600, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5632, y = -3, z = 944, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5648, y = -3, z = 912, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5680, y = -3, z = 896, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5712, y = -3, z = 880, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5728, y = -3, z = 848, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5744, y = -3, z = 816, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5760, y = -3, z = 784, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5776, y = -3, z = 752, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5792, y = -3, z = 720, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5808, y = -3, z = 688, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5840, y = -3, z = 688, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5872, y = -3, z = 688, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5904, y = -3, z = 672, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5936, y = -3, z = 672, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 5968, y = -3, z = 672, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 6000, y = -3, z = 672, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 6128, y = -3, z = 656, rot = -16384 , team = 2}, - {name = 'corfdrag', x = 6096, y = -3, z = 656, rot = 0 , team = 2}, - {name = 'corfdrag', x = 6064, y = -3, z = 656, rot = 0 , team = 2}, - {name = 'corfdrag', x = 6032, y = -3, z = 656, rot = 0 , team = 2}, - {name = 'correcl', x = 5520, y = -45, z = 210, rot = -27465 , team = 2}, - {name = 'coruwadves', x = 344, y = -104, z = 4792, rot = 0 , team = 3}, - {name = 'coruwadvms', x = 352, y = -104, z = 4720, rot = 0 , team = 3}, - {name = 'coruwfus', x = 344, y = -104, z = 4872, rot = 0 , team = 3}, - {name = 'coruwfus', x = 424, y = -104, z = 4760, rot = 0 , team = 3}, - {name = 'coruwfus', x = 264, y = -104, z = 4760, rot = 0 , team = 3}, - {name = 'coruwfus', x = 344, y = -104, z = 4648, rot = 0 , team = 3}, - {name = 'coratl', x = 792, y = -2, z = 4552, rot = 32767 , team = 3}, - {name = 'coratl', x = 680, y = -2, z = 4440, rot = 32767 , team = 3}, - {name = 'corason', x = 568, y = -104, z = 4472, rot = 32767 , team = 3}, - {name = 'corfatf', x = 48, y = -3, z = 4768, rot = 32767 , team = 3}, - {name = 'corfatf', x = 48, y = -3, z = 4832, rot = 32767 , team = 3}, - {name = 'corfatf', x = 48, y = -3, z = 4896, rot = 32767 , team = 3}, - {name = 'corenaa', x = 416, y = 0, z = 4688, rot = 32767 , team = 3}, - {name = 'coratl', x = 904, y = -2, z = 4952, rot = 32767 , team = 3}, - {name = 'coratl', x = 1064, y = -2, z = 4776, rot = 32767 , team = 3}, - {name = 'coratl', x = 1096, y = -2, z = 4408, rot = 32767 , team = 3}, - {name = 'coratl', x = 968, y = -2, z = 4280, rot = 32767 , team = 3}, - {name = 'coratl', x = 728, y = -2, z = 4184, rot = 32767 , team = 3}, - {name = 'coratl', x = 440, y = -2, z = 4184, rot = 32767 , team = 3}, - {name = 'coratl', x = 200, y = -2, z = 4216, rot = 32767 , team = 3}, - {name = 'corfdoom', x = 432, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdoom', x = 736, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdoom', x = 1040, y = -3, z = 4256, rot = 32767 , team = 3}, - {name = 'corfdoom', x = 1168, y = -3, z = 4416, rot = 32767 , team = 3}, - {name = 'corfdoom', x = 1136, y = -3, z = 4768, rot = 32767 , team = 3}, - {name = 'corenaa', x = 960, y = 0, z = 4800, rot = 32767 , team = 3}, - {name = 'corenaa', x = 1024, y = 0, z = 4464, rot = 32767 , team = 3}, - {name = 'corenaa', x = 720, y = 0, z = 4256, rot = 32767 , team = 3}, - {name = 'corenaa', x = 416, y = 0, z = 4272, rot = 32767 , team = 3}, - {name = 'corenaa', x = 272, y = 0, z = 4832, rot = 32767 , team = 3}, - {name = 'corarch', x = 497, y = 0, z = 4870, rot = 0 , team = 3}, - {name = 'corarch', x = 227, y = 0, z = 4636, rot = 0 , team = 3}, - {name = 'corarch', x = 433, y = 0, z = 4377, rot = 0 , team = 3}, - {name = 'corarch', x = 880, y = 0, z = 4681, rot = 0 , team = 3}, - {name = 'corsjam', x = 587, y = 0, z = 4850, rot = -2450 , team = 3}, - {name = 'corsjam', x = 375, y = 0, z = 4572, rot = 20759 , team = 3}, - {name = 'corfdrag', x = 16, y = -3, z = 4144, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 48, y = -3, z = 4144, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 80, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 112, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 144, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 176, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 208, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 240, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 272, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 304, y = -3, z = 4096, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 336, y = -3, z = 4096, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 336, y = -3, z = 4064, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 352, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 384, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 416, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 448, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 480, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 512, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 512, y = -3, z = 4064, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 544, y = -3, z = 4096, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 560, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 592, y = -3, z = 4128, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 608, y = -3, z = 4096, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 640, y = -3, z = 4080, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 672, y = -3, z = 4064, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 688, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 720, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 752, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 784, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 816, y = -3, z = 4032, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 832, y = -3, z = 4064, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 848, y = -3, z = 4096, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 880, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 912, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 944, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 976, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1008, y = -3, z = 4112, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1008, y = -3, z = 4144, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1008, y = -3, z = 4176, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1040, y = -3, z = 4176, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1072, y = -3, z = 4176, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1104, y = -3, z = 4192, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1120, y = -3, z = 4224, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1136, y = -3, z = 4256, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1152, y = -3, z = 4288, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4304, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4320, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4336, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4368, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4400, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4432, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4464, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4496, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4512, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1200, y = -3, z = 4544, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4576, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4608, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4640, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4672, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4704, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4720, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4752, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4784, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4816, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1248, y = -3, z = 4832, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1280, y = -3, z = 4864, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 4896, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1216, y = -3, z = 4848, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1184, y = -3, z = 4864, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1152, y = -3, z = 4880, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1120, y = -3, z = 4896, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1088, y = -3, z = 4912, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1056, y = -3, z = 4928, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1024, y = -3, z = 4944, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1008, y = -3, z = 4976, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 992, y = -3, z = 5008, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 960, y = -3, z = 5040, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 944, y = -3, z = 5072, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 944, y = -3, z = 5104, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 4928, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 4960, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 4992, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 5024, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 5056, rot = 32767 , team = 3}, - {name = 'corfdrag', x = 1296, y = -3, z = 5088, rot = 32767 , team = 3}, - {name = 'coratl', x = 1080, y = -2, z = 4984, rot = 32767 , team = 3}, - {name = "coruwmme", x = 4880, y = -105, z = 176, rot = 0, team = 4}, - {name = "corcarry", x = 5559, y = -8, z = 458, rot = 0, team = 4}, - {name = "corcarry", x = 4251, y = -8, z = 1666, rot = -16384, team = 4}, - {name = "correcl", x = 6077, y = -81, z = 228, rot = 0, team = 4}, - {name = "corsjam", x = 5470, y = 0, z = 348, rot = 0, team = 4}, - {name = 'coruwfus', x = 4939, y = -105, z = 115, rot = -16384 , team = 4}, - {name = 'coruwmmm', x = 4644, y = 0, z = 1202, rot = -16384 , team = 4}, - {name = "coruwmme", x = 1248, y = -105, z = 4928, rot = 0, team = 5}, - {name = "corsjam", x = 429, y = 0, z = 4593, rot = 0, team = 5}, - {name = "correcl", x = 240, y = -80, z = 5062, rot = 0, team = 5}, - {name = "corcarry", x = 539, y = -8, z = 4764, rot = -16384, team = 5}, - {name = "corcarry", x = 1875, y = -8, z = 3398, rot = -16384, team = 5}, - {name = 'coruwfus', x = 1143, y = -105, z = 5090, rot = -16384 , team = 5}, - {name = 'coruwmmm', x = 1467, y = 0, z = 3799, rot = -16384 , team = 5}, + { name = "armsolar", x = 1112, y = 99, z = 1224, rot = -16384, team = 0 }, + { name = "armsolar", x = 1272, y = 93, z = 1224, rot = -16384, team = 0 }, + { name = "armsolar", x = 1350, y = 34, z = 218, rot = -16384, team = 0 }, + { name = "armsolar", x = 1272, y = 34, z = 206, rot = -16384, team = 0 }, + { name = "armrectr", x = 1176, y = 100, z = 1414, rot = 12977, team = 0 }, + { name = "armrectr", x = 716, y = 34, z = 1290, rot = 12977, team = 0 }, + { name = "armrectr", x = 1265, y = 34, z = 898, rot = 12977, team = 0 }, + { name = "armmakr", x = 1192, y = 95, z = 1224, rot = -16384, team = 0 }, + { name = "armdrag", x = 1856, y = 34, z = 240, rot = -16384, team = 0 }, + { name = "armdrag", x = 1296, y = 34, z = 16, rot = -16384, team = 0 }, + { name = "armdrag", x = 1312, y = 34, z = 64, rot = -16384, team = 0 }, + { name = "armdrag", x = 1328, y = 34, z = 112, rot = -16384, team = 0 }, + { name = "armdrag", x = 1344, y = 34, z = 160, rot = -16384, team = 0 }, + { name = "armdrag", x = 1392, y = 34, z = 176, rot = -16384, team = 0 }, + { name = "armdrag", x = 1408, y = 34, z = 224, rot = -16384, team = 0 }, + { name = "armdrag", x = 1840, y = 34, z = 16, rot = -16384, team = 0 }, + { name = "armdrag", x = 1856, y = 33, z = 64, rot = -16384, team = 0 }, + { name = "armdrag", x = 1840, y = 55, z = 128, rot = -16384, team = 0 }, + { name = "armdrag", x = 1856, y = 33, z = 176, rot = -16384, team = 0 }, + { name = "coradvsol", x = 5120, y = 102, z = 4096, rot = -16384, team = 1 }, + { name = "coradvsol", x = 5016, y = 100, z = 4097, rot = -16384, team = 1 }, + { name = "cormakr", x = 5320, y = 35, z = 4152, rot = -16384, team = 1 }, + { name = "corjamt", x = 5136, y = 96, z = 4224, rot = -16384, team = 1 }, + { name = "cornecro", x = 5281, y = 34, z = 4394, rot = -7263, team = 1 }, + { name = "cornecro", x = 5915, y = 34, z = 4963, rot = -7263, team = 1 }, + { name = "cornecro", x = 5707, y = 34, z = 4966, rot = -7263, team = 1 }, + { name = "cornecro", x = 5427, y = 34, z = 4976, rot = -7263, team = 1 }, + { name = "cornecro", x = 5968, y = 34, z = 4752, rot = -7263, team = 1 }, + { name = "corfrad", x = 1160, y = -4, z = 4024, rot = 32767, team = 3 }, + { name = "corfrad", x = 2696, y = -4, z = 3064, rot = 32767, team = 3 }, + { name = "corfrad", x = 3416, y = -4, z = 2024, rot = 32767, team = 2 }, + { name = "corfrad", x = 4776, y = -4, z = 1080, rot = 32767, team = 2 }, + { name = "cordronecarry", x = 5164, y = -8, z = 615, rot = 10868, team = 2 }, + { name = "cordronecarry", x = 846, y = -8, z = 4430, rot = -27437, team = 3 }, + { name = "correcl", x = 176, y = -80, z = 4786, rot = 9073, team = 3 }, + { name = "corblackhy", x = 650, y = 0, z = 4602, rot = -23614, team = 3 }, + { name = "correcl", x = 5397, y = -80, z = 331, rot = -18068, team = 2 }, + { name = "corblackhy", x = 5369, y = 0, z = 489, rot = -26161, team = 2 }, + { name = "coruwadvms", x = 5216, y = -104, z = 160, rot = -16384, team = 2 }, + { name = "coruwadves", x = 5224, y = -104, z = 232, rot = -16384, team = 2 }, + { name = "coruwfus", x = 5144, y = -104, z = 200, rot = -16384, team = 2 }, + { name = "coruwfus", x = 5304, y = -104, z = 184, rot = -16384, team = 2 }, + { name = "coruwfus", x = 5224, y = -104, z = 88, rot = -16384, team = 2 }, + { name = "coruwfus", x = 5224, y = -104, z = 312, rot = -16384, team = 2 }, + { name = "corenaa", x = 5088, y = 0, z = 720, rot = -16384, team = 2 }, + { name = "corason", x = 5256, y = -104, z = 440, rot = -16384, team = 2 }, + { name = "corenaa", x = 5488, y = 0, z = 720, rot = -16384, team = 2 }, + { name = "corenaa", x = 4944, y = 0, z = 400, rot = -16384, team = 2 }, + { name = "corenaa", x = 5456, y = 0, z = 272, rot = -16384, team = 2 }, + { name = "coratl", x = 5320, y = -2, z = 616, rot = -16384, team = 2 }, + { name = "coratl", x = 5192, y = -2, z = 504, rot = -16384, team = 2 }, + { name = "coratl", x = 5560, y = -2, z = 744, rot = -16384, team = 2 }, + { name = "coratl", x = 5032, y = -2, z = 792, rot = -16384, team = 2 }, + { name = "coratl", x = 4872, y = -2, z = 408, rot = -16384, team = 2 }, + { name = "corfdoom", x = 4800, y = -3, z = 432, rot = -16384, team = 2 }, + { name = "corfdoom", x = 4976, y = -3, z = 880, rot = -16384, team = 2 }, + { name = "corfdoom", x = 5552, y = -3, z = 848, rot = -16384, team = 2 }, + { name = "corsjam", x = 5314, y = 0, z = 251, rot = 20439, team = 2 }, + { name = "corsjam", x = 5580, y = 0, z = 303, rot = 1649, team = 2 }, + { name = "coratl", x = 5256, y = -2, z = 856, rot = -16384, team = 2 }, + { name = "coratl", x = 4904, y = -2, z = 664, rot = -16384, team = 2 }, + { name = "corfatf", x = 5344, y = -3, z = 32, rot = -16384, team = 2 }, + { name = "corfatf", x = 5408, y = -3, z = 32, rot = -16384, team = 2 }, + { name = "corfatf", x = 5408, y = -3, z = 160, rot = -16384, team = 2 }, + { name = "coratl", x = 5752, y = -2, z = 632, rot = -16384, team = 2 }, + { name = "coratl", x = 4856, y = -2, z = 296, rot = -16384, team = 2 }, + { name = "correcl", x = 593, y = -80, z = 4691, rot = -8019, team = 3 }, + { name = "corfdrag", x = 4800, y = -3, z = 16, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4800, y = -3, z = 48, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4784, y = -3, z = 80, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4784, y = -3, z = 112, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4768, y = -3, z = 144, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4768, y = -3, z = 176, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4752, y = -3, z = 208, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4752, y = -3, z = 240, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4752, y = -3, z = 272, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4736, y = -3, z = 304, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4736, y = -3, z = 336, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4720, y = -3, z = 368, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4720, y = -3, z = 400, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4704, y = -3, z = 432, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4704, y = -3, z = 464, rot = -16384, team = 2 }, + { name = "corarch", x = 5086, y = 0, z = 93, rot = 0, team = 2 }, + { name = "corarch", x = 5684, y = 0, z = 555, rot = 0, team = 2 }, + { name = "corarch", x = 5052, y = 0, z = 395, rot = 0, team = 2 }, + { name = "corarch", x = 5398, y = 0, z = 665, rot = -15506, team = 2 }, + { name = "corfdrag", x = 4720, y = -3, z = 496, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4736, y = -3, z = 528, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4752, y = -3, z = 560, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4768, y = -3, z = 592, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4784, y = -3, z = 624, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4816, y = -3, z = 640, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4848, y = -3, z = 656, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4848, y = -3, z = 688, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4864, y = -3, z = 720, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4880, y = -3, z = 752, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 784, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 816, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 848, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 880, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4896, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4928, y = -3, z = 960, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4960, y = -3, z = 960, rot = -16384, team = 2 }, + { name = "corfdrag", x = 4992, y = -3, z = 960, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5024, y = -3, z = 960, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5056, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5088, y = -3, z = 928, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5120, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5152, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5184, y = -3, z = 896, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5216, y = -3, z = 896, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5248, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5280, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5312, y = -3, z = 928, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5344, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5376, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5408, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5440, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5472, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5504, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5536, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5568, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5600, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5632, y = -3, z = 944, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5648, y = -3, z = 912, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5680, y = -3, z = 896, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5712, y = -3, z = 880, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5728, y = -3, z = 848, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5744, y = -3, z = 816, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5760, y = -3, z = 784, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5776, y = -3, z = 752, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5792, y = -3, z = 720, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5808, y = -3, z = 688, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5840, y = -3, z = 688, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5872, y = -3, z = 688, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5904, y = -3, z = 672, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5936, y = -3, z = 672, rot = -16384, team = 2 }, + { name = "corfdrag", x = 5968, y = -3, z = 672, rot = -16384, team = 2 }, + { name = "corfdrag", x = 6000, y = -3, z = 672, rot = -16384, team = 2 }, + { name = "corfdrag", x = 6128, y = -3, z = 656, rot = -16384, team = 2 }, + { name = "corfdrag", x = 6096, y = -3, z = 656, rot = 0, team = 2 }, + { name = "corfdrag", x = 6064, y = -3, z = 656, rot = 0, team = 2 }, + { name = "corfdrag", x = 6032, y = -3, z = 656, rot = 0, team = 2 }, + { name = "correcl", x = 5520, y = -45, z = 210, rot = -27465, team = 2 }, + { name = "coruwadves", x = 344, y = -104, z = 4792, rot = 0, team = 3 }, + { name = "coruwadvms", x = 352, y = -104, z = 4720, rot = 0, team = 3 }, + { name = "coruwfus", x = 344, y = -104, z = 4872, rot = 0, team = 3 }, + { name = "coruwfus", x = 424, y = -104, z = 4760, rot = 0, team = 3 }, + { name = "coruwfus", x = 264, y = -104, z = 4760, rot = 0, team = 3 }, + { name = "coruwfus", x = 344, y = -104, z = 4648, rot = 0, team = 3 }, + { name = "coratl", x = 792, y = -2, z = 4552, rot = 32767, team = 3 }, + { name = "coratl", x = 680, y = -2, z = 4440, rot = 32767, team = 3 }, + { name = "corason", x = 568, y = -104, z = 4472, rot = 32767, team = 3 }, + { name = "corfatf", x = 48, y = -3, z = 4768, rot = 32767, team = 3 }, + { name = "corfatf", x = 48, y = -3, z = 4832, rot = 32767, team = 3 }, + { name = "corfatf", x = 48, y = -3, z = 4896, rot = 32767, team = 3 }, + { name = "corenaa", x = 416, y = 0, z = 4688, rot = 32767, team = 3 }, + { name = "coratl", x = 904, y = -2, z = 4952, rot = 32767, team = 3 }, + { name = "coratl", x = 1064, y = -2, z = 4776, rot = 32767, team = 3 }, + { name = "coratl", x = 1096, y = -2, z = 4408, rot = 32767, team = 3 }, + { name = "coratl", x = 968, y = -2, z = 4280, rot = 32767, team = 3 }, + { name = "coratl", x = 728, y = -2, z = 4184, rot = 32767, team = 3 }, + { name = "coratl", x = 440, y = -2, z = 4184, rot = 32767, team = 3 }, + { name = "coratl", x = 200, y = -2, z = 4216, rot = 32767, team = 3 }, + { name = "corfdoom", x = 432, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdoom", x = 736, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdoom", x = 1040, y = -3, z = 4256, rot = 32767, team = 3 }, + { name = "corfdoom", x = 1168, y = -3, z = 4416, rot = 32767, team = 3 }, + { name = "corfdoom", x = 1136, y = -3, z = 4768, rot = 32767, team = 3 }, + { name = "corenaa", x = 960, y = 0, z = 4800, rot = 32767, team = 3 }, + { name = "corenaa", x = 1024, y = 0, z = 4464, rot = 32767, team = 3 }, + { name = "corenaa", x = 720, y = 0, z = 4256, rot = 32767, team = 3 }, + { name = "corenaa", x = 416, y = 0, z = 4272, rot = 32767, team = 3 }, + { name = "corenaa", x = 272, y = 0, z = 4832, rot = 32767, team = 3 }, + { name = "corarch", x = 497, y = 0, z = 4870, rot = 0, team = 3 }, + { name = "corarch", x = 227, y = 0, z = 4636, rot = 0, team = 3 }, + { name = "corarch", x = 433, y = 0, z = 4377, rot = 0, team = 3 }, + { name = "corarch", x = 880, y = 0, z = 4681, rot = 0, team = 3 }, + { name = "corsjam", x = 587, y = 0, z = 4850, rot = -2450, team = 3 }, + { name = "corsjam", x = 375, y = 0, z = 4572, rot = 20759, team = 3 }, + { name = "corfdrag", x = 16, y = -3, z = 4144, rot = 32767, team = 3 }, + { name = "corfdrag", x = 48, y = -3, z = 4144, rot = 32767, team = 3 }, + { name = "corfdrag", x = 80, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 112, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 144, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 176, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 208, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 240, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 272, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 304, y = -3, z = 4096, rot = 32767, team = 3 }, + { name = "corfdrag", x = 336, y = -3, z = 4096, rot = 32767, team = 3 }, + { name = "corfdrag", x = 336, y = -3, z = 4064, rot = 32767, team = 3 }, + { name = "corfdrag", x = 352, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 384, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 416, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 448, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 480, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 512, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 512, y = -3, z = 4064, rot = 32767, team = 3 }, + { name = "corfdrag", x = 544, y = -3, z = 4096, rot = 32767, team = 3 }, + { name = "corfdrag", x = 560, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 592, y = -3, z = 4128, rot = 32767, team = 3 }, + { name = "corfdrag", x = 608, y = -3, z = 4096, rot = 32767, team = 3 }, + { name = "corfdrag", x = 640, y = -3, z = 4080, rot = 32767, team = 3 }, + { name = "corfdrag", x = 672, y = -3, z = 4064, rot = 32767, team = 3 }, + { name = "corfdrag", x = 688, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 720, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 752, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 784, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 816, y = -3, z = 4032, rot = 32767, team = 3 }, + { name = "corfdrag", x = 832, y = -3, z = 4064, rot = 32767, team = 3 }, + { name = "corfdrag", x = 848, y = -3, z = 4096, rot = 32767, team = 3 }, + { name = "corfdrag", x = 880, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 912, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 944, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 976, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1008, y = -3, z = 4112, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1008, y = -3, z = 4144, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1008, y = -3, z = 4176, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1040, y = -3, z = 4176, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1072, y = -3, z = 4176, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1104, y = -3, z = 4192, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1120, y = -3, z = 4224, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1136, y = -3, z = 4256, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1152, y = -3, z = 4288, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4304, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4320, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4336, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4368, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4400, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4432, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4464, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4496, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4512, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1200, y = -3, z = 4544, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4576, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4608, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4640, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4672, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4704, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4720, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4752, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4784, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4816, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1248, y = -3, z = 4832, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1280, y = -3, z = 4864, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 4896, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1216, y = -3, z = 4848, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1184, y = -3, z = 4864, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1152, y = -3, z = 4880, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1120, y = -3, z = 4896, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1088, y = -3, z = 4912, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1056, y = -3, z = 4928, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1024, y = -3, z = 4944, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1008, y = -3, z = 4976, rot = 32767, team = 3 }, + { name = "corfdrag", x = 992, y = -3, z = 5008, rot = 32767, team = 3 }, + { name = "corfdrag", x = 960, y = -3, z = 5040, rot = 32767, team = 3 }, + { name = "corfdrag", x = 944, y = -3, z = 5072, rot = 32767, team = 3 }, + { name = "corfdrag", x = 944, y = -3, z = 5104, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 4928, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 4960, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 4992, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 5024, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 5056, rot = 32767, team = 3 }, + { name = "corfdrag", x = 1296, y = -3, z = 5088, rot = 32767, team = 3 }, + { name = "coratl", x = 1080, y = -2, z = 4984, rot = 32767, team = 3 }, + { name = "coruwmme", x = 4880, y = -105, z = 176, rot = 0, team = 4 }, + { name = "corcarry", x = 5559, y = -8, z = 458, rot = 0, team = 4 }, + { name = "corcarry", x = 4251, y = -8, z = 1666, rot = -16384, team = 4 }, + { name = "correcl", x = 6077, y = -81, z = 228, rot = 0, team = 4 }, + { name = "corsjam", x = 5470, y = 0, z = 348, rot = 0, team = 4 }, + { name = "coruwfus", x = 4939, y = -105, z = 115, rot = -16384, team = 4 }, + { name = "coruwmmm", x = 4644, y = 0, z = 1202, rot = -16384, team = 4 }, + { name = "coruwmme", x = 1248, y = -105, z = 4928, rot = 0, team = 5 }, + { name = "corsjam", x = 429, y = 0, z = 4593, rot = 0, team = 5 }, + { name = "correcl", x = 240, y = -80, z = 5062, rot = 0, team = 5 }, + { name = "corcarry", x = 539, y = -8, z = 4764, rot = -16384, team = 5 }, + { name = "corcarry", x = 1875, y = -8, z = 3398, rot = -16384, team = 5 }, + { name = "coruwfus", x = 1143, y = -105, z = 5090, rot = -16384, team = 5 }, + { name = "coruwmmm", x = 1467, y = 0, z = 3799, rot = -16384, team = 5 }, }, featureloadout = { -- Similarly to units, but these can also be resurrectable! - -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed - -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example - {name = 'armrectr_dead', x = 114, y = 34, z = 149, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = 'armjamt_dead', x = 1424, y = 34, z = 631, rot = 0 , scale = 1.0, resurrectas = "armjamt"}, - {name = 'armadvsol_dead', x = 58, y = 34, z = 947, rot = 0 , scale = 1.0, resurrectas = "armadvsol"}, - {name = 'armadvsol_dead', x = 929, y = 34, z = 81, rot = 0 , scale = 1.0, resurrectas = "armadvsol"}, - {name = 'armjamt_dead', x = 531, y = 34, z = 1265, rot = 0 , scale = 1.0, resurrectas = "armjamt"}, - {name = 'armck_dead', x = 1027, y = 101, z = 1053, rot = 0 , scale = 1.0, resurrectas = "armck"}, - {name = 'armrectr_dead', x = 1917, y = 34, z = 175, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = 'armjamt_dead', x = 733, y = 34, z = 575, rot = 0 , scale = 1.0, resurrectas = "armjamt"}, - {name = 'armjamt_dead', x = 1972, y = 34, z = 903, rot = 0 , scale = 1.0, resurrectas = "armjamt"}, - {name = 'armjamt_dead', x = 530, y = 34, z = 1747, rot = 0 , scale = 1.0, resurrectas = "armjamt"}, - {name = 'armrectr_dead', x = 91, y = 34, z = 1687, rot = 0 , scale = 1.0, resurrectas = "armrectr"}, - {name = "armgate_dead", x = 384, y = 34, z = 1456, rot = 0, scale = 1.0, resurrectas = "armgate"}, - {name = "armadvsol_dead", x = 64, y = 34, z = 688, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 192, y = 34, z = 464, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 656, y = 34, z = 448, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 640, y = 34, z = 96, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 272, y = 34, z = 208, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 637, y = 34, z = 268, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 912, y = 34, z = 268, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armadvsol_dead", x = 416, y = 34, z = 96, rot = 0, scale = 1.0, resurrectas = "armadvsol"}, - {name = "armckfus_dead", x = 48, y = 34, z = 46, rot = 0, scale = 1.0, resurrectas = "armckfus"}, - {name = "armbeamer_dead", x = 272, y = 34, z = 1584, rot = 0, scale = 1.0, resurrectas = "armbeamer"}, - {name = "armbeamer_dead", x = 608, y = 34, z = 1584, rot = 0, scale = 1.0, resurrectas = "armbeamer"}, - {name = "armbeamer_dead", x = 1376, y = 34, z = 832, rot = 0, scale = 1.0, resurrectas = "armbeamer"}, - {name = "armbeamer_dead", x = 1696, y = 34, z = 528, rot = 0, scale = 1.0, resurrectas = "armbeamer"}, - {name = "armpb_dead", x = 1556, y = 34, z = 695, rot = 0, scale = 1.0, resurrectas = "armpb"}, - {name = "armpb_dead", x = 414, y = 34, z = 1631, rot = 0, scale = 1.0, resurrectas = "armpb"}, - {name = "armgate_dead", x = 432, y = 34, z = 304, rot = 0, scale = 1.0, resurrectas = "armgate"}, - {name = "armgate_dead", x = 1168, y = 34, z = 528, rot = 0, scale = 1.0, resurrectas = "armgate"}, - {name = 'coradvsol_dead', x = 6088, y = 34, z = 5068, rot = 0 , scale = 1.0, resurrectas = "coradvsol"}, - {name = 'coradvsol_dead', x = 5740, y = 34, z = 5081, rot = 0 , scale = 1.0, resurrectas = "coradvsol"}, - {name = 'coradvsol_dead', x = 5533, y = 34, z = 5086, rot = 0 , scale = 1.0, resurrectas = "coradvsol"}, - {name = 'cornecro_dead', x = 5567, y = 34, z = 4905, rot = 0 , scale = 1.0, resurrectas = "cornecro"}, - {name = 'coradvsol_dead', x = 5937, y = 34, z = 5076, rot = 0 , scale = 1.0, resurrectas = "coradvsol"}, - {name = 'corck_dead', x = 5173, y = 34, z = 4379, rot = 0 , scale = 1.0, resurrectas = "corck"}, - {name = 'corexp_dead', x = 4719, y = 34, z = 4687, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'coramsub_dead', x = 5760, y = -104, z = 208, rot = 0 , scale = 1.0, resurrectas = "coramsub"}, - {name = 'coramsub_dead', x = 96, y = -104, z = 4624, rot = 32767 , scale = 1.0, resurrectas = "coramsub"}, - {name = 'cormex_dead', x = 736, y = -104, z = 4416, rot = 0 , scale = 1.0, resurrectas = "cormex"}, - {name = 'cormex_dead', x = 944, y = -104, z = 4176, rot = 0 , scale = 1.0, resurrectas = "cormex"}, - {name = 'cormex_dead', x = 5200, y = -104, z = 944, rot = -16384 , scale = 1.0, resurrectas = "cormex"}, - {name = 'cormex_dead', x = 5408, y = -104, z = 688, rot = -16384 , scale = 1.0, resurrectas = "cormex"}, - {name = 'corexp_dead', x = 3337, y = 34, z = 3853, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'cornecro_dead', x = 5042, y = 34, z = 4912, rot = 0 , scale = 1.0, resurrectas = "cornecro"}, - {name = 'corexp_dead', x = 5627, y = 34, z = 3617, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'corexp_dead', x = 3950, y = 34, z = 4091, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'corexp_dead', x = 5710, y = 34, z = 4493, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'coradvsol_dead', x = 6082, y = 34, z = 4834, rot = 0 , scale = 1.0, resurrectas = "coradvsol"}, - {name = 'corexp_dead', x = 3866, y = 101, z = 5056, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'corexp_dead', x = 4319, y = 34, z = 3227, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = 'corexp_dead', x = 6024, y = 34, z = 2342, rot = 0 , scale = 1.0, resurrectas = "corexp"}, - {name = "corgate_dead", x = 5248, y = 34, z = 4672, rot = 0, scale = 1.0, resurrectas = "corgate"}, - {name = "corshroud_dead", x = 5808, y = 34, z = 4544, rot = 0, scale = 1.0, resurrectas = "corshroud"}, - {name = "corgate_dead", x = 5792, y = 34, z = 4720, rot = 0, scale = 1.0, resurrectas = "corgate"}, - {name = "corshroud_dead", x = 5120, y = 34, z = 4528, rot = 0, scale = 1.0, resurrectas = "corshroud"}, - {name = "corgate_dead", x = 5792, y = 34, z = 4208, rot = 0, scale = 1.0, resurrectas = "corgate"}, - {name = "corgate_dead", x = 5280, y = 35, z = 4224, rot = 0, scale = 1.0, resurrectas = "corgate"}, - {name = "corgate_dead", x = 5520, y = 34, z = 4432, rot = 0, scale = 1.0, resurrectas = "corgate"}, - {name = "corfus_dead", x = 6088, y = 34, z = 4952, rot = 0, scale = 1.0, resurrectas = "corfus"}, - {name = "coradvsol_dead", x = 5632, y = 34, z = 5088, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 5840, y = 34, z = 5072, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 6016, y = 34, z = 5072, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 5424, y = 34, z = 5088, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 6080, y = 34, z = 4736, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 5328, y = 34, z = 5096, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "coradvsol_dead", x = 6098, y = 34, z = 4629, rot = 0, scale = 1.0, resurrectas = "coradvsol"}, - {name = "corlab_dead", x = 5504, y = 34, z = 4672, rot = 32767, scale = 1.0, resurrectas = "corlab"}, - {name = "corvipe_dead", x = 5704, y = 34, z = 4072, rot = 32767, scale = 1.0, resurrectas = "corvipe"}, - {name = "corvipe_dead", x = 4904, y = 34, z = 4616, rot = 16384, scale = 1.0, resurrectas = "corvipe"}, - {name = "corhllt_dead", x = 4962, y = 34, z = 4415, rot = 16384, scale = 1.0, resurrectas = "corhllt"}, - {name = "corhllt_dead", x = 5469, y = 34, z = 4075, rot = 32767, scale = 1.0, resurrectas = "corhllt"}, - } - }, - -- Full Documentation for start script here: - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + -- You can /give corcom_dead with cheats when making your scenario, but it might not contain the 'resurrectas' tag, so be careful to add it if needed + -- {name = 'corcom_dead', x = 1125,y = 237, z = 734, rot = "0" , scale = 1.0, resurrectas = "corcom"}, -- there is no need for this dead comm here, just an example + { name = "armrectr_dead", x = 114, y = 34, z = 149, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armjamt_dead", x = 1424, y = 34, z = 631, rot = 0, scale = 1.0, resurrectas = "armjamt" }, + { name = "armadvsol_dead", x = 58, y = 34, z = 947, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 929, y = 34, z = 81, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armjamt_dead", x = 531, y = 34, z = 1265, rot = 0, scale = 1.0, resurrectas = "armjamt" }, + { name = "armck_dead", x = 1027, y = 101, z = 1053, rot = 0, scale = 1.0, resurrectas = "armck" }, + { name = "armrectr_dead", x = 1917, y = 34, z = 175, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armjamt_dead", x = 733, y = 34, z = 575, rot = 0, scale = 1.0, resurrectas = "armjamt" }, + { name = "armjamt_dead", x = 1972, y = 34, z = 903, rot = 0, scale = 1.0, resurrectas = "armjamt" }, + { name = "armjamt_dead", x = 530, y = 34, z = 1747, rot = 0, scale = 1.0, resurrectas = "armjamt" }, + { name = "armrectr_dead", x = 91, y = 34, z = 1687, rot = 0, scale = 1.0, resurrectas = "armrectr" }, + { name = "armgate_dead", x = 384, y = 34, z = 1456, rot = 0, scale = 1.0, resurrectas = "armgate" }, + { name = "armadvsol_dead", x = 64, y = 34, z = 688, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 192, y = 34, z = 464, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 656, y = 34, z = 448, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 640, y = 34, z = 96, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 272, y = 34, z = 208, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 637, y = 34, z = 268, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 912, y = 34, z = 268, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armadvsol_dead", x = 416, y = 34, z = 96, rot = 0, scale = 1.0, resurrectas = "armadvsol" }, + { name = "armckfus_dead", x = 48, y = 34, z = 46, rot = 0, scale = 1.0, resurrectas = "armckfus" }, + { name = "armbeamer_dead", x = 272, y = 34, z = 1584, rot = 0, scale = 1.0, resurrectas = "armbeamer" }, + { name = "armbeamer_dead", x = 608, y = 34, z = 1584, rot = 0, scale = 1.0, resurrectas = "armbeamer" }, + { name = "armbeamer_dead", x = 1376, y = 34, z = 832, rot = 0, scale = 1.0, resurrectas = "armbeamer" }, + { name = "armbeamer_dead", x = 1696, y = 34, z = 528, rot = 0, scale = 1.0, resurrectas = "armbeamer" }, + { name = "armpb_dead", x = 1556, y = 34, z = 695, rot = 0, scale = 1.0, resurrectas = "armpb" }, + { name = "armpb_dead", x = 414, y = 34, z = 1631, rot = 0, scale = 1.0, resurrectas = "armpb" }, + { name = "armgate_dead", x = 432, y = 34, z = 304, rot = 0, scale = 1.0, resurrectas = "armgate" }, + { name = "armgate_dead", x = 1168, y = 34, z = 528, rot = 0, scale = 1.0, resurrectas = "armgate" }, + { name = "coradvsol_dead", x = 6088, y = 34, z = 5068, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 5740, y = 34, z = 5081, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 5533, y = 34, z = 5086, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "cornecro_dead", x = 5567, y = 34, z = 4905, rot = 0, scale = 1.0, resurrectas = "cornecro" }, + { name = "coradvsol_dead", x = 5937, y = 34, z = 5076, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "corck_dead", x = 5173, y = 34, z = 4379, rot = 0, scale = 1.0, resurrectas = "corck" }, + { name = "corexp_dead", x = 4719, y = 34, z = 4687, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "coramsub_dead", x = 5760, y = -104, z = 208, rot = 0, scale = 1.0, resurrectas = "coramsub" }, + { name = "coramsub_dead", x = 96, y = -104, z = 4624, rot = 32767, scale = 1.0, resurrectas = "coramsub" }, + { name = "cormex_dead", x = 736, y = -104, z = 4416, rot = 0, scale = 1.0, resurrectas = "cormex" }, + { name = "cormex_dead", x = 944, y = -104, z = 4176, rot = 0, scale = 1.0, resurrectas = "cormex" }, + { name = "cormex_dead", x = 5200, y = -104, z = 944, rot = -16384, scale = 1.0, resurrectas = "cormex" }, + { name = "cormex_dead", x = 5408, y = -104, z = 688, rot = -16384, scale = 1.0, resurrectas = "cormex" }, + { name = "corexp_dead", x = 3337, y = 34, z = 3853, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "cornecro_dead", x = 5042, y = 34, z = 4912, rot = 0, scale = 1.0, resurrectas = "cornecro" }, + { name = "corexp_dead", x = 5627, y = 34, z = 3617, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "corexp_dead", x = 3950, y = 34, z = 4091, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "corexp_dead", x = 5710, y = 34, z = 4493, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "coradvsol_dead", x = 6082, y = 34, z = 4834, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "corexp_dead", x = 3866, y = 101, z = 5056, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "corexp_dead", x = 4319, y = 34, z = 3227, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "corexp_dead", x = 6024, y = 34, z = 2342, rot = 0, scale = 1.0, resurrectas = "corexp" }, + { name = "corgate_dead", x = 5248, y = 34, z = 4672, rot = 0, scale = 1.0, resurrectas = "corgate" }, + { name = "corshroud_dead", x = 5808, y = 34, z = 4544, rot = 0, scale = 1.0, resurrectas = "corshroud" }, + { name = "corgate_dead", x = 5792, y = 34, z = 4720, rot = 0, scale = 1.0, resurrectas = "corgate" }, + { name = "corshroud_dead", x = 5120, y = 34, z = 4528, rot = 0, scale = 1.0, resurrectas = "corshroud" }, + { name = "corgate_dead", x = 5792, y = 34, z = 4208, rot = 0, scale = 1.0, resurrectas = "corgate" }, + { name = "corgate_dead", x = 5280, y = 35, z = 4224, rot = 0, scale = 1.0, resurrectas = "corgate" }, + { name = "corgate_dead", x = 5520, y = 34, z = 4432, rot = 0, scale = 1.0, resurrectas = "corgate" }, + { name = "corfus_dead", x = 6088, y = 34, z = 4952, rot = 0, scale = 1.0, resurrectas = "corfus" }, + { name = "coradvsol_dead", x = 5632, y = 34, z = 5088, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 5840, y = 34, z = 5072, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 6016, y = 34, z = 5072, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 5424, y = 34, z = 5088, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 6080, y = 34, z = 4736, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 5328, y = 34, z = 5096, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "coradvsol_dead", x = 6098, y = 34, z = 4629, rot = 0, scale = 1.0, resurrectas = "coradvsol" }, + { name = "corlab_dead", x = 5504, y = 34, z = 4672, rot = 32767, scale = 1.0, resurrectas = "corlab" }, + { name = "corvipe_dead", x = 5704, y = 34, z = 4072, rot = 32767, scale = 1.0, resurrectas = "corvipe" }, + { name = "corvipe_dead", x = 4904, y = 34, z = 4616, rot = 16384, scale = 1.0, resurrectas = "corvipe" }, + { name = "corhllt_dead", x = 4962, y = 34, z = 4415, rot = 16384, scale = 1.0, resurrectas = "corhllt" }, + { name = "corhllt_dead", x = 5469, y = 34, z = 4075, rot = 32767, scale = 1.0, resurrectas = "corhllt" }, + }, + }, + -- Full Documentation for start script here: + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt - -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below - -- The following keys MUST be present in startscript below - -- scenariooptions = __SCENARIOOPTIONS__; - -- Name = __PLAYERNAME__; - -- myplayername = __PLAYERNAME__; - -- gametype = __BARVERSION__; - -- mapname =__MAPNAME__; + -- HOW TO MAKE THE START SCRIPT: Use Chobby's single player mode to set up your start script. When you launch a single player game, the start script is dumped into infolog.txt + -- ModOptions: You can also set modoptions in chobby, and they will get dumped into the infolog's start script too, or just set then in chobby and copy paste them into the [modoptions] tag. as below + -- The following keys MUST be present in startscript below + -- scenariooptions = __SCENARIOOPTIONS__; + -- Name = __PLAYERNAME__; + -- myplayername = __PLAYERNAME__; + -- gametype = __BARVERSION__; + -- mapname =__MAPNAME__; - -- Optional keys: - -- __ENEMYHANDICAP__ - -- __PLAYERSIDE__ - -- __PLAYERHANDICAP__ - -- __NUMRESTRICTIONS__ - -- __RESTRICTEDUNITS__ + -- Optional keys: + -- __ENEMYHANDICAP__ + -- __PLAYERSIDE__ + -- __PLAYERHANDICAP__ + -- __NUMRESTRICTIONS__ + -- __RESTRICTEDUNITS__ - startscript = [[[GAME] + startscript = [[[GAME] { [allyTeam0] { @@ -646,7 +646,6 @@ Scoring: nohelperais = 0; } ]], - } return scenariodata diff --git a/singleplayer/scenarios/scenario023.lua b/singleplayer/scenarios/scenario023.lua index 769f8b29cc5..42d4582a66a 100644 --- a/singleplayer/scenarios/scenario023.lua +++ b/singleplayer/scenarios/scenario023.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 23, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "benchmark_lightside", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "Benchmark BAR", -- can be anything - author = "Beherith, AKU", -- your name here - isnew = true, - imagepath = "scenario023.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Units will act automatically during the benchmark", -- This text will be drawn over image - summary = [[This is a quick, ~3 minute benchmark script. You may leave after the benchmark is complete.]], - briefing = [[This scenario starts a benchmark by spawning 650 units to continously fight against 650 units. Use Bots/Tanks/Aircraft an option for close to a real game's match benchmark and collision an option for synthetic testing multithreading abilities of the game's engine. The average Sim, Draw and Update times are shown on screen. The game will automatically center the camera over the units, do not move the camera while the benchmark is running, and do not interact with the units. The game will return after printing the results to screen and infolog, and submitting them to the server. + index = 23, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "benchmark_lightside", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "Benchmark BAR", -- can be anything + author = "Beherith, AKU", -- your name here + isnew = true, + imagepath = "scenario023.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Units will act automatically during the benchmark", -- This text will be drawn over image + summary = [[This is a quick, ~3 minute benchmark script. You may leave after the benchmark is complete.]], + briefing = [[This scenario starts a benchmark by spawning 650 units to continously fight against 650 units. Use Bots/Tanks/Aircraft an option for close to a real game's match benchmark and collision an option for synthetic testing multithreading abilities of the game's engine. The average Sim, Draw and Update times are shown on screen. The game will automatically center the camera over the units, do not move the camera while the benchmark is running, and do not interact with the units. The game will return after printing the results to screen and infolog, and submitting them to the server. A total of 2000 simulation frames are tested. @@ -21,35 +21,35 @@ local scenariodata = { ]], - mapfilename = "Starwatcher 1.0", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 180, -- par time in seconds - parresources = 1, -- par resource amount - difficulty = 15, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "Bots", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "Bots", playerhandicap = "corak armpw 650 10 2040" , enemyhandicap = 0}, - {name = "Tanks", playerhandicap = "armbull armbull 650 10 2040" , enemyhandicap = 0}, - {name = "Aircraft", playerhandicap = "corvamp armhawk 650 10 2040" , enemyhandicap = 0}, - {name = "Collision", simspeed = "setspeed 20", cpu80 = "speedcontrol 0", playerhandicap = "coracsub coracsub 1300 2 1" , enemyhandicap = 0}, - }, - allowedsides = {""}, --these are the permitted factions for this mission - victorycondition= "None", -- This is plaintext, but should be reflected in startscript - losscondition = "None", -- This is plaintext, but should be reflected in startscript - unitlimits = {}, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - --myoption = "dostuff", - scenarioid = "benchmark_lightside", --must be present for scores + mapfilename = "Starwatcher 1.0", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 180, -- par time in seconds + parresources = 1, -- par resource amount + difficulty = 15, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "Bots", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "Bots", playerhandicap = "corak armpw 650 10 2040", enemyhandicap = 0 }, + { name = "Tanks", playerhandicap = "armbull armbull 650 10 2040", enemyhandicap = 0 }, + { name = "Aircraft", playerhandicap = "corvamp armhawk 650 10 2040", enemyhandicap = 0 }, + { name = "Collision", simspeed = "setspeed 20", cpu80 = "speedcontrol 0", playerhandicap = "coracsub coracsub 1300 2 1", enemyhandicap = 0 }, + }, + allowedsides = { "" }, --these are the permitted factions for this mission + victorycondition = "None", -- This is plaintext, but should be reflected in startscript + losscondition = "None", -- This is plaintext, but should be reflected in startscript + unitlimits = {}, + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + --myoption = "dostuff", + scenarioid = "benchmark_lightside", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides benchmarkcommand = "luarules benchmark corak armpw 650 10 2040", -- make sure the matches the debugcommands identically named modoption's info benchmarkframes = 2000, - -- quiteforce sucks, does not end the game. - --unitloadout = {}, + -- quiteforce sucks, does not end the game. + --unitloadout = {}, --featureloadout = {}, - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { diff --git a/singleplayer/scenarios/scenario024.lua b/singleplayer/scenarios/scenario024.lua index 72732d49bb3..6fe87216dca 100644 --- a/singleplayer/scenarios/scenario024.lua +++ b/singleplayer/scenarios/scenario024.lua @@ -1,14 +1,14 @@ local scenariodata = { - index = 24, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER - scenarioid = "benchmark_pathfinding", -- no spaces, lowercase, this will be used to save the score - version = "1.0", -- increment this to keep the score when changing a mission - title = "Benchmark pathfinding", -- can be anything - author = "Beherith, AKU", -- your name here - isnew = true, - imagepath = "scenario023.jpg", -- placed next to lua file, should be 3:1 ratio banner style - imageflavor = "Units will act automatically during the benchmark", -- This text will be drawn over image - summary = [[Pathfinding benchmark.]], - briefing = [[Pathfinding benchmark. The average Sim, Draw and Update times are shown on screen. The game will automatically center the camera over the units, do not move the camera while the benchmark is running, and do not interact with the units. The game will return after printing the results to screen and infolog, and submitting them to the server. Amount of units at the end of testing depends of setting: + index = 24, -- integer, sort order, MUST BE EQUAL TO FILENAME NUMBER + scenarioid = "benchmark_pathfinding", -- no spaces, lowercase, this will be used to save the score + version = "1.0", -- increment this to keep the score when changing a mission + title = "Benchmark pathfinding", -- can be anything + author = "Beherith, AKU", -- your name here + isnew = true, + imagepath = "scenario023.jpg", -- placed next to lua file, should be 3:1 ratio banner style + imageflavor = "Units will act automatically during the benchmark", -- This text will be drawn over image + summary = [[Pathfinding benchmark.]], + briefing = [[Pathfinding benchmark. The average Sim, Draw and Update times are shown on screen. The game will automatically center the camera over the units, do not move the camera while the benchmark is running, and do not interact with the units. The game will return after printing the results to screen and infolog, and submitting them to the server. Amount of units at the end of testing depends of setting: 1 unit spawn rate ~700 units; 3 unit spawn rate ~2000 units; 10 unit spawn rate ~7000 units; @@ -25,35 +25,35 @@ local scenariodata = { ]], - mapfilename = "Jade Empress 1.3", -- the name of the map to be displayed here - playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map - playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map - partime = 180, -- par time in seconds - parresources = 1, -- par resource amount - difficulty = 15, -- Percieved difficulty at 'normal' level: integer 1-10 - defaultdifficulty = "3 unit spawn rate", -- an entry of the difficulty table - difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels - {name = "1 unit spawn rate", playerhandicap = "armcv armck 11000 1 12000" , enemyhandicap = 0}, - {name = "3 unit spawn rate", playerhandicap = "armcv armck 11000 3 12000" , enemyhandicap = 0}, - {name = "10 unit spawn rate", playerhandicap = "armcv armck 11000 10 12000" , enemyhandicap = 0}, - {name = "15 unit spawn rate", playerhandicap = "armcv armck 11000 15 12000" , enemyhandicap = 0}, - }, - allowedsides = {""}, --these are the permitted factions for this mission - victorycondition= "None", -- This is plaintext, but should be reflected in startscript - losscondition = "None", -- This is plaintext, but should be reflected in startscript - unitlimits = {}, - scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game - --myoption = "dostuff", - scenarioid = "benchmark_pathfinding", --must be present for scores + mapfilename = "Jade Empress 1.3", -- the name of the map to be displayed here + playerstartx = "10%", -- X position of where player comm icon should be drawn, from top left of the map + playerstarty = "10%", -- Y position of where player comm icon should be drawn, from top left of the map + partime = 180, -- par time in seconds + parresources = 1, -- par resource amount + difficulty = 15, -- Percieved difficulty at 'normal' level: integer 1-10 + defaultdifficulty = "3 unit spawn rate", -- an entry of the difficulty table + difficulties = { -- Array for sortedness, Keys are text that appears in selector (as well as in scoring!), values are handicap levels + { name = "1 unit spawn rate", playerhandicap = "armcv armck 11000 1 12000", enemyhandicap = 0 }, + { name = "3 unit spawn rate", playerhandicap = "armcv armck 11000 3 12000", enemyhandicap = 0 }, + { name = "10 unit spawn rate", playerhandicap = "armcv armck 11000 10 12000", enemyhandicap = 0 }, + { name = "15 unit spawn rate", playerhandicap = "armcv armck 11000 15 12000", enemyhandicap = 0 }, + }, + allowedsides = { "" }, --these are the permitted factions for this mission + victorycondition = "None", -- This is plaintext, but should be reflected in startscript + losscondition = "None", -- This is plaintext, but should be reflected in startscript + unitlimits = {}, + scenariooptions = { -- this will get lua->json->base64 and passed to scenariooptions in game + --myoption = "dostuff", + scenarioid = "benchmark_pathfinding", --must be present for scores disablefactionpicker = true, -- this is needed to prevent faction picking outside of the allowedsides benchmarkcommand = "luarules benchmark armcv armck 11000 1 12000", -- make sure the matches the debugcommands identically named modoption's info benchmarkframes = 2000, - -- quiteforce sucks, does not end the game. - --unitloadout = {}, + -- quiteforce sucks, does not end the game. + --unitloadout = {}, --featureloadout = {}, - }, - -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt - startscript = [[ + }, + -- https://github.com/spring/spring/blob/105.0/doc/StartScriptFormat.txt + startscript = [[ [Game] { diff --git a/singleplayer/scenarios/scenarioscripts/Begin06.lua b/singleplayer/scenarios/scenarioscripts/Begin06.lua index e5368604107..05e6413830f 100644 --- a/singleplayer/scenarios/scenarioscripts/Begin06.lua +++ b/singleplayer/scenarios/scenarioscripts/Begin06.lua @@ -20,693 +20,694 @@ local function rot_to_facing(rotation) end return 2 end -]]-- +]] +-- -- --[[ Different loadout tables ]] -- local loadout = { - {name = "corsub", x = 2395, y = -46, z = 1798, rot = -19024, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3752, py = -46, pz = 2807}}, - }}, - {name = "corsub", x = 2101, y = -46, z = 2283, rot = -19135, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3458, py = -46, pz = 3292}}, - }}, - {name = "corsub", x = 2526, y = -46, z = 1727, rot = -22660, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3883, py = -46, pz = 2736}}, - }}, - {name = "corsub", x = 2174, y = -46, z = 2141, rot = -19743, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3532, py = -46, pz = 3150}}, - }}, - {name = "corsub", x = 2273, y = -46, z = 1961, rot = -26036, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3630, py = -46, pz = 2970}}, - }}, - {name = "corsub", x = 2225, y = -46, z = 2049, rot = -18900, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3582, py = -46, pz = 3058}}, - }}, - {name = "corsub", x = 2481, y = -46, z = 1754, rot = -25613, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3838, py = -46, pz = 2763}}, - }}, - {name = "corsub", x = 2299, y = -46, z = 1913, rot = -27608, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3656, py = -46, pz = 2922}}, - }}, - {name = "corsub", x = 2152, y = -46, z = 2190, rot = -20447, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3509, py = -46, pz = 3199}}, - }}, - {name = "corsub", x = 2355, y = -46, z = 1830, rot = -22140, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3712, py = -46, pz = 2839}}, - }}, - {name = "corsub", x = 2324, y = -46, z = 1871, rot = -21438, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3681, py = -46, pz = 2880}}, - }}, - {name = "corsub", x = 2564, y = -46, z = 1710, rot = -26779, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3921, py = -46, pz = 2720}}, - }}, - {name = "corsub", x = 2597, y = -46, z = 1688, rot = -22725, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3954, py = -46, pz = 2697}}, - }}, - {name = "corsub", x = 2671, y = -46, z = 1660, rot = -20204, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 4028, py = -46, pz = 2669}}, - }}, - {name = "corsub", x = 2199, y = -46, z = 2094, rot = -24359, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3556, py = -46, pz = 3103}}, - }}, - {name = "corsub", x = 2631, y = -46, z = 1664, rot = -23525, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3988, py = -46, pz = 2673}}, - }}, - {name = "corsub", x = 2074, y = -46, z = 2325, rot = -27673, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3431, py = -46, pz = 3334}}, - }}, - {name = "corsub", x = 2053, y = -46, z = 2367, rot = -28267, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3410, py = -46, pz = 3376}}, - }}, - {name = "corsub", x = 2248, y = -46, z = 2002, rot = -29877, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3605, py = -46, pz = 3011}}, - }}, - {name = "corsub", x = 2122, y = -46, z = 2234, rot = -20970, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3479, py = -46, pz = 3243}}, - }}, - {name = "corsub", x = 2438, y = -46, z = 1775, rot = -28732, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3795, py = -46, pz = 2785}}, - }}, - {name = "corshark", x = 4091, y = -41, z = 2745, rot = 4577, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2613, py = -41, pz = 1610}}, - }}, - {name = "corshark", x = 3610, y = -41, z = 3333, rot = 6060, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2131, py = -41, pz = 2198}}, - }}, - {name = "corshark", x = 3410, y = -41, z = 3460, rot = 9963, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 1932, py = -41, pz = 2325}}, - }}, - {name = "corshark", x = 4005, y = -41, z = 3005, rot = 5265, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2527, py = -41, pz = 1870}}, - }}, - {name = "corshark", x = 3708, y = -41, z = 3267, rot = 4594, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2230, py = -41, pz = 2132}}, - }}, - {name = "corshark", x = 3970, y = -41, z = 3046, rot = 8316, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2491, py = -41, pz = 1911}}, - }}, - {name = "corshark", x = 3559, y = -41, z = 3368, rot = 5400, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2081, py = -41, pz = 2233}}, - }}, - {name = "corshark", x = 4104, y = -41, z = 2691, rot = 7498, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2625, py = -41, pz = 1556}}, - }}, - {name = "corshark", x = 3506, y = -41, z = 3398, rot = 4976, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2027, py = -41, pz = 2263}}, - }}, - {name = "corshark", x = 3889, y = -41, z = 3113, rot = 10484, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2411, py = -41, pz = 1978}}, - }}, - {name = "corshark", x = 3660, y = -41, z = 3303, rot = 4746, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2182, py = -41, pz = 2168}}, - }}, - {name = "corshark", x = 4036, y = -41, z = 2966, rot = 6577, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2557, py = -41, pz = 1831}}, - }}, - {name = "corshark", x = 3846, y = -41, z = 3154, rot = 5416, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2367, py = -41, pz = 2018}}, - }}, - {name = "corshark", x = 4078, y = -41, z = 2864, rot = 8478, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2600, py = -41, pz = 1729}}, - }}, - {name = "corshark", x = 3934, y = -41, z = 3078, rot = 6340, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2456, py = -41, pz = 1943}}, - }}, - {name = "corshark", x = 4084, y = -41, z = 2804, rot = 9219, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2606, py = -41, pz = 1669}}, - }}, - {name = "corshark", x = 4057, y = -41, z = 2919, rot = 7581, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2578, py = -41, pz = 1784}}, - }}, - {name = "corshark", x = 3748, y = -41, z = 3226, rot = 9738, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2269, py = -41, pz = 2091}}, - }}, - {name = "corshark", x = 3454, y = -41, z = 3430, rot = 8993, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 1975, py = -41, pz = 2295}}, - }}, - {name = "corshark", x = 3795, y = -41, z = 3186, rot = 5517, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2317, py = -41, pz = 2051}}, - }}, - {name = "corsjam", x = 2795, y = 0, z = 2285, rot = 10658, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3579, py = 0, pz = 2672}}, - }}, - {name = "corsjam", x = 3458, y = 0, z = 2924, rot = -24312, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 2651, py = 0, pz = 2110}}, - }}, - {name = "corssub", x = 2315, y = -81, z = 2807, rot = 13433, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 803, py = -81, pz = 2654}}, - }}, - {name = "corssub", x = 2231, y = -81, z = 2717, rot = 17969, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 1333, py = -81, pz = 2368}}, - }}, - {name = "corssub", x = 2582, y = -81, z = 3087, rot = 14196, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 3056, py = -81, pz = 3965}}, - }}, - {name = "corssub", x = 2485, y = -81, z = 2997, rot = 15927, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 2520, py = -81, pz = 4434}}, - }}, - {name = "corssub", x = 2393, y = -81, z = 2902, rot = 14020, teamID = 5, queue = { - {cmdID = CMD.PATROL, position = {px = 1324, py = -81, pz = 3610}}, - }}, - {name = "corssub", x = 3537, y = -81, z = 1988, rot = -13998, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 3041, py = -81, pz = 1033}}, - }}, - {name = "corssub", x = 3956, y = -81, z = 2412, rot = -13577, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 4819, py = -81, pz = 2597}}, - }}, - {name = "corssub", x = 3869, y = -81, z = 2293, rot = -12114, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 5260, py = -81, pz = 2368}}, - }}, - {name = "corssub", x = 3660, y = -81, z = 2072, rot = -15091, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 3407, py = -81, pz = 756}}, - }}, - {name = "corssub", x = 3774, y = -81, z = 2181, rot = -13382, teamID = 4, queue = { - {cmdID = CMD.PATROL, position = {px = 4997, py = -81, pz = 1632}}, - }}, - {name = "corarch", x = 401, y = 0, z = 3293, rot = -8268, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1076, py = 0, pz = 3071}}, - {cmdID = CMD.PATROL, position = {px = 2089, py = 0, pz = 2361}}, - {cmdID = CMD.PATROL, position = {px = 1632, py = 0, pz = 3700}}, - }}, - {name = "coracsub", x = 326, y = -81, z = 3389, rot = -14327, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1002, py = -81, pz = 3168}}, - {cmdID = CMD.PATROL, position = {px = 2014, py = -81, pz = 2457}}, - {cmdID = CMD.PATROL, position = {px = 1557, py = -81, pz = 3797}}, - }}, - {name = "coracsub", x = 87, y = -81, z = 3606, rot = -19391, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 763, py = -81, pz = 3384}}, - {cmdID = CMD.PATROL, position = {px = 1775, py = -81, pz = 2673}}, - {cmdID = CMD.PATROL, position = {px = 1318, py = -81, pz = 4013}}, - }}, - {name = "coracsub", x = 85, y = -81, z = 3245, rot = -14186, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 760, py = -81, pz = 3024}}, - {cmdID = CMD.PATROL, position = {px = 1772, py = -81, pz = 2313}}, - {cmdID = CMD.PATROL, position = {px = 1316, py = -81, pz = 3652}}, - }}, - {name = "corbats", x = 59, y = 0, z = 3128, rot = -17857, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 734, py = 0, pz = 2907}}, - {cmdID = CMD.PATROL, position = {px = 1746, py = 0, pz = 2196}}, - {cmdID = CMD.PATROL, position = {px = 1290, py = 0, pz = 3535}}, - }}, - {name = "corarch", x = 53, y = 0, z = 3494, rot = -12873, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 729, py = 0, pz = 3272}}, - {cmdID = CMD.PATROL, position = {px = 1741, py = 0, pz = 2562}}, - {cmdID = CMD.PATROL, position = {px = 1284, py = 0, pz = 3901}}, - }}, - {name = "corbats", x = 403, y = 0, z = 3127, rot = -13163, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1079, py = 0, pz = 2906}}, - {cmdID = CMD.PATROL, position = {px = 2091, py = 0, pz = 2195}}, - {cmdID = CMD.PATROL, position = {px = 1634, py = 0, pz = 3535}}, - }}, - {name = "corssub", x = 440, y = -81, z = 3711, rot = -16709, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1116, py = -81, pz = 3490}}, - {cmdID = CMD.PATROL, position = {px = 2128, py = -81, pz = 2779}}, - {cmdID = CMD.PATROL, position = {px = 1671, py = -81, pz = 4119}}, - }}, - {name = "corssub", x = 545, y = -81, z = 3306, rot = -19247, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1220, py = -81, pz = 3085}}, - {cmdID = CMD.PATROL, position = {px = 2232, py = -81, pz = 2374}}, - {cmdID = CMD.PATROL, position = {px = 1776, py = -81, pz = 3713}}, - }}, - {name = "corssub", x = 280, y = -81, z = 3014, rot = -17025, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 955, py = -81, pz = 2792}}, - {cmdID = CMD.PATROL, position = {px = 1967, py = -81, pz = 2081}}, - {cmdID = CMD.PATROL, position = {px = 1511, py = -81, pz = 3421}}, - }}, - {name = "corsjam", x = 181, y = 0, z = 3498, rot = -17266, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 856, py = 0, pz = 3277}}, - {cmdID = CMD.PATROL, position = {px = 1868, py = 0, pz = 2566}}, - {cmdID = CMD.PATROL, position = {px = 1412, py = 0, pz = 3906}}, - }}, - {name = "corsjam", x = 60, y = 0, z = 3679, rot = -19976, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 735, py = 0, pz = 3457}}, - {cmdID = CMD.PATROL, position = {px = 1748, py = 0, pz = 2747}}, - {cmdID = CMD.PATROL, position = {px = 1291, py = 0, pz = 4086}}, - }}, - {name = "corsjam", x = 314, y = 0, z = 3651, rot = -17396, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 990, py = 0, pz = 3430}}, - {cmdID = CMD.PATROL, position = {px = 2002, py = 0, pz = 2719}}, - {cmdID = CMD.PATROL, position = {px = 1545, py = 0, pz = 4059}}, - }}, - {name = "cordronecarry", x = 372, y = 0, z = 3418, rot = -14339, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 1048, py = 0, pz = 3196}}, - {cmdID = CMD.PATROL, position = {px = 2060, py = 0, pz = 2486}}, - {cmdID = CMD.PATROL, position = {px = 1603, py = 0, pz = 3825}}, - }}, - {name = "corcarry", x = 214, y = 0, z = 3129, rot = -16320, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 890, py = 0, pz = 2907}}, - {cmdID = CMD.PATROL, position = {px = 1902, py = 0, pz = 2197}}, - {cmdID = CMD.PATROL, position = {px = 1445, py = 0, pz = 3536}}, - }}, - {name = "cordronecarry", x = 73, y = 0, z = 3292, rot = -20175, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 749, py = 0, pz = 3070}}, - {cmdID = CMD.PATROL, position = {px = 1761, py = 0, pz = 2360}}, - {cmdID = CMD.PATROL, position = {px = 1304, py = 0, pz = 3699}}, - }}, - {name = "corbats", x = 231, y = 0, z = 3291, rot = -18175, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 907, py = 0, pz = 3070}}, - {cmdID = CMD.PATROL, position = {px = 1919, py = 0, pz = 2359}}, - {cmdID = CMD.PATROL, position = {px = 1462, py = 0, pz = 3699}}, - }}, - {name = "corarch", x = 189, y = 0, z = 3680, rot = -14214, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 865, py = 0, pz = 3459}}, - {cmdID = CMD.PATROL, position = {px = 1877, py = 0, pz = 2748}}, - {cmdID = CMD.PATROL, position = {px = 1420, py = 0, pz = 4088}}, - }}, - {name = "corssub", x = 4466, y = -81, z = 274, rot = 28841, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4086, py = -81, pz = 879}}, - {cmdID = CMD.PATROL, position = {px = 3547, py = -81, pz = 1335}}, - {cmdID = CMD.PATROL, position = {px = 4334, py = -81, pz = 1948}}, - }}, - {name = "coracsub", x = 4335, y = -81, z = 64, rot = 32023, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3954, py = -81, pz = 668}}, - {cmdID = CMD.PATROL, position = {px = 3415, py = -81, pz = 1125}}, - {cmdID = CMD.PATROL, position = {px = 4202, py = -81, pz = 1738}}, - }}, - {name = "coracsub", x = 4450, y = -81, z = 208, rot = 32023, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4069, py = -81, pz = 812}}, - {cmdID = CMD.PATROL, position = {px = 3531, py = -81, pz = 1269}}, - {cmdID = CMD.PATROL, position = {px = 4317, py = -81, pz = 1882}}, - }}, - {name = "cordronecarry", x = 4272, y = 0, z = 350, rot = 30329, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3892, py = 0, pz = 955}}, - {cmdID = CMD.PATROL, position = {px = 3353, py = 0, pz = 1411}}, - {cmdID = CMD.PATROL, position = {px = 4140, py = 0, pz = 2024}}, - }}, - {name = "corarch", x = 4380, y = 0, z = 199, rot = 29239, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3999, py = 0, pz = 803}}, - {cmdID = CMD.PATROL, position = {px = 3461, py = 0, pz = 1260}}, - {cmdID = CMD.PATROL, position = {px = 4247, py = 0, pz = 1873}}, - }}, - {name = "corarch", x = 4099, y = 0, z = 347, rot = -31268, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3718, py = 0, pz = 952}}, - {cmdID = CMD.PATROL, position = {px = 3180, py = 0, pz = 1409}}, - {cmdID = CMD.PATROL, position = {px = 3966, py = 0, pz = 2022}}, - }}, - {name = "corsjam", x = 4515, y = 0, z = 200, rot = -29184, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4135, py = 0, pz = 805}}, - {cmdID = CMD.PATROL, position = {px = 3596, py = 0, pz = 1262}}, - {cmdID = CMD.PATROL, position = {px = 4383, py = 0, pz = 1875}}, - }}, - {name = "corsjam", x = 4504, y = 0, z = 334, rot = 27574, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4124, py = 0, pz = 939}}, - {cmdID = CMD.PATROL, position = {px = 3585, py = 0, pz = 1395}}, - {cmdID = CMD.PATROL, position = {px = 4371, py = 0, pz = 2008}}, - }}, - {name = "corcarry", x = 4109, y = 0, z = 204, rot = 29517, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3728, py = 0, pz = 809}}, - {cmdID = CMD.PATROL, position = {px = 3190, py = 0, pz = 1265}}, - {cmdID = CMD.PATROL, position = {px = 3976, py = 0, pz = 1878}}, - }}, - {name = "coracsub", x = 4216, y = -81, z = 200, rot = 24493, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3836, py = -81, pz = 805}}, - {cmdID = CMD.PATROL, position = {px = 3297, py = -81, pz = 1261}}, - {cmdID = CMD.PATROL, position = {px = 4083, py = -81, pz = 1875}}, - }}, - {name = "corarch", x = 4549, y = 0, z = 64, rot = 24032, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4168, py = 0, pz = 668}}, - {cmdID = CMD.PATROL, position = {px = 3629, py = 0, pz = 1125}}, - {cmdID = CMD.PATROL, position = {px = 4416, py = 0, pz = 1738}}, - }}, - {name = "corbats", x = 4126, y = 0, z = 68, rot = 30890, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3746, py = 0, pz = 672}}, - {cmdID = CMD.PATROL, position = {px = 3207, py = 0, pz = 1129}}, - {cmdID = CMD.PATROL, position = {px = 3994, py = 0, pz = 1742}}, - }}, - {name = "corsjam", x = 4394, y = 0, z = 48, rot = 29167, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 4013, py = 0, pz = 653}}, - {cmdID = CMD.PATROL, position = {px = 3475, py = 0, pz = 1109}}, - {cmdID = CMD.PATROL, position = {px = 4261, py = 0, pz = 1722}}, - }}, - {name = "cordronecarry", x = 4283, y = 0, z = 65, rot = 20132, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3902, py = 0, pz = 669}}, - {cmdID = CMD.PATROL, position = {px = 3363, py = 0, pz = 1126}}, - {cmdID = CMD.PATROL, position = {px = 4150, py = 0, pz = 1739}}, - }}, - {name = "corssub", x = 4176, y = -81, z = 277, rot = 25315, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3795, py = -81, pz = 881}}, - {cmdID = CMD.PATROL, position = {px = 3257, py = -81, pz = 1338}}, - {cmdID = CMD.PATROL, position = {px = 4043, py = -81, pz = 1951}}, - }}, - {name = "corbats", x = 4271, y = 0, z = 211, rot = 32159, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3891, py = 0, pz = 816}}, - {cmdID = CMD.PATROL, position = {px = 3352, py = 0, pz = 1273}}, - {cmdID = CMD.PATROL, position = {px = 4139, py = 0, pz = 1886}}, - }}, - {name = "corbats", x = 4365, y = 0, z = 361, rot = -24568, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3985, py = 0, pz = 965}}, - {cmdID = CMD.PATROL, position = {px = 3446, py = 0, pz = 1422}}, - {cmdID = CMD.PATROL, position = {px = 4233, py = 0, pz = 2035}}, - }}, + { name = "corsub", x = 2395, y = -46, z = 1798, rot = -19024, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3752, py = -46, pz = 2807 } }, + } }, + { name = "corsub", x = 2101, y = -46, z = 2283, rot = -19135, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3458, py = -46, pz = 3292 } }, + } }, + { name = "corsub", x = 2526, y = -46, z = 1727, rot = -22660, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3883, py = -46, pz = 2736 } }, + } }, + { name = "corsub", x = 2174, y = -46, z = 2141, rot = -19743, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3532, py = -46, pz = 3150 } }, + } }, + { name = "corsub", x = 2273, y = -46, z = 1961, rot = -26036, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3630, py = -46, pz = 2970 } }, + } }, + { name = "corsub", x = 2225, y = -46, z = 2049, rot = -18900, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3582, py = -46, pz = 3058 } }, + } }, + { name = "corsub", x = 2481, y = -46, z = 1754, rot = -25613, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3838, py = -46, pz = 2763 } }, + } }, + { name = "corsub", x = 2299, y = -46, z = 1913, rot = -27608, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3656, py = -46, pz = 2922 } }, + } }, + { name = "corsub", x = 2152, y = -46, z = 2190, rot = -20447, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3509, py = -46, pz = 3199 } }, + } }, + { name = "corsub", x = 2355, y = -46, z = 1830, rot = -22140, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3712, py = -46, pz = 2839 } }, + } }, + { name = "corsub", x = 2324, y = -46, z = 1871, rot = -21438, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3681, py = -46, pz = 2880 } }, + } }, + { name = "corsub", x = 2564, y = -46, z = 1710, rot = -26779, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3921, py = -46, pz = 2720 } }, + } }, + { name = "corsub", x = 2597, y = -46, z = 1688, rot = -22725, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3954, py = -46, pz = 2697 } }, + } }, + { name = "corsub", x = 2671, y = -46, z = 1660, rot = -20204, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 4028, py = -46, pz = 2669 } }, + } }, + { name = "corsub", x = 2199, y = -46, z = 2094, rot = -24359, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3556, py = -46, pz = 3103 } }, + } }, + { name = "corsub", x = 2631, y = -46, z = 1664, rot = -23525, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3988, py = -46, pz = 2673 } }, + } }, + { name = "corsub", x = 2074, y = -46, z = 2325, rot = -27673, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3431, py = -46, pz = 3334 } }, + } }, + { name = "corsub", x = 2053, y = -46, z = 2367, rot = -28267, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3410, py = -46, pz = 3376 } }, + } }, + { name = "corsub", x = 2248, y = -46, z = 2002, rot = -29877, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3605, py = -46, pz = 3011 } }, + } }, + { name = "corsub", x = 2122, y = -46, z = 2234, rot = -20970, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3479, py = -46, pz = 3243 } }, + } }, + { name = "corsub", x = 2438, y = -46, z = 1775, rot = -28732, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3795, py = -46, pz = 2785 } }, + } }, + { name = "corshark", x = 4091, y = -41, z = 2745, rot = 4577, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2613, py = -41, pz = 1610 } }, + } }, + { name = "corshark", x = 3610, y = -41, z = 3333, rot = 6060, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2131, py = -41, pz = 2198 } }, + } }, + { name = "corshark", x = 3410, y = -41, z = 3460, rot = 9963, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 1932, py = -41, pz = 2325 } }, + } }, + { name = "corshark", x = 4005, y = -41, z = 3005, rot = 5265, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2527, py = -41, pz = 1870 } }, + } }, + { name = "corshark", x = 3708, y = -41, z = 3267, rot = 4594, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2230, py = -41, pz = 2132 } }, + } }, + { name = "corshark", x = 3970, y = -41, z = 3046, rot = 8316, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2491, py = -41, pz = 1911 } }, + } }, + { name = "corshark", x = 3559, y = -41, z = 3368, rot = 5400, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2081, py = -41, pz = 2233 } }, + } }, + { name = "corshark", x = 4104, y = -41, z = 2691, rot = 7498, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2625, py = -41, pz = 1556 } }, + } }, + { name = "corshark", x = 3506, y = -41, z = 3398, rot = 4976, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2027, py = -41, pz = 2263 } }, + } }, + { name = "corshark", x = 3889, y = -41, z = 3113, rot = 10484, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2411, py = -41, pz = 1978 } }, + } }, + { name = "corshark", x = 3660, y = -41, z = 3303, rot = 4746, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2182, py = -41, pz = 2168 } }, + } }, + { name = "corshark", x = 4036, y = -41, z = 2966, rot = 6577, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2557, py = -41, pz = 1831 } }, + } }, + { name = "corshark", x = 3846, y = -41, z = 3154, rot = 5416, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2367, py = -41, pz = 2018 } }, + } }, + { name = "corshark", x = 4078, y = -41, z = 2864, rot = 8478, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2600, py = -41, pz = 1729 } }, + } }, + { name = "corshark", x = 3934, y = -41, z = 3078, rot = 6340, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2456, py = -41, pz = 1943 } }, + } }, + { name = "corshark", x = 4084, y = -41, z = 2804, rot = 9219, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2606, py = -41, pz = 1669 } }, + } }, + { name = "corshark", x = 4057, y = -41, z = 2919, rot = 7581, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2578, py = -41, pz = 1784 } }, + } }, + { name = "corshark", x = 3748, y = -41, z = 3226, rot = 9738, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2269, py = -41, pz = 2091 } }, + } }, + { name = "corshark", x = 3454, y = -41, z = 3430, rot = 8993, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 1975, py = -41, pz = 2295 } }, + } }, + { name = "corshark", x = 3795, y = -41, z = 3186, rot = 5517, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2317, py = -41, pz = 2051 } }, + } }, + { name = "corsjam", x = 2795, y = 0, z = 2285, rot = 10658, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3579, py = 0, pz = 2672 } }, + } }, + { name = "corsjam", x = 3458, y = 0, z = 2924, rot = -24312, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 2651, py = 0, pz = 2110 } }, + } }, + { name = "corssub", x = 2315, y = -81, z = 2807, rot = 13433, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 803, py = -81, pz = 2654 } }, + } }, + { name = "corssub", x = 2231, y = -81, z = 2717, rot = 17969, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 1333, py = -81, pz = 2368 } }, + } }, + { name = "corssub", x = 2582, y = -81, z = 3087, rot = 14196, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 3056, py = -81, pz = 3965 } }, + } }, + { name = "corssub", x = 2485, y = -81, z = 2997, rot = 15927, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 2520, py = -81, pz = 4434 } }, + } }, + { name = "corssub", x = 2393, y = -81, z = 2902, rot = 14020, teamID = 5, queue = { + { cmdID = CMD.PATROL, position = { px = 1324, py = -81, pz = 3610 } }, + } }, + { name = "corssub", x = 3537, y = -81, z = 1988, rot = -13998, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 3041, py = -81, pz = 1033 } }, + } }, + { name = "corssub", x = 3956, y = -81, z = 2412, rot = -13577, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 4819, py = -81, pz = 2597 } }, + } }, + { name = "corssub", x = 3869, y = -81, z = 2293, rot = -12114, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 5260, py = -81, pz = 2368 } }, + } }, + { name = "corssub", x = 3660, y = -81, z = 2072, rot = -15091, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 3407, py = -81, pz = 756 } }, + } }, + { name = "corssub", x = 3774, y = -81, z = 2181, rot = -13382, teamID = 4, queue = { + { cmdID = CMD.PATROL, position = { px = 4997, py = -81, pz = 1632 } }, + } }, + { name = "corarch", x = 401, y = 0, z = 3293, rot = -8268, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1076, py = 0, pz = 3071 } }, + { cmdID = CMD.PATROL, position = { px = 2089, py = 0, pz = 2361 } }, + { cmdID = CMD.PATROL, position = { px = 1632, py = 0, pz = 3700 } }, + } }, + { name = "coracsub", x = 326, y = -81, z = 3389, rot = -14327, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1002, py = -81, pz = 3168 } }, + { cmdID = CMD.PATROL, position = { px = 2014, py = -81, pz = 2457 } }, + { cmdID = CMD.PATROL, position = { px = 1557, py = -81, pz = 3797 } }, + } }, + { name = "coracsub", x = 87, y = -81, z = 3606, rot = -19391, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 763, py = -81, pz = 3384 } }, + { cmdID = CMD.PATROL, position = { px = 1775, py = -81, pz = 2673 } }, + { cmdID = CMD.PATROL, position = { px = 1318, py = -81, pz = 4013 } }, + } }, + { name = "coracsub", x = 85, y = -81, z = 3245, rot = -14186, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 760, py = -81, pz = 3024 } }, + { cmdID = CMD.PATROL, position = { px = 1772, py = -81, pz = 2313 } }, + { cmdID = CMD.PATROL, position = { px = 1316, py = -81, pz = 3652 } }, + } }, + { name = "corbats", x = 59, y = 0, z = 3128, rot = -17857, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 734, py = 0, pz = 2907 } }, + { cmdID = CMD.PATROL, position = { px = 1746, py = 0, pz = 2196 } }, + { cmdID = CMD.PATROL, position = { px = 1290, py = 0, pz = 3535 } }, + } }, + { name = "corarch", x = 53, y = 0, z = 3494, rot = -12873, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 729, py = 0, pz = 3272 } }, + { cmdID = CMD.PATROL, position = { px = 1741, py = 0, pz = 2562 } }, + { cmdID = CMD.PATROL, position = { px = 1284, py = 0, pz = 3901 } }, + } }, + { name = "corbats", x = 403, y = 0, z = 3127, rot = -13163, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1079, py = 0, pz = 2906 } }, + { cmdID = CMD.PATROL, position = { px = 2091, py = 0, pz = 2195 } }, + { cmdID = CMD.PATROL, position = { px = 1634, py = 0, pz = 3535 } }, + } }, + { name = "corssub", x = 440, y = -81, z = 3711, rot = -16709, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1116, py = -81, pz = 3490 } }, + { cmdID = CMD.PATROL, position = { px = 2128, py = -81, pz = 2779 } }, + { cmdID = CMD.PATROL, position = { px = 1671, py = -81, pz = 4119 } }, + } }, + { name = "corssub", x = 545, y = -81, z = 3306, rot = -19247, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1220, py = -81, pz = 3085 } }, + { cmdID = CMD.PATROL, position = { px = 2232, py = -81, pz = 2374 } }, + { cmdID = CMD.PATROL, position = { px = 1776, py = -81, pz = 3713 } }, + } }, + { name = "corssub", x = 280, y = -81, z = 3014, rot = -17025, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 955, py = -81, pz = 2792 } }, + { cmdID = CMD.PATROL, position = { px = 1967, py = -81, pz = 2081 } }, + { cmdID = CMD.PATROL, position = { px = 1511, py = -81, pz = 3421 } }, + } }, + { name = "corsjam", x = 181, y = 0, z = 3498, rot = -17266, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 856, py = 0, pz = 3277 } }, + { cmdID = CMD.PATROL, position = { px = 1868, py = 0, pz = 2566 } }, + { cmdID = CMD.PATROL, position = { px = 1412, py = 0, pz = 3906 } }, + } }, + { name = "corsjam", x = 60, y = 0, z = 3679, rot = -19976, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 735, py = 0, pz = 3457 } }, + { cmdID = CMD.PATROL, position = { px = 1748, py = 0, pz = 2747 } }, + { cmdID = CMD.PATROL, position = { px = 1291, py = 0, pz = 4086 } }, + } }, + { name = "corsjam", x = 314, y = 0, z = 3651, rot = -17396, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 990, py = 0, pz = 3430 } }, + { cmdID = CMD.PATROL, position = { px = 2002, py = 0, pz = 2719 } }, + { cmdID = CMD.PATROL, position = { px = 1545, py = 0, pz = 4059 } }, + } }, + { name = "cordronecarry", x = 372, y = 0, z = 3418, rot = -14339, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 1048, py = 0, pz = 3196 } }, + { cmdID = CMD.PATROL, position = { px = 2060, py = 0, pz = 2486 } }, + { cmdID = CMD.PATROL, position = { px = 1603, py = 0, pz = 3825 } }, + } }, + { name = "corcarry", x = 214, y = 0, z = 3129, rot = -16320, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 890, py = 0, pz = 2907 } }, + { cmdID = CMD.PATROL, position = { px = 1902, py = 0, pz = 2197 } }, + { cmdID = CMD.PATROL, position = { px = 1445, py = 0, pz = 3536 } }, + } }, + { name = "cordronecarry", x = 73, y = 0, z = 3292, rot = -20175, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 749, py = 0, pz = 3070 } }, + { cmdID = CMD.PATROL, position = { px = 1761, py = 0, pz = 2360 } }, + { cmdID = CMD.PATROL, position = { px = 1304, py = 0, pz = 3699 } }, + } }, + { name = "corbats", x = 231, y = 0, z = 3291, rot = -18175, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 907, py = 0, pz = 3070 } }, + { cmdID = CMD.PATROL, position = { px = 1919, py = 0, pz = 2359 } }, + { cmdID = CMD.PATROL, position = { px = 1462, py = 0, pz = 3699 } }, + } }, + { name = "corarch", x = 189, y = 0, z = 3680, rot = -14214, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 865, py = 0, pz = 3459 } }, + { cmdID = CMD.PATROL, position = { px = 1877, py = 0, pz = 2748 } }, + { cmdID = CMD.PATROL, position = { px = 1420, py = 0, pz = 4088 } }, + } }, + { name = "corssub", x = 4466, y = -81, z = 274, rot = 28841, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4086, py = -81, pz = 879 } }, + { cmdID = CMD.PATROL, position = { px = 3547, py = -81, pz = 1335 } }, + { cmdID = CMD.PATROL, position = { px = 4334, py = -81, pz = 1948 } }, + } }, + { name = "coracsub", x = 4335, y = -81, z = 64, rot = 32023, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3954, py = -81, pz = 668 } }, + { cmdID = CMD.PATROL, position = { px = 3415, py = -81, pz = 1125 } }, + { cmdID = CMD.PATROL, position = { px = 4202, py = -81, pz = 1738 } }, + } }, + { name = "coracsub", x = 4450, y = -81, z = 208, rot = 32023, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4069, py = -81, pz = 812 } }, + { cmdID = CMD.PATROL, position = { px = 3531, py = -81, pz = 1269 } }, + { cmdID = CMD.PATROL, position = { px = 4317, py = -81, pz = 1882 } }, + } }, + { name = "cordronecarry", x = 4272, y = 0, z = 350, rot = 30329, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3892, py = 0, pz = 955 } }, + { cmdID = CMD.PATROL, position = { px = 3353, py = 0, pz = 1411 } }, + { cmdID = CMD.PATROL, position = { px = 4140, py = 0, pz = 2024 } }, + } }, + { name = "corarch", x = 4380, y = 0, z = 199, rot = 29239, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3999, py = 0, pz = 803 } }, + { cmdID = CMD.PATROL, position = { px = 3461, py = 0, pz = 1260 } }, + { cmdID = CMD.PATROL, position = { px = 4247, py = 0, pz = 1873 } }, + } }, + { name = "corarch", x = 4099, y = 0, z = 347, rot = -31268, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3718, py = 0, pz = 952 } }, + { cmdID = CMD.PATROL, position = { px = 3180, py = 0, pz = 1409 } }, + { cmdID = CMD.PATROL, position = { px = 3966, py = 0, pz = 2022 } }, + } }, + { name = "corsjam", x = 4515, y = 0, z = 200, rot = -29184, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4135, py = 0, pz = 805 } }, + { cmdID = CMD.PATROL, position = { px = 3596, py = 0, pz = 1262 } }, + { cmdID = CMD.PATROL, position = { px = 4383, py = 0, pz = 1875 } }, + } }, + { name = "corsjam", x = 4504, y = 0, z = 334, rot = 27574, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4124, py = 0, pz = 939 } }, + { cmdID = CMD.PATROL, position = { px = 3585, py = 0, pz = 1395 } }, + { cmdID = CMD.PATROL, position = { px = 4371, py = 0, pz = 2008 } }, + } }, + { name = "corcarry", x = 4109, y = 0, z = 204, rot = 29517, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3728, py = 0, pz = 809 } }, + { cmdID = CMD.PATROL, position = { px = 3190, py = 0, pz = 1265 } }, + { cmdID = CMD.PATROL, position = { px = 3976, py = 0, pz = 1878 } }, + } }, + { name = "coracsub", x = 4216, y = -81, z = 200, rot = 24493, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3836, py = -81, pz = 805 } }, + { cmdID = CMD.PATROL, position = { px = 3297, py = -81, pz = 1261 } }, + { cmdID = CMD.PATROL, position = { px = 4083, py = -81, pz = 1875 } }, + } }, + { name = "corarch", x = 4549, y = 0, z = 64, rot = 24032, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4168, py = 0, pz = 668 } }, + { cmdID = CMD.PATROL, position = { px = 3629, py = 0, pz = 1125 } }, + { cmdID = CMD.PATROL, position = { px = 4416, py = 0, pz = 1738 } }, + } }, + { name = "corbats", x = 4126, y = 0, z = 68, rot = 30890, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3746, py = 0, pz = 672 } }, + { cmdID = CMD.PATROL, position = { px = 3207, py = 0, pz = 1129 } }, + { cmdID = CMD.PATROL, position = { px = 3994, py = 0, pz = 1742 } }, + } }, + { name = "corsjam", x = 4394, y = 0, z = 48, rot = 29167, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 4013, py = 0, pz = 653 } }, + { cmdID = CMD.PATROL, position = { px = 3475, py = 0, pz = 1109 } }, + { cmdID = CMD.PATROL, position = { px = 4261, py = 0, pz = 1722 } }, + } }, + { name = "cordronecarry", x = 4283, y = 0, z = 65, rot = 20132, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3902, py = 0, pz = 669 } }, + { cmdID = CMD.PATROL, position = { px = 3363, py = 0, pz = 1126 } }, + { cmdID = CMD.PATROL, position = { px = 4150, py = 0, pz = 1739 } }, + } }, + { name = "corssub", x = 4176, y = -81, z = 277, rot = 25315, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3795, py = -81, pz = 881 } }, + { cmdID = CMD.PATROL, position = { px = 3257, py = -81, pz = 1338 } }, + { cmdID = CMD.PATROL, position = { px = 4043, py = -81, pz = 1951 } }, + } }, + { name = "corbats", x = 4271, y = 0, z = 211, rot = 32159, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3891, py = 0, pz = 816 } }, + { cmdID = CMD.PATROL, position = { px = 3352, py = 0, pz = 1273 } }, + { cmdID = CMD.PATROL, position = { px = 4139, py = 0, pz = 1886 } }, + } }, + { name = "corbats", x = 4365, y = 0, z = 361, rot = -24568, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3985, py = 0, pz = 965 } }, + { cmdID = CMD.PATROL, position = { px = 3446, py = 0, pz = 1422 } }, + { cmdID = CMD.PATROL, position = { px = 4233, py = 0, pz = 2035 } }, + } }, } local backupOne = { - {name = 'corsumo', x = 4367, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4677, py = 34, pz = 4530}}, - }}, - {name = 'corban', x = 4453, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4788, py = 34, pz = 4707}}, - }}, - {name = 'corspec', x = 4542, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4838, py = 34, pz = 4778}}, - }}, - {name = 'corsent', x = 4634, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4907, py = 34, pz = 4854}}, - }}, - {name = 'corfast', x = 4758, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4951, py = 34, pz = 4889}}, - }}, - {name = 'armconsul', x = 4868, y = 34, z = 5112, rot = 32767, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 4951, py = 34, pz = 4889}}, - }}, - {name = 'armmar', x = 1382, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1439, py = 34, pz = 326}}, - }}, - {name = 'armmanni', x = 1487, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1548, py = 34, pz = 399}}, - }}, - {name = 'armbull', x = 1584, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1645, py = 34, pz = 404}}, - }}, - {name = 'armmart', x = 1676, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1725, py = 34, pz = 403}}, - }}, - {name = 'armmart', x = 1770, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1809, py = 34, pz = 406}}, - }}, + { name = "corsumo", x = 4367, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4677, py = 34, pz = 4530 } }, + } }, + { name = "corban", x = 4453, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4788, py = 34, pz = 4707 } }, + } }, + { name = "corspec", x = 4542, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4838, py = 34, pz = 4778 } }, + } }, + { name = "corsent", x = 4634, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4907, py = 34, pz = 4854 } }, + } }, + { name = "corfast", x = 4758, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4951, py = 34, pz = 4889 } }, + } }, + { name = "armconsul", x = 4868, y = 34, z = 5112, rot = 32767, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 4951, py = 34, pz = 4889 } }, + } }, + { name = "armmar", x = 1382, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1439, py = 34, pz = 326 } }, + } }, + { name = "armmanni", x = 1487, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1548, py = 34, pz = 399 } }, + } }, + { name = "armbull", x = 1584, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1645, py = 34, pz = 404 } }, + } }, + { name = "armmart", x = 1676, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1725, py = 34, pz = 403 } }, + } }, + { name = "armmart", x = 1770, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1809, py = 34, pz = 406 } }, + } }, } local backupTwo = { - {name = 'corsumo', x = 4367, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4677, py = 34, pz = 4530}}, - }}, - {name = 'corkarg', x = 4453, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4788, py = 34, pz = 4707}}, - }}, - {name = 'corspec', x = 4542, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4838, py = 34, pz = 4778}}, - }}, - {name = 'corgol', x = 4634, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4907, py = 34, pz = 4854}}, - }}, - {name = 'corvroc', x = 4758, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { - {cmdID = CMD.MOVE, position = {px = 4951, py = 34, pz = 4889}}, - }}, - {name = 'armmerl', x = 1382, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1439, py = 34, pz = 326}}, - }}, - {name = 'armmerl', x = 1487, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1548, py = 34, pz = 399}}, - }}, - {name = 'armraz', x = 1584, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1645, py = 34, pz = 404}}, - }}, - {name = 'armyork', x = 1676, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1725, py = 34, pz = 403}}, - }}, - {name = 'armraz', x = 1770, y = 34, z = 4, rot = 0, teamID = 0, queue = { - {cmdID = CMD.MOVE, position = {px = 1809, py = 34, pz = 406}}, - }}, - {name = "coralab", x = 2928, y = 33, z = 288, rot = 0, teamID = 2, queue = {}}, - {name = "corshroud", x = 3520, y = 33, z = 80, rot = 0, teamID = 2, queue = {}}, - {name = "corshroud", x = 3072, y = 33, z = 224, rot = 0, teamID = 2, queue = {}}, - {name = "corgate", x = 3536, y = 33, z = 32, rot = 0, teamID = 2, queue = {}}, - {name = "corgate", x = 3120, y = 33, z = 224, rot = 0, teamID = 2, queue = {}}, - {name = "corvipe", x = 2856, y = 36, z = 584, rot = 0, teamID = 2, queue = {}}, - {name = "corvipe", x = 3176, y = 32, z = 728, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2800, y = 52, z = 576, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2768, y = 50, z = 544, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2736, y = 47, z = 512, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2704, y = 48, z = 480, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2688, y = 48, z = 448, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2656, y = 54, z = 416, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2624, y = 59, z = 384, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2608, y = 59, z = 352, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2608, y = 55, z = 320, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2592, y = 56, z = 288, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2592, y = 53, z = 256, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2592, y = 51, z = 224, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2592, y = 50, z = 192, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2576, y = 53, z = 160, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2576, y = 50, z = 128, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2576, y = 48, z = 96, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2560, y = 50, z = 64, rot = 0, teamID = 2, queue = {}}, - {name = "corfort", x = 2560, y = 47, z = 32, rot = 0, teamID = 2, queue = {}}, - {name = "corflak", x = 3040, y = 33, z = 224, rot = 0, teamID = 2, queue = {}}, - {name = "corfmd", x = 3600, y = 33, z = 32, rot = 0, teamID = 2, queue = {}}, - {name = "corsd", x = 3568, y = 33, z = 96, rot = 0, teamID = 2, queue = {}}, - {name = "corhlt", x = 2832, y = 36, z = 528, rot = 0, teamID = 2, queue = {}}, - {name = "corhlt", x = 3216, y = 33, z = 672, rot = 0, teamID = 2, queue = {}}, - {name = "cormaw", x = 2912, y = 33, z = 608, rot = 0, teamID = 2, queue = {}}, - {name = "cormaw", x = 3120, y = 32, z = 736, rot = 0, teamID = 2, queue = {}}, - {name = "corvp", x = 3288, y = 33, z = 296, rot = 0, teamID = 2, queue = {}}, + { name = "corsumo", x = 4367, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4677, py = 34, pz = 4530 } }, + } }, + { name = "corkarg", x = 4453, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4788, py = 34, pz = 4707 } }, + } }, + { name = "corspec", x = 4542, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4838, py = 34, pz = 4778 } }, + } }, + { name = "corgol", x = 4634, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4907, py = 34, pz = 4854 } }, + } }, + { name = "corvroc", x = 4758, y = 34, z = 5112, rot = 32767, teamID = 1, queue = { + { cmdID = CMD.MOVE, position = { px = 4951, py = 34, pz = 4889 } }, + } }, + { name = "armmerl", x = 1382, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1439, py = 34, pz = 326 } }, + } }, + { name = "armmerl", x = 1487, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1548, py = 34, pz = 399 } }, + } }, + { name = "armraz", x = 1584, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1645, py = 34, pz = 404 } }, + } }, + { name = "armyork", x = 1676, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1725, py = 34, pz = 403 } }, + } }, + { name = "armraz", x = 1770, y = 34, z = 4, rot = 0, teamID = 0, queue = { + { cmdID = CMD.MOVE, position = { px = 1809, py = 34, pz = 406 } }, + } }, + { name = "coralab", x = 2928, y = 33, z = 288, rot = 0, teamID = 2, queue = {} }, + { name = "corshroud", x = 3520, y = 33, z = 80, rot = 0, teamID = 2, queue = {} }, + { name = "corshroud", x = 3072, y = 33, z = 224, rot = 0, teamID = 2, queue = {} }, + { name = "corgate", x = 3536, y = 33, z = 32, rot = 0, teamID = 2, queue = {} }, + { name = "corgate", x = 3120, y = 33, z = 224, rot = 0, teamID = 2, queue = {} }, + { name = "corvipe", x = 2856, y = 36, z = 584, rot = 0, teamID = 2, queue = {} }, + { name = "corvipe", x = 3176, y = 32, z = 728, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2800, y = 52, z = 576, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2768, y = 50, z = 544, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2736, y = 47, z = 512, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2704, y = 48, z = 480, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2688, y = 48, z = 448, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2656, y = 54, z = 416, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2624, y = 59, z = 384, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2608, y = 59, z = 352, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2608, y = 55, z = 320, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2592, y = 56, z = 288, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2592, y = 53, z = 256, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2592, y = 51, z = 224, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2592, y = 50, z = 192, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2576, y = 53, z = 160, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2576, y = 50, z = 128, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2576, y = 48, z = 96, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2560, y = 50, z = 64, rot = 0, teamID = 2, queue = {} }, + { name = "corfort", x = 2560, y = 47, z = 32, rot = 0, teamID = 2, queue = {} }, + { name = "corflak", x = 3040, y = 33, z = 224, rot = 0, teamID = 2, queue = {} }, + { name = "corfmd", x = 3600, y = 33, z = 32, rot = 0, teamID = 2, queue = {} }, + { name = "corsd", x = 3568, y = 33, z = 96, rot = 0, teamID = 2, queue = {} }, + { name = "corhlt", x = 2832, y = 36, z = 528, rot = 0, teamID = 2, queue = {} }, + { name = "corhlt", x = 3216, y = 33, z = 672, rot = 0, teamID = 2, queue = {} }, + { name = "cormaw", x = 2912, y = 33, z = 608, rot = 0, teamID = 2, queue = {} }, + { name = "cormaw", x = 3120, y = 32, z = 736, rot = 0, teamID = 2, queue = {} }, + { name = "corvp", x = 3288, y = 33, z = 296, rot = 0, teamID = 2, queue = {} }, } local timed = { - {name = 'corblackhy', x = 5, y = 0, z = 3165, rot = 0, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 999, py = 0, pz = 2769}}, - }}, - {name = 'coracsub', x = 5, y = -80, z = 3238, rot = 0, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 1076, py = -80, pz = 2946}}, - }}, - {name = 'cormship', x = 5, y = 0, z = 3320, rot = 0, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 1304, py = 0, pz = 3226}}, - }}, - {name = 'corblackhy', x = 6127, y = 0, z = 1880, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 4997, py = 0, pz = 2356}}, - }}, - {name = 'coracsub', x = 6130, y = -80, z = 1734, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 5008, py = -80, pz = 2164}}, - }}, - {name = 'cormship', x = 6125, y = 0, z = 1556, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 4824, py = 0, pz = 1977}}, - }}, - {name = 'corsumo', x = 2791, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 2884, py = 33, pz = 4887}}, - }}, - {name = 'correap', x = 2738, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 2777, py = 33, pz = 4890}}, - }}, - {name = 'corspec', x = 2660, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 2703, py = 33, pz = 4881}}, - }}, - {name = 'corsent', x = 2600, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 2630, py = 33, pz = 4881}}, - }}, - {name = 'corack', x = 2520, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { - {cmdID = CMD.MOVE, position = {px = 2581, py = 33, pz = 4884}}, - }}, - {name = 'corshiva', x = 2851, y = 33, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corsumo', x = 2920, y = 33, z = 4, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 3100, py = 33, pz = 362}}, - }}, - {name = 'correap', x = 3056, y = 33, z = 4, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 3171, py = 33, pz = 362}}, - }}, - {name = 'corspec', x = 3144, y = 33, z = 4, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 3230, py = 33, pz = 362}}, - }}, - {name = 'corsent', x = 3235, y = 33, z = 4, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 3310, py = 33, pz = 362}}, - }}, - {name = 'corack', x = 3306, y = 33, z = 4, rot = 0, teamID = 2, queue = { - {cmdID = CMD.MOVE, position = {px = 3425, py = 33, pz = 362}}, - }}, - {name = 'corshiva', x = 2810, y = 33, z = 4, rot = 0, teamID = 2, queue = {}}, + { name = "corblackhy", x = 5, y = 0, z = 3165, rot = 0, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 999, py = 0, pz = 2769 } }, + } }, + { name = "coracsub", x = 5, y = -80, z = 3238, rot = 0, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 1076, py = -80, pz = 2946 } }, + } }, + { name = "cormship", x = 5, y = 0, z = 3320, rot = 0, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 1304, py = 0, pz = 3226 } }, + } }, + { name = "corblackhy", x = 6127, y = 0, z = 1880, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 4997, py = 0, pz = 2356 } }, + } }, + { name = "coracsub", x = 6130, y = -80, z = 1734, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 5008, py = -80, pz = 2164 } }, + } }, + { name = "cormship", x = 6125, y = 0, z = 1556, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 4824, py = 0, pz = 1977 } }, + } }, + { name = "corsumo", x = 2791, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 2884, py = 33, pz = 4887 } }, + } }, + { name = "correap", x = 2738, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 2777, py = 33, pz = 4890 } }, + } }, + { name = "corspec", x = 2660, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 2703, py = 33, pz = 4881 } }, + } }, + { name = "corsent", x = 2600, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 2630, py = 33, pz = 4881 } }, + } }, + { name = "corack", x = 2520, y = 33, z = 5110, rot = 32767, teamID = 3, queue = { + { cmdID = CMD.MOVE, position = { px = 2581, py = 33, pz = 4884 } }, + } }, + { name = "corshiva", x = 2851, y = 33, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corsumo", x = 2920, y = 33, z = 4, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 3100, py = 33, pz = 362 } }, + } }, + { name = "correap", x = 3056, y = 33, z = 4, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 3171, py = 33, pz = 362 } }, + } }, + { name = "corspec", x = 3144, y = 33, z = 4, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 3230, py = 33, pz = 362 } }, + } }, + { name = "corsent", x = 3235, y = 33, z = 4, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 3310, py = 33, pz = 362 } }, + } }, + { name = "corack", x = 3306, y = 33, z = 4, rot = 0, teamID = 2, queue = { + { cmdID = CMD.MOVE, position = { px = 3425, py = 33, pz = 362 } }, + } }, + { name = "corshiva", x = 2810, y = 33, z = 4, rot = 0, teamID = 2, queue = {} }, } local special = { - {name = 'corcrw', x = 6031, y = 150, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.FIGHT, position = {px = 5154, py = 130, pz = 4875}}, - }}, - {name = 'corcrw', x = 5970, y = 150, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.FIGHT, position = {px = 5822, py = 130, pz = 4892}}, - }}, - {name = 'corcrw', x = 5800, y = 150, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.FIGHT, position = {px = 3723, py = 130, pz = 4297}}, - }}, - {name = 'corcrw', x = 5750, y = 150, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.FIGHT, position = {px = 1830, py = 130, pz = 3256}}, - }}, - {name = 'corhunt', x = 5550, y = 130, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 5833, py = 130, pz = 2056}}, - {cmdID = CMD.PATROL, position = {px = 3973, py = 130, pz = 3035}}, - }}, - {name = 'corhunt', x = 5450, y = 130, z = 4, rot = 0, teamID = 4, queue = { - {cmdID = CMD.MOVE, position = {px = 3286, py = 130, pz = 938}}, - {cmdID = CMD.PATROL, position = {px = 2565, py = 130, pz = 41}}, - }}, - {name = 'corcrw', x = 160, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.FIGHT, position = {px = 242, py = 130, pz = 221}}, - }}, - {name = 'corcrw', x = 560, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.FIGHT, position = {px = 742, py = 130, pz = 264}}, - }}, - {name = 'corcrw', x = 180, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.FIGHT, position = {px = 1214, py = 130, pz = 399}}, - }}, - {name = 'corcrw', x = 210, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.FIGHT, position = {px = 1932, py = 130, pz = 556}}, - }}, - {name = 'corhunt', x = 330, y = 130, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 970, py = 130, pz = 2682}}, - {cmdID = CMD.PATROL, position = {px = 2272, py = 130, pz = 1943}}, - }}, - {name = 'corhunt', x = 400, y = 130, z = 5110, rot = 32767, teamID = 5, queue = { - {cmdID = CMD.MOVE, position = {px = 2982, py = 130, pz = 4094}}, - {cmdID = CMD.PATROL, position = {px = 3440, py = 130, pz = 5068}}, - }}, - {name = 'corcsa', x = 6000, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corcsa', x = 5930, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corcsa', x = 5870, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corhurc', x = 5700, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corhurc', x = 5650, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corhurc', x = 5600, y = 130, z = 4, rot = 0, teamID = 2, queue = {}}, - {name = 'corcsa', x = 50, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corcsa', x = 84, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corcsa', x = 128, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corhurc', x = 240, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corhurc', x = 270, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, - {name = 'corhurc', x = 300, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {}}, + { name = "corcrw", x = 6031, y = 150, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.FIGHT, position = { px = 5154, py = 130, pz = 4875 } }, + } }, + { name = "corcrw", x = 5970, y = 150, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.FIGHT, position = { px = 5822, py = 130, pz = 4892 } }, + } }, + { name = "corcrw", x = 5800, y = 150, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.FIGHT, position = { px = 3723, py = 130, pz = 4297 } }, + } }, + { name = "corcrw", x = 5750, y = 150, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.FIGHT, position = { px = 1830, py = 130, pz = 3256 } }, + } }, + { name = "corhunt", x = 5550, y = 130, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 5833, py = 130, pz = 2056 } }, + { cmdID = CMD.PATROL, position = { px = 3973, py = 130, pz = 3035 } }, + } }, + { name = "corhunt", x = 5450, y = 130, z = 4, rot = 0, teamID = 4, queue = { + { cmdID = CMD.MOVE, position = { px = 3286, py = 130, pz = 938 } }, + { cmdID = CMD.PATROL, position = { px = 2565, py = 130, pz = 41 } }, + } }, + { name = "corcrw", x = 160, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.FIGHT, position = { px = 242, py = 130, pz = 221 } }, + } }, + { name = "corcrw", x = 560, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.FIGHT, position = { px = 742, py = 130, pz = 264 } }, + } }, + { name = "corcrw", x = 180, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.FIGHT, position = { px = 1214, py = 130, pz = 399 } }, + } }, + { name = "corcrw", x = 210, y = 150, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.FIGHT, position = { px = 1932, py = 130, pz = 556 } }, + } }, + { name = "corhunt", x = 330, y = 130, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 970, py = 130, pz = 2682 } }, + { cmdID = CMD.PATROL, position = { px = 2272, py = 130, pz = 1943 } }, + } }, + { name = "corhunt", x = 400, y = 130, z = 5110, rot = 32767, teamID = 5, queue = { + { cmdID = CMD.MOVE, position = { px = 2982, py = 130, pz = 4094 } }, + { cmdID = CMD.PATROL, position = { px = 3440, py = 130, pz = 5068 } }, + } }, + { name = "corcsa", x = 6000, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corcsa", x = 5930, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corcsa", x = 5870, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corhurc", x = 5700, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corhurc", x = 5650, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corhurc", x = 5600, y = 130, z = 4, rot = 0, teamID = 2, queue = {} }, + { name = "corcsa", x = 50, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corcsa", x = 84, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corcsa", x = 128, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corhurc", x = 240, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corhurc", x = 270, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, + { name = "corhurc", x = 300, y = 130, z = 5110, rot = 32767, teamID = 3, queue = {} }, } local objectiveUnits = { - [1] = { - {name = 'mission_command_tower', x = 5814, y = 34, z = 4875, rot = 0, teamID = 1, queue = {}, objectiveUnitID = 2}, - --{name = 'mission_command_tower', x = 932, y = 34, z = 491, rot = 0, teamID = 0, queue = {}, objectiveUnitID = 3}, - }, + [1] = { + { name = "mission_command_tower", x = 5814, y = 34, z = 4875, rot = 0, teamID = 1, queue = {}, objectiveUnitID = 2 }, + --{name = 'mission_command_tower', x = 932, y = 34, z = 491, rot = 0, teamID = 0, queue = {}, objectiveUnitID = 3}, + }, } local objectiveUnitsAlive = {} local function Fail() - GG.wipeoutAllyTeam(0) -- kill all units when failed - GameOver = Spring.GameOver({2}) --winningAllyTeamN where N is Ally ID + GG.wipeoutAllyTeam(0) -- kill all units when failed + GameOver = Spring.GameOver({ 2 }) --winningAllyTeamN where N is Ally ID end local function Loadout() - for k , unit in pairs(loadout) do - if UnitDefNames[unit.name] then - -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - for i = 1, #unit.queue do - local order = unit.queue[i] - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end + for k, unit in pairs(loadout) do + if UnitDefNames[unit.name] then + -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + for i = 1, #unit.queue do + local order = unit.queue[i] + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end end function ObjectiveLoadout() - for i, unitGroup in ipairs(objectiveUnits) do - for j, unit in ipairs(unitGroup) do - if UnitDefNames[unit.name] then - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - objectiveUnitsAlive[unitID] = true - if unit.objectiveUnitID then - objectiveUnits[unitID] = unit.objectiveUnitID - end - for k, order in ipairs(unit.queue) do - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end - end + for i, unitGroup in ipairs(objectiveUnits) do + for j, unit in ipairs(unitGroup) do + if UnitDefNames[unit.name] then + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + objectiveUnitsAlive[unitID] = true + if unit.objectiveUnitID then + objectiveUnits[unitID] = unit.objectiveUnitID + end + for k, order in ipairs(unit.queue) do + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end + end end function gadget:UnitDestroyed(unitID, unitDefID) - if objectiveUnitsAlive[unitID] then -- check if it hasn't already died - objectiveUnitsAlive[unitID] = nil -- remove it - for i, unitGroup in ipairs(objectiveUnits) do - for j, unit in ipairs(unitGroup) do - if unit.objectiveUnitID == 2 then - Fail() - Spring.Echo('\n\n\nYOU LOST CRITICAL BUILDING!!\nMISSION FAILED!!!') - objectiveUnits[unitID] = nil - return - end - end - end - end + if objectiveUnitsAlive[unitID] then -- check if it hasn't already died + objectiveUnitsAlive[unitID] = nil -- remove it + for i, unitGroup in ipairs(objectiveUnits) do + for j, unit in ipairs(unitGroup) do + if unit.objectiveUnitID == 2 then + Fail() + Spring.Echo("\n\n\nYOU LOST CRITICAL BUILDING!!\nMISSION FAILED!!!") + objectiveUnits[unitID] = nil + return + end + end + end + end end local function BackupOne() - for k , unit in pairs(backupOne) do - if UnitDefNames[unit.name] then - -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - for i = 1, #unit.queue do - local order = unit.queue[i] - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end + for k, unit in pairs(backupOne) do + if UnitDefNames[unit.name] then + -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + for i = 1, #unit.queue do + local order = unit.queue[i] + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end end local function BackupTwo() - for k , unit in pairs(backupTwo) do - if UnitDefNames[unit.name] then - -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - for i = 1, #unit.queue do - local order = unit.queue[i] - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end + for k, unit in pairs(backupTwo) do + if UnitDefNames[unit.name] then + -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + for i = 1, #unit.queue do + local order = unit.queue[i] + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end end local function Timed() - for k , unit in pairs(timed) do - if UnitDefNames[unit.name] then - -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - for i = 1, #unit.queue do - local order = unit.queue[i] - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end + for k, unit in pairs(timed) do + if UnitDefNames[unit.name] then + -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + for i = 1, #unit.queue do + local order = unit.queue[i] + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end end local function Special() - for k , unit in pairs(special) do - if UnitDefNames[unit.name] then - -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) - local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) - for i = 1, #unit.queue do - local order = unit.queue[i] - local position = {order.position["px"], order.position["py"], order.position["pz"]} - Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) - end - end - end + for k, unit in pairs(special) do + if UnitDefNames[unit.name] then + -- Spring.Echo("trying to spawn a unit, synced is", Script.GetSynced()) + local unitID = Spring.CreateUnit(unit.name, unit.x, unit.y, unit.z, unit.rot, unit.teamID) + for i = 1, #unit.queue do + local order = unit.queue[i] + local position = { order.position["px"], order.position["py"], order.position["pz"] } + Spring.GiveOrderToUnit(unitID, order.cmdID, position, CMD.OPT_SHIFT) + end + end + end end function gadget:GameFrame(frameNum) - local n = frameNum - if n <= 1 then - Loadout() --Initial loadout with commands - ObjectiveLoadout() -- objective loadout - end - if n == 16200 then -- 9min - BackupOne() --One time insertion at certain GameFrame - end - if n == 32400 then -- 18min - BackupTwo() --One time insertion at certain GameFrame - end - if n>0 and n%14400 == 0 then -- 8min ((30frame/s *60sec)*8=14400 ) - Timed() --Looped insertion at certain GameFrame - end - if n>0 and n%36000 == 0 then -- 20min - Special() --Looped insertion at certain GameFrame - end -end \ No newline at end of file + local n = frameNum + if n <= 1 then + Loadout() --Initial loadout with commands + ObjectiveLoadout() -- objective loadout + end + if n == 16200 then -- 9min + BackupOne() --One time insertion at certain GameFrame + end + if n == 32400 then -- 18min + BackupTwo() --One time insertion at certain GameFrame + end + if n > 0 and n % 14400 == 0 then -- 8min ((30frame/s *60sec)*8=14400 ) + Timed() --Looped insertion at certain GameFrame + end + if n > 0 and n % 36000 == 0 then -- 20min + Special() --Looped insertion at certain GameFrame + end +end diff --git a/singleplayer/test_mission.lua b/singleplayer/test_mission.lua index 46eaff4f5a8..f39cdd4cfe4 100644 --- a/singleplayer/test_mission.lua +++ b/singleplayer/test_mission.lua @@ -1,5 +1,5 @@ -local triggerTypes = GG['MissionAPI'].TriggerTypes -local actionTypes = GG['MissionAPI'].ActionTypes +local triggerTypes = GG["MissionAPI"].TriggerTypes +local actionTypes = GG["MissionAPI"].ActionTypes local triggers = { testTime = { @@ -11,7 +11,7 @@ local triggers = { gameFrame = 150, interval = 60, }, - actions = { 'helloWorld' }, + actions = { "helloWorld" }, }, spawnHero = { @@ -23,7 +23,7 @@ local triggers = { gameFrame = 1, interval = 180, }, - actions = { 'spawnHero' }, + actions = { "spawnHero" }, }, despawnHero = { @@ -35,7 +35,7 @@ local triggers = { gameFrame = 90, interval = 180, }, - actions = { 'despawnHero' }, + actions = { "despawnHero" }, }, } @@ -50,8 +50,8 @@ local actions = { spawnHero = { type = actionTypes.SpawnUnits, parameters = { - name = 'hero', - unitDefName = 'corkorg', + name = "hero", + unitDefName = "corkorg", x = 100, z = 100, }, @@ -60,7 +60,7 @@ local actions = { despawnHero = { type = actionTypes.DespawnUnits, parameters = { - name = 'hero', + name = "hero", }, }, } @@ -68,4 +68,4 @@ local actions = { return { Triggers = triggers, Actions = actions, -} \ No newline at end of file +} diff --git a/sounds/voice/config.lua b/sounds/voice/config.lua index 0d8cd5b5048..57dced8a349 100644 --- a/sounds/voice/config.lua +++ b/sounds/voice/config.lua @@ -86,24 +86,23 @@ EventName = { end ]] - return { -- Commanders EnemyCommanderDied = { delay = 1, soundEffect = "EnemyComDead", - resetOtherEventDelay = {"NeutralCommanderDied"}, + resetOtherEventDelay = { "NeutralCommanderDied" }, }, FriendlyCommanderDied = { delay = 1, soundEffect = "FriendlyComDead", - resetOtherEventDelay = {"NeutralCommanderDied"}, + resetOtherEventDelay = { "NeutralCommanderDied" }, }, FriendlyCommanderSelfD = { delay = 1, soundEffect = "FriendlyComDead", - resetOtherEventDelay = {"NeutralCommanderSelfD"}, + resetOtherEventDelay = { "NeutralCommanderSelfD" }, }, NeutralCommanderDied = { delay = 1, @@ -177,52 +176,52 @@ return { TeammateCaughtUp = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerCaughtUp"}, + resetOtherEventDelay = { "NeutralPlayerCaughtUp" }, }, TeammateDisconnected = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerDisconnected"}, + resetOtherEventDelay = { "NeutralPlayerDisconnected" }, }, TeammateLagging = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerLagging"}, + resetOtherEventDelay = { "NeutralPlayerLagging" }, }, TeammateReconnected = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerReconnected"}, + resetOtherEventDelay = { "NeutralPlayerReconnected" }, }, TeammateResigned = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerResigned"}, + resetOtherEventDelay = { "NeutralPlayerResigned" }, }, TeammateTimedout = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerTimedout"}, + resetOtherEventDelay = { "NeutralPlayerTimedout" }, }, EnemyPlayerCaughtUp = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerCaughtUp"}, + resetOtherEventDelay = { "NeutralPlayerCaughtUp" }, }, EnemyPlayerDisconnected = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerDisconnected"}, + resetOtherEventDelay = { "NeutralPlayerDisconnected" }, }, EnemyPlayerLagging = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerLagging"}, + resetOtherEventDelay = { "NeutralPlayerLagging" }, }, EnemyPlayerReconnected = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerReconnected"}, + resetOtherEventDelay = { "NeutralPlayerReconnected" }, }, EnemyPlayerResigned = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerResigned"}, + resetOtherEventDelay = { "NeutralPlayerResigned" }, }, EnemyPlayerTimedout = { delay = 5, - resetOtherEventDelay = {"NeutralPlayerTimedout"}, + resetOtherEventDelay = { "NeutralPlayerTimedout" }, }, NeutralPlayerCaughtUp = { @@ -259,46 +258,44 @@ return { delay = 5, }, - UnitsUnderAttack = { delay = 60, stackedDelay = true, - resetOtherEventDelay = {"DefenseUnderAttack"}, + resetOtherEventDelay = { "DefenseUnderAttack" }, soundEffect = "UnitUnderAttack", }, DefenseUnderAttack = { delay = 60, stackedDelay = true, - resetOtherEventDelay = {"UnitsUnderAttack"}, + resetOtherEventDelay = { "UnitsUnderAttack" }, soundEffect = "UnitUnderAttack", }, EconomyUnderAttack = { delay = 30, stackedDelay = true, - resetOtherEventDelay = {"UnitsUnderAttack", "DefenseUnderAttack"}, + resetOtherEventDelay = { "UnitsUnderAttack", "DefenseUnderAttack" }, soundEffect = "UnitUnderAttack", }, FactoryUnderAttack = { delay = 30, stackedDelay = true, - resetOtherEventDelay = {"UnitsUnderAttack", "DefenseUnderAttack"}, + resetOtherEventDelay = { "UnitsUnderAttack", "DefenseUnderAttack" }, soundEffect = "UnitUnderAttack", }, CommanderUnderAttack = { delay = 10, stackedDelay = true, - resetOtherEventDelay = {"UnitsUnderAttack", "DefenseUnderAttack"}, + resetOtherEventDelay = { "UnitsUnderAttack", "DefenseUnderAttack" }, soundEffect = "CommanderUnderAttack", }, ComHeavyDamage = { delay = 10, stackedDelay = true, - resetOtherEventDelay = {"UnitsUnderAttack", "DefenseUnderAttack", "CommanderUnderAttack"}, + resetOtherEventDelay = { "UnitsUnderAttack", "DefenseUnderAttack", "CommanderUnderAttack" }, soundEffect = "CommanderHeavilyDamaged", }, - UnitLost = { -- Master Event delay = 60, stackedDelay = true, @@ -308,20 +305,20 @@ return { RadarLost = { delay = 30, stackedDelay = true, - resetOtherEventDelay = {"UnitLost", "RadarLost"}, + resetOtherEventDelay = { "UnitLost", "RadarLost" }, soundEffect = "UnitUnderAttack", }, AdvancedRadarLost = { delay = 30, stackedDelay = true, - resetOtherEventDelay = {"UnitLost", "AdvancedRadarLost"}, + resetOtherEventDelay = { "UnitLost", "AdvancedRadarLost" }, soundEffect = "UnitUnderAttack", }, MetalExtractorLost = { delay = 30, stackedDelay = true, - resetOtherEventDelay = {"UnitLost"}, + resetOtherEventDelay = { "UnitLost" }, soundEffect = "UnitUnderAttack", }, @@ -373,7 +370,7 @@ return { NukeLaunched = { delay = 5, soundEffect = "NukeAlert", - resetOtherEventDelay = {"AlliedNukeLaunched"}, + resetOtherEventDelay = { "AlliedNukeLaunched" }, stackedDelay = true, }, AlliedNukeLaunched = { @@ -430,12 +427,12 @@ return { ["UnitReady/FusionIsReady"] = { delay = 120, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"AdvancedFusionIsReady"}, + rulesPlayOnlyIfDisabled = { "AdvancedFusionIsReady" }, }, ["UnitReady/AdvancedFusionIsReady"] = { delay = 120, stackedDelay = true, - rulesEnable = {"AdvancedFusionIsReady"}, + rulesEnable = { "AdvancedFusionIsReady" }, }, ["UnitReady/NuclearSiloIsReady"] = { delay = 120, @@ -443,15 +440,15 @@ return { }, ["UnitReady/Tech2UnitReady"] = { delay = 9999999, - rulesEnable = {"PlayerHasTech2"}, + rulesEnable = { "PlayerHasTech2" }, }, ["UnitReady/Tech3UnitReady"] = { delay = 9999999, - rulesEnable = {"PlayerHasTech2", "PlayerHasTech3"}, + rulesEnable = { "PlayerHasTech2", "PlayerHasTech3" }, }, ["UnitReady/Tech4UnitReady"] = { delay = 9999999, - rulesEnable = {"PlayerHasTech2", "PlayerHasTech3","PlayerHasTech4"}, + rulesEnable = { "PlayerHasTech2", "PlayerHasTech3", "PlayerHasTech4" }, }, Tech2TeamReached = { delay = 9999999, @@ -466,15 +463,15 @@ return { -- Units Detected ["UnitDetected/Tech2UnitDetected"] = { delay = 9999999, - rulesEnable = {"Tech2UnitDetected"}, + rulesEnable = { "Tech2UnitDetected" }, }, ["UnitDetected/Tech3UnitDetected"] = { delay = 9999999, - rulesEnable = {"Tech2UnitDetected", "Tech3UnitDetected"}, + rulesEnable = { "Tech2UnitDetected", "Tech3UnitDetected" }, }, ["UnitDetected/Tech4UnitDetected"] = { delay = 9999999, - rulesEnable = {"Tech2UnitDetected", "Tech3UnitDetected", "Tech4UnitDetected"}, + rulesEnable = { "Tech2UnitDetected", "Tech3UnitDetected", "Tech4UnitDetected" }, }, --FatboyDetected = { -- delay = 300, @@ -551,34 +548,34 @@ return { ["UnitDetected/TitanDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, ["UnitDetected/ThorDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, -- Cortex ["UnitDetected/JuggernautDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, ["UnitDetected/BehemothDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, -- Legion ["UnitDetected/SolinvictusDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, ["UnitDetected/AstraeusDetected"] = { delay = 120, stackedDelay = true, - rulesEnable = {"Tech3-5UnitDetected"}, + rulesEnable = { "Tech3-5UnitDetected" }, }, -- Tech 3 - 180 sec delay @@ -586,118 +583,118 @@ return { ["UnitDetected/RazorbackDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/MarauderDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/VanguardDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/LunkheadDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/EpochDetected"] = { -- Flagships should be considered T3 for this context, despite being built from T2 factory. delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, -- Cortex ["UnitDetected/DemonDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/ShivaDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/CataphractDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/KarganethDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/CatapultDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/BlackHydraDetected"] = { -- Flagships should be considered T3 for this context, despite being built from T2 factory. delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, -- Legion ["UnitDetected/PraetorianDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/JavelinDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/MyrmidonDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/KeresDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/CharybdisDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/DaedalusDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/NeptuneDetected"] = { -- Flagships should be considered T3 for this context, despite being built from T2 factory. delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, ["UnitDetected/CorinthDetected"] = { -- Flagships should be considered T3 for this context, despite being built from T2 factory. delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech4UnitDetected"}, - rulesEnable = {"Tech3UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech4UnitDetected" }, + rulesEnable = { "Tech3UnitDetected" }, }, -- Other ["UnitDetected/FlagshipDetected"] = { -- Flagships should be considered T3 for this context, despite being built from T2 factory. @@ -710,112 +707,112 @@ return { ["UnitDetected/StarlightDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/AmbassadorDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/FatboyDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/SharpshooterDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, -- Cortex ["UnitDetected/MammothDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/ArbiterDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/TzarDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/NegotiatorDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/TremorDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/BanisherDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/DragonDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, -- Legion ["UnitDetected/ThanatosDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/ArquebusDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/IncineratorDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/PrometheusDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/MedusaDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/InfernoDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/TyrannusDetected"] = { delay = 180, stackedDelay = true, - rulesPlayOnlyIfDisabled = {"Tech3-5UnitDetected", "Tech4UnitDetected"}, - rulesEnable = {"Tech2-5UnitDetected"}, + rulesPlayOnlyIfDisabled = { "Tech3-5UnitDetected", "Tech4UnitDetected" }, + rulesEnable = { "Tech2-5UnitDetected" }, }, ["UnitDetected/LicheDetected"] = { -- Scary one, so shorter delay delay = 30, @@ -940,5 +937,4 @@ return { delay = 10, soundEffect = "YourTeamHasTheLastCommander", -- Placeholder }, - } diff --git a/spec/builder_specs/engine_synced_builder_spec.lua b/spec/builder_specs/engine_synced_builder_spec.lua new file mode 100644 index 00000000000..bde84b45de9 --- /dev/null +++ b/spec/builder_specs/engine_synced_builder_spec.lua @@ -0,0 +1,34 @@ +local Builders = VFS.Include("spec/builders/index.lua") + +describe("EngineSyncedBuilder", function() + it("should build spring mocks with teams", function() + local team1 = Builders.Team.new():WithUnit("armcom") + local team2 = Builders.Team.new():WithUnit("corcom"):AI() + local spring = Builders.EngineSynced.new():WithTeam(team1):WithTeam(team2):WithAlliance(team1.id, team2.id, true):Build() + + assert.is_table(spring) + + assert.is_true(spring.AreTeamsAllied(team1.id, team2.id)) + + local teamUnits = spring.GetTeamUnits(team1.id) + assert.is_not_nil(teamUnits) + ---@cast teamUnits number[] + assert.are.equal(1, #teamUnits) + end) + + it("should integrate real unit definitions", function() + local teamBuilder = Builders.Team.new():WithUnit("armacv") + local spring = Builders.EngineSynced.new():WithRealUnitDefs():WithTeam(teamBuilder):Build() + + local teamUnits = spring.GetTeamUnits(teamBuilder.id) + assert.is_not_nil(teamUnits) + ---@cast teamUnits number[] + assert.are.equal(1, #teamUnits) + local unitId = teamUnits[1] + local unitDefId = spring.GetUnitDefID(unitId) + assert.are.equal("armacv", unitDefId) + + local unitDef = spring.GetUnitDefs()[unitDefId] + assert.are.equal(unitDef.customparams.techlevel, 2) + end) +end) diff --git a/spec/builder_specs/engine_unsynced_builder_spec.lua b/spec/builder_specs/engine_unsynced_builder_spec.lua new file mode 100644 index 00000000000..f59f5ed1366 --- /dev/null +++ b/spec/builder_specs/engine_unsynced_builder_spec.lua @@ -0,0 +1,148 @@ +local Builders = VFS.Include("spec/builders/index.lua") + +-- A throwaway widget on disk used to exercise the builder. Written once, +-- removed in the final test. Kept tiny: it records what the env exposes, +-- then reads/writes through the standard widget surface. +local TMP_WIDGET_PATH = "spec/builder_specs/_tmp_unsynced_widget.lua" + +local TMP_WIDGET_SOURCE = [[ +local function GetInfo() return { name = "tmp_unsynced" } end + +local seen = { + unitDefs = UnitDefs, + platformGl = Platform and Platform.gl, + isHeadless = not (Platform and Platform.gl), +} + +function widget:Initialize() + WG["tmp_unsynced"] = { + seen = seen, + callGiveOrder = function(unitID, cmdID) + Spring.GiveOrderToUnit(unitID, cmdID, {}, {}) + end, + callGiveOrderArray = function(unitIDs, orders) + Spring.GiveOrderArrayToUnitArray(unitIDs, orders, {}) + end, + getUnitDefID = function(id) return Spring.GetUnitDefID(id) end, + } +end + +return GetInfo +]] + +local function writeTmpWidget() + local f = io.open(TMP_WIDGET_PATH, "w") + if not f then + error("could not open " .. TMP_WIDGET_PATH) + end + f:write(TMP_WIDGET_SOURCE) + f:close() +end + +local function removeTmpWidget() + os.remove(TMP_WIDGET_PATH) +end + +describe("EngineUnsyncedBuilder", function() + setup(writeTmpWidget) + teardown(removeTmpWidget) + + it("loads a widget into a sandboxed env and runs Initialize", function() + local widget = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + assert.is_table(widget.WG.tmp_unsynced) + end) + + it("defaults to headless (Platform.gl is falsy)", function() + local widget = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + assert.is_true(widget.WG.tmp_unsynced.seen.isHeadless) + end) + + it("exposes UnitDefs registered via WithUnitDef", function() + local widget = Builders.EngineUnsynced.new():WithUnitDef(7, { name = "armcom", buildSpeed = 100 }):LoadWidget(TMP_WIDGET_PATH) + + local seenDefs = widget.WG.tmp_unsynced.seen.unitDefs + assert.equals("armcom", seenDefs[7].name) + end) + + it("maps unit IDs to def IDs by numeric defID", function() + local widget = Builders.EngineUnsynced.new():WithUnitDef(7, { name = "armcom", buildSpeed = 100 }):WithUnit(42, 7):LoadWidget(TMP_WIDGET_PATH) + + assert.equals(7, widget.WG.tmp_unsynced.getUnitDefID(42)) + assert.is_nil(widget.WG.tmp_unsynced.getUnitDefID(99)) + end) + + it("WithUnit by unknown numeric defID errors", function() + assert.has_error(function() + Builders.EngineUnsynced.new():WithUnit(1, 999) + end) + end) + + it("resolves WithUnit by name when the def has been registered", function() + local widget = Builders.EngineUnsynced.new():WithUnitDef(7, { name = "armcom", buildSpeed = 100 }):WithUnit(42, "armcom"):LoadWidget(TMP_WIDGET_PATH) + + assert.equals(7, widget.WG.tmp_unsynced.getUnitDefID(42)) + end) + + it("WithUnit by unknown name errors with a helpful message", function() + assert.has_error(function() + Builders.EngineUnsynced.new():WithUnit(1, "nonesuch") + end) + end) + + it("WithUnitDef accepts a UnitDefBuilder", function() + local widget = Builders.EngineUnsynced.new():WithUnitDef(Builders.UnitDef.new("armcon"):WithDefID(100):WithSpeed(100):Builds(10, 11)):LoadWidget(TMP_WIDGET_PATH) + + local defs = widget.WG.tmp_unsynced.seen.unitDefs + assert.equals("armcon", defs[100].name) + assert.equals(100, defs[100].buildSpeed) + assert.same({ 10, 11 }, defs[100].buildOptions) + end) + + it("captureUnitOrders records GiveOrderToUnit calls", function() + local widget = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + local calls = widget.captureUnitOrders() + + widget.WG.tmp_unsynced.callGiveOrder(5, -10) + widget.WG.tmp_unsynced.callGiveOrder(6, -11) + + assert.equals(2, #calls) + assert.same({ unitID = 5, cmdID = -10, params = {} }, calls[1]) + assert.same({ unitID = 6, cmdID = -11, params = {} }, calls[2]) + end) + + it("captureArrayOrders records GiveOrderArrayToUnitArray calls", function() + local widget = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + local calls = widget.captureArrayOrders() + + widget.WG.tmp_unsynced.callGiveOrderArray({ 1, 2 }, { { -10 }, { -11 } }) + + assert.equals(1, #calls) + assert.same({ 1, 2 }, calls[1].unitIDs) + assert.same({ { -10 }, { -11 } }, calls[1].orders) + end) + + it("WithSpringFn overrides individual Spring functions", function() + local widget = Builders.EngineUnsynced + .new() + :WithSpringFn("GetMyTeamID", function() + return 99 + end) + :LoadWidget(TMP_WIDGET_PATH) + + assert.equals(99, widget.env.Spring.GetMyTeamID()) + end) + + it("WithVFSInclude overrides VFS.Include for a specific path", function() + local widget = Builders.EngineUnsynced.new():WithVFSInclude("any/fake/path.lua", { sentinel = true }):LoadWidget(TMP_WIDGET_PATH) + + local result = widget.env.VFS.Include("any/fake/path.lua") + assert.is_true(result.sentinel) + end) + + it("each LoadWidget call yields an isolated env", function() + local a = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + local b = Builders.EngineUnsynced.new():LoadWidget(TMP_WIDGET_PATH) + assert.are_not.equal(a.env, b.env) + assert.are_not.equal(a.WG, b.WG) + end) +end) diff --git a/spec/builder_specs/spring_synced_builder_spec.lua b/spec/builder_specs/spring_synced_builder_spec.lua deleted file mode 100644 index c4b532bb363..00000000000 --- a/spec/builder_specs/spring_synced_builder_spec.lua +++ /dev/null @@ -1,41 +0,0 @@ -local Builders = VFS.Include("spec/builders/index.lua") - -describe("SpringSyncedBuilder", function() - it("should build spring mocks with teams", function() - local team1 = Builders.Team.new():WithUnit("armcom") - local team2 = Builders.Team.new():WithUnit("corcom"):AI() - local spring = Builders.Spring.new() - :WithTeam(team1) - :WithTeam(team2) - :WithAlliance(team1.id, team2.id, true) - :Build() - - assert.is_table(spring) - - assert.is_true(spring.AreTeamsAllied(team1.id, team2.id)) - - local teamUnits = spring.GetTeamUnits(team1.id) - assert.is_not_nil(teamUnits) - ---@cast teamUnits number[] - assert.are.equal(1, #teamUnits) - end) - - it("should integrate real unit definitions", function() - local teamBuilder = Builders.Team.new():WithUnit("armacv") - local spring = Builders.Spring.new() - :WithRealUnitDefs() - :WithTeam(teamBuilder) - :Build() - - local teamUnits = spring.GetTeamUnits(teamBuilder.id) - assert.is_not_nil(teamUnits) - ---@cast teamUnits number[] - assert.are.equal(1, #teamUnits) - local unitId = teamUnits[1] - local unitDefId = spring.GetUnitDefID(unitId) - assert.are.equal("armacv", unitDefId) - - local unitDef = spring.GetUnitDefs()[unitDefId] - assert.are.equal(unitDef.customparams.techlevel, 2) - end) -end) \ No newline at end of file diff --git a/spec/builder_specs/spring_unsynced_builder_spec.lua b/spec/builder_specs/spring_unsynced_builder_spec.lua deleted file mode 100644 index 6853d06e987..00000000000 --- a/spec/builder_specs/spring_unsynced_builder_spec.lua +++ /dev/null @@ -1,155 +0,0 @@ -local Builders = VFS.Include("spec/builders/index.lua") - --- A throwaway widget on disk used to exercise the builder. Written once, --- removed in the final test. Kept tiny: it records what the env exposes, --- then reads/writes through the standard widget surface. -local TMP_WIDGET_PATH = "spec/builder_specs/_tmp_unsynced_widget.lua" - -local TMP_WIDGET_SOURCE = [[ -local function GetInfo() return { name = "tmp_unsynced" } end - -local seen = { - unitDefs = UnitDefs, - platformGl = Platform and Platform.gl, - isHeadless = not (Platform and Platform.gl), -} - -function widget:Initialize() - WG["tmp_unsynced"] = { - seen = seen, - callGiveOrder = function(unitID, cmdID) - Spring.GiveOrderToUnit(unitID, cmdID, {}, {}) - end, - callGiveOrderArray = function(unitIDs, orders) - Spring.GiveOrderArrayToUnitArray(unitIDs, orders, {}) - end, - getUnitDefID = function(id) return Spring.GetUnitDefID(id) end, - } -end - -return GetInfo -]] - -local function writeTmpWidget() - local f = io.open(TMP_WIDGET_PATH, "w") - if not f then error("could not open " .. TMP_WIDGET_PATH) end - f:write(TMP_WIDGET_SOURCE) - f:close() -end - -local function removeTmpWidget() - os.remove(TMP_WIDGET_PATH) -end - -describe("SpringUnsyncedBuilder", function() - setup(writeTmpWidget) - teardown(removeTmpWidget) - - it("loads a widget into a sandboxed env and runs Initialize", function() - local widget = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - assert.is_table(widget.WG.tmp_unsynced) - end) - - it("defaults to headless (Platform.gl is falsy)", function() - local widget = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - assert.is_true(widget.WG.tmp_unsynced.seen.isHeadless) - end) - - it("exposes UnitDefs registered via WithUnitDef", function() - local widget = Builders.SpringUnsynced.new() - :WithUnitDef(7, { name = "armcom", buildSpeed = 100 }) - :LoadWidget(TMP_WIDGET_PATH) - - local seenDefs = widget.WG.tmp_unsynced.seen.unitDefs - assert.equals("armcom", seenDefs[7].name) - end) - - it("maps unit IDs to def IDs by numeric defID", function() - local widget = Builders.SpringUnsynced.new() - :WithUnitDef(7, { name = "armcom", buildSpeed = 100 }) - :WithUnit(42, 7) - :LoadWidget(TMP_WIDGET_PATH) - - assert.equals(7, widget.WG.tmp_unsynced.getUnitDefID(42)) - assert.is_nil(widget.WG.tmp_unsynced.getUnitDefID(99)) - end) - - it("WithUnit by unknown numeric defID errors", function() - assert.has_error(function() - Builders.SpringUnsynced.new():WithUnit(1, 999) - end) - end) - - it("resolves WithUnit by name when the def has been registered", function() - local widget = Builders.SpringUnsynced.new() - :WithUnitDef(7, { name = "armcom", buildSpeed = 100 }) - :WithUnit(42, "armcom") - :LoadWidget(TMP_WIDGET_PATH) - - assert.equals(7, widget.WG.tmp_unsynced.getUnitDefID(42)) - end) - - it("WithUnit by unknown name errors with a helpful message", function() - assert.has_error(function() - Builders.SpringUnsynced.new():WithUnit(1, "nonesuch") - end) - end) - - it("WithUnitDef accepts a UnitDefBuilder", function() - local widget = Builders.SpringUnsynced.new() - :WithUnitDef(Builders.UnitDef.new("armcon"):WithDefID(100):WithSpeed(100):Builds(10, 11)) - :LoadWidget(TMP_WIDGET_PATH) - - local defs = widget.WG.tmp_unsynced.seen.unitDefs - assert.equals("armcon", defs[100].name) - assert.equals(100, defs[100].buildSpeed) - assert.same({ 10, 11 }, defs[100].buildOptions) - end) - - it("captureUnitOrders records GiveOrderToUnit calls", function() - local widget = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - local calls = widget.captureUnitOrders() - - widget.WG.tmp_unsynced.callGiveOrder(5, -10) - widget.WG.tmp_unsynced.callGiveOrder(6, -11) - - assert.equals(2, #calls) - assert.same({ unitID = 5, cmdID = -10, params = {} }, calls[1]) - assert.same({ unitID = 6, cmdID = -11, params = {} }, calls[2]) - end) - - it("captureArrayOrders records GiveOrderArrayToUnitArray calls", function() - local widget = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - local calls = widget.captureArrayOrders() - - widget.WG.tmp_unsynced.callGiveOrderArray({ 1, 2 }, { { -10 }, { -11 } }) - - assert.equals(1, #calls) - assert.same({ 1, 2 }, calls[1].unitIDs) - assert.same({ { -10 }, { -11 } }, calls[1].orders) - end) - - it("WithSpringFn overrides individual Spring functions", function() - local widget = Builders.SpringUnsynced.new() - :WithSpringFn("GetMyTeamID", function() return 99 end) - :LoadWidget(TMP_WIDGET_PATH) - - assert.equals(99, widget.env.Spring.GetMyTeamID()) - end) - - it("WithVFSInclude overrides VFS.Include for a specific path", function() - local widget = Builders.SpringUnsynced.new() - :WithVFSInclude("any/fake/path.lua", { sentinel = true }) - :LoadWidget(TMP_WIDGET_PATH) - - local result = widget.env.VFS.Include("any/fake/path.lua") - assert.is_true(result.sentinel) - end) - - it("each LoadWidget call yields an isolated env", function() - local a = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - local b = Builders.SpringUnsynced.new():LoadWidget(TMP_WIDGET_PATH) - assert.are_not.equal(a.env, b.env) - assert.are_not.equal(a.WG, b.WG) - end) -end) diff --git a/spec/builder_specs/team_builder_spec.lua b/spec/builder_specs/team_builder_spec.lua index 2c37f158871..c04bdadf775 100644 --- a/spec/builder_specs/team_builder_spec.lua +++ b/spec/builder_specs/team_builder_spec.lua @@ -1,25 +1,23 @@ local Builders = VFS.Include("spec/builders/index.lua") describe("TeamBuilder", function() - it("should create teams with unique IDs", function() - local team1 = Builders.Team.new() - local team2 = Builders.Team.new() - assert.is_number(team1.id) - assert.is_number(team2.id) - assert.are_not.equal(team1.id, team2.id) - end) + it("should create teams with unique IDs", function() + local team1 = Builders.Team.new() + local team2 = Builders.Team.new() + assert.is_number(team1.id) + assert.is_number(team2.id) + assert.are_not.equal(team1.id, team2.id) + end) - it("should build teams with units", function() - local team = Builders.Team.new() - :WithMetal(500) - :WithUnit("armcom") - :WithUnit("corcom") - :Build() + it("should build teams with units", function() + local team = Builders.Team.new():WithMetal(500):WithUnit("armcom"):WithUnit("corcom"):Build() - ---@diagnostic disable-next-line: undefined-field - assert.are.equal(500, team.metal.current) - local unitCount = 0 - for _ in pairs(team.units) do unitCount = unitCount + 1 end - assert.are.equal(2, unitCount) - end) + ---@diagnostic disable-next-line: undefined-field + assert.are.equal(500, team.metal.current) + local unitCount = 0 + for _ in pairs(team.units) do + unitCount = unitCount + 1 + end + assert.are.equal(2, unitCount) + end) end) diff --git a/spec/builders/engine_synced_builder.lua b/spec/builders/engine_synced_builder.lua new file mode 100644 index 00000000000..72c5530cbd0 --- /dev/null +++ b/spec/builders/engine_synced_builder.lua @@ -0,0 +1,901 @@ +-- Ensure TeamData type is available +local ResourceTypes = VFS.Include("gamedata/resource_types.lua") + +VFS.Include("spec/builders/team_builder.lua") +VFS.Include("common/stringFunctions.lua") +VFS.Include("common.tablefunctions.lua") + +local UnitDefsBuilder = VFS.Include("spec/builders/unit_defs_builder.lua") + +---@class EngineSyncedMock : EngineSynced +---@field GetUnitDefs fun(): table +---@field GetUnitDefNames fun(): table +---@field GetPlayerListUnpacked fun(): TeamData[]? +---@field GetPlayerIdsList fun(): number[]? +---@field _builtTeams table +---@field setDataCalls table +---@field __resourceSetCalls table +---@field __clearResourceDataCalls fun() +---@field GetLoggedMessages fun(): table +---@field __getInitialUnits fun(): table + +---@class EngineSyncedBuilder : EngineSyncedMock +---@field modOptions table +---@field teamRulesParams table +---@field teams table +---@field logMessages table +---@field alliances table +---@field gameFrame number +---@field cheatingEnabled boolean +---@field initialUnits table> +local SB = {} +SB.__index = SB + +---Get comprehensive default mod options required for unitdefs and alldefs_post.lua loading +---@return table +local function getUnitDefRequireModoptionDefaults() + return { + -- Multipliers + multiplier_maxvelocity = 1, + multiplier_turnrate = 1, + multiplier_builddistance = 1, + multiplier_buildpower = 1, + multiplier_metalextraction = 1, + multiplier_resourceincome = 1, + multiplier_energyproduction = 1, + multiplier_energyconversion = 1, + multiplier_losrange = 1, + multiplier_radarrange = 1, + multiplier_shieldpower = 1, + multiplier_weaponrange = 1, + multiplier_weapondamage = 1, + + -- Unit restrictions + unit_restrictions_notech2 = false, + unit_restrictions_notech3 = false, + unit_restrictions_noair = false, + unit_restrictions_nobots = false, + unit_restrictions_nocons = false, + unit_restrictions_nodrops = false, + unit_restrictions_noecon = false, + unit_restrictions_nofactory = false, + unit_restrictions_nogh = false, + unit_restrictions_nohover = false, + unit_restrictions_nokbot = false, + unit_restrictions_nonavy = false, + unit_restrictions_noradarvh = false, + unit_restrictions_notank = false, + unit_restrictions_nouber = false, + unit_restrictions_nowall = false, + unit_restrictions_noxp = false, + unit_restrictions_nosuperweapons = false, + + -- Commander perks + commander = 0, + commtype = 0, + commanderstorage = 0, + automatic_swarm = 0, + automatic_factory = 0, + + -- Other features + unithats = false, + scavunitsforplayers = false, + releasecandidates = false, + ruins = "disabled", + forceallunits = false, + transportenemy = "all", + animationcleanup = false, + xmas = false, + assistdronesbuildpowermultiplier = 1, + + gamespeed = 30, + } +end + +local function normalizeUnitDef(unitDef) + if not unitDef then + return + end + local cp = unitDef.customParams or unitDef.customparams + if not cp then + cp = {} + end + unitDef.customParams = cp + unitDef.customparams = cp + if cp.unitgroup == nil and unitDef.unitgroup then + cp.unitgroup = unitDef.unitgroup + end + if unitDef.buildOptions == nil and unitDef.buildoptions ~= nil then + unitDef.buildOptions = unitDef.buildoptions + elseif unitDef.buildoptions == nil and unitDef.buildOptions ~= nil then + unitDef.buildoptions = unitDef.buildOptions + end + if unitDef.canAssist == nil and unitDef.canassist ~= nil then + unitDef.canAssist = unitDef.canassist + elseif unitDef.canassist == nil and unitDef.canAssist ~= nil then + unitDef.canassist = unitDef.canAssist + end +end + +local function buildUnitDefIndex(unitDefs, unitDefNames) + local index = {} + for key, def in pairs(unitDefs or {}) do + if def then + normalizeUnitDef(def) + index[key] = def + if def.id then + index[def.id] = def + end + if def.name then + index[def.name] = def + end + end + end + for name, info in pairs(unitDefNames or {}) do + local numericId = info and info.id + if numericId and unitDefs and unitDefs[name] then + index[numericId] = unitDefs[name] + end + end + return index +end + +---@return EngineSyncedBuilder +function SB.new() + return setmetatable({ + modOptions = { game_economy = "1" }, + teamRulesParams = {}, -- teamID -> paramName -> value + teams = {}, -- teamID -> TeamDataMock from team builders + logMessages = {}, + alliances = {}, -- teamID -> teamID -> boolean + gameFrame = 1, + cheatingEnabled = false, + unitDefs = UnitDefsBuilder.new(), + _globalUnitDefs = nil, -- mirror of unitDefs:GetUnitDefsByName() once loaded + }, SB) +end + +---@param self EngineSyncedBuilder +---@param options table +---@return EngineSyncedBuilder +function SB:WithModOptions(options) + self.modOptions = self.modOptions or {} + for key, value in pairs(options or {}) do + self.modOptions[key] = value + end + self.modOptions.game_economy = "1" + return self +end + +---@param self EngineSyncedBuilder +---@param key string +---@param value any +---@return EngineSyncedBuilder +function SB:WithModOption(key, value) + self.modOptions[key] = value + self.modOptions.game_economy = "1" + return self +end + +---@param self EngineSyncedBuilder +---@param team1ID number +---@param team2ID number +---@return EngineSyncedBuilder +function SB:WithAlliance(team1ID, team2ID, isAllied) + if isAllied == nil then + isAllied = true + end -- Default to allied for backward compatibility + self.alliances[team1ID] = self.alliances[team1ID] or {} + self.alliances[team2ID] = self.alliances[team2ID] or {} + self.alliances[team1ID][team2ID] = isAllied + self.alliances[team2ID][team1ID] = isAllied + return self +end + +---@param self EngineSyncedBuilder +---@param frame number +---@return EngineSyncedBuilder +function SB:WithGameFrame(frame) + self.gameFrame = frame + return self +end + +---@param self EngineSyncedBuilder +---@param teamID number +---@param key string +---@param value any +---@return EngineSyncedBuilder +function SB:WithTeamRulesParam(teamID, key, value) + self.teamRulesParams[teamID] = self.teamRulesParams[teamID] or {} + self.teamRulesParams[teamID][key] = value + return self +end + +---@param self EngineSyncedBuilder +---@return EngineSyncedMock +function SB:Build() + return self:BuildSpring() +end + +---@param self EngineSyncedBuilder +---@return EngineSyncedMock +function SB:BuildSpring() + ---@type EngineSyncedBuilder + local instance = self + + -- Build all teams for use throughout the repository + local builtTeams = {} + for teamId, teamBuilder in pairs(instance.teams) do + builtTeams[teamId] = teamBuilder:Build() + end + -- Store built teams for access by other functions + instance._builtTeams = builtTeams + + -- Integrate real unit definitions into built teams if available + if instance._globalUnitDefs then + for _, builtTeam in pairs(builtTeams) do + if builtTeam.units then + for _, unitWrapper in pairs(builtTeam.units) do + local defKey = unitWrapper.unitDefId + local unitDef = defKey and instance._globalUnitDefs[defKey] + if not unitDef and defKey and instance._globalUnitDefNames then + local info = instance._globalUnitDefNames[defKey] + local numericId = info and info.id + if numericId then + unitDef = instance._globalUnitDefs[numericId] + unitWrapper.unitDefId = numericId + end + end + + if unitDef then + unitWrapper.unitDefName = unitWrapper.unitDefName or unitDef.name or defKey + unitWrapper.unitDefId = unitDef.id or unitWrapper.unitDefId + for k, v in pairs(unitDef) do + if unitWrapper[k] == nil then + unitWrapper[k] = v + end + end + unitWrapper.unitDef = unitDef + else + unitWrapper.unitDefName = unitWrapper.unitDefName or tostring(defKey) + end + end + end + end + end + -- Use the team rules params configured via WithTeamRulesParam + local rulesParams = instance.teamRulesParams + + local function ensureTeam(teamID) + if type(teamID) ~= "number" then + error(string.format("TeamID must be a number, got %s: %s", type(teamID), tostring(teamID))) + end + local teamBuilder = builtTeams[teamID] + if not teamBuilder then + error(string.format("TeamBuilder not found for teamID %d. Use EngineSyncedBuilder:WithTeam(teamBuilder) to configure teams properly.", teamID)) + end + return teamBuilder + end + + local function normalizeResourceType(resourceType) + if resourceType == ResourceTypes.METAL then + return ResourceTypes.METAL + end + if resourceType == ResourceTypes.ENERGY then + return ResourceTypes.ENERGY + end + error(string.format("Unknown resource type: %s", tostring(resourceType))) + end + + local function getResourceStore(teamID, resourceType) + local team = ensureTeam(teamID) + local normalized = normalizeResourceType(resourceType) + if normalized == ResourceTypes.METAL then + return team.metal, normalized + end + return team.energy, normalized + end + + local resourceSetCalls = {} + + local function recordSetCall(teamID, resourceType, data) + table.insert(resourceSetCalls, { + teamID = teamID, + resource = resourceType, + data = table.copy(data or {}), + }) + end + + local function applyResourcePatch(teamID, resourceType, patch) + if type(patch) ~= "table" then + error("ResourceData patch must be a table") + end + + local store, normalized = getResourceStore(teamID, resourceType) + for key, value in pairs(patch) do + store[key] = value + end + store.resourceType = normalized + recordSetCall(teamID, normalized, patch) + end + + ---@type EngineSyncedMock + local mock = { + CMD = Spring and Spring.CMD or { + LOAD_ONTO = 1, + SELFD = 2, + GUARD = 25, + REPAIR = 40, + RECLAIM = 90, + }, + GetModOptions = function() + -- Return only the mod options that were explicitly set via WithModOption/WithModOptions + return instance.modOptions + end, + GetGameFrame = function() + return instance.gameFrame + end, + IsCheatingEnabled = function() + return instance.cheatingEnabled + end, + Log = function(tag, level, msg) + table.insert(instance.logMessages, { tag = tag, level = level, msg = msg }) + end, + GetLoggedMessages = function() + return instance.logMessages + end, + GetTeamRulesParam = function(teamID, key) + return rulesParams[teamID] and rulesParams[teamID][key] or nil + end, + SetTeamRulesParam = function(teamID, key, value) + rulesParams[teamID] = rulesParams[teamID] or {} + rulesParams[teamID][key] = value + end, + GetTeamList = function() + local teamIds = {} + local i = 1 + for teamId, _ in pairs(builtTeams) do + teamIds[i] = teamId + i = i + 1 + end + return teamIds + end, + GetPlayerInfo = function(playerID, getPlayerOpts) + for _, teamData in pairs(builtTeams) do + if teamData.players then + for _, player in ipairs(teamData.players) do + if player.id == playerID then + local name = player.name or ("Player " .. tostring(playerID)) + local active = player.active ~= false + local spectator = player.spectator or false + local teamID = teamData.id + local allyTeamID = teamData.allyTeam or teamID + local pingTime = player.pingTime or 0 + local cpuUsage = player.cpuUsage or 0 + local country = player.country or "XX" + local rank = player.rank or 0 + local hasSkirmishAIsInTeam = player.hasSkirmishAIsInTeam or false + local playerOpts = player.playerOpts or {} + local desynced = player.desynced or false + return name, active, spectator, teamID, allyTeamID, pingTime, cpuUsage, country, rank, hasSkirmishAIsInTeam, playerOpts, desynced + end + end + end + end + return ("Player " .. tostring(playerID)), false, true, -1, -1, 0, 0, "XX", 0, false, {}, false + end, + + GetTeamResources = function(teamID, resourceType) + local data = getResourceStore(teamID, resourceType) + return data.current, data.storage, data.pull, data.income, data.expense, data.shareSlider, data.sent, data.received + end, + -- Convenience accessors for tests + __getInitialUnits = function() + return instance.initialUnits + end, + GetUnitDefs = function() + -- Return instance globals from WithRealUnitDefs + if instance._globalUnitDefs then + return instance._globalUnitDefs + end + + -- Otherwise, return registered unitDefs from team builders + local unitDefs = {} + local registeredUnitDefIds = {} + + -- Collect all unique unitDefIds from teams' units + for teamId, teamBuilder in pairs(builtTeams) do + if teamBuilder.units then + for unitId, unitWrapper in pairs(teamBuilder.units) do + if unitWrapper.unitDefId then + registeredUnitDefIds[unitWrapper.unitDefId] = true + end + end + end + end + + -- Create mock unitDefs for registered unitDefIds + for unitDefId in pairs(registeredUnitDefIds) do + -- Create a basic mock unitDef - this may need to be enhanced based on what properties are checked + local mockDef = { + id = unitDefId, + name = "mock_unit_" .. unitDefId, + isFactory = false, + canAssist = false, + buildOptions = {}, + customParams = { + techlevel = 1, + unitgroup = "combat", + }, + } + unitDefs[unitDefId] = mockDef + end + + return unitDefs + end, + GetUnitDefNames = function() + return instance._globalUnitDefNames + end, + + _builtTeams = builtTeams, + setDataCalls = resourceSetCalls, + __resourceSetCalls = resourceSetCalls, + __clearResourceDataCalls = function() + for i = #resourceSetCalls, 1, -1 do + resourceSetCalls[i] = nil + end + end, + + GetPlayerList = function(teamID) + if teamID then + local teamData = builtTeams[teamID] + if not teamData then + return {} + end + local players = teamData.players or {} + local ids = {} + for i, player in ipairs(players) do + ids[i] = player.id + end + if #ids == 0 then + ids[1] = teamData.leader or teamID + end + return ids + end + + local all = {} + for _, teamData in pairs(builtTeams) do + local players = teamData.players or {} + if #players > 0 then + for _, player in ipairs(players) do + table.insert(all, player.id) + end + else + table.insert(all, teamData.leader or teamData.id) + end + end + return all + end, + + GetTeamUnits = function(teamID) + local teamData = builtTeams[teamID] + if not teamData or not teamData.units then + return {} + end + + local unitIds = {} + local i = 1 + for unitID in pairs(teamData.units) do + unitIds[i] = unitID + i = i + 1 + end + return unitIds + end, + + GetUnitTeam = function(unitID) + for teamId, teamBuilder in pairs(builtTeams) do + if teamBuilder.units then + for uId, uData in pairs(teamBuilder.units) do + if uId == unitID then + return teamId + end + end + end + end + return nil + end, + + GetUnitDefID = function(unitID) + for _, teamBuilder in pairs(builtTeams) do + if teamBuilder.units then + local unitWrapper = teamBuilder.units[unitID] + if unitWrapper then + local id = unitWrapper.unitDefId + if type(id) == "number" then + return id + end + local name = unitWrapper.unitDefName or unitWrapper.unitDefId + if instance._globalUnitDefNames and name and instance._globalUnitDefNames[name] then + id = instance._globalUnitDefNames[name].id + unitWrapper.unitDefId = id + return id + end + if unitWrapper.unitDef and type(unitWrapper.unitDef.id) == "number" then + unitWrapper.unitDefId = unitWrapper.unitDef.id + return unitWrapper.unitDefId + end + return id + end + end + end + return nil + end, + + GiveOrderToUnit = function(unitID, cmdID, params, options) + return true + end, + + AddTeamResource = function(teamID, resourceType, amount) + local teamData = builtTeams[teamID] + if teamData then + if resourceType == "metal" then + teamData.metal.current = teamData.metal.current + amount + elseif resourceType == "energy" then + teamData.energy.current = teamData.energy.current + amount + end + end + return true, amount + end, + + ValidUnitID = function(unitID) + for teamId, teamBuilder in pairs(builtTeams) do + if teamBuilder.units and teamBuilder.units[unitID] then + return true + end + end + return false + end, + + GetUnitIsBeingBuilt = function(unitID) + for _, teamData in pairs(builtTeams) do + if teamData.units and teamData.units[unitID] then + local wrapper = teamData.units[unitID] + return wrapper.beingBuilt or false, wrapper.buildProgress or 1.0 + end + end + return false, 1.0 + end, + + TransferUnit = function(unitID, newTeamID, given) + local currentTeamID = nil + local unitDefID = nil + for teamId, teamBuilder in pairs(builtTeams) do + if teamBuilder.units and teamBuilder.units[unitID] then + currentTeamID = teamId + unitDefID = teamBuilder.units[unitID].unitDefId + break + end + end + + if not currentTeamID then + return false + end + + if currentTeamID == newTeamID then + return true + end + + if builtTeams[currentTeamID] and builtTeams[currentTeamID].units then + builtTeams[currentTeamID].units[unitID] = nil + end + + if not builtTeams[newTeamID] then + builtTeams[newTeamID] = { units = {} } + end + if not builtTeams[newTeamID].units then + builtTeams[newTeamID].units = {} + end + builtTeams[newTeamID].units[unitID] = { unitDefId = unitDefID } + + return true + end, + + AreTeamsAllied = function(team1ID, team2ID) + if team1ID == team2ID then + return true + end + if instance.alliances[team1ID] and instance.alliances[team1ID][team2ID] ~= nil then + return instance.alliances[team1ID][team2ID] + end + return false + end, + + GetGaiaTeamID = function() + return -1 + end, + + GetTeamInfo = function(teamID, getUnread) + local teamData = builtTeams[teamID] + if teamData then + local name = teamData.name or ("Team " .. tostring(teamID)) + local leader = teamData.leader or 0 + local isDead = teamData.isDead or false + local isAI = teamData.isAI or false + local side = teamData.side or "arm" + local allyTeam = teamData.allyTeam or teamID + local customTeamKeys = teamData.customTeamKeys or {} + local incomeMultiplier = teamData.incomeMultiplier or 1 + local customOpts = teamData.customOpts or 0 + return name, leader, isDead, isAI, side, allyTeam, customTeamKeys, incomeMultiplier, customOpts + end + return "Unknown", 0, true, false, "arm", -1, {}, 1, 0 + end, + + GetTeamLuaAI = function(teamID) + local teamData = builtTeams[teamID] + if teamData and teamData.luaAI then + return teamData.luaAI + end + return "" + end, + + SetTeamShareLevel = function(teamID, resource, level) + local teamData = builtTeams[teamID] + if teamData then + local normalized = normalizeResourceType(resource) + if normalized == ResourceTypes.METAL then + teamData.metal.shareSlider = level + else + teamData.energy.shareSlider = level + end + end + end, + + GetAuditTimer = function() + return 0 + end, + + GetTeamAllyTeamID = function(teamID) + local teamData = builtTeams[teamID] + if teamData then + return teamData.allyTeam or teamID + end + return nil + end, + + GetPlayerListUnpacked = function() + local result = {} + for _, teamData in pairs(builtTeams) do + result[#result + 1] = teamData + end + if #result == 0 then + return nil + end + return result + end, + + GetPlayerIdsList = function() + local ids = {} + for _, teamData in pairs(builtTeams) do + if teamData.players then + for _, player in ipairs(teamData.players) do + ids[#ids + 1] = player.id + end + end + end + if #ids == 0 then + return nil + end + return ids + end, + } + + return mock +end + +---Temporarily install minimal global Spring/VFS/Game/LOG (spec_helper does some of this but we try for thoroughness) to allow real unitdefs load +---@param self EngineSyncedBuilder +---@param fn fun() +---@param persist? boolean If true, don't clean up globals after execution +function SB:WithGlobalsDefined(fn, persist) + local instance = self + -- Save current globals + local prevSpring = _G.Spring + local prevVFS = _G.VFS + local prevGame = _G.Game + local prevLOG = _G.LOG + local prevSplit = string.split + local prevUnitDefs = _G.UnitDefs + local prevUnitDefNames = _G.UnitDefNames + + -- Set up mocks for the duration of the function + _G.Spring = _G.Spring or {} + local mock = self:BuildSpring() + + -- Expose all Spring functions to global Spring object + -- Defer to already defined GetModOptions if it exists (defined by springOverrides.lua) + if not _G.Spring.GetModOptions then + ---@diagnostic disable: duplicate-set-field + _G.Spring.GetModOptions = function() + -- Start with comprehensive defaults, then override with explicitly set mod options + local modOptions = getUnitDefRequireModoptionDefaults() + -- Override with any mod options that were explicitly set via WithModOption + for k, v in pairs(self.modOptions) do + modOptions[k] = v + end + return modOptions + end + end + _G.Spring.GetGameFrame = mock.GetGameFrame + _G.Spring.IsCheatingEnabled = mock.IsCheatingEnabled + -- Don't override Spring.Log if it's already set by spec_helper + if not _G.Spring.Log then + _G.Spring.Log = mock.Log + end + _G.Spring.GetTeamRulesParam = mock.GetTeamRulesParam + _G.Spring.SetTeamRulesParam = mock.SetTeamRulesParam + _G.Spring.GetUnitDefID = mock.GetUnitDefID + _G.Spring.ValidUnitID = mock.ValidUnitID + + -- Additional Spring functions that may be needed + -- Defer to already defined GetTeamLuaAI if it exists (real Spring API function) + if not _G.Spring.GetTeamLuaAI then + ---@diagnostic disable: duplicate-set-field + _G.Spring.GetTeamLuaAI = function(_) + return "" + end + end + if not _G.Spring.GetConfigInt then + _G.Spring.GetConfigInt = function(name, default) + return default or 0 + end + end + _G.BAR = _G.BAR or {} + _G.Spring.Utilities = _G.Spring.Utilities or { Gametype = { + IsScavengers = function() + return false + end, + IsRaptors = function() + return false + end, + GetCurrentHolidays = function() + return {} + end, + } } + + -- Mock VFS.Include cache to intercept system.lua load + local originalVFSInclude = _G.VFS.Include + _G.VFS.Include = function(path, ...) + if path == "gamedata/system.lua" then + return { + lowerkeys = function(t) + return t + end, + reftable = function(ref, tbl) + tbl = tbl or {} + setmetatable(tbl, { __index = ref }) + return tbl + end, + VFS = _G.VFS, + Spring = _G.Spring, + -- Type-split + detached-module namespaces for the def loader. + -- The codemod rewrites Spring.X -> Engine.{Shared,Synced,Unsynced}.X + -- (spring-split) and Spring.I18N -> BAR.I18N etc. (detach-bar-modules); + -- these aliases let unit/weapon/feature defs resolve in the test VM + -- (real engine: the LuaParser defs env provides them natively). + Engine = { Shared = _G.Spring, Synced = _G.Spring, Unsynced = _G.Spring }, + BAR = _G.BAR, + -- Export standard Lua libs as system.lua does + pairs = pairs, + ipairs = ipairs, + math = math, + table = table, + string = string, + tonumber = tonumber, + tostring = tostring, + type = type, + unpack = unpack or table.unpack, + print = print, + error = error, + pcall = pcall, + select = select, + next = next, + require = require, + } + end + if originalVFSInclude then + return originalVFSInclude(path, ...) + end + -- Fallback if original was nil (unlikely given setup) + return {} + end + + _G.LOG = _G.LOG or { DEBUG = "DEBUG", INFO = "INFO", WARNING = "WARNING", ERROR = "ERROR" } + _G.Game = _G.Game or {} + _G.Game.gameSpeed = _G.Game.gameSpeed or 30 + -- Make sure these are available in the environment + _G.pairs = pairs + _G.ipairs = ipairs + _G.math = math + _G.table = table + _G.string = string + _G.type = type + _G.tostring = tostring + _G.tonumber = tonumber + _G.unpack = unpack or table.unpack + _G.print = print + _G.error = error + _G.pcall = pcall + _G.select = select + _G.next = next + _G.require = require + + -- Execute the function with globals set up + local success, result = pcall(fn) + if not success then + error("WithGlobalsDefined function failed: " .. tostring(result)) + end + + -- If not persisting, restore original globals + if not persist then + _G.Spring = prevSpring + _G.VFS = prevVFS + _G.Game = prevGame + _G.LOG = prevLOG + string.split = prevSplit + _G.UnitDefs = prevUnitDefs + _G.UnitDefNames = prevUnitDefNames + end + + return instance +end + +---@param self EngineSyncedBuilder +---@param teamBuilder TeamBuilder The team builder instance +---@return EngineSyncedBuilder +function SB:WithTeam(teamBuilder) + if not teamBuilder.id then + error("TeamBuilder must have an id field. teamBuilder: " .. table.toString(teamBuilder)) + end + self.teams[teamBuilder.id] = teamBuilder + return self +end + +---Register a unit definition. Accepts either a UnitDefBuilder or a (defID, defTable) pair. +---Delegates to the shared UnitDefsBuilder registry. +---@overload fun(self: EngineSyncedBuilder, udb: UnitDefBuilder): EngineSyncedBuilder +---@param defID number +---@param def table +---@return EngineSyncedBuilder +function SB:WithUnitDef(defID, def) + self.unitDefs:WithUnitDef(defID, def) + return self +end + +---Load real BAR UnitDefs from gamedata into the registry. +---Uses WithGlobalsDefined as the harness so modoptions are honored during the load. +---After loading, normalizes the defs into the polyglot index that downstream code +---(GetUnitDefs, BuildSpring team-resolution) expects. +---@param self EngineSyncedBuilder +---@return EngineSyncedBuilder +function SB:WithRealUnitDefs() + if self._globalUnitDefs then + return self + end + + self.unitDefs:WithRealUnitDefs(function(loadFn) + self:WithGlobalsDefined(loadFn) + end) + + -- Build the polyglot index downstream code reads via _globalUnitDefs. + -- In the gamedata pre-load shape this is name-keyed (no numeric IDs); + -- buildUnitDefIndex also runs normalizeUnitDef to fold customParams etc. + local byName = self.unitDefs:GetUnitDefsByName() + if next(byName) ~= nil then + self._globalUnitDefs = buildUnitDefIndex(byName, self.unitDefs:GetUnitDefNames()) + self._globalUnitDefNames = self.unitDefs:GetUnitDefNames() + end + return self +end + +return SB diff --git a/spec/builders/spring_unsynced_builder.lua b/spec/builders/engine_unsynced_builder.lua similarity index 86% rename from spec/builders/spring_unsynced_builder.lua rename to spec/builders/engine_unsynced_builder.lua index b79b3a80c17..a7bbd932f5f 100644 --- a/spec/builders/spring_unsynced_builder.lua +++ b/spec/builders/engine_unsynced_builder.lua @@ -1,6 +1,6 @@ -- Spring Unsynced (Widget) Builder -- Builds a sandboxed widget execution environment for unsynced/LuaUI tests. --- Mirrors SpringSyncedBuilder but for widgets that consume widget context globals +-- Mirrors EngineSyncedBuilder but for widgets that consume widget context globals -- (widget, widgetHandler, WG, GL, gl, Platform, UnitDefs) and Spring unsynced -- functions like GiveOrderToUnit / TestBuildOrder. @@ -12,7 +12,7 @@ local UnitDefsBuilder = VFS.Include("spec/builders/unit_defs_builder.lua") ---@field captureArrayOrders fun(): table[] installs spy on Spring.GiveOrderArrayToUnitArray, returns recorded calls ---@field captureUnitOrders fun(): table[] installs spy on Spring.GiveOrderToUnit, returns recorded calls ----@class SpringUnsyncedBuilder +---@class EngineUnsyncedBuilder ---@field unitDefs UnitDefsBuilder ---@field springOverrides table ---@field vfsIncludeOverrides table @@ -30,10 +30,10 @@ function SUB.new() end ---Register a unit definition. Delegates to the underlying UnitDefsBuilder. ----@overload fun(self: SpringUnsyncedBuilder, udb: UnitDefBuilder): SpringUnsyncedBuilder +---@overload fun(self: EngineUnsyncedBuilder, udb: UnitDefBuilder): EngineUnsyncedBuilder ---@param defID number ---@param def table ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithUnitDef(defID, def) self.unitDefs:WithUnitDef(defID, def) return self @@ -42,14 +42,14 @@ end ---Place a live unit instance on the map. Errors if the def is not registered. ---@param unitID number ---@param defIDOrName number|string ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithUnit(unitID, defIDOrName) self.unitDefs:WithUnit(unitID, defIDOrName) return self end ---Load real BAR UnitDefs from gamedata into the registry. ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithRealUnitDefs() self.unitDefs:WithRealUnitDefs() return self @@ -57,7 +57,7 @@ end ---@param name string ---@param fn function|table ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithSpringFn(name, fn) self.springOverrides[name] = fn return self @@ -67,14 +67,14 @@ end ---value may be a literal table or a function called with the original args. ---@param path string ---@param value any ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithVFSInclude(path, value) self.vfsIncludeOverrides[path] = value return self end ---@param headless boolean|nil defaults to true ----@return SpringUnsyncedBuilder +---@return EngineUnsyncedBuilder function SUB:WithHeadless(headless) self.headless = headless ~= false return self @@ -145,6 +145,9 @@ local function makeEnv(self) springTable[k] = v end env.Spring = setmetatable(springTable, { __index = _G.Spring }) + -- spring-split: widgets call Engine.{Synced,Unsynced,Shared}.X; point all + -- buckets at the same mock table so they resolve to the per-test overrides. + env.Engine = { Synced = env.Spring, Unsynced = env.Spring, Shared = env.Spring } local realInclude = _G.VFS and _G.VFS.Include local includeOverrides = self.vfsIncludeOverrides @@ -184,7 +187,7 @@ function SUB:LoadWidget(widgetPath) function mock.captureArrayOrders() local calls = {} - env.Spring.GiveOrderArrayToUnitArray = function(unitIDs, orders, _) + env.Engine.Shared.GiveOrderArrayToUnitArray = function(unitIDs, orders, _) table.insert(calls, { unitIDs = unitIDs, orders = orders }) end return calls @@ -192,7 +195,7 @@ function SUB:LoadWidget(widgetPath) function mock.captureUnitOrders() local calls = {} - env.Spring.GiveOrderToUnit = function(unitID, cmdID, params, _) + env.Engine.Shared.GiveOrderToUnit = function(unitID, cmdID, params, _) table.insert(calls, { unitID = unitID, cmdID = cmdID, params = params }) end return calls diff --git a/spec/builders/index.lua b/spec/builders/index.lua index 19e135925ec..916b0ba7e88 100644 --- a/spec/builders/index.lua +++ b/spec/builders/index.lua @@ -1,23 +1,23 @@ local TeamBuilder = VFS.Include("spec/builders/team_builder.lua") -local SpringSyncedBuilder = VFS.Include("spec/builders/spring_synced_builder.lua") -local SpringUnsyncedBuilder = VFS.Include("spec/builders/spring_unsynced_builder.lua") +local EngineSyncedBuilder = VFS.Include("spec/builders/engine_synced_builder.lua") +local EngineUnsyncedBuilder = VFS.Include("spec/builders/engine_unsynced_builder.lua") local ResourceDataBuilder = VFS.Include("spec/builders/resource_data_builder.lua") local UnitDefBuilder = VFS.Include("spec/builders/unit_def_builder.lua") local UnitDefsBuilder = VFS.Include("spec/builders/unit_defs_builder.lua") ---@class Builders ---@field Team TeamBuilder ----@field Spring SpringBuilder ----@field SpringUnsynced SpringUnsyncedBuilder +---@field EngineSynced EngineSyncedBuilder +---@field EngineUnsynced EngineUnsyncedBuilder ---@field UnitDef UnitDefBuilder ---@field UnitDefs UnitDefsBuilder local Builders = { - Team = TeamBuilder, - Spring = SpringSyncedBuilder, - SpringUnsynced = SpringUnsyncedBuilder, - ResourceData = ResourceDataBuilder, - UnitDef = UnitDefBuilder, - UnitDefs = UnitDefsBuilder, + Team = TeamBuilder, + EngineSynced = EngineSyncedBuilder, + EngineUnsynced = EngineUnsyncedBuilder, + ResourceData = ResourceDataBuilder, + UnitDef = UnitDefBuilder, + UnitDefs = UnitDefsBuilder, } -return Builders \ No newline at end of file +return Builders diff --git a/spec/builders/resource_data_builder.lua b/spec/builders/resource_data_builder.lua index 5d3c18a1395..53833003336 100644 --- a/spec/builders/resource_data_builder.lua +++ b/spec/builders/resource_data_builder.lua @@ -45,20 +45,39 @@ function ResourceDataBuilder:WithField(fieldName, value) return self end -function ResourceDataBuilder:WithCurrent(value) return self:WithField("current", value) end -function ResourceDataBuilder:WithStorage(value) return self:WithField("storage", value) end -function ResourceDataBuilder:WithPull(value) return self:WithField("pull", value) end -function ResourceDataBuilder:WithIncome(value) return self:WithField("income", value) end -function ResourceDataBuilder:WithExpense(value) return self:WithField("expense", value) end -function ResourceDataBuilder:WithShareSlider(value) return self:WithField("shareSlider", value) end -function ResourceDataBuilder:WithSent(value) return self:WithField("sent", value) end -function ResourceDataBuilder:WithReceived(value) return self:WithField("received", value) end -function ResourceDataBuilder:WithExcess(value) return self:WithField("excess", value) end -function ResourceDataBuilder:WithResourceType(value) return self:WithField("resourceType", value) end +function ResourceDataBuilder:WithCurrent(value) + return self:WithField("current", value) +end +function ResourceDataBuilder:WithStorage(value) + return self:WithField("storage", value) +end +function ResourceDataBuilder:WithPull(value) + return self:WithField("pull", value) +end +function ResourceDataBuilder:WithIncome(value) + return self:WithField("income", value) +end +function ResourceDataBuilder:WithExpense(value) + return self:WithField("expense", value) +end +function ResourceDataBuilder:WithShareSlider(value) + return self:WithField("shareSlider", value) +end +function ResourceDataBuilder:WithSent(value) + return self:WithField("sent", value) +end +function ResourceDataBuilder:WithReceived(value) + return self:WithField("received", value) +end +function ResourceDataBuilder:WithExcess(value) + return self:WithField("excess", value) +end +function ResourceDataBuilder:WithResourceType(value) + return self:WithField("resourceType", value) +end function ResourceDataBuilder:Build() return clone(self.data) end return ResourceDataBuilder - diff --git a/spec/builders/sequence.lua b/spec/builders/sequence.lua index eebace2ad2a..4c630ddd0c7 100644 --- a/spec/builders/sequence.lua +++ b/spec/builders/sequence.lua @@ -16,9 +16,11 @@ local _counters = {} ---Get current counter for prefix (or defaultStart - 1 if unset) local function current(prefix, defaultStart) - local n = _counters[prefix] - if n == nil then return (defaultStart or 1) - 1 end - return n - 1 + local n = _counters[prefix] + if n == nil then + return (defaultStart or 1) - 1 + end + return n - 1 end ---Create a generator function tied to a prefix (& cached counter) @@ -26,21 +28,27 @@ end ---@param opts SequenceOptions|nil ---@return fun():string function M.sequence(prefix, opts) - opts = opts or {} - local start = opts.start or 1 - local step = opts.step or 1 - local fmt = opts.format or function(p, n) return p .. tostring(n) end + opts = opts or {} + local start = opts.start or 1 + local step = opts.step or 1 + local fmt = opts.format or function(p, n) + return p .. tostring(n) + end - -- If first time seeing this prefix, initialize its next value - if _counters[prefix] == nil then _counters[prefix] = start end + -- If first time seeing this prefix, initialize its next value + if _counters[prefix] == nil then + _counters[prefix] = start + end - return function() - local n = _counters[prefix] - _counters[prefix] = n + step - local str = fmt(prefix, n) - if str == nil then str = prefix .. tostring(n) end - return str - end + return function() + local n = _counters[prefix] + _counters[prefix] = n + step + local str = fmt(prefix, n) + if str == nil then + str = prefix .. tostring(n) + end + return str + end end ---Peek without incrementing @@ -48,24 +56,26 @@ end ---@param defaultStart integer|nil ---@return integer function M.peek(prefix, defaultStart) - return current(prefix, defaultStart) + return current(prefix, defaultStart) end ---Force the next value (useful in tests) ---@param prefix string ---@param nextValue integer function M.set(prefix, nextValue) - _counters[prefix] = nextValue + _counters[prefix] = nextValue end ---Reset one prefix (or all if nil) ---@param prefix string|nil function M.reset(prefix) - if prefix == nil then - for k in pairs(_counters) do _counters[k] = nil end - else - _counters[prefix] = nil - end + if prefix == nil then + for k in pairs(_counters) do + _counters[k] = nil + end + else + _counters[prefix] = nil + end end return M diff --git a/spec/builders/spring_synced_builder.lua b/spec/builders/spring_synced_builder.lua deleted file mode 100644 index b51a519f9f5..00000000000 --- a/spec/builders/spring_synced_builder.lua +++ /dev/null @@ -1,867 +0,0 @@ --- Ensure TeamData type is available -local ResourceTypes = VFS.Include("gamedata/resource_types.lua") - -VFS.Include("spec/builders/team_builder.lua") -VFS.Include("common/stringFunctions.lua") -VFS.Include("common.tablefunctions.lua") - -local UnitDefsBuilder = VFS.Include("spec/builders/unit_defs_builder.lua") - ----@class SpringSyncedMock : SpringSynced ----@field GetUnitDefs fun(): table ----@field GetUnitDefNames fun(): table ----@field GetPlayerListUnpacked fun(): TeamData[]? ----@field GetPlayerIdsList fun(): number[]? ----@field _builtTeams table ----@field setDataCalls table ----@field __resourceSetCalls table ----@field __clearResourceDataCalls fun() ----@field GetLoggedMessages fun(): table ----@field __getInitialUnits fun(): table - ----@class SpringSyncedBuilder : SpringSyncedMock ----@field modOptions table ----@field teamRulesParams table ----@field teams table ----@field logMessages table ----@field alliances table ----@field gameFrame number ----@field cheatingEnabled boolean ----@field initialUnits table> -local SB = {} -SB.__index = SB - ----Get comprehensive default mod options required for unitdefs and alldefs_post.lua loading ----@return table -local function getUnitDefRequireModoptionDefaults() - return { - -- Multipliers - multiplier_maxvelocity = 1, - multiplier_turnrate = 1, - multiplier_builddistance = 1, - multiplier_buildpower = 1, - multiplier_metalextraction = 1, - multiplier_resourceincome = 1, - multiplier_energyproduction = 1, - multiplier_energyconversion = 1, - multiplier_losrange = 1, - multiplier_radarrange = 1, - multiplier_shieldpower = 1, - multiplier_weaponrange = 1, - multiplier_weapondamage = 1, - - -- Unit restrictions - unit_restrictions_notech2 = false, - unit_restrictions_notech3 = false, - unit_restrictions_noair = false, - unit_restrictions_nobots = false, - unit_restrictions_nocons = false, - unit_restrictions_nodrops = false, - unit_restrictions_noecon = false, - unit_restrictions_nofactory = false, - unit_restrictions_nogh = false, - unit_restrictions_nohover = false, - unit_restrictions_nokbot = false, - unit_restrictions_nonavy = false, - unit_restrictions_noradarvh = false, - unit_restrictions_notank = false, - unit_restrictions_nouber = false, - unit_restrictions_nowall = false, - unit_restrictions_noxp = false, - unit_restrictions_nosuperweapons = false, - - -- Commander perks - commander = 0, - commtype = 0, - commanderstorage = 0, - automatic_swarm = 0, - automatic_factory = 0, - - -- Other features - unithats = false, - scavunitsforplayers = false, - releasecandidates = false, - ruins = "disabled", - forceallunits = false, - transportenemy = "all", - animationcleanup = false, - xmas = false, - assistdronesbuildpowermultiplier = 1, - - gamespeed = 30, - } -end - -local function normalizeUnitDef(unitDef) - if not unitDef then return end - local cp = unitDef.customParams or unitDef.customparams - if not cp then - cp = {} - end - unitDef.customParams = cp - unitDef.customparams = cp - if cp.unitgroup == nil and unitDef.unitgroup then - cp.unitgroup = unitDef.unitgroup - end - if unitDef.buildOptions == nil and unitDef.buildoptions ~= nil then - unitDef.buildOptions = unitDef.buildoptions - elseif unitDef.buildoptions == nil and unitDef.buildOptions ~= nil then - unitDef.buildoptions = unitDef.buildOptions - end - if unitDef.canAssist == nil and unitDef.canassist ~= nil then - unitDef.canAssist = unitDef.canassist - elseif unitDef.canassist == nil and unitDef.canAssist ~= nil then - unitDef.canassist = unitDef.canAssist - end -end - -local function buildUnitDefIndex(unitDefs, unitDefNames) - local index = {} - for key, def in pairs(unitDefs or {}) do - if def then - normalizeUnitDef(def) - index[key] = def - if def.id then - index[def.id] = def - end - if def.name then - index[def.name] = def - end - end - end - for name, info in pairs(unitDefNames or {}) do - local numericId = info and info.id - if numericId and unitDefs and unitDefs[name] then - index[numericId] = unitDefs[name] - end - end - return index -end - ----@return SpringSyncedBuilder -function SB.new() - return setmetatable({ - modOptions = { game_economy = "1" }, - teamRulesParams = {}, -- teamID -> paramName -> value - teams = {}, -- teamID -> TeamDataMock from team builders - logMessages = {}, - alliances = {}, -- teamID -> teamID -> boolean - gameFrame = 1, - cheatingEnabled = false, - unitDefs = UnitDefsBuilder.new(), - _globalUnitDefs = nil, -- mirror of unitDefs:GetUnitDefsByName() once loaded - }, SB) -end - ----@param self SpringSyncedBuilder ----@param options table ----@return SpringSyncedBuilder -function SB:WithModOptions(options) - self.modOptions = self.modOptions or {} - for key, value in pairs(options or {}) do - self.modOptions[key] = value - end - self.modOptions.game_economy = "1" - return self -end - ----@param self SpringSyncedBuilder ----@param key string ----@param value any ----@return SpringSyncedBuilder -function SB:WithModOption(key, value) - self.modOptions[key] = value - self.modOptions.game_economy = "1" - return self -end - - ----@param self SpringSyncedBuilder ----@param team1ID number ----@param team2ID number ----@return SpringSyncedBuilder -function SB:WithAlliance(team1ID, team2ID, isAllied) - if isAllied == nil then isAllied = true end -- Default to allied for backward compatibility - self.alliances[team1ID] = self.alliances[team1ID] or {} - self.alliances[team2ID] = self.alliances[team2ID] or {} - self.alliances[team1ID][team2ID] = isAllied - self.alliances[team2ID][team1ID] = isAllied - return self -end - ----@param self SpringSyncedBuilder ----@param frame number ----@return SpringSyncedBuilder -function SB:WithGameFrame(frame) - self.gameFrame = frame - return self -end - ----@param self SpringSyncedBuilder ----@param teamID number ----@param key string ----@param value any ----@return SpringSyncedBuilder -function SB:WithTeamRulesParam(teamID, key, value) - self.teamRulesParams[teamID] = self.teamRulesParams[teamID] or {} - self.teamRulesParams[teamID][key] = value - return self -end - ----@param self SpringSyncedBuilder ----@return SpringSyncedMock -function SB:Build() - return self:BuildSpring() -end - ----@param self SpringSyncedBuilder ----@return SpringSyncedMock -function SB:BuildSpring() - ---@type SpringSyncedBuilder - local instance = self - - -- Build all teams for use throughout the repository - local builtTeams = {} - for teamId, teamBuilder in pairs(instance.teams) do - builtTeams[teamId] = teamBuilder:Build() - end - -- Store built teams for access by other functions - instance._builtTeams = builtTeams - - -- Integrate real unit definitions into built teams if available - if instance._globalUnitDefs then - for _, builtTeam in pairs(builtTeams) do - if builtTeam.units then - for _, unitWrapper in pairs(builtTeam.units) do - local defKey = unitWrapper.unitDefId - local unitDef = defKey and instance._globalUnitDefs[defKey] - if not unitDef and defKey and instance._globalUnitDefNames then - local info = instance._globalUnitDefNames[defKey] - local numericId = info and info.id - if numericId then - unitDef = instance._globalUnitDefs[numericId] - unitWrapper.unitDefId = numericId - end - end - - if unitDef then - unitWrapper.unitDefName = unitWrapper.unitDefName or unitDef.name or defKey - unitWrapper.unitDefId = unitDef.id or unitWrapper.unitDefId - for k, v in pairs(unitDef) do - if unitWrapper[k] == nil then - unitWrapper[k] = v - end - end - unitWrapper.unitDef = unitDef - else - unitWrapper.unitDefName = unitWrapper.unitDefName or tostring(defKey) - end - end - end - end - end - -- Use the team rules params configured via WithTeamRulesParam - local rulesParams = instance.teamRulesParams - - local function ensureTeam(teamID) - if type(teamID) ~= "number" then - error(string.format("TeamID must be a number, got %s: %s", type(teamID), tostring(teamID))) - end - local teamBuilder = builtTeams[teamID] - if not teamBuilder then - error(string.format("TeamBuilder not found for teamID %d. Use SpringSyncedBuilder:WithTeam(teamBuilder) to configure teams properly.", teamID)) - end - return teamBuilder - end - - local function normalizeResourceType(resourceType) - if resourceType == ResourceTypes.METAL then - return ResourceTypes.METAL - end - if resourceType == ResourceTypes.ENERGY then - return ResourceTypes.ENERGY - end - error(string.format("Unknown resource type: %s", tostring(resourceType))) - end - - local function getResourceStore(teamID, resourceType) - local team = ensureTeam(teamID) - local normalized = normalizeResourceType(resourceType) - if normalized == ResourceTypes.METAL then - return team.metal, normalized - end - return team.energy, normalized - end - - local resourceSetCalls = {} - - local function recordSetCall(teamID, resourceType, data) - table.insert(resourceSetCalls, { - teamID = teamID, - resource = resourceType, - data = table.copy(data or {}), - }) - end - - local function applyResourcePatch(teamID, resourceType, patch) - if type(patch) ~= "table" then - error("ResourceData patch must be a table") - end - - local store, normalized = getResourceStore(teamID, resourceType) - for key, value in pairs(patch) do - store[key] = value - end - store.resourceType = normalized - recordSetCall(teamID, normalized, patch) - end - - ---@type SpringSyncedMock - local mock = { - CMD = Spring and Spring.CMD or { - LOAD_ONTO = 1, - SELFD = 2, - GUARD = 25, - REPAIR = 40, - RECLAIM = 90 - }, - GetModOptions = function() - -- Return only the mod options that were explicitly set via WithModOption/WithModOptions - return instance.modOptions - end, - GetGameFrame = function() - return instance.gameFrame - end, - IsCheatingEnabled = function() - return instance.cheatingEnabled - end, - Log = function(tag, level, msg) - table.insert(instance.logMessages, {tag = tag, level = level, msg = msg}) - end, - GetLoggedMessages = function() - return instance.logMessages - end, - GetTeamRulesParam = function(teamID, key) - return rulesParams[teamID] and rulesParams[teamID][key] or nil - end, - SetTeamRulesParam = function(teamID, key, value) - rulesParams[teamID] = rulesParams[teamID] or {} - rulesParams[teamID][key] = value - end, - GetTeamList = function() - local teamIds = {} - local i = 1 - for teamId, _ in pairs(builtTeams) do - teamIds[i] = teamId - i = i + 1 - end - return teamIds - end, - GetPlayerInfo = function(playerID, getPlayerOpts) - for _, teamData in pairs(builtTeams) do - if teamData.players then - for _, player in ipairs(teamData.players) do - if player.id == playerID then - local name = player.name or ("Player " .. tostring(playerID)) - local active = player.active ~= false - local spectator = player.spectator or false - local teamID = teamData.id - local allyTeamID = teamData.allyTeam or teamID - local pingTime = player.pingTime or 0 - local cpuUsage = player.cpuUsage or 0 - local country = player.country or "XX" - local rank = player.rank or 0 - local hasSkirmishAIsInTeam = player.hasSkirmishAIsInTeam or false - local playerOpts = player.playerOpts or {} - local desynced = player.desynced or false - return name, active, spectator, teamID, allyTeamID, pingTime, cpuUsage, country, rank, hasSkirmishAIsInTeam, playerOpts, desynced - end - end - end - end - return ("Player " .. tostring(playerID)), false, true, -1, -1, 0, 0, "XX", 0, false, {}, false - end, - - GetTeamResources = function(teamID, resourceType) - local data = getResourceStore(teamID, resourceType) - return data.current, data.storage, data.pull, data.income, data.expense, data.shareSlider, data.sent, data.received - end, - -- Convenience accessors for tests - __getInitialUnits = function() - return instance.initialUnits - end, - GetUnitDefs = function() - -- Return instance globals from WithRealUnitDefs - if instance._globalUnitDefs then - return instance._globalUnitDefs - end - - -- Otherwise, return registered unitDefs from team builders - local unitDefs = {} - local registeredUnitDefIds = {} - - -- Collect all unique unitDefIds from teams' units - for teamId, teamBuilder in pairs(builtTeams) do - if teamBuilder.units then - for unitId, unitWrapper in pairs(teamBuilder.units) do - if unitWrapper.unitDefId then - registeredUnitDefIds[unitWrapper.unitDefId] = true - end - end - end - end - - -- Create mock unitDefs for registered unitDefIds - for unitDefId in pairs(registeredUnitDefIds) do - -- Create a basic mock unitDef - this may need to be enhanced based on what properties are checked - local mockDef = { - id = unitDefId, - name = "mock_unit_" .. unitDefId, - isFactory = false, - canAssist = false, - buildOptions = {}, - customParams = { - techlevel = 1, - unitgroup = "combat" - } - } - unitDefs[unitDefId] = mockDef - end - - return unitDefs - end, - GetUnitDefNames = function() - return instance._globalUnitDefNames - end, - - _builtTeams = builtTeams, - setDataCalls = resourceSetCalls, - __resourceSetCalls = resourceSetCalls, - __clearResourceDataCalls = function() - for i = #resourceSetCalls, 1, -1 do - resourceSetCalls[i] = nil - end - end, - - GetPlayerList = function(teamID) - if teamID then - local teamData = builtTeams[teamID] - if not teamData then return {} end - local players = teamData.players or {} - local ids = {} - for i, player in ipairs(players) do - ids[i] = player.id - end - if #ids == 0 then - ids[1] = teamData.leader or teamID - end - return ids - end - - local all = {} - for _, teamData in pairs(builtTeams) do - local players = teamData.players or {} - if #players > 0 then - for _, player in ipairs(players) do - table.insert(all, player.id) - end - else - table.insert(all, teamData.leader or teamData.id) - end - end - return all - end, - - GetTeamUnits = function(teamID) - local teamData = builtTeams[teamID] - if not teamData or not teamData.units then - return {} - end - - local unitIds = {} - local i = 1 - for unitID in pairs(teamData.units) do - unitIds[i] = unitID - i = i + 1 - end - return unitIds - end, - - GetUnitTeam = function(unitID) - for teamId, teamBuilder in pairs(builtTeams) do - if teamBuilder.units then - for uId, uData in pairs(teamBuilder.units) do - if uId == unitID then - return teamId - end - end - end - end - return nil - end, - - GetUnitDefID = function(unitID) - for _, teamBuilder in pairs(builtTeams) do - if teamBuilder.units then - local unitWrapper = teamBuilder.units[unitID] - if unitWrapper then - local id = unitWrapper.unitDefId - if type(id) == "number" then - return id - end - local name = unitWrapper.unitDefName or unitWrapper.unitDefId - if instance._globalUnitDefNames and name and instance._globalUnitDefNames[name] then - id = instance._globalUnitDefNames[name].id - unitWrapper.unitDefId = id - return id - end - if unitWrapper.unitDef and type(unitWrapper.unitDef.id) == "number" then - unitWrapper.unitDefId = unitWrapper.unitDef.id - return unitWrapper.unitDefId - end - return id - end - end - end - return nil - end, - - GiveOrderToUnit = function(unitID, cmdID, params, options) - return true - end, - - AddTeamResource = function(teamID, resourceType, amount) - local teamData = builtTeams[teamID] - if teamData then - if resourceType == "metal" then - teamData.metal.current = teamData.metal.current + amount - elseif resourceType == "energy" then - teamData.energy.current = teamData.energy.current + amount - end - end - return true, amount - end, - - ValidUnitID = function(unitID) - for teamId, teamBuilder in pairs(builtTeams) do - if teamBuilder.units and teamBuilder.units[unitID] then - return true - end - end - return false - end, - - GetUnitIsBeingBuilt = function(unitID) - for _, teamData in pairs(builtTeams) do - if teamData.units and teamData.units[unitID] then - local wrapper = teamData.units[unitID] - return wrapper.beingBuilt or false, wrapper.buildProgress or 1.0 - end - end - return false, 1.0 - end, - - TransferUnit = function(unitID, newTeamID, given) - local currentTeamID = nil - local unitDefID = nil - for teamId, teamBuilder in pairs(builtTeams) do - if teamBuilder.units and teamBuilder.units[unitID] then - currentTeamID = teamId - unitDefID = teamBuilder.units[unitID].unitDefId - break - end - end - - if not currentTeamID then - return false - end - - if currentTeamID == newTeamID then - return true - end - - if builtTeams[currentTeamID] and builtTeams[currentTeamID].units then - builtTeams[currentTeamID].units[unitID] = nil - end - - if not builtTeams[newTeamID] then - builtTeams[newTeamID] = {units = {}} - end - if not builtTeams[newTeamID].units then - builtTeams[newTeamID].units = {} - end - builtTeams[newTeamID].units[unitID] = {unitDefId = unitDefID} - - return true - end, - - AreTeamsAllied = function(team1ID, team2ID) - if team1ID == team2ID then return true end - if instance.alliances[team1ID] and instance.alliances[team1ID][team2ID] ~= nil then - return instance.alliances[team1ID][team2ID] - end - return false - end, - - GetGaiaTeamID = function() - return -1 - end, - - GetTeamInfo = function(teamID, getUnread) - local teamData = builtTeams[teamID] - if teamData then - local name = teamData.name or ("Team " .. tostring(teamID)) - local leader = teamData.leader or 0 - local isDead = teamData.isDead or false - local isAI = teamData.isAI or false - local side = teamData.side or "arm" - local allyTeam = teamData.allyTeam or teamID - local customTeamKeys = teamData.customTeamKeys or {} - local incomeMultiplier = teamData.incomeMultiplier or 1 - local customOpts = teamData.customOpts or 0 - return name, leader, isDead, isAI, side, allyTeam, customTeamKeys, incomeMultiplier, customOpts - end - return "Unknown", 0, true, false, "arm", -1, {}, 1, 0 - end, - - GetTeamLuaAI = function(teamID) - local teamData = builtTeams[teamID] - if teamData and teamData.luaAI then - return teamData.luaAI - end - return "" - end, - - SetTeamShareLevel = function(teamID, resource, level) - local teamData = builtTeams[teamID] - if teamData then - local normalized = normalizeResourceType(resource) - if normalized == ResourceTypes.METAL then - teamData.metal.shareSlider = level - else - teamData.energy.shareSlider = level - end - end - end, - - GetAuditTimer = function() - return 0 - end, - - GetTeamAllyTeamID = function(teamID) - local teamData = builtTeams[teamID] - if teamData then - return teamData.allyTeam or teamID - end - return nil - end, - - GetPlayerListUnpacked = function() - local result = {} - for _, teamData in pairs(builtTeams) do - result[#result + 1] = teamData - end - if #result == 0 then return nil end - return result - end, - - GetPlayerIdsList = function() - local ids = {} - for _, teamData in pairs(builtTeams) do - if teamData.players then - for _, player in ipairs(teamData.players) do - ids[#ids + 1] = player.id - end - end - end - if #ids == 0 then return nil end - return ids - end, - } - - return mock -end - ----Temporarily install minimal global Spring/VFS/Game/LOG (spec_helper does some of this but we try for thoroughness) to allow real unitdefs load ----@param self SpringSyncedBuilder ----@param fn fun() ----@param persist? boolean If true, don't clean up globals after execution -function SB:WithGlobalsDefined(fn, persist) - local instance = self - -- Save current globals - local prevSpring = _G.Spring - local prevVFS = _G.VFS - local prevGame = _G.Game - local prevLOG = _G.LOG - local prevSplit = string.split - local prevUnitDefs = _G.UnitDefs - local prevUnitDefNames = _G.UnitDefNames - - -- Set up mocks for the duration of the function - _G.Spring = _G.Spring or {} - local mock = self:BuildSpring() - - -- Expose all Spring functions to global Spring object - -- Defer to already defined GetModOptions if it exists (defined by springOverrides.lua) - if not _G.Spring.GetModOptions then - ---@diagnostic disable: duplicate-set-field - _G.Spring.GetModOptions = function() - -- Start with comprehensive defaults, then override with explicitly set mod options - local modOptions = getUnitDefRequireModoptionDefaults() - -- Override with any mod options that were explicitly set via WithModOption - for k, v in pairs(self.modOptions) do - modOptions[k] = v - end - return modOptions - end - end - _G.Spring.GetGameFrame = mock.GetGameFrame - _G.Spring.IsCheatingEnabled = mock.IsCheatingEnabled - -- Don't override Spring.Log if it's already set by spec_helper - if not _G.Spring.Log then - _G.Spring.Log = mock.Log - end - _G.Spring.GetTeamRulesParam = mock.GetTeamRulesParam - _G.Spring.SetTeamRulesParam = mock.SetTeamRulesParam - _G.Spring.GetUnitDefID = mock.GetUnitDefID - _G.Spring.ValidUnitID = mock.ValidUnitID - - - -- Additional Spring functions that may be needed - -- Defer to already defined GetTeamLuaAI if it exists (real Spring API function) - if not _G.Spring.GetTeamLuaAI then - ---@diagnostic disable: duplicate-set-field - _G.Spring.GetTeamLuaAI = function(_) return "" end - end - if not _G.Spring.GetConfigInt then - _G.Spring.GetConfigInt = function(name, default) return default or 0 end - end - _G.Spring.Utilities = _G.Spring.Utilities or { Gametype = { IsScavengers = function() return false end, IsRaptors = function() return false end, GetCurrentHolidays = function() return {} end } } - - -- Mock VFS.Include cache to intercept system.lua load - local originalVFSInclude = _G.VFS.Include - _G.VFS.Include = function(path, ...) - if path == "gamedata/system.lua" then - return { - lowerkeys = function(t) return t end, - reftable = function(ref, tbl) - tbl = tbl or {} - setmetatable(tbl, { __index = ref }) - return tbl - end, - VFS = _G.VFS, - Spring = _G.Spring, - -- Export standard Lua libs as system.lua does - pairs = pairs, - ipairs = ipairs, - math = math, - table = table, - string = string, - tonumber = tonumber, - tostring = tostring, - type = type, - unpack = unpack or table.unpack, - print = print, - error = error, - pcall = pcall, - select = select, - next = next, - require = require - } - end - if originalVFSInclude then - return originalVFSInclude(path, ...) - end - -- Fallback if original was nil (unlikely given setup) - return {} - end - - _G.LOG = _G.LOG or { DEBUG = "DEBUG", INFO = "INFO", WARNING = "WARNING", ERROR = "ERROR" } - _G.Game = _G.Game or {} - _G.Game.gameSpeed = _G.Game.gameSpeed or 30 - -- Make sure these are available in the environment - _G.pairs = pairs - _G.ipairs = ipairs - _G.math = math - _G.table = table - _G.string = string - _G.type = type - _G.tostring = tostring - _G.tonumber = tonumber - _G.unpack = unpack or table.unpack - _G.print = print - _G.error = error - _G.pcall = pcall - _G.select = select - _G.next = next - _G.require = require - - -- Execute the function with globals set up - local success, result = pcall(fn) - if not success then - error("WithGlobalsDefined function failed: " .. tostring(result)) - end - - -- If not persisting, restore original globals - if not persist then - _G.Spring = prevSpring - _G.VFS = prevVFS - _G.Game = prevGame - _G.LOG = prevLOG - string.split = prevSplit - _G.UnitDefs = prevUnitDefs - _G.UnitDefNames = prevUnitDefNames - end - - return instance -end - - ----@param self SpringSyncedBuilder ----@param teamBuilder TeamBuilder The team builder instance ----@return SpringSyncedBuilder -function SB:WithTeam(teamBuilder) - if not teamBuilder.id then - error("TeamBuilder must have an id field. teamBuilder: " .. table.toString(teamBuilder)) - end - self.teams[teamBuilder.id] = teamBuilder - return self -end - ----Register a unit definition. Accepts either a UnitDefBuilder or a (defID, defTable) pair. ----Delegates to the shared UnitDefsBuilder registry. ----@overload fun(self: SpringSyncedBuilder, udb: UnitDefBuilder): SpringSyncedBuilder ----@param defID number ----@param def table ----@return SpringSyncedBuilder -function SB:WithUnitDef(defID, def) - self.unitDefs:WithUnitDef(defID, def) - return self -end - ----Load real BAR UnitDefs from gamedata into the registry. ----Uses WithGlobalsDefined as the harness so modoptions are honored during the load. ----After loading, normalizes the defs into the polyglot index that downstream code ----(GetUnitDefs, BuildSpring team-resolution) expects. ----@param self SpringSyncedBuilder ----@return SpringSyncedBuilder -function SB:WithRealUnitDefs() - if self._globalUnitDefs then return self end - - self.unitDefs:WithRealUnitDefs(function(loadFn) - self:WithGlobalsDefined(loadFn) - end) - - -- Build the polyglot index downstream code reads via _globalUnitDefs. - -- In the gamedata pre-load shape this is name-keyed (no numeric IDs); - -- buildUnitDefIndex also runs normalizeUnitDef to fold customParams etc. - local byName = self.unitDefs:GetUnitDefsByName() - if next(byName) ~= nil then - self._globalUnitDefs = buildUnitDefIndex(byName, self.unitDefs:GetUnitDefNames()) - self._globalUnitDefNames = self.unitDefs:GetUnitDefNames() - end - return self -end - - -return SB diff --git a/spec/builders/team_builder.lua b/spec/builders/team_builder.lua index 658d73af765..6af19958f1a 100644 --- a/spec/builders/team_builder.lua +++ b/spec/builders/team_builder.lua @@ -1,13 +1,18 @@ -- Team Builder -- Builds individual team/player configurations with automatic ID generation -local Sides = require("gamedata/sides_enum") local Definitions = require("luaui/Include/blueprint_substitution/definitions") +local Sides = require("gamedata/sides_enum") local ResourceDataBuilder = VFS.Include("spec/builders/resource_data_builder.lua") local sequence = require("spec/builders/sequence") -local nextPlayerId = sequence.sequence("player_id", { start = 100, format = function(_, n) return n end }) +local nextPlayerId = sequence.sequence("player_id", { + start = 100, + format = function(_, n) + return n + end, +}) ---@class TeamDataMock : TeamData ---@field isHuman boolean @@ -23,116 +28,118 @@ TeamBuilder.__index = TeamBuilder ---@type TeamDataMock local defaultData = { - id = 0, - name = "Team", - isHuman = true, - playerName = "Player", - leader = 0, - isDead = false, - isAI = false, - side = Sides.ARMADA, - allyTeam = 0, - units = {}, - players = {}, - metal = ResourceDataBuilder.new() - :WithCurrent(1000) - :WithStorage(1000) - :WithShareSlider(100) - :WithResourceType("metal") - :Build(), - energy = ResourceDataBuilder.new() - :WithCurrent(1000) - :WithStorage(1000) - :WithShareSlider(100) - :WithResourceType("energy") - :Build(), + id = 0, + name = "Team", + isHuman = true, + playerName = "Player", + leader = 0, + isDead = false, + isAI = false, + side = Sides.ARMADA, + allyTeam = 0, + units = {}, + players = {}, + metal = ResourceDataBuilder.new():WithCurrent(1000):WithStorage(1000):WithShareSlider(100):WithResourceType("metal"):Build(), + energy = ResourceDataBuilder.new():WithCurrent(1000):WithStorage(1000):WithShareSlider(100):WithResourceType("energy"):Build(), } -local nextTeamId = sequence.sequence("team_id", { start = 0, format = function(_, n) return n end }) -local nextUnitId = sequence.sequence("unit_id", { start = 1, format = function(p, n) return tostring(n) end }) +local nextTeamId = sequence.sequence("team_id", { + start = 0, + format = function(_, n) + return n + end, +}) +local nextUnitId = sequence.sequence("unit_id", { + start = 1, + format = function(p, n) + return tostring(n) + end, +}) function TeamBuilder.new() - local instance = {} - - -- Copy default data - for k, v in pairs(defaultData) do - if type(v) == "table" then - local t = {} - for k2, v2 in pairs(v) do t[k2] = v2 end - instance[k] = t - else - instance[k] = v - end - end - - -- Assign unique IDs - team ID and player ID are deliberately different - instance.id = tonumber(nextTeamId()) - local defaultLeaderPlayerId = tonumber(nextPlayerId()) - instance.leader = defaultLeaderPlayerId - instance.allyTeam = instance.id - - -- Initialize default leader player for this team - instance.players = { - { - id = defaultLeaderPlayerId, - name = instance.playerName, - active = true, - spectator = false, - pingTime = 0, - cpuUsage = 0, - country = "XX", - rank = 0, - hasSkirmishAIsInTeam = false, - playerOpts = {}, - desynced = false, - } - } - - return setmetatable(instance, { __index = TeamBuilder }) + local instance = {} + + -- Copy default data + for k, v in pairs(defaultData) do + if type(v) == "table" then + local t = {} + for k2, v2 in pairs(v) do + t[k2] = v2 + end + instance[k] = t + else + instance[k] = v + end + end + + -- Assign unique IDs - team ID and player ID are deliberately different + instance.id = tonumber(nextTeamId()) + local defaultLeaderPlayerId = tonumber(nextPlayerId()) + instance.leader = defaultLeaderPlayerId + instance.allyTeam = instance.id + + -- Initialize default leader player for this team + instance.players = { + { + id = defaultLeaderPlayerId, + name = instance.playerName, + active = true, + spectator = false, + pingTime = 0, + cpuUsage = 0, + country = "XX", + rank = 0, + hasSkirmishAIsInTeam = false, + playerOpts = {}, + desynced = false, + }, + } + + return setmetatable(instance, { __index = TeamBuilder }) end function TeamBuilder:WithID(teamID) - if type(teamID) ~= "number" then - error("TeamBuilder:WithID requires a numeric teamID") - end - self.id = teamID - return self + if type(teamID) ~= "number" then + error("TeamBuilder:WithID requires a numeric teamID") + end + self.id = teamID + return self end function TeamBuilder:WithAllyTeam(allyTeamID) - if type(allyTeamID) ~= "number" then - error("TeamBuilder:WithAllyTeam requires a numeric allyTeamID") - end - self.allyTeam = allyTeamID - return self + if type(allyTeamID) ~= "number" then + error("TeamBuilder:WithAllyTeam requires a numeric allyTeamID") + end + self.allyTeam = allyTeamID + return self end function TeamBuilder:Build() - ---@type TeamDataMock - local out = { - id = self.id, - name = self.name, - isHuman = self.isHuman, - playerName = self.playerName, - leader = self.leader, - isDead = self.isDead, - isAI = not self.isHuman, - side = self.side, - allyTeam = self.allyTeam, - units = self.units, - players = self.players, - metal = self.metal, - energy = self.energy, - } - return out + ---@type TeamDataMock + local out = { + id = self.id, + name = self.name, + isHuman = self.isHuman, + playerName = self.playerName, + leader = self.leader, + isDead = self.isDead, + isAI = not self.isHuman, + side = self.side, + allyTeam = self.allyTeam, + units = self.units, + players = self.players, + metal = self.metal, + energy = self.energy, + } + return out end ---@param self TeamBuilder ---@param metal number ---@return TeamBuilder function TeamBuilder:WithMetal(metal) - self.metal.current = metal - return self + self.metal.current = metal + return self end ---@param self TeamBuilder @@ -140,122 +147,122 @@ end ---@param unitIdCallback fun(unitID: number)|nil ---@return TeamBuilder function TeamBuilder:WithUnit(unitDefID, unitIdCallback) - local rawUnitId = nextUnitId() - local unitID = tonumber(rawUnitId) - if unitID == nil then - error(string.format("Generated unit ID '%s' is not numeric", tostring(rawUnitId))) - end - - -- Create wrapper object with just the unitDefId - real data populated later by SpringSyncedBuilder - local unitWrapper = { unitDefId = unitDefID } - - local units = self.units - if units == nil then - units = {} - self.units = units - end - units[unitID] = unitWrapper - - if unitIdCallback then - unitIdCallback(unitID) - end - - return self + local rawUnitId = nextUnitId() + local unitID = tonumber(rawUnitId) + if unitID == nil then + error(string.format("Generated unit ID '%s' is not numeric", tostring(rawUnitId))) + end + + -- Create wrapper object with just the unitDefId - real data populated later by EngineSyncedBuilder + local unitWrapper = { unitDefId = unitDefID } + + local units = self.units + if units == nil then + units = {} + self.units = units + end + units[unitID] = unitWrapper + + if unitIdCallback then + unitIdCallback(unitID) + end + + return self end ---@param self TeamBuilder ---@return TeamBuilder function TeamBuilder:AI() - self.isHuman = false - return self + self.isHuman = false + return self end ---@param self TeamBuilder ---@return TeamBuilder function TeamBuilder:Human() - self.isHuman = true - return self + self.isHuman = true + return self end ---@param self TeamBuilder ---@param energy number ---@return TeamBuilder function TeamBuilder:WithEnergy(energy) - self.energy.current = energy - return self + self.energy.current = energy + return self end ---@param self TeamBuilder ---@param storage number ---@return TeamBuilder function TeamBuilder:WithEnergyStorage(storage) - self.energy.storage = storage - return self + self.energy.storage = storage + return self end function TeamBuilder:WithMetalStorage(storage) - self.metal.storage = storage - return self + self.metal.storage = storage + return self end function TeamBuilder:WithMetalPull(pull) - self.metal.pull = pull - return self + self.metal.pull = pull + return self end function TeamBuilder:WithMetalIncome(income) - self.metal.income = income - return self + self.metal.income = income + return self end function TeamBuilder:WithMetalExpense(expense) - self.metal.expense = expense - return self + self.metal.expense = expense + return self end function TeamBuilder:WithMetalShareSlider(shareSlider) - self.metal.shareSlider = shareSlider - return self + self.metal.shareSlider = shareSlider + return self end function TeamBuilder:WithMetalSent(sent) - self.metal.sent = sent - return self + self.metal.sent = sent + return self end function TeamBuilder:WithMetalReceived(received) - self.metal.received = received - return self + self.metal.received = received + return self end function TeamBuilder:WithEnergyPull(pull) - self.energy.pull = pull - return self + self.energy.pull = pull + return self end function TeamBuilder:WithEnergyIncome(income) - self.energy.income = income - return self + self.energy.income = income + return self end function TeamBuilder:WithEnergyExpense(expense) - self.energy.expense = expense - return self + self.energy.expense = expense + return self end function TeamBuilder:WithEnergyShareSlider(shareSlider) - self.energy.shareSlider = shareSlider - return self + self.energy.shareSlider = shareSlider + return self end function TeamBuilder:WithEnergySent(sent) - self.energy.sent = sent - return self + self.energy.sent = sent + return self end function TeamBuilder:WithEnergyReceived(received) - self.energy.received = received - return self + self.energy.received = received + return self end ---@param self TeamBuilder @@ -263,55 +270,55 @@ end ---@param opts table|nil ---@return TeamBuilder function TeamBuilder:WithPlayer(playerId, opts) - local player = { - id = playerId, - name = (opts and opts.name) or self.playerName, - active = (opts and opts.active) ~= false, - spectator = (opts and opts.spectator) or false, - pingTime = (opts and opts.pingTime) or 0, - cpuUsage = (opts and opts.cpuUsage) or 0, - country = (opts and opts.country) or "XX", - rank = (opts and opts.rank) or 0, - hasSkirmishAIsInTeam = (opts and opts.hasSkirmishAIsInTeam) or false, - playerOpts = (opts and opts.playerOpts) or {}, - desynced = (opts and opts.desynced) or false, - } - for i, p in ipairs(self.players) do - if p.id == playerId then - self.players[i] = player - return self - end - end - table.insert(self.players, player) - return self + local player = { + id = playerId, + name = (opts and opts.name) or self.playerName, + active = (opts and opts.active) ~= false, + spectator = (opts and opts.spectator) or false, + pingTime = (opts and opts.pingTime) or 0, + cpuUsage = (opts and opts.cpuUsage) or 0, + country = (opts and opts.country) or "XX", + rank = (opts and opts.rank) or 0, + hasSkirmishAIsInTeam = (opts and opts.hasSkirmishAIsInTeam) or false, + playerOpts = (opts and opts.playerOpts) or {}, + desynced = (opts and opts.desynced) or false, + } + for i, p in ipairs(self.players) do + if p.id == playerId then + self.players[i] = player + return self + end + end + table.insert(self.players, player) + return self end ---@param self TeamBuilder ---@param playerId number ---@return TeamBuilder function TeamBuilder:WithLeader(playerId) - self.leader = playerId - local exists = false - for _, p in ipairs(self.players) do - if p.id == playerId then - exists = true - break - end - end - if not exists then - self:WithPlayer(playerId, { name = self.playerName, active = true, spectator = false }) - end - return self + self.leader = playerId + local exists = false + for _, p in ipairs(self.players) do + if p.id == playerId then + exists = true + break + end + end + if not exists then + self:WithPlayer(playerId, { name = self.playerName, active = true, spectator = false }) + end + return self end function TeamBuilder:WithUnitFromCategory(category, side) - local actualSide = side or Sides.ARMADA - local unitDefId = Definitions.getUnitByCategory(category, actualSide) - if not unitDefId then - error("WithUnitFromCategory: getUnitByCategory returned nil for category '" .. tostring(category) .. "' and side '" .. tostring(actualSide) .. "'") - end + local actualSide = side or Sides.ARMADA + local unitDefId = Definitions.getUnitByCategory(category, actualSide) + if not unitDefId then + error("WithUnitFromCategory: getUnitByCategory returned nil for category '" .. tostring(category) .. "' and side '" .. tostring(actualSide) .. "'") + end - return self:WithUnit(unitDefId) + return self:WithUnit(unitDefId) end -return TeamBuilder \ No newline at end of file +return TeamBuilder diff --git a/spec/builders/team_builder_spec.lua b/spec/builders/team_builder_spec.lua index 2c37f158871..c04bdadf775 100644 --- a/spec/builders/team_builder_spec.lua +++ b/spec/builders/team_builder_spec.lua @@ -1,25 +1,23 @@ local Builders = VFS.Include("spec/builders/index.lua") describe("TeamBuilder", function() - it("should create teams with unique IDs", function() - local team1 = Builders.Team.new() - local team2 = Builders.Team.new() - assert.is_number(team1.id) - assert.is_number(team2.id) - assert.are_not.equal(team1.id, team2.id) - end) + it("should create teams with unique IDs", function() + local team1 = Builders.Team.new() + local team2 = Builders.Team.new() + assert.is_number(team1.id) + assert.is_number(team2.id) + assert.are_not.equal(team1.id, team2.id) + end) - it("should build teams with units", function() - local team = Builders.Team.new() - :WithMetal(500) - :WithUnit("armcom") - :WithUnit("corcom") - :Build() + it("should build teams with units", function() + local team = Builders.Team.new():WithMetal(500):WithUnit("armcom"):WithUnit("corcom"):Build() - ---@diagnostic disable-next-line: undefined-field - assert.are.equal(500, team.metal.current) - local unitCount = 0 - for _ in pairs(team.units) do unitCount = unitCount + 1 end - assert.are.equal(2, unitCount) - end) + ---@diagnostic disable-next-line: undefined-field + assert.are.equal(500, team.metal.current) + local unitCount = 0 + for _ in pairs(team.units) do + unitCount = unitCount + 1 + end + assert.are.equal(2, unitCount) + end) end) diff --git a/spec/builders/unit_def_builder.lua b/spec/builders/unit_def_builder.lua index 3494b23c82b..fe2bcc3bbd7 100644 --- a/spec/builders/unit_def_builder.lua +++ b/spec/builders/unit_def_builder.lua @@ -12,68 +12,68 @@ UDB.__index = UDB ---@param name string ---@return UnitDefBuilder function UDB.new(name) - return setmetatable({ - _def = { - name = name, - buildSpeed = 0, - buildOptions = {}, - cost = 0, - xsize = 1, - zsize = 1, - }, - _defID = nil, - }, UDB) + return setmetatable({ + _def = { + name = name, + buildSpeed = 0, + buildOptions = {}, + cost = 0, + xsize = 1, + zsize = 1, + }, + _defID = nil, + }, UDB) end ---@param defID number ---@return UnitDefBuilder function UDB:WithDefID(defID) - self._defID = defID - return self + self._defID = defID + return self end ---@param buildSpeed number ---@return UnitDefBuilder function UDB:WithSpeed(buildSpeed) - self._def.buildSpeed = buildSpeed - return self + self._def.buildSpeed = buildSpeed + return self end ---@param cost number ---@return UnitDefBuilder function UDB:WithCost(cost) - self._def.cost = cost - return self + self._def.cost = cost + return self end ---@param xsize number ---@param zsize number ---@return UnitDefBuilder function UDB:WithFootprint(xsize, zsize) - self._def.xsize = xsize - self._def.zsize = zsize - return self + self._def.xsize = xsize + self._def.zsize = zsize + return self end ---List the defIDs this unit can construct. ---@param ... number ---@return UnitDefBuilder function UDB:Builds(...) - self._def.buildOptions = { ... } - return self + self._def.buildOptions = { ... } + return self end ---@return number function UDB:GetDefID() - if not self._defID then - error("UnitDefBuilder for '" .. tostring(self._def.name) .. "' is missing defID; call :WithDefID(n)") - end - return self._defID + if not self._defID then + error("UnitDefBuilder for '" .. tostring(self._def.name) .. "' is missing defID; call :WithDefID(n)") + end + return self._defID end ---@return table function UDB:GetDef() - return self._def + return self._def end return UDB diff --git a/spec/builders/unit_defs_builder.lua b/spec/builders/unit_defs_builder.lua index 695148e6823..a78700df523 100644 --- a/spec/builders/unit_defs_builder.lua +++ b/spec/builders/unit_defs_builder.lua @@ -1,6 +1,6 @@ -- Unit Defs Builder -- Shared registry of unit definitions and live unit instances, used by both --- SpringSyncedBuilder and SpringUnsyncedBuilder so they don't each carry +-- EngineSyncedBuilder and EngineUnsyncedBuilder so they don't each carry -- their own copy of WithUnitDef / WithUnit / WithRealUnitDefs. -- -- Two views of the registered defs are exposed: @@ -18,13 +18,13 @@ local UDFB = {} UDFB.__index = UDFB function UDFB.new() - return setmetatable({ - _byID = {}, - _byName = {}, - _names = {}, - _instances = {}, - _realLoaded = false, - }, UDFB) + return setmetatable({ + _byID = {}, + _byName = {}, + _names = {}, + _instances = {}, + _realLoaded = false, + }, UDFB) end ---Register a unit definition. Accepts either a UnitDefBuilder or a (defID, defTable) pair. @@ -33,23 +33,23 @@ end ---@param def table ---@return UnitDefsBuilder function UDFB:WithUnitDef(defID, def) - local resolvedID, resolvedDef - if type(defID) == "table" and defID.GetDefID then - ---@type UnitDefBuilder - local udb = defID - resolvedID = udb:GetDefID() - resolvedDef = udb:GetDef() - else - ---@cast defID number - resolvedID = defID - resolvedDef = def - end - self._byID[resolvedID] = resolvedDef - if resolvedDef.name then - self._byName[resolvedDef.name] = resolvedDef - self._names[resolvedDef.name] = { id = resolvedID } - end - return self + local resolvedID, resolvedDef + if type(defID) == "table" and defID.GetDefID then + ---@type UnitDefBuilder + local udb = defID + resolvedID = udb:GetDefID() + resolvedDef = udb:GetDef() + else + ---@cast defID number + resolvedID = defID + resolvedDef = def + end + self._byID[resolvedID] = resolvedDef + if resolvedDef.name then + self._byName[resolvedDef.name] = resolvedDef + self._names[resolvedDef.name] = { id = resolvedID } + end + return self end ---Register a live unit instance. defIDOrName accepts either a numeric defID @@ -59,23 +59,23 @@ end ---@param defIDOrName number|string ---@return UnitDefsBuilder function UDFB:WithUnit(unitID, defIDOrName) - local defID - if type(defIDOrName) == "string" then - local entry = self._names[defIDOrName] - if not entry then - error(("UnitDefsBuilder:WithUnit unknown unit name '%s' — register via :WithUnitDef or :WithRealUnitDefs first"):format(defIDOrName)) - end - defID = entry.id - elseif type(defIDOrName) == "number" then - if not self._byID[defIDOrName] then - error(("UnitDefsBuilder:WithUnit unknown defID %d — register via :WithUnitDef or :WithRealUnitDefs first"):format(defIDOrName)) - end - defID = defIDOrName - else - error("UnitDefsBuilder:WithUnit expected unit name or numeric defID, got " .. type(defIDOrName)) - end - self._instances[unitID] = defID - return self + local defID + if type(defIDOrName) == "string" then + local entry = self._names[defIDOrName] + if not entry then + error(("UnitDefsBuilder:WithUnit unknown unit name '%s' — register via :WithUnitDef or :WithRealUnitDefs first"):format(defIDOrName)) + end + defID = entry.id + elseif type(defIDOrName) == "number" then + if not self._byID[defIDOrName] then + error(("UnitDefsBuilder:WithUnit unknown defID %d — register via :WithUnitDef or :WithRealUnitDefs first"):format(defIDOrName)) + end + defID = defIDOrName + else + error("UnitDefsBuilder:WithUnit expected unit name or numeric defID, got " .. type(defIDOrName)) + end + self._instances[unitID] = defID + return self end ---Load real BAR UnitDefs from gamedata into the registry. @@ -87,71 +87,85 @@ end ---@param loadHarness? fun(loadFn: fun()) ---@return UnitDefsBuilder function UDFB:WithRealUnitDefs(loadHarness) - if self._realLoaded then return self end + if self._realLoaded then + return self + end - local function load() - local prevDefs = _G.UnitDefs - local prevNames = _G.UnitDefNames + local function load() + local prevDefs = _G.UnitDefs + local prevNames = _G.UnitDefNames - local success, defs = pcall(require, "gamedata.unitdefs") - if not success or type(defs) ~= "table" then - _G.UnitDefs = prevDefs - _G.UnitDefNames = prevNames - return - end - ---@diagnostic disable-next-line: global-in-non-module - _G.UnitDefs = defs - pcall(require, "gamedata.alldefs_post") - pcall(require, "gamedata.unitdefs_post") + local success, defs = pcall(require, "gamedata.unitdefs") + if not success or type(defs) ~= "table" then + _G.UnitDefs = prevDefs + _G.UnitDefNames = prevNames + return + end + ---@diagnostic disable-next-line: global-in-non-module + _G.UnitDefs = defs + pcall(require, "gamedata.alldefs_post") + pcall(require, "gamedata.unitdefs_post") - local loaded = _G.UnitDefs - local names = _G.UnitDefNames - if type(loaded) == "table" then - for _, def in pairs(loaded) do - if def.builder ~= nil and def.isBuilder == nil then - def.isBuilder = def.builder - end - end - -- Post-load shape is name-keyed (BAR's gamedata flow); - -- UnitDefNames carries the numeric id mapping. - for name, def in pairs(loaded) do - if type(def) == "table" then - self._byName[name] = def - local info = names and names[name] - local id = info and info.id - if id then - self._byID[id] = def - self._names[name] = { id = id } - end - end - end - end - ---@diagnostic disable-next-line: global-in-non-module - _G.UnitDefs = prevDefs - ---@diagnostic disable-next-line: global-in-non-module - _G.UnitDefNames = prevNames - end + local loaded = _G.UnitDefs + local names = _G.UnitDefNames + if type(loaded) == "table" then + for _, def in pairs(loaded) do + if def.builder ~= nil and def.isBuilder == nil then + def.isBuilder = def.builder + end + end + -- Post-load shape is name-keyed (BAR's gamedata flow); + -- UnitDefNames carries the numeric id mapping. + for name, def in pairs(loaded) do + if type(def) == "table" then + self._byName[name] = def + local info = names and names[name] + local id = info and info.id + if id then + self._byID[id] = def + self._names[name] = { id = id } + end + end + end + end + ---@diagnostic disable-next-line: global-in-non-module + _G.UnitDefs = prevDefs + ---@diagnostic disable-next-line: global-in-non-module + _G.UnitDefNames = prevNames + end - local harness = loadHarness or function(fn) fn() end - harness(load) - self._realLoaded = true - return self + local harness = loadHarness or function(fn) + fn() + end + harness(load) + self._realLoaded = true + return self end ---@return table -function UDFB:GetUnitDefsByID() return self._byID end +function UDFB:GetUnitDefsByID() + return self._byID +end ---@return table -function UDFB:GetUnitDefsByName() return self._byName end +function UDFB:GetUnitDefsByName() + return self._byName +end ---@return table -function UDFB:GetUnitDefNames() return self._names end +function UDFB:GetUnitDefNames() + return self._names +end ---@param unitID number ---@return number|nil -function UDFB:GetUnitDefID(unitID) return self._instances[unitID] end +function UDFB:GetUnitDefID(unitID) + return self._instances[unitID] +end ---@return boolean -function UDFB:HasRealDefs() return self._realLoaded end +function UDFB:HasRealDefs() + return self._realLoaded +end return UDFB diff --git a/spec/common/lib_polygon_spec.lua b/spec/common/lib_polygon_spec.lua index b5b637e5d7f..942d9c9640f 100644 --- a/spec/common/lib_polygon_spec.lua +++ b/spec/common/lib_polygon_spec.lua @@ -1,13 +1,12 @@ local PolygonLib = VFS.Include("common/lib_polygon.lua") describe("lib_polygon", function() - describe("PointInPolygon", function() local square = { - {0, 0}, - {100, 0}, - {100, 100}, - {0, 100}, + { 0, 0 }, + { 100, 0 }, + { 100, 100 }, + { 0, 100 }, } it("returns true for a point inside a square", function() @@ -24,20 +23,20 @@ describe("lib_polygon", function() it("returns true for a point near the center of a large polygon", function() -- rotated diamond shape local diamond = { - {50, 0}, - {100, 50}, - {50, 100}, - {0, 50}, + { 50, 0 }, + { 100, 50 }, + { 50, 100 }, + { 0, 50 }, } assert.is_true(PolygonLib.PointInPolygon(50, 50, diamond)) end) it("returns false for a point in the corner outside a diamond", function() local diamond = { - {50, 0}, - {100, 50}, - {50, 100}, - {0, 50}, + { 50, 0 }, + { 100, 50 }, + { 50, 100 }, + { 0, 50 }, } assert.is_false(PolygonLib.PointInPolygon(5, 5, diamond)) assert.is_false(PolygonLib.PointInPolygon(95, 5, diamond)) @@ -46,12 +45,12 @@ describe("lib_polygon", function() it("handles a concave L-shaped polygon", function() -- L-shape: top-left quadrant missing local lShape = { - {0, 0}, - {50, 0}, - {50, 50}, - {100, 50}, - {100, 100}, - {0, 100}, + { 0, 0 }, + { 50, 0 }, + { 50, 50 }, + { 100, 50 }, + { 100, 100 }, + { 0, 100 }, } -- inside the bottom part assert.is_true(PolygonLib.PointInPolygon(75, 75, lShape)) @@ -63,16 +62,16 @@ describe("lib_polygon", function() it("returns false for degenerate inputs", function() assert.is_false(PolygonLib.PointInPolygon(50, 50, {})) - assert.is_false(PolygonLib.PointInPolygon(50, 50, {{0, 0}})) - assert.is_false(PolygonLib.PointInPolygon(50, 50, {{0, 0}, {100, 0}})) + assert.is_false(PolygonLib.PointInPolygon(50, 50, { { 0, 0 } })) + assert.is_false(PolygonLib.PointInPolygon(50, 50, { { 0, 0 }, { 100, 0 } })) end) it("works with large map-scale coordinates", function() local bigBox = { - {0, 0}, - {16384, 0}, - {16384, 3276}, - {0, 3276}, + { 0, 0 }, + { 16384, 0 }, + { 16384, 3276 }, + { 0, 3276 }, } assert.is_true(PolygonLib.PointInPolygon(8192, 1638, bigBox)) assert.is_false(PolygonLib.PointInPolygon(8192, 5000, bigBox)) @@ -83,9 +82,9 @@ describe("lib_polygon", function() it("returns true when point is inside any sub-polygon", function() local entry = { boxes = { - {{0, 0}, {100, 0}, {100, 100}, {0, 100}}, - {{200, 200}, {300, 200}, {300, 300}, {200, 300}}, - } + { { 0, 0 }, { 100, 0 }, { 100, 100 }, { 0, 100 } }, + { { 200, 200 }, { 300, 200 }, { 300, 300 }, { 200, 300 } }, + }, } assert.is_true(PolygonLib.PointInStartbox(50, 50, entry)) assert.is_true(PolygonLib.PointInStartbox(250, 250, entry)) @@ -94,9 +93,9 @@ describe("lib_polygon", function() it("returns false when point is outside all sub-polygons", function() local entry = { boxes = { - {{0, 0}, {100, 0}, {100, 100}, {0, 100}}, - {{200, 200}, {300, 200}, {300, 300}, {200, 300}}, - } + { { 0, 0 }, { 100, 0 }, { 100, 100 }, { 0, 100 } }, + { { 200, 200 }, { 300, 200 }, { 300, 300 }, { 200, 300 } }, + }, } assert.is_false(PolygonLib.PointInStartbox(150, 150, entry)) end) @@ -111,8 +110,8 @@ describe("lib_polygon", function() it("returns bounding box of a single polygon", function() local entry = { boxes = { - {{10, 20}, {90, 20}, {90, 80}, {10, 80}}, - } + { { 10, 20 }, { 90, 20 }, { 90, 80 }, { 10, 80 } }, + }, } local xmin, zmin, xmax, zmax = PolygonLib.GetStartboxBounds(entry) assert.are.equal(10, xmin) @@ -124,9 +123,9 @@ describe("lib_polygon", function() it("returns combined bounding box of multiple sub-polygons", function() local entry = { boxes = { - {{0, 0}, {50, 0}, {50, 50}, {0, 50}}, - {{200, 300}, {400, 300}, {400, 500}, {200, 500}}, - } + { { 0, 0 }, { 50, 0 }, { 50, 50 }, { 0, 50 } }, + { { 200, 300 }, { 400, 300 }, { 400, 500 }, { 200, 500 } }, + }, } local xmin, zmin, xmax, zmax = PolygonLib.GetStartboxBounds(entry) assert.are.equal(0, xmin) diff --git a/spec/common/lib_spline_spec.lua b/spec/common/lib_spline_spec.lua index 2d0d5729001..933140beba9 100644 --- a/spec/common/lib_spline_spec.lua +++ b/spec/common/lib_spline_spec.lua @@ -7,26 +7,25 @@ local function pointsApproxEqual(a, b, eps) end describe("lib_spline", function() - describe("TessellateRing on plain polygons (no strengths)", function() it("returns the anchor points unchanged when no strengths are provided", function() - local anchors = { {0, 0}, {100, 0}, {100, 100}, {0, 100} } + local anchors = { { 0, 0 }, { 100, 0 }, { 100, 100 }, { 0, 100 } } local poly = SplineLib.TessellateRing(anchors) assert.are.equal(4, #poly) - assert.is_true(pointsApproxEqual(poly[1], {0, 0})) - assert.is_true(pointsApproxEqual(poly[2], {100, 0})) - assert.is_true(pointsApproxEqual(poly[3], {100, 100})) - assert.is_true(pointsApproxEqual(poly[4], {0, 100})) + assert.is_true(pointsApproxEqual(poly[1], { 0, 0 })) + assert.is_true(pointsApproxEqual(poly[2], { 100, 0 })) + assert.is_true(pointsApproxEqual(poly[3], { 100, 100 })) + assert.is_true(pointsApproxEqual(poly[4], { 0, 100 })) end) it("returns the anchor points unchanged when all strengths are zero", function() - local anchors = { {0, 0, 0}, {100, 0, 0}, {100, 100, 0}, {0, 100, 0} } + local anchors = { { 0, 0, 0 }, { 100, 0, 0 }, { 100, 100, 0 }, { 0, 100, 0 } } local poly = SplineLib.TessellateRing(anchors) assert.are.equal(4, #poly) - assert.is_true(pointsApproxEqual(poly[1], {0, 0})) - assert.is_true(pointsApproxEqual(poly[2], {100, 0})) - assert.is_true(pointsApproxEqual(poly[3], {100, 100})) - assert.is_true(pointsApproxEqual(poly[4], {0, 100})) + assert.is_true(pointsApproxEqual(poly[1], { 0, 0 })) + assert.is_true(pointsApproxEqual(poly[2], { 100, 0 })) + assert.is_true(pointsApproxEqual(poly[3], { 100, 100 })) + assert.is_true(pointsApproxEqual(poly[4], { 0, 100 })) end) it("anchor without strength next to anchor with strength stays a sharp corner", function() @@ -35,7 +34,7 @@ describe("lib_spline", function() -- edge 1->2 tension = (0 + 1)/2 = 0.5 (curved) -- edge 4->1 tension = (1 + 0)/2 = 0.5 (curved) -- edges 2->3 and 3->4: anchors 3,4 missing → 0 → linear - local anchors = { {0, 0}, {100, 0, 1}, {100, 100, 1}, {0, 100} } + local anchors = { { 0, 0 }, { 100, 0, 1 }, { 100, 100, 1 }, { 0, 100 } } local poly = SplineLib.TessellateRing(anchors, { segments = 4 }) -- linear edges contribute 1 vertex; curved edges contribute 4 -- edge 1->2 curved (4), 2->3 curved (4), 3->4 linear (1), 4->1 curved (4) @@ -51,30 +50,30 @@ describe("lib_spline", function() describe("TessellateRing with positive strength", function() it("subdivides curved edges into `segments` samples", function() - local anchors = { {0, 0, 1}, {100, 0, 1}, {100, 100, 1}, {0, 100, 1} } + local anchors = { { 0, 0, 1 }, { 100, 0, 1 }, { 100, 100, 1 }, { 0, 100, 1 } } local poly = SplineLib.TessellateRing(anchors, { segments = 8 }) -- 4 anchors * 8 samples per edge = 32 vertices when fully splined assert.are.equal(32, #poly) end) it("anchor positions are preserved on the tessellated curve", function() - local anchors = { {0, 0, 1}, {100, 0, 1}, {100, 100, 1}, {0, 100, 1} } + local anchors = { { 0, 0, 1 }, { 100, 0, 1 }, { 100, 100, 1 }, { 0, 100, 1 } } local poly = SplineLib.TessellateRing(anchors, { segments = 5 }) -- the first vertex emitted in each per-edge group is the anchor itself - assert.is_true(pointsApproxEqual(poly[1], {0, 0})) - assert.is_true(pointsApproxEqual(poly[1 + 5], {100, 0})) - assert.is_true(pointsApproxEqual(poly[1 + 10], {100, 100})) - assert.is_true(pointsApproxEqual(poly[1 + 15], {0, 100})) + assert.is_true(pointsApproxEqual(poly[1], { 0, 0 })) + assert.is_true(pointsApproxEqual(poly[1 + 5], { 100, 0 })) + assert.is_true(pointsApproxEqual(poly[1 + 10], { 100, 100 })) + assert.is_true(pointsApproxEqual(poly[1 + 15], { 0, 100 })) end) it("mixed strength only subdivides edges whose endpoints have any strength", function() -- two adjacent anchors with strength 0 produce a linear edge between them. -- adjacency ordering: 1->2, 2->3, 3->4, 4->1 local anchors = { - {0, 0, 0}, - {100, 0, 0}, - {100, 100, 1}, - {0, 100, 1}, + { 0, 0, 0 }, + { 100, 0, 0 }, + { 100, 100, 1 }, + { 0, 100, 1 }, } local poly = SplineLib.TessellateRing(anchors, { segments = 6 }) -- edges with tensions: (0+0)/2=0, (0+1)/2=0.5, (1+1)/2=1, (1+0)/2=0.5 @@ -86,7 +85,7 @@ describe("lib_spline", function() describe("integration with PolygonLib", function() it("tessellated spline polygon is valid input for PointInPolygon", function() - local anchors = { {0, 0, 1}, {100, 0, 1}, {100, 100, 1}, {0, 100, 1} } + local anchors = { { 0, 0, 1 }, { 100, 0, 1 }, { 100, 100, 1 }, { 0, 100, 1 } } local poly = SplineLib.TessellateRing(anchors) -- center of the anchor square should still be inside the spline polygon assert.is_true(PolygonLib.PointInPolygon(50, 50, poly)) @@ -94,16 +93,13 @@ describe("lib_spline", function() end) it("zero-strength tessellation is point-equivalent to the input polygon", function() - local anchors = { {0, 0, 0}, {100, 0, 0}, {100, 100, 0}, {0, 100, 0} } + local anchors = { { 0, 0, 0 }, { 100, 0, 0 }, { 100, 100, 0 }, { 0, 100, 0 } } local splineOut = SplineLib.TessellateRing(anchors) - local plain = { {0, 0}, {100, 0}, {100, 100}, {0, 100} } + local plain = { { 0, 0 }, { 100, 0 }, { 100, 100 }, { 0, 100 } } -- both should agree on a sample of test points (containment-equivalent) - local samples = { {50, 50}, {-1, -1}, {101, 50}, {25, 25}, {99, 99}, {50, 200} } + local samples = { { 50, 50 }, { -1, -1 }, { 101, 50 }, { 25, 25 }, { 99, 99 }, { 50, 200 } } for _, s in ipairs(samples) do - assert.are.equal( - PolygonLib.PointInPolygon(s[1], s[2], splineOut), - PolygonLib.PointInPolygon(s[1], s[2], plain) - ) + assert.are.equal(PolygonLib.PointInPolygon(s[1], s[2], splineOut), PolygonLib.PointInPolygon(s[1], s[2], plain)) end end) end) @@ -115,14 +111,14 @@ describe("lib_spline", function() end) it("passes through 1- and 2-anchor inputs without curving", function() - local one = SplineLib.TessellateRing({ {5, 7, 1} }) + local one = SplineLib.TessellateRing({ { 5, 7, 1 } }) assert.are.equal(1, #one) - local two = SplineLib.TessellateRing({ {0, 0, 1}, {10, 10, 1} }) + local two = SplineLib.TessellateRing({ { 0, 0, 1 }, { 10, 10, 1 } }) assert.are.equal(2, #two) end) it("clamps out-of-range strength values", function() - local anchors = { {0, 0, -5}, {100, 0, 99}, {100, 100, 0.5}, {0, 100, 0.5} } + local anchors = { { 0, 0, -5 }, { 100, 0, 99 }, { 100, 100, 0.5 }, { 0, 100, 0.5 } } -- should not error; values get clamped to [0, 1] local poly = SplineLib.TessellateRing(anchors, { segments = 4 }) assert.is_true(#poly >= 4) diff --git a/spec/gamedata/unitdefs_spec.lua b/spec/gamedata/unitdefs_spec.lua index 14b19c84d9a..ddc5c55bcb9 100644 --- a/spec/gamedata/unitdefs_spec.lua +++ b/spec/gamedata/unitdefs_spec.lua @@ -1,31 +1,31 @@ local Builders = VFS.Include("spec/builders/index.lua") describe("UnitDefs", function() - local unitDefs - before_each(function() - local spring = Builders.Spring.new():WithRealUnitDefs():Build() - unitDefs = spring:GetUnitDefs() - end) + local unitDefs + before_each(function() + local spring = Builders.EngineSynced.new():WithRealUnitDefs():Build() + unitDefs = spring:GetUnitDefs() + end) - it("should be loaded", function() - assert.is_table(unitDefs) - -- Count actual entries in the hash table (UnitDefs uses string keys) - local count = 0 - for k, v in pairs(unitDefs) do - assert.is_string(k) - assert.is_table(v) - count = count + 1 - end - assert.is_true(count > 1700) - end) + it("should be loaded", function() + assert.is_table(unitDefs) + -- Count actual entries in the hash table (UnitDefs uses string keys) + local count = 0 + for k, v in pairs(unitDefs) do + assert.is_string(k) + assert.is_table(v) + count = count + 1 + end + assert.is_true(count > 1700) + end) - it("should have valid structure", function() - local testUnits = {"armcom", "corcom", "armpw", "corak"} - for _, unitName in ipairs(testUnits) do - local unitDef = unitDefs[unitName] - assert.is_table(unitDef) - -- Unit definitions should have basic properties - assert.is_number(unitDef.maxDamage or unitDef.health) - end - end) -end) \ No newline at end of file + it("should have valid structure", function() + local testUnits = { "armcom", "corcom", "armpw", "corak" } + for _, unitName in ipairs(testUnits) do + local unitDef = unitDefs[unitName] + assert.is_table(unitDef) + -- Unit definitions should have basic properties + assert.is_number(unitDef.maxDamage or unitDef.health) + end + end) +end) diff --git a/spec/luaui/Widgets/api_build_orders_spec.lua b/spec/luaui/Widgets/api_build_orders_spec.lua index 2f2705d0a3b..3551465fa37 100644 --- a/spec/luaui/Widgets/api_build_orders_spec.lua +++ b/spec/luaui/Widgets/api_build_orders_spec.lua @@ -97,7 +97,7 @@ end -- needed for proportional and fork/followup tests. local function buildArmCorWorld() return Builders - .SpringUnsynced + .EngineUnsynced .new() -- Buildings :WithUnitDef(UnitDef.new("armmex"):WithDefID(10):WithCost(100):WithFootprint(2, 2)) @@ -190,7 +190,7 @@ describe("api_build_orders", function() local widget before_each(function() - widget = withMinimalSubLogic(Builders.SpringUnsynced.new()):LoadWidget(WIDGET_PATH) + widget = withMinimalSubLogic(Builders.EngineUnsynced.new()):LoadWidget(WIDGET_PATH) end) it("issues no orders when there are no buildings", function() @@ -218,7 +218,7 @@ describe("api_build_orders", function() describe("when every builder has zero build speed", function() it("issues no orders", function() - local widget = withMinimalSubLogic(Builders.SpringUnsynced.new():WithUnitDef(UnitDef.new("armcon"):WithDefID(42):WithSpeed(0)):WithUnit(1, "armcon")):LoadWidget(WIDGET_PATH) + local widget = withMinimalSubLogic(Builders.EngineUnsynced.new():WithUnitDef(UnitDef.new("armcon"):WithDefID(42):WithSpeed(0)):WithUnit(1, "armcon")):LoadWidget(WIDGET_PATH) local bo = widget.WG.api_build_orders local calls = widget.captureArrayOrders() diff --git a/spec/spec_helper.lua b/spec/spec_helper.lua index e945ddb39dc..cccd3719c80 100644 --- a/spec/spec_helper.lua +++ b/spec/spec_helper.lua @@ -1,49 +1,51 @@ - -- Spring logging mocks _G.LOG = _G.LOG or { - ERROR = "ERROR", - WARNING = "WARNING", - INFO = "INFO", - DEBUG = "DEBUG", + ERROR = "ERROR", + WARNING = "WARNING", + INFO = "INFO", + DEBUG = "DEBUG", } -- Log level hierarchy for filtering local LOG_LEVELS = { - [_G.LOG.DEBUG] = 1, - [_G.LOG.INFO] = 2, - [_G.LOG.WARNING] = 3, - [_G.LOG.ERROR] = 4, + [_G.LOG.DEBUG] = 1, + [_G.LOG.INFO] = 2, + [_G.LOG.WARNING] = 3, + [_G.LOG.ERROR] = 4, } -- Current log level - only log messages at this level or higher _G.CURRENT_LOG_LEVEL = _G.LOG.WARNING _G.Spring = _G.Spring or { - Log = function(tag, level, message) - -- If only one argument provided, treat it as a simple message - if message == nil then - message = tag - tag = "Spring" - level = _G.LOG.INFO - end - - -- Only log if the message level meets or exceeds the current log level - if LOG_LEVELS[level] and LOG_LEVELS[level] >= LOG_LEVELS[_G.CURRENT_LOG_LEVEL] then - print(string.format("[%s] %s: %s", tag, level, message)) - end - end + Log = function(tag, level, message) + -- If only one argument provided, treat it as a simple message + if message == nil then + message = tag + tag = "Spring" + level = _G.LOG.INFO + end + + -- Only log if the message level meets or exceeds the current log level + if LOG_LEVELS[level] and LOG_LEVELS[level] >= LOG_LEVELS[_G.CURRENT_LOG_LEVEL] then + print(string.format("[%s] %s: %s", tag, level, message)) + end + end, } _G.Spring.Echo = _G.Spring.Echo or function(...) - print(...) + print(...) end _G.GG = _G.GG or {} _G.unpack = _G.unpack or table.unpack or function(t, i, j) - i = i or 1; j = j or #t - if i > j then return end - return t[i], _G.unpack(t, i+1, j) + i = i or 1 + j = j or #t + if i > j then + return + end + return t[i], _G.unpack(t, i + 1, j) end -- VFS.Include mock for testing @@ -51,91 +53,88 @@ _G.VFS = _G.VFS or {} _G.VFS._cache = _G.VFS._cache or {} _G.VFS.FileExists = function(path) - -- First try the exact path provided - local file = io.open(path, "r") - if file then - file:close() - return true - end - - -- Fallback: Case-insensitive check using cached file list - if not _G.VFS._ci_file_cache then - _G.VFS._ci_file_cache = {} - -- Find all files, excluding .git directory - local handle = io.popen("find . -name '.git' -prune -o -type f -print") - if handle then - for line in handle:lines() do - -- Strip leading ./ - local p = line:gsub("^%./", "") - _G.VFS._ci_file_cache[p:lower()] = p - end - handle:close() - end - end - - local cleanPath = path:gsub("^%./", "") - return _G.VFS._ci_file_cache[cleanPath:lower()] ~= nil + -- First try the exact path provided + local file = io.open(path, "r") + if file then + file:close() + return true + end + + -- Fallback: Case-insensitive check using cached file list + if not _G.VFS._ci_file_cache then + _G.VFS._ci_file_cache = {} + -- Find all files, excluding .git directory + local handle = io.popen("find . -name '.git' -prune -o -type f -print") + if handle then + for line in handle:lines() do + -- Strip leading ./ + local p = line:gsub("^%./", "") + _G.VFS._ci_file_cache[p:lower()] = p + end + handle:close() + end + end + + local cleanPath = path:gsub("^%./", "") + return _G.VFS._ci_file_cache[cleanPath:lower()] ~= nil end _G.VFS.Include = function(path, env, mode) - -- Check cache first - if _G.VFS._cache[path] then - return _G.VFS._cache[path] - end - - -- Try direct path first - local realPath = path - local file = io.open(path, "r") - if file then - file:close() - else - -- Check case-insensitive cache - if not _G.VFS._ci_file_cache then - -- Force cache population by calling FileExists with a dummy path - _G.VFS.FileExists("___dummy_path___") - end - - local cleanPath = path:gsub("^%./", "") - local cachedPath = _G.VFS._ci_file_cache[cleanPath:lower()] - if cachedPath then - realPath = cachedPath - end - end - - -- Use loadfile/dofile instead of require to better simulate VFS and handle case-insensitive paths - local chunk, err = loadfile(realPath) - if chunk then - -- Handle environment if provided - if env then - setfenv(chunk, env) - end - - local success, result = pcall(chunk) - if success then - _G.VFS._cache[path] = result - return result - else - print("Error loading " .. path .. ": " .. tostring(result)) - end - end - - -- Fallback to old require method if file not found on disk (e.g. standard libs) - -- Convert filesystem-like path to module name for require - local mod = path - :gsub("^%./", "") - :gsub("%.lua$", "") - :gsub("/", ".") - - local success, result = pcall(require, mod) - if success then - _G.VFS._cache[path] = result - return result - else - -- Instead of erroring, return an empty table for missing files - -- This allows unitdefs.lua and other files to continue loading even if some dependencies are missing - _G.VFS._cache[path] = {} - return {} - end + -- Check cache first + if _G.VFS._cache[path] then + return _G.VFS._cache[path] + end + + -- Try direct path first + local realPath = path + local file = io.open(path, "r") + if file then + file:close() + else + -- Check case-insensitive cache + if not _G.VFS._ci_file_cache then + -- Force cache population by calling FileExists with a dummy path + _G.VFS.FileExists("___dummy_path___") + end + + local cleanPath = path:gsub("^%./", "") + local cachedPath = _G.VFS._ci_file_cache[cleanPath:lower()] + if cachedPath then + realPath = cachedPath + end + end + + -- Use loadfile/dofile instead of require to better simulate VFS and handle case-insensitive paths + local chunk, err = loadfile(realPath) + if chunk then + -- Handle environment if provided + if env then + setfenv(chunk, env) + end + + local success, result = pcall(chunk) + if success then + _G.VFS._cache[path] = result + return result + else + print("Error loading " .. path .. ": " .. tostring(result)) + end + end + + -- Fallback to old require method if file not found on disk (e.g. standard libs) + -- Convert filesystem-like path to module name for require + local mod = path:gsub("^%./", ""):gsub("%.lua$", ""):gsub("/", ".") + + local success, result = pcall(require, mod) + if success then + _G.VFS._cache[path] = result + return result + else + -- Instead of erroring, return an empty table for missing files + -- This allows unitdefs.lua and other files to continue loading even if some dependencies are missing + _G.VFS._cache[path] = {} + return {} + end end -- we have to do this after VFS.Include is declared @@ -143,90 +142,94 @@ end VFS.Include("common/tablefunctions.lua") _G.VFS.SubDirs = function(path) - -- Check case-insensitive cache for correct directory path - if not _G.VFS._ci_file_cache then - -- Force cache population - _G.VFS.FileExists("___dummy_path___") - end - - -- Currently the cache only has files. We need directories too or just assume 'find' works if we fix the path. - -- But for SubDirs we want to list subdirectories. - -- Let's assume the input path might be wrong casing. - - -- Simple heuristic: try to find the directory case-insensitively if it doesn't exist - local searchPath = path - local handle = io.open(path) - if handle then - handle:close() - else - -- Try to find matching directory - local parent = path:match("(.+)/[^/]+$") or "." - local base = path:match("([^/]+)$") - if base then - local pHandle = io.popen(string.format("find %s -maxdepth 1 -type d -iname '%s'", parent, base)) - if pHandle then - local match = pHandle:read("*l") - if match then searchPath = match end - pHandle:close() - end - end - end - - local dirs = {} - local handle = io.popen(string.format("find %s -maxdepth 1 -type d", searchPath)) - if handle then - for line in handle:lines() do - if line ~= searchPath then - table.insert(dirs, line) - end - end - handle:close() - end - return dirs + -- Check case-insensitive cache for correct directory path + if not _G.VFS._ci_file_cache then + -- Force cache population + _G.VFS.FileExists("___dummy_path___") + end + + -- Currently the cache only has files. We need directories too or just assume 'find' works if we fix the path. + -- But for SubDirs we want to list subdirectories. + -- Let's assume the input path might be wrong casing. + + -- Simple heuristic: try to find the directory case-insensitively if it doesn't exist + local searchPath = path + local handle = io.open(path) + if handle then + handle:close() + else + -- Try to find matching directory + local parent = path:match("(.+)/[^/]+$") or "." + local base = path:match("([^/]+)$") + if base then + local pHandle = io.popen(string.format("find %s -maxdepth 1 -type d -iname '%s'", parent, base)) + if pHandle then + local match = pHandle:read("*l") + if match then + searchPath = match + end + pHandle:close() + end + end + end + + local dirs = {} + local handle = io.popen(string.format("find %s -maxdepth 1 -type d", searchPath)) + if handle then + for line in handle:lines() do + if line ~= searchPath then + table.insert(dirs, line) + end + end + handle:close() + end + return dirs end _G.VFS.DirList = function(directory, pattern, mode, recursive) - -- Returns relative paths with directory prefix, just like native VFS.DirList - local files = {} - local cmd - - -- Fix directory path case-sensitivity - local searchDir = directory - local handle = io.open(directory) - if handle then - handle:close() - else - -- Try to find matching directory case-insensitively - local parent = directory:match("(.+)/[^/]+$") or "." - local base = directory:match("([^/]+)$") - if base then - local pHandle = io.popen(string.format("find %s -maxdepth 1 -type d -iname '%s'", parent, base)) - if pHandle then - local match = pHandle:read("*l") - if match then searchDir = match end - pHandle:close() - end - end - end - - -- Use find command with pattern matching - -- Use -iname for case-insensitive pattern matching - local name_pattern = pattern and pattern ~= "*" and string.format("-iname '%s'", pattern) or "" - if recursive then - cmd = string.format("find %s %s -type f", searchDir, name_pattern) - else - cmd = string.format("find %s %s -maxdepth 1 -type f", searchDir, name_pattern) - end - - local handle = io.popen(cmd) - if handle then - for line in handle:lines() do - table.insert(files, line) - end - handle:close() - end - - return files + -- Returns relative paths with directory prefix, just like native VFS.DirList + local files = {} + local cmd + + -- Fix directory path case-sensitivity + local searchDir = directory + local handle = io.open(directory) + if handle then + handle:close() + else + -- Try to find matching directory case-insensitively + local parent = directory:match("(.+)/[^/]+$") or "." + local base = directory:match("([^/]+)$") + if base then + local pHandle = io.popen(string.format("find %s -maxdepth 1 -type d -iname '%s'", parent, base)) + if pHandle then + local match = pHandle:read("*l") + if match then + searchDir = match + end + pHandle:close() + end + end + end + + -- Use find command with pattern matching + -- Use -iname for case-insensitive pattern matching + local name_pattern = pattern and pattern ~= "*" and string.format("-iname '%s'", pattern) or "" + if recursive then + cmd = string.format("find %s %s -type f", searchDir, name_pattern) + else + cmd = string.format("find %s %s -maxdepth 1 -type f", searchDir, name_pattern) + end + + local handle = io.popen(cmd) + if handle then + for line in handle:lines() do + table.insert(files, line) + end + handle:close() + end + + return files end _G.VFS.MAP = 1 @@ -236,9 +239,12 @@ _G.VFS_MODES = _G.VFS.MAP + _G.VFS.MOD + _G.VFS.BASE -- to enable, `luarocks install inspect` _G.inspect = (function() - local ok, mod = pcall(require, "inspect") - if ok and mod then return mod end - -- fallback: no-op string (won't break prints/concats) - return function(_) return _ end + local ok, mod = pcall(require, "inspect") + if ok and mod then + return mod + end + -- fallback: no-op string (won't break prints/concats) + return function(_) + return _ + end end)() - diff --git a/types/Spring.lua b/types/Spring.lua index e59aaaea260..5c5291f61c1 100644 --- a/types/Spring.lua +++ b/types/Spring.lua @@ -65,4 +65,3 @@ ---@class ObjectRenderingTable ---@field ActivateMaterial fun(objectID: integer, lod: integer) ---@field DeactivateMaterial fun(objectID: integer, lod: integer) - diff --git a/unitbasedefs/air_rework_defs.lua b/unitbasedefs/air_rework_defs.lua index a5621d34370..8e06980eabe 100644 --- a/unitbasedefs/air_rework_defs.lua +++ b/unitbasedefs/air_rework_defs.lua @@ -309,7 +309,7 @@ local function airReworkUnitTweaks(name, uDef) end if name == "armbrawl" then uDef.weapondefs.vtol_emg.damage = { - default = 20, + default = 20, } end if name == "corcrwh" then @@ -409,7 +409,7 @@ local function airReworkUnitTweaks(name, uDef) uDef.cruisealtitude = 240 uDef.weapondefs.coradvbomb.burstrate = 0.26 uDef.weapondefs.coradvbomb.damage = { - default = 500 + default = 500, } end if name == "armpnix" then diff --git a/unitbasedefs/community_balance_patch_defs.lua b/unitbasedefs/community_balance_patch_defs.lua index c11afa46354..3a2d1dd50a5 100644 --- a/unitbasedefs/community_balance_patch_defs.lua +++ b/unitbasedefs/community_balance_patch_defs.lua @@ -1,5 +1,4 @@ local function communityBalanceTweaks(name, uDef, modOptions) - local communityBalancePatchDisabled = modOptions.community_balance_patch == "disabled" if not communityBalancePatchDisabled then local all = modOptions.community_balance_patch == "enabled" diff --git a/unitbasedefs/emp_rework.lua b/unitbasedefs/emp_rework.lua index fd33c489865..8e2fa6c5570 100644 --- a/unitbasedefs/emp_rework.lua +++ b/unitbasedefs/emp_rework.lua @@ -19,13 +19,10 @@ local function empReworkUnitTweaks(name, unitDef) if name == "armdfly" then weapondefs.armdfly_paralyzer.paralyzetime = 1 - weapondefs.armdfly_paralyzer.beamdecay = 0.05--testing - weapondefs.armdfly_paralyzer.beamtime = 0.1--testing - weapondefs.armdfly_paralyzer.areaofeffect = 8--testing - weapondefs.armdfly_paralyzer.targetmoveerror = 0.05--testing - - - + weapondefs.armdfly_paralyzer.beamdecay = 0.05 --testing + weapondefs.armdfly_paralyzer.beamtime = 0.1 --testing + weapondefs.armdfly_paralyzer.areaofeffect = 8 --testing + weapondefs.armdfly_paralyzer.targetmoveerror = 0.05 --testing --mono beam settings --weapondefs.armdfly_paralyzer.reloadtime = 0.05--testing @@ -41,7 +38,6 @@ local function empReworkUnitTweaks(name, unitDef) --weapondefs.armdfly_paralyzer.beamBurst = true--testing --weapondefs.armdfly_paralyzer.burst = 10--testing --weapondefs.armdfly_paralyzer.burstRate = 0.1--testing - end if name == "armemp" then @@ -50,7 +46,6 @@ local function empReworkUnitTweaks(name, unitDef) weapondefs.armemp_weapon.edgeeffectiveness = -0.10 weapondefs.armemp_weapon.paralyzetime = 22 weapondefs.armemp_weapon.damage.default = 60000 - end if name == "armshockwave" then weapondefs.hllt_bottom.areaofeffect = 150 @@ -66,7 +61,7 @@ local function empReworkUnitTweaks(name, unitDef) weapondefs.empmissile.damage.default = 20000 weapondefs.empmissile.paralyzetime = 5 weapondefs.emp.damage.default = 200 - weapondefs.emp.reloadtime = .5 + weapondefs.emp.reloadtime = 0.5 weapondefs.emp.paralyzetime = 1 end @@ -85,16 +80,16 @@ local function empReworkUnitTweaks(name, unitDef) local customparams = unitDef.customparams - if (name =="corfmd" or name =="armamd" or name =="cormabm" or name =="armscab") then + if name == "corfmd" or name == "armamd" or name == "cormabm" or name == "armscab" then customparams.paralyzemultiplier = 1.5 end - if (name == "armvulc" or name == "corbuzz" or name == "legstarfall" or name == "corsilo" or name == "armsilo") then + if name == "armvulc" or name == "corbuzz" or name == "legstarfall" or name == "corsilo" or name == "armsilo" then customparams.paralyzemultiplier = 2 end --if name == "corsumo" then - --customparams.paralyzemultiplier = 0.9 + --customparams.paralyzemultiplier = 0.9 --end if name == "armmar" then @@ -106,49 +101,49 @@ local function empReworkUnitTweaks(name, unitDef) end --if name == "armraz" then - --customparams.paralyzemultiplier = 1.2 + --customparams.paralyzemultiplier = 1.2 --end --if name == "armvang" then - --customparams.paralyzemultiplier = 1.1 + --customparams.paralyzemultiplier = 1.1 --end --if name == "armlun" then - --customparams.paralyzemultiplier = 1.05 + --customparams.paralyzemultiplier = 1.05 --end --if name == "corshiva" then - --customparams.paralyzemultiplier = 1.1 + --customparams.paralyzemultiplier = 1.1 --end --if name == "corcat" then - --customparams.paralyzemultiplier = 1.05 + --customparams.paralyzemultiplier = 1.05 --end --if name == "corkarg" then - --customparams.paralyzemultiplier = 1.2 + --customparams.paralyzemultiplier = 1.2 --end --if name == "corsok" then - --customparams.paralyzemultiplier = 1.1 + --customparams.paralyzemultiplier = 1.1 --end --if name == "cordemont4" then - --customparams.paralyzemultiplier = 1.2 + --customparams.paralyzemultiplier = 1.2 --end end local function empReworkWeaponTweaks(name, wDef) - if name == 'empblast' then + if name == "empblast" then wDef.areaofeffect = 350 wDef.edgeeffectiveness = 0.6 wDef.paralyzetime = 12 wDef.damage.default = 50000 end - if name == 'spybombx' then + if name == "spybombx" then wDef.areaofeffect = 350 wDef.edgeeffectiveness = 0.4 wDef.paralyzetime = 20 wDef.damage.default = 16000 end - if name == 'spybombxscav' then + if name == "spybombxscav" then wDef.edgeeffectiveness = 0.50 wDef.paralyzetime = 12 wDef.damage.default = 35000 diff --git a/unitbasedefs/evocom.lua b/unitbasedefs/evocom.lua index 05858eb52bc..8acfe6e3f5e 100644 --- a/unitbasedefs/evocom.lua +++ b/unitbasedefs/evocom.lua @@ -5,15 +5,15 @@ local commanderLevel1 = { } local commanderEffigies = { - [1] = nil, -- already set up by the effigy modoption - [2] = "comeffigylvl1", - [3] = "comeffigylvl2", - [4] = "comeffigylvl2", - [5] = "comeffigylvl3", - [6] = "comeffigylvl3", - [7] = "comeffigylvl4", - [8] = "comeffigylvl4", - [9] = "comeffigylvl5", + [1] = nil, -- already set up by the effigy modoption + [2] = "comeffigylvl1", + [3] = "comeffigylvl2", + [4] = "comeffigylvl2", + [5] = "comeffigylvl3", + [6] = "comeffigylvl3", + [7] = "comeffigylvl4", + [8] = "comeffigylvl4", + [9] = "comeffigylvl5", [10] = "comeffigylvl5", } @@ -57,7 +57,7 @@ local function evolvingCommanders(name, unitDef, modOptions) if modOptions.evocomlevelupmethod == "dynamic" then customparams.evolution_condition = "power" - customparams.evolution_power_multiplier = 1 -- Scales the power calculated based on your own combined power. + customparams.evolution_power_multiplier = 1 -- Scales the power calculated based on your own combined power. local evolutionPowerThreshold = customparams.evolution_power_threshold or 10000 --sets threshold for level 1 commanders customparams.evolution_power_threshold = evolutionPowerThreshold * modOptions.evocomlevelupmultiplier elseif modOptions.evocomlevelupmethod == "timed" then @@ -78,4 +78,4 @@ end return { Tweaks = evolvingCommanders, -} \ No newline at end of file +} diff --git a/unitbasedefs/experimental_extra_units.lua b/unitbasedefs/experimental_extra_units.lua index bf9ffd2865d..c8895d31177 100644 --- a/unitbasedefs/experimental_extra_units.lua +++ b/unitbasedefs/experimental_extra_units.lua @@ -105,7 +105,7 @@ local function experimentalExtraUnits(name, unitDef) -- Cortex T2 Vehicle Factory if name == "coravp" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "corvac" -- Printer - Armored Field Engineer + buildoptions[numBuildoptions + 1] = "corvac" -- Printer - Armored Field Engineer buildoptions[numBuildoptions + 2] = "corphantom" -- Phantom - Amphibious Stealth Scout buildoptions[numBuildoptions + 3] = "corsiegebreaker" -- Siegebreaker - Heavy Long Range Destroyer buildoptions[numBuildoptions + 4] = "corforge" -- Forge - Flamethrower Combat Engineer @@ -129,13 +129,13 @@ local function experimentalExtraUnits(name, unitDef) -- Cortex T3 Gantry if name == "corgant" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "corves" -- Vesuvius + buildoptions[numBuildoptions + 1] = "corves" -- Vesuvius end -- Cortex T3 Underwater Gantry if name == "corgantuw" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "corves" -- Vesuvius + buildoptions[numBuildoptions + 1] = "corves" -- Vesuvius end -- Legion T1 Land Constructors @@ -168,4 +168,4 @@ end return { Tweaks = experimentalExtraUnits, -} \ No newline at end of file +} diff --git a/unitbasedefs/factory_costs_rebalance.lua b/unitbasedefs/factory_costs_rebalance.lua index adc4c29cab5..0ef5957714d 100644 --- a/unitbasedefs/factory_costs_rebalance.lua +++ b/unitbasedefs/factory_costs_rebalance.lua @@ -43,4 +43,4 @@ end return { Tweaks = factoryCostsTest, -} \ No newline at end of file +} diff --git a/unitbasedefs/holiday_models.lua b/unitbasedefs/holiday_models.lua index 52b54b39d86..b418ba389ed 100644 --- a/unitbasedefs/holiday_models.lua +++ b/unitbasedefs/holiday_models.lua @@ -1,20 +1,20 @@ local aprilFoolsModels = { - corak = "units/event/aprilfools/CORAK.s3o", - corllt = "units/event/aprilfools/CORllt.s3o", - corhllt = "units/event/aprilfools/CORhllt.s3o", - corack = "units/event/aprilfools/CORACK.s3o", - corck = "units/event/aprilfools/CORCK.s3o", - armpw = "units/event/aprilfools/ARMPW.s3o", + corak = "units/event/aprilfools/CORAK.s3o", + corllt = "units/event/aprilfools/CORllt.s3o", + corhllt = "units/event/aprilfools/CORhllt.s3o", + corack = "units/event/aprilfools/CORACK.s3o", + corck = "units/event/aprilfools/CORCK.s3o", + armpw = "units/event/aprilfools/ARMPW.s3o", cordemon = "units/event/aprilfools/cordemon.s3o", --correap -- Requires Model Update corstorm = "units/event/aprilfools/corstorm.s3o", - armcv = "units/event/aprilfools/armcv.s3o", - armrock = "units/event/aprilfools/armrock.s3o", - armbull = "units/event/aprilfools/armbull.s3o", - armllt = "units/event/aprilfools/armllt.s3o", - armwin = "units/event/aprilfools/armwin.s3o", - armham = "units/event/aprilfools/armham.s3o", - corwin = "units/event/aprilfools/corwin.s3o", + armcv = "units/event/aprilfools/armcv.s3o", + armrock = "units/event/aprilfools/armrock.s3o", + armbull = "units/event/aprilfools/armbull.s3o", + armllt = "units/event/aprilfools/armllt.s3o", + armwin = "units/event/aprilfools/armwin.s3o", + armham = "units/event/aprilfools/armham.s3o", + corwin = "units/event/aprilfools/corwin.s3o", --corthud -- Requires Model Update } @@ -40,6 +40,6 @@ local xmasModels = { return { AprilFools = aprilFoolsModels, - Halloween = halloweenModels, - Xmas = xmasModels, + Halloween = halloweenModels, + Xmas = xmasModels, } diff --git a/unitbasedefs/juno_rework.lua b/unitbasedefs/juno_rework.lua index 0189e32032c..8a58126d0cd 100644 --- a/unitbasedefs/juno_rework.lua +++ b/unitbasedefs/juno_rework.lua @@ -10,4 +10,4 @@ end return { Tweaks = junoReworkTweaks, -} \ No newline at end of file +} diff --git a/unitbasedefs/legion_simplified_mexes.lua b/unitbasedefs/legion_simplified_mexes.lua index 4afc390c881..b3cf9b29c91 100644 --- a/unitbasedefs/legion_simplified_mexes.lua +++ b/unitbasedefs/legion_simplified_mexes.lua @@ -4,91 +4,91 @@ local function legionSimplifiedMexes(name, uDef) uDef.extractsmetal = 0.001 end if name == "legck" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "leggob" then - uDef.metalcost = math.ceil(uDef.metalcost*1.25) - uDef.energycost = math.ceil(uDef.energycost*0.7) + uDef.metalcost = math.ceil(uDef.metalcost * 1.25) + uDef.energycost = math.ceil(uDef.energycost * 0.7) end if name == "leglob" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "legaabot" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "legcen" then - uDef.metalcost = math.ceil(uDef.metalcost*0.9) - uDef.energycost = math.ceil(uDef.energycost*1.1) + uDef.metalcost = math.ceil(uDef.metalcost * 0.9) + uDef.energycost = math.ceil(uDef.energycost * 1.1) end if name == "legkark" then - uDef.metalcost = math.ceil(uDef.metalcost*0.9) - uDef.energycost = math.ceil(uDef.energycost*1.3) + uDef.metalcost = math.ceil(uDef.metalcost * 0.9) + uDef.energycost = math.ceil(uDef.energycost * 1.3) end if name == "legbal" then - uDef.metalcost = math.ceil(uDef.metalcost*0.9) - uDef.energycost = math.ceil(uDef.energycost*1.2) + uDef.metalcost = math.ceil(uDef.metalcost * 0.9) + uDef.energycost = math.ceil(uDef.energycost * 1.2) end if name == "legcv" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "leghades" then - uDef.metalcost = math.ceil(uDef.metalcost*1.2) - uDef.energycost = math.ceil(uDef.energycost*0.6) + uDef.metalcost = math.ceil(uDef.metalcost * 1.2) + uDef.energycost = math.ceil(uDef.energycost * 0.6) end if name == "leghelios" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "legbar" then - uDef.metalcost = math.ceil(uDef.metalcost*0.9) - uDef.energycost = math.ceil(uDef.energycost*1.3) + uDef.metalcost = math.ceil(uDef.metalcost * 0.9) + uDef.energycost = math.ceil(uDef.energycost * 1.3) end if name == "legrail" then - uDef.metalcost = math.ceil(uDef.metalcost*0.95) - uDef.energycost = math.ceil(uDef.energycost*1.05) + uDef.metalcost = math.ceil(uDef.metalcost * 0.95) + uDef.energycost = math.ceil(uDef.energycost * 1.05) end if name == "leggat" then - uDef.metalcost = math.ceil(uDef.metalcost*0.9) - uDef.energycost = math.ceil(uDef.energycost*1.3) + uDef.metalcost = math.ceil(uDef.metalcost * 0.9) + uDef.energycost = math.ceil(uDef.energycost * 1.3) end if name == "legnavyscout" then - uDef.metalcost = math.ceil(uDef.metalcost*1.15) - uDef.energycost = math.ceil(uDef.energycost*0.7) + uDef.metalcost = math.ceil(uDef.metalcost * 1.15) + uDef.energycost = math.ceil(uDef.energycost * 0.7) end if name == "legnavyaaship" then - uDef.metalcost = math.ceil(uDef.metalcost*1.15) - uDef.energycost = math.ceil(uDef.energycost*0.7) + uDef.metalcost = math.ceil(uDef.metalcost * 1.15) + uDef.energycost = math.ceil(uDef.energycost * 0.7) end if name == "legnavysub" then - uDef.metalcost = math.ceil(uDef.metalcost*1.05) - uDef.energycost = math.ceil(uDef.energycost*0.9) + uDef.metalcost = math.ceil(uDef.metalcost * 1.05) + uDef.energycost = math.ceil(uDef.energycost * 0.9) end if name == "legnavysub" then - uDef.metalcost = math.ceil(uDef.metalcost*1.05) - uDef.energycost = math.ceil(uDef.energycost*0.9) + uDef.metalcost = math.ceil(uDef.metalcost * 1.05) + uDef.energycost = math.ceil(uDef.energycost * 0.9) end if name == "legnavyfrigate" then - uDef.metalcost = math.ceil(uDef.metalcost*1.2) - uDef.energycost = math.ceil(uDef.energycost*0.6) + uDef.metalcost = math.ceil(uDef.metalcost * 1.2) + uDef.energycost = math.ceil(uDef.energycost * 0.6) end if name == "legnavyconship" then - uDef.metalcost = math.ceil(uDef.metalcost*1.1) - uDef.energycost = math.ceil(uDef.energycost*0.8) + uDef.metalcost = math.ceil(uDef.metalcost * 1.1) + uDef.energycost = math.ceil(uDef.energycost * 0.8) end if name == "legnavydestro" then - uDef.metalcost = math.ceil(uDef.metalcost*0.95) - uDef.energycost = math.ceil(uDef.energycost*1.1) + uDef.metalcost = math.ceil(uDef.metalcost * 0.95) + uDef.energycost = math.ceil(uDef.energycost * 1.1) end if name == "legnavyartyship" then - uDef.metalcost = math.ceil(uDef.metalcost*0.95) - uDef.energycost = math.ceil(uDef.energycost*1.1) + uDef.metalcost = math.ceil(uDef.metalcost * 0.95) + uDef.energycost = math.ceil(uDef.energycost * 1.1) end end return { Tweaks = legionSimplifiedMexes, -} \ No newline at end of file +} diff --git a/unitbasedefs/lootboxes/lootboxnano.lua b/unitbasedefs/lootboxes/lootboxnano.lua index cf43239d309..8637b366d73 100644 --- a/unitbasedefs/lootboxes/lootboxnano.lua +++ b/unitbasedefs/lootboxes/lootboxnano.lua @@ -90,7 +90,7 @@ local generateParameters = function(tier) buildList = buildList, objectName = objectName, script = script, - i18nFromUnit = 'lootboxnano_t1', + i18nFromUnit = "lootboxnano_t1", explodeas = "lootboxExplosion1", }, @@ -102,7 +102,7 @@ local generateParameters = function(tier) buildList = buildList, objectName = objectName, script = script, - i18nFromUnit = 'lootboxnano_t2', + i18nFromUnit = "lootboxnano_t2", explodeas = "lootboxExplosion2", }, @@ -114,7 +114,7 @@ local generateParameters = function(tier) buildList = buildList, objectName = objectName, script = script, - i18nFromUnit = 'lootboxnano_t3', + i18nFromUnit = "lootboxnano_t3", explodeas = "lootboxExplosion3", }, @@ -126,7 +126,7 @@ local generateParameters = function(tier) buildList = buildList, objectName = objectName, script = script, - i18nFromUnit = 'lootboxnano_t4', + i18nFromUnit = "lootboxnano_t4", explodeas = "lootboxExplosion4", }, } @@ -163,7 +163,7 @@ local createNanoUnitDef = function(tier) collisionvolumeoffsets = "0 0 0", collisionvolumescales = parameters.collisionVolumeScales, collisionvolumetype = "CylY", - energyupkeep= 0, + energyupkeep = 0, explodeas = parameters.explodeas, footprintx = parameters.footprintx, footprintz = parameters.footprintz, @@ -224,7 +224,7 @@ local createNanoUnitDef = function(tier) normaltex = "unittextures/Arm_normal.dds", subfolder = "armbuildings/landutil", i18nfromunit = parameters.i18nFromUnit, - unitgroup = 'builder', + unitgroup = "builder", paratrooper = true, }, } diff --git a/unitbasedefs/naval_balance_tweaks.lua b/unitbasedefs/naval_balance_tweaks.lua index 528fed80818..c275c65ba9e 100644 --- a/unitbasedefs/naval_balance_tweaks.lua +++ b/unitbasedefs/naval_balance_tweaks.lua @@ -20,14 +20,14 @@ local buildOptionReplacements = { -- t2 arm cons armacsub = { armkraken = "armanavaldefturret" }, armmls = { - armfhlt = "armnavaldefturret", + armfhlt = "armnavaldefturret", armkraken = "armanavaldefturret", }, -- t2 cor cons coracsub = { corfdoom = "coranavaldefturret" }, cormls = { - corfhlt = "cornavaldefturret", + corfhlt = "cornavaldefturret", corfdoom = "coranavaldefturret", }, @@ -61,4 +61,4 @@ end return { Tweaks = navalBalanceTweaks, -} \ No newline at end of file +} diff --git a/unitbasedefs/proposed_unit_reworks_defs.lua b/unitbasedefs/proposed_unit_reworks_defs.lua index d139f76d495..b1755767df3 100644 --- a/unitbasedefs/proposed_unit_reworks_defs.lua +++ b/unitbasedefs/proposed_unit_reworks_defs.lua @@ -1,6 +1,4 @@ local function proposed_unit_reworksTweaks(name, uDef) - - return uDef end diff --git a/unitbasedefs/raptor_unitdefs_post.lua b/unitbasedefs/raptor_unitdefs_post.lua index 6550c456ef5..b0de0506f50 100644 --- a/unitbasedefs/raptor_unitdefs_post.lua +++ b/unitbasedefs/raptor_unitdefs_post.lua @@ -11,7 +11,7 @@ local function processRaptorUnitDef(uDef) uDef.autoheal = 0 uDef.idleautoheal = math.ceil(math.sqrt(raptorHealth * 0.8)) uDef.idletime = 150 - customparams.paralyzemultiplier = customparams.paralyzemultiplier or .2 + customparams.paralyzemultiplier = customparams.paralyzemultiplier or 0.2 customparams.areadamageresistance = "_RAPTORACID_" uDef.upright = false uDef.floater = true @@ -64,4 +64,4 @@ end return { Tweaks = processRaptorUnitDef, -} \ No newline at end of file +} diff --git a/unitbasedefs/scavenger_units_for_players.lua b/unitbasedefs/scavenger_units_for_players.lua index 32dc8ef36fc..b96fc8c52c4 100644 --- a/unitbasedefs/scavenger_units_for_players.lua +++ b/unitbasedefs/scavenger_units_for_players.lua @@ -36,7 +36,7 @@ local function scavengerUnitsForPlayers(name, unitDef) if name == "armasy" then local numBuildoptions = #buildoptions buildoptions[numBuildoptions + 1] = "armdronecarry" -- Nexus - Drone Carrier - buildoptions[numBuildoptions + 2] = "armptt2" -- Epic Skater + buildoptions[numBuildoptions + 2] = "armptt2" -- Epic Skater buildoptions[numBuildoptions + 3] = "armdecadet3" -- Epic Dolphin buildoptions[numBuildoptions + 4] = "armpshipt3" -- Epic Ellysaw buildoptions[numBuildoptions + 5] = "armserpt3" -- Epic Serpent @@ -46,10 +46,10 @@ local function scavengerUnitsForPlayers(name, unitDef) -- Armada T3 Gantry if name == "armshltx" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "armrattet4" -- Ratte - Very Heavy Tank - buildoptions[numBuildoptions + 2] = "armsptkt4" -- Epic Recluse - buildoptions[numBuildoptions + 3] = "armpwt4" -- Epic Pawn - buildoptions[numBuildoptions + 4] = "armvadert4" -- Epic Tumbleweed - Nuclear Rolling Bomb + buildoptions[numBuildoptions + 1] = "armrattet4" -- Ratte - Very Heavy Tank + buildoptions[numBuildoptions + 2] = "armsptkt4" -- Epic Recluse + buildoptions[numBuildoptions + 3] = "armpwt4" -- Epic Pawn + buildoptions[numBuildoptions + 4] = "armvadert4" -- Epic Tumbleweed - Nuclear Rolling Bomb buildoptions[numBuildoptions + 5] = "armdronecarryland" -- Nexus Terra - Drone Carrier end @@ -114,7 +114,7 @@ local function scavengerUnitsForPlayers(name, unitDef) if name == "corgant" then local numBuildoptions = #buildoptions buildoptions[numBuildoptions + 1] = "corkarganetht4" -- Epic Karganeth - buildoptions[numBuildoptions + 2] = "corakt4" -- Epic Grunt + buildoptions[numBuildoptions + 2] = "corakt4" -- Epic Grunt buildoptions[numBuildoptions + 3] = "corthermite" -- Thermite/Epic Termite buildoptions[numBuildoptions + 4] = "cormandot4" -- Epic Commando end @@ -123,7 +123,7 @@ local function scavengerUnitsForPlayers(name, unitDef) if name == "corgantuw" then local numBuildoptions = #buildoptions buildoptions[numBuildoptions + 1] = "corkarganetht4" -- Epic Karganeth - buildoptions[numBuildoptions + 2] = "corakt4" -- Epic Grunt + buildoptions[numBuildoptions + 2] = "corakt4" -- Epic Grunt buildoptions[numBuildoptions + 3] = "cormandot4" -- Epic Commando end @@ -135,22 +135,22 @@ local function scavengerUnitsForPlayers(name, unitDef) -- Legion T2 Land Constructors if name == "legaca" or name == "legack" or name == "legacv" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "legapt3" -- T3 Aircraft Gantry + buildoptions[numBuildoptions + 1] = "legapt3" -- T3 Aircraft Gantry buildoptions[numBuildoptions + 2] = "legministarfall" -- Mini Starfall - buildoptions[numBuildoptions + 3] = "legafust3" -- Epic Fusion Reactor + buildoptions[numBuildoptions + 3] = "legafust3" -- Epic Fusion Reactor buildoptions[numBuildoptions + 4] = "legadveconvt3" -- Epic Energy Converter end -- Legion T3 Gantry if name == "leggant" then local numBuildoptions = #buildoptions - buildoptions[numBuildoptions + 1] = "legsrailt4" -- Epic Arquebus - buildoptions[numBuildoptions + 2] = "leggobt3" -- Epic Goblin - buildoptions[numBuildoptions + 3] = "legpede" -- Mukade - Heavy Multi Weapon Centipede + buildoptions[numBuildoptions + 1] = "legsrailt4" -- Epic Arquebus + buildoptions[numBuildoptions + 2] = "leggobt3" -- Epic Goblin + buildoptions[numBuildoptions + 3] = "legpede" -- Mukade - Heavy Multi Weapon Centipede buildoptions[numBuildoptions + 4] = "legeheatraymech_old" -- Old Sol Invictus - Quad Heatray Mech end end return { Tweaks = scavengerUnitsForPlayers, -} \ No newline at end of file +} diff --git a/unitbasedefs/skyshiftunits_post.lua b/unitbasedefs/skyshiftunits_post.lua index 4ab1573ce2e..87a99b642f7 100644 --- a/unitbasedefs/skyshiftunits_post.lua +++ b/unitbasedefs/skyshiftunits_post.lua @@ -1,10 +1,9 @@ local function skyshiftUnitTweaks(name, uDef) - ---------------------------------------------- - -------------------- - ---ARMADA AIR T1 --- - -------------------- ---------------------------------------------- + --------------------------------------------- + -------------------- + ---ARMADA AIR T1 --- + -------------------- + --------------------------------------------- if name == "armca" then uDef.health = 720 end @@ -94,7 +93,7 @@ local function skyshiftUnitTweaks(name, uDef) uDef.wingangle = 0.06315 uDef.wingdrag = 0.185 uDef.weapondefs = { - emg = { + emg = { areaofeffect = 2, avoidfeature = false, avoidfriendly = true, @@ -403,21 +402,17 @@ local function skyshiftUnitTweaks(name, uDef) } end ---------------------------------------------- - -------------------- - ---ARMADA AIR T2 --- - -------------------- ---------------------------------------------- - - - - ---------------------------------------------- - -------------------- - ---CORTEX AIR T1 --- - -------------------- ---------------------------------------------- + --------------------------------------------- + -------------------- + ---ARMADA AIR T2 --- + -------------------- + --------------------------------------------- + --------------------------------------------- + -------------------- + ---CORTEX AIR T1 --- + -------------------- + --------------------------------------------- if name == "corfink" then uDef.acceleration = 0.6 @@ -809,26 +804,17 @@ local function skyshiftUnitTweaks(name, uDef) } end ---------------------------------------------- - -------------------- - ---CORTEX AIR T2 --- - -------------------- ---------------------------------------------- - - - - - - - - - ---------------------------------------------- - -------------------- - ----GROUND UNITS---- - -------------------- ---------------------------------------------- + --------------------------------------------- + -------------------- + ---CORTEX AIR T2 --- + -------------------- + --------------------------------------------- + --------------------------------------------- + -------------------- + ----GROUND UNITS---- + -------------------- + --------------------------------------------- if name == "armwar" or name == "armham" or name == "armflea" or name == "armpw" or name == "armstump" or name == "armfav" or name == "armart" or name == "armflash" or name == "armpincer" or name == "armjanus" or name == "armcom" or name == "armllt" or name == "armbeamer" or name == "armhlt" or name == "armclaw" or name == "armguard" or name == "corstorm" or name == "corthud" or name == "corak" or name == "corlevlr" or name == "corgarp" or name == "corwolv" or name == "corraid" or name == "corgator" or name == "corfav" or name == "corllt" or name == "corhlt" or name == "corhllt" or name == "cormaw" or name == "corpun" or name == "corpship" or name == "corroy" or name == "coresupp" or name == "armroy" or name == "armpship" or name == "armdecade" or name == "armfhlt" or name == "corfhlt" then for weapons, weaponDef in pairs(uDef.weapondefs) do @@ -870,20 +856,11 @@ local function skyshiftUnitTweaks(name, uDef) } end - - - - - - - - - ---------------------------------------------- - -------------------- - ----BUILDOPTIONS---- - -------------------- ---------------------------------------------- + --------------------------------------------- + -------------------- + ----BUILDOPTIONS---- + -------------------- + --------------------------------------------- if name == "armap" then uDef.buildoptions[7] = "armsfig" end @@ -893,16 +870,8 @@ local function skyshiftUnitTweaks(name, uDef) end return uDef - end - - - - - - - --[[ local function skyshiftWeaponTweaks(name, wDef) @@ -916,4 +885,4 @@ end return { skyshiftUnitTweaks = skyshiftUnitTweaks, --skyshiftWeaponTweaks = skyshiftWeaponTweaks, - } +} diff --git a/unitbasedefs/techsplit_balance_defs.lua b/unitbasedefs/techsplit_balance_defs.lua index 1ae49ca2b71..b34c0dd4997 100644 --- a/unitbasedefs/techsplit_balance_defs.lua +++ b/unitbasedefs/techsplit_balance_defs.lua @@ -1,5 +1,5 @@ local function techsplit_balanceTweaks(name, uDef) - if name == "corthud" then + if name == "corthud" then uDef.speed = 54 uDef.weapondefs.arm_ham.range = 300 uDef.weapondefs.arm_ham.predictboost = 0.8 @@ -178,7 +178,7 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.adv_rocket.trajectoryheight = 1 uDef.weapondefs.adv_rocket.customparams.overrange_distance = 800 uDef.weapondefs.adv_rocket.weapontimer = 8 - uDef.weapondefs.adv_rocket.flighttime = 4 + uDef.weapondefs.adv_rocket.flighttime = 4 uDef.weapons[1].maxangledif = 45 uDef.weapons[1].maindir = "0 0 1" end @@ -218,14 +218,14 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.arm_triton.damage = { default = 250, subs = 111, - vtol = 44 + vtol = 44, } uDef.weapons[2] = { def = "", } end - if name == "correap" then + if name == "correap" then uDef.speed = 76 uDef.turnrate = 250 uDef.weapondefs.cor_reap.areaofeffect = 92 @@ -243,7 +243,7 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.arm_bull.damage = { default = 600, subs = 222, - vtol = 67 + vtol = 67, } uDef.weapondefs.arm_bull.reloadtime = 2 uDef.weapondefs.arm_bull.areaofeffect = 96 @@ -258,7 +258,7 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.corsumo_weapon.reloadtime = 1 end - if name == "corgol" then + if name == "corgol" then uDef.speed = 37 uDef.weapondefs.cor_gol.damage = { default = 1600, @@ -269,7 +269,7 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.cor_gol.range = 700 end - if name == "armguard" then + if name == "armguard" then uDef.health = 6000 uDef.metalcost = 800 uDef.energycost = 8000 @@ -277,7 +277,7 @@ local function techsplit_balanceTweaks(name, uDef) uDef.weapondefs.plasma.areaofeffect = 150 uDef.weapondefs.plasma.range = 1000 uDef.weapondefs.plasma.reloadtime = 2.3 - uDef.weapondefs.plasma.weaponvelocity = 550 + uDef.weapondefs.plasma.weaponvelocity = 550 uDef.weapondefs.plasma.damage = { default = 140, subs = 70, @@ -321,10 +321,6 @@ local function techsplit_balanceTweaks(name, uDef) } end - - - - return uDef end diff --git a/unitbasedefs/techsplit_defs.lua b/unitbasedefs/techsplit_defs.lua index b3354de8569..aff31b2acb6 100644 --- a/unitbasedefs/techsplit_defs.lua +++ b/unitbasedefs/techsplit_defs.lua @@ -1,1105 +1,1070 @@ local function techsplitTweaks(name, uDef) - if name == "coralab" then - uDef.buildoptions = { - [1] = "corack", - [2] = "coraak", - [3] = "cormort", - [4] = "corcan", - [5] = "corpyro", - [6] = "corspy", - [7] = "coramph", - [8] = "cormando", - [9] = "cortermite", - [10] = "corhrk", - [11] = "corvoyr", - [12] = "corroach", - } - end - - if name == "armalab" then - uDef.buildoptions = { - [1] = "armack", - [2] = "armfido", - [3] = "armaak", - [4] = "armzeus", - [5] = "armmav", - [6] = "armamph", - [7] = "armspid", - [8] = "armfast", - [9] = "armvader", - [10] = "armmark", - [11] = "armsptk", - [12] = "armspy", - } - end - - if name == "armavp" then - uDef.buildoptions = { - [1] = "armacv", - [2] = "armch", - [3] = "armcroc", - [4] = "armlatnk", - [5] = "armah", - [6] = "armmart", - [7] = "armseer", - [8] = "armmh", - [9] = "armanac", - [10] = "armsh", - [11] = "armgremlin" - } - end - - if name == "coravp" then - uDef.buildoptions = { - [1] = "corch", - [2] = "coracv", - [3] = "corsala", - [4] = "correap", - [5] = "cormart", - [6] = "corhal", - [7] = "cormh", - [8] = "corsnap", - [9] = "corah", - [10] = "corsh", - [11] = "corvrad", - [12] = "corban" - } - end - - if name == "armck" then - uDef.buildoptions = { - [1] = "armsolar", - [2] = "armwin", - [3] = "armmex", - [4] = "armmstor", - [5] = "armestor", - [6] = "armamex", - [7] = "armmakr", - [8] = "armalab", - [9] = "armlab", - [10] = "armvp", - [11] = "armap", - [12] = "armnanotc", - [13] = "armeyes", - [14] = "armrad", - [15] = "armdrag", - [16] = "armllt", - [17] = "armrl", - [18] = "armdl", - [19] = "armjamt", - [22] = "armsy", - [23] = "armgeo", - [24] = "armbeamer", - [25] = "armhlt", - [26] = "armferret", - [27] = "armclaw", - [28] = "armjuno", - [29] = "armadvsol", - [30] = "armguard" - } - end - - if name == "corck" then - uDef.buildoptions = { - [1] = "corsolar", - [2] = "corwin", - [3] = "cormstor", - [4] = "corestor", - [5] = "cormex", - [6] = "cormakr", - [10] = "corlab", - [11] = "coralab", - [12] = "corvp", - [13] = "corap", - [14] = "cornanotc", - [15] = "coreyes", - [16] = "cordrag", - [17] = "corllt", - [18] = "corrl", - [19] = "corrad", - [20] = "cordl", - [21] = "corjamt", - [22] = "corsy", - [23] = "corexp", - [24] = "corgeo", - [25] = "corhllt", - [26] = "corhlt", - [27] = "cormaw", - [28] = "cormadsam", - [29] = "coradvsol", - [30] = "corpun" - } - end - - if name == "armack" then - uDef.buildoptions = { - [1] = "armadvsol", - [2] = "armmoho", - [3] = "armbeamer", - [4] = "armhlt", - [5] = "armguard", - [6] = "armferret", - [7] = "armcir", - [8] = "armjuno", - [9] = "armpb", - [10] = "armarad", - [11] = "armveil", - [12] = "armfus", - [13] = "armgmm", - [14] = "armhalab", - [15] = "armlab", - [16] = "armalab", - [17] = "armsd", - [18] = "armmakr", - [19] = "armestor", - [20] = "armmstor", - [21] = "armageo", - [22] = "armckfus", - [23] = "armdl", - [24] = "armdf", - [25] = "armvp", - [26] = "armsy", - [27] = "armap", - [28] = "armnanotc", - [29] = "armamd", - } - end - - if name == "corack" then - uDef.buildoptions = { - [1] = "coradvsol", - [2] = "cormoho", - [3] = "corvipe", - [4] = "corhllt", - [5] = "corpun", - [6] = "cormadsam", - [7] = "corerad", - [8] = "corjuno", - [9] = "corfus", - [10] = "corarad", - [11] = "corshroud", - [12] = "corsd", - [13] = "corlab", - [14] = "corhalab", - [15] = "coralab", - [16] = "cormakr", - [17] = "corestor", - [18] = "cormstor", - [19] = "corageo", - [20] = "corhlt", - [21] = "cordl", - [22] = "corvp", - [23] = "corap", - [24] = "corsy", - [25] = "cornanotc", - [26] = "corfmd", - } - end - - if name == "armcv" then - uDef.buildoptions = { - [1] = "armsolar", - [2] = "armwin", - [3] = "armmex", - [4] = "armmstor", - [5] = "armestor", - [6] = "armamex", - [7] = "armmakr", - [8] = "armavp", - [9] = "armlab", - [10] = "armvp", - [11] = "armap", - [12] = "armnanotc", - [13] = "armeyes", - [14] = "armrad", - [15] = "armdrag", - [16] = "armllt", - [17] = "armrl", - [18] = "armdl", - [19] = "armjamt", - [22] = "armsy", - [23] = "armgeo", - [24] = "armbeamer", - [25] = "armhlt", - [26] = "armferret", - [27] = "armclaw", - [28] = "armjuno", - [29] = "armadvsol", - [30] = "armguard" - } - end - - if name == "armbeaver" then - uDef.buildoptions = { - [1] = "armsolar", - [2] = "armwin", - [3] = "armmex", - [4] = "armmstor", - [5] = "armestor", - [6] = "armamex", - [7] = "armmakr", - [8] = "armavp", - [9] = "armlab", - [10] = "armvp", - [11] = "armap", - [12] = "armnanotc", - [13] = "armeyes", - [14] = "armrad", - [15] = "armdrag", - [16] = "armllt", - [17] = "armrl", - [18] = "armdl", - [19] = "armjamt", - [20] = "armsy", - [21] = "armtide", - [22] = "armfmkr", - [23] = "armasy", - [24] = "armfrt", - [25] = "armtl", - [26] = "armgeo", - [27] = "armbeamer", - [28] = "armhlt", - [29] = "armferret", - [30] = "armclaw", - [31] = "armjuno", - [32] = "armfrad", - [33] = "armadvsol", - [34] = "armguard" - } - end - - if name == "corcv" then - uDef.buildoptions = { - [1] = "corsolar", - [2] = "corwin", - [3] = "cormstor", - [4] = "corestor", - [5] = "cormex", - [6] = "cormakr", - [10] = "corlab", - [11] = "coravp", - [12] = "corvp", - [13] = "corap", - [14] = "cornanotc", - [15] = "coreyes", - [16] = "cordrag", - [17] = "corllt", - [18] = "corrl", - [19] = "corrad", - [20] = "cordl", - [21] = "corjamt", - [22] = "corsy", - [23] = "corexp", - [24] = "corgeo", - [25] = "corhllt", - [26] = "corhlt", - [27] = "cormaw", - [28] = "cormadsam", - [29] = "coradvsol", - [30] = "corpun" - } - end - - if name == "cormuskrat" then - uDef.buildoptions = { - [1] = "corsolar", - [2] = "corwin", - [3] = "cormstor", - [4] = "corestor", - [5] = "cormex", - [6] = "cormakr", - [7] = "corlab", - [8] = "coravp", - [9] = "corvp", - [10] = "corap", - [11] = "cornanotc", - [12] = "coreyes", - [13] = "cordrag", - [14] = "corllt", - [15] = "corrl", - [16] = "corrad", - [17] = "cordl", - [18] = "corjamt", - [19] = "corsy", - [20] = "corexp", - [21] = "corgeo", - [22] = "corhllt", - [23] = "corhlt", - [24] = "cormaw", - [25] = "cormadsam", - [26] = "corfrad", - [27] = "cortide", - [28] = "corasy", - [29] = "cortl", - [30] = "coradvsol", - [31] = "corpun" - } - end - - if name == "armacv" then - uDef.buildoptions = { - [1] = "armadvsol", - [2] = "armmoho", - [3] = "armbeamer", - [4] = "armhlt", - [5] = "armguard", - [6] = "armferret", - [7] = "armcir", - [8] = "armjuno", - [9] = "armpb", - [10] = "armarad", - [11] = "armveil", - [12] = "armfus", - [13] = "armgmm", - [14] = "armhavp", - [15] = "armlab", - [16] = "armavp", - [17] = "armsd", - [18] = "armmakr", - [19] = "armestor", - [20] = "armmstor", - [21] = "armageo", - [22] = "armckfus", - [23] = "armdl", - [24] = "armdf", - [25] = "armvp", - [26] = "armsy", - [27] = "armap", - [28] = "armnanotc", - [29] = "armamd", - } - end - - if name == "coracv" then - uDef.buildoptions = { - [1] = "coradvsol", - [2] = "cormoho", - [3] = "corvipe", - [4] = "corhllt", - [5] = "corpun", - [6] = "cormadsam", - [7] = "corerad", - [8] = "corjuno", - [9] = "corfus", - [10] = "corarad", - [11] = "corshroud", - [12] = "corsd", - [13] = "corvp", - [14] = "corhavp", - [15] = "coravp", - [16] = "cormakr", - [17] = "corestor", - [18] = "cormstor", - [19] = "corageo", - [20] = "corhlt", - [21] = "cordl", - [22] = "corlab", - [23] = "corap", - [24] = "corsy", - [25] = "cornanotc", - [26] = "corfmd", - } - end - - ------------------------------ - -- Armada and Cortex Air Split - - -- Air Labs - - if name == "armaap" then - uDef.buildpic = "ARMHAAP.DDS" - uDef.objectname = "Units/ARMAAPLAT.s3o" - uDef.script = "Units/techsplit/ARMHAAP.cob" - uDef.customparams.buildinggrounddecaltype = "decals/armamsub_aoplane.dds" - uDef.customparams.buildinggrounddecalsizex = 13 - uDef.customparams.buildinggrounddecalsizey = 13 - uDef.featuredefs.dead["object"] = "Units/armaaplat_dead.s3o" - uDef.buildoptions = { - [1] = "armaca", - [2] = "armseap", - [3] = "armsb", - [4] = "armsfig", - [5] = "armsehak", - [6] = "armsaber", - [7] = "armhvytrans" - } - uDef.sfxtypes = { - explosiongenerators = { - [1] = "custom:radarpulse_t1_slow", - }, - pieceexplosiongenerators = { - [1] = "deathceg2", - [2] = "deathceg3", - [3] = "deathceg4", - }, - } - uDef.sounds = { - build = "seaplok1", - canceldestruct = "cancel2", - underattack = "warning1", - unitcomplete = "untdone", - count = { - [1] = "count6", - [2] = "count5", - [3] = "count4", - [4] = "count3", - [5] = "count2", - [6] = "count1", - }, - select = { - [1] = "seaplsl1", - }, - } - end - - if name == "coraap" then - uDef.buildpic = "CORHAAP.DDS" - uDef.objectname = "Units/CORAAPLAT.s3o" - uDef.script = "Units/CORHAAP.cob" - uDef.buildoptions = { - [1] = "coraca", - [2] = "corhunt", - [3] = "corcut", - [4] = "corsb", - [5] = "corseap", - [6] = "corsfig", - [7] = "corhvytrans", - } - uDef.featuredefs.dead["object"] = "Units/coraaplat_dead.s3o" - uDef.customparams.buildinggrounddecaltype = "decals/coraap_aoplane.dds" - uDef.customparams.buildinggrounddecalsizex = 6 - uDef.customparams.buildinggrounddecalsizey = 6 - uDef.customparams.sfxtypes = { - pieceexplosiongenerators = { - [1] = "deathceg2", - [2] = "deathceg3", - [3] = "deathceg4", - }, - } - uDef.customparams.sounds = { - build = "seaplok2", - canceldestruct = "cancel2", - underattack = "warning1", - unitcomplete = "untdone", - count = { - [1] = "count6", - [2] = "count5", - [3] = "count4", - [4] = "count3", - [5] = "count2", - [6] = "count1", - }, - select = { - [1] = "seaplsl2", - }, - } - end - - if name == "armap" then - uDef.buildoptions = { - [1] = "armca", - [2] = "armpeep", - [3] = "armfig", - [4] = "armthund", - [5] = "armatlas", - [6] = "armkam", - } - end - - if name == "corap" then - uDef.buildoptions = { - [1] = "corca", - [2] = "corfink", - [3] = "corveng", - [4] = "corshad", - [5] = "corvalk", - [6] = "corbw", - } - end - - -- Air Cons - - if name == "armca" then - uDef.buildoptions = { - [1] = "armsolar", - [2] = "armwin", - [3] = "armmstor", - [4] = "armestor", - [5] = "armmex", - [6] = "armmakr", - [7] = "armaap", - [8] = "armlab", - [9] = "armvp", - [10] = "armap", - [11] = "armnanotc", - [12] = "armeyes", - [13] = "armrad", - [14] = "armdrag", - [15] = "armllt", - [16] = "armrl", - [17] = "armdl", - [18] = "armjamt", - [19] = "armsy", - [20] = "armamex", - [21] = "armgeo", - [22] = "armbeamer", - [23] = "armhlt", - [24] = "armferret", - [25] = "armclaw", - [26] = "armjuno", - [27] = "armadvsol", - [30] = "armguard", - [31] = "armnanotc", - } - end - - if name == "corca" then - uDef.buildoptions = { - [1] = "corsolar", - [2] = "corwin", - [3] = "cormstor", - [4] = "corestor", - [5] = "cormex", - [6] = "cormakr", - [10] = "corlab", - [11] = "coraap", - [12] = "corvp", - [13] = "corap", - [14] = "cornanotc", - [15] = "coreyes", - [16] = "cordrag", - [17] = "corllt", - [18] = "corrl", - [19] = "corrad", - [20] = "cordl", - [21] = "corjamt", - [22] = "corsy", - [23] = "corexp", - [24] = "corgeo", - [25] = "corhllt", - [26] = "corhlt", - [27] = "cormaw", - [28] = "cormadsam", - [29] = "coradvsol", - [30] = "corpun", - [31] = "cornanotc", - } - end - - if name == "armaca" then - uDef.buildpic = "ARMCSA.DDS" - uDef.objectname = "Units/ARMCSA.s3o" - uDef.script = "units/ARMCSA.cob" - uDef.buildoptions = { - [1] = "armadvsol", - [2] = "armmoho", - [3] = "armbeamer", - [4] = "armhlt", - [5] = "armguard", - [6] = "armferret", - [7] = "armcir", - [8] = "armjuno", - [9] = "armpb", - [10] = "armarad", - [11] = "armveil", - [12] = "armfus", - [13] = "armgmm", - [14] = "armhaap", - [15] = "armlab", - [16] = "armaap", - [17] = "armsd", - [18] = "armmakr", - [19] = "armestor", - [20] = "armmstor", - [21] = "armageo", - [22] = "armckfus", - [23] = "armdl", - [24] = "armdf", - [25] = "armvp", - [26] = "armsy", - [27] = "armap", - [28] = "armnanotc", - [29] = "armamd", - } - end - - if name == "coraca" then - uDef.buildpic = "CORCSA.DDS" - uDef.objectname = "Units/CORCSA.s3o" - uDef.script = "units/CORCSA.cob" - uDef.buildoptions = { - [1] = "coradvsol", - [2] = "cormoho", - [3] = "corvipe", - [4] = "corhllt", - [5] = "corpun", - [6] = "cormadsam", - [7] = "corerad", - [8] = "corjuno", - [9] = "corfus", - [10] = "corarad", - [11] = "corshroud", - [12] = "corsd", - [13] = "corap", - [14] = "corhaap", - [15] = "coraap", - [16] = "cormakr", - [17] = "corestor", - [18] = "cormstor", - [19] = "corageo", - [20] = "corhlt", - [21] = "cordl", - [22] = "corvp", - [23] = "corlab", - [24] = "corsy", - [25] = "cornanotc", - [26] = "corfmd", - } - end - - ------------ - -- Sea Split - - -- Sea Labs + if name == "coralab" then + uDef.buildoptions = { + [1] = "corack", + [2] = "coraak", + [3] = "cormort", + [4] = "corcan", + [5] = "corpyro", + [6] = "corspy", + [7] = "coramph", + [8] = "cormando", + [9] = "cortermite", + [10] = "corhrk", + [11] = "corvoyr", + [12] = "corroach", + } + end + + if name == "armalab" then + uDef.buildoptions = { + [1] = "armack", + [2] = "armfido", + [3] = "armaak", + [4] = "armzeus", + [5] = "armmav", + [6] = "armamph", + [7] = "armspid", + [8] = "armfast", + [9] = "armvader", + [10] = "armmark", + [11] = "armsptk", + [12] = "armspy", + } + end + + if name == "armavp" then + uDef.buildoptions = { + [1] = "armacv", + [2] = "armch", + [3] = "armcroc", + [4] = "armlatnk", + [5] = "armah", + [6] = "armmart", + [7] = "armseer", + [8] = "armmh", + [9] = "armanac", + [10] = "armsh", + [11] = "armgremlin", + } + end + + if name == "coravp" then + uDef.buildoptions = { + [1] = "corch", + [2] = "coracv", + [3] = "corsala", + [4] = "correap", + [5] = "cormart", + [6] = "corhal", + [7] = "cormh", + [8] = "corsnap", + [9] = "corah", + [10] = "corsh", + [11] = "corvrad", + [12] = "corban", + } + end + + if name == "armck" then + uDef.buildoptions = { + [1] = "armsolar", + [2] = "armwin", + [3] = "armmex", + [4] = "armmstor", + [5] = "armestor", + [6] = "armamex", + [7] = "armmakr", + [8] = "armalab", + [9] = "armlab", + [10] = "armvp", + [11] = "armap", + [12] = "armnanotc", + [13] = "armeyes", + [14] = "armrad", + [15] = "armdrag", + [16] = "armllt", + [17] = "armrl", + [18] = "armdl", + [19] = "armjamt", + [22] = "armsy", + [23] = "armgeo", + [24] = "armbeamer", + [25] = "armhlt", + [26] = "armferret", + [27] = "armclaw", + [28] = "armjuno", + [29] = "armadvsol", + [30] = "armguard", + } + end + + if name == "corck" then + uDef.buildoptions = { + [1] = "corsolar", + [2] = "corwin", + [3] = "cormstor", + [4] = "corestor", + [5] = "cormex", + [6] = "cormakr", + [10] = "corlab", + [11] = "coralab", + [12] = "corvp", + [13] = "corap", + [14] = "cornanotc", + [15] = "coreyes", + [16] = "cordrag", + [17] = "corllt", + [18] = "corrl", + [19] = "corrad", + [20] = "cordl", + [21] = "corjamt", + [22] = "corsy", + [23] = "corexp", + [24] = "corgeo", + [25] = "corhllt", + [26] = "corhlt", + [27] = "cormaw", + [28] = "cormadsam", + [29] = "coradvsol", + [30] = "corpun", + } + end + + if name == "armack" then + uDef.buildoptions = { + [1] = "armadvsol", + [2] = "armmoho", + [3] = "armbeamer", + [4] = "armhlt", + [5] = "armguard", + [6] = "armferret", + [7] = "armcir", + [8] = "armjuno", + [9] = "armpb", + [10] = "armarad", + [11] = "armveil", + [12] = "armfus", + [13] = "armgmm", + [14] = "armhalab", + [15] = "armlab", + [16] = "armalab", + [17] = "armsd", + [18] = "armmakr", + [19] = "armestor", + [20] = "armmstor", + [21] = "armageo", + [22] = "armckfus", + [23] = "armdl", + [24] = "armdf", + [25] = "armvp", + [26] = "armsy", + [27] = "armap", + [28] = "armnanotc", + [29] = "armamd", + } + end + + if name == "corack" then + uDef.buildoptions = { + [1] = "coradvsol", + [2] = "cormoho", + [3] = "corvipe", + [4] = "corhllt", + [5] = "corpun", + [6] = "cormadsam", + [7] = "corerad", + [8] = "corjuno", + [9] = "corfus", + [10] = "corarad", + [11] = "corshroud", + [12] = "corsd", + [13] = "corlab", + [14] = "corhalab", + [15] = "coralab", + [16] = "cormakr", + [17] = "corestor", + [18] = "cormstor", + [19] = "corageo", + [20] = "corhlt", + [21] = "cordl", + [22] = "corvp", + [23] = "corap", + [24] = "corsy", + [25] = "cornanotc", + [26] = "corfmd", + } + end + + if name == "armcv" then + uDef.buildoptions = { + [1] = "armsolar", + [2] = "armwin", + [3] = "armmex", + [4] = "armmstor", + [5] = "armestor", + [6] = "armamex", + [7] = "armmakr", + [8] = "armavp", + [9] = "armlab", + [10] = "armvp", + [11] = "armap", + [12] = "armnanotc", + [13] = "armeyes", + [14] = "armrad", + [15] = "armdrag", + [16] = "armllt", + [17] = "armrl", + [18] = "armdl", + [19] = "armjamt", + [22] = "armsy", + [23] = "armgeo", + [24] = "armbeamer", + [25] = "armhlt", + [26] = "armferret", + [27] = "armclaw", + [28] = "armjuno", + [29] = "armadvsol", + [30] = "armguard", + } + end + + if name == "armbeaver" then + uDef.buildoptions = { + [1] = "armsolar", + [2] = "armwin", + [3] = "armmex", + [4] = "armmstor", + [5] = "armestor", + [6] = "armamex", + [7] = "armmakr", + [8] = "armavp", + [9] = "armlab", + [10] = "armvp", + [11] = "armap", + [12] = "armnanotc", + [13] = "armeyes", + [14] = "armrad", + [15] = "armdrag", + [16] = "armllt", + [17] = "armrl", + [18] = "armdl", + [19] = "armjamt", + [20] = "armsy", + [21] = "armtide", + [22] = "armfmkr", + [23] = "armasy", + [24] = "armfrt", + [25] = "armtl", + [26] = "armgeo", + [27] = "armbeamer", + [28] = "armhlt", + [29] = "armferret", + [30] = "armclaw", + [31] = "armjuno", + [32] = "armfrad", + [33] = "armadvsol", + [34] = "armguard", + } + end + + if name == "corcv" then + uDef.buildoptions = { + [1] = "corsolar", + [2] = "corwin", + [3] = "cormstor", + [4] = "corestor", + [5] = "cormex", + [6] = "cormakr", + [10] = "corlab", + [11] = "coravp", + [12] = "corvp", + [13] = "corap", + [14] = "cornanotc", + [15] = "coreyes", + [16] = "cordrag", + [17] = "corllt", + [18] = "corrl", + [19] = "corrad", + [20] = "cordl", + [21] = "corjamt", + [22] = "corsy", + [23] = "corexp", + [24] = "corgeo", + [25] = "corhllt", + [26] = "corhlt", + [27] = "cormaw", + [28] = "cormadsam", + [29] = "coradvsol", + [30] = "corpun", + } + end + + if name == "cormuskrat" then + uDef.buildoptions = { + [1] = "corsolar", + [2] = "corwin", + [3] = "cormstor", + [4] = "corestor", + [5] = "cormex", + [6] = "cormakr", + [7] = "corlab", + [8] = "coravp", + [9] = "corvp", + [10] = "corap", + [11] = "cornanotc", + [12] = "coreyes", + [13] = "cordrag", + [14] = "corllt", + [15] = "corrl", + [16] = "corrad", + [17] = "cordl", + [18] = "corjamt", + [19] = "corsy", + [20] = "corexp", + [21] = "corgeo", + [22] = "corhllt", + [23] = "corhlt", + [24] = "cormaw", + [25] = "cormadsam", + [26] = "corfrad", + [27] = "cortide", + [28] = "corasy", + [29] = "cortl", + [30] = "coradvsol", + [31] = "corpun", + } + end + + if name == "armacv" then + uDef.buildoptions = { + [1] = "armadvsol", + [2] = "armmoho", + [3] = "armbeamer", + [4] = "armhlt", + [5] = "armguard", + [6] = "armferret", + [7] = "armcir", + [8] = "armjuno", + [9] = "armpb", + [10] = "armarad", + [11] = "armveil", + [12] = "armfus", + [13] = "armgmm", + [14] = "armhavp", + [15] = "armlab", + [16] = "armavp", + [17] = "armsd", + [18] = "armmakr", + [19] = "armestor", + [20] = "armmstor", + [21] = "armageo", + [22] = "armckfus", + [23] = "armdl", + [24] = "armdf", + [25] = "armvp", + [26] = "armsy", + [27] = "armap", + [28] = "armnanotc", + [29] = "armamd", + } + end + + if name == "coracv" then + uDef.buildoptions = { + [1] = "coradvsol", + [2] = "cormoho", + [3] = "corvipe", + [4] = "corhllt", + [5] = "corpun", + [6] = "cormadsam", + [7] = "corerad", + [8] = "corjuno", + [9] = "corfus", + [10] = "corarad", + [11] = "corshroud", + [12] = "corsd", + [13] = "corvp", + [14] = "corhavp", + [15] = "coravp", + [16] = "cormakr", + [17] = "corestor", + [18] = "cormstor", + [19] = "corageo", + [20] = "corhlt", + [21] = "cordl", + [22] = "corlab", + [23] = "corap", + [24] = "corsy", + [25] = "cornanotc", + [26] = "corfmd", + } + end + + ------------------------------ + -- Armada and Cortex Air Split + + -- Air Labs + + if name == "armaap" then + uDef.buildpic = "ARMHAAP.DDS" + uDef.objectname = "Units/ARMAAPLAT.s3o" + uDef.script = "Units/techsplit/ARMHAAP.cob" + uDef.customparams.buildinggrounddecaltype = "decals/armamsub_aoplane.dds" + uDef.customparams.buildinggrounddecalsizex = 13 + uDef.customparams.buildinggrounddecalsizey = 13 + uDef.featuredefs.dead["object"] = "Units/armaaplat_dead.s3o" + uDef.buildoptions = { + [1] = "armaca", + [2] = "armseap", + [3] = "armsb", + [4] = "armsfig", + [5] = "armsehak", + [6] = "armsaber", + [7] = "armhvytrans", + } + uDef.sfxtypes = { + explosiongenerators = { + [1] = "custom:radarpulse_t1_slow", + }, + pieceexplosiongenerators = { + [1] = "deathceg2", + [2] = "deathceg3", + [3] = "deathceg4", + }, + } + uDef.sounds = { + build = "seaplok1", + canceldestruct = "cancel2", + underattack = "warning1", + unitcomplete = "untdone", + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + select = { + [1] = "seaplsl1", + }, + } + end + + if name == "coraap" then + uDef.buildpic = "CORHAAP.DDS" + uDef.objectname = "Units/CORAAPLAT.s3o" + uDef.script = "Units/CORHAAP.cob" + uDef.buildoptions = { + [1] = "coraca", + [2] = "corhunt", + [3] = "corcut", + [4] = "corsb", + [5] = "corseap", + [6] = "corsfig", + [7] = "corhvytrans", + } + uDef.featuredefs.dead["object"] = "Units/coraaplat_dead.s3o" + uDef.customparams.buildinggrounddecaltype = "decals/coraap_aoplane.dds" + uDef.customparams.buildinggrounddecalsizex = 6 + uDef.customparams.buildinggrounddecalsizey = 6 + uDef.customparams.sfxtypes = { + pieceexplosiongenerators = { + [1] = "deathceg2", + [2] = "deathceg3", + [3] = "deathceg4", + }, + } + uDef.customparams.sounds = { + build = "seaplok2", + canceldestruct = "cancel2", + underattack = "warning1", + unitcomplete = "untdone", + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + select = { + [1] = "seaplsl2", + }, + } + end + + if name == "armap" then + uDef.buildoptions = { + [1] = "armca", + [2] = "armpeep", + [3] = "armfig", + [4] = "armthund", + [5] = "armatlas", + [6] = "armkam", + } + end + + if name == "corap" then + uDef.buildoptions = { + [1] = "corca", + [2] = "corfink", + [3] = "corveng", + [4] = "corshad", + [5] = "corvalk", + [6] = "corbw", + } + end + + -- Air Cons + + if name == "armca" then + uDef.buildoptions = { + [1] = "armsolar", + [2] = "armwin", + [3] = "armmstor", + [4] = "armestor", + [5] = "armmex", + [6] = "armmakr", + [7] = "armaap", + [8] = "armlab", + [9] = "armvp", + [10] = "armap", + [11] = "armnanotc", + [12] = "armeyes", + [13] = "armrad", + [14] = "armdrag", + [15] = "armllt", + [16] = "armrl", + [17] = "armdl", + [18] = "armjamt", + [19] = "armsy", + [20] = "armamex", + [21] = "armgeo", + [22] = "armbeamer", + [23] = "armhlt", + [24] = "armferret", + [25] = "armclaw", + [26] = "armjuno", + [27] = "armadvsol", + [30] = "armguard", + [31] = "armnanotc", + } + end + + if name == "corca" then + uDef.buildoptions = { + [1] = "corsolar", + [2] = "corwin", + [3] = "cormstor", + [4] = "corestor", + [5] = "cormex", + [6] = "cormakr", + [10] = "corlab", + [11] = "coraap", + [12] = "corvp", + [13] = "corap", + [14] = "cornanotc", + [15] = "coreyes", + [16] = "cordrag", + [17] = "corllt", + [18] = "corrl", + [19] = "corrad", + [20] = "cordl", + [21] = "corjamt", + [22] = "corsy", + [23] = "corexp", + [24] = "corgeo", + [25] = "corhllt", + [26] = "corhlt", + [27] = "cormaw", + [28] = "cormadsam", + [29] = "coradvsol", + [30] = "corpun", + [31] = "cornanotc", + } + end + + if name == "armaca" then + uDef.buildpic = "ARMCSA.DDS" + uDef.objectname = "Units/ARMCSA.s3o" + uDef.script = "units/ARMCSA.cob" + uDef.buildoptions = { + [1] = "armadvsol", + [2] = "armmoho", + [3] = "armbeamer", + [4] = "armhlt", + [5] = "armguard", + [6] = "armferret", + [7] = "armcir", + [8] = "armjuno", + [9] = "armpb", + [10] = "armarad", + [11] = "armveil", + [12] = "armfus", + [13] = "armgmm", + [14] = "armhaap", + [15] = "armlab", + [16] = "armaap", + [17] = "armsd", + [18] = "armmakr", + [19] = "armestor", + [20] = "armmstor", + [21] = "armageo", + [22] = "armckfus", + [23] = "armdl", + [24] = "armdf", + [25] = "armvp", + [26] = "armsy", + [27] = "armap", + [28] = "armnanotc", + [29] = "armamd", + } + end + + if name == "coraca" then + uDef.buildpic = "CORCSA.DDS" + uDef.objectname = "Units/CORCSA.s3o" + uDef.script = "units/CORCSA.cob" + uDef.buildoptions = { + [1] = "coradvsol", + [2] = "cormoho", + [3] = "corvipe", + [4] = "corhllt", + [5] = "corpun", + [6] = "cormadsam", + [7] = "corerad", + [8] = "corjuno", + [9] = "corfus", + [10] = "corarad", + [11] = "corshroud", + [12] = "corsd", + [13] = "corap", + [14] = "corhaap", + [15] = "coraap", + [16] = "cormakr", + [17] = "corestor", + [18] = "cormstor", + [19] = "corageo", + [20] = "corhlt", + [21] = "cordl", + [22] = "corvp", + [23] = "corlab", + [24] = "corsy", + [25] = "cornanotc", + [26] = "corfmd", + } + end + + ------------ + -- Sea Split + + -- Sea Labs if name == "armhasy" or name == "corhasy" then uDef.metalcost = uDef.metalcost - 1200 end - if name == "armsy" then - uDef.buildoptions[8] = "armbeaver" - end - - if name == "corsy" then - uDef.buildoptions[8] = "cormuskrat" - end - - if name == "armasy" then - uDef.metalcost = uDef.metalcost + 400 - uDef.buildoptions = { - [1] = "armacsub", - [2] = "armmship", - [3] = "armcrus", - [4] = "armsubk", - [5] = "armah", - [6] = "armlship", - [7] = "armcroc", - [8] = "armsh", - [9] = "armanac", - [10] = "armch", - [11] = "armmh", - [12] = "armsjam" - } - - elseif name == "corasy" then - uDef.metalcost = uDef.metalcost + 400 - uDef.buildoptions = { - [1] = "coracsub", - [2] = "corcrus", - [3] = "corshark", - [4] = "cormship", - [5] = "corfship", - [6] = "corah", - [7] = "corsala", - [8] = "corsnap", - [9] = "corsh", - [10] = "corch", - [11] = "cormh", - [12] = "corsjam", - } - - - -- Sea Cons - - elseif name == "armcs" then - uDef.buildoptions = { - [1] = "armmex", - [2] = "armvp", - [3] = "armap", - [4] = "armlab", - [5] = "armeyes", - [6] = "armdl", - [7] = "armdrag", - [8] = "armtide", - [9] = "armuwgeo", - [10] = "armfmkr", - [11] = "armuwms", - [12] = "armuwes", - [13] = "armsy", - [14] = "armnanotcplat", - [15] = "armasy", - [16] = "armfrad", - [17] = "armfdrag", - [18] = "armtl", - [19] = "armfrt", - [20] = "armfhlt", - [21] = "armbeamer", - [22] = "armclaw", - [23] = "armferret", - [24] = "armjuno", - [25] = "armguard", - } - - elseif name == "corcs" then - uDef.buildoptions = { - [1] = "cormex", - [2] = "corvp", - [3] = "corap", - [4] = "corlab", - [5] = "coreyes", - [6] = "cordl", - [7] = "cordrag", - [8] = "cortide", - [9] = "corfmkr", - [10] = "coruwms", - [11] = "coruwes", - [12] = "corsy", - [13] = "cornanotcplat", - [14] = "corasy", - [15] = "corfrad", - [16] = "corfdrag", - [17] = "cortl", - [18] = "corfrt", - [19] = "cormadsam", - [20] = "corfhlt", - [21] = "corhllt", - [22] = "cormaw", - [23] = "coruwgeo", - [24] = "corjuno", - [30] = "corpun" - } - - elseif name == "armacsub" then - uDef.buildoptions = { - [1] = "armtide", - [2] = "armuwageo", - [3] = "armveil", - [4] = "armarad", - [5] = "armpb", - [7] = "armasy", - [8] = "armguard", - [9] = "armfhlt", - [10] = "armhasy", - [11] = "armfmkr", - [12] = "armason", - [13] = "armuwfus", - [17] = "armfdrag", - [18] = "armsy", - [19] = "armuwmme", - [20] = "armatl", - [21] = "armkraken", - [22] = "armfrt", - [23] = "armuwes", - [24] = "armuwms", - [25] = "armhaapuw", - [26] = "armvp", - [27] = "armlab", - [28] = "armap", - [29] = "armferret", - [30] = "armcir", - [31] = "armsd", - [32] = "armnanotcplat", - [33] = "armamd", - } - - elseif name == "coracsub" then - uDef.buildoptions = { - [1] = "cortide", - [2] = "coruwmme", - [3] = "corshroud", - [4] = "corarad", - [5] = "corvipe", - [6] = "corsy", - [7] = "corasy", - [8] = "corhasy", - [9] = "corfhlt", - [10] = "corpun", - [11] = "corason", - [12] = "coruwfus", - [13] = "corfmkr", - [14] = "corfdrag", - [15] = "corfrt", - [16] = "coruwes", - [17] = "coruwms", - [18] = "coruwageo", - [19] = "corhaapuw", - [20] = "coratl", - [21] = "corsd", - [22] = "corvp", - [23] = "corlab", - [24] = "corsy", - [25] = "corasy", - [26] = "cornanotcplat", - [27] = "corfdoom", - [28] = "cormadsam", - [29] = "corerad", - [30] = "corfmd", - } - end - - -- T3 Gantries - if name == "armshltx" then - uDef.footprintx = 15 - uDef.footprintz = 15 - uDef.collisionvolumescales = "225 150 205" - uDef.yardmap = "ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee" - uDef.objectname = "Units/ARMSHLTXBIG.s3o" - uDef.script = "Units/techsplit/ARMSHLTXBIG.cob" - uDef.featuredefs.armshlt_dead.object = "Units/armshltxbig_dead.s3o" - uDef.featuredefs.armshlt_dead.footprintx = 11 - uDef.featuredefs.armshlt_dead.footprintz = 11 - uDef.featuredefs.armshlt_dead.collisionvolumescales = "155 95 180" - uDef.customparams.buildinggrounddecalsizex = 18 - uDef.customparams.buildinggrounddecalsizez = 18 - end - - if name == "corgant" then - uDef.footprintx = 15 - uDef.footprintz = 15 - uDef.collisionvolumescales = "245 131 245" - uDef.yardmap = "oooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo" - uDef.objectname = "Units/CORGANTBIG.s3o" - uDef.script = "Units/techsplit/CORGANTBIG.cob" - uDef.featuredefs.dead.object = "Units/corgant_dead.s3o" - uDef.featuredefs.dead.footprintx = 15 - uDef.featuredefs.dead.footprintz = 15 - uDef.featuredefs.dead.collisionvolumescales = "238 105 238" - uDef.customparams.buildinggrounddecalsizex = 18 - uDef.customparams.buildinggrounddecalsizez = 18 - end - - if name == "leggant" then - uDef.footprintx = 15 - uDef.footprintz = 15 - uDef.collisionvolumescales = "245 135 245" - uDef.yardmap = "oooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo yooeeeeeeeeeooy" - uDef.objectname = "Units/LEGGANTBIG.s3o" - uDef.script = "Units/techsplit/LEGGANTBIG.cob" - uDef.featuredefs.dead.object = "Units/leggant_dead.s3o" - uDef.featuredefs.dead.footprintx = 15 - uDef.featuredefs.dead.footprintz = 15 - uDef.featuredefs.dead.collisionvolumescales = "145 90 160" - uDef.customparams.buildinggrounddecalsizex = 18 - uDef.customparams.buildinggrounddecalsizez = 18 - end - - -- Remove lolmech from T3 cons - if name == "armhaca" or name == "armhack" or name == "armhacv" then - uDef.buildoptions[24] = "" - end - - if name == "armhacs" then - uDef.buildoptions[13] = "" - end - - if name == "corhaca" or name == "corhack" or name == "corhacv" then - uDef.buildoptions[25] = "" - uDef.buildoptions[26] = "" - end - - if name == "corhacs" then - uDef.buildoptions[15] = "" - uDef.buildoptions[16] = "" - end - - if name == "leghaca" or name == "leghack" or name == "leghacv" then - uDef.buildoptions[33] = "" - uDef.buildoptions[34] = "" - end - - -- remove hovers from com - if name == "corcom" or name == "armcom" or name == "legcom" then - uDef.buildoptions[26] = "" - uDef.buildoptions[27] = "" - - -- T2 labs are priced as t1.5 but require more BP - elseif name == "armaap" or name == "armasy" or name == "armalab" or name == "armavp" - or name == "coraap" or name == "corasy" or name == "coralab" or name == "coravp" - then - uDef.metalcost = uDef.metalcost - 1300 - uDef.energycost = uDef.energycost - 5000 - uDef.buildtime = math.ceil(uDef.buildtime * 0.015) * 100 - - -- T2 cons are priced as t1.5 - elseif name == "armack" or name == "armacv" or name == "armaca" or name == "armacsub" - or name == "corack" or name == "coracv" or name == "coraca" or name == "coracsub" - or name == "legack" or name == "legacv" or name == "legaca" - then - uDef.metalcost = uDef.metalcost - 200 - uDef.energycost = uDef.energycost - 2000 - uDef.buildtime = math.ceil(uDef.buildtime * 0.008) * 100 - - -- Hover cons are priced as t2 - elseif name == "armch" or name == "corch" or name == "legch" - then - uDef.metalcost = uDef.metalcost * 2 - uDef.energycost = uDef.energycost * 2 - uDef.buildtime = uDef.buildtime * 2 - uDef.customparams.techlevel = 2 - end - - ---------------------------------------------- - -- T2 mexes upkeep increased, health decreased - if name == "armmoho" or name == "cormoho" or name == "armuwmme" or name == "coruwmme" - or name == "legmoho" - then - uDef.energyupkeep = 40 - uDef.health = uDef.health - 1200 - elseif name == "cormexp" then - uDef.energyupkeep = 40 - end - - - - ------------------------------- - -- T3 mobile jammers have radar - - if name == "armaser" or name == "corspec" or name == "legajamk" - or name == "armjam" or name == "coreter" or name == "legavjam" - then - uDef.metalcost = uDef.metalcost + 100 - uDef.energycost = uDef.energycost + 1250 - uDef.buildtime = uDef.buildtime + 3800 - uDef.radardistance = 2500 - uDef.sightdistance = 1000 - end - - if name == "armantiship" or name == "corantiship" then - uDef.radardistancejam = 450 - end - - ---------------------------- - -- T2 ship jammers get radar - - if name == "armsjam" or name == "corsjam" then - uDef.metalcost = uDef.metalcost + 90 - uDef.energycost = uDef.energycost + 1050 - uDef.buildtime = uDef.buildtime + 3000 - uDef.radarDistance = 2200 - uDef.sightdistance = 900 - end - - ----------------------------------- - -- Pinpointers are T3 radar/jammers - - if name == "armtarg" or name == "cortarg" or name == "legtarg" - or name == "armfatf" or name == "corfatf" - then - uDef.radardistance = 5000 - uDef.sightdistance = 1200 - uDef.radardistancejam = 900 - end - - ----------------------------- - -- Correct Tier for Announcer - - if name == "armch" or name == "armsh" or name == "armanac" or name == "armah" or name == "armmh" - or name == "armcsa" or name == "armsaber" or name == "armsb" or name == "armseap" or name == "armsfig" or name == "armsehak" or name == "armhvytrans" - or name == "corch" or name == "corsh" or name == "corsnap" or name == "corah" or name == "cormh" or name == "corhal" - or name == "corcsa" or name == "corcut" or name == "corsb" or name == "corseap" or name == "corsfig" or name == "corhunt" or name == "corhvytrans" - then - uDef.customparams.techlevel = 2 - - elseif name == "armsnipe" or name == "armfboy" or name == "armaser" or name == "armdecom" or name == "armscab" - or name == "armbull" or name == "armmerl" or name == "armmanni" or name == "armyork" or name == "armjam" - or name == "armserp" or name == "armbats" or name == "armepoch" or name == "armantiship" or name == "armaas" - or name == "armhawk" or name == "armpnix" or name == "armlance" or name == "armawac" or name == "armdfly" or name == "armliche" or name == "armblade" or name == "armbrawl" or name == "armstil" - or name == "corsumo" or name == "cordecom" or name == "corsktl" or name == "corspec" - or name == "corgol" or name == "corvroc" or name == "cortrem" or name == "corsent" or name == "coreter" or name == "corparrow" - or name == "corssub" or name == "corbats" or name == "corblackhy" or name == "corarch" or name == "corantiship" - or name == "corape" or name == "corhurc" or name == "cortitan" or name == "corvamp" or name == "corseah" or name == "corawac" or name == "corcrwh" - then - uDef.customparams.techlevel = 3 - end - - - ----------------------------------------- - -- Hovers, Sea Planes and Amphibious Labs - - if name == "armch" then - uDef.buildoptions = { - [1] = "armadvsol", - [2] = "armmoho", - [3] = "armbeamer", - [4] = "armhlt", - [5] = "armguard", - [6] = "armferret", - [7] = "armcir", - [8] = "armjuno", - [9] = "armpb", - [10] = "armarad", - [11] = "armveil", - [12] = "armfus", - [13] = "armgmm", - [14] = "armhavp", - [15] = "armlab", - [16] = "armsd", - [17] = "armmakr", - [18] = "armestor", - [19] = "armmstor", - [20] = "armageo", - [21] = "armckfus", - [22] = "armdl", - [23] = "armdf", - [24] = "armvp", - [25] = "armsy", - [26] = "armap", - [27] = "armavp", - [28] = "armasy", - [29] = "armhasy", - [30] = "armtl", - [31] = "armason", - [32] = "armdrag", - [33] = "armfdrag", - [34] = "armuwmme", - [35] = "armguard", - [36] = "armnanotc", - [37] = "armamd", - } - - elseif name == "corch" then - uDef.buildoptions = { - [1] = "coradvsol", - [2] = "cormoho", - [3] = "corvipe", - [4] = "corhllt", - [5] = "corpun", - [6] = "cormadsam", - [7] = "corerad", - [8] = "corjuno", - [9] = "corfus", - [10] = "corarad", - [11] = "corshroud", - [12] = "corsd", - [13] = "corvp", - [14] = "corhavp", - [15] = "coravp", - [16] = "cormakr", - [17] = "corestor", - [18] = "cormstor", - [19] = "corageo", - [20] = "cordl", - [21] = "coruwmme", - [22] = "cordrag", - [23] = "corfdrag", - [24] = "corason", - [25] = "corlab", - [26] = "corap", - [27] = "corsy", - [28] = "corasy", - [29] = "corhlt", - [30] = "cortl", - [31] = "corhasy", - [32] = "corpun", - [33] = "corfmd", - } - end - -- Seaplane Platforms removed, become T2 air labs. - -- T2 air labs have sea variants - -- Made by hover cons and enhanced ship cons - -- Enhanced ships given seaplanes instead of static AA - -- Tech Split Balance - if name == "corthud" then + if name == "armsy" then + uDef.buildoptions[8] = "armbeaver" + end + + if name == "corsy" then + uDef.buildoptions[8] = "cormuskrat" + end + + if name == "armasy" then + uDef.metalcost = uDef.metalcost + 400 + uDef.buildoptions = { + [1] = "armacsub", + [2] = "armmship", + [3] = "armcrus", + [4] = "armsubk", + [5] = "armah", + [6] = "armlship", + [7] = "armcroc", + [8] = "armsh", + [9] = "armanac", + [10] = "armch", + [11] = "armmh", + [12] = "armsjam", + } + elseif name == "corasy" then + uDef.metalcost = uDef.metalcost + 400 + uDef.buildoptions = { + [1] = "coracsub", + [2] = "corcrus", + [3] = "corshark", + [4] = "cormship", + [5] = "corfship", + [6] = "corah", + [7] = "corsala", + [8] = "corsnap", + [9] = "corsh", + [10] = "corch", + [11] = "cormh", + [12] = "corsjam", + } + + -- Sea Cons + elseif name == "armcs" then + uDef.buildoptions = { + [1] = "armmex", + [2] = "armvp", + [3] = "armap", + [4] = "armlab", + [5] = "armeyes", + [6] = "armdl", + [7] = "armdrag", + [8] = "armtide", + [9] = "armuwgeo", + [10] = "armfmkr", + [11] = "armuwms", + [12] = "armuwes", + [13] = "armsy", + [14] = "armnanotcplat", + [15] = "armasy", + [16] = "armfrad", + [17] = "armfdrag", + [18] = "armtl", + [19] = "armfrt", + [20] = "armfhlt", + [21] = "armbeamer", + [22] = "armclaw", + [23] = "armferret", + [24] = "armjuno", + [25] = "armguard", + } + elseif name == "corcs" then + uDef.buildoptions = { + [1] = "cormex", + [2] = "corvp", + [3] = "corap", + [4] = "corlab", + [5] = "coreyes", + [6] = "cordl", + [7] = "cordrag", + [8] = "cortide", + [9] = "corfmkr", + [10] = "coruwms", + [11] = "coruwes", + [12] = "corsy", + [13] = "cornanotcplat", + [14] = "corasy", + [15] = "corfrad", + [16] = "corfdrag", + [17] = "cortl", + [18] = "corfrt", + [19] = "cormadsam", + [20] = "corfhlt", + [21] = "corhllt", + [22] = "cormaw", + [23] = "coruwgeo", + [24] = "corjuno", + [30] = "corpun", + } + elseif name == "armacsub" then + uDef.buildoptions = { + [1] = "armtide", + [2] = "armuwageo", + [3] = "armveil", + [4] = "armarad", + [5] = "armpb", + [7] = "armasy", + [8] = "armguard", + [9] = "armfhlt", + [10] = "armhasy", + [11] = "armfmkr", + [12] = "armason", + [13] = "armuwfus", + [17] = "armfdrag", + [18] = "armsy", + [19] = "armuwmme", + [20] = "armatl", + [21] = "armkraken", + [22] = "armfrt", + [23] = "armuwes", + [24] = "armuwms", + [25] = "armhaapuw", + [26] = "armvp", + [27] = "armlab", + [28] = "armap", + [29] = "armferret", + [30] = "armcir", + [31] = "armsd", + [32] = "armnanotcplat", + [33] = "armamd", + } + elseif name == "coracsub" then + uDef.buildoptions = { + [1] = "cortide", + [2] = "coruwmme", + [3] = "corshroud", + [4] = "corarad", + [5] = "corvipe", + [6] = "corsy", + [7] = "corasy", + [8] = "corhasy", + [9] = "corfhlt", + [10] = "corpun", + [11] = "corason", + [12] = "coruwfus", + [13] = "corfmkr", + [14] = "corfdrag", + [15] = "corfrt", + [16] = "coruwes", + [17] = "coruwms", + [18] = "coruwageo", + [19] = "corhaapuw", + [20] = "coratl", + [21] = "corsd", + [22] = "corvp", + [23] = "corlab", + [24] = "corsy", + [25] = "corasy", + [26] = "cornanotcplat", + [27] = "corfdoom", + [28] = "cormadsam", + [29] = "corerad", + [30] = "corfmd", + } + end + + -- T3 Gantries + if name == "armshltx" then + uDef.footprintx = 15 + uDef.footprintz = 15 + uDef.collisionvolumescales = "225 150 205" + uDef.yardmap = "ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee eeeeeeeeeeeeeee" + uDef.objectname = "Units/ARMSHLTXBIG.s3o" + uDef.script = "Units/techsplit/ARMSHLTXBIG.cob" + uDef.featuredefs.armshlt_dead.object = "Units/armshltxbig_dead.s3o" + uDef.featuredefs.armshlt_dead.footprintx = 11 + uDef.featuredefs.armshlt_dead.footprintz = 11 + uDef.featuredefs.armshlt_dead.collisionvolumescales = "155 95 180" + uDef.customparams.buildinggrounddecalsizex = 18 + uDef.customparams.buildinggrounddecalsizez = 18 + end + + if name == "corgant" then + uDef.footprintx = 15 + uDef.footprintz = 15 + uDef.collisionvolumescales = "245 131 245" + uDef.yardmap = "oooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo" + uDef.objectname = "Units/CORGANTBIG.s3o" + uDef.script = "Units/techsplit/CORGANTBIG.cob" + uDef.featuredefs.dead.object = "Units/corgant_dead.s3o" + uDef.featuredefs.dead.footprintx = 15 + uDef.featuredefs.dead.footprintz = 15 + uDef.featuredefs.dead.collisionvolumescales = "238 105 238" + uDef.customparams.buildinggrounddecalsizex = 18 + uDef.customparams.buildinggrounddecalsizez = 18 + end + + if name == "leggant" then + uDef.footprintx = 15 + uDef.footprintz = 15 + uDef.collisionvolumescales = "245 135 245" + uDef.yardmap = "oooooooooooooo ooooooooooooooo ooooooooooooooo ooooooooooooooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo oooeeeeeeeeeooo yooeeeeeeeeeooy" + uDef.objectname = "Units/LEGGANTBIG.s3o" + uDef.script = "Units/techsplit/LEGGANTBIG.cob" + uDef.featuredefs.dead.object = "Units/leggant_dead.s3o" + uDef.featuredefs.dead.footprintx = 15 + uDef.featuredefs.dead.footprintz = 15 + uDef.featuredefs.dead.collisionvolumescales = "145 90 160" + uDef.customparams.buildinggrounddecalsizex = 18 + uDef.customparams.buildinggrounddecalsizez = 18 + end + + -- Remove lolmech from T3 cons + if name == "armhaca" or name == "armhack" or name == "armhacv" then + uDef.buildoptions[24] = "" + end + + if name == "armhacs" then + uDef.buildoptions[13] = "" + end + + if name == "corhaca" or name == "corhack" or name == "corhacv" then + uDef.buildoptions[25] = "" + uDef.buildoptions[26] = "" + end + + if name == "corhacs" then + uDef.buildoptions[15] = "" + uDef.buildoptions[16] = "" + end + + if name == "leghaca" or name == "leghack" or name == "leghacv" then + uDef.buildoptions[33] = "" + uDef.buildoptions[34] = "" + end + + -- remove hovers from com + if name == "corcom" or name == "armcom" or name == "legcom" then + uDef.buildoptions[26] = "" + uDef.buildoptions[27] = "" + + -- T2 labs are priced as t1.5 but require more BP + elseif name == "armaap" or name == "armasy" or name == "armalab" or name == "armavp" or name == "coraap" or name == "corasy" or name == "coralab" or name == "coravp" then + uDef.metalcost = uDef.metalcost - 1300 + uDef.energycost = uDef.energycost - 5000 + uDef.buildtime = math.ceil(uDef.buildtime * 0.015) * 100 + + -- T2 cons are priced as t1.5 + elseif name == "armack" or name == "armacv" or name == "armaca" or name == "armacsub" or name == "corack" or name == "coracv" or name == "coraca" or name == "coracsub" or name == "legack" or name == "legacv" or name == "legaca" then + uDef.metalcost = uDef.metalcost - 200 + uDef.energycost = uDef.energycost - 2000 + uDef.buildtime = math.ceil(uDef.buildtime * 0.008) * 100 + + -- Hover cons are priced as t2 + elseif name == "armch" or name == "corch" or name == "legch" then + uDef.metalcost = uDef.metalcost * 2 + uDef.energycost = uDef.energycost * 2 + uDef.buildtime = uDef.buildtime * 2 + uDef.customparams.techlevel = 2 + end + + ---------------------------------------------- + -- T2 mexes upkeep increased, health decreased + if name == "armmoho" or name == "cormoho" or name == "armuwmme" or name == "coruwmme" or name == "legmoho" then + uDef.energyupkeep = 40 + uDef.health = uDef.health - 1200 + elseif name == "cormexp" then + uDef.energyupkeep = 40 + end + + ------------------------------- + -- T3 mobile jammers have radar + + if name == "armaser" or name == "corspec" or name == "legajamk" or name == "armjam" or name == "coreter" or name == "legavjam" then + uDef.metalcost = uDef.metalcost + 100 + uDef.energycost = uDef.energycost + 1250 + uDef.buildtime = uDef.buildtime + 3800 + uDef.radardistance = 2500 + uDef.sightdistance = 1000 + end + + if name == "armantiship" or name == "corantiship" then + uDef.radardistancejam = 450 + end + + ---------------------------- + -- T2 ship jammers get radar + + if name == "armsjam" or name == "corsjam" then + uDef.metalcost = uDef.metalcost + 90 + uDef.energycost = uDef.energycost + 1050 + uDef.buildtime = uDef.buildtime + 3000 + uDef.radarDistance = 2200 + uDef.sightdistance = 900 + end + + ----------------------------------- + -- Pinpointers are T3 radar/jammers + + if name == "armtarg" or name == "cortarg" or name == "legtarg" or name == "armfatf" or name == "corfatf" then + uDef.radardistance = 5000 + uDef.sightdistance = 1200 + uDef.radardistancejam = 900 + end + + ----------------------------- + -- Correct Tier for Announcer + + if name == "armch" or name == "armsh" or name == "armanac" or name == "armah" or name == "armmh" or name == "armcsa" or name == "armsaber" or name == "armsb" or name == "armseap" or name == "armsfig" or name == "armsehak" or name == "armhvytrans" or name == "corch" or name == "corsh" or name == "corsnap" or name == "corah" or name == "cormh" or name == "corhal" or name == "corcsa" or name == "corcut" or name == "corsb" or name == "corseap" or name == "corsfig" or name == "corhunt" or name == "corhvytrans" then + uDef.customparams.techlevel = 2 + elseif name == "armsnipe" or name == "armfboy" or name == "armaser" or name == "armdecom" or name == "armscab" or name == "armbull" or name == "armmerl" or name == "armmanni" or name == "armyork" or name == "armjam" or name == "armserp" or name == "armbats" or name == "armepoch" or name == "armantiship" or name == "armaas" or name == "armhawk" or name == "armpnix" or name == "armlance" or name == "armawac" or name == "armdfly" or name == "armliche" or name == "armblade" or name == "armbrawl" or name == "armstil" or name == "corsumo" or name == "cordecom" or name == "corsktl" or name == "corspec" or name == "corgol" or name == "corvroc" or name == "cortrem" or name == "corsent" or name == "coreter" or name == "corparrow" or name == "corssub" or name == "corbats" or name == "corblackhy" or name == "corarch" or name == "corantiship" or name == "corape" or name == "corhurc" or name == "cortitan" or name == "corvamp" or name == "corseah" or name == "corawac" or name == "corcrwh" then + uDef.customparams.techlevel = 3 + end + + ----------------------------------------- + -- Hovers, Sea Planes and Amphibious Labs + + if name == "armch" then + uDef.buildoptions = { + [1] = "armadvsol", + [2] = "armmoho", + [3] = "armbeamer", + [4] = "armhlt", + [5] = "armguard", + [6] = "armferret", + [7] = "armcir", + [8] = "armjuno", + [9] = "armpb", + [10] = "armarad", + [11] = "armveil", + [12] = "armfus", + [13] = "armgmm", + [14] = "armhavp", + [15] = "armlab", + [16] = "armsd", + [17] = "armmakr", + [18] = "armestor", + [19] = "armmstor", + [20] = "armageo", + [21] = "armckfus", + [22] = "armdl", + [23] = "armdf", + [24] = "armvp", + [25] = "armsy", + [26] = "armap", + [27] = "armavp", + [28] = "armasy", + [29] = "armhasy", + [30] = "armtl", + [31] = "armason", + [32] = "armdrag", + [33] = "armfdrag", + [34] = "armuwmme", + [35] = "armguard", + [36] = "armnanotc", + [37] = "armamd", + } + elseif name == "corch" then + uDef.buildoptions = { + [1] = "coradvsol", + [2] = "cormoho", + [3] = "corvipe", + [4] = "corhllt", + [5] = "corpun", + [6] = "cormadsam", + [7] = "corerad", + [8] = "corjuno", + [9] = "corfus", + [10] = "corarad", + [11] = "corshroud", + [12] = "corsd", + [13] = "corvp", + [14] = "corhavp", + [15] = "coravp", + [16] = "cormakr", + [17] = "corestor", + [18] = "cormstor", + [19] = "corageo", + [20] = "cordl", + [21] = "coruwmme", + [22] = "cordrag", + [23] = "corfdrag", + [24] = "corason", + [25] = "corlab", + [26] = "corap", + [27] = "corsy", + [28] = "corasy", + [29] = "corhlt", + [30] = "cortl", + [31] = "corhasy", + [32] = "corpun", + [33] = "corfmd", + } + end + -- Seaplane Platforms removed, become T2 air labs. + -- T2 air labs have sea variants + -- Made by hover cons and enhanced ship cons + -- Enhanced ships given seaplanes instead of static AA + -- Tech Split Balance + if name == "corthud" then uDef.speed = 54 uDef.weapondefs.arm_ham.range = 300 uDef.weapondefs.arm_ham.predictboost = 0.8 @@ -1127,9 +1092,9 @@ local function techsplitTweaks(name, uDef) end if name == "armrock" then - uDef.health = 240 - uDef.speed = 48 - uDef.weapondefs.arm_bot_rocket.reloadtime = 5.4 + uDef.health = 240 + uDef.speed = 48 + uDef.weapondefs.arm_bot_rocket.reloadtime = 5.4 uDef.weapondefs.arm_bot_rocket.range = 575 uDef.weapondefs.arm_bot_rocket.damage.default = 190 end @@ -1148,7 +1113,7 @@ local function techsplitTweaks(name, uDef) } end - if name == "armfhlt" then + if name == "armfhlt" then uDef.health = 7600 uDef.metalcost = 570 uDef.energycost = 7520 @@ -1176,7 +1141,7 @@ local function techsplitTweaks(name, uDef) } end - if name == "corfhlt" then + if name == "corfhlt" then uDef.health = 7340 uDef.metalcost = 580 uDef.energycost = 7520 @@ -1233,7 +1198,7 @@ local function techsplitTweaks(name, uDef) uDef.weapondefs.arm_artillery.hightrajectory = 1 uDef.weapondefs.arm_artillery.range = 1050 uDef.weapondefs.arm_artillery.reloadtime = 3.05 - uDef.weapondefs.arm_artillery.weaponvelocity = 500 + uDef.weapondefs.arm_artillery.weaponvelocity = 500 uDef.weapondefs.arm_artillery.damage = { default = 488, subs = 163, @@ -1359,41 +1324,41 @@ local function techsplitTweaks(name, uDef) uDef.speed = 69 uDef.turnrate = 500 uDef.weapondefs.banisher.areaofeffect = 180 - uDef.weapondefs.banisher.weaponvelocity = 864 + uDef.weapondefs.banisher.weaponvelocity = 864 uDef.weapondefs.banisher.range = 450 end if name == "armcroc" then - uDef.health = 5250 + uDef.health = 5250 uDef.turnrate = 270 uDef.weapondefs.arm_triton.reloadtime = 1.5 uDef.weapondefs.arm_triton.damage = { default = 250, subs = 111, - vtol = 44 + vtol = 44, } uDef.weapons[2] = { def = "", } end - --Tech Split Hotfixes 3 - - if name == "armhack" or name == "armhacv" or name == "armhaca" then - uDef.buildoptions[40] = "armnanotc" - end + --Tech Split Hotfixes 3 + + if name == "armhack" or name == "armhacv" or name == "armhaca" then + uDef.buildoptions[40] = "armnanotc" + end - if name == "armhacs" then - uDef.buildoptions[41] = "armnanotcplat" - end + if name == "armhacs" then + uDef.buildoptions[41] = "armnanotcplat" + end - if name == "corhack" or name == "corhacv" or name == "corhaca" then - uDef.buildoptions[40] = "cornanotc" - end + if name == "corhack" or name == "corhacv" or name == "corhaca" then + uDef.buildoptions[40] = "cornanotc" + end - if name == "corhacs" then - uDef.buildoptions[41] = "cornanotcplat" - end + if name == "corhacs" then + uDef.buildoptions[41] = "cornanotcplat" + end if name == "correap" then uDef.speed = 74 @@ -1413,7 +1378,7 @@ local function techsplitTweaks(name, uDef) uDef.weapondefs.arm_bull.damage = { default = 600, subs = 222, - vtol = 67 + vtol = 67, } uDef.weapondefs.arm_bull.reloadtime = 2 uDef.weapondefs.arm_bull.areaofeffect = 96 @@ -1423,13 +1388,13 @@ local function techsplitTweaks(name, uDef) uDef.weapondefs.corsumo_weapon.range = 750 uDef.weapondefs.corsumo_weapon.damage = { commanders = 350, - default = 700, + default = 700, vtol = 165, } uDef.weapondefs.corsumo_weapon.reloadtime = 1 end - if name == "corgol" then + if name == "corgol" then uDef.speed = 37 uDef.weapondefs.cor_gol.damage = { default = 1600, @@ -1440,7 +1405,7 @@ local function techsplitTweaks(name, uDef) uDef.weapondefs.cor_gol.range = 700 end - if name == "armguard" then + if name == "armguard" then uDef.health = 6000 uDef.metalcost = 800 uDef.energycost = 8000 @@ -1448,7 +1413,7 @@ local function techsplitTweaks(name, uDef) uDef.weapondefs.plasma.areaofeffect = 150 uDef.weapondefs.plasma.range = 1000 uDef.weapondefs.plasma.reloadtime = 2.3 - uDef.weapondefs.plasma.weaponvelocity = 550 + uDef.weapondefs.plasma.weaponvelocity = 550 uDef.weapondefs.plasma.damage = { default = 140, subs = 70, @@ -1492,395 +1457,386 @@ local function techsplitTweaks(name, uDef) } end - if name == "armpb" then - uDef.health = 3360 - uDef.weapondefs.armpb_weapon.range = 500 - uDef.weapondefs.armpb_weapon.reloadtime = 1.2 - end - - if name == "corvipe" then - uDef.health = 3600 - uDef.weapondefs.vipersabot.areaofeffect = 96 - uDef.weapondefs.vipersabot.edgeeffectiveness = 0.8 - uDef.weapondefs.vipersabot.range = 480 - uDef.weapondefs.vipersabot.reloadtime = 3 - end - - - - --- Legion Update + if name == "armpb" then + uDef.health = 3360 + uDef.weapondefs.armpb_weapon.range = 500 + uDef.weapondefs.armpb_weapon.reloadtime = 1.2 + end + if name == "corvipe" then + uDef.health = 3600 + uDef.weapondefs.vipersabot.areaofeffect = 96 + uDef.weapondefs.vipersabot.edgeeffectiveness = 0.8 + uDef.weapondefs.vipersabot.range = 480 + uDef.weapondefs.vipersabot.reloadtime = 3 + end + -- Legion Update + + --T2 labs + if name == "legalab" then + uDef.buildoptions = { + [1] = "legack", + [2] = "legadvaabot", + [3] = "legstr", + [4] = "legshot", + [5] = "leginfestor", + [6] = "legamph", + [7] = "legsnapper", + [8] = "legbart", + [9] = "leghrk", + [10] = "legaspy", + [11] = "legaradk", + } + end ---T2 labs -if name == "legalab" then - uDef.buildoptions = { - [1] = "legack", - [2] = "legadvaabot", - [3] = "legstr", - [4] = "legshot", - [5] = "leginfestor", - [6] = "legamph", - [7] = "legsnapper", - [8] = "legbart", - [9] = "leghrk", - [10] = "legaspy", - [11] = "legaradk", - } -end + if name == "legavp" then + uDef.buildoptions = { + [1] = "legacv", + [2] = "legch", + [3] = "legavrad", + [4] = "legsh", + [5] = "legmrv", + [6] = "legfloat", + [7] = "legaskirmtank", + [8] = "legamcluster", + [9] = "legvcarry", + [10] = "legner", + [11] = "legmh", + [12] = "legah", + } + end -if name == "legavp" then - uDef.buildoptions = { - [1] = "legacv", - [2] = "legch", - [3] = "legavrad", - [4] = "legsh", - [5] = "legmrv", - [6] = "legfloat", - [7] = "legaskirmtank", - [8] = "legamcluster", - [9] = "legvcarry", - [10] = "legner", - [11] = "legmh", - [12] = "legah" - } -end + -- Placeholder: Legion T2 air is cor seaplanes + if name == "legaap" then + uDef.buildoptions = { + [1] = "legaca", + [2] = "corhunt", + [3] = "corcut", + [4] = "corsb", + [5] = "corseap", + [6] = "corsfig", + [7] = "legatrans", + } + end --- Placeholder: Legion T2 air is cor seaplanes -if name == "legaap" then - uDef.buildoptions = { - [1] = "legaca", - [2] = "corhunt", - [3] = "corcut", - [4] = "corsb", - [5] = "corseap", - [6] = "corsfig", - [7] = "legatrans", - } -end + if name == "legap" then + uDef.buildoptions[7] = "" + end -if name == "legap" then - uDef.buildoptions[7] = "" -end + if name == "legaap" or name == "legasy" or name == "legalab" or name == "legavp" then + uDef.metalcost = uDef.metalcost - 1300 + uDef.energycost = uDef.energycost - 5000 + uDef.buildtime = math.ceil(uDef.buildtime * 0.015) * 100 + end -if name == "legaap" or name == "legasy" or name == "legalab" or name == "legavp" -then - uDef.metalcost = uDef.metalcost - 1300 - uDef.energycost = uDef.energycost - 5000 - uDef.buildtime = math.ceil(uDef.buildtime * 0.015) * 100 -end + if name == "legch" then + uDef.metalcost = uDef.metalcost * 2 + uDef.energycost = uDef.energycost * 2 + uDef.buildtime = uDef.buildtime * 2 + uDef.customparams.techlevel = 2 + end -if name == "legch" -then - uDef.metalcost = uDef.metalcost * 2 - uDef.energycost = uDef.energycost * 2 - uDef.buildtime = uDef.buildtime * 2 - uDef.customparams.techlevel = 2 -end + -- T1 Cons + + if name == "legck" then + uDef.buildoptions = { + [1] = "legsolar", + [2] = "legwin", + [3] = "leggeo", + [4] = "legmstor", + [5] = "legestor", + [6] = "legmex", + [7] = "legeconv", + [9] = "leglab", + [10] = "legalab", + [11] = "legvp", + [12] = "legap", + [13] = "legnanotc", + [14] = "legeyes", + [15] = "legrad", + [16] = "legdrag", + [17] = "leglht", + [18] = "legrl", + [19] = "legctl", + [20] = "legjam", + [21] = "corsy", + [22] = "legadvsol", + [23] = "legmext15", + [24] = "legcluster", + [25] = "legrhapsis", + [26] = "legmg", + [27] = "legdtr", + [28] = "leghive", + [29] = "legjuno", + } + end + if name == "legca" then + uDef.buildoptions = { + [1] = "legsolar", + [2] = "legwin", + [3] = "leggeo", + [4] = "legmstor", + [5] = "legestor", + [6] = "legmex", + [7] = "legeconv", + [9] = "leglab", + [10] = "legaap", + [11] = "legvp", + [12] = "legap", + [13] = "legnanotc", + [14] = "legeyes", + [15] = "legrad", + [16] = "legdrag", + [17] = "leglht", + [18] = "legrl", + [19] = "legctl", + [20] = "legjam", + [21] = "corsy", + [22] = "legadvsol", + [23] = "legmext15", + [24] = "legcluster", + [25] = "legrhapsis", + [26] = "legmg", + [27] = "legdtr", + [28] = "leghive", + [29] = "legjuno", + } + end --- T1 Cons - - -if name == "legck" then - uDef.buildoptions = { - [1] = "legsolar", - [2] = "legwin", - [3] = "leggeo", - [4] = "legmstor", - [5] = "legestor", - [6] = "legmex", - [7] = "legeconv", - [9] = "leglab", - [10] = "legalab", - [11] = "legvp", - [12] = "legap", - [13] = "legnanotc", - [14] = "legeyes", - [15] = "legrad", - [16] = "legdrag", - [17] = "leglht", - [18] = "legrl", - [19] = "legctl", - [20] = "legjam", - [21] = "corsy", - [22] = "legadvsol", - [23] = "legmext15", - [24] = "legcluster", - [25] = "legrhapsis", - [26] = "legmg", - [27] = "legdtr", - [28] = "leghive", - [29] = "legjuno", - } -end + if name == "legcv" then + uDef.buildoptions = { + [1] = "legsolar", + [2] = "legwin", + [3] = "leggeo", + [4] = "legmstor", + [5] = "legestor", + [6] = "legmex", + [7] = "legeconv", + [9] = "leglab", + [10] = "legavp", + [11] = "legvp", + [12] = "legap", + [13] = "legnanotc", + [14] = "legeyes", + [15] = "legrad", + [16] = "legdrag", + [17] = "leglht", + [18] = "legrl", + [19] = "legctl", + [20] = "legjam", + [21] = "corsy", + [22] = "legadvsol", + [23] = "legmext15", + [24] = "legcluster", + [25] = "legrhapsis", + [26] = "legmg", + [27] = "legdtr", + [28] = "leghive", + [29] = "legjuno", + } + end -if name == "legca" then - uDef.buildoptions = { - [1] = "legsolar", - [2] = "legwin", - [3] = "leggeo", - [4] = "legmstor", - [5] = "legestor", - [6] = "legmex", - [7] = "legeconv", - [9] = "leglab", - [10] = "legaap", - [11] = "legvp", - [12] = "legap", - [13] = "legnanotc", - [14] = "legeyes", - [15] = "legrad", - [16] = "legdrag", - [17] = "leglht", - [18] = "legrl", - [19] = "legctl", - [20] = "legjam", - [21] = "corsy", - [22] = "legadvsol", - [23] = "legmext15", - [24] = "legcluster", - [25] = "legrhapsis", - [26] = "legmg", - [27] = "legdtr", - [28] = "leghive", - [29] = "legjuno", - } -end + if name == "legotter" then + uDef.buildoptions = { + [1] = "legsolar", + [2] = "legwin", + [3] = "leggeo", + [4] = "legmstor", + [5] = "legestor", + [6] = "legmex", + [7] = "legeconv", + [9] = "leglab", + [10] = "legavp", + [11] = "legvp", + [12] = "legap", + [13] = "legnanotc", + [14] = "legeyes", + [15] = "legrad", + [16] = "legdrag", + [17] = "leglht", + [18] = "legrl", + [19] = "legctl", + [20] = "legjam", + [21] = "corsy", + [22] = "legadvsol", + [23] = "legmext15", + [24] = "legcluster", + [25] = "legrhapsis", + [26] = "legmg", + [27] = "legdtr", + [28] = "leghive", + [29] = "legtide", + [30] = "legtl", + [31] = "legfrad", + [32] = "corasy", + [33] = "legjuno", + } + end + -------------------------- + -- Legion Air Placeholders + + if name == "legch" then + uDef.buildoptions = { + [1] = "legadvsol", + [2] = "legmoho", + [3] = "legapopupdef", + [4] = "legmg", + [5] = "legrhapsis", + [6] = "leglupara", + [7] = "legjuno", + [8] = "leghive", + [9] = "legfus", + [10] = "legarad", + [11] = "legajam", + [12] = "legsd", + [13] = "leglab", + [14] = "legavp", + [15] = "leghavp", + [16] = "legcluster", + [17] = "legeconv", + [18] = "legageo", + [19] = "legrampart", + [20] = "legmstor", + [21] = "legestor", + [22] = "legcluster", + [24] = "legmg", + [25] = "legctl", + [26] = "legvp", + [27] = "legap", + [28] = "corsy", + [29] = "legnanotc", + [30] = "coruwmme", + [31] = "legtl", + [32] = "corasy", + [33] = "legabm", + } + end -if name == "legcv" then - uDef.buildoptions = { - [1] = "legsolar", - [2] = "legwin", - [3] = "leggeo", - [4] = "legmstor", - [5] = "legestor", - [6] = "legmex", - [7] = "legeconv", - [9] = "leglab", - [10] = "legavp", - [11] = "legvp", - [12] = "legap", - [13] = "legnanotc", - [14] = "legeyes", - [15] = "legrad", - [16] = "legdrag", - [17] = "leglht", - [18] = "legrl", - [19] = "legctl", - [20] = "legjam", - [21] = "corsy", - [22] = "legadvsol", - [23] = "legmext15", - [24] = "legcluster", - [25] = "legrhapsis", - [26] = "legmg", - [27] = "legdtr", - [28] = "leghive", - [29] = "legjuno", - } -end + if name == "legacv" then + uDef.buildoptions = { + [1] = "legadvsol", + [2] = "legmoho", + [3] = "legapopupdef", + [4] = "legmg", + [5] = "legrhapsis", + [6] = "leglupara", + [7] = "legjuno", + [8] = "leghive", + [9] = "legfus", + [10] = "legarad", + [11] = "legajam", + [12] = "legsd", + [13] = "leglab", + [14] = "legavp", + [15] = "leghavp", + [16] = "legcluster", + [17] = "legeconv", + [18] = "legageo", + [19] = "legrampart", + [20] = "legmstor", + [21] = "legestor", + [22] = "legcluster", + [24] = "legmg", + [25] = "legdl", + [26] = "legvp", + [27] = "legap", + [28] = "corsy", + [29] = "legnanotc", + [30] = "legabm", + [31] = "legctl", + } + end -if name == "legotter" then - uDef.buildoptions = { - [1] = "legsolar", - [2] = "legwin", - [3] = "leggeo", - [4] = "legmstor", - [5] = "legestor", - [6] = "legmex", - [7] = "legeconv", - [9] = "leglab", - [10] = "legavp", - [11] = "legvp", - [12] = "legap", - [13] = "legnanotc", - [14] = "legeyes", - [15] = "legrad", - [16] = "legdrag", - [17] = "leglht", - [18] = "legrl", - [19] = "legctl", - [20] = "legjam", - [21] = "corsy", - [22] = "legadvsol", - [23] = "legmext15", - [24] = "legcluster", - [25] = "legrhapsis", - [26] = "legmg", - [27] = "legdtr", - [28] = "leghive", - [29] = "legtide", - [30] = "legtl", - [31] = "legfrad", - [32] = "corasy", - [33] = "legjuno", - } -end --------------------------- --- Legion Air Placeholders - -if name == "legch" then - uDef.buildoptions = { - [1] = "legadvsol", - [2] = "legmoho", - [3] = "legapopupdef", - [4] = "legmg", - [5] = "legrhapsis", - [6] = "leglupara", - [7] = "legjuno", - [8] = "leghive", - [9] = "legfus", - [10] = "legarad", - [11] = "legajam", - [12] = "legsd", - [13] = "leglab", - [14] = "legavp", - [15] = "leghavp", - [16] = "legcluster", - [17] = "legeconv", - [18] = "legageo", - [19] = "legrampart", - [20] = "legmstor", - [21] = "legestor", - [22] = "legcluster", - [24] = "legmg", - [25] = "legctl", - [26] = "legvp", - [27] = "legap", - [28] = "corsy", - [29] = "legnanotc", - [30] = "coruwmme", - [31] = "legtl", - [32] = "corasy", - [33] = "legabm", - } -end + if name == "legack" then + uDef.buildoptions = { + [1] = "legadvsol", + [2] = "legmoho", + [3] = "legapopupdef", + [4] = "legmg", + [5] = "legrhapsis", + [6] = "leglupara", + [7] = "legjuno", + [8] = "leghive", + [9] = "legfus", + [10] = "legarad", + [11] = "legajam", + [12] = "legsd", + [13] = "leglab", + [14] = "legalab", + [15] = "leghalab", + [16] = "legcluster", + [17] = "legeconv", + [18] = "legageo", + [19] = "legrampart", + [20] = "legmstor", + [21] = "legestor", + [22] = "legcluster", + [24] = "legmg", + [25] = "legdl", + [26] = "legvp", + [27] = "legap", + [28] = "corsy", + [29] = "legnanotc", + [30] = "legabm", + [31] = "legctl", + } + end -if name == "legacv" then - uDef.buildoptions = { - [1] = "legadvsol", - [2] = "legmoho", - [3] = "legapopupdef", - [4] = "legmg", - [5] = "legrhapsis", - [6] = "leglupara", - [7] = "legjuno", - [8] = "leghive", - [9] = "legfus", - [10] = "legarad", - [11] = "legajam", - [12] = "legsd", - [13] = "leglab", - [14] = "legavp", - [15] = "leghavp", - [16] = "legcluster", - [17] = "legeconv", - [18] = "legageo", - [19] = "legrampart", - [20] = "legmstor", - [21] = "legestor", - [22] = "legcluster", - [24] = "legmg", - [25] = "legdl", - [26] = "legvp", - [27] = "legap", - [28] = "corsy", - [29] = "legnanotc", - [30] = "legabm", - [31] = "legctl", - } -end + if name == "legaca" then + uDef.buildpic = "CORCSA.DDS" + uDef.objectname = "Units/CORCSA.s3o" + uDef.script = "Units/CORCSA.cob" + uDef.buildoptions = { + [1] = "legadvsol", + [2] = "legmoho", + [3] = "legapopupdef", + [4] = "legmg", + [5] = "legrhapsis", + [6] = "leglupara", + [7] = "legjuno", + [8] = "leghive", + [9] = "legfus", + [10] = "legarad", + [11] = "legajam", + [12] = "legsd", + [13] = "leglab", + [14] = "legaap", + [15] = "leghaap", + [16] = "legcluster", + [17] = "legeconv", + [18] = "legageo", + [19] = "legrampart", + [20] = "legmstor", + [21] = "legestor", + [22] = "legcluster", + [24] = "legmg", + [25] = "legdl", + [26] = "legvp", + [27] = "legap", + [28] = "corsy", + [29] = "legnanotc", + [30] = "legabm", + [31] = "legctl", + } + end -if name == "legack" then - uDef.buildoptions = { - [1] = "legadvsol", - [2] = "legmoho", - [3] = "legapopupdef", - [4] = "legmg", - [5] = "legrhapsis", - [6] = "leglupara", - [7] = "legjuno", - [8] = "leghive", - [9] = "legfus", - [10] = "legarad", - [11] = "legajam", - [12] = "legsd", - [13] = "leglab", - [14] = "legalab", - [15] = "leghalab", - [16] = "legcluster", - [17] = "legeconv", - [18] = "legageo", - [19] = "legrampart", - [20] = "legmstor", - [21] = "legestor", - [22] = "legcluster", - [24] = "legmg", - [25] = "legdl", - [26] = "legvp", - [27] = "legap", - [28] = "corsy", - [29] = "legnanotc", - [30] = "legabm", - [31] = "legctl", - } -end + -- Legion Unit Tweaks -if name == "legaca" then - uDef.buildpic = "CORCSA.DDS" - uDef.objectname = "Units/CORCSA.s3o" - uDef.script = "Units/CORCSA.cob" - uDef.buildoptions = { - [1] = "legadvsol", - [2] = "legmoho", - [3] = "legapopupdef", - [4] = "legmg", - [5] = "legrhapsis", - [6] = "leglupara", - [7] = "legjuno", - [8] = "leghive", - [9] = "legfus", - [10] = "legarad", - [11] = "legajam", - [12] = "legsd", - [13] = "leglab", - [14] = "legaap", - [15] = "leghaap", - [16] = "legcluster", - [17] = "legeconv", - [18] = "legageo", - [19] = "legrampart", - [20] = "legmstor", - [21] = "legestor", - [22] = "legcluster", - [24] = "legmg", - [25] = "legdl", - [26] = "legvp", - [27] = "legap", - [28] = "corsy", - [29] = "legnanotc", - [30] = "legabm", - [31] = "legctl", - } -end - --- Legion Unit Tweaks - -if name == "legapopupdef" then - uDef.weapondefs.advanced_riot_cannon.range = 480 - uDef.weapondefs.advanced_riot_cannon.reloadtime = 1.5 - uDef.weapondefs.standard_minigun.range = 400 -end + if name == "legapopupdef" then + uDef.weapondefs.advanced_riot_cannon.range = 480 + uDef.weapondefs.advanced_riot_cannon.reloadtime = 1.5 + uDef.weapondefs.standard_minigun.range = 400 + end -if name == "legmg" then - uDef.weapondefs.armmg_weapon.range = 650 -end + if name == "legmg" then + uDef.weapondefs.armmg_weapon.range = 650 + end - return uDef + return uDef end return { - techsplitTweaks = techsplitTweaks, -} \ No newline at end of file + techsplitTweaks = techsplitTweaks, +} diff --git a/units/ArmBuildings/LandDefenceOffence/armclaw.lua b/units/ArmBuildings/LandDefenceOffence/armclaw.lua index 30f13fe6dc3..89044c9c939 100644 --- a/units/ArmBuildings/LandDefenceOffence/armclaw.lua +++ b/units/ArmBuildings/LandDefenceOffence/armclaw.lua @@ -120,7 +120,7 @@ return { cratermult = 0, duration = 1, edgeeffectiveness = 0.15, - energypershot = 10, + energypershot = 10, explosiongenerator = "custom:genericshellexplosion-medium-lightning2", firestarter = 50, impactonly = 1, diff --git a/units/ArmBuildings/SeaDefence/armanavaldefturret.lua b/units/ArmBuildings/SeaDefence/armanavaldefturret.lua index 8eea22f024b..10ec8d64e6e 100644 --- a/units/ArmBuildings/SeaDefence/armanavaldefturret.lua +++ b/units/ArmBuildings/SeaDefence/armanavaldefturret.lua @@ -29,7 +29,7 @@ return { waterline = 0, yardmap = "wwwwww wwwwww wwwwww wwwwww wwwwww wwwwww", customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/arm_normal.dds", removewait = true, diff --git a/units/ArmShips/T2/armdronecarry.lua b/units/ArmShips/T2/armdronecarry.lua index 56df19d46dc..260f676d811 100644 --- a/units/ArmShips/T2/armdronecarry.lua +++ b/units/ArmShips/T2/armdronecarry.lua @@ -140,26 +140,26 @@ return { default = 0, }, customparams = { - carried_unit = "armdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "armdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1350, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 4, --Spawnrate roughly in seconds. - maxunits = 16, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 4, --Spawnrate roughly in seconds. + maxunits = 16, --Will spawn units until this amount has been reached. startingdronecount = 8, - energycost = 600, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 25, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 600, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 25, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 6, - attackformationspread = 120,--Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 120, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 24, docktohealthreshold = 65, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 16, stockpilemetal = 25, stockpileenergy = 600, @@ -167,7 +167,7 @@ return { dronedocktime = 2, droneairtime = 60, droneammo = 9, - } + }, }, aamissile = { areaofeffect = 48, diff --git a/units/ArmShips/T2/armtrident.lua b/units/ArmShips/T2/armtrident.lua index 6e126a7e1ac..9a6fe76a97a 100644 --- a/units/ArmShips/T2/armtrident.lua +++ b/units/ArmShips/T2/armtrident.lua @@ -119,7 +119,7 @@ return { craterboost = 0, cratermult = 0, edgeeffectiveness = 0.15, - explosiongenerator = "",--"custom:genericshellexplosion-medium", + explosiongenerator = "", --"custom:genericshellexplosion-medium", gravityaffected = "true", hightrajectory = 1, impulsefactor = 0.123, @@ -130,9 +130,9 @@ return { range = 1300, reloadtime = 2.5, size = 0, - soundhit = "",--"xplomed2", - soundhitwet = "",--"splssml", - soundstart = "",--"cannhvy1", + soundhit = "", --"xplomed2", + soundhitwet = "", --"splssml", + soundstart = "", --"cannhvy1", stockpile = true, stockpiletime = 5, turret = true, @@ -143,27 +143,27 @@ return { default = 0, }, customparams = { - carried_unit = "armtdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "armtdrone", --Name of the unit spawned by this carrier unit. -- carried_unit2... Currently not implemented, but planned. engagementrange = 1300, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 5, --Spawnrate roughly in seconds. - maxunits = 4, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 5, --Spawnrate roughly in seconds. + maxunits = 4, --Will spawn units until this amount has been reached. startingdronecount = 2, - buildcostenergy = 750,--650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - buildcostmetal = 30,--29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1400, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + buildcostenergy = 750, --650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + buildcostmetal = 30, --29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1400, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 3, - attackformationspread = 120, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 120, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 36, docktohealthreshold = 50, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "10 11 12 13 14", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 4, stockpilemetal = 30, stockpileenergy = 750, @@ -171,10 +171,9 @@ return { dronedocktime = 2, droneairtime = 60, droneammo = 3, - } + }, }, - - + trident_depthcharge = { avoidfeature = false, avoidfriendly = false, @@ -213,7 +212,8 @@ return { default = 255, -- subs = 300, }, - }, }, + }, + }, weapons = { [1] = { def = "PLASMA", diff --git a/units/CorAircraft/T2/corcrwh.lua b/units/CorAircraft/T2/corcrwh.lua index 1b55b36c3d8..bab0ae4d407 100644 --- a/units/CorAircraft/T2/corcrwh.lua +++ b/units/CorAircraft/T2/corcrwh.lua @@ -43,8 +43,7 @@ return { unitgroup = "weapon", }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", diff --git a/units/CorBuildings/LandDefenceOffence/cormaw.lua b/units/CorBuildings/LandDefenceOffence/cormaw.lua index 5d71ff75aa8..4e9b514edcf 100644 --- a/units/CorBuildings/LandDefenceOffence/cormaw.lua +++ b/units/CorBuildings/LandDefenceOffence/cormaw.lua @@ -80,8 +80,7 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", diff --git a/units/CorShips/T2/cordronecarry.lua b/units/CorShips/T2/cordronecarry.lua index e43eeaadaee..4b8117accd7 100644 --- a/units/CorShips/T2/cordronecarry.lua +++ b/units/CorShips/T2/cordronecarry.lua @@ -140,33 +140,33 @@ return { default = 0, }, customparams = { - carried_unit = "cordrone", --Name of the unit spawned by this carrier unit. + carried_unit = "cordrone", --Name of the unit spawned by this carrier unit. engagementrange = 1350, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 6, --Spawnrate roughly in seconds. - maxunits = 10, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 6, --Spawnrate roughly in seconds. + maxunits = 10, --Will spawn units until this amount has been reached. startingdronecount = 5, - energycost = 750, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 30, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 750, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 30, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 9, - attackformationspread = 200,--Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 200, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 36, docktohealthreshold = 55, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "9 10 11 12 13 14 15 16 17 18 19", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 10, stockpilemetal = 30, stockpileenergy = 750, dronesusestockpile = true, dronedocktime = 2, droneairtime = 30, - } + }, }, aamissile = { areaofeffect = 48, diff --git a/units/CorShips/T2/corsentinel.lua b/units/CorShips/T2/corsentinel.lua index aff2bc38c02..48842cb78bc 100644 --- a/units/CorShips/T2/corsentinel.lua +++ b/units/CorShips/T2/corsentinel.lua @@ -120,7 +120,7 @@ return { craterboost = 0, cratermult = 0, edgeeffectiveness = 0.15, - explosiongenerator = "",--"custom:genericshellexplosion-medium", + explosiongenerator = "", --"custom:genericshellexplosion-medium", gravityaffected = "true", hightrajectory = 1, impulsefactor = 0.123, @@ -131,9 +131,9 @@ return { range = 1300, reloadtime = 2.5, size = 0, - soundhit = "",--"xplomed2", - soundhitwet = "",--"splssml", - soundstart = "",--"cannhvy1", + soundhit = "", --"xplomed2", + soundhitwet = "", --"splssml", + soundstart = "", --"cannhvy1", stockpile = true, stockpiletime = 6, turret = true, @@ -144,27 +144,27 @@ return { default = 0, }, customparams = { - carried_unit = "cortdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "cortdrone", --Name of the unit spawned by this carrier unit. -- carried_unit2... Currently not implemented, but planned. engagementrange = 1300, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 6, --Spawnrate roughly in seconds. - maxunits = 5, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 6, --Spawnrate roughly in seconds. + maxunits = 5, --Will spawn units until this amount has been reached. startingdronecount = 2, - buildcostenergy = 1000,--650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - buildcostmetal = 40,--29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1400, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + buildcostenergy = 1000, --650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + buildcostmetal = 40, --29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1400, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 2, - attackformationspread = 200, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 200, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 54, docktohealthreshold = 50, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "4 5 6 7 8 9 10", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 5, stockpilemetal = 40, stockpileenergy = 1000, @@ -172,9 +172,9 @@ return { dronedocktime = 2, droneairtime = 60, droneammo = 3, - } + }, }, - + sentinel_depthcharge = { avoidfeature = false, avoidfriendly = false, @@ -213,8 +213,7 @@ return { default = 255, -- subs = 300, }, - }, - + }, }, weapons = { [1] = { diff --git a/units/CorVehicles/T2/corsiegebreaker.lua b/units/CorVehicles/T2/corsiegebreaker.lua index 2e61e1f28af..8709796425f 100644 --- a/units/CorVehicles/T2/corsiegebreaker.lua +++ b/units/CorVehicles/T2/corsiegebreaker.lua @@ -26,7 +26,7 @@ return { script = "Units/corsiegebreaker.cob", seismicsignature = 0, selfdestructas = "mediumExplosionGenericSelfd-phib", - sightdistance = 500,--500 + sightdistance = 500, --500 trackoffset = -6, trackstrength = 10, tracktype = "corparrowtracks", @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1.21, turnrate = 250, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", cannon1name = "gun", driftratio = "0.25", @@ -164,15 +164,14 @@ return { weaponvelocity = 1250, damage = { commanders = 1500, - default = 4000,--76 + default = 4000, --76 }, --customparams = { - --sweepfire=3.25,--multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs + --sweepfire=3.25,--multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs --} }, - - dreadshot = {--silent version + dreadshot = { --silent version areaofeffect = 60, avoidfeature = false, avoidfriendly = true, @@ -216,9 +215,7 @@ return { commanders = 25, default = 76, }, - }, - }, weapons = { [1] = { @@ -232,14 +229,14 @@ return { weaponAimAdjustPriority = 125, }, --[2] = {--not used directly, silent version for animation reasons - --badtargetcategory = "VTOL GROUNDSCOUT", - --def = "dreadshot", - --maindir = "0 0 1", - --maxangledif = 50, - --onlytargetcategory = "SURFACE", - --fastautoretargeting = true, - --burstControlWhenOutOfArc = 2, - --weaponAimAdjustPriority = 125, + --badtargetcategory = "VTOL GROUNDSCOUT", + --def = "dreadshot", + --maindir = "0 0 1", + --maxangledif = 50, + --onlytargetcategory = "SURFACE", + --fastautoretargeting = true, + --burstControlWhenOutOfArc = 2, + --weaponAimAdjustPriority = 125, --}, }, }, diff --git a/units/Legion/Air/T2 Air/legafigdef.lua b/units/Legion/Air/T2 Air/legafigdef.lua index d6f789e171d..2aadf4109be 100644 --- a/units/Legion/Air/T2 Air/legafigdef.lua +++ b/units/Legion/Air/T2 Air/legafigdef.lua @@ -15,7 +15,7 @@ return { explodeas = "smallExplosionGenericAir", footprintx = 2, footprintz = 2, - maxacc= 0.4, + maxacc = 0.4, maxaileron = 0.016, maxbank = 0.72, health = 480, @@ -39,7 +39,7 @@ return { wingangle = 0.06363, wingdrag = 0.21, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Air/T2 Air", @@ -50,7 +50,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:barrelshot-medium-aa", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", @@ -115,7 +116,7 @@ return { weapontype = "LaserCannon", weaponvelocity = 2500, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, damage = { commanders = 1, @@ -123,7 +124,6 @@ return { vtol = 80, }, }, - }, weapons = { [1] = { diff --git a/units/Legion/Air/T2 Air/legfort.lua b/units/Legion/Air/T2 Air/legfort.lua index 62df3dd4ab4..7b650fa7c6b 100644 --- a/units/Legion/Air/T2 Air/legfort.lua +++ b/units/Legion/Air/T2 Air/legfort.lua @@ -35,7 +35,7 @@ return { turnrate = 240, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "tHARSIS", normaltex = "unittextures/LEG_normal.dds", subfolder = "CorAircraft/T2", @@ -44,7 +44,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:barrelshot-small", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", @@ -129,7 +130,7 @@ return { weapontype = "Cannon", weaponvelocity = 400, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, damage = { default = 166, diff --git a/units/Legion/Air/T2 Air/legheavydrone.lua b/units/Legion/Air/T2 Air/legheavydrone.lua index c702b5d7e03..611e1a4f0c7 100644 --- a/units/Legion/Air/T2 Air/legheavydrone.lua +++ b/units/Legion/Air/T2 Air/legheavydrone.lua @@ -99,7 +99,7 @@ return { vtol = 2, }, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, }, }, diff --git a/units/Legion/Air/T2 Air/legheavydronesmall.lua b/units/Legion/Air/T2 Air/legheavydronesmall.lua index 8335db5b838..9e31249a4d2 100644 --- a/units/Legion/Air/T2 Air/legheavydronesmall.lua +++ b/units/Legion/Air/T2 Air/legheavydronesmall.lua @@ -99,7 +99,7 @@ return { vtol = 2, }, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, }, }, diff --git a/units/Legion/Air/T2 Air/legionnaire.lua b/units/Legion/Air/T2 Air/legionnaire.lua index 0d6d12b2886..f32844fb0d6 100644 --- a/units/Legion/Air/T2 Air/legionnaire.lua +++ b/units/Legion/Air/T2 Air/legionnaire.lua @@ -1,6 +1,6 @@ return { legionnaire = { - maxacc= 0.35, + maxacc = 0.35, airsightdistance = 1100, blocking = false, maxdec = 0.0875, @@ -15,7 +15,7 @@ return { explodeas = "smallExplosionGenericAir", footprintx = 2, footprintz = 2, - maxacc= 0.4, + maxacc = 0.4, maxaileron = 0.016, maxbank = 0.72, health = 480, @@ -39,7 +39,7 @@ return { wingangle = 0.06363, wingdrag = 0.21, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "Hornet", normaltex = "unittextures/cor_normal.dds", subfolder = "CorAircraft/T2", @@ -113,10 +113,9 @@ return { vtol = 80, }, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, }, - }, weapons = { [1] = { diff --git a/units/Legion/Air/T2 Air/legmineb.lua b/units/Legion/Air/T2 Air/legmineb.lua index e5348d37dcf..3982ef685ea 100644 --- a/units/Legion/Air/T2 Air/legmineb.lua +++ b/units/Legion/Air/T2 Air/legmineb.lua @@ -37,7 +37,7 @@ return { wingangle = 0.06222, wingdrag = 0.125, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Air/T2 Air", diff --git a/units/Legion/Air/T2 Air/legnap.lua b/units/Legion/Air/T2 Air/legnap.lua index fdeb647fa9e..98c301196be 100644 --- a/units/Legion/Air/T2 Air/legnap.lua +++ b/units/Legion/Air/T2 Air/legnap.lua @@ -38,7 +38,7 @@ return { wingangle = 0.06148, wingdrag = 0.125, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/Arm_normal.dds", subfolder = "CorAircraft/T2", diff --git a/units/Legion/Air/T2 Air/legphoenix.lua b/units/Legion/Air/T2 Air/legphoenix.lua index 8ceb89c4467..7ed6a4b7a4e 100644 --- a/units/Legion/Air/T2 Air/legphoenix.lua +++ b/units/Legion/Air/T2 Air/legphoenix.lua @@ -1,6 +1,6 @@ return { legphoenix = { - maxacc= 0.05, + maxacc = 0.05, blocking = false, maxdec = 0.025, energycost = 25000, @@ -38,7 +38,7 @@ return { wingangle = 0.06148, wingdrag = 0.125, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Protar/Hornet", normaltex = "unittextures/leg_normal.dds", subfolder = "Legionaircraft/T2", @@ -71,8 +71,8 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, }, + explosiongenerators = {}, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", @@ -117,7 +117,7 @@ return { noselfdamage = true, predictboost = 1, proximitypriority = -1, - range = 950,--this is VERTICAL, not lateral + range = 950, --this is VERTICAL, not lateral reloadtime = 8, rgbcolor = "1 0.5 0", rgbcolor2 = "0.9 1.0 0.5", @@ -136,10 +136,10 @@ return { vtol = 5, }, customparams = { - sweepfire=7, --multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs - } + sweepfire = 7, --multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs + }, }, - legphtarg = {--targetting only + legphtarg = { --targetting only areaofeffect = 121, avoidfeature = false, burst = 5, diff --git a/units/Legion/Air/T2 Air/legstronghold.lua b/units/Legion/Air/T2 Air/legstronghold.lua index 4252ab8c042..19ecdb38fd8 100644 --- a/units/Legion/Air/T2 Air/legstronghold.lua +++ b/units/Legion/Air/T2 Air/legstronghold.lua @@ -47,7 +47,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:barrelshot-small", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", diff --git a/units/Legion/Air/T2 Air/legvenator.lua b/units/Legion/Air/T2 Air/legvenator.lua index a6f45b56812..ce3f3522255 100644 --- a/units/Legion/Air/T2 Air/legvenator.lua +++ b/units/Legion/Air/T2 Air/legvenator.lua @@ -1,6 +1,6 @@ return { legvenator = { - maxacc= 0.6, + maxacc = 0.6, airsightdistance = 1100, blocking = false, maxdec = 0.0675, @@ -38,7 +38,7 @@ return { wingangle = 0.06363, wingdrag = 0.21, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Air/T2 Air", @@ -97,7 +97,7 @@ return { weapontype = "Cannon", weaponvelocity = 1600, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, }, damage = { commanders = 8, diff --git a/units/Legion/Air/T2 Air/legwhisper.lua b/units/Legion/Air/T2 Air/legwhisper.lua index d21e7718152..15ec74990a3 100644 --- a/units/Legion/Air/T2 Air/legwhisper.lua +++ b/units/Legion/Air/T2 Air/legwhisper.lua @@ -38,7 +38,7 @@ return { wingangle = 0.06241, wingdrag = 0.11, customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", selectable_as_combat_unit = true, @@ -48,7 +48,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:radarpulse_t2", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", diff --git a/units/Legion/Air/legcib.lua b/units/Legion/Air/legcib.lua index 997731b824b..936f4479d0f 100644 --- a/units/Legion/Air/legcib.lua +++ b/units/Legion/Air/legcib.lua @@ -39,7 +39,7 @@ return { wingangle = 0.06296, wingdrag = 0.08, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorAircraft", @@ -81,7 +81,7 @@ return { impulsefactor = 0, model = "epulse_mini.s3o", model = "legmediumrocket.s3o", - mygravity = 0.2, + mygravity = 0.2, name = "Anti radar/minefield/jammer magnetic impulse bomb", range = 450, reloadtime = 10, diff --git a/units/Legion/Air/legfig.lua b/units/Legion/Air/legfig.lua index a61d518d0c1..3c76ba5d2e7 100644 --- a/units/Legion/Air/legfig.lua +++ b/units/Legion/Air/legfig.lua @@ -39,7 +39,7 @@ return { wingangle = 0.06315, wingdrag = 0.185, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Air", diff --git a/units/Legion/Air/legkam.lua b/units/Legion/Air/legkam.lua index 245b274f331..bdb3cbd2f40 100644 --- a/units/Legion/Air/legkam.lua +++ b/units/Legion/Air/legkam.lua @@ -42,7 +42,7 @@ return { wingangle = 0.06296, wingdrag = 0.06, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Air", @@ -51,7 +51,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:genericunitexplosion-large", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", diff --git a/units/Legion/Air/legmos.lua b/units/Legion/Air/legmos.lua index 45fb76db10a..37aea05c90d 100644 --- a/units/Legion/Air/legmos.lua +++ b/units/Legion/Air/legmos.lua @@ -28,7 +28,7 @@ return { turninplaceanglelimit = 360, turnrate = 1400, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmAircraft", diff --git a/units/Legion/Bots/T2 Bots/legadvaabot.lua b/units/Legion/Bots/T2 Bots/legadvaabot.lua index f71511635d9..c00b40f65c5 100644 --- a/units/Legion/Bots/T2 Bots/legadvaabot.lua +++ b/units/Legion/Bots/T2 Bots/legadvaabot.lua @@ -99,7 +99,7 @@ return { leg_t2_microflak_mobile = { accuracy = 1000, areaofeffect = 35, - burst = 3, + burst = 3, burstrate = 0.066, avoidfeature = false, burnblow = true, diff --git a/units/Legion/Bots/T2 Bots/legamph.lua b/units/Legion/Bots/T2 Bots/legamph.lua index 705b1b7566f..14626e856a4 100644 --- a/units/Legion/Bots/T2 Bots/legamph.lua +++ b/units/Legion/Bots/T2 Bots/legamph.lua @@ -208,7 +208,7 @@ return { fastautoretargeting = true, burstControlWhenOutOfArc = 2, maxangledif = 180, - maindir = "0 0 1" + maindir = "0 0 1", }, [2] = { def = "COAX_DEPTHCHARGE", diff --git a/units/Legion/Bots/T2 Bots/legbart.lua b/units/Legion/Bots/T2 Bots/legbart.lua index 728af417f1e..a87a0319ddb 100644 --- a/units/Legion/Bots/T2 Bots/legbart.lua +++ b/units/Legion/Bots/T2 Bots/legbart.lua @@ -31,7 +31,7 @@ return { turnrate = 1263.84998, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies (Model), Phill-Art (Concept)", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Bots/T2 Bots", @@ -114,8 +114,8 @@ return { noselfdamage = true, projectiles = 2, range = 625, - tolerance = 5000; - firetolerance = 5000; + tolerance = 5000, + firetolerance = 5000, reloadtime = 4, rgbcolor = "1 0.25 0.1", size = 6, diff --git a/units/Legion/Bots/T2 Bots/legdecom.lua b/units/Legion/Bots/T2 Bots/legdecom.lua index d5292c34e0f..5f8d868f2a2 100644 --- a/units/Legion/Bots/T2 Bots/legdecom.lua +++ b/units/Legion/Bots/T2 Bots/legdecom.lua @@ -27,7 +27,7 @@ return { footprintx = 3, footprintz = 3, hidedamage = true, - holdsteady = true, + holdsteady = true, mass = 2700, -- same as legcom's default mass (= metalcost) health = 3700, maxslope = 20, @@ -40,7 +40,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcom.cob", seismicsignature = 0, selfdestructas = "decoycommanderSelfd", @@ -72,7 +72,7 @@ return { [16] = "legfeconv", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", decoyfor = "legcom", firestateoncloak = 0, model_author = "Tharsis", @@ -295,7 +295,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Bots/T2 Bots/leghrk.lua b/units/Legion/Bots/T2 Bots/leghrk.lua index 67e3e97e4d3..d1f1b3e6f37 100644 --- a/units/Legion/Bots/T2 Bots/leghrk.lua +++ b/units/Legion/Bots/T2 Bots/leghrk.lua @@ -4,7 +4,7 @@ return { buildtime = 12600, canmove = true, collisionvolumeoffsets = "0 -2 0", - collisionvolumescales = "40.0 40.0 46.0", + collisionvolumescales = "40.0 40.0 46.0", collisionvolumetype = "CylZ", corpse = "DEAD", energycost = 9000, diff --git a/units/Legion/Bots/T2 Bots/leginc.lua b/units/Legion/Bots/T2 Bots/leginc.lua index 089f88ddf36..8402157445d 100644 --- a/units/Legion/Bots/T2 Bots/leginc.lua +++ b/units/Legion/Bots/T2 Bots/leginc.lua @@ -32,7 +32,7 @@ return { turnrate = 120, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Protar, Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBots/T2", @@ -114,7 +114,7 @@ return { predictboost = 0, --proximitypriority = -1, range = 725, - reloadtime = .033, + reloadtime = 0.033, rgbcolor = "1 0.55 0", rgbcolor2 = "0.9 1.0 0.5", soundhitdry = "flamhit1", diff --git a/units/Legion/Bots/T2 Bots/leginfestor.lua b/units/Legion/Bots/T2 Bots/leginfestor.lua index da55091b80b..54272c42e9c 100644 --- a/units/Legion/Bots/T2 Bots/leginfestor.lua +++ b/units/Legion/Bots/T2 Bots/leginfestor.lua @@ -38,10 +38,10 @@ return { turnrate = 1214.40002, workertime = 100, buildoptions = { - [1] = "leginfestor" + [1] = "leginfestor", }, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Zath (model), Tuerk (animation)", normaltex = "unittextures/leg_normal.dds", paralyzemultiplier = 0.2, diff --git a/units/Legion/Bots/T2 Bots/legshot.lua b/units/Legion/Bots/T2 Bots/legshot.lua index b54ad644a10..b40104086aa 100644 --- a/units/Legion/Bots/T2 Bots/legshot.lua +++ b/units/Legion/Bots/T2 Bots/legshot.lua @@ -33,7 +33,7 @@ return { turnrate = 1316.75, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies (modeller), Protar (concept art)", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Bots/T2 Bots", diff --git a/units/Legion/Bots/T2 Bots/legsnapper.lua b/units/Legion/Bots/T2 Bots/legsnapper.lua index 1dac8f7b81c..3294a249d37 100644 --- a/units/Legion/Bots/T2 Bots/legsnapper.lua +++ b/units/Legion/Bots/T2 Bots/legsnapper.lua @@ -32,7 +32,7 @@ return { turninplacespeedlimit = 1.750, turnrate = 1650, customparams = { - unitgroup = 'explo', + unitgroup = "explo", model_author = "Hornet", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/bots/t2 bots", diff --git a/units/Legion/Bots/T2 Bots/legsrail.lua b/units/Legion/Bots/T2 Bots/legsrail.lua index 5b092d6f382..62e80b2e834 100644 --- a/units/Legion/Bots/T2 Bots/legsrail.lua +++ b/units/Legion/Bots/T2 Bots/legsrail.lua @@ -33,7 +33,7 @@ return { turnrate = 800, usepiececollisionvolumes = 1, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/gantry", diff --git a/units/Legion/Bots/T2 Bots/legstr.lua b/units/Legion/Bots/T2 Bots/legstr.lua index 38c1d1c4243..ecaa9dfd9fc 100644 --- a/units/Legion/Bots/T2 Bots/legstr.lua +++ b/units/Legion/Bots/T2 Bots/legstr.lua @@ -31,7 +31,7 @@ return { turnrate = 800, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmGantry", @@ -129,7 +129,7 @@ return { sprayangle = 1024, texture1 = "shot", texture2 = "empty", - thickness = 2.0; + thickness = 2.0, tolerance = 6000, turret = true, weapontype = "LaserCannon", diff --git a/units/Legion/Bots/legbal.lua b/units/Legion/Bots/legbal.lua index 1a865d577d1..caf61db6d25 100644 --- a/units/Legion/Bots/legbal.lua +++ b/units/Legion/Bots/legbal.lua @@ -31,7 +31,7 @@ return { turnrate = 1268.44995, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBots", diff --git a/units/Legion/Bots/legcen.lua b/units/Legion/Bots/legcen.lua index 157f396631f..f21a7bb803a 100644 --- a/units/Legion/Bots/legcen.lua +++ b/units/Legion/Bots/legcen.lua @@ -32,7 +32,7 @@ return { turnrate = 720, customparams = { firingceg = "barrelshot-tiny", - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmBots", diff --git a/units/Legion/Bots/leggob.lua b/units/Legion/Bots/leggob.lua index 8c8de4abbb7..67885c98924 100644 --- a/units/Legion/Bots/leggob.lua +++ b/units/Legion/Bots/leggob.lua @@ -31,7 +31,7 @@ return { turnrate = 1391.5, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Odin", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBots", diff --git a/units/Legion/Bots/legkark.lua b/units/Legion/Bots/legkark.lua index 7af21a6dd76..d1cbdf8aa0a 100644 --- a/units/Legion/Bots/legkark.lua +++ b/units/Legion/Bots/legkark.lua @@ -17,7 +17,7 @@ return { footprintz = 2, health = 1725, maxslope = 17, - mass = 210, -- Testing: this unit has resistance to impulse + mass = 210, -- Testing: this unit has resistance to impulse speed = 42.0, maxwaterdepth = 12, movementclass = "BOT2", @@ -33,7 +33,7 @@ return { turninplacespeedlimit = 0.99, turnrate = 900, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Bots", diff --git a/units/Legion/Bots/leglob.lua b/units/Legion/Bots/leglob.lua index 4e8873ad2b2..576f740df5e 100644 --- a/units/Legion/Bots/leglob.lua +++ b/units/Legion/Bots/leglob.lua @@ -33,7 +33,7 @@ return { turnrate = 1263.84998, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBots", diff --git a/units/Legion/Constructors/legaca.lua b/units/Legion/Constructors/legaca.lua index 8f631f22dde..99bff151e03 100644 --- a/units/Legion/Constructors/legaca.lua +++ b/units/Legion/Constructors/legaca.lua @@ -66,7 +66,7 @@ return { "leggant", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Constructors", diff --git a/units/Legion/Constructors/legaceb.lua b/units/Legion/Constructors/legaceb.lua index d9d172432bd..ce65db6be2d 100644 --- a/units/Legion/Constructors/legaceb.lua +++ b/units/Legion/Constructors/legaceb.lua @@ -57,7 +57,7 @@ return { "legamph", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/constructors", diff --git a/units/Legion/Constructors/legack.lua b/units/Legion/Constructors/legack.lua index ec41c557a9f..26ef1c50633 100644 --- a/units/Legion/Constructors/legack.lua +++ b/units/Legion/Constructors/legack.lua @@ -67,7 +67,7 @@ return { "legalab", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", area_mex_def = "legmoho", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", diff --git a/units/Legion/Constructors/legacv.lua b/units/Legion/Constructors/legacv.lua index 42b575b8b40..d29b9cbfbbb 100644 --- a/units/Legion/Constructors/legacv.lua +++ b/units/Legion/Constructors/legacv.lua @@ -70,7 +70,7 @@ return { "legavp", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Constructors", diff --git a/units/Legion/Constructors/legafcv.lua b/units/Legion/Constructors/legafcv.lua index 17da027c93c..31480a0b3a8 100644 --- a/units/Legion/Constructors/legafcv.lua +++ b/units/Legion/Constructors/legafcv.lua @@ -45,7 +45,7 @@ return { "legdrag", "legrad", "legmex", - "leglht" + "leglht", }, customparams = { model_author = "ZephyrSkies", diff --git a/units/Legion/Constructors/legca.lua b/units/Legion/Constructors/legca.lua index 6f82350893f..d33f777ec3d 100644 --- a/units/Legion/Constructors/legca.lua +++ b/units/Legion/Constructors/legca.lua @@ -67,7 +67,7 @@ return { "leghive", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorAircraft", diff --git a/units/Legion/Constructors/legch.lua b/units/Legion/Constructors/legch.lua index b8159a55f57..95851e4eed1 100644 --- a/units/Legion/Constructors/legch.lua +++ b/units/Legion/Constructors/legch.lua @@ -84,7 +84,7 @@ return { [46] = "legfhive", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "CorHovercraft", diff --git a/units/Legion/Constructors/legck.lua b/units/Legion/Constructors/legck.lua index 666805b6198..c15c039c2ee 100644 --- a/units/Legion/Constructors/legck.lua +++ b/units/Legion/Constructors/legck.lua @@ -68,7 +68,7 @@ return { "leghive", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mexT15_def = "legmext15", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", diff --git a/units/Legion/Constructors/legcv.lua b/units/Legion/Constructors/legcv.lua index 59acc8d611f..86d7ae24299 100644 --- a/units/Legion/Constructors/legcv.lua +++ b/units/Legion/Constructors/legcv.lua @@ -73,7 +73,7 @@ return { "leghive", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mexT15_def = "legmext15", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", diff --git a/units/Legion/Constructors/leghack.lua b/units/Legion/Constructors/leghack.lua index 2adef6057dd..107e79ae8ce 100644 --- a/units/Legion/Constructors/leghack.lua +++ b/units/Legion/Constructors/leghack.lua @@ -70,7 +70,7 @@ return { [34] = "legelrpcmech", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/constructors", diff --git a/units/Legion/Constructors/legnavyconship.lua b/units/Legion/Constructors/legnavyconship.lua index 2b28117b440..77d6e541c81 100644 --- a/units/Legion/Constructors/legnavyconship.lua +++ b/units/Legion/Constructors/legnavyconship.lua @@ -61,7 +61,7 @@ return { "legtl", "legfrl", "legfmg", - "legmext15", + "legmext15", "legfhive", }, customparams = { @@ -74,8 +74,8 @@ return { dead = { blocking = false, category = "corpses", - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "42 30 50", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "42 30 50", collisionvolumetype = "Box", damage = 1380, featuredead = "HEAP", diff --git a/units/Legion/Constructors/legotter.lua b/units/Legion/Constructors/legotter.lua index 449800b1f7d..b8d989c1a5d 100644 --- a/units/Legion/Constructors/legotter.lua +++ b/units/Legion/Constructors/legotter.lua @@ -86,7 +86,7 @@ return { "legfhive", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorVehicles", diff --git a/units/Legion/Defenses/legabm.lua b/units/Legion/Defenses/legabm.lua index 1c70ff33989..405141e8f97 100644 --- a/units/Legion/Defenses/legabm.lua +++ b/units/Legion/Defenses/legabm.lua @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'antinuke', + unitgroup = "antinuke", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", removestop = true, @@ -93,58 +93,58 @@ return { }, weapondefs = { fmd_rocket = { - areaofeffect = 420, - avoidfeature = false, - avoidfriendly = false, - burnblow = true, - cegtag = "antimissiletrail", - collideenemy = false, - collidefeature = false, - collidefriendly = false, - coverage = 2000, - craterareaofeffect = 420, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - energypershot = 7500, - explosiongenerator = "custom:antinuke", - firestarter = 100, - flighttime = 20, - impulsefactor = 0.123, - interceptor = 1, - metalpershot = 150, - model = "leghomingmissile.s3o", - name = "ICBM intercepting missile launcher", - noselfdamage = true, - range = 72000, - reloadtime = 2, - smoketrail = true, - smokePeriod = 10, - smoketime = 110, - smokesize = 27, - smokecolor = 0.70, - smokeTrailCastShadow = true, - soundhit = "xplomed4", - soundhitwet = "splslrg", - soundstart = "antinukelaunch", - stockpile = true, - stockpiletime = 90, - texture1 = "bluenovaexplo", - texture2 = "smoketrailbar", - texture3 = "null", - tolerance = 7000, - tracks = true, - turnrate = 10000, - weaponacceleration = 150, - weapontimer = 2.5, - weapontype = "StarburstLauncher", - weaponvelocity = 6000, - customparams = { - stockpilelimit = 20, - }, - damage = { - default = 1500, - }, + areaofeffect = 420, + avoidfeature = false, + avoidfriendly = false, + burnblow = true, + cegtag = "antimissiletrail", + collideenemy = false, + collidefeature = false, + collidefriendly = false, + coverage = 2000, + craterareaofeffect = 420, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + energypershot = 7500, + explosiongenerator = "custom:antinuke", + firestarter = 100, + flighttime = 20, + impulsefactor = 0.123, + interceptor = 1, + metalpershot = 150, + model = "leghomingmissile.s3o", + name = "ICBM intercepting missile launcher", + noselfdamage = true, + range = 72000, + reloadtime = 2, + smoketrail = true, + smokePeriod = 10, + smoketime = 110, + smokesize = 27, + smokecolor = 0.70, + smokeTrailCastShadow = true, + soundhit = "xplomed4", + soundhitwet = "splslrg", + soundstart = "antinukelaunch", + stockpile = true, + stockpiletime = 90, + texture1 = "bluenovaexplo", + texture2 = "smoketrailbar", + texture3 = "null", + tolerance = 7000, + tracks = true, + turnrate = 10000, + weaponacceleration = 150, + weapontimer = 2.5, + weapontype = "StarburstLauncher", + weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, + damage = { + default = 1500, + }, }, }, weapons = { diff --git a/units/Legion/Defenses/legacluster.lua b/units/Legion/Defenses/legacluster.lua index f36f04eb8a4..54efbbb8258 100644 --- a/units/Legion/Defenses/legacluster.lua +++ b/units/Legion/Defenses/legacluster.lua @@ -34,7 +34,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Defenses", @@ -124,7 +124,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 8, exclude_preaim = true, smart_priority = true, @@ -187,7 +187,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 8, exclude_preaim = true, smart_backup = true, @@ -228,7 +228,7 @@ return { smart_trajectory_checker = true, }, damage = { - default = 0 + default = 0, }, }, }, diff --git a/units/Legion/Defenses/legapopupdef.lua b/units/Legion/Defenses/legapopupdef.lua index 02a19d68f6f..71c2b93a176 100644 --- a/units/Legion/Defenses/legapopupdef.lua +++ b/units/Legion/Defenses/legapopupdef.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies (Model), Johnathan Crimson (Proposal)", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/legbastion.lua b/units/Legion/Defenses/legbastion.lua index 1f47d780145..dbfac40789d 100644 --- a/units/Legion/Defenses/legbastion.lua +++ b/units/Legion/Defenses/legbastion.lua @@ -1,6 +1,6 @@ return { legbastion = { - maxacc= 0, + maxacc = 0, activatewhenbuilt = true, maxdec = 0, buildangle = 4096, @@ -40,7 +40,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Gabs", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -148,7 +148,7 @@ return { badtargetcategory = "VTOL GROUNDSCOUT", def = "t2heatray", onlytargetcategory = "SURFACE", - } + }, }, }, } diff --git a/units/Legion/Defenses/legbombard.lua b/units/Legion/Defenses/legbombard.lua index f0e528f3d7b..7526376c889 100644 --- a/units/Legion/Defenses/legbombard.lua +++ b/units/Legion/Defenses/legbombard.lua @@ -31,7 +31,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Hornet", normaltex = "unittextures/cor_normal.dds", removewait = true, @@ -133,21 +133,20 @@ return { weapontype = "Cannon", weaponvelocity = 300, model = "legnade.s3o", - - + weaponacceleration = -0.3, weapontimer = 0.01, weapontype = "Cannon", - weaponvelocity = 700, + weaponvelocity = 700, startvelocity = 700, - + smoketrail = true, smokePeriod = 100, smoketime = 110, smokesize = 27, smokecolor = 0.70, - smokeTrailCastShadow = true, - + smokeTrailCastShadow = true, + cegtag = "missiletrail-grenadesmoke", areaofeffect = 124, avoidfeature = false, @@ -163,10 +162,10 @@ return { bouncerebound = 0.40, numbounce = 5, groundbounce = true, - collideenemy = true, + collideenemy = true, collidefeature = false, collideground = true, - collidefriendly = false, + collidefriendly = false, collidefirebase = false, collideneutral = false, flighttime = 2.05, @@ -175,7 +174,7 @@ return { waterbounce = true, predictboost = 0.8, customparams = { - noattackrangearc= 1, + noattackrangearc = 1, exclude_preaim = true, }, damage = { diff --git a/units/Legion/Defenses/legcluster.lua b/units/Legion/Defenses/legcluster.lua index 83819b8e731..241bea9dcde 100644 --- a/units/Legion/Defenses/legcluster.lua +++ b/units/Legion/Defenses/legcluster.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/LandDefenceOffence", @@ -121,7 +121,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 5, exclude_preaim = true, smart_priority = true, @@ -183,7 +183,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 5, exclude_preaim = true, smart_backup = true, diff --git a/units/Legion/Defenses/legdtr.lua b/units/Legion/Defenses/legdtr.lua index 037c3af88b1..5601dcb2fc3 100644 --- a/units/Legion/Defenses/legdtr.lua +++ b/units/Legion/Defenses/legdtr.lua @@ -43,7 +43,7 @@ return { removewait = true, selectionscalemult = 1, subfolder = "Legion/Defenses", - unitgroup = 'weapon', + unitgroup = "weapon", usebuildinggrounddecal = true, }, featuredefs = { diff --git a/units/Legion/Defenses/legflak.lua b/units/Legion/Defenses/legflak.lua index 49ea565f8c0..f9fc25e3983 100644 --- a/units/Legion/Defenses/legflak.lua +++ b/units/Legion/Defenses/legflak.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'aa', + unitgroup = "aa", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -102,7 +102,7 @@ return { leg_t2_microflak = { accuracy = 1000, areaofeffect = 44, - burst = 3, + burst = 3, burstrate = 0.02, avoidfeature = false, burnblow = true, @@ -152,4 +152,3 @@ return { }, }, } - diff --git a/units/Legion/Defenses/leghive.lua b/units/Legion/Defenses/leghive.lua index cee9b2e2e58..772c60c4363 100644 --- a/units/Legion/Defenses/leghive.lua +++ b/units/Legion/Defenses/leghive.lua @@ -35,7 +35,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Zephyr", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -131,24 +131,24 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1100, - spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 10, --Spawnrate roughly in seconds. - maxunits = 6, --Will spawn units until this amount has been reached. + spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 10, --Spawnrate roughly in seconds. + maxunits = 6, --Will spawn units until this amount has been reached. startingdronecount = 3, - energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1000, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1000, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 20, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 20, docktohealthreshold = 75, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "4 5 6 7 8 9", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 6, stockpilemetal = 15, stockpileenergy = 500, @@ -158,7 +158,7 @@ return { dronedocktime = 3, droneairtime = 60, droneammo = 12, - } + }, }, }, weapons = { diff --git a/units/Legion/Defenses/leglht.lua b/units/Legion/Defenses/leglht.lua index 6a54cf49ea0..4f68a76f490 100644 --- a/units/Legion/Defenses/leglht.lua +++ b/units/Legion/Defenses/leglht.lua @@ -17,7 +17,7 @@ return { footprintx = 2, footprintz = 2, mass = 5100, - health = 550,--650 + health = 550, --650 maxslope = 10, maxwaterdepth = 0, nochasecategory = "MOBILE", @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", cannon1name = "barrel", driftratio = "0.6", @@ -137,8 +137,8 @@ return { vtol = 25, }, customparams = { - exclude_preaim = true - } + exclude_preaim = true, + }, }, }, weapons = { diff --git a/units/Legion/Defenses/leglraa.lua b/units/Legion/Defenses/leglraa.lua index 00809ef6a02..bd93a7aec0b 100644 --- a/units/Legion/Defenses/leglraa.lua +++ b/units/Legion/Defenses/leglraa.lua @@ -31,7 +31,7 @@ return { buildinggrounddecalsizey = 7, buildinggrounddecalsizex = 7, buildinggrounddecaldecayspeed = 30, - unitgroup = 'aa', + unitgroup = "aa", model_author = "Mr Bob", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/leglrpc.lua b/units/Legion/Defenses/leglrpc.lua index f54f3be8b60..f94ae49b2e4 100644 --- a/units/Legion/Defenses/leglrpc.lua +++ b/units/Legion/Defenses/leglrpc.lua @@ -31,7 +31,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", restrictions_inclusion = "_nolrpc_", canareaattack = 1, model_author = "ZephyrSkies", @@ -132,7 +132,7 @@ return { weapontype = "Cannon", weaponvelocity = 1100, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 6, }, damage = { diff --git a/units/Legion/Defenses/leglupara.lua b/units/Legion/Defenses/leglupara.lua index fb9af4f6448..ea6fefc1902 100644 --- a/units/Legion/Defenses/leglupara.lua +++ b/units/Legion/Defenses/leglupara.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -153,4 +153,3 @@ return { }, }, } - diff --git a/units/Legion/Defenses/legmg.lua b/units/Legion/Defenses/legmg.lua index 212944ed5f0..f40bc86177d 100644 --- a/units/Legion/Defenses/legmg.lua +++ b/units/Legion/Defenses/legmg.lua @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weaponaa', + unitgroup = "weaponaa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/legperdition.lua b/units/Legion/Defenses/legperdition.lua index 47267822110..8a3731cf084 100644 --- a/units/Legion/Defenses/legperdition.lua +++ b/units/Legion/Defenses/legperdition.lua @@ -34,7 +34,7 @@ return { selectionscalemult = 1, subfolder = "CorBuildings/LandDefenceOffence", techlevel = 2, - unitgroup = 'weapon', + unitgroup = "weapon", restrictions_inclusion = "_notacnukes_", usebuildinggrounddecal = true, }, diff --git a/units/Legion/Defenses/legrhapsis.lua b/units/Legion/Defenses/legrhapsis.lua index 939050226ef..475b4c92cb2 100644 --- a/units/Legion/Defenses/legrhapsis.lua +++ b/units/Legion/Defenses/legrhapsis.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/legrl.lua b/units/Legion/Defenses/legrl.lua index 2603cb7d34e..0964494816c 100644 --- a/units/Legion/Defenses/legrl.lua +++ b/units/Legion/Defenses/legrl.lua @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/legsilo.lua b/units/Legion/Defenses/legsilo.lua index 2fc241419a7..e36474212bb 100644 --- a/units/Legion/Defenses/legsilo.lua +++ b/units/Legion/Defenses/legsilo.lua @@ -30,7 +30,7 @@ return { buildinggrounddecalsizey = 10, buildinggrounddecalsizex = 10, buildinggrounddecaldecayspeed = 30, - unitgroup = 'nuke', + unitgroup = "nuke", model_author = "Tharsy", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/Defenses/legstarfall.lua b/units/Legion/Defenses/legstarfall.lua index a8c4e97e875..5a7b42804c0 100644 --- a/units/Legion/Defenses/legstarfall.lua +++ b/units/Legion/Defenses/legstarfall.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", restrictions_inclusion = "_nolrpc_noendgamelrpc_", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", @@ -189,12 +189,12 @@ return { --engine bug? burstControlWhenOutOfArc = 1, maindir = "0 0 1", - --maxangledif = 10, + --maxangledif = 10, }, [2] = { def = "energycharger", onlytargetcategory = "SURFACE", - } + }, }, }, } diff --git a/units/Legion/Economy/legadvsol.lua b/units/Legion/Economy/legadvsol.lua index 3516f4faad4..d39c21ed1f5 100644 --- a/units/Legion/Economy/legadvsol.lua +++ b/units/Legion/Economy/legadvsol.lua @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 7, buildinggrounddecalsizex = 7, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/legageo.lua b/units/Legion/Economy/legageo.lua index 39c8aa7c638..7d8b84288cf 100644 --- a/units/Legion/Economy/legageo.lua +++ b/units/Legion/Economy/legageo.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 10, buildinggrounddecalsizex = 10, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", cvbuildable = true, geothermal = 1, model_author = "Tharsis", diff --git a/units/Legion/Economy/legamstor.lua b/units/Legion/Economy/legamstor.lua index 046b95a68f0..d43025663ca 100644 --- a/units/Legion/Economy/legamstor.lua +++ b/units/Legion/Economy/legamstor.lua @@ -30,7 +30,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/legeconv.lua b/units/Legion/Economy/legeconv.lua index 749e89af446..11e4f72ce4b 100644 --- a/units/Legion/Economy/legeconv.lua +++ b/units/Legion/Economy/legeconv.lua @@ -30,9 +30,9 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", energyconv_capacity = 70, - energyconv_efficiency = 1/70, + energyconv_efficiency = 1 / 70, model_author = "Protar", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/legestor.lua b/units/Legion/Economy/legestor.lua index f329725d538..531634d950d 100644 --- a/units/Legion/Economy/legestor.lua +++ b/units/Legion/Economy/legestor.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/leggeo.lua b/units/Legion/Economy/leggeo.lua index 072f4abbcf4..98246a956f2 100644 --- a/units/Legion/Economy/leggeo.lua +++ b/units/Legion/Economy/leggeo.lua @@ -33,7 +33,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", cvbuildable = true, geothermal = 1, model_author = "Tharsis", diff --git a/units/Legion/Economy/legmex.lua b/units/Legion/Economy/legmex.lua index 5125a1a72d0..8a345c9a51a 100644 --- a/units/Legion/Economy/legmex.lua +++ b/units/Legion/Economy/legmex.lua @@ -37,7 +37,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 1, model_author = "Protar", diff --git a/units/Legion/Economy/legmext15.lua b/units/Legion/Economy/legmext15.lua index 54ed67d20b9..fa0b03888e5 100644 --- a/units/Legion/Economy/legmext15.lua +++ b/units/Legion/Economy/legmext15.lua @@ -36,7 +36,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 1, model_author = "Protar", diff --git a/units/Legion/Economy/legmoho.lua b/units/Legion/Economy/legmoho.lua index 7e1b178d312..b1c9d2658ef 100644 --- a/units/Legion/Economy/legmoho.lua +++ b/units/Legion/Economy/legmoho.lua @@ -35,7 +35,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 4, model_author = "Protar", diff --git a/units/Legion/Economy/legmohobp.lua b/units/Legion/Economy/legmohobp.lua index bfbb5739571..88e8b2601ae 100644 --- a/units/Legion/Economy/legmohobp.lua +++ b/units/Legion/Economy/legmohobp.lua @@ -37,7 +37,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 4, model_author = "Protar", diff --git a/units/Legion/Economy/legmohobpct.lua b/units/Legion/Economy/legmohobpct.lua index 265328be275..2c7f46e2937 100644 --- a/units/Legion/Economy/legmohobpct.lua +++ b/units/Legion/Economy/legmohobpct.lua @@ -32,7 +32,7 @@ return { upright = true, workertime = 400, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", paralyzemultiplier = 0.1, diff --git a/units/Legion/Economy/legmohocon.lua b/units/Legion/Economy/legmohocon.lua index 4874096202c..9c984b7ccdc 100644 --- a/units/Legion/Economy/legmohocon.lua +++ b/units/Legion/Economy/legmohocon.lua @@ -1,4 +1,4 @@ -return { --costs should be same as legmohoconct and legmohoconin +return { --costs should be same as legmohoconct and legmohoconin legmohocon = { maxacc = 0, activatewhenbuilt = true, @@ -35,7 +35,7 @@ return { --costs should be same as legmohoconct and legmohoconin buildinggrounddecalsizey = 7, buildinggrounddecalsizex = 7, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 4, model_author = "Tharsis and Protar", diff --git a/units/Legion/Economy/legmohoconct.lua b/units/Legion/Economy/legmohoconct.lua index 33a83dca810..bca2fb37f9c 100644 --- a/units/Legion/Economy/legmohoconct.lua +++ b/units/Legion/Economy/legmohoconct.lua @@ -1,4 +1,4 @@ -return { --costs should be same as legmohocon and legmohoconin +return { --costs should be same as legmohocon and legmohoconin legmohoconct = { activatewhenbuilt = true, maxacc = 0, @@ -46,7 +46,7 @@ return { --costs should be same as legmohocon and legmohoconin buildinggrounddecalsizey = 7, buildinggrounddecalsizex = 7, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis and Protar", normaltex = "unittextures/leg_normal.dds", scav_swap_override_created = "delete", -- (delete = removes the unit, null = cancels swap, unitdefname = overrides what unit are we swapping into) diff --git a/units/Legion/Economy/legmohoconin.lua b/units/Legion/Economy/legmohoconin.lua index de9b0af0a7b..67bbb61ce04 100644 --- a/units/Legion/Economy/legmohoconin.lua +++ b/units/Legion/Economy/legmohoconin.lua @@ -1,4 +1,4 @@ -return { --costs should be same as legmohocon and legmohoconct +return { --costs should be same as legmohocon and legmohoconct legmohoconin = { maxacc = 0, activatewhenbuilt = true, @@ -31,7 +31,7 @@ return { --costs should be same as legmohocon and legmohoconct icontype = "legmohocon", yardmap = "h oooooooo osssssso osssssso ossoosso ossoosso osssssso osssssso oooooooo", customparams = { - unitgroup = 'metal', + unitgroup = "metal", cvbuildable = true, metal_extractor = 4, model_author = "Tharsis and Protar", diff --git a/units/Legion/Economy/legmstor.lua b/units/Legion/Economy/legmstor.lua index c00530f9e20..643f04cd334 100644 --- a/units/Legion/Economy/legmstor.lua +++ b/units/Legion/Economy/legmstor.lua @@ -31,7 +31,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'metal', + unitgroup = "metal", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/legrampart.lua b/units/Legion/Economy/legrampart.lua index 8a81e166ca3..9067f3337a9 100644 --- a/units/Legion/Economy/legrampart.lua +++ b/units/Legion/Economy/legrampart.lua @@ -1,75 +1,75 @@ return { - legrampart = { - maxacc = 0, - activatewhenbuilt = true, - maxdec = 4.5, - buildangle = 4096, - energycost = 38000, - metalcost = 2600, - buildpic = "legrampart.DDS", - buildtime = 36000, + legrampart = { + maxacc = 0, + activatewhenbuilt = true, + maxdec = 4.5, + buildangle = 4096, + energycost = 38000, + metalcost = 2600, + buildpic = "legrampart.DDS", + buildtime = 36000, canrepeat = false, canmove = true, - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "96 86 96", - collisionvolumetype = "cylY", - energymake = 600, - energystorage = 4000, - explodeas = "advenergystorage", - footprintx = 5, - footprintz = 5, - health = 8600, + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "96 86 96", + collisionvolumetype = "cylY", + energymake = 600, + energystorage = 4000, + explodeas = "advenergystorage", + footprintx = 5, + footprintz = 5, + health = 8600, radardistancejam = 500, radardistance = 2100, radaremitheight = 72, - maxslope = 20, + maxslope = 20, mass = 20000, - maxwaterdepth = 5, + maxwaterdepth = 5, nochasecategory = "VTOL", name = "Gattling", - objectname = "Units/legrampart.s3o", - script = "Units/legrampart.cob", - seismicsignature = 0, - selfdestructas = "advenergystorageSelfd", - sightdistance = 1000, + objectname = "Units/legrampart.s3o", + script = "Units/legrampart.cob", + seismicsignature = 0, + selfdestructas = "advenergystorageSelfd", + sightdistance = 1000, turnrate = 1, yardmap = "h cbyybsygbc bsbssbbssb gsbsbssbby ybsssbsssy sbsbsssbsb bsbsssbsbs ysssbsssby ybbssbsbsg bssbbssbsb cbgysbyybc", upright = true, - customparams = { - usebuildinggrounddecal = true, - buildinggrounddecaltype = "decals/legrampart_aoplane.dds", - buildinggrounddecalsizey = 10, - buildinggrounddecalsizex = 10, - buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + customparams = { + usebuildinggrounddecal = true, + buildinggrounddecaltype = "decals/legrampart_aoplane.dds", + buildinggrounddecalsizey = 10, + buildinggrounddecalsizex = 10, + buildinggrounddecaldecayspeed = 30, + unitgroup = "energy", restrictions_exclusion = "_noantinuke_", - cvbuildable = true, - geothermal = 1, - model_author = "Tharsis", - normaltex = "unittextures/LEG_normal.dds", - removewait = true, - subfolder = "CorBuildings/LandEconomy", - techlevel = 2, + cvbuildable = true, + geothermal = 1, + model_author = "Tharsis", + normaltex = "unittextures/LEG_normal.dds", + removewait = true, + subfolder = "CorBuildings/LandEconomy", + techlevel = 2, inheritxpratemultiplier = 1, childreninheritxp = "DRONE", parentsinheritxp = "DRONE", - }, - sounds = { - canceldestruct = "cancel2", - underattack = "warning1", - count = { - [1] = "count6", - [2] = "count5", - [3] = "count4", - [4] = "count3", - [5] = "count2", - [6] = "count1" - }, - select = { - [1] = "geothrm2" - } - }, - weapondefs = { + }, + sounds = { + canceldestruct = "cancel2", + underattack = "warning1", + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + select = { + [1] = "geothrm2", + }, + }, + weapondefs = { fmd_rocket = { areaofeffect = 420, avoidfeature = false, @@ -150,40 +150,40 @@ return { default = 0, }, customparams = { - carried_unit = "legheavydrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legheavydrone", --Name of the unit spawned by this carrier unit. engagementrange = 1600, - spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 8, --Spawnrate roughly in seconds. - maxunits = 3, --Will spawn units until this amount has been reached. + spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 8, --Spawnrate roughly in seconds. + maxunits = 3, --Will spawn units until this amount has been reached. startingdronecount = 1, - energycost = 1000, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 90, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1500, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 1000, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 90, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1500, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 50, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 256, docktohealthreshold = 33, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "10 11 12", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. dronedocktime = 2, droneairtime = 90, droneammo = 40, }, }, - }, - weapons = { - [1] = { - badtargetcategory = "ALL", - def = "FMD_ROCKET" - }, - [2] = { + }, + weapons = { + [1] = { + badtargetcategory = "ALL", + def = "FMD_ROCKET", + }, + [2] = { badtargetcategory = "VTOL", def = "PLASMA", onlytargetcategory = "NOTSUB", - }, - } - } + }, + }, + }, } diff --git a/units/Legion/Economy/legsolar.lua b/units/Legion/Economy/legsolar.lua index 3e9a7e2581c..2ab7b085604 100644 --- a/units/Legion/Economy/legsolar.lua +++ b/units/Legion/Economy/legsolar.lua @@ -36,7 +36,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", model_author = "Hornet", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Economy/legwin.lua b/units/Legion/Economy/legwin.lua index 3c62f0f6f7c..3b97b6961db 100644 --- a/units/Legion/Economy/legwin.lua +++ b/units/Legion/Economy/legwin.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", model_author = "Yzch", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Hovercraft/legah.lua b/units/Legion/Hovercraft/legah.lua index 7f00bac7291..0ed48b41cfc 100644 --- a/units/Legion/Hovercraft/legah.lua +++ b/units/Legion/Hovercraft/legah.lua @@ -34,7 +34,7 @@ return { turninplacespeedlimit = 2.2044, turnrate = 470, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "CorHovercraft", @@ -159,4 +159,3 @@ return { }, }, } - diff --git a/units/Legion/Hovercraft/legcar.lua b/units/Legion/Hovercraft/legcar.lua index 0a89b293e18..04a3f39473e 100644 --- a/units/Legion/Hovercraft/legcar.lua +++ b/units/Legion/Hovercraft/legcar.lua @@ -31,7 +31,7 @@ return { turninplacespeedlimit = 1.9768, turnrate = 410, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "hovercraft", diff --git a/units/Legion/Hovercraft/legmh.lua b/units/Legion/Hovercraft/legmh.lua index cea2ff1a1b2..7f009f80303 100644 --- a/units/Legion/Hovercraft/legmh.lua +++ b/units/Legion/Hovercraft/legmh.lua @@ -30,7 +30,7 @@ return { turninplacespeedlimit = 1.5972, turnrate = 455, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "CorHovercraft", diff --git a/units/Legion/Hovercraft/legner.lua b/units/Legion/Hovercraft/legner.lua index 47d33dd97f9..70a9bd4357b 100644 --- a/units/Legion/Hovercraft/legner.lua +++ b/units/Legion/Hovercraft/legner.lua @@ -30,7 +30,7 @@ return { turninplacespeedlimit = 1.6698, turnrate = 550, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "hovercraft", diff --git a/units/Legion/Hovercraft/legsh.lua b/units/Legion/Hovercraft/legsh.lua index fe5045c22e0..cdca0d2f877 100644 --- a/units/Legion/Hovercraft/legsh.lua +++ b/units/Legion/Hovercraft/legsh.lua @@ -30,7 +30,7 @@ return { turninplacespeedlimit = 2.9634, turnrate = 540, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "EnderRobo", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmHovercraft", diff --git a/units/Legion/Labs/legaap.lua b/units/Legion/Labs/legaap.lua index a6712b71ce0..bf9810885e3 100644 --- a/units/Legion/Labs/legaap.lua +++ b/units/Legion/Labs/legaap.lua @@ -49,7 +49,7 @@ return { buildinggrounddecalsizey = 12, buildinggrounddecalsizex = 12, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert2', + unitgroup = "buildert2", restrictions_inclusion = "_noair_", airfactory = true, model_author = "Protar/Ghoulish", diff --git a/units/Legion/Labs/legalab.lua b/units/Legion/Labs/legalab.lua index 1efd6ac6c68..fc142cd2015 100644 --- a/units/Legion/Labs/legalab.lua +++ b/units/Legion/Labs/legalab.lua @@ -55,7 +55,7 @@ return { buildinggrounddecalsizey = 12, buildinggrounddecalsizex = 12, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "Protar/Ghoulish", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/legamphlab.lua b/units/Legion/Labs/legamphlab.lua index 014ff39ec4b..973210347b3 100644 --- a/units/Legion/Labs/legamphlab.lua +++ b/units/Legion/Labs/legamphlab.lua @@ -28,20 +28,20 @@ return { terraformspeed = 750, workertime = 150, yardmap = "oooooo oooooo oeeeeo oeeeeo oeeeeo oeeeeo", - -- yardmap = [[h - -- oo oo oo oo oo oo - -- oo oo oo oo oo oo - -- oo oo oo oo oo oo - -- oo oo oo oo oo oo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- oe ee ee ee ee eo - -- ]], + -- yardmap = [[h + -- oo oo oo oo oo oo + -- oo oo oo oo oo oo + -- oo oo oo oo oo oo + -- oo oo oo oo oo oo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- oe ee ee ee ee eo + -- ]], buildoptions = { [1] = "legotter", [2] = "legamphtank", @@ -57,7 +57,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "ZephyrSkies, Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/legap.lua b/units/Legion/Labs/legap.lua index 3cd84f62e51..db3c8f57545 100644 --- a/units/Legion/Labs/legap.lua +++ b/units/Legion/Labs/legap.lua @@ -48,7 +48,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", restrictions_inclusion = "_noair_", airfactory = true, model_author = "Protar/Ghoulish", diff --git a/units/Legion/Labs/legavp.lua b/units/Legion/Labs/legavp.lua index 935a864f591..b1abefdcda7 100644 --- a/units/Legion/Labs/legavp.lua +++ b/units/Legion/Labs/legavp.lua @@ -66,7 +66,7 @@ return { "legavantinuke", "legavjam", "legavrad", - "legafcv" + "legafcv", }, customparams = { usebuildinggrounddecal = false, @@ -74,7 +74,7 @@ return { buildinggrounddecalsizey = 12, buildinggrounddecalsizex = 12, buildinggrounddecaldecayspeed = 0.01, - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/legfhp.lua b/units/Legion/Labs/legfhp.lua index b3155cf753a..507c1026e42 100644 --- a/units/Legion/Labs/legfhp.lua +++ b/units/Legion/Labs/legfhp.lua @@ -38,7 +38,7 @@ return { [6] = "legcar", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "Protar, ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", @@ -48,8 +48,8 @@ return { dead = { blocking = false, category = "corpses", - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "96 35 96", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "96 35 96", collisionvolumetype = "Box", damage = 2014, footprintx = 8, diff --git a/units/Legion/Labs/leggant.lua b/units/Legion/Labs/leggant.lua index 4751b6b257c..3036283858b 100644 --- a/units/Legion/Labs/leggant.lua +++ b/units/Legion/Labs/leggant.lua @@ -46,7 +46,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 15, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/leggantuw.lua b/units/Legion/Labs/leggantuw.lua index 5977a8173dc..bd255e70437 100644 --- a/units/Legion/Labs/leggantuw.lua +++ b/units/Legion/Labs/leggantuw.lua @@ -20,7 +20,7 @@ return { health = 17800, maxslope = 10, metalstorage = 800, - minwaterdepth = 30, + minwaterdepth = 30, objectname = "Units/LEGGANT.s3o", radardistance = 50, script = "Units/LEGGANT.cob", @@ -34,9 +34,9 @@ return { "legeheatraymech", "legjav", "legehovertank", - "legfloat", - "legamph", - "leganavybattleship" + "legfloat", + "legamph", + "leganavybattleship", }, customparams = { usebuildinggrounddecal = true, @@ -44,7 +44,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 15, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/leghalab.lua b/units/Legion/Labs/leghalab.lua index 0ab422ffc11..b20f9eae066 100644 --- a/units/Legion/Labs/leghalab.lua +++ b/units/Legion/Labs/leghalab.lua @@ -48,7 +48,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 15, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/leghavp.lua b/units/Legion/Labs/leghavp.lua index 1db2e44dc13..512ec7b701a 100644 --- a/units/Legion/Labs/leghavp.lua +++ b/units/Legion/Labs/leghavp.lua @@ -48,7 +48,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 15, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/leghp.lua b/units/Legion/Labs/leghp.lua index 6408ff09f10..52d35504b62 100644 --- a/units/Legion/Labs/leghp.lua +++ b/units/Legion/Labs/leghp.lua @@ -43,7 +43,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Protar", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Labs/leglab.lua b/units/Legion/Labs/leglab.lua index bf66f520a95..0a2c821fa50 100644 --- a/units/Legion/Labs/leglab.lua +++ b/units/Legion/Labs/leglab.lua @@ -47,7 +47,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/LandFactories", diff --git a/units/Legion/Labs/legsy.lua b/units/Legion/Labs/legsy.lua index 9f9fe450761..b724d30ff2b 100644 --- a/units/Legion/Labs/legsy.lua +++ b/units/Legion/Labs/legsy.lua @@ -37,7 +37,7 @@ return { [5] = "legnavyfrigate", [6] = "legnavydestro", [7] = "legnavysub", - [8] = "legnavyartyship", + [8] = "legnavyartyship", }, customparams = { model_author = "Tharsis", diff --git a/units/Legion/Labs/legvp.lua b/units/Legion/Labs/legvp.lua index 9d457081d58..0a19849de73 100644 --- a/units/Legion/Labs/legvp.lua +++ b/units/Legion/Labs/legvp.lua @@ -63,7 +63,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Protar/Ghoulish", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Labs", diff --git a/units/Legion/Legion EvoCom/legcombabyunits.lua b/units/Legion/Legion EvoCom/legcombabyunits.lua index 32693243035..072bb4fd1b5 100644 --- a/units/Legion/Legion EvoCom/legcombabyunits.lua +++ b/units/Legion/Legion EvoCom/legcombabyunits.lua @@ -1,51 +1,51 @@ --special unit variations used in EvoCom local unitsTable = {} --Legion Lobber, for Legion Commander Botcannon -unitsTable['babyleglob'] = VFS.Include('units/Legion/Bots/leglob.lua').leglob --if this filepath is changed, the unit will no longer work! -unitsTable['babyleglob'].corpse = "" -unitsTable['babyleglob'].selfdestructas = "" -unitsTable['babyleglob'].mass = 150 -unitsTable['babyleglob'].metalcost = 0 -unitsTable['babyleglob'].movestate = 2 -unitsTable['babyleglob'].power = 66 -unitsTable['babyleglob'].customparams.i18nfromunit = 'leglob' +unitsTable["babyleglob"] = VFS.Include("units/Legion/Bots/leglob.lua").leglob --if this filepath is changed, the unit will no longer work! +unitsTable["babyleglob"].corpse = "" +unitsTable["babyleglob"].selfdestructas = "" +unitsTable["babyleglob"].mass = 150 +unitsTable["babyleglob"].metalcost = 0 +unitsTable["babyleglob"].movestate = 2 +unitsTable["babyleglob"].power = 66 +unitsTable["babyleglob"].customparams.i18nfromunit = "leglob" --Legion Goblin, for Legion Commander Botcannon -unitsTable['babyleggob'] = VFS.Include('units/Legion/Bots/leggob.lua').leggob --if this filepath is changed, the unit will no longer work! -unitsTable['babyleggob'].corpse = "" -unitsTable['babyleggob'].selfdestructas = "" -unitsTable['babyleggob'].mass = 25 -unitsTable['babyleggob'].metalcost = 0 -unitsTable['babyleggob'].movestate = 2 -unitsTable['babyleggob'].power = 33 -unitsTable['babyleggob'].customparams.i18nfromunit = 'leggob' +unitsTable["babyleggob"] = VFS.Include("units/Legion/Bots/leggob.lua").leggob --if this filepath is changed, the unit will no longer work! +unitsTable["babyleggob"].corpse = "" +unitsTable["babyleggob"].selfdestructas = "" +unitsTable["babyleggob"].mass = 25 +unitsTable["babyleggob"].metalcost = 0 +unitsTable["babyleggob"].movestate = 2 +unitsTable["babyleggob"].power = 33 +unitsTable["babyleggob"].customparams.i18nfromunit = "leggob" --Legion Phalanx, for Legion Commander Botcannon -unitsTable['babylegshot'] = VFS.Include('units/Legion/Bots/T2 Bots/legshot.lua').legshot --if this filepath is changed, the unit will no longer work! -unitsTable['babylegshot'].corpse = "" -unitsTable['babylegshot'].selfdestructas = "" -unitsTable['babylegshot'].metalcost = 0 -unitsTable['babylegshot'].mass = 630 -unitsTable['babylegshot'].movestate = 2 -unitsTable['babylegshot'].power = 735 -unitsTable['babylegshot'].customparams.i18nfromunit = 'legshot' +unitsTable["babylegshot"] = VFS.Include("units/Legion/Bots/T2 Bots/legshot.lua").legshot --if this filepath is changed, the unit will no longer work! +unitsTable["babylegshot"].corpse = "" +unitsTable["babylegshot"].selfdestructas = "" +unitsTable["babylegshot"].metalcost = 0 +unitsTable["babylegshot"].mass = 630 +unitsTable["babylegshot"].movestate = 2 +unitsTable["babylegshot"].power = 735 +unitsTable["babylegshot"].customparams.i18nfromunit = "legshot" --Legion Heavy Drone, for Legion Commander Botcannon -unitsTable['babylegheavydrone'] = VFS.Include('units/Legion/Air/T2 Air/legheavydrone.lua').legheavydrone --if this filepath is changed, the unit will no longer work! -unitsTable['babylegheavydrone'].corpse = "" -unitsTable['babylegheavydrone'].selfdestructas = "" -unitsTable['babylegheavydrone'].metalcost = 0 -unitsTable['babylegheavydrone'].movestate = 2 -unitsTable['babylegheavydrone'].power = 1000 -unitsTable['babylegheavydrone'].customparams.i18nfromunit = 'legheavydrone' +unitsTable["babylegheavydrone"] = VFS.Include("units/Legion/Air/T2 Air/legheavydrone.lua").legheavydrone --if this filepath is changed, the unit will no longer work! +unitsTable["babylegheavydrone"].corpse = "" +unitsTable["babylegheavydrone"].selfdestructas = "" +unitsTable["babylegheavydrone"].metalcost = 0 +unitsTable["babylegheavydrone"].movestate = 2 +unitsTable["babylegheavydrone"].power = 1000 +unitsTable["babylegheavydrone"].customparams.i18nfromunit = "legheavydrone" --Legion Drone, for Legion Commander Botcannon -unitsTable['babylegdrone'] = VFS.Include('units/Legion/Air/legdrone.lua').legdrone --if this filepath is changed, the unit will no longer work! -unitsTable['babylegdrone'].corpse = "" -unitsTable['babylegdrone'].selfdestructas = "" -unitsTable['babylegdrone'].metalcost = 0 -unitsTable['babylegdrone'].movestate = 2 -unitsTable['babylegdrone'].power = 500 -unitsTable['babylegdrone'].customparams.i18nfromunit = 'legdrone' +unitsTable["babylegdrone"] = VFS.Include("units/Legion/Air/legdrone.lua").legdrone --if this filepath is changed, the unit will no longer work! +unitsTable["babylegdrone"].corpse = "" +unitsTable["babylegdrone"].selfdestructas = "" +unitsTable["babylegdrone"].metalcost = 0 +unitsTable["babylegdrone"].movestate = 2 +unitsTable["babylegdrone"].power = 500 +unitsTable["babylegdrone"].customparams.i18nfromunit = "legdrone" return unitsTable diff --git a/units/Legion/Legion EvoCom/legcomlvl10.lua b/units/Legion/Legion EvoCom/legcomlvl10.lua index 1913666f028..9c258723d6c 100644 --- a/units/Legion/Legion EvoCom/legcomlvl10.lua +++ b/units/Legion/Legion EvoCom/legcomlvl10.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 5388, - releaseheld = true, + releaseheld = true, script = "Units/legevocom3.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -73,7 +73,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -83,21 +83,21 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", "legctl", "leganavalaaturret", - "legbastion", + "legbastion", "legeyes", "legavrad", "legavjam", "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -105,15 +105,15 @@ return { "legsy", "leghp", "legfhp", - "legavantinuke", - "legkeres", + "legavantinuke", + "legkeres", "legeshotgunmech", "legnanotc", "legnanotcplat", "legdeflector", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -134,7 +134,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -152,7 +152,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -217,11 +217,11 @@ return { }, weapondefs = { armmg_weapon = { - accuracy = 100, + accuracy = 100, areaofeffect = 110, avoidfeature = false, - burnblow = true, - burst = 2, + burnblow = true, + burst = 2, burstrate = 0.15, craterareaofeffect = 0, craterboost = 0, @@ -237,7 +237,7 @@ return { soundhit = "xplomed2", soundhitwet = "splssml", soundstart = "cannon3", - sprayangle = 500, + sprayangle = 500, turret = true, weapontype = "Cannon", weaponvelocity = 600, @@ -338,7 +338,7 @@ return { areaofeffect = 16, avoidfeature = false, burnblow = false, - burst = 4, + burst = 4, burstrate = 0.12, cegtag = "railgun", collidefriendly = false, @@ -441,7 +441,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl2.lua b/units/Legion/Legion EvoCom/legcomlvl2.lua index 1038d0d52fe..c7ff5ae2380 100644 --- a/units/Legion/Legion EvoCom/legcomlvl2.lua +++ b/units/Legion/Legion EvoCom/legcomlvl2.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4999, health = 6000, @@ -45,7 +45,7 @@ return { radardistance = 800, radaremitheight = 44, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legevocom1.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -92,7 +92,7 @@ return { "leghelios", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, effigy_offset = 1, evocomlvl = 2, @@ -113,7 +113,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -128,7 +128,7 @@ return { footprintz = 2, height = 20, metal = 2000, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, }, heap = { @@ -372,7 +372,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl3.lua b/units/Legion/Legion EvoCom/legcomlvl3.lua index 4008c7513cc..2d52327210c 100644 --- a/units/Legion/Legion EvoCom/legcomlvl3.lua +++ b/units/Legion/Legion EvoCom/legcomlvl3.lua @@ -1,4 +1,3 @@ - return { legcomlvl3 = { maxacc = 0.18, @@ -29,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4900, health = 8000, @@ -46,7 +45,7 @@ return { radardistance = 900, radaremitheight = 49, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legevocom1.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -95,7 +94,7 @@ return { "legdrag", "legrad", "legfrad", - "legstronghold", + "legstronghold", "legfdrag", "leglab", "legvp", @@ -107,7 +106,7 @@ return { "legnanotcplat", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, effigy_offset = 1, evocomlvl = 3, @@ -131,7 +130,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -146,7 +145,7 @@ return { footprintz = 2, height = 20, metal = 2750, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, }, heap = { @@ -444,7 +443,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl4.lua b/units/Legion/Legion EvoCom/legcomlvl4.lua index 4ae21b109f1..f99f5dae56b 100644 --- a/units/Legion/Legion EvoCom/legcomlvl4.lua +++ b/units/Legion/Legion EvoCom/legcomlvl4.lua @@ -1,4 +1,3 @@ - return { legcomlvl4 = { maxacc = 0.18, @@ -29,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4900, health = 10000, @@ -46,7 +45,7 @@ return { radardistance = 1000, radaremitheight = 54, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legevocom2.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -61,56 +60,56 @@ return { upright = true, workertime = 500, buildoptions = { - "legmex", - "legsolar", - "legwin", - "legadvsol", - "legeconv", - "legmext15", - "leggeo", - "legtide", - "legestor", - "legmstor", - "leguwestore", - "legfeconv", - "leguwmstore", - "leguwgeo", - "leggat", - "legbart", - "legshot", - "legstr", - "leginfestor", - "legvflak", - "legflak", - "leganavaltorpturret", - "legmed", - "legdtr", - "legvcarry", - "legmg", - "legjuno", - "legctl", - "leganavalaaturret", - "legeyes", - "legavrad", - "legavjam", - "legdrag", - "legarad", - "legfrad", - "legstronghold", - "legforti", - "legfdrag", - "leglab", - "legvp", - "legap", - "legsy", - "leghp", - "legfhp", - "legavantinuke", - "legnanotc", - "legnanotcplat", + "legmex", + "legsolar", + "legwin", + "legadvsol", + "legeconv", + "legmext15", + "leggeo", + "legtide", + "legestor", + "legmstor", + "leguwestore", + "legfeconv", + "leguwmstore", + "leguwgeo", + "leggat", + "legbart", + "legshot", + "legstr", + "leginfestor", + "legvflak", + "legflak", + "leganavaltorpturret", + "legmed", + "legdtr", + "legvcarry", + "legmg", + "legjuno", + "legctl", + "leganavalaaturret", + "legeyes", + "legavrad", + "legavjam", + "legdrag", + "legarad", + "legfrad", + "legstronghold", + "legforti", + "legfdrag", + "leglab", + "legvp", + "legap", + "legsy", + "leghp", + "legfhp", + "legavantinuke", + "legnanotc", + "legnanotcplat", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, effigy_offset = 1, evocomlvl = 4, @@ -134,7 +133,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -149,7 +148,7 @@ return { footprintz = 2, height = 20, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, }, heap = { @@ -435,7 +434,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl5.lua b/units/Legion/Legion EvoCom/legcomlvl5.lua index 0f90f19d7c3..4cce7b416cf 100644 --- a/units/Legion/Legion EvoCom/legcomlvl5.lua +++ b/units/Legion/Legion EvoCom/legcomlvl5.lua @@ -2,7 +2,7 @@ return { legcomlvl5 = { maxacc = 0.18, activatewhenbuilt = true, - autoheal = 15,--10, + autoheal = 15, --10, maxdec = 1.125, energycost = 60000, metalcost = 6000, @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 1995, - releaseheld = true, + releaseheld = true, script = "Units/legevocom2.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -74,7 +74,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -84,7 +84,7 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", @@ -96,8 +96,8 @@ return { "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -110,7 +110,7 @@ return { "legnanotcplat", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -137,7 +137,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -155,7 +155,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -454,7 +454,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl6.lua b/units/Legion/Legion EvoCom/legcomlvl6.lua index 888ff593e43..7ccf14dcb96 100644 --- a/units/Legion/Legion EvoCom/legcomlvl6.lua +++ b/units/Legion/Legion EvoCom/legcomlvl6.lua @@ -2,7 +2,7 @@ return { legcomlvl6 = { maxacc = 0.18, activatewhenbuilt = true, - autoheal = 15,--10, + autoheal = 15, --10, maxdec = 1.125, energycost = 70000, metalcost = 7000, @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 2433, - releaseheld = true, + releaseheld = true, script = "Units/legevocom3.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -73,7 +73,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -83,21 +83,21 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", "legctl", "leganavalaaturret", - "legbastion", + "legbastion", "legeyes", "legavrad", "legavjam", "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -105,13 +105,13 @@ return { "legsy", "leghp", "legfhp", - "legavantinuke", - "legkeres", + "legavantinuke", + "legkeres", "legnanotc", "legnanotcplat", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -138,7 +138,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -156,7 +156,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -221,10 +221,10 @@ return { }, weapondefs = { armmg_weapon = { - accuracy = 100, + accuracy = 100, areaofeffect = 90, avoidfeature = false, - burnblow = true, + burnblow = true, craterareaofeffect = 0, craterboost = 0, cratermult = 0, @@ -296,7 +296,7 @@ return { areaofeffect = 16, avoidfeature = false, burnblow = false, - burst = 3, + burst = 3, burstrate = 0.15, cegtag = "railgun", collidefriendly = false, @@ -440,7 +440,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl7.lua b/units/Legion/Legion EvoCom/legcomlvl7.lua index fb4855e0bba..eeb48f2f15e 100644 --- a/units/Legion/Legion EvoCom/legcomlvl7.lua +++ b/units/Legion/Legion EvoCom/legcomlvl7.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 2967, - releaseheld = true, + releaseheld = true, script = "Units/legevocom3.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -73,7 +73,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -83,21 +83,21 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", "legctl", "leganavalaaturret", - "legbastion", + "legbastion", "legeyes", "legavrad", "legavjam", "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -105,13 +105,13 @@ return { "legsy", "leghp", "legfhp", - "legavantinuke", - "legkeres", + "legavantinuke", + "legkeres", "legnanotc", "legnanotcplat", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -138,7 +138,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -156,7 +156,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -221,10 +221,10 @@ return { }, weapondefs = { armmg_weapon = { - accuracy = 100, + accuracy = 100, areaofeffect = 90, avoidfeature = false, - burnblow = true, + burnblow = true, craterareaofeffect = 0, craterboost = 0, cratermult = 0, @@ -338,7 +338,7 @@ return { areaofeffect = 16, avoidfeature = false, burnblow = false, - burst = 4, + burst = 4, burstrate = 0.12, cegtag = "railgun", collidefriendly = false, @@ -440,7 +440,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legcomlvl8.lua b/units/Legion/Legion EvoCom/legcomlvl8.lua index 2242c21bd76..1cd147e3d7d 100644 --- a/units/Legion/Legion EvoCom/legcomlvl8.lua +++ b/units/Legion/Legion EvoCom/legcomlvl8.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 3621, - releaseheld = true, + releaseheld = true, script = "Units/legevocom3.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -73,7 +73,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -83,21 +83,21 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", "legctl", "leganavalaaturret", - "legbastion", + "legbastion", "legeyes", "legavrad", "legavjam", "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -105,14 +105,14 @@ return { "legsy", "leghp", "legfhp", - "legavantinuke", - "legkeres", + "legavantinuke", + "legkeres", "legnanotc", "legnanotcplat", "legdeflector", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -139,7 +139,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -157,7 +157,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -222,10 +222,10 @@ return { }, weapondefs = { armmg_weapon = { - accuracy = 100, + accuracy = 100, areaofeffect = 100, avoidfeature = false, - burnblow = true, + burnblow = true, craterareaofeffect = 0, craterboost = 0, cratermult = 0, @@ -339,7 +339,7 @@ return { areaofeffect = 16, avoidfeature = false, burnblow = false, - burst = 4, + burst = 4, burstrate = 0.12, cegtag = "railgun", collidefriendly = false, @@ -442,7 +442,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", @@ -457,7 +457,7 @@ return { badtargetcategory = "VTOL GROUNDSCOUT SHIP", def = "BOTCANNON", onlytargetcategory = "NOTSHIP", - } + }, }, }, } diff --git a/units/Legion/Legion EvoCom/legcomlvl9.lua b/units/Legion/Legion EvoCom/legcomlvl9.lua index ee0c45b3dbf..082940df5ce 100644 --- a/units/Legion/Legion EvoCom/legcomlvl9.lua +++ b/units/Legion/Legion EvoCom/legcomlvl9.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "legcomlvl4", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radaremitheight = 54, reclaimable = false, reclaimspeed = 4416, - releaseheld = true, + releaseheld = true, script = "Units/legevocom3.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -73,7 +73,7 @@ return { "legamstor", "leganavaladvgeo", "leganavalmex", - "leganavaleconv", + "leganavaleconv", "legaheattank", "leginf", "legshot", @@ -83,21 +83,21 @@ return { "legflak", "leganavaltorpturret", "legmed", - "legdtr", + "legdtr", "legvcarry", "legmg", "legjuno", "legctl", "leganavalaaturret", - "legbastion", + "legbastion", "legeyes", "legavrad", "legavjam", "legdrag", "legarad", "legfrad", - "legstronghold", - "legforti", + "legstronghold", + "legforti", "legfdrag", "leglab", "legvp", @@ -105,15 +105,15 @@ return { "legsy", "leghp", "legfhp", - "legavantinuke", - "legkeres", + "legavantinuke", + "legkeres", "legeshotgunmech", "legnanotc", "legnanotcplat", "legdeflector", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "legmex", iscommander = true, effigy_offset = 1, @@ -140,7 +140,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -158,7 +158,7 @@ return { height = 20, hitdensity = 100, metal = 3500, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, seqnamereclamate = "TREE1RECLAMATE", }, @@ -223,11 +223,11 @@ return { }, weapondefs = { armmg_weapon = { - accuracy = 100, + accuracy = 100, areaofeffect = 110, avoidfeature = false, - burnblow = true, - burst = 2, + burnblow = true, + burst = 2, burstrate = 0.2, craterareaofeffect = 0, craterboost = 0, @@ -243,7 +243,7 @@ return { soundhit = "xplomed2", soundhitwet = "splssml", soundstart = "cannon3", - sprayangle = 500, + sprayangle = 500, turret = true, weapontype = "Cannon", weaponvelocity = 600, @@ -344,7 +344,7 @@ return { areaofeffect = 16, avoidfeature = false, burnblow = false, - burst = 4, + burst = 4, burstrate = 0.12, cegtag = "railgun", collidefriendly = false, @@ -447,7 +447,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Legion/Legion EvoCom/legevodecom.lua b/units/Legion/Legion EvoCom/legevodecom.lua index 4c924e7ff0f..d0219348cbd 100644 --- a/units/Legion/Legion EvoCom/legevodecom.lua +++ b/units/Legion/Legion EvoCom/legevodecom.lua @@ -1,22 +1,22 @@ local unitsTable = {} for i = 2, 10 do - unitsTable['legdecomlvl' .. i] = VFS.Include('units/Legion/Legion EvoCom/legcomlvl' .. i .. '.lua')['legcomlvl' .. i] --if this filepath is changed, the unit will no longer work! - unitsTable['legdecomlvl' .. i].selfdestructas = "decoycommander" - unitsTable['legdecomlvl' .. i].explodeas = "decoycommander" - unitsTable['legdecomlvl' .. i].corpse = nil - unitsTable['legdecomlvl' .. i].customparams.evolution_target = nil - unitsTable['legdecomlvl' .. i].customparams.iscommander = nil - unitsTable['legdecomlvl' .. i].customparams.effigy = nil - unitsTable['legdecomlvl' .. i].customparams.i18nfromunit = "legcomlvl" .. i - unitsTable['legdecomlvl' .. i].customparams.isdecoycommander = true - unitsTable['legdecomlvl' .. i].decoyfor = "legcomlvl" .. i - unitsTable['legdecomlvl' .. i].customparams.decoyfor = "legcomlvl" .. i - unitsTable['legdecomlvl' .. i].health = math.ceil(unitsTable['legdecomlvl' .. i].health*0.5) - unitsTable['legdecomlvl' .. i].weapondefs.disintegrator.damage.default = 40 - if unitsTable['legdecomlvl' .. i].weapondefs.botcannon and unitsTable['legdecomlvl' .. i].weapondefs.botcannon.customparams.stockpilelimit then - unitsTable['legdecomlvl' .. i].weapondefs.botcannon.customparams.stockpilelimit = math.ceil(unitsTable['legdecomlvl' .. i].weapondefs.botcannon.customparams.stockpilelimit*0.4) - end + unitsTable["legdecomlvl" .. i] = VFS.Include("units/Legion/Legion EvoCom/legcomlvl" .. i .. ".lua")["legcomlvl" .. i] --if this filepath is changed, the unit will no longer work! + unitsTable["legdecomlvl" .. i].selfdestructas = "decoycommander" + unitsTable["legdecomlvl" .. i].explodeas = "decoycommander" + unitsTable["legdecomlvl" .. i].corpse = nil + unitsTable["legdecomlvl" .. i].customparams.evolution_target = nil + unitsTable["legdecomlvl" .. i].customparams.iscommander = nil + unitsTable["legdecomlvl" .. i].customparams.effigy = nil + unitsTable["legdecomlvl" .. i].customparams.i18nfromunit = "legcomlvl" .. i + unitsTable["legdecomlvl" .. i].customparams.isdecoycommander = true + unitsTable["legdecomlvl" .. i].decoyfor = "legcomlvl" .. i + unitsTable["legdecomlvl" .. i].customparams.decoyfor = "legcomlvl" .. i + unitsTable["legdecomlvl" .. i].health = math.ceil(unitsTable["legdecomlvl" .. i].health * 0.5) + unitsTable["legdecomlvl" .. i].weapondefs.disintegrator.damage.default = 40 + if unitsTable["legdecomlvl" .. i].weapondefs.botcannon and unitsTable["legdecomlvl" .. i].weapondefs.botcannon.customparams.stockpilelimit then + unitsTable["legdecomlvl" .. i].weapondefs.botcannon.customparams.stockpilelimit = math.ceil(unitsTable["legdecomlvl" .. i].weapondefs.botcannon.customparams.stockpilelimit * 0.4) + end end return unitsTable diff --git a/units/Legion/Other/Commanders/legcomecon.lua b/units/Legion/Other/Commanders/legcomecon.lua index 98db3780530..fe0bd03a74d 100644 --- a/units/Legion/Other/Commanders/legcomecon.lua +++ b/units/Legion/Other/Commanders/legcomecon.lua @@ -25,7 +25,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4999, health = 3350, @@ -41,7 +41,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcom.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -90,7 +90,7 @@ return { [32] = "armgeo", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", @@ -332,7 +332,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/Legion/Other/Commanders/legcomoff.lua b/units/Legion/Other/Commanders/legcomoff.lua index 7951aa2c18e..645ccf5d060 100644 --- a/units/Legion/Other/Commanders/legcomoff.lua +++ b/units/Legion/Other/Commanders/legcomoff.lua @@ -25,7 +25,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4999, health = 3350, @@ -41,7 +41,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcomoff.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -87,7 +87,7 @@ return { [29] = "corjamt", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", @@ -337,7 +337,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/Legion/Other/Commanders/legcomt2com.lua b/units/Legion/Other/Commanders/legcomt2com.lua index 5d1aede4de0..9ba14f16567 100644 --- a/units/Legion/Other/Commanders/legcomt2com.lua +++ b/units/Legion/Other/Commanders/legcomt2com.lua @@ -25,7 +25,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 10000, health = 6700, @@ -41,7 +41,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcomt2com.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -91,7 +91,7 @@ return { [33] = "legmext15", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", @@ -389,7 +389,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/Legion/Other/Commanders/legcomt2def.lua b/units/Legion/Other/Commanders/legcomt2def.lua index a96f0cb0a25..646c7c1d4c6 100644 --- a/units/Legion/Other/Commanders/legcomt2def.lua +++ b/units/Legion/Other/Commanders/legcomt2def.lua @@ -26,7 +26,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4999, health = 4450, @@ -42,7 +42,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcom.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -93,7 +93,7 @@ return { [34] = "armcir", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", @@ -380,7 +380,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "EMPGRENADE", diff --git a/units/Legion/Other/Commanders/legcomt2off.lua b/units/Legion/Other/Commanders/legcomt2off.lua index e597d3ac442..15637c72c73 100644 --- a/units/Legion/Other/Commanders/legcomt2off.lua +++ b/units/Legion/Other/Commanders/legcomt2off.lua @@ -25,7 +25,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, mass = 4999, health = 4450, @@ -42,7 +42,7 @@ return { radaremitheight = 40, radardistancejam = 100, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcomoff.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -99,7 +99,7 @@ return { [40] = "armgeo", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", iscommander = true, model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", @@ -350,7 +350,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/Legion/Other/legvision.lua b/units/Legion/Other/legvision.lua index 0df02d625d4..85d4158294a 100644 --- a/units/Legion/Other/legvision.lua +++ b/units/Legion/Other/legvision.lua @@ -32,7 +32,7 @@ return { waterline = 5, yardmap = "o", customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", removestop = true, diff --git a/units/Legion/SeaDefenses/T2/leganavalaaturret.lua b/units/Legion/SeaDefenses/T2/leganavalaaturret.lua index 91040d8f49b..29c44bf0944 100644 --- a/units/Legion/SeaDefenses/T2/leganavalaaturret.lua +++ b/units/Legion/SeaDefenses/T2/leganavalaaturret.lua @@ -82,7 +82,7 @@ return { leg_t2_microflak = { accuracy = 1000, areaofeffect = 44, - burst = 3, + burst = 3, burstrate = 0.02, avoidfeature = false, burnblow = true, diff --git a/units/Legion/SeaDefenses/T2/leganavaldefturret.lua b/units/Legion/SeaDefenses/T2/leganavaldefturret.lua index b4c918c8e41..dbd45e689ec 100644 --- a/units/Legion/SeaDefenses/T2/leganavaldefturret.lua +++ b/units/Legion/SeaDefenses/T2/leganavaldefturret.lua @@ -28,7 +28,7 @@ return { waterline = 0, yardmap = "wwwwww wwwwww wwwwww wwwwww wwwwww wwwwww", customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -153,7 +153,7 @@ return { sprayangle = 1500, thickness = 1, tolerance = 6000, - firetolerance = 6000, + firetolerance = 6000, turret = true, weapontype = "LaserCannon", weaponvelocity = 1000, diff --git a/units/Legion/SeaDefenses/legfhive.lua b/units/Legion/SeaDefenses/legfhive.lua index 8644930a90c..fde94e914b0 100644 --- a/units/Legion/SeaDefenses/legfhive.lua +++ b/units/Legion/SeaDefenses/legfhive.lua @@ -36,8 +36,8 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', - model_author = "Zephyr",--naval edition by / c/o Hornet + unitgroup = "weapon", + model_author = "Zephyr", --naval edition by / c/o Hornet normaltex = "unittextures/leg_normal.dds", removewait = true, subfolder = "CorBuildings/LandDefenceOffence", @@ -132,24 +132,24 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1100, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 8, --Spawnrate roughly in seconds. - maxunits = 6, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 8, --Spawnrate roughly in seconds. + maxunits = 6, --Will spawn units until this amount has been reached. startingdronecount = 3, - energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1000, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1000, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 20, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 20, docktohealthreshold = 75, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "4 5 6 7 8 9", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 6, stockpilemetal = 15, stockpileenergy = 500, @@ -159,7 +159,7 @@ return { dronedocktime = 3, droneairtime = 60, droneammo = 12, - } + }, }, }, weapons = { diff --git a/units/Legion/SeaDefenses/legfmg.lua b/units/Legion/SeaDefenses/legfmg.lua index 63378058380..08fd608e5c8 100644 --- a/units/Legion/SeaDefenses/legfmg.lua +++ b/units/Legion/SeaDefenses/legfmg.lua @@ -29,7 +29,7 @@ return { waterline = 0, yardmap = "ooooooooo", customparams = { - unitgroup = 'weaponaa', + unitgroup = "weaponaa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, diff --git a/units/Legion/SeaDefenses/legfrl.lua b/units/Legion/SeaDefenses/legfrl.lua index 6081ae8ece9..9a850861bf9 100644 --- a/units/Legion/SeaDefenses/legfrl.lua +++ b/units/Legion/SeaDefenses/legfrl.lua @@ -38,8 +38,8 @@ return { dead = { blocking = false, category = "corpses", - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "26 52 26", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "26 52 26", collisionvolumetype = "Box", damage = 151, footprintx = 3, @@ -71,7 +71,7 @@ return { [1] = "kbarmsel", }, }, - weapondefs = { + weapondefs = { legrl_missile = { areaofeffect = 48, avoidfeature = false, diff --git a/units/Legion/SeaDefenses/legnavaldefturret.lua b/units/Legion/SeaDefenses/legnavaldefturret.lua index bca6d1b66b1..1f724a8a645 100644 --- a/units/Legion/SeaDefenses/legnavaldefturret.lua +++ b/units/Legion/SeaDefenses/legnavaldefturret.lua @@ -27,7 +27,7 @@ return { waterline = 0, yardmap = "ooooooooooooooooooooooooo", customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -88,8 +88,8 @@ return { craterareaofeffect = 0, craterboost = 0, cratermult = 0, - dance = 10, - flighttime = 5, + dance = 10, + flighttime = 5, edgeeffectiveness = 0.2, explosiongenerator = "custom:genericshellexplosion-medium", firestarter = 70, diff --git a/units/Legion/SeaEconomy/legtide.lua b/units/Legion/SeaEconomy/legtide.lua index c2ffaf41539..e174e37e695 100644 --- a/units/Legion/SeaEconomy/legtide.lua +++ b/units/Legion/SeaEconomy/legtide.lua @@ -30,7 +30,7 @@ return { waterline = 7, yardmap = "wwwwwwwww", customparams = { - unitgroup = 'energy', + unitgroup = "energy", model_author = "Mr Bob", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/SeaPlanes/legspcarrier.lua b/units/Legion/SeaPlanes/legspcarrier.lua index 379e1c59eb0..afb95714789 100644 --- a/units/Legion/SeaPlanes/legspcarrier.lua +++ b/units/Legion/SeaPlanes/legspcarrier.lua @@ -37,7 +37,7 @@ return { turnrate = 540, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/SeaPlanes", @@ -49,7 +49,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:barrelshot-small", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", @@ -77,10 +78,10 @@ return { avoidfeature = false, burnblow = true, canattackground = false, - avoidfriendly = false, + avoidfriendly = false, burst = 3, burstrate = 0.005, - collidefriendly = false, + collidefriendly = false, --sprayangle = 20000, dance = 150, cegtag = "missiletrailaa", @@ -115,7 +116,7 @@ return { tracks = true, turnrate = 68000, turret = true, - fixedlauncher = true; + fixedlauncher = true, weaponacceleration = 300, weapontimer = 2, weapontype = "MissileLauncher", @@ -157,24 +158,24 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1100, -- spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 15, --Spawnrate roughly in seconds. - maxunits = 2, --Will spawn units until this amount has been reached. + spawnrate = 15, --Spawnrate roughly in seconds. + maxunits = 2, --Will spawn units until this amount has been reached. startingdronecount = 1, - energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 4, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 24, docktohealthreshold = 66, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "11 13", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 2, stockpilemetal = 15, stockpileenergy = 500, diff --git a/units/Legion/SeaPlanes/legspfighter.lua b/units/Legion/SeaPlanes/legspfighter.lua index 2efa6f4b652..8d852010e2d 100644 --- a/units/Legion/SeaPlanes/legspfighter.lua +++ b/units/Legion/SeaPlanes/legspfighter.lua @@ -47,7 +47,8 @@ return { sfxtypes = { explosiongenerators = { [0] = "custom:barrelshot-tiny-aa", - }, }, + }, + }, sounds = { build = "nanlath1", canceldestruct = "cancel2", diff --git a/units/Legion/SeaPlanes/legspradarsonarplane.lua b/units/Legion/SeaPlanes/legspradarsonarplane.lua index 53c5677cbfc..28d5cecc5b1 100644 --- a/units/Legion/SeaPlanes/legspradarsonarplane.lua +++ b/units/Legion/SeaPlanes/legspradarsonarplane.lua @@ -46,7 +46,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:radarpulse_t2", - }, }, + }, + }, sounds = { build = "nanlath1", canceldestruct = "cancel2", diff --git a/units/Legion/SeaPlanes/legspsurfacegunship.lua b/units/Legion/SeaPlanes/legspsurfacegunship.lua index aef779055da..a08640be15f 100644 --- a/units/Legion/SeaPlanes/legspsurfacegunship.lua +++ b/units/Legion/SeaPlanes/legspsurfacegunship.lua @@ -37,7 +37,8 @@ return { sfxtypes = { explosiongenerators = { [0] = "custom:barrelshot-small", - }, }, + }, + }, sounds = { build = "nanlath1", canceldestruct = "cancel2", diff --git a/units/Legion/SeaPlanes/legsptorpgunship.lua b/units/Legion/SeaPlanes/legsptorpgunship.lua index 9fc7330b25c..40129d82b1b 100644 --- a/units/Legion/SeaPlanes/legsptorpgunship.lua +++ b/units/Legion/SeaPlanes/legsptorpgunship.lua @@ -37,7 +37,8 @@ return { sfxtypes = { explosiongenerators = { [0] = "custom:barrelshot-tiny", - }, }, + }, + }, sounds = { build = "nanlath1", canceldestruct = "cancel2", diff --git a/units/Legion/Ships/T2/leganavyaaship.lua b/units/Legion/Ships/T2/leganavyaaship.lua index 2237b7c5716..19c43e396dc 100644 --- a/units/Legion/Ships/T2/leganavyaaship.lua +++ b/units/Legion/Ships/T2/leganavyaaship.lua @@ -75,7 +75,7 @@ return { [1] = "custom:barrelshot-flak", [2] = "custom:waterwake-medium", [3] = "custom:bowsplash-medium", - [4] = "custom:barrelshot-tiny-aa", + [4] = "custom:barrelshot-tiny-aa", }, }, sounds = { @@ -105,10 +105,10 @@ return { avoidfeature = false, burnblow = true, canattackground = false, - avoidfriendly = false, + avoidfriendly = false, burst = 3, burstrate = 0.005, - collidefriendly = false, + collidefriendly = false, --sprayangle = 20000, dance = 150, cegtag = "missiletrailaa", @@ -143,7 +143,7 @@ return { tracks = true, turnrate = 68000, turret = true, - fixedlauncher = true; + fixedlauncher = true, weaponacceleration = 300, weapontimer = 2, weapontype = "MissileLauncher", @@ -155,7 +155,7 @@ return { leg_t2_microflak_mobile = { accuracy = 1000, areaofeffect = 35, - burst = 3, + burst = 3, burstrate = 0.02, avoidfeature = false, burnblow = true, diff --git a/units/Legion/Ships/T2/leganavyantinukecarrier.lua b/units/Legion/Ships/T2/leganavyantinukecarrier.lua index 19d63edeb3b..1b6da964d91 100644 --- a/units/Legion/Ships/T2/leganavyantinukecarrier.lua +++ b/units/Legion/Ships/T2/leganavyantinukecarrier.lua @@ -202,32 +202,32 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone",--"legdrone legheavydronesmall", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --"legdrone legheavydronesmall", --Name of the unit spawned by this carrier unit. engagementrange = 1350, -- spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 7, --Spawnrate roughly in seconds. - maxunits = 6,--"6 1", --Will spawn units until this amount has been reached. - startingdronecount = 3,--"0 0", - energycost = 500,--"500 1000", --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15,--"15 90", --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + spawnrate = 7, --Spawnrate roughly in seconds. + maxunits = 6, --"6 1", --Will spawn units until this amount has been reached. + startingdronecount = 3, --"0 0", + energycost = 500, --"500 1000", --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --"15 90", --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1200, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 20, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 30, docktohealthreshold = 75, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "16 17 18 19 20 21", --"16 17 18 19 20 , 21", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. -- stockpilelimit = 6, -- stockpilemetal = 15, -- stockpileenergy = 500, -- dronesusestockpile = true, dronedocktime = 2, - droneairtime = 60,--"60 90", - droneammo = 12,--"9 0", - } + droneairtime = 60, --"60 90", + droneammo = 12, --"9 0", + }, }, }, weapons = { diff --git a/units/Legion/Ships/T2/leganavyantiswarm.lua b/units/Legion/Ships/T2/leganavyantiswarm.lua index 7752d11959a..83e6b0db6fd 100644 --- a/units/Legion/Ships/T2/leganavyantiswarm.lua +++ b/units/Legion/Ships/T2/leganavyantiswarm.lua @@ -139,7 +139,7 @@ return { }, customparams = { --exclude_preaim = true - } + }, }, light_antiair_missile = { areaofeffect = 16, diff --git a/units/Legion/Ships/T2/leganavyartyship.lua b/units/Legion/Ships/T2/leganavyartyship.lua index 77155b7479b..d61564b3c97 100644 --- a/units/Legion/Ships/T2/leganavyartyship.lua +++ b/units/Legion/Ships/T2/leganavyartyship.lua @@ -138,7 +138,7 @@ return { weapontype = "Cannon", weaponvelocity = 600, customparams = { - cluster_def = 'cluster_munition_main', + cluster_def = "cluster_munition_main", cluster_number = 5, }, damage = { @@ -178,9 +178,9 @@ return { areaofeffect = 120, avoidfeature = false, avoidneutral = true, - avoidfriendly = false, + avoidfriendly = false, cegtag = "starfire_tiny", - collidefriendly = false, + collidefriendly = false, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.4, @@ -199,7 +199,7 @@ return { weapontype = "Cannon", weaponvelocity = 500, customparams = { - cluster_def = 'cluster_munition_secondary', + cluster_def = "cluster_munition_secondary", cluster_number = 4, }, damage = { @@ -249,13 +249,13 @@ return { }, [3] = { def = "leg_mobile_cluster_plasma", - maindir = "0.259 0 0.966", -- rightcannon, needs to calculate from 35 degrees to the right + maindir = "0.259 0 0.966", -- rightcannon, needs to calculate from 35 degrees to the right maxangledif = 320, onlytargetcategory = "SURFACE", }, [4] = { def = "leg_mobile_cluster_plasma", - maindir = "-0.174 0 0.985", -- leftcannon2, needs to calculate from 15 degrees to the left + maindir = "-0.174 0 0.985", -- leftcannon2, needs to calculate from 15 degrees to the left maxangledif = 330, onlytargetcategory = "SURFACE", }, diff --git a/units/Legion/Ships/T2/leganavybattleship.lua b/units/Legion/Ships/T2/leganavybattleship.lua index 804a87c4903..7dfa91d1426 100644 --- a/units/Legion/Ships/T2/leganavybattleship.lua +++ b/units/Legion/Ships/T2/leganavybattleship.lua @@ -196,7 +196,7 @@ return { thickness = 2.0, tolerance = 6000, turret = true, - cylindertargeting=true, + cylindertargeting = true, weapontype = "LaserCannon", weaponvelocity = 800, customparams = { diff --git a/units/Legion/Ships/T2/leganavybattlesub.lua b/units/Legion/Ships/T2/leganavybattlesub.lua index 9da711e3a29..6008a4aa37b 100644 --- a/units/Legion/Ships/T2/leganavybattlesub.lua +++ b/units/Legion/Ships/T2/leganavybattlesub.lua @@ -103,8 +103,8 @@ return { avoidfeature = false, avoidfriendly = false, burnblow = true, - burst = 3; - burstrate = 0.33; + burst = 3, + burstrate = 0.33, cegtag = "torpedotrail-small", collidefriendly = false, craterareaofeffect = 0, diff --git a/units/Legion/Ships/T2/leganavycruiser.lua b/units/Legion/Ships/T2/leganavycruiser.lua index 55c58547417..f0d8f1b5106 100644 --- a/units/Legion/Ships/T2/leganavycruiser.lua +++ b/units/Legion/Ships/T2/leganavycruiser.lua @@ -129,7 +129,7 @@ return { sprayangle = 1900, thickness = 0.6, tolerance = 6000, - firetolerance = 6000, + firetolerance = 6000, turret = true, weapontype = "LaserCannon", weaponvelocity = 969, diff --git a/units/Legion/Ships/T2/leganavyflagship.lua b/units/Legion/Ships/T2/leganavyflagship.lua index 4ae656f88eb..a34ce431a4a 100644 --- a/units/Legion/Ships/T2/leganavyflagship.lua +++ b/units/Legion/Ships/T2/leganavyflagship.lua @@ -157,7 +157,7 @@ return { predictboost = 0, proximitypriority = 1, range = 700, - reloadtime = .033, + reloadtime = 0.033, rgbcolor = "1 0.3 0", rgbcolor2 = "1 0.8 0.5", soundhitdry = "flamhit1", diff --git a/units/Legion/Ships/T2/leganavymissileship.lua b/units/Legion/Ships/T2/leganavymissileship.lua index 351679dddc3..48fe38cf2cf 100644 --- a/units/Legion/Ships/T2/leganavymissileship.lua +++ b/units/Legion/Ships/T2/leganavymissileship.lua @@ -102,10 +102,10 @@ return { avoidfeature = false, burnblow = true, canattackground = false, - avoidfriendly = false, + avoidfriendly = false, burst = 3, burstrate = 0.005, - collidefriendly = false, + collidefriendly = false, dance = 150, cegtag = "missiletrailaa", craterareaofeffect = 0, @@ -139,7 +139,7 @@ return { tracks = true, turnrate = 68000, turret = true, - fixedlauncher = true; + fixedlauncher = true, weaponacceleration = 300, weapontimer = 2, weapontype = "MissileLauncher", diff --git a/units/Legion/Ships/legnavyaaship.lua b/units/Legion/Ships/legnavyaaship.lua index a0106716c48..ecf81770510 100644 --- a/units/Legion/Ships/legnavyaaship.lua +++ b/units/Legion/Ships/legnavyaaship.lua @@ -36,7 +36,7 @@ return { turnrate = 450, waterline = 0, customparams = { - unitgroup = 'aa', + unitgroup = "aa", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Ships", diff --git a/units/Legion/Ships/legnavyartyship.lua b/units/Legion/Ships/legnavyartyship.lua index bcfc0be6b8d..016c390dd56 100644 --- a/units/Legion/Ships/legnavyartyship.lua +++ b/units/Legion/Ships/legnavyartyship.lua @@ -33,7 +33,7 @@ return { turnrate = 150, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Johnathan Crimson (Concept Art/Model), ZephyrSkies (Model)", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Ships", @@ -42,8 +42,8 @@ return { dead = { blocking = false, category = "corpses", - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "35 30 102", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "35 30 102", collisionvolumetype = "Box", damage = 3360, featuredead = "HEAP", @@ -120,7 +120,7 @@ return { weapontype = "Cannon", weaponvelocity = 380, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 5, }, damage = { @@ -152,7 +152,7 @@ return { weapontype = "Cannon", weaponvelocity = 380, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 5, }, damage = { @@ -160,7 +160,7 @@ return { subs = 50, vtol = 50, }, - }, + }, cluster_munition = { areaofeffect = 115, avoidfeature = false, @@ -202,7 +202,6 @@ return { -- maxangledif = 310, onlytargetcategory = "SURFACE", }, - }, }, } diff --git a/units/Legion/Ships/legnavydestro.lua b/units/Legion/Ships/legnavydestro.lua index 48924780416..db6f907540f 100644 --- a/units/Legion/Ships/legnavydestro.lua +++ b/units/Legion/Ships/legnavydestro.lua @@ -33,7 +33,7 @@ return { turnrate = 280, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", customrange = 700, model_author = "Phill-Art (Concept Art), ZephyrSkies (Model)", normaltex = "unittextures/leg_normal.dds", @@ -161,7 +161,7 @@ return { noselfdamage = true, metalpershot = 15, energypershot = 500, - range = 700,--1000, + range = 700, --1000, reloadtime = 2.5, size = 0, soundhit = "", @@ -176,24 +176,24 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1000, - spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 20, --Spawnrate roughly in seconds. - maxunits = 2, --Will spawn units until this amount has been reached. + spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 20, --Spawnrate roughly in seconds. + maxunits = 2, --Will spawn units until this amount has been reached. startingdronecount = 1, - energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 20, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 20, docktohealthreshold = 75, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "7 9", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 2, stockpilemetal = 15, stockpileenergy = 500, @@ -203,10 +203,8 @@ return { dronedocktime = 3, droneairtime = 60, droneammo = 12, - } + }, }, - - }, weapons = { [1] = { @@ -216,13 +214,12 @@ return { fastautoretargeting = true, burstControlWhenOutOfArc = 2, }, - + [2] = { badtargetcategory = "VTOL", def = "drone_control_matrix", onlytargetcategory = "SURFACE", }, - }, }, } diff --git a/units/Legion/Ships/legnavyfrigate.lua b/units/Legion/Ships/legnavyfrigate.lua index a18c15d8cc6..b545ad3086c 100644 --- a/units/Legion/Ships/legnavyfrigate.lua +++ b/units/Legion/Ships/legnavyfrigate.lua @@ -34,7 +34,7 @@ return { turnrate = 300, waterline = 0, customparams = { - unitgroup = 'weaponsub', + unitgroup = "weaponsub", model_author = "EnderRobo (Model), Phill-Arts (Concept Art)", normaltex = "unittextures/leg_normal.dds", paralyzemultiplier = 0.5, diff --git a/units/Legion/Ships/legnavyscout.lua b/units/Legion/Ships/legnavyscout.lua index f2121b3a19c..3a07e169b2b 100644 --- a/units/Legion/Ships/legnavyscout.lua +++ b/units/Legion/Ships/legnavyscout.lua @@ -31,7 +31,7 @@ return { turnrate = 430, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies (Model), Phill-Art (Concept Art)", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Ships", @@ -40,8 +40,8 @@ return { dead = { blocking = false, category = "corpses", - collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "20 16 41", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "20 16 41", collisionvolumetype = "Box", damage = 300, featuredead = "HEAP", @@ -140,7 +140,7 @@ return { }, weapons = { [1] = { - badtargetcategory="vtol", + badtargetcategory = "vtol", def = "mg_guns", onlytargetcategory = "NOTSUB", }, diff --git a/units/Legion/T3/leegmech.lua b/units/Legion/T3/leegmech.lua index 44f8af6de6e..3fa4d4f0090 100644 --- a/units/Legion/T3/leegmech.lua +++ b/units/Legion/T3/leegmech.lua @@ -34,7 +34,7 @@ return { turnrate = 450, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", customrange = 400, model_author = "Kremenchuk", normaltex = "unittextures/leegmech_normal.dds", diff --git a/units/Legion/T3/legbunk.lua b/units/Legion/T3/legbunk.lua index 47096699b16..2c38a8895ad 100644 --- a/units/Legion/T3/legbunk.lua +++ b/units/Legion/T3/legbunk.lua @@ -35,7 +35,7 @@ return { upright = true, customparams = { maxrange = "10", - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Johanthan Crimson, Tuerk", normaltex = "unittextures/leg_normal.dds", subfolder = "leggantry", diff --git a/units/Legion/T3/legeallterrainmech.lua b/units/Legion/T3/legeallterrainmech.lua index 916a1d07a30..757a6e290d4 100644 --- a/units/Legion/T3/legeallterrainmech.lua +++ b/units/Legion/T3/legeallterrainmech.lua @@ -35,7 +35,7 @@ return { turnrate = 265.64999, customparams = { model_author = "ZephyrSkies (model), Johnathan Crimson, Darth Mikey, Protar (Concept Art)", - maxrange = "1300", + maxrange = "1300", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/T3", techlevel = 3, @@ -109,9 +109,9 @@ return { areaofeffect = 120, avoidfeature = false, avoidneutral = true, - avoidfriendly = false, + avoidfriendly = false, cegtag = "starfire_arty", - collidefriendly = false, + collidefriendly = false, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.4, @@ -130,7 +130,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 7, exclude_preaim = true, smart_priority = true, @@ -173,9 +173,9 @@ return { areaofeffect = 120, avoidfeature = false, avoidneutral = true, - avoidfriendly = false, + avoidfriendly = false, cegtag = "starfire_arty", - collidefriendly = false, + collidefriendly = false, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.4, @@ -195,7 +195,7 @@ return { weapontype = "Cannon", weaponvelocity = 450, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 7, exclude_preaim = true, smart_backup = true, @@ -213,7 +213,7 @@ return { areaofeffect = 120, avoidfeature = false, cegtag = "starfire_arty", - collidefriendly = false, + collidefriendly = false, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.4, @@ -237,14 +237,14 @@ return { smart_trajectory_checker = true, }, damage = { - default = 0 + default = 0, }, }, drone_controller = { areaofeffect = 4, avoidfeature = false, craterareaofeffect = 0, - collidefriendly = false, + collidefriendly = false, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.15, @@ -271,24 +271,24 @@ return { default = 0, }, customparams = { - carried_unit = "legheavydronesmall", --Name of the unit spawned by this carrier unit. + carried_unit = "legheavydronesmall", --Name of the unit spawned by this carrier unit. engagementrange = 1600, - spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 12, --Spawnrate roughly in seconds. - maxunits = 2, --Will spawn units until this amount has been reached. + spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 12, --Spawnrate roughly in seconds. + maxunits = 2, --Will spawn units until this amount has been reached. startingdronecount = 0, - energycost = 1000, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 90, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1500, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 1000, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 90, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1500, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 50, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 256, docktohealthreshold = 33, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "32 33", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 2, stockpilemetal = 90, stockpileenergy = 1000, @@ -302,10 +302,10 @@ return { avoidfeature = false, burnblow = true, canattackground = false, - avoidfriendly = false, + avoidfriendly = false, burst = 3, burstrate = 0.005, - collidefriendly = false, + collidefriendly = false, --sprayangle = 20000, dance = 150, cegtag = "missiletrailaa", @@ -340,7 +340,7 @@ return { tracks = true, turnrate = 68000, turret = true, - fixedlauncher = true; + fixedlauncher = true, weaponacceleration = 300, weapontimer = 2, weapontype = "MissileLauncher", @@ -369,12 +369,12 @@ return { def = "smart_trajectory_dummy", onlytargetcategory = "SURFACE", }, - [5] = { + [5] = { badtargetcategory = "VTOL", def = "drone_controller", onlytargetcategory = "NOTSUB", - }, - [4] = { + }, + [4] = { badtargetcategory = "SURFACE LIGHTAIRSCOUT", def = "light_antiair_missile", onlytargetcategory = "VTOL", diff --git a/units/Legion/T3/legeheatraymech.lua b/units/Legion/T3/legeheatraymech.lua index c366342aee2..6bfbc585933 100644 --- a/units/Legion/T3/legeheatraymech.lua +++ b/units/Legion/T3/legeheatraymech.lua @@ -160,7 +160,7 @@ return { predictboost = 0, --proximitypriority = -1, range = 800, - reloadtime = .033, + reloadtime = 0.033, rgbcolor = "1 0.3 0", rgbcolor2 = "1 0.8 0.5", soundhitdry = "flamhit1", diff --git a/units/Legion/T3/legeheatraymech_old.lua b/units/Legion/T3/legeheatraymech_old.lua index d722b9e8e91..68dc5390340 100644 --- a/units/Legion/T3/legeheatraymech_old.lua +++ b/units/Legion/T3/legeheatraymech_old.lua @@ -160,7 +160,7 @@ return { predictboost = 0, --proximitypriority = -1, range = 800, - reloadtime = .033, + reloadtime = 0.033, rgbcolor = "1 0.3 0", rgbcolor2 = "1 0.8 0.5", soundhitdry = "flamhit1", @@ -282,7 +282,7 @@ return { noselfdamage = true, predictboost = 1, range = 700, - reloadtime = 0.9,--1.8, + reloadtime = 0.9, --1.8, soundhit = "flakhit2", soundhitwet = "splslrg", soundstart = "flakfire", diff --git a/units/Legion/T3/legehovertank.lua b/units/Legion/T3/legehovertank.lua index 6a0a4e70ac9..335ea4c36ee 100644 --- a/units/Legion/T3/legehovertank.lua +++ b/units/Legion/T3/legehovertank.lua @@ -4,9 +4,9 @@ return { builder = false, buildpic = "legehovertank.DDS", buildtime = 41600, - collisionvolumescales = "63 32 63", - collisionvolumeoffsets = "0 -15 0", - collisionvolumetype = "cylY", + collisionvolumescales = "63 32 63", + collisionvolumeoffsets = "0 -15 0", + collisionvolumetype = "cylY", usepiececollisionvolumes = 1, canattack = true, canguard = true, @@ -20,8 +20,8 @@ return { footprintx = 4, footprintz = 4, health = 4900, - maxacc = 0.022,--0.01788, - maxdec = 0.022,--0.01788, + maxacc = 0.022, --0.01788, + maxdec = 0.022, --0.01788, maxslope = 16, maxwaterdepth = 0, metalcost = 1350, @@ -33,11 +33,11 @@ return { selfdestructas = "largeExplosionGenericSelfd", sightdistance = 600, sonardistance = 550, - speed = 63,--47.5, + speed = 63, --47.5, turninplace = true, turninplaceanglelimit = 90, turninplacespeedlimit = 1.122, - turnrate = 300,--200, + turnrate = 300, --200, customparams = { model_author = "Gabs/ShadowsAIT & ZephyrSkies (Model), Protar (Concept Art)", normaltex = "unittextures/leg_normal.dds", @@ -50,8 +50,8 @@ return { blocking = true, category = "corpses", damage = 7000, - collisionvolumescales = "63 22 62", - collisionvolumetype = "cylY", + collisionvolumescales = "63 22 62", + collisionvolumetype = "cylY", featuredead = "heap", footprintx = 4, footprintz = 4, @@ -144,8 +144,8 @@ return { vtol = 7, }, customparams = { - sweepfire=9,--multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs - } + sweepfire = 9, --multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs + }, }, depthcharge = { areaofeffect = 24, @@ -204,7 +204,7 @@ return { model = "legsmallrocket.s3o", name = "Parabolic Trajectory Multi-Rocket Launcher", noselfdamage = true, - proximitypriority = -1, + proximitypriority = -1, range = 500, reloadtime = 6, smokecolor = 0.5, diff --git a/units/Legion/T3/legelrpcmech.lua b/units/Legion/T3/legelrpcmech.lua index bc4e85d1fe2..4610b56045a 100644 --- a/units/Legion/T3/legelrpcmech.lua +++ b/units/Legion/T3/legelrpcmech.lua @@ -160,7 +160,7 @@ return { weapontype = "Cannon", weaponvelocity = 800, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 6, }, damage = { diff --git a/units/Legion/T3/legerailtank.lua b/units/Legion/T3/legerailtank.lua index 8c9b702affe..5801fd99f10 100644 --- a/units/Legion/T3/legerailtank.lua +++ b/units/Legion/T3/legerailtank.lua @@ -108,7 +108,7 @@ return { areaofeffect = 80, avoidfeature = false, burst = 1, - burstrate = 0.33, -- this is controlled in the animation script + burstrate = 0.33, -- this is controlled in the animation script burnblow = false, cegtag = "railgun", collisionSize = 0.667, diff --git a/units/Legion/T3/legeshotgunmech.lua b/units/Legion/T3/legeshotgunmech.lua index 317bc82620a..43d625b632e 100644 --- a/units/Legion/T3/legeshotgunmech.lua +++ b/units/Legion/T3/legeshotgunmech.lua @@ -33,7 +33,7 @@ return { turnrate = 600, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", maxrange = "315", model_author = "Ghoulish & ZephyrSkies", normaltex = "unittextures/leg_normal.dds", @@ -130,7 +130,7 @@ return { damage = { default = 0, }, - }, + }, shotgun = { accuracy = 7, areaofeffect = 16, @@ -161,7 +161,7 @@ return { sprayangle = 1400, thickness = 0.6, tolerance = 6000, - firetolerance = 6000, + firetolerance = 6000, turret = true, weapontype = "LaserCannon", weaponvelocity = 969, @@ -190,7 +190,7 @@ return { model = "legsmallrocket.s3o", name = "Parabolic Trajectory Multi-Rocket Launcher", noselfdamage = true, - proximitypriority = -1, + proximitypriority = -1, range = 700, reloadtime = 6, smokecolor = 0.5, @@ -231,7 +231,7 @@ return { leg_t2_microflak_mobile = { accuracy = 1000, areaofeffect = 35, - burst = 3, + burst = 3, burstrate = 0.02, avoidfeature = false, burnblow = true, @@ -284,13 +284,13 @@ return { badtargetcategory = "VTOL", def = "SHOTGUN", onlytargetcategory = "SURFACE", - slaveto = 1; + slaveto = 1, }, [3] = { badtargetcategory = "VTOL", def = "adv_rocket", onlytargetcategory = "SURFACE", - slaveto = 1; + slaveto = 1, }, [4] = { badtargetcategory = "LIGHTAIRSCOUT", diff --git a/units/Legion/Utilities/legeyes.lua b/units/Legion/Utilities/legeyes.lua index 0b794ba7a3c..94acfac6c47 100644 --- a/units/Legion/Utilities/legeyes.lua +++ b/units/Legion/Utilities/legeyes.lua @@ -31,7 +31,7 @@ return { waterline = 5, yardmap = "o", customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "NebuchadnezzarII", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Utilities/legjam.lua b/units/Legion/Utilities/legjam.lua index 6b76a4f418e..72c72156d94 100644 --- a/units/Legion/Utilities/legjam.lua +++ b/units/Legion/Utilities/legjam.lua @@ -35,7 +35,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'util', + unitgroup = "util", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Utilities/legnanotc.lua b/units/Legion/Utilities/legnanotc.lua index 68514618611..84cc51f75fa 100644 --- a/units/Legion/Utilities/legnanotc.lua +++ b/units/Legion/Utilities/legnanotc.lua @@ -43,7 +43,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/LandUtil", diff --git a/units/Legion/Utilities/legnanotct2.lua b/units/Legion/Utilities/legnanotct2.lua index ced74553a8a..075ad251b09 100644 --- a/units/Legion/Utilities/legnanotct2.lua +++ b/units/Legion/Utilities/legnanotct2.lua @@ -43,7 +43,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/LandUtil", diff --git a/units/Legion/Utilities/legnanotct2plat.lua b/units/Legion/Utilities/legnanotct2plat.lua index 857426a5bc6..7f9409334cd 100644 --- a/units/Legion/Utilities/legnanotct2plat.lua +++ b/units/Legion/Utilities/legnanotct2plat.lua @@ -46,7 +46,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/LandUtil", diff --git a/units/Legion/Utilities/legrad.lua b/units/Legion/Utilities/legrad.lua index 7e3bbdba93e..604db3e7321 100644 --- a/units/Legion/Utilities/legrad.lua +++ b/units/Legion/Utilities/legrad.lua @@ -38,7 +38,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'util', + unitgroup = "util", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removestop = true, diff --git a/units/Legion/Vehicles/T2 Vehicles/legaheattank.lua b/units/Legion/Vehicles/T2 Vehicles/legaheattank.lua index 1f1f1c00805..dedfd065c93 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legaheattank.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legaheattank.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1.6104, turnrate = 300, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", @@ -145,8 +145,8 @@ return { vtol = 10, }, customparams = { - sweepfire=9,--multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs - } + sweepfire = 9, --multiplier for displayed dps during the 'bonus' sweepfire stage, needed for DPS calcs + }, }, }, weapons = { diff --git a/units/Legion/Vehicles/T2 Vehicles/legamcluster.lua b/units/Legion/Vehicles/T2 Vehicles/legamcluster.lua index dc8dc2c246d..236140170bf 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legamcluster.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legamcluster.lua @@ -37,7 +37,7 @@ return { turninplacespeedlimit = 1.15, turnrate = 180, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", canareaattack = 1, firingceg = "barrelshot-medium", @@ -130,7 +130,7 @@ return { weapontype = "Cannon", weaponvelocity = 345, customparams = { - cluster_def = 'cluster_munition', + cluster_def = "cluster_munition", cluster_number = 5, }, damage = { diff --git a/units/Legion/Vehicles/T2 Vehicles/legaskirmtank.lua b/units/Legion/Vehicles/T2 Vehicles/legaskirmtank.lua index 8a4bc1e4073..84beac2260f 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legaskirmtank.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legaskirmtank.lua @@ -16,9 +16,9 @@ return { footprintx = 3, footprintz = 3, leavetracks = true, - health = 2500,--3900, + health = 2500, --3900, maxslope = 12, - speed = 65,--90, + speed = 65, --90, maxwaterdepth = 15, movementclass = "MTANK3", nochasecategory = "VTOL", @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1.72656, turnrate = 450, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", @@ -110,7 +110,7 @@ return { burstrate = 0.2, burst = 3, sprayangle = 600, - --accuracy = 100, + --accuracy = 100, areaofeffect = 64, avoidfeature = false, burnblow = true, diff --git a/units/Legion/Vehicles/T2 Vehicles/leginf.lua b/units/Legion/Vehicles/T2 Vehicles/leginf.lua index 5255b25ef65..e074a624f5b 100644 --- a/units/Legion/Vehicles/T2 Vehicles/leginf.lua +++ b/units/Legion/Vehicles/T2 Vehicles/leginf.lua @@ -38,7 +38,7 @@ return { turninplacespeedlimit = 0.95832, turnrate = 169.39999, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies (model), Phill-Art (concept art)", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/Vehicles/T2 Vehicles", diff --git a/units/Legion/Vehicles/T2 Vehicles/legmed.lua b/units/Legion/Vehicles/T2 Vehicles/legmed.lua index cfd21f441c5..73a4c1e4db6 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legmed.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legmed.lua @@ -35,7 +35,7 @@ return { turninplacespeedlimit = 0.792, turnrate = 220, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies, EnderRobo", normaltex = "unittextures/leg_normal.dds", techlevel = 2, diff --git a/units/Legion/Vehicles/T2 Vehicles/legmrv.lua b/units/Legion/Vehicles/T2 Vehicles/legmrv.lua index 592bbec9b45..c9bd9a4df4e 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legmrv.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legmrv.lua @@ -35,7 +35,7 @@ return { turninplacespeedlimit = 1.72656, turnrate = 600, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", @@ -141,7 +141,6 @@ return { def = "QUICKSHOT_CANNON", onlytargetcategory = "SURFACE", burstControlWhenOutOfArc = 2, - }, }, }, diff --git a/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua b/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua index e93997280f9..14d3b165101 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua @@ -1,5 +1,5 @@ return { - legvcarry = { + legvcarry = { maxacc = 0.02, maxdec = 0.1, energycost = 9000, @@ -48,7 +48,7 @@ return { restrictions_inclusion = "_noair_", subfolder = "Legion/Vehicles/T2 Vehicles", techlevel = 2, - unitgroup = 'weapon', + unitgroup = "weapon", weapon1turretx = 45, weapon1turrety = 80, }, @@ -140,24 +140,24 @@ return { default = 0, }, customparams = { - carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "legdrone", --Name of the unit spawned by this carrier unit. engagementrange = 1050, - spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 10, --Spawnrate roughly in seconds. - maxunits = 6, --Will spawn units until this amount has been reached. + spawns_surface = "LAND", -- "LAND" or "SEA". The SEA option has not been tested currently. + spawnrate = 10, --Spawnrate roughly in seconds. + maxunits = 6, --Will spawn units until this amount has been reached. startingdronecount = 3, - energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 500, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 15, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 900, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. deathdecayrate = 20, carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 20, docktohealthreshold = 75, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "8 10 12 14 16 18", - dockingradius = 80, --The range at which the units snap to the carrier unit when docking. + dockingradius = 80, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 6, stockpilemetal = 15, stockpileenergy = 500, @@ -167,7 +167,7 @@ return { droneairtime = 60, dronedocktime = 3, droneammo = 12, - } + }, }, }, weapons = { diff --git a/units/Legion/Vehicles/T2 Vehicles/legvflak.lua b/units/Legion/Vehicles/T2 Vehicles/legvflak.lua index 38db8000d72..d9a7148901e 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legvflak.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legvflak.lua @@ -104,7 +104,7 @@ return { leg_t2_microflak_mobile = { accuracy = 1000, areaofeffect = 35, - burst = 3, + burst = 3, burstrate = 0.02, avoidfeature = false, burnblow = true, diff --git a/units/Legion/Vehicles/legamphtank.lua b/units/Legion/Vehicles/legamphtank.lua index cb994443034..3dadfb46b2f 100644 --- a/units/Legion/Vehicles/legamphtank.lua +++ b/units/Legion/Vehicles/legamphtank.lua @@ -38,7 +38,7 @@ return { turninplacespeedlimit = 1.485, turnrate = 398, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-small", kickback = "-2.7", diff --git a/units/Legion/Vehicles/legbar.lua b/units/Legion/Vehicles/legbar.lua index a923055e7f2..38a0b4a8622 100644 --- a/units/Legion/Vehicles/legbar.lua +++ b/units/Legion/Vehicles/legbar.lua @@ -3,7 +3,7 @@ return { maxacc = 0.01654, maxdec = 0.1, energycost = 3200, - metalcost = 250,--320, + metalcost = 250, --320, buildpic = "LEGBAR.DDS", buildtime = 3600, canmove = true, @@ -41,7 +41,7 @@ return { buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, buildinggrounddecalalpha = 0.5, - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", @@ -130,13 +130,13 @@ return { noselfdamage = true, projectiles = 1, range = 535, - reloadtime = 5,--2.5, + reloadtime = 5, --2.5, rgbcolor = "1 0.25 0.1", size = 6, soundhitdry = "flamhit1", soundhitwet = "sizzle", soundstart = "cannhvy2", - sprayangle = 600,--2400, + sprayangle = 600, --2400, turret = true, weapontype = "Cannon", weaponvelocity = 250, @@ -144,7 +144,7 @@ return { area_onhit_ceg = "fire-area-60-repeat", area_onhit_damageCeg = "burnflamel-gen", area_onhit_resistance = "fire", - area_onhit_damage = 60,--30, + area_onhit_damage = 60, --30, area_onhit_range = 60, area_onhit_time = 7, water_splash = 0, diff --git a/units/Legion/Vehicles/leggat.lua b/units/Legion/Vehicles/leggat.lua index b56b658a958..68f8edc5a64 100644 --- a/units/Legion/Vehicles/leggat.lua +++ b/units/Legion/Vehicles/leggat.lua @@ -1,5 +1,5 @@ return { - leggat = { + leggat = { maxacc = 0.02, maxdec = 0.1, energycost = 3600, @@ -37,7 +37,7 @@ return { turninplacespeedlimit = 1.952, turnrate = 300, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-small", kickback = "-2.4", diff --git a/units/Legion/Vehicles/leghades.lua b/units/Legion/Vehicles/leghades.lua index a02efd93915..92078060c4f 100644 --- a/units/Legion/Vehicles/leghades.lua +++ b/units/Legion/Vehicles/leghades.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 2.424, turnrate = 544, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-tiny", kickback = "-2", diff --git a/units/Legion/Vehicles/leghelios.lua b/units/Legion/Vehicles/leghelios.lua index 5e56c040029..b97bc6c344e 100644 --- a/units/Legion/Vehicles/leghelios.lua +++ b/units/Legion/Vehicles/leghelios.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1.96, turnrate = 400, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", cannon1name = "barrel", driftratio = "0.6", diff --git a/units/Legion/Vehicles/legrail.lua b/units/Legion/Vehicles/legrail.lua index f8ec62179d8..b83d276f45d 100644 --- a/units/Legion/Vehicles/legrail.lua +++ b/units/Legion/Vehicles/legrail.lua @@ -38,7 +38,7 @@ return { usepiececollisionvolumes = 1, customparams = { maxrange = 625, - unitgroup = 'weaponaa', + unitgroup = "weaponaa", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmVehicles", diff --git a/units/Legion/Vehicles/legscout.lua b/units/Legion/Vehicles/legscout.lua index 0a1ed2cdf73..e7dc7ae0ab9 100644 --- a/units/Legion/Vehicles/legscout.lua +++ b/units/Legion/Vehicles/legscout.lua @@ -37,7 +37,7 @@ return { turninplacespeedlimit = 4.224, turnrate = 750, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "body", firingceg = "barrelshot-small", kickback = "0", diff --git a/units/Legion/legcom.lua b/units/Legion/legcom.lua index d54add5d4eb..d0d0194e5f6 100644 --- a/units/Legion/legcom.lua +++ b/units/Legion/legcom.lua @@ -28,7 +28,7 @@ return { footprintx = 3, footprintz = 3, hidedamage = true, - holdsteady = true, + holdsteady = true, sightemitheight = 40, health = 3700, maxslope = 20, @@ -44,7 +44,7 @@ return { radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/legcom.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -87,7 +87,7 @@ return { [27] = "legfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", combatradius = 600, firestateoncloak = 0, maxrange = 300, @@ -110,7 +110,7 @@ return { footprintz = 2, height = 20, metal = 1250, - object = 'Units/legcom_dead.s3o', + object = "Units/legcom_dead.s3o", reclaimable = true, }, heap = { @@ -348,7 +348,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "disintegrator", diff --git a/units/Scavengers/Air/armfepocht4.lua b/units/Scavengers/Air/armfepocht4.lua index dddd6a9fa94..a7e14f076bf 100644 --- a/units/Scavengers/Air/armfepocht4.lua +++ b/units/Scavengers/Air/armfepocht4.lua @@ -40,7 +40,7 @@ return { turnrate = 135, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0, diff --git a/units/Scavengers/Air/armfify.lua b/units/Scavengers/Air/armfify.lua index 839e4b0b7a1..2b02cc702ef 100644 --- a/units/Scavengers/Air/armfify.lua +++ b/units/Scavengers/Air/armfify.lua @@ -4,13 +4,13 @@ return { buildpic = "ARMFIFY.DDS", builddistance = 150, builder = true, - buildtime = 3800, + buildtime = 3800, canfly = true, canmove = true, - canassist = false, - canrepair = true, - canrestore = true, - canresurrect = true, + canassist = false, + canrepair = true, + canrestore = true, + canresurrect = true, cantbetransported = false, collide = true, cruisealtitude = 78, @@ -32,12 +32,12 @@ return { selfdestructas = "tinyExplosionGenericSelfd", sightdistance = 364, speed = 208, - stealth = true, + stealth = true, turninplaceanglelimit = 360, turnrate = 1100, upright = true, usesmoothmesh = 0, - workertime = 75, + workertime = 75, customparams = { model_author = "Darknagura, Fritman", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Air/armlichet4.lua b/units/Scavengers/Air/armlichet4.lua index c114833d1d4..209d386d09d 100644 --- a/units/Scavengers/Air/armlichet4.lua +++ b/units/Scavengers/Air/armlichet4.lua @@ -40,7 +40,7 @@ return { wingangle = 0.062, wingdrag = 0.135, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", lumamult = "1.7", model_author = "Flaka", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Air/armminebomber.lua b/units/Scavengers/Air/armminebomber.lua index 8b0aba40565..48f8f86fae9 100644 --- a/units/Scavengers/Air/armminebomber.lua +++ b/units/Scavengers/Air/armminebomber.lua @@ -37,7 +37,7 @@ return { wingangle = 0.06315, wingdrag = 0.135, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmAircraft", diff --git a/units/Scavengers/Air/armthundt4.lua b/units/Scavengers/Air/armthundt4.lua index 480a00b7f20..d702cd2a27e 100644 --- a/units/Scavengers/Air/armthundt4.lua +++ b/units/Scavengers/Air/armthundt4.lua @@ -38,7 +38,7 @@ return { wingangle = 0.045, wingdrag = 0.135, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmAircraft", diff --git a/units/Scavengers/Air/corcrw.lua b/units/Scavengers/Air/corcrw.lua index e9698002691..19c1a5a8fcd 100644 --- a/units/Scavengers/Air/corcrw.lua +++ b/units/Scavengers/Air/corcrw.lua @@ -34,7 +34,7 @@ return { turnrate = 300, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "CorAircraft/T2", diff --git a/units/Scavengers/Air/corcrwt4.lua b/units/Scavengers/Air/corcrwt4.lua index 569c966f89d..077f98717e8 100644 --- a/units/Scavengers/Air/corcrwt4.lua +++ b/units/Scavengers/Air/corcrwt4.lua @@ -36,7 +36,7 @@ return { upright = true, customparams = { maxrange = "450", - unitgroup = 'aa', + unitgroup = "aa", model_author = "Mr Bob, Hornet", normaltex = "unittextures/cor_normal.dds", subfolder = "other/scavengers", @@ -111,7 +111,7 @@ return { damage = { default = 40, subs = 10, - } + }, }, edragon_missile = { @@ -251,7 +251,7 @@ return { def = "kmaw", onlytargetcategory = "SURFACE", maindir = "0 -1 1", - maxangledif = 180, + maxangledif = 180, }, [2] = { def = "edragon_missile", @@ -263,25 +263,25 @@ return { def = "KROWBOSSLASER", onlytargetcategory = "SURFACE", maindir = "1 -1 0", - maxangledif = 180, + maxangledif = 180, }, [4] = { def = "KROWBOSSLASER", onlytargetcategory = "SURFACE", maindir = "1 -1 0", - maxangledif = 180, + maxangledif = 180, }, [5] = { def = "KROWBOSSLASER", onlytargetcategory = "SURFACE", maindir = "-1 -1 0", - maxangledif = 180, + maxangledif = 180, }, [6] = { def = "KROWBOSSLASER", onlytargetcategory = "SURFACE", maindir = "-1 -1 0", - maxangledif = 180, + maxangledif = 180, }, }, }, diff --git a/units/Scavengers/Air/cordronecarryair.lua b/units/Scavengers/Air/cordronecarryair.lua index 26370025ff5..c47835b2ef6 100644 --- a/units/Scavengers/Air/cordronecarryair.lua +++ b/units/Scavengers/Air/cordronecarryair.lua @@ -117,7 +117,7 @@ return { craterboost = 0, cratermult = 0, edgeeffectiveness = 0.15, - explosiongenerator = "",--"custom:genericshellexplosion-medium", + explosiongenerator = "", --"custom:genericshellexplosion-medium", gravityaffected = "true", hightrajectory = 1, impulsefactor = 0.123, @@ -128,9 +128,9 @@ return { range = 1200, reloadtime = 2.5, size = 0, - soundhit = "",--"xplomed2", - soundhitwet = "",--"splssml", - soundstart = "",--"cannhvy1", + soundhit = "", --"xplomed2", + soundhitwet = "", --"splssml", + soundstart = "", --"cannhvy1", stockpile = true, stockpiletime = 6, turret = true, @@ -140,34 +140,34 @@ return { default = 0, }, customparams = { - carried_unit = "cordrone", --Name of the unit spawned by this carrier unit. + carried_unit = "cordrone", --Name of the unit spawned by this carrier unit. -- carried_unit2... Currently not implemented, but planned. engagementrange = 1300, --spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 6, --Spawnrate roughly in seconds. - maxunits = 10, --Will spawn units until this amount has been reached. + spawnrate = 6, --Spawnrate roughly in seconds. + maxunits = 10, --Will spawn units until this amount has been reached. startingdronecount = 5, - energycost = 1000,--650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 40,--29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1100, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 1000, --650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 40, --29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1100, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 9, - attackformationspread = 200, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 200, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 36, docktohealthreshold = 50, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "9 10 11 12 13 14 15 16 17 18 19", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 10, stockpilemetal = 40, stockpileenergy = 1000, dronesusestockpile = true, dronedocktime = 2, droneairtime = 30, - } + }, }, }, weapons = { diff --git a/units/Scavengers/Air/cords.lua b/units/Scavengers/Air/cords.lua index 77724dda0bc..a9edd24ff35 100644 --- a/units/Scavengers/Air/cords.lua +++ b/units/Scavengers/Air/cords.lua @@ -38,7 +38,7 @@ return { wingangle = 0.16296, wingdrag = 0.145, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", subfolder = "Scavengers", diff --git a/units/Scavengers/Air/corfblackhyt4.lua b/units/Scavengers/Air/corfblackhyt4.lua index 2953cb0524c..c279a6a300c 100644 --- a/units/Scavengers/Air/corfblackhyt4.lua +++ b/units/Scavengers/Air/corfblackhyt4.lua @@ -39,7 +39,7 @@ return { turnrate = 129, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Beherith", normaltex = "unittextures/cor_normal.dds", paralyzemultiplier = 0, diff --git a/units/Scavengers/Air/legfortt4.lua b/units/Scavengers/Air/legfortt4.lua index 68ee345985c..33038523543 100644 --- a/units/Scavengers/Air/legfortt4.lua +++ b/units/Scavengers/Air/legfortt4.lua @@ -36,7 +36,7 @@ return { turnrate = 120, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "tHARSIS", normaltex = "unittextures/LEG_normal.dds", subfolder = "CorAircraft/T2", @@ -45,7 +45,8 @@ return { sfxtypes = { explosiongenerators = { [1] = "custom:barrelshot-small", - }, }, + }, + }, sounds = { canceldestruct = "cancel2", underattack = "warning1", @@ -101,7 +102,7 @@ return { customparams = { --isupgraded = isupgraded, --damagetype = "ehbotkarganneth", - noattackrangearc= 1, + noattackrangearc = 1, }, damage = { default = 50, diff --git a/units/Scavengers/Air/legmost3.lua b/units/Scavengers/Air/legmost3.lua index ae7e6687952..2cdf4f5fce3 100644 --- a/units/Scavengers/Air/legmost3.lua +++ b/units/Scavengers/Air/legmost3.lua @@ -28,7 +28,7 @@ return { turninplaceanglelimit = 360, turnrate = 500, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "ArmAircraft", diff --git a/units/Scavengers/Boss/armcomboss.lua b/units/Scavengers/Boss/armcomboss.lua index ae8cb002261..9fb03b3ea59 100644 --- a/units/Scavengers/Boss/armcomboss.lua +++ b/units/Scavengers/Boss/armcomboss.lua @@ -60,7 +60,7 @@ return { [2] = "corkorg", }, customparams = { - unitgroup = 'buildert4', + unitgroup = "buildert4", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.01, diff --git a/units/Scavengers/Boss/armscavengerbossv2.lua b/units/Scavengers/Boss/armscavengerbossv2.lua index 329b3031e8e..0d9d61d1bd9 100644 --- a/units/Scavengers/Boss/armscavengerbossv2.lua +++ b/units/Scavengers/Boss/armscavengerbossv2.lua @@ -53,7 +53,7 @@ for difficulty, stats in pairs(difficultyParams) do unitsTable["armscavengerbossv2_" .. difficulty] = { maxacc = 0.01, activatewhenbuilt = true, - autoheal = stats.autoHeal,--10, + autoheal = stats.autoHeal, --10, maxdec = 0.01, energycost = 5000000, metalcost = 500000, @@ -92,7 +92,7 @@ for difficulty, stats in pairs(difficultyParams) do radardistance = 500, radaremitheight = 54, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/scavboss/armscavengerbossv2.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -105,14 +105,14 @@ for difficulty, stats in pairs(difficultyParams) do turninplacespeedlimit = 0.825, turnrate = 300, upright = true, - workertime = 1500,--400, + workertime = 1500, --400, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.025, subfolder = "", - i18nfromunit = 'armscavengerbossv2' + i18nfromunit = "armscavengerbossv2", }, featuredefs = { dead = { @@ -186,42 +186,42 @@ for difficulty, stats in pairs(difficultyParams) do }, weapondefs = { machinegun = { - accuracy = 1024, - AreaOfEffect = 64, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = true, - beamTime = 0.09, - coreThickness = 0.5, - duration = 0.09, - explosionGenerator = "custom:genericshellexplosion-tiny-aa", - energypershot = 0, - fallOffRate = 0, - fireStarter = 50, - interceptedByShieldType = 4, - minintensity = "1", - name = "Scav Rapid Fire Plasma Gun", - range = 1200, - reloadtime = 0.1, - WeaponType = "LaserCannon", - rgbColor = {0.95, 0.32, 1}, - rgbColor2 = {1, 0.8, 1}, - soundTrigger = true, - soundstart = "tgunshipfire", - texture1 = "shot", - texture2 = "empty", - thickness = 20, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { + accuracy = 1024, + AreaOfEffect = 64, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = true, + beamTime = 0.09, + coreThickness = 0.5, + duration = 0.09, + explosionGenerator = "custom:genericshellexplosion-tiny-aa", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + minintensity = "1", + name = "Scav Rapid Fire Plasma Gun", + range = 1200, + reloadtime = 0.1, + WeaponType = "LaserCannon", + rgbColor = { 0.95, 0.32, 1 }, + rgbColor2 = { 1, 0.8, 1 }, + soundTrigger = true, + soundstart = "tgunshipfire", + texture1 = "shot", + texture2 = "empty", + thickness = 20, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { --isupgraded = isUpgraded, --damagetype = "ehbotkarganneth", }, - damage = { - default = stats.minigunDamage, - vtol = stats.minigunDamage*3, + damage = { + default = stats.minigunDamage, + vtol = stats.minigunDamage * 3, }, }, torpedo = { @@ -353,7 +353,7 @@ for difficulty, stats in pairs(difficultyParams) do [2] = { badtargetcategory = "VTOL", def = "TORPEDO", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { badtargetcategory = "VTOL", diff --git a/units/Scavengers/Boss/babyscavbossunits.lua b/units/Scavengers/Boss/babyscavbossunits.lua index 3eb316589ac..0b9331236bb 100644 --- a/units/Scavengers/Boss/babyscavbossunits.lua +++ b/units/Scavengers/Boss/babyscavbossunits.lua @@ -1,275 +1,274 @@ --special unit variations used for scavengerbossv4.lua local unitsTable = {} --Epic Pawn Squad -unitsTable['squadarmpwt4'] = VFS.Include('units/Scavengers/Bots/armpwt4.lua').armpwt4 --if this filepath is changed, the unit will no longer work! -unitsTable['squadarmpwt4'].selfdestructas = "" -unitsTable['squadarmpwt4'].movestate = 2 -unitsTable['squadarmpwt4'].customparams.i18nfromunit = 'armpwt4' -unitsTable['squadarmpwt4'].customparams.inheritxpratemultiplier = 1 -unitsTable['squadarmpwt4'].customparams.childreninheritxp = "DRONE" -unitsTable['squadarmpwt4'].customparams.parentsinheritxp = "DRONE" -unitsTable['squadarmpwt4'].weapondefs.dronespawner = { - areaofeffect = 4, - avoidfeature = false, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - explosiongenerator = "", - gravityaffected = "true", - hightrajectory = 1, - impulsefactor = 0.123, - name = "HeavyCannon", - noselfdamage = true, - range = 1200, - reloadtime = 2.5, - size = 0, - soundhit = "", - soundhitwet = "", - soundstart = "", - turret = true, - weapontype = "Cannon", - weaponvelocity = 360, - damage = { - default = 0, - }, - customparams = { - carried_unit = "squadarmpw", - engagementrange = 1200, - spawns_surface = "LAND", - spawnrate = 0.5, - maxunits = 20, - controlradius = 1300, - carrierdeaththroe = "death", - dockingarmor = 0.001, - dockinghealrate = 1000, - docktohealthreshold = 0, - dockingHelperSpeed = 5, - dockingpieces = "5 7 9 11", - dockingradius = 120, - holdfireradius = 300 - } +unitsTable["squadarmpwt4"] = VFS.Include("units/Scavengers/Bots/armpwt4.lua").armpwt4 --if this filepath is changed, the unit will no longer work! +unitsTable["squadarmpwt4"].selfdestructas = "" +unitsTable["squadarmpwt4"].movestate = 2 +unitsTable["squadarmpwt4"].customparams.i18nfromunit = "armpwt4" +unitsTable["squadarmpwt4"].customparams.inheritxpratemultiplier = 1 +unitsTable["squadarmpwt4"].customparams.childreninheritxp = "DRONE" +unitsTable["squadarmpwt4"].customparams.parentsinheritxp = "DRONE" +unitsTable["squadarmpwt4"].weapondefs.dronespawner = { + areaofeffect = 4, + avoidfeature = false, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "", + gravityaffected = "true", + hightrajectory = 1, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 1200, + reloadtime = 2.5, + size = 0, + soundhit = "", + soundhitwet = "", + soundstart = "", + turret = true, + weapontype = "Cannon", + weaponvelocity = 360, + damage = { + default = 0, + }, + customparams = { + carried_unit = "squadarmpw", + engagementrange = 1200, + spawns_surface = "LAND", + spawnrate = 0.5, + maxunits = 20, + controlradius = 1300, + carrierdeaththroe = "death", + dockingarmor = 0.001, + dockinghealrate = 1000, + docktohealthreshold = 0, + dockingHelperSpeed = 5, + dockingpieces = "5 7 9 11", + dockingradius = 120, + holdfireradius = 300, + }, } -unitsTable['squadarmpwt4'].weapons[2] = { - badtargetcategory = "VTOL", - def = "dronespawner", - onlytargetcategory = "NOTSUB", +unitsTable["squadarmpwt4"].weapons[2] = { + badtargetcategory = "VTOL", + def = "dronespawner", + onlytargetcategory = "NOTSUB", } --Epic Pawn's Babies -unitsTable['squadarmpw'] = VFS.Include('units/ArmBots/armpw.lua').armpw --if this filepath is changed, the unit will no longer work! -unitsTable['squadarmpw'].corpse = "" -unitsTable['squadarmpw'].energycost = 1 -unitsTable['squadarmpw'].metalcost = 1 -unitsTable['squadarmpw'].movestate = 2 -unitsTable['squadarmpw'].power = 50 -unitsTable['squadarmpw'].mass = 50 -unitsTable['squadarmpw'].speed = unitsTable['squadarmpw'].speed*1.5 -unitsTable['squadarmpw'].customparams.i18nfromunit = 'armpw' +unitsTable["squadarmpw"] = VFS.Include("units/ArmBots/armpw.lua").armpw --if this filepath is changed, the unit will no longer work! +unitsTable["squadarmpw"].corpse = "" +unitsTable["squadarmpw"].energycost = 1 +unitsTable["squadarmpw"].metalcost = 1 +unitsTable["squadarmpw"].movestate = 2 +unitsTable["squadarmpw"].power = 50 +unitsTable["squadarmpw"].mass = 50 +unitsTable["squadarmpw"].speed = unitsTable["squadarmpw"].speed * 1.5 +unitsTable["squadarmpw"].customparams.i18nfromunit = "armpw" --Epic Recluse Squad -unitsTable['squadarmsptkt4'] = VFS.Include('units/Scavengers/Bots/armsptkt4.lua').armsptkt4 --if this filepath is changed, the unit will no longer work! -unitsTable['squadarmsptkt4'].selfdestructas = "" -unitsTable['squadarmsptkt4'].movestate = 2 -unitsTable['squadarmsptkt4'].customparams.i18nfromunit = 'armsptkt4' -unitsTable['squadarmsptkt4'].customparams.inheritxpratemultiplier = 1 -unitsTable['squadarmsptkt4'].customparams.childreninheritxp = "DRONE" -unitsTable['squadarmsptkt4'].customparams.parentsinheritxp = "DRONE" -unitsTable['squadarmsptkt4'].weapondefs.dronespawner = { - areaofeffect = 4, - avoidfeature = false, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - explosiongenerator = "", - gravityaffected = "true", - hightrajectory = 1, - impulsefactor = 0.123, - name = "HeavyCannon", - noselfdamage = true, - range = 1200, - reloadtime = 2.5, - size = 0, - soundhit = "", - soundhitwet = "", - soundstart = "", - turret = true, - weapontype = "Cannon", - weaponvelocity = 360, - damage = { - default = 0, - }, - customparams = { - carried_unit = "squadarmsptk", - engagementrange = 1200, - spawns_surface = "LAND", - spawnrate = 3, - maxunits = 20, - controlradius = 1300, - decayrate = 0, - carrierdeaththroe = "death", - dockingarmor = 0.001, - dockinghealrate = 100, - docktohealthreshold = 0, - dockingHelperSpeed = 5, - dockingpieces = "5 7 9 11", - dockingradius = 120, - holdfireradius = 300 - } +unitsTable["squadarmsptkt4"] = VFS.Include("units/Scavengers/Bots/armsptkt4.lua").armsptkt4 --if this filepath is changed, the unit will no longer work! +unitsTable["squadarmsptkt4"].selfdestructas = "" +unitsTable["squadarmsptkt4"].movestate = 2 +unitsTable["squadarmsptkt4"].customparams.i18nfromunit = "armsptkt4" +unitsTable["squadarmsptkt4"].customparams.inheritxpratemultiplier = 1 +unitsTable["squadarmsptkt4"].customparams.childreninheritxp = "DRONE" +unitsTable["squadarmsptkt4"].customparams.parentsinheritxp = "DRONE" +unitsTable["squadarmsptkt4"].weapondefs.dronespawner = { + areaofeffect = 4, + avoidfeature = false, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "", + gravityaffected = "true", + hightrajectory = 1, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 1200, + reloadtime = 2.5, + size = 0, + soundhit = "", + soundhitwet = "", + soundstart = "", + turret = true, + weapontype = "Cannon", + weaponvelocity = 360, + damage = { + default = 0, + }, + customparams = { + carried_unit = "squadarmsptk", + engagementrange = 1200, + spawns_surface = "LAND", + spawnrate = 3, + maxunits = 20, + controlradius = 1300, + decayrate = 0, + carrierdeaththroe = "death", + dockingarmor = 0.001, + dockinghealrate = 100, + docktohealthreshold = 0, + dockingHelperSpeed = 5, + dockingpieces = "5 7 9 11", + dockingradius = 120, + holdfireradius = 300, + }, } -unitsTable['squadarmsptkt4'].weapons[2] = { - badtargetcategory = "VTOL", - def = "dronespawner", - onlytargetcategory = "NOTSUB", +unitsTable["squadarmsptkt4"].weapons[2] = { + badtargetcategory = "VTOL", + def = "dronespawner", + onlytargetcategory = "NOTSUB", } --Epic Recluse's Babies -unitsTable['squadarmsptk'] = VFS.Include('units/ArmBots/T2/armsptk.lua').armsptk --if this filepath is changed, the unit will no longer work! -unitsTable['squadarmsptk'].corpse = "" -unitsTable['squadarmsptk'].energycost = 1 -unitsTable['squadarmsptk'].metalcost = 1 -unitsTable['squadarmsptk'].movestate = 2 -unitsTable['squadarmsptk'].power = 500 -unitsTable['squadarmsptk'].mass = 500 -unitsTable['squadarmsptk'].speed = unitsTable['squadarmsptk'].speed*1.5 -unitsTable['squadarmsptk'].customparams.i18nfromunit = 'armsptk' +unitsTable["squadarmsptk"] = VFS.Include("units/ArmBots/T2/armsptk.lua").armsptk --if this filepath is changed, the unit will no longer work! +unitsTable["squadarmsptk"].corpse = "" +unitsTable["squadarmsptk"].energycost = 1 +unitsTable["squadarmsptk"].metalcost = 1 +unitsTable["squadarmsptk"].movestate = 2 +unitsTable["squadarmsptk"].power = 500 +unitsTable["squadarmsptk"].mass = 500 +unitsTable["squadarmsptk"].speed = unitsTable["squadarmsptk"].speed * 1.5 +unitsTable["squadarmsptk"].customparams.i18nfromunit = "armsptk" --Epic Grunt Squad -unitsTable['squadcorakt4'] = VFS.Include('units/Scavengers/Bots/corakt4.lua').corakt4 --if this filepath is changed, the unit will no longer work! -unitsTable['squadcorakt4'].corpse = "" -unitsTable['squadcorakt4'].selfdestructas = "" -unitsTable['squadcorakt4'].movestate = 2 -unitsTable['squadcorakt4'].customparams.i18nfromunit = 'corakt4' -unitsTable['squadcorakt4'].customparams.inheritxpratemultiplier = 1 -unitsTable['squadcorakt4'].customparams.childreninheritxp = "DRONE" -unitsTable['squadcorakt4'].customparams.parentsinheritxp = "DRONE" -unitsTable['squadcorakt4'].weapondefs.dronespawner = { - areaofeffect = 4, - avoidfeature = false, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - explosiongenerator = "", - gravityaffected = "true", - hightrajectory = 1, - impulsefactor = 0.123, - name = "HeavyCannon", - noselfdamage = true, - range = 1200, - reloadtime = 2.5, - size = 0, - soundhit = "", - soundhitwet = "", - soundstart = "", - turret = true, - weapontype = "Cannon", - weaponvelocity = 360, - damage = { - default = 0, - }, - customparams = { - carried_unit = "squadcorak", - engagementrange = 1200, - spawns_surface = "LAND", - spawnrate = 0.5, - maxunits = 15, - controlradius = 1300, - carrierdeaththroe = "death", - dockingarmor = 0.001, - dockinghealrate = 1000, - docktohealthreshold = 0, - dockingHelperSpeed = 5, - dockingpieces = "5 7 9 11", - dockingradius = 120, - holdfireradius = 300 - } +unitsTable["squadcorakt4"] = VFS.Include("units/Scavengers/Bots/corakt4.lua").corakt4 --if this filepath is changed, the unit will no longer work! +unitsTable["squadcorakt4"].corpse = "" +unitsTable["squadcorakt4"].selfdestructas = "" +unitsTable["squadcorakt4"].movestate = 2 +unitsTable["squadcorakt4"].customparams.i18nfromunit = "corakt4" +unitsTable["squadcorakt4"].customparams.inheritxpratemultiplier = 1 +unitsTable["squadcorakt4"].customparams.childreninheritxp = "DRONE" +unitsTable["squadcorakt4"].customparams.parentsinheritxp = "DRONE" +unitsTable["squadcorakt4"].weapondefs.dronespawner = { + areaofeffect = 4, + avoidfeature = false, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "", + gravityaffected = "true", + hightrajectory = 1, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 1200, + reloadtime = 2.5, + size = 0, + soundhit = "", + soundhitwet = "", + soundstart = "", + turret = true, + weapontype = "Cannon", + weaponvelocity = 360, + damage = { + default = 0, + }, + customparams = { + carried_unit = "squadcorak", + engagementrange = 1200, + spawns_surface = "LAND", + spawnrate = 0.5, + maxunits = 15, + controlradius = 1300, + carrierdeaththroe = "death", + dockingarmor = 0.001, + dockinghealrate = 1000, + docktohealthreshold = 0, + dockingHelperSpeed = 5, + dockingpieces = "5 7 9 11", + dockingradius = 120, + holdfireradius = 300, + }, } -unitsTable['squadcorakt4'].weapons[2] = { - badtargetcategory = "VTOL", - def = "dronespawner", - onlytargetcategory = "NOTSUB", +unitsTable["squadcorakt4"].weapons[2] = { + badtargetcategory = "VTOL", + def = "dronespawner", + onlytargetcategory = "NOTSUB", } --Epic Grunt's Babies -unitsTable['squadcorak'] = VFS.Include('units/CorBots/corak.lua').corak --if this filepath is changed, the unit will no longer work! -unitsTable['squadcorak'].corpse = "" -unitsTable['squadcorak'].energycost = 1 -unitsTable['squadcorak'].metalcost = 1 -unitsTable['squadcorak'].movestate = 2 -unitsTable['squadcorak'].power = 50 -unitsTable['squadcorak'].mass = 50 -unitsTable['squadcorak'].speed = unitsTable['squadcorak'].speed*1.5 -unitsTable['squadcorak'].customparams.i18nfromunit = 'corak' +unitsTable["squadcorak"] = VFS.Include("units/CorBots/corak.lua").corak --if this filepath is changed, the unit will no longer work! +unitsTable["squadcorak"].corpse = "" +unitsTable["squadcorak"].energycost = 1 +unitsTable["squadcorak"].metalcost = 1 +unitsTable["squadcorak"].movestate = 2 +unitsTable["squadcorak"].power = 50 +unitsTable["squadcorak"].mass = 50 +unitsTable["squadcorak"].speed = unitsTable["squadcorak"].speed * 1.5 +unitsTable["squadcorak"].customparams.i18nfromunit = "corak" --Epic Karganeth Squad -unitsTable['squadcorkarganetht4'] = VFS.Include('units/Scavengers/Bots/corkarganetht4.lua').corkarganetht4 --if this filepath is changed, the unit will no longer work! -unitsTable['squadcorkarganetht4'].selfdestructas = "" -unitsTable['squadcorkarganetht4'].movestate = 2 -unitsTable['squadcorkarganetht4'].customparams.i18nfromunit = 'corkarganetht4' -unitsTable['squadcorkarganetht4'].customparams.inheritxpratemultiplier = 1 -unitsTable['squadcorkarganetht4'].customparams.childreninheritxp = "DRONE" -unitsTable['squadcorkarganetht4'].customparams.parentsinheritxp = "DRONE" -unitsTable['squadcorkarganetht4'].weapondefs.dronespawner = { - areaofeffect = 4, - avoidfeature = false, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - explosiongenerator = "", - gravityaffected = "true", - hightrajectory = 1, - impulsefactor = 0.123, - name = "HeavyCannon", - noselfdamage = true, - range = 1200, - reloadtime = 2.5, - size = 0, - soundhit = "", - soundhitwet = "", - soundstart = "", - turret = true, - weapontype = "Cannon", - weaponvelocity = 360, - damage = { - default = 0, - }, - customparams = { - carried_unit = "squadcorkarg", - engagementrange = 1200, - spawns_surface = "LAND", - spawnrate = 8, - maxunits = 10, - controlradius = 1300, - decayrate = 0, - carrierdeaththroe = "death", - dockingarmor = 0.001, - dockinghealrate = 100, - docktohealthreshold = 0, - dockingHelperSpeed = 5, - dockingpieces = "5 7 9 11", - dockingradius = 120, - holdfireradius = 300 - } +unitsTable["squadcorkarganetht4"] = VFS.Include("units/Scavengers/Bots/corkarganetht4.lua").corkarganetht4 --if this filepath is changed, the unit will no longer work! +unitsTable["squadcorkarganetht4"].selfdestructas = "" +unitsTable["squadcorkarganetht4"].movestate = 2 +unitsTable["squadcorkarganetht4"].customparams.i18nfromunit = "corkarganetht4" +unitsTable["squadcorkarganetht4"].customparams.inheritxpratemultiplier = 1 +unitsTable["squadcorkarganetht4"].customparams.childreninheritxp = "DRONE" +unitsTable["squadcorkarganetht4"].customparams.parentsinheritxp = "DRONE" +unitsTable["squadcorkarganetht4"].weapondefs.dronespawner = { + areaofeffect = 4, + avoidfeature = false, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "", + gravityaffected = "true", + hightrajectory = 1, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 1200, + reloadtime = 2.5, + size = 0, + soundhit = "", + soundhitwet = "", + soundstart = "", + turret = true, + weapontype = "Cannon", + weaponvelocity = 360, + damage = { + default = 0, + }, + customparams = { + carried_unit = "squadcorkarg", + engagementrange = 1200, + spawns_surface = "LAND", + spawnrate = 8, + maxunits = 10, + controlradius = 1300, + decayrate = 0, + carrierdeaththroe = "death", + dockingarmor = 0.001, + dockinghealrate = 100, + docktohealthreshold = 0, + dockingHelperSpeed = 5, + dockingpieces = "5 7 9 11", + dockingradius = 120, + holdfireradius = 300, + }, } -unitsTable['squadcorkarganetht4'].weapons[4] = { - badtargetcategory = "VTOL", - def = "dronespawner", - onlytargetcategory = "NOTSUB", +unitsTable["squadcorkarganetht4"].weapons[4] = { + badtargetcategory = "VTOL", + def = "dronespawner", + onlytargetcategory = "NOTSUB", } --Epic Tzar's Babies -unitsTable['squadcorkarg'] = VFS.Include('units/CorGantry/corkarg.lua').corkarg --if this filepath is changed, the unit will no longer work! -unitsTable['squadcorkarg'].corpse = "" -unitsTable['squadcorkarg'].energycost = 1 -unitsTable['squadcorkarg'].metalcost = 1 -unitsTable['squadcorkarg'].movestate = 2 -unitsTable['squadcorkarg'].power = 1800 -unitsTable['squadcorkarg'].mass = 500 -unitsTable['squadcorkarg'].speed = unitsTable['squadcorkarg'].speed*1.5 -unitsTable['squadcorkarg'].customparams.i18nfromunit = 'corkarg' - +unitsTable["squadcorkarg"] = VFS.Include("units/CorGantry/corkarg.lua").corkarg --if this filepath is changed, the unit will no longer work! +unitsTable["squadcorkarg"].corpse = "" +unitsTable["squadcorkarg"].energycost = 1 +unitsTable["squadcorkarg"].metalcost = 1 +unitsTable["squadcorkarg"].movestate = 2 +unitsTable["squadcorkarg"].power = 1800 +unitsTable["squadcorkarg"].mass = 500 +unitsTable["squadcorkarg"].speed = unitsTable["squadcorkarg"].speed * 1.5 +unitsTable["squadcorkarg"].customparams.i18nfromunit = "corkarg" return unitsTable diff --git a/units/Scavengers/Boss/corcomboss.lua b/units/Scavengers/Boss/corcomboss.lua index 3c25781724b..cdf65fb684c 100644 --- a/units/Scavengers/Boss/corcomboss.lua +++ b/units/Scavengers/Boss/corcomboss.lua @@ -60,7 +60,7 @@ return { [2] = "corkorg", }, customparams = { - unitgroup = 'buildert4', + unitgroup = "buildert4", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", paralyzemultiplier = 0.01, diff --git a/units/Scavengers/Boss/scavengerbossv4.lua b/units/Scavengers/Boss/scavengerbossv4.lua index 0e080098d78..e5239ea15df 100644 --- a/units/Scavengers/Boss/scavengerbossv4.lua +++ b/units/Scavengers/Boss/scavengerbossv4.lua @@ -22,8 +22,8 @@ local baseValues = { --format: {value, multiplier} shotgunSprayAnglePercentageMultiplier = { 100, 1.15 }, --AI Behaviors - turboWeaponOffTime = {100, 1.4}, --{percentage, multiplier} Don't change the percentage. Changing multiplier will influence the difference in turbo weapon activation delay. - turboWeaponOnTime = {100, 1.4}, --{percentage, multiplier} Don't change the percentage. Changing multiplier will influence the difference in turbo weapon activation duration. + turboWeaponOffTime = { 100, 1.4 }, --{percentage, multiplier} Don't change the percentage. Changing multiplier will influence the difference in turbo weapon activation delay. + turboWeaponOnTime = { 100, 1.4 }, --{percentage, multiplier} Don't change the percentage. Changing multiplier will influence the difference in turbo weapon activation duration. --non-damage weapon behavior turboShotgunArmBurst = { 2, 1.15 }, @@ -94,7 +94,7 @@ for difficulty, stats in pairs(difficultyParams) do radardistance = 2000, radaremitheight = 54, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/scavboss/scavengerbossv4.cob", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -107,14 +107,14 @@ for difficulty, stats in pairs(difficultyParams) do turninplacespeedlimit = 0.825, turnrate = 300, upright = true, - workertime = 1500,--400, + workertime = 1500, --400, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.025, subfolder = "", - i18nfromunit = 'scavengerbossv4', + i18nfromunit = "scavengerbossv4", ispvefinalboss = true, }, featuredefs = { @@ -210,7 +210,7 @@ for difficulty, stats in pairs(difficultyParams) do laserflaresize = 30, name = "Rapid-fire close quarters g2g armor-piercing laser", noselfdamage = true, - pulsespeed = q8, + pulsespeed = q8, range = 800, reloadtime = 0.40, rgbcolor = "0.7 0.3 1.0", @@ -230,7 +230,7 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 920, damage = { default = stats.minigunDamage, - vtol = stats.minigunDamage/2, + vtol = stats.minigunDamage / 2, }, }, torpedo = { @@ -300,7 +300,7 @@ for difficulty, stats in pairs(difficultyParams) do soundhit = "xplomed2xs", soundhitwet = "splsmed", soundstart = "kroggie2xs", - sprayangle = (6000*stats.shotgunSprayAnglePercentageMultiplier/100), + sprayangle = (6000 * stats.shotgunSprayAnglePercentageMultiplier / 100), tolerance = 6000, turret = true, waterweapon = true, @@ -309,7 +309,7 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 900, damage = { default = stats.shotgunDamage, - subs = stats.shotgunDamage/4, + subs = stats.shotgunDamage / 4, }, }, shoulderturrets = { @@ -345,11 +345,11 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 800, damage = { default = stats.topTurretsDamage, - shields = stats.topTurretsDamage/2, - subs = stats.topTurretsDamage/4, + shields = stats.topTurretsDamage / 2, + subs = stats.topTurretsDamage / 4, }, }, - missilelauncher = { + missilelauncher = { areaofeffect = 250, avoidfeature = false, burnblow = true, @@ -396,9 +396,9 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 1200, wobble = 5000, damage = { - default = stats.missileDamage/6, + default = stats.missileDamage / 6, vtol = stats.missileDamage, - subs = stats.missileDamage/4, + subs = stats.missileDamage / 4, }, }, eaterbeam = { @@ -540,8 +540,8 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 1200, wobble = 5000, damage = { - default = stats.missileDamage/6, - vtol = stats.missileDamage*2, + default = stats.missileDamage / 6, + vtol = stats.missileDamage * 2, }, }, turbo_napalm = { @@ -576,7 +576,7 @@ for difficulty, stats in pairs(difficultyParams) do soundhit = "flamhit1", soundhitwet = "sizzle", soundstart = "cannhvy2", - sprayangle = (5000*stats.shotgunSprayAnglePercentageMultiplier/100), + sprayangle = (5000 * stats.shotgunSprayAnglePercentageMultiplier / 100), tolerance = 6000, turret = true, weapontype = "Cannon", @@ -591,8 +591,8 @@ for difficulty, stats in pairs(difficultyParams) do water_splash = 0, }, damage = { - default = stats.shotgunDamage/3, - subs = stats.shotgunDamage/4, + default = stats.shotgunDamage / 3, + subs = stats.shotgunDamage / 4, }, }, turbo_machinegun = { @@ -619,7 +619,7 @@ for difficulty, stats in pairs(difficultyParams) do name = "TURBO Rapid-fire close quarters g2g armor-piercing laser", noselfdamage = true, projectiles = 4, - pulsespeed = q8, + pulsespeed = q8, range = 800, reloadtime = 0.40, rgbcolor = "0.7 0.3 1.0", @@ -638,8 +638,8 @@ for difficulty, stats in pairs(difficultyParams) do weapontype = "BeamLaser", weaponvelocity = 920, damage = { - default = stats.minigunDamage*4, - vtol = (stats.minigunDamage*4)/2, + default = stats.minigunDamage * 4, + vtol = (stats.minigunDamage * 4) / 2, subs = stats.minigunDamage, }, }, @@ -676,8 +676,8 @@ for difficulty, stats in pairs(difficultyParams) do weaponvelocity = 800, damage = { default = stats.topTurretsDamage, - shields = stats.topTurretsDamage/2, - subs = stats.topTurretsDamage/4, + shields = stats.topTurretsDamage / 2, + subs = stats.topTurretsDamage / 4, }, }, special_botcannon = { @@ -780,7 +780,7 @@ for difficulty, stats in pairs(difficultyParams) do reloadtime = 1, --increasing firerate increases the weight by which this sensor affects TURBO and SPECIAL weapon selection rgbcolor = "0.7 0.3 1.0", rgbcolor2 = "0.8 0.6 1.0", - size = 0, --when this is aiming, sensor_ground_near cannot aim. + size = 0, --when this is aiming, sensor_ground_near cannot aim. soundhit = "", soundhitwet = "", soundstart = "", @@ -850,7 +850,7 @@ for difficulty, stats in pairs(difficultyParams) do default = 0, }, }, - setting_turbo_delay = { -- + setting_turbo_delay = { -- avoidfeature = false, craterareaofeffect = 0, craterboost = 0, @@ -862,9 +862,9 @@ for difficulty, stats in pairs(difficultyParams) do impulsefactor = 0.123, name = "TurboWeaponGapDelay", noselfdamage = true, - projectiles = math.floor((10/stats.turboWeaponOnTime*100) + 0.5), -- after delay, when 200-300 additional projectiles are fired, the turbo weapon is disabled. + projectiles = math.floor((10 / stats.turboWeaponOnTime * 100) + 0.5), -- after delay, when 200-300 additional projectiles are fired, the turbo weapon is disabled. range = 99999, - reloadtime = 1/stats.turboWeaponOffTime*100, --when 10+(health%/4) shots are fired, select a turbo weapon and enable it. + reloadtime = 1 / stats.turboWeaponOffTime * 100, --when 10+(health%/4) shots are fired, select a turbo weapon and enable it. rgbcolor = "0.7 0.3 1.0", rgbcolor2 = "0.8 0.6 1.0", size = 0, @@ -902,7 +902,7 @@ for difficulty, stats in pairs(difficultyParams) do def = "shoulderturrets", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { badtargetcategory = "SURFACE", def = "missilelauncher", onlytargetcategory = "NOTSUB", diff --git a/units/Scavengers/Bots/armassimilator.lua b/units/Scavengers/Bots/armassimilator.lua index 778a257ca0d..239d992bf3e 100644 --- a/units/Scavengers/Bots/armassimilator.lua +++ b/units/Scavengers/Bots/armassimilator.lua @@ -33,7 +33,7 @@ return { turnrate = 768.20001, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "PtaQ", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmGantry", @@ -177,7 +177,7 @@ return { default = 33, vtol = 100, }, - } + }, }, weapons = { [1] = { diff --git a/units/Scavengers/Bots/armlunchbox.lua b/units/Scavengers/Bots/armlunchbox.lua index 6a07e141120..369ce14eef8 100644 --- a/units/Scavengers/Bots/armlunchbox.lua +++ b/units/Scavengers/Bots/armlunchbox.lua @@ -32,7 +32,7 @@ return { turninplacespeedlimit = 0.726, turnrate = 265.64999, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Flaka", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmGantry", diff --git a/units/Scavengers/Bots/armmeatball.lua b/units/Scavengers/Bots/armmeatball.lua index bfee4c99f94..43c4f336cad 100644 --- a/units/Scavengers/Bots/armmeatball.lua +++ b/units/Scavengers/Bots/armmeatball.lua @@ -32,7 +32,7 @@ return { turnrate = 1214.40002, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "PtaQ", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmGantry", diff --git a/units/Scavengers/Bots/armpwt4.lua b/units/Scavengers/Bots/armpwt4.lua index 9439fdd374a..709d3fbd708 100644 --- a/units/Scavengers/Bots/armpwt4.lua +++ b/units/Scavengers/Bots/armpwt4.lua @@ -32,7 +32,7 @@ return { turnrate = 1200.44, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Kaiser", normaltex = "unittextures/Arm_normal.dds", subfolder = "other/scavengers", diff --git a/units/Scavengers/Bots/armsptkt4.lua b/units/Scavengers/Bots/armsptkt4.lua index 4a45a109b19..9bb63b2d230 100644 --- a/units/Scavengers/Bots/armsptkt4.lua +++ b/units/Scavengers/Bots/armsptkt4.lua @@ -31,7 +31,7 @@ return { turninplacespeedlimit = 350, turnrate = 650, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.125, @@ -106,7 +106,7 @@ return { firestarter = 70, flighttime = 4, impulsefactor = 0.123, - model = "catapultmissile.s3o", --catapultmissile.s3o + model = "catapultmissile.s3o", --catapultmissile.s3o movingaccuracy = 450, name = "Parabolic trajectory g2g multi-rocket launcher", noselfdamage = true, diff --git a/units/Scavengers/Bots/corakt4.lua b/units/Scavengers/Bots/corakt4.lua index 5c15d90d160..5c7071923eb 100644 --- a/units/Scavengers/Bots/corakt4.lua +++ b/units/Scavengers/Bots/corakt4.lua @@ -32,7 +32,7 @@ return { turnrate = 1391.5, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "CorBots", diff --git a/units/Scavengers/Bots/cordeadeye.lua b/units/Scavengers/Bots/cordeadeye.lua index 1c7a9e82ea9..7ecd672952d 100644 --- a/units/Scavengers/Bots/cordeadeye.lua +++ b/units/Scavengers/Bots/cordeadeye.lua @@ -32,7 +32,7 @@ return { turnrate = 400, upright = false, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Kaludjo", normaltex = "unittextures/cor_normal.dds", subfolder = "CorBots/t2", diff --git a/units/Scavengers/Bots/corkarganetht4.lua b/units/Scavengers/Bots/corkarganetht4.lua index be36fcfd1f7..b4bba80c79c 100644 --- a/units/Scavengers/Bots/corkarganetht4.lua +++ b/units/Scavengers/Bots/corkarganetht4.lua @@ -32,7 +32,7 @@ return { turnrate = 457.20001, upright = false, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Flaka", normaltex = "unittextures/cor_normal.dds", subfolder = "CorGantry", diff --git a/units/Scavengers/Bots/corkark.lua b/units/Scavengers/Bots/corkark.lua index 1d910c539a2..a3677e26ab5 100644 --- a/units/Scavengers/Bots/corkark.lua +++ b/units/Scavengers/Bots/corkark.lua @@ -33,7 +33,7 @@ return { turnrate = 885.5, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Firestorm", normaltex = "unittextures/cor_normal.dds", subfolder = "Scavengers/Bots", diff --git a/units/Scavengers/Bots/cormandot4.lua b/units/Scavengers/Bots/cormandot4.lua index 759ed1a0a1a..3f1a62ed83f 100644 --- a/units/Scavengers/Bots/cormandot4.lua +++ b/units/Scavengers/Bots/cormandot4.lua @@ -10,9 +10,9 @@ return { builder = true, buildpic = "CORMANDO.DDS", buildtime = 17100, - cancloak = true, - cloakcost = 100, - cloakcostmoving = 1000, + cancloak = true, + cloakcost = 100, + cloakcostmoving = 1000, canassist = true, canmove = true, canreclaim = true, @@ -53,12 +53,12 @@ return { [6] = "cortron", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", subfolder = "CorBots/T2", techlevel = 2, - paratrooper = true, + paratrooper = true, water_fall_damage_multiplier = 0, fall_damage_multiplier = 0, firestateoncloak = 0, @@ -108,7 +108,7 @@ return { edgeeffectiveness = 0.15, energypershot = 500, explosiongenerator = "custom:expldgun", - explosionscar = false, + explosionscar = false, firestarter = 100, firesubmersed = false, impulsefactor = 0, @@ -140,9 +140,9 @@ return { beamdecay = 0.5, beamtime = 0.1, beamttl = 0.2, - collideenemy = false, + collideenemy = false, collidefriendly = false, - collidefeature = false, + collidefeature = false, corethickness = 0.5, craterareaofeffect = 0, craterboost = 0, @@ -156,16 +156,16 @@ return { noselfdamage = true, paralyzer = true, paralyzetime = 7, - projectiles = 10, + projectiles = 10, range = 250, reloadtime = 2.2, rgbcolor = "0.7 0.7 1", - sprayangle = 8000, + sprayangle = 8000, soundhitdry = "flashemgxlhit", soundhitwet = "sizzle", soundstart = "lasfirerb", soundtrigger = 1, - thickness = 10, + thickness = 10, turret = true, weapontype = "BeamLaser", weaponvelocity = 1200, @@ -173,15 +173,15 @@ return { default = 2000, }, }, - }, + }, weapons = { - [1] = { + [1] = { badtargetcategory = "GROUNDSCOUT", def = "commando_stunner", onlytargetcategory = "WEAPON", }, - [2] = { - badtargetcategory = "WEAPON", + [2] = { + badtargetcategory = "WEAPON", def = "commando_back_cannon", }, }, diff --git a/units/Scavengers/Bots/corthermite.lua b/units/Scavengers/Bots/corthermite.lua index 6bf3cd56bde..3a11bcd4717 100644 --- a/units/Scavengers/Bots/corthermite.lua +++ b/units/Scavengers/Bots/corthermite.lua @@ -8,7 +8,7 @@ return { buildtime = 188000, canmove = true, collisionvolumeoffsets = "0 0 0", - collisionvolumescales = "80 50 98",--40 26 48 + collisionvolumescales = "80 50 98", --40 26 48 collisionvolumetype = "CylY", corpse = "DEAD", explodeas = "mediumexplosiongeneric", @@ -33,7 +33,7 @@ return { turninplacespeedlimit = 1.0626, turnrate = 1214.40002, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Beherith, Hornet", normaltex = "unittextures/cor_normal.dds", paralyzemultiplier = 0.125, @@ -164,7 +164,7 @@ return { noselfdamage = true, predictboost = 1, range = 350, - reloadtime = 0.39996,--3 0.09999,--burst 12 0.39996, + reloadtime = 0.39996, --3 0.09999,--burst 12 0.39996, sizegrowth = 3, soundhitwet = "sizzle", soundstart = "Flamhvy1", @@ -178,9 +178,8 @@ return { damage = { default = 30, subs = 10, - } + }, }, - }, weapons = { [1] = { diff --git a/units/Scavengers/Bots/leggobt3.lua b/units/Scavengers/Bots/leggobt3.lua index 92b67b50844..62e3dc6d700 100644 --- a/units/Scavengers/Bots/leggobt3.lua +++ b/units/Scavengers/Bots/leggobt3.lua @@ -31,7 +31,7 @@ return { turnrate = 650, upright = true, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Odin", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBots", diff --git a/units/Scavengers/Bots/legpede.lua b/units/Scavengers/Bots/legpede.lua index b38c8197460..87141e850be 100644 --- a/units/Scavengers/Bots/legpede.lua +++ b/units/Scavengers/Bots/legpede.lua @@ -33,7 +33,7 @@ return { turnrate = 200, usepiececollisionvolumes = 1, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmBots/T2", diff --git a/units/Scavengers/Bots/legsrailt4.lua b/units/Scavengers/Bots/legsrailt4.lua index 2c4b8bf3954..c2c4a1deab9 100644 --- a/units/Scavengers/Bots/legsrailt4.lua +++ b/units/Scavengers/Bots/legsrailt4.lua @@ -32,7 +32,7 @@ return { turninplacespeedlimit = 1, turnrate = 100, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "Legion/gantry", @@ -134,8 +134,8 @@ return { weapontype = "LaserCannon", weaponvelocity = 3180, customparams = { - overpenetrate = true, - stockpilelimit = 3, + overpenetrate = true, + stockpilelimit = 3, }, damage = { commanders = 1000, diff --git a/units/Scavengers/Buildings/DefenseOffense/armannit3.lua b/units/Scavengers/Buildings/DefenseOffense/armannit3.lua index 2715cb5a0f8..00f8acc7054 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armannit3.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armannit3.lua @@ -39,7 +39,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Cremuss", normaltex = "unittextures/Arm_normal.dds", removewait = true, diff --git a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua index 27c8e77a500..fcb979de6e3 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 12, buildinggrounddecalsizex = 12, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", restrictions_inclusion = "_nolrpc_", canareaattack = 1, model_author = "FireStorm", diff --git a/units/Scavengers/Buildings/DefenseOffense/armlwall.lua b/units/Scavengers/Buildings/DefenseOffense/armlwall.lua index 051d295ab60..17f3aae8424 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armlwall.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armlwall.lua @@ -39,7 +39,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "armfort", model_author = "Beherith", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Buildings/DefenseOffense/armminivulc.lua b/units/Scavengers/Buildings/DefenseOffense/armminivulc.lua index 6cccab1fc66..b6071e3b243 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armminivulc.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armminivulc.lua @@ -31,7 +31,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Beherith", normaltex = "unittextures/Arm_normal.dds", removewait = true, diff --git a/units/Scavengers/Buildings/DefenseOffense/cordoomt3.lua b/units/Scavengers/Buildings/DefenseOffense/cordoomt3.lua index e550e65f667..58dbf13436f 100644 --- a/units/Scavengers/Buildings/DefenseOffense/cordoomt3.lua +++ b/units/Scavengers/Buildings/DefenseOffense/cordoomt3.lua @@ -39,7 +39,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", removewait = true, diff --git a/units/Scavengers/Buildings/DefenseOffense/corhllllt.lua b/units/Scavengers/Buildings/DefenseOffense/corhllllt.lua index 9c41957d263..0bd73750368 100644 --- a/units/Scavengers/Buildings/DefenseOffense/corhllllt.lua +++ b/units/Scavengers/Buildings/DefenseOffense/corhllllt.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", removewait = true, @@ -131,7 +131,7 @@ return { }, customparams = { exclude_preaim = true, - } + }, }, hllt_2 = { areaofeffect = 12, @@ -171,7 +171,7 @@ return { customparams = { exclude_preaim = true, norangering = 1, - } + }, }, hllt_3 = { areaofeffect = 12, @@ -211,7 +211,7 @@ return { customparams = { exclude_preaim = true, norangering = 1, - } + }, }, hllt_4 = { areaofeffect = 12, @@ -251,7 +251,7 @@ return { customparams = { exclude_preaim = true, norangering = 1, - } + }, }, }, weapons = { diff --git a/units/Scavengers/Buildings/DefenseOffense/corminibuzz.lua b/units/Scavengers/Buildings/DefenseOffense/corminibuzz.lua index e5f9a1e9d16..39ff327691c 100644 --- a/units/Scavengers/Buildings/DefenseOffense/corminibuzz.lua +++ b/units/Scavengers/Buildings/DefenseOffense/corminibuzz.lua @@ -30,7 +30,7 @@ return { buildinggrounddecalsizey = 6, buildinggrounddecalsizex = 6, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", removewait = true, diff --git a/units/Scavengers/Buildings/DefenseOffense/cormwall.lua b/units/Scavengers/Buildings/DefenseOffense/cormwall.lua index 7dc5f3d9bef..4c7b0c447e0 100644 --- a/units/Scavengers/Buildings/DefenseOffense/cormwall.lua +++ b/units/Scavengers/Buildings/DefenseOffense/cormwall.lua @@ -38,7 +38,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "armfort", model_author = "Beherith", normaltex = "unittextures/cor_normal.dds", @@ -82,8 +82,7 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", @@ -204,7 +203,7 @@ return { exclude_preaim = true, overrange_distance = 777, projectile_destruction_method = "descend", - } + }, }, }, weapons = { diff --git a/units/Scavengers/Buildings/DefenseOffense/corscavdtf.lua b/units/Scavengers/Buildings/DefenseOffense/corscavdtf.lua index 82332607b39..40b56af23ac 100644 --- a/units/Scavengers/Buildings/DefenseOffense/corscavdtf.lua +++ b/units/Scavengers/Buildings/DefenseOffense/corscavdtf.lua @@ -37,7 +37,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", @@ -79,8 +79,7 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", diff --git a/units/Scavengers/Buildings/DefenseOffense/corscavdtl.lua b/units/Scavengers/Buildings/DefenseOffense/corscavdtl.lua index c17c2fa491f..3a9c5b1a20d 100644 --- a/units/Scavengers/Buildings/DefenseOffense/corscavdtl.lua +++ b/units/Scavengers/Buildings/DefenseOffense/corscavdtl.lua @@ -39,7 +39,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/DefenseOffense/corscavdtm.lua b/units/Scavengers/Buildings/DefenseOffense/corscavdtm.lua index d1871ce1030..5f6720323af 100644 --- a/units/Scavengers/Buildings/DefenseOffense/corscavdtm.lua +++ b/units/Scavengers/Buildings/DefenseOffense/corscavdtm.lua @@ -36,7 +36,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/DefenseOffense/legdtf.lua b/units/Scavengers/Buildings/DefenseOffense/legdtf.lua index 4aeb4de53cd..dc036b1b808 100644 --- a/units/Scavengers/Buildings/DefenseOffense/legdtf.lua +++ b/units/Scavengers/Buildings/DefenseOffense/legdtf.lua @@ -37,7 +37,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", @@ -78,8 +78,7 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", diff --git a/units/Scavengers/Buildings/DefenseOffense/legdtl.lua b/units/Scavengers/Buildings/DefenseOffense/legdtl.lua index 1684cd526ba..241eb07b8ce 100644 --- a/units/Scavengers/Buildings/DefenseOffense/legdtl.lua +++ b/units/Scavengers/Buildings/DefenseOffense/legdtl.lua @@ -39,7 +39,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/DefenseOffense/legdtm.lua b/units/Scavengers/Buildings/DefenseOffense/legdtm.lua index 1a965088e54..7bc9cca2f11 100644 --- a/units/Scavengers/Buildings/DefenseOffense/legdtm.lua +++ b/units/Scavengers/Buildings/DefenseOffense/legdtm.lua @@ -36,7 +36,7 @@ return { buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "corscavdrag", model_author = "FireStorm", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/DefenseOffense/legministarfall.lua b/units/Scavengers/Buildings/DefenseOffense/legministarfall.lua index 3f5a1a0d7bc..aa9db86957b 100644 --- a/units/Scavengers/Buildings/DefenseOffense/legministarfall.lua +++ b/units/Scavengers/Buildings/DefenseOffense/legministarfall.lua @@ -27,7 +27,7 @@ return { yardmap = "ooo ooo ooo", customparams = { usebuildinggrounddecal = false, - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", removewait = true, @@ -179,12 +179,12 @@ return { --engine bug? burstControlWhenOutOfArc = 1, maindir = "0 0 1", - --maxangledif = 10, + --maxangledif = 10, }, [2] = { def = "energycharger", onlytargetcategory = "SURFACE", - } + }, }, }, } diff --git a/units/Scavengers/Buildings/DefenseOffense/legrwall.lua b/units/Scavengers/Buildings/DefenseOffense/legrwall.lua index 79801aa982d..33bded0cbb3 100644 --- a/units/Scavengers/Buildings/DefenseOffense/legrwall.lua +++ b/units/Scavengers/Buildings/DefenseOffense/legrwall.lua @@ -38,7 +38,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'weapon', + unitgroup = "weapon", decoyfor = "armfort", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", @@ -82,8 +82,7 @@ return { }, }, sfxtypes = { - explosiongenerators = { - }, + explosiongenerators = {}, }, sounds = { canceldestruct = "cancel2", diff --git a/units/Scavengers/Buildings/Economy/armwint2.lua b/units/Scavengers/Buildings/Economy/armwint2.lua index d7f5379ce30..56ebfa5ec52 100644 --- a/units/Scavengers/Buildings/Economy/armwint2.lua +++ b/units/Scavengers/Buildings/Economy/armwint2.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", energymultiplier = 10, model_author = "Cremuss", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Buildings/Economy/corwint2.lua b/units/Scavengers/Buildings/Economy/corwint2.lua index 75ac51c8b7e..c60542174b6 100644 --- a/units/Scavengers/Buildings/Economy/corwint2.lua +++ b/units/Scavengers/Buildings/Economy/corwint2.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 9, buildinggrounddecalsizex = 9, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", energymultiplier = 10, model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/Economy/legwint2.lua b/units/Scavengers/Buildings/Economy/legwint2.lua index fbaacdcc4b1..fb36f4a2f94 100644 --- a/units/Scavengers/Buildings/Economy/legwint2.lua +++ b/units/Scavengers/Buildings/Economy/legwint2.lua @@ -32,7 +32,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'energy', + unitgroup = "energy", energymultiplier = 10, --Doesn't work for some reason. Acts like "energymultiplier = 1". Build cost is reduced 10x, until It's fixed. model_author = "Yzch", normaltex = "unittextures/leg_normal.dds", diff --git a/units/Scavengers/Buildings/Factories/armapt3.lua b/units/Scavengers/Buildings/Factories/armapt3.lua index 3424500c428..1d459b2c2f0 100644 --- a/units/Scavengers/Buildings/Factories/armapt3.lua +++ b/units/Scavengers/Buildings/Factories/armapt3.lua @@ -44,7 +44,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 21, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", restrictions_inclusion = "_noair_", model_author = "Cremuss", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Buildings/Factories/corapt3.lua b/units/Scavengers/Buildings/Factories/corapt3.lua index 3ea556d65e8..eb277b7a724 100644 --- a/units/Scavengers/Buildings/Factories/corapt3.lua +++ b/units/Scavengers/Buildings/Factories/corapt3.lua @@ -44,7 +44,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 19, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", restrictions_inclusion = "_noair_", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Buildings/Factories/legapt3.lua b/units/Scavengers/Buildings/Factories/legapt3.lua index 25b0f3bd214..9c8a4a3d519 100644 --- a/units/Scavengers/Buildings/Factories/legapt3.lua +++ b/units/Scavengers/Buildings/Factories/legapt3.lua @@ -44,7 +44,7 @@ return { buildinggrounddecalsizey = 15, buildinggrounddecalsizex = 19, buildinggrounddecaldecayspeed = 30, - unitgroup = 'buildert3', + unitgroup = "buildert3", restrictions_inclusion = "_noair_", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", diff --git a/units/Scavengers/Other/scavengerdroppodfriendly.lua b/units/Scavengers/Other/scavengerdroppodfriendly.lua index ff453a20036..8691b900b55 100644 --- a/units/Scavengers/Other/scavengerdroppodfriendly.lua +++ b/units/Scavengers/Other/scavengerdroppodfriendly.lua @@ -63,7 +63,7 @@ return { interceptedbyshieldtype = 4, metalpershot = 0, model = "scavs/scavbeacondroppodbyar.s3o", - mygravity = 0.1, -- to ensure consistent speed + mygravity = 0.1, -- to ensure consistent speed name = "Droppod", range = 29999, reloadtime = 5, diff --git a/units/Scavengers/Other/scavmists.lua b/units/Scavengers/Other/scavmists.lua index dccfcf19696..00df7345efa 100644 --- a/units/Scavengers/Other/scavmists.lua +++ b/units/Scavengers/Other/scavmists.lua @@ -1,76 +1,75 @@ local lvlParams = { [""] = { autoheal = 125, - buildtime = 5500, - explodeas = "", - explosiongenerator = "custom:scavmist", - health = 1250, - jamandlosdistance = 300, - power = 500, - selfdestructas = "", - unitname = "scavmist", - workertime = 200, + buildtime = 5500, + explodeas = "", + explosiongenerator = "custom:scavmist", + health = 1250, + jamandlosdistance = 300, + power = 500, + selfdestructas = "", + unitname = "scavmist", + workertime = 200, - --unitspawning - landunitspawns = "armwar armham armrock armstump armflash armpincer armjanus corthud corstorm corlevlr corgarp corraid corgator legbal legkark legcen leglob legamphtank leggat leghelios leghades armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob", - landturretspawns = "armbeamer armhlt armclaw armferret armrl armrl corhllt corhlt cormaw cormadsam corrl corrl legmg legdtr legrhapsis legrl legrl armllt corllt leglht armllt corllt leglht armllt corllt leglht armllt corllt leglht armllt corllt leglht", - waterspawns = "armdecade armpship armsub corpship corpt armanac corsnap legner armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh", - unitspawnrange = 200, - turretspawnrange = 300, - landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction - landturretburst = 4, --same here - waterburst = 8, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + --unitspawning + landunitspawns = "armwar armham armrock armstump armflash armpincer armjanus corthud corstorm corlevlr corgarp corraid corgator legbal legkark legcen leglob legamphtank leggat leghelios leghades armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob armpw corak leggob", + landturretspawns = "armbeamer armhlt armclaw armferret armrl armrl corhllt corhlt cormaw cormadsam corrl corrl legmg legdtr legrhapsis legrl legrl armllt corllt leglht armllt corllt leglht armllt corllt leglht armllt corllt leglht armllt corllt leglht", + waterspawns = "armdecade armpship armsub corpship corpt armanac corsnap legner armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh armpt coresupp armsh corsh legsh", + unitspawnrange = 200, + turretspawnrange = 300, + landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + landturretburst = 4, --same here + waterburst = 8, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction }, ["xl"] = { - autoheal = 250, - buildtime = 17000, - explodeas = "",--"mistexploxl", - explosiongenerator = "custom:scavmistxl", - health = 2500, - jamandlosdistance = 300, - power = 1000, - selfdestructas = "",--"mistexploxl", - unitname = "scavmistxl", - workertime = 400, + autoheal = 250, + buildtime = 17000, + explodeas = "", --"mistexploxl", + explosiongenerator = "custom:scavmistxl", + health = 2500, + jamandlosdistance = 300, + power = 1000, + selfdestructas = "", --"mistexploxl", + unitname = "scavmistxl", + workertime = 400, - --unitspawning - landunitspawns = "armsptk armmav armfido armamph armlatnk armbull armgremlin armzeus armfast corpyro corsala corhal correap coramph cortermite corcan corparrow armcroc legaskirmtank legfloat legmrv legaheattank legshot legstr armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat", - landturretspawns = "armpb armclaw armclaw armcir corvipe cormaw cormaw corerad legbombard legdtr legdtr legrhapsis legrhapsis armferret armferret legrhapsis legrhapsis cormadsam cormadsam armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg", - waterspawns = "armlship armbats armserp armcrus corshark corbats corfship corssub corcrus corhal corhal armpship corpship armanac corsnap legner armpship corpship armanac corsnap legner armpship corpship armanac corsnap legner", - unitspawnrange = 275, - turretspawnrange = 375, - landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction - landturretburst = 4, --same here - waterburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + --unitspawning + landunitspawns = "armsptk armmav armfido armamph armlatnk armbull armgremlin armzeus armfast corpyro corsala corhal correap coramph cortermite corcan corparrow armcroc legaskirmtank legfloat legmrv legaheattank legshot legstr armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat armstump corraid leggat", + landturretspawns = "armpb armclaw armclaw armcir corvipe cormaw cormaw corerad legbombard legdtr legdtr legrhapsis legrhapsis armferret armferret legrhapsis legrhapsis cormadsam cormadsam armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg armhlt corhlt legmg", + waterspawns = "armlship armbats armserp armcrus corshark corbats corfship corssub corcrus corhal corhal armpship corpship armanac corsnap legner armpship corpship armanac corsnap legner armpship corpship armanac corsnap legner", + unitspawnrange = 275, + turretspawnrange = 375, + landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + landturretburst = 4, --same here + waterburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction }, ["xxl"] = { - autoheal = 500, - buildtime = 25500, - explodeas = "",--"mistexploxxl", - explosiongenerator = "custom:scavmistxl", + autoheal = 500, + buildtime = 25500, + explodeas = "", --"mistexploxxl", + explosiongenerator = "custom:scavmistxl", health = 5000, - jamandlosdistance = 300, - power = 2000, - selfdestructas = "",--"mistexploxxl", - unitname = "scavmistxxl", - workertime = 600, - - --unitspawning - landunitspawns = "armmeatball armassimilator armpwt4 armraz corthermite corakt4 corkarg cordemon armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok", - landturretspawns = "armflak armminivulc corhllllt corflak legbombard legflak corminibuzz armlwall cormwall legrwall armlwall cormwall legrwall armlwall cormwall legrwall", - waterspawns = "armlun armlun armlship armlship armlship armbats armserp armcrus armcrus corshark corbats corfship corfship corfship corfship corssub corcrus corcrus corsok corsok ", - unitspawnrange = 300, - turretspawnrange = 400, - landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction - landturretburst = 8, --same here - waterburst = 12, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + jamandlosdistance = 300, + power = 2000, + selfdestructas = "", --"mistexploxxl", + unitname = "scavmistxxl", + workertime = 600, + --unitspawning + landunitspawns = "armmeatball armassimilator armpwt4 armraz corthermite corakt4 corkarg cordemon armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok armmar armlun corshiva corsok", + landturretspawns = "armflak armminivulc corhllllt corflak legbombard legflak corminibuzz armlwall cormwall legrwall armlwall cormwall legrwall armlwall cormwall legrwall", + waterspawns = "armlun armlun armlship armlship armlship armbats armserp armcrus armcrus corshark corbats corfship corfship corfship corfship corssub corcrus corcrus corsok corsok ", + unitspawnrange = 300, + turretspawnrange = 400, + landunitburst = 10, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction + landturretburst = 8, --same here + waterburst = 12, --remember, around 50% actually ends up spawning on average due to burnblow+sprayangle interaction }, } local unitsTable = {} for lvl, stats in pairs(lvlParams) do unitsTable["scavmist" .. lvl] = { - maxacc = 0.207, + maxacc = 0.207, autoheal = 50, maxdec = 0.6486, energycost = 1, @@ -82,7 +81,7 @@ for lvl, stats in pairs(lvlParams) do canmove = true, canassist = true, cancloak = true, - initcloaked = true, + initcloaked = true, decloakonfire = false, collisionvolumeoffsets = "0 0 0", collisionvolumescales = "64 24 64", @@ -102,8 +101,8 @@ for lvl, stats in pairs(lvlParams) do movementclass = "SCAVMIST", nochasecategory = "ALL", objectname = "scavs/scavmistflare.s3o", - power = stats.power, - radardistancejam = stats.jamandlosdistance, + power = stats.power, + radardistancejam = stats.jamandlosdistance, script = "scavs/SCAVMIST.cob", seismicsignature = 0, selfdestructas = stats.selfdestructas, @@ -122,7 +121,7 @@ for lvl, stats in pairs(lvlParams) do normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.001, subfolder = "Scavengers", - inheritxpratemultiplier = 0.1, + inheritxpratemultiplier = 0.1, childreninheritxp = "BOTCANNON", parentsinheritxp = "BOTCANNON", }, @@ -167,12 +166,14 @@ for lvl, stats in pairs(lvlParams) do explosiongenerator = "", gravityaffected = "true", heightboostfactor = 0, - model = "", + model = "", name = "Teleporter", noselfdamage = true, range = stats.unitspawnrange, reloadtime = 60, - rgb = 0.0, 0.0, 0.0, + rgb = 0.0, + 0.0, + 0.0, soundhit = "", soundhitwet = "", soundstart = "", @@ -184,8 +185,8 @@ for lvl, stats in pairs(lvlParams) do spawns_name = stats.landunitspawns, spawns_surface = "LAND", spawns_mode = "random", - spawns_ceg = "scav-spawnexplo-medium", - spawns_stun = 1 + spawns_ceg = "scav-spawnexplo-medium", + spawns_stun = 1, }, damage = { default = 0, @@ -210,13 +211,15 @@ for lvl, stats in pairs(lvlParams) do explosiongenerator = "", gravityaffected = "true", heightboostfactor = 0, - model = "", + model = "", name = "Teleporter", noselfdamage = true, proximitypriority = -1, range = stats.turretspawnrange, reloadtime = 60, - rgb = 0.0, 0.0, 0.0, + rgb = 0.0, + 0.0, + 0.0, soundhit = "", soundhitwet = "", soundstart = "", @@ -229,8 +232,8 @@ for lvl, stats in pairs(lvlParams) do spawns_surface = "LAND", spawns_mode = "random", spawns_expire = 60, - spawns_ceg = "scav-spawnexplo-medium", - spawns_stun = 1 + spawns_ceg = "scav-spawnexplo-medium", + spawns_stun = 1, }, damage = { default = 0, @@ -244,7 +247,7 @@ for lvl, stats in pairs(lvlParams) do burnblow = true, burst = stats.waterburst, burstrate = 0.1, - craterareaofeffect = 0, + craterareaofeffect = 0, craterboost = 0, cratermult = 0, collidefriendly = false, @@ -256,13 +259,15 @@ for lvl, stats in pairs(lvlParams) do explosiongenerator = "", gravityaffected = "true", heightboostfactor = 0, - model = "", + model = "", name = "Teleporter", noselfdamage = true, proximitypriority = -1, range = stats.turretspawnrange, reloadtime = 60, - rgb = 0.0, 0.0, 0.0, + rgb = 0.0, + 0.0, + 0.0, soundhit = "", soundhitwet = "", soundstart = "", @@ -274,8 +279,8 @@ for lvl, stats in pairs(lvlParams) do spawns_name = stats.waterspawns, spawns_surface = "SEA", spawns_mode = "random", - spawns_ceg = "scav-spawnexplo-medium", - spawns_stun = 1 + spawns_ceg = "scav-spawnexplo-medium", + spawns_stun = 1, }, damage = { default = 0, @@ -284,19 +289,18 @@ for lvl, stats in pairs(lvlParams) do }, weapons = { [1] = { - badtargetcategory = "VTOL", + badtargetcategory = "VTOL", def = "landunitspawner", - onlytargetcategory = "NOTSUB", + onlytargetcategory = "NOTSUB", }, [2] = { - badtargetcategory = "VTOL UNDERWATER", + badtargetcategory = "VTOL UNDERWATER", def = "landturretspawner", }, [3] = { - badtargetcategory = "VTOL", + badtargetcategory = "VTOL", def = "waterspawner", }, - }, } end diff --git a/units/Scavengers/Ships/armdecadet3.lua b/units/Scavengers/Ships/armdecadet3.lua index 97afb7c4335..ccdd30f4db5 100644 --- a/units/Scavengers/Ships/armdecadet3.lua +++ b/units/Scavengers/Ships/armdecadet3.lua @@ -32,7 +32,7 @@ return { turnrate = 180, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", techlevel = 3, diff --git a/units/Scavengers/Ships/armpshipt3.lua b/units/Scavengers/Ships/armpshipt3.lua index 4764dc968d4..512ae7e35f2 100644 --- a/units/Scavengers/Ships/armpshipt3.lua +++ b/units/Scavengers/Ships/armpshipt3.lua @@ -33,7 +33,7 @@ return { turnrate = 270, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmShips", techlevel = 3, diff --git a/units/Scavengers/Ships/armptt2.lua b/units/Scavengers/Ships/armptt2.lua index 136d53ad416..92fb9adc7b0 100644 --- a/units/Scavengers/Ships/armptt2.lua +++ b/units/Scavengers/Ships/armptt2.lua @@ -35,7 +35,7 @@ return { turnrate = 180, waterline = 0, customparams = { - unitgroup = 'weaponaa', + unitgroup = "weaponaa", maxrange = "260", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", diff --git a/units/Scavengers/Ships/armserpt3.lua b/units/Scavengers/Ships/armserpt3.lua index bc0da35b34e..959d919ab31 100644 --- a/units/Scavengers/Ships/armserpt3.lua +++ b/units/Scavengers/Ships/armserpt3.lua @@ -34,7 +34,7 @@ return { upright = true, waterline = 80, --45, customparams = { - unitgroup = 'sub', + unitgroup = "sub", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmShips/T2", diff --git a/units/Scavengers/Ships/coresuppt3.lua b/units/Scavengers/Ships/coresuppt3.lua index e895c8edbe9..2cd867fe6ff 100644 --- a/units/Scavengers/Ships/coresuppt3.lua +++ b/units/Scavengers/Ships/coresuppt3.lua @@ -10,7 +10,7 @@ return { buildtime = 400000, canmove = true, collisionvolumeoffsets = "0 -14 -6", - collisionvolumescales = "84 84 246",--"19 19 58", + collisionvolumescales = "84 84 246", --"19 19 58", collisionvolumetype = "CylZ", corpse = "DEAD", explodeas = "bantha", @@ -32,7 +32,7 @@ return { turnrate = 120, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "ZephyrSkies & Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "CorShips", diff --git a/units/Scavengers/Ships/corslrpc.lua b/units/Scavengers/Ships/corslrpc.lua index fcb27463a31..ac79edb170f 100644 --- a/units/Scavengers/Ships/corslrpc.lua +++ b/units/Scavengers/Ships/corslrpc.lua @@ -34,7 +34,7 @@ return { turnrate = 60, waterline = 0, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "CorShips", diff --git a/units/Scavengers/Vehicles/armdronecarryland.lua b/units/Scavengers/Vehicles/armdronecarryland.lua index a5889bced60..b327900b29c 100644 --- a/units/Scavengers/Vehicles/armdronecarryland.lua +++ b/units/Scavengers/Vehicles/armdronecarryland.lua @@ -115,7 +115,7 @@ return { craterboost = 0, cratermult = 0, edgeeffectiveness = 0.15, - explosiongenerator = "",--"custom:genericshellexplosion-medium", + explosiongenerator = "", --"custom:genericshellexplosion-medium", gravityaffected = "true", hightrajectory = 1, impulsefactor = 0.123, @@ -126,9 +126,9 @@ return { range = 1200, reloadtime = 2.5, size = 0, - soundhit = "",--"xplomed2", - soundhitwet = "",--"splssml", - soundstart = "",--"cannhvy1", + soundhit = "", --"xplomed2", + soundhitwet = "", --"splssml", + soundstart = "", --"cannhvy1", stockpile = true, stockpiletime = 4, turret = true, @@ -138,27 +138,27 @@ return { default = 0, }, customparams = { - carried_unit = "armdrone", --Name of the unit spawned by this carrier unit. + carried_unit = "armdrone", --Name of the unit spawned by this carrier unit. -- carried_unit2... Currently not implemented, but planned. engagementrange = 1250, --spawns_surface = "SEA", -- "LAND" or "SEA". The SEA option has not been tested currently. - spawnrate = 7, --Spawnrate roughly in seconds. - maxunits = 16, --Will spawn units until this amount has been reached. + spawnrate = 7, --Spawnrate roughly in seconds. + maxunits = 16, --Will spawn units until this amount has been reached. startingdronecount = 8, - energycost = 750,--650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - metalcost = 30,--29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. - controlradius = 1100, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. + energycost = 750, --650, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + metalcost = 30, --29, --Custom spawn cost. Remove this or set = nil to inherit the cost from the carried_unit unitDef. Cost inheritance is currently not working. + controlradius = 1100, --The spawned units should stay within this radius. Unfinished behavior may cause exceptions. Planned: radius = 0 to disable radius limit. decayrate = 6, - attackformationspread = 120, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. - attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. + attackformationspread = 120, --Used to spread out the drones when attacking from a docked state. Distance between each drone when spreading out. + attackformationoffset = 30, --Used to spread out the drones when attacking from a docked state. Distance from the carrier when they start moving directly to the target. Given as a percentage of the distance to the target. carrierdeaththroe = "release", dockingarmor = 0.2, dockinghealrate = 24, docktohealthreshold = 50, - enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. + enabledocking = true, --If enabled, docking behavior is used. Currently docking while moving or stopping, and undocking while attacking. Unfinished behavior may cause exceptions. dockingHelperSpeed = 5, dockingpieces = "11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27", - dockingradius = 300, --The range at which the units snap to the carrier unit when docking. + dockingradius = 300, --The range at which the units snap to the carrier unit when docking. stockpilelimit = 16, stockpilemetal = 30, stockpileenergy = 750, @@ -166,7 +166,7 @@ return { dronedocktime = 2, droneairtime = 60, droneammo = 9, - } + }, }, }, weapons = { diff --git a/units/Scavengers/Vehicles/armrattet4.lua b/units/Scavengers/Vehicles/armrattet4.lua index e7286274dff..c8d7dc82741 100644 --- a/units/Scavengers/Vehicles/armrattet4.lua +++ b/units/Scavengers/Vehicles/armrattet4.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1, turnrate = 150, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-large", kickback = "-0.4", diff --git a/units/Scavengers/Vehicles/armvadert4.lua b/units/Scavengers/Vehicles/armvadert4.lua index f985a2c4516..2bf539ad504 100644 --- a/units/Scavengers/Vehicles/armvadert4.lua +++ b/units/Scavengers/Vehicles/armvadert4.lua @@ -34,7 +34,7 @@ return { turnrate = 100, upright = false, customparams = { - unitgroup = 'explo', + unitgroup = "explo", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "other/scavengers", diff --git a/units/Scavengers/Vehicles/armzapper.lua b/units/Scavengers/Vehicles/armzapper.lua index 46bc98a901c..f8ecfcbfd7c 100644 --- a/units/Scavengers/Vehicles/armzapper.lua +++ b/units/Scavengers/Vehicles/armzapper.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 0, turnrate = 800, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "", kickback = "0", diff --git a/units/Scavengers/Vehicles/corforge.lua b/units/Scavengers/Vehicles/corforge.lua index ca54ccb80e5..6be2815a040 100644 --- a/units/Scavengers/Vehicles/corforge.lua +++ b/units/Scavengers/Vehicles/corforge.lua @@ -47,7 +47,7 @@ return { [7] = "corspec", }, customparams = { - unitgroup = 'buildert2', + unitgroup = "buildert2", model_author = "MASHUP", normaltex = "unittextures/cor_normal.dds", subfolder = "CorVehicles/T2", diff --git a/units/Scavengers/Vehicles/corftiger.lua b/units/Scavengers/Vehicles/corftiger.lua index bca6161d5a5..7dfd2a1e235 100644 --- a/units/Scavengers/Vehicles/corftiger.lua +++ b/units/Scavengers/Vehicles/corftiger.lua @@ -35,7 +35,7 @@ return { turninplacespeedlimit = 1.72656, turnrate = 347, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", diff --git a/units/Scavengers/Vehicles/corgatreap.lua b/units/Scavengers/Vehicles/corgatreap.lua index c62053a6205..2cc8d6a82a6 100644 --- a/units/Scavengers/Vehicles/corgatreap.lua +++ b/units/Scavengers/Vehicles/corgatreap.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1.72656, turnrate = 325, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-medium", kickback = "-2.4", @@ -107,32 +107,32 @@ return { }, weapondefs = { -- cor_reap = { - -- areaofeffect = 64, - -- avoidfeature = false, - -- craterareaofeffect = 0, - -- craterboost = 0, - -- cratermult = 0, - -- edgeeffectiveness = 0.15, - -- explosiongenerator = "custom:genericshellexplosion-small", - -- gravityaffected = "true", - -- impulsefactor = 0.123, - -- name = "PlasmaCannon", - -- noselfdamage = true, - -- range = 410, - -- reloadtime = 0.7, - -- soundhit = "xplomed2", - -- soundhitwet = "splssml", - -- soundstart = "cannon3", - -- turret = true, - -- weapontype = "Cannon", - -- weaponvelocity = 380, - -- damage = { - -- bombers = 35, - -- default = 109, - -- fighters = 35, - -- subs = 5, - -- vtol = 35, - -- }, + -- areaofeffect = 64, + -- avoidfeature = false, + -- craterareaofeffect = 0, + -- craterboost = 0, + -- cratermult = 0, + -- edgeeffectiveness = 0.15, + -- explosiongenerator = "custom:genericshellexplosion-small", + -- gravityaffected = "true", + -- impulsefactor = 0.123, + -- name = "PlasmaCannon", + -- noselfdamage = true, + -- range = 410, + -- reloadtime = 0.7, + -- soundhit = "xplomed2", + -- soundhitwet = "splssml", + -- soundstart = "cannon3", + -- turret = true, + -- weapontype = "Cannon", + -- weaponvelocity = 380, + -- damage = { + -- bombers = 35, + -- default = 109, + -- fighters = 35, + -- subs = 5, + -- vtol = 35, + -- }, -- }, cor_laserh1 = { areaofeffect = 14, diff --git a/units/Scavengers/Vehicles/corgolt4.lua b/units/Scavengers/Vehicles/corgolt4.lua index 82929d901c5..21444ecc31f 100644 --- a/units/Scavengers/Vehicles/corgolt4.lua +++ b/units/Scavengers/Vehicles/corgolt4.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1, turnrate = 150, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-tiny", kickback = "-4", diff --git a/units/Scavengers/Vehicles/cortorch.lua b/units/Scavengers/Vehicles/cortorch.lua index 949fcbcde41..81124c0e656 100644 --- a/units/Scavengers/Vehicles/cortorch.lua +++ b/units/Scavengers/Vehicles/cortorch.lua @@ -37,7 +37,7 @@ return { turninplacespeedlimit = 4.7, turnrate = 364, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", model_author = "Flaka, Itanthias kitbash", normaltex = "unittextures/cor_normal.dds", paralyzemultiplier = 0.0130, diff --git a/units/Scavengers/Vehicles/corves.lua b/units/Scavengers/Vehicles/corves.lua index 096e0d3983f..d97f4fb801f 100644 --- a/units/Scavengers/Vehicles/corves.lua +++ b/units/Scavengers/Vehicles/corves.lua @@ -36,7 +36,7 @@ return { turninplacespeedlimit = 1, turnrate = 150, customparams = { - unitgroup = 'weapon', + unitgroup = "weapon", basename = "base", firingceg = "barrelshot-tiny", kickback = "-4", diff --git a/units/armassistdrone.lua b/units/armassistdrone.lua index 91c332fd325..6d7bfbb71b7 100644 --- a/units/armassistdrone.lua +++ b/units/armassistdrone.lua @@ -31,7 +31,7 @@ return { terraformspeed = 225, turninplaceanglelimit = 360, turnrate = 740, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { "armsolar", "armadvsol", @@ -65,7 +65,7 @@ return { "armfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "FireStorm, Flaka", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmAircraft", diff --git a/units/armassistdrone_land.lua b/units/armassistdrone_land.lua index 7d237e5dc84..3dd85e24b3c 100644 --- a/units/armassistdrone_land.lua +++ b/units/armassistdrone_land.lua @@ -35,7 +35,7 @@ return { turninplaceanglelimit = 90, turninplacespeedlimit = 0.9834, turnrate = 1000, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { [1] = "armsolar", [2] = "armwin", @@ -66,7 +66,7 @@ return { [27] = "armfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "Beherith", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmVehicles", diff --git a/units/armcomnew.lua b/units/armcomnew.lua index 3c97fbcccd2..bf2974a8083 100644 --- a/units/armcomnew.lua +++ b/units/armcomnew.lua @@ -38,7 +38,7 @@ return { movementclass = "COMMANDERBOT", movestate = 0, nochasecategory = "ALL", - objectname = "Units/ARMCOM"..(Spring.GetModOptions().xmas and '-XMAS' or '')..".s3o", + objectname = "Units/ARMCOM" .. (Spring.GetModOptions().xmas and "-XMAS" or "") .. ".s3o", radardistance = 700, radaremitheight = 40, reclaimable = false, diff --git a/units/corassistdrone.lua b/units/corassistdrone.lua index 7e036999fc6..93448d36408 100644 --- a/units/corassistdrone.lua +++ b/units/corassistdrone.lua @@ -31,7 +31,7 @@ return { terraformspeed = 225, turninplaceanglelimit = 360, turnrate = 740, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { "corsolar", "coradvsol", @@ -65,7 +65,7 @@ return { "corfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "Mr Bob, Flaka", normaltex = "unittextures/cor_normal.dds", subfolder = "CorAircraft", diff --git a/units/corassistdrone_land.lua b/units/corassistdrone_land.lua index efb4bdb980b..09f9d9d136b 100644 --- a/units/corassistdrone_land.lua +++ b/units/corassistdrone_land.lua @@ -36,7 +36,7 @@ return { turninplaceanglelimit = 90, turninplacespeedlimit = 0.9504, turnrate = 1000, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { [1] = "corsolar", [2] = "corwin", @@ -67,7 +67,7 @@ return { [27] = "corfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "CorVehicles", diff --git a/units/legassistdrone.lua b/units/legassistdrone.lua index 80495268613..95fe119c4e5 100644 --- a/units/legassistdrone.lua +++ b/units/legassistdrone.lua @@ -31,7 +31,7 @@ return { terraformspeed = 225, turninplaceanglelimit = 360, turnrate = 740, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { "legsolar", "legadvsol", @@ -65,7 +65,7 @@ return { "legfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorAircraft", diff --git a/units/legassistdrone_land.lua b/units/legassistdrone_land.lua index b71bb6d0d58..a4dfef449c8 100644 --- a/units/legassistdrone_land.lua +++ b/units/legassistdrone_land.lua @@ -36,7 +36,7 @@ return { turninplaceanglelimit = 90, turninplacespeedlimit = 0.9504, turnrate = 1000, - workertime = 100*Spring.GetModOptions().assistdronesbuildpowermultiplier, + workertime = 100 * Spring.GetModOptions().assistdronesbuildpowermultiplier, buildoptions = { "legsolar", "legwin", @@ -67,7 +67,7 @@ return { "legfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", model_author = "ZephyrSkies", normaltex = "unittextures/leg_normal.dds", subfolder = "CorVehicles", diff --git a/units/other/armrespawn.lua b/units/other/armrespawn.lua index 88b9a458645..88d2ea9e1a5 100644 --- a/units/other/armrespawn.lua +++ b/units/other/armrespawn.lua @@ -46,7 +46,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Beherith", normaltex = "unittextures/Arm_normal.dds", subfolder = "ArmBuildings/SeaUtil", diff --git a/units/other/armsat.lua b/units/other/armsat.lua index 481a5dc7f1b..ac9a1b1a3c8 100644 --- a/units/other/armsat.lua +++ b/units/other/armsat.lua @@ -43,7 +43,7 @@ return { wingangle = 0.05, wingdrag = 0.1, customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "FireStorm", normaltex = "unittextures/Arm_normal.dds", subfolder = "other", diff --git a/units/other/chip.lua b/units/other/chip.lua index 0a206c15013..4e6e1e19684 100644 --- a/units/other/chip.lua +++ b/units/other/chip.lua @@ -37,7 +37,7 @@ return { usebuildinggrounddecal = false, yardmap = "f", customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "Floris", nohealthbars = true, subfolder = "other", diff --git a/units/other/correspawn.lua b/units/other/correspawn.lua index 8b27b89996a..92f80445277 100644 --- a/units/other/correspawn.lua +++ b/units/other/correspawn.lua @@ -46,7 +46,7 @@ return { buildinggrounddecalsizey = 5, buildinggrounddecalsizex = 5, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Beherith", normaltex = "unittextures/cor_normal.dds", subfolder = "CorBuildings/SeaUtil", diff --git a/units/other/corsat.lua b/units/other/corsat.lua index 0cbac3f5d3e..20553728ce4 100644 --- a/units/other/corsat.lua +++ b/units/other/corsat.lua @@ -43,7 +43,7 @@ return { wingangle = 0.05, wingdrag = 0.1, customparams = { - unitgroup = 'util', + unitgroup = "util", model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", subfolder = "other", diff --git a/units/other/critters/critter_gull.lua b/units/other/critters/critter_gull.lua index 99c60883519..acb7207432e 100644 --- a/units/other/critters/critter_gull.lua +++ b/units/other/critters/critter_gull.lua @@ -47,52 +47,52 @@ return { subfolder = "other/critters", crashable = 0, }, --- weapondefs = { --- gullbomb = { --- areaofeffect = 36, --- avoidfeature = false, --- avoidfriendly = false, --- burnblow = true, --- collidefriendly = false, --- craterareaofeffect = 12, --- craterboost = -0.9, --- cratermult = -0.9, --- edgeeffectiveness = 0.65, --- explosiongenerator = "custom:noexplosion", --- firestarter = 100, --- flighttime = 2, --- impulseboost = 0.123, --- impulsefactor = 2, --- name = "Biological Weaponry", --- noselfdamage = true, --- range = 100, --- rgbcolor = {1.0, 1.0, 1.0}, --- reloadtime = 15, --- smoketrail = false, --- soundhit = "splslrg", --- soundhitwet = "splslrg", --- soundstart = "seacry3", --- startvelocity = 140, --- texture1 = "null", --- tolerance = 16000, --- tracks = false, --- turnrate = 32768, --- weaponacceleration = 40, --- weapontype = "MissileLauncher", --- weaponvelocity = 420, --- damage = { --- default = 10, --- subs = 5, --- }, --- }, --- --- }, --- weapons = { --- [1] = { --- badtargetcategory = "VTOL", --- def = "gullbomb", --- onlytargetcategory = "SURFACE", --- }, --- }, + -- weapondefs = { + -- gullbomb = { + -- areaofeffect = 36, + -- avoidfeature = false, + -- avoidfriendly = false, + -- burnblow = true, + -- collidefriendly = false, + -- craterareaofeffect = 12, + -- craterboost = -0.9, + -- cratermult = -0.9, + -- edgeeffectiveness = 0.65, + -- explosiongenerator = "custom:noexplosion", + -- firestarter = 100, + -- flighttime = 2, + -- impulseboost = 0.123, + -- impulsefactor = 2, + -- name = "Biological Weaponry", + -- noselfdamage = true, + -- range = 100, + -- rgbcolor = {1.0, 1.0, 1.0}, + -- reloadtime = 15, + -- smoketrail = false, + -- soundhit = "splslrg", + -- soundhitwet = "splslrg", + -- soundstart = "seacry3", + -- startvelocity = 140, + -- texture1 = "null", + -- tolerance = 16000, + -- tracks = false, + -- turnrate = 32768, + -- weaponacceleration = 40, + -- weapontype = "MissileLauncher", + -- weaponvelocity = 420, + -- damage = { + -- default = 10, + -- subs = 5, + -- }, + -- }, + -- + -- }, + -- weapons = { + -- [1] = { + -- badtargetcategory = "VTOL", + -- def = "gullbomb", + -- onlytargetcategory = "SURFACE", + -- }, + -- }, }, } diff --git a/units/other/critters/critter_penguin.lua b/units/other/critters/critter_penguin.lua index a904a0cb63f..b7aed548fc7 100644 --- a/units/other/critters/critter_penguin.lua +++ b/units/other/critters/critter_penguin.lua @@ -59,61 +59,61 @@ return { paralyzemultiplier = 0, subfolder = "other/critters", }, --- weapondefs = { --- eyelaser = { --- areaofeffect = 8, --- avoidfeature = false, --- beamtime = 0.22, --- corethickness = 0.07, --- craterareaofeffect = 0, --- craterboost = 0, --- cratermult = 0, --- edgeeffectiveness = 0.3, --- energypershot = 0, --- explosiongenerator = "custom:laserhit-mini-red", --- firestarter = 100, --- impactonly = 1, --- impulseboost = 0, --- impulsefactor = 0, --- laserflaresize = 3.146, --- name = "LightLaser", --- noselfdamage = true, --- proximitypriority = 1, --- range = 125, --- reloadtime = 0.5, --- rgbcolor = "1 0 0", --- soundhitdry = "", --- soundhitwet = "sizzle", --- soundstart = "pensquawk1", --- soundtrigger = 1, --- targetborder = 0.75, --- targetmoveerror = 0.1, --- thickness = 0.6, --- tolerance = 6000, --- turret = false, --- weapontype = "BeamLaser", --- weaponvelocity = 2250, --- customparams = { --- nohealthbars = true, --- }, --- damage = { --- default = 4, --- subs = 1, --- vtol = 1, --- }, --- }, --- }, --- weapons = { --- [1] = { --- badtargetcategory = "VTOL", --- def = "EYELASER", --- onlytargetcategory = "NOTSUB", --- }, --- [2] = { --- badtargetcategory = "VTOL", --- def = "EYELASER", --- onlytargetcategory = "NOTSUB", --- }, --- }, + -- weapondefs = { + -- eyelaser = { + -- areaofeffect = 8, + -- avoidfeature = false, + -- beamtime = 0.22, + -- corethickness = 0.07, + -- craterareaofeffect = 0, + -- craterboost = 0, + -- cratermult = 0, + -- edgeeffectiveness = 0.3, + -- energypershot = 0, + -- explosiongenerator = "custom:laserhit-mini-red", + -- firestarter = 100, + -- impactonly = 1, + -- impulseboost = 0, + -- impulsefactor = 0, + -- laserflaresize = 3.146, + -- name = "LightLaser", + -- noselfdamage = true, + -- proximitypriority = 1, + -- range = 125, + -- reloadtime = 0.5, + -- rgbcolor = "1 0 0", + -- soundhitdry = "", + -- soundhitwet = "sizzle", + -- soundstart = "pensquawk1", + -- soundtrigger = 1, + -- targetborder = 0.75, + -- targetmoveerror = 0.1, + -- thickness = 0.6, + -- tolerance = 6000, + -- turret = false, + -- weapontype = "BeamLaser", + -- weaponvelocity = 2250, + -- customparams = { + -- nohealthbars = true, + -- }, + -- damage = { + -- default = 4, + -- subs = 1, + -- vtol = 1, + -- }, + -- }, + -- }, + -- weapons = { + -- [1] = { + -- badtargetcategory = "VTOL", + -- def = "EYELASER", + -- onlytargetcategory = "NOTSUB", + -- }, + -- [2] = { + -- badtargetcategory = "VTOL", + -- def = "EYELASER", + -- onlytargetcategory = "NOTSUB", + -- }, + -- }, }, } diff --git a/units/other/dummycom.lua b/units/other/dummycom.lua index 377685bcfb6..0374f51b508 100644 --- a/units/other/dummycom.lua +++ b/units/other/dummycom.lua @@ -2,9 +2,9 @@ -- and partially because the dice model is still drawn pregame so allies get visual feedback "for free" local def = VFS.Include("units/armcom.lua").armcom def.buildpic = "other/dice.dds" -def.customparams = {i18nfromunit = "random"} +def.customparams = { i18nfromunit = "random" } def.objectname = "cordice.s3o" def.script = "dice.lua" def.weapondefs = nil def.weapons = nil -return { dummycom = def } \ No newline at end of file +return { dummycom = def } diff --git a/units/other/evocom/armcomlvl10.lua b/units/other/evocom/armcomlvl10.lua index 373ccc2a280..e496cac8eec 100644 --- a/units/other/evocom/armcomlvl10.lua +++ b/units/other/evocom/armcomlvl10.lua @@ -1,5 +1,5 @@ return { - armcomlvl10 = { + armcomlvl10 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -111,7 +111,7 @@ return { "armannit3", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -129,7 +129,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -467,7 +467,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -518,13 +518,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -532,7 +532,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl2.lua b/units/other/evocom/armcomlvl2.lua index 3d128a139d1..dd9a9a545da 100644 --- a/units/other/evocom/armcomlvl2.lua +++ b/units/other/evocom/armcomlvl2.lua @@ -28,7 +28,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -41,11 +41,11 @@ return { mincloakdistance = 50, movementclass = "COMMANDERBOT", nochasecategory = "ALL", - objectname = "Units/ARMCOM"..(Spring.GetModOptions().xmas and '-XMAS' or '')..".s3o", + objectname = "Units/ARMCOM" .. (Spring.GetModOptions().xmas and "-XMAS" or "") .. ".s3o", radardistance = 700, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOM_lus.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -95,7 +95,7 @@ return { "armfrock", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -122,7 +122,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -374,12 +374,12 @@ return { [1] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/other/evocom/armcomlvl3.lua b/units/other/evocom/armcomlvl3.lua index b7e8ce067aa..994f2091acc 100644 --- a/units/other/evocom/armcomlvl3.lua +++ b/units/other/evocom/armcomlvl3.lua @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1100, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -109,7 +109,7 @@ return { "armdecom", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -136,7 +136,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -432,7 +432,7 @@ return { }, }, }, - shortgun = { + shortgun = { accuracy = 50, allowNonBlockingAim = true, areaofeffect = 10, @@ -477,7 +477,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, --beamtime = 0.25, beamttl = 0.8, burnblow = true, @@ -530,13 +530,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -544,7 +544,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "empflashbang", diff --git a/units/other/evocom/armcomlvl4.lua b/units/other/evocom/armcomlvl4.lua index 150e458b4de..1d75a960b63 100644 --- a/units/other/evocom/armcomlvl4.lua +++ b/units/other/evocom/armcomlvl4.lua @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1100, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -109,7 +109,7 @@ return { "armdecom", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -136,7 +136,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -432,92 +432,92 @@ return { }, }, }, - shortgun = { - accuracy = 50, - allowNonBlockingAim = true, - areaofeffect = 10, - avoidfeature = false, - beamdecay = 0.05, - beamtime = 0.1, - beamttl = 1, - corethickness = 0.233, - burnblow = true, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - cylindertargeting = 1, - edgeeffectiveness = 0.15, - explosionscar = false, - explosiongenerator = "custom:laserhit-beamer", - firestarter = 100, - impulsefactor = 0.123, - intensity = 0.7, - laserflaresize = 9.35, - name = "Scatter Beamer", - noselfdamage = true, - projectiles = 16, - range = 350, - reloadtime = 0.1, - rgbcolor = "0 0 1", - soundhitdry = "", - soundhitwet = "sizzle", - soundstart = "beamershot2", - sprayangle = 3500, - tolerance = 5000, - turret = true, - weapontype = "BeamLaser", - weaponvelocity = 1000, - customparams = { - weapons_group = 1, - }, - damage = { - default = 25, - }, + shortgun = { + accuracy = 50, + allowNonBlockingAim = true, + areaofeffect = 10, + avoidfeature = false, + beamdecay = 0.05, + beamtime = 0.1, + beamttl = 1, + corethickness = 0.233, + burnblow = true, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + cylindertargeting = 1, + edgeeffectiveness = 0.15, + explosionscar = false, + explosiongenerator = "custom:laserhit-beamer", + firestarter = 100, + impulsefactor = 0.123, + intensity = 0.7, + laserflaresize = 9.35, + name = "Scatter Beamer", + noselfdamage = true, + projectiles = 16, + range = 350, + reloadtime = 0.1, + rgbcolor = "0 0 1", + soundhitdry = "", + soundhitwet = "sizzle", + soundstart = "beamershot2", + sprayangle = 3500, + tolerance = 5000, + turret = true, + weapontype = "BeamLaser", + weaponvelocity = 1000, + customparams = { + weapons_group = 1, }, - empflashbang = { - areaofeffect = 50, - avoidfeature = false, - beamdecay = .8, - beamttl = 0.8, - burnblow = true, - collideenemy = false, - collidefeature = false, - collidefriendly = false, - collideground = false, - collideneutral = false, - corethickness = 1, - craterareaofeffect = 0, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 0.001, - explosiongenerator = "custom:genericshellexplosion-huge-lightning", - falloffrate = 0, - impactonly = 1, - impulsefactor = 0, - laserflaresize = 8.8, - name = "EMP Damage-Mitigating Flashbang", - noselfdamage = true, - paralyzer = true, - paralyzetime = 8, - range = 3, - reloadtime = 0.25, - rgbcolor = "1 1 1", - soundhitdry = "", - soundhitwet = "", - soundstart = "xplosml5", - soundtrigger = 1, - thickness = 6, - turret = true, - weapontype = "LaserCannon", - weaponvelocity = 1, - customparams = { - weapons_group = 1, - weapons_role = "secondary", - }, - damage = { - default = 20000, - }, + damage = { + default = 25, + }, + }, + empflashbang = { + areaofeffect = 50, + avoidfeature = false, + beamdecay = 0.8, + beamttl = 0.8, + burnblow = true, + collideenemy = false, + collidefeature = false, + collidefriendly = false, + collideground = false, + collideneutral = false, + corethickness = 1, + craterareaofeffect = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.001, + explosiongenerator = "custom:genericshellexplosion-huge-lightning", + falloffrate = 0, + impactonly = 1, + impulsefactor = 0, + laserflaresize = 8.8, + name = "EMP Damage-Mitigating Flashbang", + noselfdamage = true, + paralyzer = true, + paralyzetime = 8, + range = 3, + reloadtime = 0.25, + rgbcolor = "1 1 1", + soundhitdry = "", + soundhitwet = "", + soundstart = "xplosml5", + soundtrigger = 1, + thickness = 6, + turret = true, + weapontype = "LaserCannon", + weaponvelocity = 1, + customparams = { + weapons_group = 1, + weapons_role = "secondary", }, + damage = { + default = 20000, + }, + }, }, weapons = { [1] = { @@ -528,13 +528,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -542,7 +542,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl5.lua b/units/other/evocom/armcomlvl5.lua index b30370c1570..8963320d802 100644 --- a/units/other/evocom/armcomlvl5.lua +++ b/units/other/evocom/armcomlvl5.lua @@ -1,5 +1,5 @@ return { - armcomlvl5 = { + armcomlvl5 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -108,7 +108,7 @@ return { "armshockwave", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -135,7 +135,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -473,7 +473,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -524,13 +524,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -538,7 +538,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl6.lua b/units/other/evocom/armcomlvl6.lua index 0ef8e6f893c..0713ffc578b 100644 --- a/units/other/evocom/armcomlvl6.lua +++ b/units/other/evocom/armcomlvl6.lua @@ -1,5 +1,5 @@ return { - armcomlvl6 = { + armcomlvl6 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -108,7 +108,7 @@ return { "armshockwave", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -135,7 +135,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -473,7 +473,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -524,13 +524,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -538,7 +538,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl7.lua b/units/other/evocom/armcomlvl7.lua index efb051fdff8..caceefaffd3 100644 --- a/units/other/evocom/armcomlvl7.lua +++ b/units/other/evocom/armcomlvl7.lua @@ -1,5 +1,5 @@ return { - armcomlvl7 = { + armcomlvl7 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -109,7 +109,7 @@ return { "armlwall", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -136,7 +136,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -475,7 +475,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -526,13 +526,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -540,7 +540,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl8.lua b/units/other/evocom/armcomlvl8.lua index 3ed619a07ff..969981f6c2f 100644 --- a/units/other/evocom/armcomlvl8.lua +++ b/units/other/evocom/armcomlvl8.lua @@ -1,5 +1,5 @@ return { - armcomlvl8 = { + armcomlvl8 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -111,7 +111,7 @@ return { "armannit3", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -138,7 +138,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -476,7 +476,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -527,13 +527,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -541,7 +541,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcomlvl9.lua b/units/other/evocom/armcomlvl9.lua index 32ba63be66e..a827c32ce96 100644 --- a/units/other/evocom/armcomlvl9.lua +++ b/units/other/evocom/armcomlvl9.lua @@ -1,5 +1,5 @@ return { - armcomlvl9 = { + armcomlvl9 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "armcom", sightemitheight = 40, mass = 4900, @@ -47,7 +47,7 @@ return { radardistance = 1200, radaremitheight = 40, reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/ARMCOMHILVL.lua", seismicsignature = 0, selfdestructas = "commanderexplosion", @@ -111,7 +111,7 @@ return { "armannit3", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "armmex", iscommander = true, effigy_offset = 1, @@ -138,7 +138,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -476,7 +476,7 @@ return { empflashbang = { areaofeffect = 50, avoidfeature = false, - beamdecay = .8, + beamdecay = 0.8, beamttl = 0.8, burnblow = true, collideenemy = false, @@ -527,13 +527,13 @@ return { [2] = { badtargetcategory = "VTOL", def = "ARMCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { badtargetcategory = "GROUNDSCOUT", def = "LONGGUN", onlytargetcategory = "EMPABLE", @@ -541,7 +541,7 @@ return { [5] = { def = "SHORTGUN", onlytargetcategory = "NOTSUB", - fastautoretargeting = true, + fastautoretargeting = true, }, [6] = { def = "EMPFLASHBANG", diff --git a/units/other/evocom/armcorevodecom.lua b/units/other/evocom/armcorevodecom.lua index 585e058ee08..bbe43d7d49d 100644 --- a/units/other/evocom/armcorevodecom.lua +++ b/units/other/evocom/armcorevodecom.lua @@ -1,40 +1,39 @@ local unitsTable = {} for i = 2, 10 do - unitsTable['armdecomlvl' .. i] = VFS.Include('units/other/evocom/armcomlvl' .. i .. '.lua')['armcomlvl' .. i] --if this filepath is changed, the unit will no longer work! - unitsTable['armdecomlvl' .. i].selfdestructas = "decoycommander" - unitsTable['armdecomlvl' .. i].explodeas = "decoycommander" - unitsTable['armdecomlvl' .. i].corpse = nil - unitsTable['armdecomlvl' .. i].customparams.evolution_target = nil - unitsTable['armdecomlvl' .. i].customparams.iscommander = nil - unitsTable['armdecomlvl' .. i].customparams.effigy = nil - unitsTable['armdecomlvl' .. i].customparams.i18nfromunit = "armcomlvl" .. i - unitsTable['armdecomlvl' .. i].decoyfor = "armcomlvl" .. i - unitsTable['armdecomlvl' .. i].customparams.decoyfor = "armcomlvl" .. i - unitsTable['armdecomlvl' .. i].customparams.isdecoycommander = true - unitsTable['armdecomlvl' .. i].health = math.ceil(unitsTable['armdecomlvl' .. i].health*0.5) - unitsTable['armdecomlvl' .. i].weapondefs.disintegrator.damage.default = 40 - if unitsTable['armdecomlvl' .. i].weapondefs.backlauncher and unitsTable['armdecomlvl' .. i].weapondefs.backlauncher.customparams.stockpilelimit then - unitsTable['armdecomlvl' .. i].weapondefs.backlauncher.customparams.stockpilelimit = math.ceil(unitsTable['armdecomlvl' .. i].weapondefs.backlauncher.customparams.stockpilelimit*0.4) - end + unitsTable["armdecomlvl" .. i] = VFS.Include("units/other/evocom/armcomlvl" .. i .. ".lua")["armcomlvl" .. i] --if this filepath is changed, the unit will no longer work! + unitsTable["armdecomlvl" .. i].selfdestructas = "decoycommander" + unitsTable["armdecomlvl" .. i].explodeas = "decoycommander" + unitsTable["armdecomlvl" .. i].corpse = nil + unitsTable["armdecomlvl" .. i].customparams.evolution_target = nil + unitsTable["armdecomlvl" .. i].customparams.iscommander = nil + unitsTable["armdecomlvl" .. i].customparams.effigy = nil + unitsTable["armdecomlvl" .. i].customparams.i18nfromunit = "armcomlvl" .. i + unitsTable["armdecomlvl" .. i].decoyfor = "armcomlvl" .. i + unitsTable["armdecomlvl" .. i].customparams.decoyfor = "armcomlvl" .. i + unitsTable["armdecomlvl" .. i].customparams.isdecoycommander = true + unitsTable["armdecomlvl" .. i].health = math.ceil(unitsTable["armdecomlvl" .. i].health * 0.5) + unitsTable["armdecomlvl" .. i].weapondefs.disintegrator.damage.default = 40 + if unitsTable["armdecomlvl" .. i].weapondefs.backlauncher and unitsTable["armdecomlvl" .. i].weapondefs.backlauncher.customparams.stockpilelimit then + unitsTable["armdecomlvl" .. i].weapondefs.backlauncher.customparams.stockpilelimit = math.ceil(unitsTable["armdecomlvl" .. i].weapondefs.backlauncher.customparams.stockpilelimit * 0.4) + end - unitsTable['cordecomlvl' .. i] = VFS.Include('units/other/evocom/corcomlvl' .. i .. '.lua')['corcomlvl' .. i] --if this filepath is changed, the unit will no longer work! - unitsTable['cordecomlvl' .. i].selfdestructas = "decoycommander" - unitsTable['cordecomlvl' .. i].explodeas = "decoycommander" - unitsTable['cordecomlvl' .. i].corpse = nil - unitsTable['cordecomlvl' .. i].customparams.evolution_target = nil - unitsTable['cordecomlvl' .. i].customparams.iscommander = nil - unitsTable['cordecomlvl' .. i].customparams.effigy = nil - unitsTable['cordecomlvl' .. i].customparams.i18nfromunit = "corcomlvl" .. i - unitsTable['cordecomlvl' .. i].decoyfor = "corcomlvl" .. i - unitsTable['cordecomlvl' .. i].customparams.decoyfor = "corcomlvl" .. i - unitsTable['cordecomlvl' .. i].customparams.isdecoycommander = true - unitsTable['cordecomlvl' .. i].health = math.ceil(unitsTable['cordecomlvl' .. i].health*0.5) - unitsTable['cordecomlvl' .. i].weapondefs.disintegrator.damage.default = 40 - if unitsTable['cordecomlvl' .. i].weapondefs.repulsor and unitsTable['cordecomlvl' .. i].weapondefs.repulsor.shield.power then - unitsTable['cordecomlvl' .. i].weapondefs.repulsor.shield.power = unitsTable['cordecomlvl' .. i].weapondefs.repulsor.shield.power*0.2 - end + unitsTable["cordecomlvl" .. i] = VFS.Include("units/other/evocom/corcomlvl" .. i .. ".lua")["corcomlvl" .. i] --if this filepath is changed, the unit will no longer work! + unitsTable["cordecomlvl" .. i].selfdestructas = "decoycommander" + unitsTable["cordecomlvl" .. i].explodeas = "decoycommander" + unitsTable["cordecomlvl" .. i].corpse = nil + unitsTable["cordecomlvl" .. i].customparams.evolution_target = nil + unitsTable["cordecomlvl" .. i].customparams.iscommander = nil + unitsTable["cordecomlvl" .. i].customparams.effigy = nil + unitsTable["cordecomlvl" .. i].customparams.i18nfromunit = "corcomlvl" .. i + unitsTable["cordecomlvl" .. i].decoyfor = "corcomlvl" .. i + unitsTable["cordecomlvl" .. i].customparams.decoyfor = "corcomlvl" .. i + unitsTable["cordecomlvl" .. i].customparams.isdecoycommander = true + unitsTable["cordecomlvl" .. i].health = math.ceil(unitsTable["cordecomlvl" .. i].health * 0.5) + unitsTable["cordecomlvl" .. i].weapondefs.disintegrator.damage.default = 40 + if unitsTable["cordecomlvl" .. i].weapondefs.repulsor and unitsTable["cordecomlvl" .. i].weapondefs.repulsor.shield.power then + unitsTable["cordecomlvl" .. i].weapondefs.repulsor.shield.power = unitsTable["cordecomlvl" .. i].weapondefs.repulsor.shield.power * 0.2 + end end - return unitsTable diff --git a/units/other/evocom/comeffigy.lua b/units/other/evocom/comeffigy.lua index 531fccc3368..2898886b69b 100644 --- a/units/other/evocom/comeffigy.lua +++ b/units/other/evocom/comeffigy.lua @@ -1,41 +1,41 @@ local lvlParams = { ["1"] = { health = 4000, - energycost = 4000, - metalcost = 1000, - heapmetal = 1000, + energycost = 4000, + metalcost = 1000, + heapmetal = 1000, }, ["2"] = { health = 6000, - energycost = 6000, - metalcost = 1500, - heapmetal = 1500, + energycost = 6000, + metalcost = 1500, + heapmetal = 1500, }, ["3"] = { health = 8000, - energycost = 9000, - metalcost = 2250, - heapmetal = 2250, + energycost = 9000, + metalcost = 2250, + heapmetal = 2250, }, - ["4"] = { + ["4"] = { health = 10000, - energycost = 13500, - metalcost = 3375, - heapmetal = 3375, + energycost = 13500, + metalcost = 3375, + heapmetal = 3375, }, - ["5"] = { + ["5"] = { health = 12000, - energycost = 20000, - metalcost = 5000, - heapmetal = 5000, + energycost = 20000, + metalcost = 5000, + heapmetal = 5000, }, } local unitsTable = {} for lvl, stats in pairs(lvlParams) do unitsTable["comeffigylvl" .. lvl] = { - maxacc = 0.0, + maxacc = 0.0, activatewhenbuilt = true, - autoheal = math.ceil(stats.health/100), + autoheal = math.ceil(stats.health / 100), maxdec = 0, energycost = stats.energycost, metalcost = stats.metalcost, @@ -57,7 +57,7 @@ for lvl, stats in pairs(lvlParams) do footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, initcloaked = true, sightemitheight = 40, mass = 4900, @@ -71,7 +71,7 @@ for lvl, stats in pairs(lvlParams) do nochasecategory = "ALL", objectname = "Units/COMEFFIGY.s3o", reclaimable = false, - releaseheld = true, + releaseheld = true, script = "Units/COMEFFIGY.cob", seismicsignature = 0, selfdestructas = "decoycommander", @@ -84,7 +84,7 @@ for lvl, stats in pairs(lvlParams) do turnrate = 0, upright = true, customparams = { - unitgroup = 'util', + unitgroup = "util", iseffigy = true, model_author = "Mr Bob", normaltex = "unittextures/cor_normal.dds", @@ -98,7 +98,7 @@ for lvl, stats in pairs(lvlParams) do category = "heaps", collisionvolumescales = "35 12 54", collisionvolumetype = "cylY", - damage = stats.health*2, + damage = stats.health * 2, footprintx = 2, footprintz = 2, height = 4, @@ -147,11 +147,8 @@ for lvl, stats in pairs(lvlParams) do [1] = "corcomsel", }, }, - weapondefs = { - }, - weapons = { - - }, + weapondefs = {}, + weapons = {}, } end return unitsTable diff --git a/units/other/evocom/corcomlvl10.lua b/units/other/evocom/corcomlvl10.lua index 8e4f0b3cc3b..f6cacc9cbd2 100644 --- a/units/other/evocom/corcomlvl10.lua +++ b/units/other/evocom/corcomlvl10.lua @@ -1,5 +1,5 @@ return { - corcomlvl10 = { + corcomlvl10 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -70,27 +70,27 @@ return { "coruwadvms", "cortide", "cormexp", - "coruwmmm", + "coruwmmm", "coruwmme", - "corarad", - "coreyes", + "corarad", + "coreyes", "cordrag", "corfort", - "cormaw", - "corhllt", - "corvipe", - "cordoom", - "cortoast", - "corflak", - "corscreamer", - "cordl", - "corshroud", + "cormaw", + "corhllt", + "corvipe", + "cordoom", + "cortoast", + "corflak", + "corscreamer", + "cordl", + "corshroud", "corjuno", "corlab", "corvp", "corap", - "coratl", - "corenaa", + "coratl", + "corenaa", "corfrad", "corfus", "corsy", @@ -103,7 +103,7 @@ return { "corgate", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormoho", iscommander = true, effigy_offset = 1, @@ -122,7 +122,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -253,7 +253,7 @@ return { damage = { default = 120, subs = 49, - } + }, }, corcomsealaser = { areaofeffect = 70, @@ -461,7 +461,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/other/evocom/corcomlvl2.lua b/units/other/evocom/corcomlvl2.lua index b66a3f927cd..777ce27342f 100644 --- a/units/other/evocom/corcomlvl2.lua +++ b/units/other/evocom/corcomlvl2.lua @@ -29,7 +29,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -42,7 +42,7 @@ return { mincloakdistance = 50, movementclass = "COMMANDERBOT", nochasecategory = "ALL", - objectname = "Units/CORCOM"..(Spring.GetModOptions().xmas and '-XMAS' or '')..".s3o", + objectname = "Units/CORCOM" .. (Spring.GetModOptions().xmas and "-XMAS" or "") .. ".s3o", radardistance = 700, radaremitheight = 40, reclaimable = false, @@ -89,7 +89,7 @@ return { [27] = "corfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -114,7 +114,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -374,7 +374,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/other/evocom/corcomlvl3.lua b/units/other/evocom/corcomlvl3.lua index 1ec4597fd0f..8a6b2c52d49 100644 --- a/units/other/evocom/corcomlvl3.lua +++ b/units/other/evocom/corcomlvl3.lua @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -72,27 +72,27 @@ return { [9] = "cortide", [10] = "corexp", [11] = "cormstor", - [12] = "coruwes", - [13] = "corfmkr", - [14] = "coreyes", - [15] = "corrad", - [16] = "cordrag", - [17] = "cormaw", - [18] = "corllt", - [19] = "corhllt", - [20] = "corhlt", - [21] = "corpun", - [22] = "corfrock", - [23] = "cormadsam", - [24] = "corerad", - [25] = "cordl", - [26] = "corjamt", + [12] = "coruwes", + [13] = "corfmkr", + [14] = "coreyes", + [15] = "corrad", + [16] = "cordrag", + [17] = "cormaw", + [18] = "corllt", + [19] = "corhllt", + [20] = "corhlt", + [21] = "corpun", + [22] = "corfrock", + [23] = "cormadsam", + [24] = "corerad", + [25] = "cordl", + [26] = "corjamt", [27] = "corjuno", [28] = "corlab", [29] = "corvp", [30] = "corap", - [31] = "cortl", - [32] = "corfrt", + [31] = "cortl", + [32] = "corfrt", [33] = "corfrad", [34] = "corsy", [35] = "cornanotc", @@ -102,7 +102,7 @@ return { [39] = "corfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -127,7 +127,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -426,21 +426,21 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { def = "REPULSOR", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, - }, + }, }, }, } diff --git a/units/other/evocom/corcomlvl4.lua b/units/other/evocom/corcomlvl4.lua index a088cdec5bd..9ee894c75c3 100644 --- a/units/other/evocom/corcomlvl4.lua +++ b/units/other/evocom/corcomlvl4.lua @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -72,27 +72,27 @@ return { [9] = "cortide", [10] = "corexp", [11] = "cormstor", - [12] = "coruwes", - [13] = "corfmkr", - [14] = "coreyes", - [15] = "corrad", - [16] = "cordrag", - [17] = "cormaw", - [18] = "corllt", - [19] = "corhllt", - [20] = "corhlt", - [21] = "corpun", - [22] = "corfrock", - [23] = "cormadsam", - [24] = "corerad", - [25] = "cordl", - [26] = "corjamt", + [12] = "coruwes", + [13] = "corfmkr", + [14] = "coreyes", + [15] = "corrad", + [16] = "cordrag", + [17] = "cormaw", + [18] = "corllt", + [19] = "corhllt", + [20] = "corhlt", + [21] = "corpun", + [22] = "corfrock", + [23] = "cormadsam", + [24] = "corerad", + [25] = "cordl", + [26] = "corjamt", [27] = "corjuno", [28] = "corlab", [29] = "corvp", [30] = "corap", - [31] = "cortl", - [32] = "corfrt", + [31] = "cortl", + [32] = "corfrt", [33] = "corfrad", [34] = "corsy", [35] = "cornanotc", @@ -102,7 +102,7 @@ return { [39] = "corfhp", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -127,7 +127,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -454,17 +454,17 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { def = "REPULSOR", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, diff --git a/units/other/evocom/corcomlvl5.lua b/units/other/evocom/corcomlvl5.lua index e28c349411f..ef4f7222eae 100644 --- a/units/other/evocom/corcomlvl5.lua +++ b/units/other/evocom/corcomlvl5.lua @@ -1,5 +1,5 @@ return { - corcomlvl5 = { + corcomlvl5 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -102,7 +102,7 @@ return { "coruwageo", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -127,7 +127,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -457,17 +457,17 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { def = "REPULSOR", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { badtargetcategory = "commander", def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", diff --git a/units/other/evocom/corcomlvl6.lua b/units/other/evocom/corcomlvl6.lua index 310300cde0f..8a2f4acc50e 100644 --- a/units/other/evocom/corcomlvl6.lua +++ b/units/other/evocom/corcomlvl6.lua @@ -1,5 +1,5 @@ return { - corcomlvl6 = { + corcomlvl6 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -102,7 +102,7 @@ return { "coruwageo", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -127,7 +127,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -338,7 +338,7 @@ return { raptorqueen = 10, }, }, - corcomeyelaser = { + corcomeyelaser = { allowNonBlockingAim = true, areaofeffect = 50, avoidfeature = false, @@ -461,17 +461,17 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { def = "REPULSOR", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, diff --git a/units/other/evocom/corcomlvl7.lua b/units/other/evocom/corcomlvl7.lua index 52183079dc7..a97b6bbc02c 100644 --- a/units/other/evocom/corcomlvl7.lua +++ b/units/other/evocom/corcomlvl7.lua @@ -1,5 +1,5 @@ return { - corcomlvl7 = { + corcomlvl7 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -102,7 +102,7 @@ return { "coruwageo", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormex", iscommander = true, effigy_offset = 1, @@ -127,7 +127,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -339,7 +339,7 @@ return { raptorqueen = 10, }, }, - corcomeyelaser = { + corcomeyelaser = { allowNonBlockingAim = true, areaofeffect = 50, avoidfeature = false, @@ -462,17 +462,17 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", onlytargetcategory = "NOTSUB", }, - [4] = { + [4] = { def = "REPULSOR", onlytargetcategory = "NOTSUB", }, - [5] = { + [5] = { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, diff --git a/units/other/evocom/corcomlvl8.lua b/units/other/evocom/corcomlvl8.lua index 20c44efdccc..b6f438fc1c4 100644 --- a/units/other/evocom/corcomlvl8.lua +++ b/units/other/evocom/corcomlvl8.lua @@ -1,5 +1,5 @@ return { - corcomlvl8 = { + corcomlvl8 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -103,7 +103,7 @@ return { "corgate", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormoho", iscommander = true, effigy_offset = 1, @@ -129,7 +129,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -260,7 +260,7 @@ return { damage = { default = 80, subs = 25, - } + }, }, corcomsealaser = { areaofeffect = 70, @@ -469,7 +469,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/other/evocom/corcomlvl9.lua b/units/other/evocom/corcomlvl9.lua index 19830c0eeec..8a7108da0fc 100644 --- a/units/other/evocom/corcomlvl9.lua +++ b/units/other/evocom/corcomlvl9.lua @@ -1,5 +1,5 @@ return { - corcomlvl9 = { + corcomlvl9 = { maxacc = 0.18, activatewhenbuilt = true, autoheal = 5, @@ -30,7 +30,7 @@ return { footprintx = 2, footprintz = 2, hidedamage = true, - holdsteady = true, + holdsteady = true, icontype = "corcom", sightemitheight = 40, mass = 4900, @@ -70,27 +70,27 @@ return { "coruwadvms", "cortide", "cormexp", - "coruwmmm", + "coruwmmm", "coruwmme", - "corarad", - "coreyes", + "corarad", + "coreyes", "cordrag", "corfort", - "cormaw", - "corhllt", - "corvipe", - "cordoom", - "cortoast", - "corflak", - "corscreamer", - "cordl", - "corshroud", + "cormaw", + "corhllt", + "corvipe", + "cordoom", + "cortoast", + "corflak", + "corscreamer", + "cordl", + "corshroud", "corjuno", "corlab", "corvp", "corap", - "coratl", - "corenaa", + "coratl", + "corenaa", "corfrad", "corfus", "corsy", @@ -103,7 +103,7 @@ return { "corgate", }, customparams = { - unitgroup = 'builder', + unitgroup = "builder", area_mex_def = "cormoho", iscommander = true, effigy_offset = 1, @@ -129,7 +129,7 @@ return { firestateoncloak = 0, minimum_respawn_stun = 5, distance_stun_multiplier = 1, - fall_damage_multiplier = 5,--this ensures commander dies when it hits the ground so effigies can trigger respawn. + fall_damage_multiplier = 5, --this ensures commander dies when it hits the ground so effigies can trigger respawn. }, featuredefs = { dead = { @@ -260,7 +260,7 @@ return { damage = { default = 96, subs = 38, - } + }, }, corcomsealaser = { areaofeffect = 70, @@ -377,7 +377,7 @@ return { soundstart = "heatray3burn", soundstartvolume = 11, soundtrigger = 1, - thickness = 4.5, + thickness = 4.5, turret = true, weapontype = "BeamLaser", weaponvelocity = 1500, @@ -468,7 +468,7 @@ return { [2] = { badtargetcategory = "VTOL", def = "CORCOMSEALASER", - onlytargetcategory = "NOTAIR" + onlytargetcategory = "NOTAIR", }, [3] = { def = "DISINTEGRATOR", diff --git a/units/other/hats/commander_cosmetics.lua b/units/other/hats/commander_cosmetics.lua index c7ee6f226c9..4335632ff2b 100644 --- a/units/other/hats/commander_cosmetics.lua +++ b/units/other/hats/commander_cosmetics.lua @@ -1,6 +1,6 @@ local units = {} local def = { - maxacc = 0, + maxacc = 0, blocking = false, maxdec = 0, energycost = 10000, @@ -101,4 +101,4 @@ units["cor_leftshoulder_nationwars_us"] = table.copy(def) units["cor_leftshoulder_nationwars_us"].objectname = "hats/cor_leftshoulder_nationwars_us.s3o" units["cor_leftshoulder_nationwars_us"].customparams.normaltex = "unittextures/cor_normal.dds" -return units \ No newline at end of file +return units diff --git a/units/other/legnanotcbase.lua b/units/other/legnanotcbase.lua index 85fb3005ee1..441df84cbe2 100644 --- a/units/other/legnanotcbase.lua +++ b/units/other/legnanotcbase.lua @@ -46,7 +46,7 @@ return { buildinggrounddecalsizey = 8, buildinggrounddecalsizex = 8, buildinggrounddecaldecayspeed = 30, - unitgroup = 'builder', + unitgroup = "builder", model_author = "Tharsis", normaltex = "unittextures/leg_normal.dds", subfolder = "CorBuildings/SeaUtil", diff --git a/units/other/lootboxes/lootboxbronze.lua b/units/other/lootboxes/lootboxbronze.lua index 048b3c3694b..2c381afa782 100644 --- a/units/other/lootboxes/lootboxbronze.lua +++ b/units/other/lootboxes/lootboxbronze.lua @@ -51,7 +51,7 @@ return { reclaimable = false, customparams = { fall_damage_multiplier = 0, - unitgroup = 'energy', + unitgroup = "energy", normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", paratrooper = true, diff --git a/units/other/lootboxes/lootboxgold.lua b/units/other/lootboxes/lootboxgold.lua index bd689b6202e..3e922375856 100644 --- a/units/other/lootboxes/lootboxgold.lua +++ b/units/other/lootboxes/lootboxgold.lua @@ -50,7 +50,7 @@ return { reclaimable = false, customparams = { fall_damage_multiplier = 0, - unitgroup = 'energy', + unitgroup = "energy", normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", paratrooper = true, diff --git a/units/other/lootboxes/lootboxnano.lua b/units/other/lootboxes/lootboxnano.lua index 3a11e53f449..f735c4fb98b 100644 --- a/units/other/lootboxes/lootboxnano.lua +++ b/units/other/lootboxes/lootboxnano.lua @@ -1,8 +1,8 @@ local lootboxesDefs = {} -local nanoDefCreator= VFS.Include("unitbasedefs/lootboxes/lootboxnano.lua") -for t = 1,4 do - for i = 1,9 do - lootboxesDefs["lootboxnano_t"..t.."_var"..i] = nanoDefCreator.CreateNanoUnitDef(nanoDefCreator.Tiers["T"..t]) - end +local nanoDefCreator = VFS.Include("unitbasedefs/lootboxes/lootboxnano.lua") +for t = 1, 4 do + for i = 1, 9 do + lootboxesDefs["lootboxnano_t" .. t .. "_var" .. i] = nanoDefCreator.CreateNanoUnitDef(nanoDefCreator.Tiers["T" .. t]) + end end -return lootboxesDefs \ No newline at end of file +return lootboxesDefs diff --git a/units/other/lootboxes/lootboxplatinum.lua b/units/other/lootboxes/lootboxplatinum.lua index 359def4e53b..05b3b9c9bbb 100644 --- a/units/other/lootboxes/lootboxplatinum.lua +++ b/units/other/lootboxes/lootboxplatinum.lua @@ -50,7 +50,7 @@ return { reclaimable = false, customparams = { fall_damage_multiplier = 0, - unitgroup = 'energy', + unitgroup = "energy", normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", paratrooper = true, diff --git a/units/other/lootboxes/lootboxsilver.lua b/units/other/lootboxes/lootboxsilver.lua index d3d9b75b0d1..6313cd60b2e 100644 --- a/units/other/lootboxes/lootboxsilver.lua +++ b/units/other/lootboxes/lootboxsilver.lua @@ -50,7 +50,7 @@ return { reclaimable = false, customparams = { fall_damage_multiplier = 0, - unitgroup = 'energy', + unitgroup = "energy", normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", paratrooper = true, diff --git a/units/other/lootboxes/lootdroppod_gold.lua b/units/other/lootboxes/lootdroppod_gold.lua index 173870a3b0b..f0143af574b 100644 --- a/units/other/lootboxes/lootdroppod_gold.lua +++ b/units/other/lootboxes/lootdroppod_gold.lua @@ -40,7 +40,7 @@ return { workertime = 1500, yardmap = "", customparams = { - unitgroup = 'builder', + unitgroup = "builder", isairbase = true, normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", diff --git a/units/other/lootboxes/lootdroppod_printer.lua b/units/other/lootboxes/lootdroppod_printer.lua index e3dca9dd593..39b106a8983 100644 --- a/units/other/lootboxes/lootdroppod_printer.lua +++ b/units/other/lootboxes/lootdroppod_printer.lua @@ -40,7 +40,7 @@ return { workertime = 1500, yardmap = "", customparams = { - unitgroup = 'builder', + unitgroup = "builder", isairbase = true, normaltex = "unittextures/cor_normal.dds", subfolder = "other/lootboxes", diff --git a/units/other/raptors/Brood/raptor_land_swarmer_brood_t2_v1.lua b/units/other/raptors/Brood/raptor_land_swarmer_brood_t2_v1.lua index e58b58d4a67..57f347c8cbc 100644 --- a/units/other/raptors/Brood/raptor_land_swarmer_brood_t2_v1.lua +++ b/units/other/raptors/Brood/raptor_land_swarmer_brood_t2_v1.lua @@ -89,7 +89,7 @@ return { range = 200, reloadtime = 1, soundstart = "smallraptorattack", - + tolerance = 5000, turret = true, waterweapon = true, diff --git a/units/other/raptors/Queens/raptor_queen_easy.lua b/units/other/raptors/Queens/raptor_queen_easy.lua index 71874721ee1..d9590db4c56 100644 --- a/units/other/raptors/Queens/raptor_queen_easy.lua +++ b/units/other/raptors/Queens/raptor_queen_easy.lua @@ -1,9 +1,8 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end - return { raptor_queen_easy = { maxacc = 0.1, @@ -116,7 +115,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 750*playerCountScale, + default = 750 * playerCountScale, }, }, melee = { @@ -144,7 +143,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 3750*playerCountScale, + default = 3750 * playerCountScale, }, }, yellow_missile = { @@ -195,7 +194,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Queens/raptor_queen_epic.lua b/units/other/raptors/Queens/raptor_queen_epic.lua index 1514896f0f7..55a3c6f2af2 100644 --- a/units/other/raptors/Queens/raptor_queen_epic.lua +++ b/units/other/raptors/Queens/raptor_queen_epic.lua @@ -1,9 +1,8 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end - return { raptor_queen_epic = { maxacc = 0.1, @@ -117,7 +116,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 2000*playerCountScale, + default = 2000 * playerCountScale, }, }, melee = { @@ -146,7 +145,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 10000*playerCountScale, + default = 10000 * playerCountScale, }, }, yellow_missile = { @@ -197,7 +196,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Queens/raptor_queen_hard.lua b/units/other/raptors/Queens/raptor_queen_hard.lua index fc30cc68590..fe366e52276 100644 --- a/units/other/raptors/Queens/raptor_queen_hard.lua +++ b/units/other/raptors/Queens/raptor_queen_hard.lua @@ -1,9 +1,8 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end - return { raptor_queen_hard = { maxacc = 0.1, @@ -116,7 +115,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 1250*playerCountScale, + default = 1250 * playerCountScale, }, }, melee = { @@ -145,7 +144,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 6250*playerCountScale, + default = 6250 * playerCountScale, }, }, yellow_missile = { @@ -196,7 +195,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Queens/raptor_queen_normal.lua b/units/other/raptors/Queens/raptor_queen_normal.lua index e907232d03a..f5f8bf1ce7b 100644 --- a/units/other/raptors/Queens/raptor_queen_normal.lua +++ b/units/other/raptors/Queens/raptor_queen_normal.lua @@ -1,9 +1,8 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end - return { raptor_queen_normal = { maxacc = 0.1, @@ -116,7 +115,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 1000*playerCountScale, + default = 1000 * playerCountScale, }, }, melee = { @@ -145,7 +144,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 5000*playerCountScale, + default = 5000 * playerCountScale, }, }, yellow_missile = { @@ -196,7 +195,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Queens/raptor_queen_veryeasy.lua b/units/other/raptors/Queens/raptor_queen_veryeasy.lua index 6ef028a4a0b..0e9714cf1a1 100644 --- a/units/other/raptors/Queens/raptor_queen_veryeasy.lua +++ b/units/other/raptors/Queens/raptor_queen_veryeasy.lua @@ -1,6 +1,6 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end return { @@ -114,7 +114,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 500*playerCountScale, + default = 500 * playerCountScale, }, }, melee = { @@ -142,7 +142,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 2500*playerCountScale, + default = 2500 * playerCountScale, }, }, yellow_missile = { @@ -193,7 +193,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Queens/raptor_queen_veryhard.lua b/units/other/raptors/Queens/raptor_queen_veryhard.lua index 8e1776ddd0c..e8f718e2700 100644 --- a/units/other/raptors/Queens/raptor_queen_veryhard.lua +++ b/units/other/raptors/Queens/raptor_queen_veryhard.lua @@ -1,9 +1,8 @@ local playerCountScale = 1 if Spring.Utilities.Gametype.IsRaptors() then - playerCountScale = (#Spring.GetTeamList() - 2)/8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline + playerCountScale = (#Spring.GetTeamList() - 2) / 8 -- -2 because scavs and gaia shouldn't count, divided by 8 because we use 8 player games as a baseline end - return { raptor_queen_veryhard = { maxacc = 0.1, @@ -116,7 +115,7 @@ return { weapontimer = 0.2, weaponvelocity = 400, damage = { - default = 1500*playerCountScale, + default = 1500 * playerCountScale, }, }, melee = { @@ -145,7 +144,7 @@ return { weapontype = "Cannon", weaponvelocity = 2500, damage = { - default = 7500*playerCountScale, + default = 7500 * playerCountScale, }, }, yellow_missile = { @@ -196,7 +195,7 @@ return { }, damage = { default = 1, - vtol = 1000*playerCountScale, + vtol = 1000 * playerCountScale, }, }, }, diff --git a/units/other/raptors/Structures/raptor_antinuke.lua b/units/other/raptors/Structures/raptor_antinuke.lua index 231a67b5af2..4659b4a7126 100644 --- a/units/other/raptors/Structures/raptor_antinuke.lua +++ b/units/other/raptors/Structures/raptor_antinuke.lua @@ -29,7 +29,7 @@ return { sightdistance = 195, yardmap = "oooo", customparams = { - unitgroup = 'antinuke', + unitgroup = "antinuke", model_author = "Mr Bob", normaltex = "unittextures/chicken_l_normals.png", removestop = true, diff --git a/units/other/raptors/raptor_air_gunship_acid_t2_v1.lua b/units/other/raptors/raptor_air_gunship_acid_t2_v1.lua index d63d223f9ce..9b19eb15b71 100644 --- a/units/other/raptors/raptor_air_gunship_acid_t2_v1.lua +++ b/units/other/raptors/raptor_air_gunship_acid_t2_v1.lua @@ -58,7 +58,7 @@ return { wingangle = 0.06593, wingdrag = 0.835, workertime = 0, - hoverAttack = true, + hoverAttack = true, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/raptor_air_gunship_antiair_t2_v1.lua b/units/other/raptors/raptor_air_gunship_antiair_t2_v1.lua index 76b6993ef2a..adfa7397d64 100644 --- a/units/other/raptors/raptor_air_gunship_antiair_t2_v1.lua +++ b/units/other/raptors/raptor_air_gunship_antiair_t2_v1.lua @@ -58,7 +58,7 @@ return { wingangle = 0.06593, wingdrag = 0.835, workertime = 0, - hoverAttack = true, + hoverAttack = true, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/raptor_air_gunship_basic_t2_v1.lua b/units/other/raptors/raptor_air_gunship_basic_t2_v1.lua index 17a027a9f93..fe17c71c108 100644 --- a/units/other/raptors/raptor_air_gunship_basic_t2_v1.lua +++ b/units/other/raptors/raptor_air_gunship_basic_t2_v1.lua @@ -58,7 +58,7 @@ return { wingangle = 0.06593, wingdrag = 0.835, workertime = 0, - hoverAttack = true, + hoverAttack = true, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/raptor_air_gunship_emp_t2_v1.lua b/units/other/raptors/raptor_air_gunship_emp_t2_v1.lua index 36fd2550b3c..8f79590408f 100644 --- a/units/other/raptors/raptor_air_gunship_emp_t2_v1.lua +++ b/units/other/raptors/raptor_air_gunship_emp_t2_v1.lua @@ -58,7 +58,7 @@ return { wingangle = 0.06593, wingdrag = 0.835, workertime = 0, - hoverAttack = true, + hoverAttack = true, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/raptor_air_gunship_fire_t2_v1.lua b/units/other/raptors/raptor_air_gunship_fire_t2_v1.lua index 1423205d8b1..41e9e414528 100644 --- a/units/other/raptors/raptor_air_gunship_fire_t2_v1.lua +++ b/units/other/raptors/raptor_air_gunship_fire_t2_v1.lua @@ -58,7 +58,7 @@ return { wingangle = 0.06593, wingdrag = 0.835, workertime = 0, - hoverAttack = true, + hoverAttack = true, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/volcano_projectile_unit.lua b/units/other/volcano_projectile_unit.lua index 7818db6358f..0041a050ad0 100644 --- a/units/other/volcano_projectile_unit.lua +++ b/units/other/volcano_projectile_unit.lua @@ -11,7 +11,7 @@ return { -------------------------------------------------------------------------- -- REQUIRED BY BAR (DO NOT REMOVE) -------------------------------------------------------------------------- - customparams = { + customparams = { faction = "NONE", is_volcano_launcher = 1, }, @@ -19,104 +19,103 @@ return { -------------------------------------------------------------------------- -- Give it non-zero power (prevents XP / division warnings) -------------------------------------------------------------------------- - metalcost = 100, - energycost = 100, - buildtime = 1, - health = 1000000, - power = 1, + metalcost = 100, + energycost = 100, + buildtime = 1, + health = 1000000, + power = 1, -------------------------------------------------------------------------- -- No wreckage -------------------------------------------------------------------------- - corpse = "", - leavetracks = false, + corpse = "", + leavetracks = false, -------------------------------------------------------------------------- -- Real combat unit (engine requirement) -------------------------------------------------------------------------- - canmove = true, - movementclass = "BOT3", - speed = 0.0001, + canmove = true, + movementclass = "BOT3", + speed = 0.0001, - canattack = true, - canattackground = true, - category = "SURFACE", + canattack = true, + canattackground = true, + category = "SURFACE", -------------------------------------------------------------------------- -- Invisible & non-interactive -------------------------------------------------------------------------- - drawtype = 0, - selectable = false, - blocking = false, - yardmap = "o", + drawtype = 0, + selectable = false, + blocking = false, + yardmap = "o", - canstop = false, - canpatrol = false, - canrepeat = false, + canstop = false, + canpatrol = false, + canrepeat = false, -- invisible in-game without removing the model/script pipeline - initcloaked = true, - cloakcost = 0, - cloakcostmoving = 0, + initcloaked = true, + cloakcost = 0, + cloakcostmoving = 0, mincloakdistance = 0, - stealth = true, - sonarstealth = true, + stealth = true, + sonarstealth = true, -------------------------------------------------------------------------- -- Known-good firing pipeline -------------------------------------------------------------------------- - objectname = "Units/CORTHUD.s3o", - script = "Units/CORTHUD.cob", + objectname = "Units/CORTHUD.s3o", + script = "Units/CORTHUD.cob", - footprintx = 2, - footprintz = 2, + footprintx = 2, + footprintz = 2, - sightdistance = 0, - radardistance = 0, + sightdistance = 0, + radardistance = 0, seismicsignature = 0, -------------------------------------------------------------------------------- -- WEAPON -------------------------------------------------------------------------------- - weapondefs = { + weapondefs = { volcano_fireball = { - name = "Volcano Fireball", - weapontype = "Cannon", + name = "Volcano Fireball", + weapontype = "Cannon", - model = "Raptors/greyrock2.s3o", - cegtag = "volcano_rock_trail", + model = "Raptors/greyrock2.s3o", + cegtag = "volcano_rock_trail", explosiongenerator = "custom:volcano_rock_impact", - gravityaffected = true, - hightrajectory = 1, - trajectoryheight = 1.1, - mygravity = 0.16, - - range = 32000, - reloadtime = 5, - weaponvelocity = 780, - impulsefactor = 3, - impulseboost = 400, - turret = true, - tolerance = 5000, - areaofeffect = 220, - edgeeffectiveness = 0.9, - - collideground = true, - avoidfriendly = false, - avoidfeature = false, - - soundhit = "xplolrg1", - soundhitvolume = 75, - - damage = { + gravityaffected = true, + hightrajectory = 1, + trajectoryheight = 1.1, + mygravity = 0.16, + + range = 32000, + reloadtime = 5, + weaponvelocity = 780, + impulsefactor = 3, + impulseboost = 400, + turret = true, + tolerance = 5000, + areaofeffect = 220, + edgeeffectiveness = 0.9, + + collideground = true, + avoidfriendly = false, + avoidfeature = false, + + soundhit = "xplolrg1", + soundhitvolume = 75, + + damage = { default = 100, }, - }, }, - weapons = { + weapons = { [1] = { def = "VOLCANO_FIREBALL", onlyTargetCategory = "SURFACE", diff --git a/unittextures/decals/unitaoplates_atlas.lua b/unittextures/decals/unitaoplates_atlas.lua index 68d21254f41..d53bea8ed3e 100644 --- a/unittextures/decals/unitaoplates_atlas.lua +++ b/unittextures/decals/unitaoplates_atlas.lua @@ -1,215 +1,234 @@ -- This file has been automatically generated by texture_atlas_builder.ipynb -- Do not edit this file! --- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size +-- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size local atlas = { atlasimage = "unittextures/decals/unitaoplates_atlas.dds", width = 2048, height = 2048, - flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end , - pad = function(t,p) for k,v in pairs(t) do if type(v) == "table" then p = p or 0.5; local px,py = p/t.width, p/t.height; v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py end end end , - getUVCoords = function(t, name) if t[name] then return t[name][1], t[name][2], t[name][3], t[name][4] else return 0,1,0,1 end end , - ["unittextures/decals/armaap_aoplane.dds"] = {0.125,0.1875,0.75,0.8125,128,128}, - ["unittextures/decals/armadvsol_aoplane.dds"] = {0.125,0.1875,0.6875,0.75,128,128}, - ["unittextures/decals/armafus_aoplane.dds"] = {0.125,0.1875,0.625,0.6875,128,128}, - ["unittextures/decals/armageo_aoplane.dds"] = {0.125,0.1875,0.5625,0.625,128,128}, - ["unittextures/decals/armalab_aoplane.dds"] = {0.125,0.1875,0.5,0.5625,128,128}, - ["unittextures/decals/armamb_aoplane.dds"] = {0.125,0.1875,0.4375,0.5,128,128}, - ["unittextures/decals/armamd_aoplane.dds"] = {0.125,0.1875,0.375,0.4375,128,128}, - ["unittextures/decals/armamex_aoplane.dds"] = {0.125,0.1875,0.3125,0.375,128,128}, - ["unittextures/decals/armamsub_aoplane.dds"] = {0.125,0.1875,0.25,0.3125,128,128}, - ["unittextures/decals/armanni_aoplane.dds"] = {0.125,0.1875,0.1875,0.25,128,128}, - ["unittextures/decals/armannit3_aoplane.dds"] = {0.1875,0.25,0.9375,1.0,128,128}, - ["unittextures/decals/armap_aoplane.dds"] = {0.1875,0.25,0.875,0.9375,128,128}, - ["unittextures/decals/armapt3_aoplane.dds"] = {0.1875,0.25,0.8125,0.875,128,128}, - ["unittextures/decals/armarad_aoplane.dds"] = {0.1875,0.25,0.75,0.8125,128,128}, - ["unittextures/decals/armason_aoplane.dds"] = {0.1875,0.25,0.6875,0.75,128,128}, - ["unittextures/decals/armasp_aoplane.dds"] = {0.1875,0.25,0.625,0.6875,128,128}, - ["unittextures/decals/armavp_aoplane.dds"] = {0.1875,0.25,0.5625,0.625,128,128}, - ["unittextures/decals/armbeamer_aoplane.dds"] = {0.1875,0.25,0.5,0.5625,128,128}, - ["unittextures/decals/armbotrail_aoplane.dds"] = {0.1875,0.25,0.4375,0.5,128,128}, - ["unittextures/decals/armbrtha_aoplane.dds"] = {0.1875,0.25,0.375,0.4375,128,128}, - ["unittextures/decals/armcir_aoplane.dds"] = {0.1875,0.25,0.3125,0.375,128,128}, - ["unittextures/decals/armclaw_aoplane.dds"] = {0.1875,0.25,0.25,0.3125,128,128}, - ["unittextures/decals/armdl_aoplane.dds"] = {0.1875,0.25,0.1875,0.25,128,128}, - ["unittextures/decals/armdrag_aoplane.dds"] = {0.1875,0.25,0.125,0.1875,128,128}, - ["unittextures/decals/armemp_aoplane.dds"] = {0.125,0.1875,0.125,0.1875,128,128}, - ["unittextures/decals/armestor_aoplane.dds"] = {0.25,0.3125,0.9375,1.0,128,128}, - ["unittextures/decals/armferret_aoplane.dds"] = {0.25,0.3125,0.875,0.9375,128,128}, - ["unittextures/decals/armflak_aoplane.dds"] = {0.25,0.3125,0.8125,0.875,128,128}, - ["unittextures/decals/armfmmm_aoplane.dds"] = {0.25,0.3125,0.75,0.8125,128,128}, - ["unittextures/decals/armfort_aoplane.dds"] = {0.25,0.3125,0.6875,0.75,128,128}, - ["unittextures/decals/armfus_aoplane.dds"] = {0.25,0.3125,0.625,0.6875,128,128}, - ["unittextures/decals/armgate_aoplane.dds"] = {0.875,1.0,0.125,0.25,256,256}, - ["unittextures/decals/armgeo_aoplane.dds"] = {0.25,0.3125,0.5625,0.625,128,128}, - ["unittextures/decals/armgmm_aoplane.dds"] = {0.25,0.3125,0.5,0.5625,128,128}, - ["unittextures/decals/armguard_aoplane.dds"] = {0.25,0.3125,0.4375,0.5,128,128}, - ["unittextures/decals/armhlt_aoplane.dds"] = {0.25,0.3125,0.375,0.4375,128,128}, - ["unittextures/decals/armhp_aoplane.dds"] = {0.25,0.3125,0.3125,0.375,128,128}, - ["unittextures/decals/armjuno_aoplane.dds"] = {0.25,0.3125,0.25,0.3125,128,128}, - ["unittextures/decals/armlab_aoplane.dds"] = {0.25,0.3125,0.1875,0.25,128,128}, - ["unittextures/decals/armllt_aoplane.dds"] = {0.3125,0.375,0.9375,1.0,128,128}, - ["unittextures/decals/armmakr_aoplane.dds"] = {0.3125,0.375,0.875,0.9375,128,128}, - ["unittextures/decals/armmercury_aoplane.dds"] = {0.3125,0.375,0.8125,0.875,128,128}, - ["unittextures/decals/armmex_aoplane.dds"] = {0.3125,0.375,0.75,0.8125,128,128}, - ["unittextures/decals/armmg_aoplane.dds"] = {0.3125,0.375,0.6875,0.75,128,128}, - ["unittextures/decals/armminivulc_aoplane.dds"] = {0.3125,0.375,0.625,0.6875,128,128}, - ["unittextures/decals/armmmkr_aoplane.dds"] = {0.3125,0.375,0.5625,0.625,128,128}, - ["unittextures/decals/armmoho_aoplane.dds"] = {0.3125,0.375,0.5,0.5625,128,128}, - ["unittextures/decals/armmstor_aoplane.dds"] = {0.3125,0.375,0.4375,0.5,128,128}, - ["unittextures/decals/armnanotc_aoplane.dds"] = {0.3125,0.375,0.375,0.4375,128,128}, - ["unittextures/decals/armpb_aoplane.dds"] = {0.3125,0.375,0.3125,0.375,128,128}, - ["unittextures/decals/armrad_aoplane.dds"] = {0.3125,0.375,0.25,0.3125,128,128}, - ["unittextures/decals/armrl_aoplane.dds"] = {0.3125,0.375,0.1875,0.25,128,128}, - ["unittextures/decals/armsd_aoplane.dds"] = {0.3125,0.375,0.125,0.1875,128,128}, - ["unittextures/decals/armshltx_aoplane.dds"] = {0.25,0.3125,0.125,0.1875,128,128}, - ["unittextures/decals/armsilo_aoplane.dds"] = {0.375,0.4375,0.9375,1.0,128,128}, - ["unittextures/decals/armsolar_aoplane.dds"] = {0.375,0.4375,0.875,0.9375,128,128}, - ["unittextures/decals/armsonar_aoplane.dds"] = {0.375,0.4375,0.8125,0.875,128,128}, - ["unittextures/decals/armtarg_aoplane.dds"] = {0.375,0.4375,0.75,0.8125,128,128}, - ["unittextures/decals/armuwadves_aoplane.dds"] = {0.375,0.4375,0.6875,0.75,128,128}, - ["unittextures/decals/armuwadvms_aoplane.dds"] = {0.375,0.4375,0.625,0.6875,128,128}, - ["unittextures/decals/armuwes_aoplane.dds"] = {0.375,0.4375,0.5625,0.625,128,128}, - ["unittextures/decals/armuwfus_aoplane.dds"] = {0.375,0.4375,0.5,0.5625,128,128}, - ["unittextures/decals/armuwmme_aoplane.dds"] = {0.375,0.4375,0.4375,0.5,128,128}, - ["unittextures/decals/armuwms_aoplane.dds"] = {0.375,0.4375,0.375,0.4375,128,128}, - ["unittextures/decals/armveil_aoplane.dds"] = {0.375,0.4375,0.3125,0.375,128,128}, - ["unittextures/decals/armvp_aoplane.dds"] = {0.375,0.4375,0.25,0.3125,128,128}, - ["unittextures/decals/armvulc_aoplane.dds"] = {0.375,0.4375,0.1875,0.25,128,128}, - ["unittextures/decals/armwin_aoplane.dds"] = {0.4375,0.5,0.9375,1.0,128,128}, - ["unittextures/decals/armwint2_aoplane.dds"] = {0.4375,0.5,0.875,0.9375,128,128}, - ["unittextures/decals/coraap_aoplane.dds"] = {0.4375,0.5,0.8125,0.875,128,128}, - ["unittextures/decals/coradvsol_aoplane.dds"] = {0.4375,0.5,0.75,0.8125,128,128}, - ["unittextures/decals/corafus_aoplane.dds"] = {0.4375,0.5,0.6875,0.75,128,128}, - ["unittextures/decals/corageo_aoplane.dds"] = {0.4375,0.5,0.625,0.6875,128,128}, - ["unittextures/decals/coralab_aoplane.dds"] = {0.4375,0.5,0.5625,0.625,128,128}, - ["unittextures/decals/coramsub_aoplane.dds"] = {0.4375,0.5,0.5,0.5625,128,128}, - ["unittextures/decals/corap_aoplane.dds"] = {0.4375,0.5,0.4375,0.5,128,128}, - ["unittextures/decals/corapt3_aoplane.dds"] = {0.4375,0.5,0.375,0.4375,128,128}, - ["unittextures/decals/corarad_aoplane.dds"] = {0.875,1.0,0.0,0.125,256,256}, - ["unittextures/decals/corason_aoplane.dds"] = {0.4375,0.5,0.3125,0.375,128,128}, - ["unittextures/decals/corasp_aoplane.dds"] = {0.4375,0.5,0.25,0.3125,128,128}, - ["unittextures/decals/coravp_aoplane.dds"] = {0.4375,0.5,0.1875,0.25,128,128}, - ["unittextures/decals/corbhmth_aoplane.dds"] = {0.4375,0.5,0.125,0.1875,128,128}, - ["unittextures/decals/corbuzz_aoplane.dds"] = {0.375,0.4375,0.125,0.1875,128,128}, - ["unittextures/decals/cordl_aoplane.dds"] = {0.5,0.5625,0.9375,1.0,128,128}, - ["unittextures/decals/cordoom_aoplane.dds"] = {0.5,0.5625,0.875,0.9375,128,128}, - ["unittextures/decals/cordoomt3_aoplane.dds"] = {0.5,0.5625,0.8125,0.875,128,128}, - ["unittextures/decals/cordrag_aoplane.dds"] = {0.15625,0.1875,0.875,0.90625,64,64}, - ["unittextures/decals/corerad_aoplane.dds"] = {0.5,0.5625,0.75,0.8125,128,128}, - ["unittextures/decals/corestor_aoplane.dds"] = {0.5,0.5625,0.6875,0.75,128,128}, - ["unittextures/decals/corexp_aoplane.dds"] = {0.5,0.5625,0.625,0.6875,128,128}, - ["unittextures/decals/coreyes_aoplane.dds"] = {0.5,0.5625,0.5625,0.625,128,128}, - ["unittextures/decals/corflak_aoplane.dds"] = {0.5,0.5625,0.5,0.5625,128,128}, - ["unittextures/decals/corfmd_aoplane.dds"] = {0.5,0.5625,0.4375,0.5,128,128}, - ["unittextures/decals/corfmmm_aoplane.dds"] = {0.5,0.5625,0.375,0.4375,128,128}, - ["unittextures/decals/corfort_aoplane.dds"] = {0.5,0.5625,0.3125,0.375,128,128}, - ["unittextures/decals/corfus_aoplane.dds"] = {0.5,0.5625,0.25,0.3125,128,128}, - ["unittextures/decals/corgant_aoplane.dds"] = {0.5,0.5625,0.1875,0.25,128,128}, - ["unittextures/decals/corgate_aoplane.dds"] = {0.75,0.875,0.0,0.125,256,256}, - ["unittextures/decals/corgeo_aoplane.dds"] = {0.5625,0.625,0.9375,1.0,128,128}, - ["unittextures/decals/corgol_aoplane.dds"] = {0.15625,0.1875,0.84375,0.875,64,64}, - ["unittextures/decals/corhllt_aoplane.dds"] = {0.5625,0.625,0.875,0.9375,128,128}, - ["unittextures/decals/corhlt_aoplane.dds"] = {0.5625,0.625,0.8125,0.875,128,128}, - ["unittextures/decals/corhp_aoplane.dds"] = {0.5625,0.625,0.75,0.8125,128,128}, - ["unittextures/decals/corint_aoplane.dds"] = {0.5625,0.625,0.6875,0.75,128,128}, - ["unittextures/decals/corjamt_aoplane.dds"] = {0.5625,0.625,0.625,0.6875,128,128}, - ["unittextures/decals/corjuno_aoplane.dds"] = {0.5625,0.625,0.5625,0.625,128,128}, - ["unittextures/decals/corlab_aoplane.dds"] = {0.5625,0.625,0.5,0.5625,128,128}, - ["unittextures/decals/corllt_aoplane.dds"] = {0.5625,0.625,0.4375,0.5,128,128}, - ["unittextures/decals/cormadsam_aoplane.dds"] = {0.5625,0.625,0.375,0.4375,128,128}, - ["unittextures/decals/cormakr_aoplane.dds"] = {0.5625,0.625,0.3125,0.375,128,128}, - ["unittextures/decals/cormaw_aoplane.dds"] = {0.5625,0.625,0.25,0.3125,128,128}, - ["unittextures/decals/cormex_aoplane.dds"] = {0.5625,0.625,0.1875,0.25,128,128}, - ["unittextures/decals/cormexp_aoplane.dds"] = {0.5625,0.625,0.125,0.1875,128,128}, - ["unittextures/decals/corminibuzz_aoplane.dds"] = {0.5,0.5625,0.125,0.1875,128,128}, - ["unittextures/decals/cormmkr_aoplane.dds"] = {0.625,0.6875,0.9375,1.0,128,128}, - ["unittextures/decals/cormoho_aoplane.dds"] = {0.625,0.6875,0.875,0.9375,128,128}, - ["unittextures/decals/cormstor_aoplane.dds"] = {0.625,0.6875,0.8125,0.875,128,128}, - ["unittextures/decals/cornanotc_aoplane.dds"] = {0.625,0.6875,0.75,0.8125,128,128}, - ["unittextures/decals/corpun_aoplane.dds"] = {0.625,0.6875,0.6875,0.75,128,128}, - ["unittextures/decals/corrad_aoplane.dds"] = {0.625,0.75,0.0,0.125,256,256}, - ["unittextures/decals/corrl_aoplane.dds"] = {0.625,0.6875,0.625,0.6875,128,128}, - ["unittextures/decals/corscreamer_aoplane.dds"] = {0.625,0.6875,0.5625,0.625,128,128}, - ["unittextures/decals/corsd_aoplane.dds"] = {0.625,0.6875,0.5,0.5625,128,128}, - ["unittextures/decals/corshroud_aoplane.dds"] = {0.625,0.6875,0.4375,0.5,128,128}, - ["unittextures/decals/corsilo_aoplane.dds"] = {0.625,0.6875,0.375,0.4375,128,128}, - ["unittextures/decals/corsolar_aoplane.dds"] = {0.625,0.6875,0.3125,0.375,128,128}, - ["unittextures/decals/corsonar_aoplane.dds"] = {0.625,0.6875,0.25,0.3125,128,128}, - ["unittextures/decals/cortarg_aoplane.dds"] = {0.625,0.6875,0.1875,0.25,128,128}, - ["unittextures/decals/cortoast_aoplane.dds"] = {0.6875,0.75,0.9375,1.0,128,128}, - ["unittextures/decals/cortron_aoplane.dds"] = {0.6875,0.75,0.875,0.9375,128,128}, - ["unittextures/decals/coruwadves_aoplane.dds"] = {0.6875,0.75,0.8125,0.875,128,128}, - ["unittextures/decals/coruwadvms_aoplane.dds"] = {0.6875,0.75,0.75,0.8125,128,128}, - ["unittextures/decals/coruwes_aoplane.dds"] = {0.6875,0.75,0.6875,0.75,128,128}, - ["unittextures/decals/coruwfus_aoplane.dds"] = {0.6875,0.75,0.625,0.6875,128,128}, - ["unittextures/decals/coruwmme_aoplane.dds"] = {0.6875,0.75,0.5625,0.625,128,128}, - ["unittextures/decals/coruwms_aoplane.dds"] = {0.6875,0.75,0.5,0.5625,128,128}, - ["unittextures/decals/corvipe_aoplane.dds"] = {0.6875,0.75,0.4375,0.5,128,128}, - ["unittextures/decals/corvp_aoplane.dds"] = {0.6875,0.75,0.375,0.4375,128,128}, - ["unittextures/decals/corwin_aoplane.dds"] = {0.6875,0.75,0.3125,0.375,128,128}, - ["unittextures/decals/corwint2_aoplane.dds"] = {0.6875,0.75,0.25,0.3125,128,128}, - ["unittextures/decals/generic_aoplane.dds"] = {0.6875,0.75,0.1875,0.25,128,128}, - ["unittextures/decals/legaap_aoplane.dds"] = {0.5,0.625,0.0,0.125,256,256}, - ["unittextures/decals/legabm_aoplane.dds"] = {0.6875,0.75,0.125,0.1875,128,128}, - ["unittextures/decals/legacluster_aoplane.dds"] = {0.625,0.6875,0.125,0.1875,128,128}, - ["unittextures/decals/legadveconv_aoplane.dds"] = {0.75,0.8125,0.9375,1.0,128,128}, - ["unittextures/decals/legadvestore_aoplane.dds"] = {0.75,0.8125,0.875,0.9375,128,128}, - ["unittextures/decals/legadvsol_aoplane.dds"] = {0.75,0.8125,0.8125,0.875,128,128}, - ["unittextures/decals/legafus_aoplane.dds"] = {0.75,0.8125,0.75,0.8125,128,128}, - ["unittextures/decals/legageo_aoplane.dds"] = {0.75,0.8125,0.6875,0.75,128,128}, - ["unittextures/decals/legajam_aoplane.dds"] = {0.75,0.8125,0.625,0.6875,128,128}, - ["unittextures/decals/legalab_aoplane.dds"] = {0.375,0.5,0.0,0.125,256,256}, - ["unittextures/decals/legamstor_aoplane.dds"] = {0.75,0.8125,0.5625,0.625,128,128}, - ["unittextures/decals/legap_aoplane.dds"] = {0.25,0.375,0.0,0.125,256,256}, - ["unittextures/decals/legarad_aoplane.dds"] = {0.75,0.8125,0.5,0.5625,128,128}, - ["unittextures/decals/legavp_aoplane.dds"] = {0.125,0.25,0.0,0.125,256,256}, - ["unittextures/decals/legbastion_aoplane.dds"] = {0.75,0.8125,0.4375,0.5,128,128}, - ["unittextures/decals/legbombard_aoplane.dds"] = {0.75,0.8125,0.375,0.4375,128,128}, - ["unittextures/decals/legcluster_aoplane.dds"] = {0.75,0.8125,0.3125,0.375,128,128}, - ["unittextures/decals/legdeflector_aoplane.dds"] = {0.75,0.8125,0.25,0.3125,128,128}, - ["unittextures/decals/legdrag_aoplane.dds"] = {0.75,0.8125,0.1875,0.25,128,128}, - ["unittextures/decals/legdtr_aoplane.dds"] = {0.8125,0.875,0.9375,1.0,128,128}, - ["unittextures/decals/legeconv_aoplane.dds"] = {0.8125,0.875,0.875,0.9375,128,128}, - ["unittextures/decals/legestor_aoplane.dds"] = {0.8125,0.875,0.8125,0.875,128,128}, - ["unittextures/decals/legflak_aoplane.dds"] = {0.8125,0.875,0.75,0.8125,128,128}, - ["unittextures/decals/legforti_aoplane.dds"] = {0.8125,0.875,0.6875,0.75,128,128}, - ["unittextures/decals/legfus_aoplane.dds"] = {0.8125,0.875,0.625,0.6875,128,128}, - ["unittextures/decals/leggatet3_aoplane.dds"] = {0.8125,0.875,0.5625,0.625,128,128}, - ["unittextures/decals/leggeo_aoplane.dds"] = {0.8125,0.875,0.5,0.5625,128,128}, - ["unittextures/decals/leghive_aoplane.dds"] = {0.8125,0.875,0.4375,0.5,128,128}, - ["unittextures/decals/leghp_aoplane.dds"] = {0.8125,0.875,0.375,0.4375,128,128}, - ["unittextures/decals/legjam_aoplane.dds"] = {0.8125,0.875,0.3125,0.375,128,128}, - ["unittextures/decals/leglab_aoplane.dds"] = {0.8125,0.875,0.25,0.3125,128,128}, - ["unittextures/decals/leglht_aoplane.dds"] = {0.8125,0.875,0.1875,0.25,128,128}, - ["unittextures/decals/leglraa_aoplane.dds"] = {0.8125,0.875,0.125,0.1875,128,128}, - ["unittextures/decals/leglrpc_aoplane.dds"] = {0.75,0.8125,0.125,0.1875,128,128}, - ["unittextures/decals/leglupara_aoplane.dds"] = {0.875,0.9375,0.9375,1.0,128,128}, - ["unittextures/decals/legmex_aoplane.dds"] = {0.875,0.9375,0.875,0.9375,128,128}, - ["unittextures/decals/legmext15_aoplane.dds"] = {0.875,0.9375,0.8125,0.875,128,128}, - ["unittextures/decals/legmg_aoplane.dds"] = {0.875,0.9375,0.75,0.8125,128,128}, - ["unittextures/decals/legmoho_aoplane.dds"] = {0.875,0.9375,0.6875,0.75,128,128}, - ["unittextures/decals/legmohobp_aoplane.dds"] = {0.875,0.9375,0.625,0.6875,128,128}, - ["unittextures/decals/legmohocon_aoplane.dds"] = {0.875,0.9375,0.5625,0.625,128,128}, - ["unittextures/decals/legmstor_aoplane.dds"] = {0.875,0.9375,0.5,0.5625,128,128}, - ["unittextures/decals/legnanotc_aoplane.dds"] = {0.875,0.9375,0.4375,0.5,128,128}, - ["unittextures/decals/legnanotcbase_aoplane.dds"] = {0.875,0.9375,0.375,0.4375,128,128}, - ["unittextures/decals/legnanotct2_aoplane.dds"] = {0.875,0.9375,0.3125,0.375,128,128}, - ["unittextures/decals/legperdition_aoplane.dds"] = {0.9375,1.0,0.9375,1.0,128,128}, - ["unittextures/decals/legrad_aoplane.dds"] = {0.9375,1.0,0.875,0.9375,128,128}, - ["unittextures/decals/legrampart_aoplane.dds"] = {0.9375,1.0,0.8125,0.875,128,128}, - ["unittextures/decals/legrhapsis_aoplane.dds"] = {0.9375,1.0,0.75,0.8125,128,128}, - ["unittextures/decals/legrl_aoplane.dds"] = {0.9375,1.0,0.6875,0.75,128,128}, - ["unittextures/decals/legsd_aoplane.dds"] = {0.9375,1.0,0.625,0.6875,128,128}, - ["unittextures/decals/legsilo_aoplane.dds"] = {0.9375,1.0,0.5625,0.625,128,128}, - ["unittextures/decals/legsolar_aoplane.dds"] = {0.9375,1.0,0.5,0.5625,128,128}, - ["unittextures/decals/legstarfall_aoplane.dds"] = {0.9375,1.0,0.4375,0.5,128,128}, - ["unittextures/decals/legtarg_aoplane.dds"] = {0.9375,1.0,0.375,0.4375,128,128}, - ["unittextures/decals/legvp_aoplane.dds"] = {0.0,0.125,0.0,0.125,256,256}, - ["unittextures/decals/legwin_aoplane.dds"] = {0.9375,1.0,0.3125,0.375,128,128}, - ["unittextures/decals/legwint2_aoplane.dds"] = {0.9375,1.0,0.25,0.3125,128,128}, - ["unittextures/decals/mission_command_tower_aoplane.dds"] = {0.875,0.9375,0.25,0.3125,128,128}, - ["unittextures/decals/scavdtf_aoplane.dds"] = {0.15625,0.1875,0.8125,0.84375,64,64}, - ["unittextures/decals/scavfort_aoplane.dds"] = {0.125,0.15625,0.8125,0.84375,64,64}, - + flip = function(t) + for k, v in pairs(t) do + if type(v) == "table" then + v[3], v[4] = 1.0 - v[3], 1.0 - v[4] + end + end + end, + pad = function(t, p) + for k, v in pairs(t) do + if type(v) == "table" then + p = p or 0.5 + local px, py = p / t.width, p / t.height + v[1], v[2], v[3], v[4] = v[1] + px, v[2] - px, v[3] + py, v[4] - py + end + end + end, + getUVCoords = function(t, name) + if t[name] then + return t[name][1], t[name][2], t[name][3], t[name][4] + else + return 0, 1, 0, 1 + end + end, + ["unittextures/decals/armaap_aoplane.dds"] = { 0.125, 0.1875, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/armadvsol_aoplane.dds"] = { 0.125, 0.1875, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/armafus_aoplane.dds"] = { 0.125, 0.1875, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/armageo_aoplane.dds"] = { 0.125, 0.1875, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/armalab_aoplane.dds"] = { 0.125, 0.1875, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/armamb_aoplane.dds"] = { 0.125, 0.1875, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/armamd_aoplane.dds"] = { 0.125, 0.1875, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/armamex_aoplane.dds"] = { 0.125, 0.1875, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/armamsub_aoplane.dds"] = { 0.125, 0.1875, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/armanni_aoplane.dds"] = { 0.125, 0.1875, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/armannit3_aoplane.dds"] = { 0.1875, 0.25, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/armap_aoplane.dds"] = { 0.1875, 0.25, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/armapt3_aoplane.dds"] = { 0.1875, 0.25, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/armarad_aoplane.dds"] = { 0.1875, 0.25, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/armason_aoplane.dds"] = { 0.1875, 0.25, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/armasp_aoplane.dds"] = { 0.1875, 0.25, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/armavp_aoplane.dds"] = { 0.1875, 0.25, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/armbeamer_aoplane.dds"] = { 0.1875, 0.25, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/armbotrail_aoplane.dds"] = { 0.1875, 0.25, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/armbrtha_aoplane.dds"] = { 0.1875, 0.25, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/armcir_aoplane.dds"] = { 0.1875, 0.25, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/armclaw_aoplane.dds"] = { 0.1875, 0.25, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/armdl_aoplane.dds"] = { 0.1875, 0.25, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/armdrag_aoplane.dds"] = { 0.1875, 0.25, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/armemp_aoplane.dds"] = { 0.125, 0.1875, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/armestor_aoplane.dds"] = { 0.25, 0.3125, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/armferret_aoplane.dds"] = { 0.25, 0.3125, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/armflak_aoplane.dds"] = { 0.25, 0.3125, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/armfmmm_aoplane.dds"] = { 0.25, 0.3125, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/armfort_aoplane.dds"] = { 0.25, 0.3125, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/armfus_aoplane.dds"] = { 0.25, 0.3125, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/armgate_aoplane.dds"] = { 0.875, 1.0, 0.125, 0.25, 256, 256 }, + ["unittextures/decals/armgeo_aoplane.dds"] = { 0.25, 0.3125, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/armgmm_aoplane.dds"] = { 0.25, 0.3125, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/armguard_aoplane.dds"] = { 0.25, 0.3125, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/armhlt_aoplane.dds"] = { 0.25, 0.3125, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/armhp_aoplane.dds"] = { 0.25, 0.3125, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/armjuno_aoplane.dds"] = { 0.25, 0.3125, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/armlab_aoplane.dds"] = { 0.25, 0.3125, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/armllt_aoplane.dds"] = { 0.3125, 0.375, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/armmakr_aoplane.dds"] = { 0.3125, 0.375, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/armmercury_aoplane.dds"] = { 0.3125, 0.375, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/armmex_aoplane.dds"] = { 0.3125, 0.375, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/armmg_aoplane.dds"] = { 0.3125, 0.375, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/armminivulc_aoplane.dds"] = { 0.3125, 0.375, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/armmmkr_aoplane.dds"] = { 0.3125, 0.375, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/armmoho_aoplane.dds"] = { 0.3125, 0.375, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/armmstor_aoplane.dds"] = { 0.3125, 0.375, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/armnanotc_aoplane.dds"] = { 0.3125, 0.375, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/armpb_aoplane.dds"] = { 0.3125, 0.375, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/armrad_aoplane.dds"] = { 0.3125, 0.375, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/armrl_aoplane.dds"] = { 0.3125, 0.375, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/armsd_aoplane.dds"] = { 0.3125, 0.375, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/armshltx_aoplane.dds"] = { 0.25, 0.3125, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/armsilo_aoplane.dds"] = { 0.375, 0.4375, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/armsolar_aoplane.dds"] = { 0.375, 0.4375, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/armsonar_aoplane.dds"] = { 0.375, 0.4375, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/armtarg_aoplane.dds"] = { 0.375, 0.4375, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/armuwadves_aoplane.dds"] = { 0.375, 0.4375, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/armuwadvms_aoplane.dds"] = { 0.375, 0.4375, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/armuwes_aoplane.dds"] = { 0.375, 0.4375, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/armuwfus_aoplane.dds"] = { 0.375, 0.4375, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/armuwmme_aoplane.dds"] = { 0.375, 0.4375, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/armuwms_aoplane.dds"] = { 0.375, 0.4375, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/armveil_aoplane.dds"] = { 0.375, 0.4375, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/armvp_aoplane.dds"] = { 0.375, 0.4375, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/armvulc_aoplane.dds"] = { 0.375, 0.4375, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/armwin_aoplane.dds"] = { 0.4375, 0.5, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/armwint2_aoplane.dds"] = { 0.4375, 0.5, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/coraap_aoplane.dds"] = { 0.4375, 0.5, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/coradvsol_aoplane.dds"] = { 0.4375, 0.5, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/corafus_aoplane.dds"] = { 0.4375, 0.5, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/corageo_aoplane.dds"] = { 0.4375, 0.5, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/coralab_aoplane.dds"] = { 0.4375, 0.5, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/coramsub_aoplane.dds"] = { 0.4375, 0.5, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/corap_aoplane.dds"] = { 0.4375, 0.5, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/corapt3_aoplane.dds"] = { 0.4375, 0.5, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/corarad_aoplane.dds"] = { 0.875, 1.0, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/corason_aoplane.dds"] = { 0.4375, 0.5, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/corasp_aoplane.dds"] = { 0.4375, 0.5, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/coravp_aoplane.dds"] = { 0.4375, 0.5, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/corbhmth_aoplane.dds"] = { 0.4375, 0.5, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/corbuzz_aoplane.dds"] = { 0.375, 0.4375, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/cordl_aoplane.dds"] = { 0.5, 0.5625, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/cordoom_aoplane.dds"] = { 0.5, 0.5625, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/cordoomt3_aoplane.dds"] = { 0.5, 0.5625, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/cordrag_aoplane.dds"] = { 0.15625, 0.1875, 0.875, 0.90625, 64, 64 }, + ["unittextures/decals/corerad_aoplane.dds"] = { 0.5, 0.5625, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/corestor_aoplane.dds"] = { 0.5, 0.5625, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/corexp_aoplane.dds"] = { 0.5, 0.5625, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/coreyes_aoplane.dds"] = { 0.5, 0.5625, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/corflak_aoplane.dds"] = { 0.5, 0.5625, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/corfmd_aoplane.dds"] = { 0.5, 0.5625, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/corfmmm_aoplane.dds"] = { 0.5, 0.5625, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/corfort_aoplane.dds"] = { 0.5, 0.5625, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/corfus_aoplane.dds"] = { 0.5, 0.5625, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/corgant_aoplane.dds"] = { 0.5, 0.5625, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/corgate_aoplane.dds"] = { 0.75, 0.875, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/corgeo_aoplane.dds"] = { 0.5625, 0.625, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/corgol_aoplane.dds"] = { 0.15625, 0.1875, 0.84375, 0.875, 64, 64 }, + ["unittextures/decals/corhllt_aoplane.dds"] = { 0.5625, 0.625, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/corhlt_aoplane.dds"] = { 0.5625, 0.625, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/corhp_aoplane.dds"] = { 0.5625, 0.625, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/corint_aoplane.dds"] = { 0.5625, 0.625, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/corjamt_aoplane.dds"] = { 0.5625, 0.625, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/corjuno_aoplane.dds"] = { 0.5625, 0.625, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/corlab_aoplane.dds"] = { 0.5625, 0.625, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/corllt_aoplane.dds"] = { 0.5625, 0.625, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/cormadsam_aoplane.dds"] = { 0.5625, 0.625, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/cormakr_aoplane.dds"] = { 0.5625, 0.625, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/cormaw_aoplane.dds"] = { 0.5625, 0.625, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/cormex_aoplane.dds"] = { 0.5625, 0.625, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/cormexp_aoplane.dds"] = { 0.5625, 0.625, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/corminibuzz_aoplane.dds"] = { 0.5, 0.5625, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/cormmkr_aoplane.dds"] = { 0.625, 0.6875, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/cormoho_aoplane.dds"] = { 0.625, 0.6875, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/cormstor_aoplane.dds"] = { 0.625, 0.6875, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/cornanotc_aoplane.dds"] = { 0.625, 0.6875, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/corpun_aoplane.dds"] = { 0.625, 0.6875, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/corrad_aoplane.dds"] = { 0.625, 0.75, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/corrl_aoplane.dds"] = { 0.625, 0.6875, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/corscreamer_aoplane.dds"] = { 0.625, 0.6875, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/corsd_aoplane.dds"] = { 0.625, 0.6875, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/corshroud_aoplane.dds"] = { 0.625, 0.6875, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/corsilo_aoplane.dds"] = { 0.625, 0.6875, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/corsolar_aoplane.dds"] = { 0.625, 0.6875, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/corsonar_aoplane.dds"] = { 0.625, 0.6875, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/cortarg_aoplane.dds"] = { 0.625, 0.6875, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/cortoast_aoplane.dds"] = { 0.6875, 0.75, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/cortron_aoplane.dds"] = { 0.6875, 0.75, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/coruwadves_aoplane.dds"] = { 0.6875, 0.75, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/coruwadvms_aoplane.dds"] = { 0.6875, 0.75, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/coruwes_aoplane.dds"] = { 0.6875, 0.75, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/coruwfus_aoplane.dds"] = { 0.6875, 0.75, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/coruwmme_aoplane.dds"] = { 0.6875, 0.75, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/coruwms_aoplane.dds"] = { 0.6875, 0.75, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/corvipe_aoplane.dds"] = { 0.6875, 0.75, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/corvp_aoplane.dds"] = { 0.6875, 0.75, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/corwin_aoplane.dds"] = { 0.6875, 0.75, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/corwint2_aoplane.dds"] = { 0.6875, 0.75, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/generic_aoplane.dds"] = { 0.6875, 0.75, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/legaap_aoplane.dds"] = { 0.5, 0.625, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/legabm_aoplane.dds"] = { 0.6875, 0.75, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/legacluster_aoplane.dds"] = { 0.625, 0.6875, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/legadveconv_aoplane.dds"] = { 0.75, 0.8125, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/legadvestore_aoplane.dds"] = { 0.75, 0.8125, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/legadvsol_aoplane.dds"] = { 0.75, 0.8125, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/legafus_aoplane.dds"] = { 0.75, 0.8125, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/legageo_aoplane.dds"] = { 0.75, 0.8125, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/legajam_aoplane.dds"] = { 0.75, 0.8125, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/legalab_aoplane.dds"] = { 0.375, 0.5, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/legamstor_aoplane.dds"] = { 0.75, 0.8125, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/legap_aoplane.dds"] = { 0.25, 0.375, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/legarad_aoplane.dds"] = { 0.75, 0.8125, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/legavp_aoplane.dds"] = { 0.125, 0.25, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/legbastion_aoplane.dds"] = { 0.75, 0.8125, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/legbombard_aoplane.dds"] = { 0.75, 0.8125, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/legcluster_aoplane.dds"] = { 0.75, 0.8125, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/legdeflector_aoplane.dds"] = { 0.75, 0.8125, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/legdrag_aoplane.dds"] = { 0.75, 0.8125, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/legdtr_aoplane.dds"] = { 0.8125, 0.875, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/legeconv_aoplane.dds"] = { 0.8125, 0.875, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/legestor_aoplane.dds"] = { 0.8125, 0.875, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/legflak_aoplane.dds"] = { 0.8125, 0.875, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/legforti_aoplane.dds"] = { 0.8125, 0.875, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/legfus_aoplane.dds"] = { 0.8125, 0.875, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/leggatet3_aoplane.dds"] = { 0.8125, 0.875, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/leggeo_aoplane.dds"] = { 0.8125, 0.875, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/leghive_aoplane.dds"] = { 0.8125, 0.875, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/leghp_aoplane.dds"] = { 0.8125, 0.875, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/legjam_aoplane.dds"] = { 0.8125, 0.875, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/leglab_aoplane.dds"] = { 0.8125, 0.875, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/leglht_aoplane.dds"] = { 0.8125, 0.875, 0.1875, 0.25, 128, 128 }, + ["unittextures/decals/leglraa_aoplane.dds"] = { 0.8125, 0.875, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/leglrpc_aoplane.dds"] = { 0.75, 0.8125, 0.125, 0.1875, 128, 128 }, + ["unittextures/decals/leglupara_aoplane.dds"] = { 0.875, 0.9375, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/legmex_aoplane.dds"] = { 0.875, 0.9375, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/legmext15_aoplane.dds"] = { 0.875, 0.9375, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/legmg_aoplane.dds"] = { 0.875, 0.9375, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/legmoho_aoplane.dds"] = { 0.875, 0.9375, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/legmohobp_aoplane.dds"] = { 0.875, 0.9375, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/legmohocon_aoplane.dds"] = { 0.875, 0.9375, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/legmstor_aoplane.dds"] = { 0.875, 0.9375, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/legnanotc_aoplane.dds"] = { 0.875, 0.9375, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/legnanotcbase_aoplane.dds"] = { 0.875, 0.9375, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/legnanotct2_aoplane.dds"] = { 0.875, 0.9375, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/legperdition_aoplane.dds"] = { 0.9375, 1.0, 0.9375, 1.0, 128, 128 }, + ["unittextures/decals/legrad_aoplane.dds"] = { 0.9375, 1.0, 0.875, 0.9375, 128, 128 }, + ["unittextures/decals/legrampart_aoplane.dds"] = { 0.9375, 1.0, 0.8125, 0.875, 128, 128 }, + ["unittextures/decals/legrhapsis_aoplane.dds"] = { 0.9375, 1.0, 0.75, 0.8125, 128, 128 }, + ["unittextures/decals/legrl_aoplane.dds"] = { 0.9375, 1.0, 0.6875, 0.75, 128, 128 }, + ["unittextures/decals/legsd_aoplane.dds"] = { 0.9375, 1.0, 0.625, 0.6875, 128, 128 }, + ["unittextures/decals/legsilo_aoplane.dds"] = { 0.9375, 1.0, 0.5625, 0.625, 128, 128 }, + ["unittextures/decals/legsolar_aoplane.dds"] = { 0.9375, 1.0, 0.5, 0.5625, 128, 128 }, + ["unittextures/decals/legstarfall_aoplane.dds"] = { 0.9375, 1.0, 0.4375, 0.5, 128, 128 }, + ["unittextures/decals/legtarg_aoplane.dds"] = { 0.9375, 1.0, 0.375, 0.4375, 128, 128 }, + ["unittextures/decals/legvp_aoplane.dds"] = { 0.0, 0.125, 0.0, 0.125, 256, 256 }, + ["unittextures/decals/legwin_aoplane.dds"] = { 0.9375, 1.0, 0.3125, 0.375, 128, 128 }, + ["unittextures/decals/legwint2_aoplane.dds"] = { 0.9375, 1.0, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/mission_command_tower_aoplane.dds"] = { 0.875, 0.9375, 0.25, 0.3125, 128, 128 }, + ["unittextures/decals/scavdtf_aoplane.dds"] = { 0.15625, 0.1875, 0.8125, 0.84375, 64, 64 }, + ["unittextures/decals/scavfort_aoplane.dds"] = { 0.125, 0.15625, 0.8125, 0.84375, 64, 64 }, } return atlas diff --git a/unittextures/decals_features/featureaoplates_atlas.lua b/unittextures/decals_features/featureaoplates_atlas.lua index 0444d0ec89a..44b67a59a2a 100644 --- a/unittextures/decals_features/featureaoplates_atlas.lua +++ b/unittextures/decals_features/featureaoplates_atlas.lua @@ -1,692 +1,711 @@ -- This file has been automatically generated by texture_atlas_builder.ipynb -- Do not edit this file! --- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size +-- Note that the UV coordinates are unpadded, if you must avoid bleed then pad it with 0.5/atlas size local atlas = { atlasimage = "unittextures/decals_features/featureaoplates_atlas.dds", width = 3072, height = 3072, - flip = function(t) for k,v in pairs(t) do if type(v) == "table" then v[3], v[4] = 1.0 - v[3], 1.0 - v[4] end end end , - pad = function(t,p) for k,v in pairs(t) do if type(v) == "table" then p = p or 0.5; local px,py = p/t.width, p/t.height; v[1], v[2], v[3], v[4] = v[1] + px, v[2]-px, v[3] + py, v[4] - py end end end , - getUVCoords = function(t, name) if t[name] then return t[name][1], t[name][2], t[name][3], t[name][4] else return 0,1,0,1 end end , - ["unittextures/decals_features/arm1X1A_2_2_aoplane.dds"] = {0.2916666666666667,0.3125,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/arm1X1B_2_2_aoplane.dds"] = {0.2916666666666667,0.3125,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/arm2X2A_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/arm2X2B_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/arm2X2C_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/arm2X2D_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/arm2X2E_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/arm2X2F_3_3_aoplane.dds"] = {0.2916666666666667,0.3125,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/arm3X3A_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/arm3X3B_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/arm3X3C_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/arm3X3D_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/arm3X3E_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/arm3X3F_4_4_aoplane.dds"] = {0.2916666666666667,0.3125,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/arm4X4A_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/arm4X4B_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/arm4X4C_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/arm4X4D_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/arm4X4E_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/arm5X5A_7_7_aoplane.dds"] = {0.2916666666666667,0.3125,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/arm5X5B_7_7_aoplane.dds"] = {0.2916666666666667,0.3125,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/arm5X5C_7_7_aoplane.dds"] = {0.2916666666666667,0.3125,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/arm5X5D_7_7_aoplane.dds"] = {0.2916666666666667,0.3125,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/arm6X6A_8_8_aoplane.dds"] = {0.2916666666666667,0.3125,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/arm6X6B_8_8_aoplane.dds"] = {0.3125,0.3333333333333333,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/arm6X6C_8_8_aoplane.dds"] = {0.3125,0.3333333333333333,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/arm6X6D_8_8_aoplane.dds"] = {0.3125,0.3333333333333333,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/arm7X7A_9_9_aoplane.dds"] = {0.3125,0.3333333333333333,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/arm7X7B_9_9_aoplane.dds"] = {0.3125,0.3333333333333333,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/arm7X7C_9_9_aoplane.dds"] = {0.3125,0.3333333333333333,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/armaak_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/armaap_dead_11_11_aoplane.dds"] = {0.4583333333333333,0.5,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/armaas_dead_6_6_aoplane.dds"] = {0.4583333333333333,0.5,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/armaca_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/armack_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/armacsub_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/armacv_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/armadvsol_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/armafus_dead_9_9_aoplane.dds"] = {0.4583333333333333,0.5,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/armafust3_dead_17_17_aoplane.dds"] = {0.4583333333333333,0.5,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/armageo_dead_9_9_aoplane.dds"] = {0.4583333333333333,0.5,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/armah_dead_3_3_aoplane.dds"] = {0.3125,0.3333333333333333,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/armalab_dead_12_12_aoplane.dds"] = {0.4583333333333333,0.5,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/armamb_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/armamd_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/armamex_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/armamph_dead_6_6_aoplane.dds"] = {0.4583333333333333,0.5,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/armamsub_dead_8_8_aoplane.dds"] = {0.4583333333333333,0.5,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/armanac_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/armanni_dead_11_11_aoplane.dds"] = {0.4583333333333333,0.5,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/armannit3_dead_16_16_aoplane.dds"] = {0.4583333333333333,0.5,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/armantiship_dead_10_10_aoplane.dds"] = {0.4583333333333333,0.5,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/armap_dead_11_11_aoplane.dds"] = {0.4583333333333333,0.5,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/armapt3_dead_21_21_aoplane.dds"] = {0.4583333333333333,0.5,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/armarad_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/armart_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/armaser_dead_7_7_aoplane.dds"] = {0.4583333333333333,0.5,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/armason_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/armasp_dead_10_10_aoplane.dds"] = {0.4583333333333333,0.5,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/armassimilator_dead_11_11_aoplane.dds"] = {0.4583333333333333,0.5,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/armasy_dead_13_13_aoplane.dds"] = {0.4583333333333333,0.5,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/armatl_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/armatlas_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/armavp_dead_11_11_aoplane.dds"] = {0.4583333333333333,0.5,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/armawac_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/armbanth_dead_15_15_aoplane.dds"] = {0.4583333333333333,0.5,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/armbats_dead_12_12_aoplane.dds"] = {0.4583333333333333,0.5,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/armbeamer_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/armbeaver_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/armblade_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/armbrawl_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/armbrtha_dead_10_10_aoplane.dds"] = {0.5,0.5416666666666666,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/armbull_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/armca_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/armcarry_dead_12_12_aoplane.dds"] = {0.5,0.5416666666666666,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/armch_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/armcir_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/armck_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/armckfus_dead_8_8_aoplane.dds"] = {0.5,0.5416666666666666,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/armclaw_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/armcom_dead_8_8_aoplane.dds"] = {0.5,0.5416666666666666,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/armcomboss_dead_23_23_aoplane.dds"] = {0.5,0.5416666666666666,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/armconsul_dead_3_3_aoplane.dds"] = {0.3125,0.3333333333333333,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/armcroc_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/armcrus_dead_9_9_aoplane.dds"] = {0.5,0.5416666666666666,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/armcs_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/armcsa_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/armcv_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/armdecade_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/armdecadet3_dead_12_12_aoplane.dds"] = {0.5,0.5416666666666666,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/armdfly_dead_8_8_aoplane.dds"] = {0.5,0.5416666666666666,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/armdl_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/armdronecarry_dead_14_14_aoplane.dds"] = {0.5,0.5416666666666666,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/armemp_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/armepoch_dead_15_15_aoplane.dds"] = {0.5,0.5416666666666666,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/armestor_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/armexcalibur_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/armeyes_dead_3_3_aoplane.dds"] = {0.3125,0.3333333333333333,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/armfark_dead_5_5_aoplane.dds"] = {0.3125,0.3333333333333333,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/armfast_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/armfatf_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/armfav_dead_3_3_aoplane.dds"] = {0.3125,0.3333333333333333,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/armfboy_dead_7_7_aoplane.dds"] = {0.5,0.5416666666666666,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/armfdrag_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/armfepocht4_dead_15_15_aoplane.dds"] = {0.5,0.5416666666666666,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/armferret_dead_4_4_aoplane.dds"] = {0.3125,0.3333333333333333,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/armfflak_dead_5_5_aoplane.dds"] = {0.2916666666666667,0.3125,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/armfgate_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/armfhlt_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/armfhp_dead_9_9_aoplane.dds"] = {0.5,0.5416666666666666,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/armfido_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/armfify_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/armfig_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/armflak_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/armflash_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/armflea_dead_3_3_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/armfmkr_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/armfort_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/armfrad_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/armfrock_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/armfrt_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/armfus_dead_8_8_aoplane.dds"] = {0.5,0.5416666666666666,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/armgate_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/armgatet3_dead_8_8_aoplane.dds"] = {0.5,0.5416666666666666,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/armgeo_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/armgmm_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/armgplat_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/armgremlin_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/armguard_dead_6_6_aoplane.dds"] = {0.5,0.5416666666666666,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/armham_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/armhawk_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/armhlt_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/armhp_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/armjam_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/armjamt_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/armjanus_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/armjeth_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/armjuno_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/armkam_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/armkraken_dead_7_7_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/armlab_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/armlance_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/armlatnk_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/armliche_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/armllt_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/armlship_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/armlun_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/armlunchbox_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/armmakr_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/armmanni_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/armmar_dead_9_9_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/armmark_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/armmart_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/armmav_dead_7_7_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/armmeatball_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/armmercury_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/armmerl_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/armmex_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/armmh_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/armminivulc_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/armmls_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/armmlv_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/armmmkr_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/armmmkrt3_dead_10_10_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/armmoho_dead_6_6_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/armmship_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/armmstor_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/armnanotc_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/armnanotcplat_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/armpb_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/armpeep_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/armpincer_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/armplat_dead_8_8_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/armpnix_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/armpship_dead_12_12_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/armpshipt3_dead_22_22_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/armpt_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/armptt2_dead_9_9_aoplane.dds"] = {0.5416666666666666,0.5833333333333334,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/armpw_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/armpwt4_dead_9_9_aoplane.dds"] = {0.5833333333333334,0.625,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/armrad_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/armrattet4_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/armraz_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/armrecl_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/armrectr_dead_4_4_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/armrl_dead_5_5_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/armrock_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/armroy_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/armsaber_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/armsam_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/armsb_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/armscab_dead_7_7_aoplane.dds"] = {0.5833333333333334,0.625,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/armsd_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/armseadragon_dead_10_10_aoplane.dds"] = {0.5833333333333334,0.625,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/armseap_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/armseer_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/armsehak_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/armserp_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/armserpt3_dead_9_9_aoplane.dds"] = {0.5833333333333334,0.625,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/armsfig_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/armsh_dead_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/armshltx_dead_16_16_aoplane.dds"] = {0.5833333333333334,0.625,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/armshockwave_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/armsilo_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/armsjam_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/armsnipe_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/armsolar_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/armsonar_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/armspid_dead_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/armsptk_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/armsptkt4_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/armspy_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/armstil_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/armstump_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/armsub_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/armsubk_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/armsy_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/armtarg_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/armthor_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/armthovr_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/armthund_dead_6_6_aoplane.dds"] = {0.5833333333333334,0.625,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/armtide_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/armtl_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/armtrident_dead_7_7_aoplane.dds"] = {0.5833333333333334,0.625,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/armtship_dead_8_8_aoplane.dds"] = {0.5833333333333334,0.625,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/armuwadves_dead_6_6_aoplane.dds"] = {0.625,0.6666666666666666,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/armuwadvms_dead_7_7_aoplane.dds"] = {0.625,0.6666666666666666,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/armuwes_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/armuwfus_dead_8_8_aoplane.dds"] = {0.625,0.6666666666666666,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/armuwmme_dead_6_6_aoplane.dds"] = {0.625,0.6666666666666666,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/armuwmmm_dead_6_6_aoplane.dds"] = {0.625,0.6666666666666666,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/armuwms_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/armvader_dead_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/armvang_dead_7_7_aoplane.dds"] = {0.625,0.6666666666666666,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/armveil_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/armvp_dead_8_8_aoplane.dds"] = {0.625,0.6666666666666666,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/armvulc_dead_17_17_aoplane.dds"] = {0.625,0.6666666666666666,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/armwar_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/armwin_dead_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/armwint2_dead_9_9_aoplane.dds"] = {0.625,0.6666666666666666,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/armyork_dead_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/armzeus_dead_7_7_aoplane.dds"] = {0.625,0.6666666666666666,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/cor1X1A_2_2_aoplane.dds"] = {0.3541666666666667,0.375,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/cor1X1B_2_2_aoplane.dds"] = {0.3541666666666667,0.375,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/cor2X2A_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/cor2X2B_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/cor2X2C_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/cor2X2D_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/cor2X2E_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/cor2X2F_3_3_aoplane.dds"] = {0.3541666666666667,0.375,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/cor3X3A_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/cor3X3B_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/cor3X3C_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/cor3X3D_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/cor3X3E_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/cor3X3F_4_4_aoplane.dds"] = {0.3541666666666667,0.375,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/cor4X4A_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/cor4X4B_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/cor4X4C_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/cor4X4D_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/cor4X4E_5_5_aoplane.dds"] = {0.3541666666666667,0.375,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/cor5X5A_7_7_aoplane.dds"] = {0.3333333333333333,0.3541666666666667,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/cor5X5B_7_7_aoplane.dds"] = {0.375,0.3958333333333333,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/cor5X5C_7_7_aoplane.dds"] = {0.375,0.3958333333333333,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/cor5X5D_7_7_aoplane.dds"] = {0.375,0.3958333333333333,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/cor6X6A_8_8_aoplane.dds"] = {0.375,0.3958333333333333,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/cor6X6B_8_8_aoplane.dds"] = {0.375,0.3958333333333333,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/cor6X6C_8_8_aoplane.dds"] = {0.375,0.3958333333333333,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/cor6X6D_8_8_aoplane.dds"] = {0.375,0.3958333333333333,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/cor7X7A_9_9_aoplane.dds"] = {0.375,0.3958333333333333,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/cor7X7B_9_9_aoplane.dds"] = {0.375,0.3958333333333333,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/cor7X7C_9_9_aoplane.dds"] = {0.375,0.3958333333333333,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/coraak_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/coraap_dead_10_10_aoplane.dds"] = {0.625,0.6666666666666666,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/coraca_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/corack_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/coracsub_dead_7_7_aoplane.dds"] = {0.625,0.6666666666666666,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/coracv_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/coradvsol_dead_6_6_aoplane.dds"] = {0.625,0.6666666666666666,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/corafus_dead_8_8_aoplane.dds"] = {0.625,0.6666666666666666,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/corafust3_dead_15_15_aoplane.dds"] = {0.625,0.6666666666666666,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/corageo_dead_8_8_aoplane.dds"] = {0.625,0.6666666666666666,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/corah_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/corak_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/corakt4_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/coralab_dead_12_12_aoplane.dds"] = {0.625,0.6666666666666666,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/coramph_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/coramsub_dead_8_8_aoplane.dds"] = {0.625,0.6666666666666666,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/corantiship_dead_12_12_aoplane.dds"] = {0.625,0.6666666666666666,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/corap_dead_9_9_aoplane.dds"] = {0.625,0.6666666666666666,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/corape_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/corapt3_dead_16_16_aoplane.dds"] = {0.625,0.6666666666666666,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/corarad_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/corarch_dead_7_7_aoplane.dds"] = {0.625,0.6666666666666666,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/corason_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/corasp_dead_12_12_aoplane.dds"] = {0.625,0.6666666666666666,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/corasy_dead_14_14_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/coratl_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/coravp_dead_10_10_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/corawac_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/corban_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/corbats_dead_11_11_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/corbhmth_dead_7_7_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/corblackhy_dead_15_15_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/corbuzz_dead_10_10_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/corbw_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/corca_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/corcan_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/corcarry_dead_12_12_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/corcat_dead_7_7_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/corch_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/corck_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/corcom_dead_9_9_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/corcomboss_dead_27_27_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/corcrash_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/corcrus_dead_9_9_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/corcrw_dead_8_8_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/corcrwh_dead_9_9_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/corcs_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/corcsa_dead_6_6_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/corcut_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/corcv_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/cordeadeye_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/cordemon_dead_10_10_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/cordesolator_dead_9_9_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/cordl_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/cordoom_dead_8_8_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/cordoomt3_dead_11_11_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/cordrag_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/cordronecarry_dead_11_11_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/corenaa_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/corerad_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/corestor_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/coresupp_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/coresuppt3_dead_20_20_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/coreter_dead_4_4_aoplane.dds"] = {0.375,0.3958333333333333,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/corexp_dead_5_5_aoplane.dds"] = {0.375,0.3958333333333333,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/coreyes_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/corfast_dead_7_7_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/corfatf_dead_6_6_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/corfav_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/corfblackhyt4_dead_15_15_aoplane.dds"] = {0.6666666666666666,0.7083333333333334,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/corfdoom_dead_9_9_aoplane.dds"] = {0.7083333333333334,0.75,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/corfdrag_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/corfgate_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/corfhlt_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/corfhp_dead_8_8_aoplane.dds"] = {0.7083333333333334,0.75,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/corfink_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/corflak_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/corfmd_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/corfmkr_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/corforge_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/corfort_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/corfrad_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/corfrock_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/corfrt_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/corfship_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/corftiger_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/corfus_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/corgant_dead_15_15_aoplane.dds"] = {0.7083333333333334,0.75,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/corgarp_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/corgate_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/corgatet3_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/corgator_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/corgatreap_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/corgeo_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/corgol_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/corgolt4_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/corgplat_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/corhal_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/corhllllt_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/corhllt_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/corhlt_dead_8_8_aoplane.dds"] = {0.7083333333333334,0.75,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/corhp_dead_8_8_aoplane.dds"] = {0.7083333333333334,0.75,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/corhrk_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/corhunt_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/corhurc_dead_6_6_aoplane.dds"] = {0.7083333333333334,0.75,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/corint_dead_11_11_aoplane.dds"] = {0.7083333333333334,0.75,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/corintr_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/corjamt_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/corjugg_dead_8_8_aoplane.dds"] = {0.7083333333333334,0.75,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/corjuno_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/corkarg_dead_7_7_aoplane.dds"] = {0.7083333333333334,0.75,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/corkarganetht4_dead_10_10_aoplane.dds"] = {0.7083333333333334,0.75,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/corkark_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/corkorg_dead_17_17_aoplane.dds"] = {0.75,0.7916666666666666,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/corlab_dead_8_8_aoplane.dds"] = {0.75,0.7916666666666666,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/corlevlr_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/corlevlrt4_dead_8_8_aoplane.dds"] = {0.75,0.7916666666666666,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/corllt_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/cormabm_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/cormadsam_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/cormakr_dead_3_3_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/cormando_dead_7_7_aoplane.dds"] = {0.75,0.7916666666666666,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/cormart_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/cormaw_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/cormex_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/cormexp_dead_7_7_aoplane.dds"] = {0.75,0.7916666666666666,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/cormh_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/corminibuzz_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/cormist_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/cormls_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/cormlv_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/cormmkr_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/cormmkr_old_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/cormmkrt3_dead_9_9_aoplane.dds"] = {0.75,0.7916666666666666,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/cormoho_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/cormort_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/cormship_dead_8_8_aoplane.dds"] = {0.75,0.7916666666666666,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/cormstor_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/cormuskrat_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/cornanotc_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/cornanotcplat_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/cornecro_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/coronager_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/corparrow_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/corphantom_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/corplat_dead_8_8_aoplane.dds"] = {0.75,0.7916666666666666,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/corprinter_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/corpship_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/corpt_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/corpun_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/corpyro_dead_5_5_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/corrad_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/corraid_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/correap_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/correcl_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/corrl_dead_4_4_aoplane.dds"] = {0.3958333333333333,0.4166666666666667,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/corroach_dead_3_3_aoplane.dds"] = {0.375,0.3958333333333333,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/corroy_dead_7_7_aoplane.dds"] = {0.75,0.7916666666666666,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/corsb_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/corscreamer_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/corsd_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/corseah_dead_9_9_aoplane.dds"] = {0.75,0.7916666666666666,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/corseal_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/corseap_dead_6_6_aoplane.dds"] = {0.75,0.7916666666666666,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/corsent_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/corsentinel_dead_8_8_aoplane.dds"] = {0.75,0.7916666666666666,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/corsfig_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/corsh_dead_3_3_aoplane.dds"] = {0.4166666666666667,0.4375,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/corshad_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/corshark_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/corshiva_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/corshroud_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/corsiegebreaker_dead_7_7_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/corsilo_dead_8_8_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/corsjam_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/corsktl_dead_3_3_aoplane.dds"] = {0.4166666666666667,0.4375,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/corslrpc_dead_17_17_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/corsnap_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/corsok_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/corsolar_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/corsonar_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/corspec_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/corspy_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/corssub_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/corstorm_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/corsub_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/corsumo_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/corsy_dead_8_8_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/cortarg_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/cortermite_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/corthermite_dead_8_8_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/corthovr_dead_9_9_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/corthud_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/cortide_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/cortitan_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/cortl_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/cortoast_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/cortorch_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/cortrem_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/cortron_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/cortship_dead_8_8_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/coruwadves_dead_7_7_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/coruwadvms_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/coruwes_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/coruwfus_dead_7_7_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/coruwmme_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/coruwmmm_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/coruwms_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/corvalk_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/corvamp_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/corveng_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/corvipe_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/corvoyr_dead_6_6_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/corvp_dead_8_8_aoplane.dds"] = {0.7916666666666666,0.8333333333333334,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/corvrad_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/corvroc_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/corwin_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/corwint2_dead_8_8_aoplane.dds"] = {0.8333333333333334,0.875,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/corwolv_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/freefusion_dead_7_7_aoplane.dds"] = {0.8333333333333334,0.875,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/legaap_dead_13_13_aoplane.dds"] = {0.8333333333333334,0.875,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/legabm_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/legaceb_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/legack_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/legacluster_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/legacv_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/legadveconv_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/legadveconvt3_dead_11_11_aoplane.dds"] = {0.8333333333333334,0.875,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/legadvestore_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/legadvsol_dead_8_8_aoplane.dds"] = {0.8333333333333334,0.875,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/legafcv_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/legafus_dead_9_9_aoplane.dds"] = {0.8333333333333334,0.875,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/legafust3_dead_16_16_aoplane.dds"] = {0.8333333333333334,0.875,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/legah_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/legaheattank_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/legajam_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/legalab_dead_13_13_aoplane.dds"] = {0.8333333333333334,0.875,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/legamcluster_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/legamph_dead_7_7_aoplane.dds"] = {0.8333333333333334,0.875,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/legamphtank_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/legamstor_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/legap_dead_8_8_aoplane.dds"] = {0.8333333333333334,0.875,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/legarad_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/legaskirmtank_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/legavjam_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/legavp_dead_13_13_aoplane.dds"] = {0.8333333333333334,0.875,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/legavrad_dead_4_4_aoplane.dds"] = {0.4166666666666667,0.4375,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/legavroc_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/legbal_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/legbar_dead_5_5_aoplane.dds"] = {0.4166666666666667,0.4375,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/legbart_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/legbastion_dead_9_9_aoplane.dds"] = {0.8333333333333334,0.875,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/legbombard_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/legbunk_dead_8_8_aoplane.dds"] = {0.8333333333333334,0.875,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/legcar_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/legcen_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/legch_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/legck_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/legcluster_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/legcom_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/legctl_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.8541666666666666,0.875,64,64}, - ["unittextures/decals_features/legcv_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.8333333333333334,0.8541666666666666,64,64}, - ["unittextures/decals_features/legdeflector_dead_6_6_aoplane.dds"] = {0.8333333333333334,0.875,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/legdrag_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.8125,0.8333333333333334,64,64}, - ["unittextures/decals_features/legdtr_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.7916666666666666,0.8125,64,64}, - ["unittextures/decals_features/legeconv_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.7708333333333334,0.7916666666666666,64,64}, - ["unittextures/decals_features/legeheatraymech_dead_12_12_aoplane.dds"] = {0.875,0.9166666666666666,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/legelrpcmech_dead_12_12_aoplane.dds"] = {0.875,0.9166666666666666,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/legerailtank_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/legeshotgunmech_dead_9_9_aoplane.dds"] = {0.875,0.9166666666666666,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/legestor_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.75,0.7708333333333334,64,64}, - ["unittextures/decals_features/legfhive_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/legflak_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/legfloat_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/legfmg_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/legfrad_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.7291666666666666,0.75,64,64}, - ["unittextures/decals_features/legfrl_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.7083333333333334,0.7291666666666666,64,64}, - ["unittextures/decals_features/legfus_dead_8_8_aoplane.dds"] = {0.875,0.9166666666666666,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/leggat_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.6875,0.7083333333333334,64,64}, - ["unittextures/decals_features/leggatet3_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/leggeo_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/leggob_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.6666666666666666,0.6875,64,64}, - ["unittextures/decals_features/leggobt3_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/leghades_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.6458333333333334,0.6666666666666666,64,64}, - ["unittextures/decals_features/leghelios_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.625,0.6458333333333334,64,64}, - ["unittextures/decals_features/leghive_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.6041666666666666,0.625,64,64}, - ["unittextures/decals_features/leghp_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/leginc_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/leginf_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/leginfestor_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.5833333333333334,0.6041666666666666,64,64}, - ["unittextures/decals_features/legjam_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.5625,0.5833333333333334,64,64}, - ["unittextures/decals_features/legjav_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/legkark_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.5416666666666666,0.5625,64,64}, - ["unittextures/decals_features/legkeres_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/leglab_dead_9_9_aoplane.dds"] = {0.875,0.9166666666666666,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/leglaw_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.5208333333333334,0.5416666666666666,64,64}, - ["unittextures/decals_features/leglht_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.5,0.5208333333333334,64,64}, - ["unittextures/decals_features/leglob_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.4791666666666667,0.5,64,64}, - ["unittextures/decals_features/leglraa_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/leglrpc_dead_8_8_aoplane.dds"] = {0.875,0.9166666666666666,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/leglupara_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.4583333333333333,0.4791666666666667,64,64}, - ["unittextures/decals_features/legmech_dead_8_8_aoplane.dds"] = {0.875,0.9166666666666666,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/legmed_dead_7_7_aoplane.dds"] = {0.875,0.9166666666666666,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/legmex_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.4375,0.4583333333333333,64,64}, - ["unittextures/decals_features/legmext15_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.4166666666666667,0.4375,64,64}, - ["unittextures/decals_features/legmg_dead_6_6_aoplane.dds"] = {0.875,0.9166666666666666,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/legmh_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.3958333333333333,0.4166666666666667,64,64}, - ["unittextures/decals_features/legministarfall_dead_7_7_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/legmlv_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.375,0.3958333333333333,64,64}, - ["unittextures/decals_features/legmoho_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/legmohocon_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/legmrv_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.3541666666666667,0.375,64,64}, - ["unittextures/decals_features/legmstor_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/legner_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.3333333333333333,0.3541666666666667,64,64}, - ["unittextures/decals_features/legotter_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.3125,0.3333333333333333,64,64}, - ["unittextures/decals_features/legpede_dead_18_18_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/legperdition_dead_7_7_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/legphoenix_dead_10_10_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/legrad_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.2916666666666667,0.3125,64,64}, - ["unittextures/decals_features/legrail_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.2708333333333333,0.2916666666666667,64,64}, - ["unittextures/decals_features/legrhapsis_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.25,0.2708333333333333,64,64}, - ["unittextures/decals_features/legrl_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.22916666666666666,0.25,64,64}, - ["unittextures/decals_features/legscout_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.20833333333333334,0.22916666666666666,64,64}, - ["unittextures/decals_features/legsd_dead_7_7_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/legsh_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.1875,0.20833333333333334,64,64}, - ["unittextures/decals_features/legshot_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.16666666666666666,0.1875,64,64}, - ["unittextures/decals_features/legsilo_dead_8_8_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/legsnapper_dead_3_3_aoplane.dds"] = {0.4375,0.4583333333333333,0.14583333333333334,0.16666666666666666,64,64}, - ["unittextures/decals_features/legsolar_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/legsrail_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/legsrailt4_dead_10_10_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/legstarfall_dead_10_10_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/legstr_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/legtarg_dead_7_7_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/legtl_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.125,0.14583333333333334,64,64}, - ["unittextures/decals_features/legvcarry_dead_7_7_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/legvflak_dead_5_5_aoplane.dds"] = {0.4375,0.4583333333333333,0.10416666666666667,0.125,64,64}, - ["unittextures/decals_features/legvp_dead_8_8_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/legwin_dead_4_4_aoplane.dds"] = {0.4375,0.4583333333333333,0.08333333333333333,0.10416666666666667,64,64}, - ["unittextures/decals_features/legwint2_dead_6_6_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/mission_command_tower_dead_11_11_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/pilha_crystal_1_3_3_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_1_aoplane.tga"] = {0.9166666666666666,0.9583333333333334,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_2_5_5_aoplane.dds"] = {0.9166666666666666,0.9583333333333334,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/pilha_crystal_2_aoplane.tga"] = {0.9166666666666666,0.9583333333333334,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/pilha_crystal_3_7_7_aoplane.dds"] = {0.9583333333333334,1.0,0.9583333333333334,1.0,128,128}, - ["unittextures/decals_features/pilha_crystal_3_aoplane.tga"] = {0.9583333333333334,1.0,0.9166666666666666,0.9583333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_blue_1_aoplane.tga"] = {0.9583333333333334,1.0,0.875,0.9166666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_blue_2_aoplane.tga"] = {0.9583333333333334,1.0,0.8333333333333334,0.875,128,128}, - ["unittextures/decals_features/pilha_crystal_blue_3_aoplane.tga"] = {0.9583333333333334,1.0,0.7916666666666666,0.8333333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_green_1_aoplane.tga"] = {0.9583333333333334,1.0,0.75,0.7916666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_green_2_aoplane.tga"] = {0.9583333333333334,1.0,0.7083333333333334,0.75,128,128}, - ["unittextures/decals_features/pilha_crystal_green_3_aoplane.tga"] = {0.9583333333333334,1.0,0.6666666666666666,0.7083333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_lime_1_aoplane.tga"] = {0.9583333333333334,1.0,0.625,0.6666666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_lime_2_aoplane.tga"] = {0.9583333333333334,1.0,0.5833333333333334,0.625,128,128}, - ["unittextures/decals_features/pilha_crystal_lime_3_aoplane.tga"] = {0.9583333333333334,1.0,0.5416666666666666,0.5833333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_obsidian_1_aoplane.tga"] = {0.9583333333333334,1.0,0.5,0.5416666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_obsidian_2_aoplane.tga"] = {0.9583333333333334,1.0,0.4583333333333333,0.5,128,128}, - ["unittextures/decals_features/pilha_crystal_obsidian_3_aoplane.tga"] = {0.9583333333333334,1.0,0.4166666666666667,0.4583333333333333,128,128}, - ["unittextures/decals_features/pilha_crystal_orange_1_aoplane.tga"] = {0.9583333333333334,1.0,0.375,0.4166666666666667,128,128}, - ["unittextures/decals_features/pilha_crystal_orange_2_aoplane.tga"] = {0.9583333333333334,1.0,0.3333333333333333,0.375,128,128}, - ["unittextures/decals_features/pilha_crystal_orange_3_aoplane.tga"] = {0.9583333333333334,1.0,0.2916666666666667,0.3333333333333333,128,128}, - ["unittextures/decals_features/pilha_crystal_quartz_1_aoplane.tga"] = {0.9583333333333334,1.0,0.25,0.2916666666666667,128,128}, - ["unittextures/decals_features/pilha_crystal_quartz_2_aoplane.tga"] = {0.9583333333333334,1.0,0.20833333333333334,0.25,128,128}, - ["unittextures/decals_features/pilha_crystal_quartz_3_aoplane.tga"] = {0.9583333333333334,1.0,0.16666666666666666,0.20833333333333334,128,128}, - ["unittextures/decals_features/pilha_crystal_red_1_aoplane.tga"] = {0.9583333333333334,1.0,0.125,0.16666666666666666,128,128}, - ["unittextures/decals_features/pilha_crystal_red_2_aoplane.tga"] = {0.9583333333333334,1.0,0.08333333333333333,0.125,128,128}, - ["unittextures/decals_features/pilha_crystal_red_3_aoplane.tga"] = {0.9583333333333334,1.0,0.041666666666666664,0.08333333333333333,128,128}, - ["unittextures/decals_features/pilha_crystal_teal_1_aoplane.tga"] = {0.9583333333333334,1.0,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_teal_2_aoplane.tga"] = {0.9166666666666666,0.9583333333333334,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_teal_3_aoplane.tga"] = {0.875,0.9166666666666666,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_team_1_aoplane.tga"] = {0.8333333333333334,0.875,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_team_2_aoplane.tga"] = {0.7916666666666666,0.8333333333333334,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_team_3_aoplane.tga"] = {0.75,0.7916666666666666,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_violet_1_aoplane.tga"] = {0.7083333333333334,0.75,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_violet_2_aoplane.tga"] = {0.6666666666666666,0.7083333333333334,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/pilha_crystal_violet_3_aoplane.tga"] = {0.625,0.6666666666666666,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_01_aoplane.tga"] = {0.4375,0.4583333333333333,0.0625,0.08333333333333333,64,64}, - ["unittextures/decals_features/rocks30_def_02_aoplane.tga"] = {0.4375,0.4583333333333333,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/rocks30_def_03_aoplane.tga"] = {0.4166666666666667,0.4375,0.041666666666666664,0.0625,64,64}, - ["unittextures/decals_features/rocks30_def_04_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/rocks30_def_05_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/rocks30_def_06_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/rocks30_def_07_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/rocks30_def_08_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/rocks30_def_09_aoplane.tga"] = {0.4791666666666667,0.5,0.9791666666666666,1.0,64,64}, - ["unittextures/decals_features/rocks30_def_10_aoplane.tga"] = {0.4791666666666667,0.5,0.9583333333333334,0.9791666666666666,64,64}, - ["unittextures/decals_features/rocks30_def_11_aoplane.tga"] = {0.4791666666666667,0.5,0.9375,0.9583333333333334,64,64}, - ["unittextures/decals_features/rocks30_def_12_aoplane.tga"] = {0.4791666666666667,0.5,0.9166666666666666,0.9375,64,64}, - ["unittextures/decals_features/rocks30_def_13_aoplane.tga"] = {0.4791666666666667,0.5,0.8958333333333334,0.9166666666666666,64,64}, - ["unittextures/decals_features/rocks30_def_14_aoplane.tga"] = {0.4791666666666667,0.5,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/rocks30_def_15_aoplane.tga"] = {0.4583333333333333,0.4791666666666667,0.875,0.8958333333333334,64,64}, - ["unittextures/decals_features/rocks30_def_16_aoplane.tga"] = {0.5833333333333334,0.625,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_17_aoplane.tga"] = {0.5416666666666666,0.5833333333333334,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_18_aoplane.tga"] = {0.5,0.5416666666666666,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_19_aoplane.tga"] = {0.4583333333333333,0.5,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_20_aoplane.tga"] = {0.4166666666666667,0.4583333333333333,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_21_aoplane.tga"] = {0.375,0.4166666666666667,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_22_aoplane.tga"] = {0.3333333333333333,0.375,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_23_aoplane.tga"] = {0.2916666666666667,0.3333333333333333,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_24_aoplane.tga"] = {0.25,0.2916666666666667,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_25_aoplane.tga"] = {0.20833333333333334,0.25,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_26_aoplane.tga"] = {0.16666666666666666,0.20833333333333334,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_27_aoplane.tga"] = {0.125,0.16666666666666666,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_28_aoplane.tga"] = {0.08333333333333333,0.125,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_29_aoplane.tga"] = {0.041666666666666664,0.08333333333333333,0.0,0.041666666666666664,128,128}, - ["unittextures/decals_features/rocks30_def_30_aoplane.tga"] = {0.0,0.041666666666666664,0.0,0.041666666666666664,128,128}, - + flip = function(t) + for k, v in pairs(t) do + if type(v) == "table" then + v[3], v[4] = 1.0 - v[3], 1.0 - v[4] + end + end + end, + pad = function(t, p) + for k, v in pairs(t) do + if type(v) == "table" then + p = p or 0.5 + local px, py = p / t.width, p / t.height + v[1], v[2], v[3], v[4] = v[1] + px, v[2] - px, v[3] + py, v[4] - py + end + end + end, + getUVCoords = function(t, name) + if t[name] then + return t[name][1], t[name][2], t[name][3], t[name][4] + else + return 0, 1, 0, 1 + end + end, + ["unittextures/decals_features/arm1X1A_2_2_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/arm1X1B_2_2_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/arm2X2A_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/arm2X2B_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/arm2X2C_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/arm2X2D_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/arm2X2E_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/arm2X2F_3_3_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/arm3X3A_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/arm3X3B_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/arm3X3C_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/arm3X3D_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/arm3X3E_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/arm3X3F_4_4_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/arm4X4A_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/arm4X4B_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/arm4X4C_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/arm4X4D_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/arm4X4E_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/arm5X5A_7_7_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/arm5X5B_7_7_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/arm5X5C_7_7_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/arm5X5D_7_7_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/arm6X6A_8_8_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/arm6X6B_8_8_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/arm6X6C_8_8_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/arm6X6D_8_8_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/arm7X7A_9_9_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/arm7X7B_9_9_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/arm7X7C_9_9_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/armaak_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/armaap_dead_11_11_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/armaas_dead_6_6_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/armaca_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/armack_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/armacsub_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/armacv_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/armadvsol_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/armafus_dead_9_9_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/armafust3_dead_17_17_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/armageo_dead_9_9_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/armah_dead_3_3_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/armalab_dead_12_12_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/armamb_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/armamd_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/armamex_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/armamph_dead_6_6_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/armamsub_dead_8_8_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/armanac_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/armanni_dead_11_11_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/armannit3_dead_16_16_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/armantiship_dead_10_10_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/armap_dead_11_11_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/armapt3_dead_21_21_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/armarad_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/armart_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/armaser_dead_7_7_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/armason_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/armasp_dead_10_10_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/armassimilator_dead_11_11_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/armasy_dead_13_13_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/armatl_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/armatlas_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/armavp_dead_11_11_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/armawac_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/armbanth_dead_15_15_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/armbats_dead_12_12_aoplane.dds"] = { 0.4583333333333333, 0.5, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/armbeamer_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/armbeaver_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/armblade_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/armbrawl_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/armbrtha_dead_10_10_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/armbull_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/armca_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/armcarry_dead_12_12_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/armch_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/armcir_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/armck_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/armckfus_dead_8_8_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/armclaw_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/armcom_dead_8_8_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/armcomboss_dead_23_23_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/armconsul_dead_3_3_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/armcroc_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/armcrus_dead_9_9_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/armcs_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/armcsa_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/armcv_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/armdecade_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/armdecadet3_dead_12_12_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/armdfly_dead_8_8_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/armdl_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/armdronecarry_dead_14_14_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/armemp_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/armepoch_dead_15_15_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/armestor_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/armexcalibur_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/armeyes_dead_3_3_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/armfark_dead_5_5_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/armfast_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/armfatf_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/armfav_dead_3_3_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/armfboy_dead_7_7_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/armfdrag_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/armfepocht4_dead_15_15_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/armferret_dead_4_4_aoplane.dds"] = { 0.3125, 0.3333333333333333, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/armfflak_dead_5_5_aoplane.dds"] = { 0.2916666666666667, 0.3125, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/armfgate_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/armfhlt_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/armfhp_dead_9_9_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/armfido_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/armfify_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/armfig_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/armflak_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/armflash_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/armflea_dead_3_3_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/armfmkr_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/armfort_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/armfrad_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/armfrock_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/armfrt_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/armfus_dead_8_8_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/armgate_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/armgatet3_dead_8_8_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/armgeo_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/armgmm_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/armgplat_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/armgremlin_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/armguard_dead_6_6_aoplane.dds"] = { 0.5, 0.5416666666666666, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/armham_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/armhawk_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/armhlt_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/armhp_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/armjam_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/armjamt_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/armjanus_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/armjeth_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/armjuno_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/armkam_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/armkraken_dead_7_7_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/armlab_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/armlance_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/armlatnk_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/armliche_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/armllt_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/armlship_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/armlun_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/armlunchbox_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/armmakr_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/armmanni_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/armmar_dead_9_9_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/armmark_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/armmart_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/armmav_dead_7_7_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/armmeatball_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/armmercury_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/armmerl_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/armmex_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/armmh_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/armminivulc_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/armmls_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/armmlv_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/armmmkr_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/armmmkrt3_dead_10_10_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/armmoho_dead_6_6_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/armmship_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/armmstor_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/armnanotc_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/armnanotcplat_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/armpb_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/armpeep_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/armpincer_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/armplat_dead_8_8_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/armpnix_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/armpship_dead_12_12_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/armpshipt3_dead_22_22_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/armpt_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/armptt2_dead_9_9_aoplane.dds"] = { 0.5416666666666666, 0.5833333333333334, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/armpw_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/armpwt4_dead_9_9_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/armrad_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/armrattet4_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/armraz_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/armrecl_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/armrectr_dead_4_4_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/armrl_dead_5_5_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/armrock_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/armroy_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/armsaber_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/armsam_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/armsb_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/armscab_dead_7_7_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/armsd_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/armseadragon_dead_10_10_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/armseap_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/armseer_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/armsehak_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/armserp_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/armserpt3_dead_9_9_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/armsfig_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/armsh_dead_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/armshltx_dead_16_16_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/armshockwave_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/armsilo_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/armsjam_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/armsnipe_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/armsolar_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/armsonar_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/armspid_dead_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/armsptk_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/armsptkt4_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/armspy_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/armstil_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/armstump_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/armsub_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/armsubk_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/armsy_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/armtarg_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/armthor_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/armthovr_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/armthund_dead_6_6_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/armtide_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/armtl_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/armtrident_dead_7_7_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/armtship_dead_8_8_aoplane.dds"] = { 0.5833333333333334, 0.625, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/armuwadves_dead_6_6_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/armuwadvms_dead_7_7_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/armuwes_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/armuwfus_dead_8_8_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/armuwmme_dead_6_6_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/armuwmmm_dead_6_6_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/armuwms_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/armvader_dead_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/armvang_dead_7_7_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/armveil_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/armvp_dead_8_8_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/armvulc_dead_17_17_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/armwar_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/armwin_dead_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/armwint2_dead_9_9_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/armyork_dead_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/armzeus_dead_7_7_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/cor1X1A_2_2_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/cor1X1B_2_2_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/cor2X2A_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/cor2X2B_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/cor2X2C_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/cor2X2D_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/cor2X2E_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/cor2X2F_3_3_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/cor3X3A_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/cor3X3B_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/cor3X3C_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/cor3X3D_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/cor3X3E_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/cor3X3F_4_4_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/cor4X4A_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/cor4X4B_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/cor4X4C_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/cor4X4D_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/cor4X4E_5_5_aoplane.dds"] = { 0.3541666666666667, 0.375, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/cor5X5A_7_7_aoplane.dds"] = { 0.3333333333333333, 0.3541666666666667, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/cor5X5B_7_7_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/cor5X5C_7_7_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/cor5X5D_7_7_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/cor6X6A_8_8_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/cor6X6B_8_8_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/cor6X6C_8_8_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/cor6X6D_8_8_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/cor7X7A_9_9_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/cor7X7B_9_9_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/cor7X7C_9_9_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/coraak_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/coraap_dead_10_10_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/coraca_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/corack_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/coracsub_dead_7_7_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/coracv_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/coradvsol_dead_6_6_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/corafus_dead_8_8_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/corafust3_dead_15_15_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/corageo_dead_8_8_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/corah_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/corak_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/corakt4_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/coralab_dead_12_12_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/coramph_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/coramsub_dead_8_8_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/corantiship_dead_12_12_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/corap_dead_9_9_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/corape_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/corapt3_dead_16_16_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/corarad_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/corarch_dead_7_7_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/corason_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/corasp_dead_12_12_aoplane.dds"] = { 0.625, 0.6666666666666666, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/corasy_dead_14_14_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/coratl_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/coravp_dead_10_10_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/corawac_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/corban_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/corbats_dead_11_11_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/corbhmth_dead_7_7_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/corblackhy_dead_15_15_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/corbuzz_dead_10_10_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/corbw_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/corca_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/corcan_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/corcarry_dead_12_12_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/corcat_dead_7_7_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/corch_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/corck_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/corcom_dead_9_9_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/corcomboss_dead_27_27_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/corcrash_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/corcrus_dead_9_9_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/corcrw_dead_8_8_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/corcrwh_dead_9_9_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/corcs_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/corcsa_dead_6_6_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/corcut_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/corcv_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/cordeadeye_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/cordemon_dead_10_10_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/cordesolator_dead_9_9_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/cordl_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/cordoom_dead_8_8_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/cordoomt3_dead_11_11_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/cordrag_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/cordronecarry_dead_11_11_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/corenaa_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/corerad_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/corestor_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/coresupp_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/coresuppt3_dead_20_20_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/coreter_dead_4_4_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/corexp_dead_5_5_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/coreyes_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/corfast_dead_7_7_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/corfatf_dead_6_6_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/corfav_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/corfblackhyt4_dead_15_15_aoplane.dds"] = { 0.6666666666666666, 0.7083333333333334, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/corfdoom_dead_9_9_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/corfdrag_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/corfgate_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/corfhlt_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/corfhp_dead_8_8_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/corfink_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/corflak_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/corfmd_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/corfmkr_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/corforge_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/corfort_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/corfrad_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/corfrock_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/corfrt_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/corfship_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/corftiger_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/corfus_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/corgant_dead_15_15_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/corgarp_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/corgate_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/corgatet3_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/corgator_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/corgatreap_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/corgeo_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/corgol_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/corgolt4_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/corgplat_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/corhal_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/corhllllt_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/corhllt_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/corhlt_dead_8_8_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/corhp_dead_8_8_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/corhrk_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/corhunt_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/corhurc_dead_6_6_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/corint_dead_11_11_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/corintr_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/corjamt_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/corjugg_dead_8_8_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/corjuno_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/corkarg_dead_7_7_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/corkarganetht4_dead_10_10_aoplane.dds"] = { 0.7083333333333334, 0.75, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/corkark_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/corkorg_dead_17_17_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/corlab_dead_8_8_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/corlevlr_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/corlevlrt4_dead_8_8_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/corllt_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/cormabm_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/cormadsam_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/cormakr_dead_3_3_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/cormando_dead_7_7_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/cormart_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/cormaw_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/cormex_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/cormexp_dead_7_7_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/cormh_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/corminibuzz_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/cormist_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/cormls_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/cormlv_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/cormmkr_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/cormmkr_old_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/cormmkrt3_dead_9_9_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/cormoho_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/cormort_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/cormship_dead_8_8_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/cormstor_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/cormuskrat_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/cornanotc_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/cornanotcplat_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/cornecro_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/coronager_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/corparrow_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/corphantom_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/corplat_dead_8_8_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/corprinter_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/corpship_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/corpt_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/corpun_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/corpyro_dead_5_5_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/corrad_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/corraid_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/correap_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/correcl_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/corrl_dead_4_4_aoplane.dds"] = { 0.3958333333333333, 0.4166666666666667, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/corroach_dead_3_3_aoplane.dds"] = { 0.375, 0.3958333333333333, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/corroy_dead_7_7_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/corsb_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/corscreamer_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/corsd_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/corseah_dead_9_9_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/corseal_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/corseap_dead_6_6_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/corsent_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/corsentinel_dead_8_8_aoplane.dds"] = { 0.75, 0.7916666666666666, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/corsfig_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/corsh_dead_3_3_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/corshad_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/corshark_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/corshiva_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/corshroud_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/corsiegebreaker_dead_7_7_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/corsilo_dead_8_8_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/corsjam_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/corsktl_dead_3_3_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/corslrpc_dead_17_17_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/corsnap_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/corsok_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/corsolar_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/corsonar_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/corspec_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/corspy_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/corssub_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/corstorm_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/corsub_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/corsumo_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/corsy_dead_8_8_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/cortarg_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/cortermite_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/corthermite_dead_8_8_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/corthovr_dead_9_9_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/corthud_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/cortide_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/cortitan_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/cortl_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/cortoast_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/cortorch_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/cortrem_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/cortron_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/cortship_dead_8_8_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/coruwadves_dead_7_7_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/coruwadvms_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/coruwes_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/coruwfus_dead_7_7_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/coruwmme_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/coruwmmm_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/coruwms_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/corvalk_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/corvamp_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/corveng_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/corvipe_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/corvoyr_dead_6_6_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/corvp_dead_8_8_aoplane.dds"] = { 0.7916666666666666, 0.8333333333333334, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/corvrad_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/corvroc_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/corwin_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/corwint2_dead_8_8_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/corwolv_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/freefusion_dead_7_7_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/legaap_dead_13_13_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/legabm_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/legaceb_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/legack_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/legacluster_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/legacv_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/legadveconv_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/legadveconvt3_dead_11_11_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/legadvestore_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/legadvsol_dead_8_8_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/legafcv_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/legafus_dead_9_9_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/legafust3_dead_16_16_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/legah_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/legaheattank_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/legajam_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/legalab_dead_13_13_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/legamcluster_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/legamph_dead_7_7_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/legamphtank_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/legamstor_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/legap_dead_8_8_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/legarad_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/legaskirmtank_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/legavjam_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/legavp_dead_13_13_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/legavrad_dead_4_4_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/legavroc_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/legbal_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/legbar_dead_5_5_aoplane.dds"] = { 0.4166666666666667, 0.4375, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/legbart_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/legbastion_dead_9_9_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/legbombard_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/legbunk_dead_8_8_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/legcar_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/legcen_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/legch_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/legck_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/legcluster_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/legcom_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/legctl_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.8541666666666666, 0.875, 64, 64 }, + ["unittextures/decals_features/legcv_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.8333333333333334, 0.8541666666666666, 64, 64 }, + ["unittextures/decals_features/legdeflector_dead_6_6_aoplane.dds"] = { 0.8333333333333334, 0.875, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/legdrag_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.8125, 0.8333333333333334, 64, 64 }, + ["unittextures/decals_features/legdtr_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.7916666666666666, 0.8125, 64, 64 }, + ["unittextures/decals_features/legeconv_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.7708333333333334, 0.7916666666666666, 64, 64 }, + ["unittextures/decals_features/legeheatraymech_dead_12_12_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/legelrpcmech_dead_12_12_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/legerailtank_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/legeshotgunmech_dead_9_9_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/legestor_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.75, 0.7708333333333334, 64, 64 }, + ["unittextures/decals_features/legfhive_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/legflak_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/legfloat_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/legfmg_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/legfrad_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.7291666666666666, 0.75, 64, 64 }, + ["unittextures/decals_features/legfrl_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.7083333333333334, 0.7291666666666666, 64, 64 }, + ["unittextures/decals_features/legfus_dead_8_8_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/leggat_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.6875, 0.7083333333333334, 64, 64 }, + ["unittextures/decals_features/leggatet3_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/leggeo_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/leggob_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.6666666666666666, 0.6875, 64, 64 }, + ["unittextures/decals_features/leggobt3_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/leghades_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.6458333333333334, 0.6666666666666666, 64, 64 }, + ["unittextures/decals_features/leghelios_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.625, 0.6458333333333334, 64, 64 }, + ["unittextures/decals_features/leghive_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.6041666666666666, 0.625, 64, 64 }, + ["unittextures/decals_features/leghp_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/leginc_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/leginf_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/leginfestor_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.5833333333333334, 0.6041666666666666, 64, 64 }, + ["unittextures/decals_features/legjam_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.5625, 0.5833333333333334, 64, 64 }, + ["unittextures/decals_features/legjav_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/legkark_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.5416666666666666, 0.5625, 64, 64 }, + ["unittextures/decals_features/legkeres_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/leglab_dead_9_9_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/leglaw_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.5208333333333334, 0.5416666666666666, 64, 64 }, + ["unittextures/decals_features/leglht_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.5, 0.5208333333333334, 64, 64 }, + ["unittextures/decals_features/leglob_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.4791666666666667, 0.5, 64, 64 }, + ["unittextures/decals_features/leglraa_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/leglrpc_dead_8_8_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/leglupara_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.4583333333333333, 0.4791666666666667, 64, 64 }, + ["unittextures/decals_features/legmech_dead_8_8_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/legmed_dead_7_7_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/legmex_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.4375, 0.4583333333333333, 64, 64 }, + ["unittextures/decals_features/legmext15_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.4166666666666667, 0.4375, 64, 64 }, + ["unittextures/decals_features/legmg_dead_6_6_aoplane.dds"] = { 0.875, 0.9166666666666666, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/legmh_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.3958333333333333, 0.4166666666666667, 64, 64 }, + ["unittextures/decals_features/legministarfall_dead_7_7_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/legmlv_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.375, 0.3958333333333333, 64, 64 }, + ["unittextures/decals_features/legmoho_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/legmohocon_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/legmrv_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.3541666666666667, 0.375, 64, 64 }, + ["unittextures/decals_features/legmstor_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/legner_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.3333333333333333, 0.3541666666666667, 64, 64 }, + ["unittextures/decals_features/legotter_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.3125, 0.3333333333333333, 64, 64 }, + ["unittextures/decals_features/legpede_dead_18_18_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/legperdition_dead_7_7_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/legphoenix_dead_10_10_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/legrad_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.2916666666666667, 0.3125, 64, 64 }, + ["unittextures/decals_features/legrail_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.2708333333333333, 0.2916666666666667, 64, 64 }, + ["unittextures/decals_features/legrhapsis_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.25, 0.2708333333333333, 64, 64 }, + ["unittextures/decals_features/legrl_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.22916666666666666, 0.25, 64, 64 }, + ["unittextures/decals_features/legscout_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.20833333333333334, 0.22916666666666666, 64, 64 }, + ["unittextures/decals_features/legsd_dead_7_7_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/legsh_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.1875, 0.20833333333333334, 64, 64 }, + ["unittextures/decals_features/legshot_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.16666666666666666, 0.1875, 64, 64 }, + ["unittextures/decals_features/legsilo_dead_8_8_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/legsnapper_dead_3_3_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.14583333333333334, 0.16666666666666666, 64, 64 }, + ["unittextures/decals_features/legsolar_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/legsrail_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/legsrailt4_dead_10_10_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/legstarfall_dead_10_10_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/legstr_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/legtarg_dead_7_7_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/legtl_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.125, 0.14583333333333334, 64, 64 }, + ["unittextures/decals_features/legvcarry_dead_7_7_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/legvflak_dead_5_5_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.10416666666666667, 0.125, 64, 64 }, + ["unittextures/decals_features/legvp_dead_8_8_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/legwin_dead_4_4_aoplane.dds"] = { 0.4375, 0.4583333333333333, 0.08333333333333333, 0.10416666666666667, 64, 64 }, + ["unittextures/decals_features/legwint2_dead_6_6_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/mission_command_tower_dead_11_11_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_1_3_3_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_1_aoplane.tga"] = { 0.9166666666666666, 0.9583333333333334, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_2_5_5_aoplane.dds"] = { 0.9166666666666666, 0.9583333333333334, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_2_aoplane.tga"] = { 0.9166666666666666, 0.9583333333333334, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_3_7_7_aoplane.dds"] = { 0.9583333333333334, 1.0, 0.9583333333333334, 1.0, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.9166666666666666, 0.9583333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_blue_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.875, 0.9166666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_blue_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.8333333333333334, 0.875, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_blue_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.7916666666666666, 0.8333333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_green_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.75, 0.7916666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_green_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.7083333333333334, 0.75, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_green_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.6666666666666666, 0.7083333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_lime_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.625, 0.6666666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_lime_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.5833333333333334, 0.625, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_lime_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.5416666666666666, 0.5833333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_obsidian_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.5, 0.5416666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_obsidian_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.4583333333333333, 0.5, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_obsidian_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.4166666666666667, 0.4583333333333333, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_orange_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.375, 0.4166666666666667, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_orange_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.3333333333333333, 0.375, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_orange_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.2916666666666667, 0.3333333333333333, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_quartz_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.25, 0.2916666666666667, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_quartz_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.20833333333333334, 0.25, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_quartz_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.16666666666666666, 0.20833333333333334, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_red_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.125, 0.16666666666666666, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_red_2_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.08333333333333333, 0.125, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_red_3_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.041666666666666664, 0.08333333333333333, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_teal_1_aoplane.tga"] = { 0.9583333333333334, 1.0, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_teal_2_aoplane.tga"] = { 0.9166666666666666, 0.9583333333333334, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_teal_3_aoplane.tga"] = { 0.875, 0.9166666666666666, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_team_1_aoplane.tga"] = { 0.8333333333333334, 0.875, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_team_2_aoplane.tga"] = { 0.7916666666666666, 0.8333333333333334, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_team_3_aoplane.tga"] = { 0.75, 0.7916666666666666, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_violet_1_aoplane.tga"] = { 0.7083333333333334, 0.75, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_violet_2_aoplane.tga"] = { 0.6666666666666666, 0.7083333333333334, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/pilha_crystal_violet_3_aoplane.tga"] = { 0.625, 0.6666666666666666, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_01_aoplane.tga"] = { 0.4375, 0.4583333333333333, 0.0625, 0.08333333333333333, 64, 64 }, + ["unittextures/decals_features/rocks30_def_02_aoplane.tga"] = { 0.4375, 0.4583333333333333, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/rocks30_def_03_aoplane.tga"] = { 0.4166666666666667, 0.4375, 0.041666666666666664, 0.0625, 64, 64 }, + ["unittextures/decals_features/rocks30_def_04_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/rocks30_def_05_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/rocks30_def_06_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/rocks30_def_07_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/rocks30_def_08_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/rocks30_def_09_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.9791666666666666, 1.0, 64, 64 }, + ["unittextures/decals_features/rocks30_def_10_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.9583333333333334, 0.9791666666666666, 64, 64 }, + ["unittextures/decals_features/rocks30_def_11_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.9375, 0.9583333333333334, 64, 64 }, + ["unittextures/decals_features/rocks30_def_12_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.9166666666666666, 0.9375, 64, 64 }, + ["unittextures/decals_features/rocks30_def_13_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.8958333333333334, 0.9166666666666666, 64, 64 }, + ["unittextures/decals_features/rocks30_def_14_aoplane.tga"] = { 0.4791666666666667, 0.5, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/rocks30_def_15_aoplane.tga"] = { 0.4583333333333333, 0.4791666666666667, 0.875, 0.8958333333333334, 64, 64 }, + ["unittextures/decals_features/rocks30_def_16_aoplane.tga"] = { 0.5833333333333334, 0.625, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_17_aoplane.tga"] = { 0.5416666666666666, 0.5833333333333334, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_18_aoplane.tga"] = { 0.5, 0.5416666666666666, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_19_aoplane.tga"] = { 0.4583333333333333, 0.5, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_20_aoplane.tga"] = { 0.4166666666666667, 0.4583333333333333, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_21_aoplane.tga"] = { 0.375, 0.4166666666666667, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_22_aoplane.tga"] = { 0.3333333333333333, 0.375, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_23_aoplane.tga"] = { 0.2916666666666667, 0.3333333333333333, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_24_aoplane.tga"] = { 0.25, 0.2916666666666667, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_25_aoplane.tga"] = { 0.20833333333333334, 0.25, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_26_aoplane.tga"] = { 0.16666666666666666, 0.20833333333333334, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_27_aoplane.tga"] = { 0.125, 0.16666666666666666, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_28_aoplane.tga"] = { 0.08333333333333333, 0.125, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_29_aoplane.tga"] = { 0.041666666666666664, 0.08333333333333333, 0.0, 0.041666666666666664, 128, 128 }, + ["unittextures/decals_features/rocks30_def_30_aoplane.tga"] = { 0.0, 0.041666666666666664, 0.0, 0.041666666666666664, 128, 128 }, } return atlas diff --git a/weapons/Raptors/emp_death.lua b/weapons/Raptors/emp_death.lua index 38e4def9d20..0843671197c 100644 --- a/weapons/Raptors/emp_death.lua +++ b/weapons/Raptors/emp_death.lua @@ -1,6 +1,5 @@ - unitDeaths = { - raptor_empdeath_small = { -- for armamex + raptor_empdeath_small = { -- for armamex areaofeffect = 150, commandfire = 1, craterboost = 0, @@ -18,10 +17,10 @@ unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - raptor_empdeath_big = { -- for armamex + raptor_empdeath_big = { -- for armamex areaofeffect = 300, commandfire = 1, craterboost = 0, @@ -39,8 +38,8 @@ unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, } -return lowerkeys(unitDeaths) \ No newline at end of file +return lowerkeys(unitDeaths) diff --git a/weapons/Unit_Explosions.lua b/weapons/Unit_Explosions.lua index 60eb810101c..bbf81e409f3 100644 --- a/weapons/Unit_Explosions.lua +++ b/weapons/Unit_Explosions.lua @@ -12,7 +12,7 @@ local unitDeaths = { }, }, - empblast = { -- for armamex + empblast = { -- for armamex areaofeffect = 400, commandfire = 1, craterboost = 0, @@ -30,7 +30,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, pyro = { @@ -45,7 +45,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, pyroselfd = { areaofeffect = 200, @@ -60,7 +60,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, flamethrower = { @@ -75,7 +75,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, flamethrowerSelfd = { areaofeffect = 140, @@ -90,7 +90,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, tidal = { @@ -107,7 +107,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, tidalSelfd = { @@ -124,7 +124,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, nanoboom = { @@ -141,7 +141,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, nanoselfd = { @@ -158,7 +158,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallbuilder = { @@ -173,7 +173,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallbuilderSelfd = { areaofeffect = 120, @@ -187,7 +187,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, windboom = { @@ -203,7 +203,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, metalmaker = { @@ -218,7 +218,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, metalmakerSelfd = { areaofeffect = 260, @@ -232,7 +232,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advmetalmaker = { @@ -248,7 +248,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advmetalmakerSelfd = { areaofeffect = 480, @@ -263,7 +263,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, energystorage = { @@ -278,7 +278,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, energystorageSelfd = { areaofeffect = 520, @@ -292,9 +292,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['energystorage-uw'] = { + ["energystorage-uw"] = { areaofeffect = 420, camerashake = 420, impulsefactor = impulsefactor, @@ -306,9 +306,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['energystorageSelfd-uw'] = { + ["energystorageSelfd-uw"] = { areaofeffect = 520, camerashake = 520, impulsefactor = impulsefactor, @@ -320,7 +320,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advenergystorage = { @@ -336,7 +336,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advenergystorageSelfd = { AreaOfEffect = 768, @@ -351,9 +351,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['advenergystorage-uw'] = { + ["advenergystorage-uw"] = { AreaOfEffect = 480, cameraShake = 480, impulsefactor = impulsefactor, @@ -366,9 +366,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['advenergystorageSelfd-uw'] = { + ["advenergystorageSelfd-uw"] = { AreaOfEffect = 768, cameraShake = 768, impulsefactor = impulsefactor, @@ -381,7 +381,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, geo = { @@ -396,7 +396,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advgeo = { @@ -412,7 +412,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, nukeBuilding = { @@ -428,7 +428,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, nukeBuildingSelfd = { AreaOfEffect = 1280, @@ -443,7 +443,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, nukeSub = { AreaOfEffect = 780, @@ -458,7 +458,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, penetrator = { @@ -473,7 +473,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, penetratorSelfd = { areaofeffect = 520, @@ -487,7 +487,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, deadeyeSelfd = { @@ -502,7 +502,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, bantha = { @@ -518,7 +518,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, banthaSelfd = { areaofeffect = 800, @@ -533,7 +533,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, korgExplosion = { AreaOfEffect = 1280, @@ -548,7 +548,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, korgExplosionSelfd = { AreaOfEffect = 1920, @@ -563,7 +563,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, juggernaut = { areaofeffect = 280, @@ -579,7 +579,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, juggernautSelfd = { areaofeffect = 430, @@ -595,7 +595,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, flagshipExplosion = { @@ -611,7 +611,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, flagshipExplosionSelfd = { AreaOfEffect = 700, @@ -626,10 +626,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - decoycommander = { AreaOfEffect = 48, cameraShake = 48, @@ -642,7 +641,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, decoycommanderSelfd = { AreaOfEffect = 96, @@ -656,7 +655,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, minifusionExplosion = { AreaOfEffect = 320, @@ -671,7 +670,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, fusionExplosion = { AreaOfEffect = 480, @@ -686,7 +685,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, fusionExplosionSelfd = { AreaOfEffect = 768, @@ -701,10 +700,10 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['fusionExplosion-uw'] = { + ["fusionExplosion-uw"] = { AreaOfEffect = 480, cameraShake = 480, impulsefactor = impulsefactor, @@ -717,9 +716,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['fusionExplosionSelfd-uw'] = { + ["fusionExplosionSelfd-uw"] = { AreaOfEffect = 768, cameraShake = 768, impulsefactor = impulsefactor, @@ -732,7 +731,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advancedFusionExplosion = { --this explosion does not generate a distortion effect for unknown reasons @@ -748,7 +747,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, customfusionexplo = { @@ -764,7 +763,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, advancedFusionExplosionSelfd = { @@ -780,7 +779,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, scavcomexplosion = { @@ -796,7 +795,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, ScavComBossExplo = { @@ -813,7 +812,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, --NUKE EXPLOSIONS WITH DAMAGE-- @@ -839,7 +838,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, commanderexplosion = { @@ -863,10 +862,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - --BUILDING DEATHS-- WallExplosionMetal = { @@ -951,7 +949,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, tinyBuildingExplosionGenericSelfd = { AreaOfEffect = 40, @@ -965,9 +963,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyBuildingExplosionGeneric-uw'] = { + ["tinyBuildingExplosionGeneric-uw"] = { AreaOfEffect = 25, cameraShake = 0, impulsefactor = impulsefactor, @@ -979,9 +977,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyBuildingExplosionGenericSelfd-uw'] = { + ["tinyBuildingExplosionGenericSelfd-uw"] = { AreaOfEffect = 40, cameraShake = 0, impulsefactor = impulsefactor, @@ -993,7 +991,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallBuildingExplosionGeneric = { @@ -1008,7 +1006,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallBuildingExplosionGenericSelfd = { AreaOfEffect = 240, @@ -1022,7 +1020,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallMex = { AreaOfEffect = 240, @@ -1036,9 +1034,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallBuildingExplosionGeneric-uw'] = { + ["smallBuildingExplosionGeneric-uw"] = { AreaOfEffect = 180, cameraShake = 180, impulsefactor = impulsefactor, @@ -1050,9 +1048,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallBuildingExplosionGenericSelfd-uw'] = { + ["smallBuildingExplosionGenericSelfd-uw"] = { AreaOfEffect = 240, cameraShake = 240, impulsefactor = impulsefactor, @@ -1064,7 +1062,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, mediumBuildingExplosionGeneric = { @@ -1079,7 +1077,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, mediumBuildingExplosionGenericSelfd = { AreaOfEffect = 360, @@ -1093,9 +1091,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumBuildingExplosionGeneric-uw'] = { + ["mediumBuildingExplosionGeneric-uw"] = { AreaOfEffect = 260, cameraShake = 260, impulsefactor = impulsefactor, @@ -1107,9 +1105,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumBuildingExplosionGenericSelfd-uw'] = { + ["mediumBuildingExplosionGenericSelfd-uw"] = { AreaOfEffect = 360, cameraShake = 360, impulsefactor = impulsefactor, @@ -1121,7 +1119,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, largeBuildingExplosionGeneric = { @@ -1136,7 +1134,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, largeBuildingExplosionGenericSelfd = { AreaOfEffect = 480, @@ -1150,9 +1148,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeBuildingExplosionGeneric-uw'] = { + ["largeBuildingExplosionGeneric-uw"] = { AreaOfEffect = 340, cameraShake = 340, impulsefactor = impulsefactor, @@ -1164,9 +1162,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeBuildingExplosionGenericSelfd-uw'] = { + ["largeBuildingExplosionGenericSelfd-uw"] = { AreaOfEffect = 480, cameraShake = 480, impulsefactor = impulsefactor, @@ -1178,7 +1176,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, hugeBuildingExplosionGeneric = { @@ -1193,7 +1191,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, hugeBuildingExplosionGenericSelfd = { AreaOfEffect = 580, @@ -1207,9 +1205,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeBuildingExplosionGeneric-uw'] = { + ["hugeBuildingExplosionGeneric-uw"] = { AreaOfEffect = 420, cameraShake = 420, impulsefactor = impulsefactor, @@ -1221,9 +1219,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeBuildingExplosionGenericSelfd-uw'] = { + ["hugeBuildingExplosionGenericSelfd-uw"] = { AreaOfEffect = 580, cameraShake = 580, impulsefactor = impulsefactor, @@ -1235,10 +1233,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - --UNIT DEATHS-- tinyExplosionGeneric = { @@ -1253,7 +1250,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, tinyExplosionGenericSelfd = { AreaOfEffect = 44, @@ -1267,9 +1264,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGeneric-builder'] = { + ["tinyExplosionGeneric-builder"] = { AreaOfEffect = 24, cameraShake = 0, impulsefactor = impulsefactor, @@ -1281,9 +1278,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGenericSelfd-builder'] = { + ["tinyExplosionGenericSelfd-builder"] = { AreaOfEffect = 44, cameraShake = 0, impulsefactor = impulsefactor, @@ -1295,9 +1292,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGeneric-uw'] = { + ["tinyExplosionGeneric-uw"] = { AreaOfEffect = 24, cameraShake = 0, impulsefactor = impulsefactor, @@ -1309,9 +1306,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGenericSelfd-uw'] = { + ["tinyExplosionGenericSelfd-uw"] = { AreaOfEffect = 44, cameraShake = 0, impulsefactor = impulsefactor, @@ -1323,9 +1320,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGeneric-phib'] = { + ["tinyExplosionGeneric-phib"] = { AreaOfEffect = 24, cameraShake = 0, impulsefactor = impulsefactor, @@ -1337,9 +1334,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['tinyExplosionGenericSelfd-phib'] = { + ["tinyExplosionGenericSelfd-phib"] = { AreaOfEffect = 44, cameraShake = 0, impulsefactor = impulsefactor, @@ -1351,7 +1348,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallExplosionGenericAir = { @@ -1366,7 +1363,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallExplosionGeneric = { @@ -1381,7 +1378,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, smallExplosionGenericSelfd = { AreaOfEffect = 60, @@ -1395,9 +1392,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGeneric-builder'] = { + ["smallExplosionGeneric-builder"] = { AreaOfEffect = 36, cameraShake = 0, impulsefactor = impulsefactor, @@ -1409,9 +1406,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGenericSelfd-builder'] = { + ["smallExplosionGenericSelfd-builder"] = { AreaOfEffect = 60, cameraShake = 60, impulsefactor = impulsefactor, @@ -1423,9 +1420,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGeneric-uw'] = { + ["smallExplosionGeneric-uw"] = { AreaOfEffect = 36, cameraShake = 0, impulsefactor = impulsefactor, @@ -1437,9 +1434,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGenericSelfd-uw'] = { + ["smallExplosionGenericSelfd-uw"] = { AreaOfEffect = 60, cameraShake = 60, impulsefactor = impulsefactor, @@ -1451,9 +1448,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGeneric-phib'] = { + ["smallExplosionGeneric-phib"] = { AreaOfEffect = 36, cameraShake = 0, impulsefactor = impulsefactor, @@ -1465,9 +1462,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['smallExplosionGenericSelfd-phib'] = { + ["smallExplosionGenericSelfd-phib"] = { AreaOfEffect = 60, cameraShake = 60, impulsefactor = impulsefactor, @@ -1479,7 +1476,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, mediumExplosionGeneric = { @@ -1494,7 +1491,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, mediumExplosionGenericSelfd = { AreaOfEffect = 96, @@ -1508,9 +1505,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGeneric-builder'] = { + ["mediumExplosionGeneric-builder"] = { AreaOfEffect = 48, cameraShake = 48, impulsefactor = impulsefactor, @@ -1522,9 +1519,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGenericSelfd-builder'] = { + ["mediumExplosionGenericSelfd-builder"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1536,9 +1533,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGeneric-uw'] = { + ["mediumExplosionGeneric-uw"] = { AreaOfEffect = 48, cameraShake = 48, impulsefactor = impulsefactor, @@ -1550,9 +1547,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGenericSelfd-uw'] = { + ["mediumExplosionGenericSelfd-uw"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1564,9 +1561,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGeneric-phib'] = { + ["mediumExplosionGeneric-phib"] = { AreaOfEffect = 48, cameraShake = 48, impulsefactor = impulsefactor, @@ -1578,9 +1575,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['mediumExplosionGenericSelfd-phib'] = { + ["mediumExplosionGenericSelfd-phib"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1592,7 +1589,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, largeExplosionGeneric = { @@ -1607,7 +1604,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, largeExplosionGenericSelfd = { AreaOfEffect = 120, @@ -1621,9 +1618,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGeneric-builder'] = { + ["largeExplosionGeneric-builder"] = { AreaOfEffect = 64, cameraShake = 64, impulsefactor = impulsefactor, @@ -1635,9 +1632,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGenericSelfd-builder'] = { + ["largeExplosionGenericSelfd-builder"] = { AreaOfEffect = 120, cameraShake = 120, impulsefactor = impulsefactor, @@ -1649,9 +1646,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGeneric-uw'] = { + ["largeExplosionGeneric-uw"] = { AreaOfEffect = 64, cameraShake = 64, impulsefactor = impulsefactor, @@ -1663,9 +1660,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGenericSelfd-uw'] = { + ["largeExplosionGenericSelfd-uw"] = { AreaOfEffect = 120, cameraShake = 120, impulsefactor = impulsefactor, @@ -1677,9 +1674,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGeneric-phib'] = { + ["largeExplosionGeneric-phib"] = { AreaOfEffect = 64, cameraShake = 64, impulsefactor = impulsefactor, @@ -1691,9 +1688,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['largeExplosionGenericSelfd-phib'] = { + ["largeExplosionGenericSelfd-phib"] = { AreaOfEffect = 120, cameraShake = 120, impulsefactor = impulsefactor, @@ -1705,7 +1702,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, hugeExplosionGeneric = { @@ -1720,7 +1717,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, explosiont3 = { AreaOfEffect = 96, @@ -1734,7 +1731,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, explosiont3med = { AreaOfEffect = 48, @@ -1748,7 +1745,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, explosiont3xl = { AreaOfEffect = 160, @@ -1762,7 +1759,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, explosiont3xxl = { AreaOfEffect = 280, @@ -1776,7 +1773,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, hugeExplosionGenericSelfd = { AreaOfEffect = 160, @@ -1790,9 +1787,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGeneric-builder'] = { + ["hugeExplosionGeneric-builder"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1804,9 +1801,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGenericSelfd-builder'] = { + ["hugeExplosionGenericSelfd-builder"] = { AreaOfEffect = 160, cameraShake = 160, impulsefactor = impulsefactor, @@ -1818,9 +1815,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGeneric-uw'] = { + ["hugeExplosionGeneric-uw"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1832,9 +1829,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGenericSelfd-uw'] = { + ["hugeExplosionGenericSelfd-uw"] = { AreaOfEffect = 160, cameraShake = 160, impulsefactor = impulsefactor, @@ -1846,9 +1843,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGeneric-phib'] = { + ["hugeExplosionGeneric-phib"] = { AreaOfEffect = 96, cameraShake = 96, impulsefactor = impulsefactor, @@ -1860,9 +1857,9 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - ['hugeExplosionGenericSelfd-phib'] = { + ["hugeExplosionGenericSelfd-phib"] = { AreaOfEffect = 160, cameraShake = 160, impulsefactor = impulsefactor, @@ -1874,7 +1871,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, lootboxExplosion1 = { AreaOfEffect = 340, @@ -1888,7 +1885,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, lootboxExplosion2 = { AreaOfEffect = 620, @@ -1902,7 +1899,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, lootboxExplosion3 = { AreaOfEffect = 920, @@ -1916,7 +1913,7 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, lootboxExplosion4 = { AreaOfEffect = 1280, @@ -1930,10 +1927,10 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - mistexplo = { -- for scavmist + mistexplo = { -- for scavmist areaofeffect = 200, craterboost = 0, cratermult = 0, @@ -1951,10 +1948,10 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - mistexploxl = { -- for scavmist + mistexploxl = { -- for scavmist areaofeffect = 350, craterboost = 0, cratermult = 0, @@ -1972,10 +1969,10 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - mistexploxxl = { -- for scavmist + mistexploxxl = { -- for scavmist areaofeffect = 400, craterboost = 0, cratermult = 0, @@ -1993,19 +1990,18 @@ local unitDeaths = { }, customparams = { unitexplosion = 1, - } + }, }, - } local scavengerDefs = {} for name, def in pairs(unitDeaths) do - if string.find(string.lower(name), 'explosiont3') or string.find(string.lower(name), 'explosiongeneric') or string.find(string.lower(name), 'buildingexplosiongeneric') then - scavengerDefs[name .. '-purple'] = table.copy(def) - scavengerDefs[name .. '-purple'].explosiongenerator = scavengerDefs[name .. '-purple'].explosiongenerator .. '-purple' - elseif string.find(def.explosiongenerator, 't3unitexplosion') then - scavengerDefs[name .. '-purple'] = table.copy(def) - scavengerDefs[name .. '-purple'].explosiongenerator = scavengerDefs[name .. '-purple'].explosiongenerator .. '-purple' + if string.find(string.lower(name), "explosiont3") or string.find(string.lower(name), "explosiongeneric") or string.find(string.lower(name), "buildingexplosiongeneric") then + scavengerDefs[name .. "-purple"] = table.copy(def) + scavengerDefs[name .. "-purple"].explosiongenerator = scavengerDefs[name .. "-purple"].explosiongenerator .. "-purple" + elseif string.find(def.explosiongenerator, "t3unitexplosion") then + scavengerDefs[name .. "-purple"] = table.copy(def) + scavengerDefs[name .. "-purple"].explosiongenerator = scavengerDefs[name .. "-purple"].explosiongenerator .. "-purple" end end for name, ud in pairs(scavengerDefs) do diff --git a/weapons/lightning_chain.lua b/weapons/lightning_chain.lua index c6b685c3aee..3a21d890e2a 100644 --- a/weapons/lightning_chain.lua +++ b/weapons/lightning_chain.lua @@ -1,32 +1,32 @@ return { lightning_chain = { areaofeffect = 8, - avoidfeature = false, - beamttl = 1, - craterareaofeffect = 0, - cratermult = 0, - edgeeffectiveness = 0.15, - explosiongenerator = "custom:genericshellexplosion-medium-lightning2", - firestarter = 50, - impactonly = 1, - impulsefactor = 0, - intensity = 0.33, - name = "Close-quarters lightning turret", - noselfdamage = true, - range = 320, - reloadtime = 1.4, - rgbcolor = "0.5 0.5 1", - soundhit = "lashit", - soundhitwet = "sizzle", - soundstart = "lghthvy1", - soundtrigger = true, - thickness = 0.5, - coreThickness = 0.5, - turret = true, - weapontype = "LightningCannon", - weaponvelocity = 400, - damage = { - default = 1, - }, + avoidfeature = false, + beamttl = 1, + craterareaofeffect = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-medium-lightning2", + firestarter = 50, + impactonly = 1, + impulsefactor = 0, + intensity = 0.33, + name = "Close-quarters lightning turret", + noselfdamage = true, + range = 320, + reloadtime = 1.4, + rgbcolor = "0.5 0.5 1", + soundhit = "lashit", + soundhitwet = "sizzle", + soundstart = "lghthvy1", + soundtrigger = true, + thickness = 0.5, + coreThickness = 0.5, + turret = true, + weapontype = "LightningCannon", + weaponvelocity = 400, + damage = { + default = 1, + }, }, -} \ No newline at end of file +} diff --git a/weapons/noweapon.lua b/weapons/noweapon.lua index 889c5307710..c9def22a12c 100644 --- a/weapons/noweapon.lua +++ b/weapons/noweapon.lua @@ -1,8 +1,8 @@ return { noweapon = { - range = 0, + range = 0, damage = { default = 0, }, - }, + }, } diff --git a/weapons/spybombx.lua b/weapons/spybombx.lua index bfa9374b0c3..e5ca8026586 100644 --- a/weapons/spybombx.lua +++ b/weapons/spybombx.lua @@ -5,7 +5,7 @@ return { craterboost = 0, cratermult = 0, customparams = { - paralyzetime_exception = "isBuilding=false:10,customparams.unitgroup=antinuke:20", -- UP TO 10s stun duration for mobile units and 20s for antinukes (depending on hp vs damage) + paralyzetime_exception = "isBuilding=false:10,customparams.unitgroup=antinuke:20", -- UP TO 10s stun duration for mobile units and 20s for antinukes (depending on hp vs damage) }, edgeeffectiveness = 1, explosiongenerator = "custom:genericshellexplosion-huge-lightning", @@ -14,7 +14,7 @@ return { name = "spyexplosion", noselfdamage = 1, paralyzer = 1, - paralyzetime = 20, -- Absolute max stun duration. See customparams for exceptions. + paralyzetime = 20, -- Absolute max stun duration. See customparams for exceptions. range = 1280, reloadtime = 0.3, soundhit = "EMGPULS1",